fusible 0.18.0

Electronic linter: a fuse that blows to block firmware code generation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
var P5o=Object.create;var{getPrototypeOf:E5o,defineProperty:SRe,getOwnPropertyNames:M5o}=Object;var Ryt=Object.prototype.hasOwnProperty;function w5o(e){return this[e]}var B5o,T5o,at=(e,t,n)=>{var o=e!=null&&typeof e==="object";if(o){var r=t?B5o??=new WeakMap:T5o??=new WeakMap,i=r.get(e);if(i)return i}n=e!=null?P5o(E5o(e)):{};let s=t||!e||!e.__esModule||!Ryt.call(e,"default")?SRe(n,"default",{value:e,enumerable:!0}):n;if(e&&typeof e==="object"||typeof e==="function"){for(let a of M5o(e))if(!Ryt.call(s,a))SRe(s,a,{get:w5o.bind(e,a),enumerable:!0})}if(o)r.set(e,s);return s};var pt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var D5o=(e)=>e;function N5o(e,t){this[e]=D5o.bind(null,t)}var IX=(e,t)=>{for(var n in t)SRe(e,n,{get:t[n],enumerable:!0,configurable:!0,set:N5o.bind(t,n)})};var ba=(e,t,n)=>()=>{if(e)try{t=e(e=0)}catch(o){n=[o]}if(n)throw n[0];return t};var vX=((e)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var ln=pt(function(R5o,Wge){(function(){function e(Le,Ze){Object.defineProperty(o.prototype,Le,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",Ze[0],Ze[1])}})}function t(Le){if(Le===null||typeof Le!=="object")return null;return Le=ue&&Le[ue]||Le["@@iterator"],typeof Le==="function"?Le:null}function n(Le,Ze){Le=(Le=Le.constructor)&&(Le.displayName||Le.name)||"ReactClass";var $e=Le+"."+Ze;de[$e]||(console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",Ze,Le),de[$e]=!0)}function o(Le,Ze,$e){this.props=Le,this.context=Ze,this.refs=xe,this.updater=$e||me}function r(){}function i(Le,Ze,$e){this.props=Le,this.context=Ze,this.refs=xe,this.updater=$e||me}function s(){}function a(Le){return""+Le}function c(Le){try{a(Le);var Ze=!1}catch(ft){Ze=!0}if(Ze){Ze=console;var $e=Ze.error,qe=typeof Symbol==="function"&&Symbol.toStringTag&&Le[Symbol.toStringTag]||Le.constructor.name||"Object";return $e.call(Ze,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",qe),a(Le)}}function l(Le){if(Le==null)return null;if(typeof Le==="function")return Le.$$typeof===we?null:Le.displayName||Le.name||null;if(typeof Le==="string")return Le;switch(Le){case Y:return"Fragment";case K:return"Profiler";case X:return"StrictMode";case ne:return"Suspense";case re:return"SuspenseList";case ie:return"Activity";case le:return"ViewTransition"}if(typeof Le==="object")switch(typeof Le.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),Le.$$typeof){case j:return"Portal";case ee:return Le.displayName||"Context";case J:return(Le._context.displayName||"Context")+".Consumer";case se:var Ze=Le.render;return Le=Le.displayName,Le||(Le=Ze.displayName||Ze.name||"",Le=Le!==""?"ForwardRef("+Le+")":"ForwardRef"),Le;case Z:return Ze=Le.displayName||null,Ze!==null?Ze:l(Le.type)||"Memo";case te:Ze=Le._payload,Le=Le._init;try{return l(Le(Ze))}catch($e){}}return null}function h(Le){if(Le===Y)return"<>";if(typeof Le==="object"&&Le!==null&&Le.$$typeof===te)return"<...>";try{var Ze=l(Le);return Ze?"<"+Ze+">":"<...>"}catch($e){return"<...>"}}function d(){var Le=_e.A;return Le===null?null:Le.getOwner()}function u(){return Error("react-stack-top-frame")}function _(Le){if(ye.call(Le,"key")){var Ze=Object.getOwnPropertyDescriptor(Le,"key").get;if(Ze&&Ze.isReactWarning)return!1}return Le.key!==void 0}function p(Le,Ze){function $e(){Ne||(Ne=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",Ze))}$e.isReactWarning=!0,Object.defineProperty(Le,"key",{get:$e,configurable:!0})}function m(){var Le=l(this.type);return nt[Le]||(nt[Le]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),Le=this.props.ref,Le!==void 0?Le:null}function A(Le,Ze,$e,qe,ft,It){var ze=$e.ref;return Le={$$typeof:U,type:Le,key:Ze,props:$e,_owner:qe},(ze!==void 0?ze:null)!==null?Object.defineProperty(Le,"ref",{enumerable:!1,get:m}):Object.defineProperty(Le,"ref",{enumerable:!1,value:null}),Le._store={},Object.defineProperty(Le._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(Le,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(Le,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:ft}),Object.defineProperty(Le,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:It}),Object.freeze&&(Object.freeze(Le.props),Object.freeze(Le)),Le}function g(Le,Ze){return Ze=A(Le.type,Ze,Le.props,Le._owner,Le._debugStack,Le._debugTask),Le._store&&(Ze._store.validated=Le._store.validated),Ze}function f(Le){y(Le)?Le._store&&(Le._store.validated=1):typeof Le==="object"&&Le!==null&&Le.$$typeof===te&&(Le._payload.status==="fulfilled"?y(Le._payload.value)&&Le._payload.value._store&&(Le._payload.value._store.validated=1):Le._store&&(Le._store.validated=1))}function y(Le){return typeof Le==="object"&&Le!==null&&Le.$$typeof===U}function x(Le){var Ze={"=":"=0",":":"=2"};return"$"+Le.replace(/[=:]/g,function($e){return Ze[$e]})}function C(Le,Ze){return typeof Le==="object"&&Le!==null&&Le.key!=null?(c(Le.key),x(""+Le.key)):Ze.toString(36)}function b(Le){switch(Le.status){case"fulfilled":return Le.value;case"rejected":throw Le.reason;default:switch(typeof Le.status==="string"?Le.then(s,s):(Le.status="pending",Le.then(function(Ze){Le.status==="pending"&&(Le.status="fulfilled",Le.value=Ze)},function(Ze){Le.status==="pending"&&(Le.status="rejected",Le.reason=Ze)})),Le.status){case"fulfilled":return Le.value;case"rejected":throw Le.reason}}throw Le}function I(Le,Ze,$e,qe,ft){var It=typeof Le;if(It==="undefined"||It==="boolean")Le=null;var ze=!1;if(Le===null)ze=!0;else switch(It){case"bigint":case"string":case"number":ze=!0;break;case"object":switch(Le.$$typeof){case U:case j:ze=!0;break;case te:return ze=Le._init,I(ze(Le._payload),Ze,$e,qe,ft)}}if(ze){ze=Le,ft=ft(ze);var Xe=qe===""?"."+C(ze,0):qe;return Re(ft)?($e="",Xe!=null&&($e=Xe.replace(lt,"$&/")+"/"),I(ft,Ze,$e,"",function(St){return St})):ft!=null&&(y(ft)&&(ft.key!=null&&(ze&&ze.key===ft.key||c(ft.key)),$e=g(ft,$e+(ft.key==null||ze&&ze.key===ft.key?"":(""+ft.key).replace(lt,"$&/")+"/")+Xe),qe!==""&&ze!=null&&y(ze)&&ze.key==null&&ze._store&&!ze._store.validated&&($e._store.validated=2),ft=$e),Ze.push(ft)),1}if(ze=0,Xe=qe===""?".":qe+":",Re(Le))for(var it=0;it<Le.length;it++)qe=Le[it],It=Xe+C(qe,it),ze+=I(qe,Ze,$e,It,ft);else if(it=t(Le),typeof it==="function")for(it===Le.entries&&(mt||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),mt=!0),Le=it.call(Le),it=0;!(qe=Le.next()).done;)qe=qe.value,It=Xe+C(qe,it++),ze+=I(qe,Ze,$e,It,ft);else if(It==="object"){if(typeof Le.then==="function")return I(b(Le),Ze,$e,qe,ft);throw Ze=String(Le),Error("Objects are not valid as a React child (found: "+(Ze==="[object Object]"?"object with keys {"+Object.keys(Le).join(", ")+"}":Ze)+"). If you meant to render a collection of children, use an array instead.")}return ze}function v(Le,Ze,$e){if(Le==null)return Le;var qe=[],ft=0;return I(Le,qe,"","",function(It){return Ze.call($e,It,ft++)}),qe}function P(Le){if(Le._status===-1){var Ze=null,$e=null,qe=Le._ioInfo;qe!=null&&(qe.start=qe.end=performance.now(),qe.value=new Promise(function(ze,Xe){Ze=ze,$e=Xe})),qe=Le._result;var ft=qe();if(ft.then(function(ze){if(Le._status===0||Le._status===-1){Le._status=1,Le._result=ze;var Xe=Le._ioInfo;if(Xe!=null){Xe.end=performance.now();var it=ze==null?void 0:ze.default;Ze(it),Xe.value.status="fulfilled",Xe.value.value=it}ft.status===void 0&&(ft.status="fulfilled",ft.value=ze)}},function(ze){if(Le._status===0||Le._status===-1){Le._status=2,Le._result=ze;var Xe=Le._ioInfo;Xe!=null&&(Xe.end=performance.now(),Xe.value.then(s,s),$e(ze),Xe.value.status="rejected",Xe.value.reason=ze),ft.status===void 0&&(ft.status="rejected",ft.reason=ze)}}),qe=Le._ioInfo,qe!=null){var It=ft.displayName;typeof It==="string"&&(qe.name=It)}Le._status===-1&&(Le._status=0,Le._result=ft)}if(Le._status===1)return qe=Le._result,qe===void 0&&console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s

Your code should look like: 
  const MyComponent = lazy(() => import('./MyComponent'))

Did you accidentally put curly braces around the import?`,qe),"default"in qe||console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s

Your code should look like: 
  const MyComponent = lazy(() => import('./MyComponent'))`,qe),qe.default;throw Le._result}function M(){var Le=_e.H;return Le===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),Le}function B(){_e.asyncTransitions--}function T(Le){var Ze=_e.T,$e={};$e.types=Ze!==null?Ze.types:null,$e._updatedFibers=new Set,_e.T=$e;try{var qe=Le(),ft=_e.S;ft!==null&&ft($e,qe),typeof qe==="object"&&qe!==null&&typeof qe.then==="function"&&(_e.asyncTransitions++,qe.then(B,B),qe.then(s,Ct))}catch(It){Ct(It)}finally{Ze===null&&$e._updatedFibers&&(Le=$e._updatedFibers.size,$e._updatedFibers.clear(),10<Le&&console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.")),Ze!==null&&$e.types!==null&&(Ze.types!==null&&Ze.types!==$e.types&&console.error("We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."),Ze.types=$e.types),_e.T=Ze}}function N(Le){var Ze=_e.T;if(Ze!==null){var $e=Ze.types;$e===null?Ze.types=[Le]:$e.indexOf(Le)===-1&&$e.push(Le)}else _e.asyncTransitions===0&&console.error("addTransitionType can only be called inside a `startTransition()` callback. It must be associated with a specific Transition."),T(N.bind(null,Le))}function D(Le){if(Ht===null)try{var Ze=("require"+Math.random()).slice(0,7);Ht=(Wge&&Wge[Ze]).call(Wge,"timers").setImmediate}catch($e){Ht=function(qe){Nt===!1&&(Nt=!0,typeof MessageChannel>"u"&&console.error("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var ft=new MessageChannel;ft.port1.onmessage=qe,ft.port2.postMessage(void 0)}}return Ht(Le)}function L(Le){return 1<Le.length&&typeof AggregateError==="function"?AggregateError(Le):Le[0]}function H(Le,Ze){Ze!==Tt-1&&console.error("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),Tt=Ze}function V(Le,Ze,$e){var qe=_e.actQueue;if(qe!==null)if(qe.length!==0)try{O(qe),D(function(){return V(Le,Ze,$e)});return}catch(ft){_e.thrownErrors.push(ft)}else _e.actQueue=null;0<_e.thrownErrors.length?(qe=L(_e.thrownErrors),_e.thrownErrors.length=0,$e(qe)):Ze(Le)}function O(Le){if(!vt){vt=!0;var Ze=0;try{for(;Ze<Le.length;Ze++){var $e=Le[Ze];do{_e.didUsePromise=!1;var qe=$e(!1);if(qe!==null){if(_e.didUsePromise){Le[Ze]=$e,Le.splice(0,Ze);return}$e=qe}else break}while(1)}Le.length=0}catch(ft){Le.splice(0,Ze+1),_e.thrownErrors.push(ft)}finally{vt=!1}}}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var U=Symbol.for("react.transitional.element"),j=Symbol.for("react.portal"),Y=Symbol.for("react.fragment"),X=Symbol.for("react.strict_mode"),K=Symbol.for("react.profiler"),J=Symbol.for("react.consumer"),ee=Symbol.for("react.context"),se=Symbol.for("react.forward_ref"),ne=Symbol.for("react.suspense"),re=Symbol.for("react.suspense_list"),Z=Symbol.for("react.memo"),te=Symbol.for("react.lazy"),ie=Symbol.for("react.activity"),le=Symbol.for("react.view_transition"),ue=Symbol.iterator,de={},me={isMounted:function(){return!1},enqueueForceUpdate:function(Le){n(Le,"forceUpdate")},enqueueReplaceState:function(Le){n(Le,"replaceState")},enqueueSetState:function(Le){n(Le,"setState")}},Ae=Object.assign,xe={};Object.freeze(xe),o.prototype.isReactComponent={},o.prototype.setState=function(Le,Ze){if(typeof Le!=="object"&&typeof Le!=="function"&&Le!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,Le,Ze,"setState")},o.prototype.forceUpdate=function(Le){this.updater.enqueueForceUpdate(this,Le,"forceUpdate")};var Me={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]};for(We in Me)Me.hasOwnProperty(We)&&e(We,Me[We]);r.prototype=o.prototype,Me=i.prototype=new r,Me.constructor=i,Ae(Me,o.prototype),Me.isPureReactComponent=!0;var Re=Array.isArray,we=Symbol.for("react.client.reference"),_e={H:null,A:null,T:null,S:null,actQueue:null,asyncTransitions:0,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1,didUsePromise:!1,thrownErrors:[],getCurrentStack:null,recentlyCreatedOwnerStacks:0},ye=Object.prototype.hasOwnProperty,Se=console.createTask?console.createTask:function(){return null};Me={react_stack_bottom_frame:function(Le){return Le()}};var Ne,ke,nt={},dt=Me.react_stack_bottom_frame.bind(Me,u)(),rt=Se(h(u)),mt=!1,lt=/\/+/g,Ct=typeof reportError==="function"?reportError:function(Le){if(typeof window==="object"&&typeof window.ErrorEvent==="function"){var Ze=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof Le==="object"&&Le!==null&&typeof Le.message==="string"?String(Le.message):String(Le),error:Le});if(!window.dispatchEvent(Ze))return}else if(typeof process==="object"&&typeof process.emit==="function"){process.emit("uncaughtException",Le);return}console.error(Le)},Nt=!1,Ht=null,Tt=0,et=!1,vt=!1,ht=typeof queueMicrotask==="function"?function(Le){queueMicrotask(function(){return queueMicrotask(Le)})}:D;Me=Object.freeze({__proto__:null,c:function(Le){return M().useMemoCache(Le)}});var We={map:v,forEach:function(Le,Ze,$e){v(Le,function(){Ze.apply(this,arguments)},$e)},count:function(Le){var Ze=0;return v(Le,function(){Ze++}),Ze},toArray:function(Le){return v(Le,function(Ze){return Ze})||[]},only:function(Le){if(!y(Le))throw Error("React.Children.only expected to receive a single React element child.");return Le}};R5o.Activity=ie,R5o.Children=We,R5o.Component=o,R5o.Fragment=Y,R5o.Profiler=K,R5o.PureComponent=i,R5o.StrictMode=X,R5o.Suspense=ne,R5o.ViewTransition=le,R5o.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=_e,R5o.__COMPILER_RUNTIME=Me,R5o.act=function(Le){var Ze=_e.actQueue,$e=Tt;Tt++;var qe=_e.actQueue=Ze!==null?Ze:[],ft=!1;try{var It=Le()}catch(it){_e.thrownErrors.push(it)}if(0<_e.thrownErrors.length)throw H(Ze,$e),Le=L(_e.thrownErrors),_e.thrownErrors.length=0,Le;if(It!==null&&typeof It==="object"&&typeof It.then==="function"){var ze=It;return ht(function(){ft||et||(et=!0,console.error("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),{then:function(it,St){ft=!0,ze.then(function(kt){if(H(Ze,$e),$e===0){try{O(qe),D(function(){return V(kt,it,St)})}catch(Wt){_e.thrownErrors.push(Wt)}if(0<_e.thrownErrors.length){var Lt=L(_e.thrownErrors);_e.thrownErrors.length=0,St(Lt)}}else it(kt)},function(kt){H(Ze,$e),0<_e.thrownErrors.length?(kt=L(_e.thrownErrors),_e.thrownErrors.length=0,St(kt)):St(kt)})}}}var Xe=It;if(H(Ze,$e),$e===0&&(O(qe),qe.length!==0&&ht(function(){ft||et||(et=!0,console.error("A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"))}),_e.actQueue=null),0<_e.thrownErrors.length)throw Le=L(_e.thrownErrors),_e.thrownErrors.length=0,Le;return{then:function(it,St){ft=!0,$e===0?(_e.actQueue=qe,D(function(){return V(Xe,it,St)})):it(Xe)}}},R5o.addTransitionType=N,R5o.cache=function(Le){return function(){return Le.apply(null,arguments)}},R5o.cacheSignal=function(){return null},R5o.captureOwnerStack=function(){var Le=_e.getCurrentStack;return Le===null?null:Le()},R5o.cloneElement=function(Le,Ze,$e){if(Le===null||Le===void 0)throw Error("The argument must be a React element, but you passed "+Le+".");var qe=Ae({},Le.props),{key:ft,_owner:It}=Le;if(Ze!=null){var ze;e:{if(ye.call(Ze,"ref")&&(ze=Object.getOwnPropertyDescriptor(Ze,"ref").get)&&ze.isReactWarning){ze=!1;break e}ze=Ze.ref!==void 0}ze&&(It=d()),_(Ze)&&(c(Ze.key),ft=""+Ze.key);for(Xe in Ze)!ye.call(Ze,Xe)||Xe==="key"||Xe==="__self"||Xe==="__source"||Xe==="ref"&&Ze.ref===void 0||(qe[Xe]=Ze[Xe])}var Xe=arguments.length-2;if(Xe===1)qe.children=$e;else if(1<Xe){ze=Array(Xe);for(var it=0;it<Xe;it++)ze[it]=arguments[it+2];qe.children=ze}qe=A(Le.type,ft,qe,It,Le._debugStack,Le._debugTask);for(ft=2;ft<arguments.length;ft++)f(arguments[ft]);return qe},R5o.createContext=function(Le){return Le={$$typeof:ee,_currentValue:Le,_currentValue2:Le,_threadCount:0,Provider:null,Consumer:null},Le.Provider=Le,Le.Consumer={$$typeof:J,_context:Le},Le._currentRenderer=null,Le._currentRenderer2=null,Le},R5o.createElement=function(Le,Ze,$e){for(var qe=2;qe<arguments.length;qe++)f(arguments[qe]);var ft;qe={};var It=null;if(Ze!=null)for(ft in ke||!("__self"in Ze)||"key"in Ze||(ke=!0,console.warn("Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform")),_(Ze)&&(c(Ze.key),It=""+Ze.key),Ze)ye.call(Ze,ft)&&ft!=="key"&&ft!=="__self"&&ft!=="__source"&&(qe[ft]=Ze[ft]);var ze=arguments.length-2;if(ze===1)qe.children=$e;else if(1<ze){for(var Xe=Array(ze),it=0;it<ze;it++)Xe[it]=arguments[it+2];Object.freeze&&Object.freeze(Xe),qe.children=Xe}if(Le&&Le.defaultProps)for(ft in ze=Le.defaultProps,ze)qe[ft]===void 0&&(qe[ft]=ze[ft]);return It&&p(qe,typeof Le==="function"?Le.displayName||Le.name||"Unknown":Le),(ft=1e4>_e.recentlyCreatedOwnerStacks++)?(Xe=Error.stackTraceLimit,Error.stackTraceLimit=10,ze=Error("react-stack-top-frame"),Error.stackTraceLimit=Xe):ze=dt,A(Le,It,qe,d(),ze,ft?Se(h(Le)):rt)},R5o.createRef=function(){var Le={current:null};return Object.seal(Le),Le},R5o.forwardRef=function(Le){Le!=null&&Le.$$typeof===Z?console.error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):typeof Le!=="function"?console.error("forwardRef requires a render function but was given %s.",Le===null?"null":typeof Le):Le.length!==0&&Le.length!==2&&console.error("forwardRef render functions accept exactly two parameters: props and ref. %s",Le.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),Le!=null&&Le.defaultProps!=null&&console.error("forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?");var Ze={$$typeof:se,render:Le},$e;return Object.defineProperty(Ze,"displayName",{enumerable:!1,configurable:!0,get:function(){return $e},set:function(qe){$e=qe,Le.name||Le.displayName||(Object.defineProperty(Le,"name",{value:qe}),Le.displayName=qe)}}),Ze},R5o.isValidElement=y,R5o.lazy=function(Le){Le={_status:-1,_result:Le};var Ze={$$typeof:te,_payload:Le,_init:P},$e={name:"lazy",start:-1,end:-1,value:null,owner:null,debugStack:Error("react-stack-top-frame"),debugTask:console.createTask?console.createTask("lazy()"):null};return Le._ioInfo=$e,Ze._debugInfo=[{awaited:$e}],Ze},R5o.memo=function(Le,Ze){Le==null&&console.error("memo: The first argument must be a component. Instead received: %s",Le===null?"null":typeof Le),Ze={$$typeof:Z,type:Le,compare:Ze===void 0?null:Ze};var $e;return Object.defineProperty(Ze,"displayName",{enumerable:!1,configurable:!0,get:function(){return $e},set:function(qe){$e=qe,Le.name||Le.displayName||(Object.defineProperty(Le,"name",{value:qe}),Le.displayName=qe)}}),Ze},R5o.startTransition=T,R5o.unstable_useCacheRefresh=function(){return M().useCacheRefresh()},R5o.use=function(Le){return M().use(Le)},R5o.useActionState=function(Le,Ze,$e){return M().useActionState(Le,Ze,$e)},R5o.useCallback=function(Le,Ze){return M().useCallback(Le,Ze)},R5o.useContext=function(Le){var Ze=M();return Le.$$typeof===J&&console.error("Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"),Ze.useContext(Le)},R5o.useDebugValue=function(Le,Ze){return M().useDebugValue(Le,Ze)},R5o.useDeferredValue=function(Le,Ze){return M().useDeferredValue(Le,Ze)},R5o.useEffect=function(Le,Ze){return Le==null&&console.warn("React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"),M().useEffect(Le,Ze)},R5o.useEffectEvent=function(Le){return M().useEffectEvent(Le)},R5o.useId=function(){return M().useId()},R5o.useImperativeHandle=function(Le,Ze,$e){return M().useImperativeHandle(Le,Ze,$e)},R5o.useInsertionEffect=function(Le,Ze){return Le==null&&console.warn("React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"),M().useInsertionEffect(Le,Ze)},R5o.useLayoutEffect=function(Le,Ze){return Le==null&&console.warn("React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"),M().useLayoutEffect(Le,Ze)},R5o.useMemo=function(Le,Ze){return M().useMemo(Le,Ze)},R5o.useOptimistic=function(Le,Ze){return M().useOptimistic(Le,Ze)},R5o.useReducer=function(Le,Ze,$e){return M().useReducer(Le,Ze,$e)},R5o.useRef=function(Le){return M().useRef(Le)},R5o.useState=function(Le){return M().useState(Le)},R5o.useSyncExternalStore=function(Le,Ze,$e){return M().useSyncExternalStore(Le,Ze,$e)},R5o.useTransition=function(){return M().useTransition()},R5o.version="19.3.1",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var Qyt=pt(function(SX){(function(){function e(){if(x=!1,v){var L=SX.unstable_now();B=L;var H=!0;try{e:{f=!1,y&&(y=!1,b(P),P=-1),g=!0;var V=A;try{t:{i(L);for(m=n(u);m!==null&&!(m.expirationTime>L&&a());){var O=m.callback;if(typeof O==="function"){m.callback=null,A=m.priorityLevel;var U=O(m.expirationTime<=L);if(L=SX.unstable_now(),typeof U==="function"){m.callback=U,i(L),H=!0;break t}m===n(u)&&o(u),i(L)}else o(u);m=n(u)}if(m!==null)H=!0;else{var j=n(_);j!==null&&c(s,j.startTime-L),H=!1}}break e}finally{m=null,A=V,g=!1}H=void 0}}finally{H?T():v=!1}}}function t(L,H){var V=L.length;L.push(H);e:for(;0<V;){var O=V-1>>>1,U=L[O];if(0<r(U,H))L[O]=H,L[V]=U,V=O;else break e}}function n(L){return L.length===0?null:L[0]}function o(L){if(L.length===0)return null;var H=L[0],V=L.pop();if(V!==H){L[0]=V;e:for(var O=0,U=L.length,j=U>>>1;O<j;){var Y=2*(O+1)-1,X=L[Y],K=Y+1,J=L[K];if(0>r(X,V))K<U&&0>r(J,X)?(L[O]=J,L[K]=V,O=K):(L[O]=X,L[Y]=V,O=Y);else if(K<U&&0>r(J,V))L[O]=J,L[K]=V,O=K;else break e}}return H}function r(L,H){var V=L.sortIndex-H.sortIndex;return V!==0?V:L.id-H.id}function i(L){for(var H=n(_);H!==null;){if(H.callback===null)o(_);else if(H.startTime<=L)o(_),H.sortIndex=H.expirationTime,t(u,H);else break;H=n(_)}}function s(L){if(y=!1,i(L),!f)if(n(u)!==null)f=!0,v||(v=!0,T());else{var H=n(_);H!==null&&c(s,H.startTime-L)}}function a(){return x?!0:SX.unstable_now()-B<M?!1:!0}function c(L,H){P=C(function(){L(SX.unstable_now())},H)}if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()),SX.unstable_now=void 0,typeof performance==="object"&&typeof performance.now==="function"){var l=performance;SX.unstable_now=function(){return l.now()}}else{var h=Date,d=h.now();SX.unstable_now=function(){return h.now()-d}}var u=[],_=[],p=1,m=null,A=3,g=!1,f=!1,y=!1,x=!1,C=typeof setTimeout==="function"?setTimeout:null,b=typeof clearTimeout==="function"?clearTimeout:null,I=typeof setImmediate<"u"?setImmediate:null,v=!1,P=-1,M=5,B=-1;if(typeof I==="function")var T=function(){I(e)};else if(typeof MessageChannel<"u"){var N=new MessageChannel,D=N.port2;N.port1.onmessage=e,T=function(){D.postMessage(null)}}else T=function(){C(e,0)};SX.unstable_IdlePriority=5,SX.unstable_ImmediatePriority=1,SX.unstable_LowPriority=4,SX.unstable_NormalPriority=3,SX.unstable_Profiling=null,SX.unstable_UserBlockingPriority=2,SX.unstable_cancelCallback=function(L){L.callback=null},SX.unstable_forceFrameRate=function(L){0>L||125<L?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<L?Math.floor(1000/L):5},SX.unstable_getCurrentPriorityLevel=function(){return A},SX.unstable_next=function(L){switch(A){case 1:case 2:case 3:var H=3;break;default:H=A}var V=A;A=H;try{return L()}finally{A=V}},SX.unstable_requestPaint=function(){x=!0},SX.unstable_runWithPriority=function(L,H){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var V=A;A=L;try{return H()}finally{A=V}},SX.unstable_scheduleCallback=function(L,H,V){var O=SX.unstable_now();switch(typeof V==="object"&&V!==null?(V=V.delay,V=typeof V==="number"&&0<V?O+V:O):V=O,L){case 1:var U=-1;break;case 2:U=250;break;case 5:U=1073741823;break;case 4:U=1e4;break;default:U=5000}return U=V+U,L={id:p++,callback:H,priorityLevel:L,startTime:V,expirationTime:U,sortIndex:-1},V>O?(L.sortIndex=V,t(_,L),n(u)===null&&L===n(_)&&(y?(b(P),P=-1):y=!0,c(s,V-O))):(L.sortIndex=U,t(u,L),f||g||(f=!0,v||(v=!0,T()))),L},SX.unstable_shouldYield=a,SX.unstable_wrapCallback=function(L){var H=A;return function(){var V=A;A=H;try{return L.apply(this,arguments)}finally{A=V}}},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var kyt=pt(function(Q5o){var PRe=at(ln());(function(){function e(){}function t(u){return""+u}function n(u,_,p){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;if(m==null)m=null;else if(m===h)m=h;else{try{t(m);var A=!1}catch(g){A=!0}A&&(console.error("The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",typeof Symbol==="function"&&Symbol.toStringTag&&m[Symbol.toStringTag]||m.constructor.name||"Object"),t(m)),m=""+m}return{$$typeof:c,key:m,children:u,containerInfo:_,implementation:p}}function o(u,_){if(u==="font")return"";if(typeof _==="string")return _==="use-credentials"?_:""}function r(u){return u===null?"`null`":u===void 0?"`undefined`":u===""?"an empty string":'something with type "'+typeof u+'"'}function i(u){return u===null?"`null`":u===void 0?"`undefined`":u===""?"an empty string":typeof u==="string"?JSON.stringify(u):typeof u==="number"?"`"+u+"`":'something with type "'+typeof u+'"'}function s(){var u=d.H;return u===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),u}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var a={d:{f:e,r:function(){throw Error("Invalid form element. requestFormReset must be passed a form that was rendered by React.")},D:e,C:e,L:e,m:e,X:e,S:e,M:e},p:0,findDOMNode:null},c=Symbol.for("react.portal"),l=Symbol.for("react.recoverable"),h=Symbol.for("react.optimistic_key"),d=PRe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;typeof Map==="function"&&Map.prototype!=null&&typeof Map.prototype.forEach==="function"&&typeof Set==="function"&&Set.prototype!=null&&typeof Set.prototype.clear==="function"&&typeof Set.prototype.forEach==="function"||console.error("React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),Q5o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,Q5o.browser=function(u){return{$$typeof:l,_reason:u}},Q5o.createPortal=function(u,_){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!_||_.nodeType!==1&&_.nodeType!==9&&_.nodeType!==11)throw Error("Target container is not a DOM element.");return n(u,_,null,p)},Q5o.flushSync=function(u){var _=d.T,p=a.p;try{if(d.T=null,a.p=2,u)return u()}finally{d.T=_,a.p=p,a.d.f()&&console.error("flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task.")}},Q5o.preconnect=function(u,_){typeof u==="string"&&u?_!=null&&typeof _!=="object"?console.error("ReactDOM.preconnect(): Expected the `options` argument (second) to be an object but encountered %s instead. The only supported option at this time is `crossOrigin` which accepts a string.",i(_)):_!=null&&typeof _.crossOrigin!=="string"&&console.error("ReactDOM.preconnect(): Expected the `crossOrigin` option (second argument) to be a string but encountered %s instead. Try removing this option or passing a string value instead.",r(_.crossOrigin)):console.error("ReactDOM.preconnect(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",r(u)),typeof u==="string"&&(_?(_=_.crossOrigin,_=typeof _==="string"?_==="use-credentials"?_:"":void 0):_=null,a.d.C(u,_))},Q5o.prefetchDNS=function(u){if(typeof u!=="string"||!u)console.error("ReactDOM.prefetchDNS(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",r(u));else if(1<arguments.length){var _=arguments[1];typeof _==="object"&&_.hasOwnProperty("crossOrigin")?console.error("ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. It looks like the you are attempting to set a crossOrigin property for this DNS lookup hint. Browsers do not perform DNS queries using CORS and setting this attribute on the resource hint has no effect. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",i(_)):console.error("ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",i(_))}typeof u==="string"&&a.d.D(u)},Q5o.preinit=function(u,_){if(typeof u==="string"&&u?_==null||typeof _!=="object"?console.error("ReactDOM.preinit(): Expected the `options` argument (second) to be an object with an `as` property describing the type of resource to be preinitialized but encountered %s instead.",i(_)):_.as!=="style"&&_.as!=="script"&&console.error('ReactDOM.preinit(): Expected the `as` property in the `options` argument (second) to contain a valid value describing the type of resource to be preinitialized but encountered %s instead. Valid values for `as` are "style" and "script".',i(_.as)):console.error("ReactDOM.preinit(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",r(u)),typeof u==="string"&&_&&typeof _.as==="string"){var p=_.as,m=o(p,_.crossOrigin),A=typeof _.integrity==="string"?_.integrity:void 0,g=typeof _.fetchPriority==="string"?_.fetchPriority:void 0;p==="style"?a.d.S(u,typeof _.precedence==="string"?_.precedence:void 0,{crossOrigin:m,integrity:A,fetchPriority:g}):p==="script"&&a.d.X(u,{crossOrigin:m,integrity:A,fetchPriority:g,nonce:typeof _.nonce==="string"?_.nonce:void 0})}},Q5o.preinitModule=function(u,_){var p="";if(typeof u==="string"&&u||(p+=" The `href` argument encountered was "+r(u)+"."),_!==void 0&&typeof _!=="object"?p+=" The `options` argument encountered was "+r(_)+".":_&&("as"in _)&&_.as!=="script"&&(p+=" The `as` option encountered was "+i(_.as)+"."),p)console.error("ReactDOM.preinitModule(): Expected up to two arguments, a non-empty `href` string and, optionally, an `options` object with a valid `as` property.%s",p);else switch(p=_&&typeof _.as==="string"?_.as:"script",p){case"script":break;default:p=i(p),console.error('ReactDOM.preinitModule(): Currently the only supported "as" type for this function is "script" but received "%s" instead. This warning was generated for `href` "%s". In the future other module types will be supported, aligning with the import-attributes proposal. Learn more here: (https://github.com/tc39/proposal-import-attributes)',p,u)}if(typeof u==="string")if(typeof _==="object"&&_!==null){if(_.as==null||_.as==="script")p=o(_.as,_.crossOrigin),a.d.M(u,{crossOrigin:p,integrity:typeof _.integrity==="string"?_.integrity:void 0,nonce:typeof _.nonce==="string"?_.nonce:void 0,fetchPriority:typeof _.fetchPriority==="string"?_.fetchPriority:void 0})}else _==null&&a.d.M(u)},Q5o.preload=function(u,_){var p="";if(typeof u==="string"&&u||(p+=" The `href` argument encountered was "+r(u)+"."),_==null||typeof _!=="object"?p+=" The `options` argument encountered was "+r(_)+".":typeof _.as==="string"&&_.as||(p+=" The `as` option encountered was "+r(_.as)+"."),p&&console.error('ReactDOM.preload(): Expected two arguments, a non-empty `href` string and an `options` object with an `as` property valid for a `<link rel="preload" as="..." />` tag.%s',p),typeof u==="string"&&typeof _==="object"&&_!==null&&typeof _.as==="string"){p=_.as;var m=o(p,_.crossOrigin);a.d.L(u,p,{crossOrigin:m,integrity:typeof _.integrity==="string"?_.integrity:void 0,nonce:typeof _.nonce==="string"?_.nonce:void 0,type:typeof _.type==="string"?_.type:void 0,fetchPriority:typeof _.fetchPriority==="string"?_.fetchPriority:void 0,referrerPolicy:typeof _.referrerPolicy==="string"?_.referrerPolicy:void 0,imageSrcSet:typeof _.imageSrcSet==="string"?_.imageSrcSet:void 0,imageSizes:typeof _.imageSizes==="string"?_.imageSizes:void 0,media:typeof _.media==="string"?_.media:void 0})}},Q5o.preloadModule=function(u,_){var p="";typeof u==="string"&&u||(p+=" The `href` argument encountered was "+r(u)+"."),_!==void 0&&typeof _!=="object"?p+=" The `options` argument encountered was "+r(_)+".":_&&("as"in _)&&typeof _.as!=="string"&&(p+=" The `as` option encountered was "+r(_.as)+"."),p&&console.error('ReactDOM.preloadModule(): Expected two arguments, a non-empty `href` string and, optionally, an `options` object with an `as` property valid for a `<link rel="modulepreload" as="..." />` tag.%s',p),typeof u==="string"&&(_?(p=o(_.as,_.crossOrigin),a.d.m(u,{as:typeof _.as==="string"&&_.as!=="script"?_.as:void 0,crossOrigin:p,integrity:typeof _.integrity==="string"?_.integrity:void 0,nonce:typeof _.nonce==="string"?_.nonce:void 0,fetchPriority:typeof _.fetchPriority==="string"?_.fetchPriority:void 0})):a.d.m(u))},Q5o.requestFormReset=function(u){a.d.r(u)},Q5o.unstable_batchedUpdates=function(u,_){return u(_)},Q5o.useFormState=function(u,_,p){return s().useFormState(u,_,p)},Q5o.useFormStatus=function(){return s().useHostTransitionStatus()},Q5o.version="19.3.1",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var z7=pt(function(k5o,Xge){Xge.exports=at(kyt())});var Lyt=pt(function(L5o){var Il=at(Qyt()),PX=at(ln()),ERe=at(z7());(function(){function e(S,w){for(S=S.memoizedState;S!==null&&0<w;)S=S.next,w--;return S}function t(S,w,Q,W){if(Q>=w.length)return W;var oe=w[Q],ae=O0(S)?S.slice():pa({},S);return ae[oe]=t(S[oe],w,Q+1,W),ae}function n(S,w,Q){if(w.length!==Q.length)console.warn("copyWithRename() expects paths of the same length");else{for(var W=0;W<Q.length-1;W++)if(w[W]!==Q[W]){console.warn("copyWithRename() expects paths to be the same except for the deepest key");return}return o(S,w,Q,0)}}function o(S,w,Q,W){var oe=w[W],ae=O0(S)?S.slice():pa({},S);return W+1===w.length?(ae[Q[W]]=ae[oe],O0(ae)?ae.splice(oe,1):delete ae[oe]):ae[oe]=o(S[oe],w,Q,W+1),ae}function r(S,w,Q){var W=w[Q],oe=O0(S)?S.slice():pa({},S);if(Q+1===w.length)return O0(oe)?oe.splice(W,1):delete oe[W],oe;return oe[W]=r(S[W],w,Q+1),oe}function i(){return!1}function s(){return null}function a(){console.error("Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://react.dev/link/rules-of-hooks")}function c(){console.error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().")}function l(){}function h(){}function d(S){var w=[];return S.forEach(function(Q){w.push(Q)}),w.sort().join(", ")}function u(S,w,Q,W){return new Ws(S,w,Q,W)}function _(S,w){S.context===zN&&(cb(S.current,2,w,S,null,null),GI())}function p(S,w){if(XM!==null){var Q=w.staleFamilies;w=w.updatedFamilies,fy(),Pa(S.current,w,Q),GI()}}function m(S){XM=S}function A(S){return!(!S||S.nodeType!==1&&S.nodeType!==9&&S.nodeType!==11)}function g(S){for(var w=S,Q=w;Q&&!Q.alternate;)w=Q,(w.flags&4098)!==0&&(S=w.return),Q=w.return;for(;w.return;)w=w.return;return w.tag===3?S:null}function f(S){if(S.tag===13){var w=S.memoizedState;if(w===null&&(S=S.alternate,S!==null&&(w=S.memoizedState)),w!==null)return w.dehydrated}return null}function y(S){if(S.tag===31){var w=S.memoizedState;if(w===null&&(S=S.alternate,S!==null&&(w=S.memoizedState)),w!==null)return w.dehydrated}return null}function x(S){if(g(S)!==S)throw Error("Unable to find node on an unmounted component.")}function C(S){var w=S.alternate;if(!w){if(w=g(S),w===null)throw Error("Unable to find node on an unmounted component.");return w!==S?null:S}for(var Q=S,W=w;;){var oe=Q.return;if(oe===null)break;var ae=oe.alternate;if(ae===null){if(W=oe.return,W!==null){Q=W;continue}break}if(oe.child===ae.child){for(ae=oe.child;ae;){if(ae===Q)return x(oe),S;if(ae===W)return x(oe),w;ae=ae.sibling}throw Error("Unable to find node on an unmounted component.")}if(Q.return!==W.return)Q=oe,W=ae;else{for(var De=!1,Qe=oe.child;Qe;){if(Qe===Q){De=!0,Q=oe,W=ae;break}if(Qe===W){De=!0,W=oe,Q=ae;break}Qe=Qe.sibling}if(!De){for(Qe=ae.child;Qe;){if(Qe===Q){De=!0,Q=ae,W=oe;break}if(Qe===W){De=!0,W=ae,Q=oe;break}Qe=Qe.sibling}if(!De)throw Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.")}}if(Q.alternate!==W)throw Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.")}if(Q.tag!==3)throw Error("Unable to find node on an unmounted component.");return Q.stateNode.current===Q?S:w}function b(S){var w=S.tag;if(w===5||w===26||w===27||w===6)return S;for(S=S.child;S!==null;){if(w=b(S),w!==null)return w;S=S.sibling}return null}function I(S,w,Q,W,oe){v(S.child,!1,w,Q,W,oe)}function v(S,w,Q,W,oe,ae){for(;S!==null;){if((S.tag===5||S.tag===27||S.tag===6)&&Q(S,W,oe,ae)||(S.tag!==22||S.memoizedState===null)&&(w||S.tag!==5&&S.tag!==27)&&v(S.child,w,Q,W,oe,ae))return!0;S=S.sibling}return!1}function P(S){for(S=S.return;S!==null;){if(S.tag===3||S.tag===5||S.tag===27)return S;S=S.return}return null}function M(S){var w=!1;for(S=S.return;S!==null;){if(S.tag===4&&(w=!0),S.tag===3||S.tag===5||S.tag===27)break;S=S.return}return w}function B(S){var w=[null,null],Q=P(S);if(Q===null)return w;return T(w,S,Q.child,{foundSelf:!1}),w}function T(S,w,Q,W){for(;Q!==null;){if(Q===w)W.foundSelf=!0;else if(Q.tag===5||Q.tag===27||Q.tag===6){if(W.foundSelf)return S[1]=Q,!0;S[0]=Q}else if((Q.tag!==22||Q.memoizedState===null)&&T(S,w,Q.child,W))return!0;Q=Q.sibling}return!1}function N(S){switch(S.tag){case 5:case 27:case 6:return S.stateNode;case 3:return S.stateNode.containerInfo;default:throw Error("Expected to find a host node. This is a bug in React.")}}function D(S,w,Q){return S===Q?!0:S===w?(K4=S,!0):!1}function L(S,w,Q){return S===Q?(zM=S,!1):S===w?(zM!==null&&(K4=S),!0):!1}function H(S){if(S===null)return null;do S=S===null?null:S.return;while(S&&S.tag!==5&&S.tag!==27&&S.tag!==3);return S?S:null}function V(S,w,Q){for(var W=0,oe=S;oe;oe=Q(oe))W++;oe=0;for(var ae=w;ae;ae=Q(ae))oe++;for(;0<W-oe;)S=Q(S),W--;for(;0<oe-W;)w=Q(w),oe--;for(;W--;){if(S===w||w!==null&&S===w.alternate)return S;S=Q(S),w=Q(w)}return null}function O(S){if(S===null||typeof S!=="object")return null;return S=zF&&S[zF]||S["@@iterator"],typeof S==="function"?S:null}function U(S){if(S==null)return null;if(typeof S==="function")return S.$$typeof===LW?null:S.displayName||S.name||null;if(typeof S==="string")return S;switch(S){case y7:return"Fragment";case QW:return"Profiler";case FF:return"StrictMode";case kW:return"Suspense";case Gp:return"SuspenseList";case z0:return"Activity";case x7:return"ViewTransition"}if(typeof S==="object")switch(typeof S.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),S.$$typeof){case f7:return"Portal";case Yl:return S.displayName||"Context";case q4:return(S._context.displayName||"Context")+".Consumer";case BN:var w=S.render;return S=S.displayName,S||(S=w.displayName||w.name||"",S=S!==""?"ForwardRef("+S+")":"ForwardRef"),S;case h9:return w=S.displayName||null,w!==null?w:U(S.type)||"Memo";case Qm:w=S._payload,S=S._init;try{return U(S(w))}catch(Q){}}return null}function j(S){return typeof S.tag==="number"?Y(S):typeof S.name==="string"?S.name:null}function Y(S){var w=S.type;switch(S.tag){case 31:return"Activity";case 24:return"Cache";case 9:return(w._context.displayName||"Context")+".Consumer";case 10:return w.displayName||"Context";case 18:return"DehydratedFragment";case 11:return S=w.render,S=S.displayName||S.name||"",w.displayName||(S!==""?"ForwardRef("+S+")":"ForwardRef");case 7:return"Fragment";case 26:case 27:case 5:return w;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return U(w);case 8:return w===FF?"StrictMode":"Mode";case 22:if(S.return!==null)return Y(S.return);break;case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 30:return"ViewTransition";case 1:case 0:case 14:case 15:if(typeof w==="function")return w.displayName||w.name||null;if(typeof w==="string")return w;break;case 29:if(w=S._debugInfo,w!=null){for(var Q=w.length-1;0<=Q;Q--)if(typeof w[Q].name==="string")return w[Q].name}if(S.return!==null)return Y(S.return)}return null}function X(S){return{current:S}}function K(S,w){0>p0?console.error("Unexpected pop."):(w!==Coe[p0]&&console.error("Unexpected Fiber popped."),S.current=TN[p0],TN[p0]=null,Coe[p0]=null,p0--)}function J(S,w,Q){p0++,TN[p0]=S.current,Coe[p0]=Q,S.current=w}function ee(S){return S===null&&console.error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue."),S}function se(S,w){J(wA,w,S),J(MA,S,S),J(m0,null,S);var Q=w.nodeType;switch(Q){case 9:case 11:Q=Q===9?"#document":"#fragment",w=(w=w.documentElement)?(w=w.namespaceURI)?JI(w):ow:ow;break;default:if(Q=w.tagName,w=w.namespaceURI)w=JI(w),w=DM(w,Q);else switch(Q){case"svg":w=yX;break;case"math":w=Fge;break;default:w=ow}}Q=Q.toLowerCase(),Q=fm(null,Q),Q={context:w,ancestorInfo:Q},K(m0,S),J(m0,Q,S)}function ne(S){K(m0,S),K(MA,S),K(wA,S)}function re(){return ee(m0.current)}function Z(S){var w=S.memoizedState;w!==null&&(CX._currentValue=w.memoizedState,J(C7,S,S)),w=ee(m0.current);var Q=S.type,W=DM(w.context,Q);Q=fm(w.ancestorInfo,Q),W={context:W,ancestorInfo:Q},w!==W&&(J(MA,S,S),J(m0,W,S))}function te(S){MA.current===S&&(K(m0,S),K(MA,S)),C7.current===S&&(K(C7,S),CX._currentValue=Az)}function ie(){}function le(){if(pb===0){HW=console.log,b7=console.info,VF=console.warn,boe=console.error,Ac=console.group,Qh=console.groupCollapsed,Ha=console.groupEnd;var S={configurable:!0,enumerable:!0,value:ie,writable:!0};Object.defineProperties(console,{info:S,log:S,warn:S,error:S,group:S,groupCollapsed:S,groupEnd:S})}pb++}function ue(){if(pb--,pb===0){var S={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:pa({},S,{value:HW}),info:pa({},S,{value:b7}),warn:pa({},S,{value:VF}),error:pa({},S,{value:boe}),group:pa({},S,{value:Ac}),groupCollapsed:pa({},S,{value:Qh}),groupEnd:pa({},S,{value:Ha})})}0>pb&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function de(S){var w=Error.prepareStackTrace;if(Error.prepareStackTrace=void 0,S=S.stack,Error.prepareStackTrace=w,S.startsWith(`Error: react-stack-top-frame
`)&&(S=S.slice(29)),w=S.indexOf(`
`),w!==-1&&(S=S.slice(w+1)),w=S.indexOf("react_stack_bottom_frame"),w!==-1&&(w=S.lastIndexOf(`
`,w)),w!==-1)S=S.slice(0,w);else return"";return S}function me(S){if(Fa===void 0)try{throw Error()}catch(Q){var w=Q.stack.trim().match(/\n( *(at )?)/);Fa=w&&w[1]||"",qf=-1<Q.stack.indexOf(`
    at`)?" (<anonymous>)":-1<Q.stack.indexOf("@")?"@unknown:0:0":""}return`
`+Fa+S+qf}function Ae(S,w){if(!S||OM)return"";var Q=d9.get(S);if(Q!==void 0)return Q;OM=!0,Q=Error.prepareStackTrace,Error.prepareStackTrace=void 0;var W=null;W=Xn.H,Xn.H=null,le();try{var oe={DetermineComponentFrameRoot:function(){try{if(w){var on=function(){throw Error()};if(Object.defineProperty(on.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==="object"&&Reflect.construct){try{Reflect.construct(on,[])}catch(Sr){var Cn=Sr}Reflect.construct(S,[],on)}else{try{on.call()}catch(Sr){Cn=Sr}on=!1;try{var Po=Object.getOwnPropertyDescriptor(S.prototype,"props");Object.defineProperty(S.prototype,"props",{configurable:!0,set:function(){throw Error()}}),on=!0,new S}finally{on&&(Po!==void 0?Object.defineProperty(S.prototype,"props",Po):delete S.prototype.props)}}}else{try{throw Error()}catch(Sr){Cn=Sr}(on=S())&&typeof on.catch==="function"&&on.catch(function(){})}}catch(Sr){if(Sr&&Cn&&typeof Sr.stack==="string")return[Sr.stack,Cn.stack]}return[null,null]}};oe.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var ae=Object.getOwnPropertyDescriptor(oe.DetermineComponentFrameRoot,"name");ae&&ae.configurable&&Object.defineProperty(oe.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var De=oe.DetermineComponentFrameRoot(),Qe=De[0],ot=De[1];if(Qe&&ot){var _t=Qe.split(`
`),Yt=ot.split(`
`);for(De=ae=0;ae<_t.length&&!_t[ae].includes("DetermineComponentFrameRoot");)ae++;for(;De<Yt.length&&!Yt[De].includes("DetermineComponentFrameRoot");)De++;if(ae===_t.length||De===Yt.length)for(ae=_t.length-1,De=Yt.length-1;1<=ae&&0<=De&&_t[ae]!==Yt[De];)De--;for(;1<=ae&&0<=De;ae--,De--)if(_t[ae]!==Yt[De]){if(ae!==1||De!==1)do if(ae--,De--,0>De||_t[ae]!==Yt[De]){var rn=`
`+_t[ae].replace(" at new "," at ");return S.displayName&&rn.includes("<anonymous>")&&(rn=rn.replace("<anonymous>",S.displayName)),typeof S==="function"&&d9.set(S,rn),rn}while(1<=ae&&0<=De);break}}}finally{OM=!1,Xn.H=W,ue(),Error.prepareStackTrace=Q}return _t=(_t=S?S.displayName||S.name:"")?me(_t):"",typeof S==="function"&&d9.set(S,_t),_t}function xe(S,w){switch(S.tag){case 26:case 27:case 5:return me(S.type);case 16:return me("Lazy");case 13:return S.child!==w&&w!==null?me("Suspense Fallback"):me("Suspense");case 19:return me("SuspenseList");case 0:case 15:return Ae(S.type,!1);case 11:return Ae(S.type.render,!1);case 1:return Ae(S.type,!0);case 31:return me("Activity");case 30:return me("ViewTransition");default:return""}}function Me(S){try{var w="",Q=null;do{w+=xe(S,Q);var W=S._debugInfo;if(W)for(var oe=W.length-1;0<=oe;oe--){var ae=W[oe];if(typeof ae.name==="string"){var De=w;e:{var{name:Qe,env:ot,debugLocation:_t}=ae;if(_t!=null){var Yt=de(_t),rn=Yt.lastIndexOf(`
`),on=rn===-1?Yt:Yt.slice(rn+1);if(on.indexOf(Qe)!==-1){var Cn=`
`+on;break e}}Cn=me(Qe+(ot?" ["+ot+"]":""))}w=De+Cn}}Q=S,S=S.return}while(S);return w}catch(Po){return`
Error generating stack: `+Po.message+`
`+Po.stack}}function Re(S){return(S=S?S.displayName||S.name:"")?me(S):""}function we(){if(Dg===null)return null;var S=Dg._debugOwner;return S!=null?j(S):null}function _e(){if(Dg===null)return"";var S=Dg;try{var w="";switch(S.tag===6&&(S=S.return),S.tag){case 26:case 27:case 5:w+=me(S.type);break;case 13:w+=me("Suspense");break;case 19:w+=me("SuspenseList");break;case 31:w+=me("Activity");break;case 30:w+=me("ViewTransition");break;case 0:case 15:case 1:S._debugOwner||w!==""||(w+=Re(S.type));break;case 11:S._debugOwner||w!==""||(w+=Re(S.type.render))}for(;S;)if(typeof S.tag==="number"){var Q=S;S=Q._debugOwner;var W=Q._debugStack;if(S&&W){var oe=de(W);oe!==""&&(w+=`
`+oe)}}else if(S.debugStack!=null){var ae=S.debugStack;(S=S.owner)&&ae&&(w+=`
`+de(ae))}else break;var De=w}catch(Qe){De=`
Error generating stack: `+Qe.message+`
`+Qe.stack}return De}function ye(S,w,Q,W,oe,ae,De){var Qe=Dg;Se(S);try{return S!==null&&S._debugTask?S._debugTask.run(w.bind(null,Q,W,oe,ae,De)):w(Q,W,oe,ae,De)}finally{Se(Qe)}throw Error("runWithFiberInDEV should never be called in production. This is a bug in React.")}function Se(S){Xn.getCurrentStack=S===null?null:_e,Z4=!1,Dg=S}function Ne(S){return typeof Symbol==="function"&&Symbol.toStringTag&&S[Symbol.toStringTag]||S.constructor.name||"Object"}function ke(S){try{return nt(S),!1}catch(w){return!0}}function nt(S){return""+S}function dt(S,w){if(ke(S))return console.error("The provided `%s` attribute is an unsupported type %s. This value must be coerced to a string before using it here.",w,Ne(S)),nt(S)}function rt(S,w){if(ke(S))return console.error("The provided `%s` CSS property is an unsupported type %s. This value must be coerced to a string before using it here.",w,Ne(S)),nt(S)}function mt(S){if(ke(S))return console.error("Form field values (value, checked, defaultValue, or defaultChecked props) must be strings, not %s. This value must be coerced to a string before using it here.",Ne(S)),nt(S)}function lt(S){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")return!1;var w=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(w.isDisabled)return!0;if(!w.supportsFiber)return console.error("The installed version of React DevTools is too old and will not work with the current version of React. Please update React DevTools. https://react.dev/link/react-devtools"),!0;try{M7=w.inject(S),kh=w}catch(Q){console.error("React instrumentation encountered an error: %o.",Q)}return w.checkDCE?!0:!1}function Ct(S){if(typeof P7==="function"&&E7(S),kh&&typeof kh.setStrictMode==="function")try{kh.setStrictMode(M7,S)}catch(w){BA||(BA=!0,console.error("React instrumentation encountered an error: %o",w))}}function Nt(S){return S>>>=0,S===0?32:31-(FW(S)/voe|0)|0}function Ht(S){var w=S&42;if(w!==0)return w;switch(S&-S){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return S&-S;case 262144:case 524288:case 1048576:case 2097152:return S&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return S&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return console.error("Should have found matching lanes. This is a bug in React."),S}}function Tt(S,w,Q){var W=S.pendingLanes;if(W===0)return 0;var oe=0,ae=S.suspendedLanes,De=S.pingedLanes;S=S.warmLanes;var Qe=W&134217727;return Qe!==0?(W=Qe&~ae,W!==0?oe=Ht(W):(De&=Qe,De!==0?oe=Ht(De):Q||(Q=Qe&~S,Q!==0&&(oe=Ht(Q))))):(Qe=W&~ae,Qe!==0?oe=Ht(Qe):De!==0?oe=Ht(De):Q||(Q=W&~S,Q!==0&&(oe=Ht(Q)))),oe===0?0:w!==0&&w!==oe&&(w&ae)===0&&(ae=oe&-oe,Q=w&-w,ae>=Q||ae===32&&(Q&4194048)!==0)?w:oe}function et(S,w){return(S.pendingLanes&~(S.suspendedLanes&~S.pingedLanes)&w)===0}function vt(S,w){(w&8)!==0&&(w|=w&32);var Q=S.entangledLanes;if(Q!==0)for(S=S.entanglements,Q&=w;0<Q;){var W=31-mh(Q),oe=1<<W;w|=S[W],Q&=~oe}return w}function ht(S,w){switch(S){case 1:case 2:case 4:case 8:case 64:return w+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return w+5000;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return console.error("Should have found matching lanes. This is a bug in React."),-1}}function We(){var S=DN;return DN<<=1,(DN&62914560)===0&&(DN=4194304),S}function Le(S){for(var w=[],Q=0;31>Q;Q++)w.push(S);return w}function Ze(S,w){S.pendingLanes|=w,w!==268435456&&(S.suspendedLanes=0,S.pingedLanes=0,S.warmLanes=0)}function $e(S,w,Q,W,oe,ae){var De=S.pendingLanes;S.pendingLanes=Q,S.suspendedLanes=0,S.pingedLanes=0,S.warmLanes=0,S.expiredLanes&=Q,S.entangledLanes&=Q,S.errorRecoveryDisabledLanes&=Q,S.shellSuspendCounter=0;var{entanglements:Qe,expirationTimes:ot,hiddenUpdates:_t}=S;for(Q=De&~Q;0<Q;){var Yt=31-mh(Q),rn=1<<Yt;Qe[Yt]=0,ot[Yt]=-1;var on=_t[Yt];if(on!==null)for(_t[Yt]=null,Yt=0;Yt<on.length;Yt++){var Cn=on[Yt];Cn!==null&&(Cn.lane&=-536870913)}Q&=~rn}W!==0&&qe(S,W,0),ae!==0&&oe===0&&S.tag!==0&&(S.suspendedLanes|=ae&~(De&~w))}function qe(S,w,Q){S.pendingLanes|=w,S.suspendedLanes&=~w;var W=31-mh(w);S.entangledLanes|=w,S.entanglements[W]=S.entanglements[W]|1073741824|Q&261930}function ft(S,w){var Q=S.entangledLanes|=w;for(S=S.entanglements;Q;){var W=31-mh(Q),oe=1<<W;oe&w|S[W]&w&&(S[W]|=w),Q&=~oe}}function It(S,w){var Q=w&-w;return Q=(Q&42)!==0?1:ze(Q),(Q&(S.suspendedLanes|w))!==0?0:Q}function ze(S){switch(S){case 2:S=1;break;case 8:S=4;break;case 32:S=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:S=128;break;case 268435456:S=134217728;break;default:S=0}return S}function Xe(S,w,Q){if(Z2)for(S=S.pendingUpdatersLaneMap;0<Q;){var W=31-mh(Q),oe=1<<W;S[W].add(w),Q&=~oe}}function it(S,w){if(Z2)for(var Q=S.pendingUpdatersLaneMap,W=S.memoizedUpdaters;0<w;){var oe=31-mh(w);S=1<<oe,oe=Q[oe],0<oe.size&&(oe.forEach(function(ae){var De=ae.alternate;De!==null&&W.has(De)||W.add(ae)}),oe.clear()),w&=~S}}function St(S){return S&=-S,km!==0&&km<S?f_!==0&&f_<S?(S&134217727)!==0?gb:zW:f_:km}function kt(){var S=Jc.p;if(S!==0)return S;return S=window.event,S===void 0?gb:c9(S.type)}function Lt(S,w){var Q=Jc.p;try{return Jc.p=S,w()}finally{Jc.p=Q}}function Wt(S){delete S[_0],delete S[TA],delete S[hNe],delete S[Poe]}function bn(S){var w;if(w=S[_0])return w;for(var Q=S.parentNode;Q;){if(w=Q[p9]||Q[_0]){if(Q=w.alternate,w.child!==null||Q!==null&&Q.child!==null)for(S=r9(S);S!==null;){if(Q=S[_0])return Q;S=r9(S)}return w}S=Q,Q=S.parentNode}return null}function pn(S){if(S=S[_0]||S[p9]){var w=S.tag;if(w===5||w===6||w===13||w===31||w===26||w===27||w===3)return S}return null}function wn(S){var w=S.tag;if(w===5||w===26||w===27||w===6)return S.stateNode;throw Error("getNodeFromInstance: Invalid argument.")}function Fn(S){var w=S[y_];return w||(w=S[y_]={hoistableStyles:new Map,hoistableScripts:new Map}),w}function mn(S){S[Kx]=!0}function _n(S){S[m9]=void 0}function no(S,w){To(S,w),To(S+"Capture",w)}function To(S,w){g9[S]&&console.error("EventRegistry: More than one plugin attempted to publish the same registration name, `%s`.",S),g9[S]=w;var Q=S.toLowerCase();UF[Q]=S,S==="onDoubleClick"&&(UF.ondblclick=S);for(S=0;S<w.length;S++)_9.add(w[S])}function ir(S,w){F_e[w.type]||w.onChange||w.onInput||w.readOnly||w.disabled||w.value==null||(S==="select"?console.error("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set `onChange`."):console.error("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`.")),w.onChange||w.readOnly||w.disabled||w.checked==null||console.error("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.")}function xt(S){if(J2.call(OW,S))return!0;if(J2.call(NN,S))return!1;if(dNe.test(S))return OW[S]=!0;return NN[S]=!0,console.error("Invalid attribute name: `%s`",S),!1}function gt(){var S=Zc;return Zc=!1,S}function Ot(S,w,Q){if(xt(w)){if(!S.hasAttribute(w)){switch(typeof Q){case"symbol":case"object":return Q;case"function":return Q;case"boolean":if(Q===!1)return Q}return Q===void 0?void 0:null}if(S=w.toLowerCase()==="nonce"?S.nonce:S.getAttribute(w),S===""&&Q===!0)return!0;return dt(Q,w),S===""+Q?Q:S}}function Zt(S,w,Q){if(xt(w))if(Q===null)S.removeAttribute(w);else{switch(typeof Q){case"undefined":case"function":case"symbol":S.removeAttribute(w);return;case"boolean":var W=w.toLowerCase().slice(0,5);if(W!=="data-"&&W!=="aria-"){S.removeAttribute(w);return}}dt(Q,w),S.setAttribute(w,Q)}}function je(S,w,Q){if(Q===null)S.removeAttribute(w);else{switch(typeof Q){case"undefined":case"function":case"symbol":case"boolean":S.removeAttribute(w);return}dt(Q,w),S.setAttribute(w,Q)}}function Mt(S,w,Q,W){if(W===null)S.removeAttribute(Q);else{switch(typeof W){case"undefined":case"function":case"symbol":case"boolean":S.removeAttribute(Q);return}dt(W,Q),S.setAttributeNS(w,Q,W)}}function Kt(S){switch(typeof S){case"bigint":case"boolean":case"number":case"string":case"undefined":return S;case"object":return mt(S),S;default:return""}}function nn(S){var w=S.type;return(S=S.nodeName)&&S.toLowerCase()==="input"&&(w==="checkbox"||w==="radio")}function Zn(S,w,Q){var W=Object.getOwnPropertyDescriptor(S.constructor.prototype,w);if(!S.hasOwnProperty(w)&&typeof W<"u"&&typeof W.get==="function"&&typeof W.set==="function"){var{get:oe,set:ae}=W;return Object.defineProperty(S,w,{configurable:!0,get:function(){return oe.call(this)},set:function(De){mt(De),Q=""+De,ae.call(this,De)}}),Object.defineProperty(S,w,{enumerable:W.enumerable}),{getValue:function(){return Q},setValue:function(De){mt(De),Q=""+De},stopTracking:function(){S._valueTracker=null,delete S[w]}}}}function Vn(S){if(!S._valueTracker){var w=nn(S)?"checked":"value";S._valueTracker=Zn(S,w,""+S[w])}}function Rn(S){if(!S)return!1;var w=S._valueTracker;if(!w)return!0;var Q=w.getValue(),W="";return S&&(W=nn(S)?S.checked?"true":"false":S.value),S=W,S!==Q?(w.setValue(S),!0):!1}function Bn(S){return S.replace(VW,function(w){return"\\"+w.charCodeAt(0).toString(16)+" "})}function ho(S,w){w.checked===void 0||w.defaultChecked===void 0||B7||(console.error("%s contains an input of type %s with both checked and defaultChecked props. Input elements must be either controlled or uncontrolled (specify either the checked prop, or the defaultChecked prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://react.dev/link/controlled-components",we()||"A component",w.type),B7=!0),w.value===void 0||w.defaultValue===void 0||z_e||(console.error("%s contains an input of type %s with both value and defaultValue props. Input elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://react.dev/link/controlled-components",we()||"A component",w.type),z_e=!0)}function Qo(S,w,Q,W,oe,ae,De,Qe){if(S.name="",De!=null&&typeof De!=="function"&&typeof De!=="symbol"&&typeof De!=="boolean"?(dt(De,"type"),S.type=De):S.removeAttribute("type"),w!=null)if(De==="number"){if(w===0&&S.value===""||S.value!=w)S.value=""+Kt(w)}else S.value!==""+Kt(w)&&(S.value=""+Kt(w));else De!=="submit"&&De!=="reset"||S.removeAttribute("value");w!=null?De==="number"&&S.value==w?mo(S,Kt(S.value)):mo(S,Kt(w)):Q!=null?mo(S,Kt(Q)):W!=null&&S.removeAttribute("value"),oe==null&&ae!=null&&(S.defaultChecked=!!ae),oe!=null&&(S.checked=oe&&typeof oe!=="function"&&typeof oe!=="symbol"),Qe!=null&&typeof Qe!=="function"&&typeof Qe!=="symbol"&&typeof Qe!=="boolean"?(dt(Qe,"name"),S.name=""+Kt(Qe)):S.removeAttribute("name")}function Nn(S,w,Q,W,oe,ae,De,Qe){if(ae!=null&&typeof ae!=="function"&&typeof ae!=="symbol"&&typeof ae!=="boolean"&&(dt(ae,"type"),S.type=ae),w!=null||Q!=null){if(!(ae!=="submit"&&ae!=="reset"||w!==void 0&&w!==null)){Vn(S);return}Q=Q!=null?""+Kt(Q):"",w=w!=null?""+Kt(w):Q,Qe||w===S.value||(S.value=w),S.defaultValue=w}W=W!=null?W:oe,W=typeof W!=="function"&&typeof W!=="symbol"&&!!W,S.checked=Qe?S.checked:!!W,S.defaultChecked=!!W,De!=null&&typeof De!=="function"&&typeof De!=="symbol"&&typeof De!=="boolean"&&(dt(De,"name"),S.name=De),Vn(S)}function mo(S,w){S.defaultValue!==""+w&&(S.defaultValue=""+w)}function Io(S,w){w.value==null&&(typeof w.children==="object"&&w.children!==null?PX.Children.forEach(w.children,function(Q){Q==null||typeof Q==="string"||typeof Q==="number"||typeof Q==="bigint"||YM||(YM=!0,console.error("Cannot infer the option value of complex children. Pass a `value` prop or use a plain string as children to <option>."))}):w.dangerouslySetInnerHTML==null||WF||(WF=!0,console.error("Pass a `value` prop if you set dangerouslyInnerHTML so React knows which value should be selected."))),w.selected==null||RN||(console.error("Use the `defaultValue` or `value` props on <select> instead of setting `selected` on <option>."),RN=!0)}function io(){var S=we();return S?`

Check the render method of \``+S+"`.":""}function Wo(S,w,Q,W){if(S=S.options,w){w={};for(var oe=0;oe<Q.length;oe++)w["$"+Q[oe]]=!0;for(Q=0;Q<S.length;Q++)oe=w.hasOwnProperty("$"+S[Q].value),S[Q].selected!==oe&&(S[Q].selected=oe),oe&&W&&(S[Q].defaultSelected=!0)}else{Q=""+Kt(Q),w=null;for(oe=0;oe<S.length;oe++){if(S[oe].value===Q){S[oe].selected=!0,W&&(S[oe].defaultSelected=!0);return}w!==null||S[oe].disabled||(w=S[oe])}w!==null&&(w.selected=!0)}}function rr(S,w){for(S=0;S<Moe.length;S++){var Q=Moe[S];if(w[Q]!=null){var W=O0(w[Q]);w.multiple&&!W?console.error("The `%s` prop supplied to <select> must be an array if `multiple` is true.%s",Q,io()):!w.multiple&&W&&console.error("The `%s` prop supplied to <select> must be a scalar value if `multiple` is false.%s",Q,io())}}w.value===void 0||w.defaultValue===void 0||Eoe||(console.error("Select elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled select element and remove one of these props. More info: https://react.dev/link/controlled-components"),Eoe=!0)}function xr(S,w){w.value===void 0||w.defaultValue===void 0||O_e||(console.error("%s contains a textarea with both value and defaultValue props. Textarea elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled textarea and remove one of these props. More info: https://react.dev/link/controlled-components",we()||"A component"),O_e=!0),w.children!=null&&w.value==null&&console.error("Use the `defaultValue` or `value` props instead of setting children on <textarea>.")}function Ci(S,w,Q){if(w!=null&&(w=""+Kt(w),w!==S.value&&(S.value=w),Q==null)){S.defaultValue!==w&&(S.defaultValue=w);return}S.defaultValue=Q!=null?""+Kt(Q):""}function ea(S,w,Q,W){if(w==null){if(W!=null){if(Q!=null)throw Error("If you supply `defaultValue` on a <textarea>, do not pass children.");if(O0(W)){if(1<W.length)throw Error("<textarea> can only have at most one child.");W=W[0]}Q=W}Q==null&&(Q=""),w=Q}Q=Kt(w),S.defaultValue=Q,W=S.textContent,W===Q&&W!==""&&W!==null&&(S.value=W),Vn(S)}function ya(S,w){return S.serverProps===void 0&&S.serverTail.length===0&&S.children.length===1&&3<S.distanceFromLeaf&&S.distanceFromLeaf>15-w?ya(S.children[0],w):S}function Oo(S){return"  "+"  ".repeat(S)}function $i(S){return"+ "+"  ".repeat(S)}function Ei(S){return"- "+"  ".repeat(S)}function hs(S){switch(S.tag){case 26:case 27:case 5:return S.type;case 16:return"Lazy";case 31:return"Activity";case 13:return"Suspense";case 19:return"SuspenseList";case 0:case 15:return S=S.type,S.displayName||S.name||null;case 11:return S=S.type.render,S.displayName||S.name||null;case 1:return S=S.type,S.displayName||S.name||null;default:return null}}function il(S,w){return Sy.test(S)?(S=JSON.stringify(S),S.length>w-2?8>w?'{"..."}':"{"+S.slice(0,w-7)+'..."}':"{"+S+"}"):S.length>w?5>w?'{"..."}':S.slice(0,w-3)+"...":S}function kl(S,w,Q){var W=120-2*Q;if(w===null)return $i(Q)+il(S,W)+`
`;if(typeof w==="string"){for(var oe=0;oe<w.length&&oe<S.length&&w.charCodeAt(oe)===S.charCodeAt(oe);oe++);return oe>W-8&&10<oe&&(S="..."+S.slice(oe-8),w="..."+w.slice(oe-8)),$i(Q)+il(S,W)+`
`+Ei(Q)+il(w,W)+`
`}return Oo(Q)+il(S,W)+`
`}function Xc(S){return Object.prototype.toString.call(S).replace(/^\[object (.*)\]$/,function(w,Q){return Q})}function Od(S,w){switch(typeof S){case"string":return S=JSON.stringify(S),S.length>w?5>w?'"..."':S.slice(0,w-4)+'..."':S;case"object":if(S===null)return"null";if(O0(S))return"[...]";if(S.$$typeof===$4)return(w=U(S.type))?"<"+w+">":"<...>";var Q=Xc(S);if(Q==="Object"){Q="",w-=2;for(var W in S)if(S.hasOwnProperty(W)){var oe=JSON.stringify(W);if(oe!=='"'+W+'"'&&(W=oe),w-=W.length-2,oe=Od(S[W],15>w?w:15),w-=oe.length,0>w){Q+=Q===""?"...":", ...";break}Q+=(Q===""?"":",")+W+":"+oe}return"{"+Q+"}"}return Q;case"function":return(w=S.displayName||S.name)?"function "+w:"function";default:return String(S)}}function cp(S,w){return typeof S!=="string"||Sy.test(S)?"{"+Od(S,w-2)+"}":S.length>w-2?5>w?'"..."':'"'+S.slice(0,w-5)+'..."':'"'+S+'"'}function or(S,w,Q){var W=120-Q.length-S.length,oe=[],ae;for(ae in w)if(w.hasOwnProperty(ae)&&ae!=="children"){var De=cp(w[ae],120-Q.length-ae.length-1);W-=ae.length+De.length+2,oe.push(ae+"="+De)}return oe.length===0?Q+"<"+S+`>
`:0<W?Q+"<"+S+" "+oe.join(" ")+`>
`:Q+"<"+S+`
`+Q+"  "+oe.join(`
`+Q+"  ")+`
`+Q+`>
`}function Gr(S,w,Q){var W="",oe=pa({},w),ae;for(ae in S)if(S.hasOwnProperty(ae)){delete oe[ae];var De=120-2*Q-ae.length-2,Qe=Od(S[ae],De);w.hasOwnProperty(ae)?(De=Od(w[ae],De),W+=$i(Q)+ae+": "+Qe+`
`,W+=Ei(Q)+ae+": "+De+`
`):W+=$i(Q)+ae+": "+Qe+`
`}for(var ot in oe)oe.hasOwnProperty(ot)&&(S=Od(oe[ot],120-2*Q-ot.length-2),W+=Ei(Q)+ot+": "+S+`
`);return W}function ti(S,w,Q,W){var oe="",ae=new Map;for(_t in Q)Q.hasOwnProperty(_t)&&ae.set(_t.toLowerCase(),_t);if(ae.size===1&&ae.has("children"))oe+=or(S,w,Oo(W));else{for(var De in w)if(w.hasOwnProperty(De)&&De!=="children"){var Qe=120-2*(W+1)-De.length-1,ot=ae.get(De.toLowerCase());if(ot!==void 0){ae.delete(De.toLowerCase());var _t=w[De];ot=Q[ot];var Yt=cp(_t,Qe);Qe=cp(ot,Qe),typeof _t==="object"&&_t!==null&&typeof ot==="object"&&ot!==null&&Xc(_t)==="Object"&&Xc(ot)==="Object"&&(2<Object.keys(_t).length||2<Object.keys(ot).length||-1<Yt.indexOf("...")||-1<Qe.indexOf("..."))?oe+=Oo(W+1)+De+`={{
`+Gr(_t,ot,W+2)+Oo(W+1)+`}}
`:(oe+=$i(W+1)+De+"="+Yt+`
`,oe+=Ei(W+1)+De+"="+Qe+`
`)}else oe+=Oo(W+1)+De+"="+cp(w[De],Qe)+`
`}ae.forEach(function(rn){if(rn!=="children"){var on=120-2*(W+1)-rn.length-1;oe+=Ei(W+1)+rn+"="+cp(Q[rn],on)+`
`}}),oe=oe===""?Oo(W)+"<"+S+`>
`:Oo(W)+"<"+S+`
`+oe+Oo(W)+`>
`}if(S=Q.children,w=w.children,typeof S==="string"||typeof S==="number"||typeof S==="bigint"){if(ae="",typeof w==="string"||typeof w==="number"||typeof w==="bigint")ae=""+w;oe+=kl(ae,""+S,W+1)}else if(typeof w==="string"||typeof w==="number"||typeof w==="bigint")oe=S==null?oe+kl(""+w,null,W+1):oe+kl(""+w,void 0,W+1);return oe}function $l(S,w){var Q=hs(S);if(Q===null){Q="";for(S=S.child;S;)Q+=$l(S,w),S=S.sibling;return Q}return Oo(w)+"<"+Q+`>
`}function Ll(S,w){var Q=ya(S,w);if(Q!==S&&(S.children.length!==1||S.children[0]!==Q))return Oo(w)+`...
`+Ll(Q,w+1);Q="";var W=S.fiber._debugInfo;if(W)for(var oe=0;oe<W.length;oe++){var ae=W[oe].name;typeof ae==="string"&&(Q+=Oo(w)+"<"+ae+`>
`,w++)}if(W="",oe=S.fiber.pendingProps,S.fiber.tag===6)W=kl(oe,S.serverProps,w),w++;else if(ae=hs(S.fiber),ae!==null)if(S.serverProps===void 0){W=w;var De=120-2*W-ae.length-2,Qe="";for(_t in oe)if(oe.hasOwnProperty(_t)&&_t!=="children"){var ot=cp(oe[_t],15);if(De-=_t.length+ot.length+2,0>De){Qe+=" ...";break}Qe+=" "+_t+"="+ot}W=Oo(W)+"<"+ae+Qe+`>
`,w++}else S.serverProps===null?(W=or(ae,oe,$i(w)),w++):typeof S.serverProps==="string"?console.error("Should not have matched a non HostText fiber to a Text node. This is a bug in React."):(W=ti(ae,oe,S.serverProps,w),w++);var _t="";oe=S.fiber.child;for(ae=0;oe&&ae<S.children.length;)De=S.children[ae],De.fiber===oe?(_t+=Ll(De,w),ae++):_t+=$l(oe,w),oe=oe.sibling;oe&&0<S.children.length&&(_t+=Oo(w)+`...
`),oe=S.serverTail,S.serverProps===null&&w--;for(S=0;S<oe.length;S++)ae=oe[S],_t=typeof ae==="string"?_t+(Ei(w)+il(ae,120-2*w)+`
`):_t+or(ae.type,ae.props,Ei(w));return Q+W+_t}function Vd(S){try{return`

`+Ll(S,0)}catch(w){return""}}function $1(S,w,Q){for(var W=w,oe=null,ae=0;W;)W===S&&(ae=0),oe={fiber:W,children:oe!==null?[oe]:[],serverProps:W===w?Q:W===S?null:void 0,serverTail:[],distanceFromLeaf:ae},ae++,W=W.return;return oe!==null?Vd(oe).replaceAll(/^[+-]/gm,">"):""}function fm(S,w){var Q=pa({},S||Boe),W={tag:w};if(woe.indexOf(w)!==-1&&(Q.aTagInScope=null,Q.buttonTagInScope=null,Q.nobrTagInScope=null),V_e.indexOf(w)!==-1&&(Q.pTagInButtonScope=null),QN.indexOf(w)!==-1&&w!=="address"&&w!=="div"&&w!=="p"&&(Q.listItemTagAutoclosing=null,Q.dlItemTagAutoclosing=null),Q.current=W,w==="form"&&(Q.formTag=W),w==="a"&&(Q.aTagInScope=W),w==="button"&&(Q.buttonTagInScope=W),w==="nobr"&&(Q.nobrTagInScope=W),w==="p"&&(Q.pTagInButtonScope=W),w==="li"&&(Q.listItemTagAutoclosing=W),w==="dd"||w==="dt")Q.dlItemTagAutoclosing=W;return w==="#document"||w==="html"?Q.containerTagInScope=null:Q.containerTagInScope||(Q.containerTagInScope=W),S!==null||w!=="#document"&&w!=="html"&&w!=="body"?Q.implicitRootScope===!0&&(Q.implicitRootScope=!1):Q.implicitRootScope=!0,Q}function xa(S,w,Q){switch(w){case"tr":return S==="th"||S==="td"||S==="style"||S==="script"||S==="template";case"tbody":case"thead":case"tfoot":return S==="tr"||S==="style"||S==="script"||S==="template";case"colgroup":return S==="col"||S==="template";case"table":return S==="caption"||S==="colgroup"||S==="tbody"||S==="tfoot"||S==="thead"||S==="style"||S==="script"||S==="template";case"head":return S==="base"||S==="basefont"||S==="bgsound"||S==="link"||S==="meta"||S==="title"||S==="noscript"||S==="noframes"||S==="style"||S==="script"||S==="template";case"html":if(Q)break;return S==="head"||S==="body"||S==="frameset";case"frameset":return S==="frame";case"#document":if(!Q)return S==="html"}switch(S){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":return w!=="h1"&&w!=="h2"&&w!=="h3"&&w!=="h4"&&w!=="h5"&&w!=="h6";case"rp":case"rt":return Y_e.indexOf(w)===-1;case"caption":case"col":case"colgroup":case"input":return w!=="select";case"frameset":case"frame":case"tbody":case"td":case"tfoot":case"th":case"thead":case"tr":return w==null;case"head":return Q||w===null;case"html":return Q&&w==="#document"||w===null;case"body":return Q&&(w==="#document"||w==="html")||w===null}return!0}function k0(S,w){switch(S){case"address":case"article":case"aside":case"blockquote":case"center":case"details":case"dialog":case"dir":case"div":case"dl":case"fieldset":case"figcaption":case"figure":case"footer":case"header":case"hgroup":case"main":case"menu":case"nav":case"ol":case"p":case"section":case"summary":case"ul":case"pre":case"listing":case"table":case"hr":case"xmp":case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":return w.pTagInButtonScope;case"form":return w.formTag||w.pTagInButtonScope;case"li":return w.listItemTagAutoclosing;case"dd":case"dt":return w.dlItemTagAutoclosing;case"button":return w.buttonTagInScope;case"a":return w.aTagInScope;case"nobr":return w.nobrTagInScope}return null}function ym(S,w){for(;S;){switch(S.tag){case 5:case 26:case 27:if(S.type===w)return S}S=S.return}return null}function _u(S,w){w=w||Boe;var Q=w.current;if(w=(Q=xa(S,Q&&Q.tag,w.implicitRootScope)?null:Q)?null:k0(S,w),w=Q||w,!w)return!0;var W=w.tag;if(w=String(!!Q)+"|"+S+"|"+W,XF[w])return!1;XF[w]=!0;var oe=(w=Dg)?ym(w.return,W):null,ae=w!==null&&oe!==null?$1(oe,w,null):"",De="<"+S+">";return Q?(Q="",W==="table"&&S==="tr"&&(Q+=" Add a <tbody>, <thead> or <tfoot> to your code to match the DOM tree generated by the browser."),console.error(`In HTML, %s cannot be a child of <%s>.%s
This will cause a hydration error.%s`,De,W,Q,ae)):console.error(`In HTML, %s cannot be a descendant of <%s>.
This will cause a hydration error.%s`,De,W,ae),w&&(S=w.return,oe===null||S===null||oe===S&&S._debugOwner===w._debugOwner||ye(oe,function(){console.error(`<%s> cannot contain a nested %s.
See this log for the ancestor stack trace.`,W,De)})),!1}function o0(S,w,Q){if(Q||xa("#text",w,!1))return!0;if(Q="#text|"+w,XF[Q])return!1;XF[Q]=!0;var W=(Q=Dg)?ym(Q,w):null;return Q=Q!==null&&W!==null?$1(W,Q,Q.tag!==6?{children:null}:null):"",/\S/.test(S)?console.error(`In HTML, text nodes cannot be a child of <%s>.
This will cause a hydration error.%s`,w,Q):console.error(`In HTML, whitespace text nodes cannot be a child of <%s>. Make sure you don't have any extra whitespace between tags on each line of your source code.
This will cause a hydration error.%s`,w,Q),!1}function Zi(S,w){if(w){var Q=S.firstChild;if(Q&&Q===S.lastChild&&Q.nodeType===3){Q.nodeValue=w;return}}S.textContent=w}function Hl(S){return S.replace(W_e,function(w,Q){return Q.toUpperCase()})}function da(S,w,Q){var W=w.indexOf("--")===0;W||(-1<w.indexOf("-")?GM.hasOwnProperty(w)&&GM[w]||(GM[w]=!0,console.error("Unsupported style property %s. Did you mean %s?",w,Hl(w.replace(U_e,"ms-")))):G_e.test(w)?GM.hasOwnProperty(w)&&GM[w]||(GM[w]=!0,console.error("Unsupported vendor-prefixed style property %s. Did you mean %s?",w,w.charAt(0).toUpperCase()+w.slice(1))):!Noe.test(Q)||R.hasOwnProperty(Q)&&R[Q]||(R[Q]=!0,console.error(`Style property values shouldn't contain a semicolon. Try "%s: %s" instead.`,w,Q.replace(Noe,""))),typeof Q==="number"&&(isNaN(Q)?z||(z=!0,console.error("`NaN` is an invalid value for the `%s` css style property.",w)):isFinite(Q)||q||(q=!0,console.error("`Infinity` is an invalid value for the `%s` css style property.",w)))),Q==null||typeof Q==="boolean"||Q===""?W?S.setProperty(w,""):w==="float"?S.cssFloat="":S[w]="":W?S.setProperty(w,Q):typeof Q!=="number"||Q===0||pe.has(w)?w==="float"?S.cssFloat=Q:(rt(Q,w),S[w]=(""+Q).trim()):S[w]=Q+"px"}function zc(S,w,Q){if(w!=null&&typeof w!=="object")throw Error("The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.");if(w&&Object.freeze(w),S=S.style,Q!=null){if(w){var W={};if(Q){for(var oe in Q)if(Q.hasOwnProperty(oe)&&!w.hasOwnProperty(oe))for(var ae=YW[oe]||[oe],De=0;De<ae.length;De++)W[ae[De]]=oe}for(var Qe in w)if(w.hasOwnProperty(Qe)&&(!Q||Q[Qe]!==w[Qe]))for(oe=YW[Qe]||[Qe],ae=0;ae<oe.length;ae++)W[oe[ae]]=Qe;Qe={};for(var ot in w)for(oe=YW[ot]||[ot],ae=0;ae<oe.length;ae++)Qe[oe[ae]]=ot;ot={};for(var _t in W)if(oe=W[_t],(ae=Qe[_t])&&oe!==ae&&(De=oe+","+ae,!ot[De])){ot[De]=!0,De=console;var Yt=w[oe];De.error.call(De,"%s a style property during rerender (%s) when a conflicting property is set (%s) can lead to styling bugs. To avoid this, don't mix shorthand and non-shorthand properties for the same value; instead, replace the shorthand with separate values.",Yt==null||typeof Yt==="boolean"||Yt===""?"Removing":"Updating",oe,ae)}}for(var rn in Q)!Q.hasOwnProperty(rn)||w!=null&&w.hasOwnProperty(rn)||(rn.indexOf("--")===0?S.setProperty(rn,""):rn==="float"?S.cssFloat="":S[rn]="",Zc=!0);for(var on in w)_t=w[on],w.hasOwnProperty(on)&&Q[on]!==_t&&(da(S,on,_t),Zc=!0)}else for(W in w)w.hasOwnProperty(W)&&da(S,W,w[W])}function ua(S){if(S.indexOf("-")===-1)return!1;switch(S){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}function ri(S){return ut.get(S)||S}function ic(S,w){if(J2.call(to,w)&&to[w])return!0;if(Zo.test(w)){if(S="aria-"+w.slice(4).toLowerCase(),S=In.hasOwnProperty(S)?S:null,S==null)return console.error("Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.",w),to[w]=!0;if(w!==S)return console.error("Invalid ARIA attribute `%s`. Did you mean `%s`?",w,S),to[w]=!0}if(Xo.test(w)){if(S=w.toLowerCase(),S=In.hasOwnProperty(S)?S:null,S==null)return to[w]=!0,!1;w!==S&&(console.error("Unknown ARIA attribute `%s`. Did you mean `%s`?",w,S),to[w]=!0)}return!0}function wh(S,w){var Q=[],W;for(W in w)ic(S,W)||Q.push(W);w=Q.map(function(oe){return"`"+oe+"`"}).join(", "),Q.length===1?console.error("Invalid aria prop %s on <%s> tag. For details, see https://react.dev/link/invalid-aria-props",w,S):1<Q.length&&console.error("Invalid aria props %s on <%s> tag. For details, see https://react.dev/link/invalid-aria-props",w,S)}function Qs(S,w,Q,W){if(J2.call(ts,w)&&ts[w])return!0;var oe=w.toLowerCase();if(oe==="onfocusin"||oe==="onfocusout")return console.error("React uses onFocus and onBlur instead of onFocusIn and onFocusOut. All React events are normalized to bubble, so onFocusIn and onFocusOut are not needed/supported by React."),ts[w]=!0;if(typeof Q==="function"&&(S==="form"&&w==="action"||S==="input"&&w==="formAction"||S==="button"&&w==="formAction"))return!0;if(W!=null){if(S=W.possibleRegistrationNames,W.registrationNameDependencies.hasOwnProperty(w))return!0;if(W=S.hasOwnProperty(oe)?S[oe]:null,W!=null)return console.error("Invalid event handler property `%s`. Did you mean `%s`?",w,W),ts[w]=!0;if(bl.test(w))return console.error("Unknown event handler property `%s`. It will be ignored.",w),ts[w]=!0}else if(bl.test(w))return kN.test(w)&&console.error("Invalid event handler property `%s`. React events use the camelCase naming convention, for example `onClick`.",w),ts[w]=!0;if(LN.test(w)||e3.test(w))return!0;if(oe==="innerhtml")return console.error("Directly setting property `innerHTML` is not permitted. For more information, lookup documentation on `dangerouslySetInnerHTML`."),ts[w]=!0;if(oe==="aria")return console.error("The `aria` attribute is reserved for future use in React. Pass individual `aria-` attributes instead."),ts[w]=!0;if(oe==="is"&&Q!==null&&Q!==void 0&&typeof Q!=="string")return console.error("Received a `%s` for a string attribute `is`. If this is expected, cast the value to a string.",typeof Q),ts[w]=!0;if(typeof Q==="number"&&isNaN(Q))return console.error("Received NaN for the `%s` attribute. If this is expected, cast the value to a string.",w),ts[w]=!0;if(wt.hasOwnProperty(oe)){if(oe=wt[oe],oe!==w)return console.error("Invalid DOM property `%s`. Did you mean `%s`?",w,oe),ts[w]=!0}else if(w!==oe)return console.error("React does not recognize the `%s` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `%s` instead. If you accidentally passed it from a parent component, remove it from the DOM element.",w,oe),ts[w]=!0;switch(w){case"dangerouslySetInnerHTML":case"children":case"style":case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":return!0;case"innerText":case"textContent":return!0}switch(typeof Q){case"boolean":switch(w){case"autoFocus":case"checked":case"multiple":case"muted":case"selected":case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":case"capture":case"download":case"inert":return!0;default:if(oe=w.toLowerCase().slice(0,5),oe==="data-"||oe==="aria-")return!0;return Q?console.error('Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.',Q,w,w,Q,w):console.error('Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.',Q,w,w,Q,w,w,w),ts[w]=!0}case"function":case"symbol":return ts[w]=!0,!1;case"string":if(Q==="false"||Q==="true"){switch(w){case"checked":case"selected":case"multiple":case"muted":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":case"inert":break;default:return!0}console.error("Received the string `%s` for the boolean attribute `%s`. %s Did you mean %s={%s}?",Q,w,Q==="false"?"The browser will interpret it as a truthy value.":'Although this works, it will not work as expected if you pass the string "false".',w,Q),ts[w]=!0}}return!0}function Yd(S,w,Q){var W=[],oe;for(oe in w)Qs(S,oe,w[oe],Q)||W.push(oe);w=W.map(function(ae){return"`"+ae+"`"}).join(", "),W.length===1?console.error("Invalid value for prop %s on <%s> tag. Either remove it from the element, or pass a string or number value to keep it in the DOM. For details, see https://react.dev/link/attribute-behavior ",w,S):1<W.length&&console.error("Invalid values for props %s on <%s> tag. Either remove them from the element, or pass a string or number value to keep them in the DOM. For details, see https://react.dev/link/attribute-behavior ",w,S)}function Bh(S){return hn.test(""+S)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":S}function Gd(){}function gA(S){return S=S.target||S.srcElement||window,S.correspondingUseElement&&(S=S.correspondingUseElement),S.nodeType===3?S.parentNode:S}function r0(S){var w=pn(S);if(w&&(S=w.stateNode)){var Q=S[TA]||null;e:switch(S=w.stateNode,w.type){case"input":if(Qo(S,Q.value,Q.defaultValue,Q.defaultValue,Q.checked,Q.defaultChecked,Q.type,Q.name),w=Q.name,Q.type==="radio"&&w!=null){for(Q=S;Q.parentNode;)Q=Q.parentNode;dt(w,"name"),Q=Q.querySelectorAll('input[name="'+Bn(""+w)+'"][type="radio"]');for(w=0;w<Q.length;w++){var W=Q[w];if(W!==S&&W.form===S.form){var oe=W[TA]||null;if(!oe)throw Error("ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.");Qo(W,oe.value,oe.defaultValue,oe.defaultValue,oe.checked,oe.defaultChecked,oe.type,oe.name)}}for(w=0;w<Q.length;w++)W=Q[w],W.form===S.form&&Rn(W)}break e;case"textarea":Ci(S,Q.value,Q.defaultValue);break e;case"select":w=Q.value,w!=null&&Wo(S,!!Q.multiple,w,!1)}}}function q1(S,w,Q){if(Nr)return S(w,Q);Nr=!0;try{var W=S(w);return W}finally{if(Nr=!1,fn!==null||co!==null){if(GI(),fn&&(w=fn,S=co,co=fn=null,r0(w),S))for(w=0;w<S.length;w++)r0(S[w])}}}function Tf(S,w){var Q=S.stateNode;if(Q===null)return null;var W=Q[TA]||null;if(W===null)return null;Q=W[w];e:switch(w){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(W=!W.disabled)||(S=S.type,W=!(S==="button"||S==="input"||S==="select"||S==="textarea")),S=!W;break e;default:S=!1}if(S)return null;if(Q&&typeof Q!=="function")throw Error("Expected `"+w+"` listener to be a function, instead got a value of `"+typeof Q+"` type.");return Q}function lp(){if(Su)return Su;var S,w=Lh,Q=w.length,W,oe="value"in os?os.value:os.textContent,ae=oe.length;for(S=0;S<Q&&w[S]===oe[S];S++);var De=Q-S;for(W=1;W<=De&&w[Q-W]===oe[ae-W];W++);return Su=oe.slice(S,1<W?1-W:void 0)}function fg(S){var w=S.keyCode;return"charCode"in S?(S=S.charCode,S===0&&w===13&&(S=13)):S=w,S===10&&(S=13),32<=S||S===13?S:0}function gu(){return!0}function a_(){return!1}function Kh(S){function w(Q,W,oe,ae,De){this._reactName=Q,this._targetInst=oe,this.type=W,this.nativeEvent=ae,this.target=De,this.currentTarget=null;for(var Qe in S)S.hasOwnProperty(Qe)&&(Q=S[Qe],this[Qe]=Q?Q(ae):ae[Qe]);return this.isDefaultPrevented=(ae.defaultPrevented!=null?ae.defaultPrevented:ae.returnValue===!1)?gu:a_,this.isPropagationStopped=a_,this}return pa(w.prototype,{preventDefault:function(){this.defaultPrevented=!0;var Q=this.nativeEvent;Q&&(Q.preventDefault?Q.preventDefault():typeof Q.returnValue!=="unknown"&&(Q.returnValue=!1),this.isDefaultPrevented=gu)},stopPropagation:function(){var Q=this.nativeEvent;Q&&(Q.stopPropagation?Q.stopPropagation():typeof Q.cancelBubble!=="unknown"&&(Q.cancelBubble=!0),this.isPropagationStopped=gu)},persist:function(){},isPersistent:gu}),w}function Nx(S){var w=this.nativeEvent;return w.getModifierState?w.getModifierState(S):(S=yxo[S])?!!w[S]:!1}function c_(){return Nx}function N2(S,w){switch(S){case"keyup":return Nxo.indexOf(w.keyCode)!==-1;case"keydown":return w.keyCode!==w2t;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function J1(S){return S=S.detail,typeof S==="object"&&"data"in S?S.data:null}function hI(S,w){switch(S){case"compositionend":return J1(w);case"keypress":if(w.which!==T2t)return null;return N2t=!0,D2t;case"textInput":return S=w.data,S===D2t&&N2t?null:S;default:return null}}function L0(S,w){if(UW)return S==="compositionend"||!_Ne&&N2(S,w)?(S=lp(),Su=Lh=os=null,UW=!1,S):null;switch(S){case"paste":return null;case"keypress":if(!(w.ctrlKey||w.altKey||w.metaKey)||w.ctrlKey&&w.altKey){if(w.char&&1<w.char.length)return w.char;if(w.which)return String.fromCharCode(w.which)}return null;case"compositionend":return B2t&&w.locale!=="ko"?null:w.data;default:return null}}function dI(S){var w=S&&S.nodeName&&S.nodeName.toLowerCase();return w==="input"?!!Qxo[S.type]:w==="textarea"?!0:!1}function Z1(S){if(!ia)return!1;S="on"+S;var w=S in document;return w||(w=document.createElement("div"),w.setAttribute(S,"return;"),w=typeof w[S]==="function"),w}function Ud(S,w,Q,W){fn?co?co.push(W):co=[W]:fn=W,w=nb(w,"onChange"),0<w.length&&(Q=new GW("onChange","change",null,Q,W),S.push({event:Q,listeners:w}))}function Us(S){Mg(S,0)}function Bo(S){var w=wn(S);if(Rn(w))return S}function _d(S,w){if(S==="change")return w}function sl(){Loe&&(Loe.detachEvent("onpropertychange",Sa),Hoe=Loe=null)}function Sa(S){if(S.propertyName==="value"&&Bo(Hoe)){var w=[];Ud(w,Hoe,S,gA(S)),q1(Us,w)}}function AA(S,w,Q){S==="focusin"?(sl(),Loe=w,Hoe=Q,Loe.attachEvent("onpropertychange",Sa)):S==="focusout"&&sl()}function MC(S){if(S==="selectionchange"||S==="keyup"||S==="keydown")return Bo(Hoe)}function dD(S,w){if(S==="click")return Bo(w)}function wC(S,w){if(S==="input"||S==="change")return Bo(w)}function YH(S,w){return S===w&&(S!==0||1/S===1/w)||S!==S&&w!==w}function b4(S,w){if(Py(S,w))return!0;if(typeof S!=="object"||S===null||typeof w!=="object"||w===null)return!1;var Q=Object.keys(S),W=Object.keys(w);if(Q.length!==W.length)return!1;for(W=0;W<Q.length;W++){var oe=Q[W];if(!J2.call(w,oe)||!Py(S[oe],w[oe]))return!1}return!0}function I4(S){if(S=S||(typeof document<"u"?document:void 0),typeof S>"u")return null;try{return S.activeElement||S.body}catch(w){return S.body}}function A8(S){for(;S&&S.firstChild;)S=S.firstChild;return S}function i0(S,w){var Q=A8(S);S=0;for(var W;Q;){if(Q.nodeType===3){if(W=S+Q.textContent.length,S<=w&&W>=w)return{node:Q,offset:w-S};S=W}e:{for(;Q;){if(Q.nextSibling){Q=Q.nextSibling;break e}Q=Q.parentNode}Q=void 0}Q=A8(Q)}}function jc(S,w){return S&&w?S===w?!0:S&&S.nodeType===3?!1:w&&w.nodeType===3?jc(S,w.parentNode):("contains"in S)?S.contains(w):S.compareDocumentPosition?!!(S.compareDocumentPosition(w)&16):!1:!1}function f8(S){S=S!=null&&S.ownerDocument!=null&&S.ownerDocument.defaultView!=null?S.ownerDocument.defaultView:window;for(var w=I4(S.document);w instanceof S.HTMLIFrameElement;){try{var Q=typeof w.contentWindow.location.href==="string"}catch(W){Q=!1}if(Q)S=w.contentWindow;else break;w=I4(S.document)}return w}function yg(S){var w=S&&S.nodeName&&S.nodeName.toLowerCase();return w&&(w==="input"&&(S.type==="text"||S.type==="search"||S.type==="tel"||S.type==="url"||S.type==="password")||w==="textarea"||S.contentEditable==="true")}function ey(S,w,Q){var W=Q.window===Q?Q.document:Q.nodeType===9?Q:Q.ownerDocument;ANe||WW==null||WW!==I4(W)||(W=WW,("selectionStart"in W)&&yg(W)?W={start:W.selectionStart,end:W.selectionEnd}:(W=(W.ownerDocument&&W.ownerDocument.defaultView||window).getSelection(),W={anchorNode:W.anchorNode,anchorOffset:W.anchorOffset,focusNode:W.focusNode,focusOffset:W.focusOffset}),Foe&&b4(Foe,W)||(Foe=W,W=nb(gNe,"onSelect"),0<W.length&&(w=new GW("onSelect","select",null,w,Q),S.push({event:w,listeners:W}),w.target=WW)))}function xm(S,w){var Q={};return Q[S.toLowerCase()]=w.toLowerCase(),Q["Webkit"+S]="webkit"+w,Q["Moz"+S]="moz"+w,Q}function hp(S){if(fNe[S])return fNe[S];if(!XW[S])return S;var w=XW[S],Q;for(Q in w)if(w.hasOwnProperty(Q)&&Q in Q2t)return fNe[S]=w[Q];return S}function Cm(S,w){z2t.set(S,w),no(w,[S])}function bm(S,w){if(S.name!=null&&S.name!=="auto")return S.name;if(w.autoName!==null)return w.autoName;S=I9.identifierPrefix;var Q=zxo++;return S="_"+S+"t_"+Q.toString(32)+"_",w.autoName=S}function y8(S){if(S==null||typeof S==="string")return S;var w=null,Q=mX;if(Q!==null)for(var W=0;W<Q.length;W++){var oe=S[Q[W]];if(oe!=null){if(oe==="none")return"none";w=w==null?oe:w+(" "+oe)}}return w==null?S.default:w}function l_(S,w){return S=y8(S),w=y8(w),w==null?S==="auto"?null:S:w==="auto"?null:w}function KE(S){for(var w=j_e,Q=0;Q<S.length&&Q<Ab;Q++){var W=S[Q];if(typeof W==="object"&&W!==null)if(O0(W)&&W.length===2&&typeof W[0]==="string"){if(w!==j_e&&w!==INe)return CNe;w=INe}else return CNe;else{if(typeof W==="function"||typeof W==="string"&&50<W.length||w!==j_e&&w!==bNe||typeof W==="bigint")return CNe;w=bNe}}return w}function H0(S,w,Q,W){if(!ArrayBuffer.isView(S)){var oe=0,ae;for(ae in S)if(J2.call(S,ae)&&ae[0]!=="_"&&(oe++,Fp(ae,S[ae],w,Q,W),oe>=Ab)){w.push([W+"  ".repeat(Q)+"Only "+Ab+" properties are shown. React will not log more properties of this object.",""]);break}}}function Df(S){return"$$typeof"in S&&J2.call(S,"$$typeof")?S.$$typeof:void 0}function Fp(S,w,Q,W,oe){switch(typeof w){case"object":if(w===null){w="null";break}else{if(Df(w)===$4){var ae=U(w.type)||"…",De=w.key;w=w.props;var Qe=Object.keys(w),ot=Qe.length;if(De==null&&ot===0){w="<"+ae+" />";break}if(3>W||ot===1&&Qe[0]==="children"&&De==null){w="<"+ae+" … />";break}Q.push([oe+"  ".repeat(W)+S,"<"+ae]),De!==null&&Fp("key",De,Q,W+1,oe),S=!1,De=0;for(var _t in w)if(De++,_t==="children"?w.children!=null&&(!O0(w.children)||0<w.children.length)&&(S=!0):J2.call(w,_t)&&_t[0]!=="_"&&Fp(_t,w[_t],Q,W+1,oe),De>=Ab)break;Q.push(["",S?">…</"+ae+">":"/>"]);return}if(ae=Object.prototype.toString.call(w),ae=ae.slice(8,ae.length-1),ArrayBuffer.isView(w)){w=w.length,w=typeof w==="number"?ae+"("+w+")":ae;break}if(ae==="Array"){if(_t=w.length>Ab,De=KE(w),De===bNe||De===j_e){w=JSON.stringify(_t?w.slice(0,Ab).concat("…"):w);break}else if(De===INe){Q.push([oe+"  ".repeat(W)+S,""]);for(S=0;S<w.length&&S<Ab;S++)ae=w[S],Fp(ae[0],ae[1],Q,W+1,oe);_t&&Fp(Ab.toString(),"…",Q,W+1,oe);return}}if(ae==="Promise"){if(w.status==="fulfilled"){if(ae=Q.length,Fp(S,w.value,Q,W,oe),Q.length>ae){Q=Q[ae],Q[1]="Promise<"+(Q[1]||"Object")+">";return}}else if(w.status==="rejected"&&(ae=Q.length,Fp(S,w.reason,Q,W,oe),Q.length>ae)){Q=Q[ae],Q[1]="Rejected Promise<"+Q[1]+">";return}Q.push(["  ".repeat(W)+S,"Promise"]);return}ae==="Object"&&(_t=Object.getPrototypeOf(w))&&typeof _t.constructor==="function"&&(ae=_t.constructor.name),Q.push([oe+"  ".repeat(W)+S,ae==="Object"?3>W?"":"…":ae]),3>W&&H0(w,Q,W+1,oe);return}case"function":w=w.name,w=w===""||typeof w!=="string"?"() => {}":w+"() {}";break;case"string":w=w===Yxo?"…":JSON.stringify(1024<=w.length?w.slice(0,1023)+"…":w);break;case"undefined":w="undefined";break;case"boolean":w=w?"true":"false";break;default:w=String(w)}Q.push([oe+"  ".repeat(W)+S,w])}function uI(S,w,Q,W){var oe=!0,ae=0;for(Qe in S){if(ae>Ab){Q.push(["Previous object has more than "+Ab+" properties. React will not attempt to diff objects with too many properties.",""]),oe=!1;break}Qe in w||(Q.push([K_e+"  ".repeat(W)+Qe,"…"]),oe=!1),ae++}ae=0;for(var De in w){if(ae>Ab){Q.push(["Next object has more than "+Ab+" properties. React will not attempt to diff objects with too many properties.",""]),oe=!1;break}if(De in S){var Qe=S[De],ot=w[De];if(Qe!==ot){if(W===0&&De==="children"){oe="  ".repeat(W)+De,Q.push([K_e+oe,"…"],[$_e+oe,"…"]),oe=!1;continue}if(!(3<=W)){if(typeof Qe==="object"&&typeof ot==="object"&&Qe!==null&&ot!==null&&Df(Qe)===Df(ot))if(Df(ot)===$4){if(Qe.type===ot.type&&Qe.key===ot.key){Qe=U(ot.type)||"…",oe="  ".repeat(W)+De,Qe="<"+Qe+" … />",Q.push([K_e+oe,Qe],[$_e+oe,Qe]),oe=!1;continue}}else{var _t=Object.prototype.toString.call(Qe),Yt=Object.prototype.toString.call(ot);if(_t===Yt&&(Yt==="[object Object]"||Yt==="[object Array]")){_t=[Y2t+"  ".repeat(W)+De,Yt==="[object Array]"?"Array":""],Q.push(_t),Yt=Q.length,uI(Qe,ot,Q,W+1)?Yt===Q.length&&(_t[1]="Referentially unequal but deeply equal objects. Consider memoization."):oe=!1;continue}}else if(typeof Qe==="function"&&typeof ot==="function"&&Qe.name===ot.name&&Qe.length===ot.length&&(_t=Function.prototype.toString.call(Qe),Yt=Function.prototype.toString.call(ot),_t===Yt)){Qe=ot.name===""?"() => {}":ot.name+"() {}",Q.push([Y2t+"  ".repeat(W)+De,Qe+" Referentially unequal function closure. Consider memoization."]);continue}}Fp(De,Qe,Q,W,K_e),Fp(De,ot,Q,W,$_e),oe=!1}}else Q.push([$_e+"  ".repeat(W)+De,"…"]),oe=!1;ae++}return oe}function lh(S){fc=S&63?"Blocking":S&64?"Gesture":S&4194176?"Transition":S&62914560?"Suspense":S&2080374784?"Idle":"Other"}function Nf(S,w,Q,W){Pu&&(FN.start=w,FN.end=Q,UM.color="warning",UM.tooltipText=W,UM.properties=null,(S=S._debugTask)?S.run(performance.measure.bind(performance,W,FN)):performance.measure(W,FN),performance.clearMeasures(W))}function BC(S,w,Q){Nf(S,w,Q,"Reconnect")}function ty(S,w,Q,W,oe){var ae=Y(S);if(ae!==null&&Pu){var De=S.alternate,Qe=S.actualDuration;if(De===null||De.child!==S.child)for(var ot=S.child;ot!==null;ot=ot.sibling)Qe-=ot.actualDuration;Qe=0.5>Qe?W?"tertiary-light":"primary-light":10>Qe?W?"tertiary":"primary":100>Qe?W?"tertiary-dark":"primary-dark":"error";var _t=S.memoizedProps;W=S._debugTask,_t!==null&&De!==null&&De.memoizedProps!==_t?(ot=[Gxo],_t=uI(De.memoizedProps,_t,ot,0),1<ot.length?(_t&&!HN&&(De.lanes&oe)===0&&100<S.actualDuration?(HN=!0,ot[0]=Uxo,UM.color="warning",UM.tooltipText=G2t):(UM.color=Qe,UM.tooltipText=ae),UM.properties=ot,FN.start=w,FN.end=Q,S="​"+ae,W!=null?W.run(performance.measure.bind(performance,S,FN)):performance.measure(S,FN),performance.clearMeasures(S)):W!=null?W.run(console.timeStamp.bind(console,ae,w,Q,$x,void 0,Qe)):console.timeStamp(ae,w,Q,$x,void 0,Qe)):W!=null?W.run(console.timeStamp.bind(console,ae,w,Q,$x,void 0,Qe)):console.timeStamp(ae,w,Q,$x,void 0,Qe)}}function ny(S,w,Q,W){if(Pu){var oe=Y(S);if(oe!==null){for(var ae=null,De=[],Qe=0;Qe<W.length;Qe++){var ot=W[Qe];ae==null&&ot.source!==null&&(ae=ot.source._debugTask),ot=ot.value,De.push(["Error",typeof ot==="object"&&ot!==null&&typeof ot.message==="string"?String(ot.message):String(ot)])}S.key!==null&&Fp("key",S.key,De,0,""),S.memoizedProps!==null&&H0(S.memoizedProps,De,0,""),ae==null&&(ae=S._debugTask),S={start:w,end:Q,detail:{devtools:{color:"error",track:$x,tooltipText:S.tag===13?"Hydration failed":"Error boundary caught an error",properties:De}}},oe="​"+oe,ae?ae.run(performance.measure.bind(performance,oe,S)):performance.measure(oe,S),performance.clearMeasures(oe)}}}function s0(S,w,Q,W,oe){if(oe!==null){if(Pu){var ae=Y(S);if(ae!==null){W=[];for(var De=0;De<oe.length;De++){var Qe=oe[De].value;W.push(["Error",typeof Qe==="object"&&Qe!==null&&typeof Qe.message==="string"?String(Qe.message):String(Qe)])}S.key!==null&&Fp("key",S.key,W,0,""),S.memoizedProps!==null&&H0(S.memoizedProps,W,0,""),w={start:w,end:Q,detail:{devtools:{color:"error",track:$x,tooltipText:"A lifecycle or effect errored",properties:W}}},S=S._debugTask,Q="​"+ae,S?S.run(performance.measure.bind(performance,Q,w)):performance.measure(Q,w),performance.clearMeasures(Q)}}}else ae=Y(S),ae!==null&&Pu&&(oe=1>W?"secondary-light":100>W?"secondary":500>W?"secondary-dark":"error",(S=S._debugTask)?S.run(console.timeStamp.bind(console,ae,w,Q,$x,void 0,oe)):console.timeStamp(ae,w,Q,$x,void 0,oe))}function $E(S,w,Q,W){!Pu||w<=S||(Q=(Q&738197653)===Q?"tertiary-dark":"primary-dark",W?W.run(console.timeStamp.bind(console,"Prewarm",S,w,fc,sc,Q)):console.timeStamp("Prewarm",S,w,fc,sc,Q))}function v4(S,w,Q,W){!Pu||w<=S||(Q=(Q&738197653)===Q?"tertiary-dark":"primary-dark",W?W.run(console.timeStamp.bind(console,"Suspended",S,w,fc,sc,Q)):console.timeStamp("Suspended",S,w,fc,sc,Q))}function qE(S,w,Q,W){!Pu||w<=S||(W?W.run(console.timeStamp.bind(console,"Errored",S,w,fc,sc,"error")):console.timeStamp("Errored",S,w,fc,sc,"error"))}function S4(S,w,Q,W){!Pu||w<=S||(W?W.run(console.timeStamp.bind(console,Q,S,w,fc,sc,"secondary-light")):console.timeStamp(Q,S,w,fc,sc,"secondary-light"))}function Je(S,w,Q,W,oe){if(Pu&&!(w<=S)){for(var ae=[],De=0;De<Q.length;De++){var Qe=Q[De].value;ae.push(["Error",typeof Qe==="object"&&Qe!==null&&typeof Qe.message==="string"?String(Qe.message):String(Qe)])}S={start:S,end:w,detail:{devtools:{color:"error",track:fc,trackGroup:sc,tooltipText:W?"Remaining Effects Errored":"Commit Errored",properties:ae}}},oe?oe.run(performance.measure.bind(performance,"Errored",S)):performance.measure("Errored",S),performance.clearMeasures("Errored")}}function ct(S,w,Q,W,oe){Q!==null?Je(S,w,Q,!1,oe):!Pu||w<=S||(oe?oe.run(console.timeStamp.bind(console,W?"Commit Interrupted View Transition":"Commit",S,w,fc,sc,W?"error":"secondary-dark")):console.timeStamp(W?"Commit Interrupted View Transition":"Commit",S,w,fc,sc,W?"error":"secondary-dark"))}function Dt(S,w,Q){!Pu||w<=S||(Q?Q.run(console.timeStamp.bind(console,"Animating",S,w,fc,sc,"secondary-dark")):console.timeStamp("Animating",S,w,fc,sc,"secondary-dark"))}function tn(){for(var S=jW,w=vNe=jW=0;w<S;){var Q=fb[w];fb[w++]=null;var W=fb[w];fb[w++]=null;var oe=fb[w];fb[w++]=null;var ae=fb[w];if(fb[w++]=null,W!==null&&oe!==null){var De=W.pending;De===null?oe.next=oe:(oe.next=De.next,De.next=oe),W.pending=oe}ae!==0&&uo(Q,oe,ae)}}function xn(S,w,Q,W){fb[jW++]=S,fb[jW++]=w,fb[jW++]=Q,fb[jW++]=W,vNe|=W,S.lanes|=W,S=S.alternate,S!==null&&(S.lanes|=W)}function Mn(S,w,Q,W){return xn(S,w,Q,W),ko(S)}function Ln(S,w){return xn(S,null,null,w),ko(S)}function uo(S,w,Q){S.lanes|=Q;var W=S.alternate;W!==null&&(W.lanes|=Q);for(var oe=!1,ae=S.return;ae!==null;)ae.childLanes|=Q,W=ae.alternate,W!==null&&(W.childLanes|=Q),ae.tag===22&&(S=ae.stateNode,S===null||S._visibility&zoe||(oe=!0)),S=ae,ae=ae.return;return S.tag===3?(ae=S.stateNode,oe&&w!==null&&(oe=31-mh(Q),S=ae.hiddenUpdates,W=S[oe],W===null?S[oe]=[w]:W.push(w),w.lane=Q|536870912),ae):null}function ko(S){if(Are>s5o)throw dz=Are=0,fre=wge=null,Error("Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.");dz>a5o&&(dz=0,fre=null,console.error("Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render.")),S.alternate===null&&(S.flags&4098)!==0&&yd(S);for(var w=S,Q=w.return;Q!==null;)w.alternate===null&&(w.flags&4098)!==0&&yd(S),w=Q,Q=w.return;return w.tag===3?w.stateNode:null}function tr(S){if(XM===null)return S;var w=XM(S);return w===void 0?S:w.current}function Dr(S,w){if(XM===null)return!1;var Q=XM,W=S.elementType;w=w.type;var oe=!1,ae=typeof w==="object"&&w!==null?w.$$typeof:null;switch(S.tag){case 1:typeof w==="function"&&(oe=!0);break;case 0:typeof w==="function"?oe=!0:ae===Qm&&(oe=!0);break;case 11:ae===BN?oe=!0:ae===Qm&&(oe=!0);break;case 14:case 15:ae===h9?oe=!0:ae===Qm&&(oe=!0);break;default:return!1}return oe&&(S=Q(W),S!==void 0&&S===Q(w))?!0:!1}function ta(S){XM!==null&&typeof WeakSet==="function"&&(KW===null&&(KW=new WeakSet),KW.add(S))}function Pa(S,w,Q){do{var W=S,oe=W.alternate,ae=W.child,De=W.sibling,Qe=W.tag,ot=W.type,_t=W.elementType,Yt=null;switch(W=null,Qe){case 0:case 1:Yt=ot;break;case 15:Yt=ot,W=_t;break;case 14:W=_t;break;case 11:Yt=ot.render,W=_t}if(XM===null)throw Error("Expected resolveFamily to be set during hot reload.");var rn=XM;if(ot=_t=!1,Yt!==null&&(Yt=rn(Yt),Yt!==void 0&&(Q.has(Yt)?ot=!0:w.has(Yt)&&(Qe===1?ot=!0:_t=!0))),ot||W===null||(Qe=rn(W),Qe!==void 0&&Q.has(Qe)?ot=!0:typeof W==="object"&&W.$$typeof===Qm&&(Qe=W._payload,Qe._status===1&&(Qe=rn(Qe._result.default),Qe!==void 0&&Q.has(Qe)&&(ot=!0)))),KW!==null&&(KW.has(S)||oe!==null&&KW.has(oe))&&(ot=!0),ot&&(S._debugNeedsRemount=!0),ot||_t)oe=Ln(S,2),oe!==null&&Kd(oe,S,2);if(ae===null||ot||Pa(ae,w,Q),De===null)break;S=De}while(1)}function Ws(S,w,Q,W){this.tag=S,this.key=Q,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=w,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=W,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null,this.actualDuration=-0,this.actualStartTime=-1.1,this.treeBaseDuration=this.selfBaseDuration=-0,this._debugTask=this._debugStack=this._debugOwner=this._debugInfo=null,this._debugNeedsRemount=!1,this._debugHookTypes=null,W2t||typeof Object.preventExtensions!=="function"||Object.preventExtensions(this)}function na(S){return S=S.prototype,!(!S||!S.isReactComponent)}function vc(S,w){var Q=S.alternate;switch(Q===null?(Q=u(S.tag,w,S.key,S.mode),Q.elementType=S.elementType,Q.type=S.type,Q.stateNode=S.stateNode,Q._debugOwner=S._debugOwner,Q._debugStack=S._debugStack,Q._debugTask=S._debugTask,Q._debugHookTypes=S._debugHookTypes,Q.alternate=S,S.alternate=Q):(Q.pendingProps=w,Q.type=S.type,Q.flags=0,Q.subtreeFlags=0,Q.deletions=null,Q.actualDuration=-0,Q.actualStartTime=-1.1),Q.flags=S.flags&1206910976,Q.childLanes=S.childLanes,Q.lanes=S.lanes,Q.child=S.child,Q.memoizedProps=S.memoizedProps,Q.memoizedState=S.memoizedState,Q.updateQueue=S.updateQueue,w=S.dependencies,Q.dependencies=w===null?null:{lanes:w.lanes,firstContext:w.firstContext,_debugThenableState:w._debugThenableState},Q.sibling=S.sibling,Q.index=S.index,Q.ref=S.ref,Q.refCleanup=S.refCleanup,Q.selfBaseDuration=S.selfBaseDuration,Q.treeBaseDuration=S.treeBaseDuration,Q._debugInfo=S._debugInfo,Q._debugNeedsRemount=S._debugNeedsRemount,Q.tag){case 0:case 15:case 14:case 1:case 11:Q.type=tr(S.type)}return Q}function zp(S,w){S.flags&=1206910978;var Q=S.alternate;return Q===null?(S.childLanes=0,S.lanes=w,S.child=null,S.subtreeFlags=0,S.memoizedProps=null,S.memoizedState=null,S.updateQueue=null,S.dependencies=null,S.stateNode=null,S.selfBaseDuration=0,S.treeBaseDuration=0):(S.childLanes=Q.childLanes,S.lanes=Q.lanes,S.child=Q.child,S.subtreeFlags=0,S.deletions=null,S.memoizedProps=Q.memoizedProps,S.memoizedState=Q.memoizedState,S.updateQueue=Q.updateQueue,S.type=Q.type,w=Q.dependencies,S.dependencies=w===null?null:{lanes:w.lanes,firstContext:w.firstContext,_debugThenableState:w._debugThenableState},S.selfBaseDuration=Q.selfBaseDuration,S.treeBaseDuration=Q.treeBaseDuration),S}function jt(S,w,Q,W,oe,ae){var De=0,Qe=tr(S);if(typeof Qe==="function")na(Qe)&&(De=1);else if(typeof Qe==="string")De=re(),De=Xt(S,Q,De)?26:S==="html"||S==="head"||S==="body"?27:5;else e:switch(Qe){case z0:return w=u(31,Q,w,oe),w.elementType=z0,w.lanes=ae,w;case y7:return oo(Q.children,oe,ae,w);case FF:De=8,oe|=e1,oe|=A9;break;case QW:return S=Q,W=oe,typeof S.id!=="string"&&console.error('Profiler must specify an "id" of type `string` as a prop. Received the type `%s` instead.',typeof S.id),w=u(12,S,w,W|za),w.elementType=QW,w.lanes=ae,w.stateNode={effectDuration:0,passiveEffectDuration:0},w;case kW:return w=u(13,Q,w,oe),w.elementType=kW,w.lanes=ae,w;case Gp:return w=u(19,Q,w,oe),w.elementType=Gp,w.lanes=ae,w;case q2:case x7:return S=oe|U2t,w=u(30,Q,w,S),w.elementType=x7,w.lanes=ae,w.stateNode={autoName:null,paired:null,clones:null,ref:null},w;default:if(typeof Qe==="object"&&Qe!==null)switch(Qe.$$typeof){case Yl:De=10;break e;case q4:De=9;break e;case BN:De=11;break e;case h9:De=14;break e;case Qm:De=16,Qe=null;break e}if(Q="",S===void 0||typeof S==="object"&&S!==null&&Object.keys(S).length===0)Q+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";S===null?Qe="null":O0(S)?Qe="array":S!==void 0&&S.$$typeof===$4?(Qe="<"+(U(S.type)||"Unknown")+" />",Q=" Did you accidentally export a JSX literal instead of a component?"):Qe=typeof S,(De=W?j(W):null)&&(Q+=`

Check the render method of \``+De+"`."),De=29,Q=Error("Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: "+(Qe+"."+Q)),Qe=null}return w=u(De,Q,w,oe),w.elementType=S,w.type=Qe,w.lanes=ae,w._debugOwner=W,w}function vn(S,w,Q){return w=jt(S.type,S.key,S.props,S._owner,w,Q),w._debugOwner=S._owner,w._debugStack=S._debugStack,w._debugTask=S._debugTask,w}function oo(S,w,Q,W){return S=u(7,S,W,w),S.lanes=Q,S}function vo(S,w,Q){return S=u(6,S,null,w),S.lanes=Q,S}function pi(S){var w=u(18,null,null,gs);return w.stateNode=S,w}function oa(S,w,Q){return w=u(4,S.children!==null?S.children:[],S.key,w),w.lanes=Q,w.stateNode={containerInfo:S.containerInfo,pendingChildren:null,implementation:S.implementation},w}function ds(S,w){if(typeof S==="object"&&S!==null){var Q=SNe.get(S);if(Q!==void 0)return Q;return w={value:S,source:w,stack:Me(w)},SNe.set(S,w),w}return{value:S,source:w,stack:Me(w)}}function Ea(S,w){P4(),$W[qW++]=Ooe,$W[qW++]=q_e,q_e=S,Ooe=w}function Th(S,w,Q){P4(),yb[xb++]=jM,yb[xb++]=KM,yb[xb++]=jF,jF=S;var W=jM;S=KM;var oe=32-mh(W)-1;W&=~(1<<oe),Q+=1;var ae=32-mh(w)+oe;if(30<ae){var De=oe-oe%5;ae=(W&(1<<De)-1).toString(32),W>>=De,oe-=De,jM=1<<32-mh(w)+oe|Q<<oe|W,KM=ae+S}else jM=1<<ae|Q<<oe|W,KM=S}function xg(S){P4(),S.return!==null&&(Ea(S,1),Th(S,1,0))}function Cg(S){for(;S===q_e;)q_e=$W[--qW],$W[qW]=null,Ooe=$W[--qW],$W[qW]=null;for(;S===jF;)jF=yb[--xb],yb[xb]=null,KM=yb[--xb],yb[xb]=null,jM=yb[--xb],yb[xb]=null}function Fl(){return P4(),jF!==null?{id:jM,overflow:KM}:null}function JE(S,w){P4(),yb[xb++]=jM,yb[xb++]=KM,yb[xb++]=jF,jM=w.id,KM=w.overflow,jF=S}function P4(){Oa||console.error("Expected to be hydrating. This is a bug in React. Please file an issue.")}function E4(S,w){if(S.return===null){if(t3===null)t3={fiber:S,children:[],serverProps:void 0,serverTail:[],distanceFromLeaf:w};else{if(t3.fiber!==S)throw Error("Saw multiple hydration diff roots in a pass. This is a bug in React.");t3.distanceFromLeaf>w&&(t3.distanceFromLeaf=w)}return t3}var Q=E4(S.return,w+1).children;if(0<Q.length&&Q[Q.length-1].fiber===S)return Q=Q[Q.length-1],Q.distanceFromLeaf>w&&(Q.distanceFromLeaf=w),Q;return w={fiber:S,children:[],serverProps:void 0,serverTail:[],distanceFromLeaf:w},Q.push(w),w}function GH(){Oa&&console.error("We should not be hydrating here. This is a bug in React. Please file a bug.")}function ZE(S,w){T7||(S=E4(S,0),S.serverProps=null,w!==null&&(w=sb(w),S.serverTail.push(w)))}function fA(S){var w=1<arguments.length&&arguments[1]!==void 0?arguments[1]:!1,Q="",W=t3;throw W!==null&&(t3=null,Q=Vd(W)),M4(ds(Error("Hydration failed because the server rendered "+(w?"text":"HTML")+` didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used:

- A server/client branch \`if (typeof window !== 'undefined')\`.
- Variable input such as \`Date.now()\` or \`Math.random()\` which changes each time it's called.
- Date formatting in a user's locale which doesn't match the server.
- External changing data without sending a snapshot of it along with the HTML.
- Invalid HTML tag nesting.

It can also happen if the client has a browser extension installed which messes with the HTML before React loaded.

https://react.dev/link/hydration-mismatch`+Q),S)),PNe}function Rf(S){var{stateNode:w,type:Q,memoizedProps:W}=S;switch(w[_0]=S,w[TA]=W,jf(Q,W),Q){case"dialog":Xs("cancel",w),Xs("close",w);break;case"iframe":case"object":case"embed":Xs("load",w);break;case"video":case"audio":for(Q=0;Q<yre.length;Q++)Xs(yre[Q],w);break;case"source":Xs("error",w);break;case"img":case"image":case"link":Xs("error",w),Xs("load",w);break;case"details":Xs("toggle",w);break;case"input":ir("input",W),Xs("invalid",w),ho(w,W),Nn(w,W.value,W.defaultValue,W.checked,W.defaultChecked,W.type,W.name,!0);break;case"option":Io(w,W);break;case"select":ir("select",W),Xs("invalid",w),rr(w,W);break;case"textarea":ir("textarea",W),Xs("invalid",w),xr(w,W),ea(w,W.value,W.defaultValue,W.children)}Q=W.children,typeof Q!=="string"&&typeof Q!=="number"&&typeof Q!=="bigint"||w.textContent===""+Q||W.suppressHydrationWarning===!0||TM(w.textContent,Q)?(W.popover!=null&&(Xs("beforetoggle",w),Xs("toggle",w)),W.onScroll!=null&&Xs("scroll",w),W.onScrollEnd!=null&&Xs("scrollend",w),W.onClick!=null&&(w.onclick=Gd),w=!0):w=!1,w||fA(S,!0)}function x8(S){for(NA=S.return;NA;)switch(NA.tag){case 5:case 31:case 13:Cb=!1;return;case 27:case 3:Cb=!0;return;default:NA=NA.return}}function C8(S){if(S!==NA)return!1;if(!Oa)return x8(S),Oa=!0,!1;var w=S.tag,Q;if(Q=w!==3&&w!==27){if(Q=w===5)Q=S.type,Q=!(Q!=="form"&&Q!=="button")||r7(S.type,S.memoizedProps);Q=!Q}if(Q&&qd){for(Q=qd;Q;){var W=E4(S,0),oe=sb(Q);W.serverTail.push(oe),Q=oe.type==="Suspense"?X4(Q):Tm(Q.nextSibling)}fA(S)}if(x8(S),w===13){if(S=S.memoizedState,S=S!==null?S.dehydrated:null,!S)throw Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");qd=X4(S)}else if(w===31){if(S=S.memoizedState,S=S!==null?S.dehydrated:null,!S)throw Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");qd=X4(S)}else w===27?(w=qd,Xx(S.type)?(S=bRe,bRe=null,qd=S):qd=w):qd=NA?Tm(S.stateNode.nextSibling):null;return!0}function TC(){qd=NA=null,T7=Oa=!1}function eM(){var S=ON;return S!==null&&(wy===null?wy=S:wy.push.apply(wy,S),ON=null),S}function M4(S){ON===null?ON=[S]:ON.push(S)}function b8(){var S=t3;if(S!==null){t3=null;for(var w=Vd(S);0<S.children.length;)S=S.children[0];ye(S.fiber,function(){console.error(`A tree hydrated but some attributes of the server rendered HTML didn't match the client properties. This won't be patched up. This can happen if a SSR-ed Client Component used:

- A server/client branch \`if (typeof window !== 'undefined')\`.
- Variable input such as \`Date.now()\` or \`Math.random()\` which changes each time it's called.
- Date formatting in a user's locale which doesn't match the server.
- External changing data without sending a snapshot of it along with the HTML.
- Invalid HTML tag nesting.

It can also happen if the client has a browser extension installed which messes with the HTML before React loaded.

%s%s`,"https://react.dev/link/hydration-mismatch",w)})}}function DC(){JW=J_e=null,ZW=!1}function w4(S,w,Q){J(ENe,w._currentValue,S),w._currentValue=Q,J(MNe,w._currentRenderer,S),w._currentRenderer!==void 0&&w._currentRenderer!==null&&w._currentRenderer!==j2t&&console.error("Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported."),w._currentRenderer=j2t}function R2(S,w){S._currentValue=ENe.current;var Q=MNe.current;K(MNe,w),S._currentRenderer=Q,K(ENe,w)}function a0(S,w,Q){for(;S!==null;){var W=S.alternate;if((S.childLanes&w)!==w?(S.childLanes|=w,W!==null&&(W.childLanes|=w)):W!==null&&(W.childLanes&w)!==w&&(W.childLanes|=w),S===Q)break;S=S.return}S!==Q&&console.error("Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue.")}function I8(S,w,Q,W){var oe=S.child;oe!==null&&(oe.return=S);for(;oe!==null;){var ae=oe.dependencies;if(ae!==null){var De=oe.child;ae=ae.firstContext;e:for(;ae!==null;){var Qe=ae;ae=oe;for(var ot=0;ot<w.length;ot++)if(Qe.context===w[ot]){ae.lanes|=Q,Qe=ae.alternate,Qe!==null&&(Qe.lanes|=Q),a0(ae.return,Q,S),W||(De=null);break e}ae=Qe.next}}else if(oe.tag===18){if(De=oe.return,De===null)throw Error("We just came from a parent so we must have had a parent. This is a bug in React.");De.lanes|=Q,ae=De.alternate,ae!==null&&(ae.lanes|=Q),a0(De,Q,S),De=null}else oe.tag===13&&oe.memoizedState!==null&&oe.memoizedState.dehydrated===null?(oe.lanes|=Q,De=oe.alternate,De!==null&&(De.lanes|=Q),a0(oe.return,Q,S),De=oe.child,De=De!==null?De.sibling:null):De=oe.child;if(De!==null)De.return=oe;else for(De=oe;De!==null;){if(De===S){De=null;break}if(oe=De.sibling,oe!==null){oe.return=De.return,De=oe;break}De=De.return}oe=De}}function Rx(S,w,Q,W){S=null;for(var oe=w,ae=!1;oe!==null;){if(!ae){if((oe.flags&524288)!==0)ae=!0;else if((oe.flags&262144)!==0)break}if(oe.tag===10){var De=oe.alternate;if(De===null)throw Error("Should have a current fiber. This is a bug in React.");if(De=De.memoizedProps,De!==null){var Qe=oe.type;Py(oe.pendingProps.value,De.value)||(S!==null?S.push(Qe):S=[Qe])}}else if(oe===C7.current){if(De=oe.alternate,De===null)throw Error("Should have a current fiber. This is a bug in React.");De.memoizedState.memoizedState!==oe.memoizedState.memoizedState&&(S!==null?S.push(CX):S=[CX])}oe=oe.return}return S!==null&&I8(w,S,Q,W),w.flags|=262144,S!==null}function B4(S){for(S=S.firstContext;S!==null;){if(!Py(S.context._currentValue,S.memoizedValue))return!0;S=S.next}return!1}function Qx(S){J_e=S,JW=null,S=S.dependencies,S!==null&&(S.firstContext=null)}function fl(S){return ZW&&console.error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()."),UH(J_e,S)}function pI(S,w){return J_e===null&&Qx(S),UH(S,w)}function UH(S,w){var Q=w._currentValue;if(w={context:w,memoizedValue:Q,next:null},JW===null){if(S===null)throw Error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().");JW=w,S.dependencies={lanes:0,firstContext:w,_debugThenableState:null},S.flags|=524288}else JW=JW.next=w;return Q}function kx(){return{controller:new Xxo,data:new Map,refCount:0}}function T4(S){S.controller.signal.aborted&&console.warn("A cache instance was retained after it was already freed. This likely indicates a bug in React."),S.refCount++}function Q2(S){S.refCount--,0>S.refCount&&console.warn("A cache instance was released after it was already freed. This likely indicates a bug in React."),S.refCount===0&&jxo(Kxo,function(){S.controller.abort()})}function oy(S,w){if((S.pendingLanes&4194048)!==0){var Q=S.transitionTypes;Q===null&&(Q=S.transitionTypes=[]);for(S=0;S<w.length;S++){var W=w[S];Q.indexOf(W)===-1&&Q.push(W)}}}function v8(S){var w=S.transitionTypes;return S.transitionTypes=null,w}function Qf(S,w,Q){if((S&127)!==0)0>D7&&(D7=Lm(),Goe=Z_e(w),wNe=w,Q!=null&&(BNe=Y(Q)),(hl&(Rg|r3))!==LA&&(yp=!0,YN=Yoe),S=Kf(),w=F4(),S!==eX||w!==Uoe?eX=-1.1:w!==null&&(YN=Yoe),$F=S,Uoe=w);else if((S&4194048)!==0&&0>bb&&(bb=Lm(),Woe=Z_e(w),K2t=w,Q!=null&&($2t=Y(Q)),0>JM)){if(S=Kf(),w=F4(),S!==UN||w!==qF)UN=-1.1;GN=S,qF=w}}function WH(S){if(0>D7){D7=Lm(),Goe=S._debugTask!=null?S._debugTask:null,(hl&(Rg|r3))!==LA&&(YN=Yoe);var w=Kf(),Q=F4();w!==eX||Q!==Uoe?eX=-1.1:Q!==null&&(YN=Yoe),$F=w,Uoe=Q}if(0>bb&&(bb=Lm(),Woe=S._debugTask!=null?S._debugTask:null,0>JM)){if(S=Kf(),w=F4(),S!==UN||w!==qF)UN=-1.1;GN=S,qF=w}}function k2(){var S=KF;return KF=0,S}function tM(S){var w=KF;return KF=S,w}function kf(S){var w=KF;return KF+=S,w}function mI(){rs=Qi=-1.1}function dp(){var S=Qi;return Qi=-1.1,S}function h_(S){0<=S&&(Qi=S)}function L2(){var S=V0;return V0=-0,S}function Lf(S){0<=S&&(V0=S)}function ry(){var S=g0;return g0=null,S}function hh(){var S=yp;return yp=!1,S}function nM(S){Ey=Lm(),0>S.actualStartTime&&(S.actualStartTime=Ey)}function uD(S){if(0<=Ey){var w=Lm()-Ey;S.actualDuration+=w,S.selfBaseDuration=w,Ey=-1}}function XH(S){if(0<=Ey){var w=Lm()-Ey;S.actualDuration+=w,Ey=-1}}function iy(){if(0<=Ey){var S=Lm(),w=S-Ey;Ey=-1,KF+=w,V0+=w,rs=S}}function jH(S){g0===null&&(g0=[]),g0.push(S),qM===null&&(qM=[]),qM.push(S)}function Hf(){Ey=Lm(),0>Qi&&(Qi=Ey)}function Ff(S){for(var w=S.child;w;)S.actualDuration+=w.actualDuration,w=w.sibling}function _I(S,w){if(joe===null){var Q=joe=[];RNe=0,WN=L4(),tX={status:"pending",value:void 0,then:function(W){Q.push(W)}}}return RNe++,w.then(KH,KH),w}function KH(){if(--RNe===0&&(-1<bb||(JM=-1.1),Voe=null,joe!==null)){tX!==null&&(tX.status="fulfilled");var S=joe;joe=null,WN=0,tX=null;for(var w=0;w<S.length;w++)(0,S[w])()}}function ZU(S,w){var Q=[],W={status:"pending",value:null,reason:null,then:function(oe){Q.push(oe)}};return S.then(function(){W.status="fulfilled",W.value=w;for(var oe=0;oe<Q.length;oe++)(0,Q[oe])(w)},function(oe){W.status="rejected",W.reason=oe;for(oe=0;oe<Q.length;oe++)(0,Q[oe])(void 0)}),W}function oM(){var S=ZF.current;return S!==null?S:Cd.pooledCache}function S8(S,w){w===null?J(ZF,ZF.current,S):J(ZF,w.pool,S)}function gI(){var S=oM();return S===null?null:{parent:x_._currentValue,pool:S}}function rM(){return{didWarnAboutUncachedPromise:!1,thenables:[]}}function pD(S){return S=S.status,S==="fulfilled"||S==="rejected"}function iM(S,w,Q,W){Xn.actQueue!==null&&(Xn.didUsePromise=!0);var oe=S.thenables;if(Q=oe[Q],Q===void 0?oe.push(w):Q!==w&&(S.didWarnAboutUncachedPromise||(S.didWarnAboutUncachedPromise=!0,console.error("A component was suspended by an uncached promise. Creating promises inside a Client Component or hook is not yet supported, except via a Suspense-compatible library or framework.")),w.then(Gd,Gd),w=Q),w._debugInfo===void 0){S=performance.now(),oe=w.displayName;var ae={name:typeof oe==="string"?oe:"Promise",start:S,end:S,value:w};w._debugInfo=[{awaited:ae}],w.status!=="fulfilled"&&w.status!=="rejected"&&(S=function(){ae.end=performance.now()},w.then(S,S))}switch(w.status){case"fulfilled":return w.value;case"rejected":if(W=w.reason,_D(W),W===void 0&&!("reason"in w))throw Error("A rejected Promise was passed to React without a `reason` property. React threw a generic error from where the Promise was used to assist in identifying the problematic Promise. Make sure that instrumented Promises correctly set the `reason` property when setting `status` to `'rejected'`.");throw W;default:if(typeof w.status==="string")w.then(Gd,Gd);else{if(S=Cd,S!==null&&100<S.shellSuspendCounter)throw Error("An unknown Component is an async Client Component. Only Server Components can be async at the moment. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server.");S=w,S.status="pending",S.then(function(De){if(w.status==="pending"){var Qe=w;Qe.status="fulfilled",Qe.value=De}},function(De){if(w.status==="pending"){var Qe=w;Qe.status="rejected",Qe.reason=De}})}switch(w.status){case"fulfilled":return w.value;case"rejected":throw W=w.reason,_D(W),W}throw nz=w,tre=!0,HNe||W===null||W.alternate!==null||(tz=W,cge=Error("This library called use() to suspend in a previous render but did not call use() when it finished. This indicates an incorrect use of use(). Learn more: https://react.dev/warnings/conditional-use-of-use")),nX}}function Lx(S){try{return e5o(S)}catch(w){if(w!==null&&typeof w==="object"&&typeof w.then==="function")throw nz=w,tre=!0,nX;throw w}}function mD(){if(nz===null)throw Error("Expected a suspended thenable. This is a bug in React. Please file an issue.");var S=nz;return nz=null,tre=!1,S}function _D(S){if(S===nX||S===sge)throw Error("Hooks are not supported inside an async component. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server.")}function gD(S,w){return S===w?!0:S.tag!==w.tag||S.type!==w.type||S.key!==w.key||S.index!==w.index||S.tag===3&&S.stateNode!==w.stateNode||S.return===null||w.return===null?!1:gD(S.return,w.return)}function d_(S){var w=ac;return S!=null&&(ac=w===null?S:w.concat(S)),w}function sy(){var S=ac;if(S!=null){for(var w=S.length-1;0<=w;w--)if(S[w].name!=null){var Q=S[w].debugTask;if(Q!=null)return Q}}return null}function P8(S,w,Q){for(var W=Object.keys(S.props),oe=0;oe<W.length;oe++){var ae=W[oe];if(ae!=="children"&&ae!=="key"&&ae!=="ref"){w===null&&(w=vn(S,Q.mode,0),w._debugInfo=ac,w.return=Q),ye(w,function(De){console.error("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key`, `ref`, and `children` props.",De)},ae);break}}}function AD(S){var w=nre;return nre+=1,oX===null&&(oX=rM()),iM(oX,S,w,null)}function Hx(S,w){w=w.props.ref,S.ref=w!==void 0?w:null}function yA(S,w){if(w.$$typeof===wN)throw Error(`A React Element from an older version of React was rendered. This is not supported. It can happen if:
- Multiple copies of the "react" package is used.
- A library pre-bundled an old copy of "react" or "react/jsx-runtime".
- A compiler tries to "inline" JSX instead of using the runtime.`);throw S=Object.prototype.toString.call(w),Error("Objects are not valid as a React child (found: "+(S==="[object Object]"?"object with keys {"+Object.keys(w).join(", ")+"}":S)+"). If you meant to render a collection of children, use an array instead.")}function sM(S,w){var Q=sy();Q!==null?Q.run(yA.bind(null,S,w)):yA(S,w)}function fD(S,w){var Q=Y(S)||"Component";m1t[Q]||(m1t[Q]=!0,w=w.displayName||w.name||"Component",S.tag===3?console.error(`Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.
  root.render(%s)`,w,w,w):console.error(`Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.
  <%s>{%s}</%s>`,w,w,Q,w,Q))}function aM(S,w){var Q=sy();Q!==null?Q.run(fD.bind(null,S,w)):fD(S,w)}function $H(S,w){var Q=Y(S)||"Component";_1t[Q]||(_1t[Q]=!0,w=String(w),S.tag===3?console.error(`Symbols are not valid as a React child.
  root.render(%s)`,w):console.error(`Symbols are not valid as a React child.
  <%s>%s</%s>`,Q,w,Q))}function E8(S,w){var Q=sy();Q!==null?Q.run($H.bind(null,S,w)):$H(S,w)}function yD(S){function w(Jt,en){if(S){var sn=Jt.deletions;sn===null?(Jt.deletions=[en],Jt.flags|=16):sn.push(en)}}function Q(Jt,en){if(!S)return null;for(;en!==null;)w(Jt,en),en=en.sibling;return null}function W(Jt){for(var en=new Map;Jt!==null;)Jt.key===null?en.set(Jt.index,Jt):en.set(Jt.key,Jt),Jt=Jt.sibling;return en}function oe(Jt,en){return Jt=vc(Jt,en),Jt.index=0,Jt.sibling=null,Jt}function ae(Jt,en,sn){if(Jt.index=sn,!S)return Jt.flags|=1048576,en;if(sn=Jt.alternate,sn!==null)return sn=sn.index,sn<en?(Jt.flags|=2,en):sn;return Jt.flags|=134217730,en}function De(Jt){return S&&Jt.alternate===null&&(Jt.flags|=134217730),Jt}function Qe(Jt,en,sn,jn){if(en===null||en.tag!==6)return en=vo(sn,Jt.mode,jn),en.return=Jt,en._debugOwner=Jt,en._debugTask=Jt._debugTask,en._debugInfo=ac,en;return en=oe(en,sn),en.return=Jt,en._debugInfo=ac,en}function ot(Jt,en,sn,jn){var zo=sn.type;if(zo===y7)return en=Yt(Jt,en,sn.props.children,jn,sn.key),Hx(en,sn),P8(sn,en,Jt),en;if(en!==null&&(en.elementType===zo||Dr(en,sn)||typeof zo==="object"&&zo!==null&&zo.$$typeof===Qm&&Lx(zo)===en.type))return en=oe(en,sn.props),Hx(en,sn),en.return=Jt,en._debugOwner=sn._owner,en._debugInfo=ac,en;return en=vn(sn,Jt.mode,jn),Hx(en,sn),en.return=Jt,en._debugInfo=ac,en}function _t(Jt,en,sn,jn){if(en===null||en.tag!==4||en.stateNode.containerInfo!==sn.containerInfo||en.stateNode.implementation!==sn.implementation)return en=oa(sn,Jt.mode,jn),en.return=Jt,en._debugInfo=ac,en;return en=oe(en,sn.children||[]),en.return=Jt,en._debugInfo=ac,en}function Yt(Jt,en,sn,jn,zo){if(en===null||en.tag!==7)return en=oo(sn,Jt.mode,jn,zo),en.return=Jt,en._debugOwner=Jt,en._debugTask=Jt._debugTask,en._debugInfo=ac,en;return en=oe(en,sn),en.return=Jt,en._debugInfo=ac,en}function rn(Jt,en,sn){if(typeof en==="string"&&en!==""||typeof en==="number"||typeof en==="bigint")return en=vo(""+en,Jt.mode,sn),en.return=Jt,en._debugOwner=Jt,en._debugTask=Jt._debugTask,en._debugInfo=ac,en;if(typeof en==="object"&&en!==null){switch(en.$$typeof){case $4:return sn=vn(en,Jt.mode,sn),Hx(sn,en),sn.return=Jt,Jt=d_(en._debugInfo),sn._debugInfo=ac,ac=Jt,sn;case f7:return en=oa(en,Jt.mode,sn),en.return=Jt,en._debugInfo=ac,en;case Qm:var jn=d_(en._debugInfo);return en=Lx(en),Jt=rn(Jt,en,sn),ac=jn,Jt}if(O0(en)||O(en))return sn=oo(en,Jt.mode,sn,null),sn.return=Jt,sn._debugOwner=Jt,sn._debugTask=Jt._debugTask,Jt=d_(en._debugInfo),sn._debugInfo=ac,ac=Jt,sn;if(typeof en.then==="function")return jn=d_(en._debugInfo),Jt=rn(Jt,AD(en),sn),ac=jn,Jt;if(en.$$typeof===Yl)return rn(Jt,pI(Jt,en),sn);sM(Jt,en)}return typeof en==="function"&&aM(Jt,en),typeof en==="symbol"&&E8(Jt,en),null}function on(Jt,en,sn,jn){var zo=en!==null?en.key:null;if(typeof sn==="string"&&sn!==""||typeof sn==="number"||typeof sn==="bigint")return zo!==null?null:Qe(Jt,en,""+sn,jn);if(typeof sn==="object"&&sn!==null){switch(sn.$$typeof){case $4:return sn.key===zo?(zo=d_(sn._debugInfo),Jt=ot(Jt,en,sn,jn),ac=zo,Jt):null;case f7:return sn.key===zo?_t(Jt,en,sn,jn):null;case Qm:return zo=d_(sn._debugInfo),sn=Lx(sn),Jt=on(Jt,en,sn,jn),ac=zo,Jt}if(O0(sn)||O(sn)){if(zo!==null)return null;return zo=d_(sn._debugInfo),Jt=Yt(Jt,en,sn,jn,null),ac=zo,Jt}if(typeof sn.then==="function")return zo=d_(sn._debugInfo),Jt=on(Jt,en,AD(sn),jn),ac=zo,Jt;if(sn.$$typeof===Yl)return on(Jt,en,pI(Jt,sn),jn);sM(Jt,sn)}return typeof sn==="function"&&aM(Jt,sn),typeof sn==="symbol"&&E8(Jt,sn),null}function Cn(Jt,en,sn,jn,zo){if(typeof jn==="string"&&jn!==""||typeof jn==="number"||typeof jn==="bigint")return Jt=Jt.get(sn)||null,Qe(en,Jt,""+jn,zo);if(typeof jn==="object"&&jn!==null){switch(jn.$$typeof){case $4:return sn=Jt.get(jn.key===null?sn:jn.key)||null,Jt=d_(jn._debugInfo),en=ot(en,sn,jn,zo),ac=Jt,en;case f7:return Jt=Jt.get(jn.key===null?sn:jn.key)||null,_t(en,Jt,jn,zo);case Qm:var is=d_(jn._debugInfo);return jn=Lx(jn),en=Cn(Jt,en,sn,jn,zo),ac=is,en}if(O0(jn)||O(jn))return sn=Jt.get(sn)||null,Jt=d_(jn._debugInfo),en=Yt(en,sn,jn,zo,null),ac=Jt,en;if(typeof jn.then==="function")return is=d_(jn._debugInfo),en=Cn(Jt,en,sn,AD(jn),zo),ac=is,en;if(jn.$$typeof===Yl)return Cn(Jt,en,sn,pI(en,jn),zo);sM(en,jn)}return typeof jn==="function"&&aM(en,jn),typeof jn==="symbol"&&E8(en,jn),null}function Po(Jt,en,sn,jn){if(typeof sn!=="object"||sn===null)return jn;switch(sn.$$typeof){case $4:case f7:h(Jt,en,sn);var zo=sn.key;if(typeof zo!=="string")break;if(jn===null){jn=new Set,jn.add(zo);break}if(!jn.has(zo)){jn.add(zo);break}ye(en,function(){console.error("Encountered two children with the same key, `%s`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version.",zo)});break;case Qm:sn=Lx(sn),Po(Jt,en,sn,jn)}return jn}function Sr(Jt,en,sn,jn){for(var zo=null,is=null,_i=null,Ca=en,Ja=en=0,U0=null;Ca!==null&&Ja<sn.length;Ja++){Ca.index>Ja?(U0=Ca,Ca=null):U0=Ca.sibling;var qh=on(Jt,Ca,sn[Ja],jn);if(qh===null){Ca===null&&(Ca=U0);break}zo=Po(Jt,qh,sn[Ja],zo),S&&Ca&&qh.alternate===null&&w(Jt,Ca),en=ae(qh,en,Ja),_i===null?is=qh:_i.sibling=qh,_i=qh,Ca=U0}if(Ja===sn.length)return Q(Jt,Ca),Oa&&Ea(Jt,Ja),is;if(Ca===null){for(;Ja<sn.length;Ja++)Ca=rn(Jt,sn[Ja],jn),Ca!==null&&(zo=Po(Jt,Ca,sn[Ja],zo),en=ae(Ca,en,Ja),_i===null?is=Ca:_i.sibling=Ca,_i=Ca);return Oa&&Ea(Jt,Ja),is}for(Ca=W(Ca);Ja<sn.length;Ja++)U0=Cn(Ca,Jt,Ja,sn[Ja],jn),U0!==null&&(zo=Po(Jt,U0,sn[Ja],zo),S&&(qh=U0.alternate,qh!==null&&Ca.delete(qh.key===null?Ja:qh.key)),en=ae(U0,en,Ja),_i===null?is=U0:_i.sibling=U0,_i=U0);return S&&Ca.forEach(function(iw){return w(Jt,iw)}),Oa&&Ea(Jt,Ja),is}function mi(Jt,en,sn,jn){if(sn==null)throw Error("An iterable object provided no iterator.");for(var zo=null,is=null,_i=en,Ca=en=0,Ja=null,U0=null,qh=sn.next();_i!==null&&!qh.done;Ca++,qh=sn.next()){_i.index>Ca?(Ja=_i,_i=null):Ja=_i.sibling;var iw=on(Jt,_i,qh.value,jn);if(iw===null){_i===null&&(_i=Ja);break}U0=Po(Jt,iw,qh.value,U0),S&&_i&&iw.alternate===null&&w(Jt,_i),en=ae(iw,en,Ca),is===null?zo=iw:is.sibling=iw,is=iw,_i=Ja}if(qh.done)return Q(Jt,_i),Oa&&Ea(Jt,Ca),zo;if(_i===null){for(;!qh.done;Ca++,qh=sn.next())_i=rn(Jt,qh.value,jn),_i!==null&&(U0=Po(Jt,_i,qh.value,U0),en=ae(_i,en,Ca),is===null?zo=_i:is.sibling=_i,is=_i);return Oa&&Ea(Jt,Ca),zo}for(_i=W(_i);!qh.done;Ca++,qh=sn.next())Ja=Cn(_i,Jt,Ca,qh.value,jn),Ja!==null&&(U0=Po(Jt,Ja,qh.value,U0),S&&(qh=Ja.alternate,qh!==null&&_i.delete(qh.key===null?Ca:qh.key)),en=ae(Ja,en,Ca),is===null?zo=Ja:is.sibling=Ja,is=Ja);return S&&_i.forEach(function(S5o){return w(Jt,S5o)}),Oa&&Ea(Jt,Ca),zo}function wa(Jt,en,sn,jn){if(typeof sn==="object"&&sn!==null&&sn.type===y7&&sn.key===null&&sn.props.ref===void 0&&(P8(sn,null,Jt),sn=sn.props.children),typeof sn==="object"&&sn!==null){switch(sn.$$typeof){case $4:var zo=d_(sn._debugInfo);e:{for(var is=sn.key;en!==null;){if(en.key===is){if(is=sn.type,is===y7){if(en.tag===7){Q(Jt,en.sibling),jn=oe(en,sn.props.children),Hx(jn,sn),jn.return=Jt,jn._debugOwner=sn._owner,jn._debugInfo=ac,P8(sn,jn,Jt),Jt=jn;break e}}else if(en.elementType===is||Dr(en,sn)||typeof is==="object"&&is!==null&&is.$$typeof===Qm&&Lx(is)===en.type){Q(Jt,en.sibling),jn=oe(en,sn.props),Hx(jn,sn),jn.return=Jt,jn._debugOwner=sn._owner,jn._debugInfo=ac,Jt=jn;break e}Q(Jt,en);break}else w(Jt,en);en=en.sibling}sn.type===y7?(jn=oo(sn.props.children,Jt.mode,jn,sn.key),Hx(jn,sn),jn.return=Jt,jn._debugOwner=Jt,jn._debugTask=Jt._debugTask,jn._debugInfo=ac,P8(sn,jn,Jt),Jt=jn):(jn=vn(sn,Jt.mode,jn),Hx(jn,sn),jn.return=Jt,jn._debugInfo=ac,Jt=jn)}return Jt=De(Jt),ac=zo,Jt;case f7:e:{zo=sn;for(sn=zo.key;en!==null;){if(en.key===sn)if(en.tag===4&&en.stateNode.containerInfo===zo.containerInfo&&en.stateNode.implementation===zo.implementation){Q(Jt,en.sibling),jn=oe(en,zo.children||[]),jn.return=Jt,Jt=jn;break e}else{Q(Jt,en);break}else w(Jt,en);en=en.sibling}jn=oa(zo,Jt.mode,jn),jn.return=Jt,Jt=jn}return De(Jt);case Qm:return zo=d_(sn._debugInfo),sn=Lx(sn),Jt=wa(Jt,en,sn,jn),ac=zo,Jt}if(O0(sn))return Sr(Jt,en,sn,jn);if(O(sn)){if(zo=sn,sn=O(zo),typeof sn!=="function")throw Error("An object is not an iterable. This error is likely caused by a bug in React. Please file an issue.");if(is=sn.call(zo),is===zo){if(Jt.tag!==0||Object.prototype.toString.call(Jt.type)!=="[object GeneratorFunction]"||Object.prototype.toString.call(is)!=="[object Generator]")u1t||console.error("Using Iterators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You may convert it to an array with `Array.from()` or the `[...spread]` operator before rendering. You can also use an Iterable that can iterate multiple times over the same items."),u1t=!0}else zo.entries!==sn||FNe||(console.error("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),FNe=!0);return mi(Jt,en,is,jn)}if(typeof sn.then==="function")return zo=d_(sn._debugInfo),Jt=wa(Jt,en,AD(sn),jn),ac=zo,Jt;if(sn.$$typeof===Yl)return wa(Jt,en,pI(Jt,sn),jn);sM(Jt,sn)}if(typeof sn==="string"&&sn!==""||typeof sn==="number"||typeof sn==="bigint")return zo=""+sn,en!==null&&en.tag===6?(Q(Jt,en.sibling),jn=oe(en,zo),jn.return=Jt,Jt=jn):(Q(Jt,en),jn=vo(zo,Jt.mode,jn),jn.return=Jt,jn._debugOwner=Jt,jn._debugTask=Jt._debugTask,jn._debugInfo=ac,Jt=jn),De(Jt);return typeof sn==="function"&&aM(Jt,sn),typeof sn==="symbol"&&E8(Jt,sn),Q(Jt,en)}return function(Jt,en,sn,jn){var zo=ac;ac=null;try{nre=0;var is=wa(Jt,en,sn,jn);return oX=null,is}catch(U0){if(U0===nX||U0===sge)throw U0;var _i=u(29,U0,null,Jt.mode);_i.lanes=jn,_i.return=Jt;var Ca=_i._debugInfo=ac;if(_i._debugOwner=Jt._debugOwner,_i._debugTask=Jt._debugTask,Ca!=null){for(var Ja=Ca.length-1;0<=Ja;Ja--)if(typeof Ca[Ja].stack==="string"){_i._debugOwner=Ca[Ja],_i._debugTask=Ca[Ja].debugTask;break}}return _i}finally{ac=zo}}}function qH(S,w){var Q=O0(S);return S=!Q&&typeof O(S)==="function",Q||S?(Q=Q?"array":"iterable",console.error("A nested %s was passed to row #%s in <SuspenseList />. Wrap it in an additional SuspenseList to configure its revealOrder: <SuspenseList revealOrder=...> ... <SuspenseList revealOrder=...>{%s}</SuspenseList> ... </SuspenseList>",Q,w,Q),!1):!0}function M8(S){S.updateQueue={baseState:S.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function AI(S,w){S=S.updateQueue,w.updateQueue===S&&(w.updateQueue={baseState:S.baseState,firstBaseUpdate:S.firstBaseUpdate,lastBaseUpdate:S.lastBaseUpdate,shared:S.shared,callbacks:null})}function al(S){return{lane:S,tag:A1t,payload:null,callback:null,next:null}}function NC(S,w,Q){var W=S.updateQueue;if(W===null)return null;if(W=W.shared,ONe===W&&!x1t){var oe=Y(S);console.error(`An update (setState, replaceState, or forceUpdate) was scheduled from inside an update function. Update functions should be pure, with zero side-effects. Consider using componentDidUpdate or a callback.

Please update the following component: %s`,oe),x1t=!0}if((hl&Rg)!==LA)return oe=W.pending,oe===null?w.next=w:(w.next=oe.next,oe.next=w),W.pending=w,w=ko(S),uo(S,null,Q),w;return xn(S,W,w,Q),ko(S)}function cM(S,w,Q){if(w=w.updateQueue,w!==null&&(w=w.shared,(Q&4194048)!==0)){var W=w.lanes;W&=S.pendingLanes,Q|=W,w.lanes=Q,ft(S,Q)}}function lM(S,w){var Q=S.updateQueue,W=S.alternate;if(W!==null&&(W=W.updateQueue,Q===W)){var oe=null,ae=null;if(Q=Q.firstBaseUpdate,Q!==null){do{var De={lane:Q.lane,tag:Q.tag,payload:Q.payload,callback:null,next:null};ae===null?oe=ae=De:ae=ae.next=De,Q=Q.next}while(Q!==null);ae===null?oe=ae=w:ae=ae.next=w}else oe=ae=w;Q={baseState:W.baseState,firstBaseUpdate:oe,lastBaseUpdate:ae,shared:W.shared,callbacks:W.callbacks},S.updateQueue=Q;return}S=Q.lastBaseUpdate,S===null?Q.firstBaseUpdate=w:S.next=w,Q.lastBaseUpdate=w}function xA(){if(VNe){var S=tX;if(S!==null)throw S}}function w8(S,w,Q,W){VNe=!1;var oe=S.updateQueue;XN=!1,ONe=oe.shared;var{firstBaseUpdate:ae,lastBaseUpdate:De}=oe,Qe=oe.shared.pending;if(Qe!==null){oe.shared.pending=null;var ot=Qe,_t=ot.next;ot.next=null,De===null?ae=_t:De.next=_t,De=ot;var Yt=S.alternate;Yt!==null&&(Yt=Yt.updateQueue,Qe=Yt.lastBaseUpdate,Qe!==De&&(Qe===null?Yt.firstBaseUpdate=_t:Qe.next=_t,Yt.lastBaseUpdate=ot))}if(ae!==null){var rn=oe.baseState;De=0,Yt=_t=ot=null,Qe=ae;do{var on=Qe.lane&-536870913,Cn=on!==Qe.lane;if(Cn?(ma&on)===on:(W&on)===on){on!==0&&on===WN&&(VNe=!0),Yt!==null&&(Yt=Yt.next={lane:0,tag:Qe.tag,payload:Qe.payload,callback:null,next:null});e:{on=S;var Po=Qe,Sr=w,mi=Q;switch(Po.tag){case f1t:if(Po=Po.payload,typeof Po==="function"){ZW=!0;var wa=Po.call(mi,rn,Sr);if(on.mode&e1){Ct(!0);try{Po.call(mi,rn,Sr)}finally{Ct(!1)}}ZW=!1,rn=wa;break e}rn=Po;break e;case zNe:on.flags=on.flags&-65537|128;case A1t:if(wa=Po.payload,typeof wa==="function"){if(ZW=!0,Po=wa.call(mi,rn,Sr),on.mode&e1){Ct(!0);try{wa.call(mi,rn,Sr)}finally{Ct(!1)}}ZW=!1}else Po=wa;if(Po===null||Po===void 0)break e;rn=pa({},rn,Po);break e;case y1t:XN=!0}}on=Qe.callback,on!==null&&(S.flags|=64,Cn&&(S.flags|=8192),Cn=oe.callbacks,Cn===null?oe.callbacks=[on]:Cn.push(on))}else Cn={lane:on,tag:Qe.tag,payload:Qe.payload,callback:Qe.callback,next:null},Yt===null?(_t=Yt=Cn,ot=rn):Yt=Yt.next=Cn,De|=on;if(Qe=Qe.next,Qe===null)if(Qe=oe.shared.pending,Qe===null)break;else Cn=Qe,Qe=Cn.next,Cn.next=null,oe.lastBaseUpdate=Cn,oe.shared.pending=null}while(1);Yt===null&&(ot=rn),oe.baseState=ot,oe.firstBaseUpdate=_t,oe.lastBaseUpdate=Yt,ae===null&&(oe.shared.lanes=0),$N|=De,S.lanes=De,S.memoizedState=rn}ONe=null}function xD(S,w){if(typeof S!=="function")throw Error("Invalid argument passed as callback. Expected a function. Instead received: "+S);S.call(w)}function hM(S,w){var Q=S.shared.hiddenCallbacks;if(Q!==null)for(S.shared.hiddenCallbacks=null,S=0;S<Q.length;S++)xD(Q[S],w)}function fI(S,w){var Q=S.callbacks;if(Q!==null)for(S.callbacks=null,S=0;S<Q.length;S++)xD(Q[S],w)}function CD(S,w){var Q=H7;J(lge,Q,S),J(jN,w,S),H7=Q|w.baseLanes}function dM(S){J(lge,H7,S),J(jN,jN.current,S)}function bD(S){H7=lge.current,K(jN,S),K(lge,S)}function RC(S){var w=S.alternate;J(Zf,Zf.current&rX,S),J(Jf,S,S),t1===null&&(w===null||jN.current!==null?t1=S:w.memoizedState!==null&&(t1=S))}function JH(S){J(Zf,Zf.current,S),J(Jf,S,S),t1===null&&(t1=S)}function ID(S){S.tag===22?(J(Zf,Zf.current,S),J(Jf,S,S),t1===null&&(t1=S)):QC(S)}function QC(S){J(Zf,Zf.current,S),J(Jf,Jf.current,S)}function Im(S){K(Jf,S),t1===S&&(t1=null),K(Zf,S)}function CA(S,w){J(Jf,Jf.current,S),J(Zf,w,S)}function vD(S){K(Zf,S),K(Jf,S),t1===S&&(t1=null)}function SD(S){for(var w=S;w!==null;){if(w.tag===13){var Q=w.memoizedState;if(Q!==null&&(Q=Q.dehydrated,Q===null||Ji(Q)||ll(Q)))return w}else if(w.tag===19&&w.memoizedProps.revealOrder!=="independent"){if((w.flags&128)!==0)return w}else if(w.child!==null){w.child.return=w,w=w.child;continue}if(w===S)break;for(;w.sibling===null;){if(w.return===null||w.return===S)return null;w=w.return}w.sibling.return=w.return,w=w.sibling}return null}function ra(){var S=Un;vb===null?vb=[S]:vb.push(S)}function Do(){var S=Un;if(vb!==null&&(ew++,vb[ew]!==S)){var w=Y(Is);if(!C1t.has(w)&&(C1t.add(w),vb!==null)){for(var Q="",W=0;W<=ew;W++){var oe=vb[W],ae=W===ew?S:oe;for(oe=W+1+". "+oe;30>oe.length;)oe+=" ";oe+=ae+`
`,Q+=oe}console.error(`React has detected a change in the order of Hooks called by %s. This will lead to bugs and errors if not fixed. For more information, read the Rules of Hooks: https://react.dev/link/rules-of-hooks

   Previous render            Next render
   ------------------------------------------------------
%s   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
`,w,Q)}}}function yI(S){S===void 0||S===null||O0(S)||console.error("%s received a final argument that is not an array (instead, received `%s`). When specified, the final argument must be an array.",Un,typeof S)}function B8(){var S=Y(Is);I1t.has(S)||(I1t.add(S),console.error("ReactDOM.useFormState has been renamed to React.useActionState. Please update %s to use React.useActionState.",S))}function gd(){throw Error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`)}function xI(S,w){if(sre)return!1;if(w===null)return console.error("%s received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders.",Un),!1;S.length!==w.length&&console.error(`The final argument passed to %s changed size between renders. The order and size of this array must remain constant.

Previous: %s
Incoming: %s`,Un,"["+w.join(", ")+"]","["+S.join(", ")+"]");for(var Q=0;Q<w.length&&Q<S.length;Q++)if(!Py(S[Q],w[Q]))return!1;return!0}function ZH(S,w,Q,W,oe,ae){if(ZM=ae,Is=w,vb=S!==null?S._debugHookTypes:null,ew=-1,sre=S!==null&&S.type!==w.type,Object.prototype.toString.call(Q)==="[object AsyncFunction]"||Object.prototype.toString.call(Q)==="[object AsyncGeneratorFunction]")ae=Y(Is),YNe.has(ae)||(YNe.add(ae),console.error("%s is an async Client Component. Only Server Components can be async at the moment. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server.",ae===null?"An unknown Component":"<"+ae+">"));w.memoizedState=null,w.updateQueue=null,w.lanes=0,Xn.H=S!==null&&S.memoizedState!==null?UNe:vb!==null?v1t:GNe,rz=ae=(w.mode&e1)!==gs;var De=QNe(Q,W,oe);if(rz=!1,sX&&(De=PD(w,Q,W,oe)),ae){Ct(!0);try{De=PD(w,Q,W,oe)}finally{Ct(!1)}}return eF(S,w),De}function eF(S,w){w._debugHookTypes=vb,w.dependencies===null?N7!==null&&(w.dependencies={lanes:0,firstContext:null,_debugThenableState:N7}):w.dependencies._debugThenableState=N7;var Q=N7;if(tz!==null&&gD(tz,w)&&(Q!==null||cge===null||HNe||(HNe=!0,console.error(cge)),cge=tz=null),Xn.H=uge,Q=xd!==null&&xd.next!==null,ZM=0,vb=Un=C_=xd=Is=null,ew=-1,S!==null&&(S.flags&1206910976)!==(w.flags&1206910976)&&console.error("Internal React error: Expected static flag was missing. Please notify the React team."),hge=!1,ire=0,N7=null,Q)throw Error("Rendered fewer hooks than expected. This may be caused by an accidental early return statement.");S===null||Hm||(S=S.dependencies,S!==null&&B4(S)&&(Hm=!0)),tre?(tre=!1,S=!0):S=!1,S&&(w=Y(w)||"Unknown",b1t.has(w)||YNe.has(w)||(b1t.add(w),console.error("`use` was called from inside a try/catch block. This is not allowed and can lead to unexpected behavior. To handle errors triggered by `use`, wrap your component in a error boundary.")))}function PD(S,w,Q,W){Is=S;var oe=0;do{if(sX&&(N7=null),ire=0,sX=!1,oe>=n5o)throw Error("Too many re-renders. React limits the number of renders to prevent an infinite loop.");if(oe+=1,sre=!1,C_=xd=null,S.updateQueue!=null){var ae=S.updateQueue;ae.lastEffect=null,ae.events=null,ae.stores=null,ae.memoCache!=null&&(ae.memoCache.index=0)}ew=-1,Xn.H=S1t,ae=QNe(w,Q,W)}while(sX);return ae}function eW(){var S=Xn.H,w=S.useState()[0];return w=typeof w.then==="function"?CI(w):w,S=S.useState()[0],(xd!==null?xd.memoizedState:null)!==S&&(Is.flags|=1024),w}function ED(){var S=dge!==0;return dge=0,S}function MD(S,w,Q){w.updateQueue=S.updateQueue,w.flags=(w.mode&A9)!==gs?w.flags&-805308421:w.flags&-2053,S.lanes&=~Q}function zf(S){if(hge){for(S=S.memoizedState;S!==null;){var w=S.queue;w!==null&&(w.pending=null),S=S.next}hge=!1}ZM=0,vb=C_=xd=Is=null,ew=-1,Un=null,sX=!1,ire=dge=0,N7=null}function vm(){var S={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return C_===null?Is.memoizedState=C_=S:C_=C_.next=S,C_}function cl(){if(xd===null){var S=Is.alternate;S=S!==null?S.memoizedState:null}else S=xd.next;var w=C_===null?Is.memoizedState:C_.next;if(w!==null)C_=w,xd=S;else{if(S===null){if(Is.alternate===null)throw Error("Update hook called on initial render. This is likely a bug in React. Please file an issue.");throw Error("Rendered more hooks than during the previous render.")}xd=S,S={memoizedState:xd.memoizedState,baseState:xd.baseState,baseQueue:xd.baseQueue,queue:xd.queue,next:null},C_===null?Is.memoizedState=C_=S:C_=C_.next=S}return C_}function wD(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function CI(S){var w=ire;return ire+=1,N7===null&&(N7=rM()),S=iM(N7,S,w,Is),w=Is,(C_===null?w.memoizedState:C_.next)===null&&(w=w.alternate,Xn.H=w!==null&&w.memoizedState!==null?UNe:GNe),S}function Au(S){if(S!==null&&typeof S==="object"){if(typeof S.then==="function")return CI(S);if(S.$$typeof===lNe)return;if(S.$$typeof===Yl)return fl(S)}throw Error("An unsupported type was passed to use(): "+String(S))}function kC(S){var w=null,Q=Is.updateQueue;if(Q!==null&&(w=Q.memoCache),w==null){var W=Is.alternate;W!==null&&(W=W.updateQueue,W!==null&&(W=W.memoCache,W!=null&&(w={data:W.data.map(function(oe){return oe.slice()}),index:0})))}if(w==null&&(w={data:[],index:0}),Q===null&&(Q=wD(),Is.updateQueue=Q),Q.memoCache=w,Q=w.data[w.index],Q===void 0||sre)for(Q=w.data[w.index]=Array(S),W=0;W<S;W++)Q[W]=J4;else Q.length!==S&&console.error("Expected a constant size argument for each invocation of useMemoCache. The previous cache was allocated with size %s but size %s was requested.",Q.length,S);return w.index++,Q}function Ad(S,w){return typeof w==="function"?w(S):w}function BD(S,w,Q){var W=vm();if(Q!==void 0){var oe=Q(w);if(rz){Ct(!0);try{Q(w)}finally{Ct(!1)}}}else oe=w;return W.memoizedState=W.baseState=oe,S={pending:null,lanes:0,dispatch:null,lastRenderedReducer:S,lastRenderedState:oe},W.queue=S,S=S.dispatch=yl.bind(null,Is,S),[W.memoizedState,S]}function bA(S){var w=cl();return TD(w,xd,S)}function TD(S,w,Q){var W=S.queue;if(W===null)throw Error("Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)");W.lastRenderedReducer=Q;var oe=S.baseQueue,ae=W.pending;if(ae!==null){if(oe!==null){var De=oe.next;oe.next=ae.next,ae.next=De}w.baseQueue!==oe&&console.error("Internal error: Expected work-in-progress queue to be a clone. This is a bug in React."),w.baseQueue=oe=ae,W.pending=null}if(ae=S.baseState,oe===null)S.memoizedState=ae;else{w=oe.next;var Qe=De=null,ot=null,_t=w,Yt=!1;do{var rn=_t.lane&-536870913;if(rn!==_t.lane?(ma&rn)===rn:(ZM&rn)===rn){var on=_t.revertLane;if(on===0)ot!==null&&(ot=ot.next={lane:0,revertLane:0,gesture:null,action:_t.action,hasEagerState:_t.hasEagerState,eagerState:_t.eagerState,next:null}),rn===WN&&(Yt=!0);else if((ZM&on)===on){_t=_t.next,on===WN&&(Yt=!0);continue}else rn={lane:0,revertLane:_t.revertLane,gesture:null,action:_t.action,hasEagerState:_t.hasEagerState,eagerState:_t.eagerState,next:null},ot===null?(Qe=ot=rn,De=ae):ot=ot.next=rn,Is.lanes|=on,$N|=on;rn=_t.action,rz&&Q(ae,rn),ae=_t.hasEagerState?_t.eagerState:Q(ae,rn)}else on={lane:rn,revertLane:_t.revertLane,gesture:_t.gesture,action:_t.action,hasEagerState:_t.hasEagerState,eagerState:_t.eagerState,next:null},ot===null?(Qe=ot=on,De=ae):ot=ot.next=on,Is.lanes|=rn,$N|=rn;_t=_t.next}while(_t!==null&&_t!==w);if(ot===null?De=ae:ot.next=Qe,!Py(ae,S.memoizedState)&&(Hm=!0,Yt&&(Q=tX,Q!==null)))throw Q;S.memoizedState=ae,S.baseState=De,S.baseQueue=ot,W.lastRenderedState=ae}return oe===null&&(W.lanes=0),[S.memoizedState,W.dispatch]}function ay(S){var w=cl(),Q=w.queue;if(Q===null)throw Error("Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)");Q.lastRenderedReducer=S;var{dispatch:W,pending:oe}=Q,ae=w.memoizedState;if(oe!==null){Q.pending=null;var De=oe=oe.next;do ae=S(ae,De.action),De=De.next;while(De!==oe);Py(ae,w.memoizedState)||(Hm=!0),w.memoizedState=ae,w.baseQueue===null&&(w.baseState=ae),Q.lastRenderedState=ae}return[ae,W]}function DD(S,w,Q){var W=Is,oe=vm();if(Oa){if(Q===void 0)throw Error("Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.");var ae=Q();iX||ae===Q()||(console.error("The result of getServerSnapshot should be cached to avoid an infinite loop"),iX=!0)}else{if(ae=w(),iX||(Q=w(),Py(ae,Q)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),iX=!0)),Cd===null)throw Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");(ma&127)!==0||zl(W,w,ae)}return oe.memoizedState=ae,Q={value:ae,getSnapshot:w},oe.queue=Q,HD(cy.bind(null,W,Q,S),[S]),W.flags|=2048,EI(Ib|n1,{destroy:void 0},bI.bind(null,W,Q,ae,w),null),ae}function H2(S,w,Q){var W=Is,oe=cl(),ae=Oa;if(ae){if(Q===void 0)throw Error("Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.");Q=Q()}else if(Q=w(),!iX){var De=w();Py(Q,De)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),iX=!0)}if(De=!Py((xd||oe).memoizedState,Q))oe.memoizedState=Q,Hm=!0;oe=oe.queue;var Qe=cy.bind(null,W,oe,S);if(bg(2048,n1,Qe,[S]),S=oe.getSnapshot!==w||De||C_!==null&&(C_.memoizedState.tag&Ib)!==rre,EI(S?Ib|n1:n1,{destroy:void 0},bI.bind(null,W,oe,Q,w),null),S){if(W.flags|=2048,Cd===null)throw Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");ae||(ZM&127)!==0||zl(W,w,Q)}return Q}function zl(S,w,Q){S.flags|=16384,S={getSnapshot:w,value:Q},w=Is.updateQueue,w===null?(w=wD(),Is.updateQueue=w,w.stores=[S]):(Q=w.stores,Q===null?w.stores=[S]:Q.push(S))}function bI(S,w,Q,W){w.value=Q,w.getSnapshot=W,up(w)&&ly(S)}function cy(S,w,Q){return Q(function(){up(w)&&(Qf(2,"updateSyncExternalStore()",S),ly(S))})}function up(S){var w=S.getSnapshot;S=S.value;try{var Q=w();return!Py(S,Q)}catch(W){return!0}}function ly(S){var w=Ln(S,2);w!==null&&Kd(w,S,2)}function ND(S){var w=vm();if(typeof S==="function"){var Q=S;if(S=Q(),rz){Ct(!0);try{Q()}finally{Ct(!1)}}}return w.memoizedState=w.baseState=S,w.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ad,lastRenderedState:S},w}function II(S){S=ND(S);var w=S.queue,Q=WD.bind(null,Is,w);return w.dispatch=Q,[S.memoizedState,Q]}function D4(S){var w=vm();w.memoizedState=w.baseState=S;var Q={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return w.queue=Q,w=XD.bind(null,Is,!0,Q),Q.dispatch=w,[S,w]}function LC(S,w){var Q=cl();return RD(Q,xd,S,w)}function RD(S,w,Q,W){return S.baseState=Q,TD(S,xd,typeof W==="function"?W:Ad)}function HC(S,w){var Q=cl();if(xd!==null)return RD(Q,xd,S,w);return Q.baseState=S,[S,Q.queue.dispatch]}function tW(S,w,Q,W,oe){if(Of(S))throw Error("Cannot update action state while rendering.");if(S=w.action,S!==null){var ae={payload:oe,action:S,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(De){ae.listeners.push(De)}};Xn.T!==null?Q(!0):ae.isTransition=!1,W(ae),Q=w.pending,Q===null?(ae.next=w.pending=ae,uM(w,ae)):(ae.next=Q.next,w.pending=Q.next=ae)}}function uM(S,w){var{action:Q,payload:W}=w,oe=S.state;if(w.isTransition){var ae=Xn.T,De={};De.types=ae!==null?ae.types:null,De._updatedFibers=new Set,Xn.T=De;try{var Qe=Q(oe,W),ot=Xn.S;ot!==null&&ot(De,Qe),QD(S,w,Qe)}catch(_t){vI(S,w,_t)}finally{ae!==null&&De.types!==null&&(ae.types!==null&&ae.types!==De.types&&console.error("We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."),ae.types=De.types),Xn.T=ae,ae===null&&De._updatedFibers&&(S=De._updatedFibers.size,De._updatedFibers.clear(),10<S&&console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."))}}else try{De=Q(oe,W),QD(S,w,De)}catch(_t){vI(S,w,_t)}}function QD(S,w,Q){Q!==null&&typeof Q==="object"&&typeof Q.then==="function"?(Xn.asyncTransitions++,Q.then(N4,N4),Q.then(function(W){tF(S,w,W)},function(W){return vI(S,w,W)}),w.isTransition||console.error("An async function with useActionState was called outside of a transition. This is likely not what you intended (for example, isPending will not update correctly). Either call the returned function inside startTransition, or pass it to an `action` or `formAction` prop.")):tF(S,w,Q)}function tF(S,w,Q){w.status="fulfilled",w.value=Q,kD(w),S.state=Q,w=S.pending,w!==null&&(Q=w.next,Q===w?S.pending=null:(Q=Q.next,w.next=Q,uM(S,Q)))}function vI(S,w,Q){var W=S.pending;if(S.pending=null,W!==null){W=W.next;do w.status="rejected",w.reason=Q,kD(w),w=w.next;while(w!==W)}S.action=null}function kD(S){S=S.listeners;for(var w=0;w<S.length;w++)(0,S[w])()}function LD(S,w){return w}function SI(S,w){if(Oa){var Q=Cd.formState;if(Q!==null){e:{var W=Is;if(Oa){if(qd){t:{var oe=qd;for(var ae=Cb;oe.nodeType!==8;){if(!ae){oe=null;break t}if(oe=Tm(oe.nextSibling),oe===null){oe=null;break t}}ae=oe.data,oe=ae===gRe||ae===lyt?oe:null}if(oe){qd=Tm(oe.nextSibling),W=oe.data===gRe;break e}}fA(W)}W=!1}W&&(w=Q[0])}}return Q=vm(),Q.memoizedState=Q.baseState=w,W={pending:null,lanes:0,dispatch:null,lastRenderedReducer:LD,lastRenderedState:w},Q.queue=W,Q=WD.bind(null,Is,W),W.dispatch=Q,W=ND(!1),ae=XD.bind(null,Is,!1,W.queue),W=vm(),oe={state:w,dispatch:null,action:S,pending:null},W.queue=oe,Q=tW.bind(null,Is,oe,ae,Q),oe.dispatch=Q,W.memoizedState=S,[w,Q,!1]}function PI(S){var w=cl();return nW(w,xd,S)}function nW(S,w,Q){if(w=TD(S,w,LD)[0],S=bA(Ad)[0],typeof w==="object"&&w!==null&&typeof w.then==="function")try{var W=CI(w)}catch(De){if(De===nX)throw sge;throw De}else W=w;w=cl();var oe=w.queue,ae=oe.dispatch;return Q!==w.memoizedState&&(Is.flags|=2048,EI(Ib|n1,{destroy:void 0},oW.bind(null,oe,Q),null)),[W,ae,S]}function oW(S,w){S.action=w}function u_(S){var w=cl(),Q=xd;if(Q!==null)return nW(w,Q,S);cl(),w=w.memoizedState,Q=cl();var W=Q.queue.dispatch;return Q.memoizedState=S,[w,W,!1]}function EI(S,w,Q,W){return S={tag:S,create:Q,deps:W,inst:w,next:null},w=Is.updateQueue,w===null&&(w=wD(),Is.updateQueue=w),Q=w.lastEffect,Q===null?w.lastEffect=S.next=S:(W=Q.next,Q.next=S,S.next=W,w.lastEffect=S),S}function Wd(S){var w=vm();return S={current:S},w.memoizedState=S}function FC(S,w,Q,W){var oe=vm();Is.flags|=S,oe.memoizedState=EI(Ib|w,{destroy:void 0},Q,W===void 0?null:W)}function bg(S,w,Q,W){var oe=cl();W=W===void 0?null:W;var ae=oe.memoizedState.inst;xd!==null&&W!==null&&xI(W,xd.memoizedState.deps)?oe.memoizedState=EI(w,ae,Q,W):(Is.flags|=S,oe.memoizedState=EI(Ib|w,ae,Q,W))}function HD(S,w){(Is.mode&A9)!==gs?FC(545261568,n1,S,w):FC(8390656,n1,S,w)}function zC(S){Is.flags|=4;var w=Is.updateQueue;if(w===null)w=wD(),Is.updateQueue=w,w.events=[S];else{var Q=w.events;Q===null?w.events=[S]:Q.push(S)}}function MI(S){var w=vm(),Q={impl:S};return w.memoizedState=Q,function(){if((hl&Rg)!==LA)throw Error("A function wrapped in useEffectEvent can't be called during rendering.");return Q.impl.apply(void 0,arguments)}}function OC(S){var w=cl().memoizedState;return zC({ref:w,nextImpl:S}),function(){if((hl&Rg)!==LA)throw Error("A function wrapped in useEffectEvent can't be called during rendering.");return w.impl.apply(void 0,arguments)}}function VC(S,w){var Q=4194308;return(Is.mode&A9)!==gs&&(Q|=268435456),FC(Q,n3,S,w)}function nF(S,w){if(typeof w==="function"){S=S();var Q=w(S);return function(){typeof Q==="function"?Q():w(null)}}if(w!==null&&w!==void 0)return w.hasOwnProperty("current")||console.error("Expected useImperativeHandle() first argument to either be a ref callback or React.createRef() object. Instead received: %s.","an object with keys {"+Object.keys(w).join(", ")+"}"),S=S(),w.current=S,function(){w.current=null}}function FD(S,w,Q){typeof w!=="function"&&console.error("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.",w!==null?typeof w:"null"),Q=Q!==null&&Q!==void 0?Q.concat([S]):null;var W=4194308;(Is.mode&A9)!==gs&&(W|=268435456),FC(W,n3,nF.bind(null,w,S),Q)}function pM(S,w,Q){typeof w!=="function"&&console.error("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.",w!==null?typeof w:"null"),Q=Q!==null&&Q!==void 0?Q.concat([S]):null,bg(4,n3,nF.bind(null,w,S),Q)}function zD(S,w){return vm().memoizedState=[S,w===void 0?null:w],S}function T8(S,w){var Q=cl();w=w===void 0?null:w;var W=Q.memoizedState;if(w!==null&&xI(w,W[1]))return W[0];return Q.memoizedState=[S,w],S}function D8(S,w){var Q=vm();w=w===void 0?null:w;var W=S();if(rz){Ct(!0);try{S()}finally{Ct(!1)}}return Q.memoizedState=[W,w],W}function N8(S,w){var Q=cl();w=w===void 0?null:w;var W=Q.memoizedState;if(w!==null&&xI(w,W[1]))return W[0];if(W=S(),rz){Ct(!0);try{S()}finally{Ct(!1)}}return Q.memoizedState=[W,w],W}function R8(S,w){var Q=vm();return VD(Q,S,w)}function rW(S,w){var Q=cl();return YD(Q,xd.memoizedState,S,w)}function OD(S,w){var Q=cl();return xd===null?VD(Q,S,w):YD(Q,xd.memoizedState,S,w)}function VD(S,w,Q){if(Q===void 0||(ZM&1073741824)!==0&&(ma&261930)===0)return S.memoizedState=w;return S.memoizedState=Q,S=hN(),Is.lanes|=S,$N|=S,Q}function YD(S,w,Q,W){if(Py(Q,w))return Q;if(jN.current!==null)return S=VD(S,Q,W),Py(S,w)||(Hm=!0),S;if((ZM&106)===0||(ZM&1073741824)!==0&&(ma&261930)===0)return Hm=!0,S.memoizedState=Q;return S=hN(),Is.lanes|=S,$N|=S,w}function N4(){Xn.asyncTransitions--}function mM(S,w,Q,W,oe){var ae=Jc.p;Jc.p=ae!==0&&ae<f_?ae:f_;var De=Xn.T,Qe={};Qe.types=De!==null?De.types:null,Qe._updatedFibers=new Set,Xn.T=Qe,XD(S,!1,w,Q);try{var ot=oe(),_t=Xn.S;if(_t!==null&&_t(Qe,ot),ot!==null&&typeof ot==="object"&&typeof ot.then==="function"){Xn.asyncTransitions++,ot.then(N4,N4);var Yt=ZU(ot,W);AM(S,w,Yt,Pm(S))}else AM(S,w,W,Pm(S))}catch(rn){AM(S,w,{then:function(){},status:"rejected",reason:rn},Pm(S))}finally{Jc.p=ae,De!==null&&Qe.types!==null&&(De.types!==null&&De.types!==Qe.types&&console.error("We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."),De.types=Qe.types),Xn.T=De,De===null&&Qe._updatedFibers&&(S=Qe._updatedFibers.size,Qe._updatedFibers.clear(),10<S&&console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."))}}function GD(S,w,Q,W){if(S.tag!==5)throw Error("Expected the form instance to be a HostComponent. This is a bug in React.");var oe=_M(S).queue;WH(S),mM(S,oe,w,Az,Q===null?l:function(){return oF(S),Q(W)})}function _M(S){var w=S.memoizedState;if(w!==null)return w;w={memoizedState:Az,baseState:Az,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ad,lastRenderedState:Az},next:null};var Q={};return w.next={memoizedState:Q,baseState:Q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ad,lastRenderedState:Q},next:null},S.memoizedState=w,S=S.alternate,S!==null&&(S.memoizedState=w),w}function oF(S){Xn.T===null&&console.error("requestFormReset was called outside a transition or action. To fix, move to an action, or wrap with startTransition.");var w=_M(S);w.next===null&&(w=S.alternate.memoizedState),AM(S,w.next.queue,{},Pm(S))}function gM(){var S=ND(!1);return S=mM.bind(null,Is,S.queue,!0,!1),vm().memoizedState=S,[!1,S]}function rF(){var S=bA(Ad)[0],w=cl().memoizedState;return[typeof S==="boolean"?S:CI(S),w]}function iW(){var S=ay(Ad)[0],w=cl().memoizedState;return[typeof S==="boolean"?S:CI(S),w]}function R4(){return fl(CX)}function YC(){var S=vm(),w=Cd.identifierPrefix;if(Oa){var Q=KM,W=jM;Q=(W&~(1<<32-mh(W)-1)).toString(32)+Q,w="_"+w+"R_"+Q,Q=dge++,0<Q&&(w+="H"+Q.toString(32)),w+="_"}else Q=t5o++,w="_"+w+"r_"+Q.toString(32)+"_";return S.memoizedState=w}function UD(){return vm().memoizedState=sW.bind(null,Is)}function sW(S,w){for(var Q=S.return;Q!==null;){switch(Q.tag){case 24:case 3:var W=Pm(Q),oe=al(W),ae=NC(Q,oe,W);ae!==null&&(Qf(W,"refresh()",S),Kd(ae,Q,W),cM(ae,Q,W)),S=kx(),w!==null&&w!==void 0&&ae!==null&&console.error("The seed argument is not enabled outside experimental channels."),oe.payload={cache:S};return}Q=Q.return}}function yl(S,w,Q){var W=arguments;typeof W[3]==="function"&&console.error("State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()."),W=Pm(S);var oe={lane:W,revertLane:0,gesture:null,action:Q,hasEagerState:!1,eagerState:null,next:null};Of(S)?aW(w,oe):(oe=Mn(S,w,oe,W),oe!==null&&(Qf(W,"dispatch()",S),Kd(oe,S,W),jD(oe,w,W)))}function WD(S,w,Q){var W=arguments;typeof W[3]==="function"&&console.error("State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()."),W=Pm(S),AM(S,w,Q,W)&&Qf(W,"setState()",S)}function AM(S,w,Q,W){var oe={lane:W,revertLane:0,gesture:null,action:Q,hasEagerState:!1,eagerState:null,next:null};if(Of(S))aW(w,oe);else{var ae=S.alternate;if(S.lanes===0&&(ae===null||ae.lanes===0)&&(ae=w.lastRenderedReducer,ae!==null)){var De=Xn.H;Xn.H=C9;try{var Qe=w.lastRenderedState,ot=ae(Qe,Q);if(oe.hasEagerState=!0,oe.eagerState=ot,Py(ot,Qe))return xn(S,w,oe,0),Cd===null&&tn(),!1}catch(_t){}finally{Xn.H=De}}if(Q=Mn(S,w,oe,W),Q!==null)return Kd(Q,S,W),jD(Q,w,W),!0}return!1}function XD(S,w,Q,W){if(Xn.T===null&&WN===0&&console.error("An optimistic state update occurred outside a transition or action. To fix, move the update to an action, or wrap with startTransition."),W={lane:2,revertLane:L4(),gesture:null,action:W,hasEagerState:!1,eagerState:null,next:null},Of(S)){if(w)throw Error("Cannot update optimistic state while rendering.");console.error("Cannot call startTransition while rendering.")}else w=Mn(S,Q,W,2),w!==null&&(Qf(2,"setOptimistic()",S),Kd(w,S,2))}function Of(S){var w=S.alternate;return S===Is||w!==null&&w===Is}function aW(S,w){sX=hge=!0;var Q=S.pending;Q===null?w.next=w:(w.next=Q.next,Q.next=w),S.pending=w}function jD(S,w,Q){if((Q&4194048)!==0){var W=w.lanes;W&=S.pendingLanes,Q|=W,w.lanes=Q,ft(S,Q)}}function KD(S){if(S!==null&&typeof S!=="function"){var w=String(S);k1t.has(w)||(k1t.add(w),console.error("Expected the last optional `callback` argument to be a function. Instead received: %s.",S))}}function $D(S,w,Q,W){var oe=S.memoizedState,ae=Q(W,oe);if(S.mode&e1){Ct(!0);try{ae=Q(W,oe)}finally{Ct(!1)}}ae===void 0&&(w=U(w)||"Component",D1t.has(w)||(D1t.add(w),console.error("%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.",w))),oe=ae===null||ae===void 0?oe:pa({},oe,ae),S.memoizedState=oe,S.lanes===0&&(S.updateQueue.baseState=oe)}function iF(S,w,Q,W,oe,ae,De){var Qe=S.stateNode;if(typeof Qe.shouldComponentUpdate==="function"){if(Q=Qe.shouldComponentUpdate(W,ae,De),S.mode&e1){Ct(!0);try{Q=Qe.shouldComponentUpdate(W,ae,De)}finally{Ct(!1)}}return Q===void 0&&console.error("%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.",U(w)||"Component"),Q}return w.prototype&&w.prototype.isPureReactComponent?!b4(Q,W)||!b4(oe,ae):!0}function Q8(S,w,Q,W){var oe=w.state;typeof w.componentWillReceiveProps==="function"&&w.componentWillReceiveProps(Q,W),typeof w.UNSAFE_componentWillReceiveProps==="function"&&w.UNSAFE_componentWillReceiveProps(Q,W),w.state!==oe&&(S=Y(S)||"Component",E1t.has(S)||(E1t.add(S),console.error("%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.",S)),WNe.enqueueReplaceState(w,w.state,null))}function wI(S,w){var Q=w;if("ref"in w){Q={};for(var W in w)W!=="ref"&&(Q[W]=w[W])}if(S=S.defaultProps){Q===w&&(Q=pa({},Q));for(var oe in S)Q[oe]===void 0&&(Q[oe]=S[oe])}return Q}function GC(S){xNe(S),console.warn(`%s

%s
`,aX?"An error occurred in the <"+aX+"> component.":"An error occurred in one of your React components.",`Consider adding an error boundary to your tree to customize error handling behavior.
Visit https://react.dev/link/error-boundaries to learn more about error boundaries.`)}function UC(S){var w=aX?"The above error occurred in the <"+aX+"> component.":"The above error occurred in one of your React components.",Q="React will try to recreate this component tree from scratch using the error boundary you provided, "+((XNe||"Anonymous")+".");if(typeof S==="object"&&S!==null&&typeof S.environmentName==="string"){var W=S.environmentName;S=[`%o

%s

%s
`,S,w,Q].slice(0),typeof S[0]==="string"?S.splice(0,1,yyt+" "+S[0],xyt,Yge+W+Yge,Cyt):S.splice(0,0,yyt,xyt,Yge+W+Yge,Cyt),S.unshift(console),W=I5o.apply(console.error,S),W()}else console.error(`%o

%s

%s
`,S,w,Q)}function qD(S){xNe(S)}function k8(S,w){try{aX=w.source?Y(w.source):null,XNe=null;var Q=w.value;if(Xn.actQueue!==null)Xn.thrownErrors.push(Q);else{var W=S.onUncaughtError;W(Q,{componentStack:w.stack})}}catch(oe){setTimeout(function(){throw oe})}}function sF(S,w,Q){try{aX=Q.source?Y(Q.source):null,XNe=Y(w);var W=S.onCaughtError;W(Q.value,{componentStack:Q.stack,errorBoundary:w.tag===1?w.stateNode:null})}catch(oe){setTimeout(function(){throw oe})}}function fM(S,w,Q){return Q=al(Q),Q.tag=zNe,Q.payload={element:null},Q.callback=function(){ye(w.source,k8,S,w)},Q}function yM(S){return S=al(S),S.tag=zNe,S}function L8(S,w,Q,W){var oe=Q.type.getDerivedStateFromError;if(typeof oe==="function"){var ae=W.value;S.payload=function(){return oe(ae)},S.callback=function(){ta(Q),ye(W.source,sF,w,Q,W)}}var De=Q.stateNode;De!==null&&typeof De.componentDidCatch==="function"&&(S.callback=function(){ta(Q),ye(W.source,sF,w,Q,W),typeof oe!=="function"&&(JN===null?JN=new Set([this]):JN.add(this)),qxo(this,W),typeof oe==="function"||(Q.lanes&2)===0&&console.error("%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.",Y(Q)||"Unknown")})}function Fx(S,w,Q,W,oe){if(Q.flags|=32768,Z2&&Ux(S,oe),W!==null&&typeof W==="object"&&typeof W.then==="function"){if(w=Q.alternate,w!==null&&Rx(w,Q,oe,!0),Oa&&(T7=!0),Q=Jf.current,Q!==null){switch(Q.tag){case 31:case 13:case 19:return t1===null?EM():Q.alternate===null&&Y0===tw&&(Y0=fge),Q.flags&=-257,Q.flags|=65536,Q.lanes=oe,W===age?Q.flags|=16384:(w=Q.updateQueue,w===null?Q.updateQueue=new Set([W]):w.add(W),EF(S,W,oe)),!1;case 22:return Q.flags|=65536,W===age?Q.flags|=16384:(w=Q.updateQueue,w===null?(w={transitions:null,markerInstances:null,retryQueue:new Set([W])},Q.updateQueue=w):(Q=w.retryQueue,Q===null?w.retryQueue=new Set([W]):Q.add(W)),EF(S,W,oe)),!1}throw Error("Unexpected Suspense handler tag ("+Q.tag+"). This is a bug in React.")}return EF(S,W,oe),EM(),!1}if(Oa)return T7=!0,w=Jf.current,w!==null?(w.tag===19&&console.error("SuspenseList should never catch while hydrating. This is a bug in React."),(w.flags&65536)===0&&(w.flags|=256),w.flags|=65536,w.lanes=oe,W!==PNe&&M4(ds(Error("There was an error while hydrating but React was able to recover by instead client rendering from the nearest Suspense boundary.",{cause:W}),Q))):(W!==PNe&&M4(ds(Error("There was an error while hydrating but React was able to recover by instead client rendering the entire root.",{cause:W}),Q)),S=S.current.alternate,S.flags|=65536,oe&=-oe,S.lanes|=oe,W=ds(W,Q),oe=fM(S.stateNode,W,oe),lM(S,oe),Y0!==KN&&(Y0=sz)),!1;var ae=ds(Error("There was an error during concurrent rendering but React was able to recover by instead synchronously rendering the entire root.",{cause:W}),Q);if(mre===null?mre=[ae]:mre.push(ae),Y0!==KN&&(Y0=sz),w===null)return!0;W=ds(W,Q),Q=w;do{switch(Q.tag){case 3:return Q.flags|=65536,S=oe&-oe,Q.lanes|=S,S=fM(Q.stateNode,W,S),lM(Q,S),!1;case 1:if(w=Q.type,ae=Q.stateNode,(Q.flags&128)===0&&(typeof w.getDerivedStateFromError==="function"||ae!==null&&typeof ae.componentDidCatch==="function"&&(JN===null||!JN.has(ae))))return Q.flags|=65536,oe&=-oe,Q.lanes|=oe,oe=yM(oe),L8(oe,S,Q,W),lM(Q,oe),!1;break;case 22:if(Q.memoizedState!==null)return Q.flags|=65536,!1}Q=Q.return}while(Q!==null);return!1}function F0(S,w,Q,W){w.child=S===null?g1t(w,null,Q,W):oz(w,S.child,Q,W)}function JD(S,w,Q,W,oe){Q=Q.render;var ae=tr(Q);if(ae!==Q&&(Q=ae,S!==null&&(Hm=!0)),ae=w.ref,"ref"in W){var De={};for(var Qe in W)Qe!=="ref"&&(De[Qe]=W[Qe])}else De=W;if(Qx(w),W=ZH(S,w,Q,De,ae,oe),Qe=ED(),S!==null&&!Hm)return MD(S,w,oe),uy(S,w,oe);return Oa&&Qe&&xg(w),w.flags|=1,F0(S,w,W,oe),w.child}function xM(S,w,Q,W,oe){if(S===null){var ae=Q.type;if(typeof ae==="function"&&!na(ae)&&ae.defaultProps===void 0&&Q.compare===null)return Q=tr(ae),w.tag=15,w.type=Q,aF(w,ae),hy(S,w,Q,W,oe);return S=jt(Q.type,null,W,w,w.mode,oe),S.ref=w.ref,S.return=w,w.child=S}if(ae=S.child,!bi(S,oe)){var De=ae.memoizedProps;if(Q=Q.compare,Q=Q!==null?Q:b4,Q(De,W)&&S.ref===w.ref)return uy(S,w,oe)}return w.flags|=1,S=vc(ae,W),S.ref=w.ref,S.return=w,w.child=S}function hy(S,w,Q,W,oe){if(S!==null){var ae=S.memoizedProps;if(b4(ae,W)&&S.ref===w.ref&&w.type===S.type)if(Hm=!1,w.pendingProps=W=ae,bi(S,oe))(S.flags&131072)!==0&&(Hm=!0);else return w.lanes=S.lanes,uy(S,w,oe)}return IA(S,w,Q,W,oe)}function Q4(S,w,Q,W){var oe=W.children,ae=S!==null?S.memoizedState:null;if(S===null&&w.stateNode===null&&(w.stateNode={_visibility:zoe,_pendingMarkers:null,_retryCache:null,_transitions:null}),W.mode==="hidden"){if((w.flags&128)!==0){if(ae=ae!==null?ae.baseLanes|Q:Q,S!==null){W=w.child=S.child;for(oe=0;W!==null;)oe=oe|W.lanes|W.childLanes,W=W.sibling;W=oe&~ae}else W=0,w.child=null;return H8(S,w,ae,Q,W)}if((Q&536870912)!==0)w.memoizedState={baseLanes:0,cachePool:null},S!==null&&S8(w,ae!==null?ae.cachePool:null),ae!==null?CD(w,ae):dM(w),ID(w);else return W=w.lanes=536870912,H8(S,w,ae!==null?ae.baseLanes|Q:Q,Q,W)}else ae!==null?(S8(w,ae.cachePool),CD(w,ae),QC(w),w.memoizedState=null):(S!==null&&S8(w,null),dM(w),QC(w));return F0(S,w,oe,Q),w.child}function Xd(S,w){return S!==null&&S.tag===22||w.stateNode!==null||(w.stateNode={_visibility:zoe,_pendingMarkers:null,_retryCache:null,_transitions:null}),w.sibling}function H8(S,w,Q,W,oe){var ae=oM();return ae=ae===null?null:{parent:x_._currentValue,pool:ae},w.memoizedState={baseLanes:Q,cachePool:ae},S!==null&&S8(w,null),dM(w),ID(w),S!==null&&Rx(S,w,W,!0),w.childLanes=oe,null}function CM(S,w){var Q=w.hidden;return Q!==void 0&&console.error(`<Activity> doesn't accept a hidden prop. Use mode="hidden" instead.
- <Activity %s>
+ <Activity %s>`,Q===!0?"hidden":Q===!1?"hidden={false}":"hidden={...}",Q?'mode="hidden"':'mode="visible"'),w=zx({mode:w.mode,children:w.children},S.mode),w.ref=S.ref,S.child=w,w.return=S,w}function Vi(S,w,Q){return oz(w,S.child,null,Q),S=CM(w,w.pendingProps),S.flags|=2,Im(w),w.memoizedState=null,S}function cW(S,w,Q){var W=w.pendingProps,oe=(w.flags&128)!==0;if(w.flags&=-129,S===null){if(Oa){if(W.mode==="hidden")return S=CM(w,W),w.lanes=536870912,S.memoizedState={baseLanes:0,cachePool:null},Xd(null,S);if(JH(w),(S=qd)?(Q=U4(S,Cb),Q=Q!==null&&Q.data===pz?Q:null,Q!==null&&(W={dehydrated:Q,treeContext:Fl(),retryLane:536870912,hydrationErrors:null},w.memoizedState=W,W=pi(Q),W.return=w,w.child=W,NA=w,qd=null)):Q=null,Q===null)throw ZE(w,S),fA(w);return w.lanes=536870912,null}return CM(w,W)}var ae=S.memoizedState;if(ae!==null){var De=ae.dehydrated;if(JH(w),oe)if(w.flags&256)w.flags&=-257,w=Vi(S,w,Q);else if(w.memoizedState!==null)w.child=S.child,w.flags|=128,w=null;else throw Error("Client rendering an Activity suspended it again. This is a bug in React.");else if(GH(),(Q&536870912)!==0&&uN(w),Hm||Rx(S,w,Q,!1),oe=(Q&S.childLanes)!==0,Hm||oe){if(jN.current===null){if(W=Cd,W!==null&&(De=It(W,Q),De!==0&&De!==ae.retryLane))throw ae.retryLane=De,Ln(S,De),Kd(W,S,De),jNe;EM()}w=Vi(S,w,Q)}else S=ae.treeContext,qd=Tm(De.nextSibling),NA=w,Oa=!0,ON=null,T7=!1,t3=null,Cb=!1,S!==null&&JE(w,S),w=CM(w,W),w.flags|=134221824;return w}return ae=S.child,W={mode:W.mode,children:W.children},(Q&536870912)!==0&&(Q&S.lanes)!==0&&uN(w),S=vc(ae,W),S.ref=w.ref,w.child=S,S.return=w,S}function BI(S,w){var Q=w.ref;if(Q===null)S!==null&&S.ref!==null&&(w.flags|=4194816);else{if(typeof Q!=="function"&&typeof Q!=="object")throw Error("Expected ref to be a function, an object returned by React.createRef(), or undefined/null.");if(S===null||S.ref!==Q)w.flags|=4194816}}function IA(S,w,Q,W,oe){if(Q.prototype&&typeof Q.prototype.render==="function"){var ae=U(Q)||"Unknown";L1t[ae]||(console.error("The <%s /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change %s to extend React.Component instead.",ae,ae),L1t[ae]=!0)}if(w.mode&e1&&x9.recordLegacyContextWarning(w,null),S===null&&(aF(w,w.type),Q.contextTypes&&(ae=U(Q)||"Unknown",F1t[ae]||(F1t[ae]=!0,console.error("%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with React.useContext() instead. (https://react.dev/link/legacy-context)",ae)))),Qx(w),Q=ZH(S,w,Q,W,void 0,oe),W=ED(),S!==null&&!Hm)return MD(S,w,oe),uy(S,w,oe);return Oa&&W&&xg(w),w.flags|=1,F0(S,w,Q,oe),w.child}function ZD(S,w,Q,W,oe,ae){if(Qx(w),ew=-1,sre=S!==null&&S.type!==w.type,w.updateQueue=null,Q=PD(w,W,Q,oe),eF(S,w),W=ED(),S!==null&&!Hm)return MD(S,w,ae),uy(S,w,ae);return Oa&&W&&xg(w),w.flags|=1,F0(S,w,Q,ae),w.child}function Ig(S,w,Q,W,oe){switch(s(w)){case!1:var ae=w.stateNode,De=new w.type(w.memoizedProps,ae.context).state;ae.updater.enqueueSetState(ae,De,null);break;case!0:w.flags|=128,w.flags|=65536,ae=Error("Simulated error coming from DevTools");var Qe=oe&-oe;if(w.lanes|=Qe,De=Cd,De===null)throw Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");Qe=yM(Qe),L8(Qe,De,w,ds(ae,w)),lM(w,Qe)}if(Qx(w),w.stateNode===null){if(De=zN,ae=Q.contextType,"contextType"in Q&&ae!==null&&(ae===void 0||ae.$$typeof!==Yl)&&!Q1t.has(Q)&&(Q1t.add(Q),Qe=ae===void 0?" However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file.":typeof ae!=="object"?" However, it is set to a "+typeof ae+".":ae.$$typeof===q4?" Did you accidentally pass the Context.Consumer instead?":" However, it is set to an object with keys {"+Object.keys(ae).join(", ")+"}.",console.error("%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s",U(Q)||"Component",Qe)),typeof ae==="object"&&ae!==null&&(De=fl(ae)),ae=new Q(W,De),w.mode&e1){Ct(!0);try{ae=new Q(W,De)}finally{Ct(!1)}}if(De=w.memoizedState=ae.state!==null&&ae.state!==void 0?ae.state:null,ae.updater=WNe,w.stateNode=ae,ae._reactInternals=w,ae._reactInternalInstance=P1t,typeof Q.getDerivedStateFromProps==="function"&&De===null&&(De=U(Q)||"Component",M1t.has(De)||(M1t.add(De),console.error("`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.",De,ae.state===null?"null":"undefined",De))),typeof Q.getDerivedStateFromProps==="function"||typeof ae.getSnapshotBeforeUpdate==="function"){var ot=Qe=De=null;if(typeof ae.componentWillMount==="function"&&ae.componentWillMount.__suppressDeprecationWarning!==!0?De="componentWillMount":typeof ae.UNSAFE_componentWillMount==="function"&&(De="UNSAFE_componentWillMount"),typeof ae.componentWillReceiveProps==="function"&&ae.componentWillReceiveProps.__suppressDeprecationWarning!==!0?Qe="componentWillReceiveProps":typeof ae.UNSAFE_componentWillReceiveProps==="function"&&(Qe="UNSAFE_componentWillReceiveProps"),typeof ae.componentWillUpdate==="function"&&ae.componentWillUpdate.__suppressDeprecationWarning!==!0?ot="componentWillUpdate":typeof ae.UNSAFE_componentWillUpdate==="function"&&(ot="UNSAFE_componentWillUpdate"),De!==null||Qe!==null||ot!==null){ae=U(Q)||"Component";var _t=typeof Q.getDerivedStateFromProps==="function"?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";B1t.has(ae)||(B1t.add(ae),console.error(`Unsafe legacy lifecycles will not be called for components using new component APIs.

%s uses %s but also contains the following legacy lifecycles:%s%s%s

The above lifecycles should be removed. Learn more about this warning here:
https://react.dev/link/unsafe-component-lifecycles`,ae,_t,De!==null?`
  `+De:"",Qe!==null?`
  `+Qe:"",ot!==null?`
  `+ot:""))}}ae=w.stateNode,De=U(Q)||"Component",ae.render||(Q.prototype&&typeof Q.prototype.render==="function"?console.error("No `render` method found on the %s instance: did you accidentally return an object from the constructor?",De):console.error("No `render` method found on the %s instance: you may have forgotten to define `render`.",De)),!ae.getInitialState||ae.getInitialState.isReactClassApproved||ae.state||console.error("getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?",De),ae.getDefaultProps&&!ae.getDefaultProps.isReactClassApproved&&console.error("getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.",De),ae.contextType&&console.error("contextType was defined as an instance property on %s. Use a static property to define contextType instead.",De),Q.childContextTypes&&!R1t.has(Q)&&(R1t.add(Q),console.error("%s uses the legacy childContextTypes API which was removed in React 19. Use React.createContext() instead. (https://react.dev/link/legacy-context)",De)),Q.contextTypes&&!N1t.has(Q)&&(N1t.add(Q),console.error("%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with static contextType instead. (https://react.dev/link/legacy-context)",De)),typeof ae.componentShouldUpdate==="function"&&console.error("%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.",De),Q.prototype&&Q.prototype.isPureReactComponent&&typeof ae.shouldComponentUpdate<"u"&&console.error("%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.",U(Q)||"A pure component"),typeof ae.componentDidUnmount==="function"&&console.error("%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?",De),typeof ae.componentDidReceiveProps==="function"&&console.error("%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().",De),typeof ae.componentWillRecieveProps==="function"&&console.error("%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?",De),typeof ae.UNSAFE_componentWillRecieveProps==="function"&&console.error("%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?",De),Qe=ae.props!==W,ae.props!==void 0&&Qe&&console.error("When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.",De),ae.defaultProps&&console.error("Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.",De,De),typeof ae.getSnapshotBeforeUpdate!=="function"||typeof ae.componentDidUpdate==="function"||w1t.has(Q)||(w1t.add(Q),console.error("%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.",U(Q))),typeof ae.getDerivedStateFromProps==="function"&&console.error("%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.",De),typeof ae.getDerivedStateFromError==="function"&&console.error("%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.",De),typeof Q.getSnapshotBeforeUpdate==="function"&&console.error("%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.",De),(Qe=ae.state)&&(typeof Qe!=="object"||O0(Qe))&&console.error("%s.state: must be set to an object or null",De),typeof ae.getChildContext==="function"&&typeof Q.childContextTypes!=="object"&&console.error("%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().",De),ae=w.stateNode,ae.props=W,ae.state=w.memoizedState,ae.refs={},M8(w),De=Q.contextType,ae.context=typeof De==="object"&&De!==null?fl(De):zN,ae.state===W&&(De=U(Q)||"Component",T1t.has(De)||(T1t.add(De),console.error("%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.",De))),w.mode&e1&&x9.recordLegacyContextWarning(w,ae),x9.recordUnsafeLifecycleWarnings(w,ae),ae.state=w.memoizedState,De=Q.getDerivedStateFromProps,typeof De==="function"&&($D(w,Q,De,W),ae.state=w.memoizedState),typeof Q.getDerivedStateFromProps==="function"||typeof ae.getSnapshotBeforeUpdate==="function"||typeof ae.UNSAFE_componentWillMount!=="function"&&typeof ae.componentWillMount!=="function"||(De=ae.state,typeof ae.componentWillMount==="function"&&ae.componentWillMount(),typeof ae.UNSAFE_componentWillMount==="function"&&ae.UNSAFE_componentWillMount(),De!==ae.state&&(console.error("%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.",Y(w)||"Component"),WNe.enqueueReplaceState(ae,ae.state,null)),w8(w,W,ae,oe),xA(),ae.state=w.memoizedState),typeof ae.componentDidMount==="function"&&(w.flags|=4194308),(w.mode&A9)!==gs&&(w.flags|=268435456),ae=!0}else if(S===null){ae=w.stateNode;var Yt=w.memoizedProps;Qe=wI(Q,Yt),ae.props=Qe;var rn=ae.context;ot=Q.contextType,De=zN,typeof ot==="object"&&ot!==null&&(De=fl(ot)),_t=Q.getDerivedStateFromProps,ot=typeof _t==="function"||typeof ae.getSnapshotBeforeUpdate==="function",Yt=w.pendingProps!==Yt,ot||typeof ae.UNSAFE_componentWillReceiveProps!=="function"&&typeof ae.componentWillReceiveProps!=="function"||(Yt||rn!==De)&&Q8(w,ae,W,De),XN=!1;var on=w.memoizedState;ae.state=on,w8(w,W,ae,oe),xA(),rn=w.memoizedState,Yt||on!==rn||XN?(typeof _t==="function"&&($D(w,Q,_t,W),rn=w.memoizedState),(Qe=XN||iF(w,Q,Qe,W,on,rn,De))?(ot||typeof ae.UNSAFE_componentWillMount!=="function"&&typeof ae.componentWillMount!=="function"||(typeof ae.componentWillMount==="function"&&ae.componentWillMount(),typeof ae.UNSAFE_componentWillMount==="function"&&ae.UNSAFE_componentWillMount()),typeof ae.componentDidMount==="function"&&(w.flags|=4194308),(w.mode&A9)!==gs&&(w.flags|=268435456)):(typeof ae.componentDidMount==="function"&&(w.flags|=4194308),(w.mode&A9)!==gs&&(w.flags|=268435456),w.memoizedProps=W,w.memoizedState=rn),ae.props=W,ae.state=rn,ae.context=De,ae=Qe):(typeof ae.componentDidMount==="function"&&(w.flags|=4194308),(w.mode&A9)!==gs&&(w.flags|=268435456),ae=!1)}else{ae=w.stateNode,AI(S,w),De=w.memoizedProps,ot=wI(Q,De),ae.props=ot,_t=w.pendingProps,on=ae.context,rn=Q.contextType,Qe=zN,typeof rn==="object"&&rn!==null&&(Qe=fl(rn)),Yt=Q.getDerivedStateFromProps,(rn=typeof Yt==="function"||typeof ae.getSnapshotBeforeUpdate==="function")||typeof ae.UNSAFE_componentWillReceiveProps!=="function"&&typeof ae.componentWillReceiveProps!=="function"||(De!==_t||on!==Qe)&&Q8(w,ae,W,Qe),XN=!1,on=w.memoizedState,ae.state=on,w8(w,W,ae,oe),xA();var Cn=w.memoizedState;De!==_t||on!==Cn||XN||S!==null&&S.dependencies!==null&&B4(S.dependencies)?(typeof Yt==="function"&&($D(w,Q,Yt,W),Cn=w.memoizedState),(ot=XN||iF(w,Q,ot,W,on,Cn,Qe)||S!==null&&S.dependencies!==null&&B4(S.dependencies))?(rn||typeof ae.UNSAFE_componentWillUpdate!=="function"&&typeof ae.componentWillUpdate!=="function"||(typeof ae.componentWillUpdate==="function"&&ae.componentWillUpdate(W,Cn,Qe),typeof ae.UNSAFE_componentWillUpdate==="function"&&ae.UNSAFE_componentWillUpdate(W,Cn,Qe)),typeof ae.componentDidUpdate==="function"&&(w.flags|=4),typeof ae.getSnapshotBeforeUpdate==="function"&&(w.flags|=1024)):(typeof ae.componentDidUpdate!=="function"||De===S.memoizedProps&&on===S.memoizedState||(w.flags|=4),typeof ae.getSnapshotBeforeUpdate!=="function"||De===S.memoizedProps&&on===S.memoizedState||(w.flags|=1024),w.memoizedProps=W,w.memoizedState=Cn),ae.props=W,ae.state=Cn,ae.context=Qe,ae=ot):(typeof ae.componentDidUpdate!=="function"||De===S.memoizedProps&&on===S.memoizedState||(w.flags|=4),typeof ae.getSnapshotBeforeUpdate!=="function"||De===S.memoizedProps&&on===S.memoizedState||(w.flags|=1024),ae=!1)}if(Qe=ae,BI(S,w),De=(w.flags&128)!==0,Qe||De){if(Qe=w.stateNode,Se(w),De&&typeof Q.getDerivedStateFromError!=="function")Q=null,Ey=-1;else if(Q=n1t(Qe),w.mode&e1){Ct(!0);try{n1t(Qe)}finally{Ct(!1)}}w.flags|=1,S!==null&&De?(w.child=oz(w,S.child,null,oe),w.child=oz(w,null,Q,oe)):F0(S,w,Q,oe),w.memoizedState=Qe.state,S=w.child}else S=uy(S,w,oe);return oe=w.stateNode,ae&&oe.props!==W&&(cX||console.error("It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.",Y(w)||"a component"),cX=!0),S}function lW(S,w,Q,W){return TC(),w.flags|=256,F0(S,w,Q,W),w.child}function aF(S,w){w&&w.childContextTypes&&console.error(`childContextTypes cannot be defined on a function component.
  %s.childContextTypes = ...`,w.displayName||w.name||"Component"),typeof w.getDerivedStateFromProps==="function"&&(S=U(w)||"Unknown",z1t[S]||(console.error("%s: Function components do not support getDerivedStateFromProps.",S),z1t[S]=!0)),typeof w.contextType==="object"&&w.contextType!==null&&(w=U(w)||"Unknown",H1t[w]||(console.error("%s: Function components do not support contextType.",w),H1t[w]=!0))}function Ma(S){return{baseLanes:S,cachePool:gI()}}function pp(S,w,Q){return S=S!==null?S.childLanes&~Q:0,w&&(S|=t5),S}function TI(S,w,Q){var W=w.pendingProps;i(w)&&(w.flags|=128);var oe=!1,ae=(w.flags&128)!==0,De;if((De=ae)||(De=S!==null&&S.memoizedState===null?!1:(Zf.current&ore)!==0),De&&(oe=!0,w.flags&=-129),De=(w.flags&32)!==0,w.flags&=-33,S===null){if(Oa){if(oe?RC(w):QC(w),(S=qd)?(Q=U4(S,Cb),Q=Q!==null&&Q.data!==pz?Q:null,Q!==null&&(De={dehydrated:Q,treeContext:Fl(),retryLane:536870912,hydrationErrors:null},w.memoizedState=De,De=pi(Q),De.return=w,w.child=De,NA=w,qd=null)):Q=null,Q===null)throw ZE(w,S),fA(w);return ll(Q)?w.lanes=32:w.lanes=536870912,null}if(ae=W.children,W=W.fallback,oe)return QC(w),oe=w.mode,ae=zx({mode:"hidden",children:ae},oe),W=oo(W,oe,Q,null),ae.return=w,W.return=w,ae.sibling=W,w.child=ae,W=w.child,W.memoizedState=Ma(Q),W.childLanes=pp(S,De,Q),w.memoizedState=$Ne,Xd(null,W);return RC(w),mp(w,ae)}var Qe=S.memoizedState;if(Qe!==null){var ot=Qe.dehydrated;if(ot!==null)return vg(S,w,ae,De,W,ot,Qe,Q)}if(oe)return QC(w),oe=W.fallback,ae=w.mode,Qe=S.child,ot=Qe.sibling,W=vc(Qe,{mode:"hidden",children:W.children}),W.subtreeFlags=Qe.subtreeFlags&1206910976,ot!==null?oe=vc(ot,oe):(oe=oo(oe,ae,Q,null),oe.flags|=2),oe.return=w,W.return=w,W.sibling=oe,w.child=W,Xd(null,W),W=w.child,oe=S.child.memoizedState,oe===null?oe=Ma(Q):(ae=oe.cachePool,ae!==null?(Qe=x_._currentValue,ae=ae.parent!==Qe?{parent:Qe,pool:Qe}:ae):ae=gI(),oe={baseLanes:oe.baseLanes|Q,cachePool:ae}),W.memoizedState=oe,W.childLanes=pp(S,De,Q),w.memoizedState=$Ne,Xd(S.child,W);return Qe!==null&&(Q&62914560)===Q&&(Q&S.lanes)!==0&&uN(w),RC(w),Q=S.child,S=Q.sibling,Q=vc(Q,{mode:"visible",children:W.children}),Q.return=w,Q.sibling=null,S!==null&&(De=w.deletions,De===null?(w.deletions=[S],w.flags|=16):De.push(S)),w.child=Q,w.memoizedState=null,Q}function mp(S,w){return w=zx({mode:"visible",children:w},S.mode),w.return=S,S.child=w}function zx(S,w){return S=u(22,S,null,w),S.lanes=0,S}function Ur(S,w,Q){return oz(w,S.child,null,Q),S=mp(w,w.pendingProps.children),S.flags|=2,w.memoizedState=null,S}function vg(S,w,Q,W,oe,ae,De,Qe){if(Q){if(w.flags&256)return RC(w),w.flags&=-257,Ur(S,w,Qe);if(w.memoizedState!==null)return QC(w),w.child=S.child,w.flags|=128,null;QC(w);var ot=oe.fallback,_t=w.mode,Yt=zx({mode:"visible",children:oe.children},_t);return ot=oo(ot,_t,Qe,null),ot.flags|=2,Yt.return=w,ot.return=w,Yt.sibling=ot,w.child=Yt,oz(w,S.child,null,Qe),ot=w.child,ot.memoizedState=Ma(Qe),ot.childLanes=pp(S,W,Qe),w.memoizedState=$Ne,Xd(null,ot)}if(RC(w),GH(),(Qe&536870912)!==0&&uN(w),ll(ae)){if(W=ae.nextSibling&&ae.nextSibling.dataset,W){ot=W.dgst;var rn=W.msg;_t=W.stck,Yt=W.cstck}return ae=rn,De=ot,oe=_t,W=Yt,ot=De,_t=ae,Yt=oe,oe=W,ot!==$xo&&(W=_t?Error(_t):Error("The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering."),W.stack=Yt||"",W.digest=ot,ot=oe===void 0?null:oe,_t={value:W,source:null,stack:ot},typeof ot==="string"&&SNe.set(W,_t),M4(_t)),Ur(S,w,Qe)}if(Hm||Rx(S,w,Qe,!1),W=(Qe&S.childLanes)!==0,Hm||W){if(jN.current!==null)return Ur(S,w,Qe);if(W=Cd,W!==null&&(ot=It(W,Qe),ot!==0&&ot!==De.retryLane))throw De.retryLane=ot,Ln(S,ot),Kd(W,S,ot),jNe;return Ji(ae)||EM(),Ur(S,w,Qe)}if(Ji(ae))return w.flags|=192,w.child=S.child,null;return S=De.treeContext,qd=Tm(ae.nextSibling),NA=w,Oa=!0,ON=null,T7=!1,t3=null,Cb=!1,S!==null&&JE(w,S),w=mp(w,oe.children),w.flags|=134221824,w}function eN(S,w,Q){S.lanes|=w;var W=S.alternate;W!==null&&(W.lanes|=w),a0(S.return,w,Q)}function hW(S){for(var w=null;S!==null;){var Q=S.alternate;Q!==null&&SD(Q)===null&&(w=S),S=S.sibling}return w}function F8(S,w,Q,W,oe,ae){var De=S.memoizedState;De===null?S.memoizedState={isBackwards:w,rendering:null,renderingStartTime:0,last:W,tail:Q,tailMode:oe,treeForkCount:ae}:(De.isBackwards=w,De.rendering=null,De.renderingStartTime=0,De.last=W,De.tail=Q,De.tailMode=oe,De.treeForkCount=ae)}function dy(S){var w=S.child;for(S.child=null;w!==null;){var Q=w.sibling;w.sibling=S.child,S.child=w,w=Q}}function DI(S,w,Q){var W=w.pendingProps,oe=W.revealOrder,ae=W.tail,De=W.children,Qe=Zf.current;if(w.flags&128)return CA(w,Qe),null;if((W=(Qe&ore)!==0)?(Qe=Qe&rX|ore,w.flags|=128):Qe&=rX,CA(w,Qe),Qe=oe==null?"null":oe,oe!=null&&oe!=="forwards"&&oe!=="backwards"&&oe!=="unstable_legacy-backwards"&&oe!=="together"&&oe!=="independent"&&!O1t[Qe])if(O1t[Qe]=!0,typeof oe==="string")switch(oe.toLowerCase()){case"together":case"forwards":case"backwards":case"independent":console.error('"%s" is not a valid value for revealOrder on <SuspenseList />. Use lowercase "%s" instead.',oe,oe.toLowerCase());break;case"forward":case"backward":console.error('"%s" is not a valid value for revealOrder on <SuspenseList />. React uses the -s suffix in the spelling. Use "%ss" instead.',oe,oe.toLowerCase());break;default:console.error('"%s" is not a supported revealOrder on <SuspenseList />. Did you mean "independent", "together", "forwards" or "backwards"?',oe)}else console.error('%s is not a supported value for revealOrder on <SuspenseList />. Did you mean "independent", "together", "forwards" or "backwards"?',oe);Qe=ae==null?"null":ae,KNe[Qe]||ae==null||(ae!=="visible"&&ae!=="collapsed"&&ae!=="hidden"?(KNe[Qe]=!0,console.error('"%s" is not a supported value for tail on <SuspenseList />. Did you mean "visible", "collapsed" or "hidden"?',ae)):oe!=null&&oe!=="forwards"&&oe!=="backwards"&&oe!=="unstable_legacy-backwards"&&(KNe[Qe]=!0,console.error('<SuspenseList tail="%s" /> is only valid if revealOrder is "forwards" (default) or "backwards". Did you mean to specify revealOrder="forwards"?',ae)));e:if((oe==null||oe==="forwards"||oe==="backwards"||oe==="unstable_legacy-backwards")&&De!==void 0&&De!==null&&De!==!1)if(O0(De)){for(Qe=0;Qe<De.length;Qe++)if(!qH(De[Qe],Qe))break e}else if(Qe=O(De),typeof Qe==="function"){if(Qe=Qe.call(De))for(var ot=Qe.next(),_t=0;!ot.done;ot=Qe.next()){if(!qH(ot.value,_t))break e;_t++}}else console.error('A single row was passed to a <SuspenseList revealOrder="%s" />. This is not useful since it needs multiple rows. Did you mean to pass multiple children or an array?',oe);if(oe==="backwards"&&S!==null?(dy(S),F0(S,w,De,Q),dy(S)):F0(S,w,De,Q),Oa?(P4(),De=Ooe):De=0,!W&&S!==null&&(S.flags&128)!==0)e:for(S=w.child;S!==null;){if(S.tag===13)S.memoizedState!==null&&eN(S,Q,w);else if(S.tag===19)eN(S,Q,w);else if(S.child!==null){S.child.return=S,S=S.child;continue}if(S===w)break e;for(;S.sibling===null;){if(S.return===null||S.return===w)break e;S=S.return}S.sibling.return=S.return,S=S.sibling}switch(oe){case"backwards":Q=hW(w.child),Q===null?(oe=w.child,w.child=null):(oe=Q.sibling,Q.sibling=null,dy(w)),F8(w,!0,oe,null,ae,De);break;case"unstable_legacy-backwards":Q=null,oe=w.child;for(w.child=null;oe!==null;){if(S=oe.alternate,S!==null&&SD(S)===null){w.child=oe;break}S=oe.sibling,oe.sibling=Q,Q=oe,oe=S}F8(w,!0,Q,null,ae,De);break;case"together":F8(w,!1,null,null,void 0,De);break;case"independent":w.memoizedState=null;break;default:Q=hW(w.child),Q===null?(oe=w.child,w.child=null):(oe=Q.sibling,Q.sibling=null),F8(w,!1,oe,Q,ae,De)}return w.child}function tN(S,w,Q){var{type:W,pendingProps:oe}=w,ae=oe.value;return"value"in oe||Y1t||(Y1t=!0,console.error("The `value` prop is required for the `<Context.Provider>`. Did you misspell it or forget to pass it?")),w4(w,W,ae),F0(S,w,oe.children,Q),w.child}function uy(S,w,Q){if(S!==null&&(w.dependencies=S.dependencies),Ey=-1,$N|=w.lanes,(Q&w.childLanes)===0)if(S!==null){if(Rx(S,w,Q,!1),(Q&w.childLanes)===0)return null}else return null;if(S!==null&&w.child!==S.child)throw Error("Resuming work not yet implemented.");if(w.child!==null){S=w.child,Q=vc(S,S.pendingProps),w.child=Q;for(Q.return=w;S.sibling!==null;)S=S.sibling,Q=Q.sibling=vc(S,S.pendingProps),Q.return=w;Q.sibling=null}return w.child}function bi(S,w){if((S.lanes&w)!==0)return!0;return S=S.dependencies,S!==null&&B4(S)?!0:!1}function Vf(S,w,Q){switch(w.tag){case 3:se(w,w.stateNode.containerInfo),w4(w,x_,S.memoizedState.cache),TC();break;case 27:case 5:Z(w);break;case 4:se(w,w.stateNode.containerInfo);break;case 10:w4(w,w.type,w.memoizedProps.value);break;case 12:(Q&w.childLanes)!==0&&(w.flags|=4),w.flags|=2048;var W=w.stateNode;W.effectDuration=-0,W.passiveEffectDuration=-0;break;case 31:if(w.memoizedState!==null)return w.flags|=128,JH(w),null;break;case 13:if(W=w.memoizedState,W!==null){if(W.dehydrated!==null)return RC(w),w.flags|=128,null;W=Rx(S,w,Q,!1);var oe=w.child.childLanes;if(W||(Q&oe)!==0)return TI(S,w,Q);return RC(w),S=uy(S,w,Q),S!==null?S.sibling:null}RC(w);break;case 19:if(w.flags&128)return DI(S,w,Q);if(oe=(S.flags&128)!==0,W=(Q&w.childLanes)!==0,W||(Rx(S,w,Q,!1),W=(Q&w.childLanes)!==0),oe){if(W)return DI(S,w,Q);w.flags|=128}if(oe=w.memoizedState,oe!==null&&(oe.rendering=null,oe.tail=null,oe.lastEffect=null),CA(w,Zf.current),W)break;else return null;case 22:return w.lanes=0,Q4(S,w,Q,w.pendingProps);case 24:w4(w,x_,S.memoizedState.cache)}return uy(S,w,Q)}function Op(S,w,Q){if(w._debugNeedsRemount&&S!==null){Q=jt(tr(w.elementType),w.key,w.pendingProps,w._debugOwner||null,w.mode,w.lanes),Q._debugStack=w._debugStack,Q._debugTask=w._debugTask;var W=w.return;if(W===null)throw Error("Cannot swap the root fiber.");if(S.alternate=null,w.alternate=null,Q.index=w.index,Q.sibling=w.sibling,Q.return=w.return,Q.ref=w.ref,Q._debugInfo=w._debugInfo,w===W.child)W.child=Q;else{var oe=W.child;if(oe===null)throw Error("Expected parent to have a child.");for(;oe.sibling!==w;)if(oe=oe.sibling,oe===null)throw Error("Expected to find the previous sibling.");oe.sibling=Q}return w=W.deletions,w===null?(W.deletions=[S],W.flags|=16):w.push(S),Q.flags|=134217730,Q}if(S!==null)if(S.memoizedProps!==w.pendingProps||w.type!==S.type)Hm=!0;else{if(!bi(S,Q)&&(w.flags&128)===0)return Hm=!1,Vf(S,w,Q);Hm=(S.flags&131072)!==0?!0:!1}else{if(Hm=!1,W=Oa)P4(),W=(w.flags&1048576)!==0;W&&(W=w.index,P4(),Th(w,Ooe,W))}switch(w.lanes=0,w.tag){case 16:e:if(W=w.pendingProps,S=Lx(w.elementType),S=tr(S),w.type=S,typeof S==="function")na(S)?(W=wI(S,W),w.tag=1,w=Ig(null,w,S,W,Q)):(w.tag=0,aF(w,S),w=IA(null,w,S,W,Q));else{if(S!==void 0&&S!==null){if(oe=S.$$typeof,oe===BN){w.tag=11,w=JD(null,w,S,W,Q);break e}else if(oe===h9){w.tag=14,w=xM(null,w,S,W,Q);break e}else if(oe===Yl){w.tag=10,w.type=S,w=tN(null,w,Q);break e}}throw w="",S!==null&&typeof S==="object"&&S.$$typeof===Qm&&(w=" Did you wrap a component in React.lazy() more than once?"),Q=U(S)||S,Error("Element type is invalid. Received a promise that resolves to: "+Q+". Lazy element type must resolve to a class or function."+w)}return w;case 0:return IA(S,w,w.type,w.pendingProps,Q);case 1:return W=w.type,oe=wI(W,w.pendingProps),Ig(S,w,W,oe,Q);case 3:e:{if(se(w,w.stateNode.containerInfo),S===null)throw Error("Should have a current fiber. This is a bug in React.");W=w.pendingProps;var ae=w.memoizedState;oe=ae.element,AI(S,w),w8(w,W,null,Q);var De=w.memoizedState;if(W=De.cache,w4(w,x_,W),W!==ae.cache&&I8(w,[x_],Q,!0),xA(),W=De.element,ae.isDehydrated)if(ae={element:W,isDehydrated:!1,cache:De.cache},w.updateQueue.baseState=ae,w.memoizedState=ae,w.flags&256){w=lW(S,w,W,Q);break e}else if(W!==oe){oe=ds(Error("This root received an early update, before anything was able hydrate. Switched the entire root to client rendering."),w),M4(oe),w=lW(S,w,W,Q);break e}else{switch(S=w.stateNode.containerInfo,S.nodeType){case 9:S=S.body;break;default:S=S.nodeName==="HTML"?S.ownerDocument.body:S}qd=Tm(S.firstChild),NA=w,Oa=!0,ON=null,T7=!1,t3=null,Cb=!0,Q=g1t(w,null,W,Q);for(w.child=Q;Q;)Q.flags=Q.flags&-3|134221824,Q=Q.sibling}else{if(TC(),W===oe){w=uy(S,w,Q);break e}F0(S,w,W,Q)}w=w.child}return w;case 26:return BI(S,w),S===null?(Q=A7(w.type,null,w.pendingProps,null))?w.memoizedState=Q:Oa||(w.stateNode=g_(w.type,w.pendingProps,ee(wA.current),w)):w.memoizedState=A7(w.type,S.memoizedProps,w.pendingProps,S.memoizedState),null;case 27:return Z(w),S===null&&Oa&&(W=ee(wA.current),oe=re(),W=w.stateNode=EA(w.type,w.pendingProps,W,oe,!1),T7||(oe=H4(W,w.type,w.pendingProps,oe),oe!==null&&(E4(w,0).serverProps=oe)),NA=w,Cb=!0,oe=qd,Xx(w.type)?(bRe=oe,qd=Tm(W.firstChild)):qd=oe),F0(S,w,w.pendingProps.children,Q),BI(S,w),S===null&&(w.flags|=4194304),w.child;case 5:return S===null&&Oa&&(ae=re(),W=_u(w.type,ae.ancestorInfo),oe=qd,(De=!oe)||(De=LM(oe,w.type,w.pendingProps,Cb),De!==null?(w.stateNode=De,T7||(ae=H4(De,w.type,w.pendingProps,ae),ae!==null&&(E4(w,0).serverProps=ae)),NA=w,qd=Tm(De.firstChild),Cb=!1,ae=!0):ae=!1,De=!ae),De&&(W&&ZE(w,oe),fA(w))),Z(w),oe=w.type,ae=w.pendingProps,De=S!==null?S.memoizedProps:null,W=ae.children,r7(oe,ae)?W=null:De!==null&&r7(oe,De)&&(w.flags|=32),w.memoizedState!==null&&(oe=ZH(S,w,eW,null,null,Q),CX._currentValue=oe),BI(S,w),F0(S,w,W,Q),w.child;case 6:return S===null&&Oa&&(Q=w.pendingProps,S=re(),W=S.ancestorInfo.current,Q=W!=null?o0(Q,W.tag,S.ancestorInfo.implicitRootScope):!0,S=qd,(W=!S)||(W=TW(S,w.pendingProps,Cb),W!==null?(w.stateNode=W,NA=w,qd=null,W=!0):W=!1,W=!W),W&&(Q&&ZE(w,S),fA(w))),null;case 13:return TI(S,w,Q);case 4:return se(w,w.stateNode.containerInfo),W=w.pendingProps,S===null?w.child=oz(w,null,W,Q):F0(S,w,W,Q),w.child;case 11:return JD(S,w,w.type,w.pendingProps,Q);case 7:return W=w.pendingProps,BI(S,w),F0(S,w,W,Q),w.child;case 8:return F0(S,w,w.pendingProps.children,Q),w.child;case 12:return w.flags|=4,w.flags|=2048,W=w.stateNode,W.effectDuration=-0,W.passiveEffectDuration=-0,F0(S,w,w.pendingProps.children,Q),w.child;case 10:return tN(S,w,Q);case 9:return oe=w.type._context,W=w.pendingProps.children,typeof W!=="function"&&console.error("A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it."),Qx(w),oe=fl(oe),W=QNe(W,oe,void 0),w.flags|=1,F0(S,w,W,Q),w.child;case 14:return xM(S,w,w.type,w.pendingProps,Q);case 15:return hy(S,w,w.type,w.pendingProps,Q);case 19:return DI(S,w,Q);case 31:return cW(S,w,Q);case 22:return Q4(S,w,Q,w.pendingProps);case 24:return Qx(w),W=fl(x_),S===null?(oe=oM(),oe===null&&(oe=Cd,ae=kx(),oe.pooledCache=ae,T4(ae),ae!==null&&(oe.pooledCacheLanes|=Q),oe=ae),w.memoizedState={parent:W,cache:oe},M8(w),w4(w,x_,oe)):((S.lanes&Q)!==0&&(AI(S,w),w8(w,null,null,Q),xA()),oe=S.memoizedState,ae=w.memoizedState,oe.parent!==W?(oe={parent:W,cache:W},w.memoizedState=oe,w.lanes===0&&(w.memoizedState=w.updateQueue.baseState=oe),w4(w,x_,W)):(W=ae.cache,w4(w,x_,W),W!==oe.cache&&I8(w,[x_],Q,!0))),F0(S,w,w.pendingProps.children,Q),w.child;case 30:return w.stateNode===null&&(w.stateNode={autoName:null,paired:null,clones:null,ref:null}),W=w.pendingProps,W.name!=null&&W.name!=="auto"?w.flags|=S===null?18882560:18874368:Oa&&xg(w),W.className!==void 0&&(oe=typeof W.className==="string"?JSON.stringify(W.className):"{...}",V1t[oe]||(V1t[oe]=!0,console.error(`<ViewTransition> doesn't accept a "className" prop. It has been renamed to "default".
-   <ViewTransition className=%s>
+   <ViewTransition default=%s>`,oe,oe))),S!==null&&S.memoizedProps.name!==W.name?w.flags|=4194816:BI(S,w),F0(S,w,W.children,Q),w.child;case 29:throw w.pendingProps}throw Error("Unknown unit of work tag ("+w.tag+"). This error is likely caused by a bug in React. Please file an issue.")}function k4(S){S.flags|=4}function fu(S,w,Q,W,oe){var ae;if(ae=(S.mode&U2t)!==gs)ae=Q===null?Hn(w,W):Hn(w,W)&&(W.src!==Q.src||W.srcSet!==Q.srcSet);if(ae){if(S.flags|=16777216,(oe&335544128)===oe)if(S.stateNode.complete)S.flags|=8192;else if(xF())S.flags|=8192;else throw nz=age,LNe}else S.flags&=-16777217}function dW(S,w){if(w.type!=="stylesheet"||(w.state.loading&Sb)!==gz)S.flags&=-16777217;else if(S.flags|=16777216,!so(w))if(xF())S.flags|=8192;else throw nz=age,LNe}function Kc(S,w){w!==null&&(S.flags|=4),S.flags&16384&&(w=S.tag!==22?We():536870912,S.lanes|=w,lz|=w)}function zn(S,w){if(!Oa)switch(S.tailMode){case"visible":break;case"collapsed":for(var Q=S.tail,W=null;Q!==null;)Q.alternate!==null&&(W=Q),Q=Q.sibling;W===null?w||S.tail===null?S.tail=null:S.tail.sibling=null:W.sibling=null;break;default:w=S.tail;for(Q=null;w!==null;)w.alternate!==null&&(Q=w),w=w.sibling;Q===null?S.tail=null:Q.sibling=null}}function Ol(S){var w=S.alternate!==null&&S.alternate.child===S.child,Q=0,W=0;if(w)if((S.mode&za)!==gs){for(var{selfBaseDuration:oe,child:ae}=S;ae!==null;)Q|=ae.lanes|ae.childLanes,W|=ae.subtreeFlags&1206910976,W|=ae.flags&1206910976,oe+=ae.treeBaseDuration,ae=ae.sibling;S.treeBaseDuration=oe}else for(oe=S.child;oe!==null;)Q|=oe.lanes|oe.childLanes,W|=oe.subtreeFlags&1206910976,W|=oe.flags&1206910976,oe.return=S,oe=oe.sibling;else if((S.mode&za)!==gs){oe=S.actualDuration,ae=S.selfBaseDuration;for(var De=S.child;De!==null;)Q|=De.lanes|De.childLanes,W|=De.subtreeFlags,W|=De.flags,oe+=De.actualDuration,ae+=De.treeBaseDuration,De=De.sibling;S.actualDuration=oe,S.treeBaseDuration=ae}else for(oe=S.child;oe!==null;)Q|=oe.lanes|oe.childLanes,W|=oe.subtreeFlags,W|=oe.flags,oe.return=S,oe=oe.sibling;return S.subtreeFlags|=W,S.childLanes=Q,w}function _oe(S,w,Q){var W=w.pendingProps;switch(Cg(w),w.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ol(w),null;case 1:return Ol(w),null;case 3:if(Q=w.stateNode,W=null,S!==null&&(W=S.memoizedState.cache),w.memoizedState.cache!==W&&(w.flags|=2048),R2(x_,w),ne(w),Q.pendingContext&&(Q.context=Q.pendingContext,Q.pendingContext=null),S===null||S.child===null)C8(w)?(b8(),k4(w)):S===null||S.memoizedState.isDehydrated&&(w.flags&256)===0||(w.flags|=1024,eM());return Ol(w),null;case 26:var{type:oe,memoizedState:ae}=w;return S===null?(k4(w),ae!==null?(Ol(w),dW(w,ae)):(Ol(w),fu(w,oe,null,W,Q))):ae?ae!==S.memoizedState?(k4(w),Ol(w),dW(w,ae)):(Ol(w),w.flags&=-16777217):(S=S.memoizedProps,S!==W&&k4(w),Ol(w),fu(w,oe,S,W,Q)),null;case 27:if(te(w),Q=ee(wA.current),oe=w.type,S!==null&&w.stateNode!=null)S.memoizedProps!==W&&k4(w);else{if(!W){if(w.stateNode===null)throw Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");return Ol(w),w.subtreeFlags&=-33554433,null}S=re(),C8(w)?Rf(w,S):(S=EA(oe,W,Q,S,!0),w.stateNode=S,k4(w))}return Ol(w),w.subtreeFlags&=-33554433,null;case 5:if(te(w),oe=w.type,S!==null&&w.stateNode!=null)S.memoizedProps!==W&&k4(w);else{if(!W){if(w.stateNode===null)throw Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");return Ol(w),w.subtreeFlags&=-33554433,null}var De=re();if(C8(w))Rf(w,De);else{switch(ae=ee(wA.current),_u(oe,De.ancestorInfo),De=De.context,ae=Dh(ae),De){case yX:ae=ae.createElementNS(Te,oe);break;case Fge:ae=ae.createElementNS(Ce,oe);break;default:switch(oe){case"svg":ae=ae.createElementNS(Te,oe);break;case"math":ae=ae.createElementNS(Ce,oe);break;case"script":ae=ae.createElement("div"),uyt||rb(W)||(console.error("Encountered a script tag while rendering React component. Scripts inside React components are never executed when rendering on the client. Consider using template tag instead (https://developer.mozilla.org/en-US/docs/Web/HTML/Element/template)."),uyt=!0),ae.innerHTML="<script></script>",ae=ae.removeChild(ae.firstChild);break;case"select":ae=typeof W.is==="string"?ae.createElement("select",{is:W.is}):ae.createElement("select"),W.multiple?ae.multiple=!0:W.size&&(ae.size=W.size);break;default:ae=typeof W.is==="string"?ae.createElement(oe,{is:W.is}):ae.createElement(oe),oe.indexOf("-")===-1&&(oe!==oe.toLowerCase()&&console.error("<%s /> is using incorrect casing. Use PascalCase for React components, or lowercase for HTML elements.",oe),Object.prototype.toString.call(ae)!=="[object HTMLUnknownElement]"||J2.call(pyt,oe)||(pyt[oe]=!0,console.error("The tag <%s> is unrecognized in this browser. If you meant to render a React component, start its name with an uppercase letter.",oe)))}}ae[_0]=w,ae[TA]=W;e:for(De=w.child;De!==null;){if(De.tag===5||De.tag===6)ae.appendChild(De.stateNode);else if(De.tag!==4&&De.tag!==27&&De.child!==null){De.child.return=De,De=De.child;continue}if(De===w)break e;for(;De.sibling===null;){if(De.return===null||De.return===w)break e;De=De.return}De.sibling.return=De.return,De=De.sibling}w.stateNode=ae;e:switch(Vp(ae,oe,W),oe){case"button":case"input":case"select":case"textarea":W=!!W.autoFocus;break e;case"img":W=!0;break e;default:W=!1}W&&k4(w)}}return Ol(w),w.subtreeFlags&=-33554433,fu(w,w.type,S===null?null:S.memoizedProps,w.pendingProps,Q),null;case 6:if(S&&w.stateNode!=null)S.memoizedProps!==W&&k4(w);else{if(typeof W!=="string"&&w.stateNode===null)throw Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");if(S=ee(wA.current),Q=re(),C8(w)){if(S=w.stateNode,Q=w.memoizedProps,oe=!T7,W=null,ae=NA,ae!==null)switch(ae.tag){case 3:oe&&(oe=W4(S,Q,W),oe!==null&&(E4(w,0).serverProps=oe));break;case 27:case 5:W=ae.memoizedProps,oe&&(oe=W4(S,Q,W),oe!==null&&(E4(w,0).serverProps=oe))}S[_0]=w,S=S.nodeValue===Q||W!==null&&W.suppressHydrationWarning===!0||TM(S.nodeValue,Q)?!0:!1,S||fA(w,!0)}else oe=Q.ancestorInfo.current,oe!=null&&o0(W,oe.tag,Q.ancestorInfo.implicitRootScope),S=Dh(S).createTextNode(W),S[_0]=w,w.stateNode=S}return Ol(w),null;case 31:if(Q=w.memoizedState,S===null||S.memoizedState!==null){if(W=C8(w),Q!==null){if(S===null){if(!W)throw Error("A dehydrated suspense component was completed without a hydrated node. This is probably a bug in React.");if(S=w.memoizedState,S=S!==null?S.dehydrated:null,!S)throw Error("Expected to have a hydrated activity instance. This error is likely caused by a bug in React. Please file an issue.");S[_0]=w,Ol(w),(w.mode&za)!==gs&&Q!==null&&(S=w.child,S!==null&&(w.treeBaseDuration-=S.treeBaseDuration))}else b8(),TC(),(w.flags&128)===0&&(Q=w.memoizedState=null),w.flags|=4,Ol(w),(w.mode&za)!==gs&&Q!==null&&(S=w.child,S!==null&&(w.treeBaseDuration-=S.treeBaseDuration));S=!1}else Q=eM(),S!==null&&S.memoizedState!==null&&(S.memoizedState.hydrationErrors=Q),S=!0;if(!S){if(w.flags&256)return Im(w),w;return Im(w),null}if((w.flags&128)!==0)throw Error("Client rendering an Activity suspended it again. This is a bug in React.")}return Ol(w),null;case 13:if(W=w.memoizedState,S===null||S.memoizedState!==null&&S.memoizedState.dehydrated!==null){if(oe=W,ae=C8(w),oe!==null&&oe.dehydrated!==null){if(S===null){if(!ae)throw Error("A dehydrated suspense component was completed without a hydrated node. This is probably a bug in React.");if(ae=w.memoizedState,ae=ae!==null?ae.dehydrated:null,!ae)throw Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");ae[_0]=w,Ol(w),(w.mode&za)!==gs&&oe!==null&&(oe=w.child,oe!==null&&(w.treeBaseDuration-=oe.treeBaseDuration))}else b8(),TC(),(w.flags&128)===0&&(oe=w.memoizedState=null),w.flags|=4,Ol(w),(w.mode&za)!==gs&&oe!==null&&(oe=w.child,oe!==null&&(w.treeBaseDuration-=oe.treeBaseDuration));oe=!1}else oe=eM(),S!==null&&S.memoizedState!==null&&(S.memoizedState.hydrationErrors=oe),oe=!0;if(!oe){if(w.flags&256)return Im(w),w;return Im(w),null}}if(Im(w),(w.flags&128)!==0)return w.lanes=Q,(w.mode&za)!==gs&&Ff(w),w;return Q=W!==null,S=S!==null&&S.memoizedState!==null,Q&&(W=w.child,oe=null,W.alternate!==null&&W.alternate.memoizedState!==null&&W.alternate.memoizedState.cachePool!==null&&(oe=W.alternate.memoizedState.cachePool.pool),ae=null,W.memoizedState!==null&&W.memoizedState.cachePool!==null&&(ae=W.memoizedState.cachePool.pool),ae!==oe&&(W.flags|=2048)),Q!==S&&Q&&(w.child.flags|=8192),Kc(w,w.updateQueue),Ol(w),(w.mode&za)!==gs&&Q&&(S=w.child,S!==null&&(w.treeBaseDuration-=S.treeBaseDuration)),null;case 4:return ne(w),S===null&&yy(w.stateNode.containerInfo),w.flags|=67108864,Ol(w),null;case 10:return R2(w.type,w),Ol(w),null;case 19:if(vD(w),W=w.memoizedState,W===null)return Ol(w),null;if(oe=(w.flags&128)!==0,ae=W.rendering,ae===null)if(oe)zn(W,!1);else{if(Y0!==tw||S!==null&&(S.flags&128)!==0)for(S=w.child;S!==null;){if(ae=SD(S),ae!==null){w.flags|=128,zn(W,!1),S=ae.updateQueue,w.updateQueue=S,Kc(w,S),w.subtreeFlags=0,S=Q;for(Q=w.child;Q!==null;)zp(Q,S),Q=Q.sibling;return CA(w,Zf.current&rX|ore),Oa&&Ea(w,W.treeForkCount),w.child}S=S.sibling}W.tail!==null&&es()>vge&&(w.flags|=128,oe=!0,zn(W,!1),w.lanes=4194304)}else{if(!oe)if(S=SD(ae),S!==null){if(w.flags|=128,oe=!0,S=S.updateQueue,w.updateQueue=S,Kc(w,S),zn(W,!0),W.tail===null&&W.tailMode!=="collapsed"&&W.tailMode!=="visible"&&!ae.alternate&&!Oa)return Ol(w),null}else 2*es()-W.renderingStartTime>vge&&Q!==536870912&&(w.flags|=128,oe=!0,zn(W,!1),w.lanes=4194304);W.isBackwards?(ae.sibling=w.child,w.child=ae):(S=W.last,S!==null?S.sibling=ae:w.child=ae,W.last=ae)}if(W.tail!==null){S=W.tail;e:{for(Q=S;Q!==null;){if(Q.alternate!==null){Q=!1;break e}Q=Q.sibling}Q=!0}return W.rendering=S,W.tail=S.sibling,W.renderingStartTime=es(),S.sibling=null,ae=Zf.current,ae=oe?ae&rX|ore:ae&rX,W.tailMode==="visible"||W.tailMode==="collapsed"||!Q||Oa?CA(w,ae):(Q=ae,J(Jf,w,w),J(Zf,Q,w),t1===null&&(t1=w)),Oa&&Ea(w,W.treeForkCount),S}return Ol(w),null;case 22:case 23:return Im(w),bD(w),W=w.memoizedState!==null,S!==null?S.memoizedState!==null!==W&&(w.flags|=8192):W&&(w.flags|=8192),W?(Q&536870912)!==0&&(w.flags&128)===0&&(Ol(w),w.subtreeFlags&6&&(w.flags|=8192)):Ol(w),Q=w.updateQueue,Q!==null&&Kc(w,Q.retryQueue),Q=null,S!==null&&S.memoizedState!==null&&S.memoizedState.cachePool!==null&&(Q=S.memoizedState.cachePool.pool),W=null,w.memoizedState!==null&&w.memoizedState.cachePool!==null&&(W=w.memoizedState.cachePool.pool),W!==Q&&(w.flags|=2048),S!==null&&K(ZF,w),null;case 24:return Q=null,S!==null&&(Q=S.memoizedState.cache),w.memoizedState.cache!==Q&&(w.flags|=2048),R2(x_,w),Ol(w),null;case 25:return null;case 30:return w.flags|=33554432,Ol(w),null}throw Error("Unknown unit of work tag ("+w.tag+"). This error is likely caused by a bug in React. Please file an issue.")}function uW(S,w){switch(Cg(w),w.tag){case 1:return S=w.flags,S&65536?(w.flags=S&-65537|128,(w.mode&za)!==gs&&Ff(w),w):null;case 3:return R2(x_,w),ne(w),S=w.flags,(S&65536)!==0&&(S&128)===0?(w.flags=S&-65537|128,w):null;case 26:case 27:case 5:return te(w),null;case 31:if(w.memoizedState!==null){if(Im(w),w.alternate===null)throw Error("Threw in newly mounted dehydrated component. This is likely a bug in React. Please file an issue.");TC()}return S=w.flags,S&65536?(w.flags=S&-65537|128,(w.mode&za)!==gs&&Ff(w),w):null;case 13:if(Im(w),S=w.memoizedState,S!==null&&S.dehydrated!==null){if(w.alternate===null)throw Error("Threw in newly mounted dehydrated component. This is likely a bug in React. Please file an issue.");TC()}return S=w.flags,S&65536?(w.flags=S&-65537|128,(w.mode&za)!==gs&&Ff(w),w):null;case 19:return vD(w),S=w.flags,S&65536?(w.flags=S&-65537|128,S=w.memoizedState,S!==null&&(S.rendering=null,S.tail=null),w.flags|=4,w):null;case 4:return ne(w),null;case 10:return R2(w.type,w),null;case 22:case 23:return Im(w),bD(w),S!==null&&K(ZF,w),S=w.flags,S&65536?(w.flags=S&-65537|128,(w.mode&za)!==gs&&Ff(w),w):null;case 24:return R2(x_,w),null;case 25:return null;default:return null}}function NI(S,w){switch(Cg(w),w.tag){case 3:R2(x_,w),ne(w);break;case 26:case 27:case 5:te(w);break;case 4:ne(w);break;case 31:w.memoizedState!==null&&Im(w);break;case 13:Im(w);break;case 19:vD(w);break;case 10:R2(w.type,w);break;case 22:case 23:Im(w),bD(w),S!==null&&K(ZF,w);break;case 24:R2(x_,w)}}function Ox(S){return(S.mode&za)!==gs}function dh(S,w){Ox(S)?(Hf(),bM(w,S),iy()):bM(w,S)}function cF(S,w,Q){Ox(S)?(Hf(),RI(Q,S,w),iy()):RI(Q,S,w)}function bM(S,w){try{var Q=w.updateQueue,W=Q!==null?Q.lastEffect:null;if(W!==null){var oe=W.next;Q=oe;do{if((Q.tag&S)===S&&(W=void 0,(S&My)!==rre&&(_X=!0),W=ye(w,Jxo,Q),(S&My)!==rre&&(_X=!1),W!==void 0&&typeof W!=="function")){var ae=void 0;ae=(Q.tag&n3)!==0?"useLayoutEffect":(Q.tag&My)!==0?"useInsertionEffect":"useEffect";var De=void 0;De=W===null?" You returned null. If your effect does not require clean up, return undefined (or nothing).":typeof W.then==="function"?`

It looks like you wrote `+ae+`(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:

`+ae+`(() => {
  async function fetchData() {
    // You can await here
    const response = await MyAPI.getData(someId);
    // ...
  }
  fetchData();
}, [someId]); // Or [] if effect doesn't need props or state

Learn more about data fetching with Hooks: https://react.dev/link/hooks-data-fetching`:" You returned: "+W,ye(w,function(Qe,ot){console.error("%s must not return anything besides a function, which is used for clean-up.%s",Qe,ot)},ae,De)}Q=Q.next}while(Q!==oe)}}catch(Qe){qc(w,w.return,Qe)}}function RI(S,w,Q){try{var W=w.updateQueue,oe=W!==null?W.lastEffect:null;if(oe!==null){var ae=oe.next;W=ae;do{if((W.tag&S)===S){var De=W.inst,Qe=De.destroy;Qe!==void 0&&(De.destroy=void 0,(S&My)!==rre&&(_X=!0),oe=w,ye(oe,Zxo,oe,Q,Qe),(S&My)!==rre&&(_X=!1))}W=W.next}while(W!==ae)}}catch(ot){qc(w,w.return,ot)}}function nN(S,w){Ox(S)?(Hf(),bM(w,S),iy()):bM(w,S)}function F2(S,w,Q){Ox(S)?(Hf(),RI(Q,S,w),iy()):RI(Q,S,w)}function Yf(S){var w=S.updateQueue;if(w!==null){var Q=S.stateNode;S.type.defaultProps||"ref"in S.memoizedProps||cX||(Q.props!==S.memoizedProps&&console.error("Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",Y(S)||"instance"),Q.state!==S.memoizedState&&console.error("Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",Y(S)||"instance"));try{ye(S,fI,w,Q)}catch(W){qc(S,S.return,W)}}}function pW(S,w,Q){return S.getSnapshotBeforeUpdate(w,Q)}function goe(S,w){var Q=w.memoizedProps,W=w.memoizedState;w=S.stateNode,S.type.defaultProps||"ref"in S.memoizedProps||cX||(w.props!==S.memoizedProps&&console.error("Expected %s props to match memoized props before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",Y(S)||"instance"),w.state!==S.memoizedState&&console.error("Expected %s state to match memoized state before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",Y(S)||"instance"));try{var oe=wI(S.type,Q),ae=ye(S,pW,w,oe,W);Q=G1t,ae!==void 0||Q.has(S.type)||(Q.add(S.type),ye(S,function(){console.error("%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.",Y(S))})),w.__reactInternalSnapshotBeforeUpdate=ae}catch(De){qc(S,S.return,De)}}function mW(S,w,Q){Q.props=wI(S.type,S.memoizedProps),Q.state=S.memoizedState,Ox(S)?(Hf(),ye(S,c1t,S,w,Q),iy()):ye(S,c1t,S,w,Q)}function QI(S){var w=S.ref;if(w!==null){switch(S.tag){case 26:case 27:case 5:var Q=S.stateNode;break;case 30:Q=S.stateNode;var W=bm(S.memoizedProps,Q);if(Q.ref===null||Q.ref.name!==W)Q.ref=PA(W);Q=Q.ref;break;case 7:S.stateNode===null&&(Q=new $h(S),I(S,m7,Q),S.stateNode=Q),Q=S.stateNode;break;default:Q=S.stateNode}if(typeof w==="function")if(Ox(S))try{Hf(),S.refCleanup=w(Q)}finally{iy()}else S.refCleanup=w(Q);else typeof w==="string"?console.error("String refs are no longer supported."):w.hasOwnProperty("current")||console.error("Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().",Y(S)),w.current=Q}}function ql(S,w){try{ye(S,QI,S)}catch(Q){qc(S,w,Q)}}function $c(S,w){var Q=S.ref,W=S.refCleanup;if(Q!==null)if(typeof W==="function")try{if(Ox(S))try{Hf(),ye(S,W)}finally{iy(S)}else ye(S,W)}catch(oe){qc(S,w,oe)}finally{S.refCleanup=null,S=S.alternate,S!=null&&(S.refCleanup=null)}else if(typeof Q==="function")try{if(Ox(S))try{Hf(),ye(S,Q,null)}finally{iy(S)}else ye(S,Q,null)}catch(oe){qc(S,w,oe)}else Q.current=null}function c0(S,w,Q,W){var oe=S.memoizedProps,ae=oe.id,De=oe.onCommit;oe=oe.onRender,w=w===null?"mount":"update",oge&&(w="nested-update"),typeof oe==="function"&&oe(ae,w,S.actualDuration,S.treeBaseDuration,S.actualStartTime,Q),typeof De==="function"&&De(ae,w,W,Q)}function Sg(S,w,Q,W){var oe=S.memoizedProps;S=oe.id,oe=oe.onPostCommit,w=w===null?"mount":"update",oge&&(w="nested-update"),typeof oe==="function"&&oe(S,w,W,Q)}function oN(S,w){if((S.tag===5||S.tag===27||S.tag===6)&&S.alternate===null&&w!==null)for(var Q=0;Q<w.length;Q++)o9(S.stateNode,w[Q])}function lF(S){for(var w=S.return;w!==null;){if(hF(w)&&o9(S.stateNode,w.stateNode),py(w))break;w=w.return}}function yu(S){for(var w=S.return;w!==null;){if(hF(w)&&BW(S.stateNode,w.stateNode),py(w))break;w=w.return}}function py(S){return S.tag===5||S.tag===3||S.tag===27}function hF(S){return S&&S.tag===7&&S.stateNode!==null}function dF(S){var{type:w,memoizedProps:Q,stateNode:W}=S;try{ye(S,DF,W,w,Q,S)}catch(oe){qc(S,S.return,oe)}}function uF(S,w,Q){try{ye(S,yN,S.stateNode,S.type,Q,w,S)}catch(W){qc(S,S.return,W)}}function rN(S){return S.tag===5||S.tag===3||S.tag===26||S.tag===27&&Xx(S.type)||S.tag===4}function z8(S){e:for(;;){for(;S.sibling===null;){if(S.return===null||rN(S.return))return null;S=S.return}S.sibling.return=S.return;for(S=S.sibling;S.tag!==5&&S.tag!==6&&S.tag!==18;){if(S.tag===27&&Xx(S.type))continue e;if(S.flags&2)continue e;if(S.child===null||S.tag===4)continue e;else S.child.return=S,S=S.child}if(!(S.flags&2))return S.stateNode}}function iN(S,w,Q,W){var oe=S.tag;if(oe===5||oe===6)oe=S.stateNode,w?(s7(Q),(Q.nodeType===9?Q.body:Q.nodeName==="HTML"?Q.ownerDocument.body:Q).insertBefore(oe,w)):(s7(Q),w=Q.nodeType===9?Q.body:Q.nodeName==="HTML"?Q.ownerDocument.body:Q,w.appendChild(oe),oe=Q._reactRootContainer,oe!==null&&oe!==void 0||w.onclick!==null||(w.onclick=Gd)),oN(S,W),Zc=!0;else if(oe!==4&&(oe===27&&(oN(S,W),W=null,Xx(S.type)&&(Q=S.stateNode,w=null)),S=S.child,S!==null))for(iN(S,w,Q,W),S=S.sibling;S!==null;)iN(S,w,Q,W),S=S.sibling}function O8(S,w,Q,W){var oe=S.tag;if(oe===5||oe===6)oe=S.stateNode,w?Q.insertBefore(oe,w):Q.appendChild(oe),oN(S,W),Zc=!0;else if(oe!==4&&(oe===27&&(oN(S,W),W=null,Xx(S.type)&&(Q=S.stateNode)),S=S.child,S!==null))for(O8(S,w,Q,W),S=S.sibling;S!==null;)O8(S,w,Q,W),S=S.sibling}function _W(S){for(var w,Q=S.return;Q!==null;){if(rN(Q)){w=Q;break}Q=Q.return}Q=null;for(var W=S.return;W!==null;){if(hF(W)){var oe=W.stateNode;Q===null?Q=[oe]:Q.push(oe)}if(py(W))break;W=W.return}if(w==null)throw Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");switch(w.tag){case 27:w=w.stateNode,W=z8(S),O8(S,W,w,Q);break;case 5:W=w.stateNode,w.flags&32&&(ZI(W),w.flags&=-33),w=z8(S),O8(S,w,W,Q);break;case 3:case 4:w=w.stateNode.containerInfo,W=z8(S),iN(S,W,w,Q);break;default:throw Error("Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue.")}}function kI(S){var{stateNode:w,memoizedProps:Q}=S;try{ye(S,HM,S.type,Q,w,S)}catch(W){qc(S,S.return,W)}}function WC(S){if(S.tag===30||(S.subtreeFlags&33554432)!==0)mge=!0}function z2(){var S=Q7;return Q7=null,S}function _p(S,w,Q,W,oe){return Jx=0,(w=XC(S.child,w,Q,W,oe))&&S._debugTask!=null&&qx===null&&(qx=S._debugTask),w}function XC(S,w,Q,W,oe){for(var ae=!1;S!==null;){if(S.tag===5){var De=S.stateNode;if(W!==null){var Qe=d7(De);W.push(Qe),Qe.view&&(ae=!0)}else ae||d7(De).view&&(ae=!0);mge=!0,n9(De,Jx===0?w:w+"_"+Jx,Q),Jx++}else if(S.tag!==22||S.memoizedState===null)S.tag===30&&oe||XC(S.child,w,Q,W,oe)&&(ae=!0);S=S.sibling}return ae}function fd(S,w){for(;S!==null;){if(S.tag===5)V4(S.stateNode,S.memoizedProps);else if(S.tag!==22||S.memoizedState===null)S.tag===30&&w||fd(S.child,w);S=S.sibling}}function jd(S){if((S.subtreeFlags&18874368)!==0)for(S=S.child;S!==null;){if(S.tag!==22||S.memoizedState===null){if(jd(S),S.tag===30&&(S.flags&18874368)!==0&&S.stateNode.paired){var w=S.memoizedProps;if(w.name==null||w.name==="auto")throw Error("Found a pair with an auto name. This is a bug in React.");var Q=w.name;w=l_(w.default,w.share),w!=="none"&&(_p(S,Q,w,null,!1)||fd(S.child,!1))}}S=S.sibling}}function Gf(S,w){if(S.tag===30){var Q=S.stateNode,W=S.memoizedProps,oe=bm(W,Q),ae=l_(W.default,Q.paired?W.share:W.enter);ae!=="none"?_p(S,oe,ae,null,!1)?(jd(S),Q.paired||w||YI(S,W.onEnter)):fd(S.child,!1):jd(S)}else if((S.subtreeFlags&33554432)!==0)for(S=S.child;S!==null;)Gf(S,w),S=S.sibling;else jd(S)}function Uf(S){if(o3!==null&&o3.size!==0){var w=o3;if((S.subtreeFlags&18874368)!==0)for(S=S.child;S!==null;){if(S.tag!==22||S.memoizedState===null){if(S.tag===30&&(S.flags&18874368)!==0){var Q=S.memoizedProps,W=Q.name;if(W!=null&&W!=="auto"){var oe=w.get(W);if(oe!==void 0){var ae=l_(Q.default,Q.share);if(ae!=="none"&&(_p(S,W,ae,null,!1)?(ae=S.stateNode,oe.paired=ae,ae.paired=oe,YI(S,Q.onShare)):fd(S.child,!1)),w.delete(W),w.size===0)break}}}Uf(S)}S=S.sibling}}}function xu(S){if(S.tag===30){var w=S.memoizedProps,Q=bm(w,S.stateNode),W=o3!==null?o3.get(Q):void 0,oe=l_(w.default,W!==void 0?w.share:w.exit);oe!=="none"&&(_p(S,Q,oe,null,!1)?W!==void 0?(oe=S.stateNode,W.paired=oe,oe.paired=W,o3.delete(Q),YI(S,w.onShare)):YI(S,w.onExit):fd(S.child,!1)),o3!==null&&Uf(S)}else if((S.subtreeFlags&33554432)!==0)for(S=S.child;S!==null;)xu(S),S=S.sibling;else o3!==null&&Uf(S)}function Sm(S){for(S=S.child;S!==null;){if(S.tag===30){var w=S.memoizedProps,Q=bm(w,S.stateNode);w=l_(w.default,w.update),S.flags&=-5,w!=="none"&&_p(S,Q,w,S.memoizedState=[],!1)}else(S.subtreeFlags&33554432)!==0&&Sm(S);S=S.sibling}}function vA(S){if((S.subtreeFlags&18874368)!==0)for(S=S.child;S!==null;){if(S.tag!==22||S.memoizedState===null){if(S.tag===30&&(S.flags&18874368)!==0){var w=S.stateNode;w.paired!==null&&(w.paired=null,fd(S.child,!1))}vA(S)}S=S.sibling}}function uh(S){if(S.tag===30)S.stateNode.paired=null,fd(S.child,!1),vA(S);else if((S.subtreeFlags&33554432)!==0)for(S=S.child;S!==null;)uh(S),S=S.sibling;else vA(S)}function gW(S){for(S=S.child;S!==null;)S.tag===30?fd(S.child,!1):(S.subtreeFlags&33554432)!==0&&gW(S),S=S.sibling}function V8(S,w,Q,W,oe,ae,De){for(var Qe=!1;w!==null;){if(w.tag===5){var ot=w.stateNode;if(ae!==null&&Jx<ae.length){var _t=ae[Jx],Yt=d7(ot);if(_t.view||Yt.view)Qe=!0;var rn;if(rn=(S.flags&4)===0)if(Yt.clip)rn=!0;else{rn=_t.rect;var on=Yt.rect;rn=rn.y!==on.y||rn.x!==on.x||rn.height!==on.height||rn.width!==on.width}rn&&(S.flags|=4),Yt.abs?Yt=!_t.abs:(_t=_t.rect,Yt=Yt.rect,Yt=_t.height!==Yt.height||_t.width!==Yt.width),Yt&&(S.flags|=32)}else S.flags|=32;(S.flags&4)!==0&&n9(ot,Jx===0?Q:Q+"_"+Jx,oe),Qe&&(S.flags&4)!==0||(Q7===null&&(Q7=[]),Q7.push(ot,Jx===0?W:W+"_"+Jx,w.memoizedProps)),Jx++}else if(w.tag!==22||w.memoizedState===null)w.tag===30&&De?S.flags|=w.flags&32:V8(S,w.child,Q,W,oe,ae,De)&&(Qe=!0);w=w.sibling}return Qe}function jC(S,w){for(S=S.child;S!==null;){if(S.tag===30){var Q=S.memoizedProps,W=S.stateNode,oe=bm(Q,W),ae=l_(Q.default,Q.update);if(w){W=W.clones;var De=W===null?null:W.map(u7)}else De=S.memoizedState,S.memoizedState=null;W=S;var Qe=S.child,ot=oe;Jx=0,ae=V8(W,Qe,ot,oe,ae,De,!1),(S.flags&4)!==0&&ae&&(w||YI(S,Q.onUpdate))}else(S.subtreeFlags&33554432)!==0&&jC(S,w);S=S.sibling}}function AW(S){var w=S.memoizedProps.name;if(w!=null&&w!=="auto"){var Q=_ge.get(w);if(Q!==void 0){if(Q!==S&&Q!==S.alternate&&!U1t[w]){U1t[w]=!0;var W=JSON.stringify(w);ye(S,function(){console.error("There are two <ViewTransition name=%s> components with the same name mounted at the same time. This is not supported and will cause View Transitions to error. Try to use a more unique name e.g. by using a namespace prefix and adding the id of an item to the name.",W)}),ye(Q,function(){console.error("The existing <ViewTransition name=%s> duplicate has this stack trace.",W)})}}else _ge.set(w,S)}}function IM(S){var w=S.memoizedProps.name;if(w!=null&&w!=="auto"){var Q=_ge.get(w);Q===void 0||Q!==S&&Q!==S.alternate||_ge.delete(w)}}function fW(S,w){return w.tag===31?(w=w.memoizedState,S.memoizedState!==null&&w===null):w.tag===13?(S=S.memoizedState,w=w.memoizedState,S!==null&&S.dehydrated!==null&&(w===null||w.dehydrated===null)):w.tag===3?S.memoizedState.isDehydrated&&(w.flags&256)===0:!1}function Vx(S,w,Q){if(S=S.containerInfo,ARe=bX,S=f8(S),yg(S)){if("selectionStart"in S)var W={start:S.selectionStart,end:S.selectionEnd};else e:{W=(W=S.ownerDocument)&&W.defaultView||window;var oe=W.getSelection&&W.getSelection();if(oe&&oe.rangeCount!==0){W=oe.anchorNode;var ae=oe.anchorOffset,De=oe.focusNode;oe=oe.focusOffset;try{W.nodeType,De.nodeType}catch(Sr){W=null;break e}var Qe=0,ot=-1,_t=-1,Yt=0,rn=0,on=S,Cn=null;t:for(;;){for(var Po;;){if(on!==W||ae!==0&&on.nodeType!==3||(ot=Qe+ae),on!==De||oe!==0&&on.nodeType!==3||(_t=Qe+oe),on.nodeType===3&&(Qe+=on.nodeValue.length),(Po=on.firstChild)===null)break;Cn=on,on=Po}for(;;){if(on===S)break t;if(Cn===W&&++Yt===ae&&(ot=Qe),Cn===De&&++rn===oe&&(_t=Qe),(Po=on.nextSibling)!==null)break;on=Cn,Cn=on.parentNode}on=Po}W=ot===-1||_t===-1?null:{start:ot,end:_t}}else W=null}W=W||{start:0,end:0}}else W=null;fRe={focusedElem:S,selectionRange:W},bX=!1,Q=(Q&335544064)===Q,kA=w;for(w=Q?9270:1024;kA!==null;){if(S=kA,Q&&(W=S.deletions,W!==null))for(ae=0;ae<W.length;ae++)Q&&xu(W[ae]);if(S.alternate===null&&(S.flags&2)!==0)Q&&WC(S),KC(Q);else{if(S.tag===22){if(W=S.alternate,S.memoizedState!==null){W!==null&&W.memoizedState===null&&Q&&xu(W),KC(Q);continue}else if(W!==null&&W.memoizedState!==null){Q&&WC(S),KC(Q);continue}}W=S.child,(S.subtreeFlags&w)!==0&&W!==null?(W.return=S,kA=W):(Q&&Sm(S),KC(Q))}}o3=null}function KC(S){for(;kA!==null;){var w=kA,Q=w,W=S,oe=Q.alternate,ae=Q.flags;switch(Q.tag){case 0:case 11:case 15:break;case 1:(ae&1024)!==0&&oe!==null&&goe(Q,oe);break;case 3:if((ae&1024)!==0){if(W=Q.stateNode.containerInfo,Q=W.nodeType,Q===9)IN(W);else if(Q===1)switch(W.nodeName){case"HEAD":case"HTML":case"BODY":IN(W);break;default:W.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:W&&oe!==null&&(W=oe,oe=Q,Q=bm(W.memoizedProps,W.stateNode),oe=oe.memoizedProps,oe=l_(oe.default,oe.update),oe!=="none"&&_p(W,Q,oe,W.memoizedState=[],!0));break;default:if((ae&1024)!==0)throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.")}if(W=w.sibling,W!==null){W.return=w.return,kA=W;break}kA=w.return}}function pF(S,w,Q){var W=dp(),oe=L2(),ae=ry(),De=hh(),Qe=Q.flags;switch(Q.tag){case 0:case 11:case 15:V2(S,Q),Qe&4&&dh(Q,n3|Ib);break;case 1:if(V2(S,Q),Qe&4)if(S=Q.stateNode,w===null)Q.type.defaultProps||"ref"in Q.memoizedProps||cX||(S.props!==Q.memoizedProps&&console.error("Expected %s props to match memoized props before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",Y(Q)||"instance"),S.state!==Q.memoizedState&&console.error("Expected %s state to match memoized state before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",Y(Q)||"instance")),Ox(Q)?(Hf(),ye(Q,kNe,Q,S),iy()):ye(Q,kNe,Q,S);else{var ot=wI(Q.type,w.memoizedProps);w=w.memoizedState,Q.type.defaultProps||"ref"in Q.memoizedProps||cX||(S.props!==Q.memoizedProps&&console.error("Expected %s props to match memoized props before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",Y(Q)||"instance"),S.state!==Q.memoizedState&&console.error("Expected %s state to match memoized state before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",Y(Q)||"instance")),Ox(Q)?(Hf(),ye(Q,i1t,Q,S,ot,w,S.__reactInternalSnapshotBeforeUpdate),iy()):ye(Q,i1t,Q,S,ot,w,S.__reactInternalSnapshotBeforeUpdate)}Qe&64&&Yf(Q),Qe&512&&ql(Q,Q.return);break;case 3:if(w=k2(),V2(S,Q),Qe&64&&(Qe=Q.updateQueue,Qe!==null)){if(ot=null,Q.child!==null)switch(Q.child.tag){case 27:case 5:ot=Q.child.stateNode;break;case 1:ot=Q.child.stateNode}try{ye(Q,fI,Qe,ot)}catch(Yt){qc(Q,Q.return,Yt)}}S.effectDuration+=tM(w);break;case 27:w===null&&Qe&4&&kI(Q);case 26:case 5:if(V2(S,Q),w===null){if(Qe&4)dF(Q);else if(Qe&64){S=Q.type,w=Q.memoizedProps,ot=Q.stateNode;try{ye(Q,fN,ot,S,w,Q)}catch(Yt){qc(Q,Q.return,Yt)}}}Qe&512&&ql(Q,Q.return);break;case 12:if(Qe&4){Qe=k2(),V2(S,Q),S=Q.stateNode,S.effectDuration+=kf(Qe);try{ye(Q,c0,Q,w,$M,S.effectDuration)}catch(Yt){qc(Q,Q.return,Yt)}}else V2(S,Q);break;case 31:V2(S,Q),Qe&4&&xW(S,Q);break;case 13:V2(S,Q),Qe&4&&CW(S,Q),Qe&64&&(S=Q.memoizedState,S!==null&&(S=S.dehydrated,S!==null&&(Qe=Em.bind(null,Q),d0(S,Qe))));break;case 22:if(Qe=Q.memoizedState!==null||QA,!Qe){var _t=w!==null&&w.memoizedState!==null||Hh;w=QA,ot=Hh,QA=Qe,(Hh=_t)&&!ot?(Qe=gge,(Q.subtreeFlags&8772)!==0&&(Qe|=qNe),Pg(S,Q,Qe),(Q.mode&za)!==gs&&0<=Qi&&0<=rs&&0.05<rs-Qi&&BC(Q,Qi,rs)):V2(S,Q),QA=w,Hh=ot}break;case 30:Qe&18874368&&AW(Q),V2(S,Q),Qe&512&&ql(Q,Q.return);break;case 7:Qe&512&&ql(Q,Q.return);default:V2(S,Q)}(Q.mode&za)!==gs&&0<=Qi&&0<=rs&&((yp||0.05<V0)&&s0(Q,Qi,rs,V0,g0),Q.alternate===null&&Q.return!==null&&Q.return.alternate!==null&&0.05<rs-Qi&&(fW(Q.return.alternate,Q.return)||Nf(Q,Qi,rs,"Mount"))),h_(W),Lf(oe),g0=ae,yp=De}function LI(S,w){for(S=S.child;S!==null;)mF(S,w),S=S.sibling}function mF(S,w){switch(S.tag){case 5:case 26:try{var Q=S.stateNode;w?ye(S,K2,Q):ye(S,ib,S.stateNode,S.memoizedProps)}catch(ae){qc(S,S.return,ae)}_F(S,w);break;case 6:try{var W=S.stateNode;w?ye(S,c7,W):ye(S,O4,W,S.memoizedProps),Zc=!0}catch(ae){qc(S,S.return,ae)}break;case 18:try{var oe=S.stateNode;w?ye(S,wW,oe):ye(S,l7,S.stateNode)}catch(ae){qc(S,S.return,ae)}break;case 22:case 23:S.memoizedState===null&&LI(S,w);break;default:LI(S,w)}}function _F(S,w){if(S.subtreeFlags&67108864)for(S=S.child;S!==null;){e:{var Q=S,W=w;switch(Q.tag){case 4:mF(Q,W);break e;case 22:Q.memoizedState===null&&_F(Q,W);break e;default:_F(Q,W)}}S=S.sibling}}function yW(S){var w=S.alternate;w!==null&&(S.alternate=null,yW(w)),S.child=null,S.deletions=null,S.sibling=null,S.tag===5&&(w=S.stateNode,w!==null&&Wt(w)),S.stateNode=null,S._debugOwner=null,S.return=null,S.dependencies=null,S.memoizedProps=null,S.memoizedState=null,S.pendingProps=null,S.stateNode=null,S.updateQueue=null}function O2(S,w,Q){for(Q=Q.child;Q!==null;)gF(S,w,Q),Q=Q.sibling}function gF(S,w,Q){if(kh&&typeof kh.onCommitFiberUnmount==="function")try{kh.onCommitFiberUnmount(M7,Q)}catch(_t){BA||(BA=!0,console.error("React instrumentation encountered an error: %o",_t))}var W=dp(),oe=L2(),ae=ry(),De=hh();switch(Q.tag){case 26:Hh||$c(Q,w),O2(S,w,Q),Q.memoizedState?Q.memoizedState.count--:Q.stateNode&&!Hh&&(S=Q.stateNode,S.parentNode.removeChild(S));break;case 27:Hh||$c(Q,w),yu(Q);var Qe=b_,ot=Zx;Xx(Q.type)&&(b_=Q.stateNode,Zx=!1),O2(S,w,Q),ye(Q,g7,Q.stateNode,Q.type,Q.memoizedProps),b_=Qe,Zx=ot;break;case 5:Hh||$c(Q,w),yu(Q);case 6:if(Q.tag===6&&yu(Q),Qe=b_,ot=Zx,b_=null,O2(S,w,Q),b_=Qe,Zx=ot,b_!==null)if(Zx)try{ye(Q,a7,b_,Q.stateNode),Zc=!0}catch(_t){qc(Q,w,_t)}else try{ye(Q,e9,b_,Q.stateNode),Zc=!0}catch(_t){qc(Q,w,_t)}break;case 18:b_!==null&&(Zx?(S=b_,RF(S.nodeType===9?S.body:S.nodeName==="HTML"?S.ownerDocument.body:S,Q.stateNode),$d(S)):RF(b_,Q.stateNode));break;case 4:Qe=b_,ot=Zx,b_=Q.stateNode.containerInfo,Zx=!0,O2(S,w,Q),b_=Qe,Zx=ot;break;case 0:case 11:case 14:case 15:RI(My,Q,w),Hh||cF(Q,w,n3),O2(S,w,Q);break;case 1:Hh||($c(Q,w),Qe=Q.stateNode,typeof Qe.componentWillUnmount==="function"&&mW(Q,w,Qe)),O2(S,w,Q);break;case 21:O2(S,w,Q);break;case 22:Hh=(Qe=Hh)||Q.memoizedState!==null,O2(S,w,Q),Hh=Qe;break;case 30:Q.flags&18874368&&IM(Q),$c(Q,w),O2(S,w,Q);break;case 7:Hh||$c(Q,w),O2(S,w,Q);break;default:O2(S,w,Q)}(Q.mode&za)!==gs&&0<=Qi&&0<=rs&&(yp||0.05<V0)&&s0(Q,Qi,rs,V0,g0),h_(W),Lf(oe),g0=ae,yp=De}function xW(S,w){if(w.memoizedState===null&&(S=w.alternate,S!==null&&(S=S.memoizedState,S!==null))){S=S.dehydrated;try{ye(w,DW,S)}catch(Q){qc(w,w.return,Q)}}}function CW(S,w){if(w.memoizedState===null&&(S=w.alternate,S!==null&&(S=S.memoizedState,S!==null&&(S=S.dehydrated,S!==null))))try{ye(w,NW,S)}catch(Q){qc(w,w.return,Q)}}function qi(S){switch(S.tag){case 31:case 13:case 19:var w=S.stateNode;return w===null&&(w=S.stateNode=new W1t),w;case 22:return S=S.stateNode,w=S._retryCache,w===null&&(w=S._retryCache=new W1t),w;default:throw Error("Unexpected Suspense handler tag ("+S.tag+"). This is a bug in React.")}}function HI(S,w){var Q=qi(S);w.forEach(function(W){if(!Q.has(W)){if(Q.add(W),Z2)if(lX!==null&&hX!==null)Ux(hX,lX);else throw Error("Expected finished root and lanes to be set. This is a bug in React.");var oe=Cr.bind(null,S,W);W.then(oe,oe)}})}function gp(S,w,Q){var W=w.deletions;if(W!==null)for(var oe=0;oe<W.length;oe++){var ae=S,De=w,Qe=W[oe],ot=dp(),_t=De;e:for(;_t!==null;){switch(_t.tag){case 27:if(Xx(_t.type)){b_=_t.stateNode,Zx=!1;break e}break;case 5:b_=_t.stateNode,Zx=!1;break e;case 3:case 4:b_=_t.stateNode.containerInfo,Zx=!0;break e}_t=_t.return}if(b_===null)throw Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");gF(ae,De,Qe),b_=null,Zx=!1,(Qe.mode&za)!==gs&&0<=Qi&&0<=rs&&0.05<rs-Qi&&Nf(Qe,Qi,rs,"Unmount"),h_(ot),ae=Qe,De=ae.alternate,De!==null&&(De.return=null),ae.return=null}if(w.subtreeFlags&13886)for(w=w.child;w!==null;)$C(w,S,Q),w=w.sibling}function $C(S,w,Q){var W=dp(),oe=L2(),ae=ry(),De=hh(),{alternate:Qe,flags:ot}=S;switch(S.tag){case 0:case 11:case 14:case 15:if(ot&4&&(Qe=S.updateQueue,Qe=Qe!==null?Qe.events:null,Qe!==null))for(var _t=0;_t<Qe.length;_t++){var Yt=Qe[_t];Yt.ref.impl=Yt.nextImpl}gp(w,S,Q),p_(S),ot&4&&(RI(My|Ib,S,S.return),bM(My|Ib,S),cF(S,S.return,n3|Ib));break;case 1:gp(w,S,Q),p_(S),ot&512&&(Hh||Qe===null||$c(Qe,Qe.return)),ot&64&&QA&&(w=S.updateQueue,w!==null&&(Q=w.callbacks,Q!==null&&(ot=w.shared.hiddenCallbacks,w.shared.hiddenCallbacks=ot===null?Q:ot.concat(Q))));break;case 26:if(_t=b9,gp(w,S,Q),p_(S),ot&512&&(Hh||Qe===null||$c(Qe,Qe.return)),ot&4)if(ot=Qe!==null?Qe.memoizedState:null,Q=S.memoizedState,Qe===null)if(Q===null)if(S.stateNode===null)if(QA)S.stateNode=g_(S.type,S.memoizedProps,w.containerInfo,S);else{e:{w=S.type,Q=S.memoizedProps,ot=_t.ownerDocument||_t;t:switch(w){case"title":if(Qe=ot.getElementsByTagName("title")[0],!Qe||Qe[Kx]||Qe[_0]||Qe.namespaceURI===Te||Qe.hasAttribute("itemprop"))Qe=ot.createElement(w),ot.head.insertBefore(Qe,ot.querySelector("head > title"));Vp(Qe,w,Q),Qe[_0]=S,mn(Qe),w=Qe;break e;case"link":if(_t=Bt("link","href",ot).get(w+(Q.href||""))){for(Yt=0;Yt<_t.length;Yt++)if(Qe=_t[Yt],Qe.getAttribute("href")===(Q.href==null||Q.href===""?null:Q.href)&&Qe.getAttribute("rel")===(Q.rel==null?null:Q.rel)&&Qe.getAttribute("title")===(Q.title==null?null:Q.title)&&Qe.getAttribute("crossorigin")===(Q.crossOrigin==null?null:Q.crossOrigin)){_t.splice(Yt,1);break t}}Qe=ot.createElement(w),Vp(Qe,w,Q),ot.head.appendChild(Qe);break;case"meta":if(_t=Bt("meta","content",ot).get(w+(Q.content||""))){for(Yt=0;Yt<_t.length;Yt++)if(Qe=_t[Yt],dt(Q.content,"content"),Qe.getAttribute("content")===(Q.content==null?null:""+Q.content)&&Qe.getAttribute("name")===(Q.name==null?null:Q.name)&&Qe.getAttribute("property")===(Q.property==null?null:Q.property)&&Qe.getAttribute("http-equiv")===(Q.httpEquiv==null?null:Q.httpEquiv)&&Qe.getAttribute("charset")===(Q.charSet==null?null:Q.charSet)){_t.splice(Yt,1);break t}}Qe=ot.createElement(w),Vp(Qe,w,Q),ot.head.appendChild(Qe);break;default:throw Error('getNodesForType encountered a type it did not expect: "'+w+'". This is a bug in React.')}Qe[_0]=S,mn(Qe),w=Qe}S.stateNode=w}else QA||Rt(_t,S.type,S.stateNode);else S.stateNode=fe(_t,Q,S.memoizedProps);else ot!==Q?(ot===null?(w=Qe.stateNode,w===null||Hh||w.parentNode.removeChild(w)):ot.count--,Q===null?QA||Rt(_t,S.type,S.stateNode):fe(_t,Q,S.memoizedProps)):Q===null&&S.stateNode!==null&&uF(S,S.memoizedProps,Qe.memoizedProps);break;case 27:gp(w,S,Q),p_(S),ot&512&&(Hh||Qe===null||$c(Qe,Qe.return)),Qe!==null&&ot&4&&uF(S,S.memoizedProps,Qe.memoizedProps);break;case 5:if(_t=k7,k7=!1,gp(w,S,Q),k7=_t,p_(S),ot&512&&(Hh||Qe===null||$c(Qe,Qe.return)),S.flags&32){w=S.stateNode;try{ye(S,ZI,w),Zc=!0}catch(Po){qc(S,S.return,Po)}}ot&4&&S.stateNode!=null&&(w=S.memoizedProps,uF(S,w,Qe!==null?Qe.memoizedProps:w)),ot&1024&&(JNe=!0,S.type!=="form"&&console.error("Unexpected host component type. Expected a form. This is a bug in React."));break;case 6:if(gp(w,S,Q),p_(S),ot&4){if(S.stateNode===null)throw Error("This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue.");w=S.memoizedProps,Q=Qe!==null?Qe.memoizedProps:w,ot=S.stateNode;try{ye(S,NF,ot,Q,w),Zc=!0}catch(Po){qc(S,S.return,Po)}}break;case 3:if(_t=k2(),Zc=!1,zge=null,Yt=b9,b9=i9(w.containerInfo),gp(w,S,Q),b9=Yt,p_(S),ot&4&&Qe!==null&&Qe.memoizedState.isDehydrated)try{ye(S,jx,w.containerInfo)}catch(Po){qc(S,S.return,Po)}JNe&&(JNe=!1,sN(S)),w.effectDuration+=tM(_t),Zc=!1;break;case 4:ot=k7,k7=QA,Qe=gt(),_t=b9,b9=i9(S.stateNode.containerInfo),gp(w,S,Q),p_(S),b9=_t,Zc&&cre&&(Age=!0),Zc=Qe,k7=ot;break;case 12:ot=k2(),gp(w,S,Q),p_(S),S.stateNode.effectDuration+=kf(ot);break;case 31:gp(w,S,Q),p_(S),ot&4&&(w=S.updateQueue,w!==null&&(S.updateQueue=null,HI(S,w)));break;case 13:gp(w,S,Q),p_(S),S.child.flags&8192&&S.memoizedState!==null!==(Qe!==null&&Qe.memoizedState!==null)&&(Ige=es()),ot&4&&(w=S.updateQueue,w!==null&&(S.updateQueue=null,HI(S,w)));break;case 22:_t=S.memoizedState!==null,Yt=Qe!==null&&Qe.memoizedState!==null;var rn=QA,on=Hh,Cn=k7;QA=rn||_t,k7=Cn||_t,Hh=on||Yt,gp(w,S,Q),Hh=on,k7=Cn,QA=rn,Yt&&!_t&&!rn&&!on&&(S.mode&za)!==gs&&0<=Qi&&0<=rs&&0.05<rs-Qi&&BC(S,Qi,rs),p_(S),ot&8192&&(w=S.stateNode,w._visibility=_t?w._visibility&~zoe:w._visibility|zoe,!_t||Qe===null||Yt||QA||Hh||(w=gge,Q=Yt||Hh,Qe=QA,Yt=Hh,QA=_t||QA,Hh=Q,_y(S,w),(S.mode&za)!==gs&&0<=Qi&&0<=rs&&0.05<rs-Qi&&Nf(S,Qi,rs,"Disconnect"),QA=Qe,Hh=Yt),!_t&&k7||LI(S,_t)),ot&4&&(w=S.updateQueue,w!==null&&(Q=w.retryQueue,Q!==null&&(w.retryQueue=null,HI(S,Q))));break;case 19:gp(w,S,Q),p_(S),ot&4&&(w=S.updateQueue,w!==null&&(S.updateQueue=null,HI(S,w)));break;case 30:ot&512&&(Hh||Qe===null||$c(Qe,Qe.return)),ot=gt(),_t=cre,Yt=(Q&335544064)===Q,rn=S.memoizedProps,cre=Yt&&l_(rn.default,rn.update)!=="none",gp(w,S,Q),p_(S),Yt&&Qe!==null&&Zc&&(S.flags|=4),cre=_t,Zc=ot;break;case 21:break;case 7:ot&512&&(Hh||Qe===null||$c(Qe,Qe.return)),Qe&&Qe.stateNode!==null&&(Qe.stateNode._fragmentFiber=S);default:gp(w,S,Q),p_(S)}(S.mode&za)!==gs&&0<=Qi&&0<=rs&&((yp||0.05<V0)&&s0(S,Qi,rs,V0,g0),S.alternate===null&&S.return!==null&&S.return.alternate!==null&&0.05<rs-Qi&&(fW(S.return.alternate,S.return)||Nf(S,Qi,rs,"Mount"))),h_(W),Lf(oe),g0=ae,yp=De}function p_(S){var w=S.flags;if(w&2){try{ye(S,_W,S)}catch(Q){qc(S,S.return,Q)}S.flags&=-3}w&4096&&(S.flags&=-4097)}function sN(S){if(S.subtreeFlags&1024)for(S=S.child;S!==null;){var w=S;sN(w),w.tag===5&&w.flags&1024&&(w=w.stateNode,bX=!0,w.reset(),bX=!1),S=S.sibling}}function my(S,w){if(w.subtreeFlags&9270)for(w=w.child;w!==null;)FI(w,S),w=w.sibling;else jC(w,!1)}function FI(S,w){var Q=S.alternate;if(Q===null)Gf(S,!1);else switch(S.tag){case 3:if(ZNe=L7=!1,z2(),my(w,S),!L7&&!Age){if(S=Q7,S!==null)for(var W=0;W<S.length;W+=3){Q=S[W];var oe=S[W+1];V4(Q,S[W+2]),Q=Q.ownerDocument.documentElement,Q!==null&&Q.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+oe+")"})}S=w.containerInfo,S=S.nodeType===9?S.documentElement:S.ownerDocument.documentElement,S!==null&&S.style.viewTransitionName===""&&(S.style.viewTransitionName="none",S.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),S.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),ZNe=!0}Q7=null;break;case 5:my(w,S);break;case 4:W=L7,L7=!1,my(w,S),L7&&(Age=!0),L7=W;break;case 22:S.memoizedState===null&&(Q.memoizedState!==null?Gf(S,!1):my(w,S));break;case 30:W=L7,oe=z2(),L7=!1,my(w,S),L7&&(S.flags|=4);var ae=S.memoizedProps,De=S.stateNode;w=bm(ae,De),De=bm(Q.memoizedProps,De);var Qe=l_(ae.default,ae.update);Qe==="none"?w=!1:(ae=Q.memoizedState,Q.memoizedState=null,Q=S.child,Jx=0,w=V8(S,Q,w,De,Qe,ae,!0),Jx!==(ae===null?0:ae.length)&&(S.flags|=32)),(S.flags&4)!==0&&w?(YI(S,S.memoizedProps.onUpdate),Q7=oe):oe!==null&&(oe.push.apply(oe,Q7),Q7=oe),L7=(S.flags&32)!==0?!0:W;break;default:my(w,S)}}function V2(S,w){if(w.subtreeFlags&8772)for(w=w.child;w!==null;)pF(S,w.alternate,w),w=w.sibling}function bW(S,w){var Q=dp(),W=L2(),oe=ry(),ae=hh();switch(S.tag){case 0:case 11:case 14:case 15:cF(S,S.return,n3),_y(S,w);break;case 1:$c(S,S.return);var De=S.stateNode;typeof De.componentWillUnmount==="function"&&mW(S,S.return,De),_y(S,w);break;case 27:(w&gge)!==are&&ye(S,g7,S.stateNode,S.type,S.memoizedProps);case 5:$c(S,S.return),S.tag!==5&&S.tag!==27||yu(S),_y(S,w);break;case 6:yu(S);break;case 26:$c(S,S.return),De=S.stateNode,S.memoizedState!==null||De===null||Hh||De.parentNode.removeChild(De),_y(S,w);break;case 22:S.memoizedState===null&&_y(S,w);break;case 30:S.flags&18874368&&IM(S),$c(S,S.return),_y(S,w);break;case 7:$c(S,S.return);default:_y(S,w)}(S.mode&za)!==gs&&0<=Qi&&0<=rs&&(yp||0.05<V0)&&s0(S,Qi,rs,V0,g0),h_(Q),Lf(W),g0=oe,yp=ae}function _y(S,w){for(S=S.child;S!==null;)bW(S,w),S=S.sibling}function IW(S,w,Q,W){var oe=dp(),ae=L2(),De=ry(),Qe=hh(),ot=Q.flags,_t=(W&qNe)!==are;switch(Q.tag){case 0:case 11:case 15:Pg(S,Q,W),dh(Q,n3);break;case 1:if(Pg(S,Q,W),w=Q.stateNode,typeof w.componentDidMount==="function"&&ye(Q,kNe,Q,w),w=Q.updateQueue,w!==null){S=Q.stateNode;try{ye(Q,hM,w,S)}catch(rn){qc(Q,Q.return,rn)}}_t&&ot&64&&Yf(Q),ql(Q,Q.return);break;case 27:(W&gge)!==are&&kI(Q);case 5:Q.tag!==5&&Q.tag!==27||lF(Q),Pg(S,Q,W),_t&&w===null&&ot&4&&dF(Q),ql(Q,Q.return);break;case 6:lF(Q);break;case 26:var Yt=Q.stateNode;Q.memoizedState!==null||Yt===null||QA||Rt(i9(Yt.ownerDocument),Q.type,Yt),Pg(S,Q,W),_t&&w===null&&ot&4&&dF(Q),ql(Q,Q.return);break;case 12:if(_t&&ot&4){ot=k2(),Pg(S,Q,W),_t=Q.stateNode,_t.effectDuration+=kf(ot);try{ye(Q,c0,Q,w,$M,_t.effectDuration)}catch(rn){qc(Q,Q.return,rn)}}else Pg(S,Q,W);break;case 31:Pg(S,Q,W),_t&&ot&4&&xW(S,Q);break;case 13:Pg(S,Q,W),_t&&ot&4&&CW(S,Q);break;case 22:Q.memoizedState===null&&Pg(S,Q,W),ql(Q,Q.return);break;case 30:Pg(S,Q,W),ot&18874368&&AW(Q),ql(Q,Q.return);break;case 7:ql(Q,Q.return);default:Pg(S,Q,W)}(Q.mode&za)!==gs&&0<=Qi&&0<=rs&&(yp||0.05<V0)&&s0(Q,Qi,rs,V0,g0),h_(oe),Lf(ae),g0=De,yp=Qe}function Pg(S,w,Q){Q=(w.subtreeFlags&8772)!==0?Q:Q&~qNe;for(w=w.child;w!==null;)IW(S,w.alternate,w,Q),w=w.sibling}function Y8(S,w){var Q=null;S!==null&&S.memoizedState!==null&&S.memoizedState.cachePool!==null&&(Q=S.memoizedState.cachePool.pool),S=null,w.memoizedState!==null&&w.memoizedState.cachePool!==null&&(S=w.memoizedState.cachePool.pool),S!==Q&&(S!=null&&T4(S),Q!=null&&Q2(Q))}function G8(S,w){S=null,w.alternate!==null&&(S=w.alternate.memoizedState.cache),w=w.memoizedState.cache,w!==S&&(T4(w),S!=null&&Q2(S))}function Y2(S,w,Q,W,oe){var ae=(Q&335544064)===Q;if(w.subtreeFlags&(ae?10262:10256)||w.actualDuration!==0&&(w.alternate===null||w.alternate.child!==w.child))for(w=w.child;w!==null;)ae=w.sibling,vM(S,w,Q,W,ae!==null?ae.actualStartTime:oe),w=ae;else ae&&gW(w)}function vM(S,w,Q,W,oe){var ae=dp(),De=L2(),Qe=ry(),ot=hh(),_t=HN,Yt=(Q&335544064)===Q;Yt&&w.alternate===null&&w.return!==null&&w.return.alternate!==null&&uh(w);var rn=w.flags;switch(w.tag){case 0:case 11:case 15:(w.mode&za)!==gs&&0<w.actualStartTime&&(w.flags&1)!==0&&ty(w,w.actualStartTime,oe,Ng,Q),Y2(S,w,Q,W,oe),rn&2048&&nN(w,n1|Ib);break;case 1:(w.mode&za)!==gs&&0<w.actualStartTime&&((w.flags&128)!==0?ny(w,w.actualStartTime,oe,[]):(w.flags&1)!==0&&ty(w,w.actualStartTime,oe,Ng,Q)),Y2(S,w,Q,W,oe);break;case 3:var on=k2(),Cn=Ng;Ng=w.alternate!==null&&w.alternate.memoizedState.isDehydrated&&(w.flags&256)===0,Y2(S,w,Q,W,oe),Ng=Cn,Yt&&ZNe&&(Q=S.containerInfo,Q=Q.nodeType===9?Q.body:Q.nodeName==="HTML"?Q.ownerDocument.body:Q,Q.style.viewTransitionName==="root"&&(Q.style.viewTransitionName=""),Q=Q.ownerDocument.documentElement,Q!==null&&Q.style.viewTransitionName==="none"&&(Q.style.viewTransitionName="")),rn&2048&&(Q=null,w.alternate!==null&&(Q=w.alternate.memoizedState.cache),W=w.memoizedState.cache,W!==Q&&(T4(W),Q!=null&&Q2(Q))),S.passiveEffectDuration+=tM(on);break;case 12:if(rn&2048){rn=k2(),Y2(S,w,Q,W,oe),S=w.stateNode,S.passiveEffectDuration+=kf(rn);try{ye(w,Sg,w,w.alternate,$M,S.passiveEffectDuration)}catch(Po){qc(w,w.return,Po)}}else Y2(S,w,Q,W,oe);break;case 31:rn=Ng,on=w.alternate!==null?w.alternate.memoizedState:null,Yt=w.memoizedState,on!==null&&Yt===null?(Yt=w.deletions,Yt!==null&&0<Yt.length&&Yt[0].tag===18?(Ng=!1,on=on.hydrationErrors,on!==null&&ny(w,w.actualStartTime,oe,on)):Ng=!0):Ng=!1,Y2(S,w,Q,W,oe),Ng=rn;break;case 13:rn=Ng,on=w.alternate!==null?w.alternate.memoizedState:null,Yt=w.memoizedState,on===null||on.dehydrated===null||Yt!==null&&Yt.dehydrated!==null?Ng=!1:(Yt=w.deletions,Yt!==null&&0<Yt.length&&Yt[0].tag===18?(Ng=!1,on=on.hydrationErrors,on!==null&&ny(w,w.actualStartTime,oe,on)):Ng=!0),Y2(S,w,Q,W,oe),Ng=rn;break;case 23:break;case 22:Cn=w.stateNode,on=w.alternate,w.memoizedState!==null?(Yt&&on!==null&&on.memoizedState===null&&uh(on),Cn._visibility&WM?Y2(S,w,Q,W,oe):qC(S,w,Q,W,oe)):(Yt&&on!==null&&on.memoizedState!==null&&uh(w),Cn._visibility&WM?Y2(S,w,Q,W,oe):(Cn._visibility|=WM,U8(S,w,Q,W,(w.subtreeFlags&10256)!==0||w.actualDuration!==0&&(w.alternate===null||w.alternate.child!==w.child),oe),(w.mode&za)===gs||Ng||(S=w.actualStartTime,0<=S&&0.05<oe-S&&BC(w,S,oe),0<=Qi&&0<=rs&&0.05<rs-Qi&&BC(w,Qi,rs)))),rn&2048&&Y8(on,w);break;case 24:Y2(S,w,Q,W,oe),rn&2048&&G8(w.alternate,w);break;case 30:Yt&&(rn=w.alternate,rn!==null&&(fd(rn.child,!0),fd(w.child,!0))),Y2(S,w,Q,W,oe);break;default:Y2(S,w,Q,W,oe)}if((w.mode&za)!==gs){if(S=!Ng&&w.alternate===null&&w.return!==null&&w.return.alternate!==null)Q=w.actualStartTime,0<=Q&&0.05<oe-Q&&Nf(w,Q,oe,"Mount");0<=Qi&&0<=rs&&((yp||0.05<V0)&&s0(w,Qi,rs,V0,g0),S&&0.05<rs-Qi&&Nf(w,Qi,rs,"Mount"))}h_(ae),Lf(De),g0=Qe,yp=ot,HN=_t}function U8(S,w,Q,W,oe,ae){oe=oe&&((w.subtreeFlags&10256)!==0||w.actualDuration!==0&&(w.alternate===null||w.alternate.child!==w.child));for(w=w.child;w!==null;){var De=w.sibling;AF(S,w,Q,W,oe,De!==null?De.actualStartTime:ae),w=De}}function AF(S,w,Q,W,oe,ae){var De=dp(),Qe=L2(),ot=ry(),_t=hh(),Yt=HN;oe&&(w.mode&za)!==gs&&0<w.actualStartTime&&(w.flags&1)!==0&&ty(w,w.actualStartTime,ae,Ng,Q);var rn=w.flags;switch(w.tag){case 0:case 11:case 15:U8(S,w,Q,W,oe,ae),nN(w,n1);break;case 23:break;case 22:var on=w.stateNode;w.memoizedState!==null?on._visibility&WM?U8(S,w,Q,W,oe,ae):qC(S,w,Q,W,ae):(on._visibility|=WM,U8(S,w,Q,W,oe,ae)),oe&&rn&2048&&Y8(w.alternate,w);break;case 24:U8(S,w,Q,W,oe,ae),oe&&rn&2048&&G8(w.alternate,w);break;default:U8(S,w,Q,W,oe,ae)}(w.mode&za)!==gs&&0<=Qi&&0<=rs&&(yp||0.05<V0)&&s0(w,Qi,rs,V0,g0),h_(De),Lf(Qe),g0=ot,yp=_t,HN=Yt}function qC(S,w,Q,W,oe){if(w.subtreeFlags&10256||w.actualDuration!==0&&(w.alternate===null||w.alternate.child!==w.child))for(var ae=w.child;ae!==null;){w=ae.sibling;var De=S,Qe=Q,ot=W,_t=w!==null?w.actualStartTime:oe,Yt=HN;(ae.mode&za)!==gs&&0<ae.actualStartTime&&(ae.flags&1)!==0&&ty(ae,ae.actualStartTime,_t,Ng,Qe);var rn=ae.flags;switch(ae.tag){case 22:qC(De,ae,Qe,ot,_t),rn&2048&&Y8(ae.alternate,ae);break;case 24:qC(De,ae,Qe,ot,_t),rn&2048&&G8(ae.alternate,ae);break;default:qC(De,ae,Qe,ot,_t)}HN=Yt,ae=w}}function zI(S,w,Q){if(S.subtreeFlags&iz)for(S=S.child;S!==null;)aN(S,w,Q),S=S.sibling}function aN(S,w,Q){switch(S.tag){case 26:zI(S,w,Q),S.flags&iz&&(S.memoizedState!==null?Rr(Q,b9,S.memoizedState,S.memoizedProps):(S=S.stateNode,(w&335544128)===w&&nr(Q,S)));break;case 5:zI(S,w,Q),S.flags&iz&&(S=S.stateNode,(w&335544128)===w&&nr(Q,S));break;case 3:case 4:var W=b9;b9=i9(S.stateNode.containerInfo),zI(S,w,Q),b9=W;break;case 22:S.memoizedState===null&&(W=S.alternate,W!==null&&W.memoizedState!==null?(W=iz,iz=16777216,zI(S,w,Q),iz=W):zI(S,w,Q));break;case 30:if((S.flags&iz)!==0&&(W=S.memoizedProps.name,W!=null&&W!=="auto")){var oe=S.stateNode;oe.paired=null,o3===null&&(o3=new Map),o3.set(W,oe)}zI(S,w,Q);break;default:zI(S,w,Q)}}function SM(S){var w=S.alternate;if(w!==null&&(S=w.child,S!==null)){w.child=null;do w=S.sibling,S.sibling=null,S=w;while(S!==null)}}function PM(S){var w=S.deletions;if((S.flags&16)!==0){if(w!==null)for(var Q=0;Q<w.length;Q++){var W=w[Q],oe=dp();kA=W,lN(W,S),(W.mode&za)!==gs&&0<=Qi&&0<=rs&&0.05<rs-Qi&&Nf(W,Qi,rs,"Unmount"),h_(oe)}SM(S)}if(S.subtreeFlags&10256)for(S=S.child;S!==null;)cN(S),S=S.sibling}function cN(S){var w=dp(),Q=L2(),W=ry(),oe=hh();switch(S.tag){case 0:case 11:case 15:PM(S),S.flags&2048&&F2(S,S.return,n1|Ib);break;case 3:var ae=k2();PM(S),S.stateNode.passiveEffectDuration+=tM(ae);break;case 12:ae=k2(),PM(S),S.stateNode.passiveEffectDuration+=kf(ae);break;case 22:ae=S.stateNode,S.memoizedState!==null&&ae._visibility&WM&&(S.return===null||S.return.tag!==13)?(ae._visibility&=~WM,W8(S),(S.mode&za)!==gs&&0<=Qi&&0<=rs&&0.05<rs-Qi&&Nf(S,Qi,rs,"Disconnect")):PM(S);break;default:PM(S)}(S.mode&za)!==gs&&0<=Qi&&0<=rs&&(yp||0.05<V0)&&s0(S,Qi,rs,V0,g0),h_(w),Lf(Q),yp=oe,g0=W}function W8(S){var w=S.deletions;if((S.flags&16)!==0){if(w!==null)for(var Q=0;Q<w.length;Q++){var W=w[Q],oe=dp();kA=W,lN(W,S),(W.mode&za)!==gs&&0<=Qi&&0<=rs&&0.05<rs-Qi&&Nf(W,Qi,rs,"Unmount"),h_(oe)}SM(S)}for(S=S.child;S!==null;)fF(S),S=S.sibling}function fF(S){var w=dp(),Q=L2(),W=ry(),oe=hh();switch(S.tag){case 0:case 11:case 15:F2(S,S.return,n1),W8(S);break;case 22:var ae=S.stateNode;ae._visibility&WM&&(ae._visibility&=~WM,W8(S));break;default:W8(S)}(S.mode&za)!==gs&&0<=Qi&&0<=rs&&(yp||0.05<V0)&&s0(S,Qi,rs,V0,g0),h_(w),Lf(Q),yp=oe,g0=W}function lN(S,w){for(;kA!==null;){var Q=kA,W=Q,oe=w,ae=dp(),De=L2(),Qe=ry(),ot=hh();switch(W.tag){case 0:case 11:case 15:F2(W,oe,n1);break;case 23:case 22:W.memoizedState!==null&&W.memoizedState.cachePool!==null&&(oe=W.memoizedState.cachePool.pool,oe!=null&&T4(oe));break;case 24:Q2(W.memoizedState.cache)}if((W.mode&za)!==gs&&0<=Qi&&0<=rs&&(yp||0.05<V0)&&s0(W,Qi,rs,V0,g0),h_(ae),Lf(De),yp=ot,g0=Qe,W=Q.child,W!==null)W.return=Q,kA=W;else e:for(Q=S;kA!==null;){if(W=kA,ae=W.sibling,De=W.return,yW(W),W===Q){kA=null;break e}if(ae!==null){ae.return=De,kA=ae;break e}kA=De}}}function OI(){r5o.forEach(function(S){return S()})}function VI(){var S=typeof IS_REACT_ACT_ENVIRONMENT<"u"?IS_REACT_ACT_ENVIRONMENT:void 0;return S||Xn.actQueue===null||console.error("The current testing environment is not configured to support act(...)"),S}function Pm(S){if((hl&Rg)!==LA&&ma!==0)return ma&-ma;var w=Xn.T;if(w!==null)return w._updatedFibers||(w._updatedFibers=new Set),w._updatedFibers.add(S),tz!==null&&kt()===km&&(tz=null),L4();return S=kt(),S===km&&(tz=null),S}function hN(){if(t5===0)if((ma&536870912)===0||Oa){var S=w7;w7<<=1,(w7&3932160)===0&&(w7=262144),t5=S}else t5=536870912;return S=Jf.current,S!==null&&(S.flags|=32),t5}function YI(S,w){if(w!=null){var Q=S.stateNode,W=Q.ref;W===null&&(W=Q.ref=PA(bm(S.memoizedProps,Q))),pX===null&&(pX=[]),pX.push(w.bind(null,W))}}function Kd(S,w,Q){if(_X&&console.error("useInsertionEffect must not schedule updates."),lRe&&(Bge=!0),S===Cd&&(Fh===az||Fh===cz)||S.cancelPendingCommit!==null)X8(S,0),Yx(S,ma,t5,!1);if(Ze(S,Q),(hl&Rg)!==LA&&S===Cd){if(Z4)switch(w.tag){case 0:case 11:case 15:S=qa&&Y(qa)||"Unknown",ryt.has(S)||(ryt.add(S),w=Y(w)||"Unknown",console.error("Cannot update a component (`%s`) while rendering a different component (`%s`). To locate the bad setState() call inside `%s`, follow the stack trace as described in https://react.dev/link/setstate-in-render",w,S,S));break;case 1:oyt||(console.error("Cannot update during an existing state transition (such as within `render`). Render methods should be a pure function of props and state."),oyt=!0)}}else Z2&&Xe(S,w,Q),Z8(w),S===Cd&&((hl&Rg)===LA&&(qN|=Q),Y0===KN&&Yx(S,ma,t5,!1)),X2(S)}function vW(S,w,Q){if((hl&(Rg|r3))!==LA)throw Error("Should not already be working.");if(ma!==0&&qa!==null){var W=qa,oe=es();switch(q2t){case ure:case az:var ae=Xoe;Pu&&((W=W._debugTask)?W.run(console.timeStamp.bind(console,"Suspended",ae,oe,$x,void 0,"primary-light")):console.timeStamp("Suspended",ae,oe,$x,void 0,"primary-light"));break;case cz:ae=Xoe,Pu&&((W=W._debugTask)?W.run(console.timeStamp.bind(console,"Action",ae,oe,$x,void 0,"primary-light")):console.timeStamp("Action",ae,oe,$x,void 0,"primary-light"));break;default:Pu&&(W=oe-Xoe,3>W||console.timeStamp("Blocked",Xoe,oe,$x,void 0,5>W?"primary-light":10>W?"primary":100>W?"primary-dark":"error"))}}ae=(Q=!Q&&(w&127)===0&&(w&S.expiredLanes)===0||et(S,w))?bF(S,w):CF(S,w,!0);var De=Q;do{if(ae===tw){dX&&!Q&&Yx(S,w,0,!1),w=Fh,Xoe=Lm(),q2t=w;break}else{if(W=es(),oe=S.current.alternate,De&&!SW(oe)){lh(w),oe=RA,ae=W,!Pu||ae<=oe||(xp?xp.run(console.timeStamp.bind(console,"Teared Render",oe,ae,fc,sc,"error")):console.timeStamp("Teared Render",oe,ae,fc,sc,"error")),JC(w,W),ae=CF(S,w,!1),De=!1;continue}if(ae===sz){if(De=w,S.errorRecoveryDisabledLanes&De)var Qe=0;else Qe=S.pendingLanes&-536870913,Qe=Qe!==0?Qe:Qe&536870912?536870912:0;if(Qe!==0){lh(w),qE(RA,W,w,xp),JC(w,W),w=Qe;e:{W=S,ae=De,De=mre;var ot=W.current.memoizedState.isDehydrated;if(ot&&(X8(W,Qe).flags|=256),Qe=CF(W,Qe,!1),Qe!==sz&&Qe!==dre){if(nRe&&!ot){W.errorRecoveryDisabledLanes|=ae,qN|=ae,ae=KN;break e}W=wy,wy=De,W!==null&&(wy===null?wy=W:wy.push.apply(wy,W))}ae=Qe}if(De=!1,ae!==sz)continue;else W=es()}}if(ae===hre){lh(w),qE(RA,W,w,xp),JC(w,W),X8(S,0),Yx(S,w,0,!0);break}e:{switch(Q=S,ae){case tw:case hre:throw Error("Root did not complete. This is a bug in React.");case KN:if((w&4194048)!==w&&(w&62914560)!==w)break;case dre:lh(w),$E(RA,W,w,xp),JC(w,W),oe=w,(oe&127)!==0?tge=W:(oe&4194048)!==0&&(nge=W),Yx(Q,w,t5,!nw);break e;case sz:wy=null;break;case fge:case X1t:break;default:throw Error("Unknown root exit status.")}if(Xn.actQueue!==null)Gx(Q,oe,w,wy,_re,bge,t5,qN,lz,nw,ae,null,null,RA,W);else{if((w&62914560)===w&&(De=Ige+$1t-es(),10<De)){if(Yx(Q,w,t5,!nw),Tt(Q,0,!0)!==0)break e;n5=w,Q.timeoutHandle=xRe(G2.bind(null,Q,oe,wy,_re,bge,w,t5,qN,lz,nw,ae,"Throttled",RA,W),De);break e}G2(Q,oe,wy,_re,bge,w,t5,qN,lz,nw,ae,null,RA,W)}}}break}while(1);X2(S)}function G2(S,w,Q,W,oe,ae,De,Qe,ot,_t,Yt,rn,on,Cn){S.timeoutHandle=_z;var Po=w.subtreeFlags,Sr=(ae&335544064)===ae,mi=null;if(Sr||Po&8192||(Po&16785408)===16785408){if(mi={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Gd},o3=null,aN(w,ae,mi),Sr&&(Po=mi,Sr=S.containerInfo,Sr=(Sr.nodeType===9?Sr:Sr.ownerDocument).__reactViewTransition,Sr!=null&&(Po.count++,Po.waitingForViewTransition=!0,Po=zr.bind(Po),Sr.finished.then(Po,Po))),Po=(ae&62914560)===ae?Ige-es():(ae&4194048)===ae?K1t-es():0,Po=Yi(mi,Po),Po!==null){n5=ae,S.cancelPendingCommit=Po(Gx.bind(null,S,w,ae,Q,W,oe,De,Qe,ot,_t,Yt,mi,mi.waitingForViewTransition?"Waiting for the previous Animation":0<mi.count?0<mi.imgCount?"Suspended on CSS and Images":"Suspended on CSS":mi.imgCount===1?"Suspended on an Image":0<mi.imgCount?"Suspended on Images":null,on,Cn)),Yx(S,ae,De,!_t);return}}Gx(S,w,ae,Q,W,oe,De,Qe,ot,_t,Yt,mi,rn,on,Cn)}function SW(S){for(var w=S;;){var Q=w.tag;if((Q===0||Q===11||Q===15)&&w.flags&16384&&(Q=w.updateQueue,Q!==null&&(Q=Q.stores,Q!==null)))for(var W=0;W<Q.length;W++){var oe=Q[W],ae=oe.getSnapshot;oe=oe.value;try{if(!Py(ae(),oe))return!1}catch(De){return!1}}if(Q=w.child,w.subtreeFlags&16384&&Q!==null)Q.return=w,w=Q;else{if(w===S)break;for(;w.sibling===null;){if(w.return===null||w.return===S)return!0;w=w.return}w.sibling.return=w.return,w=w.sibling}}return!0}function Yx(S,w,Q,W){w=vt(S,w),w&=~Cge,w&=~qN,S.suspendedLanes|=w,S.pingedLanes&=~w,W&&(S.warmLanes|=w),W=S.expirationTimes;for(var oe=w;0<oe;){var ae=31-mh(oe),De=1<<ae;W[ae]=-1,oe&=~De}Q!==0&&qe(S,Q,w)}function GI(){return(hl&(Rg|r3))===LA?(e7(0,!1),!1):!0}function dN(){if(qa!==null){if(Fh===e5)var S=qa.return;else S=qa,DC(),zf(S),oX=null,nre=0,S=qa;for(;S!==null;)NI(S.alternate,S),S=S.return;qa=null}}function JC(S,w){(S&127)!==0&&(VN=w),(S&4194048)!==0&&(y9=w),(S&62914560)!==0&&(DNe=w),(S&2080374784)!==0&&(NNe=w)}function X8(S,w){Pu&&(console.timeStamp("Blocking Track",0.003,0.003,"Blocking",sc,"primary-light"),console.timeStamp("Transition Track",0.003,0.003,"Transition",sc,"primary-light"),console.timeStamp("Suspense Track",0.003,0.003,"Suspense",sc,"primary-light"),console.timeStamp("Idle Track",0.003,0.003,"Idle",sc,"primary-light"));var Q=RA;if(RA=Lm(),ma!==0&&0<Q){if(lh(ma),Y0===fge||Y0===KN)$E(Q,RA,w,xp);else{var W=RA,oe=xp;if(Pu&&!(W<=Q)){var ae=(w&738197653)===w?"tertiary-dark":"primary-dark",De=(w&536870912)===w?"Prewarm":(w&201326741)===w?"Interrupted Hydration":"Interrupted Render";oe?oe.run(console.timeStamp.bind(console,De,Q,W,fc,sc,ae)):console.timeStamp(De,Q,W,fc,sc,ae)}}JC(ma,RA)}if(Q=xp,xp=null,(w&127)!==0){xp=Goe,oe=0<=D7&&D7<VN?VN:D7,W=0<=$F&&$F<VN?VN:$F,ae=0<=W?W:0<=oe?oe:RA,0<=tge?(lh(2),v4(tge,ae,w,Q)):(JF&127)!==0&&(lh(2),Dt(VN,ae,qx)),Q=oe;var Qe=W,ot=Uoe,_t=0<eX,Yt=YN===Yoe,rn=YN===ege;if(oe=RA,W=Goe,ae=wNe,De=BNe,Pu){if(fc="Blocking",0<Q?Q>oe&&(Q=oe):Q=oe,0<Qe?Qe>Q&&(Qe=Q):Qe=Q,ot!==null&&Q>Qe){var on=_t?"secondary-light":"warning";W?W.run(console.timeStamp.bind(console,_t?"Consecutive":"Event: "+ot,Qe,Q,fc,sc,on)):console.timeStamp(_t?"Consecutive":"Event: "+ot,Qe,Q,fc,sc,on)}oe>Q&&(Qe=Yt?"error":(w&738197653)===w?"tertiary-light":"primary-light",Yt=rn?"Promise Resolved":Yt?"Cascading Update":5<oe-Q?"Update Blocked":"Update",rn=[],De!=null&&rn.push(["Component name",De]),ae!=null&&rn.push(["Method name",ae]),Q={start:Q,end:oe,detail:{devtools:{properties:rn,track:fc,trackGroup:sc,color:Qe}}},W?W.run(performance.measure.bind(performance,Yt,Q)):performance.measure(Yt,Q),performance.clearMeasures(Yt))}D7=-1.1,YN=0,BNe=wNe=null,tge=-1.1,eX=$F,$F=-1.1,VN=Lm()}return(w&4194048)!==0&&(xp=Woe,oe=0<=JM&&JM<y9?y9:JM,Q=0<=bb&&bb<y9?y9:bb,W=0<=GN&&GN<y9?y9:GN,ae=0<=W?W:0<=Q?Q:RA,0<=nge?(lh(256),v4(nge,ae,w,xp)):(JF&4194048)!==0&&(lh(256),Dt(y9,ae,qx)),rn=W,Qe=qF,ot=0<UN,_t=TNe===ege,ae=RA,W=Woe,De=K2t,Yt=$2t,Pu&&(fc="Transition",0<Q?Q>ae&&(Q=ae):Q=ae,0<oe?oe>Q&&(oe=Q):oe=Q,0<rn?rn>oe&&(rn=oe):rn=oe,oe>rn&&Qe!==null&&(on=ot?"secondary-light":"warning",W?W.run(console.timeStamp.bind(console,ot?"Consecutive":"Event: "+Qe,rn,oe,fc,sc,on)):console.timeStamp(ot?"Consecutive":"Event: "+Qe,rn,oe,fc,sc,on)),Q>oe&&(W?W.run(console.timeStamp.bind(console,"Action",oe,Q,fc,sc,"primary-dark")):console.timeStamp("Action",oe,Q,fc,sc,"primary-dark")),ae>Q&&(oe=_t?"Promise Resolved":5<ae-Q?"Update Blocked":"Update",rn=[],Yt!=null&&rn.push(["Component name",Yt]),De!=null&&rn.push(["Method name",De]),Q={start:Q,end:ae,detail:{devtools:{properties:rn,track:fc,trackGroup:sc,color:"primary-light"}}},W?W.run(performance.measure.bind(performance,oe,Q)):performance.measure(oe,Q),performance.clearMeasures(oe))),bb=JM=-1.1,TNe=0,nge=-1.1,UN=GN,GN=-1.1,y9=Lm()),(w&62914560)!==0&&(JF&62914560)!==0&&(lh(4194304),Dt(DNe,RA,qx)),(w&2080374784)!==0&&(JF&2080374784)!==0&&(lh(268435456),Dt(NNe,RA,qx)),Q=S.timeoutHandle,Q!==_z&&(S.timeoutHandle=_z,A5o(Q)),Q=S.cancelPendingCommit,Q!==null&&(S.cancelPendingCommit=null,Q()),n5=0,dN(),Cd=S,qa=Q=vc(S.current,null),ma=w,Fh=e5,i3=null,nw=!1,dX=et(S,w),nRe=!1,Y0=tw,lz=t5=Cge=qN=$N=0,wy=mre=null,bge=!1,H7=vt(S,w),tn(),S=V2t(),1000<S-O2t&&(Xn.recentlyCreatedOwnerStacks=0,O2t=S),x9.discardPendingWarnings(),Q}function yF(S,w){Is=null,Xn.H=uge,Xn.getCurrentStack=null,Z4=!1,Dg=null,w===nX||w===sge?(w=mD(),Fh=ure):w===LNe?(w=mD(),Fh=j1t):Fh=w===jNe?tRe:w!==null&&typeof w==="object"&&typeof w.then==="function"?pre:yge,i3=w;var Q=qa;Q===null?(Y0=hre,k8(S,ds(w,S.current))):Q.mode&za&&uD(Q)}function xF(){var S=Jf.current;return S===null?!0:(ma&4194048)===ma?t1===null?!0:!1:(ma&62914560)===ma||(ma&536870912)!==0?S===t1:!1}function PW(){var S=Xn.H;return Xn.H=uge,S===null?uge:S}function EW(){var S=Xn.A;return Xn.A=o5o,S}function uN(S){xp===null&&(xp=S._debugTask==null?null:S._debugTask)}function EM(){Y0=KN,nw||(ma&4194048)!==ma&&Jf.current!==null||(dX=!0),($N&134217727)===0&&(qN&134217727)===0||Cd===null||Yx(Cd,ma,t5,!1)}function CF(S,w,Q){var W=hl;hl|=Rg;var oe=PW(),ae=EW();if(Cd!==S||ma!==w){if(Z2){var De=S.memoizedUpdaters;0<De.size&&(Ux(S,ma),De.clear()),it(S,w)}_re=null,X8(S,w)}w=!1,De=Y0;e:do try{if(Fh!==e5&&qa!==null){var Qe=qa,ot=i3;switch(Fh){case tRe:dN(),De=dre;break e;case ure:case az:case cz:case pre:Jf.current===null&&(w=!0);var _t=Fh;if(Fh=e5,i3=null,ZC(S,Qe,ot,_t),Q&&dX){De=tw;break e}break;default:_t=Fh,Fh=e5,i3=null,ZC(S,Qe,ot,_t)}}l0(),De=Y0;break}catch(Yt){yF(S,Yt)}while(1);return w&&S.shellSuspendCounter++,DC(),hl=W,Xn.H=oe,Xn.A=ae,qa===null&&(Cd=null,ma=0,tn()),De}function l0(){for(;qa!==null;)IF(qa)}function bF(S,w){var Q=hl;hl|=Rg;var W=PW(),oe=EW();if(Cd!==S||ma!==w){if(Z2){var ae=S.memoizedUpdaters;0<ae.size&&(Ux(S,ma),ae.clear()),it(S,w)}_re=null,vge=es()+q1t,X8(S,w)}else dX=et(S,w);e:do try{if(Fh!==e5&&qa!==null)t:switch(w=qa,ae=i3,Fh){case yge:Fh=e5,i3=null,ZC(S,w,ae,yge);break;case az:case cz:if(pD(ae)){Fh=e5,i3=null,vF(w);break}w=function(){Fh!==az&&Fh!==cz||Cd!==S||(Fh=xge),X2(S)},ae.then(w,w);break e;case ure:Fh=xge;break e;case j1t:Fh=eRe;break e;case xge:pD(ae)?(Fh=e5,i3=null,vF(w)):(Fh=e5,i3=null,ZC(S,w,ae,xge));break;case eRe:var De=null;switch(qa.tag){case 26:De=qa.memoizedState;case 5:case 27:var Qe=qa;if(De?so(De):Qe.stateNode.complete){Fh=e5,i3=null;var ot=Qe.sibling;if(ot!==null)qa=ot;else{var _t=Qe.return;_t!==null?(qa=_t,j8(_t)):qa=null}break t}break;default:console.error("Unexpected type of fiber triggered a suspensey commit. This is a bug in React.")}Fh=e5,i3=null,ZC(S,w,ae,eRe);break;case pre:Fh=e5,i3=null,ZC(S,w,ae,pre);break;case tRe:dN(),Y0=dre;break e;default:throw Error("Unexpected SuspendedReason. This is a bug in React.")}Xn.actQueue!==null?l0():Aoe();break}catch(Yt){yF(S,Yt)}while(1);if(DC(),Xn.H=W,Xn.A=oe,hl=Q,qa!==null)return tw;return Cd=null,ma=0,tn(),Y0}function Aoe(){for(;qa!==null&&!Ioe();)IF(qa)}function IF(S){var w=S.alternate;(S.mode&za)!==gs?(nM(S),w=ye(S,Op,w,S,H7),uD(S)):w=ye(S,Op,w,S,H7),S.memoizedProps=S.pendingProps,w===null?j8(S):qa=w}function vF(S){var w=ye(S,UI,S);S.memoizedProps=S.pendingProps,w===null?j8(S):qa=w}function UI(S){var w=S.alternate,Q=(S.mode&za)!==gs;switch(Q&&nM(S),S.tag){case 15:case 0:w=ZD(w,S,S.pendingProps,S.type,void 0,ma);break;case 11:w=ZD(w,S,S.pendingProps,S.type.render,S.ref,ma);break;case 5:zf(S);var W=S;W===NA&&(Oa?(x8(W),W.tag===5&&W.stateNode!=null&&(qd=W.stateNode)):(x8(W),Oa=!0));default:NI(w,S),S=qa=zp(S,H7),w=Op(w,S,H7)}return Q&&uD(S),w}function ZC(S,w,Q,W){DC(),zf(w),oX=null,nre=0;var oe=w.return;try{if(Fx(S,oe,w,Q,ma)){Y0=hre,k8(S,ds(Q,S.current)),qa=null;return}}catch(ae){if(oe!==null)throw qa=oe,ae;Y0=hre,k8(S,ds(Q,S.current)),qa=null;return}if(w.flags&32768){if(Oa||W===yge)S=!0;else if(dX||(ma&536870912)!==0)S=!1;else if(nw=S=!0,W===az||W===cz||W===ure||W===pre)W=Jf.current,W!==null&&W.tag===13&&(W.flags|=16384);gy(w,S)}else j8(w)}function j8(S){var w=S;do{if((w.flags&32768)!==0){gy(w,nw);return}var Q=w.alternate;if(S=w.return,nM(w),Q=ye(w,_oe,Q,w,H7),(w.mode&za)!==gs&&XH(w),Q!==null){qa=Q;return}if(w=w.sibling,w!==null){qa=w;return}qa=w=S}while(w!==null);Y0===tw&&(Y0=X1t)}function gy(S,w){do{var Q=uW(S.alternate,S);if(Q!==null){Q.flags&=32767,qa=Q;return}if((S.mode&za)!==gs){XH(S),Q=S.actualDuration;for(var W=S.child;W!==null;)Q+=W.actualDuration,W=W.sibling;S.actualDuration=Q}if(Q=S.return,Q!==null&&(Q.flags|=32768,Q.subtreeFlags=0,Q.deletions=null),!w&&(S=S.sibling,S!==null)){qa=S;return}qa=S=Q}while(S!==null);Y0=dre,qa=null}function Gx(S,w,Q,W,oe,ae,De,Qe,ot,_t,Yt,rn,on,Cn,Po){S.cancelPendingCommit=null;do fy();while(G0!==F7);if(x9.flushLegacyContextWarning(),x9.flushPendingUnsafeLifecycleWarnings(),(hl&(Rg|r3))!==LA)throw Error("Should not already be working.");if(lh(Q),Yt===sz)qE(Cn,Po,Q,xp);else if(W!==null){if(_t=w!==null&&w.alternate!==null&&w.alternate.memoizedState.isDehydrated&&(w.flags&256)!==0,ae=xp,Pu&&!(Po<=Cn)){Yt=[];for(var Sr=0;Sr<W.length;Sr++){var mi=W[Sr].value;Yt.push(["Recoverable Error",typeof mi==="object"&&mi!==null&&typeof mi.message==="string"?String(mi.message):String(mi)])}Cn={start:Cn,end:Po,detail:{devtools:{color:"primary-dark",track:fc,trackGroup:sc,tooltipText:_t?"Hydration Failed":"Recovered after Error",properties:Yt}}},ae?ae.run(performance.measure.bind(performance,"Recovered",Cn)):performance.measure("Recovered",Cn),performance.clearMeasures("Recovered")}}else ae=xp,!Pu||Po<=Cn||(_t=(Q&738197653)===Q?"tertiary-dark":"primary-dark",Yt=(Q&536870912)===Q?"Prepared":(Q&201326741)===Q?"Hydrated":"Render",ae?ae.run(console.timeStamp.bind(console,Yt,Cn,Po,fc,sc,_t)):console.timeStamp(Yt,Cn,Po,fc,sc,_t));if(w!==null){if(Q===0&&console.error("finishedLanes should not be empty during a commit. This is a bug in React."),w===S.current)throw Error("Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue.");S===Cd&&(qa=Cd=null,ma=0),hz=w,I9=S,n5=Q,aRe=oe,tyt=W,Ege=Po,Mge=on,s3=Sge,cRe=null,m_(S,w,Q,De,Qe,ot,rn,on,Po)}}function m_(S,w,Q,W,oe,ae,De,Qe,ot){var _t=w.lanes|w.childLanes;if(sRe=_t,_t|=vNe,$e(S,Q,_t,W,oe,ae),pX=null,(Q&335544064)===Q?(mX=v8(S),W=10262):(mX=null,W=10256),w.actualDuration!==0||(w.subtreeFlags&W)!==0||(w.flags&W)!==0?(S.callbackNode=null,S.callbackPriority=0,Eg(S7,function(){return bre=window.event,s3===Sge&&(s3=oRe),pN(),null})):(S.callbackNode=null,S.callbackPriority=0),qM=null,$M=Lm(),Qe!==null&&S4(ot,$M,Qe,xp),mge=!1,Qe=(w.flags&13878)!==0,(w.subtreeFlags&13878)!==0||Qe){Qe=Xn.T,Xn.T=null,ot=Jc.p,Jc.p=km,W=hl,hl|=r3;try{Vx(S,w,Q)}finally{hl=W,Jc.p=ot,Xn.T=Qe}}G0=Z1t,mge?(JF|=Q,qx=null,uX=p7(De,S.containerInfo,mX,K8,XI,Ay,$8,pN,SF,MM,WI.bind(null,Q))):(K8(),XI(),$8())}function SF(S){if(G0!==F7){var w=I9.onRecoverableError;w(S,PF(null))}}function MM(S){f9=Lm(),ct(Mge===null?Ege:$M,f9,qM,s3===gre,xp),Mge=cRe=S}function WI(S){if((JF&S)!==0){var w=qx;JF&=~S,qx=null,(S&4194048)!==0&&(ma&4194048)===0&&(n5&4194048)===0&&(lh(256),Dt(y9,es(),w)),(S&62914560)!==0&&(ma&62914560)===0&&(n5&62914560)===0&&(lh(4194304),Dt(DNe,es(),w)),(S&2080374784)!==0&&(ma&2080374784)===0&&(n5&2080374784)===0&&(lh(268435456),Dt(NNe,es(),w))}}function Ay(){G0===rRe&&(G0=F7,FI(hz,I9),G0=iRe)}function K8(){if(G0===Z1t){G0=F7;var S=I9,w=hz,Q=n5,W=(w.flags&13878)!==0;if((w.subtreeFlags&13878)!==0||W){W=Xn.T,Xn.T=null;var oe=Jc.p;Jc.p=km;var ae=hl;hl|=r3;try{lX=Q,hX=S,cre=Age=!1,mI(),$C(w,S,Q),hX=lX=null,Q=fRe;var De=f8(S.containerInfo),Qe=Q.focusedElem,ot=Q.selectionRange;if(De!==Qe&&Qe&&Qe.ownerDocument&&jc(Qe.ownerDocument.documentElement,Qe)){if(ot!==null&&yg(Qe)){var{start:_t,end:Yt}=ot;if(Yt===void 0&&(Yt=_t),"selectionStart"in Qe)Qe.selectionStart=_t,Qe.selectionEnd=Math.min(Yt,Qe.value.length);else{var rn=Qe.ownerDocument||document,on=rn&&rn.defaultView||window;if(on.getSelection){var Cn=on.getSelection(),Po=Qe.textContent.length,Sr=Math.min(ot.start,Po),mi=ot.end===void 0?Sr:Math.min(ot.end,Po);!Cn.extend&&Sr>mi&&(De=mi,mi=Sr,Sr=De);var wa=i0(Qe,Sr),Jt=i0(Qe,mi);if(wa&&Jt&&(Cn.rangeCount!==1||Cn.anchorNode!==wa.node||Cn.anchorOffset!==wa.offset||Cn.focusNode!==Jt.node||Cn.focusOffset!==Jt.offset)){var en=rn.createRange();en.setStart(wa.node,wa.offset),Cn.removeAllRanges(),Sr>mi?(Cn.addRange(en),Cn.extend(Jt.node,Jt.offset)):(en.setEnd(Jt.node,Jt.offset),Cn.addRange(en))}}}}rn=[];for(Cn=Qe;Cn=Cn.parentNode;)Cn.nodeType===1&&rn.push({element:Cn,left:Cn.scrollLeft,top:Cn.scrollTop});typeof Qe.focus==="function"&&Qe.focus();for(Qe=0;Qe<rn.length;Qe++){var sn=rn[Qe];sn.element.scrollLeft=sn.left,sn.element.scrollTop=sn.top}}bX=!!ARe,fRe=ARe=null}finally{hl=ae,Jc.p=oe,Xn.T=W}}S.current=w,G0=eyt}}function XI(){if(G0===eyt){G0=F7;var S=cRe;if(S!==null){$M=Lm();var w=f9,Q=$M;!Pu||Q<=w||(qx?qx.run(console.timeStamp.bind(console,S,w,Q,fc,sc,"secondary-light")):console.timeStamp(S,w,Q,fc,sc,"secondary-light"))}S=I9,w=hz,Q=n5;var W=(w.flags&8772)!==0;if((w.subtreeFlags&8772)!==0||W){W=Xn.T,Xn.T=null;var oe=Jc.p;Jc.p=km;var ae=hl;hl|=r3;try{lX=Q,hX=S,mI(),pF(S,w.alternate,w),hX=lX=null}finally{hl=ae,Jc.p=oe,Xn.T=W}}S=Ege,w=Mge,f9=Lm(),ct(w===null?S:$M,f9,qM,s3===gre,xp),G0=rRe}}function $8(){if(G0===iRe||G0===rRe){if(G0===iRe){var S=f9;f9=Lm();var w=f9,Q=s3===gre;!Pu||w<=S||(qx?qx.run(console.timeStamp.bind(console,Q?"Interrupted View Transition":"Starting Animation",S,w,fc,sc,Q?"error":"secondary-light")):console.timeStamp(Q?"Interrupted View Transition":"Starting Animation",S,w,fc,sc,Q?" error":"secondary-light")),s3!==gre&&(s3=J1t)}G0=F7,S=uX,uX=null,VM(),w=I9;var W=hz;Q=n5;var oe=tyt,ae=(Q&335544064)===Q?10262:10256;(ae=W.actualDuration!==0||(W.subtreeFlags&ae)!==0||(W.flags&ae)!==0)?G0=Pge:(G0=F7,hz=I9=null,Wf(w,w.pendingLanes),dz=0,fre=null);var De=w.pendingLanes;if(De===0&&(JN=null),ae||J8(w),De=St(Q),W=W.stateNode,kh&&typeof kh.onCommitFiberRoot==="function")try{var Qe=(W.current.flags&128)===128;switch(De){case km:var ot=mb;break;case f_:ot=v7;break;case gb:ot=S7;break;case zW:ot=vu;break;default:ot=S7}kh.onCommitFiberRoot(M7,W,ot,Qe)}catch(on){BA||(BA=!0,console.error("React instrumentation encountered an error: %o",on))}if(Z2&&w.memoizedUpdaters.clear(),OI(),oe!==null){Qe=Xn.T,ot=Jc.p,Jc.p=km,Xn.T=null;try{var _t=w.onRecoverableError;for(W=0;W<oe.length;W++){var Yt=oe[W],rn=PF(Yt.stack);ye(Yt.source,_t,Yt.value,rn)}}finally{Xn.T=Qe,Jc.p=ot}}if(_t=pX,Yt=mX,mX=null,_t!==null&&(pX=null,Yt===null&&(Yt=[]),S!==null))for(rn=0;rn<_t.length;rn++)oe=(0,_t[rn])(Yt),oe!==void 0&&S.finished.finally(oe);(n5&3)!==0&&fy(),X2(w),De=w.pendingLanes,(Q&261930)!==0&&(De&42)!==0?(rge=!0,w===wge?Are++:(Are=0,wge=w)):(Are=0,wge=null),ae||JC(Q,f9),e7(0,!1)}}function PF(S){return S={componentStack:S},Object.defineProperty(S,"digest",{get:function(){console.error('You are accessing "digest" from the errorInfo object passed to onRecoverableError. This property is no longer provided as part of errorInfo but can be accessed as a property of the Error instance itself.')}}),S}function Wf(S,w){(S.pooledCacheLanes&=w)===0&&(w=S.pooledCache,w!=null&&(S.pooledCache=null,Q2(w)))}function fy(){return uX!==null&&(uX.skipTransition(),nyt||(nyt=!0,console.warn("A flushSync update cancelled a View Transition because it was called while the View Transition was still preparing. To preserve the synchronous semantics, React had to skip the View Transition. If you can, try to avoid flushSync() in a scenario that's likely to interfere.")),uX=null,s3=gre),K8(),XI(),$8(),pN()}function pN(){if(G0!==Pge)return!1;var S=I9,w=sRe;sRe=0;var Q=St(n5),W=gb===0||gb>Q?gb:Q;Q=Xn.T;var oe=Jc.p;try{Jc.p=W,Xn.T=null;var ae=aRe;aRe=null,W=I9;var De=n5;if(G0=F7,hz=I9=null,n5=0,(hl&(Rg|r3))!==LA)throw Error("Cannot flush passive effects while already rendering.");lh(De),lRe=!0,Bge=!1;var Qe=0;if(qM=null,Qe=es(),s3===J1t)Dt(f9,Qe,qx);else{var ot=f9,_t=Qe,Yt=s3===oRe;!Pu||_t<=ot||(xp?xp.run(console.timeStamp.bind(console,Yt?"Waiting for Paint":"Waiting",ot,_t,fc,sc,"secondary-light")):console.timeStamp(Yt?"Waiting for Paint":"Waiting",ot,_t,fc,sc,"secondary-light"))}ot=hl,hl|=r3;var rn=W.current;mI(),cN(rn);var on=W.current;rn=Ege,mI(),vM(W,on,De,ae,rn),J8(W),hl=ot;var Cn=es();if(on=Qe,rn=xp,qM!==null?Je(on,Cn,qM,!0,rn):!Pu||Cn<=on||(rn?rn.run(console.timeStamp.bind(console,"Remaining Effects",on,Cn,fc,sc,"secondary-dark")):console.timeStamp("Remaining Effects",on,Cn,fc,sc,"secondary-dark")),JC(De,Cn),e7(0,!1),Bge?W===fre?dz++:(dz=0,fre=W):dz=0,Bge=lRe=!1,kh&&typeof kh.onPostCommitFiberRoot==="function")try{kh.onPostCommitFiberRoot(M7,W)}catch(Sr){BA||(BA=!0,console.error("React instrumentation encountered an error: %o",Sr))}var Po=W.current.stateNode;return Po.effectDuration=0,Po.passiveEffectDuration=0,!0}finally{Jc.p=oe,Xn.T=Q,Wf(S,w)}}function q8(S,w,Q){w=ds(Q,w),jH(w),w=fM(S.stateNode,w,2),S=NC(S,w,2),S!==null&&(Ze(S,2),X2(S))}function qc(S,w,Q){if(_X=!1,S.tag===3)q8(S,S,Q);else{for(;w!==null;){if(w.tag===3){q8(w,S,Q);return}if(w.tag===1){var W=w.stateNode;if(typeof w.type.getDerivedStateFromError==="function"||typeof W.componentDidCatch==="function"&&(JN===null||!JN.has(W))){S=ds(Q,S),jH(S),Q=yM(2),W=NC(w,Q,2),W!==null&&(L8(Q,W,w,S),Ze(W,2),X2(W));return}}w=w.return}console.error(`Internal React error: Attempted to capture a commit phase error inside a detached tree. This indicates a bug in React. Potential causes include deleting the same fiber more than once, committing an already-finished tree, or an inconsistent return pointer.

Error message:

%s`,Q)}}function EF(S,w,Q){var W=S.pingCache;if(W===null){W=S.pingCache=new i5o;var oe=new Set;W.set(w,oe)}else oe=W.get(w),oe===void 0&&(oe=new Set,W.set(w,oe));oe.has(Q)||(nRe=!0,oe.add(Q),W=MW.bind(null,S,w,Q),Z2&&Ux(S,Q),w.then(W,W))}function MW(S,w,Q){var W=S.pingCache;W!==null&&W.delete(w),S.pingedLanes|=S.suspendedLanes&Q,S.warmLanes&=~Q,(Q&127)!==0?0>D7&&(VN=D7=Lm(),Goe=Z_e("Promise Resolved"),YN=ege):(Q&4194048)!==0&&0>bb&&(y9=bb=Lm(),Woe=Z_e("Promise Resolved"),TNe=ege),VI()&&Xn.actQueue===null&&console.error(`A suspended resource finished loading inside a test, but the event was not wrapped in act(...).

When testing, code that resolves suspended data should be wrapped into act(...):

act(() => {
  /* finish loading suspended data */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act`),Cd===S&&(ma&Q)===Q&&(Y0===KN||Y0===fge&&(ma&62914560)===ma&&es()-Ige<$1t?(hl&Rg)===LA?X8(S,0):Cge|=Q:Cge|=Q,lz===ma&&(lz=0)),X2(S)}function eb(S,w){w===0&&(w=We()),S=Ln(S,w),S!==null&&(Ze(S,w),X2(S))}function Em(S){var w=S.memoizedState,Q=0;w!==null&&(Q=w.retryLane),eb(S,Q)}function Cr(S,w){var Q=0;switch(S.tag){case 31:case 13:var{stateNode:W,memoizedState:oe}=S;oe!==null&&(Q=oe.retryLane);break;case 19:W=S.stateNode;break;case 22:W=S.stateNode._retryCache;break;default:throw Error("Pinged unknown suspense boundary type. This is probably a bug in React.")}W!==null&&W.delete(w),eb(S,Q)}function U2(S,w,Q){if((w.subtreeFlags&134225920)!==0)for(w=w.child;w!==null;){var W=S,oe=w,ae=oe.type===FF;ae=Q||ae,oe.tag!==22?oe.flags&134217728?ae&&ye(oe,W2,W,oe):U2(W,oe,ae):oe.memoizedState===null&&(ae&&oe.flags&134225920?ye(oe,W2,W,oe):oe.subtreeFlags&134217728&&ye(oe,U2,W,oe,ae)),w=w.sibling}}function W2(S,w){Ct(!0);try{bW(w,are),fF(w),IW(S,w.alternate,w,are),AF(S,w,0,null,!1,0)}finally{Ct(!1)}}function J8(S){var w=!0;S.current.mode&(e1|A9)||(w=!1),U2(S,S.current,w)}function yd(S){if((hl&Rg)===LA){var w=S.tag;if(w===3||w===1||w===0||w===11||w===14||w===15){if(w=Y(S)||"ReactComponent",Tge!==null){if(Tge.has(w))return;Tge.add(w)}else Tge=new Set([w]);ye(S,function(){console.error("Can't perform a React state update on a component that hasn't mounted yet. This indicates that you have a side-effect in your render function that asynchronously tries to update the component. Move this work to useEffect instead.")})}}}function Ux(S,w){Z2&&S.memoizedUpdaters.forEach(function(Q){Xe(S,Q,w)})}function Eg(S,w){var Q=Xn.actQueue;return Q!==null?(Q.push(w),c5o):I7(S,w)}function Z8(S){VI()&&Xn.actQueue===null&&ye(S,function(){console.error(`An update to %s inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act`,Y(S))})}function X2(S){S!==AX&&S.next===null&&(AX===null?gX=AX=S:AX=AX.next=S),Dge=!0,Xn.actQueue!==null?dRe||(dRe=!0,tb()):hRe||(hRe=!0,tb())}function e7(S,w){if(!uRe&&Dge){uRe=!0;do{var Q=!1;for(var W=gX;W!==null;){if(!w)if(S!==0){var oe=W.pendingLanes;if(oe===0)var ae=0;else{var De=W.suspendedLanes,Qe=W.pingedLanes;ae=(1<<31-mh(42|S)+1)-1,ae&=oe&~(De&~Qe),ae=ae&201326741?ae&201326741|1:ae?ae|2:0}ae!==0&&(Q=!0,BM(W,ae))}else ae=ma,ae=Tt(W,W===Cd?ae:0,W.cancelPendingCommit!==null||W.timeoutHandle!==_z),(ae&3)===0||et(W,ae)||(Q=!0,BM(W,ae));W=W.next}}while(Q);uRe=!1}}function MF(){bre=window.event,t7()}function t7(){Dge=dRe=hRe=!1;var S=0;ZN!==0&&AN()&&(S=ZN);for(var w=es(),Q=null,W=gX;W!==null;){var oe=W.next,ae=mN(W,w);if(ae===0)W.next=null,Q===null?gX=oe:Q.next=oe,oe===null&&(AX=Q);else if(Q=W,S!==0||(ae&3)!==0)Dge=!0;W=oe}G0!==F7&&G0!==Pge||e7(S,!1),ZN!==0&&(ZN=0)}function mN(S,w){for(var{suspendedLanes:Q,pingedLanes:W,expirationTimes:oe}=S,ae=S.pendingLanes&-62914561;0<ae;){var De=31-mh(ae),Qe=1<<De,ot=oe[De];if(ot===-1){if((Qe&Q)===0||(Qe&W)!==0)oe[De]=ht(Qe,w)}else ot<=w&&(S.expiredLanes|=Qe);ae&=~Qe}if(w=Cd,Q=ma,Q=Tt(S,S===w?Q:0,S.cancelPendingCommit!==null||S.timeoutHandle!==_z),W=S.callbackNode,Q===0||S===w&&(Fh===az||Fh===cz)||S.cancelPendingCommit!==null)return W!==null&&n7(W),S.callbackNode=null,S.callbackPriority=0;if((Q&3)===0||et(S,Q)){if(w=Q&-Q,w!==S.callbackPriority||Xn.actQueue!==null&&W!==pRe)n7(W);else return w;switch(St(Q)){case km:case f_:Q=v7;break;case gb:Q=S7;break;case zW:Q=vu;break;default:Q=S7}return W=wM.bind(null,S),Xn.actQueue!==null?(Xn.actQueue.push(W),Q=pRe):Q=I7(Q,W),S.callbackPriority=w,S.callbackNode=Q,w}return W!==null&&n7(W),S.callbackPriority=2,S.callbackNode=null,2}function wM(S,w){if(rge=oge=!1,bre=window.event,G0!==F7&&G0!==Pge)return S.callbackNode=null,S.callbackPriority=0,null;var Q=S.callbackNode;if(s3===Sge&&(s3=oRe),fy()&&S.callbackNode!==Q)return null;var W=ma;if(W=Tt(S,S===Cd?W:0,S.cancelPendingCommit!==null||S.timeoutHandle!==_z),W===0)return null;return vW(S,W,w),mN(S,es()),S.callbackNode!=null&&S.callbackNode===Q?wM.bind(null,S):null}function BM(S,w){if(fy())return null;oge=rge,rge=!1,vW(S,w,!0)}function n7(S){S!==pRe&&S!==null&&YF(S)}function tb(){Xn.actQueue!==null&&Xn.actQueue.push(function(){return t7(),null}),f5o(function(){(hl&(Rg|r3))!==LA?I7(mb,MF):t7()})}function L4(){if(ZN===0){var S=WN;S===0&&(S=GF,GF<<=1,(GF&261888)===0&&(GF=256)),ZN=S}return ZN}function jI(S){if(S==null||typeof S==="symbol"||typeof S==="boolean")return null;if(typeof S==="function")return S;return dt(S,"action"),Bh(S)}function _N(S,w,Q,W,oe){if(w==="submit"&&Q&&Q.stateNode===oe){var ae=jI((oe[TA]||null).action),De=W.submitter;De&&(w=(w=De[TA]||null)?jI(w.formAction):De.getAttribute("formAction"),w!==null&&(ae=w,De=null));var Qe=new GW("action","action",null,W,oe);S.push({event:Qe,listeners:[{instance:null,listener:function(){if(W.defaultPrevented){if(ZN!==0){var ot=new FormData(oe,De),_t={pending:!0,data:ot,method:oe.method,action:ae};Object.freeze(_t),GD(Q,_t,null,ot)}}else typeof ae==="function"&&(Qe.preventDefault(),ot=new FormData(oe,De),_t={pending:!0,data:ot,method:oe.method,action:ae},Object.freeze(_t),GD(Q,_t,ae,ot))},currentTarget:oe}]})}}function h0(S,w,Q){S.currentTarget=Q;try{w(S)}catch(W){xNe(W)}S.currentTarget=null}function Mg(S,w){w=(w&4)!==0;for(var Q=0;Q<S.length;Q++){var W=S[Q];e:{var oe=void 0,ae=W.event;if(W=W.listeners,w)for(var De=W.length-1;0<=De;De--){var Qe=W[De],ot=Qe.instance,_t=Qe.currentTarget;if(Qe=Qe.listener,ot!==oe&&ae.isPropagationStopped())break e;ot!==null?ye(ot,h0,ae,Qe,_t):h0(ae,Qe,_t),oe=ot}else for(De=0;De<W.length;De++){if(Qe=W[De],ot=Qe.instance,_t=Qe.currentTarget,Qe=Qe.listener,ot!==oe&&ae.isPropagationStopped())break e;ot!==null?ye(ot,h0,ae,Qe,_t):h0(ae,Qe,_t),oe=ot}}}}function Xs(S,w){mRe.has(S)||console.error('Did not expect a listenToNonDelegatedEvent() call for "%s". This is a bug in React. Please file an issue.',S);var Q=w[Soe];Q===void 0&&(Q=w[Soe]=new Set);var W=S+"__bubble";Q.has(W)||(wg(w,S,2,!1),Q.add(W))}function j2(S,w,Q){mRe.has(S)&&!w&&console.error('Did not expect a listenToNativeEvent() call for "%s" in the bubble phase. This is a bug in React. Please file an issue.',S);var W=0;w&&(W|=4),wg(Q,S,W,w)}function yy(S){if(!S[Nge]){S[Nge]=!0,_9.forEach(function(Q){Q!=="selectionchange"&&(mRe.has(Q)||j2(Q,!1,S),j2(Q,!0,S))});var w=S.nodeType===9?S:S.ownerDocument;w===null||w[Nge]||(w[Nge]=!0,j2("selectionchange",!1,w))}}function wg(S,w,Q,W){switch(c9(w)){case km:var oe=hb;break;case f_:oe=Rh;break;default:oe=db}Q=oe.bind(null,w,Q,S),oe=void 0,!ns||w!=="touchstart"&&w!=="touchmove"&&w!=="wheel"||(oe=!0),W?oe!==void 0?S.addEventListener(w,Q,{capture:!0,passive:oe}):S.addEventListener(w,Q,!0):oe!==void 0?S.addEventListener(w,Q,{passive:oe}):S.addEventListener(w,Q,!1)}function KI(S,w,Q,W,oe){var ae=W;if((w&1)===0&&(w&2)===0&&W!==null)e:for(;;){if(W===null)return;var De=W.tag;if(De===3||De===4){var Qe=W.stateNode.containerInfo;if(Qe===oe)break;if(De===4)for(De=W.return;De!==null;){var ot=De.tag;if((ot===3||ot===4)&&De.stateNode.containerInfo===oe)return;De=De.return}for(;Qe!==null;){if(De=bn(Qe),De===null)return;if(ot=De.tag,ot===5||ot===6||ot===26||ot===27){W=ae=De;continue e}Qe=Qe.parentNode}}W=W.return}q1(function(){var _t=ae,Yt=gA(Q),rn=[];e:{var on=z2t.get(S);if(on!==void 0){var Cn=GW,Po=S;switch(S){case"keypress":if(fg(Q)===0)break e;case"keydown":case"keyup":Cn=Cxo;break;case"focusin":Po="focus",Cn=mNe;break;case"focusout":Po="blur",Cn=mNe;break;case"beforeblur":case"afterblur":Cn=mNe;break;case"click":if(Q.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Cn=P2t;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Cn=lxo;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Cn=Pxo;break;case k2t:case L2t:case H2t:Cn=uxo;break;case F2t:Cn=Mxo;break;case"scroll":case"scrollend":Cn=axo;break;case"wheel":Cn=Bxo;break;case"copy":case"cut":case"paste":Cn=mxo;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Cn=M2t;break;case"submit":Cn=vxo;break;case"toggle":case"beforetoggle":Cn=Dxo}var Sr=(w&4)!==0,mi=!Sr&&(S==="scroll"||S==="scrollend"),wa=Sr?on!==null?on+"Capture":null:on;Sr=[];for(var Jt=_t,en;Jt!==null;){var sn=Jt;if(en=sn.stateNode,sn=sn.tag,sn!==5&&sn!==26&&sn!==27||en===null||wa===null||(sn=Tf(Jt,wa),sn!=null&&Sr.push(Xf(Jt,sn,en))),mi)break;Jt=Jt.return}0<Sr.length&&(on=new Cn(on,Po,null,Q,Yt),rn.push({event:on,listeners:Sr}))}}if((w&7)===0){e:{if(Cn=S==="mouseover"||S==="pointerover",on=S==="mouseout"||S==="pointerout",Cn&&Q!==cn&&(Po=Q.relatedTarget||Q.fromElement)&&(bn(Po)||Po[p9]))break e;if(on||Cn){if(Po=Yt.window===Yt?Yt:(Cn=Yt.ownerDocument)?Cn.defaultView||Cn.parentWindow:window,on){if(Cn=Q.relatedTarget||Q.toElement,on=_t,Cn=Cn?bn(Cn):null,Cn!==null&&(mi=g(Cn),Sr=Cn.tag,Cn!==mi||Sr!==5&&Sr!==27&&Sr!==6))Cn=null}else on=null,Cn=_t;if(on!==Cn){if(Sr=P2t,sn="onMouseLeave",wa="onMouseEnter",Jt="mouse",S==="pointerout"||S==="pointerover")Sr=M2t,sn="onPointerLeave",wa="onPointerEnter",Jt="pointer";mi=on==null?Po:wn(on),en=Cn==null?Po:wn(Cn),Po=new Sr(sn,Jt+"leave",on,Q,Yt),Po.target=mi,Po.relatedTarget=en,sn=null,bn(Yt)===_t&&(Sr=new Sr(wa,Jt+"enter",Cn,Q,Yt),Sr.target=en,Sr.relatedTarget=mi,sn=Sr),mi=sn,Sr=on&&Cn?V(on,Cn,wF):null,on!==null&&SA(rn,Po,on,Sr,!1),Cn!==null&&mi!==null&&SA(rn,mi,Cn,Sr,!0)}}}e:{if(on=_t?wn(_t):window,Cn=on.nodeName&&on.nodeName.toLowerCase(),Cn==="select"||Cn==="input"&&on.type==="file")var jn=_d;else if(dI(on))if(R2t)jn=wC;else{jn=MC;var zo=AA}else Cn=on.nodeName,!Cn||Cn.toLowerCase()!=="input"||on.type!=="checkbox"&&on.type!=="radio"?_t&&ua(_t.elementType)&&(jn=_d):jn=dD;if(jn&&(jn=jn(S,_t))){Ud(rn,jn,Q,Yt);break e}zo&&zo(S,on,_t)}switch(zo=_t?wn(_t):window,S){case"focusin":if(dI(zo)||zo.contentEditable==="true")WW=zo,gNe=_t,Foe=null;break;case"focusout":Foe=gNe=WW=null;break;case"mousedown":ANe=!0;break;case"contextmenu":case"mouseup":case"dragend":ANe=!1,ey(rn,Q,Yt);break;case"selectionchange":if(kxo)break;case"keydown":case"keyup":ey(rn,Q,Yt)}var is;if(_Ne)e:{switch(S){case"compositionstart":var _i="onCompositionStart";break e;case"compositionend":_i="onCompositionEnd";break e;case"compositionupdate":_i="onCompositionUpdate";break e}_i=void 0}else UW?N2(S,Q)&&(_i="onCompositionEnd"):S==="keydown"&&Q.keyCode===w2t&&(_i="onCompositionStart");if(_i&&(B2t&&Q.locale!=="ko"&&(UW||_i!=="onCompositionStart"?_i==="onCompositionEnd"&&UW&&(is=lp()):(os=Yt,Lh=("value"in os)?os.value:os.textContent,UW=!0)),zo=nb(_t,_i),0<zo.length&&(_i=new E2t(_i,S,null,Q,Yt),rn.push({event:_i,listeners:zo}),is?_i.data=is:(is=J1(Q),is!==null&&(_i.data=is)))),is=Rxo?hI(S,Q):L0(S,Q))_i=nb(_t,"onBeforeInput"),0<_i.length&&(zo=new gxo("onBeforeInput","beforeinput",null,Q,Yt),rn.push({event:zo,listeners:_i}),zo.data=is);_N(rn,S,_t,Q,Yt)}Mg(rn,w)})}function Xf(S,w,Q){return{instance:S,listener:w,currentTarget:Q}}function nb(S,w){for(var Q=w+"Capture",W=[];S!==null;){var oe=S,ae=oe.stateNode;if(oe=oe.tag,oe!==5&&oe!==26&&oe!==27||ae===null||(oe=Tf(S,Q),oe!=null&&W.unshift(Xf(S,oe,ae)),oe=Tf(S,w),oe!=null&&W.push(Xf(S,oe,ae))),S.tag===3)return W;S=S.return}return[]}function wF(S){if(S===null)return null;do S=S.return;while(S&&S.tag!==5&&S.tag!==27);return S?S:null}function SA(S,w,Q,W,oe){for(var ae=w._reactName,De=[];Q!==null&&Q!==W;){var Qe=Q,ot=Qe.alternate,_t=Qe.stateNode;if(Qe=Qe.tag,ot!==null&&ot===W)break;Qe!==5&&Qe!==26&&Qe!==27||_t===null||(ot=_t,oe?(_t=Tf(Q,ae),_t!=null&&De.unshift(Xf(Q,_t,ot))):oe||(_t=Tf(Q,ae),_t!=null&&De.push(Xf(Q,_t,ot)))),Q=Q.return}De.length!==0&&S.push({event:w,listeners:De})}function jf(S,w){wh(S,w),S!=="input"&&S!=="textarea"&&S!=="select"||w==null||w.value!==null||vr||(vr=!0,S==="select"&&w.multiple?console.error("`value` prop on `%s` should not be null. Consider using an empty array when `multiple` is set to `true` to clear the component or `undefined` for uncontrolled components.",S):console.error("`value` prop on `%s` should not be null. Consider using an empty string to clear the component or `undefined` for uncontrolled components.",S));var Q={registrationNameDependencies:g9,possibleRegistrationNames:UF};ua(S)||typeof w.is==="string"||Yd(S,w,Q),w.contentEditable&&!w.suppressContentEditableWarning&&w.children!=null&&console.error("A component is `contentEditable` and contains `children` managed by React. It is now your responsibility to guarantee that none of those nodes are unexpectedly modified or duplicated. This is probably not intentional.")}function Sc(S,w,Q,W){w!==Q&&(Q=La(Q),La(w)!==Q&&(W[S]=w))}function Cu(S){return!!(S.getAttribute("vt-share")||S.getAttribute("vt-exit")||S.getAttribute("vt-enter")||S.getAttribute("vt-update"))}function $a(S){if(!Cu(S))return!1;var w=S.getAttribute("vt-name");return S=S.style["view-transition-name"],w?w===S:S.startsWith("_T_")}function xy(S,w,Q){w.forEach(function(W){W==="style"?S.getAttribute(W)!==""&&(W=S.style,(W.length===1&&W[0]==="view-transition-name"||W.length===2&&W[0]==="view-transition-class"&&W[1]==="view-transition-name")&&$a(S)||(Q.style=Cl(S))):Q[Mm(W)]=S.getAttribute(W)})}function bu(S,w){w===!1?console.error("Expected `%s` listener to be a function, instead got `false`.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.",S,S,S):console.error("Expected `%s` listener to be a function, instead got a value of `%s` type.",S,typeof w)}function ob(S,w){return S=S.namespaceURI===Ce||S.namespaceURI===Te?S.ownerDocument.createElementNS(S.namespaceURI,S.tagName):S.ownerDocument.createElement(S.tagName),S.innerHTML=w,S.innerHTML}function La(S){return ke(S)&&(console.error("The provided HTML markup uses a value of unsupported type %s. This value must be coerced to a string before using it here.",Ne(S)),nt(S)),(typeof S==="string"?S:""+S).replace(l5o,`
`).replace(h5o,"")}function TM(S,w){return w=La(w),La(S)===w?!0:!1}function xl(S,w,Q,W,oe,ae){switch(Q){case"children":if(typeof W==="string")o0(W,w,!1),w==="body"||w==="textarea"&&W===""||Zi(S,W);else if(typeof W==="number"||typeof W==="bigint")o0(""+W,w,!1),w!=="body"&&Zi(S,""+W);else return;break;case"className":je(S,"class",W);break;case"tabIndex":je(S,"tabindex",W);break;case"dir":case"role":case"viewBox":case"width":case"height":je(S,Q,W);break;case"style":zc(S,W,ae);return;case"data":if(w!=="object"){je(S,"data",W);break}case"src":case"href":if(W===""&&(w!=="a"||Q!=="href")){Q==="src"?console.error('An empty string ("") was passed to the %s attribute. This may cause the browser to download the whole page again over the network. To fix this, either do not render the element at all or pass null to %s instead of an empty string.',Q,Q):console.error('An empty string ("") was passed to the %s attribute. To fix this, either do not render the element at all or pass null to %s instead of an empty string.',Q,Q),S.removeAttribute(Q);break}if(W==null||typeof W==="function"||typeof W==="symbol"||typeof W==="boolean"){S.removeAttribute(Q);break}dt(W,Q),W=Bh(W),S.setAttribute(Q,W);break;case"action":case"formAction":if(W!=null&&(w==="form"?Q==="formAction"?console.error("You can only pass the formAction prop to <input> or <button>. Use the action prop on <form>."):typeof W==="function"&&(oe.encType==null&&oe.method==null||kge||(kge=!0,console.error("Cannot specify a encType or method for a form that specifies a function as the action. React provides those automatically. They will get overridden.")),oe.target==null||Qge||(Qge=!0,console.error("Cannot specify a target for a form that specifies a function as the action. The function will always be executed in the same window."))):w==="input"||w==="button"?Q==="action"?console.error("You can only pass the action prop to <form>. Use the formAction prop on <input> or <button>."):w!=="input"||oe.type==="submit"||oe.type==="image"||Rge?w!=="button"||oe.type==null||oe.type==="submit"||Rge?typeof W==="function"&&(oe.name==null||ayt||(ayt=!0,console.error('Cannot specify a "name" prop for a button that specifies a function as a formAction. React needs it to encode which action should be invoked. It will get overridden.')),oe.formEncType==null&&oe.formMethod==null||kge||(kge=!0,console.error("Cannot specify a formEncType or formMethod for a button that specifies a function as a formAction. React provides those automatically. They will get overridden.")),oe.formTarget==null||Qge||(Qge=!0,console.error("Cannot specify a formTarget for a button that specifies a function as a formAction. The function will always be executed in the same window."))):(Rge=!0,console.error('A button can only specify a formAction along with type="submit" or no type.')):(Rge=!0,console.error('An input can only specify a formAction along with type="submit" or type="image".')):Q==="action"?console.error("You can only pass the action prop to <form>."):console.error("You can only pass the formAction prop to <input> or <button>.")),typeof W==="function"){S.setAttribute(Q,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof ae==="function"&&(Q==="formAction"?(w!=="input"&&xl(S,w,"name",oe.name,oe,null),xl(S,w,"formEncType",oe.formEncType,oe,null),xl(S,w,"formMethod",oe.formMethod,oe,null),xl(S,w,"formTarget",oe.formTarget,oe,null)):(xl(S,w,"encType",oe.encType,oe,null),xl(S,w,"method",oe.method,oe,null),xl(S,w,"target",oe.target,oe,null)));if(W==null||typeof W==="symbol"||typeof W==="boolean"){S.removeAttribute(Q);break}dt(W,Q),W=Bh(W),S.setAttribute(Q,W);break;case"onClick":W!=null&&(typeof W!=="function"&&bu(Q,W),S.onclick=Gd);return;case"onScroll":W!=null&&(typeof W!=="function"&&bu(Q,W),Xs("scroll",S));return;case"onScrollEnd":W!=null&&(typeof W!=="function"&&bu(Q,W),Xs("scrollend",S));return;case"dangerouslySetInnerHTML":if(W!=null){if(typeof W!=="object"||!("__html"in W))throw Error("`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://react.dev/link/dangerously-set-inner-html for more information.");if(Q=W.__html,Q!=null){if(oe.children!=null)throw Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`.");(ae!=null?ae.__html:void 0)!==Q&&(S.innerHTML=Q)}}break;case"multiple":S.multiple=W&&typeof W!=="function"&&typeof W!=="symbol";break;case"muted":S.muted=W&&typeof W!=="function"&&typeof W!=="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(W==null||typeof W==="function"||typeof W==="boolean"||typeof W==="symbol"){S.removeAttribute("xlink:href");break}dt(W,Q),Q=Bh(W),S.setAttributeNS(uz,"xlink:href",Q);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":W!=null&&typeof W!=="function"&&typeof W!=="symbol"?(dt(W,Q),S.setAttribute(Q,W)):S.removeAttribute(Q);break;case"inert":W!==""||Lge[Q]||(Lge[Q]=!0,console.error("Received an empty string for a boolean attribute `%s`. This will treat the attribute as if it were false. Either pass `false` to silence this warning, or pass `true` if you used an empty string in earlier versions of React to indicate this attribute is true.",Q));case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":W&&typeof W!=="function"&&typeof W!=="symbol"?S.setAttribute(Q,""):S.removeAttribute(Q);break;case"capture":case"download":W===!0?S.setAttribute(Q,""):W!==!1&&W!=null&&typeof W!=="function"&&typeof W!=="symbol"?(dt(W,Q),S.setAttribute(Q,W)):S.removeAttribute(Q);break;case"cols":case"rows":case"size":case"span":W!=null&&typeof W!=="function"&&typeof W!=="symbol"&&!isNaN(W)&&1<=W?(dt(W,Q),S.setAttribute(Q,W)):S.removeAttribute(Q);break;case"rowSpan":case"start":W==null||typeof W==="function"||typeof W==="symbol"||isNaN(W)?S.removeAttribute(Q):(dt(W,Q),S.setAttribute(Q,W));break;case"popover":Xs("beforetoggle",S),Xs("toggle",S),Zt(S,"popover",W);break;case"xlinkActuate":Mt(S,uz,"xlink:actuate",W);break;case"xlinkArcrole":Mt(S,uz,"xlink:arcrole",W);break;case"xlinkRole":Mt(S,uz,"xlink:role",W);break;case"xlinkShow":Mt(S,uz,"xlink:show",W);break;case"xlinkTitle":Mt(S,uz,"xlink:title",W);break;case"xlinkType":Mt(S,uz,"xlink:type",W);break;case"xmlBase":Mt(S,_Re,"xml:base",W);break;case"xmlLang":Mt(S,_Re,"xml:lang",W);break;case"xmlSpace":Mt(S,_Re,"xml:space",W);break;case"is":ae!=null&&console.error('Cannot update the "is" prop after it has been initialized.'),Zt(S,"is",W);break;case"innerText":case"textContent":return;case"popoverTarget":cyt||W==null||typeof W!=="object"||(cyt=!0,console.error("The `popoverTarget` prop expects the ID of an Element as a string. Received %s instead.",W));default:if(!(2<Q.length)||Q[0]!=="o"&&Q[0]!=="O"||Q[1]!=="n"&&Q[1]!=="N")Q=ri(Q),Zt(S,Q,W);else{g9.hasOwnProperty(Q)&&W!=null&&typeof W!=="function"&&bu(Q,W);return}}Zc=!0}function BF(S,w,Q,W,oe,ae){switch(Q){case"style":zc(S,W,ae);return;case"dangerouslySetInnerHTML":if(W!=null){if(typeof W!=="object"||!("__html"in W))throw Error("`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://react.dev/link/dangerously-set-inner-html for more information.");if(Q=W.__html,Q!=null){if(oe.children!=null)throw Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`.");(ae!=null?ae.__html:void 0)!==Q&&(S.innerHTML=Q)}}break;case"children":if(typeof W==="string")Zi(S,W);else if(typeof W==="number"||typeof W==="bigint")Zi(S,""+W);else return;break;case"onScroll":W!=null&&(typeof W!=="function"&&bu(Q,W),Xs("scroll",S));return;case"onScrollEnd":W!=null&&(typeof W!=="function"&&bu(Q,W),Xs("scrollend",S));return;case"onClick":W!=null&&(typeof W!=="function"&&bu(Q,W),S.onclick=Gd);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(g9.hasOwnProperty(Q))W!=null&&typeof W!=="function"&&bu(Q,W);else e:{if(Q[0]==="o"&&Q[1]==="n"&&(oe=Q.endsWith("Capture"),ae=Q.slice(2,oe?Q.length-7:void 0),w=S[TA]||null,w=w!=null?w[Q]:null,typeof w==="function"&&S.removeEventListener(ae,w,oe),typeof W==="function")){typeof w!=="function"&&w!==null&&(Q in S?S[Q]=null:S.hasAttribute(Q)&&S.removeAttribute(Q)),S.addEventListener(ae,W,oe);break e}Zc=!0,Q in S?S[Q]=W:W===!0?S.setAttribute(Q,""):Zt(S,Q,W)}return}Zc=!0}function Vp(S,w,Q){switch(jf(w,Q),w){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Xs("error",S),Xs("load",S);var W=!1,oe=!1,ae;for(ae in Q)if(Q.hasOwnProperty(ae)){var De=Q[ae];if(De!=null)switch(ae){case"src":W=!0;break;case"srcSet":oe=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(w+" is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.");default:xl(S,w,ae,De,Q,null)}}oe&&xl(S,w,"srcSet",Q.srcSet,Q,null),W&&xl(S,w,"src",Q.src,Q,null);return;case"input":ir("input",Q),Xs("invalid",S);var Qe=ae=De=oe=null,ot=null,_t=null;for(W in Q)if(Q.hasOwnProperty(W)){var Yt=Q[W];if(Yt!=null)switch(W){case"name":oe=Yt;break;case"type":De=Yt;break;case"checked":ot=Yt;break;case"defaultChecked":_t=Yt;break;case"value":ae=Yt;break;case"defaultValue":Qe=Yt;break;case"children":case"dangerouslySetInnerHTML":if(Yt!=null)throw Error(w+" is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.");break;default:xl(S,w,W,Yt,Q,null)}}ho(S,Q),Nn(S,ae,Qe,ot,_t,De,oe,!1);return;case"select":ir("select",Q),Xs("invalid",S),W=De=ae=null;for(oe in Q)if(Q.hasOwnProperty(oe)&&(Qe=Q[oe],Qe!=null))switch(oe){case"value":ae=Qe;break;case"defaultValue":De=Qe;break;case"multiple":W=Qe;default:xl(S,w,oe,Qe,Q,null)}rr(S,Q),w=ae,Q=De,S.multiple=!!W,w!=null?Wo(S,!!W,w,!1):Q!=null&&Wo(S,!!W,Q,!0);return;case"textarea":ir("textarea",Q),Xs("invalid",S),ae=oe=W=null;for(De in Q)if(Q.hasOwnProperty(De)&&(Qe=Q[De],Qe!=null))switch(De){case"value":W=Qe;break;case"defaultValue":oe=Qe;break;case"children":ae=Qe;break;case"dangerouslySetInnerHTML":if(Qe!=null)throw Error("`dangerouslySetInnerHTML` does not make sense on <textarea>.");break;default:xl(S,w,De,Qe,Q,null)}xr(S,Q),ea(S,W,oe,ae);return;case"option":Io(S,Q);for(ot in Q)if(Q.hasOwnProperty(ot)&&(W=Q[ot],W!=null))switch(ot){case"selected":S.selected=W&&typeof W!=="function"&&typeof W!=="symbol";break;default:xl(S,w,ot,W,Q,null)}return;case"dialog":Xs("beforetoggle",S),Xs("toggle",S),Xs("cancel",S),Xs("close",S);break;case"iframe":case"object":Xs("load",S);break;case"video":case"audio":for(W=0;W<yre.length;W++)Xs(yre[W],S);break;case"image":Xs("error",S),Xs("load",S);break;case"details":Xs("toggle",S);break;case"embed":case"source":case"link":Xs("error",S),Xs("load",S);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(_t in Q)if(Q.hasOwnProperty(_t)&&(W=Q[_t],W!=null))switch(_t){case"children":case"dangerouslySetInnerHTML":throw Error(w+" is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.");default:xl(S,w,_t,W,Q,null)}return;default:if(ua(w)){for(Yt in Q)Q.hasOwnProperty(Yt)&&(W=Q[Yt],W!==void 0&&BF(S,w,Yt,W,Q,void 0));return}}for(Qe in Q)Q.hasOwnProperty(Qe)&&(W=Q[Qe],W!=null&&xl(S,w,Qe,W,Q,null))}function foe(S,w,Q,W){switch(jf(w,W),w){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var oe=null,ae=null,De=null,Qe=null,ot=null,_t=null,Yt=null;for(Cn in Q){var rn=Q[Cn];if(Q.hasOwnProperty(Cn)&&rn!=null)switch(Cn){case"checked":break;case"value":break;case"defaultValue":ot=rn;default:W.hasOwnProperty(Cn)||xl(S,w,Cn,null,W,rn)}}for(var on in W){var Cn=W[on];if(rn=Q[on],W.hasOwnProperty(on)&&(Cn!=null||rn!=null))switch(on){case"type":Cn!==rn&&(Zc=!0),ae=Cn;break;case"name":Cn!==rn&&(Zc=!0),oe=Cn;break;case"checked":Cn!==rn&&(Zc=!0),_t=Cn;break;case"defaultChecked":Cn!==rn&&(Zc=!0),Yt=Cn;break;case"value":Cn!==rn&&(Zc=!0),De=Cn;break;case"defaultValue":Cn!==rn&&(Zc=!0),Qe=Cn;break;case"children":case"dangerouslySetInnerHTML":if(Cn!=null)throw Error(w+" is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.");break;default:Cn!==rn&&xl(S,w,on,Cn,W,rn)}}w=Q.type==="checkbox"||Q.type==="radio"?Q.checked!=null:Q.value!=null,W=W.type==="checkbox"||W.type==="radio"?W.checked!=null:W.value!=null,w||!W||syt||(console.error("A component is changing an uncontrolled input to be controlled. This is likely caused by the value changing from undefined to a defined value, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://react.dev/link/controlled-components"),syt=!0),!w||W||iyt||(console.error("A component is changing a controlled input to be uncontrolled. This is likely caused by the value changing from a defined to undefined, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://react.dev/link/controlled-components"),iyt=!0),Qo(S,De,Qe,ot,_t,Yt,ae,oe);return;case"select":Cn=De=Qe=on=null;for(ae in Q)if(ot=Q[ae],Q.hasOwnProperty(ae)&&ot!=null)switch(ae){case"value":break;case"multiple":Cn=ot;default:W.hasOwnProperty(ae)||xl(S,w,ae,null,W,ot)}for(oe in W)if(ae=W[oe],ot=Q[oe],W.hasOwnProperty(oe)&&(ae!=null||ot!=null))switch(oe){case"value":ae!==ot&&(Zc=!0),on=ae;break;case"defaultValue":ae!==ot&&(Zc=!0),Qe=ae;break;case"multiple":ae!==ot&&(Zc=!0),De=ae;default:ae!==ot&&xl(S,w,oe,ae,W,ot)}W=Qe,w=De,Q=Cn,on!=null?Wo(S,!!w,on,!1):!!Q!==!!w&&(W!=null?Wo(S,!!w,W,!0):Wo(S,!!w,w?[]:"",!1));return;case"textarea":Cn=on=null;for(Qe in Q)if(oe=Q[Qe],Q.hasOwnProperty(Qe)&&oe!=null&&!W.hasOwnProperty(Qe))switch(Qe){case"value":break;case"children":break;default:xl(S,w,Qe,null,W,oe)}for(De in W)if(oe=W[De],ae=Q[De],W.hasOwnProperty(De)&&(oe!=null||ae!=null))switch(De){case"value":oe!==ae&&(Zc=!0),on=oe;break;case"defaultValue":oe!==ae&&(Zc=!0),Cn=oe;break;case"children":break;case"dangerouslySetInnerHTML":if(oe!=null)throw Error("`dangerouslySetInnerHTML` does not make sense on <textarea>.");break;default:oe!==ae&&xl(S,w,De,oe,W,ae)}Ci(S,on,Cn);return;case"option":for(var Po in Q)if(on=Q[Po],Q.hasOwnProperty(Po)&&on!=null&&!W.hasOwnProperty(Po))switch(Po){case"selected":S.selected=!1;break;default:xl(S,w,Po,null,W,on)}for(ot in W)if(on=W[ot],Cn=Q[ot],W.hasOwnProperty(ot)&&on!==Cn&&(on!=null||Cn!=null))switch(ot){case"selected":on!==Cn&&(Zc=!0),S.selected=on&&typeof on!=="function"&&typeof on!=="symbol";break;default:xl(S,w,ot,on,W,Cn)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Sr in Q)on=Q[Sr],Q.hasOwnProperty(Sr)&&on!=null&&!W.hasOwnProperty(Sr)&&xl(S,w,Sr,null,W,on);for(_t in W)if(on=W[_t],Cn=Q[_t],W.hasOwnProperty(_t)&&on!==Cn&&(on!=null||Cn!=null))switch(_t){case"children":case"dangerouslySetInnerHTML":if(on!=null)throw Error(w+" is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.");break;default:xl(S,w,_t,on,W,Cn)}return;default:if(ua(w)){for(var mi in Q)on=Q[mi],Q.hasOwnProperty(mi)&&on!==void 0&&!W.hasOwnProperty(mi)&&BF(S,w,mi,void 0,W,on);for(Yt in W)on=W[Yt],Cn=Q[Yt],!W.hasOwnProperty(Yt)||on===Cn||on===void 0&&Cn===void 0||BF(S,w,Yt,on,W,Cn);return}}for(var wa in Q)on=Q[wa],Q.hasOwnProperty(wa)&&on!=null&&!W.hasOwnProperty(wa)&&xl(S,w,wa,null,W,on);for(rn in W)on=W[rn],Cn=Q[rn],!W.hasOwnProperty(rn)||on===Cn||on==null&&Cn==null||xl(S,w,rn,on,W,Cn)}function Mm(S){switch(S){case"class":return"className";case"for":return"htmlFor";default:return S}}function Cl(S){for(var w={},Q=S.style,W=0;W<Q.length;W++){var oe=Q[W];oe==="view-transition-name"&&$a(S)||(w[oe]=Q.getPropertyValue(oe))}return w}function o7(S,w,Q){if(w!=null&&typeof w!=="object")console.error("The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.");else{var W,oe=W="",ae;for(ae in w)if(w.hasOwnProperty(ae)){var De=w[ae];De!=null&&typeof De!=="boolean"&&De!==""&&(ae.indexOf("--")===0?(rt(De,ae),W+=oe+ae+":"+(""+De).trim()):typeof De!=="number"||De===0||pe.has(ae)?(rt(De,ae),W+=oe+ae.replace(Toe,"-$1").toLowerCase().replace(Doe,"-ms-")+":"+(""+De).trim()):W+=oe+ae.replace(Toe,"-$1").toLowerCase().replace(Doe,"-ms-")+":"+De+"px",oe=";")}W=W||null,w=S.getAttribute("style"),w!==W&&(W=La(W),w=La(w),w===W||w[w.length-1]===";"&&Cu(S)||(Q.style=Cl(S)))}}function __(S,w,Q,W,oe,ae){if(oe.delete(Q),S=S.getAttribute(Q),S===null)switch(typeof W){case"undefined":case"function":case"symbol":case"boolean":return}else if(W!=null)switch(typeof W){case"function":case"symbol":case"boolean":break;default:if(dt(W,w),S===""+W)return}Sc(w,S,W,ae)}function gN(S,w,Q,W,oe,ae){if(oe.delete(Q),S=S.getAttribute(Q),S===null){switch(typeof W){case"function":case"symbol":return}if(!W)return}else switch(typeof W){case"function":case"symbol":break;default:if(W)return}Sc(w,S,W,ae)}function $I(S,w,Q,W,oe,ae){if(oe.delete(Q),S=S.getAttribute(Q),S===null)switch(typeof W){case"undefined":case"function":case"symbol":return}else if(W!=null)switch(typeof W){case"function":case"symbol":break;default:if(dt(W,Q),S===""+W)return}Sc(w,S,W,ae)}function qI(S,w,Q,W,oe,ae){if(oe.delete(Q),S=S.getAttribute(Q),S===null)switch(typeof W){case"undefined":case"function":case"symbol":case"boolean":return;default:if(isNaN(W))return}else if(W!=null)switch(typeof W){case"function":case"symbol":case"boolean":break;default:if(!isNaN(W)&&(dt(W,w),S===""+W))return}Sc(w,S,W,ae)}function Wx(S,w,Q,W,oe,ae){if(oe.delete(Q),S=S.getAttribute(Q),S===null)switch(typeof W){case"undefined":case"function":case"symbol":case"boolean":return}else if(W!=null)switch(typeof W){case"function":case"symbol":case"boolean":break;default:if(dt(W,w),Q=Bh(""+W),S===Q)return}Sc(w,S,W,ae)}function H4(S,w,Q,W){for(var oe={},ae=new Set,De=S.attributes,Qe=0;Qe<De.length;Qe++)switch(De[Qe].name.toLowerCase()){case"value":break;case"checked":break;case"selected":break;case"vt-name":case"vt-update":case"vt-enter":case"vt-exit":case"vt-share":case"vt-parent-enter":case"vt-parent-exit":break;default:ae.add(De[Qe].name)}if(ua(w)){for(var ot in Q)if(Q.hasOwnProperty(ot)){var _t=Q[ot];if(_t!=null){if(g9.hasOwnProperty(ot))typeof _t!=="function"&&bu(ot,_t);else if(Q.suppressHydrationWarning!==!0)switch(ot){case"children":typeof _t!=="string"&&typeof _t!=="number"||Sc("children",S.textContent,_t,oe);continue;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":continue;case"dangerouslySetInnerHTML":De=S.innerHTML,_t=_t?_t.__html:void 0,_t!=null&&(_t=ob(S,_t),Sc(ot,De,_t,oe));continue;case"style":ae.delete(ot),o7(S,_t,oe);continue;case"offsetParent":case"offsetTop":case"offsetLeft":case"offsetWidth":case"offsetHeight":case"isContentEditable":case"outerText":case"outerHTML":ae.delete(ot.toLowerCase()),console.error("Assignment to read-only property will result in a no-op: `%s`",ot);continue;case"className":ae.delete("class"),De=Ot(S,"class",_t),Sc("className",De,_t,oe);continue;default:W.context===ow&&w!=="svg"&&w!=="math"?ae.delete(ot.toLowerCase()):ae.delete(ot),De=Ot(S,ot,_t),Sc(ot,De,_t,oe)}}}}else for(_t in Q)if(Q.hasOwnProperty(_t)&&(ot=Q[_t],ot!=null)){if(g9.hasOwnProperty(_t))typeof ot!=="function"&&bu(_t,ot);else if(Q.suppressHydrationWarning!==!0)switch(_t){case"children":typeof ot!=="string"&&typeof ot!=="number"||Sc("children",S.textContent,ot,oe);continue;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"value":case"checked":case"selected":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":continue;case"dangerouslySetInnerHTML":De=S.innerHTML,ot=ot?ot.__html:void 0,ot!=null&&(ot=ob(S,ot),De!==ot&&(oe[_t]={__html:De}));continue;case"className":__(S,_t,"class",ot,ae,oe);continue;case"tabIndex":__(S,_t,"tabindex",ot,ae,oe);continue;case"style":ae.delete(_t),o7(S,ot,oe);continue;case"multiple":ae.delete(_t),Sc(_t,S.multiple,ot,oe);continue;case"muted":ae.delete(_t),Sc(_t,S.muted,ot,oe);continue;case"autoFocus":ae.delete("autofocus"),Sc(_t,S.autofocus,ot,oe);continue;case"data":if(w!=="object"){ae.delete(_t),De=S.getAttribute("data"),Sc(_t,De,ot,oe);continue}case"src":case"href":if(!(ot!==""||w==="a"&&_t==="href"||w==="object"&&_t==="data")){_t==="src"?console.error('An empty string ("") was passed to the %s attribute. This may cause the browser to download the whole page again over the network. To fix this, either do not render the element at all or pass null to %s instead of an empty string.',_t,_t):console.error('An empty string ("") was passed to the %s attribute. To fix this, either do not render the element at all or pass null to %s instead of an empty string.',_t,_t);continue}Wx(S,_t,_t,ot,ae,oe);continue;case"action":case"formAction":if(De=S.getAttribute(_t),typeof ot==="function"){ae.delete(_t.toLowerCase()),_t==="formAction"?(ae.delete("name"),ae.delete("formenctype"),ae.delete("formmethod"),ae.delete("formtarget")):(ae.delete("enctype"),ae.delete("method"),ae.delete("target"));continue}else if(De===u5o){ae.delete(_t.toLowerCase()),Sc(_t,"function",ot,oe);continue}Wx(S,_t,_t.toLowerCase(),ot,ae,oe);continue;case"xlinkHref":Wx(S,_t,"xlink:href",ot,ae,oe);continue;case"contentEditable":$I(S,_t,"contenteditable",ot,ae,oe);continue;case"spellCheck":$I(S,_t,"spellcheck",ot,ae,oe);continue;case"draggable":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":$I(S,_t,_t,ot,ae,oe);continue;case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":gN(S,_t,_t.toLowerCase(),ot,ae,oe);continue;case"capture":case"download":e:{Qe=S;var Yt=De=_t,rn=oe;if(ae.delete(Yt),Qe=Qe.getAttribute(Yt),Qe===null)switch(typeof ot){case"undefined":case"function":case"symbol":break e;default:if(ot===!1)break e}else if(ot!=null)switch(typeof ot){case"function":case"symbol":break;case"boolean":if(ot===!0&&Qe==="")break e;break;default:if(dt(ot,De),Qe===""+ot)break e}Sc(De,Qe,ot,rn)}continue;case"cols":case"rows":case"size":case"span":e:{if(Qe=S,Yt=De=_t,rn=oe,ae.delete(Yt),Qe=Qe.getAttribute(Yt),Qe===null)switch(typeof ot){case"undefined":case"function":case"symbol":case"boolean":break e;default:if(isNaN(ot)||1>ot)break e}else if(ot!=null)switch(typeof ot){case"function":case"symbol":case"boolean":break;default:if(!(isNaN(ot)||1>ot)&&(dt(ot,De),Qe===""+ot))break e}Sc(De,Qe,ot,rn)}continue;case"rowSpan":qI(S,_t,"rowspan",ot,ae,oe);continue;case"start":qI(S,_t,_t,ot,ae,oe);continue;case"xHeight":__(S,_t,"x-height",ot,ae,oe);continue;case"xlinkActuate":__(S,_t,"xlink:actuate",ot,ae,oe);continue;case"xlinkArcrole":__(S,_t,"xlink:arcrole",ot,ae,oe);continue;case"xlinkRole":__(S,_t,"xlink:role",ot,ae,oe);continue;case"xlinkShow":__(S,_t,"xlink:show",ot,ae,oe);continue;case"xlinkTitle":__(S,_t,"xlink:title",ot,ae,oe);continue;case"xlinkType":__(S,_t,"xlink:type",ot,ae,oe);continue;case"xmlBase":__(S,_t,"xml:base",ot,ae,oe);continue;case"xmlLang":__(S,_t,"xml:lang",ot,ae,oe);continue;case"xmlSpace":__(S,_t,"xml:space",ot,ae,oe);continue;case"inert":ot!==""||Lge[_t]||(Lge[_t]=!0,console.error("Received an empty string for a boolean attribute `%s`. This will treat the attribute as if it were false. Either pass `false` to silence this warning, or pass `true` if you used an empty string in earlier versions of React to indicate this attribute is true.",_t)),gN(S,_t,_t,ot,ae,oe);continue;default:if(!(2<_t.length)||_t[0]!=="o"&&_t[0]!=="O"||_t[1]!=="n"&&_t[1]!=="N"){Qe=ri(_t),De=!1,W.context===ow&&w!=="svg"&&w!=="math"?ae.delete(Qe.toLowerCase()):(Yt=_t.toLowerCase(),Yt=wt.hasOwnProperty(Yt)?wt[Yt]||null:null,Yt!==null&&Yt!==_t&&(De=!0,ae.delete(Yt)),ae.delete(Qe));e:if(Yt=S,rn=Qe,Qe=ot,xt(rn))if(Yt.hasAttribute(rn))Yt=rn.toLowerCase()==="nonce"?Yt.nonce:Yt.getAttribute(rn),dt(Qe,rn),Qe=Yt===""+Qe?Qe:Yt;else{switch(typeof Qe){case"function":case"symbol":break e;case"boolean":if(Yt=rn.toLowerCase().slice(0,5),Yt!=="data-"&&Yt!=="aria-")break e}Qe=Qe===void 0?void 0:null}else Qe=void 0;De||Sc(_t,Qe,ot,oe)}}}return 0<ae.size&&Q.suppressHydrationWarning!==!0&&xy(S,ae,oe),Object.keys(oe).length===0?null:oe}function yoe(S,w){switch(S.length){case 0:return"";case 1:return S[0];case 2:return S[0]+" "+w+" "+S[1];default:return S.slice(0,-1).join(", ")+", "+w+" "+S[S.length-1]}}function TF(S){switch(S){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function xoe(){if(typeof performance.getEntriesByType==="function"){for(var S=0,w=0,Q=performance.getEntriesByType("resource"),W=0;W<Q.length;W++){var oe=Q[W],{transferSize:ae,initiatorType:De,duration:Qe}=oe;if(ae&&Qe&&TF(De)){De=0,Qe=oe.responseEnd;for(W+=1;W<Q.length;W++){var ot=Q[W],_t=ot.startTime;if(_t>Qe)break;var Yt=ot.transferSize,rn=ot.initiatorType;Yt&&TF(rn)&&(ot=ot.responseEnd,De+=Yt*(ot<Qe?1:(Qe-_t)/(ot-_t)))}if(--W,w+=8*(ae+De)/(oe.duration/1000),S++,10<S)break}}if(0<S)return w/S/1e6}return navigator.connection&&(S=navigator.connection.downlink,typeof S==="number")?S:5}function Dh(S){return S.nodeType===9?S:S.ownerDocument}function JI(S){switch(S){case Te:return yX;case Ce:return Fge;default:return ow}}function DM(S,w){if(S===ow)switch(w){case"svg":return yX;case"math":return Fge;default:return ow}return S===yX&&w==="foreignObject"?ow:S}function g_(S,w,Q,W){return Q=Dh(Q).createElement(S),Q[_0]=W,Q[TA]=w,Vp(Q,S,w),mn(Q),Q}function rb(S){if(S=S.type,typeof S!=="string"||S==="")return!1;if(S=S.toLowerCase(),S==="module"||S==="importmap"||S==="speculationrules")return!1;switch(S){case"application/ecmascript":case"application/javascript":case"application/x-ecmascript":case"application/x-javascript":case"text/ecmascript":case"text/javascript":case"text/javascript1.0":case"text/javascript1.1":case"text/javascript1.2":case"text/javascript1.3":case"text/javascript1.4":case"text/javascript1.5":case"text/jscript":case"text/livescript":case"text/x-ecmascript":case"text/x-javascript":return!1}return!0}function r7(S,w){return S==="textarea"||S==="noscript"||typeof w.children==="string"||typeof w.children==="number"||typeof w.children==="bigint"||typeof w.dangerouslySetInnerHTML==="object"&&w.dangerouslySetInnerHTML!==null&&w.dangerouslySetInnerHTML.__html!=null}function AN(){var S=window.event;if(S&&S.type==="popstate"){if(S===yRe)return!1;return yRe=S,!0}return yRe=null,!1}function F4(){var S=window.event;return S&&S!==bre?S.type:null}function Kf(){var S=window.event;return S&&S!==bre?S.timeStamp:-1.1}function i7(S){setTimeout(function(){throw S})}function DF(S,w,Q){switch(w){case"button":case"input":case"select":case"textarea":Q.autoFocus&&S.focus();break;case"img":Q.src?S.src=Q.src:Q.srcSet&&(S.srcset=Q.srcSet)}}function fN(){}function yN(S,w,Q,W){foe(S,w,Q,W),S[TA]=W}function ZI(S){Zi(S,"")}function NF(S,w,Q){S.nodeValue=Q}function s7(S){if(!S.__reactWarnedAboutChildrenConflict){var w=S[TA]||null;if(w!==null){var Q=pn(S);Q!==null&&(typeof w.children==="string"||typeof w.children==="number"?(S.__reactWarnedAboutChildrenConflict=!0,ye(Q,function(){console.error('Cannot use a ref on a React element as a container to `createRoot` or `createPortal` if that element also sets "children" text content using React. It should be a leaf with no children. Otherwise it\'s ambiguous which children should be used.')})):w.dangerouslySetInnerHTML!=null&&(S.__reactWarnedAboutChildrenConflict=!0,ye(Q,function(){console.error('Cannot use a ref on a React element as a container to `createRoot` or `createPortal` if that element also sets "dangerouslySetInnerHTML" using React. It should be a leaf with no children. Otherwise it\'s ambiguous which children should be used.')})))}}}function Xx(S){return S==="head"}function e9(S,w){S.removeChild(w)}function a7(S,w){(S.nodeType===9?S.body:S.nodeName==="HTML"?S.ownerDocument.body:S).removeChild(w)}function RF(S,w){var Q=w,W=0;do{var oe=Q.nextSibling;if(S.removeChild(Q),oe&&oe.nodeType===8)if(Q=oe.data,Q===Cre||Q===Hge){if(W===0){S.removeChild(oe),$d(w);return}W--}else if(Q===xre||Q===eR||Q===mz||Q===fX||Q===pz)W++;else if(Q===m5o)ab(S.ownerDocument.documentElement);else if(Q===g5o){Q=S.ownerDocument.head,ab(Q);for(var ae=Q.firstChild;ae;){var De=ae.nextSibling,Qe=ae.nodeName;ae[Kx]||Qe==="SCRIPT"||Qe==="STYLE"||Qe==="LINK"&&ae.rel.toLowerCase()==="stylesheet"||Q.removeChild(ae),ae=De}}else Q===_5o&&ab(S.ownerDocument.body);Q=oe}while(Q);$d(w)}function z4(S,w){var Q=S;S=0;do{var W=Q.nextSibling;if(Q.nodeType===1?w?(Q._stashedDisplay=Q.style.display,Q.style.display="none"):(Q.style.display=Q._stashedDisplay||"",Q.getAttribute("style")===""&&Q.removeAttribute("style")):Q.nodeType===3&&(w?(Q._stashedText=Q.nodeValue,Q.nodeValue=""):Q.nodeValue=Q._stashedText||""),W&&W.nodeType===8)if(Q=W.data,Q===Cre)if(S===0)break;else S--;else Q!==xre&&Q!==eR&&Q!==mz&&Q!==fX||S++;Q=W}while(Q)}function wW(S){z4(S,!0)}function K2(S){S=S.style,typeof S.setProperty==="function"?S.setProperty("display","none","important"):S.display="none"}function c7(S){S.nodeValue=""}function l7(S){z4(S,!1)}function ib(S,w){w=w[dyt],w=w!==void 0&&w!==null&&w.hasOwnProperty("display")?w.display:null,S.style.display=w==null||typeof w==="boolean"?"":(""+w).trim()}function O4(S,w){S.nodeValue=w}function t9(S){for(var w=S.firstChild;w!=null;){if(w.nodeType===1&&getComputedStyle(w).display==="block"){var Q=pn(w)||pn(S);ye(Q,function(W,oe){console.error(`You're about to start a <ViewTransition> around a display: inline element <%s>, which itself has a display: block element <%s> inside it. This might trigger a bug in Safari which causes the View Transition to be skipped with a duplicate name error.
https://bugs.webkit.org/show_bug.cgi?id=290923`,W.toLocaleLowerCase(),oe.toLocaleLowerCase())},S.tagName,w.tagName);break}if(w.firstChild!=null)w=w.firstChild;else{if(w===S)break;for(;w.nextSibling==null&&w.parentNode!=null&&w.parentNode!==S;)w=w.parentNode;w=w.nextSibling}}}function n9(S,w,Q){if(w=CSS.escape(w)!==w?"r-"+btoa(w).replace(/=/g,""):w,S.style.viewTransitionName=w,Q!=null&&(S.style.viewTransitionClass=Q),Q=getComputedStyle(S),Q.display==="inline"){if(w=S.getClientRects(),w.length===1)var W=1;else for(var oe=W=0;oe<w.length;oe++){var ae=w[oe];0<ae.width&&0<ae.height&&W++}W===1?(S=S.style,S.display=w.length===1?"inline-block":"block",S.marginTop="-"+Q.paddingTop,S.marginBottom="-"+Q.paddingBottom):t9(S)}}function V4(S,w){S=S.style,w=w[dyt];var Q=w!=null?w.hasOwnProperty("viewTransitionName")?w.viewTransitionName:w.hasOwnProperty("view-transition-name")?w["view-transition-name"]:null:null;S.viewTransitionName=Q==null||typeof Q==="boolean"?"":(""+Q).trim(),Q=w!=null?w.hasOwnProperty("viewTransitionClass")?w.viewTransitionClass:w.hasOwnProperty("view-transition-class")?w["view-transition-class"]:null:null,S.viewTransitionClass=Q==null||typeof Q==="boolean"?"":(""+Q).trim(),S.display==="inline-block"&&(w==null?S.display=S.margin="":(Q=w.display,S.display=Q==null||typeof Q==="boolean"?"":Q,Q=w.margin,Q!=null?S.margin=Q:(Q=w.hasOwnProperty("marginTop")?w.marginTop:w["margin-top"],S.marginTop=Q==null||typeof Q==="boolean"?"":Q,w=w.hasOwnProperty("marginBottom")?w.marginBottom:w["margin-bottom"],S.marginBottom=w==null||typeof w==="boolean"?"":w)))}function h7(S,w,Q){return Q=Q.ownerDocument.defaultView,{rect:S,abs:w.position==="absolute"||w.position==="fixed",clip:w.clipPath!=="none"||w.overflow!=="visible"||w.filter!=="none"||w.mask!=="none"||w.mask!=="none"||w.borderRadius!=="0px",view:0<=S.bottom&&0<=S.right&&S.top<=Q.innerHeight&&S.left<=Q.innerWidth}}function d7(S){var w=S.getBoundingClientRect(),Q=getComputedStyle(S);return h7(w,Q,S)}function u7(S){var w=S.getBoundingClientRect();w=new DOMRect(w.x+20000,w.y+20000,w.width,w.height);var Q=getComputedStyle(S);return h7(w,Q,S)}function xN(S,w){if(typeof S==="object"&&S!==null)switch(S.name){case"TimeoutError":return Error("A ViewTransition timed out because a Navigation stalled. This can happen if a Navigation is blocked on React itself. Such as if it's resolved inside useEffect. This can be solved by moving the resolution to useLayoutEffect.",{cause:S});case"AbortError":return w?null:Error("A ViewTransition was aborted early. This might be because you have other View Transition libraries on the page and only one can run at a time. To avoid this, use only React's built-in <ViewTransition> to coordinate.",{cause:S});case"InvalidStateError":if(S.message==="View transition was skipped because document visibility state is hidden."||S.message==="Skipping view transition because document visibility state has become hidden."||S.message==="Skipping view transition because viewport size changed."||S.message==="Transition was aborted because of invalid state")return null}return S}function NM(S){return S.documentElement.clientHeight}function CN(S){this.addEventListener("load",S),this.addEventListener("error",S)}function p7(S,w,Q,W,oe,ae,De,Qe,ot,_t,Yt){var rn=w.nodeType===9?w:w.ownerDocument;try{var on=rn.startViewTransition({update:function(){var Po=rn.defaultView,Sr=Po.navigation&&Po.navigation.transition,mi=rn.fonts.status;W();var wa=[];if(mi==="loaded"&&(NM(rn),rn.fonts.status==="loading"&&wa.push(rn.fonts.ready)),mi=wa.length,S!==null)for(var Jt=S.suspenseyImages,en=0,sn=0;sn<Jt.length;sn++){var jn=Jt[sn];if(!jn.complete){var zo=jn.getBoundingClientRect();if(0<zo.bottom&&0<zo.right&&zo.top<Po.innerHeight&&zo.left<Po.innerWidth){if(en+=So(jn),en>Oge){wa.length=mi;break}jn=new Promise(CN.bind(jn)),wa.push(jn)}}}if(0<wa.length)return _t(0<mi?wa.length>mi?"Waiting on Fonts and Images":"Waiting on Fonts":"Waiting on Images"),Po=Promise.race([Promise.all(wa),new Promise(function(is){return setTimeout(is,y5o)})]).then(oe,oe),(Sr?Promise.allSettled([Sr.finished,Po]):Po).then(ae,ae);if(oe(),Sr)return Sr.finished.then(ae,ae);ae()},types:Q});rn.__reactViewTransition=on;var Cn=[];return on.ready.then(function(){for(var Po=rn.documentElement.getAnimations({subtree:!0}),Sr=0;Sr<Po.length;Sr++){var mi=Po[Sr],wa=mi.effect,Jt=wa.pseudoElement;if(Jt!=null&&Jt.startsWith("::view-transition")){Cn.push(mi),mi=wa.getKeyframes();for(var en=Jt=void 0,sn=!0,jn=0;jn<mi.length;jn++){var zo=mi[jn],is=zo.width;if(Jt===void 0)Jt=is;else if(Jt!==is){sn=!1;break}if(is=zo.height,en===void 0)en=is;else if(en!==is){sn=!1;break}delete zo.width,delete zo.height,zo.transform==="none"&&delete zo.transform}sn&&Jt!==void 0&&en!==void 0&&(wa.setKeyframes(mi),sn=getComputedStyle(wa.target,wa.pseudoElement),sn.width!==Jt||sn.height!==en)&&(sn=mi[0],sn.width=Jt,sn.height=en,sn=mi[mi.length-1],sn.width=Jt,sn.height=en,wa.setKeyframes(mi))}}De()},function(Po){rn.__reactViewTransition===on&&(rn.__reactViewTransition=null);try{Po=xN(Po,!1),Po!==null&&ot(Po)}finally{W(),oe(),De(),Yt()}}),on.finished.finally(function(){for(var Po=0;Po<Cn.length;Po++)Cn[Po].cancel();rn.__reactViewTransition===on&&(rn.__reactViewTransition=null),Yt(),Qe()}),on}catch(Po){return W(),oe(),Yt(),De(),null}}function wm(S,w){this._scope=document.documentElement,this._selector="::view-transition-"+S+"("+w+")"}function PA(S){return{name:S,group:new wm("group",S),imagePair:new wm("image-pair",S),old:new wm("old",S),new:new wm("new",S)}}function $h(S){this._fragmentFiber=S,this._observers=this._eventListeners=null}function Bm(S,w,Q,W){return N(S).addEventListener(w,Q,W),!1}function Ap(S,w,Q,W){return N(S).removeEventListener(w,Q,W),!1}function Nh(S){return S!=null&&typeof S!=="boolean"&&(S.once===!0||S.signal instanceof AbortSignal)?{capture:S.capture,passive:S.passive}:S}function A_(S){return S==null?"c=0":typeof S==="boolean"?"c="+(S?"1":"0"):"c="+(S.capture?"1":"0")}function Y4(S,w,Q,W){if(S.length===0)return-1;W=A_(W);for(var oe=0;oe<S.length;oe++){var ae=S[oe];if(ae.type===w&&ae.listener===Q&&A_(ae.optionsOrUseCapture)===W)return oe}return-1}function RM(S,w){if(S.tag===6)return!1;return S=N(S),$n(S,w)}function QM(S,w){return w.push(S),!1}function QF(S,w){if(S.tag===6)return!1;return S=N(S),S===w||S.contains(w)?(w.blur(),!0):!1}function kM(S,w){if(S.tag===6)return!1;return S=N(S),w.observe(S),!1}function kF(S,w){if(S.tag===6)return!1;return S=N(S),w.unobserve(S),!1}function G4(S,w,Q){v9.push({fragmentInstance:S,observer:w,instance:Q}),CRe||(CRe=!0,$f(function(){CRe=!1;var W=v9;v9=[];for(var oe=0;oe<W.length;oe++){var ae=W[oe];ae.observer.unobserve(ae.instance)}}))}function LF(S,w){if(S.tag===6){S=S.stateNode;var Q=S.ownerDocument.createRange();Q.selectNodeContents(S),w.push.apply(w,Q.getClientRects())}else S=N(S),w.push.apply(w,S.getClientRects());return!1}function HF(S,w,Q,W,oe){var ae=bn(oe);if(S&Node.DOCUMENT_POSITION_CONTAINED_BY){if(Q=!!ae)e:{for(;ae!==null;){if(ae.tag===7&&(ae===w||ae.alternate===w)){Q=!0;break e}ae=ae.return}Q=!1}return Q}if(S&Node.DOCUMENT_POSITION_CONTAINS){if(ae===null)return ae=oe.ownerDocument,oe===ae||oe===ae.documentElement||oe===ae.body;e:{ae=w;for(w=P(w);ae!==null;){if(!(ae.tag!==5&&ae.tag!==3&&ae.tag!==27||ae!==w&&ae.alternate!==w)){ae=!0;break e}ae=ae.return}ae=!1}return ae}return S&Node.DOCUMENT_POSITION_PRECEDING?((w=!!ae)&&!(w=ae===Q)&&(w=V(Q,ae,H),w===null?w=!1:(v(w,!0,D,ae,Q),ae=K4,K4=null,w=ae!==null)),w):S&Node.DOCUMENT_POSITION_FOLLOWING?((w=!!ae)&&!(w=ae===W)&&(w=V(W,ae,H),w===null?w=!1:(v(w,!0,L,ae,W),ae=K4,zM=K4=null,w=ae!==null)),w):!1}function bN(S,w){var Q=S.ownerDocument.createRange();Q.selectNodeContents(S),S=Q.getBoundingClientRect(),window.scrollTo(window.scrollX+S.left,w?window.scrollY+S.top:window.scrollY+S.bottom-window.innerHeight)}function m7(S,w){return S=N(S),_7(S,w),!1}function _7(S,w){S.reactFragments==null&&(S.reactFragments=new Set),S.reactFragments.add(w)}function o9(S,w){var Q=w._eventListeners;if(Q!==null)for(var W=0;W<Q.length;W++){var oe=Q[W];S.addEventListener(oe.type,oe.attachedListener,Nh(oe.optionsOrUseCapture))}S.nodeType!==3&&(Q=w._observers,Q!==null&&Q.forEach(function(ae){for(var De=0,Qe=0;Qe<v9.length;Qe++){var ot=v9[Qe];if(ot.fragmentInstance!==w||ot.observer!==ae||ot.instance!==S)v9[De++]=ot}v9.length=De,ae.observe(S)}),_7(S,w))}function BW(S,w){var Q=w._eventListeners;if(Q!==null)for(var W=0;W<Q.length;W++){var oe=Q[W];S.removeEventListener(oe.type,oe.attachedListener,Nh(oe.optionsOrUseCapture))}S.nodeType!==3&&(Q=w._observers,Q!==null&&Q.forEach(function(ae){typeof ae.rootMargin==="string"?G4(w,ae,S):ae.unobserve(S)}),S.reactFragments!=null&&S.reactFragments.delete(w))}function IN(S){var w=S.firstChild;w&&w.nodeType===10&&(w=w.nextSibling);for(;w;){var Q=w;switch(w=w.nextSibling,Q.nodeName){case"HTML":case"HEAD":case"BODY":IN(Q),Wt(Q);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(Q.rel.toLowerCase()==="stylesheet")continue}S.removeChild(Q)}}function LM(S,w,Q,W){for(;S.nodeType===1;){var oe=Q;if(S.nodeName.toLowerCase()!==w.toLowerCase()){if(!W&&(S.nodeName!=="INPUT"||S.type!=="hidden"))break}else if(!W)if(w==="input"&&S.type==="hidden"){dt(oe.name,"name");var ae=oe.name==null?null:""+oe.name;if(oe.type==="hidden"&&S.getAttribute("name")===ae)return S}else return S;else if(!S[Kx])switch(w){case"meta":if(!S.hasAttribute("itemprop"))break;return S;case"link":if(ae=S.getAttribute("rel"),ae==="stylesheet"&&S.hasAttribute("data-precedence"))break;else if(ae!==oe.rel||S.getAttribute("href")!==(oe.href==null||oe.href===""?null:oe.href)||S.getAttribute("crossorigin")!==(oe.crossOrigin==null?null:oe.crossOrigin)||S.getAttribute("title")!==(oe.title==null?null:oe.title))break;return S;case"style":if(S.hasAttribute("data-precedence"))break;return S;case"script":if(ae=S.getAttribute("src"),(ae!==(oe.src==null?null:oe.src)||S.getAttribute("type")!==(oe.type==null?null:oe.type)||S.getAttribute("crossorigin")!==(oe.crossOrigin==null?null:oe.crossOrigin))&&ae&&S.hasAttribute("async")&&!S.hasAttribute("itemprop"))break;return S;default:return S}if(S=Tm(S.nextSibling),S===null)break}return null}function TW(S,w,Q){if(w==="")return null;for(;S.nodeType!==3;){if((S.nodeType!==1||S.nodeName!=="INPUT"||S.type!=="hidden")&&!Q)return null;if(S=Tm(S.nextSibling),S===null)return null}return S}function U4(S,w){for(;S.nodeType!==8;){if((S.nodeType!==1||S.nodeName!=="INPUT"||S.type!=="hidden")&&!w)return null;if(S=Tm(S.nextSibling),S===null)return null}return S}function Ji(S){return S.data===eR||S.data===mz}function ll(S){return S.data===fX||S.data===eR&&S.ownerDocument.readyState!==hyt}function d0(S,w){var Q=S.ownerDocument;if(S.data===mz)S._reactRetry=w;else if(S.data!==eR||Q.readyState!==hyt)w();else{var W=function(){w(),Q.removeEventListener("DOMContentLoaded",W)};Q.addEventListener("DOMContentLoaded",W),S._reactRetry=W}}function Tm(S){for(;S!=null;S=S.nextSibling){var w=S.nodeType;if(w===1||w===3)break;if(w===8){if(w=S.data,w===xre||w===fX||w===eR||w===mz||w===pz||w===gRe||w===lyt)break;if(w===Cre||w===Hge)return null}}return S}function sb(S){if(S.nodeType===1){for(var w=S.nodeName.toLowerCase(),Q={},W=S.attributes,oe=0;oe<W.length;oe++){var ae=W[oe];Q[Mm(ae.name)]=ae.name.toLowerCase()==="style"?Cl(S):ae.value}return{type:w,props:Q}}return S.nodeType===8?S.data===pz?{type:"Activity",props:{}}:{type:"Suspense",props:{}}:S.nodeValue}function W4(S,w,Q){return Q===null||Q[p5o]!==!0?(S.nodeValue===w?S=null:(w=La(w),S=La(S.nodeValue)===w?null:S.nodeValue),S):null}function X4(S){S=S.nextSibling;for(var w=0;S;){if(S.nodeType===8){var Q=S.data;if(Q===Cre||Q===Hge){if(w===0)return Tm(S.nextSibling);w--}else Q!==xre&&Q!==fX&&Q!==eR&&Q!==mz&&Q!==pz||w++}S=S.nextSibling}return null}function r9(S){S=S.previousSibling;for(var w=0;S;){if(S.nodeType===8){var Q=S.data;if(Q===xre||Q===fX||Q===eR||Q===mz||Q===pz){if(w===0)return S;w--}else Q!==Cre&&Q!==Hge||w++}S=S.previousSibling}return null}function jx(S){$d(S)}function DW(S){$d(S)}function NW(S){$d(S)}function $n(S,w){function Q(){W=!0}if(S.ownerDocument.activeElement===S)return!0;var W=!1;try{S.ownerDocument.addEventListener("focus",Q,!0),(S.focus||HTMLElement.prototype.focus).call(S,w)}finally{S.ownerDocument.removeEventListener("focus",Q,!0)}return W}function $f(S){_yt(function(){_yt(function(w){return S(w)})})}function EA(S,w,Q,W,oe){switch(oe&&_u(S,W.ancestorInfo),w=Dh(Q),S){case"html":if(S=w.documentElement,!S)throw Error("React expected an <html> element (document.documentElement) to exist in the Document but one was not found. React never removes the documentElement for any Document it renders into so the cause is likely in some other script running on this page.");return S;case"head":if(S=w.head,!S)throw Error("React expected a <head> element (document.head) to exist in the Document but one was not found. React never removes the head for any Document it renders into so the cause is likely in some other script running on this page.");return S;case"body":if(S=w.body,!S)throw Error("React expected a <body> element (document.body) to exist in the Document but one was not found. React never removes the body for any Document it renders into so the cause is likely in some other script running on this page.");return S;default:throw Error("resolveSingletonInstance was called with an element type that is not supported. This is a bug in React.")}}function HM(S,w,Q,W){if(!Q[p9]&&pn(Q)){var oe=Q.tagName.toLowerCase();console.error("You are mounting a new %s component when a previous one has not first unmounted. It is an error to render more than one %s component at a time and attributes and children of these components will likely fail in unpredictable ways. Please only render a single instance of <%s> and if you need to mount a new one, ensure any previous ones have unmounted first.",oe,oe,oe)}switch(S){case"html":case"head":case"body":break;default:console.error("acquireSingletonInstance was called with an element type that is not supported. This is a bug in React.")}for(oe=Q.attributes;oe.length;)Q.removeAttributeNode(oe[0]);Vp(Q,S,w),Q[_0]=W,Q[TA]=w}function g7(S,w,Q){for(var W in Q){var oe=Q[W];Q.hasOwnProperty(W)&&oe!=null&&xl(S,w,W,null,d5o,oe)}Q.dangerouslySetInnerHTML!=null&&(S.textContent=""),S.onclick===Gd&&(S.onclick=null),Wt(S)}function ab(S){for(var w=S.attributes;w.length;)S.removeAttributeNode(w[0]);Wt(S)}function i9(S){if(typeof S.getRootNode==="function"){var w=S.getRootNode();if(w.nodeType===9||w.nodeType===11)return w}return S.nodeType===9?S:S.ownerDocument}function vN(S,w,Q){var W=xX;if(W&&typeof w==="string"&&w){var oe=Bn(w);oe='link[rel="'+S+'"][href="'+oe+'"]',typeof Q==="string"&&(oe+='[crossorigin="'+Q+'"]'),fyt.has(oe)||(fyt.add(oe),S={rel:S,crossOrigin:Q,href:w},W.querySelector(oe)===null&&(w=W.createElement("link"),Vp(w,"link",S),mn(w),W.head.appendChild(w)))}}function A7(S,w,Q,W){var oe=(oe=wA.current)?i9(oe):null;if(!oe)throw Error('"resourceRoot" was expected to exist. This is a bug in React.');switch(S){case"meta":case"title":return null;case"style":return typeof Q.precedence==="string"&&typeof Q.href==="string"?(Q=fp(Q.href),w=Fn(oe).hoistableStyles,W=w.get(Q),W||(W={type:"style",instance:null,count:0,state:null},w.set(Q,W)),W):{type:"void",instance:null,count:0,state:null};case"link":if(Q.rel==="stylesheet"&&typeof Q.href==="string"&&typeof Q.precedence==="string"){S=fp(Q.href);var ae=Fn(oe).hoistableStyles,De=ae.get(S);if(De||(oe=oe.ownerDocument||oe,De={type:"stylesheet",instance:null,count:0,state:{loading:gz,preload:null}},ae.set(S,De),(ae=oe.querySelector(Iu(S)))?ae._p||(De.instance=ae,De.state.loading=Ire|Sb):(ae=Pb.get(S),ae||(ae={rel:"preload",as:"style",href:Q.href,crossOrigin:Q.crossOrigin,integrity:Q.integrity,media:Q.media,hrefLang:Q.hrefLang,referrerPolicy:Q.referrerPolicy},Pb.set(S,ae)),SN(oe,S,ae,De.state))),w&&W===null)throw Q=`

  - `+u0(w)+`
  + `+u0(Q),Error("Expected <link> not to update to be updated to a stylesheet with precedence. Check the `rel`, `href`, and `precedence` props of this component. Alternatively, check whether two different <link> components render in the same slot or share the same key."+Q);return De}if(w&&W!==null)throw Q=`

  - `+u0(w)+`
  + `+u0(Q),Error("Expected stylesheet with precedence to not be updated to a different kind of <link>. Check the `rel`, `href`, and `precedence` props of this component. Alternatively, check whether two different <link> components render in the same slot or share the same key."+Q);return null;case"script":return w=Q.async,Q=Q.src,typeof Q==="string"&&w&&typeof w!=="function"&&typeof w!=="symbol"?(Q=G(Q),w=Fn(oe).hoistableScripts,W=w.get(Q),W||(W={type:"script",instance:null,count:0,state:null},w.set(Q,W)),W):{type:"void",instance:null,count:0,state:null};default:throw Error('getResource encountered a type it did not expect: "'+S+'". this is a bug in React.')}}function u0(S){var w=0,Q="<link";return typeof S.rel==="string"?(w++,Q+=' rel="'+S.rel+'"'):J2.call(S,"rel")&&(w++,Q+=' rel="'+(S.rel===null?"null":"invalid type "+typeof S.rel)+'"'),typeof S.href==="string"?(w++,Q+=' href="'+S.href+'"'):J2.call(S,"href")&&(w++,Q+=' href="'+(S.href===null?"null":"invalid type "+typeof S.href)+'"'),typeof S.precedence==="string"?(w++,Q+=' precedence="'+S.precedence+'"'):J2.call(S,"precedence")&&(w++,Q+=" precedence={"+(S.precedence===null?"null":"invalid type "+typeof S.precedence)+"}"),Object.getOwnPropertyNames(S).length>w&&(Q+=" ..."),Q+" />"}function fp(S){return'href="'+Bn(S)+'"'}function Iu(S){return'link[rel="stylesheet"]['+S+"]"}function s9(S){return pa({},S,{"data-precedence":S.precedence,precedence:null})}function SN(S,w,Q,W){if(w=S.querySelector('link[rel="preload"][as="style"]['+w+"]")){if(w[m9]!==!0){W.loading=Ire;return}}else w=S.createElement("link"),w[m9]=!0,w.onload=w.onerror=_n.bind(null,w),Vp(w,"link",Q),mn(w),S.head.appendChild(w);W.preload=w,w.addEventListener("load",function(){return W.loading|=Ire}),w.addEventListener("error",function(){return W.loading|=gyt})}function G(S){return'[src="'+Bn(S)+'"]'}function he(S){return"script[async]"+S}function fe(S,w,Q){if(w.count++,w.instance===null)switch(w.type){case"style":var W=S.querySelector('style[data-href~="'+Bn(Q.href)+'"]');if(W)return w.instance=W,mn(W),W;var oe=pa({},Q,{"data-href":Q.href,"data-precedence":Q.precedence,href:null,precedence:null});return W=(S.ownerDocument||S).createElement("style"),mn(W),Vp(W,"style",oe),Fe(W,Q.precedence,S),w.instance=W;case"stylesheet":oe=fp(Q.href);var ae=S.querySelector(Iu(oe));if(ae)return w.state.loading|=Sb,w.instance=ae,mn(ae),ae;W=s9(Q),(oe=Pb.get(oe))&&tt(W,oe),ae=(S.ownerDocument||S).createElement("link"),mn(ae);var De=ae;return De._p=new Promise(function(Qe,ot){De.onload=Qe,De.onerror=ot}),Vp(ae,"link",W),w.state.loading|=Sb,Fe(ae,Q.precedence,S),w.instance=ae;case"script":if(ae=G(Q.src),oe=S.querySelector(he(ae)))return w.instance=oe,mn(oe),oe;if(W=Q,oe=Pb.get(ae))W=pa({},Q),yt(W,oe);return S=S.ownerDocument||S,oe=S.createElement("script"),mn(oe),Vp(oe,"link",W),S.head.appendChild(oe),w.instance=oe;case"void":return null;default:throw Error('acquireResource encountered a resource type it did not expect: "'+w.type+'". this is a bug in React.')}else w.type==="stylesheet"&&(w.state.loading&Sb)===gz&&(W=w.instance,w.state.loading|=Sb,Fe(W,Q.precedence,S));return w.instance}function Fe(S,w,Q){for(var W=Q.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),oe=W.length?W[W.length-1]:null,ae=oe,De=0;De<W.length;De++){var Qe=W[De];if(Qe.dataset.precedence===w)ae=Qe;else if(ae!==oe)break}ae?ae.parentNode.insertBefore(S,ae.nextSibling):(w=Q.nodeType===9?Q.head:Q,w.insertBefore(S,w.firstChild))}function tt(S,w){S.crossOrigin==null&&(S.crossOrigin=w.crossOrigin),S.referrerPolicy==null&&(S.referrerPolicy=w.referrerPolicy),S.title==null&&(S.title=w.title)}function yt(S,w){S.crossOrigin==null&&(S.crossOrigin=w.crossOrigin),S.referrerPolicy==null&&(S.referrerPolicy=w.referrerPolicy),S.integrity==null&&(S.integrity=w.integrity)}function Bt(S,w,Q){if(zge===null){var W=new Map,oe=zge=new Map;oe.set(Q,W)}else oe=zge,W=oe.get(Q),W||(W=new Map,oe.set(Q,W));if(W.has(S))return W;W.set(S,null),Q=Q.getElementsByTagName(S);for(oe=0;oe<Q.length;oe++){var ae=Q[oe];if(!(ae[Kx]||ae[_0]||S==="link"&&ae.getAttribute("rel")==="stylesheet")&&ae.namespaceURI!==Te){var De=ae.getAttribute(w)||"";De=S+De;var Qe=W.get(De);Qe?Qe.push(ae):W.set(De,[ae])}}return W}function Rt(S,w,Q){S=S.ownerDocument||S,S.head.insertBefore(Q,w==="title"?S.querySelector("head > title"):null)}function Xt(S,w,Q){var W=!Q.ancestorInfo.containerTagInScope;if(Q.context===yX||w.itemProp!=null)return!W||w.itemProp==null||S!=="meta"&&S!=="title"&&S!=="style"&&S!=="link"&&S!=="script"||console.error("Cannot render a <%s> outside the main document if it has an `itemProp` prop. `itemProp` suggests the tag belongs to an `itemScope` which can appear anywhere in the DOM. If you were intending for React to hoist this <%s> remove the `itemProp` prop. Otherwise, try moving this tag into the <head> or <body> of the Document.",S,S),!1;switch(S){case"meta":case"title":return!0;case"style":if(typeof w.precedence!=="string"||typeof w.href!=="string"||w.href===""){W&&console.error('Cannot render a <style> outside the main document without knowing its precedence and a unique href key. React can hoist and deduplicate <style> tags if you provide a `precedence` prop along with an `href` prop that does not conflict with the `href` values used in any other hoisted <style> or <link rel="stylesheet" ...> tags.  Note that hoisting <style> tags is considered an advanced feature that most will not use directly. Consider moving the <style> tag to the <head> or consider adding a `precedence="default"` and `href="some unique resource identifier"`.');break}return!0;case"link":if(typeof w.rel!=="string"||typeof w.href!=="string"||w.href===""||w.onLoad||w.onError){if(w.rel==="stylesheet"&&typeof w.precedence==="string"){S=w.href;var oe=w.onError,ae=w.disabled;Q=[],w.onLoad&&Q.push("`onLoad`"),oe&&Q.push("`onError`"),ae!=null&&Q.push("`disabled`"),oe=yoe(Q,"and"),oe+=Q.length===1?" prop":" props",ae=Q.length===1?"an "+oe:"the "+oe,Q.length&&console.error('React encountered a <link rel="stylesheet" href="%s" ... /> with a `precedence` prop that also included %s. The presence of loading and error handlers indicates an intent to manage the stylesheet loading state from your from your Component code and React will not hoist or deduplicate this stylesheet. If your intent was to have React hoist and deduplciate this stylesheet using the `precedence` prop remove the %s, otherwise remove the `precedence` prop.',S,ae,oe)}W&&(typeof w.rel!=="string"||typeof w.href!=="string"||w.href===""?console.error("Cannot render a <link> outside the main document without a `rel` and `href` prop. Try adding a `rel` and/or `href` prop to this <link> or moving the link into the <head> tag"):(w.onError||w.onLoad)&&console.error("Cannot render a <link> with onLoad or onError listeners outside the main document. Try removing onLoad={...} and onError={...} or moving it into the root <head> tag or somewhere in the <body>."));break}switch(w.rel){case"stylesheet":return S=w.precedence,w=w.disabled,typeof S!=="string"&&W&&console.error('Cannot render a <link rel="stylesheet" /> outside the main document without knowing its precedence. Consider adding precedence="default" or moving it into the root <head> tag.'),typeof S==="string"&&w==null;default:return!0}case"script":if(S=w.async&&typeof w.async!=="function"&&typeof w.async!=="symbol",!S||w.onLoad||w.onError||!w.src||typeof w.src!=="string"){W&&(S?w.onLoad||w.onError?console.error("Cannot render a <script> with onLoad or onError listeners outside the main document. Try removing onLoad={...} and onError={...} or moving it into the root <head> tag or somewhere in the <body>."):console.error("Cannot render a <script> outside the main document without `async={true}` and a non-empty `src` prop. Ensure there is a valid `src` and either make the script async or move it into the root <head> tag or somewhere in the <body>."):console.error('Cannot render a sync or defer <script> outside the main document without knowing its order. Try adding async="" or moving it into the root <head> tag.'));break}return!0;case"noscript":case"template":W&&console.error("Cannot render <%s> outside the main document. Try moving it into the root <head> tag.",S)}return!1}function Hn(S,w){return S==="img"&&w.src!=null&&w.src!==""&&w.onLoad==null&&w.loading!=="lazy"}function so(S){return S.type==="stylesheet"&&(S.state.loading&Ayt)===gz?!1:!0}function So(S){return(S.width||100)*(S.height||100)*(typeof devicePixelRatio==="number"?devicePixelRatio:1)*0.25}function nr(S,w){typeof w.decode==="function"&&(S.imgCount++,w.complete||(S.imgBytes+=So(w),S.suspenseyImages.push(w)),S=Pr.bind(S),w.decode().then(S,S))}function Rr(S,w,Q,W){if(Q.type==="stylesheet"&&(typeof W.media!=="string"||matchMedia(W.media).matches!==!1)&&(Q.state.loading&Sb)===gz){if(Q.instance===null){var oe=fp(W.href),ae=w.querySelector(Iu(oe));if(ae){w=ae._p,w!==null&&typeof w==="object"&&typeof w.then==="function"&&(S.count++,S=zr.bind(S),w.then(S,S)),Q.state.loading|=Sb,Q.instance=ae,mn(ae);return}ae=w.ownerDocument||w,W=s9(W),(oe=Pb.get(oe))&&tt(W,oe),ae=ae.createElement("link"),mn(ae);var De=ae;De._p=new Promise(function(Qe,ot){De.onload=Qe,De.onerror=ot}),Vp(ae,"link",W),Q.instance=ae}S.stylesheets===null&&(S.stylesheets=new Map),S.stylesheets.set(Q,w),(w=Q.state.preload)&&(Q.state.loading&Ayt)===gz&&(S.count++,Q=zr.bind(S),w.addEventListener("load",Q),w.addEventListener("error",Q))}}function Yi(S,w){return S.stylesheets&&S.count===0&&Eo(S,S.stylesheets),0<S.count||0<S.imgCount?function(Q){var W=setTimeout(function(){if(S.stylesheets&&Eo(S,S.stylesheets),S.unsuspend){var ae=S.unsuspend;S.unsuspend=null,ae()}},x5o+w);0<S.imgBytes&&Oge===0&&(Oge=125*xoe()*b5o);var oe=setTimeout(function(){if(S.waitingForImages=!1,S.count===0&&(S.stylesheets&&Eo(S,S.stylesheets),S.unsuspend)){var ae=S.unsuspend;S.unsuspend=null,ae()}},(S.imgBytes>Oge?50:C5o)+w);return S.unsuspend=Q,function(){S.unsuspend=null,clearTimeout(W),clearTimeout(oe)}}:null}function li(S){if(S.count===0&&(S.imgCount===0||!S.waitingForImages)){if(S.stylesheets)Eo(S,S.stylesheets);else if(S.unsuspend){var w=S.unsuspend;S.unsuspend=null,w()}}}function zr(){this.count--,li(this)}function Pr(){this.imgCount--,li(this)}function Eo(S,w){S.stylesheets=null,S.unsuspend!==null&&(S.count++,Vge=new Map,w.forEach(Fo,S),Vge=null,zr.call(S))}function Fo(S,w){if(!(w.state.loading&Sb)){var Q=Vge.get(S);if(Q)var W=Q.get(IRe);else{Q=new Map,Vge.set(S,Q);for(var oe=S.querySelectorAll("link[data-precedence],style[data-precedence]"),ae=0;ae<oe.length;ae++){var De=oe[ae];if(De.nodeName==="LINK"||De.getAttribute("media")!=="not all")Q.set(De.dataset.precedence,De),W=De}W&&Q.set(IRe,W)}oe=w.instance,De=oe.getAttribute("data-precedence"),ae=Q.get(De)||W,ae===W&&Q.set(IRe,oe),Q.set(De,oe),this.count++,W=zr.bind(this),oe.addEventListener("load",W),oe.addEventListener("error",W),ae?ae.parentNode.insertBefore(oe,ae.nextSibling):(S=S.nodeType===9?S.head:S,S.insertBefore(oe,S.firstChild)),w.state.loading|=Sb}}function ks(S,w,Q,W,oe,ae,De,Qe,ot){this.tag=1,this.containerInfo=S,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=_z,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Le(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Le(0),this.hiddenUpdates=Le(null),this.identifierPrefix=W,this.onUncaughtError=oe,this.onCaughtError=ae,this.onRecoverableError=De,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ot,this.transitionTypes=null,this.incompleteTransitions=new Map,this.passiveEffectDuration=this.effectDuration=-0,this.memoizedUpdaters=new Set,S=this.pendingUpdatersLaneMap=[];for(w=0;31>w;w++)S.push(new Set);this._debugRootType=Q?"hydrateRoot()":"createRoot()"}function ph(S,w,Q,W,oe,ae,De,Qe,ot,_t,Yt,rn){return S=new ks(S,w,Q,De,ot,_t,Yt,rn,Qe),w=Wxo,ae===!0&&(w|=e1|A9),w|=za,ae=u(3,null,null,w),S.current=ae,ae.stateNode=S,w=kx(),T4(w),S.pooledCache=w,T4(w),ae.memoizedState={element:W,isDehydrated:Q,cache:w},M8(ae),S}function Yp(S){if(!S)return zN;return S=zN,S}function cb(S,w,Q,W,oe,ae){if(kh&&typeof kh.onScheduleFiberRoot==="function")try{kh.onScheduleFiberRoot(M7,W,Q)}catch(De){BA||(BA=!0,console.error("React instrumentation encountered an error: %o",De))}oe=Yp(oe),W.context===null?W.context=oe:W.pendingContext=oe,Z4&&Dg!==null&&!byt&&(byt=!0,console.error(`Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate.

Check the render method of %s.`,Y(Dg)||"Unknown")),W=al(w),W.payload={element:Q},ae=ae===void 0?null:ae,ae!==null&&(typeof ae!=="function"&&console.error("Expected the last optional `callback` argument to be a function. Instead received: %s.",ae),W.callback=ae),Q=NC(S,W,w),Q!==null&&(Qf(w,"root.render()",null),Kd(Q,S,w),cM(Q,S,w))}function Bg(S,w){if(S=S.memoizedState,S!==null&&S.dehydrated!==null){var Q=S.retryLane;S.retryLane=Q!==0&&Q<w?Q:w}}function Cy(S,w){Bg(S,w),(S=S.alternate)&&Bg(S,w)}function Dm(S){if(S.tag===13||S.tag===31){var w=Ln(S,67108864);w!==null&&Kd(w,S,67108864),Cy(S,67108864)}}function by(S){if(S.tag===13||S.tag===31){var w=Pm(S);w=ze(w);var Q=Ln(S,w);Q!==null&&Kd(Q,S,w),Cy(S,w)}}function lb(){return Dg}function hb(S,w,Q,W){var oe=Xn.T;Xn.T=null;var ae=Jc.p;try{Jc.p=km,db(S,w,Q,W)}finally{Jc.p=ae,Xn.T=oe}}function Rh(S,w,Q,W){var oe=Xn.T;Xn.T=null;var ae=Jc.p;try{Jc.p=f_,db(S,w,Q,W)}finally{Jc.p=ae,Xn.T=oe}}function db(S,w,Q,W){if(bX){var oe=a9(W);if(oe===null)KI(S,w,W,Gge,Q),PN(S,W);else if(RW(oe,S,w,Q,W))W.stopPropagation();else if(PN(S,W),w&4&&-1<v5o.indexOf(S)){for(;oe!==null;){var ae=pn(oe);if(ae!==null)switch(ae.tag){case 3:if(ae=ae.stateNode,ae.current.memoizedState.isDehydrated){var De=Ht(ae.pendingLanes);if(De!==0){var Qe=ae;Qe.pendingLanes|=2;for(Qe.entangledLanes|=2;De;){var ot=1<<31-mh(De);Qe.entanglements[1]|=ot,De&=~ot}X2(ae),(hl&(Rg|r3))===LA&&(vge=es()+q1t,e7(0,!1))}}break;case 31:case 13:Qe=Ln(ae,2),Qe!==null&&Kd(Qe,ae,2),GI(),Cy(ae,2)}if(ae=a9(W),ae===null&&KI(S,w,W,Gge,Q),ae===oe)break;oe=ae}oe!==null&&W.stopPropagation()}else KI(S,w,W,null,Q)}}function a9(S){return S=gA(S),FM(S)}function FM(S){if(Gge=null,S=bn(S),S!==null){var w=g(S);if(w===null)S=null;else{var Q=w.tag;if(Q===13){if(S=f(w),S!==null)return S;S=null}else if(Q===31){if(S=y(w),S!==null)return S;S=null}else if(Q===3){if(w.stateNode.current.memoizedState.isDehydrated)return w.tag===3?w.stateNode.containerInfo:null;S=null}else w!==S&&(S=null)}}return Gge=S,null}function c9(S){switch(S){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"fullscreenerror":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return km;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return f_;case"message":switch(vy()){case mb:return km;case v7:return f_;case S7:case _b:return gb;case vu:return zW;default:return gb}default:return gb}}function PN(S,w){switch(S){case"focusin":case"focusout":tR=null;break;case"dragenter":case"dragleave":nR=null;break;case"mouseover":case"mouseout":oR=null;break;case"pointerover":case"pointerout":vre.delete(w.pointerId);break;case"gotpointercapture":case"lostpointercapture":Sre.delete(w.pointerId)}}function l9(S,w,Q,W,oe,ae){if(S===null||S.nativeEvent!==ae)return S={blockedOn:w,domEventName:Q,eventSystemFlags:W,nativeEvent:ae,targetContainers:[oe]},w!==null&&(w=pn(w),w!==null&&Dm(w)),S;return S.eventSystemFlags|=W,w=S.targetContainers,oe!==null&&w.indexOf(oe)===-1&&w.push(oe),S}function RW(S,w,Q,W,oe){switch(w){case"focusin":return tR=l9(tR,S,w,Q,W,oe),!0;case"dragenter":return nR=l9(nR,S,w,Q,W,oe),!0;case"mouseover":return oR=l9(oR,S,w,Q,W,oe),!0;case"pointerover":var ae=oe.pointerId;return vre.set(ae,l9(vre.get(ae)||null,S,w,Q,W,oe)),!0;case"gotpointercapture":return ae=oe.pointerId,Sre.set(ae,l9(Sre.get(ae)||null,S,w,Q,W,oe)),!0}return!1}function EN(S){var w=bn(S.target);if(w!==null){var Q=g(w);if(Q!==null){if(w=Q.tag,w===13){if(w=f(Q),w!==null){S.blockedOn=w,Lt(S.priority,function(){by(Q)});return}}else if(w===31){if(w=y(Q),w!==null){S.blockedOn=w,Lt(S.priority,function(){by(Q)});return}}else if(w===3&&Q.stateNode.current.memoizedState.isDehydrated){S.blockedOn=Q.tag===3?Q.stateNode.containerInfo:null;return}}}S.blockedOn=null}function Tg(S){if(S.blockedOn!==null)return!1;for(var w=S.targetContainers;0<w.length;){var Q=a9(S.nativeEvent);if(Q===null){Q=S.nativeEvent;var W=new Q.constructor(Q.type,Q),oe=W;cn!==null&&console.error("Expected currently replaying event to be null. This error is likely caused by a bug in React. Please file an issue."),cn=oe,Q.target.dispatchEvent(W),cn===null&&console.error("Expected currently replaying event to not be null. This error is likely caused by a bug in React. Please file an issue."),cn=null}else return w=pn(Q),w!==null&&Dm(w),S.blockedOn=Q,!1;w.shift()}return!0}function MN(S,w,Q){Tg(S)&&Q.delete(w)}function Nm(){vRe=!1,tR!==null&&Tg(tR)&&(tR=null),nR!==null&&Tg(nR)&&(nR=null),oR!==null&&Tg(oR)&&(oR=null),vre.forEach(MN),Sre.forEach(MN)}function Rm(S,w){S.blockedOn===w&&(S.blockedOn=null,vRe||(vRe=!0,Il.unstable_scheduleCallback(Il.unstable_NormalPriority,Nm)))}function ub(S){Uge!==S&&(Uge=S,Il.unstable_scheduleCallback(Il.unstable_NormalPriority,function(){Uge===S&&(Uge=null);for(var w=0;w<S.length;w+=3){var Q=S[w],W=S[w+1],oe=S[w+2];if(typeof W!=="function")if(FM(W||Q)===null)continue;else break;var ae=pn(Q);ae!==null&&(S.splice(w,3),w-=3,Q={pending:!0,data:oe,method:Q.method,action:W},Object.freeze(Q),GD(ae,Q,W,oe))}}))}function $d(S){function w(ot){return Rm(ot,S)}tR!==null&&Rm(tR,S),nR!==null&&Rm(nR,S),oR!==null&&Rm(oR,S),vre.forEach(w),Sre.forEach(w);for(var Q=0;Q<rR.length;Q++){var W=rR[Q];W.blockedOn===S&&(W.blockedOn=null)}for(;0<rR.length&&(Q=rR[0],Q.blockedOn===null);)EN(Q),Q.blockedOn===null&&rR.shift();if(Q=(S.ownerDocument||S).$$reactFormReplay,Q!=null)for(W=0;W<Q.length;W+=3){var oe=Q[W],ae=Q[W+1],De=oe[TA]||null;if(typeof ae==="function")De||ub(Q);else if(De){var Qe=null;if(ae&&ae.hasAttribute("formAction")){if(oe=ae,De=ae[TA]||null)Qe=De.formAction;else if(FM(oe)!==null)continue}else Qe=De.action;typeof Qe==="function"?Q[W+1]=Qe:(Q.splice(W,3),W-=3),ub(Q)}}}function $2(){function S(ae){ae.canIntercept&&ae.info==="react-transition"&&ae.intercept({handler:function(){return new Promise(function(De){return oe=De})},focusReset:"manual",scroll:"manual"})}function w(){oe!==null&&(oe(),oe=null),W||setTimeout(Q,20)}function Q(){if(!W&&!navigation.transition){var ae=navigation.currentEntry;ae&&ae.url!=null&&navigation.navigate(ae.url,{state:ae.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation==="object"){var W=!1,oe=null;return navigation.addEventListener("navigate",S),navigation.addEventListener("navigatesuccess",w),navigation.addEventListener("navigateerror",w),setTimeout(Q,100),function(){W=!0,navigation.removeEventListener("navigate",S),navigation.removeEventListener("navigatesuccess",w),navigation.removeEventListener("navigateerror",w),oe!==null&&(oe(),oe=null)}}}function Iy(S){this._internalRoot=S}function Vl(S){this._internalRoot=S}function j4(S){S[p9]&&(S._reactRootContainer?console.error("You are calling ReactDOMClient.createRoot() on a container that was previously passed to ReactDOM.render(). This is not supported."):console.error("You are calling ReactDOMClient.createRoot() on a container that has already been passed to createRoot() before. Instead, call root.render() on the existing root instead if you want to update it."))}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var K4=null,zM=null,pa=Object.assign,wN=Symbol.for("react.element"),$4=Symbol.for("react.transitional.element"),f7=Symbol.for("react.portal"),y7=Symbol.for("react.fragment"),FF=Symbol.for("react.strict_mode"),QW=Symbol.for("react.profiler"),q4=Symbol.for("react.consumer"),Yl=Symbol.for("react.context"),BN=Symbol.for("react.forward_ref"),kW=Symbol.for("react.suspense"),Gp=Symbol.for("react.suspense_list"),h9=Symbol.for("react.memo"),Qm=Symbol.for("react.lazy"),z0=Symbol.for("react.activity"),q2=Symbol.for("react.legacy_hidden"),J4=Symbol.for("react.memo_cache_sentinel"),x7=Symbol.for("react.view_transition"),lNe=Symbol.for("react.recoverable"),zF=Symbol.iterator,LW=Symbol.for("react.client.reference"),O0=Array.isArray,Xn=PX.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Jc=ERe.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,OF=Object.freeze({pending:!1,data:null,method:null,action:null}),TN=[],Coe=[],p0=-1,m0=X(null),MA=X(null),wA=X(null),C7=X(null),pb=0,HW,b7,VF,boe,Ac,Qh,Ha;ie.__reactDisabledLog=!0;var Fa,qf,OM=!1,d9=new(typeof WeakMap==="function"?WeakMap:Map),Dg=null,Z4=!1,J2=Object.prototype.hasOwnProperty,I7=Il.unstable_scheduleCallback,YF=Il.unstable_cancelCallback,Ioe=Il.unstable_shouldYield,VM=Il.unstable_requestPaint,es=Il.unstable_now,vy=Il.unstable_getCurrentPriorityLevel,mb=Il.unstable_ImmediatePriority,v7=Il.unstable_UserBlockingPriority,S7=Il.unstable_NormalPriority,_b=Il.unstable_LowPriority,vu=Il.unstable_IdlePriority,P7=Il.log,E7=Il.unstable_setDisableYieldValue,M7=null,kh=null,BA=!1,Z2=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u",mh=Math.clz32?Math.clz32:Nt,{log:FW,LN2:voe}=Math,GF=256,w7=262144,DN=4194304,km=2,f_=8,gb=32,zW=268435456,u9=Math.random().toString(36).slice(2),_0="__reactFiber$"+u9,TA="__reactProps$"+u9,p9="__reactContainer$"+u9,Soe="__reactEvents$"+u9,hNe="__reactListeners$"+u9,Poe="__reactHandles$"+u9,y_="__reactResources$"+u9,Kx="__reactMarker$"+u9,m9="__reactLoad$"+u9,_9=new Set,g9={},UF={},F_e={button:!0,checkbox:!0,image:!0,hidden:!0,radio:!0,reset:!0,submit:!0},dNe=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),NN={},OW={},Zc=!1,VW=/[\n"\\]/g,z_e=!1,B7=!1,RN=!1,YM=!1,WF=!1,Eoe=!1,Moe=["value","defaultValue"],O_e=!1,Sy=/["'&<>\n\t]|^\s|\s$/,QN="address applet area article aside base basefont bgsound blockquote body br button caption center col colgroup dd details dir div dl dt embed fieldset figcaption figure footer form frame frameset h1 h2 h3 h4 h5 h6 head header hgroup hr html iframe img input isindex li link listing main marquee menu menuitem meta nav noembed noframes noscript object ol p param plaintext pre script section select source style summary table tbody td template textarea tfoot th thead title tr track ul wbr xmp".split(" "),woe="applet caption html table td th marquee object select template foreignObject desc title".split(" "),V_e=woe.concat(["button"]),Y_e="dd dt li option optgroup p rp rt".split(" "),Boe={current:null,formTag:null,aTagInScope:null,buttonTagInScope:null,nobrTagInScope:null,pTagInButtonScope:null,listItemTagAutoclosing:null,dlItemTagAutoclosing:null,containerTagInScope:null,implicitRootScope:!1},XF={},YW={animation:"animationDelay animationDirection animationDuration animationFillMode animationIterationCount animationName animationPlayState animationTimingFunction".split(" "),background:"backgroundAttachment backgroundClip backgroundColor backgroundImage backgroundOrigin backgroundPositionX backgroundPositionY backgroundRepeat backgroundSize".split(" "),backgroundPosition:["backgroundPositionX","backgroundPositionY"],border:"borderBottomColor borderBottomStyle borderBottomWidth borderImageOutset borderImageRepeat borderImageSlice borderImageSource borderImageWidth borderLeftColor borderLeftStyle borderLeftWidth borderRightColor borderRightStyle borderRightWidth borderTopColor borderTopStyle borderTopWidth".split(" "),borderBlock:"borderBlockEndColor borderBlockEndStyle borderBlockEndWidth borderBlockStartColor borderBlockStartStyle borderBlockStartWidth".split(" "),borderBlockColor:["borderBlockEndColor","borderBlockStartColor"],borderBlockEnd:["borderBlockEndColor","borderBlockEndStyle","borderBlockEndWidth"],borderBlockStart:["borderBlockStartColor","borderBlockStartStyle","borderBlockStartWidth"],borderBlockStyle:["borderBlockEndStyle","borderBlockStartStyle"],borderBlockWidth:["borderBlockEndWidth","borderBlockStartWidth"],borderBottom:["borderBottomColor","borderBottomStyle","borderBottomWidth"],borderColor:["borderBottomColor","borderLeftColor","borderRightColor","borderTopColor"],borderImage:["borderImageOutset","borderImageRepeat","borderImageSlice","borderImageSource","borderImageWidth"],borderInline:"borderInlineEndColor borderInlineEndStyle borderInlineEndWidth borderInlineStartColor borderInlineStartStyle borderInlineStartWidth".split(" "),borderInlineColor:["borderInlineEndColor","borderInlineStartColor"],borderInlineEnd:["borderInlineEndColor","borderInlineEndStyle","borderInlineEndWidth"],borderInlineStart:["borderInlineStartColor","borderInlineStartStyle","borderInlineStartWidth"],borderInlineStyle:["borderInlineEndStyle","borderInlineStartStyle"],borderInlineWidth:["borderInlineEndWidth","borderInlineStartWidth"],borderLeft:["borderLeftColor","borderLeftStyle","borderLeftWidth"],borderRadius:["borderBottomLeftRadius","borderBottomRightRadius","borderTopLeftRadius","borderTopRightRadius"],borderRight:["borderRightColor","borderRightStyle","borderRightWidth"],borderStyle:["borderBottomStyle","borderLeftStyle","borderRightStyle","borderTopStyle"],borderTop:["borderTopColor","borderTopStyle","borderTopWidth"],borderWidth:["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth"],colorAdjust:["printColorAdjust"],columnRule:["columnRuleColor","columnRuleStyle","columnRuleWidth"],columns:["columnCount","columnWidth"],containIntrinsicSize:["containIntrinsicHeight","containIntrinsicWidth"],container:["containerName","containerType"],flex:["flexBasis","flexGrow","flexShrink"],flexFlow:["flexDirection","flexWrap"],font:"fontFamily fontFeatureSettings fontKerning fontLanguageOverride fontSize fontSizeAdjust fontStretch fontStyle fontVariant fontVariantAlternates fontVariantCaps fontVariantEastAsian fontVariantLigatures fontVariantNumeric fontVariantPosition fontWeight lineHeight".split(" "),fontSynthesis:["fontSynthesisPosition","fontSynthesisSmallCaps","fontSynthesisStyle","fontSynthesisWeight"],fontVariant:"fontVariantAlternates fontVariantCaps fontVariantEastAsian fontVariantLigatures fontVariantNumeric fontVariantPosition".split(" "),gap:["columnGap","rowGap"],grid:"gridAutoColumns gridAutoFlow gridAutoRows gridTemplateAreas gridTemplateColumns gridTemplateRows".split(" "),gridArea:["gridColumnEnd","gridColumnStart","gridRowEnd","gridRowStart"],gridColumn:["gridColumnEnd","gridColumnStart"],gridColumnGap:["columnGap"],gridGap:["columnGap","rowGap"],gridRow:["gridRowEnd","gridRowStart"],gridRowGap:["rowGap"],gridTemplate:["gridTemplateAreas","gridTemplateColumns","gridTemplateRows"],inset:["bottom","left","right","top"],insetBlock:["insetBlockEnd","insetBlockStart"],insetInline:["insetInlineEnd","insetInlineStart"],listStyle:["listStyleImage","listStylePosition","listStyleType"],margin:["marginBottom","marginLeft","marginRight","marginTop"],marginBlock:["marginBlockEnd","marginBlockStart"],marginInline:["marginInlineEnd","marginInlineStart"],marker:["markerEnd","markerMid","markerStart"],mask:"maskClip maskComposite maskImage maskMode maskOrigin maskPositionX maskPositionY maskRepeat maskSize".split(" "),maskPosition:["maskPositionX","maskPositionY"],offset:["offsetAnchor","offsetDistance","offsetPath","offsetPosition","offsetRotate"],outline:["outlineColor","outlineStyle","outlineWidth"],overflow:["overflowX","overflowY"],overscrollBehavior:["overscrollBehaviorX","overscrollBehaviorY"],padding:["paddingBottom","paddingLeft","paddingRight","paddingTop"],paddingBlock:["paddingBlockEnd","paddingBlockStart"],paddingInline:["paddingInlineEnd","paddingInlineStart"],pageBreakAfter:["breakAfter"],pageBreakBefore:["breakBefore"],pageBreakInside:["breakInside"],placeContent:["alignContent","justifyContent"],placeItems:["alignItems","justifyItems"],placeSelf:["alignSelf","justifySelf"],scrollMargin:["scrollMarginBottom","scrollMarginLeft","scrollMarginRight","scrollMarginTop"],scrollMarginBlock:["scrollMarginBlockEnd","scrollMarginBlockStart"],scrollMarginInline:["scrollMarginInlineEnd","scrollMarginInlineStart"],scrollPadding:["scrollPaddingBottom","scrollPaddingLeft","scrollPaddingRight","scrollPaddingTop"],scrollPaddingBlock:["scrollPaddingBlockEnd","scrollPaddingBlockStart"],scrollPaddingInline:["scrollPaddingInlineEnd","scrollPaddingInlineStart"],textDecoration:["textDecorationColor","textDecorationLine","textDecorationStyle","textDecorationThickness"],textEmphasis:["textEmphasisColor","textEmphasisStyle"],textWrap:["textWrapMode","textWrapStyle"],transition:["transitionBehavior","transitionDelay","transitionDuration","transitionProperty","transitionTimingFunction"],verticalAlign:["alignmentBaseline","baselineShift","baselineSource"],whiteSpace:["textWrapMode","whiteSpaceCollapse"],wordWrap:["overflowWrap"]},Toe=/([A-Z])/g,Doe=/^ms-/,G_e=/^(?:webkit|moz|o)[A-Z]/,U_e=/^-ms-/,W_e=/-(.)/g,Noe=/;\s*$/,GM={},R={},z=!1,q=!1,pe=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" ")),Ce="http://www.w3.org/1998/Math/MathML",Te="http://www.w3.org/2000/svg",ut=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["maskType","mask-type"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),wt={accept:"accept",acceptcharset:"acceptCharset","accept-charset":"acceptCharset",accesskey:"accessKey",action:"action",allowfullscreen:"allowFullScreen",alt:"alt",as:"as",async:"async",autocapitalize:"autoCapitalize",autocomplete:"autoComplete",autocorrect:"autoCorrect",autofocus:"autoFocus",autoplay:"autoPlay",autosave:"autoSave",capture:"capture",cellpadding:"cellPadding",cellspacing:"cellSpacing",challenge:"challenge",charset:"charSet",checked:"checked",children:"children",cite:"cite",class:"className",classid:"classID",classname:"className",cols:"cols",colspan:"colSpan",content:"content",contenteditable:"contentEditable",contextmenu:"contextMenu",controls:"controls",controlslist:"controlsList",coords:"coords",credentialless:"credentialless",crossorigin:"crossOrigin",dangerouslysetinnerhtml:"dangerouslySetInnerHTML",data:"data",datetime:"dateTime",default:"default",defaultchecked:"defaultChecked",defaultvalue:"defaultValue",defer:"defer",dir:"dir",disabled:"disabled",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback",download:"download",draggable:"draggable",enctype:"encType",enterkeyhint:"enterKeyHint",fetchpriority:"fetchPriority",for:"htmlFor",form:"form",formmethod:"formMethod",formaction:"formAction",formenctype:"formEncType",formnovalidate:"formNoValidate",formtarget:"formTarget",frameborder:"frameBorder",headers:"headers",height:"height",hidden:"hidden",high:"high",href:"href",hreflang:"hrefLang",htmlfor:"htmlFor",httpequiv:"httpEquiv","http-equiv":"httpEquiv",icon:"icon",id:"id",imagesizes:"imageSizes",imagesrcset:"imageSrcSet",inert:"inert",innerhtml:"innerHTML",inputmode:"inputMode",integrity:"integrity",is:"is",itemid:"itemID",itemprop:"itemProp",itemref:"itemRef",itemscope:"itemScope",itemtype:"itemType",keyparams:"keyParams",keytype:"keyType",kind:"kind",label:"label",lang:"lang",list:"list",loop:"loop",low:"low",manifest:"manifest",marginwidth:"marginWidth",marginheight:"marginHeight",max:"max",maxlength:"maxLength",media:"media",mediagroup:"mediaGroup",method:"method",min:"min",minlength:"minLength",multiple:"multiple",muted:"muted",name:"name",nomodule:"noModule",nonce:"nonce",novalidate:"noValidate",open:"open",optimum:"optimum",pattern:"pattern",placeholder:"placeholder",playsinline:"playsInline",poster:"poster",preload:"preload",profile:"profile",radiogroup:"radioGroup",readonly:"readOnly",referrerpolicy:"referrerPolicy",rel:"rel",required:"required",reversed:"reversed",role:"role",rows:"rows",rowspan:"rowSpan",sandbox:"sandbox",scope:"scope",scoped:"scoped",scrolling:"scrolling",seamless:"seamless",selected:"selected",shape:"shape",size:"size",sizes:"sizes",span:"span",spellcheck:"spellCheck",src:"src",srcdoc:"srcDoc",srclang:"srcLang",srcset:"srcSet",start:"start",step:"step",style:"style",summary:"summary",tabindex:"tabIndex",target:"target",title:"title",type:"type",usemap:"useMap",value:"value",width:"width",wmode:"wmode",wrap:"wrap",about:"about",accentheight:"accentHeight","accent-height":"accentHeight",accumulate:"accumulate",additive:"additive",alignmentbaseline:"alignmentBaseline","alignment-baseline":"alignmentBaseline",allowreorder:"allowReorder",alphabetic:"alphabetic",amplitude:"amplitude",arabicform:"arabicForm","arabic-form":"arabicForm",ascent:"ascent",attributename:"attributeName",attributetype:"attributeType",autoreverse:"autoReverse",azimuth:"azimuth",basefrequency:"baseFrequency",baselineshift:"baselineShift","baseline-shift":"baselineShift",baseprofile:"baseProfile",bbox:"bbox",begin:"begin",bias:"bias",by:"by",calcmode:"calcMode",capheight:"capHeight","cap-height":"capHeight",clip:"clip",clippath:"clipPath","clip-path":"clipPath",clippathunits:"clipPathUnits",cliprule:"clipRule","clip-rule":"clipRule",color:"color",colorinterpolation:"colorInterpolation","color-interpolation":"colorInterpolation",colorinterpolationfilters:"colorInterpolationFilters","color-interpolation-filters":"colorInterpolationFilters",colorprofile:"colorProfile","color-profile":"colorProfile",colorrendering:"colorRendering","color-rendering":"colorRendering",contentscripttype:"contentScriptType",contentstyletype:"contentStyleType",cursor:"cursor",cx:"cx",cy:"cy",d:"d",datatype:"datatype",decelerate:"decelerate",descent:"descent",diffuseconstant:"diffuseConstant",direction:"direction",display:"display",divisor:"divisor",dominantbaseline:"dominantBaseline","dominant-baseline":"dominantBaseline",dur:"dur",dx:"dx",dy:"dy",edgemode:"edgeMode",elevation:"elevation",enablebackground:"enableBackground","enable-background":"enableBackground",end:"end",exponent:"exponent",externalresourcesrequired:"externalResourcesRequired",fill:"fill",fillopacity:"fillOpacity","fill-opacity":"fillOpacity",fillrule:"fillRule","fill-rule":"fillRule",filter:"filter",filterres:"filterRes",filterunits:"filterUnits",floodopacity:"floodOpacity","flood-opacity":"floodOpacity",floodcolor:"floodColor","flood-color":"floodColor",focusable:"focusable",fontfamily:"fontFamily","font-family":"fontFamily",fontsize:"fontSize","font-size":"fontSize",fontsizeadjust:"fontSizeAdjust","font-size-adjust":"fontSizeAdjust",fontstretch:"fontStretch","font-stretch":"fontStretch",fontstyle:"fontStyle","font-style":"fontStyle",fontvariant:"fontVariant","font-variant":"fontVariant",fontweight:"fontWeight","font-weight":"fontWeight",format:"format",from:"from",fx:"fx",fy:"fy",g1:"g1",g2:"g2",glyphname:"glyphName","glyph-name":"glyphName",glyphorientationhorizontal:"glyphOrientationHorizontal","glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphorientationvertical:"glyphOrientationVertical","glyph-orientation-vertical":"glyphOrientationVertical",glyphref:"glyphRef",gradienttransform:"gradientTransform",gradientunits:"gradientUnits",hanging:"hanging",horizadvx:"horizAdvX","horiz-adv-x":"horizAdvX",horizoriginx:"horizOriginX","horiz-origin-x":"horizOriginX",ideographic:"ideographic",imagerendering:"imageRendering","image-rendering":"imageRendering",in2:"in2",in:"in",inlist:"inlist",intercept:"intercept",k1:"k1",k2:"k2",k3:"k3",k4:"k4",k:"k",kernelmatrix:"kernelMatrix",kernelunitlength:"kernelUnitLength",kerning:"kerning",keypoints:"keyPoints",keysplines:"keySplines",keytimes:"keyTimes",lengthadjust:"lengthAdjust",letterspacing:"letterSpacing","letter-spacing":"letterSpacing",lightingcolor:"lightingColor","lighting-color":"lightingColor",limitingconeangle:"limitingConeAngle",local:"local",markerend:"markerEnd","marker-end":"markerEnd",markerheight:"markerHeight",markermid:"markerMid","marker-mid":"markerMid",markerstart:"markerStart","marker-start":"markerStart",markerunits:"markerUnits",markerwidth:"markerWidth",mask:"mask",maskcontentunits:"maskContentUnits",masktype:"maskType",maskunits:"maskUnits",mathematical:"mathematical",mode:"mode",numoctaves:"numOctaves",offset:"offset",opacity:"opacity",operator:"operator",order:"order",orient:"orient",orientation:"orientation",origin:"origin",overflow:"overflow",overlineposition:"overlinePosition","overline-position":"overlinePosition",overlinethickness:"overlineThickness","overline-thickness":"overlineThickness",paintorder:"paintOrder","paint-order":"paintOrder",panose1:"panose1","panose-1":"panose1",pathlength:"pathLength",patterncontentunits:"patternContentUnits",patterntransform:"patternTransform",patternunits:"patternUnits",pointerevents:"pointerEvents","pointer-events":"pointerEvents",points:"points",pointsatx:"pointsAtX",pointsaty:"pointsAtY",pointsatz:"pointsAtZ",popover:"popover",popovertarget:"popoverTarget",popovertargetaction:"popoverTargetAction",prefix:"prefix",preservealpha:"preserveAlpha",preserveaspectratio:"preserveAspectRatio",primitiveunits:"primitiveUnits",property:"property",r:"r",radius:"radius",refx:"refX",refy:"refY",renderingintent:"renderingIntent","rendering-intent":"renderingIntent",repeatcount:"repeatCount",repeatdur:"repeatDur",requiredextensions:"requiredExtensions",requiredfeatures:"requiredFeatures",resource:"resource",restart:"restart",result:"result",results:"results",rotate:"rotate",rx:"rx",ry:"ry",scale:"scale",security:"security",seed:"seed",shaperendering:"shapeRendering","shape-rendering":"shapeRendering",slope:"slope",spacing:"spacing",specularconstant:"specularConstant",specularexponent:"specularExponent",speed:"speed",spreadmethod:"spreadMethod",startoffset:"startOffset",stddeviation:"stdDeviation",stemh:"stemh",stemv:"stemv",stitchtiles:"stitchTiles",stopcolor:"stopColor","stop-color":"stopColor",stopopacity:"stopOpacity","stop-opacity":"stopOpacity",strikethroughposition:"strikethroughPosition","strikethrough-position":"strikethroughPosition",strikethroughthickness:"strikethroughThickness","strikethrough-thickness":"strikethroughThickness",string:"string",stroke:"stroke",strokedasharray:"strokeDasharray","stroke-dasharray":"strokeDasharray",strokedashoffset:"strokeDashoffset","stroke-dashoffset":"strokeDashoffset",strokelinecap:"strokeLinecap","stroke-linecap":"strokeLinecap",strokelinejoin:"strokeLinejoin","stroke-linejoin":"strokeLinejoin",strokemiterlimit:"strokeMiterlimit","stroke-miterlimit":"strokeMiterlimit",strokewidth:"strokeWidth","stroke-width":"strokeWidth",strokeopacity:"strokeOpacity","stroke-opacity":"strokeOpacity",suppresscontenteditablewarning:"suppressContentEditableWarning",suppresshydrationwarning:"suppressHydrationWarning",surfacescale:"surfaceScale",systemlanguage:"systemLanguage",tablevalues:"tableValues",targetx:"targetX",targety:"targetY",textanchor:"textAnchor","text-anchor":"textAnchor",textdecoration:"textDecoration","text-decoration":"textDecoration",textlength:"textLength",textrendering:"textRendering","text-rendering":"textRendering",to:"to",transform:"transform",transformorigin:"transformOrigin","transform-origin":"transformOrigin",typeof:"typeof",u1:"u1",u2:"u2",underlineposition:"underlinePosition","underline-position":"underlinePosition",underlinethickness:"underlineThickness","underline-thickness":"underlineThickness",unicode:"unicode",unicodebidi:"unicodeBidi","unicode-bidi":"unicodeBidi",unicoderange:"unicodeRange","unicode-range":"unicodeRange",unitsperem:"unitsPerEm","units-per-em":"unitsPerEm",unselectable:"unselectable",valphabetic:"vAlphabetic","v-alphabetic":"vAlphabetic",values:"values",vectoreffect:"vectorEffect","vector-effect":"vectorEffect",version:"version",vertadvy:"vertAdvY","vert-adv-y":"vertAdvY",vertoriginx:"vertOriginX","vert-origin-x":"vertOriginX",vertoriginy:"vertOriginY","vert-origin-y":"vertOriginY",vhanging:"vHanging","v-hanging":"vHanging",videographic:"vIdeographic","v-ideographic":"vIdeographic",viewbox:"viewBox",viewtarget:"viewTarget",visibility:"visibility",vmathematical:"vMathematical","v-mathematical":"vMathematical",vocab:"vocab",widths:"widths",wordspacing:"wordSpacing","word-spacing":"wordSpacing",writingmode:"writingMode","writing-mode":"writingMode",x1:"x1",x2:"x2",x:"x",xchannelselector:"xChannelSelector",xheight:"xHeight","x-height":"xHeight",xlinkactuate:"xlinkActuate","xlink:actuate":"xlinkActuate",xlinkarcrole:"xlinkArcrole","xlink:arcrole":"xlinkArcrole",xlinkhref:"xlinkHref","xlink:href":"xlinkHref",xlinkrole:"xlinkRole","xlink:role":"xlinkRole",xlinkshow:"xlinkShow","xlink:show":"xlinkShow",xlinktitle:"xlinkTitle","xlink:title":"xlinkTitle",xlinktype:"xlinkType","xlink:type":"xlinkType",xmlbase:"xmlBase","xml:base":"xmlBase",xmllang:"xmlLang","xml:lang":"xmlLang",xmlns:"xmlns","xml:space":"xmlSpace",xmlnsxlink:"xmlnsXlink","xmlns:xlink":"xmlnsXlink",xmlspace:"xmlSpace",y1:"y1",y2:"y2",y:"y",ychannelselector:"yChannelSelector",z:"z",zoomandpan:"zoomAndPan"},In={"aria-current":0,"aria-description":0,"aria-details":0,"aria-disabled":0,"aria-hidden":0,"aria-invalid":0,"aria-keyshortcuts":0,"aria-label":0,"aria-roledescription":0,"aria-autocomplete":0,"aria-checked":0,"aria-expanded":0,"aria-haspopup":0,"aria-level":0,"aria-modal":0,"aria-multiline":0,"aria-multiselectable":0,"aria-orientation":0,"aria-placeholder":0,"aria-pressed":0,"aria-readonly":0,"aria-required":0,"aria-selected":0,"aria-sort":0,"aria-valuemax":0,"aria-valuemin":0,"aria-valuenow":0,"aria-valuetext":0,"aria-atomic":0,"aria-busy":0,"aria-live":0,"aria-relevant":0,"aria-dropeffect":0,"aria-grabbed":0,"aria-activedescendant":0,"aria-colcount":0,"aria-colindex":0,"aria-colspan":0,"aria-controls":0,"aria-describedby":0,"aria-errormessage":0,"aria-flowto":0,"aria-labelledby":0,"aria-owns":0,"aria-posinset":0,"aria-rowcount":0,"aria-rowindex":0,"aria-rowspan":0,"aria-setsize":0,"aria-braillelabel":0,"aria-brailleroledescription":0,"aria-colindextext":0,"aria-rowindextext":0},to={},Xo=RegExp("^(aria)-[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Zo=RegExp("^(aria)[A-Z][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),vr=!1,ts={},bl=/^on./,kN=/^on[^A-Z]/,LN=RegExp("^(aria)-[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),e3=RegExp("^(aria)[A-Z][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),hn=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i,cn=null,fn=null,co=null,Nr=!1,ia=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ns=!1;if(ia)try{var _s={};Object.defineProperty(_s,"passive",{get:function(){ns=!0}}),window.addEventListener("test",_s,_s),window.removeEventListener("test",_s,_s)}catch(S){ns=!1}var os=null,Lh=null,Su=null,DA={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(S){return S.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},GW=Kh(DA),Roe=pa({},DA,{view:0,detail:0}),axo=Kh(Roe),uNe,pNe,Qoe,X_e=pa({},Roe,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:c_,button:0,buttons:0,relatedTarget:function(S){return S.relatedTarget===void 0?S.fromElement===S.srcElement?S.toElement:S.fromElement:S.relatedTarget},movementX:function(S){if("movementX"in S)return S.movementX;return S!==Qoe&&(Qoe&&S.type==="mousemove"?(uNe=S.screenX-Qoe.screenX,pNe=S.screenY-Qoe.screenY):pNe=uNe=0,Qoe=S),uNe},movementY:function(S){return"movementY"in S?S.movementY:pNe}}),P2t=Kh(X_e),cxo=pa({},X_e,{dataTransfer:0}),lxo=Kh(cxo),hxo=pa({},Roe,{relatedTarget:0}),mNe=Kh(hxo),dxo=pa({},DA,{animationName:0,elapsedTime:0,pseudoElement:0}),uxo=Kh(dxo),pxo=pa({},DA,{clipboardData:function(S){return"clipboardData"in S?S.clipboardData:window.clipboardData}}),mxo=Kh(pxo),_xo=pa({},DA,{data:0}),E2t=Kh(_xo),gxo=E2t,Axo={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},fxo={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},yxo={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"},xxo=pa({},Roe,{key:function(S){if(S.key){var w=Axo[S.key]||S.key;if(w!=="Unidentified")return w}return S.type==="keypress"?(S=fg(S),S===13?"Enter":String.fromCharCode(S)):S.type==="keydown"||S.type==="keyup"?fxo[S.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:c_,charCode:function(S){return S.type==="keypress"?fg(S):0},keyCode:function(S){return S.type==="keydown"||S.type==="keyup"?S.keyCode:0},which:function(S){return S.type==="keypress"?fg(S):S.type==="keydown"||S.type==="keyup"?S.keyCode:0}}),Cxo=Kh(xxo),bxo=pa({},X_e,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),M2t=Kh(bxo),Ixo=pa({},DA,{submitter:0}),vxo=Kh(Ixo),Sxo=pa({},Roe,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:c_}),Pxo=Kh(Sxo),Exo=pa({},DA,{propertyName:0,elapsedTime:0,pseudoElement:0}),Mxo=Kh(Exo),wxo=pa({},X_e,{deltaX:function(S){return"deltaX"in S?S.deltaX:("wheelDeltaX"in S)?-S.wheelDeltaX:0},deltaY:function(S){return"deltaY"in S?S.deltaY:("wheelDeltaY"in S)?-S.wheelDeltaY:("wheelDelta"in S)?-S.wheelDelta:0},deltaZ:0,deltaMode:0}),Bxo=Kh(wxo),Txo=pa({},DA,{newState:0,oldState:0,source:0}),Dxo=Kh(Txo),Nxo=[9,13,27,32],w2t=229,_Ne=ia&&"CompositionEvent"in window,koe=null;ia&&"documentMode"in document&&(koe=document.documentMode);var Rxo=ia&&"TextEvent"in window&&!koe,B2t=ia&&(!_Ne||koe&&8<koe&&11>=koe),T2t=32,D2t=String.fromCharCode(T2t),N2t=!1,UW=!1,Qxo={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0},Loe=null,Hoe=null,R2t=!1;ia&&(R2t=Z1("input")&&(!document.documentMode||9<document.documentMode));var Py=typeof Object.is==="function"?Object.is:YH,kxo=ia&&"documentMode"in document&&11>=document.documentMode,WW=null,gNe=null,Foe=null,ANe=!1,XW={animationend:xm("Animation","AnimationEnd"),animationiteration:xm("Animation","AnimationIteration"),animationstart:xm("Animation","AnimationStart"),transitionrun:xm("Transition","TransitionRun"),transitionstart:xm("Transition","TransitionStart"),transitioncancel:xm("Transition","TransitionCancel"),transitionend:xm("Transition","TransitionEnd")},fNe={},Q2t={};ia&&(Q2t=document.createElement("div").style,("AnimationEvent"in window)||(delete XW.animationend.animation,delete XW.animationiteration.animation,delete XW.animationstart.animation),("TransitionEvent"in window)||delete XW.transitionend.transition);var k2t=hp("animationend"),L2t=hp("animationiteration"),H2t=hp("animationstart"),Lxo=hp("transitionrun"),Hxo=hp("transitionstart"),Fxo=hp("transitioncancel"),F2t=hp("transitionend"),z2t=new Map,yNe="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");yNe.push("scrollEnd");var zxo=0,O2t=0;if(typeof performance==="object"&&typeof performance.now==="function")var Oxo=performance,V2t=function(){return Oxo.now()};else{var Vxo=Date;V2t=function(){return Vxo.now()}}var xNe=typeof reportError==="function"?reportError:function(S){if(typeof window==="object"&&typeof window.ErrorEvent==="function"){var w=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof S==="object"&&S!==null&&typeof S.message==="string"?String(S.message):String(S),error:S});if(!window.dispatchEvent(w))return}else if(typeof process==="object"&&typeof process.emit==="function"){process.emit("uncaughtException",S);return}console.error(S)},Yxo="This object has been omitted by React in the console log to avoid sending too much data from the server. Try logging smaller or more specific objects.",j_e=0,CNe=1,bNe=2,INe=3,Ab=100,K_e="- ",$_e="+ ",Y2t="  ",Pu=typeof console<"u"&&typeof console.timeStamp==="function"&&typeof performance<"u"&&typeof performance.measure==="function",$x="Components ⚛",sc="Scheduler ⚛",fc="Blocking",HN=!1,UM={color:"primary",properties:null,tooltipText:"",track:$x},FN={start:-0,end:-0,detail:{devtools:UM}},Gxo=["Changed Props",""],G2t="This component received deeply equal props. It might benefit from useMemo or the React Compiler in its owner.",Uxo=["Changed Props",G2t],zoe=1,WM=2,fb=[],jW=0,vNe=0,zN={};Object.freeze(zN);var XM=null,KW=null,gs=0,Wxo=1,za=2,e1=8,A9=16,U2t=32,W2t=!1;try{var X2t=Object.preventExtensions({})}catch(S){W2t=!0}var SNe=new WeakMap,$W=[],qW=0,q_e=null,Ooe=0,yb=[],xb=0,jF=null,jM=1,KM="",NA=null,qd=null,Oa=!1,T7=!1,t3=null,ON=null,Cb=!1,PNe=Error("Hydration Mismatch Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React."),ENe=X(null),MNe=X(null),j2t={},J_e=null,JW=null,ZW=!1,Xxo=typeof AbortController<"u"?AbortController:function(){var S=[],w=this.signal={aborted:!1,addEventListener:function(Q,W){S.push(W)}};this.abort=function(){w.aborted=!0,S.forEach(function(Q){return Q()})}},jxo=Il.unstable_scheduleCallback,Kxo=Il.unstable_NormalPriority,x_={$$typeof:Yl,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0,_currentRenderer:null,_currentRenderer2:null},Voe=null,Lm=Il.unstable_now,Z_e=console.createTask?console.createTask:function(){return null},Yoe=1,ege=2,RA=-0,$M=-0,f9=-0,qM=null,Ey=-1.1,KF=-0,V0=-0,Qi=-1.1,rs=-1.1,g0=null,yp=!1,VN=-0,D7=-1.1,Goe=null,YN=0,wNe=null,BNe=null,$F=-1.1,Uoe=null,eX=-1.1,tge=-1.1,y9=-0,JM=-1.1,bb=-1.1,TNe=0,Woe=null,K2t=null,$2t=null,GN=-1.1,qF=null,UN=-1.1,nge=-1.1,DNe=-0,NNe=-0,JF=0,qx=null,q2t=0,Xoe=-1.1,oge=!1,rge=!1,joe=null,RNe=0,WN=0,tX=null,J2t=Xn.S;Xn.S=function(S,w){if(K1t=es(),typeof w==="object"&&w!==null&&typeof w.then==="function"){if(0>JM&&0>bb){JM=Lm();var Q=Kf(),W=F4();if(Q!==UN||W!==qF)UN=-1.1;GN=Q,qF=W}_I(S,w)}if(Voe!==null)for(Q=gX;Q!==null;)oy(Q,Voe),Q=Q.next;if(Q=S.types,Q!==null){for(W=gX;W!==null;)oy(W,Q),W=W.next;if(WN!==0){W=Voe,W===null&&(W=Voe=[]);for(var oe=0;oe<Q.length;oe++){var ae=Q[oe];W.indexOf(ae)===-1&&W.push(ae)}}}J2t!==null&&J2t(S,w)};var ZF=X(null),x9={recordUnsafeLifecycleWarnings:function(){},flushPendingUnsafeLifecycleWarnings:function(){},recordLegacyContextWarning:function(){},flushLegacyContextWarning:function(){},discardPendingWarnings:function(){}},Koe=[],$oe=[],qoe=[],Joe=[],Zoe=[],ere=[],ez=new Set;x9.recordUnsafeLifecycleWarnings=function(S,w){ez.has(S.type)||(typeof w.componentWillMount==="function"&&w.componentWillMount.__suppressDeprecationWarning!==!0&&Koe.push(S),S.mode&e1&&typeof w.UNSAFE_componentWillMount==="function"&&$oe.push(S),typeof w.componentWillReceiveProps==="function"&&w.componentWillReceiveProps.__suppressDeprecationWarning!==!0&&qoe.push(S),S.mode&e1&&typeof w.UNSAFE_componentWillReceiveProps==="function"&&Joe.push(S),typeof w.componentWillUpdate==="function"&&w.componentWillUpdate.__suppressDeprecationWarning!==!0&&Zoe.push(S),S.mode&e1&&typeof w.UNSAFE_componentWillUpdate==="function"&&ere.push(S))},x9.flushPendingUnsafeLifecycleWarnings=function(){var S=new Set;0<Koe.length&&(Koe.forEach(function(Qe){S.add(Y(Qe)||"Component"),ez.add(Qe.type)}),Koe=[]);var w=new Set;0<$oe.length&&($oe.forEach(function(Qe){w.add(Y(Qe)||"Component"),ez.add(Qe.type)}),$oe=[]);var Q=new Set;0<qoe.length&&(qoe.forEach(function(Qe){Q.add(Y(Qe)||"Component"),ez.add(Qe.type)}),qoe=[]);var W=new Set;0<Joe.length&&(Joe.forEach(function(Qe){W.add(Y(Qe)||"Component"),ez.add(Qe.type)}),Joe=[]);var oe=new Set;0<Zoe.length&&(Zoe.forEach(function(Qe){oe.add(Y(Qe)||"Component"),ez.add(Qe.type)}),Zoe=[]);var ae=new Set;if(0<ere.length&&(ere.forEach(function(Qe){ae.add(Y(Qe)||"Component"),ez.add(Qe.type)}),ere=[]),0<w.size){var De=d(w);console.error(`Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. See https://react.dev/link/unsafe-component-lifecycles for details.

* Move code with side effects to componentDidMount, and set initial state in the constructor.

Please update the following components: %s`,De)}0<W.size&&(De=d(W),console.error(`Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. See https://react.dev/link/unsafe-component-lifecycles for details.

* Move data fetching code or side effects to componentDidUpdate.
* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://react.dev/link/derived-state

Please update the following components: %s`,De)),0<ae.size&&(De=d(ae),console.error(`Using UNSAFE_componentWillUpdate in strict mode is not recommended and may indicate bugs in your code. See https://react.dev/link/unsafe-component-lifecycles for details.

* Move data fetching code or side effects to componentDidUpdate.

Please update the following components: %s`,De)),0<S.size&&(De=d(S),console.warn(`componentWillMount has been renamed, and is not recommended for use. See https://react.dev/link/unsafe-component-lifecycles for details.

* Move code with side effects to componentDidMount, and set initial state in the constructor.
* Rename componentWillMount to UNSAFE_componentWillMount to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.

Please update the following components: %s`,De)),0<Q.size&&(De=d(Q),console.warn(`componentWillReceiveProps has been renamed, and is not recommended for use. See https://react.dev/link/unsafe-component-lifecycles for details.

* Move data fetching code or side effects to componentDidUpdate.
* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://react.dev/link/derived-state
* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.

Please update the following components: %s`,De)),0<oe.size&&(De=d(oe),console.warn(`componentWillUpdate has been renamed, and is not recommended for use. See https://react.dev/link/unsafe-component-lifecycles for details.

* Move data fetching code or side effects to componentDidUpdate.
* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.

Please update the following components: %s`,De))};var ige=new Map,Z2t=new Set;x9.recordLegacyContextWarning=function(S,w){var Q=null;for(var W=S;W!==null;)W.mode&e1&&(Q=W),W=W.return;Q===null?console.error("Expected to find a StrictMode component in a strict mode tree. This error is likely caused by a bug in React. Please file an issue."):!Z2t.has(S.type)&&(W=ige.get(Q),S.type.contextTypes!=null||S.type.childContextTypes!=null||w!==null&&typeof w.getChildContext==="function")&&(W===void 0&&(W=[],ige.set(Q,W)),W.push(S))},x9.flushLegacyContextWarning=function(){ige.forEach(function(S){if(S.length!==0){var w=S[0],Q=new Set;S.forEach(function(oe){Q.add(Y(oe)||"Component"),Z2t.add(oe.type)});var W=d(Q);ye(w,function(){console.error(`Legacy context API has been detected within a strict-mode tree.

The old API will be supported in all 16.x releases, but applications using it should migrate to the new version.

Please update the following components: %s

Learn more about this warning here: https://react.dev/link/legacy-context`,W)})}})},x9.discardPendingWarnings=function(){Koe=[],$oe=[],qoe=[],Joe=[],Zoe=[],ere=[],ige=new Map};var $xo="",e1t={react_stack_bottom_frame:function(S,w,Q){var W=Z4;Z4=!0;try{return S(w,Q)}finally{Z4=W}}},QNe=e1t.react_stack_bottom_frame.bind(e1t),t1t={react_stack_bottom_frame:function(S){var w=Z4;Z4=!0;try{return S.render()}finally{Z4=w}}},n1t=t1t.react_stack_bottom_frame.bind(t1t),o1t={react_stack_bottom_frame:function(S,w){try{w.componentDidMount()}catch(Q){qc(S,S.return,Q)}}},kNe=o1t.react_stack_bottom_frame.bind(o1t),r1t={react_stack_bottom_frame:function(S,w,Q,W,oe){try{w.componentDidUpdate(Q,W,oe)}catch(ae){qc(S,S.return,ae)}}},i1t=r1t.react_stack_bottom_frame.bind(r1t),s1t={react_stack_bottom_frame:function(S,w){var Q=w.stack;S.componentDidCatch(w.value,{componentStack:Q!==null?Q:""})}},qxo=s1t.react_stack_bottom_frame.bind(s1t),a1t={react_stack_bottom_frame:function(S,w,Q){try{Q.componentWillUnmount()}catch(W){qc(S,w,W)}}},c1t=a1t.react_stack_bottom_frame.bind(a1t),l1t={react_stack_bottom_frame:function(S){var w=S.create;return S=S.inst,w=w(),S.destroy=w}},Jxo=l1t.react_stack_bottom_frame.bind(l1t),h1t={react_stack_bottom_frame:function(S,w,Q){try{Q()}catch(W){qc(S,w,W)}}},Zxo=h1t.react_stack_bottom_frame.bind(h1t),d1t={react_stack_bottom_frame:function(S){var w=S._init;return w(S._payload)}},e5o=d1t.react_stack_bottom_frame.bind(d1t),nX=Error("Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`."),LNe=Error("Suspense Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React."),sge=Error("Suspense Exception: This is not a real error! It's an implementation detail of `useActionState` to interrupt the current render. You must either rethrow it immediately, or move the `useActionState` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary."),age={then:function(){console.error('Internal React error: A listener was unexpectedly attached to a "noop" thenable. This is a bug in React. Please file an issue.')}},tz=null,cge=null,HNe=!1,nz=null,tre=!1,oX=null,nre=0,ac=null,FNe,u1t=FNe=!1,p1t={},m1t={},_1t={};h=function(S,w,Q){if(Q!==null&&typeof Q==="object"&&Q._store&&(!Q._store.validated&&Q.key==null||Q._store.validated===2)){if(typeof Q._store!=="object")throw Error("React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue.");Q._store.validated=1;var W=Y(S),oe=W||"null";if(!p1t[oe]){p1t[oe]=!0,Q=Q._owner,S=S._debugOwner;var ae="";S&&typeof S.tag==="number"&&(oe=Y(S))&&(ae=`

Check the render method of \``+oe+"`."),ae||W&&(ae=`

Check the top-level render call using <`+W+">.");var De="";Q!=null&&S!==Q&&(W=null,typeof Q.tag==="number"?W=Y(Q):typeof Q.name==="string"&&(W=Q.name),W&&(De=" It was passed a child from "+W+".")),ye(w,function(){console.error('Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',ae,De)})}}};var oz=yD(!0),g1t=yD(!1),A1t=0,f1t=1,y1t=2,zNe=3,XN=!1,x1t=!1,ONe=null,VNe=!1,jN=X(null),lge=X(0),Jf=X(null),t1=null,rX=1,ore=2,Zf=X(0),rre=0,Ib=1,My=2,n3=4,n1=8,iX,C1t=new Set,b1t=new Set,YNe=new Set,I1t=new Set,ZM=0,Is=null,xd=null,C_=null,hge=!1,sX=!1,rz=!1,dge=0,ire=0,N7=null,t5o=0,n5o=25,Un=null,vb=null,ew=-1,sre=!1,uge={readContext:fl,use:Au,useCallback:gd,useContext:gd,useEffect:gd,useImperativeHandle:gd,useLayoutEffect:gd,useInsertionEffect:gd,useMemo:gd,useReducer:gd,useRef:gd,useState:gd,useDebugValue:gd,useDeferredValue:gd,useTransition:gd,useSyncExternalStore:gd,useId:gd,useHostTransitionStatus:gd,useFormState:gd,useActionState:gd,useOptimistic:gd,useMemoCache:gd,useCacheRefresh:gd,useEffectEvent:gd},GNe=null,v1t=null,UNe=null,S1t=null,R7=null,C9=null,pge=null;GNe={readContext:function(S){return fl(S)},use:Au,useCallback:function(S,w){return Un="useCallback",ra(),yI(w),zD(S,w)},useContext:function(S){return Un="useContext",ra(),fl(S)},useEffect:function(S,w){return Un="useEffect",ra(),yI(w),HD(S,w)},useImperativeHandle:function(S,w,Q){return Un="useImperativeHandle",ra(),yI(Q),FD(S,w,Q)},useInsertionEffect:function(S,w){Un="useInsertionEffect",ra(),yI(w),FC(4,My,S,w)},useLayoutEffect:function(S,w){return Un="useLayoutEffect",ra(),yI(w),VC(S,w)},useMemo:function(S,w){Un="useMemo",ra(),yI(w);var Q=Xn.H;Xn.H=R7;try{return D8(S,w)}finally{Xn.H=Q}},useReducer:function(S,w,Q){Un="useReducer",ra();var W=Xn.H;Xn.H=R7;try{return BD(S,w,Q)}finally{Xn.H=W}},useRef:function(S){return Un="useRef",ra(),Wd(S)},useState:function(S){Un="useState",ra();var w=Xn.H;Xn.H=R7;try{return II(S)}finally{Xn.H=w}},useDebugValue:function(){Un="useDebugValue",ra()},useDeferredValue:function(S,w){return Un="useDeferredValue",ra(),R8(S,w)},useTransition:function(){return Un="useTransition",ra(),gM()},useSyncExternalStore:function(S,w,Q){return Un="useSyncExternalStore",ra(),DD(S,w,Q)},useId:function(){return Un="useId",ra(),YC()},useFormState:function(S,w){return Un="useFormState",ra(),B8(),SI(S,w)},useActionState:function(S,w){return Un="useActionState",ra(),SI(S,w)},useOptimistic:function(S){return Un="useOptimistic",ra(),D4(S)},useHostTransitionStatus:R4,useMemoCache:kC,useCacheRefresh:function(){return Un="useCacheRefresh",ra(),UD()},useEffectEvent:function(S){return Un="useEffectEvent",ra(),MI(S)}},v1t={readContext:function(S){return fl(S)},use:Au,useCallback:function(S,w){return Un="useCallback",Do(),zD(S,w)},useContext:function(S){return Un="useContext",Do(),fl(S)},useEffect:function(S,w){return Un="useEffect",Do(),HD(S,w)},useImperativeHandle:function(S,w,Q){return Un="useImperativeHandle",Do(),FD(S,w,Q)},useInsertionEffect:function(S,w){Un="useInsertionEffect",Do(),FC(4,My,S,w)},useLayoutEffect:function(S,w){return Un="useLayoutEffect",Do(),VC(S,w)},useMemo:function(S,w){Un="useMemo",Do();var Q=Xn.H;Xn.H=R7;try{return D8(S,w)}finally{Xn.H=Q}},useReducer:function(S,w,Q){Un="useReducer",Do();var W=Xn.H;Xn.H=R7;try{return BD(S,w,Q)}finally{Xn.H=W}},useRef:function(S){return Un="useRef",Do(),Wd(S)},useState:function(S){Un="useState",Do();var w=Xn.H;Xn.H=R7;try{return II(S)}finally{Xn.H=w}},useDebugValue:function(){Un="useDebugValue",Do()},useDeferredValue:function(S,w){return Un="useDeferredValue",Do(),R8(S,w)},useTransition:function(){return Un="useTransition",Do(),gM()},useSyncExternalStore:function(S,w,Q){return Un="useSyncExternalStore",Do(),DD(S,w,Q)},useId:function(){return Un="useId",Do(),YC()},useActionState:function(S,w){return Un="useActionState",Do(),SI(S,w)},useFormState:function(S,w){return Un="useFormState",Do(),B8(),SI(S,w)},useOptimistic:function(S){return Un="useOptimistic",Do(),D4(S)},useHostTransitionStatus:R4,useMemoCache:kC,useCacheRefresh:function(){return Un="useCacheRefresh",Do(),UD()},useEffectEvent:function(S){return Un="useEffectEvent",Do(),MI(S)}},UNe={readContext:function(S){return fl(S)},use:Au,useCallback:function(S,w){return Un="useCallback",Do(),T8(S,w)},useContext:function(S){return Un="useContext",Do(),fl(S)},useEffect:function(S,w){Un="useEffect",Do(),bg(2048,n1,S,w)},useImperativeHandle:function(S,w,Q){return Un="useImperativeHandle",Do(),pM(S,w,Q)},useInsertionEffect:function(S,w){return Un="useInsertionEffect",Do(),bg(4,My,S,w)},useLayoutEffect:function(S,w){return Un="useLayoutEffect",Do(),bg(4,n3,S,w)},useMemo:function(S,w){Un="useMemo",Do();var Q=Xn.H;Xn.H=C9;try{return N8(S,w)}finally{Xn.H=Q}},useReducer:function(S,w,Q){Un="useReducer",Do();var W=Xn.H;Xn.H=C9;try{return bA(S,w,Q)}finally{Xn.H=W}},useRef:function(){return Un="useRef",Do(),cl().memoizedState},useState:function(){Un="useState",Do();var S=Xn.H;Xn.H=C9;try{return bA(Ad)}finally{Xn.H=S}},useDebugValue:function(){Un="useDebugValue",Do()},useDeferredValue:function(S,w){return Un="useDeferredValue",Do(),rW(S,w)},useTransition:function(){return Un="useTransition",Do(),rF()},useSyncExternalStore:function(S,w,Q){return Un="useSyncExternalStore",Do(),H2(S,w,Q)},useId:function(){return Un="useId",Do(),cl().memoizedState},useFormState:function(S){return Un="useFormState",Do(),B8(),PI(S)},useActionState:function(S){return Un="useActionState",Do(),PI(S)},useOptimistic:function(S,w){return Un="useOptimistic",Do(),LC(S,w)},useHostTransitionStatus:R4,useMemoCache:kC,useCacheRefresh:function(){return Un="useCacheRefresh",Do(),cl().memoizedState},useEffectEvent:function(S){return Un="useEffectEvent",Do(),OC(S)}},S1t={readContext:function(S){return fl(S)},use:Au,useCallback:function(S,w){return Un="useCallback",Do(),T8(S,w)},useContext:function(S){return Un="useContext",Do(),fl(S)},useEffect:function(S,w){Un="useEffect",Do(),bg(2048,n1,S,w)},useImperativeHandle:function(S,w,Q){return Un="useImperativeHandle",Do(),pM(S,w,Q)},useInsertionEffect:function(S,w){return Un="useInsertionEffect",Do(),bg(4,My,S,w)},useLayoutEffect:function(S,w){return Un="useLayoutEffect",Do(),bg(4,n3,S,w)},useMemo:function(S,w){Un="useMemo",Do();var Q=Xn.H;Xn.H=pge;try{return N8(S,w)}finally{Xn.H=Q}},useReducer:function(S,w,Q){Un="useReducer",Do();var W=Xn.H;Xn.H=pge;try{return ay(S,w,Q)}finally{Xn.H=W}},useRef:function(){return Un="useRef",Do(),cl().memoizedState},useState:function(){Un="useState",Do();var S=Xn.H;Xn.H=pge;try{return ay(Ad)}finally{Xn.H=S}},useDebugValue:function(){Un="useDebugValue",Do()},useDeferredValue:function(S,w){return Un="useDeferredValue",Do(),OD(S,w)},useTransition:function(){return Un="useTransition",Do(),iW()},useSyncExternalStore:function(S,w,Q){return Un="useSyncExternalStore",Do(),H2(S,w,Q)},useId:function(){return Un="useId",Do(),cl().memoizedState},useFormState:function(S){return Un="useFormState",Do(),B8(),u_(S)},useActionState:function(S){return Un="useActionState",Do(),u_(S)},useOptimistic:function(S,w){return Un="useOptimistic",Do(),HC(S,w)},useHostTransitionStatus:R4,useMemoCache:kC,useCacheRefresh:function(){return Un="useCacheRefresh",Do(),cl().memoizedState},useEffectEvent:function(S){return Un="useEffectEvent",Do(),OC(S)}},R7={readContext:function(S){return c(),fl(S)},use:function(S){return a(),Au(S)},useCallback:function(S,w){return Un="useCallback",a(),ra(),zD(S,w)},useContext:function(S){return Un="useContext",a(),ra(),fl(S)},useEffect:function(S,w){return Un="useEffect",a(),ra(),HD(S,w)},useImperativeHandle:function(S,w,Q){return Un="useImperativeHandle",a(),ra(),FD(S,w,Q)},useInsertionEffect:function(S,w){Un="useInsertionEffect",a(),ra(),FC(4,My,S,w)},useLayoutEffect:function(S,w){return Un="useLayoutEffect",a(),ra(),VC(S,w)},useMemo:function(S,w){Un="useMemo",a(),ra();var Q=Xn.H;Xn.H=R7;try{return D8(S,w)}finally{Xn.H=Q}},useReducer:function(S,w,Q){Un="useReducer",a(),ra();var W=Xn.H;Xn.H=R7;try{return BD(S,w,Q)}finally{Xn.H=W}},useRef:function(S){return Un="useRef",a(),ra(),Wd(S)},useState:function(S){Un="useState",a(),ra();var w=Xn.H;Xn.H=R7;try{return II(S)}finally{Xn.H=w}},useDebugValue:function(){Un="useDebugValue",a(),ra()},useDeferredValue:function(S,w){return Un="useDeferredValue",a(),ra(),R8(S,w)},useTransition:function(){return Un="useTransition",a(),ra(),gM()},useSyncExternalStore:function(S,w,Q){return Un="useSyncExternalStore",a(),ra(),DD(S,w,Q)},useId:function(){return Un="useId",a(),ra(),YC()},useFormState:function(S,w){return Un="useFormState",a(),ra(),SI(S,w)},useActionState:function(S,w){return Un="useActionState",a(),ra(),SI(S,w)},useOptimistic:function(S){return Un="useOptimistic",a(),ra(),D4(S)},useMemoCache:function(S){return a(),kC(S)},useHostTransitionStatus:R4,useCacheRefresh:function(){return Un="useCacheRefresh",ra(),UD()},useEffectEvent:function(S){return Un="useEffectEvent",a(),ra(),MI(S)}},C9={readContext:function(S){return c(),fl(S)},use:function(S){return a(),Au(S)},useCallback:function(S,w){return Un="useCallback",a(),Do(),T8(S,w)},useContext:function(S){return Un="useContext",a(),Do(),fl(S)},useEffect:function(S,w){Un="useEffect",a(),Do(),bg(2048,n1,S,w)},useImperativeHandle:function(S,w,Q){return Un="useImperativeHandle",a(),Do(),pM(S,w,Q)},useInsertionEffect:function(S,w){return Un="useInsertionEffect",a(),Do(),bg(4,My,S,w)},useLayoutEffect:function(S,w){return Un="useLayoutEffect",a(),Do(),bg(4,n3,S,w)},useMemo:function(S,w){Un="useMemo",a(),Do();var Q=Xn.H;Xn.H=C9;try{return N8(S,w)}finally{Xn.H=Q}},useReducer:function(S,w,Q){Un="useReducer",a(),Do();var W=Xn.H;Xn.H=C9;try{return bA(S,w,Q)}finally{Xn.H=W}},useRef:function(){return Un="useRef",a(),Do(),cl().memoizedState},useState:function(){Un="useState",a(),Do();var S=Xn.H;Xn.H=C9;try{return bA(Ad)}finally{Xn.H=S}},useDebugValue:function(){Un="useDebugValue",a(),Do()},useDeferredValue:function(S,w){return Un="useDeferredValue",a(),Do(),rW(S,w)},useTransition:function(){return Un="useTransition",a(),Do(),rF()},useSyncExternalStore:function(S,w,Q){return Un="useSyncExternalStore",a(),Do(),H2(S,w,Q)},useId:function(){return Un="useId",a(),Do(),cl().memoizedState},useFormState:function(S){return Un="useFormState",a(),Do(),PI(S)},useActionState:function(S){return Un="useActionState",a(),Do(),PI(S)},useOptimistic:function(S,w){return Un="useOptimistic",a(),Do(),LC(S,w)},useMemoCache:function(S){return a(),kC(S)},useHostTransitionStatus:R4,useCacheRefresh:function(){return Un="useCacheRefresh",Do(),cl().memoizedState},useEffectEvent:function(S){return Un="useEffectEvent",a(),Do(),OC(S)}},pge={readContext:function(S){return c(),fl(S)},use:function(S){return a(),Au(S)},useCallback:function(S,w){return Un="useCallback",a(),Do(),T8(S,w)},useContext:function(S){return Un="useContext",a(),Do(),fl(S)},useEffect:function(S,w){Un="useEffect",a(),Do(),bg(2048,n1,S,w)},useImperativeHandle:function(S,w,Q){return Un="useImperativeHandle",a(),Do(),pM(S,w,Q)},useInsertionEffect:function(S,w){return Un="useInsertionEffect",a(),Do(),bg(4,My,S,w)},useLayoutEffect:function(S,w){return Un="useLayoutEffect",a(),Do(),bg(4,n3,S,w)},useMemo:function(S,w){Un="useMemo",a(),Do();var Q=Xn.H;Xn.H=C9;try{return N8(S,w)}finally{Xn.H=Q}},useReducer:function(S,w,Q){Un="useReducer",a(),Do();var W=Xn.H;Xn.H=C9;try{return ay(S,w,Q)}finally{Xn.H=W}},useRef:function(){return Un="useRef",a(),Do(),cl().memoizedState},useState:function(){Un="useState",a(),Do();var S=Xn.H;Xn.H=C9;try{return ay(Ad)}finally{Xn.H=S}},useDebugValue:function(){Un="useDebugValue",a(),Do()},useDeferredValue:function(S,w){return Un="useDeferredValue",a(),Do(),OD(S,w)},useTransition:function(){return Un="useTransition",a(),Do(),iW()},useSyncExternalStore:function(S,w,Q){return Un="useSyncExternalStore",a(),Do(),H2(S,w,Q)},useId:function(){return Un="useId",a(),Do(),cl().memoizedState},useFormState:function(S){return Un="useFormState",a(),Do(),u_(S)},useActionState:function(S){return Un="useActionState",a(),Do(),u_(S)},useOptimistic:function(S,w){return Un="useOptimistic",a(),Do(),HC(S,w)},useMemoCache:function(S){return a(),kC(S)},useHostTransitionStatus:R4,useCacheRefresh:function(){return Un="useCacheRefresh",Do(),cl().memoizedState},useEffectEvent:function(S){return Un="useEffectEvent",a(),Do(),OC(S)}};var P1t={},E1t=new Set,M1t=new Set,w1t=new Set,B1t=new Set,T1t=new Set,D1t=new Set,N1t=new Set,R1t=new Set,Q1t=new Set,k1t=new Set;Object.freeze(P1t);var WNe={enqueueSetState:function(S,w,Q){S=S._reactInternals;var W=Pm(S),oe=al(W);oe.payload=w,Q!==void 0&&Q!==null&&(KD(Q),oe.callback=Q),w=NC(S,oe,W),w!==null&&(Qf(W,"this.setState()",S),Kd(w,S,W),cM(w,S,W))},enqueueReplaceState:function(S,w,Q){S=S._reactInternals;var W=Pm(S),oe=al(W);oe.tag=f1t,oe.payload=w,Q!==void 0&&Q!==null&&(KD(Q),oe.callback=Q),w=NC(S,oe,W),w!==null&&(Qf(W,"this.replaceState()",S),Kd(w,S,W),cM(w,S,W))},enqueueForceUpdate:function(S,w){S=S._reactInternals;var Q=Pm(S),W=al(Q);W.tag=y1t,w!==void 0&&w!==null&&(KD(w),W.callback=w),w=NC(S,W,Q),w!==null&&(Qf(Q,"this.forceUpdate()",S),Kd(w,S,Q),cM(w,S,Q))}},aX=null,XNe=null,jNe=Error("This is not a real error. It's an implementation detail of React's selective hydration feature. If this leaks into userspace, it's a bug in React. Please file an issue."),Hm=!1,L1t={},H1t={},F1t={},z1t={},cX=!1,O1t={},KNe={},V1t={},$Ne={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null},Y1t=!1,G1t=null;G1t=new Set;var mge=!1,o3=null,Q7=null,Jx=0,_ge=new Map,U1t={},are=0,qNe=1,gge=2,QA=!1,Hh=!1,k7=!1,JNe=!1,W1t=typeof WeakSet==="function"?WeakSet:Set,kA=null,lX=null,hX=null,L7=!1,cre=!1,Age=!1,ZNe=!1,b_=null,Zx=!1,b9=null,Ng=!1,iz=8192,o5o={getCacheForType:function(S){var w=fl(x_),Q=w.data.get(S);return Q===void 0&&(Q=S(),w.data.set(S,Q)),Q},cacheSignal:function(){return fl(x_).controller.signal},getOwner:function(){return Dg}};if(typeof Symbol==="function"&&Symbol.for){var lre=Symbol.for;lre("selector.component"),lre("selector.has_pseudo_class"),lre("selector.role"),lre("selector.test_id"),lre("selector.text")}var r5o=[],i5o=typeof WeakMap==="function"?WeakMap:Map,LA=0,Rg=2,r3=4,tw=0,hre=1,sz=2,fge=3,KN=4,dre=6,X1t=5,hl=LA,Cd=null,qa=null,ma=0,e5=0,yge=1,az=2,ure=3,j1t=4,eRe=5,pre=6,xge=7,tRe=8,cz=9,Fh=e5,i3=null,nw=!1,dX=!1,nRe=!1,H7=0,Y0=tw,$N=0,qN=0,Cge=0,t5=0,lz=0,mre=null,wy=null,bge=!1,Ige=0,K1t=0,$1t=300,vge=1/0,q1t=500,_re=null,xp=null,JN=null,Sge=0,gre=1,oRe=2,J1t=3,F7=0,Z1t=1,eyt=2,rRe=3,iRe=4,Pge=5,G0=0,I9=null,hz=null,n5=0,sRe=0,Ege=-0,aRe=null,tyt=null,uX=null,pX=null,mX=null,Mge=null,s3=Sge,cRe=null,s5o=50,Are=0,wge=null,lRe=!1,Bge=!1,a5o=50,dz=0,fre=null,_X=!1,nyt=!1,Tge=null,oyt=!1,ryt=new Set,c5o={},gX=null,AX=null,hRe=!1,dRe=!1,Dge=!1,uRe=!1,ZN=0,pRe={};(function(){for(var S=0;S<yNe.length;S++){var w=yNe[S],Q=w.toLowerCase();w=w[0].toUpperCase()+w.slice(1),Cm(Q,"on"+w)}Cm(k2t,"onAnimationEnd"),Cm(L2t,"onAnimationIteration"),Cm(H2t,"onAnimationStart"),Cm("dblclick","onDoubleClick"),Cm("focusin","onFocus"),Cm("focusout","onBlur"),Cm(Lxo,"onTransitionRun"),Cm(Hxo,"onTransitionStart"),Cm(Fxo,"onTransitionCancel"),Cm(F2t,"onTransitionEnd")})(),To("onMouseEnter",["mouseout","mouseover"]),To("onMouseLeave",["mouseout","mouseover"]),To("onPointerEnter",["pointerout","pointerover"]),To("onPointerLeave",["pointerout","pointerover"]),no("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),no("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),no("onBeforeInput",["compositionend","keypress","textInput","paste"]),no("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),no("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),no("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var yre="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),mRe=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(yre)),Nge="_reactListening"+Math.random().toString(36).slice(2),iyt=!1,syt=!1,Rge=!1,ayt=!1,Qge=!1,kge=!1,cyt=!1,Lge={},l5o=/\r\n?/g,h5o=/\u0000|\uFFFD/g,uz="http://www.w3.org/1999/xlink",_Re="http://www.w3.org/XML/1998/namespace",d5o={},u5o="javascript:throw new Error('React form unexpectedly submitted.')",p5o="suppressHydrationWarning",pz="&",Hge="/&",xre="$",Cre="/$",eR="$?",mz="$~",fX="$!",m5o="html",_5o="body",g5o="head",gRe="F!",lyt="F",hyt="loading",dyt="style",ow=0,yX=1,Fge=2,ARe=null,fRe=null,uyt=!1,pyt={dialog:!0,webview:!0},yRe=null,bre=void 0,xRe=typeof setTimeout==="function"?setTimeout:void 0,A5o=typeof clearTimeout==="function"?clearTimeout:void 0,_z=-1,myt=typeof Promise==="function"?Promise:void 0,_yt=typeof requestAnimationFrame==="function"?requestAnimationFrame:xRe,f5o=typeof queueMicrotask==="function"?queueMicrotask:typeof myt<"u"?function(S){return myt.resolve(null).then(S).catch(i7)}:xRe,y5o=500;wm.prototype.animate=function(S,w){return w=typeof w==="number"?{duration:w}:pa({},w),w.pseudoElement=this._selector,this._scope.animate(S,w)},wm.prototype.getAnimations=function(){for(var S=this._scope,w=this._selector,Q=S.getAnimations({subtree:!0}),W=[],oe=0;oe<Q.length;oe++){var ae=Q[oe].effect;ae!==null&&ae.target===S&&ae.pseudoElement===w&&W.push(Q[oe])}return W},wm.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)},$h.prototype.addEventListener=function(S,w,Q){var W=null,oe=null;if(Q!=null&&typeof Q!=="boolean"&&(W=Q.signal||null,W!==null&&W.aborted))return;this._eventListeners===null&&(this._eventListeners=[]);var ae=this._eventListeners;if(Y4(ae,S,w,Q)===-1){var De=this,Qe=w;Q!=null&&typeof Q!=="boolean"&&Q.once===!0&&(Qe=function(ot){De.removeEventListener(S,w,Q),typeof w==="function"?w.call(this,ot):w.handleEvent(ot)}),W!==null&&(oe=De.removeEventListener.bind(De,S,w,Q),W.addEventListener("abort",oe,{once:!0}),oe=W.removeEventListener.bind(W,"abort",oe)),W=Nh(Q),ae.push({type:S,listener:w,optionsOrUseCapture:Q,attachedListener:Qe,cleanup:oe}),I(this._fragmentFiber,Bm,S,Qe,W)}this._eventListeners=ae},$h.prototype.removeEventListener=function(S,w,Q){var W=this._eventListeners;if(W!==null&&(w=Y4(W,S,w,Q),w!==-1)){var oe=W[w];Q=oe.attachedListener;var ae=oe.cleanup;oe=Nh(oe.optionsOrUseCapture),I(this._fragmentFiber,Ap,S,Q,oe),W.splice(w,1),ae!==null&&ae()}},$h.prototype.dispatchEvent=function(S){var w=P(this._fragmentFiber);if(w===null)return!0;w=N(w);var Q=this._eventListeners;if(Q!==null&&0<Q.length||!S.bubbles){var W=w.nodeType===9?w.createComment(""):document.createTextNode("");if(Q)for(var oe=0;oe<Q.length;oe++){var ae=Q[oe];W.addEventListener(ae.type,ae.attachedListener,Nh(ae.optionsOrUseCapture))}if(w.appendChild(W),S=W.dispatchEvent(S),Q)for(oe=0;oe<Q.length;oe++)ae=Q[oe],W.removeEventListener(ae.type,ae.attachedListener,Nh(ae.optionsOrUseCapture));return w.removeChild(W),S}return w.dispatchEvent(S)},$h.prototype.focus=function(S){v(this._fragmentFiber.child,!0,RM,S,void 0,void 0)},$h.prototype.focusLast=function(S){var w=[];v(this._fragmentFiber.child,!0,QM,w,void 0,void 0);for(var Q=w.length-1;0<=Q&&!RM(w[Q],S);Q--);},$h.prototype.blur=function(){var S=P(this._fragmentFiber);S!==null&&(S=N(S),S=Dh(S).activeElement,S!==null&&I(this._fragmentFiber,QF,S))},$h.prototype.observeUsing=function(S){var w=!1,Q=!1;I(this._fragmentFiber,function(W){if(W.tag===6)w=!0;else return Q=!0;return!1}),w&&!Q&&console.error("observeUsing() was called on a FragmentInstance with only text children. Observers do not work on text nodes."),this._observers===null&&(this._observers=new Set),this._observers.add(S),I(this._fragmentFiber,kM,S)},$h.prototype.unobserveUsing=function(S){var w=this._observers;if(w!==null&&w.has(S)){w.delete(S),I(this._fragmentFiber,kF,S);for(var Q=w=0;Q<v9.length;Q++){var W=v9[Q];W.fragmentInstance===this&&W.observer===S?S.unobserve(W.instance):v9[w++]=W}v9.length=w}else console.error("You are calling unobserveUsing() with an observer that is not being observed with this fragment instance. First attach the observer with observeUsing()")};var v9=[],CRe=!1;$h.prototype.getClientRects=function(){var S=[];return I(this._fragmentFiber,LF,S),S},$h.prototype.getRootNode=function(S){var w=P(this._fragmentFiber);return w===null?this:N(w).getRootNode(S)},$h.prototype.compareDocumentPosition=function(S){var w=P(this._fragmentFiber);if(w===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var Q=[];I(this._fragmentFiber,QM,Q);var W=N(w);if(Q.length===0){if(w=W,M(this._fragmentFiber)){e:{for(Q=this._fragmentFiber.return;Q!==null;){if(Q.tag===4){Q=Q.stateNode.containerInfo;break e}if(Q.tag===3||Q.tag===5||Q.tag===27)break;Q=Q.return}Q=null}Q!=null&&(w=Q)}Q=this._fragmentFiber;var oe=W=w.compareDocumentPosition(S);return w===S?oe=Node.DOCUMENT_POSITION_CONTAINS:W&Node.DOCUMENT_POSITION_CONTAINED_BY&&(Q=B(Q)[1],Q===null?oe=Node.DOCUMENT_POSITION_PRECEDING:(S=N(Q).compareDocumentPosition(S),oe=S===0||S&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),oe|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}w=N(Q[0]),oe=N(Q[Q.length-1]);var ae=M(this._fragmentFiber)?w.parentElement:W;if(ae==null)return Node.DOCUMENT_POSITION_DISCONNECTED;W=ae.compareDocumentPosition(w)&Node.DOCUMENT_POSITION_CONTAINED_BY,ae=ae.compareDocumentPosition(oe)&Node.DOCUMENT_POSITION_CONTAINED_BY;var De=w.compareDocumentPosition(S),Qe=oe.compareDocumentPosition(S),ot=De&Node.DOCUMENT_POSITION_CONTAINED_BY||Qe&Node.DOCUMENT_POSITION_CONTAINED_BY;return Qe=W&&ae&&De&Node.DOCUMENT_POSITION_FOLLOWING&&Qe&Node.DOCUMENT_POSITION_PRECEDING,w=W&&w===S||ae&&oe===S||ot||Qe?Node.DOCUMENT_POSITION_CONTAINED_BY:!W&&w===S||!ae&&oe===S?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:De,w&Node.DOCUMENT_POSITION_DISCONNECTED||w&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||HF(w,this._fragmentFiber,Q[0],Q[Q.length-1],S)?w:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC},$h.prototype.scrollIntoView=function(S){if(typeof S==="object")throw Error("FragmentInstance.scrollIntoView() does not support scrollIntoViewOptions. Use the alignToTop boolean instead.");var w=[];I(this._fragmentFiber,QM,w);var Q=S!==!1;if(w.length===0){var W=B(this._fragmentFiber);if(W=Q?W[1]||W[0]||P(this._fragmentFiber):W[0]||W[1],W===null)return;if(W.tag===6){S=N(W),bN(S,Q);return}if(W=N(W),W.nodeType!==9){if(W.nodeType===11){Q="host"in W?W.host:null,Q!==null?Q.scrollIntoView(S):console.warn("You are attempting to scroll a FragmentInstance that is only mounted inside a detached DocumentFragment. No scroll was performed.");return}W.scrollIntoView(S)}}for(W=Q?w.length-1:0;W!==(Q?-1:w.length);){var oe=w[W];oe.tag===6?(oe=N(oe),bN(oe,Q)):N(oe).scrollIntoView(S),W+=Q?-1:1}};var bRe=null,gz=0,Ire=1,gyt=2,Ayt=3,Sb=4,Pb=new Map,fyt=new Set,rw=Jc.d;Jc.d={f:function(){var S=rw.f(),w=GI();return S||w},r:function(S){var w=pn(S);w!==null&&w.tag===5&&w.type==="form"?oF(w):rw.r(S)},D:function(S){rw.D(S),vN("dns-prefetch",S,null)},C:function(S,w){rw.C(S,w),vN("preconnect",S,w)},L:function(S,w,Q){rw.L(S,w,Q);var W=xX;if(W&&S&&w){var oe='link[rel="preload"][as="'+Bn(w)+'"]';w==="image"?Q&&Q.imageSrcSet?(oe+='[imagesrcset="'+Bn(Q.imageSrcSet)+'"]',typeof Q.imageSizes==="string"&&(oe+='[imagesizes="'+Bn(Q.imageSizes)+'"]')):oe+='[href="'+Bn(S)+'"]':oe+='[href="'+Bn(S)+'"]';var ae=oe;switch(w){case"style":ae=fp(S);break;case"script":ae=G(S)}if(!(Pb.has(ae)||(S=pa({rel:"preload",href:w==="image"&&Q&&Q.imageSrcSet?void 0:S,as:w},Q),Pb.set(ae,S),W.querySelector(oe)!==null||w==="style"&&W.querySelector(Iu(ae))||w==="script"&&W.querySelector(he(ae))))){var De=W.createElement("link");Vp(De,"link",S),w==="style"&&(De[m9]=!0,De.onload=De.onerror=function(){_n(De)}),mn(De),W.head.appendChild(De)}}},m:function(S,w){rw.m(S,w);var Q=xX;if(Q&&S){var W=w&&typeof w.as==="string"?w.as:"script",oe='link[rel="modulepreload"][as="'+Bn(W)+'"][href="'+Bn(S)+'"]',ae=oe;switch(W){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":ae=G(S)}if(!Pb.has(ae)&&(S=pa({rel:"modulepreload",href:S},w),Pb.set(ae,S),Q.querySelector(oe)===null)){switch(W){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(Q.querySelector(he(ae)))return}W=Q.createElement("link"),Vp(W,"link",S),mn(W),Q.head.appendChild(W)}}},X:function(S,w){rw.X(S,w);var Q=xX;if(Q&&S){var W=Fn(Q).hoistableScripts,oe=G(S),ae=W.get(oe);ae||(ae=Q.querySelector(he(oe)),ae||(S=pa({src:S,async:!0},w),(w=Pb.get(oe))&&yt(S,w),ae=Q.createElement("script"),mn(ae),Vp(ae,"link",S),Q.head.appendChild(ae)),ae={type:"script",instance:ae,count:1,state:null},W.set(oe,ae))}},S:function(S,w,Q){rw.S(S,w,Q);var W=xX;if(W&&S){var oe=Fn(W).hoistableStyles,ae=fp(S);w=w||"default";var De=oe.get(ae);if(!De){var Qe={loading:gz,preload:null};if(De=W.querySelector(Iu(ae)))Qe.loading=Ire|Sb;else{S=pa({rel:"stylesheet",href:S,"data-precedence":w},Q),(Q=Pb.get(ae))&&tt(S,Q);var ot=De=W.createElement("link");mn(ot),Vp(ot,"link",S),ot._p=new Promise(function(_t,Yt){ot.onload=_t,ot.onerror=Yt}),ot.addEventListener("load",function(){Qe.loading|=Ire}),ot.addEventListener("error",function(){Qe.loading|=gyt}),Qe.loading|=Sb,Fe(De,w,W)}De={type:"stylesheet",instance:De,count:1,state:Qe},oe.set(ae,De)}}},M:function(S,w){rw.M(S,w);var Q=xX;if(Q&&S){var W=Fn(Q).hoistableScripts,oe=G(S),ae=W.get(oe);ae||(ae=Q.querySelector(he(oe)),ae||(S=pa({src:S,async:!0,type:"module"},w),(w=Pb.get(oe))&&yt(S,w),ae=Q.createElement("script"),mn(ae),Vp(ae,"link",S),Q.head.appendChild(ae)),ae={type:"script",instance:ae,count:1,state:null},W.set(oe,ae))}}};var xX=typeof document>"u"?null:document,zge=null,x5o=60000,C5o=800,b5o=500,Oge=0,IRe=null,Vge=null,Az=OF,CX={$$typeof:Yl,Provider:null,Consumer:null,_currentValue:Az,_currentValue2:Az,_threadCount:0},yyt="%c%s%c",xyt="background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px",Cyt="",Yge=" ",I5o=Function.prototype.bind,byt=!1,Iyt=null,vyt=null,Syt=null,Pyt=null,Eyt=null,Myt=null,wyt=null,Byt=null,Tyt=null,Dyt=null;Iyt=function(S,w,Q,W){w=e(S,w),w!==null&&(Q=t(w.memoizedState,Q,0,W),w.memoizedState=Q,w.baseState=Q,S.memoizedProps=pa({},S.memoizedProps),Q=Ln(S,2),Q!==null&&Kd(Q,S,2))},vyt=function(S,w,Q){w=e(S,w),w!==null&&(Q=r(w.memoizedState,Q,0),w.memoizedState=Q,w.baseState=Q,S.memoizedProps=pa({},S.memoizedProps),Q=Ln(S,2),Q!==null&&Kd(Q,S,2))},Syt=function(S,w,Q,W){w=e(S,w),w!==null&&(Q=n(w.memoizedState,Q,W),w.memoizedState=Q,w.baseState=Q,S.memoizedProps=pa({},S.memoizedProps),Q=Ln(S,2),Q!==null&&Kd(Q,S,2))},Pyt=function(S,w,Q){S.pendingProps=t(S.memoizedProps,w,0,Q),S.alternate&&(S.alternate.pendingProps=S.pendingProps),w=Ln(S,2),w!==null&&Kd(w,S,2)},Eyt=function(S,w){S.pendingProps=r(S.memoizedProps,w,0),S.alternate&&(S.alternate.pendingProps=S.pendingProps),w=Ln(S,2),w!==null&&Kd(w,S,2)},Myt=function(S,w,Q){S.pendingProps=n(S.memoizedProps,w,Q),S.alternate&&(S.alternate.pendingProps=S.pendingProps),w=Ln(S,2),w!==null&&Kd(w,S,2)},wyt=function(S){var w=Ln(S,2);w!==null&&Kd(w,S,2)},Byt=function(S){var w=We(),Q=Ln(S,w);Q!==null&&Kd(Q,S,w)},Tyt=function(S){s=S},Dyt=function(S){i=S};var bX=!0,Gge=null,vRe=!1,tR=null,nR=null,oR=null,vre=new Map,Sre=new Map,rR=[],v5o="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" "),Uge=null;if(Vl.prototype.render=Iy.prototype.render=function(S){var w=this._internalRoot;if(w===null)throw Error("Cannot update an unmounted root.");var Q=arguments;typeof Q[1]==="function"?console.error("does not support the second callback argument. To execute a side effect after rendering, declare it in a component body with useEffect()."):A(Q[1])?console.error("You passed a container to the second argument of root.render(...). You don't need to pass it again since you already passed it to create the root."):typeof Q[1]<"u"&&console.error("You passed a second argument to root.render(...) but it only accepts one argument."),Q=S;var W=w.current,oe=Pm(W);cb(W,oe,Q,w,null,null)},Vl.prototype.unmount=Iy.prototype.unmount=function(){var S=arguments;if(typeof S[0]==="function"&&console.error("does not support a callback argument. To execute a side effect after rendering, declare it in a component body with useEffect()."),S=this._internalRoot,S!==null){this._internalRoot=null;var w=S.containerInfo;(hl&(Rg|r3))!==LA&&console.error("Attempted to synchronously unmount a root while React was already rendering. React cannot finish unmounting the root until the current render has completed, which may lead to a race condition."),cb(S.current,2,null,S,null,null),GI(),w[p9]=null}},Vl.prototype.unstable_scheduleHydration=function(S){if(S){var w=kt();S={blockedOn:null,target:S,priority:w};for(var Q=0;Q<rR.length&&w!==0&&w<rR[Q].priority;Q++);rR.splice(Q,0,S),Q===0&&EN(S)}},function(){var S=PX.version;if(S!=="19.3.1")throw Error(`Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:
  - react:      `+(S+`
  - react-dom:  19.3.1
Learn more: https://react.dev/warnings/version-mismatch`))}(),typeof Map==="function"&&Map.prototype!=null&&typeof Map.prototype.forEach==="function"&&typeof Set==="function"&&Set.prototype!=null&&typeof Set.prototype.clear==="function"&&typeof Set.prototype.forEach==="function"||console.error("React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://react.dev/link/react-polyfills"),Jc.findDOMNode=function(S){var w=S._reactInternals;if(w===void 0){if(typeof S.render==="function")throw Error("Unable to find node on an unmounted component.");throw S=Object.keys(S).join(","),Error("Argument appears to not be a ReactComponent. Keys: "+S)}return S=C(w),S=S!==null?b(S):null,S=S===null?null:S.stateNode,S},!function(){var S={bundleType:1,version:"19.3.1",rendererPackageName:"react-dom",currentDispatcherRef:Xn,reconcilerVersion:"19.3.1"};return S.overrideHookState=Iyt,S.overrideHookStateDeletePath=vyt,S.overrideHookStateRenamePath=Syt,S.overrideProps=Pyt,S.overridePropsDeletePath=Eyt,S.overridePropsRenamePath=Myt,S.scheduleUpdate=wyt,S.scheduleRetry=Byt,S.setErrorHandler=Tyt,S.setSuspenseHandler=Dyt,S.scheduleRefresh=p,S.scheduleRoot=_,S.setRefreshHandler=m,S.getCurrentFiber=lb,lt(S)}()&&ia&&window.top===window.self&&(-1<navigator.userAgent.indexOf("Chrome")&&navigator.userAgent.indexOf("Edge")===-1||-1<navigator.userAgent.indexOf("Firefox"))){var Nyt=window.location.protocol;/^(https?|file):$/.test(Nyt)&&console.info("%cDownload the React DevTools for a better development experience: https://react.dev/link/react-devtools"+(Nyt==="file:"?`
You might need to use a local HTTP server (instead of file://): https://react.dev/link/react-devtools-faq`:""),"font-weight:bold")}L5o.createRoot=function(S,w){if(!A(S))throw Error("Target container is not a DOM element.");j4(S);var Q=!1,W="",oe=GC,ae=UC,De=qD;return w!==null&&w!==void 0&&(w.hydrate?console.warn("hydrate through createRoot is deprecated. Use ReactDOMClient.hydrateRoot(container, <App />) instead."):typeof w==="object"&&w!==null&&w.$$typeof===$4&&console.error(`You passed a JSX element to createRoot. You probably meant to call root.render instead. Example usage:

  let root = createRoot(domContainer);
  root.render(<App />);`),w.unstable_strictMode===!0&&(Q=!0),w.identifierPrefix!==void 0&&(W=w.identifierPrefix),w.onUncaughtError!==void 0&&(oe=w.onUncaughtError),w.onCaughtError!==void 0&&(ae=w.onCaughtError),w.onRecoverableError!==void 0&&(De=w.onRecoverableError)),w=ph(S,1,!1,null,null,Q,W,null,oe,ae,De,$2),S[p9]=w.current,yy(S),new Iy(w)},L5o.hydrateRoot=function(S,w,Q){if(!A(S))throw Error("Target container is not a DOM element.");j4(S),w===void 0&&console.error("Must provide initial children as second argument to hydrateRoot. Example usage: hydrateRoot(domContainer, <App />)");var W=!1,oe="",ae=GC,De=UC,Qe=qD,ot=null;return Q!==null&&Q!==void 0&&(Q.unstable_strictMode===!0&&(W=!0),Q.identifierPrefix!==void 0&&(oe=Q.identifierPrefix),Q.onUncaughtError!==void 0&&(ae=Q.onUncaughtError),Q.onCaughtError!==void 0&&(De=Q.onCaughtError),Q.onRecoverableError!==void 0&&(Qe=Q.onRecoverableError),Q.formState!==void 0&&(ot=Q.formState)),w=ph(S,1,!0,w,Q!=null?Q:null,W,oe,ot,ae,De,Qe,$2),w.context=Yp(null),Q=w.current,W=Pm(Q),W=ze(W),oe=al(W),oe.callback=null,NC(Q,oe,W),Qf(W,"hydrateRoot()",null),Q=W,w.current.lanes=Q,Ze(w,Q),X2(w),S[p9]=w.current,yy(S),new Vl(w)},L5o.version="19.3.1",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var Hyt=pt(function(H5o,jge){jge.exports=at(Lyt())});var lo=pt(function(RIo){var Hz=at(ln());(function(){function e(Y){if(Y==null)return null;if(typeof Y==="function")return Y.$$typeof===B?null:Y.displayName||Y.name||null;if(typeof Y==="string")return Y;switch(Y){case m:return"Fragment";case g:return"Profiler";case A:return"StrictMode";case C:return"Suspense";case b:return"SuspenseList";case P:return"Activity";case M:return"ViewTransition"}if(typeof Y==="object")switch(typeof Y.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),Y.$$typeof){case p:return"Portal";case y:return Y.displayName||"Context";case f:return(Y._context.displayName||"Context")+".Consumer";case x:var X=Y.render;return Y=Y.displayName,Y||(Y=X.displayName||X.name||"",Y=Y!==""?"ForwardRef("+Y+")":"ForwardRef"),Y;case I:return X=Y.displayName||null,X!==null?X:e(Y.type)||"Memo";case v:X=Y._payload,Y=Y._init;try{return e(Y(X))}catch(K){}}return null}function t(Y){return""+Y}function n(Y){try{t(Y);var X=!1}catch(ee){X=!0}if(X){X=console;var K=X.error,J=typeof Symbol==="function"&&Symbol.toStringTag&&Y[Symbol.toStringTag]||Y.constructor.name||"Object";return K.call(X,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",J),t(Y)}}function o(Y){if(Y===m)return"<>";if(typeof Y==="object"&&Y!==null&&Y.$$typeof===v)return"<...>";try{var X=e(Y);return X?"<"+X+">":"<...>"}catch(K){return"<...>"}}function r(){var Y=T.A;return Y===null?null:Y.getOwner()}function i(){return Error("react-stack-top-frame")}function s(Y){if(N.call(Y,"key")){var X=Object.getOwnPropertyDescriptor(Y,"key").get;if(X&&X.isReactWarning)return!1}return Y.key!==void 0}function a(Y,X){function K(){H||(H=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",X))}K.isReactWarning=!0,Object.defineProperty(Y,"key",{get:K,configurable:!0})}function c(){var Y=e(this.type);return V[Y]||(V[Y]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),Y=this.props.ref,Y!==void 0?Y:null}function l(Y,X,K,J,ee,se){var ne=K.ref;return Y={$$typeof:_,type:Y,key:X,props:K,_owner:J},(ne!==void 0?ne:null)!==null?Object.defineProperty(Y,"ref",{enumerable:!1,get:c}):Object.defineProperty(Y,"ref",{enumerable:!1,value:null}),Y._store={},Object.defineProperty(Y._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(Y,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(Y,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:ee}),Object.defineProperty(Y,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:se}),Object.freeze&&(Object.freeze(Y.props),Object.freeze(Y)),Y}function h(Y,X,K,J,ee,se){var ne=X.children;if(ne!==void 0)if(J)if(D(ne)){for(J=0;J<ne.length;J++)d(ne[J]);Object.freeze&&Object.freeze(ne)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else d(ne);if(N.call(X,"key")){ne=e(Y);var re=Object.keys(X).filter(function(te){return te!=="key"});J=0<re.length?"{key: someKey, "+re.join(": ..., ")+": ...}":"{key: someKey}",j[ne+J]||(re=0<re.length?"{"+re.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
  let props = %s;
  <%s {...props} />
React keys must be passed directly to JSX without using spread:
  let props = %s;
  <%s key={someKey} {...props} />`,J,ne,re,ne),j[ne+J]=!0)}if(ne=null,K!==void 0&&(n(K),ne=""+K),s(X)&&(n(X.key),ne=""+X.key),"key"in X){K={};for(var Z in X)Z!=="key"&&(K[Z]=X[Z])}else K=X;return ne&&a(K,typeof Y==="function"?Y.displayName||Y.name||"Unknown":Y),l(Y,ne,K,r(),ee,se)}function d(Y){u(Y)?Y._store&&(Y._store.validated=1):typeof Y==="object"&&Y!==null&&Y.$$typeof===v&&(Y._payload.status==="fulfilled"?u(Y._payload.value)&&Y._payload.value._store&&(Y._payload.value._store.validated=1):Y._store&&(Y._store.validated=1))}function u(Y){return typeof Y==="object"&&Y!==null&&Y.$$typeof===_}var _=Symbol.for("react.transitional.element"),p=Symbol.for("react.portal"),m=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),y=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),b=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),M=Symbol.for("react.view_transition"),B=Symbol.for("react.client.reference"),T=Hz.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,N=Object.prototype.hasOwnProperty,D=Array.isArray,L=console.createTask?console.createTask:function(){return null};Hz={react_stack_bottom_frame:function(Y){return Y()}};var H,V={},O=Hz.react_stack_bottom_frame.bind(Hz,i)(),U=L(o(i)),j={};RIo.Fragment=m,RIo.jsx=function(Y,X,K){var J=1e4>T.recentlyCreatedOwnerStacks++;if(J){var ee=Error.stackTraceLimit;Error.stackTraceLimit=10;var se=Error("react-stack-top-frame");Error.stackTraceLimit=ee}else se=O;return h(Y,X,K,!1,se,J?L(o(Y)):U)},RIo.jsxs=function(Y,X,K){var J=1e4>T.recentlyCreatedOwnerStacks++;if(J){var ee=Error.stackTraceLimit;Error.stackTraceLimit=10;var se=Error("react-stack-top-frame");Error.stackTraceLimit=ee}else se=O;return h(Y,X,K,!0,se,J?L(o(Y)):U)}})()});function C4t(e){return x4t.get(e)}function E9o(e){for(let t of Object.values(b4t)){if(e in t.variants)return{baseUnit:t.baseUnit,conversionFactor:t.variants[e]};for(let[n,o]of Object.entries(t.variants)){if(!e.endsWith(n))continue;let r=e.slice(0,-n.length),i=C4t(r);if(i==null)continue;return{baseUnit:t.baseUnit,conversionFactor:i*o}}}return{baseUnit:e,conversionFactor:1}}function Ta(e,t){if(e===void 0||e===null)return{parsedUnit:null,unitOfValue:null,value:null};if(typeof e==="string"&&e.match(/^-?[\d.]+$/))return{value:Number.parseFloat(e),parsedUnit:null,unitOfValue:null};if(typeof e==="number")return{value:e,parsedUnit:null,unitOfValue:null};if(typeof e==="object"&&"x"in e&&"y"in e){let l=Ta(e.x,t),h=Ta(e.x,t),d=Ta(e.y,t);if(h.value===null||d.value===null)return{parsedUnit:null,unitOfValue:null,value:null};return{parsedUnit:l.parsedUnit,unitOfValue:l.unitOfValue,value:{x:h.value,y:d.value}}}let o=e.toString().split("").reverse().join("").match(/[^\d\s]+/)?.[0];if(!o)throw Error(`Could not determine unit: "${e}"`);let r=o.split("").reverse().join(""),i=e.slice(0,-r.length),s=C4t(r);if(t&&s!=null)return{parsedUnit:null,unitOfValue:t,value:Number.parseFloat(i)*s};if(s!=null&&!$Qe.has(r))return{parsedUnit:null,unitOfValue:null,value:Number.parseFloat(i)*s};let{baseUnit:a,conversionFactor:c}=E9o(r);return{parsedUnit:r,unitOfValue:a,value:c*Number.parseFloat(i)}}function vd(e){if(e==null)return"";if(e===0)return"0";let t=Math.abs(e),n=oj.findIndex((s)=>{let a=t/s.value;return a>=1&&a<1000});if(n===-1)n=oj.indexOf(w9o);let o=oj[n],r=e/o.value;while(n>0&&Math.abs(Number(r.toPrecision(3)))>=1000)n-=1,o=oj[n],r=e/o.value;let i=r.toPrecision(3);if(i.includes(".")&&!/\.0+$/.test(i))i=i.replace(/0+$/,"");return i=i.replace(/\.0+$/,""),`${i}${o.symbol}`}var ul=(e)=>{let t=Math.round(e*1000)/1000;return`${Number(t.toFixed(3))}mm`},x4t,P9o,b4t,$Qe,M9o,lAs,oj,w9o;var bp=ba(()=>{x4t=new Map([["T",1000000000000],["G",1e9],["M",1e6],["K",1000],["k",1000],["",1],["m",0.001],["µ",0.000001],["μ",0.000001],["u",0.000001],["n",0.000000001],["p",0.000000000001],["f",0.000000000000001]]),P9o=[...x4t.keys()];b4t={Hz:{baseUnit:"Hz",variants:{MHz:1e6,kHz:1000,Hz:1}},g:{baseUnit:"g",variants:{kg:1000,g:1}},Ω:{baseUnit:"Ω",variants:{mΩ:0.001,mohm:0.001,mOhm:0.001,milliohm:0.001,Ω:1,ohm:1,Ohm:1,kΩ:1000,KΩ:1000,kohm:1000,kOhm:1000,KOhm:1000,Kohm:1000,MΩ:1e6,Mohm:1e6,MOhm:1e6,megohm:1e6,Megohm:1e6,GΩ:1e9,Gohm:1e9,GOhm:1e9,TΩ:1000000000000,Tohm:1000000000000,TOhm:1000000000000}},V:{baseUnit:"V",variants:{mV:0.001,V:1,kV:1000,KV:1000,MV:1e6,GV:1e9,TV:1000000000000}},A:{baseUnit:"A",variants:{µA:0.000001,μA:0.000001,mA:0.001,ma:0.001,A:1,kA:1000,MA:1e6}},F:{baseUnit:"F",variants:{pF:0.000000000001,nF:0.000000001,µF:0.000001,μF:0.000001,uF:0.000001,mF:0.001,F:1,kF:1000,KF:1000,MF:1e6}},H:{baseUnit:"H",variants:{pH:0.000000000001,nH:0.000000001,µH:0.000001,μH:0.000001,uH:0.000001,mH:0.001,H:1,kH:1000,KH:1000,MH:1e6}},ml:{baseUnit:"ml",variants:{ml:1,mL:1,l:1000,L:1000}},deg:{baseUnit:"deg",variants:{rad:180/Math.PI}},ms:{baseUnit:"ms",variants:{fs:0.000000000001,ps:0.000000001,ns:0.000001,us:0.001,µs:0.001,μs:0.001,ms:1,s:1000}},mm:{baseUnit:"mm",variants:{nm:0.000001,µm:0.001,μm:0.001,um:0.001,mm:1,cm:10,dm:100,m:1000,km:1e6,in:25.4,ft:304.8,IN:25.4,FT:304.8,yd:914.4,mi:1609344,mil:0.0254}}},$Qe=new Set;for(let[e,t]of Object.entries(b4t)){$Qe.add(e);for(let n of Object.keys(t.variants))$Qe.add(n)}M9o=P9o.filter((e)=>e!=="").sort((e,t)=>t.length-e.length).map((e)=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),lAs=new RegExp(`^([+-]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+-]?\\d+)?)(?:(${M9o}))?$`),oj=[{value:1000000000000,symbol:"T"},{value:1e9,symbol:"G"},{value:1e6,symbol:"M"},{value:1000,symbol:"k"},{value:1,symbol:""},{value:0.001,symbol:"m"},{value:0.000001,symbol:"µ"},{value:0.000000001,symbol:"n"},{value:0.000000000001,symbol:"p"}],w9o=oj[oj.length-1]});var el,I4t,Or,Aw=(e)=>{switch(typeof e){case"undefined":return Or.undefined;case"string":return Or.string;case"number":return Number.isNaN(e)?Or.nan:Or.number;case"boolean":return Or.boolean;case"function":return Or.function;case"bigint":return Or.bigint;case"symbol":return Or.symbol;case"object":if(Array.isArray(e))return Or.array;if(e===null)return Or.null;if(e.then&&typeof e.then==="function"&&e.catch&&typeof e.catch==="function")return Or.promise;if(typeof Map<"u"&&e instanceof Map)return Or.map;if(typeof Set<"u"&&e instanceof Set)return Or.set;if(typeof Date<"u"&&e instanceof Date)return Or.date;return Or.object;default:return Or.unknown}};var iie=ba(()=>{(function(e){e.assertEqual=(r)=>{};function t(r){}e.assertIs=t;function n(r){throw Error()}e.assertNever=n,e.arrayToEnum=(r)=>{let i={};for(let s of r)i[s]=s;return i},e.getValidEnumValues=(r)=>{let i=e.objectKeys(r).filter((a)=>typeof r[r[a]]!=="number"),s={};for(let a of i)s[a]=r[a];return e.objectValues(s)},e.objectValues=(r)=>e.objectKeys(r).map(function(i){return r[i]}),e.objectKeys=typeof Object.keys==="function"?(r)=>Object.keys(r):(r)=>{let i=[];for(let s in r)if(Object.prototype.hasOwnProperty.call(r,s))i.push(s);return i},e.find=(r,i)=>{for(let s of r)if(i(s))return s;return},e.isInteger=typeof Number.isInteger==="function"?(r)=>Number.isInteger(r):(r)=>typeof r==="number"&&Number.isFinite(r)&&Math.floor(r)===r;function o(r,i=" | "){return r.map((s)=>typeof s==="string"?`'${s}'`:s).join(i)}e.joinValues=o,e.jsonStringifyReplacer=(r,i)=>{if(typeof i==="bigint")return i.toString();return i}})(el||(el={}));(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(I4t||(I4t={}));Or=el.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"])});var Gt,Ny;var lfe=ba(()=>{iie();Gt=el.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);Ny=class Ny extends Error{get errors(){return this.issues}constructor(e){super();this.issues=[],this.addIssue=(n)=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let t=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,t);else this.__proto__=t;this.name="ZodError",this.issues=e}format(e){let t=e||function(r){return r.message},n={_errors:[]},o=(r)=>{for(let i of r.issues)if(i.code==="invalid_union")i.unionErrors.map(o);else if(i.code==="invalid_return_type")o(i.returnTypeError);else if(i.code==="invalid_arguments")o(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let s=n,a=0;while(a<i.path.length){let c=i.path[a];if(a!==i.path.length-1)s[c]=s[c]||{_errors:[]};else s[c]=s[c]||{_errors:[]},s[c]._errors.push(t(i));s=s[c],a++}}};return o(this),n}static assert(e){if(!(e instanceof Ny))throw Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,el.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=(t)=>t.message){let t={},n=[];for(let o of this.issues)if(o.path.length>0){let r=o.path[0];t[r]=t[r]||[],t[r].push(e(o))}else n.push(e(o));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};Ny.create=(e)=>new Ny(e)});var B9o=(e,t)=>{let n;switch(e.code){case Gt.invalid_type:if(e.received===Or.undefined)n="Required";else n=`Expected ${e.expected}, received ${e.received}`;break;case Gt.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,el.jsonStringifyReplacer)}`;break;case Gt.unrecognized_keys:n=`Unrecognized key(s) in object: ${el.joinValues(e.keys,", ")}`;break;case Gt.invalid_union:n="Invalid input";break;case Gt.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${el.joinValues(e.options)}`;break;case Gt.invalid_enum_value:n=`Invalid enum value. Expected ${el.joinValues(e.options)}, received '${e.received}'`;break;case Gt.invalid_arguments:n="Invalid function arguments";break;case Gt.invalid_return_type:n="Invalid function return type";break;case Gt.invalid_date:n="Invalid date";break;case Gt.invalid_string:if(typeof e.validation==="object")if("includes"in e.validation){if(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==="number")n=`${n} at one or more positions greater than or equal to ${e.validation.position}`}else if("startsWith"in e.validation)n=`Invalid input: must start with "${e.validation.startsWith}"`;else if("endsWith"in e.validation)n=`Invalid input: must end with "${e.validation.endsWith}"`;else el.assertNever(e.validation);else if(e.validation!=="regex")n=`Invalid ${e.validation}`;else n="Invalid";break;case Gt.too_small:if(e.type==="array")n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`;else if(e.type==="string")n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`;else if(e.type==="number")n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`;else if(e.type==="bigint")n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`;else if(e.type==="date")n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`;else n="Invalid input";break;case Gt.too_big:if(e.type==="array")n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`;else if(e.type==="string")n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`;else if(e.type==="number")n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`;else if(e.type==="bigint")n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`;else if(e.type==="date")n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`;else n="Invalid input";break;case Gt.custom:n="Invalid input";break;case Gt.invalid_intersection_types:n="Intersection results could not be merged";break;case Gt.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Gt.not_finite:n="Number must be finite";break;default:n=t.defaultError,el.assertNever(e)}return{message:n}},fR;var qQe=ba(()=>{lfe();iie();fR=B9o});function sie(){return T9o}var T9o;var hfe=ba(()=>{qQe();T9o=fR});function Mr(e,t){let n=sie(),o=dfe({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===fR?void 0:fR].filter((r)=>!!r)});e.common.issues.push(o)}class a1{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(e,t){let n=[];for(let o of t){if(o.status==="aborted")return us;if(o.status==="dirty")e.dirty();n.push(o.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){let n=[];for(let o of t){let r=await o.key,i=await o.value;n.push({key:r,value:i})}return a1.mergeObjectSync(e,n)}static mergeObjectSync(e,t){let n={};for(let o of t){let{key:r,value:i}=o;if(r.status==="aborted")return us;if(i.status==="aborted")return us;if(r.status==="dirty")e.dirty();if(i.status==="dirty")e.dirty();if(r.value!=="__proto__"&&(typeof i.value<"u"||o.alwaysSet))n[r.value]=i.value}return{status:e.value,value:n}}}var dfe=(e)=>{let{data:t,path:n,errorMaps:o,issueData:r}=e,i=[...n,...r.path||[]],s={...r,path:i};if(r.message!==void 0)return{...r,path:i,message:r.message};let a="",c=o.filter((l)=>!!l).slice().reverse();for(let l of c)a=l(s,{data:t,defaultError:a}).message;return{...r,path:i,message:a}},us,rj=(e)=>({status:"dirty",value:e}),Ry=(e)=>({status:"valid",value:e}),JQe=(e)=>e.status==="aborted",ZQe=(e)=>e.status==="dirty",Vz=(e)=>e.status==="valid",aie=(e)=>typeof Promise<"u"&&e instanceof Promise;var eke=ba(()=>{hfe();qQe();us=Object.freeze({status:"aborted"})});var v4t=()=>{};var fi;var S4t=ba(()=>{(function(e){e.errToObj=(t)=>typeof t==="string"?{message:t}:t||{},e.toString=(t)=>typeof t==="string"?t:t?.message})(fi||(fi={}))});class Q9{constructor(e,t,n,o){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=o}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}function Ga(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:o,description:r}=e;if(t&&(n||o))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(t)return{errorMap:t,description:r};return{errorMap:(s,a)=>{let{message:c}=e;if(s.code==="invalid_enum_value")return{message:c??a.defaultError};if(typeof a.data>"u")return{message:c??o??a.defaultError};if(s.code!=="invalid_type")return{message:a.defaultError};return{message:c??n??a.defaultError}},description:r}}class Mc{get description(){return this._def.description}_getType(e){return Aw(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Aw(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new a1,ctx:{common:e.parent.common,data:e.data,parsedType:Aw(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(aie(t))throw Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Aw(e)},o=this._parseSync({data:e,path:n.path,parent:n});return P4t(n,o)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Aw(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:t});return Vz(n)?{value:n.value}:{issues:t.common.issues}}catch(n){if(n?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then((n)=>Vz(n)?{value:n.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Aw(e)},o=this._parse({data:e,path:n.path,parent:n}),r=await(aie(o)?o:Promise.resolve(o));return P4t(n,r)}refine(e,t){let n=(o)=>{if(typeof t==="string"||typeof t>"u")return{message:t};else if(typeof t==="function")return t(o);else return t};return this._refinement((o,r)=>{let i=e(o),s=()=>r.addIssue({code:Gt.custom,...n(o)});if(typeof Promise<"u"&&i instanceof Promise)return i.then((a)=>{if(!a)return s(),!1;else return!0});if(!i)return s(),!1;else return!0})}refinement(e,t){return this._refinement((n,o)=>{if(!e(n))return o.addIssue(typeof t==="function"?t(n,o):t),!1;else return!0})}_refinement(e){return new W7({schema:this,typeName:Ls.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(t)=>this["~validate"](t)}}optional(){return U7.create(this,this._def)}nullable(){return yR.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return G7.create(this)}promise(){return lj.create(this,this._def)}or(e){return uie.create([this,e],this._def)}and(e){return pie.create(this,e,this._def)}transform(e){return new W7({...Ga(this._def),schema:this,typeName:Ls.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e==="function"?e:()=>e;return new Aie({...Ga(this._def),innerType:this,defaultValue:t,typeName:Ls.ZodDefault})}brand(){return new rke({typeName:Ls.ZodBranded,type:this,...Ga(this._def)})}catch(e){let t=typeof e==="function"?e:()=>e;return new fie({...Ga(this._def),innerType:this,catchValue:t,typeName:Ls.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return Afe.create(this,e)}readonly(){return yie.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}function w4t(e){let t="[0-5]\\d";if(e.precision)t=`${t}\\.\\d{${e.precision}}`;else if(e.precision==null)t=`${t}(\\.\\d+)?`;let n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function j9o(e){return new RegExp(`^${w4t(e)}$`)}function K9o(e){let t=`${M4t}T${w4t(e)}`,n=[];if(n.push(e.local?"Z?":"Z"),e.offset)n.push("([+-]\\d{2}:?\\d{2})");return t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function $9o(e,t){if((t==="v4"||!t)&&O9o.test(e))return!0;if((t==="v6"||!t)&&Y9o.test(e))return!0;return!1}function q9o(e,t){if(!L9o.test(e))return!1;try{let[n]=e.split(".");if(!n)return!1;let o=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),r=JSON.parse(atob(o));if(typeof r!=="object"||r===null)return!1;if("typ"in r&&r?.typ!=="JWT")return!1;if(!r.alg)return!1;if(t&&r.alg!==t)return!1;return!0}catch{return!1}}function J9o(e,t){if((t==="v4"||!t)&&V9o.test(e))return!0;if((t==="v6"||!t)&&G9o.test(e))return!0;return!1}function Z9o(e,t){let n=(e.toString().split(".")[1]||"").length,o=(t.toString().split(".")[1]||"").length,r=n>o?n:o,i=Number.parseInt(e.toFixed(r).replace(".","")),s=Number.parseInt(t.toFixed(r).replace(".",""));return i%s/10**r}function ij(e){if(e instanceof Wp){let t={};for(let n in e.shape){let o=e.shape[n];t[n]=U7.create(ij(o))}return new Wp({...e._def,shape:()=>t})}else if(e instanceof G7)return new G7({...e._def,type:ij(e.element)});else if(e instanceof U7)return U7.create(ij(e.unwrap()));else if(e instanceof yR)return yR.create(ij(e.unwrap()));else if(e instanceof xw)return xw.create(e.items.map((t)=>ij(t)));else return e}function nke(e,t){let n=Aw(e),o=Aw(t);if(e===t)return{valid:!0,data:e};else if(n===Or.object&&o===Or.object){let r=el.objectKeys(t),i=el.objectKeys(e).filter((a)=>r.indexOf(a)!==-1),s={...e,...t};for(let a of i){let c=nke(e[a],t[a]);if(!c.valid)return{valid:!1};s[a]=c.data}return{valid:!0,data:s}}else if(n===Or.array&&o===Or.array){if(e.length!==t.length)return{valid:!1};let r=[];for(let i=0;i<e.length;i++){let s=e[i],a=t[i],c=nke(s,a);if(!c.valid)return{valid:!1};r.push(c.data)}return{valid:!0,data:r}}else if(n===Or.date&&o===Or.date&&+e===+t)return{valid:!0,data:e};else return{valid:!1}}function B4t(e,t){return new Wz({values:e,typeName:Ls.ZodEnum,...Ga(t)})}function E4t(e,t){let n=typeof e==="function"?e(t):typeof e==="string"?{message:e}:e;return typeof n==="string"?{message:n}:n}function cc(e,t={},n){if(e)return aj.create().superRefine((o,r)=>{let i=e(o);if(i instanceof Promise)return i.then((s)=>{if(!s){let a=E4t(t,o),c=a.fatal??n??!0;r.addIssue({code:"custom",...a,fatal:c})}});if(!i){let s=E4t(t,o),a=s.fatal??n??!0;r.addIssue({code:"custom",...s,fatal:a})}return});return aj.create()}var P4t=(e,t)=>{if(Vz(t))return{success:!0,data:t.value};else{if(!e.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new Ny(e.common.issues);return this._error=n,this._error}}}},D9o,N9o,R9o,Q9o,k9o,L9o,H9o,F9o,z9o="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",tke,O9o,V9o,Y9o,G9o,U9o,W9o,M4t="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",X9o,Y7,Gz,Uz,lie,sj,ufe,hie,die,aj,Yz,yw,pfe,G7,Wp,uie,fw=(e)=>{if(e instanceof mie)return fw(e.schema);else if(e instanceof W7)return fw(e.innerType());else if(e instanceof _ie)return[e.value];else if(e instanceof Wz)return e.options;else if(e instanceof gie)return el.objectValues(e.enum);else if(e instanceof Aie)return fw(e._def.innerType);else if(e instanceof hie)return[void 0];else if(e instanceof die)return[null];else if(e instanceof U7)return[void 0,...fw(e.unwrap())];else if(e instanceof yR)return[null,...fw(e.unwrap())];else if(e instanceof rke)return fw(e.unwrap());else if(e instanceof yie)return fw(e.unwrap());else if(e instanceof fie)return fw(e._def.innerType);else return[]},oke,pie,xw,mfe,_fe,cj,cie,mie,_ie,Wz,gie,lj,W7,U7,yR,Aie,fie,gfe,MAs,rke,Afe,yie,wAs,Ls,k,ge,BAs,TAs,Be,DAs,NAs,RAs,T4t,Sd,Xz,Fm,QAs,st,Ee,kAs,an,ss,LAs,c1,Ss,HAs,FAs,xR,zAs,ce,bt,OAs,CR,VAs,YAs,GAs,xie,UAs,X7,Cie;var D4t=ba(()=>{lfe();hfe();S4t();eke();iie();D9o=/^c[^\s-]{8,}$/i,N9o=/^[0-9a-z]+$/,R9o=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Q9o=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,k9o=/^[a-z0-9_-]{21}$/i,L9o=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,H9o=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,F9o=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,O9o=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,V9o=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Y9o=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,G9o=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,U9o=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,W9o=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,X9o=new RegExp(`^${M4t}$`);Y7=class Y7 extends Mc{_parse(e){if(this._def.coerce)e.data=String(e.data);if(this._getType(e)!==Or.string){let r=this._getOrReturnCtx(e);return Mr(r,{code:Gt.invalid_type,expected:Or.string,received:r.parsedType}),us}let n=new a1,o=void 0;for(let r of this._def.checks)if(r.kind==="min"){if(e.data.length<r.value)o=this._getOrReturnCtx(e,o),Mr(o,{code:Gt.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),n.dirty()}else if(r.kind==="max"){if(e.data.length>r.value)o=this._getOrReturnCtx(e,o),Mr(o,{code:Gt.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),n.dirty()}else if(r.kind==="length"){let i=e.data.length>r.value,s=e.data.length<r.value;if(i||s){if(o=this._getOrReturnCtx(e,o),i)Mr(o,{code:Gt.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message});else if(s)Mr(o,{code:Gt.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message});n.dirty()}}else if(r.kind==="email"){if(!F9o.test(e.data))o=this._getOrReturnCtx(e,o),Mr(o,{validation:"email",code:Gt.invalid_string,message:r.message}),n.dirty()}else if(r.kind==="emoji"){if(!tke)tke=new RegExp(z9o,"u");if(!tke.test(e.data))o=this._getOrReturnCtx(e,o),Mr(o,{validation:"emoji",code:Gt.invalid_string,message:r.message}),n.dirty()}else if(r.kind==="uuid"){if(!Q9o.test(e.data))o=this._getOrReturnCtx(e,o),Mr(o,{validation:"uuid",code:Gt.invalid_string,message:r.message}),n.dirty()}else if(r.kind==="nanoid"){if(!k9o.test(e.data))o=this._getOrReturnCtx(e,o),Mr(o,{validation:"nanoid",code:Gt.invalid_string,message:r.message}),n.dirty()}else if(r.kind==="cuid"){if(!D9o.test(e.data))o=this._getOrReturnCtx(e,o),Mr(o,{validation:"cuid",code:Gt.invalid_string,message:r.message}),n.dirty()}else if(r.kind==="cuid2"){if(!N9o.test(e.data))o=this._getOrReturnCtx(e,o),Mr(o,{validation:"cuid2",code:Gt.invalid_string,message:r.message}),n.dirty()}else if(r.kind==="ulid"){if(!R9o.test(e.data))o=this._getOrReturnCtx(e,o),Mr(o,{validation:"ulid",code:Gt.invalid_string,message:r.message}),n.dirty()}else if(r.kind==="url")try{new URL(e.data)}catch{o=this._getOrReturnCtx(e,o),Mr(o,{validation:"url",code:Gt.invalid_string,message:r.message}),n.dirty()}else if(r.kind==="regex"){if(r.regex.lastIndex=0,!r.regex.test(e.data))o=this._getOrReturnCtx(e,o),Mr(o,{validation:"regex",code:Gt.invalid_string,message:r.message}),n.dirty()}else if(r.kind==="trim")e.data=e.data.trim();else if(r.kind==="includes"){if(!e.data.includes(r.value,r.position))o=this._getOrReturnCtx(e,o),Mr(o,{code:Gt.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),n.dirty()}else if(r.kind==="toLowerCase")e.data=e.data.toLowerCase();else if(r.kind==="toUpperCase")e.data=e.data.toUpperCase();else if(r.kind==="startsWith"){if(!e.data.startsWith(r.value))o=this._getOrReturnCtx(e,o),Mr(o,{code:Gt.invalid_string,validation:{startsWith:r.value},message:r.message}),n.dirty()}else if(r.kind==="endsWith"){if(!e.data.endsWith(r.value))o=this._getOrReturnCtx(e,o),Mr(o,{code:Gt.invalid_string,validation:{endsWith:r.value},message:r.message}),n.dirty()}else if(r.kind==="datetime"){if(!K9o(r).test(e.data))o=this._getOrReturnCtx(e,o),Mr(o,{code:Gt.invalid_string,validation:"datetime",message:r.message}),n.dirty()}else if(r.kind==="date"){if(!X9o.test(e.data))o=this._getOrReturnCtx(e,o),Mr(o,{code:Gt.invalid_string,validation:"date",message:r.message}),n.dirty()}else if(r.kind==="time"){if(!j9o(r).test(e.data))o=this._getOrReturnCtx(e,o),Mr(o,{code:Gt.invalid_string,validation:"time",message:r.message}),n.dirty()}else if(r.kind==="duration"){if(!H9o.test(e.data))o=this._getOrReturnCtx(e,o),Mr(o,{validation:"duration",code:Gt.invalid_string,message:r.message}),n.dirty()}else if(r.kind==="ip"){if(!$9o(e.data,r.version))o=this._getOrReturnCtx(e,o),Mr(o,{validation:"ip",code:Gt.invalid_string,message:r.message}),n.dirty()}else if(r.kind==="jwt"){if(!q9o(e.data,r.alg))o=this._getOrReturnCtx(e,o),Mr(o,{validation:"jwt",code:Gt.invalid_string,message:r.message}),n.dirty()}else if(r.kind==="cidr"){if(!J9o(e.data,r.version))o=this._getOrReturnCtx(e,o),Mr(o,{validation:"cidr",code:Gt.invalid_string,message:r.message}),n.dirty()}else if(r.kind==="base64"){if(!U9o.test(e.data))o=this._getOrReturnCtx(e,o),Mr(o,{validation:"base64",code:Gt.invalid_string,message:r.message}),n.dirty()}else if(r.kind==="base64url"){if(!W9o.test(e.data))o=this._getOrReturnCtx(e,o),Mr(o,{validation:"base64url",code:Gt.invalid_string,message:r.message}),n.dirty()}else el.assertNever(r);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement((o)=>e.test(o),{validation:t,code:Gt.invalid_string,...fi.errToObj(n)})}_addCheck(e){return new Y7({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...fi.errToObj(e)})}url(e){return this._addCheck({kind:"url",...fi.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...fi.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...fi.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...fi.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...fi.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...fi.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...fi.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...fi.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...fi.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...fi.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...fi.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...fi.errToObj(e)})}datetime(e){if(typeof e==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e});return this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...fi.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){if(typeof e==="string")return this._addCheck({kind:"time",precision:null,message:e});return this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...fi.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...fi.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...fi.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...fi.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...fi.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...fi.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...fi.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...fi.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...fi.errToObj(t)})}nonempty(e){return this.min(1,fi.errToObj(e))}trim(){return new Y7({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Y7({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Y7({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e)=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find((e)=>e.kind==="date")}get isTime(){return!!this._def.checks.find((e)=>e.kind==="time")}get isDuration(){return!!this._def.checks.find((e)=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find((e)=>e.kind==="email")}get isURL(){return!!this._def.checks.find((e)=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find((e)=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find((e)=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((e)=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((e)=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((e)=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find((e)=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find((e)=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find((e)=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find((e)=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find((e)=>e.kind==="base64url")}get minLength(){let e=null;for(let t of this._def.checks)if(t.kind==="min"){if(e===null||t.value>e)e=t.value}return e}get maxLength(){let e=null;for(let t of this._def.checks)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e}};Y7.create=(e)=>new Y7({checks:[],typeName:Ls.ZodString,coerce:e?.coerce??!1,...Ga(e)});Gz=class Gz extends Mc{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce)e.data=Number(e.data);if(this._getType(e)!==Or.number){let r=this._getOrReturnCtx(e);return Mr(r,{code:Gt.invalid_type,expected:Or.number,received:r.parsedType}),us}let n=void 0,o=new a1;for(let r of this._def.checks)if(r.kind==="int"){if(!el.isInteger(e.data))n=this._getOrReturnCtx(e,n),Mr(n,{code:Gt.invalid_type,expected:"integer",received:"float",message:r.message}),o.dirty()}else if(r.kind==="min"){if(r.inclusive?e.data<r.value:e.data<=r.value)n=this._getOrReturnCtx(e,n),Mr(n,{code:Gt.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),o.dirty()}else if(r.kind==="max"){if(r.inclusive?e.data>r.value:e.data>=r.value)n=this._getOrReturnCtx(e,n),Mr(n,{code:Gt.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),o.dirty()}else if(r.kind==="multipleOf"){if(Z9o(e.data,r.value)!==0)n=this._getOrReturnCtx(e,n),Mr(n,{code:Gt.not_multiple_of,multipleOf:r.value,message:r.message}),o.dirty()}else if(r.kind==="finite"){if(!Number.isFinite(e.data))n=this._getOrReturnCtx(e,n),Mr(n,{code:Gt.not_finite,message:r.message}),o.dirty()}else el.assertNever(r);return{status:o.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,fi.toString(t))}gt(e,t){return this.setLimit("min",e,!1,fi.toString(t))}lte(e,t){return this.setLimit("max",e,!0,fi.toString(t))}lt(e,t){return this.setLimit("max",e,!1,fi.toString(t))}setLimit(e,t,n,o){return new Gz({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:fi.toString(o)}]})}_addCheck(e){return new Gz({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:fi.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:fi.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:fi.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:fi.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:fi.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:fi.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:fi.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:fi.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:fi.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)if(t.kind==="min"){if(e===null||t.value>e)e=t.value}return e}get maxValue(){let e=null;for(let t of this._def.checks)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e}get isInt(){return!!this._def.checks.find((e)=>e.kind==="int"||e.kind==="multipleOf"&&el.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks)if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;else if(n.kind==="min"){if(t===null||n.value>t)t=n.value}else if(n.kind==="max"){if(e===null||n.value<e)e=n.value}return Number.isFinite(t)&&Number.isFinite(e)}};Gz.create=(e)=>new Gz({checks:[],typeName:Ls.ZodNumber,coerce:e?.coerce||!1,...Ga(e)});Uz=class Uz extends Mc{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==Or.bigint)return this._getInvalidInput(e);let n=void 0,o=new a1;for(let r of this._def.checks)if(r.kind==="min"){if(r.inclusive?e.data<r.value:e.data<=r.value)n=this._getOrReturnCtx(e,n),Mr(n,{code:Gt.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),o.dirty()}else if(r.kind==="max"){if(r.inclusive?e.data>r.value:e.data>=r.value)n=this._getOrReturnCtx(e,n),Mr(n,{code:Gt.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),o.dirty()}else if(r.kind==="multipleOf"){if(e.data%r.value!==BigInt(0))n=this._getOrReturnCtx(e,n),Mr(n,{code:Gt.not_multiple_of,multipleOf:r.value,message:r.message}),o.dirty()}else el.assertNever(r);return{status:o.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return Mr(t,{code:Gt.invalid_type,expected:Or.bigint,received:t.parsedType}),us}gte(e,t){return this.setLimit("min",e,!0,fi.toString(t))}gt(e,t){return this.setLimit("min",e,!1,fi.toString(t))}lte(e,t){return this.setLimit("max",e,!0,fi.toString(t))}lt(e,t){return this.setLimit("max",e,!1,fi.toString(t))}setLimit(e,t,n,o){return new Uz({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:fi.toString(o)}]})}_addCheck(e){return new Uz({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:fi.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:fi.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:fi.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:fi.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:fi.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)if(t.kind==="min"){if(e===null||t.value>e)e=t.value}return e}get maxValue(){let e=null;for(let t of this._def.checks)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e}};Uz.create=(e)=>new Uz({checks:[],typeName:Ls.ZodBigInt,coerce:e?.coerce??!1,...Ga(e)});lie=class lie extends Mc{_parse(e){if(this._def.coerce)e.data=Boolean(e.data);if(this._getType(e)!==Or.boolean){let n=this._getOrReturnCtx(e);return Mr(n,{code:Gt.invalid_type,expected:Or.boolean,received:n.parsedType}),us}return Ry(e.data)}};lie.create=(e)=>new lie({typeName:Ls.ZodBoolean,coerce:e?.coerce||!1,...Ga(e)});sj=class sj extends Mc{_parse(e){if(this._def.coerce)e.data=new Date(e.data);if(this._getType(e)!==Or.date){let r=this._getOrReturnCtx(e);return Mr(r,{code:Gt.invalid_type,expected:Or.date,received:r.parsedType}),us}if(Number.isNaN(e.data.getTime())){let r=this._getOrReturnCtx(e);return Mr(r,{code:Gt.invalid_date}),us}let n=new a1,o=void 0;for(let r of this._def.checks)if(r.kind==="min"){if(e.data.getTime()<r.value)o=this._getOrReturnCtx(e,o),Mr(o,{code:Gt.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),n.dirty()}else if(r.kind==="max"){if(e.data.getTime()>r.value)o=this._getOrReturnCtx(e,o),Mr(o,{code:Gt.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),n.dirty()}else el.assertNever(r);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new sj({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:fi.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:fi.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)if(t.kind==="min"){if(e===null||t.value>e)e=t.value}return e!=null?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e!=null?new Date(e):null}};sj.create=(e)=>new sj({checks:[],coerce:e?.coerce||!1,typeName:Ls.ZodDate,...Ga(e)});ufe=class ufe extends Mc{_parse(e){if(this._getType(e)!==Or.symbol){let n=this._getOrReturnCtx(e);return Mr(n,{code:Gt.invalid_type,expected:Or.symbol,received:n.parsedType}),us}return Ry(e.data)}};ufe.create=(e)=>new ufe({typeName:Ls.ZodSymbol,...Ga(e)});hie=class hie extends Mc{_parse(e){if(this._getType(e)!==Or.undefined){let n=this._getOrReturnCtx(e);return Mr(n,{code:Gt.invalid_type,expected:Or.undefined,received:n.parsedType}),us}return Ry(e.data)}};hie.create=(e)=>new hie({typeName:Ls.ZodUndefined,...Ga(e)});die=class die extends Mc{_parse(e){if(this._getType(e)!==Or.null){let n=this._getOrReturnCtx(e);return Mr(n,{code:Gt.invalid_type,expected:Or.null,received:n.parsedType}),us}return Ry(e.data)}};die.create=(e)=>new die({typeName:Ls.ZodNull,...Ga(e)});aj=class aj extends Mc{constructor(){super(...arguments);this._any=!0}_parse(e){return Ry(e.data)}};aj.create=(e)=>new aj({typeName:Ls.ZodAny,...Ga(e)});Yz=class Yz extends Mc{constructor(){super(...arguments);this._unknown=!0}_parse(e){return Ry(e.data)}};Yz.create=(e)=>new Yz({typeName:Ls.ZodUnknown,...Ga(e)});yw=class yw extends Mc{_parse(e){let t=this._getOrReturnCtx(e);return Mr(t,{code:Gt.invalid_type,expected:Or.never,received:t.parsedType}),us}};yw.create=(e)=>new yw({typeName:Ls.ZodNever,...Ga(e)});pfe=class pfe extends Mc{_parse(e){if(this._getType(e)!==Or.undefined){let n=this._getOrReturnCtx(e);return Mr(n,{code:Gt.invalid_type,expected:Or.void,received:n.parsedType}),us}return Ry(e.data)}};pfe.create=(e)=>new pfe({typeName:Ls.ZodVoid,...Ga(e)});G7=class G7 extends Mc{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),o=this._def;if(t.parsedType!==Or.array)return Mr(t,{code:Gt.invalid_type,expected:Or.array,received:t.parsedType}),us;if(o.exactLength!==null){let i=t.data.length>o.exactLength.value,s=t.data.length<o.exactLength.value;if(i||s)Mr(t,{code:i?Gt.too_big:Gt.too_small,minimum:s?o.exactLength.value:void 0,maximum:i?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),n.dirty()}if(o.minLength!==null){if(t.data.length<o.minLength.value)Mr(t,{code:Gt.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),n.dirty()}if(o.maxLength!==null){if(t.data.length>o.maxLength.value)Mr(t,{code:Gt.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()}if(t.common.async)return Promise.all([...t.data].map((i,s)=>o.type._parseAsync(new Q9(t,i,t.path,s)))).then((i)=>a1.mergeArray(n,i));let r=[...t.data].map((i,s)=>o.type._parseSync(new Q9(t,i,t.path,s)));return a1.mergeArray(n,r)}get element(){return this._def.type}min(e,t){return new G7({...this._def,minLength:{value:e,message:fi.toString(t)}})}max(e,t){return new G7({...this._def,maxLength:{value:e,message:fi.toString(t)}})}length(e,t){return new G7({...this._def,exactLength:{value:e,message:fi.toString(t)}})}nonempty(e){return this.min(1,e)}};G7.create=(e,t)=>new G7({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ls.ZodArray,...Ga(t)});Wp=class Wp extends Mc{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=el.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==Or.object){let c=this._getOrReturnCtx(e);return Mr(c,{code:Gt.invalid_type,expected:Or.object,received:c.parsedType}),us}let{status:n,ctx:o}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),s=[];if(!(this._def.catchall instanceof yw&&this._def.unknownKeys==="strip")){for(let c in o.data)if(!i.includes(c))s.push(c)}let a=[];for(let c of i){let l=r[c],h=o.data[c];a.push({key:{status:"valid",value:c},value:l._parse(new Q9(o,h,o.path,c)),alwaysSet:c in o.data})}if(this._def.catchall instanceof yw){let c=this._def.unknownKeys;if(c==="passthrough")for(let l of s)a.push({key:{status:"valid",value:l},value:{status:"valid",value:o.data[l]}});else if(c==="strict"){if(s.length>0)Mr(o,{code:Gt.unrecognized_keys,keys:s}),n.dirty()}else if(c==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let l of s){let h=o.data[l];a.push({key:{status:"valid",value:l},value:c._parse(new Q9(o,h,o.path,l)),alwaysSet:l in o.data})}}if(o.common.async)return Promise.resolve().then(async()=>{let c=[];for(let l of a){let h=await l.key,d=await l.value;c.push({key:h,value:d,alwaysSet:l.alwaysSet})}return c}).then((c)=>a1.mergeObjectSync(n,c));else return a1.mergeObjectSync(n,a)}get shape(){return this._def.shape()}strict(e){return fi.errToObj,new Wp({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,n)=>{let o=this._def.errorMap?.(t,n).message??n.defaultError;if(t.code==="unrecognized_keys")return{message:fi.errToObj(e).message??o};return{message:o}}}:{}})}strip(){return new Wp({...this._def,unknownKeys:"strip"})}passthrough(){return new Wp({...this._def,unknownKeys:"passthrough"})}extend(e){return new Wp({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Wp({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Ls.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Wp({...this._def,catchall:e})}pick(e){let t={};for(let n of el.objectKeys(e))if(e[n]&&this.shape[n])t[n]=this.shape[n];return new Wp({...this._def,shape:()=>t})}omit(e){let t={};for(let n of el.objectKeys(this.shape))if(!e[n])t[n]=this.shape[n];return new Wp({...this._def,shape:()=>t})}deepPartial(){return ij(this)}partial(e){let t={};for(let n of el.objectKeys(this.shape)){let o=this.shape[n];if(e&&!e[n])t[n]=o;else t[n]=o.optional()}return new Wp({...this._def,shape:()=>t})}required(e){let t={};for(let n of el.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let r=this.shape[n];while(r instanceof U7)r=r._def.innerType;t[n]=r}return new Wp({...this._def,shape:()=>t})}keyof(){return B4t(el.objectKeys(this.shape))}};Wp.create=(e,t)=>new Wp({shape:()=>e,unknownKeys:"strip",catchall:yw.create(),typeName:Ls.ZodObject,...Ga(t)});Wp.strictCreate=(e,t)=>new Wp({shape:()=>e,unknownKeys:"strict",catchall:yw.create(),typeName:Ls.ZodObject,...Ga(t)});Wp.lazycreate=(e,t)=>new Wp({shape:e,unknownKeys:"strip",catchall:yw.create(),typeName:Ls.ZodObject,...Ga(t)});uie=class uie extends Mc{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function o(r){for(let s of r)if(s.result.status==="valid")return s.result;for(let s of r)if(s.result.status==="dirty")return t.common.issues.push(...s.ctx.common.issues),s.result;let i=r.map((s)=>new Ny(s.ctx.common.issues));return Mr(t,{code:Gt.invalid_union,unionErrors:i}),us}if(t.common.async)return Promise.all(n.map(async(r)=>{let i={...t,common:{...t.common,issues:[]},parent:null};return{result:await r._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(o);else{let r=void 0,i=[];for(let a of n){let c={...t,common:{...t.common,issues:[]},parent:null},l=a._parseSync({data:t.data,path:t.path,parent:c});if(l.status==="valid")return l;else if(l.status==="dirty"&&!r)r={result:l,ctx:c};if(c.common.issues.length)i.push(c.common.issues)}if(r)return t.common.issues.push(...r.ctx.common.issues),r.result;let s=i.map((a)=>new Ny(a));return Mr(t,{code:Gt.invalid_union,unionErrors:s}),us}}get options(){return this._def.options}};uie.create=(e,t)=>new uie({options:e,typeName:Ls.ZodUnion,...Ga(t)});oke=class oke extends Mc{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==Or.object)return Mr(t,{code:Gt.invalid_type,expected:Or.object,received:t.parsedType}),us;let n=this.discriminator,o=t.data[n],r=this.optionsMap.get(o);if(!r)return Mr(t,{code:Gt.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),us;if(t.common.async)return r._parseAsync({data:t.data,path:t.path,parent:t});else return r._parseSync({data:t.data,path:t.path,parent:t})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){let o=new Map;for(let r of t){let i=fw(r.shape[e]);if(!i.length)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let s of i){if(o.has(s))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);o.set(s,r)}}return new oke({typeName:Ls.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:o,...Ga(n)})}};pie=class pie extends Mc{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),o=(r,i)=>{if(JQe(r)||JQe(i))return us;let s=nke(r.value,i.value);if(!s.valid)return Mr(n,{code:Gt.invalid_intersection_types}),us;if(ZQe(r)||ZQe(i))t.dirty();return{status:t.value,value:s.data}};if(n.common.async)return Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([r,i])=>o(r,i));else return o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};pie.create=(e,t,n)=>new pie({left:e,right:t,typeName:Ls.ZodIntersection,...Ga(n)});xw=class xw extends Mc{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Or.array)return Mr(n,{code:Gt.invalid_type,expected:Or.array,received:n.parsedType}),us;if(n.data.length<this._def.items.length)return Mr(n,{code:Gt.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),us;if(!this._def.rest&&n.data.length>this._def.items.length)Mr(n,{code:Gt.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty();let r=[...n.data].map((i,s)=>{let a=this._def.items[s]||this._def.rest;if(!a)return null;return a._parse(new Q9(n,i,n.path,s))}).filter((i)=>!!i);if(n.common.async)return Promise.all(r).then((i)=>a1.mergeArray(t,i));else return a1.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new xw({...this._def,rest:e})}};xw.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new xw({items:e,typeName:Ls.ZodTuple,rest:null,...Ga(t)})};mfe=class mfe extends Mc{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Or.object)return Mr(n,{code:Gt.invalid_type,expected:Or.object,received:n.parsedType}),us;let o=[],r=this._def.keyType,i=this._def.valueType;for(let s in n.data)o.push({key:r._parse(new Q9(n,s,n.path,s)),value:i._parse(new Q9(n,n.data[s],n.path,s)),alwaysSet:s in n.data});if(n.common.async)return a1.mergeObjectAsync(t,o);else return a1.mergeObjectSync(t,o)}get element(){return this._def.valueType}static create(e,t,n){if(t instanceof Mc)return new mfe({keyType:e,valueType:t,typeName:Ls.ZodRecord,...Ga(n)});return new mfe({keyType:Y7.create(),valueType:e,typeName:Ls.ZodRecord,...Ga(t)})}};_fe=class _fe extends Mc{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Or.map)return Mr(n,{code:Gt.invalid_type,expected:Or.map,received:n.parsedType}),us;let o=this._def.keyType,r=this._def.valueType,i=[...n.data.entries()].map(([s,a],c)=>({key:o._parse(new Q9(n,s,n.path,[c,"key"])),value:r._parse(new Q9(n,a,n.path,[c,"value"]))}));if(n.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let a of i){let c=await a.key,l=await a.value;if(c.status==="aborted"||l.status==="aborted")return us;if(c.status==="dirty"||l.status==="dirty")t.dirty();s.set(c.value,l.value)}return{status:t.value,value:s}})}else{let s=new Map;for(let a of i){let{key:c,value:l}=a;if(c.status==="aborted"||l.status==="aborted")return us;if(c.status==="dirty"||l.status==="dirty")t.dirty();s.set(c.value,l.value)}return{status:t.value,value:s}}}};_fe.create=(e,t,n)=>new _fe({valueType:t,keyType:e,typeName:Ls.ZodMap,...Ga(n)});cj=class cj extends Mc{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Or.set)return Mr(n,{code:Gt.invalid_type,expected:Or.set,received:n.parsedType}),us;let o=this._def;if(o.minSize!==null){if(n.data.size<o.minSize.value)Mr(n,{code:Gt.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),t.dirty()}if(o.maxSize!==null){if(n.data.size>o.maxSize.value)Mr(n,{code:Gt.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),t.dirty()}let r=this._def.valueType;function i(a){let c=new Set;for(let l of a){if(l.status==="aborted")return us;if(l.status==="dirty")t.dirty();c.add(l.value)}return{status:t.value,value:c}}let s=[...n.data.values()].map((a,c)=>r._parse(new Q9(n,a,n.path,c)));if(n.common.async)return Promise.all(s).then((a)=>i(a));else return i(s)}min(e,t){return new cj({...this._def,minSize:{value:e,message:fi.toString(t)}})}max(e,t){return new cj({...this._def,maxSize:{value:e,message:fi.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};cj.create=(e,t)=>new cj({valueType:e,minSize:null,maxSize:null,typeName:Ls.ZodSet,...Ga(t)});cie=class cie extends Mc{constructor(){super(...arguments);this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==Or.function)return Mr(t,{code:Gt.invalid_type,expected:Or.function,received:t.parsedType}),us;function n(s,a){return dfe({data:s,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,sie(),fR].filter((c)=>!!c),issueData:{code:Gt.invalid_arguments,argumentsError:a}})}function o(s,a){return dfe({data:s,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,sie(),fR].filter((c)=>!!c),issueData:{code:Gt.invalid_return_type,returnTypeError:a}})}let r={errorMap:t.common.contextualErrorMap},i=t.data;if(this._def.returns instanceof lj){let s=this;return Ry(async function(...a){let c=new Ny([]),l=await s._def.args.parseAsync(a,r).catch((u)=>{throw c.addIssue(n(a,u)),c}),h=await Reflect.apply(i,this,l);return await s._def.returns._def.type.parseAsync(h,r).catch((u)=>{throw c.addIssue(o(h,u)),c})})}else{let s=this;return Ry(function(...a){let c=s._def.args.safeParse(a,r);if(!c.success)throw new Ny([n(a,c.error)]);let l=Reflect.apply(i,this,c.data),h=s._def.returns.safeParse(l,r);if(!h.success)throw new Ny([o(l,h.error)]);return h.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new cie({...this._def,args:xw.create(e).rest(Yz.create())})}returns(e){return new cie({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new cie({args:e?e:xw.create([]).rest(Yz.create()),returns:t||Yz.create(),typeName:Ls.ZodFunction,...Ga(n)})}};mie=class mie extends Mc{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};mie.create=(e,t)=>new mie({getter:e,typeName:Ls.ZodLazy,...Ga(t)});_ie=class _ie extends Mc{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return Mr(t,{received:t.data,code:Gt.invalid_literal,expected:this._def.value}),us}return{status:"valid",value:e.data}}get value(){return this._def.value}};_ie.create=(e,t)=>new _ie({value:e,typeName:Ls.ZodLiteral,...Ga(t)});Wz=class Wz extends Mc{_parse(e){if(typeof e.data!=="string"){let t=this._getOrReturnCtx(e),n=this._def.values;return Mr(t,{expected:el.joinValues(n),received:t.parsedType,code:Gt.invalid_type}),us}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return Mr(t,{received:t.data,code:Gt.invalid_enum_value,options:n}),us}return Ry(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return Wz.create(e,{...this._def,...t})}exclude(e,t=this._def){return Wz.create(this.options.filter((n)=>!e.includes(n)),{...this._def,...t})}};Wz.create=B4t;gie=class gie extends Mc{_parse(e){let t=el.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==Or.string&&n.parsedType!==Or.number){let o=el.objectValues(t);return Mr(n,{expected:el.joinValues(o),received:n.parsedType,code:Gt.invalid_type}),us}if(!this._cache)this._cache=new Set(el.getValidEnumValues(this._def.values));if(!this._cache.has(e.data)){let o=el.objectValues(t);return Mr(n,{received:n.data,code:Gt.invalid_enum_value,options:o}),us}return Ry(e.data)}get enum(){return this._def.values}};gie.create=(e,t)=>new gie({values:e,typeName:Ls.ZodNativeEnum,...Ga(t)});lj=class lj extends Mc{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==Or.promise&&t.common.async===!1)return Mr(t,{code:Gt.invalid_type,expected:Or.promise,received:t.parsedType}),us;let n=t.parsedType===Or.promise?t.data:Promise.resolve(t.data);return Ry(n.then((o)=>this._def.type.parseAsync(o,{path:t.path,errorMap:t.common.contextualErrorMap})))}};lj.create=(e,t)=>new lj({type:e,typeName:Ls.ZodPromise,...Ga(t)});W7=class W7 extends Mc{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ls.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),o=this._def.effect||null,r={addIssue:(i)=>{if(Mr(n,i),i.fatal)t.abort();else t.dirty()},get path(){return n.path}};if(r.addIssue=r.addIssue.bind(r),o.type==="preprocess"){let i=o.transform(n.data,r);if(n.common.async)return Promise.resolve(i).then(async(s)=>{if(t.value==="aborted")return us;let a=await this._def.schema._parseAsync({data:s,path:n.path,parent:n});if(a.status==="aborted")return us;if(a.status==="dirty")return rj(a.value);if(t.value==="dirty")return rj(a.value);return a});else{if(t.value==="aborted")return us;let s=this._def.schema._parseSync({data:i,path:n.path,parent:n});if(s.status==="aborted")return us;if(s.status==="dirty")return rj(s.value);if(t.value==="dirty")return rj(s.value);return s}}if(o.type==="refinement"){let i=(s)=>{let a=o.refinement(s,r);if(n.common.async)return Promise.resolve(a);if(a instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(s.status==="aborted")return us;if(s.status==="dirty")t.dirty();return i(s.value),{status:t.value,value:s.value}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((s)=>{if(s.status==="aborted")return us;if(s.status==="dirty")t.dirty();return i(s.value).then(()=>({status:t.value,value:s.value}))})}if(o.type==="transform")if(n.common.async===!1){let i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Vz(i))return us;let s=o.transform(i.value,r);if(s instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:s}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((i)=>{if(!Vz(i))return us;return Promise.resolve(o.transform(i.value,r)).then((s)=>({status:t.value,value:s}))});el.assertNever(o)}};W7.create=(e,t,n)=>new W7({schema:e,typeName:Ls.ZodEffects,effect:t,...Ga(n)});W7.createWithPreprocess=(e,t,n)=>new W7({schema:t,effect:{type:"preprocess",transform:e},typeName:Ls.ZodEffects,...Ga(n)});U7=class U7 extends Mc{_parse(e){if(this._getType(e)===Or.undefined)return Ry(void 0);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};U7.create=(e,t)=>new U7({innerType:e,typeName:Ls.ZodOptional,...Ga(t)});yR=class yR extends Mc{_parse(e){if(this._getType(e)===Or.null)return Ry(null);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};yR.create=(e,t)=>new yR({innerType:e,typeName:Ls.ZodNullable,...Ga(t)});Aie=class Aie extends Mc{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;if(t.parsedType===Or.undefined)n=this._def.defaultValue();return this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};Aie.create=(e,t)=>new Aie({innerType:e,typeName:Ls.ZodDefault,defaultValue:typeof t.default==="function"?t.default:()=>t.default,...Ga(t)});fie=class fie extends Mc{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},o=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});if(aie(o))return o.then((r)=>({status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new Ny(n.common.issues)},input:n.data})}));else return{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Ny(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};fie.create=(e,t)=>new fie({innerType:e,typeName:Ls.ZodCatch,catchValue:typeof t.catch==="function"?t.catch:()=>t.catch,...Ga(t)});gfe=class gfe extends Mc{_parse(e){if(this._getType(e)!==Or.nan){let n=this._getOrReturnCtx(e);return Mr(n,{code:Gt.invalid_type,expected:Or.nan,received:n.parsedType}),us}return{status:"valid",value:e.data}}};gfe.create=(e)=>new gfe({typeName:Ls.ZodNaN,...Ga(e)});MAs=Symbol("zod_brand");rke=class rke extends Mc{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}};Afe=class Afe extends Mc{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let r=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});if(r.status==="aborted")return us;if(r.status==="dirty")return t.dirty(),rj(r.value);else return this._def.out._parseAsync({data:r.value,path:n.path,parent:n})})();else{let o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});if(o.status==="aborted")return us;if(o.status==="dirty")return t.dirty(),{status:"dirty",value:o.value};else return this._def.out._parseSync({data:o.value,path:n.path,parent:n})}}static create(e,t){return new Afe({in:e,out:t,typeName:Ls.ZodPipeline})}};yie=class yie extends Mc{_parse(e){let t=this._def.innerType._parse(e),n=(o)=>{if(Vz(o))o.value=Object.freeze(o.value);return o};return aie(t)?t.then((o)=>n(o)):n(t)}unwrap(){return this._def.innerType}};yie.create=(e,t)=>new yie({innerType:e,typeName:Ls.ZodReadonly,...Ga(t)});wAs={object:Wp.lazycreate};(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Ls||(Ls={}));k=Y7.create,ge=Gz.create,BAs=gfe.create,TAs=Uz.create,Be=lie.create,DAs=sj.create,NAs=ufe.create,RAs=hie.create,T4t=die.create,Sd=aj.create,Xz=Yz.create,Fm=yw.create,QAs=pfe.create,st=G7.create,Ee=Wp.create,kAs=Wp.strictCreate,an=uie.create,ss=oke.create,LAs=pie.create,c1=xw.create,Ss=mfe.create,HAs=_fe.create,FAs=cj.create,xR=cie.create,zAs=mie.create,ce=_ie.create,bt=Wz.create,OAs=gie.create,CR=lj.create,VAs=W7.create,YAs=U7.create,GAs=yR.create,xie=W7.createWithPreprocess,UAs=Afe.create,X7={string:(e)=>Y7.create({...e,coerce:!0}),number:(e)=>Gz.create({...e,coerce:!0}),boolean:(e)=>lie.create({...e,coerce:!0}),bigint:(e)=>Uz.create({...e,coerce:!0}),date:(e)=>sj.create({...e,coerce:!0})},Cie=us});var ike=ba(()=>{hfe();eke();v4t();iie();D4t();lfe()});var be=ba(()=>{ike();ike()});var PR={};IX(PR,{all_layers:()=>Hg,any_circuit_element:()=>zfe,any_soup_element:()=>SR,any_source_component:()=>x3t,asset:()=>Pie,base_circuit_json_error:()=>Bc,battery_capacity:()=>U4t,brep_shape:()=>Vke,cadModelDefaultDirectionMap:()=>Hvo,cad_cable:()=>f6t,cad_collision_error:()=>A6t,cad_component:()=>g6t,cad_model_axis_directions:()=>_6t,cad_model_formats:()=>Lvo,cad_reference_surface:()=>x6t,capacitance:()=>k9,circle_shape:()=>mke,circuit_json_footprint_load_error:()=>Dfe,current:()=>l1,distance:()=>Ke,duration_ms:()=>mj,experiment_type:()=>E6t,external_footprint_load_error:()=>gj,frequency:()=>Xp,getRotationBetweenPcbPin1Locations:()=>hvo,getSimulationReturnCurrentGridJsonSchema:()=>Mie,getZodPrefixedIdWithDefault:()=>Sn,inductance:()=>pj,insertionDirectionToCanonical:()=>Pfe,insertionDirectionToVector:()=>cvo,insertion_direction:()=>yCt,kicadAt:()=>Cfe,kicadEffects:()=>W4t,kicadFont:()=>gke,kicadFootprintAttributes:()=>j4t,kicadFootprintMetadata:()=>q4t,kicadFootprintModel:()=>$4t,kicadFootprintPad:()=>K4t,kicadFootprintProperties:()=>X4t,kicadProperty:()=>vie,kicadSymbolEffects:()=>e3t,kicadSymbolMetadata:()=>n3t,kicadSymbolPinNames:()=>Z4t,kicadSymbolPinNumbers:()=>J4t,kicadSymbolProperties:()=>t3t,kicadSymbolProperty:()=>bR,layer_ref:()=>Lo,layer_string:()=>lke,length:()=>ve,manufacturing_drc_properties:()=>CCt,ms:()=>wc,ninePointAnchor:()=>Cw,parseAndConvertSiUnit:()=>Ta,pcbRenderLayer:()=>ivo,pcb_autorouting_error:()=>Ubt,pcb_bend:()=>obt,pcb_board:()=>nbt,pcb_breakout_point:()=>$bt,pcb_bus_length_skew_error:()=>jCt,pcb_bus_routing_constraint_error:()=>wfe,pcb_bus_routing_constraint_warning:()=>Bfe,pcb_component:()=>bCt,pcb_component_invalid_layer_error:()=>Aj,pcb_component_missing_courtyard_warning:()=>jbt,pcb_component_not_on_board_edge_error:()=>i6t,pcb_component_outside_board_error:()=>r6t,pcb_connector_not_in_accessible_orientation_warning:()=>Xbt,pcb_copper_pour:()=>o6t,pcb_copper_pour_brep:()=>t6t,pcb_copper_pour_polygon:()=>n6t,pcb_copper_pour_rect:()=>e6t,pcb_copper_text:()=>Abt,pcb_courtyard_circle:()=>p6t,pcb_courtyard_outline:()=>d6t,pcb_courtyard_overlap_error:()=>Rbt,pcb_courtyard_pill:()=>m6t,pcb_courtyard_polygon:()=>u6t,pcb_courtyard_rect:()=>h6t,pcb_cutout:()=>Vbt,pcb_cutout_circle:()=>Fbt,pcb_cutout_path:()=>Obt,pcb_cutout_polygon:()=>zbt,pcb_cutout_rect:()=>Hbt,pcb_debug_line:()=>vCt,pcb_debug_object:()=>PCt,pcb_debug_object_base:()=>Efe,pcb_debug_point:()=>SCt,pcb_debug_rect:()=>ICt,pcb_fabrication_note_dimension:()=>Ebt,pcb_fabrication_note_path:()=>Sbt,pcb_fabrication_note_rect:()=>Pbt,pcb_fabrication_note_text:()=>vbt,pcb_fabricator_extra_charge_warning:()=>Kbt,pcb_footprint_overlap_error:()=>Nbt,pcb_ground_plane:()=>qbt,pcb_ground_plane_region:()=>Jbt,pcb_group:()=>Gbt,pcb_hole:()=>NCt,pcb_hole_circle_or_square_shape:()=>mvo,pcb_hole_circle_shape:()=>uvo,pcb_hole_oval_shape:()=>_vo,pcb_hole_pill_shape:()=>gvo,pcb_hole_rect_shape:()=>pvo,pcb_hole_rotated_pill_shape:()=>Avo,pcb_keepout:()=>kbt,pcb_keepout_outline:()=>Qbt,pcb_keepout_overlap_warning:()=>Lbt,pcb_manual_edit_conflict_warning:()=>Nfe,pcb_missing_footprint_error:()=>Ybt,pcb_net:()=>tbt,pcb_note_dimension:()=>Dbt,pcb_note_line:()=>Tbt,pcb_note_path:()=>Bbt,pcb_note_rect:()=>wbt,pcb_note_text:()=>Mbt,pcb_packing_error:()=>dbt,pcb_pad_pad_clearance_error:()=>c6t,pcb_pad_trace_clearance_error:()=>l6t,pcb_panel:()=>lbt,pcb_panelization_placement_error:()=>ubt,pcb_pin1_location:()=>uj,pcb_placement_error:()=>hbt,pcb_plated_hole:()=>RCt,pcb_port:()=>QCt,pcb_port_not_connected_error:()=>ebt,pcb_port_not_matched_error:()=>ZCt,pcb_preflight_routing_error:()=>Wbt,pcb_route_hint:()=>xCt,pcb_route_hints:()=>dvo,pcb_silkscreen_circle:()=>ybt,pcb_silkscreen_graphic:()=>bbt,pcb_silkscreen_graphic_brep:()=>Cbt,pcb_silkscreen_line:()=>mbt,pcb_silkscreen_oval:()=>xbt,pcb_silkscreen_path:()=>_bt,pcb_silkscreen_pill:()=>Ibt,pcb_silkscreen_rect:()=>fbt,pcb_silkscreen_text:()=>gbt,pcb_smtpad:()=>LCt,pcb_smtpad_pill:()=>kCt,pcb_solder_paste:()=>HCt,pcb_soldermask_opening:()=>FCt,pcb_stiffener:()=>cbt,pcb_stiffener_polygon:()=>abt,pcb_stiffener_rect:()=>sbt,pcb_text:()=>zCt,pcb_thermal_spoke:()=>Zbt,pcb_trace:()=>GCt,pcb_trace_error:()=>qCt,pcb_trace_hint:()=>pbt,pcb_trace_missing_error:()=>JCt,pcb_trace_route_point:()=>Mfe,pcb_trace_route_point_through_pad:()=>YCt,pcb_trace_route_point_via:()=>VCt,pcb_trace_route_point_wire:()=>OCt,pcb_trace_style_warning:()=>WCt,pcb_trace_too_long_error:()=>XCt,pcb_trace_too_long_warning:()=>KCt,pcb_trace_too_many_vias_warning:()=>$Ct,pcb_trace_warning:()=>UCt,pcb_via:()=>vR,pcb_via_clearance_error:()=>s6t,pcb_via_trace_clearance_error:()=>a6t,point:()=>jo,point3:()=>i5,point_with_bulge:()=>fCt,polygon_shape:()=>Sie,port_arrangement:()=>G3t,position:()=>tvo,position3:()=>nvo,rect_shape:()=>xfe,resistance:()=>s5,ring:()=>hke,rotated_rect_shape:()=>_ke,rotation:()=>ii,route_hint_point:()=>r2,schematic_arc:()=>$3t,schematic_box:()=>F3t,schematic_circle:()=>K3t,schematic_component:()=>U3t,schematic_component_overlap_warning:()=>cCt,schematic_component_port_arrangement_by_sides:()=>Y3t,schematic_component_port_arrangement_by_size:()=>V3t,schematic_component_styling_warning:()=>lCt,schematic_debug_line:()=>rCt,schematic_debug_object:()=>sCt,schematic_debug_object_base:()=>Ife,schematic_debug_point:()=>iCt,schematic_debug_rect:()=>oCt,schematic_element_outside_sheet_warning:()=>dCt,schematic_error:()=>tCt,schematic_graphic:()=>uCt,schematic_group:()=>pCt,schematic_layout_error:()=>nCt,schematic_line:()=>X3t,schematic_manual_edit_conflict_warning:()=>vfe,schematic_missing_sheet_warning:()=>ACt,schematic_net_label:()=>eCt,schematic_path:()=>z3t,schematic_pin_styles:()=>O3t,schematic_port:()=>Z3t,schematic_rect:()=>j3t,schematic_sheet:()=>gCt,schematic_sheet_size:()=>Sfe,schematic_sheet_styling_warning:()=>hCt,schematic_symbol:()=>W3t,schematic_table:()=>mCt,schematic_table_cell:()=>_Ct,schematic_text:()=>J3t,schematic_text_part:()=>Oke,schematic_trace:()=>q3t,schematic_voltage_probe:()=>aCt,simulation_ac_current_source:()=>S6t,simulation_ac_sweep_current_graph:()=>V6t,simulation_ac_sweep_voltage_graph:()=>O6t,simulation_ac_voltage_source:()=>b6t,simulation_complex_sample:()=>Wke,simulation_current_probe:()=>R6t,simulation_current_source:()=>P6t,simulation_dc_current_source:()=>v6t,simulation_dc_operating_point_current:()=>H6t,simulation_dc_operating_point_voltage:()=>L6t,simulation_dc_sweep_current_graph:()=>z6t,simulation_dc_sweep_unit:()=>Qfe,simulation_dc_sweep_voltage_graph:()=>F6t,simulation_dc_voltage_source:()=>C6t,simulation_experiment:()=>w6t,simulation_op_amp:()=>Y6t,simulation_oscilloscope_trace:()=>U6t,simulation_parameter_sweep:()=>k6t,simulation_parameter_sweep_coordinate:()=>Iw,simulation_parameter_type:()=>Ovo,simulation_parameter_unit:()=>Uke,simulation_pcb_return_current_field:()=>fj,simulation_pcb_return_current_heatmap:()=>Hfe,simulation_pcb_return_current_marker:()=>Ffe,simulation_pcb_return_current_result:()=>kfe,simulation_return_current_contact:()=>uke,simulation_return_current_excitation:()=>W6t,simulation_return_current_field_asset:()=>j6t,simulation_return_current_grid_json:()=>K6t,simulation_return_current_image_asset:()=>Lfe,simulation_spice_subcircuit:()=>G6t,simulation_switch:()=>D6t,simulation_terminal_port:()=>pke,simulation_transient_current_graph:()=>T6t,simulation_transient_voltage_graph:()=>B6t,simulation_unknown_experiment_error:()=>Q6t,simulation_voltage_probe:()=>N6t,simulation_voltage_source:()=>I6t,size:()=>yfe,source_ambiguous_port_reference:()=>E3t,source_board:()=>P3t,source_bus:()=>L3t,source_component_availability_warning:()=>Eie,source_component_base:()=>gh,source_component_internal_connection:()=>b3t,source_component_misconfigured_error:()=>bw,source_component_pins_underspecified_warning:()=>N3t,source_confusing_net_name_warning:()=>k3t,source_failed_to_create_component_error:()=>_3t,source_group:()=>v3t,source_i2c_misconfigured_error:()=>zke,source_interconnect:()=>f3t,source_invalid_component_property_error:()=>Qke,source_manually_placed_via:()=>w3t,source_missing_manufacturer_part_number_warning:()=>Hke,source_missing_property_error:()=>m3t,source_motor:()=>a3t,source_net:()=>S3t,source_no_ground_pin_defined_warning:()=>D3t,source_no_power_pin_defined_warning:()=>T3t,source_part_not_found_warning:()=>IR,source_pcb_ground_plane:()=>M3t,source_pin_attributes:()=>_j,source_pin_missing_trace_warning:()=>Lke,source_pin_must_be_connected_error:()=>R3t,source_port:()=>C3t,source_printed_part:()=>i3t,source_project_metadata:()=>Rke,source_property_ignored_warning:()=>g3t,source_refdes_convention_warning:()=>Fke,source_runtime_error:()=>H3t,source_simple_ammeter:()=>h3t,source_simple_battery:()=>bke,source_simple_capacitor:()=>Ake,source_simple_chip:()=>xke,source_simple_connector:()=>p3t,source_simple_connector_standards:()=>u3t,source_simple_crystal:()=>d3t,source_simple_current_source:()=>c3t,source_simple_diode:()=>bfe,source_simple_fiducial:()=>o3t,source_simple_fuse:()=>l3t,source_simple_ground:()=>r3t,source_simple_inductor:()=>Ike,source_simple_led:()=>yke,source_simple_mosfet:()=>Tke,source_simple_op_amp:()=>Dke,source_simple_pin_header:()=>Pke,source_simple_pinout:()=>Eke,source_simple_potentiometer:()=>Ske,source_simple_power_source:()=>Cke,source_simple_push_button:()=>vke,source_simple_resistor:()=>fke,source_simple_resonator:()=>Mke,source_simple_switch:()=>Nke,source_simple_test_point:()=>Bke,source_simple_transistor:()=>wke,source_simple_voltage_probe:()=>A3t,source_simple_voltage_source:()=>y3t,source_subassembly:()=>s3t,source_trace:()=>I3t,source_trace_not_connected_error:()=>kke,source_unnamed_trace_warning:()=>B3t,spice_simulation_options:()=>M6t,standard_shape:()=>ovo,supplier_footprint_mismatch_warning:()=>Rfe,supplier_name:()=>j7,time:()=>evo,timestamp:()=>G4t,unknown_error_finding_part:()=>Q3t,visible_layer:()=>jp,voltage:()=>_h,wave_shape:()=>Gke});function X6t(e){return Pie.extend({project_relative_path:k().min(1),url:k().url()}).superRefine((t,n)=>{if(!e.includes(t.mimetype))n.addIssue({code:Gt.custom,path:["mimetype"],message:`Expected one of: ${e.join(", ")}`});if(t.url.startsWith("data:")){if(/^data:([^;,]*)(?:;[^,]*)?,/i.exec(t.url)?.[1]?.toLowerCase()!==t.mimetype)n.addIssue({code:Gt.custom,path:["url"],message:"Data URL media type must match asset.mimetype"})}})}function Mie(e){let t=e.columns*e.rows;if(!Number.isSafeInteger(e.columns)||e.columns<=0||!Number.isSafeInteger(e.rows)||e.rows<=0||!Number.isSafeInteger(t))throw Error("Grid dimensions must be positive safe integers");return K6t.superRefine((n,o)=>{if(n.field_type!==e.field_type)o.addIssue({code:Gt.custom,path:["field_type"],message:"Decoded field_type must match the parent field"});if((n.field_type==="real"?n.sheet_current_x:n.sheet_current_x_real).length!==t)o.addIssue({code:Gt.custom,message:`Each current channel must have ${t} entries (columns * rows)`})})}var s5,k9,pj,_h,ve,Xp,Ke,l1,mj,evo,wc,G4t,ii,U4t,Qt=(e)=>{},Kz=(e)=>{},jo,tvo,i5,nvo,yfe,dj,cke,mke,xfe,_ke,Sie,ovo,rvo=(e)=>Array.from({length:e},()=>"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[Math.floor(Math.random()*62)]).join(""),Sn=(e)=>k().optional().default(()=>`${e}_${rvo(10)}`),Cw,ivo,Pie,Cfe,gke,W4t,vie,X4t,j4t,K4t,$4t,q4t,J4t,Z4t,e3t,bR,t3t,n3t,Bc,j7,gh,Ake,fke,bfe,o3t,yke,r3t,xke,i3t,s3t,a3t,Cke,c3t,l3t,h3t,N4t,_j,bke,Ike,vke,Ske,d3t,Pke,u3t,p3t,Eke,Mke,wke,Bke,Tke,Dke,Nke,Rke,m3t,_3t,Qke,kke,g3t,Lke,Hke,Fke,Eie,A3t,f3t,zke,bw,y3t,x3t,C3t,b3t,I3t,v3t,S3t,P3t,E3t,M3t,Hg,lke,Lo,jp,w3t,B3t,T3t,D3t,N3t,R3t,Q3t,IR,k3t,ske,R4t,L3t,H3t,F3t,z3t,O3t,V3t,Y3t,G3t,U3t,svo,W3t,X3t,j3t,K3t,$3t,q3t,avo,Oke,J3t,Z3t,eCt,tCt,nCt,Ife,oCt,rCt,iCt,sCt,aCt,vfe,cCt,lCt,hCt,dCt,Q4t,uCt,pCt,mCt,_Ct,Sfe,gCt,ACt,fCt,hke,Vke,Pfe,cvo,yCt,uj,lvo,hvo=(e,t)=>{for(let n of lvo){let o=n.indexOf(e),r=n.indexOf(t);if(o!==-1&&r!==-1)return(r-o+n.length)%n.length*90}return null},xCt,dvo,r2,CCt,bCt,Efe,ICt,vCt,SCt,PCt,ECt,uvo,MCt,pvo,wCt,mvo,BCt,_vo,TCt,gvo,DCt,Avo,NCt,fvo,yvo,xvo,Cvo,bvo,Ivo,RCt,QCt,vvo,Svo,Pvo,kCt,Evo,Mvo,LCt,wvo,Bvo,Tvo,Dvo,Nvo,Rvo,Qvo,HCt,ffe,FCt,zCt,k4t,OCt,VCt,YCt,Mfe,GCt,UCt,WCt,XCt,jCt,KCt,$Ct,jz,wfe,bie,Bfe,qCt,JCt,ZCt,ebt,tbt,vR,nbt,L4t,obt,dke,rbt,ibt,sbt,abt,cbt,lbt,hbt,dbt,ubt,pbt,mbt,_bt,gbt,Abt,fbt,ybt,xbt,kvo,Cbt,bbt,Ibt,vbt,Sbt,Pbt,Ebt,Mbt,wbt,Bbt,Tbt,Dbt,Nbt,Rbt,Qbt,kbt,Lbt,Tfe,Hbt,Fbt,zbt,Obt,Vbt,Ybt,gj,Dfe,Gbt,Ubt,Wbt,Nfe,H4t,Xbt,jbt,Rfe,Kbt,$bt,qbt,Jbt,Zbt,Yke,e6t,t6t,n6t,o6t,r6t,i6t,Aj,s6t,a6t,c6t,l6t,h6t,d6t,u6t,p6t,m6t,Lvo,_6t,Hvo,g6t,A6t,F4t,f6t,y6t=0.000001,z4t,O4t,x6t,Gke,Fvo,C6t,b6t,I6t,zvo,v6t,S6t,P6t,Qfe,Uke,E6t,M6t,w6t,Iw,B6t,T6t,D6t,N6t,R6t,Q6t,Ovo,Iie,k6t,L6t,H6t,F6t,z6t,Wke,O6t,V6t,Y6t,G6t,V4t=(e)=>e!==void 0,U6t,ake,uke,pke,W6t,kfe,j6t,Lfe,fj,hj,K6t,Hfe,Y4t,Ffe,zfe,SR;var qt=ba(()=>{bp();be();bp();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();s5=k().or(ge()).transform((e)=>Ta(e,"Ω").value),k9=k().or(ge()).transform((e)=>Ta(e,"F").value).transform((e)=>Number.parseFloat(e.toPrecision(12))),pj=k().or(ge()).transform((e)=>Ta(e,"H").value),_h=k().or(ge()).transform((e)=>Ta(e,"V").value),ve=k().or(ge()).transform((e)=>Ta(e).value),Xp=k().or(ge()).transform((e)=>Ta(e,"Hz").value),Ke=ve,l1=k().or(ge()).transform((e)=>Ta(e,"A").value),mj=k().or(ge()).transform((e)=>Ta(e).value),evo=mj,wc=mj,G4t=k().datetime(),ii=k().or(ge()).transform((e)=>{if(typeof e==="number")return e;if(e.endsWith("deg"))return Number.parseFloat(e.split("deg")[0]);if(e.endsWith("rad"))return Number.parseFloat(e.split("rad")[0])*180/Math.PI;return Number.parseFloat(e)}),U4t=ge().or(k().endsWith("mAh")).transform((e)=>{if(typeof e==="string"){let t=e.replace("mAh",""),n=Number.parseFloat(t);if(Number.isNaN(n))throw Error("Invalid capacity");return n}return e}).describe("Battery capacity in mAh");Qt("extra props b");Qt("missing props b");Qt(!0);Qt("mismatched prop types: a");Kz(!0);Kz('T1 has extra: "c", T2 has extra: "d"');Kz('T1 has extra: "c"');Kz('T2 has extra: "c"');Kz('T1 has extra: "d", T2 has extra: "c"');Kz(!0);jo=Ee({x:Ke,y:Ke}),tvo=jo;Qt(!0);Qt(!0);i5=Ee({x:Ke,y:Ke,z:Ke}),nvo=i5;Qt(!0);yfe=Ee({width:ge(),height:ge()});Qt(!0);dj=Ke.pipe(ge().finite()),cke=Ke.pipe(ge().finite().positive()),mke=Ee({shape:ce("circle"),x:dj,y:dj,radius:cke}).strict(),xfe=Ee({shape:ce("rect"),x:dj,y:dj,width:cke,height:cke}).strict(),_ke=xfe.extend({shape:ce("rotated_rect"),ccw_rotation:ii.pipe(ge().finite())}),Sie=Ee({shape:ce("polygon"),points:st(jo.extend({x:dj,y:dj})).min(3).refine((e)=>{let t=e.reduce((n,o,r)=>{let i=e[(r+1)%e.length];return n+o.x*i.y-i.x*o.y},0);return Number.isFinite(t)&&t!==0},"Polygon boundary must enclose a nonzero area")}).strict();Qt(!0);Qt(!0);Qt(!0);Qt(!0);ovo=ss("shape",[mke,xfe,_ke,Sie]);Qt(!0);Cw=bt(["top_left","top_center","top_right","center_left","center","center_right","bottom_left","bottom_center","bottom_right"]);Qt(!0);ivo=bt(["top_silkscreen","bottom_silkscreen","top_copper","bottom_copper","top_soldermask","bottom_soldermask","top_fabrication_note","bottom_fabrication_note","top_user_note","bottom_user_note","top_courtyard","bottom_courtyard","inner1_copper","inner2_copper","inner3_copper","inner4_copper","inner5_copper","inner6_copper","inner7_copper","inner8_copper","edge_cuts","drill"]);Qt(!0);Pie=Ee({project_relative_path:k(),url:k(),mimetype:k()});Qt(!0);Cfe=jo.extend({rotation:ii.optional()});Qt(!0);gke=Ee({size:jo.optional(),thickness:Ke.optional()});Qt(!0);W4t=Ee({font:gke.optional()});Qt(!0);vie=Ee({value:k(),at:Cfe.optional(),layer:k().optional(),uuid:k().optional(),hide:Be().optional(),effects:W4t.optional()});Qt(!0);X4t=Ee({Reference:vie.optional(),Value:vie.optional(),Datasheet:vie.optional(),Description:vie.optional()});Qt(!0);j4t=Ee({through_hole:Be().optional(),smd:Be().optional(),exclude_from_pos_files:Be().optional(),exclude_from_bom:Be().optional()});Qt(!0);K4t=Ee({name:k(),type:k(),shape:k().optional(),at:Cfe.optional(),size:jo.optional(),drill:Ke.optional(),layers:st(k()).optional(),removeUnusedLayers:Be().optional(),uuid:k().optional()});Qt(!0);$4t=Ee({path:k(),offset:i5.optional(),scale:i5.optional(),rotate:i5.optional()});Qt(!0);q4t=Ee({footprintName:k().optional(),version:an([ge(),k()]).optional(),generator:k().optional(),generatorVersion:an([ge(),k()]).optional(),layer:k().optional(),properties:X4t.optional(),attributes:j4t.optional(),pads:st(K4t).optional(),embeddedFonts:Be().optional(),model:$4t.optional()});Qt(!0);J4t=Ee({hide:Be().optional()});Qt(!0);Z4t=Ee({offset:Ke.optional(),hide:Be().optional()});Qt(!0);e3t=Ee({font:gke.optional(),justify:an([k(),st(k())]).optional(),hide:Be().optional()});Qt(!0);bR=Ee({value:k(),id:an([ge(),k()]).optional(),at:Cfe.optional(),effects:e3t.optional()});Qt(!0);t3t=Ee({Reference:bR.optional(),Value:bR.optional(),Footprint:bR.optional(),Datasheet:bR.optional(),Description:bR.optional(),ki_keywords:bR.optional(),ki_fp_filters:bR.optional()});Qt(!0);n3t=Ee({symbolName:k().optional(),extends:k().optional(),pinNumbers:J4t.optional(),pinNames:Z4t.optional(),excludeFromSim:Be().optional(),inBom:Be().optional(),onBoard:Be().optional(),properties:t3t.optional(),embeddedFonts:Be().optional()});Qt(!0);Bc=Ee({error_type:k(),message:k(),is_fatal:Be().optional()});Qt(!0);j7=bt(["jlcpcb","macrofab","pcbway","digikey","mouser","lcsc"]);Qt(!0);gh=Ee({type:ce("source_component"),ftype:k().optional(),source_component_id:k(),name:k(),manufacturer_part_number:k().optional(),supplier_part_numbers:Ss(j7,st(k())).optional(),display_value:k().optional(),display_name:k().optional(),are_pins_interchangeable:Be().optional(),internally_connected_source_port_ids:st(st(k())).optional(),source_group_id:k().optional(),subcircuit_id:k().optional()});Qt(!0);Ake=gh.extend({ftype:ce("simple_capacitor"),capacitance:k9,max_voltage_rating:_h.optional(),display_capacitance:k().optional(),max_decoupling_trace_length:Ke.optional()});Qt(!0);fke=gh.extend({ftype:ce("simple_resistor"),resistance:s5,display_resistance:k().optional()});Qt(!0);bfe=gh.extend({ftype:ce("simple_diode")});Qt(!0);o3t=gh.extend({ftype:ce("simple_fiducial")});Qt(!0);yke=bfe.extend({ftype:ce("simple_led"),color:k().optional(),wavelength:k().optional()});Qt(!0);r3t=gh.extend({ftype:ce("simple_ground")});Qt(!0);xke=gh.extend({ftype:ce("simple_chip")});Qt(!0);i3t=gh.extend({ftype:ce("printedpart"),material:bt(["pla","petg","nylon"]).optional(),color:k().trim().min(1).optional()});Qt(!0);s3t=gh.extend({ftype:ce("subassembly")});Qt(!0);a3t=gh.extend({ftype:ce("motor")});Qt(!0);Cke=gh.extend({ftype:ce("simple_power_source"),voltage:_h});Qt(!0);c3t=gh.extend({ftype:ce("simple_current_source"),current:l1,frequency:Xp.optional(),peak_to_peak_current:l1.optional(),wave_shape:bt(["sine","square","triangle","sawtooth","dc"]).optional().default("dc"),phase:ge().optional(),duty_cycle:ge().min(0).max(1).optional()});Qt(!0);l3t=gh.extend({ftype:ce("simple_fuse"),current_rating_amps:ge().describe("Nominal current in amps the fuse is rated for"),voltage_rating_volts:ge().describe("Voltage rating in volts, e.g. ±5V would be 5")});Qt(!0);h3t=gh.extend({ftype:ce("simple_ammeter")});Qt(!0);N4t=an([ge(),k().trim().regex(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?\s*(?:[fpnumkKMGTµμ]?V?|V)?$/,"Expected a scalar voltage, optionally with SI units")]).pipe(_h).pipe(ge().finite()),_j=Ee({is_input:Be().optional(),is_output:Be().optional(),is_bidirectional:Be().optional(),is_passive:Be().optional(),can_use_tri_state:Be().optional(),is_using_tri_state:Be().optional(),can_use_open_collector:Be().optional(),is_using_open_collector:Be().optional(),can_use_open_emitter:Be().optional(),is_using_open_emitter:Be().optional(),is_gpio:Be().optional(),highlight_color:k().optional(),must_be_connected:Be().optional(),provides_power:Be().optional(),requires_power:Be().optional(),provides_ground:Be().optional(),requires_ground:Be().optional(),provides_voltage:N4t.optional(),requires_voltage:N4t.optional(),required_voltage_tolerance:ge().finite().min(0).max(1).optional(),do_not_connect:Be().optional(),include_in_board_pinout:Be().optional(),can_use_internal_pullup:Be().optional(),is_using_internal_pullup:Be().optional(),needs_external_pullup:Be().optional(),can_use_internal_pulldown:Be().optional(),is_using_internal_pulldown:Be().optional(),needs_external_pulldown:Be().optional(),can_use_open_drain:Be().optional(),is_using_open_drain:Be().optional(),can_use_push_pull:Be().optional(),is_using_push_pull:Be().optional(),should_have_decoupling_capacitor:Be().optional(),recommended_decoupling_capacitor_capacitance:an([k(),ge()]).optional(),is_configured_for_i2c_sda:Be().optional(),is_configured_for_i2c_scl:Be().optional(),is_configured_for_spi_mosi:Be().optional(),is_configured_for_spi_miso:Be().optional(),is_configured_for_spi_sck:Be().optional(),is_configured_for_spi_cs:Be().optional(),is_configured_for_uart_tx:Be().optional(),is_configured_for_uart_rx:Be().optional(),supports_i2c_sda:Be().optional(),supports_i2c_scl:Be().optional(),supports_spi_mosi:Be().optional(),supports_spi_miso:Be().optional(),supports_spi_sck:Be().optional(),supports_spi_cs:Be().optional(),supports_uart_tx:Be().optional(),supports_uart_rx:Be().optional()});Qt(!0);bke=gh.extend({ftype:ce("simple_battery"),capacity:U4t});Qt(!0);Ike=gh.extend({ftype:ce("simple_inductor"),inductance:pj,display_inductance:k().optional(),max_current_rating:ge().optional()});Qt(!0);vke=gh.extend({ftype:ce("simple_push_button")});Qt(!0);Ske=gh.extend({ftype:ce("simple_potentiometer"),max_resistance:s5,display_max_resistance:k().optional()});Qt(!0);d3t=gh.extend({ftype:ce("simple_crystal"),frequency:ge().describe("Frequency in Hz"),load_capacitance:ge().optional().describe("Load capacitance in pF"),pin_variant:bt(["two_pin","four_pin"]).optional()});Qt(!0);Pke=gh.extend({ftype:ce("simple_pin_header"),pin_count:ge(),gender:bt(["male","female"]).optional().default("male")});Qt(!0);u3t=["usb_c","m2","jst_sh","jst_gh","jst_zh","jst_ph","jst_xh","jst_vh"],p3t=gh.extend({ftype:ce("simple_connector"),standard:bt(u3t).optional(),pin_count:ge().int().positive().optional()});Qt(!0);Eke=gh.extend({ftype:ce("simple_pinout")});Qt(!0);Mke=gh.extend({ftype:ce("simple_resonator"),load_capacitance:k9,equivalent_series_resistance:s5.optional(),frequency:Xp});Qt(!0);wke=gh.extend({ftype:ce("simple_transistor"),transistor_type:bt(["npn","pnp"])});Qt(!0);Bke=gh.extend({ftype:ce("simple_test_point"),footprint_variant:bt(["pad","through_hole"]).optional(),pad_shape:bt(["rect","circle"]).optional(),pad_diameter:an([ge(),k()]).optional(),hole_diameter:an([ge(),k()]).optional(),width:an([ge(),k()]).optional(),height:an([ge(),k()]).optional()});Qt(!0);Tke=gh.extend({ftype:ce("simple_mosfet"),channel_type:bt(["n","p"]),mosfet_mode:bt(["enhancement","depletion"])});Qt(!0);Dke=gh.extend({ftype:ce("simple_op_amp")});Qt(!0);Nke=gh.extend({ftype:ce("simple_switch")});Qt(!0);Rke=Ee({type:ce("source_project_metadata"),name:k().optional(),software_used_string:k().optional(),project_url:k().optional(),source_filesystem_md5_hash:k().optional(),created_at:G4t.optional()});Qt(!0);m3t=Bc.extend({type:ce("source_missing_property_error"),source_missing_property_error_id:Sn("source_missing_property_error"),source_component_id:k(),property_name:k(),subcircuit_id:k().optional(),error_type:ce("source_missing_property_error").default("source_missing_property_error")}).describe("The source code is missing a property");Qt(!0);_3t=Bc.extend({type:ce("source_failed_to_create_component_error"),source_failed_to_create_component_error_id:Sn("source_failed_to_create_component_error"),error_type:ce("source_failed_to_create_component_error").default("source_failed_to_create_component_error"),component_name:k().optional(),subcircuit_id:k().optional(),parent_source_component_id:k().optional(),pcb_center:Ee({x:ge().optional(),y:ge().optional()}).optional(),schematic_center:Ee({x:ge().optional(),y:ge().optional()}).optional()}).describe("Error emitted when a component fails to be constructed");Qt(!0);Qke=Bc.extend({type:ce("source_invalid_component_property_error"),source_invalid_component_property_error_id:Sn("source_invalid_component_property_error"),source_component_id:k(),property_name:k(),property_value:Xz().optional(),expected_format:k().optional(),subcircuit_id:k().optional(),error_type:ce("source_invalid_component_property_error").default("source_invalid_component_property_error")}).describe("The source component property is invalid");Qt(!0);kke=Bc.extend({type:ce("source_trace_not_connected_error"),source_trace_not_connected_error_id:Sn("source_trace_not_connected_error"),error_type:ce("source_trace_not_connected_error").default("source_trace_not_connected_error"),subcircuit_id:k().optional(),source_group_id:k().optional(),source_trace_id:k().optional(),connected_source_port_ids:st(k()).optional(),selectors_not_found:st(k()).optional()}).describe("Occurs when a source trace selector does not match any ports");Qt(!0);g3t=Ee({type:ce("source_property_ignored_warning"),source_property_ignored_warning_id:Sn("source_property_ignored_warning"),source_component_id:k(),property_name:k(),subcircuit_id:k().optional(),error_type:ce("source_property_ignored_warning").default("source_property_ignored_warning"),message:k()}).describe("The source property was ignored");Qt(!0);Lke=Ee({type:ce("source_pin_missing_trace_warning"),source_pin_missing_trace_warning_id:Sn("source_pin_missing_trace_warning"),warning_type:ce("source_pin_missing_trace_warning").default("source_pin_missing_trace_warning"),message:k(),source_component_id:k(),source_port_id:k(),subcircuit_id:k().optional()}).describe("Warning emitted when a source component pin is missing a trace connection");Qt(!0);Hke=Ee({type:ce("source_missing_manufacturer_part_number_warning"),source_missing_manufacturer_part_number_warning_id:Sn("source_missing_manufacturer_part_number_warning"),warning_type:ce("source_missing_manufacturer_part_number_warning").default("source_missing_manufacturer_part_number_warning"),message:k(),source_component_id:k(),standard:k().optional(),subcircuit_id:k().optional()}).describe("Warning emitted when a source component is missing its manufacturer part number");Qt(!0);Fke=Ee({type:ce("source_refdes_convention_warning"),source_refdes_convention_warning_id:Sn("source_refdes_convention_warning"),warning_type:ce("source_refdes_convention_warning").default("source_refdes_convention_warning"),message:k(),source_component_id:k(),refdes:k(),source_component_ftype:k(),expected_prefixes:st(k()),actual_prefix:k().optional(),subcircuit_id:k().optional()}).describe("Warning emitted when a source component reference designator does not match the component type convention");Qt(!0);Eie=Ee({type:ce("source_component_availability_warning"),source_component_availability_warning_id:Sn("source_component_availability_warning"),warning_type:ce("source_component_availability_warning").default("source_component_availability_warning"),message:k(),source_component_id:k(),subcircuit_id:k().optional(),supplier_name:j7,supplier_part_numbers:st(k()).nonempty()}).describe("Warning emitted when no supplier alternative can be confirmed in stock. Availability may be unknown or change over time.");Qt(!0);A3t=gh.extend({ftype:ce("simple_voltage_probe")});Qt(!0);f3t=gh.extend({ftype:ce("interconnect")});Qt(!0);zke=Bc.extend({type:ce("source_i2c_misconfigured_error"),source_i2c_misconfigured_error_id:Sn("source_i2c_misconfigured_error"),error_type:ce("source_i2c_misconfigured_error").default("source_i2c_misconfigured_error"),source_port_ids:st(k())}).describe("Error emitted when incompatible I2C pins (e.g. SDA and SCL) are connected to the same net");Qt(!0);bw=Bc.extend({type:ce("source_component_misconfigured_error"),source_component_misconfigured_error_id:Sn("source_component_misconfigured_error"),error_type:ce("source_component_misconfigured_error").default("source_component_misconfigured_error"),source_component_ids:st(k()),source_port_ids:st(k()).optional()}).describe("Error emitted when one or more source components have an invalid or conflicting configuration");Qt(!0);y3t=gh.extend({ftype:ce("simple_voltage_source"),voltage:_h,frequency:Xp.optional(),peak_to_peak_voltage:_h.optional(),wave_shape:bt(["sinewave","square","triangle","sawtooth"]).optional(),phase:ii.optional(),duty_cycle:ge().optional().describe("Duty cycle as a fraction (0 to 1)"),pulse_delay:wc.optional(),rise_time:wc.optional(),fall_time:wc.optional(),pulse_width:wc.optional(),period:wc.optional()});Qt(!0);x3t=an([fke,Ake,bfe,o3t,yke,r3t,xke,i3t,s3t,a3t,Cke,c3t,h3t,bke,Ike,vke,Ske,d3t,Pke,p3t,Eke,Mke,Nke,wke,Bke,Tke,Dke,l3t,A3t,f3t,y3t,Rke,m3t,Qke,_3t,kke,g3t,Lke,Hke,Fke,Eie,zke,bw]);Qt(!0);C3t=Ee({type:ce("source_port"),pin_number:ge().optional(),port_hints:st(k()).optional(),name:k(),source_port_id:k(),source_component_id:k().optional(),source_group_id:k().optional(),most_frequently_referenced_by_name:k().optional(),subcircuit_id:k().optional(),subcircuit_connectivity_map_key:k().optional()}).merge(_j);Qt(!0);b3t=Ee({type:ce("source_component_internal_connection"),source_component_internal_connection_id:k(),source_component_id:k(),source_port_ids:st(k()),subcircuit_id:k().optional()});Qt(!0);I3t=Ee({type:ce("source_trace"),source_trace_id:k(),connected_source_port_ids:st(k()),connected_source_net_ids:st(k()),subcircuit_id:k().optional(),subcircuit_connectivity_map_key:k().optional(),max_length:ge().optional(),max_via_count:ge().int().nonnegative().optional(),name:k().optional(),min_trace_thickness:ge().optional(),display_name:k().optional()});Qt(!0);v3t=Ee({type:ce("source_group"),source_group_id:k(),subcircuit_id:k().optional(),parent_subcircuit_id:k().optional(),parent_source_group_id:k().optional(),is_subcircuit:Be().optional(),show_as_schematic_box:Be().optional(),name:k().optional(),was_automatically_named:Be().optional()});Qt(!0);S3t=Ee({type:ce("source_net"),source_net_id:k(),name:k(),member_source_group_ids:st(k()),is_power:Be().optional(),is_ground:Be().optional(),is_digital_signal:Be().optional(),is_analog_signal:Be().optional(),is_positive_voltage_source:Be().optional(),trace_width:ge().optional(),subcircuit_id:k().optional(),subcircuit_connectivity_map_key:k().optional()});Qt(!0);P3t=Ee({type:ce("source_board"),source_board_id:k(),source_group_id:k(),title:k().optional()}).describe("Defines a board in the source domain");Qt(!0);E3t=Bc.extend({type:ce("source_ambiguous_port_reference"),source_ambiguous_port_reference_id:Sn("source_ambiguous_port_reference"),error_type:ce("source_ambiguous_port_reference").default("source_ambiguous_port_reference"),source_port_id:k().optional(),source_component_id:k().optional()}).describe("Error emitted when a port hint matches multiple non-overlapping pads, making the port reference ambiguous");Qt(!0);M3t=Ee({type:ce("source_pcb_ground_plane"),source_pcb_ground_plane_id:k(),source_group_id:k(),source_net_id:k(),subcircuit_id:k().optional()}).describe("Defines a ground plane in the source domain");Qt(!0);Hg=["top","bottom","inner1","inner2","inner3","inner4","inner5","inner6","inner7","inner8"],lke=bt(Hg),Lo=lke.or(Ee({name:lke})).transform((e)=>{if(typeof e==="string")return e;return e.name});Qt(!0);jp=bt(["top","bottom"]),w3t=Ee({type:ce("source_manually_placed_via"),source_manually_placed_via_id:k(),source_group_id:k(),source_net_id:k().min(1).optional(),subcircuit_id:k().optional(),source_trace_id:k().optional()}).describe("Defines a via that is manually placed in the source domain");Qt(!0);B3t=Ee({type:ce("source_unnamed_trace_warning"),source_unnamed_trace_warning_id:Sn("source_unnamed_trace_warning"),warning_type:ce("source_unnamed_trace_warning").default("source_unnamed_trace_warning"),message:k(),source_trace_id:k(),subcircuit_id:k().optional()}).describe("Warning emitted when a source trace is missing a name");Qt(!0);T3t=Ee({type:ce("source_no_power_pin_defined_warning"),source_no_power_pin_defined_warning_id:Sn("source_no_power_pin_defined_warning"),warning_type:ce("source_no_power_pin_defined_warning").default("source_no_power_pin_defined_warning"),message:k(),source_component_id:k(),source_port_ids:st(k()),subcircuit_id:k().optional()}).describe("Warning emitted when a chip has no source ports with requires_power=true");Qt(!0);D3t=Ee({type:ce("source_no_ground_pin_defined_warning"),source_no_ground_pin_defined_warning_id:Sn("source_no_ground_pin_defined_warning"),warning_type:ce("source_no_ground_pin_defined_warning").default("source_no_ground_pin_defined_warning"),message:k(),source_component_id:k(),source_port_ids:st(k()),subcircuit_id:k().optional()}).describe("Warning emitted when a chip has no source ports marked as ground pins");Qt(!0);N3t=Ee({type:ce("source_component_pins_underspecified_warning"),source_component_pins_underspecified_warning_id:Sn("source_component_pins_underspecified_warning"),warning_type:ce("source_component_pins_underspecified_warning").default("source_component_pins_underspecified_warning"),message:k(),source_component_id:k(),source_port_ids:st(k()),subcircuit_id:k().optional()}).describe("Warning emitted when all ports on a source component are underspecified");Qt(!0);R3t=Bc.extend({type:ce("source_pin_must_be_connected_error"),source_pin_must_be_connected_error_id:Sn("source_pin_must_be_connected_error"),error_type:ce("source_pin_must_be_connected_error").default("source_pin_must_be_connected_error"),source_component_id:k(),source_port_id:k(),subcircuit_id:k().optional()}).describe("Error emitted when a pin with mustBeConnected attribute is not connected to any trace");Qt(!0);Q3t=Bc.extend({type:ce("unknown_error_finding_part"),unknown_error_finding_part_id:Sn("unknown_error_finding_part"),error_type:ce("unknown_error_finding_part").default("unknown_error_finding_part"),source_component_id:k().optional(),subcircuit_id:k().optional()}).describe("Error emitted when an unexpected error occurs while finding a part");Qt(!0);IR=Ee({type:ce("source_part_not_found_warning"),source_part_not_found_warning_id:Sn("source_part_not_found_warning"),warning_type:ce("source_part_not_found_warning").default("source_part_not_found_warning"),message:k(),source_component_id:k().optional(),subcircuit_id:k().optional(),supplier_name:j7.optional(),manufacturer_part_number:k().optional(),supplier_part_number:k().optional(),part_name:k().optional()}).describe("Warning emitted when a requested part can not be found");Qt(!0);k3t=Ee({type:ce("source_confusing_net_name_warning"),source_confusing_net_name_warning_id:Sn("source_confusing_net_name_warning"),warning_type:ce("source_confusing_net_name_warning").default("source_confusing_net_name_warning"),message:k(),source_net_ids:st(k()).min(2),net_name:k(),subcircuit_id:k().optional()}).describe("Warning emitted when electrically disconnected source nets share a name");Qt(!0);ske=an([ge().nonnegative().finite(),Ee({reference:ce("longest_manhattan"),source_trace_ids:st(k()).min(1).optional(),offset:ge().finite().optional()})]),R4t=an([ge().positive().finite(),Ee({width_multiplier:ge().positive().finite()})]),L3t=Ee({type:ce("source_bus"),source_bus_id:k(),name:k().optional(),source_trace_ids:st(k()).min(1),max_length_skew:ge().nonnegative().finite().optional(),target_impedance:ge().positive().finite().optional(),target_differential_impedance:ge().positive().finite().optional(),differential_pair:Ee({positive_source_trace_id:k(),negative_source_trace_id:k(),trace_gap:ge().positive().finite().optional(),max_uncoupled_length:ge().nonnegative().finite().optional()}).optional(),length_match_source_trace_ids:st(k()).min(1).optional(),min_length:ske.optional(),max_length:ske.optional(),target_length:ske.optional(),length_tolerance:ge().nonnegative().finite().optional(),pcb_trace_spacing:R4t.optional(),pcb_spacing_to_other_signals:R4t.optional(),target_impedance_min:ge().positive().finite().optional(),target_impedance_max:ge().positive().finite().optional(),target_differential_impedance_min:ge().positive().finite().optional(),target_differential_impedance_max:ge().positive().finite().optional(),subcircuit_id:k().optional()});Qt(!0);H3t=Bc.pick({message:!0,error_type:!0}).extend({type:ce("source_runtime_error"),source_runtime_error_id:Sn("source_runtime_error"),error_type:ce("source_runtime_error").default("source_runtime_error"),phase_name:k().optional()}).describe("An unexpected runtime failure while generating or validating a circuit");Qt(!0);F3t=Ee({type:ce("schematic_box"),schematic_sheet_id:k().optional(),schematic_component_id:k().optional(),schematic_symbol_id:k().optional(),width:Ke,height:Ke,is_dashed:Be().default(!1),x:Ke,y:Ke,subcircuit_id:k().optional()}).describe("Draws a box on the schematic");Qt(!0);z3t=Ee({type:ce("schematic_path"),schematic_path_id:Sn("schematic_path"),schematic_sheet_id:k().optional(),schematic_component_id:k().optional(),schematic_symbol_id:k().optional(),fill_color:k().optional(),is_filled:Be().optional(),is_dashed:Be().default(!1),stroke_width:Ke.nullable().optional(),stroke_color:k().optional(),dash_length:Ke.optional(),dash_gap:Ke.optional(),points:st(jo),subcircuit_id:k().optional()});Qt(!0);O3t=Ss(Ee({left_margin:ve.optional(),right_margin:ve.optional(),top_margin:ve.optional(),bottom_margin:ve.optional()})),V3t=Ee({left_size:ge(),right_size:ge(),top_size:ge().optional(),bottom_size:ge().optional()});Qt(!0);Y3t=Ee({left_side:Ee({pins:st(ge()),direction:bt(["top-to-bottom","bottom-to-top"]).optional()}).optional(),right_side:Ee({pins:st(ge()),direction:bt(["top-to-bottom","bottom-to-top"]).optional()}).optional(),top_side:Ee({pins:st(ge()),direction:bt(["left-to-right","right-to-left"]).optional()}).optional(),bottom_side:Ee({pins:st(ge()),direction:bt(["left-to-right","right-to-left"]).optional()}).optional()});Qt(!0);G3t=an([V3t,Y3t]),U3t=Ee({type:ce("schematic_component"),size:yfe,center:jo,source_component_id:k().optional(),schematic_component_id:k(),schematic_sheet_id:k().optional(),schematic_symbol_id:k().optional(),pin_spacing:ve.optional(),pin_styles:O3t.optional(),box_width:ve.optional(),symbol_name:k().optional(),port_arrangement:G3t.optional(),port_labels:Ss(k()).optional(),symbol_display_value:k().optional(),subcircuit_id:k().optional(),schematic_group_id:k().optional(),is_schematic_group:Be().optional(),source_group_id:k().optional(),is_box_with_pins:Be().optional().default(!0)});Qt(!0);svo=Ee({kicad_symbol:n3t.optional()}).catchall(Xz()),W3t=Ee({type:ce("schematic_symbol"),schematic_symbol_id:k(),name:k().optional(),metadata:svo.optional()}).describe("Defines a named schematic symbol that can be referenced by components.");Qt(!0);X3t=Ee({type:ce("schematic_line"),schematic_line_id:Sn("schematic_line"),schematic_sheet_id:k().optional(),schematic_component_id:k().optional(),schematic_symbol_id:k().optional(),x1:Ke,y1:Ke,x2:Ke,y2:Ke,stroke_width:Ke.nullable().optional(),color:k().default("#000000"),is_dashed:Be().default(!1),dash_length:Ke.optional(),dash_gap:Ke.optional(),subcircuit_id:k().optional()}).describe("Draws a styled line on the schematic");Qt(!0);j3t=Ee({type:ce("schematic_rect"),schematic_rect_id:Sn("schematic_rect"),schematic_sheet_id:k().optional(),schematic_component_id:k().optional(),schematic_symbol_id:k().optional(),center:jo,width:Ke,height:Ke,rotation:ii.default(0),stroke_width:Ke.nullable().optional(),color:k().default("#000000"),is_filled:Be().default(!1),fill_color:k().optional(),is_dashed:Be().default(!1),subcircuit_id:k().optional()}).describe("Draws a styled rectangle on the schematic");Qt(!0);K3t=Ee({type:ce("schematic_circle"),schematic_circle_id:Sn("schematic_circle"),schematic_sheet_id:k().optional(),schematic_component_id:k().optional(),schematic_symbol_id:k().optional(),center:jo,radius:Ke,stroke_width:Ke.nullable().optional(),color:k().default("#000000"),is_filled:Be().default(!1),fill_color:k().optional(),is_dashed:Be().default(!1),subcircuit_id:k().optional()}).describe("Draws a styled circle on the schematic");Qt(!0);$3t=Ee({type:ce("schematic_arc"),schematic_arc_id:Sn("schematic_arc"),schematic_sheet_id:k().optional(),schematic_component_id:k().optional(),schematic_symbol_id:k().optional(),center:jo,radius:Ke,start_angle_degrees:ii,end_angle_degrees:ii,direction:bt(["clockwise","counterclockwise"]).default("counterclockwise"),stroke_width:Ke.nullable().optional(),color:k().default("#000000"),is_dashed:Be().default(!1),subcircuit_id:k().optional()}).describe("Draws a styled arc on the schematic");Qt(!0);q3t=Ee({type:ce("schematic_trace"),schematic_trace_id:k(),schematic_sheet_id:k().optional(),source_trace_id:k().optional(),junctions:st(Ee({x:ge(),y:ge()})),edges:st(Ee({from:Ee({x:ge(),y:ge()}),to:Ee({x:ge(),y:ge()}),is_crossing:Be().optional(),from_schematic_port_id:k().optional(),to_schematic_port_id:k().optional()})),subcircuit_id:k().optional(),subcircuit_connectivity_map_key:k().optional()});Qt(!0);avo=bt(["center","left","right","top","bottom"]);Qt(!0);Oke=Ee({text:k(),is_overlined:Be().optional()}),J3t=Ee({type:ce("schematic_text"),schematic_sheet_id:k().optional(),schematic_component_id:k().optional(),schematic_symbol_id:k().optional(),schematic_text_id:k(),source_trace_id:k().optional(),text:k(),text_parts:st(Oke).min(1).optional(),display_superscript:k().optional(),font_size:ge().default(0.18),position:Ee({x:Ke,y:Ke}),rotation:ge().default(0),anchor:an([avo.describe("legacy"),Cw]).default("center"),color:k().default("#000000"),subcircuit_id:k().optional()});Qt(!0);Z3t=Ee({type:ce("schematic_port"),schematic_port_id:k(),source_port_id:k(),schematic_sheet_id:k().optional(),schematic_component_id:k().optional(),center:jo,facing_direction:bt(["up","down","left","right"]).optional(),distance_from_component_edge:ge().optional(),side_of_component:bt(["top","bottom","left","right"]).optional(),true_ccw_index:ge().optional(),pin_number:ge().optional(),display_pin_label:k().optional(),display_pin_label_text_parts:st(Oke).min(1).optional(),display_pin_label_font_size:ge().positive().finite().optional(),subcircuit_id:k().optional(),is_connected:Be().optional(),is_internal_circuit_port:Be().optional(),is_overlapping_internal_circuit_port:Be().optional(),has_input_arrow:Be().optional(),has_output_arrow:Be().optional(),is_drawn_with_inversion_circle:Be().optional()}).describe("Defines a port on a schematic component");Qt(!0);eCt=Ee({type:ce("schematic_net_label"),schematic_net_label_id:Sn("schematic_net_label"),schematic_sheet_id:k().optional(),schematic_trace_id:k().optional(),source_trace_id:k().optional(),source_net_id:k(),center:jo,anchor_position:jo.optional(),anchor_side:bt(["top","bottom","left","right"]),text:k(),display_superscript:k().optional(),symbol_name:k().optional(),is_movable:Be().optional(),subcircuit_id:k().optional()});Qt(!0);tCt=Bc.extend({type:ce("schematic_error"),schematic_error_id:k(),error_type:ce("schematic_port_not_found").default("schematic_port_not_found"),subcircuit_id:k().optional()}).describe("Defines a schematic error on the schematic");Qt(!0);nCt=Bc.extend({type:ce("schematic_layout_error"),schematic_layout_error_id:Sn("schematic_layout_error"),error_type:ce("schematic_layout_error").default("schematic_layout_error"),source_group_id:k(),schematic_group_id:k(),subcircuit_id:k().optional()}).describe("Error emitted when schematic layout fails for a group");Qt(!0);Ife=Ee({type:ce("schematic_debug_object"),label:k().optional(),subcircuit_id:k().optional()}),oCt=Ife.extend({shape:ce("rect"),center:jo,size:yfe}),rCt=Ife.extend({shape:ce("line"),start:jo,end:jo}),iCt=Ife.extend({shape:ce("point"),center:jo}),sCt=ss("shape",[oCt,rCt,iCt]);Qt(!0);aCt=Ee({type:ce("schematic_voltage_probe"),schematic_voltage_probe_id:k(),schematic_sheet_id:k().optional(),source_component_id:k().optional(),name:k().optional(),position:jo,schematic_trace_id:k(),voltage:_h.optional(),subcircuit_id:k().optional(),color:k().optional(),label_alignment:Cw.optional()}).describe("Defines a voltage probe measurement point on a schematic trace");Qt(!0);vfe=Ee({type:ce("schematic_manual_edit_conflict_warning"),schematic_manual_edit_conflict_warning_id:Sn("schematic_manual_edit_conflict_warning"),warning_type:ce("schematic_manual_edit_conflict_warning").default("schematic_manual_edit_conflict_warning"),message:k(),schematic_component_id:k(),schematic_group_id:k().optional(),subcircuit_id:k().optional(),source_component_id:k()}).describe("Warning emitted when a component has both manual placement and explicit schX/schY coordinates");Qt(!0);cCt=Ee({type:ce("schematic_component_overlap_warning"),schematic_component_overlap_warning_id:Sn("schematic_component_overlap_warning"),warning_type:ce("schematic_component_overlap_warning").default("schematic_component_overlap_warning"),message:k(),schematic_component_ids:c1([k(),k()]),schematic_sheet_id:k().optional()}).describe("Warning emitted when the rendered bounds of two schematic components overlap");Qt(!0);lCt=Ee({type:ce("schematic_component_styling_warning"),schematic_component_styling_warning_id:Sn("schematic_component_styling_warning"),warning_type:ce("schematic_component_styling_warning").default("schematic_component_styling_warning"),message:k(),schematic_component_id:k(),styling_issue_type:k(),schematic_port_ids:st(k()).optional(),source_component_id:k().optional(),schematic_sheet_id:k().optional(),subcircuit_id:k().optional()}).describe("Warning emitted when a schematic component has a visual styling issue");Qt(!0);hCt=Ee({type:ce("schematic_sheet_styling_warning"),schematic_sheet_styling_warning_id:Sn("schematic_sheet_styling_warning"),warning_type:ce("schematic_sheet_styling_warning").default("schematic_sheet_styling_warning"),message:k(),schematic_sheet_id:k(),styling_issue_type:ce("non_default_sheet_size"),subcircuit_id:k().optional()}).describe("Style warning emitted when a schematic sheet uses a non-default size");Qt(!0);dCt=Ee({type:ce("schematic_element_outside_sheet_warning"),schematic_element_outside_sheet_warning_id:Sn("schematic_element_outside_sheet_warning"),warning_type:ce("schematic_element_outside_sheet_warning").default("schematic_element_outside_sheet_warning"),message:k(),schematic_sheet_id:k(),schematic_element_type:bt(["schematic_component","schematic_net_label","schematic_trace"]),schematic_element_id:k()}).describe("Warning emitted when a schematic component, net label, or trace extends outside its schematic sheet");Qt(!0);Q4t=Ke.pipe(ge().positive().finite()),uCt=Ee({type:ce("schematic_graphic"),schematic_graphic_id:Sn("schematic_graphic"),schematic_sheet_id:k().optional(),asset:Pie.optional(),svg_content:k().optional(),width:Q4t.optional(),height:Q4t.optional()}).describe("References a graphic asset or inline SVG content with optional centered layout bounds on a schematic sheet").superRefine(({asset:e,svg_content:t},n)=>{if(e===void 0&&t===void 0)n.addIssue({code:Gt.custom,message:"At least one of asset or svg_content is required"})});Qt(!0);pCt=Ee({type:ce("schematic_group"),schematic_group_id:Sn("schematic_group"),schematic_sheet_id:k().optional(),source_group_id:k(),is_subcircuit:Be().optional(),subcircuit_id:k().optional(),width:ve,height:ve,center:jo,schematic_component_ids:st(k()),show_as_schematic_box:Be().optional(),name:k().optional(),description:k().optional()}).describe("Defines a group of components on the schematic");Qt(!0);mCt=Ee({type:ce("schematic_table"),schematic_table_id:Sn("schematic_table"),schematic_sheet_id:k().optional(),anchor_position:jo,column_widths:st(Ke),row_heights:st(Ke),cell_padding:Ke.optional(),border_width:Ke.optional(),subcircuit_id:k().optional(),schematic_component_id:k().optional(),anchor:Cw.optional()}).describe("Defines a table on the schematic");Qt(!0);_Ct=Ee({type:ce("schematic_table_cell"),schematic_table_cell_id:Sn("schematic_table_cell"),schematic_sheet_id:k().optional(),schematic_table_id:k(),start_row_index:ge(),end_row_index:ge(),start_column_index:ge(),end_column_index:ge(),text:k().optional(),center:jo,width:Ke,height:Ke,horizontal_align:bt(["left","center","right"]).optional(),vertical_align:bt(["top","middle","bottom"]).optional(),font_size:Ke.optional(),subcircuit_id:k().optional()}).describe("Defines a cell within a schematic_table");Qt(!0);Sfe=bt(["a4","ansi_b"]),gCt=Ee({type:ce("schematic_sheet"),schematic_sheet_id:Sn("schematic_sheet"),name:k().optional(),sheet_index:ge().optional(),sheet_size:Sfe.optional(),sheet_width:ge().positive().optional(),sheet_height:ge().positive().optional(),subcircuit_id:k().optional(),outline_color:k().optional()}).describe("Defines a schematic sheet or page that components can be placed on");Qt(!0);ACt=Ee({type:ce("schematic_missing_sheet_warning"),schematic_missing_sheet_warning_id:Sn("schematic_missing_sheet_warning"),warning_type:ce("schematic_missing_sheet_warning").default("schematic_missing_sheet_warning"),message:k()}).describe("Circuit-wide warning emitted when a schematic has no schematic sheet. Display as a banner without attaching it to a component or drawing a target outline or leader line.");Qt(!0);fCt=Ee({x:Ke,y:Ke,bulge:ge().optional()});Qt(!0);hke=Ee({vertices:st(fCt)});Qt(!0);Vke=Ee({outer_ring:hke,inner_rings:st(hke).default([])});Qt(!0);Pfe={from_left:"from_left",from_right:"from_right",from_top:"from_top",from_bottom:"from_bottom",from_above:"from_above",from_below:"from_below",from_x_neg:"from_left",from_x_pos:"from_right",from_y_pos:"from_top",from_y_neg:"from_bottom",from_z_pos:"from_above",from_z_neg:"from_below",from_front:"from_top",from_back:"from_bottom"},cvo={from_left:{x:-1,y:0,z:0},from_right:{x:1,y:0,z:0},from_top:{x:0,y:1,z:0},from_bottom:{x:0,y:-1,z:0},from_above:{x:0,y:0,z:1},from_below:{x:0,y:0,z:-1}},yCt=bt(["from_left","from_right","from_top","from_bottom","from_above","from_below","from_x_neg","from_x_pos","from_y_pos","from_y_neg","from_z_pos","from_z_neg","from_front","from_back"]).transform((e)=>Pfe[e]).describe('The side exposing the receptacle where the cable or mating part is attached, following the 2D PCB diagram convention, not a 3D viewport frame. In project coordinate space, "from_top" is +Y, "from_bottom" -Y, "from_left" -X, "from_right" +X, "from_above" +Z and "from_below" -Z. A receptacle on the +Y edge is "from_top" even though the plug moves in -Y as it seats. Cartesian spellings such as "from_y_pos" are accepted and normalized to the named values, as are the deprecated "from_front" (now "from_top") and "from_back" (now "from_bottom").');Qt(!0);Qt(!0);uj=bt(["leftside_top","leftside_bottom","rightside_top","rightside_bottom","topside_left","topside_right","bottomside_left","bottomside_right"]);Qt(!0);lvo=[["leftside_top","bottomside_left","rightside_bottom","topside_right"],["leftside_bottom","bottomside_right","rightside_top","topside_left"]],xCt=Ee({x:Ke,y:Ke,via:Be().optional(),via_to_layer:Lo.optional()}),dvo=st(xCt);Qt(!0);Qt(!0);r2=Ee({x:Ke,y:Ke,via:Be().optional(),to_layer:Lo.optional(),trace_width:Ke.optional()});Qt(!0);CCt=Ee({min_trace_width:ve.optional(),min_board_edge_clearance:ve.optional(),min_via_hole_edge_to_via_hole_edge_clearance:ve.optional(),min_plated_hole_drill_edge_to_drill_edge_clearance:ve.optional(),min_trace_to_pad_edge_clearance:ve.optional(),min_trace_to_hole_edge_clearance:ve.optional().describe("Minimum distance from a trace copper edge to a non-plated hole edge, in mm. No default is applied when omitted."),min_pad_edge_to_pad_edge_clearance:ve.optional(),min_same_net_trace_edge_to_trace_edge_clearance:ve.optional(),min_different_net_trace_edge_to_trace_edge_clearance:ve.optional(),min_via_edge_to_pad_edge_clearance:ve.optional(),min_via_hole_diameter:ve.optional(),min_via_pad_diameter:ve.optional()}),bCt=Ee({type:ce("pcb_component"),pcb_component_id:Sn("pcb_component"),source_component_id:k(),center:jo,layer:Lo,rotation:ii,display_offset_x:k().optional().describe("How to display the x offset for this part, usually corresponding with how the user specified it"),display_offset_y:k().optional().describe("How to display the y offset for this part, usually corresponding with how the user specified it"),width:ve,height:ve,do_not_place:Be().optional(),is_allowed_to_be_off_board:Be().optional(),subcircuit_id:k().optional(),pcb_group_id:k().optional(),position_mode:bt(["packed","relative_to_group_anchor","relative_to_another_component","none"]).optional(),anchor_position:jo.optional(),anchor_alignment:Cw.optional(),positioned_relative_to_pcb_group_id:k().optional(),positioned_relative_to_pcb_board_id:k().optional(),cable_insertion_center:jo.optional(),insertion_direction:yCt.optional(),pin1_location:uj.optional().describe("Location of pin 1 on the unrotated, top-view component footprint"),supplier_pin1_location_map:Ss(j7,uj).optional().describe("Pin 1 location for each supplier's unrotated, top-view footprint"),metadata:Ee({kicad_footprint:q4t.optional()}).optional(),obstructs_within_bounds:Be().default(!0).describe("Does this component take up all the space within its bounds on a layer. This is generally true except for when separated pin headers are being represented by a single component (in which case, chips can be placed between the pin headers) or for tall modules where chips fit underneath")}).describe("Defines a component on the PCB");Qt(!0);Efe=Ee({type:ce("pcb_debug_object"),pcb_debug_object_id:Sn("pcb_debug_object"),label:k().optional(),subcircuit_id:k().optional()}),ICt=Efe.extend({shape:ce("rect"),center:jo,size:yfe}),vCt=Efe.extend({shape:ce("line"),start:jo,end:jo}),SCt=Efe.extend({shape:ce("point"),center:jo}),PCt=ss("shape",[ICt,vCt,SCt]);Qt(!0);ECt=Ee({type:ce("pcb_hole"),pcb_hole_id:Sn("pcb_hole"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),pcb_component_id:k().optional(),hole_shape:ce("circle"),hole_diameter:ge(),x:Ke,y:Ke,is_covered_with_solder_mask:Be().optional(),soldermask_margin:ge().optional()}),uvo=ECt.describe("Defines a circular hole on the PCB");Qt(!0);MCt=Ee({type:ce("pcb_hole"),pcb_hole_id:Sn("pcb_hole"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),pcb_component_id:k().optional(),hole_shape:ce("rect"),hole_width:ge(),hole_height:ge(),x:Ke,y:Ke,is_covered_with_solder_mask:Be().optional(),soldermask_margin:ge().optional()}),pvo=MCt.describe("Defines a rectangular (square-capable) hole on the PCB. Use equal width/height for square.");Qt(!0);wCt=Ee({type:ce("pcb_hole"),pcb_hole_id:Sn("pcb_hole"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),pcb_component_id:k().optional(),hole_shape:bt(["circle","square"]),hole_diameter:ge(),x:Ke,y:Ke,is_covered_with_solder_mask:Be().optional(),soldermask_margin:ge().optional()}),mvo=wCt.describe("Defines a circular or square hole on the PCB");Qt(!0);BCt=Ee({type:ce("pcb_hole"),pcb_hole_id:Sn("pcb_hole"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),pcb_component_id:k().optional(),hole_shape:ce("oval"),hole_width:ge(),hole_height:ge(),x:Ke,y:Ke,is_covered_with_solder_mask:Be().optional(),soldermask_margin:ge().optional()}),_vo=BCt.describe("Defines an oval hole on the PCB");Qt(!0);TCt=Ee({type:ce("pcb_hole"),pcb_hole_id:Sn("pcb_hole"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),pcb_component_id:k().optional(),hole_shape:ce("pill"),hole_width:ge(),hole_height:ge(),x:Ke,y:Ke,is_covered_with_solder_mask:Be().optional(),soldermask_margin:ge().optional()}),gvo=TCt.describe("Defines a pill-shaped hole on the PCB");Qt(!0);DCt=Ee({type:ce("pcb_hole"),pcb_hole_id:Sn("pcb_hole"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),pcb_component_id:k().optional(),hole_shape:ce("rotated_pill"),hole_width:ge(),hole_height:ge(),x:Ke,y:Ke,ccw_rotation:ii,is_covered_with_solder_mask:Be().optional(),soldermask_margin:ge().optional()}),Avo=DCt.describe("Defines a rotated pill-shaped hole on the PCB");Qt(!0);NCt=wCt.or(BCt).or(TCt).or(DCt).or(ECt).or(MCt),fvo=Ee({type:ce("pcb_plated_hole"),shape:ce("circle"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),outer_diameter:ge(),hole_diameter:ge(),is_covered_with_solder_mask:Be().optional(),x:Ke,y:Ke,layers:st(Lo),port_hints:st(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),pcb_plated_hole_id:Sn("pcb_plated_hole"),soldermask_margin:ge().optional()}),yvo=Ee({type:ce("pcb_plated_hole"),shape:bt(["oval","pill"]),pcb_group_id:k().optional(),subcircuit_id:k().optional(),outer_width:ge(),outer_height:ge(),hole_width:ge(),hole_height:ge(),is_covered_with_solder_mask:Be().optional(),x:Ke,y:Ke,ccw_rotation:ii,layers:st(Lo),port_hints:st(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),pcb_plated_hole_id:Sn("pcb_plated_hole"),soldermask_margin:ge().optional()}),xvo=Ee({type:ce("pcb_plated_hole"),shape:ce("circular_hole_with_rect_pad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),hole_shape:ce("circle"),pad_shape:ce("rect"),hole_diameter:ge(),rect_pad_width:ge(),rect_pad_height:ge(),rect_border_radius:ge().optional(),hole_offset_x:Ke.default(0),hole_offset_y:Ke.default(0),is_covered_with_solder_mask:Be().optional(),x:Ke,y:Ke,layers:st(Lo),port_hints:st(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),pcb_plated_hole_id:Sn("pcb_plated_hole"),soldermask_margin:ge().optional(),rect_ccw_rotation:ii.optional()}),Cvo=Ee({type:ce("pcb_plated_hole"),shape:ce("pill_hole_with_rect_pad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),hole_shape:ce("pill"),pad_shape:ce("rect"),hole_width:ge(),hole_height:ge(),rect_pad_width:ge(),rect_pad_height:ge(),rect_border_radius:ge().optional(),hole_offset_x:Ke.default(0),hole_offset_y:Ke.default(0),is_covered_with_solder_mask:Be().optional(),x:Ke,y:Ke,layers:st(Lo),port_hints:st(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),pcb_plated_hole_id:Sn("pcb_plated_hole"),soldermask_margin:ge().optional()}),bvo=Ee({type:ce("pcb_plated_hole"),shape:ce("rotated_pill_hole_with_rect_pad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),hole_shape:ce("rotated_pill"),pad_shape:ce("rect"),hole_width:ge(),hole_height:ge(),hole_ccw_rotation:ii,rect_pad_width:ge(),rect_pad_height:ge(),rect_border_radius:ge().optional(),rect_ccw_rotation:ii,hole_offset_x:Ke.default(0),hole_offset_y:Ke.default(0),is_covered_with_solder_mask:Be().optional(),x:Ke,y:Ke,layers:st(Lo),port_hints:st(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),pcb_plated_hole_id:Sn("pcb_plated_hole"),soldermask_margin:ge().optional()}),Ivo=Ee({type:ce("pcb_plated_hole"),shape:ce("hole_with_polygon_pad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),hole_shape:bt(["circle","oval","pill","rotated_pill"]),hole_diameter:ge().optional(),hole_width:ge().optional(),hole_height:ge().optional(),pad_outline:st(Ee({x:Ke,y:Ke})).min(3),hole_offset_x:Ke.default(0),hole_offset_y:Ke.default(0),is_covered_with_solder_mask:Be().optional(),x:Ke,y:Ke,layers:st(Lo),port_hints:st(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),pcb_plated_hole_id:Sn("pcb_plated_hole"),soldermask_margin:ge().optional(),ccw_rotation:ii.optional()}),RCt=an([fvo,yvo,xvo,Cvo,bvo,Ivo]);Qt(!0);Qt(!0);Qt(!0);Qt(!0);Qt(!0);Qt(!0);QCt=Ee({type:ce("pcb_port"),pcb_port_id:Sn("pcb_port"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),source_port_id:k(),pcb_component_id:k().optional(),x:Ke,y:Ke,layers:st(Lo),is_board_pinout:Be().optional()}).describe("Defines a port on the PCB");Qt(!0);vvo=Ee({type:ce("pcb_smtpad"),shape:ce("circle"),pcb_smtpad_id:Sn("pcb_smtpad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:Ke,y:Ke,radius:ge(),layer:Lo,port_hints:st(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),is_covered_with_solder_mask:Be().optional(),soldermask_margin:ge().optional(),solderpaste_margin:ge().optional()}),Svo=Ee({type:ce("pcb_smtpad"),shape:ce("rect"),pcb_smtpad_id:Sn("pcb_smtpad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:Ke,y:Ke,width:ge(),height:ge(),rect_border_radius:ge().optional(),corner_radius:ge().optional(),layer:Lo,port_hints:st(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),is_covered_with_solder_mask:Be().optional(),soldermask_margin:ge().optional(),soldermask_margin_left:ge().optional(),soldermask_margin_top:ge().optional(),soldermask_margin_right:ge().optional(),soldermask_margin_bottom:ge().optional(),solderpaste_margin:ge().optional()}),Pvo=Ee({type:ce("pcb_smtpad"),shape:ce("rotated_rect"),pcb_smtpad_id:Sn("pcb_smtpad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:Ke,y:Ke,width:ge(),height:ge(),rect_border_radius:ge().optional(),corner_radius:ge().optional(),ccw_rotation:ii,layer:Lo,port_hints:st(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),is_covered_with_solder_mask:Be().optional(),soldermask_margin:ge().optional(),soldermask_margin_left:ge().optional(),soldermask_margin_top:ge().optional(),soldermask_margin_right:ge().optional(),soldermask_margin_bottom:ge().optional(),solderpaste_margin:ge().optional()}),kCt=Ee({type:ce("pcb_smtpad"),shape:ce("pill"),pcb_smtpad_id:Sn("pcb_smtpad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:Ke,y:Ke,width:ge(),height:ge(),radius:ge(),layer:Lo,port_hints:st(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),is_covered_with_solder_mask:Be().optional(),soldermask_margin:ge().optional(),solderpaste_margin:ge().optional()}),Evo=Ee({type:ce("pcb_smtpad"),shape:ce("rotated_pill"),pcb_smtpad_id:Sn("pcb_smtpad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:Ke,y:Ke,width:ge(),height:ge(),radius:ge(),ccw_rotation:ii,layer:Lo,port_hints:st(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),is_covered_with_solder_mask:Be().optional(),soldermask_margin:ge().optional(),solderpaste_margin:ge().optional()}),Mvo=Ee({type:ce("pcb_smtpad"),shape:ce("polygon"),pcb_smtpad_id:Sn("pcb_smtpad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),points:st(jo),layer:Lo,port_hints:st(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),is_covered_with_solder_mask:Be().optional(),soldermask_margin:ge().optional(),solderpaste_margin:ge().optional()}),LCt=ss("shape",[vvo,Svo,Pvo,Evo,kCt,Mvo]).describe("Defines an SMT pad on the PCB");Qt(!0);Qt(!0);Qt(!0);Qt(!0);Qt(!0);Qt(!0);wvo=Ee({type:ce("pcb_solder_paste"),shape:ce("circle"),pcb_solder_paste_id:Sn("pcb_solder_paste"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:Ke,y:Ke,radius:ge(),layer:Lo,pcb_component_id:k().optional(),pcb_smtpad_id:k().optional()}),Bvo=Ee({type:ce("pcb_solder_paste"),shape:ce("rect"),pcb_solder_paste_id:Sn("pcb_solder_paste"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:Ke,y:Ke,width:ge(),height:ge(),layer:Lo,pcb_component_id:k().optional(),pcb_smtpad_id:k().optional()}),Tvo=Ee({type:ce("pcb_solder_paste"),shape:ce("pill"),pcb_solder_paste_id:Sn("pcb_solder_paste"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:Ke,y:Ke,width:ge(),height:ge(),radius:ge(),layer:Lo,pcb_component_id:k().optional(),pcb_smtpad_id:k().optional()}),Dvo=Ee({type:ce("pcb_solder_paste"),shape:ce("rotated_rect"),pcb_solder_paste_id:Sn("pcb_solder_paste"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:Ke,y:Ke,width:ge(),height:ge(),ccw_rotation:Ke,layer:Lo,pcb_component_id:k().optional(),pcb_smtpad_id:k().optional()}),Nvo=Ee({type:ce("pcb_solder_paste"),shape:ce("rotated_pill"),pcb_solder_paste_id:Sn("pcb_solder_paste"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:Ke,y:Ke,width:ge(),height:ge(),radius:ge(),ccw_rotation:ii,layer:Lo,pcb_component_id:k().optional(),pcb_smtpad_id:k().optional()}),Rvo=Ee({type:ce("pcb_solder_paste"),shape:ce("oval"),pcb_solder_paste_id:Sn("pcb_solder_paste"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:Ke,y:Ke,width:ge(),height:ge(),layer:Lo,pcb_component_id:k().optional(),pcb_smtpad_id:k().optional()}),Qvo=Sie.extend({type:ce("pcb_solder_paste"),pcb_solder_paste_id:Sn("pcb_solder_paste"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),holes:st(Sie.shape.points).optional(),layer:Lo,pcb_component_id:k().optional(),pcb_smtpad_id:k().optional()}),HCt=an([wvo,Bvo,Tvo,Dvo,Nvo,Rvo,Qvo]).describe("Defines solderpaste on the PCB");Qt(!0);Qt(!0);Qt(!0);Qt(!0);Qt(!0);Qt(!0);Qt(!0);ffe=Ee({type:ce("pcb_soldermask_opening"),pcb_soldermask_opening_id:Sn("pcb_soldermask_opening"),layer:Lo.pipe(jp),pcb_component_id:k().optional(),pcb_group_id:k().optional(),subcircuit_id:k().optional()}),FCt=ss("shape",[mke.extend(ffe.shape),xfe.extend(ffe.shape),_ke.extend(ffe.shape),Sie.extend(ffe.shape)]).describe("An explicit opening in top or bottom solder mask or flex coverlay, independent of pads. Removes mask without adding copper or solder paste.");Qt(!0);zCt=Ee({type:ce("pcb_text"),pcb_text_id:Sn("pcb_text"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),text:k(),center:jo,layer:Lo,width:ve,height:ve,lines:ge(),align:bt(["bottom-left"])}).describe("Defines text on the PCB");Qt(!0);k4t=Ke.pipe(ge().finite().positive()),OCt=Ee({route_type:ce("wire"),x:Ke,y:Ke,width:Ke,start_width:k4t.optional(),end_width:k4t.optional(),width_interpolation_mode:bt(["linear","quadratic"]).optional(),copper_pour_id:k().optional(),is_inside_copper_pour:Be().optional(),start_pcb_port_id:k().optional(),end_pcb_port_id:k().optional(),layer:Lo}).superRefine((e,t)=>{let n=[e.start_width,e.end_width,e.width_interpolation_mode].filter((o)=>o!==void 0).length;if(n===0)return;if(n!==3)t.addIssue({code:Gt.custom,message:"Wire taper requires start_width, end_width and width_interpolation_mode together"});if(e.width!==e.start_width)t.addIssue({code:Gt.custom,path:["start_width"],message:"start_width must equal width"});if(!Number.isFinite(e.x)||!Number.isFinite(e.y))t.addIssue({code:Gt.custom,message:"Tapered wire coordinates must be finite"})}),VCt=Ee({route_type:ce("via"),x:Ke,y:Ke,copper_pour_id:k().optional(),is_inside_copper_pour:Be().optional(),hole_diameter:Ke.optional(),outer_diameter:Ke.optional(),tented_on_top:Be().optional(),tented_on_bottom:Be().optional(),from_layer:Lo,to_layer:Lo}),YCt=Ee({route_type:ce("through_pad"),start:jo,end:jo,width:Ke,start_layer:Lo,end_layer:Lo,pcb_smtpad_id:k().optional(),pcb_plated_hole_id:k().optional()}),Mfe=an([OCt,VCt,YCt]),GCt=Ee({type:ce("pcb_trace"),source_trace_id:k().optional(),pcb_component_id:k().optional(),pcb_trace_id:Sn("pcb_trace"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),route_thickness_mode:bt(["constant","interpolated"]).default("constant").optional(),route_order_index:ge().optional(),should_round_corners:Be().optional(),trace_length:ge().optional(),is_antenna_trace:Be().optional(),highlight_color:k().optional(),route:st(Mfe).superRefine((e,t)=>{for(let[n,o]of e.entries()){if(o.route_type!=="wire"||o.width_interpolation_mode===void 0)continue;let r=e[n+1],i=r?.route_type==="through_pad"?r.start:r,s=r?.route_type==="wire"?r.layer:r?.route_type==="via"?r.from_layer:r?.start_layer,a=i?Math.hypot(i.x-o.x,i.y-o.y):NaN;if(!Number.isFinite(a)||a<=0||s!==o.layer)t.addIssue({code:Gt.custom,path:[n],message:"Tapered wire must lead to a distinct finite next point on the same layer"})}})}).describe("Defines a trace on the PCB");Qt(!0);Qt(!0);UCt=Ee({type:ce("pcb_trace_warning"),pcb_trace_warning_id:Sn("pcb_trace_warning"),warning_type:ce("pcb_trace_warning").default("pcb_trace_warning"),message:k(),center:jo.optional(),pcb_trace_id:k(),source_trace_id:k(),pcb_component_ids:st(k()),pcb_port_ids:st(k()),subcircuit_id:k().optional()}).describe("Defines a trace warning on the PCB");Qt(!0);WCt=Ee({type:ce("pcb_trace_style_warning"),pcb_trace_style_warning_id:Sn("pcb_trace_style_warning"),warning_type:ce("pcb_trace_style_warning").default("pcb_trace_style_warning"),message:k(),styling_issue_type:ce("long_segment_at_odd_angle"),pcb_trace_id:k(),source_trace_id:k().optional(),subcircuit_id:k().optional(),layer:Lo,start_route_index:ge().int().nonnegative(),end_route_index:ge().int().nonnegative(),segment_start:jo,segment_end:jo,center:jo,segment_length:Ke,minimum_segment_length:Ke,angle_degrees:ge().min(0).lt(360),nearest_allowed_angle_degrees:ge().min(0).lt(360).multipleOf(45),angle_deviation_degrees:ge().min(0).max(22.5),angle_tolerance_degrees:ge().min(0).lt(22.5)}).describe("Warning for a long PCB trace segment whose direction deviates from a multiple of 45 degrees");Qt(!0);XCt=Ee({type:ce("pcb_trace_too_long_error"),pcb_trace_too_long_error_id:Sn("pcb_trace_too_long_error"),error_type:ce("pcb_trace_too_long_error").default("pcb_trace_too_long_error"),message:k(),pcb_trace_id:k(),source_net_id:k().optional(),source_trace_id:k().optional(),actual_trace_length:Ke,maximum_trace_length:Ke,subcircuit_id:k().optional()}).describe("Error emitted when a PCB trace is longer than its maximum allowed length");Qt(!0);jCt=Bc.extend({type:ce("pcb_bus_length_skew_error"),pcb_bus_length_skew_error_id:Sn("pcb_bus_length_skew_error"),error_type:ce("pcb_bus_length_skew_error").default("pcb_bus_length_skew_error"),source_bus_id:k(),source_trace_ids:st(k()),pcb_trace_ids:st(k()),actual_length_skew:ge().nonnegative().finite(),maximum_length_skew:ge().nonnegative().finite(),subcircuit_id:k().optional()});Qt(!0);KCt=Ee({type:ce("pcb_trace_too_long_warning"),pcb_trace_too_long_warning_id:Sn("pcb_trace_too_long_warning"),warning_type:ce("pcb_trace_too_long_warning").default("pcb_trace_too_long_warning"),message:k(),pcb_trace_id:k(),source_net_id:k().optional(),source_trace_id:k().optional(),actual_trace_length:Ke,maximum_trace_length:Ke,subcircuit_id:k().optional()}).describe("Warning emitted when a PCB trace is longer than its maximum allowed length");Qt(!0);$Ct=Ee({type:ce("pcb_trace_too_many_vias_warning"),pcb_trace_too_many_vias_warning_id:Sn("pcb_trace_too_many_vias_warning"),warning_type:ce("pcb_trace_too_many_vias_warning").default("pcb_trace_too_many_vias_warning"),message:k(),pcb_trace_id:k(),source_net_id:k().optional(),source_trace_id:k().optional(),actual_via_count:ge().int().nonnegative(),maximum_via_count:ge().int().nonnegative(),subcircuit_id:k().optional()}).describe("Warning emitted when a PCB trace has more vias than its maximum allowed count");Qt(!0);jz=Bc.extend({type:ce("pcb_bus_routing_constraint_error"),pcb_bus_routing_constraint_error_id:Sn("pcb_bus_routing_constraint_error"),error_type:ce("pcb_bus_routing_constraint_error").default("pcb_bus_routing_constraint_error"),source_bus_id:k(),source_trace_ids:st(k()).min(1),pcb_trace_ids:st(k()),subcircuit_id:k().optional()}),wfe=ss("routing_rule",[jz.extend({routing_rule:ce("length_skew"),actual_length_skew:ge().nonnegative().finite(),maximum_length_skew:ge().nonnegative().finite()}),jz.extend({routing_rule:ce("min_length"),actual_trace_length:ge().nonnegative().finite(),minimum_trace_length:ge().finite()}),jz.extend({routing_rule:ce("max_length"),actual_trace_length:ge().nonnegative().finite(),maximum_trace_length:ge().finite()}),jz.extend({routing_rule:ce("target_length"),actual_trace_length:ge().nonnegative().finite(),target_trace_length:ge().finite(),length_tolerance:ge().nonnegative().finite()}),jz.extend({routing_rule:ce("pcb_trace_spacing"),other_pcb_trace_id:k(),other_source_trace_id:k().optional(),actual_centerline_spacing:ge().nonnegative().finite(),minimum_centerline_spacing:ge().positive().finite()}),jz.extend({routing_rule:ce("pcb_spacing_to_other_signals"),other_pcb_trace_id:k(),other_source_trace_id:k().optional(),actual_centerline_spacing:ge().nonnegative().finite(),minimum_centerline_spacing:ge().positive().finite()}),jz.extend({routing_rule:ce("impedance_target"),target_impedance:ge().positive().finite(),minimum_impedance:ge().positive().finite().optional(),maximum_impedance:ge().positive().finite().optional()})]).superRefine((e,t)=>{if(e.routing_rule!=="impedance_target")return;if(e.minimum_impedance===void 0&&e.maximum_impedance===void 0)t.addIssue({code:Gt.custom,path:["minimum_impedance"],message:"Provide an impedance bound"});if(e.minimum_impedance!==void 0&&e.maximum_impedance!==void 0&&e.minimum_impedance>e.maximum_impedance)t.addIssue({code:Gt.custom,path:["maximum_impedance"],message:"Impedance bounds must be ordered"})}).describe("A declared bus or differential-pair routing constraint is violated.");Qt(!0);bie=Ee({type:ce("pcb_bus_routing_constraint_warning"),pcb_bus_routing_constraint_warning_id:Sn("pcb_bus_routing_constraint_warning"),warning_type:ce("pcb_bus_routing_constraint_warning").default("pcb_bus_routing_constraint_warning"),source_bus_id:k(),source_trace_ids:st(k()).min(1),pcb_trace_ids:st(k()),message:k(),subcircuit_id:k().optional()}).describe("A declared bus or pair constraint could not be verified; this is not a pass."),Bfe=ss("routing_rule",[bie.extend({routing_rule:ce("route_geometry")}),bie.extend({routing_rule:ce("reference_geometry")}),bie.extend({routing_rule:ce("spacing_geometry")}),bie.extend({routing_rule:ce("target_length")}),bie.extend({routing_rule:ce("physical_impedance")})]);Qt(!0);qCt=Bc.extend({type:ce("pcb_trace_error"),pcb_trace_error_id:Sn("pcb_trace_error"),error_type:ce("pcb_trace_error").default("pcb_trace_error"),center:jo.optional(),pcb_trace_id:k(),source_trace_id:k(),pcb_component_ids:st(k()),pcb_port_ids:st(k()),subcircuit_id:k().optional()}).describe("Defines a trace error on the PCB");Qt(!0);JCt=Bc.extend({type:ce("pcb_trace_missing_error"),pcb_trace_missing_error_id:Sn("pcb_trace_missing_error"),error_type:ce("pcb_trace_missing_error").default("pcb_trace_missing_error"),center:jo.optional(),source_trace_id:k(),pcb_component_ids:st(k()),pcb_port_ids:st(k()),subcircuit_id:k().optional()}).describe("Defines an error when a source trace has no corresponding PCB trace");Qt(!0);ZCt=Bc.extend({type:ce("pcb_port_not_matched_error"),pcb_error_id:Sn("pcb_error"),error_type:ce("pcb_port_not_matched_error").default("pcb_port_not_matched_error"),pcb_component_ids:st(k()),subcircuit_id:k().optional()}).describe("Defines a trace error on the PCB where a port is not matched");Qt(!0);ebt=Bc.extend({type:ce("pcb_port_not_connected_error"),pcb_port_not_connected_error_id:Sn("pcb_port_not_connected_error"),error_type:ce("pcb_port_not_connected_error").default("pcb_port_not_connected_error"),pcb_port_ids:st(k()),pcb_component_ids:st(k()),subcircuit_id:k().optional()}).describe("Defines an error when a pcb port is not connected to any trace");Qt(!0);tbt=Ee({type:ce("pcb_net"),pcb_net_id:Sn("pcb_net"),source_net_id:k().optional(),highlight_color:k().optional()}).describe("Defines a net on the PCB");Qt(!0);vR=Ee({type:ce("pcb_via"),pcb_via_id:Sn("pcb_via"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),subcircuit_connectivity_map_key:k().optional(),x:Ke,y:Ke,outer_diameter:Ke.default("0.6mm"),hole_diameter:Ke.default("0.25mm"),topmost_drill_layer:Lo.optional(),bottommost_drill_layer:Lo.optional(),through_hole:Be().optional(),from_layer:Lo.optional(),to_layer:Lo.optional(),layers:st(Lo),pcb_port_ids:st(k()).optional(),pcb_trace_id:k().optional(),source_trace_id:k().optional(),source_net_id:k().min(1).optional(),net_is_assignable:Be().optional(),net_assigned:Be().optional(),is_tented:Be().optional(),tented_on_top:Be().optional(),tented_on_bottom:Be().optional()}).transform(({is_tented:e,...t})=>{if(e!==void 0)t.tented_on_top??=e,t.tented_on_bottom??=e;return t}).describe("Defines a via on the PCB");Qt(!0);nbt=Ee({type:ce("pcb_board"),pcb_board_id:Sn("pcb_board"),pcb_panel_id:k().optional(),carrier_pcb_board_id:k().optional(),is_subcircuit:Be().optional(),subcircuit_id:k().optional(),is_mounted_to_carrier_board:Be().optional(),is_via_in_pad_allowed:Be().optional(),default_via_tented_on_top:Be().optional(),default_via_tented_on_bottom:Be().optional(),default_via_plugged:Be().optional(),width:ve.optional(),height:ve.optional(),center:jo,display_offset_x:k().optional().describe("How to display the x offset for this board, usually corresponding with how the user specified it"),display_offset_y:k().optional().describe("How to display the y offset for this board, usually corresponding with how the user specified it"),thickness:ve.optional().default(1.4),num_layers:ge().optional().default(4),allow_blind_and_buried_vias:Be().optional().describe("Whether autorouters may generate blind and buried vias. False restricts newly generated vias to the full board stack."),outline:st(jo).optional(),shape:bt(["rect","polygon"]).optional(),material:bt(["fr4","fr1","flex"]).default("fr4"),solder_mask_color:k().optional(),silkscreen_color:k().optional(),anchor_position:jo.optional(),anchor_alignment:Cw.optional(),position_mode:bt(["relative_to_panel_anchor","none"]).optional()}).merge(CCt).describe("Defines the board outline of the PCB");Qt(!0);L4t=jo.extend({x:ve.pipe(ge().finite()),y:ve.pipe(ge().finite())}),obt=Ee({type:ce("pcb_bend"),pcb_bend_id:Sn("pcb_bend"),pcb_board_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),name:k().optional(),start:L4t,end:L4t,bend_angle:ii.pipe(ge().finite()),bend_radius:ve.pipe(ge().finite().positive()),bend_side:bt(["left","right"])}).refine(({start:e,end:t})=>e.x!==t.x||e.y!==t.y,{message:"Bend centerline endpoints must be distinct",path:["end"]}).describe("Defines a finite-radius bend on a flat PCB for runtime CAD folding");Qt(!0);dke=ve.pipe(ge().finite().positive()),rbt=jo.extend({x:ve.pipe(ge().finite()),y:ve.pipe(ge().finite())}),ibt=Ee({type:ce("pcb_stiffener"),pcb_stiffener_id:Sn("pcb_stiffener"),pcb_board_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),name:k().optional(),layer:bt(["top","bottom"]),material:bt(["fr4","polyimide","stainless_steel","aluminum"]),thickness:dke,adhesive_thickness:ve.pipe(ge().finite().nonnegative()).optional()}),sbt=ibt.extend({shape:ce("rect"),center:rbt,rotation:ii.pipe(ge().finite()).optional(),width:dke,height:dke,outline:Fm().optional()});Qt(!0);abt=ibt.extend({shape:ce("polygon"),outline:st(rbt).min(3).refine((e)=>{let t=e.reduce((n,o,r)=>{let i=e[(r+1)%e.length];return n+o.x*i.y-i.x*o.y},0);return Number.isFinite(t)&&t!==0},"Stiffener outline must enclose a nonzero area"),center:Fm().optional(),rotation:Fm().optional(),width:Fm().optional(),height:Fm().optional()});Qt(!0);cbt=ss("shape",[sbt,abt]).describe("Defines bonded mechanical PCB reinforcement without adding copper layers");Qt(!0);lbt=Ee({type:ce("pcb_panel"),pcb_panel_id:Sn("pcb_panel"),width:ve,height:ve,center:jo,thickness:ve.optional().default(1.4),covered_with_solder_mask:Be().optional().default(!0)}).describe("Defines a PCB panel that can contain multiple boards");Qt(!0);hbt=Bc.extend({type:ce("pcb_placement_error"),pcb_placement_error_id:Sn("pcb_placement_error"),error_type:ce("pcb_placement_error").default("pcb_placement_error"),subcircuit_id:k().optional()}).describe("Defines a placement error on the PCB");Qt(!0);dbt=Bc.extend({type:ce("pcb_packing_error"),pcb_packing_error_id:Sn("pcb_packing_error"),error_type:ce("pcb_packing_error").default("pcb_packing_error"),pcb_group_id:k().optional(),subcircuit_id:k().optional()}).describe("Defines a failure to pack PCB components within layout bounds");Qt(!0);ubt=Bc.extend({type:ce("pcb_panelization_placement_error"),pcb_panelization_placement_error_id:Sn("pcb_panelization_placement_error"),error_type:ce("pcb_panelization_placement_error").default("pcb_panelization_placement_error"),pcb_panel_id:k().optional(),pcb_board_id:k().optional(),subcircuit_id:k().optional()}).describe("Defines a panelization placement error on the PCB");Qt(!0);pbt=Ee({type:ce("pcb_trace_hint"),pcb_trace_hint_id:Sn("pcb_trace_hint"),pcb_port_id:k(),pcb_component_id:k(),route:st(r2),subcircuit_id:k().optional()}).describe("A hint that can be used during generation of a PCB trace");Qt(!0);mbt=Ee({type:ce("pcb_silkscreen_line"),pcb_silkscreen_line_id:Sn("pcb_silkscreen_line"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),stroke_width:Ke.default("0.1mm"),x1:Ke,y1:Ke,x2:Ke,y2:Ke,layer:jp}).describe("Defines a silkscreen line on the PCB");Qt(!0);_bt=Ee({type:ce("pcb_silkscreen_path"),pcb_silkscreen_path_id:Sn("pcb_silkscreen_path"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),layer:jp,route:st(jo),stroke_width:ve}).describe("Defines a silkscreen path on the PCB");Qt(!0);gbt=Ee({type:ce("pcb_silkscreen_text"),pcb_silkscreen_text_id:Sn("pcb_silkscreen_text"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),font:ce("tscircuit2024").default("tscircuit2024"),font_size:Ke.default("0.2mm"),pcb_component_id:k(),text:k(),is_knockout:Be().default(!1).optional(),knockout_padding:Ee({left:ve,top:ve,bottom:ve,right:ve}).default({left:"0.2mm",top:"0.2mm",bottom:"0.2mm",right:"0.2mm"}).optional(),ccw_rotation:ge().optional(),layer:Lo,is_mirrored:Be().default(!1).optional(),anchor_position:jo.default({x:0,y:0}),anchor_alignment:Cw.default("center")}).describe("Defines silkscreen text on the PCB");Qt(!0);Abt=Ee({type:ce("pcb_copper_text"),pcb_copper_text_id:Sn("pcb_copper_text"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),font:ce("tscircuit2024").default("tscircuit2024"),font_size:Ke.default("0.2mm"),pcb_component_id:k(),text:k(),is_knockout:Be().default(!1).optional(),knockout_padding:Ee({left:ve,top:ve,bottom:ve,right:ve}).default({left:"0.2mm",top:"0.2mm",bottom:"0.2mm",right:"0.2mm"}).optional(),ccw_rotation:ge().optional(),layer:Lo,is_mirrored:Be().default(!1).optional(),anchor_position:jo.default({x:0,y:0}),anchor_alignment:Cw.default("center")}).describe("Defines copper text on the PCB");Qt(!0);fbt=Ee({type:ce("pcb_silkscreen_rect"),pcb_silkscreen_rect_id:Sn("pcb_silkscreen_rect"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:jo,width:ve,height:ve,layer:Lo,stroke_width:ve.default("1mm"),corner_radius:ve.optional(),is_filled:Be().default(!0).optional(),has_stroke:Be().optional(),is_stroke_dashed:Be().optional(),ccw_rotation:ge().optional()}).describe("Defines a silkscreen rect on the PCB");Qt(!0);ybt=Ee({type:ce("pcb_silkscreen_circle"),pcb_silkscreen_circle_id:Sn("pcb_silkscreen_circle"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:jo,radius:ve,layer:jp,stroke_width:ve.default("1mm"),is_filled:Be().optional()}).describe("Defines a silkscreen circle on the PCB");Qt(!0);xbt=Ee({type:ce("pcb_silkscreen_oval"),pcb_silkscreen_oval_id:Sn("pcb_silkscreen_oval"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:jo,radius_x:Ke,radius_y:Ke,layer:jp,ccw_rotation:ii.optional()}).describe("Defines a silkscreen oval on the PCB");Qt(!0);kvo=Ee({type:ce("pcb_silkscreen_graphic"),pcb_silkscreen_graphic_id:Sn("pcb_silkscreen_graphic"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),layer:jp,image_asset:Pie.optional()}),Cbt=kvo.extend({shape:ce("brep"),brep_shape:Vke}).describe("Defines a BRep silkscreen graphic on the PCB");Qt(!0);bbt=ss("shape",[Cbt]).describe("Defines a silkscreen graphic on the PCB");Qt(!0);Ibt=Ee({type:ce("pcb_silkscreen_pill"),pcb_silkscreen_pill_id:Sn("pcb_silkscreen_pill"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:jo,width:ve,height:ve,layer:Lo,ccw_rotation:ge().optional()}).describe("Defines a silkscreen pill on the PCB");Qt(!0);vbt=Ee({type:ce("pcb_fabrication_note_text"),pcb_fabrication_note_text_id:Sn("pcb_fabrication_note_text"),subcircuit_id:k().optional(),pcb_group_id:k().optional(),font:ce("tscircuit2024").default("tscircuit2024"),font_size:Ke.default("1mm"),pcb_component_id:k(),text:k(),ccw_rotation:ge().optional(),layer:jp,anchor_position:jo.default({x:0,y:0}),anchor_alignment:bt(["center","top_left","top_right","bottom_left","bottom_right"]).default("center"),color:k().optional()}).describe("Defines a fabrication note in text on the PCB, useful for leaving notes for assemblers or fabricators");Qt(!0);Sbt=Ee({type:ce("pcb_fabrication_note_path"),pcb_fabrication_note_path_id:Sn("pcb_fabrication_note_path"),pcb_component_id:k(),subcircuit_id:k().optional(),layer:Lo,route:st(jo),stroke_width:ve,color:k().optional(),is_filled:Be().optional(),has_stroke:Be().optional()}).describe("Defines a fabrication path on the PCB for fabricators or assemblers");Qt(!0);Pbt=Ee({type:ce("pcb_fabrication_note_rect"),pcb_fabrication_note_rect_id:Sn("pcb_fabrication_note_rect"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:jo,width:ve,height:ve,layer:jp,stroke_width:ve.default("0.1mm"),corner_radius:ve.optional(),is_filled:Be().optional(),has_stroke:Be().optional(),is_stroke_dashed:Be().optional(),color:k().optional()}).describe("Defines a fabrication note rectangle on the PCB");Qt(!0);Ebt=Ee({type:ce("pcb_fabrication_note_dimension"),pcb_fabrication_note_dimension_id:Sn("pcb_fabrication_note_dimension"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),layer:jp,from:jo,to:jo,text:k().optional(),text_ccw_rotation:ge().optional(),offset:ve.optional(),offset_distance:ve.optional(),offset_direction:Ee({x:ge(),y:ge()}).optional(),font:ce("tscircuit2024").default("tscircuit2024"),font_size:ve.default("1mm"),color:k().optional(),arrow_size:ve.default("1mm")}).describe("Defines a measurement annotation within PCB fabrication notes");Qt(!0);Mbt=Ee({type:ce("pcb_note_text"),pcb_note_text_id:Sn("pcb_note_text"),pcb_component_id:k().optional(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),name:k().optional(),font:ce("tscircuit2024").default("tscircuit2024"),font_size:Ke.default("1mm"),text:k().optional(),anchor_position:jo.default({x:0,y:0}),anchor_alignment:bt(["center","top_left","top_right","bottom_left","bottom_right"]).default("center"),layer:jp.default("top"),is_mirrored_from_top_view:Be().optional(),color:k().optional()}).describe("Defines a documentation note in text on the PCB");Qt(!0);wbt=Ee({type:ce("pcb_note_rect"),pcb_note_rect_id:Sn("pcb_note_rect"),pcb_component_id:k().optional(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),name:k().optional(),text:k().optional(),center:jo,width:ve,height:ve,layer:jp.default("top"),stroke_width:ve.default("0.1mm"),corner_radius:ve.optional(),is_filled:Be().optional(),has_stroke:Be().optional(),is_stroke_dashed:Be().optional(),color:k().optional()}).describe("Defines a rectangular documentation note on the PCB");Qt(!0);Bbt=Ee({type:ce("pcb_note_path"),pcb_note_path_id:Sn("pcb_note_path"),pcb_component_id:k().optional(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),name:k().optional(),text:k().optional(),route:st(jo),layer:jp.default("top"),stroke_width:ve.default("0.1mm"),color:k().optional()}).describe("Defines a polyline documentation note on the PCB");Qt(!0);Tbt=Ee({type:ce("pcb_note_line"),pcb_note_line_id:Sn("pcb_note_line"),pcb_component_id:k().optional(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),name:k().optional(),text:k().optional(),x1:Ke,y1:Ke,x2:Ke,y2:Ke,layer:jp.default("top"),stroke_width:Ke.default("0.1mm"),color:k().optional(),is_dashed:Be().optional()}).describe("Defines a straight documentation note line on the PCB");Qt(!0);Dbt=Ee({type:ce("pcb_note_dimension"),pcb_note_dimension_id:Sn("pcb_note_dimension"),pcb_component_id:k().optional(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),name:k().optional(),from:jo,to:jo,text:k().optional(),text_ccw_rotation:ge().optional(),offset_distance:ve.optional(),offset_direction:Ee({x:ge(),y:ge()}).optional(),font:ce("tscircuit2024").default("tscircuit2024"),font_size:ve.default("1mm"),layer:jp.default("top"),color:k().optional(),arrow_size:ve.default("1mm")}).describe("Defines a measurement annotation within PCB documentation notes");Qt(!0);Nbt=Bc.extend({type:ce("pcb_footprint_overlap_error"),pcb_error_id:Sn("pcb_error"),error_type:ce("pcb_footprint_overlap_error").default("pcb_footprint_overlap_error"),pcb_smtpad_ids:st(k()).optional(),pcb_plated_hole_ids:st(k()).optional(),pcb_hole_ids:st(k()).optional(),pcb_keepout_ids:st(k()).optional()}).describe("Error emitted when a pcb footprint overlaps with another element");Qt(!0);Rbt=Bc.extend({type:ce("pcb_courtyard_overlap_error"),pcb_error_id:Sn("pcb_error"),error_type:ce("pcb_courtyard_overlap_error").default("pcb_courtyard_overlap_error"),pcb_component_ids:c1([k(),k()])}).describe("Error emitted when the courtyard (CrtYd) of one PCB component overlaps with the courtyard of another");Qt(!0);Qbt=Ee({type:ce("pcb_keepout"),shape:ce("outline"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),outline:st(jo).min(2),stroke_width:ve,pcb_keepout_id:k(),layers:st(k()),description:k().optional(),excluded_pcb_component_ids:st(k()).optional(),warning_only:Be().optional(),allow_traces:Be().optional(),allow_placements:Be().optional()}),kbt=Ee({type:ce("pcb_keepout"),shape:ce("rect"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:jo,width:Ke,height:Ke,pcb_keepout_id:k(),layers:st(k()),description:k().optional(),excluded_pcb_component_ids:st(k()).optional(),warning_only:Be().optional(),allow_traces:Be().optional(),allow_placements:Be().optional()}).or(Ee({type:ce("pcb_keepout"),shape:ce("circle"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:jo,radius:Ke,pcb_keepout_id:k(),layers:st(k()),description:k().optional(),excluded_pcb_component_ids:st(k()).optional(),warning_only:Be().optional(),allow_traces:Be().optional(),allow_placements:Be().optional()})).or(Qbt);Qt(!0);Qt(!0);Lbt=Ee({type:ce("pcb_keepout_overlap_warning"),pcb_keepout_overlap_warning_id:Sn("pcb_keepout_overlap_warning"),warning_type:ce("pcb_keepout_overlap_warning").default("pcb_keepout_overlap_warning"),message:k(),pcb_keepout_id:k(),pcb_component_ids:st(k()).optional(),pcb_trace_ids:st(k()).optional(),pcb_smtpad_ids:st(k()).optional(),pcb_plated_hole_ids:st(k()).optional(),pcb_via_ids:st(k()).optional(),center:jo.optional(),subcircuit_id:k().optional()}).describe("Warning emitted when copper overlaps a PCB keepout with warning_only enabled");Qt(!0);Tfe=Ee({type:ce("pcb_cutout"),pcb_cutout_id:Sn("pcb_cutout"),pcb_component_id:k().optional(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),pcb_board_id:k().optional(),pcb_panel_id:k().optional()}),Hbt=Tfe.extend({shape:ce("rect"),center:jo,width:ve,height:ve,rotation:ii.optional(),corner_radius:ve.optional()});Qt(!0);Fbt=Tfe.extend({shape:ce("circle"),center:jo,radius:ve});Qt(!0);zbt=Tfe.extend({shape:ce("polygon"),points:st(jo)});Qt(!0);Obt=Tfe.extend({shape:ce("path"),route:st(jo),slot_width:ve,slot_length:ve.optional(),space_between_slots:ve.optional(),slot_corner_radius:ve.optional()});Qt(!0);Vbt=ss("shape",[Hbt,Fbt,zbt,Obt]).describe("Defines a cutout on the PCB, removing board material.");Qt(!0);Ybt=Bc.extend({type:ce("pcb_missing_footprint_error"),pcb_missing_footprint_error_id:Sn("pcb_missing_footprint_error"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),error_type:ce("pcb_missing_footprint_error").default("pcb_missing_footprint_error"),source_component_id:k()}).describe("Defines a missing footprint error on the PCB");Qt(!0);gj=Bc.extend({type:ce("external_footprint_load_error"),external_footprint_load_error_id:Sn("external_footprint_load_error"),pcb_component_id:k(),source_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),footprinter_string:k().optional(),error_type:ce("external_footprint_load_error").default("external_footprint_load_error")}).describe("Defines an error when an external footprint fails to load");Qt(!0);Dfe=Bc.extend({type:ce("circuit_json_footprint_load_error"),circuit_json_footprint_load_error_id:Sn("circuit_json_footprint_load_error"),pcb_component_id:k(),source_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),error_type:ce("circuit_json_footprint_load_error").default("circuit_json_footprint_load_error"),circuit_json:st(Sd()).optional()}).describe("Defines an error when a circuit JSON footprint fails to load");Qt(!0);Gbt=Ee({type:ce("pcb_group"),pcb_group_id:Sn("pcb_group"),source_group_id:k(),is_subcircuit:Be().optional(),subcircuit_id:k().optional(),width:ve.optional(),height:ve.optional(),center:jo,display_offset_x:k().optional().describe("How to display the x offset for this group, usually corresponding with how the user specified it"),display_offset_y:k().optional().describe("How to display the y offset for this group, usually corresponding with how the user specified it"),outline:st(jo).optional(),anchor_position:jo.optional(),anchor_alignment:Cw.default("center"),position_mode:bt(["packed","relative_to_group_anchor","none"]).optional(),positioned_relative_to_pcb_group_id:k().optional(),positioned_relative_to_pcb_board_id:k().optional(),pcb_component_ids:st(k()),child_layout_mode:bt(["packed","none"]).optional(),name:k().optional(),description:k().optional(),layout_mode:k().optional(),autorouter_configuration:Ee({trace_clearance:ve}).optional(),autorouter_used_string:k().optional()}).describe("Defines a group of components on the PCB");Qt(!0);Ubt=Bc.extend({type:ce("pcb_autorouting_error"),pcb_error_id:Sn("pcb_autorouting_error"),error_type:ce("pcb_autorouting_error").default("pcb_autorouting_error"),subcircuit_id:k().optional()}).describe("The autorouting has failed to route a portion of the board");Qt(!0);Wbt=Bc.extend({type:ce("pcb_preflight_routing_error"),pcb_preflight_routing_error_id:Sn("pcb_preflight_routing_error"),error_type:ce("pcb_preflight_routing_error").default("pcb_preflight_routing_error"),error_code:k(),subcircuit_id:k().optional(),pcb_group_id:k().optional(),routing_phase_index:ge().int().optional(),phase_name:k().optional(),source_trace_ids:st(k()).optional(),pcb_component_ids:st(k()).optional(),pcb_port_ids:st(k()).optional(),related_error_ids:st(k()).optional(),measurements:Ss(ge().finite()).optional()});Qt(!0);Nfe=Ee({type:ce("pcb_manual_edit_conflict_warning"),pcb_manual_edit_conflict_warning_id:Sn("pcb_manual_edit_conflict_warning"),warning_type:ce("pcb_manual_edit_conflict_warning").default("pcb_manual_edit_conflict_warning"),message:k(),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),source_component_id:k()}).describe("Warning emitted when a component has both manual placement and explicit pcbX/pcbY coordinates");Qt(!0);H4t=bt(["x-","x+","y+","y-"]),Xbt=Ee({type:ce("pcb_connector_not_in_accessible_orientation_warning"),pcb_connector_not_in_accessible_orientation_warning_id:Sn("pcb_connector_not_in_accessible_orientation_warning"),warning_type:ce("pcb_connector_not_in_accessible_orientation_warning").default("pcb_connector_not_in_accessible_orientation_warning"),message:k(),pcb_component_id:k(),source_component_id:k().optional(),pcb_board_id:k().optional(),facing_direction:H4t,recommended_facing_direction:H4t,subcircuit_id:k().optional()}).describe("Warning emitted when a connector PCB component is facing inward toward the board and should be reoriented to an outward-facing direction");Qt(!0);jbt=Ee({type:ce("pcb_component_missing_courtyard_warning"),pcb_component_missing_courtyard_warning_id:Sn("pcb_component_missing_courtyard_warning"),warning_type:ce("pcb_component_missing_courtyard_warning").default("pcb_component_missing_courtyard_warning"),message:k(),pcb_component_id:k(),source_component_id:k().optional(),subcircuit_id:k().optional()}).describe("Warning emitted when a PCB component has no courtyard geometry");Qt(!0);Rfe=Ee({type:ce("supplier_footprint_mismatch_warning"),supplier_footprint_mismatch_warning_id:Sn("supplier_footprint_mismatch_warning"),warning_type:ce("supplier_footprint_mismatch_warning").default("supplier_footprint_mismatch_warning"),message:k(),source_component_id:k(),pcb_component_id:k().optional(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),supplier_name:j7.optional(),supplier_part_number:k().optional(),supplier_footprint_url:k().optional(),footprint_copper_intersection_over_union:ge()}).describe("Warning emitted when a supplier part footprint does not match the expected footprint");Qt(!0);Kbt=Ee({type:ce("pcb_fabricator_extra_charge_warning"),pcb_fabricator_extra_charge_warning_id:Sn("pcb_fabricator_extra_charge_warning"),warning_type:ce("pcb_fabricator_extra_charge_warning").default("pcb_fabricator_extra_charge_warning"),message:k(),fabricator_preset:k(),pcb_board_id:k().optional(),pcb_via_ids:st(k()).optional(),subcircuit_id:k().optional()}).describe("Warning that a design feature incurs an extra charge for the selected fabricator preset, such as via hole diameters below 0.3 mm with JLCPCB economy or standard presets.");Qt(!0);$bt=Ee({type:ce("pcb_breakout_point"),pcb_breakout_point_id:Sn("pcb_breakout_point"),pcb_group_id:k(),subcircuit_id:k().optional(),source_trace_id:k().optional(),source_port_id:k().optional(),source_net_id:k().optional(),layer:Lo.optional(),x:Ke,y:Ke}).describe("Defines a routing target within a pcb_group for a source_trace or source_net");Qt(!0);qbt=Ee({type:ce("pcb_ground_plane"),pcb_ground_plane_id:Sn("pcb_ground_plane"),source_pcb_ground_plane_id:k(),source_net_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional()}).describe("Defines a ground plane on the PCB");Qt(!0);Jbt=Ee({type:ce("pcb_ground_plane_region"),pcb_ground_plane_region_id:Sn("pcb_ground_plane_region"),pcb_ground_plane_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),layer:Lo,points:st(jo)}).describe("Defines a polygon region of a ground plane");Qt(!0);Zbt=Ee({type:ce("pcb_thermal_spoke"),pcb_thermal_spoke_id:Sn("pcb_thermal_spoke"),pcb_ground_plane_id:k(),shape:k(),spoke_count:ge(),spoke_thickness:Ke,spoke_inner_diameter:Ke,spoke_outer_diameter:Ke,pcb_plated_hole_id:k().optional(),subcircuit_id:k().optional()}).describe("Pattern for connecting a ground plane to a plated hole");Qt(!0);Yke=Ee({type:ce("pcb_copper_pour"),pcb_copper_pour_id:Sn("pcb_copper_pour"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),layer:Lo,source_net_id:k().optional(),covered_with_solder_mask:Be().optional().default(!0)}),e6t=Yke.extend({shape:ce("rect"),center:jo,width:ve,height:ve,rotation:ii.optional()});Qt(!0);t6t=Yke.extend({shape:ce("brep"),brep_shape:Vke});Qt(!0);n6t=Yke.extend({shape:ce("polygon"),points:st(jo)});Qt(!0);o6t=ss("shape",[e6t,t6t,n6t]).describe("Defines a copper pour on the PCB.");Qt(!0);r6t=Bc.extend({type:ce("pcb_component_outside_board_error"),pcb_component_outside_board_error_id:Sn("pcb_component_outside_board_error"),error_type:ce("pcb_component_outside_board_error").default("pcb_component_outside_board_error"),pcb_component_id:k(),pcb_board_id:k(),component_center:jo,component_bounds:Ee({min_x:ge(),max_x:ge(),min_y:ge(),max_y:ge()}),subcircuit_id:k().optional(),source_component_id:k().optional()}).describe("Error emitted when a PCB component is placed outside the board boundaries");Qt(!0);i6t=Bc.extend({type:ce("pcb_component_not_on_board_edge_error"),pcb_component_not_on_board_edge_error_id:Sn("pcb_component_not_on_board_edge_error"),error_type:ce("pcb_component_not_on_board_edge_error").default("pcb_component_not_on_board_edge_error"),pcb_component_id:k(),pcb_board_id:k(),component_center:jo,pad_to_nearest_board_edge_distance:ge(),source_component_id:k().optional(),subcircuit_id:k().optional()}).describe("Error emitted when a component that must be placed on the board edge is centered away from the edge");Qt(!0);Aj=Bc.extend({type:ce("pcb_component_invalid_layer_error"),pcb_component_invalid_layer_error_id:Sn("pcb_component_invalid_layer_error"),error_type:ce("pcb_component_invalid_layer_error").default("pcb_component_invalid_layer_error"),pcb_component_id:k().optional(),source_component_id:k(),layer:Lo,subcircuit_id:k().optional()}).describe("Error emitted when a component is placed on an invalid layer (components can only be on 'top' or 'bottom' layers)");Qt(!0);s6t=Bc.extend({type:ce("pcb_via_clearance_error"),pcb_error_id:Sn("pcb_error"),error_type:ce("pcb_via_clearance_error").default("pcb_via_clearance_error"),pcb_via_ids:st(k()).min(2),minimum_clearance:Ke.optional(),actual_clearance:Ke.optional(),pcb_center:Ee({x:ge().optional(),y:ge().optional()}).optional(),subcircuit_id:k().optional()}).describe("Error emitted when vias are closer than the allowed clearance");Qt(!0);a6t=Bc.extend({type:ce("pcb_via_trace_clearance_error"),pcb_via_trace_clearance_error_id:Sn("pcb_via_trace_clearance_error"),error_type:ce("pcb_via_trace_clearance_error").default("pcb_via_trace_clearance_error"),pcb_via_id:k(),pcb_trace_id:k(),minimum_clearance:Ke.optional(),actual_clearance:Ke.optional(),center:Ee({x:ge().optional(),y:ge().optional()}).optional(),subcircuit_id:k().optional()}).describe("Error emitted when a via and trace are closer than the allowed clearance");Qt(!0);c6t=Bc.extend({type:ce("pcb_pad_pad_clearance_error"),pcb_pad_pad_clearance_error_id:Sn("pcb_pad_pad_clearance_error"),error_type:ce("pcb_pad_pad_clearance_error").default("pcb_pad_pad_clearance_error"),pcb_pad_ids:st(k()).min(2),minimum_clearance:Ke.optional(),actual_clearance:Ke.optional(),center:Ee({x:ge().optional(),y:ge().optional()}).optional(),subcircuit_id:k().optional()}).describe("Error emitted when pads are closer than the allowed clearance");Qt(!0);l6t=Bc.extend({type:ce("pcb_pad_trace_clearance_error"),pcb_pad_trace_clearance_error_id:Sn("pcb_pad_trace_clearance_error"),error_type:ce("pcb_pad_trace_clearance_error").default("pcb_pad_trace_clearance_error"),pcb_pad_id:k(),pcb_trace_id:k(),minimum_clearance:Ke.optional(),actual_clearance:Ke.optional(),center:Ee({x:ge().optional(),y:ge().optional()}).optional(),subcircuit_id:k().optional()}).describe("Error emitted when a pad and trace are closer than allowed clearance");Qt(!0);h6t=Ee({type:ce("pcb_courtyard_rect"),pcb_courtyard_rect_id:Sn("pcb_courtyard_rect"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:jo,width:ve,height:ve,layer:jp,ccw_rotation:ii.optional(),color:k().optional()}).describe("Defines a courtyard rectangle on the PCB");Qt(!0);d6t=Ee({type:ce("pcb_courtyard_outline"),pcb_courtyard_outline_id:Sn("pcb_courtyard_outline"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),layer:jp,outline:st(jo).min(2)}).describe("Defines a courtyard outline on the PCB");Qt(!0);u6t=Ee({type:ce("pcb_courtyard_polygon"),pcb_courtyard_polygon_id:Sn("pcb_courtyard_polygon"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),layer:jp,points:st(jo).min(3),color:k().optional()}).describe("Defines a courtyard polygon on the PCB");Qt(!0);p6t=Ee({type:ce("pcb_courtyard_circle"),pcb_courtyard_circle_id:Sn("pcb_courtyard_circle"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:jo,radius:ve,layer:jp,color:k().optional()}).describe("Defines a courtyard circle on the PCB");Qt(!0);m6t=Ee({type:ce("pcb_courtyard_pill"),pcb_courtyard_pill_id:Sn("pcb_courtyard_pill"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:jo,width:ve,height:ve,radius:ve,layer:jp,color:k().optional()}).describe("Defines a courtyard pill on the PCB");Qt(!0);Lvo=["obj","stl","3mf","gltf","glb","step","wrl"],_6t=["x+","x-","y+","y-","z+","z-"],Hvo={obj:"z+",stl:"z+","3mf":"z+",gltf:"y+",glb:"y+",step:"z+",wrl:"y+"},g6t=Ee({type:ce("cad_component"),cad_component_id:k(),pcb_component_id:k().optional().describe("Optional PCB component reference; omit for CAD geometry without a PCB component"),source_component_id:k(),position:i5,rotation:i5.optional(),is_on_folded_board:Be().optional().describe("True when position and rotation describe the assembled folded board pose. False or omitted means the flat board pose. PCB records remain flat; pcb_component_id identifies the flat mount and owning board for reversible transforms."),size:i5.optional(),layer:Lo.optional(),subcircuit_id:k().optional(),footprinter_string:k().optional(),model_obj_url:k().optional(),model_stl_url:k().optional(),model_3mf_url:k().optional(),model_gltf_url:k().optional(),model_glb_url:k().optional(),model_step_url:k().optional(),model_wrl_url:k().optional(),model_asset:Pie.optional(),model_unit_to_mm_scale_factor:ge().optional(),model_board_normal_direction:bt(_6t).optional().describe(`The direction in the model's coordinate space that is considered "up" or "coming out of the board surface"`),model_origin_position:i5.optional(),model_origin_alignment:bt(["unknown","center","center_of_component_on_board_surface","bottom_center_of_component"]).optional(),model_object_fit:bt(["contain_within_bounds","fill_bounds"]).optional().default("contain_within_bounds"),model_jscad:Sd().optional(),color:k().trim().min(1).optional().describe("Explicit color override for CAD geometry, including authored JSCAD material colors. Omit to preserve model materials."),show_as_translucent_model:Be().optional(),show_as_bounding_box:Be().optional(),show_hidden_edges:Be().optional(),anchor_alignment:bt(["center","center_of_component_on_board_surface"]).optional().default("center")}).describe("Defines CAD geometry, optionally associated with a PCB component");Qt(!0);A6t=Bc.extend({type:ce("cad_collision_error"),cad_collision_error_id:Sn("cad_collision_error"),error_type:ce("cad_collision_error").default("cad_collision_error"),cad_component_ids:st(k()).min(1),pcb_component_ids:st(k()).optional(),source_component_ids:st(k()).min(1),intersection_area_mm2:ge().finite().nonnegative(),threshold_area_mm2:ge().finite().nonnegative()}).describe("An aperture-bearing part intersects the finished enclosure. The intersection_area_mm2 is the union silhouette area of the solid intersection projected along the aperture face normal, in the right-handed Circuit JSON world frame (+X right, +Y top, +Z above). It is an area in square millimetres, not intersection volume or surface area. This indicates possible aperture misplacement, insufficient size/depth, or body clearance problems; it does not prove which cause applies.");Qt(!0);F4t=i5.refine((e)=>[e.x,e.y,e.z].every(Number.isFinite),"Connector pin 1 positions must be finite").describe("Resolved pin 1 position at the connector mating face, in right-handed circuit world, millimeters: +X right, +Y top, +Z above. An absolute point, not a direction. Computed by the circuit producer from endpoint geometry. Together with the endpoint path tangent, fixes connector roll and identifies its pin 1 side; renderers must not infer it from footprints."),f6t=Ee({type:ce("cad_cable"),cad_cable_id:k(),name:k().min(1),from_source_component_id:k(),to_source_component_id:k(),from_connector_pin1_position:F4t.optional(),to_connector_pin1_position:F4t.optional(),cableprinter_string:k().min(1).describe('Physical cable definition, e.g. "usb_c" or "jst_ph_pins6". Independent of the route.'),path:st(i5).min(2).refine((e)=>e.every((t,n)=>[t.x,t.y,t.z].every(Number.isFinite)&&(n===0||Math.hypot(t.x-e[n-1].x,t.y-e[n-1].y,t.z-e[n-1].z)>0.00000001)),"Cable paths require finite, distinct consecutive points").describe("Resolved cable centerline points in right-handed circuit world, millimeters: +X right, +Y top, +Z above. First/last samples are connector wire exits; their tangents point into/out of the cable. Includes routing/slack; renderers must not recompute the path.")}).describe("A physical assembly cable with a resolved 3D route. Several cables are independent cad_cable records, each with its own endpoints, definition and path. Does not imply electrical pin mapping.");Qt(!0);z4t=Ee({x:ge().finite(),y:ge().finite(),z:ge().finite()}).refine((e)=>Math.abs(Math.hypot(e.x,e.y,e.z)-1)<=y6t,"Reference surface directions must be unit vectors"),O4t=Ke.pipe(ge().finite().positive()),x6t=Ee({type:ce("cad_reference_surface"),cad_reference_surface_id:k().min(1),source_component_id:k().min(1).describe("Owning assembly part's source component ID. The part may have no CAD geometry."),name:k().trim().min(1).describe("Reference name, unique within the owning part, e.g. shade in STEM.shade."),shape:ce("rect"),center:i5.refine((e)=>[e.x,e.y,e.z].every(Number.isFinite),"Reference surface centers must be finite").describe("Resolved surface center in right-handed circuit-world XYZ, millimeters: +X right, +Y top, +Z above. An absolute point after assembly placement."),normal:z4t.describe("Outward unit normal in circuit-world XYZ. Dimensionless direction; transform with the part's rotation, without translation."),x_axis:z4t.describe("In-plane unit X direction in circuit-world XYZ, perpendicular to normal. The second tangent is normal cross x_axis, giving a right-handed frame."),width:O4t.optional().describe("Rectangular extent along x_axis in millimeters. Supply together with height. Omission leaves the surface's display size unspecified."),height:O4t.optional().describe("Rectangular extent along normal cross x_axis in millimeters. Supply together with width."),subcircuit_id:k().optional()}).superRefine((e,t)=>{if(e.width===void 0!==(e.height===void 0))t.addIssue({code:Gt.custom,path:["width"],message:"Provide width and height together"});let{normal:n,x_axis:o}=e;if(Math.abs(n.x*o.x+n.y*o.y+n.z*o.z)>y6t)t.addIssue({code:Gt.custom,path:["x_axis"],message:"x_axis must be perpendicular to normal"})}).describe("A named assembly mounting surface with a resolved world-space frame. Reference geometry for optional visualization; does not add solid material or electrical connectivity. The producer resolves part placement independently of CAD-model offsets; renderers consume the world frame without reapplying the owning model's transform.");Qt(!0);Gke=bt(["sinewave","square","triangle","sawtooth"]),Fvo=an([k(),ge()]).transform((e)=>{if(typeof e==="string"){if(e.endsWith("%"))return parseFloat(e.slice(0,-1))/100;return parseFloat(e)}return e}).pipe(ge().min(0,"Duty cycle must be non-negative").max(1,"Duty cycle cannot be greater than 100%")),C6t=Ee({type:ce("simulation_voltage_source"),simulation_voltage_source_id:Sn("simulation_voltage_source"),is_dc_source:ce(!0).optional().default(!0),positive_source_port_id:k().optional(),negative_source_port_id:k().optional(),positive_source_net_id:k().optional(),negative_source_net_id:k().optional(),voltage:_h,ac_magnitude:_h.optional(),ac_phase:ii.optional()}).describe("Defines a DC voltage source for simulation"),b6t=Ee({type:ce("simulation_voltage_source"),simulation_voltage_source_id:Sn("simulation_voltage_source"),is_dc_source:ce(!1),terminal1_source_port_id:k().optional(),terminal2_source_port_id:k().optional(),terminal1_source_net_id:k().optional(),terminal2_source_net_id:k().optional(),voltage:_h.optional(),frequency:Xp.optional(),peak_to_peak_voltage:_h.optional(),wave_shape:Gke.optional(),phase:ii.optional(),duty_cycle:Fvo.optional(),pulse_delay:wc.optional(),rise_time:wc.optional(),fall_time:wc.optional(),pulse_width:wc.optional(),period:wc.optional(),ac_magnitude:_h.optional(),ac_phase:ii.optional()}).describe("Defines an AC voltage source for simulation"),I6t=an([C6t,b6t]).describe("Defines a voltage source for simulation");Qt(!0);Qt(!0);Qt(!0);zvo=an([k(),ge()]).transform((e)=>{if(typeof e==="string"){if(e.endsWith("%"))return parseFloat(e.slice(0,-1))/100;return parseFloat(e)}return e}).pipe(ge().min(0,"Duty cycle must be non-negative").max(1,"Duty cycle cannot be greater than 100%")),v6t=Ee({type:ce("simulation_current_source"),simulation_current_source_id:Sn("simulation_current_source"),is_dc_source:ce(!0).optional().default(!0),positive_source_port_id:k().optional(),negative_source_port_id:k().optional(),positive_source_net_id:k().optional(),negative_source_net_id:k().optional(),current:l1,ac_magnitude:l1.optional(),ac_phase:ii.optional()}).describe("Defines a DC current source for simulation"),S6t=Ee({type:ce("simulation_current_source"),simulation_current_source_id:Sn("simulation_current_source"),is_dc_source:ce(!1),terminal1_source_port_id:k().optional(),terminal2_source_port_id:k().optional(),terminal1_source_net_id:k().optional(),terminal2_source_net_id:k().optional(),current:l1.optional(),frequency:Xp.optional(),peak_to_peak_current:l1.optional(),wave_shape:Gke.optional(),phase:ii.optional(),duty_cycle:zvo.optional(),ac_magnitude:l1.optional(),ac_phase:ii.optional()}).describe("Defines an AC current source for simulation"),P6t=an([v6t,S6t]).describe("Defines a current source for simulation");Qt(!0);Qt(!0);Qt(!0);Qfe=cc((e)=>e==="V"||e==="A"),Uke=cc((e)=>e==="Ω"||e==="F"||e==="H"||e==="V"||e==="A"),E6t=an([ce("spice_dc_sweep"),ce("spice_dc_operating_point"),ce("spice_transient_analysis"),ce("spice_ac_analysis"),ce("pcb_return_current")]),M6t=Ee({method:bt(["trap","gear"]).optional(),reltol:an([ge(),k()]).optional(),abstol:an([ge(),k()]).optional(),vntol:an([ge(),k()]).optional()}).describe("SPICE solver options for a simulation experiment"),w6t=Ee({type:ce("simulation_experiment"),simulation_experiment_id:Sn("simulation_experiment"),name:k(),experiment_type:E6t,time_per_step:mj.optional(),start_time_ms:wc.optional(),end_time_ms:wc.optional(),spice_options:M6t.optional(),dc_sweep_voltage_source_id:k().optional(),dc_sweep_current_source_id:k().optional(),dc_sweep_start:ge().optional(),dc_sweep_stop:ge().optional(),dc_sweep_step:ge().refine((e)=>e!==0).optional(),dc_sweep_unit:Qfe.optional(),ac_sweep_type:bt(["linear","decade","octave"]).optional(),ac_samples_per_interval:ge().int().positive().optional(),ac_sample_count:ge().int().positive().optional(),ac_start_frequency_hz:ge().positive().optional(),ac_stop_frequency_hz:ge().positive().optional()}).superRefine((e,t)=>{if(e.experiment_type==="spice_dc_sweep"){let n=["dc_sweep_start","dc_sweep_stop","dc_sweep_step","dc_sweep_unit"];for(let i of n)if(e[i]===void 0)t.addIssue({code:Gt.custom,path:[i],message:`${i} is required for a DC sweep`});let o=e.dc_sweep_voltage_source_id!==void 0,r=e.dc_sweep_current_source_id!==void 0;if(o===r)t.addIssue({code:Gt.custom,path:["dc_sweep_voltage_source_id"],message:"Exactly one DC sweep voltage or current source ID is required"})}if(e.experiment_type==="spice_ac_analysis"){if(e.ac_sweep_type===void 0)t.addIssue({code:Gt.custom,path:["ac_sweep_type"],message:"ac_sweep_type is required for an AC analysis"});if(e.ac_start_frequency_hz===void 0)t.addIssue({code:Gt.custom,path:["ac_start_frequency_hz"],message:"ac_start_frequency_hz is required for an AC analysis"});if(e.ac_stop_frequency_hz===void 0)t.addIssue({code:Gt.custom,path:["ac_stop_frequency_hz"],message:"ac_stop_frequency_hz is required for an AC analysis"});if(e.ac_sweep_type==="linear"&&e.ac_sample_count===void 0)t.addIssue({code:Gt.custom,path:["ac_sample_count"],message:"ac_sample_count is required for a linear AC analysis"});if((e.ac_sweep_type==="decade"||e.ac_sweep_type==="octave")&&e.ac_samples_per_interval===void 0)t.addIssue({code:Gt.custom,path:["ac_samples_per_interval"],message:"ac_samples_per_interval is required for decade and octave AC analyses"})}}).describe("Defines a simulation experiment configuration");Qt(!0);Iw=Ee({simulation_parameter_sweep_id:k(),sweep_index:ge().int().nonnegative(),parameter_value:ge(),parameter_unit:Uke});Qt(!0);B6t=Ee({type:ce("simulation_transient_voltage_graph"),simulation_transient_voltage_graph_id:Sn("simulation_transient_voltage_graph"),simulation_experiment_id:k(),simulation_parameter_sweep_coordinate:Iw.optional(),timestamps_ms:st(ge()).optional(),voltage_levels:st(ge()),source_component_id:k().optional(),subcircuit_connectivity_map_key:k().optional(),time_per_step:mj,start_time_ms:wc,end_time_ms:wc,name:k().optional(),color:k().optional()}).describe("Stores voltage measurements over time for a simulation");Qt(!0);T6t=Ee({type:ce("simulation_transient_current_graph"),simulation_transient_current_graph_id:Sn("simulation_transient_current_graph"),simulation_experiment_id:k(),simulation_parameter_sweep_coordinate:Iw.optional(),timestamps_ms:st(ge()).optional(),current_levels:st(ge()),source_component_id:k().optional(),subcircuit_connectivity_map_key:k().optional(),time_per_step:mj,start_time_ms:wc,end_time_ms:wc,name:k().optional(),color:k().optional()}).describe("Stores current measurements over time for a simulation");Qt(!0);D6t=Ee({type:ce("simulation_switch"),simulation_switch_id:Sn("simulation_switch"),source_component_id:k().optional(),closes_at:wc.optional(),opens_at:wc.optional(),starts_closed:Be().optional(),switching_frequency:Xp.optional()}).describe("Defines a switch for simulation timing control");Qt(!0);N6t=Ee({type:ce("simulation_voltage_probe"),simulation_voltage_probe_id:Sn("simulation_voltage_probe"),source_component_id:k().optional(),name:k().optional(),signal_input_source_port_id:k().optional(),signal_input_source_net_id:k().optional(),reference_input_source_port_id:k().optional(),reference_input_source_net_id:k().optional(),subcircuit_id:k().optional(),color:k().optional()}).describe("Defines a voltage probe for simulation. If a reference input is not provided, it measures against ground. If a reference input is provided, it measures the differential voltage between two points.").superRefine((e,t)=>{if(e.reference_input_source_port_id||e.reference_input_source_net_id){let o=!!e.signal_input_source_port_id||!!e.reference_input_source_port_id,r=!!e.signal_input_source_net_id||!!e.reference_input_source_net_id;if(o&&r)t.addIssue({code:Gt.custom,message:"Cannot mix port and net connections in a differential probe."});else if(o){if(!e.signal_input_source_port_id||!e.reference_input_source_port_id)t.addIssue({code:Gt.custom,message:"Differential port probe requires both signal_input_source_port_id and reference_input_source_port_id."})}else if(r){if(!e.signal_input_source_net_id||!e.reference_input_source_net_id)t.addIssue({code:Gt.custom,message:"Differential net probe requires both signal_input_source_net_id and reference_input_source_net_id."})}}else if(!!e.signal_input_source_port_id===!!e.signal_input_source_net_id)t.addIssue({code:Gt.custom,message:"A voltage probe must have exactly one of signal_input_source_port_id or signal_input_source_net_id."})});Qt(!0);R6t=Ee({type:ce("simulation_current_probe"),simulation_current_probe_id:Sn("simulation_current_probe"),source_component_id:k().optional(),name:k().optional(),positive_source_port_id:k().optional(),negative_source_port_id:k().optional(),positive_source_net_id:k().optional(),negative_source_net_id:k().optional(),subcircuit_id:k().optional(),color:k().optional()}).describe("Defines a current probe for simulation. It measures current flowing from the positive endpoint to the negative endpoint.").superRefine((e,t)=>{let n=!!e.positive_source_port_id,o=!!e.negative_source_port_id,r=!!e.positive_source_net_id,i=!!e.negative_source_net_id,s=n||o,a=r||i;if(s&&a){t.addIssue({code:Gt.custom,message:"Cannot mix port and net connections in a current probe."});return}if(s){if(!n||!o)t.addIssue({code:Gt.custom,message:"Current probe using source ports requires both positive_source_port_id and negative_source_port_id."});return}if(a){if(!r||!i)t.addIssue({code:Gt.custom,message:"Current probe using source nets requires both positive_source_net_id and negative_source_net_id."});return}t.addIssue({code:Gt.custom,message:"A current probe must have either positive/negative source port ids or positive/negative source net ids."})});Qt(!0);Q6t=Bc.extend({type:ce("simulation_unknown_experiment_error"),simulation_unknown_experiment_error_id:Sn("simulation_unknown_experiment_error"),error_type:ce("simulation_unknown_experiment_error").default("simulation_unknown_experiment_error"),simulation_experiment_id:k().optional(),subcircuit_id:k().optional()}).describe("An unknown error occurred during the simulation experiment.");Qt(!0);Ovo=bt(["resistance","capacitance","inductance","voltage","current"]),Iie=Ee({type:ce("simulation_parameter_sweep"),simulation_parameter_sweep_id:Sn("simulation_parameter_sweep"),simulation_experiment_id:k(),name:k().optional(),parameter_values:st(ge()).min(1),parameter_unit:Uke}),k6t=ss("parameter_type",[Iie.extend({parameter_type:ce("resistance"),resistor_source_component_id:k()}),Iie.extend({parameter_type:ce("capacitance"),capacitor_source_component_id:k()}),Iie.extend({parameter_type:ce("inductance"),inductor_source_component_id:k()}),Iie.extend({parameter_type:ce("voltage"),source_net_id:k()}),Iie.extend({parameter_type:ce("current"),current_source_component_id:k()})]).describe("Repeats a simulation experiment over component parameter values");Qt(!0);L6t=Ee({type:ce("simulation_dc_operating_point_voltage"),simulation_dc_operating_point_voltage_id:Sn("simulation_dc_operating_point_voltage"),simulation_experiment_id:k(),simulation_parameter_sweep_coordinate:Iw.optional(),simulation_voltage_probe_id:k(),voltage:ge(),name:k().optional(),color:k().optional()});Qt(!0);H6t=Ee({type:ce("simulation_dc_operating_point_current"),simulation_dc_operating_point_current_id:Sn("simulation_dc_operating_point_current"),simulation_experiment_id:k(),simulation_parameter_sweep_coordinate:Iw.optional(),simulation_current_probe_id:k(),current:ge(),name:k().optional(),color:k().optional()});Qt(!0);F6t=Ee({type:ce("simulation_dc_sweep_voltage_graph"),simulation_dc_sweep_voltage_graph_id:Sn("simulation_dc_sweep_voltage_graph"),simulation_experiment_id:k(),simulation_parameter_sweep_coordinate:Iw.optional(),simulation_voltage_probe_id:k(),sweep_values:st(ge()),sweep_unit:Qfe,voltage_levels:st(ge()),name:k().optional(),color:k().optional()}).refine((e)=>e.sweep_values.length===e.voltage_levels.length,{message:"sweep_values and voltage_levels must have the same length"});Qt(!0);z6t=Ee({type:ce("simulation_dc_sweep_current_graph"),simulation_dc_sweep_current_graph_id:Sn("simulation_dc_sweep_current_graph"),simulation_experiment_id:k(),simulation_parameter_sweep_coordinate:Iw.optional(),simulation_current_probe_id:k(),sweep_values:st(ge()),sweep_unit:Qfe,current_levels:st(ge()),name:k().optional(),color:k().optional()}).refine((e)=>e.sweep_values.length===e.current_levels.length,{message:"sweep_values and current_levels must have the same length"});Qt(!0);Wke=Ee({re:ge(),im:ge()});Qt(!0);O6t=Ee({type:ce("simulation_ac_sweep_voltage_graph"),simulation_ac_sweep_voltage_graph_id:Sn("simulation_ac_sweep_voltage_graph"),simulation_experiment_id:k(),simulation_parameter_sweep_coordinate:Iw.optional(),simulation_voltage_probe_id:k(),frequencies_hz:st(ge()),complex_voltages:st(Wke),name:k().optional(),color:k().optional()}).refine((e)=>e.frequencies_hz.length===e.complex_voltages.length,{message:"frequencies_hz and complex_voltages must have the same length"});Qt(!0);V6t=Ee({type:ce("simulation_ac_sweep_current_graph"),simulation_ac_sweep_current_graph_id:Sn("simulation_ac_sweep_current_graph"),simulation_experiment_id:k(),simulation_parameter_sweep_coordinate:Iw.optional(),simulation_current_probe_id:k(),frequencies_hz:st(ge()),complex_currents:st(Wke),name:k().optional(),color:k().optional()}).refine((e)=>e.frequencies_hz.length===e.complex_currents.length,{message:"frequencies_hz and complex_currents must have the same length"});Qt(!0);Y6t=Ee({type:ce("simulation_op_amp"),simulation_op_amp_id:Sn("simulation_op_amp"),source_component_id:k().optional(),inverting_input_source_port_id:k(),non_inverting_input_source_port_id:k(),output_source_port_id:k(),positive_supply_source_port_id:k(),negative_supply_source_port_id:k()}).describe("Defines a simple ideal operational amplifier for simulation");Qt(!0);G6t=Ee({type:ce("simulation_spice_subcircuit"),simulation_spice_subcircuit_id:Sn("simulation_spice_subcircuit"),source_component_id:k(),spice_pin_to_source_port_map:Ss(k(),k()),subcircuit_source:k()}).describe("Defines a custom SPICE subcircuit model for simulation");Qt(!0);U6t=Ee({type:ce("simulation_oscilloscope_trace"),simulation_oscilloscope_trace_id:Sn("simulation_oscilloscope_trace"),simulation_transient_voltage_graph_id:k().optional(),simulation_transient_current_graph_id:k().optional(),simulation_voltage_probe_id:k().optional(),simulation_current_probe_id:k().optional(),display_name:k().optional(),color:k().optional(),display_center_value:ge().optional(),display_center_offset_divs:ge().optional(),volts_per_div:ge().positive().optional(),amps_per_div:ge().positive().optional()}).describe("Defines how a simulation measurement is rendered as an oscilloscope-style trace.").superRefine((e,t)=>{let n=[e.simulation_transient_voltage_graph_id,e.simulation_voltage_probe_id].filter(V4t).length,o=[e.simulation_transient_current_graph_id,e.simulation_current_probe_id].filter(V4t).length;if(n+o!==1)t.addIssue({code:Gt.custom,message:"An oscilloscope trace must reference exactly one voltage graph, current graph, voltage probe, or current probe."});if(n>0&&e.amps_per_div!==void 0)t.addIssue({code:Gt.custom,message:"Voltage oscilloscope traces must use volts_per_div, not amps_per_div."});if(o>0&&e.volts_per_div!==void 0)t.addIssue({code:Gt.custom,message:"Current oscilloscope traces must use amps_per_div, not volts_per_div."})});Qt(!0);ake=Ee({x:ge().finite(),y:ge().finite(),layer:Lo}),uke=ss("contact_type",[ake.extend({contact_type:ce("pcb_port"),pcb_port_id:k().min(1)}),ake.extend({contact_type:ce("pcb_via"),pcb_via_id:k().min(1)}),ake.extend({contact_type:ce("pcb_copper_pour"),pcb_copper_pour_id:k().min(1)})]).describe("Identifies the reference conductor at a return-current contact");Qt(!0);pke=Ee({signal_pcb_port_id:k().min(1),reference_pcb_port_id:k().min(1).optional(),reference_layer:Lo,resistance:ge().finite().positive()}).describe("A two-terminal return-current excitation port with resistance in ohms");Qt(!0);W6t=Ee({type:ce("simulation_return_current_excitation"),simulation_return_current_excitation_id:Sn("simulation_return_current_excitation"),simulation_experiment_id:k().min(1),pcb_trace_id:k().min(1),ground_source_net_id:k().min(1),current:ge().finite(),return_source:uke,return_sink:uke,source_port:pke.optional(),load_port:pke.optional()}).describe("Excites a signal trace with signed current in amperes, peak for AC; return_source is near the load and return_sink near the driver for positive current");Qt(!0);kfe=Ee({type:ce("simulation_pcb_return_current_result"),simulation_pcb_return_current_result_id:Sn("simulation_pcb_return_current_result"),simulation_experiment_id:k().min(1),pcb_board_id:k().min(1),simulation_return_current_excitation_ids:st(k().min(1)).min(1).refine((e)=>new Set(e).size===e.length,"Excitation IDs must be unique"),frequency_hz:ge().finite().positive().optional()}).describe("A PCB return-current result at one frequency, or a frequency-independent result when frequency_hz is absent");Qt(!0);j6t=X6t(["application/json","application/gzip"]),Lfe=X6t(["image/png","image/webp"]),fj=Ee({type:ce("simulation_pcb_return_current_field"),simulation_pcb_return_current_field_id:Sn("simulation_pcb_return_current_field"),simulation_pcb_return_current_result_id:k().min(1),layer:Lo,source_net_id:k().min(1),field_type:bt(["real","complex_phasor"]),min_x:ge().finite(),min_y:ge().finite(),columns:ge().int().positive().safe(),rows:ge().int().positive().safe(),cell_width:ge().finite().positive(),cell_height:ge().finite().positive(),copper_thickness:ge().finite().positive(),data_format:ce("simulation_return_current_grid_json_v1"),field_asset:j6t}).superRefine((e,t)=>{if(!Number.isSafeInteger(e.columns*e.rows))t.addIssue({code:Gt.custom,path:["columns"],message:"The grid cell count must be a safe integer"})}).describe("A sampled sheet-current field in A/mm, using plain or gzipped JSON Asset URLs; dimensions are PCB millimeters");Qt(!0);hj=st(ge().finite().nullable()).min(1),K6t=ss("field_type",[Ee({field_type:ce("real"),sheet_current_x:hj,sheet_current_y:hj}),Ee({field_type:ce("complex_phasor"),sheet_current_x_real:hj,sheet_current_x_imag:hj,sheet_current_y_real:hj,sheet_current_y_imag:hj})]).superRefine((e,t)=>{let n=e.field_type==="real"?[e.sheet_current_x,e.sheet_current_y]:[e.sheet_current_x_real,e.sheet_current_x_imag,e.sheet_current_y_real,e.sheet_current_y_imag],o=n[0];if(n.some((r)=>r.length!==o.length)){t.addIssue({code:Gt.custom,message:"Current channels must have equal lengths"});return}for(let r=0;r<o.length;r++){let i=o[r]===null;if(n.some((s)=>s[r]===null!==i)){t.addIssue({code:Gt.custom,message:`Cell ${r} must be null in every channel or finite in every channel`});return}}}).describe("Decoded real or complex sheet-current arrays with a shared conductor mask");Qt(!0);Hfe=Ee({type:ce("simulation_pcb_return_current_heatmap"),simulation_pcb_return_current_heatmap_id:Sn("simulation_pcb_return_current_heatmap"),simulation_pcb_return_current_result_id:k().min(1),layer:Lo,source_net_id:k().min(1),min_x:ge().finite(),min_y:ge().finite(),max_x:ge().finite(),max_y:ge().finite(),image_asset:Lfe}).superRefine((e,t)=>{for(let n of["x","y"])if(e[`max_${n}`]<=e[`min_${n}`])t.addIssue({code:Gt.custom,path:[`max_${n}`],message:"Heatmap bounds must have positive width and height"})}).describe("A transparent PNG/WebP current-density overlay in A/mm²; the top-left pixel maps to (min_x, max_y)");Qt(!0);Y4t=Ee({type:ce("simulation_pcb_return_current_marker"),simulation_pcb_return_current_marker_id:Sn("simulation_pcb_return_current_marker"),simulation_pcb_return_current_result_id:k().min(1),role:bt(["signal_source","signal_load","return_source","return_sink","signal_transition","return_transition"]),label:k().optional(),label_x:ge().finite().optional(),label_y:ge().finite().optional()}),Ffe=ss("target_type",[Y4t.extend({target_type:ce("pcb_port"),pcb_port_id:k().min(1),layer:Lo}),Y4t.extend({target_type:ce("pcb_via"),pcb_via_id:k().min(1),from_layer:Lo,to_layer:Lo})]).superRefine((e,t)=>{if(e.label_x===void 0!==(e.label_y===void 0))t.addIssue({code:Gt.custom,path:["label_x"],message:"label_x and label_y must be provided together"});if(e.target_type==="pcb_via"&&e.from_layer===e.to_layer)t.addIssue({code:Gt.custom,path:["to_layer"],message:"A via transition must connect distinct layers"})}).describe("A signal/return port or via highlight; markers do not assert measured via-transfer currents");Qt(!0);zfe=an([H3t,I3t,L3t,C3t,b3t,x3t,S3t,v3t,xke,Ake,bfe,yke,fke,Cke,bke,Ike,Pke,Eke,Mke,Nke,wke,Bke,Tke,Dke,Ske,vke,M3t,w3t,P3t,Rke,Qke,kke,Lke,B3t,k3t,Hke,Eie,Fke,T3t,D3t,N3t,R3t,Q3t,IR,zke,bw,E3t,bCt,PCt,NCt,Ybt,gj,Dfe,Nfe,Xbt,jbt,Rfe,Kbt,RCt,kbt,Lbt,QCt,tbt,zCt,GCt,UCt,WCt,KCt,XCt,jCt,$Ct,vR,LCt,HCt,FCt,nbt,obt,cbt,lbt,Gbt,pbt,mbt,_bt,gbt,Ibt,Abt,fbt,ybt,xbt,bbt,wfe,Bfe,qCt,JCt,hbt,dbt,ubt,ZCt,ebt,s6t,a6t,c6t,l6t,Sbt,vbt,Pbt,Ebt,Mbt,wbt,Bbt,Tbt,Dbt,Ubt,Wbt,Nbt,Rbt,$bt,Vbt,qbt,Jbt,Zbt,o6t,r6t,i6t,Aj,h6t,d6t,u6t,p6t,m6t,F3t,J3t,X3t,j3t,K3t,$3t,U3t,W3t,Z3t,q3t,z3t,tCt,nCt,eCt,sCt,aCt,vfe,cCt,lCt,hCt,ACt,dCt,uCt,pCt,gCt,mCt,_Ct,g6t,f6t,x6t,A6t,I6t,P6t,w6t,W6t,kfe,fj,Hfe,Ffe,B6t,T6t,L6t,H6t,F6t,z6t,O6t,V6t,k6t,D6t,N6t,R6t,U6t,Q6t,Y6t,G6t]),SR=zfe;Qt(!0);Kz(!0)});var Xke=pt(function(q6t){Object.defineProperty(q6t,"__esModule",{value:!0});q6t.applyToPoint=$6t;q6t.applyToPoints=Vvo;function $6t(e,t){return Array.isArray(t)?[e.a*t[0]+e.c*t[1]+e.e,e.b*t[0]+e.d*t[1]+e.f]:{x:e.a*t.x+e.c*t.y+e.e,y:e.b*t.x+e.d*t.y+e.f}}function Vvo(e,t){return t.map((n)=>$6t(e,n))}});var jke=pt(function(J6t){Object.defineProperty(J6t,"__esModule",{value:!0});J6t.fromObject=Uvo;function Uvo(e){return{a:parseFloat(e.a),b:parseFloat(e.b),c:parseFloat(e.c),d:parseFloat(e.d),e:parseFloat(e.e),f:parseFloat(e.f)}}});var eIt=pt(function(Z6t){Object.defineProperty(Z6t,"__esModule",{value:!0});Z6t.fromString=jvo;Z6t.fromStringLegacy=Kvo;var Xvo=/^matrix\(\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*\)$/i;function jvo(e){let t=(s)=>{let a=parseFloat(s);if(Number.isFinite(a))return a;throw Error(`'${e}' is not a matrix`)},n=e.substring(0,7).toLowerCase(),o=e.substring(e.length-1),i=e.substring(7,e.length-1).split(",");if(n==="matrix("&&o===")"&&i.length===6)return{a:t(i[0]),b:t(i[1]),c:t(i[2]),d:t(i[3]),e:t(i[4]),f:t(i[5])};throw Error(`'${e}' is not a matrix`)}function Kvo(e){let t=e.match(Xvo);if(t===null||t.length<7)throw Error(`'${e}' is not a matrix`);return{a:parseFloat(t[1]),b:parseFloat(t[2]),c:parseFloat(t[3]),d:parseFloat(t[4]),e:parseFloat(t[5]),f:parseFloat(t[6])}}});var nIt=pt(function(tIt){Object.defineProperty(tIt,"__esModule",{value:!0});tIt.identity=Jvo;function Jvo(){return{a:1,c:0,e:0,b:0,d:1,f:0}}});var Kke=pt(function(oIt){Object.defineProperty(oIt,"__esModule",{value:!0});oIt.inverse=e8o;function e8o(e){let{a:t,b:n,c:o,d:r,e:i,f:s}=e,a=t*r-n*o;return{a:r/a,b:n/-a,c:o/-a,d:t/a,e:(r*i-o*s)/-a,f:(n*i-t*s)/a}}});var Ofe=pt(function(rIt){Object.defineProperty(rIt,"__esModule",{value:!0});rIt.isNumeric=o8o;rIt.isObject=r8o;rIt.isUndefined=n8o;rIt.matchesShape=i8o;function n8o(e){return typeof e>"u"}function o8o(e){return typeof e==="number"&&!Number.isNaN(e)&&Number.isFinite(e)}function r8o(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function i8o(e,t){return t.every((n)=>(n in e))}});var sIt=pt(function(iIt){Object.defineProperty(iIt,"__esModule",{value:!0});iIt.isAffineMatrix=h8o;var $z=Ofe();function h8o(e){return(0,$z.isObject)(e)&&"a"in e&&(0,$z.isNumeric)(e.a)&&"b"in e&&(0,$z.isNumeric)(e.b)&&"c"in e&&(0,$z.isNumeric)(e.c)&&"d"in e&&(0,$z.isNumeric)(e.d)&&"e"in e&&(0,$z.isNumeric)(e.e)&&"f"in e&&(0,$z.isNumeric)(e.f)}});var yj=pt(function(aIt){Object.defineProperty(aIt,"__esModule",{value:!0});aIt.translate=u8o;function u8o(e,t=0){return{a:1,c:0,e,b:0,d:1,f:t}}});var qz=pt(function(cIt){Object.defineProperty(cIt,"__esModule",{value:!0});cIt.compose=m8o;cIt.transform=$ke;function $ke(...e){e=Array.isArray(e[0])?e[0]:e;let t=(n,o)=>({a:n.a*o.a+n.c*o.b,c:n.a*o.c+n.c*o.d,e:n.a*o.e+n.c*o.f+n.e,b:n.b*o.a+n.d*o.b,d:n.b*o.c+n.d*o.d,f:n.b*o.e+n.d*o.f+n.f});switch(e.length){case 0:throw Error("no matrices provided");case 1:return e[0];case 2:return t(e[0],e[1]);default:{let[n,o,...r]=e,i=t(n,o);return $ke(i,...r)}}}function m8o(...e){return $ke(...e)}});var Vfe=pt(function(uIt){Object.defineProperty(uIt,"__esModule",{value:!0});uIt.rotate=dIt;uIt.rotateDEG=C8o;var lIt=Ofe(),hIt=yj(),A8o=qz(),{cos:f8o,sin:y8o,PI:x8o}=Math;function dIt(e,t,n){let o=f8o(e),r=y8o(e),i={a:o,c:-r,e:0,b:r,d:o,f:0};if((0,lIt.isUndefined)(t)||(0,lIt.isUndefined)(n))return i;return(0,A8o.transform)([(0,hIt.translate)(t,n),i,(0,hIt.translate)(-t,-n)])}function C8o(e,t=void 0,n=void 0){return dIt(e*x8o/180,t,n)}});var wie=pt(function(mIt){Object.defineProperty(mIt,"__esModule",{value:!0});mIt.scale=S8o;var qke=Ofe(),pIt=yj(),v8o=qz();function S8o(e,t=void 0,n=void 0,o=void 0){if((0,qke.isUndefined)(t))t=e;let r={a:e,c:0,e:0,b:0,d:t,f:0};if((0,qke.isUndefined)(n)||(0,qke.isUndefined)(o))return r;return(0,v8o.transform)([(0,pIt.translate)(n,o),r,(0,pIt.translate)(-n,-o)])}});var Jke=pt(function(_It){Object.defineProperty(_It,"__esModule",{value:!0});_It.shear=E8o;function E8o(e,t){return{a:1,c:e,e:0,b:t,d:1,f:0}}});var Zke=pt(function(fIt){Object.defineProperty(fIt,"__esModule",{value:!0});fIt.skew=AIt;fIt.skewDEG=w8o;var{tan:gIt}=Math;function AIt(e,t){return{a:1,c:gIt(e),e:0,b:gIt(t),d:1,f:0}}function w8o(e,t){return AIt(e*Math.PI/180,t*Math.PI/180)}});var xIt=pt(function(yIt){Object.defineProperty(yIt,"__esModule",{value:!0});yIt.toCSS=D8o;yIt.toSVG=N8o;yIt.toString=eLe;function D8o(e){return eLe(e)}function N8o(e){return eLe(e)}function eLe(e){return`matrix(${e.a},${e.b},${e.c},${e.d},${e.e},${e.f})`}});var tLe=pt(function(CIt){Object.defineProperty(CIt,"__esModule",{value:!0});CIt.smoothMatrix=L8o;function L8o(e,t=10000000000){return{a:Math.round(e.a*t)/t,b:Math.round(e.b*t)/t,c:Math.round(e.c*t)/t,d:Math.round(e.d*t)/t,e:Math.round(e.e*t)/t,f:Math.round(e.f*t)/t}}});var IIt=pt(function(bIt){Object.defineProperty(bIt,"__esModule",{value:!0});bIt.fromTriangles=V8o;var F8o=Kke(),z8o=qz(),O8o=tLe();function V8o(e,t){let n=e[0].x!=null?e[0].x:e[0][0],o=e[0].y!=null?e[0].y:e[0][1],r=t[0].x!=null?t[0].x:t[0][0],i=t[0].y!=null?t[0].y:t[0][1],s=e[1].x!=null?e[1].x:e[1][0],a=e[1].y!=null?e[1].y:e[1][1],c=t[1].x!=null?t[1].x:t[1][0],l=t[1].y!=null?t[1].y:t[1][1],h=e[2].x!=null?e[2].x:e[2][0],d=e[2].y!=null?e[2].y:e[2][1],u=t[2].x!=null?t[2].x:t[2][0],_=t[2].y!=null?t[2].y:t[2][1],p={a:n-h,b:o-d,c:s-h,d:a-d,e:h,f:d},m={a:r-u,b:i-_,c:c-u,d:l-_,e:u,f:_},A=(0,F8o.inverse)(p),g=(0,z8o.transform)([m,A]);return(0,O8o.smoothMatrix)(g)}});var wIt=pt(function(MIt){Object.defineProperty(MIt,"__esModule",{value:!0});MIt.fromDefinition=W8o;var G8o=jke(),vIt=yj(),SIt=wie(),PIt=Vfe(),EIt=Zke(),U8o=Jke();function W8o(e){return Array.isArray(e)?e.map(t):t(e);function t(n){switch(n.type){case"matrix":if("a"in n&&"b"in n&&"c"in n&&"d"in n&&"e"in n&&"f"in n)return(0,G8o.fromObject)(n);else throw Error("MISSING_MANDATORY_PARAM");case"translate":if(!("tx"in n))throw Error("MISSING_MANDATORY_PARAM");if("ty"in n)return(0,vIt.translate)(n.tx,n.ty);return(0,vIt.translate)(n.tx);case"scale":if(!("sx"in n))throw Error("MISSING_MANDATORY_PARAM");if("sy"in n)return(0,SIt.scale)(n.sx,n.sy);return(0,SIt.scale)(n.sx);case"rotate":if(!("angle"in n))throw Error("MISSING_MANDATORY_PARAM");if("cx"in n&&"cy"in n)return(0,PIt.rotateDEG)(n.angle,n.cx,n.cy);return(0,PIt.rotateDEG)(n.angle);case"skewX":if(!("angle"in n))throw Error("MISSING_MANDATORY_PARAM");return(0,EIt.skewDEG)(n.angle,0);case"skewY":if(!("angle"in n))throw Error("MISSING_MANDATORY_PARAM");return(0,EIt.skewDEG)(0,n.angle);case"shear":if(!(("shx"in n)&&("shy"in n)))throw Error("MISSING_MANDATORY_PARAM");return(0,U8o.shear)(n.shx,n.shy);default:throw Error("UNSUPPORTED_DESCRIPTOR")}}}});var DIt=pt(function(BIt){Object.defineProperty(BIt,"__esModule",{value:!0});BIt.SyntaxError=BIt.StartRules=void 0;BIt.parse=j8o;class Bie extends SyntaxError{constructor(e,t,n,o){super(e);this.expected=t,this.found=n,this.location=o,this.name="SyntaxError"}format(e){let t="Error: "+this.message;if(this.location){let n=null,o=e.find((a)=>a.source===this.location.source);if(o)n=o.text.split(/\r\n|\n|\r/g);let r=this.location.start,i=this.location.source&&typeof this.location.source.offset==="function"?this.location.source.offset(r):r,s=this.location.source+":"+i.line+":"+i.column;if(n){let a=this.location.end,c="".padEnd(i.line.toString().length," "),l=n[r.line-1],d=(r.line===a.line?a.column:l.length+1)-r.column||1;t+=`
 --> `+s+`
`+c+` |
`+i.line+" | "+l+`
`+c+" | "+"".padEnd(r.column-1," ")+"".padEnd(d,"^")}else t+=`
 at `+s}return t}static buildMessage(e,t){function n(d){return d.codePointAt(0).toString(16).toUpperCase()}let o=Object.prototype.hasOwnProperty.call(RegExp.prototype,"unicode")?new RegExp("[\\p{C}\\p{Mn}\\p{Mc}]","gu"):null;function r(d){if(o)return d.replace(o,(u)=>"\\u{"+n(u)+"}");return d}function i(d){return r(d.replace(/\\/g,"\\\\").replace(/"/g,"\\\"").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(u)=>"\\x0"+n(u)).replace(/[\x10-\x1F\x7F-\x9F]/g,(u)=>"\\x"+n(u)))}function s(d){return r(d.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(u)=>"\\x0"+n(u)).replace(/[\x10-\x1F\x7F-\x9F]/g,(u)=>"\\x"+n(u)))}let a={literal(d){return'"'+i(d.text)+'"'},class(d){let u=d.parts.map((_)=>Array.isArray(_)?s(_[0])+"-"+s(_[1]):s(_));return"["+(d.inverted?"^":"")+u.join("")+"]"+(d.unicode?"u":"")},any(){return"any character"},end(){return"end of input"},other(d){return d.description}};function c(d){return a[d.type](d)}function l(d){let u=d.map(c);if(u.sort(),u.length>0){let _=1;for(let p=1;p<u.length;p++)if(u[p-1]!==u[p])u[_]=u[p],_++;u.length=_}switch(u.length){case 1:return u[0];case 2:return u[0]+" or "+u[1];default:return u.slice(0,-1).join(", ")+", or "+u[u.length-1]}}function h(d){return d?'"'+i(d)+'"':"end of input"}return"Expected "+l(e)+" but "+h(t)+" found."}}BIt.SyntaxError=Bie;function j8o(e,t){t=t!==void 0?t:{};let n={},o=t.grammarSource,r={transformList:$e},i=$e,s="matrix",a="(",c=")",l="translate",h="scale",d="rotate",u="skewX",_="skewY",p=",",m=".",A=/^[eE]/,g=/^[+\-]/,f=/^[0-9]/,y=/^[ \t\r\n]/,x=Ct("matrix",!1),C=Ct("(",!1),b=Ct(")",!1),I=Ct("translate",!1),v=Ct("scale",!1),P=Ct("rotate",!1),M=Ct("skewX",!1),B=Ct("skewY",!1),T=Ct(",",!1),N=et("fractionalConstant"),D=Ct(".",!1),L=Nt(["e","E"],!1,!1,!1),H=Nt(["+","-"],!1,!1,!1),V=Nt([["0","9"]],!1,!1,!1),O=Nt([" ","\t","\r",`
`],!1,!1,!1);function U(je){return je}function j(je,Mt){return je.concat(Mt)}function Y(je,Mt,Kt,nn,Zn,Vn){return[{type:"matrix",a:je,b:Mt,c:Kt,d:nn,e:Zn,f:Vn}]}function X(je,Mt){var Kt={type:"translate",tx:je};if(Mt)Kt.ty=Mt;return[Kt]}function K(je,Mt){var Kt={type:"scale",sx:je};if(Mt)Kt.sy=Mt;return[Kt]}function J(je,Mt){var Kt={type:"rotate",angle:je};if(Mt)Kt.cx=Mt[0],Kt.cy=Mt[1];return[Kt]}function ee(je){return[{type:"skewX",angle:je}]}function se(je){return[{type:"skewY",angle:je}]}function ne(je){return parseFloat(je.join(""))}function re(je){return parseInt(je.join(""))}function Z(je){return je}function te(je,Mt){return[je,Mt]}function ie(je){return je.join("")}function le(je,Mt){return[je,Mt||null].join("")}function ue(je,Mt){return[je,Mt].join("")}function de(je,Mt){return[je?je.join(""):null,".",Mt.join("")].join("")}function me(je){return je.join("")}function Ae(je,Mt){return["e",je,Mt.join("")].join("")}let xe=t.peg$currPos|0,Me=xe,Re=[{line:1,column:1}],we=xe,_e=t.peg$maxFailExpected||[],ye=t.peg$silentFails|0,Se;if(t.startRule){if(!(t.startRule in r))throw Error(`Can't start parsing from rule "`+t.startRule+'".');i=r[t.startRule]}function Ne(){return e.substring(Me,xe)}function ke(){return Me}function nt(){return{source:o,start:Me,end:xe}}function dt(){return ht(Me,xe)}function rt(je,Mt){throw Mt=Mt!==void 0?Mt:ht(Me,xe),Ze([et(je)],e.substring(Me,xe),Mt)}function mt(je,Mt){throw Mt=Mt!==void 0?Mt:ht(Me,xe),Le(je,Mt)}function lt(je=xe){let Mt=e.codePointAt(je);if(Mt===void 0)return"";return String.fromCodePoint(Mt)}function Ct(je,Mt){return{type:"literal",text:je,ignoreCase:Mt}}function Nt(je,Mt,Kt,nn){return{type:"class",parts:je,inverted:Mt,ignoreCase:Kt,unicode:nn}}function Ht(){return{type:"any"}}function Tt(){return{type:"end"}}function et(je){return{type:"other",description:je}}function vt(je){let Mt=Re[je],Kt;if(Mt)return Mt;else{if(je>=Re.length)Kt=Re.length-1;else{Kt=je;while(!Re[--Kt]);}Mt=Re[Kt],Mt={line:Mt.line,column:Mt.column};while(Kt<je){if(e.charCodeAt(Kt)===10)Mt.line++,Mt.column=1;else Mt.column++;Kt++}return Re[je]=Mt,Mt}}function ht(je,Mt,Kt){let nn=vt(je),Zn=vt(Mt),Vn={source:o,start:{offset:je,line:nn.line,column:nn.column},end:{offset:Mt,line:Zn.line,column:Zn.column}};if(Kt&&o&&typeof o.offset==="function")Vn.start=o.offset(Vn.start),Vn.end=o.offset(Vn.end);return Vn}function We(je){if(xe<we)return;if(xe>we)we=xe,_e=[];_e.push(je)}function Le(je,Mt){return new Bie(je,null,null,Mt)}function Ze(je,Mt,Kt){return new Bie(Bie.buildMessage(je,Mt),je,Mt,Kt)}function $e(){let je,Mt,Kt,nn,Zn;je=xe,Mt=[],Kt=gt();while(Kt!==n)Mt.push(Kt),Kt=gt();if(Kt=qe(),Kt===n)Kt=null;nn=[],Zn=gt();while(Zn!==n)nn.push(Zn),Zn=gt();return Me=je,je=U(Kt),je}function qe(){let je,Mt,Kt,nn;if(je=xe,Mt=ft(),Mt!==n){if(Kt=[],nn=pn(),nn!==n)while(nn!==n)Kt.push(nn),nn=pn();else Kt=n;if(Kt!==n)if(nn=qe(),nn!==n)Me=je,je=j(Mt,nn);else xe=je,je=n;else xe=je,je=n}else xe=je,je=n;if(je===n)je=ft();return je}function ft(){let je;if(je=It(),je===n){if(je=ze(),je===n){if(je=Xe(),je===n){if(je=it(),je===n){if(je=St(),je===n)je=kt()}}}}return je}function It(){let je,Mt,Kt,nn,Zn,Vn,Rn,Bn,ho,Qo,Nn,mo,Io,io,Wo,rr,xr,Ci;if(je=xe,e.substr(xe,6)===s)Mt=s,xe+=6;else if(Mt=n,ye===0)We(x);if(Mt!==n){Kt=[],nn=gt();while(nn!==n)Kt.push(nn),nn=gt();if(e.charCodeAt(xe)===40)nn=a,xe++;else if(nn=n,ye===0)We(C);if(nn!==n){Zn=[],Vn=gt();while(Vn!==n)Zn.push(Vn),Vn=gt();if(Vn=Lt(),Vn!==n)if(Rn=pn(),Rn!==n)if(Bn=Lt(),Bn!==n)if(ho=pn(),ho!==n)if(Qo=Lt(),Qo!==n)if(Nn=pn(),Nn!==n)if(mo=Lt(),mo!==n)if(Io=pn(),Io!==n)if(io=Lt(),io!==n)if(Wo=pn(),Wo!==n)if(rr=Lt(),rr!==n){xr=[],Ci=gt();while(Ci!==n)xr.push(Ci),Ci=gt();if(e.charCodeAt(xe)===41)Ci=c,xe++;else if(Ci=n,ye===0)We(b);if(Ci!==n)Me=je,je=Y(Vn,Bn,Qo,mo,io,rr);else xe=je,je=n}else xe=je,je=n;else xe=je,je=n;else xe=je,je=n;else xe=je,je=n;else xe=je,je=n;else xe=je,je=n;else xe=je,je=n;else xe=je,je=n;else xe=je,je=n;else xe=je,je=n;else xe=je,je=n}else xe=je,je=n}else xe=je,je=n;return je}function ze(){let je,Mt,Kt,nn,Zn,Vn,Rn,Bn,ho;if(je=xe,e.substr(xe,9)===l)Mt=l,xe+=9;else if(Mt=n,ye===0)We(I);if(Mt!==n){Kt=[],nn=gt();while(nn!==n)Kt.push(nn),nn=gt();if(e.charCodeAt(xe)===40)nn=a,xe++;else if(nn=n,ye===0)We(C);if(nn!==n){Zn=[],Vn=gt();while(Vn!==n)Zn.push(Vn),Vn=gt();if(Vn=Lt(),Vn!==n){if(Rn=Wt(),Rn===n)Rn=null;Bn=[],ho=gt();while(ho!==n)Bn.push(ho),ho=gt();if(e.charCodeAt(xe)===41)ho=c,xe++;else if(ho=n,ye===0)We(b);if(ho!==n)Me=je,je=X(Vn,Rn);else xe=je,je=n}else xe=je,je=n}else xe=je,je=n}else xe=je,je=n;return je}function Xe(){let je,Mt,Kt,nn,Zn,Vn,Rn,Bn,ho;if(je=xe,e.substr(xe,5)===h)Mt=h,xe+=5;else if(Mt=n,ye===0)We(v);if(Mt!==n){Kt=[],nn=gt();while(nn!==n)Kt.push(nn),nn=gt();if(e.charCodeAt(xe)===40)nn=a,xe++;else if(nn=n,ye===0)We(C);if(nn!==n){Zn=[],Vn=gt();while(Vn!==n)Zn.push(Vn),Vn=gt();if(Vn=Lt(),Vn!==n){if(Rn=Wt(),Rn===n)Rn=null;Bn=[],ho=gt();while(ho!==n)Bn.push(ho),ho=gt();if(e.charCodeAt(xe)===41)ho=c,xe++;else if(ho=n,ye===0)We(b);if(ho!==n)Me=je,je=K(Vn,Rn);else xe=je,je=n}else xe=je,je=n}else xe=je,je=n}else xe=je,je=n;return je}function it(){let je,Mt,Kt,nn,Zn,Vn,Rn,Bn,ho;if(je=xe,e.substr(xe,6)===d)Mt=d,xe+=6;else if(Mt=n,ye===0)We(P);if(Mt!==n){Kt=[],nn=gt();while(nn!==n)Kt.push(nn),nn=gt();if(e.charCodeAt(xe)===40)nn=a,xe++;else if(nn=n,ye===0)We(C);if(nn!==n){Zn=[],Vn=gt();while(Vn!==n)Zn.push(Vn),Vn=gt();if(Vn=Lt(),Vn!==n){if(Rn=bn(),Rn===n)Rn=null;Bn=[],ho=gt();while(ho!==n)Bn.push(ho),ho=gt();if(e.charCodeAt(xe)===41)ho=c,xe++;else if(ho=n,ye===0)We(b);if(ho!==n)Me=je,je=J(Vn,Rn);else xe=je,je=n}else xe=je,je=n}else xe=je,je=n}else xe=je,je=n;return je}function St(){let je,Mt,Kt,nn,Zn,Vn,Rn,Bn;if(je=xe,e.substr(xe,5)===u)Mt=u,xe+=5;else if(Mt=n,ye===0)We(M);if(Mt!==n){Kt=[],nn=gt();while(nn!==n)Kt.push(nn),nn=gt();if(e.charCodeAt(xe)===40)nn=a,xe++;else if(nn=n,ye===0)We(C);if(nn!==n){Zn=[],Vn=gt();while(Vn!==n)Zn.push(Vn),Vn=gt();if(Vn=Lt(),Vn!==n){Rn=[],Bn=gt();while(Bn!==n)Rn.push(Bn),Bn=gt();if(e.charCodeAt(xe)===41)Bn=c,xe++;else if(Bn=n,ye===0)We(b);if(Bn!==n)Me=je,je=ee(Vn);else xe=je,je=n}else xe=je,je=n}else xe=je,je=n}else xe=je,je=n;return je}function kt(){let je,Mt,Kt,nn,Zn,Vn,Rn,Bn;if(je=xe,e.substr(xe,5)===_)Mt=_,xe+=5;else if(Mt=n,ye===0)We(B);if(Mt!==n){Kt=[],nn=gt();while(nn!==n)Kt.push(nn),nn=gt();if(e.charCodeAt(xe)===40)nn=a,xe++;else if(nn=n,ye===0)We(C);if(nn!==n){Zn=[],Vn=gt();while(Vn!==n)Zn.push(Vn),Vn=gt();if(Vn=Lt(),Vn!==n){Rn=[],Bn=gt();while(Bn!==n)Rn.push(Bn),Bn=gt();if(e.charCodeAt(xe)===41)Bn=c,xe++;else if(Bn=n,ye===0)We(b);if(Bn!==n)Me=je,je=se(Vn);else xe=je,je=n}else xe=je,je=n}else xe=je,je=n}else xe=je,je=n;return je}function Lt(){let je,Mt,Kt,nn;if(je=xe,Mt=xe,Kt=To(),Kt===n)Kt=null;if(nn=mn(),nn!==n)Kt=[Kt,nn],Mt=Kt;else xe=Mt,Mt=n;if(Mt!==n)Me=je,Mt=ne(Mt);if(je=Mt,je===n){if(je=xe,Mt=xe,Kt=To(),Kt===n)Kt=null;if(nn=Fn(),nn!==n)Kt=[Kt,nn],Mt=Kt;else xe=Mt,Mt=n;if(Mt!==n)Me=je,Mt=re(Mt);je=Mt}return je}function Wt(){let je,Mt,Kt;if(je=xe,Mt=pn(),Mt!==n)if(Kt=Lt(),Kt!==n)Me=je,je=Z(Kt);else xe=je,je=n;else xe=je,je=n;return je}function bn(){let je,Mt,Kt,nn,Zn;if(je=xe,Mt=pn(),Mt!==n)if(Kt=Lt(),Kt!==n)if(nn=pn(),nn!==n)if(Zn=Lt(),Zn!==n)Me=je,je=te(Kt,Zn);else xe=je,je=n;else xe=je,je=n;else xe=je,je=n;else xe=je,je=n;return je}function pn(){let je,Mt,Kt,nn,Zn;if(je=xe,Mt=[],Kt=gt(),Kt!==n)while(Kt!==n)Mt.push(Kt),Kt=gt();else Mt=n;if(Mt!==n){if(Kt=wn(),Kt===n)Kt=null;nn=[],Zn=gt();while(Zn!==n)nn.push(Zn),Zn=gt();Mt=[Mt,Kt,nn],je=Mt}else xe=je,je=n;if(je===n)if(je=xe,Mt=wn(),Mt!==n){Kt=[],nn=gt();while(nn!==n)Kt.push(nn),nn=gt();Mt=[Mt,Kt],je=Mt}else xe=je,je=n;return je}function wn(){let je;if(e.charCodeAt(xe)===44)je=p,xe++;else if(je=n,ye===0)We(T);return je}function Fn(){let je,Mt;if(je=xe,Mt=ir(),Mt!==n)Me=je,Mt=ie(Mt);return je=Mt,je}function mn(){let je,Mt,Kt;if(je=xe,Mt=_n(),Mt!==n){if(Kt=no(),Kt===n)Kt=null;Me=je,je=le(Mt,Kt)}else xe=je,je=n;if(je===n)if(je=xe,Mt=ir(),Mt!==n)if(Kt=no(),Kt!==n)Me=je,je=ue(Mt,Kt);else xe=je,je=n;else xe=je,je=n;return je}function _n(){let je,Mt,Kt,nn;if(ye++,je=xe,Mt=ir(),Mt===n)Mt=null;if(e.charCodeAt(xe)===46)Kt=m,xe++;else if(Kt=n,ye===0)We(D);if(Kt!==n)if(nn=ir(),nn!==n)Me=je,je=de(Mt,nn);else xe=je,je=n;else xe=je,je=n;if(je===n)if(je=xe,Mt=ir(),Mt!==n){if(e.charCodeAt(xe)===46)Kt=m,xe++;else if(Kt=n,ye===0)We(D);if(Kt!==n)Me=je,je=me(Mt);else xe=je,je=n}else xe=je,je=n;if(ye--,je===n){if(Mt=n,ye===0)We(N)}return je}function no(){let je,Mt,Kt,nn;if(je=xe,Mt=e.charAt(xe),A.test(Mt))xe++;else if(Mt=n,ye===0)We(L);if(Mt!==n){if(Kt=To(),Kt===n)Kt=null;if(nn=ir(),nn!==n)Me=je,je=Ae(Kt,nn);else xe=je,je=n}else xe=je,je=n;return je}function To(){let je;if(je=e.charAt(xe),g.test(je))xe++;else if(je=n,ye===0)We(H);return je}function ir(){let je,Mt;if(je=[],Mt=xt(),Mt!==n)while(Mt!==n)je.push(Mt),Mt=xt();else je=n;return je}function xt(){let je;if(je=e.charAt(xe),f.test(je))xe++;else if(je=n,ye===0)We(V);return je}function gt(){let je;if(je=e.charAt(xe),y.test(je))xe++;else if(je=n,ye===0)We(O);return je}Se=i();let Ot=Se!==n&&xe===e.length;function Zt(){if(Se!==n&&xe<e.length)We(Tt());throw Ze(_e,we<e.length?lt(we):null,we<e.length?ht(we,we+1):ht(we,we))}if(t.peg$library)return{peg$result:Se,peg$currPos:xe,peg$FAILED:n,peg$maxFailExpected:_e,peg$maxFailPos:we,peg$success:Ot,peg$throw:Ot?void 0:Zt};if(Ot)return Se;else Zt()}var Lxs=BIt.StartRules=["transformList"]});var RIt=pt(function(NIt){Object.defineProperty(NIt,"__esModule",{value:!0});NIt.fromTransformAttribute=J8o;var q8o=DIt();function J8o(e){return(0,q8o.parse)(e)}});var kIt=pt(function(QIt){Object.defineProperty(QIt,"__esModule",{value:!0});QIt.decomposeTSR=e7o;var nLe=wie(),oLe=qz();function e7o(e,t=!1,n=!1){if(t)if(n)e=(0,oLe.compose)(e,(0,nLe.scale)(-1,-1));else e=(0,oLe.compose)(e,(0,nLe.scale)(1,-1));else if(n)e=(0,oLe.compose)(e,(0,nLe.scale)(-1,1));let o=e.a,r=e.b,i=e.c,s=e.d,a,c,l;if(o!==0||i!==0){let h=Math.hypot(o,i);a=h,c=(o*s-r*i)/h;let d=Math.acos(o/h);l=i>0?-d:d}else if(r!==0||s!==0){let h=Math.hypot(r,s);a=(o*s-r*i)/h,c=h;let d=Math.acos(r/h);l=Math.PI/2+(s>0?-d:d)}else a=0,c=0,l=0;if(n)a=-a;if(t)c=-c;return{translate:{tx:e.e,ty:e.f},scale:{sx:a,sy:c},rotation:{angle:l}}}});var HIt=pt(function(LIt){Object.defineProperty(LIt,"__esModule",{value:!0});LIt.flipOrigin=r7o;LIt.flipX=n7o;LIt.flipY=o7o;function n7o(){return{a:1,c:0,e:0,b:0,d:-1,f:0}}function o7o(){return{a:-1,c:0,e:0,b:0,d:1,f:0}}function r7o(){return{a:-1,c:0,e:0,b:0,d:-1,f:0}}});var OIt=pt(function(zIt){Object.defineProperty(zIt,"__esModule",{value:!0});zIt.fromOneMovingPoint=FIt;zIt.fromTwoMovingPoints=p7o;var c7o=yj(),l7o=Xke(),h7o=Vfe(),d7o=wie(),u7o=qz();function FIt(e,t){let n=t.x-e.x,o=t.y-e.y;return(0,c7o.translate)(n,o)}function p7o(e,t,n,o){let r=FIt(e,n),i=(0,l7o.applyToPoint)(r,t),s=n,a=o,c=Math.atan2(a.y-s.y,a.x-s.x)-Math.atan2(i.y-s.y,i.x-s.x),l=(0,h7o.rotate)(c,s.x,s.y),h=Math.sqrt(Math.pow(i.x-s.x,2)+Math.pow(i.y-s.y,2)),u=Math.sqrt(Math.pow(a.x-s.x,2)+Math.pow(a.y-s.y,2))/h,_=(0,d7o.scale)(u,u,s.x,s.y);return(0,u7o.compose)([r,_,l])}});var As=pt(function(gi){Object.defineProperty(gi,"__esModule",{value:!0});var rLe=Xke();Object.keys(rLe).forEach(function(e){if(e==="default"||e==="__esModule")return;if(e in gi&&gi[e]===rLe[e])return;Object.defineProperty(gi,e,{enumerable:!0,get:function(){return rLe[e]}})});var iLe=jke();Object.keys(iLe).forEach(function(e){if(e==="default"||e==="__esModule")return;if(e in gi&&gi[e]===iLe[e])return;Object.defineProperty(gi,e,{enumerable:!0,get:function(){return iLe[e]}})});var sLe=eIt();Object.keys(sLe).forEach(function(e){if(e==="default"||e==="__esModule")return;if(e in gi&&gi[e]===sLe[e])return;Object.defineProperty(gi,e,{enumerable:!0,get:function(){return sLe[e]}})});var aLe=nIt();Object.keys(aLe).forEach(function(e){if(e==="default"||e==="__esModule")return;if(e in gi&&gi[e]===aLe[e])return;Object.defineProperty(gi,e,{enumerable:!0,get:function(){return aLe[e]}})});var cLe=Kke();Object.keys(cLe).forEach(function(e){if(e==="default"||e==="__esModule")return;if(e in gi&&gi[e]===cLe[e])return;Object.defineProperty(gi,e,{enumerable:!0,get:function(){return cLe[e]}})});var lLe=sIt();Object.keys(lLe).forEach(function(e){if(e==="default"||e==="__esModule")return;if(e in gi&&gi[e]===lLe[e])return;Object.defineProperty(gi,e,{enumerable:!0,get:function(){return lLe[e]}})});var hLe=Vfe();Object.keys(hLe).forEach(function(e){if(e==="default"||e==="__esModule")return;if(e in gi&&gi[e]===hLe[e])return;Object.defineProperty(gi,e,{enumerable:!0,get:function(){return hLe[e]}})});var dLe=wie();Object.keys(dLe).forEach(function(e){if(e==="default"||e==="__esModule")return;if(e in gi&&gi[e]===dLe[e])return;Object.defineProperty(gi,e,{enumerable:!0,get:function(){return dLe[e]}})});var uLe=Jke();Object.keys(uLe).forEach(function(e){if(e==="default"||e==="__esModule")return;if(e in gi&&gi[e]===uLe[e])return;Object.defineProperty(gi,e,{enumerable:!0,get:function(){return uLe[e]}})});var pLe=Zke();Object.keys(pLe).forEach(function(e){if(e==="default"||e==="__esModule")return;if(e in gi&&gi[e]===pLe[e])return;Object.defineProperty(gi,e,{enumerable:!0,get:function(){return pLe[e]}})});var mLe=xIt();Object.keys(mLe).forEach(function(e){if(e==="default"||e==="__esModule")return;if(e in gi&&gi[e]===mLe[e])return;Object.defineProperty(gi,e,{enumerable:!0,get:function(){return mLe[e]}})});var _Le=qz();Object.keys(_Le).forEach(function(e){if(e==="default"||e==="__esModule")return;if(e in gi&&gi[e]===_Le[e])return;Object.defineProperty(gi,e,{enumerable:!0,get:function(){return _Le[e]}})});var gLe=yj();Object.keys(gLe).forEach(function(e){if(e==="default"||e==="__esModule")return;if(e in gi&&gi[e]===gLe[e])return;Object.defineProperty(gi,e,{enumerable:!0,get:function(){return gLe[e]}})});var ALe=IIt();Object.keys(ALe).forEach(function(e){if(e==="default"||e==="__esModule")return;if(e in gi&&gi[e]===ALe[e])return;Object.defineProperty(gi,e,{enumerable:!0,get:function(){return ALe[e]}})});var fLe=tLe();Object.keys(fLe).forEach(function(e){if(e==="default"||e==="__esModule")return;if(e in gi&&gi[e]===fLe[e])return;Object.defineProperty(gi,e,{enumerable:!0,get:function(){return fLe[e]}})});var yLe=wIt();Object.keys(yLe).forEach(function(e){if(e==="default"||e==="__esModule")return;if(e in gi&&gi[e]===yLe[e])return;Object.defineProperty(gi,e,{enumerable:!0,get:function(){return yLe[e]}})});var xLe=RIt();Object.keys(xLe).forEach(function(e){if(e==="default"||e==="__esModule")return;if(e in gi&&gi[e]===xLe[e])return;Object.defineProperty(gi,e,{enumerable:!0,get:function(){return xLe[e]}})});var CLe=kIt();Object.keys(CLe).forEach(function(e){if(e==="default"||e==="__esModule")return;if(e in gi&&gi[e]===CLe[e])return;Object.defineProperty(gi,e,{enumerable:!0,get:function(){return CLe[e]}})});var bLe=HIt();Object.keys(bLe).forEach(function(e){if(e==="default"||e==="__esModule")return;if(e in gi&&gi[e]===bLe[e])return;Object.defineProperty(gi,e,{enumerable:!0,get:function(){return bLe[e]}})});var ILe=OIt();Object.keys(ILe).forEach(function(e){if(e==="default"||e==="__esModule")return;if(e in gi&&gi[e]===ILe[e])return;Object.defineProperty(gi,e,{enumerable:!0,get:function(){return ILe[e]}})})});var Yfe=()=>{};function t9t(e){q7=e}function n9t(){return q7}function ELe(e){return e<q7&&e>-q7}function Zz(e,t){return e-t<q7&&e-t>-q7}function o9t(e,t){return e-t>q7}function f7o(e,t){return e-t>-q7}function r9t(e,t){return e-t<-q7}function y7o(e,t){return e-t<q7}class wu{static get ILLEGAL_PARAMETERS(){return ReferenceError("Illegal Parameters")}static get ZERO_DIVISION(){return Error("Zero division")}static get UNRESOLVED_BOUNDARY_CONFLICT(){return Error("Unresolved boundary conflict in boolean operation")}static get INFINITE_LOOP(){return Error("Infinite loop")}static get CANNOT_COMPLETE_BOOLEAN_OPERATION(){return Error("Cannot complete boolean operation")}static get CANNOT_INVOKE_ABSTRACT_METHOD(){return Error("Abstract method cannot be invoked")}static get OPERATION_IS_NOT_SUPPORTED(){return Error("Operation is not supported")}static get UNSUPPORTED_SHAPE_TYPE(){return Error("Unsupported shape type")}}class i9t{constructor(e=VIt){for(let t in e)this[t]=e[t];this.stroke=e.stroke??VIt.stroke}toAttributesString(){return Object.keys(this).reduce((e,t)=>e+(this[t]!==void 0?this.toAttrString(t,this[t]):""),"")}toAttrString(e,t){let n=e==="className"?"class":this.convertCamelToKebabCase(e);return t===null?`${n} `:`${n}="${t.toString()}" `}convertCamelToKebabCase(e){return e.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g).join("-").toLowerCase()}}function tO(e){return new i9t(e).toAttributesString()}function Sj(e,t){let n=[],[o,r,i]=e.standard,[s,a,c]=t.standard,l=o*a-r*s,h=i*a-r*c,d=o*c-i*s;if(!He.Utils.EQ_0(l)){let u,_;if(r===0)u=i/o,_=d/l;else if(a===0)u=c/s,_=d/l;else if(o===0)u=h/l,_=i/r;else if(s===0)u=h/l,_=c/a;else u=h/l,_=d/l;n.push(new He.Point(u,_))}return n}function nO(e,t){let n=[],o=t.pc.projectionOn(e),r=t.pc.distanceTo(o)[0];if(He.Utils.EQ(r,t.r))n.push(o);else if(He.Utils.LT(r,t.r)){let i=Math.sqrt(t.r*t.r-r*r),s,a;s=e.norm.rotate90CCW().multiply(i),a=o.translate(s),n.push(a),s=e.norm.rotate90CW().multiply(i),a=o.translate(s),n.push(a)}return n}function Cj(e,t){let n=[];for(let o of t.toSegments()){let r=kie(o,e);for(let i of r)if(!m9t(i,n))n.push(i)}return n}function jfe(e,t){let n=[];if(Cj(e,t.box).length===0)return n;let o=new He.Circle(t.pc,t.r),r=nO(e,o);for(let i of r)if(i.on(t))n.push(i);return n}function kie(e,t){let n=[];if(e.ps.on(t))n.push(e.ps);if(e.pe.on(t)&&!e.isZeroLength())n.push(e.pe);if(n.length>0)return n;if(e.isZeroLength())return n;if(e.ps.leftTo(t)&&e.pe.leftTo(t)||!e.ps.leftTo(t)&&!e.pe.leftTo(t))return n;let o=new He.Line(e.ps,e.pe);return Sj(o,t)}function Kfe(e,t){let n=[];if(e.isZeroLength()){if(e.ps.on(t))n.push(e.ps);return n}if(t.isZeroLength()){if(t.ps.on(e))n.push(t.ps);return n}let o=new He.Line(e.ps,e.pe),r=new He.Line(t.ps,t.pe);if(o.incidentTo(r)){if(e.ps.on(t))n.push(e.ps);if(e.pe.on(t))n.push(e.pe);if(t.ps.on(e)&&!t.ps.equalTo(e.ps)&&!t.ps.equalTo(e.pe))n.push(t.ps);if(t.pe.on(e)&&!t.pe.equalTo(e.ps)&&!t.pe.equalTo(e.pe))n.push(t.pe)}else if(o.parallelTo(r)){let i=new He.Vector(e.ps,e.pe),s=new He.Vector(t.ps,t.pe),a=new He.Vector(e.ps,t.ps),c=i.cross(s);if(!He.Utils.EQ_0(c)){let l=a.cross(s)/c,h=a.cross(i)/c;if(He.Utils.GE(l,0)&&He.Utils.LE(l,1)&&He.Utils.GE(h,0)&&He.Utils.LE(h,1))n.push(YIt(e.ps.translate(i.multiply(l)),e,t))}}else{let i=Sj(o,r);if(i.length>0){if(GIt(i[0],e)&&GIt(i[0],t))n.push(YIt(i[0],e,t))}}return n}function YIt(e,t,n){for(let o of[t.ps,t.pe,n.ps,n.pe])if(e.equalTo(o))return o;return e}function GIt(e,t){let n=t.box;return He.Utils.LE(e.x,n.xmax)&&He.Utils.GE(e.x,n.xmin)&&He.Utils.LE(e.y,n.ymax)&&He.Utils.GE(e.y,n.ymin)}function $fe(e,t){let n=[];if(e.isZeroLength()){let[i,s]=e.ps.distanceTo(t.pc);if(He.Utils.EQ(i,t.r))n.push(e.ps);return n}let o=new He.Line(e.ps,e.pe),r=nO(o,t);for(let i of r)if(i.on(e))n.push(i);return n}function Pj(e,t){let n=[];if(e.isZeroLength()){if(e.ps.on(t))n.push(e.ps);return n}let o=new He.Line(e.ps,e.pe),r=new He.Circle(t.pc,t.r),i=nO(o,r);for(let s of i)if(s.on(e)&&s.on(t))n.push(s);return n}function x7o(e,t){let n=[];for(let o of t.toSegments()){let r=Kfe(o,e);for(let i of r)n.push(i)}return n}function s9t(e,t){let n=[],o=new He.Vector(e.pc,t.pc),r=e.r,i=t.r;if(He.Utils.EQ_0(r)||He.Utils.EQ_0(i))return n;if(He.Utils.EQ_0(o.x)&&He.Utils.EQ_0(o.y)&&He.Utils.EQ(r,i))return n.push(e.pc.translate(-r,0)),n;let s=e.pc.distanceTo(t.pc)[0];if(He.Utils.GT(s,r+i))return n;if(He.Utils.LT(s,Math.abs(r-i)))return n;o.x/=s,o.y/=s;let a;if(He.Utils.EQ(s,r+i)||He.Utils.EQ(s,Math.abs(r-i)))return a=e.pc.translate(r*o.x,r*o.y),n.push(a),n;let c=r*r/(2*s)-i*i/(2*s)+s/2,l=e.pc.translate(c*o.x,c*o.y),h=Math.sqrt(r*r-c*c);return a=l.translate(o.rotate90CCW().multiply(h)),n.push(a),a=l.translate(o.rotate90CW().multiply(h)),n.push(a),n}function C7o(e,t){let n=[];for(let o of t.toSegments()){let r=$fe(o,e);for(let i of r)n.push(i)}return n}function a9t(e,t){let n=[];if(e.pc.equalTo(t.pc)&&He.Utils.EQ(e.r,t.r)){let s;if(s=e.start,s.on(t))n.push(s);if(s=e.end,s.on(t))n.push(s);if(s=t.start,s.on(e))n.push(s);if(s=t.end,s.on(e))n.push(s);return n}let o=new He.Circle(e.pc,e.r),r=new He.Circle(t.pc,t.r),i=o.intersect(r);for(let s of i)if(s.on(e)&&s.on(t))n.push(s);return n}function QLe(e,t){let n=[];if(t.pc.equalTo(e.pc)&&He.Utils.EQ(t.r,e.r))return n.push(e.start),n.push(e.end),n;let o=t,r=new He.Circle(e.pc,e.r),i=s9t(o,r);for(let s of i)if(s.on(e))n.push(s);return n}function b7o(e,t){let n=[];for(let o of t.toSegments()){let r=Pj(o,e);for(let i of r)n.push(i)}return n}function c9t(e,t){return e.isSegment?Kfe(e.shape,t):Pj(t,e.shape)}function l9t(e,t){return e.isSegment?Pj(e.shape,t):a9t(e.shape,t)}function h9t(e,t){return e.isSegment?kie(e.shape,t):jfe(t,e.shape)}function I7o(e,t){return e.isSegment?HLe(t,e.shape):FLe(t,e.shape)}function v7o(e,t){return e.isSegment?$fe(e.shape,t):QLe(e.shape,t)}function kLe(e,t){let n=[];for(let o of t.edges)for(let r of c9t(o,e))n.push(r);return n}function LLe(e,t){let n=[];for(let o of t.edges)for(let r of l9t(o,e))n.push(r);return n}function Lie(e,t){let n=[];if(t.isEmpty())return n;for(let o of t.edges)for(let r of h9t(o,e))if(!m9t(r,n))n.push(r);return e.sortPoints(n)}function d9t(e,t){let n=[];if(t.isEmpty())return n;for(let o of t.edges)for(let r of v7o(o,e))n.push(r);return n}function u9t(e,t){if(e.isSegment)return c9t(t,e.shape);else if(e.isArc)return l9t(t,e.shape);else if(e.isLine)return h9t(t,e.shape);else if(e.isRay)return I7o(t,e.shape);return[]}function p9t(e,t){let n=[];if(t.isEmpty()||e.shape.box.not_intersect(t.box))return n;let o=t.edges.search(e.shape.box);for(let r of o)n=[...n,...u9t(e,r)];return n}function S7o(e,t){let n=[];if(t.isEmpty()||e.size===0)return n;for(let o of e)n=[...n,...p9t(o,t)];return n}function P7o(e,t){let n=[];if(e.isEmpty()||t.isEmpty())return n;if(e.box.not_intersect(t.box))return n;for(let o of e.edges)n=[...n,...p9t(o,t)];return n}function E7o(e,t){if(e instanceof He.Line)return Lie(e,t);else if(e instanceof He.Segment)return kLe(e,t);else if(e instanceof He.Arc)return LLe(e,t);else return[]}function m9t(e,t){return t.some((n)=>n.equalTo(e))}function MR(e){return new He.Line(e.start,e.norm)}function HLe(e,t){return kie(t,MR(e)).filter((n)=>e.contains(n))}function FLe(e,t){return jfe(MR(e),t).filter((n)=>e.contains(n))}function _9t(e,t){return nO(MR(e),t).filter((n)=>e.contains(n))}function M7o(e,t){return Cj(MR(e),t).filter((n)=>e.contains(n))}function g9t(e,t){return Sj(MR(e),t).filter((n)=>e.contains(n))}function w7o(e,t){return Sj(MR(e),MR(t)).filter((n)=>e.contains(n)).filter((n)=>t.contains(n))}function A9t(e,t){return Lie(MR(e),t).filter((n)=>e.contains(n))}function f9t(e,t){if(e.intersect&&e.intersect instanceof Function)return e.intersect(t);throw wu.UNSUPPORTED_SHAPE_TYPE}function Ej(e,t){let n=[];for(let o of t)n=[...n,...f9t(e,o.shape)];return n}function B7o(e,t){let n=[];for(let o of e)for(let r of t)n=[...n,...f9t(o.shape,r.shape)];return n}function bj(e,t,n){let o=n.length,r=e.shape.split(t);if(r.length===0)return;let i=0;if(r[0]===null)i=0;else if(r[1]===null)i=e.shape.length;else i=r[0].length;let s=0;if(Zz(i,0))s|=1;if(Zz(i,e.shape.length))s|=2;let a;if(i===1/0)a=r[0].coord(t);else a=s&2&&e.next&&e.next.arc_length===0?0:e.arc_length+i;n.push({id:o,pt:t,arc_length:a,edge_before:e,edge_after:void 0,face:e.face,is_vertex:s})}function Rie(e){e.int_points1_sorted=ER(e.int_points1),e.int_points2_sorted=ER(e.int_points2)}function ER(e){let t=new Map,n=0;for(let r of e)if(!t.has(r.face))t.set(r.face,n),n++;for(let r of e)r.faceId=t.get(r.face);return e.slice().sort(D7o)}function D7o(e,t){if(e.faceId<t.faceId)return-1;if(e.faceId>t.faceId)return 1;if(e.arc_length<t.arc_length)return-1;if(e.arc_length>t.arc_length)return 1;return 0}function zLe(e){if(e.int_points1.length<2)return;let t=!1,n,o,r,i;for(let s=0;s<e.int_points1_sorted.length;s++){if(e.int_points1_sorted[s].id===-1)continue;n=e.int_points1_sorted[s],o=e.int_points2[n.id];for(let a=s+1;a<e.int_points1_sorted.length;a++){if(r=e.int_points1_sorted[a],!Zz(r.arc_length,n.arc_length))break;if(r.id===-1)continue;if(i=e.int_points2[r.id],i.id===-1)continue;if(r.edge_before===n.edge_before&&r.edge_after===n.edge_after&&i.edge_before===o.edge_before&&i.edge_after===o.edge_after)r.id=-1,i.id=-1,t=!0}}o=e.int_points2_sorted[0],n=e.int_points1[o.id];for(let s=1;s<e.int_points2_sorted.length;s++){let a=e.int_points2_sorted[s];if(a.id===-1)continue;if(o.id===-1||!Zz(a.arc_length,o.arc_length)){o=a,n=e.int_points1[o.id];continue}let c=e.int_points1[a.id];if(c.edge_before===n.edge_before&&c.edge_after===n.edge_after&&a.edge_before===o.edge_before&&a.edge_after===o.edge_after)c.id=-1,a.id=-1,t=!0}if(t)e.int_points1=e.int_points1.filter((s)=>s.id>=0),e.int_points2=e.int_points2.filter((s)=>s.id>=0),e.int_points1.forEach((s,a)=>s.id=a),e.int_points2.forEach((s,a)=>s.id=a)}function MLe(e){for(let t of e){if(t.edge_before)t.edge_before.bvStart=void 0,t.edge_before.bvEnd=void 0,t.edge_before.bv=void 0,t.edge_before.overlap=void 0;if(t.edge_after)t.edge_after.bvStart=void 0,t.edge_after.bvEnd=void 0,t.edge_after.bv=void 0,t.edge_after.overlap=void 0}for(let t of e){if(t.edge_before)t.edge_before.bvEnd=2;if(t.edge_after)t.edge_after.bvStart=2}}function wLe(e,t){for(let n of e){if(n.edge_before)n.edge_before.setInclusion(t);if(n.edge_after)n.edge_after.setInclusion(t)}}function N7o(e){let t=void 0,n=void 0,o=void 0,r=e.int_points1.length;for(let i=0;i<r;i++){let s=e.int_points1_sorted[i];if(s.face!==t)n=i,t=s.face;let a=i,c=Ij(e.int_points1_sorted,i,t),l;if(a+c<r&&e.int_points1_sorted[a+c].face===t)l=a+c;else l=n;let h=Ij(e.int_points1_sorted,l,t);o=null;for(let g=l;g<l+h;g++){let f=e.int_points1_sorted[g];if(f.face===t&&e.int_points2[f.id].face===e.int_points2[s.id].face){o=f;break}}if(o===null)continue;let d=s.edge_after,u=o.edge_before;if(!(d.bv===2&&u.bv===2))continue;if(d!==u)continue;let _=e.int_points2[s.id],p=e.int_points2[o.id],m=_.edge_after,A=p.edge_before;if(!(m.bv===2&&A.bv===2&&m===A))_=e.int_points2[o.id],p=e.int_points2[s.id],m=_.edge_after,A=p.edge_before;if(!(m.bv===2&&A.bv===2&&m===A))continue;d.setOverlap(m)}}function Ij(e,t,n){let o,r,i=1;if(e.length===1)return 1;o=e[t];for(let s=t+1;s<e.length;s++){if(o.face!==n)break;if(r=e[s],!(r.pt.equalTo(o.pt)&&r.edge_before===o.edge_before&&r.edge_after===o.edge_after))break;i++}return i}function vj(e,t){if(!t)return;for(let n of t){let o=n.edge_before;if(n.is_vertex=0,o.shape.start&&o.shape.start.equalTo(n.pt))n.is_vertex|=1;if(o.shape.end&&o.shape.end.equalTo(n.pt))n.is_vertex|=2;if(n.is_vertex&1){if(n.edge_before=o.prev,o.prev)n.is_vertex=2;continue}if(n.is_vertex&2)continue;let r=e.addVertex(n.pt,o);n.edge_before=r}for(let n of t)if(n.edge_before)n.edge_after=n.edge_before.next;else if(e instanceof oO&&n.is_vertex&1)n.edge_after=e.first}function UIt(e,t,n){let o=e.edge_before,r=t.edge_after,i=n.length;o.next=n[0],n[0].prev=o,n[i-1].next=r,r.prev=n[i-1]}function k7o(e,t){let[n,o]=Fie(e,t,qfe,!0);return n}function BLe(e,t){let o=t.clone().reverse(),[r,i]=Fie(e,o,eO,!0);return r}function y9t(e,t){let[n,o]=Fie(e,t,Hie,!0);return n}function x9t(e,t){let[n,o]=Fie(e,t,Hie,!1),r=[];for(let s of n.faces)r=[...r,...[...s.edges].map((a)=>a.shape)];let i=[];for(let s of o.faces)i=[...i,...[...s.edges].map((a)=>a.shape)];return[r,i]}function TLe(e,t){let[n,o]=Fie(e,t,eO,!1),r=[];for(let i of n.faces)r=[...r,...[...i.edges].map((s)=>s.shape)];return r}function C9t(e,t){let n=e.clone(),o=t.clone(),r=b9t(n,o);Rie(r),vj(n,r.int_points1_sorted),vj(o,r.int_points2_sorted),zLe(r),Rie(r);let i=r.int_points1_sorted.map((a)=>a.pt),s=r.int_points2_sorted.map((a)=>a.pt);return[i,s]}function L7o(e,t,n,o){let r=jIt(e,n.int_points1),i=jIt(t,n.int_points2);KIt(r,t),KIt(i,e),MLe(n.int_points1),MLe(n.int_points2),wLe(n.int_points1,t),wLe(n.int_points2,e);while(F7o(e,t,n.int_points1,n.int_points1_sorted,n.int_points2,n));N7o(n),DLe(e,o,n.int_points1_sorted,!0),DLe(t,o,n.int_points2_sorted,!1),$It(e,r,o,!0),$It(t,i,o,!1)}function H7o(e,t,n,o){z7o(e,t,o,n.int_points2),O7o(e,t,n),NLe(e,n.int_points1),NLe(t,n.int_points2),RLe(e,n.int_points1,n.int_points2),RLe(e,n.int_points2,n.int_points1),qIt(e),qIt(t)}function Fie(e,t,n,o){let r=e.clone(),i=t.clone(),s=b9t(r,i);if(Rie(s),vj(r,s.int_points1_sorted),vj(i,s.int_points2_sorted),zLe(s),Rie(s),L7o(r,i,s,n),o)H7o(r,i,s,n);return[r,i]}function b9t(e,t){let n={int_points1:[],int_points2:[]};for(let o of e.edges){let r=t.edges.search(o.box);for(let i of r){let s=o.shape.intersect(i.shape);for(let a of s)bj(o,a,n.int_points1),bj(i,a,n.int_points2)}}return n}function jIt(e,t){let n=[];for(let o of e.faces)if(!t.find((r)=>r.face===o))n.push(o);return n}function KIt(e,t){for(let n of e)n.first.bv=n.first.bvStart=n.first.bvEnd=void 0,n.first.setInclusion(t)}function F7o(e,t,n,o,r,i){let s,a,c,l=o.length,h=!1;for(let d=0;d<l;d++){let u=o[d];if(u.face!==s)a=d,s=u.face;let _=d,p=Ij(o,d,s),m;if(_+p<l&&o[_+p].face===s)m=_+p;else m=a;let A=Ij(o,m,s);c=null;for(let y=m;y<m+A;y++){let x=o[y];if(x.face===s&&r[x.id].face===r[u.id].face){c=x;break}}if(c===null)continue;let g=u.edge_after,f=c.edge_before;if(g.bv===VA&&f.bv!=VA){g.bv=f.bv;continue}if(g.bv!=VA&&f.bv===VA){f.bv=g.bv;continue}if(g.bv===VA&&f.bv===VA&&g!=f||(g.bv===K7&&f.bv===$7||g.bv===$7&&f.bv===K7)){let y=g.next;while(y!=f)y.bvStart=void 0,y.bvEnd=void 0,y.bv=void 0,y.setInclusion(t),y=y.next}if(g.bv===VA&&f.bv===VA&&g!=f){let y=g.next,x;while(y!=f){if(y.bv!=VA){if(x===void 0)x=y.bv;else if(y.bv!=x)throw wu.UNRESOLVED_BOUNDARY_CONFLICT}y=y.next}if(x!=null)g.bv=x,f.bv=x;continue}if(g.bv===K7&&f.bv===$7||g.bv===$7&&f.bv===K7){let y=g;while(y!=f){if(y.bvStart===g.bv&&y.bvEnd===f.bv){let[x,C]=y.shape.distanceTo(t);if(x<10*He.DP_TOL){bj(y,C.ps,n);let b=n[n.length-1];if(b.is_vertex&WIt)b.edge_after=y,b.edge_before=y.prev,y.bvStart=VA,y.bv=void 0,y.setInclusion(t);else if(b.is_vertex&XIt)b.edge_after=y.next,y.bvEnd=VA,y.bv=void 0,y.setInclusion(t);else{let P=t.addVertex(b.pt,y);b.edge_before=P,b.edge_after=P.next,P.setInclusion(t),P.next.bvStart=VA,P.next.bvEnd=void 0,P.next.bv=void 0,P.next.setInclusion(t)}let I=t.findEdgeByPoint(C.pe);bj(I,C.pe,r);let v=r[r.length-1];if(v.is_vertex&WIt)v.edge_after=I,v.edge_before=I.prev;else if(v.is_vertex&XIt)v.edge_after=I.next;else{let P=r.find((B)=>B.edge_after===I),M=t.addVertex(v.pt,I);if(v.edge_before=M,v.edge_after=M.next,P)P.edge_after=M;M.bvStart=void 0,M.bvEnd=VA,M.bv=void 0,M.setInclusion(e),M.next.bvStart=VA,M.next.bvEnd=void 0,M.next.bv=void 0,M.next.setInclusion(e)}Rie(i),h=!0;break}}y=y.next}if(h)break;throw wu.UNRESOLVED_BOUNDARY_CONFLICT}}return h}function DLe(e,t,n,o){if(!n)return;let r=void 0,i=void 0,s,a;for(let c=0;c<n.length;c++){if(s=n[c],s.face!==r)i=c,r=s.face;if(r.isEmpty())continue;let l=c,h=Ij(n,c,r),d;if(l+h<n.length&&n[l+h].face===s.face)d=l+h;else d=i;a=n[d];let u=d,_=Ij(n,u,r),p=s.edge_after,m=a.edge_before;if(p.bv===K7&&m.bv===K7&&t===qfe||p.bv===$7&&m.bv===$7&&t===Hie||(p.bv===$7||m.bv===$7)&&t===eO&&!o||(p.bv===K7||m.bv===K7)&&t===eO&&o||p.bv===VA&&m.bv===VA&&p.overlap&R7o&&o||p.bv===VA&&m.bv===VA&&p.overlap&Q7o){e.removeChain(r,p,m);for(let A=l;A<l+h;A++)n[A].edge_after=void 0;for(let A=u;A<u+_;A++)n[A].edge_before=void 0}c+=h-1}}function z7o(e,t,n,o){for(let r of t.faces){for(let i of r)e.edges.add(i);if(o.find((i)=>i.face===r)===void 0)e.addFace(r.first,r.last)}}function O7o(e,t,n){if(n.int_points1.length===0)return;for(let o=0;o<n.int_points1.length;o++){let r=n.int_points1[o],i=n.int_points2[o];if(r.edge_before!==void 0&&r.edge_after===void 0){if(i.edge_before===void 0&&i.edge_after!==void 0)r.edge_before.next=i.edge_after,i.edge_after.prev=r.edge_before,r.edge_after=i.edge_after,i.edge_before=r.edge_before}if(i.edge_before!==void 0&&i.edge_after===void 0){if(r.edge_before===void 0&&r.edge_after!==void 0)i.edge_before.next=r.edge_after,r.edge_after.prev=i.edge_before,i.edge_after=r.edge_after,r.edge_before=i.edge_before}if(r.edge_before!==void 0&&r.edge_after===void 0)for(let s of n.int_points1_sorted){if(s===r)continue;if(s.edge_before===void 0&&s.edge_after!==void 0){if(s.pt.equalTo(r.pt))r.edge_before.next=s.edge_after,s.edge_after.prev=r.edge_before,r.edge_after=s.edge_after,s.edge_before=r.edge_before}}if(i.edge_before!==void 0&&i.edge_after===void 0)for(let s of n.int_points2_sorted){if(s===i)continue;if(s.edge_before===void 0&&s.edge_after!==void 0){if(s.pt.equalTo(i.pt))i.edge_before.next=s.edge_after,s.edge_after.prev=i.edge_before,i.edge_after=s.edge_after,s.edge_before=i.edge_before}}}}function NLe(e,t){for(let n of t){if(e.faces.delete(n.face),n.face=void 0,n.edge_before)n.edge_before.face=void 0;if(n.edge_after)n.edge_after.face=void 0}}function RLe(e,t,n){for(let o of t){if(o.edge_before===void 0||o.edge_after===void 0)continue;if(o.face)continue;if(o.edge_after.face||o.edge_before.face)continue;let{edge_after:r,edge_before:i}=o;try{Xfe.testInfiniteLoop(r)}catch(a){throw wu.CANNOT_COMPLETE_BOOLEAN_OPERATION}let s=e.addFace(r,i);for(let a of t)if(a.edge_before&&a.edge_after&&a.edge_before.face===s&&a.edge_after.face===s)a.face=s;for(let a of n)if(a.edge_before&&a.edge_after&&a.edge_before.face===s&&a.edge_after.face===s)a.face=s}}function $It(e,t,n,o){for(let r of t){let i=r.first.bv;if(n===qfe&&i===K7||n===eO&&i===K7&&o||n===eO&&i===$7&&!o||n===Hie&&i===$7)e.deleteFace(r)}}function qIt(e){let t=[];for(let n of e.edges)if(!n.face||!e.faces.has(n.face))t.push(n);for(let n of t)e.edges.delete(n)}class rO{constructor(){this.m=[,,,,,,,,,].fill(void 0)}get I2I(){return this.m[0]}set I2I(e){this.m[0]=e}get I2B(){return this.m[1]}set I2B(e){this.m[1]=e}get I2E(){return this.m[2]}set I2E(e){this.m[2]=e}get B2I(){return this.m[3]}set B2I(e){this.m[3]=e}get B2B(){return this.m[4]}set B2B(e){this.m[4]=e}get B2E(){return this.m[5]}set B2E(e){this.m[5]=e}get E2I(){return this.m[6]}set E2I(e){this.m[6]=e}get E2B(){return this.m[7]}set E2B(e){this.m[7]=e}get E2E(){return this.m[8]}set E2E(e){this.m[8]=e}toString(){return this.m.map((e)=>{if(e instanceof Array&&e.length>0)return"T";else if(e instanceof Array&&e.length===0)return"F";else return"*"}).join("")}equal(){return V7o.test(this.toString())}intersect(){return Y7o.test(this.toString())}touch(){return G7o.test(this.toString())}inside(){return U7o.test(this.toString())}covered(){return W7o.test(this.toString())}}function Die(e,t){let n=void 0,o=new He.Ray(t),r=new He.Line(o.pt,o.norm),i=new He.Box(o.box.xmin-He.DP_TOL,o.box.ymin-He.DP_TOL,o.box.xmax+He.DP_TOL,o.box.ymax+He.DP_TOL);if(e.box.not_intersect(i))return He.OUTSIDE;let s=e.edges.search(i);if(s.length===0)return He.OUTSIDE;for(let h of s)if(h.shape.contains(t))return He.BOUNDARY;let a=[...e.faces],c=[];for(let h of s)for(let d of o.intersect(h.shape)){if(d.equalTo(t))return He.BOUNDARY;c.push({pt:d,edge:h,face_index:a.indexOf(h.face)})}c.sort((h,d)=>{if(r9t(h.pt.x,d.pt.x))return-1;if(o9t(h.pt.x,d.pt.x))return 1;if(h.face_index<d.face_index)return-1;if(h.face_index>d.face_index)return 1;if(h.edge.arc_length<d.edge.arc_length)return-1;if(h.edge.arc_length>d.edge.arc_length)return 1;return 0});let l=0;for(let h=0;h<c.length;h++){let d=c[h];if(d.pt.equalTo(d.edge.shape.start)){if(h>0&&d.pt.equalTo(c[h-1].pt)&&d.face_index===c[h-1].face_index&&d.edge.prev===c[h-1].edge)continue;let u=d.edge.prev;while(ELe(u.length))u=u.prev;let _=u.shape.tangentInEnd(),p=d.pt.translate(_),m=d.edge.shape.tangentInStart(),A=d.pt.translate(m),g=p.leftTo(r),f=A.leftTo(r);if(g&&!f||!g&&f)l++}else if(d.pt.equalTo(d.edge.shape.end)){if(h>0&&d.pt.equalTo(c[h-1].pt)&&d.face_index===c[h-1].face_index&&d.edge.next===c[h-1].edge)continue;let u=d.edge.next;while(ELe(u.length))u=u.next;let _=u.shape.tangentInStart(),p=d.pt.translate(_),m=d.edge.shape.tangentInEnd(),A=d.pt.translate(m),g=p.leftTo(r),f=A.leftTo(r);if(g&&!f||!g&&f)l++}else if(d.edge.shape instanceof He.Segment)l++;else{let u=d.edge.shape.box;if(!(Zz(d.pt.y,u.ymin)||Zz(d.pt.y,u.ymax)))l++}}return n=l%2===1?1:0,n}function X7o(e,t){return wj(e,t).equal()}function I9t(e,t){return wj(e,t).intersect()}function j7o(e,t){return wj(e,t).touch()}function K7o(e,t){return!I9t(e,t)}function v9t(e,t){return wj(e,t).inside()}function S9t(e,t){return wj(e,t).covered()}function $7o(e,t){return v9t(t,e)}function P9t(e,t){return S9t(t,e)}function wj(e,t){if(e instanceof He.Line&&t instanceof He.Line)return q7o(e,t);else if(e instanceof He.Line&&t instanceof He.Circle)return J7o(e,t);else if(e instanceof He.Line&&t instanceof He.Box)return Z7o(e,t);else if(e instanceof He.Line&&t instanceof He.Polygon)return eSo(e,t);else if((e instanceof He.Segment||e instanceof He.Arc)&&t instanceof He.Polygon)return JIt(e,t);else if((e instanceof He.Segment||e instanceof He.Arc)&&(t instanceof He.Circle||t instanceof He.Box))return JIt(e,new He.Polygon(t));else if(e instanceof He.Polygon&&t instanceof He.Polygon)return Gfe(e,t);else if((e instanceof He.Circle||e instanceof He.Box)&&(t instanceof He.Circle||t instanceof He.Box))return Gfe(new He.Polygon(e),new He.Polygon(t));else if((e instanceof He.Circle||e instanceof He.Box)&&t instanceof He.Polygon)return Gfe(new He.Polygon(e),t);else if(e instanceof He.Polygon&&(t instanceof He.Circle||t instanceof He.Box))return Gfe(e,new He.Polygon(t))}function q7o(e,t){let n=new rO,o=Sj(e,t);if(o.length===0)if(e.contains(t.pt)&&t.contains(e.pt))n.I2I=[e],n.I2E=[],n.E2I=[];else n.I2I=[],n.I2E=[e],n.E2I=[t];else n.I2I=o,n.I2E=e.split(o),n.E2I=t.split(o);return n}function J7o(e,t){let n=new rO,o=nO(e,t);if(o.length===0)n.I2I=[],n.I2B=[],n.I2E=[e],n.E2I=[t];else if(o.length===1)n.I2I=[],n.I2B=o,n.I2E=e.split(o),n.E2I=[t];else{let r=new oO([e]),i=e.sortPoints(o);r.split(i);let s=r.toShapes();n.I2I=[s[1]],n.I2B=i,n.I2E=[s[0],s[2]],n.E2I=new He.Polygon([t.toArc()]).cutWithLine(e)}return n}function Z7o(e,t){let n=new rO,o=Cj(e,t);if(o.length===0)n.I2I=[],n.I2B=[],n.I2E=[e],n.E2I=[t];else if(o.length===1)n.I2I=[],n.I2B=o,n.I2E=e.split(o),n.E2I=[t];else{let r=new oO([e]),i=e.sortPoints(o);r.split(i);let s=r.toShapes();if(t.toSegments().some((a)=>a.contains(o[0])&&a.contains(o[1])))n.I2I=[],n.I2B=[s[1]],n.I2E=[s[0],s[2]],n.E2I=[t];else n.I2I=[s[1]],n.I2B=i,n.I2E=[s[0],s[2]],n.E2I=new He.Polygon(t.toSegments()).cutWithLine(e)}return n}function eSo(e,t){let n=new rO,o=Lie(e,t),r=new oO([e]),i=o.length>0?o.slice():e.sortPoints(o);return r.split(i),[...r].forEach((s)=>s.setInclusion(t)),n.I2I=[...r].filter((s)=>s.bv===He.INSIDE).map((s)=>s.shape),n.I2B=[...r].slice(1).map((s)=>s.bv===He.BOUNDARY?s.shape:s.shape.start),n.I2E=[...r].filter((s)=>s.bv===He.OUTSIDE).map((s)=>s.shape),n.E2I=t.cutWithLine(e),n}function JIt(e,t){let n=new rO,o=E7o(e,t),r=o.length>0?o.slice():e.sortPoints(o),i=new oO([e]);i.split(r),[...i].forEach((s)=>s.setInclusion(t)),n.I2I=[...i].filter((s)=>s.bv===He.INSIDE).map((s)=>s.shape),n.I2B=[...i].slice(1).map((s)=>s.bv===He.BOUNDARY?s.shape:s.shape.start),n.I2E=[...i].filter((s)=>s.bv===He.OUTSIDE).map((s)=>s.shape),n.B2I=[],n.B2B=[],n.B2E=[];for(let s of[e.start,e.end])switch(Die(t,s)){case He.INSIDE:n.B2I.push(s);break;case He.BOUNDARY:n.B2B.push(s);break;case He.OUTSIDE:n.B2E.push(s);break}return n}function Gfe(e,t){let n=new rO,[o,r]=C9t(e,t),i=y9t(e,t),s=BLe(e,t),a=BLe(t,e),[c,l]=x9t(e,t),h=TLe(e,t),d=TLe(t,e);return n.I2I=i.isEmpty()?[]:[i],n.I2B=l,n.I2E=s.isEmpty()?[]:[s],n.B2I=c,n.B2B=o,n.B2E=h,n.E2I=a.isEmpty()?[]:[a],n.E2B=d,n}class s2{constructor(e=1,t=0,n=0,o=1,r=0,i=0){this.a=e,this.b=t,this.c=n,this.d=o,this.tx=r,this.ty=i}fromMatrix3x3(e){let[t,n,o]=e[0],[r,i,s]=e[1];return new s2(t,r,n,i,o,s)}toMatrix3x3(){return[[this.a,this.c,this.tx],[this.b,this.d,this.ty],[0,0,1]]}clone(){return new s2(this.a,this.b,this.c,this.d,this.tx,this.ty)}transform(e){return[e[0]*this.a+e[1]*this.c+this.tx,e[0]*this.b+e[1]*this.d+this.ty]}multiply(e){return new s2(this.a*e.a+this.c*e.b,this.b*e.a+this.d*e.b,this.a*e.c+this.c*e.d,this.b*e.c+this.d*e.d,this.a*e.tx+this.c*e.ty+this.tx,this.b*e.tx+this.d*e.ty+this.ty)}translate(...e){let t,n;if(e.length==1&&!isNaN(e[0].x)&&!isNaN(e[0].y))t=e[0].x,n=e[0].y;else if(e.length===2&&typeof e[0]=="number"&&typeof e[1]=="number")t=e[0],n=e[1];else throw wu.ILLEGAL_PARAMETERS;return this.multiply(new s2(1,0,0,1,t,n))}rotate(e,t=0,n=0){let o=Math.cos(e),r=Math.sin(e);return this.translate(t,n).multiply(new s2(o,r,-r,o,0,0)).translate(-t,-n)}scale(e,t){return this.multiply(new s2(e,0,0,t,0,0))}equalTo(e){if(!He.Utils.EQ(this.tx,e.tx))return!1;if(!He.Utils.EQ(this.ty,e.ty))return!1;if(!He.Utils.EQ(this.a,e.a))return!1;if(!He.Utils.EQ(this.b,e.b))return!1;if(!He.Utils.EQ(this.c,e.c))return!1;if(!He.Utils.EQ(this.d,e.d))return!1;return!0}}class E9t{constructor(e,t){this.low=e,this.high=t}get max(){return this.clone()}less_than(e){return this.low<e.low||this.low===e.low&&this.high<e.high}equal_to(e){return this.low===e.low&&this.high===e.high}intersect(e){return!this.not_intersect(e)}not_intersect(e){return this.high<e.low||e.high<this.low}merge(e){let t=this.low===void 0?e.low:this.low<e.low?this.low:e.low,n=this.high===void 0?e.high:this.high>e.high?this.high:e.high,o=this.clone();return o.low=t,o.high=n,o}output(){return[this.low,this.high]}comparable_less_than(e,t){return e<t}}class vw{constructor(e,t,n=null,o=null,r=null,i=ed){if(this.left=n,this.right=o,this.parent=r,this.color=i,this.item={key:void 0,values:[]},t!==void 0)this.item.values.push(t);if(e!==void 0)if(Array.isArray(e)){let[s,a]=e;if(!Number.isNaN(s)&&!Number.isNaN(a)){let c=s,l=a;if(c>l)[c,l]=[l,c];this.item.key=new OLe(c,l)}}else this.item.key=e;this.max=this.item.key?this.item.key.max:void 0}isNil(){return this.item.key===void 0&&this.item.values.length===0&&this.left===null&&this.right===null&&this.color===ed}requireKey(){if(!this.item.key)throw Error("Node key is undefined (nil/sentinel). Operation is not applicable.");return this.item.key}less_than(e){let t=this.requireKey(),n=e.requireKey();return t.less_than(n)}_value_equal(e){let t=this.item.values[0],n=e.item.values[0];return t&&n&&t.equal_to?t.equal_to(n):t===n}equal_to(e){let t=this.requireKey(),n=e.requireKey();return t.equal_to(n)}intersect(e){let t=this.requireKey(),n=e.requireKey();return t.intersect(n)}copy_data(e){this.item.key=e.item.key,this.item.values=e.item.values.slice()}update_max(){if(this.max=this.item.key?this.item.key.max:void 0,this.right&&this.right.max)this.max=this.max?this.max.merge(this.right.max):this.right.max;if(this.left&&this.left.max)this.max=this.max?this.max.merge(this.left.max):this.left.max}not_intersect_left_subtree(e){if(!this.left)return!0;let t=this.left.max?this.left.max.high:this.left.item.key.high,n=this.requireKey(),o=e.requireKey();return n.comparable_less_than(t,o.low)}not_intersect_right_subtree(e){if(!this.right)return!0;let t=this.right.max?this.right.max.low:this.right.item.key.low,n=this.requireKey(),o=e.requireKey();return n.comparable_less_than(o.high,t)}}class Qie{constructor(){this.root=null,this.nil_node=new vw}get size(){let e=0;return this.tree_walk(this.root,(t)=>e+=t.item.values.length),e}get keys(){let e=[];return this.tree_walk(this.root,(t)=>e.push(t.item.key.output())),e}get values(){let e=[];return this.tree_walk(this.root,(t)=>{for(let n of t.item.values)e.push(n)}),e}get items(){let e=[];return this.tree_walk(this.root,(t)=>{let n=t.item.key.output();for(let o of t.item.values)e.push({key:n,value:o})}),e}isEmpty(){return this.root==null||this.root===this.nil_node}clear(){this.root=null}insert(e,t=e){if(e===void 0)return;let n=this.tree_search(this.root,new vw(e));if(n)return n.item.values.push(t),n;let o=new vw(e,t,this.nil_node,this.nil_node,null,i2);return this.tree_insert(o),this.recalc_max(o),o}exist(e,t=e){let n=this.tree_search(this.root,new vw(e));if(!n)return!1;if(arguments.length<2||t===e)return!0;return n.item.values.some((o)=>o&&o.equal_to?o.equal_to(t):o===t)}remove(e,t=e){let n=this.tree_search(this.root,new vw(e));if(!n)return;if(arguments.length<2)return this.tree_delete(n),n;let o=n.item.values.findIndex((r)=>r&&r.equal_to?r.equal_to(t):r===t);if(o>=0){if(n.item.values.splice(o,1),n.item.values.length===0)this.tree_delete(n);return n}return}search(e,t=(n,o)=>n===o?o.output():n){let n=new vw(e),o=[];this.tree_search_interval(this.root,n,o);let r=[];for(let i of o)for(let s of i.item.values)r.push(t(s,i.item.key));return r}intersect_any(e){let t=new vw(e);return this.tree_find_any_interval(this.root,t)}forEach(e){this.tree_walk(this.root,(t)=>{for(let n of t.item.values)e(t.item.key,n)})}map(e){let t=new Qie;return this.tree_walk(this.root,(n)=>{for(let o of n.item.values)t.insert(n.item.key,e(o,n.item.key))}),t}*iterate(e,t=(n,o)=>n===o?o.output():n){let n=null;if(e)n=this.tree_search_nearest_forward(this.root,new vw(e));else if(this.root)n=this.local_minimum(this.root);while(n){for(let o of n.item.values)yield t(o,n.item.key);n=this.tree_successor(n)}}recalc_max(e){let t=e;while(t.parent!=null)t.parent.update_max(),t=t.parent}tree_insert(e){let t=this.root,n=null;if(this.root==null||this.root===this.nil_node)this.root=e;else{while(t!==this.nil_node)if(n=t,e.less_than(t))t=t.left;else t=t.right;if(e.parent=n,e.less_than(n))n.left=e;else n.right=e}this.insert_fixup(e)}insert_fixup(e){let t,n;t=e;while(t!==this.root&&t.parent.color===i2)if(t.parent===t.parent.parent.left)if(n=t.parent.parent.right,n.color===i2)t.parent.color=ed,n.color=ed,t.parent.parent.color=i2,t=t.parent.parent;else{if(t===t.parent.right)t=t.parent,this.rotate_left(t);t.parent.color=ed,t.parent.parent.color=i2,this.rotate_right(t.parent.parent)}else if(n=t.parent.parent.left,n.color===i2)t.parent.color=ed,n.color=ed,t.parent.parent.color=i2,t=t.parent.parent;else{if(t===t.parent.left)t=t.parent,this.rotate_right(t);t.parent.color=ed,t.parent.parent.color=i2,this.rotate_left(t.parent.parent)}this.root.color=ed}tree_delete(e){let t,n;if(e.left===this.nil_node||e.right===this.nil_node)t=e;else t=this.tree_successor(e);if(t.left!==this.nil_node)n=t.left;else n=t.right;if(n.parent=t.parent,t===this.root)this.root=n;else{if(t===t.parent.left)t.parent.left=n;else t.parent.right=n;t.parent.update_max()}if(this.recalc_max(n),t!==e)e.copy_data(t),e.update_max(),this.recalc_max(e);if(t.color===ed)this.delete_fixup(n)}delete_fixup(e){let t=e,n;while(t!==this.root&&t.parent!=null&&t.color===ed)if(t===t.parent.left){if(n=t.parent.right,n.color===i2)n.color=ed,t.parent.color=i2,this.rotate_left(t.parent),n=t.parent.right;if(n.left.color===ed&&n.right.color===ed)n.color=i2,t=t.parent;else{if(n.right.color===ed)n.color=i2,n.left.color=ed,this.rotate_right(n),n=t.parent.right;n.color=t.parent.color,t.parent.color=ed,n.right.color=ed,this.rotate_left(t.parent),t=this.root}}else{if(n=t.parent.left,n.color===i2)n.color=ed,t.parent.color=i2,this.rotate_right(t.parent),n=t.parent.left;if(n.left.color===ed&&n.right.color===ed)n.color=i2,t=t.parent;else{if(n.left.color===ed)n.color=i2,n.right.color=ed,this.rotate_left(n),n=t.parent.left;n.color=t.parent.color,t.parent.color=ed,n.left.color=ed,this.rotate_right(t.parent),t=this.root}}t.color=ed}tree_search(e,t){if(e==null||e===this.nil_node)return;if(t.equal_to(e))return e;if(t.less_than(e))return this.tree_search(e.left,t);else return this.tree_search(e.right,t)}tree_search_nearest_forward(e,t){let n=null,o=e;while(o&&o!==this.nil_node)if(o.less_than(t))if(o.intersect(t))n=o,o=o.left;else o=o.right;else{if(!n||o.less_than(n))n=o;o=o.left}return n||null}tree_search_interval(e,t,n){if(e!=null&&e!==this.nil_node){if(e.left!==this.nil_node&&!e.not_intersect_left_subtree(t))this.tree_search_interval(e.left,t,n);if(e.intersect(t))n.push(e);if(e.right!==this.nil_node&&!e.not_intersect_right_subtree(t))this.tree_search_interval(e.right,t,n)}}tree_find_any_interval(e,t){let n=!1;if(e!=null&&e!==this.nil_node){if(e.left!==this.nil_node&&!e.not_intersect_left_subtree(t))n=this.tree_find_any_interval(e.left,t);if(!n)n=e.intersect(t);if(!n&&e.right!==this.nil_node&&!e.not_intersect_right_subtree(t))n=this.tree_find_any_interval(e.right,t)}return n}local_minimum(e){let t=e;while(t.left!=null&&t.left!==this.nil_node)t=t.left;return t}local_maximum(e){let t=e;while(t.right!=null&&t.right!==this.nil_node)t=t.right;return t}tree_successor(e){let t,n,o;if(e.right!==this.nil_node)t=this.local_minimum(e.right);else{n=e,o=e.parent;while(o!=null&&o.right===n)n=o,o=o.parent;t=o}return t}rotate_left(e){let t=e.right;if(e.right=t.left,t.left!==this.nil_node)t.left.parent=e;if(t.parent=e.parent,e===this.root)this.root=t;else if(e===e.parent.left)e.parent.left=t;else e.parent.right=t;if(t.left=e,e.parent=t,e!==null&&e!==this.nil_node)e.update_max();if(t!=null&&t!==this.nil_node)t.update_max()}rotate_right(e){let t=e.left;if(e.left=t.right,t.right!==this.nil_node)t.right.parent=e;if(t.parent=e.parent,e===this.root)this.root=t;else if(e===e.parent.left)e.parent.left=t;else e.parent.right=t;if(t.right=e,e.parent=t,e!==null&&e!==this.nil_node)e.update_max();if(t!=null&&t!==this.nil_node)t.update_max()}tree_walk(e,t){if(e!=null&&e!==this.nil_node)this.tree_walk(e.left,t),t(e),this.tree_walk(e.right,t)}testRedBlackProperty(){let e=!0;return this.tree_walk(this.root,function(t){if(t.color===i2){if(!(t.left.color===ed&&t.right.color===ed))e=!1}}),e}testBlackHeightProperty(e){let t=0,n=0,o=0;if(e.color===ed)t++;if(e.left!==this.nil_node)n=this.testBlackHeightProperty(e.left);else n=1;if(e.right!==this.nil_node)o=this.testBlackHeightProperty(e.right);else o=1;if(n!==o)throw Error("Red-black height property violated");return t+=n,t}}class Sw{get name(){throw wu.CANNOT_INVOKE_ABSTRACT_METHOD}get box(){throw wu.CANNOT_INVOKE_ABSTRACT_METHOD}clone(){throw wu.CANNOT_INVOKE_ABSTRACT_METHOD}translate(...e){return this.transform(new s2().translate(...e))}rotate(e,t=new He.Point){return this.transform(new s2().rotate(e,t.x,t.y))}scale(e,t){return this.transform(new s2().scale(e,t))}transform(...e){throw wu.CANNOT_INVOKE_ABSTRACT_METHOD}toJSON(){return Object.assign({},this,{name:this.name})}svg(e={}){throw wu.CANNOT_INVOKE_ABSTRACT_METHOD}}class Zfe{constructor(e){this.shape=e,this.next=void 0,this.prev=void 0,this.face=void 0,this.arc_length=0,this.bvStart=void 0,this.bvEnd=void 0,this.bv=void 0,this.overlap=void 0}get start(){return this.shape.start}get end(){return this.shape.end}get length(){return this.shape.length}get box(){return this.shape.box}get isSegment(){return this.shape instanceof He.Segment}get isArc(){return this.shape instanceof He.Arc}get isLine(){return this.shape instanceof He.Line}get isRay(){return this.shape instanceof He.Ray}middle(){return this.shape.middle()}pointAtLength(e){return this.shape.pointAtLength(e)}contains(e){return this.shape.contains(e)}setInclusion(e){if(this.bv!==void 0)return this.bv;if(this.shape instanceof He.Line||this.shape instanceof He.Ray)return this.bv=He.OUTSIDE,this.bv;if(this.bvStart===void 0)this.bvStart=Die(e,this.start);if(this.bvEnd===void 0)this.bvEnd=Die(e,this.end);if(this.bvStart===He.OUTSIDE||this.bvEnd==He.OUTSIDE)this.bv=He.OUTSIDE;else if(this.bvStart===He.INSIDE||this.bvEnd==He.INSIDE)this.bv=He.INSIDE;else{let t=Die(e,this.middle());this.bv=t}return this.bv}setOverlap(e){let t=void 0,n=this.shape,o=e.shape;if(n instanceof He.Segment&&o instanceof He.Segment){if(n.start.equalTo(o.start)&&n.end.equalTo(o.end))t=He.OVERLAP_SAME;else if(n.start.equalTo(o.end)&&n.end.equalTo(o.start))t=He.OVERLAP_OPPOSITE}else if(n instanceof He.Arc&&o instanceof He.Arc){if(n.start.equalTo(o.start)&&n.end.equalTo(o.end)&&n.middle().equalTo(o.middle()))t=He.OVERLAP_SAME;else if(n.start.equalTo(o.end)&&n.end.equalTo(o.start)&&n.middle().equalTo(o.middle()))t=He.OVERLAP_OPPOSITE}else if(n instanceof He.Segment&&o instanceof He.Arc||n instanceof He.Arc&&o instanceof He.Segment){if(n.start.equalTo(o.start)&&n.end.equalTo(o.end)&&n.middle().equalTo(o.middle()))t=He.OVERLAP_SAME;else if(n.start.equalTo(o.end)&&n.end.equalTo(o.start)&&n.middle().equalTo(o.middle()))t=He.OVERLAP_OPPOSITE}if(this.overlap===void 0)this.overlap=t;if(e.overlap===void 0)e.overlap=t}svg(){if(this.shape instanceof He.Segment)return` L${this.shape.end.x},${this.shape.end.y}`;else if(this.shape instanceof He.Arc){let e=this.shape,t,n=e.counterClockwise?"1":"0";if(He.Utils.EQ(e.sweep,2*Math.PI)){let o=e.counterClockwise?1:-1,r=new He.Arc(e.pc,e.r,e.startAngle,e.startAngle+o*Math.PI,e.counterClockwise),i=new He.Arc(e.pc,e.r,e.startAngle+o*Math.PI,e.endAngle,e.counterClockwise);return t="0",` A${r.r},${r.r} 0 ${t},${n} ${r.end.x},${r.end.y}
                    A${i.r},${i.r} 0 ${t},${n} ${i.end.x},${i.end.y}`}else return t=e.sweep<=Math.PI?"0":"1",` A${e.r},${e.r} 0 ${t},${n} ${e.end.x},${e.end.y}`}}toJSON(){return this.shape.toJSON()}}class Nie{constructor(e){this.circle=e}get inversion_circle(){return this.circle}static inversePoint(e,t){let n=new Ufe(e.pc,t),o=e.r*e.r,r=n.dot(n);return PLe.EQ_0(r)?new e9t(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY):e.pc.translate(n.multiply(o/r))}static inverseCircle(e,t){let n=e.pc.distanceTo(t.pc)[0];if(PLe.EQ(n,t.r)){let o=e.r*e.r/(2*t.r),r=new Ufe(e.pc,t.pc);r=r.normalize();let i=e.pc.translate(r.multiply(o));return new ZIt(i,r)}else{let o=new Ufe(e.pc,t.pc),r=e.r*e.r/(o.dot(o)-t.r*t.r),i=e.pc.translate(o.multiply(r)),s=Math.abs(r)*t.r;return new SLe(i,s)}}static inverseLine(e,t){let[n,o]=e.pc.distanceTo(t);if(PLe.EQ_0(n))return t.clone();else{let r=e.r*e.r/(2*n),i=new Ufe(e.pc,o.end);return i=i.multiply(r/n),new SLe(e.pc.translate(i),r)}}inverse(e){if(e instanceof e9t)return Nie.inversePoint(this.circle,e);else if(e instanceof SLe)return Nie.inverseCircle(this.circle,e);else if(e instanceof ZIt)return Nie.inverseLine(this.circle,e)}}class qr{static point2point(e,t){return e.distanceTo(t)}static point2line(e,t){let n=e.projectionOn(t);return[new He.Vector(e,n).length,new He.Segment(e,n)]}static point2circle(e,t){let[n,o]=e.distanceTo(t.center);if(He.Utils.EQ_0(n))return[t.r,new He.Segment(e,t.toArc().start)];else{let r=Math.abs(n-t.r),i=new He.Vector(t.pc,e).normalize().multiply(t.r),s=t.pc.translate(i);return[r,new He.Segment(e,s)]}}static point2segment(e,t){if(t.start.equalTo(t.end))return qr.point2point(e,t.start);let n=new He.Vector(t.start,t.end),o=new He.Vector(t.start,e),r=new He.Vector(t.end,e),i=n.dot(o),s=-n.dot(r),a,c;if(He.Utils.GE(i,0)&&He.Utils.GE(s,0)){let l=t.tangentInStart();return a=Math.abs(l.cross(o)),c=t.start.translate(l.multiply(l.dot(o))),[a,new He.Segment(e,c)]}else if(i<0)return e.distanceTo(t.start);else return e.distanceTo(t.end)}static point2arc(e,t){let n=new He.Circle(t.pc,t.r),o=[],r,i;if([r,i]=qr.point2circle(e,n),i.end.on(t))o.push(qr.point2circle(e,n));return o.push(qr.point2point(e,t.start)),o.push(qr.point2point(e,t.end)),qr.sort(o),o[0]}static point2edge(e,t){return t.shape instanceof He.Segment?qr.point2segment(e,t.shape):qr.point2arc(e,t.shape)}static segment2line(e,t){let n=e.intersect(t);if(n.length>0)return[0,new He.Segment(n[0],n[0])];let o=[];return o.push(qr.point2line(e.start,t)),o.push(qr.point2line(e.end,t)),qr.sort(o),o[0]}static segment2segment(e,t){let n=Kfe(e,t);if(n.length>0)return[0,new He.Segment(n[0],n[0])];let o=[],r,i;return[r,i]=qr.point2segment(t.start,e),o.push([r,i.reverse()]),[r,i]=qr.point2segment(t.end,e),o.push([r,i.reverse()]),o.push(qr.point2segment(e.start,t)),o.push(qr.point2segment(e.end,t)),qr.sort(o),o[0]}static segment2circle(e,t){let n=e.intersect(t);if(n.length>0)return[0,new He.Segment(n[0],n[0])];let o=new He.Line(e.ps,e.pe),[r,i]=qr.point2line(t.center,o);if(He.Utils.GE(r,t.r)&&i.end.on(e))return qr.point2circle(i.end,t);else{let[s,a]=qr.point2circle(e.start,t),[c,l]=qr.point2circle(e.end,t);return He.Utils.LT(s,c)?[s,a]:[c,l]}}static segment2arc(e,t){let n=e.intersect(t);if(n.length>0)return[0,new He.Segment(n[0],n[0])];let o=new He.Line(e.ps,e.pe),r=new He.Circle(t.pc,t.r),[i,s]=qr.point2line(r.center,o);if(He.Utils.GE(i,r.r)&&s.end.on(e)){let[h,d]=qr.point2circle(s.end,r);if(d.end.on(t))return[h,d]}let a=[];a.push(qr.point2arc(e.start,t)),a.push(qr.point2arc(e.end,t));let c,l;return[c,l]=qr.point2segment(t.start,e),a.push([c,l.reverse()]),[c,l]=qr.point2segment(t.end,e),a.push([c,l.reverse()]),qr.sort(a),a[0]}static circle2circle(e,t){let n=e.intersect(t);if(n.length>0)return[0,new He.Segment(n[0],n[0])];if(e.center.equalTo(t.center)){let o=e.toArc(),r=t.toArc();return qr.point2point(o.start,r.start)}else{let o=new He.Line(e.center,t.center),r=o.intersect(e),i=o.intersect(t),s=[];return s.push(qr.point2point(r[0],i[0])),s.push(qr.point2point(r[0],i[1])),s.push(qr.point2point(r[1],i[0])),s.push(qr.point2point(r[1],i[1])),qr.sort(s),s[0]}}static circle2line(e,t){let n=e.intersect(t);if(n.length>0)return[0,new He.Segment(n[0],n[0])];let[o,r]=qr.point2line(e.center,t),[i,s]=qr.point2circle(r.end,e);return s=s.reverse(),[i,s]}static arc2line(e,t){let n=t.intersect(e);if(n.length>0)return[0,new He.Segment(n[0],n[0])];let o=new He.Circle(e.center,e.r),[r,i]=qr.point2line(o.center,t);if(He.Utils.GE(r,o.r)){let[s,a]=qr.point2circle(i.end,o);if(a.end.on(e))return[s,a]}else{let s=[];return s.push(qr.point2line(e.start,t)),s.push(qr.point2line(e.end,t)),qr.sort(s),s[0]}}static arc2circle(e,t){let n=e.intersect(t);if(n.length>0)return[0,new He.Segment(n[0],n[0])];let o=new He.Circle(e.center,e.r),[r,i]=qr.circle2circle(o,t);if(i.start.on(e))return[r,i];else{let s=[];return s.push(qr.point2circle(e.start,t)),s.push(qr.point2circle(e.end,t)),qr.sort(s),s[0]}}static arc2arc(e,t){let n=e.intersect(t);if(n.length>0)return[0,new He.Segment(n[0],n[0])];let o=new He.Circle(e.center,e.r),r=new He.Circle(t.center,t.r),[i,s]=qr.circle2circle(o,r);if(s.start.on(e)&&s.end.on(t))return[i,s];else{let a=[],c,l;if([c,l]=qr.point2arc(e.start,t),l.end.on(t))a.push([c,l]);if([c,l]=qr.point2arc(e.end,t),l.end.on(t))a.push([c,l]);if([c,l]=qr.point2arc(t.start,e),l.end.on(e))a.push([c,l.reverse()]);if([c,l]=qr.point2arc(t.end,e),l.end.on(e))a.push([c,l.reverse()]);return[c,l]=qr.point2point(e.start,t.start),a.push([c,l]),[c,l]=qr.point2point(e.start,t.end),a.push([c,l]),[c,l]=qr.point2point(e.end,t.start),a.push([c,l]),[c,l]=qr.point2point(e.end,t.end),a.push([c,l]),qr.sort(a),a[0]}}static point2polygon(e,t){let n=[Number.POSITIVE_INFINITY,new He.Segment];for(let o of t.edges){let[r,i]=qr.point2edge(e,o);if(He.Utils.LT(r,n[0]))n=[r,i]}return n}static shape2polygon(e,t){let n=[Number.POSITIVE_INFINITY,new He.Segment];for(let o of t.edges){let[r,i]=e.distanceTo(o.shape);if(He.Utils.LT(r,n[0]))n=[r,i]}return n}static polygon2polygon(e,t){let n=[Number.POSITIVE_INFINITY,new He.Segment];for(let o of e.edges)for(let r of t.edges){let[i,s]=o.shape.distanceTo(r.shape);if(He.Utils.LT(i,n[0]))n=[i,s]}return n}static box2box_minmax(e,t){let n=Math.max(Math.max(e.xmin-t.xmax,0),Math.max(t.xmin-e.xmax,0)),o=Math.max(Math.max(e.ymin-t.ymax,0),Math.max(t.ymin-e.ymax,0)),r=n*n+o*o,i=e.merge(t),s=i.xmax-i.xmin,a=i.ymax-i.ymin,c=s*s+a*a;return[r,c]}static minmax_tree_process_level(e,t,n,o){let r,i;for(let l of t){[r,i]=qr.box2box_minmax(e.box,l.item.key);for(let h of l.item.values)if(h instanceof He.Edge)o.insert([r,i],h.shape);else o.insert([r,i],h);if(He.Utils.LT(i,n))n=i}if(t.length===0)return n;let s=t.map((l)=>l.left.isNil()?void 0:l.left).filter((l)=>l!==void 0),a=t.map((l)=>l.right.isNil()?void 0:l.right).filter((l)=>l!==void 0),c=[...s,...a].filter((l)=>{let[h,d]=qr.box2box_minmax(e.box,l.max);return He.Utils.LE(h,n)});return n=qr.minmax_tree_process_level(e,c,n,o),n}static minmax_tree(e,t,n){let o=new Qie,r=[t.index.root],i=n<Number.POSITIVE_INFINITY?n*n:Number.POSITIVE_INFINITY;return i=qr.minmax_tree_process_level(e,r,i,o),o}static minmax_tree_calc_distance(e,t,n){let o,r;if(t!=null&&!t.isNil()){if([o,r]=qr.minmax_tree_calc_distance(e,t.left,n),r)return[o,r];if(He.Utils.LT(o[0],Math.sqrt(t.item.key.low)))return[o,!0];let[i,s]=qr.distanceToArray(e,t.item.values);if(He.Utils.LT(i,o[0]))o=[i,s];return[o,r]=qr.minmax_tree_calc_distance(e,t.right,o),[o,r]}return[n,!1]}static shape2planarSet(e,t,n=Number.POSITIVE_INFINITY){let o=[n,new He.Segment],r=!1;if(t instanceof He.PlanarSet){let i=qr.minmax_tree(e,t,n);[o,r]=qr.minmax_tree_calc_distance(e,i.root,o)}return o}static sort(e){e.sort((t,n)=>{if(He.Utils.LT(t[0],n[0]))return-1;if(He.Utils.GT(t[0],n[0]))return 1;return 0})}static distance(e,t){return e.distanceTo(t)}static distanceToArray(e,t){let n=[Number.POSITIVE_INFINITY,new He.Segment];for(let o of t){let[r,i]=e.distanceTo(o);if(He.Utils.LT(r,n[0]))n=[r,i]}return n}static shape2multiline(e,t){let n=[Number.POSITIVE_INFINITY,new He.Segment];for(let o of t){let[r,i]=qr.distance(e,o.shape);if(He.Utils.LT(r,n[0]))n=[r,i]}return n}static multiline2multiline(e,t){let n=[Number.POSITIVE_INFINITY,new He.Segment];for(let o of e)for(let r of t){let[i,s]=qr.distance(o.shape,r.shape);if(He.Utils.LT(i,n[0]))n=[i,s]}return n}}function YLe(e){return new B9t(e.split(" ").map(Number))}function D9t(e){return e.split(", ").map(YLe)}function GLe(e){let t=D9t(e),n=[];for(let o=0;o<t.length-1;o++)n.push(new uSo(t[o],t[o+1]));return new dSo(n)}function pSo(e){return e.replace(/\(\(/,"").replace(/\)\)$/,"").split("), (").map(GLe)}function N9t(e){let t=e.replace(/\(\(/,"").replace(/\)\)$/,"").split("), ("),n=new T9t,o;return t.forEach((r,i)=>{let s=r.split(", ").map((c)=>new B9t(c.split(" ").map(Number))),a=n.addFace(s);if(i===0)o=a.orientation();else if(a.orientation()===o)a.reverse()}),n}function mSo(e){let n=e.split(/\)\), \(\(/).map((i)=>"(("+i+"))").map(N9t),o=new T9t;return n.reduce((i,s)=>[...i,...s?.faces],[]).forEach((i)=>o.addFace([...i?.shapes])),o}function _So(e){if(e.startsWith("POLYGON")){let t=e.replace(/^POLYGON /,"");return N9t(t)}else{let t=e.replace(/^MULTIPOLYGON \(\(\((.*)\)\)\)$/,"$1");return mSo(t)}}function gSo(e){return e.split(`
`).map((n)=>n.match(/\(([^)]+)\)/)[1]).map(YLe)}function ASo(e){return e.split(`
`).map((n)=>n.match(/\(([^)]+)\)/)[1]).map(GLe).reduce((n,o)=>[...n,...o],[])}function R9t(e){if(e.startsWith("POINT")){let t=e.replace(/^POINT \(/,"").replace(/\)$/,"");return YLe(t)}else if(e.startsWith("MULTIPOINT")){let t=e.replace(/^MULTIPOINT \(/,"").replace(/\)$/,"");return D9t(t)}else if(e.startsWith("LINESTRING")){let t=e.replace(/^LINESTRING \(/,"").replace(/\)$/,"");return GLe(t)}else if(e.startsWith("MULTILINESTRING")){let t=e.replace(/^MULTILINESTRING /,"");return pSo(t)}else if(e.startsWith("POLYGON")||e.startsWith("MULTIPOLYGON"))return _So(e);else if(e.startsWith("GEOMETRYCOLLECTION")){let t=/(?<type>POINT|LINESTRING|POLYGON|MULTIPOINT|MULTILINESTRING|MULTIPOLYGON) \((?:[^\(\)]|\([^\)]*\))*\)/g,n=e.match(t);if(n[0].startsWith("GEOMETRYCOLLECTION"))n[0]=n[0].replace("GEOMETRYCOLLECTION (","");return n.map(R9t).map((r)=>r instanceof Array?r:[r]).reduce((r,i)=>[...r,...i],[])}else if(Q9t(e))return gSo(e);else if(k9t(e))return ASo(e);return[]}function Q9t(e){return e.split(`
`)?.every((t)=>t.includes("POINT"))}function k9t(e){return e.split(`
`)?.every((t)=>t.includes("LINESTRING"))}function fSo(e){return e.startsWith("POINT")||Q9t(e)||e.startsWith("LINESTRING")||k9t(e)||e.startsWith("MULTILINESTRING")||e.startsWith("POLYGON")||e.startsWith("MULTIPOINT")||e.startsWith("MULTIPOLYGON")||e.startsWith("GEOMETRYCOLLECTION")}var Jz,g7o,Wfe,q7=0.000001,A7o=3,p3,He,Xfe,VIt,oO,T7o=(...e)=>new He.Multiline(...e),K7,$7,VA,R7o,Q7o,Gxs,WIt,XIt,qfe=1,Hie=2,eO=3,Mj,V7o,Y7o,G7o,U7o,W7o,tSo,nSo=(...e)=>new He.Matrix(...e),OLe,i2=1,ed=0,M9t,sa,P_=(...e)=>new He.Point(...e),Bj,iO=(...e)=>new He.Vector(...e),Fg,Jfe=(...e)=>new He.Segment(...e),Tie,oSo,rSo=(...e)=>new He.Line(...e),sO,iSo=(...e)=>new He.Circle(...e),Kp,sSo=(...e)=>new He.Arc(...e),YA,aSo=(...e)=>new He.Box(...e),w9t,xj,VLe,cSo=(...e)=>new He.Ray(...e),El=class e{constructor(){this.faces=new He.PlanarSet,this.edges=new He.PlanarSet;let t=[...arguments];if(t.length===1&&(t[0]instanceof Array&&t[0].length>0||t[0]instanceof He.Circle||t[0]instanceof He.Box)){let n=t[0];if(t[0]instanceof Array&&t[0].every((o)=>o instanceof Array))if(n.every((o)=>o instanceof Array&&o.length===2&&typeof o[0]==="number"&&typeof o[1]==="number"))this.faces.add(new He.Face(this,n));else for(let o of n)if(o instanceof Array&&o[0]instanceof Array&&o[0].every((r)=>r instanceof Array&&r.length===2&&typeof r[0]==="number"&&typeof r[1]==="number"))for(let r of o)this.faces.add(new He.Face(this,r));else this.faces.add(new He.Face(this,o));else this.faces.add(new He.Face(this,n))}}get box(){return[...this.faces].reduce((t,n)=>t.merge(n.box),new He.Box)}get vertices(){return[...this.faces].flatMap((t)=>t.vertices)}clone(){let t=new e;for(let n of this.faces)t.addFace(n.shapes);return t}createFromArray(t){let n=new e;return t.forEach((o)=>[...o.faces].forEach((r)=>n.addFace(r.shapes))),n}isEmpty(){return this.edges.size===0||this.faces.size===0}isValid(){let t=!0;for(let n of this.faces)if(!n.isSimple(this.edges)){t=!1;break}return t}area(){let t=[...this.faces].reduce((n,o)=>n+o.signedArea(),0);return Math.abs(t)}addFace(...t){let n=new He.Face(this,...t);return this.faces.add(n),n}deleteFace(t){for(let n of t)this.edges.delete(n);return this.faces.delete(t)}recreateFaces(){this.faces.clear();for(let o of this.edges)o.face=null;let t,n=!0;while(n){n=!1;for(let o of this.edges)if(o.face===null){t=o,n=!0;break}if(n){let o=t;do o=o.next;while(o.next!==t);this.addFace(t,o)}}}removeChain(t,n,o){if(o.next===n){this.deleteFace(t);return}for(let r=n;r!==o.next;r=r.next)if(t.remove(r),this.edges.delete(r),t.isEmpty()){this.deleteFace(t);break}}addVertex(t,n){let o=n.shape.split(t);if(o[0]===null)return n.prev;if(o[1]===null)return n;let r=new He.Edge(o[0]),i=n.prev;return n.face.insert(r,i),this.edges.delete(n),this.edges.add(r),n.shape=o[1],this.edges.add(n),r}removeEndVertex(t){let n=t.next;if(n===t)return;t.face.merge_with_next_edge(t),this.edges.delete(n)}cut(t){let o=this.splitToIslands().flatMap((r)=>r._cutSingleIsland(t)).filter((r)=>r.isValid()&&r.isEmpty()===!1);return this.createFromArray(o)}_cutSingleIsland(t){let n=this.clone(),o=t.clone(),r={int_points1:[],int_points2:[],int_points1_sorted:[],int_points2_sorted:[]};for(let a of o.edges)for(let c of n.edges){let l=u9t(a,c);for(let h of l)bj(a,h,r.int_points1),bj(c,h,r.int_points2)}if(r.int_points1.length===0)return n;r.int_points1_sorted=ER(r.int_points1),r.int_points2_sorted=ER(r.int_points2),vj(o,r.int_points1_sorted),vj(n,r.int_points2_sorted),zLe(r),r.int_points1_sorted=ER(r.int_points1),r.int_points2_sorted=ER(r.int_points2),MLe(r.int_points1),wLe(r.int_points1,n);for(let a of r.int_points1_sorted)if(a.edge_before&&a.edge_after&&a.edge_before.bv===a.edge_after.bv)r.int_points2[a.id]=-1,a.id=-1;if(r.int_points1=r.int_points1.filter((a)=>a.id>=0),r.int_points2=r.int_points2.filter((a)=>a.id>=0),r.int_points1.forEach((a,c)=>{a.id=c}),r.int_points2.forEach((a,c)=>{a.id=c}),r.int_points1.length===0)return n;r.int_points1_sorted=ER(r.int_points1),r.int_points2_sorted=ER(r.int_points2);let i,s;for(let a=1;a<r.int_points1_sorted.length;a++)if(s=r.int_points1_sorted[a],i=r.int_points1_sorted[a-1],s.edge_before&&s.edge_before.bv===1){let c=i.edge_after,l=s.edge_before,h=o.getChain(c,l);UIt(r.int_points2[i.id],r.int_points2[s.id],h),h.forEach((d)=>n.edges.add(d)),h=h.reverse().map((d)=>new He.Edge(d.shape.reverse()));for(let d=0;d<h.length-1;d++)h[d].next=h[d+1],h[d+1].prev=h[d];UIt(r.int_points2[s.id],r.int_points2[i.id],h),h.forEach((d)=>n.edges.add(d))}return n.recreateFaces(),n}cutWithLine(t){let n=new oO([t]);return this.cut(n)}findEdgeByPoint(t){let n;for(let o of this.faces)if(n=o.findEdgeByPoint(t),n!==void 0)break;return n}splitToIslands(){if(this.isEmpty())return[];let t=this.toArray();t.sort((r,i)=>i.area()-r.area());let n=[...t[0].faces][0].orientation(),o=t.filter((r)=>[...r.faces][0].orientation()===n);for(let r of t){let i=[...r.faces][0];if(i.orientation()===n)continue;for(let s of o)if(i.shapes.every((a)=>s.contains(a))){s.addFace(i.shapes);break}}return o}rearrange(){if(this.faces.size<=1)return this.clone();let t=this.splitToIslands(),n=new e;return t.forEach((o)=>{o.faces.forEach((r)=>n.addFace(r.shapes))}),n}orientation(){if(this.isEmpty())return Jz.NOT_ORIENTABLE;return[...this.faces][0].orientation()}isOuter(t){return t.orientation()===this.orientation()}isMultiPolygon(){let t=0;return this.faces.forEach((n)=>{if(this.isOuter(n))t++}),t>1}reverse(){for(let t of this.faces)t.reverse();return this}contains(t){if(t instanceof He.Point){let n=Die(this,t);return n===1||n===2}else return P9t(this,t)}distanceTo(t){if(t instanceof He.Point){let[n,o]=He.Distance.point2polygon(t,this);return o=o.reverse(),[n,o]}if(t instanceof He.Circle||t instanceof He.Line||t instanceof He.Segment||t instanceof He.Arc){let[n,o]=He.Distance.shape2polygon(t,this);return o=o.reverse(),[n,o]}if(t instanceof He.Box)return this.distanceTo(new He.Polygon(t));if(t instanceof He.Polygon){let n=[Number.POSITIVE_INFINITY,new He.Segment],o,r;for(let i of this.edges){let s=n[0];if([o,r]=He.Distance.shape2planarSet(i.shape,t.edges,s),He.Utils.LT(o,s))n=[o,r]}return n}}intersect(t){if(t instanceof He.Point)return this.contains(t)?[t]:[];if(t instanceof He.Line)return Lie(t,this);if(t instanceof He.Ray)return A9t(t,this);if(t instanceof He.Circle)return d9t(t,this);if(t instanceof He.Segment)return kLe(t,this);if(t instanceof He.Arc)return LLe(t,this);if(t instanceof He.Polygon)return P7o(t,this);if(t instanceof He.Multiline)return S7o(t,this)}translate(t){let n=new e;for(let o of this.faces)n.addFace(o.shapes.map((r)=>r.translate(t)));return n}rotate(t=0,n=new He.Point){let o=new e;for(let r of this.faces)o.addFace(r.shapes.map((i)=>i.rotate(t,n)));return o}scale(t,n){let o=new e;for(let r of this.faces)o.addFace(r.shapes.map((i)=>i.scale(t,n)));return o}transform(t=new He.Matrix){let n=new e;for(let o of this.faces)n.addFace(o.shapes.map((r)=>r.transform(t)));return n}toJSON(){return[...this.faces].map((t)=>t.toJSON())}toArray(){return[...this.faces].map((t)=>t.toPolygon())}dpath(){return[...this.faces].reduce((t,n)=>t+n.svg(),"")}svg(t={}){let n=`
<path ${tO({fillRule:"evenodd",fill:"lightcyan",...t})} d="`;for(let o of this.faces)n+=`
${o.svg()}`;return n+=`" >
</path>`,n}},lSo=(...e)=>new He.Polygon(...e),SLe,ZIt,e9t,Ufe,PLe,hSo=(e)=>new He.Inversion(e),dSo,B9t,uSo,T9t;var $p=ba(()=>{Jz={CCW:-1,CW:1,NOT_ORIENTABLE:0},g7o=2*Math.PI,Wfe=Object.freeze({__proto__:null,BOUNDARY:2,CCW:!0,CONTAINS:3,CW:!1,END_VERTEX:2,INSIDE:1,INTERLACE:4,NOT_VERTEX:0,ORIENTATION:Jz,OUTSIDE:0,OVERLAP_OPPOSITE:2,OVERLAP_SAME:1,PIx2:g7o,START_VERTEX:1});p3=Object.freeze({__proto__:null,DECIMALS:A7o,EQ:Zz,EQ_0:ELe,GE:f7o,GT:o9t,LE:y7o,LT:r9t,getTolerance:n9t,setTolerance:t9t}),He={Utils:p3,Errors:void 0,Matrix:void 0,Planar_set:void 0,Point:void 0,Vector:void 0,Line:void 0,Circle:void 0,Segment:void 0,Arc:void 0,Box:void 0,Edge:void 0,Face:void 0,Ray:void 0,Ray_shooting:void 0,Multiline:void 0,Polygon:void 0,Distance:void 0,Inversion:void 0};for(let e in Wfe)He[e]=Wfe[e];Object.defineProperty(He,"DP_TOL",{get:function(){return n9t()},set:function(e){t9t(e)}});He.Errors=wu;Xfe=class Xfe{constructor(e,t){this.first=e,this.last=t||this.first}[Symbol.iterator](){let e=void 0;return{next:()=>(e=e?e.next:this.first,{value:e,done:e===void 0})}}get size(){let e=0;for(let t of this)e++;return e}toArray(e=void 0,t=void 0){let n=[],o=e||this.first,r=t||this.last,i=o;if(i===void 0)return n;do n.push(i),i=i.next;while(i!==r.next);return n}append(e){if(this.isEmpty())this.first=e;else e.prev=this.last,this.last.next=e;return this.last=e,this.last.next=void 0,this.first.prev=void 0,this}insert(e,t){if(this.isEmpty())this.first=e,this.last=e;else if(t===null||t===void 0)e.next=this.first,this.first.prev=e,this.first=e;else{let n=t.next;if(t.next=e,n)n.prev=e;if(e.prev=t,e.next=n,this.last===t)this.last=e}return this.last.next=void 0,this.first.prev=void 0,this}remove(e){if(e===this.first&&e===this.last)this.first=void 0,this.last=void 0;else{if(e.prev)e.prev.next=e.next;if(e.next)e.next.prev=e.prev;if(e===this.first)this.first=e.next;if(e===this.last)this.last=e.prev}return this}isEmpty(){return this.first===void 0}static testInfiniteLoop(e){let t=e,n=e;do{if(t!=e&&t===n)throw wu.INFINITE_LOOP;t=t.next,n=n.next.next}while(t!=e)}};VIt={stroke:"black"};oO=class e extends Xfe{constructor(...t){super();if(this.isInfinite=!1,t.length===1&&t[0]instanceof Array&&t[0].length>0){let n=t[0],o=n.length,r=(c)=>c instanceof He.Segment||c instanceof He.Arc||c instanceof He.Ray||c instanceof He.Line,i=(c)=>c instanceof He.Segment||c instanceof He.Arc||c instanceof He.Ray,s=(c)=>c instanceof He.Segment||c instanceof He.Arc;if(o===1&&r(n[0])||o>1&&i(n[0])&&i(n[o-1])&&n.slice(1,o-1).every(s)){this.isInfinite=n.some((c)=>c instanceof He.Ray||c instanceof He.Line);for(let c of n){let l=new He.Edge(c);this.append(l)}this.setArcLength()}else throw He.Errors.ILLEGAL_PARAMETERS}}get edges(){return[...this]}get box(){return this.edges.reduce((t,n)=>t.merge(n.box),new He.Box)}get vertices(){let t=this.edges.map((n)=>n.start);return t.push(this.last.end),t}get length(){if(this.isEmpty())return 0;if(this.isInfinite)return Number.POSITIVE_INFINITY;let t=0;for(let n of this)t+=n.length;return t}clone(){return new e(this.toShapes())}setArcLength(){for(let t of this)this.setOneEdgeArcLength(t)}setOneEdgeArcLength(t){if(t===this.first)t.arc_length=0;else t.arc_length=t.prev.arc_length+t.prev.length}pointAtLength(t){if(t>this.length||t<0)return null;if(this.isInfinite)return null;let n=null;for(let o of this)if(t>=o.arc_length&&(o===this.last||t<o.next.arc_length)){n=o.pointAtLength(t-o.arc_length);break}return n}addVertex(t,n){let o=n.shape.split(t);if(o[0]===null)return n.prev;if(o[1]===null)return n;let r=new He.Edge(o[0]),i=n.prev;return this.insert(r,i),n.shape=o[1],r}getChain(t,n){let o=[];for(let r=t;r!==n.next;r=r.next)o.push(r);return o}split(t){for(let n of t){let o=this.findEdgeByPoint(n);this.addVertex(n,o)}return this}findEdgeByPoint(t){let n;for(let o of this)if(o.shape.contains(t)){n=o;break}return n}distanceTo(t){if(t instanceof He.Point){let[n,o]=He.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof He.Line){let[n,o]=He.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof He.Circle){let[n,o]=He.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof He.Segment){let[n,o]=He.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof He.Arc){let[n,o]=He.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof He.Box){let[n,o]=He.Distance.shape2multiline(new He.Polygon(t),this);return[n,o.reverse()]}if(t instanceof He.Multiline)return He.Distance.multiline2multiline(this,t);throw He.Errors.UNSUPPORTED_SHAPE_TYPE}intersect(t){if(t instanceof He.Multiline)return B7o(this,t);else return Ej(t,this)}contains(t){if(t instanceof He.Point)return this.edges.some((n)=>n.shape.contains(t));throw He.Errors.UNSUPPORTED_SHAPE_TYPE}translate(t){return new e(this.edges.map((n)=>n.shape.translate(t)))}rotate(t=0,n=new He.Point){return new e(this.edges.map((o)=>o.shape.rotate(t,n)))}transform(t=new He.Matrix){return new e(this.edges.map((n)=>n.shape.transform(t)))}toShapes(){return this.edges.map((t)=>t.shape.clone())}toJSON(){return this.edges.map((t)=>t.toJSON())}svgPoints(){return this.vertices.map((t)=>`${t.x},${t.y}`).join(" ")}dpath(){let t=`M${this.first.start.x},${this.first.start.y}`;for(let n of this)t+=n.svg();return t}svg(t={}){let n=`
<path ${tO({fill:"none",...t})} d="`;n+=`
M${this.first.start.x},${this.first.start.y}`;for(let o of this)n+=o.svg();return n+=`" >
</path>`,n}};He.Multiline=oO;He.multiline=T7o;({INSIDE:K7,OUTSIDE:$7,BOUNDARY:VA,OVERLAP_SAME:R7o,OVERLAP_OPPOSITE:Q7o}=Wfe),{NOT_VERTEX:Gxs,START_VERTEX:WIt,END_VERTEX:XIt}=Wfe;Mj=Object.freeze({__proto__:null,BOOLEAN_INTERSECT:Hie,BOOLEAN_SUBTRACT:eO,BOOLEAN_UNION:qfe,calculateIntersections:C9t,innerClip:x9t,intersect:y9t,outerClip:TLe,removeNotRelevantChains:DLe,removeOldFaces:NLe,restoreFaces:RLe,subtract:BLe,unify:k7o}),V7o=RegExp("T.F..FFF.|T.F...F.."),Y7o=RegExp("T........|.T.......|...T.....|....T...."),G7o=RegExp("FT.......|F..T.....|F...T...."),U7o=RegExp("T.F..F..."),W7o=RegExp("T.F..F...|.TF..F...|..FT.F...|..F.TF...");tSo=Object.freeze({__proto__:null,contain:$7o,cover:P9t,covered:S9t,disjoint:K7o,equal:X7o,inside:v9t,intersect:I9t,relate:wj,touch:j7o});He.Matrix=s2;He.matrix=nSo;OLe=class OLe extends E9t{clone(){return new OLe(this.low,this.high)}};M9t=class M9t extends Set{constructor(e){super(e);this.index=new Qie,this.forEach((t)=>this.index.insert(t))}add(e){let t=this.size,{key:n,value:o}=e,r=n||e.box,i=o||e;if(super.add(i),this.size>t)this.index.insert(r,i);return this}delete(e){let{key:t,value:n}=e,o=t||e.box,r=n||e,i=super.delete(r);if(i)this.index.remove(o,r);return i}clear(){super.clear(),this.index=new Qie}search(e){return this.index.search(e)}hit(e){let t=new He.Box(e.x-1,e.y-1,e.x+1,e.y+1);return this.index.search(t).filter((o)=>e.on(o))}svg(){return[...this].reduce((t,n)=>t+n.svg(),"")}};He.PlanarSet=M9t;sa=class e extends Sw{constructor(...t){super();if(this.x=0,this.y=0,t.length===0)return;if(t.length===1&&t[0]instanceof Array&&t[0].length===2){let n=t[0];if(typeof n[0]=="number"&&typeof n[1]=="number"){this.x=n[0],this.y=n[1];return}}if(t.length===1&&t[0]instanceof Object&&t[0].name==="point"){let{x:n,y:o}=t[0];this.x=n,this.y=o;return}if(t.length===2){if(typeof t[0]=="number"&&typeof t[1]=="number"){this.x=t[0],this.y=t[1];return}}throw wu.ILLEGAL_PARAMETERS}get box(){return new He.Box(this.x,this.y,this.x,this.y)}clone(){return new He.Point(this.x,this.y)}get vertices(){return[this.clone()]}equalTo(t){return He.Utils.EQ(this.x,t.x)&&He.Utils.EQ(this.y,t.y)}lessThan(t){if(He.Utils.LT(this.y,t.y))return!0;if(He.Utils.EQ(this.y,t.y)&&He.Utils.LT(this.x,t.x))return!0;return!1}transform(t){return new He.Point(t.transform([this.x,this.y]))}projectionOn(t){if(this.equalTo(t.pt))return this.clone();let n=new He.Vector(this,t.pt);if(He.Utils.EQ_0(n.cross(t.norm)))return t.pt.clone();let o=n.dot(t.norm),r=t.norm.multiply(o);return this.translate(r)}leftTo(t){let n=new He.Vector(t.pt,this);return He.Utils.GT(n.dot(t.norm),0)}distanceTo(t){if(t instanceof e){let n=t.x-this.x,o=t.y-this.y;return[Math.sqrt(n*n+o*o),new He.Segment(this,t)]}if(t instanceof He.Line)return He.Distance.point2line(this,t);if(t instanceof He.Circle)return He.Distance.point2circle(this,t);if(t instanceof He.Segment)return He.Distance.point2segment(this,t);if(t instanceof He.Arc)return He.Distance.point2arc(this,t);if(t instanceof He.Box)return He.Distance.point2polygon(this,new He.Polygon(t));if(t instanceof He.Polygon)return He.Distance.point2polygon(this,t);if(t instanceof He.PlanarSet)return He.Distance.shape2planarSet(this,t);if(t instanceof He.Multiline)return He.Distance.shape2multiline(this,t)}on(t){if(t instanceof He.Point)return this.equalTo(t);if(t.contains&&t.contains instanceof Function)return t.contains(this);throw He.Errors.UNSUPPORTED_SHAPE_TYPE}get name(){return"point"}svg(t={}){let n=t.r??3;return`
<circle cx="${this.x}" cy="${this.y}" r="${n}"
            ${tO({fill:"red",...t})} />`}};He.Point=sa;He.point=P_;Bj=class extends Sw{constructor(...t){super();if(this.x=0,this.y=0,t.length===0)return;if(t.length===1&&t[0]instanceof Array&&t[0].length===2){let n=t[0];if(typeof n[0]=="number"&&typeof n[1]=="number"){this.x=n[0],this.y=n[1];return}}if(t.length===1&&t[0]instanceof Object&&t[0].name==="vector"){let{x:n,y:o}=t[0];this.x=n,this.y=o;return}if(t.length===1&&t[0]instanceof Object&&t[0].name==="segment"){let{start:n,end:o}=t[0];this.x=o.x-n.x,this.y=o.y-n.y;return}if(t.length===2){let n=t[0],o=t[1];if(typeof n=="number"&&typeof o=="number"){this.x=n,this.y=o;return}if(n instanceof He.Point&&o instanceof He.Point){this.x=o.x-n.x,this.y=o.y-n.y;return}}throw wu.ILLEGAL_PARAMETERS}clone(){return new He.Vector(this.x,this.y)}get slope(){let t=Math.atan2(this.y,this.x);if(t<0)t=2*Math.PI+t;return t}get length(){return Math.sqrt(this.dot(this))}isZeroLength(){return He.Utils.EQ_0(this.length)}equalTo(t){return He.Utils.EQ(this.x,t.x)&&He.Utils.EQ(this.y,t.y)}multiply(t){return new He.Vector(t*this.x,t*this.y)}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}normalize(){if(this.isZeroLength())throw wu.ZERO_DIVISION;return new He.Vector(this.x/this.length,this.y/this.length)}rotate(t,n=new He.Point){if(n.x===0&&n.y===0)return this.transform(new s2().rotate(t));throw wu.OPERATION_IS_NOT_SUPPORTED}transform(t){return new He.Vector(t.transform([this.x,this.y]))}rotate90CCW(){return new He.Vector(-this.y,this.x)}rotate90CW(){return new He.Vector(this.y,-this.x)}invert(){return new He.Vector(-this.x,-this.y)}add(t){return new He.Vector(this.x+t.x,this.y+t.y)}subtract(t){return new He.Vector(this.x-t.x,this.y-t.y)}angleTo(t){let n=this.normalize(),o=t.normalize(),r=Math.atan2(n.cross(o),n.dot(o));if(r<0)r+=2*Math.PI;return r}projectionOn(t){let n=t.normalize(),o=this.dot(n);return n.multiply(o)}get name(){return"vector"}};He.Vector=Bj;He.vector=iO;Fg=class e extends Sw{constructor(...t){super();if(this.ps=new He.Point,this.pe=new He.Point,t.length===0)return;if(t.length===1&&t[0]instanceof Array&&t[0].length===4){let n=t[0];this.ps=new He.Point(n[0],n[1]),this.pe=new He.Point(n[2],n[3]);return}if(t.length===1&&t[0]instanceof Object&&t[0].name==="segment"){let{ps:n,pe:o}=t[0];this.ps=new He.Point(n.x,n.y),this.pe=new He.Point(o.x,o.y);return}if(t.length===1&&t[0]instanceof He.Point){this.ps=t[0].clone();return}if(t.length===2&&t[0]instanceof He.Point&&t[1]instanceof He.Point){this.ps=t[0].clone(),this.pe=t[1].clone();return}if(t.length===4){this.ps=new He.Point(t[0],t[1]),this.pe=new He.Point(t[2],t[3]);return}throw wu.ILLEGAL_PARAMETERS}clone(){return new He.Segment(this.start,this.end)}get start(){return this.ps}get end(){return this.pe}get vertices(){return[this.ps.clone(),this.pe.clone()]}get length(){return this.start.distanceTo(this.end)[0]}get slope(){return new He.Vector(this.start,this.end).slope}get box(){return new He.Box(Math.min(this.start.x,this.end.x),Math.min(this.start.y,this.end.y),Math.max(this.start.x,this.end.x),Math.max(this.start.y,this.end.y))}equalTo(t){return this.ps.equalTo(t.ps)&&this.pe.equalTo(t.pe)}contains(t){return He.Utils.EQ_0(this.distanceToPoint(t))}intersect(t){if(t instanceof He.Point)return this.contains(t)?[t]:[];if(t instanceof He.Line)return kie(this,t);if(t instanceof He.Ray)return HLe(t,this);if(t instanceof He.Segment)return Kfe(this,t);if(t instanceof He.Circle)return $fe(this,t);if(t instanceof He.Box)return x7o(this,t);if(t instanceof He.Arc)return Pj(this,t);if(t instanceof He.Polygon)return kLe(this,t);if(t instanceof He.Multiline)return Ej(this,t)}distanceTo(t){if(t instanceof He.Point){let[n,o]=He.Distance.point2segment(t,this);return o=o.reverse(),[n,o]}if(t instanceof He.Circle){let[n,o]=He.Distance.segment2circle(this,t);return[n,o]}if(t instanceof He.Line){let[n,o]=He.Distance.segment2line(this,t);return[n,o]}if(t instanceof He.Segment){let[n,o]=He.Distance.segment2segment(this,t);return[n,o]}if(t instanceof He.Arc){let[n,o]=He.Distance.segment2arc(this,t);return[n,o]}if(t instanceof He.Box){let[n,o]=He.Distance.shape2polygon(this,new He.Polygon(t));return[n,o]}if(t instanceof He.Polygon){let[n,o]=He.Distance.shape2polygon(this,t);return[n,o]}if(t instanceof He.PlanarSet){let[n,o]=He.Distance.shape2planarSet(this,t);return[n,o]}if(t instanceof He.Multiline)return He.Distance.shape2multiline(this,t)}tangentInStart(){return new He.Vector(this.start,this.end).normalize()}tangentInEnd(){return new He.Vector(this.end,this.start).normalize()}reverse(){return new e(this.end,this.start)}split(t){if(this.start.equalTo(t))return[null,this.clone()];if(this.end.equalTo(t))return[this.clone(),null];return[new He.Segment(this.start,t),new He.Segment(t,this.end)]}middle(){return new He.Point((this.start.x+this.end.x)/2,(this.start.y+this.end.y)/2)}pointAtLength(t){if(t>this.length||t<0)return null;if(t==0)return this.start;if(t==this.length)return this.end;let n=t/this.length;return new He.Point((this.end.x-this.start.x)*n+this.start.x,(this.end.y-this.start.y)*n+this.start.y)}distanceToPoint(t){let[n,...o]=He.Distance.point2segment(t,this);return n}definiteIntegral(t=0){let n=this.end.x-this.start.x,o=this.start.y-t,r=this.end.y-t;return n*(o+r)/2}transform(t=new He.Matrix){return new e(this.ps.transform(t),this.pe.transform(t))}isZeroLength(){return this.ps.equalTo(this.pe)}sortPoints(t){return new He.Line(this.start,this.end).sortPoints(t)}get name(){return"segment"}svg(t={}){return`
<line x1="${this.start.x}" y1="${this.start.y}" x2="${this.end.x}" y2="${this.end.y}" ${tO(t)} />`}};He.Segment=Fg;He.segment=Jfe;({vector:Tie}=He),oSo=class e extends Sw{constructor(...t){super();if(this.pt=new He.Point,this.norm=new He.Vector(0,1),t.length===0)return;if(t.length===1&&t[0]instanceof Object&&t[0].name==="line"){let{pt:n,norm:o}=t[0];this.pt=new He.Point(n),this.norm=new He.Vector(o);return}if(t.length===2){let n=t[0],o=t[1];if(n instanceof He.Point&&o instanceof He.Point){if(this.pt=n,this.norm=e.points2norm(n,o),this.norm.dot(Tie(this.pt.x,this.pt.y))>=0)this.norm.invert();return}if(n instanceof He.Point&&o instanceof He.Vector){if(He.Utils.EQ_0(o.x)&&He.Utils.EQ_0(o.y))throw wu.ILLEGAL_PARAMETERS;if(this.pt=n.clone(),this.norm=o.clone(),this.norm=this.norm.normalize(),this.norm.dot(Tie(this.pt.x,this.pt.y))>=0)this.norm.invert();return}if(n instanceof He.Vector&&o instanceof He.Point){if(He.Utils.EQ_0(n.x)&&He.Utils.EQ_0(n.y))throw wu.ILLEGAL_PARAMETERS;if(this.pt=o.clone(),this.norm=n.clone(),this.norm=this.norm.normalize(),this.norm.dot(Tie(this.pt.x,this.pt.y))>=0)this.norm.invert();return}}throw wu.ILLEGAL_PARAMETERS}clone(){return new He.Line(this.pt,this.norm)}get start(){return}get end(){return}get length(){return Number.POSITIVE_INFINITY}get box(){return new He.Box(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY)}get middle(){return}get slope(){return new He.Vector(this.norm.y,-this.norm.x).slope}get standard(){let t=this.norm.x,n=this.norm.y,o=this.norm.dot(Tie(this.pt.x,this.pt.y));return[t,n,o]}parallelTo(t){return He.Utils.EQ_0(this.norm.cross(t.norm))}incidentTo(t){return this.parallelTo(t)&&this.pt.on(t)}contains(t){if(this.pt.equalTo(t))return!0;let n=new He.Vector(this.pt,t);return He.Utils.EQ_0(this.norm.dot(n))}coord(t){return Tie(t.x,t.y).cross(this.norm)}intersect(t){if(t instanceof He.Point)return this.contains(t)?[t]:[];if(t instanceof He.Line)return Sj(this,t);if(t instanceof He.Ray)return g9t(t,this);if(t instanceof He.Circle)return nO(this,t);if(t instanceof He.Box)return Cj(this,t);if(t instanceof He.Segment)return kie(t,this);if(t instanceof He.Arc)return jfe(this,t);if(t instanceof He.Polygon)return Lie(this,t);if(t instanceof He.Multiline)return Ej(this,t)}distanceTo(t){if(t instanceof He.Point){let[n,o]=He.Distance.point2line(t,this);return o=o.reverse(),[n,o]}if(t instanceof He.Circle){let[n,o]=He.Distance.circle2line(t,this);return o=o.reverse(),[n,o]}if(t instanceof He.Segment){let[n,o]=He.Distance.segment2line(t,this);return[n,o.reverse()]}if(t instanceof He.Arc){let[n,o]=He.Distance.arc2line(t,this);return[n,o.reverse()]}if(t instanceof He.Box){let[n,o]=He.Distance.shape2polygon(this,new He.Polygon(t));return[n,o]}if(t instanceof He.Polygon){let[n,o]=He.Distance.shape2polygon(this,t);return[n,o]}}split(t){if(t instanceof He.Point)return[new He.Ray(t,this.norm),new He.Ray(t,this.norm)];else{let n=new He.Multiline([this]),o=this.sortPoints(t);return n.split(o),n.toShapes()}}rotate(t,n=new He.Point){return new He.Line(this.pt.rotate(t,n),this.norm.rotate(t))}transform(t){return new He.Line(this.pt.transform(t),this.norm.clone())}sortPoints(t){return t.slice().sort((n,o)=>{if(this.coord(n)<this.coord(o))return-1;if(this.coord(n)>this.coord(o))return 1;return 0})}get name(){return"line"}svg(t,n={}){let o=Cj(this,t);if(o.length===0)return"";let r=o[0],i=o.length===2?o[1]:o.find((a)=>!a.equalTo(r));if(i===void 0)i=r;return new He.Segment(r,i).svg(n)}static points2norm(t,n){if(t.equalTo(n))throw wu.ILLEGAL_PARAMETERS;return new He.Vector(t,n).normalize().rotate90CCW()}};He.Line=oSo;He.line=rSo;sO=class extends Sw{constructor(...t){super();if(this.pc=new He.Point,this.r=1,t.length===1&&t[0]instanceof Object&&t[0].name==="circle"){let{pc:n,r:o}=t[0];this.pc=new He.Point(n),this.r=o}else{let[n,o]=[...t];if(n&&n instanceof He.Point)this.pc=n.clone();if(o!==void 0)this.r=o}}clone(){return new He.Circle(this.pc.clone(),this.r)}get center(){return this.pc}get box(){return new He.Box(this.pc.x-this.r,this.pc.y-this.r,this.pc.x+this.r,this.pc.y+this.r)}contains(t){if(t instanceof He.Point)return He.Utils.LE(t.distanceTo(this.center)[0],this.r);if(t instanceof He.Segment)return He.Utils.LE(t.start.distanceTo(this.center)[0],this.r)&&He.Utils.LE(t.end.distanceTo(this.center)[0],this.r);if(t instanceof He.Arc)return this.intersect(t).length===0&&He.Utils.LE(t.start.distanceTo(this.center)[0],this.r)&&He.Utils.LE(t.end.distanceTo(this.center)[0],this.r);if(t instanceof He.Circle)return this.intersect(t).length===0&&He.Utils.LE(t.r,this.r)&&He.Utils.LE(t.center.distanceTo(this.center)[0],this.r)}toArc(t=!0){return new He.Arc(this.center,this.r,Math.PI,-Math.PI,t)}scale(t,n){if(t!==n)throw wu.OPERATION_IS_NOT_SUPPORTED;if(!(this.pc.x===0&&this.pc.y===0))throw wu.OPERATION_IS_NOT_SUPPORTED;return new He.Circle(this.pc,this.r*t)}transform(t=new He.Matrix){return new He.Circle(this.pc.transform(t),this.r)}intersect(t){if(t instanceof He.Point)return this.contains(t)?[t]:[];if(t instanceof He.Line)return nO(t,this);if(t instanceof He.Ray)return _9t(t,this);if(t instanceof He.Segment)return $fe(t,this);if(t instanceof He.Circle)return s9t(t,this);if(t instanceof He.Box)return C7o(this,t);if(t instanceof He.Arc)return QLe(t,this);if(t instanceof He.Polygon)return d9t(this,t);if(t instanceof He.Multiline)return Ej(this,t)}distanceTo(t){if(t instanceof He.Point){let[n,o]=He.Distance.point2circle(t,this);return o=o.reverse(),[n,o]}if(t instanceof He.Circle){let[n,o]=He.Distance.circle2circle(this,t);return[n,o]}if(t instanceof He.Line){let[n,o]=He.Distance.circle2line(this,t);return[n,o]}if(t instanceof He.Segment){let[n,o]=He.Distance.segment2circle(t,this);return o=o.reverse(),[n,o]}if(t instanceof He.Arc){let[n,o]=He.Distance.arc2circle(t,this);return o=o.reverse(),[n,o]}if(t instanceof He.Box){let[n,o]=He.Distance.shape2polygon(this,new He.Polygon(t));return[n,o]}if(t instanceof He.Polygon){let[n,o]=He.Distance.shape2polygon(this,t);return[n,o]}if(t instanceof He.PlanarSet){let[n,o]=He.Distance.shape2planarSet(this,t);return[n,o]}if(t instanceof He.Multiline){let[n,o]=He.Distance.shape2multiline(this,t);return[n,o]}}get name(){return"circle"}svg(t={}){return`
<circle cx="${this.pc.x}" cy="${this.pc.y}" r="${this.r}"
                ${tO({fill:"none",...t})} />`}};He.Circle=sO;He.circle=iSo;Kp=class Kp extends Sw{constructor(...e){super();if(this.pc=new He.Point,this.r=1,this.startAngle=0,this.endAngle=2*Math.PI,this.counterClockwise=!0,e.length===0)return;if(e.length===1&&e[0]instanceof Object&&e[0].name==="arc"){let{pc:t,r:n,startAngle:o,endAngle:r,counterClockwise:i}=e[0];this.pc=new He.Point(t.x,t.y),this.r=n,this.startAngle=o,this.endAngle=r,this.counterClockwise=i}else{let[t,n,o,r,i]=[...e];if(t&&t instanceof He.Point)this.pc=t.clone();if(n!==void 0)this.r=n;if(o!==void 0)this.startAngle=o;if(r!==void 0)this.endAngle=r;if(i!==void 0)this.counterClockwise=i}}clone(){return new He.Arc(this.pc.clone(),this.r,this.startAngle,this.endAngle,this.counterClockwise)}get sweep(){let e=this.startAngle,t=this.endAngle;if(He.Utils.EQ(Math.abs(e-t),He.PIx2))return He.PIx2;if(Math.abs(e)>He.PIx2)e-=Math.trunc(e/He.PIx2)*He.PIx2;if(e<0)e+=He.PIx2;if(Math.abs(t)>He.PIx2)t-=Math.trunc(t/He.PIx2)*He.PIx2;if(t<0)t+=He.PIx2;let n=this.counterClockwise?t-e:e-t;if(n<0)n+=He.PIx2;return n}get start(){return new He.Point(this.pc.x+this.r,this.pc.y).rotate(this.startAngle,this.pc)}get end(){return new He.Point(this.pc.x+this.r,this.pc.y).rotate(this.endAngle,this.pc)}get center(){return this.pc.clone()}get vertices(){return[this.start.clone(),this.end.clone()]}get length(){return Math.abs(this.sweep*this.r)}get box(){let t=this.breakToFunctional().reduce((n,o)=>n.merge(o.start.box),new He.Box);return t=t.merge(this.end.box),t}contains(e){if(!He.Utils.EQ(this.pc.distanceTo(e)[0],this.r))return!1;if(e.equalTo(this.start))return!0;let t=new He.Vector(this.pc,e).slope,n=new He.Arc(this.pc,this.r,this.startAngle,t,this.counterClockwise);return He.Utils.LE(n.length,this.length)}split(e){if(this.start.equalTo(e))return[null,this.clone()];if(this.end.equalTo(e))return[this.clone(),null];let t=new He.Vector(this.pc,e).slope;return[new He.Arc(this.pc,this.r,this.startAngle,t,this.counterClockwise),new He.Arc(this.pc,this.r,t,this.endAngle,this.counterClockwise)]}middle(){let e=this.counterClockwise?this.startAngle+this.sweep/2:this.startAngle-this.sweep/2;return new He.Arc(this.pc,this.r,this.startAngle,e,this.counterClockwise).end}pointAtLength(e){if(e>this.length||e<0)return null;if(e===0)return this.start;if(e===this.length)return this.end;let t=e/this.length,n=this.counterClockwise?this.startAngle+this.sweep*t:this.startAngle-this.sweep*t;return new He.Arc(this.pc,this.r,this.startAngle,n,this.counterClockwise).end}chordHeight(){return(1-Math.cos(Math.abs(this.sweep/2)))*this.r}intersect(e){if(e instanceof He.Point)return this.contains(e)?[e]:[];if(e instanceof He.Line)return jfe(e,this);if(e instanceof He.Ray)return FLe(e,this);if(e instanceof He.Circle)return QLe(this,e);if(e instanceof He.Segment)return Pj(e,this);if(e instanceof He.Box)return b7o(this,e);if(e instanceof He.Arc)return a9t(this,e);if(e instanceof He.Polygon)return LLe(this,e);if(e instanceof He.Multiline)return Ej(this,e)}distanceTo(e){if(e instanceof He.Point){let[t,n]=He.Distance.point2arc(e,this);return n=n.reverse(),[t,n]}if(e instanceof He.Circle){let[t,n]=He.Distance.arc2circle(this,e);return[t,n]}if(e instanceof He.Line){let[t,n]=He.Distance.arc2line(this,e);return[t,n]}if(e instanceof He.Segment){let[t,n]=He.Distance.segment2arc(e,this);return n=n.reverse(),[t,n]}if(e instanceof He.Arc){let[t,n]=He.Distance.arc2arc(this,e);return[t,n]}if(e instanceof He.Box){let[t,n]=He.Distance.shape2polygon(this,new He.Polygon(e));return[t,n]}if(e instanceof He.Polygon){let[t,n]=He.Distance.shape2polygon(this,e);return[t,n]}if(e instanceof He.PlanarSet){let[t,n]=He.Distance.shape2planarSet(this,e);return[t,n]}if(e instanceof He.Multiline)return He.Distance.shape2multiline(this,e)}breakToFunctional(){let e=[],t=[0,Math.PI/2,Math.PI,3*Math.PI/2],n=this.startAngle,o=this.endAngle;if(He.Utils.EQ(Math.abs(n-o),He.PIx2))o=n;if(Math.abs(n)>He.PIx2)n-=Math.trunc(n/He.PIx2)*He.PIx2;if(n<0)n+=He.PIx2;if(Math.abs(o)>He.PIx2)o-=Math.trunc(o/He.PIx2)*He.PIx2;if(o<0)o+=He.PIx2;let r=n,i,s,a;if(this.counterClockwise)s=Math.ceil(n/(Math.PI/2))%4,a=1;else s=Math.floor(n/(Math.PI/2))%4,a=-1;for(let c=0,l=s;c<4;c++,l=(l+a+4)%4){if(i=t[l],i===r)continue;let h=this.counterClockwise?i-n:n-i;if(h<0)h+=He.PIx2;if(h>this.sweep)break;e.push(new He.Arc(this.pc,this.r,r,i,this.counterClockwise)),r=i}if(e.length===0)return e.push(this),e;if(i=o,r!==i)e.push(new He.Arc(this.pc,this.r,r,i,this.counterClockwise));return e}tangentInStart(){let e=new He.Vector(this.pc,this.start),t=this.counterClockwise?Math.PI/2:-Math.PI/2;return e.rotate(t).normalize()}tangentInEnd(){let e=new He.Vector(this.pc,this.end),t=this.counterClockwise?-Math.PI/2:Math.PI/2;return e.rotate(t).normalize()}reverse(){return new He.Arc(this.pc,this.r,this.endAngle,this.startAngle,!this.counterClockwise)}transform(e=new He.Matrix){let t=this.start.transform(e),n=this.end.transform(e),o=this.pc.transform(e),r=this.counterClockwise;if(e.a*e.d<0)r=!r;return He.Arc.arcSE(o,t,n,r)}static arcSE(e,t,n,o){let{vector:r}=He,i=r(e,t).slope,s=r(e,n).slope;if(He.Utils.EQ(i,s))s+=2*Math.PI,o=!0;let a=r(e,t).length;return new He.Arc(e,a,i,s,o)}definiteIntegral(e=0){return this.breakToFunctional().reduce((o,r)=>o+r.circularSegmentDefiniteIntegral(e),0)}circularSegmentDefiniteIntegral(e){let n=new He.Segment(this.start,this.end).definiteIntegral(e),o=He.Utils.EQ(this.sweep,He.PIx2)?0:this.circularSegmentArea();return this.counterClockwise?n-o:n+o}circularSegmentArea(){return 0.5*this.r*this.r*(this.sweep-Math.sin(this.sweep))}sortPoints(e){let{vector:t}=He;return e.slice().sort((n,o)=>{let r=t(this.pc,n).slope,i=t(this.pc,o).slope;if(r<i)return-1;if(r>i)return 1;return 0})}get name(){return"arc"}svg(e={}){let t=this.sweep<=Math.PI?"0":"1",n=this.counterClockwise?"1":"0";if(He.Utils.EQ(this.sweep,2*Math.PI))return new He.Circle(this.pc,this.r).svg(e);else return`
<path d="M${this.start.x},${this.start.y}
                             A${this.r},${this.r} 0 ${t},${n} ${this.end.x},${this.end.y}"
                    ${tO({fill:"none",...e})} />`}};He.Arc=Kp;He.arc=sSo;YA=class YA extends Sw{constructor(e=void 0,t=void 0,n=void 0,o=void 0){super();this.xmin=e,this.ymin=t,this.xmax=n,this.ymax=o}clone(){return new YA(this.xmin,this.ymin,this.xmax,this.ymax)}get low(){return new He.Point(this.xmin,this.ymin)}get high(){return new He.Point(this.xmax,this.ymax)}get max(){return this.clone()}get center(){return new He.Point((this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)}get width(){return Math.abs(this.xmax-this.xmin)}get height(){return Math.abs(this.ymax-this.ymin)}get box(){return this.clone()}not_intersect(e){return this.xmax<e.xmin||this.xmin>e.xmax||this.ymax<e.ymin||this.ymin>e.ymax}intersect(e){return!this.not_intersect(e)}merge(e){return new YA(this.xmin===void 0?e.xmin:Math.min(this.xmin,e.xmin),this.ymin===void 0?e.ymin:Math.min(this.ymin,e.ymin),this.xmax===void 0?e.xmax:Math.max(this.xmax,e.xmax),this.ymax===void 0?e.ymax:Math.max(this.ymax,e.ymax))}less_than(e){if(this.low.lessThan(e.low))return!0;if(this.low.equalTo(e.low)&&this.high.lessThan(e.high))return!0;return!1}equal_to(e){return this.low.equalTo(e.low)&&this.high.equalTo(e.high)}output(){return this.clone()}comparable_less_than(e,t){return e.lessThan(t)}set(e,t,n,o){this.xmin=e,this.ymin=t,this.xmax=n,this.ymax=o}extend(e){if(e<=0)return this.clone();return new YA(this.xmin-e,this.ymin-e,this.xmax+e,this.ymax+e)}toPoints(){return[new He.Point(this.xmin,this.ymin),new He.Point(this.xmax,this.ymin),new He.Point(this.xmax,this.ymax),new He.Point(this.xmin,this.ymax)]}toSegments(){let e=this.toPoints();return[new He.Segment(e[0],e[1]),new He.Segment(e[1],e[2]),new He.Segment(e[2],e[3]),new He.Segment(e[3],e[0])]}rotate(e,t=new He.Point){throw wu.OPERATION_IS_NOT_SUPPORTED}transform(e=new He.Matrix){return this.toPoints().map((n)=>n.transform(e)).reduce((n,o)=>n.merge(o.box),new YA)}contains(e){if(e instanceof He.Point)return e.x>=this.xmin&&e.x<=this.xmax&&e.y>=this.ymin&&e.y<=this.ymax;if(e instanceof He.Segment)return e.vertices.every((t)=>this.contains(t));if(e instanceof He.Box)return e.toSegments().every((t)=>this.contains(t));if(e instanceof He.Circle)return this.contains(e.box);if(e instanceof He.Arc)return e.vertices.every((t)=>this.contains(t))&&this.toSegments().every((t)=>Pj(t,e).length===0);if(e instanceof He.Line||e instanceof He.Ray)return!1;if(e instanceof He.Multiline)return e.toShapes().every((t)=>this.contains(t));if(e instanceof He.Polygon)return this.contains(e.box)}distanceTo(e){let t=this.toSegments().map((o)=>o.distanceTo(e)),n=[Number.MAX_SAFE_INTEGER,null];return t.forEach((o)=>{if(o[0]<n[0])n=o}),n}get name(){return"box"}svg(e={}){let t=this.xmax-this.xmin,n=this.ymax-this.ymin;return`
<rect x="${this.xmin}" y="${this.ymin}" width="${t}" height="${n}"
                ${tO({fill:"none",...e})} />`}};He.Box=YA;He.box=aSo;He.Edge=Zfe;w9t=class w9t extends Xfe{constructor(e,t){super(e,t);this.setCircularLinks()}setCircularLinks(){if(this.isEmpty())return;this.last.next=this.first,this.first.prev=this.last}[Symbol.iterator](){let e=void 0;return{next:()=>{let t=e?e:this.first,n=this.first?e?e===this.first:!1:!0;return e=t?t.next:void 0,{value:t,done:n}}}}append(e){return super.append(e),this.setCircularLinks(),this}insert(e,t){return super.insert(e,t),this.setCircularLinks(),this}remove(e){return super.remove(e),this}};xj=class xj extends w9t{constructor(e,...t){super();if(this._box=void 0,this._orientation=void 0,t.length===0)return;if(t.length===1){if(t[0]instanceof Array){let n=t[0];if(n.length===0)return;if(n.every((o)=>o instanceof He.Point)){let o=xj.points2segments(n);this.shapes2face(e.edges,o)}else if(n.every((o)=>o instanceof Array&&o.length===2)){let o=n.map((i)=>new He.Point(i[0],i[1])),r=xj.points2segments(o);this.shapes2face(e.edges,r)}else if(n.every((o)=>o instanceof He.Segment||o instanceof He.Arc))this.shapes2face(e.edges,n);else if(n.every((o)=>o.name==="segment"||o.name==="arc")){let o=[];for(let r of n){let i;if(r.name==="segment")i=new He.Segment(r);else i=new He.Arc(r);o.push(i)}this.shapes2face(e.edges,o)}}else if(t[0]instanceof xj){let n=t[0];this.first=n.first,this.last=n.last;for(let o of n)e.edges.add(o)}else if(t[0]instanceof He.Circle)this.shapes2face(e.edges,[t[0].toArc(!0)]);else if(t[0]instanceof He.Box){let n=t[0];this.shapes2face(e.edges,[new He.Segment(new He.Point(n.xmin,n.ymin),new He.Point(n.xmax,n.ymin)),new He.Segment(new He.Point(n.xmax,n.ymin),new He.Point(n.xmax,n.ymax)),new He.Segment(new He.Point(n.xmax,n.ymax),new He.Point(n.xmin,n.ymax)),new He.Segment(new He.Point(n.xmin,n.ymax),new He.Point(n.xmin,n.ymin))])}}if(t.length===2&&t[0]instanceof He.Edge&&t[1]instanceof He.Edge)this.first=t[0],this.last=t[1],this.last.next=this.first,this.first.prev=this.last,this.setArcLength()}get edges(){return this.toArray()}get vertices(){return this.edges.map((e)=>e.shape.start.clone())}get shapes(){return this.edges.map((e)=>e.shape.clone())}get box(){if(this._box===void 0){let e=new He.Box;for(let t of this)e=e.merge(t.box);this._box=e}return this._box}get perimeter(){return this.last.arc_length+this.last.length}pointAtLength(e){if(e>this.perimeter||e<0)return null;let t=null;for(let n of this)if(e>=n.arc_length&&(n===this.last||e<n.next.arc_length)){t=n.pointAtLength(e-n.arc_length);break}return t}static points2segments(e){let t=[];for(let n=0;n<e.length;n++){if(e[n].equalTo(e[(n+1)%e.length]))continue;t.push(new He.Segment(e[n],e[(n+1)%e.length]))}return t}shapes2face(e,t){for(let n of t){let o=new He.Edge(n);this.append(o),e.add(o)}}append(e){return super.append(e),this.setOneEdgeArcLength(e),e.face=this,this}insert(e,t){return super.insert(e,t),this.setOneEdgeArcLength(e),e.face=this,this}remove(e){return super.remove(e),this.setArcLength(),this}merge_with_next_edge(e){return e.shape.end.x=e.next.shape.end.x,e.shape.end.y=e.next.shape.end.y,this.remove(e.next),this}reverse(){let e=[],t=this.last;do t.shape=t.shape.reverse(),e.push(t),t=t.prev;while(t!==this.last);this.first=void 0,this.last=void 0;for(let n of e){if(this.first===void 0)n.prev=n,n.next=n,this.first=n,this.last=n;else n.prev=this.last,this.last.next=n,this.last=n,this.last.next=this.first,this.first.prev=this.last;this.setOneEdgeArcLength(n)}if(this._orientation!==void 0)this._orientation=void 0,this._orientation=this.orientation()}setArcLength(){for(let e of this)this.setOneEdgeArcLength(e),e.face=this}setOneEdgeArcLength(e){if(e===this.first)e.arc_length=0;else e.arc_length=e.prev.arc_length+e.prev.length}area(){return Math.abs(this.signedArea())}signedArea(){let e=0,t=this.box.ymin;for(let n of this)e+=n.shape.definiteIntegral(t);return e}orientation(){if(this._orientation===void 0){let e=this.signedArea();if(He.Utils.EQ_0(e))this._orientation=Jz.NOT_ORIENTABLE;else if(He.Utils.LT(e,0))this._orientation=Jz.CCW;else this._orientation=Jz.CW}return this._orientation}isSimple(e){return xj.getSelfIntersections(this,e,!0).length===0}static getSelfIntersections(e,t,n=!1){let o=[];for(let r of e){let i=t.search(r.box);for(let s of i){if(r===s)continue;if(s.face!==e)continue;if(r.shape instanceof He.Segment&&s.shape instanceof He.Segment&&(r.next===s||r.prev===s))continue;let a=r.shape.intersect(s.shape);for(let c of a){if(c.equalTo(r.start)&&c.equalTo(s.end)&&s===r.prev)continue;if(c.equalTo(r.end)&&c.equalTo(s.start)&&s===r.next)continue;if(o.push(c),n)break}if(o.length>0&&n)break}if(o.length>0&&n)break}return o}findEdgeByPoint(e){let t;for(let n of this){if(e.equalTo(n.shape.start))continue;if(e.equalTo(n.shape.end)||n.shape.contains(e)){t=n;break}}return t}toPolygon(){return new He.Polygon(this.shapes)}toJSON(){return this.edges.map((e)=>e.toJSON())}svg(){let e=`M${this.first.start.x},${this.first.start.y}`;for(let t of this)e+=t.svg();return e+=" z",e}};He.Face=xj;VLe=class VLe extends Sw{constructor(...e){super();if(this.pt=new He.Point,this.norm=new He.Vector(0,1),e.length===0)return;if(e.length>=1&&e[0]instanceof He.Point)this.pt=e[0].clone();if(e.length===1)return;if(e.length===2&&e[1]instanceof He.Vector){this.norm=e[1].clone();return}throw wu.ILLEGAL_PARAMETERS}clone(){return new VLe(this.pt,this.norm)}get slope(){return new He.Vector(this.norm.y,-this.norm.x).slope}get box(){let e=this.slope;return new He.Box(e>Math.PI/2&&e<3*Math.PI/2?Number.NEGATIVE_INFINITY:this.pt.x,e>=0&&e<=Math.PI?this.pt.y:Number.NEGATIVE_INFINITY,e>=Math.PI/2&&e<=3*Math.PI/2?this.pt.x:Number.POSITIVE_INFINITY,e>=Math.PI&&e<=2*Math.PI||e===0?this.pt.y:Number.POSITIVE_INFINITY)}get start(){return this.pt}get end(){return}get length(){return Number.POSITIVE_INFINITY}contains(e){if(this.pt.equalTo(e))return!0;let t=new He.Vector(this.pt,e);return He.Utils.EQ_0(this.norm.dot(t))&&He.Utils.GE(t.cross(this.norm),0)}coord(e){return iO(e.x,e.y).cross(this.norm)}split(e){if(!this.contains(e))return[];if(this.pt.equalTo(e))return[this];return[new He.Segment(this.pt,e),new He.Ray(e,this.norm)]}intersect(e){if(e instanceof He.Point)return this.contains(e)?[e]:[];if(e instanceof He.Segment)return HLe(this,e);if(e instanceof He.Arc)return FLe(this,e);if(e instanceof He.Line)return g9t(this,e);if(e instanceof He.Ray)return w7o(this,e);if(e instanceof He.Circle)return _9t(this,e);if(e instanceof He.Box)return M7o(this,e);if(e instanceof He.Polygon)return A9t(this,e);if(e instanceof He.Multiline)return Ej(this,e)}rotate(e,t=new He.Point){return new He.Ray(this.pt.rotate(e,t),this.norm.rotate(e))}transform(e){return new He.Ray(this.pt.transform(e),this.norm.clone())}get name(){return"ray"}svg(e,t={}){let n=new He.Line(this.pt,this.norm),o=Cj(n,e);if(o=o.filter((i)=>this.contains(i)),o.length===0||o.length===2)return"";return new He.Segment(this.pt,o[0]).svg(t)}};He.Ray=VLe;He.ray=cSo;He.Polygon=El;He.polygon=lSo;({Circle:SLe,Line:ZIt,Point:e9t,Vector:Ufe,Utils:PLe}=He);He.Inversion=Nie;He.inversion=hSo;He.Distance=qr;({Multiline:dSo,Point:B9t,Segment:uSo,Polygon:T9t}=He);He.isWktString=fSo;He.parseWKT=R9t;He.BooleanOperations=Mj;He.Relations=tSo});function L9t(e,t,n){if(!t||!n)return;let o=e.get(t);if(!o)o=new Set,e.set(t,o);o.add(n);let r=e.get(n);if(!r)r=new Set,e.set(n,r);r.add(t)}function Rj(e,t){if(!t.subcircuit_id&&!t.source_group_id)return[...e];let n=t;if(t.subcircuit_id){let a=new Set([t.subcircuit_id]),c=new Map,l=new Map;for(let d of e)if(d.type==="source_group"){let{source_group_id:u,subcircuit_id:_}=d;if(_)l.set(u,_);let p=d.parent_source_group_id;if(p){if(!c.has(p))c.set(p,[]);c.get(p).push(u)}}let h;for(let[d,u]of l)if(u===t.subcircuit_id){h=d;break}if(h){let d=(u)=>{let _=c.get(u)||[];for(let p of _){let m=l.get(p);if(m)a.add(m);d(p)}};d(h),n={...t,subcircuit_ids:Array.from(a)}}}let o=new Map;for(let a of e){let c=`${a.type}_id`,l=a[c];if(typeof l==="string")o.set(l,a)}let r=new Map;for(let a of e){let c=Object.entries(a);for(let[l,h]of c){if(l==="parent_source_group_id")continue;if(l.endsWith("_id")&&typeof h==="string"){let d=o.get(h);L9t(r,a,d)}else if(l.endsWith("_ids")&&Array.isArray(h)){for(let d of h)if(typeof d==="string"){let u=o.get(d);L9t(r,a,u)}}}}let i=[],s=new Set;for(let a of e){let c=!1;if(n.subcircuit_id&&"subcircuit_id"in a&&a.subcircuit_id===n.subcircuit_id)c=!0;else if(n.subcircuit_ids&&"subcircuit_id"in a&&a.subcircuit_id&&n.subcircuit_ids.includes(a.subcircuit_id))c=!0;else if(n.source_group_id&&"source_group_id"in a&&a.source_group_id===n.source_group_id)c=!0;else if(n.source_group_id&&"member_source_group_ids"in a&&Array.isArray(a.member_source_group_ids)&&a.member_source_group_ids.includes(n.source_group_id))c=!0;if(c)i.push(a),s.add(a)}while(i.length>0){let a=i.shift(),c=r.get(a);if(!c)continue;for(let l of c)if(!s.has(l))s.add(l),i.push(l)}return e.filter((a)=>s.has(a))}function ULe(e){let t=e.type;return`${t}:${e[`${t}_id`]}`}function wSo(e,t){let n=Qy(e).pcb_smtpad.get(t);if(!n||!n.pcb_port_id)return`smtpad[${t}]`;return j9t(e,n.pcb_port_id)}function BSo(e,t){let n=Qy(e).pcb_trace.get(t);if(!n)return`trace[${t}]`;let o=n.route.flatMap((s)=>[s.start_pcb_port_id,s.end_pcb_port_id]).filter(Boolean);if(o.length===0)return`trace[${t}]`;function r(s){let a=Qy(e).pcb_port.get(s);if(!a)return null;let c=a.pcb_component_id?Qy(e).pcb_component.get(a.pcb_component_id):void 0;if(!c)return null;let l=Qy(e).source_component.get(c.source_component_id);if(!l)return null;let h=Qy(e).source_port.get(a.source_port_id),d=h?.port_hints?h.port_hints[1]:"";return{componentName:l.name,portHint:d}}return`trace[${o.map((s)=>{let a=r(s);if(a)return`.${a.componentName} > port.${a.portHint}`;return`port[${s}]`}).join(", ")}]`}function n2e(e){let t=new Map,n=new Map,o=new Map;for(let c of e)switch(c.type){case"pcb_board":o.set(c.pcb_board_id,c);break;case"source_group":{let l=c.parent_subcircuit_id??c.parent_source_group_id;if(n.set(c.source_group_id,c.subcircuit_id??l),c.is_subcircuit&&c.subcircuit_id)n.set(c.subcircuit_id,l);break}case"pcb_group":n.set(c.pcb_group_id,c.subcircuit_id??c.source_group_id);break;case"pcb_component":n.set(c.pcb_component_id,c.subcircuit_id??c.pcb_group_id);break;case"pcb_trace":n.set(c.pcb_trace_id,c.subcircuit_id??c.pcb_group_id??c.pcb_component_id);break;case"pcb_via":n.set(c.pcb_via_id,c.subcircuit_id??c.pcb_group_id??c.pcb_trace_id);break}let r=[...o.values()];for(let c of r)if(t.set(c.pcb_board_id,c),c.subcircuit_id)t.set(c.subcircuit_id,c);let i=r.length===1?r[0]:void 0,s=new Set;function a(c){if(t.has(c))return t.get(c);if(!n.has(c))return;if(s.has(c))return;s.add(c);let l=n.get(c),h=i;if(l)h=a(l);return s.delete(c),t.set(c,h),h}for(let c of n.keys())a(c);return t}function LSo(e){let t=0;if(e.length==0)return t;for(var n=0;n<e.length;n++){var o=e.charCodeAt(n);t=(t<<5)-t+o,t=t&t}return Math.abs(t)}function s2e(e,t={}){if(e.length===0)return{width:0,height:0};let n=t.direction??"row",o=t.columnGap??0,r=t.rowGap??0;if(n==="row"||n==="row-reverse"){let a=e.reduce((l,h)=>l+h.width,0)+o*Math.max(0,e.length-1),c=e.reduce((l,h)=>Math.max(l,h.height),0);return{width:a,height:c}}else{let a=e.reduce((l,h)=>l+h.height,0)+r*Math.max(0,e.length-1);return{width:e.reduce((l,h)=>Math.max(l,h.width),0),height:a}}}function a2e(e){if(e.type==="pcb_smtpad")return[`${e.layer}_copper`];if(e.type==="pcb_trace"){if(!e.route||!Array.isArray(e.route))return[];let t=new Set;for(let n of e.route)if("layer"in n&&n.layer)t.add(`${n.layer}_copper`);return Array.from(t)}if(e.type==="pcb_copper_pour")return[`${e.layer}_copper`];if(e.type==="pcb_copper_text")return[`${e.layer}_copper`];if(e.type==="pcb_silkscreen_text"||e.type==="pcb_silkscreen_rect"||e.type==="pcb_silkscreen_circle"||e.type==="pcb_silkscreen_line"||e.type==="pcb_silkscreen_path")return[`${e.layer}_silkscreen`];if(e.type==="pcb_fabrication_note_text"||e.type==="pcb_fabrication_note_rect"||e.type==="pcb_fabrication_note_path")return[`${e.layer}_fabrication_note`];if(e.type==="pcb_courtyard_circle"||e.type==="pcb_courtyard_polygon"||e.type==="pcb_courtyard_rect"||e.type==="pcb_courtyard_outline")return[`${e.layer}_courtyard`];if(e.type==="pcb_note_rect"||e.type==="pcb_note_path"||e.type==="pcb_note_text"||e.type==="pcb_note_line"||e.type==="pcb_note_dimension")return[`${e.layer}_user_note`];return[]}var _a,q9t,J9t,evt,nvt,Qj,Qy=(e,t={})=>{let n=e,o=n._internal_store;if(!o){o={counts:{},editCount:0},n._internal_store=o;for(let i of n){let s=i.type,a=i[`${s}_id`];if(!a)continue;let c=Number.parseInt(a.split("_").pop());if(!Number.isNaN(c))o.counts[s]=Math.max(o.counts[s]??0,c)}}let r=new Proxy({},{get:(i,s)=>{if(s==="toArray")return()=>(n.editCount=o.editCount,n);if(s==="editCount")return o.editCount;if(s==="subtree")return(c)=>Qy(Rj(n,c),t);if(s==="insert")return(c)=>{let l=c.type;if(!l)throw Error("insert requires an element with a type");o.counts[l]??=-1,o.counts[l]++;let h=o.counts[l],d={...c,type:l,[`${l}_id`]:`${l}_${h}`};if(t.validateInserts)(PR[l]??SR).parse(d);return n.push(d),o.editCount++,d};if(s==="insertAll")return(c)=>c.map((l)=>r.insert(l));let a=s;return{get:(c)=>n.find((l)=>l.type===a&&l[`${a}_id`]===c),getUsing:(c)=>{let l=Object.keys(c);if(l.length!==1)throw Error("getUsing requires exactly one key, e.g. { pcb_component_id }");let h=l[0],d=h.replace("_id",""),u=n.find((_)=>_.type===d&&_[h]===c[h]);if(!u)return null;return n.find((_)=>_.type===a&&_[`${a}_id`]===u[`${a}_id`])},getWhere:(c)=>{let l=Object.keys(c);return n.find((h)=>h.type===a&&l.every((d)=>h[d]===c[d]))},list:(c)=>{let l=!c?[]:Object.keys(c);return n.filter((h)=>h.type===a&&l.every((d)=>h[d]===c[d]))},insert:(c)=>{o.counts[a]??=-1,o.counts[a]++;let l=o.counts[a],h={type:a,[`${a}_id`]:`${a}_${l}`,...c};if(t.validateInserts)(PR[a]??SR).parse(h);return n.push(h),o.editCount++,h},delete:(c)=>{let l=n.find((h)=>h[`${a}_id`]===c);if(!l)return;n.splice(n.indexOf(l),1),o.editCount++},update:(c,l)=>{let h=n.find((d)=>d.type===a&&d[`${a}_id`]===c);if(!h)return null;return Object.assign(h,l),o.editCount++,h},select:(c)=>{if(a==="source_component")return n.find((l)=>l.type==="source_component"&&l.name===c.replace(/\./g,""));else if(a==="pcb_port"||a==="source_port"||a==="schematic_port"){let[l,h]=c.replace(/\./g,"").split(/[\s\>]+/),d=n.find((_)=>_.type==="source_component"&&_.name===l);if(!d)return null;let u=n.find((_)=>_.type==="source_port"&&_.source_component_id===d.source_component_id&&(_.name===h||(_.port_hints??[]).includes(h)));if(!u)return null;if(a==="source_port")return u;if(a==="pcb_port")return n.find((_)=>_.type==="pcb_port"&&_.source_port_id===u.source_port_id);else if(a==="schematic_port")return n.find((_)=>_.type==="schematic_port"&&_.source_port_id===u.source_port_id)}}}}});return r},Vo,Ps,t2e=(e,t={})=>{let n=e._internal_store_indexed;if(!n){n={counts:{},editCount:0,indexes:{}};for(let s of e){let a=s.type,c=s[`${a}_id`];if(!c)continue;let l=Number.parseInt(c.split("_").pop()||"");if(!Number.isNaN(l))n.counts[a]=Math.max(n.counts[a]??0,l)}let r=t.indexConfig||{},i=n.indexes;if(r.byId)i.byId=new Map;if(r.byType)i.byType=new Map;if(r.byRelation)i.byRelation=new Map;if(r.bySubcircuit)i.bySubcircuit=new Map;if(r.byCustomField&&r.byCustomField.length>0){i.byCustomField=new Map;for(let s of r.byCustomField)i.byCustomField.set(s,new Map)}for(let s of e){if(r.byId){let a=ULe(s);i.byId.set(a,s)}if(r.byType){let a=i.byType.get(s.type)||[];a.push(s),i.byType.set(s.type,a)}if(r.byRelation){let a=Object.entries(s);for(let[c,l]of a)if(c.endsWith("_id")&&c!==`${s.type}_id`&&typeof l==="string"){let h=i.byRelation.get(c)||new Map,d=h.get(l)||[];d.push(s),h.set(l,d),i.byRelation.set(c,h)}}if(r.bySubcircuit&&"subcircuit_id"in s){let a=s.subcircuit_id;if(a&&typeof a==="string"){let c=i.bySubcircuit.get(a)||[];c.push(s),i.bySubcircuit.set(a,c)}}if(r.byCustomField&&i.byCustomField){for(let a of r.byCustomField)if(a in s){let c=s[a];if(c!==void 0&&(typeof c==="string"||typeof c==="number")){let l=String(c),h=i.byCustomField.get(a),d=h.get(l)||[];d.push(s),h.set(l,d)}}}}e._internal_store_indexed=n}let o=new Proxy({},{get:(r,i)=>{if(i==="toArray")return()=>(e.editCount=n.editCount,e);if(i==="editCount")return n.editCount;if(i==="insert")return(a)=>{let{type:c,...l}=a;if(!c)throw Error("insert requires an element with a type");return delete l[`${c}_id`],o[c].insert(l)};if(i==="insertAll")return(a)=>a.map((c)=>o.insert(c));if(i==="subtree")return(a)=>t2e(Rj(e,a),t);let s=i;return{get:(a)=>{let c=t.indexConfig||{};if(c.byId&&n.indexes.byId)return n.indexes.byId.get(`${s}:${a}`)||null;if(c.byType&&n.indexes.byType)return(n.indexes.byType.get(s)||[]).find((h)=>h[`${s}_id`]===a)||null;return e.find((l)=>l.type===s&&l[`${s}_id`]===a)||null},getUsing:(a)=>{let c=t.indexConfig||{},l=Object.keys(a);if(l.length!==1)throw Error("getUsing requires exactly one key, e.g. { pcb_component_id }");let h=l[0],d=h.replace("_id","");if(c.byRelation&&n.indexes.byRelation){let _=n.indexes.byRelation.get(h);if(_){let m=(_.get(a[h])||[]).find((g)=>g.type===d);if(!m)return null;let A=m[`${s}_id`];if(c.byId&&n.indexes.byId)return n.indexes.byId.get(`${s}:${A}`)||null;if(c.byType&&n.indexes.byType)return(n.indexes.byType.get(s)||[]).find((f)=>f[`${s}_id`]===A)||null;return e.find((g)=>g.type===s&&g[`${s}_id`]===A)||null}}let u=e.find((_)=>_.type===d&&_[h]===a[h]);if(!u)return null;return e.find((_)=>_.type===s&&_[`${s}_id`]===u[`${s}_id`])||null},getWhere:(a)=>{let c=t.indexConfig||{},l=Object.keys(a);if(l.length===1&&c.byCustomField&&n.indexes.byCustomField){let h=l[0],d=n.indexes.byCustomField.get(h);if(d){let u=String(a[h]);return(d.get(u)||[]).find((p)=>p.type===s)||null}}if("subcircuit_id"in a&&c.bySubcircuit&&n.indexes.bySubcircuit){let h=a.subcircuit_id;return(n.indexes.bySubcircuit.get(h)||[]).find((u)=>u.type===s&&l.every((_)=>u[_]===a[_]))||null}if(c.byType&&n.indexes.byType)return(n.indexes.byType.get(s)||[]).find((d)=>l.every((u)=>d[u]===a[u]))||null;return e.find((h)=>h.type===s&&l.every((d)=>h[d]===a[d]))||null},list:(a)=>{let c=t.indexConfig||{},l=!a?[]:Object.keys(a);if(l.length===0&&c.byType&&n.indexes.byType)return(n.indexes.byType.get(s)||[]).slice();if(l.length===1&&l[0]==="subcircuit_id"&&c.bySubcircuit&&n.indexes.bySubcircuit){let d=a.subcircuit_id;return(n.indexes.bySubcircuit.get(d)||[]).filter((_)=>_.type===s)}let h;if(c.byType&&n.indexes.byType)h=n.indexes.byType.get(s)||[];else h=e.filter((d)=>d.type===s);if(l.length>0)return h.filter((d)=>l.every((u)=>d[u]===a[u]));return h.slice()},insert:(a)=>{n.counts[s]??=-1,n.counts[s]++;let c=n.counts[s],l={type:s,[`${s}_id`]:`${s}_${c}`,...a};if(t.validateInserts)(PR[s]??SR).parse(l);e.push(l),n.editCount++;let h=t.indexConfig||{};if(h.byId&&n.indexes.byId){let d=ULe(l);n.indexes.byId.set(d,l)}if(h.byType&&n.indexes.byType){let d=n.indexes.byType.get(s)||[];d.push(l),n.indexes.byType.set(s,d)}if(h.byRelation&&n.indexes.byRelation){let d=Object.entries(l);for(let[u,_]of d)if(u.endsWith("_id")&&u!==`${l.type}_id`&&typeof _==="string"){let p=n.indexes.byRelation.get(u)||new Map,m=p.get(_)||[];m.push(l),p.set(_,m),n.indexes.byRelation.set(u,p)}}if(h.bySubcircuit&&n.indexes.bySubcircuit&&"subcircuit_id"in l){let d=l.subcircuit_id;if(d&&typeof d==="string"){let u=n.indexes.bySubcircuit.get(d)||[];u.push(l),n.indexes.bySubcircuit.set(d,u)}}if(h.byCustomField&&n.indexes.byCustomField){for(let d of h.byCustomField)if(d in l){let u=l[d];if(u!==void 0&&(typeof u==="string"||typeof u==="number")){let _=String(u),p=n.indexes.byCustomField.get(d),m=p.get(_)||[];m.push(l),p.set(_,m)}}}return l},delete:(a)=>{let c=t.indexConfig||{},l;if(c.byId&&n.indexes.byId)l=n.indexes.byId.get(`${s}:${a}`);else if(c.byType&&n.indexes.byType)l=(n.indexes.byType.get(s)||[]).find((u)=>u[`${s}_id`]===a);else l=e.find((d)=>d[`${s}_id`]===a);if(!l)return;let h=e.indexOf(l);if(h>=0)e.splice(h,1),n.editCount++;if(c.byId&&n.indexes.byId){let d=ULe(l);n.indexes.byId.delete(d)}if(c.byType&&n.indexes.byType){let u=(n.indexes.byType.get(s)||[]).filter((_)=>_[`${s}_id`]!==a);n.indexes.byType.set(s,u)}if(c.byRelation&&n.indexes.byRelation)for(let[d,u]of n.indexes.byRelation.entries())for(let[_,p]of u.entries()){let m=p.filter((A)=>A!==l);if(m.length===0)u.delete(_);else u.set(_,m)}if(c.bySubcircuit&&n.indexes.bySubcircuit&&"subcircuit_id"in l){let d=l.subcircuit_id;if(d){let _=(n.indexes.bySubcircuit.get(d)||[]).filter((p)=>p!==l);if(_.length===0)n.indexes.bySubcircuit.delete(d);else n.indexes.bySubcircuit.set(d,_)}}if(c.byCustomField&&n.indexes.byCustomField)for(let d of n.indexes.byCustomField.values())for(let[u,_]of d.entries()){let p=_.filter((m)=>m!==l);if(p.length===0)d.delete(u);else d.set(u,p)}},update:(a,c)=>{let l=t.indexConfig||{},h;if(l.byId&&n.indexes.byId)h=n.indexes.byId.get(`${s}:${a}`);else if(l.byType&&n.indexes.byType)h=(n.indexes.byType.get(s)||[]).find((u)=>u[`${s}_id`]===a);else h=e.find((d)=>d.type===s&&d[`${s}_id`]===a);if(!h)return null;if(l.byRelation&&n.indexes.byRelation){let d=Object.entries(h);for(let[u,_]of d)if(u.endsWith("_id")&&u!==`${h.type}_id`&&typeof _==="string"){if(u in c&&c[u]!==_){let p=n.indexes.byRelation.get(u);if(p){let A=(p.get(_)||[]).filter((g)=>g!==h);if(A.length===0)p.delete(_);else p.set(_,A)}}}}if(l.bySubcircuit&&n.indexes.bySubcircuit&&"subcircuit_id"in h&&"subcircuit_id"in c){let d=h.subcircuit_id,u=c.subcircuit_id;if(d!==u){let p=(n.indexes.bySubcircuit.get(d)||[]).filter((m)=>m!==h);if(p.length===0)n.indexes.bySubcircuit.delete(d);else n.indexes.bySubcircuit.set(d,p)}}if(l.byCustomField&&n.indexes.byCustomField){for(let d of l.byCustomField)if(d in h&&d in c&&h[d]!==c[d]){let u=n.indexes.byCustomField.get(d);if(u){let _=String(h[d]),m=(u.get(_)||[]).filter((A)=>A!==h);if(m.length===0)u.delete(_);else u.set(_,m)}}}if(Object.assign(h,c),n.editCount++,l.byRelation&&n.indexes.byRelation){let d=Object.entries(h);for(let[u,_]of d)if(u.endsWith("_id")&&u!==`${h.type}_id`&&typeof _==="string"){if(u in c){let p=n.indexes.byRelation.get(u)||new Map,m=p.get(_)||[];if(!m.includes(h))m.push(h),p.set(_,m),n.indexes.byRelation.set(u,p)}}}if(l.bySubcircuit&&n.indexes.bySubcircuit&&"subcircuit_id"in h&&"subcircuit_id"in c){let d=h.subcircuit_id;if(d&&typeof d==="string"){let u=n.indexes.bySubcircuit.get(d)||[];if(!u.includes(h))u.push(h),n.indexes.bySubcircuit.set(d,u)}}if(l.byCustomField&&n.indexes.byCustomField){for(let d of l.byCustomField)if(d in h&&d in c){let u=h[d];if(u!==void 0&&(typeof u==="string"||typeof u==="number")){let _=String(u),p=n.indexes.byCustomField.get(d),m=p.get(_)||[];if(!m.includes(h))m.push(h),p.set(_,m)}}}return h},select:(a)=>{if(s==="source_component")return e.find((c)=>c.type==="source_component"&&c.name===a.replace(/\./g,""))||null;else if(s==="pcb_port"||s==="source_port"||s==="schematic_port"){let[c,l]=a.replace(/\./g,"").split(/[\s\>]+/),h=e.find((u)=>u.type==="source_component"&&u.name===c);if(!h)return null;let d=e.find((u)=>u.type==="source_port"&&u.source_component_id===h.source_component_id&&(u.name===l||(u.port_hints??[]).includes(l)));if(!d)return null;if(s==="source_port")return d;if(s==="pcb_port")return e.find((u)=>u.type==="pcb_port"&&u.source_port_id===d.source_port_id)||null;else if(s==="schematic_port")return e.find((u)=>u.type==="schematic_port"&&u.source_port_id===d.source_port_id)||null}return null}}}});return o},KLe,ySo=(e)=>{if(e==="up")return"right";else if(e==="right")return"down";else if(e==="down")return"left";else if(e==="left")return"up";throw Error(`Invalid direction: ${e}`)},xSo=(e)=>{if(e==="up")return"left";else if(e==="left")return"down";else if(e==="down")return"right";else if(e==="right")return"up";throw Error(`Invalid direction: ${e}`)},CSo=(e,t)=>{while(t>0)e=ySo(e),t--;while(t<0)e=xSo(e),t++;return e},G9t=(e)=>{if(e==="top"||e==="up")return"bottom";else if(e==="bottom"||e==="down")return"top";else if(e==="left")return"right";else if(e==="right")return"left";throw Error(`Invalid sideOrDir: ${e}`)},U9t=(e)=>Math.round(e/(Math.PI/2)),bSo=(e)=>{switch(e){case"from_left":return{x:-1,y:0};case"from_right":return{x:1,y:0};case"from_top":return{x:0,y:1};case"from_bottom":return{x:0,y:-1}}},ISo=({x:e,y:t})=>{if(e>0)return"from_right";if(e<0)return"from_left";if(t>0)return"from_top";return"from_bottom"},vSo=(e,t)=>{if(!e)return e;if(e==="from_above"||e==="from_below"){if(!t.isFlipped)return e;return e==="from_above"?"from_below":"from_above"}let{x:n,y:o}=bSo(e),r=Math.round(t.rotationDegrees/90);while(r>0)[n,o]=[-o,n],r--;while(r<0)[n,o]=[o,-n],r++;if(t.isFlipped)o=-o;return ISo({x:n,y:o})},SSo=(e,t)=>{if(e.type==="schematic_component")e.center=_a.applyToPoint(t,e.center);else if(e.type==="schematic_port"){if(e.center=_a.applyToPoint(t,e.center),e.facing_direction)e.facing_direction=CSo(e.facing_direction,-(Math.atan2(t.b,t.a)/Math.PI)*2)}else if(e.type==="schematic_text")e.position=_a.applyToPoint(t,e.position);else if(e.type==="schematic_trace"){let n=e;if(n.route=(n.route??[]).map((o)=>{let r=_a.applyToPoint(t,o);return o.x=r.x,o.y=r.y,o}),Array.isArray(n.junctions))n.junctions=n.junctions.map((o)=>{let r=_a.applyToPoint(t,o);return o.x=r.x,o.y=r.y,o});if(Array.isArray(n.edges))n.edges=n.edges.map((o)=>(o.from=_a.applyToPoint(t,o.from),o.to=_a.applyToPoint(t,o.to),o))}else if(e.type==="schematic_box"){let{x:n,y:o}=_a.applyToPoint(t,{x:e.x,y:e.y});e.x=n,e.y=o}else if(e.type==="schematic_line"){let{x:n,y:o}=_a.applyToPoint(t,{x:e.x1,y:e.y1}),{x:r,y:i}=_a.applyToPoint(t,{x:e.x2,y:e.y2});e.x1=n,e.y1=o,e.x2=r,e.y2=i}return e},W9t=(e,t)=>e.map((n)=>SSo(n,t)),$Le=(e,t)=>{let n=t.a*t.d-t.b*t.c<0;return _a.decomposeTSR(_a.compose(t,_a.rotateDEG(e)),!1,n).rotation.angle*180/Math.PI},PSo=(e,t)=>{let n=_a.applyToPoint(t,{x:e.x,y:e.y});e.x=n.x,e.y=n.y;let o=$Le(e.shape==="rotated_rect"?e.ccw_rotation:0,t),r=Math.round(o/90);if(Math.abs(o-r*90)<0.00000001){if(Math.abs(r)%2===1)[e.width,e.height]=[e.height,e.width];Object.assign(e,{shape:"rect"}),Reflect.deleteProperty(e,"ccw_rotation")}else Object.assign(e,{shape:"rotated_rect",ccw_rotation:o});return e},ESo=(e,t)=>{if(e.shape==="polygon")return e.points=e.points.map((i)=>_a.applyToPoint(t,i)),e;let n=_a.applyToPoint(t,{x:e.x,y:e.y});if(e.x=n.x,e.y=n.y,e.shape==="circle")return e;let o=e.shape==="rotated_rect"?e.ccw_rotation:0,r=$Le(o,t);if(Math.abs(r)<0.00000001)Object.assign(e,{shape:"rect"}),Reflect.deleteProperty(e,"ccw_rotation");else Object.assign(e,{shape:"rotated_rect",ccw_rotation:r});return e},X9t=(e,t)=>{if(e.type==="pcb_cutout"){if(e.shape==="polygon")e.points=e.points.map((s)=>_a.applyToPoint(t,s));else if(e.shape==="path")e.route=e.route.map((s)=>_a.applyToPoint(t,s));else if(e.center=_a.applyToPoint(t,e.center),e.shape==="rect")e.rotation=$Le(e.rotation??0,t);return e}if(e.type==="pcb_soldermask_opening")return ESo(e,t);if(e.type==="pcb_solder_paste"&&(e.shape==="rect"||e.shape==="rotated_rect"))return PSo(e,t);if((e.type==="pcb_smtpad"||e.type==="pcb_solder_paste")&&e.shape==="polygon"){if(e.points=e.points.map((s)=>_a.applyToPoint(t,s)),e.type==="pcb_solder_paste"&&e.holes)e.holes=e.holes.map((s)=>s.map((a)=>_a.applyToPoint(t,a)));return e}let n=_a.decomposeTSR(t),o=Math.abs(U9t(n.rotation.angle))%2===1,r=n.rotation.angle/Math.PI*180,i=n.scale.sy<0;if(e.type==="pcb_plated_hole"||e.type==="pcb_hole"||e.type==="pcb_via"||e.type==="pcb_smtpad"||e.type==="pcb_solder_paste"||e.type==="pcb_port"){let{x:s,y:a}=_a.applyToPoint(t,{x:e.x,y:e.y});e.x=s,e.y=a}else if(e.type==="pcb_keepout"&&e.shape==="outline")e.outline=e.outline.map((s)=>_a.applyToPoint(t,s));else if(e.type==="pcb_keepout"||e.type==="pcb_board")e.center=_a.applyToPoint(t,e.center);else if(e.type==="pcb_silkscreen_text"||e.type==="pcb_fabrication_note_text"||e.type==="pcb_note_text")e.anchor_position=_a.applyToPoint(t,e.anchor_position);else if(e.type==="pcb_copper_text"){if(e.anchor_position)e.anchor_position=_a.applyToPoint(t,e.anchor_position)}else if(e.type==="pcb_courtyard_rect")e.center=_a.applyToPoint(t,e.center),e.ccw_rotation=((e.ccw_rotation??0)+r)%360;else if(e.type==="pcb_silkscreen_circle"||e.type==="pcb_silkscreen_rect"||e.type==="pcb_silkscreen_pill"||e.type==="pcb_silkscreen_oval"||e.type==="pcb_note_rect"||e.type==="pcb_courtyard_circle")e.center=_a.applyToPoint(t,e.center);else if(e.type==="pcb_component"){if(e.center=_a.applyToPoint(t,e.center),e.rotation=e.rotation+r,e.rotation=e.rotation%360,e.cable_insertion_center)e.cable_insertion_center=_a.applyToPoint(t,e.cable_insertion_center);if(e.insertion_direction=vSo(e.insertion_direction,{rotationDegrees:r,isFlipped:i}),o)[e.width,e.height]=[e.height,e.width]}else if(e.type==="pcb_courtyard_outline")e.outline=e.outline.map((s)=>{let a=_a.applyToPoint(t,s);return s.x=a.x,s.y=a.y,s});else if(e.type==="pcb_courtyard_polygon")e.points=e.points.map((s)=>{let a=_a.applyToPoint(t,s);return s.x=a.x,s.y=a.y,s});else if(e.type==="pcb_trace")e.route=e.route.map((s)=>{if(!("x"in s))return s.start=_a.applyToPoint(t,s.start),s.end=_a.applyToPoint(t,s.end),s;let a=_a.applyToPoint(t,s);return s.x=a.x,s.y=a.y,s});else if(e.type==="pcb_silkscreen_path"||e.type==="pcb_trace_hint"||e.type==="pcb_fabrication_note_path"||e.type==="pcb_note_path")e.route=e.route.map((s)=>{let a=_a.applyToPoint(t,s);return s.x=a.x,s.y=a.y,s});else if(e.type==="pcb_silkscreen_line"||e.type==="pcb_note_line"){let s={x:e.x1,y:e.y1},a={x:e.x2,y:e.y2},c=_a.applyToPoint(t,s),l=_a.applyToPoint(t,a);e.x1=c.x,e.y1=c.y,e.x2=l.x,e.y2=l.y}else if(e.type==="cad_component"){let s=_a.applyToPoint(t,{x:e.position.x,y:e.position.y});e.position.x=s.x,e.position.y=s.y}return e},TR=(e,t)=>{let n=_a.decomposeTSR(t),o=U9t(n.rotation.angle),r=Math.abs(o)%2===1,i=e.map((s)=>X9t(s,t));if(r)i=i.map((s)=>{if(s.type==="pcb_smtpad"&&(s.shape==="rect"||s.shape==="pill")||s.type==="pcb_solder_paste"&&s.shape==="pill")[s.width,s.height]=[s.height,s.width];return s});return i},cO=(e)=>{let t=e.type;return e[`${t}_id`]},MSo=(e,t)=>e.find((n)=>cO(n)===t)??null,j9t=(e,t)=>{let n=Qy(e).pcb_port.get(t);if(!n)return`pcb_port[#${t}]`;let o=n.pcb_component_id?Qy(e).pcb_component.get(n.pcb_component_id):void 0;if(!o)return`pcb_port[#${t}]`;let r=Qy(e).source_component.get(o.source_component_id);if(!r)return`pcb_port[#${t}]`;let i=Qy(e).source_port.get(n.source_port_id);if(!i)return`pcb_port[#${t}]`;let s;if(i?.port_hints&&i.port_hints.length>0)s=i.port_hints[0];else if(i.port_hints&&i.port_hints.length>0)s=i.port_hints[0];else s=t;return`pcb_port[.${r.name} > .${s}]`},qLe=(e,t)=>{if(typeof t==="string"){let n=MSo(e,t);if(!n)`unknown (could not find element with id ${t})`;return qLe(e,n)}switch(t.type){case"pcb_port":return j9t(e,t.pcb_port_id);case"pcb_smtpad":return wSo(e,t.pcb_smtpad_id);case"pcb_trace":return BSo(e,t.pcb_trace_id);case"source_component":return`source_component[${t.name}]`;default:return`${t.type}[#${cO(t)}]`}},XLe=(e,t)=>({minX:Math.min(e.minX,t.minX),minY:Math.min(e.minY,t.minY),maxX:Math.max(e.maxX,t.maxX),maxY:Math.max(e.maxY,t.maxY)}),zie=(e,t,n)=>{let o=n/2;return{minX:e-o,minY:t-o,maxX:e+o,maxY:t+o}},H9t=(e,t,n,o,r)=>{let i=n/2,s=o/2,a=r*Math.PI/180,c=Math.cos(a),l=Math.sin(a),h=[{x:-i,y:-s},{x:i,y:-s},{x:i,y:s},{x:-i,y:s}].map((d)=>({x:e+d.x*c-d.y*l,y:t+d.x*l+d.y*c}));return{minX:Math.min(...h.map((d)=>d.x)),minY:Math.min(...h.map((d)=>d.y)),maxX:Math.max(...h.map((d)=>d.x)),maxY:Math.max(...h.map((d)=>d.y))}},TSo=(e,t,n,o,r)=>{let i=n/2,s=o/2,a=r*Math.PI/180,c=Math.cos(a),l=Math.sin(a),h=Math.hypot(i*c,s*l),d=Math.hypot(i*l,s*c);return{minX:e-h,minY:t-d,maxX:e+h,maxY:t+d}},DSo=(e,t,n,o,r)=>{let i=Math.min(n,o)/2,s=Math.max(n,o)/2-i,a=r*Math.PI/180,c=n>=o?{x:s,y:0}:{x:0,y:s},l={x:c.x*Math.cos(a)-c.y*Math.sin(a),y:c.x*Math.sin(a)+c.y*Math.cos(a)},h=Math.abs(l.x)+i,d=Math.abs(l.y)+i;return{minX:e-h,minY:t-d,maxX:e+h,maxY:t+d}},e2e=(e)=>{if(e.length===0)return null;return{minX:Math.min(...e.map((t)=>t.x)),minY:Math.min(...e.map((t)=>t.y)),maxX:Math.max(...e.map((t)=>t.x)),maxY:Math.max(...e.map((t)=>t.y))}},WLe=(e)=>{if(!Array.isArray(e))return[];return e.flatMap((t)=>{if(!t||typeof t!=="object")return[];if("x"in t&&"y"in t&&typeof t.x==="number"&&typeof t.y==="number")return[{x:t.x,y:t.y}];if("start"in t&&"end"in t)return[t.start,t.end].filter((o)=>Boolean(o&&typeof o==="object"&&"x"in o&&"y"in o&&typeof o.x==="number"&&typeof o.y==="number"));return[]})},NSo=(e)=>{if(!e.type.startsWith("pcb_"))return null;if(e.type==="pcb_smtpad"&&e.shape==="polygon"&&Array.isArray(e.points))return e2e(e.points);if(e.type==="pcb_hole"&&e.hole_shape==="circle")return zie(e.x,e.y,e.hole_diameter);if(e.type==="pcb_plated_hole"){let d;if("outer_diameter"in e&&typeof e.outer_diameter==="number")d=zie(e.x,e.y,e.outer_diameter);else if("hole_diameter"in e&&typeof e.hole_diameter==="number")d=zie(e.x,e.y,e.hole_diameter);if((e.shape==="oval"||e.shape==="pill")&&typeof e.outer_width==="number"&&typeof e.outer_height==="number")d=(e.shape==="pill"?DSo:TSo)(e.x,e.y,e.outer_width,e.outer_height,e.ccw_rotation??0);if("rect_pad_width"in e&&typeof e.rect_pad_width==="number"&&"rect_pad_height"in e&&typeof e.rect_pad_height==="number"){let u=H9t(e.x,e.y,e.rect_pad_width,e.rect_pad_height,"rect_ccw_rotation"in e?e.rect_ccw_rotation??0:0);d=d?XLe(d,u):u}if("hole_diameter"in e&&typeof e.hole_diameter==="number"){let u=zie(e.x+("hole_offset_x"in e?e.hole_offset_x??0:0),e.y+("hole_offset_y"in e?e.hole_offset_y??0:0),e.hole_diameter);d=d?XLe(d,u):u}if(d)return d}let t=e,n=e2e(WLe(t.route));if(n)return n;let o=e2e(WLe(t.outline));if(o)return o;let r=e2e(WLe(t.points));if(r)return r;let i,s,a,c;if("x"in e&&"y"in e)i=Number(e.x),s=Number(e.y);if("outer_diameter"in e)a=Number(e.outer_diameter),c=Number(e.outer_diameter);if("width"in e)a=Number(e.width);if("height"in e)c=Number(e.height);if("center"in e&&e.center&&typeof e.center==="object"&&"x"in e.center&&"y"in e.center)i=Number(e.center.x),s=Number(e.center.y);let l=0;if("rotation"in e&&typeof e.rotation==="number")l=e.rotation;if("ccw_rotation"in e&&typeof e.ccw_rotation==="number")l=e.ccw_rotation;if(i!==void 0&&s!==void 0){if(a!==void 0&&c!==void 0)return l?H9t(i,s,a,c,l):{minX:i-a/2,minY:s-c/2,maxX:i+a/2,maxY:s+c/2};if("radius"in e&&typeof e.radius==="number")return zie(i,s,e.radius*2);return{minX:i,minY:s,maxX:i,maxY:s}}let h=[t.anchor_position,t.position].filter((d)=>Boolean(d&&typeof d==="object"&&"x"in d&&"y"in d&&typeof d.x==="number"&&typeof d.y==="number")).at(0);return h?{minX:h.x,minY:h.y,maxX:h.x,maxY:h.y}:null},ky=(e)=>{let t={minX:Number.POSITIVE_INFINITY,minY:Number.POSITIVE_INFINITY,maxX:Number.NEGATIVE_INFINITY,maxY:Number.NEGATIVE_INFINITY};for(let n of e){let o=NSo(n);if(o)t=XLe(t,o)}return t},K9t=(e)=>{if(e.width&&e.height&&e.center){let a=e.width/2,c=e.height/2;return{minX:e.center.x-a,minY:e.center.y-c,maxX:e.center.x+a,maxY:e.center.y+c,width:e.width,height:e.height,center:{x:e.center.x,y:e.center.y}}}if(!e.outline||e.outline.length===0)throw Error("Unable to compute board bounds. pcb_board must include width/height/center or a non-empty outline.");let{POSITIVE_INFINITY:t,POSITIVE_INFINITY:n,NEGATIVE_INFINITY:o,NEGATIVE_INFINITY:r}=Number;for(let a of e.outline)t=Math.min(t,a.x),n=Math.min(n,a.y),o=Math.max(o,a.x),r=Math.max(r,a.y);let i=o-t,s=r-n;return{minX:t,minY:n,maxX:o,maxY:r,width:i,height:s,center:{x:t+i/2,y:n+s/2}}},RSo=0.1,F9t=0.18,J7=0.2,aO=({minX:e,minY:t,maxX:n,maxY:o})=>{let r=n-e,i=o-t;return{minX:e,minY:t,maxX:n,maxY:o,width:r,height:i,center:{x:e+r/2,y:t+i/2}}},QSo=(e)=>{let t=0.12*(F9t/0.18),n=0.12*(F9t/0.18);return e.length*t+n},kSo=(e)=>{let t=QSo(e.text),n=e.anchor_position;if(!n){let o=e.anchor_side==="top"||e.anchor_side==="bottom",r=o?J7:t,i=o?t:J7;return aO({minX:e.center.x-r/2,minY:e.center.y-i/2,maxX:e.center.x+r/2,maxY:e.center.y+i/2})}switch(e.anchor_side){case"left":return aO({minX:n.x,minY:n.y-J7/2,maxX:n.x+t,maxY:n.y+J7/2});case"right":return aO({minX:n.x-t,minY:n.y-J7/2,maxX:n.x,maxY:n.y+J7/2});case"top":return aO({minX:n.x-J7/2,minY:n.y-t,maxX:n.x+J7/2,maxY:n.y});case"bottom":return aO({minX:n.x-J7/2,minY:n.y,maxX:n.x+J7/2,maxY:n.y+t})}},$9t=(e)=>{if(e.type==="schematic_component")return aO({minX:e.center.x-e.size.width/2,minY:e.center.y-e.size.height/2,maxX:e.center.x+e.size.width/2,maxY:e.center.y+e.size.height/2});if(e.type==="schematic_net_label")return kSo(e);let t=[...e.edges.flatMap((o)=>[o.from,o.to]),...e.junctions];if(t.length===0)return null;let n=RSo/2;return aO({minX:Math.min(...t.map((o)=>o.x))-n,minY:Math.min(...t.map((o)=>o.y))-n,maxX:Math.max(...t.map((o)=>o.x))+n,maxY:Math.max(...t.map((o)=>o.y))+n})},z9t,HSo=(e)=>{let{x:t,y:n,width:o,height:r}={...e,...e.size,...e.center,...e.position};if(e.x1!==void 0&&e.x2!==void 0&&e.y1!==void 0&&e.y2!==void 0)t=(e.x1+e.x2)/2,n=(e.y1+e.y2)/2,o=Math.abs(e.x1-e.x2),r=Math.abs(e.y1-e.y2);if(e.points&&Array.isArray(e.points)&&e.points.length>0){let a=e.points.map((_)=>_.x),c=e.points.map((_)=>_.y),l=Math.min(...a),h=Math.max(...a),d=Math.min(...c),u=Math.max(...c);t=(l+h)/2,n=(d+u)/2,o=h-l,r=u-d}let i=e.text||e.name||e.source?.text||e.source?.name||"?",s=e;if(t===void 0||n===void 0)return null;if(o===void 0){if("radius"in e)o=e.radius*2,r=e.radius*2;else if("outer_diameter"in e)o=e.outer_diameter,r=e.outer_diameter;else if("rect_pad_width"in e&&"rect_pad_height"in e){if(o=e.rect_pad_width,r=e.rect_pad_height,"hole_diameter"in e)o=Math.max(o,e.hole_diameter),r=Math.max(r,e.hole_diameter)}else if("hole_diameter"in e)o=e.hole_diameter,r=e.hole_diameter}if(o===void 0||r===void 0)o=0.1,r=0.1;return{x:t,y:n,width:o,height:r,title:i,content:s,bg_color:z9t[LSo(e.type||i)%z9t.length]?.[4]??"#f00"}},FSo=(e)=>Boolean(e),o2e=(e)=>{let t=e.filter((l)=>l.type.startsWith("pcb_")||l.type.startsWith("schematic_")).concat(e.filter((l)=>l.type==="pcb_trace"||l.type==="schematic_trace").flatMap((l)=>l.route)).map((l)=>HSo(l)).filter(FSo);if(t.length===0)return{center:{x:0,y:0},width:0,height:0};let n=t[0].x-t[0].width/2,o=t[0].x+t[0].width/2,r=t[0].y-t[0].height/2,i=t[0].y+t[0].height/2;for(let l of t.slice(1))n=Math.min(n,l.x-l.width/2),o=Math.max(o,l.x+l.width/2),r=Math.min(r,l.y-l.height/2),i=Math.max(i,l.y+l.height/2);let s=o-n,a=i-r;return{center:{x:n+s/2,y:r+a/2},width:s,height:a}},Za=(e)=>e[`${e.type}_id`],r2e=(e,t,n)=>{let o=e.find((h)=>h.type==="pcb_component"&&h.pcb_component_id===t);if(!o)return;let r="center"in o?o.center:{x:o.x,y:o.y},i=n.x-r.x,s=n.y-r.y,a=e.filter((h)=>h.type==="pcb_port"&&h.pcb_component_id===t).map((h)=>h.pcb_port_id),c=e.filter((h)=>{if(h===o)return!0;let d=h;if(d.pcb_component_id===t)return!0;if(Array.isArray(d.pcb_component_ids)&&d.pcb_component_ids.includes(t))return!0;if(d.pcb_port_id&&a.includes(d.pcb_port_id))return!0;if(Array.isArray(d.pcb_port_ids)&&d.pcb_port_ids.some((u)=>a.includes(u)))return!0;if(d.start_pcb_port_id&&a.includes(d.start_pcb_port_id))return!0;if(d.end_pcb_port_id&&a.includes(d.end_pcb_port_id))return!0;if(Array.isArray(d.route)&&d.route.some((u)=>u.start_pcb_port_id&&a.includes(u.start_pcb_port_id)||u.end_pcb_port_id&&a.includes(u.end_pcb_port_id)))return!0;return!1}),l=q9t.translate(i,s);TR(c,l)},Z9t=(e,t)=>{let n=[],o=e.filter((r)=>r.type==="source_group"&&r.parent_source_group_id===t).map((r)=>r.source_group_id);n.push(...o);for(let r of o)n.push(...Z9t(e,r));return n},i2e=(e,t,n)=>{let o=[t,...Z9t(e,t)],r=new Set;for(let u of o)Rj(e,{source_group_id:u}).forEach((p)=>r.add(p));let i=Array.from(r).filter((u)=>u.type==="pcb_port").map((u)=>u.pcb_port_id);e.filter((u)=>{if(u.type!=="pcb_trace")return!1;if(r.has(u))return!1;let _=u;if(_.start_pcb_port_id&&i.includes(_.start_pcb_port_id))return!0;if(_.end_pcb_port_id&&i.includes(_.end_pcb_port_id))return!0;if(Array.isArray(_.route)&&_.route.some((p)=>p.start_pcb_port_id&&i.includes(p.start_pcb_port_id)||p.end_pcb_port_id&&i.includes(p.end_pcb_port_id)))return!0;return!1}).forEach((u)=>r.add(u));let a=Array.from(r).filter((u)=>u.type.startsWith("pcb_"));if(a.length===0)return;let{center:c}=o2e(a),l=n.x-c.x,h=n.y-c.y,d=J9t.translate(l,h);TR(a,d)},tvt=(e,t,n)=>{let o=e.find((h)=>h.type==="schematic_component"&&h.schematic_component_id===t);if(!o)return;let r="center"in o?o.center:{x:o.x,y:o.y},i=n.x-r.x,s=n.y-r.y,a=e.filter((h)=>h.type==="schematic_port"&&h.schematic_component_id===t).map((h)=>h.schematic_port_id),c=e.filter((h)=>{if(h===o)return!0;let d=h;if(d.schematic_component_id===t)return!0;if(Array.isArray(d.schematic_component_ids)&&d.schematic_component_ids.includes(t))return!0;if(d.schematic_port_id&&a.includes(d.schematic_port_id))return!0;if(Array.isArray(d.schematic_port_ids)&&d.schematic_port_ids.some((u)=>a.includes(u)))return!0;if(d.start_schematic_port_id&&a.includes(d.start_schematic_port_id))return!0;if(d.end_schematic_port_id&&a.includes(d.end_schematic_port_id))return!0;if(Array.isArray(d.route)&&d.route.some((u)=>u.start_schematic_port_id&&a.includes(u.start_schematic_port_id)||u.end_schematic_port_id&&a.includes(u.end_schematic_port_id)))return!0;return!1}),l=evt.translate(i,s);W9t(c,l)},ovt=(e,t)=>{let n=[],o=e.filter((r)=>r.type==="source_group"&&r.parent_source_group_id===t).map((r)=>r.source_group_id);n.push(...o);for(let r of o)n.push(...ovt(e,r));return n},rvt=(e,t,n)=>{let o=[t,...ovt(e,t)],r=new Set;for(let u of o)Rj(e,{source_group_id:u}).forEach((p)=>r.add(p));let i=Array.from(r).filter((u)=>u.type==="schematic_port").map((u)=>u.schematic_port_id);e.filter((u)=>{if(u.type!=="schematic_trace")return!1;if(r.has(u))return!1;let _=u;if(_.start_schematic_port_id&&i.includes(_.start_schematic_port_id))return!0;if(_.end_schematic_port_id&&i.includes(_.end_schematic_port_id))return!0;if(Array.isArray(_.route)&&_.route.some((p)=>p.start_schematic_port_id&&i.includes(p.start_schematic_port_id)||p.end_schematic_port_id&&i.includes(p.end_schematic_port_id)))return!0;return!1}).forEach((u)=>r.add(u));let a=Array.from(r).filter((u)=>u.type.startsWith("schematic_"));if(a.length===0)return;let{center:c}=o2e(a),l=n.x-c.x,h=n.y-c.y,d=nvt.translate(l,h);W9t(a,d)},Pw=(e,t)=>{let n=new Map,o=new Set;for(let l of e)if(l.type==="source_group")o.add(l.source_group_id);let r=[];for(let l of e)if(l.type==="source_group"&&l.parent_source_group_id){let{parent_source_group_id:h,source_group_id:d}=l;if(!o.has(h)){if(r.push(d),!n.has(d))n.set(d,[])}else{let u=n.get(h)??[];if(u.push(d),n.set(h,u),!n.has(d))n.set(d,[])}}for(let l of e)if(l.type==="source_group"&&!n.has(l.source_group_id))n.set(l.source_group_id,[]);let i=new Map,s=()=>{for(let[l,h]of n){if(i.has(l))continue;if(h.every((d)=>i.has(d)))return l}return null},a=null;while(!0){let l=s();if(!l)break;let d={nodeType:"group",sourceGroup:e.find((u)=>u.type==="source_group"&&u.source_group_id===l),otherChildElements:[],childNodes:[...n.get(l)?.map((u)=>i.get(u))??[],...e.filter((u)=>u.type==="source_component"&&u.source_group_id===l).map((u)=>({nodeType:"component",sourceComponent:u,childNodes:[],otherChildElements:[...e.filter((_)=>_.type==="pcb_component"&&_.source_component_id===u.source_component_id)]}))]};i.set(l,d),a=l}if(!a)return console.warn("No groups were processed, returning tree without sourceGroup"),{nodeType:"group",childNodes:[],otherChildElements:e};let c=null;if(t&&t.source_group_id!==void 0)c=t.source_group_id;else if(r.length>0)c=r[0];else c=a;if(!c)return console.warn("No valid root group found, returning tree without sourceGroup"),{nodeType:"group",childNodes:[],otherChildElements:e};return i.get(c)},a5=0.000000001,zSo=(e,t,n)=>Math.max(t,Math.min(n,e)),OSo=(e,t)=>Math.hypot(e.x-t.x,e.y-t.y),Oie=(e,t,n)=>{let o=n.x-t.x,r=n.y-t.y,i=o*o+r*r;if(i<=a5)return OSo(e,t);let s=zSo(((e.x-t.x)*o+(e.y-t.y)*r)/i,0,1);return Math.hypot(e.x-(t.x+s*o),e.y-(t.y+s*r))},Vie=(e,t,n)=>(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x),Yie=(e,t,n)=>{if(Math.abs(Vie(t,n,e))>a5)return!1;return e.x>=Math.min(t.x,n.x)-a5&&e.x<=Math.max(t.x,n.x)+a5&&e.y>=Math.min(t.y,n.y)-a5&&e.y<=Math.max(t.y,n.y)+a5},VSo=(e,t,n,o)=>{let r=Vie(e,t,n),i=Vie(e,t,o),s=Vie(n,o,e),a=Vie(n,o,t);if((r>a5&&i<-a5||r<-a5&&i>a5)&&(s>a5&&a<-a5||s<-a5&&a>a5))return!0;return Yie(n,e,t)||Yie(o,e,t)||Yie(e,n,o)||Yie(t,n,o)},Dj=(e)=>{let t=[];if(e.points.length<2)return t;for(let n=0;n<e.points.length;n+=1){let o=e.points[n],r=e.points[(n+1)%e.points.length];if(!o||!r)continue;t.push([o,r])}return t},jLe=(e,t)=>{for(let[o,r]of Dj(t))if(Yie(e,o,r))return!0;let n=!1;for(let o=0,r=t.points.length-1;o<t.points.length;r=o++){let i=t.points[o],s=t.points[r];if(!i||!s)continue;if(i.y>e.y!==s.y>e.y&&e.x<(s.x-i.x)*(e.y-i.y)/(s.y-i.y)+i.x)n=!n}return n},ivt=(e,t)=>Math.max(0,Math.hypot(e.x-t.x,e.y-t.y)-e.radius-t.radius),svt=(e,t)=>{if(e.points.length<3||t.points.length<3)return Number.POSITIVE_INFINITY;for(let[i,s]of Dj(e))for(let[a,c]of Dj(t))if(VSo(i,s,a,c))return 0;let n=e.points[0],o=t.points[0];if(n&&jLe(n,t)||o&&jLe(o,e))return 0;let r=Number.POSITIVE_INFINITY;for(let[i,s]of Dj(e))for(let[a,c]of Dj(t))r=Math.min(r,Oie(i,a,c),Oie(s,a,c),Oie(a,i,s),Oie(c,i,s));return r},JLe=(e,t)=>{if(t.points.length<3)return Number.POSITIVE_INFINITY;if(jLe({x:e.x,y:e.y},t))return 0;let n=Number.POSITIVE_INFINITY;for(let[o,r]of Dj(t))n=Math.min(n,Oie({x:e.x,y:e.y},o,r));return Math.max(0,n-e.radius)},ZLe,YSo,GSo=(e)=>{if(typeof e.x==="number"&&typeof e.y==="number")return{x:e.x,y:e.y};if(e.points&&e.points.length>0){let t=e.points.map((o)=>o.x),n=e.points.map((o)=>o.y);return{x:(Math.min(...t)+Math.max(...t))/2,y:(Math.min(...n)+Math.max(...n))/2}}return null},USo=(e)=>{for(let t of e.port_hints??[]){let n=String(t).trim().match(/^(?:pin)?(\d+)$/i);if(n)return Number.parseInt(n[1],10)}return null},O9t=(e,t,n)=>{let o=t.x-e.x,r=t.y-e.y;if(Math.abs(r)<=n&&Math.abs(o)>n)return o>0?"topside_left":"bottomside_right";if(Math.abs(o)<=n&&Math.abs(r)>n)return r>0?"leftside_bottom":"rightside_top";return null},WSo=(e,t,n)=>{let o=e.map((f)=>f.x),r=e.map((f)=>f.y),i=Math.min(...o),s=Math.max(...o),a=Math.min(...r),c=Math.max(...r),l=(i+s)/2,h=(a+c)/2,d=s-i,u=c-a,_=Math.max(d,u,1)*0.000001,{side:p,alignment:m}=ZLe[n],A=p==="leftside"&&Math.abs(t.x-i)<=_||p==="rightside"&&Math.abs(t.x-s)<=_||p==="topside"&&Math.abs(t.y-c)<=_||p==="bottomside"&&Math.abs(t.y-a)<=_,g=m==="left"&&(d<=_||t.x<l-_)||m==="right"&&(d<=_||t.x>l+_)||m==="top"&&(u<=_||t.y>h+_)||m==="bottom"&&(u<=_||t.y<h-_);return A&&g},eHe=(e)=>{let n=e.filter((u)=>u.type==="pcb_smtpad"||u.type==="pcb_plated_hole").map((u)=>({center:GSo(u),pinNumber:USo(u)})),o=n.find((u)=>u.pinNumber===1)?.center,r=n.map((u)=>u.center).filter((u)=>u!==null);if(!o||r.length===0)return null;let i=YSo.filter((u)=>WSo(r,o,u));if(i.length===1)return i[0];if(i.length===0)return null;let s;for(let u of n){if(!u.center||u.pinNumber===null||u.pinNumber<=1)continue;if(!s||u.pinNumber<s.pinNumber)s={center:u.center,pinNumber:u.pinNumber}}if(!s)return null;let a=r.map((u)=>u.x),c=r.map((u)=>u.y),h=Math.max(Math.max(...a)-Math.min(...a),Math.max(...c)-Math.min(...c),1)*0.000001;if(n.length===2&&s.pinNumber===2)return O9t(o,s.center,h);if(n.length>2){let u=[...n].sort((_,p)=>(_.pinNumber??Number.POSITIVE_INFINITY)-(p.pinNumber??Number.POSITIVE_INFINITY));if(u.every(({center:_,pinNumber:p},m)=>p===m+1&&_!==null&&Number.isFinite(_.x)&&Number.isFinite(_.y))){let _=u[0].center,p=u[u.length-1].center,m=p.x-_.x,A=p.y-_.y,g=Math.abs(A)<=h&&Math.abs(m)>h,f=Math.abs(m)<=h&&Math.abs(A)>h;if((g||f)&&u.slice(1).every(({center:y},x)=>{let C=u[x].center;return g?Math.abs(y.y-_.y)<=h&&(y.x-C.x)*Math.sign(m)>h:Math.abs(y.x-_.x)<=h&&(y.y-C.y)*Math.sign(A)>h}))return O9t(_,u[1].center,h)}}let d=i.filter((u)=>{let{side:_}=ZLe[u];return _==="leftside"||_==="rightside"?Math.abs(s.center.x-o.x)<=h:Math.abs(s.center.y-o.y)<=h});return d.length===1?d[0]:null},Uie=(e,t,n=0)=>{let{a:o,b:r,c:i,d:s,e:a,f:c}=Qj.compose(Qj.translate(t.x,t.y),Qj.rotate(n*Math.PI/180));return e.transform(new s2(o,r,i,s,a,c))},wR=(e)=>e.orientation()===Jz.CCW?e:e.reverse(),BR=(e,t)=>wR(new El(new sO(new sa(e.x,e.y),t))),Nj=(e,t,n,o=0,r=0)=>{let i=t/2,s=n/2,a=Math.max(0,Math.min(o,i,s));if(a===0)return Uie(wR(new El(new YA(-i,-s,i,s))),e,r);let c=[new Kp(new sa(i-a,-s+a),a,-Math.PI/2,0,!0),new Kp(new sa(i-a,s-a),a,0,Math.PI/2,!0),new Kp(new sa(-i+a,s-a),a,Math.PI/2,Math.PI,!0),new Kp(new sa(-i+a,-s+a),a,Math.PI,Math.PI*1.5,!0)],l=[];for(let h=0;h<c.length;h++){let d=c[h],u=c[(h+1)%c.length];if(l.push(d),d.end.distanceTo(u.start)[0]>0.000000000001)l.push(new Fg(d.end,u.start))}return Uie(wR(new El(l)),e,r)},V9t=(e)=>{let t=[];for(let n=0;n<e.vertices.length;n++){let o=e.vertices[n],r=e.vertices[(n+1)%e.vertices.length],i=r.x-o.x,s=r.y-o.y;if(i===0&&s===0)continue;let a=o.bulge??0;if(a===0)t.push(new Fg(new sa(o.x,o.y),new sa(r.x,r.y)));else{let c=(1-a*a)/(4*a),l=new sa((o.x+r.x)/2-s*c,(o.y+r.y)/2+i*c);t.push(new Kp(l,Math.hypot(i,s)*(1+a*a)/(4*Math.abs(a)),Math.atan2(o.y-l.y,o.x-l.x),Math.atan2(r.y-l.y,r.x-l.x),a>0))}}return wR(new El(t))},Gie=(e,t)=>{for(let n of t.reverse().faces)e.addFace(n.shapes);return e},DR=(e)=>{if(e.shape==="rect")return Nj(e.center,e.width,e.height,0,e.rotation);if(e.shape==="polygon")return wR(new El(e.points.map((n)=>new sa(n.x,n.y))));let t=V9t(e.brep_shape.outer_ring);for(let n of e.brep_shape.inner_rings)Gie(t,V9t(n));return t},kj=(e)=>{if(e.shape==="polygon")return wR(new El(e.points.map((n)=>new sa(n.x,n.y))));if(e.shape==="circle")return BR(e,e.radius);let t=e.shape==="pill"||e.shape==="rotated_pill"?e.radius:e.corner_radius??e.rect_border_radius??0;return Nj(e,e.width,e.height,t,"ccw_rotation"in e?e.ccw_rotation:0)},NR=(e,t,n)=>Gie(BR(e,t/2),BR(e,n/2)),RR=(e,t=0)=>{if(e.shape==="circle")return NR(e,e.outer_diameter,e.hole_diameter);if("outer_width"in e)return Gie(Nj(e,e.outer_width,e.outer_height,Math.min(e.outer_width,e.outer_height)/2,e.ccw_rotation),Nj(e,e.hole_width,e.hole_height,Math.min(e.hole_width,e.hole_height)/2,e.ccw_rotation));let n={x:e.x+e.hole_offset_x,y:e.y+e.hole_offset_y},o=e.shape==="hole_with_polygon_pad"?Uie(wR(new El(e.pad_outline.map((r)=>new sa(r.x,r.y)))),e,e.ccw_rotation??t):Nj(e,e.rect_pad_width,e.rect_pad_height,e.rect_border_radius,"rect_ccw_rotation"in e?e.rect_ccw_rotation:0);if(e.shape==="circular_hole_with_rect_pad"||e.shape==="hole_with_polygon_pad"&&e.hole_shape==="circle"){if(e.hole_diameter===void 0)throw Error("Circular plated hole requires hole_diameter");return Gie(o,BR(n,e.hole_diameter/2))}if(!("hole_width"in e)||e.hole_width===void 0||e.hole_height===void 0)throw Error("Slotted plated hole requires hole_width and hole_height");return Gie(o,Nj(n,e.hole_width,e.hole_height,Math.min(e.hole_width,e.hole_height)/2,"hole_ccw_rotation"in e?e.hole_ccw_rotation:e.shape==="hole_with_polygon_pad"?e.ccw_rotation??t:0))},lO=(e,t,n,o=n)=>{let r=Math.hypot(t.x-e.x,t.y-e.y),i=n/2,s=o/2;if(p3.EQ_0(r)||r<=Math.abs(s-i))return BR(i>=s?e:t,Math.max(i,s));let a=Math.atan2(t.y-e.y,t.x-e.x),c=Math.acos((i-s)/r),l=new Kp(new sa(e.x,e.y),i,a+c,a-c,!0),h=new Kp(new sa(t.x,t.y),s,a-c,a+c,!0);return wR(new El([l,new Fg(l.end,h.start),h,new Fg(h.end,l.start)]))},avt=(e,t,n=0.0000001)=>e.vertices.some((o)=>t.contains(o))||t.vertices.some((o)=>e.contains(o))||e.distanceTo(t)[0]<=n;var er=ba(()=>{qt();qt();Yfe();$p();_a=at(As(),1),q9t=at(As(),1),J9t=at(As(),1),evt=at(As(),1),nvt=at(As(),1),Qj=at(As(),1);Qy.unparsed=Qy;Vo=Qy,Ps=Qy;t2e.unparsed=t2e;KLe=t2e;z9t=[["#69d2e7","#a7dbd8","#e0e4cc","#f38630","#fa6900"],["#fe4365","#fc9d9a","#f9cdad","#c8c8a9","#83af9b"],["#ecd078","#d95b43","#c02942","#542437","#53777a"],["#556270","#4ecdc4","#c7f464","#ff6b6b","#c44d58"],["#774f38","#e08e79","#f1d4af","#ece5ce","#c5e0dc"],["#e8ddcb","#cdb380","#036564","#033649","#031634"],["#490a3d","#bd1550","#e97f02","#f8ca00","#8a9b0f"],["#594f4f","#547980","#45ada8","#9de0ad","#e5fcc2"],["#00a0b0","#6a4a3c","#cc333f","#eb6841","#edc951"],["#e94e77","#d68189","#c6a49a","#c6e5d9","#f4ead5"],["#3fb8af","#7fc7af","#dad8a7","#ff9e9d","#ff3d7f"],["#d9ceb2","#948c75","#d5ded9","#7a6a53","#99b2b7"],["#ffffff","#cbe86b","#f2e9e1","#1c140d","#cbe86b"],["#efffcd","#dce9be","#555152","#2e2633","#99173c"],["#343838","#005f6b","#008c9e","#00b4cc","#00dffc"],["#413e4a","#73626e","#b38184","#f0b49e","#f7e4be"],["#ff4e50","#fc913a","#f9d423","#ede574","#e1f5c4"],["#99b898","#fecea8","#ff847c","#e84a5f","#2a363b"],["#655643","#80bca3","#f6f7bd","#e6ac27","#bf4d28"],["#00a8c6","#40c0cb","#f9f2e7","#aee239","#8fbe00"],["#351330","#424254","#64908a","#e8caa4","#cc2a41"],["#554236","#f77825","#d3ce3d","#f1efa5","#60b99a"],["#5d4157","#838689","#a8caba","#cad7b2","#ebe3aa"],["#8c2318","#5e8c6a","#88a65e","#bfb35a","#f2c45a"],["#fad089","#ff9c5b","#f5634a","#ed303c","#3b8183"],["#ff4242","#f4fad2","#d4ee5e","#e1edb9","#f0f2eb"],["#f8b195","#f67280","#c06c84","#6c5b7b","#355c7d"],["#d1e751","#ffffff","#000000","#4dbce9","#26ade4"],["#1b676b","#519548","#88c425","#bef202","#eafde6"],["#5e412f","#fcebb6","#78c0a8","#f07818","#f0a830"],["#bcbdac","#cfbe27","#f27435","#f02475","#3b2d38"],["#452632","#91204d","#e4844a","#e8bf56","#e2f7ce"],["#eee6ab","#c5bc8e","#696758","#45484b","#36393b"],["#f0d8a8","#3d1c00","#86b8b1","#f2d694","#fa2a00"],["#2a044a","#0b2e59","#0d6759","#7ab317","#a0c55f"],["#f04155","#ff823a","#f2f26f","#fff7bd","#95cfb7"],["#b9d7d9","#668284","#2a2829","#493736","#7b3b3b"],["#bbbb88","#ccc68d","#eedd99","#eec290","#eeaa88"],["#b3cc57","#ecf081","#ffbe40","#ef746f","#ab3e5b"],["#a3a948","#edb92e","#f85931","#ce1836","#009989"],["#300030","#480048","#601848","#c04848","#f07241"],["#67917a","#170409","#b8af03","#ccbf82","#e33258"],["#aab3ab","#c4cbb7","#ebefc9","#eee0b7","#e8caaf"],["#e8d5b7","#0e2430","#fc3a51","#f5b349","#e8d5b9"],["#ab526b","#bca297","#c5ceae","#f0e2a4","#f4ebc3"],["#607848","#789048","#c0d860","#f0f0d8","#604848"],["#b6d8c0","#c8d9bf","#dadabd","#ecdbbc","#fedcba"],["#a8e6ce","#dcedc2","#ffd3b5","#ffaaa6","#ff8c94"],["#3e4147","#fffedf","#dfba69","#5a2e2e","#2a2c31"],["#fc354c","#29221f","#13747d","#0abfbc","#fcf7c5"],["#cc0c39","#e6781e","#c8cf02","#f8fcc1","#1693a7"],["#1c2130","#028f76","#b3e099","#ffeaad","#d14334"],["#a7c5bd","#e5ddcb","#eb7b59","#cf4647","#524656"],["#dad6ca","#1bb0ce","#4f8699","#6a5e72","#563444"],["#5c323e","#a82743","#e15e32","#c0d23e","#e5f04c"],["#edebe6","#d6e1c7","#94c7b6","#403b33","#d3643b"],["#fdf1cc","#c6d6b8","#987f69","#e3ad40","#fcd036"],["#230f2b","#f21d41","#ebebbc","#bce3c5","#82b3ae"],["#b9d3b0","#81bda4","#b28774","#f88f79","#f6aa93"],["#3a111c","#574951","#83988e","#bcdea5","#e6f9bc"],["#5e3929","#cd8c52","#b7d1a3","#dee8be","#fcf7d3"],["#1c0113","#6b0103","#a30006","#c21a01","#f03c02"],["#000000","#9f111b","#b11623","#292c37","#cccccc"],["#382f32","#ffeaf2","#fcd9e5","#fbc5d8","#f1396d"],["#e3dfba","#c8d6bf","#93ccc6","#6cbdb5","#1a1f1e"],["#f6f6f6","#e8e8e8","#333333","#990100","#b90504"],["#1b325f","#9cc4e4","#e9f2f9","#3a89c9","#f26c4f"],["#a1dbb2","#fee5ad","#faca66","#f7a541","#f45d4c"],["#c1b398","#605951","#fbeec2","#61a6ab","#accec0"],["#5e9fa3","#dcd1b4","#fab87f","#f87e7b","#b05574"],["#951f2b","#f5f4d7","#e0dfb1","#a5a36c","#535233"],["#8dccad","#988864","#fea6a2","#f9d6ac","#ffe9af"],["#2d2d29","#215a6d","#3ca2a2","#92c7a3","#dfece6"],["#413d3d","#040004","#c8ff00","#fa023c","#4b000f"],["#eff3cd","#b2d5ba","#61ada0","#248f8d","#605063"],["#ffefd3","#fffee4","#d0ecea","#9fd6d2","#8b7a5e"],["#cfffdd","#b4dec1","#5c5863","#a85163","#ff1f4c"],["#9dc9ac","#fffec7","#f56218","#ff9d2e","#919167"],["#4e395d","#827085","#8ebe94","#ccfc8e","#dc5b3e"],["#a8a7a7","#cc527a","#e8175d","#474747","#363636"],["#f8edd1","#d88a8a","#474843","#9d9d93","#c5cfc6"],["#046d8b","#309292","#2fb8ac","#93a42a","#ecbe13"],["#f38a8a","#55443d","#a0cab5","#cde9ca","#f1edd0"],["#a70267","#f10c49","#fb6b41","#f6d86b","#339194"],["#ff003c","#ff8a00","#fabe28","#88c100","#00c176"],["#ffedbf","#f7803c","#f54828","#2e0d23","#f8e4c1"],["#4e4d4a","#353432","#94ba65","#2790b0","#2b4e72"],["#0ca5b0","#4e3f30","#fefeeb","#f8f4e4","#a5b3aa"],["#4d3b3b","#de6262","#ffb88c","#ffd0b3","#f5e0d3"],["#fffbb7","#a6f6af","#66b6ab","#5b7c8d","#4f2958"],["#edf6ee","#d1c089","#b3204d","#412e28","#151101"],["#9d7e79","#ccac95","#9a947c","#748b83","#5b756c"],["#fcfef5","#e9ffe1","#cdcfb7","#d6e6c3","#fafbe3"],["#9cddc8","#bfd8ad","#ddd9ab","#f7af63","#633d2e"],["#30261c","#403831","#36544f","#1f5f61","#0b8185"],["#aaff00","#ffaa00","#ff00aa","#aa00ff","#00aaff"],["#d1313d","#e5625c","#f9bf76","#8eb2c5","#615375"],["#ffe181","#eee9e5","#fad3b2","#ffba7f","#ff9c97"],["#73c8a9","#dee1b6","#e1b866","#bd5532","#373b44"],["#805841","#dcf7f3","#fffcdd","#ffd8d8","#f5a2a2"]];ZLe={leftside_top:{side:"leftside",alignment:"top"},leftside_bottom:{side:"leftside",alignment:"bottom"},rightside_top:{side:"rightside",alignment:"top"},rightside_bottom:{side:"rightside",alignment:"bottom"},topside_left:{side:"topside",alignment:"left"},topside_right:{side:"topside",alignment:"right"},bottomside_left:{side:"bottomside",alignment:"left"},bottomside_right:{side:"bottomside",alignment:"right"}},YSo=Object.keys(ZLe)});var cvt=()=>{};var lvt=()=>{};function aHe([e,t],[n,o],{lineThickness:r=0}={}){if(r===0)return cHe(e,t,n,o);return JSo(e,t,n,o)<=r}function cHe(e,t,n,o){let r=Kie(e,t,n),i=Kie(e,t,o),s=Kie(n,o,e),a=Kie(n,o,t);if(r!==i&&s!==a)return!0;if(r===0&&$ie(e,n,t))return!0;if(i===0&&$ie(e,o,t))return!0;if(s===0&&$ie(n,e,o))return!0;if(a===0&&$ie(n,t,o))return!0;return!1}function Kie(e,t,n){let o=(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y);if(o===0)return 0;return o>0?1:2}function $ie(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function JSo(e,t,n,o){if(e.x===t.x&&e.y===t.y)return uO(e,n,o);if(n.x===o.x&&n.y===o.y)return uO(n,e,t);if(cHe(e,t,n,o))return 0;let r=[uO(e,n,o),uO(t,n,o),uO(n,e,t),uO(o,e,t)];return Math.min(...r)}function uO(e,t,n){let o=(n.x-t.x)**2+(n.y-t.y)**2;if(o===0)return sHe(e,t);let r=((e.x-t.x)*(n.x-t.x)+(e.y-t.y)*(n.y-t.y))/o;r=Math.max(0,Math.min(1,r));let i={x:t.x+r*(n.x-t.x),y:t.y+r*(n.y-t.y)};return sHe(e,i)}function sHe(e,t){let n=e.x-t.x,o=e.y-t.y;return Math.sqrt(n*n+o*o)}var hvt=()=>{};var dvt=()=>{};var uvt=ba(()=>{cvt();lvt();hvt();dvt()});function pvt(e){let t=e;while(t.parent!==null)t=t.parent;let n=e;while(n.parent!==null&&n.parent!==t){let o=n.parent;n.parent=t,n=o}return t}function ZSo(e,t){let n={nodeId:e,nextMember:null},o={parent:null,networkId:`connectivity_net${t.nextNetworkNumber++}`,firstMember:n,lastMember:n};return t.rootByNodeId.set(e,o),o}function ePo(e,t){let n=t.rootByNodeId.get(e);return n===void 0?ZSo(e,t):pvt(n)}function tPo({targetRoot:e,sourceRoot:t}){e.lastMember.nextMember=t.firstMember,e.lastMember=t.lastMember,t.parent=e}function nPo(e){let t=[],n=e.firstMember;while(n!==null)t.push(n.nodeId),n=n.nextMember;return t}function Mw(e){let t={rootByNodeId:new Map,nextNetworkNumber:0};for(let o of e){let r=null;for(let i of o){let s=ePo(i,t);if(r===null){r=s;continue}if(r=pvt(r),s!==r)tPo({targetRoot:r,sourceRoot:s})}}let n={};for(let o of t.rootByNodeId.values()){if(o.parent!==null)continue;n[o.networkId]=nPo(o)}return n}var l5=class{netMap;idToNetMap;constructor(e){this.netMap=e,this.idToNetMap={};for(let[t,n]of Object.entries(e))for(let o of n)this.idToNetMap[o]=t}addConnections(e){for(let t of e){let n=new Set;for(let r of t){let i=this.idToNetMap[r];if(i)n.add(i)}let o;if(n.size===0)o=`connectivity_net${Object.keys(this.netMap).length}`,this.netMap[o]=[];else if(n.size===1)o=n.values().next().value??`connectivity_net${Object.keys(this.netMap).length}`;else{o=n.values().next().value??`connectivity_net${Object.keys(this.netMap).length}`;for(let r of n)if(r!==o){this.netMap[o].push(...this.netMap[r]),this.netMap[r]=this.netMap[o];for(let i of this.netMap[o])this.idToNetMap[i]=o}}for(let r of t){if(!this.netMap[o].includes(r))this.netMap[o].push(r);this.idToNetMap[r]=o}}}getIdsConnectedToNet(e){return this.netMap[e]||[]}getNetConnectedToId(e){return this.idToNetMap[e]}areIdsConnected(e,t){if(e===t)return!0;let n=this.getNetConnectedToId(e);if(!n)return!1;let o=this.getNetConnectedToId(t);if(!o)return!1;return n===o||o===e||o===e}areAllIdsConnected(e){let t=this.getNetConnectedToId(e[0]);for(let n of e){let o=this.getNetConnectedToId(n);if(o===void 0)return!1;if(o!==t)return!1}return!0}},eS=(e)=>{let t=[];for(let o of e)if(o.type==="source_trace")t.push([...o.connected_source_port_ids??[],...o.connected_source_net_ids??[]]);else if(o.type==="source_component"){if(o.internally_connected_source_port_ids)for(let r of o.internally_connected_source_port_ids)t.push(r)}else if(o.type==="source_component_internal_connection")t.push(o.source_port_ids);let n=Mw(t);return new l5(n)},Aa=(e)=>{let t=[];for(let o of e)if(o.type==="source_trace")t.push([o.source_trace_id,...o.connected_source_port_ids??[],...o.connected_source_net_ids??[]].filter(Boolean));else if(o.type==="pcb_port"){let{pcb_port_id:r,source_port_id:i}=o;if(i&&r)t.push([i,r])}else if(o.type==="pcb_smtpad"){let{pcb_smtpad_id:r,pcb_port_id:i}=o;if(i&&r)t.push([r,i])}else if(o.type==="pcb_plated_hole"){let{pcb_plated_hole_id:r,pcb_port_id:i}=o;if(i&&r)t.push([r,i])}else if(o.type==="pcb_trace"){let{pcb_trace_id:r,source_trace_id:i}=o,s=Array.isArray(o.route)?o.route.filter((a)=>a&&a.route_type==="wire"):[];if(i&&r)t.push([r,i]);if(Array.isArray(s)){let a=s.find((l)=>l?.start_pcb_port_id)?.start_pcb_port_id,c=s.find((l)=>l?.end_pcb_port_id)?.end_pcb_port_id;if(a&&r)t.push([a,r]);if(r&&c)t.push([r,c])}}else if(o.type==="pcb_via"){let{pcb_via_id:r,pcb_trace_id:i,source_trace_id:s,source_net_id:a}=o,c=[...o.pcb_port_ids??[],i,s,a].filter((l)=>Boolean(l));if(r&&c.length>0)t.push([r,...c])}else if(o.type==="source_component"){if(o.internally_connected_source_port_ids)for(let r of o.internally_connected_source_port_ids)t.push(r)}let n=Mw(t);return new l5(n)},Fj=class{circuitJson;traceIdToElm;portIdToElm;connMap;constructor(e){if(this.circuitJson=e||[],this.traceIdToElm=new Map,this.portIdToElm=new Map,e)this._buildTraceMap(),this._buildPortMap(),this.connMap=this._buildTraceConnectivityMap();else this.connMap=new l5({})}_buildPortMap(){for(let e of this.circuitJson)if(e.type==="pcb_port")this.portIdToElm.set(e.pcb_port_id,e)}_buildTraceMap(){for(let e of this.circuitJson)if(e.type==="pcb_trace")this.traceIdToElm.set(e.pcb_trace_id,e)}_buildTraceConnectivityMap(){let e=[],t=Array.from(this.traceIdToElm.keys());for(let n=0;n<t.length;n++)for(let o=n+1;o<t.length;o++){let r=this.traceIdToElm.get(t[n]),i=this.traceIdToElm.get(t[o]);if(this._arePcbTracesConnected(r,i))e.push([t[n],t[o]])}for(let n of this.portIdToElm.values())for(let o of this.traceIdToElm.values())for(let r of o.route)if(r.route_type==="wire"){if(r.start_pcb_port_id===n.pcb_port_id)e.push([n.pcb_port_id,o.pcb_trace_id]);else if(r.end_pcb_port_id===n.pcb_port_id)e.push([o.pcb_trace_id,n.pcb_port_id])}return new l5(Mw(e))}addTrace(e){this.traceIdToElm.set(e.pcb_trace_id,e);let t=[];for(let n of e.route)if(n.route_type==="wire"){if(n.start_pcb_port_id)t.push([n.start_pcb_port_id,e.pcb_trace_id]);if(n.end_pcb_port_id)t.push([n.end_pcb_port_id,e.pcb_trace_id])}this.connMap.addConnections(t)}_arePcbTracesConnected(e,t){for(let n=0;n<e.route.length-1;n++){let o=e.route[n],r=e.route[n+1];if(o.route_type!=="wire")continue;if(r.route_type!=="wire")continue;if(o.layer!==r.layer)continue;let i=Math.min(o.x,r.x),s=Math.min(o.y,r.y),a=Math.max(o.x,r.x),c=Math.max(o.y,r.y),l=Number.isFinite(i)&&Number.isFinite(s)&&Number.isFinite(a)&&Number.isFinite(c);for(let h=0;h<t.route.length-1;h++){let d=t.route[h],u=t.route[h+1];if(d.route_type!=="wire")continue;if(u.route_type!=="wire")continue;if(d.layer!==u.layer)continue;if(o.layer!==d.layer)continue;let _=(o.width+d.width)/2,p=Math.max(0,_)+0.000000001;if(l&&Number.isFinite(d.x)&&Number.isFinite(d.y)&&Number.isFinite(u.x)&&Number.isFinite(u.y)&&Number.isFinite(_)&&(Math.min(d.x,u.x)>a+p||Math.max(d.x,u.x)<i-p||Math.min(d.y,u.y)>c+p||Math.max(d.y,u.y)<s-p))continue;if(aHe([o,r],[d,u],{lineThickness:_}))return!0}}return!1}areTracesConnected(e,t){return this.connMap.areIdsConnected(e,t)}getAllTracesConnectedToTrace(e){let t=this.connMap.getNetConnectedToId(e);return t?this.connMap.getIdsConnectedToNet(t).filter((n)=>this.traceIdToElm.has(n)).map((n)=>this.traceIdToElm.get(n)):[]}getAllTracesConnectedToPort(e){let t=this.connMap.getNetConnectedToId(e);return t?this.connMap.getIdsConnectedToNet(t).filter((n)=>this.traceIdToElm.has(n)).map((n)=>this.traceIdToElm.get(n)):[]}};var yc=ba(()=>{uvt()});var W0=pt(function(uHe,pHe){(function(e,t){typeof uHe==="object"&&typeof pHe<"u"?pHe.exports=t():typeof define==="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.svgson=t())})(uHe,function(){/*!
   * Determine if an object is a Buffer
   *
   * @author   Feross Aboukhadijeh <https://feross.org>
   * @license  MIT
   */var e=function(U){return U!=null&&(t(U)||n(U)||!!U._isBuffer)};function t(U){return!!U.constructor&&typeof U.constructor.isBuffer==="function"&&U.constructor.isBuffer(U)}function n(U){return typeof U.readFloatLE==="function"&&typeof U.slice==="function"&&t(U.slice(0,0))}var o=Object.prototype.toString,r=function(j){if(typeof j>"u")return"undefined";if(j===null)return"null";if(j===!0||j===!1||j instanceof Boolean)return"boolean";if(typeof j==="string"||j instanceof String)return"string";if(typeof j==="number"||j instanceof Number)return"number";if(typeof j==="function"||j instanceof Function)return"function";if(typeof Array.isArray<"u"&&Array.isArray(j))return"array";if(j instanceof RegExp)return"regexp";if(j instanceof Date)return"date";var Y=o.call(j);if(Y==="[object RegExp]")return"regexp";if(Y==="[object Date]")return"date";if(Y==="[object Arguments]")return"arguments";if(Y==="[object Error]")return"error";if(e(j))return"buffer";if(Y==="[object Set]")return"set";if(Y==="[object WeakSet]")return"weakset";if(Y==="[object Map]")return"map";if(Y==="[object WeakMap]")return"weakmap";if(Y==="[object Symbol]")return"symbol";if(Y==="[object Int8Array]")return"int8array";if(Y==="[object Uint8Array]")return"uint8array";if(Y==="[object Uint8ClampedArray]")return"uint8clampedarray";if(Y==="[object Int16Array]")return"int16array";if(Y==="[object Uint16Array]")return"uint16array";if(Y==="[object Int32Array]")return"int32array";if(Y==="[object Uint32Array]")return"uint32array";if(Y==="[object Float32Array]")return"float32array";if(Y==="[object Float64Array]")return"float64array";return"object"};function i(U,j){return j={exports:{}},U(j,j.exports),j.exports}var s=i(function(U){(function(){function j(Y,X){if(typeof X!=="function")return Y;var K={};for(var J in Y)if(Object.prototype.hasOwnProperty.call(Y,J))K[X(J,Y[J])||J]=Y[J];return K}if(U.exports)U.exports=j;else window.rename=j})()}),a=function U(j,Y){var X=r(j);if(X!=="object"&&X!=="array")throw Error("expected an object");var K=[];if(X==="object")j=s(j,Y),K={};for(var J in j)if(j.hasOwnProperty(J)){var ee=j[J];if(r(ee)==="object"||r(ee)==="array")K[J]=U(ee,Y);else K[J]=ee}return K},c=i(function(U){var j=Object.prototype.hasOwnProperty,Y="~";function X(){}if(Object.create){if(X.prototype=Object.create(null),!new X().__proto__)Y=!1}function K(ee,se,ne){this.fn=ee,this.context=se,this.once=ne||!1}function J(){this._events=new X,this._eventsCount=0}J.prototype.eventNames=function(){var se=[],ne,re;if(this._eventsCount===0)return se;for(re in ne=this._events)if(j.call(ne,re))se.push(Y?re.slice(1):re);if(Object.getOwnPropertySymbols)return se.concat(Object.getOwnPropertySymbols(ne));return se},J.prototype.listeners=function(se,ne){var re=Y?Y+se:se,Z=this._events[re];if(ne)return!!Z;if(!Z)return[];if(Z.fn)return[Z.fn];for(var te=0,ie=Z.length,le=Array(ie);te<ie;te++)le[te]=Z[te].fn;return le},J.prototype.emit=function(se,ne,re,Z,te,ie){var le=Y?Y+se:se;if(!this._events[le])return!1;var ue=this._events[le],de=arguments.length,me,Ae;if(ue.fn){if(ue.once)this.removeListener(se,ue.fn,void 0,!0);switch(de){case 1:return ue.fn.call(ue.context),!0;case 2:return ue.fn.call(ue.context,ne),!0;case 3:return ue.fn.call(ue.context,ne,re),!0;case 4:return ue.fn.call(ue.context,ne,re,Z),!0;case 5:return ue.fn.call(ue.context,ne,re,Z,te),!0;case 6:return ue.fn.call(ue.context,ne,re,Z,te,ie),!0}for(Ae=1,me=Array(de-1);Ae<de;Ae++)me[Ae-1]=arguments[Ae];ue.fn.apply(ue.context,me)}else{var xe=ue.length,Me;for(Ae=0;Ae<xe;Ae++){if(ue[Ae].once)this.removeListener(se,ue[Ae].fn,void 0,!0);switch(de){case 1:ue[Ae].fn.call(ue[Ae].context);break;case 2:ue[Ae].fn.call(ue[Ae].context,ne);break;case 3:ue[Ae].fn.call(ue[Ae].context,ne,re);break;case 4:ue[Ae].fn.call(ue[Ae].context,ne,re,Z);break;default:if(!me)for(Me=1,me=Array(de-1);Me<de;Me++)me[Me-1]=arguments[Me];ue[Ae].fn.apply(ue[Ae].context,me)}}}return!0},J.prototype.on=function(se,ne,re){var Z=new K(ne,re||this),te=Y?Y+se:se;if(!this._events[te])this._events[te]=Z,this._eventsCount++;else if(!this._events[te].fn)this._events[te].push(Z);else this._events[te]=[this._events[te],Z];return this},J.prototype.once=function(se,ne,re){var Z=new K(ne,re||this,!0),te=Y?Y+se:se;if(!this._events[te])this._events[te]=Z,this._eventsCount++;else if(!this._events[te].fn)this._events[te].push(Z);else this._events[te]=[this._events[te],Z];return this},J.prototype.removeListener=function(se,ne,re,Z){var te=Y?Y+se:se;if(!this._events[te])return this;if(!ne){if(--this._eventsCount===0)this._events=new X;else delete this._events[te];return this}var ie=this._events[te];if(ie.fn){if(ie.fn===ne&&(!Z||ie.once)&&(!re||ie.context===re))if(--this._eventsCount===0)this._events=new X;else delete this._events[te]}else{for(var le=0,ue=[],de=ie.length;le<de;le++)if(ie[le].fn!==ne||Z&&!ie[le].once||re&&ie[le].context!==re)ue.push(ie[le]);if(ue.length)this._events[te]=ue.length===1?ue[0]:ue;else if(--this._eventsCount===0)this._events=new X;else delete this._events[te]}return this},J.prototype.removeAllListeners=function(se){var ne;if(se){if(ne=Y?Y+se:se,this._events[ne])if(--this._eventsCount===0)this._events=new X;else delete this._events[ne]}else this._events=new X,this._eventsCount=0;return this},J.prototype.off=J.prototype.removeListener,J.prototype.addListener=J.prototype.on,J.prototype.setMaxListeners=function(){return this},J.prefixed=Y,J.EventEmitter=J,U.exports=J});function l(U,j,Y){if(j in U)Object.defineProperty(U,j,{value:Y,enumerable:!0,configurable:!0,writable:!0});else U[j]=Y;return U}var h=function(){},d={data:"state-data",cdata:"state-cdata",tagBegin:"state-tag-begin",tagName:"state-tag-name",tagEnd:"state-tag-end",attributeNameStart:"state-attribute-name-start",attributeName:"state-attribute-name",attributeNameEnd:"state-attribute-name-end",attributeValueBegin:"state-attribute-value-begin",attributeValue:"state-attribute-value"},u={lt:"action-lt",gt:"action-gt",space:"action-space",equal:"action-equal",quote:"action-quote",slash:"action-slash",char:"action-char",error:"action-error"},_={text:"text",openTag:"open-tag",closeTag:"close-tag",attributeName:"attribute-name",attributeValue:"attribute-value"},p={" ":u.space,"\t":u.space,"\n":u.space,"\r":u.space,"<":u.lt,">":u.gt,'"':u.quote,"'":u.quote,"=":u.equal,"/":u.slash},m=function(j){return p[j]||u.char},A=function(j){var Y,X,K,J,ee,se,ne,re,Z,te;j=Object.assign({debug:!1},j);var ie=new c,le=d.data,ue="",de="",me="",Ae="",xe="",Me="",Re=function(ye,Se){if(de[0]==="?"||de[0]==="!")return;var Ne={type:ye,value:Se};if(j.debug)console.log("emit:",Ne);ie.emit("data",Ne)};ie.stateMachine=(te={},l(te,d.data,(Y={},l(Y,u.lt,function(){if(ue.trim())Re(_.text,ue);de="",xe=!1,le=d.tagBegin}),l(Y,u.char,function(_e){ue+=_e}),Y)),l(te,d.cdata,l({},u.char,function(_e){if(ue+=_e,ue.substr(-3)==="]]>")Re(_.text,ue.slice(0,-3)),ue="",le=d.data})),l(te,d.tagBegin,(X={},l(X,u.space,h),l(X,u.char,function(_e){de=_e,le=d.tagName}),l(X,u.slash,function(){de="",xe=!0}),X)),l(te,d.tagName,(K={},l(K,u.space,function(){if(xe)le=d.tagEnd;else le=d.attributeNameStart,Re(_.openTag,de)}),l(K,u.gt,function(){if(xe)Re(_.closeTag,de);else Re(_.openTag,de);ue="",le=d.data}),l(K,u.slash,function(){le=d.tagEnd,Re(_.openTag,de)}),l(K,u.char,function(_e){if(de+=_e,de==="![CDATA[")le=d.cdata,ue="",de=""}),K)),l(te,d.tagEnd,(J={},l(J,u.gt,function(){Re(_.closeTag,de),ue="",le=d.data}),l(J,u.char,h),J)),l(te,d.attributeNameStart,(ee={},l(ee,u.char,function(_e){me=_e,le=d.attributeName}),l(ee,u.gt,function(){ue="",le=d.data}),l(ee,u.space,h),l(ee,u.slash,function(){xe=!0,le=d.tagEnd}),ee)),l(te,d.attributeName,(se={},l(se,u.space,function(){le=d.attributeNameEnd}),l(se,u.equal,function(){Re(_.attributeName,me),le=d.attributeValueBegin}),l(se,u.gt,function(){Ae="",Re(_.attributeName,me),Re(_.attributeValue,Ae),ue="",le=d.data}),l(se,u.slash,function(){xe=!0,Ae="",Re(_.attributeName,me),Re(_.attributeValue,Ae),le=d.tagEnd}),l(se,u.char,function(_e){me+=_e}),se)),l(te,d.attributeNameEnd,(ne={},l(ne,u.space,h),l(ne,u.equal,function(){Re(_.attributeName,me),le=d.attributeValueBegin}),l(ne,u.gt,function(){Ae="",Re(_.attributeName,me),Re(_.attributeValue,Ae),ue="",le=d.data}),l(ne,u.char,function(_e){Ae="",Re(_.attributeName,me),Re(_.attributeValue,Ae),me=_e,le=d.attributeName}),ne)),l(te,d.attributeValueBegin,(re={},l(re,u.space,h),l(re,u.quote,function(_e){Me=_e,Ae="",le=d.attributeValue}),l(re,u.gt,function(){Ae="",Re(_.attributeValue,Ae),ue="",le=d.data}),l(re,u.char,function(_e){Me="",Ae=_e,le=d.attributeValue}),re)),l(te,d.attributeValue,(Z={},l(Z,u.space,function(_e){if(Me)Ae+=_e;else Re(_.attributeValue,Ae),le=d.attributeNameStart}),l(Z,u.quote,function(_e){if(Me===_e)Re(_.attributeValue,Ae),le=d.attributeNameStart;else Ae+=_e}),l(Z,u.gt,function(_e){if(Me)Ae+=_e;else Re(_.attributeValue,Ae),ue="",le=d.data}),l(Z,u.slash,function(_e){if(Me)Ae+=_e;else Re(_.attributeValue,Ae),xe=!0,le=d.tagEnd}),l(Z,u.char,function(_e){Ae+=_e}),Z)),te);var we=function(ye){if(j.debug)console.log(le,ye);var Se=ie.stateMachine[le],Ne=Se[m(ye)]||Se[u.error]||Se[u.char];Ne(ye)};return ie.write=function(_e){var ye=_e.length;for(var Se=0;Se<ye;Se++)we(_e[Se])},ie},g={State:d,Action:u,Type:_,create:A},f=g.Type,y={element:"element",text:"text"},x=function(j){return Object.assign({name:"",type:y.element,value:"",parent:null,attributes:{},children:[]},j)},C=function(j){j=Object.assign({stream:!1,parentNodes:!0,doneEvent:"done",tagPrefix:"tag:",emitTopLevelOnly:!1,debug:!1},j);var Y=void 0,X=void 0,K=void 0,J=void 0,ee=new c,se=function(re){switch(re.type){case f.openTag:if(K===null)K=X,K.name=re.value;else{var Z=x({name:re.value,parent:K});K.children.push(Z),K=Z}break;case f.closeTag:var te=K.parent;if(!j.parentNodes)K.parent=null;if(K.name!==re.value)break;if(j.stream&&te===X)X.children=[],K.parent=null;if(!j.emitTopLevelOnly||te===X)ee.emit(j.tagPrefix+K.name,K),ee.emit("tag",K.name,K);if(K===X)Y.removeAllListeners("data"),ee.emit(j.doneEvent,K),X=null;K=te;break;case f.text:if(K)K.children.push(x({type:y.text,value:re.value,parent:j.parentNodes?K:null}));break;case f.attributeName:J=re.value,K.attributes[J]="";break;case f.attributeValue:K.attributes[J]=re.value;break}};return ee.reset=function(){Y=g.create({debug:j.debug}),Y.on("data",se),X=x(),K=null,J="",ee.parse=Y.write},ee.reset(),ee},b=function(j,Y){Y=Object.assign({},Y,{stream:!1,tagPrefix:":"});var X=C(Y),K=void 0;return X.on("done",function(J){K=J}),X.parse(j),K},I={parseSync:b,create:C,NodeType:y},v=I.parseSync,P=function(j){var Y=v("<root>".concat(j,"</root>"),{parentNodes:!1}),X=Y.children&&Y.children.length>0&&Y.children.every(function(K){return K.name==="svg"});if(X)return Y.children.length===1?Y.children[0]:Y.children;else throw Error("nothing to parse")},M=function(j){return a(j,function(Y){if(!T(Y))return B(Y);return Y})},B=function(j){return j.replace(/[-|:]([a-z])/gi,function(Y,X){return X.toUpperCase()})},T=function(j){return/^(data|aria)(-\w+)/.test(j)},N=function(j){if(j){var Y=String(j);return/[&<>]/.test(Y)?"<![CDATA[".concat(Y.replace(/]]>/,"]]]]><![CDATA[>"),"]]>"):Y}return""},D=function(j){return String(j).replace(/&/g,"&amp;").replace(/'/g,"&apos;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},L=function(j){var Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},X=Y.transformNode,K=X===void 0?function(ne){return ne}:X,J=Y.camelcase,ee=J===void 0?!1:J,se=function(re){var Z=K(re);if(ee)Z=M(Z);return Z};return se(P(j))};function H(){for(var U=arguments.length,j=Array(U),Y=0;Y<U;Y++)j[Y]=arguments[Y];return new Promise(function(X,K){try{var J=L.apply(void 0,j);X(J)}catch(ee){K(ee)}})}var V=function U(j){var Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},X=Y.transformAttr,K=X===void 0?function(le,ue,de){return"".concat(le,'="').concat(de(ue),'"')}:X,J=Y.transformNode,ee=J===void 0?function(le){return le}:J,se=Y.selfClose,ne=se===void 0?!0:se;if(Array.isArray(j))return j.map(function(le){return U(le,{transformAttr:K,selfClose:ne,transformNode:ee})}).join("");var re=ee(j);if(re.type==="text")return N(re.value);var Z="";for(var te in re.attributes){var ie=K(te,re.attributes[te],D,re.name);Z+=ie?" ".concat(ie):""}return re.children&&re.children.length>0||!ne?"<".concat(re.name).concat(Z,">").concat(U(re.children,{transformAttr:K,transformNode:ee,selfClose:ne}),"</").concat(re.name,">"):"<".concat(re.name).concat(Z,"/>")},O=Object.assign({},{parse:H,parseSync:L,stringify:V});return O})});var NHe,d5,KPo=0.09,$Po=0.692052,qPo=0.692052,JPo=1.152,ZPo=0,E2e,Oj,M2e,A3;var H9=ba(()=>{NHe={"0":"M0.301025 0.257813 L0.206593 0.283385 L0.122042 0.361307 L0.075923 0.474441 L0.064942 0.642221 L0.091296 0.78289 L0.159376 0.899463 L0.257104 0.961214 L0.344948 0.961214 L0.442678 0.899463 L0.510757 0.78289 L0.537111 0.642221 L0.526131 0.474441 L0.480012 0.361307 L0.39546 0.283385 L0.301025 0.257813","1":"M0.220426 0.40845 L0.381626 0.270996 L0.381626 0.948966","2":"M0.110409 0.39212 L0.125621 0.342293 L0.170571 0.295823 L0.244237 0.26431 L0.291518 0.257813 L0.373319 0.263799 L0.434683 0.290705 L0.468239 0.331966 L0.480292 0.379913 L0.479492 0.411806 L0.465088 0.465192 L0.402571 0.568988 L0.245134 0.766438 L0.07959 0.948045 L0.522462 0.948045","3":"M0.081606 0.345073 L0.119154 0.315633 L0.178996 0.284091 L0.255265 0.257813 L0.349133 0.263062 L0.43127 0.289348 L0.48994 0.336662 L0.525141 0.394491 L0.513407 0.457577 L0.466472 0.504892 L0.384334 0.541692 L0.290464 0.56272 L0.20833 0.573235 L0.290464 0.583749 L0.384334 0.610035 L0.466472 0.652092 L0.519274 0.709922 L0.531007 0.773007 L0.50754 0.841351 L0.454738 0.899179 L0.3726 0.946494 L0.310412 0.961214 L0.209503 0.959111 L0.127367 0.946494 L0.071046 0.929671","4":"M0.418494 0.270996 L0.048828 0.724199 L0.553224 0.724199 M0.414181 0.578167 L0.414181 0.94897","5":"M0.074951 0.270996 L0.074951 0.614701 L0.267655 0.5695 L0.405247 0.586502 L0.460002 0.617189 L0.498028 0.660731 L0.527101 0.779401 L0.513352 0.841049 L0.477274 0.889568 L0.406378 0.93463 L0.324445 0.958337 L0.247399 0.962139 L0.182516 0.949767 L0.130068 0.925508 L0.074951 0.875607 M0.074951 0.270996 L0.527101 0.270996","6":"M0.428549 0.257813 L0.341433 0.285053 L0.26073 0.312099 L0.192188 0.360182 L0.138902 0.410969 L0.098219 0.500422 L0.070249 0.584267 L0.067264 0.670716 L0.065164 0.756863 L0.087163 0.820973 L0.108168 0.861042 L0.157916 0.913131 L0.210981 0.948192 L0.29279 0.961214 L0.384548 0.956206 L0.456409 0.924151 L0.507262 0.881077 L0.5349 0.821975 L0.537111 0.771889 L0.521634 0.718798 L0.498418 0.67372 L0.463042 0.636657 L0.414398 0.613617 L0.34696 0.598591 L0.28284 0.595587 L0.215403 0.605604 L0.145756 0.641665 L0.109274 0.678729 L0.064942 0.724006","7":"M0.071534 0.270996 L0.530519 0.270996 L0.495935 0.291702 L0.477752 0.305407 L0.435186 0.346112 L0.412067 0.374136 L0.388565 0.40796 L0.365315 0.448098 L0.342943 0.495062 L0.322081 0.549366 L0.303364 0.611524 L0.287416 0.68205 L0.270077 0.80465 L0.26253 0.94897","8":"M0.286761 0.257813 L0.210684 0.27162 L0.1414 0.305622 L0.092494 0.382125 L0.111513 0.450128 L0.16857 0.502193 L0.228345 0.539382 L0.377781 0.594635 L0.470161 0.645637 L0.52586 0.706203 L0.538087 0.792269 L0.506841 0.87621 L0.438915 0.927212 L0.339743 0.961214 L0.263666 0.959089 L0.174004 0.929337 L0.102003 0.881523 L0.063965 0.811395 L0.066682 0.741266 L0.102003 0.671139 L0.180797 0.608448 L0.259591 0.580822 L0.358762 0.548945 L0.456576 0.49688 L0.486463 0.446941 L0.487822 0.362999 L0.453859 0.302434 L0.384574 0.265245 L0.286761 0.257813","9":"M0.511026 0.437812 L0.491026 0.347812 L0.451026 0.297812 L0.391026 0.267812 L0.311026 0.257813 L0.231026 0.267812 L0.161026 0.297812 L0.111026 0.347812 L0.091026 0.417812 L0.111026 0.487812 L0.161026 0.537812 L0.231026 0.567812 L0.311026 0.577812 L0.391026 0.557812 L0.451026 0.517812 L0.491026 0.477812 L0.511026 0.437812 M0.510026 0.438812 L0.434026 0.636812 L0.381026 0.777812 L0.337026 0.879812 L0.301026 0.957812","!":"M0.301026 0.270996 L0.301026 0.749566 M0.251466 0.94897 L0.350587 0.94897",'"':"M0.16504 0.270996 L0.16504 0.523022 M0.437013 0.270996 L0.437013 0.523022","#":"M0.20958 0.282227 L0.146515 0.949754 M0.461844 0.282227 L0.398779 0.949754 M0.032999 0.526969 L0.600587 0.452796 M0.001465 0.82366 L0.569055 0.749486",$:"M0.307121 0.240234 L0.307121 1.083502 M0.490031 0.415915 L0.404676 0.328075 L0.23396 0.310507 L0.136407 0.398347 L0.099828 0.521324 L0.124213 0.591596 L0.197379 0.644299 L0.429061 0.697003 L0.502224 0.749708 L0.526613 0.837547 L0.477836 0.960526 L0.355897 1.013228 L0.197379 0.99566 L0.112021 0.942957 L0.07544 0.837547","'":"M0.301026 0.270996 L0.301026 0.523022","(":"M0.413087 0.241211 L0.372337 0.28347 L0.331589 0.334184 L0.290838 0.393349 L0.25009 0.460965 L0.219528 0.528584 L0.199153 0.5962 L0.188966 0.655364 L0.199153 0.714529 L0.219528 0.782146 L0.25009 0.849764 L0.290838 0.91738 L0.331589 0.976544 L0.372337 1.027258 L0.413087 1.069491",")":"M0.188966 0.241211 L0.229716 0.28347 L0.270466 0.334184 L0.311213 0.393349 L0.351964 0.460965 L0.382526 0.528584 L0.4029 0.5962 L0.413087 0.655364 L0.4029 0.714529 L0.382526 0.782146 L0.351964 0.849764 L0.311213 0.91738 L0.270466 0.976544 L0.229716 1.027258 L0.188966 1.069491","*":"M0.301026 0.458702 L0.301026 0.681942 M0.301026 0.458702 L0.520997 0.536834 M0.301026 0.458702 L0.439954 0.257813 M0.301026 0.458702 L0.162098 0.257813 M0.301026 0.458702 L0.081055 0.536834","+":"M0.042969 0.66845 L0.559083 0.66845 M0.301023 0.428223 L0.301023 0.908661",",":"M0.38672 0.852051 L0.215333 1.030661 L0.301025 1.119971","-":"M0.173829 0.686035 L0.428224 0.686035",".":"M0.362549 0.851074 L0.239503 0.851074","/":"M0.062501 1.035249 L0.539551 0.270996","<":"M0.559083 0.441895 L0.042969 0.66939 L0.042969 0.66939 L0.559083 0.896902","=":"M0.042969 0.545898 L0.559083 0.545898 M0.042969 0.80837 L0.559083 0.80837",">":"M0.042969 0.441895 L0.559083 0.66939 L0.559083 0.66939 L0.042969 0.896902",A:"M0.018067 0.94897 L0.290179 0.270996 L0.583986 0.94897 M0.155303 0.684521 L0.433548 0.684521",B:"M0.063965 0.94897 L0.063965 0.278953 L0.209356 0.270996 L0.342486 0.294394 L0.432179 0.37292 L0.418224 0.48773 L0.312686 0.549166 L0.084728 0.575531 L0.306377 0.589434 L0.468877 0.647456 L0.538087 0.736658 L0.5324 0.85202 L0.501247 0.902983 L0.42355 0.944398 L0.063965 0.94897",C:"M0.529054 0.419847 L0.498425 0.345196 L0.442238 0.292341 L0.33583 0.257813 L0.257199 0.268357 L0.187906 0.303748 L0.120243 0.385432 L0.072998 0.599844 L0.110073 0.815385 L0.165381 0.902183 L0.222883 0.942801 L0.334904 0.961214 L0.43253 0.937679 L0.504816 0.868999 L0.529054 0.772065",D:"M0.064454 0.94897 L0.071838 0.285078 L0.171217 0.270996 L0.247348 0.272633 L0.37101 0.306078 L0.462461 0.378304 L0.514748 0.475555 L0.535591 0.576392 L0.537599 0.652313 L0.528065 0.717381 L0.508562 0.772419 L0.445948 0.855695 L0.362356 0.90871 L0.225203 0.945862 L0.064454 0.94897",E:"M0.080078 0.270996 L0.080078 0.94897 M0.080078 0.270996 L0.521974 0.270996 M0.080078 0.609981 L0.389405 0.609981 M0.080078 0.94897 L0.521974 0.94897",F:"M0.086426 0.270996 L0.086426 0.94897 M0.091304 0.275607 L0.515626 0.275607 M0.091304 0.607677 L0.447344 0.607677",G:"M0.498034 0.284943 L0.374621 0.257813 L0.244219 0.268648 L0.160577 0.311997 L0.094556 0.398116 L0.056397 0.58404 L0.076752 0.785532 L0.120865 0.858197 L0.188947 0.916734 L0.271008 0.953591 L0.357069 0.961214 L0.43715 0.932047 L0.501262 0.858539 L0.545656 0.648611 L0.329595 0.648131",H:"M0.066895 0.270996 L0.066895 0.94897 M0.066895 0.595658 L0.530009 0.595658 M0.535157 0.270996 L0.535157 0.94897",I:"M0.301026 0.270996 L0.301026 0.94897",J:"M0.506839 0.270996 L0.507814 0.782193 L0.498468 0.846168 L0.480733 0.880789 L0.455864 0.90832 L0.426095 0.929408 L0.360746 0.954812 L0.302508 0.962139 L0.223573 0.953638 L0.16538 0.930312 L0.137072 0.907715 L0.116428 0.880312 L0.102822 0.848819 L0.095633 0.813947 L0.094239 0.776413",K:"M0.035401 0.270996 L0.035401 0.94897 M0.502258 0.316194 L0.035401 0.687823 M0.212484 0.582361 L0.566652 0.933903",L:"M0.07544 0.270996 L0.07544 0.94897 L0.526613 0.94897",M:"M0.042481 0.94897 L0.042481 0.270996 L0.301027 0.712492 L0.559571 0.270996 L0.559571 0.94897",N:"M0.067871 0.94897 L0.067871 0.270996 L0.534181 0.94897 L0.525031 0.270996",O:"M0.287293 0.961214 L0.19843 0.933567 L0.1172 0.849451 L0.057129 0.563945 L0.114348 0.350255 L0.18455 0.289392 L0.306101 0.257813 L0.42054 0.29572 L0.487543 0.365003 L0.544923 0.625294 L0.516366 0.789624 L0.465476 0.884596 L0.375084 0.949287 L0.287293 0.961214",P:"M0.070557 0.94897 L0.070557 0.28379 L0.20704 0.270996 L0.329134 0.278993 L0.408525 0.300514 L0.444022 0.317908 L0.500637 0.368929 L0.525796 0.423728 L0.531496 0.50384 L0.508934 0.554205 L0.473724 0.582043 L0.417577 0.604365 L0.336375 0.620372 L0.226014 0.629268 L0.082368 0.630258",Q:"M0.282435 1.050813 L0.195447 1.019646 L0.115933 0.924817 L0.057129 0.602943 L0.113139 0.362034 L0.18186 0.293418 L0.300844 0.257813 L0.412868 0.300553 L0.478457 0.37866 L0.534625 0.672103 L0.506671 0.857367 L0.456855 0.964437 L0.368371 1.037368 L0.282435 1.050813 M0.341225 0.815559 L0.544923 1.070653",R:"M0.034912 0.944112 L0.034912 0.288556 L0.227127 0.270996 L0.362038 0.276867 L0.443423 0.294907 L0.477644 0.309614 L0.505809 0.328757 L0.526616 0.352817 L0.544963 0.418061 L0.543241 0.475921 L0.524463 0.517817 L0.49076 0.546518 L0.444265 0.564799 L0.355195 0.578739 L0.047653 0.589627 M0.303054 0.617306 L0.56714 0.94897",S:"M0.483037 0.364333 L0.407613 0.267477 L0.22883 0.257813 L0.128623 0.327565 L0.087712 0.455539 L0.104656 0.518727 L0.168054 0.573307 L0.41928 0.617318 L0.503796 0.669342 L0.535157 0.759324 L0.493846 0.900055 L0.367668 0.961214 L0.205436 0.956661 L0.116711 0.907038 L0.066895 0.790334",T:"M0.022949 0.270996 L0.579103 0.270996 M0.309284 0.270996 L0.309284 0.94897",U:"M0.072022 0.270996 L0.07308 0.648875 L0.080372 0.75167 L0.099024 0.827813 L0.134786 0.885729 L0.181571 0.924023 L0.251464 0.95168 L0.339655 0.962139 L0.401553 0.951668 L0.45232 0.924086 L0.482701 0.891771 L0.495745 0.870529 L0.515699 0.81637 L0.525014 0.744626 L0.530031 0.272017",V:"M0.027832 0.270996 L0.320083 0.94897 L0.57422 0.270996",W:"M0 0.270996 L0.079799 0.940377 L0.285198 0.472884 L0.505255 0.94897 L0.602052 0.270996",X:"M0.009034 0.270996 L0.586805 0.94897 M0.593019 0.270996 L0.015246 0.94897",Y:"M0.018067 0.270996 L0.293132 0.574135 M0.583986 0.271959 L0.294954 0.57606 L0.305277 0.94897",Z:"M0.053711 0.270996 L0.548341 0.270996 L0.053711 0.94897 L0.548341 0.94897","[":"M0.404542 0.240234 L0.197511 0.240234 L0.197511 1.069424 L0.404542 1.069424","\\":"M0.062501 0.270996 L0.539551 1.035249","]":"M0.19751 0.240234 L0.404542 0.240234 L0.404542 1.069424 L0.19751 1.069424","^":"M0.035156 0.523931 L0.301024 0.270996 L0.566896 0.523931",_:"M0 1.160601 L0.602052 1.160601",a:"M0.527101 0.439941 L0.527101 0.973965 M0.527101 0.553824 L0.451366 0.477535 L0.376759 0.439941 L0.263722 0.439941 L0.187989 0.477535 L0.112255 0.553824 L0.074951 0.66881 L0.074951 0.745099 L0.112255 0.85898 L0.187989 0.93527 L0.263722 0.973965 L0.376759 0.973965 L0.451366 0.93527 L0.527101 0.85898",b:"M0.07666 0.240234 L0.07666 0.959985 M0.07666 0.582737 L0.151822 0.514237 L0.225865 0.480483 L0.338045 0.480483 L0.413211 0.514237 L0.488374 0.582737 L0.525392 0.685983 L0.525392 0.754485 L0.488374 0.856739 L0.413211 0.92524 L0.338045 0.959985 L0.225865 0.959985 L0.151822 0.92524 L0.07666 0.856739",c:"M0.512452 0.553823 L0.441624 0.477535 L0.371854 0.439941 L0.26614 0.439941 L0.195312 0.477535 L0.124486 0.553823 L0.0896 0.668808 L0.0896 0.745099 L0.124486 0.858979 L0.195312 0.93527 L0.26614 0.973965 L0.371854 0.973965 L0.441624 0.93527 L0.512452 0.858979",d:"M0.525392 0.240234 L0.525392 0.959985 M0.525392 0.582737 L0.450232 0.514237 L0.376189 0.480483 L0.264006 0.480483 L0.188844 0.514237 L0.11368 0.582737 L0.076661 0.685983 L0.076661 0.754485 L0.11368 0.856739 L0.188844 0.92524 L0.264006 0.959985 L0.376189 0.959985 L0.450232 0.92524 L0.525392 0.856739",e:"M0.059571 0.668808 L0.542482 0.668808 M0.542482 0.592521 L0.502641 0.516231 L0.461594 0.477535 L0.381914 0.439941 L0.261186 0.439941 L0.180299 0.477535 L0.099412 0.553823 L0.059571 0.668808 L0.059571 0.745099 L0.099412 0.858979 L0.180299 0.93527 L0.261186 0.973965 L0.381914 0.973965 L0.461594 0.93527 L0.542482 0.858979",f:"M0.512941 0.240234 L0.406984 0.240234 L0.301026 0.274346 L0.248047 0.374731 L0.248047 0.946817 M0.089112 0.476088 L0.459965 0.476088",g:"M0.525392 0.439941 L0.525392 0.989395 L0.488373 1.091918 L0.45023 1.126757 L0.376189 1.160601 L0.264004 1.160601 L0.188844 1.126757 L0.113681 1.058075 L0.076661 0.954555 M0.525392 0.542467 L0.45023 0.473786 L0.376189 0.439941 L0.264004 0.439941 L0.188844 0.473786 L0.113681 0.542467 L0.076661 0.645988 L0.076661 0.714669 L0.113681 0.817193 L0.188844 0.885875 L0.264004 0.920713 L0.376189 0.920713 L0.45023 0.885875 L0.525392 0.817193",h:"M0.092041 0.240234 L0.092041 0.946817 M0.092041 0.61058 L0.205937 0.509225 L0.282214 0.476086 L0.396109 0.476086 L0.47187 0.509225 L0.510011 0.61058 L0.510011 0.946817",i:"M0.261026 0.240234 L0.341026 0.240234 M0.300978 0.476089 L0.300978 0.946817",j:"M0.3853 0.240234 L0.447023 0.240234 M0.416159 0.465708 L0.416159 1.011689 L0.383887 1.108586 L0.252832 1.140264 L0.15503 1.108586",k:"M0.065186 0.240234 L0.065186 0.946817 M0.493824 0.476086 L0.065186 0.812323 M0.236758 0.677829 L0.536867 0.946817",l:"M0.301026 0.234863 L0.301026 0.946441",m:"M0.050538 0.439941 L0.050538 0.960796 M0.050538 0.588758 L0.114405 0.476607 L0.157178 0.439941 L0.236864 0.439941 L0.279637 0.476607 L0.32241 0.588758 L0.32241 0.960796 M0.32241 0.588758 L0.386281 0.476607 L0.428467 0.439941 L0.50874 0.439941 L0.551515 0.476607 L0.551515 0.960796",n:"M0.092041 0.439941 L0.092041 0.960796 M0.092041 0.588758 L0.205936 0.476607 L0.282216 0.439941 L0.396113 0.439941 L0.471871 0.476607 L0.510011 0.588758 L0.510011 0.960796",o:"M0.247175 0.439941 L0.175178 0.477535 L0.103186 0.553823 L0.066895 0.668808 L0.066895 0.745099 L0.103186 0.858979 L0.175178 0.93527 L0.247175 0.973965 L0.354874 0.973965 L0.426872 0.93527 L0.498866 0.858979 L0.535157 0.745099 L0.535157 0.668808 L0.498866 0.553823 L0.426872 0.477535 L0.354874 0.439941 L0.247175 0.439941",p:"M0.076904 0.439941 L0.076904 1.154244 M0.076904 0.541563 L0.151986 0.473487 L0.225944 0.439941 L0.338005 0.439941 L0.413087 0.473487 L0.488166 0.541563 L0.525148 0.644169 L0.525148 0.712246 L0.488166 0.813866 L0.413087 0.881942 L0.338005 0.916471 L0.225944 0.916471 L0.151986 0.881942 L0.076904 0.813866",q:"M0.525148 0.441895 L0.525148 1.156195 M0.525148 0.5435 L0.450067 0.47544 L0.376106 0.441895 L0.264042 0.441895 L0.188966 0.47544 L0.113885 0.5435 L0.076905 0.646108 L0.076905 0.714187 L0.113885 0.815809 L0.188966 0.883886 L0.264042 0.918418 L0.376106 0.918418 L0.450067 0.883886 L0.525148 0.815809",r:"M0.107422 0.439941 L0.107422 0.960796 M0.107422 0.663164 L0.155824 0.551014 L0.252626 0.476607 L0.349428 0.439941 L0.49463 0.439941",s:"M0.475556 0.477535 L0.400757 0.439941 L0.276092 0.439941 L0.176361 0.477535 L0.101563 0.553823 L0.101563 0.630112 L0.176361 0.668808 L0.301024 0.668808 L0.425688 0.745099 L0.50049 0.821387 L0.50049 0.897677 L0.425688 0.93527 L0.325956 0.973965 L0.201295 0.973965 L0.126496 0.93527 L0.101563 0.858979",t:"M0.246032 0.297852 L0.246032 0.826549 L0.301023 0.919323 L0.411011 0.950848 L0.520997 0.950848 M0.081055 0.515799 L0.466004 0.515799",u:"M0.092041 0.454102 L0.092041 0.826134 L0.13018 0.937211 L0.205936 0.974954 L0.319832 0.974954 L0.396113 0.937211 L0.510011 0.826134 M0.510011 0.454102 L0.510011 0.974954",v:"M0.048828 0.453125 L0.301026 0.961719 M0.553224 0.453125 L0.301026 0.961719",w:"M0 0.453125 L0.150512 0.961719 M0.301024 0.453125 L0.150512 0.961719 M0.301024 0.453125 L0.451539 0.961719 M0.602052 0.453125 L0.451539 0.961719",x:"M0.03711 0.453125 L0.564943 0.961719 M0.564943 0.453125 L0.03711 0.961719",y:"M0.084618 0.453125 L0.320232 0.921476 M0.55713 0.453125 L0.320232 0.921476 L0.242119 1.055289 L0.163369 1.122196 L0.084618 1.155166 L0.044922 1.155166",z:"M0.505373 0.452148 L0.09668 0.961651 M0.09668 0.452148 L0.505373 0.452148 M0.09668 0.961651 L0.505373 0.961651"},d5={};for(let e in NHe){d5[e]=[];let t=NHe[e].split("M").slice(1).map((n)=>n.split("L").map((o)=>o.trim().split(" ").map(parseFloat)));for(let n of t)for(let o=0;o<n.length-1;o++)d5[e].push({x1:n[o][0],y1:1-n[o][1],x2:n[o+1][0],y2:1-n[o+1][1]})}E2e=d5,Oj={"0":0.692052,"1":0.692052,"2":0.692052,"3":0.692052,"4":0.692052,"5":0.692052,"6":0.692052,"7":0.692052,"8":0.692052,"9":0.692052,"!":0.692052,'"':0.692052,"#":0.692052,$:0.692052,"'":0.692052,"(":0.692052,")":0.692052,"*":0.692052,"+":0.692052,",":0.692052,"-":0.692052,".":0.692052,"/":0.692052,"<":0.692052,"=":0.692052,">":0.692052,A:0.692052,B:0.692052,C:0.692052,D:0.692052,E:0.692052,F:0.692052,G:0.692052,H:0.692052,I:0.692052,J:0.692052,K:0.692052,L:0.692052,M:0.692052,N:0.692052,O:0.692052,P:0.692052,Q:0.692052,R:0.692052,S:0.692052,T:0.692052,U:0.692052,V:0.692052,W:0.692052,X:0.692052,Y:0.692052,Z:0.692052,"[":0.692052,"\\":0.692052,"]":0.692052,"^":0.692052,_:0.692052,a:0.692052,b:0.692052,c:0.692052,d:0.692052,e:0.692052,f:0.692052,g:0.692052,h:0.692052,i:0.692052,j:0.692052,k:0.692052,l:0.692052,m:0.692052,n:0.692052,o:0.692052,p:0.692052,q:0.692052,r:0.692052,s:0.692052,t:0.692052,u:0.692052,v:0.692052,w:0.692052,x:0.692052,y:0.692052,z:0.692052," ":0.692052},M2e={},A3={glyphWidthRatio:$Po,spaceWidthRatio:qPo,lineHeightRatio:JPo,strokeWidthRatio:KPo,letterSpacingRatio:ZPo}});var yMt=pt(function(yws,fMt){var dK=1000,uK=dK*60,pK=uK*60,MO=pK*24,gzo=MO*7,Azo=MO*365.25;fMt.exports=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0)return fzo(e);else if(n==="number"&&isFinite(e))return t.long?xzo(e):yzo(e);throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function fzo(e){if(e=String(e),e.length>100)return;var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!t)return;var n=parseFloat(t[1]),o=(t[2]||"ms").toLowerCase();switch(o){case"years":case"year":case"yrs":case"yr":case"y":return n*Azo;case"weeks":case"week":case"w":return n*gzo;case"days":case"day":case"d":return n*MO;case"hours":case"hour":case"hrs":case"hr":case"h":return n*pK;case"minutes":case"minute":case"mins":case"min":case"m":return n*uK;case"seconds":case"second":case"secs":case"sec":case"s":return n*dK;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}function yzo(e){var t=Math.abs(e);if(t>=MO)return Math.round(e/MO)+"d";if(t>=pK)return Math.round(e/pK)+"h";if(t>=uK)return Math.round(e/uK)+"m";if(t>=dK)return Math.round(e/dK)+"s";return e+"ms"}function xzo(e){var t=Math.abs(e);if(t>=MO)return Q1e(e,t,MO,"day");if(t>=pK)return Q1e(e,t,pK,"hour");if(t>=uK)return Q1e(e,t,uK,"minute");if(t>=dK)return Q1e(e,t,dK,"second");return e+" ms"}function Q1e(e,t,n,o){var r=t>=n*1.5;return Math.round(e/n)+" "+o+(r?"s":"")}});var CMt=pt(function(xws,xMt){function Czo(e){n.debug=n,n.default=n,n.coerce=c,n.disable=s,n.enable=r,n.enabled=a,n.humanize=yMt(),n.destroy=l,Object.keys(e).forEach((h)=>{n[h]=e[h]}),n.names=[],n.skips=[],n.formatters={};function t(h){let d=0;for(let u=0;u<h.length;u++)d=(d<<5)-d+h.charCodeAt(u),d|=0;return n.colors[Math.abs(d)%n.colors.length]}n.selectColor=t;function n(h){let d,u=null,_,p;function m(...A){if(!m.enabled)return;let g=m,f=Number(new Date),y=f-(d||f);if(g.diff=y,g.prev=d,g.curr=f,d=f,A[0]=n.coerce(A[0]),typeof A[0]!=="string")A.unshift("%O");let x=0;A[0]=A[0].replace(/%([a-zA-Z%])/g,(b,I)=>{if(b==="%%")return"%";x++;let v=n.formatters[I];if(typeof v==="function"){let P=A[x];b=v.call(g,P),A.splice(x,1),x--}return b}),n.formatArgs.call(g,A),(g.log||n.log).apply(g,A)}if(m.namespace=h,m.useColors=n.useColors(),m.color=n.selectColor(h),m.extend=o,m.destroy=n.destroy,Object.defineProperty(m,"enabled",{enumerable:!0,configurable:!1,get:()=>{if(u!==null)return u;if(_!==n.namespaces)_=n.namespaces,p=n.enabled(h);return p},set:(A)=>{u=A}}),typeof n.init==="function")n.init(m);return m}function o(h,d){let u=n(this.namespace+(typeof d>"u"?":":d)+h);return u.log=this.log,u}function r(h){n.save(h),n.namespaces=h,n.names=[],n.skips=[];let d=(typeof h==="string"?h:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let u of d)if(u[0]==="-")n.skips.push(u.slice(1));else n.names.push(u)}function i(h,d){let u=0,_=0,p=-1,m=0;while(u<h.length)if(_<d.length&&(d[_]===h[u]||d[_]==="*"))if(d[_]==="*")p=_,m=u,_++;else u++,_++;else if(p!==-1)_=p+1,m++,u=m;else return!1;while(_<d.length&&d[_]==="*")_++;return _===d.length}function s(){let h=[...n.names,...n.skips.map((d)=>"-"+d)].join(",");return n.enable(""),h}function a(h){for(let d of n.skips)if(i(h,d))return!1;for(let d of n.names)if(i(h,d))return!0;return!1}function c(h){if(h instanceof Error)return h.stack||h.message;return h}function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}xMt.exports=Czo});var j0=pt(function(Qze,k1e){Qze.formatArgs=Izo;Qze.save=vzo;Qze.load=Szo;Qze.useColors=bzo;Qze.storage=Pzo();Qze.destroy=(()=>{let e=!1;return()=>{if(!e)e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}})();Qze.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function bzo(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function Izo(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+k1e.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;e.splice(1,0,t,"color: inherit");let n=0,o=0;e[0].replace(/%[a-zA-Z%]/g,(r)=>{if(r==="%%")return;if(n++,r==="%c")o=n}),e.splice(o,0,t)}Qze.log=console.debug||console.log||(()=>{});function vzo(e){try{if(e)Qze.storage.setItem("debug",e);else Qze.storage.removeItem("debug")}catch(t){}}function Szo(){let e;try{e=Qze.storage.getItem("debug")||Qze.storage.getItem("DEBUG")}catch(t){}if(!e&&typeof process<"u"&&"env"in process)e=process.env.DEBUG;return e}function Pzo(){try{return localStorage}catch(e){}}k1e.exports=CMt()(Qze);var{formatters:Ezo}=k1e.exports;Ezo.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var vMt=pt(function(IMt,Hse){(function(){var e,t,n,o,r,i;if(typeof performance<"u"&&performance!==null&&performance.now)Hse.exports=function(){return performance.now()};else if(typeof process<"u"&&process!==null&&process.hrtime)Hse.exports=function(){return(e()-r)/1e6},t=process.hrtime,e=function(){var s=t();return s[0]*1e9+s[1]},o=e(),i=process.uptime()*1e9,r=o-i;else if(Date.now)Hse.exports=function(){return Date.now()-n},n=Date.now();else Hse.exports=function(){return new Date().getTime()-n},n=new Date().getTime()}).call(IMt)});var DO=pt(function(vBs,Awt){Awt.exports={trueFunc:function(){return!0},falseFunc:function(){return!1}}});function v3(e,t){return Array.isArray(t)?[e.a*t[0]+e.c*t[1]+e.e,e.b*t[0]+e.d*t[1]+e.f]:{x:e.a*t.x+e.c*t.y+e.e,y:e.b*t.x+e.d*t.y+e.f}}function kwt(e){return typeof e>"u"}function Lwt(e,t=0){return{a:1,c:0,e,b:0,d:1,f:t}}function Hxe(...e){e=Array.isArray(e[0])?e[0]:e;let t=(n,o)=>({a:n.a*o.a+n.c*o.b,c:n.a*o.c+n.c*o.d,e:n.a*o.e+n.c*o.f+n.e,b:n.b*o.a+n.d*o.b,d:n.b*o.c+n.d*o.d,f:n.b*o.e+n.d*o.f+n.f});switch(e.length){case 0:throw Error("no matrices provided");case 1:return e[0];case 2:return t(e[0],e[1]);default:{let[n,o,...r]=e,i=t(n,o);return Hxe(i,...r)}}}function aVo(e,t,n){let o=iVo(e),r=sVo(e),i={a:o,c:-r,e:0,b:r,d:o,f:0};return kwt(t)||kwt(n)?i:Hxe([Lwt(t,n),i,Lwt(-t,-n)])}function cVo(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n}function Fxe(e,t,n,o){var r=Error.call(this,e);return Object.setPrototypeOf&&Object.setPrototypeOf(r,Fxe.prototype),r.expected=t,r.found=n,r.location=o,r.name="SyntaxError",r}function sOe(e,t,n){return n=n||" ",e.length>t?e:(t-=e.length,n+=n.repeat(t),e+n.slice(0,t))}function zw(e){if(e.length===0)return{minX:0,maxX:0,minY:0,maxY:0};let t=1/0,n=-1/0,o=1/0,r=-1/0,i=(s)=>{t=Math.min(t,s.x),n=Math.max(n,s.x),o=Math.min(o,s.y),r=Math.max(r,s.y)};return e.forEach((s)=>{switch(s.type){case"path":s.points.forEach(i);break;case"text":i({x:s.x,y:s.y});break;case"circle":{let{x:a,y:c,radius:l}=s;i({x:a-l,y:c-l}),i({x:a+l,y:c+l});break}case"box":{let{x:a,y:c,width:l,height:h}=s,d=l/2,u=h/2;i({x:a-d,y:c-u}),i({x:a+d,y:c+u});break}}}),{minX:t,maxX:n,minY:o,maxY:r}}function Gl(e){let t=e.size;if(!t){let n=zw(e.primitives);t={width:n.maxX-n.minX,height:n.maxY-n.minY}}return{...e,size:t}}function EXo(e){return typeof e=="object"}function nae(e,t){return{width:Math.max(...t.map((n)=>Math.abs(n.x-e.x)))*2,height:Math.max(...t.map((n)=>Math.abs(n.y-e.y)))*2}}function cZo(e){return typeof e=="object"}function eer(e){return typeof e=="object"}function D5e(e,t){let{width:n,height:o}=e.size,r=1,i=1;t.width!==void 0&&t.height!==void 0?(r=t.width/n,i=t.height/o):t.width!==void 0?r=i=t.width/n:t.height!==void 0&&(r=i=t.height/o);let s=e.primitives.map((a)=>{switch(a.type){case"path":return{...a,points:a.points.map((c)=>({x:c.x*r,y:c.y*i}))};case"text":return{...a,x:a.x*r,y:a.y*i,fontSize:a.fontSize?a.fontSize*r:void 0};case"circle":return{...a,x:a.x*r,y:a.y*i,radius:a.radius*r};case"box":return{...a,x:a.x*r,y:a.y*i,width:a.width*r,height:a.height*i};default:return a}});return{...e,primitives:s,center:{x:e.center.x*r,y:e.center.y*i},ports:e.ports.map((a)=>({...a,x:a.x*r,y:a.y*i})),size:{width:n*r,height:o*i}}}function Cer(e){return typeof e=="object"}function wer(e){return typeof e=="object"}var iVo,sVo,LDs,HDs,lVo=(e,t="right")=>{switch(t){case"down":switch(e){case"middle_top":return"middle_right";case"middle_bottom":return"middle_left";case"middle_left":return"middle_bottom";case"middle_right":return"middle_top"}break;case"up":switch(e){case"middle_top":return"middle_left";case"middle_bottom":return"middle_right";case"middle_left":return"middle_top";case"middle_right":return"middle_bottom"}break;case"left":switch(e){case"middle_top":return"middle_bottom";case"middle_bottom":return"middle_top";case"middle_left":return"middle_right";case"middle_right":return"middle_left"}break;case"right":return e}return e},CK=(e,t)=>{let{primitives:n,center:o,ports:r,size:i}=e,s=Hxe({a:1,b:0,c:0,d:-1,e:0,f:2*o.y}),a=n.map((l)=>{switch(l={...l},l.type){case"path":return{...l,points:l.points.map((_)=>v3(s,_))};case"text":let h=v3(s,{x:l.x,y:l.y}),d={top_left:"bottom_left",top_right:"bottom_right",bottom_left:"top_left",bottom_right:"top_right",center:"center",middle_top:"middle_bottom",middle_bottom:"middle_top",middle_left:"middle_left",middle_right:"middle_right"};return{...l,x:h.x,y:h.y,anchor:d[l.anchor]};case"circle":case"box":let u=v3(s,{x:l.x,y:l.y});return{...l,x:u.x,y:u.y}}}),c=r.map((l)=>({...l,...v3(s,l)}));return{primitives:a,center:o,ports:c,size:i,...t}},Y9=(e,t)=>{let{primitives:n,center:o,ports:r,size:i}=e,s=Hxe({a:-1,b:0,c:0,d:1,e:0,f:2*o.x}),a=n.map((l)=>{switch(l={...l},l.type){case"path":return{...l,points:l.points.map((_)=>v3(s,_))};case"text":let h=v3(s,{x:l.x,y:l.y}),d={top_left:"top_right",top_right:"top_left",bottom_left:"bottom_right",bottom_right:"bottom_left",center:"center",middle_top:"middle_top",middle_bottom:"middle_bottom",middle_left:"middle_right",middle_right:"middle_left"};return{...l,x:h.x,y:h.y,anchor:d[l.anchor]};case"circle":case"box":let u=v3(s,{x:l.x,y:l.y});return{...l,x:u.x,y:u.y}}}),c=r.map((l)=>({...l,...v3(s,l)}));return{primitives:a,center:o,ports:c,size:i,...t}},Zse=(e,t)=>{let{newOrientation:n,overrides:o}=t,r={up:Math.PI/2,right:0,down:-Math.PI/2,left:-Math.PI},i=aVo(n?r[n]:Math.PI/2,e.center.x,e.center.y),{primitives:s,center:a,size:c,ports:l}=e,h=s.map((_)=>{switch(_={..._},_.type){case"path":return{..._,points:_.points.map((g)=>v3(i,g))};case"text":let p=v3(i,{x:_.x,y:_.y});return _.anchor=lVo(_.anchor,n??"right"),{..._,x:p.x,y:p.y};case"circle":let m=v3(i,{x:_.x,y:_.y});return{..._,x:m.x,y:m.y};case"box":let A=v3(i,{x:_.x,y:_.y});return{..._,x:A.x,y:A.y,width:_.height,height:_.width}}}),d=l.map((_)=>({..._,...v3(i,_)})),u=zw(h);return{primitives:h,center:a,ports:d,size:{width:u.maxX-u.minX,height:u.maxY-u.minY},...o}},Ro=(e,t="down",n={})=>Zse(e,{newOrientation:t,overrides:n}),hVo=class{symbol;constructor(e){this.symbol=JSON.parse(JSON.stringify(e)),this.symbol.size=this.computeSize()}changeTextAnchor(e,t,n){return this.symbol={...this.symbol,primitives:this.symbol.primitives.map((o)=>o.type==="text"&&o.text===e?{...o,anchor:t,...n?{x:o.x+n.x,y:o.y+n.y}:{}}:o)},this}labelPort(e,t){return this.symbol={...this.symbol,ports:this.symbol.ports.map((n)=>n.labels.includes(e)?{...n,labels:t}:n)},this}rotateRightFacingSymbol(e){return this.symbol=Zse(this.symbol,{newOrientation:e}),this}computeSize(){let e=zw(this.symbol.primitives);return{width:e.maxX-e.minX,height:e.maxY-e.minY}}build(){return{...this.symbol,size:this.computeSize()}}},An=(e)=>{let t=e.primitives??[...Object.values(e.paths??{}),...Object.values(e.texts??{}),...Object.values(e.circles??{}),...Object.values(e.rects??{})],n=e.ports??Object.entries(e.refblocks).flatMap(([r,i])=>[{...i,labels:[r]}]),o=e.center??{x:e.bounds.centerX,y:e.bounds.centerY};return n.length===2&&(o={x:(n[0].x+n[1].x)/2,y:(n[0].y+n[1].y)/2}),new hVo({...e,primitives:t,ports:n,center:o})},bK,dVo,FDs,J1e,Hwt,uVo,pVo,mVo,zDs,Z1e,Fwt,_Vo,gVo,AVo,ODs,eye,zwt,fVo,yVo,xVo,VDs,tye,Owt,CVo,bVo,IVo,YDs,nye,Vwt,vVo,SVo,PVo,GDs,oye,Ywt,EVo,MVo,LOe,wVo,uDt,BVo,TVo,IK,DVo,UDs,rye,Gwt,NVo,RVo,QVo,kVo,WDs,iye,Uwt,LVo,HVo,FVo,zxe,zVo,Fi=(e,{kind:t,orientation:n,pin1Labels:o=["1"],pin2Labels:r=["2"]})=>{let i=zVo[t],s=An({...e,texts:{}}).rotateRightFacingSymbol(n).labelPort("left1",o).labelPort("right1",r).build(),a=n==="right"||n==="left",c=a?[{type:"text",text:"{REF}",x:0,y:i.horizontalOffset,anchor:"middle_bottom"},{type:"text",text:"{VAL}",x:0,y:-i.horizontalOffset,anchor:"middle_top"}]:[{type:"text",text:"{REF}",x:i.verticalX,y:i.verticalRefY,anchor:"middle_left"},{type:"text",text:"{VAL}",x:i.verticalX,y:i.verticalValY,anchor:"middle_left"}],[l,h]=s.ports,d=Math.hypot(h.x-l.x,h.y-l.y);return{...s,primitives:[...s.primitives,...c],size:a?{width:d,height:i.horizontalHeight}:{width:i.verticalWidth,height:d}}},OVo,VVo,YVo,GVo,UVo,XDs,sye,Wwt,WVo,XVo,jVo,jDs,aye,Xwt,KVo,$Vo,Oxe,qVo,JVo,ZVo,eYo,Vxe,tYo,KDs,cye,jwt,nYo,oYo,rYo,$Ds,lye,Kwt,iYo,pDt,sYo,qDs,hye,$wt,aYo,cYo,JDs,ZDs,eNs,tNs,nNs,HOe,FOe,zOe,lYo,eae,hYo,qwt,Jwt,dYo,uYo,pYo,mYo,Zwt,dye,eBt,_Yo,mDt,gYo,tBt,nBt,AYo,fYo,yYo,xYo,oBt,rBt,CYo,bYo,IYo,vYo,iBt,sBt,SYo,PYo,EYo,MYo,Yxe,wYo,oNs,aBt,cBt,BYo,TYo,DYo,NYo,rNs,lBt,hBt,RYo,QYo,kYo,LYo,iNs,dBt,uBt,HYo,FYo,zYo,Gxe,OYo,VYo,YYo,GYo,Uxe,UYo,sNs,uye,pBt,WYo,XYo,jYo,aNs,pye,mBt,KYo,$Yo,qYo,cNs,mye,_Bt,JYo,ZYo,eGo,lNs,_ye,gBt,tGo,nGo,oGo,hNs,ABt,fBt,rGo,iGo,sGo,Wxe,aGo,cGo,lGo,hGo,OOe,dGo,dNs,yBt,xBt,uGo,pGo,mGo,uNs,CBt,bBt,_Go,_Dt,gGo,AGo,pNs,IBt,vBt,fGo,yGo,Xxe,xGo,mNs,gye,SBt,CGo,bGo,IGo,vGo,SGo,jxe,PGo,EGo,MGo,wGo,BGo,TGo,Kxe,DGo,NGo,RGo,QGo,kGo,_Ns,Aye,PBt,LGo,HGo,FGo,$xe,zGo,OGo,VGo,YGo,vK,GGo,gNs,fye,EBt,UGo,WGo,XGo,jGo,ANs,yye,MBt,KGo,$Go,qGo,JGo,fNs,xye,wBt,ZGo,eUo,tUo,yNs,Cye,BBt,nUo,oUo,qxe,rUo,xNs,bye,Iye,iUo,sUo,aUo,cUo,lUo,CNs,vye,Sye,hUo,dUo,Jxe,uUo,bNs,Pye,TBt,pUo,mUo,_Uo,gUo,AUo,INs,Eye,DBt,fUo,yUo,jse=0.6,aOe=0.3,xUo,CUo,Kse=0.6,cOe=0.3,bUo,IUo,$se=0.6,lOe=0.3,vUo,SUo,qse=0.6,hOe=0.3,PUo,EUo,SK,MUo,wUo,BUo,TUo,DUo,NUo,RUo,NBt,Mye,RBt,QUo,tae,NOe,QBt,kUo,LUo,ROe,HUo,PK,FUo,vNs,wye,kBt,zUo,OUo,VUo,SNs,Bye,LBt,YUo,GUo,UUo,PNs,Tye,HBt,WUo,XUo,jUo,ENs,Dye,FBt,KUo,$Uo,qUo,MNs,Nye,zBt,JUo,ZUo,eWo,wNs,Rye,OBt,tWo,nWo,EK,oWo,rWo,iWo,sWo,aWo,cWo,Zxe,lWo,VBt,hWo,dWo,uWo,YBt,pWo,mWo,_Wo,GBt,gWo,AWo,fWo,UBt,yWo,xWo,CWo,e5e,bWo,IWo,t5e,vWo,SWo,PWo,EWo,MWo,n5e,wWo,BWo,TWo,DWo,NWo,o5e,VOe,YOe,GOe,RWo,UOe,WOe,XOe,QWo,jOe,KOe,$Oe,kWo,LWo,r5e,qOe,JOe,ZOe,HWo,eVe,tVe,nVe,FWo,oVe,rVe,iVe,zWo,OWo,i5e,sVe,aVe,cVe,VWo,lVe,hVe,dVe,YWo,uVe,pVe,mVe,GWo,UWo,s5e,_Ve,gVe,AVe,WWo,fVe,yVe,xVe,XWo,CVe,bVe,IVe,jWo,Qye,KWo,vVe=(e)=>{let t=KWo[e],n=e==="up"||e==="down";return An({...Qye,texts:{...Qye.texts,top1:{...Qye.texts.top1,...t.reference},bottom1:{...Qye.texts.bottom1,...t.value}}}).labelPort("left1",["1","anode"]).labelPort("bottom1",["2","junction","common"]).labelPort("right1",["3","cathode"]).rotateRightFacingSymbol(e).changeTextAnchor("{REF}",n?"middle_left":"middle_bottom").changeTextAnchor("{VAL}",n?"middle_left":"middle_top").build()},$Wo,gDt,qWo,JWo,ADt,ZWo,BNs,kye,WBt,eXo,fDt,SVe,PVe,EVe,tXo,yDt,nXo,MK,oXo,TNs,Lye,XBt,rXo,iXo,sXo,DNs,Hye,jBt,aXo,cXo,lXo,NNs,Fye,KBt,hXo,dXo,uXo,RNs,zye,$Bt,pXo,mXo,_Xo,QNs,Oye,qBt,gXo,AXo,fXo,kNs,Vye,JBt,yXo,xXo,CXo,bXo,IXo,Yye,ZBt,vXo,MVe,SXo,PXo,eTt,MXo,wXo,BXo,TXo,Gye,tTt,xDt,DXo,wK,NXo,RXo,QXo,kXo,LXo,HXo,wVe,LNs,HNs,FNs,zNs,ONs,FXo,zXo,OXo,a5e,VXo,YXo,BVe,TVe,DVe,GXo,UXo,CDt,NVe,RVe,bDt,WXo,XXo,IDt,vDt,SDt,QVe,kVe,jXo,c5e,KXo,$Xo,qXo,JXo,PDt,l5e,LVe,HVe,FVe,ZXo,zVe,OVe,VVe,ejo,YVe,GVe,UVe,tjo,njo,ojo,nTt,Uye,oTt,rjo,WVe,XVe,jVe,KVe,EDt,$Ve,qVe,JVe,ijo,sjo,h5e,ajo,cjo,ljo,hjo,d5e,djo,ujo,pjo,mjo,_jo,gjo,rTt,Wye,iTt,Ajo,MDt,wDt,BDt,ZVe,eYe,fjo,yjo,xjo,sTt,aTt,AK,cTt,TDt,tYe,DDt,nYe,Cjo,bjo,Ijo,lTt,Xye,hTt,vjo,NDt,oYe,Jse,Lxe,Sjo,eh=({horizontalSymbol:e,verticalSymbol:t,gateSide:n,drainSide:o})=>{let r=n==="left"||n==="right",i=o==="left"||o==="right";if(r===i)throw Error(`Invalid MOSFET orientation: gate ${n}, drain ${o}. Gate and drain must be perpendicular.`);let s=r?e:t;return(n==="right"||i&&o==="left")&&(s=Y9(s)),(n==="bottom"||!i&&o==="bottom")&&(s=CK(s)),s},Pjo,Ejo,dTt,uTt,LO,Mjo,RDt,wjo,uS,QDt,kDt,rYe,iYe,Ow,Bjo,Tjo,Djo,Njo,Rjo,Qjo,kjo,Ljo,Hjo,Fjo,pTt,mTt,fK,zjo,_Tt,pS,LDt,HDt,sYe,aYe,Vw,Ojo,Vjo,Yjo,Gjo,Ujo,Wjo,Xjo,jjo,Kjo,$jo,gTt,jye,dOe,qjo,FDt,zDt,ODt,cYe,lYe,Jjo,Zjo,eKo,ATt,tKo,u5e,nKo,oKo,rKo,BK,iKo,VNs,Kye,uOe,sKo,aKo,cKo,YNs,$ye,pOe,lKo,hKo,dKo,GNs,qye,mOe,uKo,pKo,mKo,UNs,Jye,_Oe,_Ko,gKo,AKo,WNs,Zye,gOe,fKo,yKo,xKo,XNs,exe,AOe,CKo,bKo,IKo,p5e,vKo,SKo,PKo,EKo,m5e,MKo,wKo,BKo,TKo,DKo,fTt,yTt,yK,NKo,xTt,mS,VDt,YDt,hYe,dYe,Yw,RKo,QKo,kKo,LKo,HKo,FKo,zKo,OKo,VKo,YKo,CTt,bTt,xK,GKo,ITt,_S,GDt,UDt,uYe,pYe,Gw,UKo,WKo,XKo,jKo,KKo,$Ko,qKo,JKo,ZKo,WDt,XDt,e$o,jDt,t$o,mYe,n$o,KDt,o$o,r$o,i$o,s$o,vTt,txe,fOe,a$o,$Dt,qDt,JDt,_Ye,gYe,c$o,HO,l$o,jNs,nxe,yOe,h$o,d$o,KNs,$Ns,qNs,JNs,ZNs,u$o,p$o,eRs,oxe,xOe,m$o,_$o,g$o,tRs,rxe,COe,A$o,f$o,y$o,nRs,ixe,bOe,x$o,C$o,b$o,oRs,sxe,IOe,I$o,v$o,S$o,P$o,STt,axe,PTt,ZDt,E$o,M$o,w$o,B$o,ETt,cxe,MTt,_5e,AYe,fYe,yYe,T$o,xYe,CYe,bYe,D$o,IYe,vYe,SYe,N$o,g5e,R$o,rRs,lxe,vOe,Q$o,k$o,L$o,iRs,hxe,SOe,H$o,F$o,z$o,O$o,sRs,dxe,POe,V$o,Y$o,G$o,U$o,aRs,uxe,wTt,W$o,eNt,tNt,PYe,QOe,EYe,kOe,X$o,j$o,K$o,BTt,TTt,DTt,$$o,nNt,q$o,oNt,J$o,NTt,Z$o,EOe,eqo,oae,MYe,wYe,BYe,tqo,nqo,RTt,oqo,MOe,rqo,iqo,TYe,DYe,NYe,sqo,RYe,QYe,kYe,aqo,LYe,HYe,FYe,cqo,A5e,lqo,cRs,QTt,hqo,dqo,uqo,pqo,lRs,kTt,mqo,_qo,gqo,Aqo,hRs,LTt,fqo,yqo,xqo,Cqo,dRs,HTt,bqo,Iqo,vqo,Sqo,FTt,pxe,mxe,Pqo,rNt,zYe,Eqo,Mqo,wqo,f5e,Bqo,uRs,_xe,zTt,Tqo,Dqo,Nqo,pRs,gxe,OTt,Rqo,Qqo,kqo,mRs,Axe,VTt,Lqo,Hqo,y5e,Fqo,zqo,Oqo,Vqo,Yqo,_Rs,fxe,YTt,Gqo,Uqo,x5e,Wqo,Xqo,jqo,Kqo,iNt,$qo,GTt,yxe,wOe,qqo,C5e,OYe,VYe,YYe,Jqo,Zqo,gRs,xxe,BOe,eJo,sNt,GYe,UYe,WYe,tJo,XYe,jYe,KYe,nJo,oJo,$Ye,rJo,aNt,iJo,sJo,aJo,b5e,qYe,JYe,ZYe,cJo,eGe,tGe,nGe,lJo,oGe,rGe,iGe,hJo,cNt,ARs,fRs,yRs,xRs,CRs,lNt,hNt,dJo,dNt,uJo,uNt,pJo,sGe,pNt,aGe,mJo,mNt,cGe,_Jo,_Nt,gJo,lGe,gNt,hGe,AJo,ANt,dGe,fJo,fNt,yJo,uGe,yNt,pGe,xJo,xNt,mGe,CJo,CNt,bJo,_Ge,bNt,gGe,IJo,INt,AGe,vJo,vNt,SJo,fGe,SNt,yGe,PJo,PNt,xGe,EJo,ENt,MJo,CGe,MNt,bGe,wJo,wNt,IGe,BJo,TJo,I5e,vGe,SGe,PGe,DJo,EGe,MGe,wGe,NJo,BGe,TGe,DGe,RJo,QJo,v5e,NGe,RGe,QGe,kJo,kGe,LGe,HGe,LJo,FGe,zGe,OGe,HJo,TK,BNt,Cxe,FJo,TNt,bxe,zJo,DNt,Ixe,OJo,NNt,vxe,VJo,RNt,Sxe,YJo,QNt,Pxe,GJo,S5e,P5e,VGe,YGe,GGe,UJo,UGe,WGe,XGe,WJo,jGe,KGe,$Ge,XJo,E5e,M5e,qGe,JGe,ZGe,jJo,eUe,tUe,nUe,KJo,oUe,rUe,iUe,$Jo,w5e,qJo,JJo,ZJo,eZo,kNt,bRs,IRs,vRs,SRs,PRs,LNt,tZo,nZo,oZo,rZo,Exe,UTt,iZo,sUe,sZo,aZo,WTt,lZo,B5e,HNt,XTt,hZo,dZo,FNt,jTt,uZo,pZo,aUe,cUe,lUe,hUe,zNt,dUe,uUe,pUe,mZo,mUe,_Ue,gUe,_Zo,AUe,gZo,ONt,AZo,fZo,VNt,ERs,MRs,wRs,BRs,TRs,YNt,GNt,UNt,yZo,xZo,CZo,bZo,IZo,KTt,Mxe,$Tt,vZo,WNt,fUe,SZo,PZo,EZo,MZo,wZo,qTt,wxe,TOe,BZo,XNt,jNt,KNt,TZo,$Nt,DZo,NZo,RZo,QZo,kZo,DOe,Bxe,JTt,LZo,qNt,HZo,FZo,zZo,ZTt,Txe,eDt,OZo,JNt,yUe,VZo,YZo,GZo,UZo,WZo,tDt,Dxe,nDt,ZNt,eRt,tRt,xUe,CUe,XZo,jZo,KZo,$Zo,Nxe,oDt,qZo,bUe,JZo,ZZo,rDt,ter,T5e,ner,oer,rer,ier,ser,aer,cer,ler,IUe,DRs,NRs,RRs,QRs,kRs,her,der,LRs,iDt,uer,sDt,per,mer,_er,ger,Aer,Rxe,aDt,fer,vUe,yer,xer,cDt,ber,Ier,ver,Ser,Qxe,lDt,Per,SUe,Eer,Mer,hDt,Ber,nRt,Ter,N5e,Der,Ner,Rer,Qer,ker,kxe,dDt,Ler,Her,R5e,Fer,zer,Oer,Ver,zs,HRs;var K0=ba(()=>{({cos:iVo,sin:sVo,PI:LDs}=Math);({tan:HDs}=Math);cVo(Fxe,Error);Fxe.prototype.format=function(e){var t="Error: "+this.message;if(this.location){var n=null,o;for(o=0;o<e.length;o++)if(e[o].source===this.location.source){n=e[o].text.split(/\r\n|\n|\r/g);break}var r=this.location.start,i=this.location.source&&typeof this.location.source.offset=="function"?this.location.source.offset(r):r,s=this.location.source+":"+i.line+":"+i.column;if(n){var a=this.location.end,c=sOe("",i.line.toString().length," "),l=n[r.line-1],h=r.line===a.line?a.column:l.length+1,d=h-r.column||1;t+=`
 --> `+s+`
`+c+` |
`+i.line+" | "+l+`
`+c+" | "+sOe("",r.column-1," ")+sOe("",d,"^")}else t+=`
 at `+s}return t};Fxe.buildMessage=function(e,t){var n={literal:function(l){return'"'+r(l.text)+'"'},class:function(l){var h=l.parts.map(function(d){return Array.isArray(d)?i(d[0])+"-"+i(d[1]):i(d)});return"["+(l.inverted?"^":"")+h.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(l){return l.description}};function o(l){return l.charCodeAt(0).toString(16).toUpperCase()}function r(l){return l.replace(/\\/g,"\\\\").replace(/"/g,"\\\"").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(h){return"\\x0"+o(h)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(h){return"\\x"+o(h)})}function i(l){return l.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(h){return"\\x0"+o(h)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(h){return"\\x"+o(h)})}function s(l){return n[l.type](l)}function a(l){var h=l.map(s),d,u;if(h.sort(),h.length>0){for(d=1,u=1;d<h.length;d++)h[d-1]!==h[d]&&(h[u]=h[d],u++);h.length=u}switch(h.length){case 1:return h[0];case 2:return h[0]+" or "+h[1];default:return h.slice(0,-1).join(", ")+", or "+h[h.length-1]}}function c(l){return l?'"'+r(l)+'"':"end of input"}return"Expected "+a(e)+" but "+c(t)+" found."};bK={paths:{path11:{type:"path",points:[{x:-0.54,y:0.03},{x:-0.3,y:0.04}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.29,y:0.04},{x:0.54,y:0.04}],color:"primary",fill:!1},"path11-5-5":{type:"path",points:[{x:0.1,y:0.13},{x:0,y:-0.06},{x:-0.11,y:0.13}],color:"primary",fill:!1},path17:{type:"path",points:[{x:0,y:-0.13},{x:0.07,y:-0.11}],color:"primary",fill:!1},path18:{type:"path",points:[{x:0.07,y:-0.11},{x:0.14,y:-0.13}],color:"primary",fill:!1},path19:{type:"path",points:[{x:-0.15,y:-0.13},{x:-0.07,y:-0.11}],color:"primary",fill:!1},path20:{type:"path",points:[{x:-0.07,y:-0.11},{x:0,y:-0.13}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.17,y:0.4},bottom1:{type:"text",text:"{VAL}",x:-0.01,y:-0.4}},refblocks:{left1:{x:-0.54,y:0.03},right1:{x:0.54,y:0.04}},bounds:{minX:-0.57,maxX:0.57,minY:-0.4,maxY:0.4,width:1.14,height:0.79,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0,y:0.04,radius:0.29,color:"primary",fill:!1}}},{paths:dVo,texts:FDs,bounds:J1e,refblocks:Hwt,circles:uVo}=bK,pVo=An({primitives:[...Object.values(dVo),...Object.values(uVo),{type:"text",text:"{REF}",x:-0.15,y:0.3894553499999995},{type:"text",text:"{VAL}",x:0.15,y:0.3894553499999995}],ports:[{...Hwt.left1,labels:["1"]},{...Hwt.right1,labels:["2"]}],size:{width:J1e.width,height:J1e.height},center:{x:J1e.centerX,y:J1e.centerY}}).rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),{paths:mVo,texts:zDs,bounds:Z1e,refblocks:Fwt,circles:_Vo}=bK,gVo=An({primitives:[...Object.values(mVo),...Object.values(_Vo),{type:"text",text:"{REF}",x:-0,y:0.4094553499999995},{type:"text",text:"{VAL}",x:0,y:-0.4094553499999995}],ports:[{...Fwt.left1,labels:["1"]},{...Fwt.right1,labels:["2"]}],size:{width:Z1e.width,height:Z1e.height},center:{x:Z1e.centerX,y:Z1e.centerY}}).changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:AVo,texts:ODs,bounds:eye,refblocks:zwt,circles:fVo}=bK,yVo=An({primitives:[...Object.values(AVo),...Object.values(fVo),{type:"text",text:"{REF}",x:-0,y:-0.3094553499999995},{type:"text",text:"{VAL}",x:0,y:0.4094553499999995}],ports:[{...zwt.left1,labels:["1"]},{...zwt.right1,labels:["2"]}],size:{width:eye.width,height:eye.height},center:{x:eye.centerX,y:eye.centerY}}).changeTextAnchor("{VAL}","middle_bottom").rotateRightFacingSymbol("left").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:xVo,texts:VDs,bounds:tye,refblocks:Owt,circles:CVo}=bK,bVo=An({primitives:[...Object.values(xVo),...Object.values(CVo),{type:"text",text:"{REF}",x:-0,y:0.4094553499999995},{type:"text",text:"{VAL}",x:0,y:-0.4094553499999995}],ports:[{...Owt.left1,labels:["1"]},{...Owt.right1,labels:["2"]}],size:{width:tye.width,height:tye.height},center:{x:tye.centerX,y:tye.centerY}}).changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:IVo,texts:YDs,bounds:nye,refblocks:Vwt,circles:vVo}=bK,SVo=An({primitives:[...Object.values(IVo),...Object.values(vVo),{type:"text",text:"{REF}",x:0.15,y:-0.2894553499999995},{type:"text",text:"{VAL}",x:-0.15,y:-0.2894553499999995}],ports:[{...Vwt.left1,labels:["1"]},{...Vwt.right1,labels:["2"]}],size:{width:nye.width,height:nye.height},center:{x:nye.centerX,y:nye.centerY}}).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),{paths:PVo,texts:GDs,bounds:oye,refblocks:Ywt,circles:EVo}=bK,MVo=An({primitives:[...Object.values(PVo),...Object.values(EVo),{type:"text",text:"{REF}",x:0.15,y:-0.2894553499999995},{type:"text",text:"{VAL}",x:-0.15,y:-0.2894553499999995}],ports:[{...Ywt.left1,labels:["1"]},{...Ywt.right1,labels:["2"]}],size:{width:oye.width,height:oye.height},center:{x:oye.centerX,y:oye.centerY}}).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),LOe={paths:{"input-a-lead":{type:"path",points:[{x:-0.6,y:0.16000000000000014},{x:-0.25,y:0.16000000000000014}],color:"primary",fill:!1},"input-b-lead":{type:"path",points:[{x:-0.6,y:-0.1399999999999999},{x:-0.25,y:-0.1399999999999999}],color:"primary",fill:!1},body:{type:"path",points:[{x:-0.25,y:0.3600000000000001},{x:0,y:0.3600000000000001},{x:0,y:0.3600000000000001},{x:0.029662962962962967,y:0.359535925925926},{x:0.05863703703703704,y:0.3581540740740742},{x:0.08690000000000002,y:0.35587000000000013},{x:0.11442962962962966,y:0.3526992592592594},{x:0.14120370370370372,y:0.3486574074074076},{x:0.16720000000000004,y:0.34376000000000023},{x:0.19239629629629632,y:0.3380225925925927},{x:0.21677037037037045,y:0.331460740740741},{x:0.2403,y:0.3240900000000001},{x:0.26296296296296295,y:0.31592592592592605},{x:0.28473703703703696,y:0.30698407407407413},{x:0.30560000000000004,y:0.2972800000000002},{x:0.3255296296296295,y:0.2868292592592593},{x:0.34450370370370376,y:0.2756474074074076},{x:0.36249999999999993,y:0.2637500000000001},{x:0.3794962962962963,y:0.25115259259259276},{x:0.39547037037037036,y:0.2378707407407409},{x:0.41040000000000004,y:0.2239200000000002},{x:0.42426296296296295,y:0.20931592592592613},{x:0.437037037037037,y:0.19407407407407426},{x:0.4487,y:0.1782100000000002},{x:0.4592296296296296,y:0.16173925925925947},{x:0.46860370370370374,y:0.14467740740740764},{x:0.4768,y:0.12704000000000024},{x:0.4837962962962963,y:0.10884259259259285},{x:0.4895703703703703,y:0.09010074074074101},{x:0.4941,y:0.07083000000000027},{x:0.49736296296296295,y:0.05104592592592622},{x:0.49933703703703697,y:0.03076407407407436},{x:0.5,y:0.0100000000000003},{x:0.5,y:0.010000000000000231},{x:0.5,y:0.010000000000000231},{x:0.499337037037037,y:-0.010764074074073858},{x:0.49736296296296295,y:-0.031045925925925727},{x:0.49410000000000004,y:-0.05082999999999982},{x:0.48957037037037043,y:-0.07010074074074057},{x:0.48379629629629634,y:-0.08884259259259243},{x:0.47680000000000006,y:-0.10703999999999986},{x:0.46860370370370374,y:-0.12467740740740728},{x:0.4592296296296297,y:-0.14173925925925915},{x:0.4486999999999999,y:-0.15820999999999985},{x:0.4370370370370371,y:-0.17407407407407394},{x:0.4242629629629629,y:-0.18931592592592578},{x:0.4104000000000001,y:-0.20391999999999988},{x:0.3954703703703703,y:-0.21787074074074056},{x:0.37949629629629644,y:-0.2311525925925925},{x:0.36249999999999993,y:-0.24374999999999986},{x:0.3445037037037037,y:-0.25564740740740727},{x:0.3255296296296296,y:-0.26682925925925916},{x:0.30560000000000004,y:-0.2772799999999999},{x:0.28473703703703707,y:-0.28698407407407395},{x:0.262962962962963,y:-0.29592592592592576},{x:0.24030000000000004,y:-0.30408999999999986},{x:0.21677037037037042,y:-0.3114607407407406},{x:0.19239629629629634,y:-0.31802259259259247},{x:0.16720000000000007,y:-0.3237599999999998},{x:0.14120370370370378,y:-0.32865740740740723},{x:0.11442962962962971,y:-0.33269925925925914},{x:0.08690000000000009,y:-0.33586999999999984},{x:0.058637037037037126,y:-0.33815407407407394},{x:0.029662962962963058,y:-0.33953592592592574},{x:0.00000000000000009992007221626409,y:-0.33999999999999986},{x:0,y:-0.33999999999999986},{x:-0.25,y:-0.33999999999999986},{x:-0.25,y:0.3600000000000001}],color:"primary",fill:!1},"output-lead":{type:"path",points:[{x:0.5,y:0.010000000000000231},{x:0.6000000000000001,y:0.010000000000000231}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.4700000000000002},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.47}},refblocks:{left1:{x:-0.6,y:-0.1399999999999999},left2:{x:-0.6,y:0.16000000000000014},right1:{x:0.6000000000000001,y:0.010000000000000231}},bounds:{minX:-0.6,maxX:0.6000000000000001,minY:-0.47,maxY:0.4700000000000002,width:1.2000000000000002,height:0.9400000000000002,centerX:0.00000000000000005551115123125783,centerY:0.00000000000000011102230246251565},circles:{}},wVo=An(LOe).labelPort("left1",["2","in2","input2","b"]).labelPort("left2",["1","in1","input1","a"]).labelPort("right1",["3","out","output","y"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("down").build(),uDt=An(LOe).labelPort("left1",["2","in2","input2","b"]).labelPort("left2",["1","in1","input1","a"]).labelPort("right1",["3","out","output","y"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("right").build(),BVo=Y9(uDt),TVo=An(LOe).labelPort("left1",["2","in2","input2","b"]).labelPort("left2",["1","in1","input1","a"]).labelPort("right1",["3","out","output","y"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("up").build(),IK={paths:{path40:{type:"path",points:[{x:0.14,y:0.04},{x:-0.12,y:-0.09}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-0.12,y:0.18},{x:0.14,y:0.04}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-0.12,y:-0.09},{x:-0.12,y:0.18}],color:"primary",fill:!1},path43:{type:"path",points:[{x:0.14,y:0.18},{x:0.14,y:-0.09}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-0.12,y:0.04},{x:-0.52,y:0.04}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.52,y:0.04},{x:0.15,y:0.04}],color:"primary",fill:!1},"path43-8":{type:"path",points:[{x:0.14,y:0.18},{x:0.08,y:0.2}],color:"primary",fill:!1},"path43-8-3":{type:"path",points:[{x:0.21,y:-0.11},{x:0.15,y:-0.09}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.01,y:0.27},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.27}},refblocks:{left1:{x:-0.52,y:0.04},right1:{x:0.52,y:0.04}},bounds:{minX:-0.55,maxX:0.55,minY:-0.27,maxY:0.27,width:1.09,height:0.55,centerX:0,centerY:0},circles:{}},{paths:DVo,texts:UDs,bounds:rye,refblocks:Gwt,circles:NVo}=IK,RVo=An({primitives:[...Object.values(DVo),...Object.values(NVo),{type:"text",text:"{REF}",x:-0.15,y:0.3294553499999995},{type:"text",text:"{VAL}",x:0.15,y:0.3294553499999995}],ports:[{...Gwt.left1,labels:["1"]},{...Gwt.right1,labels:["2"]}],size:{width:rye.width,height:rye.height},center:{x:rye.centerX,y:rye.centerY}}).rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),QVo=An(IK).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1","neg"]).labelPort("right1",["2","pos"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:kVo,texts:WDs,bounds:iye,refblocks:Uwt,circles:LVo}=IK,HVo=An({primitives:[...Object.values(kVo),...Object.values(LVo),{type:"text",text:"{REF}",x:-0,y:-0.2294553499999995},{type:"text",text:"{VAL}",x:0,y:0.3294553499999995}],ports:[{...Uwt.left1,labels:["1"]},{...Uwt.right1,labels:["2"]}],size:{width:iye.width,height:iye.height},center:{x:iye.centerX,y:iye.centerY}}).changeTextAnchor("{VAL}","middle_bottom").rotateRightFacingSymbol("left").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),FVo=An(IK).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1","neg"]).labelPort("right1",["2","pos"]).changeTextAnchor("{REF}","middle_bottom").build(),zxe={paths:{"anode-lead":{type:"path",points:[{x:-0.25,y:0},{x:-0.11999999999999988,y:0}],color:"primary",fill:!1},body:{type:"path",points:[{x:-0.11999999999999988,y:0.11999999999999988},{x:0.1200000000000001,y:0},{x:-0.11999999999999988,y:-0.1200000000000001},{x:-0.11999999999999988,y:0.11999999999999988}],color:"primary",fill:!1},"cathode-bar":{type:"path",points:[{x:0.07000000000000006,y:0.1399999999999999},{x:0.1200000000000001,y:0.11999999999999988},{x:0.1200000000000001,y:-0.1200000000000001},{x:0.16999999999999993,y:-0.1399999999999999}],color:"primary",fill:!1},"cathode-lead":{type:"path",points:[{x:0.1200000000000001,y:0},{x:0.25,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.25},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.25}},refblocks:{left1:{x:-0.25,y:0},right1:{x:0.25,y:0}},bounds:{minX:-0.25,maxX:0.25,minY:-0.25,maxY:0.25,width:0.5,height:0.5,centerX:0,centerY:0},circles:{}},zVo={boxresistor:{horizontalOffset:0.16,horizontalHeight:0.65,verticalX:0.16,verticalRefY:0.16,verticalValY:-0.16,verticalWidth:0.9},capacitor:{horizontalOffset:0.24,horizontalHeight:0.65,verticalX:0.2,verticalRefY:0.095,verticalValY:-0.095,verticalWidth:0.9},led:{horizontalOffset:0.38,horizontalHeight:0.9,verticalX:0.38,verticalRefY:0.14,verticalValY:-0.14,verticalWidth:1.1},diode:{horizontalOffset:0.22,horizontalHeight:0.65,verticalX:0.2,verticalRefY:0.14,verticalValY:-0.14,verticalWidth:0.9},resistor:{horizontalOffset:0.22,horizontalHeight:0.65,verticalX:0.2,verticalRefY:0.14,verticalValY:-0.14,verticalWidth:0.9}},OVo=Fi(zxe,{kind:"diode",orientation:"down",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),VVo=Fi(zxe,{kind:"diode",orientation:"left",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),YVo=Fi(zxe,{kind:"diode",orientation:"right",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),GVo=Fi(zxe,{kind:"diode",orientation:"up",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),{paths:UVo,texts:XDs,bounds:sye,refblocks:Wwt,circles:WVo}=IK,XVo=An({primitives:[...Object.values(UVo),...Object.values(WVo),{type:"text",text:"{REF}",x:0.15,y:-0.2294553499999995},{type:"text",text:"{VAL}",x:-0.15,y:-0.2294553499999995}],ports:[{...Wwt.left1,labels:["1"]},{...Wwt.right1,labels:["2"]}],size:{width:sye.width,height:sye.height},center:{x:sye.centerX,y:sye.centerY}}).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),{paths:jVo,texts:jDs,bounds:aye,refblocks:Xwt,circles:KVo}=IK,$Vo=An({primitives:[...Object.values(jVo),...Object.values(KVo),{type:"text",text:"{REF}",x:0.15,y:-0.2294553499999995},{type:"text",text:"{VAL}",x:-0.15,y:-0.2294553499999995}],ports:[{...Xwt.left1,labels:["1"]},{...Xwt.right1,labels:["2"]}],size:{width:aye.width,height:aye.height},center:{x:aye.centerX,y:aye.centerY}}).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),Oxe={paths:{"anode-lead":{type:"path",points:[{x:-0.17499999999999982,y:0},{x:-0.09999999999999987,y:0}],color:"primary",fill:!1},body:{type:"path",points:[{x:-0.09999999999999987,y:0.09999999999999987},{x:0.10000000000000009,y:0},{x:-0.09999999999999987,y:-0.10000000000000009},{x:-0.09999999999999987,y:0.09999999999999987}],color:"primary",fill:!1},"cathode-bar":{type:"path",points:[{x:0.050000000000000044,y:0.11999999999999988},{x:0.10000000000000009,y:0.09999999999999987},{x:0.10000000000000009,y:-0.10000000000000009},{x:0.15000000000000013,y:-0.1200000000000001}],color:"primary",fill:!1},"cathode-lead":{type:"path",points:[{x:0.10000000000000009,y:0},{x:0.17500000000000004,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.25},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.25}},refblocks:{left1:{x:-0.17499999999999982,y:0},right1:{x:0.17500000000000004,y:0}},bounds:{minX:-0.17499999999999982,maxX:0.17500000000000004,minY:-0.25,maxY:0.25,width:0.34999999999999987,height:0.5,centerX:0.00000000000000011102230246251565,centerY:0},circles:{}},qVo=Fi(Oxe,{kind:"diode",orientation:"down",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),JVo=Fi(Oxe,{kind:"diode",orientation:"left",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),ZVo=Fi(Oxe,{kind:"diode",orientation:"right",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),eYo=Fi(Oxe,{kind:"diode",orientation:"up",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),Vxe={paths:{path40:{type:"path",points:[{x:0.14,y:0.04},{x:-0.12,y:-0.09}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-0.12,y:0.18},{x:0.14,y:0.04}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-0.12,y:-0.09},{x:-0.12,y:0.18}],color:"primary",fill:!1},path43:{type:"path",points:[{x:0.14,y:0.18},{x:0.14,y:-0.09}],color:"primary",fill:!1},path44:{type:"path",points:[{x:0.14,y:0.04},{x:-0.52,y:0.04}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.52,y:0.04},{x:0.15,y:0.04}],color:"primary",fill:!1},"path43-8":{type:"path",points:[{x:0.18,y:0.18},{x:0.11,y:0.18}],color:"primary",fill:!1},"path43-8-8":{type:"path",points:[{x:0.18,y:-0.09},{x:0.11,y:-0.09}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.01,y:0.27},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.27}},refblocks:{left1:{x:-0.52,y:0.04},right1:{x:0.52,y:0.04}},bounds:{minX:-0.55,maxX:0.55,minY:-0.27,maxY:0.27,width:1.09,height:0.55,centerX:0,centerY:0},circles:{}},{paths:tYo,texts:KDs,bounds:cye,refblocks:jwt,circles:nYo}=Vxe,oYo=An({primitives:[...Object.values(tYo),...Object.values(nYo),{type:"text",text:"{REF}",x:-0.16,y:0.2294553499999995},{type:"text",text:"{VAL}",x:0.16,y:0.2294553499999995}],ports:[{...jwt.left1,labels:["1"]},{...jwt.right1,labels:["2"]}],size:{width:cye.width,height:cye.height},center:{x:cye.centerX,y:cye.centerY}}).changeTextAnchor("{VAL}","middle_bottom").rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").build(),{paths:rYo,texts:$Ds,bounds:lye,refblocks:Kwt,circles:iYo}=Vxe,pDt=An({primitives:[...Object.values(rYo),...Object.values(iYo),{type:"text",text:"{REF}",x:-0.0001118,y:-0.18},{type:"text",text:"{VAL}",x:0.0001118,y:0.2738453}],ports:[{...Kwt.left1,labels:["1"]},{...Kwt.right1,labels:["2"]}],size:{width:lye.width,height:lye.height},center:{x:lye.centerX,y:lye.centerY}}).changeTextAnchor("{VAL}","middle_bottom").rotateRightFacingSymbol("left").labelPort("left1",["2"]).labelPort("right1",["1"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:sYo,texts:qDs,bounds:hye,refblocks:$wt,circles:aYo}=Vxe,cYo=An({primitives:[...Object.values(sYo),...Object.values(aYo),{type:"text",text:"{REF}",x:-0.0050250999999996715,y:0.27384529999999985,anchor:"middle_left"},{type:"text",text:"{VAL}",x:-0.00011179999999999524,y:-0.27384530000000007,anchor:"middle_left"}],ports:[{...$wt.left1,labels:["1"]},{...$wt.right1,labels:["2"]}],size:{width:hye.width,height:hye.height},center:{x:hye.centerX,y:hye.centerY}}).changeTextAnchor("{VAL}","middle_top").labelPort("right1",["2"]).labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:JDs,texts:ZDs,bounds:eNs,refblocks:tNs,circles:nNs}=Vxe,HOe=Ro(pDt,"down"),FOe=HOe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),zOe=HOe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");FOe.anchor="middle_left";zOe.anchor="middle_left";FOe.x=0.25;FOe.y+=0.21;zOe.y-=0.21;zOe.x=0.25;lYo=HOe,eae={paths:{path43:{type:"path",points:[{x:-0.06,y:0.19},{x:-0.06,y:-0.12}],color:"primary",fill:!1},"path43-6":{type:"path",points:[{x:0.02,y:0.13},{x:0.02,y:-0.06}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-0.06,y:0.03},{x:-0.5,y:0.03}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.5,y:0.03},{x:0.03,y:0.03}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.03,y:0.27},bottom1:{type:"text",text:"{VAL}",x:-0.03,y:-0.28}},refblocks:{left1:{x:-0.5,y:0.03},right1:{x:0.5,y:0.03}},bounds:{minX:-0.5,maxX:0.5,minY:-0.38,maxY:0.27,width:1,height:0.29,centerX:0,centerY:0.06},circles:{}},{paths:hYo,bounds:qwt,refblocks:Jwt,circles:dYo}=eae,uYo=An({primitives:[...Object.values(hYo),...Object.values(dYo),{type:"text",text:"{REF}",x:-0.2,y:0.31},{type:"text",text:"{VAL}",x:0.2,y:0.31}],ports:[{...Jwt.left1,labels:["1"]},{...Jwt.right1,labels:["2"]}],center:{x:qwt.centerX,y:qwt.centerY}}).changeTextAnchor("{VAL}","middle_bottom").rotateRightFacingSymbol("down").changeTextAnchor("{REF}","middle_left").build(),pYo={...uYo,size:{width:1,height:0.9}};({paths:mYo,texts:Zwt,bounds:dye,refblocks:eBt,circles:_Yo}=eae),mDt=Gl({primitives:[...Object.values(mYo),...Object.values(_Yo),{...Zwt.top1,anchor:"middle_bottom"},{...Zwt.bottom1,anchor:"middle_top"}],ports:[{...eBt.left1,labels:["1"]},{...eBt.right1,labels:["2"]}],size:{width:dye.width,height:dye.height},center:{x:dye.centerX,y:dye.centerY}}),{paths:gYo,bounds:tBt,refblocks:nBt,circles:AYo}=eae,fYo=An({primitives:[...Object.values(gYo),...Object.values(AYo),{type:"text",text:"{REF}",x:0,y:-0.22},{type:"text",text:"{VAL}",x:0,y:0.28}],ports:[{...nBt.left1,labels:["1"]},{...nBt.right1,labels:["2"]}],center:{x:tBt.centerX,y:tBt.centerY}}).changeTextAnchor("{VAL}","middle_bottom").rotateRightFacingSymbol("left").changeTextAnchor("{REF}","middle_bottom").build(),yYo={...fYo,size:{width:1,height:0.65}},{paths:xYo,bounds:oBt,refblocks:rBt,circles:CYo}=eae,bYo=An({primitives:[...Object.values(xYo),...Object.values(CYo),{type:"text",text:"{REF}",x:0,y:0.28},{type:"text",text:"{VAL}",x:0,y:-0.22}],ports:[{...rBt.left1,labels:["1"]},{...rBt.right1,labels:["2"]}],center:{x:oBt.centerX,y:oBt.centerY}}).changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("right").changeTextAnchor("{REF}","middle_bottom").build(),IYo={...bYo,size:{width:1,height:0.65}},{paths:vYo,bounds:iBt,refblocks:sBt,circles:SYo}=eae,PYo=An({primitives:[...Object.values(vYo),...Object.values(SYo),{type:"text",text:"{REF}",x:0.2,y:-0.25},{type:"text",text:"{VAL}",x:-0.2,y:-0.25}],ports:[{...sBt.left1,labels:["1"]},{...sBt.right1,labels:["2"]}],center:{x:iBt.centerX,y:iBt.centerY}}).changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("up").changeTextAnchor("{REF}","middle_left").build(),EYo={...PYo,size:{width:1,height:0.9}},MYo=Zse(mDt,{newOrientation:"up"}),Yxe={paths:{path1:{type:"path",points:[{x:-0.3,y:0},{x:-0.19998,y:0}],color:"primary",fill:!1,strokeWidth:0.012},path2:{type:"path",points:[{x:0.19998,y:0},{x:0.3,y:0}],color:"primary",fill:!1,strokeWidth:0.012},path3:{type:"path",points:[{x:-0.19998,y:0.07998},{x:0.19998,y:0.07998},{x:0.19998,y:-0.07998},{x:-0.19998,y:-0.07998},{x:-0.19998,y:0.07998}],color:"primary",fill:!1,strokeWidth:0.012}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.3,anchor:"middle_bottom"},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.45,anchor:"middle_bottom"}},refblocks:{left1:{x:-0.3,y:0},right1:{x:0.3,y:0}},bounds:{minX:-0.3,maxX:0.3,minY:-0.45,maxY:0.3,width:0.6,height:0.75,centerX:0,centerY:0},circles:{}},{paths:wYo,texts:oNs,bounds:aBt,refblocks:cBt,circles:BYo}=Yxe,TYo=An({primitives:[...Object.values(wYo),...Object.values(BYo),{type:"text",text:"{REF}",x:-0.16,y:0.16},{type:"text",text:"{VAL}",x:0.16,y:0.16}],ports:[{...cBt.left1,labels:["1"]},{...cBt.right1,labels:["2"]}],center:{x:aBt.centerX,y:aBt.centerY}}).changeTextAnchor("{VAL}","middle_bottom").rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").build(),DYo={...TYo,size:{width:0.9,height:0.6}},{paths:NYo,texts:rNs,bounds:lBt,refblocks:hBt,circles:RYo}=Yxe,QYo=An({primitives:[...Object.values(NYo),...Object.values(RYo),{type:"text",text:"{REF}",x:0,y:-0.16},{type:"text",text:"{VAL}",x:0,y:0.16}],ports:[{...hBt.left1,labels:["1"]},{...hBt.right1,labels:["2"]}],center:{x:lBt.centerX,y:lBt.centerY}}).changeTextAnchor("{VAL}","middle_bottom").rotateRightFacingSymbol("left").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),kYo={...QYo,size:{width:0.6,height:0.65}},{paths:LYo,texts:iNs,bounds:dBt,refblocks:uBt,circles:HYo}=Yxe,FYo=An({primitives:[...Object.values(LYo),...Object.values(HYo),{type:"text",text:"{REF}",x:0,y:0.16},{type:"text",text:"{VAL}",x:0,y:-0.16}],ports:[{...uBt.left1,labels:["1"]},{...uBt.right1,labels:["2"]}],center:{x:dBt.centerX,y:dBt.centerY}}).changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),zYo={...FYo,size:{width:0.6,height:0.65}},Gxe={paths:{"left-lead":{type:"path",points:[{x:-0.25,y:0},{x:-0.175,y:0}],color:"primary",fill:!1,strokeWidth:0.012},body:{type:"path",points:[{x:-0.175,y:0.075},{x:0.175,y:0.075},{x:0.175,y:-0.075},{x:-0.175,y:-0.075},{x:-0.175,y:0.075}],color:"primary",fill:!1,strokeWidth:0.012},"right-lead":{type:"path",points:[{x:0.175,y:0},{x:0.25,y:0}],color:"primary",fill:!1,strokeWidth:0.012}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.25,anchor:"middle_bottom"},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.25,anchor:"middle_top"}},refblocks:{left1:{x:-0.25,y:0},right1:{x:0.25,y:0}},bounds:{minX:-0.25,maxX:0.25,minY:-0.25,maxY:0.25,width:0.5,height:0.5,centerX:0,centerY:0},circles:{}},OYo=Fi(Gxe,{kind:"boxresistor",orientation:"down"}),VYo=Fi(Gxe,{kind:"boxresistor",orientation:"left"}),YYo=Fi(Gxe,{kind:"boxresistor",orientation:"right"}),GYo=Fi(Gxe,{kind:"boxresistor",orientation:"up"}),Uxe={paths:{path2:{type:"path",points:[{x:0.15,y:-0.01},{x:0.55,y:-0.01}],color:"primary",fill:!0},"path2-5":{type:"path",points:[{x:-0.15,y:0.06},{x:0.14,y:0.06}],color:"primary",fill:!0},"path2-5-1":{type:"path",points:[{x:0.14,y:0.06},{x:0.14,y:-0.08}],color:"primary",fill:!0},"path2-5-1-6":{type:"path",points:[{x:-0.16,y:0.06},{x:-0.16,y:-0.08}],color:"primary",fill:!0},"path2-5-4":{type:"path",points:[{x:-0.15,y:-0.08},{x:0.14,y:-0.08}],color:"primary",fill:!0},"path2-9":{type:"path",points:[{x:-0.55,y:-0.01},{x:-0.17,y:-0.01}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-0.01,y:0.17},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.17}},refblocks:{left1:{x:-0.55,y:-0.01},right1:{x:0.55,y:-0.01}},bounds:{minX:-0.58,maxX:0.58,minY:-0.17,maxY:0.17,width:1.16,height:0.35,centerX:0,centerY:0},circles:{}},{paths:UYo,texts:sNs,bounds:uye,refblocks:pBt,circles:WYo}=Uxe,XYo=An({primitives:[...Object.values(UYo),...Object.values(WYo),{type:"text",text:"{REF}",x:-0.2,y:0.1404553499999995},{type:"text",text:"{VAL}",x:0.2,y:0.1494553499999995}],ports:[{...pBt.left1,labels:["1"]},{...pBt.right1,labels:["2"]}],size:{width:uye.width,height:uye.height},center:{x:uye.centerX,y:uye.centerY}}).rotateRightFacingSymbol("down").labelPort("left",["1"]).labelPort("right",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),{paths:jYo,texts:aNs,bounds:pye,refblocks:mBt,circles:KYo}=Uxe,$Yo=An({primitives:[...Object.values(jYo),...Object.values(KYo),{type:"text",text:"{REF}",x:0,y:-0.2294553499999995},{type:"text",text:"{VAL}",x:0,y:0.1704553499999995}],ports:[{...mBt.left1,labels:["1"]},{...mBt.right1,labels:["2"]}],size:{width:pye.width,height:pye.height},center:{x:pye.centerX,y:pye.centerY}}).rotateRightFacingSymbol("left").labelPort("left",["1"]).labelPort("right",["2"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),{paths:qYo,texts:cNs,bounds:mye,refblocks:_Bt,circles:JYo}=Uxe,ZYo=An({primitives:[...Object.values(qYo),...Object.values(JYo),{type:"text",text:"{REF}",x:0,y:0.2294553499999995},{type:"text",text:"{VAL}",x:0,y:-0.1704553499999995}],ports:[{..._Bt.left1,labels:["1"]},{..._Bt.right1,labels:["2"]}],size:{width:mye.width,height:mye.height},center:{x:mye.centerX,y:mye.centerY}}).rotateRightFacingSymbol("right").labelPort("left",["1"]).labelPort("right",["2"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),{paths:eGo,texts:lNs,bounds:_ye,refblocks:gBt,circles:tGo}=Uxe,nGo=An({primitives:[...Object.values(eGo),...Object.values(tGo),{type:"text",text:"{REF}",x:0.2,y:-0.1404553499999995},{type:"text",text:"{VAL}",x:-0.2,y:-0.1494553499999995}],ports:[{...gBt.left1,labels:["1"]},{...gBt.right1,labels:["2"]}],size:{width:_ye.width,height:_ye.height},center:{x:_ye.centerX,y:_ye.centerY}}).rotateRightFacingSymbol("up").labelPort("left",["1"]).labelPort("right",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),{paths:oGo,texts:hNs,bounds:ABt,refblocks:fBt,circles:rGo}=Yxe,iGo=An({primitives:[...Object.values(oGo),...Object.values(rGo),{type:"text",text:"{REF}",x:0.16,y:-0.16},{type:"text",text:"{VAL}",x:-0.16,y:-0.16}],ports:[{...fBt.left1,labels:["1"]},{...fBt.right1,labels:["2"]}],center:{x:ABt.centerX,y:ABt.centerY}}).changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").build(),sGo={...iGo,size:{width:0.9,height:0.6}},Wxe={paths:{"left-lead":{type:"path",points:[{x:-0.175,y:0},{x:-0.14,y:0}],color:"primary",fill:!1,strokeWidth:0.012},body:{type:"path",points:[{x:-0.14,y:0.065},{x:0.14,y:0.065},{x:0.14,y:-0.065},{x:-0.14,y:-0.065},{x:-0.14,y:0.065}],color:"primary",fill:!1,strokeWidth:0.012},"right-lead":{type:"path",points:[{x:0.14,y:0},{x:0.175,y:0}],color:"primary",fill:!1,strokeWidth:0.012}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.25,anchor:"middle_bottom"},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.25,anchor:"middle_top"}},refblocks:{left1:{x:-0.175,y:0},right1:{x:0.175,y:0}},bounds:{minX:-0.175,maxX:0.175,minY:-0.25,maxY:0.25,width:0.35,height:0.5,centerX:0,centerY:0},circles:{}},aGo=Fi(Wxe,{kind:"boxresistor",orientation:"down"}),cGo=Fi(Wxe,{kind:"boxresistor",orientation:"left"}),lGo=Fi(Wxe,{kind:"boxresistor",orientation:"right"}),hGo=Fi(Wxe,{kind:"boxresistor",orientation:"up"}),OOe={paths:{"horizontal-bar":{type:"path",points:[{x:-0.4,y:0},{x:0.4,y:0}],color:"primary",fill:!1},"middle-dash-1":{type:"path",points:[{x:0,y:0.2},{x:0,y:0.07}],color:"primary",fill:!1},"middle-dash-2":{type:"path",points:[{x:0,y:0.01},{x:0,y:-0.12}],color:"primary",fill:!1},"middle-dash-3":{type:"path",points:[{x:0,y:-0.18},{x:0,y:-0.31}],color:"primary",fill:!1},"left-vertical":{type:"path",points:[{x:-0.25,y:0},{x:-0.25,y:-0.2}],color:"primary",fill:!1},"right-vertical":{type:"path",points:[{x:0.25,y:0},{x:0.25,y:-0.2}],color:"primary",fill:!1},"left-ground":{type:"path",points:[{x:-0.3,y:-0.2},{x:-0.25,y:-0.3},{x:-0.2,y:-0.2},{x:-0.3,y:-0.2}],color:"primary",fill:!1},"right-ground":{type:"path",points:[{x:0.2,y:-0.2},{x:0.25,y:-0.3},{x:0.3,y:-0.2},{x:0.2,y:-0.2}],color:"primary",fill:!1}},refblocks:{left1:{x:-0.4,y:0},right1:{x:0.4,y:0}},texts:{ref:{type:"text",text:"{REF}",x:0,y:0.35}},bounds:{minX:-0.4,maxX:0.4,minY:-0.4,maxY:0.35,width:0.8,height:0.75,centerX:0,centerY:-0.02},circles:{}},{paths:dGo,texts:dNs,bounds:yBt,refblocks:xBt,circles:uGo}=OOe,pGo=An({primitives:[...Object.values(dGo),...Object.values(uGo),{type:"text",text:"{REF}",x:0,y:0.2594553499999995}],ports:[{...xBt.left1,labels:["1"]},{...xBt.right1,labels:["2"]}],center:{x:yBt.centerX,y:yBt.centerY}}).changeTextAnchor("{VAL}","middle_bottom").rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").build(),{paths:mGo,texts:uNs,bounds:CBt,refblocks:bBt,circles:_Go}=OOe,_Dt=An({primitives:[...Object.values(mGo),...Object.values(_Go),{type:"text",text:"{REF}",x:0,y:0.2594553499999995}],ports:[{...bBt.left1,labels:["1"]},{...bBt.right1,labels:["2"]}],center:{x:CBt.centerX,y:CBt.centerY}}).rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),gGo=Y9(_Dt),{paths:AGo,texts:pNs,bounds:IBt,refblocks:vBt,circles:fGo}=OOe,yGo=An({primitives:[...Object.values(AGo),...Object.values(fGo),{type:"text",text:"{REF}",x:0,y:0.2594553499999995}],ports:[{...vBt.left1,labels:["1"]},{...vBt.right1,labels:["2"]}],center:{x:IBt.centerX,y:IBt.centerY}}).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_right").build(),Xxe={paths:{path27:{type:"path",points:[{x:0.3,y:0},{x:0.06,y:0}],color:"primary",fill:!1,strokeWidth:0.012},path28:{type:"path",points:[{x:-0.06,y:0},{x:-0.3,y:0}],color:"primary",fill:!1,strokeWidth:0.012},path29:{type:"path",points:[{x:0.06,y:0.16002},{x:0.06,y:-0.16002}],color:"primary",fill:!1,strokeWidth:0.012},path30:{type:"path",points:[{x:-0.06,y:0.16002},{x:-0.06,y:-0.16002}],color:"primary",fill:!1,strokeWidth:0.012}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.24,anchor:"middle_bottom"},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.24,anchor:"middle_top"}},refblocks:{left1:{x:-0.3,y:0},right1:{x:0.3,y:0}},bounds:{minX:-0.3,maxX:0.3,minY:-0.24,maxY:0.24,width:0.6,height:0.48,centerX:0,centerY:0},circles:{}},{paths:xGo,texts:mNs,bounds:gye,refblocks:SBt,circles:CGo}=Xxe,bGo=An({primitives:[...Object.values(xGo),...Object.values(CGo),{type:"text",text:"{REF}",x:-0.2,y:0.115},{type:"text",text:"{VAL}",x:0.2,y:0.115}],ports:[{...SBt.left1,labels:["1"]},{...SBt.right1,labels:["2"]}],size:{width:gye.width,height:gye.height},center:{x:gye.centerX,y:gye.centerY}}).changeTextAnchor("{VAL}","top_left").rotateRightFacingSymbol("down").labelPort("left1",["1","pos"]).labelPort("right1",["2","neg"]).changeTextAnchor("{REF}","bottom_left").build(),IGo={...bGo,size:{width:0.9,height:0.6}},vGo=An(Xxe).changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("right").labelPort("left1",["2","neg"]).labelPort("right1",["1","pos"]).changeTextAnchor("{REF}","middle_bottom").build(),SGo={...vGo,size:{width:0.6,height:0.65}},jxe={paths:{path27:{type:"path",points:[{x:0.3,y:0},{x:0.000657,y:0}],color:"primary",fill:!1,strokeWidth:0.012},path28:{type:"path",points:[{x:-0.038683,y:0},{x:-0.3,y:0}],color:"primary",fill:!1,strokeWidth:0.012},path30:{type:"path",points:[{x:-0.074255,y:0.16002},{x:-0.074255,y:0.16002},{x:-0.069544,y:0.149352},{x:-0.065126,y:0.138684},{x:-0.061005,y:0.128016},{x:-0.057182,y:0.117348},{x:-0.053663,y:0.10668},{x:-0.05045,y:0.096012},{x:-0.047547,y:0.085344},{x:-0.044957,y:0.074676},{x:-0.042684,y:0.064008},{x:-0.040732,y:0.05334},{x:-0.039103,y:0.042672},{x:-0.037801,y:0.032004},{x:-0.03683,y:0.021336},{x:-0.036193,y:0.010668},{x:-0.035893,y:0},{x:-0.036193,y:-0.010668},{x:-0.03683,y:-0.021336},{x:-0.037801,y:-0.032004},{x:-0.039103,y:-0.042672},{x:-0.040732,y:-0.05334},{x:-0.042684,y:-0.064008},{x:-0.044957,y:-0.074676},{x:-0.047547,y:-0.085344},{x:-0.05045,y:-0.096012},{x:-0.053663,y:-0.10668},{x:-0.057182,y:-0.117348},{x:-0.061005,y:-0.128016},{x:-0.065126,y:-0.138684},{x:-0.069544,y:-0.149352},{x:-0.074255,y:-0.16002},{x:-0.074255,y:-0.16002}],color:"primary",fill:!1,strokeWidth:0.012},"path30-7":{type:"path",points:[{x:-0.000385,y:0.16002},{x:-0.000385,y:-0.16002}],color:"primary",fill:!1,strokeWidth:0.012},"path30-9-2":{type:"path",points:[{x:0.156026,y:0.2},{x:0.085846,y:0.2}],color:"primary",fill:!1,strokeWidth:0.012},"path30-9-2-9":{type:"path",points:[{x:0.120936,y:0.16491},{x:0.120936,y:0.23509}],color:"primary",fill:!1,strokeWidth:0.012}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.42,anchor:"middle_bottom"},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.42,anchor:"middle_top"}},refblocks:{left1:{x:-0.3,y:0},right1:{x:0.3,y:0}},bounds:{minX:-0.3,maxX:0.3,minY:-0.55,maxY:0.55,width:0.6,height:1.1,centerX:0,centerY:0},circles:{"viewbox-padding-min":{type:"circle",x:-0.3,y:-0.55,radius:0,fill:!1,color:"transparent"},"viewbox-padding-max":{type:"circle",x:0.3,y:0.55,radius:0,fill:!1,color:"transparent"}}},PGo=An(jxe).rotateRightFacingSymbol("up").labelPort("left1",["2","neg"]).labelPort("right1",["1","pos"]).changeTextAnchor("{REF}","middle_left",{x:0.7,y:0.3}).changeTextAnchor("{VAL}","middle_left",{x:-0.12,y:-0.3}).build(),EGo=An(jxe).rotateRightFacingSymbol("right").labelPort("left1",["2","neg"]).labelPort("right1",["1","pos"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),MGo=An(jxe).rotateRightFacingSymbol("left").labelPort("left1",["2","neg"]).labelPort("right1",["1","pos"]).changeTextAnchor("{REF}","middle_bottom",{x:0,y:0.78}).changeTextAnchor("{VAL}","middle_top",{x:0,y:-0.78}).build(),wGo=An(jxe).rotateRightFacingSymbol("down").labelPort("left1",["2","neg"]).labelPort("right1",["1","pos"]).changeTextAnchor("{REF}","middle_left",{x:-0.12,y:0.3}).changeTextAnchor("{VAL}","middle_left",{x:0.72,y:-0.3}).build(),BGo=An(Xxe).rotateRightFacingSymbol("right").changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1","pos"]).labelPort("right1",["2","neg"]).changeTextAnchor("{REF}","middle_bottom").build(),TGo={...BGo,size:{width:0.6,height:0.65}},Kxe={paths:{"left-lead":{type:"path",points:[{x:-0.25,y:0},{x:-0.06,y:0}],color:"primary",fill:!1,strokeWidth:0.012},"left-plate":{type:"path",points:[{x:-0.06,y:0.16},{x:-0.06,y:-0.16}],color:"primary",fill:!1,strokeWidth:0.012},"right-plate":{type:"path",points:[{x:0.06,y:0.16},{x:0.06,y:-0.16}],color:"primary",fill:!1,strokeWidth:0.012},"right-lead":{type:"path",points:[{x:0.06,y:0},{x:0.25,y:0}],color:"primary",fill:!1,strokeWidth:0.012}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.25,anchor:"middle_bottom"},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.25,anchor:"middle_top"}},refblocks:{left1:{x:-0.25,y:0},right1:{x:0.25,y:0}},bounds:{minX:-0.25,maxX:0.25,minY:-0.25,maxY:0.25,width:0.5,height:0.5,centerX:0,centerY:0},circles:{}},DGo=Fi(Kxe,{kind:"capacitor",orientation:"down",pin1Labels:["1","pos"],pin2Labels:["2","neg"]}),NGo=Fi(Kxe,{kind:"capacitor",orientation:"left",pin1Labels:["1","pos"],pin2Labels:["2","neg"]}),RGo=Fi(Kxe,{kind:"capacitor",orientation:"right",pin1Labels:["1","pos"],pin2Labels:["2","neg"]}),QGo=Fi(Kxe,{kind:"capacitor",orientation:"up",pin1Labels:["1","pos"],pin2Labels:["2","neg"]}),{paths:kGo,texts:_Ns,bounds:Aye,refblocks:PBt,circles:LGo}=Xxe,HGo=An({primitives:[...Object.values(kGo),...Object.values(LGo),{type:"text",text:"{REF}",x:0.2,y:-0.095},{type:"text",text:"{VAL}",x:-0.2,y:-0.095}],ports:[{...PBt.left1,labels:["1"]},{...PBt.right1,labels:["2"]}],size:{width:Aye.width,height:Aye.height},center:{x:Aye.centerX,y:Aye.centerY}}).changeTextAnchor("{VAL}","top_left").rotateRightFacingSymbol("up").labelPort("left1",["1","pos"]).labelPort("right1",["2","neg"]).changeTextAnchor("{REF}","bottom_left").build(),FGo={...HGo,size:{width:0.9,height:0.6}},$xe={paths:{"left-lead":{type:"path",points:[{x:-0.175,y:0},{x:-0.05,y:0}],color:"primary",fill:!1,strokeWidth:0.012},"left-plate":{type:"path",points:[{x:-0.05,y:0.14},{x:-0.05,y:-0.14}],color:"primary",fill:!1,strokeWidth:0.012},"right-plate":{type:"path",points:[{x:0.05,y:0.14},{x:0.05,y:-0.14}],color:"primary",fill:!1,strokeWidth:0.012},"right-lead":{type:"path",points:[{x:0.05,y:0},{x:0.175,y:0}],color:"primary",fill:!1,strokeWidth:0.012}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.25,anchor:"middle_bottom"},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.25,anchor:"middle_top"}},refblocks:{left1:{x:-0.175,y:0},right1:{x:0.175,y:0}},bounds:{minX:-0.175,maxX:0.175,minY:-0.25,maxY:0.25,width:0.35,height:0.5,centerX:0,centerY:0},circles:{}},zGo=Fi($xe,{kind:"capacitor",orientation:"down",pin1Labels:["1","pos"],pin2Labels:["2","neg"]}),OGo=Fi($xe,{kind:"capacitor",orientation:"left",pin1Labels:["1","pos"],pin2Labels:["2","neg"]}),VGo=Fi($xe,{kind:"capacitor",orientation:"right",pin1Labels:["1","pos"],pin2Labels:["2","neg"]}),YGo=Fi($xe,{kind:"capacitor",orientation:"up",pin1Labels:["1","pos"],pin2Labels:["2","neg"]}),vK={paths:{path11:{type:"path",points:[{x:-0.54,y:0.03},{x:-0.3,y:0.03}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.29,y:0.03},{x:0.54,y:0.03}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.29,y:0.29},{x:0.29,y:-0.23}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.02,y:0.37},bottom1:{type:"text",text:"{VAL}",x:-0.01,y:-0.37}},refblocks:{left1:{x:-0.54,y:0.03},right1:{x:0.54,y:0.03}},bounds:{minX:-0.57,maxX:0.57,minY:-0.37,maxY:0.37,width:1.14,height:0.74,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0,y:0.04,radius:0.29,color:"primary",fill:!1}}},{paths:GGo,texts:gNs,bounds:fye,refblocks:EBt,circles:UGo}=vK,WGo=An({primitives:[...Object.values(GGo),...Object.values(UGo),{type:"text",text:"{REF}",x:-0.15,y:0.3894553499999995},{type:"text",text:"{VAL}",x:0.15,y:0.3894553499999995}],ports:[{...EBt.left1,labels:["1"]},{...EBt.right1,labels:["2"]}],size:{width:fye.width,height:fye.height},center:{x:fye.centerX,y:fye.centerY}}).rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),XGo=An(vK).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:jGo,texts:ANs,bounds:yye,refblocks:MBt,circles:KGo}=vK,$Go=An({primitives:[...Object.values(jGo),...Object.values(KGo),{type:"text",text:"{REF}",x:-0,y:-0.2894553499999995},{type:"text",text:"{VAL}",x:0,y:0.3894553499999995}],ports:[{...MBt.left1,labels:["1"]},{...MBt.right1,labels:["2"]}],size:{width:yye.width,height:yye.height},center:{x:yye.centerX,y:yye.centerY}}).changeTextAnchor("{VAL}","middle_bottom").rotateRightFacingSymbol("left").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),qGo=An(vK).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1","neg"]).labelPort("right1",["2","pos"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:JGo,texts:fNs,bounds:xye,refblocks:wBt,circles:ZGo}=vK,eUo=An({primitives:[...Object.values(JGo),...Object.values(ZGo),{type:"text",text:"{REF}",x:0.15,y:-0.2894553499999995},{type:"text",text:"{VAL}",x:-0.15,y:-0.2894553499999995}],ports:[{...wBt.left1,labels:["1"]},{...wBt.right1,labels:["2"]}],size:{width:xye.width,height:xye.height},center:{x:xye.centerX,y:xye.centerY}}).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),{paths:tUo,texts:yNs,bounds:Cye,refblocks:BBt,circles:nUo}=vK,oUo=An({primitives:[...Object.values(tUo),...Object.values(nUo),{type:"text",text:"{REF}",x:0.15,y:-0.2894553499999995},{type:"text",text:"{VAL}",x:-0.15,y:-0.2894553499999995}],ports:[{...BBt.left1,labels:["1"]},{...BBt.right1,labels:["2"]}],size:{width:Cye.width,height:Cye.height},center:{x:Cye.centerX,y:Cye.centerY}}).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),qxe={paths:{path27:{type:"path",points:[{x:0.54,y:-0.01},{x:0.13,y:-0.01}],color:"primary",fill:!1},path29:{type:"path",points:[{x:0.13,y:0.25},{x:0.13,y:-0.27}],color:"primary",fill:!1},"path29-2":{type:"path",points:[{x:0.07,y:0.25},{x:0.07,y:-0.28}],color:"primary",fill:!1},path30:{type:"path",points:[{x:-0.14,y:0.25},{x:-0.14,y:-0.27}],color:"primary",fill:!1},"path29-5":{type:"path",points:[{x:-0.08,y:0.26},{x:-0.08,y:-0.27}],color:"primary",fill:!1},"path29-2-7":{type:"path",points:[{x:0.07,y:0.26},{x:-0.08,y:0.26}],color:"primary",fill:!1},"path29-2-7-6":{type:"path",points:[{x:0.07,y:-0.28},{x:-0.08,y:-0.28}],color:"primary",fill:!1},path43:{type:"path",points:[{x:-0.21,y:0.32},{x:0.2,y:0.32}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0,y:0.71},{x:0,y:0.33},{x:0,y:0.32}],color:"primary",fill:!1},"path43-8":{type:"path",points:[{x:-0.21,y:0.32},{x:-0.21,y:0.25}],color:"primary",fill:!1},"path43-8-8":{type:"path",points:[{x:0.2,y:0.32},{x:0.2,y:0.25}],color:"primary",fill:!1},"path43-9":{type:"path",points:[{x:0.19,y:-0.35},{x:-0.22,y:-0.35}],color:"primary",fill:!1},"path44-0-5":{type:"path",points:[{x:-0.02,y:-0.71},{x:-0.02,y:-0.36},{x:-0.02,y:-0.35}],color:"primary",fill:!1},"path43-8-1":{type:"path",points:[{x:0.19,y:-0.35},{x:0.19,y:-0.28}],color:"primary",fill:!1},"path43-8-8-9":{type:"path",points:[{x:-0.22,y:-0.35},{x:-0.22,y:-0.28}],color:"primary",fill:!1},path28:{type:"path",points:[{x:-0.14,y:-0.01},{x:-0.54,y:-0.01}],color:"primary",fill:!1}},texts:{left1:{type:"text",text:"{REF}",x:0.53,y:0.28},right1:{type:"text",text:"{VAL}",x:0.54,y:-0.28}},refblocks:{top1:{x:0,y:0.71},bottom1:{x:-0.02,y:-0.71},left1:{x:-0.54,y:-0.01},right1:{x:0.54,y:-0.01}},bounds:{minX:-0.57,maxX:0.57,minY:-0.74,maxY:0.74,width:1.14,height:1.48,centerX:0,centerY:0},circles:{}},{paths:rUo,texts:xNs,bounds:bye,refblocks:Iye,circles:iUo}=qxe,sUo=An({primitives:[...Object.values(rUo),...Object.values(iUo),{type:"text",text:"{REF}",x:-0.4,y:0.4094554499999995},{type:"text",text:"{VAL}",x:0.4,y:0.4094553499999995}],ports:[{...Iye.left1,labels:["1"]},{...Iye.right1,labels:["3"]},{...Iye.bottom1,labels:["2"]},{...Iye.top1,labels:["4"]}],size:{width:bye.width,height:bye.height},center:{x:bye.centerX,y:bye.centerY}}).rotateRightFacingSymbol("down").changeTextAnchor("{REF}","bottom_left").changeTextAnchor("{VAL}","top_left").build(),aUo=An(qxe).labelPort("top1",["2","gnd1"]).labelPort("bottom1",["4","gnd2"]).labelPort("left1",["3"]).labelPort("right1",["1"]).changeTextAnchor("{REF}","bottom_left").changeTextAnchor("{VAL}","top_left").build(),cUo=An(qxe).labelPort("top1",["4","gnd1"]).labelPort("bottom1",["2","gnd2"]).labelPort("left1",["1"]).labelPort("right1",["3"]).changeTextAnchor("{REF}","bottom_left").changeTextAnchor("{VAL}","top_left").build(),{paths:lUo,texts:CNs,bounds:vye,refblocks:Sye,circles:hUo}=qxe,dUo=An({primitives:[...Object.values(lUo),...Object.values(hUo),{type:"text",text:"{VAL}",x:-0.4,y:-0.4094554499999995},{type:"text",text:"{REF}",x:0.4,y:-0.4094553499999995}],ports:[{...Sye.left1,labels:["1"]},{...Sye.right1,labels:["3"]},{...Sye.bottom1,labels:["2"]},{...Sye.top1,labels:["4"]}],size:{width:vye.width,height:vye.height},center:{x:vye.centerX,y:vye.centerY}}).rotateRightFacingSymbol("up").changeTextAnchor("{REF}","bottom_left").changeTextAnchor("{VAL}","top_left").build(),Jxe={paths:{path27:{type:"path",points:[{x:0.55,y:-0.01},{x:0.13,y:-0.01}],color:"primary",fill:!1},path28:{type:"path",points:[{x:-0.14,y:-0.01},{x:-0.55,y:-0.01}],color:"primary",fill:!1},path29:{type:"path",points:[{x:0.13,y:-0.28},{x:0.13,y:0.25}],color:"primary",fill:!1},"path29-2":{type:"path",points:[{x:0.07,y:-0.28},{x:0.07,y:0.25}],color:"primary",fill:!1},path30:{type:"path",points:[{x:-0.14,y:-0.28},{x:-0.14,y:0.25}],color:"primary",fill:!1},"path29-5":{type:"path",points:[{x:-0.08,y:-0.28},{x:-0.08,y:0.25}],color:"primary",fill:!1},"path29-2-7":{type:"path",points:[{x:0.07,y:-0.28},{x:-0.08,y:-0.28}],color:"primary",fill:!1},"path29-2-7-6":{type:"path",points:[{x:0.07,y:0.26},{x:-0.08,y:0.26}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{VAL}",x:-0.01,y:-0.42},bottom1:{type:"text",text:"{REF}",x:0,y:0.43}},refblocks:{left1:{x:-0.55,y:-0.01},right1:{x:0.55,y:-0.01}},bounds:{minX:-0.58,maxX:0.58,minY:-0.52,maxY:0.43,width:1.16,height:1,centerX:0,centerY:-0.04},circles:{}},{paths:uUo,texts:bNs,bounds:Pye,refblocks:TBt,circles:pUo}=Jxe,mUo=An({primitives:[...Object.values(uUo),...Object.values(pUo),{type:"text",text:"{REF}",x:-0.3,y:0.3094553499999995},{type:"text",text:"{VAL}",x:0.3,y:0.3094553499999995}],ports:[{...TBt.left1,labels:["1"]},{...TBt.right1,labels:["2"]}],size:{width:Pye.width,height:Pye.height},center:{x:Pye.centerX,y:Pye.centerY}}).changeTextAnchor("{VAL}","top_left").rotateRightFacingSymbol("down").labelPort("left1",["1","pos"]).labelPort("right1",["2","neg"]).changeTextAnchor("{REF}","bottom_left").build(),_Uo=An(Jxe).changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("right").labelPort("left1",["2","neg"]).labelPort("right1",["1","pos"]).changeTextAnchor("{REF}","middle_bottom").build(),gUo=An(Jxe).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:AUo,texts:INs,bounds:Eye,refblocks:DBt,circles:fUo}=Jxe,yUo=An({primitives:[...Object.values(AUo),...Object.values(fUo),{type:"text",text:"{REF}",x:0.3,y:-0.3094553499999995},{type:"text",text:"{VAL}",x:-0.3,y:-0.3094553499999995}],ports:[{...DBt.left1,labels:["1"]},{...DBt.right1,labels:["2"]}],size:{width:Eye.width,height:Eye.height},center:{x:Eye.centerX,y:Eye.centerY}}).changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("up").labelPort("left1",["1","pos"]).labelPort("right1",["2","neg"]).changeTextAnchor("{REF}","bottom_left").build(),xUo=[{type:"path",points:[{x:-jse,y:0},{x:-aOe,y:0}],color:"primary",fill:!1},{type:"path",points:[{x:aOe,y:0},{x:jse,y:0}],color:"primary",fill:!1},{type:"circle",x:0,y:0,radius:aOe,color:"primary",fill:!1},{type:"path",points:[{x:-0.1,y:0},{x:0.15,y:0}],color:"primary",fill:!1},{type:"path",points:[{x:0.15,y:0},{x:0.05,y:0.08}],color:"primary",fill:!1},{type:"path",points:[{x:0.15,y:0},{x:0.05,y:-0.08}],color:"primary",fill:!1}],CUo=An({primitives:[...xUo,{type:"text",text:"{REF}",x:-0.2,y:0.35},{type:"text",text:"{VAL}",x:0.2,y:0.35}],ports:[{x:-jse,y:0,labels:["1"]},{x:jse,y:0,labels:["2"]}],center:{x:0,y:0},size:{width:jse*2,height:0.9}}).rotateRightFacingSymbol("down").changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),bUo=[{type:"path",points:[{x:-Kse,y:0},{x:-cOe,y:0}],color:"primary",fill:!1},{type:"path",points:[{x:cOe,y:0},{x:Kse,y:0}],color:"primary",fill:!1},{type:"circle",x:0,y:0,radius:cOe,color:"primary",fill:!1},{type:"path",points:[{x:-0.1,y:0},{x:0.15,y:0}],color:"primary",fill:!1},{type:"path",points:[{x:0.15,y:0},{x:0.05,y:0.08}],color:"primary",fill:!1},{type:"path",points:[{x:0.15,y:0},{x:0.05,y:-0.08}],color:"primary",fill:!1}],IUo=An({primitives:[...bUo,{type:"text",text:"{REF}",x:0,y:-0.4},{type:"text",text:"{VAL}",x:0,y:0.4}],ports:[{x:-Kse,y:0,labels:["1"]},{x:Kse,y:0,labels:["2"]}],center:{x:0,y:0},size:{width:Kse*2,height:0.9}}).rotateRightFacingSymbol("left").changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),vUo=[{type:"path",points:[{x:-$se,y:0},{x:-lOe,y:0}],color:"primary",fill:!1},{type:"path",points:[{x:lOe,y:0},{x:$se,y:0}],color:"primary",fill:!1},{type:"circle",x:0,y:0,radius:lOe,color:"primary",fill:!1},{type:"path",points:[{x:-0.1,y:0},{x:0.15,y:0}],color:"primary",fill:!1},{type:"path",points:[{x:0.15,y:0},{x:0.05,y:0.08}],color:"primary",fill:!1},{type:"path",points:[{x:0.15,y:0},{x:0.05,y:-0.08}],color:"primary",fill:!1}],SUo=An({primitives:[...vUo,{type:"text",text:"{REF}",x:0,y:0.4},{type:"text",text:"{VAL}",x:0,y:-0.4}],ports:[{x:-$se,y:0,labels:["1"]},{x:$se,y:0,labels:["2"]}],center:{x:0,y:0},size:{width:$se*2,height:0.9}}).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),PUo=[{type:"path",points:[{x:-qse,y:0},{x:-hOe,y:0}],color:"primary",fill:!1},{type:"path",points:[{x:hOe,y:0},{x:qse,y:0}],color:"primary",fill:!1},{type:"circle",x:0,y:0,radius:hOe,color:"primary",fill:!1},{type:"path",points:[{x:-0.1,y:0},{x:0.15,y:0}],color:"primary",fill:!1},{type:"path",points:[{x:0.15,y:0},{x:0.05,y:0.08}],color:"primary",fill:!1},{type:"path",points:[{x:0.15,y:0},{x:0.05,y:-0.08}],color:"primary",fill:!1}],EUo=An({primitives:[...PUo,{type:"text",text:"{REF}",x:0.2,y:-0.35},{type:"text",text:"{VAL}",x:-0.2,y:-0.35}],ports:[{x:-qse,y:0,labels:["1"]},{x:qse,y:0,labels:["2"]}],center:{x:0,y:0},size:{width:qse*2,height:0.9}}).rotateRightFacingSymbol("up").changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),SK={paths:{path11:{type:"path",points:[{x:1.99,y:-1.64},{x:2.1,y:-1.64}],color:"primary",fill:!1},"path40-0":{type:"path",points:[{x:2.1,y:-1.48},{x:2.1,y:-1.8}],color:"primary",fill:!1},"path40-0-5":{type:"path",points:[{x:2.22,y:-1.5},{x:2.11,y:-1.58}],color:"primary",fill:!1},"path40-0-5-0":{type:"path",points:[{x:2.23,y:-1.78},{x:2.11,y:-1.7}],color:"primary",fill:!1},"path12-1-5":{type:"path",points:[{x:2.23,y:-1.49},{x:2.23,y:-1.14}],color:"primary",fill:!1},"path12-1-5-3":{type:"path",points:[{x:2.23,y:-1.97},{x:2.23,y:-1.79}],color:"primary",fill:!1},"arrow-2":{type:"path",points:[{x:2.17,y:-1.7},{x:2.13,y:-1.76},{x:2.19,y:-1.76},{x:2.17,y:-1.7}],color:"primary",fill:!0},path1:{type:"path",points:[{x:1.6,y:-1.5},{x:1.86,y:-1.5}],color:"primary",fill:!1},path2:{type:"path",points:[{x:1.87,y:-1.34},{x:1.87,y:-1.66}],color:"primary",fill:!1},path3:{type:"path",points:[{x:1.99,y:-1.36},{x:1.87,y:-1.44}],color:"primary",fill:!1},path4:{type:"path",points:[{x:1.99,y:-1.64},{x:1.88,y:-1.56}],color:"primary",fill:!1},"arrow-1":{type:"path",points:[{x:1.94,y:-1.56},{x:1.89,y:-1.62},{x:1.96,y:-1.62},{x:1.94,y:-1.56}],color:"primary",fill:!0},path9:{type:"path",points:[{x:1.99,y:-1.35},{x:2.23,y:-1.36}],color:"primary",fill:!1}},texts:{bottom1:{type:"text",text:"{VAL}",x:1.88,y:-1.94},right1:{type:"text",text:"{REF}",x:1.88,y:-1.14}},refblocks:{right1:{x:2.23,y:-1.97},right2:{x:1.6,y:-1.5},right3:{x:2.23,y:-1.14}},bounds:{minX:1.58,maxX:2.35,minY:-1.98,maxY:-1.12,width:0.77,height:0.86,centerX:1.96,centerY:-1.55},circles:{"path1-0":{type:"circle",x:2.05,y:-1.54,radius:0.3,color:"primary",fill:!1}}},MUo=An(SK).rotateRightFacingSymbol("down").labelPort("right2",["1"]).labelPort("right1",["2"]).labelPort("right3",["3"]).changeTextAnchor("{VAL}","middle_left",{x:0.8,y:-0.15}).changeTextAnchor("{REF}","middle_left",{x:0,y:0.15}).build(),wUo=An(SK).rotateRightFacingSymbol("right").labelPort("right2",["1"]).labelPort("right1",["2"]).labelPort("right3",["3"]).changeTextAnchor("{VAL}","middle_right").changeTextAnchor("{REF}","middle_right").build(),BUo=An(SK).rotateRightFacingSymbol("left").labelPort("right2",["1"]).labelPort("right1",["2"]).labelPort("right3",["3"]).changeTextAnchor("{VAL}","middle_left",{x:0,y:-0.8}).changeTextAnchor("{REF}","middle_left",{x:0,y:0.8}).build(),TUo=An(SK).rotateRightFacingSymbol("right").labelPort("right2",["1"]).labelPort("right1",["2"]).labelPort("right3",["3"]).changeTextAnchor("{VAL}","middle_right").changeTextAnchor("{REF}","middle_right").build(),DUo=An(SK).rotateRightFacingSymbol("up").labelPort("right2",["1"]).labelPort("right1",["2"]).labelPort("right3",["3"]).changeTextAnchor("{VAL}","middle_left",{x:0,y:-0.15}).changeTextAnchor("{REF}","middle_left",{x:0.8,y:0.15}).build(),NUo=An(SK).rotateRightFacingSymbol("up").labelPort("right2",["1"]).labelPort("right1",["2"]).labelPort("right3",["3"]).changeTextAnchor("{VAL}","middle_left",{x:0,y:-0.15}).changeTextAnchor("{REF}","middle_left",{x:0.8,y:0.15}).build(),RUo={paths:{path11:{type:"path",points:[{x:-0.54,y:0},{x:-0.3,y:0}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.29,y:0},{x:0.54,y:0}],color:"primary",fill:!1},path2:{type:"path",points:[{x:-0.12,y:0.09},{x:0.12,y:0.09}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.18,y:-0.45},bottom1:{type:"text",text:"{VAL}",x:-0.01,y:0.35},left1:{type:"text",text:"A",x:0,y:-0.1}},refblocks:{left1:{x:-0.54,y:0},right1:{x:0.54,y:0}},bounds:{minX:-0.53,maxX:0.53,minY:-0.09,maxY:0.09,width:1.06,height:1,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0,y:0,radius:0.29,color:"primary",fill:!1}}},{paths:NBt,bounds:Mye,refblocks:RBt,circles:QUo}=RUo,tae=Gl({primitives:[NBt.path11,NBt.path12,{type:"path",points:[{x:-0.12,y:0.14},{x:0.12,y:0.14}],color:"primary",fill:!1},...Object.values(QUo),{type:"text",text:"{REF}",x:0,y:0.3594553499999995,anchor:"middle_bottom"},{type:"text",text:"{VAL}",x:0,y:-0.35,anchor:"middle_top"},{type:"path",points:[{x:-0.095,y:-0.16},{x:0,y:0.09}],color:"primary",fill:!1},{type:"path",points:[{x:0,y:0.09},{x:0.095,y:-0.16}],color:"primary",fill:!1},{type:"path",points:[{x:-0.048,y:-0.045},{x:0.048,y:-0.045}],color:"primary",fill:!1}],ports:[{...RBt.left1,labels:["1"]},{...RBt.right1,labels:["2"]}],size:{width:Mye.width,height:Mye.height},center:{x:Mye.centerX,y:Mye.centerY}}),NOe=structuredClone(tae);NOe.primitives=NOe.primitives.map((e)=>e.type!=="text"?e:e.text==="{REF}"?{...e,x:-0.16,y:0.3594553499999995,anchor:"middle_bottom"}:e.text==="{VAL}"?{...e,x:0.16,y:0.35,anchor:"middle_bottom"}:e);QBt=Zse(NOe,{newOrientation:"down"}),kUo=Y9(tae),LUo=tae,ROe=structuredClone(tae);ROe.primitives=ROe.primitives.map((e)=>e.type!=="text"?e:e.text==="{REF}"?{...e,x:0.16,y:-0.3594553499999995,anchor:"middle_top"}:e.text==="{VAL}"?{...e,x:-0.16,y:-0.35,anchor:"middle_top"}:e);HUo=Zse(ROe,{newOrientation:"up"}),PK={paths:{path11:{type:"path",points:[{x:-0.54,y:0.03},{x:-0.3,y:0.04}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.29,y:0.04},{x:0.54,y:0.04}],color:"primary",fill:!1},"path11-5-5":{type:"path",points:[{x:0.1,y:0.13},{x:0,y:-0.06},{x:-0.11,y:0.13}],color:"primary",fill:!1},path2:{type:"path",points:[{x:-0.12,y:-0.14},{x:0.12,y:-0.14}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.17,y:0.4},bottom1:{type:"text",text:"{VAL}",x:-0.01,y:-0.4}},refblocks:{left1:{x:-0.54,y:0.03},right1:{x:0.54,y:0.04}},bounds:{minX:-0.57,maxX:0.57,minY:-0.4,maxY:0.4,width:1.14,height:0.79,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0,y:0.04,radius:0.29,color:"primary",fill:!1}}},{paths:FUo,texts:vNs,bounds:wye,refblocks:kBt,circles:zUo}=PK,OUo=An({primitives:[...Object.values(FUo),...Object.values(zUo),{type:"text",text:"{REF}",x:-0.15,y:0.3894553499999995},{type:"text",text:"{VAL}",x:0.15,y:0.3894553499999995}],ports:[{...kBt.left1,labels:["1"]},{...kBt.right1,labels:["2"]}],size:{width:wye.width,height:wye.height},center:{x:wye.centerX,y:wye.centerY}}).rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),{paths:VUo,texts:SNs,bounds:Bye,refblocks:LBt,circles:YUo}=PK,GUo=An({primitives:[...Object.values(VUo),...Object.values(YUo),{type:"text",text:"{REF}",x:-0,y:0.3894553499999995},{type:"text",text:"{VAL}",x:0,y:-0.3294553499999995}],ports:[{...LBt.left1,labels:["1"]},{...LBt.right1,labels:["2"]}],size:{width:Bye.width,height:Bye.height},center:{x:Bye.centerX,y:Bye.centerY}}).changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:UUo,texts:PNs,bounds:Tye,refblocks:HBt,circles:WUo}=PK,XUo=An({primitives:[...Object.values(UUo),...Object.values(WUo),{type:"text",text:"{REF}",x:-0,y:-0.3294553499999995},{type:"text",text:"{VAL}",x:0,y:0.4294553499999995}],ports:[{...HBt.left1,labels:["1"]},{...HBt.right1,labels:["2"]}],size:{width:Tye.width,height:Tye.height},center:{x:Tye.centerX,y:Tye.centerY}}).changeTextAnchor("{VAL}","middle_bottom").rotateRightFacingSymbol("left").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:jUo,texts:ENs,bounds:Dye,refblocks:FBt,circles:KUo}=PK,$Uo=An({primitives:[...Object.values(jUo),...Object.values(KUo),{type:"text",text:"{REF}",x:-0,y:0.3894553499999995},{type:"text",text:"{VAL}",x:0,y:-0.3294553499999995}],ports:[{...FBt.left1,labels:["1"]},{...FBt.right1,labels:["2"]}],size:{width:Dye.width,height:Dye.height},center:{x:Dye.centerX,y:Dye.centerY}}).changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:qUo,texts:MNs,bounds:Nye,refblocks:zBt,circles:JUo}=PK,ZUo=An({primitives:[...Object.values(qUo),...Object.values(JUo),{type:"text",text:"{REF}",x:0.15,y:-0.2894553499999995},{type:"text",text:"{VAL}",x:-0.15,y:-0.2894553499999995}],ports:[{...zBt.left1,labels:["1"]},{...zBt.right1,labels:["2"]}],size:{width:Nye.width,height:Nye.height},center:{x:Nye.centerX,y:Nye.centerY}}).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),{paths:eWo,texts:wNs,bounds:Rye,refblocks:OBt,circles:tWo}=PK,nWo=An({primitives:[...Object.values(eWo),...Object.values(tWo),{type:"text",text:"{REF}",x:0.15,y:-0.2894553499999995},{type:"text",text:"{VAL}",x:-0.15,y:-0.2894553499999995}],ports:[{...OBt.left1,labels:["1"]},{...OBt.right1,labels:["2"]}],size:{width:Rye.width,height:Rye.height},center:{x:Rye.centerX,y:Rye.centerY}}).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),EK={paths:{path11:{type:"path",points:[{x:-0.54,y:0.04},{x:-0.11,y:0.04}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.1,y:0.04},{x:0.54,y:0.04}],color:"primary",fill:!1},"path11-0":{type:"path",points:[{x:-0.09,y:-0.15},{x:-0.09,y:0.26}],color:"primary",fill:!1},"path11-0-3":{type:"path",points:[{x:0.09,y:-0.15},{x:0.09,y:0.26}],color:"primary",fill:!1},"path11-0-9":{type:"path",points:[{x:-0.08,y:0.06},{x:-0.08,y:-0.15},{x:0.09,y:-0.05},{x:-0.08,y:0.06}],color:"primary",fill:!0},"path11-0-9-0":{type:"path",points:[{x:0.08,y:0.26},{x:0.08,y:0.05},{x:-0.09,y:0.15},{x:0.07,y:0.26}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-0.03,y:0.42},bottom1:{type:"text",text:"{VAL}",x:-0.03,y:-0.42}},refblocks:{left1:{x:-0.54,y:0.04},right1:{x:0.54,y:0.04}},bounds:{minX:-0.57,maxX:0.57,minY:-0.42,maxY:0.42,width:1.14,height:0.83,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0,y:0.05,radius:0.29,color:"primary",fill:!1}}},oWo=An(EK).rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left",{x:-0.03,y:0.2}).changeTextAnchor("{VAL}","middle_left",{x:0.8,y:-0.2}).build(),rWo=An(EK).rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom",{x:0,y:0.1}).changeTextAnchor("{VAL}","middle_top").build(),iWo=An(EK).rotateRightFacingSymbol("left").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom",{x:0,y:0.8}).changeTextAnchor("{VAL}","middle_top",{x:0,y:-0.9}).build(),sWo=An(EK).rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom",{x:0,y:0.1}).changeTextAnchor("{VAL}","middle_top").build(),aWo=An(EK).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left",{x:0.7,y:0.2}).changeTextAnchor("{VAL}","middle_left",{x:-0.13,y:-0.2}).build(),cWo=An(EK).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left",{x:0.7,y:0.2}).changeTextAnchor("{VAL}","middle_left",{x:-0.13,y:-0.2}).build(),Zxe={paths:{triangle:{type:"path",points:[{x:-0.06,y:-0.09},{x:-0.06,y:0.09},{x:0.06,y:0},{x:-0.06,y:-0.09}],color:"primary",fill:!1},stem:{type:"path",points:[{x:-0.11,y:0},{x:-0.06,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.03}},refblocks:{left1:{x:-0.11,y:0}},bounds:{minX:-0.57,maxX:0.57,minY:-0.37,maxY:0.37,width:1.14,height:0.74,centerX:0,centerY:0},circles:{}},{paths:lWo,bounds:VBt,refblocks:hWo}=Zxe,dWo=An({primitives:[...Object.values(lWo),{type:"text",text:"{REF}",x:-0.13,y:-0}],ports:[{...hWo.left1,labels:["1"]}],center:{x:VBt.centerX,y:VBt.centerY}}).rotateRightFacingSymbol("up").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_top").build(),{paths:uWo,bounds:YBt,refblocks:pWo}=Zxe,mWo=An({primitives:[...Object.values(uWo),{type:"text",text:"{REF}",x:-0.13,y:0}],ports:[{...pWo.left1,labels:["1"]}],center:{x:YBt.centerX,y:YBt.centerY}}).rotateRightFacingSymbol("right").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_right").build(),{paths:_Wo,bounds:GBt,refblocks:gWo}=Zxe,AWo=An({primitives:[...Object.values(_Wo),{type:"text",text:"{REF}",x:-0.13,y:-0}],ports:[{...gWo.left1,labels:["1"]}],center:{x:GBt.centerX,y:GBt.centerY}}).rotateRightFacingSymbol("left").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_left").build(),{paths:fWo,bounds:UBt,refblocks:yWo}=Zxe,xWo=An({primitives:[...Object.values(fWo),{type:"text",text:"{REF}",x:-0.13,y:0}],ports:[{...yWo.left1,labels:["1"]}],center:{x:UBt.centerX,y:UBt.centerY}}).rotateRightFacingSymbol("down").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_bottom").build(),CWo={paths:{path40:{type:"path",points:[{x:0.14,y:0.04},{x:-0.12,y:-0.09}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-0.12,y:0.18},{x:0.14,y:0.04}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-0.12,y:-0.09},{x:-0.12,y:0.18}],color:"primary",fill:!1},path43:{type:"path",points:[{x:0.14,y:0.18},{x:0.14,y:-0.09}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-0.12,y:0.04},{x:-0.52,y:0.04}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.52,y:0.04},{x:0.15,y:0.04}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.01,y:0.27},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.27}},refblocks:{left1:{x:-0.52,y:0.04},right1:{x:0.52,y:0.04}},bounds:{minX:-0.55,maxX:0.55,minY:-0.27,maxY:0.27,width:1.09,height:0.55,centerX:0,centerY:0},circles:{}},e5e=An(CWo).labelPort("left1",["1","pos","anode"]).labelPort("right1",["2","neg","cathode"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),bWo=Ro(e5e,"down"),IWo=Ro(e5e,"left"),t5e={paths:{"anode-lead":{type:"path",points:[{x:-0.25,y:0},{x:-0.11999999999999988,y:0}],color:"primary",fill:!1},body:{type:"path",points:[{x:-0.11999999999999988,y:0.11999999999999988},{x:0.1200000000000001,y:0},{x:-0.11999999999999988,y:-0.1200000000000001},{x:-0.11999999999999988,y:0.11999999999999988}],color:"primary",fill:!1},"cathode-bar":{type:"path",points:[{x:0.1200000000000001,y:0.11999999999999988},{x:0.1200000000000001,y:-0.1200000000000001}],color:"primary",fill:!1},"cathode-lead":{type:"path",points:[{x:0.1200000000000001,y:0},{x:0.25,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.25},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.25}},refblocks:{left1:{x:-0.25,y:0},right1:{x:0.25,y:0}},bounds:{minX:-0.25,maxX:0.25,minY:-0.25,maxY:0.25,width:0.5,height:0.5,centerX:0,centerY:0},circles:{}},vWo=Fi(t5e,{kind:"diode",orientation:"down",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),SWo=Fi(t5e,{kind:"diode",orientation:"left",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),PWo=Fi(t5e,{kind:"diode",orientation:"right",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),EWo=Fi(t5e,{kind:"diode",orientation:"up",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),MWo=Ro(e5e,"up"),n5e={paths:{"anode-lead":{type:"path",points:[{x:-0.17499999999999982,y:0},{x:-0.09999999999999987,y:0}],color:"primary",fill:!1},body:{type:"path",points:[{x:-0.09999999999999987,y:0.09999999999999987},{x:0.10000000000000009,y:0},{x:-0.09999999999999987,y:-0.10000000000000009},{x:-0.09999999999999987,y:0.09999999999999987}],color:"primary",fill:!1},"cathode-bar":{type:"path",points:[{x:0.10000000000000009,y:0.09999999999999987},{x:0.10000000000000009,y:-0.10000000000000009}],color:"primary",fill:!1},"cathode-lead":{type:"path",points:[{x:0.10000000000000009,y:0},{x:0.17500000000000004,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.25},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.25}},refblocks:{left1:{x:-0.17499999999999982,y:0},right1:{x:0.17500000000000004,y:0}},bounds:{minX:-0.17499999999999982,maxX:0.17500000000000004,minY:-0.25,maxY:0.25,width:0.34999999999999987,height:0.5,centerX:0.00000000000000011102230246251565,centerY:0},circles:{}},wWo=Fi(n5e,{kind:"diode",orientation:"down",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),BWo=Fi(n5e,{kind:"diode",orientation:"left",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),TWo=Fi(n5e,{kind:"diode",orientation:"right",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),DWo=Fi(n5e,{kind:"diode",orientation:"up",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),NWo={paths:{path1:{type:"path",points:[{x:-0.37,y:0.22},{x:-0.13,y:0.22}],color:"primary",fill:!1},"path-1-2":{type:"path",points:[{x:-0.07,y:0.22},{x:0.11,y:0.16}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.1,y:0.13},{x:0.37,y:0.13}],color:"primary",fill:!1},path3:{type:"path",points:[{x:0.12,y:0.36},{x:0.37,y:0.36}],color:"primary",fill:!1},path4:{type:"path",points:[{x:-0.37,y:-0.18},{x:-0.13,y:-0.18}],color:"primary",fill:!1},"path4-5":{type:"path",points:[{x:-0.07,y:-0.19},{x:0.1,y:-0.24}],color:"primary",fill:!1},path5:{type:"path",points:[{x:0.1,y:-0.27},{x:0.37,y:-0.27}],color:"primary",fill:!1},path6:{type:"path",points:[{x:0.12,y:-0.04},{x:0.37,y:-0.04}],color:"primary",fill:!1},"path1-4-join":{type:"path",points:[{x:0,y:-0.2},{x:0,y:0.19}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.56},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.42}},refblocks:{left1:{x:-0.37,y:0.22},left2:{x:-0.37,y:-0.18},right1:{x:0.37,y:0.36},right2:{x:0.37,y:0.13},right3:{x:0.37,y:-0.04},right5:{x:0.37,y:-0.27}},bounds:{minX:-0.4,maxX:0.4,minY:-0.47,maxY:0.56,width:1,height:1.04,centerX:0,centerY:0.05},circles:{"circle-2":{type:"circle",x:0.08,y:0.13,radius:0.02,color:"primary",fill:!1},"circle-5":{type:"circle",x:0.08,y:-0.27,radius:0.02,color:"primary",fill:!1},"circle-3":{type:"circle",x:0.08,y:0.37,radius:0.02,color:"primary",fill:!1},"circle-6":{type:"circle",x:0.08,y:-0.04,radius:0.02,color:"primary",fill:!1},"circle-1":{type:"circle",x:-0.1,y:0.22,radius:0.02,color:"primary",fill:!1},"circle-4":{type:"circle",x:-0.1,y:-0.18,radius:0.02,color:"primary",fill:!1}}},o5e=An(NWo).labelPort("left1",["1"]).labelPort("right1",["3"]).labelPort("right2",["2"]).labelPort("right3",["6"]).labelPort("left2",["4"]).labelPort("right5",["5"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),VOe=Ro(o5e,"down"),YOe=VOe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),GOe=VOe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");YOe.anchor="middle_bottom";GOe.anchor="middle_top";YOe.x=0;YOe.y+=0.537;GOe.y-=0.5375;GOe.x=0;RWo=VOe,UOe=Ro(o5e,"left"),WOe=UOe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),XOe=UOe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");WOe.anchor="middle_bottom";XOe.anchor="middle_top";WOe.x=0;WOe.y+=1;XOe.y-=1;XOe.x=0;QWo=UOe,jOe=Ro(o5e,"up"),KOe=jOe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),$Oe=jOe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");KOe.anchor="middle_bottom";$Oe.anchor="middle_top";KOe.x=0;KOe.y+=0.537;$Oe.y-=0.5375;$Oe.x=0;kWo=jOe,LWo={paths:{path1:{type:"path",points:[{x:-0.37,y:0.22},{x:-0.13,y:0.22}],color:"primary",fill:!1},"path-1-3":{type:"path",points:[{x:-0.07,y:0.23},{x:0.11,y:0.33}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.1,y:0.13},{x:0.37,y:0.13}],color:"primary",fill:!1},path3:{type:"path",points:[{x:0.12,y:0.36},{x:0.37,y:0.36}],color:"primary",fill:!1},path4:{type:"path",points:[{x:-0.37,y:-0.18},{x:-0.13,y:-0.18}],color:"primary",fill:!1},"path4-6":{type:"path",points:[{x:-0.07,y:-0.18},{x:0.11,y:-0.07}],color:"primary",fill:!1},path5:{type:"path",points:[{x:0.1,y:-0.27},{x:0.37,y:-0.27}],color:"primary",fill:!1},path6:{type:"path",points:[{x:0.12,y:-0.04},{x:0.37,y:-0.04}],color:"primary",fill:!1},"path1-4-join":{type:"path",points:[{x:0,y:-0.12},{x:0,y:0.27}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.61},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.52}},refblocks:{left1:{x:-0.37,y:0.22},left2:{x:-0.37,y:-0.18},right1:{x:0.37,y:0.36},right2:{x:0.37,y:0.13},right3:{x:0.37,y:-0.04},right5:{x:0.37,y:-0.27}},bounds:{minX:-0.4,maxX:0.4,minY:-0.47,maxY:0.56,width:1,height:1.04,centerX:0,centerY:0.05},circles:{"circle-2":{type:"circle",x:0.08,y:0.13,radius:0.02,color:"primary",fill:!1},"circle-5":{type:"circle",x:0.08,y:-0.27,radius:0.02,color:"primary",fill:!1},"circle-3":{type:"circle",x:0.08,y:0.37,radius:0.02,color:"primary",fill:!1},"circle-6":{type:"circle",x:0.08,y:-0.04,radius:0.02,color:"primary",fill:!1},"circle-1":{type:"circle",x:-0.1,y:0.22,radius:0.02,color:"primary",fill:!1},"circle-4":{type:"circle",x:-0.1,y:-0.18,radius:0.02,color:"primary",fill:!1}}},r5e=An(LWo).labelPort("left1",["1"]).labelPort("right1",["3"]).labelPort("right2",["2"]).labelPort("right3",["6"]).labelPort("left2",["4"]).labelPort("right5",["5"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),qOe=Ro(r5e,"down"),JOe=qOe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),ZOe=qOe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");JOe.anchor="middle_bottom";ZOe.anchor="middle_top";JOe.x=0;JOe.y+=0.565;ZOe.y-=0.555;ZOe.x=0;HWo=qOe,eVe=Ro(r5e,"left"),tVe=eVe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),nVe=eVe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");tVe.anchor="middle_bottom";nVe.anchor="middle_top";tVe.x=0;tVe.y+=1.09;nVe.y-=1.09;nVe.x=0;FWo=eVe,oVe=Ro(r5e,"up"),rVe=oVe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),iVe=oVe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");rVe.anchor="middle_bottom";iVe.anchor="middle_top";rVe.x=0;rVe.y+=0.565;iVe.y-=0.555;iVe.x=0;zWo=oVe,OWo={paths:{path11:{type:"path",points:[{x:-0.38,y:0.06},{x:-0.14,y:0.06}],color:"primary",fill:!1},"path11-0":{type:"path",points:[{x:-0.09,y:0.07},{x:0.11,y:0.11}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.13,y:0.06},{x:0.38,y:0.06}],color:"primary",fill:!1},"path11-5":{type:"path",points:[{x:-0.38,y:-0.17},{x:-0.14,y:-0.17}],color:"primary",fill:!1},"path11-0-3":{type:"path",points:[{x:-0.09,y:-0.17},{x:0.11,y:-0.12}],color:"primary",fill:!1},"path12-0":{type:"path",points:[{x:0.13,y:-0.17},{x:0.38,y:-0.17}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.31},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.31}},refblocks:{left1:{x:-0.38,y:-0.17},left3:{x:-0.38,y:0.06},right1:{x:0.38,y:-0.17},right3:{x:0.38,y:0.06}},bounds:{minX:-0.4,maxX:0.4,minY:-0.4,maxY:0.4,width:0.81,height:0.79,centerX:0,centerY:0},circles:{"circle-4":{type:"circle",x:0.1,y:0.06,radius:0.02,color:"primary",fill:!1},"circle-2":{type:"circle",x:0.1,y:-0.17,radius:0.02,color:"primary",fill:!1},"circle-3":{type:"circle",x:-0.11,y:0.06,radius:0.02,color:"primary",fill:!1},"circle-1":{type:"circle",x:-0.11,y:-0.17,radius:0.02,color:"primary",fill:!1}}},i5e=An(OWo).labelPort("left1",["1"]).labelPort("right1",["2"]).labelPort("right3",["4"]).labelPort("left3",["3"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),sVe=Ro(i5e,"down"),aVe=sVe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),cVe=sVe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");aVe.anchor="middle_bottom";cVe.anchor="middle_top";aVe.x=0.4;aVe.y+=0.265;cVe.y-=0.265;cVe.x=0.4;VWo=sVe,lVe=Ro(i5e,"left"),hVe=lVe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),dVe=lVe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");hVe.anchor="middle_bottom";dVe.anchor="middle_top";hVe.x=0;hVe.y+=0.67;dVe.y-=0.67;dVe.x=0;YWo=lVe,uVe=Ro(i5e,"up"),pVe=uVe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),mVe=uVe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");pVe.anchor="middle_bottom";mVe.anchor="middle_top";pVe.x=0.46;pVe.y+=0.265;mVe.y-=0.265;mVe.x=0.46;GWo=uVe,UWo={paths:{path11:{type:"path",points:[{x:-0.38,y:0.06},{x:-0.14,y:0.06}],color:"primary",fill:!1},"path11-0":{type:"path",points:[{x:-0.09,y:0.07},{x:0.1,y:0.2}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.13,y:0.06},{x:0.38,y:0.06}],color:"primary",fill:!1},"path11-5":{type:"path",points:[{x:-0.38,y:-0.17},{x:-0.14,y:-0.17}],color:"primary",fill:!1},"path11-0-3":{type:"path",points:[{x:-0.09,y:-0.16},{x:0.1,y:-0.03}],color:"primary",fill:!1},"path12-0":{type:"path",points:[{x:0.13,y:-0.17},{x:0.38,y:-0.17}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.42},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.42}},refblocks:{left1:{x:-0.38,y:-0.17},left3:{x:-0.38,y:0.06},right1:{x:0.38,y:-0.17},right3:{x:0.38,y:0.06}},bounds:{minX:-0.4,maxX:0.4,minY:-0.4,maxY:0.4,width:0.81,height:0.79,centerX:0,centerY:0},circles:{"circle-4":{type:"circle",x:0.1,y:0.06,radius:0.02,color:"primary",fill:!1},"circle-2":{type:"circle",x:0.1,y:-0.17,radius:0.02,color:"primary",fill:!1},"circle-3":{type:"circle",x:-0.11,y:0.06,radius:0.02,color:"primary",fill:!1},"circle-1":{type:"circle",x:-0.11,y:-0.17,radius:0.02,color:"primary",fill:!1}}},s5e=An(UWo).labelPort("left1",["1"]).labelPort("right1",["2"]).labelPort("right3",["4"]).labelPort("left3",["3"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),_Ve=Ro(s5e,"down"),gVe=_Ve.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),AVe=_Ve.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");gVe.anchor="middle_bottom";AVe.anchor="middle_top";gVe.x=0.4;gVe.y+=0.295;AVe.y-=0.295;AVe.x=0.42;WWo=_Ve,fVe=Ro(s5e,"left"),yVe=fVe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),xVe=fVe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");yVe.anchor="middle_bottom";xVe.anchor="middle_top";yVe.x=0;yVe.y+=0.795;xVe.y-=0.795;xVe.x=0;XWo=fVe,CVe=Ro(s5e,"up"),bVe=CVe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),IVe=CVe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");bVe.anchor="middle_bottom";IVe.anchor="middle_top";bVe.x=0.46;bVe.y+=0.315;IVe.y-=0.315;IVe.x=0.46;jWo=CVe,Qye={paths:{"left-terminal-lead":{type:"path",points:[{x:-0.7,y:0.06000000000000005},{x:-0.3938805999999999,y:0.06000000000000005}],color:"primary",fill:!1},"diode-bridge":{type:"path",points:[{x:-0.2763954999999998,y:0.06000000000000005},{x:0.27446270000000017,y:0.06000000000000005}],color:"primary",fill:!1},"right-terminal-lead":{type:"path",points:[{x:0.39193030000000006,y:0.06000000000000005},{x:0.7000000000000002,y:0.06000000000000005}],color:"primary",fill:!1},"junction-lead":{type:"path",points:[{x:0,y:0.06000000000000005},{x:0,y:-0.2200000000000002}],color:"primary",fill:!1},"first-diode-body":{type:"path",points:[{x:-0.3938805999999999,y:0.12609950000000003},{x:-0.2783806,y:0.05897259999999993},{x:-0.3938805999999999,y:-0.007179100000000105},{x:-0.3938805999999999,y:0.12609950000000003}],color:"primary",fill:!1},"first-cathode-bar":{type:"path",points:[{x:-0.2763954999999998,y:0.1754652000000001},{x:-0.2763954999999998,y:-0.05455969999999999},{x:-0.23000749999999992,y:-0.05455969999999999},{x:-0.23000749999999992,y:-0.027900499999999884}],color:"primary",fill:!1},"first-cathode-upper-hook":{type:"path",points:[{x:-0.32379350000000007,y:0.13499749999999988},{x:-0.3228009999999999,y:0.1754652000000001},{x:-0.2763954999999998,y:0.1754652000000001}],color:"primary",fill:!1},"second-diode-body":{type:"path",points:[{x:0.27446270000000017,y:0.12609950000000003},{x:0.3899626999999999,y:0.05897259999999993},{x:0.27446270000000017,y:-0.007179100000000105},{x:0.27446270000000017,y:0.12609950000000003}],color:"primary",fill:!1},"second-cathode-bar":{type:"path",points:[{x:0.39193030000000006,y:0.1754652000000001},{x:0.39193030000000006,y:-0.05455969999999999},{x:0.43931089999999995,y:-0.05455969999999999},{x:0.43931089999999995,y:-0.027900499999999884}],color:"primary",fill:!1},"second-cathode-upper-hook":{type:"path",points:[{x:0.3455249,y:0.13499749999999988},{x:0.3465174000000002,y:0.1754652000000001},{x:0.39193030000000006,y:0.1754652000000001}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.3400000000000001},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.3400000000000001}},refblocks:{bottom1:{x:0,y:-0.2200000000000002},left1:{x:-0.7,y:0.06000000000000005},right1:{x:0.7000000000000002,y:0.06000000000000005}},bounds:{minX:-0.7,maxX:0.7000000000000002,minY:-0.3400000000000001,maxY:0.3400000000000001,width:1.4000000000000001,height:0.6800000000000002,centerX:0.00000000000000011102230246251565,centerY:0},circles:{"junction-dot":{type:"circle",x:0,y:0.06000000000000005,radius:0.024291,color:"primary",fill:!0}}},KWo={right:{reference:{x:0,y:0.34},value:{x:0,y:-0.34}},up:{reference:{x:0.17,y:-0.34},value:{x:-0.17,y:-0.34}},down:{reference:{x:-0.17,y:0.34},value:{x:0.17,y:0.34}}},$Wo=vVe("down"),gDt=vVe("right"),qWo=Y9(gDt),JWo=vVe("up"),ADt={paths:{path5:{type:"path",points:[{x:-0.44,y:0},{x:-0.16,y:0}],color:"primary",fill:!1},path6:{type:"path",points:[{x:0.17,y:0},{x:0.44,y:0.01}],color:"primary",fill:!1},path9:{type:"path",points:[{x:-0.25,y:-0.16},{x:0.02,y:0.3},{x:0.25,y:0.17},{x:-0.02,y:-0.29},{x:-0.25,y:-0.16}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.37},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.37}},refblocks:{left1:{x:-0.44,y:0},right1:{x:0.44,y:0.01}},bounds:{minX:-0.57,maxX:0.57,minY:-0.25,maxY:0.25,width:1.13,height:0.5,centerX:0,centerY:0},circles:{}},{paths:ZWo,texts:BNs,bounds:kye,refblocks:WBt,circles:eXo}=ADt,fDt=An({primitives:[...Object.values(ZWo),...Object.values(eXo),{type:"text",text:"{REF}",x:0.18,y:-0.3204553499999995},{type:"text",text:"{VAL}",x:-0.25,y:-0.3294553499999995}],ports:[{...WBt.left1,labels:["1"]},{...WBt.right1,labels:["2"]}],size:{width:kye.width,height:kye.height},center:{x:kye.centerX,y:kye.centerY}}).rotateRightFacingSymbol("up").labelPort("left",["1"]).labelPort("right",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),SVe=CK(fDt),PVe=SVe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),EVe=SVe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");PVe.anchor="middle_left";EVe.anchor="middle_left";PVe.y+=0.4;PVe.x=0.32;EVe.y-=0.45;EVe.x=0.32;tXo=SVe,yDt=An(ADt).labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),nXo=Y9(yDt),MK={paths:{path11:{type:"path",points:[{x:-0.56,y:0.04},{x:-0.22,y:0.04}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.14,y:0.05},{x:0.48,y:0.05}],color:"primary",fill:!1},"path12-6":{type:"path",points:[{x:0.14,y:-0.15},{x:0.14,y:0.25}],color:"primary",fill:!1},"path11-0-9":{type:"path",points:[{x:-0.22,y:0.25},{x:-0.21,y:-0.15},{x:0.14,y:0.05},{x:-0.22,y:0.25}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-0.09,y:0.38},bottom1:{type:"text",text:"{VAL}",x:-0.07,y:-0.38},right1:{type:"text",text:"",x:0.59,y:-0.33}},refblocks:{left1:{x:-0.56,y:0.04},right1:{x:0.48,y:0.05}},bounds:{minX:-0.59,maxX:0.59,minY:-0.38,maxY:0.38,width:1.18,height:0.76,centerX:0,centerY:0},circles:{}},{paths:oXo,texts:TNs,bounds:Lye,refblocks:XBt,circles:rXo}=MK,iXo=An({primitives:[...Object.values(oXo),...Object.values(rXo),{type:"text",text:"{REF}",x:-0.15,y:0.3294553499999995},{type:"text",text:"{VAL}",x:0.15,y:0.3294553499999995}],ports:[{...XBt.left1,labels:["1"]},{...XBt.right1,labels:["2"]}],size:{width:Lye.width,height:Lye.height},center:{x:Lye.centerX,y:Lye.centerY}}).rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),{paths:sXo,texts:DNs,bounds:Hye,refblocks:jBt,circles:aXo}=MK,cXo=An({primitives:[...Object.values(sXo),...Object.values(aXo),{type:"text",text:"{REF}",x:-0,y:0.4094553499999995},{type:"text",text:"{VAL}",x:0,y:-0.4094553499999995}],ports:[{...jBt.left1,labels:["1"]},{...jBt.right1,labels:["2"]}],size:{width:Hye.width,height:Hye.height},center:{x:Hye.centerX,y:Hye.centerY}}).changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:lXo,texts:NNs,bounds:Fye,refblocks:KBt,circles:hXo}=MK,dXo=An({primitives:[...Object.values(lXo),...Object.values(hXo),{type:"text",text:"{REF}",x:-0,y:-0.3094553499999995},{type:"text",text:"{VAL}",x:0,y:0.4094553499999995}],ports:[{...KBt.left1,labels:["1"]},{...KBt.right1,labels:["2"]}],size:{width:Fye.width,height:Fye.height},center:{x:Fye.centerX,y:Fye.centerY}}).changeTextAnchor("{VAL}","middle_bottom").rotateRightFacingSymbol("left").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:uXo,texts:RNs,bounds:zye,refblocks:$Bt,circles:pXo}=MK,mXo=An({primitives:[...Object.values(uXo),...Object.values(pXo),{type:"text",text:"{REF}",x:-0,y:0.4094553499999995},{type:"text",text:"{VAL}",x:0,y:-0.4094553499999995}],ports:[{...$Bt.left1,labels:["1"]},{...$Bt.right1,labels:["2"]}],size:{width:zye.width,height:zye.height},center:{x:zye.centerX,y:zye.centerY}}).changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:_Xo,texts:QNs,bounds:Oye,refblocks:qBt,circles:gXo}=MK,AXo=An({primitives:[...Object.values(_Xo),...Object.values(gXo),{type:"text",text:"{REF}",x:0.15,y:-0.2894553499999995},{type:"text",text:"{VAL}",x:-0.15,y:-0.2894553499999995}],ports:[{...qBt.left1,labels:["1"]},{...qBt.right1,labels:["2"]}],size:{width:Oye.width,height:Oye.height},center:{x:Oye.centerX,y:Oye.centerY}}).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),{paths:fXo,texts:kNs,bounds:Vye,refblocks:JBt,circles:yXo}=MK,xXo=An({primitives:[...Object.values(fXo),...Object.values(yXo),{type:"text",text:"{REF}",x:0.15,y:-0.2894553499999995},{type:"text",text:"{VAL}",x:-0.15,y:-0.2894553499999995}],ports:[{...JBt.left1,labels:["1"]},{...JBt.right1,labels:["2"]}],size:{width:Vye.width,height:Vye.height},center:{x:Vye.centerX,y:Vye.centerY}}).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),CXo={paths:{path11:{type:"path",points:[{x:-0.54,y:0},{x:-0.3,y:0}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.29,y:0},{x:0.54,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.18,y:-0.36},bottom1:{type:"text",text:"{VAL}",x:-0.01,y:0.43},left1:{type:"text",text:"Hz",x:0,y:-0.04}},refblocks:{left1:{x:-0.54,y:0},right1:{x:0.54,y:0}},bounds:{minX:-0.53,maxX:0.53,minY:0,maxY:0,width:1.06,height:1,centerX:0,centerY:0},circles:{path1:{type:"circle",x:-0.01,y:-0.01,radius:0.29,color:"primary",fill:!1}}},{paths:bXo,texts:IXo,bounds:Yye,refblocks:ZBt,circles:vXo}=CXo,MVe=Gl({primitives:[...Object.values(bXo),...Object.values(vXo),{type:"text",text:"{REF}",x:0,y:-0.3594553499999995,anchor:"middle_top"},{type:"text",text:"{VAL}",x:0,y:0.35,anchor:"middle_bottom"},{...IXo.left1,x:0,y:0.01,anchor:"center",fontSize:0.2}],ports:[{...ZBt.left1,labels:["1"]},{...ZBt.right1,labels:["2"]}],size:{width:Yye.width,height:Yye.height},center:{x:Yye.centerX,y:Yye.centerY}}),{5:SXo,...PXo}=MVe.primitives;eTt=Ro({...MVe,primitives:Object.values(PXo).filter(EXo)}),MXo={...eTt,primitives:[...eTt.primitives,SXo]},wXo={paths:{path10:{type:"path",points:[{x:-0.53,y:0.04},{x:0.53,y:0.04}],color:"primary",fill:!1},path14:{type:"path",points:[{x:0,y:0.17},{x:0.27,y:0.17},{x:0.27,y:-0.1},{x:-0.26,y:-0.1},{x:-0.26,y:0.17},{x:0,y:0.17}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.01,y:0.24},bottom1:{type:"text",text:"{VAL}",x:-0.17,y:-0.24}},refblocks:{left1:{x:-0.53,y:0.04},right1:{x:0.53,y:0.04}},bounds:{minX:-0.56,maxX:0.56,minY:-0.24,maxY:0.24,width:1.13,height:0.47,centerX:0,centerY:0},circles:{}},{paths:BXo,texts:TXo,bounds:Gye,refblocks:tTt}=wXo,xDt=Gl({primitives:[...Object.values(BXo),{...TXo.top1,anchor:"middle_bottom"},{type:"text",text:"{VAL}",x:0,y:-0.2,anchor:"middle_top"}],ports:[{...tTt.left1,labels:["1"]},{...tTt.right1,labels:["2"]}],size:{width:Gye.width,height:Gye.height},center:{x:Gye.centerX,y:Gye.centerY}}),DXo=Ro(xDt),wK={paths:{path1:{type:"path",points:[{x:-0.29,y:0.01},{x:0.04,y:0}],color:"primary",fill:!0},path2:{type:"path",points:[{x:0.04,y:-0.22},{x:0.04,y:0.22}],color:"primary",fill:!0},path3:{type:"path",points:[{x:0.12,y:-0.17},{x:0.12,y:0.17}],color:"primary",fill:!0},path4:{type:"path",points:[{x:0.19,y:-0.06},{x:0.19,y:0.06}],color:"primary",fill:!0}},texts:{right1:{type:"text",text:"{REF}",x:0.31,y:-0.02}},refblocks:{left1:{x:-0.29,y:0.01}},bounds:{minX:-0.31,maxX:0.31,minY:-0.22,maxY:0.22,width:0.62,height:0.45,centerX:0,centerY:0},circles:{}},NXo=An(wK).rotateRightFacingSymbol("down").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_top").build(),RXo=An(wK).rotateRightFacingSymbol("right").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_left").build(),QXo=An(wK).rotateRightFacingSymbol("left").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_right").build(),kXo=An(wK).rotateRightFacingSymbol("right").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_left").build(),LXo=An(wK).rotateRightFacingSymbol("up").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_bottom").build(),HXo=An(wK).rotateRightFacingSymbol("up").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_bottom").build(),wVe={paths:{path11:{type:"path",points:[{x:-0.52,y:0.03},{x:-0.18,y:0.04}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.19,y:0.04},{x:0.52,y:0.04}],color:"primary",fill:!1},"path11-0-9":{type:"path",points:[{x:-0.31,y:0.2},{x:-0.31,y:-0.11},{x:-0.01,y:0.04},{x:-0.3,y:0.2}],color:"primary",fill:!0},"path11-0-9-5":{type:"path",points:[{x:0.33,y:0.2},{x:0.33,y:-0.1},{x:0.04,y:0.04},{x:0.33,y:0.2}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:0.04,y:0.32},bottom1:{type:"text",text:"{VAL}",x:0.04,y:-0.32}},refblocks:{left1:{x:-0.52,y:0.03},right1:{x:0.52,y:0.04}},bounds:{minX:-0.55,maxX:0.55,minY:-0.32,maxY:0.32,width:1.09,height:0.63,centerX:0,centerY:0},circles:{}},{paths:LNs,texts:HNs,bounds:FNs,refblocks:zNs,circles:ONs}=wVe,FXo=An(wVe).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),zXo=An(wVe).rotateRightFacingSymbol("down").changeTextAnchor("{VAL}","middle_right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").build(),OXo={paths:{path45:{type:"path",points:[{x:0.14,y:0},{x:-0.13,y:-0.14}],color:"primary",fill:!1},"path1-8":{type:"path",points:[{x:0.13,y:0},{x:0.3,y:0}],color:"primary",fill:!1},path46:{type:"path",points:[{x:-0.13,y:0.13},{x:0.14,y:0}],color:"primary",fill:!1},path47:{type:"path",points:[{x:-0.13,y:-0.14},{x:-0.13,y:0.13}],color:"primary",fill:!1},path48:{type:"path",points:[{x:0.14,y:0.13},{x:0.14,y:-0.14}],color:"primary",fill:!1},path49:{type:"path",points:[{x:-0.13,y:0},{x:-0.3,y:0}],color:"primary",fill:!1},path25:{type:"path",points:[{x:0.16,y:0.29},{x:0.25,y:0.3},{x:0.22,y:0.21}],color:"primary",fill:!0},path78:{type:"path",points:[{x:0.08,y:0.17},{x:0.09,y:0.17},{x:0.21,y:0.27},{x:0.21,y:0.27}],color:"primary",fill:!1},"path25-0":{type:"path",points:[{x:-0.02,y:0.31},{x:0.08,y:0.32},{x:0.04,y:0.23}],color:"primary",fill:!0},"path78-6":{type:"path",points:[{x:-0.1,y:0.19},{x:-0.09,y:0.2},{x:0.04,y:0.29},{x:0.04,y:0.29}],color:"primary",fill:!1},box:{type:"path",points:[{x:-0.3,y:-0.4},{x:0.3,y:-0.4},{x:0.3,y:0.4},{x:-0.3,y:0.4},{x:-0.3,y:-0.4},{x:-0.3,y:0.4}],color:"primary",fill:!1},"path48-1":{type:"path",points:[{x:-0.3,y:0.13},{x:-0.54,y:0.13}],color:"primary",fill:!1},"path48-2":{type:"path",points:[{x:-0.3,y:-0.13},{x:-0.54,y:-0.13}],color:"primary",fill:!1},"path48-3":{type:"path",points:[{x:0.3,y:-0.13},{x:0.54,y:-0.13}],color:"primary",fill:!1},"path48-4":{type:"path",points:[{x:0.3,y:0.13},{x:0.54,y:0.13}],color:"primary",fill:!1}},texts:{bottom1:{type:"text",text:"{VAL}",x:0,y:-0.43},right1:{type:"text",text:"{REF}",x:0,y:0.43}},refblocks:{left1:{x:-0.54,y:0.13},left2:{x:-0.54,y:-0.13},right1:{x:0.54,y:-0.13},right2:{x:0.54,y:0.13}},bounds:{minX:-0.56,maxX:0.56,minY:-0.32,maxY:0.32,width:1.13,height:0.65,centerX:0,centerY:0},circles:{}},a5e=An(OXo).labelPort("left1",["1","DIN"]).labelPort("left2",["2","POWER"]).labelPort("right1",["3","GND"]).labelPort("right2",["4","DOUT"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),VXo=Ro(a5e,"down"),YXo=Y9(a5e),BVe=Ro(a5e,"up"),TVe=BVe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),DVe=BVe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");TVe.anchor="middle_left";DVe.anchor="middle_left";TVe.y+=0.21;TVe.x=0.44;DVe.y-=0.21;DVe.x=0.44;GXo=BVe,UXo={paths:{path11:{type:"path",points:[{x:-0.4,y:0},{x:-0.01,y:0}],color:"primary",fill:!1},path40:{type:"path",points:[{x:0.07,y:0.19},{x:0.07,y:-0.18}],color:"primary",fill:!1},path42:{type:"path",points:[{x:0.01,y:-0.12},{x:0.01,y:0.14}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.28,y:-0.25},{x:0.28,y:-0.56}],color:"primary",fill:!1},"path12-1":{type:"path",points:[{x:0.28,y:0.56},{x:0.28,y:0.27}],color:"primary",fill:!1},path15:{type:"path",points:[{x:0.17,y:-0.22},{x:0.28,y:-0.23},{x:0.23,y:-0.14}],color:"primary",fill:!0},path17:{type:"path",points:[{x:0.08,y:-0.09},{x:0.23,y:-0.2}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.07,y:0.11},{x:0.28,y:0.26}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.01,y:0.36},bottom1:{type:"text",text:"{VAL}",x:0.02,y:-0.42}},refblocks:{top1:{x:0.28,y:0.56},bottom1:{x:0.28,y:-0.56},left1:{x:-0.4,y:0}},bounds:{minX:-0.43,maxX:0.43,minY:-0.58,maxY:0.58,width:0.85,height:1.17,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0.14,y:0.01,radius:0.29,color:"primary",fill:!1}}},CDt=An(UXo).changeTextAnchor("{VAL}","middle_right").labelPort("left1",["3"]).labelPort("top1",["2"]).labelPort("bottom1",["1"]).changeTextAnchor("{REF}","middle_right").build(),NVe=Ro(CDt),RVe=NVe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),bDt=NVe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");RVe.anchor="middle_left";bDt.anchor="middle_right";RVe.x=0.45;RVe.y+=0.065;bDt.y+=0.065;WXo=NVe,XXo={paths:{"path12-1-8-6-9":{type:"path",points:[{x:0.02,y:-0.02},{x:0.02,y:-0.1}],color:"primary",fill:!1},"path12-1-5-6":{type:"path",points:[{x:-0.47,y:-0.19},{x:-0.17,y:-0.19}],color:"primary",fill:!1},"path12-1-5-6-8":{type:"path",points:[{x:0.02,y:0.17},{x:0.02,y:0.11}],color:"primary",fill:!1},"path12-1-8-0":{type:"path",points:[{x:-0.15,y:-0.03},{x:0.2,y:-0.19}],color:"primary",fill:!1},"path12-1-0":{type:"path",points:[{x:0.2,y:-0.19},{x:0.47,y:-0.19}],color:"primary",fill:!1},"path12-1-8-6-9-4":{type:"path",points:[{x:0.02,y:0.12},{x:0.02,y:0.02}],color:"primary",fill:!1},"path12-1-8-6-9-4-3":{type:"path",points:[{x:0.08,y:0.11},{x:0.08,y:0.05}],color:"primary",fill:!1},"path12-1-8-6-9-4-3-1":{type:"path",points:[{x:-0.04,y:0.11},{x:-0.04,y:0.05}],color:"primary",fill:!1},"path12-1-8-6-9-4-4":{type:"path",points:[{x:0.08,y:0.11},{x:-0.04,y:0.11}],color:"primary",fill:!1},"path14-5":{type:"path",points:[{x:-0.01,y:0.28},{x:0.01,y:0.25},{x:0.04,y:0.23},{x:0.06,y:0.2}],color:"primary",fill:!0},"path14-5-3":{type:"path",points:[{x:-0.01,y:0.2},{x:0.01,y:0.23},{x:0.04,y:0.25},{x:0.06,y:0.28}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:0.01,y:0.38},bottom1:{type:"text",text:"{VAL}",x:0.06,y:-0.38}},refblocks:{left1:{x:-0.47,y:-0.19},right1:{x:0.47,y:-0.19}},bounds:{minX:-0.5,maxX:0.5,minY:-0.38,maxY:0.38,width:1,height:0.76,centerX:0,centerY:0},circles:{path9:{type:"circle",x:0.02,y:0.24,radius:0.06,color:"primary",fill:!1}}},IDt=An(XXo).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),vDt=Ro(IDt),SDt=vDt.primitives.filter((e)=>e.type==="text"),QVe=SDt.find((e)=>e.text==="{VAL}");QVe.x=-0.35;QVe.y=0;QVe.anchor="middle_right";kVe=SDt.find((e)=>e.text==="{REF}");kVe.y=0;kVe.x=0.35;kVe.anchor="middle_left";jXo=vDt,c5e={paths:{path8698:{type:"path",points:[{x:-0.19796749999999919,y:-0.023826854587889912},{x:-0.2004570399999992,y:-0.018993393814014044},{x:-0.2029465799999992,y:-0.014174384106555204},{x:-0.20543611999999922,y:-0.009384187436300498},{x:-0.20792565999999923,y:-0.004636988132081332},{x:-0.21041519999999925,y:0.00005329457033053167},{x:-0.21290473999999926,y:0.004673092344940184},{x:-0.21539427999999927,y:0.009209271428771242},{x:-0.21788381999999928,y:0.013649213595881985},{x:-0.2203733599999993,y:0.01798089395292432},{x:-0.2228628999999993,y:0.022192955076609913},{x:-0.22535243999999932,y:0.02627477703600152},{x:-0.22784197999999933,y:0.030216542867918667},{x:-0.23033151999999935,y:0.03400929910178016},{x:-0.23282105999999936,y:0.03764501096072756},{x:-0.23531059999999937,y:0.04111661189869628},{x:-0.23780013999999938,y:0.04441804716802203},{x:-0.2402896799999994,y:0.04754431114897349},{x:-0.2427792199999994,y:0.05049147821106258},{x:-0.24526875999999942,y:0.053256726915861724},{x:-0.24775829999999943,y:0.05583835741211009},{x:-0.25024783999999944,y:0.05823580191586174},{x:-0.25273737999999946,y:0.060449628211062575},{x:-0.25522691999999947,y:0.0624815361489735},{x:-0.2577164599999995,y:0.06433434716802203},{x:-0.2602059999999995,y:0.06601198689869628},{x:-0.2626955399999995,y:0.06751946096072757},{x:-0.2651850799999995,y:0.06886282410178016},{x:-0.26767461999999953,y:0.07004914286791866},{x:-0.27016415999999954,y:0.0710864520360015},{x:-0.27265369999999955,y:0.07198370507660991},{x:-0.27514323999999957,y:0.07275071895292433},{x:-0.2776327799999996,y:0.07339811359588198},{x:-0.2801223199999996,y:0.07393724642877124},{x:-0.2826118599999996,y:0.07438014234494018},{x:-0.2851013999999996,y:0.07473941957033053},{x:-0.28759093999999963,y:0.07502821186791866},{x:-0.29008047999999964,y:0.07526008756369952},{x:-0.29257001999999965,y:0.07544896589344477},{x:-0.29505955999999967,y:0.07560903118598594},{x:-0.2975490999999997,y:0.07575464541211008},{x:-0.30003863749999965,y:0.07560903118598594},{x:-0.3025281749999997,y:0.07544896589344477},{x:-0.30501771249999965,y:0.07526008756369951},{x:-0.3075072499999996,y:0.07502821186791866},{x:-0.30999678749999965,y:0.07473941957033052},{x:-0.3124863249999996,y:0.07438014234494018},{x:-0.3149758624999996,y:0.07393724642877124},{x:-0.31746539999999956,y:0.07339811359588198},{x:-0.3199549374999996,y:0.07275071895292431},{x:-0.32244447499999956,y:0.07198370507660991},{x:-0.32493401249999954,y:0.0710864520360015},{x:-0.32742354999999956,y:0.07004914286791866},{x:-0.32991308749999954,y:0.06886282410178016},{x:-0.3324026249999995,y:0.06751946096072756},{x:-0.33489216249999954,y:0.06601198689869628},{x:-0.3373816999999995,y:0.06433434716802203},{x:-0.3398712374999995,y:0.06248153614897349},{x:-0.3423607749999995,y:0.06044962821106258},{x:-0.3448503124999994,y:0.05823580191586174},{x:-0.34733984999999945,y:0.05583835741211009},{x:-0.3498293874999995,y:0.053256726915861724},{x:-0.35231892499999945,y:0.050491478211062576},{x:-0.3548084624999994,y:0.0475443111489735},{x:-0.3572979999999994,y:0.04441804716802203},{x:-0.35978753749999937,y:0.04111661189869628},{x:-0.3622770749999994,y:0.03764501096072756},{x:-0.36476661249999937,y:0.03400929910178016},{x:-0.36725614999999934,y:0.030216542867918673},{x:-0.36974568749999936,y:0.02627477703600152},{x:-0.37223522499999934,y:0.022192955076609917},{x:-0.3747247624999993,y:0.017980893952924324},{x:-0.37721429999999934,y:0.013649213595881985},{x:-0.3797038374999993,y:0.00920927142877125},{x:-0.3821933749999993,y:0.004673092344940191},{x:-0.3846829124999993,y:0.00005329457033053514},{x:-0.3871724499999993,y:-0.004636988132081328},{x:-0.38966198749999925,y:-0.009384187436300498},{x:-0.3921515249999992,y:-0.014174384106555197},{x:-0.39464106249999925,y:-0.01899339381401404},{x:-0.3971305999999992,y:-0.023826854587889912}],color:"primary",fill:!1},path8700:{type:"path",points:[{x:0.0011955000000007932,y:-0.02382615458789039},{x:-0.00129403749999919,y:-0.01899269131401453},{x:-0.0037835749999991734,y:-0.014173679106555696},{x:-0.006273112499999156,y:-0.009383479936300985},{x:-0.00876264999999914,y:-0.004636278132081827},{x:-0.011252187499999122,y:0.00005400707033003174},{x:-0.013741724999999105,y:0.004673807344939681},{x:-0.016231262499999087,y:0.009209988928770731},{x:-0.018720799999999073,y:0.013649933595881476},{x:-0.021210337499999055,y:0.017981616452923805},{x:-0.023699874999999038,y:0.022193680076609393},{x:-0.026189412499999024,y:0.026275504536001},{x:-0.028678949999999002,y:0.030217272867918137},{x:-0.03116848749999899,y:0.034010031601779636},{x:-0.03365802499999897,y:0.03764574596072702},{x:-0.03614756249999895,y:0.04111734939869574},{x:-0.03863709999999894,y:0.04441878716802149},{x:-0.04112663749999892,y:0.04754505364897295},{x:-0.043616174999998904,y:0.05049222321106203},{x:-0.04610571249999888,y:0.05325747441586117},{x:-0.04859524999999887,y:0.055839107412109526},{x:-0.051084787499998854,y:0.05823655441586117},{x:-0.05357432499999884,y:0.06045038321106201},{x:-0.05606386249999881,y:0.06248229364897292},{x:-0.0585533999999988,y:0.06433510716802145},{x:-0.061042937499998784,y:0.0660127493986957},{x:-0.06353247499999877,y:0.06752022596072697},{x:-0.06602201249999876,y:0.06886359160177957},{x:-0.06851154999999873,y:0.07004991286791806},{x:-0.07100108749999871,y:0.07108722453600091},{x:-0.0734906249999987,y:0.0719844800766093},{x:-0.07598016249999869,y:0.07275149645292371},{x:-0.07846969999999867,y:0.07339889359588138},{x:-0.08095923749999864,y:0.07393802892877062},{x:-0.08344877499999863,y:0.07438092734493956},{x:-0.08593831249999861,y:0.07474020707032991},{x:-0.0884278499999986,y:0.07502900186791804},{x:-0.09091738749999859,y:0.07526088006369888},{x:-0.09340692499999856,y:0.07544976089344414},{x:-0.09589646249999854,y:0.0756098286859853},{x:-0.09838599999999853,y:0.07575544541210943},{x:-0.10087553999999854,y:0.0756098286859853},{x:-0.10336507999999855,y:0.07544976089344414},{x:-0.10585461999999857,y:0.07526088006369887},{x:-0.10834415999999858,y:0.07502900186791804},{x:-0.11083369999999859,y:0.0747402070703299},{x:-0.1133232399999986,y:0.07438092734493956},{x:-0.11581277999999862,y:0.07393802892877062},{x:-0.11830231999999863,y:0.07339889359588138},{x:-0.12079185999999864,y:0.07275149645292371},{x:-0.12328139999999865,y:0.0719844800766093},{x:-0.12577093999999867,y:0.07108722453600091},{x:-0.12826047999999868,y:0.07004991286791806},{x:-0.1307500199999987,y:0.06886359160177957},{x:-0.1332395599999987,y:0.06752022596072697},{x:-0.13572909999999871,y:0.0660127493986957},{x:-0.13821863999999873,y:0.06433510716802145},{x:-0.14070817999999874,y:0.06248229364897291},{x:-0.14319771999999875,y:0.06045038321106202},{x:-0.14568725999999876,y:0.05823655441586117},{x:-0.14817679999999878,y:0.055839107412109526},{x:-0.1506663399999988,y:0.05325747441586117},{x:-0.1531558799999988,y:0.05049222321106202},{x:-0.1556454199999988,y:0.047545053648972956},{x:-0.15813495999999883,y:0.04441878716802149},{x:-0.16062449999999884,y:0.04111734939869574},{x:-0.16311403999999885,y:0.03764574596072702},{x:-0.16560357999999886,y:0.034010031601779636},{x:-0.16809311999999887,y:0.03021727286791814},{x:-0.1705826599999989,y:0.026275504536001},{x:-0.1730721999999989,y:0.022193680076609396},{x:-0.1755617399999989,y:0.017981616452923805},{x:-0.17805127999999892,y:0.013649933595881474},{x:-0.18054081999999894,y:0.00920998892877074},{x:-0.18303035999999895,y:0.0046738073449396865},{x:-0.18551989999999896,y:0.00005400707033003521},{x:-0.18800943999999897,y:-0.004636278132081827},{x:-0.19049897999999899,y:-0.009383479936300985},{x:-0.192988519999999,y:-0.01417367910655569},{x:-0.19547805999999898,y:-0.018992691314014522},{x:-0.19796759999999902,y:-0.02382615458789039}],color:"primary",fill:!1},path8702:{type:"path",points:[{x:0.2003586000000006,y:-0.02382615458789039},{x:0.19786906000000057,y:-0.01899269131401453},{x:0.19537952000000058,y:-0.014173679106555696},{x:0.19288998000000057,y:-0.009383479936300985},{x:0.1904004400000006,y:-0.004636278132081827},{x:0.18791090000000055,y:0.00005400707033003174},{x:0.1854213600000005,y:0.004673807344939681},{x:0.18293182000000052,y:0.009209988928770731},{x:0.1804422800000005,y:0.013649933595881476},{x:0.17795274000000053,y:0.017981616452923805},{x:0.17546320000000049,y:0.022193680076609393},{x:0.17297366000000047,y:0.026275504536001},{x:0.17048412000000046,y:0.030217272867918137},{x:0.16799458000000045,y:0.034010031601779636},{x:0.16550504000000044,y:0.03764574596072702},{x:0.16301550000000042,y:0.04111734939869574},{x:0.1605259600000004,y:0.04441878716802149},{x:0.1580364200000004,y:0.04754505364897295},{x:0.1555468800000004,y:0.05049222321106203},{x:0.15305734000000037,y:0.05325747441586117},{x:0.15056780000000036,y:0.055839107412109526},{x:0.14807826000000035,y:0.05823655441586117},{x:0.14558872000000034,y:0.06045038321106201},{x:0.14309918000000033,y:0.06248229364897292},{x:0.1406096400000003,y:0.06433510716802145},{x:0.1381201000000003,y:0.0660127493986957},{x:0.1356305600000003,y:0.06752022596072697},{x:0.13314102000000028,y:0.06886359160177957},{x:0.13065148000000026,y:0.07004991286791806},{x:0.12816194000000025,y:0.07108722453600091},{x:0.12567240000000024,y:0.0719844800766093},{x:0.12318286000000023,y:0.07275149645292371},{x:0.12069332000000021,y:0.07339889359588138},{x:0.1182037800000002,y:0.07393802892877062},{x:0.11571424000000019,y:0.07438092734493956},{x:0.11322470000000018,y:0.07474020707032991},{x:0.11073516000000017,y:0.07502900186791804},{x:0.10824562000000015,y:0.07526088006369888},{x:0.10575608000000014,y:0.07544976089344414},{x:0.10326654000000013,y:0.0756098286859853},{x:0.10077700000000012,y:0.07575544541210943},{x:0.09828746250000013,y:0.0756098286859853},{x:0.09579792500000014,y:0.07544976089344414},{x:0.09330838750000017,y:0.07526088006369887},{x:0.09081885000000019,y:0.07502900186791804},{x:0.0883293125000002,y:0.0747402070703299},{x:0.08583977500000022,y:0.07438092734493956},{x:0.08335023750000023,y:0.07393802892877062},{x:0.08086070000000026,y:0.07339889359588138},{x:0.07837116250000027,y:0.07275149645292371},{x:0.07588162500000029,y:0.0719844800766093},{x:0.0733920875000003,y:0.07108722453600091},{x:0.07090255000000031,y:0.07004991286791806},{x:0.06841301250000034,y:0.06886359160177957},{x:0.06592347500000036,y:0.06752022596072697},{x:0.06343393750000037,y:0.0660127493986957},{x:0.060944400000000384,y:0.06433510716802145},{x:0.0584548625000004,y:0.06248229364897291},{x:0.05596532500000043,y:0.06045038321106202},{x:0.05347578750000044,y:0.05823655441586117},{x:0.050986250000000455,y:0.055839107412109526},{x:0.04849671250000047,y:0.05325747441586117},{x:0.04600717500000048,y:0.05049222321106202},{x:0.04351763750000051,y:0.047545053648972956},{x:0.041028100000000525,y:0.04441878716802149},{x:0.03853856250000054,y:0.04111734939869574},{x:0.036049025000000554,y:0.03764574596072702},{x:0.03355948750000057,y:0.034010031601779636},{x:0.031069950000000596,y:0.03021727286791814},{x:0.02858041250000061,y:0.026275504536001},{x:0.026090875000000624,y:0.022193680076609396},{x:0.023601337500000638,y:0.017981616452923805},{x:0.021111800000000652,y:0.013649933595881474},{x:0.01862226250000068,y:0.00920998892877074},{x:0.016132725000000694,y:0.0046738073449396865},{x:0.013643187500000709,y:0.00005400707033003521},{x:0.011153650000000723,y:-0.004636278132081827},{x:0.008664112500000737,y:-0.009383479936300985},{x:0.006174575000000764,y:-0.01417367910655569},{x:0.0036850375000007786,y:-0.018992691314014522},{x:0.0011955000000007932,y:-0.02382615458789039}],color:"primary",fill:!1},path8704:{type:"path",points:[{x:0.3995216000000006,y:-0.02382615458789039},{x:0.39703206250000056,y:-0.01899269131401453},{x:0.3945425250000006,y:-0.014173679106555696},{x:0.3920529875000006,y:-0.009383479936300985},{x:0.38956345000000064,y:-0.004636278132081827},{x:0.38707391250000067,y:0.00005400707033003174},{x:0.3845843750000007,y:0.004673807344939681},{x:0.38209483750000073,y:0.009209988928770731},{x:0.37960530000000076,y:0.013649933595881476},{x:0.3771157625000008,y:0.017981616452923805},{x:0.37462622500000076,y:0.022193680076609393},{x:0.37213668750000073,y:0.026275504536001},{x:0.36964715000000076,y:0.030217272867918137},{x:0.3671576125000008,y:0.034010031601779636},{x:0.3646680750000008,y:0.03764574596072702},{x:0.36217853750000084,y:0.04111734939869574},{x:0.3596890000000008,y:0.04441878716802149},{x:0.3571994625000009,y:0.04754505364897295},{x:0.35470992500000087,y:0.05049222321106203},{x:0.35222038750000095,y:0.05325747441586117},{x:0.3497308500000009,y:0.055839107412109526},{x:0.3472413125000009,y:0.05823655441586117},{x:0.344751775000001,y:0.06045038321106201},{x:0.34226223750000095,y:0.06248229364897292},{x:0.33977270000000104,y:0.06433510716802145},{x:0.337283162500001,y:0.0660127493986957},{x:0.334793625000001,y:0.06752022596072697},{x:0.33230408750000107,y:0.06886359160177957},{x:0.3298145500000011,y:0.07004991286791806},{x:0.32732501250000107,y:0.07108722453600091},{x:0.3248354750000011,y:0.0719844800766093},{x:0.3223459375000011,y:0.07275149645292371},{x:0.3198564000000011,y:0.07339889359588138},{x:0.3173668625000012,y:0.07393802892877062},{x:0.31487732500000115,y:0.07438092734493956},{x:0.3123877875000012,y:0.07474020707032991},{x:0.3098982500000012,y:0.07502900186791804},{x:0.30740871250000124,y:0.07526088006369888},{x:0.30491917500000126,y:0.07544976089344414},{x:0.30242963750000124,y:0.0756098286859853},{x:0.29994010000000126,y:0.07575544541210943},{x:0.29745056000000125,y:0.0756098286859853},{x:0.29496102000000124,y:0.07544976089344414},{x:0.2924714800000012,y:0.07526088006369887},{x:0.2899819400000012,y:0.07502900186791804},{x:0.2874924000000012,y:0.0747402070703299},{x:0.2850028600000012,y:0.07438092734493956},{x:0.2825133200000012,y:0.07393802892877062},{x:0.28002378000000117,y:0.07339889359588138},{x:0.27753424000000115,y:0.07275149645292371},{x:0.27504470000000114,y:0.0719844800766093},{x:0.27255516000000113,y:0.07108722453600091},{x:0.2700656200000011,y:0.07004991286791806},{x:0.2675760800000011,y:0.06886359160177957},{x:0.2650865400000011,y:0.06752022596072697},{x:0.2625970000000011,y:0.0660127493986957},{x:0.26010746000000107,y:0.06433510716802145},{x:0.25761792000000105,y:0.06248229364897291},{x:0.25512838000000104,y:0.06045038321106202},{x:0.25263884000000103,y:0.05823655441586117},{x:0.250149300000001,y:0.055839107412109526},{x:0.247659760000001,y:0.05325747441586117},{x:0.245170220000001,y:0.05049222321106202},{x:0.24268068000000098,y:0.047545053648972956},{x:0.24019114000000097,y:0.04441878716802149},{x:0.23770160000000096,y:0.04111734939869574},{x:0.23521206000000094,y:0.03764574596072702},{x:0.23272252000000093,y:0.034010031601779636},{x:0.23023298000000092,y:0.03021727286791814},{x:0.2277434400000009,y:0.026275504536001},{x:0.2252539000000009,y:0.022193680076609396},{x:0.22276436000000088,y:0.017981616452923805},{x:0.22027482000000087,y:0.013649933595881474},{x:0.21778528000000086,y:0.00920998892877074},{x:0.21529574000000085,y:0.0046738073449396865},{x:0.21280620000000083,y:0.00005400707033003521},{x:0.21031666000000082,y:-0.004636278132081827},{x:0.2078271200000008,y:-0.009383479936300985},{x:0.2053375800000008,y:-0.01417367910655569},{x:0.20284804000000078,y:-0.018992691314014522},{x:0.20035850000000077,y:-0.02382615458789039}],color:"primary",fill:!1},path8706:{type:"path",points:[{x:-0.40026109999999937,y:-0.022544054587890106},{x:-0.5272914999999991,y:-0.022544054587890106}],color:"primary",fill:!1},"path8706-5":{type:"path",points:[{x:0.5282280000000006,y:-0.027111054587890093},{x:0.4011975999999997,y:-0.027111054587890093}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.0020145999999989783,y:0.22997364541210996},bottom1:{type:"text",text:"{VAL}",x:-0.002185205294839676,y:-0.22997364541210996}},refblocks:{left1:{x:-0.5279125,y:-0.021272154587890446},right1:{x:0.5279125,y:-0.026521254587889898}},bounds:{minX:-0.556070941,maxX:0.556070941,minY:-0.22997364541210996,maxY:0.22997364541210996,width:1.112141882,height:0.4599472908242199,centerX:0,centerY:0},circles:{}},KXo=An(c5e).rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_right",{x:-0.5,y:0}).changeTextAnchor("{VAL}","middle_left",{x:0.5,y:0}).build(),$Xo=An(c5e).rotateRightFacingSymbol("left").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom",{x:0,y:0.5}).changeTextAnchor("{VAL}","middle_top",{x:0,y:-0.5}).build(),qXo=An(c5e).rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),JXo=An(c5e).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_right").changeTextAnchor("{VAL}","middle_left").build(),PDt={paths:{path11:{type:"path",points:[{x:-0.54,y:-0.06},{x:-0.15,y:-0.06}],color:"primary",fill:!1},path40:{type:"path",points:[{x:0.13,y:-0.05},{x:-0.13,y:-0.18}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-0.13,y:0.08},{x:0.13,y:-0.05}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-0.13,y:-0.18},{x:-0.13,y:0.08}],color:"primary",fill:!1},path43:{type:"path",points:[{x:0.13,y:0.08},{x:0.13,y:-0.18}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.14,y:-0.05},{x:0.54,y:-0.06}],color:"primary",fill:!1},"path25-0-9-8":{type:"path",points:[{x:-0.03,y:0.39},{x:-0.05,y:0.47},{x:-0.08,y:0.39}],color:"primary",fill:!0},"path78-6-5-5":{type:"path",points:[{x:-0.05,y:0.27},{x:-0.05,y:0.29},{x:-0.05,y:0.41},{x:-0.05,y:0.42}],color:"primary",fill:!1},"path25-0-9-8-2":{type:"path",points:[{x:0.07,y:0.39},{x:0.04,y:0.47},{x:0.02,y:0.39}],color:"primary",fill:!0},"path78-6-5-5-7":{type:"path",points:[{x:0.04,y:0.27},{x:0.04,y:0.29},{x:0.04,y:0.41},{x:0.04,y:0.42}],color:"primary",fill:!1},"path43-1":{type:"path",points:[{x:0.03,y:0.06},{x:0.03,y:-0.16}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0.38,y:0.38},bottom1:{type:"text",text:"{VAL}",x:0.38,y:-0.47}},refblocks:{left1:{x:-0.54,y:-0.06},right1:{x:0.54,y:-0.06}},bounds:{minX:-0.57,maxX:0.57,minY:-0.47,maxY:0.47,width:1.14,height:0.93,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0,y:-0.05,radius:0.29,color:"primary",fill:!1}}};PDt.bounds.width+=0.2;l5e=An(PDt).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1","anode","pos"]).labelPort("right1",["2","cathode","neg"]).changeTextAnchor("{REF}","middle_bottom").build(),LVe=Ro(l5e,"down"),HVe=LVe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),FVe=LVe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");HVe.anchor="middle_left";FVe.anchor="middle_left";HVe.y+=0.9;HVe.x=0.3;FVe.y-=0.1;FVe.x=0.3;ZXo=LVe,zVe=Ro(l5e,"left"),OVe=zVe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),VVe=zVe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");OVe.anchor="middle_left";VVe.anchor="middle_left";OVe.y+=0.71;OVe.x=0.44;VVe.y-=0.71;VVe.x=0.44;ejo=zVe,YVe=Ro(l5e,"up"),GVe=YVe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),UVe=YVe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");GVe.anchor="middle_left";UVe.anchor="middle_left";GVe.y+=0.1;GVe.x=0.3;UVe.y-=0.71;UVe.x=0.3;tjo=YVe,njo={paths:{path45:{type:"path",points:[{x:0.14,y:0},{x:-0.13,y:-0.14}],color:"primary",fill:!1},"path1-8":{type:"path",points:[{x:0.13,y:0},{x:0.54,y:0}],color:"primary",fill:!1},path46:{type:"path",points:[{x:-0.13,y:0.13},{x:0.14,y:0}],color:"primary",fill:!1},path47:{type:"path",points:[{x:-0.13,y:-0.14},{x:-0.13,y:0.13}],color:"primary",fill:!1},path48:{type:"path",points:[{x:0.14,y:0.13},{x:0.14,y:-0.14}],color:"primary",fill:!1},path49:{type:"path",points:[{x:-0.13,y:0},{x:-0.54,y:0}],color:"primary",fill:!1},path25:{type:"path",points:[{x:0.16,y:0.29},{x:0.25,y:0.3},{x:0.22,y:0.21}],color:"primary",fill:!0},path78:{type:"path",points:[{x:0.08,y:0.17},{x:0.09,y:0.17},{x:0.21,y:0.27},{x:0.21,y:0.27}],color:"primary",fill:!1},"path25-0":{type:"path",points:[{x:-0.02,y:0.31},{x:0.08,y:0.32},{x:0.04,y:0.23}],color:"primary",fill:!0},"path78-6":{type:"path",points:[{x:-0.1,y:0.19},{x:-0.09,y:0.2},{x:0.04,y:0.29},{x:0.04,y:0.29}],color:"primary",fill:!1}},texts:{bottom1:{type:"text",text:"{VAL}",x:0,y:-0.21},right1:{type:"text",text:"{REF}",x:0,y:0.41}},refblocks:{left1:{x:-0.54,y:0},right1:{x:0.54,y:0}},bounds:{minX:-0.56,maxX:0.56,minY:-0.32,maxY:0.32,width:1.13,height:0.65,centerX:0,centerY:0},circles:{}},{paths:ojo,texts:nTt,bounds:Uye,refblocks:oTt,circles:rjo}=njo,WVe=Gl({primitives:[...Object.values(ojo),...Object.values(rjo),{...nTt.bottom1,anchor:"middle_top"},{...nTt.right1,anchor:"middle_bottom"}],ports:[{...oTt.left1,labels:["1","anode","pos"]},{...oTt.right1,labels:["2","cathode","neg"]}],size:{width:Uye.width,height:Uye.height},center:{x:Uye.centerX,y:Uye.centerY}}),XVe=Ro(WVe,"up"),jVe=XVe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),KVe=XVe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");jVe.anchor="middle_left";KVe.anchor="middle_left";jVe.y+=0.21;jVe.x=0.21;KVe.y-=0.21;KVe.x=0.21;EDt=XVe,$Ve=CK(EDt),qVe=$Ve.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),JVe=$Ve.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");qVe.anchor="middle_left";JVe.anchor="middle_left";qVe.y+=0.4;qVe.x=0.2;JVe.y-=0.41;JVe.x=0.2;ijo=$Ve,sjo=Y9(WVe),h5e={paths:{"anode-lead":{type:"path",points:[{x:-0.25,y:0},{x:-0.11999999999999988,y:0}],color:"primary",fill:!1},body:{type:"path",points:[{x:-0.11999999999999988,y:0.11999999999999988},{x:0.1200000000000001,y:0},{x:-0.11999999999999988,y:-0.1200000000000001},{x:-0.11999999999999988,y:0.11999999999999988}],color:"primary",fill:!1},"cathode-bar":{type:"path",points:[{x:0.1200000000000001,y:0.11999999999999988},{x:0.1200000000000001,y:-0.1200000000000001}],color:"primary",fill:!1},"cathode-lead":{type:"path",points:[{x:0.1200000000000001,y:0},{x:0.25,y:0}],color:"primary",fill:!1},"emission-0-shaft":{type:"path",points:[{x:-0.11999999999999988,y:0.15999999999999992},{x:-0.030000000000000027,y:0.29000000000000004}],color:"primary",fill:!1},"emission-0-head":{type:"path",points:[{x:-0.08499999999999996,y:0.2699999999999998},{x:-0.030000000000000027,y:0.29000000000000004},{x:-0.030000000000000027,y:0.22999999999999998}],color:"primary",fill:!1},"emission-1-shaft":{type:"path",points:[{x:0,y:0.15999999999999992},{x:0.09000000000000008,y:0.29000000000000004}],color:"primary",fill:!1},"emission-1-head":{type:"path",points:[{x:0.03500000000000014,y:0.2699999999999998},{x:0.09000000000000008,y:0.29000000000000004},{x:0.09000000000000008,y:0.22999999999999998}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.3999999999999999},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.40000000000000013}},refblocks:{left1:{x:-0.25,y:0},right1:{x:0.25,y:0}},bounds:{minX:-0.25,maxX:0.25,minY:-0.40000000000000013,maxY:0.3999999999999999,width:0.5,height:0.8,centerX:0,centerY:-0.00000000000000011102230246251565},circles:{}},ajo=Fi(h5e,{kind:"led",orientation:"down",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),cjo=Fi(h5e,{kind:"led",orientation:"left",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),ljo=Fi(h5e,{kind:"led",orientation:"right",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),hjo=Fi(h5e,{kind:"led",orientation:"up",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),d5e={paths:{"anode-lead":{type:"path",points:[{x:-0.17499999999999982,y:0},{x:-0.09999999999999987,y:0}],color:"primary",fill:!1},body:{type:"path",points:[{x:-0.09999999999999987,y:0.09999999999999987},{x:0.10000000000000009,y:0},{x:-0.09999999999999987,y:-0.10000000000000009},{x:-0.09999999999999987,y:0.09999999999999987}],color:"primary",fill:!1},"cathode-bar":{type:"path",points:[{x:0.10000000000000009,y:0.09999999999999987},{x:0.10000000000000009,y:-0.10000000000000009}],color:"primary",fill:!1},"cathode-lead":{type:"path",points:[{x:0.10000000000000009,y:0},{x:0.17500000000000004,y:0}],color:"primary",fill:!1},"emission-0-shaft":{type:"path",points:[{x:-0.11999999999999988,y:0.15999999999999992},{x:-0.030000000000000027,y:0.29000000000000004}],color:"primary",fill:!1},"emission-0-head":{type:"path",points:[{x:-0.08499999999999996,y:0.2699999999999998},{x:-0.030000000000000027,y:0.29000000000000004},{x:-0.030000000000000027,y:0.22999999999999998}],color:"primary",fill:!1},"emission-1-shaft":{type:"path",points:[{x:0,y:0.15999999999999992},{x:0.09000000000000008,y:0.29000000000000004}],color:"primary",fill:!1},"emission-1-head":{type:"path",points:[{x:0.03500000000000014,y:0.2699999999999998},{x:0.09000000000000008,y:0.29000000000000004},{x:0.09000000000000008,y:0.22999999999999998}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.3999999999999999},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.40000000000000013}},refblocks:{left1:{x:-0.17499999999999982,y:0},right1:{x:0.17500000000000004,y:0}},bounds:{minX:-0.17499999999999982,maxX:0.17500000000000004,minY:-0.40000000000000013,maxY:0.3999999999999999,width:0.34999999999999987,height:0.8,centerX:0.00000000000000011102230246251565,centerY:-0.00000000000000011102230246251565},circles:{}},djo=Fi(d5e,{kind:"led",orientation:"down",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),ujo=Fi(d5e,{kind:"led",orientation:"left",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),pjo=Fi(d5e,{kind:"led",orientation:"right",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),mjo=Fi(d5e,{kind:"led",orientation:"up",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),_jo={paths:{path11:{type:"path",points:[{x:-0.52,y:-0.01},{x:-0.18,y:-0.01}],color:"primary",fill:!1},"path11-2":{type:"path",points:[{x:-0.17,y:-0.11},{x:-0.17,y:0.08}],color:"primary",fill:!1},"path11-5":{type:"path",points:[{x:-0.17,y:-0.12},{x:0.16,y:-0.12}],color:"primary",fill:!1},"path11-5-5":{type:"path",points:[{x:-0.17,y:0.08},{x:0.16,y:0.08}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.17,y:-0.01},{x:0.52,y:-0.01}],color:"primary",fill:!1},"path11-2-1":{type:"path",points:[{x:0.16,y:-0.12},{x:0.16,y:0.08}],color:"primary",fill:!1},"path25-0-9":{type:"path",points:[{x:-0.4,y:-0.21},{x:-0.33,y:-0.18},{x:-0.34,y:-0.27}],color:"primary",fill:!0},"path78-6-5":{type:"path",points:[{x:-0.45,y:-0.34},{x:-0.44,y:-0.32},{x:-0.35,y:-0.22},{x:-0.35,y:-0.22}],color:"primary",fill:!1},"path25-0-9-0":{type:"path",points:[{x:-0.3,y:-0.34},{x:-0.22,y:-0.31},{x:-0.24,y:-0.4}],color:"primary",fill:!0},"path78-6-5-9":{type:"path",points:[{x:-0.35,y:-0.46},{x:-0.34,y:-0.45},{x:-0.25,y:-0.35},{x:-0.25,y:-0.35}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.17,y:-0.41},bottom1:{type:"text",text:"{VAL}",x:-0.01,y:0.46}},refblocks:{left1:{x:-0.52,y:-0.01},right1:{x:0.52,y:-0.01}},bounds:{minX:-0.55,maxX:0.55,minY:-0.51,maxY:0.46,width:1.1,height:0.62,centerX:0,centerY:-0.02},circles:{path1:{type:"circle",x:0,y:-0.02,radius:0.28,color:"primary",fill:!1}}},{paths:gjo,texts:rTt,bounds:Wye,refblocks:iTt,circles:Ajo}=_jo,MDt=Gl({primitives:[...Object.values(gjo),...Object.values(Ajo),{...rTt.top1,anchor:"middle_left",x:0},{...rTt.bottom1,anchor:"middle_left",x:0}],ports:[{...iTt.left1,labels:["1"]},{...iTt.right1,labels:["2"]}],size:{width:Wye.width,height:Wye.height},center:{x:Wye.centerX,y:Wye.centerY}}),wDt=Ro(MDt),BDt=wDt.primitives.filter((e)=>e.type==="text"),ZVe=BDt.find((e)=>e.text==="{VAL}");ZVe.x=-0.35;ZVe.y=0;ZVe.anchor="middle_right";eYe=BDt.find((e)=>e.text==="{REF}");eYe.y=0;eYe.x=0.35;eYe.anchor="middle_left";fjo=wDt,yjo={paths:{path208:{type:"path",points:[{x:0.38,y:0.13},{x:0.52,y:-0.13}],color:"primary",fill:!1},path209:{type:"path",points:[{x:0.25,y:-0.13},{x:0.38,y:0.13}],color:"primary",fill:!1},path210:{type:"path",points:[{x:0.52,y:-0.13},{x:0.25,y:-0.13}],color:"primary",fill:!1},path211:{type:"path",points:[{x:0.25,y:0.13},{x:0.52,y:0.13}],color:"primary",fill:!1},path212:{type:"path",points:[{x:0.12,y:-0.4},{x:0.38,y:-0.4}],color:"primary",fill:!1},path213:{type:"path",points:[{x:0.38,y:0.4},{x:0.12,y:0.4}],color:"primary",fill:!1},path214:{type:"path",points:[{x:0.12,y:0.54},{x:0.12,y:0.18}],color:"primary",fill:!1},path215:{type:"path",points:[{x:0.12,y:-0.54},{x:0.12,y:0}],color:"primary",fill:!1},path216:{type:"path",points:[{x:0.38,y:-0.4},{x:0.38,y:0.4}],color:"primary",fill:!1},path217:{type:"path",points:[{x:-0.14,y:0.26},{x:-0.14,y:-0.27}],color:"primary",fill:!1},path218:{type:"path",points:[{x:-0.22,y:-0.27},{x:-0.22,y:0.26}],color:"primary",fill:!1},path219:{type:"path",points:[{x:-0.54,y:-0.27},{x:-0.22,y:-0.27}],color:"primary",fill:!1},path220:{type:"path",points:[{x:-0.14,y:-0.19},{x:0.12,y:-0.19}],color:"primary",fill:!1},path221:{type:"path",points:[{x:-0.14,y:0.18},{x:0.12,y:0.18}],color:"primary",fill:!1},path222:{type:"path",points:[{x:-0.07,y:0},{x:0.12,y:0}],color:"primary",fill:!1}},texts:{right1:{type:"text",text:"{VAL}",x:0.57,y:0.02},right2:{type:"text",text:"{REF}",x:0.57,y:0.21}},refblocks:{top1:{x:0.12,y:0.54},bottom1:{x:0.12,y:-0.54},left1:{x:-0.54,y:-0.27}},bounds:{minX:-0.57,maxX:0.57,minY:-0.57,maxY:0.57,width:1.14,height:1.14,centerX:0,centerY:0},circles:{}};({paths:xjo,texts:sTt,bounds:aTt,refblocks:AK}=yjo),cTt={x:aTt.centerX+0.2,y:aTt.centerY},TDt=Gl({primitives:[...Object.values(xjo),{...sTt.right1,anchor:"middle_left"},{...sTt.right2,anchor:"middle_left"}],ports:[{...AK.top1,labels:["1"]},{...AK.bottom1,labels:["2"]},{...AK.left1,labels:["3"]}],size:nae(cTt,[AK.top1,AK.bottom1,AK.left1]),center:cTt}),tYe=Ro(TDt),DDt=tYe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),nYe=tYe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");DDt.anchor="middle_top";nYe.anchor="middle_top";DDt.x=nYe.x;nYe.y+=0.15;Cjo=tYe,bjo={paths:{"path12-1-8-6-9":{type:"path",points:[{x:0.01,y:0.07},{x:0.01,y:-0.01}],color:"primary",fill:!1},"path12-1-5-6":{type:"path",points:[{x:-0.47,y:-0.09},{x:-0.17,y:-0.09}],color:"primary",fill:!1},"path12-1-8-0":{type:"path",points:[{x:-0.16,y:-0.01},{x:0.17,y:-0.01}],color:"primary",fill:!1},"path12-1-0":{type:"path",points:[{x:0.2,y:-0.09},{x:0.47,y:-0.09}],color:"primary",fill:!1},path2:{type:"path",points:[{x:-0.1,y:0.06},{x:-0.1,y:0.06},{x:-0.1,y:0.07},{x:-0.1,y:0.07},{x:-0.1,y:0.07},{x:-0.1,y:0.08},{x:-0.1,y:0.08},{x:-0.1,y:0.08},{x:-0.1,y:0.09},{x:-0.09,y:0.09},{x:-0.09,y:0.09},{x:-0.09,y:0.1},{x:-0.09,y:0.1},{x:-0.09,y:0.1},{x:-0.09,y:0.1},{x:-0.09,y:0.11},{x:-0.09,y:0.11},{x:-0.08,y:0.11},{x:-0.08,y:0.12},{x:-0.08,y:0.12},{x:-0.08,y:0.12},{x:-0.08,y:0.12},{x:-0.07,y:0.13},{x:-0.07,y:0.13},{x:-0.07,y:0.13},{x:-0.07,y:0.13},{x:-0.06,y:0.14},{x:-0.06,y:0.14},{x:-0.06,y:0.14},{x:-0.06,y:0.14},{x:-0.05,y:0.14},{x:-0.05,y:0.15},{x:-0.05,y:0.15},{x:-0.04,y:0.15},{x:-0.04,y:0.15},{x:-0.04,y:0.15},{x:-0.04,y:0.15},{x:-0.03,y:0.16},{x:-0.03,y:0.16},{x:-0.03,y:0.16},{x:-0.02,y:0.16},{x:-0.02,y:0.16},{x:-0.02,y:0.16},{x:-0.01,y:0.16},{x:-0.01,y:0.16},{x:0,y:0.16},{x:0,y:0.16},{x:0,y:0.16},{x:0.01,y:0.16},{x:0.01,y:0.16},{x:0.01,y:0.16},{x:0.02,y:0.16},{x:0.02,y:0.16},{x:0.02,y:0.16},{x:0.03,y:0.16},{x:0.03,y:0.16},{x:0.03,y:0.16},{x:0.04,y:0.16},{x:0.04,y:0.16},{x:0.04,y:0.16},{x:0.05,y:0.15},{x:0.05,y:0.15},{x:0.05,y:0.15},{x:0.06,y:0.15},{x:0.06,y:0.15},{x:0.06,y:0.15},{x:0.06,y:0.14},{x:0.07,y:0.14},{x:0.07,y:0.14},{x:0.07,y:0.14},{x:0.08,y:0.14},{x:0.08,y:0.13},{x:0.08,y:0.13},{x:0.08,y:0.13},{x:0.09,y:0.13},{x:0.09,y:0.12},{x:0.09,y:0.12},{x:0.09,y:0.12},{x:0.09,y:0.12},{x:0.1,y:0.11},{x:0.1,y:0.11},{x:0.1,y:0.1},{x:0.1,y:0.1},{x:0.11,y:0.09},{x:0.11,y:0.09},{x:0.11,y:0.09},{x:0.11,y:0.08},{x:0.11,y:0.08},{x:0.11,y:0.08},{x:0.11,y:0.07},{x:0.11,y:0.07},{x:0.11,y:0.07},{x:0.11,y:0.06},{x:0.11,y:0.06},{x:0.1,y:0.06},{x:0.1,y:0.06},{x:0.09,y:0.06},{x:0.09,y:0.06},{x:0.08,y:0.06},{x:0.07,y:0.06},{x:0.07,y:0.06},{x:0.06,y:0.06},{x:0.05,y:0.06},{x:0.05,y:0.06},{x:0.04,y:0.06},{x:0.03,y:0.06},{x:0.03,y:0.06},{x:0.02,y:0.06},{x:0.01,y:0.06},{x:0.01,y:0.06},{x:0,y:0.06},{x:-0.01,y:0.06},{x:-0.01,y:0.06},{x:-0.02,y:0.06},{x:-0.03,y:0.06},{x:-0.03,y:0.06},{x:-0.04,y:0.06},{x:-0.05,y:0.06},{x:-0.05,y:0.06},{x:-0.06,y:0.06},{x:-0.07,y:0.06},{x:-0.07,y:0.06},{x:-0.08,y:0.06},{x:-0.09,y:0.06},{x:-0.09,y:0.06}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:0.01,y:0.27},bottom1:{type:"text",text:"{VAL}",x:-0.16,y:-0.27}},refblocks:{left1:{x:-0.47,y:-0.09},right1:{x:0.47,y:-0.09}},bounds:{minX:-0.5,maxX:0.5,minY:-0.27,maxY:0.27,width:1,height:0.53,centerX:0,centerY:0},circles:{}},{paths:Ijo,texts:lTt,bounds:Xye,refblocks:hTt,circles:vjo}=bjo,NDt=Gl({primitives:[...Object.values(Ijo),...Object.values(vjo),{...lTt.top1,anchor:"middle_bottom",x:0},{...lTt.bottom1,anchor:"middle_top",x:0}],ports:[{...hTt.left1,labels:["1"]},{...hTt.right1,labels:["2"]}],size:{width:Xye.width,height:Xye.height},center:{x:Xye.centerX+0.006,y:Xye.centerY+0.06}}),oYe=Ro(NDt),Jse=oYe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),Lxe=oYe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");Jse.anchor="middle_left";Lxe.anchor="middle_right";Jse.x=Jse.x-0.03;Jse.y=Jse.y;Lxe.x=Lxe.x;Lxe.y=0;Sjo=oYe,Pjo={paths:{path11:{type:"path",points:[{x:-0.42,y:-0.1},{x:0.05,y:-0.11}],color:"primary",fill:!1},path40:{type:"path",points:[{x:0.09,y:0.19},{x:0.09,y:-0.18}],color:"primary",fill:!1},"path12-1":{type:"path",points:[{x:0.3,y:0.55},{x:0.3,y:0.11}],color:"primary",fill:!1},"path12-1-5":{type:"path",points:[{x:0.31,y:-0.55},{x:0.31,y:-0.01}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.09,y:0.11},{x:0.31,y:0.11}],color:"primary",fill:!1},"path2-5":{type:"path",points:[{x:0.09,y:-0.1},{x:0.31,y:-0.1}],color:"primary",fill:!1},path15:{type:"path",points:[{x:0.27,y:-0.04},{x:0.27,y:0.03},{x:0.2,y:0},{x:0.27,y:-0.04}],color:"primary",fill:!0},"path2-0":{type:"path",points:[{x:0.09,y:0},{x:0.31,y:-0.01}],color:"primary",fill:!1},"path12-1-0":{type:"path",points:[{x:0.05,y:0.17},{x:0.05,y:-0.11}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.13,y:0.36},bottom1:{type:"text",text:"{VAL}",x:0.06,y:-0.42}},refblocks:{top1:{x:0.3,y:0.55},bottom1:{x:0.31,y:-0.55},left1:{x:-0.42,y:-0.1}},bounds:{minX:-0.45,maxX:0.45,minY:-0.58,maxY:0.58,width:0.89,height:1.16,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0.16,y:0,radius:0.29,color:"primary",fill:!1}}},{paths:Ejo,texts:dTt,bounds:uTt,refblocks:LO,circles:Mjo}=Pjo,RDt={x:uTt.centerX,y:uTt.centerY},wjo={x:RDt.x,y:LO.left1.y},uS=Gl({primitives:[...Object.values(Ejo),...Object.values(Mjo),{...dTt.top1,anchor:"middle_right",x:0},{...dTt.bottom1,anchor:"middle_right",x:0}],ports:[{...LO.top1,labels:["1","drain"]},{...LO.bottom1,labels:["2","source"]},{...LO.left1,labels:["3","gate"]}],size:nae(RDt,[LO.top1,LO.bottom1,LO.left1]),center:wjo}),QDt=Ro(uS),kDt=QDt.primitives.filter((e)=>e.type==="text"),rYe=kDt.find((e)=>e.text==="{VAL}");rYe.x=-0.35;rYe.y=0;rYe.anchor="middle_right";iYe=kDt.find((e)=>e.text==="{REF}");iYe.y=0;iYe.x=0.35;iYe.anchor="middle_left";Ow=QDt,Bjo=eh({horizontalSymbol:uS,verticalSymbol:Ow,gateSide:"bottom",drainSide:"left"}),Tjo=eh({horizontalSymbol:uS,verticalSymbol:Ow,gateSide:"bottom",drainSide:"right"}),Djo=eh({horizontalSymbol:uS,verticalSymbol:Ow,gateSide:"left",drainSide:"bottom"}),Njo=eh({horizontalSymbol:uS,verticalSymbol:Ow,gateSide:"left",drainSide:"top"}),Rjo=eh({horizontalSymbol:uS,verticalSymbol:Ow,gateSide:"right",drainSide:"bottom"}),Qjo=eh({horizontalSymbol:uS,verticalSymbol:Ow,gateSide:"right",drainSide:"top"}),kjo=eh({horizontalSymbol:uS,verticalSymbol:Ow,gateSide:"top",drainSide:"left"}),Ljo=eh({horizontalSymbol:uS,verticalSymbol:Ow,gateSide:"top",drainSide:"right"}),Hjo={paths:{path11:{type:"path",points:[{x:-0.42,y:-0.1},{x:0.05,y:-0.11}],color:"primary",fill:!1},"path12-1":{type:"path",points:[{x:0.3,y:0.55},{x:0.3,y:0.11}],color:"primary",fill:!1},"path12-1-5":{type:"path",points:[{x:0.31,y:-0.55},{x:0.31,y:-0.01}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.09,y:0.11},{x:0.31,y:0.11}],color:"primary",fill:!1},"path2-8-3-7":{type:"path",points:[{x:0.09,y:0.15},{x:0.09,y:0.07}],color:"primary",fill:!1},"path2-5":{type:"path",points:[{x:0.09,y:-0.1},{x:0.31,y:-0.1}],color:"primary",fill:!1},"path2-8-3":{type:"path",points:[{x:0.09,y:-0.08},{x:0.09,y:-0.15}],color:"primary",fill:!1},"path2-8-3-2":{type:"path",points:[{x:0.09,y:0.03},{x:0.09,y:-0.04}],color:"primary",fill:!1},path15:{type:"path",points:[{x:0.27,y:-0.04},{x:0.27,y:0.03},{x:0.2,y:0},{x:0.27,y:-0.04}],color:"primary",fill:!0},"path2-0":{type:"path",points:[{x:0.09,y:0},{x:0.31,y:-0.01}],color:"primary",fill:!1},"path12-1-0":{type:"path",points:[{x:0.05,y:0.11},{x:0.05,y:-0.11}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.13,y:0.36},bottom1:{type:"text",text:"{VAL}",x:0.06,y:-0.42}},refblocks:{top1:{x:0.3,y:0.55},bottom1:{x:0.31,y:-0.55},left1:{x:-0.42,y:-0.1}},bounds:{minX:-0.45,maxX:0.45,minY:-0.58,maxY:0.58,width:0.89,height:1.16,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0.16,y:0,radius:0.29,color:"primary",fill:!1}}},{paths:Fjo,texts:pTt,bounds:mTt,refblocks:fK,circles:zjo}=Hjo,_Tt={x:mTt.centerX,y:mTt.centerY},pS=Gl({primitives:[...Object.values(Fjo),...Object.values(zjo),{...pTt.top1,anchor:"middle_right",x:0},{...pTt.bottom1,anchor:"middle_right",x:0}],ports:[{...fK.top1,labels:["1","drain"]},{...fK.bottom1,labels:["2","source"]},{...fK.left1,labels:["3","gate"]}],size:nae(_Tt,[fK.top1,fK.bottom1,fK.left1]),center:_Tt}),LDt=Ro(pS),HDt=LDt.primitives.filter((e)=>e.type==="text"),sYe=HDt.find((e)=>e.text==="{VAL}");sYe.x=-0.35;sYe.y=0;sYe.anchor="middle_right";aYe=HDt.find((e)=>e.text==="{REF}");aYe.y=0;aYe.x=0.35;aYe.anchor="middle_left";Vw=LDt,Ojo=eh({horizontalSymbol:pS,verticalSymbol:Vw,gateSide:"bottom",drainSide:"left"}),Vjo=eh({horizontalSymbol:pS,verticalSymbol:Vw,gateSide:"bottom",drainSide:"right"}),Yjo=eh({horizontalSymbol:pS,verticalSymbol:Vw,gateSide:"left",drainSide:"bottom"}),Gjo=eh({horizontalSymbol:pS,verticalSymbol:Vw,gateSide:"left",drainSide:"top"}),Ujo=eh({horizontalSymbol:pS,verticalSymbol:Vw,gateSide:"right",drainSide:"bottom"}),Wjo=eh({horizontalSymbol:pS,verticalSymbol:Vw,gateSide:"right",drainSide:"top"}),Xjo=eh({horizontalSymbol:pS,verticalSymbol:Vw,gateSide:"top",drainSide:"left"}),jjo=eh({horizontalSymbol:pS,verticalSymbol:Vw,gateSide:"top",drainSide:"right"}),Kjo={paths:{path11:{type:"path",points:[{x:-0.4,y:0},{x:0.06,y:-0.01}],color:"primary",fill:!1},path40:{type:"path",points:[{x:0.07,y:0.19},{x:0.07,y:-0.18}],color:"primary",fill:!1},"path12-1":{type:"path",points:[{x:0.28,y:0.55},{x:0.28,y:0.11}],color:"primary",fill:!1},"path12-1-5":{type:"path",points:[{x:0.29,y:-0.55},{x:0.29,y:-0.1}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.07,y:0.11},{x:0.29,y:0.11}],color:"primary",fill:!1},"path2-5":{type:"path",points:[{x:0.07,y:-0.1},{x:0.29,y:-0.1}],color:"primary",fill:!1},path15:{type:"path",points:[{x:-0.08,y:0.06},{x:-0.08,y:-0.07},{x:0.01,y:0},{x:-0.08,y:0.06}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-0.15,y:0.36},bottom1:{type:"text",text:"{VAL}",x:0.04,y:-0.42}},refblocks:{top1:{x:0.28,y:0.55},bottom1:{x:0.29,y:-0.55},left1:{x:-0.4,y:0}},bounds:{minX:-0.43,maxX:0.43,minY:-0.58,maxY:0.58,width:0.85,height:1.16,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0.14,y:0,radius:0.29,color:"primary",fill:!1}}},{paths:$jo,texts:gTt,bounds:jye,refblocks:dOe,circles:qjo}=Kjo,FDt=Gl({primitives:[...Object.values($jo),...Object.values(qjo),{...gTt.top1,anchor:"middle_right",x:0},{...gTt.bottom1,anchor:"middle_right",x:0}],ports:[{...dOe.top1,labels:["1","drain"]},{...dOe.bottom1,labels:["2","source"]},{...dOe.left1,labels:["3","gate"]}],size:{width:jye.width,height:jye.height},center:{x:jye.centerX,y:jye.centerY}}),zDt=Ro(FDt),ODt=zDt.primitives.filter((e)=>e.type==="text"),cYe=ODt.find((e)=>e.text==="{VAL}");cYe.x=-0.35;cYe.y=0;cYe.anchor="middle_right";lYe=ODt.find((e)=>e.text==="{REF}");lYe.y=0;lYe.x=0.35;lYe.anchor="middle_left";Jjo=zDt,Zjo={paths:{diag1:{type:"path",points:[{x:-0.1,y:-0.1},{x:0.1,y:0.1}],color:"primary",fill:!1},diag2:{type:"path",points:[{x:-0.1,y:0.1},{x:0.1,y:-0.1}],color:"primary",fill:!1},stem:{type:"path",points:[{x:-0.2,y:0},{x:0,y:0}],color:"primary",fill:!1}},texts:{},refblocks:{left1:{x:-0.2,y:0}},bounds:{minX:-0.19,maxX:0.2,minY:-0.12,maxY:0.12,width:0.39,height:0.24,centerX:0,centerY:0},circles:{}},{paths:eKo,bounds:ATt,refblocks:tKo}=Zjo,u5e=An({primitives:[...Object.values(eKo)],ports:[{...tKo.left1,labels:["1"]}],center:{x:ATt.centerX,y:ATt.centerY}}).rotateRightFacingSymbol("right").labelPort("left1",["1"]).build(),nKo=Ro(u5e,"down"),oKo=Ro(u5e,"left"),rKo=Ro(u5e,"up"),BK={paths:{path11:{type:"path",points:[{x:-0.4,y:0},{x:0.06,y:-0.01}],color:"primary",fill:!1},"path40-0":{type:"path",points:[{x:0.07,y:0.27},{x:0.07,y:-0.28}],color:"primary",fill:!1},"path40-0-5":{type:"path",points:[{x:0.28,y:0.24},{x:0.08,y:0.11}],color:"primary",fill:!1},"path40-0-5-0":{type:"path",points:[{x:0.29,y:-0.24},{x:0.09,y:-0.11}],color:"primary",fill:!1},"path12-1-5":{type:"path",points:[{x:0.29,y:0.25},{x:0.29,y:0.55}],color:"primary",fill:!1},"path12-1-5-3":{type:"path",points:[{x:0.29,y:-0.55},{x:0.29,y:-0.25}],color:"primary",fill:!1},path15:{type:"path",points:[{x:0.19,y:-0.1},{x:0.12,y:-0.2},{x:0.22,y:-0.2},{x:0.19,y:-0.1}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-0.08,y:0.36},bottom1:{type:"text",text:"{VAL}",x:-0.07,y:-0.41}},refblocks:{top1:{x:0.29,y:0.55},bottom1:{x:0.29,y:-0.55},left1:{x:-0.4,y:0}},bounds:{minX:-0.43,maxX:0.43,minY:-0.58,maxY:0.58,width:0.85,height:1.16,centerX:0,centerY:0},circles:{"path1-0":{type:"circle",x:0.14,y:0,radius:0.29,color:"primary",fill:!1}}},{paths:iKo,texts:VNs,bounds:Kye,refblocks:uOe,circles:sKo}=BK,aKo=An({primitives:[...Object.values(iKo),...Object.values(sKo),{type:"text",text:"{REF}",x:-0.3,y:0.5094553499999995},{type:"text",text:"{VAL}",x:-0.3,y:-0.5094553499999995}],ports:[{...uOe.top1,labels:["1","collector"]},{...uOe.bottom1,labels:["3","emitter"]},{...uOe.left1,labels:["2","base"]}],size:{width:Kye.width,height:Kye.height},center:{x:Kye.centerX,y:Kye.centerY}}).rotateRightFacingSymbol("right").changeTextAnchor("{REF}","middle_right").changeTextAnchor("{VAL}","middle_right").build(),{paths:cKo,texts:YNs,bounds:$ye,refblocks:pOe,circles:lKo}=BK,hKo=An({primitives:[...Object.values(cKo),...Object.values(lKo),{type:"text",text:"{REF}",x:0.55,y:-0.4094553499999995},{type:"text",text:"{VAL}",x:-0.3,y:-0.4094553499999995}],ports:[{...pOe.top1,labels:["1","collector"]},{...pOe.bottom1,labels:["3","emitter"]},{...pOe.left1,labels:["2","base"]}],size:{width:$ye.width,height:$ye.height},center:{x:$ye.centerX,y:$ye.centerY}}).rotateRightFacingSymbol("up").changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),{paths:dKo,texts:GNs,bounds:qye,refblocks:mOe,circles:uKo}=BK,pKo=An({primitives:[...Object.values(dKo),...Object.values(uKo),{type:"text",text:"{REF}",x:-0.5,y:0.3094553499999995},{type:"text",text:"{VAL}",x:0.55,y:0.3094553499999995}],ports:[{...mOe.top1,labels:["1","collector"]},{...mOe.bottom1,labels:["3","emitter"]},{...mOe.left1,labels:["2","base"]}],size:{width:qye.width,height:qye.height},center:{x:qye.centerX,y:qye.centerY}}).rotateRightFacingSymbol("down").changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),{paths:mKo,texts:UNs,bounds:Jye,refblocks:_Oe,circles:_Ko}=BK,gKo=An({primitives:[...Object.values(mKo),...Object.values(_Ko),{type:"text",text:"{REF}",x:0.55,y:-0.4094553499999995},{type:"text",text:"{VAL}",x:-0.3,y:-0.4094553499999995}],ports:[{..._Oe.top1,labels:["1","collector"]},{..._Oe.bottom1,labels:["3","emitter"]},{..._Oe.left1,labels:["2","base"]}],size:{width:Jye.width,height:Jye.height},center:{x:Jye.centerX,y:Jye.centerY}}).rotateRightFacingSymbol("up").changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),{paths:AKo,texts:WNs,bounds:Zye,refblocks:gOe,circles:fKo}=BK,yKo=An({primitives:[...Object.values(AKo),...Object.values(fKo),{type:"text",text:"{REF}",x:-0.3,y:-0.4094553499999995},{type:"text",text:"{VAL}",x:-0.3,y:0.4094553499999995}],ports:[{...gOe.top1,labels:["1","collector"]},{...gOe.bottom1,labels:["3","emitter"]},{...gOe.left1,labels:["2","base"]}],size:{width:Zye.width,height:Zye.height},center:{x:Zye.centerX,y:Zye.centerY}}).rotateRightFacingSymbol("left").changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),{paths:xKo,texts:XNs,bounds:exe,refblocks:AOe,circles:CKo}=BK,bKo=An({primitives:[...Object.values(xKo),...Object.values(CKo),{type:"text",text:"{REF}",x:-0.3,y:-0.4094553499999995},{type:"text",text:"{VAL}",x:-0.3,y:0.4094553499999995}],ports:[{...AOe.top1,labels:["1","collector"]},{...AOe.bottom1,labels:["3","emitter"]},{...AOe.left1,labels:["2","base"]}],size:{width:exe.width,height:exe.height},center:{x:exe.centerX,y:exe.centerY}}).rotateRightFacingSymbol("left").changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),IKo={paths:{path40:{type:"path",points:[{x:0.14,y:0.04},{x:-0.32,y:-0.21}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-0.32,y:0.31},{x:0.14,y:0.04}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-0.32,y:-0.21},{x:-0.32,y:0.31}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-0.32,y:0.18},{x:-0.57,y:0.18}],color:"primary",fill:!1},path45:{type:"path",points:[{x:-0.32,y:-0.09},{x:-0.57,y:-0.09}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.43,y:0.04},{x:0.15,y:0.04}],color:"primary",fill:!1},"rect1577-3":{type:"path",points:[{x:-0.19,y:-0.09},{x:-0.27,y:-0.09}],color:"primary",fill:!0},"rect1577-4":{type:"path",points:[{x:-0.19,y:0.18},{x:-0.27,y:0.18}],color:"primary",fill:!0},"rect1577-4-7":{type:"path",points:[{x:-0.23,y:0.14},{x:-0.23,y:0.22}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-0.01,y:0.42},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.3}},refblocks:{left1:{x:-0.57,y:0.18},left2:{x:-0.57,y:-0.09},right1:{x:0.43,y:0.04}},bounds:{minX:-0.57,maxX:0.43,minY:-0.38,maxY:0.27,width:1.09,height:0.3,centerX:-0.07,centerY:0.05},circles:{}},p5e=An(IKo).labelPort("left1",["1","inp1"]).labelPort("left2",["2","inp2"]).labelPort("right1",["3","out"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),vKo=Ro(p5e,"down"),SKo=CK(Ro(p5e,"left")),PKo=Ro(p5e,"up"),EKo={paths:{path40:{type:"path",points:[{x:0.14,y:0.04},{x:-0.32,y:-0.21}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-0.32,y:0.31},{x:0.14,y:0.04}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-0.32,y:-0.21},{x:-0.32,y:0.31}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-0.32,y:0.18},{x:-0.57,y:0.18}],color:"primary",fill:!1},path45:{type:"path",points:[{x:-0.32,y:-0.09},{x:-0.57,y:-0.09}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.43,y:0.04},{x:0.15,y:0.04}],color:"primary",fill:!1},"path44-1":{type:"path",points:[{x:-0.1,y:0.44},{x:-0.1,y:0.18}],color:"primary",fill:!1},"path44-2":{type:"path",points:[{x:-0.09,y:-0.34},{x:-0.09,y:-0.09}],color:"primary",fill:!1},"rect1577-3":{type:"path",points:[{x:-0.19,y:0.18},{x:-0.27,y:0.18}],color:"primary",fill:!0},"rect1577-4":{type:"path",points:[{x:-0.19,y:-0.09},{x:-0.27,y:-0.09}],color:"primary",fill:!0},"rect1577-4-7":{type:"path",points:[{x:-0.23,y:0.14},{x:-0.23,y:0.22}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:0.25,y:0.32},bottom1:{type:"text",text:"{VAL}",x:0.25,y:-0.24}},refblocks:{left1:{x:-0.57,y:0.18},left2:{x:-0.57,y:-0.09},right1:{x:0.43,y:0.04},top2:{x:-0.1,y:0.44},bottom1:{x:-0.09,y:-0.34}},bounds:{minX:-0.57,maxX:0.43,minY:-0.38,maxY:0.27,width:1.09,height:0.3,centerX:-0.07,centerY:0.05},circles:{}},m5e=An(EKo).labelPort("left1",["1","inp1"]).labelPort("left2",["2","inp2"]).labelPort("right1",["4","out"]).labelPort("top2",["5","V+"]).labelPort("bottom1",["3","V-"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),MKo=Ro(m5e,"down"),wKo=CK(Ro(m5e,"left")),BKo=Ro(m5e,"up"),TKo={paths:{path11:{type:"path",points:[{x:-0.42,y:-0.1},{x:0.05,y:-0.11}],color:"primary",fill:!1},path40:{type:"path",points:[{x:0.09,y:0.19},{x:0.09,y:-0.18}],color:"primary",fill:!1},"path12-1":{type:"path",points:[{x:0.3,y:0.55},{x:0.3,y:0.11}],color:"primary",fill:!1},"path12-1-5":{type:"path",points:[{x:0.31,y:-0.55},{x:0.31,y:-0.01}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.09,y:0.11},{x:0.31,y:0.11}],color:"primary",fill:!1},"path2-5":{type:"path",points:[{x:0.09,y:-0.1},{x:0.31,y:-0.1}],color:"primary",fill:!1},path15:{type:"path",points:[{x:0.2,y:0.03},{x:0.2,y:-0.04},{x:0.27,y:-0.01},{x:0.2,y:0.03}],color:"primary",fill:!0},"path2-0":{type:"path",points:[{x:0.09,y:0},{x:0.31,y:-0.01}],color:"primary",fill:!1},"path12-1-0":{type:"path",points:[{x:0.05,y:0.17},{x:0.05,y:-0.11}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.13,y:0.36},bottom1:{type:"text",text:"{VAL}",x:0.06,y:-0.42}},refblocks:{top1:{x:0.3,y:0.55},bottom1:{x:0.31,y:-0.55},left1:{x:-0.42,y:-0.1}},bounds:{minX:-0.45,maxX:0.45,minY:-0.58,maxY:0.58,width:0.89,height:1.16,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0.16,y:0,radius:0.29,color:"primary",fill:!1}}},{paths:DKo,texts:fTt,bounds:yTt,refblocks:yK,circles:NKo}=TKo,xTt={x:yTt.centerX,y:yTt.centerY},mS=Gl({primitives:[...Object.values(DKo),...Object.values(NKo),{...fTt.top1,anchor:"middle_right",x:0},{...fTt.bottom1,anchor:"middle_right",x:0}],ports:[{...yK.top1,labels:["1","drain"]},{...yK.bottom1,labels:["2","source"]},{...yK.left1,labels:["3","gate"]}],size:nae(xTt,[yK.top1,yK.bottom1,yK.left1]),center:xTt}),VDt=Ro(mS),YDt=VDt.primitives.filter((e)=>e.type==="text"),hYe=YDt.find((e)=>e.text==="{VAL}");hYe.x=-0.35;hYe.y=0;hYe.anchor="middle_right";dYe=YDt.find((e)=>e.text==="{REF}");dYe.y=0;dYe.x=0.35;dYe.anchor="middle_left";Yw=VDt,RKo=eh({horizontalSymbol:mS,verticalSymbol:Yw,gateSide:"bottom",drainSide:"left"}),QKo=eh({horizontalSymbol:mS,verticalSymbol:Yw,gateSide:"bottom",drainSide:"right"}),kKo=eh({horizontalSymbol:mS,verticalSymbol:Yw,gateSide:"left",drainSide:"bottom"}),LKo=eh({horizontalSymbol:mS,verticalSymbol:Yw,gateSide:"left",drainSide:"top"}),HKo=eh({horizontalSymbol:mS,verticalSymbol:Yw,gateSide:"right",drainSide:"bottom"}),FKo=eh({horizontalSymbol:mS,verticalSymbol:Yw,gateSide:"right",drainSide:"top"}),zKo=eh({horizontalSymbol:mS,verticalSymbol:Yw,gateSide:"top",drainSide:"left"}),OKo=eh({horizontalSymbol:mS,verticalSymbol:Yw,gateSide:"top",drainSide:"right"}),VKo={paths:{path11:{type:"path",points:[{x:-0.42,y:-0.1},{x:0.05,y:-0.11}],color:"primary",fill:!1},"path12-1":{type:"path",points:[{x:0.3,y:0.55},{x:0.3,y:0.11}],color:"primary",fill:!1},"path12-1-5":{type:"path",points:[{x:0.31,y:-0.55},{x:0.31,y:-0.01}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.09,y:0.11},{x:0.31,y:0.11}],color:"primary",fill:!1},"path2-8-3-7":{type:"path",points:[{x:0.09,y:0.15},{x:0.09,y:0.07}],color:"primary",fill:!1},"path2-5":{type:"path",points:[{x:0.09,y:-0.1},{x:0.31,y:-0.1}],color:"primary",fill:!1},"path2-8-3":{type:"path",points:[{x:0.09,y:-0.08},{x:0.09,y:-0.15}],color:"primary",fill:!1},"path2-8-3-2":{type:"path",points:[{x:0.09,y:0.03},{x:0.09,y:-0.04}],color:"primary",fill:!1},path15:{type:"path",points:[{x:0.2,y:0.03},{x:0.2,y:-0.04},{x:0.27,y:-0.01},{x:0.2,y:0.03}],color:"primary",fill:!0},"path2-0":{type:"path",points:[{x:0.09,y:0},{x:0.31,y:-0.01}],color:"primary",fill:!1},"path12-1-0":{type:"path",points:[{x:0.05,y:0.11},{x:0.05,y:-0.11}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.13,y:0.36},bottom1:{type:"text",text:"{VAL}",x:0.06,y:-0.42}},refblocks:{top1:{x:0.3,y:0.55},bottom1:{x:0.31,y:-0.55},left1:{x:-0.42,y:-0.1}},bounds:{minX:-0.45,maxX:0.45,minY:-0.58,maxY:0.58,width:0.89,height:1.16,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0.16,y:0,radius:0.29,color:"primary",fill:!1}}},{paths:YKo,texts:CTt,bounds:bTt,refblocks:xK,circles:GKo}=VKo,ITt={x:bTt.centerX,y:bTt.centerY},_S=Gl({primitives:[...Object.values(YKo),...Object.values(GKo),{...CTt.top1,anchor:"middle_right",x:0},{...CTt.bottom1,anchor:"middle_right",x:0}],ports:[{...xK.top1,labels:["1","drain"]},{...xK.bottom1,labels:["2","source"]},{...xK.left1,labels:["3","gate"]}],size:nae(ITt,[xK.top1,xK.bottom1,xK.left1]),center:ITt}),GDt=Ro(_S),UDt=GDt.primitives.filter((e)=>e.type==="text"),uYe=UDt.find((e)=>e.text==="{VAL}");uYe.x=-0.35;uYe.y=0;uYe.anchor="middle_right";pYe=UDt.find((e)=>e.text==="{REF}");pYe.y=0;pYe.x=0.35;pYe.anchor="middle_left";Gw=GDt,UKo=eh({horizontalSymbol:_S,verticalSymbol:Gw,gateSide:"bottom",drainSide:"left"}),WKo=eh({horizontalSymbol:_S,verticalSymbol:Gw,gateSide:"bottom",drainSide:"right"}),XKo=eh({horizontalSymbol:_S,verticalSymbol:Gw,gateSide:"left",drainSide:"bottom"}),jKo=eh({horizontalSymbol:_S,verticalSymbol:Gw,gateSide:"left",drainSide:"top"}),KKo=eh({horizontalSymbol:_S,verticalSymbol:Gw,gateSide:"right",drainSide:"bottom"}),$Ko=eh({horizontalSymbol:_S,verticalSymbol:Gw,gateSide:"right",drainSide:"top"}),qKo=eh({horizontalSymbol:_S,verticalSymbol:Gw,gateSide:"top",drainSide:"left"}),JKo=eh({horizontalSymbol:_S,verticalSymbol:Gw,gateSide:"top",drainSide:"right"}),ZKo={paths:{path11:{type:"path",points:[{x:-0.54,y:-0.01},{x:-0.15,y:-0.02}],color:"primary",fill:!1},path40:{type:"path",points:[{x:0.13,y:0},{x:-0.13,y:-0.13}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-0.13,y:0.13},{x:0.13,y:0}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-0.13,y:-0.13},{x:-0.13,y:0.13}],color:"primary",fill:!1},path43:{type:"path",points:[{x:0.13,y:0.13},{x:0.13,y:-0.13}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.14,y:0},{x:0.54,y:-0.01}],color:"primary",fill:!1},"path25-0":{type:"path",points:[{x:0.2,y:0.38},{x:0.16,y:0.28},{x:0.26,y:0.3}],color:"primary",fill:!0},"path78-6":{type:"path",points:[{x:0.33,y:0.43},{x:0.32,y:0.42},{x:0.21,y:0.31},{x:0.21,y:0.31}],color:"primary",fill:!1},"path25-0-9":{type:"path",points:[{x:0.35,y:0.35},{x:0.31,y:0.26},{x:0.41,y:0.27}],color:"primary",fill:!0},"path78-6-5":{type:"path",points:[{x:0.48,y:0.4},{x:0.47,y:0.39},{x:0.35,y:0.29},{x:0.35,y:0.29}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.1,y:0.35},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.43}},refblocks:{left1:{x:-0.54,y:-0.01},right1:{x:0.54,y:-0.01}},bounds:{minX:-0.57,maxX:0.57,minY:-0.43,maxY:0.43,width:1.14,height:0.85,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0,y:-0.01,radius:0.29,color:"primary",fill:!1}}},WDt=An(ZKo).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),XDt=Ro(WDt),e$o=XDt.primitives.filter((e)=>e.type==="text"),jDt=e$o.find((e)=>e.text==="{REF}");jDt.y=0;jDt.anchor="middle_left";t$o=XDt,mYe={paths:{enclosure:{type:"path",points:[{x:-0.5,y:0.2749999999999999},{x:0.5,y:0.2749999999999999},{x:0.5,y:-0.27500000000000013},{x:-0.5,y:-0.27500000000000013},{x:-0.5,y:0.2749999999999999}],color:"primary",fill:!1},"pin-one-lead":{type:"path",points:[{x:-0.6499999999999999,y:0.10833329999999997},{x:-0.5,y:0.10833329999999997}],color:"primary",fill:!1},"pin-two-lead":{type:"path",points:[{x:-0.6499999999999999,y:-0.10833329999999997},{x:-0.5,y:-0.10833329999999997}],color:"primary",fill:!1},"pin-four-lead":{type:"path",points:[{x:0.5,y:0.10833329999999997},{x:0.6499999999999999,y:0.10833329999999997}],color:"primary",fill:!1},"pin-three-lead":{type:"path",points:[{x:0.5,y:-0.10833329999999997},{x:0.6499999999999999,y:-0.10833329999999997}],color:"primary",fill:!1},"led-anode-lead":{type:"path",points:[{x:-0.5,y:0.10833329999999997},{x:-0.2749999999999999,y:0.10833329999999997},{x:-0.2749999999999999,y:0.04999999999999982}],color:"primary",fill:!1},"led-body":{type:"path",points:[{x:-0.32499999999999996,y:0.04999999999999982},{x:-0.22499999999999987,y:0.04999999999999982},{x:-0.2749999999999999,y:-0.050000000000000044},{x:-0.32499999999999996,y:0.04999999999999982}],color:"primary",fill:!1},"led-cathode":{type:"path",points:[{x:-0.32499999999999996,y:-0.050000000000000044},{x:-0.22499999999999987,y:-0.050000000000000044}],color:"primary",fill:!1},"led-cathode-lead":{type:"path",points:[{x:-0.2749999999999999,y:-0.050000000000000044},{x:-0.2749999999999999,y:-0.10833329999999997},{x:-0.5,y:-0.10833329999999997}],color:"primary",fill:!1},collector:{type:"path",points:[{x:0.5,y:0.10833329999999997},{x:0.3700000000000001,y:0.10833329999999997},{x:0.28000000000000025,y:0.05499999999999994}],color:"primary",fill:!1},"transistor-base":{type:"path",points:[{x:0.28000000000000025,y:0.08499999999999996},{x:0.28000000000000025,y:-0.08499999999999996}],color:"primary",fill:!1},emitter:{type:"path",points:[{x:0.28000000000000025,y:-0.05500000000000016},{x:0.375,y:-0.10833329999999997},{x:0.5,y:-0.10833329999999997}],color:"primary",fill:!1},"emitter-arrow":{type:"path",points:[{x:0.31620000000000004,y:-0.09600000000000009},{x:0.365,y:-0.10270000000000024},{x:0.3338000000000001,y:-0.06460000000000021}],color:"primary",fill:!1},"light-ray-one":{type:"path",points:[{x:-0.1299999999999999,y:0.10499999999999998},{x:0.1050000000000002,y:0.009999999999999787}],color:"primary",fill:!1},"light-ray-one-head":{type:"path",points:[{x:0.04700000000000015,y:0.014000000000000012},{x:0.1050000000000002,y:0.009999999999999787},{x:0.06099999999999994,y:0.04699999999999993}],color:"primary",fill:!1},"light-ray-two":{type:"path",points:[{x:-0.1299999999999999,y:-0.0050000000000001155},{x:0.1050000000000002,y:-0.10000000000000009}],color:"primary",fill:!1},"light-ray-two-head":{type:"path",points:[{x:0.04700000000000015,y:-0.09600000000000009},{x:0.1050000000000002,y:-0.10000000000000009},{x:0.06099999999999994,y:-0.06300000000000017}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.3800000000000001},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.3800000000000001}},refblocks:{left1:{x:-0.6499999999999999,y:-0.10833333333330031},left2:{x:-0.6499999999999999,y:0.10833333333329986},right1:{x:0.6499999999999999,y:-0.10833333333330031},right2:{x:0.6499999999999999,y:0.10833333333329986}},bounds:{minX:-0.6499999999999999,maxX:0.6499999999999999,minY:-0.3800000000000001,maxY:0.3800000000000001,width:1.2999999999999998,height:0.7600000000000002,centerX:0,centerY:0},circles:{}},n$o=An(mYe).labelPort("left1",["2","cathode","input_cathode"]).labelPort("left2",["1","anode","input_anode"]).labelPort("right1",["3","emitter","output_emitter"]).labelPort("right2",["4","collector","output_collector"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("down").build(),KDt=An(mYe).labelPort("left1",["2","cathode","input_cathode"]).labelPort("left2",["1","anode","input_anode"]).labelPort("right1",["3","emitter","output_emitter"]).labelPort("right2",["4","collector","output_collector"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("right").build(),o$o=Y9(KDt),r$o=An(mYe).labelPort("left1",["2","cathode","input_cathode"]).labelPort("left2",["1","anode","input_anode"]).labelPort("right1",["3","emitter","output_emitter"]).labelPort("right2",["4","collector","output_collector"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("up").build(),i$o={paths:{path11:{type:"path",points:[{x:-0.4,y:0},{x:0.06,y:-0.01}],color:"primary",fill:!1},path40:{type:"path",points:[{x:0.07,y:0.19},{x:0.07,y:-0.18}],color:"primary",fill:!1},"path12-1":{type:"path",points:[{x:0.28,y:0.55},{x:0.28,y:0.11}],color:"primary",fill:!1},"path12-1-5":{type:"path",points:[{x:0.29,y:-0.55},{x:0.29,y:-0.1}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.07,y:0.11},{x:0.29,y:0.11}],color:"primary",fill:!1},"path2-5":{type:"path",points:[{x:0.07,y:-0.1},{x:0.29,y:-0.1}],color:"primary",fill:!1},path15:{type:"path",points:[{x:0.01,y:-0.07},{x:0.01,y:0.06},{x:-0.08,y:0},{x:0.01,y:-0.07}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-0.15,y:0.36},bottom1:{type:"text",text:"{VAL}",x:0.04,y:-0.42}},refblocks:{top1:{x:0.28,y:0.55},bottom1:{x:0.29,y:-0.55},left1:{x:-0.4,y:0}},bounds:{minX:-0.43,maxX:0.43,minY:-0.58,maxY:0.58,width:0.85,height:1.16,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0.14,y:0,radius:0.29,color:"primary",fill:!1}}},{paths:s$o,texts:vTt,bounds:txe,refblocks:fOe,circles:a$o}=i$o,$Dt=Gl({primitives:[...Object.values(s$o),...Object.values(a$o),{...vTt.top1,anchor:"middle_right",x:0},{...vTt.bottom1,anchor:"middle_right"}],ports:[{...fOe.top1,labels:["1","drain"]},{...fOe.bottom1,labels:["2","source"]},{...fOe.left1,labels:["3","gate"]}],size:{width:txe.width,height:txe.height},center:{x:txe.centerX,y:txe.centerY}}),qDt=Ro($Dt),JDt=qDt.primitives.filter((e)=>e.type==="text"),_Ye=JDt.find((e)=>e.text==="{VAL}");_Ye.x=-0.35;_Ye.y=0;_Ye.anchor="middle_right";gYe=JDt.find((e)=>e.text==="{REF}");gYe.y=0;gYe.x=0.35;gYe.anchor="middle_left";c$o=qDt,HO={paths:{path11:{type:"path",points:[{x:-0.4,y:0},{x:0.06,y:-0.01}],color:"primary",fill:!1},"path40-0":{type:"path",points:[{x:0.07,y:0.27},{x:0.07,y:-0.28}],color:"primary",fill:!1},"path40-0-5":{type:"path",points:[{x:0.28,y:0.24},{x:0.08,y:0.11}],color:"primary",fill:!1},"path40-0-5-0":{type:"path",points:[{x:0.29,y:-0.24},{x:0.09,y:-0.11}],color:"primary",fill:!1},"path12-1-5":{type:"path",points:[{x:0.29,y:0.25},{x:0.29,y:0.55}],color:"primary",fill:!1},"path12-1-5-3":{type:"path",points:[{x:0.29,y:-0.55},{x:0.29,y:-0.25}],color:"primary",fill:!1},path15:{type:"path",points:[{x:0.15,y:-0.23},{x:0.22,y:-0.12},{x:0.12,y:-0.12},{x:0.15,y:-0.23}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-0.08,y:0.37},bottom1:{type:"text",text:"{VAL}",x:-0.07,y:-0.41}},refblocks:{top1:{x:0.29,y:0.55},bottom1:{x:0.29,y:-0.55},left1:{x:-0.4,y:0}},bounds:{minX:-0.43,maxX:0.43,minY:-0.58,maxY:0.58,width:0.85,height:1.16,centerX:0,centerY:0},circles:{"path1-0":{type:"circle",x:0.14,y:0,radius:0.29,color:"primary",fill:!1}}},{paths:l$o,texts:jNs,bounds:nxe,refblocks:yOe,circles:h$o}=HO,d$o=An({primitives:[...Object.values(l$o),...Object.values(h$o),{type:"text",text:"{REF}",x:-0.1,y:0.3094553499999995},{type:"text",text:"{VAL}",x:-0.1,y:-0.3094553499999995}],ports:[{...yOe.top1,labels:["1","collector"]},{...yOe.bottom1,labels:["3","emitter"]},{...yOe.left1,labels:["2","base"]}],size:{width:nxe.width,height:nxe.height},center:{x:nxe.centerX,y:nxe.centerY}}).rotateRightFacingSymbol("right").changeTextAnchor("{REF}","middle_right").changeTextAnchor("{VAL}","middle_right").build(),{paths:KNs,texts:$Ns,bounds:qNs,refblocks:JNs,circles:ZNs}=HO,u$o=An(HO).rotateRightFacingSymbol("up").changeTextAnchor("{VAL}","middle_left").labelPort("left1",["2","base"]).labelPort("top1",["1","collector"]).labelPort("bottom1",["3","emitter"]).changeTextAnchor("{REF}","middle_right").build(),{paths:p$o,texts:eRs,bounds:oxe,refblocks:xOe,circles:m$o}=HO,_$o=An({primitives:[...Object.values(p$o),...Object.values(m$o),{type:"text",text:"{REF}",x:-0.1,y:-0.3094553499999995},{type:"text",text:"{VAL}",x:-0.1,y:0.3094553499999995}],ports:[{...xOe.top1,labels:["1","collector"]},{...xOe.bottom1,labels:["3","emitter"]},{...xOe.left1,labels:["2","base"]}],size:{width:oxe.width,height:oxe.height},center:{x:oxe.centerX,y:oxe.centerY}}).rotateRightFacingSymbol("down").changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_bottom").build(),{paths:g$o,texts:tRs,bounds:rxe,refblocks:COe,circles:A$o}=HO,f$o=An({primitives:[...Object.values(g$o),...Object.values(A$o),{type:"text",text:"{REF}",x:-0.1,y:-0.3094553499999995},{type:"text",text:"{VAL}",x:-0.1,y:0.3094553499999995}],ports:[{...COe.top1,labels:["1","collector"]},{...COe.bottom1,labels:["3","emitter"]},{...COe.left1,labels:["2","base"]}],size:{width:rxe.width,height:rxe.height},center:{x:rxe.centerX,y:rxe.centerY}}).rotateRightFacingSymbol("up").changeTextAnchor("{REF}","middle_top").changeTextAnchor("{VAL}","middle_top").build(),{paths:y$o,texts:nRs,bounds:ixe,refblocks:bOe,circles:x$o}=HO,C$o=An({primitives:[...Object.values(y$o),...Object.values(x$o),{type:"text",text:"{REF}",x:-0.1,y:-0.3094553499999995},{type:"text",text:"{VAL}",x:-0.1,y:0.3094553499999995}],ports:[{...bOe.top1,labels:["1","collector"]},{...bOe.bottom1,labels:["3","emitter"]},{...bOe.left1,labels:["2","base"]}],size:{width:ixe.width,height:ixe.height},center:{x:ixe.centerX,y:ixe.centerY}}).rotateRightFacingSymbol("left").changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),{paths:b$o,texts:oRs,bounds:sxe,refblocks:IOe,circles:I$o}=HO,v$o=An({primitives:[...Object.values(b$o),...Object.values(I$o),{type:"text",text:"{REF}",x:-0.1,y:-0.3094553499999995},{type:"text",text:"{VAL}",x:-0.1,y:0.3094553499999995}],ports:[{...IOe.top1,labels:["1","collector"]},{...IOe.bottom1,labels:["3","emitter"]},{...IOe.left1,labels:["2","base"]}],size:{width:sxe.width,height:sxe.height},center:{x:sxe.centerX,y:sxe.centerY}}).rotateRightFacingSymbol("left").changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),S$o={paths:{path40:{type:"path",points:[{x:-0.19,y:0.33},{x:-0.26,y:0.14}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-0.38,y:0.26},{x:-0.19,y:0.33}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-0.26,y:0.14},{x:-0.38,y:0.26}],color:"primary",fill:!1},path43:{type:"path",points:[{x:-0.26,y:0.39},{x:-0.13,y:0.26}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-0.32,y:0.2},{x:-0.52,y:0}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0,y:0.52},{x:-0.19,y:0.33}],color:"primary",fill:!1},"path40-4":{type:"path",points:[{x:-0.19,y:-0.32},{x:-0.38,y:-0.26}],color:"primary",fill:!1},"path41-1":{type:"path",points:[{x:-0.26,y:-0.13},{x:-0.19,y:-0.32}],color:"primary",fill:!1},"path42-7":{type:"path",points:[{x:-0.38,y:-0.26},{x:-0.26,y:-0.13}],color:"primary",fill:!1},"path43-1":{type:"path",points:[{x:-0.13,y:-0.26},{x:-0.26,y:-0.39}],color:"primary",fill:!1},"path44-8":{type:"path",points:[{x:-0.32,y:-0.19},{x:-0.51,y:-0.01}],color:"primary",fill:!1},"path44-0-7":{type:"path",points:[{x:-0.01,y:-0.5},{x:-0.19,y:-0.32}],color:"primary",fill:!1},"path40-4-0":{type:"path",points:[{x:0.32,y:0.19},{x:0.13,y:0.26}],color:"primary",fill:!1},"path41-1-2":{type:"path",points:[{x:0.26,y:0.38},{x:0.32,y:0.19}],color:"primary",fill:!1},"path42-7-1":{type:"path",points:[{x:0.13,y:0.26},{x:0.26,y:0.38}],color:"primary",fill:!1},"path43-1-8":{type:"path",points:[{x:0.39,y:0.26},{x:0.26,y:0.13}],color:"primary",fill:!1},"path44-8-7":{type:"path",points:[{x:0.2,y:0.32},{x:0.01,y:0.51}],color:"primary",fill:!1},"path44-0-7-1":{type:"path",points:[{x:0.52,y:0},{x:0.32,y:0.19}],color:"primary",fill:!1},"path40-4-8":{type:"path",points:[{x:0.32,y:-0.19},{x:0.26,y:-0.38}],color:"primary",fill:!1},"path41-1-4":{type:"path",points:[{x:0.13,y:-0.26},{x:0.32,y:-0.19}],color:"primary",fill:!1},"path42-7-0":{type:"path",points:[{x:0.26,y:-0.38},{x:0.13,y:-0.26}],color:"primary",fill:!1},"path43-1-0":{type:"path",points:[{x:0.26,y:-0.13},{x:0.39,y:-0.26}],color:"primary",fill:!1},"path44-8-9":{type:"path",points:[{x:0.19,y:-0.32},{x:0,y:-0.52}],color:"primary",fill:!1},"path44-0-7-3":{type:"path",points:[{x:0.5,y:-0.01},{x:0.32,y:-0.19}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.29,y:0.46},bottom1:{type:"text",text:"{VAL}",x:-0.29,y:-0.5}},refblocks:{top1:{x:0,y:0.52},bottom1:{x:0,y:-0.52},left1:{x:-0.52,y:0},right1:{x:0.52,y:0}},bounds:{minX:-0.55,maxX:0.55,minY:-0.55,maxY:0.55,width:1.09,height:1.09,centerX:0,centerY:0},circles:{}},{paths:P$o,texts:STt,bounds:axe,refblocks:PTt}=S$o,ZDt=Gl({primitives:[...Object.values(P$o),{...STt.bottom1,y:0.35,anchor:"middle_top"},{...STt.top1,anchor:"middle_left"}],ports:[{...PTt.left1,labels:["1"]},{...PTt.right1,labels:["2"]}],size:{width:axe.width+0.05,height:axe.height},center:{x:axe.centerX,y:axe.centerY}}),E$o=Ro(ZDt),M$o=E$o,w$o={paths:{path18:{type:"path",points:[{x:-0.53,y:0},{x:-0.27,y:0}],color:"primary",fill:!1},path19:{type:"path",points:[{x:0.26,y:0},{x:0.53,y:0}],color:"primary",fill:!1},path20:{type:"path",points:[{x:0,y:0.13},{x:0.26,y:0.13},{x:0.26,y:-0.13},{x:-0.27,y:-0.13},{x:-0.27,y:0.13},{x:0,y:0.13}],color:"primary",fill:!1},path24:{type:"path",points:[{x:0.29,y:-0.29},{x:0.26,y:-0.16},{x:0.16,y:-0.26},{x:0.29,y:-0.29}],color:"primary",fill:!0},path26:{type:"path",points:[{x:-0.3,y:0.29},{x:0.2,y:-0.2}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0.06,y:0.2},bottom1:{type:"text",text:"{VAL}",x:-0.1,y:-0.28}},refblocks:{left1:{x:-0.53,y:0},right1:{x:0.53,y:0}},bounds:{minX:-0.56,maxX:0.56,minY:-0.29,maxY:0.29,width:1.13,height:0.58,centerX:0,centerY:0},circles:{}},{paths:B$o,texts:ETt,bounds:cxe,refblocks:MTt}=w$o,_5e=Gl({primitives:[...Object.values(B$o),{...ETt.bottom1,x:0,y:-0.35,anchor:"middle_top"},{...ETt.top1,x:0,y:0.35,anchor:"middle_bottom"}],ports:[{...MTt.left1,labels:["1"]},{...MTt.right1,labels:["2"]}],size:{width:cxe.width+0.05,height:cxe.height},center:{x:cxe.centerX,y:cxe.centerY}}),AYe=Ro(_5e,"down"),fYe=AYe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),yYe=AYe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");fYe.anchor="middle_left";yYe.anchor="middle_left";fYe.y+=0.31;fYe.x=0.34;yYe.y-=0.31;yYe.x=0.34;T$o=AYe,xYe=Ro(_5e,"left"),CYe=xYe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),bYe=xYe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");CYe.anchor="middle_bottom";bYe.anchor="middle_top";CYe.y+=0.73;CYe.x=0;bYe.y-=0.7;bYe.x=0;D$o=xYe,IYe=Ro(_5e,"up"),vYe=IYe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),SYe=IYe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");vYe.anchor="middle_left";SYe.anchor="middle_left";vYe.y+=0.21;vYe.x=0.34;SYe.y-=0.21;SYe.x=0.34;N$o=IYe,g5e={paths:{path1:{type:"path",points:[{x:-0.42,y:0},{x:-0.3,y:0}],color:"primary",fill:!1},"path1-2-1":{type:"path",points:[{x:-0.3,y:0},{x:-0.25,y:0.1},{x:-0.15,y:-0.1},{x:-0.05,y:0.1},{x:0.05,y:-0.1},{x:0.15,y:0.1},{x:0.25,y:-0.1},{x:0.3,y:0}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.3,y:0},{x:0.42,y:0}],color:"primary",fill:!1},path3:{type:"path",points:[{x:0,y:-0.17},{x:0,y:-0.4}],color:"primary",fill:!1},path15:{type:"path",points:[{x:0,y:-0.12},{x:0.05,y:-0.2},{x:-0.05,y:-0.2},{x:0,y:-0.12}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:0.3,y:0.25},bottom1:{type:"text",text:"{VAL}",x:0.3,y:-0.25}},refblocks:{left:{x:-0.42,y:0},right:{x:0.42,y:0},bottom:{x:0,y:-0.4}},bounds:{minX:-0.42,maxX:0.42,minY:-0.2,maxY:0.2,width:0.84,height:0.4,centerX:0,centerY:0},circles:{}},{paths:R$o,texts:rRs,bounds:lxe,refblocks:vOe,circles:Q$o}=g5e,k$o=An({primitives:[...Object.values(R$o),...Object.values(Q$o),{type:"text",text:"{REF}",x:-0.15,y:0.2394553499999995},{type:"text",text:"{VAL}",x:0.15,y:0.2394553499999995}],ports:[{...vOe.left,labels:["1"]},{...vOe.right,labels:["3"]},{...vOe.bottom,labels:["2"]}],size:{width:lxe.width,height:lxe.height},center:{x:lxe.centerX,y:lxe.centerY}}).rotateRightFacingSymbol("down").labelPort("left",["1"]).labelPort("right",["2"]).labelPort("bottom",["3"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),{paths:L$o,texts:iRs,bounds:hxe,refblocks:SOe,circles:H$o}=g5e,F$o=An({primitives:[...Object.values(L$o),...Object.values(H$o),{type:"text",text:"{REF}",x:-0.3,y:-0.3894553499999995},{type:"text",text:"{VAL}",x:-0.3,y:0.3194553499999995}],ports:[{...SOe.left,labels:["1"]},{...SOe.right,labels:["3"]},{...SOe.bottom,labels:["2"]}],size:{width:hxe.width,height:hxe.height},center:{x:hxe.centerX,y:hxe.centerY}}).rotateRightFacingSymbol("left").labelPort("left",["1"]).labelPort("right",["2"]).labelPort("bottom",["3"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),z$o=An(g5e).labelPort("left",["1"]).labelPort("right",["3"]).labelPort("bottom",["2"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),{paths:O$o,texts:sRs,bounds:dxe,refblocks:POe,circles:V$o}=g5e,Y$o=An({primitives:[...Object.values(O$o),...Object.values(V$o),{type:"text",text:"{REF}",x:0.3,y:-0.2894553499999995},{type:"text",text:"{VAL}",x:-0.3,y:-0.2894553499999995}],ports:[{...POe.left,labels:["1"]},{...POe.right,labels:["3"]},{...POe.bottom,labels:["2"]}],size:{width:dxe.width,height:dxe.height},center:{x:dxe.centerX,y:dxe.centerY}}).rotateRightFacingSymbol("up").labelPort("left",["1"]).labelPort("right",["2"]).labelPort("bottom",["3"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),G$o={paths:{path11:{type:"path",points:[{x:-0.54,y:0.03},{x:-0.3,y:0.03}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.29,y:0.03},{x:0.54,y:0.03}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.16,y:0.4},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.4},left1:{type:"text",text:"COS φ",x:-0.15,y:0.01}},refblocks:{left1:{x:-0.54,y:0.03},right1:{x:0.54,y:0.03}},bounds:{minX:-0.57,maxX:0.57,minY:-0.4,maxY:0.4,width:1.14,height:0.79,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0,y:0.04,radius:0.29,color:"primary",fill:!1}}},{paths:U$o,texts:aRs,bounds:uxe,refblocks:wTt,circles:W$o}=G$o,eNt=Gl({primitives:[...Object.values(U$o),...Object.values(W$o),{type:"text",text:"{REF}",x:0,y:0.43330070000000065,anchor:"middle_bottom"},{type:"text",text:"{VAL}",x:0,y:-0.43330070000000065,anchor:"middle_top"},{type:"text",text:"COS φ",x:0,y:0.014279000000000375,anchor:"center"}],ports:[{...wTt.left1,labels:["1"]},{...wTt.right1,labels:["2"]}],size:{width:uxe.width,height:uxe.height},center:{x:uxe.centerX,y:uxe.centerY}}),tNt=Ro(eNt),PYe=tNt.primitives.filter((e)=>e.type==="text"),QOe=PYe.find((e)=>e.text==="{REF}"),EYe=PYe.find((e)=>e.text==="{VAL}"),kOe=PYe.find((e)=>e.text==="COS φ");QOe.x=0.35;QOe.y=0.4279000000000375,QOe.anchor="middle_left";EYe.anchor="middle_left";EYe.x=0.35;EYe.y=-0.4279000000000375,kOe.x=0;kOe.y=0.014279000000000375,kOe.anchor="center";X$o=tNt,j$o={paths:{"path12-1-8-6-9-9":{type:"path",points:[{x:0.01,y:0.03},{x:0.01,y:-0.09}],color:"primary",fill:!1},"path12-1-5-6-4":{type:"path",points:[{x:-0.47,y:-0.05},{x:-0.17,y:-0.05}],color:"primary",fill:!1},"path12-1-8-0-0":{type:"path",points:[{x:-0.16,y:-0.09},{x:0.18,y:-0.09}],color:"primary",fill:!1},"path12-1-0-1":{type:"path",points:[{x:0.2,y:-0.05},{x:0.47,y:-0.05}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0.01,y:0.22},bottom1:{type:"text",text:"{VAL}",x:-0.16,y:-0.22}},refblocks:{left1:{x:-0.47,y:-0.05},right1:{x:0.47,y:-0.05}},bounds:{minX:-0.5,maxX:0.5,minY:-0.22,maxY:0.22,width:1,height:0.45,centerX:0,centerY:0},circles:{"circle-2":{type:"circle",x:-0.14,y:-0.05,radius:0.02,color:"primary",fill:!1},circle:{type:"circle",x:0.17,y:-0.05,radius:0.02,color:"primary",fill:!1}}},{paths:K$o,texts:BTt,bounds:TTt,refblocks:DTt,circles:$$o}=j$o,nNt=Gl({primitives:[...Object.values(K$o),...Object.values($$o),{...BTt.top1,anchor:"middle_left"},{...BTt.bottom1,anchor:"middle_left"}],ports:[{...DTt.left1,labels:["1"]},{...DTt.right1,labels:["2"]}],center:{x:TTt.centerX,y:TTt.centerY}}),q$o=Ro(nNt,"up"),oNt={paths:{"path12-1-8-6-9-9":{type:"path",points:[{x:-0.05,y:0.09},{x:-0.05,y:0.04}],color:"primary",fill:!1},"path12-1-8-7-9-9":{type:"path",points:[{x:-0.05,y:0.09},{x:0.07,y:0.09}],color:"primary",fill:!1},"path12-1-8-6-9-10":{type:"path",points:[{x:0.07,y:0.09},{x:0.07,y:0.04}],color:"primary",fill:!1},"path12-1-5-6-4":{type:"path",points:[{x:-0.47,y:-0.05},{x:-0.17,y:-0.05}],color:"primary",fill:!1},"path12-1-8-0-0":{type:"path",points:[{x:-0.16,y:0.04},{x:0.18,y:0.04}],color:"primary",fill:!1},"path12-1-0-1":{type:"path",points:[{x:0.2,y:-0.05},{x:0.47,y:-0.05}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0.01,y:0.29},bottom1:{type:"text",text:"{VAL}",x:-0.16,y:-0.22}},refblocks:{left1:{x:-0.47,y:-0.05},right1:{x:0.47,y:-0.05}},bounds:{minX:-0.5,maxX:0.5,minY:-0.22,maxY:0.22,width:1,height:0.45,centerX:0,centerY:0},circles:{"circle-2":{type:"circle",x:-0.14,y:-0.05,radius:0.02,color:"primary",fill:!1},circle:{type:"circle",x:0.17,y:-0.05,radius:0.02,color:"primary",fill:!1}}},{paths:J$o,texts:NTt,bounds:Z$o,refblocks:EOe,circles:eqo}=oNt,oae=Gl({primitives:[...Object.values(J$o),...Object.values(eqo),{...NTt.top1,x:0,y:0.3594553499999995,anchor:"middle_bottom"},{...NTt.bottom1,x:0,y:-0.3594553499999995,anchor:"middle_top"}],ports:[{...EOe.left1,labels:["1"]},{...EOe.right1,labels:["2"]}],center:{x:Z$o.centerX,y:EOe.left1.y}}),MYe=Ro(oae,"down"),wYe=MYe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),BYe=MYe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");wYe.anchor="middle_bottom";BYe.anchor="middle_top";wYe.y=0.4;wYe.x=0.35;BYe.y=-0.4;BYe.x=0.35;tqo=MYe,{paths:nqo,texts:RTt,bounds:oqo,refblocks:MOe,circles:rqo}=oNt,iqo=Gl({primitives:[...Object.values(nqo),...Object.values(rqo),{...RTt.top1,x:0,y:0.3594553499999995,anchor:"middle_bottom"},{...RTt.bottom1,x:0,y:-0.3594553499999995,anchor:"middle_top"}],ports:[{...MOe.left1,labels:["1"]},{...MOe.right1,labels:["2"]}],center:{x:oqo.centerX,y:MOe.left1.y}}),TYe=Ro(oae,"left"),DYe=TYe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),NYe=TYe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");DYe.anchor="middle_bottom";NYe.anchor="middle_top";DYe.y=0.4;DYe.x=0;NYe.y=-0.4;NYe.x=0;sqo=TYe,RYe=Ro(oae,"up"),QYe=RYe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),kYe=RYe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");QYe.anchor="middle_left";kYe.anchor="middle_left";QYe.y+=0.4;QYe.x=0.34;kYe.y-=0.41;kYe.x=0.34;aqo=RYe,LYe=Ro(oae,"up"),HYe=LYe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),FYe=LYe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");HYe.anchor="middle_left";FYe.anchor="middle_left";HYe.y+=0.4;HYe.x=0.34;FYe.y-=0.41;FYe.x=0.34;cqo=LYe,A5e={paths:{path12_rotated:{type:"path",points:[{x:-0.09,y:0.12},{x:-0.09,y:-0.12}],color:"primary",fill:!1},path2_rotated:{type:"path",points:[{x:-0.09,y:0},{x:0.09,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.03}},refblocks:{left1:{x:0.09,y:0}},bounds:{minX:-0.57,maxX:0.57,minY:-0.37,maxY:0.37,width:1.14,height:0.74,centerX:0,centerY:0},circles:{}},{paths:lqo,texts:cRs,bounds:QTt,refblocks:hqo,circles:dqo}=A5e,uqo=An({primitives:[...Object.values(lqo),...Object.values(dqo),{type:"text",text:"{REF}",x:-0.14,y:-0}],ports:[{...hqo.left1,labels:["1"]}],center:{x:QTt.centerX,y:QTt.centerY}}).rotateRightFacingSymbol("up").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_top").build(),{paths:pqo,texts:lRs,bounds:kTt,refblocks:mqo,circles:_qo}=A5e,gqo=An({primitives:[...Object.values(pqo),...Object.values(_qo),{type:"text",text:"{REF}",x:-0.13,y:0}],ports:[{...mqo.left1,labels:["1"]}],center:{x:kTt.centerX,y:kTt.centerY}}).changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("right").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_right").build(),{paths:Aqo,texts:hRs,bounds:LTt,refblocks:fqo,circles:yqo}=A5e,xqo=An({primitives:[...Object.values(Aqo),...Object.values(yqo),{type:"text",text:"{REF}",x:-0.14,y:-0}],ports:[{...fqo.left1,labels:["1"]}],center:{x:LTt.centerX,y:LTt.centerY}}).rotateRightFacingSymbol("left").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_left").build(),{paths:Cqo,texts:dRs,bounds:HTt,refblocks:bqo}=A5e,Iqo=An({primitives:[...Object.values(Cqo),{type:"text",text:"{REF}",x:-0.14,y:0}],ports:[{...bqo.left1,labels:["1"]}],center:{x:HTt.centerX,y:HTt.centerY}}).rotateRightFacingSymbol("down").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_bottom").build(),vqo={paths:{path40:{type:"path",points:[{x:-0.19,y:-0.33},{x:-0.26,y:-0.14}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-0.38,y:-0.26},{x:-0.19,y:-0.33}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-0.26,y:-0.14},{x:-0.38,y:-0.26}],color:"primary",fill:!1},path43:{type:"path",points:[{x:-0.26,y:-0.39},{x:-0.13,y:-0.26}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-0.32,y:-0.2},{x:-0.52,y:0}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0,y:-0.52},{x:-0.19,y:-0.33}],color:"primary",fill:!1},"path40-4":{type:"path",points:[{x:-0.19,y:0.32},{x:-0.38,y:0.26}],color:"primary",fill:!1},"path41-1":{type:"path",points:[{x:-0.26,y:0.13},{x:-0.19,y:0.32}],color:"primary",fill:!1},"path42-7":{type:"path",points:[{x:-0.38,y:0.26},{x:-0.26,y:0.13}],color:"primary",fill:!1},"path43-1":{type:"path",points:[{x:-0.13,y:0.26},{x:-0.26,y:0.39}],color:"primary",fill:!1},"path44-8":{type:"path",points:[{x:-0.32,y:0.19},{x:-0.51,y:0.01}],color:"primary",fill:!1},"path44-0-7":{type:"path",points:[{x:-0.01,y:0.5},{x:-0.19,y:0.32}],color:"primary",fill:!1},"path40-4-0":{type:"path",points:[{x:0.32,y:-0.19},{x:0.13,y:-0.26}],color:"primary",fill:!1},"path41-1-2":{type:"path",points:[{x:0.26,y:-0.38},{x:0.32,y:-0.19}],color:"primary",fill:!1},"path42-7-1":{type:"path",points:[{x:0.13,y:-0.26},{x:0.26,y:-0.38}],color:"primary",fill:!1},"path43-1-8":{type:"path",points:[{x:0.39,y:-0.26},{x:0.26,y:-0.13}],color:"primary",fill:!1},"path44-8-7":{type:"path",points:[{x:0.2,y:-0.32},{x:0.01,y:-0.51}],color:"primary",fill:!1},"path44-0-7-1":{type:"path",points:[{x:0.52,y:0},{x:0.32,y:-0.19}],color:"primary",fill:!1},"path40-4-8":{type:"path",points:[{x:0.32,y:0.19},{x:0.26,y:0.38}],color:"primary",fill:!1},"path41-1-4":{type:"path",points:[{x:0.13,y:0.26},{x:0.32,y:0.19}],color:"primary",fill:!1},"path42-7-0":{type:"path",points:[{x:0.26,y:0.38},{x:0.13,y:0.26}],color:"primary",fill:!1},"path43-1-0":{type:"path",points:[{x:0.26,y:0.13},{x:0.39,y:0.26}],color:"primary",fill:!1},"path44-8-9":{type:"path",points:[{x:0.19,y:0.32},{x:0,y:0.52}],color:"primary",fill:!1},"path44-0-7-3":{type:"path",points:[{x:0.5,y:0.01},{x:0.32,y:0.19}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.29,y:-0.46},bottom1:{type:"text",text:"{VAL}",x:-0.29,y:0.5}},refblocks:{top1:{x:0,y:-0.52},bottom1:{x:0,y:0.52},left1:{x:-0.52,y:0},right1:{x:0.52,y:0}},bounds:{minX:-0.55,maxX:0.55,minY:-0.56,maxY:0.55,width:1.09,height:1.1,centerX:0,centerY:0},circles:{}},{paths:Sqo,texts:FTt,bounds:pxe,refblocks:mxe,circles:Pqo}=vqo,rNt=Gl({primitives:[...Object.values(Sqo),...Object.values(Pqo),{...FTt.top1,anchor:"middle_right"},{...FTt.bottom1,anchor:"middle_right"}],ports:[{...mxe.top1,labels:["1"]},{...mxe.bottom1,labels:["2"]},{...mxe.left1,labels:["3"]},{...mxe.right1,labels:["4"]}],size:{width:pxe.width,height:pxe.height},center:{x:pxe.centerX,y:pxe.centerY}}),zYe=Ro(rNt),Eqo=zYe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),Mqo=zYe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");Eqo.anchor="middle_left";Mqo.anchor="middle_right";wqo=zYe,f5e={paths:{path27:{type:"path",points:[{x:0.47,y:0.04},{x:0.21,y:0.04}],color:"primary",fill:!1},"path27-0":{type:"path",points:[{x:-0.21,y:0.04},{x:-0.47,y:0.04}],color:"primary",fill:!1},"path27-8-2-4":{type:"path",points:[{x:0.21,y:0.04},{x:0.19,y:-0.05}],color:"primary",fill:!1},"path27-8-2-4-29":{type:"path",points:[{x:-0.19,y:0.14},{x:-0.21,y:0.04}],color:"primary",fill:!1},"path27-8-2-4-5":{type:"path",points:[{x:0.19,y:-0.05},{x:0.13,y:0.14}],color:"primary",fill:!1},"path27-8-2-4-5-1":{type:"path",points:[{x:0.08,y:-0.05},{x:0.13,y:0.14}],color:"primary",fill:!1},"path27-8-2-4-5-1-9":{type:"path",points:[{x:0.08,y:-0.05},{x:0.03,y:0.14}],color:"primary",fill:!1},"path27-8-2-4-5-1-9-2":{type:"path",points:[{x:-0.03,y:-0.05},{x:0.03,y:0.14}],color:"primary",fill:!1},"path27-8-2-4-5-1-9-2-1":{type:"path",points:[{x:-0.03,y:-0.05},{x:-0.08,y:0.14}],color:"primary",fill:!1},"path27-8-2-4-5-1-9-2-1-2":{type:"path",points:[{x:-0.13,y:-0.05},{x:-0.08,y:0.14}],color:"primary",fill:!1},"path27-8-2-4-5-1-9-2-1-2-2":{type:"path",points:[{x:-0.13,y:-0.05},{x:-0.19,y:0.14}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.05,y:0.42},bottom1:{type:"text",text:"{VAL}",x:-0.04,y:-0.42}},refblocks:{left1:{x:-0.47,y:0.04},right1:{x:0.47,y:0.04}},bounds:{minX:-0.49,maxX:0.49,minY:-0.42,maxY:0.42,width:0.99,height:0.84,centerX:0,centerY:0},circles:{}},{paths:Bqo,texts:uRs,bounds:_xe,refblocks:zTt,circles:Tqo}=f5e,Dqo=An({primitives:[...Object.values(Bqo),...Object.values(Tqo),{type:"text",text:"{REF}",x:-0.2,y:0.2194553499999995},{type:"text",text:"{VAL}",x:0.2,y:0.2194553499999995}],ports:[{...zTt.left1,labels:["1"]},{...zTt.right1,labels:["2"]}],size:{width:_xe.width,height:_xe.height},center:{x:_xe.centerX,y:_xe.centerY}}).rotateRightFacingSymbol("down").labelPort("left",["1"]).labelPort("right",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),{paths:Nqo,texts:pRs,bounds:gxe,refblocks:OTt,circles:Rqo}=f5e,Qqo=An({primitives:[...Object.values(Nqo),...Object.values(Rqo),{type:"text",text:"{REF}",x:0,y:-0.1704553499999995},{type:"text",text:"{VAL}",x:0,y:0.2294553499999995}],ports:[{...OTt.left1,labels:["1"]},{...OTt.right1,labels:["2"]}],size:{width:gxe.width,height:gxe.height},center:{x:gxe.centerX,y:gxe.centerY}}).rotateRightFacingSymbol("left").labelPort("left",["1"]).labelPort("right",["2"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),{paths:kqo,texts:mRs,bounds:Axe,refblocks:VTt,circles:Lqo}=f5e,Hqo=An({primitives:[...Object.values(kqo),...Object.values(Lqo),{type:"text",text:"{REF}",x:0,y:0.2294553499999995},{type:"text",text:"{VAL}",x:0,y:-0.1704553499999995}],ports:[{...VTt.left1,labels:["1"]},{...VTt.right1,labels:["2"]}],size:{width:Axe.width,height:Axe.height},center:{x:Axe.centerX,y:Axe.centerY}}).rotateRightFacingSymbol("right").labelPort("left",["1"]).labelPort("right",["2"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),y5e={paths:{"left-lead":{type:"path",points:[{x:-0.25,y:0},{x:-0.16,y:0}],color:"primary",fill:!1,strokeWidth:0.02},zigzag:{type:"path",points:[{x:-0.16,y:0},{x:-0.12,y:0.095},{x:-0.07,y:-0.095},{x:-0.02,y:0.095},{x:0.02,y:-0.095},{x:0.07,y:0.095},{x:0.12,y:-0.095},{x:0.16,y:0}],color:"primary",fill:!1,strokeWidth:0.02},"right-lead":{type:"path",points:[{x:0.16,y:0},{x:0.25,y:0}],color:"primary",fill:!1,strokeWidth:0.02}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.25,anchor:"middle_bottom"},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.25,anchor:"middle_top"}},refblocks:{left1:{x:-0.25,y:0},right1:{x:0.25,y:0}},bounds:{minX:-0.25,maxX:0.25,minY:-0.25,maxY:0.25,width:0.5,height:0.5,centerX:0,centerY:0},circles:{}},Fqo=Fi(y5e,{kind:"resistor",orientation:"down"}),zqo=Fi(y5e,{kind:"resistor",orientation:"left"}),Oqo=Fi(y5e,{kind:"resistor",orientation:"right"}),Vqo=Fi(y5e,{kind:"resistor",orientation:"up"}),{paths:Yqo,texts:_Rs,bounds:fxe,refblocks:YTt,circles:Gqo}=f5e,Uqo=An({primitives:[...Object.values(Yqo),...Object.values(Gqo),{type:"text",text:"{REF}",x:0.2,y:-0.1404553499999995},{type:"text",text:"{VAL}",x:-0.2,y:-0.1494553499999995}],ports:[{...YTt.left1,labels:["1"]},{...YTt.right1,labels:["2"]}],size:{width:fxe.width,height:fxe.height},center:{x:fxe.centerX,y:fxe.centerY}}).rotateRightFacingSymbol("up").labelPort("left",["1"]).labelPort("right",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),x5e={paths:{"left-lead":{type:"path",points:[{x:-0.175,y:0},{x:-0.115,y:0}],color:"primary",fill:!1,strokeWidth:0.02},zigzag:{type:"path",points:[{x:-0.115,y:0},{x:-0.07,y:0.095},{x:-0.025,y:-0.095},{x:0.025,y:0.095},{x:0.07,y:-0.095},{x:0.115,y:0}],color:"primary",fill:!1,strokeWidth:0.02},"right-lead":{type:"path",points:[{x:0.115,y:0},{x:0.175,y:0}],color:"primary",fill:!1,strokeWidth:0.02}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.25,anchor:"middle_bottom"},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.25,anchor:"middle_top"}},refblocks:{left1:{x:-0.175,y:0},right1:{x:0.175,y:0}},bounds:{minX:-0.175,maxX:0.175,minY:-0.25,maxY:0.25,width:0.35,height:0.5,centerX:0,centerY:0},circles:{}},Wqo=Fi(x5e,{kind:"resistor",orientation:"down"}),Xqo=Fi(x5e,{kind:"resistor",orientation:"left"}),jqo=Fi(x5e,{kind:"resistor",orientation:"right"}),Kqo=Fi(x5e,{kind:"resistor",orientation:"up"}),iNt={paths:{path27:{type:"path",points:[{x:0.76,y:-0.28},{x:0.31,y:-0.28}],color:"primary",fill:!1},path28:{type:"path",points:[{x:-0.3,y:-0.02},{x:-0.77,y:-0.02}],color:"primary",fill:!1},path30:{type:"path",points:[{x:-0.3,y:0.35},{x:-0.3,y:-0.28}],color:"primary",fill:!1},"path27-3":{type:"path",points:[{x:0.77,y:0.35},{x:0.32,y:0.35}],color:"primary",fill:!1},"path29-5":{type:"path",points:[{x:-0.07,y:-0.28},{x:-0.3,y:-0.28}],color:"primary",fill:!1},"path29-5-7":{type:"path",points:[{x:0.33,y:-0.28},{x:0.11,y:-0.28}],color:"primary",fill:!1},"path29-5-7-6":{type:"path",points:[{x:-0.06,y:-0.17},{x:-0.06,y:-0.39}],color:"primary",fill:!1},"path29-5-7-6-6":{type:"path",points:[{x:0.09,y:-0.17},{x:0.09,y:-0.39}],color:"primary",fill:!1},"path29-5-9":{type:"path",points:[{x:-0.07,y:0.35},{x:-0.3,y:0.35}],color:"primary",fill:!1},"path29-5-7-2":{type:"path",points:[{x:0.33,y:0.35},{x:0.11,y:0.35}],color:"primary",fill:!1},"path29-5-7-6-0":{type:"path",points:[{x:-0.06,y:0.46},{x:-0.06,y:0.24}],color:"primary",fill:!1},"path29-5-7-6-6-2":{type:"path",points:[{x:0.09,y:0.46},{x:0.09,y:0.24}],color:"primary",fill:!1},"path29-5-92":{type:"path",points:[{x:0.33,y:0.13},{x:0.33,y:0.35}],color:"primary",fill:!1},"path29-5-7-28":{type:"path",points:[{x:0.33,y:-0.28},{x:0.33,y:-0.05}],color:"primary",fill:!1},"path29-5-7-6-9":{type:"path",points:[{x:0.44,y:0.11},{x:0.22,y:0.11}],color:"primary",fill:!1},"path29-5-7-6-6-7":{type:"path",points:[{x:0.44,y:-0.04},{x:0.22,y:-0.04}],color:"primary",fill:!1},"path29-5-7-6-9-2":{type:"path",points:[{x:0.44,y:0.07},{x:0.22,y:0.07}],color:"primary",fill:!1},"path29-5-7-6-9-2-4":{type:"path",points:[{x:0.44,y:0},{x:0.44,y:0.07}],color:"primary",fill:!1},"path29-5-7-6-9-2-4-6":{type:"path",points:[{x:0.22,y:0},{x:0.22,y:0.07}],color:"primary",fill:!1},"path29-5-7-6-9-2-9":{type:"path",points:[{x:0.44,y:0},{x:0.22,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0.02,y:0.53},bottom1:{type:"text",text:"{VAL}",x:0.01,y:-0.54}},refblocks:{left1:{x:-0.77,y:-0.02},right1:{x:0.76,y:-0.28},right2:{x:0.77,y:0.35}},bounds:{minX:-0.79,maxX:0.79,minY:-0.54,maxY:0.54,width:1.59,height:1.07,centerX:0,centerY:0},circles:{}},{paths:$qo,texts:GTt,bounds:yxe,refblocks:wOe,circles:qqo}=iNt,C5e=Gl({primitives:[...Object.values($qo),...Object.values(qqo),{...GTt.top1,anchor:"middle_bottom"},{...GTt.bottom1,anchor:"middle_top"}],ports:[{...wOe.left1,labels:["1"]},{...wOe.right1,labels:["2"]},{...wOe.right2,labels:["3"]}],size:{width:yxe.width,height:yxe.height},center:{x:yxe.centerX,y:yxe.centerY}}),OYe=Ro(C5e,"down"),VYe=OYe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),YYe=OYe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");VYe.anchor="middle_bottom";YYe.anchor="middle_top";VYe.y+=0.3;VYe.x+=0.101;YYe.y-=0.49999;YYe.x+=1.19999;Jqo=OYe,{paths:Zqo,texts:gRs,bounds:xxe,refblocks:BOe,circles:eJo}=iNt,sNt=Gl({primitives:[...Object.values(Zqo),...Object.values(eJo),{type:"text",text:"{REF}",x:0.01596175000000022,y:-0.5308501500000009,anchor:"middle_top"},{type:"text",text:"{VAL}",x:0.013116750000000454,y:0.5408501499999989,anchor:"middle_bottom"}],ports:[{...BOe.left1,labels:["1"]},{...BOe.right1,labels:["2"]},{...BOe.right2,labels:["3"]}],size:{width:xxe.width,height:xxe.height},center:{x:xxe.centerX,y:xxe.centerY}}),GYe=Ro(C5e,"left"),UYe=GYe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),WYe=GYe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");UYe.anchor="middle_bottom";WYe.anchor="middle_top";UYe.y+=0.99;UYe.x-=0;WYe.y-=1.10999;WYe.x=0;tJo=GYe,XYe=Ro(C5e,"up"),jYe=XYe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),KYe=XYe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");jYe.anchor="middle_bottom";KYe.anchor="middle_top";jYe.y+=0.499;jYe.x=0.62;KYe.y-=0.29999;KYe.x+=0.1;nJo=XYe,oJo=Ro(sNt),$Ye={paths:{"input-lead":{type:"path",points:[{x:-0.65,y:0.010000000000000231},{x:-0.30000000000000004,y:0.010000000000000231}],color:"primary",fill:!1},body:{type:"path",points:[{x:-0.30000000000000004,y:0.3600000000000001},{x:0.25,y:0.010000000000000231},{x:-0.30000000000000004,y:-0.33999999999999986},{x:-0.30000000000000004,y:0.3600000000000001}],color:"primary",fill:!1},"schmitt-marker":{type:"path",points:[{x:-0.17999999999999994,y:-0.08999999999999986},{x:-0.09999999999999987,y:-0.08999999999999986},{x:-0.09999999999999987,y:0.1100000000000001},{x:-0.019999999999999796,y:0.1100000000000001}],color:"primary",fill:!1},"output-lead":{type:"path",points:[{x:0.3800000000000001,y:0.010000000000000231},{x:0.6500000000000001,y:0.010000000000000231}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.4700000000000002},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.47}},refblocks:{left1:{x:-0.65,y:0.010000000000000231},right1:{x:0.6500000000000001,y:0.010000000000000231}},bounds:{minX:-0.65,maxX:0.6500000000000001,minY:-0.47,maxY:0.4700000000000002,width:1.3000000000000003,height:0.9400000000000002,centerX:0.00000000000000005551115123125783,centerY:0.00000000000000011102230246251565},circles:{"inversion-bubble":{type:"circle",x:0.31499999999999995,y:0.010000000000000231,radius:0.065,color:"primary",fill:!1}}},rJo=An($Ye).labelPort("left1",["1","in","input","a"]).labelPort("right1",["2","out","output","y"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("down").build(),aNt=An($Ye).labelPort("left1",["1","in","input","a"]).labelPort("right1",["2","out","output","y"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("right").build(),iJo=Y9(aNt),sJo=An($Ye).labelPort("left1",["1","in","input","a"]).labelPort("right1",["2","out","output","y"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("up").build(),aJo={paths:{path40:{type:"path",points:[{x:0.14,y:0.04},{x:-0.12,y:-0.09}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-0.12,y:0.18},{x:0.14,y:0.04}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-0.12,y:-0.09},{x:-0.12,y:0.18}],color:"primary",fill:!1},path43:{type:"path",points:[{x:0.14,y:0.18},{x:0.14,y:-0.09}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-0.12,y:0.04},{x:-0.52,y:0.04}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.52,y:0.04},{x:0.15,y:0.04}],color:"primary",fill:!1},"path43-7":{type:"path",points:[{x:0.21,y:0.18},{x:0.14,y:0.18}],color:"primary",fill:!1},"path43-7-9":{type:"path",points:[{x:0.21,y:0.13},{x:0.21,y:0.18}],color:"primary",fill:!1},"path43-7-2":{type:"path",points:[{x:0.08,y:-0.09},{x:0.14,y:-0.09}],color:"primary",fill:!1},"path43-7-9-3":{type:"path",points:[{x:0.08,y:-0.04},{x:0.08,y:-0.09}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.01,y:0.27},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.27}},refblocks:{left1:{x:-0.52,y:0.04},right1:{x:0.52,y:0.04}},bounds:{minX:-0.55,maxX:0.55,minY:-0.27,maxY:0.27,width:1.09,height:0.55,centerX:0,centerY:0},circles:{}},b5e=An(aJo).labelPort("left1",["1","pos"]).labelPort("right1",["2","neg"]).changeTextAnchor("{VAL}","middle_top").changeTextAnchor("{REF}","middle_bottom").build(),qYe=Ro(b5e,"down"),JYe=qYe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),ZYe=qYe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");JYe.anchor="middle_left";ZYe.anchor="middle_left";JYe.y+=0.3;JYe.x=0.3;ZYe.y-=0.3;ZYe.x=0.3;cJo=qYe,eGe=Ro(b5e,"left"),tGe=eGe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),nGe=eGe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");tGe.anchor="middle_bottom";nGe.anchor="middle_top";tGe.y+=0.5;tGe.x=0;nGe.y-=0.55;nGe.x=0;lJo=eGe,oGe=Ro(b5e,"up"),rGe=oGe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),iGe=oGe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");rGe.anchor="middle_left";iGe.anchor="middle_left";rGe.y+=0.3;rGe.x=0.3;iGe.y-=0.3;iGe.x=0.3;hJo=oGe,cNt={paths:{path11:{type:"path",points:[{x:-0.52,y:0.04},{x:-0.18,y:0.04}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.19,y:0.05},{x:0.52,y:0.05}],color:"primary",fill:!1},"path12-6":{type:"path",points:[{x:0.18,y:-0.15},{x:0.18,y:0.25}],color:"primary",fill:!1},"path12-2":{type:"path",points:[{x:0.19,y:0},{x:0.35,y:-0.14}],color:"primary",fill:!1},"path12-2-9":{type:"path",points:[{x:0.35,y:-0.14},{x:0.34,y:-0.35}],color:"primary",fill:!1},"path11-0-9":{type:"path",points:[{x:-0.17,y:0.27},{x:-0.17,y:-0.15},{x:0.18,y:0.05},{x:-0.17,y:0.27}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-0.22,y:0.38},bottom1:{type:"text",text:"{VAL}",x:0.11,y:-0.38}},refblocks:{bottom1:{x:0.34,y:-0.35},left1:{x:-0.52,y:0.04},right1:{x:0.52,y:0.05}},bounds:{minX:-0.55,maxX:0.55,minY:-0.38,maxY:0.38,width:1.09,height:0.77,centerX:0,centerY:0},circles:{}},{paths:ARs,texts:fRs,bounds:yRs,refblocks:xRs,circles:CRs}=cNt,lNt=An(cNt).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1"]).labelPort("right1",["2"]).labelPort("bottom1",["3"]).changeTextAnchor("{REF}","middle_bottom").build(),hNt=Ro(lNt),dJo=hNt.primitives.filter((e)=>e.type==="text"),dNt=dJo.find((e)=>e.text==="{REF}");dNt.y=0;dNt.anchor="middle_left";uJo=hNt,uNt={paths:{path44:{type:"path",points:[{x:-0.195,y:-0.025},{x:-0.45,y:-0.025}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.45,y:-0.025},{x:0.195,y:-0.025}],color:"primary",fill:!1},"path44-0-7":{type:"path",points:[{x:0.07,y:-0.025},{x:-0.07,y:-0.025}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.07,y:0.1},{x:0.07,y:-0.15}],color:"primary",fill:!0},"path2-8":{type:"path",points:[{x:-0.07,y:0.1},{x:-0.07,y:-0.15}],color:"primary",fill:!0},"path8704-1":{type:"path",points:[{x:-0.07,y:0.1},{x:-0.082252,y:0.099398},{x:-0.094386,y:0.097598},{x:-0.106286,y:0.094618},{x:-0.117835,y:0.090485},{x:-0.128925,y:0.08524},{x:-0.139446,y:0.078934},{x:-0.149299,y:0.071626},{x:-0.158388,y:0.063388},{x:-0.166626,y:0.054299},{x:-0.173934,y:0.044446},{x:-0.18024,y:0.033925},{x:-0.185485,y:0.022835},{x:-0.189618,y:0.011286},{x:-0.192598,y:-0.000614},{x:-0.194398,y:-0.012748},{x:-0.195,y:-0.025},{x:-0.194398,y:-0.037252},{x:-0.192598,y:-0.049386},{x:-0.189618,y:-0.061286},{x:-0.185485,y:-0.072835},{x:-0.18024,y:-0.083925},{x:-0.173934,y:-0.094446},{x:-0.166626,y:-0.104299},{x:-0.158388,y:-0.113388},{x:-0.149299,y:-0.121626},{x:-0.139446,y:-0.128934},{x:-0.128925,y:-0.13524},{x:-0.117835,y:-0.140485},{x:-0.106286,y:-0.144618},{x:-0.094386,y:-0.147598},{x:-0.082252,y:-0.149398},{x:-0.07,y:-0.15}],color:"primary",fill:!1},"path8704-1-7":{type:"path",points:[{x:0.07,y:0.1},{x:0.082252,y:0.099398},{x:0.094386,y:0.097598},{x:0.106286,y:0.094618},{x:0.117835,y:0.090485},{x:0.128925,y:0.08524},{x:0.139446,y:0.078934},{x:0.149299,y:0.071626},{x:0.158388,y:0.063388},{x:0.166626,y:0.054299},{x:0.173934,y:0.044446},{x:0.18024,y:0.033925},{x:0.185485,y:0.022835},{x:0.189618,y:0.011286},{x:0.192598,y:-0.000614},{x:0.194398,y:-0.012748},{x:0.195,y:-0.025},{x:0.194398,y:-0.037252},{x:0.192598,y:-0.049386},{x:0.189618,y:-0.061286},{x:0.185485,y:-0.072835},{x:0.18024,y:-0.083925},{x:0.173934,y:-0.094446},{x:0.166626,y:-0.104299},{x:0.158388,y:-0.113388},{x:0.149299,y:-0.121626},{x:0.139446,y:-0.128934},{x:0.128925,y:-0.13524},{x:0.117835,y:-0.140485},{x:0.106286,y:-0.144618},{x:0.094386,y:-0.147598},{x:0.082252,y:-0.149398},{x:0.07,y:-0.15}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.020635199999998965,y:0.15414649999999952}},refblocks:{left1:{x:-0.4458008,y:-0.025023700000000426},right1:{x:0.4458008,y:-0.02514810000000045}},bounds:{minX:-0.45,maxX:0.45,minY:-0.15,maxY:0.1,width:0.9,height:0.25,centerX:0,centerY:-0.025},circles:{}},pJo=An(uNt).rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").build(),sGe=An(uNt).rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),pNt=Ro(sGe,"left"),aGe=pNt.primitives.find((e)=>e.type==="text"&&e.text==="{REF}");aGe.anchor="middle_bottom";aGe.y+=0.4;aGe.x=0;mJo=pNt,mNt=Ro(sGe,"up"),cGe=mNt.primitives.find((e)=>e.type==="text"&&e.text==="{REF}");cGe.anchor="middle_left";cGe.y+=0;cGe.x=0.2;_Jo=mNt,_Nt={paths:{path44:{type:"path",points:[{x:-0.195,y:-0.025},{x:-0.45,y:-0.025}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.45,y:-0.025},{x:0.195,y:-0.025}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.07,y:0.1},{x:0.07,y:-0.15}],color:"primary",fill:!0},"path2-8":{type:"path",points:[{x:-0.07,y:0.1},{x:-0.07,y:-0.15}],color:"primary",fill:!0},"path8704-1":{type:"path",points:[{x:-0.07,y:0.1},{x:-0.082252,y:0.099398},{x:-0.094386,y:0.097598},{x:-0.106286,y:0.094618},{x:-0.117835,y:0.090485},{x:-0.128925,y:0.08524},{x:-0.139446,y:0.078934},{x:-0.149299,y:0.071626},{x:-0.158388,y:0.063388},{x:-0.166626,y:0.054299},{x:-0.173934,y:0.044446},{x:-0.18024,y:0.033925},{x:-0.185485,y:0.022835},{x:-0.189618,y:0.011286},{x:-0.192598,y:-0.000614},{x:-0.194398,y:-0.012748},{x:-0.195,y:-0.025},{x:-0.194398,y:-0.037252},{x:-0.192598,y:-0.049386},{x:-0.189618,y:-0.061286},{x:-0.185485,y:-0.072835},{x:-0.18024,y:-0.083925},{x:-0.173934,y:-0.094446},{x:-0.166626,y:-0.104299},{x:-0.158388,y:-0.113388},{x:-0.149299,y:-0.121626},{x:-0.139446,y:-0.128934},{x:-0.128925,y:-0.13524},{x:-0.117835,y:-0.140485},{x:-0.106286,y:-0.144618},{x:-0.094386,y:-0.147598},{x:-0.082252,y:-0.149398},{x:-0.07,y:-0.15}],color:"primary",fill:!1},"path8704-1-7":{type:"path",points:[{x:0.07,y:0.1},{x:0.082252,y:0.099398},{x:0.094386,y:0.097598},{x:0.106286,y:0.094618},{x:0.117835,y:0.090485},{x:0.128925,y:0.08524},{x:0.139446,y:0.078934},{x:0.149299,y:0.071626},{x:0.158388,y:0.063388},{x:0.166626,y:0.054299},{x:0.173934,y:0.044446},{x:0.18024,y:0.033925},{x:0.185485,y:0.022835},{x:0.189618,y:0.011286},{x:0.192598,y:-0.000614},{x:0.194398,y:-0.012748},{x:0.195,y:-0.025},{x:0.194398,y:-0.037252},{x:0.192598,y:-0.049386},{x:0.189618,y:-0.061286},{x:0.185485,y:-0.072835},{x:0.18024,y:-0.083925},{x:0.173934,y:-0.094446},{x:0.166626,y:-0.104299},{x:0.158388,y:-0.113388},{x:0.149299,y:-0.121626},{x:0.139446,y:-0.128934},{x:0.128925,y:-0.13524},{x:0.117835,y:-0.140485},{x:0.106286,y:-0.144618},{x:0.094386,y:-0.147598},{x:0.082252,y:-0.149398},{x:0.07,y:-0.15}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.020635199999998965,y:0.15414649999999952}},refblocks:{left1:{x:-0.44,y:-0.02},right1:{x:0.4458008,y:-0.02514810000000045}},bounds:{minX:-0.45,maxX:0.45,minY:-0.15,maxY:0.1,width:0.9,height:0.25,centerX:0,centerY:-0.025},circles:{}},gJo=An(_Nt).rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").build(),lGe=An(_Nt).rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),gNt=Ro(lGe,"left"),hGe=gNt.primitives.find((e)=>e.type==="text"&&e.text==="{REF}");hGe.anchor="middle_bottom";hGe.y+=0.4;hGe.x=0;AJo=gNt,ANt=Ro(lGe,"up"),dGe=ANt.primitives.find((e)=>e.type==="text"&&e.text==="{REF}");dGe.anchor="middle_left";dGe.y+=0.05;dGe.x=0.2;fJo=ANt,fNt={paths:{path44:{type:"path",points:[{x:-0.25,y:0.1},{x:-0.45,y:0.1}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.45,y:0.1},{x:0.25,y:0.1}],color:"primary",fill:!1},"path44-5":{type:"path",points:[{x:0,y:-0.025},{x:0,y:-0.275}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.125,y:0.225},{x:0.125,y:-0.025}],color:"primary",fill:!0},"path2-88":{type:"path",points:[{x:0.045,y:0.225},{x:0.045,y:-0.025}],color:"primary",fill:!0},"path2-88-5":{type:"path",points:[{x:-0.045,y:0.225},{x:-0.045,y:-0.025}],color:"primary",fill:!0},"path2-88-5-1":{type:"path",points:[{x:0.045,y:0.225},{x:-0.045,y:0.225}],color:"primary",fill:!0},"path2-88-5-1-6":{type:"path",points:[{x:0.045,y:-0.025},{x:-0.045,y:-0.025}],color:"primary",fill:!0},"path2-8":{type:"path",points:[{x:-0.125,y:0.225},{x:-0.125,y:-0.025}],color:"primary",fill:!0},"path8704-1":{type:"path",points:[{x:-0.125,y:0.225},{x:-0.137252,y:0.224398},{x:-0.149386,y:0.222598},{x:-0.161286,y:0.219618},{x:-0.172835,y:0.215485},{x:-0.183925,y:0.21024},{x:-0.194446,y:0.203934},{x:-0.204299,y:0.196626},{x:-0.213388,y:0.188388},{x:-0.221626,y:0.179299},{x:-0.228934,y:0.169446},{x:-0.23524,y:0.158925},{x:-0.240485,y:0.147835},{x:-0.244618,y:0.136286},{x:-0.247598,y:0.124386},{x:-0.249398,y:0.112252},{x:-0.25,y:0.1},{x:-0.249398,y:0.087748},{x:-0.247598,y:0.075614},{x:-0.244618,y:0.063714},{x:-0.240485,y:0.052165},{x:-0.23524,y:0.041075},{x:-0.228934,y:0.030554},{x:-0.221626,y:0.020701},{x:-0.213388,y:0.011612},{x:-0.204299,y:0.003374},{x:-0.194446,y:-0.003934},{x:-0.183925,y:-0.01024},{x:-0.172835,y:-0.015485},{x:-0.161286,y:-0.019618},{x:-0.149386,y:-0.022598},{x:-0.137252,y:-0.024398},{x:-0.125,y:-0.025}],color:"primary",fill:!1},"path8704-1-7":{type:"path",points:[{x:0.125,y:0.225},{x:0.137252,y:0.224398},{x:0.149386,y:0.222598},{x:0.161286,y:0.219618},{x:0.172835,y:0.215485},{x:0.183925,y:0.21024},{x:0.194446,y:0.203934},{x:0.204299,y:0.196626},{x:0.213388,y:0.188388},{x:0.221626,y:0.179299},{x:0.228934,y:0.169446},{x:0.23524,y:0.158925},{x:0.240485,y:0.147835},{x:0.244618,y:0.136286},{x:0.247598,y:0.124386},{x:0.249398,y:0.112252},{x:0.25,y:0.1},{x:0.249398,y:0.087748},{x:0.247598,y:0.075614},{x:0.244618,y:0.063714},{x:0.240485,y:0.052165},{x:0.23524,y:0.041075},{x:0.228934,y:0.030554},{x:0.221626,y:0.020701},{x:0.213388,y:0.011612},{x:0.204299,y:0.003374},{x:0.194446,y:-0.003934},{x:0.183925,y:-0.01024},{x:0.172835,y:-0.015485},{x:0.161286,y:-0.019618},{x:0.149386,y:-0.022598},{x:0.137252,y:-0.024398},{x:0.125,y:-0.025}],color:"primary",fill:!1},path1:{type:"path",points:[{x:-0.045,y:0.1},{x:-0.125,y:0.1}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.020635199999998965,y:0.28075747049999955}},refblocks:{left1:{x:-0.45,y:0.1},right1:{x:0.45,y:0.1},bottom1:{x:0,y:-0.275}},bounds:{minX:-0.45,maxX:0.45,minY:-0.28,maxY:0.28,width:0.9,height:0.56,centerX:0,centerY:0},circles:{}},yJo=An(fNt).rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("bottom1",["2"]).labelPort("right1",["3"]).changeTextAnchor("{REF}","middle_left").build(),uGe=An(fNt).rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("bottom1",["2"]).labelPort("right1",["3"]).changeTextAnchor("{REF}","middle_bottom").build(),yNt=Ro(uGe,"left"),pGe=yNt.primitives.find((e)=>e.type==="text"&&e.text==="{REF}");pGe.anchor="middle_left";pGe.y+=0.5;pGe.x=0.2;xJo=yNt,xNt=Ro(uGe,"up"),mGe=xNt.primitives.find((e)=>e.type==="text"&&e.text==="{REF}");mGe.anchor="middle_left";mGe.y+=0.3;mGe.x=0.2;CJo=xNt,CNt={paths:{path44:{type:"path",points:[{x:-0.25,y:0.1},{x:-0.45,y:0.1}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.45,y:0.1},{x:0.25,y:0.1}],color:"primary",fill:!1},"path44-5":{type:"path",points:[{x:0,y:-0.025},{x:0,y:-0.275}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.125,y:0.225},{x:0.125,y:-0.025}],color:"primary",fill:!0},"path2-88":{type:"path",points:[{x:0.045,y:0.225},{x:0.045,y:-0.025}],color:"primary",fill:!0},"path2-88-5":{type:"path",points:[{x:-0.045,y:0.225},{x:-0.045,y:-0.025}],color:"primary",fill:!0},"path2-88-5-1":{type:"path",points:[{x:0.045,y:0.225},{x:-0.045,y:0.225}],color:"primary",fill:!0},"path2-88-5-1-6":{type:"path",points:[{x:0.045,y:-0.025},{x:-0.045,y:-0.025}],color:"primary",fill:!0},"path2-8":{type:"path",points:[{x:-0.125,y:0.225},{x:-0.125,y:-0.025}],color:"primary",fill:!0},"path8704-1":{type:"path",points:[{x:-0.125,y:0.225},{x:-0.137252,y:0.224398},{x:-0.149386,y:0.222598},{x:-0.161286,y:0.219618},{x:-0.172835,y:0.215485},{x:-0.183925,y:0.21024},{x:-0.194446,y:0.203934},{x:-0.204299,y:0.196626},{x:-0.213388,y:0.188388},{x:-0.221626,y:0.179299},{x:-0.228934,y:0.169446},{x:-0.23524,y:0.158925},{x:-0.240485,y:0.147835},{x:-0.244618,y:0.136286},{x:-0.247598,y:0.124386},{x:-0.249398,y:0.112252},{x:-0.25,y:0.1},{x:-0.249398,y:0.087748},{x:-0.247598,y:0.075614},{x:-0.244618,y:0.063714},{x:-0.240485,y:0.052165},{x:-0.23524,y:0.041075},{x:-0.228934,y:0.030554},{x:-0.221626,y:0.020701},{x:-0.213388,y:0.011612},{x:-0.204299,y:0.003374},{x:-0.194446,y:-0.003934},{x:-0.183925,y:-0.01024},{x:-0.172835,y:-0.015485},{x:-0.161286,y:-0.019618},{x:-0.149386,y:-0.022598},{x:-0.137252,y:-0.024398},{x:-0.125,y:-0.025}],color:"primary",fill:!1},"path8704-1-7":{type:"path",points:[{x:0.125,y:0.225},{x:0.137252,y:0.224398},{x:0.149386,y:0.222598},{x:0.161286,y:0.219618},{x:0.172835,y:0.215485},{x:0.183925,y:0.21024},{x:0.194446,y:0.203934},{x:0.204299,y:0.196626},{x:0.213388,y:0.188388},{x:0.221626,y:0.179299},{x:0.228934,y:0.169446},{x:0.23524,y:0.158925},{x:0.240485,y:0.147835},{x:0.244618,y:0.136286},{x:0.247598,y:0.124386},{x:0.249398,y:0.112252},{x:0.25,y:0.1},{x:0.249398,y:0.087748},{x:0.247598,y:0.075614},{x:0.244618,y:0.063714},{x:0.240485,y:0.052165},{x:0.23524,y:0.041075},{x:0.228934,y:0.030554},{x:0.221626,y:0.020701},{x:0.213388,y:0.011612},{x:0.204299,y:0.003374},{x:0.194446,y:-0.003934},{x:0.183925,y:-0.01024},{x:0.172835,y:-0.015485},{x:0.161286,y:-0.019618},{x:0.149386,y:-0.022598},{x:0.137252,y:-0.024398},{x:0.125,y:-0.025}],color:"primary",fill:!1},path1:{type:"path",points:[{x:-0.045,y:0.1},{x:-0.125,y:0.1}],color:"primary",fill:!1},"path44-0-7":{type:"path",points:[{x:0.125,y:0.1},{x:0.045,y:0.1}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.28}},refblocks:{left1:{x:-0.45,y:0.1},right1:{x:0.45,y:0.1},bottom1:{x:0,y:-0.275}},bounds:{minX:-0.45,maxX:0.45,minY:-0.28,maxY:0.28,width:0.9,height:0.56,centerX:0,centerY:0},circles:{}},bJo=An(CNt).rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("bottom1",["2"]).labelPort("right1",["3"]).changeTextAnchor("{REF}","middle_left").build(),_Ge=An(CNt).rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("bottom1",["2"]).labelPort("right1",["3"]).changeTextAnchor("{REF}","middle_bottom").build(),bNt=Ro(_Ge,"left"),gGe=bNt.primitives.find((e)=>e.type==="text"&&e.text==="{REF}");gGe.anchor="middle_left";gGe.y+=0.5;gGe.x=0.2;IJo=bNt,INt=Ro(_Ge,"up"),AGe=INt.primitives.find((e)=>e.type==="text"&&e.text==="{REF}");AGe.anchor="middle_left";AGe.y+=0.4;AGe.x=0.2;vJo=INt,vNt={paths:{path44:{type:"path",points:[{x:-0.25,y:0.1},{x:-0.45,y:0.1}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.45,y:0.1},{x:0.25,y:0.1}],color:"primary",fill:!1},"path44-5":{type:"path",points:[{x:0,y:-0.025},{x:0,y:-0.275}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.125,y:0.225},{x:0.125,y:-0.025}],color:"primary",fill:!0},"path2-88":{type:"path",points:[{x:0.045,y:0.225},{x:0.045,y:-0.025}],color:"primary",fill:!0},"path2-88-5":{type:"path",points:[{x:-0.045,y:0.225},{x:-0.045,y:-0.025}],color:"primary",fill:!0},"path2-88-5-1":{type:"path",points:[{x:0.045,y:0.225},{x:-0.045,y:0.225}],color:"primary",fill:!0},"path2-88-5-1-6":{type:"path",points:[{x:0.045,y:-0.025},{x:-0.045,y:-0.025}],color:"primary",fill:!0},"path2-8":{type:"path",points:[{x:-0.125,y:0.225},{x:-0.125,y:-0.025}],color:"primary",fill:!0},"path8704-1":{type:"path",points:[{x:-0.125,y:0.225},{x:-0.137252,y:0.224398},{x:-0.149386,y:0.222598},{x:-0.161286,y:0.219618},{x:-0.172835,y:0.215485},{x:-0.183925,y:0.21024},{x:-0.194446,y:0.203934},{x:-0.204299,y:0.196626},{x:-0.213388,y:0.188388},{x:-0.221626,y:0.179299},{x:-0.228934,y:0.169446},{x:-0.23524,y:0.158925},{x:-0.240485,y:0.147835},{x:-0.244618,y:0.136286},{x:-0.247598,y:0.124386},{x:-0.249398,y:0.112252},{x:-0.25,y:0.1},{x:-0.249398,y:0.087748},{x:-0.247598,y:0.075614},{x:-0.244618,y:0.063714},{x:-0.240485,y:0.052165},{x:-0.23524,y:0.041075},{x:-0.228934,y:0.030554},{x:-0.221626,y:0.020701},{x:-0.213388,y:0.011612},{x:-0.204299,y:0.003374},{x:-0.194446,y:-0.003934},{x:-0.183925,y:-0.01024},{x:-0.172835,y:-0.015485},{x:-0.161286,y:-0.019618},{x:-0.149386,y:-0.022598},{x:-0.137252,y:-0.024398},{x:-0.125,y:-0.025}],color:"primary",fill:!1},"path8704-1-7":{type:"path",points:[{x:0.125,y:0.225},{x:0.137252,y:0.224398},{x:0.149386,y:0.222598},{x:0.161286,y:0.219618},{x:0.172835,y:0.215485},{x:0.183925,y:0.21024},{x:0.194446,y:0.203934},{x:0.204299,y:0.196626},{x:0.213388,y:0.188388},{x:0.221626,y:0.179299},{x:0.228934,y:0.169446},{x:0.23524,y:0.158925},{x:0.240485,y:0.147835},{x:0.244618,y:0.136286},{x:0.247598,y:0.124386},{x:0.249398,y:0.112252},{x:0.25,y:0.1},{x:0.249398,y:0.087748},{x:0.247598,y:0.075614},{x:0.244618,y:0.063714},{x:0.240485,y:0.052165},{x:0.23524,y:0.041075},{x:0.228934,y:0.030554},{x:0.221626,y:0.020701},{x:0.213388,y:0.011612},{x:0.204299,y:0.003374},{x:0.194446,y:-0.003934},{x:0.183925,y:-0.01024},{x:0.172835,y:-0.015485},{x:0.161286,y:-0.019618},{x:0.149386,y:-0.022598},{x:0.137252,y:-0.024398},{x:0.125,y:-0.025}],color:"primary",fill:!1},"path44-0-7":{type:"path",points:[{x:0.125,y:0.1},{x:0.045,y:0.1}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.28}},refblocks:{left1:{x:-0.45,y:0.1},right1:{x:0.45,y:0.1},bottom1:{x:0,y:-0.275}},bounds:{minX:-0.45,maxX:0.45,minY:-0.28,maxY:0.28,width:0.9,height:0.56,centerX:0,centerY:0},circles:{}},SJo=An(vNt).rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("bottom1",["2"]).labelPort("right1",["3"]).changeTextAnchor("{REF}","middle_left").build(),fGe=An(vNt).rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("bottom1",["2"]).labelPort("right1",["3"]).changeTextAnchor("{REF}","middle_bottom").build(),SNt=Ro(fGe,"left"),yGe=SNt.primitives.find((e)=>e.type==="text"&&e.text==="{REF}");yGe.anchor="middle_left";yGe.y+=0.6;yGe.x=0.3;PJo=SNt,PNt=Ro(fGe,"up"),xGe=PNt.primitives.find((e)=>e.type==="text"&&e.text==="{REF}");xGe.anchor="middle_left";xGe.y+=0.4;xGe.x=0.2;EJo=PNt,ENt={paths:{path44:{type:"path",points:[{x:-0.25,y:0.1},{x:-0.45,y:0.1}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.45,y:0.1},{x:0.25,y:0.1}],color:"primary",fill:!1},"path44-5":{type:"path",points:[{x:0,y:-0.025},{x:0,y:-0.275}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.125,y:0.225},{x:0.125,y:-0.025}],color:"primary",fill:!0},"path2-88":{type:"path",points:[{x:0.045,y:0.225},{x:0.045,y:-0.025}],color:"primary",fill:!0},"path2-88-5":{type:"path",points:[{x:-0.045,y:0.225},{x:-0.045,y:-0.025}],color:"primary",fill:!0},"path2-88-5-1":{type:"path",points:[{x:0.045,y:0.225},{x:-0.045,y:0.225}],color:"primary",fill:!0},"path2-88-5-1-6":{type:"path",points:[{x:0.045,y:-0.025},{x:-0.045,y:-0.025}],color:"primary",fill:!0},"path2-8":{type:"path",points:[{x:-0.125,y:0.225},{x:-0.125,y:-0.025}],color:"primary",fill:!0},"path8704-1":{type:"path",points:[{x:-0.125,y:0.225},{x:-0.137252,y:0.224398},{x:-0.149386,y:0.222598},{x:-0.161286,y:0.219618},{x:-0.172835,y:0.215485},{x:-0.183925,y:0.21024},{x:-0.194446,y:0.203934},{x:-0.204299,y:0.196626},{x:-0.213388,y:0.188388},{x:-0.221626,y:0.179299},{x:-0.228934,y:0.169446},{x:-0.23524,y:0.158925},{x:-0.240485,y:0.147835},{x:-0.244618,y:0.136286},{x:-0.247598,y:0.124386},{x:-0.249398,y:0.112252},{x:-0.25,y:0.1},{x:-0.249398,y:0.087748},{x:-0.247598,y:0.075614},{x:-0.244618,y:0.063714},{x:-0.240485,y:0.052165},{x:-0.23524,y:0.041075},{x:-0.228934,y:0.030554},{x:-0.221626,y:0.020701},{x:-0.213388,y:0.011612},{x:-0.204299,y:0.003374},{x:-0.194446,y:-0.003934},{x:-0.183925,y:-0.01024},{x:-0.172835,y:-0.015485},{x:-0.161286,y:-0.019618},{x:-0.149386,y:-0.022598},{x:-0.137252,y:-0.024398},{x:-0.125,y:-0.025}],color:"primary",fill:!1},"path8704-1-7":{type:"path",points:[{x:0.125,y:0.225},{x:0.137252,y:0.224398},{x:0.149386,y:0.222598},{x:0.161286,y:0.219618},{x:0.172835,y:0.215485},{x:0.183925,y:0.21024},{x:0.194446,y:0.203934},{x:0.204299,y:0.196626},{x:0.213388,y:0.188388},{x:0.221626,y:0.179299},{x:0.228934,y:0.169446},{x:0.23524,y:0.158925},{x:0.240485,y:0.147835},{x:0.244618,y:0.136286},{x:0.247598,y:0.124386},{x:0.249398,y:0.112252},{x:0.25,y:0.1},{x:0.249398,y:0.087748},{x:0.247598,y:0.075614},{x:0.244618,y:0.063714},{x:0.240485,y:0.052165},{x:0.23524,y:0.041075},{x:0.228934,y:0.030554},{x:0.221626,y:0.020701},{x:0.213388,y:0.011612},{x:0.204299,y:0.003374},{x:0.194446,y:-0.003934},{x:0.183925,y:-0.01024},{x:0.172835,y:-0.015485},{x:0.161286,y:-0.019618},{x:0.149386,y:-0.022598},{x:0.137252,y:-0.024398},{x:0.125,y:-0.025}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.020635199999998965,y:0.28075747049999955}},refblocks:{left1:{x:-0.45,y:0.1},right1:{x:0.45,y:0.1},bottom1:{x:0,y:-0.275}},bounds:{minX:-0.45,maxX:0.45,minY:-0.28,maxY:0.28,width:0.9,height:0.56,centerX:0,centerY:0},circles:{}},MJo=An(ENt).rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("bottom1",["2"]).labelPort("right1",["3"]).changeTextAnchor("{REF}","middle_left").build(),CGe=An(ENt).rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("bottom1",["2"]).labelPort("right1",["3"]).changeTextAnchor("{REF}","middle_bottom").build(),MNt=Ro(CGe,"left"),bGe=MNt.primitives.find((e)=>e.type==="text"&&e.text==="{REF}");bGe.anchor="middle_left";bGe.y+=0.5;bGe.x=0.3;wJo=MNt,wNt=Ro(CGe,"up"),IGe=wNt.primitives.find((e)=>e.type==="text"&&e.text==="{REF}");IGe.anchor="middle_left";IGe.y+=0.3;IGe.x=0.2;BJo=wNt,TJo={paths:{path1:{type:"path",points:[{x:-0.37,y:0.03},{x:-0.13,y:0.03}],color:"primary",fill:!1},"path-1-3":{type:"path",points:[{x:-0.07,y:0.03},{x:0.11,y:-0.03}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.1,y:-0.06},{x:0.37,y:-0.06}],color:"primary",fill:!1},path3:{type:"path",points:[{x:0.12,y:0.17},{x:0.37,y:0.17}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.37},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.37}},refblocks:{left1:{x:-0.37,y:0.03},right1:{x:0.37,y:-0.06},right2:{x:0.37,y:0.17}},bounds:{minX:-0.4,maxX:0.4,minY:-0.4,maxY:0.4,width:0.79,height:0.79,centerX:0,centerY:0},circles:{"circle-3":{type:"circle",x:0.08,y:-0.07,radius:0.02,color:"primary",fill:!1},"circle-1":{type:"circle",x:-0.1,y:0.03,radius:0.02,color:"primary",fill:!1},"circle-2":{type:"circle",x:0.08,y:0.17,radius:0.02,color:"primary",fill:!1}}},I5e=An(TJo).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1"]).labelPort("right2",["2"]).labelPort("right1",["3"]).changeTextAnchor("{REF}","middle_bottom").build(),vGe=Ro(I5e,"down"),SGe=vGe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),PGe=vGe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");SGe.anchor="middle_bottom";PGe.anchor="middle_top";SGe.x=0.44;SGe.y+=0.28;PGe.y-=0.28;PGe.x=0.44;DJo=vGe,EGe=Ro(I5e,"left"),MGe=EGe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),wGe=EGe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");MGe.anchor="middle_bottom";wGe.anchor="middle_top";MGe.x=0;MGe.y+=0.625;wGe.y-=0.695;wGe.x=0;NJo=EGe,BGe=Ro(I5e,"up"),TGe=BGe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),DGe=BGe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");TGe.anchor="middle_bottom";DGe.anchor="middle_top";TGe.x=0.4;TGe.y+=0.28;DGe.y-=0.28;DGe.x=0.4;RJo=BGe,QJo={paths:{path1:{type:"path",points:[{x:-0.37,y:0.03},{x:-0.13,y:0.03}],color:"primary",fill:!1},"path-1-3":{type:"path",points:[{x:-0.07,y:0.03},{x:0.11,y:0.14}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.1,y:-0.06},{x:0.37,y:-0.06}],color:"primary",fill:!1},path3:{type:"path",points:[{x:0.12,y:0.17},{x:0.37,y:0.17}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.4},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.4}},refblocks:{left1:{x:-0.37,y:0.03},right1:{x:0.37,y:-0.06},right3:{x:0.37,y:0.17}},bounds:{minX:-0.4,maxX:0.4,minY:-0.4,maxY:0.4,width:0.79,height:0.79,centerX:0,centerY:0},circles:{"circle-3":{type:"circle",x:0.08,y:-0.07,radius:0.02,color:"primary",fill:!1},"circle-1":{type:"circle",x:-0.1,y:0.03,radius:0.02,color:"primary",fill:!1},"circle-2":{type:"circle",x:0.08,y:0.17,radius:0.02,color:"primary",fill:!1}}},v5e=An(QJo).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1"]).labelPort("right3",["2"]).labelPort("right1",["3"]).changeTextAnchor("{REF}","middle_bottom").build(),NGe=Ro(v5e,"down"),RGe=NGe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),QGe=NGe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");RGe.anchor="middle_bottom";QGe.anchor="middle_top";RGe.x=0.44;RGe.y+=0.28;QGe.y-=0.28;QGe.x=0.44;kJo=NGe,kGe=Ro(v5e,"left"),LGe=kGe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),HGe=kGe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");LGe.anchor="middle_bottom";HGe.anchor="middle_top";LGe.x=0;LGe.y+=0.625;HGe.y-=0.695;HGe.x=0;LJo=kGe,FGe=Ro(v5e,"up"),zGe=FGe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),OGe=FGe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");zGe.anchor="middle_bottom";OGe.anchor="middle_top";zGe.x=0.4;zGe.y+=0.28;OGe.y-=0.28;OGe.x=0.4;HJo=FGe,TK={paths:{"lead-positive":{type:"path",points:[{x:-0.4,y:0.19999999999999996},{x:-0.20000000000000007,y:0.19999999999999996}],color:"primary",fill:!1},"lead-negative":{type:"path",points:[{x:-0.4,y:-0.20000000000000018},{x:-0.20000000000000007,y:-0.20000000000000018}],color:"primary",fill:!1},"voice-coil":{type:"path",points:[{x:-0.20000000000000007,y:0.19999999999999996},{x:0,y:0.19999999999999996},{x:0,y:-0.20000000000000018},{x:-0.20000000000000007,y:-0.20000000000000018},{x:-0.20000000000000007,y:0.19999999999999996}],color:"primary",fill:!1},cone:{type:"path",points:[{x:0,y:0.19999999999999996},{x:0.3999999999999999,y:0.3999999999999999},{x:0.3999999999999999,y:-0.40000000000000013},{x:0,y:-0.20000000000000018},{x:0,y:0.19999999999999996}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.6},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.6000000000000001}},refblocks:{left1:{x:-0.4,y:-0.20000000000000018},left2:{x:-0.4,y:0.19999999999999996}},bounds:{minX:-0.4,maxX:0.3999999999999999,minY:-0.6000000000000001,maxY:0.6,width:0.7999999999999999,height:1.2000000000000002,centerX:-0.00000000000000005551115123125783,centerY:-0.00000000000000005551115123125783},circles:{}},BNt=An(TK).rotateRightFacingSymbol("down").labelPort("left1",["2","neg"]).labelPort("left2",["1","pos"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),Cxe=zw(BNt.primitives),FJo={...BNt,center:{x:(Cxe.minX+Cxe.maxX)/2,y:(Cxe.minY+Cxe.maxY)/2}},TNt=An(TK).rotateRightFacingSymbol("right").labelPort("left1",["2","neg"]).labelPort("left2",["1","pos"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),bxe=zw(TNt.primitives),zJo={...TNt,center:{x:(bxe.minX+bxe.maxX)/2,y:(bxe.minY+bxe.maxY)/2}},DNt=An(TK).rotateRightFacingSymbol("left").labelPort("left1",["2","neg"]).labelPort("left2",["1","pos"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),Ixe=zw(DNt.primitives),OJo={...DNt,center:{x:(Ixe.minX+Ixe.maxX)/2,y:(Ixe.minY+Ixe.maxY)/2}},NNt=An(TK).rotateRightFacingSymbol("right").labelPort("left1",["2","neg"]).labelPort("left2",["1","pos"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),vxe=zw(NNt.primitives),VJo={...NNt,center:{x:(vxe.minX+vxe.maxX)/2,y:(vxe.minY+vxe.maxY)/2}},RNt=An(TK).rotateRightFacingSymbol("up").labelPort("left1",["2","neg"]).labelPort("left2",["1","pos"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),Sxe=zw(RNt.primitives),YJo={...RNt,center:{x:(Sxe.minX+Sxe.maxX)/2,y:(Sxe.minY+Sxe.maxY)/2}},QNt=An(TK).rotateRightFacingSymbol("up").labelPort("left1",["2","neg"]).labelPort("left2",["1","pos"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),Pxe=zw(QNt.primitives),GJo={...QNt,center:{x:(Pxe.minX+Pxe.maxX)/2,y:(Pxe.minY+Pxe.maxY)/2}},S5e={paths:{path11:{type:"path",points:[{x:-0.38,y:0},{x:-0.12,y:-0.01}],color:"primary",fill:!1},"path11-0":{type:"path",points:[{x:-0.07,y:0},{x:0.11,y:0.05}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.12,y:-0.01},{x:0.38,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.31},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.28}},refblocks:{left1:{x:-0.12,y:-0.01},left2:{x:-0.38,y:0},right1:{x:0.12,y:-0.01},right2:{x:0.38,y:0}},bounds:{minX:-0.4,maxX:0.4,minY:-0.25,maxY:0.25,width:0.81,height:0.5,centerX:0,centerY:0},circles:{"circle-2":{type:"circle",x:0.1,y:0,radius:0.02,color:"primary",fill:!1},"circle-1":{type:"circle",x:-0.1,y:0,radius:0.02,color:"primary",fill:!1}}};delete S5e.refblocks.left1;delete S5e.refblocks.right1;S5e.bounds.width+=0.2;P5e=An(S5e).changeTextAnchor("{VAL}","middle_top").labelPort("left2",["1"]).labelPort("right2",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),VGe=Ro(P5e,"down"),YGe=VGe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),GGe=VGe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");YGe.anchor="middle_bottom";GGe.anchor="middle_top";YGe.x=0.3;YGe.y+=0.265;GGe.y-=0.265;GGe.x=0.3;UJo=VGe,UGe=Ro(P5e,"left"),WGe=UGe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),XGe=UGe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");WGe.anchor="middle_bottom";XGe.anchor="middle_top";WGe.x=0;WGe.y+=0.57;XGe.y-=0.57;XGe.x=0;WJo=UGe,jGe=Ro(P5e,"up"),KGe=jGe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),$Ge=jGe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");KGe.anchor="middle_bottom";$Ge.anchor="middle_top";KGe.x=0.3;KGe.y+=0.265;$Ge.y-=0.265;$Ge.x=0.3;XJo=jGe,E5e={paths:{path11:{type:"path",points:[{x:-0.38,y:0},{x:-0.12,y:-0.01}],color:"primary",fill:!1},"path11-0":{type:"path",points:[{x:-0.07,y:0.01},{x:0.1,y:0.14}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.12,y:-0.01},{x:0.38,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.25},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.25}},refblocks:{left1:{x:-0.12,y:-0.01},left2:{x:-0.38,y:0},right1:{x:0.12,y:-0.01},right2:{x:0.38,y:0}},bounds:{minX:-0.4,maxX:0.4,minY:-0.25,maxY:0.25,width:0.81,height:0.5,centerX:0,centerY:0},circles:{"circle-2":{type:"circle",x:0.1,y:0,radius:0.02,color:"primary",fill:!1},"circle-1":{type:"circle",x:-0.1,y:0,radius:0.02,color:"primary",fill:!1}}};delete E5e.refblocks.left1;delete E5e.refblocks.right1;E5e.bounds.width+=0.2;M5e=An(E5e).changeTextAnchor("{VAL}","middle_top").labelPort("left2",["1"]).labelPort("right2",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),qGe=Ro(M5e,"down"),JGe=qGe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),ZGe=qGe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");JGe.anchor="middle_bottom";ZGe.anchor="middle_top";JGe.x=0.3;JGe.y+=0.265;ZGe.y-=0.265;ZGe.x=0.3;jJo=qGe,eUe=Ro(M5e,"left"),tUe=eUe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),nUe=eUe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");tUe.anchor="middle_bottom";nUe.anchor="middle_top";tUe.x=0;tUe.y+=0.57;nUe.y-=0.57;nUe.x=0;KJo=eUe,oUe=Ro(M5e,"up"),rUe=oUe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),iUe=oUe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");rUe.anchor="middle_bottom";iUe.anchor="middle_top";rUe.x=0.3;rUe.y+=0.265;iUe.y-=0.265;iUe.x=0.3;$Jo=oUe,w5e={paths:{path44:{type:"path",points:[{x:-0.16845120000000047,y:0.02621170000000017},{x:-0.4458008,y:0.02709619999999968}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.4458008,y:0.026971799999999657},{x:0.1677968999999997,y:0.027926399999999685}],color:"primary",fill:!1},"path8704-1":{type:"path",points:[{x:-0.0040837000000002455,y:-0.13467459999999964},{x:-0.0040837000000002455,y:-0.13467459999999964},{x:-0.017668143940740948,y:-0.1311205263185182},{x:-0.03043520885925943,y:-0.12727072121481456},{x:-0.04240966440000013,y:-0.1231399985999998},{x:-0.05361628020740751,y:-0.11874317238518502},{x:-0.064079825925926,y:-0.11409505648148131},{x:-0.07382507120000005,y:-0.10921046479999987},{x:-0.0828767856740741,y:-0.10410421125185171},{x:-0.0912597389925926,y:-0.09879110974814802},{x:-0.09899870079999995,y:-0.0932859741999998},{x:-0.10611844074074069,y:-0.08760361851851838},{x:-0.11264372845925916,y:-0.0817588566148146},{x:-0.11859933359999993,y:-0.07576650239999982},{x:-0.12401002580740728,y:-0.06964136978518495},{x:-0.12890057472592584,y:-0.06339827268148127},{x:-0.13329574999999985,y:-0.05705202499999972},{x:-0.13722032127407394,y:-0.05061744065185156},{x:-0.14069905819259243,y:-0.04410933354814783},{x:-0.14375673039999987,y:-0.03754251759999966},{x:-0.14641810754074058,y:-0.030931806718518143},{x:-0.1487079592592591,y:-0.0242920148148144},{x:-0.15065105519999983,y:-0.017637955799999563},{x:-0.15227216500740723,y:-0.01098444358518472},{x:-0.15359605832592574,y:-0.004346292081480994},{x:-0.1546475047999998,y:0.00226168480000051},{x:-0.15545127407407386,y:0.008824673148148676},{x:-0.1560321357925924,y:0.015327859051852397},{x:-0.1564148595999998,y:0.02175642860000056},{x:-0.1566242151407405,y:0.028095567881482052},{x:-0.15668497205925902,y:0.03433046298518576},{x:-0.15662189999999976,y:0.04044630000000058},{x:-0.15662189999999976,y:0.0404463000000006},{x:-0.15662189999999976,y:0.0404463000000006},{x:-0.15622857394444417,y:0.04717166472222282},{x:-0.1553217675555553,y:0.05388046444444503},{x:-0.15392183849999977,y:0.060558907500000585},{x:-0.1520491444444442,y:0.0671932022222228},{x:-0.1497240430555553,y:0.07376955694444502},{x:-0.14696689199999974,y:0.08027418000000058},{x:-0.14379804894444415,y:0.0866932797222228},{x:-0.1402378715555553,y:0.09301306444444506},{x:-0.13630671749999965,y:0.09921974250000057},{x:-0.13202494444444415,y:0.10529952222222282},{x:-0.12741291005555522,y:0.11123861194444501},{x:-0.1224909719999997,y:0.1170232200000006},{x:-0.11727948794444407,y:0.12263955472222278},{x:-0.11179881555555524,y:0.12807382444444504},{x:-0.10606931249999965,y:0.13331223750000057},{x:-0.1001113364444441,y:0.13834100222222284},{x:-0.09394524505555521,y:0.14314632694444504},{x:-0.08759139599999967,y:0.14771442000000062},{x:-0.08107014694444413,y:0.15203148972222283},{x:-0.07440185555555523,y:0.15608374444444503},{x:-0.0676068794999997,y:0.15985739250000058},{x:-0.06070557644444415,y:0.16333864222222283},{x:-0.05371830405555529,y:0.16651370194444504},{x:-0.04666541999999976,y:0.1693687800000006},{x:-0.03956728194444424,y:0.1718900847222228},{x:-0.03244424755555539,y:0.17406382444444501},{x:-0.025316674499999876,y:0.17587620750000055},{x:-0.01820492044444437,y:0.17731344222222278},{x:-0.01112934305555553,y:0.178361736944445},{x:-0.004110300000000034,y:0.17900730000000054},{x:-0.004110300000000011,y:0.17900730000000054}],color:"primary",fill:!1},"path8704-1-9":{type:"path",points:[{x:0.004158700000000071,y:-0.1355885000000001},{x:0.004158700000000071,y:-0.1355885000000001},{x:0.017743143940740766,y:-0.1320344263185187},{x:0.03051020885925925,y:-0.12818462121481505},{x:0.042484664399999955,y:-0.12405389860000024},{x:0.053691280207407335,y:-0.11965707238518546},{x:0.0641548259259258,y:-0.11500895648148178},{x:0.07390007119999986,y:-0.1101243648000003},{x:0.0829517856740739,y:-0.10501811125185218},{x:0.0913347389925924,y:-0.09970500974814848},{x:0.09907370079999973,y:-0.09419987420000027},{x:0.10619344074074046,y:-0.08851751851851883},{x:0.11271872845925893,y:-0.08267275661481507},{x:0.11867433359999968,y:-0.07668040240000029},{x:0.12408502580740703,y:-0.0705552697851854},{x:0.12897557472592555,y:-0.06431217268148172},{x:0.13337074999999957,y:-0.05796592500000018},{x:0.13729532127407365,y:-0.05153134065185202},{x:0.14077405819259214,y:-0.045023233548148286},{x:0.14383173039999952,y:-0.038456417600000126},{x:0.14649310754074024,y:-0.03184570671851861},{x:0.14878295925925875,y:-0.02520591481481487},{x:0.1507260551999995,y:-0.01855185580000003},{x:0.15234716500740686,y:-0.011898343585185192},{x:0.15367105832592537,y:-0.005260192081481464},{x:0.15472250479999944,y:0.001347784800000043},{x:0.1555262740740735,y:0.007910773148148207},{x:0.156107135792592,y:0.01441395905185193},{x:0.1564898595999994,y:0.020842528600000094},{x:0.15669921514074014,y:0.02718166788148159},{x:0.15675997205925862,y:0.03341656298518529},{x:0.15669689999999936,y:0.03953240000000011},{x:0.15669689999999936,y:0.039532400000000134},{x:0.15669689999999936,y:0.039532400000000134},{x:0.1563035739444438,y:0.04625776472222235},{x:0.15539676755555493,y:0.05296656444444457},{x:0.15399683849999934,y:0.05964500750000013},{x:0.1521241444444438,y:0.06627930222222234},{x:0.14979904305555491,y:0.07285565694444456},{x:0.14704189199999937,y:0.07936028000000013},{x:0.1438730489444438,y:0.08577937972222234},{x:0.1403128715555549,y:0.09209916444444458},{x:0.13638171749999925,y:0.0983058425000001},{x:0.13209994444444376,y:0.10438562222222235},{x:0.12748791005555482,y:0.11032471194444453},{x:0.12256597199999929,y:0.11610932000000013},{x:0.1173544879444437,y:0.1217256547222223},{x:0.11187381555555485,y:0.12715992444444457},{x:0.10614431249999925,y:0.1323983375000001},{x:0.10018633644444369,y:0.13742710222222235},{x:0.09402024505555481,y:0.14223242694444457},{x:0.08766639599999927,y:0.14680052000000016},{x:0.08114514694444372,y:0.15111758972222236},{x:0.07447685555555483,y:0.15516984444444457},{x:0.06768187949999929,y:0.15894349250000012},{x:0.06078057644444377,y:0.16242474222222236},{x:0.053793304055554894,y:0.16559980194444457},{x:0.046740419999999366,y:0.16845488000000014},{x:0.039642281944443844,y:0.17097618472222234},{x:0.03251924755555499,y:0.17314992444444455},{x:0.02539167449999948,y:0.17496230750000008},{x:0.018279920444443973,y:0.17639954222222232},{x:0.011204343055555134,y:0.17744783694444452},{x:0.004185299999999637,y:0.17809340000000007},{x:0.004185299999999614,y:0.17809340000000007}],color:"primary",fill:!1},path4:{type:"path",points:[{x:-0.08039130000000005,y:0.0179576999999993},{x:-0.08039130000000005,y:0.09650599999999931}],color:"primary",fill:!0},"path4-5":{type:"path",points:[{x:0.01494479999999987,y:-0.055216500000000224},{x:0.01494479999999987,y:0.09691909999999937}],color:"primary",fill:!0},"path4-5-8":{type:"path",points:[{x:0.06871169999999927,y:-0.056870000000000864},{x:0.06871169999999927,y:0.018784499999999538}],color:"primary",fill:!0},"path4-1":{type:"path",points:[{x:-0.08179359999999969,y:0.09650570000000003},{x:0.015771699999999722,y:0.09650570000000003}],color:"primary",fill:!0},"path4-1-6":{type:"path",points:[{x:0.0117995999999998,y:-0.05594970000000088},{x:0.06843709999999925,y:-0.05594970000000088}],color:"primary",fill:!0},"rect1577-4":{type:"path",points:[{x:-0.17162450000000073,y:0.11125030000000025},{x:-0.2688274000000015,y:0.11125030000000025},{x:-0.2688274000000015,y:0.11469129999999961},{x:-0.17162450000000073,y:0.11469129999999961}],color:"primary",fill:!0},"rect1577-4-7":{type:"path",points:[{x:-0.2184661999999995,y:0.16159429999999997},{x:-0.2184661999999995,y:0.06439139999999943},{x:-0.22190719999999908,y:0.06439139999999943},{x:-0.22190719999999908,y:0.16159429999999997}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-0.0024445000000006267,y:0.23933980000000044},bottom1:{type:"text",text:"{VAL}",x:0.00341719999999901,y:-0.23933980000000066}},refblocks:{left1:{x:-0.4458008,y:0.02709619999999968},right1:{x:0.4458008,y:0.026971799999999657}},bounds:{minX:-0.473959241,maxX:0.473959241,minY:-0.23933980000000066,maxY:0.23933980000000044,width:0.947918482,height:0.4786796000000011,centerX:0,centerY:-0.00000000000000011102230246251565},circles:{}},qJo=An(w5e).rotateRightFacingSymbol("down").labelPort("left1",["1","pos"]).labelPort("right1",["2","neg"]).changeTextAnchor("{REF}","middle_left",{x:0.02,y:0.2}).changeTextAnchor("{VAL}","middle_left",{x:0.5,y:-0.2}).build(),JJo=An(w5e).rotateRightFacingSymbol("left").labelPort("left1",["1","pos"]).labelPort("right1",["2","neg"]).changeTextAnchor("{REF}","middle_bottom",{x:0,y:0.45}).changeTextAnchor("{VAL}","middle_top",{x:0,y:-0.55}).build(),ZJo=An(w5e).rotateRightFacingSymbol("right").labelPort("left1",["1","pos"]).labelPort("right1",["2","neg"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),eZo=An(w5e).rotateRightFacingSymbol("up").labelPort("left1",["1","pos"]).labelPort("right1",["2","neg"]).changeTextAnchor("{VAL}","middle_left",{x:0.02,y:-0.2}).changeTextAnchor("{REF}","middle_left",{x:0.5,y:0.2}).build(),kNt={paths:{path40:{type:"path",points:[{x:0.14,y:0.04},{x:-0.12,y:-0.09}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-0.12,y:0.18},{x:0.14,y:0.04}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-0.12,y:-0.09},{x:-0.12,y:0.18}],color:"primary",fill:!1},path43:{type:"path",points:[{x:0.14,y:0.18},{x:0.14,y:-0.09}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-0.12,y:0.04},{x:-0.52,y:0.04}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.52,y:0.04},{x:0.15,y:0.04}],color:"primary",fill:!1},"path43-5":{type:"path",points:[{x:0.19,y:-0.09},{x:0.15,y:-0.09}],color:"primary",fill:!1},"path43-5-2":{type:"path",points:[{x:0.19,y:-0.14},{x:0.19,y:-0.09}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.01,y:0.27},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.27}},refblocks:{left1:{x:-0.52,y:0.04},right1:{x:0.52,y:0.04}},bounds:{minX:-0.55,maxX:0.55,minY:-0.27,maxY:0.27,width:1.09,height:0.55,centerX:0,centerY:0},circles:{}},{paths:bRs,texts:IRs,bounds:vRs,refblocks:SRs,circles:PRs}=kNt,LNt=An(kNt).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),tZo=Ro(LNt),nZo={paths:{path11:{type:"path",points:[{x:-0.54,y:0},{x:-0.3,y:0}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.29,y:0},{x:0.54,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.18,y:-0.36},bottom1:{type:"text",text:"{VAL}",x:-0.01,y:0.43},left1:{type:"text",text:"RPM",x:0,y:-0.02}},refblocks:{left1:{x:-0.54,y:0},right1:{x:0.54,y:0}},bounds:{minX:-0.53,maxX:0.53,minY:0,maxY:0,width:1.06,height:1,centerX:0,centerY:0},circles:{path1:{type:"circle",x:-0.01,y:-0.01,radius:0.29,color:"primary",fill:!1}}},{paths:oZo,texts:rZo,bounds:Exe,refblocks:UTt,circles:iZo}=nZo,sUe=Gl({primitives:[...Object.values(oZo),...Object.values(iZo),{type:"text",text:"{REF}",x:0,y:-0.3594553499999995,anchor:"middle_top"},{type:"text",text:"{VAL}",x:0,y:0.35,anchor:"middle_bottom"},{...rZo.left1,y:0.01,anchor:"center",fontSize:0.2}],ports:[{...UTt.left1,labels:["1"]},{...UTt.right1,labels:["2"]}],size:{width:Exe.width,height:Exe.height},center:{x:Exe.centerX,y:Exe.centerY}}),{5:sZo,...aZo}=sUe.primitives;WTt=Ro({...sUe,primitives:Object.values(aZo).filter(cZo)}),lZo={...WTt,primitives:[...WTt.primitives,sZo]},B5e=Gl({primitives:[{type:"path",points:[{x:-0.2,y:0},{x:0,y:0}],color:"primary",fill:!1},{type:"path",points:Array.from({length:32},(e,t)=>{let n=Math.PI/2-t*Math.PI/31,o=0.1;return{x:0.1-o*Math.cos(n),y:o*Math.sin(n)}}),color:"primary",fill:!1},{type:"text",text:"{REF}",x:0.125,y:0,anchor:"middle_left"}],ports:[{x:-0.2,y:0,labels:["1"]}],center:{x:0,y:0}}),HNt=Ro(B5e,"down"),XTt=HNt.primitives.find((e)=>e.type==="text"&&e.text==="{REF}");XTt&&(XTt.anchor="middle_top");hZo=HNt,dZo=Ro(B5e,"left"),FNt=Ro(B5e,"up"),jTt=FNt.primitives.find((e)=>e.type==="text"&&e.text==="{REF}");jTt&&(jTt.anchor="middle_bottom");uZo=FNt,pZo={paths:{path40:{type:"path",points:[{x:0.44,y:0.04},{x:0.19,y:-0.09}],color:"primary",fill:!1},path41:{type:"path",points:[{x:0.19,y:0.18},{x:0.44,y:0.04}],color:"primary",fill:!1},path42:{type:"path",points:[{x:0.19,y:-0.09},{x:0.19,y:0.18}],color:"primary",fill:!1},path44:{type:"path",points:[{x:0.19,y:0.04},{x:-0.11,y:0.04}],color:"primary",fill:!1},path45:{type:"path",points:[{x:-0.43,y:0.22},{x:-0.11,y:0.04}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.01,y:0.27},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.27}},refblocks:{right1:{x:-0.43,y:0.22}},bounds:{minX:-0.55,maxX:0.55,minY:-0.27,maxY:0.27,width:1.09,height:0.55,centerX:0,centerY:0},circles:{}},aUe=An(pZo).labelPort("right1",["1"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),cUe=Ro(aUe,"up"),lUe=cUe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),hUe=cUe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");lUe.anchor="middle_bottom";hUe.anchor="middle_top";lUe.x=0.4;lUe.y+=0.2;hUe.y-=0.3;hUe.x=0.4;zNt=cUe,dUe=CK(zNt),uUe=dUe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),pUe=dUe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");uUe.anchor="middle_bottom";pUe.anchor="middle_top";uUe.x=0.35;uUe.y+=0.4;pUe.y-=0.4;pUe.x=0.35;mZo=dUe,mUe=Ro(aUe,"left"),_Ue=mUe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),gUe=mUe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");_Ue.anchor="middle_bottom";gUe.anchor="middle_top";_Ue.x=0;_Ue.y+=0.5;gUe.y-=0.6;gUe.x=0;_Zo=mUe,AUe={paths:{"primary-winding":{type:"path",points:[{x:-0.6666666666666999,y:0.6000000000000001},{x:-0.1419999999999999,y:0.6000000000000001},{x:-0.1419999999999999,y:0.6000000000000001},{x:-0.13426666666666656,y:0.5976565925925927},{x:-0.12706666666666658,y:0.5950394074074075},{x:-0.12039999999999991,y:0.5921680000000001},{x:-0.11426666666666657,y:0.5890619259259261},{x:-0.10866666666666656,y:0.5857407407407409},{x:-0.10359999999999989,y:0.5822240000000002},{x:-0.09906666666666655,y:0.5785312592592594},{x:-0.09506666666666656,y:0.5746820740740743},{x:-0.09159999999999985,y:0.5706959999999999},{x:-0.08866666666666653,y:0.5665925925925928},{x:-0.08626666666666649,y:0.5623914074074075},{x:-0.08439999999999986,y:0.5581120000000002},{x:-0.08306666666666651,y:0.5537739259259259},{x:-0.08226666666666653,y:0.5493967407407409},{x:-0.08199999999999985,y:0.5449999999999999},{x:-0.08226666666666652,y:0.5406032592592593},{x:-0.08306666666666651,y:0.5362260740740741},{x:-0.08439999999999986,y:0.5318880000000001},{x:-0.08626666666666652,y:0.5276085925925926},{x:-0.08866666666666652,y:0.5234074074074074},{x:-0.09159999999999985,y:0.519304},{x:-0.09506666666666652,y:0.515317925925926},{x:-0.09906666666666653,y:0.5114687407407408},{x:-0.10359999999999986,y:0.507776},{x:-0.10866666666666652,y:0.5042592592592593},{x:-0.11426666666666653,y:0.5009380740740741},{x:-0.12039999999999987,y:0.49783200000000005},{x:-0.12706666666666652,y:0.4949605925925927},{x:-0.1342666666666665,y:0.49234340740740745},{x:-0.14199999999999988,y:0.4900000000000001},{x:-0.1419999999999999,y:0.4900000000000001},{x:-0.1419999999999999,y:0.4900000000000001},{x:-0.13426666666666656,y:0.48765659259259264},{x:-0.12706666666666658,y:0.48503940740740753},{x:-0.12039999999999991,y:0.4821680000000002},{x:-0.11426666666666657,y:0.4790619259259261},{x:-0.10866666666666656,y:0.47574074074074085},{x:-0.10359999999999989,y:0.4722240000000002},{x:-0.09906666666666655,y:0.46853125925925937},{x:-0.09506666666666656,y:0.46468207407407425},{x:-0.09159999999999985,y:0.46069599999999994},{x:-0.08866666666666653,y:0.45659259259259266},{x:-0.08626666666666649,y:0.45239140740740735},{x:-0.08439999999999986,y:0.4481120000000001},{x:-0.08306666666666651,y:0.4437739259259259},{x:-0.08226666666666653,y:0.43939674074074087},{x:-0.08199999999999985,y:0.43499999999999994},{x:-0.08226666666666652,y:0.4306032592592593},{x:-0.08306666666666651,y:0.42622607407407415},{x:-0.08439999999999986,y:0.42188800000000015},{x:-0.08626666666666652,y:0.41760859259259264},{x:-0.08866666666666652,y:0.4134074074074075},{x:-0.09159999999999985,y:0.40930400000000006},{x:-0.09506666666666652,y:0.40531792592592597},{x:-0.09906666666666653,y:0.4014687407407408},{x:-0.10359999999999986,y:0.3977760000000001},{x:-0.10866666666666652,y:0.3942592592592593},{x:-0.11426666666666653,y:0.3909380740740741},{x:-0.12039999999999987,y:0.38783200000000007},{x:-0.12706666666666652,y:0.3849605925925927},{x:-0.1342666666666665,y:0.38234340740740747},{x:-0.14199999999999988,y:0.3800000000000001},{x:-0.1419999999999999,y:0.3800000000000001},{x:-0.1419999999999999,y:0.3800000000000001},{x:-0.13426666666666656,y:0.37765659259259265},{x:-0.12706666666666658,y:0.3750394074074076},{x:-0.12039999999999991,y:0.3721680000000001},{x:-0.11426666666666657,y:0.36906192592592607},{x:-0.10866666666666656,y:0.36574074074074087},{x:-0.10359999999999989,y:0.36222400000000016},{x:-0.09906666666666655,y:0.3585312592592594},{x:-0.09506666666666656,y:0.35468207407407426},{x:-0.09159999999999985,y:0.350696},{x:-0.08866666666666653,y:0.34659259259259273},{x:-0.08626666666666649,y:0.3423914074074074},{x:-0.08439999999999986,y:0.33811200000000013},{x:-0.08306666666666651,y:0.3337739259259259},{x:-0.08226666666666653,y:0.3293967407407409},{x:-0.08199999999999985,y:0.325},{x:-0.08226666666666652,y:0.3206032592592593},{x:-0.08306666666666651,y:0.31622607407407416},{x:-0.08439999999999986,y:0.3118880000000001},{x:-0.08626666666666652,y:0.30760859259259266},{x:-0.08866666666666652,y:0.30340740740740746},{x:-0.09159999999999985,y:0.299304},{x:-0.09506666666666652,y:0.29531792592592593},{x:-0.09906666666666653,y:0.2914687407407408},{x:-0.10359999999999986,y:0.28777600000000003},{x:-0.10866666666666652,y:0.28425925925925927},{x:-0.11426666666666653,y:0.2809380740740741},{x:-0.12039999999999987,y:0.277832},{x:-0.12706666666666652,y:0.27496059259259265},{x:-0.1342666666666665,y:0.2723434074074074},{x:-0.14199999999999988,y:0.27},{x:-0.1419999999999999,y:0.27},{x:-0.1419999999999999,y:0.27},{x:-0.13426666666666656,y:0.2676565925925926},{x:-0.12706666666666658,y:0.26503940740740745},{x:-0.12039999999999991,y:0.2621680000000001},{x:-0.11426666666666657,y:0.25906192592592603},{x:-0.10866666666666656,y:0.25574074074074093},{x:-0.10359999999999989,y:0.25222400000000017},{x:-0.09906666666666655,y:0.2485312592592594},{x:-0.09506666666666656,y:0.24468207407407425},{x:-0.09159999999999985,y:0.24069600000000008},{x:-0.08866666666666653,y:0.23659259259259274},{x:-0.08626666666666649,y:0.2323914074074075},{x:-0.08439999999999986,y:0.2281120000000002},{x:-0.08306666666666651,y:0.22377392592592601},{x:-0.08226666666666653,y:0.2193967407407409},{x:-0.08199999999999985,y:0.2150000000000001},{x:-0.08226666666666652,y:0.21060325925925938},{x:-0.08306666666666651,y:0.20622607407407423},{x:-0.08439999999999986,y:0.20188800000000012},{x:-0.08626666666666652,y:0.1976085925925927},{x:-0.08866666666666652,y:0.19340740740740753},{x:-0.09159999999999985,y:0.18930400000000008},{x:-0.09506666666666652,y:0.185317925925926},{x:-0.09906666666666653,y:0.18146874074074082},{x:-0.10359999999999986,y:0.17777600000000005},{x:-0.10866666666666652,y:0.17425925925925928},{x:-0.11426666666666653,y:0.17093807407407408},{x:-0.12039999999999987,y:0.16783199999999998},{x:-0.12706666666666652,y:0.16496059259259258},{x:-0.1342666666666665,y:0.16234340740740733},{x:-0.14199999999999988,y:0.15999999999999992},{x:-0.1419999999999999,y:0.15999999999999992},{x:-0.1419999999999999,y:0.15999999999999992},{x:-0.13426666666666656,y:0.1577116296296296},{x:-0.12706666666666658,y:0.15525451851851865},{x:-0.12039999999999991,y:0.15264066666666695},{x:-0.11426666666666657,y:0.1498820740740747},{x:-0.10866666666666656,y:0.1469907407407417},{x:-0.10359999999999989,y:0.14397866666666803},{x:-0.09906666666666655,y:0.14085785185185365},{x:-0.09506666666666656,y:0.1376402962962987},{x:-0.09159999999999985,y:0.13433800000000298},{x:-0.08866666666666653,y:0.1309629629629667},{x:-0.08626666666666649,y:0.12752718518518963},{x:-0.08439999999999986,y:0.12404266666667203},{x:-0.08306666666666651,y:0.12052140740741364},{x:-0.08226666666666653,y:0.11697540740741469},{x:-0.08199999999999985,y:0.11341666666667499},{x:-0.08226666666666652,y:0.10985718518519466},{x:-0.08306666666666651,y:0.10630896296297365},{x:-0.08439999999999986,y:0.10278400000001198},{x:-0.08626666666666652,y:0.09929429629630965},{x:-0.08866666666666652,y:0.09585185185186663},{x:-0.09159999999999985,y:0.09246866666668296},{x:-0.09506666666666652,y:0.08915674074075862},{x:-0.09906666666666653,y:0.08592807407409363},{x:-0.10359999999999986,y:0.08279466666668796},{x:-0.10866666666666652,y:0.07976851851854162},{x:-0.11426666666666653,y:0.07686162962965462},{x:-0.12039999999999987,y:0.07408600000002696},{x:-0.12706666666666652,y:0.07145362962965862},{x:-0.1342666666666665,y:0.06897651851854962},{x:-0.14199999999999988,y:0.06666666666669996},{x:-0.1419999999999999,y:0.06666666666669996},{x:-0.6666666666666999,y:0.06666666666669996}],color:"primary",fill:!1},"auxiliary-winding":{type:"path",points:[{x:-0.6666666666666999,y:-0.06666666666669996},{x:-0.1419999999999999,y:-0.06666666666669996},{x:-0.1419999999999999,y:-0.06666666666669996},{x:-0.13426666666666656,y:-0.0689765185185496},{x:-0.12706666666666658,y:-0.07145362962965864},{x:-0.12039999999999991,y:-0.07408600000002695},{x:-0.11426666666666657,y:-0.07686162962965463},{x:-0.10866666666666656,y:-0.07976851851854162},{x:-0.10359999999999989,y:-0.08279466666668797},{x:-0.09906666666666655,y:-0.08592807407409363},{x:-0.09506666666666656,y:-0.08915674074075866},{x:-0.09159999999999985,y:-0.09246866666668294},{x:-0.08866666666666653,y:-0.09585185185186663},{x:-0.08626666666666649,y:-0.09929429629630962},{x:-0.08439999999999986,y:-0.10278400000001198},{x:-0.08306666666666651,y:-0.10630896296297361},{x:-0.08226666666666653,y:-0.10985718518519468},{x:-0.08199999999999985,y:-0.11341666666667496},{x:-0.08226666666666652,y:-0.11697540740741467},{x:-0.08306666666666651,y:-0.12052140740741367},{x:-0.08439999999999986,y:-0.124042666666672},{x:-0.08626666666666652,y:-0.12752718518518966},{x:-0.08866666666666652,y:-0.13096296296296667},{x:-0.09159999999999985,y:-0.134338000000003},{x:-0.09506666666666652,y:-0.13764029629629865},{x:-0.09906666666666653,y:-0.14085785185185368},{x:-0.10359999999999986,y:-0.14397866666666798},{x:-0.10866666666666652,y:-0.14699074074074164},{x:-0.11426666666666653,y:-0.1498820740740746},{x:-0.12039999999999987,y:-0.15264066666666695},{x:-0.12706666666666652,y:-0.15525451851851862},{x:-0.1342666666666665,y:-0.1577116296296296},{x:-0.14199999999999988,y:-0.15999999999999992},{x:-0.1419999999999999,y:-0.15999999999999992},{x:-0.1419999999999999,y:-0.15999999999999992},{x:-0.13426666666666656,y:-0.16234340740740733},{x:-0.12706666666666658,y:-0.16496059259259252},{x:-0.12039999999999991,y:-0.16783199999999995},{x:-0.11426666666666657,y:-0.17093807407407402},{x:-0.10866666666666656,y:-0.17425925925925922},{x:-0.10359999999999989,y:-0.17777599999999996},{x:-0.09906666666666655,y:-0.18146874074074068},{x:-0.09506666666666656,y:-0.1853179259259259},{x:-0.09159999999999985,y:-0.18930399999999992},{x:-0.08866666666666653,y:-0.19340740740740736},{x:-0.08626666666666649,y:-0.19760859259259247},{x:-0.08439999999999986,y:-0.20188799999999998},{x:-0.08306666666666651,y:-0.20622607407407395},{x:-0.08226666666666653,y:-0.2106032592592592},{x:-0.08199999999999985,y:-0.21499999999999986},{x:-0.08226666666666652,y:-0.21939674074074067},{x:-0.08306666666666651,y:-0.22377392592592585},{x:-0.08439999999999986,y:-0.22811199999999995},{x:-0.08626666666666652,y:-0.23239140740740732},{x:-0.08866666666666652,y:-0.23659259259259252},{x:-0.09159999999999985,y:-0.2406959999999999},{x:-0.09506666666666652,y:-0.244682074074074},{x:-0.09906666666666653,y:-0.24853125925925917},{x:-0.10359999999999986,y:-0.2522239999999999},{x:-0.10866666666666652,y:-0.2557407407407406},{x:-0.11426666666666653,y:-0.2590619259259258},{x:-0.12039999999999987,y:-0.26216799999999985},{x:-0.12706666666666652,y:-0.2650394074074072},{x:-0.1342666666666665,y:-0.2676565925925924},{x:-0.14199999999999988,y:-0.26999999999999974},{x:-0.1419999999999999,y:-0.2699999999999998},{x:-0.1419999999999999,y:-0.2699999999999998},{x:-0.13426666666666656,y:-0.2723434074074072},{x:-0.12706666666666658,y:-0.2749605925925925},{x:-0.12039999999999991,y:-0.27783199999999986},{x:-0.11426666666666657,y:-0.280938074074074},{x:-0.10866666666666656,y:-0.28425925925925916},{x:-0.10359999999999989,y:-0.2877759999999999},{x:-0.09906666666666655,y:-0.29146874074074064},{x:-0.09506666666666656,y:-0.295317925925926},{x:-0.09159999999999985,y:-0.29930399999999985},{x:-0.08866666666666653,y:-0.30340740740740735},{x:-0.08626666666666649,y:-0.30760859259259243},{x:-0.08439999999999986,y:-0.311888},{x:-0.08306666666666651,y:-0.31622607407407394},{x:-0.08226666666666653,y:-0.32060325925925925},{x:-0.08199999999999985,y:-0.3249999999999999},{x:-0.08226666666666652,y:-0.3293967407407407},{x:-0.08306666666666651,y:-0.33377392592592586},{x:-0.08439999999999986,y:-0.338112},{x:-0.08626666666666652,y:-0.3423914074074074},{x:-0.08866666666666652,y:-0.34659259259259256},{x:-0.09159999999999985,y:-0.35069599999999995},{x:-0.09506666666666652,y:-0.35468207407407404},{x:-0.09906666666666653,y:-0.35853125925925927},{x:-0.10359999999999986,y:-0.362224},{x:-0.10866666666666652,y:-0.3657407407407407},{x:-0.11426666666666653,y:-0.3690619259259259},{x:-0.12039999999999987,y:-0.37216800000000005},{x:-0.12706666666666652,y:-0.37503940740740743},{x:-0.1342666666666665,y:-0.37765659259259265},{x:-0.14199999999999988,y:-0.3800000000000001},{x:-0.1419999999999999,y:-0.3800000000000001},{x:-0.1419999999999999,y:-0.3800000000000001},{x:-0.13426666666666656,y:-0.38234340740740747},{x:-0.12706666666666658,y:-0.38496059259259274},{x:-0.12039999999999991,y:-0.38783200000000007},{x:-0.11426666666666657,y:-0.39093807407407416},{x:-0.10866666666666656,y:-0.3942592592592593},{x:-0.10359999999999989,y:-0.3977760000000001},{x:-0.09906666666666655,y:-0.40146874074074074},{x:-0.09506666666666656,y:-0.40531792592592597},{x:-0.09159999999999985,y:-0.40930399999999995},{x:-0.08866666666666653,y:-0.41340740740740745},{x:-0.08626666666666649,y:-0.4176085925925925},{x:-0.08439999999999986,y:-0.4218880000000001},{x:-0.08306666666666651,y:-0.4262260740740739},{x:-0.08226666666666653,y:-0.43060325925925924},{x:-0.08199999999999985,y:-0.4349999999999999},{x:-0.08226666666666652,y:-0.4393967407407407},{x:-0.08306666666666651,y:-0.4437739259259258},{x:-0.08439999999999986,y:-0.44811199999999995},{x:-0.08626666666666652,y:-0.4523914074074073},{x:-0.08866666666666652,y:-0.45659259259259244},{x:-0.09159999999999985,y:-0.4606959999999999},{x:-0.09506666666666652,y:-0.46468207407407397},{x:-0.09906666666666653,y:-0.4685312592592591},{x:-0.10359999999999986,y:-0.47222399999999987},{x:-0.10866666666666652,y:-0.4757407407407406},{x:-0.11426666666666653,y:-0.4790619259259258},{x:-0.12039999999999987,y:-0.4821679999999998},{x:-0.12706666666666652,y:-0.4850394074074072},{x:-0.1342666666666665,y:-0.4876565925925923},{x:-0.14199999999999988,y:-0.48999999999999977},{x:-0.1419999999999999,y:-0.48999999999999977},{x:-0.1419999999999999,y:-0.48999999999999977},{x:-0.13426666666666656,y:-0.4923434074074071},{x:-0.12706666666666658,y:-0.49496059259259245},{x:-0.12039999999999991,y:-0.4978319999999999},{x:-0.11426666666666657,y:-0.500938074074074},{x:-0.10866666666666656,y:-0.5042592592592593},{x:-0.10359999999999989,y:-0.507776},{x:-0.09906666666666655,y:-0.5114687407407407},{x:-0.09506666666666656,y:-0.5153179259259261},{x:-0.09159999999999985,y:-0.5193039999999998},{x:-0.08866666666666653,y:-0.5234074074074074},{x:-0.08626666666666649,y:-0.5276085925925925},{x:-0.08439999999999986,y:-0.531888},{x:-0.08306666666666651,y:-0.536226074074074},{x:-0.08226666666666653,y:-0.5406032592592593},{x:-0.08199999999999985,y:-0.5449999999999999},{x:-0.08226666666666652,y:-0.5493967407407407},{x:-0.08306666666666651,y:-0.5537739259259259},{x:-0.08439999999999986,y:-0.558112},{x:-0.08626666666666652,y:-0.5623914074074075},{x:-0.08866666666666652,y:-0.5665925925925925},{x:-0.09159999999999985,y:-0.5706959999999999},{x:-0.09506666666666652,y:-0.574682074074074},{x:-0.09906666666666653,y:-0.5785312592592593},{x:-0.10359999999999986,y:-0.582224},{x:-0.10866666666666652,y:-0.5857407407407407},{x:-0.11426666666666653,y:-0.5890619259259259},{x:-0.12039999999999987,y:-0.5921679999999998},{x:-0.12706666666666652,y:-0.5950394074074072},{x:-0.1342666666666665,y:-0.5976565925925924},{x:-0.14199999999999988,y:-0.5999999999999999},{x:-0.1419999999999999,y:-0.5999999999999999},{x:-0.6666666666666999,y:-0.5999999999999999}],color:"primary",fill:!1},"secondary-one-winding":{type:"path",points:[{x:0.6666666666666998,y:0.4666666666667001},{x:0.133,y:0.4666666666667001},{x:0.133,y:0.4666666666667001},{x:0.12449333333333333,y:0.46512612345682036},{x:0.11657333333333333,y:0.4634445432099042},{x:0.10923999999999999,y:0.4616320000000254},{x:0.10249333333333334,y:0.45969856790125796},{x:0.09633333333333331,y:0.45765432098767606},{x:0.09075999999999998,y:0.4555093333333538},{x:0.0857733333333333,y:0.45327367901236504},{x:0.08137333333333331,y:0.450957432098784},{x:0.07755999999999993,y:0.44857066666668444},{x:0.0743333333333333,y:0.4461234567901409},{x:0.07169333333333326,y:0.4436258765432269},{x:0.06963999999999997,y:0.44108800000001697},{x:0.06817333333333327,y:0.4385199012345847},{x:0.06729333333333329,y:0.43593165432100456},{x:0.06699999999999995,y:0.43333333333335006},{x:0.06729333333333329,y:0.4307350123456958},{x:0.06817333333333328,y:0.4281467654321155},{x:0.06963999999999995,y:0.42557866666668337},{x:0.07169333333333328,y:0.4230407901234733},{x:0.07433333333333328,y:0.42054320987655935},{x:0.07755999999999996,y:0.4180960000000157},{x:0.08137333333333328,y:0.4157092345679163},{x:0.08577333333333328,y:0.4133929876543353},{x:0.09075999999999997,y:0.4111573333333466},{x:0.0963333333333333,y:0.4090123456790242},{x:0.10249333333333328,y:0.40696809876544227},{x:0.10923999999999996,y:0.405034666666675},{x:0.1165733333333333,y:0.4032221234567961},{x:0.12449333333333329,y:0.40154054320987975},{x:0.13299999999999998,y:0.40000000000000013},{x:0.133,y:0.40000000000000013},{x:0.133,y:0.40000000000000013},{x:0.12449333333333333,y:0.39845945679012046},{x:0.11657333333333333,y:0.3967778765432042},{x:0.10923999999999999,y:0.39496533333332534},{x:0.10249333333333334,y:0.39303190123455795},{x:0.09633333333333331,y:0.3909876543209761},{x:0.09075999999999998,y:0.3888426666666537},{x:0.0857733333333333,y:0.386607012345665},{x:0.08137333333333331,y:0.38429076543208396},{x:0.07755999999999993,y:0.3819039999999844},{x:0.0743333333333333,y:0.37945679012344086},{x:0.07169333333333326,y:0.37695920987652687},{x:0.06963999999999997,y:0.37442133333331695},{x:0.06817333333333327,y:0.37185323456788455},{x:0.06729333333333329,y:0.36926498765430443},{x:0.06699999999999995,y:0.36666666666665004},{x:0.06729333333333329,y:0.3640683456789958},{x:0.06817333333333328,y:0.3614800987654155},{x:0.06963999999999995,y:0.35891199999998336},{x:0.07169333333333328,y:0.3563741234567732},{x:0.07433333333333328,y:0.35387654320985934},{x:0.07755999999999996,y:0.3514293333333157},{x:0.08137333333333328,y:0.3490425679012163},{x:0.08577333333333328,y:0.34672632098763523},{x:0.09075999999999997,y:0.3444906666666465},{x:0.0963333333333333,y:0.34234567901232416},{x:0.10249333333333328,y:0.3403014320987423},{x:0.10923999999999996,y:0.3383679999999749},{x:0.1165733333333333,y:0.33655545679009613},{x:0.12449333333333329,y:0.3348738765431798},{x:0.13299999999999998,y:0.3333333333333002},{x:0.133,y:0.3333333333333002},{x:0.6666666666666998,y:0.3333333333333002}],color:"primary",fill:!1},"secondary-two-winding":{type:"path",points:[{x:0.6666666666666998,y:-0.19999999999999996},{x:0.133,y:-0.19999999999999996},{x:0.133,y:-0.19999999999999996},{x:0.12449333333333333,y:-0.2015405432098796},{x:0.11657333333333333,y:-0.2032221234567959},{x:0.10923999999999999,y:-0.20503466666667475},{x:0.10249333333333334,y:-0.20696809876544214},{x:0.09633333333333331,y:-0.20901234567902405},{x:0.09075999999999998,y:-0.21115733333334635},{x:0.0857733333333333,y:-0.21339298765433506},{x:0.08137333333333331,y:-0.2157092345679162},{x:0.07755999999999993,y:-0.21809600000001547},{x:0.0743333333333333,y:-0.2205432098765592},{x:0.07169333333333326,y:-0.22304079012347303},{x:0.06963999999999997,y:-0.22557866666668316},{x:0.06817333333333327,y:-0.22814676543211523},{x:0.06729333333333329,y:-0.23073501234569563},{x:0.06699999999999995,y:-0.23333333333334982},{x:0.06729333333333329,y:-0.2359316543210042},{x:0.06817333333333328,y:-0.2385199012345845},{x:0.06963999999999995,y:-0.24108800000001673},{x:0.07169333333333328,y:-0.24362587654322676},{x:0.07433333333333328,y:-0.2461234567901406},{x:0.07755999999999996,y:-0.24857066666668426},{x:0.08137333333333328,y:-0.25095743209878363},{x:0.08577333333333328,y:-0.25327367901236475},{x:0.09075999999999997,y:-0.25550933333335346},{x:0.0963333333333333,y:-0.2576543209876757},{x:0.10249333333333328,y:-0.25969856790125756},{x:0.10923999999999996,y:-0.26163200000002496},{x:0.1165733333333333,y:-0.2634445432099038},{x:0.12449333333333329,y:-0.26512612345682},{x:0.13299999999999998,y:-0.2666666666666997},{x:0.133,y:-0.2666666666666997},{x:0.133,y:-0.2666666666666997},{x:0.12449333333333333,y:-0.26820720987657004},{x:0.11657333333333333,y:-0.2698887901234782},{x:0.10923999999999999,y:-0.27170133333335017},{x:0.10249333333333334,y:-0.2736347654321117},{x:0.09633333333333331,y:-0.2756790123456887},{x:0.09075999999999998,y:-0.27782400000000707},{x:0.0857733333333333,y:-0.2800596543209926},{x:0.08137333333333331,y:-0.2823759012345713},{x:0.07755999999999993,y:-0.28476266666666866},{x:0.0743333333333333,y:-0.28720987654321106},{x:0.07169333333333326,y:-0.28970745679012394},{x:0.06963999999999997,y:-0.2922453333333336},{x:0.06817333333333327,y:-0.29481343209876537},{x:0.06729333333333329,y:-0.29740167901234577},{x:0.06699999999999995,y:-0.3},{x:0.06729333333333329,y:-0.3025983209876544},{x:0.06817333333333328,y:-0.30518656790123455},{x:0.06963999999999995,y:-0.3077546666666665},{x:0.07169333333333328,y:-0.310292543209876},{x:0.07433333333333328,y:-0.31279012345678897},{x:0.07755999999999996,y:-0.31523733333333126},{x:0.08137333333333328,y:-0.31762409876542885},{x:0.08577333333333328,y:-0.3199403456790074},{x:0.09075999999999997,y:-0.32217599999999297},{x:0.0963333333333333,y:-0.3243209876543113},{x:0.10249333333333328,y:-0.32636523456788824},{x:0.10923999999999996,y:-0.32829866666664975},{x:0.1165733333333333,y:-0.33011120987652165},{x:0.12449333333333329,y:-0.3317927901234298},{x:0.13299999999999998,y:-0.3333333333333002},{x:0.133,y:-0.3333333333333002},{x:0.6666666666666998,y:-0.3333333333333002}],color:"primary",fill:!1},"core-left":{type:"path",points:[{x:-0.03599999999999981,y:0.66},{x:-0.03599999999999981,y:-0.6599999999999999}],color:"primary",fill:!1},"core-right":{type:"path",points:[{x:0.028999999999999915,y:0.66},{x:0.028999999999999915,y:-0.6599999999999999}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.7200000000000001},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.72}},refblocks:{left1:{x:-0.6666666666666999,y:-0.5999999999999999},left2:{x:-0.6666666666666999,y:-0.06666666666669996},left3:{x:-0.6666666666666999,y:0.06666666666669996},left4:{x:-0.6666666666666999,y:0.6000000000000001},right1:{x:0.6666666666666998,y:-0.3333333333333002},right2:{x:0.6666666666666998,y:-0.19999999999999996},right3:{x:0.6666666666666998,y:0.3333333333333002},right4:{x:0.6666666666666998,y:0.4666666666667001}},bounds:{minX:-0.6666666666666999,maxX:0.6666666666666998,minY:-0.72,maxY:0.7200000000000001,width:1.3333333333333997,height:1.44,centerX:-0.00000000000000005551115123125783,centerY:0.00000000000000005551115123125783},circles:{"primary-polarity-dot":{type:"circle",x:-0.19599999999999995,y:0.535,radius:0.0172,color:"primary",fill:!0},"auxiliary-polarity-dot":{type:"circle",x:-0.19599999999999995,y:-0.1316666666666999,radius:0.0172,color:"primary",fill:!0},"secondary-one-polarity-dot":{type:"circle",x:0.18999999999999995,y:0.42700000000000005,radius:0.0172,color:"primary",fill:!0},"secondary-two-polarity-dot":{type:"circle",x:0.18999999999999995,y:-0.23999999999999977,radius:0.0172,color:"primary",fill:!0}}},gZo=An(AUe).labelPort("left1",["1","primary_end"]).labelPort("left2",["2","primary_start"]).labelPort("left3",["3","auxiliary_end"]).labelPort("left4",["4","auxiliary_start"]).labelPort("right1",["8","secondary1_end"]).labelPort("right2",["7","secondary1_start"]).labelPort("right3",["6","secondary2_end"]).labelPort("right4",["5","secondary2_start"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("down").build(),ONt=An(AUe).labelPort("left1",["1","primary_end"]).labelPort("left2",["2","primary_start"]).labelPort("left3",["3","auxiliary_end"]).labelPort("left4",["4","auxiliary_start"]).labelPort("right1",["8","secondary1_end"]).labelPort("right2",["7","secondary1_start"]).labelPort("right3",["6","secondary2_end"]).labelPort("right4",["5","secondary2_start"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("right").build(),AZo=Y9(ONt),fZo=An(AUe).labelPort("left1",["1","primary_end"]).labelPort("left2",["2","primary_start"]).labelPort("left3",["3","auxiliary_end"]).labelPort("left4",["4","auxiliary_start"]).labelPort("right1",["8","secondary1_end"]).labelPort("right2",["7","secondary1_start"]).labelPort("right3",["6","secondary2_end"]).labelPort("right4",["5","secondary2_start"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("up").build(),VNt={paths:{path11:{type:"path",points:[{x:-0.54,y:0.04},{x:-0.11,y:0.04}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.1,y:0.04},{x:0.54,y:0.04}],color:"primary",fill:!1},"path11-0":{type:"path",points:[{x:-0.09,y:-0.15},{x:-0.09,y:0.26}],color:"primary",fill:!1},"path11-0-3":{type:"path",points:[{x:0.09,y:-0.15},{x:0.09,y:0.26}],color:"primary",fill:!1},"path11-0-9":{type:"path",points:[{x:-0.08,y:0.06},{x:-0.08,y:-0.15},{x:0.09,y:-0.05},{x:-0.08,y:0.06}],color:"primary",fill:!0},"path11-0-9-0":{type:"path",points:[{x:0.08,y:0.26},{x:0.08,y:0.05},{x:-0.09,y:0.15},{x:0.07,y:0.26}],color:"primary",fill:!0},"path12-2":{type:"path",points:[{x:0.09,y:-0.06},{x:0.27,y:-0.17}],color:"primary",fill:!1},"path12-2-9":{type:"path",points:[{x:0.27,y:-0.18},{x:0.27,y:-0.31}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0.01,y:0.42},bottom1:{type:"text",text:"{VAL}",x:-0.03,y:-0.42}},refblocks:{bottom1:{x:0.27,y:-0.31},left1:{x:-0.54,y:0.04},right1:{x:0.54,y:0.04}},bounds:{minX:-0.57,maxX:0.57,minY:-0.42,maxY:0.42,width:1.14,height:0.83,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0,y:0.05,radius:0.29,color:"primary",fill:!1}}},{paths:ERs,texts:MRs,bounds:wRs,refblocks:BRs,circles:TRs}=VNt,YNt=An(VNt).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1"]).labelPort("right1",["2"]).labelPort("bottom1",["3"]).changeTextAnchor("{REF}","middle_bottom").build(),GNt=Ro(YNt),UNt=GNt.primitives.filter((e)=>e.type==="text"),yZo=UNt.find((e)=>e.text==="{REF}"),xZo=UNt.find((e)=>e.text==="{VAL}");yZo.y=0;xZo.y=0;CZo=GNt,bZo={paths:{path40:{type:"path",points:[{x:0.14,y:0.04},{x:-0.12,y:-0.09}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-0.12,y:0.18},{x:0.14,y:0.04}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-0.12,y:-0.09},{x:-0.12,y:0.18}],color:"primary",fill:!1},path43:{type:"path",points:[{x:0.14,y:0.18},{x:0.14,y:-0.09}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-0.12,y:0.04},{x:-0.52,y:0.04}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.52,y:0.04},{x:0.15,y:0.04}],color:"primary",fill:!1},"path43-8":{type:"path",points:[{x:0.14,y:0.18},{x:0.08,y:0.18}],color:"primary",fill:!1},"path43-8-8":{type:"path",points:[{x:0.14,y:-0.09},{x:0.08,y:-0.09}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.01,y:0.27},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.27}},refblocks:{left1:{x:-0.52,y:0.04},right1:{x:0.52,y:0.04}},bounds:{minX:-0.55,maxX:0.55,minY:-0.27,maxY:0.27,width:1.09,height:0.55,centerX:0,centerY:0},circles:{}},{paths:IZo,texts:KTt,bounds:Mxe,refblocks:$Tt,circles:vZo}=bZo,WNt=Gl({primitives:[...Object.values(IZo),...Object.values(vZo),{...KTt.top1,anchor:"middle_bottom"},{...KTt.bottom1,anchor:"middle_top"}],ports:[{...$Tt.left1,labels:["1"]},{...$Tt.right1,labels:["2"]}],size:{width:Mxe.width,height:Mxe.height},center:{x:Mxe.centerX,y:Mxe.centerY}}),fUe=Ro(WNt),SZo=fUe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),PZo=fUe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");SZo.anchor="middle_left";PZo.anchor="middle_right";EZo=fUe,MZo={paths:{path11:{type:"path",points:[{x:-0.34,y:0.22},{x:-0.02,y:0.01}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.23,y:0.13},{x:0.23,y:0.4}],color:"primary",fill:!1},"path12-2":{type:"path",points:[{x:0.23,y:-0.08},{x:0.23,y:-0.35}],color:"primary",fill:!1},"path11-0":{type:"path",points:[{x:-0.01,y:-0.18},{x:-0.01,y:0.23}],color:"primary",fill:!1},"path11-0-3":{type:"path",points:[{x:0.23,y:0.12},{x:-0.01,y:0.12}],color:"primary",fill:!1},"path11-0-9":{type:"path",points:[{x:-0.11,y:0.13},{x:-0.17,y:0.04},{x:-0.06,y:0.03},{x:-0.11,y:0.13}],color:"primary",fill:!0},"path11-0-3-8":{type:"path",points:[{x:0.23,y:-0.08},{x:-0.01,y:-0.08}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.2,y:0.39},bottom1:{type:"text",text:"{VAL}",x:-0.03,y:-0.42}},refblocks:{top1:{x:0.23,y:0.4},bottom1:{x:0.23,y:-0.35},left1:{x:-0.34,y:0.22}},bounds:{minX:-0.37,maxX:0.37,minY:-0.42,maxY:0.42,width:0.74,height:0.85,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0.08,y:0.01,radius:0.29,color:"primary",fill:!1}}},{paths:wZo,texts:qTt,bounds:wxe,refblocks:TOe,circles:BZo}=MZo,XNt=Gl({primitives:[...Object.values(wZo),...Object.values(BZo),{...qTt.top1,anchor:"middle_left"},{...qTt.bottom1,anchor:"middle_right"}],ports:[{...TOe.top1,labels:["1"]},{...TOe.bottom1,labels:["2"]},{...TOe.left1,labels:["3"]}],size:{width:wxe.width,height:wxe.height},center:{x:wxe.centerX,y:wxe.centerY}}),jNt=Ro(XNt),KNt=jNt.primitives.filter((e)=>e.type==="text"),TZo=KNt.find((e)=>e.text==="{REF}");TZo.y=0.1;$Nt=KNt.find((e)=>e.text==="{VAL}");$Nt.y=0.1;$Nt.x=-0.4;DZo=jNt,NZo={paths:{capsule_outer:{type:"path",points:[{x:-0.44,y:0.34},{x:-0.45,y:0.39},{x:-0.46,y:0.42},{x:-0.49,y:0.44},{x:-0.52,y:0.46},{x:-0.56,y:0.46},{x:-0.6,y:0.46},{x:-0.63,y:0.44},{x:-0.65,y:0.42},{x:-0.67,y:0.39},{x:-0.68,y:0.34},{x:-0.68,y:-0.34},{x:-0.67,y:-0.39},{x:-0.65,y:-0.42},{x:-0.63,y:-0.44},{x:-0.6,y:-0.45},{x:-0.56,y:-0.46},{x:-0.52,y:-0.45},{x:-0.49,y:-0.44},{x:-0.46,y:-0.42},{x:-0.45,y:-0.39},{x:-0.44,y:-0.34},{x:-0.44,y:0.34}],color:"primary",fill:!1},capsule_inner:{type:"path",points:[{x:-0.51,y:0.28},{x:-0.52,y:0.32},{x:-0.53,y:0.34},{x:-0.56,y:0.35},{x:-0.57,y:0.35},{x:-0.58,y:0.34},{x:-0.6,y:0.32},{x:-0.61,y:0.28},{x:-0.61,y:-0.28},{x:-0.6,y:-0.32},{x:-0.58,y:-0.34},{x:-0.57,y:-0.35},{x:-0.56,y:-0.35},{x:-0.53,y:-0.34},{x:-0.52,y:-0.32},{x:-0.51,y:-0.28},{x:-0.51,y:0.28}],color:"primary",fill:!0},usb_vertical:{type:"path",points:[{x:0.1,y:-0.4},{x:0.1,y:0.4}],color:"primary",fill:!1},usb_left_branch:{type:"path",points:[{x:0.1,y:-0.1},{x:-0.03,y:0.05},{x:-0.03,y:0.15}],color:"primary",fill:!1},usb_right_branch:{type:"path",points:[{x:0.1,y:0},{x:0.25,y:0.15},{x:0.25,y:0.25}],color:"primary",fill:!1},usb_arrow:{type:"path",points:[{x:0.05,y:0.4},{x:0.1,y:0.5},{x:0.15,y:0.4},{x:0.05,y:0.4}],color:"primary",fill:!0},usb_square:{type:"path",points:[{x:0.2,y:0.25},{x:0.3,y:0.25},{x:0.3,y:0.35},{x:0.2,y:0.35},{x:0.2,y:0.25}],color:"primary",fill:!0}},circles:{usb_base:{type:"circle",x:0.1,y:-0.4,radius:0.07,color:"primary",fill:!0},usb_tip_circle:{type:"circle",x:-0.03,y:0.15,radius:0.04,color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-0.25,y:0.7}},refblocks:{},bounds:{minX:-0.75,maxX:0.35,minY:-0.6,maxY:0.75,width:1.1,height:1.35,centerX:-0.2,centerY:0.08}},RZo=An(NZo).changeTextAnchor("{REF}","middle_bottom").build(),QZo={paths:{path11:{type:"path",points:[{x:-0.54,y:0},{x:-0.3,y:0}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.29,y:0},{x:0.54,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.18,y:-0.36},bottom1:{type:"text",text:"{VAL}",x:-0.01,y:0.43},left1:{type:"text",text:"Var",x:-0.19,y:0.07}},refblocks:{left1:{x:-0.54,y:0},right1:{x:0.54,y:0}},bounds:{minX:-0.53,maxX:0.53,minY:0,maxY:0,width:1.06,height:1,centerX:0,centerY:0},circles:{path1:{type:"circle",x:-0.01,y:-0.01,radius:0.29,color:"primary",fill:!1}}},{paths:kZo,texts:DOe,bounds:Bxe,refblocks:JTt,circles:LZo}=QZo,qNt=Gl({primitives:[...Object.values(kZo),...Object.values(LZo),{...DOe.top1,x:0,y:-0.3594553499999995,anchor:"middle_top"},{...DOe.bottom1,x:0,y:0.35,anchor:"middle_bottom"},{...DOe.left1,x:-0.02,y:0.01,fontSize:0.2,anchor:"center"}],ports:[{...JTt.left1,labels:["1"]},{...JTt.right1,labels:["2"]}],size:{width:Bxe.width,height:Bxe.height},center:{x:Bxe.centerX,y:Bxe.centerY}}),HZo=Ro(qNt),FZo={paths:{path40:{type:"path",points:[{x:0.08,y:0.04},{x:-0.18,y:-0.09}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-0.18,y:0.18},{x:0.08,y:0.04}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-0.18,y:-0.09},{x:-0.18,y:0.18}],color:"primary",fill:!1},path43:{type:"path",points:[{x:0.09,y:0.17},{x:0.1,y:-0.09}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-0.2,y:0.04},{x:-0.52,y:0.04}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.52,y:0.04},{x:0.21,y:0.04}],color:"primary",fill:!1},"path43-6":{type:"path",points:[{x:0.19,y:0.17},{x:0.19,y:-0.09}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.01,y:0.27},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.27}},refblocks:{left1:{x:-0.52,y:0.04},right1:{x:0.52,y:0.04}},bounds:{minX:-0.55,maxX:0.55,minY:-0.27,maxY:0.27,width:1.09,height:0.55,centerX:0,centerY:0},circles:{}},{paths:zZo,texts:ZTt,bounds:Txe,refblocks:eDt,circles:OZo}=FZo,JNt=Gl({primitives:[...Object.values(zZo),...Object.values(OZo),{...ZTt.top1,anchor:"middle_bottom"},{...ZTt.bottom1,anchor:"middle_top"}],ports:[{...eDt.left1,labels:["1"]},{...eDt.right1,labels:["2"]}],size:{width:Txe.width,height:Txe.height},center:{x:Txe.centerX,y:Txe.centerY}}),yUe=Ro(JNt),VZo=yUe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),YZo=yUe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");VZo.anchor="middle_left";YZo.anchor="middle_right";GZo=yUe,UZo={paths:{path5:{type:"path",points:[{x:-0.54,y:0},{x:-0.26,y:0}],color:"primary",fill:!1},path6:{type:"path",points:[{x:0.27,y:0},{x:0.54,y:0}],color:"primary",fill:!1},path7:{type:"path",points:[{x:0.27,y:-0.23},{x:-0.26,y:0.24}],color:"primary",fill:!1},path8:{type:"path",points:[{x:0.38,y:-0.23},{x:0.27,y:-0.23}],color:"primary",fill:!1},path9:{type:"path",points:[{x:0,y:0.14},{x:0.27,y:0.14},{x:0.27,y:-0.13},{x:-0.26,y:-0.13},{x:-0.26,y:0.14},{x:0,y:0.14}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.06,y:0.25},bottom1:{type:"text",text:"{VAL}",x:0.01,y:-0.25}},refblocks:{left1:{x:-0.54,y:0},right1:{x:0.54,y:0}},bounds:{minX:-0.57,maxX:0.57,minY:-0.25,maxY:0.25,width:1.13,height:0.5,centerX:0,centerY:0},circles:{}},{paths:WZo,texts:tDt,bounds:Dxe,refblocks:nDt}=UZo,ZNt=Gl({primitives:[...Object.values(WZo),{...tDt.top1,x:0,anchor:"middle_bottom"},{...tDt.bottom1,x:0,anchor:"middle_top"}],ports:[{...nDt.left1,labels:["1","-"]},{...nDt.right1,labels:["2","+"]}],size:{width:Dxe.width,height:Dxe.height},center:{x:Dxe.centerX,y:Dxe.centerY}}),eRt=Ro(ZNt),tRt=eRt.primitives.filter((e)=>e.type==="text"),xUe=tRt.find((e)=>e.text==="{REF}"),CUe=tRt.find((e)=>e.text==="{VAL}");xUe.x=0.3;xUe.y=0.15;xUe.anchor="middle_left";CUe.x=0.3;CUe.y=-0.15;CUe.anchor="middle_left";XZo=eRt,jZo={paths:{path11:{type:"path",points:[{x:-0.54,y:0},{x:-0.3,y:0}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.29,y:0},{x:0.54,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.18,y:-0.36},bottom1:{type:"text",text:"{VAL}",x:-0.01,y:0.43},left1:{type:"text",text:"Var",x:0,y:-0.02}},refblocks:{left1:{x:-0.54,y:0},right1:{x:0.54,y:0}},bounds:{minX:-0.53,maxX:0.53,minY:0,maxY:0,width:1.06,height:1,centerX:0,centerY:0},circles:{path1:{type:"circle",x:-0.01,y:-0.01,radius:0.29,color:"primary",fill:!1}}},{paths:KZo,texts:$Zo,bounds:Nxe,refblocks:oDt,circles:qZo}=jZo,bUe=Gl({primitives:[...Object.values(KZo),...Object.values(qZo),{type:"text",text:"{REF}",x:0,y:-0.3594553499999995,anchor:"middle_top"},{type:"text",text:"{VAL}",x:0,y:0.35,anchor:"middle_bottom"},{...$Zo.left1,anchor:"center",y:0.02,fontSize:0.2}],ports:[{...oDt.left1,labels:["1"]},{...oDt.right1,labels:["2"]}],size:{width:Nxe.width,height:Nxe.height},center:{x:Nxe.centerX,y:Nxe.centerY}}),{5:JZo,...ZZo}=bUe.primitives;rDt=Ro({...bUe,primitives:Object.values(ZZo).filter(eer)}),ter={...rDt,primitives:[...rDt.primitives,JZo]},T5e={paths:{"path28-2":{type:"path",points:[{x:0.19,y:0},{x:0,y:0.09}],color:"primary",fill:!1},"path28-2-6":{type:"path",points:[{x:0.19,y:0},{x:0,y:-0.09}],color:"primary",fill:!1},"path29-3":{type:"path",points:[{x:0.19,y:0},{x:-0.23,y:0}],color:"primary",fill:!1}},texts:{right1:{type:"text",text:"{REF}",x:0.25,y:0}},refblocks:{left1:{x:-0.23,y:0}},bounds:{minX:-0.25,maxX:0.25,minY:-0.09,maxY:0.09,width:0.5,height:0.19,centerX:0,centerY:0},circles:{}};ner=An(T5e).rotateRightFacingSymbol("down").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_top").build(),oer=D5e(ner,{width:0.24,height:0.23}),rer=An(T5e).rotateRightFacingSymbol("left").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_right").build(),ier=D5e(rer,{width:0.23,height:0.24}),ser=An(T5e).rotateRightFacingSymbol("right").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_left").build(),aer=D5e(ser,{width:0.23,height:0.24}),cer=An(T5e).rotateRightFacingSymbol("up").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_bottom").build(),ler=D5e(cer,{width:0.24,height:0.23}),IUe={paths:{path11:{type:"path",points:[{x:-0.54,y:0.03},{x:-0.3,y:0.03}],color:"primary",fill:!1},"path11-5-5":{type:"path",points:[{x:0.1,y:0.13},{x:0,y:-0.06},{x:-0.11,y:0.13}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.29,y:0.03},{x:0.54,y:0.03}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.02,y:0.4},bottom1:{type:"text",text:"{VAL}",x:-0.01,y:-0.4}},refblocks:{left1:{x:-0.54,y:0.03},right1:{x:0.54,y:0.03}},bounds:{minX:-0.57,maxX:0.57,minY:-0.4,maxY:0.4,width:1.14,height:0.8,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0,y:0.04,radius:0.29,color:"primary",fill:!1}}},{paths:DRs,texts:NRs,bounds:RRs,circles:QRs,refblocks:kRs}=IUe,her=An(IUe).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:der,texts:LRs,bounds:iDt,circles:uer,refblocks:sDt}=IUe,per=An({primitives:[...Object.values(der),...Object.values(uer),{type:"text",text:"{REF}",x:-0.2,y:0.35},{type:"text",text:"{VAL}",x:0.2,y:0.35}],ports:[{...sDt.left1,labels:["left1"]},{...sDt.right1,labels:["right1"]}],center:{x:iDt.centerX,y:iDt.centerY}}).rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),mer=per,_er={paths:{path11:{type:"path",points:[{x:-0.54,y:0},{x:-0.3,y:0}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.29,y:0},{x:0.54,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.18,y:-0.36},bottom1:{type:"text",text:"{VAL}",x:-0.01,y:0.43},left1:{type:"text",text:"Wh",x:0,y:-0.02}},refblocks:{left1:{x:-0.54,y:0},right1:{x:0.54,y:0}},bounds:{minX:-0.53,maxX:0.53,minY:0,maxY:0,width:1.06,height:1,centerX:0,centerY:0},circles:{path1:{type:"circle",x:-0.01,y:-0.01,radius:0.29,color:"primary",fill:!1}}},{paths:ger,texts:Aer,bounds:Rxe,refblocks:aDt,circles:fer}=_er,vUe=Gl({primitives:[...Object.values(ger),...Object.values(fer),{type:"text",text:"{REF}",x:0,y:-0.3594553499999995,anchor:"middle_top"},{type:"text",text:"{VAL}",x:0,y:0.35,anchor:"middle_bottom"},{...Aer.left1,anchor:"center",y:0.01,fontSize:0.2}],ports:[{...aDt.left1,labels:["1"]},{...aDt.right1,labels:["2"]}],size:{width:Rxe.width,height:Rxe.height},center:{x:Rxe.centerX,y:Rxe.centerY}}),{5:yer,...xer}=vUe.primitives;cDt=Ro({...vUe,primitives:Object.values(xer).filter(Cer)}),ber={...cDt,primitives:[...cDt.primitives,yer]},Ier={paths:{path11:{type:"path",points:[{x:-0.54,y:0},{x:-0.3,y:0}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.29,y:0},{x:0.54,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.18,y:-0.36},bottom1:{type:"text",text:"{VAL}",x:-0.01,y:0.43},left1:{type:"text",text:"W",x:0,y:-0.02}},refblocks:{left1:{x:-0.54,y:0},right1:{x:0.54,y:0}},bounds:{minX:-0.53,maxX:0.53,minY:0,maxY:0,width:1.06,height:1,centerX:0,centerY:0},circles:{path1:{type:"circle",x:-0.01,y:-0.01,radius:0.29,color:"primary",fill:!1}}},{paths:ver,texts:Ser,bounds:Qxe,refblocks:lDt,circles:Per}=Ier,SUe=Gl({primitives:[...Object.values(ver),...Object.values(Per),{type:"text",text:"{REF}",x:0,y:-0.3594553499999995,anchor:"middle_top"},{type:"text",text:"{VAL}",x:0,y:0.35,anchor:"middle_bottom"},{...Ser.left1,anchor:"center",y:0.01,fontSize:0.3}],ports:[{...lDt.left1,labels:["1"]},{...lDt.right1,labels:["2"]}],size:{width:Qxe.width,height:Qxe.height},center:{x:Qxe.centerX,y:Qxe.centerY}}),{5:Eer,...Mer}=SUe.primitives;hDt=Ro({...SUe,primitives:Object.values(Mer).filter(wer)}),Ber={...hDt,primitives:[...hDt.primitives,Eer]},nRt={paths:{path40:{type:"path",points:[{x:0.14458890000000002,y:0.04403629999999992},{x:-0.1199943999999995,y:-0.08825540000000043}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-0.1199943999999995,y:0.17632800000000026},{x:0.14458890000000002,y:0.04403629999999992}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-0.1199943999999995,y:-0.0882553999999991},{x:-0.1199943999999995,y:0.17632800000000026}],color:"primary",fill:!1},path43:{type:"path",points:[{x:0.14458890000000002,y:0.17632800000000026},{x:0.14458890000000002,y:-0.0882553999999991}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-0.12219909999999956,y:0.04403629999999992},{x:-0.5168693999999996,y:0.04403629999999992}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.5233797000000002,y:0.043951100000000354},{x:0.1496715999999998,y:0.043951100000000354}],color:"primary",fill:!1},"path43-8":{type:"path",points:[{x:0.14458890000000002,y:0.17632800000000026},{x:0.21069330000000042,y:0.17632800000000026}],color:"primary",fill:!1},"path43-8-8":{type:"path",points:[{x:0.14458890000000002,y:-0.0882553999999991},{x:0.07848449999999962,y:-0.0882553999999991}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.0050250999999996715,y:0.27384530000000007},bottom1:{type:"text",text:"{VAL}",x:-0.00011179999999977319,y:-0.27384529999999985}},refblocks:{left1:{x:-0.5191471000000001,y:0.044920700000000924},right1:{x:0.5191470999999999,y:0.04389609999999999}},bounds:{minX:-0.5473055410000001,maxX:0.5473055409999998,minY:-0.27384529999999985,maxY:0.27384530000000007,width:1.094611082,height:0.5476905999999999,centerX:-0.00000000000000011102230246251565,centerY:0.00000000000000011102230246251565},circles:{}},Ter=An(nRt).rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),N5e={paths:{"anode-lead":{type:"path",points:[{x:-0.25,y:0},{x:-0.11999999999999988,y:0}],color:"primary",fill:!1},body:{type:"path",points:[{x:-0.11999999999999988,y:0.11999999999999988},{x:0.1200000000000001,y:0},{x:-0.11999999999999988,y:-0.1200000000000001},{x:-0.11999999999999988,y:0.11999999999999988}],color:"primary",fill:!1},"cathode-bar":{type:"path",points:[{x:0.16999999999999993,y:0.11999999999999988},{x:0.1200000000000001,y:0.11999999999999988},{x:0.1200000000000001,y:-0.1200000000000001},{x:0.07000000000000006,y:-0.1200000000000001}],color:"primary",fill:!1},"cathode-lead":{type:"path",points:[{x:0.1200000000000001,y:0},{x:0.25,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.25},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.25}},refblocks:{left1:{x:-0.25,y:0},right1:{x:0.25,y:0}},bounds:{minX:-0.25,maxX:0.25,minY:-0.25,maxY:0.25,width:0.5,height:0.5,centerX:0,centerY:0},circles:{}},Der=Fi(N5e,{kind:"diode",orientation:"down",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),Ner=Fi(N5e,{kind:"diode",orientation:"left",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),Rer=Fi(N5e,{kind:"diode",orientation:"right",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),Qer=Fi(N5e,{kind:"diode",orientation:"up",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),{paths:ker,bounds:kxe,refblocks:dDt,circles:Ler}=nRt,Her=An({primitives:[...Object.values(ker),...Object.values(Ler),{type:"text",text:"{REF}",x:0.15,y:-0.2294553499999995},{type:"text",text:"{VAL}",x:-0.15,y:-0.2294553499999995}],ports:[{...dDt.left1,labels:["1"]},{...dDt.right1,labels:["2"]}],size:{width:kxe.width,height:kxe.height},center:{x:kxe.centerX,y:kxe.centerY}}).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),R5e={paths:{"anode-lead":{type:"path",points:[{x:-0.17499999999999982,y:0},{x:-0.09999999999999987,y:0}],color:"primary",fill:!1},body:{type:"path",points:[{x:-0.09999999999999987,y:0.09999999999999987},{x:0.10000000000000009,y:0},{x:-0.09999999999999987,y:-0.10000000000000009},{x:-0.09999999999999987,y:0.09999999999999987}],color:"primary",fill:!1},"cathode-bar":{type:"path",points:[{x:0.15000000000000013,y:0.09999999999999987},{x:0.10000000000000009,y:0.09999999999999987},{x:0.10000000000000009,y:-0.10000000000000009},{x:0.050000000000000044,y:-0.10000000000000009}],color:"primary",fill:!1},"cathode-lead":{type:"path",points:[{x:0.10000000000000009,y:0},{x:0.17500000000000004,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.25},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.25}},refblocks:{left1:{x:-0.17499999999999982,y:0},right1:{x:0.17500000000000004,y:0}},bounds:{minX:-0.17499999999999982,maxX:0.17500000000000004,minY:-0.25,maxY:0.25,width:0.34999999999999987,height:0.5,centerX:0.00000000000000011102230246251565,centerY:0},circles:{}},Fer=Fi(R5e,{kind:"diode",orientation:"down",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),zer=Fi(R5e,{kind:"diode",orientation:"left",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),Oer=Fi(R5e,{kind:"diode",orientation:"right",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),Ver=Fi(R5e,{kind:"diode",orientation:"up",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),zs={ac_voltmeter_down:pVo,ac_voltmeter_horz:gVo,ac_voltmeter_left:yVo,ac_voltmeter_right:bVo,ac_voltmeter_up:SVo,ac_voltmeter_vert:MVo,and_gate_down:wVo,and_gate_left:BVo,and_gate_right:uDt,and_gate_up:TVo,avalanche_diode_down:RVo,avalanche_diode_horz:QVo,avalanche_diode_left:HVo,avalanche_diode_right:FVo,avalanche_diode_sm_down:OVo,avalanche_diode_sm_left:VVo,avalanche_diode_sm_right:YVo,avalanche_diode_sm_up:GVo,avalanche_diode_up:XVo,avalanche_diode_vert:$Vo,avalanche_diode_xs_down:qVo,avalanche_diode_xs_left:JVo,avalanche_diode_xs_right:ZVo,avalanche_diode_xs_up:eYo,backward_diode_down:oYo,backward_diode_left:pDt,backward_diode_right:cYo,backward_diode_up:lYo,battery_down:pYo,battery_horz:mDt,battery_left:yYo,battery_right:IYo,battery_up:EYo,battery_vert:MYo,boxresistor_down:DYo,boxresistor_left:kYo,boxresistor_right:zYo,boxresistor_sm_down:OYo,boxresistor_sm_left:VYo,boxresistor_sm_right:YYo,boxresistor_sm_up:GYo,boxresistor_small_down:XYo,boxresistor_small_left:$Yo,boxresistor_small_right:ZYo,boxresistor_small_up:nGo,boxresistor_up:sGo,boxresistor_xs_down:aGo,boxresistor_xs_left:cGo,boxresistor_xs_right:lGo,boxresistor_xs_up:hGo,bridged_ground_down:pGo,bridged_ground_left:gGo,bridged_ground_right:_Dt,bridged_ground_up:yGo,capacitor_down:IGo,capacitor_left:SGo,capacitor_polarized_down:PGo,capacitor_polarized_left:EGo,capacitor_polarized_right:MGo,capacitor_polarized_up:wGo,capacitor_right:TGo,capacitor_sm_down:DGo,capacitor_sm_left:NGo,capacitor_sm_right:RGo,capacitor_sm_up:QGo,capacitor_up:FGo,capacitor_xs_down:zGo,capacitor_xs_left:OGo,capacitor_xs_right:VGo,capacitor_xs_up:YGo,constant_current_diode_down:WGo,constant_current_diode_horz:XGo,constant_current_diode_left:$Go,constant_current_diode_right:qGo,constant_current_diode_up:eUo,constant_current_diode_vert:oUo,crystal_4pin_down:sUo,crystal_4pin_left:aUo,crystal_4pin_right:cUo,crystal_4pin_up:dUo,crystal_down:mUo,crystal_left:_Uo,crystal_right:gUo,crystal_up:yUo,current_source_down:CUo,current_source_left:IUo,current_source_right:SUo,current_source_up:EUo,darlington_pair_transistor_down:MUo,darlington_pair_transistor_horz:wUo,darlington_pair_transistor_left:BUo,darlington_pair_transistor_right:TUo,darlington_pair_transistor_up:DUo,darlington_pair_transistor_vert:NUo,dc_ammeter_down:QBt,dc_ammeter_horz:tae,dc_ammeter_left:kUo,dc_ammeter_right:LUo,dc_ammeter_up:HUo,dc_ammeter_vert:QBt,dc_voltmeter_down:OUo,dc_voltmeter_horz:GUo,dc_voltmeter_left:XUo,dc_voltmeter_right:$Uo,dc_voltmeter_up:ZUo,dc_voltmeter_vert:nWo,diac_down:oWo,diac_horz:rWo,diac_left:iWo,diac_right:sWo,diac_up:aWo,diac_vert:cWo,digital_ground_down:dWo,digital_ground_left:mWo,digital_ground_right:AWo,digital_ground_up:xWo,diode_down:bWo,diode_left:IWo,diode_right:e5e,diode_sm_down:vWo,diode_sm_left:SWo,diode_sm_right:PWo,diode_sm_up:EWo,diode_up:MWo,diode_xs_down:wWo,diode_xs_left:BWo,diode_xs_right:TWo,diode_xs_up:DWo,dpdt_normally_closed_switch_down:RWo,dpdt_normally_closed_switch_left:QWo,dpdt_normally_closed_switch_right:o5e,dpdt_normally_closed_switch_up:kWo,dpdt_switch_down:HWo,dpdt_switch_left:FWo,dpdt_switch_right:r5e,dpdt_switch_up:zWo,dpst_normally_closed_switch_down:VWo,dpst_normally_closed_switch_left:YWo,dpst_normally_closed_switch_right:i5e,dpst_normally_closed_switch_up:GWo,dpst_switch_down:WWo,dpst_switch_left:XWo,dpst_switch_right:s5e,dpst_switch_up:jWo,dual_series_schottky_diode_down:$Wo,dual_series_schottky_diode_left:qWo,dual_series_schottky_diode_right:gDt,dual_series_schottky_diode_up:JWo,ferrite_bead_down:tXo,ferrite_bead_left:nXo,ferrite_bead_right:yDt,ferrite_bead_up:fDt,filled_diode_down:iXo,filled_diode_horz:cXo,filled_diode_left:dXo,filled_diode_right:mXo,filled_diode_up:AXo,filled_diode_vert:xXo,frequency_meter_horz:MVe,frequency_meter_vert:MXo,fuse_horz:xDt,fuse_vert:DXo,ground_down:NXo,ground_horz:RXo,ground_left:QXo,ground_right:kXo,ground_up:LXo,ground_vert:HXo,gunn_diode_horz:FXo,gunn_diode_vert:zXo,icled_down:VXo,icled_left:YXo,icled_right:a5e,icled_up:GXo,igbt_transistor_horz:CDt,igbt_transistor_vert:WXo,illuminated_push_button_normally_open_horz:IDt,illuminated_push_button_normally_open_vert:jXo,inductor_down:KXo,inductor_left:$Xo,inductor_right:qXo,inductor_up:JXo,laser_diode_down:ZXo,laser_diode_left:ejo,laser_diode_right:l5e,laser_diode_up:tjo,led_down:ijo,led_left:sjo,led_right:WVe,led_sm_down:ajo,led_sm_left:cjo,led_sm_right:ljo,led_sm_up:hjo,led_up:EDt,led_xs_down:djo,led_xs_left:ujo,led_xs_right:pjo,led_xs_up:mjo,light_dependent_resistor_horz:MDt,light_dependent_resistor_vert:fjo,mosfet_depletion_normally_on_horz:TDt,mosfet_depletion_normally_on_vert:Cjo,mushroom_head_normally_open_momentary_horz:NDt,mushroom_head_normally_open_momentary_vert:Sjo,n_channel_d_mosfet_transistor_gate_bottom_drain_left:Bjo,n_channel_d_mosfet_transistor_gate_bottom_drain_right:Tjo,n_channel_d_mosfet_transistor_gate_left_drain_bottom:Djo,n_channel_d_mosfet_transistor_gate_left_drain_top:Njo,n_channel_d_mosfet_transistor_gate_right_drain_bottom:Rjo,n_channel_d_mosfet_transistor_gate_right_drain_top:Qjo,n_channel_d_mosfet_transistor_gate_top_drain_left:kjo,n_channel_d_mosfet_transistor_gate_top_drain_right:Ljo,n_channel_d_mosfet_transistor_horz:uS,n_channel_d_mosfet_transistor_vert:Ow,n_channel_e_mosfet_transistor_gate_bottom_drain_left:Ojo,n_channel_e_mosfet_transistor_gate_bottom_drain_right:Vjo,n_channel_e_mosfet_transistor_gate_left_drain_bottom:Yjo,n_channel_e_mosfet_transistor_gate_left_drain_top:Gjo,n_channel_e_mosfet_transistor_gate_right_drain_bottom:Ujo,n_channel_e_mosfet_transistor_gate_right_drain_top:Wjo,n_channel_e_mosfet_transistor_gate_top_drain_left:Xjo,n_channel_e_mosfet_transistor_gate_top_drain_right:jjo,n_channel_e_mosfet_transistor_horz:pS,n_channel_e_mosfet_transistor_vert:Vw,njfet_transistor_horz:FDt,njfet_transistor_vert:Jjo,not_connected_down:nKo,not_connected_left:oKo,not_connected_right:u5e,not_connected_up:rKo,npn_bipolar_transistor_down:aKo,npn_bipolar_transistor_horz:hKo,npn_bipolar_transistor_left:pKo,npn_bipolar_transistor_right:gKo,npn_bipolar_transistor_up:yKo,npn_bipolar_transistor_vert:bKo,opamp_no_power_down:vKo,opamp_no_power_left:SKo,opamp_no_power_right:p5e,opamp_no_power_up:PKo,opamp_with_power_down:MKo,opamp_with_power_left:wKo,opamp_with_power_right:m5e,opamp_with_power_up:BKo,p_channel_d_mosfet_transistor_gate_bottom_drain_left:RKo,p_channel_d_mosfet_transistor_gate_bottom_drain_right:QKo,p_channel_d_mosfet_transistor_gate_left_drain_bottom:kKo,p_channel_d_mosfet_transistor_gate_left_drain_top:LKo,p_channel_d_mosfet_transistor_gate_right_drain_bottom:HKo,p_channel_d_mosfet_transistor_gate_right_drain_top:FKo,p_channel_d_mosfet_transistor_gate_top_drain_left:zKo,p_channel_d_mosfet_transistor_gate_top_drain_right:OKo,p_channel_d_mosfet_transistor_horz:mS,p_channel_d_mosfet_transistor_vert:Yw,p_channel_e_mosfet_transistor_gate_bottom_drain_left:UKo,p_channel_e_mosfet_transistor_gate_bottom_drain_right:WKo,p_channel_e_mosfet_transistor_gate_left_drain_bottom:XKo,p_channel_e_mosfet_transistor_gate_left_drain_top:jKo,p_channel_e_mosfet_transistor_gate_right_drain_bottom:KKo,p_channel_e_mosfet_transistor_gate_right_drain_top:$Ko,p_channel_e_mosfet_transistor_gate_top_drain_left:qKo,p_channel_e_mosfet_transistor_gate_top_drain_right:JKo,p_channel_e_mosfet_transistor_horz:_S,p_channel_e_mosfet_transistor_vert:Gw,photodiode_horz:WDt,photodiode_vert:t$o,phototransistor_optocoupler_down:n$o,phototransistor_optocoupler_left:o$o,phototransistor_optocoupler_right:KDt,phototransistor_optocoupler_up:r$o,pjfet_transistor_horz:$Dt,pjfet_transistor_vert:c$o,pnp_bipolar_transistor_down:d$o,pnp_bipolar_transistor_horz:u$o,pnp_bipolar_transistor_left:_$o,pnp_bipolar_transistor_right:f$o,pnp_bipolar_transistor_up:C$o,pnp_bipolar_transistor_vert:v$o,potentiometer_horz:ZDt,potentiometer_vert:M$o,potentiometer2_down:T$o,potentiometer2_left:D$o,potentiometer2_right:_5e,potentiometer2_up:N$o,potentiometer3_down:k$o,potentiometer3_left:F$o,potentiometer3_right:z$o,potentiometer3_up:Y$o,power_factor_meter_horz:eNt,power_factor_meter_vert:X$o,push_button_normally_closed_momentary_horz:nNt,push_button_normally_closed_momentary_vert:q$o,push_button_normally_open_momentary_down:tqo,push_button_normally_open_momentary_horz:iqo,push_button_normally_open_momentary_left:sqo,push_button_normally_open_momentary_right:oae,push_button_normally_open_momentary_up:aqo,push_button_normally_open_momentary_vert:cqo,rail_down:uqo,rail_left:gqo,rail_right:xqo,rail_up:Iqo,rectifier_diode_horz:rNt,rectifier_diode_vert:wqo,resistor_down:Dqo,resistor_left:Qqo,resistor_right:Hqo,resistor_sm_down:Fqo,resistor_sm_left:zqo,resistor_sm_right:Oqo,resistor_sm_up:Vqo,resistor_up:Uqo,resistor_xs_down:Wqo,resistor_xs_left:Xqo,resistor_xs_right:jqo,resistor_xs_up:Kqo,resonator_down:Jqo,resonator_horz:sNt,resonator_left:tJo,resonator_right:C5e,resonator_up:nJo,resonator_vert:oJo,schmitt_trigger_inverter_down:rJo,schmitt_trigger_inverter_left:iJo,schmitt_trigger_inverter_right:aNt,schmitt_trigger_inverter_up:sJo,schottky_diode_down:cJo,schottky_diode_left:lJo,schottky_diode_right:b5e,schottky_diode_up:hJo,silicon_controlled_rectifier_horz:lNt,silicon_controlled_rectifier_vert:uJo,solderjumper2_bridged12_down:pJo,solderjumper2_bridged12_left:mJo,solderjumper2_bridged12_right:sGe,solderjumper2_bridged12_up:_Jo,solderjumper2_down:gJo,solderjumper2_left:AJo,solderjumper2_right:lGe,solderjumper2_up:fJo,solderjumper3_bridged12_down:yJo,solderjumper3_bridged12_left:xJo,solderjumper3_bridged12_right:uGe,solderjumper3_bridged12_up:CJo,solderjumper3_bridged123_down:bJo,solderjumper3_bridged123_left:IJo,solderjumper3_bridged123_right:_Ge,solderjumper3_bridged123_up:vJo,solderjumper3_bridged23_down:SJo,solderjumper3_bridged23_left:PJo,solderjumper3_bridged23_right:fGe,solderjumper3_bridged23_up:EJo,solderjumper3_down:MJo,solderjumper3_left:wJo,solderjumper3_right:CGe,solderjumper3_up:BJo,spdt_normally_closed_switch_down:DJo,spdt_normally_closed_switch_left:NJo,spdt_normally_closed_switch_right:I5e,spdt_normally_closed_switch_up:RJo,spdt_switch_down:kJo,spdt_switch_left:LJo,spdt_switch_right:v5e,spdt_switch_up:HJo,speaker_down:FJo,speaker_horz:zJo,speaker_left:OJo,speaker_right:VJo,speaker_up:YJo,speaker_vert:GJo,spst_normally_closed_switch_down:UJo,spst_normally_closed_switch_left:WJo,spst_normally_closed_switch_right:P5e,spst_normally_closed_switch_up:XJo,spst_switch_down:jJo,spst_switch_left:KJo,spst_switch_right:M5e,spst_switch_up:$Jo,square_wave_down:qJo,square_wave_left:JJo,square_wave_right:ZJo,square_wave_up:eZo,step_recovery_diode_horz:LNt,step_recovery_diode_vert:tZo,tachometer_horz:sUe,tachometer_vert:lZo,testpoint_down:hZo,testpoint_left:dZo,testpoint_right:B5e,testpoint_up:uZo,tilted_ground_down:mZo,tilted_ground_left:_Zo,tilted_ground_right:aUe,tilted_ground_up:zNt,transformer_4_winding_down:gZo,transformer_4_winding_left:AZo,transformer_4_winding_right:ONt,transformer_4_winding_up:fZo,triac_horz:YNt,triac_vert:CZo,tunnel_diode_horz:WNt,tunnel_diode_vert:EZo,unijunction_transistor_horz:XNt,unijunction_transistor_vert:DZo,usbc:RZo,var_meter_horz:qNt,var_meter_vert:HZo,varactor_diode_horz:JNt,varactor_diode_vert:GZo,varistor_horz:ZNt,varistor_vert:XZo,varmeter_horz:bUe,varmeter_vert:ter,vcc_down:oer,vcc_left:ier,vcc_right:aer,vcc_up:ler,volt_meter_horz:her,volt_meter_vert:mer,watt_hour_meter_horz:vUe,watt_hour_meter_vert:ber,wattmeter_horz:SUe,wattmeter_vert:Ber,zener_diode_horz:Ter,zener_diode_sm_down:Der,zener_diode_sm_left:Ner,zener_diode_sm_right:Rer,zener_diode_sm_up:Qer,zener_diode_vert:Her,zener_diode_xs_down:Fer,zener_diode_xs_left:zer,zener_diode_xs_right:Oer,zener_diode_xs_up:Ver},HRs=Object.fromEntries(Object.keys(zs).map((e)=>[e,e]))});var Ger=(e,t,n)=>{let o=[{x:e.x,y:e.y}],r=(e.x+t.x)/2,i=(e.y+t.y)/2,s={x:t.x,y:t.y};switch(t.facingDirection){case"x+":s.x+=n;break;case"x-":s.x-=n;break;case"y+":s.y+=n;break;case"y-":s.y-=n;break}let a=e.facingDirection??"none",c=t.facingDirection??"none",l=(u)=>{let _=o[o.length-1];if(_.x!==u.x||_.y!==u.y)o.push(u)},h=Math.abs(e.y-t.y)<=Math.max(0.000001,n*0.1),d=Math.abs(e.x-t.x)<=Math.max(0.000001,n*0.1);if(a==="none"&&c==="none")l({x:r,y:e.y}),l({x:r,y:t.y});else if(a==="x+"&&c==="y+")if(e.x>t.x&&e.y<t.y)l({x:e.x+n,y:e.y}),l({x:e.x+n,y:t.y+n}),l({x:t.x,y:t.y+n});else if(!d&&!h&&e.x<t.x&&e.y>t.y)l({x:t.x,y:e.y});else if(d)l({x:e.x+n,y:e.y}),l({x:e.x+n,y:t.y+n}),l({x:t.x,y:t.y+n});else if(e.x<t.x)l({x:r,y:e.y}),l({x:r,y:s.y}),l({x:t.x,y:s.y});else if(e.y<=t.y+n)l({x:e.x+n,y:e.y}),l({x:e.x+n,y:e.y+n}),l({x:t.x,y:e.y+n}),l({x:t.x,y:t.y});else l({x:e.x+n,y:e.y}),l({x:e.x+n,y:(e.y+t.y)/2}),l({x:t.x,y:(e.y+t.y)/2});else if(a==="x+"&&c==="x+"&&!h){let u=Math.max(e.x+n,s.x);l({x:u,y:e.y}),l({x:u,y:t.y})}else if(a==="x+"&&c==="x+"&&h)l({x:e.x+n,y:e.y}),l({x:e.x+n,y:e.y+n}),l({x:t.x+n,y:e.y+n}),l({x:t.x+n,y:t.y});else if(a==="x+"&&c==="y-")if(d&&e.y<=t.y)l({x:e.x+n,y:e.y}),l({x:e.x+n,y:i}),l({x:t.x,y:i});else if(d&&e.y>t.y)l({x:e.x+n,y:e.y}),l({x:e.x+n,y:t.y-n}),l({x:t.x,y:t.y-n});else if(e.x<t.x&&e.y<t.y)l({x:t.x,y:e.y});else if(e.x>t.x&&e.y<t.y){let u=e.x+n;l({x:u,y:e.y}),l({x:u,y:i}),l({x:t.x,y:i})}else if(e.x>t.x&&e.y>t.y){let u=e.x+n;l({x:u,y:e.y}),l({x:u,y:s.y}),l({x:t.x,y:s.y})}else if(e.y===t.y)l({x:e.x+n,y:e.y}),l({x:e.x+n,y:e.y-n}),l({x:t.x,y:e.y-n});else l({x:r,y:e.y}),l({x:r,y:s.y}),l({x:t.x,y:s.y});else if(a==="x+"&&c==="x-"&&e.x+n>=t.x-n&&!h){let u=e.x+n;l({x:u,y:e.y}),l({x:u,y:i}),l({x:s.x,y:i}),l({x:s.x,y:s.y})}else if(a==="x+"&&c==="x-"&&h&&t.x>e.x);else if(a==="x+"&&c==="x-"&&h)l({x:e.x+n,y:e.y}),l({x:e.x+n,y:e.y+n}),l({x:t.x-n,y:e.y+n}),l({x:t.x-n,y:e.y});else{if(a==="x+")l({x:e.x+n,y:e.y});l({x:r,y:o[o.length-1].y}),l({x:r,y:s.y}),l({x:s.x,y:s.y})}return l({x:t.x,y:t.y}),o},FO=(e,t,n={})=>{let o=e,r=t,i=!1;if(o.x>r.x||o.x===r.x&&o.y>r.y)i=!0,[o,r]=[r,o];let s=o.facingDirection==="x-",a=o.facingDirection==="y-",c=(f)=>{let y=s?o.x-(f.x-o.x):f.x,x=a?o.y-(f.y-o.y):f.y,C=f.facingDirection;if(s){if(C==="x+")C="x-";else if(C==="x-")C="x+"}if(a){if(C==="y+")C="y-";else if(C==="y-")C="y+"}return{x:y,y:x,facingDirection:C}},l=(f,y)=>{let x=f.x-y.x,C=f.y-y.y,b=y.x+C,I=y.y-x,v=f.facingDirection;switch(v){case"x+":v="y-";break;case"y-":v="x-";break;case"x-":v="y+";break;case"y+":v="x+";break}return{x:b,y:I,facingDirection:v}},h=(f,y)=>{let x=f.x-y.x,C=f.y-y.y;return{x:y.x-C,y:y.y+x}},d=s||a?c(o):o,u=s||a?c(r):r,_=d,p=u,m=!1;if(d.facingDirection==="y+")m=!0,_={...d,facingDirection:"x+"},p=l(u,d);let A=n?.overshoot??0.1*Math.max(Math.abs(_.x-p.x),Math.abs(_.y-p.y)),g=Ger(_,p,A);if(m)g=g.map((f)=>h(f,_));if(s||a)g=g.map(({x:f,y})=>({x:s?o.x-(f-o.x):f,y:a?o.y-(y-o.y):y}));return i?g.reverse():g};var rae=()=>{};var rRt=pt(function(DK){(function(){function e(){if(x=!1,v){var L=DK.unstable_now();B=L;var H=!0;try{e:{f=!1,y&&(y=!1,b(P),P=-1),g=!0;var V=A;try{t:{i(L);for(m=n(u);m!==null&&!(m.expirationTime>L&&a());){var O=m.callback;if(typeof O==="function"){m.callback=null,A=m.priorityLevel;var U=O(m.expirationTime<=L);if(L=DK.unstable_now(),typeof U==="function"){m.callback=U,i(L),H=!0;break t}m===n(u)&&o(u),i(L)}else o(u);m=n(u)}if(m!==null)H=!0;else{var j=n(_);j!==null&&c(s,j.startTime-L),H=!1}}break e}finally{m=null,A=V,g=!1}H=void 0}}finally{H?T():v=!1}}}function t(L,H){var V=L.length;L.push(H);e:for(;0<V;){var O=V-1>>>1,U=L[O];if(0<r(U,H))L[O]=H,L[V]=U,V=O;else break e}}function n(L){return L.length===0?null:L[0]}function o(L){if(L.length===0)return null;var H=L[0],V=L.pop();if(V!==H){L[0]=V;e:for(var O=0,U=L.length,j=U>>>1;O<j;){var Y=2*(O+1)-1,X=L[Y],K=Y+1,J=L[K];if(0>r(X,V))K<U&&0>r(J,X)?(L[O]=J,L[K]=V,O=K):(L[O]=X,L[Y]=V,O=Y);else if(K<U&&0>r(J,V))L[O]=J,L[K]=V,O=K;else break e}}return H}function r(L,H){var V=L.sortIndex-H.sortIndex;return V!==0?V:L.id-H.id}function i(L){for(var H=n(_);H!==null;){if(H.callback===null)o(_);else if(H.startTime<=L)o(_),H.sortIndex=H.expirationTime,t(u,H);else break;H=n(_)}}function s(L){if(y=!1,i(L),!f)if(n(u)!==null)f=!0,v||(v=!0,T());else{var H=n(_);H!==null&&c(s,H.startTime-L)}}function a(){return x?!0:DK.unstable_now()-B<M?!1:!0}function c(L,H){P=C(function(){L(DK.unstable_now())},H)}if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()),DK.unstable_now=void 0,typeof performance==="object"&&typeof performance.now==="function"){var l=performance;DK.unstable_now=function(){return l.now()}}else{var h=Date,d=h.now();DK.unstable_now=function(){return h.now()-d}}var u=[],_=[],p=1,m=null,A=3,g=!1,f=!1,y=!1,x=!1,C=typeof setTimeout==="function"?setTimeout:null,b=typeof clearTimeout==="function"?clearTimeout:null,I=typeof setImmediate<"u"?setImmediate:null,v=!1,P=-1,M=5,B=-1;if(typeof I==="function")var T=function(){I(e)};else if(typeof MessageChannel<"u"){var N=new MessageChannel,D=N.port2;N.port1.onmessage=e,T=function(){D.postMessage(null)}}else T=function(){C(e,0)};DK.unstable_IdlePriority=5,DK.unstable_ImmediatePriority=1,DK.unstable_LowPriority=4,DK.unstable_NormalPriority=3,DK.unstable_Profiling=null,DK.unstable_UserBlockingPriority=2,DK.unstable_cancelCallback=function(L){L.callback=null},DK.unstable_forceFrameRate=function(L){0>L||125<L?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<L?Math.floor(1000/L):5},DK.unstable_getCurrentPriorityLevel=function(){return A},DK.unstable_next=function(L){switch(A){case 1:case 2:case 3:var H=3;break;default:H=A}var V=A;A=H;try{return L()}finally{A=V}},DK.unstable_requestPaint=function(){x=!0},DK.unstable_runWithPriority=function(L,H){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var V=A;A=L;try{return H()}finally{A=V}},DK.unstable_scheduleCallback=function(L,H,V){var O=DK.unstable_now();switch(typeof V==="object"&&V!==null?(V=V.delay,V=typeof V==="number"&&0<V?O+V:O):V=O,L){case 1:var U=-1;break;case 2:U=250;break;case 5:U=1073741823;break;case 4:U=1e4;break;default:U=5000}return U=V+U,L={id:p++,callback:H,priorityLevel:L,startTime:V,expirationTime:U,sortIndex:-1},V>O?(L.sortIndex=V,t(_,L),n(u)===null&&L===n(_)&&(y?(b(P),P=-1):y=!0,c(s,V-O))):(L.sortIndex=U,t(u,L),f||g||(f=!0,v||(v=!0,T()))),L},DK.unstable_shouldYield=a,DK.unstable_wrapCallback=function(L){var H=A;return function(){var V=A;A=H;try{return L.apply(this,arguments)}finally{A=V}}},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var iRt=pt(function(iQs,iae){var PUe=at(ln()),Nu=at(rRt());iae.exports=function(e){function t(R,z){for(R=R.memoizedState;R!==null&&0<z;)R=R.next,z--;return R}function n(R,z,q,pe){if(q>=z.length)return pe;var Ce=z[q],Te=Kc(R)?R.slice():pp({},R);return Te[Ce]=n(R[Ce],z,q+1,pe),Te}function o(R,z,q){if(z.length!==q.length)console.warn("copyWithRename() expects paths of the same length");else{for(var pe=0;pe<q.length-1;pe++)if(z[pe]!==q[pe]){console.warn("copyWithRename() expects paths to be the same except for the deepest key");return}return r(R,z,q,0)}}function r(R,z,q,pe){var Ce=z[pe],Te=Kc(R)?R.slice():pp({},R);return pe+1===z.length?(Te[q[pe]]=Te[Ce],Kc(Te)?Te.splice(Ce,1):delete Te[Ce]):Te[Ce]=r(R[Ce],z,q,pe+1),Te}function i(R,z,q){var pe=z[q],Ce=Kc(R)?R.slice():pp({},R);if(q+1===z.length)return Kc(Ce)?Ce.splice(pe,1):delete Ce[pe],Ce;return Ce[pe]=i(R[pe],z,q+1),Ce}function s(){return!1}function a(){return null}function c(R,z,q,pe){return new yM(R,z,q,pe)}function l(R,z){R.context===Gx&&(BI(z,R,null,null),MI())}function h(R,z){if(Sy!==null){var q=z.staleFamilies;z=z.updatedFamilies,YC(),fM(R.current,z,q),MI()}}function d(R){Sy=R}function u(){}function _(){console.error("Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://react.dev/link/rules-of-hooks")}function p(){console.error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().")}function m(){}function A(R){var z=[];return R.forEach(function(q){z.push(q)}),z.sort().join(", ")}function g(R){var z=R,q=R;if(R.alternate)for(;z.return;)z=z.return;else{R=z;do z=R,(z.flags&4098)!==0&&(q=z.return),R=z.return;while(R)}return z.tag===3?q:null}function f(R){if(g(R)!==R)throw Error("Unable to find node on an unmounted component.")}function y(R){var z=R.alternate;if(!z){if(z=g(R),z===null)throw Error("Unable to find node on an unmounted component.");return z!==R?null:R}for(var q=R,pe=z;;){var Ce=q.return;if(Ce===null)break;var Te=Ce.alternate;if(Te===null){if(pe=Ce.return,pe!==null){q=pe;continue}break}if(Ce.child===Te.child){for(Te=Ce.child;Te;){if(Te===q)return f(Ce),R;if(Te===pe)return f(Ce),z;Te=Te.sibling}throw Error("Unable to find node on an unmounted component.")}if(q.return!==pe.return)q=Ce,pe=Te;else{for(var ut=!1,wt=Ce.child;wt;){if(wt===q){ut=!0,q=Ce,pe=Te;break}if(wt===pe){ut=!0,pe=Ce,q=Te;break}wt=wt.sibling}if(!ut){for(wt=Te.child;wt;){if(wt===q){ut=!0,q=Te,pe=Ce;break}if(wt===pe){ut=!0,pe=Te,q=Ce;break}wt=wt.sibling}if(!ut)throw Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.")}}if(q.alternate!==pe)throw Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.")}if(q.tag!==3)throw Error("Unable to find node on an unmounted component.");return q.stateNode.current===q?R:z}function x(R){return R=y(R),R!==null?C(R):null}function C(R){var z=R.tag;if(z===5||z===26||z===27||z===6)return R;for(R=R.child;R!==null;){if(z=C(R),z!==null)return z;R=R.sibling}return null}function b(R){var z=R.tag;if(z===5||z===26||z===27||z===6)return R;for(R=R.child;R!==null;){if(R.tag!==4&&(z=b(R),z!==null))return z;R=R.sibling}return null}function I(R){if(R===null||typeof R!=="object")return null;return R=fu&&R[fu]||R["@@iterator"],typeof R==="function"?R:null}function v(R){if(R==null)return null;if(typeof R==="function")return R.$$typeof===dW?null:R.displayName||R.name||null;if(typeof R==="string")return R;switch(R){case Ur:return"Fragment";case eN:return"Profiler";case vg:return"StrictMode";case tN:return"Suspense";case uy:return"SuspenseList";case Op:return"Activity"}if(typeof R==="object")switch(typeof R.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),R.$$typeof){case zx:return"Portal";case dy:return(R.displayName||"Context")+".Provider";case F8:return(R._context.displayName||"Context")+".Consumer";case DI:var z=R.render;return R=R.displayName,R||(R=z.displayName||z.name||"",R=R!==""?"ForwardRef("+R+")":"ForwardRef"),R;case bi:return z=R.displayName||null,z!==null?z:v(R.type)||"Memo";case Vf:z=R._payload,R=R._init;try{return v(R(z))}catch(q){}}return null}function P(R){var z=R.type;switch(R.tag){case 31:return"Activity";case 24:return"Cache";case 9:return(z._context.displayName||"Context")+".Consumer";case 10:return(z.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return R=z.render,R=R.displayName||R.name||"",z.displayName||(R!==""?"ForwardRef("+R+")":"ForwardRef");case 7:return"Fragment";case 26:case 27:case 5:return z;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return v(z);case 8:return z===vg?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 14:case 15:if(typeof z==="function")return z.displayName||z.name||null;if(typeof z==="string")return z;break;case 29:if(z=R._debugInfo,z!=null){for(var q=z.length-1;0<=q;q--)if(typeof z[q].name==="string")return z[q].name}if(R.return!==null)return P(R.return)}return null}function M(R){return{current:R}}function B(R,z){0>gy?console.error("Unexpected pop."):(z!==j8[gy]&&console.error("Unexpected Fiber popped."),R.current=ZC[gy],ZC[gy]=null,j8[gy]=null,gy--)}function T(R,z,q){gy++,ZC[gy]=R.current,j8[gy]=q,R.current=z}function N(R){return R>>>=0,R===0?32:31-(SF(R)/MM|0)|0}function D(R){if(R&1)return"SyncHydrationLane";if(R&2)return"Sync";if(R&4)return"InputContinuousHydration";if(R&8)return"InputContinuous";if(R&16)return"DefaultHydration";if(R&32)return"Default";if(R&128)return"TransitionHydration";if(R&4194048)return"Transition";if(R&62914560)return"Retry";if(R&67108864)return"SelectiveHydration";if(R&134217728)return"IdleHydration";if(R&268435456)return"Idle";if(R&536870912)return"Offscreen";if(R&1073741824)return"Deferred"}function L(R){var z=R&42;if(z!==0)return z;switch(R&-R){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return R&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return R&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return console.error("Should have found matching lanes. This is a bug in React."),R}}function H(R,z,q){var pe=R.pendingLanes;if(pe===0)return 0;var Ce=0,Te=R.suspendedLanes,ut=R.pingedLanes;R=R.warmLanes;var wt=pe&134217727;return wt!==0?(pe=wt&~Te,pe!==0?Ce=L(pe):(ut&=wt,ut!==0?Ce=L(ut):q||(q=wt&~R,q!==0&&(Ce=L(q))))):(wt=pe&~Te,wt!==0?Ce=L(wt):ut!==0?Ce=L(ut):q||(q=pe&~R,q!==0&&(Ce=L(q)))),Ce===0?0:z!==0&&z!==Ce&&(z&Te)===0&&(Te=Ce&-Ce,q=z&-z,Te>=q||Te===32&&(q&4194048)!==0)?z:Ce}function V(R,z){return(R.pendingLanes&~(R.suspendedLanes&~R.pingedLanes)&z)===0}function O(R,z){switch(R){case 1:case 2:case 4:case 8:case 64:return z+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return z+5000;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return console.error("Should have found matching lanes. This is a bug in React."),-1}}function U(){var R=WI;return WI<<=1,(WI&4194048)===0&&(WI=256),R}function j(){var R=Ay;return Ay<<=1,(Ay&62914560)===0&&(Ay=4194304),R}function Y(R){for(var z=[],q=0;31>q;q++)z.push(R);return z}function X(R,z){R.pendingLanes|=z,z!==268435456&&(R.suspendedLanes=0,R.pingedLanes=0,R.warmLanes=0)}function K(R,z,q,pe,Ce,Te){var ut=R.pendingLanes;R.pendingLanes=q,R.suspendedLanes=0,R.pingedLanes=0,R.warmLanes=0,R.expiredLanes&=q,R.entangledLanes&=q,R.errorRecoveryDisabledLanes&=q,R.shellSuspendCounter=0;var{entanglements:wt,expirationTimes:In,hiddenUpdates:to}=R;for(q=ut&~q;0<q;){var Xo=31-m_(q),Zo=1<<Xo;wt[Xo]=0,In[Xo]=-1;var vr=to[Xo];if(vr!==null)for(to[Xo]=null,Xo=0;Xo<vr.length;Xo++){var ts=vr[Xo];ts!==null&&(ts.lane&=-536870913)}q&=~Zo}pe!==0&&J(R,pe,0),Te!==0&&Ce===0&&R.tag!==0&&(R.suspendedLanes|=Te&~(ut&~z))}function J(R,z,q){R.pendingLanes|=z,R.suspendedLanes&=~z;var pe=31-m_(z);R.entangledLanes|=z,R.entanglements[pe]=R.entanglements[pe]|1073741824|q&4194090}function ee(R,z){var q=R.entangledLanes|=z;for(R=R.entanglements;q;){var pe=31-m_(q),Ce=1<<pe;Ce&z|R[pe]&z&&(R[pe]|=z),q&=~Ce}}function se(R){switch(R){case 2:R=1;break;case 8:R=4;break;case 32:R=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:R=128;break;case 268435456:R=134217728;break;default:R=0}return R}function ne(R,z,q){if(W2)for(R=R.pendingUpdatersLaneMap;0<q;){var pe=31-m_(q),Ce=1<<pe;R[pe].add(z),q&=~Ce}}function re(R,z){if(W2)for(var q=R.pendingUpdatersLaneMap,pe=R.memoizedUpdaters;0<z;){var Ce=31-m_(z);R=1<<Ce,Ce=q[Ce],0<Ce.size&&(Ce.forEach(function(Te){var ut=Te.alternate;ut!==null&&pe.has(ut)||pe.add(Te)}),Ce.clear()),z&=~R}}function Z(R){return R&=-R,2<R?8<R?(R&134217727)!==0?32:268435456:8:2}function te(R){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")return!1;var z=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(z.isDisabled)return!0;if(!z.supportsFiber)return console.error("The installed version of React DevTools is too old and will not work with the current version of React. Please update React DevTools. https://react.dev/link/react-devtools"),!0;try{eb=z.inject(R),Em=z}catch(q){console.error("React instrumentation encountered an error: %s.",q)}return z.checkDCE?!0:!1}function ie(R){if(typeof EF==="function"&&MW(R),Em&&typeof Em.setStrictMode==="function")try{Em.setStrictMode(eb,R)}catch(z){U2||(U2=!0,console.error("React instrumentation encountered an error: %s",z))}}function le(R){Cr=R}function ue(){Cr!==null&&typeof Cr.markCommitStopped==="function"&&Cr.markCommitStopped()}function de(R){Cr!==null&&typeof Cr.markComponentRenderStarted==="function"&&Cr.markComponentRenderStarted(R)}function me(){Cr!==null&&typeof Cr.markComponentRenderStopped==="function"&&Cr.markComponentRenderStopped()}function Ae(R){Cr!==null&&typeof Cr.markRenderStarted==="function"&&Cr.markRenderStarted(R)}function xe(){Cr!==null&&typeof Cr.markRenderStopped==="function"&&Cr.markRenderStopped()}function Me(R,z){Cr!==null&&typeof Cr.markStateUpdateScheduled==="function"&&Cr.markStateUpdateScheduled(R,z)}function Re(){}function we(){if(J8===0){yd=console.log,Ux=console.info,Eg=console.warn,Z8=console.error,X2=console.group,e7=console.groupCollapsed,MF=console.groupEnd;var R={configurable:!0,enumerable:!0,value:Re,writable:!0};Object.defineProperties(console,{info:R,log:R,warn:R,error:R,group:R,groupCollapsed:R,groupEnd:R})}J8++}function _e(){if(J8--,J8===0){var R={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:pp({},R,{value:yd}),info:pp({},R,{value:Ux}),warn:pp({},R,{value:Eg}),error:pp({},R,{value:Z8}),group:pp({},R,{value:X2}),groupCollapsed:pp({},R,{value:e7}),groupEnd:pp({},R,{value:MF})})}0>J8&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function ye(R){if(t7===void 0)try{throw Error()}catch(q){var z=q.stack.trim().match(/\n( *(at )?)/);t7=z&&z[1]||"",mN=-1<q.stack.indexOf(`
    at`)?" (<anonymous>)":-1<q.stack.indexOf("@")?"@unknown:0:0":""}return`
`+t7+R+mN}function Se(R,z){if(!R||wM)return"";var q=BM.get(R);if(q!==void 0)return q;wM=!0,q=Error.prepareStackTrace,Error.prepareStackTrace=void 0;var pe=null;pe=zn.H,zn.H=null,we();try{var Ce={DetermineComponentFrameRoot:function(){try{if(z){var vr=function(){throw Error()};if(Object.defineProperty(vr.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==="object"&&Reflect.construct){try{Reflect.construct(vr,[])}catch(bl){var ts=bl}Reflect.construct(R,[],vr)}else{try{vr.call()}catch(bl){ts=bl}R.call(vr.prototype)}}else{try{throw Error()}catch(bl){ts=bl}(vr=R())&&typeof vr.catch==="function"&&vr.catch(function(){})}}catch(bl){if(bl&&ts&&typeof bl.stack==="string")return[bl.stack,ts.stack]}return[null,null]}};Ce.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var Te=Object.getOwnPropertyDescriptor(Ce.DetermineComponentFrameRoot,"name");Te&&Te.configurable&&Object.defineProperty(Ce.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var ut=Ce.DetermineComponentFrameRoot(),wt=ut[0],In=ut[1];if(wt&&In){var to=wt.split(`
`),Xo=In.split(`
`);for(ut=Te=0;Te<to.length&&!to[Te].includes("DetermineComponentFrameRoot");)Te++;for(;ut<Xo.length&&!Xo[ut].includes("DetermineComponentFrameRoot");)ut++;if(Te===to.length||ut===Xo.length)for(Te=to.length-1,ut=Xo.length-1;1<=Te&&0<=ut&&to[Te]!==Xo[ut];)ut--;for(;1<=Te&&0<=ut;Te--,ut--)if(to[Te]!==Xo[ut]){if(Te!==1||ut!==1)do if(Te--,ut--,0>ut||to[Te]!==Xo[ut]){var Zo=`
`+to[Te].replace(" at new "," at ");return R.displayName&&Zo.includes("<anonymous>")&&(Zo=Zo.replace("<anonymous>",R.displayName)),typeof R==="function"&&BM.set(R,Zo),Zo}while(1<=Te&&0<=ut);break}}}finally{wM=!1,zn.H=pe,_e(),Error.prepareStackTrace=q}return to=(to=R?R.displayName||R.name:"")?ye(to):"",typeof R==="function"&&BM.set(R,to),to}function Ne(R){var z=Error.prepareStackTrace;if(Error.prepareStackTrace=void 0,R=R.stack,Error.prepareStackTrace=z,R.startsWith(`Error: react-stack-top-frame
`)&&(R=R.slice(29)),z=R.indexOf(`
`),z!==-1&&(R=R.slice(z+1)),z=R.indexOf("react-stack-bottom-frame"),z!==-1&&(z=R.lastIndexOf(`
`,z)),z!==-1)R=R.slice(0,z);else return"";return R}function ke(R){switch(R.tag){case 26:case 27:case 5:return ye(R.type);case 16:return ye("Lazy");case 13:return ye("Suspense");case 19:return ye("SuspenseList");case 0:case 15:return Se(R.type,!1);case 11:return Se(R.type.render,!1);case 1:return Se(R.type,!0);case 31:return ye("Activity");default:return""}}function nt(R){try{var z="";do{z+=ke(R);var q=R._debugInfo;if(q)for(var pe=q.length-1;0<=pe;pe--){var Ce=q[pe];if(typeof Ce.name==="string"){var Te=z,ut=Ce.env,wt=ye(Ce.name+(ut?" ["+ut+"]":""));z=Te+wt}}R=R.return}while(R);return z}catch(In){return`
Error generating stack: `+In.message+`
`+In.stack}}function dt(R){return(R=R?R.displayName||R.name:"")?ye(R):""}function rt(R,z){if(typeof R==="object"&&R!==null){var q=n7.get(R);if(q!==void 0)return q;return z={value:R,source:z,stack:nt(z)},n7.set(R,z),z}return{value:R,source:z,stack:nt(z)}}function mt(R,z){Ht(),tb[L4++]=_N,tb[L4++]=jI,jI=R,_N=z}function lt(R,z,q){Ht(),h0[Mg++]=j2,h0[Mg++]=yy,h0[Mg++]=Xs,Xs=R;var pe=j2;R=yy;var Ce=32-m_(pe)-1;pe&=~(1<<Ce),q+=1;var Te=32-m_(z)+Ce;if(30<Te){var ut=Ce-Ce%5;Te=(pe&(1<<ut)-1).toString(32),pe>>=ut,Ce-=ut,j2=1<<32-m_(z)+Ce|q<<Ce|pe,yy=Te+R}else j2=1<<Te|q<<Ce|pe,yy=R}function Ct(R){Ht(),R.return!==null&&(mt(R,1),lt(R,1,0))}function Nt(R){for(;R===jI;)jI=tb[--L4],tb[L4]=null,_N=tb[--L4],tb[L4]=null;for(;R===Xs;)Xs=h0[--Mg],h0[Mg]=null,yy=h0[--Mg],h0[Mg]=null,j2=h0[--Mg],h0[Mg]=null}function Ht(){$a||console.error("Expected to be hydrating. This is a bug in React. Please file an issue.")}function Tt(R){return R===null&&console.error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue."),R}function et(R,z){T(Xf,z,R),T(KI,R,R),T(wg,null,R),z=Ox(z),B(wg,R),T(wg,z,R)}function vt(R){B(wg,R),B(KI,R),B(Xf,R)}function ht(){return Tt(wg.current)}function We(R){R.memoizedState!==null&&T(nb,R,R);var z=Tt(wg.current),q=dh(z,R.type);z!==q&&(T(KI,R,R),T(wg,q,R))}function Le(R){KI.current===R&&(B(wg,R),B(KI,R)),nb.current===R&&(B(nb,R),ql?WC._currentValue=kI:WC._currentValue2=kI)}function Ze(R,z){return R.serverProps===void 0&&R.serverTail.length===0&&R.children.length===1&&3<R.distanceFromLeaf&&R.distanceFromLeaf>15-z?Ze(R.children[0],z):R}function $e(R){return"  "+"  ".repeat(R)}function qe(R){return"+ "+"  ".repeat(R)}function ft(R){return"- "+"  ".repeat(R)}function It(R){switch(R.tag){case 26:case 27:case 5:return R.type;case 16:return"Lazy";case 13:return"Suspense";case 19:return"SuspenseList";case 0:case 15:return R=R.type,R.displayName||R.name||null;case 11:return R=R.type.render,R.displayName||R.name||null;case 1:return R=R.type,R.displayName||R.name||null;default:return null}}function ze(R,z){return wF.test(R)?(R=JSON.stringify(R),R.length>z-2?8>z?'{"..."}':"{"+R.slice(0,z-7)+'..."}':"{"+R+"}"):R.length>z?5>z?'{"..."}':R.slice(0,z-3)+"...":R}function Xe(R,z,q){var pe=120-2*q;if(z===null)return qe(q)+ze(R,pe)+`
`;if(typeof z==="string"){for(var Ce=0;Ce<z.length&&Ce<R.length&&z.charCodeAt(Ce)===R.charCodeAt(Ce);Ce++);return Ce>pe-8&&10<Ce&&(R="..."+R.slice(Ce-8),z="..."+z.slice(Ce-8)),qe(q)+ze(R,pe)+`
`+ft(q)+ze(z,pe)+`
`}return $e(q)+ze(R,pe)+`
`}function it(R){return Object.prototype.toString.call(R).replace(/^\[object (.*)\]$/,function(z,q){return q})}function St(R,z){switch(typeof R){case"string":return R=JSON.stringify(R),R.length>z?5>z?'"..."':R.slice(0,z-4)+'..."':R;case"object":if(R===null)return"null";if(Kc(R))return"[...]";if(R.$$typeof===mp)return(z=v(R.type))?"<"+z+">":"<...>";var q=it(R);if(q==="Object"){q="",z-=2;for(var pe in R)if(R.hasOwnProperty(pe)){var Ce=JSON.stringify(pe);if(Ce!=='"'+pe+'"'&&(pe=Ce),z-=pe.length-2,Ce=St(R[pe],15>z?z:15),z-=Ce.length,0>z){q+=q===""?"...":", ...";break}q+=(q===""?"":",")+pe+":"+Ce}return"{"+q+"}"}return q;case"function":return(z=R.displayName||R.name)?"function "+z:"function";default:return String(R)}}function kt(R,z){return typeof R!=="string"||wF.test(R)?"{"+St(R,z-2)+"}":R.length>z-2?5>z?'"..."':'"'+R.slice(0,z-5)+'..."':'"'+R+'"'}function Lt(R,z,q){var pe=120-q.length-R.length,Ce=[],Te;for(Te in z)if(z.hasOwnProperty(Te)&&Te!=="children"){var ut=kt(z[Te],120-q.length-Te.length-1);pe-=Te.length+ut.length+2,Ce.push(Te+"="+ut)}return Ce.length===0?q+"<"+R+`>
`:0<pe?q+"<"+R+" "+Ce.join(" ")+`>
`:q+"<"+R+`
`+q+"  "+Ce.join(`
`+q+"  ")+`
`+q+`>
`}function Wt(R,z,q){var pe="",Ce=pp({},z),Te;for(Te in R)if(R.hasOwnProperty(Te)){delete Ce[Te];var ut=120-2*q-Te.length-2,wt=St(R[Te],ut);z.hasOwnProperty(Te)?(ut=St(z[Te],ut),pe+=qe(q)+Te+": "+wt+`
`,pe+=ft(q)+Te+": "+ut+`
`):pe+=qe(q)+Te+": "+wt+`
`}for(var In in Ce)Ce.hasOwnProperty(In)&&(R=St(Ce[In],120-2*q-In.length-2),pe+=ft(q)+In+": "+R+`
`);return pe}function bn(R,z,q,pe){var Ce="",Te=new Map;for(to in q)q.hasOwnProperty(to)&&Te.set(to.toLowerCase(),to);if(Te.size===1&&Te.has("children"))Ce+=Lt(R,z,$e(pe));else{for(var ut in z)if(z.hasOwnProperty(ut)&&ut!=="children"){var wt=120-2*(pe+1)-ut.length-1,In=Te.get(ut.toLowerCase());if(In!==void 0){Te.delete(ut.toLowerCase());var to=z[ut];In=q[In];var Xo=kt(to,wt);wt=kt(In,wt),typeof to==="object"&&to!==null&&typeof In==="object"&&In!==null&&it(to)==="Object"&&it(In)==="Object"&&(2<Object.keys(to).length||2<Object.keys(In).length||-1<Xo.indexOf("...")||-1<wt.indexOf("..."))?Ce+=$e(pe+1)+ut+`={{
`+Wt(to,In,pe+2)+$e(pe+1)+`}}
`:(Ce+=qe(pe+1)+ut+"="+Xo+`
`,Ce+=ft(pe+1)+ut+"="+wt+`
`)}else Ce+=$e(pe+1)+ut+"="+kt(z[ut],wt)+`
`}Te.forEach(function(Zo){if(Zo!=="children"){var vr=120-2*(pe+1)-Zo.length-1;Ce+=ft(pe+1)+Zo+"="+kt(q[Zo],vr)+`
`}}),Ce=Ce===""?$e(pe)+"<"+R+`>
`:$e(pe)+"<"+R+`
`+Ce+$e(pe)+`>
`}if(R=q.children,z=z.children,typeof R==="string"||typeof R==="number"||typeof R==="bigint"){if(Te="",typeof z==="string"||typeof z==="number"||typeof z==="bigint")Te=""+z;Ce+=Xe(Te,""+R,pe+1)}else if(typeof z==="string"||typeof z==="number"||typeof z==="bigint")Ce=R==null?Ce+Xe(""+z,null,pe+1):Ce+Xe(""+z,void 0,pe+1);return Ce}function pn(R,z){var q=It(R);if(q===null){q="";for(R=R.child;R;)q+=pn(R,z),R=R.sibling;return q}return $e(z)+"<"+q+`>
`}function wn(R,z){var q=Ze(R,z);if(q!==R&&(R.children.length!==1||R.children[0]!==q))return $e(z)+`...
`+wn(q,z+1);q="";var pe=R.fiber._debugInfo;if(pe)for(var Ce=0;Ce<pe.length;Ce++){var Te=pe[Ce].name;typeof Te==="string"&&(q+=$e(z)+"<"+Te+`>
`,z++)}if(pe="",Ce=R.fiber.pendingProps,R.fiber.tag===6)pe=Xe(Ce,R.serverProps,z),z++;else if(Te=It(R.fiber),Te!==null)if(R.serverProps===void 0){pe=z;var ut=120-2*pe-Te.length-2,wt="";for(to in Ce)if(Ce.hasOwnProperty(to)&&to!=="children"){var In=kt(Ce[to],15);if(ut-=to.length+In.length+2,0>ut){wt+=" ...";break}wt+=" "+to+"="+In}pe=$e(pe)+"<"+Te+wt+`>
`,z++}else R.serverProps===null?(pe=Lt(Te,Ce,qe(z)),z++):typeof R.serverProps==="string"?console.error("Should not have matched a non HostText fiber to a Text node. This is a bug in React."):(pe=bn(Te,Ce,R.serverProps,z),z++);var to="";Ce=R.fiber.child;for(Te=0;Ce&&Te<R.children.length;)ut=R.children[Te],ut.fiber===Ce?(to+=wn(ut,z),Te++):to+=pn(Ce,z),Ce=Ce.sibling;Ce&&0<R.children.length&&(to+=$e(z)+`...
`),Ce=R.serverTail,R.serverProps===null&&z--;for(R=0;R<Ce.length;R++)Te=Ce[R],to=typeof Te==="string"?to+(ft(z)+ze(Te,120-2*z)+`
`):to+Lt(Te.type,Te.props,ft(z));return q+pe+to}function Fn(R){try{return`

`+wn(R,0)}catch(z){return""}}function mn(){if(SA===null)return"";var R=SA;try{var z="";switch(R.tag===6&&(R=R.return),R.tag){case 26:case 27:case 5:z+=ye(R.type);break;case 13:z+=ye("Suspense");break;case 19:z+=ye("SuspenseList");break;case 31:z+=ye("Activity");break;case 30:case 0:case 15:case 1:R._debugOwner||z!==""||(z+=dt(R.type));break;case 11:R._debugOwner||z!==""||(z+=dt(R.type.render))}for(;R;)if(typeof R.tag==="number"){var q=R;R=q._debugOwner;var pe=q._debugStack;R&&pe&&(typeof pe!=="string"&&(q._debugStack=pe=Ne(pe)),pe!==""&&(z+=`
`+pe))}else if(R.debugStack!=null){var Ce=R.debugStack;(R=R.owner)&&Ce&&(z+=`
`+Ne(Ce))}else break;var Te=z}catch(ut){Te=`
Error generating stack: `+ut.message+`
`+ut.stack}return Te}function _n(R,z,q,pe,Ce,Te,ut){var wt=SA;no(R);try{return R!==null&&R._debugTask?R._debugTask.run(z.bind(null,q,pe,Ce,Te,ut)):z(q,pe,Ce,Te,ut)}finally{no(wt)}throw Error("runWithFiberInDEV should never be called in production. This is a bug in React.")}function no(R){zn.getCurrentStack=R===null?null:mn,jf=!1,SA=R}function To(R,z){if(R.return===null){if(bu===null)bu={fiber:R,children:[],serverProps:void 0,serverTail:[],distanceFromLeaf:z};else{if(bu.fiber!==R)throw Error("Saw multiple hydration diff roots in a pass. This is a bug in React.");bu.distanceFromLeaf>z&&(bu.distanceFromLeaf=z)}return bu}var q=To(R.return,z+1).children;if(0<q.length&&q[q.length-1].fiber===R)return q=q[q.length-1],q.distanceFromLeaf>z&&(q.distanceFromLeaf=z),q;return z={fiber:R,children:[],serverProps:void 0,serverTail:[],distanceFromLeaf:z},q.push(z),z}function ir(R,z){xy||(R=To(R,0),R.serverProps=null,z!==null&&(z=YI(z),R.serverTail.push(z)))}function xt(R){var z="",q=bu;throw q!==null&&(bu=null,z=Fn(q)),nn(rt(Error(`Hydration failed because the server rendered HTML didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used:

- A server/client branch \`if (typeof window !== 'undefined')\`.
- Variable input such as \`Date.now()\` or \`Math.random()\` which changes each time it's called.
- Date formatting in a user's locale which doesn't match the server.
- External changing data without sending a snapshot of it along with the HTML.
- Invalid HTML tag nesting.

It can also happen if the client has a browser extension installed which messes with the HTML before React loaded.

https://react.dev/link/hydration-mismatch`+z),R)),TM}function gt(R,z){if(!Sg)throw Error("Expected prepareToHydrateHostInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.");aN(R.stateNode,R.type,R.memoizedProps,z,R)||xt(R)}function Ot(R){for(Sc=R.return;Sc;)switch(Sc.tag){case 5:case 13:La=!1;return;case 27:case 3:La=!0;return;default:Sc=Sc.return}}function Zt(R){if(!Sg||R!==Sc)return!1;if(!$a)return Ot(R),$a=!0,!1;var z=R.tag;if(l0?z!==3&&z!==27&&(z!==5||VI(R.type)&&!Yf(R.type,R.memoizedProps))&&Cu&&(je(R),xt(R)):z!==3&&(z!==5||VI(R.type)&&!Yf(R.type,R.memoizedProps))&&Cu&&(je(R),xt(R)),Ot(R),z===13){if(!Sg)throw Error("Expected skipPastDehydratedSuspenseInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.");if(R=R.memoizedState,R=R!==null?R.dehydrated:null,!R)throw Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");Cu=cN(R)}else Cu=l0&&z===27?Y8(R.type,Cu):Sc?Pg(R.stateNode):null;return!0}function je(R){for(var z=Cu;z;){var q=To(R,0),pe=YI(z);q.serverTail.push(pe),z=pe.type==="Suspense"?cN(z):Pg(z)}}function Mt(){Sg&&(Cu=Sc=null,xy=$a=!1)}function Kt(){var R=ob;return R!==null&&(mh===null?mh=R:mh.push.apply(mh,R),ob=null),R}function nn(R){ob===null?ob=[R]:ob.push(R)}function Zn(){var R=bu;if(R!==null){bu=null;for(var z=Fn(R);0<R.children.length;)R=R.children[0];_n(R.fiber,function(){console.error(`A tree hydrated but some attributes of the server rendered HTML didn't match the client properties. This won't be patched up. This can happen if a SSR-ed Client Component used:

- A server/client branch \`if (typeof window !== 'undefined')\`.
- Variable input such as \`Date.now()\` or \`Math.random()\` which changes each time it's called.
- Date formatting in a user's locale which doesn't match the server.
- External changing data without sending a snapshot of it along with the HTML.
- Invalid HTML tag nesting.

It can also happen if the client has a browser extension installed which messes with the HTML before React loaded.

%s%s`,"https://react.dev/link/hydration-mismatch",z)})}}function Vn(R,z){return R===z&&(R!==0||1/R===1/z)||R!==R&&z!==z}function Rn(){Wx=qI=null,H4=!1}function Bn(R,z,q){ql?(T(o7,z._currentValue,R),z._currentValue=q,T(__,z._currentRenderer,R),z._currentRenderer!==void 0&&z._currentRenderer!==null&&z._currentRenderer!==$I&&console.error("Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported."),z._currentRenderer=$I):(T(o7,z._currentValue2,R),z._currentValue2=q,T(gN,z._currentRenderer2,R),z._currentRenderer2!==void 0&&z._currentRenderer2!==null&&z._currentRenderer2!==$I&&console.error("Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported."),z._currentRenderer2=$I)}function ho(R,z){var q=o7.current;ql?(R._currentValue=q,q=__.current,B(__,z),R._currentRenderer=q):(R._currentValue2=q,q=gN.current,B(gN,z),R._currentRenderer2=q),B(o7,z)}function Qo(R,z,q){for(;R!==null;){var pe=R.alternate;if((R.childLanes&z)!==z?(R.childLanes|=z,pe!==null&&(pe.childLanes|=z)):pe!==null&&(pe.childLanes&z)!==z&&(pe.childLanes|=z),R===q)break;R=R.return}R!==q&&console.error("Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue.")}function Nn(R,z,q,pe){var Ce=R.child;Ce!==null&&(Ce.return=R);for(;Ce!==null;){var Te=Ce.dependencies;if(Te!==null){var ut=Ce.child;Te=Te.firstContext;e:for(;Te!==null;){var wt=Te;Te=Ce;for(var In=0;In<z.length;In++)if(wt.context===z[In]){Te.lanes|=q,wt=Te.alternate,wt!==null&&(wt.lanes|=q),Qo(Te.return,q,R),pe||(ut=null);break e}Te=wt.next}}else if(Ce.tag===18){if(ut=Ce.return,ut===null)throw Error("We just came from a parent so we must have had a parent. This is a bug in React.");ut.lanes|=q,Te=ut.alternate,Te!==null&&(Te.lanes|=q),Qo(ut,q,R),ut=null}else ut=Ce.child;if(ut!==null)ut.return=Ce;else for(ut=Ce;ut!==null;){if(ut===R){ut=null;break}if(Ce=ut.sibling,Ce!==null){Ce.return=ut.return,ut=Ce;break}ut=ut.return}Ce=ut}}function mo(R,z,q,pe){R=null;for(var Ce=z,Te=!1;Ce!==null;){if(!Te){if((Ce.flags&524288)!==0)Te=!0;else if((Ce.flags&262144)!==0)break}if(Ce.tag===10){var ut=Ce.alternate;if(ut===null)throw Error("Should have a current fiber. This is a bug in React.");if(ut=ut.memoizedProps,ut!==null){var wt=Ce.type;Mm(Ce.pendingProps.value,ut.value)||(R!==null?R.push(wt):R=[wt])}}else if(Ce===nb.current){if(ut=Ce.alternate,ut===null)throw Error("Should have a current fiber. This is a bug in React.");ut.memoizedState.memoizedState!==Ce.memoizedState.memoizedState&&(R!==null?R.push(WC):R=[WC])}Ce=Ce.return}R!==null&&Nn(z,R,q,pe),z.flags|=262144}function Io(R){for(R=R.firstContext;R!==null;){var z=R.context;if(!Mm(ql?z._currentValue:z._currentValue2,R.memoizedValue))return!0;R=R.next}return!1}function io(R){qI=R,Wx=null,R=R.dependencies,R!==null&&(R.firstContext=null)}function Wo(R){return H4&&console.error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()."),xr(qI,R)}function rr(R,z){return qI===null&&io(R),xr(R,z)}function xr(R,z){var q=ql?z._currentValue:z._currentValue2;if(z={context:z,memoizedValue:q,next:null},Wx===null){if(R===null)throw Error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().");Wx=z,R.dependencies={lanes:0,firstContext:z,_debugThenableState:null},R.flags|=524288}else Wx=Wx.next=z;return q}function Ci(){return{controller:new yoe,data:new Map,refCount:0}}function ea(R){R.controller.signal.aborted&&console.warn("A cache instance was retained after it was already freed. This likely indicates a bug in React."),R.refCount++}function ya(R){R.refCount--,0>R.refCount&&console.warn("A cache instance was released after it was already freed. This likely indicates a bug in React."),R.refCount===0&&TF(xoe,function(){R.controller.abort()})}function Oo(){var R=rb;return rb=0,R}function $i(R){var z=rb;return rb=R,z}function Ei(R){var z=rb;return rb+=R,z}function hs(R){g_=JI(),0>R.actualStartTime&&(R.actualStartTime=g_)}function il(R){if(0<=g_){var z=JI()-g_;R.actualDuration+=z,R.selfBaseDuration=z,g_=-1}}function kl(R){if(0<=g_){var z=JI()-g_;R.actualDuration+=z,g_=-1}}function Xc(){if(0<=g_){var R=JI()-g_;g_=-1,rb+=R}}function Od(){g_=JI()}function cp(R){for(var z=R.child;z;)R.actualDuration+=z.actualDuration,z=z.sibling}function or(R){R!==Kf&&R.next===null&&(Kf===null?F4=Kf=R:Kf=Kf.next=R),fN=!0,zn.actQueue!==null?DF||(DF=!0,xa()):i7||(i7=!0,xa())}function Gr(R,z){if(!yN&&fN){yN=!0;do{var q=!1;for(var pe=F4;pe!==null;){if(!z)if(R!==0){var Ce=pe.pendingLanes;if(Ce===0)var Te=0;else{var ut=pe.suspendedLanes,wt=pe.pingedLanes;Te=(1<<31-m_(42|R)+1)-1,Te&=Ce&~(ut&~wt),Te=Te&201326741?Te&201326741|1:Te?Te|2:0}Te!==0&&(q=!0,$1(pe,Te))}else Te=Fa,Te=H(pe,pe===Qh?Te:0,pe.cancelPendingCommit!==null||pe.timeoutHandle!==QI),(Te&3)===0||V(pe,Te)||(q=!0,$1(pe,Te));pe=pe.next}}while(q);yN=!1}}function ti(){$l()}function $l(){fN=DF=i7=!1;var R=0;ZI!==0&&(dF()&&(R=ZI),ZI=0);for(var z=Wf(),q=null,pe=F4;pe!==null;){var Ce=pe.next,Te=Ll(pe,z);if(Te===0)pe.next=null,q===null?F4=Ce:q.next=Ce,Ce===null&&(Kf=q);else if(q=pe,R!==0||(Te&3)!==0)fN=!0;pe=Ce}Gr(R,!1)}function Ll(R,z){for(var{suspendedLanes:q,pingedLanes:pe,expirationTimes:Ce}=R,Te=R.pendingLanes&-62914561;0<Te;){var ut=31-m_(Te),wt=1<<ut,In=Ce[ut];if(In===-1){if((wt&q)===0||(wt&pe)!==0)Ce[ut]=O(wt,z)}else In<=z&&(R.expiredLanes|=wt);Te&=~wt}if(z=Qh,q=Fa,q=H(R,R===z?q:0,R.cancelPendingCommit!==null||R.timeoutHandle!==QI),pe=R.callbackNode,q===0||R===z&&(es===d9||es===VM)||R.cancelPendingCommit!==null)return pe!==null&&fm(pe),R.callbackNode=null,R.callbackPriority=0;if((q&3)===0||V(R,q)){if(z=q&-q,z!==R.callbackPriority||zn.actQueue!==null&&pe!==NF)fm(pe);else return z;switch(Z(q)){case 2:case 8:q=pN;break;case 32:q=q8;break;case 268435456:q=qc;break;default:q=q8}return pe=Vd.bind(null,R),zn.actQueue!==null?(zn.actQueue.push(pe),q=NF):q=K8(q,pe),R.callbackPriority=z,R.callbackNode=q,z}return pe!==null&&fm(pe),R.callbackPriority=2,R.callbackNode=null,2}function Vd(R,z){if(AN=r7=!1,y_!==_0&&y_!==Poe)return R.callbackNode=null,R.callbackPriority=0,null;var q=R.callbackNode;if(YC(!0)&&R.callbackNode!==q)return null;var pe=Fa;if(pe=H(R,R===Qh?pe:0,R.cancelPendingCommit!==null||R.timeoutHandle!==QI),pe===0)return null;return FC(R,pe,z),Ll(R,Wf()),R.callbackNode!=null&&R.callbackNode===q?Vd.bind(null,R):null}function $1(R,z){if(YC())return null;r7=AN,AN=!1,FC(R,z,!0)}function fm(R){R!==NF&&R!==null&&XI(R)}function xa(){zn.actQueue!==null&&zn.actQueue.push(function(){return $l(),null}),XC?fd(function(){(Ac&(m0|MA))!==p0?K8(fy,ti):$l()}):K8(fy,ti)}function k0(){return ZI===0&&(ZI=U()),ZI}function ym(R,z){if(s7===null){var q=s7=[];Xx=0,e9=k0(),a7={status:"pending",value:void 0,then:function(pe){q.push(pe)}}}return Xx++,z.then(_u,_u),z}function _u(){if(--Xx===0&&s7!==null){a7!==null&&(a7.status="fulfilled");var R=s7;s7=null,e9=0,a7=null;for(var z=0;z<R.length;z++)(0,R[z])()}}function o0(R,z){var q=[],pe={status:"pending",value:null,reason:null,then:function(Ce){q.push(Ce)}};return R.then(function(){pe.status="fulfilled",pe.value=z;for(var Ce=0;Ce<q.length;Ce++)(0,q[Ce])(z)},function(Ce){pe.status="rejected",pe.reason=Ce;for(Ce=0;Ce<q.length;Ce++)(0,q[Ce])(void 0)}),pe}function Zi(){var R=z4.current;return R!==null?R:Qh.pooledCache}function Hl(R,z){z===null?T(z4,z4.current,R):T(z4,z.pool,R)}function da(){var R=Zi();return R===null?null:{parent:ql?Dh._currentValue:Dh._currentValue2,pool:R}}function zc(R,z){if(Mm(R,z))return!0;if(typeof R!=="object"||R===null||typeof z!=="object"||z===null)return!1;var q=Object.keys(R),pe=Object.keys(z);if(q.length!==pe.length)return!1;for(pe=0;pe<q.length;pe++){var Ce=q[pe];if(!wW.call(z,Ce)||!Mm(R[Ce],z[Ce]))return!1}return!0}function ua(){return{didWarnAboutUncachedPromise:!1,thenables:[]}}function ri(R){return R=R.status,R==="fulfilled"||R==="rejected"}function ic(){}function wh(R,z,q){zn.actQueue!==null&&(zn.didUsePromise=!0);var pe=R.thenables;switch(q=pe[q],q===void 0?pe.push(z):q!==z&&(R.didWarnAboutUncachedPromise||(R.didWarnAboutUncachedPromise=!0,console.error("A component was suspended by an uncached promise. Creating promises inside a Client Component or hook is not yet supported, except via a Suspense-compatible library or framework.")),z.then(ic,ic),z=q),z.status){case"fulfilled":return z.value;case"rejected":throw R=z.reason,Yd(R),R;default:if(typeof z.status==="string")z.then(ic,ic);else{if(R=Qh,R!==null&&100<R.shellSuspendCounter)throw Error("An unknown Component is an async Client Component. Only Server Components can be async at the moment. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server.");R=z,R.status="pending",R.then(function(Ce){if(z.status==="pending"){var Te=z;Te.status="fulfilled",Te.value=Ce}},function(Ce){if(z.status==="pending"){var Te=z;Te.status="rejected",Te.reason=Ce}})}switch(z.status){case"fulfilled":return z.value;case"rejected":throw R=z.reason,Yd(R),R}throw p7=z,wm=!0,u7}}function Qs(){if(p7===null)throw Error("Expected a suspended thenable. This is a bug in React. Please file an issue.");var R=p7;return p7=null,wm=!1,R}function Yd(R){if(R===u7||R===NM)throw Error("Hooks are not supported inside an async component. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server.")}function Bh(){for(var R=Y4,z=RM=Y4=0;z<R;){var q=A_[z];A_[z++]=null;var pe=A_[z];A_[z++]=null;var Ce=A_[z];A_[z++]=null;var Te=A_[z];if(A_[z++]=null,pe!==null&&Ce!==null){var ut=pe.pending;ut===null?Ce.next=Ce:(Ce.next=ut.next,ut.next=Ce),pe.pending=Ce}Te!==0&&q1(q,Ce,Te)}}function Gd(R,z,q,pe){A_[Y4++]=R,A_[Y4++]=z,A_[Y4++]=q,A_[Y4++]=pe,RM|=pe,R.lanes|=pe,R=R.alternate,R!==null&&(R.lanes|=pe)}function gA(R,z,q,pe){return Gd(R,z,q,pe),Tf(R)}function r0(R,z){return Gd(R,null,null,z),Tf(R)}function q1(R,z,q){R.lanes|=q;var pe=R.alternate;pe!==null&&(pe.lanes|=q);for(var Ce=!1,Te=R.return;Te!==null;)Te.childLanes|=q,pe=Te.alternate,pe!==null&&(pe.childLanes|=q),Te.tag===22&&(R=Te.stateNode,R===null||R._visibility&1||(Ce=!0)),R=Te,Te=Te.return;return R.tag===3?(Te=R.stateNode,Ce&&z!==null&&(Ce=31-m_(q),R=Te.hiddenUpdates,pe=R[Ce],pe===null?R[Ce]=[z]:pe.push(z),z.lane=q|536870912),Te):null}function Tf(R){if(NN>dNe)throw B7=NN=0,RN=OW=null,Error("Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.");B7>z_e&&(B7=0,RN=null,console.error("Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render.")),R.alternate===null&&(R.flags&4098)!==0&&iF(R);for(var z=R,q=z.return;q!==null;)z.alternate===null&&(z.flags&4098)!==0&&iF(R),z=q,q=z.return;return z.tag===3?z.stateNode:null}function lp(R){R.updateQueue={baseState:R.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function fg(R,z){R=R.updateQueue,z.updateQueue===R&&(z.updateQueue={baseState:R.baseState,firstBaseUpdate:R.firstBaseUpdate,lastBaseUpdate:R.lastBaseUpdate,shared:R.shared,callbacks:null})}function gu(R){return{lane:R,tag:QM,payload:null,callback:null,next:null}}function a_(R,z,q){var pe=R.updateQueue;if(pe===null)return null;if(pe=pe.shared,HF===pe&&!LF){var Ce=P(R);console.error(`An update (setState, replaceState, or forceUpdate) was scheduled from inside an update function. Update functions should be pure, with zero side-effects. Consider using componentDidUpdate or a callback.

Please update the following component: %s`,Ce),LF=!0}if((Ac&m0)!==p0)return Ce=pe.pending,Ce===null?z.next=z:(z.next=Ce.next,Ce.next=z),pe.pending=z,z=Tf(R),q1(R,null,q),z;return Gd(R,pe,z,q),Tf(R)}function Kh(R,z,q){if(z=z.updateQueue,z!==null&&(z=z.shared,(q&4194048)!==0)){var pe=z.lanes;pe&=R.pendingLanes,q|=pe,z.lanes=q,ee(R,q)}}function Nx(R,z){var q=R.updateQueue,pe=R.alternate;if(pe!==null&&(pe=pe.updateQueue,q===pe)){var Ce=null,Te=null;if(q=q.firstBaseUpdate,q!==null){do{var ut={lane:q.lane,tag:q.tag,payload:q.payload,callback:null,next:null};Te===null?Ce=Te=ut:Te=Te.next=ut,q=q.next}while(q!==null);Te===null?Ce=Te=z:Te=Te.next=z}else Ce=Te=z;q={baseState:pe.baseState,firstBaseUpdate:Ce,lastBaseUpdate:Te,shared:pe.shared,callbacks:pe.callbacks},R.updateQueue=q;return}R=q.lastBaseUpdate,R===null?q.firstBaseUpdate=z:R.next=z,q.lastBaseUpdate=z}function c_(){if(bN){var R=a7;if(R!==null)throw R}}function N2(R,z,q,pe){bN=!1;var Ce=R.updateQueue;G4=!1,HF=Ce.shared;var{firstBaseUpdate:Te,lastBaseUpdate:ut}=Ce,wt=Ce.shared.pending;if(wt!==null){Ce.shared.pending=null;var In=wt,to=In.next;In.next=null,ut===null?Te=to:ut.next=to,ut=In;var Xo=R.alternate;Xo!==null&&(Xo=Xo.updateQueue,wt=Xo.lastBaseUpdate,wt!==ut&&(wt===null?Xo.firstBaseUpdate=to:wt.next=to,Xo.lastBaseUpdate=In))}if(Te!==null){var Zo=Ce.baseState;ut=0,Xo=to=In=null,wt=Te;do{var vr=wt.lane&-536870913,ts=vr!==wt.lane;if(ts?(Fa&vr)===vr:(pe&vr)===vr){vr!==0&&vr===e9&&(bN=!0),Xo!==null&&(Xo=Xo.next={lane:0,tag:wt.tag,payload:wt.payload,callback:null,next:null});e:{vr=R;var bl=wt,kN=z,LN=q;switch(bl.tag){case QF:if(bl=bl.payload,typeof bl==="function"){H4=!0;var e3=bl.call(LN,Zo,kN);if(vr.mode&8){ie(!0);try{bl.call(LN,Zo,kN)}finally{ie(!1)}}H4=!1,Zo=e3;break e}Zo=bl;break e;case kF:vr.flags=vr.flags&-65537|128;case QM:if(e3=bl.payload,typeof e3==="function"){if(H4=!0,bl=e3.call(LN,Zo,kN),vr.mode&8){ie(!0);try{e3.call(LN,Zo,kN)}finally{ie(!1)}}H4=!1}else bl=e3;if(bl===null||bl===void 0)break e;Zo=pp({},Zo,bl);break e;case kM:G4=!0}}vr=wt.callback,vr!==null&&(R.flags|=64,ts&&(R.flags|=8192),ts=Ce.callbacks,ts===null?Ce.callbacks=[vr]:ts.push(vr))}else ts={lane:vr,tag:wt.tag,payload:wt.payload,callback:wt.callback,next:null},Xo===null?(to=Xo=ts,In=Zo):Xo=Xo.next=ts,ut|=vr;if(wt=wt.next,wt===null)if(wt=Ce.shared.pending,wt===null)break;else ts=wt,wt=ts.next,ts.next=null,Ce.lastBaseUpdate=ts,Ce.shared.pending=null}while(1);Xo===null&&(In=Zo),Ce.baseState=In,Ce.firstBaseUpdate=to,Ce.lastBaseUpdate=Xo,Te===null&&(Ce.shared.lanes=0),P7|=ut,R.lanes=ut,R.memoizedState=Zo}HF=null}function J1(R,z){if(typeof R!=="function")throw Error("Invalid argument passed as callback. Expected a function. Instead received: "+R);R.call(z)}function hI(R,z){var q=R.shared.hiddenCallbacks;if(q!==null)for(R.shared.hiddenCallbacks=null,R=0;R<q.length;R++)J1(q[R],z)}function L0(R,z){var q=R.callbacks;if(q!==null)for(R.callbacks=null,R=0;R<q.length;R++)J1(q[R],z)}function dI(R,z){var q=_b;T(_7,q,R),T(m7,z,R),_b=q|z.baseLanes}function Z1(R){T(_7,_b,R),T(m7,m7.current,R)}function Ud(R){_b=_7.current,B(m7,R),B(_7,R)}function Us(){var R=$n;$f===null?$f=[R]:$f.push(R)}function Bo(){var R=$n;if($f!==null&&(EA++,$f[EA]!==R)){var z=P(Ji);if(!BW.has(z)&&(BW.add(z),$f!==null)){for(var q="",pe=0;pe<=EA;pe++){var Ce=$f[pe],Te=pe===EA?R:Ce;for(Ce=pe+1+". "+Ce;30>Ce.length;)Ce+=" ";Ce+=Te+`
`,q+=Ce}console.error(`React has detected a change in the order of Hooks called by %s. This will lead to bugs and errors if not fixed. For more information, read the Rules of Hooks: https://react.dev/link/rules-of-hooks

   Previous render            Next render
   ------------------------------------------------------
%s   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
`,z,q)}}}function _d(R){R===void 0||R===null||Kc(R)||console.error("%s received a final argument that is not an array (instead, received `%s`). When specified, the final argument must be an array.",$n,typeof R)}function sl(){var R=P(Ji);TW.has(R)||(TW.add(R),console.error("ReactDOM.useFormState has been renamed to React.useActionState. Please update %s to use React.useActionState.",R))}function Sa(){throw Error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`)}function AA(R,z){if(HM)return!1;if(z===null)return console.error("%s received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders.",$n),!1;R.length!==z.length&&console.error(`The final argument passed to %s changed size between renders. The order and size of this array must remain constant.

Previous: %s
Incoming: %s`,$n,"["+z.join(", ")+"]","["+R.join(", ")+"]");for(var q=0;q<z.length&&q<R.length;q++)if(!Mm(R[q],z[q]))return!1;return!0}function MC(R,z,q,pe,Ce,Te){if(U4=Te,Ji=z,$f=R!==null?R._debugHookTypes:null,EA=-1,HM=R!==null&&R.type!==z.type,Object.prototype.toString.call(q)==="[object AsyncFunction]"||Object.prototype.toString.call(q)==="[object AsyncGeneratorFunction]")Te=P(Ji),LM.has(Te)||(LM.add(Te),console.error("%s is an async Client Component. Only Server Components can be async at the moment. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server.",Te===null?"An unknown Component":"<"+Te+">"));z.memoizedState=null,z.updateQueue=null,z.lanes=0,zn.H=R!==null&&R.memoizedState!==null?vN:$f!==null?i9:ab,W4=Te=(z.mode&8)!==Cl;var ut=SN(q,pe,Ce);if(W4=!1,sb&&(ut=wC(z,q,pe,Ce)),Te){ie(!0);try{ut=wC(z,q,pe,Ce)}finally{ie(!1)}}return dD(R,z),ut}function dD(R,z){z._debugHookTypes=$f,z.dependencies===null?jx!==null&&(z.dependencies={lanes:0,firstContext:null,_debugThenableState:jx}):z.dependencies._debugThenableState=jx,zn.H=g7;var q=ll!==null&&ll.next!==null;if(U4=0,$f=$n=d0=ll=Ji=null,EA=-1,R!==null&&(R.flags&65011712)!==(z.flags&65011712)&&console.error("Internal React error: Expected static flag was missing. Please notify the React team."),Tm=!1,r9=0,jx=null,q)throw Error("Rendered fewer hooks than expected. This may be caused by an accidental early return statement.");R===null||Vl||(R=R.dependencies,R!==null&&Io(R)&&(Vl=!0)),wm?(wm=!1,R=!0):R=!1,R&&(z=P(z)||"Unknown",IN.has(z)||LM.has(z)||(IN.add(z),console.error("`use` was called from inside a try/catch block. This is not allowed and can lead to unexpected behavior. To handle errors triggered by `use`, wrap your component in a error boundary.")))}function wC(R,z,q,pe){Ji=R;var Ce=0;do{if(sb&&(jx=null),r9=0,sb=!1,Ce>=NW)throw Error("Too many re-renders. React limits the number of renders to prevent an infinite loop.");if(Ce+=1,HM=!1,d0=ll=null,R.updateQueue!=null){var Te=R.updateQueue;Te.lastEffect=null,Te.events=null,Te.stores=null,Te.memoCache!=null&&(Te.memoCache.index=0)}EA=-1,zn.H=A7,Te=SN(z,q,pe)}while(sb);return Te}function YH(){var R=zn.H,z=R.useState()[0];return z=typeof z.then==="function"?yg(z):z,R=R.useState()[0],(ll!==null?ll.memoizedState:null)!==R&&(Ji.flags|=1024),z}function b4(){var R=X4!==0;return X4=0,R}function I4(R,z,q){z.updateQueue=R.updateQueue,z.flags=(z.mode&16)!==Cl?z.flags&-402655237:z.flags&-2053,R.lanes&=~q}function A8(R){if(Tm){for(R=R.memoizedState;R!==null;){var z=R.queue;z!==null&&(z.pending=null),R=R.next}Tm=!1}U4=0,$f=d0=ll=Ji=null,EA=-1,$n=null,sb=!1,r9=X4=0,jx=null}function i0(){var R={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return d0===null?Ji.memoizedState=d0=R:d0=d0.next=R,d0}function jc(){if(ll===null){var R=Ji.alternate;R=R!==null?R.memoizedState:null}else R=ll.next;var z=d0===null?Ji.memoizedState:d0.next;if(z!==null)d0=z,ll=R;else{if(R===null){if(Ji.alternate===null)throw Error("Update hook called on initial render. This is likely a bug in React. Please file an issue.");throw Error("Rendered more hooks than during the previous render.")}ll=R,R={memoizedState:ll.memoizedState,baseState:ll.baseState,baseQueue:ll.baseQueue,queue:ll.queue,next:null},d0===null?Ji.memoizedState=d0=R:d0=d0.next=R}return d0}function f8(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function yg(R){var z=r9;return r9+=1,jx===null&&(jx=ua()),R=wh(jx,R,z),z=Ji,(d0===null?z.memoizedState:d0.next)===null&&(z=z.alternate,zn.H=z!==null&&z.memoizedState!==null?vN:ab),R}function ey(R){if(R!==null&&typeof R==="object"){if(typeof R.then==="function")return yg(R);if(R.$$typeof===dy)return Wo(R)}throw Error("An unsupported type was passed to use(): "+String(R))}function xm(R){var z=null,q=Ji.updateQueue;if(q!==null&&(z=q.memoCache),z==null){var pe=Ji.alternate;pe!==null&&(pe=pe.updateQueue,pe!==null&&(pe=pe.memoCache,pe!=null&&(z={data:pe.data.map(function(Ce){return Ce.slice()}),index:0})))}if(z==null&&(z={data:[],index:0}),q===null&&(q=f8(),Ji.updateQueue=q),q.memoCache=z,q=z.data[z.index],q===void 0||HM)for(q=z.data[z.index]=Array(R),pe=0;pe<R;pe++)q[pe]=k4;else q.length!==R&&console.error("Expected a constant size argument for each invocation of useMemoCache. The previous cache was allocated with size %s but size %s was requested.",q.length,R);return z.index++,q}function hp(R,z){return typeof z==="function"?z(R):z}function Cm(R,z,q){var pe=i0();if(q!==void 0){var Ce=q(z);if(W4){ie(!0);try{q(z)}finally{ie(!1)}}}else Ce=z;return pe.memoizedState=pe.baseState=Ce,R={pending:null,lanes:0,dispatch:null,lastRenderedReducer:R,lastRenderedState:Ce},pe.queue=R,R=R.dispatch=TC.bind(null,Ji,R),[pe.memoizedState,R]}function bm(R){var z=jc();return y8(z,ll,R)}function y8(R,z,q){var pe=R.queue;if(pe===null)throw Error("Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)");pe.lastRenderedReducer=q;var Ce=R.baseQueue,Te=pe.pending;if(Te!==null){if(Ce!==null){var ut=Ce.next;Ce.next=Te.next,Te.next=ut}z.baseQueue!==Ce&&console.error("Internal error: Expected work-in-progress queue to be a clone. This is a bug in React."),z.baseQueue=Ce=Te,pe.pending=null}if(Te=R.baseState,Ce===null)R.memoizedState=Te;else{z=Ce.next;var wt=ut=null,In=null,to=z,Xo=!1;do{var Zo=to.lane&-536870913;if(Zo!==to.lane?(Fa&Zo)===Zo:(U4&Zo)===Zo){var vr=to.revertLane;if(vr===0)In!==null&&(In=In.next={lane:0,revertLane:0,action:to.action,hasEagerState:to.hasEagerState,eagerState:to.eagerState,next:null}),Zo===e9&&(Xo=!0);else if((U4&vr)===vr){to=to.next,vr===e9&&(Xo=!0);continue}else Zo={lane:0,revertLane:to.revertLane,action:to.action,hasEagerState:to.hasEagerState,eagerState:to.eagerState,next:null},In===null?(wt=In=Zo,ut=Te):In=In.next=Zo,Ji.lanes|=vr,P7|=vr;Zo=to.action,W4&&q(Te,Zo),Te=to.hasEagerState?to.eagerState:q(Te,Zo)}else vr={lane:Zo,revertLane:to.revertLane,action:to.action,hasEagerState:to.hasEagerState,eagerState:to.eagerState,next:null},In===null?(wt=In=vr,ut=Te):In=In.next=vr,Ji.lanes|=Zo,P7|=Zo;to=to.next}while(to!==null&&to!==z);if(In===null?ut=Te:In.next=wt,!Mm(Te,R.memoizedState)&&(Vl=!0,Xo&&(q=a7,q!==null)))throw q;R.memoizedState=Te,R.baseState=ut,R.baseQueue=In,pe.lastRenderedState=Te}return Ce===null&&(pe.lanes=0),[R.memoizedState,pe.dispatch]}function l_(R){var z=jc(),q=z.queue;if(q===null)throw Error("Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)");q.lastRenderedReducer=R;var{dispatch:pe,pending:Ce}=q,Te=z.memoizedState;if(Ce!==null){q.pending=null;var ut=Ce=Ce.next;do Te=R(Te,ut.action),ut=ut.next;while(ut!==Ce);Mm(Te,z.memoizedState)||(Vl=!0),z.memoizedState=Te,z.baseQueue===null&&(z.baseState=Te),q.lastRenderedState=Te}return[Te,pe]}function KE(R,z,q){var pe=Ji,Ce=i0();if($a){if(q===void 0)throw Error("Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.");var Te=q();o9||Te===q()||(console.error("The result of getServerSnapshot should be cached to avoid an infinite loop"),o9=!0)}else{if(Te=z(),o9||(q=z(),Mm(Te,q)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),o9=!0)),Qh===null)throw Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");(Fa&124)!==0||Df(pe,z,Te)}return Ce.memoizedState=Te,q={value:Te,getSnapshot:z},Ce.queue=q,vc(uI.bind(null,pe,q,R),[R]),pe.flags|=2048,Dr($h|Nh,ta(),Fp.bind(null,pe,q,Te,z),null),Te}function H0(R,z,q){var pe=Ji,Ce=jc(),Te=$a;if(Te){if(q===void 0)throw Error("Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.");q=q()}else if(q=z(),!o9){var ut=z();Mm(q,ut)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),o9=!0)}if(ut=!Mm((ll||Ce).memoizedState,q))Ce.memoizedState=q,Vl=!0;Ce=Ce.queue;var wt=uI.bind(null,pe,Ce,R);if(na(2048,Nh,wt,[R]),Ce.getSnapshot!==z||ut||d0!==null&&d0.memoizedState.tag&$h){if(pe.flags|=2048,Dr($h|Nh,ta(),Fp.bind(null,pe,Ce,q,z),null),Qh===null)throw Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");Te||(U4&124)!==0||Df(pe,z,q)}return q}function Df(R,z,q){R.flags|=16384,R={getSnapshot:z,value:q},z=Ji.updateQueue,z===null?(z=f8(),Ji.updateQueue=z,z.stores=[R]):(q=z.stores,q===null?z.stores=[R]:q.push(R))}function Fp(R,z,q,pe){z.value=q,z.getSnapshot=pe,lh(z)&&Nf(R)}function uI(R,z,q){return q(function(){lh(z)&&Nf(R)})}function lh(R){var z=R.getSnapshot;R=R.value;try{var q=z();return!Mm(R,q)}catch(pe){return!0}}function Nf(R){var z=r0(R,2);z!==null&&Wd(z,R,2)}function BC(R){var z=i0();if(typeof R==="function"){var q=R;if(R=q(),W4){ie(!0);try{q()}finally{ie(!1)}}}return z.memoizedState=z.baseState=R,z.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:hp,lastRenderedState:R},z}function ty(R){R=BC(R);var z=R.queue,q=eM.bind(null,Ji,z);return z.dispatch=q,[R.memoizedState,q]}function ny(R){var z=i0();z.memoizedState=z.baseState=R;var q={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return z.queue=q,z=b8.bind(null,Ji,!0,q),q.dispatch=z,[R,z]}function s0(R,z){var q=jc();return $E(q,ll,R,z)}function $E(R,z,q,pe){return R.baseState=q,y8(R,ll,typeof pe==="function"?pe:hp)}function v4(R,z){var q=jc();if(ll!==null)return $E(q,ll,R,z);return q.baseState=R,[R,q.queue.dispatch]}function qE(R,z,q,pe,Ce){if(DC(R))throw Error("Cannot update form state while rendering.");if(R=z.action,R!==null){var Te={payload:Ce,action:R,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(ut){Te.listeners.push(ut)}};zn.T!==null?q(!0):Te.isTransition=!1,pe(Te),q=z.pending,q===null?(Te.next=z.pending=Te,S4(z,Te)):(Te.next=q.next,z.pending=q.next=Te)}}function S4(R,z){var{action:q,payload:pe}=z,Ce=R.state;if(z.isTransition){var Te=zn.T,ut={};zn.T=ut,zn.T._updatedFibers=new Set;try{var wt=q(Ce,pe),In=zn.S;In!==null&&In(ut,wt),Je(R,z,wt)}catch(to){Dt(R,z,to)}finally{zn.T=Te,Te===null&&ut._updatedFibers&&(R=ut._updatedFibers.size,ut._updatedFibers.clear(),10<R&&console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."))}}else try{ut=q(Ce,pe),Je(R,z,ut)}catch(to){Dt(R,z,to)}}function Je(R,z,q){q!==null&&typeof q==="object"&&typeof q.then==="function"?(q.then(function(pe){ct(R,z,pe)},function(pe){return Dt(R,z,pe)}),z.isTransition||console.error("An async function with useActionState was called outside of a transition. This is likely not what you intended (for example, isPending will not update correctly). Either call the returned function inside startTransition, or pass it to an `action` or `formAction` prop.")):ct(R,z,q)}function ct(R,z,q){z.status="fulfilled",z.value=q,tn(z),R.state=q,z=R.pending,z!==null&&(q=z.next,q===z?R.pending=null:(q=q.next,z.next=q,S4(R,q)))}function Dt(R,z,q){var pe=R.pending;if(R.pending=null,pe!==null){pe=pe.next;do z.status="rejected",z.reason=q,tn(z),z=z.next;while(z!==pe)}R.action=null}function tn(R){R=R.listeners;for(var z=0;z<R.length;z++)(0,R[z])()}function xn(R,z){return z}function Mn(R,z){if($a){var q=Qh.formState;if(q!==null){e:{var pe=Ji;if($a){if(Cu){var Ce=_y(Cu,La);if(Ce){Cu=Pg(Ce),pe=IW(Ce);break e}}xt(pe)}pe=!1}pe&&(z=q[0])}}q=i0(),q.memoizedState=q.baseState=z,pe={pending:null,lanes:0,dispatch:null,lastRenderedReducer:xn,lastRenderedState:z},q.queue=pe,q=eM.bind(null,Ji,pe),pe.dispatch=q,pe=BC(!1);var Te=b8.bind(null,Ji,!1,pe.queue);return pe=i0(),Ce={state:z,dispatch:null,action:R,pending:null},pe.queue=Ce,q=qE.bind(null,Ji,Ce,Te,q),Ce.dispatch=q,pe.memoizedState=R,[z,q,!1]}function Ln(R){var z=jc();return uo(z,ll,R)}function uo(R,z,q){if(z=y8(R,z,xn)[0],R=bm(hp)[0],typeof z==="object"&&z!==null&&typeof z.then==="function")try{var pe=yg(z)}catch(ut){if(ut===u7)throw NM;throw ut}else pe=z;z=jc();var Ce=z.queue,Te=Ce.dispatch;return q!==z.memoizedState&&(Ji.flags|=2048,Dr($h|Nh,ta(),ko.bind(null,Ce,q),null)),[pe,Te,R]}function ko(R,z){R.action=z}function tr(R){var z=jc(),q=ll;if(q!==null)return uo(z,q,R);jc(),z=z.memoizedState,q=jc();var pe=q.queue.dispatch;return q.memoizedState=R,[z,pe,!1]}function Dr(R,z,q,pe){return R={tag:R,create:q,deps:pe,inst:z,next:null},z=Ji.updateQueue,z===null&&(z=f8(),Ji.updateQueue=z),q=z.lastEffect,q===null?z.lastEffect=R.next=R:(pe=q.next,q.next=R,R.next=pe,z.lastEffect=R),R}function ta(){return{destroy:void 0,resource:void 0}}function Pa(R){var z=i0();return R={current:R},z.memoizedState=R}function Ws(R,z,q,pe){var Ce=i0();pe=pe===void 0?null:pe,Ji.flags|=R,Ce.memoizedState=Dr($h|z,ta(),q,pe)}function na(R,z,q,pe){var Ce=jc();pe=pe===void 0?null:pe;var Te=Ce.memoizedState.inst;ll!==null&&pe!==null&&AA(pe,ll.memoizedState.deps)?Ce.memoizedState=Dr(z,Te,q,pe):(Ji.flags|=R,Ce.memoizedState=Dr($h|z,Te,q,pe))}function vc(R,z){(Ji.mode&16)!==Cl&&(Ji.mode&64)===Cl?Ws(276826112,Nh,R,z):Ws(8390656,Nh,R,z)}function zp(R,z){var q=4194308;return(Ji.mode&16)!==Cl&&(q|=134217728),Ws(q,Ap,R,z)}function jt(R,z){if(typeof z==="function"){R=R();var q=z(R);return function(){typeof q==="function"?q():z(null)}}if(z!==null&&z!==void 0)return z.hasOwnProperty("current")||console.error("Expected useImperativeHandle() first argument to either be a ref callback or React.createRef() object. Instead received: %s.","an object with keys {"+Object.keys(z).join(", ")+"}"),R=R(),z.current=R,function(){z.current=null}}function vn(R,z,q){typeof z!=="function"&&console.error("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.",z!==null?typeof z:"null"),q=q!==null&&q!==void 0?q.concat([R]):null;var pe=4194308;(Ji.mode&16)!==Cl&&(pe|=134217728),Ws(pe,Ap,jt.bind(null,z,R),q)}function oo(R,z,q){typeof z!=="function"&&console.error("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.",z!==null?typeof z:"null"),q=q!==null&&q!==void 0?q.concat([R]):null,na(4,Ap,jt.bind(null,z,R),q)}function vo(R,z){return i0().memoizedState=[R,z===void 0?null:z],R}function pi(R,z){var q=jc();z=z===void 0?null:z;var pe=q.memoizedState;if(z!==null&&AA(z,pe[1]))return pe[0];return q.memoizedState=[R,z],R}function oa(R,z){var q=i0();z=z===void 0?null:z;var pe=R();if(W4){ie(!0);try{R()}finally{ie(!1)}}return q.memoizedState=[pe,z],pe}function ds(R,z){var q=jc();z=z===void 0?null:z;var pe=q.memoizedState;if(z!==null&&AA(z,pe[1]))return pe[0];if(pe=R(),W4){ie(!0);try{R()}finally{ie(!1)}}return q.memoizedState=[pe,z],pe}function Ea(R,z){var q=i0();return Cg(q,R,z)}function Th(R,z){var q=jc();return Fl(q,ll.memoizedState,R,z)}function xg(R,z){var q=jc();return ll===null?Cg(q,R,z):Fl(q,ll.memoizedState,R,z)}function Cg(R,z,q){if(q===void 0||(U4&1073741824)!==0)return R.memoizedState=z;return R.memoizedState=q,R=EI(),Ji.lanes|=R,P7|=R,q}function Fl(R,z,q,pe){if(Mm(q,z))return q;if(m7.current!==null)return R=Cg(R,q,pe),Mm(R,z)||(Vl=!0),R;if((U4&42)===0)return Vl=!0,R.memoizedState=q;return R=EI(),Ji.lanes|=R,P7|=R,z}function JE(R,z,q,pe,Ce){var Te=py();yu(Te!==0&&8>Te?Te:8);var ut=zn.T,wt={};zn.T=wt,b8(R,!1,z,q),wt._updatedFibers=new Set;try{var In=Ce(),to=zn.S;if(to!==null&&to(wt,In),In!==null&&typeof In==="object"&&typeof In.then==="function"){var Xo=o0(In,pe);M4(R,z,Xo,u_(R))}else M4(R,z,pe,u_(R))}catch(Zo){M4(R,z,{then:function(){},status:"rejected",reason:Zo},u_(R))}finally{yu(Te),zn.T=ut,ut===null&&wt._updatedFibers&&(R=wt._updatedFibers.size,wt._updatedFibers.clear(),10<R&&console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."))}}function P4(R){var z=R.memoizedState;if(z!==null)return z;z={memoizedState:kI,baseState:kI,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:hp,lastRenderedState:kI},next:null};var q={};return z.next={memoizedState:q,baseState:q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:hp,lastRenderedState:q},next:null},R.memoizedState=z,R=R.alternate,R!==null&&(R.memoizedState=z),z}function E4(){var R=BC(!1);return R=JE.bind(null,Ji,R.queue,!0,!1),i0().memoizedState=R,[!1,R]}function GH(){var R=bm(hp)[0],z=jc().memoizedState;return[typeof R==="boolean"?R:yg(R),z]}function ZE(){var R=l_(hp)[0],z=jc().memoizedState;return[typeof R==="boolean"?R:yg(R),z]}function fA(){return Wo(WC)}function Rf(){var R=i0(),z=Qh.identifierPrefix;if($a){var q=yy,pe=j2;q=(pe&~(1<<32-m_(pe)-1)).toString(32)+q,z="«"+z+"R"+q,q=X4++,0<q&&(z+="H"+q.toString(32)),z+="»"}else q=DW++,z="«"+z+"r"+q.toString(32)+"»";return R.memoizedState=z}function x8(){return i0().memoizedState=C8.bind(null,Ji)}function C8(R,z){for(var q=R.return;q!==null;){switch(q.tag){case 24:case 3:var pe=u_(q);R=gu(pe);var Ce=a_(q,R,pe);Ce!==null&&(Wd(Ce,q,pe),Kh(Ce,q,pe)),q=Ci(),z!==null&&z!==void 0&&Ce!==null&&console.error("The seed argument is not enabled outside experimental channels."),R.payload={cache:q};return}q=q.return}}function TC(R,z,q){var pe=arguments;typeof pe[3]==="function"&&console.error("State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()."),pe=u_(R);var Ce={lane:pe,revertLane:0,action:q,hasEagerState:!1,eagerState:null,next:null};DC(R)?w4(z,Ce):(Ce=gA(R,z,Ce,pe),Ce!==null&&(Wd(Ce,R,pe),R2(Ce,z,pe))),Me(R,pe)}function eM(R,z,q){var pe=arguments;typeof pe[3]==="function"&&console.error("State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()."),pe=u_(R),M4(R,z,q,pe),Me(R,pe)}function M4(R,z,q,pe){var Ce={lane:pe,revertLane:0,action:q,hasEagerState:!1,eagerState:null,next:null};if(DC(R))w4(z,Ce);else{var Te=R.alternate;if(R.lanes===0&&(Te===null||Te.lanes===0)&&(Te=z.lastRenderedReducer,Te!==null)){var ut=zn.H;zn.H=fp;try{var wt=z.lastRenderedState,In=Te(wt,q);if(Ce.hasEagerState=!0,Ce.eagerState=In,Mm(In,wt))return Gd(R,z,Ce,0),Qh===null&&Bh(),!1}catch(to){}finally{zn.H=ut}}if(q=gA(R,z,Ce,pe),q!==null)return Wd(q,R,pe),R2(q,z,pe),!0}return!1}function b8(R,z,q,pe){if(zn.T===null&&e9===0&&console.error("An optimistic state update occurred outside a transition or action. To fix, move the update to an action, or wrap with startTransition."),pe={lane:2,revertLane:k0(),action:pe,hasEagerState:!1,eagerState:null,next:null},DC(R)){if(z)throw Error("Cannot update optimistic state while rendering.");console.error("Cannot call startTransition while rendering.")}else z=gA(R,q,pe,2),z!==null&&Wd(z,R,2);Me(R,2)}function DC(R){var z=R.alternate;return R===Ji||z!==null&&z===Ji}function w4(R,z){sb=Tm=!0;var q=R.pending;q===null?z.next=z:(z.next=q.next,q.next=z),R.pending=z}function R2(R,z,q){if((q&4194048)!==0){var pe=z.lanes;pe&=R.pendingLanes,q|=pe,z.lanes=q,ee(R,q)}}function a0(R){var z=Eo;return R!=null&&(Eo=z===null?R:z.concat(R)),z}function I8(R,z,q){for(var pe=Object.keys(R.props),Ce=0;Ce<pe.length;Ce++){var Te=pe[Ce];if(Te!=="children"&&Te!=="key"){z===null&&(z=xM(R,q.mode,0),z._debugInfo=Eo,z.return=q),_n(z,function(ut){console.error("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",ut)},Te);break}}}function Rx(R){var z=Pr;return Pr+=1,zr===null&&(zr=ua()),wh(zr,R,z)}function B4(R,z){z=z.props.ref,R.ref=z!==void 0?z:null}function Qx(R,z){if(z.$$typeof===TI)throw Error(`A React Element from an older version of React was rendered. This is not supported. It can happen if:
- Multiple copies of the "react" package is used.
- A library pre-bundled an old copy of "react" or "react/jsx-runtime".
- A compiler tries to "inline" JSX instead of using the runtime.`);throw R=Object.prototype.toString.call(z),Error("Objects are not valid as a React child (found: "+(R==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":R)+"). If you meant to render a collection of children, use an array instead.")}function fl(R,z){var q=P(R)||"Component";Yp[q]||(Yp[q]=!0,z=z.displayName||z.name||"Component",R.tag===3?console.error(`Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.
  root.render(%s)`,z,z,z):console.error(`Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.
  <%s>{%s}</%s>`,z,z,q,z,q))}function pI(R,z){var q=P(R)||"Component";cb[q]||(cb[q]=!0,z=String(z),R.tag===3?console.error(`Symbols are not valid as a React child.
  root.render(%s)`,z):console.error(`Symbols are not valid as a React child.
  <%s>%s</%s>`,q,z,q))}function UH(R){function z(hn,cn){if(R){var fn=hn.deletions;fn===null?(hn.deletions=[cn],hn.flags|=16):fn.push(cn)}}function q(hn,cn){if(!R)return null;for(;cn!==null;)z(hn,cn),cn=cn.sibling;return null}function pe(hn){for(var cn=new Map;hn!==null;)hn.key!==null?cn.set(hn.key,hn):cn.set(hn.index,hn),hn=hn.sibling;return cn}function Ce(hn,cn){return hn=Fx(hn,cn),hn.index=0,hn.sibling=null,hn}function Te(hn,cn,fn){if(hn.index=fn,!R)return hn.flags|=1048576,cn;if(fn=hn.alternate,fn!==null)return fn=fn.index,fn<cn?(hn.flags|=67108866,cn):fn;return hn.flags|=67108866,cn}function ut(hn){return R&&hn.alternate===null&&(hn.flags|=67108866),hn}function wt(hn,cn,fn,co){if(cn===null||cn.tag!==6)return cn=Q4(fn,hn.mode,co),cn.return=hn,cn._debugOwner=hn,cn._debugTask=hn._debugTask,cn._debugInfo=Eo,cn;return cn=Ce(cn,fn),cn.return=hn,cn._debugInfo=Eo,cn}function In(hn,cn,fn,co){var Nr=fn.type;if(Nr===Ur)return cn=Xo(hn,cn,fn.props.children,co,fn.key),I8(fn,cn,hn),cn;if(cn!==null&&(cn.elementType===Nr||k8(cn,fn)||typeof Nr==="object"&&Nr!==null&&Nr.$$typeof===Vf&&li(Nr)===cn.type))return cn=Ce(cn,fn.props),B4(cn,fn),cn.return=hn,cn._debugOwner=fn._owner,cn._debugInfo=Eo,cn;return cn=xM(fn,hn.mode,co),B4(cn,fn),cn.return=hn,cn._debugInfo=Eo,cn}function to(hn,cn,fn,co){if(cn===null||cn.tag!==4||cn.stateNode.containerInfo!==fn.containerInfo||cn.stateNode.implementation!==fn.implementation)return cn=Xd(fn,hn.mode,co),cn.return=hn,cn._debugInfo=Eo,cn;return cn=Ce(cn,fn.children||[]),cn.return=hn,cn._debugInfo=Eo,cn}function Xo(hn,cn,fn,co,Nr){if(cn===null||cn.tag!==7)return cn=hy(fn,hn.mode,co,Nr),cn.return=hn,cn._debugOwner=hn,cn._debugTask=hn._debugTask,cn._debugInfo=Eo,cn;return cn=Ce(cn,fn),cn.return=hn,cn._debugInfo=Eo,cn}function Zo(hn,cn,fn){if(typeof cn==="string"&&cn!==""||typeof cn==="number"||typeof cn==="bigint")return cn=Q4(""+cn,hn.mode,fn),cn.return=hn,cn._debugOwner=hn,cn._debugTask=hn._debugTask,cn._debugInfo=Eo,cn;if(typeof cn==="object"&&cn!==null){switch(cn.$$typeof){case mp:return fn=xM(cn,hn.mode,fn),B4(fn,cn),fn.return=hn,hn=a0(cn._debugInfo),fn._debugInfo=Eo,Eo=hn,fn;case zx:return cn=Xd(cn,hn.mode,fn),cn.return=hn,cn._debugInfo=Eo,cn;case Vf:var co=a0(cn._debugInfo);return cn=li(cn),hn=Zo(hn,cn,fn),Eo=co,hn}if(Kc(cn)||I(cn))return fn=hy(cn,hn.mode,fn,null),fn.return=hn,fn._debugOwner=hn,fn._debugTask=hn._debugTask,hn=a0(cn._debugInfo),fn._debugInfo=Eo,Eo=hn,fn;if(typeof cn.then==="function")return co=a0(cn._debugInfo),hn=Zo(hn,Rx(cn),fn),Eo=co,hn;if(cn.$$typeof===dy)return Zo(hn,rr(hn,cn),fn);Qx(hn,cn)}return typeof cn==="function"&&fl(hn,cn),typeof cn==="symbol"&&pI(hn,cn),null}function vr(hn,cn,fn,co){var Nr=cn!==null?cn.key:null;if(typeof fn==="string"&&fn!==""||typeof fn==="number"||typeof fn==="bigint")return Nr!==null?null:wt(hn,cn,""+fn,co);if(typeof fn==="object"&&fn!==null){switch(fn.$$typeof){case mp:return fn.key===Nr?(Nr=a0(fn._debugInfo),hn=In(hn,cn,fn,co),Eo=Nr,hn):null;case zx:return fn.key===Nr?to(hn,cn,fn,co):null;case Vf:return Nr=a0(fn._debugInfo),fn=li(fn),hn=vr(hn,cn,fn,co),Eo=Nr,hn}if(Kc(fn)||I(fn)){if(Nr!==null)return null;return Nr=a0(fn._debugInfo),hn=Xo(hn,cn,fn,co,null),Eo=Nr,hn}if(typeof fn.then==="function")return Nr=a0(fn._debugInfo),hn=vr(hn,cn,Rx(fn),co),Eo=Nr,hn;if(fn.$$typeof===dy)return vr(hn,cn,rr(hn,fn),co);Qx(hn,fn)}return typeof fn==="function"&&fl(hn,fn),typeof fn==="symbol"&&pI(hn,fn),null}function ts(hn,cn,fn,co,Nr){if(typeof co==="string"&&co!==""||typeof co==="number"||typeof co==="bigint")return hn=hn.get(fn)||null,wt(cn,hn,""+co,Nr);if(typeof co==="object"&&co!==null){switch(co.$$typeof){case mp:return fn=hn.get(co.key===null?fn:co.key)||null,hn=a0(co._debugInfo),cn=In(cn,fn,co,Nr),Eo=hn,cn;case zx:return hn=hn.get(co.key===null?fn:co.key)||null,to(cn,hn,co,Nr);case Vf:var ia=a0(co._debugInfo);return co=li(co),cn=ts(hn,cn,fn,co,Nr),Eo=ia,cn}if(Kc(co)||I(co))return fn=hn.get(fn)||null,hn=a0(co._debugInfo),cn=Xo(cn,fn,co,Nr,null),Eo=hn,cn;if(typeof co.then==="function")return ia=a0(co._debugInfo),cn=ts(hn,cn,fn,Rx(co),Nr),Eo=ia,cn;if(co.$$typeof===dy)return ts(hn,cn,fn,rr(cn,co),Nr);Qx(cn,co)}return typeof co==="function"&&fl(cn,co),typeof co==="symbol"&&pI(cn,co),null}function bl(hn,cn,fn,co){if(typeof fn!=="object"||fn===null)return co;switch(fn.$$typeof){case mp:case zx:u(hn,cn,fn);var Nr=fn.key;if(typeof Nr!=="string")break;if(co===null){co=new Set,co.add(Nr);break}if(!co.has(Nr)){co.add(Nr);break}_n(cn,function(){console.error("Encountered two children with the same key, `%s`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version.",Nr)});break;case Vf:fn=li(fn),bl(hn,cn,fn,co)}return co}function kN(hn,cn,fn,co){for(var Nr=null,ia=null,ns=null,_s=cn,os=cn=0,Lh=null;_s!==null&&os<fn.length;os++){_s.index>os?(Lh=_s,_s=null):Lh=_s.sibling;var Su=vr(hn,_s,fn[os],co);if(Su===null){_s===null&&(_s=Lh);break}Nr=bl(hn,Su,fn[os],Nr),R&&_s&&Su.alternate===null&&z(hn,_s),cn=Te(Su,cn,os),ns===null?ia=Su:ns.sibling=Su,ns=Su,_s=Lh}if(os===fn.length)return q(hn,_s),$a&&mt(hn,os),ia;if(_s===null){for(;os<fn.length;os++)_s=Zo(hn,fn[os],co),_s!==null&&(Nr=bl(hn,_s,fn[os],Nr),cn=Te(_s,cn,os),ns===null?ia=_s:ns.sibling=_s,ns=_s);return $a&&mt(hn,os),ia}for(_s=pe(_s);os<fn.length;os++)Lh=ts(_s,hn,os,fn[os],co),Lh!==null&&(Nr=bl(hn,Lh,fn[os],Nr),R&&Lh.alternate!==null&&_s.delete(Lh.key===null?os:Lh.key),cn=Te(Lh,cn,os),ns===null?ia=Lh:ns.sibling=Lh,ns=Lh);return R&&_s.forEach(function(DA){return z(hn,DA)}),$a&&mt(hn,os),ia}function LN(hn,cn,fn,co){if(fn==null)throw Error("An iterable object provided no iterator.");for(var Nr=null,ia=null,ns=cn,_s=cn=0,os=null,Lh=null,Su=fn.next();ns!==null&&!Su.done;_s++,Su=fn.next()){ns.index>_s?(os=ns,ns=null):os=ns.sibling;var DA=vr(hn,ns,Su.value,co);if(DA===null){ns===null&&(ns=os);break}Lh=bl(hn,DA,Su.value,Lh),R&&ns&&DA.alternate===null&&z(hn,ns),cn=Te(DA,cn,_s),ia===null?Nr=DA:ia.sibling=DA,ia=DA,ns=os}if(Su.done)return q(hn,ns),$a&&mt(hn,_s),Nr;if(ns===null){for(;!Su.done;_s++,Su=fn.next())ns=Zo(hn,Su.value,co),ns!==null&&(Lh=bl(hn,ns,Su.value,Lh),cn=Te(ns,cn,_s),ia===null?Nr=ns:ia.sibling=ns,ia=ns);return $a&&mt(hn,_s),Nr}for(ns=pe(ns);!Su.done;_s++,Su=fn.next())os=ts(ns,hn,_s,Su.value,co),os!==null&&(Lh=bl(hn,os,Su.value,Lh),R&&os.alternate!==null&&ns.delete(os.key===null?_s:os.key),cn=Te(os,cn,_s),ia===null?Nr=os:ia.sibling=os,ia=os);return R&&ns.forEach(function(GW){return z(hn,GW)}),$a&&mt(hn,_s),Nr}function e3(hn,cn,fn,co){if(typeof fn==="object"&&fn!==null&&fn.type===Ur&&fn.key===null&&(I8(fn,null,hn),fn=fn.props.children),typeof fn==="object"&&fn!==null){switch(fn.$$typeof){case mp:var Nr=a0(fn._debugInfo);e:{for(var ia=fn.key;cn!==null;){if(cn.key===ia){if(ia=fn.type,ia===Ur){if(cn.tag===7){q(hn,cn.sibling),co=Ce(cn,fn.props.children),co.return=hn,co._debugOwner=fn._owner,co._debugInfo=Eo,I8(fn,co,hn),hn=co;break e}}else if(cn.elementType===ia||k8(cn,fn)||typeof ia==="object"&&ia!==null&&ia.$$typeof===Vf&&li(ia)===cn.type){q(hn,cn.sibling),co=Ce(cn,fn.props),B4(co,fn),co.return=hn,co._debugOwner=fn._owner,co._debugInfo=Eo,hn=co;break e}q(hn,cn);break}else z(hn,cn);cn=cn.sibling}fn.type===Ur?(co=hy(fn.props.children,hn.mode,co,fn.key),co.return=hn,co._debugOwner=hn,co._debugTask=hn._debugTask,co._debugInfo=Eo,I8(fn,co,hn),hn=co):(co=xM(fn,hn.mode,co),B4(co,fn),co.return=hn,co._debugInfo=Eo,hn=co)}return hn=ut(hn),Eo=Nr,hn;case zx:e:{Nr=fn;for(fn=Nr.key;cn!==null;){if(cn.key===fn)if(cn.tag===4&&cn.stateNode.containerInfo===Nr.containerInfo&&cn.stateNode.implementation===Nr.implementation){q(hn,cn.sibling),co=Ce(cn,Nr.children||[]),co.return=hn,hn=co;break e}else{q(hn,cn);break}else z(hn,cn);cn=cn.sibling}co=Xd(Nr,hn.mode,co),co.return=hn,hn=co}return ut(hn);case Vf:return Nr=a0(fn._debugInfo),fn=li(fn),hn=e3(hn,cn,fn,co),Eo=Nr,hn}if(Kc(fn))return Nr=a0(fn._debugInfo),hn=kN(hn,cn,fn,co),Eo=Nr,hn;if(I(fn)){if(Nr=a0(fn._debugInfo),ia=I(fn),typeof ia!=="function")throw Error("An object is not an iterable. This error is likely caused by a bug in React. Please file an issue.");var ns=ia.call(fn);if(ns===fn){if(hn.tag!==0||Object.prototype.toString.call(hn.type)!=="[object GeneratorFunction]"||Object.prototype.toString.call(ns)!=="[object Generator]")ks||console.error("Using Iterators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You may convert it to an array with `Array.from()` or the `[...spread]` operator before rendering. You can also use an Iterable that can iterate multiple times over the same items."),ks=!0}else fn.entries!==ia||Fo||(console.error("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),Fo=!0);return hn=LN(hn,cn,ns,co),Eo=Nr,hn}if(typeof fn.then==="function")return Nr=a0(fn._debugInfo),hn=e3(hn,cn,Rx(fn),co),Eo=Nr,hn;if(fn.$$typeof===dy)return e3(hn,cn,rr(hn,fn),co);Qx(hn,fn)}if(typeof fn==="string"&&fn!==""||typeof fn==="number"||typeof fn==="bigint")return Nr=""+fn,cn!==null&&cn.tag===6?(q(hn,cn.sibling),co=Ce(cn,Nr),co.return=hn,hn=co):(q(hn,cn),co=Q4(Nr,hn.mode,co),co.return=hn,co._debugOwner=hn,co._debugTask=hn._debugTask,co._debugInfo=Eo,hn=co),ut(hn);return typeof fn==="function"&&fl(hn,fn),typeof fn==="symbol"&&pI(hn,fn),q(hn,cn)}return function(hn,cn,fn,co){var Nr=Eo;Eo=null;try{Pr=0;var ia=e3(hn,cn,fn,co);return zr=null,ia}catch(Lh){if(Lh===u7||Lh===NM)throw Lh;var ns=c(29,Lh,null,hn.mode);ns.lanes=co,ns.return=hn;var _s=ns._debugInfo=Eo;if(ns._debugOwner=hn._debugOwner,ns._debugTask=hn._debugTask,_s!=null){for(var os=_s.length-1;0<=os;os--)if(typeof _s[os].stack==="string"){ns._debugOwner=_s[os],ns._debugTask=_s[os].debugTask;break}}return ns}finally{Eo=Nr}}}function kx(R){var z=R.alternate;T(Rh,Rh.current&lb,R),T(Dm,R,R),by===null&&(z===null||m7.current!==null?by=R:z.memoizedState!==null&&(by=R))}function T4(R){if(R.tag===22){if(T(Rh,Rh.current,R),T(Dm,R,R),by===null){var z=R.alternate;z!==null&&z.memoizedState!==null&&(by=R)}}else Q2(R)}function Q2(R){T(Rh,Rh.current,R),T(Dm,Dm.current,R)}function oy(R){B(Dm,R),by===R&&(by=null),B(Rh,R)}function v8(R){for(var z=R;z!==null;){if(z.tag===13){var q=z.memoizedState;if(q!==null&&(q=q.dehydrated,q===null||my(q)||FI(q)))return z}else if(z.tag===19&&z.memoizedProps.revealOrder!==void 0){if((z.flags&128)!==0)return z}else if(z.child!==null){z.child.return=z,z=z.child;continue}if(z===R)break;for(;z.sibling===null;){if(z.return===null||z.return===R)return null;z=z.return}z.sibling.return=z.return,z=z.sibling}return null}function Qf(R){if(R!==null&&typeof R!=="function"){var z=String(R);Nm.has(z)||(Nm.add(z),console.error("Expected the last optional `callback` argument to be a function. Instead received: %s.",R))}}function WH(R,z,q,pe){var Ce=R.memoizedState,Te=q(pe,Ce);if(R.mode&8){ie(!0);try{Te=q(pe,Ce)}finally{ie(!1)}}Te===void 0&&(z=v(z)||"Component",RW.has(z)||(RW.add(z),console.error("%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.",z))),Ce=Te===null||Te===void 0?Ce:pp({},Ce,Te),R.memoizedState=Ce,R.lanes===0&&(R.updateQueue.baseState=Ce)}function k2(R,z,q,pe,Ce,Te,ut){var wt=R.stateNode;if(typeof wt.shouldComponentUpdate==="function"){if(q=wt.shouldComponentUpdate(pe,Te,ut),R.mode&8){ie(!0);try{q=wt.shouldComponentUpdate(pe,Te,ut)}finally{ie(!1)}}return q===void 0&&console.error("%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.",v(z)||"Component"),q}return z.prototype&&z.prototype.isPureReactComponent?!zc(q,pe)||!zc(Ce,Te):!0}function tM(R,z,q,pe){var Ce=z.state;typeof z.componentWillReceiveProps==="function"&&z.componentWillReceiveProps(q,pe),typeof z.UNSAFE_componentWillReceiveProps==="function"&&z.UNSAFE_componentWillReceiveProps(q,pe),z.state!==Ce&&(R=P(R)||"Component",a9.has(R)||(a9.add(R),console.error("%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.",R)),Rm.enqueueReplaceState(z,z.state,null))}function kf(R,z){var q=z;if("ref"in z){q={};for(var pe in z)pe!=="ref"&&(q[pe]=z[pe])}if(R=R.defaultProps){q===z&&(q=pp({},q));for(var Ce in R)q[Ce]===void 0&&(q[Ce]=R[Ce])}return q}function mI(R,z){try{$d=z.source?P(z.source):null,$2=null;var q=z.value;if(zn.actQueue!==null)zn.thrownErrors.push(q);else{var pe=R.onUncaughtError;pe(q,{componentStack:z.stack})}}catch(Ce){setTimeout(function(){throw Ce})}}function dp(R,z,q){try{$d=q.source?P(q.source):null,$2=P(z);var pe=R.onCaughtError;pe(q.value,{componentStack:q.stack,errorBoundary:z.tag===1?z.stateNode:null})}catch(Ce){setTimeout(function(){throw Ce})}}function h_(R,z,q){return q=gu(q),q.tag=kF,q.payload={element:null},q.callback=function(){_n(z.source,mI,R,z)},q}function L2(R){return R=gu(R),R.tag=kF,R}function Lf(R,z,q,pe){var Ce=q.type.getDerivedStateFromError;if(typeof Ce==="function"){var Te=pe.value;R.payload=function(){return Ce(Te)},R.callback=function(){sF(q),_n(pe.source,dp,z,q,pe)}}var ut=q.stateNode;ut!==null&&typeof ut.componentDidCatch==="function"&&(R.callback=function(){sF(q),_n(pe.source,dp,z,q,pe),typeof Ce!=="function"&&(f_===null?f_=new Set([this]):f_.add(this)),Rt(this,pe),typeof Ce==="function"||(q.lanes&2)===0&&console.error("%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.",P(q)||"Unknown")})}function ry(R,z,q,pe,Ce){if(q.flags|=32768,W2&&Q8(R,Ce),pe!==null&&typeof pe==="object"&&typeof pe.then==="function"){if(z=q.alternate,z!==null&&mo(z,q,Ce,!0),$a&&(xy=!0),q=Dm.current,q!==null){switch(q.tag){case 13:return by===null?T8():q.alternate===null&&vu===wA&&(vu=HW),q.flags&=-257,q.flags|=65536,q.lanes=Ce,pe===CN?q.flags|=16384:(z=q.updateQueue,z===null?q.updateQueue=new Set([pe]):z.add(pe),WD(R,pe,Ce)),!1;case 22:return q.flags|=65536,pe===CN?q.flags|=16384:(z=q.updateQueue,z===null?(z={transitions:null,markerInstances:null,retryQueue:new Set([pe])},q.updateQueue=z):(q=z.retryQueue,q===null?z.retryQueue=new Set([pe]):q.add(pe)),WD(R,pe,Ce)),!1}throw Error("Unexpected Suspense handler tag ("+q.tag+"). This is a bug in React.")}return WD(R,pe,Ce),T8(),!1}if($a)return xy=!0,z=Dm.current,z!==null?((z.flags&65536)===0&&(z.flags|=256),z.flags|=65536,z.lanes=Ce,pe!==TM&&nn(rt(Error("There was an error while hydrating but React was able to recover by instead client rendering from the nearest Suspense boundary.",{cause:pe}),q))):(pe!==TM&&nn(rt(Error("There was an error while hydrating but React was able to recover by instead client rendering the entire root.",{cause:pe}),q)),R=R.current.alternate,R.flags|=65536,Ce&=-Ce,R.lanes|=Ce,pe=rt(pe,q),Ce=h_(R.stateNode,pe,Ce),Nx(R,Ce),vu!==b7&&(vu=pb)),!1;var Te=rt(Error("There was an error during concurrent rendering but React was able to recover by instead synchronously rendering the entire root.",{cause:pe}),q);if(Z2===null?Z2=[Te]:Z2.push(Te),vu!==b7&&(vu=pb),z===null)return!0;pe=rt(pe,q),q=z;do{switch(q.tag){case 3:return q.flags|=65536,R=Ce&-Ce,q.lanes|=R,R=h_(q.stateNode,pe,R),Nx(q,R),!1;case 1:if(z=q.type,Te=q.stateNode,(q.flags&128)===0&&(typeof z.getDerivedStateFromError==="function"||Te!==null&&typeof Te.componentDidCatch==="function"&&(f_===null||!f_.has(Te))))return q.flags|=65536,Ce&=-Ce,q.lanes|=Ce,Ce=L2(Ce),Lf(Ce,R,q,pe),Nx(q,Ce),!1}q=q.return}while(q!==null);return!1}function hh(R,z,q,pe){z.child=R===null?Cy(z,null,q,pe):Bg(z,R.child,q,pe)}function nM(R,z,q,pe,Ce){q=q.render;var Te=z.ref;if("ref"in pe){var ut={};for(var wt in pe)wt!=="ref"&&(ut[wt]=pe[wt])}else ut=pe;if(io(z),de(z),pe=MC(R,z,q,ut,Te,Ce),wt=b4(),me(),R!==null&&!Vl)return I4(R,z,Ce),sy(R,z,Ce);return $a&&wt&&Ct(z),z.flags|=1,hh(R,z,pe,Ce),z.child}function uD(R,z,q,pe,Ce){if(R===null){var Te=q.type;if(typeof Te==="function"&&!L8(Te)&&Te.defaultProps===void 0&&q.compare===null)return q=UC(Te),z.tag=15,z.type=q,oM(z,Te),XH(R,z,q,pe,Ce);return R=JD(q.type,null,pe,z,z.mode,Ce),R.ref=z.ref,R.return=z,z.child=R}if(Te=R.child,!P8(R,Ce)){var ut=Te.memoizedProps;if(q=q.compare,q=q!==null?q:zc,q(ut,pe)&&R.ref===z.ref)return sy(R,z,Ce)}return z.flags|=1,R=Fx(Te,pe),R.ref=z.ref,R.return=z,z.child=R}function XH(R,z,q,pe,Ce){if(R!==null){var Te=R.memoizedProps;if(zc(Te,pe)&&R.ref===z.ref&&z.type===R.type)if(Vl=!1,z.pendingProps=pe=Te,P8(R,Ce))(R.flags&131072)!==0&&(Vl=!0);else return z.lanes=R.lanes,sy(R,z,Ce)}return Ff(R,z,q,pe,Ce)}function iy(R,z,q){var pe=z.pendingProps,Ce=pe.children,Te=R!==null?R.memoizedState:null;if(pe.mode==="hidden"){if((z.flags&128)!==0){if(pe=Te!==null?Te.baseLanes|q:q,R!==null){Ce=z.child=R.child;for(Te=0;Ce!==null;)Te=Te|Ce.lanes|Ce.childLanes,Ce=Ce.sibling;z.childLanes=Te&~pe}else z.childLanes=0,z.child=null;return jH(R,z,pe,q)}if((q&536870912)!==0)z.memoizedState={baseLanes:0,cachePool:null},R!==null&&Hl(z,Te!==null?Te.cachePool:null),Te!==null?dI(z,Te):Z1(z),T4(z);else return z.lanes=z.childLanes=536870912,jH(R,z,Te!==null?Te.baseLanes|q:q,q)}else Te!==null?(Hl(z,Te.cachePool),dI(z,Te),Q2(z),z.memoizedState=null):(R!==null&&Hl(z,null),Z1(z),Q2(z));return hh(R,z,Ce,q),z.child}function jH(R,z,q,pe){var Ce=Zi();return Ce=Ce===null?null:{parent:ql?Dh._currentValue:Dh._currentValue2,pool:Ce},z.memoizedState={baseLanes:q,cachePool:Ce},R!==null&&Hl(z,null),Z1(z),T4(z),R!==null&&mo(R,z,pe,!0),null}function Hf(R,z){var q=z.ref;if(q===null)R!==null&&R.ref!==null&&(z.flags|=4194816);else{if(typeof q!=="function"&&typeof q!=="object")throw Error("Expected ref to be a function, an object returned by React.createRef(), or undefined/null.");if(R===null||R.ref!==q)z.flags|=4194816}}function Ff(R,z,q,pe,Ce){if(q.prototype&&typeof q.prototype.render==="function"){var Te=v(q)||"Unknown";j4[Te]||(console.error("The <%s /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change %s to extend React.Component instead.",Te,Te),j4[Te]=!0)}if(z.mode&8&&K2.recordLegacyContextWarning(z,null),R===null&&(oM(z,z.type),q.contextTypes&&(Te=v(q)||"Unknown",zM[Te]||(zM[Te]=!0,console.error("%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with React.useContext() instead. (https://react.dev/link/legacy-context)",Te)))),io(z),de(z),q=MC(R,z,q,pe,void 0,Ce),pe=b4(),me(),R!==null&&!Vl)return I4(R,z,Ce),sy(R,z,Ce);return $a&&pe&&Ct(z),z.flags|=1,hh(R,z,q,Ce),z.child}function _I(R,z,q,pe,Ce,Te){if(io(z),de(z),EA=-1,HM=R!==null&&R.type!==z.type,z.updateQueue=null,q=wC(z,pe,q,Ce),dD(R,z),pe=b4(),me(),R!==null&&!Vl)return I4(R,z,Te),sy(R,z,Te);return $a&&pe&&Ct(z),z.flags|=1,hh(R,z,q,Te),z.child}function KH(R,z,q,pe,Ce){switch(a(z)){case!1:var Te=z.stateNode,ut=new z.type(z.memoizedProps,Te.context).state;Te.updater.enqueueSetState(Te,ut,null);break;case!0:z.flags|=128,z.flags|=65536,Te=Error("Simulated error coming from DevTools");var wt=Ce&-Ce;if(z.lanes|=wt,ut=Qh,ut===null)throw Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");wt=L2(wt),Lf(wt,ut,z,rt(Te,z)),Nx(z,wt)}if(io(z),z.stateNode===null){if(ut=Gx,Te=q.contextType,"contextType"in q&&Te!==null&&(Te===void 0||Te.$$typeof!==dy)&&!MN.has(q)&&(MN.add(q),wt=Te===void 0?" However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file.":typeof Te!=="object"?" However, it is set to a "+typeof Te+".":Te.$$typeof===F8?" Did you accidentally pass the Context.Consumer instead?":" However, it is set to an object with keys {"+Object.keys(Te).join(", ")+"}.",console.error("%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s",v(q)||"Component",wt)),typeof Te==="object"&&Te!==null&&(ut=Wo(Te)),Te=new q(pe,ut),z.mode&8){ie(!0);try{Te=new q(pe,ut)}finally{ie(!1)}}if(ut=z.memoizedState=Te.state!==null&&Te.state!==void 0?Te.state:null,Te.updater=Rm,z.stateNode=Te,Te._reactInternals=z,Te._reactInternalInstance=db,typeof q.getDerivedStateFromProps==="function"&&ut===null&&(ut=v(q)||"Component",FM.has(ut)||(FM.add(ut),console.error("`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.",ut,Te.state===null?"null":"undefined",ut))),typeof q.getDerivedStateFromProps==="function"||typeof Te.getSnapshotBeforeUpdate==="function"){var In=wt=ut=null;if(typeof Te.componentWillMount==="function"&&Te.componentWillMount.__suppressDeprecationWarning!==!0?ut="componentWillMount":typeof Te.UNSAFE_componentWillMount==="function"&&(ut="UNSAFE_componentWillMount"),typeof Te.componentWillReceiveProps==="function"&&Te.componentWillReceiveProps.__suppressDeprecationWarning!==!0?wt="componentWillReceiveProps":typeof Te.UNSAFE_componentWillReceiveProps==="function"&&(wt="UNSAFE_componentWillReceiveProps"),typeof Te.componentWillUpdate==="function"&&Te.componentWillUpdate.__suppressDeprecationWarning!==!0?In="componentWillUpdate":typeof Te.UNSAFE_componentWillUpdate==="function"&&(In="UNSAFE_componentWillUpdate"),ut!==null||wt!==null||In!==null){Te=v(q)||"Component";var to=typeof q.getDerivedStateFromProps==="function"?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";PN.has(Te)||(PN.add(Te),console.error(`Unsafe legacy lifecycles will not be called for components using new component APIs.

%s uses %s but also contains the following legacy lifecycles:%s%s%s

The above lifecycles should be removed. Learn more about this warning here:
https://react.dev/link/unsafe-component-lifecycles`,Te,to,ut!==null?`
  `+ut:"",wt!==null?`
  `+wt:"",In!==null?`
  `+In:""))}}Te=z.stateNode,ut=v(q)||"Component",Te.render||(q.prototype&&typeof q.prototype.render==="function"?console.error("No `render` method found on the %s instance: did you accidentally return an object from the constructor?",ut):console.error("No `render` method found on the %s instance: you may have forgotten to define `render`.",ut)),!Te.getInitialState||Te.getInitialState.isReactClassApproved||Te.state||console.error("getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?",ut),Te.getDefaultProps&&!Te.getDefaultProps.isReactClassApproved&&console.error("getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.",ut),Te.contextType&&console.error("contextType was defined as an instance property on %s. Use a static property to define contextType instead.",ut),q.childContextTypes&&!Tg.has(q)&&(Tg.add(q),console.error("%s uses the legacy childContextTypes API which was removed in React 19. Use React.createContext() instead. (https://react.dev/link/legacy-context)",ut)),q.contextTypes&&!EN.has(q)&&(EN.add(q),console.error("%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with static contextType instead. (https://react.dev/link/legacy-context)",ut)),typeof Te.componentShouldUpdate==="function"&&console.error("%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.",ut),q.prototype&&q.prototype.isPureReactComponent&&typeof Te.shouldComponentUpdate<"u"&&console.error("%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.",v(q)||"A pure component"),typeof Te.componentDidUnmount==="function"&&console.error("%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?",ut),typeof Te.componentDidReceiveProps==="function"&&console.error("%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().",ut),typeof Te.componentWillRecieveProps==="function"&&console.error("%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?",ut),typeof Te.UNSAFE_componentWillRecieveProps==="function"&&console.error("%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?",ut),wt=Te.props!==pe,Te.props!==void 0&&wt&&console.error("When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.",ut),Te.defaultProps&&console.error("Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.",ut,ut),typeof Te.getSnapshotBeforeUpdate!=="function"||typeof Te.componentDidUpdate==="function"||c9.has(q)||(c9.add(q),console.error("%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.",v(q))),typeof Te.getDerivedStateFromProps==="function"&&console.error("%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.",ut),typeof Te.getDerivedStateFromError==="function"&&console.error("%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.",ut),typeof q.getSnapshotBeforeUpdate==="function"&&console.error("%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.",ut),(wt=Te.state)&&(typeof wt!=="object"||Kc(wt))&&console.error("%s.state: must be set to an object or null",ut),typeof Te.getChildContext==="function"&&typeof q.childContextTypes!=="object"&&console.error("%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().",ut),Te=z.stateNode,Te.props=pe,Te.state=z.memoizedState,Te.refs={},lp(z),ut=q.contextType,Te.context=typeof ut==="object"&&ut!==null?Wo(ut):Gx,Te.state===pe&&(ut=v(q)||"Component",l9.has(ut)||(l9.add(ut),console.error("%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.",ut))),z.mode&8&&K2.recordLegacyContextWarning(z,Te),K2.recordUnsafeLifecycleWarnings(z,Te),Te.state=z.memoizedState,ut=q.getDerivedStateFromProps,typeof ut==="function"&&(WH(z,q,ut,pe),Te.state=z.memoizedState),typeof q.getDerivedStateFromProps==="function"||typeof Te.getSnapshotBeforeUpdate==="function"||typeof Te.UNSAFE_componentWillMount!=="function"&&typeof Te.componentWillMount!=="function"||(ut=Te.state,typeof Te.componentWillMount==="function"&&Te.componentWillMount(),typeof Te.UNSAFE_componentWillMount==="function"&&Te.UNSAFE_componentWillMount(),ut!==Te.state&&(console.error("%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.",P(z)||"Component"),Rm.enqueueReplaceState(Te,Te.state,null)),N2(z,pe,Te,Ce),c_(),Te.state=z.memoizedState),typeof Te.componentDidMount==="function"&&(z.flags|=4194308),(z.mode&16)!==Cl&&(z.flags|=134217728),Te=!0}else if(R===null){Te=z.stateNode;var Xo=z.memoizedProps;wt=kf(q,Xo),Te.props=wt;var Zo=Te.context;In=q.contextType,ut=Gx,typeof In==="object"&&In!==null&&(ut=Wo(In)),to=q.getDerivedStateFromProps,In=typeof to==="function"||typeof Te.getSnapshotBeforeUpdate==="function",Xo=z.pendingProps!==Xo,In||typeof Te.UNSAFE_componentWillReceiveProps!=="function"&&typeof Te.componentWillReceiveProps!=="function"||(Xo||Zo!==ut)&&tM(z,Te,pe,ut),G4=!1;var vr=z.memoizedState;Te.state=vr,N2(z,pe,Te,Ce),c_(),Zo=z.memoizedState,Xo||vr!==Zo||G4?(typeof to==="function"&&(WH(z,q,to,pe),Zo=z.memoizedState),(wt=G4||k2(z,q,wt,pe,vr,Zo,ut))?(In||typeof Te.UNSAFE_componentWillMount!=="function"&&typeof Te.componentWillMount!=="function"||(typeof Te.componentWillMount==="function"&&Te.componentWillMount(),typeof Te.UNSAFE_componentWillMount==="function"&&Te.UNSAFE_componentWillMount()),typeof Te.componentDidMount==="function"&&(z.flags|=4194308),(z.mode&16)!==Cl&&(z.flags|=134217728)):(typeof Te.componentDidMount==="function"&&(z.flags|=4194308),(z.mode&16)!==Cl&&(z.flags|=134217728),z.memoizedProps=pe,z.memoizedState=Zo),Te.props=pe,Te.state=Zo,Te.context=ut,Te=wt):(typeof Te.componentDidMount==="function"&&(z.flags|=4194308),(z.mode&16)!==Cl&&(z.flags|=134217728),Te=!1)}else{Te=z.stateNode,fg(R,z),ut=z.memoizedProps,In=kf(q,ut),Te.props=In,to=z.pendingProps,vr=Te.context,Zo=q.contextType,wt=Gx,typeof Zo==="object"&&Zo!==null&&(wt=Wo(Zo)),Xo=q.getDerivedStateFromProps,(Zo=typeof Xo==="function"||typeof Te.getSnapshotBeforeUpdate==="function")||typeof Te.UNSAFE_componentWillReceiveProps!=="function"&&typeof Te.componentWillReceiveProps!=="function"||(ut!==to||vr!==wt)&&tM(z,Te,pe,wt),G4=!1,vr=z.memoizedState,Te.state=vr,N2(z,pe,Te,Ce),c_();var ts=z.memoizedState;ut!==to||vr!==ts||G4||R!==null&&R.dependencies!==null&&Io(R.dependencies)?(typeof Xo==="function"&&(WH(z,q,Xo,pe),ts=z.memoizedState),(In=G4||k2(z,q,In,pe,vr,ts,wt)||R!==null&&R.dependencies!==null&&Io(R.dependencies))?(Zo||typeof Te.UNSAFE_componentWillUpdate!=="function"&&typeof Te.componentWillUpdate!=="function"||(typeof Te.componentWillUpdate==="function"&&Te.componentWillUpdate(pe,ts,wt),typeof Te.UNSAFE_componentWillUpdate==="function"&&Te.UNSAFE_componentWillUpdate(pe,ts,wt)),typeof Te.componentDidUpdate==="function"&&(z.flags|=4),typeof Te.getSnapshotBeforeUpdate==="function"&&(z.flags|=1024)):(typeof Te.componentDidUpdate!=="function"||ut===R.memoizedProps&&vr===R.memoizedState||(z.flags|=4),typeof Te.getSnapshotBeforeUpdate!=="function"||ut===R.memoizedProps&&vr===R.memoizedState||(z.flags|=1024),z.memoizedProps=pe,z.memoizedState=ts),Te.props=pe,Te.state=ts,Te.context=wt,Te=In):(typeof Te.componentDidUpdate!=="function"||ut===R.memoizedProps&&vr===R.memoizedState||(z.flags|=4),typeof Te.getSnapshotBeforeUpdate!=="function"||ut===R.memoizedProps&&vr===R.memoizedState||(z.flags|=1024),Te=!1)}if(wt=Te,Hf(R,z),ut=(z.flags&128)!==0,wt||ut){if(wt=z.stateNode,no(z),ut&&typeof q.getDerivedStateFromError!=="function")q=null,g_=-1;else{if(de(z),q=he(wt),z.mode&8){ie(!0);try{he(wt)}finally{ie(!1)}}me()}z.flags|=1,R!==null&&ut?(z.child=Bg(z,R.child,null,Ce),z.child=Bg(z,null,q,Ce)):hh(R,z,q,Ce),z.memoizedState=wt.state,R=z.child}else R=sy(R,z,Ce);return Ce=z.stateNode,Te&&Ce.props!==pe&&(wN||console.error("It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.",P(z)||"a component"),wN=!0),R}function ZU(R,z,q,pe){return Mt(),z.flags|=256,hh(R,z,q,pe),z.child}function oM(R,z){z&&z.childContextTypes&&console.error(`childContextTypes cannot be defined on a function component.
  %s.childContextTypes = ...`,z.displayName||z.name||"Component"),typeof z.getDerivedStateFromProps==="function"&&(R=v(z)||"Unknown",pa[R]||(console.error("%s: Function components do not support getDerivedStateFromProps.",R),pa[R]=!0)),typeof z.contextType==="object"&&z.contextType!==null&&(z=v(z)||"Unknown",K4[z]||(console.error("%s: Function components do not support contextType.",z),K4[z]=!0))}function S8(R){return{baseLanes:R,cachePool:da()}}function gI(R,z,q){return R=R!==null?R.childLanes&~q:0,z&&(R|=kh),R}function rM(R,z,q){var pe=z.pendingProps;s(z)&&(z.flags|=128);var Ce=!1,Te=(z.flags&128)!==0,ut;if((ut=Te)||(ut=R!==null&&R.memoizedState===null?!1:(Rh.current&hb)!==0),ut&&(Ce=!0,z.flags&=-129),ut=(z.flags&32)!==0,z.flags&=-33,R===null){if($a){if(Ce?kx(z):Q2(z),$a){var wt=Cu,In;(In=!wt)||(In=zI(wt,La),In!==null?(Ht(),z.memoizedState={dehydrated:In,treeContext:Xs!==null?{id:j2,overflow:yy}:null,retryLane:536870912,hydrationErrors:null},Te=c(18,null,null,Cl),Te.stateNode=In,Te.return=z,z.child=Te,Sc=z,Cu=null,In=!0):In=!1,In=!In),In&&(ir(z,wt),xt(z))}if(wt=z.memoizedState,wt!==null&&(wt=wt.dehydrated,wt!==null))return FI(wt)?z.lanes=32:z.lanes=536870912,null;oy(z)}if(wt=pe.children,pe=pe.fallback,Ce)return Q2(z),Ce=z.mode,wt=iM({mode:"hidden",children:wt},Ce),pe=hy(pe,Ce,q,null),wt.return=z,pe.return=z,wt.sibling=pe,z.child=wt,Ce=z.child,Ce.memoizedState=S8(q),Ce.childLanes=gI(R,ut,q),z.memoizedState=y7,pe;return kx(z),pD(z,wt)}if(In=R.memoizedState,In!==null&&(wt=In.dehydrated,wt!==null)){if(Te)z.flags&256?(kx(z),z.flags&=-257,z=Lx(R,z,q)):z.memoizedState!==null?(Q2(z),z.child=R.child,z.flags|=128,z=null):(Q2(z),Ce=pe.fallback,wt=z.mode,pe=iM({mode:"visible",children:pe.children},wt),Ce=hy(Ce,wt,q,null),Ce.flags|=2,pe.return=z,Ce.return=z,pe.sibling=Ce,z.child=pe,Bg(z,R.child,null,q),pe=z.child,pe.memoizedState=S8(q),pe.childLanes=gI(R,ut,q),z.memoizedState=y7,z=Ce);else if(kx(z),$a&&console.error("We should not be hydrating here. This is a bug in React. Please file a bug."),FI(wt))wt=V2(wt),ut=wt.digest,Ce=wt.message,pe=wt.stack,wt=wt.componentStack,Ce=Ce?Error(Ce):Error("The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering."),Ce.stack=pe||"",Ce.digest=ut,ut=wt===void 0?null:wt,pe={value:Ce,source:null,stack:ut},typeof ut==="string"&&n7.set(Ce,pe),nn(pe),z=Lx(R,z,q);else if(Vl||mo(R,z,q,!1),ut=(q&R.childLanes)!==0,Vl||ut){if(ut=Qh,ut!==null&&(pe=q&-q,pe=(pe&42)!==0?1:se(pe),pe=(pe&(ut.suspendedLanes|q))!==0?0:pe,pe!==0&&pe!==In.retryLane))throw In.retryLane=pe,r0(R,pe),Wd(ut,R,pe),Iy;my(wt)||T8(),z=Lx(R,z,q)}else my(wt)?(z.flags|=192,z.child=R.child,z=null):(R=In.treeContext,Sg&&(Cu=vM(wt),Sc=z,$a=!0,ob=null,xy=!1,bu=null,La=!1,R!==null&&(Ht(),h0[Mg++]=j2,h0[Mg++]=yy,h0[Mg++]=Xs,j2=R.id,yy=R.overflow,Xs=z)),z=pD(z,pe.children),z.flags|=4096);return z}if(Ce)return Q2(z),Ce=pe.fallback,wt=z.mode,In=R.child,Te=In.sibling,pe=Fx(In,{mode:"hidden",children:pe.children}),pe.subtreeFlags=In.subtreeFlags&65011712,Te!==null?Ce=Fx(Te,Ce):(Ce=hy(Ce,wt,q,null),Ce.flags|=2),Ce.return=z,pe.return=z,pe.sibling=Ce,z.child=pe,pe=Ce,Ce=z.child,wt=R.child.memoizedState,wt===null?wt=S8(q):(In=wt.cachePool,In!==null?(Te=ql?Dh._currentValue:Dh._currentValue2,In=In.parent!==Te?{parent:Te,pool:Te}:In):In=da(),wt={baseLanes:wt.baseLanes|q,cachePool:In}),Ce.memoizedState=wt,Ce.childLanes=gI(R,ut,q),z.memoizedState=y7,pe;return kx(z),q=R.child,R=q.sibling,q=Fx(q,{mode:"visible",children:pe.children}),q.return=z,q.sibling=null,R!==null&&(ut=z.deletions,ut===null?(z.deletions=[R],z.flags|=16):ut.push(R)),z.child=q,z.memoizedState=null,q}function pD(R,z){return z=iM({mode:"visible",children:z},R.mode),z.return=R,R.child=z}function iM(R,z){return R=c(22,R,null,z),R.lanes=0,R.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},R}function Lx(R,z,q){return Bg(z,R.child,null,q),R=pD(z,z.pendingProps.children),R.flags|=2,z.memoizedState=null,R}function mD(R,z,q){R.lanes|=z;var pe=R.alternate;pe!==null&&(pe.lanes|=z),Qo(R.return,z,q)}function _D(R,z){var q=Kc(R);return R=!q&&typeof I(R)==="function",q||R?(q=q?"array":"iterable",console.error("A nested %s was passed to row #%s in <SuspenseList />. Wrap it in an additional SuspenseList to configure its revealOrder: <SuspenseList revealOrder=...> ... <SuspenseList revealOrder=...>{%s}</SuspenseList> ... </SuspenseList>",q,z,q),!1):!0}function gD(R,z,q,pe,Ce){var Te=R.memoizedState;Te===null?R.memoizedState={isBackwards:z,rendering:null,renderingStartTime:0,last:pe,tail:q,tailMode:Ce}:(Te.isBackwards=z,Te.rendering=null,Te.renderingStartTime=0,Te.last=pe,Te.tail=q,Te.tailMode=Ce)}function d_(R,z,q){var pe=z.pendingProps,Ce=pe.revealOrder,Te=pe.tail;if(pe=pe.children,Ce!==void 0&&Ce!=="forwards"&&Ce!=="backwards"&&Ce!=="together"&&!$4[Ce])if($4[Ce]=!0,typeof Ce==="string")switch(Ce.toLowerCase()){case"together":case"forwards":case"backwards":console.error('"%s" is not a valid value for revealOrder on <SuspenseList />. Use lowercase "%s" instead.',Ce,Ce.toLowerCase());break;case"forward":case"backward":console.error('"%s" is not a valid value for revealOrder on <SuspenseList />. React uses the -s suffix in the spelling. Use "%ss" instead.',Ce,Ce.toLowerCase());break;default:console.error('"%s" is not a supported revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?',Ce)}else console.error('%s is not a supported value for revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?',Ce);Te===void 0||f7[Te]||(Te!=="collapsed"&&Te!=="hidden"?(f7[Te]=!0,console.error('"%s" is not a supported value for tail on <SuspenseList />. Did you mean "collapsed" or "hidden"?',Te)):Ce!=="forwards"&&Ce!=="backwards"&&(f7[Te]=!0,console.error('<SuspenseList tail="%s" /> is only valid if revealOrder is "forwards" or "backwards". Did you mean to specify revealOrder="forwards"?',Te)));e:if((Ce==="forwards"||Ce==="backwards")&&pe!==void 0&&pe!==null&&pe!==!1)if(Kc(pe)){for(var ut=0;ut<pe.length;ut++)if(!_D(pe[ut],ut))break e}else if(ut=I(pe),typeof ut==="function"){if(ut=ut.call(pe))for(var wt=ut.next(),In=0;!wt.done;wt=ut.next()){if(!_D(wt.value,In))break e;In++}}else console.error('A single row was passed to a <SuspenseList revealOrder="%s" />. This is not useful since it needs multiple rows. Did you mean to pass multiple children or an array?',Ce);if(hh(R,z,pe,q),pe=Rh.current,(pe&hb)!==0)pe=pe&lb|hb,z.flags|=128;else{if(R!==null&&(R.flags&128)!==0)e:for(R=z.child;R!==null;){if(R.tag===13)R.memoizedState!==null&&mD(R,q,z);else if(R.tag===19)mD(R,q,z);else if(R.child!==null){R.child.return=R,R=R.child;continue}if(R===z)break e;for(;R.sibling===null;){if(R.return===null||R.return===z)break e;R=R.return}R.sibling.return=R.return,R=R.sibling}pe&=lb}switch(T(Rh,pe,z),Ce){case"forwards":q=z.child;for(Ce=null;q!==null;)R=q.alternate,R!==null&&v8(R)===null&&(Ce=q),q=q.sibling;q=Ce,q===null?(Ce=z.child,z.child=null):(Ce=q.sibling,q.sibling=null),gD(z,!1,Ce,q,Te);break;case"backwards":q=null,Ce=z.child;for(z.child=null;Ce!==null;){if(R=Ce.alternate,R!==null&&v8(R)===null){z.child=Ce;break}R=Ce.sibling,Ce.sibling=q,q=Ce,Ce=R}gD(z,!0,q,null,Te);break;case"together":gD(z,!1,null,null,void 0);break;default:z.memoizedState=null}return z.child}function sy(R,z,q){if(R!==null&&(z.dependencies=R.dependencies),g_=-1,P7|=z.lanes,(q&z.childLanes)===0)if(R!==null){if(mo(R,z,q,!1),(q&z.childLanes)===0)return null}else return null;if(R!==null&&z.child!==R.child)throw Error("Resuming work not yet implemented.");if(z.child!==null){R=z.child,q=Fx(R,R.pendingProps),z.child=q;for(q.return=z;R.sibling!==null;)R=R.sibling,q=q.sibling=Fx(R,R.pendingProps),q.return=z;q.sibling=null}return z.child}function P8(R,z){if((R.lanes&z)!==0)return!0;return R=R.dependencies,R!==null&&Io(R)?!0:!1}function AD(R,z,q){switch(z.tag){case 3:et(z,z.stateNode.containerInfo),Bn(z,Dh,R.memoizedState.cache),Mt();break;case 27:case 5:We(z);break;case 4:et(z,z.stateNode.containerInfo);break;case 10:Bn(z,z.type,z.memoizedProps.value);break;case 12:(q&z.childLanes)!==0&&(z.flags|=4),z.flags|=2048;var pe=z.stateNode;pe.effectDuration=-0,pe.passiveEffectDuration=-0;break;case 13:if(pe=z.memoizedState,pe!==null){if(pe.dehydrated!==null)return kx(z),z.flags|=128,null;if((q&z.child.childLanes)!==0)return rM(R,z,q);return kx(z),R=sy(R,z,q),R!==null?R.sibling:null}kx(z);break;case 19:var Ce=(R.flags&128)!==0;if(pe=(q&z.childLanes)!==0,pe||(mo(R,z,q,!1),pe=(q&z.childLanes)!==0),Ce){if(pe)return d_(R,z,q);z.flags|=128}if(Ce=z.memoizedState,Ce!==null&&(Ce.rendering=null,Ce.tail=null,Ce.lastEffect=null),T(Rh,Rh.current,z),pe)break;else return null;case 22:case 23:return z.lanes=0,iy(R,z,q);case 24:Bn(z,Dh,R.memoizedState.cache)}return sy(R,z,q)}function Hx(R,z,q){if(z._debugNeedsRemount&&R!==null){q=JD(z.type,z.key,z.pendingProps,z._debugOwner||null,z.mode,z.lanes),q._debugStack=z._debugStack,q._debugTask=z._debugTask;var pe=z.return;if(pe===null)throw Error("Cannot swap the root fiber.");if(R.alternate=null,z.alternate=null,q.index=z.index,q.sibling=z.sibling,q.return=z.return,q.ref=z.ref,q._debugInfo=z._debugInfo,z===pe.child)pe.child=q;else{var Ce=pe.child;if(Ce===null)throw Error("Expected parent to have a child.");for(;Ce.sibling!==z;)if(Ce=Ce.sibling,Ce===null)throw Error("Expected to find the previous sibling.");Ce.sibling=q}return z=pe.deletions,z===null?(pe.deletions=[R],pe.flags|=16):z.push(R),q.flags|=2,q}if(R!==null)if(R.memoizedProps!==z.pendingProps||z.type!==R.type)Vl=!0;else{if(!P8(R,q)&&(z.flags&128)===0)return Vl=!1,AD(R,z,q);Vl=(R.flags&131072)!==0?!0:!1}else{if(Vl=!1,pe=$a)Ht(),pe=(z.flags&1048576)!==0;pe&&(pe=z.index,Ht(),lt(z,_N,pe))}switch(z.lanes=0,z.tag){case 16:e:if(pe=z.pendingProps,R=li(z.elementType),z.type=R,typeof R==="function")L8(R)?(pe=kf(R,pe),z.tag=1,z.type=R=UC(R),z=KH(null,z,R,pe,q)):(z.tag=0,oM(z,R),z.type=R=UC(R),z=Ff(null,z,R,pe,q));else{if(R!==void 0&&R!==null){if(Ce=R.$$typeof,Ce===DI){z.tag=11,z.type=R=qD(R),z=nM(null,z,R,pe,q);break e}else if(Ce===bi){z.tag=14,z=uD(null,z,R,pe,q);break e}}throw z="",R!==null&&typeof R==="object"&&R.$$typeof===Vf&&(z=" Did you wrap a component in React.lazy() more than once?"),R=v(R)||R,Error("Element type is invalid. Received a promise that resolves to: "+R+". Lazy element type must resolve to a class or function."+z)}return z;case 0:return Ff(R,z,z.type,z.pendingProps,q);case 1:return pe=z.type,Ce=kf(pe,z.pendingProps),KH(R,z,pe,Ce,q);case 3:e:{if(et(z,z.stateNode.containerInfo),R===null)throw Error("Should have a current fiber. This is a bug in React.");var Te=z.pendingProps;Ce=z.memoizedState,pe=Ce.element,fg(R,z),N2(z,Te,null,q);var ut=z.memoizedState;if(Te=ut.cache,Bn(z,Dh,Te),Te!==Ce.cache&&Nn(z,[Dh],q,!0),c_(),Te=ut.element,Sg&&Ce.isDehydrated)if(Ce={element:Te,isDehydrated:!1,cache:ut.cache},z.updateQueue.baseState=Ce,z.memoizedState=Ce,z.flags&256){z=ZU(R,z,Te,q);break e}else if(Te!==pe){pe=rt(Error("This root received an early update, before anything was able hydrate. Switched the entire root to client rendering."),z),nn(pe),z=ZU(R,z,Te,q);break e}else for(Sg&&(Cu=Y2(z.stateNode.containerInfo),Sc=z,$a=!0,ob=null,xy=!1,bu=null,La=!0),R=Cy(z,null,Te,q),z.child=R;R;)R.flags=R.flags&-3|4096,R=R.sibling;else{if(Mt(),Te===pe){z=sy(R,z,q);break e}hh(R,z,Te,q)}z=z.child}return z;case 26:if(G2)return Hf(R,z),R===null?(R=GI(z.type,null,z.pendingProps,null))?z.memoizedState=R:$a||(z.stateNode=PW(z.type,z.pendingProps,Tt(Xf.current),z)):z.memoizedState=GI(z.type,R.memoizedProps,z.pendingProps,R.memoizedState),null;case 27:if(l0)return We(z),R===null&&l0&&$a&&(Ce=Tt(Xf.current),pe=ht(),Ce=z.stateNode=bF(z.type,z.pendingProps,Ce,pe,!1),xy||(pe=Pm(Ce,z.type,z.pendingProps,pe),pe!==null&&(To(z,0).serverProps=pe)),Sc=z,La=!0,Cu=U8(z.type,Ce,Cu)),hh(R,z,z.pendingProps.children,q),Hf(R,z),R===null&&(z.flags|=4194304),z.child;case 5:return R===null&&$a&&(Te=ht(),pe=Kd(z.type,z.pendingProps,Te),Ce=Cu,(ut=!Ce)||(ut=AF(Ce,z.type,z.pendingProps,La),ut!==null?(z.stateNode=ut,xy||(Te=Pm(ut,z.type,z.pendingProps,Te),Te!==null&&(To(z,0).serverProps=Te)),Sc=z,Cu=G8(ut),La=!1,Te=!0):Te=!1,ut=!Te),ut&&(pe&&ir(z,Ce),xt(z))),We(z),Ce=z.type,Te=z.pendingProps,ut=R!==null?R.memoizedProps:null,pe=Te.children,Yf(Ce,Te)?pe=null:ut!==null&&Yf(Ce,ut)&&(z.flags|=32),z.memoizedState!==null&&(Ce=MC(R,z,YH,null,null,q),ql?WC._currentValue=Ce:WC._currentValue2=Ce),Hf(R,z),hh(R,z,pe,q),z.child;case 6:return R===null&&$a&&(R=z.pendingProps,q=ht(),R=vW(R,q),q=Cu,(pe=!q)||(pe=qC(q,z.pendingProps,La),pe!==null?(z.stateNode=pe,Sc=z,Cu=null,pe=!0):pe=!1,pe=!pe),pe&&(R&&ir(z,q),xt(z))),null;case 13:return rM(R,z,q);case 4:return et(z,z.stateNode.containerInfo),pe=z.pendingProps,R===null?z.child=Bg(z,null,pe,q):hh(R,z,pe,q),z.child;case 11:return nM(R,z,z.type,z.pendingProps,q);case 7:return hh(R,z,z.pendingProps,q),z.child;case 8:return hh(R,z,z.pendingProps.children,q),z.child;case 12:return z.flags|=4,z.flags|=2048,pe=z.stateNode,pe.effectDuration=-0,pe.passiveEffectDuration=-0,hh(R,z,z.pendingProps.children,q),z.child;case 10:return pe=z.type,Ce=z.pendingProps,Te=Ce.value,"value"in Ce||FF||(FF=!0,console.error("The `value` prop is required for the `<Context.Provider>`. Did you misspell it or forget to pass it?")),Bn(z,pe,Te),hh(R,z,Ce.children,q),z.child;case 9:return Ce=z.type._context,pe=z.pendingProps.children,typeof pe!=="function"&&console.error("A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it."),io(z),Ce=Wo(Ce),de(z),pe=SN(pe,Ce,void 0),me(),z.flags|=1,hh(R,z,pe,q),z.child;case 14:return uD(R,z,z.type,z.pendingProps,q);case 15:return XH(R,z,z.type,z.pendingProps,q);case 19:return d_(R,z,q);case 31:return pe=z.pendingProps,q=z.mode,pe={mode:pe.mode,children:pe.children},R===null?(R=iM(pe,q),R.ref=z.ref,z.child=R,R.return=z,z=R):(R=Fx(R.child,pe),R.ref=z.ref,z.child=R,R.return=z,z=R),z;case 22:return iy(R,z,q);case 24:return io(z),pe=Wo(Dh),R===null?(Ce=Zi(),Ce===null&&(Ce=Qh,Te=Ci(),Ce.pooledCache=Te,ea(Te),Te!==null&&(Ce.pooledCacheLanes|=q),Ce=Te),z.memoizedState={parent:pe,cache:Ce},lp(z),Bn(z,Dh,Ce)):((R.lanes&q)!==0&&(fg(R,z),N2(z,null,null,q),c_()),Ce=R.memoizedState,Te=z.memoizedState,Ce.parent!==pe?(Ce={parent:pe,cache:pe},z.memoizedState=Ce,z.lanes===0&&(z.memoizedState=z.updateQueue.baseState=Ce),Bn(z,Dh,pe)):(pe=Te.cache,Bn(z,Dh,pe),pe!==Ce.cache&&Nn(z,[Dh],q,!0))),hh(R,z,z.pendingProps.children,q),z.child;case 29:throw z.pendingProps}throw Error("Unknown unit of work tag ("+z.tag+"). This error is likely caused by a bug in React. Please file an issue.")}function yA(R){R.flags|=4}function sM(R,z){if(R!==null&&R.child===z.child)return!1;if((z.flags&16)!==0)return!0;for(R=z.child;R!==null;){if((R.flags&13878)!==0||(R.subtreeFlags&13878)!==0)return!0;R=R.sibling}return!1}function fD(R,z,q,pe){if($c)for(q=z.child;q!==null;){if(q.tag===5||q.tag===6)nN(R,q.stateNode);else if(!(q.tag===4||l0&&q.tag===27)&&q.child!==null){q.child.return=q,q=q.child;continue}if(q===z)break;for(;q.sibling===null;){if(q.return===null||q.return===z)return;q=q.return}q.sibling.return=q.return,q=q.sibling}else if(c0)for(var Ce=z.child;Ce!==null;){if(Ce.tag===5){var Te=Ce.stateNode;q&&pe&&(Te=p_(Te,Ce.type,Ce.memoizedProps)),nN(R,Te)}else if(Ce.tag===6)Te=Ce.stateNode,q&&pe&&(Te=sN(Te,Ce.memoizedProps)),nN(R,Te);else if(Ce.tag!==4){if(Ce.tag===22&&Ce.memoizedState!==null)Te=Ce.child,Te!==null&&(Te.return=Ce),fD(R,Ce,!0,!0);else if(Ce.child!==null){Ce.child.return=Ce,Ce=Ce.child;continue}}if(Ce===z)break;for(;Ce.sibling===null;){if(Ce.return===null||Ce.return===z)return;Ce=Ce.return}Ce.sibling.return=Ce.return,Ce=Ce.sibling}}function aM(R,z,q,pe){var Ce=!1;if(c0)for(var Te=z.child;Te!==null;){if(Te.tag===5){var ut=Te.stateNode;q&&pe&&(ut=p_(ut,Te.type,Te.memoizedProps)),HI(R,ut)}else if(Te.tag===6)ut=Te.stateNode,q&&pe&&(ut=sN(ut,Te.memoizedProps)),HI(R,ut);else if(Te.tag!==4){if(Te.tag===22&&Te.memoizedState!==null)Ce=Te.child,Ce!==null&&(Ce.return=Te),aM(R,Te,!0,!0),Ce=!0;else if(Te.child!==null){Te.child.return=Te,Te=Te.child;continue}}if(Te===z)break;for(;Te.sibling===null;){if(Te.return===null||Te.return===z)return Ce;Te=Te.return}Te.sibling.return=Te.return,Te=Te.sibling}return Ce}function $H(R,z){if(c0&&sM(R,z)){R=z.stateNode;var q=R.containerInfo,pe=qi();aM(pe,z,!1,!1),R.pendingChildren=pe,yA(z),gp(q,pe)}}function E8(R,z,q,pe){if($c)R.memoizedProps!==pe&&yA(z);else if(c0){var Ce=R.stateNode,Te=R.memoizedProps;if((R=sM(R,z))||Te!==pe){var ut=ht();Te=CW(Ce,q,Te,pe,!R,null),Te===Ce?z.stateNode=Ce:(F2(Te,q,pe,ut)&&yA(z),z.stateNode=Te,R?fD(Te,z,!1,!1):yA(z))}else z.stateNode=Ce}}function yD(R,z,q){if(rN(z,q)){if(R.flags|=16777216,!z8(z,q))if(FD())R.flags|=8192;else throw p7=CN,xN}else R.flags&=-16777217}function qH(R,z){if(uN(z)){if(R.flags|=16777216,!EM(z))if(FD())R.flags|=8192;else throw p7=CN,xN}else R.flags&=-16777217}function M8(R,z){z!==null&&(R.flags|=4),R.flags&16384&&(z=R.tag!==22?j():536870912,R.lanes|=z,BA|=z)}function AI(R,z){if(!$a)switch(R.tailMode){case"hidden":z=R.tail;for(var q=null;z!==null;)z.alternate!==null&&(q=z),z=z.sibling;q===null?R.tail=null:q.sibling=null;break;case"collapsed":q=R.tail;for(var pe=null;q!==null;)q.alternate!==null&&(pe=q),q=q.sibling;pe===null?z||R.tail===null?R.tail=null:R.tail.sibling=null:pe.sibling=null}}function al(R){var z=R.alternate!==null&&R.alternate.child===R.child,q=0,pe=0;if(z)if((R.mode&2)!==Cl){for(var{selfBaseDuration:Ce,child:Te}=R;Te!==null;)q|=Te.lanes|Te.childLanes,pe|=Te.subtreeFlags&65011712,pe|=Te.flags&65011712,Ce+=Te.treeBaseDuration,Te=Te.sibling;R.treeBaseDuration=Ce}else for(Ce=R.child;Ce!==null;)q|=Ce.lanes|Ce.childLanes,pe|=Ce.subtreeFlags&65011712,pe|=Ce.flags&65011712,Ce.return=R,Ce=Ce.sibling;else if((R.mode&2)!==Cl){Ce=R.actualDuration,Te=R.selfBaseDuration;for(var ut=R.child;ut!==null;)q|=ut.lanes|ut.childLanes,pe|=ut.subtreeFlags,pe|=ut.flags,Ce+=ut.actualDuration,Te+=ut.treeBaseDuration,ut=ut.sibling;R.actualDuration=Ce,R.treeBaseDuration=Te}else for(Ce=R.child;Ce!==null;)q|=Ce.lanes|Ce.childLanes,pe|=Ce.subtreeFlags,pe|=Ce.flags,Ce.return=R,Ce=Ce.sibling;return R.subtreeFlags|=pe,R.childLanes=q,z}function NC(R,z,q){var pe=z.pendingProps;switch(Nt(z),z.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return al(z),null;case 1:return al(z),null;case 3:if(q=z.stateNode,pe=null,R!==null&&(pe=R.memoizedState.cache),z.memoizedState.cache!==pe&&(z.flags|=2048),ho(Dh,z),vt(z),q.pendingContext&&(q.context=q.pendingContext,q.pendingContext=null),R===null||R.child===null)Zt(z)?(Zn(),yA(z)):R===null||R.memoizedState.isDehydrated&&(z.flags&256)===0||(z.flags|=1024,Kt());return $H(R,z),al(z),null;case 26:if(G2){q=z.type;var Ce=z.memoizedState;return R===null?(yA(z),Ce!==null?(al(z),qH(z,Ce)):(al(z),yD(z,q,pe))):Ce?Ce!==R.memoizedState?(yA(z),al(z),qH(z,Ce)):(al(z),z.flags&=-16777217):($c?R.memoizedProps!==pe&&yA(z):E8(R,z,q,pe),al(z),yD(z,q,pe)),null}case 27:if(l0){if(Le(z),q=Tt(Xf.current),Ce=z.type,R!==null&&z.stateNode!=null)$c?R.memoizedProps!==pe&&yA(z):E8(R,z,Ce,pe);else{if(!pe){if(z.stateNode===null)throw Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");return al(z),null}R=ht(),Zt(z)?gt(z,R):(R=bF(Ce,pe,q,R,!0),z.stateNode=R,yA(z))}return al(z),null}case 5:if(Le(z),q=z.type,R!==null&&z.stateNode!=null)E8(R,z,q,pe);else{if(!pe){if(z.stateNode===null)throw Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");return al(z),null}R=ht(),Zt(z)?gt(z,R):(Ce=Tt(Xf.current),Ce=RI(q,pe,Ce,R,z),fD(Ce,z,!1,!1),z.stateNode=Ce,F2(Ce,q,pe,R)&&yA(z))}return al(z),yD(z,z.type,z.pendingProps),null;case 6:if(R&&z.stateNode!=null)q=R.memoizedProps,$c?q!==pe&&yA(z):c0&&(q!==pe?(R=Tt(Xf.current),q=ht(),z.stateNode=pW(pe,R,q,z),yA(z)):z.stateNode=R.stateNode);else{if(typeof pe!=="string"&&z.stateNode===null)throw Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");if(R=Tt(Xf.current),q=ht(),Zt(z)){if(!Sg)throw Error("Expected prepareToHydrateHostTextInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.");R=z.stateNode,q=z.memoizedProps,Ce=!xy,pe=null;var Te=Sc;if(Te!==null)switch(Te.tag){case 3:Ce&&(Ce=hN(R,q,pe),Ce!==null&&(To(z,0).serverProps=Ce));break;case 27:case 5:pe=Te.memoizedProps,Ce&&(Ce=hN(R,q,pe),Ce!==null&&(To(z,0).serverProps=Ce))}SM(R,q,z,pe)||xt(z)}else z.stateNode=pW(pe,R,q,z)}return al(z),null;case 13:if(pe=z.memoizedState,R===null||R.memoizedState!==null&&R.memoizedState.dehydrated!==null){if(Ce=Zt(z),pe!==null&&pe.dehydrated!==null){if(R===null){if(!Ce)throw Error("A dehydrated suspense component was completed without a hydrated node. This is probably a bug in React.");if(!Sg)throw Error("Expected prepareToHydrateHostSuspenseInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.");if(Ce=z.memoizedState,Ce=Ce!==null?Ce.dehydrated:null,!Ce)throw Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");PM(Ce,z),al(z),(z.mode&2)!==Cl&&pe!==null&&(Ce=z.child,Ce!==null&&(z.treeBaseDuration-=Ce.treeBaseDuration))}else Zn(),Mt(),(z.flags&128)===0&&(z.memoizedState=null),z.flags|=4,al(z),(z.mode&2)!==Cl&&pe!==null&&(Ce=z.child,Ce!==null&&(z.treeBaseDuration-=Ce.treeBaseDuration));Ce=!1}else Ce=Kt(),R!==null&&R.memoizedState!==null&&(R.memoizedState.hydrationErrors=Ce),Ce=!0;if(!Ce){if(z.flags&256)return oy(z),z;return oy(z),null}}if(oy(z),(z.flags&128)!==0)return z.lanes=q,(z.mode&2)!==Cl&&cp(z),z;return q=pe!==null,R=R!==null&&R.memoizedState!==null,q&&(pe=z.child,Ce=null,pe.alternate!==null&&pe.alternate.memoizedState!==null&&pe.alternate.memoizedState.cachePool!==null&&(Ce=pe.alternate.memoizedState.cachePool.pool),Te=null,pe.memoizedState!==null&&pe.memoizedState.cachePool!==null&&(Te=pe.memoizedState.cachePool.pool),Te!==Ce&&(pe.flags|=2048)),q!==R&&q&&(z.child.flags|=8192),M8(z,z.updateQueue),al(z),(z.mode&2)!==Cl&&q&&(R=z.child,R!==null&&(z.treeBaseDuration-=R.treeBaseDuration)),null;case 4:return vt(z),$H(R,z),R===null&&lF(z.stateNode.containerInfo),al(z),null;case 10:return ho(z.type,z),al(z),null;case 19:if(B(Rh,z),Ce=z.memoizedState,Ce===null)return al(z),null;if(pe=(z.flags&128)!==0,Te=Ce.rendering,Te===null)if(pe)AI(Ce,!1);else{if(vu!==wA||R!==null&&(R.flags&128)!==0)for(R=z.child;R!==null;){if(Te=v8(R),Te!==null){z.flags|=128,AI(Ce,!1),R=Te.updateQueue,z.updateQueue=R,M8(z,R),z.subtreeFlags=0,R=q;for(q=z.child;q!==null;)F0(q,R),q=q.sibling;return T(Rh,Rh.current&lb|hb,z),z.child}R=R.sibling}Ce.tail!==null&&Wf()>w7&&(z.flags|=128,pe=!0,AI(Ce,!1),z.lanes=4194304)}else{if(!pe)if(R=v8(Te),R!==null){if(z.flags|=128,pe=!0,R=R.updateQueue,z.updateQueue=R,M8(z,R),AI(Ce,!0),Ce.tail===null&&Ce.tailMode==="hidden"&&!Te.alternate&&!$a)return al(z),null}else 2*Wf()-Ce.renderingStartTime>w7&&q!==536870912&&(z.flags|=128,pe=!0,AI(Ce,!1),z.lanes=4194304);Ce.isBackwards?(Te.sibling=z.child,z.child=Te):(R=Ce.last,R!==null?R.sibling=Te:z.child=Te,Ce.last=Te)}if(Ce.tail!==null)return R=Ce.tail,Ce.rendering=R,Ce.tail=R.sibling,Ce.renderingStartTime=Wf(),R.sibling=null,q=Rh.current,q=pe?q&lb|hb:q&lb,T(Rh,q,z),R;return al(z),null;case 22:case 23:return oy(z),Ud(z),pe=z.memoizedState!==null,R!==null?R.memoizedState!==null!==pe&&(z.flags|=8192):pe&&(z.flags|=8192),pe?(q&536870912)!==0&&(z.flags&128)===0&&(al(z),z.subtreeFlags&6&&(z.flags|=8192)):al(z),q=z.updateQueue,q!==null&&M8(z,q.retryQueue),q=null,R!==null&&R.memoizedState!==null&&R.memoizedState.cachePool!==null&&(q=R.memoizedState.cachePool.pool),pe=null,z.memoizedState!==null&&z.memoizedState.cachePool!==null&&(pe=z.memoizedState.cachePool.pool),pe!==q&&(z.flags|=2048),R!==null&&B(z4,z),null;case 24:return q=null,R!==null&&(q=R.memoizedState.cache),z.memoizedState.cache!==q&&(z.flags|=2048),ho(Dh,z),al(z),null;case 25:return null;case 30:return null}throw Error("Unknown unit of work tag ("+z.tag+"). This error is likely caused by a bug in React. Please file an issue.")}function cM(R,z){switch(Nt(z),z.tag){case 1:return R=z.flags,R&65536?(z.flags=R&-65537|128,(z.mode&2)!==Cl&&cp(z),z):null;case 3:return ho(Dh,z),vt(z),R=z.flags,(R&65536)!==0&&(R&128)===0?(z.flags=R&-65537|128,z):null;case 26:case 27:case 5:return Le(z),null;case 13:if(oy(z),R=z.memoizedState,R!==null&&R.dehydrated!==null){if(z.alternate===null)throw Error("Threw in newly mounted dehydrated component. This is likely a bug in React. Please file an issue.");Mt()}return R=z.flags,R&65536?(z.flags=R&-65537|128,(z.mode&2)!==Cl&&cp(z),z):null;case 19:return B(Rh,z),null;case 4:return vt(z),null;case 10:return ho(z.type,z),null;case 22:case 23:return oy(z),Ud(z),R!==null&&B(z4,z),R=z.flags,R&65536?(z.flags=R&-65537|128,(z.mode&2)!==Cl&&cp(z),z):null;case 24:return ho(Dh,z),null;case 25:return null;default:return null}}function lM(R,z){switch(Nt(z),z.tag){case 3:ho(Dh,z),vt(z);break;case 26:case 27:case 5:Le(z);break;case 4:vt(z);break;case 13:oy(z);break;case 19:B(Rh,z);break;case 10:ho(z.type,z);break;case 22:case 23:oy(z),Ud(z),R!==null&&B(z4,z);break;case 24:ho(Dh,z)}}function xA(R){return(R.mode&2)!==Cl}function w8(R,z){xA(R)?(Od(),hM(z,R),Xc()):hM(z,R)}function xD(R,z,q){xA(R)?(Od(),fI(q,R,z),Xc()):fI(q,R,z)}function hM(R,z){try{var q=z.updateQueue,pe=q!==null?q.lastEffect:null;if(pe!==null){var Ce=pe.next;q=Ce;do{if((q.tag&R)===R&&((R&Nh)!==PA?Cr!==null&&typeof Cr.markComponentPassiveEffectMountStarted==="function"&&Cr.markComponentPassiveEffectMountStarted(z):(R&Ap)!==PA&&Cr!==null&&typeof Cr.markComponentLayoutEffectMountStarted==="function"&&Cr.markComponentLayoutEffectMountStarted(z),pe=void 0,(R&Bm)!==PA&&(YM=!0),pe=_n(z,So,q),(R&Bm)!==PA&&(YM=!1),(R&Nh)!==PA?Cr!==null&&typeof Cr.markComponentPassiveEffectMountStopped==="function"&&Cr.markComponentPassiveEffectMountStopped():(R&Ap)!==PA&&Cr!==null&&typeof Cr.markComponentLayoutEffectMountStopped==="function"&&Cr.markComponentLayoutEffectMountStopped(),pe!==void 0&&typeof pe!=="function")){var Te=void 0;Te=(q.tag&Ap)!==0?"useLayoutEffect":(q.tag&Bm)!==0?"useInsertionEffect":"useEffect";var ut=void 0;ut=pe===null?" You returned null. If your effect does not require clean up, return undefined (or nothing).":typeof pe.then==="function"?`

It looks like you wrote `+Te+`(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:

`+Te+`(() => {
  async function fetchData() {
    // You can await here
    const response = await MyAPI.getData(someId);
    // ...
  }
  fetchData();
}, [someId]); // Or [] if effect doesn't need props or state

Learn more about data fetching with Hooks: https://react.dev/link/hooks-data-fetching`:" You returned: "+pe,_n(z,function(wt,In){console.error("%s must not return anything besides a function, which is used for clean-up.%s",wt,In)},Te,ut)}q=q.next}while(q!==Ce)}}catch(wt){yl(z,z.return,wt)}}function fI(R,z,q){try{var pe=z.updateQueue,Ce=pe!==null?pe.lastEffect:null;if(Ce!==null){var Te=Ce.next;pe=Te;do{if((pe.tag&R)===R){var ut=pe.inst,wt=ut.destroy;wt!==void 0&&(ut.destroy=void 0,(R&Nh)!==PA?Cr!==null&&typeof Cr.markComponentPassiveEffectUnmountStarted==="function"&&Cr.markComponentPassiveEffectUnmountStarted(z):(R&Ap)!==PA&&Cr!==null&&typeof Cr.markComponentLayoutEffectUnmountStarted==="function"&&Cr.markComponentLayoutEffectUnmountStarted(z),(R&Bm)!==PA&&(YM=!0),Ce=z,_n(Ce,Rr,Ce,q,wt),(R&Bm)!==PA&&(YM=!1),(R&Nh)!==PA?Cr!==null&&typeof Cr.markComponentPassiveEffectUnmountStopped==="function"&&Cr.markComponentPassiveEffectUnmountStopped():(R&Ap)!==PA&&Cr!==null&&typeof Cr.markComponentLayoutEffectUnmountStopped==="function"&&Cr.markComponentLayoutEffectUnmountStopped())}pe=pe.next}while(pe!==Te)}}catch(In){yl(z,z.return,In)}}function CD(R,z){xA(R)?(Od(),hM(z,R),Xc()):hM(z,R)}function dM(R,z,q){xA(R)?(Od(),fI(q,R,z),Xc()):fI(q,R,z)}function bD(R){var z=R.updateQueue;if(z!==null){var q=R.stateNode;R.type.defaultProps||"ref"in R.memoizedProps||wN||(q.props!==R.memoizedProps&&console.error("Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",P(R)||"instance"),q.state!==R.memoizedState&&console.error("Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",P(R)||"instance"));try{_n(R,L0,z,q)}catch(pe){yl(R,R.return,pe)}}}function RC(R,z,q){return R.getSnapshotBeforeUpdate(z,q)}function JH(R,z){var q=z.memoizedProps,pe=z.memoizedState;z=R.stateNode,R.type.defaultProps||"ref"in R.memoizedProps||wN||(z.props!==R.memoizedProps&&console.error("Expected %s props to match memoized props before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",P(R)||"instance"),z.state!==R.memoizedState&&console.error("Expected %s state to match memoized state before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",P(R)||"instance"));try{var Ce=kf(R.type,q,R.elementType===R.type),Te=_n(R,RC,z,Ce,pe);q=QW,Te!==void 0||q.has(R.type)||(q.add(R.type),_n(R,function(){console.error("%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.",P(R))})),z.__reactInternalSnapshotBeforeUpdate=Te}catch(ut){yl(R,R.return,ut)}}function ID(R,z,q){q.props=kf(R.type,R.memoizedProps),q.state=R.memoizedState,xA(R)?(Od(),_n(R,Hn,R,z,q),Xc()):_n(R,Hn,R,z,q)}function QC(R){var z=R.ref;if(z!==null){switch(R.tag){case 26:case 27:case 5:var q=NI(R.stateNode);break;case 30:q=R.stateNode;break;default:q=R.stateNode}if(typeof z==="function")if(xA(R))try{Od(),R.refCleanup=z(q)}finally{Xc()}else R.refCleanup=z(q);else typeof z==="string"?console.error("String refs are no longer supported."):z.hasOwnProperty("current")||console.error("Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().",P(R)),z.current=q}}function Im(R,z){try{_n(R,QC,R)}catch(q){yl(R,z,q)}}function CA(R,z){var q=R.ref,pe=R.refCleanup;if(q!==null)if(typeof pe==="function")try{if(xA(R))try{Od(),_n(R,pe)}finally{Xc(R)}else _n(R,pe)}catch(Ce){yl(R,z,Ce)}finally{R.refCleanup=null,R=R.alternate,R!=null&&(R.refCleanup=null)}else if(typeof q==="function")try{if(xA(R))try{Od(),_n(R,q,null)}finally{Xc(R)}else _n(R,q,null)}catch(Ce){yl(R,z,Ce)}else q.current=null}function vD(R,z,q,pe){var Ce=R.memoizedProps,Te=Ce.id,ut=Ce.onCommit;Ce=Ce.onRender,z=z===null?"mount":"update",r7&&(z="nested-update"),typeof Ce==="function"&&Ce(Te,z,R.actualDuration,R.treeBaseDuration,R.actualStartTime,q),typeof ut==="function"&&ut(R.memoizedProps.id,z,pe,q)}function SD(R,z,q,pe){var Ce=R.memoizedProps;R=Ce.id,Ce=Ce.onPostCommit,z=z===null?"mount":"update",r7&&(z="nested-update"),typeof Ce==="function"&&Ce(R,z,pe,q)}function ra(R){var{type:z,memoizedProps:q,stateNode:pe}=R;try{_n(R,IM,pe,z,q,R)}catch(Ce){yl(R,R.return,Ce)}}function Do(R,z,q){try{_n(R,fW,R.stateNode,R.type,q,z,R)}catch(pe){yl(R,R.return,pe)}}function yI(R){return R.tag===5||R.tag===3||(G2?R.tag===26:!1)||(l0?R.tag===27&&UI(R.type):!1)||R.tag===4}function B8(R){e:for(;;){for(;R.sibling===null;){if(R.return===null||yI(R.return))return null;R=R.return}R.sibling.return=R.return;for(R=R.sibling;R.tag!==5&&R.tag!==6&&R.tag!==18;){if(l0&&R.tag===27&&UI(R.type))continue e;if(R.flags&2)continue e;if(R.child===null||R.tag===4)continue e;else R.child.return=R,R=R.child}if(!(R.flags&2))return R.stateNode}}function gd(R,z,q){var pe=R.tag;if(pe===5||pe===6)R=R.stateNode,z?KC(q,R,z):jC(q,R);else if(pe!==4&&(l0&&pe===27&&UI(R.type)&&(q=R.stateNode,z=null),R=R.child,R!==null))for(gd(R,z,q),R=R.sibling;R!==null;)gd(R,z,q),R=R.sibling}function xI(R,z,q){var pe=R.tag;if(pe===5||pe===6)R=R.stateNode,z?Vx(q,R,z):V8(q,R);else if(pe!==4&&(l0&&pe===27&&UI(R.type)&&(q=R.stateNode),R=R.child,R!==null))for(xI(R,z,q),R=R.sibling;R!==null;)xI(R,z,q),R=R.sibling}function ZH(R){if($c){for(var z,q=R.return;q!==null;){if(yI(q)){z=q;break}q=q.return}if(z==null)throw Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");switch(z.tag){case 27:if(l0){z=z.stateNode,q=B8(R),xI(R,q,z);break}case 5:q=z.stateNode,z.flags&32&&(mF(q),z.flags&=-33),z=B8(R),xI(R,z,q);break;case 3:case 4:z=z.stateNode.containerInfo,q=B8(R),gd(R,q,z);break;default:throw Error("Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue.")}}}function eF(R,z,q){R=R.containerInfo;try{_n(z,$C,R,q)}catch(pe){yl(z,z.return,pe)}}function PD(R){var{stateNode:z,memoizedProps:q}=R;try{_n(R,Aoe,R.type,q,z,R)}catch(pe){yl(R,R.return,pe)}}function eW(R,z){cF(R.containerInfo);for(Gp=z;Gp!==null;)if(R=Gp,z=R.child,(R.subtreeFlags&1024)!==0&&z!==null)z.return=R,Gp=z;else for(;Gp!==null;){z=R=Gp;var q=z.alternate,pe=z.flags;switch(z.tag){case 0:break;case 11:case 15:break;case 1:(pe&1024)!==0&&q!==null&&JH(z,q);break;case 3:(pe&1024)!==0&&$c&&xW(z.stateNode.containerInfo);break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((pe&1024)!==0)throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.")}if(z=R.sibling,z!==null){z.return=R.return,Gp=z;break}Gp=R.return}}function ED(R,z,q){var pe=q.flags;switch(q.tag){case 0:case 11:case 15:bA(R,q),pe&4&&w8(q,Ap|$h);break;case 1:if(bA(R,q),pe&4)if(R=q.stateNode,z===null)q.type.defaultProps||"ref"in q.memoizedProps||wN||(R.props!==q.memoizedProps&&console.error("Expected %s props to match memoized props before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",P(q)||"instance"),R.state!==q.memoizedState&&console.error("Expected %s state to match memoized state before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",P(q)||"instance")),xA(q)?(Od(),_n(q,Fe,q,R),Xc()):_n(q,Fe,q,R);else{var Ce=kf(q.type,z.memoizedProps);z=z.memoizedState,q.type.defaultProps||"ref"in q.memoizedProps||wN||(R.props!==q.memoizedProps&&console.error("Expected %s props to match memoized props before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",P(q)||"instance"),R.state!==q.memoizedState&&console.error("Expected %s state to match memoized state before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",P(q)||"instance")),xA(q)?(Od(),_n(q,yt,q,R,Ce,z,R.__reactInternalSnapshotBeforeUpdate),Xc()):_n(q,yt,q,R,Ce,z,R.__reactInternalSnapshotBeforeUpdate)}pe&64&&bD(q),pe&512&&Im(q,q.return);break;case 3:if(z=Oo(),bA(R,q),pe&64&&(pe=q.updateQueue,pe!==null)){if(Ce=null,q.child!==null)switch(q.child.tag){case 27:case 5:Ce=NI(q.child.stateNode);break;case 1:Ce=q.child.stateNode}try{_n(q,L0,pe,Ce)}catch(ut){yl(q,q.return,ut)}}R.effectDuration+=$i(z);break;case 27:l0&&z===null&&pe&4&&PD(q);case 26:case 5:bA(R,q),z===null&&pe&4&&ra(q),pe&512&&Im(q,q.return);break;case 12:if(pe&4){pe=Oo(),bA(R,q),R=q.stateNode,R.effectDuration+=Ei(pe);try{_n(q,vD,q,z,DM,R.effectDuration)}catch(ut){yl(q,q.return,ut)}}else bA(R,q);break;case 13:bA(R,q),pe&4&&cl(R,q),pe&64&&(R=q.memoizedState,R!==null&&(R=R.dehydrated,R!==null&&(q=Of.bind(null,q),bW(R,q))));break;case 22:if(pe=q.memoizedState!==null||q4,!pe){z=z!==null&&z.memoizedState!==null||Yl,Ce=q4;var Te=Yl;q4=pe,(Yl=z)&&!Te?H2(R,q,(q.subtreeFlags&8772)!==0):bA(R,q),q4=Ce,Yl=Te}break;case 30:break;default:bA(R,q)}}function MD(R){var z=R.alternate;z!==null&&(R.alternate=null,MD(z)),R.child=null,R.deletions=null,R.sibling=null,R.tag===5&&(z=R.stateNode,z!==null&&uF(z)),R.stateNode=null,R._debugOwner=null,R.return=null,R.dependencies=null,R.memoizedProps=null,R.memoizedState=null,R.pendingProps=null,R.stateNode=null,R.updateQueue=null}function zf(R,z,q){for(q=q.child;q!==null;)vm(R,z,q),q=q.sibling}function vm(R,z,q){if(Em&&typeof Em.onCommitFiberUnmount==="function")try{Em.onCommitFiberUnmount(eb,q)}catch(Te){U2||(U2=!0,console.error("React instrumentation encountered an error: %s",Te))}switch(q.tag){case 26:if(G2){Yl||CA(q,z),zf(R,z,q),q.memoizedState?JC(q.memoizedState):q.stateNode&&xF(q.stateNode);break}case 27:if(l0){Yl||CA(q,z);var pe=z0,Ce=q2;UI(q.type)&&(z0=q.stateNode,q2=!1),zf(R,z,q),_n(q,IF,q.stateNode),z0=pe,q2=Ce;break}case 5:Yl||CA(q,z);case 6:if($c){if(pe=z0,Ce=q2,z0=null,zf(R,z,q),z0=pe,q2=Ce,z0!==null)if(q2)try{_n(q,LI,z0,q.stateNode)}catch(Te){yl(q,z,Te)}else try{_n(q,pF,z0,q.stateNode)}catch(Te){yl(q,z,Te)}}else zf(R,z,q);break;case 18:$c&&z0!==null&&(q2?OI(z0,q.stateNode):lN(z0,q.stateNode));break;case 4:$c?(pe=z0,Ce=q2,z0=q.stateNode.containerInfo,q2=!0,zf(R,z,q),z0=pe,q2=Ce):(c0&&eF(q.stateNode,q,qi()),zf(R,z,q));break;case 0:case 11:case 14:case 15:Yl||fI(Bm,q,z),Yl||xD(q,z,Ap),zf(R,z,q);break;case 1:Yl||(CA(q,z),pe=q.stateNode,typeof pe.componentWillUnmount==="function"&&ID(q,z,pe)),zf(R,z,q);break;case 21:zf(R,z,q);break;case 22:Yl=(pe=Yl)||q.memoizedState!==null,zf(R,z,q),Yl=pe;break;default:zf(R,z,q)}}function cl(R,z){if(Sg&&z.memoizedState===null&&(R=z.alternate,R!==null&&(R=R.memoizedState,R!==null&&(R=R.dehydrated,R!==null))))try{_n(z,fF,R)}catch(q){yl(z,z.return,q)}}function wD(R){switch(R.tag){case 13:case 19:var z=R.stateNode;return z===null&&(z=R.stateNode=new kW),z;case 22:return R=R.stateNode,z=R._retryCache,z===null&&(z=R._retryCache=new kW),z;default:throw Error("Unexpected Suspense handler tag ("+R.tag+"). This is a bug in React.")}}function CI(R,z){var q=wD(R);z.forEach(function(pe){var Ce=aW.bind(null,R,pe);if(!q.has(pe)){if(q.add(pe),W2)if(h9!==null&&Qm!==null)Q8(Qm,h9);else throw Error("Expected finished root and lanes to be set. This is a bug in React.");pe.then(Ce,Ce)}})}function Au(R,z){var q=z.deletions;if(q!==null)for(var pe=0;pe<q.length;pe++){var Ce=R,Te=z,ut=q[pe];if($c){var wt=Te;e:for(;wt!==null;){switch(wt.tag){case 27:if(l0){if(UI(wt.type)){z0=wt.stateNode,q2=!1;break e}break}case 5:z0=wt.stateNode,q2=!1;break e;case 3:case 4:z0=wt.stateNode.containerInfo,q2=!0;break e}wt=wt.return}if(z0===null)throw Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");vm(Ce,Te,ut),z0=null,q2=!1}else vm(Ce,Te,ut);Ce=ut,Te=Ce.alternate,Te!==null&&(Te.return=null),Ce.return=null}if(z.subtreeFlags&13878)for(z=z.child;z!==null;)kC(z,R),z=z.sibling}function kC(R,z){var q=R.alternate,pe=R.flags;switch(R.tag){case 0:case 11:case 14:case 15:Au(z,R),Ad(R),pe&4&&(fI(Bm|$h,R,R.return),hM(Bm|$h,R),xD(R,R.return,Ap|$h));break;case 1:Au(z,R),Ad(R),pe&512&&(Yl||q===null||CA(q,q.return)),pe&64&&q4&&(R=R.updateQueue,R!==null&&(pe=R.callbacks,pe!==null&&(q=R.shared.hiddenCallbacks,R.shared.hiddenCallbacks=q===null?pe:q.concat(pe))));break;case 26:if(G2){var Ce=J4;Au(z,R),Ad(R),pe&512&&(Yl||q===null||CA(q,q.return)),pe&4&&(pe=q!==null?q.memoizedState:null,z=R.memoizedState,q===null?z===null?R.stateNode===null?R.stateNode=X8(Ce,R.type,R.memoizedProps,R):yF(Ce,R.type,R.stateNode):R.stateNode=dN(Ce,z,R.memoizedProps):pe!==z?(pe===null?q.stateNode!==null&&xF(q.stateNode):JC(pe),z===null?yF(Ce,R.type,R.stateNode):dN(Ce,z,R.memoizedProps)):z===null&&R.stateNode!==null&&Do(R,R.memoizedProps,q.memoizedProps));break}case 27:if(l0){Au(z,R),Ad(R),pe&512&&(Yl||q===null||CA(q,q.return)),q!==null&&pe&4&&Do(R,R.memoizedProps,q.memoizedProps);break}case 5:if(Au(z,R),Ad(R),pe&512&&(Yl||q===null||CA(q,q.return)),$c){if(R.flags&32){z=R.stateNode;try{_n(R,mF,z)}catch(Xo){yl(R,R.return,Xo)}}pe&4&&R.stateNode!=null&&(z=R.memoizedProps,Do(R,z,q!==null?q.memoizedProps:z)),pe&1024&&(BN=!0,R.type!=="form"&&console.error("Unexpected host component type. Expected a form. This is a bug in React."))}break;case 6:if(Au(z,R),Ad(R),pe&4&&$c){if(R.stateNode===null)throw Error("This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue.");pe=R.memoizedProps,q=q!==null?q.memoizedProps:pe,z=R.stateNode;try{_n(R,AW,z,q,pe)}catch(Xo){yl(R,R.return,Xo)}}break;case 3:if(Ce=Oo(),G2){EW();var Te=J4;J4=Yx(z.containerInfo),Au(z,R),J4=Te}else Au(z,R);if(Ad(R),pe&4){if($c&&Sg&&q!==null&&q.memoizedState.isDehydrated)try{_n(R,W8,z.containerInfo)}catch(Xo){yl(R,R.return,Xo)}if(c0){pe=z.containerInfo,q=z.pendingChildren;try{_n(R,$C,pe,q)}catch(Xo){yl(R,R.return,Xo)}}}BN&&(BN=!1,BD(R)),z.effectDuration+=$i(Ce);break;case 4:G2?(q=J4,J4=Yx(R.stateNode.containerInfo),Au(z,R),Ad(R),J4=q):(Au(z,R),Ad(R)),pe&4&&c0&&eF(R.stateNode,R,R.stateNode.pendingChildren);break;case 12:pe=Oo(),Au(z,R),Ad(R),R.stateNode.effectDuration+=Ei(pe);break;case 13:Au(z,R),Ad(R),R.child.flags&8192&&R.memoizedState!==null!==(q!==null&&q.memoizedState!==null)&&(voe=Wf()),pe&4&&(pe=R.updateQueue,pe!==null&&(R.updateQueue=null,CI(R,pe)));break;case 22:Ce=R.memoizedState!==null;var ut=q!==null&&q.memoizedState!==null,wt=q4,In=Yl;if(q4=wt||Ce,Yl=In||ut,Au(z,R),Yl=In,q4=wt,Ad(R),pe&8192&&(z=R.stateNode,z._visibility=Ce?z._visibility&-2:z._visibility|1,Ce&&(q===null||ut||q4||Yl||ay(R)),$c)){e:if(q=null,$c)for(z=R;;){if(z.tag===5||G2&&z.tag===26){if(q===null){ut=q=z;try{Te=ut.stateNode,Ce?_n(ut,_F,Te):_n(ut,O2,ut.stateNode,ut.memoizedProps)}catch(Xo){yl(ut,ut.return,Xo)}}}else if(z.tag===6){if(q===null){ut=z;try{var to=ut.stateNode;Ce?_n(ut,yW,to):_n(ut,gF,to,ut.memoizedProps)}catch(Xo){yl(ut,ut.return,Xo)}}}else if((z.tag!==22&&z.tag!==23||z.memoizedState===null||z===R)&&z.child!==null){z.child.return=z,z=z.child;continue}if(z===R)break e;for(;z.sibling===null;){if(z.return===null||z.return===R)break e;q===z&&(q=null),z=z.return}q===z&&(q=null),z.sibling.return=z.return,z=z.sibling}}pe&4&&(pe=R.updateQueue,pe!==null&&(q=pe.retryQueue,q!==null&&(pe.retryQueue=null,CI(R,q))));break;case 19:Au(z,R),Ad(R),pe&4&&(pe=R.updateQueue,pe!==null&&(R.updateQueue=null,CI(R,pe)));break;case 30:break;case 21:break;default:Au(z,R),Ad(R)}}function Ad(R){var z=R.flags;if(z&2){try{_n(R,ZH,R)}catch(q){yl(R,R.return,q)}R.flags&=-3}z&4096&&(R.flags&=-4097)}function BD(R){if(R.subtreeFlags&1024)for(R=R.child;R!==null;){var z=R;BD(z),z.tag===5&&z.flags&1024&&z2(z.stateNode),R=R.sibling}}function bA(R,z){if(z.subtreeFlags&8772)for(z=z.child;z!==null;)ED(R,z.alternate,z),z=z.sibling}function TD(R){switch(R.tag){case 0:case 11:case 14:case 15:xD(R,R.return,Ap),ay(R);break;case 1:CA(R,R.return);var z=R.stateNode;typeof z.componentWillUnmount==="function"&&ID(R,R.return,z),ay(R);break;case 27:l0&&_n(R,IF,R.stateNode);case 26:case 5:CA(R,R.return),ay(R);break;case 22:R.memoizedState===null&&ay(R);break;case 30:ay(R);break;default:ay(R)}}function ay(R){for(R=R.child;R!==null;)TD(R),R=R.sibling}function DD(R,z,q,pe){var Ce=q.flags;switch(q.tag){case 0:case 11:case 15:H2(R,q,pe),w8(q,Ap);break;case 1:if(H2(R,q,pe),z=q.stateNode,typeof z.componentDidMount==="function"&&_n(q,Fe,q,z),z=q.updateQueue,z!==null){R=q.stateNode;try{_n(q,hI,z,R)}catch(Te){yl(q,q.return,Te)}}pe&&Ce&64&&bD(q),Im(q,q.return);break;case 27:l0&&PD(q);case 26:case 5:H2(R,q,pe),pe&&z===null&&Ce&4&&ra(q),Im(q,q.return);break;case 12:if(pe&&Ce&4){Ce=Oo(),H2(R,q,pe),pe=q.stateNode,pe.effectDuration+=Ei(Ce);try{_n(q,vD,q,z,DM,pe.effectDuration)}catch(Te){yl(q,q.return,Te)}}else H2(R,q,pe);break;case 13:H2(R,q,pe),pe&&Ce&4&&cl(R,q);break;case 22:q.memoizedState===null&&H2(R,q,pe),Im(q,q.return);break;case 30:break;default:H2(R,q,pe)}}function H2(R,z,q){q=q&&(z.subtreeFlags&8772)!==0;for(z=z.child;z!==null;)DD(R,z.alternate,z,q),z=z.sibling}function zl(R,z){var q=null;R!==null&&R.memoizedState!==null&&R.memoizedState.cachePool!==null&&(q=R.memoizedState.cachePool.pool),R=null,z.memoizedState!==null&&z.memoizedState.cachePool!==null&&(R=z.memoizedState.cachePool.pool),R!==q&&(R!=null&&ea(R),q!=null&&ya(q))}function bI(R,z){R=null,z.alternate!==null&&(R=z.alternate.memoizedState.cache),z=z.memoizedState.cache,z!==R&&(ea(z),R!=null&&ya(R))}function cy(R,z,q,pe){if(z.subtreeFlags&10256)for(z=z.child;z!==null;)up(R,z,q,pe),z=z.sibling}function up(R,z,q,pe){var Ce=z.flags;switch(z.tag){case 0:case 11:case 15:cy(R,z,q,pe),Ce&2048&&CD(z,Nh|$h);break;case 1:cy(R,z,q,pe);break;case 3:var Te=Oo();cy(R,z,q,pe),Ce&2048&&(q=null,z.alternate!==null&&(q=z.alternate.memoizedState.cache),z=z.memoizedState.cache,z!==q&&(ea(z),q!=null&&ya(q))),R.passiveEffectDuration+=$i(Te);break;case 12:if(Ce&2048){Ce=Oo(),cy(R,z,q,pe),R=z.stateNode,R.passiveEffectDuration+=Ei(Ce);try{_n(z,SD,z,z.alternate,DM,R.passiveEffectDuration)}catch(wt){yl(z,z.return,wt)}}else cy(R,z,q,pe);break;case 13:cy(R,z,q,pe);break;case 23:break;case 22:Te=z.stateNode;var ut=z.alternate;z.memoizedState!==null?Te._visibility&2?cy(R,z,q,pe):II(R,z):Te._visibility&2?cy(R,z,q,pe):(Te._visibility|=2,ly(R,z,q,pe,(z.subtreeFlags&10256)!==0)),Ce&2048&&zl(ut,z);break;case 24:cy(R,z,q,pe),Ce&2048&&bI(z.alternate,z);break;default:cy(R,z,q,pe)}}function ly(R,z,q,pe,Ce){Ce=Ce&&(z.subtreeFlags&10256)!==0;for(z=z.child;z!==null;)ND(R,z,q,pe,Ce),z=z.sibling}function ND(R,z,q,pe,Ce){var Te=z.flags;switch(z.tag){case 0:case 11:case 15:ly(R,z,q,pe,Ce),CD(z,Nh);break;case 23:break;case 22:var ut=z.stateNode;z.memoizedState!==null?ut._visibility&2?ly(R,z,q,pe,Ce):II(R,z):(ut._visibility|=2,ly(R,z,q,pe,Ce)),Ce&&Te&2048&&zl(z.alternate,z);break;case 24:ly(R,z,q,pe,Ce),Ce&&Te&2048&&bI(z.alternate,z);break;default:ly(R,z,q,pe,Ce)}}function II(R,z){if(z.subtreeFlags&10256)for(z=z.child;z!==null;){var q=R,pe=z,Ce=pe.flags;switch(pe.tag){case 22:II(q,pe),Ce&2048&&zl(pe.alternate,pe);break;case 24:II(q,pe),Ce&2048&&bI(pe.alternate,pe);break;default:II(q,pe)}z=z.sibling}}function D4(R){if(R.subtreeFlags&x7)for(R=R.child;R!==null;)LC(R),R=R.sibling}function LC(R){switch(R.tag){case 26:D4(R),R.flags&x7&&(R.memoizedState!==null?CF(J4,R.memoizedState,R.memoizedProps):O8(R.type,R.memoizedProps));break;case 5:D4(R),R.flags&x7&&O8(R.type,R.memoizedProps);break;case 3:case 4:if(G2){var z=J4;J4=Yx(R.stateNode.containerInfo),D4(R),J4=z}else D4(R);break;case 22:R.memoizedState===null&&(z=R.alternate,z!==null&&z.memoizedState!==null?(z=x7,x7=16777216,D4(R),x7=z):D4(R));break;default:D4(R)}}function RD(R){var z=R.alternate;if(z!==null&&(R=z.child,R!==null)){z.child=null;do z=R.sibling,R.sibling=null,R=z;while(R!==null)}}function HC(R){var z=R.deletions;if((R.flags&16)!==0){if(z!==null)for(var q=0;q<z.length;q++){var pe=z[q];Gp=pe,tF(pe,R)}RD(R)}if(R.subtreeFlags&10256)for(R=R.child;R!==null;)tW(R),R=R.sibling}function tW(R){switch(R.tag){case 0:case 11:case 15:HC(R),R.flags&2048&&dM(R,R.return,Nh|$h);break;case 3:var z=Oo();HC(R),R.stateNode.passiveEffectDuration+=$i(z);break;case 12:z=Oo(),HC(R),R.stateNode.passiveEffectDuration+=Ei(z);break;case 22:z=R.stateNode,R.memoizedState!==null&&z._visibility&2&&(R.return===null||R.return.tag!==13)?(z._visibility&=-3,uM(R)):HC(R);break;default:HC(R)}}function uM(R){var z=R.deletions;if((R.flags&16)!==0){if(z!==null)for(var q=0;q<z.length;q++){var pe=z[q];Gp=pe,tF(pe,R)}RD(R)}for(R=R.child;R!==null;)QD(R),R=R.sibling}function QD(R){switch(R.tag){case 0:case 11:case 15:dM(R,R.return,Nh),uM(R);break;case 22:var z=R.stateNode;z._visibility&2&&(z._visibility&=-3,uM(R));break;default:uM(R)}}function tF(R,z){for(;Gp!==null;){var q=Gp,pe=q;switch(pe.tag){case 0:case 11:case 15:dM(pe,z,Nh);break;case 23:case 22:pe.memoizedState!==null&&pe.memoizedState.cachePool!==null&&(pe=pe.memoizedState.cachePool.pool,pe!=null&&ea(pe));break;case 24:ya(pe.memoizedState.cache)}if(pe=q.child,pe!==null)pe.return=q,Gp=pe;else e:for(q=R;Gp!==null;){pe=Gp;var Ce=pe.sibling,Te=pe.return;if(MD(pe),pe===q){Gp=null;break e}if(Ce!==null){Ce.return=Te,Gp=Ce;break e}Gp=Te}}}function vI(R){var z=oN(R);if(z!=null){if(typeof z.memoizedProps["data-testname"]!=="string")throw Error("Invalid host root specified. Should be either a React container or a node with a testname attribute.");return z}if(R=Gf(R),R===null)throw Error("Could not find React container within specified host subtree.");return R.stateNode.current}function kD(R,z){var q=R.tag;switch(z.$$typeof){case zF:if(R.type===z.value)return!0;break;case LW:e:{z=z.value,R=[R,0];for(q=0;q<R.length;){var pe=R[q++],Ce=pe.tag,Te=R[q++],ut=z[Te];if(Ce!==5&&Ce!==26&&Ce!==27||!Sm(pe)){for(;ut!=null&&kD(pe,ut);)Te++,ut=z[Te];if(Te===z.length){z=!0;break e}else for(pe=pe.child;pe!==null;)R.push(pe,Te),pe=pe.sibling}}z=!1}return z;case O0:if((q===5||q===26||q===27)&&vA(R.stateNode,z.value))return!0;break;case Jc:if(q===5||q===6||q===26||q===27){if(R=xu(R),R!==null&&0<=R.indexOf(z.value))return!0}break;case Xn:if(q===5||q===26||q===27){if(R=R.memoizedProps["data-testname"],typeof R==="string"&&R.toLowerCase()===z.value.toLowerCase())return!0}break;default:throw Error("Invalid selector type specified.")}return!1}function LD(R){switch(R.$$typeof){case zF:return"<"+(v(R.value)||"Unknown")+">";case LW:return":has("+(LD(R)||"")+")";case O0:return'[role="'+R.value+'"]';case Jc:return'"'+R.value+'"';case Xn:return'[data-testname="'+R.value+'"]';default:throw Error("Invalid selector type specified.")}}function SI(R,z){var q=[];R=[R,0];for(var pe=0;pe<R.length;){var Ce=R[pe++],Te=Ce.tag,ut=R[pe++],wt=z[ut];if(Te!==5&&Te!==26&&Te!==27||!Sm(Ce)){for(;wt!=null&&kD(Ce,wt);)ut++,wt=z[ut];if(ut===z.length)q.push(Ce);else for(Ce=Ce.child;Ce!==null;)R.push(Ce,ut),Ce=Ce.sibling}}return q}function PI(R,z){if(!jd)throw Error("Test selector API is not supported by this renderer.");R=vI(R),R=SI(R,z),z=[],R=Array.from(R);for(var q=0;q<R.length;){var pe=R[q++],Ce=pe.tag;if(Ce===5||Ce===26||Ce===27)Sm(pe)||z.push(pe.stateNode);else for(pe=pe.child;pe!==null;)R.push(pe),pe=pe.sibling}return z}function nW(){jd&&TN.forEach(function(R){return R()})}function oW(){var R=typeof IS_REACT_ACT_ENVIRONMENT<"u"?IS_REACT_ACT_ENVIRONMENT:void 0;return R||zn.actQueue===null||console.error("The current testing environment is not configured to support act(...)"),R}function u_(R){if((Ac&m0)!==p0&&Fa!==0)return Fa&-Fa;var z=zn.T;return z!==null?(z._updatedFibers||(z._updatedFibers=new Set),z._updatedFibers.add(R),R=e9,R!==0?R:k0()):hF()}function EI(){kh===0&&(kh=(Fa&536870912)===0||$a?U():536870912);var R=Dm.current;return R!==null&&(R.flags|=32),kh}function Wd(R,z,q){if(YM&&console.error("useInsertionEffect must not schedule updates."),Zc&&(VW=!0),R===Qh&&(es===d9||es===VM)||R.cancelPendingCommit!==null)VC(R,0),zC(R,Fa,kh,!1);if(X(R,q),(Ac&m0)!==0&&R===Qh){if(jf)switch(z.tag){case 0:case 11:case 15:R=Ha&&P(Ha)||"Unknown",Moe.has(R)||(Moe.add(R),z=P(z)||"Unknown",console.error("Cannot update a component (`%s`) while rendering a different component (`%s`). To locate the bad setState() call inside `%s`, follow the stack trace as described in https://react.dev/link/setstate-in-render",z,R,R));break;case 1:Eoe||(console.error("Cannot update during an existing state transition (such as within `render`). Render methods should be a pure function of props and state."),Eoe=!0)}}else W2&&ne(R,z,q),GC(z),R===Qh&&((Ac&m0)===p0&&(E7|=q),vu===b7&&zC(R,Fa,kh,!1)),or(R)}function FC(R,z,q){if((Ac&(m0|MA))!==p0)throw Error("Should not already be working.");var pe=!q&&(z&124)===0&&(z&R.expiredLanes)===0||V(R,z),Ce=pe?R8(R,z):D8(R,z,!0),Te=pe;do{if(Ce===wA){v7&&!pe&&zC(R,z,0,!1);break}else{if(q=R.current.alternate,Te&&!HD(q)){Ce=D8(R,z,!1),Te=!1;continue}if(Ce===pb){if(Te=z,R.errorRecoveryDisabledLanes&Te)var ut=0;else ut=R.pendingLanes&-536870913,ut=ut!==0?ut:ut&536870912?536870912:0;if(ut!==0){z=ut;e:{Ce=R;var wt=ut;ut=Z2;var In=Sg&&Ce.current.memoizedState.isDehydrated;if(In&&(VC(Ce,wt).flags|=256),wt=D8(Ce,wt,!1),wt!==pb){if(S7&&!In){Ce.errorRecoveryDisabledLanes|=Te,E7|=Te,Ce=b7;break e}Ce=mh,mh=ut,Ce!==null&&(mh===null?mh=Ce:mh.push.apply(mh,Ce))}Ce=wt}if(Te=!1,Ce!==pb)continue}}if(Ce===C7){VC(R,0),zC(R,z,0,!0);break}e:{switch(pe=R,Ce){case wA:case C7:throw Error("Root did not complete. This is a bug in React.");case b7:if((z&4194048)!==z)break;case VF:zC(pe,z,kh,!mb);break e;case pb:mh=null;break;case HW:case boe:break;default:throw Error("Unknown root exit status.")}if(zn.actQueue!==null)_M(pe,q,z,mh,km,FW,kh,E7,BA);else{if((z&62914560)===z&&(Te=voe+GF-Wf(),10<Te)){if(zC(pe,z,kh,!mb),H(pe,0,!0)!==0)break e;pe.timeoutHandle=goe(bg.bind(null,pe,q,mh,km,FW,z,kh,E7,BA,mb,Ce,u9,-0,0),Te);break e}bg(pe,q,mh,km,FW,z,kh,E7,BA,mb,Ce,gb,-0,0)}}}break}while(1);or(R)}function bg(R,z,q,pe,Ce,Te,ut,wt,In,to,Xo,Zo,vr,ts){if(R.timeoutHandle=QI,Zo=z.subtreeFlags,Zo&8192||(Zo&16785408)===16785408){if(iN(),LC(z),Zo=_W(),Zo!==null){R.cancelPendingCommit=Zo(_M.bind(null,R,z,Te,q,pe,Ce,ut,wt,In,Xo,zW,vr,ts)),zC(R,Te,ut,!to);return}}_M(R,z,Te,q,pe,Ce,ut,wt,In)}function HD(R){for(var z=R;;){var q=z.tag;if((q===0||q===11||q===15)&&z.flags&16384&&(q=z.updateQueue,q!==null&&(q=q.stores,q!==null)))for(var pe=0;pe<q.length;pe++){var Ce=q[pe],Te=Ce.getSnapshot;Ce=Ce.value;try{if(!Mm(Te(),Ce))return!1}catch(ut){return!1}}if(q=z.child,z.subtreeFlags&16384&&q!==null)q.return=z,z=q;else{if(z===R)break;for(;z.sibling===null;){if(z.return===null||z.return===R)return!0;z=z.return}z.sibling.return=z.return,z=z.sibling}}return!0}function zC(R,z,q,pe){z&=~M7,z&=~E7,R.suspendedLanes|=z,R.pingedLanes&=~z,pe&&(R.warmLanes|=z),pe=R.expirationTimes;for(var Ce=z;0<Ce;){var Te=31-m_(Ce),ut=1<<Te;pe[Te]=-1,Ce&=~ut}q!==0&&J(R,q,z)}function MI(){return(Ac&(m0|MA))===p0?(Gr(0,!1),!1):!0}function OC(){if(Ha!==null){if(es===qf)var R=Ha.return;else R=Ha,Rn(),A8(R),zr=null,Pr=0,R=Ha;for(;R!==null;)lM(R.alternate,R),R=R.return;Ha=null}}function VC(R,z){var q=R.timeoutHandle;q!==QI&&(R.timeoutHandle=QI,mW(q)),q=R.cancelPendingCommit,q!==null&&(R.cancelPendingCommit=null,q()),OC(),Qh=R,Ha=q=Fx(R.current,null),Fa=z,es=qf,vy=null,mb=!1,v7=V(R,z),S7=!1,vu=wA,BA=kh=M7=E7=P7=0,mh=Z2=null,FW=!1,(z&8)!==0&&(z|=z&32);var pe=R.entangledLanes;if(pe!==0)for(R=R.entanglements,pe&=z;0<pe;){var Ce=31-m_(pe),Te=1<<Ce;z|=R[Ce],pe&=~Te}return _b=z,Bh(),z=Vp(),1000<z-xl&&(zn.recentlyCreatedOwnerStacks=0,xl=z),K2.discardPendingWarnings(),q}function nF(R,z){Ji=null,zn.H=g7,zn.getCurrentStack=null,jf=!1,SA=null,z===u7||z===NM?(z=Qs(),es=Dg):z===xN?(z=Qs(),es=Z4):es=z===Iy?Ioe:z!==null&&typeof z==="object"&&typeof z.then==="function"?I7:OM,vy=z;var q=Ha;if(q===null)vu=C7,mI(R,rt(z,R.current));else switch(q.mode&2&&il(q),me(),es){case OM:Cr!==null&&typeof Cr.markComponentErrored==="function"&&Cr.markComponentErrored(q,z,Fa);break;case d9:case VM:case Dg:case I7:case YF:Cr!==null&&typeof Cr.markComponentSuspended==="function"&&Cr.markComponentSuspended(q,z,Fa)}}function FD(){var R=Dm.current;return R===null?!0:(Fa&4194048)===Fa?by===null?!0:!1:(Fa&62914560)===Fa||(Fa&536870912)!==0?R===by:!1}function pM(){var R=zn.H;return zn.H=g7,R===null?g7:R}function zD(){var R=zn.A;return zn.A=lNe,R}function T8(){vu=b7,mb||(Fa&4194048)!==Fa&&Dm.current!==null||(v7=!0),(P7&134217727)===0&&(E7&134217727)===0||Qh===null||zC(Qh,Fa,kh,!1)}function D8(R,z,q){var pe=Ac;Ac|=m0;var Ce=pM(),Te=zD();if(Qh!==R||Fa!==z){if(W2){var ut=R.memoizedUpdaters;0<ut.size&&(Q8(R,Fa),ut.clear()),re(R,z)}km=null,VC(R,z)}Ae(z),z=!1,ut=vu;e:do try{if(es!==qf&&Ha!==null){var wt=Ha,In=vy;switch(es){case Ioe:OC(),ut=VF;break e;case Dg:case d9:case VM:case I7:Dm.current===null&&(z=!0);var to=es;if(es=qf,vy=null,N4(R,wt,In,to),q&&v7){ut=wA;break e}break;default:to=es,es=qf,vy=null,N4(R,wt,In,to)}}N8(),ut=vu;break}catch(Xo){nF(R,Xo)}while(1);return z&&R.shellSuspendCounter++,Rn(),Ac=pe,zn.H=Ce,zn.A=Te,xe(),Ha===null&&(Qh=null,Fa=0,Bh()),ut}function N8(){for(;Ha!==null;)OD(Ha)}function R8(R,z){var q=Ac;Ac|=m0;var pe=pM(),Ce=zD();if(Qh!==R||Fa!==z){if(W2){var Te=R.memoizedUpdaters;0<Te.size&&(Q8(R,Fa),Te.clear()),re(R,z)}km=null,w7=Wf()+DN,VC(R,z)}else v7=V(R,z);Ae(z);e:do try{if(es!==qf&&Ha!==null)t:switch(z=Ha,Te=vy,es){case OM:es=qf,vy=null,N4(R,z,Te,OM);break;case d9:case VM:if(ri(Te)){es=qf,vy=null,VD(z);break}z=function(){es!==d9&&es!==VM||Qh!==R||(es=YF),or(R)},Te.then(z,z);break e;case Dg:es=YF;break e;case Z4:es=J2;break e;case YF:ri(Te)?(es=qf,vy=null,VD(z)):(es=qf,vy=null,N4(R,z,Te,YF));break;case J2:var ut=null;switch(Ha.tag){case 26:ut=Ha.memoizedState;case 5:case 27:var wt=Ha,{type:In,pendingProps:to}=wt;if(ut?EM(ut):z8(In,to)){es=qf,vy=null;var Xo=wt.sibling;if(Xo!==null)Ha=Xo;else{var Zo=wt.return;Zo!==null?(Ha=Zo,mM(Zo)):Ha=null}break t}break;default:console.error("Unexpected type of fiber triggered a suspensey commit. This is a bug in React.")}es=qf,vy=null,N4(R,z,Te,J2);break;case I7:es=qf,vy=null,N4(R,z,Te,I7);break;case Ioe:OC(),vu=VF;break e;default:throw Error("Unexpected SuspendedReason. This is a bug in React.")}zn.actQueue!==null?N8():rW();break}catch(vr){nF(R,vr)}while(1);if(Rn(),zn.H=pe,zn.A=Ce,Ac=q,Ha!==null)return Cr!==null&&typeof Cr.markRenderYielded==="function"&&Cr.markRenderYielded(),wA;return xe(),Qh=null,Fa=0,Bh(),vu}function rW(){for(;Ha!==null&&!$8();)OD(Ha)}function OD(R){var z=R.alternate;(R.mode&2)!==Cl?(hs(R),z=_n(R,Hx,z,R,_b),il(R)):z=_n(R,Hx,z,R,_b),R.memoizedProps=R.pendingProps,z===null?mM(R):Ha=z}function VD(R){var z=_n(R,YD,R);R.memoizedProps=R.pendingProps,z===null?mM(R):Ha=z}function YD(R){var z=R.alternate,q=(R.mode&2)!==Cl;switch(q&&hs(R),R.tag){case 15:case 0:z=_I(z,R,R.pendingProps,R.type,void 0,Fa);break;case 11:z=_I(z,R,R.pendingProps,R.type.render,R.ref,Fa);break;case 5:A8(R);default:lM(z,R),R=Ha=F0(R,_b),z=Hx(z,R,_b)}return q&&il(R),z}function N4(R,z,q,pe){Rn(),A8(z),zr=null,Pr=0;var Ce=z.return;try{if(ry(R,Ce,z,q,Fa)){vu=C7,mI(R,rt(q,R.current)),Ha=null;return}}catch(Te){if(Ce!==null)throw Ha=Ce,Te;vu=C7,mI(R,rt(q,R.current)),Ha=null;return}if(z.flags&32768){if($a||pe===OM)R=!0;else if(v7||(Fa&536870912)!==0)R=!1;else if(mb=R=!0,pe===d9||pe===VM||pe===Dg||pe===I7)pe=Dm.current,pe!==null&&pe.tag===13&&(pe.flags|=16384);GD(z,R)}else mM(z)}function mM(R){var z=R;do{if((z.flags&32768)!==0){GD(z,mb);return}var q=z.alternate;if(R=z.return,hs(z),q=_n(z,NC,q,z,_b),(z.mode&2)!==Cl&&kl(z),q!==null){Ha=q;return}if(z=z.sibling,z!==null){Ha=z;return}Ha=z=R}while(z!==null);vu===wA&&(vu=boe)}function GD(R,z){do{var q=cM(R.alternate,R);if(q!==null){q.flags&=32767,Ha=q;return}if((R.mode&2)!==Cl){kl(R),q=R.actualDuration;for(var pe=R.child;pe!==null;)q+=pe.actualDuration,pe=pe.sibling;R.actualDuration=q}if(q=R.return,q!==null&&(q.flags|=32768,q.subtreeFlags=0,q.deletions=null),!z&&(R=R.sibling,R!==null)){Ha=R;return}Ha=R=q}while(R!==null);vu=VF,Ha=null}function _M(R,z,q,pe,Ce,Te,ut,wt,In){R.cancelPendingCommit=null;do YC();while(y_!==_0);if(K2.flushLegacyContextWarning(),K2.flushPendingUnsafeLifecycleWarnings(),(Ac&(m0|MA))!==p0)throw Error("Should not already be working.");if(Cr!==null&&typeof Cr.markCommitStarted==="function"&&Cr.markCommitStarted(q),z===null)ue();else{if(q===0&&console.error("finishedLanes should not be empty during a commit. This is a bug in React."),z===R.current)throw Error("Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue.");if(Te=z.lanes|z.childLanes,Te|=RM,K(R,q,Te,ut,wt,In),R===Qh&&(Ha=Qh=null,Fa=0),m9=z,Kx=R,_9=q,g9=Te,UF=Ce,F_e=pe,(z.subtreeFlags&10256)!==0||(z.flags&10256)!==0?(R.callbackNode=null,R.callbackPriority=0,wI(q8,function(){return UD(!0),null})):(R.callbackNode=null,R.callbackPriority=0),DM=JI(),pe=(z.flags&13878)!==0,(z.subtreeFlags&13878)!==0||pe){pe=zn.T,zn.T=null,Ce=py(),yu(2),ut=Ac,Ac|=MA;try{eW(R,z,q)}finally{Ac=ut,yu(Ce),zn.T=pe}}y_=TA,oF(),gM(),rF()}}function oF(){if(y_===TA){y_=_0;var R=Kx,z=m9,q=_9,pe=(z.flags&13878)!==0;if((z.subtreeFlags&13878)!==0||pe){pe=zn.T,zn.T=null;var Ce=py();yu(2);var Te=Ac;Ac|=MA;try{h9=q,Qm=R,kC(z,R),Qm=h9=null,bM(R.containerInfo)}finally{Ac=Te,yu(Ce),zn.T=pe}}R.current=z,y_=p9}}function gM(){if(y_===p9){y_=_0;var R=Kx,z=m9,q=_9,pe=(z.flags&8772)!==0;if((z.subtreeFlags&8772)!==0||pe){pe=zn.T,zn.T=null;var Ce=py();yu(2);var Te=Ac;Ac|=MA;try{Cr!==null&&typeof Cr.markLayoutEffectsStarted==="function"&&Cr.markLayoutEffectsStarted(q),h9=q,Qm=R,ED(R,z.alternate,z),Qm=h9=null,Cr!==null&&typeof Cr.markLayoutEffectsStopped==="function"&&Cr.markLayoutEffectsStopped()}finally{Ac=Te,yu(Ce),zn.T=pe}}y_=Soe}}function rF(){if(y_===hNe||y_===Soe){y_=_0,PF();var R=Kx,z=m9,q=_9,pe=F_e,Ce=(z.subtreeFlags&10256)!==0||(z.flags&10256)!==0;Ce?y_=Poe:(y_=_0,m9=Kx=null,R4(R,R.pendingLanes),B7=0,RN=null);var Te=R.pendingLanes;if(Te===0&&(f_=null),Ce||$D(R),Ce=Z(q),z=z.stateNode,Em&&typeof Em.onCommitFiberRoot==="function")try{var ut=(z.current.flags&128)===128;switch(Ce){case 2:var wt=fy;break;case 8:wt=pN;break;case 32:wt=q8;break;case 268435456:wt=qc;break;default:wt=q8}Em.onCommitFiberRoot(eb,z,wt,ut)}catch(Zo){U2||(U2=!0,console.error("React instrumentation encountered an error: %s",Zo))}if(W2&&R.memoizedUpdaters.clear(),nW(),pe!==null){ut=zn.T,wt=py(),yu(2),zn.T=null;try{var In=R.onRecoverableError;for(z=0;z<pe.length;z++){var to=pe[z],Xo=iW(to.stack);_n(to.source,In,to.value,Xo)}}finally{zn.T=ut,yu(wt)}}(_9&3)!==0&&YC(),or(R),Te=R.pendingLanes,(q&4194090)!==0&&(Te&42)!==0?(AN=!0,R===OW?NN++:(NN=0,OW=R)):NN=0,Gr(0,!1),ue()}}function iW(R){return R={componentStack:R},Object.defineProperty(R,"digest",{get:function(){console.error('You are accessing "digest" from the errorInfo object passed to onRecoverableError. This property is no longer provided as part of errorInfo but can be accessed as a property of the Error instance itself.')}}),R}function R4(R,z){(R.pooledCacheLanes&=z)===0&&(z=R.pooledCache,z!=null&&(R.pooledCache=null,ya(z)))}function YC(R){return oF(),gM(),rF(),UD(R)}function UD(){if(y_!==Poe)return!1;var R=Kx,z=g9;g9=0;var q=Z(_9),pe=32>q?32:q;q=zn.T;var Ce=py();try{yu(pe),zn.T=null,pe=UF,UF=null;var Te=Kx,ut=_9;if(y_=_0,m9=Kx=null,_9=0,(Ac&(m0|MA))!==p0)throw Error("Cannot flush passive effects while already rendering.");Zc=!0,VW=!1,Cr!==null&&typeof Cr.markPassiveEffectsStarted==="function"&&Cr.markPassiveEffectsStarted(ut);var wt=Ac;if(Ac|=MA,tW(Te.current),up(Te,Te.current,ut,pe),Cr!==null&&typeof Cr.markPassiveEffectsStopped==="function"&&Cr.markPassiveEffectsStopped(),$D(Te),Ac=wt,Gr(0,!1),VW?Te===RN?B7++:(B7=0,RN=Te):B7=0,VW=Zc=!1,Em&&typeof Em.onPostCommitFiberRoot==="function")try{Em.onPostCommitFiberRoot(eb,Te)}catch(to){U2||(U2=!0,console.error("React instrumentation encountered an error: %s",to))}var In=Te.current.stateNode;return In.effectDuration=0,In.passiveEffectDuration=0,!0}finally{yu(Ce),zn.T=q,R4(R,z)}}function sW(R,z,q){z=rt(q,z),z=h_(R.stateNode,z,2),R=a_(R,z,2),R!==null&&(X(R,2),or(R))}function yl(R,z,q){if(YM=!1,R.tag===3)sW(R,R,q);else{for(;z!==null;){if(z.tag===3){sW(z,R,q);return}if(z.tag===1){var pe=z.stateNode;if(typeof z.type.getDerivedStateFromError==="function"||typeof pe.componentDidCatch==="function"&&(f_===null||!f_.has(pe))){R=rt(q,R),q=L2(2),pe=a_(z,q,2),pe!==null&&(Lf(q,pe,z,R),X(pe,2),or(pe));return}}z=z.return}console.error(`Internal React error: Attempted to capture a commit phase error inside a detached tree. This indicates a bug in React. Potential causes include deleting the same fiber more than once, committing an already-finished tree, or an inconsistent return pointer.

Error message:

%s`,q)}}function WD(R,z,q){var pe=R.pingCache;if(pe===null){pe=R.pingCache=new Coe;var Ce=new Set;pe.set(z,Ce)}else Ce=pe.get(z),Ce===void 0&&(Ce=new Set,pe.set(z,Ce));Ce.has(q)||(S7=!0,Ce.add(q),pe=AM.bind(null,R,z,q),W2&&Q8(R,q),z.then(pe,pe))}function AM(R,z,q){var pe=R.pingCache;pe!==null&&pe.delete(z),R.pingedLanes|=R.suspendedLanes&q,R.warmLanes&=~q,oW()&&zn.actQueue===null&&console.error(`A suspended resource finished loading inside a test, but the event was not wrapped in act(...).

When testing, code that resolves suspended data should be wrapped into act(...):

act(() => {
  /* finish loading suspended data */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act`),Qh===R&&(Fa&q)===q&&(vu===b7||vu===HW&&(Fa&62914560)===Fa&&Wf()-voe<GF?(Ac&m0)===p0&&VC(R,0):M7|=q,BA===Fa&&(BA=0)),or(R)}function XD(R,z){z===0&&(z=j()),R=r0(R,z),R!==null&&(X(R,z),or(R))}function Of(R){var z=R.memoizedState,q=0;z!==null&&(q=z.retryLane),XD(R,q)}function aW(R,z){var q=0;switch(R.tag){case 13:var{stateNode:pe,memoizedState:Ce}=R;Ce!==null&&(q=Ce.retryLane);break;case 19:pe=R.stateNode;break;case 22:pe=R.stateNode._retryCache;break;default:throw Error("Pinged unknown suspense boundary type. This is probably a bug in React.")}pe!==null&&pe.delete(z),XD(R,q)}function jD(R,z,q){if((z.subtreeFlags&67117056)!==0)for(z=z.child;z!==null;){var pe=R,Ce=z,Te=Ce.type===vg;Te=q||Te,Ce.tag!==22?Ce.flags&67108864?Te&&_n(Ce,KD,pe,Ce,(Ce.mode&64)===Cl):jD(pe,Ce,Te):Ce.memoizedState===null&&(Te&&Ce.flags&8192?_n(Ce,KD,pe,Ce):Ce.subtreeFlags&67108864&&_n(Ce,jD,pe,Ce,Te)),z=z.sibling}}function KD(R,z){var q=2<arguments.length&&arguments[2]!==void 0?arguments[2]:!0;ie(!0);try{TD(z),q&&QD(z),DD(R,z.alternate,z,!1),q&&ND(R,z,0,null,!1,0)}finally{ie(!1)}}function $D(R){var z=!0;R.current.mode&24||(z=!1),jD(R,R.current,z)}function iF(R){if((Ac&m0)===p0){var z=R.tag;if(z===3||z===1||z===0||z===11||z===14||z===15){if(z=P(R)||"ReactComponent",WF!==null){if(WF.has(z))return;WF.add(z)}else WF=new Set([z]);_n(R,function(){console.error("Can't perform a React state update on a component that hasn't mounted yet. This indicates that you have a side-effect in your render function that asynchronously later calls tries to update the component. Move this work to useEffect instead.")})}}}function Q8(R,z){W2&&R.memoizedUpdaters.forEach(function(q){ne(R,q,z)})}function wI(R,z){var q=zn.actQueue;return q!==null?(q.push(z),O_e):K8(R,z)}function GC(R){oW()&&zn.actQueue===null&&_n(R,function(){console.error(`An update to %s inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act`,P(R))})}function UC(R){if(Sy===null)return R;var z=Sy(R);return z===void 0?R:z.current}function qD(R){if(Sy===null)return R;var z=Sy(R);return z===void 0?R!==null&&R!==void 0&&typeof R.render==="function"&&(z=UC(R.render),R.render!==z)?(z={$$typeof:DI,render:z},R.displayName!==void 0&&(z.displayName=R.displayName),z):R:z.current}function k8(R,z){if(Sy===null)return!1;var q=R.elementType;z=z.type;var pe=!1,Ce=typeof z==="object"&&z!==null?z.$$typeof:null;switch(R.tag){case 1:typeof z==="function"&&(pe=!0);break;case 0:typeof z==="function"?pe=!0:Ce===Vf&&(pe=!0);break;case 11:Ce===DI?pe=!0:Ce===Vf&&(pe=!0);break;case 14:case 15:Ce===bi?pe=!0:Ce===Vf&&(pe=!0);break;default:return!1}return pe&&(R=Sy(q),R!==void 0&&R===Sy(z))?!0:!1}function sF(R){Sy!==null&&typeof WeakSet==="function"&&(QN===null&&(QN=new WeakSet),QN.add(R))}function fM(R,z,q){var{alternate:pe,child:Ce,sibling:Te,tag:ut,type:wt}=R,In=null;switch(ut){case 0:case 15:case 1:In=wt;break;case 11:In=wt.render}if(Sy===null)throw Error("Expected resolveFamily to be set during hot reload.");var to=!1;if(wt=!1,In!==null&&(In=Sy(In),In!==void 0&&(q.has(In)?wt=!0:z.has(In)&&(ut===1?wt=!0:to=!0))),QN!==null&&(QN.has(R)||pe!==null&&QN.has(pe))&&(wt=!0),wt&&(R._debugNeedsRemount=!0),wt||to)pe=r0(R,2),pe!==null&&Wd(pe,R,2);Ce===null||wt||fM(Ce,z,q),Te!==null&&fM(Te,z,q)}function yM(R,z,q,pe){this.tag=R,this.key=q,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=z,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=pe,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null,this.actualDuration=-0,this.actualStartTime=-1.1,this.treeBaseDuration=this.selfBaseDuration=-0,this._debugTask=this._debugStack=this._debugOwner=this._debugInfo=null,this._debugNeedsRemount=!1,this._debugHookTypes=null,woe||typeof Object.preventExtensions!=="function"||Object.preventExtensions(this)}function L8(R){return R=R.prototype,!(!R||!R.isReactComponent)}function Fx(R,z){var q=R.alternate;switch(q===null?(q=c(R.tag,z,R.key,R.mode),q.elementType=R.elementType,q.type=R.type,q.stateNode=R.stateNode,q._debugOwner=R._debugOwner,q._debugStack=R._debugStack,q._debugTask=R._debugTask,q._debugHookTypes=R._debugHookTypes,q.alternate=R,R.alternate=q):(q.pendingProps=z,q.type=R.type,q.flags=0,q.subtreeFlags=0,q.deletions=null,q.actualDuration=-0,q.actualStartTime=-1.1),q.flags=R.flags&65011712,q.childLanes=R.childLanes,q.lanes=R.lanes,q.child=R.child,q.memoizedProps=R.memoizedProps,q.memoizedState=R.memoizedState,q.updateQueue=R.updateQueue,z=R.dependencies,q.dependencies=z===null?null:{lanes:z.lanes,firstContext:z.firstContext,_debugThenableState:z._debugThenableState},q.sibling=R.sibling,q.index=R.index,q.ref=R.ref,q.refCleanup=R.refCleanup,q.selfBaseDuration=R.selfBaseDuration,q.treeBaseDuration=R.treeBaseDuration,q._debugInfo=R._debugInfo,q._debugNeedsRemount=R._debugNeedsRemount,q.tag){case 0:case 15:q.type=UC(R.type);break;case 1:q.type=UC(R.type);break;case 11:q.type=qD(R.type)}return q}function F0(R,z){R.flags&=65011714;var q=R.alternate;return q===null?(R.childLanes=0,R.lanes=z,R.child=null,R.subtreeFlags=0,R.memoizedProps=null,R.memoizedState=null,R.updateQueue=null,R.dependencies=null,R.stateNode=null,R.selfBaseDuration=0,R.treeBaseDuration=0):(R.childLanes=q.childLanes,R.lanes=q.lanes,R.child=q.child,R.subtreeFlags=0,R.deletions=null,R.memoizedProps=q.memoizedProps,R.memoizedState=q.memoizedState,R.updateQueue=q.updateQueue,R.type=q.type,z=q.dependencies,R.dependencies=z===null?null:{lanes:z.lanes,firstContext:z.firstContext,_debugThenableState:z._debugThenableState},R.selfBaseDuration=q.selfBaseDuration,R.treeBaseDuration=q.treeBaseDuration),R}function JD(R,z,q,pe,Ce,Te){var ut=0,wt=R;if(typeof R==="function")L8(R)&&(ut=1),wt=UC(wt);else if(typeof R==="string")G2&&l0?(ut=ht(),ut=SW(R,q,ut)?26:vF(R)?27:5):G2?(ut=ht(),ut=SW(R,q,ut)?26:5):ut=l0?vF(R)?27:5:5;else e:switch(R){case Op:return z=c(31,q,z,Ce),z.elementType=Op,z.lanes=Te,z;case Ur:return hy(q.children,Ce,Te,z);case vg:ut=8,Ce|=24;break;case eN:return R=q,pe=Ce,typeof R.id!=="string"&&console.error('Profiler must specify an "id" of type `string` as a prop. Received the type `%s` instead.',typeof R.id),z=c(12,R,z,pe|2),z.elementType=eN,z.lanes=Te,z.stateNode={effectDuration:0,passiveEffectDuration:0},z;case tN:return z=c(13,q,z,Ce),z.elementType=tN,z.lanes=Te,z;case uy:return z=c(19,q,z,Ce),z.elementType=uy,z.lanes=Te,z;default:if(typeof R==="object"&&R!==null)switch(R.$$typeof){case hW:case dy:ut=10;break e;case F8:ut=9;break e;case DI:ut=11,wt=qD(wt);break e;case bi:ut=14;break e;case Vf:ut=16,wt=null;break e}if(wt="",R===void 0||typeof R==="object"&&R!==null&&Object.keys(R).length===0)wt+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";R===null?q="null":Kc(R)?q="array":R!==void 0&&R.$$typeof===mp?(q="<"+(v(R.type)||"Unknown")+" />",wt=" Did you accidentally export a JSX literal instead of a component?"):q=typeof R,ut=pe?typeof pe.tag==="number"?P(pe):typeof pe.name==="string"?pe.name:null:null,ut&&(wt+=`

Check the render method of \``+ut+"`."),ut=29,q=Error("Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: "+(q+"."+wt)),wt=null}return z=c(ut,q,z,Ce),z.elementType=R,z.type=wt,z.lanes=Te,z._debugOwner=pe,z}function xM(R,z,q){return z=JD(R.type,R.key,R.props,R._owner,z,q),z._debugOwner=R._owner,z._debugStack=R._debugStack,z._debugTask=R._debugTask,z}function hy(R,z,q,pe){return R=c(7,R,pe,z),R.lanes=q,R}function Q4(R,z,q){return R=c(6,R,null,z),R.lanes=q,R}function Xd(R,z,q){return z=c(4,R.children!==null?R.children:[],R.key,z),z.lanes=q,z.stateNode={containerInfo:R.containerInfo,pendingChildren:null,implementation:R.implementation},z}function H8(R,z,q,pe,Ce,Te,ut,wt){this.tag=1,this.containerInfo=R,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=QI,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Y(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Y(0),this.hiddenUpdates=Y(null),this.identifierPrefix=pe,this.onUncaughtError=Ce,this.onCaughtError=Te,this.onRecoverableError=ut,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=wt,this.incompleteTransitions=new Map,this.passiveEffectDuration=this.effectDuration=-0,this.memoizedUpdaters=new Set,R=this.pendingUpdatersLaneMap=[];for(z=0;31>z;z++)R.push(new Set);this._debugRootType=q?"hydrateRoot()":"createRoot()"}function CM(R,z,q,pe,Ce,Te,ut,wt,In,to,Xo,Zo){return R=new H8(R,z,q,ut,wt,In,to,Zo),z=1,Te===!0&&(z|=24),W2&&(z|=2),Te=c(3,null,null,z),R.current=Te,Te.stateNode=R,z=Ci(),ea(z),R.pooledCache=z,ea(z),Te.memoizedState={element:pe,isDehydrated:q,cache:z},lp(Te),R}function Vi(R){return""+R}function cW(R){if(!R)return Gx;return R=Gx,R}function BI(R,z,q,pe){return IA(z.current,2,R,z,q,pe),2}function IA(R,z,q,pe,Ce,Te){if(Em&&typeof Em.onScheduleFiberRoot==="function")try{Em.onScheduleFiberRoot(eb,pe,q)}catch(ut){U2||(U2=!0,console.error("React instrumentation encountered an error: %s",ut))}Cr!==null&&typeof Cr.markRenderScheduled==="function"&&Cr.markRenderScheduled(z),Ce=cW(Ce),pe.context===null?pe.context=Ce:pe.pendingContext=Ce,jf&&SA!==null&&!Y_e&&(Y_e=!0,console.error(`Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate.

Check the render method of %s.`,P(SA)||"Unknown")),pe=gu(z),pe.payload={element:q},Te=Te===void 0?null:Te,Te!==null&&(typeof Te!=="function"&&console.error("Expected the last optional `callback` argument to be a function. Instead received: %s.",Te),pe.callback=Te),q=a_(R,pe,z),q!==null&&(Wd(q,R,z),Kh(q,R,z))}function ZD(R,z){if(R=R.memoizedState,R!==null&&R.dehydrated!==null){var q=R.retryLane;R.retryLane=q!==0&&q<z?q:z}}function Ig(R,z){ZD(R,z),(R=R.alternate)&&ZD(R,z)}function lW(){return SA}function aF(){for(var R=new Map,z=1,q=0;31>q;q++){var pe=D(z);R.set(z,pe),z*=2}return R}var Ma={},pp=Object.assign,TI=Symbol.for("react.element"),mp=Symbol.for("react.transitional.element"),zx=Symbol.for("react.portal"),Ur=Symbol.for("react.fragment"),vg=Symbol.for("react.strict_mode"),eN=Symbol.for("react.profiler"),hW=Symbol.for("react.provider"),F8=Symbol.for("react.consumer"),dy=Symbol.for("react.context"),DI=Symbol.for("react.forward_ref"),tN=Symbol.for("react.suspense"),uy=Symbol.for("react.suspense_list"),bi=Symbol.for("react.memo"),Vf=Symbol.for("react.lazy"),Op=Symbol.for("react.activity"),k4=Symbol.for("react.memo_cache_sentinel"),fu=Symbol.iterator,dW=Symbol.for("react.client.reference"),Kc=Array.isArray,zn=PUe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,{rendererVersion:Ol,rendererPackageName:_oe,extraDevToolsConfig:uW,getPublicInstance:NI,getRootHostContext:Ox,getChildHostContext:dh,prepareForCommit:cF,resetAfterCommit:bM,createInstance:RI}=e;e.cloneMutableInstance;var{appendInitialChild:nN,finalizeInitialChildren:F2,shouldSetTextContent:Yf,createTextInstance:pW}=e;e.cloneMutableTextInstance;var{scheduleTimeout:goe,cancelTimeout:mW,noTimeout:QI,isPrimaryRenderer:ql}=e;e.warnsIfNotActing;var{supportsMutation:$c,supportsPersistence:c0,supportsHydration:Sg,getInstanceFromNode:oN}=e;e.beforeActiveInstanceBlur;var lF=e.preparePortalMount;e.prepareScopeUpdate,e.getInstanceFromScope;var{setCurrentUpdatePriority:yu,getCurrentUpdatePriority:py,resolveUpdatePriority:hF}=e;e.trackSchedulerEvent,e.resolveEventType,e.resolveEventTimeStamp;var{shouldAttemptEagerTransition:dF,detachDeletedInstance:uF}=e;e.requestPostPaintCallback;var{maySuspendCommit:rN,preloadInstance:z8,startSuspendingCommit:iN,suspendInstance:O8}=e;e.suspendOnActiveViewTransition;var{waitForCommitToBeReady:_W,NotPendingTransition:kI,HostTransitionContext:WC,resetFormInstance:z2,bindToConsole:_p,supportsMicrotasks:XC,scheduleMicrotask:fd,supportsTestSelectors:jd,findFiberRoot:Gf,getBoundingRect:Uf,getTextContent:xu,isHiddenSubtree:Sm,matchAccessibilityRole:vA,setFocusIfFocusable:uh,setupIntersectionObserver:gW,appendChild:V8,appendChildToContainer:jC,commitTextUpdate:AW,commitMount:IM,commitUpdate:fW,insertBefore:Vx,insertInContainerBefore:KC,removeChild:pF,removeChildFromContainer:LI,resetTextContent:mF,hideInstance:_F,hideTextInstance:yW,unhideInstance:O2,unhideTextInstance:gF}=e;e.cancelViewTransitionName,e.cancelRootViewTransitionName,e.restoreRootViewTransitionName,e.cloneRootViewTransitionContainer,e.removeRootViewTransitionClone,e.measureClonedInstance,e.hasInstanceChanged,e.hasInstanceAffectedParent,e.startViewTransition,e.startGestureTransition,e.stopGestureTransition,e.getCurrentGestureOffset,e.subscribeToGestureDirection,e.createViewTransitionInstance;var xW=e.clearContainer;e.createFragmentInstance,e.updateFragmentInstanceFiber,e.commitNewChildToFragmentInstance,e.deleteChildFromFragmentInstance;var{cloneInstance:CW,createContainerChildSet:qi,appendChildToContainerChildSet:HI,finalizeContainerChildren:gp,replaceContainerChildren:$C,cloneHiddenInstance:p_,cloneHiddenTextInstance:sN,isSuspenseInstancePending:my,isSuspenseInstanceFallback:FI,getSuspenseInstanceFallbackErrorDetails:V2,registerSuspenseInstanceRetry:bW,canHydrateFormStateMarker:_y,isFormStateMarkerMatching:IW,getNextHydratableSibling:Pg,getNextHydratableSiblingAfterSingleton:Y8,getFirstHydratableChild:G8,getFirstHydratableChildWithinContainer:Y2,getFirstHydratableChildWithinSuspenseInstance:vM,getFirstHydratableChildWithinSingleton:U8,canHydrateInstance:AF,canHydrateTextInstance:qC,canHydrateSuspenseInstance:zI,hydrateInstance:aN,hydrateTextInstance:SM,hydrateSuspenseInstance:PM,getNextHydratableInstanceAfterSuspenseInstance:cN,commitHydratedContainer:W8,commitHydratedSuspenseInstance:fF,clearSuspenseBoundary:lN,clearSuspenseBoundaryFromContainer:OI,shouldDeleteUnhydratedTailInstances:VI,diffHydratedPropsForDevWarnings:Pm,diffHydratedTextForDevWarnings:hN,describeHydratableInstanceForDevWarnings:YI,validateHydratableInstance:Kd,validateHydratableTextInstance:vW,supportsResources:G2,isHostHoistableType:SW,getHoistableRoot:Yx,getResource:GI,acquireResource:dN,releaseResource:JC,hydrateHoistable:X8,mountHoistable:yF,unmountHoistable:xF,createHoistableInstance:PW,prepareToCommitHoistables:EW,mayResourceSuspendCommit:uN,preloadResource:EM,suspendResource:CF,supportsSingletons:l0,resolveSingletonInstance:bF,acquireSingletonInstance:Aoe,releaseSingletonInstance:IF,isHostSingletonType:vF,isSingletonScope:UI}=e,ZC=[],j8=[],gy=-1,Gx={};Object.freeze(Gx);var m_=Math.clz32?Math.clz32:N,{log:SF,LN2:MM}=Math,WI=256,Ay=4194304,K8=Nu.unstable_scheduleCallback,XI=Nu.unstable_cancelCallback,$8=Nu.unstable_shouldYield,PF=Nu.unstable_requestPaint,Wf=Nu.unstable_now,fy=Nu.unstable_ImmediatePriority,pN=Nu.unstable_UserBlockingPriority,q8=Nu.unstable_NormalPriority,qc=Nu.unstable_IdlePriority,EF=Nu.log,MW=Nu.unstable_setDisableYieldValue,eb=null,Em=null,Cr=null,U2=!1,W2=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u",J8=0,yd,Ux,Eg,Z8,X2,e7,MF;Re.__reactDisabledLog=!0;var t7,mN,wM=!1,BM=new(typeof WeakMap==="function"?WeakMap:Map),n7=new WeakMap,tb=[],L4=0,jI=null,_N=0,h0=[],Mg=0,Xs=null,j2=1,yy="",wg=M(null),KI=M(null),Xf=M(null),nb=M(null),wF=/["'&<>\n\t]|^\s|\s$/,SA=null,jf=!1,Sc=null,Cu=null,$a=!1,xy=!1,bu=null,ob=null,La=!1,TM=Error("Hydration Mismatch Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React."),xl=0;if(typeof performance==="object"&&typeof performance.now==="function")var BF=performance,Vp=function(){return BF.now()};else{var foe=Date;Vp=function(){return foe.now()}}var Mm=typeof Object.is==="function"?Object.is:Vn,Cl=0,o7=M(null),__=M(null),gN=M(null),$I={},qI=null,Wx=null,H4=!1,yoe=typeof AbortController<"u"?AbortController:function(){var R=[],z=this.signal={aborted:!1,addEventListener:function(q,pe){R.push(pe)}};this.abort=function(){z.aborted=!0,R.forEach(function(q){return q()})}},TF=Nu.unstable_scheduleCallback,xoe=Nu.unstable_NormalPriority,Dh={$$typeof:dy,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0,_currentRenderer:null,_currentRenderer2:null},JI=Nu.unstable_now,DM=-0,g_=-1.1,rb=-0,r7=!1,AN=!1,F4=null,Kf=null,i7=!1,DF=!1,fN=!1,yN=!1,ZI=0,NF={},s7=null,Xx=0,e9=0,a7=null,RF=zn.S;zn.S=function(R,z){typeof z==="object"&&z!==null&&typeof z.then==="function"&&ym(R,z),RF!==null&&RF(R,z)};var z4=M(null),wW=Object.prototype.hasOwnProperty,K2={recordUnsafeLifecycleWarnings:function(){},flushPendingUnsafeLifecycleWarnings:function(){},recordLegacyContextWarning:function(){},flushLegacyContextWarning:function(){},discardPendingWarnings:function(){}},c7=[],l7=[],ib=[],O4=[],t9=[],n9=[],V4=new Set;K2.recordUnsafeLifecycleWarnings=function(R,z){V4.has(R.type)||(typeof z.componentWillMount==="function"&&z.componentWillMount.__suppressDeprecationWarning!==!0&&c7.push(R),R.mode&8&&typeof z.UNSAFE_componentWillMount==="function"&&l7.push(R),typeof z.componentWillReceiveProps==="function"&&z.componentWillReceiveProps.__suppressDeprecationWarning!==!0&&ib.push(R),R.mode&8&&typeof z.UNSAFE_componentWillReceiveProps==="function"&&O4.push(R),typeof z.componentWillUpdate==="function"&&z.componentWillUpdate.__suppressDeprecationWarning!==!0&&t9.push(R),R.mode&8&&typeof z.UNSAFE_componentWillUpdate==="function"&&n9.push(R))},K2.flushPendingUnsafeLifecycleWarnings=function(){var R=new Set;0<c7.length&&(c7.forEach(function(wt){R.add(P(wt)||"Component"),V4.add(wt.type)}),c7=[]);var z=new Set;0<l7.length&&(l7.forEach(function(wt){z.add(P(wt)||"Component"),V4.add(wt.type)}),l7=[]);var q=new Set;0<ib.length&&(ib.forEach(function(wt){q.add(P(wt)||"Component"),V4.add(wt.type)}),ib=[]);var pe=new Set;0<O4.length&&(O4.forEach(function(wt){pe.add(P(wt)||"Component"),V4.add(wt.type)}),O4=[]);var Ce=new Set;0<t9.length&&(t9.forEach(function(wt){Ce.add(P(wt)||"Component"),V4.add(wt.type)}),t9=[]);var Te=new Set;if(0<n9.length&&(n9.forEach(function(wt){Te.add(P(wt)||"Component"),V4.add(wt.type)}),n9=[]),0<z.size){var ut=A(z);console.error(`Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. See https://react.dev/link/unsafe-component-lifecycles for details.

* Move code with side effects to componentDidMount, and set initial state in the constructor.

Please update the following components: %s`,ut)}0<pe.size&&(ut=A(pe),console.error(`Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. See https://react.dev/link/unsafe-component-lifecycles for details.

* Move data fetching code or side effects to componentDidUpdate.
* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://react.dev/link/derived-state

Please update the following components: %s`,ut)),0<Te.size&&(ut=A(Te),console.error(`Using UNSAFE_componentWillUpdate in strict mode is not recommended and may indicate bugs in your code. See https://react.dev/link/unsafe-component-lifecycles for details.

* Move data fetching code or side effects to componentDidUpdate.

Please update the following components: %s`,ut)),0<R.size&&(ut=A(R),console.warn(`componentWillMount has been renamed, and is not recommended for use. See https://react.dev/link/unsafe-component-lifecycles for details.

* Move code with side effects to componentDidMount, and set initial state in the constructor.
* Rename componentWillMount to UNSAFE_componentWillMount to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.

Please update the following components: %s`,ut)),0<q.size&&(ut=A(q),console.warn(`componentWillReceiveProps has been renamed, and is not recommended for use. See https://react.dev/link/unsafe-component-lifecycles for details.

* Move data fetching code or side effects to componentDidUpdate.
* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://react.dev/link/derived-state
* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.

Please update the following components: %s`,ut)),0<Ce.size&&(ut=A(Ce),console.warn(`componentWillUpdate has been renamed, and is not recommended for use. See https://react.dev/link/unsafe-component-lifecycles for details.

* Move data fetching code or side effects to componentDidUpdate.
* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.

Please update the following components: %s`,ut))};var h7=new Map,d7=new Set;K2.recordLegacyContextWarning=function(R,z){var q=null;for(var pe=R;pe!==null;)pe.mode&8&&(q=pe),pe=pe.return;q===null?console.error("Expected to find a StrictMode component in a strict mode tree. This error is likely caused by a bug in React. Please file an issue."):!d7.has(R.type)&&(pe=h7.get(q),R.type.contextTypes!=null||R.type.childContextTypes!=null||z!==null&&typeof z.getChildContext==="function")&&(pe===void 0&&(pe=[],h7.set(q,pe)),pe.push(R))},K2.flushLegacyContextWarning=function(){h7.forEach(function(R){if(R.length!==0){var z=R[0],q=new Set;R.forEach(function(Ce){q.add(P(Ce)||"Component"),d7.add(Ce.type)});var pe=A(q);_n(z,function(){console.error(`Legacy context API has been detected within a strict-mode tree.

The old API will be supported in all 16.x releases, but applications using it should migrate to the new version.

Please update the following components: %s

Learn more about this warning here: https://react.dev/link/legacy-context`,pe)})}})},K2.discardPendingWarnings=function(){c7=[],l7=[],ib=[],O4=[],t9=[],n9=[],h7=new Map};var u7=Error("Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`."),xN=Error("Suspense Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React."),NM=Error("Suspense Exception: This is not a real error! It's an implementation detail of `useActionState` to interrupt the current render. You must either rethrow it immediately, or move the `useActionState` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary."),CN={then:function(){console.error('Internal React error: A listener was unexpectedly attached to a "noop" thenable. This is a bug in React. Please file an issue.')}},p7=null,wm=!1,PA=0,$h=1,Bm=2,Ap=4,Nh=8,A_=[],Y4=0,RM=0,QM=0,QF=1,kM=2,kF=3,G4=!1,LF=!1,HF=null,bN=!1,m7=M(null),_7=M(0),o9,BW=new Set,IN=new Set,LM=new Set,TW=new Set,U4=0,Ji=null,ll=null,d0=null,Tm=!1,sb=!1,W4=!1,X4=0,r9=0,jx=null,DW=0,NW=25,$n=null,$f=null,EA=-1,HM=!1,g7={readContext:Wo,use:ey,useCallback:Sa,useContext:Sa,useEffect:Sa,useImperativeHandle:Sa,useLayoutEffect:Sa,useInsertionEffect:Sa,useMemo:Sa,useReducer:Sa,useRef:Sa,useState:Sa,useDebugValue:Sa,useDeferredValue:Sa,useTransition:Sa,useSyncExternalStore:Sa,useId:Sa,useHostTransitionStatus:Sa,useFormState:Sa,useActionState:Sa,useOptimistic:Sa,useMemoCache:Sa,useCacheRefresh:Sa},ab=null,i9=null,vN=null,A7=null,u0=null,fp=null,Iu=null;ab={readContext:function(R){return Wo(R)},use:ey,useCallback:function(R,z){return $n="useCallback",Us(),_d(z),vo(R,z)},useContext:function(R){return $n="useContext",Us(),Wo(R)},useEffect:function(R,z){return $n="useEffect",Us(),_d(z),vc(R,z)},useImperativeHandle:function(R,z,q){return $n="useImperativeHandle",Us(),_d(q),vn(R,z,q)},useInsertionEffect:function(R,z){$n="useInsertionEffect",Us(),_d(z),Ws(4,Bm,R,z)},useLayoutEffect:function(R,z){return $n="useLayoutEffect",Us(),_d(z),zp(R,z)},useMemo:function(R,z){$n="useMemo",Us(),_d(z);var q=zn.H;zn.H=u0;try{return oa(R,z)}finally{zn.H=q}},useReducer:function(R,z,q){$n="useReducer",Us();var pe=zn.H;zn.H=u0;try{return Cm(R,z,q)}finally{zn.H=pe}},useRef:function(R){return $n="useRef",Us(),Pa(R)},useState:function(R){$n="useState",Us();var z=zn.H;zn.H=u0;try{return ty(R)}finally{zn.H=z}},useDebugValue:function(){$n="useDebugValue",Us()},useDeferredValue:function(R,z){return $n="useDeferredValue",Us(),Ea(R,z)},useTransition:function(){return $n="useTransition",Us(),E4()},useSyncExternalStore:function(R,z,q){return $n="useSyncExternalStore",Us(),KE(R,z,q)},useId:function(){return $n="useId",Us(),Rf()},useFormState:function(R,z){return $n="useFormState",Us(),sl(),Mn(R,z)},useActionState:function(R,z){return $n="useActionState",Us(),Mn(R,z)},useOptimistic:function(R){return $n="useOptimistic",Us(),ny(R)},useHostTransitionStatus:fA,useMemoCache:xm,useCacheRefresh:function(){return $n="useCacheRefresh",Us(),x8()}},i9={readContext:function(R){return Wo(R)},use:ey,useCallback:function(R,z){return $n="useCallback",Bo(),vo(R,z)},useContext:function(R){return $n="useContext",Bo(),Wo(R)},useEffect:function(R,z){return $n="useEffect",Bo(),vc(R,z)},useImperativeHandle:function(R,z,q){return $n="useImperativeHandle",Bo(),vn(R,z,q)},useInsertionEffect:function(R,z){$n="useInsertionEffect",Bo(),Ws(4,Bm,R,z)},useLayoutEffect:function(R,z){return $n="useLayoutEffect",Bo(),zp(R,z)},useMemo:function(R,z){$n="useMemo",Bo();var q=zn.H;zn.H=u0;try{return oa(R,z)}finally{zn.H=q}},useReducer:function(R,z,q){$n="useReducer",Bo();var pe=zn.H;zn.H=u0;try{return Cm(R,z,q)}finally{zn.H=pe}},useRef:function(R){return $n="useRef",Bo(),Pa(R)},useState:function(R){$n="useState",Bo();var z=zn.H;zn.H=u0;try{return ty(R)}finally{zn.H=z}},useDebugValue:function(){$n="useDebugValue",Bo()},useDeferredValue:function(R,z){return $n="useDeferredValue",Bo(),Ea(R,z)},useTransition:function(){return $n="useTransition",Bo(),E4()},useSyncExternalStore:function(R,z,q){return $n="useSyncExternalStore",Bo(),KE(R,z,q)},useId:function(){return $n="useId",Bo(),Rf()},useActionState:function(R,z){return $n="useActionState",Bo(),Mn(R,z)},useFormState:function(R,z){return $n="useFormState",Bo(),sl(),Mn(R,z)},useOptimistic:function(R){return $n="useOptimistic",Bo(),ny(R)},useHostTransitionStatus:fA,useMemoCache:xm,useCacheRefresh:function(){return $n="useCacheRefresh",Bo(),x8()}},vN={readContext:function(R){return Wo(R)},use:ey,useCallback:function(R,z){return $n="useCallback",Bo(),pi(R,z)},useContext:function(R){return $n="useContext",Bo(),Wo(R)},useEffect:function(R,z){$n="useEffect",Bo(),na(2048,Nh,R,z)},useImperativeHandle:function(R,z,q){return $n="useImperativeHandle",Bo(),oo(R,z,q)},useInsertionEffect:function(R,z){return $n="useInsertionEffect",Bo(),na(4,Bm,R,z)},useLayoutEffect:function(R,z){return $n="useLayoutEffect",Bo(),na(4,Ap,R,z)},useMemo:function(R,z){$n="useMemo",Bo();var q=zn.H;zn.H=fp;try{return ds(R,z)}finally{zn.H=q}},useReducer:function(R,z,q){$n="useReducer",Bo();var pe=zn.H;zn.H=fp;try{return bm(R,z,q)}finally{zn.H=pe}},useRef:function(){return $n="useRef",Bo(),jc().memoizedState},useState:function(){$n="useState",Bo();var R=zn.H;zn.H=fp;try{return bm(hp)}finally{zn.H=R}},useDebugValue:function(){$n="useDebugValue",Bo()},useDeferredValue:function(R,z){return $n="useDeferredValue",Bo(),Th(R,z)},useTransition:function(){return $n="useTransition",Bo(),GH()},useSyncExternalStore:function(R,z,q){return $n="useSyncExternalStore",Bo(),H0(R,z,q)},useId:function(){return $n="useId",Bo(),jc().memoizedState},useFormState:function(R){return $n="useFormState",Bo(),sl(),Ln(R)},useActionState:function(R){return $n="useActionState",Bo(),Ln(R)},useOptimistic:function(R,z){return $n="useOptimistic",Bo(),s0(R,z)},useHostTransitionStatus:fA,useMemoCache:xm,useCacheRefresh:function(){return $n="useCacheRefresh",Bo(),jc().memoizedState}},A7={readContext:function(R){return Wo(R)},use:ey,useCallback:function(R,z){return $n="useCallback",Bo(),pi(R,z)},useContext:function(R){return $n="useContext",Bo(),Wo(R)},useEffect:function(R,z){$n="useEffect",Bo(),na(2048,Nh,R,z)},useImperativeHandle:function(R,z,q){return $n="useImperativeHandle",Bo(),oo(R,z,q)},useInsertionEffect:function(R,z){return $n="useInsertionEffect",Bo(),na(4,Bm,R,z)},useLayoutEffect:function(R,z){return $n="useLayoutEffect",Bo(),na(4,Ap,R,z)},useMemo:function(R,z){$n="useMemo",Bo();var q=zn.H;zn.H=Iu;try{return ds(R,z)}finally{zn.H=q}},useReducer:function(R,z,q){$n="useReducer",Bo();var pe=zn.H;zn.H=Iu;try{return l_(R,z,q)}finally{zn.H=pe}},useRef:function(){return $n="useRef",Bo(),jc().memoizedState},useState:function(){$n="useState",Bo();var R=zn.H;zn.H=Iu;try{return l_(hp)}finally{zn.H=R}},useDebugValue:function(){$n="useDebugValue",Bo()},useDeferredValue:function(R,z){return $n="useDeferredValue",Bo(),xg(R,z)},useTransition:function(){return $n="useTransition",Bo(),ZE()},useSyncExternalStore:function(R,z,q){return $n="useSyncExternalStore",Bo(),H0(R,z,q)},useId:function(){return $n="useId",Bo(),jc().memoizedState},useFormState:function(R){return $n="useFormState",Bo(),sl(),tr(R)},useActionState:function(R){return $n="useActionState",Bo(),tr(R)},useOptimistic:function(R,z){return $n="useOptimistic",Bo(),v4(R,z)},useHostTransitionStatus:fA,useMemoCache:xm,useCacheRefresh:function(){return $n="useCacheRefresh",Bo(),jc().memoizedState}},u0={readContext:function(R){return p(),Wo(R)},use:function(R){return _(),ey(R)},useCallback:function(R,z){return $n="useCallback",_(),Us(),vo(R,z)},useContext:function(R){return $n="useContext",_(),Us(),Wo(R)},useEffect:function(R,z){return $n="useEffect",_(),Us(),vc(R,z)},useImperativeHandle:function(R,z,q){return $n="useImperativeHandle",_(),Us(),vn(R,z,q)},useInsertionEffect:function(R,z){$n="useInsertionEffect",_(),Us(),Ws(4,Bm,R,z)},useLayoutEffect:function(R,z){return $n="useLayoutEffect",_(),Us(),zp(R,z)},useMemo:function(R,z){$n="useMemo",_(),Us();var q=zn.H;zn.H=u0;try{return oa(R,z)}finally{zn.H=q}},useReducer:function(R,z,q){$n="useReducer",_(),Us();var pe=zn.H;zn.H=u0;try{return Cm(R,z,q)}finally{zn.H=pe}},useRef:function(R){return $n="useRef",_(),Us(),Pa(R)},useState:function(R){$n="useState",_(),Us();var z=zn.H;zn.H=u0;try{return ty(R)}finally{zn.H=z}},useDebugValue:function(){$n="useDebugValue",_(),Us()},useDeferredValue:function(R,z){return $n="useDeferredValue",_(),Us(),Ea(R,z)},useTransition:function(){return $n="useTransition",_(),Us(),E4()},useSyncExternalStore:function(R,z,q){return $n="useSyncExternalStore",_(),Us(),KE(R,z,q)},useId:function(){return $n="useId",_(),Us(),Rf()},useFormState:function(R,z){return $n="useFormState",_(),Us(),Mn(R,z)},useActionState:function(R,z){return $n="useActionState",_(),Us(),Mn(R,z)},useOptimistic:function(R){return $n="useOptimistic",_(),Us(),ny(R)},useMemoCache:function(R){return _(),xm(R)},useHostTransitionStatus:fA,useCacheRefresh:function(){return $n="useCacheRefresh",Us(),x8()}},fp={readContext:function(R){return p(),Wo(R)},use:function(R){return _(),ey(R)},useCallback:function(R,z){return $n="useCallback",_(),Bo(),pi(R,z)},useContext:function(R){return $n="useContext",_(),Bo(),Wo(R)},useEffect:function(R,z){$n="useEffect",_(),Bo(),na(2048,Nh,R,z)},useImperativeHandle:function(R,z,q){return $n="useImperativeHandle",_(),Bo(),oo(R,z,q)},useInsertionEffect:function(R,z){return $n="useInsertionEffect",_(),Bo(),na(4,Bm,R,z)},useLayoutEffect:function(R,z){return $n="useLayoutEffect",_(),Bo(),na(4,Ap,R,z)},useMemo:function(R,z){$n="useMemo",_(),Bo();var q=zn.H;zn.H=fp;try{return ds(R,z)}finally{zn.H=q}},useReducer:function(R,z,q){$n="useReducer",_(),Bo();var pe=zn.H;zn.H=fp;try{return bm(R,z,q)}finally{zn.H=pe}},useRef:function(){return $n="useRef",_(),Bo(),jc().memoizedState},useState:function(){$n="useState",_(),Bo();var R=zn.H;zn.H=fp;try{return bm(hp)}finally{zn.H=R}},useDebugValue:function(){$n="useDebugValue",_(),Bo()},useDeferredValue:function(R,z){return $n="useDeferredValue",_(),Bo(),Th(R,z)},useTransition:function(){return $n="useTransition",_(),Bo(),GH()},useSyncExternalStore:function(R,z,q){return $n="useSyncExternalStore",_(),Bo(),H0(R,z,q)},useId:function(){return $n="useId",_(),Bo(),jc().memoizedState},useFormState:function(R){return $n="useFormState",_(),Bo(),Ln(R)},useActionState:function(R){return $n="useActionState",_(),Bo(),Ln(R)},useOptimistic:function(R,z){return $n="useOptimistic",_(),Bo(),s0(R,z)},useMemoCache:function(R){return _(),xm(R)},useHostTransitionStatus:fA,useCacheRefresh:function(){return $n="useCacheRefresh",Bo(),jc().memoizedState}},Iu={readContext:function(R){return p(),Wo(R)},use:function(R){return _(),ey(R)},useCallback:function(R,z){return $n="useCallback",_(),Bo(),pi(R,z)},useContext:function(R){return $n="useContext",_(),Bo(),Wo(R)},useEffect:function(R,z){$n="useEffect",_(),Bo(),na(2048,Nh,R,z)},useImperativeHandle:function(R,z,q){return $n="useImperativeHandle",_(),Bo(),oo(R,z,q)},useInsertionEffect:function(R,z){return $n="useInsertionEffect",_(),Bo(),na(4,Bm,R,z)},useLayoutEffect:function(R,z){return $n="useLayoutEffect",_(),Bo(),na(4,Ap,R,z)},useMemo:function(R,z){$n="useMemo",_(),Bo();var q=zn.H;zn.H=fp;try{return ds(R,z)}finally{zn.H=q}},useReducer:function(R,z,q){$n="useReducer",_(),Bo();var pe=zn.H;zn.H=fp;try{return l_(R,z,q)}finally{zn.H=pe}},useRef:function(){return $n="useRef",_(),Bo(),jc().memoizedState},useState:function(){$n="useState",_(),Bo();var R=zn.H;zn.H=fp;try{return l_(hp)}finally{zn.H=R}},useDebugValue:function(){$n="useDebugValue",_(),Bo()},useDeferredValue:function(R,z){return $n="useDeferredValue",_(),Bo(),xg(R,z)},useTransition:function(){return $n="useTransition",_(),Bo(),ZE()},useSyncExternalStore:function(R,z,q){return $n="useSyncExternalStore",_(),Bo(),H0(R,z,q)},useId:function(){return $n="useId",_(),Bo(),jc().memoizedState},useFormState:function(R){return $n="useFormState",_(),Bo(),tr(R)},useActionState:function(R){return $n="useActionState",_(),Bo(),tr(R)},useOptimistic:function(R,z){return $n="useOptimistic",_(),Bo(),v4(R,z)},useMemoCache:function(R){return _(),xm(R)},useHostTransitionStatus:fA,useCacheRefresh:function(){return $n="useCacheRefresh",Bo(),jc().memoizedState}};var s9={"react-stack-bottom-frame":function(R,z,q){var pe=jf;jf=!0;try{return R(z,q)}finally{jf=pe}}},SN=s9["react-stack-bottom-frame"].bind(s9),G={"react-stack-bottom-frame":function(R){var z=jf;jf=!0;try{return R.render()}finally{jf=z}}},he=G["react-stack-bottom-frame"].bind(G),fe={"react-stack-bottom-frame":function(R,z){try{z.componentDidMount()}catch(q){yl(R,R.return,q)}}},Fe=fe["react-stack-bottom-frame"].bind(fe),tt={"react-stack-bottom-frame":function(R,z,q,pe,Ce){try{z.componentDidUpdate(q,pe,Ce)}catch(Te){yl(R,R.return,Te)}}},yt=tt["react-stack-bottom-frame"].bind(tt),Bt={"react-stack-bottom-frame":function(R,z){var q=z.stack;R.componentDidCatch(z.value,{componentStack:q!==null?q:""})}},Rt=Bt["react-stack-bottom-frame"].bind(Bt),Xt={"react-stack-bottom-frame":function(R,z,q){try{q.componentWillUnmount()}catch(pe){yl(R,z,pe)}}},Hn=Xt["react-stack-bottom-frame"].bind(Xt),so={"react-stack-bottom-frame":function(R){R.resourceKind!=null&&console.error("Expected only SimpleEffects when enableUseEffectCRUDOverload is disabled, got %s",R.resourceKind);var z=R.create;return R=R.inst,z=z(),R.destroy=z}},So=so["react-stack-bottom-frame"].bind(so),nr={"react-stack-bottom-frame":function(R,z,q){try{q()}catch(pe){yl(R,z,pe)}}},Rr=nr["react-stack-bottom-frame"].bind(nr),Yi={"react-stack-bottom-frame":function(R){var z=R._init;return z(R._payload)}},li=Yi["react-stack-bottom-frame"].bind(Yi),zr=null,Pr=0,Eo=null,Fo,ks=Fo=!1,ph={},Yp={},cb={};u=function(R,z,q){if(q!==null&&typeof q==="object"&&q._store&&(!q._store.validated&&q.key==null||q._store.validated===2)){if(typeof q._store!=="object")throw Error("React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue.");q._store.validated=1;var pe=P(R),Ce=pe||"null";if(!ph[Ce]){ph[Ce]=!0,q=q._owner,R=R._debugOwner;var Te="";R&&typeof R.tag==="number"&&(Ce=P(R))&&(Te=`

Check the render method of \``+Ce+"`."),Te||pe&&(Te=`

Check the top-level render call using <`+pe+">.");var ut="";q!=null&&R!==q&&(pe=null,typeof q.tag==="number"?pe=P(q):typeof q.name==="string"&&(pe=q.name),pe&&(ut=" It was passed a child from "+pe+".")),_n(z,function(){console.error('Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',Te,ut)})}}};var Bg=UH(!0),Cy=UH(!1),Dm=M(null),by=null,lb=1,hb=2,Rh=M(0),db={},a9=new Set,FM=new Set,c9=new Set,PN=new Set,l9=new Set,RW=new Set,EN=new Set,Tg=new Set,MN=new Set,Nm=new Set;Object.freeze(db);var Rm={enqueueSetState:function(R,z,q){R=R._reactInternals;var pe=u_(R),Ce=gu(pe);Ce.payload=z,q!==void 0&&q!==null&&(Qf(q),Ce.callback=q),z=a_(R,Ce,pe),z!==null&&(Wd(z,R,pe),Kh(z,R,pe)),Me(R,pe)},enqueueReplaceState:function(R,z,q){R=R._reactInternals;var pe=u_(R),Ce=gu(pe);Ce.tag=QF,Ce.payload=z,q!==void 0&&q!==null&&(Qf(q),Ce.callback=q),z=a_(R,Ce,pe),z!==null&&(Wd(z,R,pe),Kh(z,R,pe)),Me(R,pe)},enqueueForceUpdate:function(R,z){R=R._reactInternals;var q=u_(R),pe=gu(q);pe.tag=kM,z!==void 0&&z!==null&&(Qf(z),pe.callback=z),z=a_(R,pe,q),z!==null&&(Wd(z,R,q),Kh(z,R,q)),Cr!==null&&typeof Cr.markForceUpdateScheduled==="function"&&Cr.markForceUpdateScheduled(R,q)}},ub=typeof reportError==="function"?reportError:function(R){if(typeof window==="object"&&typeof window.ErrorEvent==="function"){var z=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof R==="object"&&R!==null&&typeof R.message==="string"?String(R.message):String(R),error:R});if(!window.dispatchEvent(z))return}else if(typeof process==="object"&&typeof process.emit==="function"){process.emit("uncaughtException",R);return}console.error(R)},$d=null,$2=null,Iy=Error("This is not a real error. It's an implementation detail of React's selective hydration feature. If this leaks into userspace, it's a bug in React. Please file an issue."),Vl=!1,j4={},K4={},zM={},pa={},wN=!1,$4={},f7={},y7={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null},FF=!1,QW=null;QW=new Set;var q4=!1,Yl=!1,BN=!1,kW=typeof WeakSet==="function"?WeakSet:Set,Gp=null,h9=null,Qm=null,z0=null,q2=!1,J4=null,x7=8192,lNe={getCacheForType:function(R){var z=Wo(Dh),q=z.data.get(R);return q===void 0&&(q=R(),z.data.set(R,q)),q},getOwner:function(){return SA}},zF=0,LW=1,O0=2,Xn=3,Jc=4;if(typeof Symbol==="function"&&Symbol.for){var OF=Symbol.for;zF=OF("selector.component"),LW=OF("selector.has_pseudo_class"),O0=OF("selector.role"),Xn=OF("selector.test_id"),Jc=OF("selector.text")}var TN=[],Coe=typeof WeakMap==="function"?WeakMap:Map,p0=0,m0=2,MA=4,wA=0,C7=1,pb=2,HW=3,b7=4,VF=6,boe=5,Ac=p0,Qh=null,Ha=null,Fa=0,qf=0,OM=1,d9=2,Dg=3,Z4=4,J2=5,I7=6,YF=7,Ioe=8,VM=9,es=qf,vy=null,mb=!1,v7=!1,S7=!1,_b=0,vu=wA,P7=0,E7=0,M7=0,kh=0,BA=0,Z2=null,mh=null,FW=!1,voe=0,GF=300,w7=1/0,DN=500,km=null,f_=null,gb=0,zW=1,u9=2,_0=0,TA=1,p9=2,Soe=3,hNe=4,Poe=5,y_=0,Kx=null,m9=null,_9=0,g9=0,UF=null,F_e=null,dNe=50,NN=0,OW=null,Zc=!1,VW=!1,z_e=50,B7=0,RN=null,YM=!1,WF=null,Eoe=!1,Moe=new Set,O_e={},Sy=null,QN=null,woe=!1;try{var V_e=Object.preventExtensions({})}catch(R){woe=!0}var Y_e=!1,Boe={},XF=null,YW=null,Toe=null,Doe=null,G_e=null,U_e=null,W_e=null,Noe=null,GM=null;return XF=function(R,z,q,pe){z=t(R,z),z!==null&&(q=n(z.memoizedState,q,0,pe),z.memoizedState=q,z.baseState=q,R.memoizedProps=pp({},R.memoizedProps),q=r0(R,2),q!==null&&Wd(q,R,2))},YW=function(R,z,q){z=t(R,z),z!==null&&(q=i(z.memoizedState,q,0),z.memoizedState=q,z.baseState=q,R.memoizedProps=pp({},R.memoizedProps),q=r0(R,2),q!==null&&Wd(q,R,2))},Toe=function(R,z,q,pe){z=t(R,z),z!==null&&(q=o(z.memoizedState,q,pe),z.memoizedState=q,z.baseState=q,R.memoizedProps=pp({},R.memoizedProps),q=r0(R,2),q!==null&&Wd(q,R,2))},Doe=function(R,z,q){R.pendingProps=n(R.memoizedProps,z,0,q),R.alternate&&(R.alternate.pendingProps=R.pendingProps),z=r0(R,2),z!==null&&Wd(z,R,2)},G_e=function(R,z){R.pendingProps=i(R.memoizedProps,z,0),R.alternate&&(R.alternate.pendingProps=R.pendingProps),z=r0(R,2),z!==null&&Wd(z,R,2)},U_e=function(R,z,q){R.pendingProps=o(R.memoizedProps,z,q),R.alternate&&(R.alternate.pendingProps=R.pendingProps),z=r0(R,2),z!==null&&Wd(z,R,2)},W_e=function(R){var z=r0(R,2);z!==null&&Wd(z,R,2)},Noe=function(R){a=R},GM=function(R){s=R},Ma.attemptContinuousHydration=function(R){if(R.tag===13){var z=r0(R,67108864);z!==null&&Wd(z,R,67108864),Ig(R,67108864)}},Ma.attemptHydrationAtCurrentPriority=function(R){if(R.tag===13){var z=u_(R);z=se(z);var q=r0(R,z);q!==null&&Wd(q,R,z),Ig(R,z)}},Ma.attemptSynchronousHydration=function(R){switch(R.tag){case 3:if(R=R.stateNode,R.current.memoizedState.isDehydrated){var z=L(R.pendingLanes);if(z!==0){R.pendingLanes|=2;for(R.entangledLanes|=2;z;){var q=1<<31-m_(z);R.entanglements[1]|=q,z&=~q}or(R),(Ac&(m0|MA))===p0&&(w7=Wf()+DN,Gr(0,!1))}}break;case 13:z=r0(R,2),z!==null&&Wd(z,R,2),MI(),Ig(R,2)}},Ma.batchedUpdates=function(R,z){return R(z)},Ma.createComponentSelector=function(R){return{$$typeof:zF,value:R}},Ma.createContainer=function(R,z,q,pe,Ce,Te,ut,wt,In,to){return CM(R,z,!1,null,q,pe,Te,ut,wt,In,to,null)},Ma.createHasPseudoClassSelector=function(R){return{$$typeof:LW,value:R}},Ma.createHydrationContainer=function(R,z,q,pe,Ce,Te,ut,wt,In,to,Xo,Zo,vr){return R=CM(q,pe,!0,R,Ce,Te,wt,In,to,Xo,Zo,vr),R.context=cW(null),q=R.current,pe=u_(q),pe=se(pe),Ce=gu(pe),Ce.callback=z!==void 0&&z!==null?z:null,a_(q,Ce,pe),z=pe,R.current.lanes=z,X(R,z),or(R),R},Ma.createPortal=function(R,z,q){var pe=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;try{Vi(pe);var Ce=!1}catch(Te){Ce=!0}return Ce&&(console.error("The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",typeof Symbol==="function"&&Symbol.toStringTag&&pe[Symbol.toStringTag]||pe.constructor.name||"Object"),Vi(pe)),{$$typeof:zx,key:pe==null?null:""+pe,children:R,containerInfo:z,implementation:q}},Ma.createRoleSelector=function(R){return{$$typeof:O0,value:R}},Ma.createTestNameSelector=function(R){return{$$typeof:Xn,value:R}},Ma.createTextSelector=function(R){return{$$typeof:Jc,value:R}},Ma.defaultOnCaughtError=function(R){var z=$d?"The above error occurred in the <"+$d+"> component.":"The above error occurred in one of your React components.",q="React will try to recreate this component tree from scratch using the error boundary you provided, "+(($2||"Anonymous")+".");typeof R==="object"&&R!==null&&typeof R.environmentName==="string"?_p("error",[`%o

%s

%s
`,R,z,q],R.environmentName)():console.error(`%o

%s

%s
`,R,z,q)},Ma.defaultOnRecoverableError=function(R){ub(R)},Ma.defaultOnUncaughtError=function(R){ub(R),console.warn(`%s

%s
`,$d?"An error occurred in the <"+$d+"> component.":"An error occurred in one of your React components.",`Consider adding an error boundary to your tree to customize error handling behavior.
Visit https://react.dev/link/error-boundaries to learn more about error boundaries.`)},Ma.deferredUpdates=function(R){var z=zn.T,q=py();try{return yu(32),zn.T=null,R()}finally{yu(q),zn.T=z}},Ma.discreteUpdates=function(R,z,q,pe,Ce){var Te=zn.T,ut=py();try{return yu(2),zn.T=null,R(z,q,pe,Ce)}finally{yu(ut),zn.T=Te,Ac===p0&&(w7=Wf()+DN)}},Ma.findAllNodes=PI,Ma.findBoundingRects=function(R,z){if(!jd)throw Error("Test selector API is not supported by this renderer.");z=PI(R,z),R=[];for(var q=0;q<z.length;q++)R.push(Uf(z[q]));for(z=R.length-1;0<z;z--){q=R[z];for(var pe=q.x,Ce=pe+q.width,Te=q.y,ut=Te+q.height,wt=z-1;0<=wt;wt--)if(z!==wt){var In=R[wt],to=In.x,Xo=to+In.width,Zo=In.y,vr=Zo+In.height;if(pe>=to&&Te>=Zo&&Ce<=Xo&&ut<=vr){R.splice(z,1);break}else if(!(pe!==to||q.width!==In.width||vr<Te||Zo>ut)){Zo>Te&&(In.height+=Zo-Te,In.y=Te),vr<ut&&(In.height=ut-Zo),R.splice(z,1);break}else if(!(Te!==Zo||q.height!==In.height||Xo<pe||to>Ce)){to>pe&&(In.width+=to-pe,In.x=pe),Xo<Ce&&(In.width=Ce-to),R.splice(z,1);break}}}return R},Ma.findHostInstance=function(R){var z=R._reactInternals;if(z===void 0){if(typeof R.render==="function")throw Error("Unable to find node on an unmounted component.");throw R=Object.keys(R).join(","),Error("Argument appears to not be a ReactComponent. Keys: "+R)}return R=x(z),R===null?null:NI(R.stateNode)},Ma.findHostInstanceWithNoPortals=function(R){return R=y(R),R=R!==null?b(R):null,R===null?null:NI(R.stateNode)},Ma.findHostInstanceWithWarning=function(R,z){var q=R._reactInternals;if(q===void 0){if(typeof R.render==="function")throw Error("Unable to find node on an unmounted component.");throw R=Object.keys(R).join(","),Error("Argument appears to not be a ReactComponent. Keys: "+R)}if(R=x(q),R===null)return null;if(R.mode&8){var pe=P(q)||"Component";Boe[pe]||(Boe[pe]=!0,_n(R,function(){q.mode&8?console.error("%s is deprecated in StrictMode. %s was passed an instance of %s which is inside StrictMode. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://react.dev/link/strict-mode-find-node",z,z,pe):console.error("%s is deprecated in StrictMode. %s was passed an instance of %s which renders StrictMode children. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://react.dev/link/strict-mode-find-node",z,z,pe)}))}return NI(R.stateNode)},Ma.flushPassiveEffects=YC,Ma.flushSyncFromReconciler=function(R){var z=Ac;Ac|=1;var q=zn.T,pe=py();try{if(yu(2),zn.T=null,R)return R()}finally{yu(pe),zn.T=q,Ac=z,(Ac&(m0|MA))===p0&&Gr(0,!1)}},Ma.flushSyncWork=MI,Ma.focusWithin=function(R,z){if(!jd)throw Error("Test selector API is not supported by this renderer.");R=vI(R),z=SI(R,z),z=Array.from(z);for(R=0;R<z.length;){var q=z[R++],pe=q.tag;if(!Sm(q)){if((pe===5||pe===26||pe===27)&&uh(q.stateNode))return!0;for(q=q.child;q!==null;)z.push(q),q=q.sibling}}return!1},Ma.getFindAllNodesFailureDescription=function(R,z){if(!jd)throw Error("Test selector API is not supported by this renderer.");var q=0,pe=[];R=[vI(R),0];for(var Ce=0;Ce<R.length;){var Te=R[Ce++],ut=Te.tag,wt=R[Ce++],In=z[wt];if(ut!==5&&ut!==26&&ut!==27||!Sm(Te)){if(kD(Te,In)&&(pe.push(LD(In)),wt++,wt>q&&(q=wt)),wt<z.length)for(Te=Te.child;Te!==null;)R.push(Te,wt),Te=Te.sibling}}if(q<z.length){for(R=[];q<z.length;q++)R.push(LD(z[q]));return`findAllNodes was able to match part of the selector:
  `+(pe.join(" > ")+`

No matching component was found for:
  `)+R.join(" > ")}return null},Ma.getPublicRootInstance=function(R){if(R=R.current,!R.child)return null;switch(R.child.tag){case 27:case 5:return NI(R.child.stateNode);default:return R.child.stateNode}},Ma.injectIntoDevTools=function(){var R={bundleType:1,version:Ol,rendererPackageName:_oe,currentDispatcherRef:zn,reconcilerVersion:"19.1.0"};return uW!==null&&(R.rendererConfig=uW),R.overrideHookState=XF,R.overrideHookStateDeletePath=YW,R.overrideHookStateRenamePath=Toe,R.overrideProps=Doe,R.overridePropsDeletePath=G_e,R.overridePropsRenamePath=U_e,R.scheduleUpdate=W_e,R.setErrorHandler=Noe,R.setSuspenseHandler=GM,R.scheduleRefresh=h,R.scheduleRoot=l,R.setRefreshHandler=d,R.getCurrentFiber=lW,R.getLaneLabelMap=aF,R.injectProfilingHooks=le,te(R)},Ma.isAlreadyRendering=function(){return(Ac&(m0|MA))!==p0},Ma.observeVisibleRects=function(R,z,q,pe){function Ce(){var to=PI(R,z);Te.forEach(function(Xo){0>to.indexOf(Xo)&&In(Xo)}),to.forEach(function(Xo){0>Te.indexOf(Xo)&&wt(Xo)})}if(!jd)throw Error("Test selector API is not supported by this renderer.");var Te=PI(R,z);q=gW(Te,q,pe);var ut=q.disconnect,wt=q.observe,In=q.unobserve;return TN.push(Ce),{disconnect:function(){var to=TN.indexOf(Ce);0<=to&&TN.splice(to,1),ut()}}},Ma.shouldError=function(R){return a(R)},Ma.shouldSuspend=function(R){return s(R)},Ma.startHostTransition=function(R,z,q,pe){if(R.tag!==5)throw Error("Expected the form instance to be a HostComponent. This is a bug in React.");var Ce=P4(R).queue;JE(R,Ce,z,kI,q===null?m:function(){zn.T===null&&console.error("requestFormReset was called outside a transition or action. To fix, move to an action, or wrap with startTransition.");var Te=P4(R).next.queue;return M4(R,Te,{},u_(R)),q(pe)})},Ma.updateContainer=function(R,z,q,pe){var Ce=z.current,Te=u_(Ce);return IA(Ce,Te,R,z,q,pe),Te},Ma.updateContainerSync=BI,Ma},iae.exports.default=iae.exports,Object.defineProperty(iae.exports,"__esModule",{value:!0})});var EUe=pt(function(Uer){Uer.ConcurrentRoot=1,Uer.ContinuousEventPriority=8,Uer.DefaultEventPriority=32,Uer.DiscreteEventPriority=2,Uer.IdleEventPriority=268435456,Uer.LegacyRoot=0,Uer.NoEventPriority=0});var W9=pt(function(GRt){Object.defineProperty(GRt,"__esModule",{value:!0});GRt.RANDOM=GRt.EPSILON=GRt.ARRAY_TYPE=GRt.ANGLE_ORDER=void 0;GRt.equals=jtr;GRt.round=Vtr;GRt.setMatrixArrayType=Ytr;GRt.toDegree=Xtr;GRt.toRadian=Wtr;var ztr=GRt.EPSILON=0.000001,Otr=GRt.ARRAY_TYPE=typeof Float32Array<"u"?Float32Array:Array,bQs=GRt.RANDOM=Math.random,IQs=GRt.ANGLE_ORDER="zyx";function Vtr(e){if(e>=0)return Math.round(e);return e%0.5===0?Math.floor(e):Math.round(e)}function Ytr(e){GRt.ARRAY_TYPE=Otr=e}var Gtr=Math.PI/180,Utr=180/Math.PI;function Wtr(e){return e*Gtr}function Xtr(e){return e*Utr}function jtr(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ztr;return Math.abs(e-t)<=n*Math.max(1,Math.abs(e),Math.abs(t))}});var ZRt=pt(function($Rt){function nWe(e){return nWe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nWe(e)}Object.defineProperty($Rt,"__esModule",{value:!0});$Rt.LDU=fnr;$Rt.add=ynr;$Rt.adjoint=hnr;$Rt.clone=onr;$Rt.copy=rnr;$Rt.create=nnr;$Rt.determinant=dnr;$Rt.equals=Cnr;$Rt.exactEquals=xnr;$Rt.frob=Anr;$Rt.fromRotation=mnr;$Rt.fromScaling=_nr;$Rt.fromValues=snr;$Rt.identity=inr;$Rt.invert=lnr;$Rt.mul=void 0;$Rt.multiply=jRt;$Rt.multiplyScalar=bnr;$Rt.multiplyScalarAndAdd=Inr;$Rt.rotate=unr;$Rt.scale=pnr;$Rt.set=anr;$Rt.str=gnr;$Rt.sub=void 0;$Rt.subtract=KRt;$Rt.transpose=cnr;var rQ=XRt(W9());function XRt(e,t){if(typeof WeakMap=="function")var n=new WeakMap,o=new WeakMap;return(XRt=function(i,s){if(!s&&i&&i.__esModule)return i;var a,c,l={__proto__:null,default:i};if(i===null||nWe(i)!="object"&&typeof i!="function")return l;if(a=s?o:n){if(a.has(i))return a.get(i);a.set(i,l)}for(var h in i)h!=="default"&&{}.hasOwnProperty.call(i,h)&&((c=(a=Object.defineProperty)&&Object.getOwnPropertyDescriptor(i,h))&&(c.get||c.set)?a(l,h,c):l[h]=i[h]);return l})(e,t)}function nnr(){var e=new rQ.ARRAY_TYPE(4);if(rQ.ARRAY_TYPE!=Float32Array)e[1]=0,e[2]=0;return e[0]=1,e[3]=1,e}function onr(e){var t=new rQ.ARRAY_TYPE(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function rnr(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function inr(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e}function snr(e,t,n,o){var r=new rQ.ARRAY_TYPE(4);return r[0]=e,r[1]=t,r[2]=n,r[3]=o,r}function anr(e,t,n,o,r){return e[0]=t,e[1]=n,e[2]=o,e[3]=r,e}function cnr(e,t){if(e===t){var n=t[1];e[1]=t[2],e[2]=n}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e}function lnr(e,t){var n=t[0],o=t[1],r=t[2],i=t[3],s=n*i-r*o;if(!s)return null;return s=1/s,e[0]=i*s,e[1]=-o*s,e[2]=-r*s,e[3]=n*s,e}function hnr(e,t){var n=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=n,e}function dnr(e){return e[0]*e[3]-e[2]*e[1]}function jRt(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=n[0],c=n[1],l=n[2],h=n[3];return e[0]=o*a+i*c,e[1]=r*a+s*c,e[2]=o*l+i*h,e[3]=r*l+s*h,e}function unr(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=Math.sin(n),c=Math.cos(n);return e[0]=o*c+i*a,e[1]=r*c+s*a,e[2]=o*-a+i*c,e[3]=r*-a+s*c,e}function pnr(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=n[0],c=n[1];return e[0]=o*a,e[1]=r*a,e[2]=i*c,e[3]=s*c,e}function mnr(e,t){var n=Math.sin(t),o=Math.cos(t);return e[0]=o,e[1]=n,e[2]=-n,e[3]=o,e}function _nr(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e}function gnr(e){return"mat2("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}function Anr(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3])}function fnr(e,t,n,o){return e[2]=o[2]/o[0],n[0]=o[0],n[1]=o[1],n[3]=o[3]-e[2]*n[1],[e,t,n]}function ynr(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}function KRt(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}function xnr(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}function Cnr(e,t){var n=e[0],o=e[1],r=e[2],i=e[3],s=t[0],a=t[1],c=t[2],l=t[3];return Math.abs(n-s)<=rQ.EPSILON*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(o-a)<=rQ.EPSILON*Math.max(1,Math.abs(o),Math.abs(a))&&Math.abs(r-c)<=rQ.EPSILON*Math.max(1,Math.abs(r),Math.abs(c))&&Math.abs(i-l)<=rQ.EPSILON*Math.max(1,Math.abs(i),Math.abs(l))}function bnr(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}function Inr(e,t,n,o){return e[0]=t[0]+n[0]*o,e[1]=t[1]+n[1]*o,e[2]=t[2]+n[2]*o,e[3]=t[3]+n[3]*o,e}var SQs=$Rt.mul=jRt,PQs=$Rt.sub=KRt});var sQt=pt(function(oQt){function oWe(e){return oWe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oWe(e)}Object.defineProperty(oQt,"__esModule",{value:!0});oQt.add=hor;oQt.clone=Knr;oQt.copy=$nr;oQt.create=jnr;oQt.determinant=tor;oQt.equals=mor;oQt.exactEquals=por;oQt.frob=lor;oQt.fromRotation=ior;oQt.fromScaling=sor;oQt.fromTranslation=aor;oQt.fromValues=Jnr;oQt.identity=qnr;oQt.invert=eor;oQt.mul=void 0;oQt.multiply=tQt;oQt.multiplyScalar=dor;oQt.multiplyScalarAndAdd=uor;oQt.rotate=nor;oQt.scale=oor;oQt.set=Znr;oQt.str=cor;oQt.sub=void 0;oQt.subtract=nQt;oQt.translate=ror;var AS=eQt(W9());function eQt(e,t){if(typeof WeakMap=="function")var n=new WeakMap,o=new WeakMap;return(eQt=function(i,s){if(!s&&i&&i.__esModule)return i;var a,c,l={__proto__:null,default:i};if(i===null||oWe(i)!="object"&&typeof i!="function")return l;if(a=s?o:n){if(a.has(i))return a.get(i);a.set(i,l)}for(var h in i)h!=="default"&&{}.hasOwnProperty.call(i,h)&&((c=(a=Object.defineProperty)&&Object.getOwnPropertyDescriptor(i,h))&&(c.get||c.set)?a(l,h,c):l[h]=i[h]);return l})(e,t)}function jnr(){var e=new AS.ARRAY_TYPE(6);if(AS.ARRAY_TYPE!=Float32Array)e[1]=0,e[2]=0,e[4]=0,e[5]=0;return e[0]=1,e[3]=1,e}function Knr(e){var t=new AS.ARRAY_TYPE(6);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function $nr(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function qnr(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}function Jnr(e,t,n,o,r,i){var s=new AS.ARRAY_TYPE(6);return s[0]=e,s[1]=t,s[2]=n,s[3]=o,s[4]=r,s[5]=i,s}function Znr(e,t,n,o,r,i,s){return e[0]=t,e[1]=n,e[2]=o,e[3]=r,e[4]=i,e[5]=s,e}function eor(e,t){var n=t[0],o=t[1],r=t[2],i=t[3],s=t[4],a=t[5],c=n*i-o*r;if(!c)return null;return c=1/c,e[0]=i*c,e[1]=-o*c,e[2]=-r*c,e[3]=n*c,e[4]=(r*a-i*s)*c,e[5]=(o*s-n*a)*c,e}function tor(e){return e[0]*e[3]-e[1]*e[2]}function tQt(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=t[4],c=t[5],l=n[0],h=n[1],d=n[2],u=n[3],_=n[4],p=n[5];return e[0]=o*l+i*h,e[1]=r*l+s*h,e[2]=o*d+i*u,e[3]=r*d+s*u,e[4]=o*_+i*p+a,e[5]=r*_+s*p+c,e}function nor(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=t[4],c=t[5],l=Math.sin(n),h=Math.cos(n);return e[0]=o*h+i*l,e[1]=r*h+s*l,e[2]=o*-l+i*h,e[3]=r*-l+s*h,e[4]=a,e[5]=c,e}function oor(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=t[4],c=t[5],l=n[0],h=n[1];return e[0]=o*l,e[1]=r*l,e[2]=i*h,e[3]=s*h,e[4]=a,e[5]=c,e}function ror(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=t[4],c=t[5],l=n[0],h=n[1];return e[0]=o,e[1]=r,e[2]=i,e[3]=s,e[4]=o*l+i*h+a,e[5]=r*l+s*h+c,e}function ior(e,t){var n=Math.sin(t),o=Math.cos(t);return e[0]=o,e[1]=n,e[2]=-n,e[3]=o,e[4]=0,e[5]=0,e}function sor(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e[4]=0,e[5]=0,e}function aor(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0],e[5]=t[1],e}function cor(e){return"mat2d("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+")"}function lor(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+1)}function hor(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e}function nQt(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e}function dor(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e}function uor(e,t,n,o){return e[0]=t[0]+n[0]*o,e[1]=t[1]+n[1]*o,e[2]=t[2]+n[2]*o,e[3]=t[3]+n[3]*o,e[4]=t[4]+n[4]*o,e[5]=t[5]+n[5]*o,e}function por(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]}function mor(e,t){var n=e[0],o=e[1],r=e[2],i=e[3],s=e[4],a=e[5],c=t[0],l=t[1],h=t[2],d=t[3],u=t[4],_=t[5];return Math.abs(n-c)<=AS.EPSILON*Math.max(1,Math.abs(n),Math.abs(c))&&Math.abs(o-l)<=AS.EPSILON*Math.max(1,Math.abs(o),Math.abs(l))&&Math.abs(r-h)<=AS.EPSILON*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(i-d)<=AS.EPSILON*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(s-u)<=AS.EPSILON*Math.max(1,Math.abs(s),Math.abs(u))&&Math.abs(a-_)<=AS.EPSILON*Math.max(1,Math.abs(a),Math.abs(_))}var MQs=oQt.mul=tQt,wQs=oQt.sub=nQt});var iWe=pt(function(hQt){function rWe(e){return rWe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rWe(e)}Object.defineProperty(hQt,"__esModule",{value:!0});hQt.add=crr;hQt.adjoint=jor;hQt.clone=Oor;hQt.copy=Vor;hQt.create=For;hQt.determinant=Kor;hQt.equals=urr;hQt.exactEquals=drr;hQt.frob=arr;hQt.fromMat2d=nrr;hQt.fromMat4=zor;hQt.fromQuat=orr;hQt.fromRotation=err;hQt.fromScaling=trr;hQt.fromTranslation=Zor;hQt.fromValues=Yor;hQt.identity=Uor;hQt.invert=Xor;hQt.mul=void 0;hQt.multiply=cQt;hQt.multiplyScalar=lrr;hQt.multiplyScalarAndAdd=hrr;hQt.normalFromMat4=rrr;hQt.projection=irr;hQt.rotate=qor;hQt.scale=Jor;hQt.set=Gor;hQt.str=srr;hQt.sub=void 0;hQt.subtract=lQt;hQt.translate=$or;hQt.transpose=Wor;var S3=aQt(W9());function aQt(e,t){if(typeof WeakMap=="function")var n=new WeakMap,o=new WeakMap;return(aQt=function(i,s){if(!s&&i&&i.__esModule)return i;var a,c,l={__proto__:null,default:i};if(i===null||rWe(i)!="object"&&typeof i!="function")return l;if(a=s?o:n){if(a.has(i))return a.get(i);a.set(i,l)}for(var h in i)h!=="default"&&{}.hasOwnProperty.call(i,h)&&((c=(a=Object.defineProperty)&&Object.getOwnPropertyDescriptor(i,h))&&(c.get||c.set)?a(l,h,c):l[h]=i[h]);return l})(e,t)}function For(){var e=new S3.ARRAY_TYPE(9);if(S3.ARRAY_TYPE!=Float32Array)e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0;return e[0]=1,e[4]=1,e[8]=1,e}function zor(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}function Oor(e){var t=new S3.ARRAY_TYPE(9);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function Vor(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function Yor(e,t,n,o,r,i,s,a,c){var l=new S3.ARRAY_TYPE(9);return l[0]=e,l[1]=t,l[2]=n,l[3]=o,l[4]=r,l[5]=i,l[6]=s,l[7]=a,l[8]=c,l}function Gor(e,t,n,o,r,i,s,a,c,l){return e[0]=t,e[1]=n,e[2]=o,e[3]=r,e[4]=i,e[5]=s,e[6]=a,e[7]=c,e[8]=l,e}function Uor(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function Wor(e,t){if(e===t){var n=t[1],o=t[2],r=t[5];e[1]=t[3],e[2]=t[6],e[3]=n,e[5]=t[7],e[6]=o,e[7]=r}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}function Xor(e,t){var n=t[0],o=t[1],r=t[2],i=t[3],s=t[4],a=t[5],c=t[6],l=t[7],h=t[8],d=h*s-a*l,u=-h*i+a*c,_=l*i-s*c,p=n*d+o*u+r*_;if(!p)return null;return p=1/p,e[0]=d*p,e[1]=(-h*o+r*l)*p,e[2]=(a*o-r*s)*p,e[3]=u*p,e[4]=(h*n-r*c)*p,e[5]=(-a*n+r*i)*p,e[6]=_*p,e[7]=(-l*n+o*c)*p,e[8]=(s*n-o*i)*p,e}function jor(e,t){var n=t[0],o=t[1],r=t[2],i=t[3],s=t[4],a=t[5],c=t[6],l=t[7],h=t[8];return e[0]=s*h-a*l,e[1]=r*l-o*h,e[2]=o*a-r*s,e[3]=a*c-i*h,e[4]=n*h-r*c,e[5]=r*i-n*a,e[6]=i*l-s*c,e[7]=o*c-n*l,e[8]=n*s-o*i,e}function Kor(e){var t=e[0],n=e[1],o=e[2],r=e[3],i=e[4],s=e[5],a=e[6],c=e[7],l=e[8];return t*(l*i-s*c)+n*(-l*r+s*a)+o*(c*r-i*a)}function cQt(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=t[4],c=t[5],l=t[6],h=t[7],d=t[8],u=n[0],_=n[1],p=n[2],m=n[3],A=n[4],g=n[5],f=n[6],y=n[7],x=n[8];return e[0]=u*o+_*s+p*l,e[1]=u*r+_*a+p*h,e[2]=u*i+_*c+p*d,e[3]=m*o+A*s+g*l,e[4]=m*r+A*a+g*h,e[5]=m*i+A*c+g*d,e[6]=f*o+y*s+x*l,e[7]=f*r+y*a+x*h,e[8]=f*i+y*c+x*d,e}function $or(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=t[4],c=t[5],l=t[6],h=t[7],d=t[8],u=n[0],_=n[1];return e[0]=o,e[1]=r,e[2]=i,e[3]=s,e[4]=a,e[5]=c,e[6]=u*o+_*s+l,e[7]=u*r+_*a+h,e[8]=u*i+_*c+d,e}function qor(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=t[4],c=t[5],l=t[6],h=t[7],d=t[8],u=Math.sin(n),_=Math.cos(n);return e[0]=_*o+u*s,e[1]=_*r+u*a,e[2]=_*i+u*c,e[3]=_*s-u*o,e[4]=_*a-u*r,e[5]=_*c-u*i,e[6]=l,e[7]=h,e[8]=d,e}function Jor(e,t,n){var o=n[0],r=n[1];return e[0]=o*t[0],e[1]=o*t[1],e[2]=o*t[2],e[3]=r*t[3],e[4]=r*t[4],e[5]=r*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function Zor(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e}function err(e,t){var n=Math.sin(t),o=Math.cos(t);return e[0]=o,e[1]=n,e[2]=0,e[3]=-n,e[4]=o,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function trr(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function nrr(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e}function orr(e,t){var n=t[0],o=t[1],r=t[2],i=t[3],s=n+n,a=o+o,c=r+r,l=n*s,h=o*s,d=o*a,u=r*s,_=r*a,p=r*c,m=i*s,A=i*a,g=i*c;return e[0]=1-d-p,e[3]=h-g,e[6]=u+A,e[1]=h+g,e[4]=1-l-p,e[7]=_-m,e[2]=u-A,e[5]=_+m,e[8]=1-l-d,e}function rrr(e,t){var n=t[0],o=t[1],r=t[2],i=t[3],s=t[4],a=t[5],c=t[6],l=t[7],h=t[8],d=t[9],u=t[10],_=t[11],p=t[12],m=t[13],A=t[14],g=t[15],f=n*a-o*s,y=n*c-r*s,x=n*l-i*s,C=o*c-r*a,b=o*l-i*a,I=r*l-i*c,v=h*m-d*p,P=h*A-u*p,M=h*g-_*p,B=d*A-u*m,T=d*g-_*m,N=u*g-_*A,D=f*N-y*T+x*B+C*M-b*P+I*v;if(!D)return null;return D=1/D,e[0]=(a*N-c*T+l*B)*D,e[1]=(c*M-s*N-l*P)*D,e[2]=(s*T-a*M+l*v)*D,e[3]=(r*T-o*N-i*B)*D,e[4]=(n*N-r*M+i*P)*D,e[5]=(o*M-n*T-i*v)*D,e[6]=(m*I-A*b+g*C)*D,e[7]=(A*x-p*I-g*y)*D,e[8]=(p*b-m*x+g*f)*D,e}function irr(e,t,n){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/n,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}function srr(e){return"mat3("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+")"}function arr(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8])}function crr(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e}function lQt(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e}function lrr(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e}function hrr(e,t,n,o){return e[0]=t[0]+n[0]*o,e[1]=t[1]+n[1]*o,e[2]=t[2]+n[2]*o,e[3]=t[3]+n[3]*o,e[4]=t[4]+n[4]*o,e[5]=t[5]+n[5]*o,e[6]=t[6]+n[6]*o,e[7]=t[7]+n[7]*o,e[8]=t[8]+n[8]*o,e}function drr(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]}function urr(e,t){var n=e[0],o=e[1],r=e[2],i=e[3],s=e[4],a=e[5],c=e[6],l=e[7],h=e[8],d=t[0],u=t[1],_=t[2],p=t[3],m=t[4],A=t[5],g=t[6],f=t[7],y=t[8];return Math.abs(n-d)<=S3.EPSILON*Math.max(1,Math.abs(n),Math.abs(d))&&Math.abs(o-u)<=S3.EPSILON*Math.max(1,Math.abs(o),Math.abs(u))&&Math.abs(r-_)<=S3.EPSILON*Math.max(1,Math.abs(r),Math.abs(_))&&Math.abs(i-p)<=S3.EPSILON*Math.max(1,Math.abs(i),Math.abs(p))&&Math.abs(s-m)<=S3.EPSILON*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(a-A)<=S3.EPSILON*Math.max(1,Math.abs(a),Math.abs(A))&&Math.abs(c-g)<=S3.EPSILON*Math.max(1,Math.abs(c),Math.abs(g))&&Math.abs(l-f)<=S3.EPSILON*Math.max(1,Math.abs(l),Math.abs(f))&&Math.abs(h-y)<=S3.EPSILON*Math.max(1,Math.abs(h),Math.abs(y))}var TQs=hQt.mul=cQt,DQs=hQt.sub=lQt});var aWe=pt(function(CQt){function sWe(e){return sWe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sWe(e)}Object.defineProperty(CQt,"__esModule",{value:!0});CQt.add=Sir;CQt.adjoint=$rr;CQt.clone=Grr;CQt.copy=Urr;CQt.create=Yrr;CQt.decompose=pir;CQt.determinant=qrr;CQt.equals=wir;CQt.exactEquals=Mir;CQt.frob=vir;CQt.fromQuat=gir;CQt.fromQuat2=hir;CQt.fromRotation=sir;CQt.fromRotationTranslation=gQt;CQt.fromRotationTranslationScale=mir;CQt.fromRotationTranslationScaleOrigin=_ir;CQt.fromScaling=iir;CQt.fromTranslation=rir;CQt.fromValues=Wrr;CQt.fromXRotation=air;CQt.fromYRotation=cir;CQt.fromZRotation=lir;CQt.frustum=Air;CQt.getRotation=uir;CQt.getScaling=AQt;CQt.getTranslation=dir;CQt.identity=mQt;CQt.invert=Krr;CQt.lookAt=Cir;CQt.mul=void 0;CQt.multiply=_Qt;CQt.multiplyScalar=Pir;CQt.multiplyScalarAndAdd=Eir;CQt.ortho=void 0;CQt.orthoNO=yQt;CQt.orthoZO=xir;CQt.perspective=void 0;CQt.perspectiveFromFieldOfView=yir;CQt.perspectiveNO=fQt;CQt.perspectiveZO=fir;CQt.rotate=eir;CQt.rotateX=tir;CQt.rotateY=nir;CQt.rotateZ=oir;CQt.scale=Zrr;CQt.set=Xrr;CQt.str=Iir;CQt.sub=void 0;CQt.subtract=xQt;CQt.targetTo=bir;CQt.translate=Jrr;CQt.transpose=jrr;var eu=pQt(W9());function pQt(e,t){if(typeof WeakMap=="function")var n=new WeakMap,o=new WeakMap;return(pQt=function(i,s){if(!s&&i&&i.__esModule)return i;var a,c,l={__proto__:null,default:i};if(i===null||sWe(i)!="object"&&typeof i!="function")return l;if(a=s?o:n){if(a.has(i))return a.get(i);a.set(i,l)}for(var h in i)h!=="default"&&{}.hasOwnProperty.call(i,h)&&((c=(a=Object.defineProperty)&&Object.getOwnPropertyDescriptor(i,h))&&(c.get||c.set)?a(l,h,c):l[h]=i[h]);return l})(e,t)}function Yrr(){var e=new eu.ARRAY_TYPE(16);if(eu.ARRAY_TYPE!=Float32Array)e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0;return e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function Grr(e){var t=new eu.ARRAY_TYPE(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Urr(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function Wrr(e,t,n,o,r,i,s,a,c,l,h,d,u,_,p,m){var A=new eu.ARRAY_TYPE(16);return A[0]=e,A[1]=t,A[2]=n,A[3]=o,A[4]=r,A[5]=i,A[6]=s,A[7]=a,A[8]=c,A[9]=l,A[10]=h,A[11]=d,A[12]=u,A[13]=_,A[14]=p,A[15]=m,A}function Xrr(e,t,n,o,r,i,s,a,c,l,h,d,u,_,p,m,A){return e[0]=t,e[1]=n,e[2]=o,e[3]=r,e[4]=i,e[5]=s,e[6]=a,e[7]=c,e[8]=l,e[9]=h,e[10]=d,e[11]=u,e[12]=_,e[13]=p,e[14]=m,e[15]=A,e}function mQt(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function jrr(e,t){if(e===t){var n=t[1],o=t[2],r=t[3],i=t[6],s=t[7],a=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=o,e[9]=i,e[11]=t[14],e[12]=r,e[13]=s,e[14]=a}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}function Krr(e,t){var n=t[0],o=t[1],r=t[2],i=t[3],s=t[4],a=t[5],c=t[6],l=t[7],h=t[8],d=t[9],u=t[10],_=t[11],p=t[12],m=t[13],A=t[14],g=t[15],f=n*a-o*s,y=n*c-r*s,x=n*l-i*s,C=o*c-r*a,b=o*l-i*a,I=r*l-i*c,v=h*m-d*p,P=h*A-u*p,M=h*g-_*p,B=d*A-u*m,T=d*g-_*m,N=u*g-_*A,D=f*N-y*T+x*B+C*M-b*P+I*v;if(!D)return null;return D=1/D,e[0]=(a*N-c*T+l*B)*D,e[1]=(r*T-o*N-i*B)*D,e[2]=(m*I-A*b+g*C)*D,e[3]=(u*b-d*I-_*C)*D,e[4]=(c*M-s*N-l*P)*D,e[5]=(n*N-r*M+i*P)*D,e[6]=(A*x-p*I-g*y)*D,e[7]=(h*I-u*x+_*y)*D,e[8]=(s*T-a*M+l*v)*D,e[9]=(o*M-n*T-i*v)*D,e[10]=(p*b-m*x+g*f)*D,e[11]=(d*x-h*b-_*f)*D,e[12]=(a*P-s*B-c*v)*D,e[13]=(n*B-o*P+r*v)*D,e[14]=(m*y-p*C-A*f)*D,e[15]=(h*C-d*y+u*f)*D,e}function $rr(e,t){var n=t[0],o=t[1],r=t[2],i=t[3],s=t[4],a=t[5],c=t[6],l=t[7],h=t[8],d=t[9],u=t[10],_=t[11],p=t[12],m=t[13],A=t[14],g=t[15],f=n*a-o*s,y=n*c-r*s,x=n*l-i*s,C=o*c-r*a,b=o*l-i*a,I=r*l-i*c,v=h*m-d*p,P=h*A-u*p,M=h*g-_*p,B=d*A-u*m,T=d*g-_*m,N=u*g-_*A;return e[0]=a*N-c*T+l*B,e[1]=r*T-o*N-i*B,e[2]=m*I-A*b+g*C,e[3]=u*b-d*I-_*C,e[4]=c*M-s*N-l*P,e[5]=n*N-r*M+i*P,e[6]=A*x-p*I-g*y,e[7]=h*I-u*x+_*y,e[8]=s*T-a*M+l*v,e[9]=o*M-n*T-i*v,e[10]=p*b-m*x+g*f,e[11]=d*x-h*b-_*f,e[12]=a*P-s*B-c*v,e[13]=n*B-o*P+r*v,e[14]=m*y-p*C-A*f,e[15]=h*C-d*y+u*f,e}function qrr(e){var t=e[0],n=e[1],o=e[2],r=e[3],i=e[4],s=e[5],a=e[6],c=e[7],l=e[8],h=e[9],d=e[10],u=e[11],_=e[12],p=e[13],m=e[14],A=e[15],g=t*s-n*i,f=t*a-o*i,y=n*a-o*s,x=l*p-h*_,C=l*m-d*_,b=h*m-d*p,I=t*b-n*C+o*x,v=i*b-s*C+a*x,P=l*y-h*f+d*g,M=_*y-p*f+m*g;return c*I-r*v+A*P-u*M}function _Qt(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=t[4],c=t[5],l=t[6],h=t[7],d=t[8],u=t[9],_=t[10],p=t[11],m=t[12],A=t[13],g=t[14],f=t[15],y=n[0],x=n[1],C=n[2],b=n[3];return e[0]=y*o+x*a+C*d+b*m,e[1]=y*r+x*c+C*u+b*A,e[2]=y*i+x*l+C*_+b*g,e[3]=y*s+x*h+C*p+b*f,y=n[4],x=n[5],C=n[6],b=n[7],e[4]=y*o+x*a+C*d+b*m,e[5]=y*r+x*c+C*u+b*A,e[6]=y*i+x*l+C*_+b*g,e[7]=y*s+x*h+C*p+b*f,y=n[8],x=n[9],C=n[10],b=n[11],e[8]=y*o+x*a+C*d+b*m,e[9]=y*r+x*c+C*u+b*A,e[10]=y*i+x*l+C*_+b*g,e[11]=y*s+x*h+C*p+b*f,y=n[12],x=n[13],C=n[14],b=n[15],e[12]=y*o+x*a+C*d+b*m,e[13]=y*r+x*c+C*u+b*A,e[14]=y*i+x*l+C*_+b*g,e[15]=y*s+x*h+C*p+b*f,e}function Jrr(e,t,n){var o=n[0],r=n[1],i=n[2],s,a,c,l,h,d,u,_,p,m,A,g;if(t===e)e[12]=t[0]*o+t[4]*r+t[8]*i+t[12],e[13]=t[1]*o+t[5]*r+t[9]*i+t[13],e[14]=t[2]*o+t[6]*r+t[10]*i+t[14],e[15]=t[3]*o+t[7]*r+t[11]*i+t[15];else s=t[0],a=t[1],c=t[2],l=t[3],h=t[4],d=t[5],u=t[6],_=t[7],p=t[8],m=t[9],A=t[10],g=t[11],e[0]=s,e[1]=a,e[2]=c,e[3]=l,e[4]=h,e[5]=d,e[6]=u,e[7]=_,e[8]=p,e[9]=m,e[10]=A,e[11]=g,e[12]=s*o+h*r+p*i+t[12],e[13]=a*o+d*r+m*i+t[13],e[14]=c*o+u*r+A*i+t[14],e[15]=l*o+_*r+g*i+t[15];return e}function Zrr(e,t,n){var o=n[0],r=n[1],i=n[2];return e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e[3]=t[3]*o,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*i,e[9]=t[9]*i,e[10]=t[10]*i,e[11]=t[11]*i,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function eir(e,t,n,o){var r=o[0],i=o[1],s=o[2],a=Math.sqrt(r*r+i*i+s*s),c,l,h,d,u,_,p,m,A,g,f,y,x,C,b,I,v,P,M,B,T,N,D,L;if(a<eu.EPSILON)return null;if(a=1/a,r*=a,i*=a,s*=a,c=Math.sin(n),l=Math.cos(n),h=1-l,d=t[0],u=t[1],_=t[2],p=t[3],m=t[4],A=t[5],g=t[6],f=t[7],y=t[8],x=t[9],C=t[10],b=t[11],I=r*r*h+l,v=i*r*h+s*c,P=s*r*h-i*c,M=r*i*h-s*c,B=i*i*h+l,T=s*i*h+r*c,N=r*s*h+i*c,D=i*s*h-r*c,L=s*s*h+l,e[0]=d*I+m*v+y*P,e[1]=u*I+A*v+x*P,e[2]=_*I+g*v+C*P,e[3]=p*I+f*v+b*P,e[4]=d*M+m*B+y*T,e[5]=u*M+A*B+x*T,e[6]=_*M+g*B+C*T,e[7]=p*M+f*B+b*T,e[8]=d*N+m*D+y*L,e[9]=u*N+A*D+x*L,e[10]=_*N+g*D+C*L,e[11]=p*N+f*D+b*L,t!==e)e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15];return e}function tir(e,t,n){var o=Math.sin(n),r=Math.cos(n),i=t[4],s=t[5],a=t[6],c=t[7],l=t[8],h=t[9],d=t[10],u=t[11];if(t!==e)e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15];return e[4]=i*r+l*o,e[5]=s*r+h*o,e[6]=a*r+d*o,e[7]=c*r+u*o,e[8]=l*r-i*o,e[9]=h*r-s*o,e[10]=d*r-a*o,e[11]=u*r-c*o,e}function nir(e,t,n){var o=Math.sin(n),r=Math.cos(n),i=t[0],s=t[1],a=t[2],c=t[3],l=t[8],h=t[9],d=t[10],u=t[11];if(t!==e)e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15];return e[0]=i*r-l*o,e[1]=s*r-h*o,e[2]=a*r-d*o,e[3]=c*r-u*o,e[8]=i*o+l*r,e[9]=s*o+h*r,e[10]=a*o+d*r,e[11]=c*o+u*r,e}function oir(e,t,n){var o=Math.sin(n),r=Math.cos(n),i=t[0],s=t[1],a=t[2],c=t[3],l=t[4],h=t[5],d=t[6],u=t[7];if(t!==e)e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15];return e[0]=i*r+l*o,e[1]=s*r+h*o,e[2]=a*r+d*o,e[3]=c*r+u*o,e[4]=l*r-i*o,e[5]=h*r-s*o,e[6]=d*r-a*o,e[7]=u*r-c*o,e}function rir(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}function iir(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function sir(e,t,n){var o=n[0],r=n[1],i=n[2],s=Math.sqrt(o*o+r*r+i*i),a,c,l;if(s<eu.EPSILON)return null;return s=1/s,o*=s,r*=s,i*=s,a=Math.sin(t),c=Math.cos(t),l=1-c,e[0]=o*o*l+c,e[1]=r*o*l+i*a,e[2]=i*o*l-r*a,e[3]=0,e[4]=o*r*l-i*a,e[5]=r*r*l+c,e[6]=i*r*l+o*a,e[7]=0,e[8]=o*i*l+r*a,e[9]=r*i*l-o*a,e[10]=i*i*l+c,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function air(e,t){var n=Math.sin(t),o=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=n,e[7]=0,e[8]=0,e[9]=-n,e[10]=o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function cir(e,t){var n=Math.sin(t),o=Math.cos(t);return e[0]=o,e[1]=0,e[2]=-n,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=n,e[9]=0,e[10]=o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function lir(e,t){var n=Math.sin(t),o=Math.cos(t);return e[0]=o,e[1]=n,e[2]=0,e[3]=0,e[4]=-n,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function gQt(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=o+o,c=r+r,l=i+i,h=o*a,d=o*c,u=o*l,_=r*c,p=r*l,m=i*l,A=s*a,g=s*c,f=s*l;return e[0]=1-(_+m),e[1]=d+f,e[2]=u-g,e[3]=0,e[4]=d-f,e[5]=1-(h+m),e[6]=p+A,e[7]=0,e[8]=u+g,e[9]=p-A,e[10]=1-(h+_),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}function hir(e,t){var n=new eu.ARRAY_TYPE(3),o=-t[0],r=-t[1],i=-t[2],s=t[3],a=t[4],c=t[5],l=t[6],h=t[7],d=o*o+r*r+i*i+s*s;if(d>0)n[0]=(a*s+h*o+c*i-l*r)*2/d,n[1]=(c*s+h*r+l*o-a*i)*2/d,n[2]=(l*s+h*i+a*r-c*o)*2/d;else n[0]=(a*s+h*o+c*i-l*r)*2,n[1]=(c*s+h*r+l*o-a*i)*2,n[2]=(l*s+h*i+a*r-c*o)*2;return gQt(e,t,n),e}function dir(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function AQt(e,t){var n=t[0],o=t[1],r=t[2],i=t[4],s=t[5],a=t[6],c=t[8],l=t[9],h=t[10];return e[0]=Math.sqrt(n*n+o*o+r*r),e[1]=Math.sqrt(i*i+s*s+a*a),e[2]=Math.sqrt(c*c+l*l+h*h),e}function uir(e,t){var n=new eu.ARRAY_TYPE(3);AQt(n,t);var o=1/n[0],r=1/n[1],i=1/n[2],s=t[0]*o,a=t[1]*r,c=t[2]*i,l=t[4]*o,h=t[5]*r,d=t[6]*i,u=t[8]*o,_=t[9]*r,p=t[10]*i,m=s+h+p,A=0;if(m>0)A=Math.sqrt(m+1)*2,e[3]=0.25*A,e[0]=(d-_)/A,e[1]=(u-c)/A,e[2]=(a-l)/A;else if(s>h&&s>p)A=Math.sqrt(1+s-h-p)*2,e[3]=(d-_)/A,e[0]=0.25*A,e[1]=(a+l)/A,e[2]=(u+c)/A;else if(h>p)A=Math.sqrt(1+h-s-p)*2,e[3]=(u-c)/A,e[0]=(a+l)/A,e[1]=0.25*A,e[2]=(d+_)/A;else A=Math.sqrt(1+p-s-h)*2,e[3]=(a-l)/A,e[0]=(u+c)/A,e[1]=(d+_)/A,e[2]=0.25*A;return e}function pir(e,t,n,o){t[0]=o[12],t[1]=o[13],t[2]=o[14];var r=o[0],i=o[1],s=o[2],a=o[4],c=o[5],l=o[6],h=o[8],d=o[9],u=o[10];n[0]=Math.sqrt(r*r+i*i+s*s),n[1]=Math.sqrt(a*a+c*c+l*l),n[2]=Math.sqrt(h*h+d*d+u*u);var _=1/n[0],p=1/n[1],m=1/n[2],A=r*_,g=i*p,f=s*m,y=a*_,x=c*p,C=l*m,b=h*_,I=d*p,v=u*m,P=A+x+v,M=0;if(P>0)M=Math.sqrt(P+1)*2,e[3]=0.25*M,e[0]=(C-I)/M,e[1]=(b-f)/M,e[2]=(g-y)/M;else if(A>x&&A>v)M=Math.sqrt(1+A-x-v)*2,e[3]=(C-I)/M,e[0]=0.25*M,e[1]=(g+y)/M,e[2]=(b+f)/M;else if(x>v)M=Math.sqrt(1+x-A-v)*2,e[3]=(b-f)/M,e[0]=(g+y)/M,e[1]=0.25*M,e[2]=(C+I)/M;else M=Math.sqrt(1+v-A-x)*2,e[3]=(g-y)/M,e[0]=(b+f)/M,e[1]=(C+I)/M,e[2]=0.25*M;return e}function mir(e,t,n,o){var r=t[0],i=t[1],s=t[2],a=t[3],c=r+r,l=i+i,h=s+s,d=r*c,u=r*l,_=r*h,p=i*l,m=i*h,A=s*h,g=a*c,f=a*l,y=a*h,x=o[0],C=o[1],b=o[2];return e[0]=(1-(p+A))*x,e[1]=(u+y)*x,e[2]=(_-f)*x,e[3]=0,e[4]=(u-y)*C,e[5]=(1-(d+A))*C,e[6]=(m+g)*C,e[7]=0,e[8]=(_+f)*b,e[9]=(m-g)*b,e[10]=(1-(d+p))*b,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}function _ir(e,t,n,o,r){var i=t[0],s=t[1],a=t[2],c=t[3],l=i+i,h=s+s,d=a+a,u=i*l,_=i*h,p=i*d,m=s*h,A=s*d,g=a*d,f=c*l,y=c*h,x=c*d,C=o[0],b=o[1],I=o[2],v=r[0],P=r[1],M=r[2],B=(1-(m+g))*C,T=(_+x)*C,N=(p-y)*C,D=(_-x)*b,L=(1-(u+g))*b,H=(A+f)*b,V=(p+y)*I,O=(A-f)*I,U=(1-(u+m))*I;return e[0]=B,e[1]=T,e[2]=N,e[3]=0,e[4]=D,e[5]=L,e[6]=H,e[7]=0,e[8]=V,e[9]=O,e[10]=U,e[11]=0,e[12]=n[0]+v-(B*v+D*P+V*M),e[13]=n[1]+P-(T*v+L*P+O*M),e[14]=n[2]+M-(N*v+H*P+U*M),e[15]=1,e}function gir(e,t){var n=t[0],o=t[1],r=t[2],i=t[3],s=n+n,a=o+o,c=r+r,l=n*s,h=o*s,d=o*a,u=r*s,_=r*a,p=r*c,m=i*s,A=i*a,g=i*c;return e[0]=1-d-p,e[1]=h+g,e[2]=u-A,e[3]=0,e[4]=h-g,e[5]=1-l-p,e[6]=_+m,e[7]=0,e[8]=u+A,e[9]=_-m,e[10]=1-l-d,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Air(e,t,n,o,r,i,s){var a=1/(n-t),c=1/(r-o),l=1/(i-s);return e[0]=i*2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i*2*c,e[6]=0,e[7]=0,e[8]=(n+t)*a,e[9]=(r+o)*c,e[10]=(s+i)*l,e[11]=-1,e[12]=0,e[13]=0,e[14]=s*i*2*l,e[15]=0,e}function fQt(e,t,n,o,r){var i=1/Math.tan(t/2);if(e[0]=i/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){var s=1/(o-r);e[10]=(r+o)*s,e[14]=2*r*o*s}else e[10]=-1,e[14]=-2*o;return e}var RQs=CQt.perspective=fQt;function fir(e,t,n,o,r){var i=1/Math.tan(t/2);if(e[0]=i/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){var s=1/(o-r);e[10]=r*s,e[14]=r*o*s}else e[10]=-1,e[14]=-o;return e}function yir(e,t,n,o){var r=Math.tan(t.upDegrees*Math.PI/180),i=Math.tan(t.downDegrees*Math.PI/180),s=Math.tan(t.leftDegrees*Math.PI/180),a=Math.tan(t.rightDegrees*Math.PI/180),c=2/(s+a),l=2/(r+i);return e[0]=c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=l,e[6]=0,e[7]=0,e[8]=-((s-a)*c*0.5),e[9]=(r-i)*l*0.5,e[10]=o/(n-o),e[11]=-1,e[12]=0,e[13]=0,e[14]=o*n/(n-o),e[15]=0,e}function yQt(e,t,n,o,r,i,s){var a=1/(t-n),c=1/(o-r),l=1/(i-s);return e[0]=-2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*c,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*l,e[11]=0,e[12]=(t+n)*a,e[13]=(r+o)*c,e[14]=(s+i)*l,e[15]=1,e}var QQs=CQt.ortho=yQt;function xir(e,t,n,o,r,i,s){var a=1/(t-n),c=1/(o-r),l=1/(i-s);return e[0]=-2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*c,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=l,e[11]=0,e[12]=(t+n)*a,e[13]=(r+o)*c,e[14]=i*l,e[15]=1,e}function Cir(e,t,n,o){var r,i,s,a,c,l,h,d,u,_,p=t[0],m=t[1],A=t[2],g=o[0],f=o[1],y=o[2],x=n[0],C=n[1],b=n[2];if(Math.abs(p-x)<eu.EPSILON&&Math.abs(m-C)<eu.EPSILON&&Math.abs(A-b)<eu.EPSILON)return mQt(e);if(h=p-x,d=m-C,u=A-b,_=1/Math.sqrt(h*h+d*d+u*u),h*=_,d*=_,u*=_,r=f*u-y*d,i=y*h-g*u,s=g*d-f*h,_=Math.sqrt(r*r+i*i+s*s),!_)r=0,i=0,s=0;else _=1/_,r*=_,i*=_,s*=_;if(a=d*s-u*i,c=u*r-h*s,l=h*i-d*r,_=Math.sqrt(a*a+c*c+l*l),!_)a=0,c=0,l=0;else _=1/_,a*=_,c*=_,l*=_;return e[0]=r,e[1]=a,e[2]=h,e[3]=0,e[4]=i,e[5]=c,e[6]=d,e[7]=0,e[8]=s,e[9]=l,e[10]=u,e[11]=0,e[12]=-(r*p+i*m+s*A),e[13]=-(a*p+c*m+l*A),e[14]=-(h*p+d*m+u*A),e[15]=1,e}function bir(e,t,n,o){var r=t[0],i=t[1],s=t[2],a=o[0],c=o[1],l=o[2],h=r-n[0],d=i-n[1],u=s-n[2],_=h*h+d*d+u*u;if(_>0)_=1/Math.sqrt(_),h*=_,d*=_,u*=_;var p=c*u-l*d,m=l*h-a*u,A=a*d-c*h;if(_=p*p+m*m+A*A,_>0)_=1/Math.sqrt(_),p*=_,m*=_,A*=_;return e[0]=p,e[1]=m,e[2]=A,e[3]=0,e[4]=d*A-u*m,e[5]=u*p-h*A,e[6]=h*m-d*p,e[7]=0,e[8]=h,e[9]=d,e[10]=u,e[11]=0,e[12]=r,e[13]=i,e[14]=s,e[15]=1,e}function Iir(e){return"mat4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+", "+e[9]+", "+e[10]+", "+e[11]+", "+e[12]+", "+e[13]+", "+e[14]+", "+e[15]+")"}function vir(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8]+e[9]*e[9]+e[10]*e[10]+e[11]*e[11]+e[12]*e[12]+e[13]*e[13]+e[14]*e[14]+e[15]*e[15])}function Sir(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e}function xQt(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e}function Pir(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12]*n,e[13]=t[13]*n,e[14]=t[14]*n,e[15]=t[15]*n,e}function Eir(e,t,n,o){return e[0]=t[0]+n[0]*o,e[1]=t[1]+n[1]*o,e[2]=t[2]+n[2]*o,e[3]=t[3]+n[3]*o,e[4]=t[4]+n[4]*o,e[5]=t[5]+n[5]*o,e[6]=t[6]+n[6]*o,e[7]=t[7]+n[7]*o,e[8]=t[8]+n[8]*o,e[9]=t[9]+n[9]*o,e[10]=t[10]+n[10]*o,e[11]=t[11]+n[11]*o,e[12]=t[12]+n[12]*o,e[13]=t[13]+n[13]*o,e[14]=t[14]+n[14]*o,e[15]=t[15]+n[15]*o,e}function Mir(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}function wir(e,t){var n=e[0],o=e[1],r=e[2],i=e[3],s=e[4],a=e[5],c=e[6],l=e[7],h=e[8],d=e[9],u=e[10],_=e[11],p=e[12],m=e[13],A=e[14],g=e[15],f=t[0],y=t[1],x=t[2],C=t[3],b=t[4],I=t[5],v=t[6],P=t[7],M=t[8],B=t[9],T=t[10],N=t[11],D=t[12],L=t[13],H=t[14],V=t[15];return Math.abs(n-f)<=eu.EPSILON*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(o-y)<=eu.EPSILON*Math.max(1,Math.abs(o),Math.abs(y))&&Math.abs(r-x)<=eu.EPSILON*Math.max(1,Math.abs(r),Math.abs(x))&&Math.abs(i-C)<=eu.EPSILON*Math.max(1,Math.abs(i),Math.abs(C))&&Math.abs(s-b)<=eu.EPSILON*Math.max(1,Math.abs(s),Math.abs(b))&&Math.abs(a-I)<=eu.EPSILON*Math.max(1,Math.abs(a),Math.abs(I))&&Math.abs(c-v)<=eu.EPSILON*Math.max(1,Math.abs(c),Math.abs(v))&&Math.abs(l-P)<=eu.EPSILON*Math.max(1,Math.abs(l),Math.abs(P))&&Math.abs(h-M)<=eu.EPSILON*Math.max(1,Math.abs(h),Math.abs(M))&&Math.abs(d-B)<=eu.EPSILON*Math.max(1,Math.abs(d),Math.abs(B))&&Math.abs(u-T)<=eu.EPSILON*Math.max(1,Math.abs(u),Math.abs(T))&&Math.abs(_-N)<=eu.EPSILON*Math.max(1,Math.abs(_),Math.abs(N))&&Math.abs(p-D)<=eu.EPSILON*Math.max(1,Math.abs(p),Math.abs(D))&&Math.abs(m-L)<=eu.EPSILON*Math.max(1,Math.abs(m),Math.abs(L))&&Math.abs(A-H)<=eu.EPSILON*Math.max(1,Math.abs(A),Math.abs(H))&&Math.abs(g-V)<=eu.EPSILON*Math.max(1,Math.abs(g),Math.abs(V))}var kQs=CQt.mul=_Qt,LQs=CQt.sub=xQt});var hWe=pt(function(QQt){function cWe(e){return cWe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cWe(e)}Object.defineProperty(QQt,"__esModule",{value:!0});QQt.add=Msr;QQt.angle=qsr;QQt.bezier=Ysr;QQt.ceil=wsr;QQt.clone=vsr;QQt.copy=Psr;QQt.create=EQt;QQt.cross=Fsr;QQt.dist=void 0;QQt.distance=DQt;QQt.div=void 0;QQt.divide=TQt;QQt.dot=lWe;QQt.equals=tar;QQt.exactEquals=ear;QQt.floor=Bsr;QQt.forEach=void 0;QQt.fromValues=Ssr;QQt.hermite=Vsr;QQt.inverse=Lsr;QQt.len=void 0;QQt.length=MQt;QQt.lerp=zsr;QQt.max=Dsr;QQt.min=Tsr;QQt.mul=void 0;QQt.multiply=BQt;QQt.negate=ksr;QQt.normalize=Hsr;QQt.random=Gsr;QQt.rotateX=jsr;QQt.rotateY=Ksr;QQt.rotateZ=$sr;QQt.round=Nsr;QQt.scale=Rsr;QQt.scaleAndAdd=Qsr;QQt.set=Esr;QQt.slerp=Osr;QQt.sqrLen=QQt.sqrDist=void 0;QQt.squaredDistance=NQt;QQt.squaredLength=RQt;QQt.str=Zsr;QQt.sub=void 0;QQt.subtract=wQt;QQt.transformMat3=Wsr;QQt.transformMat4=Usr;QQt.transformQuat=Xsr;QQt.zero=Jsr;var zb=PQt(W9());function PQt(e,t){if(typeof WeakMap=="function")var n=new WeakMap,o=new WeakMap;return(PQt=function(i,s){if(!s&&i&&i.__esModule)return i;var a,c,l={__proto__:null,default:i};if(i===null||cWe(i)!="object"&&typeof i!="function")return l;if(a=s?o:n){if(a.has(i))return a.get(i);a.set(i,l)}for(var h in i)h!=="default"&&{}.hasOwnProperty.call(i,h)&&((c=(a=Object.defineProperty)&&Object.getOwnPropertyDescriptor(i,h))&&(c.get||c.set)?a(l,h,c):l[h]=i[h]);return l})(e,t)}function EQt(){var e=new zb.ARRAY_TYPE(3);if(zb.ARRAY_TYPE!=Float32Array)e[0]=0,e[1]=0,e[2]=0;return e}function vsr(e){var t=new zb.ARRAY_TYPE(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function MQt(e){var t=e[0],n=e[1],o=e[2];return Math.sqrt(t*t+n*n+o*o)}function Ssr(e,t,n){var o=new zb.ARRAY_TYPE(3);return o[0]=e,o[1]=t,o[2]=n,o}function Psr(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function Esr(e,t,n,o){return e[0]=t,e[1]=n,e[2]=o,e}function Msr(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}function wQt(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}function BQt(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}function TQt(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e}function wsr(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}function Bsr(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}function Tsr(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e}function Dsr(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e}function Nsr(e,t){return e[0]=zb.round(t[0]),e[1]=zb.round(t[1]),e[2]=zb.round(t[2]),e}function Rsr(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}function Qsr(e,t,n,o){return e[0]=t[0]+n[0]*o,e[1]=t[1]+n[1]*o,e[2]=t[2]+n[2]*o,e}function DQt(e,t){var n=t[0]-e[0],o=t[1]-e[1],r=t[2]-e[2];return Math.sqrt(n*n+o*o+r*r)}function NQt(e,t){var n=t[0]-e[0],o=t[1]-e[1],r=t[2]-e[2];return n*n+o*o+r*r}function RQt(e){var t=e[0],n=e[1],o=e[2];return t*t+n*n+o*o}function ksr(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function Lsr(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}function Hsr(e,t){var n=t[0],o=t[1],r=t[2],i=n*n+o*o+r*r;if(i>0)i=1/Math.sqrt(i);return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e}function lWe(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Fsr(e,t,n){var o=t[0],r=t[1],i=t[2],s=n[0],a=n[1],c=n[2];return e[0]=r*c-i*a,e[1]=i*s-o*c,e[2]=o*a-r*s,e}function zsr(e,t,n,o){var r=t[0],i=t[1],s=t[2];return e[0]=r+o*(n[0]-r),e[1]=i+o*(n[1]-i),e[2]=s+o*(n[2]-s),e}function Osr(e,t,n,o){var r=Math.acos(Math.min(Math.max(lWe(t,n),-1),1)),i=Math.sin(r),s=Math.sin((1-o)*r)/i,a=Math.sin(o*r)/i;return e[0]=s*t[0]+a*n[0],e[1]=s*t[1]+a*n[1],e[2]=s*t[2]+a*n[2],e}function Vsr(e,t,n,o,r,i){var s=i*i,a=s*(2*i-3)+1,c=s*(i-2)+i,l=s*(i-1),h=s*(3-2*i);return e[0]=t[0]*a+n[0]*c+o[0]*l+r[0]*h,e[1]=t[1]*a+n[1]*c+o[1]*l+r[1]*h,e[2]=t[2]*a+n[2]*c+o[2]*l+r[2]*h,e}function Ysr(e,t,n,o,r,i){var s=1-i,a=s*s,c=i*i,l=a*s,h=3*i*a,d=3*c*s,u=c*i;return e[0]=t[0]*l+n[0]*h+o[0]*d+r[0]*u,e[1]=t[1]*l+n[1]*h+o[1]*d+r[1]*u,e[2]=t[2]*l+n[2]*h+o[2]*d+r[2]*u,e}function Gsr(e,t){t=t===void 0?1:t;var n=zb.RANDOM()*2*Math.PI,o=zb.RANDOM()*2-1,r=Math.sqrt(1-o*o)*t;return e[0]=Math.cos(n)*r,e[1]=Math.sin(n)*r,e[2]=o*t,e}function Usr(e,t,n){var o=t[0],r=t[1],i=t[2],s=n[3]*o+n[7]*r+n[11]*i+n[15];return s=s||1,e[0]=(n[0]*o+n[4]*r+n[8]*i+n[12])/s,e[1]=(n[1]*o+n[5]*r+n[9]*i+n[13])/s,e[2]=(n[2]*o+n[6]*r+n[10]*i+n[14])/s,e}function Wsr(e,t,n){var o=t[0],r=t[1],i=t[2];return e[0]=o*n[0]+r*n[3]+i*n[6],e[1]=o*n[1]+r*n[4]+i*n[7],e[2]=o*n[2]+r*n[5]+i*n[8],e}function Xsr(e,t,n){var o=n[0],r=n[1],i=n[2],s=n[3],a=t[0],c=t[1],l=t[2],h=r*l-i*c,d=i*a-o*l,u=o*c-r*a;return h=h+h,d=d+d,u=u+u,e[0]=a+s*h+r*u-i*d,e[1]=c+s*d+i*h-o*u,e[2]=l+s*u+o*d-r*h,e}function jsr(e,t,n,o){var r=[],i=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],i[0]=r[0],i[1]=r[1]*Math.cos(o)-r[2]*Math.sin(o),i[2]=r[1]*Math.sin(o)+r[2]*Math.cos(o),e[0]=i[0]+n[0],e[1]=i[1]+n[1],e[2]=i[2]+n[2],e}function Ksr(e,t,n,o){var r=[],i=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],i[0]=r[2]*Math.sin(o)+r[0]*Math.cos(o),i[1]=r[1],i[2]=r[2]*Math.cos(o)-r[0]*Math.sin(o),e[0]=i[0]+n[0],e[1]=i[1]+n[1],e[2]=i[2]+n[2],e}function $sr(e,t,n,o){var r=[],i=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],i[0]=r[0]*Math.cos(o)-r[1]*Math.sin(o),i[1]=r[0]*Math.sin(o)+r[1]*Math.cos(o),i[2]=r[2],e[0]=i[0]+n[0],e[1]=i[1]+n[1],e[2]=i[2]+n[2],e}function qsr(e,t){var n=e[0],o=e[1],r=e[2],i=t[0],s=t[1],a=t[2],c=Math.sqrt((n*n+o*o+r*r)*(i*i+s*s+a*a)),l=c&&lWe(e,t)/c;return Math.acos(Math.min(Math.max(l,-1),1))}function Jsr(e){return e[0]=0,e[1]=0,e[2]=0,e}function Zsr(e){return"vec3("+e[0]+", "+e[1]+", "+e[2]+")"}function ear(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function tar(e,t){var n=e[0],o=e[1],r=e[2],i=t[0],s=t[1],a=t[2];return Math.abs(n-i)<=zb.EPSILON*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(o-s)<=zb.EPSILON*Math.max(1,Math.abs(o),Math.abs(s))&&Math.abs(r-a)<=zb.EPSILON*Math.max(1,Math.abs(r),Math.abs(a))}var FQs=QQt.sub=wQt,zQs=QQt.mul=BQt,OQs=QQt.div=TQt,VQs=QQt.dist=DQt,YQs=QQt.sqrDist=NQt,GQs=QQt.len=MQt,UQs=QQt.sqrLen=RQt,WQs=QQt.forEach=function(){var e=EQt();return function(t,n,o,r,i,s){var a,c;if(!n)n=3;if(!o)o=0;if(r)c=Math.min(r*n+o,t.length);else c=t.length;for(a=o;a<c;a+=n)e[0]=t[a],e[1]=t[a+1],e[2]=t[a+2],i(e,e,s),t[a]=e[0],t[a+1]=e[1],t[a+2]=e[2];return t}}()});var uWe=pt(function(JQt){function dWe(e){return dWe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dWe(e)}Object.defineProperty(JQt,"__esModule",{value:!0});JQt.add=Kar;JQt.ceil=$ar;JQt.clone=Uar;JQt.copy=Xar;JQt.create=GQt;JQt.cross=acr;JQt.dist=void 0;JQt.distance=jQt;JQt.div=void 0;JQt.divide=XQt;JQt.dot=scr;JQt.equals=_cr;JQt.exactEquals=mcr;JQt.floor=qar;JQt.forEach=void 0;JQt.fromValues=War;JQt.inverse=rcr;JQt.len=void 0;JQt.length=$Qt;JQt.lerp=ccr;JQt.max=Zar;JQt.min=Jar;JQt.mul=void 0;JQt.multiply=WQt;JQt.negate=ocr;JQt.normalize=icr;JQt.random=lcr;JQt.round=ecr;JQt.scale=tcr;JQt.scaleAndAdd=ncr;JQt.set=jar;JQt.sqrLen=JQt.sqrDist=void 0;JQt.squaredDistance=KQt;JQt.squaredLength=qQt;JQt.str=pcr;JQt.sub=void 0;JQt.subtract=UQt;JQt.transformMat4=hcr;JQt.transformQuat=dcr;JQt.zero=ucr;var _1=YQt(W9());function YQt(e,t){if(typeof WeakMap=="function")var n=new WeakMap,o=new WeakMap;return(YQt=function(i,s){if(!s&&i&&i.__esModule)return i;var a,c,l={__proto__:null,default:i};if(i===null||dWe(i)!="object"&&typeof i!="function")return l;if(a=s?o:n){if(a.has(i))return a.get(i);a.set(i,l)}for(var h in i)h!=="default"&&{}.hasOwnProperty.call(i,h)&&((c=(a=Object.defineProperty)&&Object.getOwnPropertyDescriptor(i,h))&&(c.get||c.set)?a(l,h,c):l[h]=i[h]);return l})(e,t)}function GQt(){var e=new _1.ARRAY_TYPE(4);if(_1.ARRAY_TYPE!=Float32Array)e[0]=0,e[1]=0,e[2]=0,e[3]=0;return e}function Uar(e){var t=new _1.ARRAY_TYPE(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function War(e,t,n,o){var r=new _1.ARRAY_TYPE(4);return r[0]=e,r[1]=t,r[2]=n,r[3]=o,r}function Xar(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function jar(e,t,n,o,r){return e[0]=t,e[1]=n,e[2]=o,e[3]=r,e}function Kar(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}function UQt(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}function WQt(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e}function XQt(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e[3]=t[3]/n[3],e}function $ar(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e}function qar(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e}function Jar(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e[3]=Math.min(t[3],n[3]),e}function Zar(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e[3]=Math.max(t[3],n[3]),e}function ecr(e,t){return e[0]=_1.round(t[0]),e[1]=_1.round(t[1]),e[2]=_1.round(t[2]),e[3]=_1.round(t[3]),e}function tcr(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}function ncr(e,t,n,o){return e[0]=t[0]+n[0]*o,e[1]=t[1]+n[1]*o,e[2]=t[2]+n[2]*o,e[3]=t[3]+n[3]*o,e}function jQt(e,t){var n=t[0]-e[0],o=t[1]-e[1],r=t[2]-e[2],i=t[3]-e[3];return Math.sqrt(n*n+o*o+r*r+i*i)}function KQt(e,t){var n=t[0]-e[0],o=t[1]-e[1],r=t[2]-e[2],i=t[3]-e[3];return n*n+o*o+r*r+i*i}function $Qt(e){var t=e[0],n=e[1],o=e[2],r=e[3];return Math.sqrt(t*t+n*n+o*o+r*r)}function qQt(e){var t=e[0],n=e[1],o=e[2],r=e[3];return t*t+n*n+o*o+r*r}function ocr(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e}function rcr(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}function icr(e,t){var n=t[0],o=t[1],r=t[2],i=t[3],s=n*n+o*o+r*r+i*i;if(s>0)s=1/Math.sqrt(s);return e[0]=n*s,e[1]=o*s,e[2]=r*s,e[3]=i*s,e}function scr(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function acr(e,t,n,o){var r=n[0]*o[1]-n[1]*o[0],i=n[0]*o[2]-n[2]*o[0],s=n[0]*o[3]-n[3]*o[0],a=n[1]*o[2]-n[2]*o[1],c=n[1]*o[3]-n[3]*o[1],l=n[2]*o[3]-n[3]*o[2],h=t[0],d=t[1],u=t[2],_=t[3];return e[0]=d*l-u*c+_*a,e[1]=-(h*l)+u*s-_*i,e[2]=h*c-d*s+_*r,e[3]=-(h*a)+d*i-u*r,e}function ccr(e,t,n,o){var r=t[0],i=t[1],s=t[2],a=t[3];return e[0]=r+o*(n[0]-r),e[1]=i+o*(n[1]-i),e[2]=s+o*(n[2]-s),e[3]=a+o*(n[3]-a),e}function lcr(e,t){t=t===void 0?1:t;var n,o,r,i,s,a,c;c=_1.RANDOM(),n=c*2-1,o=(4*_1.RANDOM()-2)*Math.sqrt(c*-c+c),s=n*n+o*o,c=_1.RANDOM(),r=c*2-1,i=(4*_1.RANDOM()-2)*Math.sqrt(c*-c+c),a=r*r+i*i;var l=Math.sqrt((1-s)/a);return e[0]=t*n,e[1]=t*o,e[2]=t*r*l,e[3]=t*i*l,e}function hcr(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3];return e[0]=n[0]*o+n[4]*r+n[8]*i+n[12]*s,e[1]=n[1]*o+n[5]*r+n[9]*i+n[13]*s,e[2]=n[2]*o+n[6]*r+n[10]*i+n[14]*s,e[3]=n[3]*o+n[7]*r+n[11]*i+n[15]*s,e}function dcr(e,t,n){var o=n[0],r=n[1],i=n[2],s=n[3],a=t[0],c=t[1],l=t[2],h=r*l-i*c,d=i*a-o*l,u=o*c-r*a;return h=h+h,d=d+d,u=u+u,e[0]=a+s*h+r*u-i*d,e[1]=c+s*d+i*h-o*u,e[2]=l+s*u+o*d-r*h,e[3]=t[3],e}function ucr(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}function pcr(e){return"vec4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}function mcr(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}function _cr(e,t){var n=e[0],o=e[1],r=e[2],i=e[3],s=t[0],a=t[1],c=t[2],l=t[3];return Math.abs(n-s)<=_1.EPSILON*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(o-a)<=_1.EPSILON*Math.max(1,Math.abs(o),Math.abs(a))&&Math.abs(r-c)<=_1.EPSILON*Math.max(1,Math.abs(r),Math.abs(c))&&Math.abs(i-l)<=_1.EPSILON*Math.max(1,Math.abs(i),Math.abs(l))}var jQs=JQt.sub=UQt,KQs=JQt.mul=WQt,$Qs=JQt.div=XQt,qQs=JQt.dist=jQt,JQs=JQt.sqrDist=KQt,ZQs=JQt.len=$Qt,eks=JQt.sqrLen=qQt,tks=JQt.forEach=function(){var e=GQt();return function(t,n,o,r,i,s){var a,c;if(!n)n=4;if(!o)o=0;if(r)c=Math.min(r*n+o,t.length);else c=t.length;for(a=o;a<c;a+=n)e[0]=t[a],e[1]=t[a+1],e[2]=t[a+2],e[3]=t[a+3],i(e,e,s),t[a]=e[0],t[a+1]=e[1],t[a+2]=e[2],t[a+3]=e[3];return t}}()});var _We=pt(function(ukt){function pWe(e){return pWe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pWe(e)}Object.defineProperty(ukt,"__esModule",{value:!0});ukt.add=void 0;ukt.calculateW=olr;ukt.clone=void 0;ukt.conjugate=alr;ukt.copy=void 0;ukt.create=mWe;ukt.dot=void 0;ukt.equals=mlr;ukt.exactEquals=void 0;ukt.exp=ckt;ukt.fromEuler=clr;ukt.fromMat3=hkt;ukt.fromValues=void 0;ukt.getAngle=Zcr;ukt.getAxisAngle=Jcr;ukt.identity=qcr;ukt.invert=slr;ukt.lerp=ukt.length=ukt.len=void 0;ukt.ln=lkt;ukt.mul=void 0;ukt.multiply=akt;ukt.normalize=void 0;ukt.pow=rlr;ukt.random=ilr;ukt.rotateX=elr;ukt.rotateY=tlr;ukt.rotateZ=nlr;ukt.setAxes=ukt.set=ukt.scale=ukt.rotationTo=void 0;ukt.setAxisAngle=skt;ukt.slerp=n4e;ukt.squaredLength=ukt.sqrLen=ukt.sqlerp=void 0;ukt.str=llr;var Xw=Aae(W9()),$cr=Aae(iWe()),Ww=Aae(hWe()),P3=Aae(uWe());function Aae(e,t){if(typeof WeakMap=="function")var n=new WeakMap,o=new WeakMap;return(Aae=function(i,s){if(!s&&i&&i.__esModule)return i;var a,c,l={__proto__:null,default:i};if(i===null||pWe(i)!="object"&&typeof i!="function")return l;if(a=s?o:n){if(a.has(i))return a.get(i);a.set(i,l)}for(var h in i)h!=="default"&&{}.hasOwnProperty.call(i,h)&&((c=(a=Object.defineProperty)&&Object.getOwnPropertyDescriptor(i,h))&&(c.get||c.set)?a(l,h,c):l[h]=i[h]);return l})(e,t)}function mWe(){var e=new Xw.ARRAY_TYPE(4);if(Xw.ARRAY_TYPE!=Float32Array)e[0]=0,e[1]=0,e[2]=0;return e[3]=1,e}function qcr(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function skt(e,t,n){n=n*0.5;var o=Math.sin(n);return e[0]=o*t[0],e[1]=o*t[1],e[2]=o*t[2],e[3]=Math.cos(n),e}function Jcr(e,t){var n=Math.acos(t[3])*2,o=Math.sin(n/2);if(o>Xw.EPSILON)e[0]=t[0]/o,e[1]=t[1]/o,e[2]=t[2]/o;else e[0]=1,e[1]=0,e[2]=0;return n}function Zcr(e,t){var n=dlr(e,t);return Math.acos(2*n*n-1)}function akt(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=n[0],c=n[1],l=n[2],h=n[3];return e[0]=o*h+s*a+r*l-i*c,e[1]=r*h+s*c+i*a-o*l,e[2]=i*h+s*l+o*c-r*a,e[3]=s*h-o*a-r*c-i*l,e}function elr(e,t,n){n*=0.5;var o=t[0],r=t[1],i=t[2],s=t[3],a=Math.sin(n),c=Math.cos(n);return e[0]=o*c+s*a,e[1]=r*c+i*a,e[2]=i*c-r*a,e[3]=s*c-o*a,e}function tlr(e,t,n){n*=0.5;var o=t[0],r=t[1],i=t[2],s=t[3],a=Math.sin(n),c=Math.cos(n);return e[0]=o*c-i*a,e[1]=r*c+s*a,e[2]=i*c+o*a,e[3]=s*c-r*a,e}function nlr(e,t,n){n*=0.5;var o=t[0],r=t[1],i=t[2],s=t[3],a=Math.sin(n),c=Math.cos(n);return e[0]=o*c+r*a,e[1]=r*c-o*a,e[2]=i*c+s*a,e[3]=s*c-i*a,e}function olr(e,t){var n=t[0],o=t[1],r=t[2];return e[0]=n,e[1]=o,e[2]=r,e[3]=Math.sqrt(Math.abs(1-n*n-o*o-r*r)),e}function ckt(e,t){var n=t[0],o=t[1],r=t[2],i=t[3],s=Math.sqrt(n*n+o*o+r*r),a=Math.exp(i),c=s>0?a*Math.sin(s)/s:0;return e[0]=n*c,e[1]=o*c,e[2]=r*c,e[3]=a*Math.cos(s),e}function lkt(e,t){var n=t[0],o=t[1],r=t[2],i=t[3],s=Math.sqrt(n*n+o*o+r*r),a=s>0?Math.atan2(s,i)/s:0;return e[0]=n*a,e[1]=o*a,e[2]=r*a,e[3]=0.5*Math.log(n*n+o*o+r*r+i*i),e}function rlr(e,t,n){return lkt(e,t),hlr(e,e,n),ckt(e,e),e}function n4e(e,t,n,o){var r=t[0],i=t[1],s=t[2],a=t[3],c=n[0],l=n[1],h=n[2],d=n[3],u,_,p,m,A;if(_=r*c+i*l+s*h+a*d,_<0)_=-_,c=-c,l=-l,h=-h,d=-d;if(1-_>Xw.EPSILON)u=Math.acos(_),p=Math.sin(u),m=Math.sin((1-o)*u)/p,A=Math.sin(o*u)/p;else m=1-o,A=o;return e[0]=m*r+A*c,e[1]=m*i+A*l,e[2]=m*s+A*h,e[3]=m*a+A*d,e}function ilr(e){var t=Xw.RANDOM(),n=Xw.RANDOM(),o=Xw.RANDOM(),r=Math.sqrt(1-t),i=Math.sqrt(t);return e[0]=r*Math.sin(2*Math.PI*n),e[1]=r*Math.cos(2*Math.PI*n),e[2]=i*Math.sin(2*Math.PI*o),e[3]=i*Math.cos(2*Math.PI*o),e}function slr(e,t){var n=t[0],o=t[1],r=t[2],i=t[3],s=n*n+o*o+r*r+i*i,a=s?1/s:0;return e[0]=-n*a,e[1]=-o*a,e[2]=-r*a,e[3]=i*a,e}function alr(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function hkt(e,t){var n=t[0]+t[4]+t[8],o;if(n>0)o=Math.sqrt(n+1),e[3]=0.5*o,o=0.5/o,e[0]=(t[5]-t[7])*o,e[1]=(t[6]-t[2])*o,e[2]=(t[1]-t[3])*o;else{var r=0;if(t[4]>t[0])r=1;if(t[8]>t[r*3+r])r=2;var i=(r+1)%3,s=(r+2)%3;o=Math.sqrt(t[r*3+r]-t[i*3+i]-t[s*3+s]+1),e[r]=0.5*o,o=0.5/o,e[3]=(t[i*3+s]-t[s*3+i])*o,e[i]=(t[i*3+r]+t[r*3+i])*o,e[s]=(t[s*3+r]+t[r*3+s])*o}return e}function clr(e,t,n,o){var r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:Xw.ANGLE_ORDER,i=Math.PI/360;t*=i,o*=i,n*=i;var s=Math.sin(t),a=Math.cos(t),c=Math.sin(n),l=Math.cos(n),h=Math.sin(o),d=Math.cos(o);switch(r){case"xyz":e[0]=s*l*d+a*c*h,e[1]=a*c*d-s*l*h,e[2]=a*l*h+s*c*d,e[3]=a*l*d-s*c*h;break;case"xzy":e[0]=s*l*d-a*c*h,e[1]=a*c*d-s*l*h,e[2]=a*l*h+s*c*d,e[3]=a*l*d+s*c*h;break;case"yxz":e[0]=s*l*d+a*c*h,e[1]=a*c*d-s*l*h,e[2]=a*l*h-s*c*d,e[3]=a*l*d+s*c*h;break;case"yzx":e[0]=s*l*d+a*c*h,e[1]=a*c*d+s*l*h,e[2]=a*l*h-s*c*d,e[3]=a*l*d-s*c*h;break;case"zxy":e[0]=s*l*d-a*c*h,e[1]=a*c*d+s*l*h,e[2]=a*l*h+s*c*d,e[3]=a*l*d-s*c*h;break;case"zyx":e[0]=s*l*d-a*c*h,e[1]=a*c*d+s*l*h,e[2]=a*l*h-s*c*d,e[3]=a*l*d+s*c*h;break;default:throw Error("Unknown angle order "+r)}return e}function llr(e){return"quat("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}var oks=ukt.clone=P3.clone,rks=ukt.fromValues=P3.fromValues,iks=ukt.copy=P3.copy,sks=ukt.set=P3.set,aks=ukt.add=P3.add,cks=ukt.mul=akt,hlr=ukt.scale=P3.scale,dlr=ukt.dot=P3.dot,lks=ukt.lerp=P3.lerp,ulr=ukt.length=P3.length,hks=ukt.len=ulr,plr=ukt.squaredLength=P3.squaredLength,dks=ukt.sqrLen=plr,dkt=ukt.normalize=P3.normalize,uks=ukt.exactEquals=P3.exactEquals;function mlr(e,t){return Math.abs(P3.dot(e,t))>=1-Xw.EPSILON}var pks=ukt.rotationTo=function(){var e=Ww.create(),t=Ww.fromValues(1,0,0),n=Ww.fromValues(0,1,0);return function(o,r,i){var s=Ww.dot(r,i);if(s<-0.999999){if(Ww.cross(e,t,r),Ww.len(e)<0.000001)Ww.cross(e,n,r);return Ww.normalize(e,e),skt(o,e,Math.PI),o}else if(s>0.999999)return o[0]=0,o[1]=0,o[2]=0,o[3]=1,o;else return Ww.cross(e,r,i),o[0]=e[0],o[1]=e[1],o[2]=e[2],o[3]=1+s,dkt(o,o)}}(),mks=ukt.sqlerp=function(){var e=mWe(),t=mWe();return function(n,o,r,i,s,a){return n4e(e,o,s,a),n4e(t,r,i,a),n4e(n,e,t,2*a*(1-a)),n}}(),_ks=ukt.setAxes=function(){var e=$cr.create();return function(t,n,o,r){return e[0]=o[0],e[3]=o[1],e[6]=o[2],e[1]=r[0],e[4]=r[1],e[7]=r[2],e[2]=-n[0],e[5]=-n[1],e[8]=-n[2],dkt(t,hkt(t,e))}}()});var Rkt=pt(function(Mkt){function gWe(e){return gWe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gWe(e)}Object.defineProperty(Mkt,"__esModule",{value:!0});Mkt.add=chr;Mkt.clone=Glr;Mkt.conjugate=phr;Mkt.copy=Pkt;Mkt.create=Ylr;Mkt.dot=void 0;Mkt.equals=fhr;Mkt.exactEquals=Ahr;Mkt.fromMat4=Klr;Mkt.fromRotation=jlr;Mkt.fromRotationTranslation=Skt;Mkt.fromRotationTranslationValues=Wlr;Mkt.fromTranslation=Xlr;Mkt.fromValues=Ulr;Mkt.getDual=Jlr;Mkt.getReal=void 0;Mkt.getTranslation=ehr;Mkt.identity=$lr;Mkt.invert=uhr;Mkt.length=Mkt.len=void 0;Mkt.lerp=dhr;Mkt.mul=void 0;Mkt.multiply=Ekt;Mkt.normalize=_hr;Mkt.rotateAroundAxis=ahr;Mkt.rotateByQuatAppend=ihr;Mkt.rotateByQuatPrepend=shr;Mkt.rotateX=nhr;Mkt.rotateY=ohr;Mkt.rotateZ=rhr;Mkt.scale=lhr;Mkt.set=qlr;Mkt.setDual=Zlr;Mkt.squaredLength=Mkt.sqrLen=Mkt.setReal=void 0;Mkt.str=ghr;Mkt.translate=thr;var Xy=o4e(W9()),jw=o4e(_We()),vkt=o4e(aWe());function o4e(e,t){if(typeof WeakMap=="function")var n=new WeakMap,o=new WeakMap;return(o4e=function(i,s){if(!s&&i&&i.__esModule)return i;var a,c,l={__proto__:null,default:i};if(i===null||gWe(i)!="object"&&typeof i!="function")return l;if(a=s?o:n){if(a.has(i))return a.get(i);a.set(i,l)}for(var h in i)h!=="default"&&{}.hasOwnProperty.call(i,h)&&((c=(a=Object.defineProperty)&&Object.getOwnPropertyDescriptor(i,h))&&(c.get||c.set)?a(l,h,c):l[h]=i[h]);return l})(e,t)}function Ylr(){var e=new Xy.ARRAY_TYPE(8);if(Xy.ARRAY_TYPE!=Float32Array)e[0]=0,e[1]=0,e[2]=0,e[4]=0,e[5]=0,e[6]=0,e[7]=0;return e[3]=1,e}function Glr(e){var t=new Xy.ARRAY_TYPE(8);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t}function Ulr(e,t,n,o,r,i,s,a){var c=new Xy.ARRAY_TYPE(8);return c[0]=e,c[1]=t,c[2]=n,c[3]=o,c[4]=r,c[5]=i,c[6]=s,c[7]=a,c}function Wlr(e,t,n,o,r,i,s){var a=new Xy.ARRAY_TYPE(8);a[0]=e,a[1]=t,a[2]=n,a[3]=o;var c=r*0.5,l=i*0.5,h=s*0.5;return a[4]=c*o+l*n-h*t,a[5]=l*o+h*e-c*n,a[6]=h*o+c*t-l*e,a[7]=-c*e-l*t-h*n,a}function Skt(e,t,n){var o=n[0]*0.5,r=n[1]*0.5,i=n[2]*0.5,s=t[0],a=t[1],c=t[2],l=t[3];return e[0]=s,e[1]=a,e[2]=c,e[3]=l,e[4]=o*l+r*c-i*a,e[5]=r*l+i*s-o*c,e[6]=i*l+o*a-r*s,e[7]=-o*s-r*a-i*c,e}function Xlr(e,t){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0]*0.5,e[5]=t[1]*0.5,e[6]=t[2]*0.5,e[7]=0,e}function jlr(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}function Klr(e,t){var n=jw.create();vkt.getRotation(n,t);var o=new Xy.ARRAY_TYPE(3);return vkt.getTranslation(o,t),Skt(e,n,o),e}function Pkt(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}function $lr(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}function qlr(e,t,n,o,r,i,s,a,c){return e[0]=t,e[1]=n,e[2]=o,e[3]=r,e[4]=i,e[5]=s,e[6]=a,e[7]=c,e}var Aks=Mkt.getReal=jw.copy;function Jlr(e,t){return e[0]=t[4],e[1]=t[5],e[2]=t[6],e[3]=t[7],e}var fks=Mkt.setReal=jw.copy;function Zlr(e,t){return e[4]=t[0],e[5]=t[1],e[6]=t[2],e[7]=t[3],e}function ehr(e,t){var n=t[4],o=t[5],r=t[6],i=t[7],s=-t[0],a=-t[1],c=-t[2],l=t[3];return e[0]=(n*l+i*s+o*c-r*a)*2,e[1]=(o*l+i*a+r*s-n*c)*2,e[2]=(r*l+i*c+n*a-o*s)*2,e}function thr(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=n[0]*0.5,c=n[1]*0.5,l=n[2]*0.5,h=t[4],d=t[5],u=t[6],_=t[7];return e[0]=o,e[1]=r,e[2]=i,e[3]=s,e[4]=s*a+r*l-i*c+h,e[5]=s*c+i*a-o*l+d,e[6]=s*l+o*c-r*a+u,e[7]=-o*a-r*c-i*l+_,e}function nhr(e,t,n){var o=-t[0],r=-t[1],i=-t[2],s=t[3],a=t[4],c=t[5],l=t[6],h=t[7],d=a*s+h*o+c*i-l*r,u=c*s+h*r+l*o-a*i,_=l*s+h*i+a*r-c*o,p=h*s-a*o-c*r-l*i;return jw.rotateX(e,t,n),o=e[0],r=e[1],i=e[2],s=e[3],e[4]=d*s+p*o+u*i-_*r,e[5]=u*s+p*r+_*o-d*i,e[6]=_*s+p*i+d*r-u*o,e[7]=p*s-d*o-u*r-_*i,e}function ohr(e,t,n){var o=-t[0],r=-t[1],i=-t[2],s=t[3],a=t[4],c=t[5],l=t[6],h=t[7],d=a*s+h*o+c*i-l*r,u=c*s+h*r+l*o-a*i,_=l*s+h*i+a*r-c*o,p=h*s-a*o-c*r-l*i;return jw.rotateY(e,t,n),o=e[0],r=e[1],i=e[2],s=e[3],e[4]=d*s+p*o+u*i-_*r,e[5]=u*s+p*r+_*o-d*i,e[6]=_*s+p*i+d*r-u*o,e[7]=p*s-d*o-u*r-_*i,e}function rhr(e,t,n){var o=-t[0],r=-t[1],i=-t[2],s=t[3],a=t[4],c=t[5],l=t[6],h=t[7],d=a*s+h*o+c*i-l*r,u=c*s+h*r+l*o-a*i,_=l*s+h*i+a*r-c*o,p=h*s-a*o-c*r-l*i;return jw.rotateZ(e,t,n),o=e[0],r=e[1],i=e[2],s=e[3],e[4]=d*s+p*o+u*i-_*r,e[5]=u*s+p*r+_*o-d*i,e[6]=_*s+p*i+d*r-u*o,e[7]=p*s-d*o-u*r-_*i,e}function ihr(e,t,n){var o=n[0],r=n[1],i=n[2],s=n[3],a=t[0],c=t[1],l=t[2],h=t[3];return e[0]=a*s+h*o+c*i-l*r,e[1]=c*s+h*r+l*o-a*i,e[2]=l*s+h*i+a*r-c*o,e[3]=h*s-a*o-c*r-l*i,a=t[4],c=t[5],l=t[6],h=t[7],e[4]=a*s+h*o+c*i-l*r,e[5]=c*s+h*r+l*o-a*i,e[6]=l*s+h*i+a*r-c*o,e[7]=h*s-a*o-c*r-l*i,e}function shr(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=n[0],c=n[1],l=n[2],h=n[3];return e[0]=o*h+s*a+r*l-i*c,e[1]=r*h+s*c+i*a-o*l,e[2]=i*h+s*l+o*c-r*a,e[3]=s*h-o*a-r*c-i*l,a=n[4],c=n[5],l=n[6],h=n[7],e[4]=o*h+s*a+r*l-i*c,e[5]=r*h+s*c+i*a-o*l,e[6]=i*h+s*l+o*c-r*a,e[7]=s*h-o*a-r*c-i*l,e}function ahr(e,t,n,o){if(Math.abs(o)<Xy.EPSILON)return Pkt(e,t);var r=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);o=o*0.5;var i=Math.sin(o),s=i*n[0]/r,a=i*n[1]/r,c=i*n[2]/r,l=Math.cos(o),h=t[0],d=t[1],u=t[2],_=t[3];e[0]=h*l+_*s+d*c-u*a,e[1]=d*l+_*a+u*s-h*c,e[2]=u*l+_*c+h*a-d*s,e[3]=_*l-h*s-d*a-u*c;var p=t[4],m=t[5],A=t[6],g=t[7];return e[4]=p*l+g*s+m*c-A*a,e[5]=m*l+g*a+A*s-p*c,e[6]=A*l+g*c+p*a-m*s,e[7]=g*l-p*s-m*a-A*c,e}function chr(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e}function Ekt(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=n[4],c=n[5],l=n[6],h=n[7],d=t[4],u=t[5],_=t[6],p=t[7],m=n[0],A=n[1],g=n[2],f=n[3];return e[0]=o*f+s*m+r*g-i*A,e[1]=r*f+s*A+i*m-o*g,e[2]=i*f+s*g+o*A-r*m,e[3]=s*f-o*m-r*A-i*g,e[4]=o*h+s*a+r*l-i*c+d*f+p*m+u*g-_*A,e[5]=r*h+s*c+i*a-o*l+u*f+p*A+_*m-d*g,e[6]=i*h+s*l+o*c-r*a+_*f+p*g+d*A-u*m,e[7]=s*h-o*a-r*c-i*l+p*f-d*m-u*A-_*g,e}var yks=Mkt.mul=Ekt;function lhr(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e}var hhr=Mkt.dot=jw.dot;function dhr(e,t,n,o){var r=1-o;if(hhr(t,n)<0)o=-o;return e[0]=t[0]*r+n[0]*o,e[1]=t[1]*r+n[1]*o,e[2]=t[2]*r+n[2]*o,e[3]=t[3]*r+n[3]*o,e[4]=t[4]*r+n[4]*o,e[5]=t[5]*r+n[5]*o,e[6]=t[6]*r+n[6]*o,e[7]=t[7]*r+n[7]*o,e}function uhr(e,t){var n=AWe(t);return e[0]=-t[0]/n,e[1]=-t[1]/n,e[2]=-t[2]/n,e[3]=t[3]/n,e[4]=-t[4]/n,e[5]=-t[5]/n,e[6]=-t[6]/n,e[7]=t[7]/n,e}function phr(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e[4]=-t[4],e[5]=-t[5],e[6]=-t[6],e[7]=t[7],e}var mhr=Mkt.length=jw.length,xks=Mkt.len=mhr,AWe=Mkt.squaredLength=jw.squaredLength,Cks=Mkt.sqrLen=AWe;function _hr(e,t){var n=AWe(t);if(n>0){n=Math.sqrt(n);var o=t[0]/n,r=t[1]/n,i=t[2]/n,s=t[3]/n,a=t[4],c=t[5],l=t[6],h=t[7],d=o*a+r*c+i*l+s*h;e[0]=o,e[1]=r,e[2]=i,e[3]=s,e[4]=(a-o*d)/n,e[5]=(c-r*d)/n,e[6]=(l-i*d)/n,e[7]=(h-s*d)/n}return e}function ghr(e){return"quat2("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+")"}function Ahr(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]}function fhr(e,t){var n=e[0],o=e[1],r=e[2],i=e[3],s=e[4],a=e[5],c=e[6],l=e[7],h=t[0],d=t[1],u=t[2],_=t[3],p=t[4],m=t[5],A=t[6],g=t[7];return Math.abs(n-h)<=Xy.EPSILON*Math.max(1,Math.abs(n),Math.abs(h))&&Math.abs(o-d)<=Xy.EPSILON*Math.max(1,Math.abs(o),Math.abs(d))&&Math.abs(r-u)<=Xy.EPSILON*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(i-_)<=Xy.EPSILON*Math.max(1,Math.abs(i),Math.abs(_))&&Math.abs(s-p)<=Xy.EPSILON*Math.max(1,Math.abs(s),Math.abs(p))&&Math.abs(a-m)<=Xy.EPSILON*Math.max(1,Math.abs(a),Math.abs(m))&&Math.abs(c-A)<=Xy.EPSILON*Math.max(1,Math.abs(c),Math.abs(A))&&Math.abs(l-g)<=Xy.EPSILON*Math.max(1,Math.abs(l),Math.abs(g))}});var Jkt=pt(function(Gkt){function fWe(e){return fWe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fWe(e)}Object.defineProperty(Gkt,"__esModule",{value:!0});Gkt.add=odr;Gkt.angle=Idr;Gkt.ceil=rdr;Gkt.clone=Zhr;Gkt.copy=tdr;Gkt.create=kkt;Gkt.cross=_dr;Gkt.dist=void 0;Gkt.distance=zkt;Gkt.div=void 0;Gkt.divide=Fkt;Gkt.dot=mdr;Gkt.equals=Mdr;Gkt.exactEquals=Edr;Gkt.floor=idr;Gkt.forEach=void 0;Gkt.fromValues=edr;Gkt.inverse=udr;Gkt.len=void 0;Gkt.length=Vkt;Gkt.lerp=gdr;Gkt.max=adr;Gkt.min=sdr;Gkt.mul=void 0;Gkt.multiply=Hkt;Gkt.negate=ddr;Gkt.normalize=pdr;Gkt.random=Adr;Gkt.rotate=bdr;Gkt.round=cdr;Gkt.scale=ldr;Gkt.scaleAndAdd=hdr;Gkt.set=ndr;Gkt.signedAngle=vdr;Gkt.sqrLen=Gkt.sqrDist=void 0;Gkt.squaredDistance=Okt;Gkt.squaredLength=Ykt;Gkt.str=Pdr;Gkt.sub=void 0;Gkt.subtract=Lkt;Gkt.transformMat2=fdr;Gkt.transformMat2d=ydr;Gkt.transformMat3=xdr;Gkt.transformMat4=Cdr;Gkt.zero=Sdr;var Kw=Qkt(W9());function Qkt(e,t){if(typeof WeakMap=="function")var n=new WeakMap,o=new WeakMap;return(Qkt=function(i,s){if(!s&&i&&i.__esModule)return i;var a,c,l={__proto__:null,default:i};if(i===null||fWe(i)!="object"&&typeof i!="function")return l;if(a=s?o:n){if(a.has(i))return a.get(i);a.set(i,l)}for(var h in i)h!=="default"&&{}.hasOwnProperty.call(i,h)&&((c=(a=Object.defineProperty)&&Object.getOwnPropertyDescriptor(i,h))&&(c.get||c.set)?a(l,h,c):l[h]=i[h]);return l})(e,t)}function kkt(){var e=new Kw.ARRAY_TYPE(2);if(Kw.ARRAY_TYPE!=Float32Array)e[0]=0,e[1]=0;return e}function Zhr(e){var t=new Kw.ARRAY_TYPE(2);return t[0]=e[0],t[1]=e[1],t}function edr(e,t){var n=new Kw.ARRAY_TYPE(2);return n[0]=e,n[1]=t,n}function tdr(e,t){return e[0]=t[0],e[1]=t[1],e}function ndr(e,t,n){return e[0]=t,e[1]=n,e}function odr(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}function Lkt(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}function Hkt(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e}function Fkt(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e}function rdr(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e}function idr(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e}function sdr(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e}function adr(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}function cdr(e,t){return e[0]=Kw.round(t[0]),e[1]=Kw.round(t[1]),e}function ldr(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}function hdr(e,t,n,o){return e[0]=t[0]+n[0]*o,e[1]=t[1]+n[1]*o,e}function zkt(e,t){var n=t[0]-e[0],o=t[1]-e[1];return Math.sqrt(n*n+o*o)}function Okt(e,t){var n=t[0]-e[0],o=t[1]-e[1];return n*n+o*o}function Vkt(e){var t=e[0],n=e[1];return Math.sqrt(t*t+n*n)}function Ykt(e){var t=e[0],n=e[1];return t*t+n*n}function ddr(e,t){return e[0]=-t[0],e[1]=-t[1],e}function udr(e,t){return e[0]=1/t[0],e[1]=1/t[1],e}function pdr(e,t){var n=t[0],o=t[1],r=n*n+o*o;if(r>0)r=1/Math.sqrt(r);return e[0]=t[0]*r,e[1]=t[1]*r,e}function mdr(e,t){return e[0]*t[0]+e[1]*t[1]}function _dr(e,t,n){var o=t[0]*n[1]-t[1]*n[0];return e[0]=e[1]=0,e[2]=o,e}function gdr(e,t,n,o){var r=t[0],i=t[1];return e[0]=r+o*(n[0]-r),e[1]=i+o*(n[1]-i),e}function Adr(e,t){t=t===void 0?1:t;var n=Kw.RANDOM()*2*Math.PI;return e[0]=Math.cos(n)*t,e[1]=Math.sin(n)*t,e}function fdr(e,t,n){var o=t[0],r=t[1];return e[0]=n[0]*o+n[2]*r,e[1]=n[1]*o+n[3]*r,e}function ydr(e,t,n){var o=t[0],r=t[1];return e[0]=n[0]*o+n[2]*r+n[4],e[1]=n[1]*o+n[3]*r+n[5],e}function xdr(e,t,n){var o=t[0],r=t[1];return e[0]=n[0]*o+n[3]*r+n[6],e[1]=n[1]*o+n[4]*r+n[7],e}function Cdr(e,t,n){var o=t[0],r=t[1];return e[0]=n[0]*o+n[4]*r+n[12],e[1]=n[1]*o+n[5]*r+n[13],e}function bdr(e,t,n,o){var r=t[0]-n[0],i=t[1]-n[1],s=Math.sin(o),a=Math.cos(o);return e[0]=r*a-i*s+n[0],e[1]=r*s+i*a+n[1],e}function Idr(e,t){var n=e[0],o=e[1],r=t[0],i=t[1];return Math.abs(Math.atan2(o*r-n*i,n*r+o*i))}function vdr(e,t){var n=e[0],o=e[1],r=t[0],i=t[1];return Math.atan2(n*i-o*r,n*r+o*i)}function Sdr(e){return e[0]=0,e[1]=0,e}function Pdr(e){return"vec2("+e[0]+", "+e[1]+")"}function Edr(e,t){return e[0]===t[0]&&e[1]===t[1]}function Mdr(e,t){var n=e[0],o=e[1],r=t[0],i=t[1];return Math.abs(n-r)<=Kw.EPSILON*Math.max(1,Math.abs(n),Math.abs(r))&&Math.abs(o-i)<=Kw.EPSILON*Math.max(1,Math.abs(o),Math.abs(i))}var Iks=Gkt.len=Vkt,vks=Gkt.sub=Lkt,Sks=Gkt.mul=Hkt,Pks=Gkt.div=Fkt,Eks=Gkt.dist=zkt,Mks=Gkt.sqrDist=Okt,wks=Gkt.sqrLen=Ykt,Bks=Gkt.forEach=function(){var e=kkt();return function(t,n,o,r,i,s){var a,c;if(!n)n=2;if(!o)o=0;if(r)c=Math.min(r*n+o,t.length);else c=t.length;for(a=o;a<c;a+=n)e[0]=t[a],e[1]=t[a+1],i(e,e,s),t[a]=e[0],t[a+1]=e[1];return t}}()});var fS=pt(function(Zkt){function yWe(e){return yWe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yWe(e)}Object.defineProperty(Zkt,"__esModule",{value:!0});Zkt.vec4=Zkt.vec3=Zkt.vec2=Zkt.quat2=Zkt.quat=Zkt.mat4=Zkt.mat3=Zkt.mat2d=Zkt.mat2=Zkt.glMatrix=void 0;var mur=X9(W9());Zkt.glMatrix=mur;var _ur=X9(ZRt());Zkt.mat2=_ur;var gur=X9(sQt());Zkt.mat2d=gur;var Aur=X9(iWe());Zkt.mat3=Aur;var fur=X9(aWe());Zkt.mat4=fur;var yur=X9(_We());Zkt.quat=yur;var xur=X9(Rkt());Zkt.quat2=xur;var Cur=X9(Jkt());Zkt.vec2=Cur;var bur=X9(hWe());Zkt.vec3=bur;var Iur=X9(uWe());Zkt.vec4=Iur;function X9(e,t){if(typeof WeakMap=="function")var n=new WeakMap,o=new WeakMap;return(X9=function(i,s){if(!s&&i&&i.__esModule)return i;var a,c,l={__proto__:null,default:i};if(i===null||yWe(i)!="object"&&typeof i!="function")return l;if(a=s?o:n){if(a.has(i))return a.get(i);a.set(i,l)}for(var h in i)h!=="default"&&{}.hasOwnProperty.call(i,h)&&((c=(a=Object.defineProperty)&&Object.getOwnPropertyDescriptor(i,h))&&(c.get||c.set)?a(l,h,c):l[h]=i[h]);return l})(e,t)}});var bWe=pt(function(Nks,sLt){var{defineProperty:CWe,getOwnPropertyDescriptor:Nur,getOwnPropertyNames:Rur}=Object,Qur=Object.prototype.hasOwnProperty,kur=(e,t)=>{for(var n in t)CWe(e,n,{get:t[n],enumerable:!0})},Lur=(e,t,n,o)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let r of Rur(t))if(!Qur.call(e,r)&&r!==n)CWe(e,r,{get:()=>t[r],enumerable:!(o=Nur(t,r))||o.enumerable})}return e},Hur=(e)=>Lur(CWe({},"__esModule",{value:!0}),e),tLt={};kur(tLt,{assertTransformMatrix:()=>zK,executeJscadOperations:()=>rLt,jscadPlanner:()=>Fur,resolveReferencePlanes:()=>oLt,toTransformMatrix:()=>GO});sLt.exports=Hur(tLt);var nLt="Transform matrix must be a column-major array of exactly 16 finite numbers";function zK(e){if(!Array.isArray(e)||e.length!==16||!Array.from(e).every(Number.isFinite))throw Error(nLt)}function GO(e){if(e==null||e.length!==16)throw Error(nLt);let t=Array.from(e);return zK(t),t}var Fur={booleans:{intersect:(...e)=>({type:"intersect",shapes:e}),subtract:(...e)=>({type:"subtract",shapes:e}),union:(...e)=>({type:"union",shapes:e})},hulls:{hull:(...e)=>({type:"hull",shapes:e.flat()}),hullChain:(...e)=>({type:"hullChain",shapes:e.flat()})},colors:{colorize:(e,t)=>({type:"colorize",color:e,shape:t})},primitives:{rectangle:(e)=>({...e,type:"rectangle"}),cube:(e)=>({type:"cube",...e}),sphere:(e)=>({type:"sphere",...e}),cylinder:(e)=>({type:"cylinder",...e}),polygon:(e)=>({type:"polygon",...e}),cuboid:(e)=>({type:"cuboid",...e}),roundedCuboid:(e)=>({type:"roundedCuboid",...e})},transforms:{transform:(e,t)=>(zK(e),{type:"transform",matrix:e,shape:t}),rotate:(e,t)=>({type:"rotate",angles:e,shape:t}),rotateX:(e,t)=>({type:"rotateX",angle:e,shape:t}),rotateY:(e,t)=>({type:"rotateY",angle:e,shape:t}),rotateZ:(e,t)=>({type:"rotateZ",angle:e,shape:t}),scale:(e,t)=>({type:"scale",factors:e,shape:t}),translate:(e,t)=>({type:"translate",vector:e,shape:t})},extrusions:{extrudeLinear:(e,t)=>({type:"extrudeLinear",options:e,shape:t}),extrudeRotate:(e,t)=>({type:"extrudeRotate",options:e,shape:t})},maths:{vec2:{create:(e,t)=>[e,t],fromValues:(e,t)=>[e,t]},vec3:{create:(e,t,n)=>[e,t,n],fromValues:(e,t,n)=>[e,t,n]}},geometries:{geom2:{create:(e)=>({type:"createGeom2",points:e}),fromPoints:(e)=>({type:"fromPointsGeom2",points:e})},geom3:{create:(e)=>({type:"createGeom3",polygons:e})},path2:{create:(e)=>({type:"createPath2",points:e})}},measurements:{measureBoundingBox:(e)=>({type:"measureBoundingBox",shape:e}),measureArea:(e)=>({type:"measureArea",shape:e}),measureVolume:(e)=>({type:"measureVolume",shape:e})},utils:{degToRad:(e)=>e*Math.PI/180,radToDeg:(e)=>e*180/Math.PI}},g1=fS(),xWe=()=>GO(g1.mat4.create());function zur(e){let t=xWe();switch(e.type){case"transform":return zK(e.matrix),[...e.matrix];case"translate":return GO(g1.mat4.fromTranslation(t,e.vector));case"scale":return GO(g1.mat4.fromScaling(t,e.factors));case"rotate":return g1.mat4.rotateZ(t,t,e.angles[2]),g1.mat4.rotateY(t,t,e.angles[1]),g1.mat4.rotateX(t,t,e.angles[0]),t;case"rotateX":return GO(g1.mat4.fromXRotation(t,e.angle));case"rotateY":return GO(g1.mat4.fromYRotation(t,e.angle));case"rotateZ":return GO(g1.mat4.fromZRotation(t,e.angle));default:throw Error(`Cannot use ${e.type} as a reference transform`)}}function Our(e,t){let n=e.name;if(!n?.trim())throw Error("Reference rectangles require a nonblank name");let o;if(e.type==="rectangle"){if(e.size.length!==2||!e.size.every((l)=>Number.isFinite(l)&&l>0))throw Error(`Reference rectangle "${n}" requires two positive finite dimensions`);o=e.center??[0,0]}else{let l=e.points;if(e.paths||l.length!==4||!l.every((_)=>_.length===2&&_.every((p)=>typeof p==="number"&&Number.isFinite(p))))throw Error(`Reference polygon "${n}" must be an axis-aligned rectangle`);let h=l,d=[...new Set(h.map((_)=>_[0]))],u=[...new Set(h.map((_)=>_[1]))];if(d.length!==2||u.length!==2||new Set(h.map((_)=>JSON.stringify(_))).size!==4)throw Error(`Reference polygon "${n}" must be an axis-aligned rectangle`);o=[(d[0]+d[1])/2,(u[0]+u[1])/2]}if(o.length!==2||!o.every(Number.isFinite))throw Error(`Reference rectangle "${n}" has an invalid center`);let r=xWe();for(let l of t)g1.mat4.multiply(r,r,zur(l));if(zK(r),r[3]!==0||r[7]!==0||r[11]!==0||r[15]!==1)throw Error(`Reference rectangle "${n}" requires affine transforms`);let i=g1.mat4.invert(xWe(),r);if(!i)throw Error(`Reference rectangle "${n}" has a singular transform`);let s=[0,0,0];g1.vec3.transformMat4(s,[o[0],o[1],0],r);let a=[i[2],i[6],i[10]],c=[r[0],r[1],r[2]];if(![...s,...a,...c].every(Number.isFinite)||!g1.vec3.length(a)||!g1.vec3.length(c))throw Error(`Reference rectangle "${n}" has an invalid frame`);return g1.vec3.normalize(a,a),g1.vec3.normalize(c,c),{name:n,origin:s,normal:a,xAxis:c}}function oLt(e){let t=[],n=new Set;function o(s,a,c=!1){if(s.reference){if(s.type!=="rectangle"&&s.type!=="polygon")throw Error("Only rectangles can be reference geometry");if(c)throw Error("Reference rectangles must be outside extrusion and measurement inputs");let l=Our(s,a);if(n.has(l.name))throw Error(`Duplicate reference plane "${l.name}"`);n.add(l.name),t.push(l);return}switch(s.type){case"translate":case"rotate":case"rotateX":case"rotateY":case"rotateZ":case"scale":case"transform":{let l=o(s.shape,[...a,s],c);return l?{...s,shape:l}:void 0}case"colorize":{let l=o(s.shape,a,c);return l?{...s,shape:l}:void 0}case"extrudeLinear":case"extrudeRotate":case"measureArea":case"measureVolume":case"measureBoundingBox":{let l=o(s.shape,a,!0);return l?{...s,shape:l}:void 0}case"union":case"subtract":case"intersect":case"hull":case"hullChain":{let l=s.shapes.map((d)=>o(d,a,c));if(s.type==="subtract"&&s.shapes.length&&!l[0])throw Error("A subtraction base cannot be reference geometry");let h=l.filter((d)=>d!==void 0);if(!h.length)return;if(h.length===1)return h[0];return{...s,shapes:h}}default:return{...s}}}let r=(Array.isArray(e)?e:[e]).map((s)=>o(s,[])).filter((s)=>s!==void 0);return{geometry:r.length>1?{type:"union",shapes:r}:r[0],referencePlanes:t}}var rLt=(e,t)=>{if(Array.isArray(t)&&t.length===1)return rLt(e,t[0]);if(Array.isArray(t))throw Error("executeJscadOperations currently doesn't support Array<JscadOperation>, try adding a root union or or executing each element individually");let{geometry:n}=oLt(t);if(!n)throw Error("JSCAD plan contains only reference geometry");return iLt(e,n)},iLt=(e,t)=>{let n=(i)=>iLt(e,i),{type:o,...r}=t;switch(o){case"rectangle":if(!e.primitives.rectangle)throw Error("JSCAD adapter does not support primitives.rectangle");return e.primitives.rectangle({size:t.size,center:t.center??[0,0]});case"intersect":return e.booleans.intersect(...t.shapes.map(n));case"subtract":return e.booleans.subtract(...t.shapes.map(n));case"union":return e.booleans.union(...t.shapes.map(n));case"hull":return e.hulls.hull(...t.shapes.map(n));case"hullChain":return e.hulls.hullChain(...t.shapes.map(n));case"colorize":return e.colors.colorize(t.color,n(t.shape));case"cube":return e.primitives.cube(r);case"sphere":return e.primitives.sphere(r);case"cylinder":return e.primitives.cylinder(r);case"polygon":return e.primitives.polygon(r);case"cuboid":return e.primitives.cuboid(r);case"roundedCuboid":return e.primitives.roundedCuboid(r);case"transform":if(zK(t.matrix),!e.transforms.transform)throw Error('Cannot execute "transform" operation: this JSCAD adapter does not support transforms.transform');return e.transforms.transform(t.matrix,n(t.shape));case"rotate":return e.transforms.rotate(t.angles,n(t.shape));case"rotateX":return e.transforms.rotateX(t.angle,n(t.shape));case"rotateY":return e.transforms.rotateY(t.angle,n(t.shape));case"rotateZ":return e.transforms.rotateZ(t.angle,n(t.shape));case"scale":return e.transforms.scale(t.factors,n(t.shape));case"translate":return e.transforms.translate(t.vector,n(t.shape));case"extrudeLinear":return e.extrusions.extrudeLinear(t.options,n(t.shape));case"extrudeRotate":return e.extrusions.extrudeRotate(t.options,n(t.shape));case"createGeom2":return e.geometries.geom2.create(t.points);case"fromPointsGeom2":return e.geometries.geom2.fromPoints(t.points);case"createGeom3":return e.geometries.geom3.create(t.polygons);case"createPath2":return e.geometries.path2.create(t.points);case"measureBoundingBox":return e.measurements.measureBoundingBox(n(t.shape));case"measureArea":return e.measurements.measureArea(n(t.shape));case"measureVolume":return e.measurements.measureVolume(n(t.shape));case"degToRad":return e.utils.degToRad(t.degrees);case"radToDeg":return e.utils.radToDeg(t.radians);default:if(t.type===void 0)throw Error(`Operation type is undefined. This usually means the operation object is malformed or not properly initialized. Operation: ${JSON.stringify(t,null,2).slice(0,200)}...`);throw Error(`Unsupported operation type: ${t.type}. Operation: ${JSON.stringify(t,null,2)}`)}}});var a4e=pt(function(dLt,uLt){(function(e){var t;typeof dLt=="object"?uLt.exports=e():typeof define=="function"&&define.amd?define(e):(typeof window<"u"?t=window:typeof global<"u"?t=global:typeof self<"u"&&(t=self),t.objectHash=e())})(function(){return function e(t,n,o){function r(a,c){if(!n[a]){if(!t[a]){var l=vX;if(!c&&l)return l(a,!0);if(i)return i(a,!0);throw Error("Cannot find module '"+a+"'")}c=n[a]={exports:{}},t[a][0].call(c.exports,function(h){var d=t[a][1][h];return r(d||h)},c,c.exports,e,t,n,o)}return n[a].exports}for(var i=vX,s=0;s<o.length;s++)r(o[s]);return r}({1:[function(e,t,n){(function(o,r,i,s,a,c,l,h,d){var u=e("crypto");function _(x,C){C=A(x,C);var b;return(b=C.algorithm!=="passthrough"?u.createHash(C.algorithm):new y).write===void 0&&(b.write=b.update,b.end=b.update),f(C,b).dispatch(x),b.update||b.end(""),b.digest?b.digest(C.encoding==="buffer"?void 0:C.encoding):(x=b.read(),C.encoding!=="buffer"?x.toString(C.encoding):x)}(n=t.exports=_).sha1=function(x){return _(x)},n.keys=function(x){return _(x,{excludeValues:!0,algorithm:"sha1",encoding:"hex"})},n.MD5=function(x){return _(x,{algorithm:"md5",encoding:"hex"})},n.keysMD5=function(x){return _(x,{algorithm:"md5",encoding:"hex",excludeValues:!0})};var p=u.getHashes?u.getHashes().slice():["sha1","md5"],m=(p.push("passthrough"),["buffer","hex","binary","base64"]);function A(x,C){var b={};if(b.algorithm=(C=C||{}).algorithm||"sha1",b.encoding=C.encoding||"hex",b.excludeValues=!!C.excludeValues,b.algorithm=b.algorithm.toLowerCase(),b.encoding=b.encoding.toLowerCase(),b.ignoreUnknown=C.ignoreUnknown===!0,b.respectType=C.respectType!==!1,b.respectFunctionNames=C.respectFunctionNames!==!1,b.respectFunctionProperties=C.respectFunctionProperties!==!1,b.unorderedArrays=C.unorderedArrays===!0,b.unorderedSets=C.unorderedSets!==!1,b.unorderedObjects=C.unorderedObjects!==!1,b.replacer=C.replacer||void 0,b.excludeKeys=C.excludeKeys||void 0,x===void 0)throw Error("Object argument required.");for(var I=0;I<p.length;++I)p[I].toLowerCase()===b.algorithm.toLowerCase()&&(b.algorithm=p[I]);if(p.indexOf(b.algorithm)===-1)throw Error('Algorithm "'+b.algorithm+'"  not supported. supported values: '+p.join(", "));if(m.indexOf(b.encoding)===-1&&b.algorithm!=="passthrough")throw Error('Encoding "'+b.encoding+'"  not supported. supported values: '+m.join(", "));return b}function g(x){if(typeof x=="function")return/^function\s+\w*\s*\(\s*\)\s*{\s+\[native code\]\s+}$/i.exec(Function.prototype.toString.call(x))!=null}function f(x,C,b){b=b||[];function I(v){return C.update?C.update(v,"utf8"):C.write(v,"utf8")}return{dispatch:function(v){return this["_"+((v=x.replacer?x.replacer(v):v)===null?"null":typeof v)](v)},_object:function(v){var P,M=Object.prototype.toString.call(v),B=/\[object (.*)\]/i.exec(M);if(B=(B=B?B[1]:"unknown:["+M+"]").toLowerCase(),0<=(M=b.indexOf(v)))return this.dispatch("[CIRCULAR:"+M+"]");if(b.push(v),i!==void 0&&i.isBuffer&&i.isBuffer(v))return I("buffer:"),I(v);if(B==="object"||B==="function"||B==="asyncfunction")return M=Object.keys(v),x.unorderedObjects&&(M=M.sort()),x.respectType===!1||g(v)||M.splice(0,0,"prototype","__proto__","constructor"),x.excludeKeys&&(M=M.filter(function(T){return!x.excludeKeys(T)})),I("object:"+M.length+":"),P=this,M.forEach(function(T){P.dispatch(T),I(":"),x.excludeValues||P.dispatch(v[T]),I(",")});if(!this["_"+B]){if(x.ignoreUnknown)return I("["+B+"]");throw Error('Unknown object type "'+B+'"')}this["_"+B](v)},_array:function(v,T){T=T!==void 0?T:x.unorderedArrays!==!1;var M=this;if(I("array:"+v.length+":"),!T||v.length<=1)return v.forEach(function(N){return M.dispatch(N)});var B=[],T=v.map(function(N){var D=new y,L=b.slice();return f(x,D,L).dispatch(N),B=B.concat(L.slice(b.length)),D.read().toString()});return b=b.concat(B),T.sort(),this._array(T,!1)},_date:function(v){return I("date:"+v.toJSON())},_symbol:function(v){return I("symbol:"+v.toString())},_error:function(v){return I("error:"+v.toString())},_boolean:function(v){return I("bool:"+v.toString())},_string:function(v){I("string:"+v.length+":"),I(v.toString())},_function:function(v){I("fn:"),g(v)?this.dispatch("[native]"):this.dispatch(v.toString()),x.respectFunctionNames!==!1&&this.dispatch("function-name:"+String(v.name)),x.respectFunctionProperties&&this._object(v)},_number:function(v){return I("number:"+v.toString())},_xml:function(v){return I("xml:"+v.toString())},_null:function(){return I("Null")},_undefined:function(){return I("Undefined")},_regexp:function(v){return I("regex:"+v.toString())},_uint8array:function(v){return I("uint8array:"),this.dispatch(Array.prototype.slice.call(v))},_uint8clampedarray:function(v){return I("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(v))},_int8array:function(v){return I("int8array:"),this.dispatch(Array.prototype.slice.call(v))},_uint16array:function(v){return I("uint16array:"),this.dispatch(Array.prototype.slice.call(v))},_int16array:function(v){return I("int16array:"),this.dispatch(Array.prototype.slice.call(v))},_uint32array:function(v){return I("uint32array:"),this.dispatch(Array.prototype.slice.call(v))},_int32array:function(v){return I("int32array:"),this.dispatch(Array.prototype.slice.call(v))},_float32array:function(v){return I("float32array:"),this.dispatch(Array.prototype.slice.call(v))},_float64array:function(v){return I("float64array:"),this.dispatch(Array.prototype.slice.call(v))},_arraybuffer:function(v){return I("arraybuffer:"),this.dispatch(new Uint8Array(v))},_url:function(v){return I("url:"+v.toString())},_map:function(v){return I("map:"),v=Array.from(v),this._array(v,x.unorderedSets!==!1)},_set:function(v){return I("set:"),v=Array.from(v),this._array(v,x.unorderedSets!==!1)},_file:function(v){return I("file:"),this.dispatch([v.name,v.size,v.type,v.lastModfied])},_blob:function(){if(x.ignoreUnknown)return I("[blob]");throw Error(`Hashing Blob objects is currently not supported
(see https://github.com/puleos/object-hash/issues/26)
Use "options.replacer" or "options.ignoreUnknown"
`)},_domwindow:function(){return I("domwindow")},_bigint:function(v){return I("bigint:"+v.toString())},_process:function(){return I("process")},_timer:function(){return I("timer")},_pipe:function(){return I("pipe")},_tcp:function(){return I("tcp")},_udp:function(){return I("udp")},_tty:function(){return I("tty")},_statwatcher:function(){return I("statwatcher")},_securecontext:function(){return I("securecontext")},_connection:function(){return I("connection")},_zlib:function(){return I("zlib")},_context:function(){return I("context")},_nodescript:function(){return I("nodescript")},_httpparser:function(){return I("httpparser")},_dataview:function(){return I("dataview")},_signal:function(){return I("signal")},_fsevent:function(){return I("fsevent")},_tlswrap:function(){return I("tlswrap")}}}function y(){return{buf:"",write:function(x){this.buf+=x},end:function(x){this.buf+=x},read:function(){return this.buf}}}n.writeToStream=function(x,C,b){return b===void 0&&(b=C,C={}),f(C=A(x,C),b).dispatch(x)}}).call(this,e("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/fake_9a5aa49d.js","/")},{buffer:3,crypto:5,lYpoI2:11}],2:[function(e,t,n){(function(o,r,i,s,a,c,l,h,d){(function(u){var _=typeof Uint8Array<"u"?Uint8Array:Array,p=43,m=47,A=48,g=97,f=65,y=45,x=95;function C(b){return b=b.charCodeAt(0),b===p||b===y?62:b===m||b===x?63:b<A?-1:b<A+10?b-A+26+26:b<f+26?b-f:b<g+26?b-g+26:void 0}u.toByteArray=function(b){var I,v;if(0<b.length%4)throw Error("Invalid string. Length must be a multiple of 4");var P=b.length,P=b.charAt(P-2)==="="?2:b.charAt(P-1)==="="?1:0,M=new _(3*b.length/4-P),B=0<P?b.length-4:b.length,T=0;function N(D){M[T++]=D}for(I=0;I<B;I+=4,0)N((16711680&(v=C(b.charAt(I))<<18|C(b.charAt(I+1))<<12|C(b.charAt(I+2))<<6|C(b.charAt(I+3))))>>16),N((65280&v)>>8),N(255&v);return P==2?N(255&(v=C(b.charAt(I))<<2|C(b.charAt(I+1))>>4)):P==1&&(N((v=C(b.charAt(I))<<10|C(b.charAt(I+1))<<4|C(b.charAt(I+2))>>2)>>8&255),N(255&v)),M},u.fromByteArray=function(b){var I,v,P,M,B=b.length%3,T="";function N(D){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(D)}for(I=0,P=b.length-B;I<P;I+=3)v=(b[I]<<16)+(b[I+1]<<8)+b[I+2],T+=N((M=v)>>18&63)+N(M>>12&63)+N(M>>6&63)+N(63&M);switch(B){case 1:T=(T+=N((v=b[b.length-1])>>2))+N(v<<4&63)+"==";break;case 2:T=(T=(T+=N((v=(b[b.length-2]<<8)+b[b.length-1])>>10))+N(v>>4&63))+N(v<<2&63)+"="}return T}})(n===void 0?this.base64js={}:n)}).call(this,e("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/base64-js/lib/b64.js","/node_modules/gulp-browserify/node_modules/base64-js/lib")},{buffer:3,lYpoI2:11}],3:[function(e,t,n){(function(o,r,p,s,a,c,l,h,d){var u=e("base64-js"),_=e("ieee754");function p(ne,re,Z){if(!(this instanceof p))return new p(ne,re,Z);var te,ie,le,ue,de=typeof ne;if(re==="base64"&&de=="string")for(ne=(ue=ne).trim?ue.trim():ue.replace(/^\s+|\s+$/g,"");ne.length%4!=0;)ne+="=";if(de=="number")te=H(ne);else if(de=="string")te=p.byteLength(ne,re);else{if(de!="object")throw Error("First argument needs to be a number, array or string.");te=H(ne.length)}if(p._useTypedArrays?ie=p._augment(new Uint8Array(te)):((ie=this).length=te,ie._isBuffer=!0),p._useTypedArrays&&typeof ne.byteLength=="number")ie._set(ne);else if(V(ue=ne)||p.isBuffer(ue)||ue&&typeof ue=="object"&&typeof ue.length=="number")for(le=0;le<te;le++)p.isBuffer(ne)?ie[le]=ne.readUInt8(le):ie[le]=ne[le];else if(de=="string")ie.write(ne,0,re);else if(de=="number"&&!p._useTypedArrays&&!Z)for(le=0;le<te;le++)ie[le]=0;return ie}function m(ne,re,Z,te){return p._charsWritten=Y(function(ie){for(var le=[],ue=0;ue<ie.length;ue++)le.push(255&ie.charCodeAt(ue));return le}(re),ne,Z,te)}function A(ne,re,Z,te){return p._charsWritten=Y(function(ie){for(var le,ue,de=[],me=0;me<ie.length;me++)ue=ie.charCodeAt(me),le=ue>>8,ue=ue%256,de.push(ue),de.push(le);return de}(re),ne,Z,te)}function g(ne,re,Z){var te="";Z=Math.min(ne.length,Z);for(var ie=re;ie<Z;ie++)te+=String.fromCharCode(ne[ie]);return te}function f(ne,re,Z,le){le||(se(typeof Z=="boolean","missing or invalid endian"),se(re!=null,"missing offset"),se(re+1<ne.length,"Trying to read beyond buffer length"));var ie,le=ne.length;if(!(le<=re))return Z?(ie=ne[re],re+1<le&&(ie|=ne[re+1]<<8)):(ie=ne[re]<<8,re+1<le&&(ie|=ne[re+1])),ie}function y(ne,re,Z,le){le||(se(typeof Z=="boolean","missing or invalid endian"),se(re!=null,"missing offset"),se(re+3<ne.length,"Trying to read beyond buffer length"));var ie,le=ne.length;if(!(le<=re))return Z?(re+2<le&&(ie=ne[re+2]<<16),re+1<le&&(ie|=ne[re+1]<<8),ie|=ne[re],re+3<le&&(ie+=ne[re+3]<<24>>>0)):(re+1<le&&(ie=ne[re+1]<<16),re+2<le&&(ie|=ne[re+2]<<8),re+3<le&&(ie|=ne[re+3]),ie+=ne[re]<<24>>>0),ie}function x(ne,re,Z,te){if(te||(se(typeof Z=="boolean","missing or invalid endian"),se(re!=null,"missing offset"),se(re+1<ne.length,"Trying to read beyond buffer length")),!(ne.length<=re))return te=f(ne,re,Z,!0),32768&te?-1*(65535-te+1):te}function C(ne,re,Z,te){if(te||(se(typeof Z=="boolean","missing or invalid endian"),se(re!=null,"missing offset"),se(re+3<ne.length,"Trying to read beyond buffer length")),!(ne.length<=re))return te=y(ne,re,Z,!0),2147483648&te?-1*(4294967295-te+1):te}function b(ne,re,Z,te){return te||(se(typeof Z=="boolean","missing or invalid endian"),se(re+3<ne.length,"Trying to read beyond buffer length")),_.read(ne,re,Z,23,4)}function I(ne,re,Z,te){return te||(se(typeof Z=="boolean","missing or invalid endian"),se(re+7<ne.length,"Trying to read beyond buffer length")),_.read(ne,re,Z,52,8)}function v(ne,re,Z,te,ie){if(ie||(se(re!=null,"missing value"),se(typeof te=="boolean","missing or invalid endian"),se(Z!=null,"missing offset"),se(Z+1<ne.length,"trying to write beyond buffer length"),K(re,65535)),ie=ne.length,!(ie<=Z))for(var le=0,ue=Math.min(ie-Z,2);le<ue;le++)ne[Z+le]=(re&255<<8*(te?le:1-le))>>>8*(te?le:1-le)}function P(ne,re,Z,te,ie){if(ie||(se(re!=null,"missing value"),se(typeof te=="boolean","missing or invalid endian"),se(Z!=null,"missing offset"),se(Z+3<ne.length,"trying to write beyond buffer length"),K(re,4294967295)),ie=ne.length,!(ie<=Z))for(var le=0,ue=Math.min(ie-Z,4);le<ue;le++)ne[Z+le]=re>>>8*(te?le:3-le)&255}function M(ne,re,Z,te,ie){ie||(se(re!=null,"missing value"),se(typeof te=="boolean","missing or invalid endian"),se(Z!=null,"missing offset"),se(Z+1<ne.length,"Trying to write beyond buffer length"),J(re,32767,-32768)),ne.length<=Z||v(ne,0<=re?re:65535+re+1,Z,te,ie)}function B(ne,re,Z,te,ie){ie||(se(re!=null,"missing value"),se(typeof te=="boolean","missing or invalid endian"),se(Z!=null,"missing offset"),se(Z+3<ne.length,"Trying to write beyond buffer length"),J(re,2147483647,-2147483648)),ne.length<=Z||P(ne,0<=re?re:4294967295+re+1,Z,te,ie)}function T(ne,re,Z,te,ie){ie||(se(re!=null,"missing value"),se(typeof te=="boolean","missing or invalid endian"),se(Z!=null,"missing offset"),se(Z+3<ne.length,"Trying to write beyond buffer length"),ee(re,340282346638528860000000000000000000000,-340282346638528860000000000000000000000)),ne.length<=Z||_.write(ne,re,Z,te,23,4)}function N(ne,re,Z,te,ie){ie||(se(re!=null,"missing value"),se(typeof te=="boolean","missing or invalid endian"),se(Z!=null,"missing offset"),se(Z+7<ne.length,"Trying to write beyond buffer length"),ee(re,179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,-179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),ne.length<=Z||_.write(ne,re,Z,te,52,8)}n.Buffer=p,n.SlowBuffer=p,n.INSPECT_MAX_BYTES=50,p.poolSize=8192,p._useTypedArrays=function(){try{var ne=new ArrayBuffer(0),re=new Uint8Array(ne);return re.foo=function(){return 42},re.foo()===42&&typeof re.subarray=="function"}catch(Z){return!1}}(),p.isEncoding=function(ne){switch(String(ne).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},p.isBuffer=function(ne){return!(ne==null||!ne._isBuffer)},p.byteLength=function(ne,re){var Z;switch(ne+="",re||"utf8"){case"hex":Z=ne.length/2;break;case"utf8":case"utf-8":Z=U(ne).length;break;case"ascii":case"binary":case"raw":Z=ne.length;break;case"base64":Z=j(ne).length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":Z=2*ne.length;break;default:throw Error("Unknown encoding")}return Z},p.concat=function(ne,re){if(se(V(ne),`Usage: Buffer.concat(list, [totalLength])
list should be an Array.`),ne.length===0)return new p(0);if(ne.length===1)return ne[0];if(typeof re!="number")for(ie=re=0;ie<ne.length;ie++)re+=ne[ie].length;for(var Z=new p(re),te=0,ie=0;ie<ne.length;ie++){var le=ne[ie];le.copy(Z,te),te+=le.length}return Z},p.prototype.write=function(ne,re,Z,te){isFinite(re)?isFinite(Z)||(te=Z,Z=void 0):(me=te,te=re,re=Z,Z=me),re=Number(re)||0;var ie,le,ue,de,me=this.length-re;switch((!Z||me<(Z=Number(Z)))&&(Z=me),te=String(te||"utf8").toLowerCase()){case"hex":ie=function(Ae,xe,Me,Re){Me=Number(Me)||0;var we=Ae.length-Me;(!Re||we<(Re=Number(Re)))&&(Re=we),se((we=xe.length)%2==0,"Invalid hex string"),we/2<Re&&(Re=we/2);for(var _e=0;_e<Re;_e++){var ye=parseInt(xe.substr(2*_e,2),16);se(!isNaN(ye),"Invalid hex string"),Ae[Me+_e]=ye}return p._charsWritten=2*_e,_e}(this,ne,re,Z);break;case"utf8":case"utf-8":le=this,ue=re,de=Z,ie=p._charsWritten=Y(U(ne),le,ue,de);break;case"ascii":case"binary":ie=m(this,ne,re,Z);break;case"base64":le=this,ue=re,de=Z,ie=p._charsWritten=Y(j(ne),le,ue,de);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":ie=A(this,ne,re,Z);break;default:throw Error("Unknown encoding")}return ie},p.prototype.toString=function(ne,re,Z){var te,ie,le,ue,de=this;if(ne=String(ne||"utf8").toLowerCase(),re=Number(re)||0,(Z=Z!==void 0?Number(Z):de.length)===re)return"";switch(ne){case"hex":te=function(me,Ae,xe){var Me=me.length;(!Ae||Ae<0)&&(Ae=0),(!xe||xe<0||Me<xe)&&(xe=Me);for(var Re="",we=Ae;we<xe;we++)Re+=O(me[we]);return Re}(de,re,Z);break;case"utf8":case"utf-8":te=function(me,Ae,xe){var Me="",Re="";xe=Math.min(me.length,xe);for(var we=Ae;we<xe;we++)me[we]<=127?(Me+=X(Re)+String.fromCharCode(me[we]),Re=""):Re+="%"+me[we].toString(16);return Me+X(Re)}(de,re,Z);break;case"ascii":case"binary":te=g(de,re,Z);break;case"base64":ie=de,ue=Z,te=(le=re)===0&&ue===ie.length?u.fromByteArray(ie):u.fromByteArray(ie.slice(le,ue));break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":te=function(me,Ae,xe){for(var Me=me.slice(Ae,xe),Re="",we=0;we<Me.length;we+=2)Re+=String.fromCharCode(Me[we]+256*Me[we+1]);return Re}(de,re,Z);break;default:throw Error("Unknown encoding")}return te},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},p.prototype.copy=function(ne,re,Z,te){if(re=re||0,(te=te||te===0?te:this.length)!==(Z=Z||0)&&ne.length!==0&&this.length!==0){se(Z<=te,"sourceEnd < sourceStart"),se(0<=re&&re<ne.length,"targetStart out of bounds"),se(0<=Z&&Z<this.length,"sourceStart out of bounds"),se(0<=te&&te<=this.length,"sourceEnd out of bounds"),te>this.length&&(te=this.length);var ie=(te=ne.length-re<te-Z?ne.length-re+Z:te)-Z;if(ie<100||!p._useTypedArrays)for(var le=0;le<ie;le++)ne[le+re]=this[le+Z];else ne._set(this.subarray(Z,Z+ie),re)}},p.prototype.slice=function(ne,re){var Z=this.length;if(ne=L(ne,Z,0),re=L(re,Z,Z),p._useTypedArrays)return p._augment(this.subarray(ne,re));for(var te=re-ne,ie=new p(te,void 0,!0),le=0;le<te;le++)ie[le]=this[le+ne];return ie},p.prototype.get=function(ne){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(ne)},p.prototype.set=function(ne,re){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(ne,re)},p.prototype.readUInt8=function(ne,re){if(re||(se(ne!=null,"missing offset"),se(ne<this.length,"Trying to read beyond buffer length")),!(ne>=this.length))return this[ne]},p.prototype.readUInt16LE=function(ne,re){return f(this,ne,!0,re)},p.prototype.readUInt16BE=function(ne,re){return f(this,ne,!1,re)},p.prototype.readUInt32LE=function(ne,re){return y(this,ne,!0,re)},p.prototype.readUInt32BE=function(ne,re){return y(this,ne,!1,re)},p.prototype.readInt8=function(ne,re){if(re||(se(ne!=null,"missing offset"),se(ne<this.length,"Trying to read beyond buffer length")),!(ne>=this.length))return 128&this[ne]?-1*(255-this[ne]+1):this[ne]},p.prototype.readInt16LE=function(ne,re){return x(this,ne,!0,re)},p.prototype.readInt16BE=function(ne,re){return x(this,ne,!1,re)},p.prototype.readInt32LE=function(ne,re){return C(this,ne,!0,re)},p.prototype.readInt32BE=function(ne,re){return C(this,ne,!1,re)},p.prototype.readFloatLE=function(ne,re){return b(this,ne,!0,re)},p.prototype.readFloatBE=function(ne,re){return b(this,ne,!1,re)},p.prototype.readDoubleLE=function(ne,re){return I(this,ne,!0,re)},p.prototype.readDoubleBE=function(ne,re){return I(this,ne,!1,re)},p.prototype.writeUInt8=function(ne,re,Z){Z||(se(ne!=null,"missing value"),se(re!=null,"missing offset"),se(re<this.length,"trying to write beyond buffer length"),K(ne,255)),re>=this.length||(this[re]=ne)},p.prototype.writeUInt16LE=function(ne,re,Z){v(this,ne,re,!0,Z)},p.prototype.writeUInt16BE=function(ne,re,Z){v(this,ne,re,!1,Z)},p.prototype.writeUInt32LE=function(ne,re,Z){P(this,ne,re,!0,Z)},p.prototype.writeUInt32BE=function(ne,re,Z){P(this,ne,re,!1,Z)},p.prototype.writeInt8=function(ne,re,Z){Z||(se(ne!=null,"missing value"),se(re!=null,"missing offset"),se(re<this.length,"Trying to write beyond buffer length"),J(ne,127,-128)),re>=this.length||(0<=ne?this.writeUInt8(ne,re,Z):this.writeUInt8(255+ne+1,re,Z))},p.prototype.writeInt16LE=function(ne,re,Z){M(this,ne,re,!0,Z)},p.prototype.writeInt16BE=function(ne,re,Z){M(this,ne,re,!1,Z)},p.prototype.writeInt32LE=function(ne,re,Z){B(this,ne,re,!0,Z)},p.prototype.writeInt32BE=function(ne,re,Z){B(this,ne,re,!1,Z)},p.prototype.writeFloatLE=function(ne,re,Z){T(this,ne,re,!0,Z)},p.prototype.writeFloatBE=function(ne,re,Z){T(this,ne,re,!1,Z)},p.prototype.writeDoubleLE=function(ne,re,Z){N(this,ne,re,!0,Z)},p.prototype.writeDoubleBE=function(ne,re,Z){N(this,ne,re,!1,Z)},p.prototype.fill=function(ne,re,Z){if(re=re||0,Z=Z||this.length,se(typeof(ne=typeof(ne=ne||0)=="string"?ne.charCodeAt(0):ne)=="number"&&!isNaN(ne),"value is not a number"),se(re<=Z,"end < start"),Z!==re&&this.length!==0){se(0<=re&&re<this.length,"start out of bounds"),se(0<=Z&&Z<=this.length,"end out of bounds");for(var te=re;te<Z;te++)this[te]=ne}},p.prototype.inspect=function(){for(var ne=[],re=this.length,Z=0;Z<re;Z++)if(ne[Z]=O(this[Z]),Z===n.INSPECT_MAX_BYTES){ne[Z+1]="...";break}return"<Buffer "+ne.join(" ")+">"},p.prototype.toArrayBuffer=function(){if(typeof Uint8Array>"u")throw Error("Buffer.toArrayBuffer not supported in this browser");if(p._useTypedArrays)return new p(this).buffer;for(var ne=new Uint8Array(this.length),re=0,Z=ne.length;re<Z;re+=1)ne[re]=this[re];return ne.buffer};var D=p.prototype;function L(ne,re,Z){return typeof ne!="number"?Z:re<=(ne=~~ne)?re:0<=ne||0<=(ne+=re)?ne:0}function H(ne){return(ne=~~Math.ceil(+ne))<0?0:ne}function V(ne){return(Array.isArray||function(re){return Object.prototype.toString.call(re)==="[object Array]"})(ne)}function O(ne){return ne<16?"0"+ne.toString(16):ne.toString(16)}function U(ne){for(var re=[],Z=0;Z<ne.length;Z++){var te=ne.charCodeAt(Z);if(te<=127)re.push(ne.charCodeAt(Z));else for(var ie=Z,le=(55296<=te&&te<=57343&&Z++,encodeURIComponent(ne.slice(ie,Z+1)).substr(1).split("%")),ue=0;ue<le.length;ue++)re.push(parseInt(le[ue],16))}return re}function j(ne){return u.toByteArray(ne)}function Y(ne,re,Z,te){for(var ie=0;ie<te&&!(ie+Z>=re.length||ie>=ne.length);ie++)re[ie+Z]=ne[ie];return ie}function X(ne){try{return decodeURIComponent(ne)}catch(re){return String.fromCharCode(65533)}}function K(ne,re){se(typeof ne=="number","cannot write a non-number as a number"),se(0<=ne,"specified a negative value for writing an unsigned value"),se(ne<=re,"value is larger than maximum value for type"),se(Math.floor(ne)===ne,"value has a fractional component")}function J(ne,re,Z){se(typeof ne=="number","cannot write a non-number as a number"),se(ne<=re,"value larger than maximum allowed value"),se(Z<=ne,"value smaller than minimum allowed value"),se(Math.floor(ne)===ne,"value has a fractional component")}function ee(ne,re,Z){se(typeof ne=="number","cannot write a non-number as a number"),se(ne<=re,"value larger than maximum allowed value"),se(Z<=ne,"value smaller than minimum allowed value")}function se(ne,re){if(!ne)throw Error(re||"Failed assertion")}p._augment=function(ne){return ne._isBuffer=!0,ne._get=ne.get,ne._set=ne.set,ne.get=D.get,ne.set=D.set,ne.write=D.write,ne.toString=D.toString,ne.toLocaleString=D.toString,ne.toJSON=D.toJSON,ne.copy=D.copy,ne.slice=D.slice,ne.readUInt8=D.readUInt8,ne.readUInt16LE=D.readUInt16LE,ne.readUInt16BE=D.readUInt16BE,ne.readUInt32LE=D.readUInt32LE,ne.readUInt32BE=D.readUInt32BE,ne.readInt8=D.readInt8,ne.readInt16LE=D.readInt16LE,ne.readInt16BE=D.readInt16BE,ne.readInt32LE=D.readInt32LE,ne.readInt32BE=D.readInt32BE,ne.readFloatLE=D.readFloatLE,ne.readFloatBE=D.readFloatBE,ne.readDoubleLE=D.readDoubleLE,ne.readDoubleBE=D.readDoubleBE,ne.writeUInt8=D.writeUInt8,ne.writeUInt16LE=D.writeUInt16LE,ne.writeUInt16BE=D.writeUInt16BE,ne.writeUInt32LE=D.writeUInt32LE,ne.writeUInt32BE=D.writeUInt32BE,ne.writeInt8=D.writeInt8,ne.writeInt16LE=D.writeInt16LE,ne.writeInt16BE=D.writeInt16BE,ne.writeInt32LE=D.writeInt32LE,ne.writeInt32BE=D.writeInt32BE,ne.writeFloatLE=D.writeFloatLE,ne.writeFloatBE=D.writeFloatBE,ne.writeDoubleLE=D.writeDoubleLE,ne.writeDoubleBE=D.writeDoubleBE,ne.fill=D.fill,ne.inspect=D.inspect,ne.toArrayBuffer=D.toArrayBuffer,ne}}).call(this,e("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/buffer/index.js","/node_modules/gulp-browserify/node_modules/buffer")},{"base64-js":2,buffer:3,ieee754:10,lYpoI2:11}],4:[function(e,t,n){(function(o,r,u,s,a,c,l,h,d){var u=e("buffer").Buffer,_=4,p=new u(_);p.fill(0),t.exports={hash:function(m,A,g,f){for(var y=A(function(v,P){v.length%_!=0&&(M=v.length+(_-v.length%_),v=u.concat([v,p],M));for(var M,B=[],T=P?v.readInt32BE:v.readInt32LE,N=0;N<v.length;N+=_)B.push(T.call(v,N));return B}(m=u.isBuffer(m)?m:new u(m),f),8*m.length),A=f,x=new u(g),C=A?x.writeInt32BE:x.writeInt32LE,b=0;b<y.length;b++)C.call(x,y[b],4*b,!0);return x}}}).call(this,e("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/helpers.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:11}],5:[function(e,t,n){(function(o,r,u,s,a,c,l,h,d){var u=e("buffer").Buffer,_=e("./sha"),p=e("./sha256"),m=e("./rng"),A={sha1:_,sha256:p,md5:e("./md5")},g=64,f=new u(g);function y(v,P){var M=A[v=v||"sha1"],B=[];return M||x("algorithm:",v,"is not yet supported"),{update:function(T){return u.isBuffer(T)||(T=new u(T)),B.push(T),T.length,this},digest:function(T){var N=u.concat(B),N=P?function(D,L,H){u.isBuffer(L)||(L=new u(L)),u.isBuffer(H)||(H=new u(H)),L.length>g?L=D(L):L.length<g&&(L=u.concat([L,f],g));for(var V=new u(g),O=new u(g),U=0;U<g;U++)V[U]=54^L[U],O[U]=92^L[U];return H=D(u.concat([V,H])),D(u.concat([O,H]))}(M,P,N):M(N);return B=null,T?N.toString(T):N}}}function x(){var v=[].slice.call(arguments).join(" ");throw Error([v,"we accept pull requests","http://github.com/dominictarr/crypto-browserify"].join(`
`))}f.fill(0),n.createHash=function(v){return y(v)},n.createHmac=y,n.randomBytes=function(v,P){if(!P||!P.call)return new u(m(v));try{P.call(this,void 0,new u(m(v)))}catch(M){P(M)}};var C,b=["createCredentials","createCipher","createCipheriv","createDecipher","createDecipheriv","createSign","createVerify","createDiffieHellman","pbkdf2"],I=function(v){n[v]=function(){x("sorry,",v,"is not implemented yet")}};for(C in b)I(b[C],C)}).call(this,e("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/index.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./md5":6,"./rng":7,"./sha":8,"./sha256":9,buffer:3,lYpoI2:11}],6:[function(e,t,n){(function(o,r,i,s,a,c,l,h,d){var u=e("./helpers");function _(x,C){x[C>>5]|=128<<C%32,x[14+(C+64>>>9<<4)]=C;for(var b=1732584193,I=-271733879,v=-1732584194,P=271733878,M=0;M<x.length;M+=16){var B=b,T=I,N=v,D=P,b=m(b,I,v,P,x[M+0],7,-680876936),P=m(P,b,I,v,x[M+1],12,-389564586),v=m(v,P,b,I,x[M+2],17,606105819),I=m(I,v,P,b,x[M+3],22,-1044525330);b=m(b,I,v,P,x[M+4],7,-176418897),P=m(P,b,I,v,x[M+5],12,1200080426),v=m(v,P,b,I,x[M+6],17,-1473231341),I=m(I,v,P,b,x[M+7],22,-45705983),b=m(b,I,v,P,x[M+8],7,1770035416),P=m(P,b,I,v,x[M+9],12,-1958414417),v=m(v,P,b,I,x[M+10],17,-42063),I=m(I,v,P,b,x[M+11],22,-1990404162),b=m(b,I,v,P,x[M+12],7,1804603682),P=m(P,b,I,v,x[M+13],12,-40341101),v=m(v,P,b,I,x[M+14],17,-1502002290),b=A(b,I=m(I,v,P,b,x[M+15],22,1236535329),v,P,x[M+1],5,-165796510),P=A(P,b,I,v,x[M+6],9,-1069501632),v=A(v,P,b,I,x[M+11],14,643717713),I=A(I,v,P,b,x[M+0],20,-373897302),b=A(b,I,v,P,x[M+5],5,-701558691),P=A(P,b,I,v,x[M+10],9,38016083),v=A(v,P,b,I,x[M+15],14,-660478335),I=A(I,v,P,b,x[M+4],20,-405537848),b=A(b,I,v,P,x[M+9],5,568446438),P=A(P,b,I,v,x[M+14],9,-1019803690),v=A(v,P,b,I,x[M+3],14,-187363961),I=A(I,v,P,b,x[M+8],20,1163531501),b=A(b,I,v,P,x[M+13],5,-1444681467),P=A(P,b,I,v,x[M+2],9,-51403784),v=A(v,P,b,I,x[M+7],14,1735328473),b=g(b,I=A(I,v,P,b,x[M+12],20,-1926607734),v,P,x[M+5],4,-378558),P=g(P,b,I,v,x[M+8],11,-2022574463),v=g(v,P,b,I,x[M+11],16,1839030562),I=g(I,v,P,b,x[M+14],23,-35309556),b=g(b,I,v,P,x[M+1],4,-1530992060),P=g(P,b,I,v,x[M+4],11,1272893353),v=g(v,P,b,I,x[M+7],16,-155497632),I=g(I,v,P,b,x[M+10],23,-1094730640),b=g(b,I,v,P,x[M+13],4,681279174),P=g(P,b,I,v,x[M+0],11,-358537222),v=g(v,P,b,I,x[M+3],16,-722521979),I=g(I,v,P,b,x[M+6],23,76029189),b=g(b,I,v,P,x[M+9],4,-640364487),P=g(P,b,I,v,x[M+12],11,-421815835),v=g(v,P,b,I,x[M+15],16,530742520),b=f(b,I=g(I,v,P,b,x[M+2],23,-995338651),v,P,x[M+0],6,-198630844),P=f(P,b,I,v,x[M+7],10,1126891415),v=f(v,P,b,I,x[M+14],15,-1416354905),I=f(I,v,P,b,x[M+5],21,-57434055),b=f(b,I,v,P,x[M+12],6,1700485571),P=f(P,b,I,v,x[M+3],10,-1894986606),v=f(v,P,b,I,x[M+10],15,-1051523),I=f(I,v,P,b,x[M+1],21,-2054922799),b=f(b,I,v,P,x[M+8],6,1873313359),P=f(P,b,I,v,x[M+15],10,-30611744),v=f(v,P,b,I,x[M+6],15,-1560198380),I=f(I,v,P,b,x[M+13],21,1309151649),b=f(b,I,v,P,x[M+4],6,-145523070),P=f(P,b,I,v,x[M+11],10,-1120210379),v=f(v,P,b,I,x[M+2],15,718787259),I=f(I,v,P,b,x[M+9],21,-343485551),b=y(b,B),I=y(I,T),v=y(v,N),P=y(P,D)}return Array(b,I,v,P)}function p(x,C,b,I,v,P){return y((C=y(y(C,x),y(I,P)))<<v|C>>>32-v,b)}function m(x,C,b,I,v,P,M){return p(C&b|~C&I,x,C,v,P,M)}function A(x,C,b,I,v,P,M){return p(C&I|b&~I,x,C,v,P,M)}function g(x,C,b,I,v,P,M){return p(C^b^I,x,C,v,P,M)}function f(x,C,b,I,v,P,M){return p(b^(C|~I),x,C,v,P,M)}function y(x,C){var b=(65535&x)+(65535&C);return(x>>16)+(C>>16)+(b>>16)<<16|65535&b}t.exports=function(x){return u.hash(x,_,16)}}).call(this,e("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/md5.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],7:[function(e,t,n){(function(o,r,i,s,a,c,l,h,d){var u;t.exports=u||function(_){for(var p,m=Array(_),A=0;A<_;A++)(3&A)==0&&(p=4294967296*Math.random()),m[A]=p>>>((3&A)<<3)&255;return m}}).call(this,e("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/rng.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:11}],8:[function(e,t,n){(function(o,r,i,s,a,c,l,h,d){var u=e("./helpers");function _(A,g){A[g>>5]|=128<<24-g%32,A[15+(g+64>>9<<4)]=g;for(var f,y,x,C=Array(80),b=1732584193,I=-271733879,v=-1732584194,P=271733878,M=-1009589776,B=0;B<A.length;B+=16){for(var T=b,N=I,D=v,L=P,H=M,V=0;V<80;V++){C[V]=V<16?A[B+V]:m(C[V-3]^C[V-8]^C[V-14]^C[V-16],1);var O=p(p(m(b,5),(O=I,y=v,x=P,(f=V)<20?O&y|~O&x:!(f<40)&&f<60?O&y|O&x|y&x:O^y^x)),p(p(M,C[V]),(f=V)<20?1518500249:f<40?1859775393:f<60?-1894007588:-899497514)),M=P,P=v,v=m(I,30),I=b,b=O}b=p(b,T),I=p(I,N),v=p(v,D),P=p(P,L),M=p(M,H)}return Array(b,I,v,P,M)}function p(A,g){var f=(65535&A)+(65535&g);return(A>>16)+(g>>16)+(f>>16)<<16|65535&f}function m(A,g){return A<<g|A>>>32-g}t.exports=function(A){return u.hash(A,_,20,!0)}}).call(this,e("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],9:[function(e,t,n){(function(o,r,i,s,a,c,l,h,d){function u(g,f){var y=(65535&g)+(65535&f);return(g>>16)+(f>>16)+(y>>16)<<16|65535&y}function _(g,f){var y,x=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],C=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],b=Array(64);g[f>>5]|=128<<24-f%32,g[15+(f+64>>9<<4)]=f;for(var I,v,P=0;P<g.length;P+=16){for(var M=C[0],B=C[1],T=C[2],N=C[3],D=C[4],L=C[5],H=C[6],V=C[7],O=0;O<64;O++)b[O]=O<16?g[O+P]:u(u(u((v=b[O-2],m(v,17)^m(v,19)^A(v,10)),b[O-7]),(v=b[O-15],m(v,7)^m(v,18)^A(v,3))),b[O-16]),y=u(u(u(u(V,m(v=D,6)^m(v,11)^m(v,25)),D&L^~D&H),x[O]),b[O]),I=u(m(I=M,2)^m(I,13)^m(I,22),M&B^M&T^B&T),V=H,H=L,L=D,D=u(N,y),N=T,T=B,B=M,M=u(y,I);C[0]=u(M,C[0]),C[1]=u(B,C[1]),C[2]=u(T,C[2]),C[3]=u(N,C[3]),C[4]=u(D,C[4]),C[5]=u(L,C[5]),C[6]=u(H,C[6]),C[7]=u(V,C[7])}return C}var p=e("./helpers"),m=function(g,f){return g>>>f|g<<32-f},A=function(g,f){return g>>>f};t.exports=function(g){return p.hash(g,_,32,!0)}}).call(this,e("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha256.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],10:[function(e,t,n){(function(o,r,i,s,a,c,l,h,d){n.read=function(u,_,p,m,P){var g,f,y=8*P-m-1,x=(1<<y)-1,C=x>>1,b=-7,I=p?P-1:0,v=p?-1:1,P=u[_+I];for(I+=v,g=P&(1<<-b)-1,P>>=-b,b+=y;0<b;g=256*g+u[_+I],I+=v,b-=8);for(f=g&(1<<-b)-1,g>>=-b,b+=m;0<b;f=256*f+u[_+I],I+=v,b-=8);if(g===0)g=1-C;else{if(g===x)return f?NaN:1/0*(P?-1:1);f+=Math.pow(2,m),g-=C}return(P?-1:1)*f*Math.pow(2,g-m)},n.write=function(u,_,p,m,A,M){var f,y,x=8*M-A-1,C=(1<<x)-1,b=C>>1,I=A===23?Math.pow(2,-24)-Math.pow(2,-77):0,v=m?0:M-1,P=m?1:-1,M=_<0||_===0&&1/_<0?1:0;for(_=Math.abs(_),isNaN(_)||_===1/0?(y=isNaN(_)?1:0,f=C):(f=Math.floor(Math.log(_)/Math.LN2),_*(m=Math.pow(2,-f))<1&&(f--,m*=2),2<=(_+=1<=f+b?I/m:I*Math.pow(2,1-b))*m&&(f++,m/=2),C<=f+b?(y=0,f=C):1<=f+b?(y=(_*m-1)*Math.pow(2,A),f+=b):(y=_*Math.pow(2,b-1)*Math.pow(2,A),f=0));8<=A;u[p+v]=255&y,v+=P,y/=256,A-=8);for(f=f<<A|y,x+=A;0<x;u[p+v]=255&f,v+=P,f/=256,x-=8);u[p+v-P]|=128*M}}).call(this,e("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/ieee754/index.js","/node_modules/gulp-browserify/node_modules/ieee754")},{buffer:3,lYpoI2:11}],11:[function(e,t,n){(function(o,r,i,s,a,c,l,h,d){var u,_,p;function m(){}(o=t.exports={}).nextTick=(_=typeof window<"u"&&window.setImmediate,p=typeof window<"u"&&window.postMessage&&window.addEventListener,_?function(A){return window.setImmediate(A)}:p?(u=[],window.addEventListener("message",function(A){var g=A.source;g!==window&&g!==null||A.data!=="process-tick"||(A.stopPropagation(),0<u.length&&u.shift()())},!0),function(A){u.push(A),window.postMessage("process-tick","*")}):function(A){setTimeout(A,0)}),o.title="browser",o.browser=!0,o.env={},o.argv=[],o.on=m,o.addListener=m,o.once=m,o.off=m,o.removeListener=m,o.removeAllListeners=m,o.emit=m,o.binding=function(A){throw Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(A){throw Error("process.chdir is not supported")}}).call(this,e("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/process/browser.js","/node_modules/gulp-browserify/node_modules/process")},{buffer:3,lYpoI2:11}]},{},[1])(1)})});var Ett=pt(function(AKs,Vpn){Vpn.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var Gpn=pt(function(fKs,Ypn){Ypn.exports=function(t){if(!t||typeof t==="string")return!1;return t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&t.constructor.name!=="String")}});var Xpn=pt(function(yKs,Wpn){var jBr=Gpn(),KBr=Array.prototype.concat,$Br=Array.prototype.slice,Upn=Wpn.exports=function(t){var n=[];for(var o=0,r=t.length;o<r;o++){var i=t[o];if(jBr(i))n=KBr.call(n,$Br.call(i));else n.push(i)}return n};Upn.wrap=function(e){return function(){return e(Upn(arguments))}}});var qpn=pt(function(xKs,$pn){var Dhe=Ett(),Nhe=Xpn(),jpn=Object.hasOwnProperty,Kpn=Object.create(null);for(The in Dhe)if(jpn.call(Dhe,The))Kpn[Dhe[The]]=The;var The,F3=$pn.exports={to:{},get:{}};F3.get=function(e){var t=e.substring(0,3).toLowerCase(),n,o;switch(t){case"hsl":n=F3.get.hsl(e),o="hsl";break;case"hwb":n=F3.get.hwb(e),o="hwb";break;default:n=F3.get.rgb(e),o="rgb";break}if(!n)return null;return{model:o,value:n}};F3.get.rgb=function(e){if(!e)return null;var t=/^#([a-f0-9]{3,4})$/i,n=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,o=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,r=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,i=/^(\w+)$/,s=[0,0,0,1],a,c,l;if(a=e.match(n)){l=a[2],a=a[1];for(c=0;c<3;c++){var h=c*2;s[c]=parseInt(a.slice(h,h+2),16)}if(l)s[3]=parseInt(l,16)/255}else if(a=e.match(t)){a=a[1],l=a[3];for(c=0;c<3;c++)s[c]=parseInt(a[c]+a[c],16);if(l)s[3]=parseInt(l+l,16)/255}else if(a=e.match(o)){for(c=0;c<3;c++)s[c]=parseInt(a[c+1],0);if(a[4])if(a[5])s[3]=parseFloat(a[4])*0.01;else s[3]=parseFloat(a[4])}else if(a=e.match(r)){for(c=0;c<3;c++)s[c]=Math.round(parseFloat(a[c+1])*2.55);if(a[4])if(a[5])s[3]=parseFloat(a[4])*0.01;else s[3]=parseFloat(a[4])}else if(a=e.match(i)){if(a[1]==="transparent")return[0,0,0,0];if(!jpn.call(Dhe,a[1]))return null;return s=Dhe[a[1]],s[3]=1,s}else return null;for(c=0;c<3;c++)s[c]=fk(s[c],0,255);return s[3]=fk(s[3],0,1),s};F3.get.hsl=function(e){if(!e)return null;var t=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,n=e.match(t);if(n){var o=parseFloat(n[4]),r=(parseFloat(n[1])%360+360)%360,i=fk(parseFloat(n[2]),0,100),s=fk(parseFloat(n[3]),0,100),a=fk(isNaN(o)?1:o,0,1);return[r,i,s,a]}return null};F3.get.hwb=function(e){if(!e)return null;var t=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,n=e.match(t);if(n){var o=parseFloat(n[4]),r=(parseFloat(n[1])%360+360)%360,i=fk(parseFloat(n[2]),0,100),s=fk(parseFloat(n[3]),0,100),a=fk(isNaN(o)?1:o,0,1);return[r,i,s,a]}return null};F3.to.hex=function(){var e=Nhe(arguments);return"#"+_Ie(e[0])+_Ie(e[1])+_Ie(e[2])+(e[3]<1?_Ie(Math.round(e[3]*255)):"")};F3.to.rgb=function(){var e=Nhe(arguments);return e.length<4||e[3]===1?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"};F3.to.rgb.percent=function(){var e=Nhe(arguments),t=Math.round(e[0]/255*100),n=Math.round(e[1]/255*100),o=Math.round(e[2]/255*100);return e.length<4||e[3]===1?"rgb("+t+"%, "+n+"%, "+o+"%)":"rgba("+t+"%, "+n+"%, "+o+"%, "+e[3]+")"};F3.to.hsl=function(){var e=Nhe(arguments);return e.length<4||e[3]===1?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"};F3.to.hwb=function(){var e=Nhe(arguments),t="";if(e.length>=4&&e[3]!==1)t=", "+e[3];return"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"};F3.to.keyword=function(e){return Kpn[e.slice(0,3)]};function fk(e,t,n){return Math.min(Math.max(t,e),n)}function _Ie(e){var t=Math.round(e).toString(16).toUpperCase();return t.length<2?"0"+t:t}});var Mtt=pt(function(CKs,Zpn){var Rhe=Ett(),Jpn={};for(let e of Object.keys(Rhe))Jpn[Rhe[e]]=e;var yi={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};Zpn.exports=yi;for(let e of Object.keys(yi)){if(!("channels"in yi[e]))throw Error("missing channels property: "+e);if(!("labels"in yi[e]))throw Error("missing channel labels property: "+e);if(yi[e].labels.length!==yi[e].channels)throw Error("channel and label counts mismatch: "+e);let{channels:t,labels:n}=yi[e];delete yi[e].channels,delete yi[e].labels,Object.defineProperty(yi[e],"channels",{value:t}),Object.defineProperty(yi[e],"labels",{value:n})}yi.rgb.hsl=function(e){let t=e[0]/255,n=e[1]/255,o=e[2]/255,r=Math.min(t,n,o),i=Math.max(t,n,o),s=i-r,a,c;if(i===r)a=0;else if(t===i)a=(n-o)/s;else if(n===i)a=2+(o-t)/s;else if(o===i)a=4+(t-n)/s;if(a=Math.min(a*60,360),a<0)a+=360;let l=(r+i)/2;if(i===r)c=0;else if(l<=0.5)c=s/(i+r);else c=s/(2-i-r);return[a,c*100,l*100]};yi.rgb.hsv=function(e){let t,n,o,r,i,s=e[0]/255,a=e[1]/255,c=e[2]/255,l=Math.max(s,a,c),h=l-Math.min(s,a,c),d=function(u){return(l-u)/6/h+0.5};if(h===0)r=0,i=0;else{if(i=h/l,t=d(s),n=d(a),o=d(c),s===l)r=o-n;else if(a===l)r=0.3333333333333333+t-o;else if(c===l)r=0.6666666666666666+n-t;if(r<0)r+=1;else if(r>1)r-=1}return[r*360,i*100,l*100]};yi.rgb.hwb=function(e){let t=e[0],n=e[1],o=e[2],r=yi.rgb.hsl(e)[0],i=0.00392156862745098*Math.min(t,Math.min(n,o));return o=1-0.00392156862745098*Math.max(t,Math.max(n,o)),[r,i*100,o*100]};yi.rgb.cmyk=function(e){let t=e[0]/255,n=e[1]/255,o=e[2]/255,r=Math.min(1-t,1-n,1-o),i=(1-t-r)/(1-r)||0,s=(1-n-r)/(1-r)||0,a=(1-o-r)/(1-r)||0;return[i*100,s*100,a*100,r*100]};function qBr(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}yi.rgb.keyword=function(e){let t=Jpn[e];if(t)return t;let n=1/0,o;for(let r of Object.keys(Rhe)){let i=Rhe[r],s=qBr(e,i);if(s<n)n=s,o=r}return o};yi.keyword.rgb=function(e){return Rhe[e]};yi.rgb.xyz=function(e){let t=e[0]/255,n=e[1]/255,o=e[2]/255;t=t>0.04045?((t+0.055)/1.055)**2.4:t/12.92,n=n>0.04045?((n+0.055)/1.055)**2.4:n/12.92,o=o>0.04045?((o+0.055)/1.055)**2.4:o/12.92;let r=t*0.4124+n*0.3576+o*0.1805,i=t*0.2126+n*0.7152+o*0.0722,s=t*0.0193+n*0.1192+o*0.9505;return[r*100,i*100,s*100]};yi.rgb.lab=function(e){let t=yi.rgb.xyz(e),n=t[0],o=t[1],r=t[2];n/=95.047,o/=100,r/=108.883,n=n>0.008856?n**0.3333333333333333:7.787*n+0.13793103448275862,o=o>0.008856?o**0.3333333333333333:7.787*o+0.13793103448275862,r=r>0.008856?r**0.3333333333333333:7.787*r+0.13793103448275862;let i=116*o-16,s=500*(n-o),a=200*(o-r);return[i,s,a]};yi.hsl.rgb=function(e){let t=e[0]/360,n=e[1]/100,o=e[2]/100,r,i,s;if(n===0)return s=o*255,[s,s,s];if(o<0.5)r=o*(1+n);else r=o+n-o*n;let a=2*o-r,c=[0,0,0];for(let l=0;l<3;l++){if(i=t+0.3333333333333333*-(l-1),i<0)i++;if(i>1)i--;if(6*i<1)s=a+(r-a)*6*i;else if(2*i<1)s=r;else if(3*i<2)s=a+(r-a)*(0.6666666666666666-i)*6;else s=a;c[l]=s*255}return c};yi.hsl.hsv=function(e){let t=e[0],n=e[1]/100,o=e[2]/100,r=n,i=Math.max(o,0.01);o*=2,n*=o<=1?o:2-o,r*=i<=1?i:2-i;let s=(o+n)/2,a=o===0?2*r/(i+r):2*n/(o+n);return[t,a*100,s*100]};yi.hsv.rgb=function(e){let t=e[0]/60,n=e[1]/100,o=e[2]/100,r=Math.floor(t)%6,i=t-Math.floor(t),s=255*o*(1-n),a=255*o*(1-n*i),c=255*o*(1-n*(1-i));switch(o*=255,r){case 0:return[o,c,s];case 1:return[a,o,s];case 2:return[s,o,c];case 3:return[s,a,o];case 4:return[c,s,o];case 5:return[o,s,a]}};yi.hsv.hsl=function(e){let t=e[0],n=e[1]/100,o=e[2]/100,r=Math.max(o,0.01),i,s;s=(2-n)*o;let a=(2-n)*r;return i=n*r,i/=a<=1?a:2-a,i=i||0,s/=2,[t,i*100,s*100]};yi.hwb.rgb=function(e){let t=e[0]/360,n=e[1]/100,o=e[2]/100,r=n+o,i;if(r>1)n/=r,o/=r;let s=Math.floor(6*t),a=1-o;if(i=6*t-s,(s&1)!==0)i=1-i;let c=n+i*(a-n),l,h,d;switch(s){default:case 6:case 0:l=a,h=c,d=n;break;case 1:l=c,h=a,d=n;break;case 2:l=n,h=a,d=c;break;case 3:l=n,h=c,d=a;break;case 4:l=c,h=n,d=a;break;case 5:l=a,h=n,d=c;break}return[l*255,h*255,d*255]};yi.cmyk.rgb=function(e){let t=e[0]/100,n=e[1]/100,o=e[2]/100,r=e[3]/100,i=1-Math.min(1,t*(1-r)+r),s=1-Math.min(1,n*(1-r)+r),a=1-Math.min(1,o*(1-r)+r);return[i*255,s*255,a*255]};yi.xyz.rgb=function(e){let t=e[0]/100,n=e[1]/100,o=e[2]/100,r,i,s;return r=t*3.2406+n*-1.5372+o*-0.4986,i=t*-0.9689+n*1.8758+o*0.0415,s=t*0.0557+n*-0.204+o*1.057,r=r>0.0031308?1.055*r**0.4166666666666667-0.055:r*12.92,i=i>0.0031308?1.055*i**0.4166666666666667-0.055:i*12.92,s=s>0.0031308?1.055*s**0.4166666666666667-0.055:s*12.92,r=Math.min(Math.max(0,r),1),i=Math.min(Math.max(0,i),1),s=Math.min(Math.max(0,s),1),[r*255,i*255,s*255]};yi.xyz.lab=function(e){let t=e[0],n=e[1],o=e[2];t/=95.047,n/=100,o/=108.883,t=t>0.008856?t**0.3333333333333333:7.787*t+0.13793103448275862,n=n>0.008856?n**0.3333333333333333:7.787*n+0.13793103448275862,o=o>0.008856?o**0.3333333333333333:7.787*o+0.13793103448275862;let r=116*n-16,i=500*(t-n),s=200*(n-o);return[r,i,s]};yi.lab.xyz=function(e){let t=e[0],n=e[1],o=e[2],r,i,s;i=(t+16)/116,r=n/500+i,s=i-o/200;let a=i**3,c=r**3,l=s**3;return i=a>0.008856?a:(i-0.13793103448275862)/7.787,r=c>0.008856?c:(r-0.13793103448275862)/7.787,s=l>0.008856?l:(s-0.13793103448275862)/7.787,r*=95.047,i*=100,s*=108.883,[r,i,s]};yi.lab.lch=function(e){let t=e[0],n=e[1],o=e[2],r;if(r=Math.atan2(o,n)*360/2/Math.PI,r<0)r+=360;let s=Math.sqrt(n*n+o*o);return[t,s,r]};yi.lch.lab=function(e){let t=e[0],n=e[1],r=e[2]/360*2*Math.PI,i=n*Math.cos(r),s=n*Math.sin(r);return[t,i,s]};yi.rgb.ansi16=function(e,t=null){let[n,o,r]=e,i=t===null?yi.rgb.hsv(e)[2]:t;if(i=Math.round(i/50),i===0)return 30;let s=30+(Math.round(r/255)<<2|Math.round(o/255)<<1|Math.round(n/255));if(i===2)s+=60;return s};yi.hsv.ansi16=function(e){return yi.rgb.ansi16(yi.hsv.rgb(e),e[2])};yi.rgb.ansi256=function(e){let t=e[0],n=e[1],o=e[2];if(t===n&&n===o){if(t<8)return 16;if(t>248)return 231;return Math.round((t-8)/247*24)+232}return 16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(o/255*5)};yi.ansi16.rgb=function(e){let t=e%10;if(t===0||t===7){if(e>50)t+=3.5;return t=t/10.5*255,[t,t,t]}let n=(~~(e>50)+1)*0.5,o=(t&1)*n*255,r=(t>>1&1)*n*255,i=(t>>2&1)*n*255;return[o,r,i]};yi.ansi256.rgb=function(e){if(e>=232){let i=(e-232)*10+8;return[i,i,i]}e-=16;let t,n=Math.floor(e/36)/5*255,o=Math.floor((t=e%36)/6)/5*255,r=t%6/5*255;return[n,o,r]};yi.rgb.hex=function(e){let n=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".substring(n.length)+n};yi.hex.rgb=function(e){let t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let n=t[0];if(t[0].length===3)n=n.split("").map((a)=>a+a).join("");let o=parseInt(n,16),r=o>>16&255,i=o>>8&255,s=o&255;return[r,i,s]};yi.rgb.hcg=function(e){let t=e[0]/255,n=e[1]/255,o=e[2]/255,r=Math.max(Math.max(t,n),o),i=Math.min(Math.min(t,n),o),s=r-i,a,c;if(s<1)a=i/(1-s);else a=0;if(s<=0)c=0;else if(r===t)c=(n-o)/s%6;else if(r===n)c=2+(o-t)/s;else c=4+(t-n)/s;return c/=6,c%=1,[c*360,s*100,a*100]};yi.hsl.hcg=function(e){let t=e[1]/100,n=e[2]/100,o=n<0.5?2*t*n:2*t*(1-n),r=0;if(o<1)r=(n-0.5*o)/(1-o);return[e[0],o*100,r*100]};yi.hsv.hcg=function(e){let t=e[1]/100,n=e[2]/100,o=t*n,r=0;if(o<1)r=(n-o)/(1-o);return[e[0],o*100,r*100]};yi.hcg.rgb=function(e){let t=e[0]/360,n=e[1]/100,o=e[2]/100;if(n===0)return[o*255,o*255,o*255];let r=[0,0,0],i=t%1*6,s=i%1,a=1-s,c=0;switch(Math.floor(i)){case 0:r[0]=1,r[1]=s,r[2]=0;break;case 1:r[0]=a,r[1]=1,r[2]=0;break;case 2:r[0]=0,r[1]=1,r[2]=s;break;case 3:r[0]=0,r[1]=a,r[2]=1;break;case 4:r[0]=s,r[1]=0,r[2]=1;break;default:r[0]=1,r[1]=0,r[2]=a}return c=(1-n)*o,[(n*r[0]+c)*255,(n*r[1]+c)*255,(n*r[2]+c)*255]};yi.hcg.hsv=function(e){let t=e[1]/100,n=e[2]/100,o=t+n*(1-t),r=0;if(o>0)r=t/o;return[e[0],r*100,o*100]};yi.hcg.hsl=function(e){let t=e[1]/100,o=e[2]/100*(1-t)+0.5*t,r=0;if(o>0&&o<0.5)r=t/(2*o);else if(o>=0.5&&o<1)r=t/(2*(1-o));return[e[0],r*100,o*100]};yi.hcg.hwb=function(e){let t=e[1]/100,n=e[2]/100,o=t+n*(1-t);return[e[0],(o-t)*100,(1-o)*100]};yi.hwb.hcg=function(e){let t=e[1]/100,o=1-e[2]/100,r=o-t,i=0;if(r<1)i=(o-r)/(1-r);return[e[0],r*100,i*100]};yi.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};yi.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};yi.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};yi.gray.hsl=function(e){return[0,0,e[0]]};yi.gray.hsv=yi.gray.hsl;yi.gray.hwb=function(e){return[0,100,e[0]]};yi.gray.cmyk=function(e){return[0,0,0,e[0]]};yi.gray.lab=function(e){return[e[0],0,0]};yi.gray.hex=function(e){let t=Math.round(e[0]/100*255)&255,o=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(o.length)+o};yi.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}});var tmn=pt(function(bKs,emn){var gIe=Mtt();function JBr(){let e={},t=Object.keys(gIe);for(let n=t.length,o=0;o<n;o++)e[t[o]]={distance:-1,parent:null};return e}function ZBr(e){let t=JBr(),n=[e];t[e].distance=0;while(n.length){let o=n.pop(),r=Object.keys(gIe[o]);for(let i=r.length,s=0;s<i;s++){let a=r[s],c=t[a];if(c.distance===-1)c.distance=t[o].distance+1,c.parent=o,n.unshift(a)}}return t}function eTr(e,t){return function(n){return t(e(n))}}function tTr(e,t){let n=[t[e].parent,e],o=gIe[t[e].parent][e],r=t[e].parent;while(t[r].parent)n.unshift(t[r].parent),o=eTr(gIe[t[r].parent][r],o),r=t[r].parent;return o.conversion=n,o}emn.exports=function(e){let t=ZBr(e),n={},o=Object.keys(t);for(let r=o.length,i=0;i<r;i++){let s=o[i];if(t[s].parent===null)continue;n[s]=tTr(s,t)}return n}});var omn=pt(function(IKs,nmn){var wtt=Mtt(),nTr=tmn(),pJ={},oTr=Object.keys(wtt);function rTr(e){let t=function(...n){let o=n[0];if(o===void 0||o===null)return o;if(o.length>1)n=o;return e(n)};if("conversion"in e)t.conversion=e.conversion;return t}function iTr(e){let t=function(...n){let o=n[0];if(o===void 0||o===null)return o;if(o.length>1)n=o;let r=e(n);if(typeof r==="object")for(let i=r.length,s=0;s<i;s++)r[s]=Math.round(r[s]);return r};if("conversion"in e)t.conversion=e.conversion;return t}oTr.forEach((e)=>{pJ[e]={},Object.defineProperty(pJ[e],"channels",{value:wtt[e].channels}),Object.defineProperty(pJ[e],"labels",{value:wtt[e].labels});let t=nTr(e);Object.keys(t).forEach((o)=>{let r=t[o];pJ[e][o]=iTr(r),pJ[e][o].raw=rTr(r)})});nmn.exports=pJ});var _v=pt(function(vKs,imn){var _6=qpn(),z3=omn(),rmn=["keyword","gray","hex"],Btt={};for(let e of Object.keys(z3))Btt[[...z3[e].labels].sort().join("")]=e;var AIe={};function tf(e,t){if(!(this instanceof tf))return new tf(e,t);if(t&&t in rmn)t=null;if(t&&!(t in z3))throw Error("Unknown model: "+t);let n,o;if(e==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(e instanceof tf)this.model=e.model,this.color=[...e.color],this.valpha=e.valpha;else if(typeof e==="string"){let r=_6.get(e);if(r===null)throw Error("Unable to parse color from string: "+e);this.model=r.model,o=z3[this.model].channels,this.color=r.value.slice(0,o),this.valpha=typeof r.value[o]==="number"?r.value[o]:1}else if(e.length>0){this.model=t||"rgb",o=z3[this.model].channels;let r=Array.prototype.slice.call(e,0,o);this.color=Ttt(r,o),this.valpha=typeof e[o]==="number"?e[o]:1}else if(typeof e==="number")this.model="rgb",this.color=[e>>16&255,e>>8&255,e&255],this.valpha=1;else{this.valpha=1;let r=Object.keys(e);if("alpha"in e)r.splice(r.indexOf("alpha"),1),this.valpha=typeof e.alpha==="number"?e.alpha:0;let i=r.sort().join("");if(!(i in Btt))throw Error("Unable to parse color from object: "+JSON.stringify(e));this.model=Btt[i];let{labels:s}=z3[this.model],a=[];for(n=0;n<s.length;n++)a.push(e[s[n]]);this.color=Ttt(a)}if(AIe[this.model]){o=z3[this.model].channels;for(n=0;n<o;n++){let r=AIe[this.model][n];if(r)this.color[n]=r(this.color[n])}}if(this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze)Object.freeze(this)}tf.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(e){let t=this.model in _6.to?this:this.rgb();t=t.round(typeof e==="number"?e:1);let n=t.valpha===1?t.color:[...t.color,this.valpha];return _6.to[t.model](n)},percentString(e){let t=this.rgb().round(typeof e==="number"?e:1),n=t.valpha===1?t.color:[...t.color,this.valpha];return _6.to.rgb.percent(n)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){let e={},{channels:t}=z3[this.model],{labels:n}=z3[this.model];for(let o=0;o<t;o++)e[n[o]]=this.color[o];if(this.valpha!==1)e.alpha=this.valpha;return e},unitArray(){let e=this.rgb().color;if(e[0]/=255,e[1]/=255,e[2]/=255,this.valpha!==1)e.push(this.valpha);return e},unitObject(){let e=this.rgb().object();if(e.r/=255,e.g/=255,e.b/=255,this.valpha!==1)e.alpha=this.valpha;return e},round(e){return e=Math.max(e||0,0),new tf([...this.color.map(aTr(e)),this.valpha],this.model)},alpha(e){if(e!==void 0)return new tf([...this.color,Math.max(0,Math.min(1,e))],this.model);return this.valpha},red:cm("rgb",0,jg(255)),green:cm("rgb",1,jg(255)),blue:cm("rgb",2,jg(255)),hue:cm(["hsl","hsv","hsl","hwb","hcg"],0,(e)=>(e%360+360)%360),saturationl:cm("hsl",1,jg(100)),lightness:cm("hsl",2,jg(100)),saturationv:cm("hsv",1,jg(100)),value:cm("hsv",2,jg(100)),chroma:cm("hcg",1,jg(100)),gray:cm("hcg",2,jg(100)),white:cm("hwb",1,jg(100)),wblack:cm("hwb",2,jg(100)),cyan:cm("cmyk",0,jg(100)),magenta:cm("cmyk",1,jg(100)),yellow:cm("cmyk",2,jg(100)),black:cm("cmyk",3,jg(100)),x:cm("xyz",0,jg(95.047)),y:cm("xyz",1,jg(100)),z:cm("xyz",2,jg(108.833)),l:cm("lab",0,jg(100)),a:cm("lab",1),b:cm("lab",2),keyword(e){if(e!==void 0)return new tf(e);return z3[this.model].keyword(this.color)},hex(e){if(e!==void 0)return new tf(e);return _6.to.hex(this.rgb().round().color)},hexa(e){if(e!==void 0)return new tf(e);let t=this.rgb().round().color,n=Math.round(this.valpha*255).toString(16).toUpperCase();if(n.length===1)n="0"+n;return _6.to.hex(t)+n},rgbNumber(){let e=this.rgb().color;return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255},luminosity(){let e=this.rgb().color,t=[];for(let[n,o]of e.entries()){let r=o/255;t[n]=r<=0.04045?r/12.92:((r+0.055)/1.055)**2.4}return 0.2126*t[0]+0.7152*t[1]+0.0722*t[2]},contrast(e){let t=this.luminosity(),n=e.luminosity();if(t>n)return(t+0.05)/(n+0.05);return(n+0.05)/(t+0.05)},level(e){let t=this.contrast(e);if(t>=7)return"AAA";return t>=4.5?"AA":""},isDark(){let e=this.rgb().color;return(e[0]*2126+e[1]*7152+e[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){let e=this.rgb();for(let t=0;t<3;t++)e.color[t]=255-e.color[t];return e},lighten(e){let t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken(e){let t=this.hsl();return t.color[2]-=t.color[2]*e,t},saturate(e){let t=this.hsl();return t.color[1]+=t.color[1]*e,t},desaturate(e){let t=this.hsl();return t.color[1]-=t.color[1]*e,t},whiten(e){let t=this.hwb();return t.color[1]+=t.color[1]*e,t},blacken(e){let t=this.hwb();return t.color[2]+=t.color[2]*e,t},grayscale(){let e=this.rgb().color,t=e[0]*0.3+e[1]*0.59+e[2]*0.11;return tf.rgb(t,t,t)},fade(e){return this.alpha(this.valpha-this.valpha*e)},opaquer(e){return this.alpha(this.valpha+this.valpha*e)},rotate(e){let t=this.hsl(),n=t.color[0];return n=(n+e)%360,n=n<0?360+n:n,t.color[0]=n,t},mix(e,t){if(!e||!e.rgb)throw Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof e);let n=e.rgb(),o=this.rgb(),r=t===void 0?0.5:t,i=2*r-1,s=n.alpha()-o.alpha(),a=((i*s===-1?i:(i+s)/(1+i*s))+1)/2,c=1-a;return tf.rgb(a*n.red()+c*o.red(),a*n.green()+c*o.green(),a*n.blue()+c*o.blue(),n.alpha()*r+o.alpha()*(1-r))}};for(let e of Object.keys(z3)){if(rmn.includes(e))continue;let{channels:t}=z3[e];tf.prototype[e]=function(...n){if(this.model===e)return new tf(this);if(n.length>0)return new tf(n,e);return new tf([...cTr(z3[this.model][e].raw(this.color)),this.valpha],e)},tf[e]=function(...n){let o=n[0];if(typeof o==="number")o=Ttt(n,t);return new tf(o,e)}}function sTr(e,t){return Number(e.toFixed(t))}function aTr(e){return function(t){return sTr(t,e)}}function cm(e,t,n){e=Array.isArray(e)?e:[e];for(let o of e)(AIe[o]||(AIe[o]=[]))[t]=n;return e=e[0],function(o){let r;if(o!==void 0){if(n)o=n(o);return r=this[e](),r.color[t]=o,r}if(r=this[e]().color[t],n)r=n(r);return r}}function jg(e){return function(t){return Math.max(0,Math.min(e,t))}}function cTr(e){return Array.isArray(e)?e:[e]}function Ttt(e,t){for(let n=0;n<t;n++)if(typeof e[n]!=="number")e[n]=0;return e}imn.exports=tf});var cmn=pt(function(SKs,amn){var{defineProperty:Ntt,getOwnPropertyDescriptor:lTr,getOwnPropertyNames:hTr}=Object,dTr=Object.prototype.hasOwnProperty,uTr=(e,t)=>{for(var n in t)Ntt(e,n,{get:t[n],enumerable:!0})},pTr=(e,t,n,o)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let r of hTr(t))if(!dTr.call(e,r)&&r!==n)Ntt(e,r,{get:()=>t[r],enumerable:!(o=lTr(t,r))||o.enumerable})}return e},mTr=(e)=>pTr(Ntt({},"__esModule",{value:!0}),e),smn={};uTr(smn,{executeJscadOperations:()=>Dtt,jscadPlanner:()=>_Tr});amn.exports=mTr(smn);var _Tr={booleans:{intersect:(...e)=>({type:"intersect",shapes:e}),subtract:(...e)=>({type:"subtract",shapes:e}),union:(...e)=>({type:"union",shapes:e})},hulls:{hull:(...e)=>({type:"hull",shapes:e.flat()}),hullChain:(...e)=>({type:"hullChain",shapes:e.flat()})},colors:{colorize:(e,t)=>({type:"colorize",color:e,shape:t})},primitives:{cube:(e)=>({type:"cube",...e}),sphere:(e)=>({type:"sphere",...e}),cylinder:(e)=>({type:"cylinder",...e}),polygon:(e)=>({type:"polygon",...e}),cuboid:(e)=>({type:"cuboid",...e}),roundedCuboid:(e)=>({type:"roundedCuboid",...e})},transforms:{rotate:(e,t)=>({type:"rotate",angles:e,shape:t}),rotateX:(e,t)=>({type:"rotateX",angle:e,shape:t}),rotateY:(e,t)=>({type:"rotateY",angle:e,shape:t}),rotateZ:(e,t)=>({type:"rotateZ",angle:e,shape:t}),scale:(e,t)=>({type:"scale",factors:e,shape:t}),translate:(e,t)=>({type:"translate",vector:e,shape:t})},extrusions:{extrudeLinear:(e,t)=>({type:"extrudeLinear",options:e,shape:t}),extrudeRotate:(e,t)=>({type:"extrudeRotate",options:e,shape:t})},maths:{vec2:{create:(e,t)=>[e,t],fromValues:(e,t)=>[e,t]},vec3:{create:(e,t,n)=>[e,t,n],fromValues:(e,t,n)=>[e,t,n]}},geometries:{geom2:{create:(e)=>({type:"createGeom2",points:e}),fromPoints:(e)=>({type:"fromPointsGeom2",points:e})},geom3:{create:(e)=>({type:"createGeom3",polygons:e})},path2:{create:(e)=>({type:"createPath2",points:e})}},measurements:{measureBoundingBox:(e)=>({type:"measureBoundingBox",shape:e}),measureArea:(e)=>({type:"measureArea",shape:e}),measureVolume:(e)=>({type:"measureVolume",shape:e})},utils:{degToRad:(e)=>e*Math.PI/180,radToDeg:(e)=>e*180/Math.PI}},Dtt=(e,t)=>{if(Array.isArray(t)&&t.length===1)return Dtt(e,t[0]);if(Array.isArray(t))throw Error("executeJscadOperations currently doesn't support Array<JscadOperation>, try adding a root union or or executing each element individually");let n=(i)=>Dtt(e,i),{type:o,...r}=t;switch(o){case"intersect":return e.booleans.intersect(...t.shapes.map(n));case"subtract":return e.booleans.subtract(...t.shapes.map(n));case"union":return e.booleans.union(...t.shapes.map(n));case"hull":return e.hulls.hull(...t.shapes.map(n));case"hullChain":return e.hulls.hullChain(...t.shapes.map(n));case"colorize":return e.colors.colorize(t.color,n(t.shape));case"cube":return e.primitives.cube(r);case"sphere":return e.primitives.sphere(r);case"cylinder":return e.primitives.cylinder(r);case"polygon":return e.primitives.polygon(r);case"cuboid":return e.primitives.cuboid(r);case"roundedCuboid":return e.primitives.roundedCuboid(r);case"rotate":return e.transforms.rotate(t.angles,n(t.shape));case"rotateX":return e.transforms.rotateX(t.angle,n(t.shape));case"rotateY":return e.transforms.rotateY(t.angle,n(t.shape));case"rotateZ":return e.transforms.rotateZ(t.angle,n(t.shape));case"scale":return e.transforms.scale(t.factors,n(t.shape));case"translate":return e.transforms.translate(t.vector,n(t.shape));case"extrudeLinear":return e.extrusions.extrudeLinear(t.options,n(t.shape));case"extrudeRotate":return e.extrusions.extrudeRotate(t.options,n(t.shape));case"createGeom2":return e.geometries.geom2.create(t.points);case"fromPointsGeom2":return e.geometries.geom2.fromPoints(t.points);case"createGeom3":return e.geometries.geom3.create(t.polygons);case"createPath2":return e.geometries.path2.create(t.points);case"measureBoundingBox":return e.measurements.measureBoundingBox(n(t.shape));case"measureArea":return e.measurements.measureArea(n(t.shape));case"measureVolume":return e.measurements.measureVolume(n(t.shape));case"degToRad":return e.utils.degToRad(t.degrees);case"radToDeg":return e.utils.radToDeg(t.radians);default:if(t.type===void 0)throw Error(`Operation type is undefined. This usually means the operation object is malformed or not properly initialized. Operation: ${JSON.stringify(t,null,2).slice(0,200)}...`);throw Error(`Unsupported operation type: ${t.type}. Operation: ${JSON.stringify(t,null,2)}`)}}});function Pt(e,t){return Array.isArray(t)?[e.a*t[0]+e.c*t[1]+e.e,e.b*t[0]+e.d*t[1]+e.f]:{x:e.a*t.x+e.c*t.y+e.e,y:e.b*t.x+e.d*t.y+e.f}}function kmn(e){let t=e.match(cDr);if(t===null||t.length<7)throw Error(`'${e}' is not a matrix`);return{a:parseFloat(t[1]),b:parseFloat(t[2]),c:parseFloat(t[3]),d:parseFloat(t[4]),e:parseFloat(t[5]),f:parseFloat(t[6])}}var cDr;var Lmn=ba(()=>{cDr=/^matrix\(\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*\)$/i});function Hmn(e){let{a:t,b:n,c:o,d:r,e:i,f:s}=e,a=t*r-n*o;return{a:r/a,b:n/-a,c:o/-a,d:t/a,e:(r*i-o*s)/-a,f:(n*i-t*s)/a}}function IY(e){return typeof e>"u"}var Fmn=()=>{};function Rc(e,t=0){return{a:1,c:0,e,b:0,d:1,f:t}}function yk(...e){e=Array.isArray(e[0])?e[0]:e;let t=(n,o)=>({a:n.a*o.a+n.c*o.b,c:n.a*o.c+n.c*o.d,e:n.a*o.e+n.c*o.f+n.e,b:n.b*o.a+n.d*o.b,d:n.b*o.c+n.d*o.d,f:n.b*o.e+n.d*o.f+n.f});switch(e.length){case 0:throw Error("no matrices provided");case 1:return e[0];case 2:return t(e[0],e[1]);default:{let[n,o,...r]=e,i=t(n,o);return yk(i,...r)}}}function Ts(...e){return yk(...e)}function qg(e,t,n){let o=lDr(e),r=hDr(e),i={a:o,c:-r,e:0,b:r,d:o,f:0};if(IY(t)||IY(n))return i;return yk([Rc(t,n),i,Rc(-t,-n)])}var lDr,hDr,JKs;var bIe=ba(()=>{({cos:lDr,sin:hDr,PI:JKs}=Math)});function Lu(e,t=void 0,n=void 0,o=void 0){if(IY(t))t=e;let r={a:e,c:0,e:0,b:0,d:t,f:0};if(IY(n)||IY(o))return r;return yk([Rc(n,o),r,Rc(-n,-o)])}var khe=()=>{};var i$s;var Htt=ba(()=>{({tan:i$s}=Math)});function zmn(e){return p2(e)}function p2(e){return`matrix(${e.a},${e.b},${e.c},${e.d},${e.e},${e.f})`}function Omn(e,t=10000000000){return{a:Math.round(e.a*t)/t,b:Math.round(e.b*t)/t,c:Math.round(e.c*t)/t,d:Math.round(e.d*t)/t,e:Math.round(e.e*t)/t,f:Math.round(e.f*t)/t}}function Vmn(e,t){let n=e[0].x!=null?e[0].x:e[0][0],o=e[0].y!=null?e[0].y:e[0][1],r=t[0].x!=null?t[0].x:t[0][0],i=t[0].y!=null?t[0].y:t[0][1],s=e[1].x!=null?e[1].x:e[1][0],a=e[1].y!=null?e[1].y:e[1][1],c=t[1].x!=null?t[1].x:t[1][0],l=t[1].y!=null?t[1].y:t[1][1],h=e[2].x!=null?e[2].x:e[2][0],d=e[2].y!=null?e[2].y:e[2][1],u=t[2].x!=null?t[2].x:t[2][0],_=t[2].y!=null?t[2].y:t[2][1],p={a:n-h,b:o-d,c:s-h,d:a-d,e:h,f:d},m={a:r-u,b:i-_,c:c-u,d:l-_,e:u,f:_},A=Hmn(p),g=yk([m,A]);return Omn(g)}var Ymn=()=>{};var Gmn=ba(()=>{khe();bIe();Htt()});function dDr(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n}function IIe(e,t,n,o){var r=Error.call(this,e);if(Object.setPrototypeOf)Object.setPrototypeOf(r,IIe.prototype);return r.expected=t,r.found=n,r.location=o,r.name="SyntaxError",r}function Ftt(e,t,n){if(n=n||" ",e.length>t)return e;return t-=e.length,n+=n.repeat(t),e+n.slice(0,t)}var Umn=ba(()=>{dDr(IIe,Error);IIe.prototype.format=function(e){var t="Error: "+this.message;if(this.location){var n=null,o;for(o=0;o<e.length;o++)if(e[o].source===this.location.source){n=e[o].text.split(/\r\n|\n|\r/g);break}var r=this.location.start,i=this.location.source&&typeof this.location.source.offset==="function"?this.location.source.offset(r):r,s=this.location.source+":"+i.line+":"+i.column;if(n){var a=this.location.end,c=Ftt("",i.line.toString().length," "),l=n[r.line-1],h=r.line===a.line?a.column:l.length+1,d=h-r.column||1;t+=`
 --> `+s+`
`+c+` |
`+i.line+" | "+l+`
`+c+" | "+Ftt("",r.column-1," ")+Ftt("",d,"^")}else t+=`
 at `+s}return t};IIe.buildMessage=function(e,t){var n={literal:function(l){return'"'+r(l.text)+'"'},class:function(l){var h=l.parts.map(function(d){return Array.isArray(d)?i(d[0])+"-"+i(d[1]):i(d)});return"["+(l.inverted?"^":"")+h.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(l){return l.description}};function o(l){return l.charCodeAt(0).toString(16).toUpperCase()}function r(l){return l.replace(/\\/g,"\\\\").replace(/"/g,"\\\"").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(h){return"\\x0"+o(h)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(h){return"\\x"+o(h)})}function i(l){return l.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(h){return"\\x0"+o(h)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(h){return"\\x"+o(h)})}function s(l){return n[l.type](l)}function a(l){var h=l.map(s),d,u;if(h.sort(),h.length>0){for(d=1,u=1;d<h.length;d++)if(h[d-1]!==h[d])h[u]=h[d],u++;h.length=u}switch(h.length){case 1:return h[0];case 2:return h[0]+" or "+h[1];default:return h.slice(0,-1).join(", ")+", or "+h[h.length-1]}}function c(l){return l?'"'+r(l)+'"':"end of input"}return"Expected "+a(e)+" but "+c(t)+" found."}});var Wmn=ba(()=>{Umn()});var Xmn=ba(()=>{khe()});var jmn=ba(()=>{bIe();khe()});var Ho=ba(()=>{Lmn();Fmn();bIe();khe();Htt();Ymn();Gmn();Wmn();Xmn();jmn()});var ztt,mJ;var Kmn=ba(()=>{ztt={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};for(let e in ztt)Object.freeze(ztt[e]);mJ=Object.freeze(ztt)});function xk(e,t,n){return Math.min(Math.max(t,e),n)}function vIe(e){let t=Math.round(e).toString(16).toUpperCase();return t.length<2?"0"+t:t}var $mn,B5,vY;var qmn=ba(()=>{Kmn();$mn=Object.create(null);for(let e in mJ)if(Object.hasOwn(mJ,e))$mn[mJ[e]]=e;B5={to:{},get:{}};B5.get=function(e){let t=e.slice(0,3).toLowerCase(),n,o;switch(t){case"hsl":{n=B5.get.hsl(e),o="hsl";break}case"hwb":{n=B5.get.hwb(e),o="hwb";break}default:{n=B5.get.rgb(e),o="rgb";break}}if(!n)return null;return{model:o,value:n}};B5.get.rgb=function(e){if(!e)return null;let t=/^#([a-f\d]{3,4})$/i,n=/^#([a-f\d]{6})([a-f\d]{2})?$/i,o=/^rgba?\(\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)\s*(?:[\s,|/]\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(%?)\s*)?\)$/i,r=/^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/i,i=/^(\w+)$/,s=[0,0,0,1],a,c,l;if(a=e.match(n)){l=a[2],a=a[1];for(c=0;c<3;c++){let h=c*2;s[c]=Number.parseInt(a.slice(h,h+2),16)}if(l)s[3]=Number.parseInt(l,16)/255}else if(a=e.match(t)){a=a[1],l=a[3];for(c=0;c<3;c++)s[c]=Number.parseInt(a[c]+a[c],16);if(l)s[3]=Number.parseInt(l+l,16)/255}else if(a=e.match(o)){for(c=0;c<3;c++)s[c]=Number.parseFloat(a[c+1]);if(a[4])s[3]=a[5]?Number.parseFloat(a[4])*0.01:Number.parseFloat(a[4])}else if(a=e.match(r)){for(c=0;c<3;c++)s[c]=Math.round(Number.parseFloat(a[c+1])*2.55);if(a[4])s[3]=a[5]?Number.parseFloat(a[4])*0.01:Number.parseFloat(a[4])}else if(a=e.toLowerCase().match(i)){if(a[1]==="transparent")return[0,0,0,0];if(!Object.hasOwn(mJ,a[1]))return null;return s=mJ[a[1]].slice(),s[3]=1,s}else return null;for(c=0;c<3;c++)s[c]=xk(s[c],0,255);return s[3]=xk(s[3],0,1),s};B5.get.hsl=function(e){if(!e)return null;let t=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,n=e.match(t);if(n){let o=Number.parseFloat(n[4]),r=(Number.parseFloat(n[1])%360+360)%360,i=xk(Number.parseFloat(n[2]),0,100),s=xk(Number.parseFloat(n[3]),0,100),a=xk(Number.isNaN(o)?1:o,0,1);return[r,i,s,a]}return null};B5.get.hwb=function(e){if(!e)return null;let t=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*[\s,]\s*([+-]?[\d.]+)%\s*[\s,]\s*([+-]?[\d.]+)%\s*(?:[\s,]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,n=e.match(t);if(n){let o=Number.parseFloat(n[4]),r=(Number.parseFloat(n[1])%360+360)%360,i=xk(Number.parseFloat(n[2]),0,100),s=xk(Number.parseFloat(n[3]),0,100),a=xk(Number.isNaN(o)?1:o,0,1);return[r,i,s,a]}return null};B5.to.hex=function(...e){return"#"+vIe(e[0])+vIe(e[1])+vIe(e[2])+(e[3]<1?vIe(Math.round(e[3]*255)):"")};B5.to.rgb=function(...e){return e.length<4||e[3]===1?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"};B5.to.rgb.percent=function(...e){let t=Math.round(e[0]/255*100),n=Math.round(e[1]/255*100),o=Math.round(e[2]/255*100);return e.length<4||e[3]===1?"rgb("+t+"%, "+n+"%, "+o+"%)":"rgba("+t+"%, "+n+"%, "+o+"%, "+e[3]+")"};B5.to.hsl=function(...e){return e.length<4||e[3]===1?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"};B5.to.hwb=function(...e){let t="";if(e.length>=4&&e[3]!==1)t=", "+e[3];return"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"};B5.to.keyword=function(...e){return $mn[e.slice(0,3)]};vY=B5});var Ott,_J;var Jmn=ba(()=>{Ott={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};for(let e in Ott)Object.freeze(Ott[e]);_J=Object.freeze(Ott)});function gJ(e){let t=e>0.0031308?1.055*e**0.4166666666666667-0.055:e*12.92;return Math.min(Math.max(0,t),1)}function AJ(e){return e>0.04045?((e+0.055)/1.055)**2.4:e/12.92}function uDr(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}var Zmn,Kr,OB,zB=0.008856451679035631;var Vtt=ba(()=>{Jmn();Zmn={};for(let e of Object.keys(_J))Zmn[_J[e]]=e;Kr={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},oklab:{channels:3,labels:["okl","oka","okb"]},lch:{channels:3,labels:"lch"},oklch:{channels:3,labels:["okl","okc","okh"]},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}},OB=Kr;for(let e of Object.keys(Kr)){if(!("channels"in Kr[e]))throw Error("missing channels property: "+e);if(!("labels"in Kr[e]))throw Error("missing channel labels property: "+e);if(Kr[e].labels.length!==Kr[e].channels)throw Error("channel and label counts mismatch: "+e);let{channels:t,labels:n}=Kr[e];delete Kr[e].channels,delete Kr[e].labels,Object.defineProperty(Kr[e],"channels",{value:t}),Object.defineProperty(Kr[e],"labels",{value:n})}Kr.rgb.hsl=function(e){let t=e[0]/255,n=e[1]/255,o=e[2]/255,r=Math.min(t,n,o),i=Math.max(t,n,o),s=i-r,a,c;switch(i){case r:{a=0;break}case t:{a=(n-o)/s;break}case n:{a=2+(o-t)/s;break}case o:{a=4+(t-n)/s;break}}if(a=Math.min(a*60,360),a<0)a+=360;let l=(r+i)/2;if(i===r)c=0;else if(l<=0.5)c=s/(i+r);else c=s/(2-i-r);return[a,c*100,l*100]};Kr.rgb.hsv=function(e){let t,n,o,r,i,s=e[0]/255,a=e[1]/255,c=e[2]/255,l=Math.max(s,a,c),h=l-Math.min(s,a,c),d=function(u){return(l-u)/6/h+0.5};if(h===0)r=0,i=0;else{switch(i=h/l,t=d(s),n=d(a),o=d(c),l){case s:{r=o-n;break}case a:{r=0.3333333333333333+t-o;break}case c:{r=0.6666666666666666+n-t;break}}if(r<0)r+=1;else if(r>1)r-=1}return[r*360,i*100,l*100]};Kr.rgb.hwb=function(e){let t=e[0],n=e[1],o=e[2],r=Kr.rgb.hsl(e)[0],i=0.00392156862745098*Math.min(t,Math.min(n,o));return o=1-0.00392156862745098*Math.max(t,Math.max(n,o)),[r,i*100,o*100]};Kr.rgb.oklab=function(e){let t=AJ(e[0]/255),n=AJ(e[1]/255),o=AJ(e[2]/255),r=Math.cbrt(0.4122214708*t+0.5363325363*n+0.0514459929*o),i=Math.cbrt(0.2119034982*t+0.6806995451*n+0.1073969566*o),s=Math.cbrt(0.0883024619*t+0.2817188376*n+0.6299787005*o),a=0.2104542553*r+0.793617785*i-0.0040720468*s,c=1.9779984951*r-2.428592205*i+0.4505937099*s,l=0.0259040371*r+0.7827717662*i-0.808675766*s;return[a*100,c*100,l*100]};Kr.rgb.cmyk=function(e){let t=e[0]/255,n=e[1]/255,o=e[2]/255,r=Math.min(1-t,1-n,1-o),i=(1-t-r)/(1-r)||0,s=(1-n-r)/(1-r)||0,a=(1-o-r)/(1-r)||0;return[i*100,s*100,a*100,r*100]};Kr.rgb.keyword=function(e){let t=Zmn[e];if(t)return t;let n=Number.POSITIVE_INFINITY,o;for(let r of Object.keys(_J)){let i=_J[r],s=uDr(e,i);if(s<n)n=s,o=r}return o};Kr.keyword.rgb=function(e){return[..._J[e]]};Kr.rgb.xyz=function(e){let t=AJ(e[0]/255),n=AJ(e[1]/255),o=AJ(e[2]/255),r=t*0.4124564+n*0.3575761+o*0.1804375,i=t*0.2126729+n*0.7151522+o*0.072175,s=t*0.0193339+n*0.119192+o*0.9503041;return[r*100,i*100,s*100]};Kr.rgb.lab=function(e){let t=Kr.rgb.xyz(e),n=t[0],o=t[1],r=t[2];n/=95.047,o/=100,r/=108.883,n=n>zB?n**0.3333333333333333:7.787*n+0.13793103448275862,o=o>zB?o**0.3333333333333333:7.787*o+0.13793103448275862,r=r>zB?r**0.3333333333333333:7.787*r+0.13793103448275862;let i=116*o-16,s=500*(n-o),a=200*(o-r);return[i,s,a]};Kr.hsl.rgb=function(e){let t=e[0]/360,n=e[1]/100,o=e[2]/100,r,i;if(n===0)return i=o*255,[i,i,i];let s=o<0.5?o*(1+n):o+n-o*n,a=2*o-s,c=[0,0,0];for(let l=0;l<3;l++){if(r=t+0.3333333333333333*-(l-1),r<0)r++;if(r>1)r--;if(6*r<1)i=a+(s-a)*6*r;else if(2*r<1)i=s;else if(3*r<2)i=a+(s-a)*(0.6666666666666666-r)*6;else i=a;c[l]=i*255}return c};Kr.hsl.hsv=function(e){let t=e[0],n=e[1]/100,o=e[2]/100,r=n,i=Math.max(o,0.01);o*=2,n*=o<=1?o:2-o,r*=i<=1?i:2-i;let s=(o+n)/2,a=o===0?2*r/(i+r):2*n/(o+n);return[t,a*100,s*100]};Kr.hsv.rgb=function(e){let t=e[0]/60,n=e[1]/100,o=e[2]/100,r=Math.floor(t)%6,i=t-Math.floor(t),s=255*o*(1-n),a=255*o*(1-n*i),c=255*o*(1-n*(1-i));switch(o*=255,r){case 0:return[o,c,s];case 1:return[a,o,s];case 2:return[s,o,c];case 3:return[s,a,o];case 4:return[c,s,o];case 5:return[o,s,a]}};Kr.hsv.hsl=function(e){let t=e[0],n=e[1]/100,o=e[2]/100,r=Math.max(o,0.01),i,s;s=(2-n)*o;let a=(2-n)*r;return i=n*r,i/=a<=1?a:2-a,i=i||0,s/=2,[t,i*100,s*100]};Kr.hwb.rgb=function(e){let t=e[0]/360,n=e[1]/100,o=e[2]/100,r=n+o,i;if(r>1)n/=r,o/=r;let s=Math.floor(6*t),a=1-o;if(i=6*t-s,(s&1)!==0)i=1-i;let c=n+i*(a-n),l,h,d;switch(s){default:case 6:case 0:{l=a,h=c,d=n;break}case 1:{l=c,h=a,d=n;break}case 2:{l=n,h=a,d=c;break}case 3:{l=n,h=c,d=a;break}case 4:{l=c,h=n,d=a;break}case 5:{l=a,h=n,d=c;break}}return[l*255,h*255,d*255]};Kr.cmyk.rgb=function(e){let t=e[0]/100,n=e[1]/100,o=e[2]/100,r=e[3]/100,i=1-Math.min(1,t*(1-r)+r),s=1-Math.min(1,n*(1-r)+r),a=1-Math.min(1,o*(1-r)+r);return[i*255,s*255,a*255]};Kr.xyz.rgb=function(e){let t=e[0]/100,n=e[1]/100,o=e[2]/100,r,i,s;return r=t*3.2404542+n*-1.5371385+o*-0.4985314,i=t*-0.969266+n*1.8760108+o*0.041556,s=t*0.0556434+n*-0.2040259+o*1.0572252,r=gJ(r),i=gJ(i),s=gJ(s),[r*255,i*255,s*255]};Kr.xyz.lab=function(e){let t=e[0],n=e[1],o=e[2];t/=95.047,n/=100,o/=108.883,t=t>zB?t**0.3333333333333333:7.787*t+0.13793103448275862,n=n>zB?n**0.3333333333333333:7.787*n+0.13793103448275862,o=o>zB?o**0.3333333333333333:7.787*o+0.13793103448275862;let r=116*n-16,i=500*(t-n),s=200*(n-o);return[r,i,s]};Kr.xyz.oklab=function(e){let t=e[0]/100,n=e[1]/100,o=e[2]/100,r=Math.cbrt(0.8189330101*t+0.3618667424*n-0.1288597137*o),i=Math.cbrt(0.0329845436*t+0.9293118715*n+0.0361456387*o),s=Math.cbrt(0.0482003018*t+0.2643662691*n+0.633851707*o),a=0.2104542553*r+0.793617785*i-0.0040720468*s,c=1.9779984951*r-2.428592205*i+0.4505937099*s,l=0.0259040371*r+0.7827717662*i-0.808675766*s;return[a*100,c*100,l*100]};Kr.oklab.oklch=function(e){return Kr.lab.lch(e)};Kr.oklab.xyz=function(e){let t=e[0]/100,n=e[1]/100,o=e[2]/100,r=(0.999999998*t+0.396337792*n+0.215803758*o)**3,i=(1.000000008*t-0.105561342*n-0.063854175*o)**3,s=(1.000000055*t-0.089484182*n-1.291485538*o)**3,a=1.227013851*r-0.55779998*i+0.281256149*s,c=-0.040580178*r+1.11225687*i-0.071676679*s,l=-0.076381285*r-0.421481978*i+1.58616322*s;return[a*100,c*100,l*100]};Kr.oklab.rgb=function(e){let t=e[0]/100,n=e[1]/100,o=e[2]/100,r=(t+0.3963377774*n+0.2158037573*o)**3,i=(t-0.1055613458*n-0.0638541728*o)**3,s=(t-0.0894841775*n-1.291485548*o)**3,a=gJ(4.0767416621*r-3.3077115913*i+0.2309699292*s),c=gJ(-1.2684380046*r+2.6097574011*i-0.3413193965*s),l=gJ(-0.0041960863*r-0.7034186147*i+1.707614701*s);return[a*255,c*255,l*255]};Kr.oklch.oklab=function(e){return Kr.lch.lab(e)};Kr.lab.xyz=function(e){let t=e[0],n=e[1],o=e[2],r,i,s;i=(t+16)/116,r=n/500+i,s=i-o/200;let a=i**3,c=r**3,l=s**3;return i=a>zB?a:(i-0.13793103448275862)/7.787,r=c>zB?c:(r-0.13793103448275862)/7.787,s=l>zB?l:(s-0.13793103448275862)/7.787,r*=95.047,i*=100,s*=108.883,[r,i,s]};Kr.lab.lch=function(e){let t=e[0],n=e[1],o=e[2],r;if(r=Math.atan2(o,n)*360/2/Math.PI,r<0)r+=360;let s=Math.sqrt(n*n+o*o);return[t,s,r]};Kr.lch.lab=function(e){let t=e[0],n=e[1],r=e[2]/360*2*Math.PI,i=n*Math.cos(r),s=n*Math.sin(r);return[t,i,s]};Kr.rgb.ansi16=function(e,t=null){let[n,o,r]=e,i=t===null?Kr.rgb.hsv(e)[2]:t;if(i=Math.round(i/50),i===0)return 30;let s=30+(Math.round(r/255)<<2|Math.round(o/255)<<1|Math.round(n/255));if(i===2)s+=60;return s};Kr.hsv.ansi16=function(e){return Kr.rgb.ansi16(Kr.hsv.rgb(e),e[2])};Kr.rgb.ansi256=function(e){let t=e[0],n=e[1],o=e[2];if(t>>4===n>>4&&n>>4===o>>4){if(t<8)return 16;if(t>248)return 231;return Math.round((t-8)/247*24)+232}return 16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(o/255*5)};Kr.ansi16.rgb=function(e){e=e[0];let t=e%10;if(t===0||t===7){if(e>50)t+=3.5;return t=t/10.5*255,[t,t,t]}let n=(Math.trunc(e>50)+1)*0.5,o=(t&1)*n*255,r=(t>>1&1)*n*255,i=(t>>2&1)*n*255;return[o,r,i]};Kr.ansi256.rgb=function(e){if(e=e[0],e>=232){let i=(e-232)*10+8;return[i,i,i]}e-=16;let t,n=Math.floor(e/36)/5*255,o=Math.floor((t=e%36)/6)/5*255,r=t%6/5*255;return[n,o,r]};Kr.rgb.hex=function(e){let n=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".slice(n.length)+n};Kr.hex.rgb=function(e){let t=e.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!t)return[0,0,0];let n=t[0];if(t[0].length===3)n=[...n].map((a)=>a+a).join("");let o=Number.parseInt(n,16),r=o>>16&255,i=o>>8&255,s=o&255;return[r,i,s]};Kr.rgb.hcg=function(e){let t=e[0]/255,n=e[1]/255,o=e[2]/255,r=Math.max(Math.max(t,n),o),i=Math.min(Math.min(t,n),o),s=r-i,a,c=s<1?i/(1-s):0;if(s<=0)a=0;else if(r===t)a=(n-o)/s%6;else if(r===n)a=2+(o-t)/s;else a=4+(t-n)/s;return a/=6,a%=1,[a*360,s*100,c*100]};Kr.hsl.hcg=function(e){let t=e[1]/100,n=e[2]/100,o=n<0.5?2*t*n:2*t*(1-n),r=0;if(o<1)r=(n-0.5*o)/(1-o);return[e[0],o*100,r*100]};Kr.hsv.hcg=function(e){let t=e[1]/100,n=e[2]/100,o=t*n,r=0;if(o<1)r=(n-o)/(1-o);return[e[0],o*100,r*100]};Kr.hcg.rgb=function(e){let t=e[0]/360,n=e[1]/100,o=e[2]/100;if(n===0)return[o*255,o*255,o*255];let r=[0,0,0],i=t%1*6,s=i%1,a=1-s,c=0;switch(Math.floor(i)){case 0:{r[0]=1,r[1]=s,r[2]=0;break}case 1:{r[0]=a,r[1]=1,r[2]=0;break}case 2:{r[0]=0,r[1]=1,r[2]=s;break}case 3:{r[0]=0,r[1]=a,r[2]=1;break}case 4:{r[0]=s,r[1]=0,r[2]=1;break}default:r[0]=1,r[1]=0,r[2]=a}return c=(1-n)*o,[(n*r[0]+c)*255,(n*r[1]+c)*255,(n*r[2]+c)*255]};Kr.hcg.hsv=function(e){let t=e[1]/100,n=e[2]/100,o=t+n*(1-t),r=0;if(o>0)r=t/o;return[e[0],r*100,o*100]};Kr.hcg.hsl=function(e){let t=e[1]/100,o=e[2]/100*(1-t)+0.5*t,r=0;if(o>0&&o<0.5)r=t/(2*o);else if(o>=0.5&&o<1)r=t/(2*(1-o));return[e[0],r*100,o*100]};Kr.hcg.hwb=function(e){let t=e[1]/100,n=e[2]/100,o=t+n*(1-t);return[e[0],(o-t)*100,(1-o)*100]};Kr.hwb.hcg=function(e){let t=e[1]/100,o=1-e[2]/100,r=o-t,i=0;if(r<1)i=(o-r)/(1-r);return[e[0],r*100,i*100]};Kr.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};Kr.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};Kr.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};Kr.gray.hsl=function(e){return[0,0,e[0]]};Kr.gray.hsv=Kr.gray.hsl;Kr.gray.hwb=function(e){return[0,100,e[0]]};Kr.gray.cmyk=function(e){return[0,0,0,e[0]]};Kr.gray.lab=function(e){return[e[0],0,0]};Kr.gray.hex=function(e){let t=Math.round(e[0]/100*255)&255,o=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".slice(o.length)+o};Kr.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}});function pDr(){let e={},t=Object.keys(OB);for(let{length:n}=t,o=0;o<n;o++)e[t[o]]={distance:-1,parent:null};return e}function mDr(e){let t=pDr(),n=[e];t[e].distance=0;while(n.length>0){let o=n.pop(),r=Object.keys(OB[o]);for(let{length:i}=r,s=0;s<i;s++){let a=r[s],c=t[a];if(c.distance===-1)c.distance=t[o].distance+1,c.parent=o,n.unshift(a)}}return t}function _Dr(e,t){return function(n){return t(e(n))}}function gDr(e,t){let n=[t[e].parent,e],o=OB[t[e].parent][e],r=t[e].parent;while(t[r].parent)n.unshift(t[r].parent),o=_Dr(OB[t[r].parent][r],o),r=t[r].parent;return o.conversion=n,o}function ADr(e){let t=mDr(e),n={},o=Object.keys(t);for(let{length:r}=o,i=0;i<r;i++){let s=o[i];if(t[s].parent===null)continue;n[s]=gDr(s,t)}return n}var e_n;var t_n=ba(()=>{Vtt();e_n=ADr});function yDr(e){let t=function(...n){let o=n[0];if(o===void 0||o===null)return o;if(o.length>1)n=o;return e(n)};if("conversion"in e)t.conversion=e.conversion;return t}function xDr(e){let t=function(...n){let o=n[0];if(o===void 0||o===null)return o;if(o.length>1)n=o;let r=e(n);if(typeof r==="object")for(let{length:i}=r,s=0;s<i;s++)r[s]=Math.round(r[s]);return r};if("conversion"in e)t.conversion=e.conversion;return t}var fJ,fDr,T5;var n_n=ba(()=>{Vtt();t_n();fJ={},fDr=Object.keys(OB);for(let e of fDr){fJ[e]={},Object.defineProperty(fJ[e],"channels",{value:OB[e].channels}),Object.defineProperty(fJ[e],"labels",{value:OB[e].labels});let t=e_n(e),n=Object.keys(t);for(let o of n){let r=t[o];fJ[e][o]=xDr(r),fJ[e][o].raw=yDr(r)}}T5=fJ});function nf(e,t){if(!(this instanceof nf))return new nf(e,t);if(t&&t in o_n)t=null;if(t&&!(t in T5))throw Error("Unknown model: "+t);let n,o;if(e==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(e instanceof nf)this.model=e.model,this.color=[...e.color],this.valpha=e.valpha;else if(typeof e==="string"){let r=vY.get(e);if(r===null)throw Error("Unable to parse color from string: "+e);this.model=r.model,o=T5[this.model].channels,this.color=r.value.slice(0,o),this.valpha=typeof r.value[o]==="number"?r.value[o]:1}else if(e.length>0){this.model=t||"rgb",o=T5[this.model].channels;let r=Array.prototype.slice.call(e,0,o);this.color=Utt(r,o),this.valpha=typeof e[o]==="number"?e[o]:1}else if(typeof e==="number")this.model="rgb",this.color=[e>>16&255,e>>8&255,e&255],this.valpha=1;else{this.valpha=1;let r=Object.keys(e);if("alpha"in e)r.splice(r.indexOf("alpha"),1),this.valpha=typeof e.alpha==="number"?e.alpha:0;let i=r.sort().join("");if(!(i in Ytt))throw Error("Unable to parse color from object: "+JSON.stringify(e));this.model=Ytt[i];let{labels:s}=T5[this.model],a=[];for(n=0;n<s.length;n++)a.push(e[s[n]]);this.color=Utt(a)}if(Gtt[this.model]){o=T5[this.model].channels;for(n=0;n<o;n++){let r=Gtt[this.model][n];if(r)this.color[n]=r(this.color[n])}}if(this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze)Object.freeze(this)}function CDr(e,t){return Number(e.toFixed(t))}function bDr(e){return function(t){return CDr(t,e)}}function lm(e,t,n){e=Array.isArray(e)?e:[e];for(let o of e)(Gtt[o]||=[])[t]=n;return e=e[0],function(o){let r;if(o!==void 0){if(n)o=n(o);return r=this[e](),r.color[t]=o,r}if(r=this[e]().color[t],n)r=n(r);return r}}function Jg(e){return function(t){return Math.max(0,Math.min(e,t))}}function IDr(e){return Array.isArray(e)?e:[e]}function Utt(e,t){for(let n=0;n<t;n++)if(typeof e[n]!=="number")e[n]=0;return e}var o_n,Ytt,Gtt,Lhe;var Wtt=ba(()=>{qmn();n_n();o_n=["keyword","gray","hex"],Ytt={};for(let e of Object.keys(T5))Ytt[[...T5[e].labels].sort().join("")]=e;Gtt={};nf.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(e){let t=this.model in vY.to?this:this.rgb();t=t.round(typeof e==="number"?e:1);let n=t.valpha===1?t.color:[...t.color,this.valpha];return vY.to[t.model](...n)},percentString(e){let t=this.rgb().round(typeof e==="number"?e:1),n=t.valpha===1?t.color:[...t.color,this.valpha];return vY.to.rgb.percent(...n)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){let e={},{channels:t}=T5[this.model],{labels:n}=T5[this.model];for(let o=0;o<t;o++)e[n[o]]=this.color[o];if(this.valpha!==1)e.alpha=this.valpha;return e},unitArray(){let e=this.rgb().color;if(e[0]/=255,e[1]/=255,e[2]/=255,this.valpha!==1)e.push(this.valpha);return e},unitObject(){let e=this.rgb().object();if(e.r/=255,e.g/=255,e.b/=255,this.valpha!==1)e.alpha=this.valpha;return e},round(e){return e=Math.max(e||0,0),new nf([...this.color.map(bDr(e)),this.valpha],this.model)},alpha(e){if(e!==void 0)return new nf([...this.color,Math.max(0,Math.min(1,e))],this.model);return this.valpha},red:lm("rgb",0,Jg(255)),green:lm("rgb",1,Jg(255)),blue:lm("rgb",2,Jg(255)),hue:lm(["hsl","hsv","hsl","hwb","hcg"],0,(e)=>(e%360+360)%360),saturationl:lm("hsl",1,Jg(100)),lightness:lm("hsl",2,Jg(100)),saturationv:lm("hsv",1,Jg(100)),value:lm("hsv",2,Jg(100)),chroma:lm("hcg",1,Jg(100)),gray:lm("hcg",2,Jg(100)),white:lm("hwb",1,Jg(100)),wblack:lm("hwb",2,Jg(100)),cyan:lm("cmyk",0,Jg(100)),magenta:lm("cmyk",1,Jg(100)),yellow:lm("cmyk",2,Jg(100)),black:lm("cmyk",3,Jg(100)),x:lm("xyz",0,Jg(95.047)),y:lm("xyz",1,Jg(100)),z:lm("xyz",2,Jg(108.833)),l:lm("lab",0,Jg(100)),a:lm("lab",1),b:lm("lab",2),keyword(e){if(e!==void 0)return new nf(e);return T5[this.model].keyword(this.color)},hex(e){if(e!==void 0)return new nf(e);return vY.to.hex(...this.rgb().round().color)},hexa(e){if(e!==void 0)return new nf(e);let t=this.rgb().round().color,n=Math.round(this.valpha*255).toString(16).toUpperCase();if(n.length===1)n="0"+n;return vY.to.hex(...t)+n},rgbNumber(){let e=this.rgb().color;return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255},luminosity(){let e=this.rgb().color,t=[];for(let[n,o]of e.entries()){let r=o/255;t[n]=r<=0.04045?r/12.92:((r+0.055)/1.055)**2.4}return 0.2126*t[0]+0.7152*t[1]+0.0722*t[2]},contrast(e){let t=this.luminosity(),n=e.luminosity();if(t>n)return(t+0.05)/(n+0.05);return(n+0.05)/(t+0.05)},level(e){let t=this.contrast(e);if(t>=7)return"AAA";return t>=4.5?"AA":""},isDark(){let e=this.rgb().color;return(e[0]*2126+e[1]*7152+e[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){let e=this.rgb();for(let t=0;t<3;t++)e.color[t]=255-e.color[t];return e},lighten(e){let t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken(e){let t=this.hsl();return t.color[2]-=t.color[2]*e,t},saturate(e){let t=this.hsl();return t.color[1]+=t.color[1]*e,t},desaturate(e){let t=this.hsl();return t.color[1]-=t.color[1]*e,t},whiten(e){let t=this.hwb();return t.color[1]+=t.color[1]*e,t},blacken(e){let t=this.hwb();return t.color[2]+=t.color[2]*e,t},grayscale(){let e=this.rgb().color,t=e[0]*0.3+e[1]*0.59+e[2]*0.11;return nf.rgb(t,t,t)},fade(e){return this.alpha(this.valpha-this.valpha*e)},opaquer(e){return this.alpha(this.valpha+this.valpha*e)},rotate(e){let t=this.hsl(),n=t.color[0];return n=(n+e)%360,n=n<0?360+n:n,t.color[0]=n,t},mix(e,t){if(!e||!e.rgb)throw Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof e);let n=e.rgb(),o=this.rgb(),r=t===void 0?0.5:t,i=2*r-1,s=n.alpha()-o.alpha(),a=((i*s===-1?i:(i+s)/(1+i*s))+1)/2,c=1-a;return nf.rgb(a*n.red()+c*o.red(),a*n.green()+c*o.green(),a*n.blue()+c*o.blue(),n.alpha()*r+o.alpha()*(1-r))}};for(let e of Object.keys(T5)){if(o_n.includes(e))continue;let{channels:t}=T5[e];nf.prototype[e]=function(...n){if(this.model===e)return new nf(this);if(n.length>0)return new nf(n,e);return new nf([...IDr(T5[this.model][e].raw(this.color)),this.valpha],e)},nf[e]=function(...n){let o=n[0];if(typeof o==="number")o=Utt(n,t);return new nf(o,e)}}Lhe=nf});var SIe="T1RUTwAJAIAAAwAQQ0ZGIFhQSpcAAAcwAABJ3U9TLzJqmmVhAAABAAAAAGBjbWFwFN0WswAABEwAAALEaGVhZC1P1HwAAACcAAAANmhoZWEDrgI1AAAA1AAAACRobXR44xAAAAAAURAAAAFQbWF4cABUUAAAAAD4AAAABm5hbWUZQ94BAAABYAAAAutwb3N0AAMAAAAABxAAAAAgAAEAAAABAADb+Z65Xw889QADA+gAAAAA5e9IsgAAAADl70iy/9P/PwKHAvkAAAADAAIAAAAAAAAAAQAAA6z/LAAAArQAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAFQAAFAAAFQAAAADArQB9AAFAAACigK7AAAAjAKKArsAAAHfADEBAgAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAABYWFhYAEAAIQB6A6z/LAAAAvkAwQAAAAEAAAAAAiwC1wAAAAAAAAAAACIBngABAAAAAAAAAAEAWQABAAAAAAABABEAAAABAAAAAAACAAcAMwABAAAAAAADABsA/AABAAAAAAAEABkASAABAAAAAAAFAAsA2wABAAAAAAAGABgAkwABAAAAAAAHAAEAWQABAAAAAAAIAAEAWQABAAAAAAAJAAEAWQABAAAAAAAKAAEAWQABAAAAAAALAAEAWQABAAAAAAAMAAEAWQABAAAAAAANAAEAWQABAAAAAAAOAAEAWQABAAAAAAAQABEAAAABAAAAAAARAAcAMwADAAEECQAAAAIAgwADAAEECQABACIAEQADAAEECQACAA4AOgADAAEECQADADYBFwADAAEECQAEADIAYQADAAEECQAFABYA5gADAAEECQAGADAAqwADAAEECQAHAAIAgwADAAEECQAIAAIAgwADAAEECQAJAAIAgwADAAEECQAKAAIAgwADAAEECQALAAIAgwADAAEECQAMAAIAgwADAAEECQANAAIAgwADAAEECQAOAAIAgwADAAEECQAQACIAEQADAAEECQARAA4AOlRzY2lyY3VpdEFscGhhYmV0AFQAcwBjAGkAcgBjAHUAaQB0AEEAbABwAGgAYQBiAGUAdFJlZ3VsYXIAUgBlAGcAdQBsAGEAclRzY2lyY3VpdEFscGhhYmV0IFJlZ3VsYXIAVABzAGMAaQByAGMAdQBpAHQAQQBsAHAAaABhAGIAZQB0ACAAUgBlAGcAdQBsAGEAclRzY2lyY3VpdEFscGhhYmV0UmVndWxhcgBUAHMAYwBpAHIAYwB1AGkAdABBAGwAcABoAGEAYgBlAHQAUgBlAGcAdQBsAGEAclZlcnNpb24gMC4xAFYAZQByAHMAaQBvAG4AIAAwAC4AMSA6VHNjaXJjdWl0QWxwaGFiZXQgUmVndWxhcgAgADoAVABzAGMAaQByAGMAdQBpAHQAQQBsAHAAaABhAGIAZQB0ACAAUgBlAGcAdQBsAGEAcgAAAAABAAMAAQAAAAwABAK4AAAAqgCAAAYAKgAAACEAIgAjACQAJwAoACkAKgArACwALQAuAC8AMAAxADIAMwA0ADUANgA3ADgAOQA8AD0APgBBAEIAQwBEAEUARgBHAEgASQBKAEsATABNAE4ATwBQAFEAUgBTAFQAVQBWAFcAWABZAFoAWwBcAF0AXgBfAGEAYgBjAGQAZQBmAGcAaABpAGoAawBsAG0AbgBvAHAAcQByAHMAdAB1AHYAdwB4AHkAev//AAAAAAAhACIAIwAkACcAKAApACoAKwAsAC0ALgAvADAAMQAyADMANAA1ADYANwA4ADkAPAA9AD4AQQBCAEMARABFAEYARwBIAEkASgBLAEwATQBOAE8AUABRAFIAUwBUAFUAVgBXAFgAWQBaAFsAXABdAF4AXwBhAGIAYwBkAGUAZgBnAGgAaQBqAGsAbABtAG4AbwBwAHEAcgBzAHQAdQB2AHcAeAB5AHr//wAA/+D/4P/g/+D/3v/e/97/3v/e/97/3v/e/97/3v/e/97/3v/e/97/3v/e/97/3v/c/9z/3P/a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2v/a/9n/2f/Z/9n/2f/Z/9n/2f/Z/9n/2f/Z/9n/2f/Z/9n/2f/Z/9n/2f/Z/9n/2f/Z/9n/2QABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEABAEAAQEBGVRzY2lyY3VpdEFscGhhYmV0UmVndWxhcgABAQEo+BsA+BwC+B0D+B4Ei/tV+kD5SAUdAAABOQ8dAAAB4BGLHQAASd0SAFcBAQwlNj0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AgYKDhIWGh4iJiouMjY6PkFZlcnNpb24gMC4xVHNjaXJjdWl0QWxwaGFiZXQgUmVndWxhclRzY2lyY3VpdEFscGhhYmV0UmVndWxhciEiIyQnKCkqKywtLi8wMTIzNDU2Nzg5PD0+QUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVpbXF1eX2FiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6AAAAAYsBjAGNAY4BjwGQAZEBkgGTAZQBlQGWAZcBmAGZAZoBmwGcAZ0BngGfAaABoQGiAaMBpAGlAaYBpwGoAakBqgGrAawBrQGuAa8BsAGxAbIBswG0AbUBtgG3AbgBuQG6AbsBvAG9Ab4BvwHAAcEBwgHDAcQBxQHGAccByAHJAcoBywHMAc0BzgHPAdAB0QHSAdMB1AHVAdYB1wHYAdkB2gHbAdwB3QBUAgABAAQAeADuAgwFUgWPBmUHOwffCGMIzwkMCUgJhQq1CzwMhg5ADwwQUBHfEt8U3hYZFqIXFxeiGEIZtBsIHCccsh0sHpIfGh9XIC8gtiEFIjwjJSRTJWUmviftKXQp2CqzK0gsfS0ILW8uPy6iLuAvQy+2L/IxEDItM0A0XjWWNlQ39zjFOTk59zp9Oro76Dy1Pd8+/EAaQJVCDELOQ49EGEVZReRGgUdR+UgO+Uj37vlBFYv8VgWIewWBfQV8ggV6iAV6jgV8lAWBmQWImwWL+FYFjpsFlZkFmpQFnI8FnIcFmoIFlX0FL/z3Fe+LBZyIBZmCBZV9BY97BYd7BYF9BX2CBXqIBSeLBXqOBX2UBYGZBYebBY+bBZWZBZmUBQ75SPdm+UEVi/uBBYh7BYF9BXyCBXqIBXqOBXyUBYGZBYibBYv3gQWOmwWVmQWalAWcjwWchwWaggWVfQX3p3sVi/uBBYh7BYF9BXyCBXqIBXqOBXyUBYGZBYibBYv3gQWOmwWVmQWalAWcjwWchwWaggWVfQUO+Uj3XvcoFYAiBYZ7BYB/BXyDBXmJBXqQBX6VBYOaBYmbBZPgBSR/BXqMBXuSBX+YBYaaBYycBZOaBZiVBZyRBfcPmgWe91QFKH8FeYwFfJIFf5gFhZoFjZwFkpkFmZYFm5EF9wyZBZ33RgWQmgWWmAWakwWdjQWchgWYgQWUfAWMewV7+zIF9zifBZr3JgWQmgWWmAWbkwWcjQWchgWZgQWTfAWNewV++xMF8JcFnIoFm4QFl34FkHwFinoFg30FfoAFeoUF+w19BXj7VQXslwWdigWahAWXfwWRewWKegWDfQV+gAV6hgX7CnwFfvscBYZ7BX9/BXyDBXqJBXqQBX2VBYOaBYmbBZf3CQX7MM0V9zifBZ/3VAX7OHcFDvlI9/T5XhWL/awFiHoFgX4FfIEFeogFeo4FfJUFgpgFh5wFi/msBY+bBZSZBZqUBZyOBZyIBZqCBZV9BfcB+2YVNd0FgpkFiJsFjpsFlZkFmpQFnI4FnIcFmoIF4DkFlX0FjnoFh3sFgX4FfYIFeYgFeo4FQ9sV+z+bBXuQBX2VBYOaBYmbBZCbBZeYBZqTBZ2MBfc+ewWchgWZgAWTfQWMegWGfAWAfgV8gwX7LqUVKjgFe4MFeogFeo8FfZUFgpkFiJwFkJsFlZgF7d4FmpMFnI0FnIcFmYEFlH0FjnsFh3sFLD4VZvsHBYN8BX2BBXqGBXqMBXuTBYCYBYabBY2bBa/3CAWTmQWZlgWckAWciQWbgwWWfwWQewVkIRWkSQWNegWHewWAfgV8gwV6iQV6jwV9lQWCmQVyzQWJmwWPmwWWmQWakwWcjQWchwWZgQWdTxXUWgWXfwWRewWKewWEfAV+fwV7hgV5iwV7kgVCvQV/lwWFmgWLnAWTmgWYlgWbkQWdigXTWhX3fFkFm4QFl38FkXwFi3oFhHwFfoAFe4UFeYwF+3y8BXuSBX+XBYWaBYycBZKaBZeWBZyRBfedUhXVWgWWfwWSewWKewWEfAV+fwV6hgV6iwV7kgVCvAV/mAWFmgWLnAWTmgWXlgWckQWcigX2PBWjOAWMewWGewV/fgV8hAV5igV6kAV+lgWDmQVz3gWKmwWQmwWXmAWakgWdjAWbhgWZgAWp+xAVW/sHBYF9BX2BBXqIBXmOBX2UBYGYBYebBY6cBbz3BwWUmQWalQWcjgWciAWaggWVfQWPewU/+y8V+w5aBXqHBXmOBX2UBYGZBYebBY6bBZWZBZmUBfcOvQWcjgWciAWaggWVfgWPewWIewWBfQX7M00V+zObBXuQBX2WBYOZBYqcBZCaBZaYBZuTBZyMBfczewWchgWYgAWTfAWNewWFewWAfwV7gwX7VqAVNb0Ff5YFg5oFi5sFkZsFl5cFm5IFnIsFnIYF4FkFmIAFknwFjHoFhXwFf38Fe4QFeYoF+wzZFWbuBYmbBY+bBZaYBZqUBZyNBZyHBZmBBZR9BbAnBY17BYd7BYB+BXyDBXmIBXqQBX2VBQ75SPfu+UEVi/uBBYh7BYF9BXyCBXqIBXqOBXyUBYGZBYibBYv3gQWOmwWVmQWalAWcjwWchwWaggWVfQUO+Uj4Ko0VsmUFlX0FjnsFh3sFgX0FfYIFeYgFeo8FfZQFYrMFio0FiYwFY7sFiowFiowFYsMFiowFiowFY8oFio4FiY0FbcoFio4FiY4Fd8oFi44Fio0FgcMFi5IFi5IFlcMFjI0Fi44Fn8oFjY4FjI4FqcoFjY0FjI4Fs8oFjIwFjIwFtMMFjIwFjIwFs7sFjYwFjI0FtLMFmZQFnI8FnYgFmYIFlX0Fj3sFiHsFgX0FZGUFZV4FZFUFZE8Fb1AFeFEFg10Fk10FnlEFp1AFsk8FslUFDvlI95tWFYqJBWJjBX2CBXqHBXmOBX2UBYGZBYebBY6bBZWZBbKxBbG4BbLBBbLHBafGBZ7FBZO5BYO5BXjFBW/GBWTHBWTBBWW4BWSxBYGZBYibBY+bBZWZBZqUBZyOBZyHBZmCBbRjBYyJBY2KBbRbBYuKBY2KBbNTBYyKBYyKBbRMBYuIBY2JBapMBYuIBY2IBZ9MBYuIBYyJBZVTBYuEBYuEBYFTBYqJBYuIBXdMBYmIBYuIBWxMBYmJBYuIBWJMBYqKBYqKBWNTBYmKBYuKBWJbBQ75SPeU+FUV+zRWBXqIBXqPBX2VBYKZBYicBY+bBZaYBZqTBfc5wgUh9yQFhJoFi5sFkZsFmJYFm5IFnIsFm4UFmIAF8fsfBfH3HwWYlgWbkQWciwWchAWXgAWRewWLewWEfAUh+yQF9zlUBZqDBZZ+BY97BYh6BYJ9BX2BBXqHBXqOBfs0wAWL+yoFiHsFgX0FfIIFeogFeo4FfJQFgZkFiJsFDvlI95T39hWL90sFjpwFlZgFmpUFnI4FnIgFmoEFlX4FjnoFi/tLBfdpiwWciAWaggWVfQWOewWIegWBfgV8ggV6hwX7aYsFi/tLBYh7BYF9BXyCBXqIBXqOBXyUBYGZBYibBYv3SwX7aYsFeo8FfJQFgZgFiJwFjpsFlZkFmpQFnI4FDvlI96puFcJVBZV9BY56BYd7BYF+BXyCBXqIBXqOBX2VBTXfBYeRBYaRBYuMBYqMBYqSBYmSBYyMBYqMBY2SBYyTBYyLBYuMBZCRBY+RBfc/9zwFmpUFnI4FnIgFmoMFlX0Fj3sFiHsFgX0FDvlI90L35RX3kosFnIgFmoIFlX0FjnsFiHsFgX0FfIIFeogF+5KLBXqOBXyUBYGZBYibBY6bBZWZBZqUBQ75SPf/7RX7D4sFeY4FfZQFgZkFiJsFjpsFlZkFmZQFnY4F9w+LBZyIBZmCBZV9BY97BYd7BYF9BX2CBQ75SKOAFfhx+WMFl5cFm5EFnYwFm4UFmIAFknwFjHoFhXwF/HH9YwV/fwV7hQV5igV7kQV+lgWEmgWKnAUO+Uj4CfkPFUOeBUN4BUZQBWMvBYH7JQWj+wwFxi0F2F0FyYsF2LkFxukFo/cMBYH3JQVj5wVq9x4VjYoFkYgFkYgFjIoFjYoF4EEFi4sFjIoFj4UFkIUFi4oFjIoFuSEFjIQFjYUFlvsyBYqGBYuGBXH7GQWIhQWJhAVH+wIFiYoFiokFhocFh4YFiYoFiooFKVEFh4kFiIkFhooFh4oFh4sFh4oFM4sFh4wFh4sFh4wFhowFiI0Fh40FKcUFiowFiYwFh5AFho8Fio0FiowFRvcCBYmSBYiRBXH3GQWLkAWKkAWW9zIFjZEFjJIFufUFjIwFi4wFkJEFj5EFjIwFjIsF39UFjYwFjIwFkY4FkY4FjYwFjYsF6aMFjowFjowFkYoFkYwFjooFjooF6XMFDvlI9/v5ZRWQjgWNjAWNjAWSiwWSjQWMigWNiwWSigWSiQWMigWNiwWRhwWQhwWMigWNigWOhQWPhQWMigWLiQWMhQWNhAWL/REFh3sFgX0FfYIFeogFeY4FfZQFgZkFiJsFi/i2BTRFBXuDBXqJBXqPBX2WBYOZBYmbBY+bBZaYBfc19xUFDvlI90rmFffoiwWdiAWZggWVfQWOewWIewWBfQV9ggV5iAX8TosFg4wFg4wFiowFiosFhY8FhI8Fi4sFiowFhpEFh5EFi4wFiowFipIFiZIFi4wFi4wFjJIFjJIFjIwFi4wFj5EFj5EF9zn3PgX3L/dKBcTlBZezBYueBYOqBXeiBV6dBUaQBWaGBVBzBWttBX9mBYN9BX6ABXqGBXmNBXyTBYCYBYaaBYycBZu6BYuMBYyNBY+QBY6RBYyMBYyNBbi2BYuLBYuLBZOQBZKQBYuLBYuLBdWoBZCNBZGMBbqSBZCKBZCMBd2FBZKJBZKKBclxBYyKBY2LBZCHBZGHBYyKBY2JBaxlBYyKBYuKBY+FBY6EBYuKBYyKBZdeBYuFBYyGBYptBYqGBYuGBX1ZBYiFBYmGBUwpBYmJBYqJBfsy+04FiooFiooFDvlI9wqUFYeMBVObBXySBX+YBYabBY2bBZOaBZmVBZuQBZ2KBcB8BdeABeiJBb2WBdGxBbW2BZy5BYOvBWWzBUStBTSiBT2UBYiMBYiLBYWOBYaMBYmNBYiNBYePBYeOBYmOBYmNBYmQBYmQBYuOBYqOBYuQBYuRBYyNBYuOBY2QBY2QBY2NBY2OBY+PBY+PBY6MBY2NBZCNBZGNBY6LBY6MBduVBeKdBdGpBauoBZGqBXWtBV2uBUagBTyPBUp2BVZxBWhxBXyEBXmKBXuQBX2WBYOZBYqcBZCaBZeYBbCnBY+MBY6OBceoBY6MBY6NBdikBZOMBZSMBemGBZCKBZGKBd1yBZKIBZOHBcVeBZCGBZCGBa9UBY2EBY6FBYuKBYyKBYqEBYuDBYBQBYmHBYqHBYmIBYmHBYiIBYiHBVxfBYWGBYSHBUduBdFqBZGGBZKHBcBUBYyIBY6JBY2GBY6HBYuIBY2HBZZQBYuJBYyIBYqFBYuGBYqIBYuJBXNKBYuLBYuLBYeEBYaEBYuLBYuLBVZUBYWHBYaHBTlfBYWJBYWIBU19BYWLBYWKBSeNBYiMBYiLBTmWBQ75SPgF98IVi+oFj5sFlJgFmpUFnI4FnIgFmoEFlX4FjnsFiywF6YsFnIcFmoIFlX0FjnsFiHsFgX0FfIIFeogFLYsFi/s9BYh7BYF9BXyCBXqIBXqOBXyUBYKZBYebBYv3PQX71IsFhIwFhYwFiYwFiYsFhY8FhY0Fio0FiYwFh5AFh5AFi40FiY0FipEFiZEFi40Fi40FjJEFjJEFjI0Fi40Fj5EFjpAF+Ab4PgWYlgWcjwWcigWbgwWWfgWQfAWKegWCfQX7yfv5BQ75SKn5QRWOmwWVmQWalAWcjwX4WIsFnIcFmoIFlX0FjnsFiHsFgX0FfIIFeogF/CuLBYv7dwX3HakFk4sFk4wF9x57BZOIBZOJBcJuBZGGBZGHBbFiBYyJBYyKBY6FBY+FBYuKBYyJBaj7BAWLigWLigWLhAWMhAWKigWLiQV9UQWLiwWLigWHhAWIhAWLiwWKigVnXgWFhQWFhgVFYQWFiQWFiAU5dQWGigWGigU+hwWFjAWGiwVKlwWGjQWGjAVWogWGjgWFjwVUugWAmAWHmwWOmwWUmQWZlQWcjwWciQWaggW9YQW0eQXCgQXNjgXSngXFrgWlqwWUswVz5wVxpwVjoAX7DZkF+01iBYaLBYaKBYeMBYiKBYaNBYaMBYiNBYeMBYePBYeNBYmOBYiNBYmQBYiPBYuOBYmPBYuPBYqQBQ75SPch96QVi4sFi4sFbW4FioMFnlkFm24FtWEFtHIFzoEF2o8FxaMFsqoFnrMFjaoFf7MFeKwFcqQFZ5sFUJcFU44FU4MFU28F+yxcFYqPBYyRBYy5BYuLBYuLBY7cBY2RBYyRBafaBYyNBYuNBbTfBZCSBZCRBcC7BY6NBY2NBdC4BZGOBZCOBdykBYyLBYuLBeKlBZ2NBZuGBZmBBZN8BY17BYZ7BYB+BXyDBTRyBUFzBU9kBV5jBWdABXJEBYp7BZGOBZCPBdGtBZKNBZKOBc6UBZCLBY+LBcuJBY+KBY+LBc58BZCKBZCJBbt2BZKGBZKHBa5oBY6GBY+GBaNhBYyHBY2HBZpZBYyEBYyFBYlbBYuLBYuLBYmDBYmDBYuLBYuLBW9UBYuKBYqKBYaGBYeFBYqKBYqLBVhiBYaIBYaIBUNtBYOJBYOJBS+GBYeMBYaLBTmXBYqLBYqLBYSOBYOOBYuLBYqLBVasBYiPBYaNBVq8BYeQBYeQBXaxBYqOBYqOBXXHBYqSBYmTBQ75SPfP90gVg/saBYd7BYF+BXyCBXmJBXqPBX2VBYKZBYmbBZL3HAWMjQWLjQWc9wcFi4wFjI0Fms0FjI0Fi4wFnsYFjIwFi40FoL4FjIwFi40ForcFjIwFi40Fo7EFjIwFjI0FoqoFjI0FjIwFoqYFjYwF+96LBXmOBX2UBYGZBYibBY6bBZWZBZmUBZ2PBfhfiwWQigWQigWOigWPigWPiAWQiQWOiQWNiQWOhwWPhwWMiAWNiAWMhgWNhgWLiAWMiAWJhgWLhgWKiAWKiAWIhwWJhgWIiQWJiAWHiAWHiAVqeQV9gQVkaAV3dAV2bgV1aAV2YgV4WwV5UwV8TAUO+Uj3pvf2FUR0BUpaBXBZBYleBaZdBcVnBdlzBciJBeCmBb6wBaLEBYLEBWK1BTi2BVKfBdH3sxU4kQVLgAVXcwVrXQWVaQW4ZQW/bAXDeAWwlgXetQWdpgWMwwV1rwVr9wEVi4sFk4gFk4kFi4sFjIsF0GgFjokFj4kFjocFj4gFjYgFjYgFrVIFjIkFjYgFjIYFjYYFiogFjIgFiTwFi4gFi4kFiYUFioYFiYkFiogFbVwFiYkFiYgFh4gFh4cFiIoFiYkFUm4F0mYFkIcFkYcFw1IFjYcFj4gFjIcFjYgFjIYFjIcFmDoFi4kFi4kFioUFi4UFiokFiokFbDwFiYcFiogFh4cFiYgFiIgFiIkFR1sFhYgFhYcFJ2sFg4oFg4oFP40FhY0FhIsFMqcFho4FhY0FQ7gFio0FiYwFho8Fh5AFio0FiYwFZc0Fio4Fio4FipAFiZAFjI4Fio4Fjs0Fi4wFi4sFjZMFjZIFi4wFi4sFr80Fi4wFjIwFkJAFkJEFi4wFjIsF2sYFkY4Fko8FmI8FaZ8FiI4Fh40FUrwFiY0FiI4FiY8FiI8Fio4FiY4FeMsFi40Fi4wFipIFi5IFi4wFi4wFjpIFjZIFjIsFjI0Fu9IFjo4FjY4Fj44Fj44Fjo0Fjo0F0KsFkYwFkY0F15gFkIsFkYwF7YQFDvlI+Fr4mBWVnQV8xwVwqwVfoAVIkwVHgwVTdAVnagV+XwWYYAWvaQXDdAXMhAXMmgW8qgVf/BoVi4oFZ0IFgX4FfIIFeYgFeo8FfZUFgpkFiJsFj5sFr9QFtuoFwPcXBYuLBYuMBZKcBT55BYOKBYKLBTuUBYWNBYWMBUWoBYSPBYSQBVm6BYqNBYmMBYiQBYeQBYuOBYqNBXfNBYqOBYqOBYyQBYqQBYyOBYyPBZ/NBYyNBYuNBY+QBY6QBY2NBYyNBb26BZKPBZKQBdGnBZGMBZGNBduVBZGKBZGMBduBBZKJBZKJBcdvBYyKBYyLBZGGBZGHBYuKBYyKBbNcBYyKBYyKBY6FBY6FBYuJBYyKBZ83BYuFBYyEBYqJBYuJBYmFBYmGBYqHBUH7SAVW+xgFi4oFiooFXysFDvlI9y/3yxX4OvtDBZqBBZR9BY57BYd7BYF9BXyCBXqJBXqOBfyY92oFhI8FhY8FiowFiowFh5EFh5EFi4wFiosFipMFiZIFi4wFi4wFjZIFjJIFjIwFi4wFj5EFj5EFjIwFjIsFkY8Fko8F+Jj3agWcjwWciAWaggWVfgWPewWIegWCfQV8ggUO+Ui2+GkV+JiLBZyIBZqCBZV9BY57BYh7BYF9BXyCBXqIBfyYiwV6jgV8lAWBmQWImwWOmwWVmQWalAWc+4gV+JiLBZyIBZqCBZV9BY57BYh7BYF9BXyCBXqIBfyYiwV6jgV8lAWBmQWImwWOmwWVmQWalAUO+Uj44/fpFYyKBY+FBY+FBYuKBYyKBYyEBY2EBYuKBYuKBYmEBYqDBYqLBYuKBYeFBYeFBYqKBYqKBYWHBYSHBfyY+2oFeogFeo0FfJQFgZkFh5sFjpsFlJkFmpUF+Dv3QwX8O/dDBXyUBYKZBYicBY+bBZWYBZqUBZyOBZyHBfiY+2oFkocFkYcFDvlI+Ev3kxWGigX7q4sFi4sFLPtyBYF9BX2CBXqIBXmOBX2UBYGYBYecBY6bBfek+REFkJIFkJIFi4sFi4sFko8FkpAFi4sFjIsFk40Fk40FjIsFi4sFk4kFlIoFi4sFi4sFkoYFkocFjIsFi4sFkIQFj4QF97r9EQWPewWIegWBfgV9gQV6iAV5jgV9lAWBmAX7IvfIFfsB94AFJvuABQ75SPe++GUV2bYFlMsFTL8F+weeBSmGBYv7VgX32vxEFYSJBYmLBYmLBfv7hwWKiwWLiwWDjAWCjQWLiwWLiwWEjwWEkAWKiwWLiwWGkgWHkQWLjAWKiwWKkwWJkgWLjAWLiwWL+QoFjJIFjZIFi4wFi4wFkJEFjpEFjIwFjIwFkY8FkY8FjYsFjIwFkowFk40F9yWTBZCKBZCLBfcZdQWOigWPigWQiQWQiQWNiQWOiQXlQQWNiAWPiQWNhwWOhwWMhwWNiAWLhgWMhwWLhwWLhwV9+wAFiokFi4gFiIYFiYYFiYkFiogFh4cFh4cFiIoFiYkFSGYF9wJmBY6JBY+KBY+IBY+JBY2IBY6IBdE3BY6GBY6FBYyJBYuKBYyEBYyEBYX7AAWLiQWLiQWJhQWJhQWKiQWKiQVsWwWIiQWKiAWHiAWHhwWIigWIiQU+ZAWJigWJigVu3BXEqAWeqAWP3QVYyQX7JLsF+1CWBYv7nAUO+Uj4ZPclFaDbBZOZBZiXBZuQBZ2KBZuEBZd/BZF7BYp7BXIwBYqIBYqHBYiHBYmHBYiIBYmIBUNLBYiJBYmJBYaJBYaIBYiLBYiJBSl1BYuLBYuLBYOLBYKLBYuLBYuLBfsEnAWJiwWKjAWEjQWEjgWKjAWKiwVRsQWFkQWFkQVU3QWLiwWLiwWIkwWIkgWLiwWLiwVm918Fi5MFi5MFuvdeBYyMBYuNBY+RBY2RBY2MBYyNBc7XBYyMBYuLBZGQBZKQBYuLBYuLBdGsBZKNBZKOBdqVBYyLBYyLBZOKBZKLBYyKBY2LBfVqBYyLBYyLBZKHBZGHBYyLBYyKBcNZBYyLBYuKBZCFBY+FBYyKBYuLBapEBY57BYh7BYF9BXyCBXqIBXqOBXyVBYGYBXDJBWKwBTSlBU6EBVVxBVRNBWD7TAWt+04FuUgFtG8F6H0F2JwFDvlI93uVFYaKBfs1iAWLiwWKiwWDjAWDjQWKiwWLiwWEjwWEjwWLjAWKiwWHkgWGkQWLjAWLiwWJkwWJkgWMjAWKiwWT+QQFjJAFi5EFjY0Fi48Fj48FjY8FjY4FjY0FkI4Fj44Fjo0FjowFkIwFkY0F7pgFj4sFjowF14kFkYoFkIsF9xBrBYuLBYuLBZOHBZKIBYyLBYuKBeZIBYyKBYuLBZCFBZGFBYuLBYuKBb8wBY2FBY6GBaAsBYuHBYyHBY1EBYqHBYuIBYJOBYmHBYqHBXhXBYeFBYmGBUw8BYWGBYWGBTdZBYWJBYWIBfsdaAV53hX3EasF0rUFwM4Fm7UFlMAFicsFeOAFXtoFPsQF+wGnBUiMBVGDBYX8tAUO+Uj3EeUV+CGLBZyIBZqCBZV9BY57BYh7BYF9BXyCBXqIBfxOiwV6jgV8lAWCmQWHmwWL99MFi/fSBY+bBZSZBZqUBZyPBfhOiwWchwWaggWVfQWOewWIewWBfQV8ggV6iAX8IYsFi/t+BfeciwWdiAWZggWVfQWOewWIegWBfgV9ggV5hwX7nIsFDvlI9xf32hWL+6oFiHsFgX0FfYIFeYgFeo4FfZQFgZkFh5sFi/kRBY+bBZWZBZmUBZyPBZ2HBYyKBfgviwWciAWZggWVfQWPewWHewWBfQV9ggV6iAX8FYsFi/t4BffQiwWdiAWZggWVfQWOewWIewWBfQV9ggV5hwUO+Uj4fve0Ffs1iwV6jwV9lAWBmQWImwWOmwWVmQWZlAWdjgX3bIsFj4oFkIsFj4kFj4oFj4kFj4kFjogFj4kFjYgFjocFjYgFjYcFjIcFjYcFi4cFjIcFiocFi4cFXvtaBYqJBYuIBYiGBYiGBYmJBYqJBUtGBYmKBYqJBYWIBYaHBYmKBYmKBTpwBYqLBYuKBYOKBYOKBYqLBYqLBTWSBYSNBYSNBTmuBYWOBYaOBUfCBYaQBYaQBV/QBYuMBYqMBYmRBYiSBYuMBYuMBXf3UgWLkQWLkgWx90IFjIwFi40FjpEFjpEFjIwFjI0FzdsFjIwFi4wFkZAFkY8FjIwFjIsF37QFi4sFi4sFk40Fk44Fi4sFi4sF9xeVBZKKBZGLBfcQcQWbhQWXfwWRfAWLegWEfAV+gAV7hQV5iwX7CKMF+weCBUhrBVZJBWj7MwWe+0IFrlUFxFwF0W4Fz4UFx6AFvL8FDvlI+H74OhWL95sFj5sFlJkFmpQFnI8FnIcFmoIFlX0FjnsFi/0RBYh7BYF9BXyCBXqIBXqOBXyUBYKZBYebBYv3tgX8DosFi/u2BYd7BYJ9BXyCBXqIBXqOBXyUBYGZBYibBYv34AWL98UFjpsFlZkFmpQFnI8FnIcFmoIFlH0Fj3sFi/ubBQ75SPfu+UEVi/0RBYh7BYF9BXyCBXqIBXqOBXyUBYGZBYibBYv5EQWOmwWVmQWalAWcjwWchwWaggWVfQUO+Ui/9z4Vio4Fia8FjpsFlJkFmZUFnY4FnIkFmoIFlX4Fj3sFjGsFkXIFlXYFmXkFnX0FunoFzoQFu5EFwp8FoJkFnJ0Fl6EFk70FivhxBY6bBZWZBZqUBZyPBZyHBZqCBZR+BY96BYz8dAWKiAWLiAWCTgWJhQWJhAV5awWHhgWIhwVycQWHiAWIiAVtdwWGiQWGiAVKcwWGigWFigVRhAWGiwWGiwU8kwWFjAWFjAVRoQWFjwWFjQVvoQWHjwWHjgV2pQWJkAWIjwV+qAWKkAWJjwWEqwUO+Uj3Uff3FfsBOQWL+3UFiHsFgX0FfYIFeYgFeo4FfZQFgZkFh5sFi/kRBY+bBZWZBZmUBZyPBZ2HBZmCBZV9BY57BYv7xAX4Hve7BZuSBZyNBZyGBZiABZR8BYx7BYZ7BX9/Bfui+14F9+b70AWVfQWPewWHewWCfQV8ggV6iAV6jgV8lAUO+Uj3DOUV+CuLBZyIBZmCBZV9BY97BYd7BYF9BX2CBXqIBfxYiwV6jgV9lAWBmQWHmwWL+REFj5sFlZkFmZQFnI8FnYcFmYIFlX0FjnsFDvlI+KH5WxWOjwWNjQWNjQWRjQWPjgWOjAWOjAWRjAWRjAWOigWOiwWQiQWRigWNigWOigWQhwWPiAWNiQWNiQWOhgWOhgWMiQWMiAWLhgWNhQWL/REFh3sFgX0FfYIFeogFeY4FfZQFgZkFiJsFi/h1BftD+6wFiYkFiokFhocFh4cFiYkFiYoFhYkFhYgFiYsFiIoFhYwFhYoFiIwFiYsFhY4FhY0FiYwFiY0Fh48Fho8Fio0FiY0F+0P3rAWL/HUFiHsFgX0FfYIFeYgFeo4FfZQFgZkFh5sFi/kRBY2RBYuQBYyOBYyNBY6QBY6QBY2NBY2NBY+OBZCPBY6MBY2MBZGMBZCNBY6LBY6MBZGKBZGKBY6KBY6KBY+IBZGJBY2JBY2JBY6HBY+HBfdw+/UF93D39QUO+Uj4e/dPFYT4hgWOmwWVmQWZlAWcjwWdiAWZggWVfQWPewWU/REFioYFi4cFiocFiocFiYgFiYcFiIgFiIcFiIkFiIgFh4kFh4kFh4oFh4oFhosFh4oFhosFh4sFh40Fh4wFh40Fh4wFiI4Fh44FiI4FiI4F/BT4oQWL/IkFh3sFgn0FfIIFeogFeo4FfJQFgZkFiJsFi/kRBYyPBYuPBYyPBYyPBY6PBYyOBY6OBY6PBY6NBY6OBZCNBY+NBY+MBY6NBZCLBZCMBY+KBY+LBY+JBZCKBY+JBY6KBY+IBY+IBY2IBY6IBQ75SPgblBWFiAWJiwWJiwUzgAWKiwWKigWEjAWDjAWKiwWKiwUypQWJjAWIjAWGjgWGjgWJjQWJjAU62gWJjgWIjgWJjwWIjwWLjwWJjgVP96AFi40Fi4wFi5IFi5IFjIwFi40FxPddBY2PBYyPBY6OBY2PBY6NBY6PBdHEBYyMBYyMBZKOBZGOBY2LBYyMBfcOqQWPiwWPjAWQigWPjAWPiQWPiwX3B2cFjIoFjYsFkYcFkYgFjIoFjYkFzkoFjYgFjYkFjocFjYYFjIgFjIgFxfuJBYuDBYuDBW/7LgWIhAWJhQVYMgWKiQWLigWGhgWGhgWKigWKigUwTgWJigWKigUg0BXOkwXUvAW11gWl9x8FVvd1BVm8BTCoBShzBVdgBVj7RgXD+4sFy00FDvlI93j3xxWJigX7AooFi/uVBYd7BYF9BX2CBXqIBXmOBX2UBYGZBYibBYv5BQWMkQWMkgWMjAWLjQWPkQWOkAWNjAWMjQWQjwWRjwWNiwWMjAWSjQWRjAX3HZcFjosFj4sF9w6EBY+KBZCLBdp2BY+KBY+KBa96BZCIBZCIBcRbBYuKBYuLBZCFBZCEBYuLBYyLBaRXBY2EBY2EBZA/BYuJBYuJBYqFBYqFBYqJBYuJBXRcBYqJBYqJBYeHBYeFBYmKBYqKBWhxBYWIBYWIBVN2BYeKBYeJBTp8BYiLBYmLBfsCggWF4BX1kwXWmQW5nAWgmwWZpwWGxAV6sAVesQVxlwVEnQX7BpIFL4MFi/uJBQ75SPiTtRXQOQWTfAWNewWFewWAfwV7gwV6igV6kAV+lQVRzwVUYAWIigWJiQWGiQWGiAWHiwWIigU1fgWJjAWJigWEjAWFiwWJjAWIiwU0qQWJjAWIjAWGjgWGjgWJjgWJjAU75AWKjgWJjQWJkAWIkAWLjgWKjQVQ98MFi4sFi4sFi5MFi5MFi4sFi4wFw/d2BY2OBYyPBY2PBY6PBY2OBY2OBdDLBY2MBYyNBZGOBZGOBY2MBY2MBfcLrAWRjAWRjAWNigWOjAWRiQWRigX3BGMFjYoFjooFj4cFkYgFjIkFjYoFzUEFjIkFjYkFjYYFjoYFjIgFjIkFw/uoBYuEBYuEBW/7QgWJhQWJhQX7K0AVMfUFg5oFipsFkJsFlpcFm5MFnIwFnIYFmIEF0zcFmqkFpfc1BVb3lgVZxAU0qgUucQVXWgVY+2IFwvuvBctDBcx2BcmUBQ75SPfz+EoV3JcFrpgFoJsFlqIFjLMFfbkFgZYFd5gFcZUFQZsF+xSQBfsofgWL+10F90g8FftIhQWL+7cFh3oFgn4FfIEFeogFeo4FfJUFgZgFiJwFi/j8BYyRBYyRBYyNBYuNBY+QBY6RBY2MBYyNBZGOBZCPBY2MBY2MBZGMBZKNBfdUmwWOiwWOjAX3G4UFj4oFj4sF3HoFj4kFj4sFrX0Fj4kFj4kFp3kFj4cFkIgFoHQFi4oFjIsFjoQFj4UFi4oFjIoFnU0FjIUFjIUFiVQFi4sFiYMFiYMFi4sFeWQFiooFi4oFhoUFhoUFiosFi4oFaXAFhIgFhYcFXXoFhooFhokFNX8F94H7rQWTfQWNegWGewV/fwV8gwV5igV6kAV+lgX7nPfLBYOaBQ75SOXBFYaOBYqNBYiNBYmQBYeQBVr3AQWHnAWOmwWVmQWZlAWcjgWdiAWZggWVfgW3KgXNaQX3IIcF7bgFq/AFdsUFS68F+4ezBYiNBYiLBYaNBYaNBYmOBYiMBUu+BYiPBYiOBYmOBYiOBYqQBYmOBXrHBYuPBYqOBYuQBYuPBYyPBYyPBbT3DAWOkAWNkAWNjQWMjQWQjwWPjwXvzAWRjgWQjgWOiwWNjAWRiwWRjAX3R4IFjYoFjIwFkogFkooFjIoFjYoFkIcFkYcFjIoFjIoF1zAFknwFjXoFhXwFgH4Fe4QFeYoFe5AFfpYFTNYF+yOTBUBaBWssBZVoBbZoBfeDYwWTiQWTiAXfWgWQhwWQhwWNiQWMigWOhQWOhgWrNgWLhgWNhwWLhwWLiAWKhgWKhgVi+xgFi4oFiooFh4UFiIQFiosFiooFhYYFhYcFiosFiooF+xJRBYmLBYqKBYSKBYSJBYmLBYmLBfs2jwWJjAWJiwWFjQWEjAWJjAWJjAUzuQUO+Uj3yflsFfeiiwWchwWaggWVfQWOewWIewWBfQV8ggV6iAX7dYsFi/znBYh7BYF9BX2CBXmIBXqOBXyUBYKZBYebBYv45wX7hYsFeo4FfJQFgZkFiJsFjpsFlZkFmpQFnI8FDvlI+HT3hxWQ+E4Fj5sFlZkFmZQFnY4FnIcFmYIFlX0FjnsFhvxQBYqIBYyJBYFHBYqHBYqGBXdYBYmIBYmHBX53BYiHBYiIBW1sBYWHBYaHBVhxBYSJBYSJBU2BBYWLBYSLBTOUBYaNBYWMBUWlBYWPBYWOBVyvBYeQBYWQBWjCBYiRBYiRBXnSBYqPBYqOBYTsBYuNBYuMBYr39wWOmwWVmQWalAWcjwWchwWaggWVfgWOegWM+/UFki8Fm00Fp2EFr28FxXYF14IFu5MFsJ4FoqIFk5cFnLYFDvlI99H3NRX3a/ivBZSZBZqVBZyPBZyIBZqCBZV+BY97BYh6BfuS/REFi4sFi4oFhoUFh4QFi4sFiooFhIcFhYYFiosFi4sFg4kFg4oFiosFi4sFg4wFgowFi4wFiosFhI8FhI8Fi4sFi4wFhpEFhpEFi4wFi4sF+7j5EgWHmwWOmwWVmQWZlAWcjwWciAWaggWVfQUO+Uj4dvdYFdf4gwWQmwWXlwWbkgWcjAWchgWYgAWTfAWMegUq/REFiYcFioYFiYgFiocFiIgFiIcFiIkFiIgFh4kFh4kFh4oFh4kFh4sFhooFh4sFh4sFho0Fh4sFh40Fh40FiI4Fh40FiI4FiI4FiY8FiI4F+0b3/wX7Ofv2BYiHBYiGBYmJBYmJBYaIBYeHBYiKBYiKBYaKBYWJBYiLBYiLBYWMBYaLBYiNBYiLBYaOBYaOBYmNBYiNBYiPBYiPBYqOBYmOBYqQBYmQBTv5CQWNnAWTmQWYlgWckAWcigWbhAWWfgWRewXH/G8F9x/3vgWPkAWPkQWMjAWMjAWRjwWRjwWNiwWMjAWSjAWSjQWNiwWMiwWSiQWTigWMiwWMigWRhwWSiAWMigWMigWPhQWPhQUO+Uj3/Pf/FfeZ+7QFlH0FjXsFhnsFgH4FfIMFeYkFeo8FfpYF+5D3qQX7kPupBX6ABXqHBXmNBXyTBYCYBYabBY2bBZSZBfeZ97QF+5/3uwWCmQWJnAWQmwWWlwWalAWdjAWchwWYgQX3lvuxBfeW97EFmZUFm48FnYoFmoIFln8FkHsFiXoFgn0FDvlI9+j4EhWV++EFiHsFgn0FfYEFeogFeY0FfJQFgZkFh5sFgffjBfud96cFgpkFiJsFj5sFlpkFmpMFnI4FnIcFmYEF94n7kQX3k/eQBZqVBZyPBZyIBZqCBZV+BY96BYh7BYJ9BQ75SPci5RX4KosFnYgFmYIFlX0FjnsFiHsFgX0FfYIFeYgF/IKLBYWMBYaLBYiMBYeMBYeOBYaNBYmNBYiNBYiPBYePBYqOBYmOBYqQBYmPBYuPBYuOBYyQBYuQBYyOBYyOBY6PBY2QBfhP+M4F/CqLBXmOBX2UBYGZBYibBY6bBZWZBZmUBZ2PBfiCiwWRigWQigWOigWPigWPiQWQiAWNiQWOiQWOhwWPhwWMiAWNiAWMhwWNhgWLiAWLhwWKhgWLhgWKiAWKiAWIhwWJhgUO+Uj3h3QV9zaLBZyIBZmCBZV9BY97BYd7BYF9BX2CBXqHBftjiwV5jwV9lAWBmQWImwWL+Z8FjpsFlZkFmZQFnY4F92OLBZyIBZmCBZV9BY97BYd7BYF9BX2CBXqIBfs2iwUO+Ujw+VgV+HH9YwWRfAWKegWEfAV+gAV7hQV5jAV7kQV/lwX8cfljBYWaBYycBZKaBZiWBZuRBZ2KBZuFBQ75SPhWShWHewWBfQV9ggV6hwX7Y4sFeY8FfZQFgZkFiJsFjpsFlZkFmZQFnY4F9zaLBYv5SwX7NosFeY4FfZQFgZkFiJsFjpsFlZkFmZQFnY4F92OLBZyIBZmCBZV9BY97BQ75SPeo+WQVko8FjIsFjIwFkowFk40FjIoFjIwFk4kFkooFjIoFjIsFkocFkYcF9577ggWVfgWPewWIegWBfQV9ggV6hwV6jgV8lAX7f/dmBft/+2YFfIIFeogFeo8FfZQFgZkFiJwFj5sFlZgF9573ggUO+UiL+wEV+O6LBZyIBZqCBZV9BY57BYh7BYF9BXyCBXqIBfzuiwV6jgV8lAWBmQWImwWOmwWVmQWalAUO+Uj4POoVxcIFi/eQBVLBBVCnBS+LBVBvBUxQBWsvBYtQBaswBcpPBcdvBeaLBfcIZhWHiAWFhwVAZwWKigWJigWEigWFiQWJjAWJigX7BYsFiYwFiYoFhI0FhYwFiYwFiYwFQK8FhY8FhY8FP9MFiowFiowFiJEFh5EFiowFiowFZvYFipIFipIFi9IFjJIFjJEFsPcABYyNBYyMBY+RBY6RBYyMBYyMBdfTBZGPBZGPBdeuBYyMBY2MBZKMBZKNBYyKBY2MBfcFiwWMigWNjAWSiQWSigWMigWNigXWaAWQhwWQiAWLjwWPnAWUmAWalQWcjgWciAWagQWVfgWOegWL/IoFiHsFgX4FfIEFeogFeo4FfJUFgpgFh5sFDvlI9xOvFYaOBYuKBYd6BYF+BX2CBXqHBXmPBX2UBYGYBYicBYv5OAWOmwWVmQWZlAWdjgWciAWZggWVfQWPewWL+3YFkI4FkY8F1asFjIsFjIsFko0Fk40FjIoFjIwF9wSLBYyLBYuLBZOJBZOJBYyLBYuLBddrBZCHBZKIBdZKBYyKBY2KBY6FBY+GBYyJBYyKBbApBYyEBYyEBYtLBYqEBYqDBWYrBYqKBYqJBYeGBYiFBYmKBYqJBUBLBYWIBYWHBUBqBYqLBYqLBYSJBYOJBYqLBYqLBfsEiwWKjAWKigWDjQWEjQWKiwWKiwVBrAWA9w0VwlwFxnEF54sFx6UFycAFqdoFi70FbdsFTcAFT6QFL4sFUHIFVFwFDvlI+DLqFczNBZqVBZyPBZyIBZqDBZV9BY97BYl7BYF9BUVDBYWHBYWHBUZmBYiLBYmJBYWKBYWJBYiMBYmKBSGLBYmMBYiKBYWNBYWMBYmNBYmLBUSwBYWPBYWPBUXTBYqMBYqMBYeRBYeRBYuMBYqMBWn2BYqRBYqSBYvSBYyRBYySBa33AAWMjAWLjAWPkQWPkQWMjAWMjAXR0wWRjwWRjwXSrwWNiwWNjQWRjAWSjQWNigWNjAX1iwWNigWNjAWSiQWRigWNiQWNiwXRZwWRhwWRhwXRQwWVfQWNewWHewWBfQV8gwV6iAV6jwV8lQVKzQVWpgU3iwVVcAVRUAVtLgWLUAWoLwXGUAXCbwXdiwUO+Uj4PfUVwroFi/dxBVS6BVCkBS+LBU9yBU1WBW07BYtZBak8BclWBcdxBeeLBfcGYhWGiAWFhwVBagWKiwWKiwWEiQWDiQWKjAWKigX7BIsFiosFiosFhI0Fg40FiosFiosFQKwFhY8Fho4FP8sFio0FiYwFiJEFh5AFio0FiowFZusFipMFipIFi8sFjJIFjJIFsO0FjIwFjI0Fj5AFjpEFjYwFjIwF18wFkY4FkI8F16sFi4sFjIsFk40Fk40Fi4sFjIsF9wSLBYyKBYyMBZOJBZKJBYyLBYyLBdVrBZGHBZCIBYv3dgWPmwWVmQWZlAWcjgWdiAWZggWVfQWOewWL/TgFiHoFgX4FfYIFeYcFeo8FfZQFgZgFh5wFDvlI9x74IBV8YQX4GIsFg5QFZs0FbaYFS6cFJosFSm8F93r7/BXXzgWZlAWdjgWchwWZggWVfQWNegWIewWAfgU6QwWGiAWFhwU8ZgWJiwWKigWEigWEiQWJiwWKiwX7DYsFiosFiosFg40FhIwFiowFiosFOrAFhY8FhY4FO9MFiYwFiowFh5EFh5AFi40Fio0FY/YFipIFipIFi9IFjJIFjJIFs/cABYyNBYuNBY+QBY+QBYyNBY2MBdvTBZKOBZCPBdyvBYyLBYyMBZOMBZKNBYyLBYyLBfcNiwWMiwWMiwWTiQWSigWMigWMiwXbZwWQhwWRiAW1ZwWPhQWQhQWyRAWQewWJegWDfQV/ggWUhQWVfgWOegWIewWBfQV9ggV5iAX8SYsFi3UFrDAFz08FzG4F8IsFDvlI97n4VhWL/CQFiHsFgX0FfIIFeogFeo4FfJQFgZkFiJsFi/gkBfsGiwV6jgV8lQWCmAWHmwWPnAWUmAWalQWcjgX3BosFi8AFi40Fi40FjZEFjJEFjY0Fi4wFwOoFkZEFkJEFi4sFi4wFk44Fko8F9asFkowFkowF9YsFnIgFmoIFlX0FjnsFiHsFgX0FfIIFeogFKIsFOXIFZEUFi2EF9zuLBZyIBZqBBZV+BY56BYh7BYF+BXyBBXqIBQ75SPg99yMVwroFi/dxBVS7BVCkBS+LBU9yBU1WBW06BYtaBak7BclWBcdxBeeLBfcGYhWGiAWFhwVBagWKiwWKigWEigWDiQWKiwWKiwX7BIsFiosFiosFg40FhIwFiowFiosFQKwFhY8FhY4FQMwFiowFiYwFiJEFh5AFio0FiowFZuwFipIFipIFi8wFjJIFjJIFsOwFjI0FjI0Fj5AFjpAFjY0FjIwF1swFko4FkI8F16sFi4sFjIwFk4wFk40Fi4sFjIsF9wSLBYyLBYyLBZOJBZKKBYyKBYyLBdVrBZGHBZCIBYuLBY+cBZWYBZmVBZyOBZ2IBZmBBZV+BY56BYv8mAWKhAWKhAVmKgWKigWKiQWHhgWIhQWJigWKiQVlawWFhwWFhwVBbAWKigWKiwWEiQWDigWKiwWKiwX7BIsFiosFi4sFg4wFg40FiosFi4sFP6sFho8FhI8FQMsFio0FiYwFiJAFh5AFio0Fio0FZuwFiZwFj5sFlZgFm5QFnI0FnIcFmYEFlH0FrDQFyVYFx3EF54sFxqUFpKAFqdoFDvlI+L34CRWNhAWL+9AFiHsFgX0FfIIFeogFeo4FfJQFgZkFiJsFi/fIBW7TBVqfBSyLBU1yBS49BYv7vQWIewWBfQV8ggV6iAV6jgV8lAWBmQWImwWL+SwFjpsFlZkFmpQFnI4FnIgFmoIFlX0FjnsFi/uSBbKsBZGOBZGPBdeqBYyLBYuMBZOMBZONBYyLBYuLBfcGiwWMiwWLiwWTiQWTigWMigWLiwXXbAWLiwWLiwWShgWShwWLigWMiwWPhAWQhQWLigWLiwWxLAUO+Uj3mfmIFduLBZyIBZqCBZV9BY57BYh7BYF9BXyCBXqIBTuLBXqOBXyUBYGZBYibBY6bBZWZBZqUBfH7mRWL/E4FiHsFgX0FfIIFeogFeo4FfJQFgZkFiJsFi/hOBY6cBZWYBZqVBZyOBZyIBZqBBZV+BQ75SPgV+YgVyYsFnIgFmoIFlX0FjnsFiHsFgX0FfIIFeogFTYsFeo4FfJQFgpkFh5sFj5sFlJkFmpQF+wn+MhWGigWIjQWHiwUpqQV8kwWAmAWGmwWNmwWUmQWZlgWbjwWdiQXhcQXpoQWhyQWL+I4Fj5sFlJkFmpQFnI8FnIcFmoIFlX0FjnsFi/yVBYqEBYqFBWswBYiGBYmHBYmIBYmIBYeIBYeIBYiJBYiJBYaKBYaJBfsXbQWIiwWHigUO+Uj3f/eMFfsRLwWLIQWIewWBfQV8ggV6iAV6jgV8lAWCmQWHmwWL+SwFj5sFlJkFmpQFnI4FnIgFmoIFlX0FjnsFi/xXBff495sFm5IFnIwFnIYFmIEFk3wFjHoFhnwFgH4F+2v7MgX3mPtwBZV+BZB7BYh7BYJ9BX2BBXqHBXqNBXyTBQ75SPfu+WMVi/0xBYh7BYF9BXyCBXqIBXqOBXyUBYGZBYibBYv5MQWOmwWVmQWalAWcjwWchwWaggWVfQUO+Uj43/iYFZCGBYuKBYyJBYyFBY2EBYuKBYyJBYv8WwWHewWBfQV9ggV6iAV5jgV9lAWBmQWImwWL+EgFfJYFXIsFdHgFVDEFi/vmBYh7BYF9BX2CBXmIBXqOBX2UBYGZBYebBYv36gVo4wV1nAVdiwVzeAVVMQWL++YFh3sFgX0FfYIFeogFeY4FfZQFgZkFiJsFi/h9BY6cBZWYBZmVBZ2OBZyIBZmBBZV+BY2ABa2mBZGOBZGPBY2LBYyMBZKLBZKNBduLBZKJBZKLBYyKBY2LBZGHBZGIBbZoBYyJBY2KBY+GBY+GBYuJBY2JBZN1BZynBZCQBZCRBbWtBZGPBZGPBY2LBYyMBZKLBZKNBdyLBZKJBZKLBYyKBY2LBZGHBZGIBbZoBYyKBYyKBQ75SPi++B0VjIUFi/vyBYh7BYF9BXyCBXqIBXqOBXyUBYGZBYibBYv36wVt3QVaoQUtiwVPcAUsMwWL++AFiHsFgX0FfIIFeogFeo4FfJQFgZkFiJsFi/h9BY6cBZWYBZqVBZyOBZyIBZqBBZV+BY56BYtlBbCtBZKPBZCPBdiuBYyLBYyMBZKMBZONBYyLBYyLBfcGiwWMiwWNiwWSiQWSigWMigWNiwXWaAWMiwWLiwWShgWRhgWMiwWLiwWPhAWPhAWLiwWLiwWyIQUO+Uj37Ph4FTWLBVRwBU9PBWwvBYtQBaowBcdPBcNvBeCLBcKnBcfHBarmBYvGBWznBU/HBWH3AxWNjAWRiQWSigWNiQWNiwXTaAWRhgWRhwXTQwWLigWMiwWPhAWPhQWLigWMigWv+wAFjIUFjIQFi0QFioQFioUFZyAFiooFi4oFh4QFh4UFiosFi4oFQ0MFhYcFhYcFQ2YFiYsFiYkFhYoFhIkFiYwFiYoF+wCLBYmMBYmKBYSNBYWMBYmNBYmLBUOwBYWPBYWPBUPTBYuMBYqLBYeRBYeSBYuMBYqMBWf2BYqRBYqSBYvSBYySBYyRBa/3AAWMjAWLjAWPkQWPkgWMiwWLjAXT0wWSjwWQkAXTrgWNiwWNjQWSjAWRjQWNigWNjAX3AIsFDvlI9xTXFYWPBYv7dQWHewWCfQV8ggV6iAV6jgV8lAWBmQWImwWL+TMFjpwFlZgFmpUFnI4FnIgFmoEFlH4Fj3oFi4sFkY8FkI4F1asFjIsFjIwFk4wFko0FjIsFjIsF9wSLBYyLBYuLBZOJBZOKBYyKBYuLBdZsBZGHBZGHBdZLBY2KBYyJBY+GBY+GBYuJBY2JBa8rBY2EBYyDBYtLBYqEBYmEBWYsBYqJBYuJBYeGBYeFBYqKBYmKBUBLBYWHBYaIBUBqBYqLBYqKBYOKBYSJBYqLBYqLBfsEiwWKiwWKiwWDjQWEjAWKjAWKiwVBrAWA9w0VwlwFxnEF54sFx6UFyb8FqdoFi7wFbdsFTb8FT6QFL4sFUHIFVFwFDvlI+D33JRXCugWL924FVLoFUKQFL4sFT3IFTVcFbTsFi1oFqTwFyVcFx3EF54sF9wZiFYaIBYWHBUFqBYqLBYqLBYSJBYOJBYqMBYqKBfsEiwWKjAWKigWEjQWDjQWKiwWKiwVArAWGjgWFjwVAywWJjAWKjQWHkAWHkAWLjQWKjQVm6gWJkgWKkwWLywWMkgWNkgWw6wWMjQWLjQWPkAWPkQWMjAWNjAXWywWRjwWRjwXWqgWLiwWMjAWTjAWTjQWLiwWMiwX3BIsFjIsFjIsFkokFk4oFjIoFjIsF1WwFkIcFkYgFi4sFj5sFlJkFmpQFnI4FnIgFmoIFlX0FjnsFi/00BYh7BYF9BXyCBXqIBXqOBXyUBYKZBYebBQ75SPfp+MsVk40F9yaLBZyIBZmBBZV+BY96BYd7BYF+BX2BBXqIBfsdiwU4bgU5TwViNAWL+6MFiHsFgX0FfYIFeYgFeo4FfZQFgZkFh5sFi/h9BY+cBZWYBZmVBZyOBZ2IBZmBBZV+BY56BYtWBdTABZGNBZGPBeutBQ75SO6nFYSQBYuLBYuMBYeSBYeSBXLSBYmcBY+bBZaYBZuTBZyNBZyGBZmBBZN9BZ9TBbt0BfWLBeSsBbuhBYuoBVHCBfsBygX7BIsFiYsFiosFhI0FhIwFiowFiYwFQK8FhY8Fho8FiowFiYwFiJEFh5EFi4wFio0FipEFipIFi9IFjJMFjZMFi4sFi4wFkJEFj5IF1tMFjIsFjIwFkY8Fko8FjIsFi4wF764Fk4wFk40F9xGLBYyKBY2MBZKJBZKKBYyKBY2KBdZoBZmBBZN8BY17BYd7BYB+BXyDBXmJBXqPBUqqBSGLBTluBVRWBYtuBbN4BfcGiwWOigWPiwWQiQWQigWOigWPiQX3EEQFj4cFkIgF1kQFj4QFkIQFi4sFi4sFjYMFjIMFi0MFioUFioQFiooFi4kFh4UFiIYFiYoFiokFhYgFhoYFQGgFiYsFiYkFJ2cFg4oFg4kF+xGLBYmMBYmKBYWNBYSMBYmMBYqMBUCvBQ75SPdd+DEV+wyLBXqOBXyUBYGZBYibBY6bBZWZBZqUBZyOBfcMiwWL9zcFjpsFlZkFmpQFnI4FnIgFmoIFlX0FjnsFi/s3BfdDiwWciAWaggWVfQWOewWIewWBfQV8ggV6iAX7Q4sFi/uCBbNMBeF0BfOLBZyHBZqCBZV9BY57BYh7BYF9BXyCBXqIBfsCiwWFjAWFjAX7AqgFg48FhI4Fi4sFiowFhpEFhZAFVOIFio4FiY4FipAFiZAFjI4Fio4FDvlI+GX3SRWL9+AFjpsFlZkFmpQFnI4FnIgFmoIFlX0FjnsFi/x9BYh6BYF+BXyBBXqIBXqOBXyVBYGYBYicBYuyBWZpBYWHBYWHBT9oBYmKBYqKBYSKBYSJBYmMBYqKBfsGiwWJjAWKigWEjQWEjAWJjAWKjAU/rgWEkAWEkAWLiwWLiwWHkgWHkgVk9AWKkgWKkQWL9/IFjpsFlZkFmpQFnI4FnIgFmoIFlX0FjnsFi/vrBak6Bb10BeeLBcinBQ75SPfB9xcV92j4JgWWmAWakwWcjQWchwWZgQWUfQWNegWHewX7kfxyBYiHBYiGBYiJBYqJBYaIBYaIBYiKBYiKBYaKBYWKBYiLBYiLBYWMBYaMBYiMBYiMBYaOBYaOBYqNBYiNBYiQBYiPBfuQ+HIFhpsFjZwFlJkFmZUFnI8FnIkFmoMFln4FDvlI+Fj3TRX29+kFk5oFmZUFm5AFnYoFmoMFl34FkHsFiXsF+yr8cgWIhwWKhwWIiAWKhwWHiQWIhwWHiQWIiQWGiQWHiQWHiwWHigWHiwWGiwWHjAWHiwWHjQWGjQWIjQWHjQWIjwWIjQWJjwWIjgWKjwWIjwUg9+kFIPvpBYiHBYqHBYiIBYmHBYiJBYiHBYeJBYiJBYaJBYeJBYeLBYeKBYeLBYaLBYeMBYeLBYeNBYaNBYiNBYeNBYiPBYiNBYmPBYiOBYqPBYiPBfsq+HIFiZsFkJsFl5gFmpMFnYwFm4YFmYEFk3wF9wD76QX29+kFjY8FjI8Fjo4FjY8Fj44Fjo4Fjo0Fj40Fj40Fj40Fj4sFj4wFkIsFkIsFj4oFj4sFj4kFkIkFjokFjokFjogFj4gFjYcFjogFjIcFjYcFDvlI+AL3pxX3evtlBZV+BY97BYh7BYF9BX2BBXqIBXmOBX2UBft992YF+337ZgV9ggV5iAV6jgV9lQWBmQWImwWPmwWVmAX3evdlBft692UFgZgFh5sFjpwFlZgFmZUFnI4FnYgFmYMF9337ZwX3ffdnBZmTBZ2OBZyIBZmBBZV+BY56BYd7BYF+BQ75SOj7TxWDigWLiwWLiwVjiwV6jgV8lAWBmQWImwWOmwWVmQWalAWcjgWqiwXLpQXOwQXJ7gX7dfg4BYebBY2bBZSaBZiVBZyPBZ2JBZqDBZZ+BfdX/AEF91n4AQWWmAWakwWdjQWbhwWZgQWUfAWNewWGewX7gfxMBYuKBYqJBT37EQWGhQWGhgU9TAWEiAWGhwU8bAWLiwWLiwUO+Uj3UtkV98+LBZ2IBZmCBZV9BY57BYh7BYF9BX2CBXmIBfwsiwWEjAWFiwWJjQWIiwWGjgWGjgWJjQWJjAWHkAWHkAWKjQWKjQWKkQWJkAWLjgWLjQWMkQWLkQWNjQWLjQWPkAWOkQX38vguBfvPiwV5jgV9lAWBmQWImwWOmwWVmQWZlAWdjgX4LIsFkooFkYsFjYoFjooFkIgFkYgFjIkFjYoFj4YFj4YFjIkFjIkFjIUFjYYFi4gFi4kFioUFi4UFiYkFi4kFh4YFiIYFDgAAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAA==";var AAn={};IX(AAn,{CIRCUIT_TO_SVG_VERSION:()=>Pk,circuitJsonToPcbSvg:()=>rQr,circuitJsonToSchematicSvg:()=>Xkr,colorMap:()=>Hu,convertCircuitJsonToAssemblySvg:()=>AQr,convertCircuitJsonToPcbSimulationSvg:()=>sQr,convertCircuitJsonToPcbSvg:()=>wnt,convertCircuitJsonToPinoutSvg:()=>FQr,convertCircuitJsonToSchematicSimulationSvg:()=>qLr,convertCircuitJsonToSchematicSvg:()=>tde,convertCircuitJsonToSimulationGraphSvg:()=>_An,convertCircuitJsonToSolderPasteMask:()=>eHr,convertCircuitJsonToStackedSchematicSheetsSvg:()=>Zkr,createErrorTextOverlay:()=>MJ,createSvgObjectsForSchComponentPortHovers:()=>Ggn,getSoftwareUsedString:()=>Sk,isSimulationAnalysisResult:()=>Nnt,isSimulationCurrentProbe:()=>pAn,isSimulationExperiment:()=>Rnt,isSimulationOscilloscopeTrace:()=>mAn,isSimulationTransientCurrentGraph:()=>kLr,isSimulationTransientVoltageGraph:()=>LLr,isSimulationVoltageProbe:()=>uAn});function zIe(e,t){return e.flatMap((n)=>{if(n.children.length){let r=zIe(n.children,t);return r.length?[{...n,children:r}]:[]}return n.attributes["data-pcb-layer"]==="drill"===t?[n]:[]})}function tgn(e){let t={...e.attributes};for(let n of["opacity","fill-opacity","stroke-opacity"])if(n in t)t[n]="1";return{...e,attributes:t,children:e.children.map(tgn)}}function pnt(e){return{...e,attributes:{...e.attributes,...e.attributes.fill&&e.attributes.fill!=="none"?{fill:"black"}:{},...e.attributes.stroke&&e.attributes.stroke!=="none"?{stroke:"black"}:{}},children:e.children.map(pnt)}}function SDr({circuitJson:e,ctx:t,selectedIds:n,hiddenOpacity:o,width:r,height:i,create:s}){let a=new Set(n),c=(f)=>f[`${f.type}_id`],l=new Set(["top","bottom"]);for(let f of e){if(f.type==="pcb_board")for(let y=1;y<=(f.num_layers??2)-2;y++)l.add(`inner${y}`);if("layer"in f&&typeof f.layer==="string"&&/^(top|bottom|inner\d+)$/.test(f.layer))l.add(f.layer);if("layers"in f&&Array.isArray(f.layers)){for(let y of f.layers)if(/^(top|bottom|inner\d+)$/.test(y))l.add(y)}if(f.type==="pcb_trace"){for(let y of f.route)if(y.route_type==="wire")l.add(y.layer)}}let h=t.layer??"top",d=(f)=>f===h?100:f==="bottom"?0:f==="top"?50:40-Number(f.slice(5)),u=[...l].sort((f,y)=>d(f)-d(y)),_={...t,showSolderMask:!1,showSolderPaste:!1,showPinNumbers:!1,showAnchorOffsets:!1,circuitJson:e.filter((f)=>f.type!=="pcb_copper_pour")},p=[],m=[],A=[],g=[];for(let f of u){let y={..._,layer:f,colorMap:{...t.colorMap,copper:{...t.colorMap.copper,top:t.colorMap.copper[f]}}},x=[],C=[],b=[];for(let P of e){if(P.type==="pcb_hole"||P.type==="pcb_cutout"){b.push(...s(P,y).map(pnt));continue}if(!vDr.has(P.type))continue;if("layer"in P&&P.layer!==f)continue;if((P.type==="pcb_via"||P.type==="pcb_plated_hole")&&!P.layers.includes(f))continue;let M=P.type==="pcb_plated_hole"?{...P,layers:[f]}:P,B=M.type==="pcb_trace"?{...M,route:M.route.map((D)=>{let{is_inside_copper_pour:L,copper_pour_id:H,...V}=D;return V})}:M,T=s(B,y).map(tgn),N=zIe(T,!0);if(b.push(...N.map(pnt)),x.push(...zIe(T,!1)),a.has(c(P))){if(C.push(...zIe(T,!1)),f===u.filter((D)=>!("layers"in P)||!Array.isArray(P.layers)||P.layers.includes(D)).at(-1))A.push(...N)}}let I=`xray-holes-${f}`;g.push({name:"mask",type:"element",value:"",attributes:{id:I,maskUnits:"userSpaceOnUse",x:"0",y:"0",width:String(r),height:String(i)},children:[{name:"rect",type:"element",value:"",children:[],attributes:{x:"0",y:"0",width:String(r),height:String(i),fill:"white"}},...b]});let v={"data-pcb-layer":f,mask:`url(#${I})`};p.push(Hhe({...v,opacity:String(o)},x)),m.push(Hhe(v,C))}return[{name:"defs",type:"element",value:"",attributes:{},children:g},Hhe({"data-x-ray":"background"},p),Hhe({"data-x-ray":"selected"},m),Hhe({"data-x-ray":"drills"},A)]}function PDr(e,t){let{startIsInsideCopperPour:n,endIsInsideCopperPour:o,start:r,end:i}=e;if(n===o)return e;let s=EY(r),a=EY(i),c=MDr(t).flatMap((_)=>BDr(_,s,a));if(c.length===0)return e;let l=o?Math.min(...c):Math.max(...c),h=ogn(s,a,l),d=EDr(e.startWidth,e.endWidth,l),u={...e,start:n?h:r,end:o?h:i,startWidth:n?d:e.startWidth,endWidth:o?d:e.endWidth};return DDr(u.start,u.end)?null:u}function EDr(e,t,n){return e+(t-e)*n}function MDr(e){switch(e.shape){case"rect":return[wDr(e)];case"polygon":return[e.points.map(EY)];case"brep":return[e.brep_shape.outer_ring.vertices.map(i_n),...e.brep_shape.inner_rings.map((t)=>t.vertices.map(i_n))]}}function wDr(e){let t=EY(e.center),n=e.width/2,o=e.height/2,r=(e.rotation??0)*Math.PI/180,i=Math.cos(r),s=Math.sin(r);return[{x:-n,y:-o},{x:n,y:-o},{x:n,y:o},{x:-n,y:o}].map((a)=>({x:t.x+a.x*i-a.y*s,y:t.y+a.x*s+a.y*i}))}function BDr(e,t,n){let o=[];for(let r=0;r<e.length;r++){let i=e[r],s=e[(r+1)%e.length];if(!i||!s)continue;if(i.bulge){o.push(...TDr(t,n,i,s,i.bulge));continue}let a=ngn(t,n,i,s);if(a!==null)o.push(a)}return o}function TDr(e,t,n,o,r){let i=o.x-n.x,s=o.y-n.y,a=Math.hypot(i,s);if(a<D5||Math.abs(r)<D5){let x=ngn(e,t,n,o);return x===null?[]:[x]}let c=a*(1-r**2)/(4*r),l={x:(n.x+o.x)/2-s/a*c,y:(n.y+o.y)/2+i/a*c},h=Math.atan2(n.y-l.y,n.x-l.x),d=4*Math.atan(r),u=Math.hypot(n.x-l.x,n.y-l.y),_={x:t.x-e.x,y:t.y-e.y},p={x:e.x-l.x,y:e.y-l.y},m=jtt(_,_);if(m<D5)return[];let A=2*jtt(p,_),g=jtt(p,p)-u**2,f=A**2-4*m*g;if(f<-D5)return[];let y=Math.sqrt(Math.max(0,f));return[(-A-y)/(2*m),(-A+y)/(2*m)].filter((x)=>{if(x<-D5||x>1+D5)return!1;let C=ogn(e,t,x),b=Math.atan2(C.y-l.y,C.x-l.x);return(d>0?r_n(b-h):r_n(h-b))<=Math.abs(d)+D5})}function ngn(e,t,n,o){let r={x:t.x-e.x,y:t.y-e.y},i={x:o.x-n.x,y:o.y-n.y},s=Xtt(r,i);if(Math.abs(s)<D5)return null;let a={x:n.x-e.x,y:n.y-e.y},c=Xtt(a,i)/s,l=Xtt(a,r)/s;if(c<-D5||c>1+D5||l<-D5||l>1+D5)return null;return Math.min(1,Math.max(0,c))}function Xtt(e,t){return e.x*t.y-e.y*t.x}function jtt(e,t){return e.x*t.x+e.y*t.y}function r_n(e){let t=2*Math.PI,n=e%t;return n<0?n+t:n}function ogn(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function EY(e){return{x:Ke.parse(e.x),y:Ke.parse(e.y)}}function i_n(e){return{...EY(e),bulge:e.bulge}}function DDr(e,t){let n=EY(e),o=EY(t);return Math.abs(n.x-o.x)<D5&&Math.abs(n.y-o.y)<D5}function Int(e){if(!e||typeof e!=="object")return!1;return"route_type"in e&&e.route_type==="wire"&&(("start_width"in e)||("end_width"in e)||("width_interpolation_mode"in e))}function rgn(e){let t=[];for(let n=0;n<e.length-1;n++){let o=e[n];if(!Int(o))continue;let r=e[n+1];if(!r)continue;let i=r.route_type==="through_pad"?r.start:{x:r.x,y:r.y},s=r.route_type==="via"?r.from_layer:r.route_type==="through_pad"?r.start_layer:r.layer;if(!i||s!==o.layer||o.width!==o.start_width)continue;let a={start:{x:o.x,y:o.y},end:i,start_width:o.start_width,end_width:o.end_width,width_interpolation_mode:o.width_interpolation_mode,layer:o.layer,is_inside_copper_pour:Boolean(o.is_inside_copper_pour&&r.is_inside_copper_pour)};if(sgn(a))t.push(a)}return t}function ign(e){let{start:t,end:n,start_width:o,end_width:r}=e,i=n.x-t.x,s=n.y-t.y,a=Math.hypot(i,s);if(!sgn(e))return[];let c=Math.abs(r-o),l=e.width_interpolation_mode==="linear"?1:Math.max(1,Math.ceil(Math.sqrt(c/(0.001+c*0.000001)*0.375))),h=-s/a,d=i/a,u=[],_=[];for(let p=0;p<=l;p++){let m=p/l,A=o<=r?m:1-m,f=(e.width_interpolation_mode==="quadratic"?Math.min(o,r)+c*A*A:o+(r-o)*m)/2,y=t.x+i*m,x=t.y+s*m;u.push({x:y+h*f,y:x+d*f}),_.push({x:y-h*f,y:x-d*f})}return[...u,..._.reverse()]}function sgn(e){let{start:t,end:n,start_width:o,end_width:r}=e,i=Math.hypot(n.x-t.x,n.y-t.y);if(![t.x,t.y,n.x,n.y,i,o,r].every(Number.isFinite)||i<=0||o<=0||r<=0)return!1;if(e.width_interpolation_mode!=="linear"&&e.width_interpolation_mode!=="quadratic")return!1;return!0}function NDr(e){switch(e.route_type){case"through_pad":return[e.start,e.end];default:return[e]}}function RDr(e){let t=[];for(let n=0;n<e.length-1;n++){let o=e[n],r=e[n+1];if(!o||!r)continue;if(Int(o))continue;let i=o.route_type==="through_pad"?o.end:o,s=r.route_type==="through_pad"?r.start:r,a=o.route_type==="wire"?o.layer:o.route_type==="through_pad"?o.end_layer:r.route_type==="wire"?r.layer:r.route_type==="through_pad"?r.start_layer:null;if(!a)continue;if(QDr(i,s))continue;let c=s_n(o),l=s_n(r),h=Ktt(o)??Ktt(r)??0,d=Ktt(r)??h;t.push({start:i,end:s,layer:a,width:h,startWidth:h,endWidth:d,isInsideCopperPour:c&&l,startIsInsideCopperPour:c,endIsInsideCopperPour:l,copperPourId:c?a_n(o):l?a_n(r):void 0})}for(let n of e){if(!n||n.route_type!=="through_pad")continue;for(let o of new Set([n.start_layer,n.end_layer]))t.push({start:n.start,end:n.end,layer:o,width:n.width,startWidth:n.width,endWidth:n.width,isInsideCopperPour:!1,startIsInsideCopperPour:!1,endIsInsideCopperPour:!1})}return t}function Ktt(e){return"width"in e?Ke.parse(e.width):void 0}function s_n(e){return"is_inside_copper_pour"in e&&e.is_inside_copper_pour===!0}function a_n(e){if(!("copper_pour_id"in e))return;return e.copper_pour_id}function QDr(e,t){let n=Ke.parse(e.x),o=Ke.parse(e.y),r=Ke.parse(t.x),i=Ke.parse(t.y);return n===r&&o===i}function kDr(e){let t=[],n=[];for(let o=0;o<e.length;o++){let r=e[o];if(!r)continue;let i=LDr(e,o),s=vnt(-i.y,i.x),a=r.width/2;t.push({x:r.x+s.x*a,y:r.y+s.y*a}),n.push({x:r.x-s.x*a,y:r.y-s.y*a})}return t.concat(n.reverse())}function LDr(e,t){if(e.length<2)return{x:1,y:0};if(t<=0)return PIe(e[0],e[1]);if(t>=e.length-1)return PIe(e[e.length-2],e[e.length-1]);let n=PIe(e[t-1],e[t]),o=PIe(e[t],e[t+1]),r=vnt(n.x+o.x,n.y+o.y);if(r.x!==0||r.y!==0)return r;if(n.x!==0||n.y!==0)return n;if(o.x!==0||o.y!==0)return o;return{x:1,y:0}}function PIe(e,t){if(!e||!t)return{x:1,y:0};let n=vnt(t.x-e.x,t.y-e.y);return n.x===0&&n.y===0?{x:1,y:0}:n}function vnt(e,t){let n=Math.hypot(e,t);if(n<=Number.EPSILON)return{x:0,y:0};return{x:e/n,y:t/n}}function hx(e,t=tp){return t.copper[e]??"white"}function SY(e){return HDr[e]??"rgb(105, 105, 105)"}function mnt({elementType:e,shapeAttributes:t,layer:n,fillColor:o,fillOpacity:r,className:i,additionalAttributes:s}){let a={class:i,fill:o,"fill-opacity":r,"data-type":"pcb_soldermask","data-pcb-layer":n,...t,...s};return{name:e,type:"element",value:"",children:[],attributes:a}}function Snt(e,t){let{transform:n,colorMap:o}=t,r=t.layer??"top",i=t.showSolderMask&&(r==="top"||r==="bottom");if(i&&!e.layers.includes(r))return[];let s=t.boardOwnerMap?.has(e.pcb_via_id)?e.pcb_via_id:e.pcb_trace_id??e.pcb_via_id,a=t.boardOwnerMap?.get(s),c=e,l=(r==="top"?c.tented_on_top:c.tented_on_bottom)??c.is_tented??(r==="top"?a?.default_via_tented_on_top:a?.default_via_tented_on_bottom),[h,d]=Pt(n,[e.x,e.y]),u=e.outer_diameter*Math.abs(n.a),_=e.outer_diameter*Math.abs(n.a),p=e.hole_diameter*Math.abs(n.a),m=e.hole_diameter*Math.abs(n.a),A=Math.min(u,_)/2,g=Math.min(p,m)/2,f={name:"g",type:"element",value:"",attributes:{"data-type":"pcb_via","data-pcb-layer":i&&l?r:"through"},children:[{name:"circle",type:"element",value:"",children:[],attributes:{class:"pcb-hole-outer",fill:o.copper[i?r:"top"],cx:h.toString(),cy:d.toString(),r:A.toString(),"data-type":"pcb_via","data-pcb-layer":i?r:"top"}},{name:"circle",type:"element",value:"",children:[],attributes:{class:"pcb-hole-inner",fill:o.drill,cx:h.toString(),cy:d.toString(),r:g.toString(),"data-type":"pcb_via","data-pcb-layer":"drill"}}]};if(i&&l){let y=o.soldermaskWithCopperUnderneath[r],x,C=1;try{let I=Lhe(y);C=I.alpha(),y=I.alpha(1).rgb().string(),x=Lhe.rgb(I.red()/2,I.green()/2,I.blue()/2).string()}catch{}let b={name:"g",type:"element",value:"",attributes:{class:"pcb-via-tenting","data-type":"pcb_soldermask","data-pcb-layer":r,opacity:C.toString()},children:[mnt({elementType:"circle",shapeAttributes:{cx:h.toString(),cy:d.toString(),r:A.toString()},layer:r,fillColor:y,fillOpacity:"1",className:"pcb-via-tenting-ring"})]};if(x!==void 0)b.children.push(mnt({elementType:"circle",shapeAttributes:{cx:h.toString(),cy:d.toString(),r:g.toString()},layer:r,fillColor:x,fillOpacity:"1",className:"pcb-via-tenting-hole"}));f.children.push(b)}return[f]}function EJ(e,t){if(e.length===0)return"";let n=e.map((r)=>{let[i,s]=Pt(t,[r.x,r.y]);return{...r,x:i,y:s}}),o=`M ${n[0].x} ${n[0].y}`;for(let r=0;r<n.length;r++){let i=n[r],s=n[(r+1)%n.length];if(i.bulge){if(Math.hypot(s.x-i.x,s.y-i.y)<0.000000001)continue;let a=i.bulge,c=s.x-i.x,l=s.y-i.y,h=Math.hypot(c,l),d=Math.abs(h/4/a*(a*a+1)),u=a<0?1:0,_=Math.abs(a)>1?1:0;o+=` A ${d} ${d} 0 ${_} ${u} ${s.x} ${s.y}`}else o+=` L ${s.x} ${s.y}`}return o+=" Z",o}function agn(e,t){if(e.shape==="rect"){let[n,o]=Pt(t,[e.center.x,e.center.y]),r=e.width*Math.abs(t.a),i=e.height*Math.abs(t.d),s=-(e.rotation??0);return{elementType:"rect",shapeAttributes:{x:(-r/2).toString(),y:(-i/2).toString(),width:r.toString(),height:i.toString(),transform:p2(Ts(Rc(n,o),qg(s*Math.PI/180)))}}}if(e.shape==="polygon"){if(!e.points||e.points.length===0)return null;return{elementType:"polygon",shapeAttributes:{points:e.points.map((o)=>Pt(t,[o.x,o.y])).map((o)=>`${o[0]},${o[1]}`).join(" ")}}}if(e.shape==="brep"){let{brep_shape:n}=e,o=EJ(n.outer_ring.vertices,t);for(let r of n.inner_rings??[])o+=` ${EJ(r.vertices,t)}`;return{elementType:"path",shapeAttributes:{d:o,"fill-rule":"evenodd"}}}return null}function cgn(e){return`copper-pour-trace-mask-${e}`.replace(/[^a-zA-Z0-9_-]/g,"_")}function FDr({layer:e,circuitJson:t}){for(let n of t){if(n.type!=="pcb_copper_pour")continue;if(n.layer!==e)continue;return cgn(e)}return}function zDr({circuitJson:e,transform:t,svgWidth:n,svgHeight:o,usedMaskIds:r}){if(r.size===0)return null;let i=new Map;for(let a of e){if(a.type!=="pcb_copper_pour")continue;let c=a,l=cgn(c.layer);if(!r.has(l))continue;let h=i.get(l);if(h)h.push(c);else i.set(l,[c])}if(i.size===0)return null;let s=[];for(let[a,c]of i){let l=[{name:"rect",type:"element",value:"",children:[],attributes:{x:"0",y:"0",width:n.toString(),height:o.toString(),fill:"#fff"}}];for(let h of c){let d=agn(h,t);if(!d)continue;l.push({name:d.elementType,type:"element",value:"",children:[],attributes:{...d.shapeAttributes,fill:"#000"}})}s.push({name:"mask",type:"element",value:"",children:l,attributes:{id:a,maskUnits:"userSpaceOnUse",x:"0",y:"0",width:n.toString(),height:o.toString()}})}return{name:"defs",type:"element",value:"",children:s,attributes:{class:"copper-pour-trace-mask-defs"}}}function lgn(e){let t=[],n=new Map;for(let o of e){let r=o.attributes?.["data-type"],i=o.attributes?.mask;if(!(r==="pcb_trace"||r==="pcb_trace_soldermask")||!i?.includes("#copper-pour-trace-mask-")){t.push(o);continue}let a=n.get(i);if(!a){let p={name:"g",type:"element",value:"",children:[],attributes:{class:"pcb-trace-mask-group",mask:i}};a={object:p,pathsByAttributes:new Map},n.set(i,a),t.push(p)}let{mask:c,d:l="",...h}=o.attributes,d=JSON.stringify(h),u=a.pathsByAttributes.get(d);if(u){u.attributes.d+=` ${l}`;continue}let _={...o,attributes:{...h,d:l}};a.pathsByAttributes.set(d,_),a.object.children.push(_)}return t}function hgn(e,t){let{transform:n,layer:o,colorMap:r,showSolderMask:i}=t;if(!e.route||!Array.isArray(e.route)||e.route.length===0)return[];let s=[],a=t.copperPourTraceMaskIdsByLayer??=new Map,c=[];for(let h of RDr(e.route)){let d=h;if(d.isInsideCopperPour)continue;if(d.copperPourId&&d.startIsInsideCopperPour!==d.endIsInsideCopperPour){let _=t.circuitJson?.find((p)=>p.type==="pcb_copper_pour"&&p.pcb_copper_pour_id===d.copperPourId);if(_){let p=PDr(d,_);if(!p)continue;d=p}}let u=d.layer;if(!u)continue;if(o&&u!==o)continue;c.push(d)}let l=(h)=>{if(!a.has(h))a.set(h,t.circuitJson?FDr({layer:h,circuitJson:t.circuitJson}):void 0);let d=a.get(h);if(d)return t.usedCopperPourTraceMaskIds?.add(d),{mask:`url(#${d})`};return{}};for(let h of rgn(e.route)){if(o&&h.layer!==o)continue;if(h.is_inside_copper_pour)continue;let d=ign(h).map((_)=>Pt(n,_));if(!d.length)continue;let u=i?r.soldermaskWithCopperUnderneath[h.layer]:hx(h.layer,r);s.push({name:"path",type:"element",value:"",children:[],attributes:{class:i?"pcb-soldermask":"pcb-trace",fill:u,stroke:"none",d:d.map((_,p)=>`${p===0?"M":"L"} ${_.x} ${_.y}`).join(" ")+" Z","data-type":i?"pcb_trace_soldermask":"pcb_trace","data-route-type":"wire","data-wire-taper":"true","data-width-interpolation-mode":h.width_interpolation_mode,"data-pcb-layer":h.layer,...l(h.layer)}})}if(e.route_thickness_mode==="interpolated")for(let h of ODr(c)){let d=h[0]?.layer;if(!d)continue;let u=VDr(h,n);if(!u)continue;let _=hx(d,r),p=r.soldermaskWithCopperUnderneath[d];s.push({name:"path",type:"element",value:"",children:[],attributes:{class:i?"pcb-soldermask":"pcb-trace",fill:i?p:_,stroke:"none",d:u,"shape-rendering":"geometricPrecision","data-type":i?"pcb_trace_soldermask":"pcb_trace","data-pcb-layer":d,...l(d)}})}else for(let h of c){let d=Pt(n,[h.start.x,h.start.y]),u=Pt(n,[h.end.x,h.end.y]),_=h.layer,p=hx(_,r),m=r.soldermaskWithCopperUnderneath[_],A=h.width?(h.width*Math.abs(n.a)).toString():"0.3",g=l(_);if(i){let f={name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-soldermask",stroke:m,fill:"none",d:`M ${d[0]} ${d[1]} L ${u[0]} ${u[1]}`,"stroke-width":A,"stroke-linecap":"round","stroke-linejoin":"round","shape-rendering":"crispEdges","data-type":"pcb_trace_soldermask","data-pcb-layer":_,...g}};s.push(f)}else{let f={name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-trace",stroke:p,fill:"none",d:`M ${d[0]} ${d[1]} L ${u[0]} ${u[1]}`,"stroke-width":A,"stroke-linecap":"round","stroke-linejoin":"round","shape-rendering":"crispEdges","data-type":"pcb_trace","data-pcb-layer":_,...g}};s.push(f)}}for(let[h,d]of e.route.entries()){if(!d||d.route_type!=="via")continue;if(XDr(t).has(dgn(d)))continue;s.push(...Snt(GDr(e,d,h,t),t))}return s}function ODr(e){let t=[];for(let n of e){let o=t[t.length-1],r=o?.[o.length-1];if(o&&r?.layer===n.layer&&YDr(r.end,n.start))o.push(n);else t.push([n])}return t}function VDr(e,t){let n=e[0];if(!n)return"";let o=[{x:Ke.parse(n.start.x),y:Ke.parse(n.start.y),width:n.startWidth},...e.map((c)=>({x:Ke.parse(c.end.x),y:Ke.parse(c.end.y),width:c.endWidth}))],i=kDr(o).map((c)=>Pt(t,[c.x,c.y])),[s,...a]=i;if(!s)return"";return[`M ${s[0]} ${s[1]}`,...a.map((c)=>`L ${c[0]} ${c[1]}`),"Z"].join(" ")}function YDr(e,t){return Ke.parse(e.x)===Ke.parse(t.x)&&Ke.parse(e.y)===Ke.parse(t.y)}function GDr(e,t,n,o){let r=UDr(e.route,n),i=o.boardOwnerMap?.get(e.pcb_trace_id),{holeDiameter:s,outerDiameter:a}=WDr(i,r);return{type:"pcb_via",pcb_via_id:`${e.pcb_trace_id}_route_via_${n}`,pcb_trace_id:e.pcb_trace_id,subcircuit_id:e.subcircuit_id,pcb_group_id:e.pcb_group_id,x:t.x,y:t.y,outer_diameter:a,hole_diameter:s,layers:[t.from_layer,t.to_layer],tented_on_top:t.tented_on_top,tented_on_bottom:t.tented_on_bottom}}function UDr(e,t){let n=c_n(e,t,-1),o=c_n(e,t,1);return Math.max(n??0,o??0)}function c_n(e,t,n){for(let o=t+n;o>=0&&o<e.length;o+=n){let r=e[o];if(Int(r))return n===-1?r.end_width:r.start_width;if(!r||!("width"in r)||typeof r.width!=="number")continue;return r.width}return}function WDr(e,t){let n=OIe(e?.min_via_hole_diameter),o=OIe(e?.min_via_pad_diameter),r=Math.max(t,0.3),i=Math.max(r*2,0.6);return{holeDiameter:n??r,outerDiameter:o??i}}function XDr(e){return e.standaloneViaPositionKeys??=new Set(e.circuitJson?.filter((t)=>t.type==="pcb_via").map((t)=>dgn(t))??[])}function dgn(e){let t=OIe(e.x),n=OIe(e.y);if(t!==void 0&&n!==void 0)return`${t}:${n}`;return`${String(e.x)}:${String(e.y)}`}function OIe(e){if(e===null||e===void 0)return;let t=Ke.safeParse(e);return t.success?t.data:void 0}function ugn(e,t){if(!t)return{};let n=pgn(e,t);if(!n)return{};let o=t.find((a)=>a.type==="source_port"&&a.source_port_id===n),r=t.find((a)=>a.type==="source_component"&&a.source_component_id===o?.source_component_id),i={};if(r?.name&&o?.name)i["data-pad-name"]=`${r.name}.${o.name}`;let s=KDr(n,t);if(s)i["data-pad-net-name"]=s;return i}function jDr(e,t){if(t){let r=pgn(e,t),i=t.find((s)=>s.type==="source_port"&&s.source_port_id===r);if(i?.type==="source_port"&&i.pin_number!=null)return i.pin_number.toString()}let n=e.port_hints?.find((r)=>r.trim().length>0);if(!n)return;return n.match(/^pin(\d+)$/i)?.[1]??n}function pgn(e,t){if(e.source_port_id)return e.source_port_id;if(e.pcb_port_id){let r=t.find((i)=>i.type==="pcb_port"&&i.pcb_port_id===e.pcb_port_id);if(r?.source_port_id)return r.source_port_id}let n=e.pcb_smtpad_id??e.pcb_plated_hole_id;if(!n)return;return t.find((r)=>{if(r.type!=="pcb_port")return!1;let i=r;return i.pcb_smtpad_id===n||i.pcb_plated_hole_id===n})?.source_port_id}function KDr(e,t){let o=t.find((i)=>{if(i.type!=="source_trace")return!1;return i.connected_source_port_ids?.includes(e)})?.connected_source_net_ids?.[0];if(!o)return;return t.find((i)=>i.type==="source_net"&&i.source_net_id===o)?.name}function mgn(e,t){let{transform:n,layer:o,colorMap:r,showSolderMask:i}=t;if(o&&e.layer!==o)return[];let s=ugn(e,t.circuitJson),a=Boolean(e?.is_covered_with_solder_mask),c=i&&a,l=r.soldermaskWithCopperUnderneath[e.layer]??r.soldermaskWithCopperUnderneath.top,h=(e.soldermask_margin??0)*Math.abs(n.a);if(e.shape==="rect"||e.shape==="rotated_rect"){let d=e.width*Math.abs(n.a),u=e.height*Math.abs(n.d),[_,p]=Pt(n,[e.x,e.y]),A=(e.corner_radius??e.rect_border_radius??0)*Math.abs(n.a),g={left:(e.soldermask_margin_left??e.soldermask_margin??0)*Math.abs(n.a),right:(e.soldermask_margin_right??e.soldermask_margin??0)*Math.abs(n.a),top:(e.soldermask_margin_top??e.soldermask_margin??0)*Math.abs(n.a),bottom:(e.soldermask_margin_bottom??e.soldermask_margin??0)*Math.abs(n.a)},f=g.left<0||g.right<0||g.top<0||g.bottom<0,y=g.left===0&&g.right===0&&g.top===0&&g.bottom===0;if(e.shape==="rotated_rect"&&e.ccw_rotation){let P={name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-pad",fill:hx(e.layer,r),x:(-d/2).toString(),y:(-u/2).toString(),width:d.toString(),height:u.toString(),transform:`translate(${_} ${p}) rotate(${-e.ccw_rotation})`,"data-type":"pcb_smtpad","data-pcb-layer":e.layer,...s,...A?{rx:A.toString(),ry:A.toString()}:{}}};if(!c)return[P];let M=d+g.left+g.right,B=u+g.top+g.bottom,T=A?A+h:0;if(f){let D={name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-pad-covered",fill:l,x:(-d/2).toString(),y:(-u/2).toString(),width:d.toString(),height:u.toString(),transform:`translate(${_} ${p}) rotate(${-e.ccw_rotation})`,"data-type":"pcb_smtpad","data-pcb-layer":e.layer,...A?{rx:A.toString(),ry:A.toString()}:{}}},L={name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-pad-exposed",fill:hx(e.layer,r),x:(-d/2-g.left).toString(),y:(-u/2-g.top).toString(),width:M.toString(),height:B.toString(),transform:`translate(${_} ${p}) rotate(${-e.ccw_rotation})`,"data-type":"pcb_soldermask","data-pcb-layer":e.layer,...T>0?{rx:T.toString(),ry:T.toString()}:{}}};return[D,L]}if(y)return[{name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-pad-covered",fill:l,x:(-d/2).toString(),y:(-u/2).toString(),width:d.toString(),height:u.toString(),transform:`translate(${_} ${p}) rotate(${-e.ccw_rotation})`,"data-type":"pcb_smtpad","data-pcb-layer":e.layer,...A?{rx:A.toString(),ry:A.toString()}:{}}}];return[{name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-soldermask-cutout",fill:r.substrate,x:(-d/2-g.left).toString(),y:(-u/2-g.top).toString(),width:M.toString(),height:B.toString(),transform:`translate(${_} ${p}) rotate(${-e.ccw_rotation})`,...T>0?{rx:T.toString(),ry:T.toString()}:{},"data-type":"pcb_soldermask_opening","data-pcb-layer":e.layer}},P]}let x={name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-pad",fill:hx(e.layer,r),x:(_-d/2).toString(),y:(p-u/2).toString(),width:d.toString(),height:u.toString(),"data-type":"pcb_smtpad","data-pcb-layer":e.layer,...s,...A?{rx:A.toString(),ry:A.toString()}:{}}};if(!c)return[x];let C=d+g.left+g.right,b=u+g.top+g.bottom,I=A?A+h:0;if(f){let P={name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-pad-covered",fill:l,x:(_-d/2).toString(),y:(p-u/2).toString(),width:d.toString(),height:u.toString(),"data-type":"pcb_smtpad","data-pcb-layer":e.layer,...A?{rx:A.toString(),ry:A.toString()}:{}}},M={name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-pad-exposed",fill:hx(e.layer,r),x:(_-d/2-g.left).toString(),y:(p-u/2-g.top).toString(),width:C.toString(),height:b.toString(),"data-type":"pcb_soldermask","data-pcb-layer":e.layer,...I>0?{rx:I.toString(),ry:I.toString()}:{}}};return[P,M]}if(y)return[{name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-pad-covered",fill:l,x:(_-d/2).toString(),y:(p-u/2).toString(),width:d.toString(),height:u.toString(),...I>0?{rx:A.toString(),ry:A.toString()}:{},"data-type":"pcb_smtpad","data-pcb-layer":e.layer}}];return[{name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-soldermask-cutout",fill:r.substrate,x:(_-d/2-g.left).toString(),y:(p-u/2-g.top).toString(),width:C.toString(),height:b.toString(),...I>0?{rx:I.toString(),ry:I.toString()}:{},"data-type":"pcb_soldermask_opening","data-pcb-layer":e.layer}},x]}if(e.shape==="pill"||e.shape==="rotated_pill"){let d=e.shape==="rotated_pill",u=e.width*Math.abs(n.a),_=e.height*Math.abs(n.d),p=e.radius*Math.abs(n.a),[m,A]=Pt(n,[e.x,e.y]),g=d?{transform:`translate(${m} ${A}) rotate(${-(e.ccw_rotation??0)})`}:void 0,f={class:"pcb-pad",fill:hx(e.layer,r),x:d?(-u/2).toString():(m-u/2).toString(),y:d?(-_/2).toString():(A-_/2).toString(),width:u.toString(),height:_.toString(),rx:p.toString(),ry:p.toString(),"data-type":"pcb_smtpad","data-pcb-layer":e.layer,...s,...g??{}},y={name:"rect",type:"element",value:"",children:[],attributes:f};if(!c)return[y];let x=u+2*h,C=_+2*h,b=p+h;if(h<0){let P={name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-pad-covered",fill:l,x:d?(-u/2).toString():(m-u/2).toString(),y:d?(-_/2).toString():(A-_/2).toString(),width:u.toString(),height:_.toString(),rx:p.toString(),ry:p.toString(),"data-type":"pcb_smtpad","data-pcb-layer":e.layer,...g??{}}},M={class:"pcb-pad-exposed",fill:hx(e.layer,r),x:d?(-x/2).toString():(m-x/2).toString(),y:d?(-C/2).toString():(A-C/2).toString(),width:x.toString(),height:C.toString(),rx:b.toString(),ry:b.toString(),"data-type":"pcb_soldermask","data-pcb-layer":e.layer,...g??{}};return[P,{name:"rect",type:"element",value:"",children:[],attributes:M}]}if(h===0)return[{name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-pad-covered",fill:l,x:d?(-u/2).toString():(m-u/2).toString(),y:d?(-_/2).toString():(A-_/2).toString(),width:u.toString(),height:_.toString(),rx:p.toString(),ry:p.toString(),"data-type":"pcb_smtpad","data-pcb-layer":e.layer,...g??{}}}];let I={class:"pcb-soldermask-cutout",fill:r.substrate,x:d?(-x/2).toString():(m-x/2).toString(),y:d?(-C/2).toString():(A-C/2).toString(),width:x.toString(),height:C.toString(),rx:b.toString(),ry:b.toString(),"data-type":"pcb_soldermask_opening","data-pcb-layer":e.layer,...g??{}};return[{name:"rect",type:"element",value:"",children:[],attributes:I},y]}if(e.shape==="circle"){let d=e.radius*Math.abs(n.a),[u,_]=Pt(n,[e.x,e.y]),p={name:"circle",type:"element",value:"",children:[],attributes:{class:"pcb-pad",fill:hx(e.layer,r),cx:u.toString(),cy:_.toString(),r:d.toString(),"data-type":"pcb_smtpad","data-pcb-layer":e.layer,...s}};if(!c)return[p];let m=d+h;if(h<0){let g={name:"circle",type:"element",value:"",children:[],attributes:{class:"pcb-pad-covered",fill:l,cx:u.toString(),cy:_.toString(),r:d.toString(),"data-type":"pcb_smtpad","data-pcb-layer":e.layer}},f={name:"circle",type:"element",value:"",children:[],attributes:{class:"pcb-pad-exposed",fill:hx(e.layer,r),cx:u.toString(),cy:_.toString(),r:m.toString(),"data-type":"pcb_soldermask","data-pcb-layer":e.layer}};return[g,f]}if(h===0)return[{name:"circle",type:"element",value:"",children:[],attributes:{class:"pcb-pad-covered",fill:l,cx:u.toString(),cy:_.toString(),r:d.toString(),"data-type":"pcb_smtpad","data-pcb-layer":e.layer}}];return[{name:"circle",type:"element",value:"",children:[],attributes:{class:"pcb-soldermask-cutout",fill:r.substrate,cx:u.toString(),cy:_.toString(),r:m.toString(),"data-type":"pcb_soldermask_opening","data-pcb-layer":e.layer}},p]}if(e.shape==="polygon"){let d=(e.points??[]).map((m)=>Pt(n,[m.x,m.y])),u={name:"polygon",type:"element",value:"",children:[],attributes:{class:"pcb-pad",fill:hx(e.layer,r),points:d.map((m)=>m.join(",")).join(" "),"data-type":"pcb_smtpad","data-pcb-layer":e.layer,...s}};if(!c)return[u];let _=d;if(h!==0){let m=d.reduce((g,f)=>g+f[0],0)/d.length,A=d.reduce((g,f)=>g+f[1],0)/d.length;_=d.map(([g,f])=>{let y=g-m,x=f-A,C=Math.sqrt(y*y+x*x);if(C===0)return[g,f];let b=y/C,I=x/C;return[g+b*h,f+I*h]})}if(h<0){let m={name:"polygon",type:"element",value:"",children:[],attributes:{class:"pcb-pad-covered",fill:l,points:d.map((g)=>g.join(",")).join(" "),"data-type":"pcb_smtpad","data-pcb-layer":e.layer}},A={name:"polygon",type:"element",value:"",children:[],attributes:{class:"pcb-pad-exposed",fill:hx(e.layer,r),points:_.map((g)=>g.join(",")).join(" "),"data-type":"pcb_soldermask","data-pcb-layer":e.layer}};return[m,A]}if(h===0)return[{name:"polygon",type:"element",value:"",children:[],attributes:{class:"pcb-pad-covered",fill:l,points:d.map((A)=>A.join(",")).join(" "),"data-type":"pcb_smtpad","data-pcb-layer":e.layer}}];return[{name:"polygon",type:"element",value:"",children:[],attributes:{class:"pcb-soldermask-cutout",fill:r.substrate,points:_.map((m)=>m.join(",")).join(" "),"data-type":"pcb_soldermask_opening","data-pcb-layer":e.layer}},u]}return[]}function _gn(e,t){let n=e.filter((r)=>r.type==="simulation_pcb_return_current_result"&&r.simulation_pcb_return_current_result_id===t);if(n.length!==1)throw Error(`Expected one return-current result '${t}'`);let o=kfe.parse(n[0]);if(!e.some((r)=>r.type==="simulation_experiment"&&r.simulation_experiment_id===o.simulation_experiment_id&&r.experiment_type==="pcb_return_current"))throw Error(`Missing PCB return-current experiment '${o.simulation_experiment_id}'`);if(!e.some((r)=>r.type==="pcb_board"&&r.pcb_board_id===o.pcb_board_id))throw Error(`Missing PCB board '${o.pcb_board_id}'`);return o}function l_n(e,t){if(e.field_type==="real"){let s=e.sheet_current_x[t],a=e.sheet_current_y[t];return s==null||a==null?null:{x:s,y:a,magnitude:Math.hypot(s,a)}}let n=e.sheet_current_x_real[t],o=e.sheet_current_x_imag[t],r=e.sheet_current_y_real[t],i=e.sheet_current_y_imag[t];if(n==null||o==null||r==null||i==null)return null;return{x:n,y:r,magnitude:Math.hypot(n,o,r,i)}}function h_n(e){let t=Math.max(0,Math.min(1,e))*(EIe.length-1),n=Math.floor(t),o=EIe[n],r=EIe[Math.min(n+1,EIe.length-1)];return`rgb(${o.map((i,s)=>Math.round(i+(r[s]-i)*(t-n))).join(",")})`}function $Dr({circuitJson:e,resultId:t,ctx:n,options:o={},width:r,height:i}){let s=_gn(e,t),a=o.opacity??0.65;if(!Number.isFinite(a)||a<0||a>1)throw Error("Return-current opacity must be between 0 and 1");let c=o.densityRange;if(c&&(!Number.isFinite(c.min)||!Number.isFinite(c.max)||c.min<0||c.max<=c.min))throw Error("Return-current densityRange requires 0 <= min < max");let l=(C)=>("simulation_pcb_return_current_result_id"in C)&&C.simulation_pcb_return_current_result_id===t,h=e.filter((C)=>C.type==="simulation_pcb_return_current_heatmap"&&l(C)).map((C)=>Hfe.parse(C)).filter((C)=>!n.layer||C.layer===n.layer),d=e.filter((C)=>C.type==="simulation_pcb_return_current_field"&&l(C)).map((C)=>fj.parse(C)).filter((C)=>!n.layer||C.layer===n.layer);if(!d.length&&!h.length)throw Error(`No return-current field or heatmap for '${t}' on ${n.layer??"any layer"}`);let u=d.flatMap((C)=>{let b=o.fieldData?.[C.simulation_pcb_return_current_field_id];if(!b)return[];return[{field:C,grid:Mie(C).parse(b)}]});if(!h.length&&!u.length)throw Error("Return-current field assets need decoded fieldData; use convertCircuitJsonToPcbSimulationSvg to load assets");let _=0;for(let{field:C,grid:b}of u)for(let I=0;I<C.columns*C.rows;I++)_=Math.max(_,(l_n(b,I)?.magnitude??0)/C.copper_thickness);let p=c?.min??0,m=c?.max??(_||1),A=[],g=[];for(let C of h){if(c&&u.some(({field:M})=>M.layer===C.layer&&M.source_net_id===C.source_net_id))continue;let[b,I]=Pt(n.transform,[C.min_x,C.max_y]),[v,P]=Pt(n.transform,[C.max_x,C.min_y]);A.push(gv("image",{x:String(b),y:String(I),width:String(v-b),height:String(P-I),href:C.image_asset.url,preserveAspectRatio:"none",opacity:String(a),"data-type":C.type,"data-pcb-layer":C.layer,"data-source-net-id":C.source_net_id,"data-units":"A/mm²"}))}for(let{field:C,grid:b}of u){let I=!c&&h.some((v)=>v.layer===C.layer&&v.source_net_id===C.source_net_id);f(C,b,I)}function f(C,b,I){let v=Math.max(1,Math.ceil(Math.sqrt(C.columns*C.rows/500)));for(let P=0;P<C.rows;P++)for(let M=0;M<C.columns;M++){let B=P*C.columns+M,T=l_n(b,B);if(!T)continue;let N=T.magnitude/C.copper_thickness,D=C.min_x+M*C.cell_width,L=C.min_y+P*C.cell_height,[H,V]=Pt(n.transform,[D,L+C.cell_height]);if(!I)A.push(gv("rect",{x:String(H),y:String(V),width:String(C.cell_width*Math.abs(n.transform.a)),height:String(C.cell_height*Math.abs(n.transform.d)),fill:h_n((N-p)/(m-p)),opacity:String(a),"data-type":"simulation_pcb_return_current_cell","data-pcb-layer":C.layer,"data-grid-index":String(B),"data-current-density":String(N),"data-units":"A/mm²"}));if(!o.showVectors||P%v||M%v)continue;let O=Math.hypot(T.x,T.y);if(O===0)continue;let[U,j]=Pt(n.transform,[D+C.cell_width/2,L+C.cell_height/2]),Y=T.x/O*8,X=-T.y/O*8,K=U+Y,J=j+X;g.push(gv("path",{d:`M ${U-Y} ${j-X} L ${K} ${J} M ${K-Y*0.4-X*0.3} ${J-X*0.4+Y*0.3} L ${K} ${J} L ${K-Y*0.4+X*0.3} ${J-X*0.4-Y*0.3}`,fill:"none",stroke:"#fff","stroke-width":"1.2","data-type":"simulation_pcb_return_current_vector","data-pcb-layer":C.layer,"data-grid-index":String(B),"data-sheet-current-x":String(T.x),"data-sheet-current-y":String(T.y),"data-units":"A/mm","data-arrow-reference":"excitation-current-peak"}))}}let y=[];for(let C of s.simulation_return_current_excitation_ids){let b=e.find((v)=>v.type==="simulation_return_current_excitation"&&v.simulation_return_current_excitation_id===C);if(!b||b.type!=="simulation_return_current_excitation")throw Error(`Missing return-current excitation '${C}'`);if(b.simulation_experiment_id!==s.simulation_experiment_id)throw Error(`Excitation '${C}' belongs to a different experiment`);let I=e.find((v)=>v.type==="pcb_trace"&&v.pcb_trace_id===b.pcb_trace_id);if(!I||I.type!=="pcb_trace")throw Error(`Missing signal trace '${b.pcb_trace_id}'`);y.push(gv("g",{"data-type":"simulation_pcb_return_current_signal","data-pcb-trace-id":I.pcb_trace_id},hgn({...I,route:I.route.map((v)=>{let{is_inside_copper_pour:P,copper_pour_id:M,...B}=v;return B})},{...n,layer:void 0,showSolderMask:!1,circuitJson:e.filter((v)=>v.type!=="pcb_copper_pour"),colorMap:{...n.colorMap,copper:{...n.colorMap.copper,top:"#08d9ef",bottom:"#ff941f"}}})))}for(let C of e){if(C.type!=="simulation_pcb_return_current_marker"||!l(C))continue;let b=Ffe.parse(C),I=b.target_type==="pcb_port"?e.find((D)=>D.type==="pcb_port"&&D.pcb_port_id===b.pcb_port_id):e.find((D)=>D.type==="pcb_via"&&D.pcb_via_id===b.pcb_via_id);if(!I||I.type!=="pcb_port"&&I.type!=="pcb_via")throw Error(`Missing ${b.target_type} for return-current marker '${b.simulation_pcb_return_current_marker_id}'`);let[v,P]=Pt(n.transform,[Ke.parse(I.x),Ke.parse(I.y)]),M=b.role.startsWith("return_")?"#ed80e6":"#08d9ef",B=b.target_type==="pcb_port"?e.flatMap((D)=>D.type==="pcb_smtpad"&&D.pcb_port_id===b.pcb_port_id?mgn(D,{...n,layer:void 0,showSolderMask:!1,colorMap:{...n.colorMap,copper:{...n.colorMap.copper,[D.layer]:M}}}):[]):[],T=I.type==="pcb_via"?Snt(I,{...n,layer:void 0,showSolderMask:!1,colorMap:{...n.colorMap,drill:"#102b29",copper:{...n.colorMap.copper,top:M}}}):[],N=[...B,...T,gv("circle",{cx:String(v),cy:String(P),r:"8",stroke:M,"stroke-width":"3",fill:"none"})];if(b.label){let D=b.label_x!==void 0&&b.label_y!==void 0?Pt(n.transform,[b.label_x,b.label_y]):[v+13,P-13];N.push(gv("line",{x1:String(v),y1:String(P),x2:String(D[0]),y2:String(D[1]),stroke:M,"stroke-width":"1"})),N.push($tt(b.label,{x:String(D[0]),y:String(D[1]-4),fill:"white","font-size":"12","font-family":"sans-serif","paint-order":"stroke",stroke:"#122b29","stroke-width":"4"}))}y.push(gv("g",{"data-type":b.type,"data-role":b.role,"data-target-type":b.target_type,"data-target-id":b.target_type==="pcb_port"?b.pcb_port_id:b.pcb_via_id},N))}let x=[];if(o.showLegend!==!1){let b=`${s.frequency_hz===void 0?"frequency not specified":`${s.frequency_hz/1e6} MHz`} · ${n.layer??"all result layers"} · average density A/mm² · cyan: top signal · orange: bottom signal · magenta: return${o.showVectors?" · arrows: current at excitation peak":""}`;if(x.push(gv("rect",{x:"0",y:String(i-28),width:String(r),height:"28",fill:"#102b29",opacity:"0.95"})),x.push($tt(b,{x:"10",y:String(i-10),fill:"white","font-family":"sans-serif","font-size":"12"})),u.length&&(h.length===0||c)){for(let I=0;I<80;I++)x.push(gv("rect",{x:String(r-170+I*2),y:"12",width:"2",height:"10",fill:h_n(I/79)}));x.push($tt(`${p.toPrecision(3)} – ${m.toPrecision(3)} A/mm²`,{x:String(r-170),y:"36",fill:"white","font-family":"sans-serif","font-size":"12"}))}}return[gv("g",{"data-simulation-result-id":t},[...A,...g,...y,...x])]}function ggn(e){return e.map((t,n)=>({object:t,index:n,layerPriority:JDr(t.attributes?.["data-pcb-layer"]??void 0),typePriority:ZDr(t.attributes?.["data-type"]??void 0)})).sort((t,n)=>{if(t.layerPriority!==n.layerPriority)return t.layerPriority-n.layerPriority;if(t.typePriority!==n.typePriority)return t.typePriority-n.typePriority;return t.index-n.index}).map(({object:t})=>t)}function JDr(e){if(!e)return 500;let t=e.toLowerCase();if(t==="global")return-100;if(t==="bottom")return 4;if(t==="board")return 2;if(t==="soldermask-top"||t==="soldermask-bottom")return 3;if(t.startsWith("inner")){let n=t.match(/\d+/);return 5+(n?Number.parseInt(n[0],10):0)}if(t==="through")return 18;if(t==="top")return 17;if(t==="drill")return 30;if(t==="overlay")return 40;return 10}function ZDr(e){if(!e)return d_n;return qDr[e]??d_n}function tNr({circuitJson:e,ctx:t,create:n}){if(!t.showSolderMask)return[];let o=[];for(let r of["bottom","top"]){if(t.layer&&t.layer!==r)continue;let i=e.filter((h)=>h.type==="pcb_soldermask_opening"&&h.layer===r);if(i.length===0)continue;let s=i.map((h)=>nNr(h,t)),a=`pcb-soldermask-openings-${r}`,c={...t,layer:r,showSolderMask:!1},l=e.flatMap((h)=>eNr.has(h.type)?n(h,c):[]);o.push({name:"g",type:"element",value:"",attributes:{"data-type":"pcb_soldermask_opening_layer","data-pcb-layer":r},children:[{name:"defs",type:"element",value:"",attributes:{},children:[{name:"clipPath",type:"element",value:"",attributes:{id:a,clipPathUnits:"userSpaceOnUse"},children:s}]},...s.map((h,d)=>({...h,attributes:{...h.attributes,fill:t.colorMap.substrate,"data-type":"pcb_soldermask_opening","data-pcb-layer":r,"data-pcb-soldermask-opening-id":i[d].pcb_soldermask_opening_id}})),{name:"g",type:"element",value:"",attributes:{"clip-path":`url(#${a})`},children:lgn(ggn(l))}]})}return o}function nNr(e,t){let{transform:n}=t,o={type:"element",value:"",children:[]};if(e.shape==="polygon")return{...o,name:"polygon",attributes:{points:e.points.map((c)=>Pt(n,[c.x,c.y]).join(",")).join(" ")}};let[r,i]=Pt(n,[e.x,e.y]);if(e.shape==="circle")return{...o,name:"circle",attributes:{cx:String(r),cy:String(i),r:String(e.radius*Math.abs(n.a))}};let s=e.width*Math.abs(n.a),a=e.height*Math.abs(n.d);return{...o,name:"rect",attributes:{x:String(r-s/2),y:String(i-a/2),width:String(s),height:String(a),...e.shape==="rotated_rect"?{transform:`rotate(${-e.ccw_rotation} ${r} ${i})`}:{}}}}function vk(e){let t=(o)=>({...o,children:(o.children??[]).filter((r)=>!(u_n in(r.attributes??{}))).map(t)}),n=t(e);return n.children.push({name:"style",type:"element",value:"",attributes:{[u_n]:"",type:"text/css"},children:[{name:"",type:"text",value:`@font-face { font-family: '${MY}'; src: url('data:font/ttf;base64,${SIe}') format('truetype'); font-weight: normal; font-style: normal; }`,attributes:{},children:[]}]}),Agn.stringify(n)}function oNr(e,t,n){let{transform:o,shouldDrawErrors:r}=n;if(!r)return[];let{pcb_port_ids:i}=e,s=t.find((u)=>u.type==="pcb_port"&&u.pcb_port_id===i?.[0]),a=t.find((u)=>u.type==="pcb_port"&&u.pcb_port_id===i?.[1]);if(!s||!a){let _=e.message?.match(/pcb_via\[#?(pcb_via_\d+)\]/)?.[1],p=t.find((m)=>m.type==="pcb_via"&&m.pcb_via_id===_);if(p&&p.type==="pcb_via")return rNr(e,p,n);if(e.center){let m=Pt(o,{x:e.center.x,y:e.center.y});return _nt([{name:"rect",type:"element",attributes:{x:(m.x-5).toString(),y:(m.y-5).toString(),width:"10",height:"10",fill:"red",transform:`rotate(45 ${m.x} ${m.y})`},children:[],value:""},{name:"text",type:"element",attributes:{x:m.x.toString(),y:(m.y-15).toString(),fill:"red","font-family":"sans-serif","font-size":"12","text-anchor":"middle"},children:[{type:"text",value:e.message||"Pcb Trace Error",name:"",attributes:{},children:[]}],value:""}])}else return[]}let c=Pt(o,{x:s.x,y:s.y}),l=Pt(o,{x:a.x,y:a.y}),h={x:(c.x+l.x)/2,y:(c.y+l.y)/2};if(isNaN(c.x)||isNaN(c.y)||isNaN(l.x)||isNaN(l.y)||isNaN(h.x)||isNaN(h.y))return[];let d=[{name:"line",type:"element",attributes:{x1:c.x.toString(),y1:c.y.toString(),x2:h.x.toString(),y2:h.y.toString(),stroke:"red","stroke-width":"1.5","stroke-dasharray":"2,2"},children:[],value:""},{name:"line",type:"element",attributes:{x1:h.x.toString(),y1:h.y.toString(),x2:l.x.toString(),y2:l.y.toString(),stroke:"red","stroke-width":"1.5","stroke-dasharray":"2,2"},children:[],value:""},{name:"rect",type:"element",attributes:{x:(h.x-5).toString(),y:(h.y-5).toString(),width:"10",height:"10",fill:"red",transform:`rotate(45 ${h.x} ${h.y})`},children:[],value:""},{name:"text",type:"element",attributes:{x:h.x.toString(),y:(h.y-15).toString(),fill:"red","font-family":"sans-serif","font-size":"12","text-anchor":"middle"},children:[{type:"text",value:e.message||"Pcb Trace Error",name:"",attributes:{},children:[]}],value:""}];return _nt(d)}function rNr(e,t,n){let{transform:o}=n;if(e.center&&t){let r=Pt(o,{x:e.center.x,y:e.center.y}),i=Pt(o,{x:t.x,y:t.y}),s=i.x-r.x,a=i.y-r.y,c=Math.sqrt(s*s+a*a),l=Math.atan2(a,s)*180/Math.PI,h=10,d=c+20,u=20,_=(r.x+i.x)/2,p=(r.y+i.y)/2;return _nt([{name:"rect",type:"element",attributes:{x:(_-d/2).toString(),y:(p-10).toString(),width:d.toString(),height:20 .toString(),fill:"none",stroke:"red","stroke-width":"1","stroke-dasharray":"3,2",transform:`rotate(${l} ${_} ${p})`},children:[],value:""},{name:"rect",type:"element",attributes:{x:(_-5).toString(),y:(p-5).toString(),width:"10",height:"10",fill:"red",transform:`rotate(45 ${_} ${p})`},children:[],value:""},{name:"text",type:"element",attributes:{x:_.toString(),y:(p-10-5).toString(),fill:"red","font-family":"sans-serif","font-size":"12","text-anchor":"middle"},children:[{type:"text",value:e.message||"Pcb Trace Error",name:"",attributes:{},children:[]}],value:""}])}return[]}function _nt(e){return e.map((t)=>({...t,attributes:{...t.attributes??{},"data-type":t.attributes?.["data-type"]??"pcb_trace_error","data-pcb-layer":t.attributes?.["data-pcb-layer"]??"overlay"},children:(t.children??[]).map((n)=>{if(n?.type==="element")return{...n,attributes:{...n.attributes??{},"data-type":n.attributes?.["data-type"]??"pcb_trace_error","data-pcb-layer":n.attributes?.["data-pcb-layer"]??"overlay"}};return n})}))}function iNr(e){return e.map((t)=>({...t,attributes:{...t.attributes??{},"data-type":t.attributes?.["data-type"]??"pcb_footprint_overlap_error","data-pcb-layer":t.attributes?.["data-pcb-layer"]??"overlay"},children:(t.children??[]).map((n)=>{if(n?.type==="element")return{...n,attributes:{...n.attributes??{},"data-type":n.attributes?.["data-type"]??"pcb_footprint_overlap_error","data-pcb-layer":n.attributes?.["data-pcb-layer"]??"overlay"}};return n})}))}function sNr(e,t,n){let{transform:o,shouldDrawErrors:r}=n;if(!r)return[];let i=[],s=[],a=[];if(e.pcb_smtpad_ids)for(let h of e.pcb_smtpad_ids){let d=t.find((u)=>u.type==="pcb_smtpad"&&u.pcb_smtpad_id===h);if(d){if(s.push({x:d.x,y:d.y,type:"pcb_smtpad",id:h,pcb_port_id:d.pcb_port_id}),d.pcb_port_id)a.push(d.pcb_port_id)}}let c=a.length>1&&a.every((h)=>h===a[0]),l=s;if(c)l=s.filter((h)=>h.type!=="pcb_smtpad");if(e.pcb_plated_hole_ids)for(let h of e.pcb_plated_hole_ids){let d=t.find((u)=>u.type==="pcb_plated_hole"&&u.pcb_plated_hole_id===h);if(d)l.push({x:d.x,y:d.y,type:"pcb_plated_hole",id:h})}if(e.pcb_hole_ids)for(let h of e.pcb_hole_ids){let d=t.find((u)=>u.type==="pcb_hole"&&u.pcb_hole_id===h);if(d)l.push({x:d.x,y:d.y,type:"pcb_hole",id:h})}if(l.length>0){let h=l.reduce((_,p)=>_+p.x,0)/l.length,d=l.reduce((_,p)=>_+p.y,0)/l.length,u=Pt(o,{x:h,y:d});i.push({name:"rect",type:"element",attributes:{x:(u.x-5).toString(),y:(u.y-5).toString(),width:"10",height:"10",fill:"red",transform:`rotate(45 ${u.x} ${u.y})`},children:[],value:""}),i.push({name:"text",type:"element",attributes:{x:u.x.toString(),y:(u.y-15).toString(),fill:"red","font-family":"sans-serif","font-size":"12","text-anchor":"middle"},children:[{type:"text",value:e.message||"PCB Footprint Overlap Error",name:"",attributes:{},children:[]}],value:""});for(let _ of l){let p=Pt(o,{x:_.x,y:_.y});if(i.push({name:"rect",type:"element",attributes:{x:(p.x-5).toString(),y:(p.y-5).toString(),width:"10",height:"10",fill:"red",transform:`rotate(45 ${p.x} ${p.y})`},children:[],value:""}),l.length>1)i.push({name:"line",type:"element",attributes:{x1:u.x.toString(),y1:u.y.toString(),x2:p.x.toString(),y2:p.y.toString(),stroke:"red","stroke-width":"1.5","stroke-dasharray":"2,2"},children:[],value:""})}}return iNr(i)}function aNr(e,t,n){let{transform:o,shouldDrawErrors:r}=n;if(!r)return[];let i=[],s=[];for(let h of e.pcb_component_ids){let d=t.find((u)=>u.type==="pcb_component"&&u.pcb_component_id===h);if(d)s.push(d.center)}if(s.length===0)return[];let a=s.reduce((h,d)=>h+d.x,0)/s.length,c=s.reduce((h,d)=>h+d.y,0)/s.length,l=Pt(o,{x:a,y:c});i.push({name:"rect",type:"element",attributes:{x:(l.x-5).toString(),y:(l.y-5).toString(),width:"10",height:"10",fill:"red",transform:`rotate(45 ${l.x} ${l.y})`,"data-type":"pcb_courtyard_overlap_error","data-pcb-layer":"overlay"},children:[],value:""}),i.push({name:"text",type:"element",attributes:{x:l.x.toString(),y:(l.y-15).toString(),fill:"red","font-family":"sans-serif","font-size":"12","text-anchor":"middle","data-type":"pcb_courtyard_overlap_error","data-pcb-layer":"overlay"},children:[{type:"text",value:e.message||"PCB Courtyard Overlap",name:"",attributes:{},children:[]}],value:""});for(let h of s){let d=Pt(o,h);i.push({name:"rect",type:"element",attributes:{x:(d.x-5).toString(),y:(d.y-5).toString(),width:"10",height:"10",fill:"red",transform:`rotate(45 ${d.x} ${d.y})`,"data-type":"pcb_courtyard_overlap_error","data-pcb-layer":"overlay"},children:[],value:""})}if(s.length===2){let h=s.map((_)=>Pt(o,_)),d=h[0],u=h[1];i.push({name:"line",type:"element",attributes:{x1:d.x.toString(),y1:d.y.toString(),x2:u.x.toString(),y2:u.y.toString(),stroke:"red","stroke-width":"1.5","stroke-dasharray":"4,3","data-type":"pcb_courtyard_overlap_error","data-pcb-layer":"overlay"},children:[],value:""})}return i}function cNr(e){return e.map((t)=>({...t,attributes:{...t.attributes??{},"data-type":t.attributes?.["data-type"]??"pcb_component_outside_board_error","data-pcb-layer":t.attributes?.["data-pcb-layer"]??"overlay"}}))}function lNr(e,t){let n=e.pcb_component_id;if(!n)return e.component_bounds??null;let o=t.find((r)=>r.type==="pcb_component"&&r.pcb_component_id===n);if(o?.center&&o?.width&&o?.height)return{min_x:o.center.x-o.width/2,max_x:o.center.x+o.width/2,min_y:o.center.y-o.height/2,max_y:o.center.y+o.height/2};return e.component_bounds??null}function hNr(e,t,n){let{shouldDrawErrors:o,transform:r}=n;if(!o)return[];let i=lNr(e,t);if(!i)return[];let s=Pt(r,{x:i.min_x,y:i.min_y}),a=Pt(r,{x:i.max_x,y:i.max_y}),c=Math.min(s.x,a.x),l=Math.min(s.y,a.y),h=Math.abs(a.x-s.x),d=Math.abs(a.y-s.y),u=c+h/2,_=l+d/2,p=[{type:"element",name:"rect",value:"",attributes:{x:c.toString(),y:l.toString(),width:h.toString(),height:d.toString(),fill:"none",stroke:"red","stroke-width":"1.5","stroke-dasharray":"4,2"},children:[]},{type:"element",name:"rect",value:"",attributes:{x:(u-5).toString(),y:(_-5).toString(),width:"10",height:"10",fill:"red",transform:`rotate(45 ${u} ${_})`},children:[]},{type:"element",name:"text",value:"",attributes:{x:u.toString(),y:(l-10).toString(),fill:"red","font-family":"sans-serif","font-size":"12","text-anchor":"middle"},children:[{type:"text",name:"",value:e.message??"PCB component extends outside board boundaries",attributes:{},children:[]}]}];return cNr(p)}function qhe(e){return e!==void 0&&typeof e.x==="number"&&Number.isFinite(e.x)&&typeof e.y==="number"&&Number.isFinite(e.y)}function dNr(e,t){if(e.type==="pcb_via_trace_clearance_error")return t.find((n)=>n.type==="pcb_via"&&n.pcb_via_id===e.pcb_via_id);return t.find((n)=>n.type==="pcb_smtpad"&&n.pcb_smtpad_id===e.pcb_pad_id||n.type==="pcb_plated_hole"&&n.pcb_plated_hole_id===e.pcb_pad_id)}function uNr(e){if(!e)return;if("x"in e&&"y"in e&&qhe(e))return{x:e.x,y:e.y};if(e.type==="pcb_smtpad"&&e.shape==="polygon"&&e.points.length>0){let t=e.points.filter(qhe);if(t.length===0)return;let n=t.map((r)=>r.x),o=t.map((r)=>r.y);return{x:(Math.min(...n)+Math.max(...n))/2,y:(Math.min(...o)+Math.max(...o))/2}}return}function pNr(e){if(e.route_type==="through_pad")return[e.start,e.end].filter(qhe);let t=e;return qhe(t)?[{x:t.x,y:t.y}]:[]}function mNr(e){if(!e)return;let t,n;for(let o of e.route){let r=pNr(o);if(!t&&r[0])t=r[0];if(r.length>0)n=r[r.length-1]}return t&&n?{start:t,end:n}:void 0}function _Nr(e,t){return{x:(e.x+t.x)/2,y:(e.y+t.y)/2}}function qtt(e,t,n){let o=e.x-t.x,r=e.y-t.y;if(o*o+r*r<0.25)return;return{type:"element",name:"line",value:"",attributes:{x1:e.x.toString(),y1:e.y.toString(),x2:t.x.toString(),y2:t.y.toString(),stroke:"red","stroke-width":"1.5","stroke-dasharray":"2,2","data-error-reference":n},children:[]}}function gNr(e,t){return e.map((n)=>({...n,attributes:{...n.attributes??{},"data-type":n.attributes?.["data-type"]??t,"data-pcb-layer":n.attributes?.["data-pcb-layer"]??"overlay"}}))}function ANr(e,t,n){let{shouldDrawErrors:o,transform:r}=n;if(!o)return[];let i=uNr(dNr(e,t)),s=t.find((y)=>y.type==="pcb_trace"&&y.pcb_trace_id===e.pcb_trace_id),a=mNr(s),c=qhe(e.center)?e.center:i??(a?_Nr(a.start,a.end):void 0);if(!c)return[];let l=Pt(r,c),h=i?Pt(r,i):void 0,d=a?{start:Pt(r,a.start),end:Pt(r,a.end)}:void 0,u=[d?qtt(d.start,l,"trace-start"):void 0,d?qtt(d.end,l,"trace-end"):void 0,h?qtt(h,l,"obstacle"):void 0].filter((y)=>y!==void 0),_=e.type==="pcb_pad_trace_clearance_error"?"Pad/trace":"Via/trace",{actual_clearance:p,minimum_clearance:m}=e,A=p!==void 0&&m!==void 0?`${_} clearance ${p} is below minimum ${m}`:e.type==="pcb_pad_trace_clearance_error"?"Pad and trace too close":"Via and trace too close",g=e.message??A,f=[...u,{type:"element",name:"rect",value:"",attributes:{x:(l.x-5).toString(),y:(l.y-5).toString(),width:"10",height:"10",fill:"red",transform:`rotate(45 ${l.x} ${l.y})`},children:[]},{type:"element",name:"text",value:"",attributes:{x:l.x.toString(),y:(l.y-15).toString(),fill:"red","font-family":"sans-serif","font-size":"12","text-anchor":"middle"},children:[{type:"text",name:"",value:g,attributes:{},children:[]}]}];return gNr(f,e.type)}function fNr(e,t){let{transform:n}=t;if(!Array.isArray(e.route)||e.route.length<2)return[];let o=e.route[0],r=e.route[e.route.length-1],i=o.x===r.x&&o.y===r.y,s=e.route.slice(0,i?-1:void 0).map((h,d)=>{let[u,_]=Pt(n,[h.x,h.y]);return d===0?`M ${u} ${_}`:`L ${u} ${_}`}).join(" ")+(i||e.is_filled?" Z":""),a=e.color||"rgba(255,255,255,0.5)",c=a,l;if(e.is_filled&&e.has_stroke!==!1&&e.stroke_width>0)try{let h=Lhe(a);if(h.alpha()<1)c=h.alpha(1).rgb().string(),l=h.alpha().toString()}catch{}return[{name:"path",type:"element",attributes:{class:"pcb-fabrication-note-path",stroke:e.has_stroke===!1?"none":c,fill:e.is_filled?c:"none",d:s,...l===void 0?{}:{opacity:l},"stroke-width":(e.stroke_width*Math.abs(n.a)).toString(),"data-pcb-component-id":e.pcb_component_id,"data-pcb-fabrication-note-path-id":e.pcb_fabrication_note_path_id,"data-type":"pcb_fabrication_note_path","data-pcb-layer":"overlay"},value:"",children:[]}]}function xgn(e){switch(e){case"top_left":return{textAnchor:"start",dominantBaseline:"text-before-edge"};case"top_center":return{textAnchor:"middle",dominantBaseline:"text-before-edge"};case"top_right":return{textAnchor:"end",dominantBaseline:"text-before-edge"};case"center_left":return{textAnchor:"start",dominantBaseline:"central"};case"center_right":return{textAnchor:"end",dominantBaseline:"central"};case"bottom_left":return{textAnchor:"start",dominantBaseline:"text-after-edge"};case"bottom_center":return{textAnchor:"middle",dominantBaseline:"text-after-edge"};case"bottom_right":return{textAnchor:"end",dominantBaseline:"text-after-edge"};case"center":default:return{textAnchor:"middle",dominantBaseline:"central"}}}function yNr(e,t){let{transform:n,layer:o}=t,{anchor_position:r,anchor_alignment:i="center",text:s,font_size:a=1,layer:c="top",color:l,ccw_rotation:h=0}=e;if(o&&c!==o)return[];if(!r||typeof r.x!=="number"||typeof r.y!=="number")return Km(`[pcb_fabrication_note_text] Invalid anchor_position for "${e.pcb_fabrication_note_text_id}": expected {x: number, y: number}, got ${JSON.stringify(r)}`),[];let[d,u]=Pt(n,[r.x,r.y]),_=a*Math.abs(n.a),{textAnchor:p,dominantBaseline:m}=xgn(i),A=Ts(Rc(d,u),qg(-h*Math.PI/180));return[{name:"text",type:"element",attributes:{x:"0",y:"0","font-family":MY,"font-size":_.toString(),"text-anchor":p,"dominant-baseline":m,transform:p2(A),class:"pcb-fabrication-note-text",fill:l||"rgba(255,255,255,0.5)","data-type":"pcb_fabrication_note_text","data-pcb-layer":"overlay"},children:[{type:"text",value:s,name:"",attributes:{},children:[]}],value:""}]}function bNr(e,t){let{transform:n,layer:o}=t,{center:r,width:i,height:s,stroke_width:a,is_filled:c,has_stroke:l,is_stroke_dashed:h,color:d,layer:u="top",pcb_component_id:_,pcb_fabrication_note_rect_id:p,corner_radius:m}=e;if(o&&u!==o)return[];if(!r||typeof r.x!=="number"||typeof r.y!=="number"||typeof i!=="number"||typeof s!=="number")return Km(`[pcb_fabrication_note_rect] Invalid data for "${p}": expected center {x: number, y: number}, width: number, height: number, got center=${JSON.stringify(r)}, width=${JSON.stringify(i)}, height=${JSON.stringify(s)}`),[];let A=i/2,g=s/2,[f,y]=Pt(n,[r.x-A,r.y+g]),[x,C]=Pt(n,[r.x+A,r.y-g]),b=Math.min(f,x),I=Math.min(y,C),v=Math.abs(x-f),P=Math.abs(C-y),B=(typeof a==="number"?a:0)*Math.abs(n.a),T=d??xNr,N=typeof m==="number"&&m>0?m:0,D=N*Math.abs(n.a),L=N*Math.abs(n.d),H={x:b.toString(),y:I.toString(),width:v.toString(),height:P.toString(),class:"pcb-fabrication-note-rect","data-type":"pcb_fabrication_note_rect","data-pcb-fabrication-note-rect-id":p,"data-pcb-layer":"overlay"};if(_!==void 0)H["data-pcb-component-id"]=_;if(D>0)H.rx=D.toString();if(L>0)H.ry=L.toString();if(c)H.fill=d??CNr;else H.fill="none";if(l??B>0){if(H.stroke=T,H["stroke-width"]=B.toString(),h){let U=0.2*Math.abs(n.a),j=0.1*Math.abs(n.a);H["stroke-dasharray"]=`${U} ${j}`}}else H.stroke="none";return[{name:"rect",type:"element",value:"",attributes:H,children:[]}]}function Jtt(e){let t=Math.hypot(e.x,e.y)||1;return{x:e.x/t,y:e.y/t}}function p_n(e){return e.map((t,n)=>n===0?`M ${t.x} ${t.y}`:`L ${t.x} ${t.y}`).join(" ")}function PNr(e,t){let{transform:n,layer:o}=t,{from:r,to:i,text:s,font_size:a=1,color:c,arrow_size:l,layer:h,pcb_component_id:d,pcb_fabrication_note_dimension_id:u,offset_distance:_,offset_direction:p,text_ccw_rotation:m}=e;if(o&&h&&h!==o)return[];if(!r||!i||typeof r!=="object"||typeof i!=="object")return Km(`[pcb_fabrication_note_dimension] Invalid endpoints for "${u}": expected {from: {x, y}, to: {x, y}}, got from=${JSON.stringify(r)}, to=${JSON.stringify(i)}`),[];if(typeof r.x!=="number"||typeof r.y!=="number"||typeof i.x!=="number"||typeof i.y!=="number")return Km(`[pcb_fabrication_note_dimension] Invalid point values for "${u}": x and y must be numbers, got from=${JSON.stringify(r)}, to=${JSON.stringify(i)}`),[];let A=typeof l==="number"?l:void 0;if(A===void 0||!Number.isFinite(A)||A<=0)return Km(`[pcb_fabrication_note_dimension] Invalid arrow_size for "${u}": expected positive number, got ${JSON.stringify(l)}`),[];let g=A,f=Jtt({x:i.x-r.x,y:i.y-r.y});if(Number.isNaN(f.x)||Number.isNaN(f.y))return[];let y={x:-f.y,y:f.x},x=p&&typeof p.x==="number"&&typeof p.y==="number",C=x?Jtt({x:p.x,y:p.y}):{x:0,y:0},b=typeof _==="number"?_:0,I={x:C.x*b,y:C.y*b},v=(Se)=>({x:Se.x+I.x,y:Se.y+I.y}),P=v(r),M=v(i),B=g/2,T={x:P.x+f.x*g,y:P.y+f.y*g},N={x:M.x-f.x*g,y:M.y-f.y*g},D=[ye(P),ye({x:T.x+y.x*B,y:T.y+y.y*B}),ye({x:T.x-y.x*B,y:T.y-y.y*B})],L=[ye(M),ye({x:N.x+y.x*B,y:N.y+y.y*B}),ye({x:N.x-y.x*B,y:N.y-y.y*B})],[H,V]=Pt(n,[T.x,T.y]),[O,U]=Pt(n,[N.x,N.y]),j=g/5*Math.abs(n.a),Y=c||"rgba(255,255,255,0.5)",X=x&&(Math.abs(C.x)>Number.EPSILON||Math.abs(C.y)>Number.EPSILON)?C:y,K=b+g,J=(Se)=>{let Ne={x:Se.x+X.x*K,y:Se.y+X.y*K},[ke,nt]=Pt(n,[Se.x,Se.y]),[dt,rt]=Pt(n,[Ne.x,Ne.y]);return{name:"path",type:"element",value:"",attributes:{d:`M ${ke} ${nt} L ${dt} ${rt}`,stroke:Y,fill:"none","stroke-width":j.toString(),"stroke-linecap":"round",class:"pcb-fabrication-note-dimension-extension"},children:[]}},ee=[J(r),J(i)],se={x:(r.x+i.x)/2+I.x,y:(r.y+i.y)/2+I.y},[ne,re]=Pt(n,[P.x,P.y]),[Z,te]=Pt(n,[M.x,M.y]),ie=Jtt({x:Z-ne,y:te-re}),le=Math.atan2(ie.y,ie.x)*180/Math.PI;if(le>90||le<-90)le+=180;let ue=typeof m==="number"&&Number.isFinite(m)?le-m:le,de=0;if(s&&typeof m==="number"&&Number.isFinite(m)){let Se=s.length*a*vNr,Ne=a,ke=m*Math.PI/180,nt=Math.abs(Math.sin(ke)),dt=Math.abs(Math.cos(ke)),rt=Se/2,mt=Ne/2;de=rt*nt+mt*dt+a*SNr}let me=g*INr+de,Ae={x:se.x+y.x*me,y:se.y+y.y*me},[xe,Me]=Pt(n,[Ae.x,Ae.y]),Re=a*Math.abs(n.a),we=[...ee,{name:"path",type:"element",value:"",attributes:{d:`M ${H} ${V} L ${O} ${U}`,stroke:Y,fill:"none","stroke-width":j.toString(),"stroke-linecap":"round",class:"pcb-fabrication-note-dimension-line"},children:[]},{name:"path",type:"element",value:"",attributes:{d:`${p_n(D)} Z`,fill:Y,class:"pcb-fabrication-note-dimension-arrow"},children:[]},{name:"path",type:"element",value:"",attributes:{d:`${p_n(L)} Z`,fill:Y,class:"pcb-fabrication-note-dimension-arrow"},children:[]}];if(s)we.push({name:"text",type:"element",value:"",attributes:{x:xe.toString(),y:Me.toString(),fill:Y,"font-size":Re.toString(),"font-family":MY,"text-anchor":"middle","dominant-baseline":"central",class:"pcb-fabrication-note-dimension-text",transform:`rotate(${ue} ${xe} ${Me})`},children:[{type:"text",name:"",value:s,attributes:{},children:[]}]});let _e={class:"pcb-fabrication-note-dimension","data-type":"pcb_fabrication_note_dimension","data-pcb-fabrication-note-dimension-id":u,"data-pcb-layer":h??"overlay"};if(d!==void 0)_e["data-pcb-component-id"]=d;return[{name:"g",type:"element",value:"",attributes:_e,children:we}];function ye(Se){let[Ne,ke]=Pt(n,[Se.x,Se.y]);return{x:Ne,y:ke}}}function Ztt(e){let t=Math.hypot(e.x,e.y)||1;return{x:e.x/t,y:e.y/t}}function m_n(e){return e.map((t,n)=>n===0?`M ${t.x} ${t.y}`:`L ${t.x} ${t.y}`).join(" ")}function ENr(e,t){let{transform:n}=t,{from:o,to:r,text:i,font_size:s=1,color:a,arrow_size:c,offset_distance:l,offset_direction:h,text_ccw_rotation:d}=e;if(!o||!r)return Km(`[pcb_note_dimension] Invalid endpoints for "${e.pcb_note_dimension_id}": expected {from: {x, y}, to: {x, y}}, got from=${JSON.stringify(o)}, to=${JSON.stringify(r)}`),[];if(!Number.isFinite(c)||c<=0)return Km(`[pcb_note_dimension] Invalid arrow_size for "${e.pcb_note_dimension_id}": expected positive number, got ${JSON.stringify(c)}`),[];let u=Ztt({x:r.x-o.x,y:r.y-o.y});if(Number.isNaN(u.x)||Number.isNaN(u.y))return[];let _={x:-u.y,y:u.x},p=h&&typeof h.x==="number"&&typeof h.y==="number",m=p?Ztt({x:h.x,y:h.y}):{x:0,y:0},A=typeof l==="number"?l:0,g={x:m.x*A,y:m.y*A},f=(Ae)=>({x:Ae.x+g.x,y:Ae.y+g.y}),y=f(o),x=f(r),C=c/2,b={x:y.x+u.x*c,y:y.y+u.y*c},I={x:x.x-u.x*c,y:x.y-u.y*c},v=[me(y),me({x:b.x+_.x*C,y:b.y+_.y*C}),me({x:b.x-_.x*C,y:b.y-_.y*C})],P=[me(x),me({x:I.x+_.x*C,y:I.y+_.y*C}),me({x:I.x-_.x*C,y:I.y-_.y*C})],[M,B]=Pt(n,[b.x,b.y]),[T,N]=Pt(n,[I.x,I.y]),D=c/5*Math.abs(n.a),L=a||Hu.board.user_2,H=p&&(Math.abs(m.x)>Number.EPSILON||Math.abs(m.y)>Number.EPSILON)?m:_,V=A+c,O=(Ae)=>{let xe={x:Ae.x+H.x*V,y:Ae.y+H.y*V},[Me,Re]=Pt(n,[Ae.x,Ae.y]),[we,_e]=Pt(n,[xe.x,xe.y]);return{name:"path",type:"element",value:"",attributes:{d:`M ${Me} ${Re} L ${we} ${_e}`,stroke:L,fill:"none","stroke-width":D.toString(),"stroke-linecap":"round",class:"pcb-note-dimension-extension"},children:[]}},U=[O(o),O(r)],j={x:(o.x+r.x)/2+g.x,y:(o.y+r.y)/2+g.y},[Y,X]=Pt(n,[y.x,y.y]),[K,J]=Pt(n,[x.x,x.y]),ee=Ztt({x:K-Y,y:J-X}),se=Math.atan2(ee.y,ee.x)*180/Math.PI;if(se>90||se<-90)se+=180;let ne=typeof d==="number"&&Number.isFinite(d)?se-d:se,re=0;if(i&&typeof d==="number"&&Number.isFinite(d)){let Ae=i.length*s*0.6,xe=s,Me=d*Math.PI/180,Re=Math.abs(Math.sin(Me)),we=Math.abs(Math.cos(Me)),_e=Ae/2,ye=xe/2;re=_e*Re+ye*we+s*0.3}let Z=c*1.5+re,te={x:j.x+_.x*Z,y:j.y+_.y*Z},[ie,le]=Pt(n,[te.x,te.y]),ue=s*Math.abs(n.a),de=[...U,{name:"path",type:"element",value:"",attributes:{d:`M ${M} ${B} L ${T} ${N}`,stroke:L,fill:"none","stroke-width":D.toString(),"stroke-linecap":"round",class:"pcb-note-dimension-line"},children:[]},{name:"path",type:"element",value:"",attributes:{d:`${m_n(v)} Z`,fill:L,class:"pcb-note-dimension-arrow"},children:[]},{name:"path",type:"element",value:"",attributes:{d:`${m_n(P)} Z`,fill:L,class:"pcb-note-dimension-arrow"},children:[]}];if(i)de.push({name:"text",type:"element",value:"",attributes:{x:ie.toString(),y:le.toString(),fill:L,"font-size":ue.toString(),"font-family":"Arial, sans-serif","text-anchor":"middle","dominant-baseline":"central",class:"pcb-note-dimension-text",transform:`rotate(${ne} ${ie} ${le})`},children:[{type:"text",name:"",value:i,attributes:{},children:[]}]});return[{name:"g",type:"element",value:"",attributes:{class:"pcb-note-dimension","data-type":"pcb_note_dimension","data-pcb-note-dimension-id":e.pcb_note_dimension_id,"data-pcb-layer":"overlay"},children:de}];function me(Ae){let[xe,Me]=Pt(n,[Ae.x,Ae.y]);return{x:xe,y:Me}}}function wNr(e,t){let{transform:n}=t,{anchor_position:o,text:r,font_size:i=1,anchor_alignment:s="center",color:a}=e;if(!o||typeof o.x!=="number"||typeof o.y!=="number")return Km(`[pcb_note_text] Invalid anchor_position for "${e.pcb_note_text_id}": expected {x: number, y: number}, got ${JSON.stringify(o)}`),[];if(typeof r!=="string"||r.length===0)return Km(`[pcb_note_text] Invalid text for "${e.pcb_note_text_id}": expected non-empty string, got ${JSON.stringify(r)}`),[];let[c,l]=Pt(n,[o.x,o.y]),h=i*Math.abs(n.a),{textAnchor:d,dominantBaseline:u}=xgn(s),_=r.split(`
`),p=_.length===1?[{type:"text",name:"",value:r,attributes:{},children:[]}]:_.map((A,g)=>({type:"element",name:"tspan",value:"",attributes:{x:c.toString(),...g>0?{dy:"1em"}:{}},children:[{type:"text",name:"",value:A,attributes:{},children:[]}]}));return[{name:"text",type:"element",value:"",attributes:{x:c.toString(),y:l.toString(),fill:a??MNr,"font-family":MY,"font-size":h.toString(),"text-anchor":d,"dominant-baseline":u,class:"pcb-note-text","data-type":"pcb_note_text","data-pcb-note-text-id":e.pcb_note_text_id,"data-pcb-layer":"overlay"},children:p}]}function DNr(e,t){let{transform:n}=t,{center:o,width:r,height:i,stroke_width:s,is_filled:a,has_stroke:c,is_stroke_dashed:l,color:h,corner_radius:d}=e;if(!o||typeof o.x!=="number"||typeof o.y!=="number"||typeof r!=="number"||typeof i!=="number")return Km(`[pcb_note_rect] Invalid data for "${e.pcb_note_rect_id}": expected center {x: number, y: number}, width: number, height: number, got center=${JSON.stringify(o)}, width=${JSON.stringify(r)}, height=${JSON.stringify(i)}`),[];let u=r/2,_=i/2,[p,m]=Pt(n,[o.x-u,o.y+_]),[A,g]=Pt(n,[o.x+u,o.y-_]),f=Math.min(p,A),y=Math.min(m,g),x=Math.abs(A-p),C=Math.abs(g-m),I=(typeof s==="number"?s:0)*Math.abs(n.a),v=typeof d==="number"&&d>0?d:0,P=v*Math.abs(n.a),M=v*Math.abs(n.d),B=h??BNr,T={x:f.toString(),y:y.toString(),width:x.toString(),height:C.toString(),class:"pcb-note-rect","data-type":"pcb_note_rect","data-pcb-note-rect-id":e.pcb_note_rect_id,"data-pcb-layer":"overlay"};if(P>0)T.rx=P.toString();if(M>0)T.ry=M.toString();if(a)T.fill=h??TNr;else T.fill="none";if(c??I>0){if(T.stroke=B,T["stroke-width"]=I.toString(),l){let L=0.2*Math.abs(n.a),H=0.1*Math.abs(n.a);T["stroke-dasharray"]=`${L} ${H}`}}else T.stroke="none";return[{name:"rect",type:"element",value:"",attributes:T,children:[]}]}function RNr(e,t){let{transform:n}=t;if(!Array.isArray(e.route)||e.route.length===0)return Km(`[pcb_note_path] Invalid route for "${e.pcb_note_path_id}": expected non-empty array of points, got ${JSON.stringify(e.route)}`),[];for(let s of e.route)if(typeof s.x!=="number"||typeof s.y!=="number")return Km(`[pcb_note_path] Invalid point in route for "${e.pcb_note_path_id}": expected {x: number, y: number}, got ${JSON.stringify(s)}`),[];let o=e.route.map((s,a)=>{let[c,l]=Pt(n,[s.x,s.y]);return a===0?`M ${c} ${l}`:`L ${c} ${l}`}).join(" "),r=e.stroke_width*Math.abs(n.a);return[{name:"path",type:"element",value:"",attributes:{d:o,stroke:e.color??NNr,fill:"none","stroke-width":r.toString(),class:"pcb-note-path","data-type":"pcb_note_path","data-pcb-note-path-id":e.pcb_note_path_id,"data-pcb-layer":"overlay"},children:[]}]}function kNr(e,t){let{transform:n}=t,{x1:o,y1:r,x2:i,y2:s,stroke_width:a,color:c,is_dashed:l}=e;if(typeof o!=="number"||typeof r!=="number"||typeof i!=="number"||typeof s!=="number")return Km(`[pcb_note_line] Invalid coordinates for "${e.pcb_note_line_id}": expected x1, y1, x2, y2 as numbers, got x1=${JSON.stringify(o)}, y1=${JSON.stringify(r)}, x2=${JSON.stringify(i)}, y2=${JSON.stringify(s)}`),[];let[h,d]=Pt(n,[o,r]),[u,_]=Pt(n,[i,s]),m=(typeof a==="number"?a:0)*Math.abs(n.a),A={x1:h.toString(),y1:d.toString(),x2:u.toString(),y2:_.toString(),stroke:c??QNr,"stroke-width":m.toString(),"stroke-linecap":"round",class:"pcb-note-line","data-type":"pcb_note_line","data-pcb-note-line-id":e.pcb_note_line_id,"data-pcb-layer":"overlay"};if(l){let f=0.2*Math.abs(n.a),y=0.1*Math.abs(n.a);A["stroke-dasharray"]=`${f} ${y}`}return[{name:"line",type:"element",value:"",attributes:A,children:[]}]}function HNr(e,t){let n=t.boardOwnerMap?.get(e.pcb_board_id);if(!n)return[];let[o,r]=Pt(t.transform,[n.center.x+e.start.x,n.center.y+e.start.y]),[i,s]=Pt(t.transform,[n.center.x+e.end.x,n.center.y+e.end.y]),a=Math.abs(t.transform.a),c=Math.hypot(i-o,s-r),l=Math.min(0.5*a,c*0.8/LNr),h=Math.atan2(s-r,i-o);if(h>=Math.PI/2)h-=Math.PI;if(h<-Math.PI/2)h+=Math.PI;let d=Ts(Rc((o+i)/2,(r+s)/2),qg(h));return[{name:"line",type:"element",value:"",attributes:{x1:o.toString(),y1:r.toString(),x2:i.toString(),y2:s.toString(),stroke:"#ffd54f","stroke-width":(0.15*a).toString(),"stroke-dasharray":`${0.75*a} ${0.4*a}`,"stroke-linecap":"butt",class:"pcb-bend-line","data-type":"pcb_bend","data-pcb-bend-id":e.pcb_bend_id,"data-pcb-board-id":e.pcb_board_id,"data-pcb-layer":"overlay"},children:[{name:"title",type:"element",value:"",attributes:{},children:[{name:"",type:"text",value:`${e.name??e.pcb_bend_id}: ${e.bend_angle}°, radius ${e.bend_radius} mm`,attributes:{},children:[]}]}]},...c>0?[{name:"text",type:"element",value:"",attributes:{x:"0",y:(-(l*0.6+0.2*a)).toString(),fill:"#ffd54f","font-family":MY,"font-size":l.toString(),"text-anchor":"middle","dominant-baseline":"central",transform:p2(d),class:"pcb-bend-line-label","data-type":"pcb_bend","data-pcb-bend-id":e.pcb_bend_id,"data-pcb-board-id":e.pcb_board_id,"data-pcb-layer":"overlay"},children:[{name:"",type:"text",value:Cgn,attributes:{},children:[]}]}]:[]]}function FNr(e,t){let{transform:n,colorMap:o,showSolderMask:r}=t,[i,s]=Pt(n,[e.x,e.y]),a=ugn(e,t.circuitJson),c=Array.isArray(e.layers)&&e.layers[0]||e.layer||"top",l=c,h=Boolean(e.is_covered_with_solder_mask),d=(e.soldermask_margin??0)*Math.abs(n.a),u=r&&h&&d!==0,_=o.soldermaskWithCopperUnderneath.top;if(e.shape==="pill"){let p=e.outer_width*Math.abs(n.a),m=e.outer_height*Math.abs(n.a),A=e.hole_width*Math.abs(n.a),g=e.hole_height*Math.abs(n.a),f=e.ccw_rotation||0,y=f?`translate(${i} ${s}) rotate(${-f})`:`translate(${i} ${s})`,x=f?`translate(${i} ${s}) rotate(${-f})`:`translate(${i} ${s})`,C=(I,v)=>{if(I>v){let P=v/2,M=I-2*P;return`M${-I/2+P},${-P} h${M} a${P},${P} 0 0 1 0,${v} h${-M} a${P},${P} 0 0 1 0,${-v} z`}else if(v>I){let P=I/2,M=v-2*P;return`M${P},${-v/2+P} v${M} a${P},${P} 0 0 1 ${-I},0 v${-M} a${P},${P} 0 0 1 ${I},0 z`}else{let P=I/2;return`M${-P},0 a${P},${P} 0 0 1 ${I},0 a${P},${P} 0 0 1 ${-I},0 z`}},b=[{name:"path",type:"element",attributes:{class:"pcb-hole-outer",fill:o.copper.top,d:C(p,m),transform:y,"data-type":"pcb_plated_hole","data-pcb-layer":c},value:"",children:[]},{name:"path",type:"element",attributes:{class:"pcb-hole-inner",fill:o.drill,d:C(A,g),transform:x,"data-type":"pcb_plated_hole_drill","data-pcb-layer":"drill"},value:"",children:[]}];if(u){let I=p+2*d,v=m+2*d;if(d<0)b=[{name:"path",type:"element",attributes:{class:"pcb-hole-outer-covered",fill:_,d:C(p,m),transform:y,"data-type":"pcb_plated_hole","data-pcb-layer":c},value:"",children:[]},{name:"path",type:"element",attributes:{class:"pcb-hole-outer-exposed",fill:o.copper.top,d:C(I,v),transform:y,"data-type":"pcb_soldermask","data-pcb-layer":l},value:"",children:[]},b[1]];else b.unshift({name:"path",type:"element",attributes:{class:"pcb-soldermask-cutout",fill:o.substrate,d:C(I,v),transform:y,"data-type":"pcb_soldermask_opening","data-pcb-layer":l},value:"",children:[]})}return[{name:"g",type:"element",attributes:{"data-type":"pcb_plated_hole","data-pcb-layer":"through",...a},children:b,value:""}]}if(e.shape==="oval"){let p=e.outer_width*Math.abs(n.a),m=e.outer_height*Math.abs(n.a),A=e.hole_width*Math.abs(n.a),g=e.hole_height*Math.abs(n.a),f=e.ccw_rotation||0,y=f?`translate(${i} ${s}) rotate(${-f})`:`translate(${i} ${s})`,x=[{name:"ellipse",type:"element",attributes:{class:"pcb-hole-outer",fill:o.copper.top,cx:"0",cy:"0",rx:(p/2).toString(),ry:(m/2).toString(),transform:y,"data-type":"pcb_plated_hole","data-pcb-layer":c},value:"",children:[]},{name:"ellipse",type:"element",attributes:{class:"pcb-hole-inner",fill:o.drill,cx:"0",cy:"0",rx:(A/2).toString(),ry:(g/2).toString(),transform:y,"data-type":"pcb_plated_hole_drill","data-pcb-layer":"drill"},value:"",children:[]}];return[{name:"g",type:"element",attributes:{"data-type":"pcb_plated_hole","data-pcb-layer":"through",...a},children:x,value:""}]}if(e.shape==="circle"){let p=e.outer_diameter*Math.abs(n.a),m=e.outer_diameter*Math.abs(n.a),A=e.hole_diameter*Math.abs(n.a),g=e.hole_diameter*Math.abs(n.a),f=Math.min(p,m)/2,y=Math.min(A,g)/2,x=[{name:"circle",type:"element",attributes:{class:"pcb-hole-outer",fill:o.copper.top,cx:i.toString(),cy:s.toString(),r:f.toString(),"data-type":"pcb_plated_hole","data-pcb-layer":c},value:"",children:[]},{name:"circle",type:"element",attributes:{class:"pcb-hole-inner",fill:o.drill,cx:i.toString(),cy:s.toString(),r:y.toString(),"data-type":"pcb_plated_hole_drill","data-pcb-layer":"drill"},value:"",children:[]}];if(u){let C=f+d;if(d<0)x=[{name:"circle",type:"element",attributes:{class:"pcb-hole-outer-covered",fill:_,cx:i.toString(),cy:s.toString(),r:f.toString(),"data-type":"pcb_plated_hole","data-pcb-layer":c},value:"",children:[]},{name:"circle",type:"element",attributes:{class:"pcb-hole-outer-exposed",fill:o.copper.top,cx:i.toString(),cy:s.toString(),r:C.toString(),"data-type":"pcb_soldermask","data-pcb-layer":l},value:"",children:[]},x[1]];else x.unshift({name:"circle",type:"element",attributes:{class:"pcb-soldermask-cutout",fill:o.substrate,cx:i.toString(),cy:s.toString(),r:C.toString(),"data-type":"pcb_soldermask_opening","data-pcb-layer":l},value:"",children:[]})}return[{name:"g",type:"element",attributes:{"data-type":"pcb_plated_hole","data-pcb-layer":"through",...a},children:x,value:""}]}if(e.shape==="circular_hole_with_rect_pad"){let p=e,m=e.hole_diameter*Math.abs(n.a),A=e.rect_pad_width*Math.abs(n.a),g=e.rect_pad_height*Math.abs(n.a),f=(e.rect_border_radius??0)*Math.abs(n.a),y=e.rect_ccw_rotation??0,x=p.rect_ccw_rotation??0,C=x?`translate(${i} ${s}) rotate(${-x})`:void 0,b=x?(-A/2).toString():(i-A/2).toString(),I=x?(-g/2).toString():(s-g/2).toString(),v=m/2,[P,M]=Pt(n,[p.x+(p.hole_offset_x??0),p.y+(p.hole_offset_y??0)]),B=[{name:"rect",type:"element",attributes:{class:"pcb-hole-outer-pad",fill:o.copper.top,...y?{x:(-A/2).toString(),y:(-g/2).toString(),transform:`translate(${i} ${s}) rotate(${-y})`}:{x:(i-A/2).toString(),y:(s-g/2).toString()},width:A.toString(),height:g.toString(),...C?{transform:C}:{},...f?{rx:f.toString(),ry:f.toString()}:{},"data-type":"pcb_plated_hole","data-pcb-layer":c},value:"",children:[]},{name:"circle",type:"element",attributes:{class:"pcb-hole-inner",fill:o.drill,cx:P.toString(),cy:M.toString(),r:v.toString(),"data-type":"pcb_plated_hole_drill","data-pcb-layer":"drill"},value:"",children:[]}];if(u){let T=A+2*d,N=g+2*d,D=f+d;if(d<0)B=[{name:"rect",type:"element",attributes:{class:"pcb-hole-outer-covered",fill:_,...y?{x:(-A/2).toString(),y:(-g/2).toString(),transform:`translate(${i} ${s}) rotate(${-y})`}:{x:(i-A/2).toString(),y:(s-g/2).toString()},width:A.toString(),height:g.toString(),...C?{transform:C}:{},...f?{rx:f.toString(),ry:f.toString()}:{},"data-type":"pcb_plated_hole","data-pcb-layer":c},value:"",children:[]},{name:"rect",type:"element",attributes:{class:"pcb-hole-outer-exposed",fill:o.copper.top,...y?{x:(-T/2).toString(),y:(-N/2).toString(),transform:`translate(${i} ${s}) rotate(${-y})`}:{x:(i-T/2).toString(),y:(s-N/2).toString()},width:T.toString(),height:N.toString(),...C?{transform:C}:{},...D>0?{rx:D.toString(),ry:D.toString()}:{},"data-type":"pcb_soldermask","data-pcb-layer":l},value:"",children:[]},B[1]];else B.unshift({name:"rect",type:"element",attributes:{class:"pcb-soldermask-cutout",fill:o.substrate,...y?{x:(-T/2).toString(),y:(-N/2).toString(),transform:`translate(${i} ${s}) rotate(${-y})`}:{x:(i-T/2).toString(),y:(s-N/2).toString()},width:T.toString(),height:N.toString(),...C?{transform:C}:{},...f?{rx:D.toString(),ry:D.toString()}:{},"data-type":"pcb_soldermask_opening","data-pcb-layer":l},value:"",children:[]})}return[{name:"g",type:"element",attributes:{"data-type":"pcb_plated_hole","data-pcb-layer":"through",...a},children:B,value:""}]}if(e.shape==="pill_hole_with_rect_pad"){let p=e,m=p.rect_pad_width*Math.abs(n.a),A=p.rect_pad_height*Math.abs(n.a),g=(p.rect_border_radius??0)*Math.abs(n.a),f=p.hole_height*Math.abs(n.a),y=p.hole_width*Math.abs(n.a),x=p,C=x.hole_offset_x??0,b=x.hole_offset_y??0,[I,v]=Pt(n,[p.x+C,p.y+b]),P=Math.min(f,y)/2,M=[{name:"rect",type:"element",attributes:{class:"pcb-hole-outer-pad",fill:o.copper.top,x:(i-m/2).toString(),y:(s-A/2).toString(),width:m.toString(),height:A.toString(),...g?{rx:g.toString(),ry:g.toString()}:{},"data-type":"pcb_plated_hole","data-pcb-layer":c},value:"",children:[]},{name:"rect",type:"element",attributes:{class:"pcb-hole-inner",fill:o.drill,x:(I-y/2).toString(),y:(v-f/2).toString(),width:y.toString(),height:f.toString(),rx:P.toString(),ry:P.toString(),"data-type":"pcb_plated_hole_drill","data-pcb-layer":"drill"},value:"",children:[]}];if(u){let B=m+2*d,T=A+2*d,N=g+d;if(d<0)M=[{name:"rect",type:"element",attributes:{class:"pcb-hole-outer-covered",fill:_,x:(i-m/2).toString(),y:(s-A/2).toString(),width:m.toString(),height:A.toString(),...g?{rx:g.toString(),ry:g.toString()}:{},"data-type":"pcb_plated_hole","data-pcb-layer":c},value:"",children:[]},{name:"rect",type:"element",attributes:{class:"pcb-hole-outer-exposed",fill:o.copper.top,x:(i-B/2).toString(),y:(s-T/2).toString(),width:B.toString(),height:T.toString(),...N>0?{rx:N.toString(),ry:N.toString()}:{},"data-type":"pcb_soldermask","data-pcb-layer":l},value:"",children:[]},M[1]];else M.unshift({name:"rect",type:"element",attributes:{class:"pcb-soldermask-cutout",fill:o.substrate,x:(i-B/2).toString(),y:(s-T/2).toString(),width:B.toString(),height:T.toString(),...g?{rx:N.toString(),ry:N.toString()}:{},"data-type":"pcb_soldermask_opening","data-pcb-layer":l},value:"",children:[]})}return[{name:"g",type:"element",attributes:{"data-type":"pcb_plated_hole","data-pcb-layer":"through",...a},children:M,value:""}]}if(e.shape==="rotated_pill_hole_with_rect_pad"){let p=e,m=p.rect_pad_width*Math.abs(n.a),A=p.rect_pad_height*Math.abs(n.a),g=(p.rect_border_radius??0)*Math.abs(n.a),f=p.hole_height*Math.abs(n.a),y=p.hole_width*Math.abs(n.a),x=p,C=x.hole_offset_x??0,b=x.hole_offset_y??0,[I,v]=Pt(n,[p.x+C,p.y+b]),P=Math.min(f,y)/2,M=[{name:"rect",type:"element",attributes:{class:"pcb-hole-outer-pad",fill:o.copper.top,x:(-m/2).toString(),y:(-A/2).toString(),width:m.toString(),height:A.toString(),transform:`translate(${i} ${s}) rotate(${-p.rect_ccw_rotation})`,...g?{rx:g.toString(),ry:g.toString()}:{},"data-type":"pcb_plated_hole","data-pcb-layer":c},value:"",children:[]},{name:"rect",type:"element",attributes:{class:"pcb-hole-inner",fill:o.drill,x:(-y/2).toString(),y:(-f/2).toString(),width:y.toString(),height:f.toString(),rx:P.toString(),ry:P.toString(),transform:`translate(${I} ${v}) rotate(${-p.hole_ccw_rotation})`,"data-type":"pcb_plated_hole_drill","data-pcb-layer":"drill"},value:"",children:[]}];if(u){let B=m+2*d,T=A+2*d,N=g+d;if(d<0)M=[{name:"rect",type:"element",attributes:{class:"pcb-hole-outer-covered",fill:_,x:(-m/2).toString(),y:(-A/2).toString(),width:m.toString(),height:A.toString(),transform:`translate(${i} ${s}) rotate(${-p.rect_ccw_rotation})`,...g?{rx:g.toString(),ry:g.toString()}:{},"data-type":"pcb_plated_hole","data-pcb-layer":c},value:"",children:[]},{name:"rect",type:"element",attributes:{class:"pcb-hole-outer-exposed",fill:o.copper.top,x:(-B/2).toString(),y:(-T/2).toString(),width:B.toString(),height:T.toString(),transform:`translate(${i} ${s}) rotate(${-p.rect_ccw_rotation})`,...N>0?{rx:N.toString(),ry:N.toString()}:{},"data-type":"pcb_soldermask","data-pcb-layer":l},value:"",children:[]},M[1]];else M.push({name:"rect",type:"element",attributes:{class:"pcb-solder-mask",fill:_,x:(-B/2).toString(),y:(-T/2).toString(),width:B.toString(),height:T.toString(),transform:`translate(${i} ${s}) rotate(${-p.rect_ccw_rotation})`,...g?{rx:N.toString(),ry:N.toString()}:{},"data-type":"pcb_soldermask","data-pcb-layer":l},value:"",children:[]})}return[{name:"g",type:"element",attributes:{"data-type":"pcb_plated_hole","data-pcb-layer":"through",...a},children:M,value:""}]}if(e.shape==="hole_with_polygon_pad"){let p=e,m=p.pad_outline||[],A=p.x??0,g=p.y??0,y=m.map((I)=>Pt(n,[A+I.x,g+I.y])).map((I)=>I.join(",")).join(" "),[x,C]=Pt(n,[A+p.hole_offset_x,g+p.hole_offset_y]),b=()=>{if(p.hole_shape==="circle"){let v=(p.hole_diameter??0)*Math.abs(n.a)/2;return{name:"circle",type:"element",attributes:{class:"pcb-hole-inner",fill:o.drill,cx:x.toString(),cy:C.toString(),r:v.toString(),"data-type":"pcb_plated_hole_drill","data-pcb-layer":"drill"},value:"",children:[]}}if(p.hole_shape==="oval"){let I=(p.hole_width??0)*Math.abs(n.a),v=(p.hole_height??0)*Math.abs(n.a),P=I/2,M=v/2;return{name:"ellipse",type:"element",attributes:{class:"pcb-hole-inner",fill:o.drill,cx:x.toString(),cy:C.toString(),rx:P.toString(),ry:M.toString(),"data-type":"pcb_plated_hole_drill","data-pcb-layer":"drill"},value:"",children:[]}}if(p.hole_shape==="pill"||p.hole_shape==="rotated_pill"){let I=(p.hole_width??0)*Math.abs(n.a),v=(p.hole_height??0)*Math.abs(n.a),P=I>v,M=Math.min(I,v)/2,B=Math.abs(P?I-v:v-I),T=P?`M${-B/2},${-M} h${B} a${M},${M} 0 0 1 0,${v} h-${B} a${M},${M} 0 0 1 0,-${v} z`:`M${-M},${-B/2} v${B} a${M},${M} 0 0 0 ${I},0 v-${B} a${M},${M} 0 0 0 -${I},0 z`;return{name:"path",type:"element",attributes:{class:"pcb-hole-inner",fill:o.drill,d:T,transform:`translate(${x} ${C})`,"data-type":"pcb_plated_hole_drill","data-pcb-layer":"drill"},value:"",children:[]}}return{name:"g",type:"element",attributes:{},value:"",children:[]}};return[{name:"g",type:"element",attributes:{"data-type":"pcb_plated_hole","data-pcb-layer":"through",...a},children:[{name:"polygon",type:"element",attributes:{class:"pcb-hole-outer-pad",fill:o.copper.top,points:y,"data-type":"pcb_plated_hole","data-pcb-layer":c},value:"",children:[]},b()],value:""}]}return[]}function zNr(e,t){let{transform:n,layer:o,colorMap:r}=t;if(!e.route||!Array.isArray(e.route))return[];let i=e.route.map((h,d)=>{let[u,_]=Pt(n,[h.x,h.y]);return d===0?`M ${u} ${_}`:`L ${u} ${_}`}).join(" "),s=e.route[0],a=e.route[e.route.length-1];if(s&&a&&s.x===a.x&&s.y===a.y)i+=" Z";let c=e.layer||"top";if(o&&c!==o)return[];let l=c==="bottom"?r.silkscreen.bottom:r.silkscreen.top;return[{name:"path",type:"element",attributes:{class:`pcb-silkscreen pcb-silkscreen-${c}`,d:i,fill:"none",stroke:l,"stroke-width":(e.stroke_width*Math.abs(n.a)).toString(),"stroke-linecap":"round","stroke-linejoin":"round","data-pcb-component-id":e.pcb_component_id,"data-pcb-silkscreen-path-id":e.pcb_silkscreen_path_id,"data-type":"pcb_silkscreen_path","data-pcb-layer":c},value:"",children:[]}]}function ONr(e,t){let{transform:n,layer:o,colorMap:r}=t,{layer:i="top"}=e;if(o&&i!==o)return[];if(e.shape!=="brep")return[];let s=i==="bottom"?r.silkscreen.bottom:r.silkscreen.top,a=EJ(e.brep_shape.outer_ring.vertices,n);for(let c of e.brep_shape.inner_rings??[])a+=` ${EJ(c.vertices,n)}`;return[{name:"path",type:"element",attributes:{class:`pcb-silkscreen pcb-silkscreen-${i}`,d:a,fill:s,"fill-rule":"evenodd",stroke:"none","data-pcb-component-id":e.pcb_component_id,"data-pcb-silkscreen-graphic-id":e.pcb_silkscreen_graphic_id,"data-type":"pcb_silkscreen_graphic","data-pcb-layer":i},value:"",children:[]}]}function __n(e){let{text:t,anchorAlignment:n,fontSize:o,charAdvance:r,spaceAdvance:i,trailingSpacing:s,lineHeight:a,mapSegment:c}=e,l=t.split(`
`),h=l.length*a,d=l.map((f)=>VNr(f,r,i,s)),u=[],_=-h/2;for(let f=0;f<l.length;f++){let y=l[f]??"",C=-(d[f]??0)/2;for(let b of y){if(b===" "){C+=i;continue}let I=d5[b];if(I)for(let v of I)u.push(c(v,C,_,o));C+=r}_+=a}let p=YNr(u);if(!p)return{pathData:"",bounds:null};let m=Pnt(n,p),A=WNr(u,m),g=XNr(p,m);return{pathData:jNr(A),bounds:g}}function VNr(e,t,n,o){let r=0;for(let i of e)r+=i===" "?n:t;return r>0?r-o:0}function YNr(e){if(e.length===0)return null;let{POSITIVE_INFINITY:t,POSITIVE_INFINITY:n,NEGATIVE_INFINITY:o,NEGATIVE_INFINITY:r}=Number;for(let i of e)t=Math.min(t,i.x1,i.x2),n=Math.min(n,i.y1,i.y2),o=Math.max(o,i.x1,i.x2),r=Math.max(r,i.y1,i.y2);return{minX:t,minY:n,maxX:o,maxY:r}}function Pnt(e,t){return{x:-GNr(e,t),y:-UNr(e,t)}}function GNr(e,t){if(e==="top_left"||e==="center_left"||e==="bottom_left")return t.minX;if(e==="top_right"||e==="center_right"||e==="bottom_right")return t.maxX;return(t.minX+t.maxX)/2}function UNr(e,t){if(e==="top_left"||e==="top_center"||e==="top_right")return t.minY;if(e==="bottom_left"||e==="bottom_center"||e==="bottom_right")return t.maxY;return(t.minY+t.maxY)/2}function WNr(e,t){if(t.x===0&&t.y===0)return e;return e.map((n)=>({x1:n.x1+t.x,y1:n.y1+t.y,x2:n.x2+t.x,y2:n.y2+t.y}))}function XNr(e,t){return{minX:e.minX+t.x,minY:e.minY+t.y,maxX:e.maxX+t.x,maxY:e.maxY+t.y}}function jNr(e){return e.map((t)=>`M${t.x1} ${t.y1}L${t.x2} ${t.y2}`).join(" ")}function KNr(e,t){let n=null,r=e.split(`
`).map((i,s)=>{let a=Array.from(i),c=-(a.length*A_n*t)/2,l=s*t*1.1;return a.forEach((h,d)=>{let u=bgn[h];if(!u)return;let _=c+d*A_n*t,p={minX:_+u.minX*t,maxX:_+u.maxX*t,minY:l+u.minY*t,maxY:l+u.maxY*t};n=n?{minX:Math.min(n.minX,p.minX),maxX:Math.max(n.maxX,p.maxX),minY:Math.min(n.minY,p.minY),maxY:Math.max(n.maxY,p.maxY)}:p}),{name:"tspan",type:"element",value:"",attributes:{x:c.toString(),y:l.toString()},children:[{name:"",type:"text",value:i,attributes:{},children:[]}]}});return{bounds:n,textNode:{name:"text",type:"element",value:"",attributes:{"font-family":MY,"font-size":t.toString(),"text-anchor":"start","dominant-baseline":"alphabetic","xml:space":"preserve",fill:"black",stroke:"none"},children:r}}}function qNr(e,t){let{transform:n,layer:o,colorMap:r}=t,{anchor_position:i,text:s,font_size:a=1,layer:c="top",ccw_rotation:l=0,anchor_alignment:h="center",is_knockout:d=!1,knockout_padding:u,is_mirrored:_=!1}=e;if(o&&c!==o)return[];if(!i||typeof i.x!=="number"||typeof i.y!=="number")return Km(`[pcb_silkscreen_text] Invalid anchor_position for "${e.pcb_silkscreen_text_id}": expected {x: number, y: number}, got ${JSON.stringify(i)}`),[];if(!s)return[];let[p,m]=Pt(n,[i.x,i.y]),A=Math.abs(n.a),g=c==="bottom"?r.silkscreen.bottom:r.silkscreen.top,y=c==="bottom"?!0:_===!0;if(d){let M=KNr(s,a);if(!M.bounds)return[];let B=u?.left??a*0.5,T=u?.right??a*0.5,N=u?.top??a*0.3,D=u?.bottom??a*0.3,L=M.bounds.minX-B,H=M.bounds.minY-N,V=M.bounds.maxX-M.bounds.minX+B+T,O=M.bounds.maxY-M.bounds.minY+N+D,U={minX:L,minY:H,maxX:L+V,maxY:H+O},j=Pnt(h,U),Y=L+j.x,X=H+j.y,K=[{name:"rect",type:"element",value:"",attributes:{x:L.toString(),y:H.toString(),width:V.toString(),height:O.toString(),fill:"white"},children:[]},M.textNode],ee=j.x!==0||j.y!==0?[{name:"g",type:"element",value:"",attributes:{transform:`translate(${j.x} ${j.y})`},children:K}]:K,se=p2(Ts(Rc(p,m),qg(-l*Math.PI/180),...y?[Lu(-1,1)]:[],Lu(A,A))),ne=`silkscreen-knockout-mask-${e.pcb_silkscreen_text_id}-${$Nr++}`;return[{name:"defs",type:"element",value:"",children:[{name:"mask",type:"element",value:"",attributes:{id:ne},children:ee}],attributes:{}},{name:"rect",type:"element",value:"",children:[],attributes:{x:Y.toString(),y:X.toString(),width:V.toString(),height:O.toString(),fill:g,mask:`url(#${ne})`,transform:se,class:`pcb-silkscreen-text-knockout pcb-silkscreen-${c}`,"data-type":"pcb_silkscreen_text","data-pcb-silkscreen-text-id":e.pcb_silkscreen_text_id,"data-pcb-layer":c}}]}let x=a*A,C="middle",b="central";switch(h){case"top_left":C="start",b="text-before-edge";break;case"top_center":C="middle",b="text-before-edge";break;case"top_right":C="end",b="text-before-edge";break;case"center_left":C="start",b="central";break;case"center_right":C="end",b="central";break;case"bottom_left":C="start",b="text-after-edge";break;case"bottom_center":C="middle",b="text-after-edge";break;case"bottom_right":C="end",b="text-after-edge";break;case"center":default:C="middle",b="central";break}let I=Ts(Rc(p,m),qg(-l*Math.PI/180),...y?[Lu(-1,1)]:[]),v=s.split(`
`),P=v.length===1?[{type:"text",value:s,name:"",attributes:{},children:[]}]:v.map((M,B)=>({type:"element",name:"tspan",value:"",attributes:{x:"0",...B>0?{dy:x.toString()}:{}},children:[{type:"text",value:M,name:"",attributes:{},children:[]}]}));return[{name:"text",type:"element",attributes:{x:"0",y:"0",dx:"0",dy:"0",fill:g,"font-family":MY,"font-size":x.toString(),"text-anchor":C,"dominant-baseline":b,transform:p2(I),class:`pcb-silkscreen-text pcb-silkscreen-${c}`,"data-pcb-silkscreen-text-id":e.pcb_silkscreen_text_id,stroke:"none","data-type":"pcb_silkscreen_text","data-pcb-layer":c},children:P,value:""}]}function JNr(e,t){let{transform:n,layer:o,colorMap:r}=t,{center:i,width:s,height:a,layer:c="top",pcb_silkscreen_rect_id:l,stroke_width:h,is_filled:d,has_stroke:u,is_stroke_dashed:_,corner_radius:p,ccw_rotation:m=0}=e;if(o&&c!==o)return[];if(!i||typeof i.x!=="number"||typeof i.y!=="number"||typeof s!=="number"||typeof a!=="number")return Km(`[pcb_silkscreen_rect] Invalid data for "${l}": expected center {x: number, y: number}, width: number, height: number, got center=${JSON.stringify(i)}, width=${JSON.stringify(s)}, height=${JSON.stringify(a)}`),[];let[A,g]=Pt(n,[i.x,i.y]),f=typeof p==="number"&&p>0?p:0,y=f*Math.abs(n.a),x=f*Math.abs(n.d),C=s*Math.abs(n.a),b=a*Math.abs(n.d),I=h*Math.abs(n.a),v=c==="bottom"?r.silkscreen.bottom:r.silkscreen.top,P={x:(-C/2).toString(),y:(-b/2).toString(),width:C.toString(),height:b.toString(),class:`pcb-silkscreen-rect pcb-silkscreen-${c}`,"data-pcb-silkscreen-rect-id":l,"data-type":"pcb_silkscreen_rect","data-pcb-layer":c};if(typeof m==="number"&&m!==0)P.transform=`translate(${A} ${g}) rotate(${-m})`;else P.x=(A-C/2).toString(),P.y=(g-b/2).toString();if(y>0)P.rx=y.toString();if(x>0)P.ry=x.toString();P.fill=d?v:"none";let M;if(u===void 0)M=I>0;else M=u;if(M){if(P.stroke=v,P["stroke-width"]=I.toString(),_){let T=0.1*Math.abs(n.a),N=0.05*Math.abs(n.a);P["stroke-dasharray"]=`${T} ${N}`}}else P.stroke="none";return[{name:"rect",type:"element",attributes:P,value:"",children:[]}]}function eRr(e,t){let{transform:n,layer:o,colorMap:r}=t,{anchor_position:i,text:s,font_size:a="0.2mm",layer:c,ccw_rotation:l=0,anchor_alignment:h="center",is_knockout:d=!1,knockout_padding:u,is_mirrored:_=!1}=e,p=c??"top";if(o&&o!==p)return[];if(!i)return[];if(!s)return[];let[m,A]=Pt(n,[i.x,i.y]),g=Ke.parse(a)??0.2,f=Math.abs(n.a),y=hx(p,r),C=p==="bottom"?!0:_===!0;if(d){let M=g*y_n,B=__n({text:s,anchorAlignment:h,fontSize:M,charAdvance:(wIe+yJ)*M,spaceAdvance:(wIe+yJ)*M*0.6,trailingSpacing:yJ*M,lineHeight:M*f_n,mapSegment:(te,ie,le,ue)=>({x1:ie+te.x1*ue,y1:le+(1-te.y1)*ue,x2:ie+te.x2*ue,y2:le+(1-te.y2)*ue})});if(!B.bounds||!B.pathData)return[];let T=u?.left??M*0.5,N=u?.right??M*0.5,D=u?.top??M*0.3,L=u?.bottom??M*0.3,H=B.bounds.minX-T,V=B.bounds.minY-D,O=B.bounds.maxX-B.bounds.minX+T+N,U=B.bounds.maxY-B.bounds.minY+D+L,j=M*0.15,Y={minX:H,minY:V,maxX:H+O,maxY:V+U},X=Pnt(h,Y),K=H+X.x,J=V+X.y,ee=[{name:"rect",type:"element",value:"",attributes:{x:H.toString(),y:V.toString(),width:O.toString(),height:U.toString(),fill:"white"},children:[]},{name:"path",type:"element",value:"",attributes:{d:B.pathData,fill:"none",stroke:"black","stroke-width":j.toString(),"stroke-linecap":"round","stroke-linejoin":"round"},children:[]}],ne=X.x!==0||X.y!==0?[{name:"g",type:"element",value:"",attributes:{transform:`translate(${X.x} ${X.y})`},children:ee}]:ee,re=p2(Ts(Rc(m,A),qg(-l*Math.PI/180),...C?[Lu(-1,1)]:[],Lu(f,f))),Z=`knockout-mask-${e.pcb_copper_text_id}-${ZNr++}`;return[{name:"defs",type:"element",value:"",children:[{name:"mask",type:"element",value:"",attributes:{id:Z},children:ne}],attributes:{}},{name:"rect",type:"element",value:"",children:[],attributes:{x:K.toString(),y:J.toString(),width:O.toString(),height:U.toString(),fill:y,mask:`url(#${Z})`,transform:re,class:`pcb-copper-text-knockout pcb-copper-${p}`,"data-type":"pcb_copper_text","data-pcb-copper-text-id":e.pcb_copper_text_id}}]}let b=g*y_n,I=__n({text:s,anchorAlignment:h,fontSize:b,charAdvance:(wIe+yJ)*b,spaceAdvance:(wIe+yJ)*b*0.6,trailingSpacing:yJ*b,lineHeight:b*f_n,mapSegment:(M,B,T,N)=>({x1:B+M.x1*N,y1:T+(1-M.y1)*N,x2:B+M.x2*N,y2:T+(1-M.y2)*N})});if(!I.pathData)return[];let v=p2(Ts(Rc(m,A),qg(-l*Math.PI/180),...C?[Lu(-1,1)]:[],Lu(f,f))),P=b*0.15;return[{name:"path",type:"element",attributes:{d:I.pathData,fill:"none",stroke:y,"stroke-width":P.toString(),"stroke-linecap":"round","stroke-linejoin":"round",transform:v,class:`pcb-copper-text pcb-copper-${p}`,"data-type":"pcb_copper_text","data-pcb-copper-text-id":e.pcb_copper_text_id},children:[],value:""}]}function tRr(e,t){let{transform:n,layer:o,colorMap:r}=t,{center:i,radius:s,layer:a="top",pcb_silkscreen_circle_id:c,stroke_width:l=1,is_filled:h}=e;if(o&&a!==o)return[];if(!i||typeof i.x!=="number"||typeof i.y!=="number"||typeof s!=="number")return console.error("Invalid PCB Silkscreen Circle data:",{center:i,radius:s}),[];let[d,u]=Pt(n,[i.x,i.y]),_=s*Math.abs(n.a),p=l*Math.abs(n.a),m=a==="bottom"?r.silkscreen.bottom:r.silkscreen.top;return[{name:"circle",type:"element",attributes:{cx:d.toString(),cy:u.toString(),r:_.toString(),class:`pcb-silkscreen-circle pcb-silkscreen-${a}`,fill:h?m:"none",stroke:m,"stroke-width":p.toString(),"data-pcb-silkscreen-circle-id":c,"data-type":"pcb_silkscreen_circle","data-pcb-layer":a},value:"",children:[]}]}function nRr(e,t){let{transform:n,layer:o,colorMap:r}=t,{x1:i,y1:s,x2:a,y2:c,stroke_width:l,layer:h="top",pcb_silkscreen_line_id:d}=e;if(o&&h!==o)return[];if(typeof i!=="number"||typeof s!=="number"||typeof a!=="number"||typeof c!=="number")return Km(`[pcb_silkscreen_line] Invalid coordinates for "${d}": expected x1, y1, x2, y2 as numbers, got x1=${JSON.stringify(i)}, y1=${JSON.stringify(s)}, x2=${JSON.stringify(a)}, y2=${JSON.stringify(c)}`),[];let[u,_]=Pt(n,[i,s]),[p,m]=Pt(n,[a,c]),A=l*Math.abs(n.a),g=h==="bottom"?r.silkscreen.bottom:r.silkscreen.top;return[{name:"line",type:"element",attributes:{x1:u.toString(),y1:_.toString(),x2:p.toString(),y2:m.toString(),stroke:g,"stroke-width":A.toString(),class:`pcb-silkscreen-line pcb-silkscreen-${h}`,"data-pcb-silkscreen-line-id":d,"data-type":"pcb_silkscreen_line","data-pcb-layer":h},value:"",children:[]}]}function oRr(e,t){let{transform:n,layer:o,colorMap:r}=t,{center:i,width:s,height:a,layer:c="top",pcb_silkscreen_pill_id:l,ccw_rotation:h=0}=e;if(o&&c!==o)return[];let[d,u]=Pt(n,[i.x,i.y]),_=s*Math.abs(n.a),p=a*Math.abs(n.d),A=Math.min(s,a)/2,g=A*Math.abs(n.a),f=A*Math.abs(n.d),y=c==="bottom"?r.silkscreen.bottom:r.silkscreen.top;return[{name:"rect",type:"element",attributes:{x:(d-_/2).toString(),y:(u-p/2).toString(),width:_.toString(),height:p.toString(),rx:g.toString(),ry:f.toString(),fill:"none",stroke:y,"stroke-width":(0.1*Math.abs(n.a)).toString(),class:`pcb-silkscreen-pill pcb-silkscreen-${c}`,"data-pcb-silkscreen-pill-id":l,"data-type":"pcb_silkscreen_pill","data-pcb-layer":c,...h!==0&&{transform:`rotate(${-h} ${d} ${u})`}},value:"",children:[]}]}function rRr(e,t){let{transform:n,layer:o,colorMap:r}=t,{center:i,radius_x:s,radius_y:a,layer:c="top",pcb_silkscreen_oval_id:l,ccw_rotation:h=0}=e;if(o&&c!==o)return[];if(!i||typeof i.x!=="number"||typeof i.y!=="number"||typeof s!=="number"||typeof a!=="number")return Km(`[pcb_silkscreen_oval] Invalid data for "${l}": expected center {x: number, y: number}, radius_x: number, radius_y: number, got center=${JSON.stringify(i)}, radius_x=${JSON.stringify(s)}, radius_y=${JSON.stringify(a)}`),[];let[d,u]=Pt(n,[i.x,i.y]),_=s*Math.abs(n.a),p=a*Math.abs(n.d),m=c==="bottom"?r.silkscreen.bottom:r.silkscreen.top;return[{name:"ellipse",type:"element",attributes:{cx:d.toString(),cy:u.toString(),rx:_.toString(),ry:p.toString(),fill:"none",stroke:m,"stroke-width":(0.1*Math.abs(n.a)).toString(),class:`pcb-silkscreen-oval pcb-silkscreen-${c}`,"data-pcb-silkscreen-oval-id":l,"data-type":"pcb_silkscreen_oval","data-pcb-layer":c,...h!==0&&{transform:`rotate(${-h} ${d} ${u})`}},value:"",children:[]}]}function iRr(e,t){let{transform:n,layer:o,colorMap:r}=t,{center:i,width:s,height:a,layer:c="top",pcb_courtyard_rect_id:l,ccw_rotation:h=0}=e;if(o&&c!==o)return[];if(!i||typeof i.x!=="number"||typeof i.y!=="number"||typeof s!=="number"||typeof a!=="number")return Km(`[pcb_courtyard_rect] Invalid data for "${l}": expected center {x: number, y: number}, width: number, height: number, got center=${JSON.stringify(i)}, width=${JSON.stringify(s)}, height=${JSON.stringify(a)}`),[];let[d,u]=Pt(n,[i.x,i.y]),_=s*Math.abs(n.a),p=a*Math.abs(n.d),m=0.05*Math.abs(n.a),A=c==="bottom"?r.courtyard.bottom:r.courtyard.top,g={x:(-_/2).toString(),y:(-p/2).toString(),width:_.toString(),height:p.toString(),class:`pcb-courtyard-rect pcb-courtyard-${c}`,"data-pcb-courtyard-rect-id":l,"data-type":"pcb_courtyard_rect","data-pcb-layer":c,"stroke-linejoin":"round"};if(typeof h==="number"&&h!==0)g.transform=`translate(${d} ${u}) rotate(${-h})`;else g.x=(d-_/2).toString(),g.y=(u-p/2).toString();return g.fill="none",g.stroke=A,g["stroke-width"]=m.toString(),[{name:"rect",type:"element",attributes:g,value:"",children:[]}]}function sRr(e,t){let{transform:n,layer:o,colorMap:r}=t,{layer:i="top",pcb_courtyard_polygon_id:s,points:a,color:c}=e;if(o&&i!==o)return[];if(!a||a.length===0)return Km(`[pcb_courtyard_polygon] Invalid data for "${s}": expected non-empty array of points, got ${JSON.stringify(a)}`),[];let h=a.map((m)=>Pt(n,[m.x,m.y])).map((m)=>`${m[0]},${m[1]}`).join(" "),d=0.05*Math.abs(n.a),u=c??(i==="bottom"?r.courtyard.bottom:r.courtyard.top);return[{name:"polygon",type:"element",attributes:{points:h,class:`pcb-courtyard-polygon pcb-courtyard-${i}`,"data-pcb-courtyard-polygon-id":s,"data-type":"pcb_courtyard_polygon","data-pcb-layer":i,fill:"none",stroke:u,"stroke-width":d.toString(),"stroke-linejoin":"round"},value:"",children:[]}]}function aRr(e,t){let{transform:n,layer:o,colorMap:r}=t,{layer:i,pcb_courtyard_outline_id:s,outline:a}=e;if(o&&i!==o)return[];if(!a||a.length===0)return Km(`[pcb_courtyard_outline] Invalid data for "${s}": expected non-empty array of points, got ${JSON.stringify(a)}`),[];let l=a.map((p)=>Pt(n,[p.x,p.y])).map((p)=>`${p[0]},${p[1]}`).join(" "),h=0.05*Math.abs(n.a),d=i==="bottom"?r.courtyard.bottom:r.courtyard.top;return[{name:"polygon",type:"element",attributes:{points:l,class:`pcb-courtyard-outline pcb-courtyard-${i}`,"data-pcb-courtyard-outline-id":s,"data-type":"pcb_courtyard_outline","data-pcb-layer":i,fill:"none",stroke:d,"stroke-width":h.toString(),"stroke-linejoin":"round"},value:"",children:[]}]}function cRr(e,t){let{transform:n,layer:o,colorMap:r}=t,{center:i,radius:s,layer:a="top",pcb_courtyard_circle_id:c}=e;if(o&&a!==o)return[];if(!i||typeof i.x!=="number"||typeof i.y!=="number"||typeof s!=="number")return console.error(`[pcb_courtyard_circle] Invalid data for "${c}": expected center {x: number, y: number}, radius: number, got center=${JSON.stringify(i)}, radius=${JSON.stringify(s)}`),[];let[l,h]=Pt(n,[i.x,i.y]),d=s*Math.abs(n.a),u=0.05*Math.abs(n.a),_=a==="bottom"?r.courtyard.bottom:r.courtyard.top,p={cx:l.toString(),cy:h.toString(),r:d.toString(),class:`pcb-courtyard-circle pcb-courtyard-${a}`,"data-pcb-courtyard-circle-id":c,"data-type":"pcb_courtyard_circle","data-pcb-layer":a};return p.fill="none",p.stroke=_,p["stroke-width"]=u.toString(),[{name:"circle",type:"element",attributes:p,value:"",children:[]}]}function Ent(e){let{groupAnchorPosition:t,componentPosition:n,transform:o,componentWidth:r=0,componentHeight:i=0,displayXOffset:s,displayYOffset:a}=e,c=[],[l,h]=Pt(o,[t.x,t.y]),[d,u]=Pt(o,[n.x,n.y]),_=n.x-t.x,p=n.y-t.y,m=Math.abs(o.a),A=r*m,g=i*m;c.push(mRr(l,h));let f=pRr(l,h,d,u);c.push({name:"line",type:"element",attributes:{x1:f.x1.toString(),y1:f.y1.toString(),x2:f.x2.toString(),y2:f.y2.toString(),stroke:"#ffffff","stroke-width":"0.5","stroke-dasharray":"3,3",opacity:"0.5",class:"anchor-offset-connector"},children:[],value:""}),c.push({name:"circle",type:"element",attributes:{cx:d.toString(),cy:u.toString(),r:vgn.toString(),fill:"#ffffff",opacity:"0.7",class:"anchor-offset-component-marker"},children:[],value:""});let y=Math.abs(u-h),x=Math.abs(d-l),C=Math.sqrt(x*x+y*y),b=g/2+lRr,I=Math.max(b,Math.min(uRr,C*dRr)),v=p>0?u-I:u+I,P=A/2+hRr,M=_>0?d+P:d-P;if(BIe(v,h)||BIe(v,u)){let B=Math.min(h,u),T=Math.max(h,u),N=B-jhe,D=T+jhe;v=Math.abs(v-N)<Math.abs(v-D)?N:D}if(BIe(M,l)||BIe(M,d)){let B=Math.min(l,d),T=Math.max(l,d),N=B-jhe,D=T+jhe;M=Math.abs(M-N)<Math.abs(M-D)?N:D}if(Math.abs(_)>x_n)c.push(..._Rr({startX:l,endX:d,y:v,offsetMm:_,offsetY:p,displayOffset:s}));if(Math.abs(p)>x_n)c.push(...gRr({x:M,startY:h,endY:u,offsetMm:p,offsetX:_,displayOffset:a}));return c}function pRr(e,t,n,o){let r=n-e,i=o-t,s=Math.hypot(r,i),a=ent+tnt;if(!(s>a))return{x1:e,y1:t,x2:n,y2:o};let c=r/s,l=i/s;return{x1:e+c*ent,y1:t+l*ent,x2:n-c*tnt,y2:o-l*tnt}}function BIe(e,t){return Math.abs(e-t)<jhe}function mRr(e,t){return{name:"g",type:"element",attributes:{class:"anchor-offset-marker","data-type":"anchor_offset_marker"},children:[{name:"line",type:"element",attributes:{x1:e.toString(),y1:(t-CJ).toString(),x2:e.toString(),y2:(t+CJ).toString(),stroke:"#ffffff","stroke-width":b_n.toString(),"stroke-linecap":"round"},children:[],value:""},{name:"line",type:"element",attributes:{x1:(e-CJ).toString(),y1:t.toString(),x2:(e+CJ).toString(),y2:t.toString(),stroke:"#ffffff","stroke-width":b_n.toString(),"stroke-linecap":"round"},children:[],value:""}],value:""}}function _Rr({startX:e,endX:t,y:n,offsetMm:o,offsetY:r,displayOffset:i}){let s=[];s.push({name:"line",type:"element",attributes:{x1:e.toString(),y1:n.toString(),x2:t.toString(),y2:n.toString(),stroke:"#ffffff","stroke-width":vJ.toString(),class:"anchor-offset-dimension-x"},children:[],value:""}),s.push({name:"line",type:"element",attributes:{x1:e.toString(),y1:(n-O3).toString(),x2:e.toString(),y2:(n+O3).toString(),stroke:"#ffffff","stroke-width":vJ.toString()},children:[],value:""}),s.push({name:"line",type:"element",attributes:{x1:t.toString(),y1:(n-O3).toString(),x2:t.toString(),y2:(n+O3).toString(),stroke:"#ffffff","stroke-width":vJ.toString()},children:[],value:""});let a=(e+t)/2,c=r>0?n-O3-C_n:n+O3+C_n;return s.push({name:"text",type:"element",attributes:{x:a.toString(),y:c.toString(),fill:"#ffffff","font-size":Ign.toString(),"font-family":"Arial, sans-serif","text-anchor":"middle","dominant-baseline":r>0?"baseline":"hanging",class:"anchor-offset-label"},children:[{type:"text",value:Sgn("X",o,i),name:"",attributes:{},children:[]}],value:""}),s}function gRr({x:e,startY:t,endY:n,offsetMm:o,offsetX:r,displayOffset:i}){let s=[];s.push({name:"line",type:"element",attributes:{x1:e.toString(),y1:t.toString(),x2:e.toString(),y2:n.toString(),stroke:"#ffffff","stroke-width":vJ.toString(),class:"anchor-offset-dimension-y"},children:[],value:""}),s.push({name:"line",type:"element",attributes:{x1:(e-O3).toString(),y1:t.toString(),x2:(e+O3).toString(),y2:t.toString(),stroke:"#ffffff","stroke-width":vJ.toString()},children:[],value:""}),s.push({name:"line",type:"element",attributes:{x1:(e-O3).toString(),y1:n.toString(),x2:(e+O3).toString(),y2:n.toString(),stroke:"#ffffff","stroke-width":vJ.toString()},children:[],value:""});let a=(t+n)/2,c=r<0?e-O3-4:e+O3+4;return s.push({name:"text",type:"element",attributes:{x:c.toString(),y:a.toString(),fill:"#ffffff","font-size":Ign.toString(),"font-family":"Arial, sans-serif","text-anchor":r<0?"end":"start","dominant-baseline":"middle",class:"anchor-offset-label"},children:[{type:"text",value:Sgn("Y",o,i),name:"",attributes:{},children:[]}],value:""}),s}function Sgn(e,t,n){let o=typeof n==="string"?n:t.toFixed(2),i=typeof o==="string"&&o.trim().endsWith("mm")?"":"mm";return`${e}: ${o}${i}`}function Jhe(e){let t=e?.anchor_position??e?.center;if(t&&typeof t.x==="number"&&typeof t.y==="number")return{x:t.x,y:t.y};return}function Pgn(e,t){let{transform:n,colorMap:o,showSolderMask:r,circuitJson:i}=t,{width:s,height:a,center:c,outline:l,position_mode:h,anchor_position:d,display_offset_x:u,display_offset_y:_}=e,p;if(l&&Array.isArray(l)&&l.length>=3)p=l.map((A,g)=>{let[f,y]=Pt(n,[A.x,A.y]);return g===0?`M ${f} ${y}`:`L ${f} ${y}`}).join(" ");else{let A=s/2,g=a/2,f=Pt(n,[c.x-A,c.y-g]),y=Pt(n,[c.x+A,c.y-g]),x=Pt(n,[c.x+A,c.y+g]),C=Pt(n,[c.x-A,c.y+g]);p=`M ${f[0]} ${f[1]} L ${y[0]} ${y[1]} L ${x[0]} ${x[1]} L ${C[0]} ${C[1]}`}p+=" Z";let m=[];if(r){let g=(t.layer??"top")==="bottom"?"soldermask-bottom":"soldermask-top";m.push({name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-board-soldermask",d:p,fill:o.soldermask.top,"fill-opacity":"0.8",stroke:"none","data-type":"pcb_soldermask","data-pcb-layer":g}})}if(m.push({name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-board",d:p,fill:"none",stroke:o.boardOutline,"stroke-width":(0.1*Math.abs(n.a)).toString(),"data-type":"pcb_board","data-pcb-layer":"board"}}),t.showAnchorOffsets&&i&&h==="relative_to_panel_anchor"){let A=i.find((g)=>g.type==="pcb_panel");if(A){let g=Jhe(A);if(g)m.push(...Ent({groupAnchorPosition:g,componentPosition:d??c,transform:n,componentWidth:s,componentHeight:a,displayXOffset:u,displayYOffset:_}))}}return m}function ARr(e,t){let{transform:n,colorMap:o,showSolderMask:r}=t,i=Number(e.width),s=Number(e.height),a=e.center??{x:i/2,y:s/2},c=i/2,l=s/2,h=Pt(n,[a.x-c,a.y-l]),d=Pt(n,[a.x+c,a.y-l]),u=Pt(n,[a.x+c,a.y+l]),_=Pt(n,[a.x-c,a.y+l]),p=`M ${h[0]} ${h[1]} L ${d[0]} ${d[1]} L ${u[0]} ${u[1]} L ${_[0]} ${_[1]} Z`,m=e.covered_with_solder_mask!==!1,A=Boolean(r&&m);return[{name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-panel",d:p,fill:"none",stroke:o.boardOutline,"stroke-width":(0.1*Math.abs(n.a)).toString(),"data-type":"pcb_panel","data-pcb-layer":"board"}}]}function fRr(e,t){let{transform:n,colorMap:o,showSolderMask:r}=t,i=t.layer??"top",[s,a]=Pt(n,[e.x,e.y]),c=Boolean(e.is_covered_with_solder_mask),l=(e.soldermask_margin??0)*Math.abs(n.a),h=r&&c&&l!==0,d=o.soldermask.top;if(e.hole_shape==="circle"||e.hole_shape==="square"){let u=e.hole_diameter*Math.abs(n.a),_=u/2;if(e.hole_shape==="circle"){let g={name:"circle",type:"element",attributes:{class:"pcb-hole",cx:s.toString(),cy:a.toString(),r:_.toString(),fill:o.drill,"data-type":"pcb_hole","data-pcb-layer":"drill"},children:[],value:""};if(!h)return[g];let f=_+l;if(l<0){let x={name:"circle",type:"element",value:"",children:[],attributes:{class:"pcb-hole-covered",fill:d,cx:s.toString(),cy:a.toString(),r:_.toString(),"data-type":"pcb_hole","data-pcb-layer":"drill"}},C={name:"circle",type:"element",value:"",children:[],attributes:{class:"pcb-hole-exposed",fill:o.drill,cx:s.toString(),cy:a.toString(),r:f.toString(),"data-type":"pcb_soldermask","data-pcb-layer":"drill"}};return[x,C]}return[{name:"circle",type:"element",value:"",children:[],attributes:{class:"pcb-soldermask-cutout",fill:o.substrate,cx:s.toString(),cy:a.toString(),r:f.toString(),"data-type":"pcb_soldermask_opening","data-pcb-layer":i}},g]}let p={name:"rect",type:"element",attributes:{class:"pcb-hole",x:(s-_).toString(),y:(a-_).toString(),width:u.toString(),height:u.toString(),fill:o.drill,"data-type":"pcb_hole","data-pcb-layer":"drill"},children:[],value:""};if(!h)return[p];let m=u+2*l;if(l<0){let g={name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-hole-covered",fill:d,x:(s-_).toString(),y:(a-_).toString(),width:u.toString(),height:u.toString(),"data-type":"pcb_hole","data-pcb-layer":"drill"}},f={name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-hole-exposed",fill:o.drill,x:(s-m/2).toString(),y:(a-m/2).toString(),width:m.toString(),height:m.toString(),"data-type":"pcb_soldermask","data-pcb-layer":"drill"}};return[g,f]}return[{name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-soldermask-cutout",fill:o.substrate,x:(s-m/2).toString(),y:(a-m/2).toString(),width:m.toString(),height:m.toString(),"data-type":"pcb_soldermask_opening","data-pcb-layer":i}},p]}if(e.hole_shape==="oval"){let u=e.hole_width*Math.abs(n.a),_=e.hole_height*Math.abs(n.a),p=u/2,m=_/2,A={name:"ellipse",type:"element",attributes:{class:"pcb-hole",cx:s.toString(),cy:a.toString(),rx:p.toString(),ry:m.toString(),fill:o.drill,"data-type":"pcb_hole","data-pcb-layer":"drill"},children:[],value:""};if(!h)return[A];let g=p+l,f=m+l;if(l<0){let x={name:"ellipse",type:"element",value:"",children:[],attributes:{class:"pcb-hole-covered",fill:d,cx:s.toString(),cy:a.toString(),rx:p.toString(),ry:m.toString(),"data-type":"pcb_hole","data-pcb-layer":"drill"}},C={name:"ellipse",type:"element",value:"",children:[],attributes:{class:"pcb-hole-exposed",fill:o.drill,cx:s.toString(),cy:a.toString(),rx:g.toString(),ry:f.toString(),"data-type":"pcb_soldermask","data-pcb-layer":"drill"}};return[x,C]}return[{name:"ellipse",type:"element",value:"",children:[],attributes:{class:"pcb-soldermask-cutout",fill:o.substrate,cx:s.toString(),cy:a.toString(),rx:g.toString(),ry:f.toString(),"data-type":"pcb_soldermask_opening","data-pcb-layer":i}},A]}if(e.hole_shape==="rect"){let u=e.hole_width*Math.abs(n.a),_=e.hole_height*Math.abs(n.a),p={name:"rect",type:"element",attributes:{class:"pcb-hole",x:(s-u/2).toString(),y:(a-_/2).toString(),width:u.toString(),height:_.toString(),fill:o.drill,"data-type":"pcb_hole","data-pcb-layer":"drill"},children:[],value:""};if(!h)return[p];let m=u+2*l,A=_+2*l;if(l<0){let f={name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-hole-covered",fill:d,x:(s-u/2).toString(),y:(a-_/2).toString(),width:u.toString(),height:_.toString(),"data-type":"pcb_hole","data-pcb-layer":"drill"}},y={name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-hole-exposed",fill:o.drill,x:(s-m/2).toString(),y:(a-A/2).toString(),width:m.toString(),height:A.toString(),"data-type":"pcb_soldermask","data-pcb-layer":"drill"}};return[f,y]}return[{name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-soldermask-cutout",fill:o.substrate,x:(s-m/2).toString(),y:(a-A/2).toString(),width:m.toString(),height:A.toString(),"data-type":"pcb_soldermask_opening","data-pcb-layer":i}},p]}if(e.hole_shape==="pill"){let u=e.hole_width*Math.abs(n.a),_=e.hole_height*Math.abs(n.a),p=u>_,m=Math.min(u,_)/2,A=Math.abs(p?u-_:_-u),g=p?`M${s-A/2},${a-m} h${A} a${m},${m} 0 0 1 0,${_} h-${A} a${m},${m} 0 0 1 0,-${_} z`:`M${s-m},${a-A/2} v${A} a${m},${m} 0 0 0 ${u},0 v-${A} a${m},${m} 0 0 0 -${u},0 z`,f={name:"path",type:"element",attributes:{class:"pcb-hole",fill:o.drill,d:g,"data-type":"pcb_hole","data-pcb-layer":"drill"},children:[],value:""};if(!h)return[f];let y=u+2*l,x=_+2*l,C=y>x,b=Math.min(y,x)/2,I=Math.abs(C?y-x:x-y),v=C?`M${s-I/2},${a-b} h${I} a${b},${b} 0 0 1 0,${x} h-${I} a${b},${b} 0 0 1 0,-${x} z`:`M${s-b},${a-I/2} v${I} a${b},${b} 0 0 0 ${y},0 v-${I} a${b},${b} 0 0 0 -${y},0 z`;if(l<0){let M={name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-hole-covered",fill:d,d:g,"data-type":"pcb_hole","data-pcb-layer":"drill"}},B={name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-hole-exposed",fill:o.drill,d:v,"data-type":"pcb_soldermask","data-pcb-layer":"drill"}};return[M,B]}return[{name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-soldermask-cutout",fill:o.substrate,d:v,"data-type":"pcb_soldermask_opening","data-pcb-layer":i}},f]}if(e.hole_shape==="rotated_pill"){let u=e.hole_width*Math.abs(n.a),_=e.hole_height*Math.abs(n.a),p="ccw_rotation"in e?e.ccw_rotation??0:0,m=u>_,A=Math.min(u,_)/2,g=Math.abs(m?u-_:_-u),f=m?`M${-g/2},${-A} h${g} a${A},${A} 0 0 1 0,${_} h-${g} a${A},${A} 0 0 1 0,-${_} z`:`M${-A},${-g/2} v${g} a${A},${A} 0 0 0 ${u},0 v-${g} a${A},${A} 0 0 0 -${u},0 z`,y={name:"path",type:"element",attributes:{class:"pcb-hole",fill:o.drill,d:f,transform:`translate(${s} ${a}) rotate(${-p})`,"data-type":"pcb_hole","data-pcb-layer":"drill"},children:[],value:""};if(!h)return[y];let x=u+2*l,C=_+2*l,b=x>C,I=Math.min(x,C)/2,v=Math.abs(b?x-C:C-x),P=b?`M${-v/2},${-I} h${v} a${I},${I} 0 0 1 0,${C} h-${v} a${I},${I} 0 0 1 0,-${C} z`:`M${-I},${-v/2} v${v} a${I},${I} 0 0 0 ${x},0 v-${v} a${I},${I} 0 0 0 -${x},0 z`;if(l<0){let B={name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-hole-covered",fill:d,d:f,transform:`translate(${s} ${a}) rotate(${-p})`,"data-type":"pcb_hole","data-pcb-layer":"drill"}},T={name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-hole-exposed",fill:o.drill,d:P,transform:`translate(${s} ${a}) rotate(${-p})`,"data-type":"pcb_soldermask","data-pcb-layer":"drill"}};return[B,T]}return[{name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-soldermask-cutout",fill:o.substrate,d:P,"data-type":"pcb_soldermask_opening","data-pcb-layer":i}},y]}return[]}function CRr(e,t){let{transform:n}=t,o=Aa(e),r=e.filter((c)=>c.type==="pcb_port"),i=e.filter((c)=>c.type==="source_trace"),s=[];r.forEach((c,l)=>{let h=c.pcb_port_id;if(!h)return;let d=o.getNetConnectedToId(h);if(!d)return;let u=!1,_=Vo(e).source_port.getWhere({pcb_port_id:h});if(_&&_.source_port_id){let A=_.source_port_id;for(let g of i)if(Array.isArray(g.connected_source_port_ids)&&g.connected_source_port_ids.includes(A)&&Array.isArray(g.connected_source_net_ids)&&g.connected_source_net_ids.length>0){u=!0;break}}let p={x:c.x,y:c.y},m=xRr(p,d,o,e);if(!m)return;s.push({key:`${h}-${l}`,startPoint:p,endPoint:m,isInNet:u})});let a=[];for(let c of s){let l=Pt(n,[c.startPoint.x,c.startPoint.y]),h=Pt(n,[c.endPoint.x,c.endPoint.y]),d={x1:l[0].toString(),y1:l[1].toString(),x2:h[0].toString(),y2:h[1].toString(),stroke:"white","stroke-width":"1","stroke-dasharray":"6,6","data-type":"pcb_rats_nest","data-pcb-layer":"overlay"};a.push({name:"line",type:"element",attributes:d,value:"",children:[]})}return a}function bRr(e,t){let{transform:n,colorMap:o}=t;if(e.shape==="rect"){let r=e,[i,s]=Pt(n,[r.center.x,r.center.y]),a=r.width*Math.abs(n.a),c=r.height*Math.abs(n.d),l=-(r.rotation??0),{corner_radius:h}=r,d=typeof h==="number"&&h>0?h:0,u=d*Math.abs(n.a),_=d*Math.abs(n.d),p={class:"pcb-cutout pcb-cutout-rect",x:(-a/2).toString(),y:(-c/2).toString(),width:a.toString(),height:c.toString(),fill:o.drill,transform:p2(Ts(Rc(i,s),qg(l*Math.PI/180))),"data-type":"pcb_cutout","data-pcb-layer":"drill"};if(u>0)p.rx=u.toString();if(_>0)p.ry=_.toString();return[{name:"rect",type:"element",attributes:p,children:[],value:""}]}if(e.shape==="circle"){let r=e,[i,s]=Pt(n,[r.center.x,r.center.y]),a=r.radius*Math.abs(n.a);return[{name:"circle",type:"element",attributes:{class:"pcb-cutout pcb-cutout-circle",cx:i.toString(),cy:s.toString(),r:a.toString(),fill:o.drill,"data-type":"pcb_cutout","data-pcb-layer":"drill"},children:[],value:""}]}if(e.shape==="polygon"){let r=e;if(!r.points||r.points.length===0)return[];return[{name:"polygon",type:"element",attributes:{class:"pcb-cutout pcb-cutout-polygon",points:r.points.map((a)=>Pt(n,[a.x,a.y])).map((a)=>`${a[0]},${a[1]}`).join(" "),fill:o.drill,"data-type":"pcb_cutout","data-pcb-layer":"drill"},children:[],value:""}]}return[]}function IRr(e,t){let{transform:n,colorMap:o}=t;if(!e.route||!Array.isArray(e.route))return[];let r=e.route[0],i=e.route[e.route.length-1],s=r&&i&&r.x===i.x&&r.y===i.y;return[{name:"path",type:"element",attributes:{class:"pcb-cutout pcb-cutout-path",d:e.route.slice(0,s?-1:void 0).map((c,l)=>{let[h,d]=Pt(n,[c.x,c.y]);return l===0?`M ${h} ${d}`:`L ${h} ${d}`}).join(" ")+(s?" Z":""),fill:o.drill,"data-type":"pcb_cutout_path","data-pcb-cutout-id":e.pcb_cutout_id,"data-pcb-layer":"drill"},value:"",children:[]}]}function SRr(e){let t=[];for(let n=-bJ;n<=bJ;n+=vRr)t.push({name:"line",type:"element",value:"",attributes:{x1:n.toString(),y1:"0",x2:(n+bJ).toString(),y2:bJ.toString(),stroke:e,"stroke-width":"1"},children:[]});return t}function PRr(e){return{name:"defs",type:"element",value:"",attributes:{},children:[{name:"pattern",type:"element",value:"",attributes:{id:Mnt,width:bJ.toString(),height:bJ.toString(),patternUnits:"userSpaceOnUse"},children:SRr(e)}]}}function ont(e,t,n,o){let r={class:`pcb-keepout ${n} pcb-keepout-background`,"data-type":"pcb_keepout","data-pcb-layer":t,"data-pcb-keepout-id":e,stroke:"none"};if(o)r["data-description"]=o;return r}function rnt(e,t,n,o){let r={class:`pcb-keepout ${n} pcb-keepout-pattern`,fill:`url(#${Mnt})`,"data-type":"pcb_keepout","data-pcb-layer":t,"data-pcb-keepout-id":e,stroke:"none"};if(o)r["data-description"]=o;return r}function ERr(e,t){let{transform:n,layer:o,colorMap:r}=t;if(o&&!e.layers.includes(o))return[];let i=[],s=r.keepout;for(let a of e.layers){if(o&&a!==o)continue;if(e.shape==="rect"){let c=e,[l,h]=Pt(n,[c.center.x,c.center.y]),d=c.width*Math.abs(n.a),u=c.height*Math.abs(n.d),_=p2(Ts(Rc(l,h))),p={...ont(c.pcb_keepout_id,a,"pcb-keepout-rect",c.description),x:(-d/2).toString(),y:(-u/2).toString(),width:d.toString(),height:u.toString(),fill:nnt,transform:_},m={...rnt(c.pcb_keepout_id,a,"pcb-keepout-rect",c.description),x:(-d/2).toString(),y:(-u/2).toString(),width:d.toString(),height:u.toString(),transform:_};i.push({name:"rect",type:"element",attributes:p,children:[],value:""},{name:"rect",type:"element",attributes:m,children:[],value:""})}else if(e.shape==="circle"){let c=e,[l,h]=Pt(n,[c.center.x,c.center.y]),d=c.radius*Math.abs(n.a),u={...ont(c.pcb_keepout_id,a,"pcb-keepout-circle",c.description),cx:l.toString(),cy:h.toString(),r:d.toString(),fill:nnt},_={...rnt(c.pcb_keepout_id,a,"pcb-keepout-circle",c.description),cx:l.toString(),cy:h.toString(),r:d.toString()};i.push({name:"circle",type:"element",attributes:u,children:[],value:""},{name:"circle",type:"element",attributes:_,children:[],value:""})}else if(e.shape==="outline"){let c=e,l=c.outline.map((_,p)=>{let[m,A]=Pt(n,[_.x,_.y]);return p===0?`M ${m} ${A}`:`L ${m} ${A}`}).join(" "),h=c.stroke_width*Math.abs(n.a),d={...ont(c.pcb_keepout_id,a,"pcb-keepout-outline",c.description),d:l,fill:"none",stroke:nnt,"stroke-width":h.toString(),"stroke-linecap":"round","stroke-linejoin":"round"},u={...rnt(c.pcb_keepout_id,a,"pcb-keepout-outline",c.description),d:l,fill:"none",stroke:`url(#${Mnt})`,"stroke-width":h.toString(),"stroke-linecap":"round","stroke-linejoin":"round"};i.push({name:"path",type:"element",attributes:d,children:[],value:""},{name:"path",type:"element",attributes:u,children:[],value:""})}}return i}function MRr({elementType:e,shapeAttributes:t,layer:n,colorMap:o,additionalAttributes:r}){let i={class:"pcb-soldermask-cutout",fill:o.substrate,"data-type":"pcb_soldermask_opening","data-pcb-layer":n,...t,...r};return{name:e,type:"element",value:"",children:[],attributes:i}}function wRr(e,t){let{transform:n,layer:o,colorMap:r,showSolderMask:i}=t,{layer:s}=e;if(o&&s!==o)return[];let a=agn(e,n);if(!a)return[];let{elementType:c,shapeAttributes:l}=a,h=hx(s,r),d="0.5",u=e.covered_with_solder_mask!==!1,_=s==="bottom"?r.soldermaskOverCopper.bottom:r.soldermaskOverCopper.top,p="0.9",m={name:c,type:"element",value:"",children:[],attributes:{class:`pcb-copper-pour pcb-copper-pour-${e.shape}`,...l,fill:h,"fill-opacity":d,"data-type":"pcb_copper_pour","data-pcb-layer":s}},A=i?u?mnt({elementType:c,shapeAttributes:l,layer:s,fillColor:_,fillOpacity:p,className:"pcb-soldermask-covered-pour"}):MRr({elementType:c,shapeAttributes:l,layer:s,colorMap:r}):null;if(!A)return[m];if(!u&&e.pcb_copper_pour_id?.includes("substrate_only"))return[A];return[m,A]}function Egn(e,t){let{transform:n,layer:o}=t;if(o&&e.layer!==o)return[];if(e.shape==="polygon"){let s=EJ(e.points,n);for(let a of e.holes??[])s+=` ${EJ(a,n)}`;return[{name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-solder-paste",fill:SY(e.layer),d:s,"fill-rule":"evenodd","data-type":"pcb_solder_paste","data-pcb-layer":e.layer}}]}let[r,i]=Pt(n,[e.x,e.y]);if(e.shape==="rect"||e.shape==="rotated_rect"){let s=e.width*Math.abs(n.a),a=e.height*Math.abs(n.d);if(e.shape==="rotated_rect"&&e.ccw_rotation)return[{name:"rect",type:"element",attributes:{class:"pcb-solder-paste",fill:SY(e.layer),x:(-s/2).toString(),y:(-a/2).toString(),width:s.toString(),height:a.toString(),transform:`translate(${r} ${i}) rotate(${-e.ccw_rotation})`,"data-type":"pcb_solder_paste","data-pcb-layer":e.layer}}];return[{name:"rect",type:"element",attributes:{class:"pcb-solder-paste",fill:SY(e.layer),x:(r-s/2).toString(),y:(i-a/2).toString(),width:s.toString(),height:a.toString(),"data-type":"pcb_solder_paste","data-pcb-layer":e.layer}}]}if(e.shape==="pill"){let s=e.width*Math.abs(n.a),a=e.height*Math.abs(n.d),c=e.radius*Math.abs(n.a);return[{name:"rect",type:"element",attributes:{class:"pcb-solder-paste",fill:SY(e.layer),x:(r-s/2).toString(),y:(i-a/2).toString(),width:s.toString(),height:a.toString(),rx:c.toString(),"data-type":"pcb_solder_paste","data-pcb-layer":e.layer}}]}if(e.shape==="rotated_pill"){let s=e.width*Math.abs(n.a),a=e.height*Math.abs(n.d),c=e.radius*Math.abs(n.a);return[{name:"rect",type:"element",attributes:{class:"pcb-solder-paste",fill:SY(e.layer),x:(-s/2).toString(),y:(-a/2).toString(),width:s.toString(),height:a.toString(),rx:c.toString(),transform:`translate(${r} ${i}) rotate(${-e.ccw_rotation})`,"data-type":"pcb_solder_paste","data-pcb-layer":e.layer}}]}if(e.shape==="oval"){let s=e.width*Math.abs(n.a),a=e.height*Math.abs(n.d);return[{name:"ellipse",type:"element",attributes:{class:"pcb-solder-paste",fill:SY(e.layer),cx:r.toString(),cy:i.toString(),rx:(s/2).toString(),ry:(a/2).toString(),"data-type":"pcb_solder_paste","data-pcb-layer":e.layer}}]}if(e.shape==="circle"){let s=e.radius*Math.abs(n.a);return[{name:"circle",type:"element",attributes:{class:"pcb-solder-paste",fill:SY(e.layer),cx:r.toString(),cy:i.toString(),r:s.toString(),"data-type":"pcb_solder_paste","data-pcb-layer":e.layer}}]}}function TRr({grid:e,svgWidth:t,svgHeight:n}){if(!e)return{};let o=e.lineColor??BRr,{cellSize:r,majorCellSize:i}=e,s=e.majorLineColor??o;if(i!==void 0){if(!r||r<=0)throw Error("grid.majorCellSize requires a positive grid.cellSize");if(i<=0)throw Error("grid.majorCellSize must be a positive multiple of grid.cellSize");let d=i/r,u=Math.round(d);if(!Number.isFinite(d)||Math.abs(d-u)>0.000001)throw Error("grid.majorCellSize must be a positive multiple of grid.cellSize")}if(!r||r<=0)return{};let a=i!==void 0,c=a?DRr(r,i,o,s):[{name:"path",type:"element",value:"",attributes:{d:`M ${r} 0 L 0 0 0 ${r}`,fill:"none",stroke:o,"stroke-width":"1","shape-rendering":"crispEdges"},children:[]}],l={name:"defs",type:"element",value:"",attributes:{},children:[{name:"pattern",type:"element",value:"",attributes:{id:I_n,width:a?i.toString():r.toString(),height:a?i.toString():r.toString(),patternUnits:"userSpaceOnUse"},children:c}]},h={name:"rect",type:"element",value:"",attributes:{x:"0",y:"0",width:t.toString(),height:n.toString(),fill:`url(#${I_n})`,"pointer-events":"none","data-type":"pcb_grid","data-pcb-layer":"global"},children:[]};return{defs:l,rect:h}}function DRr(e,t,n,o){let r=[],i=Math.round(t/e);for(let s=0;s<i;s+=1){let c=Number((s*e).toFixed(6)).toString(),l=s===0?o:n,h=t.toString();r.push({name:"line",type:"element",value:"",attributes:{x1:c,y1:"0",x2:c,y2:h,stroke:l,"stroke-width":"1","shape-rendering":"crispEdges"},children:[]}),r.push({name:"line",type:"element",value:"",attributes:{x1:"0",y1:c,x2:h,y2:c,stroke:l,"stroke-width":"1","shape-rendering":"crispEdges"},children:[]})}return r}function NRr(e,t){let{transform:n,circuitJson:o}=t,{center:r,width:i,height:s,rotation:a=0}=e,[c,l]=Pt(n,[r.x,r.y]),h=i*Math.abs(n.a),d=s*Math.abs(n.d),u=`translate(${c}, ${l}) rotate(${-a}) scale(1, -1)`,_=[];if(t.showAnchorOffsets&&o&&e.position_mode==="relative_to_group_anchor"&&(e.positioned_relative_to_pcb_group_id||e.positioned_relative_to_pcb_board_id)){let p=RRr(e,o);if(p)_.push(...Ent({groupAnchorPosition:p,componentPosition:r,transform:n,componentWidth:i,componentHeight:s,displayXOffset:e.display_offset_x,displayYOffset:e.display_offset_y}))}if(!t.colorMap.debugComponent?.fill&&!t.colorMap.debugComponent?.stroke)return _;return _.push({name:"g",type:"element",attributes:{transform:u,"data-type":"pcb_component","data-pcb-layer":e.layer??"top"},children:[{name:"rect",type:"element",attributes:{class:"pcb-component",x:(-h/2).toString(),y:(-d/2).toString(),width:h.toString(),height:d.toString(),fill:t.colorMap.debugComponent.fill??"transparent",stroke:t.colorMap.debugComponent.stroke??"transparent","data-type":"pcb_component","data-pcb-layer":e.layer??"top"}}],value:""}),_}function RRr(e,t){if(e.positioned_relative_to_pcb_group_id){let n=t.find((r)=>r.type==="pcb_group"&&r.pcb_group_id===e.positioned_relative_to_pcb_group_id),o=Jhe(n);if(o)return o}if(e.positioned_relative_to_pcb_board_id){let n=t.find((r)=>r.type==="pcb_board"&&r.pcb_board_id===e.positioned_relative_to_pcb_board_id),o=Jhe(n);if(o)return o}return}function kRr(e,t){let{transform:n,circuitJson:o}=t,{center:r,width:i,height:s}=e,a=[];if(t.showAnchorOffsets&&e.position_mode==="relative_to_group_anchor"&&o){let v=HRr(e,o);if(v)a.push(...Ent({groupAnchorPosition:v,componentPosition:e.anchor_position??e.center,transform:n,componentWidth:e.width,componentHeight:e.height,displayXOffset:e.display_offset_x,displayYOffset:e.display_offset_y}))}let c=Array.isArray(e.outline)?e.outline:void 0,l=QRr*Math.abs(n.a),h=0.3*Math.abs(n.a),d=0.15*Math.abs(n.a),u={class:"pcb-group",fill:"none",stroke:LRr(e.pcb_group_id),"stroke-width":l.toString(),"stroke-dasharray":`${h} ${d}`,"data-type":"pcb_group","data-pcb-group-id":e.pcb_group_id,"data-pcb-layer":"overlay"};if(e.name)u["data-group-name"]=e.name;if(c&&c.length>=3&&c.every((v)=>v&&typeof v.x==="number"&&typeof v.y==="number")){let v=c.map((P,M)=>{let[B,T]=Pt(n,[P.x,P.y]);return M===0?`M ${B} ${T}`:`L ${B} ${T}`}).join(" ");return a.push({name:"path",type:"element",value:"",children:[],attributes:{...u,d:`${v} Z`}}),a}if(!r||typeof r.x!=="number"||typeof r.y!=="number"||typeof i!=="number"||typeof s!=="number")return Km(`[pcb_group] Invalid data for "${e.pcb_group_id}"${e.name?` (name: "${e.name}")`:""}: expected center {x: number, y: number}, width: number, height: number, got center=${JSON.stringify(r)}, width=${JSON.stringify(i)}, height=${JSON.stringify(s)}`),a;let _=i/2,p=s/2,[m,A]=Pt(n,[r.x-_,r.y+p]),[g,f]=Pt(n,[r.x+_,r.y-p]),y=Math.min(m,g),x=Math.min(A,f),C=Math.abs(g-m),b=Math.abs(f-A),I={name:"rect",type:"element",value:"",attributes:{...u,x:y.toString(),y:x.toString(),width:C.toString(),height:b.toString()},children:[]};return a.push(I),a}function LRr(e){let t=e.match(/(\d+)$/),n=t?Number.parseInt(t[1],10):0;return v_n[n%v_n.length]}function HRr(e,t){if(e.positioned_relative_to_pcb_group_id){let n=t.find((r)=>r.type==="pcb_group"&&r.pcb_group_id===e.positioned_relative_to_pcb_group_id),o=Jhe(n);if(o)return o}if(e.positioned_relative_to_pcb_board_id){let n=t.find((r)=>r.type==="pcb_board"&&r.pcb_board_id===e.positioned_relative_to_pcb_board_id),o=Jhe(n);if(o)return o}return}function Sk(e){return e.find((n)=>n.type==="project_software_metadata"||n.type==="source_project_metadata")?.software_used_string}function zRr({objects:e,layer:t,width:n,height:o,showSolderMask:r=!1}){let i=e.filter((h)=>h.attributes["data-pcb-layer"]===t&&(h.attributes.class==="pcb-pad"||h.attributes.class==="pcb-pad-exposed"||h.attributes["data-type"]==="pcb_soldermask_opening"));if(i.length===0)return null;let s=e.filter((h)=>h.attributes["data-type"]==="pcb_via").flatMap((h)=>h.children).filter((h)=>h.attributes.class==="pcb-via-tenting"||h.attributes.class==="pcb-via-tenting-hole"),a=e.filter((h)=>r&&h.attributes["data-pcb-layer"]===t&&(h.attributes["data-type"]==="pcb_copper_pour"||h.attributes.class==="pcb-soldermask-covered-pour")),c=i.filter((h)=>h.attributes.class==="pcb-pad"||h.attributes.class==="pcb-pad-exposed"),l=[];for(let{targets:h,cutouts:d,maskId:u}of[{targets:s,cutouts:i,maskId:`via-tenting-mask-${t}`},{targets:a,cutouts:c,maskId:`copper-pour-pad-opening-mask-${t}`}]){if(h.length===0||d.length===0)continue;for(let _ of h)_.attributes.mask=`url(#${u})`;l.push(ORr(u,d,n,o))}if(l.length===0)return null;return{name:"defs",type:"element",value:"",attributes:{},children:l}}function ORr(e,t,n,o){return{name:"mask",type:"element",value:"",attributes:{id:e,maskUnits:"userSpaceOnUse",x:"0",y:"0",width:String(n),height:String(o)},children:[{name:"rect",type:"element",value:"",attributes:{x:"0",y:"0",width:String(n),height:String(o),fill:"white"},children:[]},...t.map((r)=>({...r,attributes:{...r.attributes,fill:"black"}}))]}}function MJ(e,t="error_text_overlay"){let n=e.filter((i)=>i.type.endsWith("_error"));if(n.length===0)return null;let o=n.map((i)=>i.message).filter((i)=>!!i);if(o.length===0)return null;return{name:"text",type:"element",value:"",attributes:{x:"10",y:"20",fill:"red","font-family":"monospace","font-size":"12px","data-type":t,"data-layer":"global"},children:o.map((i,s)=>({name:"tspan",type:"element",value:"",attributes:{x:"10",dy:s===0?"0":"1.2em"},children:[{type:"text",value:i,name:"",attributes:{},children:[]}]}))}}function VRr({anchorPosition:e,textWidth:t,textHeight:n,anchorAlignment:o}){switch(o){case"top_left":return{x:e.x+t/2,y:e.y+n/2};case"top_center":return{x:e.x,y:e.y+n/2};case"top_right":return{x:e.x-t/2,y:e.y+n/2};case"center_left":return{x:e.x+t/2,y:e.y};case"center_right":return{x:e.x-t/2,y:e.y};case"bottom_left":return{x:e.x+t/2,y:e.y-n/2};case"bottom_center":return{x:e.x,y:e.y-n/2};case"bottom_right":return{x:e.x-t/2,y:e.y-n/2};case"center":default:return e}}function YRr(e){let{POSITIVE_INFINITY:t,POSITIVE_INFINITY:n,NEGATIVE_INFINITY:o,NEGATIVE_INFINITY:r}=Number,i=!1,{POSITIVE_INFINITY:s,POSITIVE_INFINITY:a,NEGATIVE_INFINITY:c,NEGATIVE_INFINITY:l}=Number,h=!1;for(let y of e)if(y.type==="pcb_panel"){let x=y,C=Ke.parse(x.width),b=Ke.parse(x.height);if(C===void 0||b===void 0)continue;let I=x.center??{x:C/2,y:b/2};d({center:I,width:C,height:b})}else if(y.type==="pcb_board"){if(y.outline&&Array.isArray(y.outline)&&y.outline.length>=3)_(y.outline),p(y.outline);else if("center"in y&&"width"in y&&"height"in y)d({center:y.center,width:y.width,height:y.height}),u({center:y.center,width:y.width,height:y.height})}else if(y.type==="pcb_courtyard_rect")d({center:y.center,width:y.width,height:y.height,ccwRotationDegrees:y.ccw_rotation});else if(y.type==="pcb_soldermask_opening")if(y.shape==="polygon")m(y.points);else if(y.shape==="circle")d({center:{x:y.x,y:y.y},width:y.radius*2,height:y.radius*2});else d({center:{x:y.x,y:y.y},width:y.width,height:y.height,ccwRotationDegrees:y.shape==="rotated_rect"?y.ccw_rotation:0});else if(y.type==="pcb_solder_paste"&&y.shape==="polygon")m(y.points);else if(y.type==="pcb_smtpad"){let x=y;if(x.shape==="rect"||x.shape==="pill")d({center:{x:x.x,y:x.y},width:x.width,height:x.height});else if(x.shape==="rotated_rect"||x.shape==="rotated_pill")d({center:{x:x.x,y:x.y},width:x.width,height:x.height,ccwRotationDegrees:x.ccw_rotation});else if(x.shape==="circle"){let C=Ke.parse(x.radius);if(C!==void 0)d({center:{x:x.x,y:x.y},width:C*2,height:C*2})}else if(x.shape==="polygon")m(x.points)}else if(y.type==="pcb_via"){let x=Ke.parse(y.outer_diameter);d({center:{x:y.x,y:y.y},width:x??0,height:x??0})}else if(y.type==="pcb_plated_hole"){let x=y,C={x:x.x,y:x.y};if(x.shape==="circle"){let b=Ke.parse(x.outer_diameter);d({center:C,width:b??0,height:b??0})}else if(x.shape==="oval"||x.shape==="pill")d({center:C,width:x.outer_width,height:x.outer_height});else if(x.shape==="circular_hole_with_rect_pad"||x.shape==="pill_hole_with_rect_pad")d({center:C,width:x.rect_pad_width,height:x.rect_pad_height});else if(x.shape==="rotated_pill_hole_with_rect_pad")d({center:C,width:x.rect_pad_width,height:x.rect_pad_height,ccwRotationDegrees:x.rect_ccw_rotation});else if(x.shape==="hole_with_polygon_pad")m((x.pad_outline??[]).map((b)=>({x:x.x+b.x,y:x.y+b.y})))}else if(y.type==="pcb_hole"){let x=y,C={x:x.x,y:x.y};if(x.hole_shape==="circle"||x.hole_shape==="square"){let b=Ke.parse(x.hole_diameter);d({center:C,width:b??0,height:b??0})}else if(x.hole_shape==="rotated_pill")d({center:C,width:x.hole_width,height:x.hole_height,ccwRotationDegrees:x.ccw_rotation});else if(x.hole_shape==="oval"||x.hole_shape==="rect"||x.hole_shape==="pill")d({center:C,width:x.hole_width,height:x.hole_height})}else if(y.type==="pcb_note_line")m([{x:y.x1,y:y.y1},{x:y.x2,y:y.y2}]);else if("x"in y&&"y"in y)d({center:{x:y.x,y:y.y},width:0,height:0});else if("route"in y)m(y.route);else if(y.type==="pcb_note_rect"||y.type==="pcb_fabrication_note_rect")d({center:y.center,width:y.width,height:y.height});else if(y.type==="pcb_note_dimension"||y.type==="pcb_fabrication_note_dimension"){let x=y,{from:C,to:b,text:I,font_size:v=1,arrow_size:P,offset_distance:M,offset_direction:B}=x;if(!C||!b||!P)continue;d({center:C,width:0,height:0}),d({center:b,width:0,height:0});let T=(le)=>{let ue=Math.hypot(le.x,le.y)||1;return{x:le.x/ue,y:le.y/ue}},N=T({x:b.x-C.x,y:b.y-C.y});if(Number.isNaN(N.x)||Number.isNaN(N.y))continue;let D={x:-N.y,y:N.x},L=B&&typeof B.x==="number"&&typeof B.y==="number",H=L?T(B):{x:0,y:0},V=typeof M==="number"?M:0,O={x:H.x*V,y:H.y*V},U={x:C.x+O.x,y:C.y+O.y},j={x:b.x+O.x,y:b.y+O.y};d({center:U,width:0,height:0}),d({center:j,width:0,height:0});let Y=L&&(Math.abs(H.x)>Number.EPSILON||Math.abs(H.y)>Number.EPSILON)?H:D,X=V+P,K={x:C.x+Y.x*X,y:C.y+Y.y*X},J={x:b.x+Y.x*X,y:b.y+Y.y*X};d({center:K,width:0,height:0}),d({center:J,width:0,height:0});let ee=P/2,se={x:U.x+N.x*P,y:U.y+N.y*P},ne={x:j.x-N.x*P,y:j.y-N.y*P},re={x:se.x+D.x*ee,y:se.y+D.y*ee},Z={x:se.x-D.x*ee,y:se.y-D.y*ee};d({center:re,width:0,height:0}),d({center:Z,width:0,height:0});let te={x:ne.x+D.x*ee,y:ne.y+D.y*ee},ie={x:ne.x-D.x*ee,y:ne.y-D.y*ee};if(d({center:te,width:0,height:0}),d({center:ie,width:0,height:0}),I){let le={x:(C.x+b.x)/2+O.x,y:(C.y+b.y)/2+O.y},ue=P*1.5,de={x:le.x+D.x*ue,y:le.y+D.y*ue},me=I.length*v*0.6;d({center:de,width:me,height:v})}}else if(y.type==="pcb_note_text"||y.type==="pcb_fabrication_note_text")g({text:y.text,anchorPosition:y.anchor_position,fontSize:y.font_size,anchorAlignment:y.anchor_alignment,ccwRotationDegrees:y.type==="pcb_fabrication_note_text"?y.ccw_rotation??1:0});else if(y.type==="pcb_cutout"){let x=y;if(x.shape==="rect")d({center:x.center,width:x.width,height:x.height,ccwRotationDegrees:x.rotation});else if(x.shape==="circle"){let C=Ke.parse(x.radius);if(C!==void 0)d({center:x.center,width:C*2,height:C*2})}else if(x.shape==="polygon")m(x.points);else if(x.shape==="path"){let C=x;if(C.route&&Array.isArray(C.route))m(C.route)}}else if(y.type==="pcb_keepout"){let x=y;if(x.shape==="rect")d({center:x.center,width:x.width,height:x.height});else if(x.shape==="circle"){let C=typeof x.radius==="number"?x.radius:Ke.parse(x.radius)??0;if(C>0)d({center:x.center,width:C*2,height:C*2})}else if(x.shape==="outline")for(let C of x.outline)d({center:C,width:x.stroke_width,height:x.stroke_width})}else if(y.type==="pcb_silkscreen_graphic"||y.type==="pcb_silkscreen_text"||y.type==="pcb_silkscreen_rect"||y.type==="pcb_silkscreen_circle"||y.type==="pcb_silkscreen_line"||y.type==="pcb_silkscreen_oval"||y.type==="pcb_silkscreen_pill")f(y);else if(y.type==="pcb_copper_text")d({center:y.anchor_position,width:0,height:0});else if(y.type==="pcb_copper_pour"){if(y.shape==="rect")d({center:y.center,width:y.width,height:y.height,ccwRotationDegrees:y.rotation});else if(y.shape==="polygon")m(y.points);else if(y.shape==="brep")m(y.brep_shape.outer_ring.vertices)}return{minX:t,minY:n,maxX:o,maxY:r,boardMinX:s,boardMinY:a,boardMaxX:c,boardMaxY:l,hasBounds:i,hasBoardBounds:h};function d({center:y,width:x,height:C,ccwRotationDegrees:b}){if(!y)return;let I=Ke.parse(y.x),v=Ke.parse(y.y);if(I===void 0||v===void 0)return;let P=Ke.parse(x)??0,M=Ke.parse(C)??0,B=P/2,T=M/2;if(typeof b==="number"&&b!==0){let N=b*Math.PI/180,D=Math.abs(Math.cos(N)),L=Math.abs(Math.sin(N)),H=B*D+T*L,V=B*L+T*D;B=H,T=V}t=Math.min(t,I-B),n=Math.min(n,v-T),o=Math.max(o,I+B),r=Math.max(r,v+T),i=!0}function u({center:y,width:x,height:C}){if(!y)return;let b=Ke.parse(y.x),I=Ke.parse(y.y);if(b===void 0||I===void 0)return;let v=Ke.parse(x)??0,P=Ke.parse(C)??0,M=v/2,B=P/2;s=Math.min(s,b-M),a=Math.min(a,I-B),c=Math.max(c,b+M),l=Math.max(l,I+B),i=!0,h=!0}function _(y){let x=!1;for(let C of y){let b=Ke.parse(C.x),I=Ke.parse(C.y);if(b===void 0||I===void 0)continue;t=Math.min(t,b),n=Math.min(n,I),o=Math.max(o,b),r=Math.max(r,I),x=!0}if(x)i=!0}function p(y){let x=!1;for(let C of y){let b=Ke.parse(C.x),I=Ke.parse(C.y);if(b===void 0||I===void 0)continue;s=Math.min(s,b),a=Math.min(a,I),c=Math.max(c,b),l=Math.max(l,I),x=!0}if(x)i=!0,h=!0}function m(y){let x=!1,C=[...y.flatMap(A),...rgn(y).flatMap(ign)];for(let b of C)for(let I of[b]){let v=Ke.parse(I.x),P=Ke.parse(I.y);if(v===void 0||P===void 0)continue;t=Math.min(t,v),n=Math.min(n,P),o=Math.max(o,v),r=Math.max(r,P),x=!0}if(x)i=!0}function A(y){return"route_type"in y?NDr(y):[y]}function g({text:y,anchorPosition:x,fontSize:C=1,anchorAlignment:b="center",ccwRotationDegrees:I=0}){if(!y||!x)return;let v=y.split(`
`),M=Math.max(...v.map((N)=>N.length),0)*C*0.6,B=Math.max(v.length,1)*C,T=VRr({anchorPosition:x,textWidth:M,textHeight:B,anchorAlignment:b});d({center:T,width:M,height:B,ccwRotationDegrees:I})}function f(y){if(y.type==="pcb_silkscreen_text")d({center:y.anchor_position,width:0,height:0});else if(y.type==="pcb_silkscreen_graphic"){for(let x of y.brep_shape.outer_ring.vertices)d({center:{x:x.x,y:x.y},width:0,height:0});for(let x of y.brep_shape.inner_rings??[])for(let C of x.vertices)d({center:{x:C.x,y:C.y},width:0,height:0})}else if(y.type==="pcb_silkscreen_path")m(y.route);else if(y.type==="pcb_silkscreen_rect")d({center:y.center,width:y.width,height:y.height,ccwRotationDegrees:y.ccw_rotation});else if(y.type==="pcb_silkscreen_circle"){let x=Ke.parse(y.radius);if(x!==void 0)d({center:y.center,width:x*2,height:x*2})}else if(y.type==="pcb_silkscreen_line")d({center:{x:y.x1,y:y.y1},width:0,height:0}),d({center:{x:y.x2,y:y.y2},width:0,height:0});else if(y.type==="pcb_silkscreen_oval"){let x=Ke.parse(y.radius_x),C=Ke.parse(y.radius_y);if(x!==void 0&&C!==void 0)d({center:y.center,width:x*2,height:C*2})}else if(y.type==="pcb_silkscreen_pill")d({center:y.center,width:y.width,height:y.height,ccwRotationDegrees:y.ccw_rotation});else if(y.type==="pcb_cutout"){let x=y;if(x.shape==="rect")d({center:x.center,width:x.width,height:x.height,ccwRotationDegrees:x.rotation});else if(x.shape==="circle"){let C=Ke.parse(x.radius);if(C!==void 0)d({center:x.center,width:C*2,height:C*2})}else if(x.shape==="polygon")m(x.points);else if(x.shape==="path"){let C=x;if(C.route&&Array.isArray(C.route))m(C.route)}}}}function S_n(e,t,n){if(!e||t===void 0||n===void 0)return;let o=Ke.parse(e.x),r=Ke.parse(e.y);if(o===void 0||r===void 0)return;let i=Ke.parse(t),s=Ke.parse(n);if(i===void 0||s===void 0)return;let a=i/2,c=s/2;return{minX:o-a,minY:r-c,maxX:o+a,maxY:r+c}}function URr(e){if(!e||e.length<3)return;let{POSITIVE_INFINITY:t,POSITIVE_INFINITY:n,NEGATIVE_INFINITY:o,NEGATIVE_INFINITY:r}=Number;for(let i of e){let s=Ke.parse(i.x),a=Ke.parse(i.y);if(s===void 0||a===void 0)continue;t=Math.min(t,s),n=Math.min(n,a),o=Math.max(o,s),r=Math.max(r,a)}if(!Number.isFinite(t)||!Number.isFinite(n))return;if(!Number.isFinite(o)||!Number.isFinite(r))return;return{minX:t,minY:n,maxX:o,maxY:r}}function P_n(e,t){if(!t.showPinNumbers)return[];if(e.type==="pcb_smtpad"){if(t.layer&&e.layer!==t.layer)return[]}else if(t.layer&&!e.layers.includes(t.layer))return[];let n=jDr(e,t.circuitJson);if(!n)return[];let o=$Rr(e);if(!o||o.width<=0||o.height<=0)return[];let r=Math.abs(t.transform.a),i=Math.min(WRr,o.height*XRr,o.width*KRr/(n.length*jRr));if(i<=0)return[];let[s,a]=Pt(t.transform,[o.centerX,o.centerY]),c=e.type==="pcb_smtpad"?e.layer:"through",l=o.ccwRotation?`rotate(${-o.ccwRotation} ${s} ${a})`:void 0;return[{name:"text",type:"element",value:"",attributes:{class:"pcb-pad-pin-number",x:s.toString(),y:a.toString(),fill:"#b0b0b0","font-family":"Arial, sans-serif","font-size":(i*r).toString(),"font-weight":"500","text-anchor":"middle","dominant-baseline":"central","pointer-events":"none","data-type":"pcb_pad_pin_number","data-pcb-layer":c,"data-pin-number":n,...l?{transform:l}:{}},children:[{type:"text",value:n,name:"",attributes:{},children:[]}]}]}function $Rr(e){if(e.type==="pcb_smtpad"){if(e.shape==="polygon")return E_n(e.points);if(e.shape==="circle")return{centerX:e.x,centerY:e.y,width:e.radius*2,height:e.radius*2,ccwRotation:0};return{centerX:e.x,centerY:e.y,width:e.width,height:e.height,ccwRotation:e.shape==="rotated_rect"||e.shape==="rotated_pill"?e.ccw_rotation:0}}if(e.shape==="circle")return{centerX:e.x,centerY:e.y,width:e.outer_diameter,height:e.outer_diameter,ccwRotation:0};if(e.shape==="oval"||e.shape==="pill")return{centerX:e.x,centerY:e.y,width:e.outer_width,height:e.outer_height,ccwRotation:e.ccw_rotation};if(e.shape==="hole_with_polygon_pad"){let t=E_n(e.pad_outline);if(!t)return;return{...t,centerX:e.x+t.centerX,centerY:e.y+t.centerY,ccwRotation:0}}if("rect_pad_width"in e)return{centerX:e.x,centerY:e.y,width:e.rect_pad_width,height:e.rect_pad_height,ccwRotation:e.shape==="rotated_pill_hole_with_rect_pad"?e.rect_ccw_rotation:e.shape==="circular_hole_with_rect_pad"?e.rect_ccw_rotation??0:0};return}function E_n(e){if(e.length===0)return;let t=e.map((a)=>a.x),n=e.map((a)=>a.y),o=Math.min(...t),r=Math.max(...t),i=Math.min(...n),s=Math.max(...n);return{centerX:(o+r)/2,centerY:(i+s)/2,width:r-o,height:s-i,ccwRotation:0}}function qRr(e,t){return e.map((n)=>({...n,attributes:{...n.attributes??{},"data-type":t.type,"data-pcb-layer":"overlay"}}))}function JRr(e,t,n){if(!n.shouldDrawWarnings)return[];let o=t.find((g)=>g.type==="pcb_component"&&g.pcb_component_id===e.pcb_component_id);if(!o)return[];let r=(o.rotation??0)*Math.PI/180,i=Math.cos(r),s=Math.sin(r),a=o.width/2,c=o.height/2,l=[{x:-a,y:-c},{x:a,y:-c},{x:a,y:c},{x:-a,y:c}].map((g)=>Pt(n.transform,{x:o.center.x+g.x*i-g.y*s,y:o.center.y+g.x*s+g.y*i})),h=Math.min(...l.map((g)=>g.x)),d=Math.min(...l.map((g)=>g.y)),u=Math.max(...l.map((g)=>g.x)),_=Math.max(...l.map((g)=>g.y)),p=u-h,m=_-d,A=h+p/2;return qRr([{name:"rect",type:"element",value:"",attributes:{x:h.toString(),y:d.toString(),width:p.toString(),height:m.toString(),fill:"none",stroke:M_n,"stroke-width":"2","stroke-dasharray":"6,3"},children:[]},{name:"text",type:"element",value:"",attributes:{x:A.toString(),y:(d-10).toString(),fill:M_n,"font-family":"sans-serif","font-size":"12","font-weight":"600","text-anchor":"middle"},children:[{type:"text",name:"",value:e.message,attributes:{},children:[]}]}],e)}function tQr({debugObject:e,transform:t,style:n,labelStackIndex:o=0}){let r=eQr(e),i={fill:"none",stroke:Mgn,"stroke-width":n.strokeWidth.toString(),"stroke-dasharray":`${n.dashLength},${n.dashLength}`};if(e.shape==="rect"){let c=Pt(t,[e.center.x-e.size.width/2,e.center.y-e.size.height/2]),l=Pt(t,[e.center.x+e.size.width/2,e.center.y+e.size.height/2]),h=Math.min(c[0],l[0]),d=Math.min(c[1],l[1]),u=Math.abs(l[0]-c[0]),_=Math.abs(l[1]-c[1]);return[{name:"g",type:"element",value:"",attributes:r,children:[{name:"rect",type:"element",value:"",attributes:{x:h.toString(),y:d.toString(),width:u.toString(),height:_.toString(),...i},children:[]},...int({label:e.label,x:h,y:d-n.labelGap-o*(n.fontSize+n.labelGap),style:n})]}]}if(e.shape==="line"){let[c,l]=Pt(t,[e.start.x,e.start.y]),[h,d]=Pt(t,[e.end.x,e.end.y]);return[{name:"g",type:"element",value:"",attributes:r,children:[{name:"line",type:"element",value:"",attributes:{x1:c.toString(),y1:l.toString(),x2:h.toString(),y2:d.toString(),...i},children:[]},...int({label:e.label,x:(c+h)/2,y:(l+d)/2-n.labelGap,style:n,anchor:"middle"})]}]}let[s,a]=Pt(t,[e.center.x,e.center.y]);return[{name:"g",type:"element",value:"",attributes:r,children:[{name:"circle",type:"element",value:"",attributes:{cx:s.toString(),cy:a.toString(),r:n.pointRadius.toString(),...i},children:[]},...int({label:e.label,x:s+n.pointRadius+n.labelGap,y:a-n.pointRadius,style:n})]}]}function nQr(e){let t=new Map,n=new Map,o=e.filter((s)=>s.type==="pcb_board");for(let s of e)switch(s.type){case"source_group":if(n.set(s.source_group_id,s.subcircuit_id??s.parent_subcircuit_id??s.parent_source_group_id),s.is_subcircuit&&s.subcircuit_id)n.set(s.subcircuit_id,s.parent_subcircuit_id??s.parent_source_group_id);break;case"pcb_group":n.set(s.pcb_group_id,s.subcircuit_id??s.source_group_id);break;case"pcb_component":n.set(s.pcb_component_id,s.subcircuit_id??s.pcb_group_id);break;case"pcb_trace":n.set(s.pcb_trace_id,s.subcircuit_id??s.pcb_group_id??s.pcb_component_id);break;case"pcb_via":n.set(s.pcb_via_id,s.subcircuit_id??s.pcb_group_id??s.pcb_trace_id);break}for(let s of o)if(t.set(s.pcb_board_id,s),s.subcircuit_id)t.set(s.subcircuit_id,s);let r=new Set;function i(s){if(t.has(s))return t.get(s);if(r.has(s)||!n.has(s))return;r.add(s);let a=n.get(s),c=a?i(a):o.length===1?o[0]:void 0;return t.set(s,c),r.delete(s),c}for(let s of n.keys())i(s);return t}function wnt(e,t){if(t?.showFabricationNotes===!1)e=e.filter((ue)=>!ue.type.startsWith("pcb_fabrication_note_"));let n=Boolean(t?.xRayElementIds?.length);if(n&&t?.hiddenLayerOpacity!==void 0&&(!Number.isFinite(t.hiddenLayerOpacity)||t.hiddenLayerOpacity<0||t.hiddenLayerOpacity>1))throw Error("hiddenLayerOpacity must be between 0 and 1");let o=!n&&(t?.drawPaddingOutsideBoard??!0),r=t?.layer,i=t?.colorOverrides,s={...tp.copper};if(i?.copper){for(let[ue,de]of Object.entries(i.copper))if(de!==void 0)s[ue]=de}let a={copper:s,drill:i?.drill??tp.drill,silkscreen:{top:i?.silkscreen?.top??tp.silkscreen.top,bottom:i?.silkscreen?.bottom??tp.silkscreen.bottom},boardOutline:i?.boardOutline??tp.boardOutline,soldermask:{top:i?.soldermask?.top??tp.soldermask.top,bottom:i?.soldermask?.bottom??tp.soldermask.bottom},soldermaskOverCopper:{top:i?.soldermaskOverCopper?.top??tp.soldermaskOverCopper.top,bottom:i?.soldermaskOverCopper?.bottom??tp.soldermaskOverCopper.bottom},soldermaskWithCopperUnderneath:{top:i?.soldermaskWithCopperUnderneath?.top??tp.soldermaskWithCopperUnderneath.top,bottom:i?.soldermaskWithCopperUnderneath?.bottom??tp.soldermaskWithCopperUnderneath.bottom},substrate:i?.substrate??tp.substrate,courtyard:{top:i?.courtyard?.top??tp.courtyard.top,bottom:i?.courtyard?.bottom??tp.courtyard.bottom},keepout:i?.keepout??tp.keepout,debugComponent:{fill:i?.debugComponent?.fill??tp.debugComponent.fill,stroke:i?.debugComponent?.stroke??tp.debugComponent.stroke}},c=e.filter((ue)=>{if(ue.type==="pcb_courtyard_rect"&&!t?.showCourtyards)return!1;if(ue.type==="pcb_soldermask_opening")return Boolean(t?.showSolderMask)&&(!r||ue.layer===r);return!0}),{minX:l,minY:h,maxX:d,maxY:u,boardMinX:_,boardMinY:p,boardMaxX:m,boardMaxY:A,hasBoardBounds:g}=YRr(c),{boundsMinX:f,boundsMinY:y,boundsMaxX:x,boundsMaxY:C,padding:b}=GRr({circuitJson:e,drawPaddingOutsideBoard:o,baseBounds:{minX:l,minY:h,maxX:d,maxY:u,boardMinX:_,boardMinY:p,boardMaxX:m,boardMaxY:A,hasBoardBounds:g},viewportOptions:{viewport:t?.viewport,viewportTarget:t?.viewportTarget}}),I=x-f+2*b,v=C-y+2*b,P=t?.width??800,M=t?.height??600;if(t?.matchBoardAspectRatio){let ue=x-f,de=C-y;if(ue>0&&de>0){let me=ue/de;if(t?.width&&!t?.height)M=t.width/me;else if(t?.height&&!t?.width)P=t.height*me;else M=P/me}}let B=[];for(let ue of e)if("route"in ue&&ue.route!==void 0)B.push(ue.route);let T=P/I,N=M/v,D=Math.min(T,N),L=(P-I*D)/2,H=(M-v*D)/2,V=Ts(Rc(L-f*D+b*D,M-H+y*D-b*D),Lu(D,-D)),O=Math.min(P,M),U=Math.max(1,Math.min(2,O*0.002)),j=Math.max(10,Math.min(18,O*0.02)),Y={transform:V,layer:r,shouldDrawErrors:t?.shouldDrawErrors,shouldDrawWarnings:t?.shouldDrawWarnings,showCourtyards:t?.showCourtyards,showPcbGroups:t?.showPcbGroups,drawPaddingOutsideBoard:o,colorMap:a,showSolderMask:t?.showSolderMask,showSolderPaste:t?.showSolderPaste,showPcbNotes:t?.showPcbNotes??!0,showBendLines:t?.showBendLines,showDebugObjects:t?.showDebugObjects,debugObjectStyle:{fontSize:j,strokeWidth:U,dashLength:U*4,labelGap:j*0.35,pointRadius:U*3},showAnchorOffsets:t?.showAnchorOffsets,showPinNumbers:t?.showPinNumbers,circuitJson:e,boardOwnerMap:nQr(e),usedCopperPourTraceMaskIds:new Set},X=n?[]:e.flatMap((ue)=>snt({elm:ue,circuitJson:e,ctx:Y}));if(!n)X.push(...tNr({circuitJson:e,ctx:Y,create:(ue,de)=>snt({elm:ue,circuitJson:e,ctx:de})}));let K=String(0.05*D);for(let ue of e)if("stroke_width"in ue){K=String(D*ue.stroke_width);break}if(!n&&t?.shouldDrawRatsNest){let ue=CRr(e,Y);X=[...X,...ue]}let J=n?SDr({circuitJson:e,ctx:Y,selectedIds:t.xRayElementIds,hiddenOpacity:t?.hiddenLayerOpacity??0.2,width:P,height:M,create:(ue,de)=>snt({elm:ue,circuitJson:e,ctx:de})}):lgn(ggn(X)),ee=[{name:"style",type:"element",value:"",attributes:{},children:[{type:"text",value:"",name:"",attributes:{},children:[]}]}],se=TRr({grid:n?void 0:t?.grid,svgWidth:P,svgHeight:M});if(se.defs)ee.push(se.defs);if(e.some((ue)=>ue.type==="pcb_keepout"))ee.push(PRr(a.keepout??tp.keepout));let re=zDr({circuitJson:e,transform:V,svgWidth:P,svgHeight:M,usedMaskIds:Y.usedCopperPourTraceMaskIds});if(re)ee.push(re);let Z=zRr({showSolderMask:Y.showSolderMask,objects:X,layer:r??"top",width:P,height:M});if(Z)ee.push(Z);if(ee.push({name:"rect",type:"element",value:"",attributes:{class:"boundary",x:"0",y:"0",fill:t?.backgroundColor??"#000",width:P.toString(),height:M.toString(),"data-type":"pcb_background","data-pcb-layer":"global"},children:[]}),o)ee.push(oQr(V,l,h,d,u));if(ee.push(...J),t?.simulationResultId)ee.push(...$Dr({circuitJson:e,resultId:t.simulationResultId,ctx:Y,options:t.returnCurrent,width:P,height:M}));if(se.rect)ee.push(se.rect);if(!n&&t?.showErrorsInTextOverlay){let ue=MJ(e,"pcb_error_text_overlay");if(ue)ee.push(ue)}let te=Sk(e),ie=Pk,le={name:"svg",type:"element",attributes:{xmlns:"http://www.w3.org/2000/svg",width:P.toString(),height:M.toString(),...te&&{"data-software-used-string":te},...t?.includeVersion&&{"data-circuit-to-svg-version":ie}},value:"",children:ee.filter((ue)=>ue!==null)};try{return vk(le)}catch(ue){throw console.error("Error stringifying SVG object:",ue),ue}}function snt({elm:e,circuitJson:t,ctx:n}){switch(e.type){case"pcb_debug_object":return n.showDebugObjects?tQr({debugObject:e,transform:n.transform,style:n.debugObjectStyle,labelStackIndex:e.shape==="rect"?t.slice(0,t.indexOf(e)).filter((r)=>r.type==="pcb_debug_object"&&r.shape==="rect"&&r.center.x===e.center.x&&r.center.y===e.center.y&&r.size.width===e.size.width&&r.size.height===e.size.height).length:0}):[];case"pcb_trace_error":return oNr(e,t,n).filter(Boolean);case"pcb_footprint_overlap_error":return sNr(e,t,n).filter(Boolean);case"pcb_courtyard_overlap_error":return aNr(e,t,n).filter(Boolean);case"pcb_component_outside_board_error":return hNr(e,t,n).filter(Boolean);case"pcb_pad_trace_clearance_error":case"pcb_via_trace_clearance_error":return ANr(e,t,n).filter(Boolean);case"pcb_connector_not_in_accessible_orientation_warning":case"pcb_manual_edit_conflict_warning":return JRr(e,t,n);case"pcb_component":return NRr(e,n).filter(Boolean);case"pcb_trace":return hgn(e,n);case"pcb_copper_pour":return wRr(e,n);case"pcb_plated_hole":return[...FNr(e,n).filter(Boolean),...P_n(e,n)];case"pcb_hole":return fRr(e,n);case"pcb_smtpad":return[...mgn(e,n),...P_n(e,n)];case"pcb_solder_paste":return n.showSolderPaste?Egn(e,n):[];case"pcb_silkscreen_text":return qNr(e,n);case"pcb_silkscreen_rect":return JNr(e,n);case"pcb_silkscreen_circle":return tRr(e,n);case"pcb_silkscreen_line":return nRr(e,n);case"pcb_silkscreen_pill":return oRr(e,n);case"pcb_silkscreen_oval":return rRr(e,n);case"pcb_copper_text":return eRr(e,n);case"pcb_courtyard_rect":if(!n.showCourtyards)return[];return iRr(e,n);case"pcb_courtyard_polygon":if(!n.showCourtyards)return[];return sRr(e,n);case"pcb_courtyard_circle":if(!n.showCourtyards)return[];return cRr(e,n);case"pcb_courtyard_outline":if(!n.showCourtyards)return[];return aRr(e,n);case"pcb_fabrication_note_path":return fNr(e,n);case"pcb_fabrication_note_text":return yNr(e,n);case"pcb_fabrication_note_rect":return bNr(e,n);case"pcb_fabrication_note_dimension":return PNr(e,n);case"pcb_note_dimension":if(!n.showPcbNotes)return[];return ENr(e,n);case"pcb_note_text":if(!n.showPcbNotes)return[];return wNr(e,n);case"pcb_note_rect":if(!n.showPcbNotes)return[];return DNr(e,n);case"pcb_note_path":if(!n.showPcbNotes)return[];return RNr(e,n);case"pcb_note_line":if(!n.showPcbNotes)return[];return kNr(e,n);case"pcb_bend":if(!n.showBendLines)return[];return HNr(e,n);case"pcb_silkscreen_path":return zNr(e,n);case"pcb_silkscreen_graphic":return ONr(e,n);case"pcb_panel":return n.drawPaddingOutsideBoard?ARr(e,n):[];case"pcb_board":return n.drawPaddingOutsideBoard?Pgn(e,n):[];case"pcb_via":if(n.layer&&!e.layers.includes(n.layer))return[];return Snt(e,n);case"pcb_cutout":let o=e;if(o.shape==="path")return IRr(o,n);return bRr(e,n);case"pcb_keepout":return ERr(e,n);case"pcb_group":return n.showPcbGroups?kRr(e,n):[];default:return[]}}function oQr(e,t,n,o,r){let[i,s]=Pt(e,[t,n]),[a,c]=Pt(e,[o,r]),l=Math.abs(a-i),h=Math.abs(c-s),d=Math.min(i,a),u=Math.min(s,c);return{name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-boundary",fill:"none",stroke:"#fff","stroke-width":"0.3",x:d.toString(),y:u.toString(),width:l.toString(),height:h.toString(),"data-type":"pcb_boundary","data-pcb-layer":"global"}}}function iQr(e){let t=/^data:([^,]*),(.*)$/s.exec(e);if(!t)throw Error("Invalid simulation asset data URL");return t[1].split(";").includes("base64")?Uint8Array.from(atob(t[2]),(n)=>n.charCodeAt(0)):new TextEncoder().encode(decodeURIComponent(t[2]))}async function w_n(e,t){if(e.url.startsWith("data:"))return iQr(e.url);if(!t.resolveAsset)throw Error(`External simulation asset '${e.project_relative_path}' requires resolveAsset`);let n=await t.resolveAsset(e);return typeof n==="string"?new TextEncoder().encode(n):n}async function sQr(e,t){_gn(e,t.simulationResultId);let n={...t.returnCurrent?.fieldData},o=await Promise.all(e.map(async(r)=>{if(!("simulation_pcb_return_current_result_id"in r)||r.simulation_pcb_return_current_result_id!==t.simulationResultId||!("layer"in r)||t.layer&&r.layer!==t.layer)return r;if(r.type==="simulation_pcb_return_current_field"){let i=fj.parse(r),s=i.simulation_pcb_return_current_field_id;if(n[s])return r;let a=await w_n(i.field_asset,t);if(i.field_asset.mimetype==="application/gzip")a=new Uint8Array(await new Response(new Blob([a]).stream().pipeThrough(new DecompressionStream("gzip"))).arrayBuffer());n[s]=Mie(i).parse(JSON.parse(new TextDecoder().decode(a)))}if(r.type==="simulation_pcb_return_current_heatmap"&&t.resolveAsset&&!r.image_asset.url.startsWith("data:")){let i=Lfe.parse(r.image_asset),s=await w_n(i,t),a="";for(let c of s)a+=String.fromCharCode(c);return{...r,image_asset:{...i,url:`data:${i.mimetype};base64,${btoa(a)}`}}}return r}));return wnt(o,{...t,returnCurrent:{...t.returnCurrent,fieldData:n}})}function aQr(e,t,n={}){let{width:o,height:r,center:i,outline:s}=e,a;if(s&&Array.isArray(s)&&s.length>=3)a=s.map((c,l)=>{let[h,d]=Pt(t,[c.x,c.y]);return l===0?`M ${h} ${d}`:`L ${h} ${d}`}).join(" ");else{let c=o/2,l=r/2,h=Pt(t,[i.x-c,i.y-l]),d=Pt(t,[i.x+c,i.y-l]),u=Pt(t,[i.x+c,i.y+l]),_=Pt(t,[i.x-c,i.y+l]);a=`M ${h[0]} ${h[1]} L ${d[0]} ${d[1]} L ${u[0]} ${u[1]} L ${_[0]} ${_[1]}`}return a+=" Z",[{name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-board",d:a,fill:n.fill??TIe.fill,stroke:n.stroke??TIe.stroke,"stroke-opacity":n.strokeOpacity??TIe.strokeOpacity,"stroke-width":((n.strokeWidthFactor??TIe.strokeWidthFactor)*Math.abs(t.a)).toString()}}]}function lQr(e,t){let{elm:n,portPosition:o,name:r,arePinsInterchangeable:i}=e,{transform:s}=t,{center:a,width:c,height:l,rotation:h=0,layer:d="top"}=n;if(!a||typeof c!=="number"||typeof l!=="number")return null;let[u,_]=Pt(s,[a.x,a.y]),[p,m]=Pt(s,[o.x,o.y]),A=c*Math.abs(s.a),g=l*Math.abs(s.d),f=d==="top",y=m>_,x=p<u,C=[hQr(A,g,h,d),dQr(A,g,r??"",s)];if(!i)C.push(uQr(A,g,h,d,y,x));return{name:"g",type:"element",value:"",attributes:{transform:`translate(${u}, ${_}) scale(1, -1)`},children:C}}function hQr(e,t,n,o){let r=e/2,i=t/2,s=0.8;return{name:"path",type:"element",attributes:{class:"assembly-component",d:pQr(r,i,n),"stroke-width":0.8 .toFixed(2),transform:`rotate(${-n})`,"stroke-dasharray":o==="bottom"?"2,2":""},value:"",children:[]}}function dQr(e,t,n,o){let r=Math.min(e,t),i=3,s=58,a=0.8,c=Math.min(58,Math.max(3,r*0.8)),l=t>e;return{name:"text",type:"element",attributes:{x:"0",y:"0",class:"assembly-component-label","text-anchor":"middle",dy:".10em",style:"pointer-events: none","font-size":`${c.toFixed(1)}px`,transform:l?"rotate(90) scale(1, -1)":"scale(1, -1)"},children:[{type:"text",value:n||"",name:"",attributes:{},children:[]}],value:""}}function uQr(e,t,n,o,r,i){let s=e/2,a=t/2,c=Math.min(s,a)*0.5,l;if(r&&i)l=[[-s,-a],[-s+c,-a],[-s,-a+c]];else if(r&&!i)l=[[s,-a],[s-c,-a],[s,-a+c]];else if(!r&&i)l=[[-s,a],[-s+c,a],[-s,a-c]];else l=[[s,a],[s-c,a],[s,a-c]];return{name:"polygon",type:"element",attributes:{class:"assembly-pin1-indicator",points:l.map((d)=>d.join(",")).join(" "),fill:"#333",stroke:"none",transform:`rotate(${-n})`},value:"",children:[]}}function pQr(e,t,n){let o=(a,c,l)=>{let h=Math.PI/180*l,d=Math.cos(h),u=Math.sin(h);return[a*d-c*u,a*u+c*d]};return`${[[-e,-t],[e,-t],[e,t],[-e,t]].map(([a,c])=>o(a,c,n)).map(([a,c],l)=>l===0?`M${a},${c}`:`L${a},${c}`).join(" ")} Z`}function mQr(e,t){let{transform:n}=t,[o,r]=Pt(n,[e.x,e.y]);if(e.hole_shape==="circle"||e.hole_shape==="square"){let i=e.hole_diameter*Math.abs(n.a),s=i/2;if(e.hole_shape==="circle")return[{name:"circle",type:"element",attributes:{class:"assembly-hole",cx:o.toString(),cy:r.toString(),r:s.toString(),fill:ant},children:[],value:""}];return[{name:"rect",type:"element",attributes:{class:"assembly-hole",x:(o-s).toString(),y:(r-s).toString(),width:i.toString(),height:i.toString(),fill:ant},children:[],value:""}]}if(e.hole_shape==="oval"){let i=e.hole_width*Math.abs(n.a),s=e.hole_height*Math.abs(n.a),a=i/2,c=s/2;return[{name:"ellipse",type:"element",attributes:{class:"assembly-hole",cx:o.toString(),cy:r.toString(),rx:a.toString(),ry:c.toString(),fill:ant},children:[],value:""}]}return[]}function _Qr(e,t){let{transform:n}=t,[o,r]=Pt(n,[e.x,e.y]);if(e.shape==="pill"){let i=e.outer_width*Math.abs(n.a),s=e.outer_height*Math.abs(n.a),a=e.hole_width*Math.abs(n.a),c=e.hole_height*Math.abs(n.a),l=i/2,h=s-i,d=a/2;return[{name:"g",type:"element",children:[{name:"path",type:"element",attributes:{class:"assembly-hole-outer",fill:Fhe,d:`M${o-l},${r-h/2} v${h} a${l},${l} 0 0 0 ${i},0 v-${h} a${l},${l} 0 0 0 -${i},0 z`},value:"",children:[]},{name:"path",type:"element",attributes:{class:"assembly-hole-inner",fill:zhe,d:`M${o-d},${r-(c-a)/2} v${c-a} a${d},${d} 0 0 0 ${a},0 v-${c-a} a${d},${d} 0 0 0 -${a},0 z`},value:"",children:[]}],value:"",attributes:{}}]}if(e.shape==="circle"){let i=e.outer_diameter*Math.abs(n.a),s=e.outer_diameter*Math.abs(n.a),a=e.hole_diameter*Math.abs(n.a),c=e.hole_diameter*Math.abs(n.a),l=Math.min(i,s)/2,h=Math.min(a,c)/2;return[{name:"g",type:"element",children:[{name:"circle",type:"element",attributes:{class:"assembly-hole-outer",fill:Fhe,cx:o.toString(),cy:r.toString(),r:l.toString()},value:"",children:[]},{name:"circle",type:"element",attributes:{class:"assembly-hole-inner",fill:zhe,cx:o.toString(),cy:r.toString(),r:h.toString()},value:"",children:[]}],value:"",attributes:{}}]}if(e.shape==="circular_hole_with_rect_pad"){let i=e,s=i.hole_diameter*Math.abs(n.a),a=i.rect_pad_width*Math.abs(n.a),c=i.rect_pad_height*Math.abs(n.a),l=(i.rect_border_radius??0)*Math.abs(n.a),h=i.rect_ccw_rotation??0,d=s/2,[u,_]=Pt(n,[i.x+i.hole_offset_x,i.y+i.hole_offset_y]);return[{name:"g",type:"element",children:[{name:"rect",type:"element",attributes:{class:"assembly-hole-outer-pad",fill:Fhe,...h?{x:(-a/2).toString(),y:(-c/2).toString(),transform:`translate(${o} ${r}) rotate(${-h})`}:{x:(o-a/2).toString(),y:(r-c/2).toString()},width:a.toString(),height:c.toString(),...l?{rx:l.toString(),ry:l.toString()}:{}},value:"",children:[]},{name:"circle",type:"element",attributes:{class:"assembly-hole-inner",fill:zhe,cx:u.toString(),cy:_.toString(),r:d.toString()},value:"",children:[]}],value:"",attributes:{}}]}if(e.shape==="pill_hole_with_rect_pad"){let i=e,s=i.rect_pad_width*Math.abs(n.a),a=i.rect_pad_height*Math.abs(n.a),c=(i.rect_border_radius??0)*Math.abs(n.a),l=i.hole_height*Math.abs(n.a),h=i.hole_width*Math.abs(n.a),d=i,u=d.hole_offset_x??0,_=d.hole_offset_y??0,[p,m]=Pt(n,[i.x+u,i.y+_]),A=Math.min(l,h)/2;return[{name:"g",type:"element",children:[{name:"rect",type:"element",attributes:{class:"assembly-hole-outer-pad",fill:Fhe,x:(o-s/2).toString(),y:(r-a/2).toString(),width:s.toString(),height:a.toString(),...c?{rx:c.toString(),ry:c.toString()}:{}},value:"",children:[]},{name:"rect",type:"element",attributes:{class:"assembly-hole-inner",fill:zhe,x:(p-h/2).toString(),y:(m-l/2).toString(),width:h.toString(),height:l.toString(),rx:A.toString(),ry:A.toString()},value:"",children:[]}],value:"",attributes:{}}]}if(e.shape==="rotated_pill_hole_with_rect_pad"){let i=e,s=i.rect_pad_width*Math.abs(n.a),a=i.rect_pad_height*Math.abs(n.a),c=(i.rect_border_radius??0)*Math.abs(n.a),l=i.hole_height*Math.abs(n.a),h=i.hole_width*Math.abs(n.a),d=i,u=d.hole_offset_x??0,_=d.hole_offset_y??0,[p,m]=Pt(n,[i.x+u,i.y+_]),A=Math.min(l,h)/2;return[{name:"g",type:"element",children:[{name:"rect",type:"element",attributes:{class:"assembly-hole-outer-pad",fill:Fhe,x:(-s/2).toString(),y:(-a/2).toString(),width:s.toString(),height:a.toString(),transform:`translate(${o} ${r}) rotate(${-i.rect_ccw_rotation})`,...c?{rx:c.toString(),ry:c.toString()}:{}},value:"",children:[]},{name:"rect",type:"element",attributes:{class:"assembly-hole-inner",fill:zhe,x:(-h/2).toString(),y:(-l/2).toString(),width:h.toString(),height:l.toString(),rx:A.toString(),ry:A.toString(),transform:`translate(${p} ${m}) rotate(${-i.hole_ccw_rotation})`},value:"",children:[]}],value:"",attributes:{}}]}return[]}function gQr(e,t){let{transform:n}=t;if(e.shape==="rect"||e.shape==="rotated_rect"){let o=e.width*Math.abs(n.a),r=e.height*Math.abs(n.d),[i,s]=Pt(n,[e.x,e.y]),a=(e.rect_border_radius??0)*Math.abs(n.a);if(e.shape==="rotated_rect"&&e.ccw_rotation)return[{name:"rect",type:"element",attributes:{class:"assembly-pad",fill:Ohe,x:(-o/2).toString(),y:(-r/2).toString(),width:o.toString(),height:r.toString(),transform:`translate(${i} ${s}) rotate(${-e.ccw_rotation})`,"data-layer":e.layer,...a?{rx:a.toString(),ry:a.toString()}:{}},value:"",children:[]}];return[{name:"rect",type:"element",attributes:{class:"assembly-pad",fill:Ohe,x:(i-o/2).toString(),y:(s-r/2).toString(),width:o.toString(),height:r.toString(),"data-layer":e.layer,...a?{rx:a.toString(),ry:a.toString()}:{}},value:"",children:[]}]}if(e.shape==="pill"){let o=e.width*Math.abs(n.a),r=e.height*Math.abs(n.d),i=e.radius*Math.abs(n.a),[s,a]=Pt(n,[e.x,e.y]);return[{name:"rect",type:"element",attributes:{class:"assembly-pad",fill:Ohe,x:(s-o/2).toString(),y:(a-r/2).toString(),width:o.toString(),height:r.toString(),rx:i.toString(),ry:i.toString(),"data-layer":e.layer},value:"",children:[]}]}if(e.shape==="circle"){let o=e.radius*Math.abs(n.a),[r,i]=Pt(n,[e.x,e.y]);return[{name:"circle",type:"element",attributes:{class:"assembly-pad",fill:Ohe,cx:r.toString(),cy:i.toString(),r:o.toString(),"data-layer":e.layer},value:"",children:[]}]}if(e.shape==="polygon"){let o=(e.points??[]).map((r)=>Pt(n,[r.x,r.y]));return[{name:"polygon",type:"element",attributes:{class:"assembly-pad",fill:Ohe,points:o.map((r)=>r.join(",")).join(" "),"data-layer":e.layer},value:"",children:[]}]}return[]}function AQr(e,t){let{POSITIVE_INFINITY:n,POSITIVE_INFINITY:o,NEGATIVE_INFINITY:r,NEGATIVE_INFINITY:i}=Number;for(let I of e)if(I.type==="pcb_board"){let v=I.center,P=I.width||0,M=I.height||0;n=Math.min(n,v.x-P/2),o=Math.min(o,v.y-M/2),r=Math.max(r,v.x+P/2),i=Math.max(i,v.y+M/2)}let s=1,a=r-n+2*s,c=i-o+2*s,l=t?.width??800,h=t?.height??600,d=l/a,u=h/c,_=Math.min(d,u),p=(l-a*_)/2,m=(h-c*_)/2,A=Ts(Rc(p-n*_+s*_,h-m+o*_-s*_),Lu(_,-_)),g={transform:A},f=e.sort((I,v)=>(B_n.indexOf(v.type)??9999)-(B_n.indexOf(I.type)??9999)).flatMap((I)=>fQr(I,g,e)),y=Sk(e),x=Pk,C=[{name:"style",type:"element",children:[{type:"text",value:`
              .assembly-component { 
                fill: none; 
                stroke: #000; 
              }
              .assembly-board { 
                fill: #f2f2f2; 
                stroke: rgb(0,0,0); 
                stroke-opacity: 0.8;
              }
              .assembly-component-label { 
                fill: #000; 
                font-family: Arial, serif;
                font-weight: bold;
                dominant-baseline: middle;
                text-anchor: middle;
              }
              .assembly-boundary { 
                fill: none; 
                stroke: #fff;
                stroke-width: 0.2; 
              }
            `,name:"",attributes:{},children:[]}],value:"",attributes:{}},{name:"rect",type:"element",attributes:{fill:"#fff",x:"0",y:"0",width:l.toString(),height:h.toString()},value:"",children:[]},yQr(A,n,o,r,i),...f].filter((I)=>I!==null);if(t?.showErrorsInTextOverlay){let I=MJ(e);if(I)C.push(I)}let b={name:"svg",type:"element",attributes:{xmlns:"http://www.w3.org/2000/svg",width:l.toString(),height:h.toString(),...y&&{"data-software-used-string":y},...t?.includeVersion&&{"data-circuit-to-svg-version":x}},value:"",children:C};return vk(b)}function fQr(e,t,n){let o=Vo(n).source_component.list();switch(e.type){case"pcb_board":return aQr(e,t.transform);case"pcb_component":{let r=o.find((a)=>a.source_component_id===e.source_component_id),s=Vo(n).pcb_port.list().filter((a)=>a.pcb_component_id===e.pcb_component_id)[0];if(r&&s){let a=r.are_pins_interchangeable,c=lQr({elm:e,portPosition:{x:s.x,y:s.y},name:r.name,arePinsInterchangeable:a},t);return c?[c]:[]}return[]}case"pcb_smtpad":return gQr(e,t);case"pcb_hole":return mQr(e,t);case"pcb_plated_hole":return _Qr(e,t);default:return[]}}function yQr(e,t,n,o,r){let[i,s]=Pt(e,[t,n]),[a,c]=Pt(e,[o,r]),l=Math.abs(a-i),h=Math.abs(c-s),d=Math.min(i,a),u=Math.min(s,c);return{name:"rect",type:"element",value:"",children:[],attributes:{class:"assembly-boundary",x:d.toString(),y:u.toString(),width:l.toString(),height:h.toString()}}}function bQr(e,t){let{transform:n,soup:o}=t,{width:r,height:i,center:s,outline:a}=e,l=o.find((_)=>_.type==="source_board"&&_.title)?.title,h;if(a&&Array.isArray(a)&&a.length>=3)h=a.map((_,p)=>{let[m,A]=Pt(n,[_.x,_.y]);return p===0?`M ${m} ${A}`:`L ${m} ${A}`}).join(" ");else{let _=r/2,p=i/2,m=Pt(n,[s.x-_,s.y-p]),A=Pt(n,[s.x+_,s.y-p]),g=Pt(n,[s.x+_,s.y+p]),f=Pt(n,[s.x-_,s.y+p]);h=`M ${m[0]} ${m[1]} L ${A[0]} ${A[1]} L ${g[0]} ${g[1]} L ${f[0]} ${f[1]}`}h+=" Z";let d=Vo(o).pcb_cutout.list();for(let _ of d)if(_.shape==="rect"){let{x:p,y:m,width:A,height:g}=_.center?(()=>{let{x:v,y:P}=_.center,{width:M,height:B}=_;return{x:v,y:P,width:M,height:B}})():{x:0,y:0,width:0,height:0},f=A/2,y=g/2,[x,C,b,I]=[Pt(n,[p-f,m-y]),Pt(n,[p+f,m-y]),Pt(n,[p+f,m+y]),Pt(n,[p-f,m+y])];h+=` M ${x[0]} ${x[1]} L ${C[0]} ${C[1]} L ${b[0]} ${b[1]} L ${I[0]} ${I[1]} Z`}else if(_.shape==="circle");let u=[{name:"path",type:"element",value:"",children:[],attributes:{class:"pinout-board",d:h,fill:xQr,stroke:CQr,"fill-rule":"evenodd","stroke-opacity":"0.8","stroke-width":(0.2*Math.abs(n.a)).toString()}}];if(l){let _=t.svgWidth/2,p=30;u.push({name:"text",type:"element",value:"",children:[{name:"",type:"text",value:l,attributes:{},children:[]}],attributes:{x:_.toString(),y:30 .toString(),"text-anchor":"middle","font-size":"18px","font-weight":"bold","font-family":"Arial, sans-serif",fill:"black",class:"pinout-board-title"}})}return u}function SQr(e,t){let{transform:n,soup:o}=t,{center:r,width:i,height:s,rotation:a=0,source_component_id:c}=e,l=Vo(o).source_component.get(c);if(!r||typeof i!=="number"||typeof s!=="number"||i===0||s===0)return[];let[h,d]=Pt(n,[r.x,r.y]),u=i*Math.abs(n.a),_=s*Math.abs(n.d),p=`translate(${h}, ${d})`,m=[{name:"rect",type:"element",attributes:{class:"pinout-component-box",x:(-u/2).toString(),y:(-_/2).toString(),width:u.toString(),height:_.toString(),fill:IQr,transform:`rotate(${a}deg)`},value:"",children:[]}];if(l?.name){let A=Math.min(u,_)*0.4;m.push({name:"text",type:"element",attributes:{x:"0",y:"0",fill:vQr,"font-size":`${A}px`,"font-family":"sans-serif","text-anchor":"middle","dominant-baseline":"middle"},children:[{type:"text",value:l.name,name:"",attributes:{},children:[]}],value:""})}return[{name:"g",type:"element",attributes:{transform:p},children:m,value:""}]}function PQr(e,t){let{transform:n}=t,[o,r]=Pt(n,[e.x,e.y]);if(e.hole_shape==="circle"||e.hole_shape==="square"){let i=e.hole_diameter*Math.abs(n.a),s=i/2;if(e.hole_shape==="circle")return[{name:"circle",type:"element",attributes:{class:"pinout-hole",cx:o.toString(),cy:r.toString(),r:s.toString(),fill:cnt},children:[],value:""}];return[{name:"rect",type:"element",attributes:{class:"pinout-hole",x:(o-s).toString(),y:(r-s).toString(),width:i.toString(),height:i.toString(),fill:cnt},children:[],value:""}]}if(e.hole_shape==="oval"){let i=e.hole_width*Math.abs(n.a),s=e.hole_height*Math.abs(n.a),a=i/2,c=s/2;return[{name:"ellipse",type:"element",attributes:{class:"pinout-hole",cx:o.toString(),cy:r.toString(),rx:a.toString(),ry:c.toString(),fill:cnt},children:[],value:""}]}return[]}function EQr(e,t){let{transform:n}=t,[o,r]=Pt(n,[e.x,e.y]);if(e.shape==="pill"){let i=e.outer_width*Math.abs(n.a),s=e.outer_height*Math.abs(n.a),a=e.hole_width*Math.abs(n.a),c=e.hole_height*Math.abs(n.a),l=i/2,h=s-i,d=a/2;return[{name:"g",type:"element",children:[{name:"path",type:"element",attributes:{class:"pinout-hole-outer",fill:Vhe,d:`M${o-l},${r-h/2} v${h} a${l},${l} 0 0 0 ${i},0 v-${h} a${l},${l} 0 0 0 -${i},0 z`},value:"",children:[]},{name:"path",type:"element",attributes:{class:"pinout-hole-inner",fill:Yhe,d:`M${o-d},${r-(c-a)/2} v${c-a} a${d},${d} 0 0 0 ${a},0 v-${c-a} a${d},${d} 0 0 0 -${a},0 z`},value:"",children:[]}],value:"",attributes:{}}]}if(e.shape==="circle"){let i=e.outer_diameter*Math.abs(n.a),s=e.outer_diameter*Math.abs(n.a),a=e.hole_diameter*Math.abs(n.a),c=e.hole_diameter*Math.abs(n.a),l=Math.min(i,s)/2,h=Math.min(a,c)/2;return[{name:"g",type:"element",children:[{name:"circle",type:"element",attributes:{class:"pinout-hole-outer",fill:Vhe,cx:o.toString(),cy:r.toString(),r:l.toString()},value:"",children:[]},{name:"circle",type:"element",attributes:{class:"pinout-hole-inner",fill:Yhe,cx:o.toString(),cy:r.toString(),r:h.toString()},value:"",children:[]}],value:"",attributes:{}}]}if(e.shape==="circular_hole_with_rect_pad"){let i=e.hole_diameter*Math.abs(n.a),s=e.rect_pad_width*Math.abs(n.a),a=e.rect_pad_height*Math.abs(n.a),c=i/2;return[{name:"g",type:"element",children:[{name:"rect",type:"element",attributes:{class:"pinout-hole-outer-pad",fill:Vhe,x:(o-s/2).toString(),y:(r-a/2).toString(),width:s.toString(),height:a.toString()},value:"",children:[]},{name:"circle",type:"element",attributes:{class:"pinout-hole-inner",fill:Yhe,cx:o.toString(),cy:r.toString(),r:c.toString()},value:"",children:[]}],value:"",attributes:{}}]}if(e.shape==="pill_hole_with_rect_pad"){let i=e.rect_pad_width*Math.abs(n.a),s=e.rect_pad_height*Math.abs(n.a),a=e.hole_height*Math.abs(n.a),c=e.hole_width*Math.abs(n.a),l=Math.min(a,c)/2;return[{name:"g",type:"element",children:[{name:"rect",type:"element",attributes:{class:"pinout-hole-outer-pad",fill:Vhe,x:(o-i/2).toString(),y:(r-s/2).toString(),width:i.toString(),height:s.toString()},value:"",children:[]},{name:"rect",type:"element",attributes:{class:"pinout-hole-inner",fill:Yhe,x:(o-c/2).toString(),y:(r-a/2).toString(),width:c.toString(),height:a.toString(),rx:l.toString(),ry:l.toString()},value:"",children:[]}],value:"",attributes:{}}]}if(e.shape==="rotated_pill_hole_with_rect_pad"){let i=e.rect_pad_width*Math.abs(n.a),s=e.rect_pad_height*Math.abs(n.a),a=e.hole_height*Math.abs(n.a),c=e.hole_width*Math.abs(n.a),l=Math.min(a,c)/2;return[{name:"g",type:"element",children:[{name:"rect",type:"element",attributes:{class:"pinout-hole-outer-pad",fill:Vhe,x:(-i/2).toString(),y:(-s/2).toString(),width:i.toString(),height:s.toString(),transform:`translate(${o} ${r}) rotate(${-e.rect_ccw_rotation})`},value:"",children:[]},{name:"rect",type:"element",attributes:{class:"pinout-hole-inner",fill:Yhe,x:(-c/2).toString(),y:(-a/2).toString(),width:c.toString(),height:a.toString(),rx:l.toString(),ry:l.toString(),transform:`translate(${o} ${r}) rotate(${-e.hole_ccw_rotation})`},value:"",children:[]}],value:"",attributes:{}}]}return[]}function MQr(e,t){let{transform:n}=t;if(e.shape==="rect"||e.shape==="rotated_rect"){let o=e.width*Math.abs(n.a),r=e.height*Math.abs(n.d),[i,s]=Pt(n,[e.x,e.y]);if(e.shape==="rotated_rect"&&e.ccw_rotation)return[{name:"rect",type:"element",attributes:{class:"pinout-pad",fill:Ghe,x:(-o/2).toString(),y:(-r/2).toString(),width:o.toString(),height:r.toString(),transform:`translate(${i} ${s}) rotate(${-e.ccw_rotation})`,"data-layer":e.layer},value:"",children:[]}];return[{name:"rect",type:"element",attributes:{class:"pinout-pad",fill:Ghe,x:(i-o/2).toString(),y:(s-r/2).toString(),width:o.toString(),height:r.toString(),"data-layer":e.layer},value:"",children:[]}]}if(e.shape==="pill"){let o=e.width*Math.abs(n.a),r=e.height*Math.abs(n.d),i=e.radius*Math.abs(n.a),[s,a]=Pt(n,[e.x,e.y]);return[{name:"rect",type:"element",attributes:{class:"pinout-pad",fill:Ghe,x:(s-o/2).toString(),y:(a-r/2).toString(),width:o.toString(),height:r.toString(),rx:i.toString(),ry:i.toString(),"data-layer":e.layer},value:"",children:[]}]}if(e.shape==="circle"){let o=e.radius*Math.abs(n.a),[r,i]=Pt(n,[e.x,e.y]);return[{name:"circle",type:"element",attributes:{class:"pinout-pad",fill:Ghe,cx:r.toString(),cy:i.toString(),r:o.toString(),"data-layer":e.layer},value:"",children:[]}]}if(e.shape==="polygon"){let o=(e.points??[]).map((r)=>Pt(n,[r.x,r.y]));return[{name:"polygon",type:"element",attributes:{class:"pinout-pad",fill:Ghe,points:o.map((r)=>r.join(",")).join(" "),"data-layer":e.layer},value:"",children:[]}]}return[]}function lnt(e){let{rectX:t,rectY:n,rectWidth:o,rectHeight:r,textX:i,textY:s,text:a,fontSize:c,labelBackground:l,labelColor:h,rx:d=4,ry:u=4,fontFamily:_="Arial, sans-serif",fontWeight:p="bold",textAnchor:m="middle",dominantBaseline:A="middle"}=e;return[{name:"rect",type:"element",attributes:{x:t.toString(),y:n.toString(),width:o.toString(),height:r.toString(),fill:l,rx:typeof d==="number"?d.toString():d,ry:typeof u==="number"?u.toString():u,stroke:"none"},children:[],value:""},{name:"text",type:"element",attributes:{x:i.toString(),y:s.toString(),fill:h,"font-size":`${c}px`,"font-family":_,"font-weight":p,"text-anchor":m,"dominant-baseline":A},children:[{type:"text",value:a,name:"",attributes:{},children:[]}],value:""}]}function DQr(e,t){let n=t.label_positions.get(e.pcb_port_id);if(!n)return[];let{text:o,aliases:r,elbow_end:i,label_pos:s,edge:a}=n,[c,l]=Pt(t.transform,[e.x,e.y]),h=a==="left"?"x-":a==="right"?"x+":a==="top"?"y-":"y+",d=a==="left"?"x+":a==="right"?"x-":a==="top"?"y+":"y-",u=FO({x:c,y:l,facingDirection:h},{x:i.x,y:i.y,facingDirection:d},{}),_=/^pin(\d+)$/i.exec(o),p=[{text:_?_[1]:o,bg:_?BQr:D_n,color:_?TQr:T_n},...r.map((L)=>({text:L,bg:D_n,color:T_n}))],m=Math.abs(t.transform.a),A=t.styleScale??1,f=1.6*A*m,y=Math.max(0.08,0.25*A),C=0.3*A*m,b=y*m,I={x:s.x+(a==="left"?-b/2:b/2),y:s.y},v=[...u,I].map((L)=>`${L.x},${L.y}`).join(" "),P=f*0.5238095238095238,M=(f-P)/2,B=M,T=p.map(({text:L,bg:H,color:V})=>{let O=L??"",j=O.length*P*0.6+2*M;return{text:O,rectWidth:j,bg:H,color:V}}),N=s.y,D=[{name:"polyline",type:"element",attributes:{points:v,stroke:wQr,"stroke-width":(y*m).toString(),fill:"none"},children:[],value:""}];if(a==="left"){let L=s.x;for(let{text:H,rectWidth:V,bg:O,color:U}of T){let j=L-V,Y=j+V/2;D.push(...lnt({rectX:j,rectY:N-f/2,rectWidth:V,rectHeight:f,textX:Y,textY:N,text:H,fontSize:P,labelBackground:O,labelColor:U,rx:C,ry:C})),L=j-B}}else if(a==="right"){let L=s.x;for(let{text:H,rectWidth:V,bg:O,color:U}of T){let j=L,Y=j+V/2;D.push(...lnt({rectX:j,rectY:N-f/2,rectWidth:V,rectHeight:f,textX:Y,textY:N,text:H,fontSize:P,labelBackground:O,labelColor:U,rx:C,ry:C})),L=j+V+B}}else{let L=T.reduce((V,O)=>V+O.rectWidth,0)+B*Math.max(0,T.length-1),H=s.x-L/2;for(let{text:V,rectWidth:O,bg:U,color:j}of T){let Y=H,X=Y+O/2;D.push(...lnt({rectX:Y,rectY:N-f/2,rectWidth:O,rectHeight:f,textX:X,textY:N,text:V,fontSize:P,labelBackground:U,labelColor:j,rx:C,ry:C})),H=Y+O+B}}return D}function N_n(e,t,{transform:n,soup:o,board_bounds:r,svgHeight:i,styleScale:s},a){let c=t.map((D)=>D.pcb_port.x),l={};for(let D of c){let L=D.toFixed(1);l[L]=(l[L]||0)+1}let h;if(Object.keys(l).length>1&&t.length>2){let D=Object.entries(l).sort((X,K)=>K[1]-X[1]),L=parseFloat(D[0][0]),H=t.filter((X)=>Math.abs(X.pcb_port.x-L)<0.2),V=t.filter((X)=>Math.abs(X.pcb_port.x-L)>=0.2),O=(X)=>({pcb_port:X.pcb_port,y:Pt(n,[X.pcb_port.x,X.pcb_port.y])[1],aliases:X.aliases});H.sort((X,K)=>K.pcb_port.y-X.pcb_port.y),V.sort((X,K)=>K.pcb_port.y-X.pcb_port.y);let U=H.length>0?Math.max(...H.map((X)=>X.pcb_port.y)):-1/0;h=((V.length>0?Math.max(...V.map((X)=>X.pcb_port.y)):-1/0)>U?[...V,...H]:[...H,...V]).map(O)}else h=t.map((D)=>({pcb_port:D.pcb_port,y:Pt(n,[D.pcb_port.x,D.pcb_port.y])[1],aliases:D.aliases})).sort((D,L)=>D.y-L.y);if(h.length===0)return;let d=Pt(n,[e==="left"?r.minX:r.maxX,0])[0],u=h.length,_={};for(let D of t){let L=D.pcb_port.x.toFixed(1);_[L]=(_[L]||0)+1}let p=new Set;if(Object.keys(_).length>1&&t.length>2){let D=Object.entries(_).sort((V,O)=>O[1]-V[1]),L=parseFloat(D[0][0]),H=t.filter((V)=>Math.abs(V.pcb_port.x-L)<0.2);p=new Set(H.map((V)=>V.pcb_port.pcb_port_id))}let m=h.map((D,L)=>{if(p.has(D.pcb_port.pcb_port_id))return L;return-1}).filter((D)=>D!==-1),A=(u-1)/2,g=Math.abs(n.a),f=wgn*s*g,y=0.3,x=Math.max(0.2*g,y*s*g),C=QQr*s*g,b=(Bgn+u*Tgn)*s*g,v=b+A*(gnt*s*g)+Dgn*s*g,P=u-m.length,M=m.length===0?u:P,B=M*f+Math.max(0,M-1)*x,T;if(m.length>0&&P>0){let D=m.map((Y)=>h[Y].y),L=Math.min(...D),H=Math.max(...D),V=L-f/2,O=H+f/2;if(h.map((Y,X)=>X).filter((Y)=>!m.includes(Y))[0]<m[0])T=V-(x*2+C)-B+f/2;else T=O+(x*2+C)+f/2}else T=(i-B)/2+f/2;let N=m.length===u;h.forEach(({pcb_port:D,aliases:L},H)=>{let V;if(m.length>0)if(m.includes(H))V=A;else{let J=Math.min(...m),ee=Math.max(...m),se;if(H<J)se=J-H;else se=H-ee;V=A-se}else{let J=Math.abs(H-A);V=A-J}let O=b+V*(gnt*s*g),U=e==="left"?-1:1,j=m.includes(H),Y=N?h[H].y:m.length>0&&j?h[H].y:T,X={x:d+U*O,y:Y},K={x:d+U*v,y:Y};if(a.set(D.pcb_port_id,{text:L[0],aliases:L.slice(1),elbow_end:X,label_pos:K,edge:e}),!(m.length>0&&j))T+=f+x})}function LQr(e,t){let n=Vo(t).source_port.get(e.source_port_id);if(!n)return null;let o=n.port_hints?.filter((s)=>!/^\d+$/.test(s)&&!["left","right","top","bottom"].includes(s))??[],r=o[0];if(!r)r=n.name;if(!r)return null;let i=o.filter((s)=>s!==r);return{text:r,aliases:i}}function HQr(e,t){let n={left:e.x-t.minX,right:t.maxX-e.x,top:t.maxY-e.y,bottom:e.y-t.minY},o="left",r=n.left;if(n.right<r)r=n.right,o="right";if(n.top<r)r=n.top,o="top";if(n.bottom<r)r=n.bottom,o="bottom";return o}function FQr(e,t){let{POSITIVE_INFINITY:n,POSITIVE_INFINITY:o,NEGATIVE_INFINITY:r,NEGATIVE_INFINITY:i}=Number;for(let le of e)if(le.type==="pcb_board")if("outline"in le&&le.outline&&Array.isArray(le.outline)&&le.outline.length>0)for(let ue of le.outline)n=Math.min(n,ue.x),o=Math.min(o,ue.y),r=Math.max(r,ue.x),i=Math.max(i,ue.y);else{let ue=le.center,de=le.width||0,me=le.height||0;n=Math.min(n,ue.x-de/2),o=Math.min(o,ue.y-me/2),r=Math.max(r,ue.x+de/2),i=Math.max(i,ue.y+me/2)}let s=2,a=t?.width??1200,c=t?.height??768,l=e.find((le)=>le.type==="source_board"&&!!le.title)?.title,h={minX:n,minY:o,maxX:r,maxY:i},d=e.filter((le)=>le.type==="pcb_port"&&le.is_board_pinout),u=[];for(let le of d){let ue=LQr(le,e);if(!ue)continue;let de=HQr({x:le.x,y:le.y},h);u.push({pcb_port:le,aliases:[ue.text,...ue.aliases],edge:de})}let _=u.filter((le)=>le.edge==="left"),p=u.filter((le)=>le.edge==="right"),m=u.filter((le)=>le.edge==="top"),A=u.filter((le)=>le.edge==="bottom"),g=(n+r)/2;if(m.length>0)if(m.filter((ue)=>ue.pcb_port.x<g).length>m.length/2)_.push(...m);else p.push(...m);if(A.length>0)if(A.filter((ue)=>ue.pcb_port.x<g).length>A.length/2)_.push(...A);else p.push(...A);let y=e.filter((le)=>le.type==="pcb_smtpad").map((le)=>{if(typeof le.height==="number")return le.height;if(typeof le.radius==="number")return le.radius*2;return}).filter((le)=>Number.isFinite(le)),x=y.length?y.reduce((le,ue)=>le+ue,0)/y.length:void 0,b=x?Math.max(0.5,Math.min(1,x/1)):1,I=wgn*b;function v(le){let ue=[...le.aliases??[]];if(ue.length===0)return ue;let de=/^pin(\d+)$/i.exec(ue[0]);if(de)ue[0]=de[1];return ue}function P(le){if(le.length===0)return 0;let ue=I,de=ue*NQr,me=(ue-de)/2,Ae=me;return le.map((Re)=>(Re??"").length*de*RQr+2*me).reduce((Re,we)=>Re+we,0)+Ae*Math.max(0,le.length-1)}function M(le){if(le<=0)return 0;let ue=(le-1)/2;return(Bgn+le*Tgn)*b+ue*(gnt*b)+Dgn*b}let B=Math.max(0,..._.map((le)=>P(v(le)))),T=Math.max(0,...p.map((le)=>P(v(le)))),N=M(_.length)+B,D=M(p.length)+T,L=n-N,V=r+D-L+2*s,O=i-o+2*s,U=a/V,j=c/O,Y=Math.min(U,j),X=(a-V*Y)/2,K=(c-O*Y)/2,J=Ts(Rc(X-L*Y+s*Y,c-K+o*Y-s*Y),Lu(Y,-Y)),ee=kQr({left_labels:_,right_labels:p,transform:J,soup:e,board_bounds:h,svgWidth:a,svgHeight:c,styleScale:b}),se={transform:J,soup:e,board_bounds:h,styleScale:b,label_positions:ee,svgWidth:a,svgHeight:c},ne=e.sort((le,ue)=>(R_n.indexOf(le.type)??9999)-(R_n.indexOf(ue.type)??9999)).flatMap((le)=>zQr(le,se,e)),re=Sk(e),Z=Pk,te=[{name:"rect",type:"element",attributes:{fill:"rgb(255, 255, 255)",x:"0",y:"0",width:a.toString(),height:c.toString()},value:"",children:[]},...ne].filter((le)=>le!==null);if(t?.showErrorsInTextOverlay){let le=MJ(e);if(le)te.push(le)}let ie={name:"svg",type:"element",attributes:{xmlns:"http://www.w3.org/2000/svg",width:a.toString(),height:c.toString(),...re&&{"data-software-used-string":re},...t?.includeVersion&&{"data-circuit-to-svg-version":Z}},value:"",children:te};return vk(ie)}function zQr(e,t,n){switch(e.type){case"pcb_board":return bQr(e,t);case"pcb_component":return SQr(e,t);case"pcb_smtpad":return MQr(e,t);case"pcb_hole":return PQr(e,t);case"pcb_plated_hole":return EQr(e,t);case"pcb_port":if(e.is_board_pinout)return DQr(e,t);return[];default:return[]}}function OQr(e){let{minX:t,minY:n,maxX:o,maxY:r}=e.bounds,i=e.cellSize??1,s=e.labelCells??!1,a=[],c=(l,h)=>{let[d,u]=Pt(e.transform,[l,h]);return{x:d,y:u}};for(let l=Math.floor(t);l<=Math.ceil(o);l+=i){let h=c(l,n),d=c(l,r);a.push({name:"line",type:"element",attributes:{x1:h.x.toString(),y1:h.y.toString(),x2:d.x.toString(),y2:d.y.toString(),stroke:Hu.schematic.grid,"stroke-width":(0.01*Math.abs(e.transform.a)).toString(),"stroke-opacity":"0.5"}})}for(let l=Math.floor(n);l<=Math.ceil(r);l+=i){let h=c(t,l),d=c(o,l);a.push({name:"line",type:"element",attributes:{x1:h.x.toString(),y1:h.y.toString(),x2:d.x.toString(),y2:d.y.toString(),stroke:Hu.schematic.grid,"stroke-width":(0.01*Math.abs(e.transform.a)).toString(),"stroke-opacity":"0.5"}})}if(s){let l=(h,d)=>{if(i<=0.1)return`${h.toFixed(1)},${d.toFixed(1)}`;return`${h},${d}`};for(let h=Math.floor(t);h<=Math.ceil(o);h+=i)for(let d=Math.floor(n);d<=Math.ceil(r);d+=i){let u=c(h,d);a.push({name:"text",type:"element",attributes:{x:(u.x-2.5).toString(),y:(u.y-5).toString(),fill:Hu.schematic.grid,"font-size":(i/5*Math.abs(e.transform.a)).toString(),"fill-opacity":"0.5","text-anchor":"middle","dominant-baseline":"middle","font-family":"sans-serif"},children:[{type:"text",value:l(h,d),name:"",attributes:{},children:[]}]})}}return{name:"g",value:"",type:"element",attributes:{class:"grid sch-grid"},children:a}}function VQr(e){let{points:t,transform:n}=e,o=[];for(let r of t){let[i,s]=Pt(n,[r.x-0.1,r.y-0.1]),[a,c]=Pt(n,[r.x+0.1,r.y+0.1]),[l,h]=Pt(n,[r.x-0.1,r.y+0.1]),[d,u]=Pt(n,[r.x+0.1,r.y-0.1]);o.push({name:"path",type:"element",attributes:{d:`M${i},${s} L${a},${c} M${l},${h} L${d},${u}`,stroke:Hu.schematic.grid,"stroke-width":(0.02*Math.abs(n.a)).toString(),"stroke-opacity":"0.7"}});let[_,p]=Pt(n,[r.x+0.15,r.y-0.15]);o.push({name:"text",type:"element",attributes:{x:_.toString(),y:p.toString(),fill:Hu.schematic.grid,"font-size":(0.1*Math.abs(n.a)).toString(),"fill-opacity":"0.7","text-anchor":"start","font-family":"sans-serif","dominant-baseline":"middle"},children:[{type:"text",value:r.label||`(${r.x},${r.y})`,name:"",attributes:{},children:[]}]})}return{name:"g",value:"",type:"element",attributes:{class:"labeled-points sch-labeled-points"},children:o}}function YQr(e){return e.reduce((t,n)=>{if(!t)return n;if(n.sheet_index===void 0)return t;if(t.sheet_index===void 0)return n;return n.sheet_index<t.sheet_index?n:t},void 0)}function VIe(e){return Zhe(e.text||"")+(e.display_superscript?Rgn+Zhe(e.display_superscript)*Ngn:0)}function Bnt(e,t,n,o="central"){let r=[{type:"text",value:e,name:"",attributes:{},children:[]}];if(t)r.push({type:"element",name:"tspan",value:"",attributes:{class:"sch-net-label-superscript","font-size":`${n*Ngn}px`,dx:`${n*Rgn}`,dy:`${-n*(o==="ideographic"?0.5:0.25)}`},children:[{type:"text",value:t,name:"",attributes:{},children:[]}]});return r}function UQr(e){return{left:180,top:90,bottom:-90,right:0}[e]??0}function WQr(e,t,n){let o=n+Ck*2+PJ*e.text.length+SJ,r=wJ(e.anchor_side);return e.anchor_position??{x:e.center.x-r.x*o*t/2,y:e.center.y-r.y*o*t/2}}function Hgn(e,t,n,o){let r=Math.sqrt((n.x-e.x)**2+(n.y-e.y)**2),s=Math.sqrt((o.x-t.x)**2+(o.y-t.y)**2)/r,a=t.x-s*e.x,c=t.y-s*e.y,l=Rc(a,c),h=Lu(s,s);return Ts(l,h)}function jQr(e){let t=[],n=new Map,o=new Map,r=null;for(let i of e)if(i.type==="schematic_component")t.push(i);else if(i.type==="schematic_port"&&i.schematic_component_id){let s=n.get(i.schematic_component_id)??[];s.push(i),n.set(i.schematic_component_id,s)}else if(i.type==="source_component")o.set(i.source_component_id,i);for(let i of t){let s=KQr({component:i,schematicPorts:n.get(i.schematic_component_id)??[],sourceComponent:i.source_component_id?o.get(i.source_component_id):void 0});if(!s)continue;r=r?Fgn(r,s):s}return r}function KQr({component:e,schematicPorts:t,sourceComponent:n}){if(!e.symbol_name)return null;let o=zs[e.symbol_name];if(!o)return null;let r=Lgn({schPorts:t,symbol:o,schComponent:e});if(!r[0])return null;let i=Hgn(r[1]?.symbolPort??o.center,r[1]?.schPort.center??e.center,r[0].symbolPort,r[0].schPort.center),s=null;for(let a of o.primitives){if(a.type!=="text")continue;let c=$Qr({primitive:a,component:e,sourceComponent:n});if(!c)continue;let l=Pt(i,a),h=bk("reference_designator"),d=qQr({x:l.x,y:l.y,width:Zhe(c)*h,height:h,anchor:a.anchor});s=s?Fgn(s,d):d}return s}function $Qr({primitive:e,component:t,sourceComponent:n}){if(e.text==="{REF}")return n?.display_name??n?.name??"";if(e.text==="{VAL}")return t.symbol_display_value??"";return""}function qQr({x:e,y:t,width:n,height:o,anchor:r}){let i=e,s=e,a=t-o/2,c=t+o/2;if(r.includes("left"))s=e+n;else if(r.includes("right"))i=e-n;else i=e-n/2,s=e+n/2;if(r.includes("top"))a=t-o,c=t;else if(r.includes("bottom"))a=t,c=t+o;return{minX:i,minY:a,maxX:s,maxY:c}}function Fgn(e,t){return{minX:Math.min(e.minX,t.minX),minY:Math.min(e.minY,t.minY),maxX:Math.max(e.maxX,t.maxX),maxY:Math.max(e.maxY,t.maxY)}}function BJ(e={}){let t=e.center??{x:0,y:0},n=e.sheet_width===void 0?ekr:e.sheet_width/Ik,o=e.sheet_height===void 0?tkr:e.sheet_height/Ik,r=t.x-n/2,i=t.x+n/2,s=t.y-o/2,a=t.y+o/2;return{center:t,width:n,height:o,minX:r,maxX:i,minY:s,maxY:a,innerMinX:r+DIe,innerMaxX:i-DIe,innerMinY:s+DIe,innerMaxY:a-DIe}}function Ogn(e,t=0.5){let{POSITIVE_INFINITY:n,POSITIVE_INFINITY:o,NEGATIVE_INFINITY:r,NEGATIVE_INFINITY:i}=Number,s=0.2;for(let l of e)if(l.type==="schematic_sheet"){let h=BJ(l);c(h.center,{width:h.width,height:h.height},0)}else if(l.type==="schematic_component")c(l.center,l.size,0);else if(l.type==="schematic_port")c(l.center,{width:s,height:s},0);else if(l.type==="schematic_debug_object"){if(l.shape==="rect")c(l.center,l.size,0);else if(l.shape==="line")c(l.start,{width:0.1,height:0.1},0),c(l.end,{width:0.1,height:0.1},0)}else if(l.type==="schematic_net_label"){let h=bk("net_label"),d=VIe(l),_=(d+Ck*2+PJ*(l.text?.length||0)+SJ)*h,p=Qgn,m=UQr(l.anchor_side)/180*Math.PI,A=WQr(l,h,d),g=wJ(l.anchor_side),f={x:A.x+g.x*_/2,y:A.y+g.y*_/2};c(f,{width:_,height:p},m)}else if(l.type==="schematic_trace")for(let h of l.edges)c(h.from,{width:0.1,height:0.1},0),c(h.to,{width:0.1,height:0.1},0);else if(l.type==="schematic_text"){let d=bk("reference_designator",l.font_size)??0.18,u=l.text??"",_=l.display_superscript;if(_){let p=u.split(`
`),m=Math.max(...p.map((b,I)=>VIe({text:b,display_superscript:I===p.length-1?_:void 0})))*d,A=l.anchor,g=A==="left"||A.endsWith("_left")?m/2:A==="right"||A.endsWith("_right")?-m/2:0,f=A==="top"||A.startsWith("top_")?0:A==="bottom"||A.startsWith("bottom_")?-d:-d/2,y=(p.length+0.3)*d,x=-(f-0.3*d+y/2),C=-(l.rotation??0)*Math.PI/180;c({x:l.position.x+g*Math.cos(C)-x*Math.sin(C),y:l.position.y+g*Math.sin(C)+x*Math.cos(C)},{width:m,height:y},C)}else{let p=u.length*d,m=d;c(l.position,{width:p,height:m},l.rotation??0)}}else if(l.type==="schematic_voltage_probe"){if(c(l.position,{width:0.2,height:0.4},0),l.name){let h=bk("net_label"),d=Zhe(l.name)*h,u=h,_=0.3,p=l.label_alignment??"top_right",m=l.position.x,A=l.position.y;if(p.includes("top"))A+=0.3+u/2;else if(p.includes("bottom"))A-=0.3+u/2;if(p.includes("right"))m+=0.3+d/2;else if(p.includes("left"))m-=0.3+d/2;c({x:m,y:A},{width:d,height:u},0)}}else if(l.type==="schematic_box")c({x:l.x+l.width/2,y:l.y+l.height/2},{width:l.width,height:l.height},0);else if(l.type==="schematic_table"){let{column_widths:h,row_heights:d}=zgn(l,e),u=h.reduce((y,x)=>y+x,0),_=d.reduce((y,x)=>y+x,0),p=l.anchor??"center",m=l.anchor_position.x,A=l.anchor_position.y;if(p.includes("center"))m-=u/2;else if(p.includes("right"))m-=u;if(p.includes("center"))A+=_/2;else if(p.includes("bottom"))A+=_;let g=m+u/2,f=A-_/2;c({x:g,y:f},{width:u,height:_},0)}else if(l.type==="schematic_line")c({x:l.x1,y:l.y1},{width:0.02,height:0.02},0),c({x:l.x2,y:l.y2},{width:0.02,height:0.02},0);else if(l.type==="schematic_circle")c(l.center,{width:l.radius*2,height:l.radius*2},0);else if(l.type==="schematic_rect")c(l.center,{width:l.width,height:l.height},l.rotation);else if(l.type==="schematic_arc")c(l.center,{width:l.radius*2,height:l.radius*2},0);else if(l.type==="schematic_path"){if(l.points&&l.points.length>0)for(let h of l.points)c(h,{width:0.02,height:0.02},0)}if(!Number.isFinite(n))n=-1,o=-1,r=1,i=1;n-=t,o-=t,r+=t,i+=t;let a=jQr(e);if(a){if(a.minX<n)n=a.minX-t;if(a.minY<o)o=a.minY-t;if(a.maxX>r)r=a.maxX+t;if(a.maxY>i)i=a.maxY+t}return{minX:n,minY:o,maxX:r,maxY:i};function c(l,h,d){let u=[{x:-h.width/2,y:-h.height/2},{x:h.width/2,y:-h.height/2},{x:h.width/2,y:h.height/2},{x:-h.width/2,y:h.height/2}];for(let _ of u){let p=_.x*Math.cos(d)-_.y*Math.sin(d)+l.x,m=_.x*Math.sin(d)+_.y*Math.cos(d)+l.y;n=Math.min(n,p),o=Math.min(o,m),r=Math.max(r,p),i=Math.max(i,m)}}}function Ant(e){if(e.type!=="element")throw Error("Expected SVG root element to be of type 'element'");return e}function Vgn(e){return{...e,attributes:{...e.attributes??{}},children:e.children?.map(Vgn)??[]}}function Khe(e,t,n,o,r){let i=Vgn(e);return i.attributes={...i.attributes,x:Xm(t),y:Xm(n),width:Xm(o),height:Xm(r)},delete i.attributes.xmlns,i}function Xm(e){if(!Number.isFinite(e))return"0";return Number.parseFloat(e.toFixed(6)).toString()}function nkr({schematicGraphic:e,viewport:t}){let n=okr(e);return{name:"g",type:"element",value:"",attributes:{class:"schematic-graphic","pointer-events":"none","data-circuit-json-type":"schematic_graphic","data-schematic-graphic-id":e.schematic_graphic_id,...e.schematic_sheet_id?{"data-schematic-sheet-id":e.schematic_sheet_id}:{}},children:[{name:"image",type:"element",value:"",attributes:{href:n,x:Xm(t.x),y:Xm(t.y),width:Xm(t.width),height:Xm(t.height),preserveAspectRatio:"xMidYMid meet",overflow:"hidden","pointer-events":"none"},children:[]}]}}function okr(e){let t=`Unable to render schematic graphic "${e.schematic_graphic_id}"`,{asset:n,svg_content:o}=e;if(!n){if(o!==void 0)return L_n(o);throw Error(`${t}: asset or svg_content is required`)}if(Ygn(n.mimetype)!==ede)throw Error(`${t}: asset.mimetype must be "${ede}" (received ${JSON.stringify(n.mimetype)})`);let r=n.url.trim();if(r.toLowerCase().startsWith("data:"))return rkr(r,t),r;if(o!==void 0)return L_n(o);throw Error(`${t}: asset.url must be an inline SVG data URL because circuit-to-svg cannot synchronously load ${JSON.stringify(n.url)}`)}function rkr(e,t){let n=e.match(/^data:([^,]*),(.*)$/is);if(!n)throw Error(`${t}: asset.url is not a valid SVG data URL`);let o=n[1].split(";").map((c)=>c.trim());if(Ygn(o.shift()??"")!==ede)throw Error(`${t}: asset.url must use the "${ede}" media type`);let i=n[2],s=o.findIndex((c)=>c.toLowerCase()==="base64"),a=s!==-1;if(a&&s!==o.length-1)throw Error(`${t}: asset.url must place "base64" as its final metadata token`);if(a){let c=i.replace(/\s+/g,"");if(!/^(?:[a-z\d+/]{4})*(?:[a-z\d+/]{2}==|[a-z\d+/]{3}=)?$/i.test(c))throw Error(`${t}: asset.url is not a valid SVG data URL`);return}if(i.includes("#"))throw Error(`${t}: asset.url must percent-encode "#" in a non-base64 SVG data URL`);try{decodeURIComponent(i)}catch(c){throw Error(`${t}: asset.url is not a valid SVG data URL`,{cause:c})}}function L_n(e){let t=new TextEncoder().encode(e),n="",o=32768;for(let r=0;r<t.length;r+=o)n+=String.fromCharCode(...t.subarray(r,r+o));return`data:${ede};base64,${btoa(n)}`}function Ygn(e){return(e.split(";",1)[0]??"").trim().toLowerCase()}function Wgn({schArc:e,transform:t,colorMap:n}){let o=Pt(t,e.center),r=Math.abs(t.a)*e.radius,i=e.stroke_width??0.02,s=Math.abs(t.a)*i,a=e.start_angle_degrees*Math.PI/180,c=e.end_angle_degrees*Math.PI/180,l=o.x+r*Math.cos(a),h=o.y+r*Math.sin(a),d=o.x+r*Math.cos(c),u=o.y+r*Math.sin(c),_=e.end_angle_degrees-e.start_angle_degrees;if(e.direction==="clockwise")_=-_;if(_<0)_+=360;let p=_>180?1:0,m=e.direction==="clockwise"?1:0;return[{name:"path",type:"element",attributes:{class:"sch-arc",d:`M ${l} ${h} A ${r} ${r} 0 ${p} ${m} ${d} ${u}`,fill:"none",stroke:e.color,"stroke-width":s.toString(),...e.is_dashed&&{"stroke-dasharray":(s*3).toString()},"data-schematic-arc-id":e.schematic_arc_id,...e.schematic_component_id&&{"data-schematic-component-id":e.schematic_component_id}},children:[],value:""}]}function Xgn({schCircle:e,transform:t,colorMap:n}){let o=Pt(t,e.center),r=Math.abs(t.a)*e.radius,i=e.stroke_width??0.02,s=Math.abs(t.a)*i;return[{name:"circle",type:"element",attributes:{class:"sch-circle",cx:o.x.toString(),cy:o.y.toString(),r:r.toString(),fill:e.is_filled?e.fill_color??e.color:"none",stroke:e.color,"stroke-width":s.toString(),...e.is_dashed&&{"stroke-dasharray":(s*3).toString()},"data-schematic-circle-id":e.schematic_circle_id,...e.schematic_component_id&&{"data-schematic-component-id":e.schematic_component_id}},children:[],value:""}]}function $gn({isDashed:e,dashLength:t,dashGap:n,strokeWidth:o,transform:r}){if(!e)return;let i=Math.abs(r.a),s=o*i*3,a=t!==void 0?t*i:s,c=n!==void 0?n*i:s;return`${a} ${c}`}function qgn({schLine:e,transform:t,colorMap:n}){let o=Pt(t,{x:e.x1,y:e.y1}),r=Pt(t,{x:e.x2,y:e.y2}),i=e.stroke_width??0.02,s=Math.abs(t.a)*i,a=$gn({isDashed:e.is_dashed,dashLength:e.dash_length,dashGap:e.dash_gap,strokeWidth:i,transform:t});return[{name:"line",type:"element",attributes:{class:"sch-line",x1:o.x.toString(),y1:o.y.toString(),x2:r.x.toString(),y2:r.y.toString(),stroke:e.color,"stroke-width":s.toString(),...a&&{"stroke-dasharray":a},"data-schematic-line-id":e.schematic_line_id,...e.schematic_component_id&&{"data-schematic-component-id":e.schematic_component_id}},children:[],value:""}]}function Jgn({schRect:e,transform:t,colorMap:n}){let o=Pt(t,e.center),r=Math.abs(t.a)*e.width,i=Math.abs(t.d)*e.height,s=e.stroke_width??0.02,a=Math.abs(t.a)*s,c=o.x-r/2,l=o.y-i/2;return[{name:"rect",type:"element",attributes:{class:"sch-rect",x:c.toString(),y:l.toString(),width:r.toString(),height:i.toString(),fill:e.is_filled?e.fill_color??e.color:"none",stroke:e.color,"stroke-width":a.toString(),...e.is_dashed&&{"stroke-dasharray":(a*3).toString()},...e.rotation!==0&&{transform:`rotate(${e.rotation} ${o.x} ${o.y})`},"data-schematic-rect-id":e.schematic_rect_id,...e.schematic_component_id&&{"data-schematic-component-id":e.schematic_component_id}},children:[],value:""}]}function Zgn({schPath:e,transform:t,colorMap:n}){let o=e.stroke_color??n.schematic.component_outline,r=e.fill_color??"none",i=e.stroke_width??0.02,s=Math.abs(t.a)*i,a=$gn({isDashed:e.is_dashed,dashLength:e.dash_length,dashGap:e.dash_gap,strokeWidth:i,transform:t});if(!e.points||e.points.length<2)return[];return[{name:"path",type:"element",attributes:{class:"sch-path",d:e.points.map((h)=>Pt(t,{x:h.x,y:h.y})).map((h,d)=>`${d===0?"M":"L"} ${h.x} ${h.y}`).join(" "),stroke:o,"stroke-width":s.toString(),fill:e.is_filled?r:"none","stroke-linecap":"round","stroke-linejoin":"round",...a&&{"stroke-dasharray":a},...e.schematic_component_id&&{"data-schematic-component-id":e.schematic_component_id}},children:[],value:""}]}function O_n(e){if(e.type==="schematic_rect")return 0;if((e.type==="schematic_circle"||e.type==="schematic_path")&&e.is_filled)return 1;if(e.type==="schematic_text")return 3;return 2}function bkr(e){let{component:t}=e,n=[];if(t.is_box_with_pins!==!1)if(t.symbol_name)n=gkr(e);else n=xkr(e);let o=Ckr(e),r=[...n,...o];return[{type:"element",name:"g",attributes:{class:"sch-component","data-circuit-json-type":"schematic_component","data-schematic-component-id":t.schematic_component_id,...t.schematic_sheet_id?{"data-schematic-sheet-id":t.schematic_sheet_id}:{}},children:r,value:""}]}function Ikr({debugObject:e,transform:t}){if(e.shape==="rect"){let[n,o]=Pt(t,[e.center.x-e.size.width/2,e.center.y-e.size.height/2]),[r,i]=Pt(t,[e.center.x+e.size.width/2,e.center.y+e.size.height/2]);[o,i]=[Math.min(o,i),Math.max(o,i)];let s=Math.abs(r-n),a=Math.abs(i-o),[c,l]=Pt(t,[e.center.x,e.center.y]);return[{name:"rect",type:"element",value:"",attributes:{x:n.toString(),y:o.toString(),width:s.toString(),height:a.toString(),fill:"none",stroke:"red","stroke-width":(0.02*Math.abs(t.a)).toString(),"stroke-dasharray":"5,5"},children:e.label?[{name:"text",type:"element",value:"",attributes:{x:c.toString(),y:(l-10).toString(),"text-anchor":"middle","font-size":(0.2*Math.abs(t.a)).toString(),fill:"red"},children:[{type:"text",value:e.label,name:"",attributes:{},children:[]}]}]:[]}]}if(e.shape==="line"){let[n,o]=Pt(t,[e.start.x,e.start.y]),[r,i]=Pt(t,[e.end.x,e.end.y]),s=(n+r)/2,a=(o+i)/2;return[{name:"line",type:"element",value:"",attributes:{x1:n.toString(),y1:o.toString(),x2:r.toString(),y2:i.toString(),stroke:"red","stroke-width":(0.02*Math.abs(t.a)).toString(),"stroke-dasharray":"5,5"},children:e.label?[{name:"text",type:"element",value:"",attributes:{x:s.toString(),y:(a-10).toString(),"text-anchor":"middle","font-size":(0.2*Math.abs(t.a)).toString(),fill:"red"},children:[{type:"text",value:e.label,name:"",attributes:{},children:[]}]}]:[]}]}return[]}function Skr({schematicSheet:e,transform:t,colorMap:n}){let o=BJ(e),r=n.schematic.sheet,i=n.schematic.net_name,s=[V_n({id:`${e.schematic_sheet_id}_outer`,center:o.center,width:o.width,height:o.height,transform:t,color:r}),V_n({id:`${e.schematic_sheet_id}_inner`,center:o.center,width:o.innerMaxX-o.innerMinX,height:o.innerMaxY-o.innerMinY,transform:t,color:r})];for(let a=1;a<NIe.length;a++){let c=o.innerMinX+(o.innerMaxX-o.innerMinX)*a/NIe.length;s.push(RIe({id:`${e.schematic_sheet_id}_top_column_${a}`,x1:c,y1:o.maxY,x2:c,y2:o.innerMaxY,transform:t,color:r}),RIe({id:`${e.schematic_sheet_id}_bottom_column_${a}`,x1:c,y1:o.minY,x2:c,y2:o.innerMinY,transform:t,color:r}))}for(let a=1;a<Whe.length;a++){let c=o.innerMinY+(o.innerMaxY-o.innerMinY)*a/Whe.length;s.push(RIe({id:`${e.schematic_sheet_id}_left_row_${a}`,x1:o.minX,y1:c,x2:o.innerMinX,y2:c,transform:t,color:r}),RIe({id:`${e.schematic_sheet_id}_right_row_${a}`,x1:o.maxX,y1:c,x2:o.innerMaxX,y2:c,transform:t,color:r}))}return NIe.forEach((a,c)=>{let l=o.innerMinX+(o.innerMaxX-o.innerMinX)*(c+0.5)/NIe.length;s.push(QIe({text:a,x:l,y:(o.maxY+o.innerMaxY)/2,transform:t,color:i}),QIe({text:a,x:l,y:(o.minY+o.innerMinY)/2,transform:t,color:i}))}),Whe.forEach((a,c)=>{let l=o.innerMinY+(o.innerMaxY-o.innerMinY)*(Whe.length-c-0.5)/Whe.length;s.push(QIe({text:a,x:(o.minX+o.innerMinX)/2,y:l,transform:t,color:i}),QIe({text:a,x:(o.maxX+o.innerMaxX)/2,y:l,transform:t,color:i}))}),[{name:"g",type:"element",value:"",attributes:{class:"schematic-sheet","data-circuit-json-type":"schematic_sheet","data-schematic-sheet-id":e.schematic_sheet_id},children:s}]}function V_n({id:e,center:t,width:n,height:o,transform:r,color:i}){let s=Pt(r,t),a=Math.abs(r.a)*n,c=Math.abs(r.d)*o;return{name:"rect",type:"element",value:"",attributes:{class:"sch-rect",x:(s.x-a/2).toString(),y:(s.y-c/2).toString(),width:a.toString(),height:c.toString(),fill:"none",stroke:i,"stroke-width":(Math.abs(r.a)*eAn).toString(),"data-schematic-rect-id":e},children:[]}}function RIe({id:e,x1:t,y1:n,x2:o,y2:r,transform:i,color:s}){let a=Pt(i,{x:t,y:n}),c=Pt(i,{x:o,y:r});return{name:"line",type:"element",value:"",attributes:{class:"sch-line",x1:a.x.toString(),y1:a.y.toString(),x2:c.x.toString(),y2:c.y.toString(),stroke:s,"stroke-width":(Math.abs(i.a)*eAn).toString(),"data-schematic-line-id":e},children:[]}}function QIe({text:e,x:t,y:n,transform:o,color:r}){let i=Pt(o,{x:t,y:n});return{type:"element",name:"text",value:"",attributes:{class:"sch-text",x:i.x.toString(),y:i.y.toString(),fill:r,"text-anchor":"middle","dominant-baseline":"middle","font-family":"sans-serif","font-size":`${V3(o,"reference_designator",vkr)}px`,transform:`rotate(0, ${i.x}, ${i.y})`},children:[{type:"text",value:e,name:"",attributes:{},children:[]}]}}function Ekr({trace:e,transform:t,colorMap:n}){let o=e.edges;if(o.length===0)return[];let r=[],i=[],s="";for(let a=0;a<o.length;a++){let c=o[a];if(c.is_crossing)continue;let[l,h]=Pt(t,[c.from.x,c.from.y]),[d,u]=Pt(t,[c.to.x,c.to.y]);if(a===0||o[a-1]?.is_crossing)s+=`M ${l} ${h} L ${d} ${u}`;else s+=` L ${d} ${u}`}if(s)r.push({name:"path",type:"element",attributes:{d:s,class:"trace-invisible-hover-outline sch-trace-hitbox",stroke:n.schematic.wire,fill:"none","stroke-width":`${H_(t)*8}px`,"stroke-linecap":"round",opacity:"0","stroke-linejoin":"round"},value:"",children:[]}),r.push({name:"path",type:"element",attributes:{class:"sch-trace-path",d:s,stroke:n.schematic.wire,fill:"none","stroke-width":`${H_(t)}px`,"stroke-linecap":"round","stroke-linejoin":"round"},value:"",children:[]});for(let a of o){if(!a.is_crossing)continue;let[c,l]=Pt(t,[a.from.x,a.from.y]),[h,d]=Pt(t,[a.to.x,a.to.y]),u=(c+h)/2,_=(l+d)/2,p=h-c,m=d-l,A=Math.sqrt(p*p+m*m),g=A*0.7,f=-m/A*g,y=p/A*g,x=u+f,C=_-Math.abs(y);i.push({name:"path",type:"element",attributes:{class:"trace-crossing-outline sch-trace-crossing-outline",d:`M ${c} ${l} Q ${x} ${C} ${h} ${d}`,stroke:n.schematic.background,fill:"none","stroke-width":`${H_(t)*1.5}px`,"stroke-linecap":"butt"},value:"",children:[]}),i.push({name:"path",type:"element",attributes:{class:"sch-trace-crossing-path",d:`M ${c} ${l} Q ${x} ${C} ${h} ${d}`,stroke:n.schematic.wire,fill:"none","stroke-width":`${H_(t)}px`,"stroke-linecap":"round"},value:"",children:[]})}if(e.junctions)for(let a of e.junctions){let[c,l]=Pt(t,[a.x,a.y]);i.push({name:"circle",type:"element",attributes:{cx:c.toString(),cy:l.toString(),r:(Math.abs(t.a)*0.03).toString(),class:"trace-junction sch-trace-junction",fill:n.schematic.junction},value:"",children:[]})}return[{name:"g",type:"element",value:"",attributes:{class:"trace sch-trace","data-layer":"base","data-circuit-json-type":"schematic_trace","data-schematic-trace-id":e.schematic_trace_id,...e.subcircuit_connectivity_map_key&&{"data-subcircuit-connectivity-map-key":e.subcircuit_connectivity_map_key}},children:r},{name:"g",type:"element",value:"",attributes:{class:"trace-overlays sch-trace-overlays","data-layer":"overlay","data-circuit-json-type":"schematic_trace","data-schematic-trace-id":e.schematic_trace_id,...e.subcircuit_connectivity_map_key&&{"data-subcircuit-connectivity-map-key":e.subcircuit_connectivity_map_key}},children:i}]}function Mkr({probe:e,transform:t,colorMap:n,fallbackColor:o}){let[r,i]=Pt(t,[e.position.x,e.position.y]),s=e.color??o??n.schematic.reference,a=Math.abs(t.a)*0.6,c=Math.abs(t.a)*0.28,l=e.label_alignment??"top_right",h,d,u,_;switch(l){case"top_left":h=-135*Math.PI/180,d="end",u=-8,_=-8;break;case"top_center":h=-90*Math.PI/180,d="middle",u=0,_=-8;break;case"top_right":h=-45*Math.PI/180,d="start",u=8,_=-8;break;case"center_left":h=180*Math.PI/180,d="end",u=-8,_=0;break;case"center":h=-90*Math.PI/180,d="middle",u=0,_=-8;break;case"center_right":h=0*Math.PI/180,d="start",u=8,_=0;break;case"bottom_left":h=135*Math.PI/180,d="end",u=-8,_=8;break;case"bottom_center":h=90*Math.PI/180,d="middle",u=0,_=8;break;case"bottom_right":h=45*Math.PI/180,d="start",u=8,_=8;break;default:h=-50*Math.PI/180,d="start",u=8,_=0}let p=r+a*Math.cos(h),m=i+a*Math.sin(h),A=r,g=i,f=[`M ${p},${m}`,`L ${A},${g}`,`M ${A},${g}`,`L ${A-c*Math.cos((h*180/Math.PI+150)*Math.PI/180)},${g-c*Math.sin((h*180/Math.PI+150)*Math.PI/180)}`,`L ${A-c*Math.cos((h*180/Math.PI+210)*Math.PI/180)},${g-c*Math.sin((h*180/Math.PI+210)*Math.PI/180)}`,"Z"].join(" "),y=(p+u).toString(),x=(m+_).toString(),C=[];if(e.name&&e.voltage!==void 0)C.push({type:"element",name:"tspan",value:"",attributes:{x:y},children:[{type:"text",value:e.name,name:"",attributes:{},children:[]}]}),C.push({type:"element",name:"tspan",value:"",attributes:{x:y,dy:"1.2em"},children:[{type:"text",value:`${e.voltage}V`,name:"",attributes:{},children:[]}]});else{let b=[];if(e.name)b.push(e.name);if(e.voltage!==void 0)b.push(`${e.voltage}V`);C.push({type:"text",value:b.join(" "),name:"",attributes:{},children:[]})}return[{name:"path",type:"element",attributes:{class:"sch-voltage-probe",d:f,stroke:s,fill:s,"stroke-width":`${H_(t)}px`},value:"",children:[]},{type:"element",name:"text",value:"",attributes:{class:"sch-voltage-probe-label",x:y,y:x,fill:s,"text-anchor":d,"dominant-baseline":"middle","font-family":"sans-serif","font-size":`${V3(t,"reference_designator")}px`,"font-weight":"bold","data-schematic-voltage-probe-id":e.schematic_voltage_probe_id},children:C}]}function tAn({message:e,targetBounds:t,svgWidth:n,svgHeight:o,occupiedCalloutBounds:r}){let i=Math.max(1,n-m2*2),s=Nkr(e,Math.max(12,Math.floor((Math.min(G_n,i)-hnt*2)/(Y_n*0.56)))),a=Math.max(...s.map((_)=>_.length)),c=Math.min(G_n,i,Math.max(Math.min(Bkr,i),a*Y_n*0.56+hnt*2)),l=hnt*2+s.length*wkr,h=Tkr({targetBounds:t,calloutWidth:c,calloutHeight:l,svgWidth:n,svgHeight:o,occupiedCalloutBounds:r});r.push(h);let d=nAn(t,$he),u=Dkr(h,d);return{messageLines:s,calloutWidth:c,calloutHeight:l,placement:h,targetOutline:d,leader:u}}function Tkr({targetBounds:e,calloutWidth:t,calloutHeight:n,svgWidth:o,svgHeight:r,occupiedCalloutBounds:i}){let s=(e.minX+e.maxX)/2,a=(e.minY+e.maxY)/2,c=e.minY-$he-kIe-n,l=e.maxY+$he+kIe,h=e.minX-$he-kIe-t,d=e.maxX+$he+kIe,u=[];if(c>=m2)u.push(Xhe({x:xJ(s-t/2,m2,o-m2-t),y:c,width:t,height:n,side:"top"}));if(l+n<=r-m2)u.push(Xhe({x:xJ(s-t/2,m2,o-m2-t),y:l,width:t,height:n,side:"bottom"}));if(d+t<=o-m2)u.push(Xhe({x:d,y:xJ(a-n/2,m2,r-m2-n),width:t,height:n,side:"right"}));if(h>=m2)u.push(Xhe({x:h,y:xJ(a-n/2,m2,r-m2-n),width:t,height:n,side:"left"}));let _=u.find((p)=>i.every((m)=>!Rkr(nAn(p,4),m)));if(_)return _;if(u[0])return u[0];return Xhe({x:xJ(s-t/2,m2,o-m2-t),y:xJ(c,m2,r-m2-n),width:t,height:n,side:"top"})}function Dkr(e,t){let n=(t.minX+t.maxX)/2,o=(t.minY+t.maxY)/2,r=(e.minX+e.maxX)/2,i=(e.minY+e.maxY)/2;switch(e.side){case"top":return{from:{x:r,y:e.maxY},to:{x:n,y:t.minY}};case"bottom":return{from:{x:r,y:e.minY},to:{x:n,y:t.maxY}};case"left":return{from:{x:e.maxX,y:i},to:{x:t.minX,y:o}};case"right":return{from:{x:e.minX,y:i},to:{x:t.maxX,y:o}}}}function Nkr(e,t){let n=e.trim().split(/\s+/),o=[],r="";for(let i of n){let s=r?`${r} ${i}`:i;if(s.length<=t||r.length===0){r=s;continue}o.push(r),r=i}if(r)o.push(r);return o.length>0?o:["Diagnostic"]}function nAn(e,t){return{minX:e.minX-t,minY:e.minY-t,maxX:e.maxX+t,maxY:e.maxY+t}}function Rkr(e,t){return!(e.maxX<=t.minX||e.minX>=t.maxX||e.maxY<=t.minY||e.minY>=t.maxY)}function Xhe({x:e,y:t,width:n,height:o,side:r}){return{minX:e,minY:t,maxX:e+n,maxY:t+o,side:r}}function xJ(e,t,n){if(n<t)return(t+n)/2;return Math.min(Math.max(e,t),n)}function kkr({circuitJson:e,transform:t,svgWidth:n,svgHeight:o,colorMap:r}){let i=r.schematic.erc_warning,s=[];return e.filter(oAn).flatMap((a)=>{let c=Lkr(a,e,t);if(!c)return[];let{messageLines:l,calloutWidth:h,calloutHeight:d,placement:u,targetOutline:_,leader:p}=tAn({message:a.message,targetBounds:c,svgWidth:n,svgHeight:o,occupiedCalloutBounds:s}),m=Okr(a);return[{name:"g",type:"element",value:"",attributes:{class:"schematic-warning","data-type":a.type,"data-warning-id":m,role:"note","aria-label":a.message},children:[{name:"rect",type:"element",value:"",attributes:{x:_.minX.toString(),y:_.minY.toString(),width:(_.maxX-_.minX).toString(),height:(_.maxY-_.minY).toString(),rx:"6",fill:"none",stroke:i,"stroke-width":"1","stroke-dasharray":"4,3","data-warning-reference":"target"},children:[]},{name:"line",type:"element",value:"",attributes:{x1:p.from.x.toString(),y1:p.from.y.toString(),x2:p.to.x.toString(),y2:p.to.y.toString(),stroke:i,"stroke-width":"1","data-warning-reference":"leader"},children:[]},{name:"rect",type:"element",value:"",attributes:{x:u.minX.toString(),y:u.minY.toString(),width:h.toString(),height:d.toString(),fill:"rgba(255, 250, 235, 0.97)",stroke:i,"stroke-width":"1","data-warning-reference":"callout"},children:[]},{name:"text",type:"element",value:"",attributes:{x:(u.minX+dnt).toString(),y:(u.minY+dnt+U_n).toString(),fill:"#5c4300","font-family":"sans-serif","font-size":U_n.toString()},children:l.map((g,f)=>({name:"tspan",type:"element",value:"",attributes:{x:(u.minX+dnt).toString(),dy:f===0?"0":Qkr.toString()},children:[Ykr(g)]}))}]}]})}function Lkr(e,t,n){let r=Hkr(e).map((i)=>Fkr(t,i)).filter((i)=>Boolean(i)).map((i)=>zkr(i,n)).filter((i)=>Boolean(i));if(r.length===0)return null;return r.reduce(Vkr)}function Hkr(e){switch(e.type){case"schematic_sheet_styling_warning":return[e.schematic_sheet_id];case"schematic_component_overlap_warning":return e.schematic_component_ids;case"schematic_component_styling_warning":return[e.schematic_component_id,...e.schematic_port_ids??[]];case"schematic_manual_edit_conflict_warning":return[e.schematic_component_id];case"schematic_element_outside_sheet_warning":return[e.schematic_element_id]}}function Fkr(e,t){return e.find((n)=>{if(!n.type.startsWith("schematic_"))return!1;let o=`${n.type}_id`;return n[o]===t})}function zkr(e,t){if(e.type==="schematic_sheet"){let n=BJ(e);return LIe([Pt(t,{x:n.minX,y:n.maxY}),Pt(t,{x:n.maxX,y:n.minY})])}if(e.type==="schematic_component"){let n=Pt(t,{x:e.center.x-e.size.width/2,y:e.center.y+e.size.height/2}),o=Pt(t,{x:e.center.x+e.size.width/2,y:e.center.y-e.size.height/2});return LIe([n,o])}if(e.type==="schematic_port"){let n=Pt(t,e.center);return W_n(LIe([n]),4)}if(e.type==="schematic_net_label"){let n=Pt(t,e.anchor_position??e.center),o=Math.max(28,e.text.length*8);return{minX:n.x-o/2,minY:n.y-10,maxX:n.x+o/2,maxY:n.y+10}}if(e.type==="schematic_trace"){let n=e.edges.flatMap((o)=>[Pt(t,o.from),Pt(t,o.to)]);if(n.length===0)return null;return W_n(LIe(n),4)}return null}function Okr(e){switch(e.type){case"schematic_sheet_styling_warning":return e.schematic_sheet_styling_warning_id;case"schematic_component_overlap_warning":return e.schematic_component_overlap_warning_id;case"schematic_component_styling_warning":return e.schematic_component_styling_warning_id;case"schematic_element_outside_sheet_warning":return e.schematic_element_outside_sheet_warning_id;case"schematic_manual_edit_conflict_warning":return e.schematic_manual_edit_conflict_warning_id}}function LIe(e){return{minX:Math.min(...e.map((t)=>t.x)),minY:Math.min(...e.map((t)=>t.y)),maxX:Math.max(...e.map((t)=>t.x)),maxY:Math.max(...e.map((t)=>t.y))}}function Vkr(e,t){return{minX:Math.min(e.minX,t.minX),minY:Math.min(e.minY,t.minY),maxX:Math.max(e.maxX,t.maxX),maxY:Math.max(e.maxY,t.maxY)}}function W_n(e,t){return{minX:e.minX-t,minY:e.minY-t,maxX:e.maxX+t,maxY:e.maxY+t}}function Ykr(e){return{name:"",type:"text",value:e,attributes:{},children:[]}}function Gkr({circuitJson:e,transform:t,svgWidth:n,svgHeight:o}){let r=Ukr(e,t);return e.flatMap((i)=>{let s=Wkr(i);if(!s)return[];let a=e.filter((A)=>A.type==="schematic_port"&&s.sourcePortIds.includes(A.source_port_id)),c=a[0];if(!c)return[];let l=a.flatMap((A)=>{let g=Pt(t,A.center);return[{name:"circle",type:"element",value:"",attributes:{cx:g.x.toString(),cy:g.y.toString(),r:"9",fill:"red","fill-opacity":"0.15",stroke:"red","stroke-width":"2","data-type":i.type,"data-source-port-id":A.source_port_id,"data-error-id":s.errorId,"aria-label":s.message},children:[{name:"title",type:"element",value:"",attributes:{},children:[{name:"",type:"text",value:s.message,attributes:{},children:[]}]}]}]}),h=Pt(t,c.center),{placement:d,leader:u,messageLines:_,calloutWidth:p,calloutHeight:m}=tAn({message:s.message,targetBounds:{minX:h.x-9,minY:h.y-9,maxX:h.x+9,maxY:h.y+9},svgWidth:n,svgHeight:o,occupiedCalloutBounds:r});return[...l,{name:"g",type:"element",value:"",attributes:{"data-type":"source_port_error_callout","data-error-type":i.type,"data-error-id":s.errorId,"data-source-port-id":c.source_port_id,"aria-label":s.message,role:"note"},children:[{name:"line",type:"element",value:"",children:[],attributes:{x1:u.from.x.toString(),y1:u.from.y.toString(),x2:u.to.x.toString(),y2:u.to.y.toString(),stroke:"red","stroke-width":"1"}},{name:"rect",type:"element",value:"",children:[],attributes:{x:d.minX.toString(),y:d.minY.toString(),width:p.toString(),height:m.toString(),fill:"rgba(255, 245, 245, 0.97)",stroke:"red","stroke-width":"1"}},{name:"text",type:"element",value:"",attributes:{x:(d.minX+6).toString(),y:(d.minY+17).toString(),fill:"#a00000","font-family":"sans-serif","font-size":"11"},children:_.map((A,g)=>({name:"tspan",type:"element",value:"",attributes:{x:(d.minX+6).toString(),dy:g===0?"0":"14"},children:[{name:"",type:"text",value:A,attributes:{},children:[]}]}))}]}]})}function Ukr(e,t){return e.flatMap((n)=>{if(n.type!=="schematic_component")return[];let o=Ogn(e.filter((i)=>i.type==="source_component"?i.source_component_id===n.source_component_id:("schematic_component_id"in i)&&i.schematic_component_id===n.schematic_component_id),0),r=[{x:o.minX,y:o.minY},{x:o.minX,y:o.maxY},{x:o.maxX,y:o.minY},{x:o.maxX,y:o.maxY}].map((i)=>Pt(t,i));return[{minX:Math.min(...r.map((i)=>i.x)),minY:Math.min(...r.map((i)=>i.y)),maxX:Math.max(...r.map((i)=>i.x)),maxY:Math.max(...r.map((i)=>i.y))}]})}function Wkr(e){switch(e.type){case"source_component_misconfigured_error":return{errorId:e.source_component_misconfigured_error_id,sourcePortIds:e.source_port_ids??[],message:e.message};case"source_pin_must_be_connected_error":return{errorId:e.source_pin_must_be_connected_error_id,sourcePortIds:[e.source_port_id],message:e.message};case"source_i2c_misconfigured_error":return{errorId:e.source_i2c_misconfigured_error_id,sourcePortIds:e.source_port_ids,message:e.message};case"source_trace_not_connected_error":return{errorId:e.source_trace_not_connected_error_id,sourcePortIds:e.connected_source_port_ids??[],message:e.message}}}function tde(e,t){let n=e.filter((K)=>K.type==="schematic_sheet"),o=YQr(n),r=o;if(t?.schematicSheetId!==void 0)r=n.find((K)=>K.schematic_sheet_id===t.schematicSheetId)??o;else if(t?.schematicSheetIndex!==void 0)r=n.find((K)=>K.sheet_index===t.schematicSheetIndex)??o;let i=r?e.filter((K)=>!K.type.startsWith("schematic_")||oAn(K)||("schematic_sheet_id"in K)&&K.schematic_sheet_id===r.schematic_sheet_id):e,s=Ogn(r?[r]:i),a=s.maxX-s.minX,c=s.maxY-s.minY,l=t?.width??1200,h=t?.height??600,d=t?.colorOverrides,u={...Hu,schematic:{...Hu.schematic,...d?.schematic??{}}},_=a/c,p=l/h,m;if(_>p){let K=l/_;m={x:0,y:(h-K)/2}}else{let K=h*_;m={x:(l-K)/2,y:0}}let A=Vmn([{x:s.minX,y:s.maxY},{x:s.maxX,y:s.maxY},{x:s.maxX,y:s.minY}],[{x:m.x,y:m.y},{x:l-m.x,y:m.y},{x:l-m.x,y:h-m.y}]),g=[];if(g.push({name:"rect",type:"element",attributes:{class:"boundary",x:"0",y:"0",width:l.toString(),height:h.toString()},children:[],value:""}),t?.grid){let K=typeof t.grid==="object"?t.grid:{};g.push(OQr({bounds:s,transform:A,...K}))}let f=[],y=[],x=[],C=[],b=[],I=[],v=[],P=[],M=[],B=[],T=[],N=[],D=[],L=jkr({transform:A,svgWidth:l,svgHeight:h,schematicSheet:r}),H=Array.isArray(u.simulation_palette)?u.simulation_palette:Array.isArray(u.palette)?u.palette:[],V=0;for(let K of i)if(K.type==="schematic_sheet")N.push(...Skr({schematicSheet:K,transform:A,colorMap:u}));else if(K.type==="schematic_graphic")D.push(nkr({schematicGraphic:K,viewport:Kkr({availableViewport:L,schematicGraphic:K,transform:A})}));else if(K.type==="schematic_debug_object")f.push(...Ikr({debugObject:K,transform:A}));else if(K.type==="schematic_component")y.push(...bkr({component:K,transform:A,circuitJson:i,colorMap:u})),M.push(...Ggn({component:K,transform:A,circuitJson:i}));else if(K.type==="schematic_box")v.push(...pkr({schematicBox:K,transform:A,colorMap:u}));else if(K.type==="schematic_trace")x.push(...Ekr({trace:K,transform:A,colorMap:u}));else if(K.type==="schematic_net_label")C.push(...skr({schNetLabel:K,realToScreenTransform:A,colorMap:u}));else if(K.type==="schematic_text"&&!K.schematic_component_id)b.push(Tnt({elm:K,transform:A,colorMap:u}));else if(K.type==="schematic_voltage_probe"){let J=H.length>0?H[V%H.length]:void 0;V+=1,I.push(...Mkr({probe:K,transform:A,colorMap:u,fallbackColor:J}))}else if(K.type==="schematic_table")P.push(...Pkr({schematicTable:K,transform:A,colorMap:u,circuitJson:i}));else if(K.type==="schematic_line"){if(K.schematic_component_id)continue;T.push(...qgn({schLine:K,transform:A,colorMap:u}))}else if(K.type==="schematic_circle"){if(K.schematic_component_id)continue;T.push(...Xgn({schCircle:K,transform:A,colorMap:u}))}else if(K.type==="schematic_rect"){if(K.schematic_component_id)continue;T.push(...Jgn({schRect:K,transform:A,colorMap:u}))}else if(K.type==="schematic_arc"){if(K.schematic_component_id)continue;T.push(...Wgn({schArc:K,transform:A,colorMap:u}))}else if(K.type==="schematic_path"){if(K.schematic_component_id)continue;T.push(...Zgn({schPath:K,transform:A,colorMap:u}))}else if(K.type==="schematic_port"){let J=i.find((ee)=>ee.type==="source_port"&&ee.source_port_id===K.source_port_id);if(J?.type==="source_port"&&J.do_not_connect===!0)B.push(lkr({schPort:K,transform:A,colorMap:u}));if(t?.drawPorts)B.push(...hkr({schPort:K,transform:A,circuitJson:i,colorMap:u}))}let O=x.filter((K)=>K.attributes?.["data-layer"]!=="overlay"),U=x.filter((K)=>K.attributes?.["data-layer"]==="overlay");if(g.push(...D,...f,...N,...O,...U,...T,...y,...M,...B,...C,...b,...v,...I,...P),t?.labeledPoints)g.push(VQr({points:t.labeledPoints,transform:A}));if(t?.shouldDrawWarnings)g.push(...kkr({circuitJson:i,transform:A,svgWidth:l,svgHeight:h,colorMap:u}));if(t?.shouldDrawErrors)g.push(...Gkr({circuitJson:i,transform:A,svgWidth:l,svgHeight:h}));let j=Sk(e),Y=Pk;if(t?.showErrorsInTextOverlay){let K=MJ(e);if(K)g.push(K)}let X={name:"svg",type:"element",attributes:{xmlns:"http://www.w3.org/2000/svg",class:["tscircuit-schematic",t?.className].filter(Boolean).join(" "),width:l.toString(),height:h.toString(),style:`background-color: ${u.schematic.background}`,"data-real-to-screen-transform":zmn(A),...j&&{"data-software-used-string":j},...t?.includeVersion&&{"data-circuit-to-svg-version":Y}},children:[{name:"style",type:"element",children:[{type:"text",value:`
              .boundary { fill: ${u.schematic.background}; }
              .schematic-boundary { fill: none; stroke: #fff; }
              .component { fill: none; stroke: ${u.schematic.component_outline}; }
              .chip { fill: ${u.schematic.component_body}; stroke: ${u.schematic.component_outline}; }
              .component-pin { fill: none; stroke: ${u.schematic.component_outline}; }
              .text { font-family: sans-serif; fill: ${u.schematic.wire}; }
              .pin-number { fill: ${u.schematic.pin_number}; }
              .port-label { fill: ${u.schematic.reference}; }
              .component-name { fill: ${u.schematic.reference}; }
              ${t?.css??""}
            `,name:"",attributes:{},children:[]}],value:"",attributes:{}},...g],value:""};return vk(X)}function jkr({transform:e,svgWidth:t,svgHeight:n,schematicSheet:o}){if(!o)return{x:0,y:0,width:t,height:n};let r=BJ(o),i=Pt(e,{x:r.innerMinX,y:r.innerMaxY}),s=Pt(e,{x:r.innerMaxX,y:r.innerMinY});return{x:Math.min(i.x,s.x),y:Math.min(i.y,s.y),width:Math.abs(s.x-i.x),height:Math.abs(s.y-i.y)}}function Kkr({availableViewport:e,schematicGraphic:t,transform:n}){if(t.width===void 0&&t.height===void 0)return e;let o=t.width===void 0?e.width:X_n(t.width*Math.hypot(n.a,n.b),e.width),r=t.height===void 0?e.height:X_n(t.height*Math.hypot(n.c,n.d),e.height);return{x:e.x+(e.width-o)/2,y:e.y+(e.height-r)/2,width:o,height:r}}function X_n(e,t){if(!Number.isFinite(e))return t;return Math.max(0,Math.min(e,t))}function Zkr(e,t){let n=e.filter((d)=>d.type==="schematic_sheet").slice().sort((d,u)=>(d.sheet_index??0)-(u.sheet_index??0));if(n.length<=1)return tde(e,t);let o=t?.width??$kr,r=t?.sheetLabelHeight??qkr,i=t?.sheetGap??Jkr,s={...Hu,schematic:{...Hu.schematic,...t?.colorOverrides?.schematic??{}}},a=[],c=0;n.forEach((d,u)=>{let _=BJ(d),p=t?.height??Math.round(o*_.height/_.width),m=tde(e,{...t,schematicSheetId:d.schematic_sheet_id,schematicSheetIndex:void 0,width:o,height:p}),A=Ant(rAn.parseSync(m)),g=c+r,f=d.display_name??d.name??`Sheet ${d.sheet_index??u+1}`,y=eLr({transformStr:A.attributes?.["data-real-to-screen-transform"],panelTop:g,labelHeight:r,schematicSheet:d});a.push({name:"text",type:"element",value:"",attributes:{class:"stacked-sheet-label",x:Xm(y.x),y:Xm(y.y),"font-family":"sans-serif","font-size":`${Xm(r*0.55)}px`,fill:s.schematic.reference,"data-schematic-sheet-id":d.schematic_sheet_id},children:[{name:"",type:"text",value:f,attributes:{},children:[]}]},Khe(A,0,g,o,p)),c=g+p+i});let l=Math.max(0,c-i),h={name:"svg",type:"element",value:"",attributes:{xmlns:"http://www.w3.org/2000/svg",class:"tscircuit-stacked-schematic",width:Xm(o),height:Xm(l),viewBox:`0 0 ${Xm(o)} ${Xm(l)}`,style:`background-color: ${s.schematic.background}`},children:[{name:"rect",type:"element",value:"",attributes:{class:"boundary",x:"0",y:"0",width:Xm(o),height:Xm(l),fill:s.schematic.background},children:[]},...a]};return vk(h)}function eLr({transformStr:e,panelTop:t,labelHeight:n,schematicSheet:o}){let r=t-n*0.28;if(!e)return{x:4,y:r};let i=BJ(o),s=Pt(kmn(e),{x:i.minX,y:i.maxY});return{x:Math.max(2,s.x),y:r}}function nde(e){return e?.valuePerDiv!==void 0&&Number.isFinite(e.valuePerDiv)&&Math.abs(e.valuePerDiv)>Number.EPSILON}function N5(e){return e.type==="simulation_transient_current_graph"}function Dnt(e){return N5(e)?e.simulation_transient_current_graph_id:e.simulation_transient_voltage_graph_id}function sAn(e){return N5(e)?"data-simulation-transient-current-graph-id":"data-simulation-transient-voltage-graph-id"}function aAn(e){return N5(e)?e.current_levels:e.voltage_levels}function dLr(e){let t=e.some((o)=>N5(o.graph)),n=e.some((o)=>!N5(o.graph));if(t&&!n)return"Current (A)";if(n&&!t)return"Voltage (V)";return"Value"}function uLr(e){return`simulation-graph-${e.replace(/[^a-zA-Z0-9_-]+/g,"-")}`}function yr(e){if(!Number.isFinite(e))return"0";let t=Number.parseFloat(e.toFixed(6));if(Number.isInteger(t))return t.toString();return t.toString()}function Cc(e,t,n=[]){return{name:e,type:"element",value:"",attributes:t,children:n}}function Av(e){return{name:"",type:"text",value:e,attributes:{},children:[]}}function bnt(e,t){if(!Number.isFinite(e))return`0 ${t}`;if(e===0)return`0 ${t}`;let n=Math.abs(e),o=[{threshold:1e6,factor:1e6,prefix:"M"},{threshold:1000,factor:1000,prefix:"k"},{threshold:1,factor:1,prefix:""},{threshold:0.001,factor:0.001,prefix:"m"},{threshold:0.000001,factor:0.000001,prefix:"µ"},{threshold:0.000000001,factor:0.000000001,prefix:"n"}],r=o.find((s)=>n>=s.threshold)??o[o.length-1],i=e/r.factor;return`${cAn(i)} ${r.prefix}${t}`}function pLr(e){return`${cAn(e)} div`}function cAn(e){if(!Number.isFinite(e))return"0";let t=Math.abs(e),n=t>=100?0:t>=10?1:t>=1?2:3;return Number.parseFloat(e.toFixed(n)).toString()}function $_n(e,t){let n=t.tickLabelOverrides?.get(e);if(n!==void 0)return n;let{ticks:o}=t;if(o.length<=1)return yr(e);let r=o[o.length-1]-o[0];if(!Number.isFinite(r)||r===0)return yr(e);let i=mLr(r),s=10**i;return(Math.round(e*s)/s).toFixed(i).replace(/\.0+$/,"").replace(/(\.\d*?)0+$/,"$1").replace(/\.$/,"")}function mLr(e){if(e>=100)return 0;if(e>=10)return 1;if(e>=1)return 2;return 3}function _Lr({graphs:e,valueAxis:t,scaleY:n,plotLeft:o,plotWidth:r,plotHeight:i}){let s=jm.top,a=jm.top+i,c=o,l=o+r,h=[],d=e.filter((u)=>nde(u.scopeTraceDisplay));for(let[u,_]of d.entries()){let p=u%2===0?"left":"right",m=Math.floor(u/2),A=p==="left"?c-10-m*Cnt:l+10+m*Cnt,g=p==="left"?A-6:A+6,f=p==="left"?"end":"start",y=p==="left"?A+6:A-6,x=_.scopeTraceDisplay;if(!nde(x))continue;h.push(Cc("line",{class:"axis axis-y axis-y-scope",x1:yr(A),y1:yr(s),x2:yr(A),y2:yr(a),style:`stroke: ${_.color};`}),Cc("text",{class:"axis-title axis-title-y axis-title-y-scope",x:yr(A),y:yr(s-12),"text-anchor":"middle",style:`fill: ${_.color}; font-size: 10px;`},[Av(_.label)]));for(let C of t.ticks){let b=n(C),I=(x.center??0)+(C-(x.offsetDivs??0))*x.valuePerDiv;h.push(Cc("line",{class:"axis-tick axis-tick-y axis-tick-y-scope",x1:yr(A),y1:yr(b),x2:yr(y),y2:yr(b),style:`stroke: ${_.color};`}),Cc("text",{class:"axis-label axis-label-y axis-label-y-scope",x:yr(g),y:yr(b),"text-anchor":f,"dominant-baseline":"middle",style:`fill: ${_.color}; font-size: 10px;`},[Av(bnt(I,N5(_.graph)?"A":"V"))]))}}return h}function gLr({timeAxis:e,valueAxis:t,graphs:n,scaleX:o,scaleY:r,plotLeft:i,plotWidth:s,plotHeight:a,yAxisTitle:c,xAxisTitle:l,usesScopeTraceDisplay:h}){let d=jm.top+a,u=i,_=i+s,p=[Cc("line",{class:"axis axis-x",x1:yr(u),y1:yr(d),x2:yr(_),y2:yr(d)}),...h?[]:[Cc("line",{class:"axis axis-y",x1:yr(u),y1:yr(jm.top),x2:yr(u),y2:yr(d)})]];for(let m of e.ticks){let A=yr(o(m));p.push(Cc("line",{class:"axis-tick axis-tick-x",x1:A,y1:yr(d),x2:A,y2:yr(d+6)}),Cc("text",{class:"axis-label axis-label-x",x:A,y:yr(d+22),"text-anchor":"middle"},[Av($_n(m,e))]))}if(h)p.push(..._Lr({graphs:n,valueAxis:t,scaleY:r,plotLeft:i,plotWidth:s,plotHeight:a}));else{for(let m of t.ticks){let A=yr(r(m));p.push(Cc("line",{class:"axis-tick axis-tick-y",x1:yr(u-6),y1:A,x2:yr(u),y2:A}),Cc("text",{class:"axis-label axis-label-y",x:yr(u-10),y:A,"text-anchor":"end","dominant-baseline":"middle"},[Av($_n(m,t))]))}p.push(Cc("text",{class:"axis-title axis-title-y",x:yr(u-64),y:yr(jm.top+a/2),transform:`rotate(-90 ${yr(u-64)} ${yr(jm.top+a/2)})`,"text-anchor":"middle"},[Av(c)]))}return p.push(Cc("text",{class:"axis-title axis-title-x",x:yr(u+s/2),y:yr(d+48),"text-anchor":"middle"},[Av(l)])),Cc("g",{class:"axes"},p)}function YIe(e,t=!1){if(e.length===0)return{domainMin:0,domainMax:1,ticks:[0,1]};let n=Math.min(...e),o=Math.max(...e);if(n===o){let c=n===0?1:Math.abs(n)*0.1||1;return{domainMin:n-c,domainMax:n+c,ticks:[n-c,n,n+c]}}let r=lAn(n,o),i=r.length>0?[...r]:[n,o],s=i[0],a=i[i.length-1];if(t&&i.length>1){let c=Math.abs(i[1]-i[0]),l=0.1;if(n<s+c*0.1)s-=c,i.unshift(s);if(o>a-c*0.1)a+=c,i.push(a)}return{domainMin:s,domainMax:a,ticks:i}}function ALr({values:e,graphs:t,experiment:n}){let o=HIe(n?.start_time_ms),r=HIe(n?.end_time_ms),i=t.map((m)=>HIe(m.start_time_ms)).filter((m)=>m!==void 0),s=t.map((m)=>HIe(m.end_time_ms)).filter((m)=>m!==void 0),a=o??(i.length>0?Math.min(...i):void 0),c=r??(s.length>0?Math.max(...s):void 0);if(a===void 0||c===void 0||a===c)return YIe(e);let l=Math.min(a,c),h=Math.max(a,c),u=(h-l)*0.12,_=lAn(l,h).filter((m)=>m>l+u&&m<h-u),p=fLr([l,..._,h]);return{domainMin:l,domainMax:h,ticks:p,tickLabelOverrides:new Map([[l,yr(l)],[h,yr(h)]])}}function HIe(e){return typeof e==="number"&&Number.isFinite(e)?e:void 0}function fLr(e){let t=[...e].sort((o,r)=>o-r),n=[];for(let o of t){let r=n[n.length-1];if(r===void 0||Math.abs(o-r)>0.000000000001)n.push(o)}return n}function lAn(e,t,n=6){let o=t-e;if(!Number.isFinite(o)||o<=Number.EPSILON)return[e,t];let r=yLr(o/Math.max(1,n-1)),i=Math.floor(e/r)*r,s=Math.ceil(t/r)*r,a=[];for(let c=i;c<=s+r/2;c+=r)a.push(Number.parseFloat(c.toPrecision(12)));return a}function yLr(e){if(!Number.isFinite(e)||e<=0)return 1;let t=Math.floor(Math.log10(e)),n=e/10**t,o;if(n<=1)o=1;else if(n<=2)o=2;else if(n<=5)o=5;else o=10;return o*10**t}function xLr(e,t){return Cc("rect",{class:"background",x:"0",y:"0",width:yr(e),height:yr(t)})}function CLr(e,t,n,o){return Cc("defs",{},[Cc("clipPath",{id:e},[Cc("rect",{x:yr(t),y:yr(jm.top),width:yr(n),height:yr(o)})])])}function bLr({timeAxis:e,valueAxis:t,scaleX:n,scaleY:o,plotLeft:r,plotWidth:i,plotHeight:s}){let a=jm.top,c=jm.top+s,l=r,h=r+i,d=[];for(let u of e.ticks){let _=yr(n(u));d.push(Cc("line",{class:"grid-line grid-line-x",x1:_,y1:yr(a),x2:_,y2:yr(c)}))}for(let u of t.ticks){let _=yr(o(u));d.push(Cc("line",{class:"grid-line grid-line-y",x1:yr(l),y1:_,x2:yr(h),y2:_}))}return Cc("g",{class:"grid"},d)}function q_n(e,t,n,o){if(!Number.isFinite(e)||!Number.isFinite(t)){let i=(n+o)/2;return()=>i}let r=t-e;if(Math.abs(r)<Number.EPSILON){let i=(n+o)/2;return()=>i}return(i)=>n+(i-e)/r*(o-n)}function ILr(e,t,n){return Cc("rect",{class:"plot-background",x:yr(e),y:yr(jm.top),width:yr(t),height:yr(n)})}function vLr(){let e=`
:root { color-scheme: light; }
svg { font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif; }
.background { fill: ${Hu.schematic.background}; }
.plot-background { fill: #ffffff; }
.grid-line { stroke: rgba(0, 0, 0, 0.08); stroke-width: 1; }
.axis { stroke: rgba(0, 0, 0, 0.6); stroke-width: 1.5; }
.axis-tick { stroke: rgba(0, 0, 0, 0.6); stroke-width: 1; }
.axis-label { fill: rgba(0, 0, 0, 0.75); font-size: 12px; }
.axis-title { fill: rgba(0, 0, 0, 0.9); font-size: 14px; font-weight: 600; }
.legend-label { fill: rgba(0, 0, 0, 0.75); font-size: 11px; }
.legend-line { stroke-width: 3; }
.scope-channel-card { fill: #ffffff; stroke: rgba(0, 0, 0, 0.22); stroke-width: 1; }
.scope-channel-header-text { fill: #ffffff; font-size: 14px; font-weight: 700; }
.scope-channel-detail { fill: rgba(0, 0, 0, 0.42); font-size: 14px; }
.simulation-line { fill: none; stroke-width: 2.5; }
.simulation-point { stroke-width: 0; }
.chart-title { fill: rgba(0, 0, 0, 0.85); font-size: 18px; font-weight: 600; }
`;return Cc("style",{},[Av(e)])}function J_n(e,t){let n=e[t];if(typeof n!=="string")return;return n}function SLr(e,t,n,o){let i=[4,8],s=i.map((u)=>yr(u)).join(" "),c=i.reduce((u,_)=>u+_,0)/3,l=[];e.forEach((u,_)=>{if(u.points.length===0)return;let p=[];u.points.forEach((y,x)=>{let C=yr(n(y.timeMs)),b=yr(o(y.displayValue));p.push(`${x===0?"M":"L"} ${C} ${b}`)});let m={class:"simulation-line",d:p.join(" "),stroke:u.color,"clip-path":`url(#${t})`,[sAn(u.graph)]:Dnt(u.graph)};if(u.graph.source_component_id)m["data-source-component-id"]=u.graph.source_component_id;let A=J_n(u.graph,"source_probe_id");if(A)m["data-source-probe-id"]=A;let g=J_n(u.graph,"source_probe_name");if(g)m["data-source-probe-name"]=g;if(u.graph.subcircuit_connectivity_map_key)m["data-subcircuit-connectivity-map-key"]=u.graph.subcircuit_connectivity_map_key;let f=u.points.map((y)=>{let x=yr(n(y.timeMs)),C=yr(o(y.displayValue));return Cc("circle",{class:"simulation-point",cx:x,cy:C,r:"2.5",fill:u.color,"clip-path":`url(#${t})`})});l.push({entry:u,graphIndex:_,pathAttributes:m,pointElements:f})});let h=[];for(let u=0;u<3;u++)for(let _ of l){let p=(_.graphIndex+u)%3,m=yr(p*c);h.push(Cc("path",{..._.pathAttributes,"stroke-dasharray":s,"stroke-dashoffset":m}))}let d=l.flatMap((u)=>u.pointElements);return Cc("g",{class:"data-series"},[...h,...d])}function PLr(e,t){if(!e?.name)return null;return Cc("text",{class:"chart-title",x:yr(t/2),y:yr(jm.top-40),"text-anchor":"middle"},[Av(e.name)])}function ELr(e,t,n,o){let r=o.map((i,s)=>Cc("tspan",{x:"20",dy:s===0?"0":String(hAn)},[Av(i)]));return Cc("g",{class:"legend-item",transform:`translate(${yr(t)} ${yr(n)})`},[Cc("line",{class:"legend-line",x1:"0",y1:"0",x2:"16",y2:"0",stroke:e.color}),Cc("text",{class:"legend-label",x:"20",y:"0","dominant-baseline":"middle"},r)])}function wLr(e){let t=e.split("_");if(t.length<=1)return[e];let n=[],o=t[0]??"";for(let r=1;r<t.length;r++){let i=t[r]??"",s=`${o}_${i}`;if(s.length>MLr)n.push(o),o=i;else o=s}if(o)n.push(o);return n}function TLr(e,t){let n=jm.top,o=e.map((r)=>{let i=t-jm.right+10,s=wLr(r.label),a=ELr(r,i,n,s),c=s.length*hAn;return n+=Math.max(c,BLr),a});return Cc("g",{class:"legend"},o)}function dAn(e,t){let n=Math.floor((t+IJ)/(PY+IJ)),o=Math.max(1,Math.min(n,e)),r=Math.max(1,Math.ceil(e/o)),i=o*PY+(o-1)*IJ,s=r*GIe+(r-1)*IJ;return{columns:o,rows:r,x:Math.max(0,(t-i)/2),height:s}}function NLr(e,t,n){let o=dAn(e.length,t),r=[];for(let[i,s]of e.entries()){let a=i%o.columns,c=Math.floor(i/o.columns);r.push(RLr(s,i,o.x+a*(PY+IJ),n+xnt+c*(GIe+IJ)))}return Cc("g",{class:"scope-legend"},r)}function RLr(e,t,n,o){let r=e.scopeTraceDisplay,i=N5(e.graph)?"A":"V",s=r&&nde(r)?bnt(r.valuePerDiv,i):`1 ${i}`,a=bnt(r?.center??0,i),c=pLr(r?.offsetDivs??0),l=`Ch${t+1}`,d=[e.label===l?void 0:e.label,`${s}/div`,c,a].filter((_)=>Boolean(_)),u=d.length>1?(GIe-FIe-unt*2-DLr)/(d.length-1):0;return Cc("g",{class:"scope-channel",transform:`translate(${yr(n)} ${yr(o)})`,[sAn(e.graph)]:Dnt(e.graph)},[Cc("rect",{class:"scope-channel-card",x:"0",y:"0",width:yr(PY),height:yr(GIe),rx:"6",ry:"6"}),Cc("rect",{x:"0",y:"0",width:yr(PY),height:yr(FIe),rx:"6",ry:"6",fill:e.color}),Cc("rect",{x:"0",y:yr(FIe-6),width:yr(PY),height:"6",fill:e.color}),Cc("text",{class:"scope-channel-header-text",x:yr(PY/2),y:"14","text-anchor":"middle"},[Av(l)]),...d.map((_,p)=>Cc("text",{class:"scope-channel-detail",x:yr(unt),y:yr(FIe+unt+p*u),"dominant-baseline":"hanging"},[Av(_)]))])}function QLr(e){let t=Math.ceil(e/2),n=Math.floor(e/2);return{left:Z_n(t),right:Z_n(n)}}function Z_n(e){if(e<=1)return 0;let t=10+(e-1)*Cnt+6+lLr+hLr;return Math.max(0,t-jm.left)}function Nnt(e){return e.type==="simulation_transient_voltage_graph"||e.type==="simulation_transient_current_graph"||e.type==="simulation_dc_operating_point_voltage"||e.type==="simulation_dc_operating_point_current"||e.type==="simulation_dc_sweep_voltage_graph"||e.type==="simulation_dc_sweep_current_graph"||e.type==="simulation_ac_sweep_voltage_graph"||e.type==="simulation_ac_sweep_current_graph"}function kLr(e){return e?.type==="simulation_transient_current_graph"}function LLr(e){return e?.type==="simulation_transient_voltage_graph"}function Rnt(e){return e?.type==="simulation_experiment"}function uAn(e){return e?.type==="simulation_voltage_probe"}function pAn(e){return e?.type==="simulation_current_probe"}function mAn(e){return e?.type==="simulation_oscilloscope_trace"}function HLr(e,t){let n=zLr(e),o=aAn(e),r=Math.min(n.length,o.length),i=[],s=FLr(t);for(let a=0;a<r;a++){let c=Number(n[a]??Number.NaN),l=Number(o[a]??Number.NaN);if(!Number.isFinite(c)||!Number.isFinite(l))continue;i.push({timeMs:c,rawValue:l,displayValue:s(l)})}return i}function FLr(e){if(!nde(e))return(r)=>r;let t=e.center??0,n=e.offsetDivs??0,o=e.valuePerDiv;return(r)=>n+(r-t)/o}function zLr(e){let t=aAn(e);if(Array.isArray(e.timestamps_ms)&&e.timestamps_ms.length===t.length)return e.timestamps_ms.map((i)=>Number(i));let n=t.length;if(n===0)return[];let o=[];for(let i=0;i<n;i++)o.push(e.start_time_ms+e.time_per_step*i);let r=o.length>0?o[o.length-1]:void 0;if(r!==void 0&&Number.isFinite(e.end_time_ms)&&Number.isFinite(r)&&Math.abs(r-e.end_time_ms)>e.time_per_step/2)o.push(e.end_time_ms);return o}function UIe(e,t){let n=e[t];if(typeof n!=="string")return;return n}function OLr(e,t,n,o){let r=N5(e)?"I":"V";if(n?.displayName)return n.displayName;if(e.simulation_parameter_sweep_coordinate&&e.name)return e.name;if(t?.name)return`${r}(${t.name})`;let i=UIe(e,"source_probe_name");if(i)return`${r}(${i})`;if(e.source_component_id){let s=o.get(e.source_component_id);if(s)return`${r}(${s})`}if(e.name)return e.name;if(e.source_component_id)return`Probe ${e.source_component_id}`;return Dnt(e)}function VLr(e,t,n,o,r,i){if(N5(e)){let c=o.get(e.simulation_transient_current_graph_id);if(c)return c;let l=UIe(e,"source_probe_id")??(t?.type==="simulation_current_probe"?t.simulation_current_probe_id:void 0);return l?i.get(l):void 0}let s=n.get(e.simulation_transient_voltage_graph_id);if(s)return s;let a=UIe(e,"source_probe_id")??(t?.type==="simulation_voltage_probe"?t.simulation_voltage_probe_id:void 0);return a?r.get(a):void 0}function YLr(e,t,n,o,r){let i=UIe(e,"source_probe_id");if(i){let s=N5(e)?n.get(i):t.get(i);if(s)return s}if(!e.source_component_id)return;return N5(e)?r.get(e.source_component_id):o.get(e.source_component_id)}function GLr(e,t){if(!t)return;return{displayName:t.display_name,color:t.color,center:t.display_center_value,offsetDivs:t.display_center_offset_divs,valuePerDiv:N5(e)?t.amps_per_div:t.volts_per_div}}function ULr(e,t){let n=Array.isArray(Hu.simulation_palette)?Hu.simulation_palette:Array.isArray(Hu.palette)?Hu.palette:[],o=t.filter(uAn),r=t.filter(pAn),i=t.filter(mAn),s=new Map,a=new Map,c=new Map,l=new Map,h=new Map,d=new Map,u=new Map,_=new Map,p=new Map,m=new Map,A=new Map,g=new Map;for(let f of i){if(f.simulation_transient_voltage_graph_id)p.set(f.simulation_transient_voltage_graph_id,f);if(f.simulation_transient_current_graph_id)m.set(f.simulation_transient_current_graph_id,f);if(f.simulation_voltage_probe_id)A.set(f.simulation_voltage_probe_id,f);if(f.simulation_current_probe_id)g.set(f.simulation_current_probe_id,f)}for(let f of o){if(h.set(f.simulation_voltage_probe_id,f),f.name&&f.source_component_id)s.set(f.source_component_id,f.name);if(f.color&&f.source_component_id)a.set(f.source_component_id,f.color);if(f.source_component_id)u.set(f.source_component_id,f)}for(let f of r){if(d.set(f.simulation_current_probe_id,f),f.name&&f.source_component_id)c.set(f.source_component_id,f.name);if(f.color&&f.source_component_id)l.set(f.source_component_id,f.color);if(f.source_component_id)_.set(f.source_component_id,f)}return e.map((f,y)=>{let x=YLr(f,h,d,u,_),C=VLr(f,x,p,m,A,g),b=GLr(f,C),I=HLr(f,b),v=WLr(n,y),P=XLr(f,x,N5(f)?l:a),M=f.color??b?.color??P??v,B=OLr(f,x,b,N5(f)?c:s);return{graph:f,points:I,color:M,label:B,scopeTraceDisplay:b,usesScopeTraceDisplay:nde(b)}}).filter((f)=>f.points.length>0)}function WLr(e,t){if(e.length===0)return K_n;return e[t%e.length]??K_n}function XLr(e,t,n){if(t?.color)return t.color;if(!e.source_component_id)return;return n.get(e.source_component_id)}function _An({circuitJson:e,simulation_experiment_id:t,simulation_transient_current_graph_ids:n,simulation_transient_voltage_graph_ids:o,simulation_result_ids:r,ac_sweep_view:i="magnitude",width:s=aLr,height:a=cLr,includeVersion:c}){let l=o?new Set(o):null,h=n?new Set(n):null,d=Boolean(l||h),u=r?new Set(r):null,_=e.find((X)=>Rnt(X)&&X.simulation_experiment_id===t),p=e.filter((X)=>Nnt(X)&&X.simulation_experiment_id===t&&(!u||u.has(iAn(X)))&&(!d||X.type==="simulation_transient_voltage_graph"&&(l?.has(X.simulation_transient_voltage_graph_id)??!1)||X.type==="simulation_transient_current_graph"&&(h?.has(X.simulation_transient_current_graph_id)??!1))),m=sLr({results:p,acSweepView:i,experiment:_}),A=m.graphs;if(A.length===0)throw Error(`No simulation analysis results found for simulation_experiment_id "${t}"`);let g=ULr(A,e),f=g.flatMap((X)=>X.points);if(f.length===0)throw Error(`Simulation results for simulation_experiment_id "${t}" do not contain any datapoints`);let y=f.map((X)=>X.timeMs),x;if(m.usesLogarithmicXValues)x=jLr(y);else if(m.xAxisTitle==="Time (ms)")x=ALr({values:y,graphs:A,experiment:_});else x=YIe(y);let C=YIe(f.map((X)=>X.displayValue),!0),b=g.some((X)=>X.usesScopeTraceDisplay),I=b?QLr(g.length):{left:0,right:0},v=s+I.left+I.right,P=b?dAn(g.length,v):null,M=P?a+xnt+P.height+xnt:a,B=Math.max(1,s-jm.left-jm.right),T=Math.max(1,a-jm.top-jm.bottom),N=jm.left+I.left,D=q_n(x.domainMin,x.domainMax,N,N+B),L=q_n(C.domainMin,C.domainMax,jm.top+T,jm.top),H=uLr(t),V=Sk(e),O=Pk,U=PLr(_,v),j=[vLr(),xLr(v,M),CLr(H,N,B,T),ILr(N,B,T),bLr({timeAxis:x,valueAxis:C,scaleX:D,scaleY:L,plotLeft:N,plotWidth:B,plotHeight:T}),SLr(g,H,D,L),gLr({timeAxis:x,valueAxis:C,graphs:g,scaleX:D,scaleY:L,plotLeft:N,plotWidth:B,plotHeight:T,yAxisTitle:m.yAxisTitle??dLr(g),xAxisTitle:m.xAxisTitle,usesScopeTraceDisplay:b}),b?NLr(g,v,a):TLr(g,v),...U?[U]:[]],Y=Cc("svg",{xmlns:"http://www.w3.org/2000/svg",width:v.toString(),height:M.toString(),style:`background-color: ${Hu.schematic.background}`,viewBox:`0 0 ${yr(v)} ${yr(M)}`,"data-simulation-experiment-id":t,..._?.name&&{"data-simulation-experiment-name":_.name},...V&&{"data-software-used-string":V},...c&&{"data-circuit-to-svg-version":O}},j);return vk(Y)}function qLr({circuitJson:e,simulation_experiment_id:t,simulation_transient_current_graph_ids:n,simulation_transient_voltage_graph_ids:o,simulation_result_ids:r,ac_sweep_view:i,width:s=KLr,height:a=$Lr,schematicHeightRatio:c=gAn,schematicOptions:l,includeVersion:h,graphAboveSchematic:d=!1,showErrorsInTextOverlay:u}){let _=e.filter((L)=>!Rnt(L)&&!Nnt(L)),p=ZLr(c),m=Math.max(1,a*p),A=Math.max(1,a-m),g=m+A,f=g===0?1:a/g,y=m*f,x=A*f,C=tde(_,{...l,width:s,height:y,includeVersion:!1,showErrorsInTextOverlay:u}),b=_An({circuitJson:e,simulation_experiment_id:t,simulation_transient_current_graph_ids:n,simulation_transient_voltage_graph_ids:o,simulation_result_ids:r,ac_sweep_view:i,width:s,height:x,includeVersion:!1}),I=Ant(ynt.parseSync(C)),v=Ant(ynt.parseSync(b)),P=JLr(v)??{width:s,height:x},M=P.width>0?s*(P.height/P.width):x,B=y+M,T=[];if(d)T.push(Khe(v,0,0,s,M)),T.push(Khe(I,0,M,s,y));else T.push(Khe(I,0,0,s,y)),T.push(Khe(v,0,y,s,M));let N=Sk(_),D={name:"svg",type:"element",value:"",attributes:{xmlns:"http://www.w3.org/2000/svg",width:Xm(s),height:Xm(B),viewBox:`0 0 ${Xm(s)} ${Xm(B)}`,"data-simulation-experiment-id":t,...N&&{"data-software-used-string":N},...h&&{"data-circuit-to-svg-version":Pk}},children:T};return vk(D)}function JLr(e){let t=e.attributes?.viewBox;if(typeof t!=="string")return null;let n=t.trim().split(/[\s,]+/).map((i)=>Number.parseFloat(i));if(n.length!==4)return null;let o=n.at(2),r=n.at(3);if(!Number.isFinite(o)||!Number.isFinite(r))return null;if(o===void 0||r===void 0)return null;if(o<=0||r<=0)return null;return{width:o,height:r}}function ZLr(e){if(!Number.isFinite(e))return gAn;if(e<=0)return 0;if(e>=1)return 1;return e}function eHr(e,t){let{POSITIVE_INFINITY:n,POSITIVE_INFINITY:o,NEGATIVE_INFINITY:r,NEGATIVE_INFINITY:i}=Number,s=e.filter((M)=>M.type==="pcb_board"||M.type==="pcb_panel"||M.type==="pcb_solder_paste"&&M.layer===t.layer);for(let M of s)if(M.type==="pcb_board"){if(M.outline&&Array.isArray(M.outline)&&M.outline.length>=3)P(M.outline);else if("center"in M&&"width"in M&&"height"in M)v(M.center,M.width,M.height)}else if(M.type==="pcb_panel"){let B=M,T=Ke.parse(B.width),N=Ke.parse(B.height);if(T!==void 0&&N!==void 0){let D=B.center??{x:T/2,y:N/2};v(D,T,N)}}else if(M.type==="pcb_solder_paste"&&M.shape==="polygon")P(M.points);else if(M.type==="pcb_solder_paste"&&"x"in M&&"y"in M)v({x:M.x,y:M.y},0,0);let a=1,c=r-n+2*a,l=i-o+2*a,h=t.width??800,d=t.height??600,u=h/c,_=d/l,p=Math.min(u,_),m=(h-c*p)/2,A=(d-l*p)/2,g=Ts(Rc(m-n*p+a*p,d-A+o*p-a*p),Lu(p,-p)),f={transform:g,layer:t.layer,colorMap:tp},y=s.sort((M,B)=>(egn.indexOf(B.type)??9999)-(egn.indexOf(M.type)??9999)).flatMap((M)=>tHr({elm:M,ctx:f})),x=Sk(e),C=Pk,b=[{name:"style",type:"element",children:[{type:"text",value:""}]},{name:"rect",type:"element",attributes:{class:"boundary",x:"0",y:"0",fill:"#000",width:h.toString(),height:d.toString()}},nHr(g,n,o,r,i),...y].filter((M)=>M!==null);if(t?.showErrorsInTextOverlay){let M=MJ(e);if(M)b.push(M)}let I={name:"svg",type:"element",attributes:{xmlns:"http://www.w3.org/2000/svg",width:h.toString(),height:d.toString(),...x&&{"data-software-used-string":x},...t.includeVersion&&{"data-circuit-to-svg-version":C}},value:"",children:b};try{return vk(I)}catch(M){throw console.error("Error stringifying SVG object:",M),M}function v(M,B,T){let N=B/2,D=T/2;n=Math.min(n,M.x-N),o=Math.min(o,M.y-D),r=Math.max(r,M.x+N),i=Math.max(i,M.y+D)}function P(M){for(let B of M)n=Math.min(n,B.x),o=Math.min(o,B.y),r=Math.max(r,B.x),i=Math.max(i,B.y)}}function tHr({elm:e,ctx:t}){let{transform:n}=t;switch(e.type){case"pcb_board":return Pgn(e,t);case"pcb_solder_paste":return Egn(e,t);default:return[]}}function nHr(e,t,n,o,r){let[i,s]=Pt(e,[t,n]),[a,c]=Pt(e,[o,r]),l=Math.abs(a-i),h=Math.abs(c-s),d=Math.min(i,a),u=Math.min(s,c);return{name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-boundary",fill:"none",stroke:"#fff","stroke-width":"0.3",x:d.toString(),y:u.toString(),width:l.toString(),height:h.toString()}}}var Agn,Hqs,fgn,PJs,QJs,GJs,ZJs,QZs,FZs,rAn,ynt,iea,vDr,Hhe=(e,t)=>({name:"g",type:"element",value:"",attributes:e,children:t}),D5=0.000000001,tp,Pqs,Eqs,Mqs,wqs,HDr,gv=(e,t,n=[])=>({name:e,type:"element",value:"",attributes:t,children:n}),$tt=(e,t)=>gv("text",t,[{name:"",type:"text",value:e,attributes:{},children:[]}]),EIe,qDr,d_n=100,eNr,MY="TscircuitAlphabet",u_n="data-tscircuit-alphabet-font",ygn,Km,Xqs,xNr="rgba(255,255,255,0.5)",CNr="rgba(255,255,255,0.2)",INr=1.5,vNr=0.6,SNr=0.3,Hu,MNr,BNr,TNr,NNr,QNr,Cgn="BEND LINE",LNr,g_n=0.94,MIe=0.045,bgn,A_n,$Nr=0,wIe=1,yJ=0.2,f_n=1.4,y_n=0.53,ZNr=0,x_n=0.05,O3=4,C_n=8,Ign=11,vJ=1,CJ=5,b_n=1.5,vgn=2,ent,tnt,jhe,lRr=15,hRr=10,dRr=0.2,uRr=50,yRr=(e,t)=>{let n=Vo(t).pcb_smtpad.get(e);if(n&&"x"in n&&"y"in n)return{x:n.x,y:n.y};let o=Vo(t).pcb_plated_hole.get(e);if(o&&"x"in o&&"y"in o)return{x:o.x,y:o.y};return null},xRr=(e,t,n,o)=>{let r=n.getIdsConnectedToNet(t),i=null,s=1/0;for(let a of r){let c=yRr(a,o);if(c){let l=e.x-c.x,h=e.y-c.y,d=Math.sqrt(l*l+h*h);if(d>0&&d<s)s=d,i=c}}return i},Mnt="pcb-keepout-pattern",bJ=20,vRr=5,nnt="rgba(255, 107, 107, 0.2)",BRr="rgba(255, 255, 255, 0.5)",I_n="pcb-grid-pattern",v_n,QRr=0.1,FRr,Pk,GRr=({circuitJson:e,drawPaddingOutsideBoard:t,baseBounds:n,viewportOptions:o})=>{let r=t?1:0,i=t||!n.hasBoardBounds?n.minX:n.boardMinX,s=t||!n.hasBoardBounds?n.minY:n.boardMinY,a=t||!n.hasBoardBounds?n.maxX:n.boardMaxX,c=t||!n.hasBoardBounds?n.maxY:n.boardMaxY,l=!1,{POSITIVE_INFINITY:h,POSITIVE_INFINITY:d,NEGATIVE_INFINITY:u,NEGATIVE_INFINITY:_}=Number,p=new Map,m=new Map;for(let A of e)if(A.type==="pcb_panel"){let g=A,f=S_n(g.center,g.width,g.height);if(!f)continue;if(h=Math.min(h,f.minX),d=Math.min(d,f.minY),u=Math.max(u,f.maxX),_=Math.max(_,f.maxY),l=!0,g.pcb_panel_id)p.set(g.pcb_panel_id,f)}else if(A.type==="pcb_board"){let g=A,y=URr(g.outline)??S_n(g.center,g.width,g.height);if(y&&g.pcb_board_id)m.set(g.pcb_board_id,y)}if(o?.viewport){let{minX:A,minY:g,maxX:f,maxY:y}=o.viewport;i=A,s=g,a=f,c=y,r=0}else if(o?.viewportTarget?.pcb_panel_id){let A=p.get(o.viewportTarget.pcb_panel_id);if(!A)throw Error(`Viewport target panel '${o.viewportTarget.pcb_panel_id}' not found`);i=A.minX,s=A.minY,a=A.maxX,c=A.maxY,r=0}else if(o?.viewportTarget?.pcb_board_id){let A=m.get(o.viewportTarget.pcb_board_id);if(!A)throw Error(`Viewport target board '${o.viewportTarget.pcb_board_id}' not found`);i=A.minX,s=A.minY,a=A.maxX,c=A.maxY,r=0}else if(l)i=h,s=d,a=u,c=_;return{boundsMinX:i,boundsMinY:s,boundsMaxX:a,boundsMaxY:c,padding:r}},WRr=0.5,XRr=0.42,jRr=0.58,KRr=0.75,M_n="rgb(255, 208, 66)",Mgn="#ff4d4d",ZRr=(e)=>({type:"text",value:e,name:"",attributes:{},children:[]}),int=({label:e,x:t,y:n,style:o,anchor:r="start"})=>e?[{name:"text",type:"element",value:"",attributes:{x:t.toString(),y:n.toString(),fill:Mgn,"font-family":"monospace","font-size":o.fontSize.toString(),"font-weight":"600","text-anchor":r},children:[ZRr(e)]}]:[],eQr=(e)=>({"data-type":"pcb_debug_object","data-pcb-layer":"overlay","data-pcb-debug-object-id":e.pcb_debug_object_id,"data-debug-shape":e.shape}),rQr,TIe,cQr,bk=(e,t)=>t??cQr[e],V3=(e,t,n)=>Math.abs(e.a)*bk(t,n),ant="rgb(190, 190, 190)",Fhe="rgb(210, 210, 210)",zhe="rgb(190, 190, 190)",Ohe="rgb(210, 210, 210)",B_n,xQr="rgb(26, 115, 143)",CQr="rgba(0,0,0,0.9)",IQr="rgba(120, 120, 120, 0.6)",vQr="rgba(255, 255, 255, 0.9)",cnt="rgb(50, 50, 50)",Vhe="rgb(218, 165, 32)",Yhe="rgb(40, 40, 40)",Ghe="rgb(218, 165, 32)",T_n="rgb(255, 255, 255)",D_n="rgb(0, 0, 0)",wQr="rgba(0, 0, 0, 0.6)",BQr="rgb(200, 200, 200)",TQr="rgb(0, 0, 0)",wgn=1.6,NQr=0.5238095238095238,RQr=0.6,Bgn=0.1,Tgn=0.1,gnt=3,Dgn=0.1,QQr=0.8,kQr=({left_labels:e,right_labels:t,transform:n,soup:o,board_bounds:r,svgWidth:i,svgHeight:s,styleScale:a})=>{let c=new Map,l={transform:n,soup:o,board_bounds:r};return N_n("left",e,{...l,svgHeight:s,styleScale:a},c),N_n("right",t,{...l,svgHeight:s,styleScale:a},c),c},R_n,Q_n,Zhe=(e)=>{if(!e)return 0;let t=0;for(let n of e){let o=Q_n[n];if(o)t+=o.width;else t+=Q_n["?"].width}return t/27},Ngn=0.65,Rgn=0.08,wJ=(e)=>{switch(e){case"top":return{x:0,y:-1};case"bottom":return{x:0,y:1};case"left":return{x:1,y:0};case"right":return{x:-1,y:0}}throw Error(`Invalid side: ${e}`)},Ck=0.3,SJ=0.3,PJ=0.06,Qgn=0.2,kgn=(e)=>({"data-circuit-json-type":"schematic_net_label","data-schematic-net-label-id":e.schematic_net_label_id}),GQr,k_n,XQr=(e,t)=>{let n=e<0?e+2*Math.PI:e,o=t<0?t+2*Math.PI:t,r=Math.abs(n-o);if(r>Math.PI)r=2*Math.PI-r;return r},Lgn=({schPorts:e,symbol:t,schComponent:n})=>{let o=e.map((a)=>{let c=a.center.x-n.center.x,l=a.center.y-n.center.y;return{port:a,angle:Math.atan2(l,c)}}),r=t.ports.map((a)=>{let c=a.x-t.center.x,l=a.y-t.center.y;return{port:a,angle:Math.atan2(l,c)}});o.sort((a,c)=>a.angle-c.angle),r.sort((a,c)=>a.angle-c.angle);let i=[],s=new Set;for(let a of o){let c=null;for(let l of r){if(s.has(l.port))continue;let h=XQr(a.angle,l.angle);if(c===null||h<c.angleDiff)c={symbolPort:l.port,angleDiff:h}}if(c&&c.angleDiff<Math.PI/4)i.push({schPort:a.port,symbolPort:c.symbolPort}),s.add(c.symbolPort)}return i},zgn=(e,t)=>{if(e.column_widths&&e.column_widths.length>0&&e.row_heights&&e.row_heights.length>0){let h=(d)=>{if(typeof d==="number")return d;if(d.endsWith("mm"))return parseFloat(d);if(d.endsWith("in"))return parseFloat(d)*25.4;return parseFloat(d)};return{column_widths:e.column_widths.map(h),row_heights:e.row_heights.map(h)}}let n=t.filter((h)=>h.type==="schematic_table_cell"&&h.schematic_table_id===e.schematic_table_id);if(n.length===0)return{column_widths:[],row_heights:[]};let o=n.reduce((h,d)=>Math.max(h,d.end_column_index),-1)+1,r=n.reduce((h,d)=>Math.max(h,d.end_row_index),-1)+1,{cell_padding:i=0.2}=e,s=Array(o).fill(0),a=Array(r).fill(0),c={},l={};for(let h of n){let d=bk("reference_designator",h.font_size),_=Zhe(h.text??"")*d+2*i,p=d*1.2+2*i,m=`${h.start_row_index}-${h.start_column_index}`;c[m]=_,l[m]=p}for(let h=0;h<r;h++)for(let d=0;d<o;d++){let u=`${h}-${d}`;if(c[u]&&c[u]>s[d])s[d]=c[u];if(l[u]&&l[u]>a[h])a[h]=l[u]}for(let h of n){if(h.start_column_index===h.end_column_index&&h.start_row_index===h.end_row_index)continue;let d=`${h.start_row_index}-${h.start_column_index}`,u=c[d],_=l[d];if(u===void 0||_===void 0)continue;let p=0;for(let A=h.start_column_index;A<=h.end_column_index;A++)p+=s[A];if(u>p){let g=(u-p)/(h.end_column_index-h.start_column_index+1);for(let f=h.start_column_index;f<=h.end_column_index;f++)s[f]+=g}let m=0;for(let A=h.start_row_index;A<=h.end_row_index;A++)m+=a[A];if(_>m){let g=(_-m)/(h.end_row_index-h.start_row_index+1);for(let f=h.start_row_index;f<=h.end_row_index;f++)a[f]+=g}}return{column_widths:s,row_heights:a}},JQr=10.16,ZQr=1.1,Ik,ekr,tkr,xZs,DIe,ede="image/svg+xml",H_=(e)=>Math.abs(e.a)*0.02,fnt=({text:e,realCenter:t,realToScreenTransform:n})=>{let o=Pt(n,t);return{type:"element",name:"text",value:"",attributes:{x:o.x.toString(),y:o.y.toString(),fill:"red","text-anchor":"middle","dominant-baseline":"middle","font-family":"sans-serif","font-size":`${V3(n,"error")}px`},children:[{type:"text",value:e,name:"",attributes:{},children:[]}]}},ikr=({schNetLabel:e,realToScreenTransform:t,colorMap:n})=>{if(!e.text)return[];let o=e.text.startsWith("N_"),r=o?e.text.slice(2):e.text,i=kgn(e),s=[],a=zs[e.symbol_name];if(!a){let H=fnt({text:`Symbol not found: ${e.symbol_name}`,realCenter:e.center,realToScreenTransform:t});return H.attributes={...H.attributes,...i},s.push(H),s}let c=a.primitives.filter((H)=>H.type==="path"),l=a.primitives.filter((H)=>H.type==="text"),h=a.primitives.filter((H)=>H.type==="circle"),d=a.primitives.filter((H)=>H.type==="box"),u={minX:Math.min(...c.flatMap((H)=>H.points.map((V)=>V.x))),maxX:Math.max(...c.flatMap((H)=>H.points.map((V)=>V.x))),minY:Math.min(...c.flatMap((H)=>H.points.map((V)=>V.y))),maxY:Math.max(...c.flatMap((H)=>H.points.map((V)=>V.y)))},_=bk("net_label"),m=VIe({...e,text:r})+Ck*2+PJ*r.length+SJ,A=wJ(e.anchor_side),g=e.anchor_position??{x:e.center.x-A.x*m*_/2,y:e.center.y-A.y*m*_/2},y=qg(0/180*Math.PI),x={minX:Math.min(...a.primitives.flatMap((H)=>H.type==="path"?H.points.map((V)=>V.x):[])),maxX:Math.max(...a.primitives.flatMap((H)=>H.type==="path"?H.points.map((V)=>V.x):[])),minY:Math.min(...a.primitives.flatMap((H)=>H.type==="path"?H.points.map((V)=>V.y):[])),maxY:Math.max(...a.primitives.flatMap((H)=>H.type==="path"?H.points.map((V)=>V.y):[]))},C=a.ports?.[0]?{x:a.ports[0].x,y:a.ports[0].y}:{x:x.minX,y:(x.minY+x.maxY)/2},b=Pt(y,C),I=Ts(Rc(g.x-b.x,g.y-b.y),y,Lu(1)),[v,P]=Pt(Ts(t,I),[u.minX,u.minY]),[M,B]=Pt(Ts(t,I),[u.maxX,u.maxY]),T=Math.abs(B-P),N=Math.min(P,B),D=Math.abs(M-v),L=Math.min(v,M);s.push({name:"rect",type:"element",value:"",attributes:{class:"component-overlay sch-component-overlay sch-net-label-overlay",...i,x:L.toString(),y:N.toString(),width:D.toString(),height:T.toString(),fill:"transparent"},children:[]});for(let H of c){let V=H.points.map((O,U)=>{let[j,Y]=Pt(Ts(t,I),[O.x,O.y]);return`${U===0?"M":"L"} ${j} ${Y}`}).join(" ");s.push({name:"path",type:"element",attributes:{class:"sch-net-label-symbol-path",...i,d:V+(H.closed?" Z":""),stroke:n.schematic.component_outline,fill:"none","stroke-width":`${H_(t)}px`,"stroke-linecap":"round"},value:"",children:[]})}for(let H of l){let V=Pt(Ts(t,I),H),O=H.text;if(O==="{REF}")O=r||"";else if(O==="{VAL}")O="";let j=Math.abs(t.a)*0.1,Y={x:V.x,y:V.y};s.push({name:"text",type:"element",attributes:{class:"sch-net-label-symbol-text",...i,x:Y.x.toString(),y:Y.y.toString(),fill:n.schematic.label_local,"font-family":"sans-serif","text-anchor":GQr[H.anchor],"dominant-baseline":k_n[H.anchor],"font-size":`${V3(t,"reference_designator")}px`,...o&&O===r?{style:"text-decoration: overline;"}:{}},children:Bnt(O,H.text==="{REF}"?e.display_superscript:void 0,V3(t,"reference_designator"),k_n[H.anchor]),value:""})}for(let H of d){let V=Pt(Ts(t,I),H),O=Ts(t,I).a;s.push({name:"rect",type:"element",attributes:{class:"sch-net-label-symbol-box",...i,x:V.x.toString(),y:V.y.toString(),width:(H.width*O).toString(),height:(H.height*O).toString(),fill:"red"},value:"",children:[]})}for(let H of h){let V=Pt(Ts(t,I),H),O=Ts(t,I).a;s.push({name:"circle",type:"element",attributes:{class:"sch-net-label-symbol-circle",...i,cx:V.x.toString(),cy:V.y.toString(),r:(H.radius*O).toString(),fill:"none",stroke:n.schematic.component_outline,"stroke-width":`${H_(t)}px`},value:"",children:[]})}return s},skr=({schNetLabel:e,realToScreenTransform:t,colorMap:n})=>{if(!e.text)return[];let o=e.text;if(e.symbol_name)return ikr({schNetLabel:e,realToScreenTransform:t,colorMap:n});let r=kgn(e),i=[],s=V3(t,"net_label"),a=bk("net_label"),c=Qgn/a/2,l=VIe({...e,text:o}),h=Pt(t,e.center),d=wJ(e.anchor_side),u={...d};u.y*=-1;let _=l+Ck*2+PJ*o.length+SJ,p=e.anchor_position?Pt(t,e.anchor_position):{x:h.x-u.x*_*s/2,y:h.y-u.y*_*s/2},m=e.anchor_position??{x:e.center.x-d.x*_*a/2,y:e.center.y-d.y*_*a/2},A={left:0,top:-90,bottom:90,right:180}[e.anchor_side],g=[{x:0,y:0},{x:Ck,y:c},{x:Ck*2+SJ+PJ*o.length+l,y:c},{x:Ck*2+SJ+PJ*o.length+l,y:-c},{x:Ck,y:-c}].map((b)=>Pt(Ts(t,Rc(m.x,m.y),Lu(a),qg(A/180*Math.PI)),b)),f=`
    M ${g[0].x},${g[0].y}
    L ${g[1].x},${g[1].y}
    L ${g[2].x},${g[2].y}
    L ${g[3].x},${g[3].y}
    L ${g[4].x},${g[4].y}
    Z
  `;i.push({name:"path",type:"element",attributes:{class:"net-label sch-net-label",...r,d:f,fill:n.schematic.label_background,stroke:n.schematic.label_global,"stroke-width":`${H_(t)}px`},value:"",children:[]});let y={x:p.x+u.x*s*0.5,y:p.y+u.y*s*0.5},x={left:"start",top:"start",bottom:"start",right:"end"}[e.anchor_side],C={left:"",right:"",top:`rotate(90 ${y.x} ${y.y})`,bottom:`rotate(-90 ${y.x} ${y.y})`}[e.anchor_side];return i.push({name:"text",type:"element",attributes:{class:"net-label-text sch-net-label-text",...r,x:y.x.toString(),y:y.y.toString(),fill:n.schematic.label_global,"text-anchor":x,"dominant-baseline":"central","font-family":"sans-serif","font-variant-numeric":"tabular-nums","font-size":`${s}px`,transform:C},children:Bnt(o,e.display_superscript,s),value:""}),i},akr=0.02,ckr=({schPort:e,transform:t})=>{let n=Pt(t,e.center),o=Math.abs(t.a)*akr*2;return[{name:"g",type:"element",value:"",attributes:{class:"schematic-port-hover sch-port-hover","data-schematic-port-id":e.source_port_id,...e.schematic_sheet_id?{"data-schematic-sheet-id":e.schematic_sheet_id}:{}},children:[{name:"circle",type:"element",value:"",attributes:{cx:n.x.toString(),cy:n.y.toString(),r:o.toString(),fill:"red",opacity:"0"},children:[]}]}]},Ggn=({component:e,transform:t,circuitJson:n})=>{let o=Vo(n).schematic_port.list({schematic_component_id:e.schematic_component_id}),r=[];for(let i of o)r.push(...ckr({schPort:i,transform:t}));return r},lkr=({schPort:e,transform:t,colorMap:n})=>{let{x:r,y:i}=e.center,s=[-1,1].map((a)=>{let c=Pt(t,{x:r-0.05,y:i-a*0.05}),l=Pt(t,{x:r+0.05,y:i+a*0.05});return`M ${c.x} ${c.y} L ${l.x} ${l.y}`}).join(" ");return{name:"path",type:"element",value:"",attributes:{class:"sch-port-no-connect","data-schematic-port-id":e.schematic_port_id,"data-source-port-id":e.source_port_id,d:s,fill:"none",stroke:n.schematic.no_connect,"stroke-width":`${H_(t)}px`,"stroke-linecap":"round"},children:[]}},H_n=0.02,hkr=({schPort:e,transform:t,circuitJson:n,colorMap:o})=>{let r=[],i=Math.abs(t.a)*H_n,s=Math.abs(t.a)*H_n,a=Pt(t,e.center),c=n.find((h)=>h.type==="source_port"&&h.source_port_id===e.source_port_id);if(!c?.do_not_connect)r.push({name:"circle",type:"element",value:"",attributes:{class:"component-pin sch-component-pin sch-port-indicator",cx:a.x.toString(),cy:a.y.toString(),r:i.toString(),fill:"none",stroke:o.schematic.component_outline,"stroke-width":s.toString(),"data-schematic-port-id":e.schematic_port_id},children:[]});let l=e.display_pin_label??c?.name;if(l){let h={...e.center},d=e.distance_from_component_edge??0,u=0.05,_="middle",p="";switch(e.facing_direction){case"left":h.x+=d/2,h.y+=0.05,_="start";break;case"right":h.x-=d/2,h.y+=0.05,_="end";break;case"up":h.y-=d/2,h.x-=0.05,_="middle";break;case"down":h.y+=d/2,h.x-=0.05,_="middle";break}let m=Pt(t,h),A=V3(t,"pin_number");if(e.facing_direction==="up"||e.facing_direction==="down")p=`rotate(-90 ${m.x} ${m.y})`;r.push({name:"text",type:"element",value:"",attributes:{class:"port-indicator-label sch-port-label",x:m.x.toString(),y:m.y.toString(),fill:o.schematic.component_outline,"font-family":"sans-serif","font-size":`${A*0.7}px`,"text-anchor":_,"dominant-baseline":"middle",...p&&{transform:p}},children:[{type:"text",value:l,name:"",attributes:{},children:[]}]})}return r},Ugn=(e)=>({type:"element",name:"tspan",value:"",attributes:e.is_overlined?{"text-decoration":"overline"}:{},children:[{type:"text",name:"",value:e.text,attributes:{},children:[]}]}),dkr=(e)=>e.filter((t)=>t.text).map(Ugn),ukr=(e)=>{let t=[[]];for(let n of e)n.text.split(`
`).forEach((o,r)=>{if(r>0)t.push([]);if(o)t.at(-1).push(Ugn({...n,text:o}))});return t},Tnt=({elm:e,transform:t,colorMap:n})=>{let o=Pt(t,e.position),r={center:"middle",center_right:"end",bottom_left:"start",bottom_center:"middle",bottom_right:"end",left:"start",right:"end",top:"middle",bottom:"middle",top_left:"start",top_center:"middle",top_right:"end",center_left:"start"},i={center:"middle",center_right:"middle",bottom_left:"ideographic",bottom_center:"ideographic",bottom_right:"ideographic",left:"middle",right:"middle",top:"hanging",bottom:"ideographic",top_left:"hanging",top_center:"hanging",top_right:"hanging",center_left:"middle"},s=e.text.split(`
`),a=ukr(e.text_parts??[]),c=s.length===1?e.text_parts?.length?a[0]:[{type:"text",value:e.text,name:e.schematic_text_id,attributes:{},children:[]}]:s.map((l,h)=>({type:"element",name:"tspan",value:"",attributes:{x:o.x.toString(),...h>0?{dy:"1em"}:{}},children:e.text_parts?.length?a[h]??[]:[{type:"text",value:l,name:h===0?e.schematic_text_id:"",attributes:{},children:[]}]}));if(e.display_superscript)(s.length===1?c:c[c.length-1].children).push(...Bnt("",e.display_superscript,V3(t,"reference_designator",e.font_size),i[e.anchor]).slice(1));return{type:"element",name:"text",value:"",attributes:{class:"sch-text","data-schematic-text-id":e.schematic_text_id,x:o.x.toString(),y:o.y.toString(),fill:e.color??n.schematic.sheet_label,"text-anchor":r[e.anchor],"dominant-baseline":i[e.anchor],"font-family":"sans-serif","font-size":`${V3(t,"reference_designator",e.font_size)}px`,transform:`rotate(${e.rotation}, ${o.x}, ${o.y})`},children:c}},pkr=({schematicBox:e,transform:t,colorMap:n})=>{let o=Pt(t,{x:e.x,y:e.y}),r=Pt(t,{x:e.x+e.width,y:e.y+e.height}),i=Math.min(o.y,r.y),s=Math.max(o.y,r.y),a=Math.min(o.x,r.x),c=Math.max(o.x,r.x),l=H_(t),h={class:"schematic-box sch-box",x:a.toString(),y:i.toString(),width:(c-a).toString(),height:(s-i).toString(),"stroke-width":`${l}px`,stroke:n.schematic.component_outline||"black",fill:"transparent"};if(e.is_dashed){let d=8*l,u=4*l;h["stroke-dasharray"]=`${d} ${u}`}return[{name:"rect",type:"element",value:"",attributes:h,children:[]}]},jgn=(e,t)=>{for(let n of e){if(n.type!=="source_trace")continue;let o=n;if(Array.isArray(o.connected_source_port_ids)&&o.connected_source_port_ids.includes(t))return!0}return!1},mkr,_kr,gkr=({component:e,transform:t,circuitJson:n,colorMap:o})=>{let r=[],i=zs[e.symbol_name];if(!i)return[fnt({text:`Symbol not found: ${e.symbol_name}`,realCenter:e.center,realToScreenTransform:t})];let s=Vo(n).schematic_port.list({schematic_component_id:e.schematic_component_id}),a=Vo(n).source_component.get(e.source_component_id),c=Lgn({schPorts:s,symbol:i,schComponent:e});if(!c[0])return[fnt({text:`Could not match ports for symbol ${e.symbol_name}`,realCenter:e.center,realToScreenTransform:t})];let l=Hgn(c[1]?.symbolPort??i.center,c[1]?.schPort.center??e.center,c[0].symbolPort,c[0].schPort.center),h=i.primitives.filter((v)=>v.type==="path"),d=i.primitives.filter((v)=>v.type==="text"),u=i.primitives.filter((v)=>v.type==="circle"),_=i.primitives.filter((v)=>v.type==="box"),p=new Set;for(let v of c)if(jgn(n,v.schPort.source_port_id)||Vo(n).source_port.get(v.schPort.source_port_id)?.do_not_connect)p.add(v.symbolPort);let m={minX:Math.min(...h.flatMap((v)=>v.points.map((P)=>P.x))),maxX:Math.max(...h.flatMap((v)=>v.points.map((P)=>P.x))),minY:Math.min(...h.flatMap((v)=>v.points.map((P)=>P.y))),maxY:Math.max(...h.flatMap((v)=>v.points.map((P)=>P.y)))},[A,g]=Pt(Ts(t,l),[m.minX,m.minY]),[f,y]=Pt(Ts(t,l),[m.maxX,m.maxY]),x=Math.abs(y-g),C=Math.min(g,y),b=Math.abs(f-A),I=Math.min(A,f);r.push({name:"rect",type:"element",value:"",attributes:{class:"component-overlay sch-component-overlay",x:I.toString(),y:C.toString(),width:b.toString(),height:x.toString(),fill:"transparent"},children:[]});for(let v of h){let{points:P,color:M,closed:B,fill:T}=v;r.push({type:"element",name:"path",attributes:{class:"sch-component-symbol-path",d:P.map((N,D)=>{let[L,H]=Pt(Ts(t,l),[N.x,N.y]);return`${D===0?"M":"L"} ${L} ${H}`}).join(" ")+(B?" Z":""),stroke:o.schematic.component_outline,fill:"none","stroke-width":`${H_(t)}px`,"stroke-linecap":"round"},value:"",children:[]})}for(let v of d){let P=Pt(Ts(t,l),v),M="",B=v.text==="{REF}";if(B)M=a?.display_name??a?.name??"";else if(v.text==="{VAL}")M=e.symbol_display_value??"";let T=_kr[v.anchor];r.push({name:"text",type:"element",attributes:{class:B?"sch-component-name sch-component-text":"sch-component-text",x:P.x.toString(),y:P.y.toString(),...B?{stroke:o.schematic.background,"stroke-width":`${H_(t)}px`,"paint-order":"stroke"}:{},fill:o.schematic.label_local,"font-family":"sans-serif","text-anchor":mkr[v.anchor],"dominant-baseline":T,"font-size":`${V3(t,"reference_designator")}px`},value:"",children:[{type:"text",value:M,name:"",attributes:{},children:[]}]})}for(let v of _){let P=Pt(Ts(t,l),v),M=Ts(t,l).a;r.push({name:"rect",type:"element",attributes:{class:"sch-component-symbol-box",x:P.x.toString(),y:P.y.toString(),width:(v.width*M).toString(),height:(v.height*M).toString(),fill:"red"},value:"",children:[]})}for(let v of i.ports){if(p.has(v))continue;let P=Pt(Ts(t,l),v);r.push({type:"element",name:"circle",attributes:{class:"component-pin sch-component-pin",cx:P.x.toString(),cy:P.y.toString(),r:`${Math.abs(t.a)*0.02}px`,"stroke-width":`${H_(t)}px`,fill:"none",stroke:o.schematic.component_outline},value:"",children:[]})}for(let v of u){let P=Pt(Ts(t,l),v),M=Math.abs(v.radius*t.a);r.push({type:"element",name:"circle",attributes:{class:"sch-component-symbol-circle",cx:P.x.toString(),cy:P.y.toString(),r:`${M}px`,"stroke-width":`${H_(t)}px`,fill:"none",stroke:o.schematic.component_outline},value:"",children:[]})}return r},Uhe=0.02,F_n=(e,t,n,o,r)=>{let i=Math.PI/6,s={x:e.x-n*Math.cos(t-i),y:e.y-n*Math.sin(t-i)},a={x:e.x-n*Math.cos(t+i),y:e.y-n*Math.sin(t+i)};return{name:"polygon",type:"element",attributes:{points:`${e.x},${e.y} ${s.x},${s.y} ${a.x},${a.y}`,fill:"white",stroke:o,"stroke-width":`${r}px`},value:"",children:[]}},Akr=({schPort:e,schComponent:t,transform:n,circuitJson:o})=>{let r=[],i=Vo(o).source_port.get(e.source_port_id),s={x:e.center.x,y:e.center.y},a=e.distance_from_component_edge??0.4;switch(e.side_of_component){case"left":s.x+=a;break;case"right":s.x-=a;break;case"top":s.y-=a;break;case"bottom":s.y+=a;break}let c=Pt(n,e.center),l=Pt(n,s),h=i!=null&&i.source_component_id==null&&typeof e.is_connected==="boolean"?e.is_connected:jgn(o,e.source_port_id),d=e.is_drawn_with_inversion_circle??!1,u=0.06,_={...e.center};if(!h&&!i?.do_not_connect)switch(e.side_of_component){case"left":_.x+=Uhe;break;case"right":_.x-=Uhe;break;case"top":_.y-=Uhe;break;case"bottom":_.y+=Uhe;break}let p=Pt(n,_);if(d){let y=Math.abs(n.a)*u,x={...l};switch(e.side_of_component){case"left":x.x-=y,l.x-=y*2;break;case"right":x.x+=y,l.x+=y*2;break;case"top":x.y-=y,l.y-=y*2;break;case"bottom":x.y+=y,l.y+=y*2;break}r.push({name:"circle",type:"element",attributes:{class:"component-pin sch-component-pin sch-inversion-bubble",cx:x.x.toString(),cy:x.y.toString(),r:y.toString(),fill:"white",stroke:Hu.schematic.component_outline,"stroke-width":`${H_(n)}px`},value:"",children:[]})}r.push({name:"line",type:"element",attributes:{class:"component-pin sch-component-pin sch-port-line",x1:l.x.toString(),y1:l.y.toString(),x2:p.x.toString(),y2:p.y.toString(),"stroke-width":`${H_(n)}px`},value:"",children:[]});let m=Math.abs(n.a)*Uhe,A=[];if(!h&&!i?.do_not_connect)A.push({name:"circle",type:"element",attributes:{class:"component-pin sch-component-pin sch-port-terminal",cx:c.x.toString(),cy:c.y.toString(),r:m.toString(),"stroke-width":`${H_(n)}px`},value:"",children:[]});A.push({name:"rect",type:"element",attributes:{x:(c.x-m).toString(),y:(c.y-m).toString(),width:(m*2).toString(),height:(m*2).toString(),opacity:"0"},value:"",children:[]}),r.push({name:"g",type:"element",value:"",attributes:{class:"sch-port","data-schematic-port-id":e.source_port_id},children:A});let{has_input_arrow:g,has_output_arrow:f}=e;if((g||f)&&e.side_of_component){let y=Math.abs(n.a)*0.1,x=Hu.schematic.component_outline,C=y*Math.cos(Math.PI/6),b=H_(n)/3,I=0,v=0;if(e.side_of_component==="left")I=0,v=Math.PI;else if(e.side_of_component==="right")I=Math.PI,v=0;else if(e.side_of_component==="top")I=Math.PI/2,v=-Math.PI/2;else if(e.side_of_component==="bottom")I=-Math.PI/2,v=Math.PI/2;let P=g&&f,M={...l},B={...l};if(P){let T=C;if(e.side_of_component==="left")B.x-=T;else if(e.side_of_component==="right")B.x+=T;else if(e.side_of_component==="top")B.y-=T;else if(e.side_of_component==="bottom")B.y+=T}if(g)r.push(F_n(M,I,y,x,b));if(f){let T={x:B.x+y*Math.cos(v),y:B.y+y*Math.sin(v)};r.push(F_n(T,v,y,x,b))}}return r},fkr=(e)=>{let t=[],{schPort:n,schComponent:o,transform:r,circuitJson:i}=e,s={x:n.center.x,y:n.center.y};if(!n.side_of_component)return[];let a=wJ(n.side_of_component),c=n.distance_from_component_edge??0.4;if(s.x+=a.x*c/2,s.y+=a.y*c/2,n.side_of_component==="top"||n.side_of_component==="bottom")s.x-=0.02;else s.y+=0.02;let l=Pt(r,s);return t.push({name:"text",type:"element",attributes:{class:"pin-number sch-pin-number",x:l.x.toString(),y:l.y.toString(),style:"font-family: sans-serif;",fill:Hu.schematic.pin_number,"text-anchor":"middle","dominant-baseline":"auto","font-size":`${V3(r,"pin_number")}px`,transform:n.side_of_component==="top"||n.side_of_component==="bottom"?`rotate(-90 ${l.x} ${l.y})`:""},children:[{type:"text",value:n.pin_number?.toString()||"",name:"",attributes:{},children:[]}],value:""}),t},z_n=0.1,Kgn=(e)=>{let t=[],{schPort:n,schComponent:o,transform:r,labelColor:i=Hu.schematic.pin_number,labelClassName:s="pin-number sch-pin-label"}=e,a={x:n.center.x,y:n.center.y};if(!n.side_of_component)return[];let c=wJ(n.side_of_component),l=n.distance_from_component_edge??0.4;a.x+=c.x*(l+z_n),a.y+=c.y*(l+z_n);let h=Pt(r,a),d=n.display_pin_label??o.port_labels?.[`${n.pin_number}`];if(!d)return[];let u=d.startsWith("N_"),_=u?d.slice(2):d,p=n.display_pin_label_text_parts,m=n.is_drawn_with_inversion_circle??!1,A=V3(r,u||m?"negated_pin_number":"pin_number",n.display_pin_label_font_size);return t.push({name:"text",type:"element",attributes:{class:s,x:h.x.toString(),y:h.y.toString(),style:`font-family: sans-serif;${u&&!p?.length?" text-decoration: overline;":""}`,fill:i,"text-anchor":n.side_of_component==="left"||n.side_of_component==="bottom"?"start":"end","dominant-baseline":"middle","font-size":`${A}px`,transform:n.side_of_component==="top"||n.side_of_component==="bottom"?`rotate(-90 ${h.x} ${h.y})`:""},children:p?.length?dkr(p):[{type:"text",value:_||"",name:"",attributes:{},children:[]}],value:""}),t},ykr=(e)=>{let t=[],{schPort:n,schComponent:o,transform:r,circuitJson:i}=e;return t.push(...Akr(e)),t.push(...fkr(e)),t.push(...Kgn(e)),t},xkr=({component:e,transform:t,circuitJson:n,colorMap:o})=>{let r=[],i=Pt(t,{x:e.center.x-e.size.width/2,y:e.center.y+e.size.height/2}),s=Pt(t,{x:e.center.x+e.size.width/2,y:e.center.y-e.size.height/2}),a=s.x-i.x,c=s.y-i.y;r.push({name:"rect",type:"element",value:"",attributes:{class:"component chip sch-component-body",x:i.x.toString(),y:i.y.toString(),width:a.toString(),height:c.toString(),"stroke-width":`${H_(t)}px`,fill:o.schematic.component_body,stroke:o.schematic.component_outline},children:[]}),r.push({name:"rect",type:"element",value:"",attributes:{class:"component-overlay sch-component-overlay",x:i.x.toString(),y:i.y.toString(),width:a.toString(),height:c.toString(),fill:"transparent"},children:[]});let l=Vo(n).schematic_text.list();for(let d of l)if(d.schematic_component_id===e.schematic_component_id)r.push(Tnt({elm:d,transform:t,colorMap:o}));let h=Vo(n).schematic_port.list({schematic_component_id:e.schematic_component_id});for(let d of h)r.push(...ykr({schPort:d,schComponent:e,transform:t,circuitJson:n}));return r},Ckr=({component:e,transform:t,circuitJson:n,colorMap:o})=>{let r=[],i=e.schematic_component_id,s=n.filter((a)=>("schematic_component_id"in a)&&a.schematic_component_id===i).sort((a,c)=>O_n(a)-O_n(c));for(let a of s)if(a.type==="schematic_text"&&e.is_box_with_pins===!1)r.push(Tnt({elm:a,transform:t,colorMap:o}));else if(a.type==="schematic_line")r.push(...qgn({schLine:a,transform:t,colorMap:o}));else if(a.type==="schematic_circle")r.push(...Xgn({schCircle:a,transform:t,colorMap:o}));else if(a.type==="schematic_rect")r.push(...Jgn({schRect:a,transform:t,colorMap:o}));else if(a.type==="schematic_arc")r.push(...Wgn({schArc:a,transform:t,colorMap:o}));else if(a.type==="schematic_path")r.push(...Zgn({schPath:a,transform:t,colorMap:o}));if(e.is_box_with_pins===!1){let a=n.filter((l)=>l.type==="schematic_line"&&l.schematic_component_id===i),c=n.filter((l)=>l.type==="schematic_port"&&l.schematic_component_id===i);for(let l of c){let h=a.find((A)=>A.x1===l.center.x&&A.y1===l.center.y||A.x2===l.center.x&&A.y2===l.center.y);if(!h)continue;let d=h.x1===l.center.x&&h.y1===l.center.y?{x:h.x2,y:h.y2}:{x:h.x1,y:h.y1},u=d.x-l.center.x,_=d.y-l.center.y,p=Math.abs(u)>Math.abs(_)?u>0?"left":"right":_>0?"bottom":"top",m=Math.max(Math.abs(u),Math.abs(_));r.push(...Kgn({schPort:{...l,side_of_component:p,distance_from_component_edge:m},schComponent:e,transform:t,circuitJson:n,labelClassName:"port-label sch-pin-label",labelColor:o.schematic.pin_name}))}}return r},eAn,vkr,NIe,Whe,Pkr=({schematicTable:e,transform:t,colorMap:n,circuitJson:o})=>{let{anchor_position:r,border_width:i=0.05,anchor:s="center"}=e,{column_widths:a,row_heights:c}=zgn(e,o),l=a.reduce((I,v)=>I+v,0),h=c.reduce((I,v)=>I+v,0),{x:d,y:u}=r;if(s.includes("center"))d-=l/2;else if(s.includes("right"))d-=l;if(s.includes("center"))u+=h/2;else if(s.includes("bottom"))u+=h;let _=[],p=i*Math.abs(t.a),m=H_(t),[A,g]=Pt(t,[d,u]),[f,y]=Pt(t,[d+l,u-h]);_.push({name:"rect",type:"element",attributes:{class:"sch-table-border",x:A.toString(),y:g.toString(),width:(f-A).toString(),height:(y-g).toString(),fill:"none",stroke:n.schematic.table,"stroke-width":p.toString()},children:[],value:""});let x=o.filter((I)=>I.type==="schematic_table_cell"&&I.schematic_table_id===e.schematic_table_id),C=d;for(let I=0;I<a.length-1;I++){C+=a[I];let v=u;for(let P=0;P<c.length;P++){let M=v-c[P];if(!x.some((T)=>T.start_column_index<=I&&T.end_column_index>I&&T.start_row_index<=P&&T.end_row_index>=P)){let T=Pt(t,{x:C,y:v}),N=Pt(t,{x:C,y:M});_.push({name:"line",type:"element",attributes:{class:"sch-table-grid-line",x1:T.x.toString(),y1:T.y.toString(),x2:N.x.toString(),y2:N.y.toString(),stroke:n.schematic.table,"stroke-width":m.toString()},children:[],value:""})}v=M}}let b=u;for(let I=0;I<c.length-1;I++){b-=c[I];let v=d;for(let P=0;P<a.length;P++){let M=v+a[P];if(!x.some((T)=>T.start_row_index<=I&&T.end_row_index>I&&T.start_column_index<=P&&T.end_column_index>=P)){let T=Pt(t,{x:v,y:b}),N=Pt(t,{x:M,y:b});_.push({name:"line",type:"element",attributes:{class:"sch-table-grid-line",x1:T.x.toString(),y1:T.y.toString(),x2:N.x.toString(),y2:N.y.toString(),stroke:n.schematic.table,"stroke-width":m.toString()},children:[],value:""})}v=M}}for(let I of x)if(I.text){let v=a.slice(I.start_column_index,I.end_column_index+1).reduce((j,Y)=>j+Y,0),P=c.slice(I.start_row_index,I.end_row_index+1).reduce((j,Y)=>j+Y,0),M=d+a.slice(0,I.start_column_index).reduce((j,Y)=>j+Y,0),B=u-c.slice(0,I.start_row_index).reduce((j,Y)=>j+Y,0),{cell_padding:T=0.2}=e,N=I.horizontal_align??"center",D=I.vertical_align??"middle",L={x:M+v/2,y:B-P/2};if(N==="left")L.x=M+T;else if(N==="right")L.x=M+v-T;if(D==="top")L.y=B-T;else if(D==="bottom")L.y=B-P+T;let H=Pt(t,L),V=V3(t,"reference_designator",I.font_size),O={left:"start",center:"middle",right:"end"},U={top:"hanging",middle:"middle",bottom:"ideographic"};_.push({name:"text",type:"element",attributes:{class:"sch-table-text",x:H.x.toString(),y:H.y.toString(),"font-size":`${V}px`,"text-anchor":O[N],"dominant-baseline":U[D],fill:n.schematic.table,"font-family":"sans-serif"},children:[{type:"text",value:I.text,name:"",attributes:{},children:[]}],value:""})}return[{name:"g",type:"element",attributes:{class:"sch-table","data-schematic-table-id":e.schematic_table_id},children:_,value:""}]},$he=6,kIe=12,m2=12,hnt=6,wkr=14,Y_n=11,G_n=280,Bkr=140,dnt=6,Qkr=14,U_n=11,oAn=(e)=>e.type==="schematic_component_overlap_warning"||e.type==="schematic_component_styling_warning"||e.type==="schematic_sheet_styling_warning"||e.type==="schematic_element_outside_sheet_warning"||e.type==="schematic_manual_edit_conflict_warning",Xkr,$kr=1000,qkr=28,Jkr=16,j_n=({simulationResult:e,fallbackName:t})=>{let n=e.name??t,o=e.simulation_parameter_sweep_coordinate;if(!o)return n;return`${n} (${o.parameter_value}${o.parameter_unit})`},tLr=(e)=>{let t=e[0]??0,n=e[1];return{timestamps_ms:e,start_time_ms:t,end_time_ms:e.at(-1)??0,time_per_step:n===void 0?1:Math.abs(n-t)}},nLr=(e)=>e.type==="simulation_transient_voltage_graph"?e.simulation_transient_voltage_graph_id:e.simulation_transient_current_graph_id,iAn=(e)=>{switch(e.type){case"simulation_transient_voltage_graph":return e.simulation_transient_voltage_graph_id;case"simulation_transient_current_graph":return e.simulation_transient_current_graph_id;case"simulation_dc_operating_point_voltage":return e.simulation_dc_operating_point_voltage_id;case"simulation_dc_operating_point_current":return e.simulation_dc_operating_point_current_id;case"simulation_dc_sweep_voltage_graph":return e.simulation_dc_sweep_voltage_graph_id;case"simulation_dc_sweep_current_graph":return e.simulation_dc_sweep_current_graph_id;case"simulation_ac_sweep_voltage_graph":return e.simulation_ac_sweep_voltage_graph_id;case"simulation_ac_sweep_current_graph":return e.simulation_ac_sweep_current_graph_id}},oLr=({simulationResult:e,acSweepView:t,usesLogarithmicXValues:n})=>{switch(e.type){case"simulation_dc_operating_point_voltage":return{horizontalCoordinates:[0],measuredLevels:[e.voltage],isCurrent:!1};case"simulation_dc_operating_point_current":return{horizontalCoordinates:[0],measuredLevels:[e.current],isCurrent:!0};case"simulation_dc_sweep_voltage_graph":return{horizontalCoordinates:e.sweep_values,measuredLevels:e.voltage_levels,isCurrent:!1};case"simulation_dc_sweep_current_graph":return{horizontalCoordinates:e.sweep_values,measuredLevels:e.current_levels,isCurrent:!0};case"simulation_ac_sweep_voltage_graph":return{horizontalCoordinates:n?e.frequencies_hz.map(Math.log10):e.frequencies_hz,measuredLevels:e.complex_voltages.map((o)=>t==="phase"?Math.atan2(o.im,o.re)*180/Math.PI:Math.hypot(o.re,o.im)),isCurrent:!1};case"simulation_ac_sweep_current_graph":return{horizontalCoordinates:n?e.frequencies_hz.map(Math.log10):e.frequencies_hz,measuredLevels:e.complex_currents.map((o)=>t==="phase"?Math.atan2(o.im,o.re)*180/Math.PI:Math.hypot(o.re,o.im)),isCurrent:!0}}},rLr=({simulationResult:e,acSweepView:t,usesLogarithmicXValues:n})=>{if(e.type==="simulation_transient_voltage_graph"||e.type==="simulation_transient_current_graph"){if(!e.simulation_parameter_sweep_coordinate)return e;return{...e,name:j_n({simulationResult:e,fallbackName:e.name??nLr(e)})}}let o=iAn(e),{horizontalCoordinates:r,measuredLevels:i,isCurrent:s}=oLr({simulationResult:e,acSweepView:t,usesLogarithmicXValues:n}),a={simulation_experiment_id:e.simulation_experiment_id,simulation_parameter_sweep_coordinate:e.simulation_parameter_sweep_coordinate,name:j_n({simulationResult:e,fallbackName:o}),color:e.color,...tLr(r)};if(s)return{type:"simulation_transient_current_graph",simulation_transient_current_graph_id:o,current_levels:i,...a};return{type:"simulation_transient_voltage_graph",simulation_transient_voltage_graph_id:o,voltage_levels:i,...a}},iLr=({simulationResultType:e,experiment:t})=>{if(e?.startsWith("simulation_ac_sweep_"))return"Frequency (Hz)";if(e?.startsWith("simulation_dc_sweep_"))return t?.dc_sweep_unit?`DC Sweep (${t.dc_sweep_unit})`:"DC Sweep";if(e?.startsWith("simulation_dc_operating_point_"))return"Operating Point";return"Time (ms)"},sLr=({results:e,acSweepView:t,experiment:n})=>{let o=e[0]?.type,r=o?.startsWith("simulation_ac_sweep_")??!1,i=r&&n?.ac_sweep_type!=="linear";return{graphs:e.map((a)=>rLr({simulationResult:a,acSweepView:t,usesLogarithmicXValues:i})),xAxisTitle:iLr({simulationResultType:o,experiment:n}),yAxisTitle:r&&t==="phase"?"Phase (deg)":void 0,usesLogarithmicXValues:i}},aLr=1200,cLr=600,jm,xnt=24,Cnt=56,lLr=56,hLr=8,K_n="#1f77b4",hAn=16,MLr=15,BLr=24,PY=118,GIe=94,IJ=18,FIe=20,unt=8,DLr=14,jLr=(e)=>{let t=YIe(e);return{...t,tickLabelOverrides:new Map(t.ticks.map((n)=>[n,yr(10**n)]))}},KLr=1200,$Lr=1200,gAn=0.55,egn;var fAn=ba(()=>{qt();Ho();qt();Ho();qt();qt();Wtt();Ho();Ho();Ho();Ho();Ho();qt();Ho();Ho();Ho();Ho();Ho();Ho();Wtt();Ho();Ho();Ho();Ho();Ho();Ho();Ho();Ho();Ho();Ho();H9();Ho();Ho();Ho();Ho();H9();H9();Ho();Ho();qt();Ho();Ho();Ho();Ho();Ho();Ho();Ho();Ho();Ho();Ho();Ho();Ho();yc();Ho();er();yc();er();Ho();Ho();Ho();Ho();Ho();Ho();qt();qt();Ho();Ho();Ho();qt();er();Ho();Ho();Ho();Ho();Ho();Ho();Ho();Ho();Ho();er();er();Ho();Ho();Ho();Ho();Ho();rae();Ho();er();Ho();Ho();Ho();Ho();K0();Ho();K0();Ho();Ho();Ho();K0();Ho();er();Ho();Ho();Ho();Ho();Ho();Ho();Ho();er();K0();Ho();er();K0();Ho();Ho();er();Ho();er();Ho();Ho();Ho();Ho();Ho();Ho();Ho();Ho();Ho();Ho();Ho();Ho();Ho();qt();Ho();Agn=at(W0(),1),Hqs=at(W0(),1),fgn=at(j0(),1),PJs=at(W0(),1),QJs=at(W0(),1),GJs=at(W0(),1),ZJs=at(W0(),1),QZs=at(W0(),1),FZs=at(W0(),1),rAn=at(W0(),1),ynt=at(W0(),1),iea=at(W0(),1),vDr=new Set(["pcb_trace","pcb_smtpad","pcb_via","pcb_plated_hole","pcb_copper_pour","pcb_copper_text"]);tp={copper:{top:"rgb(200, 52, 52)",inner1:"rgb(255, 140, 0)",inner2:"rgb(255, 215, 0)",inner3:"rgb(50, 205, 50)",inner4:"rgb(64, 224, 208)",inner5:"rgb(138, 43, 226)",inner6:"rgb(255, 105, 180)",inner7:"rgb(0, 191, 255)",inner8:"rgb(160, 82, 45)",bottom:"rgb(77, 127, 196)"},soldermaskWithCopperUnderneath:{top:"rgb(18, 82, 50)",bottom:"rgb(18, 82, 50)"},soldermask:{top:"rgb(12, 55, 33)",bottom:"rgb(12, 55, 33)"},soldermaskOverCopper:{top:"rgb(52, 135, 73)",bottom:"rgb(52, 135, 73)"},substrate:"rgb(201, 162, 110)",drill:"#FF26E2",silkscreen:{top:"#f2eda1",bottom:"#5da9e9"},boardOutline:"rgba(255, 255, 255, 0.5)",courtyard:{top:"#FF00FF",bottom:"rgb(38, 233, 255)"},keepout:"#FF6B6B",debugComponent:{fill:null,stroke:null}},Pqs=tp.drill,Eqs=tp.silkscreen.top,Mqs=tp.silkscreen.bottom,wqs={...tp.copper};HDr={bottom:"rgb(105, 105, 105)",top:"rgb(105, 105, 105)"};EIe=[[30,60,130],[20,170,190],[90,200,140],[245,210,65],[220,65,45]];qDr={pcb_background:0,pcb_boundary:1,pcb_panel:5,pcb_board:10,pcb_cutout:15,pcb_cutout_path:15,pcb_keepout:16,pcb_hole:18,pcb_plated_hole_drill:19,pcb_plated_hole:20,pcb_trace_soldermask:25,pcb_trace:30,pcb_smtpad:30,pcb_copper_pour:35,pcb_via:36,pcb_soldermask:40,pcb_soldermask_opening:25,pcb_soldermask_opening_layer:44,pcb_solder_paste:45,pcb_silkscreen_text:50,pcb_silkscreen_path:50,pcb_silkscreen_graphic:50,pcb_silkscreen_rect:50,pcb_silkscreen_circle:50,pcb_silkscreen_line:50,pcb_silkscreen_oval:50,pcb_silkscreen_pill:50,pcb_component:60,pcb_pad_pin_number:65,pcb_fabrication_note_text:70,pcb_fabrication_note_path:70,pcb_fabrication_note_rect:70,pcb_fabrication_note_dimension:70,pcb_note_dimension:70,pcb_note_text:70,pcb_note_rect:70,pcb_note_path:70,pcb_note_line:70,pcb_bend:70,pcb_trace_error:80,pcb_footprint_overlap_error:80,pcb_component_outside_board_error:80,pcb_pad_trace_clearance_error:80,pcb_via_trace_clearance_error:80,pcb_connector_not_in_accessible_orientation_warning:80,pcb_manual_edit_conflict_warning:80,pcb_rats_nest:85,pcb_debug_object:90};eNr=new Set(["pcb_trace","pcb_copper_pour","pcb_smtpad","pcb_plated_hole","pcb_via","pcb_copper_text"]);ygn=fgn.default("circuit-to-svg"),Km=ygn.extend("pcb"),Xqs=ygn.extend("sch");Hu={"3d_viewer":{background_bottom:"rgb(102, 102, 128)",background_top:"rgb(204, 204, 230)",board:"rgb(51, 43, 23)",copper:"rgb(179, 156, 0)",silkscreen_bottom:"rgb(230, 230, 230)",silkscreen_top:"rgb(230, 230, 230)",soldermask:"rgb(20, 51, 36)",solderpaste:"rgb(128, 128, 128)"},board:{anchor:"rgb(255, 38, 226)",aux_items:"rgb(255, 255, 255)",b_adhes:"rgb(0, 0, 132)",b_crtyd:"rgb(255, 38, 226)",b_fab:"rgb(88, 93, 132)",b_mask:"rgba(2, 255, 238, 0.400)",b_paste:"rgb(0, 194, 194)",b_silks:"rgb(232, 178, 167)",background:"rgb(0, 16, 35)",cmts_user:"rgb(89, 148, 220)",copper:{b:"rgb(77, 127, 196)",f:"rgb(200, 52, 52)",in1:"rgb(127, 200, 127)",in10:"rgb(237, 124, 51)",in11:"rgb(91, 195, 235)",in12:"rgb(247, 111, 142)",in13:"rgb(167, 165, 198)",in14:"rgb(40, 204, 217)",in15:"rgb(232, 178, 167)",in16:"rgb(242, 237, 161)",in17:"rgb(237, 124, 51)",in18:"rgb(91, 195, 235)",in19:"rgb(247, 111, 142)",in2:"rgb(206, 125, 44)",in20:"rgb(167, 165, 198)",in21:"rgb(40, 204, 217)",in22:"rgb(232, 178, 167)",in23:"rgb(242, 237, 161)",in24:"rgb(237, 124, 51)",in25:"rgb(91, 195, 235)",in26:"rgb(247, 111, 142)",in27:"rgb(167, 165, 198)",in28:"rgb(40, 204, 217)",in29:"rgb(232, 178, 167)",in3:"rgb(79, 203, 203)",in30:"rgb(242, 237, 161)",in4:"rgb(219, 98, 139)",in5:"rgb(167, 165, 198)",in6:"rgb(40, 204, 217)",in7:"rgb(232, 178, 167)",in8:"rgb(242, 237, 161)",in9:"rgb(141, 203, 129)"},cursor:"rgb(255, 255, 255)",drc:"rgb(194, 194, 194)",drc_error:"rgba(215, 91, 107, 0.800)",drc_exclusion:"rgb(255, 255, 255)",drc_warning:"rgba(255, 208, 66, 0.902)",dwgs_user:"rgb(194, 194, 194)",eco1_user:"rgb(180, 219, 210)",eco2_user:"rgb(216, 200, 82)",edge_cuts:"rgb(208, 210, 205)",f_adhes:"rgb(132, 0, 132)",f_crtyd:"rgb(255, 0, 245)",f_fab:"rgb(175, 175, 175)",f_mask:"rgba(216, 100, 255, 0.400)",f_paste:"rgba(180, 160, 154, 0.902)",f_silks:"rgb(242, 237, 161)",footprint_text_back:"rgb(0, 0, 132)",footprint_text_front:"rgb(194, 194, 194)",footprint_text_invisible:"rgb(132, 132, 132)",grid:"rgb(132, 132, 132)",grid_axes:"rgb(194, 194, 194)",margin:"rgb(255, 38, 226)",microvia:"rgb(0, 132, 132)",no_connect:"rgb(0, 0, 132)",pad_back:"rgb(77, 127, 196)",pad_front:"rgb(200, 52, 52)",pad_plated_hole:"rgb(194, 194, 0)",pad_through_hole:"rgb(227, 183, 46)",plated_hole:"rgb(26, 196, 210)",ratsnest:"rgba(245, 255, 213, 0.702)",select_overlay:"rgb(4, 255, 67)",through_via:"rgb(236, 236, 236)",user_1:"rgb(194, 194, 194)",user_2:"rgb(89, 148, 220)",user_3:"rgb(180, 219, 210)",user_4:"rgb(216, 200, 82)",user_5:"rgb(194, 194, 194)",user_6:"rgb(89, 148, 220)",user_7:"rgb(180, 219, 210)",user_8:"rgb(216, 200, 82)",user_9:"rgb(232, 178, 167)",via_blind_buried:"rgb(187, 151, 38)",via_hole:"rgb(227, 183, 46)",via_micro:"rgb(0, 132, 132)",via_through:"rgb(236, 236, 236)",worksheet:"rgb(200, 114, 171)"},gerbview:{axes:"rgb(0, 0, 132)",background:"rgb(0, 0, 0)",dcodes:"rgb(255, 255, 255)",grid:"rgb(132, 132, 132)",layers:["rgb(132, 0, 0)","rgb(194, 194, 0)","rgb(194, 0, 194)","rgb(194, 0, 0)","rgb(0, 132, 132)","rgb(0, 132, 0)","rgb(0, 0, 132)","rgb(132, 132, 132)","rgb(132, 0, 132)","rgb(194, 194, 194)","rgb(132, 0, 132)","rgb(132, 0, 0)","rgb(132, 132, 0)","rgb(194, 194, 194)","rgb(0, 0, 132)","rgb(0, 132, 0)","rgb(132, 0, 0)","rgb(194, 194, 0)","rgb(194, 0, 194)","rgb(194, 0, 0)","rgb(0, 132, 132)","rgb(0, 132, 0)","rgb(0, 0, 132)","rgb(132, 132, 132)","rgb(132, 0, 132)","rgb(194, 194, 194)","rgb(132, 0, 132)","rgb(132, 0, 0)","rgb(132, 132, 0)","rgb(194, 194, 194)","rgb(0, 0, 132)","rgb(0, 132, 0)","rgb(132, 0, 0)","rgb(194, 194, 0)","rgb(194, 0, 194)","rgb(194, 0, 0)","rgb(0, 132, 132)","rgb(0, 132, 0)","rgb(0, 0, 132)","rgb(132, 132, 132)","rgb(132, 0, 132)","rgb(194, 194, 194)","rgb(132, 0, 132)","rgb(132, 0, 0)","rgb(132, 132, 0)","rgb(194, 194, 194)","rgb(0, 0, 132)","rgb(0, 132, 0)","rgb(132, 0, 0)","rgb(194, 194, 0)","rgb(194, 0, 194)","rgb(194, 0, 0)","rgb(0, 132, 132)","rgb(0, 132, 0)","rgb(0, 0, 132)","rgb(132, 132, 132)","rgb(132, 0, 132)","rgb(194, 194, 194)","rgb(132, 0, 132)","rgb(132, 0, 0)"],negative_objects:"rgb(132, 132, 132)",worksheet:"rgb(0, 0, 132)"},meta:{filename:"kicad_2020",name:"KiCad 2020",version:2},simulation_palette:["#1f77b4","#d62728","#2ca02c","#ff7f0e","#9467bd","#17becf","#8c564b","#e377c2","#7f7f7f","#bcbd22"],palette:["rgb(132, 0, 0)","rgb(194, 194, 0)","rgb(194, 0, 194)","rgb(194, 0, 0)","rgb(0, 132, 132)","rgb(0, 132, 0)","rgb(0, 0, 132)","rgb(132, 132, 132)","rgb(132, 0, 132)","rgb(194, 194, 194)","rgb(132, 0, 132)","rgb(132, 0, 0)","rgb(132, 132, 0)","rgb(194, 194, 194)","rgb(0, 0, 132)","rgb(0, 132, 0)"],schematic:{aux_items:"rgb(46, 46, 46)",background:"rgb(245, 241, 237)",brightened:"rgb(255, 0, 255)",bus:"rgb(0, 0, 132)",bus_junction:"rgb(0, 0, 132)",component_body:"rgb(255, 255, 194)",component_outline:"rgb(132, 0, 0)",cursor:"rgb(15, 15, 15)",erc_error:"rgba(230, 9, 13, 0.800)",erc_warning:"rgba(209, 146, 0, 0.800)",fields:"rgb(132, 0, 132)",grid:"rgb(181, 181, 181)",grid_axes:"rgb(0, 0, 132)",hidden:"rgb(194, 194, 194)",junction:"rgb(0, 150, 0)",label_global:"rgb(132, 0, 0)",label_background:"rgba(255, 255, 255, 0.6)",label_hier:"rgb(114, 86, 0)",label_local:"rgb(15, 15, 15)",net_name:"rgb(132, 132, 132)",no_connect:"rgb(132, 0, 0)",note:"rgb(0, 0, 194)",override_item_colors:!1,pin:"rgb(132, 0, 0)",pin_name:"rgb(0, 100, 100)",pin_number:"rgb(169, 0, 0)",reference:"rgb(0, 100, 100)",shadow:"rgba(102, 179, 255, 0.800)",sheet:"rgb(132, 0, 0)",sheet_background:"rgba(253, 255, 231, 0.000)",sheet_fields:"rgb(132, 0, 132)",sheet_filename:"rgb(114, 86, 0)",sheet_label:"rgb(0, 100, 100)",sheet_name:"rgb(0, 100, 100)",table:"rgb(102, 102, 102)",value:"rgb(0, 100, 100)",wire:"rgb(0, 150, 0)",wire_crossing:"rgb(30, 180, 30)",worksheet:"rgb(132, 0, 0)"}};MNr=Hu.board.user_2;BNr=Hu.board.user_2,TNr=Hu.board.user_2;NNr=Hu.board.user_2;QNr=Hu.board.user_2;LNr=Array.from(Cgn).reduce((e,t)=>e+(Oj[t]??A3.spaceWidthRatio),0);bgn=Object.fromEntries(Object.entries(d5).map(([e,t])=>{let n=t.flatMap((r)=>[r.x1,r.x2]),o=t.flatMap((r)=>[r.y1,r.y2]);return[e,t.length?{minX:Math.min(...n)-MIe,maxX:Math.max(...n)+MIe,minY:-(Math.max(...o)+MIe)*g_n,maxY:-(Math.min(...o)-MIe)*g_n}:null]})),A_n=Math.round(Math.max(...Object.values(bgn).map((e)=>e?e.maxX-e.minX:0))*1000)/1000;ent=CJ+2,tnt=vgn+2,jhe=CJ+O3+6;v_n=["rgba(100, 200, 255, 0.6)","rgba(255, 150, 100, 0.6)","rgba(100, 255, 150, 0.6)","rgba(200, 100, 255, 0.6)","rgba(255, 220, 100, 0.6)","rgba(255, 100, 200, 0.6)","rgba(100, 255, 255, 0.6)","rgba(180, 255, 100, 0.6)"];FRr={name:"circuit-to-svg",type:"module",engines:{node:"24.x"},version:"0.0.449",repository:{type:"git",url:"https://github.com/tscircuit/circuit-to-svg.git"},description:"Convert Circuit JSON to SVG",main:"dist/index.js",files:["dist"],scripts:{start:"cosmos",prepublish:"npm run build",prepare:"node scripts/prepare-git.cjs",build:"tsup-node ./lib/index.ts --format esm --dts --sourcemap --external tscircuit",format:"biome format . --write","format:check":"biome format .",cosmos:"cosmos","cosmos-export":"cosmos-export"},license:"ISC",devDependencies:{"@biomejs/biome":"^1.9.4","@resvg/resvg-js":"^2.6.2","@tscircuit/alphabet":"^0.0.27","@tscircuit/checks-latest":"npm:@tscircuit/checks@0.0.179","@tscircuit/circuit-json-util":"^0.0.115","@types/bun":"^1.2.8","@types/color":"^4.2.1","@types/debug":"^4.1.12","@vitejs/plugin-react":"5.0.0",biome:"^0.3.3","bun-match-svg":"^0.0.12","circuit-json":"^0.0.522","circuit-json-to-connectivity-map":"^0.0.23",esbuild:"^0.20.2","format-si-unit":"^0.0.12","performance-now":"^2.1.0",react:"19.1.0","react-cosmos":"7.0.0","react-cosmos-plugin-vite":"7.0.0","react-dom":"19.1.0","schematic-symbols":"^0.0.246",tscircuit:"^0.0.2629",tsup:"^8.0.2",typescript:"^5.4.5","vite-tsconfig-paths":"^5.0.1"},peerDependencies:{"@tscircuit/alphabet":"*","@tscircuit/circuit-json-util":"*","circuit-json":"*","circuit-json-to-connectivity-map":"*","schematic-symbols":"*"},dependencies:{"@types/node":"^22.5.5","bun-types":"^1.1.40","calculate-elbow":"0.0.12",color:"^5.0.3",debug:"^4.4.3","svg-path-commander":"^2.1.11",svgson:"^5.3.1","transformation-matrix":"^2.16.1"}},Pk=FRr.version;rQr=wnt;TIe={fill:"none",stroke:"rgb(0,0,0)",strokeOpacity:"0.8",strokeWidthFactor:0.2};cQr={pin_number:0.15,negated_pin_number:0.12,reference_designator:0.18,manufacturer_number:0.18,net_label:0.18,error:0.05};B_n=["pcb_component","pcb_smtpad","pcb_hole","pcb_plated_hole","pcb_board"];R_n=["pcb_board","pcb_smtpad","pcb_hole","pcb_plated_hole","pcb_component","pcb_port"];Q_n={"0":{width:13,height:27,ascent:22,descent:5,left:-1,right:12},"1":{width:13,height:27,ascent:22,descent:5,left:-3,right:9},"2":{width:13,height:27,ascent:22,descent:5,left:-1,right:12},"3":{width:13,height:27,ascent:22,descent:5,left:-1,right:12},"4":{width:13,height:27,ascent:22,descent:5,left:0,right:12},"5":{width:13,height:27,ascent:22,descent:5,left:-1,right:12},"6":{width:13,height:27,ascent:22,descent:5,left:-1,right:12},"7":{width:13,height:27,ascent:22,descent:5,left:-1,right:12},"8":{width:13,height:27,ascent:22,descent:5,left:-1,right:12},"9":{width:13,height:27,ascent:22,descent:5,left:-1,right:12}," ":{width:7,height:27,ascent:22,descent:5,left:0,right:0},"!":{width:7,height:27,ascent:22,descent:5,left:-2,right:5},'"':{width:9,height:27,ascent:22,descent:5,left:-1,right:7},"#":{width:13,height:27,ascent:22,descent:5,left:0,right:13},$:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},"%":{width:21,height:27,ascent:22,descent:5,left:-1,right:20},"&":{width:16,height:27,ascent:22,descent:5,left:-1,right:15},"'":{width:5,height:27,ascent:22,descent:5,left:-1,right:3},"(":{width:8,height:27,ascent:22,descent:5,left:-1,right:7},")":{width:8,height:27,ascent:22,descent:5,left:-1,right:7},"*":{width:9,height:27,ascent:22,descent:5,left:-1,right:8},"+":{width:14,height:27,ascent:22,descent:5,left:-1,right:13},",":{width:7,height:27,ascent:22,descent:5,left:-2,right:5},"-":{width:8,height:27,ascent:22,descent:5,left:-1,right:7},".":{width:7,height:27,ascent:22,descent:5,left:-2,right:5},"/":{width:7,height:27,ascent:22,descent:5,left:0,right:7},":":{width:7,height:27,ascent:22,descent:5,left:-2,right:5},";":{width:7,height:27,ascent:22,descent:5,left:-2,right:5},"<":{width:14,height:27,ascent:22,descent:5,left:-1,right:13},"=":{width:14,height:27,ascent:22,descent:5,left:-1,right:13},">":{width:14,height:27,ascent:22,descent:5,left:-1,right:13},"?":{width:13,height:27,ascent:22,descent:5,left:-1,right:12},"@":{width:24,height:27,ascent:22,descent:5,left:-1,right:23},A:{width:16,height:27,ascent:22,descent:5,left:0,right:16},B:{width:16,height:27,ascent:22,descent:5,left:-2,right:15},C:{width:17,height:27,ascent:22,descent:5,left:-1,right:16},D:{width:17,height:27,ascent:22,descent:5,left:-2,right:16},E:{width:16,height:27,ascent:22,descent:5,left:-2,right:15},F:{width:15,height:27,ascent:22,descent:5,left:-2,right:14},G:{width:19,height:27,ascent:22,descent:5,left:-1,right:17},H:{width:17,height:27,ascent:22,descent:5,left:-2,right:15},I:{width:7,height:27,ascent:22,descent:5,left:-2,right:5},J:{width:12,height:27,ascent:22,descent:5,left:-1,right:10},K:{width:16,height:27,ascent:22,descent:5,left:-2,right:16},L:{width:13,height:27,ascent:22,descent:5,left:-2,right:12},M:{width:20,height:27,ascent:22,descent:5,left:-2,right:18},N:{width:17,height:27,ascent:22,descent:5,left:-2,right:15},O:{width:19,height:27,ascent:22,descent:5,left:-1,right:18},P:{width:16,height:27,ascent:22,descent:5,left:-2,right:15},Q:{width:19,height:27,ascent:22,descent:5,left:-1,right:18},R:{width:17,height:27,ascent:22,descent:5,left:-2,right:17},S:{width:16,height:27,ascent:22,descent:5,left:-1,right:15},T:{width:15,height:27,ascent:22,descent:5,left:-1,right:14},U:{width:17,height:27,ascent:22,descent:5,left:-2,right:15},V:{width:16,height:27,ascent:22,descent:5,left:0,right:16},W:{width:23,height:27,ascent:22,descent:5,left:0,right:22},X:{width:16,height:27,ascent:22,descent:5,left:0,right:16},Y:{width:16,height:27,ascent:22,descent:5,left:0,right:16},Z:{width:15,height:27,ascent:22,descent:5,left:0,right:14},"[":{width:7,height:27,ascent:22,descent:5,left:-2,right:6},"\\":{width:7,height:27,ascent:22,descent:5,left:0,right:7},"]":{width:7,height:27,ascent:22,descent:5,left:0,right:5},"^":{width:11,height:27,ascent:22,descent:5,left:-1,right:11},_:{width:13,height:27,ascent:22,descent:5,left:0,right:14},"`":{width:8,height:27,ascent:22,descent:5,left:-1,right:5},a:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},b:{width:13,height:27,ascent:22,descent:5,left:-2,right:12},c:{width:12,height:27,ascent:22,descent:5,left:-1,right:12},d:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},e:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},f:{width:7,height:27,ascent:22,descent:5,left:0,right:8},g:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},h:{width:13,height:27,ascent:22,descent:5,left:-2,right:12},i:{width:5,height:27,ascent:22,descent:5,left:-2,right:4},j:{width:5,height:27,ascent:22,descent:5,left:1,right:4},k:{width:12,height:27,ascent:22,descent:5,left:-2,right:12},l:{width:5,height:27,ascent:22,descent:5,left:-2,right:4},m:{width:20,height:27,ascent:22,descent:5,left:-2,right:18},n:{width:13,height:27,ascent:22,descent:5,left:-2,right:12},o:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},p:{width:13,height:27,ascent:22,descent:5,left:-2,right:12},q:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},r:{width:8,height:27,ascent:22,descent:5,left:-2,right:8},s:{width:12,height:27,ascent:22,descent:5,left:-1,right:11},t:{width:7,height:27,ascent:22,descent:5,left:0,right:6},u:{width:13,height:27,ascent:22,descent:5,left:-2,right:12},v:{width:12,height:27,ascent:22,descent:5,left:0,right:12},w:{width:17,height:27,ascent:22,descent:5,left:0,right:17},x:{width:12,height:27,ascent:22,descent:5,left:0,right:12},y:{width:12,height:27,ascent:22,descent:5,left:0,right:12},z:{width:12,height:27,ascent:22,descent:5,left:0,right:11},"{":{width:8,height:27,ascent:22,descent:5,left:-1,right:7},"|":{width:6,height:27,ascent:22,descent:5,left:-2,right:4},"}":{width:8,height:27,ascent:22,descent:5,left:-1,right:7},"~":{width:14,height:27,ascent:22,descent:5,left:-1,right:13}};GQr={top_left:"start",top_right:"end",middle_left:"start",middle_right:"end",bottom_left:"start",bottom_right:"end",center:"middle",middle_top:"middle",middle_bottom:"middle"},k_n={top_left:"hanging",top_right:"hanging",bottom_left:"ideographic",bottom_right:"ideographic",center:"middle",middle_left:"middle",middle_right:"middle",middle_top:"hanging",middle_bottom:"ideographic"};Ik=JQr/ZQr,ekr=297/Ik,tkr=210/Ik,xZs=20/Ik,DIe=5/Ik;mkr={top_left:"start",top_right:"end",middle_left:"start",middle_right:"end",bottom_left:"start",bottom_right:"end",center:"middle",middle_top:"middle",middle_bottom:"middle"},_kr={top_left:"hanging",top_right:"hanging",bottom_left:"ideographic",bottom_right:"ideographic",center:"middle",middle_left:"middle",middle_right:"middle",middle_top:"hanging",middle_bottom:"ideographic"};eAn=0.2/Ik,vkr=3/Ik,NIe=["1","2","3","4","5","6"],Whe=["A","B","C","D"];Xkr=tde;jm={top:64,right:100,bottom:80,left:100};egn=["pcb_board","pcb_solder_paste"]});var Cs=pt(function(vma,sBn){var Gfi=(e)=>e.flat(1/0);sBn.exports=Gfi});var cBn=pt(function(Sma,aBn){var Ufi=(e)=>Object.assign({},e);aBn.exports=Ufi});var hBn=pt(function(Pma,lBn){var Wfi=(e,t,n)=>(e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e);lBn.exports=Wfi});var Z7e=pt(function(Ema,dBn){var Xfi=()=>[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];dBn.exports=Xfi});var pBn=pt(function(Mma,uBn){var jfi=Z7e(),Kfi=(e)=>{let t=jfi();return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t};uBn.exports=Kfi});var Elt=pt(function(wma,mBn){var $fi=(e,t)=>(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e);mBn.exports=$fi});var gBn=pt(function(Bma,_Bn){var qfi=(e,t)=>{let n=t[0],o=t[1],r=t[2],i=t[3],s=t[4],a=t[5],c=t[6],l=t[7],h=t[8],d=t[9],u=t[10],_=t[11],p=t[12],m=t[13],A=t[14],g=t[15],f=n*a-o*s,y=n*c-r*s,x=n*l-i*s,C=o*c-r*a,b=o*l-i*a,I=r*l-i*c,v=h*m-d*p,P=h*A-u*p,M=h*g-_*p,B=d*A-u*m,T=d*g-_*m,N=u*g-_*A,D=f*N-y*T+x*B+C*M-b*P+I*v;if(!D)return null;return D=1/D,e[0]=(a*N-c*T+l*B)*D,e[1]=(r*T-o*N-i*B)*D,e[2]=(m*I-A*b+g*C)*D,e[3]=(u*b-d*I-_*C)*D,e[4]=(c*M-s*N-l*P)*D,e[5]=(n*N-r*M+i*P)*D,e[6]=(A*x-p*I-g*y)*D,e[7]=(h*I-u*x+_*y)*D,e[8]=(s*T-a*M+l*v)*D,e[9]=(o*M-n*T-i*v)*D,e[10]=(p*b-m*x+g*f)*D,e[11]=(d*x-h*b-_*f)*D,e[12]=(a*P-s*B-c*v)*D,e[13]=(n*B-o*P+r*v)*D,e[14]=(m*y-p*C-A*f)*D,e[15]=(h*C-d*y+u*f)*D,e};_Bn.exports=qfi});var fBn=pt(function(Tma,ABn){var Jfi=(e,t)=>e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15];ABn.exports=Jfi});var bc=pt(function(Dma,yBn){var Zfi=Math.PI*2;yBn.exports={EPS:0.00001,NEPS:0.0000000000001,TAU:Zfi,spatialResolution:1e5}});var df=pt(function(Nma,CBn){var{NEPS:e2i}=bc(),xBn=(e)=>Math.abs(e)<e2i?0:e,t2i=(e)=>xBn(Math.sin(e)),n2i=(e)=>xBn(Math.cos(e));CBn.exports={sin:t2i,cos:n2i}});var Mlt=pt(function(Rma,bBn){var o2i=(e)=>(e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e);bBn.exports=o2i});var wlt=pt(function(Qma,IBn){var{EPS:r2i}=bc(),{sin:i2i,cos:s2i}=df(),a2i=Mlt(),c2i=(e,t,n)=>{let[o,r,i]=n,s=o*o+r*r+i*i;if(Math.abs(s)<r2i)return a2i(e);let a=1/Math.sqrt(s);o*=a,r*=a,i*=a;let c=i2i(t),l=s2i(t),h=1-l;return e[0]=o*o*h+l,e[1]=r*o*h+i*c,e[2]=i*o*h-r*c,e[3]=0,e[4]=o*r*h-i*c,e[5]=r*r*h+l,e[6]=i*r*h+o*c,e[7]=0,e[8]=o*i*h+r*c,e[9]=r*i*h-o*c,e[10]=i*i*h+l,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e};IBn.exports=c2i});var SBn=pt(function(kma,vBn){var l2i=(e,t)=>(e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e);vBn.exports=l2i});var EBn=pt(function(Lma,PBn){var{sin:Blt,cos:Tlt}=df(),h2i=(e,t,n,o)=>{let r=Blt(t),i=Tlt(t),s=Blt(n),a=Tlt(n),c=Blt(o),l=Tlt(o);return e[0]=a*i,e[1]=a*r,e[2]=-s,e[3]=0,e[4]=c*s*i-l*r,e[5]=l*i+c*s*r,e[6]=c*a,e[7]=0,e[8]=c*r+l*s*i,e[9]=l*s*r-c*i,e[10]=l*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e};PBn.exports=h2i});var wBn=pt(function(Hma,MBn){var d2i=(e,t)=>(e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e);MBn.exports=d2i});var TBn=pt(function(Fma,BBn){var u2i=Z7e(),p2i=(e,t,n,o,r,i,s,a,c,l,h,d,u,_,p,m)=>{let A=u2i();return A[0]=e,A[1]=t,A[2]=n,A[3]=o,A[4]=r,A[5]=i,A[6]=s,A[7]=a,A[8]=c,A[9]=l,A[10]=h,A[11]=d,A[12]=u,A[13]=_,A[14]=p,A[15]=m,A};BBn.exports=p2i});var Dlt=pt(function(zma,DBn){var m2i=(e,t)=>(e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e);DBn.exports=m2i});var Nlt=pt(function(Oma,NBn){var _2i=(e,t,n)=>(e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e);NBn.exports=_2i});var C0e=pt(function(Vma,RBn){var g2i=(e,t)=>e[0]*t[0]+e[1]*t[1]+e[2]*t[2];RBn.exports=g2i});var kBn=pt(function(Yma,QBn){var A2i=C0e(),f2i=(e,t)=>{let n=e[0],o=e[1],r=e[2],i=t[0],s=t[1],a=t[2],c=Math.sqrt(n*n+o*o+r*r),l=Math.sqrt(i*i+s*s+a*a),h=c*l,d=h&&A2i(e,t)/h;return Math.acos(Math.min(Math.max(d,-1),1))};QBn.exports=f2i});var b0e=pt(function(Gma,LBn){var y2i=()=>[0,0,0];LBn.exports=y2i});var FBn=pt(function(Uma,HBn){var x2i=b0e(),C2i=(e)=>{let t=x2i();return t[0]=e[0],t[1]=e[1],t[2]=e[2],t};HBn.exports=C2i});var Rlt=pt(function(Wma,zBn){var b2i=(e,t)=>(e[0]=t[0],e[1]=t[1],e[2]=t[2],e);zBn.exports=b2i});var aee=pt(function(Xma,OBn){var I2i=(e,t,n)=>{let o=t[0],r=t[1],i=t[2],s=n[0],a=n[1],c=n[2];return e[0]=r*c-i*a,e[1]=i*s-o*c,e[2]=o*a-r*s,e};OBn.exports=I2i});var Qlt=pt(function(jma,VBn){var v2i=(e,t)=>{let n=t[0]-e[0],o=t[1]-e[1],r=t[2]-e[2];return Math.sqrt(n*n+o*o+r*r)};VBn.exports=v2i});var GBn=pt(function(Kma,YBn){var S2i=(e,t,n)=>(e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e);YBn.exports=S2i});var WBn=pt(function($ma,UBn){var P2i=(e,t)=>e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2];UBn.exports=P2i});var jBn=pt(function(qma,XBn){var E2i=(e,t)=>(e[0]=t,e[1]=t,e[2]=t,e);XBn.exports=E2i});var $Bn=pt(function(Jma,KBn){var M2i=b0e(),w2i=(e,t,n)=>{let o=M2i();return o[0]=e,o[1]=t,o[2]=n,o};KBn.exports=w2i});var JBn=pt(function(Zma,qBn){var B2i=(e,t,n=0)=>(e[0]=t[0],e[1]=t[1],e[2]=n,e);qBn.exports=B2i});var klt=pt(function(e_a,ZBn){var T2i=(e)=>{let t=e[0],n=e[1],o=e[2];return Math.sqrt(t*t+n*n+o*o)};ZBn.exports=T2i});var tTn=pt(function(t_a,eTn){var D2i=(e,t,n,o)=>(e[0]=t[0]+o*(n[0]-t[0]),e[1]=t[1]+o*(n[1]-t[1]),e[2]=t[2]+o*(n[2]-t[2]),e);eTn.exports=D2i});var Llt=pt(function(n_a,nTn){var N2i=(e,t,n)=>(e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e);nTn.exports=N2i});var Hlt=pt(function(o_a,oTn){var R2i=(e,t,n)=>(e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e);oTn.exports=R2i});var iTn=pt(function(r_a,rTn){var Q2i=(e,t,n)=>(e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e);rTn.exports=Q2i});var aTn=pt(function(i_a,sTn){var k2i=(e,t)=>(e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e);sTn.exports=k2i});var eSe=pt(function(s_a,cTn){var L2i=(e,t)=>{let n=t[0],o=t[1],r=t[2],i=n*n+o*o+r*r;if(i>0)i=1/Math.sqrt(i);return e[0]=n*i,e[1]=o*i,e[2]=r*i,e};cTn.exports=L2i});var hTn=pt(function(a_a,lTn){var H2i=Dlt(),F2i=b0e(),z2i=aee(),O2i=(e,t)=>{let n=H2i(F2i(),t),o=0+(n[0]<n[1]&&n[0]<n[2]),r=0+(n[1]<=n[0]&&n[1]<n[2]),i=0+(n[2]<=n[0]&&n[2]<=n[1]);return z2i(e,t,[o,r,i])};lTn.exports=O2i});var uTn=pt(function(c_a,dTn){var V2i=(e,t,n,o)=>{let r=[],i=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],i[0]=r[0],i[1]=r[1]*Math.cos(o)-r[2]*Math.sin(o),i[2]=r[1]*Math.sin(o)+r[2]*Math.cos(o),e[0]=i[0]+n[0],e[1]=i[1]+n[1],e[2]=i[2]+n[2],e};dTn.exports=V2i});var mTn=pt(function(l_a,pTn){var Y2i=(e,t,n,o)=>{let r=[],i=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],i[0]=r[2]*Math.sin(o)+r[0]*Math.cos(o),i[1]=r[1],i[2]=r[2]*Math.cos(o)-r[0]*Math.sin(o),e[0]=i[0]+n[0],e[1]=i[1]+n[1],e[2]=i[2]+n[2],e};pTn.exports=Y2i});var gTn=pt(function(h_a,_Tn){var G2i=(e,t,n,o)=>{let r=[],i=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],i[0]=r[0]*Math.cos(o)-r[1]*Math.sin(o),i[1]=r[0]*Math.sin(o)+r[1]*Math.cos(o),e[0]=i[0]+n[0],e[1]=i[1]+n[1],e[2]=t[2],e};_Tn.exports=G2i});var Flt=pt(function(d_a,ATn){var U2i=(e,t,n)=>(e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e);ATn.exports=U2i});var yTn=pt(function(u_a,fTn){var W2i=(e,t,n)=>(e[0]=Math.round(t[0]/n)*n+0,e[1]=Math.round(t[1]/n)*n+0,e[2]=Math.round(t[2]/n)*n+0,e);fTn.exports=W2i});var zlt=pt(function(p_a,xTn){var X2i=(e,t)=>{let n=t[0]-e[0],o=t[1]-e[1],r=t[2]-e[2];return n*n+o*o+r*r};xTn.exports=X2i});var Olt=pt(function(m_a,CTn){var j2i=(e)=>{let t=e[0],n=e[1],o=e[2];return t*t+n*n+o*o};CTn.exports=j2i});var I0e=pt(function(__a,bTn){var K2i=(e,t,n)=>(e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e);bTn.exports=K2i});var vTn=pt(function(g_a,ITn){var $2i=(e)=>`[${e[0].toFixed(7)}, ${e[1].toFixed(7)}, ${e[2].toFixed(7)}]`;ITn.exports=$2i});var PTn=pt(function(A_a,STn){var q2i=(e,t,n)=>{let o=t[0],r=t[1],i=t[2],s=n[3]*o+n[7]*r+n[11]*i+n[15];return s=s||1,e[0]=(n[0]*o+n[4]*r+n[8]*i+n[12])/s,e[1]=(n[1]*o+n[5]*r+n[9]*i+n[13])/s,e[2]=(n[2]*o+n[6]*r+n[10]*i+n[14])/s,e};STn.exports=q2i});var di=pt(function(f_a,ETn){ETn.exports={abs:Dlt(),add:Nlt(),angle:kBn(),clone:FBn(),copy:Rlt(),create:b0e(),cross:aee(),distance:Qlt(),divide:GBn(),dot:C0e(),equals:WBn(),fromScalar:jBn(),fromValues:$Bn(),fromVec2:JBn(),length:klt(),lerp:tTn(),max:Llt(),min:Hlt(),multiply:iTn(),negate:aTn(),normalize:eSe(),orthogonal:hTn(),rotateX:uTn(),rotateY:mTn(),rotateZ:gTn(),scale:Flt(),snap:yTn(),squaredDistance:zlt(),squaredLength:Olt(),subtract:I0e(),toString:vTn(),transform:PTn()}});var wTn=pt(function(y_a,MTn){var R1=di(),J2i=wlt(),Z2i=(e,t,n)=>{let o=R1.normalize(R1.create(),t),r=R1.normalize(R1.create(),n),i=R1.cross(R1.create(),r,o),s=R1.dot(r,o);if(s===-1)return J2i(e,Math.PI,R1.orthogonal(i,o));let a=1/(1+s);return e[0]=i[0]*i[0]*a+s,e[1]=i[1]*i[0]*a-i[2],e[2]=i[2]*i[0]*a+i[1],e[3]=0,e[4]=i[0]*i[1]*a+i[2],e[5]=i[1]*i[1]*a+s,e[6]=i[2]*i[1]*a-i[0],e[7]=0,e[8]=i[0]*i[2]*a-i[1],e[9]=i[1]*i[2]*a+i[0],e[10]=i[2]*i[2]*a+s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e};MTn.exports=Z2i});var TTn=pt(function(x_a,BTn){var{sin:e1i,cos:t1i}=df(),n1i=(e,t)=>{let n=e1i(t),o=t1i(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=n,e[7]=0,e[8]=0,e[9]=-n,e[10]=o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e};BTn.exports=n1i});var NTn=pt(function(C_a,DTn){var{sin:o1i,cos:r1i}=df(),i1i=(e,t)=>{let n=o1i(t),o=r1i(t);return e[0]=o,e[1]=0,e[2]=-n,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=n,e[9]=0,e[10]=o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e};DTn.exports=i1i});var QTn=pt(function(b_a,RTn){var{sin:s1i,cos:a1i}=df(),c1i=(e,t)=>{let n=s1i(t),o=a1i(t);return e[0]=o,e[1]=n,e[2]=0,e[3]=0,e[4]=-n,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e};RTn.exports=c1i});var LTn=pt(function(I_a,kTn){var l1i=(e)=>e[0]===1&&e[1]===0&&e[2]===0&&e[3]===0&&e[4]===0&&e[5]===1&&e[6]===0&&e[7]===0&&e[8]===0&&e[9]===0&&e[10]===1&&e[11]===0&&e[12]===0&&e[13]===0&&e[14]===0&&e[15]===1;kTn.exports=l1i});var FTn=pt(function(v_a,HTn){var h1i=(e)=>gT(e[1])&&gT(e[2])&&gT(e[3])&&gT(e[4])&&gT(e[6])&&gT(e[7])&&gT(e[8])&&gT(e[9])&&gT(e[11])&&e[15]===1,gT=(e)=>Math.abs(e)<Number.EPSILON;HTn.exports=h1i});var OTn=pt(function(S_a,zTn){var d1i=(e)=>{let t=e[4]*e[9]-e[8]*e[5],n=e[8]*e[1]-e[0]*e[9],o=e[0]*e[5]-e[4]*e[1];return t*e[2]+n*e[6]+o*e[10]<0};zTn.exports=d1i});var YTn=pt(function(P_a,VTn){var u1i=(e,t)=>{let[n,o,r,i]=t;return e[0]=1-2*n*n,e[1]=-2*o*n,e[2]=-2*r*n,e[3]=0,e[4]=-2*n*o,e[5]=1-2*o*o,e[6]=-2*r*o,e[7]=0,e[8]=-2*n*r,e[9]=-2*o*r,e[10]=1-2*r*r,e[11]=0,e[12]=2*n*i,e[13]=2*o*i,e[14]=2*r*i,e[15]=1,e};VTn.exports=u1i});var UTn=pt(function(E_a,GTn){var p1i=(e,t,n)=>{let o=t[0],r=t[1],i=t[2],s=t[3],a=t[4],c=t[5],l=t[6],h=t[7],d=t[8],u=t[9],_=t[10],p=t[11],m=t[12],A=t[13],g=t[14],f=t[15],y=n[0],x=n[1],C=n[2],b=n[3];return e[0]=y*o+x*a+C*d+b*m,e[1]=y*r+x*c+C*u+b*A,e[2]=y*i+x*l+C*_+b*g,e[3]=y*s+x*h+C*p+b*f,y=n[4],x=n[5],C=n[6],b=n[7],e[4]=y*o+x*a+C*d+b*m,e[5]=y*r+x*c+C*u+b*A,e[6]=y*i+x*l+C*_+b*g,e[7]=y*s+x*h+C*p+b*f,y=n[8],x=n[9],C=n[10],b=n[11],e[8]=y*o+x*a+C*d+b*m,e[9]=y*r+x*c+C*u+b*A,e[10]=y*i+x*l+C*_+b*g,e[11]=y*s+x*h+C*p+b*f,y=n[12],x=n[13],C=n[14],b=n[15],e[12]=y*o+x*a+C*d+b*m,e[13]=y*r+x*c+C*u+b*A,e[14]=y*i+x*l+C*_+b*g,e[15]=y*s+x*h+C*p+b*f,e};GTn.exports=p1i});var XTn=pt(function(M_a,WTn){var{EPS:m1i}=bc(),{sin:_1i,cos:g1i}=df(),A1i=Elt(),f1i=(e,t,n,o)=>{let[r,i,s]=o,a=r*r+i*i+s*s;if(Math.abs(a)<m1i)return A1i(e,t);let c=1/Math.sqrt(a);r*=c,i*=c,s*=c;let l=_1i(n),h=g1i(n),d=1-h,u=t[0],_=t[1],p=t[2],m=t[3],A=t[4],g=t[5],f=t[6],y=t[7],x=t[8],C=t[9],b=t[10],I=t[11],v=r*r*d+h,P=i*r*d+s*l,M=s*r*d-i*l,B=r*i*d-s*l,T=i*i*d+h,N=s*i*d+r*l,D=r*s*d+i*l,L=i*s*d-r*l,H=s*s*d+h;if(e[0]=u*v+A*P+x*M,e[1]=_*v+g*P+C*M,e[2]=p*v+f*P+b*M,e[3]=m*v+y*P+I*M,e[4]=u*B+A*T+x*N,e[5]=_*B+g*T+C*N,e[6]=p*B+f*T+b*N,e[7]=m*B+y*T+I*N,e[8]=u*D+A*L+x*H,e[9]=_*D+g*L+C*H,e[10]=p*D+f*L+b*H,e[11]=m*D+y*L+I*H,t!==e)e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15];return e};WTn.exports=f1i});var KTn=pt(function(w_a,jTn){var{sin:y1i,cos:x1i}=df(),C1i=(e,t,n)=>{let o=y1i(n),r=x1i(n),i=t[4],s=t[5],a=t[6],c=t[7],l=t[8],h=t[9],d=t[10],u=t[11];if(t!==e)e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15];return e[4]=i*r+l*o,e[5]=s*r+h*o,e[6]=a*r+d*o,e[7]=c*r+u*o,e[8]=l*r-i*o,e[9]=h*r-s*o,e[10]=d*r-a*o,e[11]=u*r-c*o,e};jTn.exports=C1i});var qTn=pt(function(B_a,$Tn){var{sin:b1i,cos:I1i}=df(),v1i=(e,t,n)=>{let o=b1i(n),r=I1i(n),i=t[0],s=t[1],a=t[2],c=t[3],l=t[8],h=t[9],d=t[10],u=t[11];if(t!==e)e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15];return e[0]=i*r-l*o,e[1]=s*r-h*o,e[2]=a*r-d*o,e[3]=c*r-u*o,e[8]=i*o+l*r,e[9]=s*o+h*r,e[10]=a*o+d*r,e[11]=c*o+u*r,e};$Tn.exports=v1i});var ZTn=pt(function(T_a,JTn){var{sin:S1i,cos:P1i}=df(),E1i=(e,t,n)=>{let o=S1i(n),r=P1i(n),i=t[0],s=t[1],a=t[2],c=t[3],l=t[4],h=t[5],d=t[6],u=t[7];if(t!==e)e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15];return e[0]=i*r+l*o,e[1]=s*r+h*o,e[2]=a*r+d*o,e[3]=c*r+u*o,e[4]=l*r-i*o,e[5]=h*r-s*o,e[6]=d*r-a*o,e[7]=u*r-c*o,e};JTn.exports=E1i});var tDn=pt(function(D_a,eDn){var M1i=(e,t,n)=>{let o=n[0],r=n[1],i=n[2];return e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e[3]=t[3]*o,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*i,e[9]=t[9]*i,e[10]=t[10]*i,e[11]=t[11]*i,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e};eDn.exports=M1i});var oDn=pt(function(N_a,nDn){var w1i=(e,t,n)=>(e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e);nDn.exports=w1i});var iDn=pt(function(R_a,rDn){var B1i=(e)=>e.map((t)=>t.toFixed(7)).toString();rDn.exports=B1i});var aDn=pt(function(Q_a,sDn){var T1i=(e,t,n)=>{let o=n[0],r=n[1],i=n[2],s,a,c,l,h,d,u,_,p,m,A,g;if(t===e)e[12]=t[0]*o+t[4]*r+t[8]*i+t[12],e[13]=t[1]*o+t[5]*r+t[9]*i+t[13],e[14]=t[2]*o+t[6]*r+t[10]*i+t[14],e[15]=t[3]*o+t[7]*r+t[11]*i+t[15];else s=t[0],a=t[1],c=t[2],l=t[3],h=t[4],d=t[5],u=t[6],_=t[7],p=t[8],m=t[9],A=t[10],g=t[11],e[0]=s,e[1]=a,e[2]=c,e[3]=l,e[4]=h,e[5]=d,e[6]=u,e[7]=_,e[8]=p,e[9]=m,e[10]=A,e[11]=g,e[12]=s*o+h*r+p*i+t[12],e[13]=a*o+d*r+m*i+t[13],e[14]=c*o+u*r+A*i+t[14],e[15]=l*o+_*r+g*i+t[15];return e};sDn.exports=T1i});var ld=pt(function(k_a,cDn){cDn.exports={add:hBn(),clone:pBn(),copy:Elt(),create:Z7e(),invert:gBn(),equals:fBn(),fromRotation:wlt(),fromScaling:SBn(),fromTaitBryanRotation:EBn(),fromTranslation:wBn(),fromValues:TBn(),fromVectorRotation:wTn(),fromXRotation:TTn(),fromYRotation:NTn(),fromZRotation:QTn(),identity:Mlt(),isIdentity:LTn(),isOnlyTransformScale:FTn(),isMirroring:OTn(),mirrorByPlane:YTn(),multiply:UTn(),rotate:XTn(),rotateX:KTn(),rotateY:qTn(),rotateZ:ZTn(),scale:tDn(),subtract:oDn(),toString:iDn(),translate:aDn()}});var v0e=pt(function(L_a,hDn){var lDn=ld(),D1i=(e)=>{if(e===void 0)e=[];return{sides:e,transforms:lDn.create()}};hDn.exports=D1i});var uDn=pt(function(H_a,dDn){var N1i=(e,t)=>(e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e);dDn.exports=N1i});var mDn=pt(function(F_a,pDn){var R1i=(e,t,n)=>(e[0]=t[0]+n[0],e[1]=t[1]+n[1],e);pDn.exports=R1i});var tSe=pt(function(z_a,_Dn){var Q1i=(e)=>Math.atan2(e[1],e[0]);_Dn.exports=Q1i});var ADn=pt(function(O_a,gDn){var k1i=tSe(),L1i=(e)=>k1i(e)*57.29577951308232;gDn.exports=L1i});var S0e=pt(function(V_a,fDn){var H1i=()=>[0,0];fDn.exports=H1i});var xDn=pt(function(Y_a,yDn){var F1i=S0e(),z1i=(e)=>{let t=F1i();return t[0]=e[0],t[1]=e[1],t};yDn.exports=z1i});var bDn=pt(function(G_a,CDn){var O1i=(e,t)=>(e[0]=t[0],e[1]=t[1],e);CDn.exports=O1i});var vDn=pt(function(U_a,IDn){var V1i=(e,t,n)=>(e[0]=0,e[1]=0,e[2]=t[0]*n[1]-t[1]*n[0],e);IDn.exports=V1i});var PDn=pt(function(W_a,SDn){var Y1i=(e,t)=>{let n=t[0]-e[0],o=t[1]-e[1];return Math.sqrt(n*n+o*o)};SDn.exports=Y1i});var MDn=pt(function(X_a,EDn){var G1i=(e,t,n)=>(e[0]=t[0]/n[0],e[1]=t[1]/n[1],e);EDn.exports=G1i});var BDn=pt(function(j_a,wDn){var U1i=(e,t)=>e[0]*t[0]+e[1]*t[1];wDn.exports=U1i});var DDn=pt(function(K_a,TDn){var W1i=(e,t)=>e[0]===t[0]&&e[1]===t[1];TDn.exports=W1i});var Vlt=pt(function($_a,NDn){var{sin:X1i,cos:j1i}=df(),K1i=(e,t)=>(e[0]=j1i(t),e[1]=X1i(t),e);NDn.exports=K1i});var QDn=pt(function(q_a,RDn){var $1i=Vlt(),q1i=(e,t)=>$1i(e,t*0.017453292519943295);RDn.exports=q1i});var LDn=pt(function(J_a,kDn){var J1i=(e,t)=>(e[0]=t,e[1]=t,e);kDn.exports=J1i});var FDn=pt(function(Z_a,HDn){var Z1i=S0e(),eyi=(e,t)=>{let n=Z1i();return n[0]=e,n[1]=t,n};HDn.exports=eyi});var ODn=pt(function(ega,zDn){var tyi=(e)=>Math.sqrt(e[0]*e[0]+e[1]*e[1]);zDn.exports=tyi});var YDn=pt(function(tga,VDn){var nyi=(e,t,n,o)=>{let r=t[0],i=t[1];return e[0]=r+o*(n[0]-r),e[1]=i+o*(n[1]-i),e};VDn.exports=nyi});var UDn=pt(function(nga,GDn){var oyi=(e,t,n)=>(e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e);GDn.exports=oyi});var XDn=pt(function(oga,WDn){var ryi=(e,t,n)=>(e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e);WDn.exports=ryi});var KDn=pt(function(rga,jDn){var iyi=(e,t,n)=>(e[0]=t[0]*n[0],e[1]=t[1]*n[1],e);jDn.exports=iyi});var qDn=pt(function(iga,$Dn){var syi=(e,t)=>(e[0]=-t[0],e[1]=-t[1],e);$Dn.exports=syi});var Ylt=pt(function(sga,JDn){var ayi=(e,t,n,o)=>{let r=t[0]-n[0],i=t[1]-n[1],s=Math.cos(o),a=Math.sin(o);return e[0]=r*s-i*a+n[0],e[1]=r*a+i*s+n[1],e};JDn.exports=ayi});var eNn=pt(function(aga,ZDn){var{TAU:cyi}=bc(),lyi=S0e(),hyi=Ylt(),dyi=(e,t)=>hyi(e,t,lyi(),cyi/4);ZDn.exports=dyi});var nNn=pt(function(cga,tNn){var uyi=(e,t)=>{let n=t[0],o=t[1],r=n*n+o*o;if(r>0)r=1/Math.sqrt(r);return e[0]=n*r,e[1]=o*r,e};tNn.exports=uyi});var rNn=pt(function(lga,oNn){var pyi=(e,t,n)=>(e[0]=t[0]*n,e[1]=t[1]*n,e);oNn.exports=pyi});var sNn=pt(function(hga,iNn){var myi=(e,t,n)=>(e[0]=Math.round(t[0]/n)*n+0,e[1]=Math.round(t[1]/n)*n+0,e);iNn.exports=myi});var cNn=pt(function(dga,aNn){var _yi=(e,t)=>{let n=t[0]-e[0],o=t[1]-e[1];return n*n+o*o};aNn.exports=_yi});var hNn=pt(function(uga,lNn){var gyi=(e)=>{let t=e[0],n=e[1];return t*t+n*n};lNn.exports=gyi});var uNn=pt(function(pga,dNn){var Ayi=(e,t,n)=>(e[0]=t[0]-n[0],e[1]=t[1]-n[1],e);dNn.exports=Ayi});var mNn=pt(function(mga,pNn){var fyi=(e)=>`[${e[0].toFixed(7)}, ${e[1].toFixed(7)}]`;pNn.exports=fyi});var gNn=pt(function(_ga,_Nn){var yyi=(e,t,n)=>{let o=t[0],r=t[1];return e[0]=n[0]*o+n[4]*r+n[12],e[1]=n[1]*o+n[5]*r+n[13],e};_Nn.exports=yyi});var Ia=pt(function(gga,ANn){ANn.exports={abs:uDn(),add:mDn(),angle:tSe(),angleDegrees:ADn(),angleRadians:tSe(),clone:xDn(),copy:bDn(),create:S0e(),cross:vDn(),distance:PDn(),divide:MDn(),dot:BDn(),equals:DDn(),fromAngleDegrees:QDn(),fromAngleRadians:Vlt(),fromScalar:LDn(),fromValues:FDn(),length:ODn(),lerp:YDn(),max:UDn(),min:XDn(),multiply:KDn(),negate:qDn(),normal:eNn(),normalize:nNn(),rotate:Ylt(),scale:rNn(),snap:sNn(),squaredDistance:cNn(),squaredLength:hNn(),subtract:uNn(),toString:mNn(),transform:gNn()}});var yNn=pt(function(Aga,fNn){var cee=Ia(),xyi=v0e(),Cyi=(e)=>{if(!Array.isArray(e))throw Error("the given points must be an array");let t=e.length;if(t<3)throw Error("the given points must define a closed geometry with three or more points");if(cee.equals(e[0],e[t-1]))--t;let n=[],o=e[t-1];for(let r=0;r<t;r++){let i=e[r];n.push([cee.clone(o),cee.clone(i)]),o=i}return xyi(n)};fNn.exports=Cyi});var bNn=pt(function(fga,CNn){var xNn=ld(),nSe=Ia(),byi=v0e(),Iyi=(e)=>{if(e[0]!==0)throw Error("invalid compact binary data");let t=byi();t.transforms=xNn.clone(e.slice(1,17));for(let n=21;n<e.length;n+=4){let o=nSe.fromValues(e[n+0],e[n+1]),r=nSe.fromValues(e[n+2],e[n+3]);t.sides.push([o,r])}if(e[17]>=0)t.color=[e[17],e[18],e[19],e[20]];return t};CNn.exports=Iyi});var Glt=pt(function(yga,INn){var vyi=(e)=>{if(e&&typeof e==="object"){if("sides"in e&&"transforms"in e){if(Array.isArray(e.sides)&&"length"in e.transforms)return!0}}return!1};INn.exports=vyi});var SNn=pt(function(xga,vNn){var oSe=ld(),ML=Ia(),Syi=(e)=>{if(oSe.isIdentity(e.transforms))return e;return e.sides=e.sides.map((t)=>{let n=ML.transform(ML.create(),t[0],e.transforms),o=ML.transform(ML.create(),t[1],e.transforms);return[n,o]}),e.transforms=oSe.create(),e};vNn.exports=Syi});var lee=pt(function(Cga,PNn){var Pyi=SNn(),Eyi=(e)=>Pyi(e).sides;PNn.exports=Eyi});var Ult=pt(function(bga,ENn){var Myi=v0e(),wyi=lee(),Byi=(e)=>{let n=wyi(e).map((o)=>[o[1],o[0]]);return n.reverse(),Myi(n)};ENn.exports=Byi});var Wlt=pt(function(Iga,MNn){var jP=Ia(),Tyi=lee(),Dyi=(e)=>{let t=new Map,n=(o)=>{let r=o.toString();if(t.has(r))return t.get(r);else return t.set(r,o),o};return e.map((o)=>o.map(n))},Nyi=(e)=>{let t=new Map;return Dyi(e).forEach((o)=>{if(t.has(o[0]))t.get(o[0]).push(o);else t.set(o[0],[o])}),t},Ryi=(e)=>{let t=Nyi(Tyi(e)),n=[];while(!0){let o;for(let[s,a]of t){if(o=a.shift(),!o){t.delete(s);continue}break}if(o===void 0)break;let r=[],i=o[0];while(!0){r.push(o[0]);let s=o[1];if(s===i)break;let a=t.get(s);if(!a)throw Error(`geometry is not closed at vertex ${s}`);let c=Qyi(o,a);if(a.length===0)t.delete(s);o=c}if(r.length>0)r.push(r.shift());n.push(r)}return t.clear(),n},Qyi=(e,t)=>{if(t.length===1)return t.pop();let n=jP.create(),o=jP.angleDegrees(jP.subtract(n,e[1],e[0])),r,i;t.forEach((a,c)=>{let h=jP.angleDegrees(jP.subtract(n,a[1],a[0]))-o;if(h<-180)h+=360;if(h>=180)h-=360;if(i===void 0||h>r)i=c,r=h});let s=t[i];return t.splice(i,1),s};MNn.exports=Ryi});var BNn=pt(function(vga,wNn){var kyi=lee(),Lyi=(e)=>{let n=kyi(e).map((o)=>o[0]);if(n.length>0)n.push(n.shift());return n};wNn.exports=Lyi});var DNn=pt(function(Sga,TNn){var rSe=Ia(),Hyi=lee(),Fyi=(e)=>{let t=Hyi(e),n="geom2 ("+t.length+` sides):
[
`;return t.forEach((o)=>{n+="  ["+rSe.toString(o[0])+", "+rSe.toString(o[1])+`]
`}),n+=`]
`,n};TNn.exports=Fyi});var RNn=pt(function(Pga,NNn){var zyi=(e)=>{let{sides:t,transforms:n}=e,o=[-1,-1,-1,-1];if(e.color)o=e.color;let r=new Float32Array(21+t.length*4);r[0]=0,r[1]=n[0],r[2]=n[1],r[3]=n[2],r[4]=n[3],r[5]=n[4],r[6]=n[5],r[7]=n[6],r[8]=n[7],r[9]=n[8],r[10]=n[9],r[11]=n[10],r[12]=n[11],r[13]=n[12],r[14]=n[13],r[15]=n[14],r[16]=n[15],r[17]=o[0],r[18]=o[1],r[19]=o[2],r[20]=o[3];for(let i=0;i<t.length;i++){let s=i*4+21,a=t[i][0],c=t[i][1];r[s+0]=a[0],r[s+1]=a[1],r[s+2]=c[0],r[s+3]=c[1]}return r};NNn.exports=zyi});var kNn=pt(function(Ega,QNn){var iSe=ld(),Oyi=Ult(),Vyi=(e,t)=>{let n=iSe.multiply(iSe.create(),e,t.transforms),o=Object.assign({},t,{transforms:n});if(e[0]*e[5]-e[4]*e[1]<0)return Oyi(o);return o};QNn.exports=Vyi});var FNn=pt(function(Mga,HNn){var LNn=Ia(),Yyi=Glt(),Gyi=Wlt(),Uyi=(e)=>{if(!Yyi(e))throw Error("invalid geom2 structure");if(Gyi(e),e.sides.forEach((t)=>{if(LNn.equals(t[0],t[1]))throw Error(`geom2 self-edge ${t[0]}`)}),!e.transforms.every(Number.isFinite))throw Error(`geom2 invalid transforms ${e.transforms}`)};HNn.exports=Uyi});var qs=pt(function(wga,zNn){zNn.exports={clone:cBn(),create:v0e(),fromPoints:yNn(),fromCompactBinary:bNn(),isA:Glt(),reverse:Ult(),toOutlines:Wlt(),toPoints:BNn(),toSides:lee(),toString:DNn(),toCompactBinary:RNn(),transform:kNn(),validate:FNn()}});var VNn=pt(function(Bga,ONn){var Wyi=(e)=>Object.assign({},e);ONn.exports=Wyi});var hee=pt(function(Tga,GNn){var YNn=ld(),Xyi=(e)=>{if(e===void 0)e=[];return{polygons:e,transforms:YNn.create()}};GNn.exports=Xyi});var jNn=pt(function(Dga,XNn){var jyi=aee(),UNn=I0e(),WNn=Olt(),Kyi=(e,t,n)=>{let o=[],r=[],i=[];UNn(o,n,t),UNn(r,e,t);let s=WNn(jyi(i,r,o)),a=WNn(o);if(a===0)throw Error("a and b are the same point");return s/a},$yi=(e,t,n)=>Math.sqrt(Kyi(e,t,n));XNn.exports=$yi});var qNn=pt(function(Nga,$Nn){var qyi=aee(),Jyi=eSe(),KNn=I0e(),Zyi=(e,t,n,o)=>{let r=[0,0,0];return KNn(e,t,n),KNn(r,n,o),qyi(e,e,r),Jyi(e,e)};$Nn.exports=Zyi});var eRn=pt(function(Rga,ZNn){class JNn{constructor(){this.head=null,this.tail=null}clear(){this.head=this.tail=null}insertBefore(e,t){if(t.prev=e.prev,t.next=e,!t.prev)this.head=t;else t.prev.next=t;e.prev=t}insertAfter(e,t){if(t.prev=e,t.next=e.next,!t.next)this.tail=t;else t.next.prev=t;e.next=t}add(e){if(!this.head)this.head=e;else this.tail.next=e;e.prev=this.tail,e.next=null,this.tail=e}addAll(e){if(!this.head)this.head=e;else this.tail.next=e;e.prev=this.tail;while(e.next)e=e.next;this.tail=e}remove(e){if(!e.prev)this.head=e.next;else e.prev.next=e.next;if(!e.next)this.tail=e.prev;else e.next.prev=e.prev}removeChain(e,t){if(!e.prev)this.head=t.next;else e.prev.next=t.next;if(!t.next)this.tail=e.prev;else t.next.prev=e.prev}first(){return this.head}isEmpty(){return!this.head}}ZNn.exports=JNn});var oRn=pt(function(Qga,nRn){class tRn{constructor(e,t){this.point=e,this.index=t,this.next=null,this.prev=null,this.face=null}}nRn.exports=tRn});var sRn=pt(function(kga,iRn){var exi=Qlt(),txi=zlt();class rRn{constructor(e,t){this.vertex=e,this.face=t,this.next=null,this.prev=null,this.opposite=null}head(){return this.vertex}tail(){return this.prev?this.prev.vertex:null}length(){if(this.tail())return exi(this.tail().point,this.head().point);return-1}lengthSquared(){if(this.tail())return txi(this.tail().point,this.head().point);return-1}setOpposite(e){this.opposite=e,e.opposite=this}}iRn.exports=rRn});var cRn=pt(function(Lga,aRn){var Xlt=Nlt(),nxi=Rlt(),oxi=aee(),jlt=C0e(),rxi=klt(),ixi=eSe(),sSe=Flt(),Klt=I0e(),$lt=sRn();class qlt{constructor(){this.normal=[],this.centroid=[],this.offset=0,this.outside=null,this.mark=0,this.edge=null,this.nVertices=0}getEdge(e){if(typeof e!=="number")throw Error("requires a number");let t=this.edge;while(e>0)t=t.next,e-=1;while(e<0)t=t.prev,e+=1;return t}computeNormal(){let e=this.edge,t=e.next,n=t.next,o=Klt([],t.head().point,e.head().point),r=[],i=[];this.nVertices=2,this.normal=[0,0,0];while(n!==e)nxi(i,o),Klt(o,n.head().point,e.head().point),Xlt(this.normal,this.normal,oxi(r,i,o)),n=n.next,this.nVertices+=1;this.area=rxi(this.normal),this.normal=sSe(this.normal,this.normal,1/this.area)}computeNormalMinArea(e){if(this.computeNormal(),this.area<e){let t,n=0,o=this.edge;do{let l=o.lengthSquared();if(l>n)t=o,n=l;o=o.next}while(o!==this.edge);let r=t.tail().point,i=t.head().point,s=Klt([],i,r),a=Math.sqrt(n);sSe(s,s,1/a);let c=jlt(this.normal,s);sSe(s,s,-c),Xlt(this.normal,this.normal,s),ixi(this.normal,this.normal)}}computeCentroid(){this.centroid=[0,0,0];let e=this.edge;do Xlt(this.centroid,this.centroid,e.head().point),e=e.next;while(e!==this.edge);sSe(this.centroid,this.centroid,1/this.nVertices)}computeNormalAndCentroid(e){if(typeof e<"u")this.computeNormalMinArea(e);else this.computeNormal();this.computeCentroid(),this.offset=jlt(this.normal,this.centroid)}distanceToPlane(e){return jlt(this.normal,e)-this.offset}connectHalfEdges(e,t){let n;if(e.opposite.face===t.opposite.face){let o=t.opposite.face,r;if(e===this.edge)this.edge=t;if(o.nVertices===3)r=t.opposite.prev.opposite,o.mark=2,n=o;else{if(r=t.opposite.next,o.edge===r.prev)o.edge=r;r.prev=r.prev.prev,r.prev.next=r}t.prev=e.prev,t.prev.next=t,t.setOpposite(r),o.computeNormalAndCentroid()}else e.next=t,t.prev=e;return n}mergeAdjacentFaces(e,t){let n=e.opposite,o=n.face;t.push(o),o.mark=2;let{prev:r,next:i}=e,{prev:s,next:a}=n;while(r.opposite.face===o)r=r.prev,a=a.next;while(i.opposite.face===o)i=i.next,s=s.prev;let c;for(c=a;c!==s.next;c=c.next)c.face=this;this.edge=i;let l;if(l=this.connectHalfEdges(s,i),l)t.push(l);if(l=this.connectHalfEdges(r,a),l)t.push(l);return this.computeNormalAndCentroid(),t}collectIndices(){let e=[],t=this.edge;do e.push(t.head().index),t=t.next;while(t!==this.edge);return e}static createTriangle(e,t,n,o=0){let r=new qlt,i=new $lt(e,r),s=new $lt(t,r),a=new $lt(n,r);return i.next=a.prev=s,s.next=i.prev=a,a.next=s.prev=i,r.edge=i,r.computeNormalAndCentroid(o),r}}aRn.exports={VISIBLE:0,NON_CONVEX:1,DELETED:2,Face:qlt}});var pRn=pt(function(Hga,uRn){var Jlt=C0e(),sxi=jNn(),axi=qNn(),lRn=eRn(),cxi=oRn(),{Face:AT,VISIBLE:dee,NON_CONVEX:hRn,DELETED:lxi}=cRn();class dRn{constructor(e){if(!Array.isArray(e))throw TypeError("input is not a valid array");if(e.length<4)throw Error("cannot build a simplex out of <4 points");this.tolerance=-1,this.nFaces=0,this.nPoints=e.length,this.faces=[],this.newFaces=[],this.claimed=new lRn,this.unclaimed=new lRn,this.vertices=[];for(let t=0;t<e.length;t+=1)this.vertices.push(new cxi(e[t],t));this.discardedFaces=[],this.vertexPointIndices=[]}addVertexToFace(e,t){if(e.face=t,!t.outside)this.claimed.add(e);else this.claimed.insertBefore(t.outside,e);t.outside=e}removeVertexFromFace(e,t){if(e===t.outside)if(e.next&&e.next.face===t)t.outside=e.next;else t.outside=null;this.claimed.remove(e)}removeAllVerticesFromFace(e){if(e.outside){let t=e.outside;while(t.next&&t.next.face===e)t=t.next;return this.claimed.removeChain(e.outside,t),t.next=null,e.outside}}deleteFaceVertices(e,t){let n=this.removeAllVerticesFromFace(e);if(n)if(!t)this.unclaimed.addAll(n);else{let o;for(let r=n;r;r=o)if(o=r.next,t.distanceToPlane(r.point)>this.tolerance)this.addVertexToFace(r,t);else this.unclaimed.add(r)}}resolveUnclaimedPoints(e){let t=this.unclaimed.first();for(let n=t;n;n=t){t=n.next;let o=this.tolerance,r;for(let i=0;i<e.length;i+=1){let s=e[i];if(s.mark===dee){let a=s.distanceToPlane(n.point);if(a>o)o=a,r=s;if(o>1000*this.tolerance)break}}if(r)this.addVertexToFace(n,r)}}computeExtremes(){let e=[],t=[],n=[],o=[],r,i;for(r=0;r<3;r+=1)n[r]=o[r]=this.vertices[0];for(r=0;r<3;r+=1)e[r]=t[r]=this.vertices[0].point[r];for(r=1;r<this.vertices.length;r+=1){let s=this.vertices[r],a=s.point;for(i=0;i<3;i+=1)if(a[i]<e[i])e[i]=a[i],n[i]=s;for(i=0;i<3;i+=1)if(a[i]>t[i])t[i]=a[i],o[i]=s}return this.tolerance=3*Number.EPSILON*(Math.max(Math.abs(e[0]),Math.abs(t[0]))+Math.max(Math.abs(e[1]),Math.abs(t[1]))+Math.max(Math.abs(e[2]),Math.abs(t[2]))),[n,o]}createInitialSimplex(){let e=this.vertices,[t,n]=this.computeExtremes(),o,r,i,s,a=0,c=0;for(i=0;i<3;i+=1){let p=n[i].point[i]-t[i].point[i];if(p>a)a=p,c=i}let l=t[c],h=n[c];a=0;for(i=0;i<this.vertices.length;i+=1){let p=this.vertices[i];if(p!==l&&p!==h){let m=sxi(p.point,l.point,h.point);if(m>a)a=m,o=p}}let d=axi([],l.point,h.point,o.point),u=Jlt(l.point,d);a=-1;for(i=0;i<this.vertices.length;i+=1){let p=this.vertices[i];if(p!==l&&p!==h&&p!==o){let m=Math.abs(Jlt(d,p.point)-u);if(m>a)a=m,r=p}}let _=[];if(Jlt(r.point,d)-u<0){_.push(AT.createTriangle(l,h,o),AT.createTriangle(r,h,l),AT.createTriangle(r,o,h),AT.createTriangle(r,l,o));for(i=0;i<3;i+=1){let p=(i+1)%3;_[i+1].getEdge(2).setOpposite(_[0].getEdge(p)),_[i+1].getEdge(1).setOpposite(_[p+1].getEdge(0))}}else{_.push(AT.createTriangle(l,o,h),AT.createTriangle(r,l,h),AT.createTriangle(r,h,o),AT.createTriangle(r,o,l));for(i=0;i<3;i+=1){let p=(i+1)%3;_[i+1].getEdge(2).setOpposite(_[0].getEdge((3-i)%3)),_[i+1].getEdge(0).setOpposite(_[p+1].getEdge(1))}}for(i=0;i<4;i+=1)this.faces.push(_[i]);for(i=0;i<e.length;i+=1){let p=e[i];if(p!==l&&p!==h&&p!==o&&p!==r){a=this.tolerance;let m;for(s=0;s<4;s+=1){let A=_[s].distanceToPlane(p.point);if(A>a)a=A,m=_[s]}if(m)this.addVertexToFace(p,m)}}}reindexFaceAndVertices(){let e=[];for(let t=0;t<this.faces.length;t+=1){let n=this.faces[t];if(n.mark===dee)e.push(n)}this.faces=e}collectFaces(e){let t=[];for(let n=0;n<this.faces.length;n+=1){if(this.faces[n].mark!==dee)throw Error("attempt to include a destroyed face in the hull");let o=this.faces[n].collectIndices();if(e)t.push(o);else for(let r=0;r<o.length-2;r+=1)t.push([o[0],o[r+1],o[r+2]])}return t}nextVertexToAdd(){if(!this.claimed.isEmpty()){let e,t,n=0,o=this.claimed.first().face;for(t=o.outside;t&&t.face===o;t=t.next){let r=o.distanceToPlane(t.point);if(r>n)n=r,e=t}return e}}computeHorizon(e,t,n,o){this.deleteFaceVertices(n),n.mark=lxi;let r;if(!t)r=t=n.getEdge(0);else r=t.next;do{let i=r.opposite,s=i.face;if(s.mark===dee)if(s.distanceToPlane(e)>this.tolerance)this.computeHorizon(e,i,s,o);else o.push(r);r=r.next}while(r!==t)}addAdjoiningFace(e,t){let n=AT.createTriangle(e,t.tail(),t.head());return this.faces.push(n),n.getEdge(-1).setOpposite(t.opposite),n.getEdge(0)}addNewFaces(e,t){this.newFaces=[];let n,o;for(let r=0;r<t.length;r+=1){let i=t[r],s=this.addAdjoiningFace(e,i);if(!n)n=s;else s.next.setOpposite(o);this.newFaces.push(s.face),o=s}n.next.setOpposite(o)}oppositeFaceDistance(e){return e.face.distanceToPlane(e.opposite.face.centroid)}doAdjacentMerge(e,t){let n=e.edge,o=!0,r=0;do{if(r>=e.nVertices)throw Error("merge recursion limit exceeded");let i=n.opposite.face,s=!1;if(t===2){if(this.oppositeFaceDistance(n)>-this.tolerance||this.oppositeFaceDistance(n.opposite)>-this.tolerance)s=!0}else if(e.area>i.area){if(this.oppositeFaceDistance(n)>-this.tolerance)s=!0;else if(this.oppositeFaceDistance(n.opposite)>-this.tolerance)o=!1}else if(this.oppositeFaceDistance(n.opposite)>-this.tolerance)s=!0;else if(this.oppositeFaceDistance(n)>-this.tolerance)o=!1;if(s){let a=e.mergeAdjacentFaces(n,[]);for(let c=0;c<a.length;c+=1)this.deleteFaceVertices(a[c],e);return!0}n=n.next,r+=1}while(n!==e.edge);if(!o)e.mark=hRn;return!1}addVertexToHull(e){let t=[];this.unclaimed.clear(),this.removeVertexFromFace(e,e.face),this.computeHorizon(e.point,null,e.face,t),this.addNewFaces(e,t);for(let n=0;n<this.newFaces.length;n+=1){let o=this.newFaces[n];if(o.mark===dee)while(this.doAdjacentMerge(o,1));}for(let n=0;n<this.newFaces.length;n+=1){let o=this.newFaces[n];if(o.mark===hRn){o.mark=dee;while(this.doAdjacentMerge(o,2));}}this.resolveUnclaimedPoints(this.newFaces)}build(){let e;this.createInitialSimplex();while(e=this.nextVertexToAdd())this.addVertexToHull(e);this.reindexFaceAndVertices()}}uRn.exports=dRn});var Zlt=pt(function(Fga,mRn){var hxi=pRn(),dxi=(e,t={})=>{let n=new hxi(e);return n.build(),n.collectFaces(t.skipTriangulation)};mRn.exports=dxi});var FG=pt(function(zga,_Rn){var uxi=(e)=>{if(e===void 0||e.length<3)e=[];return{vertices:e}};_Rn.exports=uxi});var fRn=pt(function(Oga,ARn){var pxi=FG(),gRn=di(),mxi=(...e)=>{let t,n;if(e.length===1)t=pxi(),n=e[0];else t=e[0],n=e[1];return t.vertices=n.vertices.map((o)=>gRn.clone(o)),t};ARn.exports=mxi});var CRn=pt(function(Vga,xRn){var yRn=di(),_xi=FG(),gxi=(e)=>{let t=e.map((n)=>yRn.clone(n));return _xi(t)};xRn.exports=gxi});var IRn=pt(function(Yga,bRn){var Axi=FG(),fxi=(e,t)=>{let n=Axi(e);return n.plane=t,n};bRn.exports=fxi});var P0e=pt(function(Gga,vRn){var yxi=()=>[0,0,0,0];vRn.exports=yxi});var eht=pt(function(Uga,SRn){var xxi=P0e(),Cxi=(e)=>{let t=xxi();return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t};SRn.exports=Cxi});var tht=pt(function(Wga,PRn){var bxi=(e,t)=>(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e);PRn.exports=bxi});var nht=pt(function(Xga,ERn){var Ixi=(e,t)=>e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3];ERn.exports=Ixi});var oht=pt(function(jga,MRn){var vxi=(e,t)=>(e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e);MRn.exports=vxi});var rht=pt(function(Kga,wRn){var uee=di(),Sxi=(e,t,n)=>{let o=uee.normalize(uee.create(),t),r=uee.dot(n,o);return e[0]=o[0],e[1]=o[1],e[2]=o[2],e[3]=r,e};wRn.exports=Sxi});var iht=pt(function($ga,BRn){var Pxi=P0e(),Exi=(e,t,n,o)=>{let r=Pxi();return r[0]=e,r[1]=t,r[2]=n,r[3]=o,r};BRn.exports=Exi});var DRn=pt(function(qga,TRn){var Wu=di(),Mxi=rht(),wxi=(e,...t)=>{e[0]=0,e[1]=0,e[2]=0,e[3]=0;let n=t.length;t.forEach((_)=>{Wu.add(e,e,_)}),Wu.scale(e,e,1/n);let o=0,r=0,i=0,s=0,a=0,c=0,l=Wu.create();t.forEach((_)=>{Wu.subtract(l,_,e),o+=l[0]*l[0],r+=l[0]*l[1],i+=l[0]*l[2],s+=l[1]*l[1],a+=l[1]*l[2],c+=l[2]*l[2]}),o/=n,r/=n,i/=n,s/=n,a/=n,c/=n,l[0]=0,l[1]=0,l[2]=0;let h=Wu.create(),d=s*c-a*a;h[0]=d,h[1]=i*a-r*c,h[2]=r*a-i*s;let u=d*d;if(Wu.add(l,l,Wu.scale(h,h,u)),d=o*c-i*i,h[0]=i*a-r*c,h[1]=d,h[2]=r*i-a*o,u=d*d,Wu.dot(l,h)<0)u=-u;if(Wu.add(l,l,Wu.scale(h,h,u)),d=o*s-r*r,h[0]=r*a-i*s,h[1]=r*i-a*o,h[2]=d,u=d*d,Wu.dot(l,h)<0)u=-u;return Wu.add(l,l,Wu.scale(h,h,u)),Mxi(e,l,e)};TRn.exports=wxi});var sht=pt(function(Jga,NRn){var U_=di(),Bxi=(e,...t)=>{let n=t.length,o=U_.create(),r=U_.create(),i=(s)=>{let a=t[s],c=t[(s+1)%n],l=t[(s+2)%n];return U_.subtract(o,c,a),U_.subtract(r,l,a),U_.cross(o,o,r),U_.normalize(o,o),o};if(e[0]=0,e[1]=0,e[2]=0,n===3)U_.copy(e,i(0));else t.forEach((s,a)=>{U_.add(e,e,i(a))}),U_.normalize(e,e);return e[3]=U_.dot(e,t[0]),e};NRn.exports=Bxi});var QRn=pt(function(Zga,RRn){var{EPS:aht}=bc(),Gh=di(),Txi=(e,t,n,o)=>{let r=Gh.subtract(Gh.create(),n,t),i=Gh.subtract(Gh.create(),o,t);if(Gh.length(r)<aht)r=Gh.orthogonal(r,i);if(Gh.length(i)<aht)i=Gh.orthogonal(i,r);let s=Gh.cross(Gh.create(),r,i);if(Gh.length(s)<aht)i=Gh.orthogonal(i,r),s=Gh.cross(s,r,i);s=Gh.normalize(s,s);let a=Gh.dot(s,t);return e[0]=s[0],e[1]=s[1],e[2]=s[2],e[3]=a,e};RRn.exports=Txi});var HRn=pt(function(eAa,LRn){var kRn=di(),Dxi=(e,t)=>{let n=t[0]*e[0]+t[1]*e[1]+t[2]*e[2]-e[3],o=t[0]-n*e[0],r=t[1]-n*e[1],i=t[2]-n*e[2];return kRn.fromValues(o,r,i)};LRn.exports=Dxi});var cht=pt(function(tAa,zRn){var FRn=di(),Nxi=(e,t)=>FRn.dot(e,t)-e[3];zRn.exports=Nxi});var lht=pt(function(nAa,ORn){var Rxi=(e)=>`(${e[0].toFixed(9)}, ${e[1].toFixed(9)}, ${e[2].toFixed(9)}, ${e[3].toFixed(9)})`;ORn.exports=Rxi});var GRn=pt(function(oAa,YRn){var VRn=ld(),Uh=di(),Qxi=sht(),kxi=oht(),Lxi=(e,t,n)=>{let o=VRn.isMirroring(n),r=Uh.orthogonal(Uh.create(),t),i=Uh.cross(r,t,r),s=Uh.cross(Uh.create(),t,i),a=Uh.fromScalar(Uh.create(),t[3]);Uh.multiply(a,a,t);let c=Uh.add(Uh.create(),a,i),l=Uh.add(Uh.create(),a,s);if(a=Uh.transform(a,a,n),c=Uh.transform(c,c,n),l=Uh.transform(l,l,n),Qxi(e,a,c,l),o)kxi(e,e);return e};YRn.exports=Lxi});var Hv=pt(function(rAa,URn){URn.exports={clone:eht(),copy:tht(),create:P0e(),equals:nht(),flip:oht(),fromNormalAndPoint:rht(),fromValues:iht(),fromNoisyPoints:DRn(),fromPoints:sht(),fromPointsRandom:QRn(),projectionOfPoint:HRn(),signedDistanceToPoint:cht(),toString:lht(),transform:GRn()}});var XRn=pt(function(iAa,WRn){var aSe=Hv(),Hxi=FG(),Fxi=(e)=>{let t=e.vertices.slice().reverse(),n=Hxi(t);if(e.plane)n.plane=aSe.flip(aSe.create(),e.plane);return n};WRn.exports=Fxi});var hht=pt(function(sAa,jRn){var zxi=(e)=>{if(e&&typeof e==="object"){if("vertices"in e){if(Array.isArray(e.vertices))return!0}}return!1};jRn.exports=zxi});var dht=pt(function(aAa,KRn){var cSe=Hv(),K5=di(),Oxi=(e)=>Vxi(e.vertices),Vxi=(e)=>{let t=e.length;if(t>2){let n=cSe.fromPoints(cSe.create(),...e),o=e[t-2],r=e[t-1];for(let i=0;i<t;i++){let s=e[i];if(!Yxi(o,r,s,n))return!1;o=r,r=s}}return!0},Yxi=(e,t,n,o)=>{let r=K5.cross(K5.create(),K5.subtract(K5.create(),t,e),K5.subtract(K5.create(),n,t));return K5.dot(r,o)>=0};KRn.exports=Oxi});var hSe=pt(function(cAa,$Rn){var lSe=Hv(),Gxi=(e)=>{if(!e.plane)e.plane=lSe.fromPoints(lSe.create(),...e.vertices);return e.plane};$Rn.exports=Gxi});var uht=pt(function(lAa,qRn){var Uxi=hSe(),Wxi=(e)=>{let t=e.vertices.length;if(t<3)return 0;let n=e.vertices,o=Uxi(e),r=Math.abs(o[0]),i=Math.abs(o[1]),s=Math.abs(o[2]);if(r+i+s===0)return 0;let a=3;if(r>i&&r>s)a=1;else if(i>s)a=2;let c=0,l=0,h=1,d=2;switch(a){case 1:for(h=1;h<t;h++)l=h-1,d=(h+1)%t,c+=n[h][1]*(n[d][2]-n[l][2]);c+=n[0][1]*(n[1][2]-n[t-1][2]),c/=2*o[0];break;case 2:for(h=1;h<t;h++)l=h-1,d=(h+1)%t,c+=n[h][2]*(n[d][0]-n[l][0]);c+=n[0][2]*(n[1][0]-n[t-1][0]),c/=2*o[1];break;case 3:default:for(h=1;h<t;h++)l=h-1,d=(h+1)%t,c+=n[h][0]*(n[d][1]-n[l][1]);c+=n[0][0]*(n[1][1]-n[t-1][1]),c/=2*o[2];break}return c};qRn.exports=Wxi});var ZRn=pt(function(hAa,JRn){var KP=di(),Xxi=(e)=>{let t=e.vertices,n=t.length,o=n===0?KP.create():KP.clone(t[0]),r=KP.clone(o);for(let i=1;i<n;i++)KP.min(o,o,t[i]),KP.max(r,r,t[i]);return[o,r]};JRn.exports=Xxi});var tQn=pt(function(dAa,eQn){var jxi=(e,t)=>e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3];eQn.exports=jxi});var oQn=pt(function(uAa,nQn){var Kxi=(e,t)=>(e[0]=t,e[1]=t,e[2]=t,e[3]=t,e);nQn.exports=Kxi});var iQn=pt(function(pAa,rQn){var $xi=(e,t,n)=>{let[o,r,i,s]=t;return e[0]=n[0]*o+n[4]*r+n[8]*i+n[12]*s,e[1]=n[1]*o+n[5]*r+n[9]*i+n[13]*s,e[2]=n[2]*o+n[6]*r+n[10]*i+n[14]*s,e[3]=n[3]*o+n[7]*r+n[11]*i+n[15]*s,e};rQn.exports=$xi});var pht=pt(function(mAa,sQn){sQn.exports={clone:eht(),copy:tht(),create:P0e(),dot:tQn(),equals:nht(),fromScalar:oQn(),fromValues:iht(),toString:lht(),transform:iQn()}});var hQn=pt(function(_Aa,lQn){var cQn=pht(),aQn=new WeakMap,qxi=(e)=>{let t=aQn.get(e);if(t)return t;let n=e.vertices,o=cQn.create();if(n.length===0)return o[0]=0,o[1]=0,o[2]=0,o[3]=0,o;let r=n[0],i=r,s=r,a=r,c=r,l=r;n.forEach((_)=>{if(r[0]>_[0])r=_;if(i[1]>_[1])i=_;if(s[2]>_[2])s=_;if(a[0]<_[0])a=_;if(c[1]<_[1])c=_;if(l[2]<_[2])l=_}),o[0]=(r[0]+a[0])*0.5,o[1]=(i[1]+c[1])*0.5,o[2]=(s[2]+l[2])*0.5;let h=o[0]-a[0],d=o[1]-c[1],u=o[2]-l[2];return o[3]=Math.sqrt(h*h+d*d+u*u),aQn.set(e,o),o};lQn.exports=qxi});var uQn=pt(function(gAa,dQn){var pee=di(),Jxi=(e)=>{let t=0,n=e.vertices,o=pee.create();for(let r=0;r<n.length-2;r++)pee.cross(o,n[r+1],n[r+2]),t+=pee.dot(n[0],o);return t/=6,t};dQn.exports=Jxi});var mQn=pt(function(AAa,pQn){var Zxi=(e)=>e.vertices;pQn.exports=Zxi});var AQn=pt(function(fAa,gQn){var _Qn=di(),e5i=(e)=>{let t="poly3: vertices: [";return e.vertices.forEach((n)=>{t+=`${_Qn.toString(n)}, `}),t+="]",t};gQn.exports=e5i});var xQn=pt(function(yAa,yQn){var fQn=ld(),dSe=di(),t5i=FG(),n5i=(e,t)=>{let n=t.vertices.map((o)=>dSe.transform(dSe.create(),o,e));if(fQn.isMirroring(e))n.reverse();return t5i(n)};yQn.exports=n5i});var IQn=pt(function(xAa,bQn){var o5i=cht(),{NEPS:r5i}=bc(),CQn=di(),i5i=hht(),s5i=dht(),a5i=uht(),c5i=hSe(),l5i=(e)=>{if(!i5i(e))throw Error("invalid poly3 structure");if(e.vertices.length<3)throw Error(`poly3 not enough vertices ${e.vertices.length}`);if(a5i(e)<=0)throw Error("poly3 area must be greater than zero");for(let t=0;t<e.vertices.length;t++)if(CQn.equals(e.vertices[t],e.vertices[(t+1)%e.vertices.length]))throw Error(`poly3 duplicate vertex ${e.vertices[t]}`);if(!s5i(e))throw Error("poly3 must be convex");if(e.vertices.forEach((t)=>{if(!t.every(Number.isFinite))throw Error(`poly3 invalid vertex ${t}`)}),e.vertices.length>3){let t=c5i(e);e.vertices.forEach((n)=>{let o=Math.abs(o5i(t,n));if(o>r5i)throw Error(`poly3 must be coplanar: vertex ${n} distance ${o}`)})}};bQn.exports=l5i});var nc=pt(function(CAa,vQn){vQn.exports={clone:fRn(),create:FG(),fromPoints:CRn(),fromPointsAndPlane:IRn(),invert:XRn(),isA:hht(),isConvex:dht(),measureArea:uht(),measureBoundingBox:ZRn(),measureBoundingSphere:hQn(),measureSignedVolume:uQn(),plane:hSe(),toPoints:mQn(),toString:AQn(),transform:xQn(),validate:IQn()}});var EQn=pt(function(bAa,PQn){var h5i=Zlt(),d5i=hee(),SQn=nc(),u5i=(e)=>{if(!Array.isArray(e))throw Error("the given points must be an array");let n=h5i(e,{skipTriangulation:!0}).map((o)=>{let r=o.map((i)=>e[i]);return SQn.create(r)});return d5i(n)};PQn.exports=u5i});var BQn=pt(function(IAa,wQn){var MQn=nc(),p5i=hee(),m5i=(e)=>{if(!Array.isArray(e))throw Error("the given points must be an array");let t=e.map((o,r)=>MQn.create(o));return p5i(t)};wQn.exports=m5i});var QQn=pt(function(vAa,RQn){var TQn=di(),DQn=ld(),NQn=nc(),_5i=hee(),g5i=(e)=>{if(e[0]!==1)throw Error("invalid compact binary data");let t=_5i();t.transforms=DQn.clone(e.slice(1,17));let n=e[21],o=22,r=e.length-n*3;while(r<e.length){let i=e[o];o++;let s=[];for(let a=0;a<i;a++)s.push(TQn.fromValues(e[r],e[r+1],e[r+2])),r+=3;t.polygons.push(NQn.create(s))}if(e[17]>=0)t.color=[e[17],e[18],e[19],e[20]];return t};RQn.exports=g5i});var HQn=pt(function(SAa,LQn){var uSe=ld(),kQn=nc(),A5i=(e)=>{if(uSe.isIdentity(e.transforms))return e;return e.polygons=e.polygons.map((t)=>kQn.transform(e.transforms,t)),e.transforms=uSe.create(),e};LQn.exports=A5i});var mee=pt(function(PAa,FQn){var f5i=HQn(),y5i=(e)=>f5i(e).polygons;FQn.exports=y5i});var VQn=pt(function(EAa,OQn){var zQn=nc(),x5i=hee(),C5i=mee(),b5i=(e)=>{let n=C5i(e).map((o)=>zQn.invert(o));return x5i(n)};OQn.exports=b5i});var pSe=pt(function(MAa,YQn){var I5i=(e)=>{if(e&&typeof e==="object"){if("polygons"in e&&"transforms"in e){if(Array.isArray(e.polygons)&&"length"in e.transforms)return!0}}return!1};YQn.exports=I5i});var XQn=pt(function(wAa,WQn){var{EPS:v5i}=bc(),GQn=di(),S5i=pSe(),P5i=mee(),UQn=nc(),E5i=(e)=>{if(!S5i(e))throw Error("isConvex requires a geom3 geometry");let t=P5i(e);if(t.length===0)return!0;let n=[],o=new Set;for(let r=0;r<t.length;r++){let i=t[r].vertices;for(let s=0;s<i.length;s++){let a=i[s],c=`${a[0]},${a[1]},${a[2]}`;if(!o.has(c))o.add(c),n.push(a)}}for(let r=0;r<t.length;r++){let i=UQn.plane(t[r]);for(let s=0;s<n.length;s++){let a=n[s];if(GQn.dot(i,a)-i[3]>v5i)return!1}}return!0};WQn.exports=E5i});var $Qn=pt(function(BAa,KQn){var jQn=nc(),M5i=mee(),w5i=(e)=>M5i(e).map((o)=>jQn.toPoints(o));KQn.exports=w5i});var ZQn=pt(function(TAa,JQn){var qQn=nc(),B5i=mee(),T5i=(e)=>{let t=B5i(e),n="geom3 ("+t.length+` polygons):
`;return t.forEach((o)=>{n+="  "+qQn.toString(o)+`
`}),n};JQn.exports=T5i});var nkn=pt(function(DAa,tkn){var ekn=nc(),D5i=(e)=>{let{polygons:t,transforms:n}=e,o=t.length,r=t.reduce((l,h)=>l+h.vertices.length,0),i=[-1,-1,-1,-1];if(e.color)i=e.color;let s=new Float32Array(22+o+r*3);s[0]=1,s[1]=n[0],s[2]=n[1],s[3]=n[2],s[4]=n[3],s[5]=n[4],s[6]=n[5],s[7]=n[6],s[8]=n[7],s[9]=n[8],s[10]=n[9],s[11]=n[10],s[12]=n[11],s[13]=n[12],s[14]=n[13],s[15]=n[14],s[16]=n[15],s[17]=i[0],s[18]=i[1],s[19]=i[2],s[20]=i[3],s[21]=r;let a=22,c=a+o;return t.forEach((l)=>{let h=ekn.toPoints(l);s[a]=h.length,a++;for(let d=0;d<h.length;d++){let u=h[d];s[c+0]=u[0],s[c+1]=u[1],s[c+2]=u[2],c+=3}}),s};tkn.exports=D5i});var rkn=pt(function(NAa,okn){var mSe=ld(),N5i=(e,t)=>{let n=mSe.multiply(mSe.create(),e,t.transforms);return Object.assign({},t,{transforms:n})};okn.exports=N5i});var akn=pt(function(RAa,skn){var ikn=nc(),R5i=pSe(),Q5i=(e)=>{if(!R5i(e))throw Error("invalid geom3 structure");if(e.polygons.forEach(ikn.validate),k5i(e),!e.transforms.every(Number.isFinite))throw Error(`geom3 invalid transforms ${e.transforms}`)},k5i=(e)=>{let t=new Map;e.polygons.forEach(({vertices:o})=>{o.forEach((r,i)=>{let s=`${r}`,a=`${o[(i+1)%o.length]}`,c=`${s}/${a}`,l=t.has(c)?t.get(c):0;t.set(c,l+1)})});let n=[];if(t.forEach((o,r)=>{let i=r.split("/").reverse().join("/"),s=t.get(i);if(o!==s)n.push(r.replace("/"," -> "))}),n.length>0)throw Error(`non-manifold edges ${n.length}
${n.join(`
`)}`)};skn.exports=Q5i});var Ys=pt(function(QAa,ckn){ckn.exports={clone:VNn(),create:hee(),fromPointsConvex:EQn(),fromPoints:BQn(),fromCompactBinary:QQn(),invert:VQn(),isA:pSe(),isConvex:XQn(),toPoints:$Qn(),toPolygons:mee(),toString:ZQn(),toCompactBinary:nkn(),transform:rkn(),validate:akn()}});var _Se=pt(function(kAa,lkn){var L5i=(e)=>Object.assign({},e);lkn.exports=L5i});var mht=pt(function(LAa,ukn){var{EPS:hkn}=bc(),dkn=Ia(),H5i=_Se(),F5i=(e)=>{if(e.isClosed)return e;let t=H5i(e);if(t.isClosed=!0,t.points.length>1){let n=t.points,o=n[0],r=n[n.length-1];while(dkn.distance(o,r)<hkn*hkn){if(n.pop(),n.length===1)break;r=n[n.length-1]}}return t};ukn.exports=F5i});var E0e=pt(function(HAa,mkn){var pkn=ld(),z5i=(e)=>{if(e===void 0)e=[];return{points:e,isClosed:!1,transforms:pkn.create()}};mkn.exports=z5i});var ASe=pt(function(FAa,gkn){var{EPS:_kn}=bc(),gSe=Ia(),O5i=mht(),V5i=E0e(),Y5i=(e,t)=>{let n={closed:!1},{closed:o}=Object.assign({},n,e),r=V5i();if(r.points=t.map((i)=>gSe.clone(i)),r.points.length>1){let i=r.points[0],s=r.points[r.points.length-1];if(gSe.distance(i,s)<_kn*_kn)o=!0}if(o===!0)r=O5i(r);return r};gkn.exports=Y5i});var fkn=pt(function(zAa,Akn){var fSe=ld(),ySe=Ia(),G5i=(e)=>{if(fSe.isIdentity(e.transforms))return e;return e.points=e.points.map((t)=>ySe.transform(ySe.create(),t,e.transforms)),e.transforms=fSe.create(),e};Akn.exports=G5i});var zG=pt(function(OAa,ykn){var U5i=fkn(),W5i=(e)=>U5i(e).points;ykn.exports=W5i});var Ckn=pt(function(VAa,xkn){var{TAU:xSe}=bc(),pc=Ia(),X5i=ASe(),j5i=zG(),K5i=(e,t)=>{let n={radius:[0,0],xaxisrotation:0,clockwise:!1,large:!1,segments:16},{endpoint:o,radius:r,xaxisrotation:i,clockwise:s,large:a,segments:c}=Object.assign({},n,e);if(!Array.isArray(o))throw Error("endpoint must be an array of X and Y values");if(o.length<2)throw Error("endpoint must contain X and Y values");if(o=pc.clone(o),!Array.isArray(r))throw Error("radius must be an array of X and Y values");if(r.length<2)throw Error("radius must contain X and Y values");if(c<4)throw Error("segments must be four or more");let l=1e5;if(t.isClosed)throw Error("the given path cannot be closed");let h=j5i(t);if(h.length<1)throw Error("the given path must contain one or more points (as the starting point for the arc)");let d=r[0],u=r[1],_=h[h.length-1];d=Math.round(d*l)/l,u=Math.round(u*l)/l,o=pc.fromValues(Math.round(o[0]*l)/l,Math.round(o[1]*l)/l);let p=!s,m=[];if(d===0||u===0)m.push(o);else{d=Math.abs(d),u=Math.abs(u);let g=i,f=Math.cos(g),y=Math.sin(g),x=pc.subtract(pc.create(),_,o);pc.scale(x,x,0.5);let C=Math.round((f*x[0]+y*x[1])*l)/l,b=Math.round((-y*x[0]+f*x[1])*l)/l,I=pc.fromValues(C,b),v=I[0]*I[0]/(d*d)+I[1]*I[1]/(u*u);if(v>1){let O=Math.sqrt(v);d*=O,u*=O,d=Math.round(d*l)/l,u=Math.round(u*l)/l}let P=Math.sqrt((d*d*u*u-d*d*I[1]*I[1]-u*u*I[0]*I[0])/(d*d*I[1]*I[1]+u*u*I[0]*I[0]));if(p===a)P=-P;let M=pc.fromValues(d*I[1]/u,-u*I[0]/d);pc.scale(M,M,P);let B=pc.fromValues(f*M[0]-y*M[1],y*M[0]+f*M[1]);B=pc.add(B,B,pc.scale(pc.create(),pc.add(pc.create(),_,o),0.5));let T=pc.fromValues((I[0]-M[0])/d,(I[1]-M[1])/u),N=pc.fromValues((-I[0]-M[0])/d,(-I[1]-M[1])/u),D=pc.angleRadians(T),H=pc.angleRadians(N)-D;if(H=H%xSe,!p&&H>0)H-=xSe;else if(p&&H<0)H+=xSe;let V=Math.floor(c*(Math.abs(H)/xSe));if(V<1)V=1;for(let O=1;O<V;O++){let U=D+O/V*H,j=Math.cos(U),Y=Math.sin(U),X=pc.fromValues(f*d*j-y*u*Y,y*d*j+f*u*Y);pc.add(X,X,B),m.push(X)}if(V)m.push(e.endpoint)}return m=h.concat(m),X5i({},m)};xkn.exports=K5i});var _ht=pt(function(YAa,bkn){var $5i=ASe(),q5i=zG(),{equals:J5i}=Ia(),Z5i=(...e)=>{let t=!1,n=[];return e.forEach((o,r)=>{let i=q5i(o).slice();if(n.length>0&&i.length>0&&J5i(i[0],n[n.length-1]))i.shift();if(i.length>0&&t)throw Error(`Cannot concatenate to a closed path; check the ${r}th path`);t=o.isClosed,n=n.concat(i)}),$5i({closed:t},n)};bkn.exports=Z5i});var ght=pt(function(GAa,Ikn){var e4i=_ht(),t4i=E0e(),n4i=(e,t)=>e4i(t,t4i(e));Ikn.exports=n4i});var Pkn=pt(function(UAa,Skn){var{TAU:o4i}=bc(),Xu=Ia(),vkn=Ia(),r4i=ght(),i4i=zG(),s4i=(e,t)=>{let n={segments:16},{controlPoints:o,segments:r}=Object.assign({},n,e);if(!Array.isArray(o))throw Error("controlPoints must be an array of one or more points");if(o.length<1)throw Error("controlPoints must be an array of one or more points");if(r<4)throw Error("segments must be four or more");if(t.isClosed)throw Error("the given geometry cannot be closed");let i=i4i(t);if(i.length<1)throw Error("the given path must contain one or more points (as the starting point for the bezier curve)");if(o=o.slice(),o[0]===null){if(o.length<2)throw Error("a null control point must be passed with one more control points");let b=i[i.length-2];if("lastBezierControlPoint"in t)b=t.lastBezierControlPoint;if(!Array.isArray(b))throw Error("the given path must contain TWO or more points if given a null control point");let I=Xu.scale(Xu.create(),i[i.length-1],2);Xu.subtract(I,I,b),o[0]=I}o.unshift(i[i.length-1]);let a=o.length-1,c=[],l=1;for(let b=0;b<=a;++b){if(b>0)l*=b;c.push(l)}let h=[];for(let b=0;b<=a;++b){let I=c[a]/(c[b]*c[a-b]);h.push(I)}let d=Xu.create(),u=Xu.create(),_=vkn.create(),p=(b)=>{let I=1,v=Math.pow(1-b,a),P=b!==1?1/(1-b):1,M=Xu.create();for(let B=0;B<=a;++B){if(B===a)v=1;let T=h[B]*I*v,N=Xu.scale(d,o[B],T);Xu.add(M,M,N),I*=b,v*=P}return M},m=[],A=[],g=a+1;for(let b=0;b<g;++b){let I=b/(g-1),v=p(I);m.push(v),A.push(I)}let f=1,y=o4i/r,x=Math.sin(y);while(f<m.length-1){let b=Xu.subtract(d,m[f],m[f-1]);Xu.normalize(b,b);let I=Xu.subtract(u,m[f+1],m[f]);Xu.normalize(I,I);let v=Xu.cross(_,b,I);if(Math.abs(v[2])>x){let P=A[f-1],M=A[f+1],B=P+(M-P)*1/3,T=P+(M-P)*2/3,N=p(B),D=p(T);if(m.splice(f,1,N,D),A.splice(f,1,B,T),f--,f<1)f=1}else++f}m.shift();let C=r4i(m,t);return C.lastBezierControlPoint=o[o.length-2],C};Skn.exports=s4i});var Bkn=pt(function(WAa,wkn){var Mkn=Ia(),Ekn=zG(),a4i=(e,t)=>{if(e.isClosed!==t.isClosed)return!1;if(e.points.length!==t.points.length)return!1;let n=Ekn(e),o=Ekn(t),r=n.length,i=0;do{let s=!1;for(let a=0;a<r;a++)if(!Mkn.equals(n[a],o[(a+i)%r])){s=!0;break}if(s===!1)return!0;if(!e.isClosed)return!1}while(++i<r);return!1};wkn.exports=a4i});var Rkn=pt(function(XAa,Nkn){var Tkn=ld(),Dkn=Ia(),c4i=E0e(),l4i=(e)=>{if(e[0]!==2)throw Error("invalid compact binary data");let t=c4i();t.transforms=Tkn.clone(e.slice(1,17)),t.isClosed=!!e[17];for(let n=22;n<e.length;n+=2){let o=Dkn.fromValues(e[n],e[n+1]);t.points.push(o)}if(e[18]>=0)t.color=[e[18],e[19],e[20],e[21]];return t};Nkn.exports=l4i});var Aht=pt(function(jAa,Qkn){var h4i=(e)=>{if(e&&typeof e==="object"){if("points"in e&&"transforms"in e&&"isClosed"in e){if(Array.isArray(e.points)&&"length"in e.transforms)return!0}}return!1};Qkn.exports=h4i});var Lkn=pt(function(KAa,kkn){var d4i=_Se(),u4i=(e)=>{let t=d4i(e);return t.points=e.points.slice().reverse(),t};kkn.exports=u4i});var zkn=pt(function($Aa,Fkn){var Hkn=Ia(),p4i=zG(),m4i=(e)=>{let t=p4i(e),n="path ("+t.length+" points, "+e.isClosed+`):
[
`;return t.forEach((o)=>{n+="  "+Hkn.toString(o)+`,
`}),n+=`]
`,n};Fkn.exports=m4i});var Vkn=pt(function(qAa,Okn){var _4i=(e)=>{let{points:t,transforms:n}=e,o=[-1,-1,-1,-1];if(e.color)o=e.color;let r=new Float32Array(22+t.length*2);r[0]=2,r[1]=n[0],r[2]=n[1],r[3]=n[2],r[4]=n[3],r[5]=n[4],r[6]=n[5],r[7]=n[6],r[8]=n[7],r[9]=n[8],r[10]=n[9],r[11]=n[10],r[12]=n[11],r[13]=n[12],r[14]=n[13],r[15]=n[14],r[16]=n[15],r[17]=e.isClosed?1:0,r[18]=o[0],r[19]=o[1],r[20]=o[2],r[21]=o[3];for(let i=0;i<t.length;i++){let s=i*2+22,a=t[i];r[s]=a[0],r[s+1]=a[1]}return r};Okn.exports=_4i});var Gkn=pt(function(JAa,Ykn){var CSe=ld(),g4i=(e,t)=>{let n=CSe.multiply(CSe.create(),e,t.transforms);return Object.assign({},t,{transforms:n})};Ykn.exports=g4i});var Xkn=pt(function(ZAa,Wkn){var Ukn=Ia(),A4i=Aht(),f4i=(e)=>{if(!A4i(e))throw Error("invalid path2 structure");if(e.points.length>1){for(let t=0;t<e.points.length;t++)if(Ukn.equals(e.points[t],e.points[(t+1)%e.points.length]))throw Error(`path2 duplicate points ${e.points[t]}`)}if(e.points.forEach((t)=>{if(!t.every(Number.isFinite))throw Error(`path2 invalid point ${t}`)}),!e.transforms.every(Number.isFinite))throw Error(`path2 invalid transforms ${e.transforms}`)};Wkn.exports=f4i});var Wh=pt(function(efa,jkn){jkn.exports={appendArc:Ckn(),appendBezier:Pkn(),appendPoints:ght(),clone:_Se(),close:mht(),concat:_ht(),create:E0e(),equals:Bkn(),fromPoints:ASe(),fromCompactBinary:Rkn(),isA:Aht(),reverse:Lkn(),toPoints:zG(),toString:zkn(),toCompactBinary:Vkn(),transform:Gkn(),validate:Xkn()}});var $kn=pt(function(tfa,Kkn){var y4i=Cs(),bSe=qs(),ISe=Ys(),vSe=Wh(),SSe=nc(),x4i=(e,t)=>{let n=bSe.clone(t);return n.color=e,n},C4i=(e,t)=>{let n=ISe.clone(t);return n.color=e,n},b4i=(e,t)=>{let n=vSe.clone(t);return n.color=e,n},I4i=(e,t)=>{let n=SSe.clone(t);return n.color=e,n},v4i=(e,...t)=>{if(!Array.isArray(e))throw Error("color must be an array");if(e.length<3)throw Error("color must contain R, G and B values");if(e.length===3)e=[e[0],e[1],e[2],1];if(t=y4i(t),t.length===0)throw Error("wrong number of arguments");let n=t.map((o)=>{if(bSe.isA(o))return x4i(e,o);if(ISe.isA(o))return C4i(e,o);if(vSe.isA(o))return b4i(e,o);if(SSe.isA(o))return I4i(e,o);return o.color=e,o});return n.length===1?n[0]:n};Kkn.exports=v4i});var fht=pt(function(nfa,qkn){var S4i={black:[0,0,0],silver:[0.7529411764705882,0.7529411764705882,0.7529411764705882],gray:[0.5019607843137255,0.5019607843137255,0.5019607843137255],white:[1,1,1],maroon:[0.5019607843137255,0,0],red:[1,0,0],purple:[0.5019607843137255,0,0.5019607843137255],fuchsia:[1,0,1],green:[0,0.5019607843137255,0],lime:[0,1,0],olive:[0.5019607843137255,0.5019607843137255,0],yellow:[1,1,0],navy:[0,0,0.5019607843137255],blue:[0,0,1],teal:[0,0.5019607843137255,0.5019607843137255],aqua:[0,1,1],aliceblue:[0.9411764705882353,0.9725490196078431,1],antiquewhite:[0.9803921568627451,0.9215686274509803,0.8431372549019608],aquamarine:[0.4980392156862745,1,0.8313725490196079],azure:[0.9411764705882353,1,1],beige:[0.9607843137254902,0.9607843137254902,0.8627450980392157],bisque:[1,0.8941176470588236,0.7686274509803922],blanchedalmond:[1,0.9215686274509803,0.803921568627451],blueviolet:[0.5411764705882353,0.16862745098039217,0.8862745098039215],brown:[0.6470588235294118,0.16470588235294117,0.16470588235294117],burlywood:[0.8705882352941177,0.7215686274509804,0.5294117647058824],cadetblue:[0.37254901960784315,0.6196078431372549,0.6274509803921569],chartreuse:[0.4980392156862745,1,0],chocolate:[0.8235294117647058,0.4117647058823529,0.11764705882352941],coral:[1,0.4980392156862745,0.3137254901960784],cornflowerblue:[0.39215686274509803,0.5843137254901961,0.9294117647058824],cornsilk:[1,0.9725490196078431,0.8627450980392157],crimson:[0.8627450980392157,0.0784313725490196,0.23529411764705882],cyan:[0,1,1],darkblue:[0,0,0.5450980392156862],darkcyan:[0,0.5450980392156862,0.5450980392156862],darkgoldenrod:[0.7215686274509804,0.5254901960784314,0.043137254901960784],darkgray:[0.6627450980392157,0.6627450980392157,0.6627450980392157],darkgreen:[0,0.39215686274509803,0],darkgrey:[0.6627450980392157,0.6627450980392157,0.6627450980392157],darkkhaki:[0.7411764705882353,0.7176470588235294,0.4196078431372549],darkmagenta:[0.5450980392156862,0,0.5450980392156862],darkolivegreen:[0.3333333333333333,0.4196078431372549,0.1843137254901961],darkorange:[1,0.5490196078431373,0],darkorchid:[0.6,0.19607843137254902,0.8],darkred:[0.5450980392156862,0,0],darksalmon:[0.9137254901960784,0.5882352941176471,0.47843137254901963],darkseagreen:[0.5607843137254902,0.7372549019607844,0.5607843137254902],darkslateblue:[0.2823529411764706,0.23921568627450981,0.5450980392156862],darkslategray:[0.1843137254901961,0.30980392156862746,0.30980392156862746],darkslategrey:[0.1843137254901961,0.30980392156862746,0.30980392156862746],darkturquoise:[0,0.807843137254902,0.8196078431372549],darkviolet:[0.5803921568627451,0,0.8274509803921568],deeppink:[1,0.0784313725490196,0.5764705882352941],deepskyblue:[0,0.7490196078431373,1],dimgray:[0.4117647058823529,0.4117647058823529,0.4117647058823529],dimgrey:[0.4117647058823529,0.4117647058823529,0.4117647058823529],dodgerblue:[0.11764705882352941,0.5647058823529412,1],firebrick:[0.6980392156862745,0.13333333333333333,0.13333333333333333],floralwhite:[1,0.9803921568627451,0.9411764705882353],forestgreen:[0.13333333333333333,0.5450980392156862,0.13333333333333333],gainsboro:[0.8627450980392157,0.8627450980392157,0.8627450980392157],ghostwhite:[0.9725490196078431,0.9725490196078431,1],gold:[1,0.8431372549019608,0],goldenrod:[0.8549019607843137,0.6470588235294118,0.12549019607843137],greenyellow:[0.6784313725490196,1,0.1843137254901961],grey:[0.5019607843137255,0.5019607843137255,0.5019607843137255],honeydew:[0.9411764705882353,1,0.9411764705882353],hotpink:[1,0.4117647058823529,0.7058823529411765],indianred:[0.803921568627451,0.3607843137254902,0.3607843137254902],indigo:[0.29411764705882354,0,0.5098039215686274],ivory:[1,1,0.9411764705882353],khaki:[0.9411764705882353,0.9019607843137255,0.5490196078431373],lavender:[0.9019607843137255,0.9019607843137255,0.9803921568627451],lavenderblush:[1,0.9411764705882353,0.9607843137254902],lawngreen:[0.48627450980392156,0.9882352941176471,0],lemonchiffon:[1,0.9803921568627451,0.803921568627451],lightblue:[0.6784313725490196,0.8470588235294118,0.9019607843137255],lightcoral:[0.9411764705882353,0.5019607843137255,0.5019607843137255],lightcyan:[0.8784313725490196,1,1],lightgoldenrodyellow:[0.9803921568627451,0.9803921568627451,0.8235294117647058],lightgray:[0.8274509803921568,0.8274509803921568,0.8274509803921568],lightgreen:[0.5647058823529412,0.9333333333333333,0.5647058823529412],lightgrey:[0.8274509803921568,0.8274509803921568,0.8274509803921568],lightpink:[1,0.7137254901960784,0.7568627450980392],lightsalmon:[1,0.6274509803921569,0.47843137254901963],lightseagreen:[0.12549019607843137,0.6980392156862745,0.6666666666666666],lightskyblue:[0.5294117647058824,0.807843137254902,0.9803921568627451],lightslategray:[0.4666666666666667,0.5333333333333333,0.6],lightslategrey:[0.4666666666666667,0.5333333333333333,0.6],lightsteelblue:[0.6901960784313725,0.7686274509803922,0.8705882352941177],lightyellow:[1,1,0.8784313725490196],limegreen:[0.19607843137254902,0.803921568627451,0.19607843137254902],linen:[0.9803921568627451,0.9411764705882353,0.9019607843137255],magenta:[1,0,1],mediumaquamarine:[0.4,0.803921568627451,0.6666666666666666],mediumblue:[0,0,0.803921568627451],mediumorchid:[0.7294117647058823,0.3333333333333333,0.8274509803921568],mediumpurple:[0.5764705882352941,0.4392156862745098,0.8588235294117647],mediumseagreen:[0.23529411764705882,0.7019607843137254,0.44313725490196076],mediumslateblue:[0.4823529411764706,0.40784313725490196,0.9333333333333333],mediumspringgreen:[0,0.9803921568627451,0.6039215686274509],mediumturquoise:[0.2823529411764706,0.8196078431372549,0.8],mediumvioletred:[0.7803921568627451,0.08235294117647059,0.5215686274509804],midnightblue:[0.09803921568627451,0.09803921568627451,0.4392156862745098],mintcream:[0.9607843137254902,1,0.9803921568627451],mistyrose:[1,0.8941176470588236,0.8823529411764706],moccasin:[1,0.8941176470588236,0.7098039215686275],navajowhite:[1,0.8705882352941177,0.6784313725490196],oldlace:[0.9921568627450981,0.9607843137254902,0.9019607843137255],olivedrab:[0.4196078431372549,0.5568627450980392,0.13725490196078433],orange:[1,0.6470588235294118,0],orangered:[1,0.27058823529411763,0],orchid:[0.8549019607843137,0.4392156862745098,0.8392156862745098],palegoldenrod:[0.9333333333333333,0.9098039215686274,0.6666666666666666],palegreen:[0.596078431372549,0.984313725490196,0.596078431372549],paleturquoise:[0.6862745098039216,0.9333333333333333,0.9333333333333333],palevioletred:[0.8588235294117647,0.4392156862745098,0.5764705882352941],papayawhip:[1,0.9372549019607843,0.8352941176470589],peachpuff:[1,0.8549019607843137,0.7254901960784313],peru:[0.803921568627451,0.5215686274509804,0.24705882352941178],pink:[1,0.7529411764705882,0.796078431372549],plum:[0.8666666666666667,0.6274509803921569,0.8666666666666667],powderblue:[0.6901960784313725,0.8784313725490196,0.9019607843137255],rosybrown:[0.7372549019607844,0.5607843137254902,0.5607843137254902],royalblue:[0.2549019607843137,0.4117647058823529,0.8823529411764706],saddlebrown:[0.5450980392156862,0.27058823529411763,0.07450980392156863],salmon:[0.9803921568627451,0.5019607843137255,0.4470588235294118],sandybrown:[0.9568627450980393,0.6431372549019608,0.3764705882352941],seagreen:[0.1803921568627451,0.5450980392156862,0.3411764705882353],seashell:[1,0.9607843137254902,0.9333333333333333],sienna:[0.6274509803921569,0.3215686274509804,0.17647058823529413],skyblue:[0.5294117647058824,0.807843137254902,0.9215686274509803],slateblue:[0.41568627450980394,0.35294117647058826,0.803921568627451],slategray:[0.4392156862745098,0.5019607843137255,0.5647058823529412],slategrey:[0.4392156862745098,0.5019607843137255,0.5647058823529412],snow:[1,0.9803921568627451,0.9803921568627451],springgreen:[0,1,0.4980392156862745],steelblue:[0.27450980392156865,0.5098039215686274,0.7058823529411765],tan:[0.8235294117647058,0.7058823529411765,0.5490196078431373],thistle:[0.8470588235294118,0.7490196078431373,0.8470588235294118],tomato:[1,0.38823529411764707,0.2784313725490196],turquoise:[0.25098039215686274,0.8784313725490196,0.8156862745098039],violet:[0.9333333333333333,0.5098039215686274,0.9333333333333333],wheat:[0.9607843137254902,0.8705882352941177,0.7019607843137254],whitesmoke:[0.9607843137254902,0.9607843137254902,0.9607843137254902],yellowgreen:[0.6039215686274509,0.803921568627451,0.19607843137254902]};qkn.exports=S4i});var Zkn=pt(function(ofa,Jkn){var P4i=fht(),E4i=(e)=>P4i[e.toLowerCase()];Jkn.exports=E4i});var tLn=pt(function(rfa,eLn){var M4i=(e)=>{if(e=e.replace("#",""),e.length<6)throw Error("the given notation must contain 3 or more hex values");let t=parseInt(e.substring(0,2),16)/255,n=parseInt(e.substring(2,4),16)/255,o=parseInt(e.substring(4,6),16)/255;if(e.length>=8){let r=parseInt(e.substring(6,8),16)/255;return[t,n,o,r]}return[t,n,o]};eLn.exports=M4i});var yht=pt(function(ifa,nLn){var w4i=(e,t,n)=>{if(n<0)n+=1;if(n>1)n-=1;if(n<0.16666666666666666)return e+(t-e)*6*n;if(n<0.5)return t;if(n<0.6666666666666666)return e+(t-e)*(0.6666666666666666-n)*6;return e};nLn.exports=w4i});var rLn=pt(function(sfa,oLn){var B4i=Cs(),xht=yht(),T4i=(...e)=>{if(e=B4i(e),e.length<3)throw Error("values must contain H, S and L values");let t=e[0],n=e[1],o=e[2],r=o,i=o,s=o;if(n!==0){let a=o<0.5?o*(1+n):o+n-o*n,c=2*o-a;r=xht(c,a,t+0.3333333333333333),i=xht(c,a,t),s=xht(c,a,t-0.3333333333333333)}if(e.length>3){let a=e[3];return[r,i,s,a]}return[r,i,s]};oLn.exports=T4i});var sLn=pt(function(afa,iLn){var D4i=Cs(),N4i=(...e)=>{if(e=D4i(e),e.length<3)throw Error("values must contain H, S and V values");let t=e[0],n=e[1],o=e[2],r=0,i=0,s=0,a=Math.floor(t*6),c=t*6-a,l=o*(1-n),h=o*(1-c*n),d=o*(1-(1-c)*n);switch(a%6){case 0:r=o,i=d,s=l;break;case 1:r=h,i=o,s=l;break;case 2:r=l,i=o,s=d;break;case 3:r=l,i=h,s=o;break;case 4:r=d,i=l,s=o;break;case 5:r=o,i=l,s=h;break}if(e.length>3){let u=e[3];return[r,i,s,u]}return[r,i,s]};iLn.exports=N4i});var cLn=pt(function(cfa,aLn){var R4i=Cs(),Q4i=(...e)=>{if(e=R4i(e),e.length<3)throw Error("values must contain R, G and B values");let t=e[0]*255,n=e[1]*255,o=e[2]*255,r=`#${Number(16777216+t*65536+n*256+o).toString(16).substring(1,7)}`;if(e.length>3)r=r+Number(e[3]*255).toString(16);return r};aLn.exports=Q4i});var hLn=pt(function(lfa,lLn){var k4i=Cs(),L4i=(...e)=>{if(e=k4i(e),e.length<3)throw Error("values must contain R, G and B values");let t=e[0],n=e[1],o=e[2],r=Math.max(t,n,o),i=Math.min(t,n,o),s,a,c=(r+i)/2;if(r===i)s=a=0;else{let l=r-i;switch(a=c>0.5?l/(2-r-i):l/(r+i),r){case t:s=(n-o)/l+(n<o?6:0);break;case n:s=(o-t)/l+2;break;case o:s=(t-n)/l+4;break}s/=6}if(e.length>3){let l=e[3];return[s,a,c,l]}return[s,a,c]};lLn.exports=L4i});var uLn=pt(function(hfa,dLn){var H4i=Cs(),F4i=(...e)=>{if(e=H4i(e),e.length<3)throw Error("values must contain R, G and B values");let t=e[0],n=e[1],o=e[2],r=Math.max(t,n,o),i=Math.min(t,n,o),s,a=r,c=r-i,l=r===0?0:c/r;if(r===i)s=0;else{switch(r){case t:s=(n-o)/c+(n<o?6:0);break;case n:s=(o-t)/c+2;break;case o:s=(t-n)/c+4;break}s/=6}if(e.length>3){let h=e[3];return[s,l,a,h]}return[s,l,a]};dLn.exports=F4i});var mLn=pt(function(dfa,pLn){pLn.exports={colorize:$kn(),colorNameToRgb:Zkn(),cssColors:fht(),hexToRgb:tLn(),hslToRgb:rLn(),hsvToRgb:sLn(),hueToColorComponent:yht(),rgbToHex:cLn(),rgbToHsl:hLn(),rgbToHsv:uLn()}});var ALn=pt(function(ufa,gLn){var z4i=(e)=>{if(!Array.isArray(e))throw Error("Bezier points must be a valid array/");if(e.length<2)throw Error("Bezier points must contain at least 2 values.");let t=O4i(e);return{points:e,pointType:t,dimensions:t==="float_single"?0:e[0].length,permutations:_Ln(e.length-1),tangentPermutations:_Ln(e.length-2)}},O4i=function(e){let t=null;return e.forEach((n)=>{let o="";if(Number.isFinite(n))o="float_single";else if(Array.isArray(n))n.forEach((r)=>{if(!Number.isFinite(r))throw Error("Bezier point values must all be numbers.")}),o="float_"+n.length;else throw Error("Bezier points must all be numbers or arrays of number.");if(t==null)t=o;else if(t!==o)throw Error("Bezier points must be either all numbers or all arrays of numbers of the same size.")}),t},_Ln=function(e){let t=[];for(let n=0;n<=e;n++)t.push(Cht(e)/(Cht(n)*Cht(e-n)));return t},Cht=function(e){let t=1;for(let n=2;n<=e;n++)t*=n;return t};gLn.exports=z4i});var bht=pt(function(pfa,yLn){var V4i=(e,t)=>{if(e<0||e>1)throw Error("Bezier valueAt() input must be between 0 and 1");if(t.pointType==="float_single")return fLn(t,t.points,e);else{let n=[];for(let o=0;o<t.dimensions;o++){let r=[];for(let i=0;i<t.points.length;i++)r.push(t.points[i][o]);n.push(fLn(t,r,e))}return n}},fLn=function(e,t,n){let o=t.length-1,r=0;for(let i=0;i<=o;i++)r+=e.permutations[i]*Math.pow(1-n,o-i)*Math.pow(n,i)*t[i];return r};yLn.exports=V4i});var bLn=pt(function(mfa,CLn){var Y4i=(e,t)=>{if(e<0||e>1)throw Error("Bezier tangentAt() input must be between 0 and 1");if(t.pointType==="float_single")return xLn(t,t.points,e);else{let n=[];for(let o=0;o<t.dimensions;o++){let r=[];for(let i=0;i<t.points.length;i++)r.push(t.points[i][o]);n.push(xLn(t,r,e))}return n}},xLn=function(e,t,n){let o=t.length-1,r=0;for(let i=0;i<o;i++){let s=o*(t[i+1]-t[i]);r+=e.tangentPermutations[i]*Math.pow(1-n,o-1-i)*Math.pow(n,i)*s}return r};CLn.exports=Y4i});var PSe=pt(function(_fa,vLn){var ILn=bht(),G4i=(e,t)=>{let n=0,o=[0],r=ILn(0,t);for(let i=1;i<=e;i++){let s=ILn(i/e,t);n+=U4i(s,r),o.push(n),r=s}return o},U4i=(e,t)=>{if(Number.isFinite(e)&&Number.isFinite(t))return Math.abs(e-t);else if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)throw Error("The operands must have the same number of dimensions.");let n=0;for(let o=0;o<e.length;o++)n+=(t[o]-e[o])*(t[o]-e[o]);return Math.sqrt(n)}else throw Error("The operands must be of the same type, either number or array.")};vLn.exports=G4i});var PLn=pt(function(gfa,SLn){var W4i=PSe(),X4i=(e,t)=>W4i(e,t)[e];SLn.exports=X4i});var MLn=pt(function(Afa,ELn){var j4i=PSe(),K4i=(e,t)=>{let n={distance:0,segments:100},{distance:o,segments:r}=Object.assign({},n,e),i=j4i(r,t),s=0,a=r;while(s<=a){let _=Math.floor(s+(a-s)/2),p=i[_]-o;if(p<0)s=_+1;else if(p>0)a=_-1;else{a=_;break}}let c=a;if(i[c]===o)return c/r;let l=i[c],d=i[c+1]-l,u=(o-l)/d;return(c+u)/r};ELn.exports=K4i});var BLn=pt(function(ffa,wLn){wLn.exports={create:ALn(),valueAt:bht(),tangentAt:bLn(),lengths:PSe(),length:PLn(),arcLengthToT:MLn()}});var DLn=pt(function(yfa,TLn){TLn.exports={bezier:BLn()}});var M0e=pt(function(xfa,NLn){var $4i=(e)=>{let t=0;for(let n=0;n<e.length;n++){let o=(n+1)%e.length;t+=e[n][0]*e[o][1],t-=e[o][0]*e[n][1]}return t/2};NLn.exports=$4i});var Iht=pt(function(Cfa,RLn){var q4i=M0e(),J4i=(e)=>q4i(e.vertices);RLn.exports=J4i});var vht=pt(function(bfa,QLn){var Z4i=(e)=>{if(e===void 0||e.length<3)e=[];return{vertices:e}};QLn.exports=Z4i});var Sht=pt(function(Ifa,kLn){var e3i=vht(),t3i=(e)=>{let t=e.vertices.slice().reverse();return e3i(t)};kLn.exports=t3i});var HLn=pt(function(vfa,LLn){var n3i=Iht(),o3i=Sht(),r3i=(e,t)=>{if(e.length===0)return 0;let n=t.vertices;if(n.length<3)return 0;if(n3i(t)<0)t=o3i(t);return e.reduce((r,i)=>r+i3i(i,n),0)===e.length?1:0},i3i=(e,t)=>{let n=t.length,o=e[0],r=e[1],i=t[n-1],s=t[0],a=i[1]>r,c=0,l=0;for(let h=n+1;--h;){let d=s[1]>r;if(a!==d){let u=i[0]>o,_=s[0]>o;if(u&&_)c=!c;else if(s[0]-(s[1]-r)*(i[0]-s[0])/(i[1]-s[1])>=o)c=!c}a=d,i=s,s=t[++l]}return c};LLn.exports=r3i});var ESe=pt(function(Sfa,FLn){FLn.exports={arePointsInside:HLn(),create:vht(),flip:Sht(),measureArea:Iht()}});var MSe=pt(function(Pfa,zLn){zLn.exports={geom2:qs(),geom3:Ys(),path2:Wh(),poly2:ESe(),poly3:nc()}});var wSe=pt(function(Efa,OLn){var s3i=()=>[0,1,0];OLn.exports=s3i});var YLn=pt(function(Mfa,VLn){var a3i=wSe(),c3i=(e)=>{let t=a3i();return t[0]=e[0],t[1]=e[1],t[2]=e[2],t};VLn.exports=c3i});var BSe=pt(function(wfa,GLn){var _ee=Ia(),l3i=(e)=>{let t=_ee.normal(_ee.create(),e);return _ee.negate(t,t),t};GLn.exports=l3i});var w0e=pt(function(Bfa,ULn){var TSe=Ia(),h3i=(e)=>TSe.scale(TSe.create(),e,e[2]);ULn.exports=h3i});var XLn=pt(function(Tfa,WLn){var $P=Ia(),d3i=BSe(),u3i=w0e(),p3i=(e,t)=>{let n=u3i(e),o=d3i(e),r=$P.subtract($P.create(),t,n),i=$P.dot(r,o);return $P.scale(r,o,i),$P.add(r,r,n),r};WLn.exports=p3i});var Pht=pt(function(Dfa,jLn){var m3i=(e,t)=>(e[0]=t[0],e[1]=t[1],e[2]=t[2],e);jLn.exports=m3i});var qLn=pt(function(Nfa,$Ln){var KLn=Ia(),_3i=(e,t)=>{let n=KLn.dot(t,e);return n=Math.abs(n-e[2]),n};$Ln.exports=_3i});var ZLn=pt(function(Rfa,JLn){var g3i=(e,t)=>e[0]===t[0]&&(e[1]===t[1]&&e[2]===t[2]);JLn.exports=g3i});var Eht=pt(function(Qfa,eHn){var qP=Ia(),A3i=(e,t,n)=>{let o=qP.subtract(qP.create(),n,t);qP.normal(o,o),qP.normalize(o,o);let r=qP.dot(t,o);return e[0]=o[0],e[1]=o[1],e[2]=r,e};eHn.exports=A3i});var Mht=pt(function(kfa,tHn){var f3i=wSe(),y3i=(e,t,n)=>{let o=f3i();return o[0]=e,o[1]=t,o[2]=n,o};tHn.exports=y3i});var DSe=pt(function(Lfa,nHn){var{NEPS:wht}=bc(),x3i=(e,t)=>Math.abs(e[0]-t[0])<=wht&&Math.abs(e[1]-t[1])<=wht&&Math.abs(e[2]-t[2])<=wht;nHn.exports=x3i});var Bht=pt(function(Hfa,oHn){var C3i=(e,t,n)=>{let o=n-e[1],r=t[1]-e[1];if(r<0)o=-o,r=-r;let i;if(o<=0)i=0;else if(o>=r)i=1;else if(r<0.0000000001)i=0.5;else i=o/r;return e[0]+i*(t[0]-e[0])};oHn.exports=C3i});var Tht=pt(function(Ffa,rHn){var b3i=(e,t,n,o)=>{if(e[0]===t[0]&&e[1]===t[1]||n[0]===o[0]&&n[1]===o[1])return;let r=(o[1]-n[1])*(t[0]-e[0])-(o[0]-n[0])*(t[1]-e[1]);if(Math.abs(r)<Number.MIN_VALUE)return;let i=((o[0]-n[0])*(e[1]-n[1])-(o[1]-n[1])*(e[0]-n[0]))/r,s=((t[0]-e[0])*(e[1]-n[1])-(t[1]-e[1])*(e[0]-n[0]))/r;if(i<0||i>1||s<0||s>1)return;let a=e[0]+i*(t[0]-e[0]),c=e[1]+i*(t[1]-e[1]);return[a,c]};rHn.exports=b3i});var sHn=pt(function(zfa,iHn){var I3i=(e,t,n,o,r,i)=>{let a=1/(e*o-t*n),c=r*o-t*i,l=-r*n+e*i;return c*=a,l*=a,[c,l]};iHn.exports=I3i});var gee=pt(function(Ofa,aHn){aHn.exports={aboutEqualNormals:DSe(),area:M0e(),cos:df().cos,interpolateBetween2DPointsForY:Bht(),intersect:Tht(),sin:df().sin,solve2Linear:sHn()}});var hHn=pt(function(Vfa,lHn){var cHn=Ia(),{solve2Linear:v3i}=gee(),S3i=(e,t)=>{let n=v3i(e[0],e[1],t[0],t[1],e[2],t[2]);return cHn.clone(n)};lHn.exports=S3i});var uHn=pt(function(Yfa,dHn){var NSe=Ia(),P3i=Pht(),E3i=Mht(),M3i=(e,t)=>{let n=NSe.negate(NSe.create(),t),o=-t[2];return P3i(e,E3i(n[0],n[1],o))};dHn.exports=M3i});var mHn=pt(function(Gfa,pHn){var w3i=(e)=>`line2: (${e[0].toFixed(7)}, ${e[1].toFixed(7)}, ${e[2].toFixed(7)})`;pHn.exports=w3i});var gHn=pt(function(Ufa,_Hn){var RSe=Ia(),B3i=Eht(),T3i=w0e(),D3i=BSe(),N3i=(e,t,n)=>{let o=T3i(t),r=D3i(t);return RSe.transform(o,o,n),RSe.transform(r,r,n),B3i(e,o,r)};_Hn.exports=N3i});var fHn=pt(function(Wfa,AHn){var R3i=w0e(),Q3i=(e,t)=>{let n=(e[2]-e[1]*t)/e[0];if(Number.isNaN(n))n=R3i(e)[0];return n};AHn.exports=Q3i});var QSe=pt(function(Xfa,yHn){yHn.exports={clone:YLn(),closestPoint:XLn(),copy:Pht(),create:wSe(),direction:BSe(),distanceToPoint:qLn(),equals:ZLn(),fromPoints:Eht(),fromValues:Mht(),intersectPointOfLines:hHn(),origin:w0e(),reverse:uHn(),toString:mHn(),transform:gHn(),xAtY:fHn()}});var Dht=pt(function(jfa,xHn){var kSe=di(),k3i=()=>[kSe.fromValues(0,0,0),kSe.fromValues(0,0,1)];xHn.exports=k3i});var bHn=pt(function(Kfa,CHn){var LSe=di(),L3i=Dht(),H3i=(e)=>{let t=L3i();return LSe.copy(t[0],e[0]),LSe.copy(t[1],e[1]),t};CHn.exports=H3i});var Nht=pt(function($fa,IHn){var $5=di(),F3i=(e,t)=>{let n=e[0],o=e[1],r=$5.dot($5.subtract($5.create(),t,n),o),i=$5.dot(o,o),s=r/i,a=$5.scale($5.create(),o,s);return $5.add(a,a,n),a};IHn.exports=F3i});var SHn=pt(function(qfa,vHn){var HSe=di(),z3i=(e,t)=>(HSe.copy(e[0],t[0]),HSe.copy(e[1],t[1]),e);vHn.exports=z3i});var EHn=pt(function(Jfa,PHn){var O3i=(e)=>e[1];PHn.exports=O3i});var wHn=pt(function(Zfa,MHn){var Aee=di(),V3i=Nht(),Y3i=(e,t)=>{let n=V3i(e,t),o=Aee.subtract(Aee.create(),t,n);return Aee.length(o)};MHn.exports=Y3i});var THn=pt(function(e2a,BHn){var FSe=di(),G3i=(e,t)=>{if(!FSe.equals(e[1],t[1]))return!1;if(!FSe.equals(e[0],t[0]))return!1;return!0};BHn.exports=G3i});var fee=pt(function(t2a,DHn){var wL=di(),U3i=(e,t,n)=>{let o=wL.normalize(wL.create(),n);return wL.copy(e[0],t),wL.copy(e[1],o),e};DHn.exports=U3i});var RHn=pt(function(n2a,NHn){var q5=di(),{solve2Linear:Rht}=gee(),{EPS:W3i}=bc(),X3i=fee(),j3i=(e,t,n)=>{let o=q5.cross(q5.create(),t,n),r=q5.length(o);if(r<W3i)throw Error("parallel planes do not intersect");r=1/r,o=q5.scale(o,o,r);let i=Math.abs(o[0]),s=Math.abs(o[1]),a=Math.abs(o[2]),c,l;if(i>=s&&i>=a)l=Rht(t[1],t[2],n[1],n[2],t[3],n[3]),c=q5.fromValues(0,l[0],l[1]);else if(s>=i&&s>=a)l=Rht(t[0],t[2],n[0],n[2],t[3],n[3]),c=q5.fromValues(l[0],0,l[1]);else l=Rht(t[0],t[1],n[0],n[1],t[3],n[3]),c=q5.fromValues(l[0],l[1],0);return X3i(e,c,o)};NHn.exports=j3i});var kHn=pt(function(o2a,QHn){var zSe=di(),K3i=fee(),$3i=(e,t,n)=>{let o=zSe.subtract(zSe.create(),n,t);return K3i(e,t,o)};QHn.exports=$3i});var HHn=pt(function(r2a,LHn){var D6=di(),q3i=(e,t)=>{let n=t,o=t[3],r=e[0],i=e[1],s=(o-D6.dot(n,r))/D6.dot(n,i);return D6.add(D6.create(),r,D6.scale(D6.create(),i,s))};LHn.exports=q3i});var zHn=pt(function(i2a,FHn){var J3i=(e)=>e[0];FHn.exports=J3i});var VHn=pt(function(s2a,OHn){var yee=di(),Z3i=fee(),eCi=(e,t)=>{let n=yee.clone(t[0]),o=yee.negate(yee.create(),t[1]);return Z3i(e,n,o)};OHn.exports=eCi});var GHn=pt(function(a2a,YHn){var tCi=(e)=>{let t=e[0],n=e[1];return`line3: point: (${t[0].toFixed(7)}, ${t[1].toFixed(7)}, ${t[2].toFixed(7)}) direction: (${n[0].toFixed(7)}, ${n[1].toFixed(7)}, ${n[2].toFixed(7)})`};YHn.exports=tCi});var WHn=pt(function(c2a,UHn){var N6=di(),nCi=fee(),oCi=(e,t,n)=>{let o=t[0],r=t[1],i=N6.add(N6.create(),o,r),s=N6.transform(N6.create(),o,n),a=N6.transform(i,i,n),c=N6.subtract(a,a,s);return nCi(e,s,c)};UHn.exports=oCi});var jHn=pt(function(l2a,XHn){XHn.exports={clone:bHn(),closestPoint:Nht(),copy:SHn(),create:Dht(),direction:EHn(),distanceToPoint:wHn(),equals:THn(),fromPlanes:RHn(),fromPointAndDirection:fee(),fromPoints:kHn(),intersectPointOfLineAndPlane:HHn(),origin:zHn(),reverse:VHn(),toString:GHn(),transform:WHn()}});var $Hn=pt(function(h2a,KHn){KHn.exports={constants:bc(),line2:QSe(),line3:jHn(),mat4:ld(),plane:Hv(),utils:gee(),vec2:Ia(),vec3:di(),vec4:pht()}});var Qht=pt(function(d2a,ZHn){var rCi=Cs(),VSe=qs(),YSe=Ys(),qHn=Wh(),JHn=nc(),OSe=new WeakMap,iCi=()=>0,sCi=(e)=>{let t=OSe.get(e);if(t)return t;return t=VSe.toSides(e).reduce((o,r)=>o+(r[0][0]*r[1][1]-r[0][1]*r[1][0]),0),t*=0.5,OSe.set(e,t),t},aCi=(e)=>{let t=OSe.get(e);if(t)return t;return t=YSe.toPolygons(e).reduce((o,r)=>o+JHn.measureArea(r),0),OSe.set(e,t),t},cCi=(...e)=>{if(e=rCi(e),e.length===0)throw Error("wrong number of arguments");let t=e.map((n)=>{if(qHn.isA(n))return iCi(n);if(VSe.isA(n))return sCi(n);if(YSe.isA(n))return aCi(n);return 0});return t.length===1?t[0]:t};ZHn.exports=cCi});var tFn=pt(function(u2a,eFn){var lCi=Cs(),hCi=Qht(),dCi=(...e)=>{if(e=lCi(e),e.length===0)throw Error("measureAggregateArea: no geometries supplied");let t=hCi(e);if(e.length===1)return t;let n=0;return t.reduce((o,r)=>o+r,n)};eFn.exports=dCi});var BL=pt(function(p2a,nFn){var uCi=Cs(),W_=Ia(),JP=di(),USe=qs(),WSe=Ys(),XSe=Wh(),GSe=nc(),xee=new WeakMap,pCi=(e)=>{let t=xee.get(e);if(t)return t;let n=XSe.toPoints(e),o;if(n.length===0)o=W_.create();else o=W_.clone(n[0]);let r=W_.clone(o);return n.forEach((i)=>{W_.min(o,o,i),W_.max(r,r,i)}),o=[o[0],o[1],0],r=[r[0],r[1],0],t=[o,r],xee.set(e,t),t},mCi=(e)=>{let t=xee.get(e);if(t)return t;let n=USe.toPoints(e),o;if(n.length===0)o=W_.create();else o=W_.clone(n[0]);let r=W_.clone(o);return n.forEach((i)=>{W_.min(o,o,i),W_.max(r,r,i)}),o=[o[0],o[1],0],r=[r[0],r[1],0],t=[o,r],xee.set(e,t),t},_Ci=(e)=>{let t=xee.get(e);if(t)return t;let n=WSe.toPolygons(e),o=JP.create();if(n.length>0){let i=GSe.toPoints(n[0]);JP.copy(o,i[0])}let r=JP.clone(o);return n.forEach((i)=>{GSe.toPoints(i).forEach((s)=>{JP.min(o,o,s),JP.max(r,r,s)})}),o=[o[0],o[1],o[2]],r=[r[0],r[1],r[2]],t=[o,r],xee.set(e,t),t},gCi=(...e)=>{if(e=uCi(e),e.length===0)throw Error("wrong number of arguments");let t=e.map((n)=>{if(XSe.isA(n))return pCi(n);if(USe.isA(n))return mCi(n);if(WSe.isA(n))return _Ci(n);return[[0,0,0],[0,0,0]]});return t.length===1?t[0]:t};nFn.exports=gCi});var jSe=pt(function(m2a,oFn){var ACi=Cs(),fCi=Hlt(),yCi=Llt(),xCi=BL(),CCi=(...e)=>{if(e=ACi(e),e.length===0)throw Error("measureAggregateBoundingBox: no geometries supplied");let t=xCi(e);if(e.length===1)return t;let n=[[Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE],[-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE]];return t.reduce((o,r)=>(o=[fCi(o[0],o[0],r[0]),yCi(o[1],o[1],r[1])],o),n)};oFn.exports=CCi});var kht=pt(function(_2a,rFn){var{EPS:bCi}=bc(),ICi=(e,t)=>{let n=0;for(let o=0;o<t;o++)n+=e[1][o]-e[0][o];return bCi*n/t};rFn.exports=ICi});var sFn=pt(function(g2a,iFn){var vCi=Cs(),SCi=jSe(),PCi=kht(),{geom2:ECi,geom3:MCi,path2:wCi}=MSe(),BCi=(...e)=>{if(e=vCi(e),e.length===0)throw Error("measureAggregateEpsilon: no geometries supplied");let t=SCi(e),n=0;return n=e.reduce((o,r)=>{if(wCi.isA(r)||ECi.isA(r))return Math.max(o,2);if(MCi.isA(r))return Math.max(o,3);return 0},n),PCi(t,n)};iFn.exports=BCi});var Lht=pt(function(A2a,dFn){var TCi=Cs(),cFn=qs(),KSe=Ys(),lFn=Wh(),hFn=nc(),aFn=new WeakMap,DCi=()=>0,NCi=()=>0,RCi=(e)=>{let t=aFn.get(e);if(t)return t;return t=KSe.toPolygons(e).reduce((o,r)=>o+hFn.measureSignedVolume(r),0),aFn.set(e,t),t},QCi=(...e)=>{if(e=TCi(e),e.length===0)throw Error("wrong number of arguments");let t=e.map((n)=>{if(lFn.isA(n))return DCi(n);if(cFn.isA(n))return NCi(n);if(KSe.isA(n))return RCi(n);return 0});return t.length===1?t[0]:t};dFn.exports=QCi});var pFn=pt(function(f2a,uFn){var kCi=Cs(),LCi=Lht(),HCi=(...e)=>{if(e=kCi(e),e.length===0)throw Error("measureAggregateVolume: no geometries supplied");let t=LCi(e);if(e.length===1)return t;let n=0;return t.reduce((o,r)=>o+r,n)};uFn.exports=HCi});var _Fn=pt(function(y2a,mFn){var FCi=Cs(),qSe=Ia(),Td=di(),JSe=qs(),ZSe=Ys(),ePe=Wh(),$Se=nc(),Cee=new WeakMap,zCi=(e)=>{let t=Cee.get(e);if(t!==void 0)return t;let n=Td.create(),o=0,r=ePe.toPoints(e);if(r.length>0){let i=0,s=Td.create();r.forEach((a)=>{Td.add(n,n,Td.fromVec2(s,a,0)),i++}),Td.scale(n,n,1/i),r.forEach((a)=>{o=Math.max(o,qSe.squaredDistance(n,a))}),o=Math.sqrt(o)}return t=[n,o],Cee.set(e,t),t},OCi=(e)=>{let t=Cee.get(e);if(t!==void 0)return t;let n=Td.create(),o=0,r=JSe.toSides(e);if(r.length>0){let i=0,s=Td.create();r.forEach((a)=>{Td.add(n,n,Td.fromVec2(s,a[0],0)),i++}),Td.scale(n,n,1/i),r.forEach((a)=>{o=Math.max(o,qSe.squaredDistance(n,a[0]))}),o=Math.sqrt(o)}return t=[n,o],Cee.set(e,t),t},VCi=(e)=>{let t=Cee.get(e);if(t!==void 0)return t;let n=Td.create(),o=0,r=ZSe.toPolygons(e);if(r.length>0){let i=0;r.forEach((s)=>{$Se.toPoints(s).forEach((a)=>{Td.add(n,n,a),i++})}),Td.scale(n,n,1/i),r.forEach((s)=>{$Se.toPoints(s).forEach((a)=>{o=Math.max(o,Td.squaredDistance(n,a))})}),o=Math.sqrt(o)}return t=[n,o],Cee.set(e,t),t},YCi=(...e)=>{e=FCi(e);let t=e.map((n)=>{if(ePe.isA(n))return zCi(n);if(JSe.isA(n))return OCi(n);if(ZSe.isA(n))return VCi(n);return[[0,0,0],0]});return t.length===1?t[0]:t};mFn.exports=YCi});var AFn=pt(function(x2a,gFn){var GCi=Cs(),UCi=BL(),WCi=(...e)=>{e=GCi(e);let t=e.map((n)=>{let o=UCi(n);return[o[0][0]+(o[1][0]-o[0][0])/2,o[0][1]+(o[1][1]-o[0][1])/2,o[0][2]+(o[1][2]-o[0][2])/2]});return t.length===1?t[0]:t};gFn.exports=WCi});var yFn=pt(function(C2a,fFn){var XCi=Cs(),X_=di(),nPe=qs(),oPe=Ys(),tPe=new WeakMap,jCi=(e)=>{let t=tPe.get(e);if(t!==void 0)return t;let n=nPe.toSides(e),o=0,r=0,i=0;if(n.length>0){for(let a=0;a<n.length;a++){let c=n[a][0],l=n[a][1],h=c[0]*l[1]-c[1]*l[0];o+=h,r+=(c[0]+l[0])*h,i+=(c[1]+l[1])*h}o/=2;let s=1/(o*6);r*=s,i*=s}return t=X_.fromValues(r,i,0),tPe.set(e,t),t},KCi=(e)=>{let t=tPe.get(e);if(t!==void 0)return t;t=X_.create();let n=oPe.toPolygons(e);if(n.length===0)return t;let o=0,r=X_.create();return n.forEach((i)=>{let s=i.vertices;for(let a=0;a<s.length-2;a++){X_.cross(r,s[a+1],s[a+2]);let c=X_.dot(s[0],r)/6;o+=c,X_.add(r,s[0],s[a+1]),X_.add(r,r,s[a+2]);let l=X_.scale(r,r,0.25*c);X_.add(t,t,l)}}),X_.scale(t,t,1/o),tPe.set(e,t),t},$Ci=(...e)=>{e=XCi(e);let t=e.map((n)=>{if(nPe.isA(n))return jCi(n);if(oPe.isA(n))return KCi(n);return[0,0,0]});return t.length===1?t[0]:t};fFn.exports=$Ci});var CFn=pt(function(b2a,xFn){var qCi=Cs(),JCi=BL(),ZCi=(...e)=>{e=qCi(e);let t=e.map((n)=>{let o=JCi(n);return[o[1][0]-o[0][0],o[1][1]-o[0][1],o[1][2]-o[0][2]]});return t.length===1?t[0]:t};xFn.exports=ZCi});var fT=pt(function(I2a,bFn){var ebi=Cs(),{geom2:tbi,geom3:nbi,path2:obi}=MSe(),Hht=kht(),Fht=BL(),rbi=(e)=>Hht(Fht(e),2),ibi=(e)=>Hht(Fht(e),2),sbi=(e)=>Hht(Fht(e),3),abi=(...e)=>{if(e=ebi(e),e.length===0)throw Error("wrong number of arguments");let t=e.map((n)=>{if(obi.isA(n))return rbi(n);if(tbi.isA(n))return ibi(n);if(nbi.isA(n))return sbi(n);return 0});return t.length===1?t[0]:t};bFn.exports=abi});var vFn=pt(function(v2a,IFn){IFn.exports={measureAggregateArea:tFn(),measureAggregateBoundingBox:jSe(),measureAggregateEpsilon:sFn(),measureAggregateVolume:pFn(),measureArea:Qht(),measureBoundingBox:BL(),measureBoundingSphere:_Fn(),measureCenter:AFn(),measureCenterOfMass:yFn(),measureDimensions:CFn(),measureEpsilon:fT(),measureVolume:Lht()}});var j_=pt(function(S2a,SFn){var cbi=(e,t)=>{if(Array.isArray(e)&&e.length>=t)return e.every((n)=>Number.isFinite(n));return!1},lbi=(e,t)=>Number.isFinite(e)&&e>t,hbi=(e,t)=>Number.isFinite(e)&&e>=t;SFn.exports={isNumberArray:cbi,isGT:lbi,isGTE:hbi}});var wFn=pt(function(P2a,MFn){var{EPS:PFn,TAU:bee}=bc(),uf=Ia(),EFn=Wh(),{isGT:dbi,isGTE:zht,isNumberArray:ubi}=j_(),pbi=(e)=>{let t={center:[0,0],radius:1,startAngle:0,endAngle:bee,makeTangent:!1,segments:32},{center:n,radius:o,startAngle:r,endAngle:i,makeTangent:s,segments:a}=Object.assign({},t,e);if(!ubi(n,2))throw Error("center must be an array of X and Y values");if(!dbi(o,0))throw Error("radius must be greater than zero");if(!zht(r,0))throw Error("startAngle must be positive");if(!zht(i,0))throw Error("endAngle must be positive");if(!zht(a,4))throw Error("segments must be four or more");r=r%bee,i=i%bee;let c=bee;if(r<i)c=i-r;if(r>i)c=i+(bee-r);let l=Math.acos((o*o+o*o-PFn*PFn)/(2*o*o)),h=uf.clone(n),d,u=[];if(c<l)d=uf.fromAngleRadians(uf.create(),r),uf.scale(d,d,o),uf.add(d,d,h),u.push(d);else{let _=Math.floor(a*(Math.abs(c)/bee)),p=_*0.5/c;if(p>0.25)p=0.25;let m=s?_+2:_;for(let A=0;A<=m;A++){let g=A;if(s){if(g=(A-1)*(_-2*p)/_+p,g<0)g=0;if(g>_)g=_}let f=r+g*(c/_);d=uf.fromAngleRadians(uf.create(),f),uf.scale(d,d,o),uf.add(d,d,h),u.push(d)}}return EFn.fromPoints({closed:!1},u)};MFn.exports=pbi});var Vht=pt(function(E2a,DFn){var{EPS:BFn,TAU:TL}=bc(),Iee=Ia(),rPe=qs(),{sin:mbi,cos:_bi}=df(),{isGTE:Oht,isNumberArray:TFn}=j_(),gbi=(e)=>{let t={center:[0,0],radius:[1,1],startAngle:0,endAngle:TL,segments:32},{center:n,radius:o,startAngle:r,endAngle:i,segments:s}=Object.assign({},t,e);if(!TFn(n,2))throw Error("center must be an array of X and Y values");if(!TFn(o,2))throw Error("radius must be an array of X and Y values");if(!o.every((_)=>_>=0))throw Error("radius values must be positive");if(!Oht(r,0))throw Error("startAngle must be positive");if(!Oht(i,0))throw Error("endAngle must be positive");if(!Oht(s,3))throw Error("segments must be three or more");if(o[0]===0||o[1]===0)return rPe.create();r=r%TL,i=i%TL;let a=TL;if(r<i)a=i-r;if(r>i)a=i+(TL-r);let c=Math.min(o[0],o[1]),l=Math.acos((c*c+c*c-BFn*BFn)/(2*c*c));if(a<l)throw Error("startAngle and endAngle do not define a significant rotation");s=Math.floor(s*(a/TL));let h=Iee.clone(n),d=a/s,u=[];s=a<TL?s+1:s;for(let _=0;_<s;_++){let p=d*_+r,m=Iee.fromValues(o[0]*_bi(p),o[1]*mbi(p));Iee.add(m,h,m),u.push(m)}if(a<TL)u.push(h);return rPe.fromPoints(u)};DFn.exports=gbi});var Yht=pt(function(M2a,NFn){var{TAU:Abi}=bc(),fbi=Vht(),{isGTE:ybi}=j_(),xbi=(e)=>{let t={center:[0,0],radius:1,startAngle:0,endAngle:Abi,segments:32},{center:n,radius:o,startAngle:r,endAngle:i,segments:s}=Object.assign({},t,e);if(!ybi(o,0))throw Error("radius must be positive");return o=[o,o],fbi({center:n,radius:o,startAngle:r,endAngle:i,segments:s})};NFn.exports=xbi});var sPe=pt(function(w2a,kFn){var iPe=Ys(),QFn=nc(),{isNumberArray:RFn}=j_(),Cbi=(e)=>{let t={center:[0,0,0],size:[2,2,2]},{center:n,size:o}=Object.assign({},t,e);if(!RFn(n,3))throw Error("center must be an array of X, Y and Z values");if(!RFn(o,3))throw Error("size must be an array of width, depth and height values");if(!o.every((i)=>i>=0))throw Error("size values must be positive");if(o[0]===0||o[1]===0||o[2]===0)return iPe.create();return iPe.create([[[0,4,6,2],[-1,0,0]],[[1,3,7,5],[1,0,0]],[[0,1,5,4],[0,-1,0]],[[2,6,7,3],[0,1,0]],[[0,2,3,1],[0,0,-1]],[[4,5,7,6],[0,0,1]]].map((i)=>{let s=i[0].map((a)=>[n[0]+o[0]/2*(2*!!(a&1)-1),n[1]+o[1]/2*(2*!!(a&2)-1),n[2]+o[2]/2*(2*!!(a&4)-1)]);return QFn.create(s)}))};kFn.exports=Cbi});var HFn=pt(function(B2a,LFn){var bbi=sPe(),{isGTE:Ibi}=j_(),vbi=(e)=>{let t={center:[0,0,0],size:2},{center:n,size:o}=Object.assign({},t,e);if(!Ibi(o,0))throw Error("size must be positive");return o=[o,o,o],bbi({center:n,size:o})};LFn.exports=vbi});var Wht=pt(function(T2a,VFn){var{EPS:FFn,TAU:DL}=bc(),ol=di(),zFn=Ys(),OFn=nc(),{sin:Sbi,cos:Pbi}=df(),{isGT:Ebi,isGTE:Ght,isNumberArray:Uht}=j_(),Mbi=(e)=>{let t={center:[0,0,0],height:2,startRadius:[1,1],startAngle:0,endRadius:[1,1],endAngle:DL,segments:32},{center:n,height:o,startRadius:r,startAngle:i,endRadius:s,endAngle:a,segments:c}=Object.assign({},t,e);if(!Uht(n,3))throw Error("center must be an array of X, Y and Z values");if(!Ebi(o,0))throw Error("height must be greater then zero");if(!Uht(r,2))throw Error("startRadius must be an array of X and Y values");if(!r.every((P)=>P>=0))throw Error("startRadius values must be positive");if(!Uht(s,2))throw Error("endRadius must be an array of X and Y values");if(!s.every((P)=>P>=0))throw Error("endRadius values must be positive");if(s.every((P)=>P===0)&&r.every((P)=>P===0))throw Error("at least one radius must be positive");if(!Ght(i,0))throw Error("startAngle must be positive");if(!Ght(a,0))throw Error("endAngle must be positive");if(!Ght(c,4))throw Error("segments must be four or more");i=i%DL,a=a%DL;let l=DL;if(i<a)l=a-i;if(i>a)l=a+(DL-i);let h=Math.min(r[0],r[1],s[0],s[1]),d=Math.acos((h*h+h*h-FFn*FFn)/(2*h*h));if(l<d)throw Error("startAngle and endAngle do not define a significant rotation");let u=Math.floor(c*(l/DL)),_=ol.fromValues(0,0,-(o/2)),p=ol.fromValues(0,0,o/2),m=ol.subtract(ol.create(),p,_),A=ol.fromValues(1,0,0),g=ol.fromValues(0,1,0),f=ol.create(),y=ol.create(),x=ol.create(),C=(P,M,B)=>{let T=M*l+i;return ol.scale(f,A,B[0]*Pbi(T)),ol.scale(y,g,B[1]*Sbi(T)),ol.add(f,f,y),ol.scale(x,m,P),ol.add(x,x,_),ol.add(ol.create(),f,x)},b=(...P)=>{let M=P.map((B)=>ol.add(ol.create(),B,n));return OFn.create(M)},I=[];for(let P=0;P<u;P++){let M=P/u,B=(P+1)/u;if(l===DL&&P===u-1)B=0;if(s[0]===r[0]&&s[1]===r[1])I.push(b(_,C(0,B,s),C(0,M,s))),I.push(b(C(0,B,s),C(1,B,s),C(1,M,s),C(0,M,s))),I.push(b(p,C(1,M,s),C(1,B,s)));else{if(r[0]>0&&r[1]>0)I.push(b(_,C(0,B,r),C(0,M,r)));if(r[0]>0||r[1]>0)I.push(b(C(0,M,r),C(0,B,r),C(1,M,s)));if(s[0]>0&&s[1]>0)I.push(b(p,C(1,M,s),C(1,B,s)));if(s[0]>0||s[1]>0)I.push(b(C(1,M,s),C(0,B,r),C(1,B,s)))}}if(l<DL)I.push(b(_,C(0,0,r),p)),I.push(b(C(0,0,r),C(1,0,s),p)),I.push(b(_,p,C(0,1,r))),I.push(b(C(0,1,r),p,C(1,1,s)));return zFn.create(I)};VFn.exports=Mbi});var Xht=pt(function(D2a,GFn){var YFn=Ys(),wbi=Wht(),{isGTE:Bbi}=j_(),Tbi=(e)=>{let t={center:[0,0,0],height:2,radius:1,segments:32},{center:n,height:o,radius:r,segments:i}=Object.assign({},t,e);if(!Bbi(r,0))throw Error("radius must be positive");if(o===0||r===0)return YFn.create();return wbi({center:n,height:o,startRadius:[r,r],endRadius:[r,r],segments:i})};GFn.exports=Tbi});var jht=pt(function(N2a,KFn){var{TAU:UFn}=bc(),bo=di(),aPe=Ys(),cPe=nc(),{sin:WFn,cos:XFn}=df(),{isGTE:Dbi,isNumberArray:jFn}=j_(),Nbi=(e)=>{let t={center:[0,0,0],radius:[1,1,1],segments:32,axes:[[1,0,0],[0,-1,0],[0,0,1]]},{center:n,radius:o,segments:r,axes:i}=Object.assign({},t,e);if(!jFn(n,3))throw Error("center must be an array of X, Y and Z values");if(!jFn(o,3))throw Error("radius must be an array of X, Y and Z values");if(!o.every((p)=>p>=0))throw Error("radius values must be positive");if(!Dbi(r,4))throw Error("segments must be four or more");if(o[0]===0||o[1]===0||o[2]===0)return aPe.create();let s=bo.scale(bo.create(),bo.normalize(bo.create(),i[0]),o[0]),a=bo.scale(bo.create(),bo.normalize(bo.create(),i[1]),o[1]),c=bo.scale(bo.create(),bo.normalize(bo.create(),i[2]),o[2]),l=Math.round(r/4),h,d=[],u=bo.create(),_=bo.create();for(let p=0;p<=r;p++){let m=UFn*p/r,A=bo.add(bo.create(),bo.scale(u,s,XFn(m)),bo.scale(_,a,WFn(m)));if(p>0){let g,f;for(let y=0;y<=l;y++){let x=UFn/4*y/l,C=XFn(x),b=WFn(x);if(y>0){let I=[],v;if(v=bo.subtract(bo.create(),bo.scale(u,h,g),bo.scale(_,c,f)),I.push(bo.add(v,v,n)),v=bo.subtract(bo.create(),bo.scale(u,A,g),bo.scale(_,c,f)),I.push(bo.add(v,v,n)),y<l)v=bo.subtract(bo.create(),bo.scale(u,A,C),bo.scale(_,c,b)),I.push(bo.add(v,v,n));if(v=bo.subtract(bo.create(),bo.scale(u,h,C),bo.scale(_,c,b)),I.push(bo.add(v,v,n)),d.push(cPe.create(I)),I=[],v=bo.add(bo.create(),bo.scale(u,h,g),bo.scale(_,c,f)),I.push(bo.add(bo.create(),n,v)),v=bo.add(v,bo.scale(u,A,g),bo.scale(_,c,f)),I.push(bo.add(bo.create(),n,v)),y<l)v=bo.add(v,bo.scale(u,A,C),bo.scale(_,c,b)),I.push(bo.add(bo.create(),n,v));v=bo.add(v,bo.scale(u,h,C),bo.scale(_,c,b)),I.push(bo.add(bo.create(),n,v)),I.reverse(),d.push(cPe.create(I))}g=C,f=b}}h=A}return aPe.create(d)};KFn.exports=Nbi});var Kht=pt(function(R2a,ZFn){var qFn=Ys(),JFn=nc(),{isNumberArray:$Fn}=j_(),Rbi=(e)=>{let t={points:[],faces:[],colors:void 0,orientation:"outward"},{points:n,faces:o,colors:r,orientation:i}=Object.assign({},t,e);if(!(Array.isArray(n)&&Array.isArray(o)))throw Error("points and faces must be arrays");if(n.length<3)throw Error("three or more points are required");if(o.length<1)throw Error("one or more faces are required");if(r){if(!Array.isArray(r))throw Error("colors must be an array");if(r.length!==o.length)throw Error("faces and colors must have the same length")}if(n.forEach((a,c)=>{if(!$Fn(a,3))throw Error(`point ${c} must be an array of X, Y, Z values`)}),o.forEach((a,c)=>{if(a.length<3)throw Error(`face ${c} must contain 3 or more indexes`);if(!$Fn(a,a.length))throw Error(`face ${c} must be an array of numbers`)}),i!=="outward")o.forEach((a)=>a.reverse());let s=o.map((a,c)=>{let l=JFn.create(a.map((h)=>n[h]));if(r&&r[c])l.color=r[c];return l});return qFn.create(s)};ZFn.exports=Rbi});var nzn=pt(function(Q2a,tzn){var lPe=ld(),hPe=di(),dPe=Ys(),Qbi=Kht(),{isGTE:ezn}=j_(),kbi=(e)=>{let t={radius:1,frequency:6},{radius:n,frequency:o}=Object.assign({},t,e);if(!ezn(n,0))throw Error("radius must be positive");if(!ezn(o,6))throw Error("frequency must be six or more");if(n===0)return dPe.create();o=Math.floor(o/6);let r=[[0.850651,0,-0.525731],[0.850651,-0,0.525731],[-0.850651,-0,0.525731],[-0.850651,0,-0.525731],[0,-0.525731,0.850651],[0,0.525731,0.850651],[0,0.525731,-0.850651],[0,-0.525731,-0.850651],[-0.525731,-0.850651,-0],[0.525731,-0.850651,-0],[0.525731,0.850651,0],[-0.525731,0.850651,0]],i=[[0,9,1],[1,10,0],[6,7,0],[10,6,0],[7,9,0],[5,1,4],[4,1,9],[5,10,1],[2,8,3],[3,11,2],[2,5,4],[4,8,2],[2,11,5],[3,7,6],[6,11,3],[8,7,3],[9,8,4],[11,10,5],[10,11,6],[8,9,7]],s=(u,_,p)=>{let m=u[0],A=u[1],g=u[2],f=p,y=[],x=[];for(let C=0;C<_;C++)for(let b=0;b<_-C;b++){let I=C/_,v=(C+1)/_,P=b/(_-C),M=(b+1)/(_-C),B=_-C-1?b/(_-C-1):1,T=[];T[0]=a(a(m,A,P),g,I),T[1]=a(a(m,A,M),g,I),T[2]=a(a(m,A,B),g,v);for(let N=0;N<3;N++){let D=hPe.length(T[N]);for(let L=0;L<3;L++)T[N][L]/=D}if(y.push(T[0],T[1],T[2]),x.push([f,f+1,f+2]),f+=3,b<_-C-1){let N=_-C-1?(b+1)/(_-C-1):1;T[0]=a(a(m,A,M),g,I),T[1]=a(a(m,A,N),g,v),T[2]=a(a(m,A,B),g,v);for(let D=0;D<3;D++){let L=hPe.length(T[D]);for(let H=0;H<3;H++)T[D][H]/=L}y.push(T[0],T[1],T[2]),x.push([f,f+1,f+2]),f+=3}}return{points:y,triangles:x,offset:f}},a=(u,_,p)=>{let m=1-p,A=[];for(let g=0;g<3;g++)A[g]=u[g]*m+_[g]*p;return A},c=[],l=[],h=0;for(let u=0;u<i.length;u++){let _=s([r[i[u][0]],r[i[u][1]],r[i[u][2]]],o,h);c=c.concat(_.points),l=l.concat(_.triangles),h=_.offset}let d=Qbi({points:c,faces:l,orientation:"inward"});if(n!==1)d=dPe.transform(lPe.fromScaling(lPe.create(),[n,n,n]),d);return d};tzn.exports=kbi});var izn=pt(function(k2a,rzn){var ozn=Wh(),Lbi=(e)=>{if(!Array.isArray(e))throw Error("points must be an array");return ozn.fromPoints({},e)};rzn.exports=Lbi});var azn=pt(function(L2a,szn){var NL=qs(),Hbi=(e)=>{let t={points:[],paths:[],orientation:"counterclockwise"},{points:n,paths:o,orientation:r}=Object.assign({},t,e);if(!(Array.isArray(n)&&Array.isArray(o)))throw Error("points and paths must be arrays");let i=n;if(Array.isArray(n[0])){if(!Array.isArray(n[0][0]))i=[n]}i.forEach((h,d)=>{if(!Array.isArray(h))throw Error("list of points "+d+" must be an array");if(h.length<3)throw Error("list of points "+d+" must contain three or more points");h.forEach((u,_)=>{if(!Array.isArray(u))throw Error("list of points "+d+", point "+_+" must be an array");if(u.length<2)throw Error("list of points "+d+", point "+_+" must contain by X and Y values")})});let s=o;if(o.length===0){let h=0;s=i.map((d)=>d.map((u)=>h++))}let a=[];i.forEach((h)=>h.forEach((d)=>a.push(d)));let c=[];s.forEach((h)=>{let d=h.map((_)=>a[_]),u=NL.fromPoints(d);c=c.concat(NL.toSides(u))});let l=NL.create(c);if(r==="clockwise")l=NL.reverse(l);return l};szn.exports=Hbi});var pPe=pt(function(H2a,lzn){var Q1=Ia(),uPe=qs(),{isNumberArray:czn}=j_(),Fbi=(e)=>{let t={center:[0,0],size:[2,2]},{center:n,size:o}=Object.assign({},t,e);if(!czn(n,2))throw Error("center must be an array of X and Y values");if(!czn(o,2))throw Error("size must be an array of X and Y values");if(!o.every((a)=>a>=0))throw Error("size values must be positive");if(o[0]===0||o[1]===0)return uPe.create();let r=[o[0]/2,o[1]/2],i=[r[0],-r[1]],s=[Q1.subtract(Q1.create(),n,r),Q1.add(Q1.create(),n,i),Q1.add(Q1.create(),n,r),Q1.subtract(Q1.create(),n,i)];return uPe.fromPoints(s)};lzn.exports=Fbi});var gzn=pt(function(F2a,_zn){var{EPS:mPe,TAU:B0e}=bc(),vee=Ia(),ja=di(),_Pe=Ys(),R6=nc(),{sin:zbi,cos:Obi}=df(),{isGTE:hzn,isNumberArray:dzn}=j_(),Vbi=sPe(),uzn=(e,t,n,o,r,i)=>{let s=B0e/4*r/o,a=Obi(s),c=zbi(s),l=o-r,h=n*a,d=t[2]-(n-n*c);if(!i)d=n-n*c-t[2];h=h>mPe?h:0;let u=ja.add(ja.create(),e,[t[0]-n,t[1]-n,d]),_=ja.add(ja.create(),e,[n-t[0],t[1]-n,d]),p=ja.add(ja.create(),e,[n-t[0],n-t[1],d]),m=ja.add(ja.create(),e,[t[0]-n,n-t[1],d]),A=[],g=[],f=[],y=[];for(let x=0;x<=l;x++){let C=l>0?B0e/4*x/l:0,b=vee.fromAngleRadians(vee.create(),C);vee.scale(b,b,h);let I=ja.fromVec2(ja.create(),b);A.push(ja.add(ja.create(),u,I)),ja.rotateZ(I,I,[0,0,0],B0e/4),g.push(ja.add(ja.create(),_,I)),ja.rotateZ(I,I,[0,0,0],B0e/4),f.push(ja.add(ja.create(),p,I)),ja.rotateZ(I,I,[0,0,0],B0e/4),y.push(ja.add(ja.create(),m,I))}if(!i)return A.reverse(),g.reverse(),f.reverse(),y.reverse(),[y,f,g,A];return[A,g,f,y]},pzn=(e,t)=>{let n=[];for(let o=0;o<e.length;o++){let r=e[o],i=t[o];for(let s=0;s<r.length-1;s++)if(n.push(R6.create([r[s],r[s+1],i[s]])),s<i.length-1)n.push(R6.create([i[s],r[s+1],i[s+1]]))}return n},mzn=(e,t)=>{let n=[];for(let o=0;o<e.length;o++){let r=e[o],i=t[o],s=r[r.length-1],a=i[i.length-1],c=(o+1)%e.length;r=e[c],i=t[c];let l=r[0],h=i[0];n.push(R6.create([s,l,h,a]))}return n},Ybi=(e,t)=>{e=[e[3],e[2],e[1],e[0]],e=e.map((i)=>i.slice().reverse());let n=[];e.forEach((i)=>{i.forEach((s)=>n.push(s))});let o=[];t.forEach((i)=>{i.forEach((s)=>o.push(s))});let r=[];for(let i=0;i<o.length;i++){let s=(i+1)%o.length;r.push(R6.create([n[i],n[s],o[s],o[i]]))}return r},Gbi=(e)=>{let t={center:[0,0,0],size:[2,2,2],roundRadius:0.2,segments:32},{center:n,size:o,roundRadius:r,segments:i}=Object.assign({},t,e);if(!dzn(n,3))throw Error("center must be an array of X, Y and Z values");if(!dzn(o,3))throw Error("size must be an array of X, Y and Z values");if(!o.every((l)=>l>=0))throw Error("size values must be positive");if(!hzn(r,0))throw Error("roundRadius must be positive");if(!hzn(i,4))throw Error("segments must be four or more");if(o[0]===0||o[1]===0||o[2]===0)return _Pe.create();if(r===0)return Vbi({center:n,size:o});if(o=o.map((l)=>l/2),r>o[0]-mPe||r>o[1]-mPe||r>o[2]-mPe)throw Error("roundRadius must be smaller than the radius of all dimensions");i=Math.floor(i/4);let s=null,a=null,c=[];for(let l=0;l<=i;l++){let h=uzn(n,o,r,i,l,!0),d=uzn(n,o,r,i,l,!1);if(l===0)c=c.concat(Ybi(d,h));if(s)c=c.concat(pzn(s,h),mzn(s,h));if(a)c=c.concat(pzn(a,d),mzn(a,d));if(l===i){let u=h.map((_)=>_[0]);c.push(R6.create(u)),u=d.map((_)=>_[0]),c.push(R6.create(u))}s=h,a=d}return _Pe.create(c)};_zn.exports=Gbi});var bzn=pt(function(z2a,Czn){var{EPS:Ubi,TAU:Azn}=bc(),Qn=di(),APe=Ys(),xzn=nc(),{sin:fzn,cos:yzn}=df(),{isGTE:gPe,isNumberArray:Wbi}=j_(),Xbi=Xht(),jbi=(e)=>{let t={center:[0,0,0],height:2,radius:1,roundRadius:0.2,segments:32},{center:n,height:o,radius:r,roundRadius:i,segments:s}=Object.assign({},t,e);if(!Wbi(n,3))throw Error("center must be an array of X, Y and Z values");if(!gPe(o,0))throw Error("height must be positive");if(!gPe(r,0))throw Error("radius must be positive");if(!gPe(i,0))throw Error("roundRadius must be positive");if(i>r)throw Error("roundRadius must be smaller than the radius");if(!gPe(s,4))throw Error("segments must be four or more");if(o===0||r===0)return APe.create();if(i===0)return Xbi({center:n,height:o,radius:r});let a=[0,0,-(o/2)],c=[0,0,o/2],l=Qn.subtract(Qn.create(),c,a),h=Qn.length(l);if(2*i>h-Ubi)throw Error("height must be larger than twice roundRadius");let d;if(Math.abs(l[0])>Math.abs(l[1]))d=Qn.fromValues(0,1,0);else d=Qn.fromValues(1,0,0);let u=Qn.scale(Qn.create(),Qn.normalize(Qn.create(),l),i),_=Qn.scale(Qn.create(),Qn.normalize(Qn.create(),Qn.cross(Qn.create(),u,d)),r),p=Qn.scale(Qn.create(),Qn.normalize(Qn.create(),Qn.cross(Qn.create(),_,u)),r);Qn.add(a,a,u),Qn.subtract(c,c,u);let m=Math.floor(0.25*s),A=(b)=>{let I=b.map((v)=>Qn.add(v,v,n));return xzn.create(I)},g=[],f=Qn.create(),y=Qn.create(),x;for(let b=0;b<=s;b++){let I=Azn*b/s,v=Qn.add(Qn.create(),Qn.scale(f,_,yzn(I)),Qn.scale(y,p,fzn(I)));if(b>0){let P=[];P.push(Qn.add(Qn.create(),a,v)),P.push(Qn.add(Qn.create(),a,x)),P.push(Qn.add(Qn.create(),c,x)),P.push(Qn.add(Qn.create(),c,v)),g.push(A(P));let M,B;for(let T=0;T<=m;T++){let N=Azn/4*T/m,D=yzn(N),L=fzn(N);if(T>0){P=[];let H;if(H=Qn.add(Qn.create(),a,Qn.subtract(f,Qn.scale(f,x,M),Qn.scale(y,u,B))),P.push(H),H=Qn.add(Qn.create(),a,Qn.subtract(f,Qn.scale(f,v,M),Qn.scale(y,u,B))),P.push(H),T<m)H=Qn.add(Qn.create(),a,Qn.subtract(f,Qn.scale(f,v,D),Qn.scale(y,u,L))),P.push(H);if(H=Qn.add(Qn.create(),a,Qn.subtract(f,Qn.scale(f,x,D),Qn.scale(y,u,L))),P.push(H),g.push(A(P)),P=[],H=Qn.add(Qn.create(),Qn.scale(f,x,M),Qn.scale(y,u,B)),Qn.add(H,H,c),P.push(H),H=Qn.add(Qn.create(),Qn.scale(f,v,M),Qn.scale(y,u,B)),Qn.add(H,H,c),P.push(H),T<m)H=Qn.add(Qn.create(),Qn.scale(f,v,D),Qn.scale(y,u,L)),Qn.add(H,H,c),P.push(H);H=Qn.add(Qn.create(),Qn.scale(f,x,D),Qn.scale(y,u,L)),Qn.add(H,H,c),P.push(H),P.reverse(),g.push(A(P))}M=D,B=L}}x=v}return APe.create(g)};Czn.exports=jbi});var Ezn=pt(function(O2a,Pzn){var{EPS:Izn,TAU:fPe}=bc(),bs=Ia(),yPe=qs(),{isGTE:vzn,isNumberArray:Szn}=j_(),Kbi=pPe(),$bi=(e)=>{let t={center:[0,0],size:[2,2],roundRadius:0.2,segments:32},{center:n,size:o,roundRadius:r,segments:i}=Object.assign({},t,e);if(!Szn(n,2))throw Error("center must be an array of X and Y values");if(!Szn(o,2))throw Error("size must be an array of X and Y values");if(!o.every((m)=>m>=0))throw Error("size values must be positive");if(!vzn(r,0))throw Error("roundRadius must be positive");if(!vzn(i,4))throw Error("segments must be four or more");if(o[0]===0||o[1]===0)return yPe.create();if(r===0)return Kbi({center:n,size:o});if(o=o.map((m)=>m/2),r>o[0]-Izn||r>o[1]-Izn)throw Error("roundRadius must be smaller than the radius of all dimensions");let s=Math.floor(i/4),a=bs.add(bs.create(),n,[o[0]-r,o[1]-r]),c=bs.add(bs.create(),n,[r-o[0],o[1]-r]),l=bs.add(bs.create(),n,[r-o[0],r-o[1]]),h=bs.add(bs.create(),n,[o[0]-r,r-o[1]]),d=[],u=[],_=[],p=[];for(let m=0;m<=s;m++){let A=fPe/4*m/s,g=bs.fromAngleRadians(bs.create(),A);bs.scale(g,g,r),d.push(bs.add(bs.create(),a,g)),bs.rotate(g,g,bs.create(),fPe/4),u.push(bs.add(bs.create(),c,g)),bs.rotate(g,g,bs.create(),fPe/4),_.push(bs.add(bs.create(),l,g)),bs.rotate(g,g,bs.create(),fPe/4),p.push(bs.add(bs.create(),h,g))}return yPe.fromPoints(d.concat(u,_,p))};Pzn.exports=$bi});var $ht=pt(function(V2a,Mzn){var qbi=jht(),{isGTE:Jbi}=j_(),Zbi=(e)=>{let t={center:[0,0,0],radius:1,segments:32,axes:[[1,0,0],[0,-1,0],[0,0,1]]},{center:n,radius:o,segments:r,axes:i}=Object.assign({},t,e);if(!Jbi(o,0))throw Error("radius must be positive");return o=[o,o,o],qbi({center:n,radius:o,segments:r,axes:i})};Mzn.exports=Zbi});var Bzn=pt(function(Y2a,wzn){var e6i=pPe(),{isGTE:t6i}=j_(),n6i=(e)=>{let t={center:[0,0],size:2},{center:n,size:o}=Object.assign({},t,e);if(!t6i(o,0))throw Error("size must be positive");return o=[o,o],e6i({center:n,size:o})};wzn.exports=n6i});var Qzn=pt(function(G2a,Rzn){var{TAU:Dzn}=bc(),ZP=Ia(),Nzn=qs(),{isGT:o6i,isGTE:xPe,isNumberArray:r6i}=j_(),i6i=(e,t)=>{if(e>0&&t>1&&t<e/2)return Math.cos(Math.PI*t/e)/Math.cos(Math.PI*(t-1)/e);return 0},Tzn=(e,t,n,o)=>{let r=Dzn/e,i=[];for(let s=0;s<e;s++){let a=ZP.fromAngleRadians(ZP.create(),r*s+n);ZP.scale(a,a,t),ZP.add(a,o,a),i.push(a)}return i},s6i=(e)=>{let t={center:[0,0],vertices:5,outerRadius:1,innerRadius:0,density:2,startAngle:0},{center:n,vertices:o,outerRadius:r,innerRadius:i,density:s,startAngle:a}=Object.assign({},t,e);if(!r6i(n,2))throw Error("center must be an array of X and Y values");if(!xPe(o,2))throw Error("vertices must be two or more");if(!o6i(r,0))throw Error("outerRadius must be greater than zero");if(!xPe(i,0))throw Error("innerRadius must be greater than zero");if(!xPe(a,0))throw Error("startAngle must be greater than zero");if(o=Math.floor(o),s=Math.floor(s),a=a%Dzn,i===0){if(!xPe(s,2))throw Error("density must be two or more");i=r*i6i(o,s)}let c=ZP.clone(n),l=Tzn(o,r,a,c),h=Tzn(o,i,a+Math.PI/o,c),d=[];for(let u=0;u<o;u++)d.push(l[u]),d.push(h[u]);return Nzn.fromPoints(d)};Rzn.exports=s6i});var See=pt(function(U2a,kzn){var a6i=Cs(),CPe=ld(),bPe=Hv(),IPe=qs(),vPe=Ys(),SPe=Wh(),PPe=(e,...t)=>{let n={origin:[0,0,0],normal:[0,0,1]},{origin:o,normal:r}=Object.assign({},n,e);if(t=a6i(t),t.length===0)throw Error("wrong number of arguments");let i=bPe.fromNormalAndPoint(bPe.create(),r,o);if(Number.isNaN(i[0]))throw Error("the given origin and normal do not define a proper plane");let s=CPe.mirrorByPlane(CPe.create(),i),a=t.map((c)=>{if(SPe.isA(c))return SPe.transform(s,c);if(IPe.isA(c))return IPe.transform(s,c);if(vPe.isA(c))return vPe.transform(s,c);return c});return a.length===1?a[0]:a},c6i=(...e)=>PPe({normal:[1,0,0]},e),l6i=(...e)=>PPe({normal:[0,1,0]},e),h6i=(...e)=>PPe({normal:[0,0,1]},e);kzn.exports={mirror:PPe,mirrorX:c6i,mirrorY:l6i,mirrorZ:h6i}});var qht=pt(function(W2a,Lzn){var EPe=Hv(),J5=di(),d6i=(e)=>{let t=e.edges;if(t.length<3)throw Error("slices must have 3 or more edges to calculate a plane");let n=t.reduce((s,a)=>J5.add(J5.create(),s,a[0]),J5.create());J5.scale(n,n,1/t.length);let o,r=0;t.forEach((s)=>{if(!J5.equals(s[0],s[1])){let a=J5.squaredDistance(n,s[0]);if(a>r)o=s,r=a}});let i=t.find((s)=>J5.equals(s[1],o[0]));return EPe.fromPoints(EPe.create(),i[0],o[0],o[1])};Lzn.exports=d6i});var RL=pt(function(X2a,Hzn){var u6i=(e)=>{if(!e)e=[];return{edges:e}};Hzn.exports=u6i});var zzn=pt(function(j2a,Fzn){var p6i=RL(),MPe=di(),m6i=(...e)=>{let t,n;if(e.length===1)t=p6i(),n=e[0];else t=e[0],n=e[1];return t.edges=n.edges.map((o)=>[MPe.clone(o[0]),MPe.clone(o[1])]),t};Fzn.exports=m6i});var Yzn=pt(function(K2a,Vzn){var Ozn=di(),_6i=(e,t)=>{let n=e.edges,o=t.edges;if(n.length!==o.length)return!1;return n.reduce((i,s,a)=>{let c=o[a],l=Ozn.squaredDistance(s[0],c[0]);return i&&l<Number.EPSILON},!0)};Vzn.exports=_6i});var Uzn=pt(function($2a,Gzn){var QL=di(),g6i=RL(),A6i=(e)=>{if(!Array.isArray(e))throw Error("the given points must be an array");if(e.length<3)throw Error("the given points must contain THREE or more points");let t=[],n=e[e.length-1];return e.forEach((o)=>{if(o.length===2)t.push([QL.fromVec2(QL.create(),n),QL.fromVec2(QL.create(),o)]);if(o.length===3)t.push([n,o]);n=o}),g6i(t)};Gzn.exports=A6i});var Xzn=pt(function(q2a,Wzn){var kL=di(),f6i=RL(),y6i=(e)=>{if(!Array.isArray(e))throw Error("the given sides must be an array");let t=[];return e.forEach((n)=>{t.push([kL.fromVec2(kL.create(),n[0]),kL.fromVec2(kL.create(),n[1])])}),f6i(t)};Wzn.exports=y6i});var Kzn=pt(function(J2a,jzn){var x6i=(e)=>{if(e&&typeof e==="object"){if("edges"in e){if(Array.isArray(e.edges))return!0}}return!1};jzn.exports=x6i});var qzn=pt(function(Z2a,$zn){var C6i=RL(),b6i=(...e)=>{let t,n;if(e.length===1)t=C6i(),n=e[0];else t=e[0],n=e[1];return t.edges=n.edges.map((o)=>[o[1],o[0]]),t};$zn.exports=b6i});var Zzn=pt(function(e1a,Jzn){var I6i=(e)=>e.edges;Jzn.exports=I6i});var tOn=pt(function(t1a,eOn){var v6i=(e,t)=>{let n,o,r,i,s,a=1;do{o=e,e=null;let c=null;s=0;while(o){s++,r=o;let l=0;for(n=0;n<a;n++)if(l++,r=r.nextZ,!r)break;let h=a;while(l>0||h>0&&r){if(l!==0&&(h===0||!r||t(o)<=t(r)))i=o,o=o.nextZ,l--;else i=r,r=r.nextZ,h--;if(c)c.nextZ=i;else e=i;i.prevZ=c,c=i}o=r}c.nextZ=null,a*=2}while(s>1);return e};eOn.exports=v6i});var Zht=pt(function(n1a,nOn){var S6i=tOn();class Jht{constructor(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}}var P6i=(e,t,n,o)=>{let r=new Jht(e,t,n);if(!o)r.prev=r,r.next=r;else r.next=o.next,r.prev=o,o.next.prev=r,o.next=r;return r},E6i=(e)=>{if(e.next.prev=e.prev,e.prev.next=e.next,e.prevZ)e.prevZ.nextZ=e.nextZ;if(e.nextZ)e.nextZ.prevZ=e.prevZ};nOn.exports={Node:Jht,insertNode:P6i,removeNode:E6i,sortLinked:S6i}});var wPe=pt(function(o1a,oOn){var M6i=(e,t,n,o,r,i,s,a)=>(r-s)*(t-a)-(e-s)*(i-a)>=0&&(e-s)*(o-a)-(n-s)*(t-a)>=0&&(n-s)*(i-a)-(r-s)*(o-a)>=0,w6i=(e,t,n)=>(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y);oOn.exports={area:w6i,pointInTriangle:M6i}});var edt=pt(function(r1a,cOn){var{Node:rOn,insertNode:iOn,removeNode:TPe}=Zht(),{area:Z5}=wPe(),B6i=(e,t,n,o,r)=>{let i;if(r===k6i(e,t,n,o)>0)for(let s=t;s<n;s+=o)i=iOn(s,e[s],e[s+1],i);else for(let s=n-o;s>=t;s-=o)i=iOn(s,e[s],e[s+1],i);if(i&&DPe(i,i.next))TPe(i),i=i.next;return i},sOn=(e,t)=>{if(!e)return e;if(!t)t=e;let n=e,o;do if(o=!1,!n.steiner&&(DPe(n,n.next)||Z5(n.prev,n,n.next)===0)){if(TPe(n),n=t=n.prev,n===n.next)break;o=!0}else n=n.next;while(o||n!==t);return t},T6i=(e,t,n)=>{let o=e;do{let r=o.prev,i=o.next.next;if(!DPe(r,i)&&aOn(r,o,o.next,i)&&T0e(r,i)&&T0e(i,r))t.push(r.i/n),t.push(o.i/n),t.push(i.i/n),TPe(o),TPe(o.next),o=e=i;o=o.next}while(o!==e);return sOn(o)},D6i=(e,t)=>{let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&aOn(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1},T0e=(e,t)=>Z5(e.prev,e,e.next)<0?Z5(e,t,e.next)>=0&&Z5(e,e.prev,t)>=0:Z5(e,t,e.prev)<0||Z5(e,e.next,t)<0,N6i=(e,t)=>{let n=e,o=!1,r=(e.x+t.x)/2,i=(e.y+t.y)/2;do{if(n.y>i!==n.next.y>i&&n.next.y!==n.y&&r<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x)o=!o;n=n.next}while(n!==e);return o},R6i=(e,t)=>{let n=new rOn(e.i,e.x,e.y),o=new rOn(t.i,t.x,t.y),r=e.next,i=t.prev;return e.next=t,t.prev=e,n.next=r,r.prev=n,o.next=n,n.prev=o,i.next=o,o.prev=i,o},Q6i=(e,t)=>e.next.i!==t.i&&e.prev.i!==t.i&&!D6i(e,t)&&(T0e(e,t)&&T0e(t,e)&&N6i(e,t)&&(Z5(e.prev,e,t.prev)||Z5(e,t.prev,t))||DPe(e,t)&&Z5(e.prev,e,e.next)>0&&Z5(t.prev,t,t.next)>0),aOn=(e,t,n,o)=>{let r=Math.sign(Z5(e,t,n)),i=Math.sign(Z5(e,t,o)),s=Math.sign(Z5(n,o,e)),a=Math.sign(Z5(n,o,t));if(r!==i&&s!==a)return!0;if(r===0&&BPe(e,n,t))return!0;if(i===0&&BPe(e,o,t))return!0;if(s===0&&BPe(n,e,o))return!0;if(a===0&&BPe(n,t,o))return!0;return!1},BPe=(e,t,n)=>t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y),k6i=(e,t,n,o)=>{let r=0;for(let i=t,s=n-o;i<n;i+=o)r+=(e[s]-e[i])*(e[i+1]+e[s+1]),s=i;return r},DPe=(e,t)=>e.x===t.x&&e.y===t.y;cOn.exports={cureLocalIntersections:T6i,filterPoints:sOn,isValidDiagonal:Q6i,linkedPolygon:B6i,locallyInside:T0e,splitPolygon:R6i}});var dOn=pt(function(i1a,hOn){var{filterPoints:tdt,linkedPolygon:L6i,locallyInside:H6i,splitPolygon:F6i}=edt(),{area:lOn,pointInTriangle:z6i}=wPe(),O6i=(e,t,n,o)=>{let r=[];for(let i=0,s=t.length;i<s;i++){let a=t[i]*o,c=i<s-1?t[i+1]*o:e.length,l=L6i(e,a,c,o,!1);if(l===l.next)l.steiner=!0;r.push(U6i(l))}r.sort((i,s)=>i.x-s.x);for(let i=0;i<r.length;i++)n=V6i(r[i],n),n=tdt(n,n.next);return n},V6i=(e,t)=>{let n=Y6i(e,t);if(!n)return t;let o=F6i(n,e),r=tdt(n,n.next);return tdt(o,o.next),t===n?r:t},Y6i=(e,t)=>{let n=t,{x:o,y:r}=e,i=-1/0,s;do{if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){let d=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(d<=o&&d>i){if(i=d,d===o){if(r===n.y)return n;if(r===n.next.y)return n.next}s=n.x<n.next.x?n:n.next}}n=n.next}while(n!==t);if(!s)return null;if(o===i)return s;let a=s,c=s.x,l=s.y,h=1/0;n=s;do{if(o>=n.x&&n.x>=c&&o!==n.x&&z6i(r<l?o:i,r,c,l,r<l?i:o,r,n.x,n.y)){let d=Math.abs(r-n.y)/(o-n.x);if(H6i(n,e)&&(d<h||d===h&&(n.x>s.x||n.x===s.x&&G6i(s,n))))s=n,h=d}n=n.next}while(n!==a);return s},G6i=(e,t)=>lOn(e.prev,e,t.prev)<0&&lOn(t.next,e,e.next)<0,U6i=(e)=>{let t=e,n=e;do{if(t.x<n.x||t.x===n.x&&t.y<n.y)n=t;t=t.next}while(t!==e);return n};hOn.exports=O6i});var pOn=pt(function(s1a,uOn){var W6i=dOn(),{removeNode:X6i,sortLinked:j6i}=Zht(),{cureLocalIntersections:K6i,filterPoints:NPe,isValidDiagonal:$6i,linkedPolygon:q6i,splitPolygon:J6i}=edt(),{area:OG,pointInTriangle:D0e}=wPe(),Z6i=(e,t,n=2)=>{let o=t&&t.length,r=o?t[0]*n:e.length,i=q6i(e,0,r,n,!0),s=[];if(!i||i.next===i.prev)return s;let a,c,l,h,d;if(o)i=W6i(e,t,i,n);if(e.length>80*n){a=l=e[0],c=h=e[1];for(let u=n;u<r;u+=n){let _=e[u],p=e[u+1];if(_<a)a=_;if(p<c)c=p;if(_>l)l=_;if(p>h)h=p}d=Math.max(l-a,h-c),d=d!==0?1/d:0}return N0e(i,s,n,a,c,d),s},N0e=(e,t,n,o,r,i,s)=>{if(!e)return;if(!s&&i)oIi(e,o,r,i);let a=e,c,l;while(e.prev!==e.next){if(c=e.prev,l=e.next,i?tIi(e,o,r,i):eIi(e)){t.push(c.i/n),t.push(e.i/n),t.push(l.i/n),X6i(e),e=l.next,a=l.next;continue}if(e=l,e===a){if(!s)N0e(NPe(e),t,n,o,r,i,1);else if(s===1)e=K6i(NPe(e),t,n),N0e(e,t,n,o,r,i,2);else if(s===2)nIi(e,t,n,o,r,i);break}}},eIi=(e)=>{let t=e.prev,n=e,o=e.next;if(OG(t,n,o)>=0)return!1;let r=e.next.next;while(r!==e.prev){if(D0e(t.x,t.y,n.x,n.y,o.x,o.y,r.x,r.y)&&OG(r.prev,r,r.next)>=0)return!1;r=r.next}return!0},tIi=(e,t,n,o)=>{let r=e.prev,i=e,s=e.next;if(OG(r,i,s)>=0)return!1;let a=r.x<i.x?r.x<s.x?r.x:s.x:i.x<s.x?i.x:s.x,c=r.y<i.y?r.y<s.y?r.y:s.y:i.y<s.y?i.y:s.y,l=r.x>i.x?r.x>s.x?r.x:s.x:i.x>s.x?i.x:s.x,h=r.y>i.y?r.y>s.y?r.y:s.y:i.y>s.y?i.y:s.y,d=ndt(a,c,t,n,o),u=ndt(l,h,t,n,o),{prevZ:_,nextZ:p}=e;while(_&&_.z>=d&&p&&p.z<=u){if(_!==e.prev&&_!==e.next&&D0e(r.x,r.y,i.x,i.y,s.x,s.y,_.x,_.y)&&OG(_.prev,_,_.next)>=0)return!1;if(_=_.prevZ,p!==e.prev&&p!==e.next&&D0e(r.x,r.y,i.x,i.y,s.x,s.y,p.x,p.y)&&OG(p.prev,p,p.next)>=0)return!1;p=p.nextZ}while(_&&_.z>=d){if(_!==e.prev&&_!==e.next&&D0e(r.x,r.y,i.x,i.y,s.x,s.y,_.x,_.y)&&OG(_.prev,_,_.next)>=0)return!1;_=_.prevZ}while(p&&p.z<=u){if(p!==e.prev&&p!==e.next&&D0e(r.x,r.y,i.x,i.y,s.x,s.y,p.x,p.y)&&OG(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0},nIi=(e,t,n,o,r,i)=>{let s=e;do{let a=s.next.next;while(a!==s.prev){if(s.i!==a.i&&$6i(s,a)){let c=J6i(s,a);s=NPe(s,s.next),c=NPe(c,c.next),N0e(s,t,n,o,r,i),N0e(c,t,n,o,r,i);return}a=a.next}s=s.next}while(s!==e)},oIi=(e,t,n,o)=>{let r=e;do{if(r.z===null)r.z=ndt(r.x,r.y,t,n,o);r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,j6i(r,(i)=>i.z)},ndt=(e,t,n,o,r)=>(e=32767*(e-n)*r,t=32767*(t-o)*r,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1);uOn.exports=Z6i});var _On=pt(function(a1a,mOn){var{area:rIi}=gee(),{toOutlines:iIi}=qs(),{arePointsInside:sIi}=ESe(),aIi=(e)=>{let t=iIi(e),n=[],o=[];t.forEach((s,a)=>{let c=rIi(s);if(c<0)o.push(a);else if(c>0)n.push(a)});let r=[],i=[];return n.forEach((s,a)=>{let c=t[s];r[a]=[],o.forEach((l,h)=>{let d=t[l];if(sIi([d[0]],{vertices:c})){if(r[a].push(l),!i[h])i[h]=[];i[h].push(a)}})}),o.forEach((s,a)=>{if(i[a]&&i[a].length>1){let c=cIi(i[a],(l)=>r[l].length);i[a].forEach((l,h)=>{if(h!==c)r[l]=r[l].filter((d)=>d!==s)})}}),r.map((s,a)=>({solid:t[n[a]],holes:s.map((c)=>t[c])}))},cIi=(e,t)=>{let n,o;return e.forEach((r,i)=>{let s=t(r);if(o===void 0||s<o)n=i,o=s}),n};mOn.exports=aIi});var COn=pt(function(c1a,xOn){var AOn=qs(),gOn=Hv(),fOn=Ia(),Nl=di(),lIi=qht(),hIi=_On();class yOn{constructor(e){this.plane=lIi(e);let t=Nl.orthogonal(Nl.create(),this.plane),n=Nl.cross(Nl.create(),this.plane,t);this.v=Nl.normalize(n,n),this.u=Nl.cross(Nl.create(),this.v,this.plane),this.basisMap=new Map;let o=e.edges.map((i)=>i.map((s)=>this.to2D(s))),r=AOn.create(o);this.roots=hIi(r)}to2D(e){let t=fOn.fromValues(Nl.dot(e,this.u),Nl.dot(e,this.v));return this.basisMap.set(t,e),t}to3D(e){let t=this.basisMap.get(e);if(t)return t;else{console.log("Warning: point not in original slice");let n=Nl.scale(Nl.create(),this.u,e[0]),o=Nl.scale(Nl.create(),this.v,e[1]),r=Nl.scale(Nl.create(),gOn,gOn[3]),i=Nl.add(n,n,r);return Nl.add(o,o,i)}}}xOn.exports=yOn});var vOn=pt(function(l1a,IOn){var bOn=nc(),dIi=pOn(),uIi=COn(),pIi=(e)=>{let t=new uIi(e),n=[];return t.roots.forEach(({solid:o,holes:r})=>{let i=o.length,s=[];r.forEach((d,u)=>{s.push(i),i+=d.length});let a=[o,...r].flat(),c=a.flat(),l=(d)=>t.to3D(a[d]),h=dIi(c,s);for(let d=0;d<h.length;d+=3){let u=h.slice(d,d+3).map(l);n.push(bOn.fromPointsAndPlane(u,t.plane))}}),n};IOn.exports=pIi});var POn=pt(function(h1a,SOn){var RPe=di(),mIi=(e)=>e.reduce((t,n)=>t+=`[${RPe.toString(n[0])}, ${RPe.toString(n[1])}], `,""),_Ii=(e)=>`[${mIi(e.edges)}]`;SOn.exports=_Ii});var MOn=pt(function(d1a,EOn){var LL=di(),gIi=RL(),AIi=(e,t)=>{let n=t.edges.map((o)=>[LL.transform(LL.create(),o[0],e),LL.transform(LL.create(),o[1],e)]);return gIi(n)};EOn.exports=AIi});var VG=pt(function(u1a,wOn){wOn.exports={calculatePlane:qht(),clone:zzn(),create:RL(),equals:Yzn(),fromPoints:Uzn(),fromSides:Xzn(),isA:Kzn(),reverse:qzn(),toEdges:Zzn(),toPolygons:vOn(),toString:POn(),transform:MOn()}});var TOn=pt(function(p1a,BOn){var QPe=di(),fIi=RL(),yIi=(e)=>{if(!e.edges)return e;let t=e.edges,n=new Map,o=new Map;t=t.filter((s)=>!QPe.equals(s[0],s[1])),t.forEach((s)=>{let a=s[0].toString(),c=s[1].toString();n.set(a,s[0]),n.set(c,s[1]),o.set(a,(o.get(a)||0)+1),o.set(c,(o.get(c)||0)-1)});let r=[],i=[];return o.forEach((s,a)=>{if(s<0)r.push(a);if(s>0)i.push(a)}),r.forEach((s)=>{let a=n.get(s),c=1/0,l;i.forEach((h)=>{let d=n.get(h),u=QPe.distance(a,d);if(u<c)c=u,l=d}),console.warn(`slice.repair: repairing vertex gap ${a} to ${l} distance ${c}`),t=t.map((h)=>{if(h[0].toString()===s)return[l,h[1]];if(h[1].toString()===s)return[h[0],l];return h})}),fIi(t)};BOn.exports=yIi});var kOn=pt(function(m1a,QOn){var{EPS:DOn}=bc(),Q6=di(),HL=nc(),kPe=VG(),odt=(e,t)=>{if(e===t)return e;if(e<t)return odt(t,e);if(t===1)return 1;if(t===0)return e;return odt(t,e%t)},xIi=(e,t)=>e*t/odt(e,t),NOn=(e,t)=>{let n=e/t.length;if(n===1)return t;let o=Q6.fromValues(n,n,n),r=Q6.create(),i=[];return t.forEach((s)=>{Q6.subtract(r,s[1],s[0]),Q6.divide(r,r,o);let a=s[0];for(let c=1;c<=n;++c){let l=Q6.add(Q6.create(),a,r);i.push([a,l]),a=l}}),i},ROn=DOn*DOn/2*Math.sin(Math.PI/3),CIi=(e,t)=>{let n=kPe.toEdges(e),o=kPe.toEdges(t);if(n.length!==o.length){let i=xIi(n.length,o.length);if(i!==n.length)n=NOn(i,n);if(i!==o.length)o=NOn(i,o)}let r=[];return n.forEach((i,s)=>{let a=o[s],c=HL.create([i[0],i[1],a[1]]),l=HL.measureArea(c);if(Number.isFinite(l)&&l>ROn)r.push(c);let h=HL.create([i[0],a[1],a[0]]),d=HL.measureArea(h);if(Number.isFinite(d)&&d>ROn)r.push(h)}),r};QOn.exports=CIi});var R0e=pt(function(_1a,FOn){var LPe=ld(),HPe=qs(),HOn=Ys(),Pee=nc(),k1=VG(),bIi=TOn(),LOn=kOn(),IIi=(e,t,n)=>{let o=null;if(HPe.isA(n))o=k1.fromSides(HPe.toSides(n));if(Pee.isA(n))o=k1.fromPoints(Pee.toPoints(n));return e===0||e===1?k1.transform(LPe.fromTranslation(LPe.create(),[0,0,e]),o):null},vIi=(e,t)=>{let n={numberOfSlices:2,capStart:!0,capEnd:!0,close:!1,repair:!0,callback:IIi},{numberOfSlices:o,capStart:r,capEnd:i,close:s,repair:a,callback:c}=Object.assign({},n,e);if(o<2)throw Error("numberOfSlices must be 2 or more");if(a)t=bIi(t);let l=o-1,h=null,d=null,u=null,_=[];for(let p=0;p<o;p++){let m=c(p/l,p,t);if(m){if(!k1.isA(m))throw Error("the callback function must return slice objects");if(k1.toEdges(m).length===0)throw Error("the callback function must return slices with one or more edges");if(u){let g=LOn(u,m);for(let f=0;f<g.length;f++)_.push(g[f])}if(p===0)h=m;if(p===o-1)d=m;u=m}}if(i){let p=k1.toPolygons(d);for(let m=0;m<p.length;m++)_.push(p[m])}if(r){let p=k1.toPolygons(h).map(Pee.invert);for(let m=0;m<p.length;m++)_.push(p[m])}if(!r&&!i){if(s&&!k1.equals(d,h)){let p=LOn(d,h);for(let m=0;m<p.length;m++)_.push(p[m])}}return HOn.create(_)};FOn.exports=vIi});var rdt=pt(function(g1a,zOn){var{TAU:tC}=bc(),k6=ld(),{mirrorX:SIi}=See(),FL=qs(),Eee=VG(),PIi=R0e(),EIi=(e,t)=>{let n={segments:12,startAngle:0,angle:tC,overflow:"cap"},{segments:o,startAngle:r,angle:i,overflow:s}=Object.assign({},n,e);if(o<3)throw Error("segments must be greater then 3");r=Math.abs(r)>tC?r%tC:r,i=Math.abs(i)>tC?i%tC:i;let a=r+i;if(a=Math.abs(a)>tC?a%tC:a,a<r){let x=r;r=a,a=x}let c=a-r;if(c<=0)c=tC;if(Math.abs(c)<tC){let x=tC/o;if(o=Math.floor(Math.abs(c)/x),Math.abs(c)>o*x)o++}let l=FL.toSides(t);if(l.length===0)throw Error("the given geometry cannot be empty");let h=l.filter((x)=>x[0][0]<0),d=l.filter((x)=>x[0][0]>=0);if(h.length>0&&d.length>0&&s==="cap"){if(h.length>d.length)l=l.map((x)=>{let C=x[0],b=x[1];return C=[Math.min(C[0],0),C[1]],b=[Math.min(b[0],0),b[1]],[C,b]}),t=FL.create(l),t=SIi(t);else if(d.length>=h.length)l=l.map((x)=>{let C=x[0],b=x[1];return C=[Math.max(C[0],0),C[1]],b=[Math.max(b[0],0),b[1]],[C,b]}),t=FL.create(l)}let _=c/o,p=Math.abs(c)<tC,m=Eee.fromSides(FL.toSides(t));Eee.reverse(m,m);let A=k6.create(),g=k6.fromXRotation(k6.create(),tC/4),f=k6.create(),y=(x,C,b)=>{let I=_*C+r;if(c===tC&&C===o)I=r;return k6.fromZRotation(f,I),k6.multiply(A,f,g),Eee.transform(A,b)};return e={numberOfSlices:o+1,capStart:p,capEnd:p,close:!p,callback:y},PIi(e,m)};zOn.exports=EIi});var Mee=pt(function(A1a,OOn){var MIi=Cs(),FPe=ld(),zPe=qs(),OPe=Ys(),VPe=Wh(),YPe=(e,...t)=>{if(!Array.isArray(e))throw Error("angles must be an array");if(t=MIi(t),t.length===0)throw Error("wrong number of arguments");e=e.slice();while(e.length<3)e.push(0);let n=e[2],o=e[1],r=e[0],i=FPe.fromTaitBryanRotation(FPe.create(),n,o,r),s=t.map((a)=>{if(VPe.isA(a))return VPe.transform(i,a);if(zPe.isA(a))return zPe.transform(i,a);if(OPe.isA(a))return OPe.transform(i,a);return a});return s.length===1?s[0]:s},wIi=(e,...t)=>YPe([e,0,0],t),BIi=(e,...t)=>YPe([0,e,0],t),TIi=(e,...t)=>YPe([0,0,e],t);OOn.exports={rotate:YPe,rotateX:wIi,rotateY:BIi,rotateZ:TIi}});var zL=pt(function(f1a,VOn){var DIi=Cs(),GPe=ld(),UPe=qs(),WPe=Ys(),XPe=Wh(),jPe=(e,...t)=>{if(!Array.isArray(e))throw Error("offset must be an array");if(t=DIi(t),t.length===0)throw Error("wrong number of arguments");e=e.slice();while(e.length<3)e.push(0);let n=GPe.fromTranslation(GPe.create(),e),o=t.map((r)=>{if(XPe.isA(r))return XPe.transform(n,r);if(UPe.isA(r))return UPe.transform(n,r);if(WPe.isA(r))return WPe.transform(n,r);return r});return o.length===1?o[0]:o},NIi=(e,...t)=>jPe([e,0,0],t),RIi=(e,...t)=>jPe([0,e,0],t),QIi=(e,...t)=>jPe([0,0,e],t);VOn.exports={translate:jPe,translateX:NIi,translateY:RIi,translateZ:QIi}});var GOn=pt(function(y1a,YOn){var{TAU:kIi}=bc(),LIi=rdt(),{rotate:HIi}=Mee(),{translate:FIi}=zL(),zIi=Yht(),{isGT:idt,isGTE:sdt}=j_(),OIi=(e)=>{let t={innerRadius:1,innerSegments:32,outerRadius:4,outerSegments:32,innerRotation:0,startAngle:0,outerRotation:kIi},{innerRadius:n,innerSegments:o,outerRadius:r,outerSegments:i,innerRotation:s,startAngle:a,outerRotation:c}=Object.assign({},t,e);if(!idt(n,0))throw Error("innerRadius must be greater than zero");if(!sdt(o,3))throw Error("innerSegments must be three or more");if(!idt(r,0))throw Error("outerRadius must be greater than zero");if(!sdt(i,3))throw Error("outerSegments must be three or more");if(!sdt(a,0))throw Error("startAngle must be positive");if(!idt(c,0))throw Error("outerRotation must be greater than zero");if(n>=r)throw Error("inner circle is too large to rotate about the outer circle");let l=zIi({radius:n,segments:o});if(s!==0)l=HIi([0,0,s],l);return l=FIi([r,0],l),LIi({startAngle:a,angle:c,segments:i},l)};YOn.exports=OIi});var XOn=pt(function(x1a,WOn){var{NEPS:wee}=bc(),eE=Ia(),UOn=qs(),{isNumberArray:VIi}=j_(),adt=(e,t,n)=>Math.acos((e*e+t*t-n*n)/(2*e*t)),YIi=(e,t,n)=>{if(t>wee)return Math.sqrt(e*e+n*n-2*e*n*Math.cos(t));return Math.sqrt((e-n)*(e-n)+e*n*t*t*(1-t*t/12))},GIi=(e)=>{if(Math.abs(e[0]+e[1]+e[2]-Math.PI)>wee)throw Error("AAA triangles require angles that sum to PI");let n=e[0],o=e[1],r=Math.PI-n-o,i=1,s=i/Math.sin(r)*Math.sin(n),a=i/Math.sin(r)*Math.sin(o);return Bee(n,o,r,s,a,i)},UIi=(e)=>{let t=e[0],n=e[1],o=Math.PI+wee-t-n;if(o<wee)throw Error("AAS triangles require angles that sum to PI");let r=e[2],i=r/Math.sin(t)*Math.sin(n),s=r/Math.sin(t)*Math.sin(o);return Bee(t,n,o,r,i,s)},WIi=(e)=>{let t=e[0],n=e[2],o=Math.PI+wee-t-n;if(o<wee)throw Error("ASA triangles require angles that sum to PI");let r=e[1],i=r/Math.sin(o)*Math.sin(t),s=r/Math.sin(o)*Math.sin(n);return Bee(t,n,o,i,s,r)},XIi=(e)=>{let t=e[0],n=e[1],o=e[2],r=YIi(t,n,o),i=adt(r,t,o),s=Math.PI-i-n;return Bee(i,n,s,o,r,t)},jIi=(e)=>{let t=e[0],n=e[1],o=e[2],r=Math.asin(n*Math.sin(o)/t),i=Math.PI-r-o,s=t/Math.sin(o)*Math.sin(i);return Bee(r,i,o,n,s,t)},KIi=(e)=>{let t=e[1],n=e[2],o=e[0];if(t+n<=o||n+o<=t||o+t<=n)throw Error("SSS triangle is incorrect, as the longest side is longer than the sum of the other sides");let r=adt(n,o,t),i=adt(o,t,n),s=Math.PI-r-i;return Bee(r,i,s,t,n,o)},Bee=(e,t,n,o,r,i)=>{let s=eE.fromValues(0,0),a=eE.fromValues(i,0),c=eE.fromValues(o,0);return eE.add(c,eE.rotate(c,c,[0,0],Math.PI-t),a),UOn.fromPoints([s,a,c])},$Ii=(e)=>{let t={type:"SSS",values:[1,1,1]},{type:n,values:o}=Object.assign({},t,e);if(typeof n!=="string")throw Error("triangle type must be a string");if(n=n.toUpperCase(),!((n[0]==="A"||n[0]==="S")&&(n[1]==="A"||n[1]==="S")&&(n[2]==="A"||n[2]==="S")))throw Error("triangle type must contain three letters; A or S");if(!VIi(o,3))throw Error("triangle values must contain three values");if(!o.every((r)=>r>0))throw Error("triangle values must be greater than zero");switch(n){case"AAA":return GIi(o);case"AAS":return UIi(o);case"ASA":return WIi(o);case"SAS":return XIi(o);case"SSA":return jIi(o);case"SSS":return KIi(o);default:throw Error("invalid triangle type, try again")}};WOn.exports=$Ii});var KOn=pt(function(C1a,jOn){jOn.exports={arc:wFn(),circle:Yht(),cube:HFn(),cuboid:sPe(),cylinder:Xht(),cylinderElliptic:Wht(),ellipse:Vht(),ellipsoid:jht(),geodesicSphere:nzn(),line:izn(),polygon:azn(),polyhedron:Kht(),rectangle:pPe(),roundedCuboid:gzn(),roundedCylinder:bzn(),roundedRectangle:Ezn(),sphere:$ht(),square:Bzn(),star:Qzn(),torus:GOn(),triangle:XOn()}});var qOn=pt(function(b1a,$On){$On.exports={height:14,32:[16],33:[10,5,21,5,7,void 0,5,2,4,1,5,0,6,1,5,2],34:[16,4,21,4,14,void 0,12,21,12,14],35:[21,11,25,4,-7,void 0,17,25,10,-7,void 0,4,12,18,12,void 0,3,6,17,6],36:[20,8,25,8,-4,void 0,12,25,12,-4,void 0,17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3],37:[24,21,21,3,0,void 0,8,21,10,19,10,17,9,15,7,14,5,14,3,16,3,18,4,20,6,21,8,21,10,20,13,19,16,19,19,20,21,21,void 0,17,7,15,6,14,4,14,2,16,0,18,0,20,1,21,3,21,5,19,7,17,7],38:[26,23,12,23,13,22,14,21,14,20,13,19,11,17,6,15,3,13,1,11,0,7,0,5,1,4,2,3,4,3,6,4,8,5,9,12,13,13,14,14,16,14,18,13,20,11,21,9,20,8,18,8,16,9,13,11,10,16,3,18,1,20,0,22,0,23,1,23,2],39:[10,5,19,4,20,5,21,6,20,6,18,5,16,4,15],40:[14,11,25,9,23,7,20,5,16,4,11,4,7,5,2,7,-2,9,-5,11,-7],41:[14,3,25,5,23,7,20,9,16,10,11,10,7,9,2,7,-2,5,-5,3,-7],42:[16,8,21,8,9,void 0,3,18,13,12,void 0,13,18,3,12],43:[26,13,18,13,0,void 0,4,9,22,9],44:[10,6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4],45:[26,4,9,22,9],46:[10,5,2,4,1,5,0,6,1,5,2],47:[22,20,25,2,-7],48:[20,9,21,6,20,4,17,3,12,3,9,4,4,6,1,9,0,11,0,14,1,16,4,17,9,17,12,16,17,14,20,11,21,9,21],49:[20,6,17,8,18,11,21,11,0],50:[20,4,16,4,17,5,19,6,20,8,21,12,21,14,20,15,19,16,17,16,15,15,13,13,10,3,0,17,0],51:[20,5,21,16,21,10,13,13,13,15,12,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4],52:[20,13,21,3,7,18,7,void 0,13,21,13,0],53:[20,15,21,5,21,4,12,5,13,8,14,11,14,14,13,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4],54:[20,16,18,15,20,12,21,10,21,7,20,5,17,4,12,4,7,5,3,7,1,10,0,11,0,14,1,16,3,17,6,17,7,16,10,14,12,11,13,10,13,7,12,5,10,4,7],55:[20,17,21,7,0,void 0,3,21,17,21],56:[20,8,21,5,20,4,18,4,16,5,14,7,13,11,12,14,11,16,9,17,7,17,4,16,2,15,1,12,0,8,0,5,1,4,2,3,4,3,7,4,9,6,11,9,12,13,13,15,14,16,16,16,18,15,20,12,21,8,21],57:[20,16,14,15,11,13,9,10,8,9,8,6,9,4,11,3,14,3,15,4,18,6,20,9,21,10,21,13,20,15,18,16,14,16,9,15,4,13,1,10,0,8,0,5,1,4,3],58:[10,5,14,4,13,5,12,6,13,5,14,void 0,5,2,4,1,5,0,6,1,5,2],59:[10,5,14,4,13,5,12,6,13,5,14,void 0,6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4],60:[24,20,18,4,9,20,0],61:[26,4,12,22,12,void 0,4,6,22,6],62:[24,4,18,20,9,4,0],63:[18,3,16,3,17,4,19,5,20,7,21,11,21,13,20,14,19,15,17,15,15,14,13,13,12,9,10,9,7,void 0,9,2,8,1,9,0,10,1,9,2],64:[27,18,13,17,15,15,16,12,16,10,15,9,14,8,11,8,8,9,6,11,5,14,5,16,6,17,8,void 0,12,16,10,14,9,11,9,8,10,6,11,5,void 0,18,16,17,8,17,6,19,5,21,5,23,7,24,10,24,12,23,15,22,17,20,19,18,20,15,21,12,21,9,20,7,19,5,17,4,15,3,12,3,9,4,6,5,4,7,2,9,1,12,0,15,0,18,1,20,2,21,3,void 0,19,16,18,8,18,6,19,5],65:[18,9,21,1,0,void 0,9,21,17,0,void 0,4,7,14,7],66:[21,4,21,4,0,void 0,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,void 0,4,11,13,11,16,10,17,9,18,7,18,4,17,2,16,1,13,0,4,0],67:[21,18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5],68:[21,4,21,4,0,void 0,4,21,11,21,14,20,16,18,17,16,18,13,18,8,17,5,16,3,14,1,11,0,4,0],69:[19,4,21,4,0,void 0,4,21,17,21,void 0,4,11,12,11,void 0,4,0,17,0],70:[18,4,21,4,0,void 0,4,21,17,21,void 0,4,11,12,11],71:[21,18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,18,8,void 0,13,8,18,8],72:[22,4,21,4,0,void 0,18,21,18,0,void 0,4,11,18,11],73:[8,4,21,4,0],74:[16,12,21,12,5,11,2,10,1,8,0,6,0,4,1,3,2,2,5,2,7],75:[21,4,21,4,0,void 0,18,21,4,7,void 0,9,12,18,0],76:[17,4,21,4,0,void 0,4,0,16,0],77:[24,4,21,4,0,void 0,4,21,12,0,void 0,20,21,12,0,void 0,20,21,20,0],78:[22,4,21,4,0,void 0,4,21,18,0,void 0,18,21,18,0],79:[22,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21],80:[21,4,21,4,0,void 0,4,21,13,21,16,20,17,19,18,17,18,14,17,12,16,11,13,10,4,10],81:[22,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21,void 0,12,4,18,-2],82:[21,4,21,4,0,void 0,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,4,11,void 0,11,11,18,0],83:[20,17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3],84:[16,8,21,8,0,void 0,1,21,15,21],85:[22,4,21,4,6,5,3,7,1,10,0,12,0,15,1,17,3,18,6,18,21],86:[18,1,21,9,0,void 0,17,21,9,0],87:[24,2,21,7,0,void 0,12,21,7,0,void 0,12,21,17,0,void 0,22,21,17,0],88:[20,3,21,17,0,void 0,17,21,3,0],89:[18,1,21,9,11,9,0,void 0,17,21,9,11],90:[20,17,21,3,0,void 0,3,21,17,21,void 0,3,0,17,0],91:[14,4,25,4,-7,void 0,5,25,5,-7,void 0,4,25,11,25,void 0,4,-7,11,-7],92:[14,0,21,14,-3],93:[14,9,25,9,-7,void 0,10,25,10,-7,void 0,3,25,10,25,void 0,3,-7,10,-7],94:[16,6,15,8,18,10,15,void 0,3,12,8,17,13,12,void 0,8,17,8,0],95:[16,0,-2,16,-2],96:[10,6,21,5,20,4,18,4,16,5,15,6,16,5,17],97:[19,15,14,15,0,void 0,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3],98:[19,4,21,4,0,void 0,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3],99:[18,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3],100:[19,15,21,15,0,void 0,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3],101:[18,3,8,15,8,15,10,14,12,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3],102:[12,10,21,8,21,6,20,5,17,5,0,void 0,2,14,9,14],103:[19,15,14,15,-2,14,-5,13,-6,11,-7,8,-7,6,-6,void 0,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3],104:[19,4,21,4,0,void 0,4,10,7,13,9,14,12,14,14,13,15,10,15,0],105:[8,3,21,4,20,5,21,4,22,3,21,void 0,4,14,4,0],106:[10,5,21,6,20,7,21,6,22,5,21,void 0,6,14,6,-3,5,-6,3,-7,1,-7],107:[17,4,21,4,0,void 0,14,14,4,4,void 0,8,8,15,0],108:[8,4,21,4,0],109:[30,4,14,4,0,void 0,4,10,7,13,9,14,12,14,14,13,15,10,15,0,void 0,15,10,18,13,20,14,23,14,25,13,26,10,26,0],110:[19,4,14,4,0,void 0,4,10,7,13,9,14,12,14,14,13,15,10,15,0],111:[19,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3,16,6,16,8,15,11,13,13,11,14,8,14],112:[19,4,14,4,-7,void 0,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3],113:[19,15,14,15,-7,void 0,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3],114:[13,4,14,4,0,void 0,4,8,5,11,7,13,9,14,12,14],115:[17,14,11,13,13,10,14,7,14,4,13,3,11,4,9,6,8,11,7,13,6,14,4,14,3,13,1,10,0,7,0,4,1,3,3],116:[12,5,21,5,4,6,1,8,0,10,0,void 0,2,14,9,14],117:[19,4,14,4,4,5,1,7,0,10,0,12,1,15,4,void 0,15,14,15,0],118:[16,2,14,8,0,void 0,14,14,8,0],119:[22,3,14,7,0,void 0,11,14,7,0,void 0,11,14,15,0,void 0,19,14,15,0],120:[17,3,14,14,0,void 0,14,14,3,0],121:[16,2,14,8,0,void 0,14,14,8,0,6,-4,4,-6,2,-7,1,-7],122:[17,14,14,3,0,void 0,3,14,14,14,void 0,3,0,14,0],123:[14,9,25,7,24,6,23,5,21,5,19,6,17,7,16,8,14,8,12,6,10,void 0,7,24,6,22,6,20,7,18,8,17,9,15,9,13,8,11,4,9,8,7,9,5,9,3,8,1,7,0,6,-2,6,-4,7,-6,void 0,6,8,8,6,8,4,7,2,6,1,5,-1,5,-3,6,-5,7,-6,9,-7],124:[8,4,25,4,-7],125:[14,5,25,7,24,8,23,9,21,9,19,8,17,7,16,6,14,6,12,8,10,void 0,7,24,8,22,8,20,7,18,6,17,5,15,5,13,6,11,10,9,6,7,5,5,5,3,6,1,7,0,8,-2,8,-4,7,-6,void 0,8,8,6,6,6,4,7,2,8,1,9,-1,9,-3,8,-5,7,-6,5,-7],126:[24,3,6,3,8,4,11,6,12,8,12,10,11,14,8,16,7,18,7,20,8,21,10,void 0,3,8,4,10,6,11,8,11,10,10,14,7,16,6,18,6,20,7,21,10,21,12]}});var cdt=pt(function(I1a,JOn){var qIi=qOn(),JIi={xOffset:0,yOffset:0,input:"?",align:"left",font:qIi,height:14,lineSpacing:2.142857142857143,letterSpacing:1,extrudeOffset:0},ZIi=(e,t)=>{if(!t&&typeof e==="string")e={input:e};e=e||{};let n=Object.assign({},JIi,e);return n.input=t||n.input,n};JOn.exports=ZIi});var ldt=pt(function(v1a,ZOn){var e9i=cdt(),t9i=(e,t)=>{let{xOffset:n,yOffset:o,input:r,font:i,height:s,extrudeOffset:a}=e9i(e,t),c=r.charCodeAt(0);if(!c||!i[c])c=63;let l=[].concat(i[c]),h=(s-a)/i.height,d=a/2,u=l.shift()*h,_=[],p=[];for(let m=0,A=l.length;m<A;m+=2){let g=h*l[m]+n,f=h*l[m+1]+o+d;if(l[m]!==void 0){p.push([g,f]);continue}_.push(p),p=[],m--}if(p.length)_.push(p);return{width:u,height:s,segments:_}};ZOn.exports=t9i});var nVn=pt(function(S1a,tVn){var n9i=ldt(),o9i=cdt(),eVn=(e,t)=>{let{x:n,y:o}=Object.assign({x:0,y:0},e||{}),r=t.segments,i=null,s=null;for(let a=0,c=r.length;a<c;a++){i=r[a];for(let l=0,h=i.length;l<h;l++)s=i[l],i[l]=[s[0]+n,s[1]+o]}return t},r9i=(e,t)=>{let{xOffset:n,yOffset:o,input:r,font:i,height:s,align:a,extrudeOffset:c,lineSpacing:l,letterSpacing:h}=o9i(e,t),[d,u]=[n,o],_,p,m,A,g,f,y={width:0,segments:[]},x=[],C=[],b=0,I=d,v=()=>{x.push(y),b=Math.max(b,y.width),y={width:0,segments:[]}};for(_=0,p=r.length;_<p;_++){if(m=r[_],A=n9i({xOffset:d,yOffset:u,font:i,height:s,extrudeOffset:c},m),m===`
`){d=I,u-=A.height*l,v();continue}if(g=A.width*h,y.width+=g,d+=g,m!==" ")y.segments=y.segments.concat(A.segments)}if(y.segments.length)v();for(_=0,p=x.length;_<p;_++){if(y=x[_],b>y.width){if(f=b-y.width,a==="right")y=eVn({x:f},y);else if(a==="center")y=eVn({x:f/2},y)}C=C.concat(y.segments)}return C};tVn.exports=r9i});var rVn=pt(function(P1a,oVn){oVn.exports={vectorChar:ldt(),vectorText:nVn()}});var Tee=pt(function(E1a,cVn){var iVn=qs(),sVn=Ys(),aVn=Wh(),i9i=(e)=>{let t;for(let n of e){let o=0;if(iVn.isA(n))o=1;if(sVn.isA(n))o=2;if(aVn.isA(n))o=3;if(t&&o!==t)return!1;t=o}return!0};cVn.exports=i9i});var hVn=pt(function(M1a,lVn){var s9i=(e)=>e*0.017453292519943295;lVn.exports=s9i});var hdt=pt(function(w1a,dVn){var a9i=(e,t)=>e-t;dVn.exports=a9i});var pVn=pt(function(B1a,uVn){var c9i=(e,t,n)=>{let o=0,r=e.length;while(r>o){let i=Math.floor((o+r)/2),s=e[i];if(n(t,s)>0)o=i+1;else r=i}e.splice(o,0,t)};uVn.exports=c9i});var gVn=pt(function(T1a,_Vn){var{TAU:mVn}=bc(),l9i=(e,t,n)=>{let o=t>0?e*mVn/t:0,r=n>0?mVn/n:0;return Math.ceil(Math.max(o,r,4))};_Vn.exports=l9i});var fVn=pt(function(D1a,AVn){var h9i=(e)=>e*57.29577951308232;AVn.exports=h9i});var ddt=pt(function(N1a,yVn){yVn.exports={areAllShapesTheSameType:Tee(),degToRad:hVn(),flatten:Cs(),fnNumberSort:hdt(),insertSorted:pVn(),radiusToSegments:gVn(),radToDeg:fVn()}});var $Pe=pt(function(R1a,CVn){var KPe=Ia(),xVn=qs(),d9i=(e,t)=>{if(t.vertices.length<4)return null;let n=[],o=t.vertices.filter((s,a)=>{if(s[2]>0)return n.push(a),!0;return!1});if(o.length!==2)throw Error("Assertion failed: fromFakePolygon: not enough points found");let r=o.map((s)=>{let a=Math.round(s[0]/e)*e+0,c=Math.round(s[1]/e)*e+0;return KPe.fromValues(a,c)});if(KPe.equals(r[0],r[1]))return null;let i=n[1]-n[0];if(i===1||i===3){if(i===1)r.reverse()}else throw Error("Assertion failed: fromFakePolygon: unknown index ordering");return r},u9i=(e,t)=>{let n=t.map((o)=>d9i(e,o)).filter((o)=>o!==null);return xVn.create(n)};CVn.exports=u9i});var qPe=pt(function(Q1a,SVn){var L1=di(),bVn=qs(),IVn=Ys(),vVn=nc(),p9i=(e,t,n)=>{let o=[L1.fromVec2(L1.create(),n[0],e),L1.fromVec2(L1.create(),n[1],e),L1.fromVec2(L1.create(),n[1],t),L1.fromVec2(L1.create(),n[0],t)];return vVn.create(o)},m9i=(e,t)=>{let o=bVn.toSides(t).map((i)=>p9i(e.z0,e.z1,i));return IVn.create(o)};SVn.exports=m9i});var wVn=pt(function(k1a,MVn){var JPe=ld(),PVn=Ia(),mc=di(),EVn=function(e,t){if(arguments.length<2)t=mc.orthogonal(mc.create(),e);this.v=mc.normalize(mc.create(),mc.cross(mc.create(),e,t)),this.u=mc.cross(mc.create(),this.v,e),this.plane=e,this.planeorigin=mc.scale(mc.create(),e,e[3])};EVn.prototype={getProjectionMatrix:function(){return JPe.fromValues(this.u[0],this.v[0],this.plane[0],0,this.u[1],this.v[1],this.plane[1],0,this.u[2],this.v[2],this.plane[2],0,0,0,-this.plane[3],1)},getInverseProjectionMatrix:function(){let e=mc.scale(mc.create(),this.plane,this.plane[3]);return JPe.fromValues(this.u[0],this.u[1],this.u[2],0,this.v[0],this.v[1],this.v[2],0,this.plane[0],this.plane[1],this.plane[2],0,e[0],e[1],e[2],1)},to2D:function(e){return PVn.fromValues(mc.dot(e,this.u),mc.dot(e,this.v))},to3D:function(e){let t=mc.scale(mc.create(),this.u,e[0]),n=mc.scale(mc.create(),this.v,e[1]),o=mc.add(t,t,this.planeorigin);return mc.add(n,n,o)}};MVn.exports=EVn});var TVn=pt(function(L1a,BVn){var{EPS:yT}=bc(),H1=QSe(),dm=Ia(),_9i=wVn(),Dee=Bht(),{insertSorted:g9i,fnNumberSort:A9i}=ddt(),ZPe=nc(),f9i=(e)=>{if(e.length<2)return e;let t=[],n=e.length,o=ZPe.plane(e[0]),r=new _9i(o),i=[],s=[],a=new Map,c=new Map,l=new Map,h=10/yT;for(let p=0;p<n;p++){let m=e[p],A=[],g=m.vertices.length,f=-1;if(g>0){let y,x;for(let C=0;C<g;C++){let b=r.to2D(m.vertices[C]),I=Math.floor(b[1]*h),v;if(l.has(I))v=l.get(I);else if(l.has(I+1))v=l.get(I+1);else if(l.has(I-1))v=l.get(I-1);else v=b[1],l.set(I,b[1]);b=dm.fromValues(b[0],v),A.push(b);let P=b[1];if(C===0||P<y)y=P,f=C;if(C===0||P>x)x=P;let M=c.get(P);if(!M)M={},c.set(P,M);M[p]=!0}if(y>=x)A=[],g=0,f=-1;else{let C=a.get(y);if(!C)C=[],a.set(y,C);C.push(p)}}A.reverse(),f=g-f-1,i.push(A),s.push(f)}let d=[];c.forEach((p,m)=>d.push(m)),d.sort(A9i);let u=[],_=[];for(let p=0;p<d.length;p++){let m=[],A=d[p],g=c.get(A),f=0;for(let x=0;x<u.length;++x){let C=u[x],b=C.polygonindex;if(g[b]){let I=i[b],v=I.length,{leftvertexindex:P,rightvertexindex:M}=C;while(!0){let T=P+1;if(T>=v)T=0;if(I[T][1]!==A)break;P=T}let B=M-1;if(B<0)B=v-1;if(I[B][1]===A)M=B;if(P!==C.leftvertexindex&&P===M)C._remove=!0,f++;else{C.leftvertexindex=P,C.rightvertexindex=M,C.topleft=I[P],C.topright=I[M];let T=P+1;if(T>=v)T=0;C.bottomleft=I[T];let N=M-1;if(N<0)N=v-1;C.bottomright=I[N]}}}if(f>0)u=u.filter((x)=>!x._remove);let y;if(p>=d.length-1)u=[],y=null;else{y=Number(d[p+1]);let x=0.5*(A+y),C=a.get(A);for(let b in C){let I=C[b],v=i[I],P=v.length,M=s[I],B=M;while(!0){let H=B+1;if(H>=P)H=0;if(v[H][1]!==A)break;if(H===M)break;B=H}let T=M;while(!0){let H=T-1;if(H<0)H=P-1;if(v[H][1]!==A)break;if(H===B)break;T=H}let N=B+1;if(N>=P)N=0;let D=T-1;if(D<0)D=P-1;let L={polygonindex:I,leftvertexindex:B,rightvertexindex:T,topleft:v[B],topright:v[T],bottomleft:v[N],bottomright:v[D]};g9i(u,L,(H,V)=>{let O=Dee(H.topleft,H.bottomleft,x),U=Dee(V.topleft,V.bottomleft,x);if(O>U)return 1;if(O<U)return-1;return 0})}}for(let x in u){let C=u[x],b=Dee(C.topleft,C.bottomleft,A),I=dm.fromValues(b,A);b=Dee(C.topright,C.bottomright,A);let v=dm.fromValues(b,A);b=Dee(C.topleft,C.bottomleft,y);let P=dm.fromValues(b,y);b=Dee(C.topright,C.bottomright,y);let M=dm.fromValues(b,y),B={topleft:I,topright:v,bottomleft:P,bottomright:M,leftline:H1.fromPoints(H1.create(),I,P),rightline:H1.fromPoints(H1.create(),M,v)};if(m.length>0){let T=m[m.length-1],N=dm.distance(B.topleft,T.topright),D=dm.distance(B.bottomleft,T.bottomright);if(N<yT&&D<yT)B.topleft=T.topleft,B.leftline=T.leftline,B.bottomleft=T.bottomleft,m.splice(m.length-1,1)}m.push(B)}if(p>0){let x=new Set,C=new Set;for(let b=0;b<m.length;b++){let I=m[b];for(let v=0;v<_.length;v++)if(!C.has(v)){let P=_[v];if(dm.distance(P.bottomleft,I.topleft)<yT){if(dm.distance(P.bottomright,I.topright)<yT){C.add(v);let M=H1.direction(I.leftline),B=H1.direction(P.leftline),T=M[0]-B[0],N=H1.direction(I.rightline),D=H1.direction(P.rightline),L=N[0]-D[0],H=Math.abs(T)<yT,V=Math.abs(L)<yT,O=H||T>=0,U=V||L>=0;if(O&&U)I.outpolygon=P.outpolygon,I.leftlinecontinues=H,I.rightlinecontinues=V,x.add(v);break}}}}for(let b=0;b<_.length;b++)if(!x.has(b)){let I=_[b];if(I.outpolygon.rightpoints.push(I.bottomright),dm.distance(I.bottomright,I.bottomleft)>yT)I.outpolygon.leftpoints.push(I.bottomleft);I.outpolygon.leftpoints.reverse();let P=I.outpolygon.rightpoints.concat(I.outpolygon.leftpoints).map((B)=>r.to3D(B)),M=ZPe.fromPointsAndPlane(P,o);if(M.vertices.length)t.push(M)}}for(let x=0;x<m.length;x++){let C=m[x];if(!C.outpolygon){if(C.outpolygon={leftpoints:[],rightpoints:[]},C.outpolygon.leftpoints.push(C.topleft),dm.distance(C.topleft,C.topright)>yT)C.outpolygon.rightpoints.push(C.topright)}else{if(!C.leftlinecontinues)C.outpolygon.leftpoints.push(C.topleft);if(!C.rightlinecontinues)C.outpolygon.rightpoints.push(C.topright)}}_=m}return t};BVn.exports=f9i});var Nee=pt(function(H1a,NVn){var eEe=Ys(),DVn=nc(),{NEPS:y9i}=bc(),x9i=TVn(),C9i=(e)=>{if(e.isRetesselated)return e;let t=eEe.toPolygons(e).map((i,s)=>({vertices:i.vertices,plane:DVn.plane(i),index:s})),n=b9i(t),o=[];n.forEach((i)=>{if(Array.isArray(i)){let s=x9i(i);for(let a=0;a<s.length;a++)o.push(s[a])}else o.push(i)});let r=eEe.create(o);return r.isRetesselated=!0,r},b9i=(e)=>{let t=[e],n=[];for(let r=3;r>=0;r--){let i=[],s=r===3?0.000000015:y9i;t.forEach((a)=>{a.sort(I9i(r,s));let c=0;for(let l=1;l<a.length;l++)if(a[l].plane[r]-a[c].plane[r]>s){if(l-c===1)n.push(a[c]);else i.push(a.slice(c,l));c=l}if(a.length-c===1)n.push(a[c]);else i.push(a.slice(c))}),t=i}let o=[];return t.forEach((r)=>{if(r[0])o[r[0].index]=r}),n.forEach((r)=>{o[r.index]=r}),o},I9i=(e,t)=>(n,o)=>{if(n.plane[e]-o.plane[e]>t)return 1;else if(o.plane[e]-n.plane[e]>t)return-1;return 0};NVn.exports=C9i});var tEe=pt(function(F1a,QVn){var{EPS:Ree}=bc(),RVn=BL(),v9i=(e,t)=>{if(e.polygons.length===0||t.polygons.length===0)return!1;let n=RVn(e),o=n[0],r=n[1],i=RVn(t),s=i[0],a=i[1];if(s[0]-r[0]>Ree)return!1;if(o[0]-a[0]>Ree)return!1;if(s[1]-r[1]>Ree)return!1;if(o[1]-a[1]>Ree)return!1;if(s[2]-r[2]>Ree)return!1;if(o[2]-a[2]>Ree)return!1;return!0};QVn.exports=v9i});var HVn=pt(function(z1a,LVn){var nEe=Hv(),kVn=nc();class oEe{constructor(e){this.plane=null,this.front=null,this.back=null,this.polygontreenodes=[],this.parent=e}invert(){let e=[this],t;for(let n=0;n<e.length;n++){if(t=e[n],t.plane)t.plane=nEe.flip(nEe.create(),t.plane);if(t.front)e.push(t.front);if(t.back)e.push(t.back);let o=t.front;t.front=t.back,t.back=o}}clipPolygons(e,t){let n={node:this,polygontreenodes:e},o,r=[];do{if(o=n.node,e=n.polygontreenodes,o.plane){let i=o.plane,s=[],a=[],c=t?s:a,l=e.length;for(let d=0;d<l;d++){let u=e[d];if(!u.isRemoved())u.splitByPlane(i,c,s,a,s)}if(o.front&&a.length>0)r.push({node:o.front,polygontreenodes:a});let h=s.length;if(o.back&&h>0)r.push({node:o.back,polygontreenodes:s});else for(let d=0;d<h;d++)s[d].remove()}n=r.pop()}while(n!==void 0)}clipTo(e,t){let n=this,o=[];do{if(n.polygontreenodes.length>0)e.rootnode.clipPolygons(n.polygontreenodes,t);if(n.front)o.push(n.front);if(n.back)o.push(n.back);n=o.pop()}while(n!==void 0)}addPolygonTreeNodes(e){let t={node:this,polygontreenodes:e},n=[];do{let o=t.node,r=t.polygontreenodes;if(r.length===0){t=n.pop();continue}if(!o.plane){let c=0;c=Math.floor(r.length/2);let l=r[c].getPolygon();o.plane=kVn.plane(l)}let i=[],s=[],a=r.length;for(let c=0;c<a;++c)r[c].splitByPlane(o.plane,o.polygontreenodes,s,i,s);if(i.length>0){if(!o.front)o.front=new oEe(o);if(a===i.length&&s.length===0)o.front.polygontreenodes=i;else n.push({node:o.front,polygontreenodes:i})}if(s.length>0){if(!o.back)o.back=new oEe(o);if(a===s.length&&i.length===0)o.back.polygontreenodes=s;else n.push({node:o.back,polygontreenodes:s})}t=n.pop()}while(t!==void 0)}}LVn.exports=oEe});var zVn=pt(function(O1a,FVn){var L6=di(),S9i=(e,t,n)=>{let o=L6.subtract(L6.create(),n,t),r=(e[3]-L6.dot(e,t))/L6.dot(e,o);if(Number.isNaN(r))r=0;if(r>1)r=1;if(r<0)r=0;return L6.scale(o,o,r),L6.add(o,t,o),o};FVn.exports=S9i});var GVn=pt(function(V1a,YVn){var{EPS:rEe}=bc(),VVn=Hv(),kee=di(),Qee=nc(),P9i=zVn(),E9i=rEe*rEe,OVn=(e)=>{let t=[],n=e[e.length-1];for(let o=0;o<e.length;o++){let r=e[o];if(kee.squaredDistance(r,n)>=E9i)t.push(r);n=r}return t},M9i=(e,t)=>{let n={type:null,front:null,back:null},o=t.vertices,r=o.length,i=Qee.plane(t);if(VVn.equals(i,e))n.type=0;else{let s=!1,a=!1,c=[],l=-rEe;for(let h=0;h<r;h++){let d=kee.dot(e,o[h])-e[3],u=d<l;if(c.push(u),d>rEe)s=!0;if(d<l)a=!0}if(!s&&!a){let h=kee.dot(e,i);n.type=h>=0?0:1}else if(!a)n.type=2;else if(!s)n.type=3;else{n.type=4;let h=[],d=[],u=c[0];for(let _=0;_<r;_++){let p=o[_],m=_+1;if(m>=r)m=0;let A=c[m];if(u===A)if(u)d.push(p);else h.push(p);else{let g=o[m],f=P9i(e,p,g);if(u)d.push(p),d.push(f),h.push(f);else h.push(p),h.push(f),d.push(f)}u=A}if(h.length>=3){let _=OVn(h);if(_.length>=3)n.front=Qee.fromPointsAndPlane(_,i)}if(d.length>=3){let _=OVn(d);if(_.length>=3)n.back=Qee.fromPointsAndPlane(_,i)}}}return n};YVn.exports=M9i});var XVn=pt(function(Y1a,WVn){var{EPS:w9i}=bc(),UVn=di(),iEe=nc(),B9i=GVn();class udt{constructor(e,t){this.parent=e,this.children=[],this.polygon=t,this.removed=!1}addPolygons(e){if(!this.isRootNode())throw Error("Assertion failed");let t=this;e.forEach((n)=>{t.addChild(n)})}remove(){if(!this.removed)this.removed=!0,this.polygon=null,this.parent.recursivelyInvalidatePolygon()}isRemoved(){return this.removed}isRootNode(){return!this.parent}invert(){if(!this.isRootNode())throw Error("Assertion failed");this.invertSub()}getPolygon(){if(!this.polygon)throw Error("Assertion failed");return this.polygon}getPolygons(e){if(this.isRootNode()&&this.children.length>0){let a=[];for(let c=0;c<this.children.length;c++)if(!this.children[c].removed)a.push(this.children[c]);this.children=a}let t=[this],n=[t],o,r,i,s;for(o=0;o<n.length;++o){t=n[o];for(r=0,i=t.length;r<i;r++)if(s=t[r],s.polygon)e.push(s.polygon);else if(s.children.length>0)n.push(s.children)}}splitByPlane(e,t,n,o,r){if(this.children.length){let i=[this.children],s,a,c,l,h;for(s=0;s<i.length;s++){h=i[s];for(a=0,c=h.length;a<c;a++)if(l=h[a],l.children.length>0)i.push(l.children);else l._splitByPlane(e,t,n,o,r)}}else this._splitByPlane(e,t,n,o,r)}_splitByPlane(e,t,n,o,r){let i=this.polygon;if(i){let s=iEe.measureBoundingSphere(i),a=s[3]+w9i,l=UVn.dot(e,s)-e[3];if(l>a)o.push(this);else if(l<-a)r.push(this);else{let h=B9i(e,i);switch(h.type){case 0:t.push(this);break;case 1:n.push(this);break;case 2:o.push(this);break;case 3:r.push(this);break;case 4:if(h.front){let d=this.addChild(h.front);o.push(d)}if(h.back){let d=this.addChild(h.back);r.push(d)}break}}}}addChild(e){let t=new udt(this,e);return this.children.push(t),t}invertSub(){let e=[this],t=[e],n,o,r,i;for(n=0;n<t.length;n++){e=t[n];for(o=0,r=e.length;o<r;o++){if(i=e[o],i.polygon)i.polygon=iEe.invert(i.polygon);if(i.children.length>0)t.push(i.children)}}}recursivelyInvalidatePolygon(){if(this.polygon=null,this.parent)this.parent.recursivelyInvalidatePolygon()}clear(){let e=[this],t=[e];for(let n=0;n<t.length;++n){e=t[n];let o=e.length;for(let r=0;r<o;r++){let i=e[r];if(i.polygon)i.polygon=null;if(i.parent)i.parent=null;if(i.children.length>0)t.push(i.children);i.children=[]}}}toString(){let e="",t=[this],n=[t],o,r,i,s;for(o=0;o<n.length;++o){t=n[o];let a=" ".repeat(o);for(r=0,i=t.length;r<i;r++){if(s=t[r],e+=`${a}PolygonTreeNode (${s.isRootNode()}): ${s.children.length}`,s.polygon)e+=`
 ${a}polygon: ${s.polygon.vertices}
`;else e+=`
`;if(s.children.length>0)n.push(s.children)}}return e}}WVn.exports=udt});var $Vn=pt(function(G1a,KVn){var T9i=HVn(),D9i=XVn();class jVn{constructor(e){if(this.polygonTree=new D9i,this.rootnode=new T9i(null),e)this.addPolygons(e)}invert(){this.polygonTree.invert(),this.rootnode.invert()}clipTo(e,t=!1){this.rootnode.clipTo(e,t)}allPolygons(){let e=[];return this.polygonTree.getPolygons(e),e}addPolygons(e){let t=Array(e.length);for(let n=0;n<e.length;n++)t[n]=this.polygonTree.addChild(e[n]);this.rootnode.addPolygonTreeNodes(t)}clear(){this.polygonTree.clear()}toString(){return"Tree: "+this.polygonTree.toString("")}}KVn.exports=jVn});var sEe=pt(function(U1a,qVn){qVn.exports={Tree:$Vn()}});var eYn=pt(function(W1a,ZVn){var OL=Ys(),N9i=tEe(),{Tree:JVn}=sEe(),R9i=(e,t)=>{if(!N9i(e,t))return OL.create();let n=new JVn(OL.toPolygons(e)),o=new JVn(OL.toPolygons(t));n.invert(),o.clipTo(n),o.invert(),n.clipTo(o),o.clipTo(n),n.addPolygons(o.allPolygons()),n.invert();let r=n.allPolygons();return OL.create(r)};ZVn.exports=R9i});var pdt=pt(function(X1a,tYn){var Q9i=Cs(),k9i=Nee(),L9i=eYn(),H9i=(...e)=>{e=Q9i(e);let t=e.shift();return e.forEach((n)=>{t=L9i(t,n)}),t=k9i(t),t};tYn.exports=H9i});var rYn=pt(function(j1a,oYn){var F9i=Cs(),nYn=Ys(),z9i=fT(),O9i=$Pe(),V9i=qPe(),Y9i=pdt(),G9i=(...e)=>{e=F9i(e);let t=e.map((r)=>V9i({z0:-1,z1:1},r)),n=Y9i(t),o=z9i(n);return O9i(o,nYn.toPolygons(n))};oYn.exports=G9i});var cYn=pt(function(K1a,aYn){var U9i=Cs(),W9i=Tee(),iYn=qs(),sYn=Ys(),X9i=rYn(),j9i=pdt(),K9i=(...e)=>{if(e=U9i(e),e.length===0)throw Error("wrong number of arguments");if(!W9i(e))throw Error("only intersect of the types are supported");let t=e[0];if(iYn.isA(t))return X9i(e);if(sYn.isA(t))return j9i(e);return t};aYn.exports=K9i});var aEe=pt(function($1a,hYn){var lYn=nc(),$9i=Zlt(),q9i=(e)=>$9i(e,{skipTriangulation:!0}).map((o)=>{let r=o.map((i)=>e[i]);return lYn.create(r)});hYn.exports=q9i});var mdt=pt(function(q1a,uYn){var H6=Ys(),J9i=tEe(),{Tree:dYn}=sEe(),Z9i=(e,t)=>{if(!J9i(e,t))return evi(e,t);let n=new dYn(H6.toPolygons(e)),o=new dYn(H6.toPolygons(t));n.clipTo(o,!1),o.clipTo(n),o.invert(),o.clipTo(n),o.invert();let r=n.allPolygons().concat(o.allPolygons());return H6.create(r)},evi=(e,t)=>{let n=H6.toPolygons(e);return n=n.concat(H6.toPolygons(t)),H6.create(n)};uYn.exports=Z9i});var cEe=pt(function(J1a,pYn){var tvi=Cs(),nvi=Nee(),ovi=mdt(),rvi=(...e)=>{e=tvi(e);let t;for(t=1;t<e.length;t+=2)e.push(ovi(e[t-1],e[t]));let n=e[t-1];return n=nvi(n),n};pYn.exports=rvi});var _dt=pt(function(Z1a,AYn){var ivi=Cs(),K_=Ys(),tE=nc(),svi=aEe(),avi=cEe(),cvi=(...e)=>{if(e=ivi(e),e.length!==2)throw Error("minkowskiSum requires exactly two geometries");let[t,n]=e;if(!K_.isA(t)||!K_.isA(n))throw Error("minkowskiSum requires geom3 geometries");let o=K_.isConvex(t),r=K_.isConvex(n);if(o&&r)return gYn(t,n);if(!o&&r)return mYn(t,n);if(o&&!r)return mYn(n,t);throw Error("minkowskiSum of two non-convex geometries is not yet supported")},mYn=(e,t)=>{let n=lvi(e);if(n.length===0)return K_.create();let o=n.map((r)=>gYn(r,t));if(o.length===1)return o[0];return avi(o)},lvi=(e)=>{let t=K_.toPolygons(e);if(t.length===0)return[];let n=[];for(let o=0;o<t.length;o++){let r=t[o],i=r.vertices,s=0,a=0,c=0;for(let m=0;m<i.length;m++)s+=i[m][0],a+=i[m][1],c+=i[m][2];s/=i.length,a/=i.length,c/=i.length;let l=tE.plane(r),h=l[0],d=l[1],u=l[2],_=0.1,p=[s-h*_,a-d*_,c-u*_];for(let m=1;m<i.length-1;m++){let A=i[0],g=i[m],f=i[m+1],y=hvi(p,A,g,f);n.push(K_.create(y))}}return n},hvi=(e,t,n,o)=>[tE.create([e,n,t]),tE.create([e,t,o]),tE.create([t,n,o]),tE.create([n,e,o])],gYn=(e,t)=>{let n=_Yn(e),o=_Yn(t);if(n.length===0||o.length===0)return K_.create();let r=[];for(let s=0;s<n.length;s++){let a=n[s];for(let c=0;c<o.length;c++){let l=o[c];r.push([a[0]+l[0],a[1]+l[1],a[2]+l[2]])}}let i=svi(r);return K_.create(i)},_Yn=(e)=>{let t=new Set,n=[],o=K_.toPolygons(e);for(let r=0;r<o.length;r++){let i=o[r].vertices;for(let s=0;s<i.length;s++){let a=i[s],c=`${a[0]},${a[1]},${a[2]}`;if(!t.has(c))t.add(c),n.push(a)}}return n};AYn.exports=cvi});var yYn=pt(function(eya,fYn){var Lee=di(),dvi=fT(),lEe=Ys(),uvi=(e)=>e.sort((t,n)=>t-n).filter((t,n,o)=>!n||t!==o[n-1]),pvi=(e,t,n)=>{let o=`${t}`,r=e.get(o);if(r===void 0)e.set(o,[n]);else r.push(n)},mvi=(e,t)=>{let n=`${t}`;return e.get(n)},_vi=(e)=>{let t=dvi(e),n=lEe.toPolygons(e),o=n.length,r=new Map,i=Lee.create();n.forEach((h,d)=>{h.vertices.forEach((u)=>{pvi(r,Lee.snap(i,u,t),d)})});let s=n.map((h)=>{let d=[];return h.vertices.forEach((u)=>{d=d.concat(mvi(r,Lee.snap(i,u,t)))}),{e:1,d:uvi(d)}});r.clear();let a=0,c=s.length;for(let h=0;h<c;h++){let d=s[h];if(d.e>0){let u=Array(o);u[h]=!0;do a=0,u.forEach((_,p)=>{let m=s[p];if(m.e>0){m.e=-1;for(let A=0;A<m.d.length;A++)u[m.d[A]]=!0;a++}});while(a>0);d.indexes=u}}let l=[];for(let h=0;h<c;h++)if(s[h].indexes){let d=[];s[h].indexes.forEach((u,_)=>d.push(n[_])),l.push(lEe.create(d))}return l};fYn.exports=_vi});var bYn=pt(function(tya,CYn){var gvi=Cs(),xYn=Ys(),Avi=yYn(),fvi=(...e)=>{if(e=gvi(e),e.length===0)throw Error("wrong number of arguments");let t=e.map((n)=>{if(xYn.isA(n))return Avi(n);return n});return t.length===1?t[0]:t};CYn.exports=fvi});var SYn=pt(function(nya,vYn){var VL=Ys(),yvi=tEe(),{Tree:IYn}=sEe(),xvi=(e,t)=>{if(!yvi(e,t))return VL.clone(e);let n=new IYn(VL.toPolygons(e)),o=new IYn(VL.toPolygons(t));n.invert(),n.clipTo(o),o.clipTo(n,!0),n.addPolygons(o.allPolygons()),n.invert();let r=n.allPolygons();return VL.create(r)};vYn.exports=xvi});var gdt=pt(function(oya,PYn){var Cvi=Cs(),bvi=Nee(),Ivi=SYn(),vvi=(...e)=>{e=Cvi(e);let t=e.shift();return e.forEach((n)=>{t=Ivi(t,n)}),t=bvi(t),t};PYn.exports=vvi});var wYn=pt(function(rya,MYn){var Svi=Cs(),EYn=Ys(),Pvi=fT(),Evi=$Pe(),Mvi=qPe(),wvi=gdt(),Bvi=(...e)=>{e=Svi(e);let t=e.map((r)=>Mvi({z0:-1,z1:1},r)),n=wvi(t),o=Pvi(n);return Evi(o,EYn.toPolygons(n))};MYn.exports=Bvi});var NYn=pt(function(iya,DYn){var Tvi=Cs(),Dvi=Tee(),BYn=qs(),TYn=Ys(),Nvi=wYn(),Rvi=gdt(),Qvi=(...e)=>{if(e=Tvi(e),e.length===0)throw Error("wrong number of arguments");if(!Dvi(e))throw Error("only subtract of the types are supported");let t=e[0];if(BYn.isA(t))return Nvi(e);if(TYn.isA(t))return Rvi(e);return t};DYn.exports=Qvi});var Adt=pt(function(sya,QYn){var kvi=Cs(),RYn=Ys(),Lvi=fT(),Hvi=$Pe(),Fvi=qPe(),zvi=cEe(),Ovi=(...e)=>{e=kvi(e);let t=e.map((r)=>Fvi({z0:-1,z1:1},r)),n=zvi(t),o=Lvi(n);return Hvi(o,RYn.toPolygons(n))};QYn.exports=Ovi});var hEe=pt(function(aya,HYn){var Vvi=Cs(),Yvi=Tee(),kYn=qs(),LYn=Ys(),Gvi=Adt(),Uvi=cEe(),Wvi=(...e)=>{if(e=Vvi(e),e.length===0)throw Error("wrong number of arguments");if(!Yvi(e))throw Error("only unions of the same type are supported");let t=e[0];if(kYn.isA(t))return Gvi(e);if(LYn.isA(t))return Uvi(e);return t};HYn.exports=Wvi});var zYn=pt(function(cya,FYn){FYn.exports={intersect:cYn(),minkowski:_dt(),scission:bYn(),subtract:NYn(),union:hEe()}});var Q0e=pt(function(lya,VYn){var{EPS:Xvi,TAU:jvi}=bc(),OYn=Tht(),nE=QSe(),ca=Ia(),Kvi=M0e(),$vi=(e,t)=>{let n={delta:1,corners:"edge",closed:!1,segments:16},{delta:o,corners:r,closed:i,segments:s}=Object.assign({},n,e);if(Math.abs(o)<Xvi)return t;let a=e.closed?Kvi(t):1;if(a===0)a=1;let c=a>0&&o>=0||a<0&&o<0;o=Math.abs(o);let l=null,h=[],d=[],u=ca.create(),_=t.length;for(let p=0;p<_;p++){let m=(p+1)%_,A=t[p],g=t[m];c?ca.subtract(u,A,g):ca.subtract(u,g,A),ca.normal(u,u),ca.normalize(u,u),ca.scale(u,u,o);let f=ca.add(ca.create(),A,u),y=ca.add(ca.create(),g,u),x=[f,y];if(l!=null){if(i||!i&&m!==0){let C=OYn(l[0],l[1],x[0],x[1]);if(C)h.pop(),x[0]=C;else d.push({c:A,s0:l,s1:x})}}if(l=[f,y],m===0&&!i)continue;h.push(x[0]),h.push(x[1])}if(i&&l!=null){let p=h[0],m=h[1],A=OYn(l[0],l[1],p,m);if(A)h[0]=A,h.pop();else{let g=t[0],f=[p,m];d.push({c:g,s0:l,s1:f})}}if(r==="edge"){let p=new Map;h.forEach((g,f)=>p.set(g,f));let m=nE.create(),A=nE.create();d.forEach((g)=>{nE.fromPoints(m,g.s0[0],g.s0[1]),nE.fromPoints(A,g.s1[0],g.s1[1]);let f=nE.intersectPointOfLines(m,A);if(Number.isFinite(f[0])&&Number.isFinite(f[1])){let y=g.s0[1],x=p.get(y);h[x]=f,h[(x+1)%h.length]=void 0}else{let y=g.s1[0],x=p.get(y);h[x]=void 0}}),h=h.filter((g)=>g!==void 0)}if(r==="round"){let p=Math.floor(s/4),m=ca.create();d.forEach((A)=>{let g=ca.angle(ca.subtract(m,A.s1[0],A.c));if(g-=ca.angle(ca.subtract(m,A.s0[1],A.c)),c&&g<0){if(g=g+Math.PI,g<0)g=g+Math.PI}if(!c&&g>0){if(g=g-Math.PI,g>0)g=g-Math.PI}if(g!==0){p=Math.floor(s*(Math.abs(g)/jvi));let f=g/p,y=ca.angle(ca.subtract(m,A.s0[1],A.c)),x=[];for(let C=1;C<p;C++){let b=y+f*C,I=ca.fromAngleRadians(ca.create(),b);ca.scale(I,I,o),ca.add(I,I,A.c),x.push(I)}if(x.length>0){let C=A.s0[1],b=h.findIndex((I)=>ca.equals(C,I));b=(b+1)%h.length,h.splice(b,0,...x)}}else{let f=A.s1[0],y=h.findIndex((x)=>ca.equals(f,x));h.splice(y,1)}})}return h};VYn.exports=$vi});var GYn=pt(function(hya,YYn){var YL=qs(),qvi=Q0e(),Jvi=(e,t)=>{let n={delta:1,corners:"edge",segments:16},{delta:o,corners:r,segments:i}=Object.assign({},n,e);if(!(r==="edge"||r==="chamfer"||r==="round"))throw Error('corners must be "edge", "chamfer", or "round"');let c=YL.toOutlines(t).map((l)=>(e={delta:o,corners:r,closed:!0,segments:i},qvi(e,l))).reduce((l,h)=>l.concat(YL.toSides(YL.fromPoints(h))),[]);return YL.create(c)};YYn.exports=Jvi});var jYn=pt(function(dya,XYn){var dEe=ld(),UYn=di(),WYn=Ys(),oE=nc(),Zvi=(e,t)=>{if(UYn.dot(oE.plane(t),e)>0)t=oE.invert(t);let o=[t],r=oE.transform(dEe.fromTranslation(dEe.create(),e),t),i=t.vertices.length;for(let s=0;s<i;s++){let a=s<i-1?s+1:0,c=oE.create([t.vertices[s],r.vertices[s],r.vertices[a],t.vertices[a]]);o.push(c)}return o.push(oE.invert(r)),WYn.create(o)};XYn.exports=Zvi});var $Yn=pt(function(uya,KYn){var{EPS:e8i,TAU:fdt}=bc(),uEe=ld(),ji=di(),t8i=hdt(),Hee=Ys(),e4=nc(),n8i=$ht(),o8i=Nee(),ydt=mdt(),r8i=jYn(),i8i=(e,t,n)=>{let o=t.toString();if(!e.has(o)){let r=[t,[n]];e.set(o,r)}else e.get(o)[1].push(n)},s8i=(e,t,n)=>{let o=t[0].toString(),r=t[1].toString(),i=o<r?`${o},${r}`:`${r},${o}`;if(!e.has(i)){let s=[t,[n]];e.set(i,s)}else e.get(i)[1].push(n)},xdt=(e,t)=>{if(e.findIndex((o)=>o===t)<0)e.push(t)},a8i=(e,t)=>{let n={delta:1,segments:12},{delta:o,segments:r}=Object.assign({},n,e),i=Hee.create(),s=new Map,a=new Map,c=ji.create(),l=ji.create();return Hee.toPolygons(t).forEach((d,u)=>{let _=ji.scale(ji.create(),e4.plane(d),2*o),p=e4.transform(uEe.fromTranslation(uEe.create(),ji.scale(ji.create(),_,-0.5)),d),m=r8i(_,p);i=ydt(i,m);let A=d.vertices;for(let g=0;g<A.length;g++){i8i(s,A[g],e4.plane(d));let f=(g+1)%A.length,y=[A[g],A[f]];s8i(a,y,e4.plane(d))}}),a.forEach((d)=>{let u=d[0],_=d[1],p=u[0],m=u[1],A=ji.subtract(ji.create(),m,p);ji.normalize(A,A);let g=_[0],f=ji.cross(ji.create(),g,A),y=[];for(let B=0;B<r;B++)xdt(y,B*fdt/r);for(let B=0,T=_.length;B<T;B++){let N=_[B],D=ji.dot(f,N),L=ji.dot(g,N),H=Math.atan2(D,L);if(H<0)H+=fdt;if(xdt(y,H),H=Math.atan2(-D,-L),H<0)H+=fdt;xdt(y,H)}y=y.sort(t8i);let x=y.length,C,b,I=[],v=[],P=[];for(let B=-1;B<x;B++){let T=y[B<0?B+x:B],N=Math.sin(T),D=Math.cos(T);ji.scale(c,g,D*o),ji.scale(l,f,N*o),ji.add(c,c,l);let L=ji.add(ji.create(),p,c),H=ji.add(ji.create(),m,c),V=!1;if(B>=0){if(ji.distance(L,C)<e8i)V=!0}if(!V){if(B>=0){I.push(L),v.push(H);let U=e4.create([b,H,L,C]);P.push(U)}C=L,b=H}}v.reverse(),P.push(e4.create(I)),P.push(e4.create(v));let M=Hee.create(P);i=ydt(i,M)}),s.forEach((d)=>{let u=d[0],_=d[1],p=_[0],m=null,A=0;for(let x=1;x<_.length;x++){let C=_[x],b=ji.cross(c,p,C),I=ji.length(b);if(I>0.05){if(I>A)A=I,m=C}}if(!m)m=ji.orthogonal(c,p);let g=ji.cross(c,p,m);ji.normalize(g,g);let f=ji.cross(l,g,p),y=n8i({center:[u[0],u[1],u[2]],radius:o,segments:r,axes:[p,g,f]});i=ydt(i,y)}),o8i(i)};KYn.exports=a8i});var ZYn=pt(function(pya,JYn){var qYn=Ys(),c8i=hEe(),l8i=$Yn(),h8i=(e,t)=>{let n={delta:1,corners:"round",segments:12},{delta:o,corners:r,segments:i}=Object.assign({},n,e);if(r!=="round")throw Error('corners must be "round" for 3D geometries');if(qYn.toPolygons(t).length===0)throw Error("the given geometry cannot be empty");e={delta:o,corners:r,segments:i};let a=l8i(e,t);return c8i(t,a)};JYn.exports=h8i});var nGn=pt(function(mya,tGn){var d8i=M0e(),Dd=Ia(),F6=qs(),rE=Wh(),eGn=Q0e(),u8i=(e)=>{let{external:t,internal:n}=e;if(d8i(t)<0)t=t.reverse();else n=n.reverse();let o=rE.fromPoints({closed:!0},t),r=rE.fromPoints({closed:!0},n),i=F6.toSides(F6.fromPoints(rE.toPoints(o))),s=F6.toSides(F6.fromPoints(rE.toPoints(r)));return i.push(...s),F6.create(i)},p8i=(e,t,n,o)=>{let{points:r,external:i,internal:s}=e,a=Math.floor(t/2),c=[],l=[];if(n==="round"&&a>0){let d=Math.PI/a,u=r[r.length-1],_=Dd.angle(Dd.subtract(Dd.create(),i[i.length-1],u)),p=r[0],m=Dd.angle(Dd.subtract(Dd.create(),s[0],p));for(let A=1;A<a;A++){let g=_+d*A,f=Dd.fromAngleRadians(Dd.create(),g);Dd.scale(f,f,o),Dd.add(f,f,u),c.push(f),g=m+d*A,f=Dd.fromAngleRadians(Dd.create(),g),Dd.scale(f,f,o),Dd.add(f,f,p),l.push(f)}}let h=[];return h.push(...i,...c,...s.reverse(),...l),F6.fromPoints(h)},m8i=(e,t)=>{e=Object.assign({},{delta:1,corners:"edge",segments:16},e);let{delta:o,corners:r,segments:i}=e;if(o<=0)throw Error("the given delta must be positive for paths");if(!(r==="edge"||r==="chamfer"||r==="round"))throw Error('corners must be "edge", "chamfer", or "round"');let s=t.isClosed,a=rE.toPoints(t);if(a.length===0)throw Error("the given geometry cannot be empty");let c={points:a,external:eGn({delta:o,corners:r,segments:i,closed:s},a),internal:eGn({delta:-o,corners:r,segments:i,closed:s},a)};if(t.isClosed)return u8i(c);else return p8i(c,i,r,o)};tGn.exports=m8i});var pEe=pt(function(_ya,sGn){var _8i=Cs(),oGn=qs(),rGn=Ys(),iGn=Wh(),g8i=GYn(),A8i=ZYn(),f8i=nGn(),y8i=(e,...t)=>{if(t=_8i(t),t.length===0)throw Error("wrong number of arguments");let n=t.map((o)=>{if(iGn.isA(o))return f8i(e,o);if(oGn.isA(o))return g8i(e,o);if(rGn.isA(o))return A8i(e,o);return o});return n.length===1?n[0]:n};sGn.exports=y8i});var cGn=pt(function(gya,aGn){var GL=qs(),mEe=ESe(),x8i=Q0e(),C8i=(e,t)=>{let n={delta:1,corners:"edge",segments:0},{delta:o,corners:r,segments:i}=Object.assign({},n,e);if(!(r==="edge"||r==="chamfer"||r==="round"))throw Error('corners must be "edge", "chamfer", or "round"');let s=GL.toOutlines(t),c=s.map((l)=>(e={delta:s.reduce((u,_)=>u+mEe.arePointsInside(l,mEe.create(_)),0)%2===0?o:-o,corners:r,closed:!0,segments:i},x8i(e,l))).reduce((l,h)=>l.concat(GL.toSides(GL.fromPoints(h))),[]);return GL.create(c)};aGn.exports=C8i});var hGn=pt(function(Aya,lGn){var _Ee=Wh(),b8i=Q0e(),I8i=(e,t)=>{let n={delta:1,corners:"edge",closed:t.isClosed,segments:16},{delta:o,corners:r,closed:i,segments:s}=Object.assign({},n,e);if(!(r==="edge"||r==="chamfer"||r==="round"))throw Error('corners must be "edge", "chamfer", or "round"');e={delta:o,corners:r,closed:i,segments:s};let a=b8i(e,_Ee.toPoints(t));return _Ee.fromPoints({closed:i},a)};lGn.exports=I8i});var mGn=pt(function(fya,pGn){var v8i=Cs(),dGn=qs(),uGn=Wh(),S8i=cGn(),P8i=hGn(),E8i=(e,...t)=>{if(t=v8i(t),t.length===0)throw Error("wrong number of arguments");let n=t.map((o)=>{if(uGn.isA(o))return P8i(e,o);if(dGn.isA(o))return S8i(e,o);return o});return n.length===1?n[0]:n};pGn.exports=E8i});var gGn=pt(function(yya,_Gn){_Gn.exports={expand:pEe(),offset:mGn()}});var k0e=pt(function(xya,fGn){var iE=ld(),Fee=di(),AGn=qs(),zee=VG(),M8i=R0e(),w8i=(e,t)=>{let n={offset:[0,0,1],twistAngle:0,twistSteps:12,repair:!0},{offset:o,twistAngle:r,twistSteps:i,repair:s}=Object.assign({},n,e);if(i<1)throw Error("twistSteps must be 1 or more");if(r===0)i=1;let a=Fee.clone(o),c=AGn.toSides(t);if(c.length===0)throw Error("the given geometry cannot be empty");let l=zee.fromSides(c);if(a[2]<0)zee.reverse(l,l);let h=iE.create(),d=(u,_,p)=>{let m=_/i*r,A=Fee.scale(Fee.create(),a,_/i);return iE.multiply(h,iE.fromZRotation(h,m),iE.fromTranslation(iE.create(),A)),zee.transform(h,p)};return e={numberOfSlices:i+1,capStart:!0,capEnd:!0,repair:s,callback:d},M8i(e,l)};fGn.exports=w8i});var bGn=pt(function(Cya,CGn){var yGn=qs(),xGn=Wh(),B8i=k0e(),T8i=(e,t)=>{if(!t.isClosed)throw Error("extruded path must be closed");let n=xGn.toPoints(t),o=yGn.fromPoints(n);return B8i(e,o)};CGn.exports=T8i});var PGn=pt(function(bya,SGn){var D8i=Cs(),IGn=qs(),vGn=Wh(),N8i=k0e(),R8i=bGn(),Q8i=(e,...t)=>{let n={height:1,twistAngle:0,twistSteps:1,repair:!0},{height:o,twistAngle:r,twistSteps:i,repair:s}=Object.assign({},n,e);if(t=D8i(t),t.length===0)throw Error("wrong number of arguments");e={offset:[0,0,o],twistAngle:r,twistSteps:i,repair:s};let a=t.map((c)=>{if(vGn.isA(c))return R8i(e,c);if(IGn.isA(c))return N8i(e,c);return c});return a.length===1?a[0]:a};SGn.exports=Q8i});var wGn=pt(function(Iya,MGn){var EGn=Wh(),k8i=pEe(),L8i=k0e(),H8i=(e,t)=>{let n={size:1,height:1},{size:o,height:r}=Object.assign({},n,e);if(e.delta=o,e.offset=[0,0,r],EGn.toPoints(t).length===0)throw Error("the given geometry cannot be empty");let s=k8i(e,t);return L8i(e,s)};MGn.exports=H8i});var DGn=pt(function(vya,TGn){var{area:F8i}=gee(),Oee=qs(),BGn=Wh(),z8i=pEe(),O8i=k0e(),V8i=(e,t)=>{let n={size:1,height:1},{size:o,height:r}=Object.assign({},n,e);e.delta=o,e.offset=[0,0,r];let i=Oee.toOutlines(t);if(i.length===0)throw Error("the given geometry cannot be empty");let a=i.map((l)=>{if(F8i(l)<0)l.reverse();return z8i(e,BGn.fromPoints({closed:!0},l))}).reduce((l,h)=>l.concat(Oee.toSides(h)),[]),c=Oee.create(a);return O8i(e,c)};TGn.exports=V8i});var kGn=pt(function(Sya,QGn){var Y8i=Cs(),NGn=qs(),RGn=Wh(),G8i=wGn(),U8i=DGn(),W8i=(e,...t)=>{let n={size:1,height:1},{size:o,height:r}=Object.assign({},n,e);if(t=Y8i(t),t.length===0)throw Error("wrong number of arguments");if(o<=0)throw Error("size must be positive");if(r<=0)throw Error("height must be positive");let i=t.map((s)=>{if(RGn.isA(s))return G8i(e,s);if(NGn.isA(s))return U8i(e,s);return s});return i.length===1?i[0]:i};QGn.exports=W8i});var FGn=pt(function(Pya,HGn){var{TAU:L0e}=bc(),$_=ld(),LGn=qs(),X8i=R0e(),Vee=VG(),j8i=(e,t)=>{let n={angle:L0e,startAngle:0,pitch:10,height:0,endOffset:0,segmentsPerRotation:32},{angle:o,startAngle:r,pitch:i,height:s,endOffset:a,segmentsPerRotation:c}=Object.assign({},n,e);if(s!=0)i=s/(o/L0e);if(c<3)throw Error("The number of segments per rotation needs to be at least 3.");let h=LGn.toSides(t);if(h.length===0)throw Error("The given geometry cannot be empty");let d=h.filter((f)=>f[0][0]>=0),u=Vee.fromSides(h);if(d.length===0)u=Vee.reverse(u);let _=Math.round(c/L0e*Math.abs(o)),p=_>=2?_:2,m=$_.create(),A=$_.create(),g=(f,y,x)=>{let C=r+o/p*y,b=a/p*y,I=(C-r)/L0e*i;return $_.multiply(m,$_.fromTranslation($_.create(),[b,0,I*Math.sign(o)]),$_.fromXRotation($_.create(),-L0e/4*Math.sign(o))),$_.multiply(A,$_.fromZRotation($_.create(),C),m),Vee.transform(A,x)};return X8i({numberOfSlices:p+1,callback:g},u)};HGn.exports=j8i});var VGn=pt(function(Eya,OGn){var K8i=Cs(),zGn=DSe(),Yee=Hv(),gEe=ld(),AEe=qs(),fEe=Ys(),z6=nc(),$8i=fT(),q8i=Adt(),J8i=(e,t)=>{let n=Yee.fromNormalAndPoint(Yee.create(),e.axis,e.origin);if(Number.isNaN(n[0])||Number.isNaN(n[1])||Number.isNaN(n[2])||Number.isNaN(n[3]))throw Error("project: invalid axis or origin");let o=$8i(t),r=o*o*Math.sqrt(3)/4;if(o===0)return AEe.create();let i=fEe.toPolygons(t),s=[];for(let c=0;c<i.length;c++){let l=i[c].vertices.map((u)=>Yee.projectionOfPoint(n,u)),h=z6.create(l),d=z6.plane(h);if(!zGn(n,d))continue;if(z6.measureArea(h)<r)continue;s.push(h)}if(!zGn(n,[0,0,1])){let c=gEe.fromVectorRotation(gEe.create(),n,[0,0,1]);s=s.map((l)=>z6.transform(c,l))}s=s.sort((c,l)=>z6.measureArea(l)-z6.measureArea(c));let a=s.map((c)=>AEe.fromPoints(c.vertices));return q8i(a)},Z8i=(e,...t)=>{let n={axis:[0,0,1],origin:[0,0,0]},{axis:o,origin:r}=Object.assign({},n,e);if(t=K8i(t),t.length===0)throw Error("wrong number of arguments");e={axis:o,origin:r};let i=t.map((s)=>{if(fEe.isA(s))return J8i(e,s);return s});return i.length===1?i[0]:i};OGn.exports=Z8i});var GGn=pt(function(Mya,YGn){YGn.exports={extrudeFromSlices:R0e(),extrudeLinear:PGn(),extrudeRectangular:kGn(),extrudeRotate:rdt(),extrudeHelical:FGn(),project:VGn(),slice:VG()}});var xEe=pt(function(wya,UGn){var yEe=Ia(),e7i=(e)=>{let t=yEe.fromValues(1/0,1/0);e.forEach((r)=>{if(r[1]<t[1]||r[1]===t[1]&&r[0]<t[0])t=r});let n=[];e.forEach((r)=>{let i=n7i(r[1]-t[1],r[0]-t[0]),s=yEe.squaredDistance(r,t);n.push({point:r,angle:i,distSq:s})}),n.sort((r,i)=>r.angle!==i.angle?r.angle-i.angle:r.distSq-i.distSq);let o=[];return n.forEach((r)=>{let i=o.length;while(i>1&&t7i(o[i-2],o[i-1],r.point)<=Number.EPSILON)o.pop(),i=o.length;o.push(r.point)}),o},t7i=(e,t,n)=>(t[0]-e[0])*(n[1]-e[1])-(t[1]-e[1])*(n[0]-e[0]),n7i=(e,t)=>{if(e===0&&t===0)return-1/0;else return-t/e};UGn.exports=e7i});var vEe=pt(function(Bya,WGn){var CEe=qs(),bEe=Ys(),IEe=Wh(),o7i=(e)=>{let t=new Set,n=[],o=(r)=>{let i=r.toString();if(!t.has(i))n.push(r),t.add(i)};return e.forEach((r)=>{if(CEe.isA(r))CEe.toPoints(r).forEach(o);else if(bEe.isA(r))bEe.toPoints(r).forEach((i)=>i.forEach(o));else if(IEe.isA(r))IEe.toPoints(r).forEach(o)}),n};WGn.exports=o7i});var KGn=pt(function(Tya,jGn){var r7i=Cs(),XGn=Wh(),i7i=xEe(),s7i=vEe(),a7i=(...e)=>{e=r7i(e);let t=s7i(e),n=i7i(t);return XGn.fromPoints({closed:!0},n)};jGn.exports=a7i});var qGn=pt(function(Dya,$Gn){var c7i=Cs(),SEe=qs(),l7i=xEe(),h7i=vEe(),d7i=(...e)=>{e=c7i(e);let t=h7i(e),n=l7i(t);if(n.length<3)return SEe.create();return SEe.fromPoints(n)};$Gn.exports=d7i});var ZGn=pt(function(Nya,JGn){var u7i=Cs(),PEe=Ys(),p7i=vEe(),m7i=aEe(),_7i=(...e)=>{e=u7i(e);let t=p7i(e);if(t.length===0)return PEe.create();return PEe.create(m7i(t))};JGn.exports=_7i});var Cdt=pt(function(Rya,oUn){var g7i=Cs(),A7i=Tee(),eUn=qs(),tUn=Ys(),nUn=Wh(),f7i=KGn(),y7i=qGn(),x7i=ZGn(),C7i=(...e)=>{if(e=g7i(e),e.length===0)throw Error("wrong number of arguments");if(!A7i(e))throw Error("only hulls of the same type are supported");let t=e[0];if(nUn.isA(t))return f7i(e);if(eUn.isA(t))return y7i(e);if(tUn.isA(t))return x7i(e);return t};oUn.exports=C7i});var iUn=pt(function(Qya,rUn){var b7i=Cs(),I7i=hEe(),v7i=Cdt(),S7i=(...e)=>{if(e=b7i(e),e.length<2)throw Error("wrong number of arguments");let t=[];for(let n=1;n<e.length;n++)t.push(v7i(e[n-1],e[n]));return I7i(t)};rUn.exports=S7i});var aUn=pt(function(kya,sUn){sUn.exports={hull:Cdt(),hullChain:iUn(),hullPoints2:xEe(),hullPoints3:aEe()}});var lUn=pt(function(Lya,cUn){cUn.exports={minkowskiSum:_dt()}});var bdt=pt(function(Hya,hUn){var Gee=di(),EEe=nc(),P7i=(e,t)=>{let n=Math.abs(EEe.measureArea(t));return Number.isFinite(n)&&n>e},E7i=(e,t)=>{let n=t.map((r)=>{let i=r.vertices.map((c)=>Gee.snap(Gee.create(),c,e)),s=[];for(let c=0;c<i.length;c++){let l=(c+1)%i.length;if(!Gee.equals(i[c],i[l]))s.push(i[c])}let a=EEe.create(s);if(r.color)a.color=r.color;return a}),o=e*e*Math.sqrt(3)/4;return n=n.filter((r)=>P7i(o,r)),n};hUn.exports=E7i});var pUn=pt(function(Fya,uUn){var M7i=DSe(),O6=di(),UL=nc(),w7i=(e)=>{let t=UL.toPoints(e),n=[];for(let o=0;o<t.length;o++){let r=(o+1)%t.length,i={v1:t[o],v2:t[r]};n.push(i)}for(let o=0;o<n.length;o++){let r=(o+1)%t.length;n[o].next=n[r],n[r].prev=n[o]}return n},B7i=(e,t)=>{let n=`${t.v1}:${t.v2}`;e.set(n,t)},Idt=(e,t)=>{let n=`${t.v1}:${t.v2}`;e.delete(n)},T7i=(e,t)=>{let n=`${t.v2}:${t.v1}`;return e.get(n)},D7i=(e,t,n)=>{let o=e.prev.v1,r=e.prev.v2,i=t.next.v2,s=dUn(o,r,i,n);o=t.prev.v1,r=t.prev.v2,i=e.next.v2;let a=dUn(o,r,i,n);return[s,a]},N7i=O6.create(),R7i=O6.create(),dUn=(e,t,n,o)=>{let r=O6.subtract(N7i,t,e),i=O6.subtract(R7i,n,t);return O6.cross(r,r,i),O6.dot(r,o)},Q7i=(e)=>{let t,n=[];while(e.next){let o=e.next;n.push(e.v1),e.v1=null,e.v2=null,e.next=null,e.prev=null,e=o}if(n.length>0)t=UL.create(n);return t},k7i=(e)=>{if(e.length<2)return e;let t=e[0].plane,n=e.slice(),o=new Map;while(n.length>0){let i=n.shift(),s=w7i(i);for(let a=0;a<s.length;a++){let c=s[a],l=T7i(o,c);if(l){let h=D7i(c,l,t);if(h[0]>=0&&h[1]>=0){let d=l.next,u=c.next;c.prev.next=l.next,c.next.prev=l.prev,l.prev.next=c.next,l.next.prev=c.prev,c.v1=null,c.v2=null,c.next=null,c.prev=null,Idt(o,l),l.v1=null,l.v2=null,l.next=null,l.prev=null;let _=(p,m,A)=>{let g={v1:A.v1,v2:m.v2,next:m.next,prev:A.prev};A.prev.next=g,m.next.prev=g,Idt(p,m),m.v1=null,m.v2=null,m.next=null,m.prev=null,Idt(p,A),A.v1=null,A.v2=null,A.next=null,A.prev=null};if(h[0]===0)_(o,d,d.prev);if(h[1]===0)_(o,u,u.prev)}}else if(c.next)B7i(o,c)}}let r=[];return o.forEach((i)=>{let s=Q7i(i);if(s)r.push(s)}),o.clear(),r},L7i=(e,t)=>{if(Math.abs(e[3]-t[3])<0.00000015)return M7i(e,t);return!1},H7i=(e,t)=>{let n=[];t.forEach((r)=>{let i=n.find((s)=>L7i(s[0],UL.plane(r)));if(i)i[1].push(r);else n.push([UL.plane(r),[r]])});let o=[];return n.forEach((r)=>{let i=r[1],s=k7i(i);o=o.concat(s)}),o};uUn.exports=H7i});var AUn=pt(function(zya,gUn){var wEe=bc(),q_=di(),_Un=nc(),F1=(e)=>`${e}`,mUn=(e,t,n,o,r,i)=>{let s=F1(o),a=F1(r),c=`${s}/${a}`,l=`${a}/${s}`;if(e.has(l))return MEe(e,t,n,r,o,null),null;let h={vertex0:o,vertex1:r,polygonindex:i};if(!e.has(c))e.set(c,[h]);else e.get(c).push(h);if(t.has(s))t.get(s).push(c);else t.set(s,[c]);if(n.has(a))n.get(a).push(c);else n.set(a,[c]);return c},MEe=(e,t,n,o,r,i)=>{let s=F1(o),a=F1(r),c=`${s}/${a}`,l=-1,h=e.get(c);for(let d=0;d<h.length;d++){let u=h[d],_=F1(u.vertex0);if(_!==s)continue;if(_=F1(u.vertex1),_!==a)continue;if(i!==null){if(u.polygonindex!==i)continue}l=d;break}if(h.splice(l,1),h.length===0)e.delete(c);if(l=t.get(s).indexOf(c),t.get(s).splice(l,1),t.get(s).length===0)t.delete(s);if(l=n.get(a).indexOf(c),n.get(a).splice(l,1),n.get(a).length===0)n.delete(a)},F7i=(e)=>{let t=new Map;for(let n=0;n<e.length;n++){let o=e[n],r=o.vertices.length;if(r>=3){let i=o.vertices[0],s=F1(i);for(let a=0;a<r;a++){let c=a+1;if(c===r)c=0;let l=o.vertices[c],h=F1(l),d=`${s}/${h}`,u=`${h}/${s}`;if(t.has(u)){let _=t.get(u);if(_.splice(-1,1),_.length===0)t.delete(u)}else{let _={vertex0:i,vertex1:l,polygonindex:n};if(!t.has(d))t.set(d,[_]);else t.get(d).push(_)}i=l,s=h}}else console.warn("warning: invalid polygon found during insertTjunctions")}if(t.size>0){let n=new Map,o=new Map,r=new Map;for(let[s,a]of t)r.set(s,!0),a.forEach((c)=>{let l=F1(c.vertex0),h=F1(c.vertex1);if(n.has(l))n.get(l).push(s);else n.set(l,[s]);if(o.has(h))o.get(h).push(s);else o.set(h,[s])});let i=e.slice(0);while(!0){if(t.size===0)break;for(let a of t.keys())r.set(a,!0);let s=!1;while(!0){let a=Array.from(r.keys());if(a.length===0)break;let c=a[0],l=!0;if(t.has(c)){let d=t.get(c)[0];for(let u=0;u<2;u++){let _=u===0?d.vertex0:d.vertex1,p=u===0?d.vertex1:d.vertex0,m=F1(_),A=F1(p),g=[];if(u===0){if(o.has(m))g=o.get(m)}else if(n.has(m))g=n.get(m);for(let f=0;f<g.length;f++){let y=g[f],x=t.get(y)[0],C=u===0?x.vertex0:x.vertex1,b=u===0?x.vertex1:x.vertex0,I=F1(C),v=F1(b);if(I===A){MEe(t,n,o,_,p,null),MEe(t,n,o,p,_,null),l=!1,u=2,s=!0;break}else{let P=_,M=p,B=C,T=q_.subtract(q_.create(),B,P),N=q_.dot(q_.subtract(q_.create(),M,P),T)/q_.dot(T,T);if(N>0&&N<1){let D=q_.scale(q_.create(),T,N);if(q_.add(D,D,P),q_.squaredDistance(D,M)<wEe.EPS*wEe.EPS){let H=x.polygonindex,V=i[H],O=F1(x.vertex1),U=-1;for(let J=0;J<V.vertices.length;J++)if(F1(V.vertices[J])===O){U=J;break}let j=V.vertices.slice(0);j.splice(U,0,p);let Y=_Un.create(j);i[H]=Y,MEe(t,n,o,x.vertex0,x.vertex1,H);let X=mUn(t,n,o,x.vertex0,p,H),K=mUn(t,n,o,p,x.vertex1,H);if(X!==null)r.set(X,!0);if(K!==null)r.set(K,!0);l=!1,u=2,s=!0;break}}}}}}if(l)r.delete(c)}if(!s)break}e=i}return t.clear(),e};gUn.exports=F7i});var yUn=pt(function(Oya,fUn){var Uee=di(),Wee=nc(),z7i=(e,t,n)=>{let o=t.vertices.length;if(o>3){if(o>4){let s=[0,0,0];t.vertices.forEach((a)=>Uee.add(s,s,a)),Uee.snap(s,Uee.divide(s,s,[o,o,o]),e);for(let a=0;a<o;a++){let c=Wee.create([s,t.vertices[a],t.vertices[(a+1)%o]]);if(t.color)c.color=t.color;n.push(c)}return}let r=Wee.create([t.vertices[0],t.vertices[1],t.vertices[2]]),i=Wee.create([t.vertices[0],t.vertices[2],t.vertices[3]]);if(t.color)r.color=t.color,i.color=t.color;n.push(r,i);return}n.push(t)},O7i=(e,t)=>{let n=[];return t.forEach((o)=>{z7i(e,o,n)}),n};fUn.exports=O7i});var IUn=pt(function(Vya,bUn){var V7i=Cs(),Y7i=fT(),xUn=qs(),BEe=Ys(),CUn=Wh(),G7i=bdt(),U7i=pUn(),W7i=AUn(),X7i=yUn(),j7i=(e,t)=>t,K7i=(e,t)=>t,$7i=(e,t)=>{let n={snap:!1,simplify:!1,triangulate:!1},{snap:o,simplify:r,triangulate:i}=Object.assign({},n,e),s=Y7i(t),a=BEe.toPolygons(t);if(o)a=G7i(s,a);if(r)a=U7i(s,a);if(i)a=W7i(a),a=X7i(s,a);let c=Object.assign({},t);return c.polygons=a,c},q7i=(e,...t)=>{if(t=V7i(t),t.length===0)throw Error("wrong number of arguments");let n=t.map((o)=>{if(CUn.isA(o))return j7i(e,o);if(xUn.isA(o))return K7i(e,o);if(BEe.isA(o))return $7i(e,o);throw Error("invalid geometry")});return n.length===1?n[0]:n};bUn.exports=q7i});var SUn=pt(function(Yya,vUn){var J7i=Cs(),t4=Ia(),Xee=qs(),jee=Ys(),Kee=Wh(),vdt=fT(),Z7i=bdt(),eSi=(e)=>{let t=vdt(e),o=Kee.toPoints(e).map((r)=>t4.snap(t4.create(),r,t));return Kee.create(o)},tSi=(e)=>{let t=vdt(e),o=Xee.toSides(e).map((r)=>[t4.snap(t4.create(),r[0],t),t4.snap(t4.create(),r[1],t)]);return o=o.filter((r)=>!t4.equals(r[0],r[1])),Xee.create(o)},nSi=(e)=>{let t=vdt(e),n=jee.toPolygons(e),o=Z7i(t,n);return jee.create(o)},oSi=(...e)=>{if(e=J7i(e),e.length===0)throw Error("wrong number of arguments");let t=e.map((n)=>{if(Kee.isA(n))return eSi(n);if(Xee.isA(n))return tSi(n);if(jee.isA(n))return nSi(n);return n});return t.length===1?t[0]:t};vUn.exports=oSi});var EUn=pt(function(Gya,PUn){PUn.exports={generalize:IUn(),snap:SUn(),retessellate:Nee()}});var wUn=pt(function(Uya,MUn){var rSi=(e,t,n)=>{e=e.slice();while(e.length<n)e.push(t);return e};MUn.exports=rSi});var RUn=pt(function(Wya,NUn){var iSi=Cs(),BUn=wUn(),DUn=jSe(),{translate:sSi}=zL(),aSi=(e)=>{if(!Array.isArray(e.modes)||e.modes.length>3)throw Error("align(): modes must be an array of length <= 3");if(e.modes=BUn(e.modes,"none",3),e.modes.filter((t)=>["center","max","min","none"].includes(t)).length!==3)throw Error('align(): all modes must be one of "center", "max" or "min"');if(!Array.isArray(e.relativeTo)||e.relativeTo.length>3)throw Error("align(): relativeTo must be an array of length <= 3");if(e.relativeTo=BUn(e.relativeTo,0,3),e.relativeTo.filter((t)=>Number.isFinite(t)||t==null).length!==3)throw Error("align(): all relativeTo values must be a number, or null.");if(typeof e.grouped!=="boolean")throw Error("align(): grouped must be a boolean value.");return e},cSi=(e,t,n)=>{for(let o=0;o<3;o++)if(e[o]==null){if(t[o]==="center")e[o]=(n[0][o]+n[1][o])/2;else if(t[o]==="max")e[o]=n[1][o];else if(t[o]==="min")e[o]=n[0][o]}return e},TUn=(e,t,n)=>{let o=DUn(e),r=[0,0,0];for(let i=0;i<3;i++)if(t[i]==="center")r[i]=n[i]-(o[0][i]+o[1][i])/2;else if(t[i]==="max")r[i]=n[i]-o[1][i];else if(t[i]==="min")r[i]=n[i]-o[0][i];return sSi(r,e)},lSi=(e,...t)=>{e=Object.assign({},{modes:["center","center","min"],relativeTo:[0,0,0],grouped:!1},e),e=aSi(e);let{modes:o,relativeTo:r,grouped:i}=e;if(t=iSi(t),t.length===0)throw Error("align(): No geometries were provided to act upon");if(r.filter((s)=>s==null).length){let s=DUn(t);r=cSi(r,o,s)}if(i)t=TUn(t,o,r);else t=t.map((s)=>TUn(s,o,r));return t.length===1?t[0]:t};NUn.exports=lSi});var H0e=pt(function(Xya,HUn){var hSi=Cs(),QUn=qs(),kUn=Ys(),LUn=Wh(),dSi=BL(),{translate:uSi}=zL(),Sdt=(e,t)=>{let n={axes:[!0,!0,!0],relativeTo:[0,0,0]},{axes:o,relativeTo:r}=Object.assign({},n,e),i=dSi(t),s=[0,0,0];if(o[0])s[0]=r[0]-(i[0][0]+(i[1][0]-i[0][0])/2);if(o[1])s[1]=r[1]-(i[0][1]+(i[1][1]-i[0][1])/2);if(o[2])s[2]=r[2]-(i[0][2]+(i[1][2]-i[0][2])/2);return uSi(s,t)},TEe=(e,...t)=>{let n={axes:[!0,!0,!0],relativeTo:[0,0,0]},{axes:o,relativeTo:r}=Object.assign({},n,e);if(t=hSi(t),t.length===0)throw Error("wrong number of arguments");if(r.length!==3)throw Error("relativeTo must be an array of length 3");e={axes:o,relativeTo:r};let i=t.map((s)=>{if(LUn.isA(s))return Sdt(e,s);if(QUn.isA(s))return Sdt(e,s);if(kUn.isA(s))return Sdt(e,s);return s});return i.length===1?i[0]:i},pSi=(...e)=>TEe({axes:[!0,!1,!1]},e),mSi=(...e)=>TEe({axes:[!1,!0,!1]},e),_Si=(...e)=>TEe({axes:[!1,!1,!0]},e);HUn.exports={center:TEe,centerX:pSi,centerY:mSi,centerZ:_Si}});var F0e=pt(function(jya,FUn){var gSi=Cs(),DEe=ld(),NEe=qs(),REe=Ys(),QEe=Wh(),kEe=(e,...t)=>{if(!Array.isArray(e))throw Error("factors must be an array");if(t=gSi(t),t.length===0)throw Error("wrong number of arguments");e=e.slice();while(e.length<3)e.push(1);if(e[0]<=0||e[1]<=0||e[2]<=0)throw Error("factors must be positive");let n=DEe.fromScaling(DEe.create(),e),o=t.map((r)=>{if(QEe.isA(r))return QEe.transform(n,r);if(NEe.isA(r))return NEe.transform(n,r);if(REe.isA(r))return REe.transform(n,r);return r});return o.length===1?o[0]:o},ASi=(e,...t)=>kEe([e,1,1],t),fSi=(e,...t)=>kEe([1,e,1],t),ySi=(e,...t)=>kEe([1,1,e],t);FUn.exports={scale:kEe,scaleX:ASi,scaleY:fSi,scaleZ:ySi}});var OUn=pt(function(Kya,zUn){var xSi=Cs(),LEe=qs(),HEe=Ys(),FEe=Wh(),CSi=(e,...t)=>{if(t=xSi(t),t.length===0)throw Error("wrong number of arguments");let n=t.map((o)=>{if(FEe.isA(o))return FEe.transform(e,o);if(LEe.isA(o))return LEe.transform(e,o);if(HEe.isA(o))return HEe.transform(e,o);return o});return n.length===1?n[0]:n};zUn.exports=CSi});var YUn=pt(function($ya,VUn){VUn.exports={align:RUn(),center:H0e().center,centerX:H0e().centerX,centerY:H0e().centerY,centerZ:H0e().centerZ,mirror:See().mirror,mirrorX:See().mirrorX,mirrorY:See().mirrorY,mirrorZ:See().mirrorZ,rotate:Mee().rotate,rotateX:Mee().rotateX,rotateY:Mee().rotateY,rotateZ:Mee().rotateZ,scale:F0e().scale,scaleX:F0e().scaleX,scaleY:F0e().scaleY,scaleZ:F0e().scaleZ,transform:OUn(),translate:zL().translate,translateX:zL().translateX,translateY:zL().translateY,translateZ:zL().translateZ}});var n4=pt(function(qya,GUn){GUn.exports={colors:mLn(),curves:DLn(),geometries:MSe(),maths:$Hn(),measurements:vFn(),primitives:KOn(),text:rVn(),utils:ddt(),booleans:zYn(),expansions:gGn(),extrusions:GGn(),hulls:aUn(),minkowski:lUn(),modifiers:EUn(),transforms:YUn()}});var jXn=pt(function(lPa,XXn){var WXn=(e)=>e.reduce((t,n)=>Array.isArray(n)?t.concat(WXn(n)):t.concat(n),[]);XXn.exports=WXn});var $Xn=pt(function(hPa,KXn){var XBi=(e,t)=>e-t;KXn.exports=XBi});var JXn=pt(function(dPa,qXn){var jBi=(e)=>{if(!Array.isArray(e)||e.length===0)return;return e[0]};qXn.exports=jBi});var ejn=pt(function(uPa,ZXn){var KBi=(e,t,n)=>{let o=0,r=e.length;while(r>o){let i=Math.floor((o+r)/2),s=e[i];if(n(t,s)>0)o=i+1;else r=i}return e.splice(o,0,t),e};ZXn.exports=KBi});var njn=pt(function(pPa,tjn){var $Bi=(e,t)=>{if(!Array.isArray(e)||e.length<t)return;return e[t]};tjn.exports=$Bi});var rjn=pt(function(mPa,ojn){var qBi=(e,t,n)=>{e=e.slice();while(e.length<n)e.push(t);return e};ojn.exports=qBi});var sjn=pt(function(_Pa,ijn){var JBi=(e)=>{if(Array.isArray(e))return e;if(e===void 0||e===null)return[];return[e]};ijn.exports=JBi});var cjn=pt(function(gPa,ajn){ajn.exports={flatten:jXn(),fnNumberSort:$Xn(),head:JXn(),insertSorted:ejn(),nth:njn(),padToLength:rjn(),toArray:sjn()}});var hjn=pt(function(APa,ljn){var{geometries:yut}=n4(),ZBi=(e,t)=>{t.statusCallback&&t.statusCallback({progress:0});let n=new ArrayBuffer(4),o=new Int32Array(n,0,1),r=new Int8Array(n,0,4);if(o[0]=287454020,r[0]!==68)throw Error("Binary STL output is currently only supported on little-endian (Intel) processors");let i=0,s=0;e.forEach((A,g)=>{yut.geom3.toPolygons(A).forEach((y)=>{let x=y.vertices.length,C=x>=3?x-2:0;i+=C,s+=1})});let a=new Uint8Array(80);for(let A=0;A<80;A++)a[A]=65;let c=new Uint32Array(1);c[0]=i;let l=new ArrayBuffer(50*i),h=new Int8Array(l),d=new ArrayBuffer(50),u=new Int8Array(d),_=new Float32Array(d,0,12),p=new Uint16Array(d,48,1),m=0;return e.forEach((A)=>{yut.geom3.toPolygons(A).forEach((f,y)=>{let x=f.vertices,C=x.length,b=yut.poly3.plane(f);for(let I=0;I<C-2;I++){_[0]=b[0],_[1]=b[1],_[2]=b[2];let v=3;for(let P=0;P<3;P++){let M=P+(P>0?I:0),B=x[M];_[v++]=B[0],_[v++]=B[1],_[v++]=B[2]}p[0]=0,h.set(u,m),m+=50}t.statusCallback&&t.statusCallback({progress:100*y/s})})}),t.statusCallback&&t.statusCallback({progress:100}),[a.buffer,c.buffer,l]};ljn.exports={serializeBinary:ZBi}});var mjn=pt(function(fPa,pjn){var{geometries:djn}=n4(),eTi=(e,t)=>{t.statusCallback&&t.statusCallback({progress:0});let n=`solid JSCAD
${tTi(e,t)}
endsolid JSCAD
`;return t.statusCallback&&t.statusCallback({progress:100}),[n]},tTi=(e,t)=>{let n=[];return e.forEach((o,r)=>{n.push(nTi(o,t)),t.statusCallback&&t.statusCallback({progress:100*r/e.length})}),n.join(`
`)},nTi=(e,t)=>{let n=[];return djn.geom3.toPolygons(e).forEach((r,i)=>{n.push(oTi(r))}),n.join(`
`)},ujn=(e)=>`${e[0]} ${e[1]} ${e[2]}`,xut=(e)=>`vertex ${ujn(e)}`,oTi=(e)=>{let t=[];if(e.vertices.length>=3){let n=xut(e.vertices[0]);for(let o=0;o<e.vertices.length-2;o++){let r=`facet normal ${ujn(djn.poly3.plane(e))}
outer loop
${n}
${xut(e.vertices[o+1])}
${xut(e.vertices[o+2])}
endloop
endfacet`;t.push(r)}}return t.join(`
`)};pjn.exports={serializeText:eTi}});var gjn=pt(function(yPa,_jn){var{geometries:rTi,modifiers:iTi}=n4(),{flatten:sTi,toArray:aTi}=cjn(),{serializeBinary:cTi}=hjn(),{serializeText:lTi}=mjn(),hTi=(e,...t)=>{e=Object.assign({},{binary:!0,statusCallback:null},e),t=sTi(t);let o=t.filter((r)=>rTi.geom3.isA(r));if(o.length===0)throw Error("only 3D geometries can be serialized to STL");if(t.length!==o.length)console.warn("some objects could not be serialized to STL");return o=aTi(iTi.generalize({snap:!0,triangulate:!0},o)),e.binary?cTi(o,e):lTi(o,e)};_jn.exports={mimeType:"application/sla",serialize:hTi}});var oho=pt(function(Ges){var AC=at(ln());(function(){function e(u,_){return u===_&&(u!==0||1/u===1/_)||u!==u&&_!==_}function t(u,_){l||AC.startTransition===void 0||(l=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var p=_();if(!h){var m=_();r(p,m)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),h=!0)}m=i({inst:{value:p,getSnapshot:_}});var A=m[0].inst,g=m[1];return a(function(){A.value=p,A.getSnapshot=_,n(A)&&g({inst:A})},[u,p,_]),s(function(){return n(A)&&g({inst:A}),u(function(){n(A)&&g({inst:A})})},[u]),c(p),p}function n(u){var _=u.getSnapshot;u=u.value;try{var p=_();return!r(u,p)}catch(m){return!0}}function o(u,_){return _()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var r=typeof Object.is==="function"?Object.is:e,i=AC.useState,s=AC.useEffect,a=AC.useLayoutEffect,c=AC.useDebugValue,l=!1,h=!1,d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?o:t;Ges.useSyncExternalStore=AC.useSyncExternalStore!==void 0?AC.useSyncExternalStore:d,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var rho=pt(function(Ues){var jT=at(ln());(function(){function e(c,l){return c===l&&(c!==0||1/c===1/l)||c!==c&&l!==l}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=oho(),n=typeof Object.is==="function"?Object.is:e,o=t.useSyncExternalStore,r=jT.useRef,i=jT.useEffect,s=jT.useMemo,a=jT.useDebugValue;Ues.useSyncExternalStoreWithSelector=function(c,l,h,d,u){var _=r(null);if(_.current===null){var p={hasValue:!1,value:null};_.current=p}else p=_.current;_=s(function(){function A(C){if(!g){if(g=!0,f=C,C=d(C),u!==void 0&&p.hasValue){var b=p.value;if(u(b,C))return y=b}return y=C}if(b=y,n(f,C))return b;var I=d(C);if(u!==void 0&&u(b,I))return f=C,b;return f=C,y=I}var g=!1,f,y,x=h===void 0?null:h;return[function(){return A(l())},x===null?void 0:function(){return A(x())}]},[l,h,d,u]);var m=o(c,_[0],_[1]);return i(function(){p.hasValue=!0,p.value=m},[m]),a(m),m},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var j_t=pt(function(QQa,Cho){var hne=at(ln()),xho=at(lo()),{defineProperty:X_t,getOwnPropertyDescriptor:ats,getOwnPropertyNames:cts}=Object,lts=Object.prototype.hasOwnProperty,hts=(e,t)=>{for(var n in t)X_t(e,n,{get:t[n],enumerable:!0})},dts=(e,t,n,o)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let r of cts(t))if(!lts.call(e,r)&&r!==n)X_t(e,r,{get:()=>t[r],enumerable:!(o=ats(t,r))||o.enumerable})}return e},uts=(e)=>dts(X_t({},"__esModule",{value:!0}),e),yho={};hts(yho,{SuperGrid:()=>_ts,toMMSI:()=>mts,toMeterSI:()=>bme});Cho.exports=uts(yho);var TE=As(),fho=(e,t,n)=>{let o=[];if(t<e)for(let r=e;r>=t;r-=Math.abs(n))o.push(r);else for(let r=e;r<=t;r+=Math.abs(n))o.push(r);return o};function pts(e,t){return{x:Math.round(t.x/e)*e,y:Math.round(t.y/e)*e}}function bme(e,t=1){if(e<0)return"-"+bme(-e);if(e<0.000001)return"0m";if(e>1000)return Math.floor(e/1000)+"km";if(e>1&&t>1)return Math.round(e)+"m";if(e>1&&t<=1)return e.toFixed(Math.ceil(-Math.log10(t)))+"m";if(e<1&&t>=0.001)return Math.round(e*1000)+"mm";if(e<1&&t<0.001)return(e*1000).toFixed(Math.ceil(-Math.log10(t*1000)))+"mm";return""}function mts(e,t=1){return bme(e/1000,t/1000)}var _ts=(e)=>{var t;let n=hne.useRef(null),[o,r]=hne.useState({x:0,y:0}),{majorColor:i="rgba(0,0,0,0.2)",minorColor:s="rgba(0,0,0,0.1)",textColor:a=(t=e.majorColor)!=null?t:"rgba(0,0,0,0.5)",width:c,height:l,screenSpaceCellSize:h=200,stringifyCoord:d=(m,A,g)=>`${bme(m,g)}, ${bme(A,g)}`}=e,u=Math.ceil(c/h)+2,_=Math.ceil(l/h)+2;hne.useEffect(()=>{if(!n.current)return;let m=n.current.getContext("2d");if(!m)return;let A=h/10**Math.floor(Math.log10(e.transform.a)),g=e.transform.d<0?-1:1,y=h/10**Math.log10(e.transform.a)/A;function x(D,L,H){let V=D,O,U,j,Y;for(O=L.x;O<=H.x;O+=V)j=(0,TE.applyToPoint)(e.transform,{x:O,y:L.y}),Y=(0,TE.applyToPoint)(e.transform,{x:O,y:H.y}),m.beginPath(),m.moveTo(j.x,j.y),m.lineTo(Y.x,Y.y),m.stroke();let X=fho(L.y,H.y,V*g);for(let K of X)j=(0,TE.applyToPoint)(e.transform,{x:L.x,y:K}),Y=(0,TE.applyToPoint)(e.transform,{x:H.x,y:K}),m.beginPath(),m.moveTo(j.x,j.y),m.lineTo(Y.x,Y.y),m.stroke()}function C(D,L,H){let V=D,O,U;for(O=L.x;O<=H.x;O+=V)for(let j of fho(L.y,H.y,V*g)){let Y=(0,TE.applyToPoint)(e.transform,{x:O,y:j});m.fillStyle=a,m.font="12px sans-serif",m.fillText(d(O,j,D),Y.x+2,Y.y-2)}}m.clearRect(0,0,c,l);let b=(0,TE.applyToPoint)((0,TE.inverse)(e.transform),{x:0,y:0}),I={x:Math.floor((b.x-A)/A)*A,y:Math.floor((b.y-A)/A+(g==-1?2:0))*A},v={x:I.x+A*u,y:I.y+A*_*g},M=A*5,B={x:Math.floor((b.x-M)/M)*M,y:Math.floor((b.y-M)/M+(g==-1?2:0))*M},T={x:B.x+M*u,y:B.y+M*_*g};m.globalAlpha=1,m.strokeStyle=i,x(A,I,v),C(M,B,T),m.globalAlpha=1-y,x(M/10,B,T),m.globalAlpha=1-y,m.strokeStyle=s,x(A/10,I,v),m.globalAlpha=Math.max(((1-y)*10-5)/5,0),C(M/10,B,T),m.globalAlpha=1;let N=(0,TE.applyToPoint)(e.transform,o);m.font="12px sans-serif",m.fillStyle=a,m.fillText(d(o.x,o.y,A),N.x+2,N.y-2),m.strokeStyle=i,m.strokeRect(N.x-5,N.y-5,10,10)},[n,e.transform,o,c,l]);let p=(m)=>{if(!n.current)return;let A=h/10/10**Math.floor(Math.log10(e.transform.a)),g=n.current.getBoundingClientRect(),f=(0,TE.applyToPoint)((0,TE.inverse)(e.transform),{x:m.clientX-g.left,y:m.clientY-g.top}),y=pts(A,f);r(y)};return xho.jsx("canvas",{onMouseUp:(m)=>{if(m.button!==1)return;p(m)},onDoubleClick:p,ref:n,width:e.width,height:e.height})}});var U1e={};IX(U1e,{DocumentPosition:()=>kb,append:()=>fOo,appendChild:()=>AOo,compareDocumentPosition:()=>_wt,existsOne:()=>pwt,filter:()=>mK,find:()=>uwt,findAll:()=>bOo,findOne:()=>V1e,findOneChild:()=>COo,getAttributeValue:()=>dOo,getChildren:()=>hwt,getElementById:()=>POo,getElements:()=>SOo,getElementsByClassName:()=>EOo,getElementsByTagName:()=>TO,getElementsByTagType:()=>MOo,getFeed:()=>TOo,getInnerHTML:()=>lOo,getName:()=>pOo,getOuterHTML:()=>lwt,getParent:()=>dwt,getSiblings:()=>hOo,getText:()=>O1e,hasAttrib:()=>uOo,hasChildren:()=>p1,innerText:()=>Yze,isCDATA:()=>Fse,isComment:()=>F1e,isDocument:()=>ewt,isTag:()=>a2,isText:()=>Hw,nextElementSibling:()=>mOo,prepend:()=>xOo,prependChild:()=>yOo,prevElementSibling:()=>_Oo,removeElement:()=>Ose,removeSubsets:()=>wOo,replaceElement:()=>gOo,testElement:()=>vOo,textContent:()=>zse,uniqueSort:()=>BOo});var cE={};IX(cE,{CstParser:()=>cut,Lexer:()=>epe,createToken:()=>um});var lne={};IX(lne,{all_layers:()=>Pso,any_circuit_element:()=>eho,any_soup_element:()=>cne,any_source_component:()=>Aso,asset:()=>OBe,base_circuit_json_error:()=>Hc,battery_capacity:()=>Oio,brep_shape:()=>k_t,cadModelDefaultDirectionMap:()=>kes,cad_cable:()=>Mlo,cad_collision_error:()=>Elo,cad_component:()=>Plo,cad_model_axis_directions:()=>Slo,cad_model_formats:()=>Qes,capacitance:()=>s_t,circle_shape:()=>a_t,circuit_json_footprint_load_error:()=>$co,current:()=>AH,distance:()=>En,duration_ms:()=>ane,experiment_type:()=>Qlo,external_footprint_load_error:()=>Kco,frequency:()=>xU,getRotationBetweenPcbPin1Locations:()=>ces,getZodPrefixedIdWithDefault:()=>Tn,inductance:()=>Fio,insertionDirectionToCanonical:()=>yao,insertionDirectionToVector:()=>ses,insertion_direction:()=>xao,kicadAt:()=>VBe,kicadEffects:()=>Vio,kicadFont:()=>l_t,kicadFootprintAttributes:()=>Gio,kicadFootprintMetadata:()=>Xio,kicadFootprintModel:()=>Wio,kicadFootprintPad:()=>Uio,kicadFootprintProperties:()=>Yio,kicadProperty:()=>_me,kicadSymbolEffects:()=>$io,kicadSymbolMetadata:()=>Jio,kicadSymbolPinNames:()=>Kio,kicadSymbolPinNumbers:()=>jio,kicadSymbolProperties:()=>qio,kicadSymbolProperty:()=>gH,layer_ref:()=>ha,layer_string:()=>n_t,length:()=>qo,manufacturing_drc_properties:()=>Iao,ms:()=>hA,ninePointAnchor:()=>WT,parseAndConvertSiUnit:()=>Ta,pcbRenderLayer:()=>oes,pcb_autorouting_error:()=>Jco,pcb_bend:()=>cco,pcb_board:()=>aco,pcb_breakout_point:()=>ilo,pcb_bus_length_skew_error:()=>$ao,pcb_bus_routing_constraint_error:()=>Zao,pcb_bus_routing_constraint_warning:()=>eco,pcb_component:()=>vao,pcb_component_invalid_layer_error:()=>_lo,pcb_component_missing_courtyard_warning:()=>nlo,pcb_component_not_on_board_edge_error:()=>mlo,pcb_component_outside_board_error:()=>plo,pcb_connector_not_in_accessible_orientation_warning:()=>tlo,pcb_copper_pour:()=>ulo,pcb_copper_pour_brep:()=>hlo,pcb_copper_pour_polygon:()=>dlo,pcb_copper_pour_rect:()=>llo,pcb_copper_text:()=>bco,pcb_courtyard_circle:()=>Ilo,pcb_courtyard_outline:()=>Clo,pcb_courtyard_overlap_error:()=>Fco,pcb_courtyard_pill:()=>vlo,pcb_courtyard_polygon:()=>blo,pcb_courtyard_rect:()=>xlo,pcb_cutout:()=>Xco,pcb_cutout_circle:()=>Gco,pcb_cutout_path:()=>Wco,pcb_cutout_polygon:()=>Uco,pcb_cutout_rect:()=>Yco,pcb_debug_line:()=>Pao,pcb_debug_object:()=>Mao,pcb_debug_object_base:()=>UBe,pcb_debug_point:()=>Eao,pcb_debug_rect:()=>Sao,pcb_fabrication_note_dimension:()=>Dco,pcb_fabrication_note_path:()=>Bco,pcb_fabrication_note_rect:()=>Tco,pcb_fabrication_note_text:()=>wco,pcb_fabricator_extra_charge_warning:()=>rlo,pcb_footprint_overlap_error:()=>Hco,pcb_ground_plane:()=>slo,pcb_ground_plane_region:()=>alo,pcb_group:()=>qco,pcb_hole:()=>Qao,pcb_hole_circle_or_square_shape:()=>ues,pcb_hole_circle_shape:()=>hes,pcb_hole_oval_shape:()=>pes,pcb_hole_pill_shape:()=>mes,pcb_hole_rect_shape:()=>des,pcb_hole_rotated_pill_shape:()=>_es,pcb_keepout:()=>Oco,pcb_keepout_outline:()=>zco,pcb_keepout_overlap_warning:()=>Vco,pcb_manual_edit_conflict_warning:()=>elo,pcb_missing_footprint_error:()=>jco,pcb_net:()=>ico,pcb_note_dimension:()=>Lco,pcb_note_line:()=>kco,pcb_note_path:()=>Qco,pcb_note_rect:()=>Rco,pcb_note_text:()=>Nco,pcb_packing_error:()=>gco,pcb_pad_pad_clearance_error:()=>flo,pcb_pad_trace_clearance_error:()=>ylo,pcb_panel:()=>mco,pcb_panelization_placement_error:()=>Aco,pcb_pin1_location:()=>r_t,pcb_placement_error:()=>_co,pcb_plated_hole:()=>kao,pcb_port:()=>Lao,pcb_port_not_connected_error:()=>rco,pcb_port_not_matched_error:()=>oco,pcb_preflight_routing_error:()=>Zco,pcb_route_hint:()=>Cao,pcb_route_hints:()=>les,pcb_silkscreen_circle:()=>vco,pcb_silkscreen_graphic:()=>Eco,pcb_silkscreen_graphic_brep:()=>Pco,pcb_silkscreen_line:()=>yco,pcb_silkscreen_oval:()=>Sco,pcb_silkscreen_path:()=>xco,pcb_silkscreen_pill:()=>Mco,pcb_silkscreen_rect:()=>Ico,pcb_silkscreen_text:()=>Cco,pcb_smtpad:()=>Fao,pcb_smtpad_pill:()=>Hao,pcb_solder_paste:()=>zao,pcb_soldermask_opening:()=>Oao,pcb_stiffener:()=>pco,pcb_stiffener_polygon:()=>uco,pcb_stiffener_rect:()=>dco,pcb_text:()=>Vao,pcb_thermal_spoke:()=>clo,pcb_trace:()=>Xao,pcb_trace_error:()=>tco,pcb_trace_hint:()=>fco,pcb_trace_missing_error:()=>nco,pcb_trace_route_point:()=>Wao,pcb_trace_route_point_through_pad:()=>Uao,pcb_trace_route_point_via:()=>Gao,pcb_trace_route_point_wire:()=>Yao,pcb_trace_too_long_error:()=>Kao,pcb_trace_too_long_warning:()=>qao,pcb_trace_too_many_vias_warning:()=>Jao,pcb_trace_warning:()=>jao,pcb_via:()=>sco,pcb_via_clearance_error:()=>glo,pcb_via_trace_clearance_error:()=>Alo,point:()=>mr,point3:()=>BE,point_with_bulge:()=>fao,polygon_shape:()=>gme,port_arrangement:()=>Yso,position:()=>ZZi,position3:()=>ees,rect_shape:()=>zBe,resistance:()=>HBe,ring:()=>o_t,rotated_rect_shape:()=>c_t,rotation:()=>dd,route_hint_point:()=>bao,schematic_arc:()=>Kso,schematic_box:()=>Hso,schematic_circle:()=>jso,schematic_component:()=>Gso,schematic_component_overlap_warning:()=>cao,schematic_component_port_arrangement_by_sides:()=>Vso,schematic_component_port_arrangement_by_size:()=>Oso,schematic_component_styling_warning:()=>lao,schematic_debug_line:()=>oao,schematic_debug_object:()=>iao,schematic_debug_object_base:()=>GBe,schematic_debug_point:()=>rao,schematic_debug_rect:()=>nao,schematic_element_outside_sheet_warning:()=>hao,schematic_error:()=>eao,schematic_graphic:()=>dao,schematic_group:()=>uao,schematic_layout_error:()=>tao,schematic_line:()=>Wso,schematic_manual_edit_conflict_warning:()=>aao,schematic_missing_sheet_warning:()=>Aao,schematic_net_label:()=>Zso,schematic_path:()=>Fso,schematic_pin_styles:()=>zso,schematic_port:()=>Jso,schematic_rect:()=>Xso,schematic_sheet:()=>gao,schematic_sheet_size:()=>_ao,schematic_symbol:()=>Uso,schematic_table:()=>pao,schematic_table_cell:()=>mao,schematic_text:()=>qso,schematic_text_part:()=>Q_t,schematic_trace:()=>$so,schematic_voltage_probe:()=>sao,simulation_ac_current_source:()=>Nlo,simulation_ac_sweep_current_graph:()=>$lo,simulation_ac_sweep_voltage_graph:()=>Klo,simulation_ac_voltage_source:()=>Blo,simulation_complex_sample:()=>z_t,simulation_current_probe:()=>Vlo,simulation_current_source:()=>Rlo,simulation_dc_current_source:()=>Dlo,simulation_dc_operating_point_current:()=>Wlo,simulation_dc_operating_point_voltage:()=>Ulo,simulation_dc_sweep_current_graph:()=>jlo,simulation_dc_sweep_unit:()=>XBe,simulation_dc_sweep_voltage_graph:()=>Xlo,simulation_dc_voltage_source:()=>wlo,simulation_experiment:()=>Llo,simulation_op_amp:()=>qlo,simulation_oscilloscope_trace:()=>Zlo,simulation_parameter_sweep:()=>Glo,simulation_parameter_sweep_coordinate:()=>XT,simulation_parameter_type:()=>Fes,simulation_parameter_unit:()=>F_t,simulation_spice_subcircuit:()=>Jlo,simulation_switch:()=>zlo,simulation_transient_current_graph:()=>Flo,simulation_transient_voltage_graph:()=>Hlo,simulation_unknown_experiment_error:()=>Ylo,simulation_voltage_probe:()=>Olo,simulation_voltage_source:()=>Tlo,size:()=>FBe,source_ambiguous_port_reference:()=>vso,source_board:()=>Iso,source_bus:()=>kso,source_component_base:()=>Ph,source_component_internal_connection:()=>yso,source_component_misconfigured_error:()=>R_t,source_component_pins_underspecified_warning:()=>Tso,source_confusing_net_name_warning:()=>Qso,source_failed_to_create_component_error:()=>uso,source_group:()=>Cso,source_i2c_misconfigured_error:()=>N_t,source_interconnect:()=>_so,source_invalid_component_property_error:()=>M_t,source_manually_placed_via:()=>Eso,source_missing_manufacturer_part_number_warning:()=>T_t,source_missing_property_error:()=>dso,source_motor:()=>oso,source_net:()=>bso,source_no_ground_pin_defined_warning:()=>Bso,source_no_power_pin_defined_warning:()=>wso,source_part_not_found_warning:()=>Rso,source_pcb_ground_plane:()=>Sso,source_pin_attributes:()=>aso,source_pin_missing_trace_warning:()=>B_t,source_pin_must_be_connected_error:()=>Dso,source_port:()=>fso,source_printed_part:()=>tso,source_project_metadata:()=>E_t,source_property_ignored_warning:()=>pso,source_refdes_convention_warning:()=>D_t,source_runtime_error:()=>Lso,source_simple_ammeter:()=>sso,source_simple_battery:()=>__t,source_simple_capacitor:()=>h_t,source_simple_chip:()=>p_t,source_simple_connector:()=>hso,source_simple_connector_standards:()=>lso,source_simple_crystal:()=>cso,source_simple_current_source:()=>rso,source_simple_diode:()=>YBe,source_simple_fiducial:()=>Zio,source_simple_fuse:()=>iso,source_simple_ground:()=>eso,source_simple_inductor:()=>g_t,source_simple_led:()=>u_t,source_simple_mosfet:()=>v_t,source_simple_op_amp:()=>S_t,source_simple_pin_header:()=>y_t,source_simple_pinout:()=>x_t,source_simple_potentiometer:()=>f_t,source_simple_power_source:()=>m_t,source_simple_push_button:()=>A_t,source_simple_resistor:()=>d_t,source_simple_resonator:()=>C_t,source_simple_switch:()=>P_t,source_simple_test_point:()=>I_t,source_simple_transistor:()=>b_t,source_simple_voltage_probe:()=>mso,source_simple_voltage_source:()=>gso,source_subassembly:()=>nso,source_trace:()=>xso,source_trace_not_connected_error:()=>w_t,source_unnamed_trace_warning:()=>Mso,spice_simulation_options:()=>klo,standard_shape:()=>tes,supplier_footprint_mismatch_warning:()=>olo,supplier_name:()=>Ame,time:()=>JZi,timestamp:()=>zio,unknown_error_finding_part:()=>Nso,visible_layer:()=>ag,voltage:()=>J6,wave_shape:()=>H_t});var $ne={};IX($ne,{all_layers:()=>Gmo,any_circuit_element:()=>qAo,any_soup_element:()=>Kne,any_source_component:()=>Qmo,asset:()=>oDe,base_circuit_json_error:()=>Kl,battery_capacity:()=>cmo,brep_shape:()=>aft,cadModelDefaultDirectionMap:()=>lls,cad_component:()=>SAo,cad_model_axis_directions:()=>vAo,cad_model_formats:()=>cls,capacitance:()=>RAt,circuit_json_footprint_load_error:()=>qgo,current:()=>TH,distance:()=>un,duration_ms:()=>jne,experiment_type:()=>DAo,external_footprint_load_error:()=>$go,frequency:()=>HU,getRotationBetweenPcbPin1Locations:()=>kcs,getZodPrefixedIdWithDefault:()=>Wn,inductance:()=>smo,insertionDirectionToCanonical:()=>N_o,insertionDirectionToVector:()=>Rcs,insertion_direction:()=>R_o,kicadAt:()=>rDe,kicadEffects:()=>lmo,kicadFont:()=>QAt,kicadFootprintAttributes:()=>dmo,kicadFootprintMetadata:()=>mmo,kicadFootprintModel:()=>pmo,kicadFootprintPad:()=>umo,kicadFootprintProperties:()=>hmo,kicadProperty:()=>c_e,kicadSymbolEffects:()=>Amo,kicadSymbolMetadata:()=>ymo,kicadSymbolPinNames:()=>gmo,kicadSymbolPinNumbers:()=>_mo,kicadSymbolProperties:()=>fmo,kicadSymbolProperty:()=>BH,layer_ref:()=>Ka,layer_string:()=>TAt,length:()=>ar,manufacturing_drc_properties:()=>L_o,ms:()=>dA,ninePointAnchor:()=>iD,parseAndConvertSiUnit:()=>Ta,pcbRenderLayer:()=>Tcs,pcb_autorouting_error:()=>Zgo,pcb_board:()=>ggo,pcb_breakout_point:()=>rAo,pcb_component:()=>H_o,pcb_component_invalid_layer_error:()=>mAo,pcb_component_missing_courtyard_warning:()=>nAo,pcb_component_not_on_board_edge_error:()=>pAo,pcb_component_outside_board_error:()=>uAo,pcb_connector_not_in_accessible_orientation_warning:()=>tAo,pcb_copper_pour:()=>dAo,pcb_copper_pour_brep:()=>lAo,pcb_copper_pour_polygon:()=>hAo,pcb_copper_pour_rect:()=>cAo,pcb_copper_text:()=>Sgo,pcb_courtyard_circle:()=>bAo,pcb_courtyard_outline:()=>xAo,pcb_courtyard_overlap_error:()=>Vgo,pcb_courtyard_pill:()=>IAo,pcb_courtyard_polygon:()=>CAo,pcb_courtyard_rect:()=>yAo,pcb_cutout:()=>jgo,pcb_cutout_circle:()=>Ugo,pcb_cutout_path:()=>Xgo,pcb_cutout_polygon:()=>Wgo,pcb_cutout_rect:()=>Ggo,pcb_debug_line:()=>z_o,pcb_debug_object:()=>V_o,pcb_debug_object_base:()=>aDe,pcb_debug_point:()=>O_o,pcb_debug_rect:()=>F_o,pcb_fabrication_note_dimension:()=>Qgo,pcb_fabrication_note_path:()=>Ngo,pcb_fabrication_note_rect:()=>Rgo,pcb_fabrication_note_text:()=>Dgo,pcb_footprint_overlap_error:()=>Ogo,pcb_ground_plane:()=>iAo,pcb_ground_plane_region:()=>sAo,pcb_group:()=>Jgo,pcb_hole:()=>K_o,pcb_hole_circle_or_square_shape:()=>zcs,pcb_hole_circle_shape:()=>Hcs,pcb_hole_oval_shape:()=>Ocs,pcb_hole_pill_shape:()=>Vcs,pcb_hole_rect_shape:()=>Fcs,pcb_hole_rotated_pill_shape:()=>Ycs,pcb_keepout:()=>Ygo,pcb_manual_edit_conflict_warning:()=>eAo,pcb_missing_footprint_error:()=>Kgo,pcb_net:()=>mgo,pcb_note_dimension:()=>zgo,pcb_note_line:()=>Fgo,pcb_note_path:()=>Hgo,pcb_note_rect:()=>Lgo,pcb_note_text:()=>kgo,pcb_packing_error:()=>ygo,pcb_pad_pad_clearance_error:()=>AAo,pcb_pad_trace_clearance_error:()=>fAo,pcb_panel:()=>Ago,pcb_panelization_placement_error:()=>xgo,pcb_pin1_location:()=>NAt,pcb_placement_error:()=>fgo,pcb_plated_hole:()=>$_o,pcb_port:()=>q_o,pcb_port_not_connected_error:()=>pgo,pcb_port_not_matched_error:()=>ugo,pcb_route_hint:()=>Q_o,pcb_route_hints:()=>Lcs,pcb_silkscreen_circle:()=>Ego,pcb_silkscreen_graphic:()=>Bgo,pcb_silkscreen_graphic_brep:()=>wgo,pcb_silkscreen_line:()=>bgo,pcb_silkscreen_oval:()=>Mgo,pcb_silkscreen_path:()=>Igo,pcb_silkscreen_pill:()=>Tgo,pcb_silkscreen_rect:()=>Pgo,pcb_silkscreen_text:()=>vgo,pcb_smtpad:()=>Z_o,pcb_smtpad_pill:()=>J_o,pcb_solder_paste:()=>ego,pcb_text:()=>tgo,pcb_thermal_spoke:()=>aAo,pcb_trace:()=>sgo,pcb_trace_error:()=>hgo,pcb_trace_hint:()=>Cgo,pcb_trace_missing_error:()=>dgo,pcb_trace_route_point:()=>igo,pcb_trace_route_point_through_pad:()=>rgo,pcb_trace_route_point_via:()=>ogo,pcb_trace_route_point_wire:()=>ngo,pcb_trace_too_long_warning:()=>cgo,pcb_trace_too_many_vias_warning:()=>lgo,pcb_trace_warning:()=>ago,pcb_via:()=>_go,pcb_via_clearance_error:()=>_Ao,pcb_via_trace_clearance_error:()=>gAo,point:()=>Tr,point3:()=>rD,point_with_bulge:()=>D_o,port_arrangement:()=>r_o,position:()=>Mcs,position3:()=>wcs,resistance:()=>tDe,ring:()=>DAt,rotation:()=>n0,route_hint_point:()=>k_o,schematic_arc:()=>h_o,schematic_box:()=>Zmo,schematic_circle:()=>l_o,schematic_component:()=>i_o,schematic_component_overlap_warning:()=>I_o,schematic_component_port_arrangement_by_sides:()=>o_o,schematic_component_port_arrangement_by_size:()=>n_o,schematic_component_styling_warning:()=>v_o,schematic_debug_line:()=>f_o,schematic_debug_object:()=>x_o,schematic_debug_object_base:()=>sDe,schematic_debug_point:()=>y_o,schematic_debug_rect:()=>A_o,schematic_element_outside_sheet_warning:()=>S_o,schematic_error:()=>__o,schematic_graphic:()=>P_o,schematic_group:()=>E_o,schematic_layout_error:()=>g_o,schematic_line:()=>a_o,schematic_manual_edit_conflict_warning:()=>b_o,schematic_net_label:()=>m_o,schematic_path:()=>e_o,schematic_pin_styles:()=>t_o,schematic_port:()=>p_o,schematic_rect:()=>c_o,schematic_sheet:()=>T_o,schematic_sheet_size:()=>B_o,schematic_symbol:()=>s_o,schematic_table:()=>M_o,schematic_table_cell:()=>w_o,schematic_text:()=>u_o,schematic_trace:()=>d_o,schematic_voltage_probe:()=>C_o,simulation_ac_current_source:()=>BAo,simulation_ac_sweep_current_graph:()=>XAo,simulation_ac_sweep_voltage_graph:()=>WAo,simulation_ac_voltage_source:()=>EAo,simulation_complex_sample:()=>dft,simulation_current_probe:()=>FAo,simulation_current_source:()=>TAo,simulation_dc_current_source:()=>wAo,simulation_dc_operating_point_current:()=>YAo,simulation_dc_operating_point_voltage:()=>VAo,simulation_dc_sweep_current_graph:()=>UAo,simulation_dc_sweep_unit:()=>lDe,simulation_dc_sweep_voltage_graph:()=>GAo,simulation_dc_voltage_source:()=>PAo,simulation_experiment:()=>RAo,simulation_op_amp:()=>jAo,simulation_oscilloscope_trace:()=>$Ao,simulation_parameter_sweep:()=>OAo,simulation_parameter_sweep_coordinate:()=>sD,simulation_parameter_type:()=>uls,simulation_parameter_unit:()=>hft,simulation_spice_subcircuit:()=>KAo,simulation_switch:()=>LAo,simulation_transient_current_graph:()=>kAo,simulation_transient_voltage_graph:()=>QAo,simulation_unknown_experiment_error:()=>zAo,simulation_voltage_probe:()=>HAo,simulation_voltage_source:()=>MAo,size:()=>nDe,source_ambiguous_port_reference:()=>Vmo,source_board:()=>Omo,source_component_base:()=>zd,source_component_internal_connection:()=>Lmo,source_component_misconfigured_error:()=>sft,source_component_pins_underspecified_warning:()=>Kmo,source_failed_to_create_component_error:()=>Bmo,source_group:()=>Fmo,source_i2c_misconfigured_error:()=>ift,source_interconnect:()=>Nmo,source_invalid_component_property_error:()=>eft,source_manually_placed_via:()=>Umo,source_missing_manufacturer_part_number_warning:()=>oft,source_missing_property_error:()=>wmo,source_net:()=>zmo,source_no_ground_pin_defined_warning:()=>jmo,source_no_power_pin_defined_warning:()=>Xmo,source_part_not_found_warning:()=>Jmo,source_pcb_ground_plane:()=>Ymo,source_pin_attributes:()=>Smo,source_pin_missing_trace_warning:()=>nft,source_pin_must_be_connected_error:()=>$mo,source_port:()=>kmo,source_project_metadata:()=>ZAt,source_property_ignored_warning:()=>Tmo,source_refdes_convention_warning:()=>rft,source_simple_ammeter:()=>vmo,source_simple_battery:()=>OAt,source_simple_capacitor:()=>kAt,source_simple_chip:()=>FAt,source_simple_connector:()=>Mmo,source_simple_connector_standards:()=>Emo,source_simple_crystal:()=>Pmo,source_simple_current_source:()=>bmo,source_simple_diode:()=>iDe,source_simple_fiducial:()=>xmo,source_simple_fuse:()=>Imo,source_simple_ground:()=>Cmo,source_simple_inductor:()=>VAt,source_simple_led:()=>HAt,source_simple_mosfet:()=>$At,source_simple_op_amp:()=>qAt,source_simple_pin_header:()=>UAt,source_simple_pinout:()=>WAt,source_simple_potentiometer:()=>GAt,source_simple_power_source:()=>zAt,source_simple_push_button:()=>YAt,source_simple_resistor:()=>LAt,source_simple_resonator:()=>XAt,source_simple_switch:()=>JAt,source_simple_test_point:()=>KAt,source_simple_transistor:()=>jAt,source_simple_voltage_probe:()=>Dmo,source_simple_voltage_source:()=>Rmo,source_trace:()=>Hmo,source_trace_not_connected_error:()=>tft,source_unnamed_trace_warning:()=>Wmo,spice_simulation_options:()=>NAo,supplier_footprint_mismatch_warning:()=>oAo,supplier_name:()=>l_e,time:()=>Ecs,timestamp:()=>amo,unknown_error_finding_part:()=>qmo,visible_layer:()=>uA,voltage:()=>s8,wave_shape:()=>lft});var hD=at(ln());var Fyt=at(Hyt());function EX(){return{root:null,container:null}}function MX(e,t,n){if(!t)return;if(e.container!==t||!e.root)e.root?.unmount(),t.innerHTML="",e.root=Fyt.createRoot(t),e.container=t;e.root.render(n)}var Jxt="165",e2={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},o5={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3};var Zxt=2;var O7=0,Ure=1,bd=2;var DAe=4;var e5t=303;var h3=1000,Bb=1001,NAe=1002,RAe=1003,QAe=1004;var kAe=1005;var Ec=1006,LAe=1007;var Jd=1008;var pQe=1023;var HAe=2300,Wre=2301;var t5t=0,FAe=1,Xre=2;var n5t=3201;var zAe="",_R="srgb";class uw{addEventListener(e,t){if(this._listeners===void 0)this._listeners={};let n=this._listeners;if(n[e]===void 0)n[e]=[];if(n[e].indexOf(t)===-1)n[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;let n=this._listeners;return n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;let o=this._listeners[e];if(o!==void 0){let r=o.indexOf(t);if(r!==-1)o.splice(r,1)}}dispatchEvent(e){if(this._listeners===void 0)return;let n=this._listeners[e.type];if(n!==void 0){e.target=this;let o=n.slice(0);for(let r=0,i=o.length;r<i;r++)o[r].call(this,e);e.target=null}}}var o1=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"],zyt=1234567,jX=Math.PI/180,$X=180/Math.PI;function wb(){let e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0,o=Math.random()*4294967295|0;return(o1[e&255]+o1[e>>8&255]+o1[e>>16&255]+o1[e>>24&255]+"-"+o1[t&255]+o1[t>>8&255]+"-"+o1[t>>16&15|64]+o1[t>>24&255]+"-"+o1[n&63|128]+o1[n>>8&255]+"-"+o1[n>>16&255]+o1[n>>24&255]+o1[o&255]+o1[o>>8&255]+o1[o>>16&255]+o1[o>>24&255]).toLowerCase()}function Qg(e,t,n){return Math.max(t,Math.min(n,e))}function mQe(e,t){return(e%t+t)%t}function F5o(e,t,n,o,r){return o+(e-t)*(r-o)/(n-t)}function z5o(e,t,n){if(e!==t)return(n-e)/(t-e);else return 0}function Qre(e,t,n){return(1-n)*e+n*t}function O5o(e,t,n,o){return Qre(e,t,1-Math.exp(-n*o))}function V5o(e,t=1){return t-Math.abs(mQe(e,t*2)-t)}function Y5o(e,t,n){if(e<=t)return 0;if(e>=n)return 1;return e=(e-t)/(n-t),e*e*(3-2*e)}function G5o(e,t,n){if(e<=t)return 0;if(e>=n)return 1;return e=(e-t)/(n-t),e*e*e*(e*(e*6-15)+10)}function U5o(e,t){return e+Math.floor(Math.random()*(t-e+1))}function W5o(e,t){return e+Math.random()*(t-e)}function X5o(e){return e*(0.5-Math.random())}function j5o(e){if(e!==void 0)zyt=e;let t=zyt+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function K5o(e){return e*jX}function $5o(e){return e*$X}function q5o(e){return(e&e-1)===0&&e!==0}function J5o(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))}function Z5o(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}function e4o(e,t,n,o,r){let{cos:i,sin:s}=Math,a=i(n/2),c=s(n/2),l=i((t+o)/2),h=s((t+o)/2),d=i((t-o)/2),u=s((t-o)/2),_=i((o-t)/2),p=s((o-t)/2);switch(r){case"XYX":e.set(a*h,c*d,c*u,a*l);break;case"YZY":e.set(c*u,a*h,c*d,a*l);break;case"ZXZ":e.set(c*d,c*u,a*h,a*l);break;case"XZX":e.set(a*h,c*p,c*_,a*l);break;case"YXY":e.set(c*_,a*h,c*p,a*l);break;case"ZYZ":e.set(c*p,c*_,a*h,a*l);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function w9(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return e/4294967295;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int32Array:return Math.max(e/2147483647,-1);case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw Error("Invalid component type.")}}function Jh(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return Math.round(e*4294967295);case Uint16Array:return Math.round(e*65535);case Uint8Array:return Math.round(e*255);case Int32Array:return Math.round(e*2147483647);case Int16Array:return Math.round(e*32767);case Int8Array:return Math.round(e*127);default:throw Error("Invalid component type.")}}var t2={DEG2RAD:jX,RAD2DEG:$X,generateUUID:wb,clamp:Qg,euclideanModulo:mQe,mapLinear:F5o,inverseLerp:z5o,lerp:Qre,damp:O5o,pingpong:V5o,smoothstep:Y5o,smootherstep:G5o,randInt:U5o,randFloat:W5o,randFloatSpread:X5o,seededRandom:j5o,degToRad:K5o,radToDeg:$5o,isPowerOfTwo:q5o,ceilPowerOfTwo:J5o,floorPowerOfTwo:Z5o,setQuaternionFromProperEuler:e4o,normalize:Jh,denormalize:w9};class ro{constructor(e=0,t=0){ro.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let t=this.x,n=this.y,o=e.elements;return this.x=o[0]*t+o[3]*n+o[6],this.y=o[1]*t+o[4]*n+o[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(Qg(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){let n=Math.cos(t),o=Math.sin(t),r=this.x-e.x,i=this.y-e.y;return this.x=r*n-i*o+e.x,this.y=r*o+i*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Ya{constructor(e,t,n,o,r,i,s,a,c){if(Ya.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0)this.set(e,t,n,o,r,i,s,a,c)}set(e,t,n,o,r,i,s,a,c){let l=this.elements;return l[0]=e,l[1]=o,l[2]=s,l[3]=t,l[4]=r,l[5]=a,l[6]=n,l[7]=i,l[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,o=t.elements,r=this.elements,i=n[0],s=n[3],a=n[6],c=n[1],l=n[4],h=n[7],d=n[2],u=n[5],_=n[8],p=o[0],m=o[3],A=o[6],g=o[1],f=o[4],y=o[7],x=o[2],C=o[5],b=o[8];return r[0]=i*p+s*g+a*x,r[3]=i*m+s*f+a*C,r[6]=i*A+s*y+a*b,r[1]=c*p+l*g+h*x,r[4]=c*m+l*f+h*C,r[7]=c*A+l*y+h*b,r[2]=d*p+u*g+_*x,r[5]=d*m+u*f+_*C,r[8]=d*A+u*y+_*b,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[1],o=e[2],r=e[3],i=e[4],s=e[5],a=e[6],c=e[7],l=e[8];return t*i*l-t*s*c-n*r*l+n*s*a+o*r*c-o*i*a}invert(){let e=this.elements,t=e[0],n=e[1],o=e[2],r=e[3],i=e[4],s=e[5],a=e[6],c=e[7],l=e[8],h=l*i-s*c,d=s*a-l*r,u=c*r-i*a,_=t*h+n*d+o*u;if(_===0)return this.set(0,0,0,0,0,0,0,0,0);let p=1/_;return e[0]=h*p,e[1]=(o*c-l*n)*p,e[2]=(s*n-o*i)*p,e[3]=d*p,e[4]=(l*t-o*a)*p,e[5]=(o*r-s*t)*p,e[6]=u*p,e[7]=(n*a-c*t)*p,e[8]=(i*t-n*r)*p,this}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,o,r,i,s){let a=Math.cos(r),c=Math.sin(r);return this.set(n*a,n*c,-n*(a*i+c*s)+i+e,-o*c,o*a,-o*(-c*i+a*s)+s+t,0,0,1),this}scale(e,t){return this.premultiply(MRe.makeScale(e,t)),this}rotate(e){return this.premultiply(MRe.makeRotation(-e)),this}translate(e,t){return this.premultiply(MRe.makeTranslation(e,t)),this}makeTranslation(e,t){if(e.isVector2)this.set(1,0,e.x,0,1,e.y,0,0,1);else this.set(1,0,e,0,1,t,0,0,1);return this}makeRotation(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){let t=this.elements,n=e.elements;for(let o=0;o<9;o++)if(t[o]!==n[o])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}}var MRe=new Ya;function o5t(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}function Fre(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}function t4o(){let e=Fre("canvas");return e.style.display="block",e}var Oyt={};function _Qe(e){if(e in Oyt)return;Oyt[e]=!0,console.warn(e)}function n4o(e,t,n){return new Promise(function(o,r){function i(){switch(e.clientWaitSync(t,e.SYNC_FLUSH_COMMANDS_BIT,0)){case e.WAIT_FAILED:r();break;case e.TIMEOUT_EXPIRED:setTimeout(i,n);break;default:o()}}setTimeout(i,n)})}var Vyt=new Ya().set(0.8224621,0.177538,0,0.0331941,0.9668058,0,0.0170827,0.0723974,0.9105199),Yyt=new Ya().set(1.2249401,-0.2249404,0,-0.0420569,1.0420571,0,-0.0196376,-0.0786361,1.0982735),Kge={["srgb-linear"]:{transfer:"linear",primaries:"rec709",toReference:(e)=>e,fromReference:(e)=>e},["srgb"]:{transfer:"srgb",primaries:"rec709",toReference:(e)=>e.convertSRGBToLinear(),fromReference:(e)=>e.convertLinearToSRGB()},["display-p3-linear"]:{transfer:"linear",primaries:"p3",toReference:(e)=>e.applyMatrix3(Yyt),fromReference:(e)=>e.applyMatrix3(Vyt)},["display-p3"]:{transfer:"srgb",primaries:"p3",toReference:(e)=>e.convertSRGBToLinear().applyMatrix3(Yyt),fromReference:(e)=>e.applyMatrix3(Vyt).convertLinearToSRGB()}},o4o=new Set(["srgb-linear","display-p3-linear"]),Zh={enabled:!0,_workingColorSpace:"srgb-linear",get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(e){if(!o4o.has(e))throw Error(`Unsupported working color space, "${e}".`);this._workingColorSpace=e},convert:function(e,t,n){if(this.enabled===!1||t===n||!t||!n)return e;let o=Kge[t].toReference,r=Kge[n].fromReference;return r(o(e))},fromWorkingColorSpace:function(e,t){return this.convert(e,this._workingColorSpace,t)},toWorkingColorSpace:function(e,t){return this.convert(e,t,this._workingColorSpace)},getPrimaries:function(e){return Kge[e].primaries},getTransfer:function(e){if(e==="")return"linear";return Kge[e].transfer}};function KX(e){return e<0.04045?e*0.0773993808:Math.pow(e*0.9478672986+0.0521327014,2.4)}function wRe(e){return e<0.0031308?e*12.92:1.055*Math.pow(e,0.41666)-0.055}var wX;class r5t{static getDataURL(e){if(/^data:/i.test(e.src))return e.src;if(typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{if(wX===void 0)wX=Fre("canvas");wX.width=e.width,wX.height=e.height;let n=wX.getContext("2d");if(e instanceof ImageData)n.putImageData(e,0,0);else n.drawImage(e,0,0,e.width,e.height);t=wX}if(t.width>2048||t.height>2048)return console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",0.6);else return t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){let t=Fre("canvas");t.width=e.width,t.height=e.height;let n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);let o=n.getImageData(0,0,e.width,e.height),r=o.data;for(let i=0;i<r.length;i++)r[i]=KX(r[i]/255)*255;return n.putImageData(o,0,0),t}else if(e.data){let t=e.data.slice(0);for(let n=0;n<t.length;n++)if(t instanceof Uint8Array||t instanceof Uint8ClampedArray)t[n]=Math.floor(KX(t[n]/255)*255);else t[n]=KX(t[n]);return{data:t,width:e.width,height:e.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}var r4o=0;class gQe{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:r4o++}),this.uuid=wb(),this.data=e,this.dataReady=!0,this.version=0}set needsUpdate(e){if(e===!0)this.version++}toJSON(e){let t=e===void 0||typeof e==="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];let n={uuid:this.uuid,url:""},o=this.data;if(o!==null){let r;if(Array.isArray(o)){r=[];for(let i=0,s=o.length;i<s;i++)if(o[i].isDataTexture)r.push(BRe(o[i].image));else r.push(BRe(o[i]))}else r=BRe(o);n.url=r}if(!t)e.images[this.uuid]=n;return n}}function BRe(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap)return r5t.getDataURL(e);else if(e.data)return{data:Array.from(e.data),width:e.width,height:e.height,type:e.data.constructor.name};else return console.warn("THREE.Texture: Unable to serialize Texture."),{}}var i4o=0;class vl extends uw{constructor(e=vl.DEFAULT_IMAGE,t=vl.DEFAULT_MAPPING,n=1001,o=1001,r=1006,i=1008,s=1023,a=1009,c=vl.DEFAULT_ANISOTROPY,l=""){super();this.isTexture=!0,Object.defineProperty(this,"id",{value:i4o++}),this.uuid=wb(),this.name="",this.source=new gQe(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=o,this.magFilter=r,this.minFilter=i,this.anisotropy=c,this.format=s,this.internalFormat=null,this.type=a,this.offset=new ro(0,0),this.repeat=new ro(1,1),this.center=new ro(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Ya,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=l,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.pmremVersion=0}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}toJSON(e){let t=e===void 0||typeof e==="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];let n={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(Object.keys(this.userData).length>0)n.userData=this.userData;if(!t)e.textures[this.uuid]=n;return n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==300)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case 1000:e.x=e.x-Math.floor(e.x);break;case 1001:e.x=e.x<0?0:1;break;case 1002:if(Math.abs(Math.floor(e.x)%2)===1)e.x=Math.ceil(e.x)-e.x;else e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case 1000:e.y=e.y-Math.floor(e.y);break;case 1001:e.y=e.y<0?0:1;break;case 1002:if(Math.abs(Math.floor(e.y)%2)===1)e.y=Math.ceil(e.y)-e.y;else e.y=e.y-Math.floor(e.y);break}if(this.flipY)e.y=1-e.y;return e}set needsUpdate(e){if(e===!0)this.version++,this.source.needsUpdate=!0}set needsPMREMUpdate(e){if(e===!0)this.pmremVersion++}}vl.DEFAULT_IMAGE=null;vl.DEFAULT_MAPPING=300;vl.DEFAULT_ANISOTROPY=1;class zh{constructor(e=0,t=0,n=0,o=1){zh.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=o}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,o){return this.x=e,this.y=t,this.z=n,this.w=o,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){let t=this.x,n=this.y,o=this.z,r=this.w,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*o+i[12]*r,this.y=i[1]*t+i[5]*n+i[9]*o+i[13]*r,this.z=i[2]*t+i[6]*n+i[10]*o+i[14]*r,this.w=i[3]*t+i[7]*n+i[11]*o+i[15]*r,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let t=Math.sqrt(1-e.w*e.w);if(t<0.0001)this.x=1,this.y=0,this.z=0;else this.x=e.x/t,this.y=e.y/t,this.z=e.z/t;return this}setAxisAngleFromRotationMatrix(e){let t,n,o,r,i=0.01,s=0.1,a=e.elements,c=a[0],l=a[4],h=a[8],d=a[1],u=a[5],_=a[9],p=a[2],m=a[6],A=a[10];if(Math.abs(l-d)<0.01&&Math.abs(h-p)<0.01&&Math.abs(_-m)<0.01){if(Math.abs(l+d)<0.1&&Math.abs(h+p)<0.1&&Math.abs(_+m)<0.1&&Math.abs(c+u+A-3)<0.1)return this.set(1,0,0,0),this;t=Math.PI;let f=(c+1)/2,y=(u+1)/2,x=(A+1)/2,C=(l+d)/4,b=(h+p)/4,I=(_+m)/4;if(f>y&&f>x)if(f<0.01)n=0,o=0.707106781,r=0.707106781;else n=Math.sqrt(f),o=C/n,r=b/n;else if(y>x)if(y<0.01)n=0.707106781,o=0,r=0.707106781;else o=Math.sqrt(y),n=C/o,r=I/o;else if(x<0.01)n=0.707106781,o=0.707106781,r=0;else r=Math.sqrt(x),n=b/r,o=I/r;return this.set(n,o,r,t),this}let g=Math.sqrt((m-_)*(m-_)+(h-p)*(h-p)+(d-l)*(d-l));if(Math.abs(g)<0.001)g=1;return this.x=(m-_)/g,this.y=(h-p)/g,this.z=(d-l)/g,this.w=Math.acos((c+u+A-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class i5t extends uw{constructor(e=1,t=1,n={}){super();this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new zh(0,0,e,t),this.scissorTest=!1,this.viewport=new zh(0,0,e,t);let o={width:e,height:t,depth:1};n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:1006,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},n);let r=new vl(o,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace);r.flipY=!1,r.generateMipmaps=n.generateMipmaps,r.internalFormat=n.internalFormat,this.textures=[];let i=n.count;for(let s=0;s<i;s++)this.textures[s]=r.clone(),this.textures[s].isRenderTargetTexture=!0;this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this.depthTexture=n.depthTexture,this.samples=n.samples}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}setSize(e,t,n=1){if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let o=0,r=this.textures.length;o<r;o++)this.textures[o].image.width=e,this.textures[o].image.height=t,this.textures[o].image.depth=n;this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let n=0,o=e.textures.length;n<o;n++)this.textures[n]=e.textures[n].clone(),this.textures[n].isRenderTargetTexture=!0;let t=Object.assign({},e.texture.image);if(this.texture.source=new gQe(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,e.depthTexture!==null)this.depthTexture=e.depthTexture.clone();return this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class uR extends i5t{constructor(e=1,t=1,n={}){super(e,t,n);this.isWebGLRenderTarget=!0}}class AQe extends vl{constructor(e=null,t=1,n=1,o=1){super(null);this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:o},this.magFilter=1003,this.minFilter=1003,this.wrapR=1001,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class s5t extends vl{constructor(e=null,t=1,n=1,o=1){super(null);this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:o},this.magFilter=1003,this.minFilter=1003,this.wrapR=1001,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Eu{constructor(e=0,t=0,n=0,o=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=o}static slerpFlat(e,t,n,o,r,i,s){let a=n[o+0],c=n[o+1],l=n[o+2],h=n[o+3],d=r[i+0],u=r[i+1],_=r[i+2],p=r[i+3];if(s===0){e[t+0]=a,e[t+1]=c,e[t+2]=l,e[t+3]=h;return}if(s===1){e[t+0]=d,e[t+1]=u,e[t+2]=_,e[t+3]=p;return}if(h!==p||a!==d||c!==u||l!==_){let m=1-s,A=a*d+c*u+l*_+h*p,g=A>=0?1:-1,f=1-A*A;if(f>Number.EPSILON){let x=Math.sqrt(f),C=Math.atan2(x,A*g);m=Math.sin(m*C)/x,s=Math.sin(s*C)/x}let y=s*g;if(a=a*m+d*y,c=c*m+u*y,l=l*m+_*y,h=h*m+p*y,m===1-s){let x=1/Math.sqrt(a*a+c*c+l*l+h*h);a*=x,c*=x,l*=x,h*=x}}e[t]=a,e[t+1]=c,e[t+2]=l,e[t+3]=h}static multiplyQuaternionsFlat(e,t,n,o,r,i){let s=n[o],a=n[o+1],c=n[o+2],l=n[o+3],h=r[i],d=r[i+1],u=r[i+2],_=r[i+3];return e[t]=s*_+l*h+a*u-c*d,e[t+1]=a*_+l*d+c*h-s*u,e[t+2]=c*_+l*u+s*d-a*h,e[t+3]=l*_-s*h-a*d-c*u,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,o){return this._x=e,this._y=t,this._z=n,this._w=o,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){let{_x:n,_y:o,_z:r,_order:i}=e,{cos:s,sin:a}=Math,c=s(n/2),l=s(o/2),h=s(r/2),d=a(n/2),u=a(o/2),_=a(r/2);switch(i){case"XYZ":this._x=d*l*h+c*u*_,this._y=c*u*h-d*l*_,this._z=c*l*_+d*u*h,this._w=c*l*h-d*u*_;break;case"YXZ":this._x=d*l*h+c*u*_,this._y=c*u*h-d*l*_,this._z=c*l*_-d*u*h,this._w=c*l*h+d*u*_;break;case"ZXY":this._x=d*l*h-c*u*_,this._y=c*u*h+d*l*_,this._z=c*l*_+d*u*h,this._w=c*l*h-d*u*_;break;case"ZYX":this._x=d*l*h-c*u*_,this._y=c*u*h+d*l*_,this._z=c*l*_-d*u*h,this._w=c*l*h+d*u*_;break;case"YZX":this._x=d*l*h+c*u*_,this._y=c*u*h+d*l*_,this._z=c*l*_-d*u*h,this._w=c*l*h-d*u*_;break;case"XZY":this._x=d*l*h-c*u*_,this._y=c*u*h-d*l*_,this._z=c*l*_+d*u*h,this._w=c*l*h+d*u*_;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+i)}if(t===!0)this._onChangeCallback();return this}setFromAxisAngle(e,t){let n=t/2,o=Math.sin(n);return this._x=e.x*o,this._y=e.y*o,this._z=e.z*o,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,n=t[0],o=t[4],r=t[8],i=t[1],s=t[5],a=t[9],c=t[2],l=t[6],h=t[10],d=n+s+h;if(d>0){let u=0.5/Math.sqrt(d+1);this._w=0.25/u,this._x=(l-a)*u,this._y=(r-c)*u,this._z=(i-o)*u}else if(n>s&&n>h){let u=2*Math.sqrt(1+n-s-h);this._w=(l-a)/u,this._x=0.25*u,this._y=(o+i)/u,this._z=(r+c)/u}else if(s>h){let u=2*Math.sqrt(1+s-n-h);this._w=(r-c)/u,this._x=(o+i)/u,this._y=0.25*u,this._z=(a+l)/u}else{let u=2*Math.sqrt(1+h-n-s);this._w=(i-o)/u,this._x=(r+c)/u,this._y=(a+l)/u,this._z=0.25*u}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;if(n<Number.EPSILON)if(n=0,Math.abs(e.x)>Math.abs(e.z))this._x=-e.y,this._y=e.x,this._z=0,this._w=n;else this._x=0,this._y=-e.z,this._z=e.y,this._w=n;else this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n;return this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Qg(this.dot(e),-1,1)))}rotateTowards(e,t){let n=this.angleTo(e);if(n===0)return this;let o=Math.min(1,t/n);return this.slerp(e,o),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();if(e===0)this._x=0,this._y=0,this._z=0,this._w=1;else e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e;return this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let{_x:n,_y:o,_z:r,_w:i}=e,{_x:s,_y:a,_z:c,_w:l}=t;return this._x=n*l+i*s+o*c-r*a,this._y=o*l+i*a+r*s-n*c,this._z=r*l+i*c+n*a-o*s,this._w=i*l-n*s-o*a-r*c,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);let n=this._x,o=this._y,r=this._z,i=this._w,s=i*e._w+n*e._x+o*e._y+r*e._z;if(s<0)this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,s=-s;else this.copy(e);if(s>=1)return this._w=i,this._x=n,this._y=o,this._z=r,this;let a=1-s*s;if(a<=Number.EPSILON){let u=1-t;return this._w=u*i+t*this._w,this._x=u*n+t*this._x,this._y=u*o+t*this._y,this._z=u*r+t*this._z,this.normalize(),this}let c=Math.sqrt(a),l=Math.atan2(c,s),h=Math.sin((1-t)*l)/c,d=Math.sin(t*l)/c;return this._w=i*h+this._w*d,this._x=n*h+this._x*d,this._y=o*h+this._y*d,this._z=r*h+this._z*d,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){let e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),o=Math.sqrt(1-n),r=Math.sqrt(n);return this.set(o*Math.sin(e),o*Math.cos(e),r*Math.sin(t),r*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class Et{constructor(e=0,t=0,n=0){Et.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){if(n===void 0)n=this.z;return this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(Gyt.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Gyt.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,n=this.y,o=this.z,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6]*o,this.y=r[1]*t+r[4]*n+r[7]*o,this.z=r[2]*t+r[5]*n+r[8]*o,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,n=this.y,o=this.z,r=e.elements,i=1/(r[3]*t+r[7]*n+r[11]*o+r[15]);return this.x=(r[0]*t+r[4]*n+r[8]*o+r[12])*i,this.y=(r[1]*t+r[5]*n+r[9]*o+r[13])*i,this.z=(r[2]*t+r[6]*n+r[10]*o+r[14])*i,this}applyQuaternion(e){let t=this.x,n=this.y,o=this.z,{x:r,y:i,z:s,w:a}=e,c=2*(i*o-s*n),l=2*(s*t-r*o),h=2*(r*n-i*t);return this.x=t+a*c+i*h-s*l,this.y=n+a*l+s*c-r*h,this.z=o+a*h+r*l-i*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,n=this.y,o=this.z,r=e.elements;return this.x=r[0]*t+r[4]*n+r[8]*o,this.y=r[1]*t+r[5]*n+r[9]*o,this.z=r[2]*t+r[6]*n+r[10]*o,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){let{x:n,y:o,z:r}=e,{x:i,y:s,z:a}=t;return this.x=o*a-r*s,this.y=r*i-n*a,this.z=n*s-o*i,this}projectOnVector(e){let t=e.lengthSq();if(t===0)return this.set(0,0,0);let n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return TRe.copy(this).projectOnVector(e),this.sub(TRe)}reflect(e){return this.sub(TRe.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(Qg(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y,o=this.z-e.z;return t*t+n*n+o*o}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){let o=Math.sin(t)*e;return this.x=o*Math.sin(n),this.y=Math.cos(t)*e,this.z=o*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),o=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=o,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let e=Math.random()*Math.PI*2,t=Math.random()*2-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}var TRe=new Et,Gyt=new Eu;class Mu{constructor(e=new Et(1/0,1/0,1/0),t=new Et(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t+=3)this.expandByPoint(S9.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(S9.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){let n=S9.copy(t).multiplyScalar(0.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(0.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);let n=e.geometry;if(n!==void 0){let r=n.getAttribute("position");if(t===!0&&r!==void 0&&e.isInstancedMesh!==!0)for(let i=0,s=r.count;i<s;i++){if(e.isMesh===!0)e.getVertexPosition(i,S9);else S9.fromBufferAttribute(r,i);S9.applyMatrix4(e.matrixWorld),this.expandByPoint(S9)}else{if(e.boundingBox!==void 0){if(e.boundingBox===null)e.computeBoundingBox();$ge.copy(e.boundingBox)}else{if(n.boundingBox===null)n.computeBoundingBox();$ge.copy(n.boundingBox)}$ge.applyMatrix4(e.matrixWorld),this.union($ge)}}let o=e.children;for(let r=0,i=o.length;r<i;r++)this.expandByObject(o[r],t);return this}containsPoint(e){return e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z?!1:!0}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z?!1:!0}intersectsSphere(e){return this.clampPoint(e.center,S9),S9.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;if(e.normal.x>0)t=e.normal.x*this.min.x,n=e.normal.x*this.max.x;else t=e.normal.x*this.max.x,n=e.normal.x*this.min.x;if(e.normal.y>0)t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y;else t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y;if(e.normal.z>0)t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z;else t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z;return t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Pre),qge.subVectors(this.max,Pre),BX.subVectors(e.a,Pre),TX.subVectors(e.b,Pre),DX.subVectors(e.c,Pre),iR.subVectors(TX,BX),sR.subVectors(DX,TX),yz.subVectors(BX,DX);let t=[0,-iR.z,iR.y,0,-sR.z,sR.y,0,-yz.z,yz.y,iR.z,0,-iR.x,sR.z,0,-sR.x,yz.z,0,-yz.x,-iR.y,iR.x,0,-sR.y,sR.x,0,-yz.y,yz.x,0];if(!DRe(t,BX,TX,DX,qge))return!1;if(t=[1,0,0,0,1,0,0,0,1],!DRe(t,BX,TX,DX,qge))return!1;return Jge.crossVectors(iR,sR),t=[Jge.x,Jge.y,Jge.z],DRe(t,BX,TX,DX,qge)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,S9).distanceTo(e)}getBoundingSphere(e){if(this.isEmpty())e.makeEmpty();else this.getCenter(e.center),e.radius=this.getSize(S9).length()*0.5;return e}intersect(e){if(this.min.max(e.min),this.max.min(e.max),this.isEmpty())this.makeEmpty();return this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){if(this.isEmpty())return this;return sw[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),sw[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),sw[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),sw[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),sw[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),sw[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),sw[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),sw[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(sw),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}var sw=[new Et,new Et,new Et,new Et,new Et,new Et,new Et,new Et],S9=new Et,$ge=new Mu,BX=new Et,TX=new Et,DX=new Et,iR=new Et,sR=new Et,yz=new Et,Pre=new Et,qge=new Et,Jge=new Et,xz=new Et;function DRe(e,t,n,o,r){for(let i=0,s=e.length-3;i<=s;i+=3){xz.fromArray(e,i);let a=r.x*Math.abs(xz.x)+r.y*Math.abs(xz.y)+r.z*Math.abs(xz.z),c=t.dot(xz),l=n.dot(xz),h=o.dot(xz);if(Math.max(-Math.max(c,l,h),Math.min(c,l,h))>a)return!1}return!0}var s4o=new Mu,Ere=new Et,NRe=new Et;class v_{constructor(e=new Et,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){let n=this.center;if(t!==void 0)n.copy(t);else s4o.setFromPoints(e).getCenter(n);let o=0;for(let r=0,i=e.length;r<i;r++)o=Math.max(o,n.distanceToSquared(e[r]));return this.radius=Math.sqrt(o),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){let t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){let n=this.center.distanceToSquared(e);if(t.copy(e),n>this.radius*this.radius)t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center);return t}getBoundingBox(e){if(this.isEmpty())return e.makeEmpty(),e;return e.set(this.center,this.center),e.expandByScalar(this.radius),e}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;Ere.subVectors(e,this.center);let t=Ere.lengthSq();if(t>this.radius*this.radius){let n=Math.sqrt(t),o=(n-this.radius)*0.5;this.center.addScaledVector(Ere,o/n),this.radius+=o}return this}union(e){if(e.isEmpty())return this;if(this.isEmpty())return this.copy(e),this;if(this.center.equals(e.center)===!0)this.radius=Math.max(this.radius,e.radius);else NRe.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Ere.copy(e.center).add(NRe)),this.expandByPoint(Ere.copy(e.center).sub(NRe));return this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}var aw=new Et,RRe=new Et,Zge=new Et,aR=new Et,QRe=new Et,eAe=new Et,kRe=new Et;class V7{constructor(e=new Et,t=new Et(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,aw)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let n=t.dot(this.direction);if(n<0)return t.copy(this.origin);return t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=aw.subVectors(e,this.origin).dot(this.direction);if(t<0)return this.origin.distanceToSquared(e);return aw.copy(this.origin).addScaledVector(this.direction,t),aw.distanceToSquared(e)}distanceSqToSegment(e,t,n,o){RRe.copy(e).add(t).multiplyScalar(0.5),Zge.copy(t).sub(e).normalize(),aR.copy(this.origin).sub(RRe);let r=e.distanceTo(t)*0.5,i=-this.direction.dot(Zge),s=aR.dot(this.direction),a=-aR.dot(Zge),c=aR.lengthSq(),l=Math.abs(1-i*i),h,d,u,_;if(l>0)if(h=i*a-s,d=i*s-a,_=r*l,h>=0)if(d>=-_)if(d<=_){let p=1/l;h*=p,d*=p,u=h*(h+i*d+2*s)+d*(i*h+d+2*a)+c}else d=r,h=Math.max(0,-(i*d+s)),u=-h*h+d*(d+2*a)+c;else d=-r,h=Math.max(0,-(i*d+s)),u=-h*h+d*(d+2*a)+c;else if(d<=-_)h=Math.max(0,-(-i*r+s)),d=h>0?-r:Math.min(Math.max(-r,-a),r),u=-h*h+d*(d+2*a)+c;else if(d<=_)h=0,d=Math.min(Math.max(-r,-a),r),u=d*(d+2*a)+c;else h=Math.max(0,-(i*r+s)),d=h>0?r:Math.min(Math.max(-r,-a),r),u=-h*h+d*(d+2*a)+c;else d=i>0?-r:r,h=Math.max(0,-(i*d+s)),u=-h*h+d*(d+2*a)+c;if(n)n.copy(this.origin).addScaledVector(this.direction,h);if(o)o.copy(RRe).addScaledVector(Zge,d);return u}intersectSphere(e,t){aw.subVectors(e.center,this.origin);let n=aw.dot(this.direction),o=aw.dot(aw)-n*n,r=e.radius*e.radius;if(o>r)return null;let i=Math.sqrt(r-o),s=n-i,a=n+i;if(a<0)return null;if(s<0)return this.at(a,t);return this.at(s,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(t===0){if(e.distanceToPoint(this.origin)===0)return 0;return null}let n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){let n=this.distanceToPlane(e);if(n===null)return null;return this.at(n,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);if(t===0)return!0;if(e.normal.dot(this.direction)*t<0)return!0;return!1}intersectBox(e,t){let n,o,r,i,s,a,c=1/this.direction.x,l=1/this.direction.y,h=1/this.direction.z,d=this.origin;if(c>=0)n=(e.min.x-d.x)*c,o=(e.max.x-d.x)*c;else n=(e.max.x-d.x)*c,o=(e.min.x-d.x)*c;if(l>=0)r=(e.min.y-d.y)*l,i=(e.max.y-d.y)*l;else r=(e.max.y-d.y)*l,i=(e.min.y-d.y)*l;if(n>i||r>o)return null;if(r>n||isNaN(n))n=r;if(i<o||isNaN(o))o=i;if(h>=0)s=(e.min.z-d.z)*h,a=(e.max.z-d.z)*h;else s=(e.max.z-d.z)*h,a=(e.min.z-d.z)*h;if(n>a||s>o)return null;if(s>n||n!==n)n=s;if(a<o||o!==o)o=a;if(o<0)return null;return this.at(n>=0?n:o,t)}intersectsBox(e){return this.intersectBox(e,aw)!==null}intersectTriangle(e,t,n,o,r){QRe.subVectors(t,e),eAe.subVectors(n,e),kRe.crossVectors(QRe,eAe);let i=this.direction.dot(kRe),s;if(i>0){if(o)return null;s=1}else if(i<0)s=-1,i=-i;else return null;aR.subVectors(this.origin,e);let a=s*this.direction.dot(eAe.crossVectors(aR,eAe));if(a<0)return null;let c=s*this.direction.dot(QRe.cross(aR));if(c<0)return null;if(a+c>i)return null;let l=-s*aR.dot(kRe);if(l<0)return null;return this.at(l/i,r)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Gi{constructor(e,t,n,o,r,i,s,a,c,l,h,d,u,_,p,m){if(Gi.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0)this.set(e,t,n,o,r,i,s,a,c,l,h,d,u,_,p,m)}set(e,t,n,o,r,i,s,a,c,l,h,d,u,_,p,m){let A=this.elements;return A[0]=e,A[4]=t,A[8]=n,A[12]=o,A[1]=r,A[5]=i,A[9]=s,A[13]=a,A[2]=c,A[6]=l,A[10]=h,A[14]=d,A[3]=u,A[7]=_,A[11]=p,A[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new Gi().fromArray(this.elements)}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){let t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){let t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){let t=this.elements,n=e.elements,o=1/NX.setFromMatrixColumn(e,0).length(),r=1/NX.setFromMatrixColumn(e,1).length(),i=1/NX.setFromMatrixColumn(e,2).length();return t[0]=n[0]*o,t[1]=n[1]*o,t[2]=n[2]*o,t[3]=0,t[4]=n[4]*r,t[5]=n[5]*r,t[6]=n[6]*r,t[7]=0,t[8]=n[8]*i,t[9]=n[9]*i,t[10]=n[10]*i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){let t=this.elements,{x:n,y:o,z:r}=e,i=Math.cos(n),s=Math.sin(n),a=Math.cos(o),c=Math.sin(o),l=Math.cos(r),h=Math.sin(r);if(e.order==="XYZ"){let d=i*l,u=i*h,_=s*l,p=s*h;t[0]=a*l,t[4]=-a*h,t[8]=c,t[1]=u+_*c,t[5]=d-p*c,t[9]=-s*a,t[2]=p-d*c,t[6]=_+u*c,t[10]=i*a}else if(e.order==="YXZ"){let d=a*l,u=a*h,_=c*l,p=c*h;t[0]=d+p*s,t[4]=_*s-u,t[8]=i*c,t[1]=i*h,t[5]=i*l,t[9]=-s,t[2]=u*s-_,t[6]=p+d*s,t[10]=i*a}else if(e.order==="ZXY"){let d=a*l,u=a*h,_=c*l,p=c*h;t[0]=d-p*s,t[4]=-i*h,t[8]=_+u*s,t[1]=u+_*s,t[5]=i*l,t[9]=p-d*s,t[2]=-i*c,t[6]=s,t[10]=i*a}else if(e.order==="ZYX"){let d=i*l,u=i*h,_=s*l,p=s*h;t[0]=a*l,t[4]=_*c-u,t[8]=d*c+p,t[1]=a*h,t[5]=p*c+d,t[9]=u*c-_,t[2]=-c,t[6]=s*a,t[10]=i*a}else if(e.order==="YZX"){let d=i*a,u=i*c,_=s*a,p=s*c;t[0]=a*l,t[4]=p-d*h,t[8]=_*h+u,t[1]=h,t[5]=i*l,t[9]=-s*l,t[2]=-c*l,t[6]=u*h+_,t[10]=d-p*h}else if(e.order==="XZY"){let d=i*a,u=i*c,_=s*a,p=s*c;t[0]=a*l,t[4]=-h,t[8]=c*l,t[1]=d*h+p,t[5]=i*l,t[9]=u*h-_,t[2]=_*h-u,t[6]=s*l,t[10]=p*h+d}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(a4o,e,c4o)}lookAt(e,t,n){let o=this.elements;if(a3.subVectors(e,t),a3.lengthSq()===0)a3.z=1;if(a3.normalize(),cR.crossVectors(n,a3),cR.lengthSq()===0){if(Math.abs(n.z)===1)a3.x+=0.0001;else a3.z+=0.0001;a3.normalize(),cR.crossVectors(n,a3)}return cR.normalize(),tAe.crossVectors(a3,cR),o[0]=cR.x,o[4]=tAe.x,o[8]=a3.x,o[1]=cR.y,o[5]=tAe.y,o[9]=a3.y,o[2]=cR.z,o[6]=tAe.z,o[10]=a3.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,o=t.elements,r=this.elements,i=n[0],s=n[4],a=n[8],c=n[12],l=n[1],h=n[5],d=n[9],u=n[13],_=n[2],p=n[6],m=n[10],A=n[14],g=n[3],f=n[7],y=n[11],x=n[15],C=o[0],b=o[4],I=o[8],v=o[12],P=o[1],M=o[5],B=o[9],T=o[13],N=o[2],D=o[6],L=o[10],H=o[14],V=o[3],O=o[7],U=o[11],j=o[15];return r[0]=i*C+s*P+a*N+c*V,r[4]=i*b+s*M+a*D+c*O,r[8]=i*I+s*B+a*L+c*U,r[12]=i*v+s*T+a*H+c*j,r[1]=l*C+h*P+d*N+u*V,r[5]=l*b+h*M+d*D+u*O,r[9]=l*I+h*B+d*L+u*U,r[13]=l*v+h*T+d*H+u*j,r[2]=_*C+p*P+m*N+A*V,r[6]=_*b+p*M+m*D+A*O,r[10]=_*I+p*B+m*L+A*U,r[14]=_*v+p*T+m*H+A*j,r[3]=g*C+f*P+y*N+x*V,r[7]=g*b+f*M+y*D+x*O,r[11]=g*I+f*B+y*L+x*U,r[15]=g*v+f*T+y*H+x*j,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[4],o=e[8],r=e[12],i=e[1],s=e[5],a=e[9],c=e[13],l=e[2],h=e[6],d=e[10],u=e[14],_=e[3],p=e[7],m=e[11],A=e[15];return _*(+r*a*h-o*c*h-r*s*d+n*c*d+o*s*u-n*a*u)+p*(+t*a*u-t*c*d+r*i*d-o*i*u+o*c*l-r*a*l)+m*(+t*c*h-t*s*u-r*i*h+n*i*u+r*s*l-n*c*l)+A*(-o*s*l-t*a*h+t*s*d+o*i*h-n*i*d+n*a*l)}transpose(){let e=this.elements,t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){let o=this.elements;if(e.isVector3)o[12]=e.x,o[13]=e.y,o[14]=e.z;else o[12]=e,o[13]=t,o[14]=n;return this}invert(){let e=this.elements,t=e[0],n=e[1],o=e[2],r=e[3],i=e[4],s=e[5],a=e[6],c=e[7],l=e[8],h=e[9],d=e[10],u=e[11],_=e[12],p=e[13],m=e[14],A=e[15],g=h*m*c-p*d*c+p*a*u-s*m*u-h*a*A+s*d*A,f=_*d*c-l*m*c-_*a*u+i*m*u+l*a*A-i*d*A,y=l*p*c-_*h*c+_*s*u-i*p*u-l*s*A+i*h*A,x=_*h*a-l*p*a-_*s*d+i*p*d+l*s*m-i*h*m,C=t*g+n*f+o*y+r*x;if(C===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let b=1/C;return e[0]=g*b,e[1]=(p*d*r-h*m*r-p*o*u+n*m*u+h*o*A-n*d*A)*b,e[2]=(s*m*r-p*a*r+p*o*c-n*m*c-s*o*A+n*a*A)*b,e[3]=(h*a*r-s*d*r-h*o*c+n*d*c+s*o*u-n*a*u)*b,e[4]=f*b,e[5]=(l*m*r-_*d*r+_*o*u-t*m*u-l*o*A+t*d*A)*b,e[6]=(_*a*r-i*m*r-_*o*c+t*m*c+i*o*A-t*a*A)*b,e[7]=(i*d*r-l*a*r+l*o*c-t*d*c-i*o*u+t*a*u)*b,e[8]=y*b,e[9]=(_*h*r-l*p*r-_*n*u+t*p*u+l*n*A-t*h*A)*b,e[10]=(i*p*r-_*s*r+_*n*c-t*p*c-i*n*A+t*s*A)*b,e[11]=(l*s*r-i*h*r-l*n*c+t*h*c+i*n*u-t*s*u)*b,e[12]=x*b,e[13]=(l*p*o-_*h*o+_*n*d-t*p*d-l*n*m+t*h*m)*b,e[14]=(_*s*o-i*p*o-_*n*a+t*p*a+i*n*m-t*s*m)*b,e[15]=(i*h*o-l*s*o+l*n*a-t*h*a-i*n*d+t*s*d)*b,this}scale(e){let t=this.elements,{x:n,y:o,z:r}=e;return t[0]*=n,t[4]*=o,t[8]*=r,t[1]*=n,t[5]*=o,t[9]*=r,t[2]*=n,t[6]*=o,t[10]*=r,t[3]*=n,t[7]*=o,t[11]*=r,this}getMaxScaleOnAxis(){let e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],o=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,o))}makeTranslation(e,t,n){if(e.isVector3)this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1);else this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1);return this}makeRotationX(e){let t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let n=Math.cos(t),o=Math.sin(t),r=1-n,{x:i,y:s,z:a}=e,c=r*i,l=r*s;return this.set(c*i+n,c*s-o*a,c*a+o*s,0,c*s+o*a,l*s+n,l*a-o*i,0,c*a-o*s,l*a+o*i,r*a*a+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,o,r,i){return this.set(1,n,r,0,e,1,i,0,t,o,1,0,0,0,0,1),this}compose(e,t,n){let o=this.elements,{_x:r,_y:i,_z:s,_w:a}=t,c=r+r,l=i+i,h=s+s,d=r*c,u=r*l,_=r*h,p=i*l,m=i*h,A=s*h,g=a*c,f=a*l,y=a*h,{x,y:C,z:b}=n;return o[0]=(1-(p+A))*x,o[1]=(u+y)*x,o[2]=(_-f)*x,o[3]=0,o[4]=(u-y)*C,o[5]=(1-(d+A))*C,o[6]=(m+g)*C,o[7]=0,o[8]=(_+f)*b,o[9]=(m-g)*b,o[10]=(1-(d+p))*b,o[11]=0,o[12]=e.x,o[13]=e.y,o[14]=e.z,o[15]=1,this}decompose(e,t,n){let o=this.elements,r=NX.set(o[0],o[1],o[2]).length(),i=NX.set(o[4],o[5],o[6]).length(),s=NX.set(o[8],o[9],o[10]).length();if(this.determinant()<0)r=-r;e.x=o[12],e.y=o[13],e.z=o[14],P9.copy(this);let c=1/r,l=1/i,h=1/s;return P9.elements[0]*=c,P9.elements[1]*=c,P9.elements[2]*=c,P9.elements[4]*=l,P9.elements[5]*=l,P9.elements[6]*=l,P9.elements[8]*=h,P9.elements[9]*=h,P9.elements[10]*=h,t.setFromRotationMatrix(P9),n.x=r,n.y=i,n.z=s,this}makePerspective(e,t,n,o,r,i,s=2000){let a=this.elements,c=2*r/(t-e),l=2*r/(n-o),h=(t+e)/(t-e),d=(n+o)/(n-o),u,_;if(s===2000)u=-(i+r)/(i-r),_=-2*i*r/(i-r);else if(s===2001)u=-i/(i-r),_=-i*r/(i-r);else throw Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+s);return a[0]=c,a[4]=0,a[8]=h,a[12]=0,a[1]=0,a[5]=l,a[9]=d,a[13]=0,a[2]=0,a[6]=0,a[10]=u,a[14]=_,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(e,t,n,o,r,i,s=2000){let a=this.elements,c=1/(t-e),l=1/(n-o),h=1/(i-r),d=(t+e)*c,u=(n+o)*l,_,p;if(s===2000)_=(i+r)*h,p=-2*h;else if(s===2001)_=r*h,p=-1*h;else throw Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+s);return a[0]=2*c,a[4]=0,a[8]=0,a[12]=-d,a[1]=0,a[5]=2*l,a[9]=0,a[13]=-u,a[2]=0,a[6]=0,a[10]=p,a[14]=-_,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(e){let t=this.elements,n=e.elements;for(let o=0;o<16;o++)if(t[o]!==n[o])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}var NX=new Et,P9=new Gi,a4o=new Et(0,0,0),c4o=new Et(1,1,1),cR=new Et,tAe=new Et,a3=new Et,Uyt=new Gi,Wyt=new Eu;class FA{constructor(e=0,t=0,n=0,o=FA.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=o}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,o=this._order){return this._x=e,this._y=t,this._z=n,this._order=o,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){let o=e.elements,r=o[0],i=o[4],s=o[8],a=o[1],c=o[5],l=o[9],h=o[2],d=o[6],u=o[10];switch(t){case"XYZ":if(this._y=Math.asin(Qg(s,-1,1)),Math.abs(s)<0.9999999)this._x=Math.atan2(-l,u),this._z=Math.atan2(-i,r);else this._x=Math.atan2(d,c),this._z=0;break;case"YXZ":if(this._x=Math.asin(-Qg(l,-1,1)),Math.abs(l)<0.9999999)this._y=Math.atan2(s,u),this._z=Math.atan2(a,c);else this._y=Math.atan2(-h,r),this._z=0;break;case"ZXY":if(this._x=Math.asin(Qg(d,-1,1)),Math.abs(d)<0.9999999)this._y=Math.atan2(-h,u),this._z=Math.atan2(-i,c);else this._y=0,this._z=Math.atan2(a,r);break;case"ZYX":if(this._y=Math.asin(-Qg(h,-1,1)),Math.abs(h)<0.9999999)this._x=Math.atan2(d,u),this._z=Math.atan2(a,r);else this._x=0,this._z=Math.atan2(-i,c);break;case"YZX":if(this._z=Math.asin(Qg(a,-1,1)),Math.abs(a)<0.9999999)this._x=Math.atan2(-l,c),this._y=Math.atan2(-h,r);else this._x=0,this._y=Math.atan2(s,u);break;case"XZY":if(this._z=Math.asin(-Qg(i,-1,1)),Math.abs(i)<0.9999999)this._x=Math.atan2(d,c),this._y=Math.atan2(s,r);else this._x=Math.atan2(-l,u),this._y=0;break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}if(this._order=t,n===!0)this._onChangeCallback();return this}setFromQuaternion(e,t,n){return Uyt.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Uyt,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return Wyt.setFromEuler(this),this.setFromQuaternion(Wyt,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){if(this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0)this._order=e[3];return this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}FA.DEFAULT_ORDER="XYZ";class OAe{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}}var l4o=0,Xyt=new Et,RX=new Eu,cw=new Gi,nAe=new Et,Mre=new Et,h4o=new Et,d4o=new Eu,jyt=new Et(1,0,0),Kyt=new Et(0,1,0),$yt=new Et(0,0,1),qyt={type:"added"},u4o={type:"removed"},QX={type:"childadded",child:null},LRe={type:"childremoved",child:null};class Sl extends uw{constructor(){super();this.isObject3D=!0,Object.defineProperty(this,"id",{value:l4o++}),this.uuid=wb(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Sl.DEFAULT_UP.clone();let e=new Et,t=new FA,n=new Eu,o=new Et(1,1,1);function r(){n.setFromEuler(t,!1)}function i(){t.setFromQuaternion(n,void 0,!1)}t._onChange(r),n._onChange(i),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:o},modelViewMatrix:{value:new Gi},normalMatrix:{value:new Ya}}),this.matrix=new Gi,this.matrixWorld=new Gi,this.matrixAutoUpdate=Sl.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Sl.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new OAe,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){if(this.matrixAutoUpdate)this.updateMatrix();this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return RX.setFromAxisAngle(e,t),this.quaternion.multiply(RX),this}rotateOnWorldAxis(e,t){return RX.setFromAxisAngle(e,t),this.quaternion.premultiply(RX),this}rotateX(e){return this.rotateOnAxis(jyt,e)}rotateY(e){return this.rotateOnAxis(Kyt,e)}rotateZ(e){return this.rotateOnAxis($yt,e)}translateOnAxis(e,t){return Xyt.copy(e).applyQuaternion(this.quaternion),this.position.add(Xyt.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(jyt,e)}translateY(e){return this.translateOnAxis(Kyt,e)}translateZ(e){return this.translateOnAxis($yt,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(cw.copy(this.matrixWorld).invert())}lookAt(e,t,n){if(e.isVector3)nAe.copy(e);else nAe.set(e,t,n);let o=this.parent;if(this.updateWorldMatrix(!0,!1),Mre.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight)cw.lookAt(Mre,nAe,this.up);else cw.lookAt(nAe,Mre,this.up);if(this.quaternion.setFromRotationMatrix(cw),o)cw.extractRotation(o.matrixWorld),RX.setFromRotationMatrix(cw),this.quaternion.premultiply(RX.invert())}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}if(e===this)return console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this;if(e&&e.isObject3D)e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(qyt),QX.child=e,this.dispatchEvent(QX),QX.child=null;else console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e);return this}remove(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}let t=this.children.indexOf(e);if(t!==-1)e.parent=null,this.children.splice(t,1),e.dispatchEvent(u4o),LRe.child=e,this.dispatchEvent(LRe),LRe.child=null;return this}removeFromParent(){let e=this.parent;if(e!==null)e.remove(this);return this}clear(){return this.remove(...this.children)}attach(e){if(this.updateWorldMatrix(!0,!1),cw.copy(this.matrixWorld).invert(),e.parent!==null)e.parent.updateWorldMatrix(!0,!1),cw.multiply(e.parent.matrixWorld);return e.applyMatrix4(cw),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(qyt),QX.child=e,this.dispatchEvent(QX),QX.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,o=this.children.length;n<o;n++){let i=this.children[n].getObjectByProperty(e,t);if(i!==void 0)return i}return}getObjectsByProperty(e,t,n=[]){if(this[e]===t)n.push(this);let o=this.children;for(let r=0,i=o.length;r<i;r++)o[r].getObjectsByProperty(e,t,n);return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Mre,e,h4o),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Mre,d4o,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);let t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);let t=this.children;for(let n=0,o=t.length;n<o;n++)t[n].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);let t=this.children;for(let n=0,o=t.length;n<o;n++)t[n].traverseVisible(e)}traverseAncestors(e){let t=this.parent;if(t!==null)e(t),t.traverseAncestors(e)}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){if(this.matrixAutoUpdate)this.updateMatrix();if(this.matrixWorldNeedsUpdate||e){if(this.parent===null)this.matrixWorld.copy(this.matrix);else this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix);this.matrixWorldNeedsUpdate=!1,e=!0}let t=this.children;for(let n=0,o=t.length;n<o;n++){let r=t[n];if(r.matrixWorldAutoUpdate===!0||e===!0)r.updateMatrixWorld(e)}}updateWorldMatrix(e,t){let n=this.parent;if(e===!0&&n!==null&&n.matrixWorldAutoUpdate===!0)n.updateWorldMatrix(!0,!1);if(this.matrixAutoUpdate)this.updateMatrix();if(this.parent===null)this.matrixWorld.copy(this.matrix);else this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix);if(t===!0){let o=this.children;for(let r=0,i=o.length;r<i;r++){let s=o[r];if(s.matrixWorldAutoUpdate===!0)s.updateWorldMatrix(!1,!0)}}}toJSON(e){let t=e===void 0||typeof e==="string",n={};if(t)e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"};let o={};if(o.uuid=this.uuid,o.type=this.type,this.name!=="")o.name=this.name;if(this.castShadow===!0)o.castShadow=!0;if(this.receiveShadow===!0)o.receiveShadow=!0;if(this.visible===!1)o.visible=!1;if(this.frustumCulled===!1)o.frustumCulled=!1;if(this.renderOrder!==0)o.renderOrder=this.renderOrder;if(Object.keys(this.userData).length>0)o.userData=this.userData;if(o.layers=this.layers.mask,o.matrix=this.matrix.toArray(),o.up=this.up.toArray(),this.matrixAutoUpdate===!1)o.matrixAutoUpdate=!1;if(this.isInstancedMesh){if(o.type="InstancedMesh",o.count=this.count,o.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null)o.instanceColor=this.instanceColor.toJSON()}if(this.isBatchedMesh){if(o.type="BatchedMesh",o.perObjectFrustumCulled=this.perObjectFrustumCulled,o.sortObjects=this.sortObjects,o.drawRanges=this._drawRanges,o.reservedRanges=this._reservedRanges,o.visibility=this._visibility,o.active=this._active,o.bounds=this._bounds.map((s)=>({boxInitialized:s.boxInitialized,boxMin:s.box.min.toArray(),boxMax:s.box.max.toArray(),sphereInitialized:s.sphereInitialized,sphereRadius:s.sphere.radius,sphereCenter:s.sphere.center.toArray()})),o.maxGeometryCount=this._maxGeometryCount,o.maxVertexCount=this._maxVertexCount,o.maxIndexCount=this._maxIndexCount,o.geometryInitialized=this._geometryInitialized,o.geometryCount=this._geometryCount,o.matricesTexture=this._matricesTexture.toJSON(e),this._colorsTexture!==null)o.colorsTexture=this._colorsTexture.toJSON(e);if(this.boundingSphere!==null)o.boundingSphere={center:o.boundingSphere.center.toArray(),radius:o.boundingSphere.radius};if(this.boundingBox!==null)o.boundingBox={min:o.boundingBox.min.toArray(),max:o.boundingBox.max.toArray()}}function r(s,a){if(s[a.uuid]===void 0)s[a.uuid]=a.toJSON(e);return a.uuid}if(this.isScene){if(this.background){if(this.background.isColor)o.background=this.background.toJSON();else if(this.background.isTexture)o.background=this.background.toJSON(e).uuid}if(this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0)o.environment=this.environment.toJSON(e).uuid}else if(this.isMesh||this.isLine||this.isPoints){o.geometry=r(e.geometries,this.geometry);let s=this.geometry.parameters;if(s!==void 0&&s.shapes!==void 0){let a=s.shapes;if(Array.isArray(a))for(let c=0,l=a.length;c<l;c++){let h=a[c];r(e.shapes,h)}else r(e.shapes,a)}}if(this.isSkinnedMesh){if(o.bindMode=this.bindMode,o.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0)r(e.skeletons,this.skeleton),o.skeleton=this.skeleton.uuid}if(this.material!==void 0)if(Array.isArray(this.material)){let s=[];for(let a=0,c=this.material.length;a<c;a++)s.push(r(e.materials,this.material[a]));o.material=s}else o.material=r(e.materials,this.material);if(this.children.length>0){o.children=[];for(let s=0;s<this.children.length;s++)o.children.push(this.children[s].toJSON(e).object)}if(this.animations.length>0){o.animations=[];for(let s=0;s<this.animations.length;s++){let a=this.animations[s];o.animations.push(r(e.animations,a))}}if(t){let s=i(e.geometries),a=i(e.materials),c=i(e.textures),l=i(e.images),h=i(e.shapes),d=i(e.skeletons),u=i(e.animations),_=i(e.nodes);if(s.length>0)n.geometries=s;if(a.length>0)n.materials=a;if(c.length>0)n.textures=c;if(l.length>0)n.images=l;if(h.length>0)n.shapes=h;if(d.length>0)n.skeletons=d;if(u.length>0)n.animations=u;if(_.length>0)n.nodes=_}return n.object=o,n;function i(s){let a=[];for(let c in s){let l=s[c];delete l.metadata,a.push(l)}return a}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n<e.children.length;n++){let o=e.children[n];this.add(o.clone())}return this}}Sl.DEFAULT_UP=new Et(0,1,0);Sl.DEFAULT_MATRIX_AUTO_UPDATE=!0;Sl.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;var E9=new Et,lw=new Et,HRe=new Et,hw=new Et,kX=new Et,LX=new Et,Jyt=new Et,FRe=new Et,zRe=new Et,ORe=new Et;class B9{constructor(e=new Et,t=new Et,n=new Et){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,o){o.subVectors(n,t),E9.subVectors(e,t),o.cross(E9);let r=o.lengthSq();if(r>0)return o.multiplyScalar(1/Math.sqrt(r));return o.set(0,0,0)}static getBarycoord(e,t,n,o,r){E9.subVectors(o,t),lw.subVectors(n,t),HRe.subVectors(e,t);let i=E9.dot(E9),s=E9.dot(lw),a=E9.dot(HRe),c=lw.dot(lw),l=lw.dot(HRe),h=i*c-s*s;if(h===0)return r.set(0,0,0),null;let d=1/h,u=(c*a-s*l)*d,_=(i*l-s*a)*d;return r.set(1-u-_,_,u)}static containsPoint(e,t,n,o){if(this.getBarycoord(e,t,n,o,hw)===null)return!1;return hw.x>=0&&hw.y>=0&&hw.x+hw.y<=1}static getInterpolation(e,t,n,o,r,i,s,a){if(this.getBarycoord(e,t,n,o,hw)===null){if(a.x=0,a.y=0,"z"in a)a.z=0;if("w"in a)a.w=0;return null}return a.setScalar(0),a.addScaledVector(r,hw.x),a.addScaledVector(i,hw.y),a.addScaledVector(s,hw.z),a}static isFrontFacing(e,t,n,o){return E9.subVectors(n,t),lw.subVectors(e,t),E9.cross(lw).dot(o)<0?!0:!1}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,o){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[o]),this}setFromAttributeAndIndices(e,t,n,o){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,o),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return E9.subVectors(this.c,this.b),lw.subVectors(this.a,this.b),E9.cross(lw).length()*0.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(0.3333333333333333)}getNormal(e){return B9.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return B9.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,o,r){return B9.getInterpolation(e,this.a,this.b,this.c,t,n,o,r)}containsPoint(e){return B9.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return B9.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let n=this.a,o=this.b,r=this.c,i,s;kX.subVectors(o,n),LX.subVectors(r,n),FRe.subVectors(e,n);let a=kX.dot(FRe),c=LX.dot(FRe);if(a<=0&&c<=0)return t.copy(n);zRe.subVectors(e,o);let l=kX.dot(zRe),h=LX.dot(zRe);if(l>=0&&h<=l)return t.copy(o);let d=a*h-l*c;if(d<=0&&a>=0&&l<=0)return i=a/(a-l),t.copy(n).addScaledVector(kX,i);ORe.subVectors(e,r);let u=kX.dot(ORe),_=LX.dot(ORe);if(_>=0&&u<=_)return t.copy(r);let p=u*c-a*_;if(p<=0&&c>=0&&_<=0)return s=c/(c-_),t.copy(n).addScaledVector(LX,s);let m=l*_-u*h;if(m<=0&&h-l>=0&&u-_>=0)return Jyt.subVectors(r,o),s=(h-l)/(h-l+(u-_)),t.copy(o).addScaledVector(Jyt,s);let A=1/(m+p+d);return i=p*A,s=d*A,t.copy(n).addScaledVector(kX,i).addScaledVector(LX,s)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}var a5t={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},lR={h:0,s:0,l:0},oAe={h:0,s:0,l:0};function VRe(e,t,n){if(n<0)n+=1;if(n>1)n-=1;if(n<0.16666666666666666)return e+(t-e)*6*n;if(n<0.5)return t;if(n<0.6666666666666666)return e+(t-e)*6*(0.6666666666666666-n);return e}class No{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(t===void 0&&n===void 0){let o=e;if(o&&o.isColor)this.copy(o);else if(typeof o==="number")this.setHex(o);else if(typeof o==="string")this.setStyle(o)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t="srgb"){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Zh.toWorkingColorSpace(this,t),this}setRGB(e,t,n,o=Zh.workingColorSpace){return this.r=e,this.g=t,this.b=n,Zh.toWorkingColorSpace(this,o),this}setHSL(e,t,n,o=Zh.workingColorSpace){if(e=mQe(e,1),t=Qg(t,0,1),n=Qg(n,0,1),t===0)this.r=this.g=this.b=n;else{let r=n<=0.5?n*(1+t):n+t-n*t,i=2*n-r;this.r=VRe(i,r,e+0.3333333333333333),this.g=VRe(i,r,e),this.b=VRe(i,r,e-0.3333333333333333)}return Zh.toWorkingColorSpace(this,o),this}setStyle(e,t="srgb"){function n(r){if(r===void 0)return;if(parseFloat(r)<1)console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let o;if(o=/^(\w+)\(([^\)]*)\)/.exec(e)){let r,i=o[1],s=o[2];switch(i){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return n(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,t);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return n(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,t);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return n(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(o=/^\#([A-Fa-f\d]+)$/.exec(e)){let r=o[1],i=r.length;if(i===3)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,t);else if(i===6)return this.setHex(parseInt(r,16),t);else console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t="srgb"){let n=a5t[e.toLowerCase()];if(n!==void 0)this.setHex(n,t);else console.warn("THREE.Color: Unknown color "+e);return this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=KX(e.r),this.g=KX(e.g),this.b=KX(e.b),this}copyLinearToSRGB(e){return this.r=wRe(e.r),this.g=wRe(e.g),this.b=wRe(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e="srgb"){return Zh.fromWorkingColorSpace(r1.copy(this),e),Math.round(Qg(r1.r*255,0,255))*65536+Math.round(Qg(r1.g*255,0,255))*256+Math.round(Qg(r1.b*255,0,255))}getHexString(e="srgb"){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Zh.workingColorSpace){Zh.fromWorkingColorSpace(r1.copy(this),t);let{r:n,g:o,b:r}=r1,i=Math.max(n,o,r),s=Math.min(n,o,r),a,c,l=(s+i)/2;if(s===i)a=0,c=0;else{let h=i-s;switch(c=l<=0.5?h/(i+s):h/(2-i-s),i){case n:a=(o-r)/h+(o<r?6:0);break;case o:a=(r-n)/h+2;break;case r:a=(n-o)/h+4;break}a/=6}return e.h=a,e.s=c,e.l=l,e}getRGB(e,t=Zh.workingColorSpace){return Zh.fromWorkingColorSpace(r1.copy(this),t),e.r=r1.r,e.g=r1.g,e.b=r1.b,e}getStyle(e="srgb"){Zh.fromWorkingColorSpace(r1.copy(this),e);let{r:t,g:n,b:o}=r1;if(e!=="srgb")return`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${o.toFixed(3)})`;return`rgb(${Math.round(t*255)},${Math.round(n*255)},${Math.round(o*255)})`}offsetHSL(e,t,n){return this.getHSL(lR),this.setHSL(lR.h+e,lR.s+t,lR.l+n)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(lR),e.getHSL(oAe);let n=Qre(lR.h,oAe.h,t),o=Qre(lR.s,oAe.s,t),r=Qre(lR.l,oAe.l,t);return this.setHSL(n,o,r),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){let t=this.r,n=this.g,o=this.b,r=e.elements;return this.r=r[0]*t+r[3]*n+r[6]*o,this.g=r[1]*t+r[4]*n+r[7]*o,this.b=r[2]*t+r[5]*n+r[8]*o,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}var r1=new No;No.NAMES=a5t;var p4o=0;class zA extends uw{constructor(){super();this.isMaterial=!0,Object.defineProperty(this,"id",{value:p4o++}),this.uuid=wb(),this.name="",this.type="Material",this.blending=1,this.side=0,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=100,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new No(0,0,0),this.blendAlpha=0,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=7680,this.stencilZFail=7680,this.stencilZPass=7680,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){if(this._alphaTest>0!==e>0)this.version++;this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e===void 0)return;for(let t in e){let n=e[t];if(n===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}let o=this[t];if(o===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}if(o&&o.isColor)o.set(n);else if(o&&o.isVector3&&(n&&n.isVector3))o.copy(n);else this[t]=n}}toJSON(e){let t=e===void 0||typeof e==="string";if(t)e={textures:{},images:{}};let n={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};if(n.uuid=this.uuid,n.type=this.type,this.name!=="")n.name=this.name;if(this.color&&this.color.isColor)n.color=this.color.getHex();if(this.roughness!==void 0)n.roughness=this.roughness;if(this.metalness!==void 0)n.metalness=this.metalness;if(this.sheen!==void 0)n.sheen=this.sheen;if(this.sheenColor&&this.sheenColor.isColor)n.sheenColor=this.sheenColor.getHex();if(this.sheenRoughness!==void 0)n.sheenRoughness=this.sheenRoughness;if(this.emissive&&this.emissive.isColor)n.emissive=this.emissive.getHex();if(this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1)n.emissiveIntensity=this.emissiveIntensity;if(this.specular&&this.specular.isColor)n.specular=this.specular.getHex();if(this.specularIntensity!==void 0)n.specularIntensity=this.specularIntensity;if(this.specularColor&&this.specularColor.isColor)n.specularColor=this.specularColor.getHex();if(this.shininess!==void 0)n.shininess=this.shininess;if(this.clearcoat!==void 0)n.clearcoat=this.clearcoat;if(this.clearcoatRoughness!==void 0)n.clearcoatRoughness=this.clearcoatRoughness;if(this.clearcoatMap&&this.clearcoatMap.isTexture)n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid;if(this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture)n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid;if(this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture)n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray();if(this.dispersion!==void 0)n.dispersion=this.dispersion;if(this.iridescence!==void 0)n.iridescence=this.iridescence;if(this.iridescenceIOR!==void 0)n.iridescenceIOR=this.iridescenceIOR;if(this.iridescenceThicknessRange!==void 0)n.iridescenceThicknessRange=this.iridescenceThicknessRange;if(this.iridescenceMap&&this.iridescenceMap.isTexture)n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid;if(this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture)n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid;if(this.anisotropy!==void 0)n.anisotropy=this.anisotropy;if(this.anisotropyRotation!==void 0)n.anisotropyRotation=this.anisotropyRotation;if(this.anisotropyMap&&this.anisotropyMap.isTexture)n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid;if(this.map&&this.map.isTexture)n.map=this.map.toJSON(e).uuid;if(this.matcap&&this.matcap.isTexture)n.matcap=this.matcap.toJSON(e).uuid;if(this.alphaMap&&this.alphaMap.isTexture)n.alphaMap=this.alphaMap.toJSON(e).uuid;if(this.lightMap&&this.lightMap.isTexture)n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity;if(this.aoMap&&this.aoMap.isTexture)n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity;if(this.bumpMap&&this.bumpMap.isTexture)n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale;if(this.normalMap&&this.normalMap.isTexture)n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray();if(this.displacementMap&&this.displacementMap.isTexture)n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias;if(this.roughnessMap&&this.roughnessMap.isTexture)n.roughnessMap=this.roughnessMap.toJSON(e).uuid;if(this.metalnessMap&&this.metalnessMap.isTexture)n.metalnessMap=this.metalnessMap.toJSON(e).uuid;if(this.emissiveMap&&this.emissiveMap.isTexture)n.emissiveMap=this.emissiveMap.toJSON(e).uuid;if(this.specularMap&&this.specularMap.isTexture)n.specularMap=this.specularMap.toJSON(e).uuid;if(this.specularIntensityMap&&this.specularIntensityMap.isTexture)n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid;if(this.specularColorMap&&this.specularColorMap.isTexture)n.specularColorMap=this.specularColorMap.toJSON(e).uuid;if(this.envMap&&this.envMap.isTexture){if(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0)n.combine=this.combine}if(this.envMapRotation!==void 0)n.envMapRotation=this.envMapRotation.toArray();if(this.envMapIntensity!==void 0)n.envMapIntensity=this.envMapIntensity;if(this.reflectivity!==void 0)n.reflectivity=this.reflectivity;if(this.refractionRatio!==void 0)n.refractionRatio=this.refractionRatio;if(this.gradientMap&&this.gradientMap.isTexture)n.gradientMap=this.gradientMap.toJSON(e).uuid;if(this.transmission!==void 0)n.transmission=this.transmission;if(this.transmissionMap&&this.transmissionMap.isTexture)n.transmissionMap=this.transmissionMap.toJSON(e).uuid;if(this.thickness!==void 0)n.thickness=this.thickness;if(this.thicknessMap&&this.thicknessMap.isTexture)n.thicknessMap=this.thicknessMap.toJSON(e).uuid;if(this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0)n.attenuationDistance=this.attenuationDistance;if(this.attenuationColor!==void 0)n.attenuationColor=this.attenuationColor.getHex();if(this.size!==void 0)n.size=this.size;if(this.shadowSide!==null)n.shadowSide=this.shadowSide;if(this.sizeAttenuation!==void 0)n.sizeAttenuation=this.sizeAttenuation;if(this.blending!==1)n.blending=this.blending;if(this.side!==0)n.side=this.side;if(this.vertexColors===!0)n.vertexColors=!0;if(this.opacity<1)n.opacity=this.opacity;if(this.transparent===!0)n.transparent=!0;if(this.blendSrc!==204)n.blendSrc=this.blendSrc;if(this.blendDst!==205)n.blendDst=this.blendDst;if(this.blendEquation!==100)n.blendEquation=this.blendEquation;if(this.blendSrcAlpha!==null)n.blendSrcAlpha=this.blendSrcAlpha;if(this.blendDstAlpha!==null)n.blendDstAlpha=this.blendDstAlpha;if(this.blendEquationAlpha!==null)n.blendEquationAlpha=this.blendEquationAlpha;if(this.blendColor&&this.blendColor.isColor)n.blendColor=this.blendColor.getHex();if(this.blendAlpha!==0)n.blendAlpha=this.blendAlpha;if(this.depthFunc!==3)n.depthFunc=this.depthFunc;if(this.depthTest===!1)n.depthTest=this.depthTest;if(this.depthWrite===!1)n.depthWrite=this.depthWrite;if(this.colorWrite===!1)n.colorWrite=this.colorWrite;if(this.stencilWriteMask!==255)n.stencilWriteMask=this.stencilWriteMask;if(this.stencilFunc!==519)n.stencilFunc=this.stencilFunc;if(this.stencilRef!==0)n.stencilRef=this.stencilRef;if(this.stencilFuncMask!==255)n.stencilFuncMask=this.stencilFuncMask;if(this.stencilFail!==7680)n.stencilFail=this.stencilFail;if(this.stencilZFail!==7680)n.stencilZFail=this.stencilZFail;if(this.stencilZPass!==7680)n.stencilZPass=this.stencilZPass;if(this.stencilWrite===!0)n.stencilWrite=this.stencilWrite;if(this.rotation!==void 0&&this.rotation!==0)n.rotation=this.rotation;if(this.polygonOffset===!0)n.polygonOffset=!0;if(this.polygonOffsetFactor!==0)n.polygonOffsetFactor=this.polygonOffsetFactor;if(this.polygonOffsetUnits!==0)n.polygonOffsetUnits=this.polygonOffsetUnits;if(this.linewidth!==void 0&&this.linewidth!==1)n.linewidth=this.linewidth;if(this.dashSize!==void 0)n.dashSize=this.dashSize;if(this.gapSize!==void 0)n.gapSize=this.gapSize;if(this.scale!==void 0)n.scale=this.scale;if(this.dithering===!0)n.dithering=!0;if(this.alphaTest>0)n.alphaTest=this.alphaTest;if(this.alphaHash===!0)n.alphaHash=!0;if(this.alphaToCoverage===!0)n.alphaToCoverage=!0;if(this.premultipliedAlpha===!0)n.premultipliedAlpha=!0;if(this.forceSinglePass===!0)n.forceSinglePass=!0;if(this.wireframe===!0)n.wireframe=!0;if(this.wireframeLinewidth>1)n.wireframeLinewidth=this.wireframeLinewidth;if(this.wireframeLinecap!=="round")n.wireframeLinecap=this.wireframeLinecap;if(this.wireframeLinejoin!=="round")n.wireframeLinejoin=this.wireframeLinejoin;if(this.flatShading===!0)n.flatShading=!0;if(this.visible===!1)n.visible=!1;if(this.toneMapped===!1)n.toneMapped=!1;if(this.fog===!1)n.fog=!1;if(Object.keys(this.userData).length>0)n.userData=this.userData;function o(r){let i=[];for(let s in r){let a=r[s];delete a.metadata,i.push(a)}return i}if(t){let r=o(e.textures),i=o(e.images);if(r.length>0)n.textures=r;if(i.length>0)n.images=i}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;let t=e.clippingPlanes,n=null;if(t!==null){let o=t.length;n=Array(o);for(let r=0;r!==o;++r)n[r]=t[r].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){if(e===!0)this.version++}}class Up extends zA{constructor(e){super();this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new No(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new FA,this.combine=0,this.reflectivity=1,this.refractionRatio=0.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}var I_=new Et,rAe=new ro;class Pl{constructor(e,t,n=!1){if(Array.isArray(e))throw TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=n,this.usage=35044,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=1015,this.version=0}onUploadCallback(){}set needsUpdate(e){if(e===!0)this.version++}get updateRange(){return _Qe("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let o=0,r=this.itemSize;o<r;o++)this.array[e+o]=t.array[n+o];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,n=this.count;t<n;t++)rAe.fromBufferAttribute(this,t),rAe.applyMatrix3(e),this.setXY(t,rAe.x,rAe.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)I_.fromBufferAttribute(this,t),I_.applyMatrix3(e),this.setXYZ(t,I_.x,I_.y,I_.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)I_.fromBufferAttribute(this,t),I_.applyMatrix4(e),this.setXYZ(t,I_.x,I_.y,I_.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)I_.fromBufferAttribute(this,t),I_.applyNormalMatrix(e),this.setXYZ(t,I_.x,I_.y,I_.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)I_.fromBufferAttribute(this,t),I_.transformDirection(e),this.setXYZ(t,I_.x,I_.y,I_.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let n=this.array[e*this.itemSize+t];if(this.normalized)n=w9(n,this.array);return n}setComponent(e,t,n){if(this.normalized)n=Jh(n,this.array);return this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];if(this.normalized)t=w9(t,this.array);return t}setX(e,t){if(this.normalized)t=Jh(t,this.array);return this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];if(this.normalized)t=w9(t,this.array);return t}setY(e,t){if(this.normalized)t=Jh(t,this.array);return this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];if(this.normalized)t=w9(t,this.array);return t}setZ(e,t){if(this.normalized)t=Jh(t,this.array);return this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];if(this.normalized)t=w9(t,this.array);return t}setW(e,t){if(this.normalized)t=Jh(t,this.array);return this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){if(e*=this.itemSize,this.normalized)t=Jh(t,this.array),n=Jh(n,this.array);return this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,o){if(e*=this.itemSize,this.normalized)t=Jh(t,this.array),n=Jh(n,this.array),o=Jh(o,this.array);return this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=o,this}setXYZW(e,t,n,o,r){if(e*=this.itemSize,this.normalized)t=Jh(t,this.array),n=Jh(n,this.array),o=Jh(o,this.array),r=Jh(r,this.array);return this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=o,this.array[e+3]=r,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){let e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};if(this.name!=="")e.name=this.name;if(this.usage!==35044)e.usage=this.usage;return e}}class fQe extends Pl{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class jre extends Pl{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class Wr extends Pl{constructor(e,t,n){super(new Float32Array(e),t,n)}}var m4o=0,Eb=new Gi,YRe=new Sl,HX=new Et,c3=new Mu,wre=new Mu,HA=new Et;class js extends uw{constructor(){super();this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:m4o++}),this.uuid=wb(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){if(Array.isArray(e))this.index=new((o5t(e))?jre:fQe)(e,1);else this.index=e;return this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){let t=this.attributes.position;if(t!==void 0)t.applyMatrix4(e),t.needsUpdate=!0;let n=this.attributes.normal;if(n!==void 0){let r=new Ya().getNormalMatrix(e);n.applyNormalMatrix(r),n.needsUpdate=!0}let o=this.attributes.tangent;if(o!==void 0)o.transformDirection(e),o.needsUpdate=!0;if(this.boundingBox!==null)this.computeBoundingBox();if(this.boundingSphere!==null)this.computeBoundingSphere();return this}applyQuaternion(e){return Eb.makeRotationFromQuaternion(e),this.applyMatrix4(Eb),this}rotateX(e){return Eb.makeRotationX(e),this.applyMatrix4(Eb),this}rotateY(e){return Eb.makeRotationY(e),this.applyMatrix4(Eb),this}rotateZ(e){return Eb.makeRotationZ(e),this.applyMatrix4(Eb),this}translate(e,t,n){return Eb.makeTranslation(e,t,n),this.applyMatrix4(Eb),this}scale(e,t,n){return Eb.makeScale(e,t,n),this.applyMatrix4(Eb),this}lookAt(e){return YRe.lookAt(e),YRe.updateMatrix(),this.applyMatrix4(YRe.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(HX).negate(),this.translate(HX.x,HX.y,HX.z),this}setFromPoints(e){let t=[];for(let n=0,o=e.length;n<o;n++){let r=e[n];t.push(r.x,r.y,r.z||0)}return this.setAttribute("position",new Wr(t,3)),this}computeBoundingBox(){if(this.boundingBox===null)this.boundingBox=new Mu;let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new Et(-1/0,-1/0,-1/0),new Et(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let n=0,o=t.length;n<o;n++){let r=t[n];if(c3.setFromBufferAttribute(r),this.morphTargetsRelative)HA.addVectors(this.boundingBox.min,c3.min),this.boundingBox.expandByPoint(HA),HA.addVectors(this.boundingBox.max,c3.max),this.boundingBox.expandByPoint(HA);else this.boundingBox.expandByPoint(c3.min),this.boundingBox.expandByPoint(c3.max)}}else this.boundingBox.makeEmpty();if(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){if(this.boundingSphere===null)this.boundingSphere=new v_;let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new Et,1/0);return}if(e){let n=this.boundingSphere.center;if(c3.setFromBufferAttribute(e),t)for(let r=0,i=t.length;r<i;r++){let s=t[r];if(wre.setFromBufferAttribute(s),this.morphTargetsRelative)HA.addVectors(c3.min,wre.min),c3.expandByPoint(HA),HA.addVectors(c3.max,wre.max),c3.expandByPoint(HA);else c3.expandByPoint(wre.min),c3.expandByPoint(wre.max)}c3.getCenter(n);let o=0;for(let r=0,i=e.count;r<i;r++)HA.fromBufferAttribute(e,r),o=Math.max(o,n.distanceToSquared(HA));if(t)for(let r=0,i=t.length;r<i;r++){let s=t[r],a=this.morphTargetsRelative;for(let c=0,l=s.count;c<l;c++){if(HA.fromBufferAttribute(s,c),a)HX.fromBufferAttribute(e,c),HA.add(HX);o=Math.max(o,n.distanceToSquared(HA))}}if(this.boundingSphere.radius=Math.sqrt(o),isNaN(this.boundingSphere.radius))console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){let e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}let{position:n,normal:o,uv:r}=t;if(this.hasAttribute("tangent")===!1)this.setAttribute("tangent",new Pl(new Float32Array(4*n.count),4));let i=this.getAttribute("tangent"),s=[],a=[];for(let I=0;I<n.count;I++)s[I]=new Et,a[I]=new Et;let c=new Et,l=new Et,h=new Et,d=new ro,u=new ro,_=new ro,p=new Et,m=new Et;function A(I,v,P){c.fromBufferAttribute(n,I),l.fromBufferAttribute(n,v),h.fromBufferAttribute(n,P),d.fromBufferAttribute(r,I),u.fromBufferAttribute(r,v),_.fromBufferAttribute(r,P),l.sub(c),h.sub(c),u.sub(d),_.sub(d);let M=1/(u.x*_.y-_.x*u.y);if(!isFinite(M))return;p.copy(l).multiplyScalar(_.y).addScaledVector(h,-u.y).multiplyScalar(M),m.copy(h).multiplyScalar(u.x).addScaledVector(l,-_.x).multiplyScalar(M),s[I].add(p),s[v].add(p),s[P].add(p),a[I].add(m),a[v].add(m),a[P].add(m)}let g=this.groups;if(g.length===0)g=[{start:0,count:e.count}];for(let I=0,v=g.length;I<v;++I){let P=g[I],{start:M,count:B}=P;for(let T=M,N=M+B;T<N;T+=3)A(e.getX(T+0),e.getX(T+1),e.getX(T+2))}let f=new Et,y=new Et,x=new Et,C=new Et;function b(I){x.fromBufferAttribute(o,I),C.copy(x);let v=s[I];f.copy(v),f.sub(x.multiplyScalar(x.dot(v))).normalize(),y.crossVectors(C,v);let M=y.dot(a[I])<0?-1:1;i.setXYZW(I,f.x,f.y,f.z,M)}for(let I=0,v=g.length;I<v;++I){let P=g[I],{start:M,count:B}=P;for(let T=M,N=M+B;T<N;T+=3)b(e.getX(T+0)),b(e.getX(T+1)),b(e.getX(T+2))}}computeVertexNormals(){let e=this.index,t=this.getAttribute("position");if(t!==void 0){let n=this.getAttribute("normal");if(n===void 0)n=new Pl(new Float32Array(t.count*3),3),this.setAttribute("normal",n);else for(let d=0,u=n.count;d<u;d++)n.setXYZ(d,0,0,0);let o=new Et,r=new Et,i=new Et,s=new Et,a=new Et,c=new Et,l=new Et,h=new Et;if(e)for(let d=0,u=e.count;d<u;d+=3){let _=e.getX(d+0),p=e.getX(d+1),m=e.getX(d+2);o.fromBufferAttribute(t,_),r.fromBufferAttribute(t,p),i.fromBufferAttribute(t,m),l.subVectors(i,r),h.subVectors(o,r),l.cross(h),s.fromBufferAttribute(n,_),a.fromBufferAttribute(n,p),c.fromBufferAttribute(n,m),s.add(l),a.add(l),c.add(l),n.setXYZ(_,s.x,s.y,s.z),n.setXYZ(p,a.x,a.y,a.z),n.setXYZ(m,c.x,c.y,c.z)}else for(let d=0,u=t.count;d<u;d+=3)o.fromBufferAttribute(t,d+0),r.fromBufferAttribute(t,d+1),i.fromBufferAttribute(t,d+2),l.subVectors(i,r),h.subVectors(o,r),l.cross(h),n.setXYZ(d+0,l.x,l.y,l.z),n.setXYZ(d+1,l.x,l.y,l.z),n.setXYZ(d+2,l.x,l.y,l.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){let e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)HA.fromBufferAttribute(e,t),HA.normalize(),e.setXYZ(t,HA.x,HA.y,HA.z)}toNonIndexed(){function e(s,a){let{array:c,itemSize:l,normalized:h}=s,d=new c.constructor(a.length*l),u=0,_=0;for(let p=0,m=a.length;p<m;p++){if(s.isInterleavedBufferAttribute)u=a[p]*s.data.stride+s.offset;else u=a[p]*l;for(let A=0;A<l;A++)d[_++]=c[u++]}return new Pl(d,l,h)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;let t=new js,n=this.index.array,o=this.attributes;for(let s in o){let a=o[s],c=e(a,n);t.setAttribute(s,c)}let r=this.morphAttributes;for(let s in r){let a=[],c=r[s];for(let l=0,h=c.length;l<h;l++){let d=c[l],u=e(d,n);a.push(u)}t.morphAttributes[s]=a}t.morphTargetsRelative=this.morphTargetsRelative;let i=this.groups;for(let s=0,a=i.length;s<a;s++){let c=i[s];t.addGroup(c.start,c.count,c.materialIndex)}return t}toJSON(){let e={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!=="")e.name=this.name;if(Object.keys(this.userData).length>0)e.userData=this.userData;if(this.parameters!==void 0){let a=this.parameters;for(let c in a)if(a[c]!==void 0)e[c]=a[c];return e}e.data={attributes:{}};let t=this.index;if(t!==null)e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)};let n=this.attributes;for(let a in n){let c=n[a];e.data.attributes[a]=c.toJSON(e.data)}let o={},r=!1;for(let a in this.morphAttributes){let c=this.morphAttributes[a],l=[];for(let h=0,d=c.length;h<d;h++){let u=c[h];l.push(u.toJSON(e.data))}if(l.length>0)o[a]=l,r=!0}if(r)e.data.morphAttributes=o,e.data.morphTargetsRelative=this.morphTargetsRelative;let i=this.groups;if(i.length>0)e.data.groups=JSON.parse(JSON.stringify(i));let s=this.boundingSphere;if(s!==null)e.data.boundingSphere={center:s.center.toArray(),radius:s.radius};return e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let t={};this.name=e.name;let n=e.index;if(n!==null)this.setIndex(n.clone(t));let o=e.attributes;for(let c in o){let l=o[c];this.setAttribute(c,l.clone(t))}let r=e.morphAttributes;for(let c in r){let l=[],h=r[c];for(let d=0,u=h.length;d<u;d++)l.push(h[d].clone(t));this.morphAttributes[c]=l}this.morphTargetsRelative=e.morphTargetsRelative;let i=e.groups;for(let c=0,l=i.length;c<l;c++){let h=i[c];this.addGroup(h.start,h.count,h.materialIndex)}let s=e.boundingBox;if(s!==null)this.boundingBox=s.clone();let a=e.boundingSphere;if(a!==null)this.boundingSphere=a.clone();return this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}var Zyt=new Gi,Cz=new V7,iAe=new v_,ext=new Et,FX=new Et,zX=new Et,OX=new Et,GRe=new Et,sAe=new Et,aAe=new ro,cAe=new ro,lAe=new ro,txt=new Et,nxt=new Et,oxt=new Et,hAe=new Et,dAe=new Et;class Mo extends Sl{constructor(e=new js,t=new Up){super();this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){if(super.copy(e,t),e.morphTargetInfluences!==void 0)this.morphTargetInfluences=e.morphTargetInfluences.slice();if(e.morphTargetDictionary!==void 0)this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary);return this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){let t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){let o=t[n[0]];if(o!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,i=o.length;r<i;r++){let s=o[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[s]=r}}}}getVertexPosition(e,t){let n=this.geometry,o=n.attributes.position,r=n.morphAttributes.position,i=n.morphTargetsRelative;t.fromBufferAttribute(o,e);let s=this.morphTargetInfluences;if(r&&s){sAe.set(0,0,0);for(let a=0,c=r.length;a<c;a++){let l=s[a],h=r[a];if(l===0)continue;if(GRe.fromBufferAttribute(h,e),i)sAe.addScaledVector(GRe,l);else sAe.addScaledVector(GRe.sub(t),l)}t.add(sAe)}return t}raycast(e,t){let n=this.geometry,o=this.material,r=this.matrixWorld;if(o===void 0)return;if(n.boundingSphere===null)n.computeBoundingSphere();if(iAe.copy(n.boundingSphere),iAe.applyMatrix4(r),Cz.copy(e.ray).recast(e.near),iAe.containsPoint(Cz.origin)===!1){if(Cz.intersectSphere(iAe,ext)===null)return;if(Cz.origin.distanceToSquared(ext)>(e.far-e.near)**2)return}if(Zyt.copy(r).invert(),Cz.copy(e.ray).applyMatrix4(Zyt),n.boundingBox!==null){if(Cz.intersectsBox(n.boundingBox)===!1)return}this._computeIntersections(e,t,Cz)}_computeIntersections(e,t,n){let o,r=this.geometry,i=this.material,s=r.index,a=r.attributes.position,c=r.attributes.uv,l=r.attributes.uv1,h=r.attributes.normal,{groups:d,drawRange:u}=r;if(s!==null)if(Array.isArray(i))for(let _=0,p=d.length;_<p;_++){let m=d[_],A=i[m.materialIndex],g=Math.max(m.start,u.start),f=Math.min(s.count,Math.min(m.start+m.count,u.start+u.count));for(let y=g,x=f;y<x;y+=3){let C=s.getX(y),b=s.getX(y+1),I=s.getX(y+2);if(o=uAe(this,A,e,n,c,l,h,C,b,I),o)o.faceIndex=Math.floor(y/3),o.face.materialIndex=m.materialIndex,t.push(o)}}else{let _=Math.max(0,u.start),p=Math.min(s.count,u.start+u.count);for(let m=_,A=p;m<A;m+=3){let g=s.getX(m),f=s.getX(m+1),y=s.getX(m+2);if(o=uAe(this,i,e,n,c,l,h,g,f,y),o)o.faceIndex=Math.floor(m/3),t.push(o)}}else if(a!==void 0)if(Array.isArray(i))for(let _=0,p=d.length;_<p;_++){let m=d[_],A=i[m.materialIndex],g=Math.max(m.start,u.start),f=Math.min(a.count,Math.min(m.start+m.count,u.start+u.count));for(let y=g,x=f;y<x;y+=3){let C=y,b=y+1,I=y+2;if(o=uAe(this,A,e,n,c,l,h,C,b,I),o)o.faceIndex=Math.floor(y/3),o.face.materialIndex=m.materialIndex,t.push(o)}}else{let _=Math.max(0,u.start),p=Math.min(a.count,u.start+u.count);for(let m=_,A=p;m<A;m+=3){let g=m,f=m+1,y=m+2;if(o=uAe(this,i,e,n,c,l,h,g,f,y),o)o.faceIndex=Math.floor(m/3),t.push(o)}}}}function _4o(e,t,n,o,r,i,s,a){let c;if(t.side===1)c=o.intersectTriangle(s,i,r,!0,a);else c=o.intersectTriangle(r,i,s,t.side===0,a);if(c===null)return null;dAe.copy(a),dAe.applyMatrix4(e.matrixWorld);let l=n.ray.origin.distanceTo(dAe);if(l<n.near||l>n.far)return null;return{distance:l,point:dAe.clone(),object:e}}function uAe(e,t,n,o,r,i,s,a,c,l){e.getVertexPosition(a,FX),e.getVertexPosition(c,zX),e.getVertexPosition(l,OX);let h=_4o(e,t,n,o,FX,zX,OX,hAe);if(h){if(r)aAe.fromBufferAttribute(r,a),cAe.fromBufferAttribute(r,c),lAe.fromBufferAttribute(r,l),h.uv=B9.getInterpolation(hAe,FX,zX,OX,aAe,cAe,lAe,new ro);if(i)aAe.fromBufferAttribute(i,a),cAe.fromBufferAttribute(i,c),lAe.fromBufferAttribute(i,l),h.uv1=B9.getInterpolation(hAe,FX,zX,OX,aAe,cAe,lAe,new ro);if(s){if(txt.fromBufferAttribute(s,a),nxt.fromBufferAttribute(s,c),oxt.fromBufferAttribute(s,l),h.normal=B9.getInterpolation(hAe,FX,zX,OX,txt,nxt,oxt,new Et),h.normal.dot(o.direction)>0)h.normal.multiplyScalar(-1)}let d={a,b:c,c:l,normal:new Et,materialIndex:0};B9.getNormal(FX,zX,OX,d.normal),h.face=d}return h}class S_ extends js{constructor(e=1,t=1,n=1,o=1,r=1,i=1){super();this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:o,heightSegments:r,depthSegments:i};let s=this;o=Math.floor(o),r=Math.floor(r),i=Math.floor(i);let a=[],c=[],l=[],h=[],d=0,u=0;_("z","y","x",-1,-1,n,t,e,i,r,0),_("z","y","x",1,-1,n,t,-e,i,r,1),_("x","z","y",1,1,e,n,t,o,i,2),_("x","z","y",1,-1,e,n,-t,o,i,3),_("x","y","z",1,-1,e,t,n,o,r,4),_("x","y","z",-1,-1,e,t,-n,o,r,5),this.setIndex(a),this.setAttribute("position",new Wr(c,3)),this.setAttribute("normal",new Wr(l,3)),this.setAttribute("uv",new Wr(h,2));function _(p,m,A,g,f,y,x,C,b,I,v){let P=y/b,M=x/I,B=y/2,T=x/2,N=C/2,D=b+1,L=I+1,H=0,V=0,O=new Et;for(let U=0;U<L;U++){let j=U*M-T;for(let Y=0;Y<D;Y++){let X=Y*P-B;O[p]=X*g,O[m]=j*f,O[A]=N,c.push(O.x,O.y,O.z),O[p]=0,O[m]=0,O[A]=C>0?1:-1,l.push(O.x,O.y,O.z),h.push(Y/b),h.push(1-U/I),H+=1}}for(let U=0;U<I;U++)for(let j=0;j<b;j++){let Y=d+j+D*U,X=d+j+D*(U+1),K=d+(j+1)+D*(U+1),J=d+(j+1)+D*U;a.push(Y,X,J),a.push(X,K,J),V+=6}s.addGroup(u,V,v),u+=V,d+=H}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new S_(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function qX(e){let t={};for(let n in e){t[n]={};for(let o in e[n]){let r=e[n][o];if(r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion))if(r.isRenderTargetTexture)console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),t[n][o]=null;else t[n][o]=r.clone();else if(Array.isArray(r))t[n][o]=r.slice();else t[n][o]=r}}return t}function Ty(e){let t={};for(let n=0;n<e.length;n++){let o=qX(e[n]);for(let r in o)t[r]=o[r]}return t}function g4o(e){let t=[];for(let n=0;n<e.length;n++)t.push(e[n].clone());return t}function c5t(e){let t=e.getRenderTarget();if(t===null)return e.outputColorSpace;if(t.isXRRenderTarget===!0)return t.texture.colorSpace;return Zh.workingColorSpace}var yQe={clone:qX,merge:Ty},A4o=`void main() {
	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
}`,f4o=`void main() {
	gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
}`;class l3 extends zA{constructor(e){super();if(this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=A4o,this.fragmentShader=f4o,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0)this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=qX(e.uniforms),this.uniformsGroups=g4o(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){let t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(let o in this.uniforms){let i=this.uniforms[o].value;if(i&&i.isTexture)t.uniforms[o]={type:"t",value:i.toJSON(e).uuid};else if(i&&i.isColor)t.uniforms[o]={type:"c",value:i.getHex()};else if(i&&i.isVector2)t.uniforms[o]={type:"v2",value:i.toArray()};else if(i&&i.isVector3)t.uniforms[o]={type:"v3",value:i.toArray()};else if(i&&i.isVector4)t.uniforms[o]={type:"v4",value:i.toArray()};else if(i&&i.isMatrix3)t.uniforms[o]={type:"m3",value:i.toArray()};else if(i&&i.isMatrix4)t.uniforms[o]={type:"m4",value:i.toArray()};else t.uniforms[o]={value:i}}if(Object.keys(this.defines).length>0)t.defines=this.defines;t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;let n={};for(let o in this.extensions)if(this.extensions[o]===!0)n[o]=!0;if(Object.keys(n).length>0)t.extensions=n;return t}}class xQe extends Sl{constructor(){super();this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Gi,this.projectionMatrix=new Gi,this.projectionMatrixInverse=new Gi,this.coordinateSystem=2000}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}var hR=new Et,rxt=new ro,ixt=new ro;class Pc extends xQe{constructor(e=50,t=1,n=0.1,o=2000){super();this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=o,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){let t=0.5*this.getFilmHeight()/e;this.fov=$X*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){let e=Math.tan(jX*0.5*this.fov);return 0.5*this.getFilmHeight()/e}getEffectiveFOV(){return $X*2*Math.atan(Math.tan(jX*0.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,n){hR.set(-1,-1,0.5).applyMatrix4(this.projectionMatrixInverse),t.set(hR.x,hR.y).multiplyScalar(-e/hR.z),hR.set(1,1,0.5).applyMatrix4(this.projectionMatrixInverse),n.set(hR.x,hR.y).multiplyScalar(-e/hR.z)}getViewSize(e,t){return this.getViewBounds(e,rxt,ixt),t.subVectors(ixt,rxt)}setViewOffset(e,t,n,o,r,i){if(this.aspect=e/t,this.view===null)this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1};this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=o,this.view.width=r,this.view.height=i,this.updateProjectionMatrix()}clearViewOffset(){if(this.view!==null)this.view.enabled=!1;this.updateProjectionMatrix()}updateProjectionMatrix(){let e=this.near,t=e*Math.tan(jX*0.5*this.fov)/this.zoom,n=2*t,o=this.aspect*n,r=-0.5*o,i=this.view;if(this.view!==null&&this.view.enabled){let{fullWidth:a,fullHeight:c}=i;r+=i.offsetX*o/a,t-=i.offsetY*n/c,o*=i.width/a,n*=i.height/c}let s=this.filmOffset;if(s!==0)r+=e*s/this.getFilmWidth();this.projectionMatrix.makePerspective(r,r+o,t,t-n,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);if(t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null)t.object.view=Object.assign({},this.view);return t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}var VX=-90,YX=1;class l5t extends Sl{constructor(e,t,n){super();this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;let o=new Pc(VX,YX,e,t);o.layers=this.layers,this.add(o);let r=new Pc(VX,YX,e,t);r.layers=this.layers,this.add(r);let i=new Pc(VX,YX,e,t);i.layers=this.layers,this.add(i);let s=new Pc(VX,YX,e,t);s.layers=this.layers,this.add(s);let a=new Pc(VX,YX,e,t);a.layers=this.layers,this.add(a);let c=new Pc(VX,YX,e,t);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){let e=this.coordinateSystem,t=this.children.concat(),[n,o,r,i,s,a]=t;for(let c of t)this.remove(c);if(e===2000)n.up.set(0,1,0),n.lookAt(1,0,0),o.up.set(0,1,0),o.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),i.up.set(0,0,1),i.lookAt(0,-1,0),s.up.set(0,1,0),s.lookAt(0,0,1),a.up.set(0,1,0),a.lookAt(0,0,-1);else if(e===2001)n.up.set(0,-1,0),n.lookAt(-1,0,0),o.up.set(0,-1,0),o.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),i.up.set(0,0,-1),i.lookAt(0,-1,0),s.up.set(0,-1,0),s.lookAt(0,0,1),a.up.set(0,-1,0),a.lookAt(0,0,-1);else throw Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(let c of t)this.add(c),c.updateMatrixWorld()}update(e,t){if(this.parent===null)this.updateMatrixWorld();let{renderTarget:n,activeMipmapLevel:o}=this;if(this.coordinateSystem!==e.coordinateSystem)this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem();let[r,i,s,a,c,l]=this.children,h=e.getRenderTarget(),d=e.getActiveCubeFace(),u=e.getActiveMipmapLevel(),_=e.xr.enabled;e.xr.enabled=!1;let p=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0,o),e.render(t,r),e.setRenderTarget(n,1,o),e.render(t,i),e.setRenderTarget(n,2,o),e.render(t,s),e.setRenderTarget(n,3,o),e.render(t,a),e.setRenderTarget(n,4,o),e.render(t,c),n.texture.generateMipmaps=p,e.setRenderTarget(n,5,o),e.render(t,l),e.setRenderTarget(h,d,u),e.xr.enabled=_,n.texture.needsPMREMUpdate=!0}}class CQe extends vl{constructor(e,t,n,o,r,i,s,a,c,l){e=e!==void 0?e:[],t=t!==void 0?t:301;super(e,t,n,o,r,i,s,a,c,l);this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class h5t extends uR{constructor(e=1,t={}){super(e,e,t);this.isWebGLCubeRenderTarget=!0;let n={width:e,height:e,depth:1},o=[n,n,n,n,n,n];this.texture=new CQe(o,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:1006}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;let n={uniforms:{tEquirect:{value:null}},vertexShader:`

				varying vec3 vWorldDirection;

				vec3 transformDirection( in vec3 dir, in mat4 matrix ) {

					return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );

				}

				void main() {

					vWorldDirection = transformDirection( position, modelMatrix );

					#include <begin_vertex>
					#include <project_vertex>

				}
			`,fragmentShader:`

				uniform sampler2D tEquirect;

				varying vec3 vWorldDirection;

				#include <common>

				void main() {

					vec3 direction = normalize( vWorldDirection );

					vec2 sampleUV = equirectUv( direction );

					gl_FragColor = texture2D( tEquirect, sampleUV );

				}
			`},o=new S_(5,5,5),r=new l3({name:"CubemapFromEquirect",uniforms:qX(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:1,blending:0});r.uniforms.tEquirect.value=t;let i=new Mo(o,r),s=t.minFilter;if(t.minFilter===1008)t.minFilter=1006;return new l5t(1,10,this).update(e,i),t.minFilter=s,i.geometry.dispose(),i.material.dispose(),this}clear(e,t,n,o){let r=e.getRenderTarget();for(let i=0;i<6;i++)e.setRenderTarget(this,i),e.clear(t,n,o);e.setRenderTarget(r)}}var URe=new Et,y4o=new Et,x4o=new Ya;class Mb{constructor(e=new Et(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,o){return this.normal.set(e,t,n),this.constant=o,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){let o=URe.subVectors(n,t).cross(y4o.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(o,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){let e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){let n=e.delta(URe),o=this.normal.dot(n);if(o===0){if(this.distanceToPoint(e.start)===0)return t.copy(e.start);return null}let r=-(e.start.dot(this.normal)+this.constant)/o;if(r<0||r>1)return null;return t.copy(e.start).addScaledVector(n,r)}intersectsLine(e){let t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){let n=t||x4o.getNormalMatrix(e),o=this.coplanarPoint(URe).applyMatrix4(e),r=this.normal.applyMatrix3(n).normalize();return this.constant=-o.dot(r),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}var bz=new v_,pAe=new Et;class VAe{constructor(e=new Mb,t=new Mb,n=new Mb,o=new Mb,r=new Mb,i=new Mb){this.planes=[e,t,n,o,r,i]}set(e,t,n,o,r,i){let s=this.planes;return s[0].copy(e),s[1].copy(t),s[2].copy(n),s[3].copy(o),s[4].copy(r),s[5].copy(i),this}copy(e){let t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=2000){let n=this.planes,o=e.elements,r=o[0],i=o[1],s=o[2],a=o[3],c=o[4],l=o[5],h=o[6],d=o[7],u=o[8],_=o[9],p=o[10],m=o[11],A=o[12],g=o[13],f=o[14],y=o[15];if(n[0].setComponents(a-r,d-c,m-u,y-A).normalize(),n[1].setComponents(a+r,d+c,m+u,y+A).normalize(),n[2].setComponents(a+i,d+l,m+_,y+g).normalize(),n[3].setComponents(a-i,d-l,m-_,y-g).normalize(),n[4].setComponents(a-s,d-h,m-p,y-f).normalize(),t===2000)n[5].setComponents(a+s,d+h,m+p,y+f).normalize();else if(t===2001)n[5].setComponents(s,h,p,f).normalize();else throw Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0){if(e.boundingSphere===null)e.computeBoundingSphere();bz.copy(e.boundingSphere).applyMatrix4(e.matrixWorld)}else{let t=e.geometry;if(t.boundingSphere===null)t.computeBoundingSphere();bz.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(bz)}intersectsSprite(e){return bz.center.set(0,0,0),bz.radius=0.7071067811865476,bz.applyMatrix4(e.matrixWorld),this.intersectsSphere(bz)}intersectsSphere(e){let t=this.planes,n=e.center,o=-e.radius;for(let r=0;r<6;r++)if(t[r].distanceToPoint(n)<o)return!1;return!0}intersectsBox(e){let t=this.planes;for(let n=0;n<6;n++){let o=t[n];if(pAe.x=o.normal.x>0?e.max.x:e.min.x,pAe.y=o.normal.y>0?e.max.y:e.min.y,pAe.z=o.normal.z>0?e.max.z:e.min.z,o.distanceToPoint(pAe)<0)return!1}return!0}containsPoint(e){let t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function d5t(){let e=null,t=!1,n=null,o=null;function r(i,s){n(i,s),o=e.requestAnimationFrame(r)}return{start:function(){if(t===!0)return;if(n===null)return;o=e.requestAnimationFrame(r),t=!0},stop:function(){e.cancelAnimationFrame(o),t=!1},setAnimationLoop:function(i){n=i},setContext:function(i){e=i}}}function C4o(e){let t=new WeakMap;function n(a,c){let{array:l,usage:h}=a,d=l.byteLength,u=e.createBuffer();e.bindBuffer(c,u),e.bufferData(c,l,h),a.onUploadCallback();let _;if(l instanceof Float32Array)_=e.FLOAT;else if(l instanceof Uint16Array)if(a.isFloat16BufferAttribute)_=e.HALF_FLOAT;else _=e.UNSIGNED_SHORT;else if(l instanceof Int16Array)_=e.SHORT;else if(l instanceof Uint32Array)_=e.UNSIGNED_INT;else if(l instanceof Int32Array)_=e.INT;else if(l instanceof Int8Array)_=e.BYTE;else if(l instanceof Uint8Array)_=e.UNSIGNED_BYTE;else if(l instanceof Uint8ClampedArray)_=e.UNSIGNED_BYTE;else throw Error("THREE.WebGLAttributes: Unsupported buffer data format: "+l);return{buffer:u,type:_,bytesPerElement:l.BYTES_PER_ELEMENT,version:a.version,size:d}}function o(a,c,l){let{array:h,_updateRange:d,updateRanges:u}=c;if(e.bindBuffer(l,a),d.count===-1&&u.length===0)e.bufferSubData(l,0,h);if(u.length!==0){for(let _=0,p=u.length;_<p;_++){let m=u[_];e.bufferSubData(l,m.start*h.BYTES_PER_ELEMENT,h,m.start,m.count)}c.clearUpdateRanges()}if(d.count!==-1)e.bufferSubData(l,d.offset*h.BYTES_PER_ELEMENT,h,d.offset,d.count),d.count=-1;c.onUploadCallback()}function r(a){if(a.isInterleavedBufferAttribute)a=a.data;return t.get(a)}function i(a){if(a.isInterleavedBufferAttribute)a=a.data;let c=t.get(a);if(c)e.deleteBuffer(c.buffer),t.delete(a)}function s(a,c){if(a.isGLBufferAttribute){let h=t.get(a);if(!h||h.version<a.version)t.set(a,{buffer:a.buffer,type:a.type,bytesPerElement:a.elementSize,version:a.version});return}if(a.isInterleavedBufferAttribute)a=a.data;let l=t.get(a);if(l===void 0)t.set(a,n(a,c));else if(l.version<a.version){if(l.size!==a.array.byteLength)throw Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");o(l.buffer,a,c),l.version=a.version}}return{get:r,remove:i,update:s}}class i1 extends js{constructor(e=1,t=1,n=1,o=1){super();this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:o};let r=e/2,i=t/2,s=Math.floor(n),a=Math.floor(o),c=s+1,l=a+1,h=e/s,d=t/a,u=[],_=[],p=[],m=[];for(let A=0;A<l;A++){let g=A*d-i;for(let f=0;f<c;f++){let y=f*h-r;_.push(y,-g,0),p.push(0,0,1),m.push(f/s),m.push(1-A/a)}}for(let A=0;A<a;A++)for(let g=0;g<s;g++){let f=g+c*A,y=g+c*(A+1),x=g+1+c*(A+1),C=g+1+c*A;u.push(f,y,C),u.push(y,x,C)}this.setIndex(u),this.setAttribute("position",new Wr(_,3)),this.setAttribute("normal",new Wr(p,3)),this.setAttribute("uv",new Wr(m,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new i1(e.width,e.height,e.widthSegments,e.heightSegments)}}var b4o=`#ifdef USE_ALPHAHASH
	if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;
#endif`,I4o=`#ifdef USE_ALPHAHASH
	const float ALPHA_HASH_SCALE = 0.05;
	float hash2D( vec2 value ) {
		return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );
	}
	float hash3D( vec3 value ) {
		return hash2D( vec2( hash2D( value.xy ), value.z ) );
	}
	float getAlphaHashThreshold( vec3 position ) {
		float maxDeriv = max(
			length( dFdx( position.xyz ) ),
			length( dFdy( position.xyz ) )
		);
		float pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );
		vec2 pixScales = vec2(
			exp2( floor( log2( pixScale ) ) ),
			exp2( ceil( log2( pixScale ) ) )
		);
		vec2 alpha = vec2(
			hash3D( floor( pixScales.x * position.xyz ) ),
			hash3D( floor( pixScales.y * position.xyz ) )
		);
		float lerpFactor = fract( log2( pixScale ) );
		float x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;
		float a = min( lerpFactor, 1.0 - lerpFactor );
		vec3 cases = vec3(
			x * x / ( 2.0 * a * ( 1.0 - a ) ),
			( x - 0.5 * a ) / ( 1.0 - a ),
			1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )
		);
		float threshold = ( x < ( 1.0 - a ) )
			? ( ( x < a ) ? cases.x : cases.y )
			: cases.z;
		return clamp( threshold , 1.0e-6, 1.0 );
	}
#endif`,v4o=`#ifdef USE_ALPHAMAP
	diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;
#endif`,S4o=`#ifdef USE_ALPHAMAP
	uniform sampler2D alphaMap;
#endif`,P4o=`#ifdef USE_ALPHATEST
	#ifdef ALPHA_TO_COVERAGE
	diffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );
	if ( diffuseColor.a == 0.0 ) discard;
	#else
	if ( diffuseColor.a < alphaTest ) discard;
	#endif
#endif`,E4o=`#ifdef USE_ALPHATEST
	uniform float alphaTest;
#endif`,M4o=`#ifdef USE_AOMAP
	float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;
	reflectedLight.indirectDiffuse *= ambientOcclusion;
	#if defined( USE_CLEARCOAT ) 
		clearcoatSpecularIndirect *= ambientOcclusion;
	#endif
	#if defined( USE_SHEEN ) 
		sheenSpecularIndirect *= ambientOcclusion;
	#endif
	#if defined( USE_ENVMAP ) && defined( STANDARD )
		float dotNV = saturate( dot( geometryNormal, geometryViewDir ) );
		reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );
	#endif
#endif`,w4o=`#ifdef USE_AOMAP
	uniform sampler2D aoMap;
	uniform float aoMapIntensity;
#endif`,B4o=`#ifdef USE_BATCHING
	attribute float batchId;
	uniform highp sampler2D batchingTexture;
	mat4 getBatchingMatrix( const in float i ) {
		int size = textureSize( batchingTexture, 0 ).x;
		int j = int( i ) * 4;
		int x = j % size;
		int y = j / size;
		vec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );
		vec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );
		vec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );
		vec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );
		return mat4( v1, v2, v3, v4 );
	}
#endif
#ifdef USE_BATCHING_COLOR
	uniform sampler2D batchingColorTexture;
	vec3 getBatchingColor( const in float i ) {
		int size = textureSize( batchingColorTexture, 0 ).x;
		int j = int( i );
		int x = j % size;
		int y = j / size;
		return texelFetch( batchingColorTexture, ivec2( x, y ), 0 ).rgb;
	}
#endif`,T4o=`#ifdef USE_BATCHING
	mat4 batchingMatrix = getBatchingMatrix( batchId );
#endif`,D4o=`vec3 transformed = vec3( position );
#ifdef USE_ALPHAHASH
	vPosition = vec3( position );
#endif`,N4o=`vec3 objectNormal = vec3( normal );
#ifdef USE_TANGENT
	vec3 objectTangent = vec3( tangent.xyz );
#endif`,R4o=`float G_BlinnPhong_Implicit( ) {
	return 0.25;
}
float D_BlinnPhong( const in float shininess, const in float dotNH ) {
	return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );
}
vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {
	vec3 halfDir = normalize( lightDir + viewDir );
	float dotNH = saturate( dot( normal, halfDir ) );
	float dotVH = saturate( dot( viewDir, halfDir ) );
	vec3 F = F_Schlick( specularColor, 1.0, dotVH );
	float G = G_BlinnPhong_Implicit( );
	float D = D_BlinnPhong( shininess, dotNH );
	return F * ( G * D );
} // validated`,Q4o=`#ifdef USE_IRIDESCENCE
	const mat3 XYZ_TO_REC709 = mat3(
		 3.2404542, -0.9692660,  0.0556434,
		-1.5371385,  1.8760108, -0.2040259,
		-0.4985314,  0.0415560,  1.0572252
	);
	vec3 Fresnel0ToIor( vec3 fresnel0 ) {
		vec3 sqrtF0 = sqrt( fresnel0 );
		return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );
	}
	vec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {
		return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );
	}
	float IorToFresnel0( float transmittedIor, float incidentIor ) {
		return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));
	}
	vec3 evalSensitivity( float OPD, vec3 shift ) {
		float phase = 2.0 * PI * OPD * 1.0e-9;
		vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );
		vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );
		vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );
		vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );
		xyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );
		xyz /= 1.0685e-7;
		vec3 rgb = XYZ_TO_REC709 * xyz;
		return rgb;
	}
	vec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {
		vec3 I;
		float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );
		float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );
		float cosTheta2Sq = 1.0 - sinTheta2Sq;
		if ( cosTheta2Sq < 0.0 ) {
			return vec3( 1.0 );
		}
		float cosTheta2 = sqrt( cosTheta2Sq );
		float R0 = IorToFresnel0( iridescenceIOR, outsideIOR );
		float R12 = F_Schlick( R0, 1.0, cosTheta1 );
		float T121 = 1.0 - R12;
		float phi12 = 0.0;
		if ( iridescenceIOR < outsideIOR ) phi12 = PI;
		float phi21 = PI - phi12;
		vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );		vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );
		vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );
		vec3 phi23 = vec3( 0.0 );
		if ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;
		if ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;
		if ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;
		float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;
		vec3 phi = vec3( phi21 ) + phi23;
		vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );
		vec3 r123 = sqrt( R123 );
		vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );
		vec3 C0 = R12 + Rs;
		I = C0;
		vec3 Cm = Rs - T121;
		for ( int m = 1; m <= 2; ++ m ) {
			Cm *= r123;
			vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );
			I += Cm * Sm;
		}
		return max( I, vec3( 0.0 ) );
	}
#endif`,k4o=`#ifdef USE_BUMPMAP
	uniform sampler2D bumpMap;
	uniform float bumpScale;
	vec2 dHdxy_fwd() {
		vec2 dSTdx = dFdx( vBumpMapUv );
		vec2 dSTdy = dFdy( vBumpMapUv );
		float Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;
		float dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;
		float dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;
		return vec2( dBx, dBy );
	}
	vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {
		vec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );
		vec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );
		vec3 vN = surf_norm;
		vec3 R1 = cross( vSigmaY, vN );
		vec3 R2 = cross( vN, vSigmaX );
		float fDet = dot( vSigmaX, R1 ) * faceDirection;
		vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );
		return normalize( abs( fDet ) * surf_norm - vGrad );
	}
#endif`,L4o=`#if NUM_CLIPPING_PLANES > 0
	vec4 plane;
	#ifdef ALPHA_TO_COVERAGE
		float distanceToPlane, distanceGradient;
		float clipOpacity = 1.0;
		#pragma unroll_loop_start
		for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
			plane = clippingPlanes[ i ];
			distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;
			distanceGradient = fwidth( distanceToPlane ) / 2.0;
			clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );
			if ( clipOpacity == 0.0 ) discard;
		}
		#pragma unroll_loop_end
		#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
			float unionClipOpacity = 1.0;
			#pragma unroll_loop_start
			for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {
				plane = clippingPlanes[ i ];
				distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;
				distanceGradient = fwidth( distanceToPlane ) / 2.0;
				unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );
			}
			#pragma unroll_loop_end
			clipOpacity *= 1.0 - unionClipOpacity;
		#endif
		diffuseColor.a *= clipOpacity;
		if ( diffuseColor.a == 0.0 ) discard;
	#else
		#pragma unroll_loop_start
		for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
			plane = clippingPlanes[ i ];
			if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;
		}
		#pragma unroll_loop_end
		#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
			bool clipped = true;
			#pragma unroll_loop_start
			for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {
				plane = clippingPlanes[ i ];
				clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;
			}
			#pragma unroll_loop_end
			if ( clipped ) discard;
		#endif
	#endif
#endif`,H4o=`#if NUM_CLIPPING_PLANES > 0
	varying vec3 vClipPosition;
	uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];
#endif`,F4o=`#if NUM_CLIPPING_PLANES > 0
	varying vec3 vClipPosition;
#endif`,z4o=`#if NUM_CLIPPING_PLANES > 0
	vClipPosition = - mvPosition.xyz;
#endif`,O4o=`#if defined( USE_COLOR_ALPHA )
	diffuseColor *= vColor;
#elif defined( USE_COLOR )
	diffuseColor.rgb *= vColor;
#endif`,V4o=`#if defined( USE_COLOR_ALPHA )
	varying vec4 vColor;
#elif defined( USE_COLOR )
	varying vec3 vColor;
#endif`,Y4o=`#if defined( USE_COLOR_ALPHA )
	varying vec4 vColor;
#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
	varying vec3 vColor;
#endif`,G4o=`#if defined( USE_COLOR_ALPHA )
	vColor = vec4( 1.0 );
#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
	vColor = vec3( 1.0 );
#endif
#ifdef USE_COLOR
	vColor *= color;
#endif
#ifdef USE_INSTANCING_COLOR
	vColor.xyz *= instanceColor.xyz;
#endif
#ifdef USE_BATCHING_COLOR
	vec3 batchingColor = getBatchingColor( batchId );
	vColor.xyz *= batchingColor.xyz;
#endif`,U4o=`#define PI 3.141592653589793
#define PI2 6.283185307179586
#define PI_HALF 1.5707963267948966
#define RECIPROCAL_PI 0.3183098861837907
#define RECIPROCAL_PI2 0.15915494309189535
#define EPSILON 1e-6
#ifndef saturate
#define saturate( a ) clamp( a, 0.0, 1.0 )
#endif
#define whiteComplement( a ) ( 1.0 - saturate( a ) )
float pow2( const in float x ) { return x*x; }
vec3 pow2( const in vec3 x ) { return x*x; }
float pow3( const in float x ) { return x*x*x; }
float pow4( const in float x ) { float x2 = x*x; return x2*x2; }
float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }
float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }
highp float rand( const in vec2 uv ) {
	const highp float a = 12.9898, b = 78.233, c = 43758.5453;
	highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );
	return fract( sin( sn ) * c );
}
#ifdef HIGH_PRECISION
	float precisionSafeLength( vec3 v ) { return length( v ); }
#else
	float precisionSafeLength( vec3 v ) {
		float maxComponent = max3( abs( v ) );
		return length( v / maxComponent ) * maxComponent;
	}
#endif
struct IncidentLight {
	vec3 color;
	vec3 direction;
	bool visible;
};
struct ReflectedLight {
	vec3 directDiffuse;
	vec3 directSpecular;
	vec3 indirectDiffuse;
	vec3 indirectSpecular;
};
#ifdef USE_ALPHAHASH
	varying vec3 vPosition;
#endif
vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
	return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
}
vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {
	return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );
}
mat3 transposeMat3( const in mat3 m ) {
	mat3 tmp;
	tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );
	tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );
	tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );
	return tmp;
}
float luminance( const in vec3 rgb ) {
	const vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );
	return dot( weights, rgb );
}
bool isPerspectiveMatrix( mat4 m ) {
	return m[ 2 ][ 3 ] == - 1.0;
}
vec2 equirectUv( in vec3 dir ) {
	float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;
	float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;
	return vec2( u, v );
}
vec3 BRDF_Lambert( const in vec3 diffuseColor ) {
	return RECIPROCAL_PI * diffuseColor;
}
vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {
	float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
	return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
}
float F_Schlick( const in float f0, const in float f90, const in float dotVH ) {
	float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
	return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
} // validated`,W4o=`#ifdef ENVMAP_TYPE_CUBE_UV
	#define cubeUV_minMipLevel 4.0
	#define cubeUV_minTileSize 16.0
	float getFace( vec3 direction ) {
		vec3 absDirection = abs( direction );
		float face = - 1.0;
		if ( absDirection.x > absDirection.z ) {
			if ( absDirection.x > absDirection.y )
				face = direction.x > 0.0 ? 0.0 : 3.0;
			else
				face = direction.y > 0.0 ? 1.0 : 4.0;
		} else {
			if ( absDirection.z > absDirection.y )
				face = direction.z > 0.0 ? 2.0 : 5.0;
			else
				face = direction.y > 0.0 ? 1.0 : 4.0;
		}
		return face;
	}
	vec2 getUV( vec3 direction, float face ) {
		vec2 uv;
		if ( face == 0.0 ) {
			uv = vec2( direction.z, direction.y ) / abs( direction.x );
		} else if ( face == 1.0 ) {
			uv = vec2( - direction.x, - direction.z ) / abs( direction.y );
		} else if ( face == 2.0 ) {
			uv = vec2( - direction.x, direction.y ) / abs( direction.z );
		} else if ( face == 3.0 ) {
			uv = vec2( - direction.z, direction.y ) / abs( direction.x );
		} else if ( face == 4.0 ) {
			uv = vec2( - direction.x, direction.z ) / abs( direction.y );
		} else {
			uv = vec2( direction.x, direction.y ) / abs( direction.z );
		}
		return 0.5 * ( uv + 1.0 );
	}
	vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {
		float face = getFace( direction );
		float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );
		mipInt = max( mipInt, cubeUV_minMipLevel );
		float faceSize = exp2( mipInt );
		highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;
		if ( face > 2.0 ) {
			uv.y += faceSize;
			face -= 3.0;
		}
		uv.x += face * faceSize;
		uv.x += filterInt * 3.0 * cubeUV_minTileSize;
		uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );
		uv.x *= CUBEUV_TEXEL_WIDTH;
		uv.y *= CUBEUV_TEXEL_HEIGHT;
		#ifdef texture2DGradEXT
			return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;
		#else
			return texture2D( envMap, uv ).rgb;
		#endif
	}
	#define cubeUV_r0 1.0
	#define cubeUV_m0 - 2.0
	#define cubeUV_r1 0.8
	#define cubeUV_m1 - 1.0
	#define cubeUV_r4 0.4
	#define cubeUV_m4 2.0
	#define cubeUV_r5 0.305
	#define cubeUV_m5 3.0
	#define cubeUV_r6 0.21
	#define cubeUV_m6 4.0
	float roughnessToMip( float roughness ) {
		float mip = 0.0;
		if ( roughness >= cubeUV_r1 ) {
			mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;
		} else if ( roughness >= cubeUV_r4 ) {
			mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;
		} else if ( roughness >= cubeUV_r5 ) {
			mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;
		} else if ( roughness >= cubeUV_r6 ) {
			mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;
		} else {
			mip = - 2.0 * log2( 1.16 * roughness );		}
		return mip;
	}
	vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {
		float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );
		float mipF = fract( mip );
		float mipInt = floor( mip );
		vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );
		if ( mipF == 0.0 ) {
			return vec4( color0, 1.0 );
		} else {
			vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );
			return vec4( mix( color0, color1, mipF ), 1.0 );
		}
	}
#endif`,X4o=`vec3 transformedNormal = objectNormal;
#ifdef USE_TANGENT
	vec3 transformedTangent = objectTangent;
#endif
#ifdef USE_BATCHING
	mat3 bm = mat3( batchingMatrix );
	transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );
	transformedNormal = bm * transformedNormal;
	#ifdef USE_TANGENT
		transformedTangent = bm * transformedTangent;
	#endif
#endif
#ifdef USE_INSTANCING
	mat3 im = mat3( instanceMatrix );
	transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );
	transformedNormal = im * transformedNormal;
	#ifdef USE_TANGENT
		transformedTangent = im * transformedTangent;
	#endif
#endif
transformedNormal = normalMatrix * transformedNormal;
#ifdef FLIP_SIDED
	transformedNormal = - transformedNormal;
#endif
#ifdef USE_TANGENT
	transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;
	#ifdef FLIP_SIDED
		transformedTangent = - transformedTangent;
	#endif
#endif`,j4o=`#ifdef USE_DISPLACEMENTMAP
	uniform sampler2D displacementMap;
	uniform float displacementScale;
	uniform float displacementBias;
#endif`,K4o=`#ifdef USE_DISPLACEMENTMAP
	transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );
#endif`,$4o=`#ifdef USE_EMISSIVEMAP
	vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );
	totalEmissiveRadiance *= emissiveColor.rgb;
#endif`,q4o=`#ifdef USE_EMISSIVEMAP
	uniform sampler2D emissiveMap;
#endif`,J4o="gl_FragColor = linearToOutputTexel( gl_FragColor );",Z4o=`
const mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3(
	vec3( 0.8224621, 0.177538, 0.0 ),
	vec3( 0.0331941, 0.9668058, 0.0 ),
	vec3( 0.0170827, 0.0723974, 0.9105199 )
);
const mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3(
	vec3( 1.2249401, - 0.2249404, 0.0 ),
	vec3( - 0.0420569, 1.0420571, 0.0 ),
	vec3( - 0.0196376, - 0.0786361, 1.0982735 )
);
vec4 LinearSRGBToLinearDisplayP3( in vec4 value ) {
	return vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a );
}
vec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) {
	return vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a );
}
vec4 LinearTransferOETF( in vec4 value ) {
	return value;
}
vec4 sRGBTransferOETF( in vec4 value ) {
	return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );
}
vec4 LinearToLinear( in vec4 value ) {
	return value;
}
vec4 LinearTosRGB( in vec4 value ) {
	return sRGBTransferOETF( value );
}`,e3o=`#ifdef USE_ENVMAP
	#ifdef ENV_WORLDPOS
		vec3 cameraToFrag;
		if ( isOrthographic ) {
			cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
		} else {
			cameraToFrag = normalize( vWorldPosition - cameraPosition );
		}
		vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
		#ifdef ENVMAP_MODE_REFLECTION
			vec3 reflectVec = reflect( cameraToFrag, worldNormal );
		#else
			vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );
		#endif
	#else
		vec3 reflectVec = vReflect;
	#endif
	#ifdef ENVMAP_TYPE_CUBE
		vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );
	#else
		vec4 envColor = vec4( 0.0 );
	#endif
	#ifdef ENVMAP_BLENDING_MULTIPLY
		outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );
	#elif defined( ENVMAP_BLENDING_MIX )
		outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );
	#elif defined( ENVMAP_BLENDING_ADD )
		outgoingLight += envColor.xyz * specularStrength * reflectivity;
	#endif
#endif`,t3o=`#ifdef USE_ENVMAP
	uniform float envMapIntensity;
	uniform float flipEnvMap;
	uniform mat3 envMapRotation;
	#ifdef ENVMAP_TYPE_CUBE
		uniform samplerCube envMap;
	#else
		uniform sampler2D envMap;
	#endif
	
#endif`,n3o=`#ifdef USE_ENVMAP
	uniform float reflectivity;
	#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
		#define ENV_WORLDPOS
	#endif
	#ifdef ENV_WORLDPOS
		varying vec3 vWorldPosition;
		uniform float refractionRatio;
	#else
		varying vec3 vReflect;
	#endif
#endif`,o3o=`#ifdef USE_ENVMAP
	#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
		#define ENV_WORLDPOS
	#endif
	#ifdef ENV_WORLDPOS
		
		varying vec3 vWorldPosition;
	#else
		varying vec3 vReflect;
		uniform float refractionRatio;
	#endif
#endif`,r3o=`#ifdef USE_ENVMAP
	#ifdef ENV_WORLDPOS
		vWorldPosition = worldPosition.xyz;
	#else
		vec3 cameraToVertex;
		if ( isOrthographic ) {
			cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
		} else {
			cameraToVertex = normalize( worldPosition.xyz - cameraPosition );
		}
		vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
		#ifdef ENVMAP_MODE_REFLECTION
			vReflect = reflect( cameraToVertex, worldNormal );
		#else
			vReflect = refract( cameraToVertex, worldNormal, refractionRatio );
		#endif
	#endif
#endif`,i3o=`#ifdef USE_FOG
	vFogDepth = - mvPosition.z;
#endif`,s3o=`#ifdef USE_FOG
	varying float vFogDepth;
#endif`,a3o=`#ifdef USE_FOG
	#ifdef FOG_EXP2
		float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );
	#else
		float fogFactor = smoothstep( fogNear, fogFar, vFogDepth );
	#endif
	gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );
#endif`,c3o=`#ifdef USE_FOG
	uniform vec3 fogColor;
	varying float vFogDepth;
	#ifdef FOG_EXP2
		uniform float fogDensity;
	#else
		uniform float fogNear;
		uniform float fogFar;
	#endif
#endif`,l3o=`#ifdef USE_GRADIENTMAP
	uniform sampler2D gradientMap;
#endif
vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {
	float dotNL = dot( normal, lightDirection );
	vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );
	#ifdef USE_GRADIENTMAP
		return vec3( texture2D( gradientMap, coord ).r );
	#else
		vec2 fw = fwidth( coord ) * 0.5;
		return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );
	#endif
}`,h3o=`#ifdef USE_LIGHTMAP
	uniform sampler2D lightMap;
	uniform float lightMapIntensity;
#endif`,d3o=`LambertMaterial material;
material.diffuseColor = diffuseColor.rgb;
material.specularStrength = specularStrength;`,u3o=`varying vec3 vViewPosition;
struct LambertMaterial {
	vec3 diffuseColor;
	float specularStrength;
};
void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {
	float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
	vec3 irradiance = dotNL * directLight.color;
	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {
	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
#define RE_Direct				RE_Direct_Lambert
#define RE_IndirectDiffuse		RE_IndirectDiffuse_Lambert`,p3o=`uniform bool receiveShadow;
uniform vec3 ambientLightColor;
#if defined( USE_LIGHT_PROBES )
	uniform vec3 lightProbe[ 9 ];
#endif
vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {
	float x = normal.x, y = normal.y, z = normal.z;
	vec3 result = shCoefficients[ 0 ] * 0.886227;
	result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;
	result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;
	result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;
	result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;
	result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;
	result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );
	result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;
	result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );
	return result;
}
vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {
	vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
	vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );
	return irradiance;
}
vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {
	vec3 irradiance = ambientLightColor;
	return irradiance;
}
float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {
	float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );
	if ( cutoffDistance > 0.0 ) {
		distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );
	}
	return distanceFalloff;
}
float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {
	return smoothstep( coneCosine, penumbraCosine, angleCosine );
}
#if NUM_DIR_LIGHTS > 0
	struct DirectionalLight {
		vec3 direction;
		vec3 color;
	};
	uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];
	void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {
		light.color = directionalLight.color;
		light.direction = directionalLight.direction;
		light.visible = true;
	}
#endif
#if NUM_POINT_LIGHTS > 0
	struct PointLight {
		vec3 position;
		vec3 color;
		float distance;
		float decay;
	};
	uniform PointLight pointLights[ NUM_POINT_LIGHTS ];
	void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {
		vec3 lVector = pointLight.position - geometryPosition;
		light.direction = normalize( lVector );
		float lightDistance = length( lVector );
		light.color = pointLight.color;
		light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );
		light.visible = ( light.color != vec3( 0.0 ) );
	}
#endif
#if NUM_SPOT_LIGHTS > 0
	struct SpotLight {
		vec3 position;
		vec3 direction;
		vec3 color;
		float distance;
		float decay;
		float coneCos;
		float penumbraCos;
	};
	uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];
	void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {
		vec3 lVector = spotLight.position - geometryPosition;
		light.direction = normalize( lVector );
		float angleCos = dot( light.direction, spotLight.direction );
		float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );
		if ( spotAttenuation > 0.0 ) {
			float lightDistance = length( lVector );
			light.color = spotLight.color * spotAttenuation;
			light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );
			light.visible = ( light.color != vec3( 0.0 ) );
		} else {
			light.color = vec3( 0.0 );
			light.visible = false;
		}
	}
#endif
#if NUM_RECT_AREA_LIGHTS > 0
	struct RectAreaLight {
		vec3 color;
		vec3 position;
		vec3 halfWidth;
		vec3 halfHeight;
	};
	uniform sampler2D ltc_1;	uniform sampler2D ltc_2;
	uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];
#endif
#if NUM_HEMI_LIGHTS > 0
	struct HemisphereLight {
		vec3 direction;
		vec3 skyColor;
		vec3 groundColor;
	};
	uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];
	vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {
		float dotNL = dot( normal, hemiLight.direction );
		float hemiDiffuseWeight = 0.5 * dotNL + 0.5;
		vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );
		return irradiance;
	}
#endif`,m3o=`#ifdef USE_ENVMAP
	vec3 getIBLIrradiance( const in vec3 normal ) {
		#ifdef ENVMAP_TYPE_CUBE_UV
			vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
			vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );
			return PI * envMapColor.rgb * envMapIntensity;
		#else
			return vec3( 0.0 );
		#endif
	}
	vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {
		#ifdef ENVMAP_TYPE_CUBE_UV
			vec3 reflectVec = reflect( - viewDir, normal );
			reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );
			reflectVec = inverseTransformDirection( reflectVec, viewMatrix );
			vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );
			return envMapColor.rgb * envMapIntensity;
		#else
			return vec3( 0.0 );
		#endif
	}
	#ifdef USE_ANISOTROPY
		vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {
			#ifdef ENVMAP_TYPE_CUBE_UV
				vec3 bentNormal = cross( bitangent, viewDir );
				bentNormal = normalize( cross( bentNormal, bitangent ) );
				bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );
				return getIBLRadiance( viewDir, bentNormal, roughness );
			#else
				return vec3( 0.0 );
			#endif
		}
	#endif
#endif`,_3o=`ToonMaterial material;
material.diffuseColor = diffuseColor.rgb;`,g3o=`varying vec3 vViewPosition;
struct ToonMaterial {
	vec3 diffuseColor;
};
void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {
	vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;
	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {
	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
#define RE_Direct				RE_Direct_Toon
#define RE_IndirectDiffuse		RE_IndirectDiffuse_Toon`,A3o=`BlinnPhongMaterial material;
material.diffuseColor = diffuseColor.rgb;
material.specularColor = specular;
material.specularShininess = shininess;
material.specularStrength = specularStrength;`,f3o=`varying vec3 vViewPosition;
struct BlinnPhongMaterial {
	vec3 diffuseColor;
	vec3 specularColor;
	float specularShininess;
	float specularStrength;
};
void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
	float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
	vec3 irradiance = dotNL * directLight.color;
	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
	reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;
}
void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
#define RE_Direct				RE_Direct_BlinnPhong
#define RE_IndirectDiffuse		RE_IndirectDiffuse_BlinnPhong`,y3o=`PhysicalMaterial material;
material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );
vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );
float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );
material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;
material.roughness = min( material.roughness, 1.0 );
#ifdef IOR
	material.ior = ior;
	#ifdef USE_SPECULAR
		float specularIntensityFactor = specularIntensity;
		vec3 specularColorFactor = specularColor;
		#ifdef USE_SPECULAR_COLORMAP
			specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;
		#endif
		#ifdef USE_SPECULAR_INTENSITYMAP
			specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;
		#endif
		material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );
	#else
		float specularIntensityFactor = 1.0;
		vec3 specularColorFactor = vec3( 1.0 );
		material.specularF90 = 1.0;
	#endif
	material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );
#else
	material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );
	material.specularF90 = 1.0;
#endif
#ifdef USE_CLEARCOAT
	material.clearcoat = clearcoat;
	material.clearcoatRoughness = clearcoatRoughness;
	material.clearcoatF0 = vec3( 0.04 );
	material.clearcoatF90 = 1.0;
	#ifdef USE_CLEARCOATMAP
		material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;
	#endif
	#ifdef USE_CLEARCOAT_ROUGHNESSMAP
		material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;
	#endif
	material.clearcoat = saturate( material.clearcoat );	material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );
	material.clearcoatRoughness += geometryRoughness;
	material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );
#endif
#ifdef USE_DISPERSION
	material.dispersion = dispersion;
#endif
#ifdef USE_IRIDESCENCE
	material.iridescence = iridescence;
	material.iridescenceIOR = iridescenceIOR;
	#ifdef USE_IRIDESCENCEMAP
		material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;
	#endif
	#ifdef USE_IRIDESCENCE_THICKNESSMAP
		material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;
	#else
		material.iridescenceThickness = iridescenceThicknessMaximum;
	#endif
#endif
#ifdef USE_SHEEN
	material.sheenColor = sheenColor;
	#ifdef USE_SHEEN_COLORMAP
		material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;
	#endif
	material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );
	#ifdef USE_SHEEN_ROUGHNESSMAP
		material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;
	#endif
#endif
#ifdef USE_ANISOTROPY
	#ifdef USE_ANISOTROPYMAP
		mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );
		vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;
		vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;
	#else
		vec2 anisotropyV = anisotropyVector;
	#endif
	material.anisotropy = length( anisotropyV );
	if( material.anisotropy == 0.0 ) {
		anisotropyV = vec2( 1.0, 0.0 );
	} else {
		anisotropyV /= material.anisotropy;
		material.anisotropy = saturate( material.anisotropy );
	}
	material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );
	material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;
	material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;
#endif`,x3o=`struct PhysicalMaterial {
	vec3 diffuseColor;
	float roughness;
	vec3 specularColor;
	float specularF90;
	float dispersion;
	#ifdef USE_CLEARCOAT
		float clearcoat;
		float clearcoatRoughness;
		vec3 clearcoatF0;
		float clearcoatF90;
	#endif
	#ifdef USE_IRIDESCENCE
		float iridescence;
		float iridescenceIOR;
		float iridescenceThickness;
		vec3 iridescenceFresnel;
		vec3 iridescenceF0;
	#endif
	#ifdef USE_SHEEN
		vec3 sheenColor;
		float sheenRoughness;
	#endif
	#ifdef IOR
		float ior;
	#endif
	#ifdef USE_TRANSMISSION
		float transmission;
		float transmissionAlpha;
		float thickness;
		float attenuationDistance;
		vec3 attenuationColor;
	#endif
	#ifdef USE_ANISOTROPY
		float anisotropy;
		float alphaT;
		vec3 anisotropyT;
		vec3 anisotropyB;
	#endif
};
vec3 clearcoatSpecularDirect = vec3( 0.0 );
vec3 clearcoatSpecularIndirect = vec3( 0.0 );
vec3 sheenSpecularDirect = vec3( 0.0 );
vec3 sheenSpecularIndirect = vec3(0.0 );
vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {
    float x = clamp( 1.0 - dotVH, 0.0, 1.0 );
    float x2 = x * x;
    float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );
    return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );
}
float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {
	float a2 = pow2( alpha );
	float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );
	float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );
	return 0.5 / max( gv + gl, EPSILON );
}
float D_GGX( const in float alpha, const in float dotNH ) {
	float a2 = pow2( alpha );
	float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;
	return RECIPROCAL_PI * a2 / pow2( denom );
}
#ifdef USE_ANISOTROPY
	float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {
		float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );
		float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );
		float v = 0.5 / ( gv + gl );
		return saturate(v);
	}
	float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {
		float a2 = alphaT * alphaB;
		highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );
		highp float v2 = dot( v, v );
		float w2 = a2 / v2;
		return RECIPROCAL_PI * a2 * pow2 ( w2 );
	}
#endif
#ifdef USE_CLEARCOAT
	vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {
		vec3 f0 = material.clearcoatF0;
		float f90 = material.clearcoatF90;
		float roughness = material.clearcoatRoughness;
		float alpha = pow2( roughness );
		vec3 halfDir = normalize( lightDir + viewDir );
		float dotNL = saturate( dot( normal, lightDir ) );
		float dotNV = saturate( dot( normal, viewDir ) );
		float dotNH = saturate( dot( normal, halfDir ) );
		float dotVH = saturate( dot( viewDir, halfDir ) );
		vec3 F = F_Schlick( f0, f90, dotVH );
		float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
		float D = D_GGX( alpha, dotNH );
		return F * ( V * D );
	}
#endif
vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {
	vec3 f0 = material.specularColor;
	float f90 = material.specularF90;
	float roughness = material.roughness;
	float alpha = pow2( roughness );
	vec3 halfDir = normalize( lightDir + viewDir );
	float dotNL = saturate( dot( normal, lightDir ) );
	float dotNV = saturate( dot( normal, viewDir ) );
	float dotNH = saturate( dot( normal, halfDir ) );
	float dotVH = saturate( dot( viewDir, halfDir ) );
	vec3 F = F_Schlick( f0, f90, dotVH );
	#ifdef USE_IRIDESCENCE
		F = mix( F, material.iridescenceFresnel, material.iridescence );
	#endif
	#ifdef USE_ANISOTROPY
		float dotTL = dot( material.anisotropyT, lightDir );
		float dotTV = dot( material.anisotropyT, viewDir );
		float dotTH = dot( material.anisotropyT, halfDir );
		float dotBL = dot( material.anisotropyB, lightDir );
		float dotBV = dot( material.anisotropyB, viewDir );
		float dotBH = dot( material.anisotropyB, halfDir );
		float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );
		float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );
	#else
		float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
		float D = D_GGX( alpha, dotNH );
	#endif
	return F * ( V * D );
}
vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {
	const float LUT_SIZE = 64.0;
	const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;
	const float LUT_BIAS = 0.5 / LUT_SIZE;
	float dotNV = saturate( dot( N, V ) );
	vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );
	uv = uv * LUT_SCALE + LUT_BIAS;
	return uv;
}
float LTC_ClippedSphereFormFactor( const in vec3 f ) {
	float l = length( f );
	return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );
}
vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {
	float x = dot( v1, v2 );
	float y = abs( x );
	float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;
	float b = 3.4175940 + ( 4.1616724 + y ) * y;
	float v = a / b;
	float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;
	return cross( v1, v2 ) * theta_sintheta;
}
vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {
	vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];
	vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];
	vec3 lightNormal = cross( v1, v2 );
	if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );
	vec3 T1, T2;
	T1 = normalize( V - N * dot( V, N ) );
	T2 = - cross( N, T1 );
	mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );
	vec3 coords[ 4 ];
	coords[ 0 ] = mat * ( rectCoords[ 0 ] - P );
	coords[ 1 ] = mat * ( rectCoords[ 1 ] - P );
	coords[ 2 ] = mat * ( rectCoords[ 2 ] - P );
	coords[ 3 ] = mat * ( rectCoords[ 3 ] - P );
	coords[ 0 ] = normalize( coords[ 0 ] );
	coords[ 1 ] = normalize( coords[ 1 ] );
	coords[ 2 ] = normalize( coords[ 2 ] );
	coords[ 3 ] = normalize( coords[ 3 ] );
	vec3 vectorFormFactor = vec3( 0.0 );
	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );
	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );
	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );
	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );
	float result = LTC_ClippedSphereFormFactor( vectorFormFactor );
	return vec3( result );
}
#if defined( USE_SHEEN )
float D_Charlie( float roughness, float dotNH ) {
	float alpha = pow2( roughness );
	float invAlpha = 1.0 / alpha;
	float cos2h = dotNH * dotNH;
	float sin2h = max( 1.0 - cos2h, 0.0078125 );
	return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );
}
float V_Neubelt( float dotNV, float dotNL ) {
	return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );
}
vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {
	vec3 halfDir = normalize( lightDir + viewDir );
	float dotNL = saturate( dot( normal, lightDir ) );
	float dotNV = saturate( dot( normal, viewDir ) );
	float dotNH = saturate( dot( normal, halfDir ) );
	float D = D_Charlie( sheenRoughness, dotNH );
	float V = V_Neubelt( dotNV, dotNL );
	return sheenColor * ( D * V );
}
#endif
float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {
	float dotNV = saturate( dot( normal, viewDir ) );
	float r2 = roughness * roughness;
	float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;
	float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;
	float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );
	return saturate( DG * RECIPROCAL_PI );
}
vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {
	float dotNV = saturate( dot( normal, viewDir ) );
	const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );
	const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );
	vec4 r = roughness * c0 + c1;
	float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;
	vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;
	return fab;
}
vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {
	vec2 fab = DFGApprox( normal, viewDir, roughness );
	return specularColor * fab.x + specularF90 * fab.y;
}
#ifdef USE_IRIDESCENCE
void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {
#else
void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {
#endif
	vec2 fab = DFGApprox( normal, viewDir, roughness );
	#ifdef USE_IRIDESCENCE
		vec3 Fr = mix( specularColor, iridescenceF0, iridescence );
	#else
		vec3 Fr = specularColor;
	#endif
	vec3 FssEss = Fr * fab.x + specularF90 * fab.y;
	float Ess = fab.x + fab.y;
	float Ems = 1.0 - Ess;
	vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;	vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );
	singleScatter += FssEss;
	multiScatter += Fms * Ems;
}
#if NUM_RECT_AREA_LIGHTS > 0
	void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
		vec3 normal = geometryNormal;
		vec3 viewDir = geometryViewDir;
		vec3 position = geometryPosition;
		vec3 lightPos = rectAreaLight.position;
		vec3 halfWidth = rectAreaLight.halfWidth;
		vec3 halfHeight = rectAreaLight.halfHeight;
		vec3 lightColor = rectAreaLight.color;
		float roughness = material.roughness;
		vec3 rectCoords[ 4 ];
		rectCoords[ 0 ] = lightPos + halfWidth - halfHeight;		rectCoords[ 1 ] = lightPos - halfWidth - halfHeight;
		rectCoords[ 2 ] = lightPos - halfWidth + halfHeight;
		rectCoords[ 3 ] = lightPos + halfWidth + halfHeight;
		vec2 uv = LTC_Uv( normal, viewDir, roughness );
		vec4 t1 = texture2D( ltc_1, uv );
		vec4 t2 = texture2D( ltc_2, uv );
		mat3 mInv = mat3(
			vec3( t1.x, 0, t1.y ),
			vec3(    0, 1,    0 ),
			vec3( t1.z, 0, t1.w )
		);
		vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );
		reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );
		reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );
	}
#endif
void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
	float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
	vec3 irradiance = dotNL * directLight.color;
	#ifdef USE_CLEARCOAT
		float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );
		vec3 ccIrradiance = dotNLcc * directLight.color;
		clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );
	#endif
	#ifdef USE_SHEEN
		sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );
	#endif
	reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );
	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {
	#ifdef USE_CLEARCOAT
		clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );
	#endif
	#ifdef USE_SHEEN
		sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );
	#endif
	vec3 singleScattering = vec3( 0.0 );
	vec3 multiScattering = vec3( 0.0 );
	vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;
	#ifdef USE_IRIDESCENCE
		computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );
	#else
		computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );
	#endif
	vec3 totalScattering = singleScattering + multiScattering;
	vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );
	reflectedLight.indirectSpecular += radiance * singleScattering;
	reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;
	reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;
}
#define RE_Direct				RE_Direct_Physical
#define RE_Direct_RectArea		RE_Direct_RectArea_Physical
#define RE_IndirectDiffuse		RE_IndirectDiffuse_Physical
#define RE_IndirectSpecular		RE_IndirectSpecular_Physical
float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {
	return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );
}`,C3o=`
vec3 geometryPosition = - vViewPosition;
vec3 geometryNormal = normal;
vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );
vec3 geometryClearcoatNormal = vec3( 0.0 );
#ifdef USE_CLEARCOAT
	geometryClearcoatNormal = clearcoatNormal;
#endif
#ifdef USE_IRIDESCENCE
	float dotNVi = saturate( dot( normal, geometryViewDir ) );
	if ( material.iridescenceThickness == 0.0 ) {
		material.iridescence = 0.0;
	} else {
		material.iridescence = saturate( material.iridescence );
	}
	if ( material.iridescence > 0.0 ) {
		material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );
		material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );
	}
#endif
IncidentLight directLight;
#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )
	PointLight pointLight;
	#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0
	PointLightShadow pointLightShadow;
	#endif
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {
		pointLight = pointLights[ i ];
		getPointLightInfo( pointLight, geometryPosition, directLight );
		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )
		pointLightShadow = pointLightShadows[ i ];
		directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;
		#endif
		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
	}
	#pragma unroll_loop_end
#endif
#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )
	SpotLight spotLight;
	vec4 spotColor;
	vec3 spotLightCoord;
	bool inSpotLightMap;
	#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0
	SpotLightShadow spotLightShadow;
	#endif
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {
		spotLight = spotLights[ i ];
		getSpotLightInfo( spotLight, geometryPosition, directLight );
		#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
		#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX
		#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
		#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS
		#else
		#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
		#endif
		#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )
			spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;
			inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );
			spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );
			directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;
		#endif
		#undef SPOT_LIGHT_MAP_INDEX
		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
		spotLightShadow = spotLightShadows[ i ];
		directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
		#endif
		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
	}
	#pragma unroll_loop_end
#endif
#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )
	DirectionalLight directionalLight;
	#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0
	DirectionalLightShadow directionalLightShadow;
	#endif
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {
		directionalLight = directionalLights[ i ];
		getDirectionalLightInfo( directionalLight, directLight );
		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )
		directionalLightShadow = directionalLightShadows[ i ];
		directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
		#endif
		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
	}
	#pragma unroll_loop_end
#endif
#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )
	RectAreaLight rectAreaLight;
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {
		rectAreaLight = rectAreaLights[ i ];
		RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
	}
	#pragma unroll_loop_end
#endif
#if defined( RE_IndirectDiffuse )
	vec3 iblIrradiance = vec3( 0.0 );
	vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );
	#if defined( USE_LIGHT_PROBES )
		irradiance += getLightProbeIrradiance( lightProbe, geometryNormal );
	#endif
	#if ( NUM_HEMI_LIGHTS > 0 )
		#pragma unroll_loop_start
		for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {
			irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );
		}
		#pragma unroll_loop_end
	#endif
#endif
#if defined( RE_IndirectSpecular )
	vec3 radiance = vec3( 0.0 );
	vec3 clearcoatRadiance = vec3( 0.0 );
#endif`,b3o=`#if defined( RE_IndirectDiffuse )
	#ifdef USE_LIGHTMAP
		vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
		vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;
		irradiance += lightMapIrradiance;
	#endif
	#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )
		iblIrradiance += getIBLIrradiance( geometryNormal );
	#endif
#endif
#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )
	#ifdef USE_ANISOTROPY
		radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );
	#else
		radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );
	#endif
	#ifdef USE_CLEARCOAT
		clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );
	#endif
#endif`,I3o=`#if defined( RE_IndirectDiffuse )
	RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
#endif
#if defined( RE_IndirectSpecular )
	RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
#endif`;var v3o=`#if defined( USE_LOGDEPTHBUF )
	gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;
#endif`,S3o=`#if defined( USE_LOGDEPTHBUF )
	uniform float logDepthBufFC;
	varying float vFragDepth;
	varying float vIsPerspective;
#endif`,P3o=`#ifdef USE_LOGDEPTHBUF
	varying float vFragDepth;
	varying float vIsPerspective;
#endif`,E3o=`#ifdef USE_LOGDEPTHBUF
	vFragDepth = 1.0 + gl_Position.w;
	vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );
#endif`,M3o=`#ifdef USE_MAP
	vec4 sampledDiffuseColor = texture2D( map, vMapUv );
	#ifdef DECODE_VIDEO_TEXTURE
		sampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );
	
	#endif
	diffuseColor *= sampledDiffuseColor;
#endif`,w3o=`#ifdef USE_MAP
	uniform sampler2D map;
#endif`,B3o=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
	#if defined( USE_POINTS_UV )
		vec2 uv = vUv;
	#else
		vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;
	#endif
#endif
#ifdef USE_MAP
	diffuseColor *= texture2D( map, uv );
#endif
#ifdef USE_ALPHAMAP
	diffuseColor.a *= texture2D( alphaMap, uv ).g;
#endif`,T3o=`#if defined( USE_POINTS_UV )
	varying vec2 vUv;
#else
	#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
		uniform mat3 uvTransform;
	#endif
#endif
#ifdef USE_MAP
	uniform sampler2D map;
#endif
#ifdef USE_ALPHAMAP
	uniform sampler2D alphaMap;
#endif`,D3o=`float metalnessFactor = metalness;
#ifdef USE_METALNESSMAP
	vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );
	metalnessFactor *= texelMetalness.b;
#endif`,N3o=`#ifdef USE_METALNESSMAP
	uniform sampler2D metalnessMap;
#endif`,R3o=`#ifdef USE_INSTANCING_MORPH
	float morphTargetInfluences[ MORPHTARGETS_COUNT ];
	float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;
	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
		morphTargetInfluences[i] =  texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;
	}
#endif`,Q3o=`#if defined( USE_MORPHCOLORS )
	vColor *= morphTargetBaseInfluence;
	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
		#if defined( USE_COLOR_ALPHA )
			if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];
		#elif defined( USE_COLOR )
			if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];
		#endif
	}
#endif`,k3o=`#ifdef USE_MORPHNORMALS
	objectNormal *= morphTargetBaseInfluence;
	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
		if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];
	}
#endif`,L3o=`#ifdef USE_MORPHTARGETS
	#ifndef USE_INSTANCING_MORPH
		uniform float morphTargetBaseInfluence;
		uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];
	#endif
	uniform sampler2DArray morphTargetsTexture;
	uniform ivec2 morphTargetsTextureSize;
	vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {
		int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;
		int y = texelIndex / morphTargetsTextureSize.x;
		int x = texelIndex - y * morphTargetsTextureSize.x;
		ivec3 morphUV = ivec3( x, y, morphTargetIndex );
		return texelFetch( morphTargetsTexture, morphUV, 0 );
	}
#endif`,H3o=`#ifdef USE_MORPHTARGETS
	transformed *= morphTargetBaseInfluence;
	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
		if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];
	}
#endif`,F3o=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;
#ifdef FLAT_SHADED
	vec3 fdx = dFdx( vViewPosition );
	vec3 fdy = dFdy( vViewPosition );
	vec3 normal = normalize( cross( fdx, fdy ) );
#else
	vec3 normal = normalize( vNormal );
	#ifdef DOUBLE_SIDED
		normal *= faceDirection;
	#endif
#endif
#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )
	#ifdef USE_TANGENT
		mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );
	#else
		mat3 tbn = getTangentFrame( - vViewPosition, normal,
		#if defined( USE_NORMALMAP )
			vNormalMapUv
		#elif defined( USE_CLEARCOAT_NORMALMAP )
			vClearcoatNormalMapUv
		#else
			vUv
		#endif
		);
	#endif
	#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )
		tbn[0] *= faceDirection;
		tbn[1] *= faceDirection;
	#endif
#endif
#ifdef USE_CLEARCOAT_NORMALMAP
	#ifdef USE_TANGENT
		mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );
	#else
		mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );
	#endif
	#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )
		tbn2[0] *= faceDirection;
		tbn2[1] *= faceDirection;
	#endif
#endif
vec3 nonPerturbedNormal = normal;`,z3o=`#ifdef USE_NORMALMAP_OBJECTSPACE
	normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;
	#ifdef FLIP_SIDED
		normal = - normal;
	#endif
	#ifdef DOUBLE_SIDED
		normal = normal * faceDirection;
	#endif
	normal = normalize( normalMatrix * normal );
#elif defined( USE_NORMALMAP_TANGENTSPACE )
	vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;
	mapN.xy *= normalScale;
	normal = normalize( tbn * mapN );
#elif defined( USE_BUMPMAP )
	normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );
#endif`,O3o=`#ifndef FLAT_SHADED
	varying vec3 vNormal;
	#ifdef USE_TANGENT
		varying vec3 vTangent;
		varying vec3 vBitangent;
	#endif
#endif`,V3o=`#ifndef FLAT_SHADED
	varying vec3 vNormal;
	#ifdef USE_TANGENT
		varying vec3 vTangent;
		varying vec3 vBitangent;
	#endif
#endif`,Y3o=`#ifndef FLAT_SHADED
	vNormal = normalize( transformedNormal );
	#ifdef USE_TANGENT
		vTangent = normalize( transformedTangent );
		vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );
	#endif
#endif`,G3o=`#ifdef USE_NORMALMAP
	uniform sampler2D normalMap;
	uniform vec2 normalScale;
#endif
#ifdef USE_NORMALMAP_OBJECTSPACE
	uniform mat3 normalMatrix;
#endif
#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )
	mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {
		vec3 q0 = dFdx( eye_pos.xyz );
		vec3 q1 = dFdy( eye_pos.xyz );
		vec2 st0 = dFdx( uv.st );
		vec2 st1 = dFdy( uv.st );
		vec3 N = surf_norm;
		vec3 q1perp = cross( q1, N );
		vec3 q0perp = cross( N, q0 );
		vec3 T = q1perp * st0.x + q0perp * st1.x;
		vec3 B = q1perp * st0.y + q0perp * st1.y;
		float det = max( dot( T, T ), dot( B, B ) );
		float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );
		return mat3( T * scale, B * scale, N );
	}
#endif`,U3o=`#ifdef USE_CLEARCOAT
	vec3 clearcoatNormal = nonPerturbedNormal;
#endif`,W3o=`#ifdef USE_CLEARCOAT_NORMALMAP
	vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;
	clearcoatMapN.xy *= clearcoatNormalScale;
	clearcoatNormal = normalize( tbn2 * clearcoatMapN );
#endif`,X3o=`#ifdef USE_CLEARCOATMAP
	uniform sampler2D clearcoatMap;
#endif
#ifdef USE_CLEARCOAT_NORMALMAP
	uniform sampler2D clearcoatNormalMap;
	uniform vec2 clearcoatNormalScale;
#endif
#ifdef USE_CLEARCOAT_ROUGHNESSMAP
	uniform sampler2D clearcoatRoughnessMap;
#endif`,j3o=`#ifdef USE_IRIDESCENCEMAP
	uniform sampler2D iridescenceMap;
#endif
#ifdef USE_IRIDESCENCE_THICKNESSMAP
	uniform sampler2D iridescenceThicknessMap;
#endif`,K3o=`#ifdef OPAQUE
diffuseColor.a = 1.0;
#endif
#ifdef USE_TRANSMISSION
diffuseColor.a *= material.transmissionAlpha;
#endif
gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,$3o=`vec3 packNormalToRGB( const in vec3 normal ) {
	return normalize( normal ) * 0.5 + 0.5;
}
vec3 unpackRGBToNormal( const in vec3 rgb ) {
	return 2.0 * rgb.xyz - 1.0;
}
const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;
const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );
const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );
const float ShiftRight8 = 1. / 256.;
vec4 packDepthToRGBA( const in float v ) {
	vec4 r = vec4( fract( v * PackFactors ), v );
	r.yzw -= r.xyz * ShiftRight8;	return r * PackUpscale;
}
float unpackRGBAToDepth( const in vec4 v ) {
	return dot( v, UnpackFactors );
}
vec2 packDepthToRG( in highp float v ) {
	return packDepthToRGBA( v ).yx;
}
float unpackRGToDepth( const in highp vec2 v ) {
	return unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) );
}
vec4 pack2HalfToRGBA( vec2 v ) {
	vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );
	return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );
}
vec2 unpackRGBATo2Half( vec4 v ) {
	return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );
}
float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {
	return ( viewZ + near ) / ( near - far );
}
float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {
	return depth * ( near - far ) - near;
}
float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {
	return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );
}
float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {
	return ( near * far ) / ( ( far - near ) * depth - far );
}`,q3o=`#ifdef PREMULTIPLIED_ALPHA
	gl_FragColor.rgb *= gl_FragColor.a;
#endif`,J3o=`vec4 mvPosition = vec4( transformed, 1.0 );
#ifdef USE_BATCHING
	mvPosition = batchingMatrix * mvPosition;
#endif
#ifdef USE_INSTANCING
	mvPosition = instanceMatrix * mvPosition;
#endif
mvPosition = modelViewMatrix * mvPosition;
gl_Position = projectionMatrix * mvPosition;`,Z3o=`#ifdef DITHERING
	gl_FragColor.rgb = dithering( gl_FragColor.rgb );
#endif`,eCo=`#ifdef DITHERING
	vec3 dithering( vec3 color ) {
		float grid_position = rand( gl_FragCoord.xy );
		vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );
		dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );
		return color + dither_shift_RGB;
	}
#endif`,tCo=`float roughnessFactor = roughness;
#ifdef USE_ROUGHNESSMAP
	vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );
	roughnessFactor *= texelRoughness.g;
#endif`,nCo=`#ifdef USE_ROUGHNESSMAP
	uniform sampler2D roughnessMap;
#endif`,oCo=`#if NUM_SPOT_LIGHT_COORDS > 0
	varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
#endif
#if NUM_SPOT_LIGHT_MAPS > 0
	uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];
#endif
#ifdef USE_SHADOWMAP
	#if NUM_DIR_LIGHT_SHADOWS > 0
		uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];
		varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
		struct DirectionalLightShadow {
			float shadowBias;
			float shadowNormalBias;
			float shadowRadius;
			vec2 shadowMapSize;
		};
		uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
	#endif
	#if NUM_SPOT_LIGHT_SHADOWS > 0
		uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];
		struct SpotLightShadow {
			float shadowBias;
			float shadowNormalBias;
			float shadowRadius;
			vec2 shadowMapSize;
		};
		uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
	#endif
	#if NUM_POINT_LIGHT_SHADOWS > 0
		uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];
		varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
		struct PointLightShadow {
			float shadowBias;
			float shadowNormalBias;
			float shadowRadius;
			vec2 shadowMapSize;
			float shadowCameraNear;
			float shadowCameraFar;
		};
		uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
	#endif
	float texture2DCompare( sampler2D depths, vec2 uv, float compare ) {
		return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );
	}
	vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {
		return unpackRGBATo2Half( texture2D( shadow, uv ) );
	}
	float VSMShadow (sampler2D shadow, vec2 uv, float compare ){
		float occlusion = 1.0;
		vec2 distribution = texture2DDistribution( shadow, uv );
		float hard_shadow = step( compare , distribution.x );
		if (hard_shadow != 1.0 ) {
			float distance = compare - distribution.x ;
			float variance = max( 0.00000, distribution.y * distribution.y );
			float softness_probability = variance / (variance + distance * distance );			softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );			occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );
		}
		return occlusion;
	}
	float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {
		float shadow = 1.0;
		shadowCoord.xyz /= shadowCoord.w;
		shadowCoord.z += shadowBias;
		bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;
		bool frustumTest = inFrustum && shadowCoord.z <= 1.0;
		if ( frustumTest ) {
		#if defined( SHADOWMAP_TYPE_PCF )
			vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
			float dx0 = - texelSize.x * shadowRadius;
			float dy0 = - texelSize.y * shadowRadius;
			float dx1 = + texelSize.x * shadowRadius;
			float dy1 = + texelSize.y * shadowRadius;
			float dx2 = dx0 / 2.0;
			float dy2 = dy0 / 2.0;
			float dx3 = dx1 / 2.0;
			float dy3 = dy1 / 2.0;
			shadow = (
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )
			) * ( 1.0 / 17.0 );
		#elif defined( SHADOWMAP_TYPE_PCF_SOFT )
			vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
			float dx = texelSize.x;
			float dy = texelSize.y;
			vec2 uv = shadowCoord.xy;
			vec2 f = fract( uv * shadowMapSize + 0.5 );
			uv -= f * texelSize;
			shadow = (
				texture2DCompare( shadowMap, uv, shadowCoord.z ) +
				texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +
				texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +
				mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),
					 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),
					 f.x ) +
				mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),
					 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),
					 f.x ) +
				mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),
					 texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),
					 f.y ) +
				mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),
					 texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),
					 f.y ) +
				mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),
						  texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),
						  f.x ),
					 mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),
						  texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),
						  f.x ),
					 f.y )
			) * ( 1.0 / 9.0 );
		#elif defined( SHADOWMAP_TYPE_VSM )
			shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );
		#else
			shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );
		#endif
		}
		return shadow;
	}
	vec2 cubeToUV( vec3 v, float texelSizeY ) {
		vec3 absV = abs( v );
		float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );
		absV *= scaleToCube;
		v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );
		vec2 planar = v.xy;
		float almostATexel = 1.5 * texelSizeY;
		float almostOne = 1.0 - almostATexel;
		if ( absV.z >= almostOne ) {
			if ( v.z > 0.0 )
				planar.x = 4.0 - v.x;
		} else if ( absV.x >= almostOne ) {
			float signX = sign( v.x );
			planar.x = v.z * signX + 2.0 * signX;
		} else if ( absV.y >= almostOne ) {
			float signY = sign( v.y );
			planar.x = v.x + 2.0 * signY + 2.0;
			planar.y = v.z * signY - 2.0;
		}
		return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );
	}
	float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {
		float shadow = 1.0;
		vec3 lightToPosition = shadowCoord.xyz;
		
		float lightToPositionLength = length( lightToPosition );
		if ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) {
			float dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );			dp += shadowBias;
			vec3 bd3D = normalize( lightToPosition );
			vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );
			#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )
				vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;
				shadow = (
					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +
					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +
					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +
					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +
					texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +
					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +
					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +
					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +
					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )
				) * ( 1.0 / 9.0 );
			#else
				shadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );
			#endif
		}
		return shadow;
	}
#endif`,rCo=`#if NUM_SPOT_LIGHT_COORDS > 0
	uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];
	varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
#endif
#ifdef USE_SHADOWMAP
	#if NUM_DIR_LIGHT_SHADOWS > 0
		uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];
		varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
		struct DirectionalLightShadow {
			float shadowBias;
			float shadowNormalBias;
			float shadowRadius;
			vec2 shadowMapSize;
		};
		uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
	#endif
	#if NUM_SPOT_LIGHT_SHADOWS > 0
		struct SpotLightShadow {
			float shadowBias;
			float shadowNormalBias;
			float shadowRadius;
			vec2 shadowMapSize;
		};
		uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
	#endif
	#if NUM_POINT_LIGHT_SHADOWS > 0
		uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];
		varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
		struct PointLightShadow {
			float shadowBias;
			float shadowNormalBias;
			float shadowRadius;
			vec2 shadowMapSize;
			float shadowCameraNear;
			float shadowCameraFar;
		};
		uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
	#endif
#endif`,iCo=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )
	vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
	vec4 shadowWorldPosition;
#endif
#if defined( USE_SHADOWMAP )
	#if NUM_DIR_LIGHT_SHADOWS > 0
		#pragma unroll_loop_start
		for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
			shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );
			vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;
		}
		#pragma unroll_loop_end
	#endif
	#if NUM_POINT_LIGHT_SHADOWS > 0
		#pragma unroll_loop_start
		for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
			shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );
			vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;
		}
		#pragma unroll_loop_end
	#endif
#endif
#if NUM_SPOT_LIGHT_COORDS > 0
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {
		shadowWorldPosition = worldPosition;
		#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
			shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;
		#endif
		vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;
	}
	#pragma unroll_loop_end
#endif`,sCo=`float getShadowMask() {
	float shadow = 1.0;
	#ifdef USE_SHADOWMAP
	#if NUM_DIR_LIGHT_SHADOWS > 0
	DirectionalLightShadow directionalLight;
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
		directionalLight = directionalLightShadows[ i ];
		shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
	}
	#pragma unroll_loop_end
	#endif
	#if NUM_SPOT_LIGHT_SHADOWS > 0
	SpotLightShadow spotLight;
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {
		spotLight = spotLightShadows[ i ];
		shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
	}
	#pragma unroll_loop_end
	#endif
	#if NUM_POINT_LIGHT_SHADOWS > 0
	PointLightShadow pointLight;
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
		pointLight = pointLightShadows[ i ];
		shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;
	}
	#pragma unroll_loop_end
	#endif
	#endif
	return shadow;
}`,aCo=`#ifdef USE_SKINNING
	mat4 boneMatX = getBoneMatrix( skinIndex.x );
	mat4 boneMatY = getBoneMatrix( skinIndex.y );
	mat4 boneMatZ = getBoneMatrix( skinIndex.z );
	mat4 boneMatW = getBoneMatrix( skinIndex.w );
#endif`,cCo=`#ifdef USE_SKINNING
	uniform mat4 bindMatrix;
	uniform mat4 bindMatrixInverse;
	uniform highp sampler2D boneTexture;
	mat4 getBoneMatrix( const in float i ) {
		int size = textureSize( boneTexture, 0 ).x;
		int j = int( i ) * 4;
		int x = j % size;
		int y = j / size;
		vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );
		vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );
		vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );
		vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );
		return mat4( v1, v2, v3, v4 );
	}
#endif`,lCo=`#ifdef USE_SKINNING
	vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );
	vec4 skinned = vec4( 0.0 );
	skinned += boneMatX * skinVertex * skinWeight.x;
	skinned += boneMatY * skinVertex * skinWeight.y;
	skinned += boneMatZ * skinVertex * skinWeight.z;
	skinned += boneMatW * skinVertex * skinWeight.w;
	transformed = ( bindMatrixInverse * skinned ).xyz;
#endif`,hCo=`#ifdef USE_SKINNING
	mat4 skinMatrix = mat4( 0.0 );
	skinMatrix += skinWeight.x * boneMatX;
	skinMatrix += skinWeight.y * boneMatY;
	skinMatrix += skinWeight.z * boneMatZ;
	skinMatrix += skinWeight.w * boneMatW;
	skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;
	objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;
	#ifdef USE_TANGENT
		objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;
	#endif
#endif`,dCo=`float specularStrength;
#ifdef USE_SPECULARMAP
	vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );
	specularStrength = texelSpecular.r;
#else
	specularStrength = 1.0;
#endif`,uCo=`#ifdef USE_SPECULARMAP
	uniform sampler2D specularMap;
#endif`,pCo=`#if defined( TONE_MAPPING )
	gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );
#endif`,mCo=`#ifndef saturate
#define saturate( a ) clamp( a, 0.0, 1.0 )
#endif
uniform float toneMappingExposure;
vec3 LinearToneMapping( vec3 color ) {
	return saturate( toneMappingExposure * color );
}
vec3 ReinhardToneMapping( vec3 color ) {
	color *= toneMappingExposure;
	return saturate( color / ( vec3( 1.0 ) + color ) );
}
vec3 OptimizedCineonToneMapping( vec3 color ) {
	color *= toneMappingExposure;
	color = max( vec3( 0.0 ), color - 0.004 );
	return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );
}
vec3 RRTAndODTFit( vec3 v ) {
	vec3 a = v * ( v + 0.0245786 ) - 0.000090537;
	vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;
	return a / b;
}
vec3 ACESFilmicToneMapping( vec3 color ) {
	const mat3 ACESInputMat = mat3(
		vec3( 0.59719, 0.07600, 0.02840 ),		vec3( 0.35458, 0.90834, 0.13383 ),
		vec3( 0.04823, 0.01566, 0.83777 )
	);
	const mat3 ACESOutputMat = mat3(
		vec3(  1.60475, -0.10208, -0.00327 ),		vec3( -0.53108,  1.10813, -0.07276 ),
		vec3( -0.07367, -0.00605,  1.07602 )
	);
	color *= toneMappingExposure / 0.6;
	color = ACESInputMat * color;
	color = RRTAndODTFit( color );
	color = ACESOutputMat * color;
	return saturate( color );
}
const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(
	vec3( 1.6605, - 0.1246, - 0.0182 ),
	vec3( - 0.5876, 1.1329, - 0.1006 ),
	vec3( - 0.0728, - 0.0083, 1.1187 )
);
const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(
	vec3( 0.6274, 0.0691, 0.0164 ),
	vec3( 0.3293, 0.9195, 0.0880 ),
	vec3( 0.0433, 0.0113, 0.8956 )
);
vec3 agxDefaultContrastApprox( vec3 x ) {
	vec3 x2 = x * x;
	vec3 x4 = x2 * x2;
	return + 15.5 * x4 * x2
		- 40.14 * x4 * x
		+ 31.96 * x4
		- 6.868 * x2 * x
		+ 0.4298 * x2
		+ 0.1191 * x
		- 0.00232;
}
vec3 AgXToneMapping( vec3 color ) {
	const mat3 AgXInsetMatrix = mat3(
		vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),
		vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),
		vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )
	);
	const mat3 AgXOutsetMatrix = mat3(
		vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),
		vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),
		vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )
	);
	const float AgxMinEv = - 12.47393;	const float AgxMaxEv = 4.026069;
	color *= toneMappingExposure;
	color = LINEAR_SRGB_TO_LINEAR_REC2020 * color;
	color = AgXInsetMatrix * color;
	color = max( color, 1e-10 );	color = log2( color );
	color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );
	color = clamp( color, 0.0, 1.0 );
	color = agxDefaultContrastApprox( color );
	color = AgXOutsetMatrix * color;
	color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );
	color = LINEAR_REC2020_TO_LINEAR_SRGB * color;
	color = clamp( color, 0.0, 1.0 );
	return color;
}
vec3 NeutralToneMapping( vec3 color ) {
	const float StartCompression = 0.8 - 0.04;
	const float Desaturation = 0.15;
	color *= toneMappingExposure;
	float x = min( color.r, min( color.g, color.b ) );
	float offset = x < 0.08 ? x - 6.25 * x * x : 0.04;
	color -= offset;
	float peak = max( color.r, max( color.g, color.b ) );
	if ( peak < StartCompression ) return color;
	float d = 1. - StartCompression;
	float newPeak = 1. - d * d / ( peak + d - StartCompression );
	color *= newPeak / peak;
	float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );
	return mix( color, vec3( newPeak ), g );
}
vec3 CustomToneMapping( vec3 color ) { return color; }`,_Co=`#ifdef USE_TRANSMISSION
	material.transmission = transmission;
	material.transmissionAlpha = 1.0;
	material.thickness = thickness;
	material.attenuationDistance = attenuationDistance;
	material.attenuationColor = attenuationColor;
	#ifdef USE_TRANSMISSIONMAP
		material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;
	#endif
	#ifdef USE_THICKNESSMAP
		material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;
	#endif
	vec3 pos = vWorldPosition;
	vec3 v = normalize( cameraPosition - pos );
	vec3 n = inverseTransformDirection( normal, viewMatrix );
	vec4 transmitted = getIBLVolumeRefraction(
		n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,
		pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,
		material.attenuationColor, material.attenuationDistance );
	material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );
	totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );
#endif`,gCo=`#ifdef USE_TRANSMISSION
	uniform float transmission;
	uniform float thickness;
	uniform float attenuationDistance;
	uniform vec3 attenuationColor;
	#ifdef USE_TRANSMISSIONMAP
		uniform sampler2D transmissionMap;
	#endif
	#ifdef USE_THICKNESSMAP
		uniform sampler2D thicknessMap;
	#endif
	uniform vec2 transmissionSamplerSize;
	uniform sampler2D transmissionSamplerMap;
	uniform mat4 modelMatrix;
	uniform mat4 projectionMatrix;
	varying vec3 vWorldPosition;
	float w0( float a ) {
		return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );
	}
	float w1( float a ) {
		return ( 1.0 / 6.0 ) * ( a *  a * ( 3.0 * a - 6.0 ) + 4.0 );
	}
	float w2( float a ){
		return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );
	}
	float w3( float a ) {
		return ( 1.0 / 6.0 ) * ( a * a * a );
	}
	float g0( float a ) {
		return w0( a ) + w1( a );
	}
	float g1( float a ) {
		return w2( a ) + w3( a );
	}
	float h0( float a ) {
		return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );
	}
	float h1( float a ) {
		return 1.0 + w3( a ) / ( w2( a ) + w3( a ) );
	}
	vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {
		uv = uv * texelSize.zw + 0.5;
		vec2 iuv = floor( uv );
		vec2 fuv = fract( uv );
		float g0x = g0( fuv.x );
		float g1x = g1( fuv.x );
		float h0x = h0( fuv.x );
		float h1x = h1( fuv.x );
		float h0y = h0( fuv.y );
		float h1y = h1( fuv.y );
		vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;
		vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;
		vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;
		vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;
		return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +
			g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );
	}
	vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {
		vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );
		vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );
		vec2 fLodSizeInv = 1.0 / fLodSize;
		vec2 cLodSizeInv = 1.0 / cLodSize;
		vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );
		vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );
		return mix( fSample, cSample, fract( lod ) );
	}
	vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {
		vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );
		vec3 modelScale;
		modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );
		modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );
		modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );
		return normalize( refractionVector ) * thickness * modelScale;
	}
	float applyIorToRoughness( const in float roughness, const in float ior ) {
		return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );
	}
	vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {
		float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );
		return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );
	}
	vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {
		if ( isinf( attenuationDistance ) ) {
			return vec3( 1.0 );
		} else {
			vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;
			vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );			return transmittance;
		}
	}
	vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,
		const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,
		const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness,
		const in vec3 attenuationColor, const in float attenuationDistance ) {
		vec4 transmittedLight;
		vec3 transmittance;
		#ifdef USE_DISPERSION
			float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;
			vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );
			for ( int i = 0; i < 3; i ++ ) {
				vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );
				vec3 refractedRayExit = position + transmissionRay;
		
				vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );
				vec2 refractionCoords = ndcPos.xy / ndcPos.w;
				refractionCoords += 1.0;
				refractionCoords /= 2.0;
		
				vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );
				transmittedLight[ i ] = transmissionSample[ i ];
				transmittedLight.a += transmissionSample.a;
				transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];
			}
			transmittedLight.a /= 3.0;
		
		#else
		
			vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );
			vec3 refractedRayExit = position + transmissionRay;
			vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );
			vec2 refractionCoords = ndcPos.xy / ndcPos.w;
			refractionCoords += 1.0;
			refractionCoords /= 2.0;
			transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );
			transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );
		
		#endif
		vec3 attenuatedColor = transmittance * transmittedLight.rgb;
		vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );
		float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;
		return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );
	}
#endif`,ACo=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
	varying vec2 vUv;
#endif
#ifdef USE_MAP
	varying vec2 vMapUv;
#endif
#ifdef USE_ALPHAMAP
	varying vec2 vAlphaMapUv;
#endif
#ifdef USE_LIGHTMAP
	varying vec2 vLightMapUv;
#endif
#ifdef USE_AOMAP
	varying vec2 vAoMapUv;
#endif
#ifdef USE_BUMPMAP
	varying vec2 vBumpMapUv;
#endif
#ifdef USE_NORMALMAP
	varying vec2 vNormalMapUv;
#endif
#ifdef USE_EMISSIVEMAP
	varying vec2 vEmissiveMapUv;
#endif
#ifdef USE_METALNESSMAP
	varying vec2 vMetalnessMapUv;
#endif
#ifdef USE_ROUGHNESSMAP
	varying vec2 vRoughnessMapUv;
#endif
#ifdef USE_ANISOTROPYMAP
	varying vec2 vAnisotropyMapUv;
#endif
#ifdef USE_CLEARCOATMAP
	varying vec2 vClearcoatMapUv;
#endif
#ifdef USE_CLEARCOAT_NORMALMAP
	varying vec2 vClearcoatNormalMapUv;
#endif
#ifdef USE_CLEARCOAT_ROUGHNESSMAP
	varying vec2 vClearcoatRoughnessMapUv;
#endif
#ifdef USE_IRIDESCENCEMAP
	varying vec2 vIridescenceMapUv;
#endif
#ifdef USE_IRIDESCENCE_THICKNESSMAP
	varying vec2 vIridescenceThicknessMapUv;
#endif
#ifdef USE_SHEEN_COLORMAP
	varying vec2 vSheenColorMapUv;
#endif
#ifdef USE_SHEEN_ROUGHNESSMAP
	varying vec2 vSheenRoughnessMapUv;
#endif
#ifdef USE_SPECULARMAP
	varying vec2 vSpecularMapUv;
#endif
#ifdef USE_SPECULAR_COLORMAP
	varying vec2 vSpecularColorMapUv;
#endif
#ifdef USE_SPECULAR_INTENSITYMAP
	varying vec2 vSpecularIntensityMapUv;
#endif
#ifdef USE_TRANSMISSIONMAP
	uniform mat3 transmissionMapTransform;
	varying vec2 vTransmissionMapUv;
#endif
#ifdef USE_THICKNESSMAP
	uniform mat3 thicknessMapTransform;
	varying vec2 vThicknessMapUv;
#endif`,fCo=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
	varying vec2 vUv;
#endif
#ifdef USE_MAP
	uniform mat3 mapTransform;
	varying vec2 vMapUv;
#endif
#ifdef USE_ALPHAMAP
	uniform mat3 alphaMapTransform;
	varying vec2 vAlphaMapUv;
#endif
#ifdef USE_LIGHTMAP
	uniform mat3 lightMapTransform;
	varying vec2 vLightMapUv;
#endif
#ifdef USE_AOMAP
	uniform mat3 aoMapTransform;
	varying vec2 vAoMapUv;
#endif
#ifdef USE_BUMPMAP
	uniform mat3 bumpMapTransform;
	varying vec2 vBumpMapUv;
#endif
#ifdef USE_NORMALMAP
	uniform mat3 normalMapTransform;
	varying vec2 vNormalMapUv;
#endif
#ifdef USE_DISPLACEMENTMAP
	uniform mat3 displacementMapTransform;
	varying vec2 vDisplacementMapUv;
#endif
#ifdef USE_EMISSIVEMAP
	uniform mat3 emissiveMapTransform;
	varying vec2 vEmissiveMapUv;
#endif
#ifdef USE_METALNESSMAP
	uniform mat3 metalnessMapTransform;
	varying vec2 vMetalnessMapUv;
#endif
#ifdef USE_ROUGHNESSMAP
	uniform mat3 roughnessMapTransform;
	varying vec2 vRoughnessMapUv;
#endif
#ifdef USE_ANISOTROPYMAP
	uniform mat3 anisotropyMapTransform;
	varying vec2 vAnisotropyMapUv;
#endif
#ifdef USE_CLEARCOATMAP
	uniform mat3 clearcoatMapTransform;
	varying vec2 vClearcoatMapUv;
#endif
#ifdef USE_CLEARCOAT_NORMALMAP
	uniform mat3 clearcoatNormalMapTransform;
	varying vec2 vClearcoatNormalMapUv;
#endif
#ifdef USE_CLEARCOAT_ROUGHNESSMAP
	uniform mat3 clearcoatRoughnessMapTransform;
	varying vec2 vClearcoatRoughnessMapUv;
#endif
#ifdef USE_SHEEN_COLORMAP
	uniform mat3 sheenColorMapTransform;
	varying vec2 vSheenColorMapUv;
#endif
#ifdef USE_SHEEN_ROUGHNESSMAP
	uniform mat3 sheenRoughnessMapTransform;
	varying vec2 vSheenRoughnessMapUv;
#endif
#ifdef USE_IRIDESCENCEMAP
	uniform mat3 iridescenceMapTransform;
	varying vec2 vIridescenceMapUv;
#endif
#ifdef USE_IRIDESCENCE_THICKNESSMAP
	uniform mat3 iridescenceThicknessMapTransform;
	varying vec2 vIridescenceThicknessMapUv;
#endif
#ifdef USE_SPECULARMAP
	uniform mat3 specularMapTransform;
	varying vec2 vSpecularMapUv;
#endif
#ifdef USE_SPECULAR_COLORMAP
	uniform mat3 specularColorMapTransform;
	varying vec2 vSpecularColorMapUv;
#endif
#ifdef USE_SPECULAR_INTENSITYMAP
	uniform mat3 specularIntensityMapTransform;
	varying vec2 vSpecularIntensityMapUv;
#endif
#ifdef USE_TRANSMISSIONMAP
	uniform mat3 transmissionMapTransform;
	varying vec2 vTransmissionMapUv;
#endif
#ifdef USE_THICKNESSMAP
	uniform mat3 thicknessMapTransform;
	varying vec2 vThicknessMapUv;
#endif`,yCo=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
	vUv = vec3( uv, 1 ).xy;
#endif
#ifdef USE_MAP
	vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;
#endif
#ifdef USE_ALPHAMAP
	vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_LIGHTMAP
	vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_AOMAP
	vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_BUMPMAP
	vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_NORMALMAP
	vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_DISPLACEMENTMAP
	vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_EMISSIVEMAP
	vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_METALNESSMAP
	vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_ROUGHNESSMAP
	vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_ANISOTROPYMAP
	vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_CLEARCOATMAP
	vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_CLEARCOAT_NORMALMAP
	vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_CLEARCOAT_ROUGHNESSMAP
	vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_IRIDESCENCEMAP
	vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_IRIDESCENCE_THICKNESSMAP
	vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_SHEEN_COLORMAP
	vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_SHEEN_ROUGHNESSMAP
	vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_SPECULARMAP
	vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_SPECULAR_COLORMAP
	vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_SPECULAR_INTENSITYMAP
	vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_TRANSMISSIONMAP
	vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_THICKNESSMAP
	vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;
#endif`,xCo=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0
	vec4 worldPosition = vec4( transformed, 1.0 );
	#ifdef USE_BATCHING
		worldPosition = batchingMatrix * worldPosition;
	#endif
	#ifdef USE_INSTANCING
		worldPosition = instanceMatrix * worldPosition;
	#endif
	worldPosition = modelMatrix * worldPosition;
#endif`,CCo=`varying vec2 vUv;
uniform mat3 uvTransform;
void main() {
	vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
	gl_Position = vec4( position.xy, 1.0, 1.0 );
}`,bCo=`uniform sampler2D t2D;
uniform float backgroundIntensity;
varying vec2 vUv;
void main() {
	vec4 texColor = texture2D( t2D, vUv );
	#ifdef DECODE_VIDEO_TEXTURE
		texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );
	#endif
	texColor.rgb *= backgroundIntensity;
	gl_FragColor = texColor;
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
}`,ICo=`varying vec3 vWorldDirection;
#include <common>
void main() {
	vWorldDirection = transformDirection( position, modelMatrix );
	#include <begin_vertex>
	#include <project_vertex>
	gl_Position.z = gl_Position.w;
}`,vCo=`#ifdef ENVMAP_TYPE_CUBE
	uniform samplerCube envMap;
#elif defined( ENVMAP_TYPE_CUBE_UV )
	uniform sampler2D envMap;
#endif
uniform float flipEnvMap;
uniform float backgroundBlurriness;
uniform float backgroundIntensity;
uniform mat3 backgroundRotation;
varying vec3 vWorldDirection;
#include <cube_uv_reflection_fragment>
void main() {
	#ifdef ENVMAP_TYPE_CUBE
		vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );
	#elif defined( ENVMAP_TYPE_CUBE_UV )
		vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );
	#else
		vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );
	#endif
	texColor.rgb *= backgroundIntensity;
	gl_FragColor = texColor;
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
}`,SCo=`varying vec3 vWorldDirection;
#include <common>
void main() {
	vWorldDirection = transformDirection( position, modelMatrix );
	#include <begin_vertex>
	#include <project_vertex>
	gl_Position.z = gl_Position.w;
}`,PCo=`uniform samplerCube tCube;
uniform float tFlip;
uniform float opacity;
varying vec3 vWorldDirection;
void main() {
	vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );
	gl_FragColor = texColor;
	gl_FragColor.a *= opacity;
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
}`,ECo=`#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
varying vec2 vHighPrecisionZW;
void main() {
	#include <uv_vertex>
	#include <batching_vertex>
	#include <skinbase_vertex>
	#include <morphinstance_vertex>
	#ifdef USE_DISPLACEMENTMAP
		#include <beginnormal_vertex>
		#include <morphnormal_vertex>
		#include <skinnormal_vertex>
	#endif
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <displacementmap_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	vHighPrecisionZW = gl_Position.zw;
}`,MCo=`#if DEPTH_PACKING == 3200
	uniform float opacity;
#endif
#include <common>
#include <packing>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
varying vec2 vHighPrecisionZW;
void main() {
	vec4 diffuseColor = vec4( 1.0 );
	#include <clipping_planes_fragment>
	#if DEPTH_PACKING == 3200
		diffuseColor.a = opacity;
	#endif
	#include <map_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	#include <logdepthbuf_fragment>
	float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;
	#if DEPTH_PACKING == 3200
		gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );
	#elif DEPTH_PACKING == 3201
		gl_FragColor = packDepthToRGBA( fragCoordZ );
	#endif
}`,wCo=`#define DISTANCE
varying vec3 vWorldPosition;
#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	#include <batching_vertex>
	#include <skinbase_vertex>
	#include <morphinstance_vertex>
	#ifdef USE_DISPLACEMENTMAP
		#include <beginnormal_vertex>
		#include <morphnormal_vertex>
		#include <skinnormal_vertex>
	#endif
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <displacementmap_vertex>
	#include <project_vertex>
	#include <worldpos_vertex>
	#include <clipping_planes_vertex>
	vWorldPosition = worldPosition.xyz;
}`,BCo=`#define DISTANCE
uniform vec3 referencePosition;
uniform float nearDistance;
uniform float farDistance;
varying vec3 vWorldPosition;
#include <common>
#include <packing>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <clipping_planes_pars_fragment>
void main () {
	vec4 diffuseColor = vec4( 1.0 );
	#include <clipping_planes_fragment>
	#include <map_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	float dist = length( vWorldPosition - referencePosition );
	dist = ( dist - nearDistance ) / ( farDistance - nearDistance );
	dist = saturate( dist );
	gl_FragColor = packDepthToRGBA( dist );
}`,TCo=`varying vec3 vWorldDirection;
#include <common>
void main() {
	vWorldDirection = transformDirection( position, modelMatrix );
	#include <begin_vertex>
	#include <project_vertex>
}`,DCo=`uniform sampler2D tEquirect;
varying vec3 vWorldDirection;
#include <common>
void main() {
	vec3 direction = normalize( vWorldDirection );
	vec2 sampleUV = equirectUv( direction );
	gl_FragColor = texture2D( tEquirect, sampleUV );
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
}`,NCo=`uniform float scale;
attribute float lineDistance;
varying float vLineDistance;
#include <common>
#include <uv_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <morphtarget_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	vLineDistance = scale * lineDistance;
	#include <uv_vertex>
	#include <color_vertex>
	#include <morphinstance_vertex>
	#include <morphcolor_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	#include <fog_vertex>
}`,RCo=`uniform vec3 diffuse;
uniform float opacity;
uniform float dashSize;
uniform float totalSize;
varying float vLineDistance;
#include <common>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <fog_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <clipping_planes_fragment>
	if ( mod( vLineDistance, totalSize ) > dashSize ) {
		discard;
	}
	vec3 outgoingLight = vec3( 0.0 );
	#include <logdepthbuf_fragment>
	#include <map_fragment>
	#include <color_fragment>
	outgoingLight = diffuseColor.rgb;
	#include <opaque_fragment>
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
}`,QCo=`#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <envmap_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	#include <color_vertex>
	#include <morphinstance_vertex>
	#include <morphcolor_vertex>
	#include <batching_vertex>
	#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )
		#include <beginnormal_vertex>
		#include <morphnormal_vertex>
		#include <skinbase_vertex>
		#include <skinnormal_vertex>
		#include <defaultnormal_vertex>
	#endif
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	#include <worldpos_vertex>
	#include <envmap_vertex>
	#include <fog_vertex>
}`,kCo=`uniform vec3 diffuse;
uniform float opacity;
#ifndef FLAT_SHADED
	varying vec3 vNormal;
#endif
#include <common>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <envmap_common_pars_fragment>
#include <envmap_pars_fragment>
#include <fog_pars_fragment>
#include <specularmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <clipping_planes_fragment>
	#include <logdepthbuf_fragment>
	#include <map_fragment>
	#include <color_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	#include <specularmap_fragment>
	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
	#ifdef USE_LIGHTMAP
		vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
		reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;
	#else
		reflectedLight.indirectDiffuse += vec3( 1.0 );
	#endif
	#include <aomap_fragment>
	reflectedLight.indirectDiffuse *= diffuseColor.rgb;
	vec3 outgoingLight = reflectedLight.indirectDiffuse;
	#include <envmap_fragment>
	#include <opaque_fragment>
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
	#include <dithering_fragment>
}`,LCo=`#define LAMBERT
varying vec3 vViewPosition;
#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <envmap_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <shadowmap_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	#include <color_vertex>
	#include <morphinstance_vertex>
	#include <morphcolor_vertex>
	#include <batching_vertex>
	#include <beginnormal_vertex>
	#include <morphnormal_vertex>
	#include <skinbase_vertex>
	#include <skinnormal_vertex>
	#include <defaultnormal_vertex>
	#include <normal_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <displacementmap_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	vViewPosition = - mvPosition.xyz;
	#include <worldpos_vertex>
	#include <envmap_vertex>
	#include <shadowmap_vertex>
	#include <fog_vertex>
}`,HCo=`#define LAMBERT
uniform vec3 diffuse;
uniform vec3 emissive;
uniform float opacity;
#include <common>
#include <packing>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <emissivemap_pars_fragment>
#include <envmap_common_pars_fragment>
#include <envmap_pars_fragment>
#include <fog_pars_fragment>
#include <bsdfs>
#include <lights_pars_begin>
#include <normal_pars_fragment>
#include <lights_lambert_pars_fragment>
#include <shadowmap_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <specularmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <clipping_planes_fragment>
	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
	vec3 totalEmissiveRadiance = emissive;
	#include <logdepthbuf_fragment>
	#include <map_fragment>
	#include <color_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	#include <specularmap_fragment>
	#include <normal_fragment_begin>
	#include <normal_fragment_maps>
	#include <emissivemap_fragment>
	#include <lights_lambert_fragment>
	#include <lights_fragment_begin>
	#include <lights_fragment_maps>
	#include <lights_fragment_end>
	#include <aomap_fragment>
	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
	#include <envmap_fragment>
	#include <opaque_fragment>
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
	#include <dithering_fragment>
}`,FCo=`#define MATCAP
varying vec3 vViewPosition;
#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <color_pars_vertex>
#include <displacementmap_pars_vertex>
#include <fog_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	#include <color_vertex>
	#include <morphinstance_vertex>
	#include <morphcolor_vertex>
	#include <batching_vertex>
	#include <beginnormal_vertex>
	#include <morphnormal_vertex>
	#include <skinbase_vertex>
	#include <skinnormal_vertex>
	#include <defaultnormal_vertex>
	#include <normal_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <displacementmap_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	#include <fog_vertex>
	vViewPosition = - mvPosition.xyz;
}`,zCo=`#define MATCAP
uniform vec3 diffuse;
uniform float opacity;
uniform sampler2D matcap;
varying vec3 vViewPosition;
#include <common>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <fog_pars_fragment>
#include <normal_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <clipping_planes_fragment>
	#include <logdepthbuf_fragment>
	#include <map_fragment>
	#include <color_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	#include <normal_fragment_begin>
	#include <normal_fragment_maps>
	vec3 viewDir = normalize( vViewPosition );
	vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );
	vec3 y = cross( viewDir, x );
	vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;
	#ifdef USE_MATCAP
		vec4 matcapColor = texture2D( matcap, uv );
	#else
		vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );
	#endif
	vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;
	#include <opaque_fragment>
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
	#include <dithering_fragment>
}`,OCo=`#define NORMAL
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
	varying vec3 vViewPosition;
#endif
#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	#include <batching_vertex>
	#include <beginnormal_vertex>
	#include <morphinstance_vertex>
	#include <morphnormal_vertex>
	#include <skinbase_vertex>
	#include <skinnormal_vertex>
	#include <defaultnormal_vertex>
	#include <normal_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <displacementmap_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
	vViewPosition = - mvPosition.xyz;
#endif
}`,VCo=`#define NORMAL
uniform float opacity;
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
	varying vec3 vViewPosition;
#endif
#include <packing>
#include <uv_pars_fragment>
#include <normal_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );
	#include <clipping_planes_fragment>
	#include <logdepthbuf_fragment>
	#include <normal_fragment_begin>
	#include <normal_fragment_maps>
	gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a );
	#ifdef OPAQUE
		gl_FragColor.a = 1.0;
	#endif
}`,YCo=`#define PHONG
varying vec3 vViewPosition;
#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <envmap_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <shadowmap_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	#include <color_vertex>
	#include <morphcolor_vertex>
	#include <batching_vertex>
	#include <beginnormal_vertex>
	#include <morphinstance_vertex>
	#include <morphnormal_vertex>
	#include <skinbase_vertex>
	#include <skinnormal_vertex>
	#include <defaultnormal_vertex>
	#include <normal_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <displacementmap_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	vViewPosition = - mvPosition.xyz;
	#include <worldpos_vertex>
	#include <envmap_vertex>
	#include <shadowmap_vertex>
	#include <fog_vertex>
}`,GCo=`#define PHONG
uniform vec3 diffuse;
uniform vec3 emissive;
uniform vec3 specular;
uniform float shininess;
uniform float opacity;
#include <common>
#include <packing>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <emissivemap_pars_fragment>
#include <envmap_common_pars_fragment>
#include <envmap_pars_fragment>
#include <fog_pars_fragment>
#include <bsdfs>
#include <lights_pars_begin>
#include <normal_pars_fragment>
#include <lights_phong_pars_fragment>
#include <shadowmap_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <specularmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <clipping_planes_fragment>
	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
	vec3 totalEmissiveRadiance = emissive;
	#include <logdepthbuf_fragment>
	#include <map_fragment>
	#include <color_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	#include <specularmap_fragment>
	#include <normal_fragment_begin>
	#include <normal_fragment_maps>
	#include <emissivemap_fragment>
	#include <lights_phong_fragment>
	#include <lights_fragment_begin>
	#include <lights_fragment_maps>
	#include <lights_fragment_end>
	#include <aomap_fragment>
	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;
	#include <envmap_fragment>
	#include <opaque_fragment>
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
	#include <dithering_fragment>
}`,UCo=`#define STANDARD
varying vec3 vViewPosition;
#ifdef USE_TRANSMISSION
	varying vec3 vWorldPosition;
#endif
#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <shadowmap_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	#include <color_vertex>
	#include <morphinstance_vertex>
	#include <morphcolor_vertex>
	#include <batching_vertex>
	#include <beginnormal_vertex>
	#include <morphnormal_vertex>
	#include <skinbase_vertex>
	#include <skinnormal_vertex>
	#include <defaultnormal_vertex>
	#include <normal_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <displacementmap_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	vViewPosition = - mvPosition.xyz;
	#include <worldpos_vertex>
	#include <shadowmap_vertex>
	#include <fog_vertex>
#ifdef USE_TRANSMISSION
	vWorldPosition = worldPosition.xyz;
#endif
}`,WCo=`#define STANDARD
#ifdef PHYSICAL
	#define IOR
	#define USE_SPECULAR
#endif
uniform vec3 diffuse;
uniform vec3 emissive;
uniform float roughness;
uniform float metalness;
uniform float opacity;
#ifdef IOR
	uniform float ior;
#endif
#ifdef USE_SPECULAR
	uniform float specularIntensity;
	uniform vec3 specularColor;
	#ifdef USE_SPECULAR_COLORMAP
		uniform sampler2D specularColorMap;
	#endif
	#ifdef USE_SPECULAR_INTENSITYMAP
		uniform sampler2D specularIntensityMap;
	#endif
#endif
#ifdef USE_CLEARCOAT
	uniform float clearcoat;
	uniform float clearcoatRoughness;
#endif
#ifdef USE_DISPERSION
	uniform float dispersion;
#endif
#ifdef USE_IRIDESCENCE
	uniform float iridescence;
	uniform float iridescenceIOR;
	uniform float iridescenceThicknessMinimum;
	uniform float iridescenceThicknessMaximum;
#endif
#ifdef USE_SHEEN
	uniform vec3 sheenColor;
	uniform float sheenRoughness;
	#ifdef USE_SHEEN_COLORMAP
		uniform sampler2D sheenColorMap;
	#endif
	#ifdef USE_SHEEN_ROUGHNESSMAP
		uniform sampler2D sheenRoughnessMap;
	#endif
#endif
#ifdef USE_ANISOTROPY
	uniform vec2 anisotropyVector;
	#ifdef USE_ANISOTROPYMAP
		uniform sampler2D anisotropyMap;
	#endif
#endif
varying vec3 vViewPosition;
#include <common>
#include <packing>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <emissivemap_pars_fragment>
#include <iridescence_fragment>
#include <cube_uv_reflection_fragment>
#include <envmap_common_pars_fragment>
#include <envmap_physical_pars_fragment>
#include <fog_pars_fragment>
#include <lights_pars_begin>
#include <normal_pars_fragment>
#include <lights_physical_pars_fragment>
#include <transmission_pars_fragment>
#include <shadowmap_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <clearcoat_pars_fragment>
#include <iridescence_pars_fragment>
#include <roughnessmap_pars_fragment>
#include <metalnessmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <clipping_planes_fragment>
	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
	vec3 totalEmissiveRadiance = emissive;
	#include <logdepthbuf_fragment>
	#include <map_fragment>
	#include <color_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	#include <roughnessmap_fragment>
	#include <metalnessmap_fragment>
	#include <normal_fragment_begin>
	#include <normal_fragment_maps>
	#include <clearcoat_normal_fragment_begin>
	#include <clearcoat_normal_fragment_maps>
	#include <emissivemap_fragment>
	#include <lights_physical_fragment>
	#include <lights_fragment_begin>
	#include <lights_fragment_maps>
	#include <lights_fragment_end>
	#include <aomap_fragment>
	vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;
	vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;
	#include <transmission_fragment>
	vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;
	#ifdef USE_SHEEN
		float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );
		outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;
	#endif
	#ifdef USE_CLEARCOAT
		float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );
		vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );
		outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;
	#endif
	#include <opaque_fragment>
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
	#include <dithering_fragment>
}`,XCo=`#define TOON
varying vec3 vViewPosition;
#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <shadowmap_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	#include <color_vertex>
	#include <morphinstance_vertex>
	#include <morphcolor_vertex>
	#include <batching_vertex>
	#include <beginnormal_vertex>
	#include <morphnormal_vertex>
	#include <skinbase_vertex>
	#include <skinnormal_vertex>
	#include <defaultnormal_vertex>
	#include <normal_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <displacementmap_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	vViewPosition = - mvPosition.xyz;
	#include <worldpos_vertex>
	#include <shadowmap_vertex>
	#include <fog_vertex>
}`,jCo=`#define TOON
uniform vec3 diffuse;
uniform vec3 emissive;
uniform float opacity;
#include <common>
#include <packing>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <emissivemap_pars_fragment>
#include <gradientmap_pars_fragment>
#include <fog_pars_fragment>
#include <bsdfs>
#include <lights_pars_begin>
#include <normal_pars_fragment>
#include <lights_toon_pars_fragment>
#include <shadowmap_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <clipping_planes_fragment>
	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
	vec3 totalEmissiveRadiance = emissive;
	#include <logdepthbuf_fragment>
	#include <map_fragment>
	#include <color_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	#include <normal_fragment_begin>
	#include <normal_fragment_maps>
	#include <emissivemap_fragment>
	#include <lights_toon_fragment>
	#include <lights_fragment_begin>
	#include <lights_fragment_maps>
	#include <lights_fragment_end>
	#include <aomap_fragment>
	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
	#include <opaque_fragment>
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
	#include <dithering_fragment>
}`,KCo=`uniform float size;
uniform float scale;
#include <common>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <morphtarget_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
#ifdef USE_POINTS_UV
	varying vec2 vUv;
	uniform mat3 uvTransform;
#endif
void main() {
	#ifdef USE_POINTS_UV
		vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
	#endif
	#include <color_vertex>
	#include <morphinstance_vertex>
	#include <morphcolor_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <project_vertex>
	gl_PointSize = size;
	#ifdef USE_SIZEATTENUATION
		bool isPerspective = isPerspectiveMatrix( projectionMatrix );
		if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );
	#endif
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	#include <worldpos_vertex>
	#include <fog_vertex>
}`,$Co=`uniform vec3 diffuse;
uniform float opacity;
#include <common>
#include <color_pars_fragment>
#include <map_particle_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <fog_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <clipping_planes_fragment>
	vec3 outgoingLight = vec3( 0.0 );
	#include <logdepthbuf_fragment>
	#include <map_particle_fragment>
	#include <color_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	outgoingLight = diffuseColor.rgb;
	#include <opaque_fragment>
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
}`,qCo=`#include <common>
#include <batching_pars_vertex>
#include <fog_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <shadowmap_pars_vertex>
void main() {
	#include <batching_vertex>
	#include <beginnormal_vertex>
	#include <morphinstance_vertex>
	#include <morphnormal_vertex>
	#include <skinbase_vertex>
	#include <skinnormal_vertex>
	#include <defaultnormal_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <worldpos_vertex>
	#include <shadowmap_vertex>
	#include <fog_vertex>
}`,JCo=`uniform vec3 color;
uniform float opacity;
#include <common>
#include <packing>
#include <fog_pars_fragment>
#include <bsdfs>
#include <lights_pars_begin>
#include <logdepthbuf_pars_fragment>
#include <shadowmap_pars_fragment>
#include <shadowmask_pars_fragment>
void main() {
	#include <logdepthbuf_fragment>
	gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
}`,ZCo=`uniform float rotation;
uniform vec2 center;
#include <common>
#include <uv_pars_vertex>
#include <fog_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );
	vec2 scale;
	scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );
	scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );
	#ifndef USE_SIZEATTENUATION
		bool isPerspective = isPerspectiveMatrix( projectionMatrix );
		if ( isPerspective ) scale *= - mvPosition.z;
	#endif
	vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;
	vec2 rotatedPosition;
	rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;
	rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;
	mvPosition.xy += rotatedPosition;
	gl_Position = projectionMatrix * mvPosition;
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	#include <fog_vertex>
}`,ebo=`uniform vec3 diffuse;
uniform float opacity;
#include <common>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <fog_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <clipping_planes_fragment>
	vec3 outgoingLight = vec3( 0.0 );
	#include <logdepthbuf_fragment>
	#include <map_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	outgoingLight = diffuseColor.rgb;
	#include <opaque_fragment>
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
}`,Va={alphahash_fragment:b4o,alphahash_pars_fragment:I4o,alphamap_fragment:v4o,alphamap_pars_fragment:S4o,alphatest_fragment:P4o,alphatest_pars_fragment:E4o,aomap_fragment:M4o,aomap_pars_fragment:w4o,batching_pars_vertex:B4o,batching_vertex:T4o,begin_vertex:D4o,beginnormal_vertex:N4o,bsdfs:R4o,iridescence_fragment:Q4o,bumpmap_pars_fragment:k4o,clipping_planes_fragment:L4o,clipping_planes_pars_fragment:H4o,clipping_planes_pars_vertex:F4o,clipping_planes_vertex:z4o,color_fragment:O4o,color_pars_fragment:V4o,color_pars_vertex:Y4o,color_vertex:G4o,common:U4o,cube_uv_reflection_fragment:W4o,defaultnormal_vertex:X4o,displacementmap_pars_vertex:j4o,displacementmap_vertex:K4o,emissivemap_fragment:$4o,emissivemap_pars_fragment:q4o,colorspace_fragment:J4o,colorspace_pars_fragment:Z4o,envmap_fragment:e3o,envmap_common_pars_fragment:t3o,envmap_pars_fragment:n3o,envmap_pars_vertex:o3o,envmap_physical_pars_fragment:m3o,envmap_vertex:r3o,fog_vertex:i3o,fog_pars_vertex:s3o,fog_fragment:a3o,fog_pars_fragment:c3o,gradientmap_pars_fragment:l3o,lightmap_pars_fragment:h3o,lights_lambert_fragment:d3o,lights_lambert_pars_fragment:u3o,lights_pars_begin:p3o,lights_toon_fragment:_3o,lights_toon_pars_fragment:g3o,lights_phong_fragment:A3o,lights_phong_pars_fragment:f3o,lights_physical_fragment:y3o,lights_physical_pars_fragment:x3o,lights_fragment_begin:C3o,lights_fragment_maps:b3o,lights_fragment_end:I3o,logdepthbuf_fragment:v3o,logdepthbuf_pars_fragment:S3o,logdepthbuf_pars_vertex:P3o,logdepthbuf_vertex:E3o,map_fragment:M3o,map_pars_fragment:w3o,map_particle_fragment:B3o,map_particle_pars_fragment:T3o,metalnessmap_fragment:D3o,metalnessmap_pars_fragment:N3o,morphinstance_vertex:R3o,morphcolor_vertex:Q3o,morphnormal_vertex:k3o,morphtarget_pars_vertex:L3o,morphtarget_vertex:H3o,normal_fragment_begin:F3o,normal_fragment_maps:z3o,normal_pars_fragment:O3o,normal_pars_vertex:V3o,normal_vertex:Y3o,normalmap_pars_fragment:G3o,clearcoat_normal_fragment_begin:U3o,clearcoat_normal_fragment_maps:W3o,clearcoat_pars_fragment:X3o,iridescence_pars_fragment:j3o,opaque_fragment:K3o,packing:$3o,premultiplied_alpha_fragment:q3o,project_vertex:J3o,dithering_fragment:Z3o,dithering_pars_fragment:eCo,roughnessmap_fragment:tCo,roughnessmap_pars_fragment:nCo,shadowmap_pars_fragment:oCo,shadowmap_pars_vertex:rCo,shadowmap_vertex:iCo,shadowmask_pars_fragment:sCo,skinbase_vertex:aCo,skinning_pars_vertex:cCo,skinning_vertex:lCo,skinnormal_vertex:hCo,specularmap_fragment:dCo,specularmap_pars_fragment:uCo,tonemapping_fragment:pCo,tonemapping_pars_fragment:mCo,transmission_fragment:_Co,transmission_pars_fragment:gCo,uv_pars_fragment:ACo,uv_pars_vertex:fCo,uv_vertex:yCo,worldpos_vertex:xCo,background_vert:CCo,background_frag:bCo,backgroundCube_vert:ICo,backgroundCube_frag:vCo,cube_vert:SCo,cube_frag:PCo,depth_vert:ECo,depth_frag:MCo,distanceRGBA_vert:wCo,distanceRGBA_frag:BCo,equirect_vert:TCo,equirect_frag:DCo,linedashed_vert:NCo,linedashed_frag:RCo,meshbasic_vert:QCo,meshbasic_frag:kCo,meshlambert_vert:LCo,meshlambert_frag:HCo,meshmatcap_vert:FCo,meshmatcap_frag:zCo,meshnormal_vert:OCo,meshnormal_frag:VCo,meshphong_vert:YCo,meshphong_frag:GCo,meshphysical_vert:UCo,meshphysical_frag:WCo,meshtoon_vert:XCo,meshtoon_frag:jCo,points_vert:KCo,points_frag:$Co,shadow_vert:qCo,shadow_frag:JCo,sprite_vert:ZCo,sprite_frag:ebo},Er={common:{diffuse:{value:new No(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Ya},alphaMap:{value:null},alphaMapTransform:{value:new Ya},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Ya}},envmap:{envMap:{value:null},envMapRotation:{value:new Ya},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:0.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Ya}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Ya}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Ya},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Ya},normalScale:{value:new ro(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Ya},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Ya}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Ya}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Ya}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:0.00025},fogNear:{value:1},fogFar:{value:2000},fogColor:{value:new No(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new No(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Ya},alphaTest:{value:0},uvTransform:{value:new Ya}},sprite:{diffuse:{value:new No(16777215)},opacity:{value:1},center:{value:new ro(0.5,0.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Ya},alphaMap:{value:null},alphaMapTransform:{value:new Ya},alphaTest:{value:0}}},M9={basic:{uniforms:Ty([Er.common,Er.specularmap,Er.envmap,Er.aomap,Er.lightmap,Er.fog]),vertexShader:Va.meshbasic_vert,fragmentShader:Va.meshbasic_frag},lambert:{uniforms:Ty([Er.common,Er.specularmap,Er.envmap,Er.aomap,Er.lightmap,Er.emissivemap,Er.bumpmap,Er.normalmap,Er.displacementmap,Er.fog,Er.lights,{emissive:{value:new No(0)}}]),vertexShader:Va.meshlambert_vert,fragmentShader:Va.meshlambert_frag},phong:{uniforms:Ty([Er.common,Er.specularmap,Er.envmap,Er.aomap,Er.lightmap,Er.emissivemap,Er.bumpmap,Er.normalmap,Er.displacementmap,Er.fog,Er.lights,{emissive:{value:new No(0)},specular:{value:new No(1118481)},shininess:{value:30}}]),vertexShader:Va.meshphong_vert,fragmentShader:Va.meshphong_frag},standard:{uniforms:Ty([Er.common,Er.envmap,Er.aomap,Er.lightmap,Er.emissivemap,Er.bumpmap,Er.normalmap,Er.displacementmap,Er.roughnessmap,Er.metalnessmap,Er.fog,Er.lights,{emissive:{value:new No(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Va.meshphysical_vert,fragmentShader:Va.meshphysical_frag},toon:{uniforms:Ty([Er.common,Er.aomap,Er.lightmap,Er.emissivemap,Er.bumpmap,Er.normalmap,Er.displacementmap,Er.gradientmap,Er.fog,Er.lights,{emissive:{value:new No(0)}}]),vertexShader:Va.meshtoon_vert,fragmentShader:Va.meshtoon_frag},matcap:{uniforms:Ty([Er.common,Er.bumpmap,Er.normalmap,Er.displacementmap,Er.fog,{matcap:{value:null}}]),vertexShader:Va.meshmatcap_vert,fragmentShader:Va.meshmatcap_frag},points:{uniforms:Ty([Er.points,Er.fog]),vertexShader:Va.points_vert,fragmentShader:Va.points_frag},dashed:{uniforms:Ty([Er.common,Er.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Va.linedashed_vert,fragmentShader:Va.linedashed_frag},depth:{uniforms:Ty([Er.common,Er.displacementmap]),vertexShader:Va.depth_vert,fragmentShader:Va.depth_frag},normal:{uniforms:Ty([Er.common,Er.bumpmap,Er.normalmap,Er.displacementmap,{opacity:{value:1}}]),vertexShader:Va.meshnormal_vert,fragmentShader:Va.meshnormal_frag},sprite:{uniforms:Ty([Er.sprite,Er.fog]),vertexShader:Va.sprite_vert,fragmentShader:Va.sprite_frag},background:{uniforms:{uvTransform:{value:new Ya},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Va.background_vert,fragmentShader:Va.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Ya}},vertexShader:Va.backgroundCube_vert,fragmentShader:Va.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Va.cube_vert,fragmentShader:Va.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Va.equirect_vert,fragmentShader:Va.equirect_frag},distanceRGBA:{uniforms:Ty([Er.common,Er.displacementmap,{referencePosition:{value:new Et},nearDistance:{value:1},farDistance:{value:1000}}]),vertexShader:Va.distanceRGBA_vert,fragmentShader:Va.distanceRGBA_frag},shadow:{uniforms:Ty([Er.lights,Er.fog,{color:{value:new No(0)},opacity:{value:1}}]),vertexShader:Va.shadow_vert,fragmentShader:Va.shadow_frag}};M9.physical={uniforms:Ty([M9.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Ya},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Ya},clearcoatNormalScale:{value:new ro(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Ya},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Ya},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Ya},sheen:{value:0},sheenColor:{value:new No(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Ya},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Ya},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Ya},transmissionSamplerSize:{value:new ro},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Ya},attenuationDistance:{value:0},attenuationColor:{value:new No(0)},specularColor:{value:new No(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Ya},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Ya},anisotropyVector:{value:new ro},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Ya}}]),vertexShader:Va.meshphysical_vert,fragmentShader:Va.meshphysical_frag};var mAe={r:0,b:0,g:0},Iz=new FA,tbo=new Gi;function nbo(e,t,n,o,r,i,s){let a=new No(0),c=i===!0?0:1,l,h,d=null,u=0,_=null;function p(f){let y=f.isScene===!0?f.background:null;if(y&&y.isTexture)y=(f.backgroundBlurriness>0?n:t).get(y);return y}function m(f){let y=!1,x=p(f);if(x===null)g(a,c);else if(x&&x.isColor)g(x,1),y=!0;let C=e.xr.getEnvironmentBlendMode();if(C==="additive")o.buffers.color.setClear(0,0,0,1,s);else if(C==="alpha-blend")o.buffers.color.setClear(0,0,0,0,s);if(e.autoClear||y)o.buffers.depth.setTest(!0),o.buffers.depth.setMask(!0),o.buffers.color.setMask(!0),e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil)}function A(f,y){let x=p(y);if(x&&(x.isCubeTexture||x.mapping===306)){if(h===void 0)h=new Mo(new S_(1,1,1),new l3({name:"BackgroundCubeMaterial",uniforms:qX(M9.backgroundCube.uniforms),vertexShader:M9.backgroundCube.vertexShader,fragmentShader:M9.backgroundCube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(C,b,I){this.matrixWorld.copyPosition(I.matrixWorld)},Object.defineProperty(h.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(h);if(Iz.copy(y.backgroundRotation),Iz.x*=-1,Iz.y*=-1,Iz.z*=-1,x.isCubeTexture&&x.isRenderTargetTexture===!1)Iz.y*=-1,Iz.z*=-1;if(h.material.uniforms.envMap.value=x,h.material.uniforms.flipEnvMap.value=x.isCubeTexture&&x.isRenderTargetTexture===!1?-1:1,h.material.uniforms.backgroundBlurriness.value=y.backgroundBlurriness,h.material.uniforms.backgroundIntensity.value=y.backgroundIntensity,h.material.uniforms.backgroundRotation.value.setFromMatrix4(tbo.makeRotationFromEuler(Iz)),h.material.toneMapped=Zh.getTransfer(x.colorSpace)!=="srgb",d!==x||u!==x.version||_!==e.toneMapping)h.material.needsUpdate=!0,d=x,u=x.version,_=e.toneMapping;h.layers.enableAll(),f.unshift(h,h.geometry,h.material,0,0,null)}else if(x&&x.isTexture){if(l===void 0)l=new Mo(new i1(2,2),new l3({name:"BackgroundMaterial",uniforms:qX(M9.background.uniforms),vertexShader:M9.background.vertexShader,fragmentShader:M9.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(l);if(l.material.uniforms.t2D.value=x,l.material.uniforms.backgroundIntensity.value=y.backgroundIntensity,l.material.toneMapped=Zh.getTransfer(x.colorSpace)!=="srgb",x.matrixAutoUpdate===!0)x.updateMatrix();if(l.material.uniforms.uvTransform.value.copy(x.matrix),d!==x||u!==x.version||_!==e.toneMapping)l.material.needsUpdate=!0,d=x,u=x.version,_=e.toneMapping;l.layers.enableAll(),f.unshift(l,l.geometry,l.material,0,0,null)}}function g(f,y){f.getRGB(mAe,c5t(e)),o.buffers.color.setClear(mAe.r,mAe.g,mAe.b,y,s)}return{getClearColor:function(){return a},setClearColor:function(f,y=1){a.set(f),c=y,g(a,c)},getClearAlpha:function(){return c},setClearAlpha:function(f){c=f,g(a,c)},render:m,addToRenderList:A}}function obo(e,t){let n=e.getParameter(e.MAX_VERTEX_ATTRIBS),o={},r=u(null),i=r,s=!1;function a(M,B,T,N,D){let L=!1,H=d(N,T,B);if(i!==H)i=H,l(i.object);if(L=_(M,N,T,D),L)p(M,N,T,D);if(D!==null)t.update(D,e.ELEMENT_ARRAY_BUFFER);if(L||s){if(s=!1,x(M,B,T,N),D!==null)e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t.get(D).buffer)}}function c(){return e.createVertexArray()}function l(M){return e.bindVertexArray(M)}function h(M){return e.deleteVertexArray(M)}function d(M,B,T){let N=T.wireframe===!0,D=o[M.id];if(D===void 0)D={},o[M.id]=D;let L=D[B.id];if(L===void 0)L={},D[B.id]=L;let H=L[N];if(H===void 0)H=u(c()),L[N]=H;return H}function u(M){let B=[],T=[],N=[];for(let D=0;D<n;D++)B[D]=0,T[D]=0,N[D]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:B,enabledAttributes:T,attributeDivisors:N,object:M,attributes:{},index:null}}function _(M,B,T,N){let D=i.attributes,L=B.attributes,H=0,V=T.getAttributes();for(let O in V)if(V[O].location>=0){let j=D[O],Y=L[O];if(Y===void 0){if(O==="instanceMatrix"&&M.instanceMatrix)Y=M.instanceMatrix;if(O==="instanceColor"&&M.instanceColor)Y=M.instanceColor}if(j===void 0)return!0;if(j.attribute!==Y)return!0;if(Y&&j.data!==Y.data)return!0;H++}if(i.attributesNum!==H)return!0;if(i.index!==N)return!0;return!1}function p(M,B,T,N){let D={},L=B.attributes,H=0,V=T.getAttributes();for(let O in V)if(V[O].location>=0){let j=L[O];if(j===void 0){if(O==="instanceMatrix"&&M.instanceMatrix)j=M.instanceMatrix;if(O==="instanceColor"&&M.instanceColor)j=M.instanceColor}let Y={};if(Y.attribute=j,j&&j.data)Y.data=j.data;D[O]=Y,H++}i.attributes=D,i.attributesNum=H,i.index=N}function m(){let M=i.newAttributes;for(let B=0,T=M.length;B<T;B++)M[B]=0}function A(M){g(M,0)}function g(M,B){let T=i.newAttributes,N=i.enabledAttributes,D=i.attributeDivisors;if(T[M]=1,N[M]===0)e.enableVertexAttribArray(M),N[M]=1;if(D[M]!==B)e.vertexAttribDivisor(M,B),D[M]=B}function f(){let M=i.newAttributes,B=i.enabledAttributes;for(let T=0,N=B.length;T<N;T++)if(B[T]!==M[T])e.disableVertexAttribArray(T),B[T]=0}function y(M,B,T,N,D,L,H){if(H===!0)e.vertexAttribIPointer(M,B,T,D,L);else e.vertexAttribPointer(M,B,T,N,D,L)}function x(M,B,T,N){m();let D=N.attributes,L=T.getAttributes(),H=B.defaultAttributeValues;for(let V in L){let O=L[V];if(O.location>=0){let U=D[V];if(U===void 0){if(V==="instanceMatrix"&&M.instanceMatrix)U=M.instanceMatrix;if(V==="instanceColor"&&M.instanceColor)U=M.instanceColor}if(U!==void 0){let j=U.normalized,Y=U.itemSize,X=t.get(U);if(X===void 0)continue;let{buffer:K,type:J,bytesPerElement:ee}=X,se=J===e.INT||J===e.UNSIGNED_INT||U.gpuType===1013;if(U.isInterleavedBufferAttribute){let ne=U.data,re=ne.stride,Z=U.offset;if(ne.isInstancedInterleavedBuffer){for(let te=0;te<O.locationSize;te++)g(O.location+te,ne.meshPerAttribute);if(M.isInstancedMesh!==!0&&N._maxInstanceCount===void 0)N._maxInstanceCount=ne.meshPerAttribute*ne.count}else for(let te=0;te<O.locationSize;te++)A(O.location+te);e.bindBuffer(e.ARRAY_BUFFER,K);for(let te=0;te<O.locationSize;te++)y(O.location+te,Y/O.locationSize,J,j,re*ee,(Z+Y/O.locationSize*te)*ee,se)}else{if(U.isInstancedBufferAttribute){for(let ne=0;ne<O.locationSize;ne++)g(O.location+ne,U.meshPerAttribute);if(M.isInstancedMesh!==!0&&N._maxInstanceCount===void 0)N._maxInstanceCount=U.meshPerAttribute*U.count}else for(let ne=0;ne<O.locationSize;ne++)A(O.location+ne);e.bindBuffer(e.ARRAY_BUFFER,K);for(let ne=0;ne<O.locationSize;ne++)y(O.location+ne,Y/O.locationSize,J,j,Y*ee,Y/O.locationSize*ne*ee,se)}}else if(H!==void 0){let j=H[V];if(j!==void 0)switch(j.length){case 2:e.vertexAttrib2fv(O.location,j);break;case 3:e.vertexAttrib3fv(O.location,j);break;case 4:e.vertexAttrib4fv(O.location,j);break;default:e.vertexAttrib1fv(O.location,j)}}}}f()}function C(){v();for(let M in o){let B=o[M];for(let T in B){let N=B[T];for(let D in N)h(N[D].object),delete N[D];delete B[T]}delete o[M]}}function b(M){if(o[M.id]===void 0)return;let B=o[M.id];for(let T in B){let N=B[T];for(let D in N)h(N[D].object),delete N[D];delete B[T]}delete o[M.id]}function I(M){for(let B in o){let T=o[B];if(T[M.id]===void 0)continue;let N=T[M.id];for(let D in N)h(N[D].object),delete N[D];delete T[M.id]}}function v(){if(P(),s=!0,i===r)return;i=r,l(i.object)}function P(){r.geometry=null,r.program=null,r.wireframe=!1}return{setup:a,reset:v,resetDefaultState:P,dispose:C,releaseStatesOfGeometry:b,releaseStatesOfProgram:I,initAttributes:m,enableAttribute:A,disableUnusedAttributes:f}}function rbo(e,t,n){let o;function r(l){o=l}function i(l,h){e.drawArrays(o,l,h),n.update(h,o,1)}function s(l,h,d){if(d===0)return;e.drawArraysInstanced(o,l,h,d),n.update(h,o,d)}function a(l,h,d){if(d===0)return;let u=t.get("WEBGL_multi_draw");if(u===null)for(let _=0;_<d;_++)this.render(l[_],h[_]);else{u.multiDrawArraysWEBGL(o,l,0,h,0,d);let _=0;for(let p=0;p<d;p++)_+=h[p];n.update(_,o,1)}}function c(l,h,d,u){if(d===0)return;let _=t.get("WEBGL_multi_draw");if(_===null)for(let p=0;p<l.length;p++)s(l[p],h[p],u[p]);else{_.multiDrawArraysInstancedWEBGL(o,l,0,h,0,u,0,d);let p=0;for(let m=0;m<d;m++)p+=h[m];for(let m=0;m<u.length;m++)n.update(p,o,u[m])}}this.setMode=r,this.render=i,this.renderInstances=s,this.renderMultiDraw=a,this.renderMultiDrawInstances=c}function ibo(e,t,n,o){let r;function i(){if(r!==void 0)return r;if(t.has("EXT_texture_filter_anisotropic")===!0){let b=t.get("EXT_texture_filter_anisotropic");r=e.getParameter(b.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else r=0;return r}function s(b){if(b!==1023&&o.convert(b)!==e.getParameter(e.IMPLEMENTATION_COLOR_READ_FORMAT))return!1;return!0}function a(b){let I=b===1016&&(t.has("EXT_color_buffer_half_float")||t.has("EXT_color_buffer_float"));if(b!==1009&&o.convert(b)!==e.getParameter(e.IMPLEMENTATION_COLOR_READ_TYPE)&&b!==1015&&!I)return!1;return!0}function c(b){if(b==="highp"){if(e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0)return"highp";b="mediump"}if(b==="mediump"){if(e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0)return"mediump"}return"lowp"}let l=n.precision!==void 0?n.precision:"highp",h=c(l);if(h!==l)console.warn("THREE.WebGLRenderer:",l,"not supported, using",h,"instead."),l=h;let d=n.logarithmicDepthBuffer===!0,u=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),_=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),p=e.getParameter(e.MAX_TEXTURE_SIZE),m=e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),A=e.getParameter(e.MAX_VERTEX_ATTRIBS),g=e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),f=e.getParameter(e.MAX_VARYING_VECTORS),y=e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),x=_>0,C=e.getParameter(e.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:i,getMaxPrecision:c,textureFormatReadable:s,textureTypeReadable:a,precision:l,logarithmicDepthBuffer:d,maxTextures:u,maxVertexTextures:_,maxTextureSize:p,maxCubemapSize:m,maxAttributes:A,maxVertexUniforms:g,maxVaryings:f,maxFragmentUniforms:y,vertexTextures:x,maxSamples:C}}function sbo(e){let t=this,n=null,o=0,r=!1,i=!1,s=new Mb,a=new Ya,c={value:null,needsUpdate:!1};this.uniform=c,this.numPlanes=0,this.numIntersection=0,this.init=function(d,u){let _=d.length!==0||u||o!==0||r;return r=u,o=d.length,_},this.beginShadows=function(){i=!0,h(null)},this.endShadows=function(){i=!1},this.setGlobalState=function(d,u){n=h(d,u,0)},this.setState=function(d,u,_){let{clippingPlanes:p,clipIntersection:m,clipShadows:A}=d,g=e.get(d);if(!r||p===null||p.length===0||i&&!A)if(i)h(null);else l();else{let f=i?0:o,y=f*4,x=g.clippingState||null;c.value=x,x=h(p,u,y,_);for(let C=0;C!==y;++C)x[C]=n[C];g.clippingState=x,this.numIntersection=m?this.numPlanes:0,this.numPlanes+=f}};function l(){if(c.value!==n)c.value=n,c.needsUpdate=o>0;t.numPlanes=o,t.numIntersection=0}function h(d,u,_,p){let m=d!==null?d.length:0,A=null;if(m!==0){if(A=c.value,p!==!0||A===null){let g=_+m*4,f=u.matrixWorldInverse;if(a.getNormalMatrix(f),A===null||A.length<g)A=new Float32Array(g);for(let y=0,x=_;y!==m;++y,x+=4)s.copy(d[y]).applyMatrix4(f,a),s.normal.toArray(A,x),A[x+3]=s.constant}c.value=A,c.needsUpdate=!0}return t.numPlanes=m,t.numIntersection=0,A}}function abo(e){let t=new WeakMap;function n(s,a){if(a===303)s.mapping=301;else if(a===304)s.mapping=302;return s}function o(s){if(s&&s.isTexture){let a=s.mapping;if(a===303||a===304)if(t.has(s)){let c=t.get(s).texture;return n(c,s.mapping)}else{let c=s.image;if(c&&c.height>0){let l=new h5t(c.height);return l.fromEquirectangularTexture(e,s),t.set(s,l),s.addEventListener("dispose",r),n(l.texture,s.mapping)}else return null}}return s}function r(s){let a=s.target;a.removeEventListener("dispose",r);let c=t.get(a);if(c!==void 0)t.delete(a),c.dispose()}function i(){t=new WeakMap}return{get:o,dispose:i}}class r5 extends xQe{constructor(e=-1,t=1,n=1,o=-1,r=0.1,i=2000){super();this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=o,this.near=r,this.far=i,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,n,o,r,i){if(this.view===null)this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1};this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=o,this.view.width=r,this.view.height=i,this.updateProjectionMatrix()}clearViewOffset(){if(this.view!==null)this.view.enabled=!1;this.updateProjectionMatrix()}updateProjectionMatrix(){let e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,o=(this.top+this.bottom)/2,r=n-e,i=n+e,s=o+t,a=o-t;if(this.view!==null&&this.view.enabled){let c=(this.right-this.left)/this.view.fullWidth/this.zoom,l=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=c*this.view.offsetX,i=r+c*this.view.width,s-=l*this.view.offsetY,a=s-l*this.view.height}this.projectionMatrix.makeOrthographic(r,i,s,a,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);if(t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null)t.object.view=Object.assign({},this.view);return t}}var WX=4,sxt=[0.125,0.215,0.35,0.446,0.526,0.582],Pz=20,WRe=new r5,axt=new No,XRe=null,jRe=0,KRe=0,$Re=!1,Sz=(1+Math.sqrt(5))/2,GX=1/Sz,cxt=[new Et(-Sz,GX,0),new Et(Sz,GX,0),new Et(-GX,0,Sz),new Et(GX,0,Sz),new Et(0,Sz,-GX),new Et(0,Sz,GX),new Et(-1,1,-1),new Et(1,1,-1),new Et(-1,1,1),new Et(1,1,1)];class zre{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=0.1,o=100){XRe=this._renderer.getRenderTarget(),jRe=this._renderer.getActiveCubeFace(),KRe=this._renderer.getActiveMipmapLevel(),$Re=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);let r=this._allocateTargets();if(r.depthBuffer=!0,this._sceneToCubeUV(e,n,o,r),t>0)this._blur(r,0,0,t);return this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){if(this._cubemapMaterial===null)this._cubemapMaterial=dxt(),this._compileMaterial(this._cubemapMaterial)}compileEquirectangularShader(){if(this._equirectMaterial===null)this._equirectMaterial=hxt(),this._compileMaterial(this._equirectMaterial)}dispose(){if(this._dispose(),this._cubemapMaterial!==null)this._cubemapMaterial.dispose();if(this._equirectMaterial!==null)this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){if(this._blurMaterial!==null)this._blurMaterial.dispose();if(this._pingPongRenderTarget!==null)this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(XRe,jRe,KRe),this._renderer.xr.enabled=$Re,e.scissorTest=!1,_Ae(e,0,0,e.width,e.height)}_fromTexture(e,t){if(e.mapping===301||e.mapping===302)this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width);else this._setSize(e.image.width/4);XRe=this._renderer.getRenderTarget(),jRe=this._renderer.getActiveCubeFace(),KRe=this._renderer.getActiveMipmapLevel(),$Re=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;let n=t||this._allocateTargets();return this._textureToCubeUV(e,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){let e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,n={magFilter:1006,minFilter:1006,generateMipmaps:!1,type:1016,format:1023,colorSpace:"srgb-linear",depthBuffer:!1},o=lxt(e,t,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){if(this._pingPongRenderTarget!==null)this._dispose();this._pingPongRenderTarget=lxt(e,t,n);let{_lodMax:r}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=cbo(r)),this._blurMaterial=lbo(r,e,t)}return o}_compileMaterial(e){let t=new Mo(this._lodPlanes[0],e);this._renderer.compile(t,WRe)}_sceneToCubeUV(e,t,n,o){let s=new Pc(90,1,t,n),a=[1,-1,1,1,1,1],c=[1,1,1,-1,-1,-1],l=this._renderer,{autoClear:h,toneMapping:d}=l;l.getClearColor(axt),l.toneMapping=0,l.autoClear=!1;let u=new Up({name:"PMREM.Background",side:1,depthWrite:!1,depthTest:!1}),_=new Mo(new S_,u),p=!1,m=e.background;if(m){if(m.isColor)u.color.copy(m),e.background=null,p=!0}else u.color.copy(axt),p=!0;for(let A=0;A<6;A++){let g=A%3;if(g===0)s.up.set(0,a[A],0),s.lookAt(c[A],0,0);else if(g===1)s.up.set(0,0,a[A]),s.lookAt(0,c[A],0);else s.up.set(0,a[A],0),s.lookAt(0,0,c[A]);let f=this._cubeSize;if(_Ae(o,g*f,A>2?f:0,f,f),l.setRenderTarget(o),p)l.render(_,s);l.render(e,s)}_.geometry.dispose(),_.material.dispose(),l.toneMapping=d,l.autoClear=h,e.background=m}_textureToCubeUV(e,t){let n=this._renderer,o=e.mapping===301||e.mapping===302;if(o){if(this._cubemapMaterial===null)this._cubemapMaterial=dxt();this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1}else if(this._equirectMaterial===null)this._equirectMaterial=hxt();let r=o?this._cubemapMaterial:this._equirectMaterial,i=new Mo(this._lodPlanes[0],r),s=r.uniforms;s.envMap.value=e;let a=this._cubeSize;_Ae(t,0,0,3*a,2*a),n.setRenderTarget(t),n.render(i,WRe)}_applyPMREM(e){let t=this._renderer,n=t.autoClear;t.autoClear=!1;let o=this._lodPlanes.length;for(let r=1;r<o;r++){let i=Math.sqrt(this._sigmas[r]*this._sigmas[r]-this._sigmas[r-1]*this._sigmas[r-1]),s=cxt[(o-r-1)%cxt.length];this._blur(e,r-1,r,i,s)}t.autoClear=n}_blur(e,t,n,o,r){let i=this._pingPongRenderTarget;this._halfBlur(e,i,t,n,o,"latitudinal",r),this._halfBlur(i,e,n,n,o,"longitudinal",r)}_halfBlur(e,t,n,o,r,i,s){let a=this._renderer,c=this._blurMaterial;if(i!=="latitudinal"&&i!=="longitudinal")console.error("blur direction must be either latitudinal or longitudinal!");let l=3,h=new Mo(this._lodPlanes[o],c),d=c.uniforms,u=this._sizeLods[n]-1,_=isFinite(r)?Math.PI/(2*u):2*Math.PI/(2*Pz-1),p=r/_,m=isFinite(r)?1+Math.floor(l*p):Pz;if(m>Pz)console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${Pz}`);let A=[],g=0;for(let b=0;b<Pz;++b){let I=b/p,v=Math.exp(-I*I/2);if(A.push(v),b===0)g+=v;else if(b<m)g+=2*v}for(let b=0;b<A.length;b++)A[b]=A[b]/g;if(d.envMap.value=e.texture,d.samples.value=m,d.weights.value=A,d.latitudinal.value=i==="latitudinal",s)d.poleAxis.value=s;let{_lodMax:f}=this;d.dTheta.value=_,d.mipInt.value=f-n;let y=this._sizeLods[o],x=3*y*(o>f-WX?o-f+WX:0),C=4*(this._cubeSize-y);_Ae(t,x,C,3*y,2*y),a.setRenderTarget(t),a.render(h,WRe)}}function cbo(e){let t=[],n=[],o=[],r=e,i=e-WX+1+sxt.length;for(let s=0;s<i;s++){let a=Math.pow(2,r);n.push(a);let c=1/a;if(s>e-WX)c=sxt[s-e+WX-1];else if(s===0)c=0;o.push(c);let l=1/(a-2),h=-l,d=1+l,u=[h,h,d,h,d,d,h,h,d,d,h,d],_=6,p=6,m=3,A=2,g=1,f=new Float32Array(m*p*_),y=new Float32Array(A*p*_),x=new Float32Array(g*p*_);for(let b=0;b<_;b++){let I=b%3*2/3-1,v=b>2?0:-1,P=[I,v,0,I+0.6666666666666666,v,0,I+0.6666666666666666,v+1,0,I,v,0,I+0.6666666666666666,v+1,0,I,v+1,0];f.set(P,m*p*b),y.set(u,A*p*b);let M=[b,b,b,b,b,b];x.set(M,g*p*b)}let C=new js;if(C.setAttribute("position",new Pl(f,m)),C.setAttribute("uv",new Pl(y,A)),C.setAttribute("faceIndex",new Pl(x,g)),t.push(C),r>WX)r--}return{lodPlanes:t,sizeLods:n,sigmas:o}}function lxt(e,t,n){let o=new uR(e,t,n);return o.texture.mapping=306,o.texture.name="PMREM.cubeUv",o.scissorTest=!0,o}function _Ae(e,t,n,o,r){e.viewport.set(t,n,o,r),e.scissor.set(t,n,o,r)}function lbo(e,t,n){let o=new Float32Array(Pz),r=new Et(0,1,0);return new l3({name:"SphericalGaussianBlur",defines:{n:Pz,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${e}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:o},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:bQe(),fragmentShader:`

			precision mediump float;
			precision mediump int;

			varying vec3 vOutputDirection;

			uniform sampler2D envMap;
			uniform int samples;
			uniform float weights[ n ];
			uniform bool latitudinal;
			uniform float dTheta;
			uniform float mipInt;
			uniform vec3 poleAxis;

			#define ENVMAP_TYPE_CUBE_UV
			#include <cube_uv_reflection_fragment>

			vec3 getSample( float theta, vec3 axis ) {

				float cosTheta = cos( theta );
				// Rodrigues' axis-angle rotation
				vec3 sampleDirection = vOutputDirection * cosTheta
					+ cross( axis, vOutputDirection ) * sin( theta )
					+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );

				return bilinearCubeUV( envMap, sampleDirection, mipInt );

			}

			void main() {

				vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );

				if ( all( equal( axis, vec3( 0.0 ) ) ) ) {

					axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );

				}

				axis = normalize( axis );

				gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );
				gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );

				for ( int i = 1; i < n; i++ ) {

					if ( i >= samples ) {

						break;

					}

					float theta = dTheta * float( i );
					gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );
					gl_FragColor.rgb += weights[ i ] * getSample( theta, axis );

				}

			}
		`,blending:0,depthTest:!1,depthWrite:!1})}function hxt(){return new l3({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:bQe(),fragmentShader:`

			precision mediump float;
			precision mediump int;

			varying vec3 vOutputDirection;

			uniform sampler2D envMap;

			#include <common>

			void main() {

				vec3 outputDirection = normalize( vOutputDirection );
				vec2 uv = equirectUv( outputDirection );

				gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );

			}
		`,blending:0,depthTest:!1,depthWrite:!1})}function dxt(){return new l3({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:bQe(),fragmentShader:`

			precision mediump float;
			precision mediump int;

			uniform float flipEnvMap;

			varying vec3 vOutputDirection;

			uniform samplerCube envMap;

			void main() {

				gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );

			}
		`,blending:0,depthTest:!1,depthWrite:!1})}function bQe(){return`

		precision mediump float;
		precision mediump int;

		attribute float faceIndex;

		varying vec3 vOutputDirection;

		// RH coordinate system; PMREM face-indexing convention
		vec3 getDirection( vec2 uv, float face ) {

			uv = 2.0 * uv - 1.0;

			vec3 direction = vec3( uv, 1.0 );

			if ( face == 0.0 ) {

				direction = direction.zyx; // ( 1, v, u ) pos x

			} else if ( face == 1.0 ) {

				direction = direction.xzy;
				direction.xz *= -1.0; // ( -u, 1, -v ) pos y

			} else if ( face == 2.0 ) {

				direction.x *= -1.0; // ( -u, v, 1 ) pos z

			} else if ( face == 3.0 ) {

				direction = direction.zyx;
				direction.xz *= -1.0; // ( -1, v, -u ) neg x

			} else if ( face == 4.0 ) {

				direction = direction.xzy;
				direction.xy *= -1.0; // ( -u, -1, v ) neg y

			} else if ( face == 5.0 ) {

				direction.z *= -1.0; // ( u, v, -1 ) neg z

			}

			return direction;

		}

		void main() {

			vOutputDirection = getDirection( uv, faceIndex );
			gl_Position = vec4( position, 1.0 );

		}
	`}function hbo(e){let t=new WeakMap,n=null;function o(a){if(a&&a.isTexture){let c=a.mapping,l=c===303||c===304,h=c===301||c===302;if(l||h){let d=t.get(a),u=d!==void 0?d.texture.pmremVersion:0;if(a.isRenderTargetTexture&&a.pmremVersion!==u){if(n===null)n=new zre(e);return d=l?n.fromEquirectangular(a,d):n.fromCubemap(a,d),d.texture.pmremVersion=a.pmremVersion,t.set(a,d),d.texture}else if(d!==void 0)return d.texture;else{let _=a.image;if(l&&_&&_.height>0||h&&_&&r(_)){if(n===null)n=new zre(e);return d=l?n.fromEquirectangular(a):n.fromCubemap(a),d.texture.pmremVersion=a.pmremVersion,t.set(a,d),a.addEventListener("dispose",i),d.texture}else return null}}}return a}function r(a){let c=0,l=6;for(let h=0;h<l;h++)if(a[h]!==void 0)c++;return c===l}function i(a){let c=a.target;c.removeEventListener("dispose",i);let l=t.get(c);if(l!==void 0)t.delete(c),l.dispose()}function s(){if(t=new WeakMap,n!==null)n.dispose(),n=null}return{get:o,dispose:s}}function dbo(e){let t={};function n(o){if(t[o]!==void 0)return t[o];let r;switch(o){case"WEBGL_depth_texture":r=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=e.getExtension(o)}return t[o]=r,r}return{has:function(o){return n(o)!==null},init:function(){n("EXT_color_buffer_float"),n("WEBGL_clip_cull_distance"),n("OES_texture_float_linear"),n("EXT_color_buffer_half_float"),n("WEBGL_multisampled_render_to_texture"),n("WEBGL_render_shared_exponent")},get:function(o){let r=n(o);if(r===null)_Qe("THREE.WebGLRenderer: "+o+" extension not supported.");return r}}}function ubo(e,t,n,o){let r={},i=new WeakMap;function s(d){let u=d.target;if(u.index!==null)t.remove(u.index);for(let p in u.attributes)t.remove(u.attributes[p]);for(let p in u.morphAttributes){let m=u.morphAttributes[p];for(let A=0,g=m.length;A<g;A++)t.remove(m[A])}u.removeEventListener("dispose",s),delete r[u.id];let _=i.get(u);if(_)t.remove(_),i.delete(u);if(o.releaseStatesOfGeometry(u),u.isInstancedBufferGeometry===!0)delete u._maxInstanceCount;n.memory.geometries--}function a(d,u){if(r[u.id]===!0)return u;return u.addEventListener("dispose",s),r[u.id]=!0,n.memory.geometries++,u}function c(d){let u=d.attributes;for(let p in u)t.update(u[p],e.ARRAY_BUFFER);let _=d.morphAttributes;for(let p in _){let m=_[p];for(let A=0,g=m.length;A<g;A++)t.update(m[A],e.ARRAY_BUFFER)}}function l(d){let u=[],_=d.index,p=d.attributes.position,m=0;if(_!==null){let f=_.array;m=_.version;for(let y=0,x=f.length;y<x;y+=3){let C=f[y+0],b=f[y+1],I=f[y+2];u.push(C,b,b,I,I,C)}}else if(p!==void 0){let f=p.array;m=p.version;for(let y=0,x=f.length/3-1;y<x;y+=3){let C=y+0,b=y+1,I=y+2;u.push(C,b,b,I,I,C)}}else return;let A=new((o5t(u))?jre:fQe)(u,1);A.version=m;let g=i.get(d);if(g)t.remove(g);i.set(d,A)}function h(d){let u=i.get(d);if(u){let _=d.index;if(_!==null){if(u.version<_.version)l(d)}}else l(d);return i.get(d)}return{get:a,update:c,getWireframeAttribute:h}}function pbo(e,t,n){let o;function r(u){o=u}let i,s;function a(u){i=u.type,s=u.bytesPerElement}function c(u,_){e.drawElements(o,_,i,u*s),n.update(_,o,1)}function l(u,_,p){if(p===0)return;e.drawElementsInstanced(o,_,i,u*s,p),n.update(_,o,p)}function h(u,_,p){if(p===0)return;let m=t.get("WEBGL_multi_draw");if(m===null)for(let A=0;A<p;A++)this.render(u[A]/s,_[A]);else{m.multiDrawElementsWEBGL(o,_,0,i,u,0,p);let A=0;for(let g=0;g<p;g++)A+=_[g];n.update(A,o,1)}}function d(u,_,p,m){if(p===0)return;let A=t.get("WEBGL_multi_draw");if(A===null)for(let g=0;g<u.length;g++)l(u[g]/s,_[g],m[g]);else{A.multiDrawElementsInstancedWEBGL(o,_,0,i,u,0,m,0,p);let g=0;for(let f=0;f<p;f++)g+=_[f];for(let f=0;f<m.length;f++)n.update(g,o,m[f])}}this.setMode=r,this.setIndex=a,this.render=c,this.renderInstances=l,this.renderMultiDraw=h,this.renderMultiDrawInstances=d}function mbo(e){let t={geometries:0,textures:0},n={frame:0,calls:0,triangles:0,points:0,lines:0};function o(i,s,a){switch(n.calls++,s){case e.TRIANGLES:n.triangles+=a*(i/3);break;case e.LINES:n.lines+=a*(i/2);break;case e.LINE_STRIP:n.lines+=a*(i-1);break;case e.LINE_LOOP:n.lines+=a*i;break;case e.POINTS:n.points+=a*i;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",s);break}}function r(){n.calls=0,n.triangles=0,n.points=0,n.lines=0}return{memory:t,render:n,programs:null,autoReset:!0,reset:r,update:o}}function _bo(e,t,n){let o=new WeakMap,r=new zh;function i(s,a,c){let l=s.morphTargetInfluences,h=a.morphAttributes.position||a.morphAttributes.normal||a.morphAttributes.color,d=h!==void 0?h.length:0,u=o.get(a);if(u===void 0||u.count!==d){let P=function(){I.dispose(),o.delete(a),a.removeEventListener("dispose",P)};if(u!==void 0)u.texture.dispose();let _=a.morphAttributes.position!==void 0,p=a.morphAttributes.normal!==void 0,m=a.morphAttributes.color!==void 0,A=a.morphAttributes.position||[],g=a.morphAttributes.normal||[],f=a.morphAttributes.color||[],y=0;if(_===!0)y=1;if(p===!0)y=2;if(m===!0)y=3;let x=a.attributes.position.count*y,C=1;if(x>t.maxTextureSize)C=Math.ceil(x/t.maxTextureSize),x=t.maxTextureSize;let b=new Float32Array(x*C*4*d),I=new AQe(b,x,C,d);I.type=1015,I.needsUpdate=!0;let v=y*4;for(let M=0;M<d;M++){let B=A[M],T=g[M],N=f[M],D=x*C*4*M;for(let L=0;L<B.count;L++){let H=L*v;if(_===!0)r.fromBufferAttribute(B,L),b[D+H+0]=r.x,b[D+H+1]=r.y,b[D+H+2]=r.z,b[D+H+3]=0;if(p===!0)r.fromBufferAttribute(T,L),b[D+H+4]=r.x,b[D+H+5]=r.y,b[D+H+6]=r.z,b[D+H+7]=0;if(m===!0)r.fromBufferAttribute(N,L),b[D+H+8]=r.x,b[D+H+9]=r.y,b[D+H+10]=r.z,b[D+H+11]=N.itemSize===4?r.w:1}}u={count:d,texture:I,size:new ro(x,C)},o.set(a,u),a.addEventListener("dispose",P)}if(s.isInstancedMesh===!0&&s.morphTexture!==null)c.getUniforms().setValue(e,"morphTexture",s.morphTexture,n);else{let _=0;for(let m=0;m<l.length;m++)_+=l[m];let p=a.morphTargetsRelative?1:1-_;c.getUniforms().setValue(e,"morphTargetBaseInfluence",p),c.getUniforms().setValue(e,"morphTargetInfluences",l)}c.getUniforms().setValue(e,"morphTargetsTexture",u.texture,n),c.getUniforms().setValue(e,"morphTargetsTextureSize",u.size)}return{update:i}}function gbo(e,t,n,o){let r=new WeakMap;function i(c){let l=o.render.frame,h=c.geometry,d=t.get(c,h);if(r.get(d)!==l)t.update(d),r.set(d,l);if(c.isInstancedMesh){if(c.hasEventListener("dispose",a)===!1)c.addEventListener("dispose",a);if(r.get(c)!==l){if(n.update(c.instanceMatrix,e.ARRAY_BUFFER),c.instanceColor!==null)n.update(c.instanceColor,e.ARRAY_BUFFER);r.set(c,l)}}if(c.isSkinnedMesh){let u=c.skeleton;if(r.get(u)!==l)u.update(),r.set(u,l)}return d}function s(){r=new WeakMap}function a(c){let l=c.target;if(l.removeEventListener("dispose",a),n.remove(l.instanceMatrix),l.instanceColor!==null)n.remove(l.instanceColor)}return{update:i,dispose:s}}class IQe extends vl{constructor(e,t,n,o,r,i,s,a,c,l=1026){if(l!==1026&&l!==1027)throw Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");if(n===void 0&&l===1026)n=1014;if(n===void 0&&l===1027)n=1020;super(null,o,r,i,s,a,l,n,c);this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=s!==void 0?s:1003,this.minFilter=a!==void 0?a:1003,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.compareFunction=e.compareFunction,this}toJSON(e){let t=super.toJSON(e);if(this.compareFunction!==null)t.compareFunction=this.compareFunction;return t}}var u5t=new vl,p5t=new IQe(1,1);p5t.compareFunction=515;var m5t=new AQe,_5t=new s5t,g5t=new CQe,uxt=[],pxt=[],mxt=new Float32Array(16),_xt=new Float32Array(9),gxt=new Float32Array(4);function JX(e,t,n){let o=e[0];if(o<=0||o>0)return e;let r=t*n,i=uxt[r];if(i===void 0)i=new Float32Array(r),uxt[r]=i;if(t!==0){o.toArray(i,0);for(let s=1,a=0;s!==t;++s)a+=n,e[s].toArray(i,a)}return i}function kg(e,t){if(e.length!==t.length)return!1;for(let n=0,o=e.length;n<o;n++)if(e[n]!==t[n])return!1;return!0}function Lg(e,t){for(let n=0,o=t.length;n<o;n++)e[n]=t[n]}function YAe(e,t){let n=pxt[t];if(n===void 0)n=new Int32Array(t),pxt[t]=n;for(let o=0;o!==t;++o)n[o]=e.allocateTextureUnit();return n}function Abo(e,t){let n=this.cache;if(n[0]===t)return;e.uniform1f(this.addr,t),n[0]=t}function fbo(e,t){let n=this.cache;if(t.x!==void 0){if(n[0]!==t.x||n[1]!==t.y)e.uniform2f(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y}else{if(kg(n,t))return;e.uniform2fv(this.addr,t),Lg(n,t)}}function ybo(e,t){let n=this.cache;if(t.x!==void 0){if(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z)e.uniform3f(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z}else if(t.r!==void 0){if(n[0]!==t.r||n[1]!==t.g||n[2]!==t.b)e.uniform3f(this.addr,t.r,t.g,t.b),n[0]=t.r,n[1]=t.g,n[2]=t.b}else{if(kg(n,t))return;e.uniform3fv(this.addr,t),Lg(n,t)}}function xbo(e,t){let n=this.cache;if(t.x!==void 0){if(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z||n[3]!==t.w)e.uniform4f(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w}else{if(kg(n,t))return;e.uniform4fv(this.addr,t),Lg(n,t)}}function Cbo(e,t){let n=this.cache,o=t.elements;if(o===void 0){if(kg(n,t))return;e.uniformMatrix2fv(this.addr,!1,t),Lg(n,t)}else{if(kg(n,o))return;gxt.set(o),e.uniformMatrix2fv(this.addr,!1,gxt),Lg(n,o)}}function bbo(e,t){let n=this.cache,o=t.elements;if(o===void 0){if(kg(n,t))return;e.uniformMatrix3fv(this.addr,!1,t),Lg(n,t)}else{if(kg(n,o))return;_xt.set(o),e.uniformMatrix3fv(this.addr,!1,_xt),Lg(n,o)}}function Ibo(e,t){let n=this.cache,o=t.elements;if(o===void 0){if(kg(n,t))return;e.uniformMatrix4fv(this.addr,!1,t),Lg(n,t)}else{if(kg(n,o))return;mxt.set(o),e.uniformMatrix4fv(this.addr,!1,mxt),Lg(n,o)}}function vbo(e,t){let n=this.cache;if(n[0]===t)return;e.uniform1i(this.addr,t),n[0]=t}function Sbo(e,t){let n=this.cache;if(t.x!==void 0){if(n[0]!==t.x||n[1]!==t.y)e.uniform2i(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y}else{if(kg(n,t))return;e.uniform2iv(this.addr,t),Lg(n,t)}}function Pbo(e,t){let n=this.cache;if(t.x!==void 0){if(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z)e.uniform3i(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z}else{if(kg(n,t))return;e.uniform3iv(this.addr,t),Lg(n,t)}}function Ebo(e,t){let n=this.cache;if(t.x!==void 0){if(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z||n[3]!==t.w)e.uniform4i(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w}else{if(kg(n,t))return;e.uniform4iv(this.addr,t),Lg(n,t)}}function Mbo(e,t){let n=this.cache;if(n[0]===t)return;e.uniform1ui(this.addr,t),n[0]=t}function wbo(e,t){let n=this.cache;if(t.x!==void 0){if(n[0]!==t.x||n[1]!==t.y)e.uniform2ui(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y}else{if(kg(n,t))return;e.uniform2uiv(this.addr,t),Lg(n,t)}}function Bbo(e,t){let n=this.cache;if(t.x!==void 0){if(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z)e.uniform3ui(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z}else{if(kg(n,t))return;e.uniform3uiv(this.addr,t),Lg(n,t)}}function Tbo(e,t){let n=this.cache;if(t.x!==void 0){if(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z||n[3]!==t.w)e.uniform4ui(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w}else{if(kg(n,t))return;e.uniform4uiv(this.addr,t),Lg(n,t)}}function Dbo(e,t,n){let o=this.cache,r=n.allocateTextureUnit();if(o[0]!==r)e.uniform1i(this.addr,r),o[0]=r;let i=this.type===e.SAMPLER_2D_SHADOW?p5t:u5t;n.setTexture2D(t||i,r)}function Nbo(e,t,n){let o=this.cache,r=n.allocateTextureUnit();if(o[0]!==r)e.uniform1i(this.addr,r),o[0]=r;n.setTexture3D(t||_5t,r)}function Rbo(e,t,n){let o=this.cache,r=n.allocateTextureUnit();if(o[0]!==r)e.uniform1i(this.addr,r),o[0]=r;n.setTextureCube(t||g5t,r)}function Qbo(e,t,n){let o=this.cache,r=n.allocateTextureUnit();if(o[0]!==r)e.uniform1i(this.addr,r),o[0]=r;n.setTexture2DArray(t||m5t,r)}function kbo(e){switch(e){case 5126:return Abo;case 35664:return fbo;case 35665:return ybo;case 35666:return xbo;case 35674:return Cbo;case 35675:return bbo;case 35676:return Ibo;case 5124:case 35670:return vbo;case 35667:case 35671:return Sbo;case 35668:case 35672:return Pbo;case 35669:case 35673:return Ebo;case 5125:return Mbo;case 36294:return wbo;case 36295:return Bbo;case 36296:return Tbo;case 35678:case 36198:case 36298:case 36306:case 35682:return Dbo;case 35679:case 36299:case 36307:return Nbo;case 35680:case 36300:case 36308:case 36293:return Rbo;case 36289:case 36303:case 36311:case 36292:return Qbo}}function Lbo(e,t){e.uniform1fv(this.addr,t)}function Hbo(e,t){let n=JX(t,this.size,2);e.uniform2fv(this.addr,n)}function Fbo(e,t){let n=JX(t,this.size,3);e.uniform3fv(this.addr,n)}function zbo(e,t){let n=JX(t,this.size,4);e.uniform4fv(this.addr,n)}function Obo(e,t){let n=JX(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,n)}function Vbo(e,t){let n=JX(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,n)}function Ybo(e,t){let n=JX(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,n)}function Gbo(e,t){e.uniform1iv(this.addr,t)}function Ubo(e,t){e.uniform2iv(this.addr,t)}function Wbo(e,t){e.uniform3iv(this.addr,t)}function Xbo(e,t){e.uniform4iv(this.addr,t)}function jbo(e,t){e.uniform1uiv(this.addr,t)}function Kbo(e,t){e.uniform2uiv(this.addr,t)}function $bo(e,t){e.uniform3uiv(this.addr,t)}function qbo(e,t){e.uniform4uiv(this.addr,t)}function Jbo(e,t,n){let o=this.cache,r=t.length,i=YAe(n,r);if(!kg(o,i))e.uniform1iv(this.addr,i),Lg(o,i);for(let s=0;s!==r;++s)n.setTexture2D(t[s]||u5t,i[s])}function Zbo(e,t,n){let o=this.cache,r=t.length,i=YAe(n,r);if(!kg(o,i))e.uniform1iv(this.addr,i),Lg(o,i);for(let s=0;s!==r;++s)n.setTexture3D(t[s]||_5t,i[s])}function e6o(e,t,n){let o=this.cache,r=t.length,i=YAe(n,r);if(!kg(o,i))e.uniform1iv(this.addr,i),Lg(o,i);for(let s=0;s!==r;++s)n.setTextureCube(t[s]||g5t,i[s])}function t6o(e,t,n){let o=this.cache,r=t.length,i=YAe(n,r);if(!kg(o,i))e.uniform1iv(this.addr,i),Lg(o,i);for(let s=0;s!==r;++s)n.setTexture2DArray(t[s]||m5t,i[s])}function n6o(e){switch(e){case 5126:return Lbo;case 35664:return Hbo;case 35665:return Fbo;case 35666:return zbo;case 35674:return Obo;case 35675:return Vbo;case 35676:return Ybo;case 5124:case 35670:return Gbo;case 35667:case 35671:return Ubo;case 35668:case 35672:return Wbo;case 35669:case 35673:return Xbo;case 5125:return jbo;case 36294:return Kbo;case 36295:return $bo;case 36296:return qbo;case 35678:case 36198:case 36298:case 36306:case 35682:return Jbo;case 35679:case 36299:case 36307:return Zbo;case 35680:case 36300:case 36308:case 36293:return e6o;case 36289:case 36303:case 36311:case 36292:return t6o}}class A5t{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.setValue=kbo(t.type)}}class f5t{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=n6o(t.type)}}class y5t{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,n){let o=this.seq;for(let r=0,i=o.length;r!==i;++r){let s=o[r];s.setValue(e,t[s.id],n)}}}var qRe=/(\w+)(\])?(\[|\.)?/g;function Axt(e,t){e.seq.push(t),e.map[t.id]=t}function o6o(e,t,n){let o=e.name,r=o.length;qRe.lastIndex=0;while(!0){let i=qRe.exec(o),s=qRe.lastIndex,a=i[1],c=i[2]==="]",l=i[3];if(c)a=a|0;if(l===void 0||l==="["&&s+2===r){Axt(n,l===void 0?new A5t(a,e,t):new f5t(a,e,t));break}else{let d=n.map[a];if(d===void 0)d=new y5t(a),Axt(n,d);n=d}}}class kre{constructor(e,t){this.seq=[],this.map={};let n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let o=0;o<n;++o){let r=e.getActiveUniform(t,o),i=e.getUniformLocation(t,r.name);o6o(r,i,this)}}setValue(e,t,n,o){let r=this.map[t];if(r!==void 0)r.setValue(e,n,o)}setOptional(e,t,n){let o=t[n];if(o!==void 0)this.setValue(e,n,o)}static upload(e,t,n,o){for(let r=0,i=t.length;r!==i;++r){let s=t[r],a=n[s.id];if(a.needsUpdate!==!1)s.setValue(e,a.value,o)}}static seqWithValue(e,t){let n=[];for(let o=0,r=e.length;o!==r;++o){let i=e[o];if(i.id in t)n.push(i)}return n}}function fxt(e,t,n){let o=e.createShader(t);return e.shaderSource(o,n),e.compileShader(o),o}var r6o=37297,i6o=0;function s6o(e,t){let n=e.split(`
`),o=[],r=Math.max(t-6,0),i=Math.min(t+6,n.length);for(let s=r;s<i;s++){let a=s+1;o.push(`${a===t?">":" "} ${a}: ${n[s]}`)}return o.join(`
`)}function a6o(e){let t=Zh.getPrimaries(Zh.workingColorSpace),n=Zh.getPrimaries(e),o;if(t===n)o="";else if(t==="p3"&&n==="rec709")o="LinearDisplayP3ToLinearSRGB";else if(t==="rec709"&&n==="p3")o="LinearSRGBToLinearDisplayP3";switch(e){case"srgb-linear":case"display-p3-linear":return[o,"LinearTransferOETF"];case"srgb":case"display-p3":return[o,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",e),[o,"LinearTransferOETF"]}}function yxt(e,t,n){let o=e.getShaderParameter(t,e.COMPILE_STATUS),r=e.getShaderInfoLog(t).trim();if(o&&r==="")return"";let i=/ERROR: 0:(\d+)/.exec(r);if(i){let s=parseInt(i[1]);return n.toUpperCase()+`

`+r+`

`+s6o(e.getShaderSource(t),s)}else return r}function c6o(e,t){let n=a6o(t);return`vec4 ${e}( vec4 value ) { return ${n[0]}( ${n[1]}( value ) ); }`}function l6o(e,t){let n;switch(t){case 1:n="Linear";break;case 2:n="Reinhard";break;case 3:n="OptimizedCineon";break;case 4:n="ACESFilmic";break;case 6:n="AgX";break;case 7:n="Neutral";break;case 5:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),n="Linear"}return"vec3 "+e+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function h6o(e){return[e.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",e.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Rre).join(`
`)}function d6o(e){let t=[];for(let n in e){let o=e[n];if(o===!1)continue;t.push("#define "+n+" "+o)}return t.join(`
`)}function u6o(e,t){let n={},o=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let r=0;r<o;r++){let i=e.getActiveAttrib(t,r),s=i.name,a=1;if(i.type===e.FLOAT_MAT2)a=2;if(i.type===e.FLOAT_MAT3)a=3;if(i.type===e.FLOAT_MAT4)a=4;n[s]={type:i.type,location:e.getAttribLocation(t,s),locationSize:a}}return n}function Rre(e){return e!==""}function xxt(e,t){let n=t.numSpotLightShadows+t.numSpotLightMaps-t.numSpotLightShadowsWithMaps;return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,t.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,n).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,t.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function Cxt(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}var p6o=/^[ \t]*#include +<([\w\d./]+)>/gm;function aQe(e){return e.replace(p6o,_6o)}var m6o=new Map;function _6o(e,t){let n=Va[t];if(n===void 0){let o=m6o.get(t);if(o!==void 0)n=Va[o],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',t,o);else throw Error("Can not resolve #include <"+t+">")}return aQe(n)}var g6o=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function bxt(e){return e.replace(g6o,A6o)}function A6o(e,t,n,o){let r="";for(let i=parseInt(t);i<parseInt(n);i++)r+=o.replace(/\[\s*i\s*\]/g,"[ "+i+" ]").replace(/UNROLLED_LOOP_INDEX/g,i);return r}function Ixt(e){let t=`precision ${e.precision} float;
	precision ${e.precision} int;
	precision ${e.precision} sampler2D;
	precision ${e.precision} samplerCube;
	precision ${e.precision} sampler3D;
	precision ${e.precision} sampler2DArray;
	precision ${e.precision} sampler2DShadow;
	precision ${e.precision} samplerCubeShadow;
	precision ${e.precision} sampler2DArrayShadow;
	precision ${e.precision} isampler2D;
	precision ${e.precision} isampler3D;
	precision ${e.precision} isamplerCube;
	precision ${e.precision} isampler2DArray;
	precision ${e.precision} usampler2D;
	precision ${e.precision} usampler3D;
	precision ${e.precision} usamplerCube;
	precision ${e.precision} usampler2DArray;
	`;if(e.precision==="highp")t+=`
#define HIGH_PRECISION`;else if(e.precision==="mediump")t+=`
#define MEDIUM_PRECISION`;else if(e.precision==="lowp")t+=`
#define LOW_PRECISION`;return t}function f6o(e){let t="SHADOWMAP_TYPE_BASIC";if(e.shadowMapType===1)t="SHADOWMAP_TYPE_PCF";else if(e.shadowMapType===2)t="SHADOWMAP_TYPE_PCF_SOFT";else if(e.shadowMapType===3)t="SHADOWMAP_TYPE_VSM";return t}function y6o(e){let t="ENVMAP_TYPE_CUBE";if(e.envMap)switch(e.envMapMode){case 301:case 302:t="ENVMAP_TYPE_CUBE";break;case 306:t="ENVMAP_TYPE_CUBE_UV";break}return t}function x6o(e){let t="ENVMAP_MODE_REFLECTION";if(e.envMap)switch(e.envMapMode){case 302:t="ENVMAP_MODE_REFRACTION";break}return t}function C6o(e){let t="ENVMAP_BLENDING_NONE";if(e.envMap)switch(e.combine){case 0:t="ENVMAP_BLENDING_MULTIPLY";break;case 1:t="ENVMAP_BLENDING_MIX";break;case 2:t="ENVMAP_BLENDING_ADD";break}return t}function b6o(e){let t=e.envMapCubeUVHeight;if(t===null)return null;let n=Math.log2(t)-2,o=1/t;return{texelWidth:1/(3*Math.max(Math.pow(2,n),112)),texelHeight:o,maxMip:n}}function I6o(e,t,n,o){let r=e.getContext(),{defines:i,vertexShader:s,fragmentShader:a}=n,c=f6o(n),l=y6o(n),h=x6o(n),d=C6o(n),u=b6o(n),_=h6o(n),p=d6o(i),m=r.createProgram(),A,g,f=n.glslVersion?"#version "+n.glslVersion+`
`:"";if(n.isRawShaderMaterial){if(A=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,p].filter(Rre).join(`
`),A.length>0)A+=`
`;if(g=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,p].filter(Rre).join(`
`),g.length>0)g+=`
`}else A=[Ixt(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,p,n.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",n.batching?"#define USE_BATCHING":"",n.batchingColor?"#define USE_BATCHING_COLOR":"",n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.instancingMorph?"#define USE_INSTANCING_MORPH":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+h:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.displacementMap?"#define USE_DISPLACEMENTMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.mapUv?"#define MAP_UV "+n.mapUv:"",n.alphaMapUv?"#define ALPHAMAP_UV "+n.alphaMapUv:"",n.lightMapUv?"#define LIGHTMAP_UV "+n.lightMapUv:"",n.aoMapUv?"#define AOMAP_UV "+n.aoMapUv:"",n.emissiveMapUv?"#define EMISSIVEMAP_UV "+n.emissiveMapUv:"",n.bumpMapUv?"#define BUMPMAP_UV "+n.bumpMapUv:"",n.normalMapUv?"#define NORMALMAP_UV "+n.normalMapUv:"",n.displacementMapUv?"#define DISPLACEMENTMAP_UV "+n.displacementMapUv:"",n.metalnessMapUv?"#define METALNESSMAP_UV "+n.metalnessMapUv:"",n.roughnessMapUv?"#define ROUGHNESSMAP_UV "+n.roughnessMapUv:"",n.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+n.anisotropyMapUv:"",n.clearcoatMapUv?"#define CLEARCOATMAP_UV "+n.clearcoatMapUv:"",n.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+n.clearcoatNormalMapUv:"",n.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+n.clearcoatRoughnessMapUv:"",n.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+n.iridescenceMapUv:"",n.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+n.iridescenceThicknessMapUv:"",n.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+n.sheenColorMapUv:"",n.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+n.sheenRoughnessMapUv:"",n.specularMapUv?"#define SPECULARMAP_UV "+n.specularMapUv:"",n.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+n.specularColorMapUv:"",n.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+n.specularIntensityMapUv:"",n.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+n.transmissionMapUv:"",n.thicknessMapUv?"#define THICKNESSMAP_UV "+n.thicknessMapUv:"",n.vertexTangents&&n.flatShading===!1?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&n.flatShading===!1?"#define USE_MORPHNORMALS":"",n.morphColors?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+c:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH","\tuniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1","\tattribute vec2 uv1;","#endif","#ifdef USE_UV2","\tattribute vec2 uv2;","#endif","#ifdef USE_UV3","\tattribute vec2 uv3;","#endif","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif",`
`].filter(Rre).join(`
`),g=[Ixt(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,p,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+l:"",n.envMap?"#define "+h:"",n.envMap?"#define "+d:"",u?"#define CUBEUV_TEXEL_WIDTH "+u.texelWidth:"",u?"#define CUBEUV_TEXEL_HEIGHT "+u.texelHeight:"",u?"#define CUBEUV_MAX_MIP "+u.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.dispersion?"#define USE_DISPERSION":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents&&n.flatShading===!1?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor||n.batchingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+c:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==0?"#define TONE_MAPPING":"",n.toneMapping!==0?Va.tonemapping_pars_fragment:"",n.toneMapping!==0?l6o("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",Va.colorspace_pars_fragment,c6o("linearToOutputTexel",n.outputColorSpace),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"",`
`].filter(Rre).join(`
`);if(s=aQe(s),s=xxt(s,n),s=Cxt(s,n),a=aQe(a),a=xxt(a,n),a=Cxt(a,n),s=bxt(s),a=bxt(a),n.isRawShaderMaterial!==!0)f=`#version 300 es
`,A=[_,"#define attribute in","#define varying out","#define texture2D texture"].join(`
`)+`
`+A,g=["#define varying in",n.glslVersion==="300 es"?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion==="300 es"?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(`
`)+`
`+g;let y=f+A+s,x=f+g+a,C=fxt(r,r.VERTEX_SHADER,y),b=fxt(r,r.FRAGMENT_SHADER,x);if(r.attachShader(m,C),r.attachShader(m,b),n.index0AttributeName!==void 0)r.bindAttribLocation(m,0,n.index0AttributeName);else if(n.morphTargets===!0)r.bindAttribLocation(m,0,"position");r.linkProgram(m);function I(B){if(e.debug.checkShaderErrors){let T=r.getProgramInfoLog(m).trim(),N=r.getShaderInfoLog(C).trim(),D=r.getShaderInfoLog(b).trim(),L=!0,H=!0;if(r.getProgramParameter(m,r.LINK_STATUS)===!1)if(L=!1,typeof e.debug.onShaderError==="function")e.debug.onShaderError(r,m,C,b);else{let V=yxt(r,C,"vertex"),O=yxt(r,b,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(m,r.VALIDATE_STATUS)+`

Material Name: `+B.name+`
Material Type: `+B.type+`

Program Info Log: `+T+`
`+V+`
`+O)}else if(T!=="")console.warn("THREE.WebGLProgram: Program Info Log:",T);else if(N===""||D==="")H=!1;if(H)B.diagnostics={runnable:L,programLog:T,vertexShader:{log:N,prefix:A},fragmentShader:{log:D,prefix:g}}}r.deleteShader(C),r.deleteShader(b),v=new kre(r,m),P=u6o(r,m)}let v;this.getUniforms=function(){if(v===void 0)I(this);return v};let P;this.getAttributes=function(){if(P===void 0)I(this);return P};let M=n.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){if(M===!1)M=r.getProgramParameter(m,r6o);return M},this.destroy=function(){o.releaseStatesOfProgram(this),r.deleteProgram(m),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=i6o++,this.cacheKey=t,this.usedTimes=1,this.program=m,this.vertexShader=C,this.fragmentShader=b,this}var v6o=0;class x5t{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){let{vertexShader:t,fragmentShader:n}=e,o=this._getShaderStage(t),r=this._getShaderStage(n),i=this._getShaderCacheForMaterial(e);if(i.has(o)===!1)i.add(o),o.usedTimes++;if(i.has(r)===!1)i.add(r),r.usedTimes++;return this}remove(e){let t=this.materialCache.get(e);for(let n of t)if(n.usedTimes--,n.usedTimes===0)this.shaderCache.delete(n.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){let t=this.materialCache,n=t.get(e);if(n===void 0)n=new Set,t.set(e,n);return n}_getShaderStage(e){let t=this.shaderCache,n=t.get(e);if(n===void 0)n=new C5t(e),t.set(e,n);return n}}class C5t{constructor(e){this.id=v6o++,this.code=e,this.usedTimes=0}}function S6o(e,t,n,o,r,i,s){let a=new OAe,c=new x5t,l=new Set,h=[],{logarithmicDepthBuffer:d,vertexTextures:u,precision:_}=r,p={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function m(P){if(l.add(P),P===0)return"uv";return`uv${P}`}function A(P,M,B,T,N){let D=T.fog,L=N.geometry,H=P.isMeshStandardMaterial?T.environment:null,V=(P.isMeshStandardMaterial?n:t).get(P.envMap||H),O=!!V&&V.mapping===306?V.image.height:null,U=p[P.type];if(P.precision!==null){if(_=r.getMaxPrecision(P.precision),_!==P.precision)console.warn("THREE.WebGLProgram.getParameters:",P.precision,"not supported, using",_,"instead.")}let j=L.morphAttributes.position||L.morphAttributes.normal||L.morphAttributes.color,Y=j!==void 0?j.length:0,X=0;if(L.morphAttributes.position!==void 0)X=1;if(L.morphAttributes.normal!==void 0)X=2;if(L.morphAttributes.color!==void 0)X=3;let K,J,ee,se;if(U){let it=M9[U];K=it.vertexShader,J=it.fragmentShader}else K=P.vertexShader,J=P.fragmentShader,c.update(P),ee=c.getVertexShaderID(P),se=c.getFragmentShaderID(P);let ne=e.getRenderTarget(),re=N.isInstancedMesh===!0,Z=N.isBatchedMesh===!0,te=!!P.map,ie=!!P.matcap,le=!!V,ue=!!P.aoMap,de=!!P.lightMap,me=!!P.bumpMap,Ae=!!P.normalMap,xe=!!P.displacementMap,Me=!!P.emissiveMap,Re=!!P.metalnessMap,we=!!P.roughnessMap,_e=P.anisotropy>0,ye=P.clearcoat>0,Se=P.dispersion>0,Ne=P.iridescence>0,ke=P.sheen>0,nt=P.transmission>0,dt=_e&&!!P.anisotropyMap,rt=ye&&!!P.clearcoatMap,mt=ye&&!!P.clearcoatNormalMap,lt=ye&&!!P.clearcoatRoughnessMap,Ct=Ne&&!!P.iridescenceMap,Nt=Ne&&!!P.iridescenceThicknessMap,Ht=ke&&!!P.sheenColorMap,Tt=ke&&!!P.sheenRoughnessMap,et=!!P.specularMap,vt=!!P.specularColorMap,ht=!!P.specularIntensityMap,We=nt&&!!P.transmissionMap,Le=nt&&!!P.thicknessMap,Ze=!!P.gradientMap,$e=!!P.alphaMap,qe=P.alphaTest>0,ft=!!P.alphaHash,It=!!P.extensions,ze=0;if(P.toneMapped){if(ne===null||ne.isXRRenderTarget===!0)ze=e.toneMapping}let Xe={shaderID:U,shaderType:P.type,shaderName:P.name,vertexShader:K,fragmentShader:J,defines:P.defines,customVertexShaderID:ee,customFragmentShaderID:se,isRawShaderMaterial:P.isRawShaderMaterial===!0,glslVersion:P.glslVersion,precision:_,batching:Z,batchingColor:Z&&N._colorsTexture!==null,instancing:re,instancingColor:re&&N.instanceColor!==null,instancingMorph:re&&N.morphTexture!==null,supportsVertexTextures:u,outputColorSpace:ne===null?e.outputColorSpace:ne.isXRRenderTarget===!0?ne.texture.colorSpace:"srgb-linear",alphaToCoverage:!!P.alphaToCoverage,map:te,matcap:ie,envMap:le,envMapMode:le&&V.mapping,envMapCubeUVHeight:O,aoMap:ue,lightMap:de,bumpMap:me,normalMap:Ae,displacementMap:u&&xe,emissiveMap:Me,normalMapObjectSpace:Ae&&P.normalMapType===1,normalMapTangentSpace:Ae&&P.normalMapType===0,metalnessMap:Re,roughnessMap:we,anisotropy:_e,anisotropyMap:dt,clearcoat:ye,clearcoatMap:rt,clearcoatNormalMap:mt,clearcoatRoughnessMap:lt,dispersion:Se,iridescence:Ne,iridescenceMap:Ct,iridescenceThicknessMap:Nt,sheen:ke,sheenColorMap:Ht,sheenRoughnessMap:Tt,specularMap:et,specularColorMap:vt,specularIntensityMap:ht,transmission:nt,transmissionMap:We,thicknessMap:Le,gradientMap:Ze,opaque:P.transparent===!1&&P.blending===1&&P.alphaToCoverage===!1,alphaMap:$e,alphaTest:qe,alphaHash:ft,combine:P.combine,mapUv:te&&m(P.map.channel),aoMapUv:ue&&m(P.aoMap.channel),lightMapUv:de&&m(P.lightMap.channel),bumpMapUv:me&&m(P.bumpMap.channel),normalMapUv:Ae&&m(P.normalMap.channel),displacementMapUv:xe&&m(P.displacementMap.channel),emissiveMapUv:Me&&m(P.emissiveMap.channel),metalnessMapUv:Re&&m(P.metalnessMap.channel),roughnessMapUv:we&&m(P.roughnessMap.channel),anisotropyMapUv:dt&&m(P.anisotropyMap.channel),clearcoatMapUv:rt&&m(P.clearcoatMap.channel),clearcoatNormalMapUv:mt&&m(P.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:lt&&m(P.clearcoatRoughnessMap.channel),iridescenceMapUv:Ct&&m(P.iridescenceMap.channel),iridescenceThicknessMapUv:Nt&&m(P.iridescenceThicknessMap.channel),sheenColorMapUv:Ht&&m(P.sheenColorMap.channel),sheenRoughnessMapUv:Tt&&m(P.sheenRoughnessMap.channel),specularMapUv:et&&m(P.specularMap.channel),specularColorMapUv:vt&&m(P.specularColorMap.channel),specularIntensityMapUv:ht&&m(P.specularIntensityMap.channel),transmissionMapUv:We&&m(P.transmissionMap.channel),thicknessMapUv:Le&&m(P.thicknessMap.channel),alphaMapUv:$e&&m(P.alphaMap.channel),vertexTangents:!!L.attributes.tangent&&(Ae||_e),vertexColors:P.vertexColors,vertexAlphas:P.vertexColors===!0&&!!L.attributes.color&&L.attributes.color.itemSize===4,pointsUvs:N.isPoints===!0&&!!L.attributes.uv&&(te||$e),fog:!!D,useFog:P.fog===!0,fogExp2:!!D&&D.isFogExp2,flatShading:P.flatShading===!0,sizeAttenuation:P.sizeAttenuation===!0,logarithmicDepthBuffer:d,skinning:N.isSkinnedMesh===!0,morphTargets:L.morphAttributes.position!==void 0,morphNormals:L.morphAttributes.normal!==void 0,morphColors:L.morphAttributes.color!==void 0,morphTargetsCount:Y,morphTextureStride:X,numDirLights:M.directional.length,numPointLights:M.point.length,numSpotLights:M.spot.length,numSpotLightMaps:M.spotLightMap.length,numRectAreaLights:M.rectArea.length,numHemiLights:M.hemi.length,numDirLightShadows:M.directionalShadowMap.length,numPointLightShadows:M.pointShadowMap.length,numSpotLightShadows:M.spotShadowMap.length,numSpotLightShadowsWithMaps:M.numSpotLightShadowsWithMaps,numLightProbes:M.numLightProbes,numClippingPlanes:s.numPlanes,numClipIntersection:s.numIntersection,dithering:P.dithering,shadowMapEnabled:e.shadowMap.enabled&&B.length>0,shadowMapType:e.shadowMap.type,toneMapping:ze,decodeVideoTexture:te&&P.map.isVideoTexture===!0&&Zh.getTransfer(P.map.colorSpace)==="srgb",premultipliedAlpha:P.premultipliedAlpha,doubleSided:P.side===2,flipSided:P.side===1,useDepthPacking:P.depthPacking>=0,depthPacking:P.depthPacking||0,index0AttributeName:P.index0AttributeName,extensionClipCullDistance:It&&P.extensions.clipCullDistance===!0&&o.has("WEBGL_clip_cull_distance"),extensionMultiDraw:It&&P.extensions.multiDraw===!0&&o.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:o.has("KHR_parallel_shader_compile"),customProgramCacheKey:P.customProgramCacheKey()};return Xe.vertexUv1s=l.has(1),Xe.vertexUv2s=l.has(2),Xe.vertexUv3s=l.has(3),l.clear(),Xe}function g(P){let M=[];if(P.shaderID)M.push(P.shaderID);else M.push(P.customVertexShaderID),M.push(P.customFragmentShaderID);if(P.defines!==void 0)for(let B in P.defines)M.push(B),M.push(P.defines[B]);if(P.isRawShaderMaterial===!1)f(M,P),y(M,P),M.push(e.outputColorSpace);return M.push(P.customProgramCacheKey),M.join()}function f(P,M){P.push(M.precision),P.push(M.outputColorSpace),P.push(M.envMapMode),P.push(M.envMapCubeUVHeight),P.push(M.mapUv),P.push(M.alphaMapUv),P.push(M.lightMapUv),P.push(M.aoMapUv),P.push(M.bumpMapUv),P.push(M.normalMapUv),P.push(M.displacementMapUv),P.push(M.emissiveMapUv),P.push(M.metalnessMapUv),P.push(M.roughnessMapUv),P.push(M.anisotropyMapUv),P.push(M.clearcoatMapUv),P.push(M.clearcoatNormalMapUv),P.push(M.clearcoatRoughnessMapUv),P.push(M.iridescenceMapUv),P.push(M.iridescenceThicknessMapUv),P.push(M.sheenColorMapUv),P.push(M.sheenRoughnessMapUv),P.push(M.specularMapUv),P.push(M.specularColorMapUv),P.push(M.specularIntensityMapUv),P.push(M.transmissionMapUv),P.push(M.thicknessMapUv),P.push(M.combine),P.push(M.fogExp2),P.push(M.sizeAttenuation),P.push(M.morphTargetsCount),P.push(M.morphAttributeCount),P.push(M.numDirLights),P.push(M.numPointLights),P.push(M.numSpotLights),P.push(M.numSpotLightMaps),P.push(M.numHemiLights),P.push(M.numRectAreaLights),P.push(M.numDirLightShadows),P.push(M.numPointLightShadows),P.push(M.numSpotLightShadows),P.push(M.numSpotLightShadowsWithMaps),P.push(M.numLightProbes),P.push(M.shadowMapType),P.push(M.toneMapping),P.push(M.numClippingPlanes),P.push(M.numClipIntersection),P.push(M.depthPacking)}function y(P,M){if(a.disableAll(),M.supportsVertexTextures)a.enable(0);if(M.instancing)a.enable(1);if(M.instancingColor)a.enable(2);if(M.instancingMorph)a.enable(3);if(M.matcap)a.enable(4);if(M.envMap)a.enable(5);if(M.normalMapObjectSpace)a.enable(6);if(M.normalMapTangentSpace)a.enable(7);if(M.clearcoat)a.enable(8);if(M.iridescence)a.enable(9);if(M.alphaTest)a.enable(10);if(M.vertexColors)a.enable(11);if(M.vertexAlphas)a.enable(12);if(M.vertexUv1s)a.enable(13);if(M.vertexUv2s)a.enable(14);if(M.vertexUv3s)a.enable(15);if(M.vertexTangents)a.enable(16);if(M.anisotropy)a.enable(17);if(M.alphaHash)a.enable(18);if(M.batching)a.enable(19);if(M.dispersion)a.enable(20);if(M.batchingColor)a.enable(21);if(P.push(a.mask),a.disableAll(),M.fog)a.enable(0);if(M.useFog)a.enable(1);if(M.flatShading)a.enable(2);if(M.logarithmicDepthBuffer)a.enable(3);if(M.skinning)a.enable(4);if(M.morphTargets)a.enable(5);if(M.morphNormals)a.enable(6);if(M.morphColors)a.enable(7);if(M.premultipliedAlpha)a.enable(8);if(M.shadowMapEnabled)a.enable(9);if(M.doubleSided)a.enable(10);if(M.flipSided)a.enable(11);if(M.useDepthPacking)a.enable(12);if(M.dithering)a.enable(13);if(M.transmission)a.enable(14);if(M.sheen)a.enable(15);if(M.opaque)a.enable(16);if(M.pointsUvs)a.enable(17);if(M.decodeVideoTexture)a.enable(18);if(M.alphaToCoverage)a.enable(19);P.push(a.mask)}function x(P){let M=p[P.type],B;if(M){let T=M9[M];B=yQe.clone(T.uniforms)}else B=P.uniforms;return B}function C(P,M){let B;for(let T=0,N=h.length;T<N;T++){let D=h[T];if(D.cacheKey===M){B=D,++B.usedTimes;break}}if(B===void 0)B=new I6o(e,M,P,i),h.push(B);return B}function b(P){if(--P.usedTimes===0){let M=h.indexOf(P);h[M]=h[h.length-1],h.pop(),P.destroy()}}function I(P){c.remove(P)}function v(){c.dispose()}return{getParameters:A,getProgramCacheKey:g,getUniforms:x,acquireProgram:C,releaseProgram:b,releaseShaderCache:I,programs:h,dispose:v}}function P6o(){let e=new WeakMap;function t(i){let s=e.get(i);if(s===void 0)s={},e.set(i,s);return s}function n(i){e.delete(i)}function o(i,s,a){e.get(i)[s]=a}function r(){e=new WeakMap}return{get:t,remove:n,update:o,dispose:r}}function E6o(e,t){if(e.groupOrder!==t.groupOrder)return e.groupOrder-t.groupOrder;else if(e.renderOrder!==t.renderOrder)return e.renderOrder-t.renderOrder;else if(e.material.id!==t.material.id)return e.material.id-t.material.id;else if(e.z!==t.z)return e.z-t.z;else return e.id-t.id}function vxt(e,t){if(e.groupOrder!==t.groupOrder)return e.groupOrder-t.groupOrder;else if(e.renderOrder!==t.renderOrder)return e.renderOrder-t.renderOrder;else if(e.z!==t.z)return t.z-e.z;else return e.id-t.id}function Sxt(){let e=[],t=0,n=[],o=[],r=[];function i(){t=0,n.length=0,o.length=0,r.length=0}function s(d,u,_,p,m,A){let g=e[t];if(g===void 0)g={id:d.id,object:d,geometry:u,material:_,groupOrder:p,renderOrder:d.renderOrder,z:m,group:A},e[t]=g;else g.id=d.id,g.object=d,g.geometry=u,g.material=_,g.groupOrder=p,g.renderOrder=d.renderOrder,g.z=m,g.group=A;return t++,g}function a(d,u,_,p,m,A){let g=s(d,u,_,p,m,A);if(_.transmission>0)o.push(g);else if(_.transparent===!0)r.push(g);else n.push(g)}function c(d,u,_,p,m,A){let g=s(d,u,_,p,m,A);if(_.transmission>0)o.unshift(g);else if(_.transparent===!0)r.unshift(g);else n.unshift(g)}function l(d,u){if(n.length>1)n.sort(d||E6o);if(o.length>1)o.sort(u||vxt);if(r.length>1)r.sort(u||vxt)}function h(){for(let d=t,u=e.length;d<u;d++){let _=e[d];if(_.id===null)break;_.id=null,_.object=null,_.geometry=null,_.material=null,_.group=null}}return{opaque:n,transmissive:o,transparent:r,init:i,push:a,unshift:c,finish:h,sort:l}}function M6o(){let e=new WeakMap;function t(o,r){let i=e.get(o),s;if(i===void 0)s=new Sxt,e.set(o,[s]);else if(r>=i.length)s=new Sxt,i.push(s);else s=i[r];return s}function n(){e=new WeakMap}return{get:t,dispose:n}}function w6o(){let e={};return{get:function(t){if(e[t.id]!==void 0)return e[t.id];let n;switch(t.type){case"DirectionalLight":n={direction:new Et,color:new No};break;case"SpotLight":n={position:new Et,direction:new Et,color:new No,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new Et,color:new No,distance:0,decay:0};break;case"HemisphereLight":n={direction:new Et,skyColor:new No,groundColor:new No};break;case"RectAreaLight":n={color:new No,position:new Et,halfWidth:new Et,halfHeight:new Et};break}return e[t.id]=n,n}}}function B6o(){let e={};return{get:function(t){if(e[t.id]!==void 0)return e[t.id];let n;switch(t.type){case"DirectionalLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ro};break;case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ro};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ro,shadowCameraNear:1,shadowCameraFar:1000};break}return e[t.id]=n,n}}}var T6o=0;function D6o(e,t){return(t.castShadow?2:0)-(e.castShadow?2:0)+(t.map?1:0)-(e.map?1:0)}function N6o(e){let t=new w6o,n=B6o(),o={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let l=0;l<9;l++)o.probe.push(new Et);let r=new Et,i=new Gi,s=new Gi;function a(l){let h=0,d=0,u=0;for(let P=0;P<9;P++)o.probe[P].set(0,0,0);let _=0,p=0,m=0,A=0,g=0,f=0,y=0,x=0,C=0,b=0,I=0;l.sort(D6o);for(let P=0,M=l.length;P<M;P++){let B=l[P],{color:T,intensity:N,distance:D}=B,L=B.shadow&&B.shadow.map?B.shadow.map.texture:null;if(B.isAmbientLight)h+=T.r*N,d+=T.g*N,u+=T.b*N;else if(B.isLightProbe){for(let H=0;H<9;H++)o.probe[H].addScaledVector(B.sh.coefficients[H],N);I++}else if(B.isDirectionalLight){let H=t.get(B);if(H.color.copy(B.color).multiplyScalar(B.intensity),B.castShadow){let V=B.shadow,O=n.get(B);O.shadowBias=V.bias,O.shadowNormalBias=V.normalBias,O.shadowRadius=V.radius,O.shadowMapSize=V.mapSize,o.directionalShadow[_]=O,o.directionalShadowMap[_]=L,o.directionalShadowMatrix[_]=B.shadow.matrix,f++}o.directional[_]=H,_++}else if(B.isSpotLight){let H=t.get(B);H.position.setFromMatrixPosition(B.matrixWorld),H.color.copy(T).multiplyScalar(N),H.distance=D,H.coneCos=Math.cos(B.angle),H.penumbraCos=Math.cos(B.angle*(1-B.penumbra)),H.decay=B.decay,o.spot[m]=H;let V=B.shadow;if(B.map){if(o.spotLightMap[C]=B.map,C++,V.updateMatrices(B),B.castShadow)b++}if(o.spotLightMatrix[m]=V.matrix,B.castShadow){let O=n.get(B);O.shadowBias=V.bias,O.shadowNormalBias=V.normalBias,O.shadowRadius=V.radius,O.shadowMapSize=V.mapSize,o.spotShadow[m]=O,o.spotShadowMap[m]=L,x++}m++}else if(B.isRectAreaLight){let H=t.get(B);H.color.copy(T).multiplyScalar(N),H.halfWidth.set(B.width*0.5,0,0),H.halfHeight.set(0,B.height*0.5,0),o.rectArea[A]=H,A++}else if(B.isPointLight){let H=t.get(B);if(H.color.copy(B.color).multiplyScalar(B.intensity),H.distance=B.distance,H.decay=B.decay,B.castShadow){let V=B.shadow,O=n.get(B);O.shadowBias=V.bias,O.shadowNormalBias=V.normalBias,O.shadowRadius=V.radius,O.shadowMapSize=V.mapSize,O.shadowCameraNear=V.camera.near,O.shadowCameraFar=V.camera.far,o.pointShadow[p]=O,o.pointShadowMap[p]=L,o.pointShadowMatrix[p]=B.shadow.matrix,y++}o.point[p]=H,p++}else if(B.isHemisphereLight){let H=t.get(B);H.skyColor.copy(B.color).multiplyScalar(N),H.groundColor.copy(B.groundColor).multiplyScalar(N),o.hemi[g]=H,g++}}if(A>0)if(e.has("OES_texture_float_linear")===!0)o.rectAreaLTC1=Er.LTC_FLOAT_1,o.rectAreaLTC2=Er.LTC_FLOAT_2;else o.rectAreaLTC1=Er.LTC_HALF_1,o.rectAreaLTC2=Er.LTC_HALF_2;o.ambient[0]=h,o.ambient[1]=d,o.ambient[2]=u;let v=o.hash;if(v.directionalLength!==_||v.pointLength!==p||v.spotLength!==m||v.rectAreaLength!==A||v.hemiLength!==g||v.numDirectionalShadows!==f||v.numPointShadows!==y||v.numSpotShadows!==x||v.numSpotMaps!==C||v.numLightProbes!==I)o.directional.length=_,o.spot.length=m,o.rectArea.length=A,o.point.length=p,o.hemi.length=g,o.directionalShadow.length=f,o.directionalShadowMap.length=f,o.pointShadow.length=y,o.pointShadowMap.length=y,o.spotShadow.length=x,o.spotShadowMap.length=x,o.directionalShadowMatrix.length=f,o.pointShadowMatrix.length=y,o.spotLightMatrix.length=x+C-b,o.spotLightMap.length=C,o.numSpotLightShadowsWithMaps=b,o.numLightProbes=I,v.directionalLength=_,v.pointLength=p,v.spotLength=m,v.rectAreaLength=A,v.hemiLength=g,v.numDirectionalShadows=f,v.numPointShadows=y,v.numSpotShadows=x,v.numSpotMaps=C,v.numLightProbes=I,o.version=T6o++}function c(l,h){let d=0,u=0,_=0,p=0,m=0,A=h.matrixWorldInverse;for(let g=0,f=l.length;g<f;g++){let y=l[g];if(y.isDirectionalLight){let x=o.directional[d];x.direction.setFromMatrixPosition(y.matrixWorld),r.setFromMatrixPosition(y.target.matrixWorld),x.direction.sub(r),x.direction.transformDirection(A),d++}else if(y.isSpotLight){let x=o.spot[_];x.position.setFromMatrixPosition(y.matrixWorld),x.position.applyMatrix4(A),x.direction.setFromMatrixPosition(y.matrixWorld),r.setFromMatrixPosition(y.target.matrixWorld),x.direction.sub(r),x.direction.transformDirection(A),_++}else if(y.isRectAreaLight){let x=o.rectArea[p];x.position.setFromMatrixPosition(y.matrixWorld),x.position.applyMatrix4(A),s.identity(),i.copy(y.matrixWorld),i.premultiply(A),s.extractRotation(i),x.halfWidth.set(y.width*0.5,0,0),x.halfHeight.set(0,y.height*0.5,0),x.halfWidth.applyMatrix4(s),x.halfHeight.applyMatrix4(s),p++}else if(y.isPointLight){let x=o.point[u];x.position.setFromMatrixPosition(y.matrixWorld),x.position.applyMatrix4(A),u++}else if(y.isHemisphereLight){let x=o.hemi[m];x.direction.setFromMatrixPosition(y.matrixWorld),x.direction.transformDirection(A),m++}}}return{setup:a,setupView:c,state:o}}function Pxt(e){let t=new N6o(e),n=[],o=[];function r(h){l.camera=h,n.length=0,o.length=0}function i(h){n.push(h)}function s(h){o.push(h)}function a(){t.setup(n)}function c(h){t.setupView(n,h)}let l={lightsArray:n,shadowsArray:o,camera:null,lights:t,transmissionRenderTarget:{}};return{init:r,state:l,setupLights:a,setupLightsView:c,pushLight:i,pushShadow:s}}function R6o(e){let t=new WeakMap;function n(r,i=0){let s=t.get(r),a;if(s===void 0)a=new Pxt(e),t.set(r,[a]);else if(i>=s.length)a=new Pxt(e),s.push(a);else a=s[i];return a}function o(){t=new WeakMap}return{get:n,dispose:o}}class GAe extends zA{constructor(e){super();this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=3200,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class UAe extends zA{constructor(e){super();this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}var Q6o=`void main() {
	gl_Position = vec4( position, 1.0 );
}`,k6o=`uniform sampler2D shadow_pass;
uniform vec2 resolution;
uniform float radius;
#include <packing>
void main() {
	const float samples = float( VSM_SAMPLES );
	float mean = 0.0;
	float squared_mean = 0.0;
	float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );
	float uvStart = samples <= 1.0 ? 0.0 : - 1.0;
	for ( float i = 0.0; i < samples; i ++ ) {
		float uvOffset = uvStart + i * uvStride;
		#ifdef HORIZONTAL_PASS
			vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );
			mean += distribution.x;
			squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;
		#else
			float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );
			mean += depth;
			squared_mean += depth * depth;
		#endif
	}
	mean = mean / samples;
	squared_mean = squared_mean / samples;
	float std_dev = sqrt( squared_mean - mean * mean );
	gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );
}`;function L6o(e,t,n){let o=new VAe,r=new ro,i=new ro,s=new zh,a=new GAe({depthPacking:3201}),c=new UAe,l={},h=n.maxTextureSize,d={[0]:1,[1]:0,[2]:2},u=new l3({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new ro},radius:{value:4}},vertexShader:Q6o,fragmentShader:k6o}),_=u.clone();_.defines.HORIZONTAL_PASS=1;let p=new js;p.setAttribute("position",new Pl(new Float32Array([-1,-1,0.5,3,-1,0.5,-1,3,0.5]),3));let m=new Mo(p,u),A=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1;let g=this.type;this.render=function(b,I,v){if(A.enabled===!1)return;if(A.autoUpdate===!1&&A.needsUpdate===!1)return;if(b.length===0)return;let P=e.getRenderTarget(),M=e.getActiveCubeFace(),B=e.getActiveMipmapLevel(),T=e.state;T.setBlending(0),T.buffers.color.setClear(1,1,1,1),T.buffers.depth.setTest(!0),T.setScissorTest(!1);let N=g!==3&&this.type===3,D=g===3&&this.type!==3;for(let L=0,H=b.length;L<H;L++){let V=b[L],O=V.shadow;if(O===void 0){console.warn("THREE.WebGLShadowMap:",V,"has no shadow.");continue}if(O.autoUpdate===!1&&O.needsUpdate===!1)continue;r.copy(O.mapSize);let U=O.getFrameExtents();if(r.multiply(U),i.copy(O.mapSize),r.x>h||r.y>h){if(r.x>h)i.x=Math.floor(h/U.x),r.x=i.x*U.x,O.mapSize.x=i.x;if(r.y>h)i.y=Math.floor(h/U.y),r.y=i.y*U.y,O.mapSize.y=i.y}if(O.map===null||N===!0||D===!0){let Y=this.type!==3?{minFilter:1003,magFilter:1003}:{};if(O.map!==null)O.map.dispose();O.map=new uR(r.x,r.y,Y),O.map.texture.name=V.name+".shadowMap",O.camera.updateProjectionMatrix()}e.setRenderTarget(O.map),e.clear();let j=O.getViewportCount();for(let Y=0;Y<j;Y++){let X=O.getViewport(Y);s.set(i.x*X.x,i.y*X.y,i.x*X.z,i.y*X.w),T.viewport(s),O.updateMatrices(V,Y),o=O.getFrustum(),x(I,v,O.camera,V,this.type)}if(O.isPointLightShadow!==!0&&this.type===3)f(O,v);O.needsUpdate=!1}g=this.type,A.needsUpdate=!1,e.setRenderTarget(P,M,B)};function f(b,I){let v=t.update(m);if(u.defines.VSM_SAMPLES!==b.blurSamples)u.defines.VSM_SAMPLES=b.blurSamples,_.defines.VSM_SAMPLES=b.blurSamples,u.needsUpdate=!0,_.needsUpdate=!0;if(b.mapPass===null)b.mapPass=new uR(r.x,r.y);u.uniforms.shadow_pass.value=b.map.texture,u.uniforms.resolution.value=b.mapSize,u.uniforms.radius.value=b.radius,e.setRenderTarget(b.mapPass),e.clear(),e.renderBufferDirect(I,null,v,u,m,null),_.uniforms.shadow_pass.value=b.mapPass.texture,_.uniforms.resolution.value=b.mapSize,_.uniforms.radius.value=b.radius,e.setRenderTarget(b.map),e.clear(),e.renderBufferDirect(I,null,v,_,m,null)}function y(b,I,v,P){let M=null,B=v.isPointLight===!0?b.customDistanceMaterial:b.customDepthMaterial;if(B!==void 0)M=B;else if(M=v.isPointLight===!0?c:a,e.localClippingEnabled&&I.clipShadows===!0&&Array.isArray(I.clippingPlanes)&&I.clippingPlanes.length!==0||I.displacementMap&&I.displacementScale!==0||I.alphaMap&&I.alphaTest>0||I.map&&I.alphaTest>0){let T=M.uuid,N=I.uuid,D=l[T];if(D===void 0)D={},l[T]=D;let L=D[N];if(L===void 0)L=M.clone(),D[N]=L,I.addEventListener("dispose",C);M=L}if(M.visible=I.visible,M.wireframe=I.wireframe,P===3)M.side=I.shadowSide!==null?I.shadowSide:I.side;else M.side=I.shadowSide!==null?I.shadowSide:d[I.side];if(M.alphaMap=I.alphaMap,M.alphaTest=I.alphaTest,M.map=I.map,M.clipShadows=I.clipShadows,M.clippingPlanes=I.clippingPlanes,M.clipIntersection=I.clipIntersection,M.displacementMap=I.displacementMap,M.displacementScale=I.displacementScale,M.displacementBias=I.displacementBias,M.wireframeLinewidth=I.wireframeLinewidth,M.linewidth=I.linewidth,v.isPointLight===!0&&M.isMeshDistanceMaterial===!0){let T=e.properties.get(M);T.light=v}return M}function x(b,I,v,P,M){if(b.visible===!1)return;if(b.layers.test(I.layers)&&(b.isMesh||b.isLine||b.isPoints)){if((b.castShadow||b.receiveShadow&&M===3)&&(!b.frustumCulled||o.intersectsObject(b))){b.modelViewMatrix.multiplyMatrices(v.matrixWorldInverse,b.matrixWorld);let N=t.update(b),D=b.material;if(Array.isArray(D)){let L=N.groups;for(let H=0,V=L.length;H<V;H++){let O=L[H],U=D[O.materialIndex];if(U&&U.visible){let j=y(b,U,P,M);b.onBeforeShadow(e,b,I,v,N,j,O),e.renderBufferDirect(v,null,N,j,b,O),b.onAfterShadow(e,b,I,v,N,j,O)}}}else if(D.visible){let L=y(b,D,P,M);b.onBeforeShadow(e,b,I,v,N,L,null),e.renderBufferDirect(v,null,N,L,b,null),b.onAfterShadow(e,b,I,v,N,L,null)}}}let T=b.children;for(let N=0,D=T.length;N<D;N++)x(T[N],I,v,P,M)}function C(b){b.target.removeEventListener("dispose",C);for(let v in l){let P=l[v],M=b.target.uuid;if(M in P)P[M].dispose(),delete P[M]}}}function H6o(e){function t(){let We=!1,Le=new zh,Ze=null,$e=new zh(0,0,0,0);return{setMask:function(qe){if(Ze!==qe&&!We)e.colorMask(qe,qe,qe,qe),Ze=qe},setLocked:function(qe){We=qe},setClear:function(qe,ft,It,ze,Xe){if(Xe===!0)qe*=ze,ft*=ze,It*=ze;if(Le.set(qe,ft,It,ze),$e.equals(Le)===!1)e.clearColor(qe,ft,It,ze),$e.copy(Le)},reset:function(){We=!1,Ze=null,$e.set(-1,0,0,0)}}}function n(){let We=!1,Le=null,Ze=null,$e=null;return{setTest:function(qe){if(qe)se(e.DEPTH_TEST);else ne(e.DEPTH_TEST)},setMask:function(qe){if(Le!==qe&&!We)e.depthMask(qe),Le=qe},setFunc:function(qe){if(Ze!==qe){switch(qe){case 0:e.depthFunc(e.NEVER);break;case 1:e.depthFunc(e.ALWAYS);break;case 2:e.depthFunc(e.LESS);break;case 3:e.depthFunc(e.LEQUAL);break;case 4:e.depthFunc(e.EQUAL);break;case 5:e.depthFunc(e.GEQUAL);break;case 6:e.depthFunc(e.GREATER);break;case 7:e.depthFunc(e.NOTEQUAL);break;default:e.depthFunc(e.LEQUAL)}Ze=qe}},setLocked:function(qe){We=qe},setClear:function(qe){if($e!==qe)e.clearDepth(qe),$e=qe},reset:function(){We=!1,Le=null,Ze=null,$e=null}}}function o(){let We=!1,Le=null,Ze=null,$e=null,qe=null,ft=null,It=null,ze=null,Xe=null;return{setTest:function(it){if(!We)if(it)se(e.STENCIL_TEST);else ne(e.STENCIL_TEST)},setMask:function(it){if(Le!==it&&!We)e.stencilMask(it),Le=it},setFunc:function(it,St,kt){if(Ze!==it||$e!==St||qe!==kt)e.stencilFunc(it,St,kt),Ze=it,$e=St,qe=kt},setOp:function(it,St,kt){if(ft!==it||It!==St||ze!==kt)e.stencilOp(it,St,kt),ft=it,It=St,ze=kt},setLocked:function(it){We=it},setClear:function(it){if(Xe!==it)e.clearStencil(it),Xe=it},reset:function(){We=!1,Le=null,Ze=null,$e=null,qe=null,ft=null,It=null,ze=null,Xe=null}}}let r=new t,i=new n,s=new o,a=new WeakMap,c=new WeakMap,l={},h={},d=new WeakMap,u=[],_=null,p=!1,m=null,A=null,g=null,f=null,y=null,x=null,C=null,b=new No(0,0,0),I=0,v=!1,P=null,M=null,B=null,T=null,N=null,D=e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS),L=!1,H=0,V=e.getParameter(e.VERSION);if(V.indexOf("WebGL")!==-1)H=parseFloat(/^WebGL (\d)/.exec(V)[1]),L=H>=1;else if(V.indexOf("OpenGL ES")!==-1)H=parseFloat(/^OpenGL ES (\d)/.exec(V)[1]),L=H>=2;let O=null,U={},j=e.getParameter(e.SCISSOR_BOX),Y=e.getParameter(e.VIEWPORT),X=new zh().fromArray(j),K=new zh().fromArray(Y);function J(We,Le,Ze,$e){let qe=new Uint8Array(4),ft=e.createTexture();e.bindTexture(We,ft),e.texParameteri(We,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(We,e.TEXTURE_MAG_FILTER,e.NEAREST);for(let It=0;It<Ze;It++)if(We===e.TEXTURE_3D||We===e.TEXTURE_2D_ARRAY)e.texImage3D(Le,0,e.RGBA,1,1,$e,0,e.RGBA,e.UNSIGNED_BYTE,qe);else e.texImage2D(Le+It,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,qe);return ft}let ee={};ee[e.TEXTURE_2D]=J(e.TEXTURE_2D,e.TEXTURE_2D,1),ee[e.TEXTURE_CUBE_MAP]=J(e.TEXTURE_CUBE_MAP,e.TEXTURE_CUBE_MAP_POSITIVE_X,6),ee[e.TEXTURE_2D_ARRAY]=J(e.TEXTURE_2D_ARRAY,e.TEXTURE_2D_ARRAY,1,1),ee[e.TEXTURE_3D]=J(e.TEXTURE_3D,e.TEXTURE_3D,1,1),r.setClear(0,0,0,1),i.setClear(1),s.setClear(0),se(e.DEPTH_TEST),i.setFunc(3),me(!1),Ae(1),se(e.CULL_FACE),ue(0);function se(We){if(l[We]!==!0)e.enable(We),l[We]=!0}function ne(We){if(l[We]!==!1)e.disable(We),l[We]=!1}function re(We,Le){if(h[We]!==Le){if(e.bindFramebuffer(We,Le),h[We]=Le,We===e.DRAW_FRAMEBUFFER)h[e.FRAMEBUFFER]=Le;if(We===e.FRAMEBUFFER)h[e.DRAW_FRAMEBUFFER]=Le;return!0}return!1}function Z(We,Le){let Ze=u,$e=!1;if(We){if(Ze=d.get(Le),Ze===void 0)Ze=[],d.set(Le,Ze);let qe=We.textures;if(Ze.length!==qe.length||Ze[0]!==e.COLOR_ATTACHMENT0){for(let ft=0,It=qe.length;ft<It;ft++)Ze[ft]=e.COLOR_ATTACHMENT0+ft;Ze.length=qe.length,$e=!0}}else if(Ze[0]!==e.BACK)Ze[0]=e.BACK,$e=!0;if($e)e.drawBuffers(Ze)}function te(We){if(_!==We)return e.useProgram(We),_=We,!0;return!1}let ie={[100]:e.FUNC_ADD,[101]:e.FUNC_SUBTRACT,[102]:e.FUNC_REVERSE_SUBTRACT};ie[103]=e.MIN,ie[104]=e.MAX;let le={[200]:e.ZERO,[201]:e.ONE,[202]:e.SRC_COLOR,[204]:e.SRC_ALPHA,[210]:e.SRC_ALPHA_SATURATE,[208]:e.DST_COLOR,[206]:e.DST_ALPHA,[203]:e.ONE_MINUS_SRC_COLOR,[205]:e.ONE_MINUS_SRC_ALPHA,[209]:e.ONE_MINUS_DST_COLOR,[207]:e.ONE_MINUS_DST_ALPHA,[211]:e.CONSTANT_COLOR,[212]:e.ONE_MINUS_CONSTANT_COLOR,[213]:e.CONSTANT_ALPHA,[214]:e.ONE_MINUS_CONSTANT_ALPHA};function ue(We,Le,Ze,$e,qe,ft,It,ze,Xe,it){if(We===0){if(p===!0)ne(e.BLEND),p=!1;return}if(p===!1)se(e.BLEND),p=!0;if(We!==5){if(We!==m||it!==v){if(A!==100||y!==100)e.blendEquation(e.FUNC_ADD),A=100,y=100;if(it)switch(We){case 1:e.blendFuncSeparate(e.ONE,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case 2:e.blendFunc(e.ONE,e.ONE);break;case 3:e.blendFuncSeparate(e.ZERO,e.ONE_MINUS_SRC_COLOR,e.ZERO,e.ONE);break;case 4:e.blendFuncSeparate(e.ZERO,e.SRC_COLOR,e.ZERO,e.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",We);break}else switch(We){case 1:e.blendFuncSeparate(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case 2:e.blendFunc(e.SRC_ALPHA,e.ONE);break;case 3:e.blendFuncSeparate(e.ZERO,e.ONE_MINUS_SRC_COLOR,e.ZERO,e.ONE);break;case 4:e.blendFunc(e.ZERO,e.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",We);break}g=null,f=null,x=null,C=null,b.set(0,0,0),I=0,m=We,v=it}return}if(qe=qe||Le,ft=ft||Ze,It=It||$e,Le!==A||qe!==y)e.blendEquationSeparate(ie[Le],ie[qe]),A=Le,y=qe;if(Ze!==g||$e!==f||ft!==x||It!==C)e.blendFuncSeparate(le[Ze],le[$e],le[ft],le[It]),g=Ze,f=$e,x=ft,C=It;if(ze.equals(b)===!1||Xe!==I)e.blendColor(ze.r,ze.g,ze.b,Xe),b.copy(ze),I=Xe;m=We,v=!1}function de(We,Le){We.side===2?ne(e.CULL_FACE):se(e.CULL_FACE);let Ze=We.side===1;if(Le)Ze=!Ze;me(Ze),We.blending===1&&We.transparent===!1?ue(0):ue(We.blending,We.blendEquation,We.blendSrc,We.blendDst,We.blendEquationAlpha,We.blendSrcAlpha,We.blendDstAlpha,We.blendColor,We.blendAlpha,We.premultipliedAlpha),i.setFunc(We.depthFunc),i.setTest(We.depthTest),i.setMask(We.depthWrite),r.setMask(We.colorWrite);let $e=We.stencilWrite;if(s.setTest($e),$e)s.setMask(We.stencilWriteMask),s.setFunc(We.stencilFunc,We.stencilRef,We.stencilFuncMask),s.setOp(We.stencilFail,We.stencilZFail,We.stencilZPass);Me(We.polygonOffset,We.polygonOffsetFactor,We.polygonOffsetUnits),We.alphaToCoverage===!0?se(e.SAMPLE_ALPHA_TO_COVERAGE):ne(e.SAMPLE_ALPHA_TO_COVERAGE)}function me(We){if(P!==We){if(We)e.frontFace(e.CW);else e.frontFace(e.CCW);P=We}}function Ae(We){if(We!==0){if(se(e.CULL_FACE),We!==M)if(We===1)e.cullFace(e.BACK);else if(We===2)e.cullFace(e.FRONT);else e.cullFace(e.FRONT_AND_BACK)}else ne(e.CULL_FACE);M=We}function xe(We){if(We!==B){if(L)e.lineWidth(We);B=We}}function Me(We,Le,Ze){if(We){if(se(e.POLYGON_OFFSET_FILL),T!==Le||N!==Ze)e.polygonOffset(Le,Ze),T=Le,N=Ze}else ne(e.POLYGON_OFFSET_FILL)}function Re(We){if(We)se(e.SCISSOR_TEST);else ne(e.SCISSOR_TEST)}function we(We){if(We===void 0)We=e.TEXTURE0+D-1;if(O!==We)e.activeTexture(We),O=We}function _e(We,Le,Ze){if(Ze===void 0)if(O===null)Ze=e.TEXTURE0+D-1;else Ze=O;let $e=U[Ze];if($e===void 0)$e={type:void 0,texture:void 0},U[Ze]=$e;if($e.type!==We||$e.texture!==Le){if(O!==Ze)e.activeTexture(Ze),O=Ze;e.bindTexture(We,Le||ee[We]),$e.type=We,$e.texture=Le}}function ye(){let We=U[O];if(We!==void 0&&We.type!==void 0)e.bindTexture(We.type,null),We.type=void 0,We.texture=void 0}function Se(){try{e.compressedTexImage2D.apply(e,arguments)}catch(We){console.error("THREE.WebGLState:",We)}}function Ne(){try{e.compressedTexImage3D.apply(e,arguments)}catch(We){console.error("THREE.WebGLState:",We)}}function ke(){try{e.texSubImage2D.apply(e,arguments)}catch(We){console.error("THREE.WebGLState:",We)}}function nt(){try{e.texSubImage3D.apply(e,arguments)}catch(We){console.error("THREE.WebGLState:",We)}}function dt(){try{e.compressedTexSubImage2D.apply(e,arguments)}catch(We){console.error("THREE.WebGLState:",We)}}function rt(){try{e.compressedTexSubImage3D.apply(e,arguments)}catch(We){console.error("THREE.WebGLState:",We)}}function mt(){try{e.texStorage2D.apply(e,arguments)}catch(We){console.error("THREE.WebGLState:",We)}}function lt(){try{e.texStorage3D.apply(e,arguments)}catch(We){console.error("THREE.WebGLState:",We)}}function Ct(){try{e.texImage2D.apply(e,arguments)}catch(We){console.error("THREE.WebGLState:",We)}}function Nt(){try{e.texImage3D.apply(e,arguments)}catch(We){console.error("THREE.WebGLState:",We)}}function Ht(We){if(X.equals(We)===!1)e.scissor(We.x,We.y,We.z,We.w),X.copy(We)}function Tt(We){if(K.equals(We)===!1)e.viewport(We.x,We.y,We.z,We.w),K.copy(We)}function et(We,Le){let Ze=c.get(Le);if(Ze===void 0)Ze=new WeakMap,c.set(Le,Ze);let $e=Ze.get(We);if($e===void 0)$e=e.getUniformBlockIndex(Le,We.name),Ze.set(We,$e)}function vt(We,Le){let $e=c.get(Le).get(We);if(a.get(Le)!==$e)e.uniformBlockBinding(Le,$e,We.__bindingPointIndex),a.set(Le,$e)}function ht(){e.disable(e.BLEND),e.disable(e.CULL_FACE),e.disable(e.DEPTH_TEST),e.disable(e.POLYGON_OFFSET_FILL),e.disable(e.SCISSOR_TEST),e.disable(e.STENCIL_TEST),e.disable(e.SAMPLE_ALPHA_TO_COVERAGE),e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ZERO),e.blendFuncSeparate(e.ONE,e.ZERO,e.ONE,e.ZERO),e.blendColor(0,0,0,0),e.colorMask(!0,!0,!0,!0),e.clearColor(0,0,0,0),e.depthMask(!0),e.depthFunc(e.LESS),e.clearDepth(1),e.stencilMask(4294967295),e.stencilFunc(e.ALWAYS,0,4294967295),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),e.clearStencil(0),e.cullFace(e.BACK),e.frontFace(e.CCW),e.polygonOffset(0,0),e.activeTexture(e.TEXTURE0),e.bindFramebuffer(e.FRAMEBUFFER,null),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),e.bindFramebuffer(e.READ_FRAMEBUFFER,null),e.useProgram(null),e.lineWidth(1),e.scissor(0,0,e.canvas.width,e.canvas.height),e.viewport(0,0,e.canvas.width,e.canvas.height),l={},O=null,U={},h={},d=new WeakMap,u=[],_=null,p=!1,m=null,A=null,g=null,f=null,y=null,x=null,C=null,b=new No(0,0,0),I=0,v=!1,P=null,M=null,B=null,T=null,N=null,X.set(0,0,e.canvas.width,e.canvas.height),K.set(0,0,e.canvas.width,e.canvas.height),r.reset(),i.reset(),s.reset()}return{buffers:{color:r,depth:i,stencil:s},enable:se,disable:ne,bindFramebuffer:re,drawBuffers:Z,useProgram:te,setBlending:ue,setMaterial:de,setFlipSided:me,setCullFace:Ae,setLineWidth:xe,setPolygonOffset:Me,setScissorTest:Re,activeTexture:we,bindTexture:_e,unbindTexture:ye,compressedTexImage2D:Se,compressedTexImage3D:Ne,texImage2D:Ct,texImage3D:Nt,updateUBOMapping:et,uniformBlockBinding:vt,texStorage2D:mt,texStorage3D:lt,texSubImage2D:ke,texSubImage3D:nt,compressedTexSubImage2D:dt,compressedTexSubImage3D:rt,scissor:Ht,viewport:Tt,reset:ht}}function F6o(e,t,n,o,r,i,s){let a=t.has("WEBGL_multisampled_render_to_texture")?t.get("WEBGL_multisampled_render_to_texture"):null,c=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),l=new ro,h=new WeakMap,d,u=new WeakMap,_=!1;try{_=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch(we){}function p(we,_e){return _?new OffscreenCanvas(we,_e):Fre("canvas")}function m(we,_e,ye){let Se=1,Ne=Re(we);if(Ne.width>ye||Ne.height>ye)Se=ye/Math.max(Ne.width,Ne.height);if(Se<1)if(typeof HTMLImageElement<"u"&&we instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&we instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&we instanceof ImageBitmap||typeof VideoFrame<"u"&&we instanceof VideoFrame){let ke=Math.floor(Se*Ne.width),nt=Math.floor(Se*Ne.height);if(d===void 0)d=p(ke,nt);let dt=_e?p(ke,nt):d;return dt.width=ke,dt.height=nt,dt.getContext("2d").drawImage(we,0,0,ke,nt),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+Ne.width+"x"+Ne.height+") to ("+ke+"x"+nt+")."),dt}else{if("data"in we)console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+Ne.width+"x"+Ne.height+").");return we}return we}function A(we){return we.generateMipmaps&&we.minFilter!==1003&&we.minFilter!==1006}function g(we){e.generateMipmap(we)}function f(we,_e,ye,Se,Ne=!1){if(we!==null){if(e[we]!==void 0)return e[we];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+we+"'")}let ke=_e;if(_e===e.RED){if(ye===e.FLOAT)ke=e.R32F;if(ye===e.HALF_FLOAT)ke=e.R16F;if(ye===e.UNSIGNED_BYTE)ke=e.R8}if(_e===e.RED_INTEGER){if(ye===e.UNSIGNED_BYTE)ke=e.R8UI;if(ye===e.UNSIGNED_SHORT)ke=e.R16UI;if(ye===e.UNSIGNED_INT)ke=e.R32UI;if(ye===e.BYTE)ke=e.R8I;if(ye===e.SHORT)ke=e.R16I;if(ye===e.INT)ke=e.R32I}if(_e===e.RG){if(ye===e.FLOAT)ke=e.RG32F;if(ye===e.HALF_FLOAT)ke=e.RG16F;if(ye===e.UNSIGNED_BYTE)ke=e.RG8}if(_e===e.RG_INTEGER){if(ye===e.UNSIGNED_BYTE)ke=e.RG8UI;if(ye===e.UNSIGNED_SHORT)ke=e.RG16UI;if(ye===e.UNSIGNED_INT)ke=e.RG32UI;if(ye===e.BYTE)ke=e.RG8I;if(ye===e.SHORT)ke=e.RG16I;if(ye===e.INT)ke=e.RG32I}if(_e===e.RGB){if(ye===e.UNSIGNED_INT_5_9_9_9_REV)ke=e.RGB9_E5}if(_e===e.RGBA){let nt=Ne?"linear":Zh.getTransfer(Se);if(ye===e.FLOAT)ke=e.RGBA32F;if(ye===e.HALF_FLOAT)ke=e.RGBA16F;if(ye===e.UNSIGNED_BYTE)ke=nt==="srgb"?e.SRGB8_ALPHA8:e.RGBA8;if(ye===e.UNSIGNED_SHORT_4_4_4_4)ke=e.RGBA4;if(ye===e.UNSIGNED_SHORT_5_5_5_1)ke=e.RGB5_A1}if(ke===e.R16F||ke===e.R32F||ke===e.RG16F||ke===e.RG32F||ke===e.RGBA16F||ke===e.RGBA32F)t.get("EXT_color_buffer_float");return ke}function y(we,_e){let ye;if(we){if(_e===null||_e===1014||_e===1020)ye=e.DEPTH24_STENCIL8;else if(_e===1015)ye=e.DEPTH32F_STENCIL8;else if(_e===1012)ye=e.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")}else if(_e===null||_e===1014||_e===1020)ye=e.DEPTH_COMPONENT24;else if(_e===1015)ye=e.DEPTH_COMPONENT32F;else if(_e===1012)ye=e.DEPTH_COMPONENT16;return ye}function x(we,_e){if(A(we)===!0||we.isFramebufferTexture&&we.minFilter!==1003&&we.minFilter!==1006)return Math.log2(Math.max(_e.width,_e.height))+1;else if(we.mipmaps!==void 0&&we.mipmaps.length>0)return we.mipmaps.length;else if(we.isCompressedTexture&&Array.isArray(we.image))return _e.mipmaps.length;else return 1}function C(we){let _e=we.target;if(_e.removeEventListener("dispose",C),I(_e),_e.isVideoTexture)h.delete(_e)}function b(we){let _e=we.target;_e.removeEventListener("dispose",b),P(_e)}function I(we){let _e=o.get(we);if(_e.__webglInit===void 0)return;let ye=we.source,Se=u.get(ye);if(Se){let Ne=Se[_e.__cacheKey];if(Ne.usedTimes--,Ne.usedTimes===0)v(we);if(Object.keys(Se).length===0)u.delete(ye)}o.remove(we)}function v(we){let _e=o.get(we);e.deleteTexture(_e.__webglTexture);let ye=we.source,Se=u.get(ye);delete Se[_e.__cacheKey],s.memory.textures--}function P(we){let _e=o.get(we);if(we.depthTexture)we.depthTexture.dispose();if(we.isWebGLCubeRenderTarget)for(let Se=0;Se<6;Se++){if(Array.isArray(_e.__webglFramebuffer[Se]))for(let Ne=0;Ne<_e.__webglFramebuffer[Se].length;Ne++)e.deleteFramebuffer(_e.__webglFramebuffer[Se][Ne]);else e.deleteFramebuffer(_e.__webglFramebuffer[Se]);if(_e.__webglDepthbuffer)e.deleteRenderbuffer(_e.__webglDepthbuffer[Se])}else{if(Array.isArray(_e.__webglFramebuffer))for(let Se=0;Se<_e.__webglFramebuffer.length;Se++)e.deleteFramebuffer(_e.__webglFramebuffer[Se]);else e.deleteFramebuffer(_e.__webglFramebuffer);if(_e.__webglDepthbuffer)e.deleteRenderbuffer(_e.__webglDepthbuffer);if(_e.__webglMultisampledFramebuffer)e.deleteFramebuffer(_e.__webglMultisampledFramebuffer);if(_e.__webglColorRenderbuffer){for(let Se=0;Se<_e.__webglColorRenderbuffer.length;Se++)if(_e.__webglColorRenderbuffer[Se])e.deleteRenderbuffer(_e.__webglColorRenderbuffer[Se])}if(_e.__webglDepthRenderbuffer)e.deleteRenderbuffer(_e.__webglDepthRenderbuffer)}let ye=we.textures;for(let Se=0,Ne=ye.length;Se<Ne;Se++){let ke=o.get(ye[Se]);if(ke.__webglTexture)e.deleteTexture(ke.__webglTexture),s.memory.textures--;o.remove(ye[Se])}o.remove(we)}let M=0;function B(){M=0}function T(){let we=M;if(we>=r.maxTextures)console.warn("THREE.WebGLTextures: Trying to use "+we+" texture units while this GPU supports only "+r.maxTextures);return M+=1,we}function N(we){let _e=[];return _e.push(we.wrapS),_e.push(we.wrapT),_e.push(we.wrapR||0),_e.push(we.magFilter),_e.push(we.minFilter),_e.push(we.anisotropy),_e.push(we.internalFormat),_e.push(we.format),_e.push(we.type),_e.push(we.generateMipmaps),_e.push(we.premultiplyAlpha),_e.push(we.flipY),_e.push(we.unpackAlignment),_e.push(we.colorSpace),_e.join()}function D(we,_e){let ye=o.get(we);if(we.isVideoTexture)xe(we);if(we.isRenderTargetTexture===!1&&we.version>0&&ye.__version!==we.version){let Se=we.image;if(Se===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(Se.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{K(ye,we,_e);return}}n.bindTexture(e.TEXTURE_2D,ye.__webglTexture,e.TEXTURE0+_e)}function L(we,_e){let ye=o.get(we);if(we.version>0&&ye.__version!==we.version){K(ye,we,_e);return}n.bindTexture(e.TEXTURE_2D_ARRAY,ye.__webglTexture,e.TEXTURE0+_e)}function H(we,_e){let ye=o.get(we);if(we.version>0&&ye.__version!==we.version){K(ye,we,_e);return}n.bindTexture(e.TEXTURE_3D,ye.__webglTexture,e.TEXTURE0+_e)}function V(we,_e){let ye=o.get(we);if(we.version>0&&ye.__version!==we.version){J(ye,we,_e);return}n.bindTexture(e.TEXTURE_CUBE_MAP,ye.__webglTexture,e.TEXTURE0+_e)}let O={[1000]:e.REPEAT,[1001]:e.CLAMP_TO_EDGE,[1002]:e.MIRRORED_REPEAT},U={[1003]:e.NEAREST,[1004]:e.NEAREST_MIPMAP_NEAREST,[1005]:e.NEAREST_MIPMAP_LINEAR,[1006]:e.LINEAR,[1007]:e.LINEAR_MIPMAP_NEAREST,[1008]:e.LINEAR_MIPMAP_LINEAR},j={[512]:e.NEVER,[519]:e.ALWAYS,[513]:e.LESS,[515]:e.LEQUAL,[514]:e.EQUAL,[518]:e.GEQUAL,[516]:e.GREATER,[517]:e.NOTEQUAL};function Y(we,_e){if(_e.type===1015&&t.has("OES_texture_float_linear")===!1&&(_e.magFilter===1006||_e.magFilter===1007||_e.magFilter===1005||_e.magFilter===1008||_e.minFilter===1006||_e.minFilter===1007||_e.minFilter===1005||_e.minFilter===1008))console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device.");if(e.texParameteri(we,e.TEXTURE_WRAP_S,O[_e.wrapS]),e.texParameteri(we,e.TEXTURE_WRAP_T,O[_e.wrapT]),we===e.TEXTURE_3D||we===e.TEXTURE_2D_ARRAY)e.texParameteri(we,e.TEXTURE_WRAP_R,O[_e.wrapR]);if(e.texParameteri(we,e.TEXTURE_MAG_FILTER,U[_e.magFilter]),e.texParameteri(we,e.TEXTURE_MIN_FILTER,U[_e.minFilter]),_e.compareFunction)e.texParameteri(we,e.TEXTURE_COMPARE_MODE,e.COMPARE_REF_TO_TEXTURE),e.texParameteri(we,e.TEXTURE_COMPARE_FUNC,j[_e.compareFunction]);if(t.has("EXT_texture_filter_anisotropic")===!0){if(_e.magFilter===1003)return;if(_e.minFilter!==1005&&_e.minFilter!==1008)return;if(_e.type===1015&&t.has("OES_texture_float_linear")===!1)return;if(_e.anisotropy>1||o.get(_e).__currentAnisotropy){let ye=t.get("EXT_texture_filter_anisotropic");e.texParameterf(we,ye.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(_e.anisotropy,r.getMaxAnisotropy())),o.get(_e).__currentAnisotropy=_e.anisotropy}}}function X(we,_e){let ye=!1;if(we.__webglInit===void 0)we.__webglInit=!0,_e.addEventListener("dispose",C);let Se=_e.source,Ne=u.get(Se);if(Ne===void 0)Ne={},u.set(Se,Ne);let ke=N(_e);if(ke!==we.__cacheKey){if(Ne[ke]===void 0)Ne[ke]={texture:e.createTexture(),usedTimes:0},s.memory.textures++,ye=!0;Ne[ke].usedTimes++;let nt=Ne[we.__cacheKey];if(nt!==void 0){if(Ne[we.__cacheKey].usedTimes--,nt.usedTimes===0)v(_e)}we.__cacheKey=ke,we.__webglTexture=Ne[ke].texture}return ye}function K(we,_e,ye){let Se=e.TEXTURE_2D;if(_e.isDataArrayTexture||_e.isCompressedArrayTexture)Se=e.TEXTURE_2D_ARRAY;if(_e.isData3DTexture)Se=e.TEXTURE_3D;let Ne=X(we,_e),ke=_e.source;n.bindTexture(Se,we.__webglTexture,e.TEXTURE0+ye);let nt=o.get(ke);if(ke.version!==nt.__version||Ne===!0){n.activeTexture(e.TEXTURE0+ye);let dt=Zh.getPrimaries(Zh.workingColorSpace),rt=_e.colorSpace===""?null:Zh.getPrimaries(_e.colorSpace),mt=_e.colorSpace===""||dt===rt?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,_e.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,_e.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,_e.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,mt);let lt=m(_e.image,!1,r.maxTextureSize);lt=Me(_e,lt);let Ct=i.convert(_e.format,_e.colorSpace),Nt=i.convert(_e.type),Ht=f(_e.internalFormat,Ct,Nt,_e.colorSpace,_e.isVideoTexture);Y(Se,_e);let Tt,et=_e.mipmaps,vt=_e.isVideoTexture!==!0,ht=nt.__version===void 0||Ne===!0,We=ke.dataReady,Le=x(_e,lt);if(_e.isDepthTexture){if(Ht=y(_e.format===1027,_e.type),ht)if(vt)n.texStorage2D(e.TEXTURE_2D,1,Ht,lt.width,lt.height);else n.texImage2D(e.TEXTURE_2D,0,Ht,lt.width,lt.height,0,Ct,Nt,null)}else if(_e.isDataTexture)if(et.length>0){if(vt&&ht)n.texStorage2D(e.TEXTURE_2D,Le,Ht,et[0].width,et[0].height);for(let Ze=0,$e=et.length;Ze<$e;Ze++)if(Tt=et[Ze],vt){if(We)n.texSubImage2D(e.TEXTURE_2D,Ze,0,0,Tt.width,Tt.height,Ct,Nt,Tt.data)}else n.texImage2D(e.TEXTURE_2D,Ze,Ht,Tt.width,Tt.height,0,Ct,Nt,Tt.data);_e.generateMipmaps=!1}else if(vt){if(ht)n.texStorage2D(e.TEXTURE_2D,Le,Ht,lt.width,lt.height);if(We)n.texSubImage2D(e.TEXTURE_2D,0,0,0,lt.width,lt.height,Ct,Nt,lt.data)}else n.texImage2D(e.TEXTURE_2D,0,Ht,lt.width,lt.height,0,Ct,Nt,lt.data);else if(_e.isCompressedTexture)if(_e.isCompressedArrayTexture){if(vt&&ht)n.texStorage3D(e.TEXTURE_2D_ARRAY,Le,Ht,et[0].width,et[0].height,lt.depth);for(let Ze=0,$e=et.length;Ze<$e;Ze++)if(Tt=et[Ze],_e.format!==1023)if(Ct!==null)if(vt){if(We)if(_e.layerUpdates.size>0){for(let qe of _e.layerUpdates){let ft=Tt.width*Tt.height;n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,Ze,0,0,qe,Tt.width,Tt.height,1,Ct,Tt.data.slice(ft*qe,ft*(qe+1)),0,0)}_e.clearLayerUpdates()}else n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,Ze,0,0,0,Tt.width,Tt.height,lt.depth,Ct,Tt.data,0,0)}else n.compressedTexImage3D(e.TEXTURE_2D_ARRAY,Ze,Ht,Tt.width,Tt.height,lt.depth,0,Tt.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else if(vt){if(We)n.texSubImage3D(e.TEXTURE_2D_ARRAY,Ze,0,0,0,Tt.width,Tt.height,lt.depth,Ct,Nt,Tt.data)}else n.texImage3D(e.TEXTURE_2D_ARRAY,Ze,Ht,Tt.width,Tt.height,lt.depth,0,Ct,Nt,Tt.data)}else{if(vt&&ht)n.texStorage2D(e.TEXTURE_2D,Le,Ht,et[0].width,et[0].height);for(let Ze=0,$e=et.length;Ze<$e;Ze++)if(Tt=et[Ze],_e.format!==1023)if(Ct!==null)if(vt){if(We)n.compressedTexSubImage2D(e.TEXTURE_2D,Ze,0,0,Tt.width,Tt.height,Ct,Tt.data)}else n.compressedTexImage2D(e.TEXTURE_2D,Ze,Ht,Tt.width,Tt.height,0,Tt.data);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else if(vt){if(We)n.texSubImage2D(e.TEXTURE_2D,Ze,0,0,Tt.width,Tt.height,Ct,Nt,Tt.data)}else n.texImage2D(e.TEXTURE_2D,Ze,Ht,Tt.width,Tt.height,0,Ct,Nt,Tt.data)}else if(_e.isDataArrayTexture)if(vt){if(ht)n.texStorage3D(e.TEXTURE_2D_ARRAY,Le,Ht,lt.width,lt.height,lt.depth);if(We)if(_e.layerUpdates.size>0){let Ze;switch(Nt){case e.UNSIGNED_BYTE:switch(Ct){case e.ALPHA:Ze=1;break;case e.LUMINANCE:Ze=1;break;case e.LUMINANCE_ALPHA:Ze=2;break;case e.RGB:Ze=3;break;case e.RGBA:Ze=4;break;default:throw Error(`Unknown texel size for format ${Ct}.`)}break;case e.UNSIGNED_SHORT_4_4_4_4:case e.UNSIGNED_SHORT_5_5_5_1:case e.UNSIGNED_SHORT_5_6_5:Ze=1;break;default:throw Error(`Unknown texel size for type ${Nt}.`)}let $e=lt.width*lt.height*Ze;for(let qe of _e.layerUpdates)n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,qe,lt.width,lt.height,1,Ct,Nt,lt.data.slice($e*qe,$e*(qe+1)));_e.clearLayerUpdates()}else n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,0,lt.width,lt.height,lt.depth,Ct,Nt,lt.data)}else n.texImage3D(e.TEXTURE_2D_ARRAY,0,Ht,lt.width,lt.height,lt.depth,0,Ct,Nt,lt.data);else if(_e.isData3DTexture)if(vt){if(ht)n.texStorage3D(e.TEXTURE_3D,Le,Ht,lt.width,lt.height,lt.depth);if(We)n.texSubImage3D(e.TEXTURE_3D,0,0,0,0,lt.width,lt.height,lt.depth,Ct,Nt,lt.data)}else n.texImage3D(e.TEXTURE_3D,0,Ht,lt.width,lt.height,lt.depth,0,Ct,Nt,lt.data);else if(_e.isFramebufferTexture){if(ht)if(vt)n.texStorage2D(e.TEXTURE_2D,Le,Ht,lt.width,lt.height);else{let Ze=lt.width,$e=lt.height;for(let qe=0;qe<Le;qe++)n.texImage2D(e.TEXTURE_2D,qe,Ht,Ze,$e,0,Ct,Nt,null),Ze>>=1,$e>>=1}}else if(et.length>0){if(vt&&ht){let Ze=Re(et[0]);n.texStorage2D(e.TEXTURE_2D,Le,Ht,Ze.width,Ze.height)}for(let Ze=0,$e=et.length;Ze<$e;Ze++)if(Tt=et[Ze],vt){if(We)n.texSubImage2D(e.TEXTURE_2D,Ze,0,0,Ct,Nt,Tt)}else n.texImage2D(e.TEXTURE_2D,Ze,Ht,Ct,Nt,Tt);_e.generateMipmaps=!1}else if(vt){if(ht){let Ze=Re(lt);n.texStorage2D(e.TEXTURE_2D,Le,Ht,Ze.width,Ze.height)}if(We)n.texSubImage2D(e.TEXTURE_2D,0,0,0,Ct,Nt,lt)}else n.texImage2D(e.TEXTURE_2D,0,Ht,Ct,Nt,lt);if(A(_e))g(Se);if(nt.__version=ke.version,_e.onUpdate)_e.onUpdate(_e)}we.__version=_e.version}function J(we,_e,ye){if(_e.image.length!==6)return;let Se=X(we,_e),Ne=_e.source;n.bindTexture(e.TEXTURE_CUBE_MAP,we.__webglTexture,e.TEXTURE0+ye);let ke=o.get(Ne);if(Ne.version!==ke.__version||Se===!0){n.activeTexture(e.TEXTURE0+ye);let nt=Zh.getPrimaries(Zh.workingColorSpace),dt=_e.colorSpace===""?null:Zh.getPrimaries(_e.colorSpace),rt=_e.colorSpace===""||nt===dt?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,_e.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,_e.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,_e.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,rt);let mt=_e.isCompressedTexture||_e.image[0].isCompressedTexture,lt=_e.image[0]&&_e.image[0].isDataTexture,Ct=[];for(let $e=0;$e<6;$e++){if(!mt&&!lt)Ct[$e]=m(_e.image[$e],!0,r.maxCubemapSize);else Ct[$e]=lt?_e.image[$e].image:_e.image[$e];Ct[$e]=Me(_e,Ct[$e])}let Nt=Ct[0],Ht=i.convert(_e.format,_e.colorSpace),Tt=i.convert(_e.type),et=f(_e.internalFormat,Ht,Tt,_e.colorSpace),vt=_e.isVideoTexture!==!0,ht=ke.__version===void 0||Se===!0,We=Ne.dataReady,Le=x(_e,Nt);Y(e.TEXTURE_CUBE_MAP,_e);let Ze;if(mt){if(vt&&ht)n.texStorage2D(e.TEXTURE_CUBE_MAP,Le,et,Nt.width,Nt.height);for(let $e=0;$e<6;$e++){Ze=Ct[$e].mipmaps;for(let qe=0;qe<Ze.length;qe++){let ft=Ze[qe];if(_e.format!==1023)if(Ht!==null)if(vt){if(We)n.compressedTexSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+$e,qe,0,0,ft.width,ft.height,Ht,ft.data)}else n.compressedTexImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+$e,qe,et,ft.width,ft.height,0,ft.data);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()");else if(vt){if(We)n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+$e,qe,0,0,ft.width,ft.height,Ht,Tt,ft.data)}else n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+$e,qe,et,ft.width,ft.height,0,Ht,Tt,ft.data)}}}else{if(Ze=_e.mipmaps,vt&&ht){if(Ze.length>0)Le++;let $e=Re(Ct[0]);n.texStorage2D(e.TEXTURE_CUBE_MAP,Le,et,$e.width,$e.height)}for(let $e=0;$e<6;$e++)if(lt){if(vt){if(We)n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+$e,0,0,0,Ct[$e].width,Ct[$e].height,Ht,Tt,Ct[$e].data)}else n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+$e,0,et,Ct[$e].width,Ct[$e].height,0,Ht,Tt,Ct[$e].data);for(let qe=0;qe<Ze.length;qe++){let It=Ze[qe].image[$e].image;if(vt){if(We)n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+$e,qe+1,0,0,It.width,It.height,Ht,Tt,It.data)}else n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+$e,qe+1,et,It.width,It.height,0,Ht,Tt,It.data)}}else{if(vt){if(We)n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+$e,0,0,0,Ht,Tt,Ct[$e])}else n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+$e,0,et,Ht,Tt,Ct[$e]);for(let qe=0;qe<Ze.length;qe++){let ft=Ze[qe];if(vt){if(We)n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+$e,qe+1,0,0,Ht,Tt,ft.image[$e])}else n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+$e,qe+1,et,Ht,Tt,ft.image[$e])}}}if(A(_e))g(e.TEXTURE_CUBE_MAP);if(ke.__version=Ne.version,_e.onUpdate)_e.onUpdate(_e)}we.__version=_e.version}function ee(we,_e,ye,Se,Ne,ke){let nt=i.convert(ye.format,ye.colorSpace),dt=i.convert(ye.type),rt=f(ye.internalFormat,nt,dt,ye.colorSpace);if(!o.get(_e).__hasExternalTextures){let lt=Math.max(1,_e.width>>ke),Ct=Math.max(1,_e.height>>ke);if(Ne===e.TEXTURE_3D||Ne===e.TEXTURE_2D_ARRAY)n.texImage3D(Ne,ke,rt,lt,Ct,_e.depth,0,nt,dt,null);else n.texImage2D(Ne,ke,rt,lt,Ct,0,nt,dt,null)}if(n.bindFramebuffer(e.FRAMEBUFFER,we),Ae(_e))a.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,Se,Ne,o.get(ye).__webglTexture,0,me(_e));else if(Ne===e.TEXTURE_2D||Ne>=e.TEXTURE_CUBE_MAP_POSITIVE_X&&Ne<=e.TEXTURE_CUBE_MAP_NEGATIVE_Z)e.framebufferTexture2D(e.FRAMEBUFFER,Se,Ne,o.get(ye).__webglTexture,ke);n.bindFramebuffer(e.FRAMEBUFFER,null)}function se(we,_e,ye){if(e.bindRenderbuffer(e.RENDERBUFFER,we),_e.depthBuffer){let Se=_e.depthTexture,Ne=Se&&Se.isDepthTexture?Se.type:null,ke=y(_e.stencilBuffer,Ne),nt=_e.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,dt=me(_e);if(Ae(_e))a.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,dt,ke,_e.width,_e.height);else if(ye)e.renderbufferStorageMultisample(e.RENDERBUFFER,dt,ke,_e.width,_e.height);else e.renderbufferStorage(e.RENDERBUFFER,ke,_e.width,_e.height);e.framebufferRenderbuffer(e.FRAMEBUFFER,nt,e.RENDERBUFFER,we)}else{let Se=_e.textures;for(let Ne=0;Ne<Se.length;Ne++){let ke=Se[Ne],nt=i.convert(ke.format,ke.colorSpace),dt=i.convert(ke.type),rt=f(ke.internalFormat,nt,dt,ke.colorSpace),mt=me(_e);if(ye&&Ae(_e)===!1)e.renderbufferStorageMultisample(e.RENDERBUFFER,mt,rt,_e.width,_e.height);else if(Ae(_e))a.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,mt,rt,_e.width,_e.height);else e.renderbufferStorage(e.RENDERBUFFER,rt,_e.width,_e.height)}}e.bindRenderbuffer(e.RENDERBUFFER,null)}function ne(we,_e){if(_e&&_e.isWebGLCubeRenderTarget)throw Error("Depth Texture with cube render targets is not supported");if(n.bindFramebuffer(e.FRAMEBUFFER,we),!(_e.depthTexture&&_e.depthTexture.isDepthTexture))throw Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");if(!o.get(_e.depthTexture).__webglTexture||_e.depthTexture.image.width!==_e.width||_e.depthTexture.image.height!==_e.height)_e.depthTexture.image.width=_e.width,_e.depthTexture.image.height=_e.height,_e.depthTexture.needsUpdate=!0;D(_e.depthTexture,0);let Se=o.get(_e.depthTexture).__webglTexture,Ne=me(_e);if(_e.depthTexture.format===1026)if(Ae(_e))a.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,Se,0,Ne);else e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,Se,0);else if(_e.depthTexture.format===1027)if(Ae(_e))a.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.TEXTURE_2D,Se,0,Ne);else e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.TEXTURE_2D,Se,0);else throw Error("Unknown depthTexture format")}function re(we){let _e=o.get(we),ye=we.isWebGLCubeRenderTarget===!0;if(we.depthTexture&&!_e.__autoAllocateDepthBuffer){if(ye)throw Error("target.depthTexture not supported in Cube render targets");ne(_e.__webglFramebuffer,we)}else if(ye){_e.__webglDepthbuffer=[];for(let Se=0;Se<6;Se++)n.bindFramebuffer(e.FRAMEBUFFER,_e.__webglFramebuffer[Se]),_e.__webglDepthbuffer[Se]=e.createRenderbuffer(),se(_e.__webglDepthbuffer[Se],we,!1)}else n.bindFramebuffer(e.FRAMEBUFFER,_e.__webglFramebuffer),_e.__webglDepthbuffer=e.createRenderbuffer(),se(_e.__webglDepthbuffer,we,!1);n.bindFramebuffer(e.FRAMEBUFFER,null)}function Z(we,_e,ye){let Se=o.get(we);if(_e!==void 0)ee(Se.__webglFramebuffer,we,we.texture,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,0);if(ye!==void 0)re(we)}function te(we){let _e=we.texture,ye=o.get(we),Se=o.get(_e);we.addEventListener("dispose",b);let Ne=we.textures,ke=we.isWebGLCubeRenderTarget===!0,nt=Ne.length>1;if(!nt){if(Se.__webglTexture===void 0)Se.__webglTexture=e.createTexture();Se.__version=_e.version,s.memory.textures++}if(ke){ye.__webglFramebuffer=[];for(let dt=0;dt<6;dt++)if(_e.mipmaps&&_e.mipmaps.length>0){ye.__webglFramebuffer[dt]=[];for(let rt=0;rt<_e.mipmaps.length;rt++)ye.__webglFramebuffer[dt][rt]=e.createFramebuffer()}else ye.__webglFramebuffer[dt]=e.createFramebuffer()}else{if(_e.mipmaps&&_e.mipmaps.length>0){ye.__webglFramebuffer=[];for(let dt=0;dt<_e.mipmaps.length;dt++)ye.__webglFramebuffer[dt]=e.createFramebuffer()}else ye.__webglFramebuffer=e.createFramebuffer();if(nt)for(let dt=0,rt=Ne.length;dt<rt;dt++){let mt=o.get(Ne[dt]);if(mt.__webglTexture===void 0)mt.__webglTexture=e.createTexture(),s.memory.textures++}if(we.samples>0&&Ae(we)===!1){ye.__webglMultisampledFramebuffer=e.createFramebuffer(),ye.__webglColorRenderbuffer=[],n.bindFramebuffer(e.FRAMEBUFFER,ye.__webglMultisampledFramebuffer);for(let dt=0;dt<Ne.length;dt++){let rt=Ne[dt];ye.__webglColorRenderbuffer[dt]=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,ye.__webglColorRenderbuffer[dt]);let mt=i.convert(rt.format,rt.colorSpace),lt=i.convert(rt.type),Ct=f(rt.internalFormat,mt,lt,rt.colorSpace,we.isXRRenderTarget===!0),Nt=me(we);e.renderbufferStorageMultisample(e.RENDERBUFFER,Nt,Ct,we.width,we.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+dt,e.RENDERBUFFER,ye.__webglColorRenderbuffer[dt])}if(e.bindRenderbuffer(e.RENDERBUFFER,null),we.depthBuffer)ye.__webglDepthRenderbuffer=e.createRenderbuffer(),se(ye.__webglDepthRenderbuffer,we,!0);n.bindFramebuffer(e.FRAMEBUFFER,null)}}if(ke){n.bindTexture(e.TEXTURE_CUBE_MAP,Se.__webglTexture),Y(e.TEXTURE_CUBE_MAP,_e);for(let dt=0;dt<6;dt++)if(_e.mipmaps&&_e.mipmaps.length>0)for(let rt=0;rt<_e.mipmaps.length;rt++)ee(ye.__webglFramebuffer[dt][rt],we,_e,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+dt,rt);else ee(ye.__webglFramebuffer[dt],we,_e,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+dt,0);if(A(_e))g(e.TEXTURE_CUBE_MAP);n.unbindTexture()}else if(nt){for(let dt=0,rt=Ne.length;dt<rt;dt++){let mt=Ne[dt],lt=o.get(mt);if(n.bindTexture(e.TEXTURE_2D,lt.__webglTexture),Y(e.TEXTURE_2D,mt),ee(ye.__webglFramebuffer,we,mt,e.COLOR_ATTACHMENT0+dt,e.TEXTURE_2D,0),A(mt))g(e.TEXTURE_2D)}n.unbindTexture()}else{let dt=e.TEXTURE_2D;if(we.isWebGL3DRenderTarget||we.isWebGLArrayRenderTarget)dt=we.isWebGL3DRenderTarget?e.TEXTURE_3D:e.TEXTURE_2D_ARRAY;if(n.bindTexture(dt,Se.__webglTexture),Y(dt,_e),_e.mipmaps&&_e.mipmaps.length>0)for(let rt=0;rt<_e.mipmaps.length;rt++)ee(ye.__webglFramebuffer[rt],we,_e,e.COLOR_ATTACHMENT0,dt,rt);else ee(ye.__webglFramebuffer,we,_e,e.COLOR_ATTACHMENT0,dt,0);if(A(_e))g(dt);n.unbindTexture()}if(we.depthBuffer)re(we)}function ie(we){let _e=we.textures;for(let ye=0,Se=_e.length;ye<Se;ye++){let Ne=_e[ye];if(A(Ne)){let ke=we.isWebGLCubeRenderTarget?e.TEXTURE_CUBE_MAP:e.TEXTURE_2D,nt=o.get(Ne).__webglTexture;n.bindTexture(ke,nt),g(ke),n.unbindTexture()}}}let le=[],ue=[];function de(we){if(we.samples>0){if(Ae(we)===!1){let{textures:_e,width:ye,height:Se}=we,Ne=e.COLOR_BUFFER_BIT,ke=we.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,nt=o.get(we),dt=_e.length>1;if(dt)for(let rt=0;rt<_e.length;rt++)n.bindFramebuffer(e.FRAMEBUFFER,nt.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+rt,e.RENDERBUFFER,null),n.bindFramebuffer(e.FRAMEBUFFER,nt.__webglFramebuffer),e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0+rt,e.TEXTURE_2D,null,0);n.bindFramebuffer(e.READ_FRAMEBUFFER,nt.__webglMultisampledFramebuffer),n.bindFramebuffer(e.DRAW_FRAMEBUFFER,nt.__webglFramebuffer);for(let rt=0;rt<_e.length;rt++){if(we.resolveDepthBuffer){if(we.depthBuffer)Ne|=e.DEPTH_BUFFER_BIT;if(we.stencilBuffer&&we.resolveStencilBuffer)Ne|=e.STENCIL_BUFFER_BIT}if(dt){e.framebufferRenderbuffer(e.READ_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.RENDERBUFFER,nt.__webglColorRenderbuffer[rt]);let mt=o.get(_e[rt]).__webglTexture;e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,mt,0)}if(e.blitFramebuffer(0,0,ye,Se,0,0,ye,Se,Ne,e.NEAREST),c===!0){if(le.length=0,ue.length=0,le.push(e.COLOR_ATTACHMENT0+rt),we.depthBuffer&&we.resolveDepthBuffer===!1)le.push(ke),ue.push(ke),e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER,ue);e.invalidateFramebuffer(e.READ_FRAMEBUFFER,le)}}if(n.bindFramebuffer(e.READ_FRAMEBUFFER,null),n.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),dt)for(let rt=0;rt<_e.length;rt++){n.bindFramebuffer(e.FRAMEBUFFER,nt.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+rt,e.RENDERBUFFER,nt.__webglColorRenderbuffer[rt]);let mt=o.get(_e[rt]).__webglTexture;n.bindFramebuffer(e.FRAMEBUFFER,nt.__webglFramebuffer),e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0+rt,e.TEXTURE_2D,mt,0)}n.bindFramebuffer(e.DRAW_FRAMEBUFFER,nt.__webglMultisampledFramebuffer)}else if(we.depthBuffer&&we.resolveDepthBuffer===!1&&c){let _e=we.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER,[_e])}}}function me(we){return Math.min(r.maxSamples,we.samples)}function Ae(we){let _e=o.get(we);return we.samples>0&&t.has("WEBGL_multisampled_render_to_texture")===!0&&_e.__useRenderToTexture!==!1}function xe(we){let _e=s.render.frame;if(h.get(we)!==_e)h.set(we,_e),we.update()}function Me(we,_e){let{colorSpace:ye,format:Se,type:Ne}=we;if(we.isCompressedTexture===!0||we.isVideoTexture===!0)return _e;if(ye!=="srgb-linear"&&ye!=="")if(Zh.getTransfer(ye)==="srgb"){if(Se!==1023||Ne!==1009)console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType.")}else console.error("THREE.WebGLTextures: Unsupported texture color space:",ye);return _e}function Re(we){if(typeof HTMLImageElement<"u"&&we instanceof HTMLImageElement)l.width=we.naturalWidth||we.width,l.height=we.naturalHeight||we.height;else if(typeof VideoFrame<"u"&&we instanceof VideoFrame)l.width=we.displayWidth,l.height=we.displayHeight;else l.width=we.width,l.height=we.height;return l}this.allocateTextureUnit=T,this.resetTextureUnits=B,this.setTexture2D=D,this.setTexture2DArray=L,this.setTexture3D=H,this.setTextureCube=V,this.rebindTextures=Z,this.setupRenderTarget=te,this.updateRenderTargetMipmap=ie,this.updateMultisampleRenderTarget=de,this.setupDepthRenderbuffer=re,this.setupFrameBufferTexture=ee,this.useMultisampledRTT=Ae}function z6o(e,t){function n(o,r=""){let i,s=Zh.getTransfer(r);if(o===1009)return e.UNSIGNED_BYTE;if(o===1017)return e.UNSIGNED_SHORT_4_4_4_4;if(o===1018)return e.UNSIGNED_SHORT_5_5_5_1;if(o===35902)return e.UNSIGNED_INT_5_9_9_9_REV;if(o===1010)return e.BYTE;if(o===1011)return e.SHORT;if(o===1012)return e.UNSIGNED_SHORT;if(o===1013)return e.INT;if(o===1014)return e.UNSIGNED_INT;if(o===1015)return e.FLOAT;if(o===1016)return e.HALF_FLOAT;if(o===1021)return e.ALPHA;if(o===1022)return e.RGB;if(o===1023)return e.RGBA;if(o===1024)return e.LUMINANCE;if(o===1025)return e.LUMINANCE_ALPHA;if(o===1026)return e.DEPTH_COMPONENT;if(o===1027)return e.DEPTH_STENCIL;if(o===1028)return e.RED;if(o===1029)return e.RED_INTEGER;if(o===1030)return e.RG;if(o===1031)return e.RG_INTEGER;if(o===1033)return e.RGBA_INTEGER;if(o===33776||o===33777||o===33778||o===33779)if(s==="srgb")if(i=t.get("WEBGL_compressed_texture_s3tc_srgb"),i!==null){if(o===33776)return i.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(o===33777)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(o===33778)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(o===33779)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(i=t.get("WEBGL_compressed_texture_s3tc"),i!==null){if(o===33776)return i.COMPRESSED_RGB_S3TC_DXT1_EXT;if(o===33777)return i.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(o===33778)return i.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(o===33779)return i.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(o===35840||o===35841||o===35842||o===35843)if(i=t.get("WEBGL_compressed_texture_pvrtc"),i!==null){if(o===35840)return i.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(o===35841)return i.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(o===35842)return i.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(o===35843)return i.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(o===36196||o===37492||o===37496)if(i=t.get("WEBGL_compressed_texture_etc"),i!==null){if(o===36196||o===37492)return s==="srgb"?i.COMPRESSED_SRGB8_ETC2:i.COMPRESSED_RGB8_ETC2;if(o===37496)return s==="srgb"?i.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:i.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(o===37808||o===37809||o===37810||o===37811||o===37812||o===37813||o===37814||o===37815||o===37816||o===37817||o===37818||o===37819||o===37820||o===37821)if(i=t.get("WEBGL_compressed_texture_astc"),i!==null){if(o===37808)return s==="srgb"?i.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:i.COMPRESSED_RGBA_ASTC_4x4_KHR;if(o===37809)return s==="srgb"?i.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:i.COMPRESSED_RGBA_ASTC_5x4_KHR;if(o===37810)return s==="srgb"?i.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:i.COMPRESSED_RGBA_ASTC_5x5_KHR;if(o===37811)return s==="srgb"?i.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:i.COMPRESSED_RGBA_ASTC_6x5_KHR;if(o===37812)return s==="srgb"?i.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:i.COMPRESSED_RGBA_ASTC_6x6_KHR;if(o===37813)return s==="srgb"?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:i.COMPRESSED_RGBA_ASTC_8x5_KHR;if(o===37814)return s==="srgb"?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:i.COMPRESSED_RGBA_ASTC_8x6_KHR;if(o===37815)return s==="srgb"?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:i.COMPRESSED_RGBA_ASTC_8x8_KHR;if(o===37816)return s==="srgb"?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:i.COMPRESSED_RGBA_ASTC_10x5_KHR;if(o===37817)return s==="srgb"?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:i.COMPRESSED_RGBA_ASTC_10x6_KHR;if(o===37818)return s==="srgb"?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:i.COMPRESSED_RGBA_ASTC_10x8_KHR;if(o===37819)return s==="srgb"?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:i.COMPRESSED_RGBA_ASTC_10x10_KHR;if(o===37820)return s==="srgb"?i.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:i.COMPRESSED_RGBA_ASTC_12x10_KHR;if(o===37821)return s==="srgb"?i.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:i.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(o===36492||o===36494||o===36495)if(i=t.get("EXT_texture_compression_bptc"),i!==null){if(o===36492)return s==="srgb"?i.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:i.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(o===36494)return i.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(o===36495)return i.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(o===36283||o===36284||o===36285||o===36286)if(i=t.get("EXT_texture_compression_rgtc"),i!==null){if(o===36492)return i.COMPRESSED_RED_RGTC1_EXT;if(o===36284)return i.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(o===36285)return i.COMPRESSED_RED_GREEN_RGTC2_EXT;if(o===36286)return i.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;if(o===1020)return e.UNSIGNED_INT_24_8;return e[o]!==void 0?e[o]:null}return{convert:n}}class b5t extends Pc{constructor(e=[]){super();this.isArrayCamera=!0,this.cameras=e}}class Ba extends Sl{constructor(){super();this.isGroup=!0,this.type="Group"}}var O6o={type:"move"};class wAe{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){if(this._hand===null)this._hand=new Ba,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1};return this._hand}getTargetRaySpace(){if(this._targetRay===null)this._targetRay=new Ba,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new Et,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new Et;return this._targetRay}getGripSpace(){if(this._grip===null)this._grip=new Ba,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new Et,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new Et;return this._grip}dispatchEvent(e){if(this._targetRay!==null)this._targetRay.dispatchEvent(e);if(this._grip!==null)this._grip.dispatchEvent(e);if(this._hand!==null)this._hand.dispatchEvent(e);return this}connect(e){if(e&&e.hand){let t=this._hand;if(t)for(let n of e.hand.values())this._getHandJoint(t,n)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){if(this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null)this._targetRay.visible=!1;if(this._grip!==null)this._grip.visible=!1;if(this._hand!==null)this._hand.visible=!1;return this}update(e,t,n){let o=null,r=null,i=null,s=this._targetRay,a=this._grip,c=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(c&&e.hand){i=!0;for(let p of e.hand.values()){let m=t.getJointPose(p,n),A=this._getHandJoint(c,p);if(m!==null)A.matrix.fromArray(m.transform.matrix),A.matrix.decompose(A.position,A.rotation,A.scale),A.matrixWorldNeedsUpdate=!0,A.jointRadius=m.radius;A.visible=m!==null}let l=c.joints["index-finger-tip"],h=c.joints["thumb-tip"],d=l.position.distanceTo(h.position),u=0.02,_=0.005;if(c.inputState.pinching&&d>u+_)c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this});else if(!c.inputState.pinching&&d<=u-_)c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this})}else if(a!==null&&e.gripSpace){if(r=t.getPose(e.gripSpace,n),r!==null){if(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,r.linearVelocity)a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity);else a.hasLinearVelocity=!1;if(r.angularVelocity)a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity);else a.hasAngularVelocity=!1}}if(s!==null){if(o=t.getPose(e.targetRaySpace,n),o===null&&r!==null)o=r;if(o!==null){if(s.matrix.fromArray(o.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,o.linearVelocity)s.hasLinearVelocity=!0,s.linearVelocity.copy(o.linearVelocity);else s.hasLinearVelocity=!1;if(o.angularVelocity)s.hasAngularVelocity=!0,s.angularVelocity.copy(o.angularVelocity);else s.hasAngularVelocity=!1;this.dispatchEvent(O6o)}}}if(s!==null)s.visible=o!==null;if(a!==null)a.visible=r!==null;if(c!==null)c.visible=i!==null;return this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){let n=new Ba;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}var V6o=`
void main() {

	gl_Position = vec4( position, 1.0 );

}`,Y6o=`
uniform sampler2DArray depthColor;
uniform float depthWidth;
uniform float depthHeight;

void main() {

	vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );

	if ( coord.x >= 1.0 ) {

		gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;

	} else {

		gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;

	}

}`;class I5t{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,n){if(this.texture===null){let o=new vl,r=e.properties.get(o);if(r.__webglTexture=t.texture,t.depthNear!=n.depthNear||t.depthFar!=n.depthFar)this.depthNear=t.depthNear,this.depthFar=t.depthFar;this.texture=o}}getMesh(e){if(this.texture!==null){if(this.mesh===null){let t=e.cameras[0].viewport,n=new l3({vertexShader:V6o,fragmentShader:Y6o,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new Mo(new i1(20,20),n)}}return this.mesh}reset(){this.texture=null,this.mesh=null}}class v5t extends uw{constructor(e,t){super();let n=this,o=null,r=1,i=null,s="local-floor",a=1,c=null,l=null,h=null,d=null,u=null,_=null,p=new I5t,m=t.getContextAttributes(),A=null,g=null,f=[],y=[],x=new ro,C=null,b=new Pc;b.layers.enable(1),b.viewport=new zh;let I=new Pc;I.layers.enable(2),I.viewport=new zh;let v=[b,I],P=new b5t;P.layers.enable(1),P.layers.enable(2);let M=null,B=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(K){let J=f[K];if(J===void 0)J=new wAe,f[K]=J;return J.getTargetRaySpace()},this.getControllerGrip=function(K){let J=f[K];if(J===void 0)J=new wAe,f[K]=J;return J.getGripSpace()},this.getHand=function(K){let J=f[K];if(J===void 0)J=new wAe,f[K]=J;return J.getHandSpace()};function T(K){let J=y.indexOf(K.inputSource);if(J===-1)return;let ee=f[J];if(ee!==void 0)ee.update(K.inputSource,K.frame,c||i),ee.dispatchEvent({type:K.type,data:K.inputSource})}function N(){o.removeEventListener("select",T),o.removeEventListener("selectstart",T),o.removeEventListener("selectend",T),o.removeEventListener("squeeze",T),o.removeEventListener("squeezestart",T),o.removeEventListener("squeezeend",T),o.removeEventListener("end",N),o.removeEventListener("inputsourceschange",D);for(let K=0;K<f.length;K++){let J=y[K];if(J===null)continue;y[K]=null,f[K].disconnect(J)}M=null,B=null,p.reset(),e.setRenderTarget(A),u=null,d=null,h=null,o=null,g=null,X.stop(),n.isPresenting=!1,e.setPixelRatio(C),e.setSize(x.width,x.height,!1),n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(K){if(r=K,n.isPresenting===!0)console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(K){if(s=K,n.isPresenting===!0)console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return c||i},this.setReferenceSpace=function(K){c=K},this.getBaseLayer=function(){return d!==null?d:u},this.getBinding=function(){return h},this.getFrame=function(){return _},this.getSession=function(){return o},this.setSession=async function(K){if(o=K,o!==null){if(A=e.getRenderTarget(),o.addEventListener("select",T),o.addEventListener("selectstart",T),o.addEventListener("selectend",T),o.addEventListener("squeeze",T),o.addEventListener("squeezestart",T),o.addEventListener("squeezeend",T),o.addEventListener("end",N),o.addEventListener("inputsourceschange",D),m.xrCompatible!==!0)await t.makeXRCompatible();if(C=e.getPixelRatio(),e.getSize(x),o.renderState.layers===void 0){let J={antialias:m.antialias,alpha:!0,depth:m.depth,stencil:m.stencil,framebufferScaleFactor:r};u=new XRWebGLLayer(o,t,J),o.updateRenderState({baseLayer:u}),e.setPixelRatio(1),e.setSize(u.framebufferWidth,u.framebufferHeight,!1),g=new uR(u.framebufferWidth,u.framebufferHeight,{format:1023,type:1009,colorSpace:e.outputColorSpace,stencilBuffer:m.stencil})}else{let J=null,ee=null,se=null;if(m.depth)se=m.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,J=m.stencil?1027:1026,ee=m.stencil?1020:1014;let ne={colorFormat:t.RGBA8,depthFormat:se,scaleFactor:r};h=new XRWebGLBinding(o,t),d=h.createProjectionLayer(ne),o.updateRenderState({layers:[d]}),e.setPixelRatio(1),e.setSize(d.textureWidth,d.textureHeight,!1),g=new uR(d.textureWidth,d.textureHeight,{format:1023,type:1009,depthTexture:new IQe(d.textureWidth,d.textureHeight,ee,void 0,void 0,void 0,void 0,void 0,void 0,J),stencilBuffer:m.stencil,colorSpace:e.outputColorSpace,samples:m.antialias?4:0,resolveDepthBuffer:d.ignoreDepthValues===!1})}g.isXRRenderTarget=!0,this.setFoveation(a),c=null,i=await o.requestReferenceSpace(s),X.setContext(o),X.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(o!==null)return o.environmentBlendMode};function D(K){for(let J=0;J<K.removed.length;J++){let ee=K.removed[J],se=y.indexOf(ee);if(se>=0)y[se]=null,f[se].disconnect(ee)}for(let J=0;J<K.added.length;J++){let ee=K.added[J],se=y.indexOf(ee);if(se===-1){for(let re=0;re<f.length;re++)if(re>=y.length){y.push(ee),se=re;break}else if(y[re]===null){y[re]=ee,se=re;break}if(se===-1)break}let ne=f[se];if(ne)ne.connect(ee)}}let L=new Et,H=new Et;function V(K,J,ee){L.setFromMatrixPosition(J.matrixWorld),H.setFromMatrixPosition(ee.matrixWorld);let se=L.distanceTo(H),ne=J.projectionMatrix.elements,re=ee.projectionMatrix.elements,Z=ne[14]/(ne[10]-1),te=ne[14]/(ne[10]+1),ie=(ne[9]+1)/ne[5],le=(ne[9]-1)/ne[5],ue=(ne[8]-1)/ne[0],de=(re[8]+1)/re[0],me=Z*ue,Ae=Z*de,xe=se/(-ue+de),Me=xe*-ue;J.matrixWorld.decompose(K.position,K.quaternion,K.scale),K.translateX(Me),K.translateZ(xe),K.matrixWorld.compose(K.position,K.quaternion,K.scale),K.matrixWorldInverse.copy(K.matrixWorld).invert();let Re=Z+xe,we=te+xe,_e=me-Me,ye=Ae+(se-Me),Se=ie*te/we*Re,Ne=le*te/we*Re;K.projectionMatrix.makePerspective(_e,ye,Se,Ne,Re,we),K.projectionMatrixInverse.copy(K.projectionMatrix).invert()}function O(K,J){if(J===null)K.matrixWorld.copy(K.matrix);else K.matrixWorld.multiplyMatrices(J.matrixWorld,K.matrix);K.matrixWorldInverse.copy(K.matrixWorld).invert()}this.updateCamera=function(K){if(o===null)return;if(p.texture!==null)K.near=p.depthNear,K.far=p.depthFar;if(P.near=I.near=b.near=K.near,P.far=I.far=b.far=K.far,M!==P.near||B!==P.far)o.updateRenderState({depthNear:P.near,depthFar:P.far}),M=P.near,B=P.far,b.near=M,b.far=B,I.near=M,I.far=B,b.updateProjectionMatrix(),I.updateProjectionMatrix(),K.updateProjectionMatrix();let J=K.parent,ee=P.cameras;O(P,J);for(let se=0;se<ee.length;se++)O(ee[se],J);if(ee.length===2)V(P,b,I);else P.projectionMatrix.copy(b.projectionMatrix);U(K,P,J)};function U(K,J,ee){if(ee===null)K.matrix.copy(J.matrixWorld);else K.matrix.copy(ee.matrixWorld),K.matrix.invert(),K.matrix.multiply(J.matrixWorld);if(K.matrix.decompose(K.position,K.quaternion,K.scale),K.updateMatrixWorld(!0),K.projectionMatrix.copy(J.projectionMatrix),K.projectionMatrixInverse.copy(J.projectionMatrixInverse),K.isPerspectiveCamera)K.fov=$X*2*Math.atan(1/K.projectionMatrix.elements[5]),K.zoom=1}this.getCamera=function(){return P},this.getFoveation=function(){if(d===null&&u===null)return;return a},this.setFoveation=function(K){if(a=K,d!==null)d.fixedFoveation=K;if(u!==null&&u.fixedFoveation!==void 0)u.fixedFoveation=K},this.hasDepthSensing=function(){return p.texture!==null},this.getDepthSensingMesh=function(){return p.getMesh(P)};let j=null;function Y(K,J){if(l=J.getViewerPose(c||i),_=J,l!==null){let ee=l.views;if(u!==null)e.setRenderTargetFramebuffer(g,u.framebuffer),e.setRenderTarget(g);let se=!1;if(ee.length!==P.cameras.length)P.cameras.length=0,se=!0;for(let re=0;re<ee.length;re++){let Z=ee[re],te=null;if(u!==null)te=u.getViewport(Z);else{let le=h.getViewSubImage(d,Z);if(te=le.viewport,re===0)e.setRenderTargetTextures(g,le.colorTexture,d.ignoreDepthValues?void 0:le.depthStencilTexture),e.setRenderTarget(g)}let ie=v[re];if(ie===void 0)ie=new Pc,ie.layers.enable(re),ie.viewport=new zh,v[re]=ie;if(ie.matrix.fromArray(Z.transform.matrix),ie.matrix.decompose(ie.position,ie.quaternion,ie.scale),ie.projectionMatrix.fromArray(Z.projectionMatrix),ie.projectionMatrixInverse.copy(ie.projectionMatrix).invert(),ie.viewport.set(te.x,te.y,te.width,te.height),re===0)P.matrix.copy(ie.matrix),P.matrix.decompose(P.position,P.quaternion,P.scale);if(se===!0)P.cameras.push(ie)}let ne=o.enabledFeatures;if(ne&&ne.includes("depth-sensing")){let re=h.getDepthInformation(ee[0]);if(re&&re.isValid&&re.texture)p.init(e,re,o.renderState)}}for(let ee=0;ee<f.length;ee++){let se=y[ee],ne=f[ee];if(se!==null&&ne!==void 0)ne.update(se,J,c||i)}if(j)j(K,J);if(J.detectedPlanes)n.dispatchEvent({type:"planesdetected",data:J});_=null}let X=new d5t;X.setAnimationLoop(Y),this.setAnimationLoop=function(K){j=K},this.dispose=function(){}}}var vz=new FA,G6o=new Gi;function U6o(e,t){function n(A,g){if(A.matrixAutoUpdate===!0)A.updateMatrix();g.value.copy(A.matrix)}function o(A,g){if(g.color.getRGB(A.fogColor.value,c5t(e)),g.isFog)A.fogNear.value=g.near,A.fogFar.value=g.far;else if(g.isFogExp2)A.fogDensity.value=g.density}function r(A,g,f,y,x){if(g.isMeshBasicMaterial)i(A,g);else if(g.isMeshLambertMaterial)i(A,g);else if(g.isMeshToonMaterial)i(A,g),d(A,g);else if(g.isMeshPhongMaterial)i(A,g),h(A,g);else if(g.isMeshStandardMaterial){if(i(A,g),u(A,g),g.isMeshPhysicalMaterial)_(A,g,x)}else if(g.isMeshMatcapMaterial)i(A,g),p(A,g);else if(g.isMeshDepthMaterial)i(A,g);else if(g.isMeshDistanceMaterial)i(A,g),m(A,g);else if(g.isMeshNormalMaterial)i(A,g);else if(g.isLineBasicMaterial){if(s(A,g),g.isLineDashedMaterial)a(A,g)}else if(g.isPointsMaterial)c(A,g,f,y);else if(g.isSpriteMaterial)l(A,g);else if(g.isShadowMaterial)A.color.value.copy(g.color),A.opacity.value=g.opacity;else if(g.isShaderMaterial)g.uniformsNeedUpdate=!1}function i(A,g){if(A.opacity.value=g.opacity,g.color)A.diffuse.value.copy(g.color);if(g.emissive)A.emissive.value.copy(g.emissive).multiplyScalar(g.emissiveIntensity);if(g.map)A.map.value=g.map,n(g.map,A.mapTransform);if(g.alphaMap)A.alphaMap.value=g.alphaMap,n(g.alphaMap,A.alphaMapTransform);if(g.bumpMap){if(A.bumpMap.value=g.bumpMap,n(g.bumpMap,A.bumpMapTransform),A.bumpScale.value=g.bumpScale,g.side===1)A.bumpScale.value*=-1}if(g.normalMap){if(A.normalMap.value=g.normalMap,n(g.normalMap,A.normalMapTransform),A.normalScale.value.copy(g.normalScale),g.side===1)A.normalScale.value.negate()}if(g.displacementMap)A.displacementMap.value=g.displacementMap,n(g.displacementMap,A.displacementMapTransform),A.displacementScale.value=g.displacementScale,A.displacementBias.value=g.displacementBias;if(g.emissiveMap)A.emissiveMap.value=g.emissiveMap,n(g.emissiveMap,A.emissiveMapTransform);if(g.specularMap)A.specularMap.value=g.specularMap,n(g.specularMap,A.specularMapTransform);if(g.alphaTest>0)A.alphaTest.value=g.alphaTest;let f=t.get(g),{envMap:y,envMapRotation:x}=f;if(y){if(A.envMap.value=y,vz.copy(x),vz.x*=-1,vz.y*=-1,vz.z*=-1,y.isCubeTexture&&y.isRenderTargetTexture===!1)vz.y*=-1,vz.z*=-1;A.envMapRotation.value.setFromMatrix4(G6o.makeRotationFromEuler(vz)),A.flipEnvMap.value=y.isCubeTexture&&y.isRenderTargetTexture===!1?-1:1,A.reflectivity.value=g.reflectivity,A.ior.value=g.ior,A.refractionRatio.value=g.refractionRatio}if(g.lightMap)A.lightMap.value=g.lightMap,A.lightMapIntensity.value=g.lightMapIntensity,n(g.lightMap,A.lightMapTransform);if(g.aoMap)A.aoMap.value=g.aoMap,A.aoMapIntensity.value=g.aoMapIntensity,n(g.aoMap,A.aoMapTransform)}function s(A,g){if(A.diffuse.value.copy(g.color),A.opacity.value=g.opacity,g.map)A.map.value=g.map,n(g.map,A.mapTransform)}function a(A,g){A.dashSize.value=g.dashSize,A.totalSize.value=g.dashSize+g.gapSize,A.scale.value=g.scale}function c(A,g,f,y){if(A.diffuse.value.copy(g.color),A.opacity.value=g.opacity,A.size.value=g.size*f,A.scale.value=y*0.5,g.map)A.map.value=g.map,n(g.map,A.uvTransform);if(g.alphaMap)A.alphaMap.value=g.alphaMap,n(g.alphaMap,A.alphaMapTransform);if(g.alphaTest>0)A.alphaTest.value=g.alphaTest}function l(A,g){if(A.diffuse.value.copy(g.color),A.opacity.value=g.opacity,A.rotation.value=g.rotation,g.map)A.map.value=g.map,n(g.map,A.mapTransform);if(g.alphaMap)A.alphaMap.value=g.alphaMap,n(g.alphaMap,A.alphaMapTransform);if(g.alphaTest>0)A.alphaTest.value=g.alphaTest}function h(A,g){A.specular.value.copy(g.specular),A.shininess.value=Math.max(g.shininess,0.0001)}function d(A,g){if(g.gradientMap)A.gradientMap.value=g.gradientMap}function u(A,g){if(A.metalness.value=g.metalness,g.metalnessMap)A.metalnessMap.value=g.metalnessMap,n(g.metalnessMap,A.metalnessMapTransform);if(A.roughness.value=g.roughness,g.roughnessMap)A.roughnessMap.value=g.roughnessMap,n(g.roughnessMap,A.roughnessMapTransform);if(g.envMap)A.envMapIntensity.value=g.envMapIntensity}function _(A,g,f){if(A.ior.value=g.ior,g.sheen>0){if(A.sheenColor.value.copy(g.sheenColor).multiplyScalar(g.sheen),A.sheenRoughness.value=g.sheenRoughness,g.sheenColorMap)A.sheenColorMap.value=g.sheenColorMap,n(g.sheenColorMap,A.sheenColorMapTransform);if(g.sheenRoughnessMap)A.sheenRoughnessMap.value=g.sheenRoughnessMap,n(g.sheenRoughnessMap,A.sheenRoughnessMapTransform)}if(g.clearcoat>0){if(A.clearcoat.value=g.clearcoat,A.clearcoatRoughness.value=g.clearcoatRoughness,g.clearcoatMap)A.clearcoatMap.value=g.clearcoatMap,n(g.clearcoatMap,A.clearcoatMapTransform);if(g.clearcoatRoughnessMap)A.clearcoatRoughnessMap.value=g.clearcoatRoughnessMap,n(g.clearcoatRoughnessMap,A.clearcoatRoughnessMapTransform);if(g.clearcoatNormalMap){if(A.clearcoatNormalMap.value=g.clearcoatNormalMap,n(g.clearcoatNormalMap,A.clearcoatNormalMapTransform),A.clearcoatNormalScale.value.copy(g.clearcoatNormalScale),g.side===1)A.clearcoatNormalScale.value.negate()}}if(g.dispersion>0)A.dispersion.value=g.dispersion;if(g.iridescence>0){if(A.iridescence.value=g.iridescence,A.iridescenceIOR.value=g.iridescenceIOR,A.iridescenceThicknessMinimum.value=g.iridescenceThicknessRange[0],A.iridescenceThicknessMaximum.value=g.iridescenceThicknessRange[1],g.iridescenceMap)A.iridescenceMap.value=g.iridescenceMap,n(g.iridescenceMap,A.iridescenceMapTransform);if(g.iridescenceThicknessMap)A.iridescenceThicknessMap.value=g.iridescenceThicknessMap,n(g.iridescenceThicknessMap,A.iridescenceThicknessMapTransform)}if(g.transmission>0){if(A.transmission.value=g.transmission,A.transmissionSamplerMap.value=f.texture,A.transmissionSamplerSize.value.set(f.width,f.height),g.transmissionMap)A.transmissionMap.value=g.transmissionMap,n(g.transmissionMap,A.transmissionMapTransform);if(A.thickness.value=g.thickness,g.thicknessMap)A.thicknessMap.value=g.thicknessMap,n(g.thicknessMap,A.thicknessMapTransform);A.attenuationDistance.value=g.attenuationDistance,A.attenuationColor.value.copy(g.attenuationColor)}if(g.anisotropy>0){if(A.anisotropyVector.value.set(g.anisotropy*Math.cos(g.anisotropyRotation),g.anisotropy*Math.sin(g.anisotropyRotation)),g.anisotropyMap)A.anisotropyMap.value=g.anisotropyMap,n(g.anisotropyMap,A.anisotropyMapTransform)}if(A.specularIntensity.value=g.specularIntensity,A.specularColor.value.copy(g.specularColor),g.specularColorMap)A.specularColorMap.value=g.specularColorMap,n(g.specularColorMap,A.specularColorMapTransform);if(g.specularIntensityMap)A.specularIntensityMap.value=g.specularIntensityMap,n(g.specularIntensityMap,A.specularIntensityMapTransform)}function p(A,g){if(g.matcap)A.matcap.value=g.matcap}function m(A,g){let f=t.get(g).light;A.referencePosition.value.setFromMatrixPosition(f.matrixWorld),A.nearDistance.value=f.shadow.camera.near,A.farDistance.value=f.shadow.camera.far}return{refreshFogUniforms:o,refreshMaterialUniforms:r}}function W6o(e,t,n,o){let r={},i={},s=[],a=e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS);function c(f,y){let x=y.program;o.uniformBlockBinding(f,x)}function l(f,y){let x=r[f.id];if(x===void 0)p(f),x=h(f),r[f.id]=x,f.addEventListener("dispose",A);let C=y.program;o.updateUBOMapping(f,C);let b=t.render.frame;if(i[f.id]!==b)u(f),i[f.id]=b}function h(f){let y=d();f.__bindingPointIndex=y;let x=e.createBuffer(),{__size:C,usage:b}=f;return e.bindBuffer(e.UNIFORM_BUFFER,x),e.bufferData(e.UNIFORM_BUFFER,C,b),e.bindBuffer(e.UNIFORM_BUFFER,null),e.bindBufferBase(e.UNIFORM_BUFFER,y,x),x}function d(){for(let f=0;f<a;f++)if(s.indexOf(f)===-1)return s.push(f),f;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function u(f){let y=r[f.id],{uniforms:x,__cache:C}=f;e.bindBuffer(e.UNIFORM_BUFFER,y);for(let b=0,I=x.length;b<I;b++){let v=Array.isArray(x[b])?x[b]:[x[b]];for(let P=0,M=v.length;P<M;P++){let B=v[P];if(_(B,b,P,C)===!0){let T=B.__offset,N=Array.isArray(B.value)?B.value:[B.value],D=0;for(let L=0;L<N.length;L++){let H=N[L],V=m(H);if(typeof H==="number"||typeof H==="boolean")B.__data[0]=H,e.bufferSubData(e.UNIFORM_BUFFER,T+D,B.__data);else if(H.isMatrix3)B.__data[0]=H.elements[0],B.__data[1]=H.elements[1],B.__data[2]=H.elements[2],B.__data[3]=0,B.__data[4]=H.elements[3],B.__data[5]=H.elements[4],B.__data[6]=H.elements[5],B.__data[7]=0,B.__data[8]=H.elements[6],B.__data[9]=H.elements[7],B.__data[10]=H.elements[8],B.__data[11]=0;else H.toArray(B.__data,D),D+=V.storage/Float32Array.BYTES_PER_ELEMENT}e.bufferSubData(e.UNIFORM_BUFFER,T,B.__data)}}}e.bindBuffer(e.UNIFORM_BUFFER,null)}function _(f,y,x,C){let b=f.value,I=y+"_"+x;if(C[I]===void 0){if(typeof b==="number"||typeof b==="boolean")C[I]=b;else C[I]=b.clone();return!0}else{let v=C[I];if(typeof b==="number"||typeof b==="boolean"){if(v!==b)return C[I]=b,!0}else if(v.equals(b)===!1)return v.copy(b),!0}return!1}function p(f){let y=f.uniforms,x=0,C=16;for(let I=0,v=y.length;I<v;I++){let P=Array.isArray(y[I])?y[I]:[y[I]];for(let M=0,B=P.length;M<B;M++){let T=P[M],N=Array.isArray(T.value)?T.value:[T.value];for(let D=0,L=N.length;D<L;D++){let H=N[D],V=m(H),O=x%C;if(O!==0&&C-O<V.boundary)x+=C-O;T.__data=new Float32Array(V.storage/Float32Array.BYTES_PER_ELEMENT),T.__offset=x,x+=V.storage}}}let b=x%C;if(b>0)x+=C-b;return f.__size=x,f.__cache={},this}function m(f){let y={boundary:0,storage:0};if(typeof f==="number"||typeof f==="boolean")y.boundary=4,y.storage=4;else if(f.isVector2)y.boundary=8,y.storage=8;else if(f.isVector3||f.isColor)y.boundary=16,y.storage=12;else if(f.isVector4)y.boundary=16,y.storage=16;else if(f.isMatrix3)y.boundary=48,y.storage=48;else if(f.isMatrix4)y.boundary=64,y.storage=64;else if(f.isTexture)console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group.");else console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",f);return y}function A(f){let y=f.target;y.removeEventListener("dispose",A);let x=s.indexOf(y.__bindingPointIndex);s.splice(x,1),e.deleteBuffer(r[y.id]),delete r[y.id],delete i[y.id]}function g(){for(let f in r)e.deleteBuffer(r[f]);s=[],r={},i={}}return{bind:c,update:l,dispose:g}}class d3{constructor(e={}){let{canvas:t=t4o(),context:n=null,depth:o=!0,stencil:r=!1,alpha:i=!1,antialias:s=!1,premultipliedAlpha:a=!0,preserveDrawingBuffer:c=!1,powerPreference:l="default",failIfMajorPerformanceCaveat:h=!1}=e;this.isWebGLRenderer=!0;let d;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");d=n.getContextAttributes().alpha}else d=i;let u=new Uint32Array(4),_=new Int32Array(4),p=null,m=null,A=[],g=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace="srgb",this.toneMapping=0,this.toneMappingExposure=1;let f=this,y=!1,x=0,C=0,b=null,I=-1,v=null,P=new zh,M=new zh,B=null,T=new No(0),N=0,{width:D,height:L}=t,H=1,V=null,O=null,U=new zh(0,0,D,L),j=new zh(0,0,D,L),Y=!1,X=new VAe,K=!1,J=!1,ee=new Gi,se=new Et,ne={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0},re=!1;function Z(){return b===null?H:1}let te=n;function ie(xt,gt){return t.getContext(xt,gt)}try{let xt={alpha:!0,depth:o,stencil:r,antialias:s,premultipliedAlpha:a,preserveDrawingBuffer:c,powerPreference:l,failIfMajorPerformanceCaveat:h};if("setAttribute"in t)t.setAttribute("data-engine","three.js r165");if(t.addEventListener("webglcontextlost",We,!1),t.addEventListener("webglcontextrestored",Le,!1),t.addEventListener("webglcontextcreationerror",Ze,!1),te===null){if(te=ie("webgl2",xt),te===null)if(ie("webgl2"))throw Error("Error creating WebGL context with your selected attributes.");else throw Error("Error creating WebGL context.")}}catch(xt){throw console.error("THREE.WebGLRenderer: "+xt.message),xt}let le,ue,de,me,Ae,xe,Me,Re,we,_e,ye,Se,Ne,ke,nt,dt,rt,mt,lt,Ct,Nt,Ht,Tt,et;function vt(){le=new dbo(te),le.init(),Ht=new z6o(te,le),ue=new ibo(te,le,e,Ht),de=new H6o(te),me=new mbo(te),Ae=new P6o,xe=new F6o(te,le,de,Ae,ue,Ht,me),Me=new abo(f),Re=new hbo(f),we=new C4o(te),Tt=new obo(te,we),_e=new ubo(te,we,me,Tt),ye=new gbo(te,_e,we,me),lt=new _bo(te,ue,xe),dt=new sbo(Ae),Se=new S6o(f,Me,Re,le,ue,Tt,dt),Ne=new U6o(f,Ae),ke=new M6o,nt=new R6o(le),mt=new nbo(f,Me,Re,de,ye,d,a),rt=new L6o(f,ye,ue),et=new W6o(te,me,ue,de),Ct=new rbo(te,le,me),Nt=new pbo(te,le,me),me.programs=Se.programs,f.capabilities=ue,f.extensions=le,f.properties=Ae,f.renderLists=ke,f.shadowMap=rt,f.state=de,f.info=me}vt();let ht=new v5t(f,te);this.xr=ht,this.getContext=function(){return te},this.getContextAttributes=function(){return te.getContextAttributes()},this.forceContextLoss=function(){let xt=le.get("WEBGL_lose_context");if(xt)xt.loseContext()},this.forceContextRestore=function(){let xt=le.get("WEBGL_lose_context");if(xt)xt.restoreContext()},this.getPixelRatio=function(){return H},this.setPixelRatio=function(xt){if(xt===void 0)return;H=xt,this.setSize(D,L,!1)},this.getSize=function(xt){return xt.set(D,L)},this.setSize=function(xt,gt,Ot=!0){if(ht.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}if(D=xt,L=gt,t.width=Math.floor(xt*H),t.height=Math.floor(gt*H),Ot===!0)t.style.width=xt+"px",t.style.height=gt+"px";this.setViewport(0,0,xt,gt)},this.getDrawingBufferSize=function(xt){return xt.set(D*H,L*H).floor()},this.setDrawingBufferSize=function(xt,gt,Ot){D=xt,L=gt,H=Ot,t.width=Math.floor(xt*Ot),t.height=Math.floor(gt*Ot),this.setViewport(0,0,xt,gt)},this.getCurrentViewport=function(xt){return xt.copy(P)},this.getViewport=function(xt){return xt.copy(U)},this.setViewport=function(xt,gt,Ot,Zt){if(xt.isVector4)U.set(xt.x,xt.y,xt.z,xt.w);else U.set(xt,gt,Ot,Zt);de.viewport(P.copy(U).multiplyScalar(H).round())},this.getScissor=function(xt){return xt.copy(j)},this.setScissor=function(xt,gt,Ot,Zt){if(xt.isVector4)j.set(xt.x,xt.y,xt.z,xt.w);else j.set(xt,gt,Ot,Zt);de.scissor(M.copy(j).multiplyScalar(H).round())},this.getScissorTest=function(){return Y},this.setScissorTest=function(xt){de.setScissorTest(Y=xt)},this.setOpaqueSort=function(xt){V=xt},this.setTransparentSort=function(xt){O=xt},this.getClearColor=function(xt){return xt.copy(mt.getClearColor())},this.setClearColor=function(){mt.setClearColor.apply(mt,arguments)},this.getClearAlpha=function(){return mt.getClearAlpha()},this.setClearAlpha=function(){mt.setClearAlpha.apply(mt,arguments)},this.clear=function(xt=!0,gt=!0,Ot=!0){let Zt=0;if(xt){let je=!1;if(b!==null){let Mt=b.texture.format;je=Mt===1033||Mt===1031||Mt===1029}if(je){let Mt=b.texture.type,Kt=Mt===1009||Mt===1014||Mt===1012||Mt===1020||Mt===1017||Mt===1018,nn=mt.getClearColor(),Zn=mt.getClearAlpha(),{r:Vn,g:Rn,b:Bn}=nn;if(Kt)u[0]=Vn,u[1]=Rn,u[2]=Bn,u[3]=Zn,te.clearBufferuiv(te.COLOR,0,u);else _[0]=Vn,_[1]=Rn,_[2]=Bn,_[3]=Zn,te.clearBufferiv(te.COLOR,0,_)}else Zt|=te.COLOR_BUFFER_BIT}if(gt)Zt|=te.DEPTH_BUFFER_BIT;if(Ot)Zt|=te.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295);te.clear(Zt)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",We,!1),t.removeEventListener("webglcontextrestored",Le,!1),t.removeEventListener("webglcontextcreationerror",Ze,!1),ke.dispose(),nt.dispose(),Ae.dispose(),Me.dispose(),Re.dispose(),ye.dispose(),Tt.dispose(),et.dispose(),Se.dispose(),ht.dispose(),ht.removeEventListener("sessionstart",it),ht.removeEventListener("sessionend",St),kt.stop()};function We(xt){xt.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),y=!0}function Le(){console.log("THREE.WebGLRenderer: Context Restored."),y=!1;let xt=me.autoReset,gt=rt.enabled,Ot=rt.autoUpdate,Zt=rt.needsUpdate,je=rt.type;vt(),me.autoReset=xt,rt.enabled=gt,rt.autoUpdate=Ot,rt.needsUpdate=Zt,rt.type=je}function Ze(xt){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",xt.statusMessage)}function $e(xt){let gt=xt.target;gt.removeEventListener("dispose",$e),qe(gt)}function qe(xt){ft(xt),Ae.remove(xt)}function ft(xt){let gt=Ae.get(xt).programs;if(gt!==void 0){if(gt.forEach(function(Ot){Se.releaseProgram(Ot)}),xt.isShaderMaterial)Se.releaseShaderCache(xt)}}this.renderBufferDirect=function(xt,gt,Ot,Zt,je,Mt){if(gt===null)gt=ne;let Kt=je.isMesh&&je.matrixWorld.determinant()<0,nn=no(xt,gt,Ot,Zt,je);de.setMaterial(Zt,Kt);let Zn=Ot.index,Vn=1;if(Zt.wireframe===!0){if(Zn=_e.getWireframeAttribute(Ot),Zn===void 0)return;Vn=2}let Rn=Ot.drawRange,Bn=Ot.attributes.position,ho=Rn.start*Vn,Qo=(Rn.start+Rn.count)*Vn;if(Mt!==null)ho=Math.max(ho,Mt.start*Vn),Qo=Math.min(Qo,(Mt.start+Mt.count)*Vn);if(Zn!==null)ho=Math.max(ho,0),Qo=Math.min(Qo,Zn.count);else if(Bn!==void 0&&Bn!==null)ho=Math.max(ho,0),Qo=Math.min(Qo,Bn.count);let Nn=Qo-ho;if(Nn<0||Nn===1/0)return;Tt.setup(je,Zt,nn,Ot,Zn);let mo,Io=Ct;if(Zn!==null)mo=we.get(Zn),Io=Nt,Io.setIndex(mo);if(je.isMesh)if(Zt.wireframe===!0)de.setLineWidth(Zt.wireframeLinewidth*Z()),Io.setMode(te.LINES);else Io.setMode(te.TRIANGLES);else if(je.isLine){let io=Zt.linewidth;if(io===void 0)io=1;if(de.setLineWidth(io*Z()),je.isLineSegments)Io.setMode(te.LINES);else if(je.isLineLoop)Io.setMode(te.LINE_LOOP);else Io.setMode(te.LINE_STRIP)}else if(je.isPoints)Io.setMode(te.POINTS);else if(je.isSprite)Io.setMode(te.TRIANGLES);if(je.isBatchedMesh)if(je._multiDrawInstances!==null)Io.renderMultiDrawInstances(je._multiDrawStarts,je._multiDrawCounts,je._multiDrawCount,je._multiDrawInstances);else Io.renderMultiDraw(je._multiDrawStarts,je._multiDrawCounts,je._multiDrawCount);else if(je.isInstancedMesh)Io.renderInstances(ho,Nn,je.count);else if(Ot.isInstancedBufferGeometry){let io=Ot._maxInstanceCount!==void 0?Ot._maxInstanceCount:1/0,Wo=Math.min(Ot.instanceCount,io);Io.renderInstances(ho,Nn,Wo)}else Io.render(ho,Nn)};function It(xt,gt,Ot){if(xt.transparent===!0&&xt.side===2&&xt.forceSinglePass===!1)xt.side=1,xt.needsUpdate=!0,Fn(xt,gt,Ot),xt.side=0,xt.needsUpdate=!0,Fn(xt,gt,Ot),xt.side=2;else Fn(xt,gt,Ot)}this.compile=function(xt,gt,Ot=null){if(Ot===null)Ot=xt;if(m=nt.get(Ot),m.init(gt),g.push(m),Ot.traverseVisible(function(je){if(je.isLight&&je.layers.test(gt.layers)){if(m.pushLight(je),je.castShadow)m.pushShadow(je)}}),xt!==Ot)xt.traverseVisible(function(je){if(je.isLight&&je.layers.test(gt.layers)){if(m.pushLight(je),je.castShadow)m.pushShadow(je)}});m.setupLights();let Zt=new Set;return xt.traverse(function(je){let Mt=je.material;if(Mt)if(Array.isArray(Mt))for(let Kt=0;Kt<Mt.length;Kt++){let nn=Mt[Kt];It(nn,Ot,je),Zt.add(nn)}else It(Mt,Ot,je),Zt.add(Mt)}),g.pop(),m=null,Zt},this.compileAsync=function(xt,gt,Ot=null){let Zt=this.compile(xt,gt,Ot);return new Promise((je)=>{function Mt(){if(Zt.forEach(function(Kt){if(Ae.get(Kt).currentProgram.isReady())Zt.delete(Kt)}),Zt.size===0){je(xt);return}setTimeout(Mt,10)}if(le.get("KHR_parallel_shader_compile")!==null)Mt();else setTimeout(Mt,10)})};let ze=null;function Xe(xt){if(ze)ze(xt)}function it(){kt.stop()}function St(){kt.start()}let kt=new d5t;if(kt.setAnimationLoop(Xe),typeof self<"u")kt.setContext(self);this.setAnimationLoop=function(xt){ze=xt,ht.setAnimationLoop(xt),xt===null?kt.stop():kt.start()},ht.addEventListener("sessionstart",it),ht.addEventListener("sessionend",St),this.render=function(xt,gt){if(gt!==void 0&&gt.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(y===!0)return;if(xt.matrixWorldAutoUpdate===!0)xt.updateMatrixWorld();if(gt.parent===null&&gt.matrixWorldAutoUpdate===!0)gt.updateMatrixWorld();if(ht.enabled===!0&&ht.isPresenting===!0){if(ht.cameraAutoUpdate===!0)ht.updateCamera(gt);gt=ht.getCamera()}if(xt.isScene===!0)xt.onBeforeRender(f,xt,gt,b);if(m=nt.get(xt,g.length),m.init(gt),g.push(m),ee.multiplyMatrices(gt.projectionMatrix,gt.matrixWorldInverse),X.setFromProjectionMatrix(ee),J=this.localClippingEnabled,K=dt.init(this.clippingPlanes,J),p=ke.get(xt,A.length),p.init(),A.push(p),ht.enabled===!0&&ht.isPresenting===!0){let Mt=f.xr.getDepthSensingMesh();if(Mt!==null)Lt(Mt,gt,-1/0,f.sortObjects)}if(Lt(xt,gt,0,f.sortObjects),p.finish(),f.sortObjects===!0)p.sort(V,O);if(re=ht.enabled===!1||ht.isPresenting===!1||ht.hasDepthSensing()===!1,re)mt.addToRenderList(p,xt);if(this.info.render.frame++,K===!0)dt.beginShadows();let Ot=m.state.shadowsArray;if(rt.render(Ot,xt,gt),K===!0)dt.endShadows();if(this.info.autoReset===!0)this.info.reset();let Zt=p.opaque,je=p.transmissive;if(m.setupLights(),gt.isArrayCamera){let Mt=gt.cameras;if(je.length>0)for(let Kt=0,nn=Mt.length;Kt<nn;Kt++){let Zn=Mt[Kt];bn(Zt,je,xt,Zn)}if(re)mt.render(xt);for(let Kt=0,nn=Mt.length;Kt<nn;Kt++){let Zn=Mt[Kt];Wt(p,xt,Zn,Zn.viewport)}}else{if(je.length>0)bn(Zt,je,xt,gt);if(re)mt.render(xt);Wt(p,xt,gt)}if(b!==null)xe.updateMultisampleRenderTarget(b),xe.updateRenderTargetMipmap(b);if(xt.isScene===!0)xt.onAfterRender(f,xt,gt);if(Tt.resetDefaultState(),I=-1,v=null,g.pop(),g.length>0){if(m=g[g.length-1],K===!0)dt.setGlobalState(f.clippingPlanes,m.state.camera)}else m=null;if(A.pop(),A.length>0)p=A[A.length-1];else p=null};function Lt(xt,gt,Ot,Zt){if(xt.visible===!1)return;if(xt.layers.test(gt.layers)){if(xt.isGroup)Ot=xt.renderOrder;else if(xt.isLOD){if(xt.autoUpdate===!0)xt.update(gt)}else if(xt.isLight){if(m.pushLight(xt),xt.castShadow)m.pushShadow(xt)}else if(xt.isSprite){if(!xt.frustumCulled||X.intersectsSprite(xt)){if(Zt)se.setFromMatrixPosition(xt.matrixWorld).applyMatrix4(ee);let Kt=ye.update(xt),nn=xt.material;if(nn.visible)p.push(xt,Kt,nn,Ot,se.z,null)}}else if(xt.isMesh||xt.isLine||xt.isPoints){if(!xt.frustumCulled||X.intersectsObject(xt)){let Kt=ye.update(xt),nn=xt.material;if(Zt){if(xt.boundingSphere!==void 0){if(xt.boundingSphere===null)xt.computeBoundingSphere();se.copy(xt.boundingSphere.center)}else{if(Kt.boundingSphere===null)Kt.computeBoundingSphere();se.copy(Kt.boundingSphere.center)}se.applyMatrix4(xt.matrixWorld).applyMatrix4(ee)}if(Array.isArray(nn)){let Zn=Kt.groups;for(let Vn=0,Rn=Zn.length;Vn<Rn;Vn++){let Bn=Zn[Vn],ho=nn[Bn.materialIndex];if(ho&&ho.visible)p.push(xt,Kt,ho,Ot,se.z,Bn)}}else if(nn.visible)p.push(xt,Kt,nn,Ot,se.z,null)}}}let Mt=xt.children;for(let Kt=0,nn=Mt.length;Kt<nn;Kt++)Lt(Mt[Kt],gt,Ot,Zt)}function Wt(xt,gt,Ot,Zt){let{opaque:je,transmissive:Mt,transparent:Kt}=xt;if(m.setupLightsView(Ot),K===!0)dt.setGlobalState(f.clippingPlanes,Ot);if(Zt)de.viewport(P.copy(Zt));if(je.length>0)pn(je,gt,Ot);if(Mt.length>0)pn(Mt,gt,Ot);if(Kt.length>0)pn(Kt,gt,Ot);de.buffers.depth.setTest(!0),de.buffers.depth.setMask(!0),de.buffers.color.setMask(!0),de.setPolygonOffset(!1)}function bn(xt,gt,Ot,Zt){if((Ot.isScene===!0?Ot.overrideMaterial:null)!==null)return;if(m.state.transmissionRenderTarget[Zt.id]===void 0)m.state.transmissionRenderTarget[Zt.id]=new uR(1,1,{generateMipmaps:!0,type:le.has("EXT_color_buffer_half_float")||le.has("EXT_color_buffer_float")?1016:1009,minFilter:1008,samples:4,stencilBuffer:r,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Zh.workingColorSpace});let Mt=m.state.transmissionRenderTarget[Zt.id],Kt=Zt.viewport||P;Mt.setSize(Kt.z,Kt.w);let nn=f.getRenderTarget();if(f.setRenderTarget(Mt),f.getClearColor(T),N=f.getClearAlpha(),N<1)f.setClearColor(16777215,0.5);if(re)mt.render(Ot);else f.clear();let Zn=f.toneMapping;f.toneMapping=0;let Vn=Zt.viewport;if(Zt.viewport!==void 0)Zt.viewport=void 0;if(m.setupLightsView(Zt),K===!0)dt.setGlobalState(f.clippingPlanes,Zt);if(pn(xt,Ot,Zt),xe.updateMultisampleRenderTarget(Mt),xe.updateRenderTargetMipmap(Mt),le.has("WEBGL_multisampled_render_to_texture")===!1){let Rn=!1;for(let Bn=0,ho=gt.length;Bn<ho;Bn++){let Qo=gt[Bn],{object:Nn,geometry:mo,material:Io,group:io}=Qo;if(Io.side===2&&Nn.layers.test(Zt.layers)){let Wo=Io.side;Io.side=1,Io.needsUpdate=!0,wn(Nn,Ot,Zt,mo,Io,io),Io.side=Wo,Io.needsUpdate=!0,Rn=!0}}if(Rn===!0)xe.updateMultisampleRenderTarget(Mt),xe.updateRenderTargetMipmap(Mt)}if(f.setRenderTarget(nn),f.setClearColor(T,N),Vn!==void 0)Zt.viewport=Vn;f.toneMapping=Zn}function pn(xt,gt,Ot){let Zt=gt.isScene===!0?gt.overrideMaterial:null;for(let je=0,Mt=xt.length;je<Mt;je++){let Kt=xt[je],{object:nn,geometry:Zn}=Kt,Vn=Zt===null?Kt.material:Zt,Rn=Kt.group;if(nn.layers.test(Ot.layers))wn(nn,gt,Ot,Zn,Vn,Rn)}}function wn(xt,gt,Ot,Zt,je,Mt){if(xt.onBeforeRender(f,gt,Ot,Zt,je,Mt),xt.modelViewMatrix.multiplyMatrices(Ot.matrixWorldInverse,xt.matrixWorld),xt.normalMatrix.getNormalMatrix(xt.modelViewMatrix),je.onBeforeRender(f,gt,Ot,Zt,xt,Mt),je.transparent===!0&&je.side===2&&je.forceSinglePass===!1)je.side=1,je.needsUpdate=!0,f.renderBufferDirect(Ot,gt,Zt,je,xt,Mt),je.side=0,je.needsUpdate=!0,f.renderBufferDirect(Ot,gt,Zt,je,xt,Mt),je.side=2;else f.renderBufferDirect(Ot,gt,Zt,je,xt,Mt);xt.onAfterRender(f,gt,Ot,Zt,je,Mt)}function Fn(xt,gt,Ot){if(gt.isScene!==!0)gt=ne;let Zt=Ae.get(xt),je=m.state.lights,Mt=m.state.shadowsArray,Kt=je.state.version,nn=Se.getParameters(xt,je.state,Mt,gt,Ot),Zn=Se.getProgramCacheKey(nn),Vn=Zt.programs;if(Zt.environment=xt.isMeshStandardMaterial?gt.environment:null,Zt.fog=gt.fog,Zt.envMap=(xt.isMeshStandardMaterial?Re:Me).get(xt.envMap||Zt.environment),Zt.envMapRotation=Zt.environment!==null&&xt.envMap===null?gt.environmentRotation:xt.envMapRotation,Vn===void 0)xt.addEventListener("dispose",$e),Vn=new Map,Zt.programs=Vn;let Rn=Vn.get(Zn);if(Rn!==void 0){if(Zt.currentProgram===Rn&&Zt.lightsStateVersion===Kt)return _n(xt,nn),Rn}else nn.uniforms=Se.getUniforms(xt),xt.onBuild(Ot,nn,f),xt.onBeforeCompile(nn,f),Rn=Se.acquireProgram(nn,Zn),Vn.set(Zn,Rn),Zt.uniforms=nn.uniforms;let Bn=Zt.uniforms;if(!xt.isShaderMaterial&&!xt.isRawShaderMaterial||xt.clipping===!0)Bn.clippingPlanes=dt.uniform;if(_n(xt,nn),Zt.needsLights=ir(xt),Zt.lightsStateVersion=Kt,Zt.needsLights)Bn.ambientLightColor.value=je.state.ambient,Bn.lightProbe.value=je.state.probe,Bn.directionalLights.value=je.state.directional,Bn.directionalLightShadows.value=je.state.directionalShadow,Bn.spotLights.value=je.state.spot,Bn.spotLightShadows.value=je.state.spotShadow,Bn.rectAreaLights.value=je.state.rectArea,Bn.ltc_1.value=je.state.rectAreaLTC1,Bn.ltc_2.value=je.state.rectAreaLTC2,Bn.pointLights.value=je.state.point,Bn.pointLightShadows.value=je.state.pointShadow,Bn.hemisphereLights.value=je.state.hemi,Bn.directionalShadowMap.value=je.state.directionalShadowMap,Bn.directionalShadowMatrix.value=je.state.directionalShadowMatrix,Bn.spotShadowMap.value=je.state.spotShadowMap,Bn.spotLightMatrix.value=je.state.spotLightMatrix,Bn.spotLightMap.value=je.state.spotLightMap,Bn.pointShadowMap.value=je.state.pointShadowMap,Bn.pointShadowMatrix.value=je.state.pointShadowMatrix;return Zt.currentProgram=Rn,Zt.uniformsList=null,Rn}function mn(xt){if(xt.uniformsList===null){let gt=xt.currentProgram.getUniforms();xt.uniformsList=kre.seqWithValue(gt.seq,xt.uniforms)}return xt.uniformsList}function _n(xt,gt){let Ot=Ae.get(xt);Ot.outputColorSpace=gt.outputColorSpace,Ot.batching=gt.batching,Ot.batchingColor=gt.batchingColor,Ot.instancing=gt.instancing,Ot.instancingColor=gt.instancingColor,Ot.instancingMorph=gt.instancingMorph,Ot.skinning=gt.skinning,Ot.morphTargets=gt.morphTargets,Ot.morphNormals=gt.morphNormals,Ot.morphColors=gt.morphColors,Ot.morphTargetsCount=gt.morphTargetsCount,Ot.numClippingPlanes=gt.numClippingPlanes,Ot.numIntersection=gt.numClipIntersection,Ot.vertexAlphas=gt.vertexAlphas,Ot.vertexTangents=gt.vertexTangents,Ot.toneMapping=gt.toneMapping}function no(xt,gt,Ot,Zt,je){if(gt.isScene!==!0)gt=ne;xe.resetTextureUnits();let Mt=gt.fog,Kt=Zt.isMeshStandardMaterial?gt.environment:null,nn=b===null?f.outputColorSpace:b.isXRRenderTarget===!0?b.texture.colorSpace:"srgb-linear",Zn=(Zt.isMeshStandardMaterial?Re:Me).get(Zt.envMap||Kt),Vn=Zt.vertexColors===!0&&!!Ot.attributes.color&&Ot.attributes.color.itemSize===4,Rn=!!Ot.attributes.tangent&&(!!Zt.normalMap||Zt.anisotropy>0),Bn=!!Ot.morphAttributes.position,ho=!!Ot.morphAttributes.normal,Qo=!!Ot.morphAttributes.color,Nn=0;if(Zt.toneMapped){if(b===null||b.isXRRenderTarget===!0)Nn=f.toneMapping}let mo=Ot.morphAttributes.position||Ot.morphAttributes.normal||Ot.morphAttributes.color,Io=mo!==void 0?mo.length:0,io=Ae.get(Zt),Wo=m.state.lights;if(K===!0){if(J===!0||xt!==v){let hs=xt===v&&Zt.id===I;dt.setState(Zt,xt,hs)}}let rr=!1;if(Zt.version===io.__version){if(io.needsLights&&io.lightsStateVersion!==Wo.state.version)rr=!0;else if(io.outputColorSpace!==nn)rr=!0;else if(je.isBatchedMesh&&io.batching===!1)rr=!0;else if(!je.isBatchedMesh&&io.batching===!0)rr=!0;else if(je.isBatchedMesh&&io.batchingColor===!0&&je.colorTexture===null)rr=!0;else if(je.isBatchedMesh&&io.batchingColor===!1&&je.colorTexture!==null)rr=!0;else if(je.isInstancedMesh&&io.instancing===!1)rr=!0;else if(!je.isInstancedMesh&&io.instancing===!0)rr=!0;else if(je.isSkinnedMesh&&io.skinning===!1)rr=!0;else if(!je.isSkinnedMesh&&io.skinning===!0)rr=!0;else if(je.isInstancedMesh&&io.instancingColor===!0&&je.instanceColor===null)rr=!0;else if(je.isInstancedMesh&&io.instancingColor===!1&&je.instanceColor!==null)rr=!0;else if(je.isInstancedMesh&&io.instancingMorph===!0&&je.morphTexture===null)rr=!0;else if(je.isInstancedMesh&&io.instancingMorph===!1&&je.morphTexture!==null)rr=!0;else if(io.envMap!==Zn)rr=!0;else if(Zt.fog===!0&&io.fog!==Mt)rr=!0;else if(io.numClippingPlanes!==void 0&&(io.numClippingPlanes!==dt.numPlanes||io.numIntersection!==dt.numIntersection))rr=!0;else if(io.vertexAlphas!==Vn)rr=!0;else if(io.vertexTangents!==Rn)rr=!0;else if(io.morphTargets!==Bn)rr=!0;else if(io.morphNormals!==ho)rr=!0;else if(io.morphColors!==Qo)rr=!0;else if(io.toneMapping!==Nn)rr=!0;else if(io.morphTargetsCount!==Io)rr=!0}else rr=!0,io.__version=Zt.version;let xr=io.currentProgram;if(rr===!0)xr=Fn(Zt,gt,je);let Ci=!1,ea=!1,ya=!1,Oo=xr.getUniforms(),$i=io.uniforms;if(de.useProgram(xr.program))Ci=!0,ea=!0,ya=!0;if(Zt.id!==I)I=Zt.id,ea=!0;if(Ci||v!==xt){Oo.setValue(te,"projectionMatrix",xt.projectionMatrix),Oo.setValue(te,"viewMatrix",xt.matrixWorldInverse);let hs=Oo.map.cameraPosition;if(hs!==void 0)hs.setValue(te,se.setFromMatrixPosition(xt.matrixWorld));if(ue.logarithmicDepthBuffer)Oo.setValue(te,"logDepthBufFC",2/(Math.log(xt.far+1)/Math.LN2));if(Zt.isMeshPhongMaterial||Zt.isMeshToonMaterial||Zt.isMeshLambertMaterial||Zt.isMeshBasicMaterial||Zt.isMeshStandardMaterial||Zt.isShaderMaterial)Oo.setValue(te,"isOrthographic",xt.isOrthographicCamera===!0);if(v!==xt)v=xt,ea=!0,ya=!0}if(je.isSkinnedMesh){Oo.setOptional(te,je,"bindMatrix"),Oo.setOptional(te,je,"bindMatrixInverse");let hs=je.skeleton;if(hs){if(hs.boneTexture===null)hs.computeBoneTexture();Oo.setValue(te,"boneTexture",hs.boneTexture,xe)}}if(je.isBatchedMesh){if(Oo.setOptional(te,je,"batchingTexture"),Oo.setValue(te,"batchingTexture",je._matricesTexture,xe),Oo.setOptional(te,je,"batchingColorTexture"),je._colorsTexture!==null)Oo.setValue(te,"batchingColorTexture",je._colorsTexture,xe)}let Ei=Ot.morphAttributes;if(Ei.position!==void 0||Ei.normal!==void 0||Ei.color!==void 0)lt.update(je,Ot,xr);if(ea||io.receiveShadow!==je.receiveShadow)io.receiveShadow=je.receiveShadow,Oo.setValue(te,"receiveShadow",je.receiveShadow);if(Zt.isMeshGouraudMaterial&&Zt.envMap!==null)$i.envMap.value=Zn,$i.flipEnvMap.value=Zn.isCubeTexture&&Zn.isRenderTargetTexture===!1?-1:1;if(Zt.isMeshStandardMaterial&&Zt.envMap===null&&gt.environment!==null)$i.envMapIntensity.value=gt.environmentIntensity;if(ea){if(Oo.setValue(te,"toneMappingExposure",f.toneMappingExposure),io.needsLights)To($i,ya);if(Mt&&Zt.fog===!0)Ne.refreshFogUniforms($i,Mt);Ne.refreshMaterialUniforms($i,Zt,H,L,m.state.transmissionRenderTarget[xt.id]),kre.upload(te,mn(io),$i,xe)}if(Zt.isShaderMaterial&&Zt.uniformsNeedUpdate===!0)kre.upload(te,mn(io),$i,xe),Zt.uniformsNeedUpdate=!1;if(Zt.isSpriteMaterial)Oo.setValue(te,"center",je.center);if(Oo.setValue(te,"modelViewMatrix",je.modelViewMatrix),Oo.setValue(te,"normalMatrix",je.normalMatrix),Oo.setValue(te,"modelMatrix",je.matrixWorld),Zt.isShaderMaterial||Zt.isRawShaderMaterial){let hs=Zt.uniformsGroups;for(let il=0,kl=hs.length;il<kl;il++){let Xc=hs[il];et.update(Xc,xr),et.bind(Xc,xr)}}return xr}function To(xt,gt){xt.ambientLightColor.needsUpdate=gt,xt.lightProbe.needsUpdate=gt,xt.directionalLights.needsUpdate=gt,xt.directionalLightShadows.needsUpdate=gt,xt.pointLights.needsUpdate=gt,xt.pointLightShadows.needsUpdate=gt,xt.spotLights.needsUpdate=gt,xt.spotLightShadows.needsUpdate=gt,xt.rectAreaLights.needsUpdate=gt,xt.hemisphereLights.needsUpdate=gt}function ir(xt){return xt.isMeshLambertMaterial||xt.isMeshToonMaterial||xt.isMeshPhongMaterial||xt.isMeshStandardMaterial||xt.isShadowMaterial||xt.isShaderMaterial&&xt.lights===!0}if(this.getActiveCubeFace=function(){return x},this.getActiveMipmapLevel=function(){return C},this.getRenderTarget=function(){return b},this.setRenderTargetTextures=function(xt,gt,Ot){Ae.get(xt.texture).__webglTexture=gt,Ae.get(xt.depthTexture).__webglTexture=Ot;let Zt=Ae.get(xt);if(Zt.__hasExternalTextures=!0,Zt.__autoAllocateDepthBuffer=Ot===void 0,!Zt.__autoAllocateDepthBuffer){if(le.has("WEBGL_multisampled_render_to_texture")===!0)console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),Zt.__useRenderToTexture=!1}},this.setRenderTargetFramebuffer=function(xt,gt){let Ot=Ae.get(xt);Ot.__webglFramebuffer=gt,Ot.__useDefaultFramebuffer=gt===void 0},this.setRenderTarget=function(xt,gt=0,Ot=0){b=xt,x=gt,C=Ot;let Zt=!0,je=null,Mt=!1,Kt=!1;if(xt){let Zn=Ae.get(xt);if(Zn.__useDefaultFramebuffer!==void 0)de.bindFramebuffer(te.FRAMEBUFFER,null),Zt=!1;else if(Zn.__webglFramebuffer===void 0)xe.setupRenderTarget(xt);else if(Zn.__hasExternalTextures)xe.rebindTextures(xt,Ae.get(xt.texture).__webglTexture,Ae.get(xt.depthTexture).__webglTexture);let Vn=xt.texture;if(Vn.isData3DTexture||Vn.isDataArrayTexture||Vn.isCompressedArrayTexture)Kt=!0;let Rn=Ae.get(xt).__webglFramebuffer;if(xt.isWebGLCubeRenderTarget){if(Array.isArray(Rn[gt]))je=Rn[gt][Ot];else je=Rn[gt];Mt=!0}else if(xt.samples>0&&xe.useMultisampledRTT(xt)===!1)je=Ae.get(xt).__webglMultisampledFramebuffer;else if(Array.isArray(Rn))je=Rn[Ot];else je=Rn;P.copy(xt.viewport),M.copy(xt.scissor),B=xt.scissorTest}else P.copy(U).multiplyScalar(H).floor(),M.copy(j).multiplyScalar(H).floor(),B=Y;if(de.bindFramebuffer(te.FRAMEBUFFER,je)&&Zt)de.drawBuffers(xt,je);if(de.viewport(P),de.scissor(M),de.setScissorTest(B),Mt){let Zn=Ae.get(xt.texture);te.framebufferTexture2D(te.FRAMEBUFFER,te.COLOR_ATTACHMENT0,te.TEXTURE_CUBE_MAP_POSITIVE_X+gt,Zn.__webglTexture,Ot)}else if(Kt){let Zn=Ae.get(xt.texture),Vn=gt||0;te.framebufferTextureLayer(te.FRAMEBUFFER,te.COLOR_ATTACHMENT0,Zn.__webglTexture,Ot||0,Vn)}I=-1},this.readRenderTargetPixels=function(xt,gt,Ot,Zt,je,Mt,Kt){if(!(xt&&xt.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let nn=Ae.get(xt).__webglFramebuffer;if(xt.isWebGLCubeRenderTarget&&Kt!==void 0)nn=nn[Kt];if(nn){de.bindFramebuffer(te.FRAMEBUFFER,nn);try{let Zn=xt.texture,{format:Vn,type:Rn}=Zn;if(!ue.textureFormatReadable(Vn)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!ue.textureTypeReadable(Rn)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}if(gt>=0&&gt<=xt.width-Zt&&(Ot>=0&&Ot<=xt.height-je))te.readPixels(gt,Ot,Zt,je,Ht.convert(Vn),Ht.convert(Rn),Mt)}finally{let Zn=b!==null?Ae.get(b).__webglFramebuffer:null;de.bindFramebuffer(te.FRAMEBUFFER,Zn)}}},this.readRenderTargetPixelsAsync=async function(xt,gt,Ot,Zt,je,Mt,Kt){if(!(xt&&xt.isWebGLRenderTarget))throw Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let nn=Ae.get(xt).__webglFramebuffer;if(xt.isWebGLCubeRenderTarget&&Kt!==void 0)nn=nn[Kt];if(nn){de.bindFramebuffer(te.FRAMEBUFFER,nn);try{let Zn=xt.texture,{format:Vn,type:Rn}=Zn;if(!ue.textureFormatReadable(Vn))throw Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!ue.textureTypeReadable(Rn))throw Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(gt>=0&&gt<=xt.width-Zt&&(Ot>=0&&Ot<=xt.height-je)){let Bn=te.createBuffer();te.bindBuffer(te.PIXEL_PACK_BUFFER,Bn),te.bufferData(te.PIXEL_PACK_BUFFER,Mt.byteLength,te.STREAM_READ),te.readPixels(gt,Ot,Zt,je,Ht.convert(Vn),Ht.convert(Rn),0),te.flush();let ho=te.fenceSync(te.SYNC_GPU_COMMANDS_COMPLETE,0);await n4o(te,ho,4);try{te.bindBuffer(te.PIXEL_PACK_BUFFER,Bn),te.getBufferSubData(te.PIXEL_PACK_BUFFER,0,Mt)}finally{te.deleteBuffer(Bn),te.deleteSync(ho)}return Mt}}finally{let Zn=b!==null?Ae.get(b).__webglFramebuffer:null;de.bindFramebuffer(te.FRAMEBUFFER,Zn)}}},this.copyFramebufferToTexture=function(xt,gt=null,Ot=0){if(xt.isTexture!==!0)console.warn("WebGLRenderer: copyFramebufferToTexture function signature has changed."),gt=arguments[0]||null,xt=arguments[1];let Zt=Math.pow(2,-Ot),je=Math.floor(xt.image.width*Zt),Mt=Math.floor(xt.image.height*Zt),Kt=gt!==null?gt.x:0,nn=gt!==null?gt.y:0;xe.setTexture2D(xt,0),te.copyTexSubImage2D(te.TEXTURE_2D,Ot,0,0,Kt,nn,je,Mt),de.unbindTexture()},this.copyTextureToTexture=function(xt,gt,Ot=null,Zt=null,je=0){if(xt.isTexture!==!0)console.warn("WebGLRenderer: copyTextureToTexture function signature has changed."),Zt=arguments[0]||null,xt=arguments[1],gt=arguments[2],je=arguments[3]||0,Ot=null;let Mt,Kt,nn,Zn,Vn,Rn;if(Ot!==null)Mt=Ot.max.x-Ot.min.x,Kt=Ot.max.y-Ot.min.y,nn=Ot.min.x,Zn=Ot.min.y;else Mt=xt.image.width,Kt=xt.image.height,nn=0,Zn=0;if(Zt!==null)Vn=Zt.x,Rn=Zt.y;else Vn=0,Rn=0;let Bn=Ht.convert(gt.format),ho=Ht.convert(gt.type);xe.setTexture2D(gt,0),te.pixelStorei(te.UNPACK_FLIP_Y_WEBGL,gt.flipY),te.pixelStorei(te.UNPACK_PREMULTIPLY_ALPHA_WEBGL,gt.premultiplyAlpha),te.pixelStorei(te.UNPACK_ALIGNMENT,gt.unpackAlignment);let Qo=te.getParameter(te.UNPACK_ROW_LENGTH),Nn=te.getParameter(te.UNPACK_IMAGE_HEIGHT),mo=te.getParameter(te.UNPACK_SKIP_PIXELS),Io=te.getParameter(te.UNPACK_SKIP_ROWS),io=te.getParameter(te.UNPACK_SKIP_IMAGES),Wo=xt.isCompressedTexture?xt.mipmaps[je]:xt.image;if(te.pixelStorei(te.UNPACK_ROW_LENGTH,Wo.width),te.pixelStorei(te.UNPACK_IMAGE_HEIGHT,Wo.height),te.pixelStorei(te.UNPACK_SKIP_PIXELS,nn),te.pixelStorei(te.UNPACK_SKIP_ROWS,Zn),xt.isDataTexture)te.texSubImage2D(te.TEXTURE_2D,je,Vn,Rn,Mt,Kt,Bn,ho,Wo.data);else if(xt.isCompressedTexture)te.compressedTexSubImage2D(te.TEXTURE_2D,je,Vn,Rn,Wo.width,Wo.height,Bn,Wo.data);else te.texSubImage2D(te.TEXTURE_2D,je,Vn,Rn,Bn,ho,Wo);if(te.pixelStorei(te.UNPACK_ROW_LENGTH,Qo),te.pixelStorei(te.UNPACK_IMAGE_HEIGHT,Nn),te.pixelStorei(te.UNPACK_SKIP_PIXELS,mo),te.pixelStorei(te.UNPACK_SKIP_ROWS,Io),te.pixelStorei(te.UNPACK_SKIP_IMAGES,io),je===0&&gt.generateMipmaps)te.generateMipmap(te.TEXTURE_2D);de.unbindTexture()},this.copyTextureToTexture3D=function(xt,gt,Ot=null,Zt=null,je=0){if(xt.isTexture!==!0)console.warn("WebGLRenderer: copyTextureToTexture3D function signature has changed."),Ot=arguments[0]||null,Zt=arguments[1]||null,xt=arguments[2],gt=arguments[3],je=arguments[4]||0;let Mt,Kt,nn,Zn,Vn,Rn,Bn,ho,Qo,Nn=xt.isCompressedTexture?xt.mipmaps[je]:xt.image;if(Ot!==null)Mt=Ot.max.x-Ot.min.x,Kt=Ot.max.y-Ot.min.y,nn=Ot.max.z-Ot.min.z,Zn=Ot.min.x,Vn=Ot.min.y,Rn=Ot.min.z;else Mt=Nn.width,Kt=Nn.height,nn=Nn.depth,Zn=0,Vn=0,Rn=0;if(Zt!==null)Bn=Zt.x,ho=Zt.y,Qo=Zt.z;else Bn=0,ho=0,Qo=0;let mo=Ht.convert(gt.format),Io=Ht.convert(gt.type),io;if(gt.isData3DTexture)xe.setTexture3D(gt,0),io=te.TEXTURE_3D;else if(gt.isDataArrayTexture||gt.isCompressedArrayTexture)xe.setTexture2DArray(gt,0),io=te.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}te.pixelStorei(te.UNPACK_FLIP_Y_WEBGL,gt.flipY),te.pixelStorei(te.UNPACK_PREMULTIPLY_ALPHA_WEBGL,gt.premultiplyAlpha),te.pixelStorei(te.UNPACK_ALIGNMENT,gt.unpackAlignment);let Wo=te.getParameter(te.UNPACK_ROW_LENGTH),rr=te.getParameter(te.UNPACK_IMAGE_HEIGHT),xr=te.getParameter(te.UNPACK_SKIP_PIXELS),Ci=te.getParameter(te.UNPACK_SKIP_ROWS),ea=te.getParameter(te.UNPACK_SKIP_IMAGES);if(te.pixelStorei(te.UNPACK_ROW_LENGTH,Nn.width),te.pixelStorei(te.UNPACK_IMAGE_HEIGHT,Nn.height),te.pixelStorei(te.UNPACK_SKIP_PIXELS,Zn),te.pixelStorei(te.UNPACK_SKIP_ROWS,Vn),te.pixelStorei(te.UNPACK_SKIP_IMAGES,Rn),xt.isDataTexture||xt.isData3DTexture)te.texSubImage3D(io,je,Bn,ho,Qo,Mt,Kt,nn,mo,Io,Nn.data);else if(gt.isCompressedArrayTexture)te.compressedTexSubImage3D(io,je,Bn,ho,Qo,Mt,Kt,nn,mo,Nn.data);else te.texSubImage3D(io,je,Bn,ho,Qo,Mt,Kt,nn,mo,Io,Nn);if(te.pixelStorei(te.UNPACK_ROW_LENGTH,Wo),te.pixelStorei(te.UNPACK_IMAGE_HEIGHT,rr),te.pixelStorei(te.UNPACK_SKIP_PIXELS,xr),te.pixelStorei(te.UNPACK_SKIP_ROWS,Ci),te.pixelStorei(te.UNPACK_SKIP_IMAGES,ea),je===0&&gt.generateMipmaps)te.generateMipmap(io);de.unbindTexture()},this.initRenderTarget=function(xt){if(Ae.get(xt).__webglFramebuffer===void 0)xe.setupRenderTarget(xt)},this.initTexture=function(xt){if(xt.isCubeTexture)xe.setTextureCube(xt,0);else if(xt.isData3DTexture)xe.setTexture3D(xt,0);else if(xt.isDataArrayTexture||xt.isCompressedArrayTexture)xe.setTexture2DArray(xt,0);else xe.setTexture2D(xt,0);de.unbindTexture()},this.resetState=function(){x=0,C=0,b=null,de.reset(),Tt.reset()},typeof __THREE_DEVTOOLS__<"u")__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return 2000}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;let t=this.getContext();t.drawingBufferColorSpace=e==="display-p3"?"display-p3":"srgb",t.unpackColorSpace=Zh.workingColorSpace==="display-p3-linear"?"display-p3":"srgb"}}class Dy extends Sl{constructor(){super();if(this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new FA,this.environmentIntensity=1,this.environmentRotation=new FA,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u")__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){if(super.copy(e,t),e.background!==null)this.background=e.background.clone();if(e.environment!==null)this.environment=e.environment.clone();if(e.fog!==null)this.fog=e.fog.clone();if(this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null)this.overrideMaterial=e.overrideMaterial.clone();return this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){let t=super.toJSON(e);if(this.fog!==null)t.object.fog=this.fog.toJSON();if(this.backgroundBlurriness>0)t.object.backgroundBlurriness=this.backgroundBlurriness;if(this.backgroundIntensity!==1)t.object.backgroundIntensity=this.backgroundIntensity;if(t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1)t.object.environmentIntensity=this.environmentIntensity;return t.object.environmentRotation=this.environmentRotation.toArray(),t}}class WAe{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=35044,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=wb()}onUploadCallback(){}set needsUpdate(e){if(e===!0)this.version++}get updateRange(){return _Qe("THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let o=0,r=this.stride;o<r;o++)this.array[e+o]=t.array[n+o];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){if(e.arrayBuffers===void 0)e.arrayBuffers={};if(this.array.buffer._uuid===void 0)this.array.buffer._uuid=wb();if(e.arrayBuffers[this.array.buffer._uuid]===void 0)e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer;let t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(t,this.stride);return n.setUsage(this.usage),n}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){if(e.arrayBuffers===void 0)e.arrayBuffers={};if(this.array.buffer._uuid===void 0)this.array.buffer._uuid=wb();if(e.arrayBuffers[this.array.buffer._uuid]===void 0)e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer));return{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}var By=new Et;class Kre{constructor(e,t,n,o=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=o}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,n=this.data.count;t<n;t++)By.fromBufferAttribute(this,t),By.applyMatrix4(e),this.setXYZ(t,By.x,By.y,By.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)By.fromBufferAttribute(this,t),By.applyNormalMatrix(e),this.setXYZ(t,By.x,By.y,By.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)By.fromBufferAttribute(this,t),By.transformDirection(e),this.setXYZ(t,By.x,By.y,By.z);return this}getComponent(e,t){let n=this.array[e*this.data.stride+this.offset+t];if(this.normalized)n=w9(n,this.array);return n}setComponent(e,t,n){if(this.normalized)n=Jh(n,this.array);return this.data.array[e*this.data.stride+this.offset+t]=n,this}setX(e,t){if(this.normalized)t=Jh(t,this.array);return this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){if(this.normalized)t=Jh(t,this.array);return this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){if(this.normalized)t=Jh(t,this.array);return this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){if(this.normalized)t=Jh(t,this.array);return this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];if(this.normalized)t=w9(t,this.array);return t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];if(this.normalized)t=w9(t,this.array);return t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];if(this.normalized)t=w9(t,this.array);return t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];if(this.normalized)t=w9(t,this.array);return t}setXY(e,t,n){if(e=e*this.data.stride+this.offset,this.normalized)t=Jh(t,this.array),n=Jh(n,this.array);return this.data.array[e+0]=t,this.data.array[e+1]=n,this}setXYZ(e,t,n,o){if(e=e*this.data.stride+this.offset,this.normalized)t=Jh(t,this.array),n=Jh(n,this.array),o=Jh(o,this.array);return this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=o,this}setXYZW(e,t,n,o,r){if(e=e*this.data.stride+this.offset,this.normalized)t=Jh(t,this.array),n=Jh(n,this.array),o=Jh(o,this.array),r=Jh(r,this.array);return this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=o,this.data.array[e+3]=r,this}clone(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");let t=[];for(let n=0;n<this.count;n++){let o=n*this.data.stride+this.offset;for(let r=0;r<this.itemSize;r++)t.push(this.data.array[o+r])}return new Pl(new this.array.constructor(t),this.itemSize,this.normalized)}else{if(e.interleavedBuffers===void 0)e.interleavedBuffers={};if(e.interleavedBuffers[this.data.uuid]===void 0)e.interleavedBuffers[this.data.uuid]=this.data.clone(e);return new Kre(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}}toJSON(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");let t=[];for(let n=0;n<this.count;n++){let o=n*this.data.stride+this.offset;for(let r=0;r<this.itemSize;r++)t.push(this.data.array[o+r])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}else{if(e.interleavedBuffers===void 0)e.interleavedBuffers={};if(e.interleavedBuffers[this.data.uuid]===void 0)e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e);return{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}}var Ext=new Et,Mxt=new zh,wxt=new zh,X6o=new Et,Bxt=new Gi,gAe=new Et,JRe=new v_,Txt=new Gi,ZRe=new V7;class vQe extends Mo{constructor(e,t){super(e,t);this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new Gi,this.bindMatrixInverse=new Gi,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){let e=this.geometry;if(this.boundingBox===null)this.boundingBox=new Mu;this.boundingBox.makeEmpty();let t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,gAe),this.boundingBox.expandByPoint(gAe)}computeBoundingSphere(){let e=this.geometry;if(this.boundingSphere===null)this.boundingSphere=new v_;this.boundingSphere.makeEmpty();let t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,gAe),this.boundingSphere.expandByPoint(gAe)}copy(e,t){if(super.copy(e,t),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,e.boundingBox!==null)this.boundingBox=e.boundingBox.clone();if(e.boundingSphere!==null)this.boundingSphere=e.boundingSphere.clone();return this}raycast(e,t){let n=this.material,o=this.matrixWorld;if(n===void 0)return;if(this.boundingSphere===null)this.computeBoundingSphere();if(JRe.copy(this.boundingSphere),JRe.applyMatrix4(o),e.ray.intersectsSphere(JRe)===!1)return;if(Txt.copy(o).invert(),ZRe.copy(e.ray).applyMatrix4(Txt),this.boundingBox!==null){if(ZRe.intersectsBox(this.boundingBox)===!1)return}this._computeIntersections(e,t,ZRe)}getVertexPosition(e,t){return super.getVertexPosition(e,t),this.applyBoneTransform(e,t),t}bind(e,t){if(this.skeleton=e,t===void 0)this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld;this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){let e=new zh,t=this.geometry.attributes.skinWeight;for(let n=0,o=t.count;n<o;n++){e.fromBufferAttribute(t,n);let r=1/e.manhattanLength();if(r!==1/0)e.multiplyScalar(r);else e.set(1,0,0,0);t.setXYZW(n,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){if(super.updateMatrixWorld(e),this.bindMode==="attached")this.bindMatrixInverse.copy(this.matrixWorld).invert();else if(this.bindMode==="detached")this.bindMatrixInverse.copy(this.bindMatrix).invert();else console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){let n=this.skeleton,o=this.geometry;Mxt.fromBufferAttribute(o.attributes.skinIndex,e),wxt.fromBufferAttribute(o.attributes.skinWeight,e),Ext.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let r=0;r<4;r++){let i=wxt.getComponent(r);if(i!==0){let s=Mxt.getComponent(r);Bxt.multiplyMatrices(n.bones[s].matrixWorld,n.boneInverses[s]),t.addScaledVector(X6o.copy(Ext).applyMatrix4(Bxt),i)}}return t.applyMatrix4(this.bindMatrixInverse)}}class XAe extends Sl{constructor(){super();this.isBone=!0,this.type="Bone"}}class ZX extends vl{constructor(e=null,t=1,n=1,o,r,i,s,a,c=1003,l=1003,h,d){super(null,i,s,a,c,l,o,r,h,d);this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}var Dxt=new Gi,j6o=new Gi;class jAe{constructor(e=[],t=[]){this.uuid=wb(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.init()}init(){let e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(e.length*16),t.length===0)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let n=0,o=this.bones.length;n<o;n++)this.boneInverses.push(new Gi)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){let n=new Gi;if(this.bones[e])n.copy(this.bones[e].matrixWorld).invert();this.boneInverses.push(n)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){let n=this.bones[e];if(n)n.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){let n=this.bones[e];if(n){if(n.parent&&n.parent.isBone)n.matrix.copy(n.parent.matrixWorld).invert(),n.matrix.multiply(n.matrixWorld);else n.matrix.copy(n.matrixWorld);n.matrix.decompose(n.position,n.quaternion,n.scale)}}}update(){let e=this.bones,t=this.boneInverses,n=this.boneMatrices,o=this.boneTexture;for(let r=0,i=e.length;r<i;r++){let s=e[r]?e[r].matrixWorld:j6o;Dxt.multiplyMatrices(s,t[r]),Dxt.toArray(n,r*16)}if(o!==null)o.needsUpdate=!0}clone(){return new jAe(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);let t=new Float32Array(e*e*4);t.set(this.boneMatrices);let n=new ZX(t,e,e,1023,1015);return n.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=n,this}getBoneByName(e){for(let t=0,n=this.bones.length;t<n;t++){let o=this.bones[t];if(o.name===e)return o}return}dispose(){if(this.boneTexture!==null)this.boneTexture.dispose(),this.boneTexture=null}fromJSON(e,t){this.uuid=e.uuid;for(let n=0,o=e.bones.length;n<o;n++){let r=e.bones[n],i=t[r];if(i===void 0)console.warn("THREE.Skeleton: No bone found with UUID:",r),i=new XAe;this.bones.push(i),this.boneInverses.push(new Gi().fromArray(e.boneInverses[n]))}return this.init(),this}toJSON(){let e={metadata:{version:4.6,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;let t=this.bones,n=this.boneInverses;for(let o=0,r=t.length;o<r;o++){let i=t[o];e.bones.push(i.uuid);let s=n[o];e.boneInverses.push(s.toArray())}return e}}class Mz extends Pl{constructor(e,t,n,o=1){super(e,t,n);this.isInstancedBufferAttribute=!0,this.meshPerAttribute=o}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){let e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}var UX=new Gi,Nxt=new Gi,AAe=[],Rxt=new Mu,K6o=new Gi,Bre=new Mo,Tre=new v_;class SQe extends Mo{constructor(e,t,n){super(e,t);this.isInstancedMesh=!0,this.instanceMatrix=new Mz(new Float32Array(n*16),16),this.instanceColor=null,this.morphTexture=null,this.count=n,this.boundingBox=null,this.boundingSphere=null;for(let o=0;o<n;o++)this.setMatrixAt(o,K6o)}computeBoundingBox(){let e=this.geometry,t=this.count;if(this.boundingBox===null)this.boundingBox=new Mu;if(e.boundingBox===null)e.computeBoundingBox();this.boundingBox.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,UX),Rxt.copy(e.boundingBox).applyMatrix4(UX),this.boundingBox.union(Rxt)}computeBoundingSphere(){let e=this.geometry,t=this.count;if(this.boundingSphere===null)this.boundingSphere=new v_;if(e.boundingSphere===null)e.computeBoundingSphere();this.boundingSphere.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,UX),Tre.copy(e.boundingSphere).applyMatrix4(UX),this.boundingSphere.union(Tre)}copy(e,t){if(super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),e.morphTexture!==null)this.morphTexture=e.morphTexture.clone();if(e.instanceColor!==null)this.instanceColor=e.instanceColor.clone();if(this.count=e.count,e.boundingBox!==null)this.boundingBox=e.boundingBox.clone();if(e.boundingSphere!==null)this.boundingSphere=e.boundingSphere.clone();return this}getColorAt(e,t){t.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,e*16)}getMorphAt(e,t){let n=t.morphTargetInfluences,o=this.morphTexture.source.data.data,r=n.length+1,i=e*r+1;for(let s=0;s<n.length;s++)n[s]=o[i+s]}raycast(e,t){let n=this.matrixWorld,o=this.count;if(Bre.geometry=this.geometry,Bre.material=this.material,Bre.material===void 0)return;if(this.boundingSphere===null)this.computeBoundingSphere();if(Tre.copy(this.boundingSphere),Tre.applyMatrix4(n),e.ray.intersectsSphere(Tre)===!1)return;for(let r=0;r<o;r++){this.getMatrixAt(r,UX),Nxt.multiplyMatrices(n,UX),Bre.matrixWorld=Nxt,Bre.raycast(e,AAe);for(let i=0,s=AAe.length;i<s;i++){let a=AAe[i];a.instanceId=r,a.object=this,t.push(a)}AAe.length=0}}setColorAt(e,t){if(this.instanceColor===null)this.instanceColor=new Mz(new Float32Array(this.instanceMatrix.count*3),3);t.toArray(this.instanceColor.array,e*3)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,e*16)}setMorphAt(e,t){let n=t.morphTargetInfluences,o=n.length+1;if(this.morphTexture===null)this.morphTexture=new ZX(new Float32Array(o*this.count),o,this.count,1028,1015);let r=this.morphTexture.source.data.data,i=0;for(let c=0;c<n.length;c++)i+=n[c];let s=this.geometry.morphTargetsRelative?1:1-i,a=o*e;r[a]=s,r.set(n,a+1)}updateMorphTargets(){}dispose(){if(this.dispatchEvent({type:"dispose"}),this.morphTexture!==null)this.morphTexture.dispose(),this.morphTexture=null;return this}}class n2 extends zA{constructor(e){super();this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new No(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}var BAe=new Et,TAe=new Et,Qxt=new Gi,Dre=new V7,fAe=new v_,eQe=new Et,kxt=new Et;class $re extends Sl{constructor(e=new js,t=new n2){super();this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){let e=this.geometry;if(e.index===null){let t=e.attributes.position,n=[0];for(let o=1,r=t.count;o<r;o++)BAe.fromBufferAttribute(t,o-1),TAe.fromBufferAttribute(t,o),n[o]=n[o-1],n[o]+=BAe.distanceTo(TAe);e.setAttribute("lineDistance",new Wr(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){let n=this.geometry,o=this.matrixWorld,r=e.params.Line.threshold,i=n.drawRange;if(n.boundingSphere===null)n.computeBoundingSphere();if(fAe.copy(n.boundingSphere),fAe.applyMatrix4(o),fAe.radius+=r,e.ray.intersectsSphere(fAe)===!1)return;Qxt.copy(o).invert(),Dre.copy(e.ray).applyMatrix4(Qxt);let s=r/((this.scale.x+this.scale.y+this.scale.z)/3),a=s*s,c=this.isLineSegments?2:1,l=n.index,d=n.attributes.position;if(l!==null){let u=Math.max(0,i.start),_=Math.min(l.count,i.start+i.count);for(let p=u,m=_-1;p<m;p+=c){let A=l.getX(p),g=l.getX(p+1),f=yAe(this,e,Dre,a,A,g);if(f)t.push(f)}if(this.isLineLoop){let p=l.getX(_-1),m=l.getX(u),A=yAe(this,e,Dre,a,p,m);if(A)t.push(A)}}else{let u=Math.max(0,i.start),_=Math.min(d.count,i.start+i.count);for(let p=u,m=_-1;p<m;p+=c){let A=yAe(this,e,Dre,a,p,p+1);if(A)t.push(A)}if(this.isLineLoop){let p=yAe(this,e,Dre,a,_-1,u);if(p)t.push(p)}}}updateMorphTargets(){let t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){let o=t[n[0]];if(o!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,i=o.length;r<i;r++){let s=o[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[s]=r}}}}}function yAe(e,t,n,o,r,i){let s=e.geometry.attributes.position;if(BAe.fromBufferAttribute(s,r),TAe.fromBufferAttribute(s,i),n.distanceSqToSegment(BAe,TAe,eQe,kxt)>o)return;eQe.applyMatrix4(e.matrixWorld);let c=t.ray.origin.distanceTo(eQe);if(c<t.near||c>t.far)return;return{distance:c,point:kxt.clone().applyMatrix4(e.matrixWorld),index:r,face:null,faceIndex:null,object:e}}var Lxt=new Et,Hxt=new Et;class u3 extends $re{constructor(e,t){super(e,t);this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){let e=this.geometry;if(e.index===null){let t=e.attributes.position,n=[];for(let o=0,r=t.count;o<r;o+=2)Lxt.fromBufferAttribute(t,o),Hxt.fromBufferAttribute(t,o+1),n[o]=o===0?0:n[o-1],n[o+1]=n[o]+Lxt.distanceTo(Hxt);e.setAttribute("lineDistance",new Wr(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class qre extends $re{constructor(e,t){super(e,t);this.isLineLoop=!0,this.type="LineLoop"}}class T9 extends zA{constructor(e){super();this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new No(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}var Fxt=new Gi,cQe=new V7,xAe=new v_,CAe=new Et;class pw extends Sl{constructor(e=new js,t=new T9){super();this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){let n=this.geometry,o=this.matrixWorld,r=e.params.Points.threshold,i=n.drawRange;if(n.boundingSphere===null)n.computeBoundingSphere();if(xAe.copy(n.boundingSphere),xAe.applyMatrix4(o),xAe.radius+=r,e.ray.intersectsSphere(xAe)===!1)return;Fxt.copy(o).invert(),cQe.copy(e.ray).applyMatrix4(Fxt);let s=r/((this.scale.x+this.scale.y+this.scale.z)/3),a=s*s,c=n.index,h=n.attributes.position;if(c!==null){let d=Math.max(0,i.start),u=Math.min(c.count,i.start+i.count);for(let _=d,p=u;_<p;_++){let m=c.getX(_);CAe.fromBufferAttribute(h,m),zxt(CAe,m,a,o,e,t,this)}}else{let d=Math.max(0,i.start),u=Math.min(h.count,i.start+i.count);for(let _=d,p=u;_<p;_++)CAe.fromBufferAttribute(h,_),zxt(CAe,_,a,o,e,t,this)}}updateMorphTargets(){let t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){let o=t[n[0]];if(o!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,i=o.length;r<i;r++){let s=o[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[s]=r}}}}}function zxt(e,t,n,o,r,i,s){let a=cQe.distanceSqToPoint(e);if(a<n){let c=new Et;cQe.closestPointToPoint(e,c),c.applyMatrix4(o);let l=r.ray.origin.distanceTo(c);if(l<r.near||l>r.far)return;i.push({distance:l,distanceToRay:Math.sqrt(a),point:c,index:t,face:null,object:s})}}class Jre extends vl{constructor(e,t,n,o,r,i,s,a,c,l,h,d){super(null,i,s,a,c,l,o,r,h,d);this.isCompressedTexture=!0,this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class Id extends vl{constructor(e,t,n,o,r,i,s,a,c){super(e,t,n,o,r,i,s,a,c);this.isCanvasTexture=!0,this.needsUpdate=!0}}class D9{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){let n=this.getUtoTmapping(e);return this.getPoint(n,t)}getPoints(e=5){let t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return t}getSpacedPoints(e=5){let t=[];for(let n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t}getLength(){let e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;let t=[],n,o=this.getPoint(0),r=0;t.push(0);for(let i=1;i<=e;i++)n=this.getPoint(i/e),r+=n.distanceTo(o),t.push(r),o=n;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){let n=this.getLengths(),o=0,r=n.length,i;if(t)i=t;else i=e*n[r-1];let s=0,a=r-1,c;while(s<=a)if(o=Math.floor(s+(a-s)/2),c=n[o]-i,c<0)s=o+1;else if(c>0)a=o-1;else{a=o;break}if(o=a,n[o]===i)return o/(r-1);let l=n[o],d=n[o+1]-l,u=(i-l)/d;return(o+u)/(r-1)}getTangent(e,t){let o=e-0.0001,r=e+0.0001;if(o<0)o=0;if(r>1)r=1;let i=this.getPoint(o),s=this.getPoint(r),a=t||(i.isVector2?new ro:new Et);return a.copy(s).sub(i).normalize(),a}getTangentAt(e,t){let n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t){let n=new Et,o=[],r=[],i=[],s=new Et,a=new Gi;for(let u=0;u<=e;u++){let _=u/e;o[u]=this.getTangentAt(_,new Et)}r[0]=new Et,i[0]=new Et;let c=Number.MAX_VALUE,l=Math.abs(o[0].x),h=Math.abs(o[0].y),d=Math.abs(o[0].z);if(l<=c)c=l,n.set(1,0,0);if(h<=c)c=h,n.set(0,1,0);if(d<=c)n.set(0,0,1);s.crossVectors(o[0],n).normalize(),r[0].crossVectors(o[0],s),i[0].crossVectors(o[0],r[0]);for(let u=1;u<=e;u++){if(r[u]=r[u-1].clone(),i[u]=i[u-1].clone(),s.crossVectors(o[u-1],o[u]),s.length()>Number.EPSILON){s.normalize();let _=Math.acos(Qg(o[u-1].dot(o[u]),-1,1));r[u].applyMatrix4(a.makeRotationAxis(s,_))}i[u].crossVectors(o[u],r[u])}if(t===!0){let u=Math.acos(Qg(r[0].dot(r[e]),-1,1));if(u/=e,o[0].dot(s.crossVectors(r[0],r[e]))>0)u=-u;for(let _=1;_<=e;_++)r[_].applyMatrix4(a.makeRotationAxis(o[_],u*_)),i[_].crossVectors(o[_],r[_])}return{tangents:o,normals:r,binormals:i}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){let e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class KAe extends D9{constructor(e=0,t=0,n=1,o=1,r=0,i=Math.PI*2,s=!1,a=0){super();this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=o,this.aStartAngle=r,this.aEndAngle=i,this.aClockwise=s,this.aRotation=a}getPoint(e,t=new ro){let n=t,o=Math.PI*2,r=this.aEndAngle-this.aStartAngle,i=Math.abs(r)<Number.EPSILON;while(r<0)r+=o;while(r>o)r-=o;if(r<Number.EPSILON)if(i)r=0;else r=o;if(this.aClockwise===!0&&!i)if(r===o)r=-o;else r=r-o;let s=this.aStartAngle+e*r,a=this.aX+this.xRadius*Math.cos(s),c=this.aY+this.yRadius*Math.sin(s);if(this.aRotation!==0){let l=Math.cos(this.aRotation),h=Math.sin(this.aRotation),d=a-this.aX,u=c-this.aY;a=d*l-u*h+this.aX,c=d*h+u*l+this.aY}return n.set(a,c)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){let e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}class S5t extends KAe{constructor(e,t,n,o,r,i){super(e,t,n,n,o,r,i);this.isArcCurve=!0,this.type="ArcCurve"}}function PQe(){let e=0,t=0,n=0,o=0;function r(i,s,a,c){e=i,t=a,n=-3*i+3*s-2*a-c,o=2*i-2*s+a+c}return{initCatmullRom:function(i,s,a,c,l){r(s,a,l*(a-i),l*(c-s))},initNonuniformCatmullRom:function(i,s,a,c,l,h,d){let u=(s-i)/l-(a-i)/(l+h)+(a-s)/h,_=(a-s)/h-(c-s)/(h+d)+(c-a)/d;u*=h,_*=h,r(s,a,u,_)},calc:function(i){let s=i*i,a=s*i;return e+t*i+n*s+o*a}}}var bAe=new Et,tQe=new PQe,nQe=new PQe,oQe=new PQe;class $Ae extends D9{constructor(e=[],t=!1,n="centripetal",o=0.5){super();this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=n,this.tension=o}getPoint(e,t=new Et){let n=t,o=this.points,r=o.length,i=(r-(this.closed?0:1))*e,s=Math.floor(i),a=i-s;if(this.closed)s+=s>0?0:(Math.floor(Math.abs(s)/r)+1)*r;else if(a===0&&s===r-1)s=r-2,a=1;let c,l;if(this.closed||s>0)c=o[(s-1)%r];else bAe.subVectors(o[0],o[1]).add(o[0]),c=bAe;let h=o[s%r],d=o[(s+1)%r];if(this.closed||s+2<r)l=o[(s+2)%r];else bAe.subVectors(o[r-1],o[r-2]).add(o[r-1]),l=bAe;if(this.curveType==="centripetal"||this.curveType==="chordal"){let u=this.curveType==="chordal"?0.5:0.25,_=Math.pow(c.distanceToSquared(h),u),p=Math.pow(h.distanceToSquared(d),u),m=Math.pow(d.distanceToSquared(l),u);if(p<0.0001)p=1;if(_<0.0001)_=p;if(m<0.0001)m=p;tQe.initNonuniformCatmullRom(c.x,h.x,d.x,l.x,_,p,m),nQe.initNonuniformCatmullRom(c.y,h.y,d.y,l.y,_,p,m),oQe.initNonuniformCatmullRom(c.z,h.z,d.z,l.z,_,p,m)}else if(this.curveType==="catmullrom")tQe.initCatmullRom(c.x,h.x,d.x,l.x,this.tension),nQe.initCatmullRom(c.y,h.y,d.y,l.y,this.tension),oQe.initCatmullRom(c.z,h.z,d.z,l.z,this.tension);return n.set(tQe.calc(a),nQe.calc(a),oQe.calc(a)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){let o=e.points[t];this.points.push(o.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){let e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){let o=this.points[t];e.points.push(o.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){let o=e.points[t];this.points.push(new Et().fromArray(o))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}function Oxt(e,t,n,o,r){let i=(o-t)*0.5,s=(r-n)*0.5,a=e*e,c=e*a;return(2*n-2*o+i+s)*c+(-3*n+3*o-2*i-s)*a+i*e+n}function $6o(e,t){let n=1-e;return n*n*t}function q6o(e,t){return 2*(1-e)*e*t}function J6o(e,t){return e*e*t}function Lre(e,t,n,o){return $6o(e,t)+q6o(e,n)+J6o(e,o)}function Z6o(e,t){let n=1-e;return n*n*n*t}function eIo(e,t){let n=1-e;return 3*n*n*e*t}function tIo(e,t){return 3*(1-e)*e*e*t}function nIo(e,t){return e*e*e*t}function Hre(e,t,n,o,r){return Z6o(e,t)+eIo(e,n)+tIo(e,o)+nIo(e,r)}class EQe extends D9{constructor(e=new ro,t=new ro,n=new ro,o=new ro){super();this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=n,this.v3=o}getPoint(e,t=new ro){let n=t,o=this.v0,r=this.v1,i=this.v2,s=this.v3;return n.set(Hre(e,o.x,r.x,i.x,s.x),Hre(e,o.y,r.y,i.y,s.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class P5t extends D9{constructor(e=new Et,t=new Et,n=new Et,o=new Et){super();this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=n,this.v3=o}getPoint(e,t=new Et){let n=t,o=this.v0,r=this.v1,i=this.v2,s=this.v3;return n.set(Hre(e,o.x,r.x,i.x,s.x),Hre(e,o.y,r.y,i.y,s.y),Hre(e,o.z,r.z,i.z,s.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class MQe extends D9{constructor(e=new ro,t=new ro){super();this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new ro){let n=t;if(e===1)n.copy(this.v2);else n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1);return n}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new ro){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class E5t extends D9{constructor(e=new Et,t=new Et){super();this.isLineCurve3=!0,this.type="LineCurve3",this.v1=e,this.v2=t}getPoint(e,t=new Et){let n=t;if(e===1)n.copy(this.v2);else n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1);return n}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new Et){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class wQe extends D9{constructor(e=new ro,t=new ro,n=new ro){super();this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new ro){let n=t,o=this.v0,r=this.v1,i=this.v2;return n.set(Lre(e,o.x,r.x,i.x),Lre(e,o.y,r.y,i.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class M5t extends D9{constructor(e=new Et,t=new Et,n=new Et){super();this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new Et){let n=t,o=this.v0,r=this.v1,i=this.v2;return n.set(Lre(e,o.x,r.x,i.x),Lre(e,o.y,r.y,i.y),Lre(e,o.z,r.z,i.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class BQe extends D9{constructor(e=[]){super();this.isSplineCurve=!0,this.type="SplineCurve",this.points=e}getPoint(e,t=new ro){let n=t,o=this.points,r=(o.length-1)*e,i=Math.floor(r),s=r-i,a=o[i===0?i:i-1],c=o[i],l=o[i>o.length-2?o.length-1:i+1],h=o[i>o.length-3?o.length-1:i+2];return n.set(Oxt(s,a.x,c.x,l.x,h.x),Oxt(s,a.y,c.y,l.y,h.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){let o=e.points[t];this.points.push(o.clone())}return this}toJSON(){let e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){let o=this.points[t];e.points.push(o.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){let o=e.points[t];this.points.push(new ro().fromArray(o))}return this}}var lQe=Object.freeze({__proto__:null,ArcCurve:S5t,CatmullRomCurve3:$Ae,CubicBezierCurve:EQe,CubicBezierCurve3:P5t,EllipseCurve:KAe,LineCurve:MQe,LineCurve3:E5t,QuadraticBezierCurve:wQe,QuadraticBezierCurve3:M5t,SplineCurve:BQe});class w5t extends D9{constructor(){super();this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){let e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);if(!e.equals(t)){let n=e.isVector2===!0?"LineCurve":"LineCurve3";this.curves.push(new lQe[n](t,e))}return this}getPoint(e,t){let n=e*this.getLength(),o=this.getCurveLengths(),r=0;while(r<o.length){if(o[r]>=n){let i=o[r]-n,s=this.curves[r],a=s.getLength(),c=a===0?0:1-i/a;return s.getPointAt(c,t)}r++}return null}getLength(){let e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;let e=[],t=0;for(let n=0,o=this.curves.length;n<o;n++)t+=this.curves[n].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){let t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));if(this.autoClose)t.push(t[0]);return t}getPoints(e=12){let t=[],n;for(let o=0,r=this.curves;o<r.length;o++){let i=r[o],s=i.isEllipseCurve?e*2:i.isLineCurve||i.isLineCurve3?1:i.isSplineCurve?e*i.points.length:e,a=i.getPoints(s);for(let c=0;c<a.length;c++){let l=a[c];if(n&&n.equals(l))continue;t.push(l),n=l}}if(this.autoClose&&t.length>1&&!t[t.length-1].equals(t[0]))t.push(t[0]);return t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){let o=e.curves[t];this.curves.push(o.clone())}return this.autoClose=e.autoClose,this}toJSON(){let e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,n=this.curves.length;t<n;t++){let o=this.curves[t];e.curves.push(o.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){let o=e.curves[t];this.curves.push(new lQe[o.type]().fromJSON(o))}return this}}class Ore extends w5t{constructor(e){super();if(this.type="Path",this.currentPoint=new ro,e)this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,n=e.length;t<n;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){let n=new MQe(this.currentPoint.clone(),new ro(e,t));return this.curves.push(n),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,n,o){let r=new wQe(this.currentPoint.clone(),new ro(e,t),new ro(n,o));return this.curves.push(r),this.currentPoint.set(n,o),this}bezierCurveTo(e,t,n,o,r,i){let s=new EQe(this.currentPoint.clone(),new ro(e,t),new ro(n,o),new ro(r,i));return this.curves.push(s),this.currentPoint.set(r,i),this}splineThru(e){let t=[this.currentPoint.clone()].concat(e),n=new BQe(t);return this.curves.push(n),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,n,o,r,i){let s=this.currentPoint.x,a=this.currentPoint.y;return this.absarc(e+s,t+a,n,o,r,i),this}absarc(e,t,n,o,r,i){return this.absellipse(e,t,n,n,o,r,i),this}ellipse(e,t,n,o,r,i,s,a){let c=this.currentPoint.x,l=this.currentPoint.y;return this.absellipse(e+c,t+l,n,o,r,i,s,a),this}absellipse(e,t,n,o,r,i,s,a){let c=new KAe(e,t,n,o,r,i,s,a);if(this.curves.length>0){let h=c.getPoint(0);if(!h.equals(this.currentPoint))this.lineTo(h.x,h.y)}this.curves.push(c);let l=c.getPoint(1);return this.currentPoint.copy(l),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){let e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class mw extends js{constructor(e=1,t=1,n=1,o=32,r=1,i=!1,s=0,a=Math.PI*2){super();this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:o,heightSegments:r,openEnded:i,thetaStart:s,thetaLength:a};let c=this;o=Math.floor(o),r=Math.floor(r);let l=[],h=[],d=[],u=[],_=0,p=[],m=n/2,A=0;if(g(),i===!1){if(e>0)f(!0);if(t>0)f(!1)}this.setIndex(l),this.setAttribute("position",new Wr(h,3)),this.setAttribute("normal",new Wr(d,3)),this.setAttribute("uv",new Wr(u,2));function g(){let y=new Et,x=new Et,C=0,b=(t-e)/n;for(let I=0;I<=r;I++){let v=[],P=I/r,M=P*(t-e)+e;for(let B=0;B<=o;B++){let T=B/o,N=T*a+s,D=Math.sin(N),L=Math.cos(N);x.x=M*D,x.y=-P*n+m,x.z=M*L,h.push(x.x,x.y,x.z),y.set(D,b,L).normalize(),d.push(y.x,y.y,y.z),u.push(T,1-P),v.push(_++)}p.push(v)}for(let I=0;I<o;I++)for(let v=0;v<r;v++){let P=p[v][I],M=p[v+1][I],B=p[v+1][I+1],T=p[v][I+1];l.push(P,M,T),l.push(M,B,T),C+=6}c.addGroup(A,C,0),A+=C}function f(y){let x=_,C=new ro,b=new Et,I=0,v=y===!0?e:t,P=y===!0?1:-1;for(let B=1;B<=o;B++)h.push(0,m*P,0),d.push(0,P,0),u.push(0.5,0.5),_++;let M=_;for(let B=0;B<=o;B++){let N=B/o*a+s,D=Math.cos(N),L=Math.sin(N);b.x=v*L,b.y=m*P,b.z=v*D,h.push(b.x,b.y,b.z),d.push(0,P,0),C.x=D*0.5+0.5,C.y=L*0.5*P+0.5,u.push(C.x,C.y),_++}for(let B=0;B<o;B++){let T=x+B,N=M+B;if(y===!0)l.push(N,N+1,T);else l.push(N+1,N,T);I+=3}c.addGroup(A,I,y===!0?1:2),A+=I}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new mw(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class qAe extends mw{constructor(e=1,t=1,n=32,o=1,r=!1,i=0,s=Math.PI*2){super(0,e,t,n,o,r,i,s);this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:o,openEnded:r,thetaStart:i,thetaLength:s}}static fromJSON(e){return new qAe(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}var IAe=new Et,vAe=new Et,rQe=new Et,SAe=new B9;class Zre extends js{constructor(e=null,t=1){super();if(this.type="EdgesGeometry",this.parameters={geometry:e,thresholdAngle:t},e!==null){let o=Math.pow(10,4),r=Math.cos(jX*t),i=e.getIndex(),s=e.getAttribute("position"),a=i?i.count:s.count,c=[0,0,0],l=["a","b","c"],h=[,,,],d={},u=[];for(let _=0;_<a;_+=3){if(i)c[0]=i.getX(_),c[1]=i.getX(_+1),c[2]=i.getX(_+2);else c[0]=_,c[1]=_+1,c[2]=_+2;let{a:p,b:m,c:A}=SAe;if(p.fromBufferAttribute(s,c[0]),m.fromBufferAttribute(s,c[1]),A.fromBufferAttribute(s,c[2]),SAe.getNormal(rQe),h[0]=`${Math.round(p.x*o)},${Math.round(p.y*o)},${Math.round(p.z*o)}`,h[1]=`${Math.round(m.x*o)},${Math.round(m.y*o)},${Math.round(m.z*o)}`,h[2]=`${Math.round(A.x*o)},${Math.round(A.y*o)},${Math.round(A.z*o)}`,h[0]===h[1]||h[1]===h[2]||h[2]===h[0])continue;for(let g=0;g<3;g++){let f=(g+1)%3,y=h[g],x=h[f],C=SAe[l[g]],b=SAe[l[f]],I=`${y}_${x}`,v=`${x}_${y}`;if(v in d&&d[v]){if(rQe.dot(d[v].normal)<=r)u.push(C.x,C.y,C.z),u.push(b.x,b.y,b.z);d[v]=null}else if(!(I in d))d[I]={index0:c[g],index1:c[f],normal:rQe.clone()}}}for(let _ in d)if(d[_]){let{index0:p,index1:m}=d[_];IAe.fromBufferAttribute(s,p),vAe.fromBufferAttribute(s,m),u.push(IAe.x,IAe.y,IAe.z),u.push(vAe.x,vAe.y,vAe.z)}this.setAttribute("position",new Wr(u,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}class JAe extends Ore{constructor(e){super(e);this.uuid=wb(),this.type="Shape",this.holes=[]}getPointsHoles(e){let t=[];for(let n=0,o=this.holes.length;n<o;n++)t[n]=this.holes[n].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){let o=e.holes[t];this.holes.push(o.clone())}return this}toJSON(){let e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,n=this.holes.length;t<n;t++){let o=this.holes[t];e.holes.push(o.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){let o=e.holes[t];this.holes.push(new Ore().fromJSON(o))}return this}}var oIo={triangulate:function(e,t,n=2){let o=t&&t.length,r=o?t[0]*n:e.length,i=B5t(e,0,r,n,!0),s=[];if(!i||i.next===i.prev)return s;let a,c,l,h,d,u,_;if(o)i=cIo(e,t,i,n);if(e.length>80*n){a=l=e[0],c=h=e[1];for(let p=n;p<r;p+=n){if(d=e[p],u=e[p+1],d<a)a=d;if(u<c)c=u;if(d>l)l=d;if(u>h)h=u}_=Math.max(l-a,h-c),_=_!==0?32767/_:0}return Vre(i,s,n,a,c,_,0),s}};function B5t(e,t,n,o,r){let i,s;if(r===yIo(e,t,n,o)>0)for(i=t;i<n;i+=o)s=Vxt(i,e[i],e[i+1],s);else for(i=n-o;i>=t;i-=o)s=Vxt(i,e[i],e[i+1],s);if(s&&ZAe(s,s.next))Gre(s),s=s.next;return s}function wz(e,t){if(!e)return e;if(!t)t=e;let n=e,o;do if(o=!1,!n.steiner&&(ZAe(n,n.next)||Cp(n.prev,n,n.next)===0)){if(Gre(n),n=t=n.prev,n===n.next)break;o=!0}else n=n.next;while(o||n!==t);return t}function Vre(e,t,n,o,r,i,s){if(!e)return;if(!s&&i)pIo(e,o,r,i);let a=e,c,l;while(e.prev!==e.next){if(c=e.prev,l=e.next,i?iIo(e,o,r,i):rIo(e)){t.push(c.i/n|0),t.push(e.i/n|0),t.push(l.i/n|0),Gre(e),e=l.next,a=l.next;continue}if(e=l,e===a){if(!s)Vre(wz(e),t,n,o,r,i,1);else if(s===1)e=sIo(wz(e),t,n),Vre(e,t,n,o,r,i,2);else if(s===2)aIo(e,t,n,o,r,i);break}}}function rIo(e){let t=e.prev,n=e,o=e.next;if(Cp(t,n,o)>=0)return!1;let r=t.x,i=n.x,s=o.x,a=t.y,c=n.y,l=o.y,h=r<i?r<s?r:s:i<s?i:s,d=a<c?a<l?a:l:c<l?c:l,u=r>i?r>s?r:s:i>s?i:s,_=a>c?a>l?a:l:c>l?c:l,p=o.next;while(p!==t){if(p.x>=h&&p.x<=u&&p.y>=d&&p.y<=_&&XX(r,a,i,c,s,l,p.x,p.y)&&Cp(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function iIo(e,t,n,o){let r=e.prev,i=e,s=e.next;if(Cp(r,i,s)>=0)return!1;let a=r.x,c=i.x,l=s.x,h=r.y,d=i.y,u=s.y,_=a<c?a<l?a:l:c<l?c:l,p=h<d?h<u?h:u:d<u?d:u,m=a>c?a>l?a:l:c>l?c:l,A=h>d?h>u?h:u:d>u?d:u,g=hQe(_,p,t,n,o),f=hQe(m,A,t,n,o),{prevZ:y,nextZ:x}=e;while(y&&y.z>=g&&x&&x.z<=f){if(y.x>=_&&y.x<=m&&y.y>=p&&y.y<=A&&y!==r&&y!==s&&XX(a,h,c,d,l,u,y.x,y.y)&&Cp(y.prev,y,y.next)>=0)return!1;if(y=y.prevZ,x.x>=_&&x.x<=m&&x.y>=p&&x.y<=A&&x!==r&&x!==s&&XX(a,h,c,d,l,u,x.x,x.y)&&Cp(x.prev,x,x.next)>=0)return!1;x=x.nextZ}while(y&&y.z>=g){if(y.x>=_&&y.x<=m&&y.y>=p&&y.y<=A&&y!==r&&y!==s&&XX(a,h,c,d,l,u,y.x,y.y)&&Cp(y.prev,y,y.next)>=0)return!1;y=y.prevZ}while(x&&x.z<=f){if(x.x>=_&&x.x<=m&&x.y>=p&&x.y<=A&&x!==r&&x!==s&&XX(a,h,c,d,l,u,x.x,x.y)&&Cp(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function sIo(e,t,n){let o=e;do{let r=o.prev,i=o.next.next;if(!ZAe(r,i)&&T5t(r,o,o.next,i)&&Yre(r,i)&&Yre(i,r))t.push(r.i/n|0),t.push(o.i/n|0),t.push(i.i/n|0),Gre(o),Gre(o.next),o=e=i;o=o.next}while(o!==e);return wz(o)}function aIo(e,t,n,o,r,i){let s=e;do{let a=s.next.next;while(a!==s.prev){if(s.i!==a.i&&gIo(s,a)){let c=D5t(s,a);s=wz(s,s.next),c=wz(c,c.next),Vre(s,t,n,o,r,i,0),Vre(c,t,n,o,r,i,0);return}a=a.next}s=s.next}while(s!==e)}function cIo(e,t,n,o){let r=[],i,s,a,c,l;for(i=0,s=t.length;i<s;i++){if(a=t[i]*o,c=i<s-1?t[i+1]*o:e.length,l=B5t(e,a,c,o,!1),l===l.next)l.steiner=!0;r.push(_Io(l))}r.sort(lIo);for(i=0;i<r.length;i++)n=hIo(r[i],n);return n}function lIo(e,t){return e.x-t.x}function hIo(e,t){let n=dIo(e,t);if(!n)return t;let o=D5t(n,e);return wz(o,o.next),wz(n,n.next)}function dIo(e,t){let n=t,o=-1/0,r,{x:i,y:s}=e;do{if(s<=n.y&&s>=n.next.y&&n.next.y!==n.y){let u=n.x+(s-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(u<=i&&u>o){if(o=u,r=n.x<n.next.x?n:n.next,u===i)return r}}n=n.next}while(n!==t);if(!r)return null;let a=r,c=r.x,l=r.y,h=1/0,d;n=r;do{if(i>=n.x&&n.x>=c&&i!==n.x&&XX(s<l?i:o,s,c,l,s<l?o:i,s,n.x,n.y)){if(d=Math.abs(s-n.y)/(i-n.x),Yre(n,e)&&(d<h||d===h&&(n.x>r.x||n.x===r.x&&uIo(r,n))))r=n,h=d}n=n.next}while(n!==a);return r}function uIo(e,t){return Cp(e.prev,e,t.prev)<0&&Cp(t.next,e,e.next)<0}function pIo(e,t,n,o){let r=e;do{if(r.z===0)r.z=hQe(r.x,r.y,t,n,o);r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,mIo(r)}function mIo(e){let t,n,o,r,i,s,a,c,l=1;do{n=e,e=null,i=null,s=0;while(n){s++,o=n,a=0;for(t=0;t<l;t++)if(a++,o=o.nextZ,!o)break;c=l;while(a>0||c>0&&o){if(a!==0&&(c===0||!o||n.z<=o.z))r=n,n=n.nextZ,a--;else r=o,o=o.nextZ,c--;if(i)i.nextZ=r;else e=r;r.prevZ=i,i=r}n=o}i.nextZ=null,l*=2}while(s>1);return e}function hQe(e,t,n,o,r){return e=(e-n)*r|0,t=(t-o)*r|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function _Io(e){let t=e,n=e;do{if(t.x<n.x||t.x===n.x&&t.y<n.y)n=t;t=t.next}while(t!==e);return n}function XX(e,t,n,o,r,i,s,a){return(r-s)*(t-a)>=(e-s)*(i-a)&&(e-s)*(o-a)>=(n-s)*(t-a)&&(n-s)*(i-a)>=(r-s)*(o-a)}function gIo(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!AIo(e,t)&&(Yre(e,t)&&Yre(t,e)&&fIo(e,t)&&(Cp(e.prev,e,t.prev)||Cp(e,t.prev,t))||ZAe(e,t)&&Cp(e.prev,e,e.next)>0&&Cp(t.prev,t,t.next)>0)}function Cp(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function ZAe(e,t){return e.x===t.x&&e.y===t.y}function T5t(e,t,n,o){let r=EAe(Cp(e,t,n)),i=EAe(Cp(e,t,o)),s=EAe(Cp(n,o,e)),a=EAe(Cp(n,o,t));if(r!==i&&s!==a)return!0;if(r===0&&PAe(e,n,t))return!0;if(i===0&&PAe(e,o,t))return!0;if(s===0&&PAe(n,e,o))return!0;if(a===0&&PAe(n,t,o))return!0;return!1}function PAe(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function EAe(e){return e>0?1:e<0?-1:0}function AIo(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&T5t(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function Yre(e,t){return Cp(e.prev,e,e.next)<0?Cp(e,t,e.next)>=0&&Cp(e,e.prev,t)>=0:Cp(e,t,e.prev)<0||Cp(e,e.next,t)<0}function fIo(e,t){let n=e,o=!1,r=(e.x+t.x)/2,i=(e.y+t.y)/2;do{if(n.y>i!==n.next.y>i&&n.next.y!==n.y&&r<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x)o=!o;n=n.next}while(n!==e);return o}function D5t(e,t){let n=new dQe(e.i,e.x,e.y),o=new dQe(t.i,t.x,t.y),r=e.next,i=t.prev;return e.next=t,t.prev=e,n.next=r,r.prev=n,o.next=n,n.prev=o,i.next=o,o.prev=i,o}function Vxt(e,t,n,o){let r=new dQe(e,t,n);if(!o)r.prev=r,r.next=r;else r.next=o.next,r.prev=o,o.next.prev=r,o.next=r;return r}function Gre(e){if(e.next.prev=e.prev,e.prev.next=e.next,e.prevZ)e.prevZ.nextZ=e.nextZ;if(e.nextZ)e.nextZ.prevZ=e.prevZ}function dQe(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function yIo(e,t,n,o){let r=0;for(let i=t,s=n-o;i<n;i+=o)r+=(e[s]-e[i])*(e[i+1]+e[s+1]),s=i;return r}class Ez{static area(e){let t=e.length,n=0;for(let o=t-1,r=0;r<t;o=r++)n+=e[o].x*e[r].y-e[r].x*e[o].y;return n*0.5}static isClockWise(e){return Ez.area(e)<0}static triangulateShape(e,t){let n=[],o=[],r=[];Yxt(e),Gxt(n,e);let i=e.length;t.forEach(Yxt);for(let a=0;a<t.length;a++)o.push(i),i+=t[a].length,Gxt(n,t[a]);let s=oIo.triangulate(n,o);for(let a=0;a<s.length;a+=3)r.push(s.slice(a,a+3));return r}}function Yxt(e){let t=e.length;if(t>2&&e[t-1].equals(e[0]))e.pop()}function Gxt(e,t){for(let n=0;n<t.length;n++)e.push(t[n].x),e.push(t[n].y)}class efe extends js{constructor(e=new JAe([new ro(0.5,0.5),new ro(-0.5,0.5),new ro(-0.5,-0.5),new ro(0.5,-0.5)]),t={}){super();this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];let n=this,o=[],r=[];for(let s=0,a=e.length;s<a;s++){let c=e[s];i(c)}this.setAttribute("position",new Wr(o,3)),this.setAttribute("uv",new Wr(r,2)),this.computeVertexNormals();function i(s){let a=[],c=t.curveSegments!==void 0?t.curveSegments:12,l=t.steps!==void 0?t.steps:1,h=t.depth!==void 0?t.depth:1,d=t.bevelEnabled!==void 0?t.bevelEnabled:!0,u=t.bevelThickness!==void 0?t.bevelThickness:0.2,_=t.bevelSize!==void 0?t.bevelSize:u-0.1,p=t.bevelOffset!==void 0?t.bevelOffset:0,m=t.bevelSegments!==void 0?t.bevelSegments:3,A=t.extrudePath,g=t.UVGenerator!==void 0?t.UVGenerator:xIo,f,y=!1,x,C,b,I;if(A)f=A.getSpacedPoints(l),y=!0,d=!1,x=A.computeFrenetFrames(l,!1),C=new Et,b=new Et,I=new Et;if(!d)m=0,u=0,_=0,p=0;let v=s.extractPoints(c),{shape:P,holes:M}=v;if(!Ez.isClockWise(P)){P=P.reverse();for(let ie=0,le=M.length;ie<le;ie++){let ue=M[ie];if(Ez.isClockWise(ue))M[ie]=ue.reverse()}}let T=Ez.triangulateShape(P,M),N=P;for(let ie=0,le=M.length;ie<le;ie++){let ue=M[ie];P=P.concat(ue)}function D(ie,le,ue){if(!le)console.error("THREE.ExtrudeGeometry: vec does not exist");return ie.clone().addScaledVector(le,ue)}let L=P.length,H=T.length;function V(ie,le,ue){let de,me,Ae,xe=ie.x-le.x,Me=ie.y-le.y,Re=ue.x-ie.x,we=ue.y-ie.y,_e=xe*xe+Me*Me,ye=xe*we-Me*Re;if(Math.abs(ye)>Number.EPSILON){let Se=Math.sqrt(_e),Ne=Math.sqrt(Re*Re+we*we),ke=le.x-Me/Se,nt=le.y+xe/Se,dt=ue.x-we/Ne,rt=ue.y+Re/Ne,mt=((dt-ke)*we-(rt-nt)*Re)/(xe*we-Me*Re);de=ke+xe*mt-ie.x,me=nt+Me*mt-ie.y;let lt=de*de+me*me;if(lt<=2)return new ro(de,me);else Ae=Math.sqrt(lt/2)}else{let Se=!1;if(xe>Number.EPSILON){if(Re>Number.EPSILON)Se=!0}else if(xe<-Number.EPSILON){if(Re<-Number.EPSILON)Se=!0}else if(Math.sign(Me)===Math.sign(we))Se=!0;if(Se)de=-Me,me=xe,Ae=Math.sqrt(_e);else de=xe,me=Me,Ae=Math.sqrt(_e/2)}return new ro(de/Ae,me/Ae)}let O=[];for(let ie=0,le=N.length,ue=le-1,de=ie+1;ie<le;ie++,ue++,de++){if(ue===le)ue=0;if(de===le)de=0;O[ie]=V(N[ie],N[ue],N[de])}let U=[],j,Y=O.concat();for(let ie=0,le=M.length;ie<le;ie++){let ue=M[ie];j=[];for(let de=0,me=ue.length,Ae=me-1,xe=de+1;de<me;de++,Ae++,xe++){if(Ae===me)Ae=0;if(xe===me)xe=0;j[de]=V(ue[de],ue[Ae],ue[xe])}U.push(j),Y=Y.concat(j)}for(let ie=0;ie<m;ie++){let le=ie/m,ue=u*Math.cos(le*Math.PI/2),de=_*Math.sin(le*Math.PI/2)+p;for(let me=0,Ae=N.length;me<Ae;me++){let xe=D(N[me],O[me],de);se(xe.x,xe.y,-ue)}for(let me=0,Ae=M.length;me<Ae;me++){let xe=M[me];j=U[me];for(let Me=0,Re=xe.length;Me<Re;Me++){let we=D(xe[Me],j[Me],de);se(we.x,we.y,-ue)}}}let X=_+p;for(let ie=0;ie<L;ie++){let le=d?D(P[ie],Y[ie],X):P[ie];if(!y)se(le.x,le.y,0);else b.copy(x.normals[0]).multiplyScalar(le.x),C.copy(x.binormals[0]).multiplyScalar(le.y),I.copy(f[0]).add(b).add(C),se(I.x,I.y,I.z)}for(let ie=1;ie<=l;ie++)for(let le=0;le<L;le++){let ue=d?D(P[le],Y[le],X):P[le];if(!y)se(ue.x,ue.y,h/l*ie);else b.copy(x.normals[ie]).multiplyScalar(ue.x),C.copy(x.binormals[ie]).multiplyScalar(ue.y),I.copy(f[ie]).add(b).add(C),se(I.x,I.y,I.z)}for(let ie=m-1;ie>=0;ie--){let le=ie/m,ue=u*Math.cos(le*Math.PI/2),de=_*Math.sin(le*Math.PI/2)+p;for(let me=0,Ae=N.length;me<Ae;me++){let xe=D(N[me],O[me],de);se(xe.x,xe.y,h+ue)}for(let me=0,Ae=M.length;me<Ae;me++){let xe=M[me];j=U[me];for(let Me=0,Re=xe.length;Me<Re;Me++){let we=D(xe[Me],j[Me],de);if(!y)se(we.x,we.y,h+ue);else se(we.x,we.y+f[l-1].y,f[l-1].x+ue)}}}K(),J();function K(){let ie=o.length/3;if(d){let le=0,ue=L*le;for(let de=0;de<H;de++){let me=T[de];ne(me[2]+ue,me[1]+ue,me[0]+ue)}le=l+m*2,ue=L*le;for(let de=0;de<H;de++){let me=T[de];ne(me[0]+ue,me[1]+ue,me[2]+ue)}}else{for(let le=0;le<H;le++){let ue=T[le];ne(ue[2],ue[1],ue[0])}for(let le=0;le<H;le++){let ue=T[le];ne(ue[0]+L*l,ue[1]+L*l,ue[2]+L*l)}}n.addGroup(ie,o.length/3-ie,0)}function J(){let ie=o.length/3,le=0;ee(N,le),le+=N.length;for(let ue=0,de=M.length;ue<de;ue++){let me=M[ue];ee(me,le),le+=me.length}n.addGroup(ie,o.length/3-ie,1)}function ee(ie,le){let ue=ie.length;while(--ue>=0){let de=ue,me=ue-1;if(me<0)me=ie.length-1;for(let Ae=0,xe=l+m*2;Ae<xe;Ae++){let Me=L*Ae,Re=L*(Ae+1),we=le+de+Me,_e=le+me+Me,ye=le+me+Re,Se=le+de+Re;re(we,_e,ye,Se)}}}function se(ie,le,ue){a.push(ie),a.push(le),a.push(ue)}function ne(ie,le,ue){Z(ie),Z(le),Z(ue);let de=o.length/3,me=g.generateTopUV(n,o,de-3,de-2,de-1);te(me[0]),te(me[1]),te(me[2])}function re(ie,le,ue,de){Z(ie),Z(le),Z(de),Z(le),Z(ue),Z(de);let me=o.length/3,Ae=g.generateSideWallUV(n,o,me-6,me-3,me-2,me-1);te(Ae[0]),te(Ae[1]),te(Ae[3]),te(Ae[1]),te(Ae[2]),te(Ae[3])}function Z(ie){o.push(a[ie*3+0]),o.push(a[ie*3+1]),o.push(a[ie*3+2])}function te(ie){r.push(ie.x),r.push(ie.y)}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){let e=super.toJSON(),t=this.parameters.shapes,n=this.parameters.options;return CIo(t,n,e)}static fromJSON(e,t){let n=[];for(let r=0,i=e.shapes.length;r<i;r++){let s=t[e.shapes[r]];n.push(s)}let o=e.options.extrudePath;if(o!==void 0)e.options.extrudePath=new lQe[o.type]().fromJSON(o);return new efe(n,e.options)}}var xIo={generateTopUV:function(e,t,n,o,r){let i=t[n*3],s=t[n*3+1],a=t[o*3],c=t[o*3+1],l=t[r*3],h=t[r*3+1];return[new ro(i,s),new ro(a,c),new ro(l,h)]},generateSideWallUV:function(e,t,n,o,r,i){let s=t[n*3],a=t[n*3+1],c=t[n*3+2],l=t[o*3],h=t[o*3+1],d=t[o*3+2],u=t[r*3],_=t[r*3+1],p=t[r*3+2],m=t[i*3],A=t[i*3+1],g=t[i*3+2];if(Math.abs(a-h)<Math.abs(s-l))return[new ro(s,1-c),new ro(l,1-d),new ro(u,1-p),new ro(m,1-g)];else return[new ro(a,1-c),new ro(h,1-d),new ro(_,1-p),new ro(A,1-g)]}};function CIo(e,t,n){if(n.shapes=[],Array.isArray(e))for(let o=0,r=e.length;o<r;o++){let i=e[o];n.shapes.push(i.uuid)}else n.shapes.push(e.uuid);if(n.options=Object.assign({},t),t.extrudePath!==void 0)n.options.extrudePath=t.extrudePath.toJSON();return n}class _w extends js{constructor(e=1,t=32,n=16,o=0,r=Math.PI*2,i=0,s=Math.PI){super();this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:o,phiLength:r,thetaStart:i,thetaLength:s},t=Math.max(3,Math.floor(t)),n=Math.max(2,Math.floor(n));let a=Math.min(i+s,Math.PI),c=0,l=[],h=new Et,d=new Et,u=[],_=[],p=[],m=[];for(let A=0;A<=n;A++){let g=[],f=A/n,y=0;if(A===0&&i===0)y=0.5/t;else if(A===n&&a===Math.PI)y=-0.5/t;for(let x=0;x<=t;x++){let C=x/t;h.x=-e*Math.cos(o+C*r)*Math.sin(i+f*s),h.y=e*Math.cos(i+f*s),h.z=e*Math.sin(o+C*r)*Math.sin(i+f*s),_.push(h.x,h.y,h.z),d.copy(h).normalize(),p.push(d.x,d.y,d.z),m.push(C+y,1-f),g.push(c++)}l.push(g)}for(let A=0;A<n;A++)for(let g=0;g<t;g++){let f=l[A][g+1],y=l[A][g],x=l[A+1][g],C=l[A+1][g+1];if(A!==0||i>0)u.push(f,y,C);if(A!==n-1||a<Math.PI)u.push(y,x,C)}this.setIndex(u),this.setAttribute("position",new Wr(_,3)),this.setAttribute("normal",new Wr(p,3)),this.setAttribute("uv",new Wr(m,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new _w(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class vs extends zA{constructor(e){super();this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new No(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new No(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new ro(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new FA,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class OA extends vs{constructor(e){super();this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new ro(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return Qg(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+0.4*t)/(1-0.4*t)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new No(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new No(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new No(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._dispersion=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){if(this._anisotropy>0!==e>0)this.version++;this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){if(this._clearcoat>0!==e>0)this.version++;this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){if(this._iridescence>0!==e>0)this.version++;this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){if(this._dispersion>0!==e>0)this.version++;this._dispersion=e}get sheen(){return this._sheen}set sheen(e){if(this._sheen>0!==e>0)this.version++;this._sheen=e}get transmission(){return this._transmission}set transmission(e){if(this._transmission>0!==e>0)this.version++;this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class Bz extends zA{constructor(e){super();this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new No(16777215),this.specular=new No(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new No(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new ro(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new FA,this.combine=0,this.reflectivity=1,this.refractionRatio=0.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}function MAe(e,t,n){if(!e||!n&&e.constructor===t)return e;if(typeof t.BYTES_PER_ELEMENT==="number")return new t(e);return Array.prototype.slice.call(e)}function bIo(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function IIo(e){function t(r,i){return e[r]-e[i]}let n=e.length,o=Array(n);for(let r=0;r!==n;++r)o[r]=r;return o.sort(t),o}function Uxt(e,t,n){let o=e.length,r=new e.constructor(o);for(let i=0,s=0;s!==o;++i){let a=n[i]*t;for(let c=0;c!==t;++c)r[s++]=e[a+c]}return r}function N5t(e,t,n,o){let r=1,i=e[0];while(i!==void 0&&i[o]===void 0)i=e[r++];if(i===void 0)return;let s=i[o];if(s===void 0)return;if(Array.isArray(s))do{if(s=i[o],s!==void 0)t.push(i.time),n.push.apply(n,s);i=e[r++]}while(i!==void 0);else if(s.toArray!==void 0)do{if(s=i[o],s!==void 0)t.push(i.time),s.toArray(n,n.length);i=e[r++]}while(i!==void 0);else do{if(s=i[o],s!==void 0)t.push(i.time),n.push(s);i=e[r++]}while(i!==void 0)}class Tz{constructor(e,t,n,o){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=o!==void 0?o:new t.constructor(n),this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){let t=this.parameterPositions,n=this._cachedIndex,o=t[n],r=t[n-1];e:{t:{let i;n:{o:if(!(e<o)){for(let s=n+2;;){if(o===void 0){if(e<r)break o;return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===s)break;if(r=o,o=t[++n],e<o)break t}i=t.length;break n}if(!(e>=r)){let s=t[1];if(e<s)n=2,r=s;for(let a=n-2;;){if(r===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(n===a)break;if(o=r,r=t[--n-1],e>=r)break t}i=n,n=0;break n}break e}while(n<i){let s=n+i>>>1;if(e<t[s])i=s;else n=s+1}if(o=t[n],r=t[n-1],r===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(o===void 0)return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,r,o)}return this.interpolate_(n,r,e,o)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){let t=this.resultBuffer,n=this.sampleValues,o=this.valueSize,r=e*o;for(let i=0;i!==o;++i)t[i]=n[r+i];return t}interpolate_(){throw Error("call to abstract method")}intervalChanged_(){}}class R5t extends Tz{constructor(e,t,n,o){super(e,t,n,o);this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:2400,endingEnd:2400}}intervalChanged_(e,t,n){let o=this.parameterPositions,r=e-2,i=e+1,s=o[r],a=o[i];if(s===void 0)switch(this.getSettings_().endingStart){case 2401:r=e,s=2*t-n;break;case 2402:r=o.length-2,s=t+o[r]-o[r+1];break;default:r=e,s=n}if(a===void 0)switch(this.getSettings_().endingEnd){case 2401:i=e,a=2*n-t;break;case 2402:i=1,a=n+o[1]-o[0];break;default:i=e-1,a=t}let c=(n-t)*0.5,l=this.valueSize;this._weightPrev=c/(t-s),this._weightNext=c/(a-n),this._offsetPrev=r*l,this._offsetNext=i*l}interpolate_(e,t,n,o){let r=this.resultBuffer,i=this.sampleValues,s=this.valueSize,a=e*s,c=a-s,l=this._offsetPrev,h=this._offsetNext,d=this._weightPrev,u=this._weightNext,_=(n-t)/(o-t),p=_*_,m=p*_,A=-d*m+2*d*p-d*_,g=(1+d)*m+(-1.5-2*d)*p+(-0.5+d)*_+1,f=(-1-u)*m+(1.5+u)*p+0.5*_,y=u*m-u*p;for(let x=0;x!==s;++x)r[x]=A*i[l+x]+g*i[c+x]+f*i[a+x]+y*i[h+x];return r}}class Q5t extends Tz{constructor(e,t,n,o){super(e,t,n,o)}interpolate_(e,t,n,o){let r=this.resultBuffer,i=this.sampleValues,s=this.valueSize,a=e*s,c=a-s,l=(n-t)/(o-t),h=1-l;for(let d=0;d!==s;++d)r[d]=i[c+d]*h+i[a+d]*l;return r}}class k5t extends Tz{constructor(e,t,n,o){super(e,t,n,o)}interpolate_(e){return this.copySampleValue_(e-1)}}class N9{constructor(e,t,n,o){if(e===void 0)throw Error("THREE.KeyframeTrack: track name is undefined");if(t===void 0||t.length===0)throw Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=MAe(t,this.TimeBufferType),this.values=MAe(n,this.ValueBufferType),this.setInterpolation(o||this.DefaultInterpolation)}static toJSON(e){let t=e.constructor,n;if(t.toJSON!==this.toJSON)n=t.toJSON(e);else{n={name:e.name,times:MAe(e.times,Array),values:MAe(e.values,Array)};let o=e.getInterpolation();if(o!==e.DefaultInterpolation)n.interpolation=o}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new k5t(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new Q5t(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new R5t(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case 2300:t=this.InterpolantFactoryMethodDiscrete;break;case 2301:t=this.InterpolantFactoryMethodLinear;break;case 2302:t=this.InterpolantFactoryMethodSmooth;break}if(t===void 0){let n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw Error(n);return console.warn("THREE.KeyframeTrack:",n),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return 2300;case this.InterpolantFactoryMethodLinear:return 2301;case this.InterpolantFactoryMethodSmooth:return 2302}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){let t=this.times;for(let n=0,o=t.length;n!==o;++n)t[n]+=e}return this}scale(e){if(e!==1){let t=this.times;for(let n=0,o=t.length;n!==o;++n)t[n]*=e}return this}trim(e,t){let n=this.times,o=n.length,r=0,i=o-1;while(r!==o&&n[r]<e)++r;while(i!==-1&&n[i]>t)--i;if(++i,r!==0||i!==o){if(r>=i)i=Math.max(i,1),r=i-1;let s=this.getValueSize();this.times=n.slice(r,i),this.values=this.values.slice(r*s,i*s)}return this}validate(){let e=!0,t=this.getValueSize();if(t-Math.floor(t)!==0)console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1;let n=this.times,o=this.values,r=n.length;if(r===0)console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1;let i=null;for(let s=0;s!==r;s++){let a=n[s];if(typeof a==="number"&&isNaN(a)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,s,a),e=!1;break}if(i!==null&&i>a){console.error("THREE.KeyframeTrack: Out of order keys.",this,s,a,i),e=!1;break}i=a}if(o!==void 0){if(bIo(o))for(let s=0,a=o.length;s!==a;++s){let c=o[s];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,s,c),e=!1;break}}}return e}optimize(){let e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),o=this.getInterpolation()===2302,r=e.length-1,i=1;for(let s=1;s<r;++s){let a=!1,c=e[s],l=e[s+1];if(c!==l&&(s!==1||c!==e[0]))if(!o){let h=s*n,d=h-n,u=h+n;for(let _=0;_!==n;++_){let p=t[h+_];if(p!==t[d+_]||p!==t[u+_]){a=!0;break}}}else a=!0;if(a){if(s!==i){e[i]=e[s];let h=s*n,d=i*n;for(let u=0;u!==n;++u)t[d+u]=t[h+u]}++i}}if(r>0){e[i]=e[r];for(let s=r*n,a=i*n,c=0;c!==n;++c)t[a+c]=t[s+c];++i}if(i!==e.length)this.times=e.slice(0,i),this.values=t.slice(0,i*n);else this.times=e,this.values=t;return this}clone(){let e=this.times.slice(),t=this.values.slice(),o=new this.constructor(this.name,e,t);return o.createInterpolant=this.createInterpolant,o}}N9.prototype.TimeBufferType=Float32Array;N9.prototype.ValueBufferType=Float32Array;N9.prototype.DefaultInterpolation=2301;class Dz extends N9{constructor(e,t,n){super(e,t,n)}}Dz.prototype.ValueTypeName="bool";Dz.prototype.ValueBufferType=Array;Dz.prototype.DefaultInterpolation=2300;Dz.prototype.InterpolantFactoryMethodLinear=void 0;Dz.prototype.InterpolantFactoryMethodSmooth=void 0;class TQe extends N9{}TQe.prototype.ValueTypeName="color";class pR extends N9{}pR.prototype.ValueTypeName="number";class L5t extends Tz{constructor(e,t,n,o){super(e,t,n,o)}interpolate_(e,t,n,o){let r=this.resultBuffer,i=this.sampleValues,s=this.valueSize,a=(n-t)/(o-t),c=e*s;for(let l=c+s;c!==l;c+=4)Eu.slerpFlat(r,0,i,c-s,i,c,a);return r}}class gR extends N9{InterpolantFactoryMethodLinear(e){return new L5t(this.times,this.values,this.getValueSize(),e)}}gR.prototype.ValueTypeName="quaternion";gR.prototype.InterpolantFactoryMethodSmooth=void 0;class Nz extends N9{constructor(e,t,n){super(e,t,n)}}Nz.prototype.ValueTypeName="string";Nz.prototype.ValueBufferType=Array;Nz.prototype.DefaultInterpolation=2300;Nz.prototype.InterpolantFactoryMethodLinear=void 0;Nz.prototype.InterpolantFactoryMethodSmooth=void 0;class mR extends N9{}mR.prototype.ValueTypeName="vector";class DQe{constructor(e="",t=-1,n=[],o=2500){if(this.name=e,this.tracks=n,this.duration=t,this.blendMode=o,this.uuid=wb(),this.duration<0)this.resetDuration()}static parse(e){let t=[],n=e.tracks,o=1/(e.fps||1);for(let i=0,s=n.length;i!==s;++i)t.push(SIo(n[i]).scale(o));let r=new this(e.name,e.duration,t,e.blendMode);return r.uuid=e.uuid,r}static toJSON(e){let t=[],n=e.tracks,o={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let r=0,i=n.length;r!==i;++r)t.push(N9.toJSON(n[r]));return o}static CreateFromMorphTargetSequence(e,t,n,o){let r=t.length,i=[];for(let s=0;s<r;s++){let a=[],c=[];a.push((s+r-1)%r,s,(s+1)%r),c.push(0,1,0);let l=IIo(a);if(a=Uxt(a,1,l),c=Uxt(c,1,l),!o&&a[0]===0)a.push(r),c.push(c[0]);i.push(new pR(".morphTargetInfluences["+t[s].name+"]",a,c).scale(1/n))}return new this(e,-1,i)}static findByName(e,t){let n=e;if(!Array.isArray(e)){let o=e;n=o.geometry&&o.geometry.animations||o.animations}for(let o=0;o<n.length;o++)if(n[o].name===t)return n[o];return null}static CreateClipsFromMorphTargetSequences(e,t,n){let o={},r=/^([\w-]*?)([\d]+)$/;for(let s=0,a=e.length;s<a;s++){let c=e[s],l=c.name.match(r);if(l&&l.length>1){let h=l[1],d=o[h];if(!d)o[h]=d=[];d.push(c)}}let i=[];for(let s in o)i.push(this.CreateFromMorphTargetSequence(s,o[s],t,n));return i}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;let n=function(h,d,u,_,p){if(u.length!==0){let m=[],A=[];if(N5t(u,m,A,_),m.length!==0)p.push(new h(d,m,A))}},o=[],r=e.name||"default",i=e.fps||30,s=e.blendMode,a=e.length||-1,c=e.hierarchy||[];for(let h=0;h<c.length;h++){let d=c[h].keys;if(!d||d.length===0)continue;if(d[0].morphTargets){let u={},_;for(_=0;_<d.length;_++)if(d[_].morphTargets)for(let p=0;p<d[_].morphTargets.length;p++)u[d[_].morphTargets[p]]=-1;for(let p in u){let m=[],A=[];for(let g=0;g!==d[_].morphTargets.length;++g){let f=d[_];m.push(f.time),A.push(f.morphTarget===p?1:0)}o.push(new pR(".morphTargetInfluence["+p+"]",m,A))}a=u.length*i}else{let u=".bones["+t[h].name+"]";n(mR,u+".position",d,"pos",o),n(gR,u+".quaternion",d,"rot",o),n(mR,u+".scale",d,"scl",o)}}if(o.length===0)return null;return new this(r,a,o,s)}resetDuration(){let e=this.tracks,t=0;for(let n=0,o=e.length;n!==o;++n){let r=this.tracks[n];t=Math.max(t,r.times[r.times.length-1])}return this.duration=t,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){let e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function vIo(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return pR;case"vector":case"vector2":case"vector3":case"vector4":return mR;case"color":return TQe;case"quaternion":return gR;case"bool":case"boolean":return Dz;case"string":return Nz}throw Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}function SIo(e){if(e.type===void 0)throw Error("THREE.KeyframeTrack: track type undefined, can not parse");let t=vIo(e.type);if(e.times===void 0){let n=[],o=[];N5t(e.keys,n,o,"value"),e.times=n,e.values=o}if(t.parse!==void 0)return t.parse(e);else return new t(e.name,e.times,e.values,e.interpolation)}var dR={enabled:!1,files:{},add:function(e,t){if(this.enabled===!1)return;this.files[e]=t},get:function(e){if(this.enabled===!1)return;return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}};class H5t{constructor(e,t,n){let o=this,r=!1,i=0,s=0,a=void 0,c=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(l){if(s++,r===!1){if(o.onStart!==void 0)o.onStart(l,i,s)}r=!0},this.itemEnd=function(l){if(i++,o.onProgress!==void 0)o.onProgress(l,i,s);if(i===s){if(r=!1,o.onLoad!==void 0)o.onLoad()}},this.itemError=function(l){if(o.onError!==void 0)o.onError(l)},this.resolveURL=function(l){if(a)return a(l);return l},this.setURLModifier=function(l){return a=l,this},this.addHandler=function(l,h){return c.push(l,h),this},this.removeHandler=function(l){let h=c.indexOf(l);if(h!==-1)c.splice(h,2);return this},this.getHandler=function(l){for(let h=0,d=c.length;h<d;h+=2){let u=c[h],_=c[h+1];if(u.global)u.lastIndex=0;if(u.test(l))return _}return null}}}var NQe=new H5t;class s1{constructor(e){this.manager=e!==void 0?e:NQe,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){let n=this;return new Promise(function(o,r){n.load(e,o,t,r)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}s1.DEFAULT_MATERIAL_NAME="__DEFAULT";var dw={};class F5t extends Error{constructor(e,t){super(e);this.response=t}}class Tb extends s1{constructor(e){super(e)}load(e,t,n,o){if(e===void 0)e="";if(this.path!==void 0)e=this.path+e;e=this.manager.resolveURL(e);let r=dR.get(e);if(r!==void 0)return this.manager.itemStart(e),setTimeout(()=>{if(t)t(r);this.manager.itemEnd(e)},0),r;if(dw[e]!==void 0){dw[e].push({onLoad:t,onProgress:n,onError:o});return}dw[e]=[],dw[e].push({onLoad:t,onProgress:n,onError:o});let i=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),s=this.mimeType,a=this.responseType;fetch(i).then((c)=>{if(c.status===200||c.status===0){if(c.status===0)console.warn("THREE.FileLoader: HTTP Status 0 received.");if(typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;let l=dw[e],h=c.body.getReader(),d=c.headers.get("X-File-Size")||c.headers.get("Content-Length"),u=d?parseInt(d):0,_=u!==0,p=0,m=new ReadableStream({start(A){g();function g(){h.read().then(({done:f,value:y})=>{if(f)A.close();else{p+=y.byteLength;let x=new ProgressEvent("progress",{lengthComputable:_,loaded:p,total:u});for(let C=0,b=l.length;C<b;C++){let I=l[C];if(I.onProgress)I.onProgress(x)}A.enqueue(y),g()}},(f)=>{A.error(f)})}}});return new Response(m)}else throw new F5t(`fetch for "${c.url}" responded with ${c.status}: ${c.statusText}`,c)}).then((c)=>{switch(a){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then((l)=>new DOMParser().parseFromString(l,s));case"json":return c.json();default:if(s===void 0)return c.text();else{let h=/charset="?([^;"\s]*)"?/i.exec(s),d=h&&h[1]?h[1].toLowerCase():void 0,u=new TextDecoder(d);return c.arrayBuffer().then((_)=>u.decode(_))}}}).then((c)=>{dR.add(e,c);let l=dw[e];delete dw[e];for(let h=0,d=l.length;h<d;h++){let u=l[h];if(u.onLoad)u.onLoad(c)}}).catch((c)=>{let l=dw[e];if(l===void 0)throw this.manager.itemError(e),c;delete dw[e];for(let h=0,d=l.length;h<d;h++){let u=l[h];if(u.onError)u.onError(c)}this.manager.itemError(e)}).finally(()=>{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class z5t extends s1{constructor(e){super(e)}load(e,t,n,o){if(this.path!==void 0)e=this.path+e;e=this.manager.resolveURL(e);let r=this,i=dR.get(e);if(i!==void 0)return r.manager.itemStart(e),setTimeout(function(){if(t)t(i);r.manager.itemEnd(e)},0),i;let s=Fre("img");function a(){if(l(),dR.add(e,this),t)t(this);r.manager.itemEnd(e)}function c(h){if(l(),o)o(h);r.manager.itemError(e),r.manager.itemEnd(e)}function l(){s.removeEventListener("load",a,!1),s.removeEventListener("error",c,!1)}if(s.addEventListener("load",a,!1),s.addEventListener("error",c,!1),e.slice(0,5)!=="data:"){if(this.crossOrigin!==void 0)s.crossOrigin=this.crossOrigin}return r.manager.itemStart(e),s.src=e,s}}class Rz extends s1{constructor(e){super(e)}load(e,t,n,o){let r=new vl,i=new z5t(this.manager);return i.setCrossOrigin(this.crossOrigin),i.setPath(this.path),i.load(e,function(s){if(r.image=s,r.needsUpdate=!0,t!==void 0)t(r)},n,o),r}}class ej extends Sl{constructor(e,t=1){super();this.isLight=!0,this.type="Light",this.color=new No(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){let t=super.toJSON(e);if(t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0)t.object.groundColor=this.groundColor.getHex();if(this.distance!==void 0)t.object.distance=this.distance;if(this.angle!==void 0)t.object.angle=this.angle;if(this.decay!==void 0)t.object.decay=this.decay;if(this.penumbra!==void 0)t.object.penumbra=this.penumbra;if(this.shadow!==void 0)t.object.shadow=this.shadow.toJSON();return t}}class eie extends ej{constructor(e,t,n){super(e,n);this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(Sl.DEFAULT_UP),this.updateMatrix(),this.groundColor=new No(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}}var iQe=new Gi,Wxt=new Et,Xxt=new Et;class tfe{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new ro(512,512),this.map=null,this.mapPass=null,this.matrix=new Gi,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new VAe,this._frameExtents=new ro(1,1),this._viewportCount=1,this._viewports=[new zh(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){let t=this.camera,n=this.matrix;Wxt.setFromMatrixPosition(e.matrixWorld),t.position.copy(Wxt),Xxt.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(Xxt),t.updateMatrixWorld(),iQe.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(iQe),n.set(0.5,0,0,0.5,0,0.5,0,0.5,0,0,0.5,0.5,0,0,0,1),n.multiply(iQe)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){if(this.map)this.map.dispose();if(this.mapPass)this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){let e={};if(this.bias!==0)e.bias=this.bias;if(this.normalBias!==0)e.normalBias=this.normalBias;if(this.radius!==1)e.radius=this.radius;if(this.mapSize.x!==512||this.mapSize.y!==512)e.mapSize=this.mapSize.toArray();return e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class O5t extends tfe{constructor(){super(new Pc(50,1,0.5,500));this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){let t=this.camera,n=$X*2*e.angle*this.focus,o=this.mapSize.width/this.mapSize.height,r=e.distance||t.far;if(n!==t.fov||o!==t.aspect||r!==t.far)t.fov=n,t.aspect=o,t.far=r,t.updateProjectionMatrix();super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class RQe extends ej{constructor(e,t,n=0,o=Math.PI/3,r=0,i=2){super(e,t);this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Sl.DEFAULT_UP),this.updateMatrix(),this.target=new Sl,this.distance=n,this.angle=o,this.penumbra=r,this.decay=i,this.map=null,this.shadow=new O5t}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}var jxt=new Gi,Nre=new Et,sQe=new Et;class V5t extends tfe{constructor(){super(new Pc(90,1,0.5,500));this.isPointLightShadow=!0,this._frameExtents=new ro(4,2),this._viewportCount=6,this._viewports=[new zh(2,1,1,1),new zh(0,1,1,1),new zh(3,1,1,1),new zh(1,1,1,1),new zh(3,0,1,1),new zh(1,0,1,1)],this._cubeDirections=[new Et(1,0,0),new Et(-1,0,0),new Et(0,0,1),new Et(0,0,-1),new Et(0,1,0),new Et(0,-1,0)],this._cubeUps=[new Et(0,1,0),new Et(0,1,0),new Et(0,1,0),new Et(0,1,0),new Et(0,0,1),new Et(0,0,-1)]}updateMatrices(e,t=0){let n=this.camera,o=this.matrix,r=e.distance||n.far;if(r!==n.far)n.far=r,n.updateProjectionMatrix();Nre.setFromMatrixPosition(e.matrixWorld),n.position.copy(Nre),sQe.copy(n.position),sQe.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(sQe),n.updateMatrixWorld(),o.makeTranslation(-Nre.x,-Nre.y,-Nre.z),jxt.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(jxt)}}class tie extends ej{constructor(e,t,n=0,o=2){super(e,t);this.isPointLight=!0,this.type="PointLight",this.distance=n,this.decay=o,this.shadow=new V5t}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class Y5t extends tfe{constructor(){super(new r5(-5,5,5,-5,0.5,500));this.isDirectionalLightShadow=!0}}class Qz extends ej{constructor(e,t){super(e,t);this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Sl.DEFAULT_UP),this.updateMatrix(),this.target=new Sl,this.shadow=new Y5t}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class kz extends ej{constructor(e,t){super(e,t);this.isAmbientLight=!0,this.type="AmbientLight"}}class R9{static decodeText(e){if(console.warn("THREE.LoaderUtils: decodeText() has been deprecated with r165 and will be removed with r175. Use TextDecoder instead."),typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let n=0,o=e.length;n<o;n++)t+=String.fromCharCode(e[n]);try{return decodeURIComponent(escape(t))}catch(n){return t}}static extractUrlBase(e){let t=e.lastIndexOf("/");if(t===-1)return"./";return e.slice(0,t+1)}static resolveURL(e,t){if(typeof e!=="string"||e==="")return"";if(/^https?:\/\//i.test(t)&&/^\//.test(e))t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1");if(/^(https?:)?\/\//i.test(e))return e;if(/^data:.*,.*$/i.test(e))return e;if(/^blob:.*$/i.test(e))return e;return t+e}}class QQe extends js{constructor(){super();this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}toJSON(){let e=super.toJSON();return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}class kQe extends s1{constructor(e){super(e);if(this.isImageBitmapLoader=!0,typeof createImageBitmap>"u")console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported.");if(typeof fetch>"u")console.warn("THREE.ImageBitmapLoader: fetch() not supported.");this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,n,o){if(e===void 0)e="";if(this.path!==void 0)e=this.path+e;e=this.manager.resolveURL(e);let r=this,i=dR.get(e);if(i!==void 0){if(r.manager.itemStart(e),i.then){i.then((c)=>{if(t)t(c);r.manager.itemEnd(e)}).catch((c)=>{if(o)o(c)});return}return setTimeout(function(){if(t)t(i);r.manager.itemEnd(e)},0),i}let s={};s.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",s.headers=this.requestHeader;let a=fetch(e,s).then(function(c){return c.blob()}).then(function(c){return createImageBitmap(c,Object.assign(r.options,{colorSpaceConversion:"none"}))}).then(function(c){if(dR.add(e,c),t)t(c);return r.manager.itemEnd(e),c}).catch(function(c){if(o)o(c);dR.remove(e),r.manager.itemError(e),r.manager.itemEnd(e)});dR.add(e,a),r.manager.itemStart(e)}}class LQe{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=Kxt(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){let t=Kxt();e=(t-this.oldTime)/1000,this.oldTime=t,this.elapsedTime+=e}return e}}function Kxt(){return(typeof performance>"u"?Date:performance).now()}var HQe="\\[\\]\\.:\\/",PIo=new RegExp("["+HQe+"]","g"),FQe="[^"+HQe+"]",EIo="[^"+HQe.replace("\\.","")+"]",MIo=/((?:WC+[\/:])*)/.source.replace("WC",FQe),wIo=/(WCOD+)?/.source.replace("WCOD",EIo),BIo=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",FQe),TIo=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",FQe),DIo=new RegExp("^"+MIo+wIo+BIo+TIo+"$"),NIo=["material","materials","bones","map"];class G5t{constructor(e,t,n){let o=n||dl.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,o)}getValue(e,t){this.bind();let n=this._targetGroup.nCachedObjects_,o=this._bindings[n];if(o!==void 0)o.getValue(e,t)}setValue(e,t){let n=this._bindings;for(let o=this._targetGroup.nCachedObjects_,r=n.length;o!==r;++o)n[o].setValue(e,t)}bind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}class dl{constructor(e,t,n){this.path=t,this.parsedPath=n||dl.parseTrackName(t),this.node=dl.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){if(!(e&&e.isAnimationObjectGroup))return new dl(e,t,n);else return new dl.Composite(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(PIo,"")}static parseTrackName(e){let t=DIo.exec(e);if(t===null)throw Error("PropertyBinding: Cannot parse trackName: "+e);let n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},o=n.nodeName&&n.nodeName.lastIndexOf(".");if(o!==void 0&&o!==-1){let r=n.nodeName.substring(o+1);if(NIo.indexOf(r)!==-1)n.nodeName=n.nodeName.substring(0,o),n.objectName=r}if(n.propertyName===null||n.propertyName.length===0)throw Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){let n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){let n=function(r){for(let i=0;i<r.length;i++){let s=r[i];if(s.name===t||s.uuid===t)return s;let a=n(s.children);if(a)return a}return null},o=n(e.children);if(o)return o}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){let n=this.resolvedProperty;for(let o=0,r=n.length;o!==r;++o)e[t++]=n[o]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){let n=this.resolvedProperty;for(let o=0,r=n.length;o!==r;++o)n[o]=e[t++]}_setValue_array_setNeedsUpdate(e,t){let n=this.resolvedProperty;for(let o=0,r=n.length;o!==r;++o)n[o]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){let n=this.resolvedProperty;for(let o=0,r=n.length;o!==r;++o)n[o]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node,t=this.parsedPath,{objectName:n,propertyName:o,propertyIndex:r}=t;if(!e)e=dl.findNode(this.rootNode,t.nodeName),this.node=e;if(this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");return}if(n){let c=t.objectIndex;switch(n){case"materials":if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}e=e.material.materials;break;case"bones":if(!e.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}e=e.skeleton.bones;for(let l=0;l<e.length;l++)if(e[l].name===c){c=l;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.map){console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}e=e.material.map;break;default:if(e[n]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[n]}if(c!==void 0){if(e[c]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[c]}}let i=e[o];if(i===void 0){let c=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+c+"."+o+" but it wasn't found.",e);return}let s=this.Versioning.None;if(this.targetObject=e,e.needsUpdate!==void 0)s=this.Versioning.NeedsUpdate;else if(e.matrixWorldNeedsUpdate!==void 0)s=this.Versioning.MatrixWorldNeedsUpdate;let a=this.BindingType.Direct;if(r!==void 0){if(o==="morphTargetInfluences"){if(!e.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!e.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}if(e.morphTargetDictionary[r]!==void 0)r=e.morphTargetDictionary[r]}a=this.BindingType.ArrayElement,this.resolvedProperty=i,this.propertyIndex=r}else if(i.fromArray!==void 0&&i.toArray!==void 0)a=this.BindingType.HasFromToArray,this.resolvedProperty=i;else if(Array.isArray(i))a=this.BindingType.EntireArray,this.resolvedProperty=i;else this.propertyName=o;this.getValue=this.GetterByBindingType[a],this.setValue=this.SetterByBindingTypeAndVersioning[a][s]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}dl.Composite=G5t;dl.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};dl.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};dl.prototype.GetterByBindingType=[dl.prototype._getValue_direct,dl.prototype._getValue_array,dl.prototype._getValue_arrayElement,dl.prototype._getValue_toArray];dl.prototype.SetterByBindingTypeAndVersioning=[[dl.prototype._setValue_direct,dl.prototype._setValue_direct_setNeedsUpdate,dl.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[dl.prototype._setValue_array,dl.prototype._setValue_array_setNeedsUpdate,dl.prototype._setValue_array_setMatrixWorldNeedsUpdate],[dl.prototype._setValue_arrayElement,dl.prototype._setValue_arrayElement_setNeedsUpdate,dl.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[dl.prototype._setValue_fromArray,dl.prototype._setValue_fromArray_setNeedsUpdate,dl.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];var Vgs=new Float32Array(1);class nfe{constructor(e){this.value=e}clone(){return new nfe(this.value.clone===void 0?this.value:this.value.clone())}}var $xt=new Gi;class Lz{constructor(e,t,n=0,o=1/0){this.ray=new V7(e,t),this.near=n,this.far=o,this.camera=null,this.layers=new OAe,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){if(t.isPerspectiveCamera)this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,0.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t;else if(t.isOrthographicCamera)this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t;else console.error("THREE.Raycaster: Unsupported camera type: "+t.type)}setFromXRController(e){return $xt.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4($xt),this}intersectObject(e,t=!0,n=[]){return uQe(e,this,n,t),n.sort(qxt),n}intersectObjects(e,t=!0,n=[]){for(let o=0,r=e.length;o<r;o++)uQe(e[o],this,n,t);return n.sort(qxt),n}}function qxt(e,t){return e.distance-t.distance}function uQe(e,t,n,o){let r=!0;if(e.layers.test(t.layers)){if(e.raycast(t,n)===!1)r=!1}if(r===!0&&o===!0){let i=e.children;for(let s=0,a=i.length;s<a;s++)uQe(i[s],t,n,!0)}}class gw{constructor(e=1,t=0,n=0){return this.radius=e,this.phi=t,this.theta=n,this}set(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=Math.max(0.000001,Math.min(Math.PI-0.000001,this.phi)),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){if(this.radius=Math.sqrt(e*e+t*t+n*n),this.radius===0)this.theta=0,this.phi=0;else this.theta=Math.atan2(e,n),this.phi=Math.acos(Qg(t/this.radius,-1,1));return this}clone(){return new this.constructor().copy(this)}}class zQe extends u3{constructor(e=10,t=10,n=4473924,o=8947848){n=new No(n),o=new No(o);let r=t/2,i=e/t,s=e/2,a=[],c=[];for(let d=0,u=0,_=-s;d<=t;d++,_+=i){a.push(-s,0,_,s,0,_),a.push(_,0,-s,_,0,s);let p=d===r?n:o;p.toArray(c,u),u+=3,p.toArray(c,u),u+=3,p.toArray(c,u),u+=3,p.toArray(c,u),u+=3}let l=new js;l.setAttribute("position",new Wr(a,3)),l.setAttribute("color",new Wr(c,3));let h=new n2({vertexColors:!0,toneMapped:!1});super(l,h);this.type="GridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}if(typeof __THREE_DEVTOOLS__<"u")__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"165"}}));if(typeof window<"u")if(window.__THREE__)console.warn("WARNING: Multiple instances of Three.js being imported.");else window.__THREE__="165";var yE=at(ln(),1),Vte=at(ln(),1);var Beo=at(lo(),1);var Neo=at(ln(),1);function QIo(){var e=Object.create(null);function t(r,i){var{id:s,name:a,dependencies:c}=r;if(c===void 0)c=[];var l=r.init;if(l===void 0)l=function(){};var h=r.getTransferables;if(h===void 0)h=null;if(e[s])return;try{if(c=c.map(function(u){if(u&&u.isWorkerModule)t(u,function(_){if(_ instanceof Error)throw _}),u=e[u.id].value;return u}),l=o("<"+a+">.init",l),h)h=o("<"+a+">.getTransferables",h);var d=null;if(typeof l==="function")d=l.apply(void 0,c);else console.error("worker module init function failed to rehydrate");e[s]={id:s,value:d,getTransferables:h},i(d)}catch(u){if(!(u&&u.noLog))console.error(u);i(u)}}function n(r,i){var s,{id:a,args:c}=r;if(!e[a]||typeof e[a].value!=="function")i(Error("Worker module "+a+": not found or its 'init' did not return a function"));try{var l=(s=e[a]).value.apply(s,c);if(l&&typeof l.then==="function")l.then(h,function(d){return i(d instanceof Error?d:Error(""+d))});else h(l)}catch(d){i(d)}function h(d){try{var u=e[a].getTransferables&&e[a].getTransferables(d);if(!u||!Array.isArray(u)||!u.length)u=void 0;i(d,u)}catch(_){console.error(_),i(_)}}}function o(r,i){var s=void 0;self.troikaDefine=function(c){return s=c};var a=URL.createObjectURL(new Blob(["/** "+r.replace(/\*/g,"")+` **/

troikaDefine(
`+i+`
)`],{type:"application/javascript"}));try{importScripts(a)}catch(c){console.error(c)}return URL.revokeObjectURL(a),delete self.troikaDefine,s}self.addEventListener("message",function(r){var i=r.data,{messageId:s,action:a,data:c}=i;try{if(a==="registerModule")t(c,function(l){if(l instanceof Error)postMessage({messageId:s,success:!1,error:l.message});else postMessage({messageId:s,success:!0,result:{isCallable:typeof l==="function"}})});if(a==="callModule")n(c,function(l,h){if(l instanceof Error)postMessage({messageId:s,success:!1,error:l.message});else postMessage({messageId:s,success:!0,result:l},h||void 0)})}catch(l){postMessage({messageId:s,success:!1,error:l.stack})}})}function kIo(e){var t=function(){var n=[],o=arguments.length;while(o--)n[o]=arguments[o];return t._getInitResult().then(function(r){if(typeof r==="function")return r.apply(void 0,n);else throw Error("Worker module function was called but `init` did not return a callable function")})};return t._getInitResult=function(){var{dependencies:n,init:o}=e;n=Array.isArray(n)?n.map(function(i){if(i){if(i=i.onMainThread||i,i._getInitResult)i=i._getInitResult()}return i}):[];var r=Promise.all(n).then(function(i){return o.apply(null,i)});return t._getInitResult=function(){return r},r},t}var W5t=function(){var e=!1;if(typeof window<"u"&&typeof window.document<"u")try{var t=new Worker(URL.createObjectURL(new Blob([""],{type:"application/javascript"})));t.terminate(),e=!0}catch(n){console.log("Troika createWorkerModule: web workers not allowed; falling back to main thread execution. Cause: ["+n.message+"]")}return W5t=function(){return e},e},LIo=0,HIo=0,OQe=!1,nie=Object.create(null),oie=Object.create(null),VQe=Object.create(null);function Fz(e){if((!e||typeof e.init!=="function")&&!OQe)throw Error("requires `options.init` function");var{dependencies:t,init:n,getTransferables:o,workerId:r}=e,i=kIo(e);if(r==null)r="#default";var s="workerModule"+ ++LIo,a=e.name||s,c=null;t=t&&t.map(function(h){if(typeof h==="function"&&!h.workerModuleData)OQe=!0,h=Fz({workerId:r,name:"<"+a+"> function dependency: "+h.name,init:`function(){return (
`+ofe(h)+`
)}`}),OQe=!1;if(h&&h.workerModuleData)h=h.workerModuleData;return h});function l(){var h=[],d=arguments.length;while(d--)h[d]=arguments[d];if(!W5t())return i.apply(void 0,h);if(!c){c=U5t(r,"registerModule",l.workerModuleData);var u=function(){c=null,oie[r].delete(u)};(oie[r]||(oie[r]=new Set)).add(u)}return c.then(function(_){var p=_.isCallable;if(p)return U5t(r,"callModule",{id:s,args:h});else throw Error("Worker module function was called but `init` did not return a callable function")})}return l.workerModuleData={isWorkerModule:!0,id:s,name:a,dependencies:t,init:ofe(n),getTransferables:o&&ofe(o)},l.onMainThread=i,l}function X5t(e){if(oie[e])oie[e].forEach(function(t){t()});if(nie[e])nie[e].terminate(),delete nie[e]}function ofe(e){var t=e.toString();if(!/^function/.test(t)&&/^\w+\s*\(/.test(t))t="function "+t;return t}function FIo(e){var t=nie[e];if(!t){var n=ofe(QIo);t=nie[e]=new Worker(URL.createObjectURL(new Blob(["/** Worker Module Bootstrap: "+e.replace(/\*/g,"")+` **/

;(`+n+")()"],{type:"application/javascript"}))),t.onmessage=function(o){var r=o.data,i=r.messageId,s=VQe[i];if(!s)throw Error("WorkerModule response with empty or unknown messageId");delete VQe[i],s(r)}}return t}function U5t(e,t,n){return new Promise(function(o,r){var i=++HIo;VQe[i]=function(s){if(s.success)o(s.result);else r(Error("Error in worker "+t+" call: "+s.error))},FIo(e).postMessage({messageId:i,action:t,data:n})})}function YQe(){var e=function(t){function n(U,j,Y,X,K,J,ee,se){var ne=1-ee;se.x=ne*ne*U+2*ne*ee*Y+ee*ee*K,se.y=ne*ne*j+2*ne*ee*X+ee*ee*J}function o(U,j,Y,X,K,J,ee,se,ne,re){var Z=1-ne;re.x=Z*Z*Z*U+3*Z*Z*ne*Y+3*Z*ne*ne*K+ne*ne*ne*ee,re.y=Z*Z*Z*j+3*Z*Z*ne*X+3*Z*ne*ne*J+ne*ne*ne*se}function r(U,j){var Y=/([MLQCZ])([^MLQCZ]*)/g,X,K,J,ee,se;while(X=Y.exec(U)){var ne=X[2].replace(/^\s*|\s*$/g,"").split(/[,\s]+/).map(function(re){return parseFloat(re)});switch(X[1]){case"M":ee=K=ne[0],se=J=ne[1];break;case"L":if(ne[0]!==ee||ne[1]!==se)j("L",ee,se,ee=ne[0],se=ne[1]);break;case"Q":{j("Q",ee,se,ee=ne[2],se=ne[3],ne[0],ne[1]);break}case"C":{j("C",ee,se,ee=ne[4],se=ne[5],ne[0],ne[1],ne[2],ne[3]);break}case"Z":if(ee!==K||se!==J)j("L",ee,se,K,J);break}}}function i(U,j,Y){if(Y===void 0)Y=16;var X={x:0,y:0};r(U,function(K,J,ee,se,ne,re,Z,te,ie){switch(K){case"L":j(J,ee,se,ne);break;case"Q":{var le=J,ue=ee;for(var de=1;de<Y;de++)n(J,ee,re,Z,se,ne,de/(Y-1),X),j(le,ue,X.x,X.y),le=X.x,ue=X.y;break}case"C":{var me=J,Ae=ee;for(var xe=1;xe<Y;xe++)o(J,ee,re,Z,te,ie,se,ne,xe/(Y-1),X),j(me,Ae,X.x,X.y),me=X.x,Ae=X.y;break}}})}var s="precision highp float;attribute vec2 aUV;varying vec2 vUV;void main(){vUV=aUV;gl_Position=vec4(mix(vec2(-1.0),vec2(1.0),aUV),0.0,1.0);}",a="precision highp float;uniform sampler2D tex;varying vec2 vUV;void main(){gl_FragColor=texture2D(tex,vUV);}",c=new WeakMap,l={premultipliedAlpha:!1,preserveDrawingBuffer:!0,antialias:!1,depth:!1};function h(U,j){var Y=U.getContext?U.getContext("webgl",l):U,X=c.get(Y);if(!X){let Z=function(me){var Ae=J[me];if(!Ae){if(Ae=J[me]=Y.getExtension(me),!Ae)throw Error(me+" not supported")}return Ae},te=function(me,Ae){var xe=Y.createShader(Ae);return Y.shaderSource(xe,me),Y.compileShader(xe),xe},ie=function(me,Ae,xe,Me){if(!ee[me]){var Re={},we={},_e=Y.createProgram();Y.attachShader(_e,te(Ae,Y.VERTEX_SHADER)),Y.attachShader(_e,te(xe,Y.FRAGMENT_SHADER)),Y.linkProgram(_e),ee[me]={program:_e,transaction:function(Se){Y.useProgram(_e),Se({setUniform:function(ke,nt){var dt=[],rt=arguments.length-2;while(rt-- >0)dt[rt]=arguments[rt+2];var mt=we[nt]||(we[nt]=Y.getUniformLocation(_e,nt));Y["uniform"+ke].apply(Y,[mt].concat(dt))},setAttribute:function(ke,nt,dt,rt,mt){var lt=Re[ke];if(!lt)lt=Re[ke]={buf:Y.createBuffer(),loc:Y.getAttribLocation(_e,ke),data:null};if(Y.bindBuffer(Y.ARRAY_BUFFER,lt.buf),Y.vertexAttribPointer(lt.loc,nt,Y.FLOAT,!1,0,0),Y.enableVertexAttribArray(lt.loc),K)Y.vertexAttribDivisor(lt.loc,rt);else Z("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(lt.loc,rt);if(mt!==lt.data)Y.bufferData(Y.ARRAY_BUFFER,mt,dt),lt.data=mt}})}}}ee[me].transaction(Me)},le=function(me,Ae){ne++;try{Y.activeTexture(Y.TEXTURE0+ne);var xe=se[me];if(!xe)xe=se[me]=Y.createTexture(),Y.bindTexture(Y.TEXTURE_2D,xe),Y.texParameteri(Y.TEXTURE_2D,Y.TEXTURE_MIN_FILTER,Y.NEAREST),Y.texParameteri(Y.TEXTURE_2D,Y.TEXTURE_MAG_FILTER,Y.NEAREST);Y.bindTexture(Y.TEXTURE_2D,xe),Ae(xe,ne)}finally{ne--}},ue=function(me,Ae,xe){var Me=Y.createFramebuffer();re.push(Me),Y.bindFramebuffer(Y.FRAMEBUFFER,Me),Y.activeTexture(Y.TEXTURE0+Ae),Y.bindTexture(Y.TEXTURE_2D,me),Y.framebufferTexture2D(Y.FRAMEBUFFER,Y.COLOR_ATTACHMENT0,Y.TEXTURE_2D,me,0);try{xe(Me)}finally{Y.deleteFramebuffer(Me),Y.bindFramebuffer(Y.FRAMEBUFFER,re[--re.length-1]||null)}},de=function(){J={},ee={},se={},ne=-1,re.length=0};var K=typeof WebGL2RenderingContext<"u"&&Y instanceof WebGL2RenderingContext,J={},ee={},se={},ne=-1,re=[];Y.canvas.addEventListener("webglcontextlost",function(me){de(),me.preventDefault()},!1),c.set(Y,X={gl:Y,isWebGL2:K,getExtension:Z,withProgram:ie,withTexture:le,withTextureFramebuffer:ue,handleContextLoss:de})}j(X)}function d(U,j,Y,X,K,J,ee,se){if(ee===void 0)ee=15;if(se===void 0)se=null;h(U,function(ne){var{gl:re,withProgram:Z,withTexture:te}=ne;te("copy",function(ie,le){re.texImage2D(re.TEXTURE_2D,0,re.RGBA,K,J,0,re.RGBA,re.UNSIGNED_BYTE,j),Z("copy",s,a,function(ue){var{setUniform:de,setAttribute:me}=ue;me("aUV",2,re.STATIC_DRAW,0,new Float32Array([0,0,2,0,0,2])),de("1i","image",le),re.bindFramebuffer(re.FRAMEBUFFER,se||null),re.disable(re.BLEND),re.colorMask(ee&8,ee&4,ee&2,ee&1),re.viewport(Y,X,K,J),re.scissor(Y,X,K,J),re.drawArrays(re.TRIANGLES,0,3)})})})}function u(U,j,Y){var{width:X,height:K}=U;h(U,function(J){var ee=J.gl,se=new Uint8Array(X*K*4);ee.readPixels(0,0,X,K,ee.RGBA,ee.UNSIGNED_BYTE,se),U.width=j,U.height=Y,d(ee,se,0,0,X,K)})}var _=Object.freeze({__proto__:null,withWebGLContext:h,renderImageData:d,resizeWebGLCanvasWithoutClearing:u});function p(U,j,Y,X,K,J){if(J===void 0)J=1;var ee=new Uint8Array(U*j),se=X[2]-X[0],ne=X[3]-X[1],re=[];i(Y,function(me,Ae,xe,Me){re.push({x1:me,y1:Ae,x2:xe,y2:Me,minX:Math.min(me,xe),minY:Math.min(Ae,Me),maxX:Math.max(me,xe),maxY:Math.max(Ae,Me)})}),re.sort(function(me,Ae){return me.maxX-Ae.maxX});for(var Z=0;Z<U;Z++)for(var te=0;te<j;te++){var ie=ue(X[0]+se*(Z+0.5)/U,X[1]+ne*(te+0.5)/j),le=Math.pow(1-Math.abs(ie)/K,J)/2;if(ie<0)le=1-le;le=Math.max(0,Math.min(255,Math.round(le*255))),ee[te*U+Z]=le}return ee;function ue(me,Ae){var xe=1/0,Me=1/0;for(var Re=re.length;Re--;){var we=re[Re];if(we.maxX+Me<=me)break;if(me+Me>we.minX&&Ae-Me<we.maxY&&Ae+Me>we.minY){var _e=g(me,Ae,we.x1,we.y1,we.x2,we.y2);if(_e<xe)xe=_e,Me=Math.sqrt(xe)}}if(de(me,Ae))Me=-Me;return Me}function de(me,Ae){var xe=0;for(var Me=re.length;Me--;){var Re=re[Me];if(Re.maxX<=me)break;var we=Re.y1>Ae!==Re.y2>Ae&&me<(Re.x2-Re.x1)*(Ae-Re.y1)/(Re.y2-Re.y1)+Re.x1;if(we)xe+=Re.y1<Re.y2?1:-1}return xe!==0}}function m(U,j,Y,X,K,J,ee,se,ne,re){if(J===void 0)J=1;if(se===void 0)se=0;if(ne===void 0)ne=0;if(re===void 0)re=0;A(U,j,Y,X,K,J,ee,null,se,ne,re)}function A(U,j,Y,X,K,J,ee,se,ne,re,Z){if(J===void 0)J=1;if(ne===void 0)ne=0;if(re===void 0)re=0;if(Z===void 0)Z=0;var te=p(U,j,Y,X,K,J),ie=new Uint8Array(te.length*4);for(var le=0;le<te.length;le++)ie[le*4+Z]=te[le];d(ee,ie,ne,re,U,j,1<<3-Z,se)}function g(U,j,Y,X,K,J){var ee=K-Y,se=J-X,ne=ee*ee+se*se,re=ne?Math.max(0,Math.min(1,((U-Y)*ee+(j-X)*se)/ne)):0,Z=U-(Y+re*ee),te=j-(X+re*se);return Z*Z+te*te}var f=Object.freeze({__proto__:null,generate:p,generateIntoCanvas:m,generateIntoFramebuffer:A}),y="precision highp float;uniform vec4 uGlyphBounds;attribute vec2 aUV;attribute vec4 aLineSegment;varying vec4 vLineSegment;varying vec2 vGlyphXY;void main(){vLineSegment=aLineSegment;vGlyphXY=mix(uGlyphBounds.xy,uGlyphBounds.zw,aUV);gl_Position=vec4(mix(vec2(-1.0),vec2(1.0),aUV),0.0,1.0);}",x="precision highp float;uniform vec4 uGlyphBounds;uniform float uMaxDistance;uniform float uExponent;varying vec4 vLineSegment;varying vec2 vGlyphXY;float absDistToSegment(vec2 point,vec2 lineA,vec2 lineB){vec2 lineDir=lineB-lineA;float lenSq=dot(lineDir,lineDir);float t=lenSq==0.0 ? 0.0 : clamp(dot(point-lineA,lineDir)/lenSq,0.0,1.0);vec2 linePt=lineA+t*lineDir;return distance(point,linePt);}void main(){vec4 seg=vLineSegment;vec2 p=vGlyphXY;float dist=absDistToSegment(p,seg.xy,seg.zw);float val=pow(1.0-clamp(dist/uMaxDistance,0.0,1.0),uExponent)*0.5;bool crossing=(seg.y>p.y!=seg.w>p.y)&&(p.x<(seg.z-seg.x)*(p.y-seg.y)/(seg.w-seg.y)+seg.x);bool crossingUp=crossing&&vLineSegment.y<vLineSegment.w;gl_FragColor=vec4(crossingUp ? 1.0/255.0 : 0.0,crossing&&!crossingUp ? 1.0/255.0 : 0.0,0.0,val);}",C="precision highp float;uniform sampler2D tex;varying vec2 vUV;void main(){vec4 color=texture2D(tex,vUV);bool inside=color.r!=color.g;float val=inside ? 1.0-color.a : color.a;gl_FragColor=vec4(val);}",b=new Float32Array([0,0,2,0,0,2]),I=null,v=!1,P={},M=new WeakMap;function B(U){if(!v&&!L(U))throw Error("WebGL generation not supported")}function T(U,j,Y,X,K,J,ee){if(J===void 0)J=1;if(ee===void 0)ee=null;if(!ee){if(ee=I,!ee){var se=typeof OffscreenCanvas==="function"?new OffscreenCanvas(1,1):typeof document<"u"?document.createElement("canvas"):null;if(!se)throw Error("OffscreenCanvas or DOM canvas not supported");ee=I=se.getContext("webgl",{depth:!1})}}B(ee);var ne=new Uint8Array(U*j*4);h(ee,function(ie){var{gl:le,withTexture:ue,withTextureFramebuffer:de}=ie;ue("readable",function(me,Ae){le.texImage2D(le.TEXTURE_2D,0,le.RGBA,U,j,0,le.RGBA,le.UNSIGNED_BYTE,null),de(me,Ae,function(xe){D(U,j,Y,X,K,J,le,xe,0,0,0),le.readPixels(0,0,U,j,le.RGBA,le.UNSIGNED_BYTE,ne)})})});var re=new Uint8Array(U*j);for(var Z=0,te=0;Z<ne.length;Z+=4)re[te++]=ne[Z];return re}function N(U,j,Y,X,K,J,ee,se,ne,re){if(J===void 0)J=1;if(se===void 0)se=0;if(ne===void 0)ne=0;if(re===void 0)re=0;D(U,j,Y,X,K,J,ee,null,se,ne,re)}function D(U,j,Y,X,K,J,ee,se,ne,re,Z){if(J===void 0)J=1;if(ne===void 0)ne=0;if(re===void 0)re=0;if(Z===void 0)Z=0;B(ee);var te=[];i(Y,function(ie,le,ue,de){te.push(ie,le,ue,de)}),te=new Float32Array(te),h(ee,function(ie){var{gl:le,isWebGL2:ue,getExtension:de,withProgram:me,withTexture:Ae,withTextureFramebuffer:xe,handleContextLoss:Me}=ie;if(Ae("rawDistances",function(Re,we){if(U!==Re._lastWidth||j!==Re._lastHeight)le.texImage2D(le.TEXTURE_2D,0,le.RGBA,Re._lastWidth=U,Re._lastHeight=j,0,le.RGBA,le.UNSIGNED_BYTE,null);me("main",y,x,function(_e){var{setAttribute:ye,setUniform:Se}=_e,Ne=!ue&&de("ANGLE_instanced_arrays"),ke=!ue&&de("EXT_blend_minmax");ye("aUV",2,le.STATIC_DRAW,0,b),ye("aLineSegment",4,le.DYNAMIC_DRAW,1,te),Se.apply(void 0,["4f","uGlyphBounds"].concat(X)),Se("1f","uMaxDistance",K),Se("1f","uExponent",J),xe(Re,we,function(nt){if(le.enable(le.BLEND),le.colorMask(!0,!0,!0,!0),le.viewport(0,0,U,j),le.scissor(0,0,U,j),le.blendFunc(le.ONE,le.ONE),le.blendEquationSeparate(le.FUNC_ADD,ue?le.MAX:ke.MAX_EXT),le.clear(le.COLOR_BUFFER_BIT),ue)le.drawArraysInstanced(le.TRIANGLES,0,3,te.length/4);else Ne.drawArraysInstancedANGLE(le.TRIANGLES,0,3,te.length/4)})}),me("post",s,C,function(_e){_e.setAttribute("aUV",2,le.STATIC_DRAW,0,b),_e.setUniform("1i","tex",we),le.bindFramebuffer(le.FRAMEBUFFER,se),le.disable(le.BLEND),le.colorMask(Z===0,Z===1,Z===2,Z===3),le.viewport(ne,re,U,j),le.scissor(ne,re,U,j),le.drawArrays(le.TRIANGLES,0,3)})}),le.isContextLost())throw Me(),Error("webgl context lost")})}function L(U){var j=!U||U===I?P:U.canvas||U,Y=M.get(j);if(Y===void 0){v=!0;var X=null;try{var K=[97,106,97,61,99,137,118,80,80,118,137,99,61,97,106,97],J=T(4,4,"M8,8L16,8L24,24L16,24Z",[0,0,32,32],24,1,U);if(Y=J&&K.length===J.length&&J.every(function(ee,se){return ee===K[se]}),!Y)X="bad trial run results",console.info(K,J)}catch(ee){Y=!1,X=ee.message}if(X)console.warn("WebGL SDF generation not supported:",X);v=!1,M.set(j,Y)}return Y}var H=Object.freeze({__proto__:null,generate:T,generateIntoCanvas:N,generateIntoFramebuffer:D,isSupported:L});function V(U,j,Y,X,K,J){if(K===void 0)K=Math.max(X[2]-X[0],X[3]-X[1])/2;if(J===void 0)J=1;try{return T.apply(H,arguments)}catch(ee){return console.info("WebGL SDF generation failed, falling back to JS",ee),p.apply(f,arguments)}}function O(U,j,Y,X,K,J,ee,se,ne,re){if(K===void 0)K=Math.max(X[2]-X[0],X[3]-X[1])/2;if(J===void 0)J=1;if(se===void 0)se=0;if(ne===void 0)ne=0;if(re===void 0)re=0;try{return N.apply(H,arguments)}catch(Z){return console.info("WebGL SDF generation failed, falling back to JS",Z),m.apply(f,arguments)}}return t.forEachPathCommand=r,t.generate=V,t.generateIntoCanvas=O,t.javascript=f,t.pathToLineSegments=i,t.webgl=H,t.webglUtils=_,Object.defineProperty(t,"__esModule",{value:!0}),t}({});return e}function j5t(){var e=function(t){var n={R:"13k,1a,2,3,3,2+1j,ch+16,a+1,5+2,2+n,5,a,4,6+16,4+3,h+1b,4mo,179q,2+9,2+11,2i9+7y,2+68,4,3+4,5+13,4+3,2+4k,3+29,8+cf,1t+7z,w+17,3+3m,1t+3z,16o1+5r,8+30,8+mc,29+1r,29+4v,75+73",EN:"1c+9,3d+1,6,187+9,513,4+5,7+9,sf+j,175h+9,qw+q,161f+1d,4xt+a,25i+9",ES:"17,2,6dp+1,f+1,av,16vr,mx+1,4o,2",ET:"z+2,3h+3,b+1,ym,3e+1,2o,p4+1,8,6u,7c,g6,1wc,1n9+4,30+1b,2n,6d,qhx+1,h0m,a+1,49+2,63+1,4+1,6bb+3,12jj",AN:"16o+5,2j+9,2+1,35,ed,1ff2+9,87+u",CS:"18,2+1,b,2u,12k,55v,l,17v0,2,3,53,2+1,b",B:"a,3,f+2,2v,690",S:"9,2,k",WS:"c,k,4f4,1vk+a,u,1j,335",ON:"x+1,4+4,h+5,r+5,r+3,z,5+3,2+1,2+1,5,2+2,3+4,o,w,ci+1,8+d,3+d,6+8,2+g,39+1,9,6+1,2,33,b8,3+1,3c+1,7+1,5r,b,7h+3,sa+5,2,3i+6,jg+3,ur+9,2v,ij+1,9g+9,7+a,8m,4+1,49+x,14u,2+2,c+2,e+2,e+2,e+1,i+n,e+e,2+p,u+2,e+2,36+1,2+3,2+1,b,2+2,6+5,2,2,2,h+1,5+4,6+3,3+f,16+2,5+3l,3+81,1y+p,2+40,q+a,m+13,2r+ch,2+9e,75+hf,3+v,2+2w,6e+5,f+6,75+2a,1a+p,2+2g,d+5x,r+b,6+3,4+o,g,6+1,6+2,2k+1,4,2j,5h+z,1m+1,1e+f,t+2,1f+e,d+3,4o+3,2s+1,w,535+1r,h3l+1i,93+2,2s,b+1,3l+x,2v,4g+3,21+3,kz+1,g5v+1,5a,j+9,n+v,2,3,2+8,2+1,3+2,2,3,46+1,4+4,h+5,r+5,r+a,3h+2,4+6,b+4,78,1r+24,4+c,4,1hb,ey+6,103+j,16j+c,1ux+7,5+g,fsh,jdq+1t,4,57+2e,p1,1m,1m,1m,1m,4kt+1,7j+17,5+2r,d+e,3+e,2+e,2+10,m+4,w,1n+5,1q,4z+5,4b+rb,9+c,4+c,4+37,d+2g,8+b,l+b,5+1j,9+9,7+13,9+t,3+1,27+3c,2+29,2+3q,d+d,3+4,4+2,6+6,a+o,8+6,a+2,e+6,16+42,2+1i",BN:"0+8,6+d,2s+5,2+p,e,4m9,1kt+2,2b+5,5+5,17q9+v,7k,6p+8,6+1,119d+3,440+7,96s+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+75,6p+2rz,1ben+1,1ekf+1,1ekf+1",NSM:"lc+33,7o+6,7c+18,2,2+1,2+1,2,21+a,1d+k,h,2u+6,3+5,3+1,2+3,10,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,g+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+g,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,k1+w,2db+2,3y,2p+v,ff+3,30+1,n9x+3,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,r2,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+5,3+1,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2d+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,f0c+4,1o+6,t5,1s+3,2a,f5l+1,43t+2,i+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,gzhy+6n",AL:"16w,3,2,e+1b,z+2,2+2s,g+1,8+1,b+m,2+t,s+2i,c+e,4h+f,1d+1e,1bwe+dp,3+3z,x+c,2+1,35+3y,2rm+z,5+7,b+5,dt+l,c+u,17nl+27,1t+27,4x+6n,3+d",LRO:"6ct",RLO:"6cu",LRE:"6cq",RLE:"6cr",PDF:"6cs",LRI:"6ee",RLI:"6ef",FSI:"6eg",PDI:"6eh"},o={},r={};o.L=1,r[1]="L",Object.keys(n).forEach(function(Me,Re){o[Me]=1<<Re+1,r[o[Me]]=Me}),Object.freeze(o);var i=o.LRI|o.RLI|o.FSI,s=o.L|o.R|o.AL,a=o.B|o.S|o.WS|o.ON|o.FSI|o.LRI|o.RLI|o.PDI,c=o.BN|o.RLE|o.LRE|o.RLO|o.LRO|o.PDF,l=o.S|o.WS|o.B|i|o.PDI|c,h=null;function d(){if(!h){h=new Map;var Me=0;for(var Re in n)if(n.hasOwnProperty(Re)){var we=n[Re],_e="",ye=void 0,Se=!1,Ne=0;for(var ke=0;ke<=we.length+1;ke+=1){var nt=we[ke];if(nt!==","&&ke!==we.length)if(nt==="+")Se=!0,Ne=Me=Ne+parseInt(_e,36),_e="";else _e+=nt;else{if(!Se)Ne=Me=Ne+parseInt(_e,36),ye=Me;else ye=Me+parseInt(_e,36);Se=!1,_e="",Ne=ye;for(var dt=Me;dt<ye+1;dt+=1)h.set(dt,o[Re])}}}}}function u(Me){return d(),h.get(Me.codePointAt(0))||o.L}function _(Me){return r[u(Me)]}var p={pairs:"14>1,1e>2,u>2,2wt>1,1>1,1ge>1,1wp>1,1j>1,f>1,hm>1,1>1,u>1,u6>1,1>1,+5,28>1,w>1,1>1,+3,b8>1,1>1,+3,1>3,-1>-1,3>1,1>1,+2,1s>1,1>1,x>1,th>1,1>1,+2,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,4q>1,1e>2,u>2,2>1,+1",canonical:"6f1>-6dx,6dy>-6dx,6ec>-6ed,6ee>-6ed,6ww>2jj,-2ji>2jj,14r4>-1e7l,1e7m>-1e7l,1e7m>-1e5c,1e5d>-1e5b,1e5c>-14qx,14qy>-14qx,14vn>-1ecg,1ech>-1ecg,1edu>-1ecg,1eci>-1ecg,1eda>-1ecg,1eci>-1ecg,1eci>-168q,168r>-168q,168s>-14ye,14yf>-14ye"};function m(Me,Re){var we=36,_e=0,ye=new Map,Se=Re&&new Map,Ne;return Me.split(",").forEach(function ke(nt){if(nt.indexOf("+")!==-1)for(var dt=+nt;dt--;)ke(Ne);else{Ne=nt;var rt=nt.split(">"),mt=rt[0],lt=rt[1];mt=String.fromCodePoint(_e+=parseInt(mt,we)),lt=String.fromCodePoint(_e+=parseInt(lt,we)),ye.set(mt,lt),Re&&Se.set(lt,mt)}}),{map:ye,reverseMap:Se}}var A,g,f;function y(){if(!A){var Me=m(p.pairs,!0),{map:Re,reverseMap:we}=Me;A=Re,g=we,f=m(p.canonical,!1).map}}function x(Me){return y(),A.get(Me)||null}function C(Me){return y(),g.get(Me)||null}function b(Me){return y(),f.get(Me)||null}var{L:I,R:v,EN:P,ES:M,ET:B,AN:T,CS:N,B:D,S:L,ON:H,BN:V,NSM:O,AL:U,LRO:j,RLO:Y,LRE:X,RLE:K,PDF:J,LRI:ee,RLI:se,FSI:ne,PDI:re}=o;function Z(Me,Re){var we=125,_e=new Uint32Array(Me.length);for(var ye=0;ye<Me.length;ye++)_e[ye]=u(Me[ye]);var Se=new Map;function Ne(_d,sl){var Sa=_e[_d];if(_e[_d]=sl,Se.set(Sa,Se.get(Sa)-1),Sa&a)Se.set(a,Se.get(a)-1);if(Se.set(sl,(Se.get(sl)||0)+1),sl&a)Se.set(a,(Se.get(a)||0)+1)}var ke=new Uint8Array(Me.length),nt=new Map,dt=[],rt=null;for(var mt=0;mt<Me.length;mt++){if(!rt)dt.push(rt={start:mt,end:Me.length-1,level:Re==="rtl"?1:Re==="ltr"?0:Us(mt,!1)});if(_e[mt]&D)rt.end=mt,rt=null}var lt=K|X|Y|j|i|re|J|D,Ct=function(_d){return _d+(_d&1?1:2)},Nt=function(_d){return _d+(_d&1?2:1)};for(var Ht=0;Ht<dt.length;Ht++){rt=dt[Ht];var Tt=[{_level:rt.level,_override:0,_isolate:0}],et=void 0,vt=0,ht=0,We=0;Se.clear();for(var Le=rt.start;Le<=rt.end;Le++){var Ze=_e[Le];if(et=Tt[Tt.length-1],Se.set(Ze,(Se.get(Ze)||0)+1),Ze&a)Se.set(a,(Se.get(a)||0)+1);if(Ze&lt){if(Ze&(K|X)){ke[Le]=et._level;var $e=(Ze===K?Nt:Ct)(et._level);if($e<=we&&!vt&&!ht)Tt.push({_level:$e,_override:0,_isolate:0});else if(!vt)ht++}else if(Ze&(Y|j)){ke[Le]=et._level;var qe=(Ze===Y?Nt:Ct)(et._level);if(qe<=we&&!vt&&!ht)Tt.push({_level:qe,_override:Ze&Y?v:I,_isolate:0});else if(!vt)ht++}else if(Ze&i){if(Ze&ne)Ze=Us(Le+1,!0)===1?se:ee;if(ke[Le]=et._level,et._override)Ne(Le,et._override);var ft=(Ze===se?Nt:Ct)(et._level);if(ft<=we&&vt===0&&ht===0)We++,Tt.push({_level:ft,_override:0,_isolate:1,_isolInitIndex:Le});else vt++}else if(Ze&re){if(vt>0)vt--;else if(We>0){ht=0;while(!Tt[Tt.length-1]._isolate)Tt.pop();var It=Tt[Tt.length-1]._isolInitIndex;if(It!=null)nt.set(It,Le),nt.set(Le,It);Tt.pop(),We--}if(et=Tt[Tt.length-1],ke[Le]=et._level,et._override)Ne(Le,et._override)}else if(Ze&J){if(vt===0){if(ht>0)ht--;else if(!et._isolate&&Tt.length>1)Tt.pop(),et=Tt[Tt.length-1]}ke[Le]=et._level}else if(Ze&D)ke[Le]=rt.level}else if(ke[Le]=et._level,et._override&&Ze!==V)Ne(Le,et._override)}var ze=[],Xe=null;for(var it=rt.start;it<=rt.end;it++){var St=_e[it];if(!(St&c)){var kt=ke[it],Lt=St&i,Wt=St===re;if(Xe&&kt===Xe._level)Xe._end=it,Xe._endsWithIsolInit=Lt;else ze.push(Xe={_start:it,_end:it,_level:kt,_startsWithPDI:Wt,_endsWithIsolInit:Lt})}}var bn=[];for(var pn=0;pn<ze.length;pn++){var wn=ze[pn];if(!wn._startsWithPDI||wn._startsWithPDI&&!nt.has(wn._start)){var Fn=[Xe=wn];for(var mn=void 0;Xe&&Xe._endsWithIsolInit&&(mn=nt.get(Xe._end))!=null;)for(var _n=pn+1;_n<ze.length;_n++)if(ze[_n]._start===mn){Fn.push(Xe=ze[_n]);break}var no=[];for(var To=0;To<Fn.length;To++){var ir=Fn[To];for(var xt=ir._start;xt<=ir._end;xt++)no.push(xt)}var gt=ke[no[0]],Ot=rt.level;for(var Zt=no[0]-1;Zt>=0;Zt--)if(!(_e[Zt]&c)){Ot=ke[Zt];break}var je=no[no.length-1],Mt=ke[je],Kt=rt.level;if(!(_e[je]&i)){for(var nn=je+1;nn<=rt.end;nn++)if(!(_e[nn]&c)){Kt=ke[nn];break}}bn.push({_seqIndices:no,_sosType:Math.max(Ot,gt)%2?v:I,_eosType:Math.max(Kt,Mt)%2?v:I})}}for(var Zn=0;Zn<bn.length;Zn++){var Vn=bn[Zn],{_seqIndices:Rn,_sosType:Bn,_eosType:ho}=Vn,Qo=ke[Rn[0]]&1?v:I;if(Se.get(O))for(var Nn=0;Nn<Rn.length;Nn++){var mo=Rn[Nn];if(_e[mo]&O){var Io=Bn;for(var io=Nn-1;io>=0;io--)if(!(_e[Rn[io]]&c)){Io=_e[Rn[io]];break}Ne(mo,Io&(i|re)?H:Io)}}if(Se.get(P))for(var Wo=0;Wo<Rn.length;Wo++){var rr=Rn[Wo];if(_e[rr]&P)for(var xr=Wo-1;xr>=-1;xr--){var Ci=xr===-1?Bn:_e[Rn[xr]];if(Ci&s){if(Ci===U)Ne(rr,T);break}}}if(Se.get(U))for(var ea=0;ea<Rn.length;ea++){var ya=Rn[ea];if(_e[ya]&U)Ne(ya,v)}if(Se.get(M)||Se.get(N))for(var Oo=1;Oo<Rn.length-1;Oo++){var $i=Rn[Oo];if(_e[$i]&(M|N)){var Ei=0,hs=0;for(var il=Oo-1;il>=0;il--)if(Ei=_e[Rn[il]],!(Ei&c))break;for(var kl=Oo+1;kl<Rn.length;kl++)if(hs=_e[Rn[kl]],!(hs&c))break;if(Ei===hs&&(_e[$i]===M?Ei===P:Ei&(P|T)))Ne($i,Ei)}}if(Se.get(P))for(var Xc=0;Xc<Rn.length;Xc++){var Od=Rn[Xc];if(_e[Od]&P){for(var cp=Xc-1;cp>=0&&_e[Rn[cp]]&(B|c);cp--)Ne(Rn[cp],P);for(Xc++;Xc<Rn.length&&_e[Rn[Xc]]&(B|c|P);Xc++)if(_e[Rn[Xc]]!==P)Ne(Rn[Xc],P)}}if(Se.get(B)||Se.get(M)||Se.get(N))for(var or=0;or<Rn.length;or++){var Gr=Rn[or];if(_e[Gr]&(B|M|N)){Ne(Gr,H);for(var ti=or-1;ti>=0&&_e[Rn[ti]]&c;ti--)Ne(Rn[ti],H);for(var $l=or+1;$l<Rn.length&&_e[Rn[$l]]&c;$l++)Ne(Rn[$l],H)}}if(Se.get(P))for(var Ll=0,Vd=Bn;Ll<Rn.length;Ll++){var $1=Rn[Ll],fm=_e[$1];if(fm&P){if(Vd===I)Ne($1,I)}else if(fm&s)Vd=fm}if(Se.get(a)){var xa=v|P|T,k0=xa|I,ym=[];{var _u=[];for(var o0=0;o0<Rn.length;o0++)if(_e[Rn[o0]]&a){var Zi=Me[Rn[o0]],Hl=void 0;if(x(Zi)!==null)if(_u.length<63)_u.push({char:Zi,seqIndex:o0});else break;else if((Hl=C(Zi))!==null)for(var da=_u.length-1;da>=0;da--){var zc=_u[da].char;if(zc===Hl||zc===C(b(Zi))||x(b(zc))===Zi){ym.push([_u[da].seqIndex,o0]),_u.length=da;break}}}ym.sort(function(_d,sl){return _d[0]-sl[0]})}for(var ua=0;ua<ym.length;ua++){var ri=ym[ua],ic=ri[0],wh=ri[1],Qs=!1,Yd=0;for(var Bh=ic+1;Bh<wh;Bh++){var Gd=Rn[Bh];if(_e[Gd]&k0){Qs=!0;var gA=_e[Gd]&xa?v:I;if(gA===Qo){Yd=gA;break}}}if(Qs&&!Yd){Yd=Bn;for(var r0=ic-1;r0>=0;r0--){var q1=Rn[r0];if(_e[q1]&k0){var Tf=_e[q1]&xa?v:I;if(Tf!==Qo)Yd=Tf;else Yd=Qo;break}}}if(Yd){if(_e[Rn[ic]]=_e[Rn[wh]]=Yd,Yd!==Qo){for(var lp=ic+1;lp<Rn.length;lp++)if(!(_e[Rn[lp]]&c)){if(u(Me[Rn[lp]])&O)_e[Rn[lp]]=Yd;break}}if(Yd!==Qo){for(var fg=wh+1;fg<Rn.length;fg++)if(!(_e[Rn[fg]]&c)){if(u(Me[Rn[fg]])&O)_e[Rn[fg]]=Yd;break}}}}for(var gu=0;gu<Rn.length;gu++)if(_e[Rn[gu]]&a){var a_=gu,Kh=gu,Nx=Bn;for(var c_=gu-1;c_>=0;c_--)if(_e[Rn[c_]]&c)a_=c_;else{Nx=_e[Rn[c_]]&xa?v:I;break}var N2=ho;for(var J1=gu+1;J1<Rn.length;J1++)if(_e[Rn[J1]]&(a|c))Kh=J1;else{N2=_e[Rn[J1]]&xa?v:I;break}for(var hI=a_;hI<=Kh;hI++)_e[Rn[hI]]=Nx===N2?Nx:Qo;gu=Kh}}}for(var L0=rt.start;L0<=rt.end;L0++){var dI=ke[L0],Z1=_e[L0];if(dI&1){if(Z1&(I|P|T))ke[L0]++}else if(Z1&v)ke[L0]++;else if(Z1&(T|P))ke[L0]+=2;if(Z1&c)ke[L0]=L0===0?rt.level:ke[L0-1];if(L0===rt.end||u(Me[L0])&(L|D))for(var Ud=L0;Ud>=0&&u(Me[Ud])&l;Ud--)ke[Ud]=rt.level}}return{levels:ke,paragraphs:dt};function Us(_d,sl){for(var Sa=_d;Sa<Me.length;Sa++){var AA=_e[Sa];if(AA&(v|U))return 1;if(AA&(D|I)||sl&&AA===re)return 0;if(AA&i){var MC=Bo(Sa);Sa=MC===-1?Me.length:MC}}return 0}function Bo(_d){var sl=1;for(var Sa=_d+1;Sa<Me.length;Sa++){var AA=_e[Sa];if(AA&D)break;if(AA&re){if(--sl===0)return Sa}else if(AA&i)sl++}return-1}}var te="14>1,j>2,t>2,u>2,1a>g,2v3>1,1>1,1ge>1,1wd>1,b>1,1j>1,f>1,ai>3,-2>3,+1,8>1k0,-1jq>1y7,-1y6>1hf,-1he>1h6,-1h5>1ha,-1h8>1qi,-1pu>1,6>3u,-3s>7,6>1,1>1,f>1,1>1,+2,3>1,1>1,+13,4>1,1>1,6>1eo,-1ee>1,3>1mg,-1me>1mk,-1mj>1mi,-1mg>1mi,-1md>1,1>1,+2,1>10k,-103>1,1>1,4>1,5>1,1>1,+10,3>1,1>8,-7>8,+1,-6>7,+1,a>1,1>1,u>1,u6>1,1>1,+5,26>1,1>1,2>1,2>2,8>1,7>1,4>1,1>1,+5,b8>1,1>1,+3,1>3,-2>1,2>1,1>1,+2,c>1,3>1,1>1,+2,h>1,3>1,a>1,1>1,2>1,3>1,1>1,d>1,f>1,3>1,1a>1,1>1,6>1,7>1,13>1,k>1,1>1,+19,4>1,1>1,+2,2>1,1>1,+18,m>1,a>1,1>1,lk>1,1>1,4>1,2>1,f>1,3>1,1>1,+3,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,6>1,4j>1,j>2,t>2,u>2,2>1,+1",ie;function le(){if(!ie){var Me=m(te,!0),{map:Re,reverseMap:we}=Me;we.forEach(function(_e,ye){Re.set(ye,_e)}),ie=Re}}function ue(Me){return le(),ie.get(Me)||null}function de(Me,Re,we,_e){var ye=Me.length;we=Math.max(0,we==null?0:+we),_e=Math.min(ye-1,_e==null?ye-1:+_e);var Se=new Map;for(var Ne=we;Ne<=_e;Ne++)if(Re[Ne]&1){var ke=ue(Me[Ne]);if(ke!==null)Se.set(Ne,ke)}return Se}function me(Me,Re,we,_e){var ye=Me.length;we=Math.max(0,we==null?0:+we),_e=Math.min(ye-1,_e==null?ye-1:+_e);var Se=[];return Re.paragraphs.forEach(function(Ne){var ke=Math.max(we,Ne.start),nt=Math.min(_e,Ne.end);if(ke<nt){var dt=Re.levels.slice(ke,nt+1);for(var rt=nt;rt>=ke&&u(Me[rt])&l;rt--)dt[rt]=Ne.level;var mt=Ne.level,lt=1/0;for(var Ct=0;Ct<dt.length;Ct++){var Nt=dt[Ct];if(Nt>mt)mt=Nt;if(Nt<lt)lt=Nt|1}for(var Ht=mt;Ht>=lt;Ht--)for(var Tt=0;Tt<dt.length;Tt++)if(dt[Tt]>=Ht){var et=Tt;while(Tt+1<dt.length&&dt[Tt+1]>=Ht)Tt++;if(Tt>et)Se.push([et+ke,Tt+ke])}}}),Se}function Ae(Me,Re,we,_e){var ye=xe(Me,Re,we,_e),Se=[].concat(Me);return ye.forEach(function(Ne,ke){Se[ke]=(Re.levels[Ne]&1?ue(Me[Ne]):null)||Me[Ne]}),Se.join("")}function xe(Me,Re,we,_e){var ye=me(Me,Re,we,_e),Se=[];for(var Ne=0;Ne<Me.length;Ne++)Se[Ne]=Ne;return ye.forEach(function(ke){var nt=ke[0],dt=ke[1],rt=Se.slice(nt,dt+1);for(var mt=rt.length;mt--;)Se[dt-mt]=rt[mt]}),Se}return t.closingToOpeningBracket=C,t.getBidiCharType=u,t.getBidiCharTypeName=_,t.getCanonicalBracket=b,t.getEmbeddingLevels=Z,t.getMirroredCharacter=ue,t.getMirroredCharactersMap=de,t.getReorderSegments=me,t.getReorderedIndices=xe,t.getReorderedString=Ae,t.openingToClosingBracket=x,Object.defineProperty(t,"__esModule",{value:!0}),t}({});return e}var UQe=/\bvoid\s+main\s*\(\s*\)\s*{/g;function GQe(e){let t=/^[ \t]*#include +<([\w\d./]+)>/gm;function n(o,r){let i=Va[r];return i?GQe(i):o}return e.replace(t,n)}var o2=[];for(let e=0;e<256;e++)o2[e]=(e<16?"0":"")+e.toString(16);function zIo(){let e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0,o=Math.random()*4294967295|0;return(o2[e&255]+o2[e>>8&255]+o2[e>>16&255]+o2[e>>24&255]+"-"+o2[t&255]+o2[t>>8&255]+"-"+o2[t>>16&15|64]+o2[t>>24&255]+"-"+o2[n&63|128]+o2[n>>8&255]+"-"+o2[n>>16&255]+o2[n>>24&255]+o2[o&255]+o2[o>>8&255]+o2[o>>16&255]+o2[o>>24&255]).toUpperCase()}var zz=Object.assign||function(){let e=arguments[0];for(let t=1,n=arguments.length;t<n;t++){let o=arguments[t];if(o){for(let r in o)if(Object.prototype.hasOwnProperty.call(o,r))e[r]=o[r]}}return e},OIo=Date.now(),K5t=new WeakMap,$5t=new Map,VIo=10000000000;function rfe(e,t){let n=WIo(t),o=K5t.get(e);if(!o)K5t.set(e,o=Object.create(null));if(o[n])return new o[n];let r=`_onBeforeCompile${n}`,i=function(l,h){e.onBeforeCompile.call(this,l,h);let d=this.customProgramCacheKey()+"|"+l.vertexShader+"|"+l.fragmentShader,u=$5t[d];if(!u){let _=YIo(this,l,t,n);u=$5t[d]=_}if(l.vertexShader=u.vertexShader,l.fragmentShader=u.fragmentShader,zz(l.uniforms,this.uniforms),t.timeUniform)l.uniforms[t.timeUniform]={get value(){return Date.now()-OIo}};if(this[r])this[r](l)},s=function(){return a(t.chained?e:e.clone())},a=function(l){let h=Object.create(l,c);return Object.defineProperty(h,"baseMaterial",{value:e}),Object.defineProperty(h,"id",{value:VIo++}),h.uuid=zIo(),h.uniforms=zz({},l.uniforms,t.uniforms),h.defines=zz({},l.defines,t.defines),h.defines[`TROIKA_DERIVED_MATERIAL_${n}`]="",h.extensions=zz({},l.extensions,t.extensions),h._listeners=void 0,h},c={constructor:{value:s},isDerivedMaterial:{value:!0},type:{get:()=>e.type,set:(l)=>{e.type=l}},isDerivedFrom:{writable:!0,configurable:!0,value:function(l){let h=this.baseMaterial;return l===h||h.isDerivedMaterial&&h.isDerivedFrom(l)||!1}},customProgramCacheKey:{writable:!0,configurable:!0,value:function(){return e.customProgramCacheKey()+"|"+n}},onBeforeCompile:{get(){return i},set(l){this[r]=l}},copy:{writable:!0,configurable:!0,value:function(l){if(e.copy.call(this,l),!e.isShaderMaterial&&!e.isDerivedMaterial)zz(this.extensions,l.extensions),zz(this.defines,l.defines),zz(this.uniforms,yQe.clone(l.uniforms));return this}},clone:{writable:!0,configurable:!0,value:function(){let l=new e.constructor;return a(l).copy(this)}},getDepthMaterial:{writable:!0,configurable:!0,value:function(){let l=this._depthMaterial;if(!l)l=this._depthMaterial=rfe(e.isDerivedMaterial?e.getDepthMaterial():new GAe({depthPacking:n5t}),t),l.defines.IS_DEPTH_MATERIAL="",l.uniforms=this.uniforms;return l}},getDistanceMaterial:{writable:!0,configurable:!0,value:function(){let l=this._distanceMaterial;if(!l)l=this._distanceMaterial=rfe(e.isDerivedMaterial?e.getDistanceMaterial():new UAe,t),l.defines.IS_DISTANCE_MATERIAL="",l.uniforms=this.uniforms;return l}},dispose:{writable:!0,configurable:!0,value(){let{_depthMaterial:l,_distanceMaterial:h}=this;if(l)l.dispose();if(h)h.dispose();e.dispose.call(this)}}};return o[n]=s,new s}function YIo(e,{vertexShader:t,fragmentShader:n},o,r){let{vertexDefs:i,vertexMainIntro:s,vertexMainOutro:a,vertexTransform:c,fragmentDefs:l,fragmentMainIntro:h,fragmentMainOutro:d,fragmentColorTransform:u,customRewriter:_,timeUniform:p}=o;if(i=i||"",s=s||"",a=a||"",l=l||"",h=h||"",d=d||"",c||_)t=GQe(t);if(u||_)n=n.replace(/^[ \t]*#include <((?:tonemapping|encodings|colorspace|fog|premultiplied_alpha|dithering)_fragment)>/gm,`
//!BEGIN_POST_CHUNK $1
$&
//!END_POST_CHUNK
`),n=GQe(n);if(_){let m=_({vertexShader:t,fragmentShader:n});t=m.vertexShader,n=m.fragmentShader}if(u){let m=[];n=n.replace(/^\/\/!BEGIN_POST_CHUNK[^]+?^\/\/!END_POST_CHUNK/gm,(A)=>(m.push(A),"")),d=`${u}
${m.join(`
`)}
${d}`}if(p){let m=`
uniform float ${p};
`;i=m+i,l=m+l}if(c){if(t=`vec3 troika_position_${r};
vec3 troika_normal_${r};
vec2 troika_uv_${r};
${t}
`,i=`${i}
void troikaVertexTransform${r}() {
  vec3 position = troika_position_${r};
  vec3 normal = troika_normal_${r};
  vec2 uv = troika_uv_${r};
  ${c}
  troika_position_${r} = position;
  troika_normal_${r} = normal;
  troika_uv_${r} = uv;
}
`,s=`
troika_position_${r} = vec3(position);
troika_normal_${r} = vec3(normal);
troika_uv_${r} = vec2(uv);
troikaVertexTransform${r}();
${s}
`,t=t.replace(/\b(position|normal|uv)\b/g,(m,A,g,f)=>/\battribute\s+vec[23]\s+$/.test(f.substr(0,g))?A:`troika_${A}_${r}`),!(e.map&&e.map.channel>0))t=t.replace(/\bMAP_UV\b/g,`troika_uv_${r}`)}return t=q5t(t,r,i,s,a),n=q5t(n,r,l,h,d),{vertexShader:t,fragmentShader:n}}function q5t(e,t,n,o,r){if(o||r||n)e=e.replace(UQe,`
${n}
void troikaOrigMain${t}() {`),e+=`
void main() {
  ${o}
  troikaOrigMain${t}();
  ${r}
}`;return e}function GIo(e,t){return e==="uniforms"?void 0:typeof t==="function"?t.toString():t}var UIo=0,J5t=new Map;function WIo(e){let t=JSON.stringify(e,GIo),n=J5t.get(t);if(n==null)J5t.set(t,n=++UIo);return n}/*!
Custom build of Typr.ts (https://github.com/fredli74/Typr.ts) for use in Troika text rendering.
Original MIT license applies: https://github.com/fredli74/Typr.ts/blob/master/LICENSE
*/function XIo(){return typeof window>"u"&&(self.window=self),function(e){var t={parse:function(r){var i=t._bin,s=new Uint8Array(r);if(i.readASCII(s,0,4)=="ttcf"){var a=4;i.readUshort(s,a),a+=2,i.readUshort(s,a),a+=2;var c=i.readUint(s,a);a+=4;for(var l=[],h=0;h<c;h++){var d=i.readUint(s,a);a+=4,l.push(t._readFont(s,d))}return l}return[t._readFont(s,0)]},_readFont:function(r,i){var s=t._bin,a=i;s.readFixed(r,i),i+=4;var c=s.readUshort(r,i);i+=2,s.readUshort(r,i),i+=2,s.readUshort(r,i),i+=2,s.readUshort(r,i),i+=2;for(var l=["cmap","head","hhea","maxp","hmtx","name","OS/2","post","loca","glyf","kern","CFF ","GDEF","GPOS","GSUB","SVG "],h={_data:r,_offset:a},d={},u=0;u<c;u++){var _=s.readASCII(r,i,4);i+=4,s.readUint(r,i),i+=4;var p=s.readUint(r,i);i+=4;var m=s.readUint(r,i);i+=4,d[_]={offset:p,length:m}}for(u=0;u<l.length;u++){var A=l[u];d[A]&&(h[A.trim()]=t[A.trim()].parse(r,d[A].offset,d[A].length,h))}return h},_tabOffset:function(r,i,s){for(var a=t._bin,c=a.readUshort(r,s+4),l=s+12,h=0;h<c;h++){var d=a.readASCII(r,l,4);l+=4,a.readUint(r,l),l+=4;var u=a.readUint(r,l);if(l+=4,a.readUint(r,l),l+=4,d==i)return u}return 0}};t._bin={readFixed:function(r,i){return(r[i]<<8|r[i+1])+(r[i+2]<<8|r[i+3])/65540},readF2dot14:function(r,i){return t._bin.readShort(r,i)/16384},readInt:function(r,i){return t._bin._view(r).getInt32(i)},readInt8:function(r,i){return t._bin._view(r).getInt8(i)},readShort:function(r,i){return t._bin._view(r).getInt16(i)},readUshort:function(r,i){return t._bin._view(r).getUint16(i)},readUshorts:function(r,i,s){for(var a=[],c=0;c<s;c++)a.push(t._bin.readUshort(r,i+2*c));return a},readUint:function(r,i){return t._bin._view(r).getUint32(i)},readUint64:function(r,i){return 4294967296*t._bin.readUint(r,i)+t._bin.readUint(r,i+4)},readASCII:function(r,i,s){for(var a="",c=0;c<s;c++)a+=String.fromCharCode(r[i+c]);return a},readUnicode:function(r,i,s){for(var a="",c=0;c<s;c++){var l=r[i++]<<8|r[i++];a+=String.fromCharCode(l)}return a},_tdec:typeof window<"u"&&window.TextDecoder?new window.TextDecoder:null,readUTF8:function(r,i,s){var a=t._bin._tdec;return a&&i==0&&s==r.length?a.decode(r):t._bin.readASCII(r,i,s)},readBytes:function(r,i,s){for(var a=[],c=0;c<s;c++)a.push(r[i+c]);return a},readASCIIArray:function(r,i,s){for(var a=[],c=0;c<s;c++)a.push(String.fromCharCode(r[i+c]));return a},_view:function(r){return r._dataView||(r._dataView=r.buffer?new DataView(r.buffer,r.byteOffset,r.byteLength):new DataView(new Uint8Array(r).buffer))}},t._lctf={},t._lctf.parse=function(r,i,s,a,c){var l=t._bin,h={},d=i;l.readFixed(r,i),i+=4;var u=l.readUshort(r,i);i+=2;var _=l.readUshort(r,i);i+=2;var p=l.readUshort(r,i);return i+=2,h.scriptList=t._lctf.readScriptList(r,d+u),h.featureList=t._lctf.readFeatureList(r,d+_),h.lookupList=t._lctf.readLookupList(r,d+p,c),h},t._lctf.readLookupList=function(r,i,s){var a=t._bin,c=i,l=[],h=a.readUshort(r,i);i+=2;for(var d=0;d<h;d++){var u=a.readUshort(r,i);i+=2;var _=t._lctf.readLookupTable(r,c+u,s);l.push(_)}return l},t._lctf.readLookupTable=function(r,i,s){var a=t._bin,c=i,l={tabs:[]};l.ltype=a.readUshort(r,i),i+=2,l.flag=a.readUshort(r,i),i+=2;var h=a.readUshort(r,i);i+=2;for(var d=l.ltype,u=0;u<h;u++){var _=a.readUshort(r,i);i+=2;var p=s(r,d,c+_,l);l.tabs.push(p)}return l},t._lctf.numOfOnes=function(r){for(var i=0,s=0;s<32;s++)(r>>>s&1)!=0&&i++;return i},t._lctf.readClassDef=function(r,i){var s=t._bin,a=[],c=s.readUshort(r,i);if(i+=2,c==1){var l=s.readUshort(r,i);i+=2;var h=s.readUshort(r,i);i+=2;for(var d=0;d<h;d++)a.push(l+d),a.push(l+d),a.push(s.readUshort(r,i)),i+=2}if(c==2){var u=s.readUshort(r,i);i+=2;for(d=0;d<u;d++)a.push(s.readUshort(r,i)),i+=2,a.push(s.readUshort(r,i)),i+=2,a.push(s.readUshort(r,i)),i+=2}return a},t._lctf.getInterval=function(r,i){for(var s=0;s<r.length;s+=3){var a=r[s],c=r[s+1];if(r[s+2],a<=i&&i<=c)return s}return-1},t._lctf.readCoverage=function(r,i){var s=t._bin,a={};a.fmt=s.readUshort(r,i),i+=2;var c=s.readUshort(r,i);return i+=2,a.fmt==1&&(a.tab=s.readUshorts(r,i,c)),a.fmt==2&&(a.tab=s.readUshorts(r,i,3*c)),a},t._lctf.coverageIndex=function(r,i){var s=r.tab;if(r.fmt==1)return s.indexOf(i);if(r.fmt==2){var a=t._lctf.getInterval(s,i);if(a!=-1)return s[a+2]+(i-s[a])}return-1},t._lctf.readFeatureList=function(r,i){var s=t._bin,a=i,c=[],l=s.readUshort(r,i);i+=2;for(var h=0;h<l;h++){var d=s.readASCII(r,i,4);i+=4;var u=s.readUshort(r,i);i+=2;var _=t._lctf.readFeatureTable(r,a+u);_.tag=d.trim(),c.push(_)}return c},t._lctf.readFeatureTable=function(r,i){var s=t._bin,a=i,c={},l=s.readUshort(r,i);i+=2,l>0&&(c.featureParams=a+l);var h=s.readUshort(r,i);i+=2,c.tab=[];for(var d=0;d<h;d++)c.tab.push(s.readUshort(r,i+2*d));return c},t._lctf.readScriptList=function(r,i){var s=t._bin,a=i,c={},l=s.readUshort(r,i);i+=2;for(var h=0;h<l;h++){var d=s.readASCII(r,i,4);i+=4;var u=s.readUshort(r,i);i+=2,c[d.trim()]=t._lctf.readScriptTable(r,a+u)}return c},t._lctf.readScriptTable=function(r,i){var s=t._bin,a=i,c={},l=s.readUshort(r,i);i+=2,l>0&&(c.default=t._lctf.readLangSysTable(r,a+l));var h=s.readUshort(r,i);i+=2;for(var d=0;d<h;d++){var u=s.readASCII(r,i,4);i+=4;var _=s.readUshort(r,i);i+=2,c[u.trim()]=t._lctf.readLangSysTable(r,a+_)}return c},t._lctf.readLangSysTable=function(r,i){var s=t._bin,a={};s.readUshort(r,i),i+=2,a.reqFeature=s.readUshort(r,i),i+=2;var c=s.readUshort(r,i);return i+=2,a.features=s.readUshorts(r,i,c),a},t.CFF={},t.CFF.parse=function(r,i,s){var a=t._bin;(r=new Uint8Array(r.buffer,i,s))[i=0],r[++i],r[++i],r[++i],i++;var c=[];i=t.CFF.readIndex(r,i,c);for(var l=[],h=0;h<c.length-1;h++)l.push(a.readASCII(r,i+c[h],c[h+1]-c[h]));i+=c[c.length-1];var d=[];i=t.CFF.readIndex(r,i,d);var u=[];for(h=0;h<d.length-1;h++)u.push(t.CFF.readDict(r,i+d[h],i+d[h+1]));i+=d[d.length-1];var _=u[0],p=[];i=t.CFF.readIndex(r,i,p);var m=[];for(h=0;h<p.length-1;h++)m.push(a.readASCII(r,i+p[h],p[h+1]-p[h]));if(i+=p[p.length-1],t.CFF.readSubrs(r,i,_),_.CharStrings){i=_.CharStrings,p=[],i=t.CFF.readIndex(r,i,p);var A=[];for(h=0;h<p.length-1;h++)A.push(a.readBytes(r,i+p[h],p[h+1]-p[h]));_.CharStrings=A}if(_.ROS){i=_.FDArray;var g=[];i=t.CFF.readIndex(r,i,g),_.FDArray=[];for(h=0;h<g.length-1;h++){var f=t.CFF.readDict(r,i+g[h],i+g[h+1]);t.CFF._readFDict(r,f,m),_.FDArray.push(f)}i+=g[g.length-1],i=_.FDSelect,_.FDSelect=[];var y=r[i];if(i++,y!=3)throw y;var x=a.readUshort(r,i);i+=2;for(h=0;h<x+1;h++)_.FDSelect.push(a.readUshort(r,i),r[i+2]),i+=3}return _.Encoding&&(_.Encoding=t.CFF.readEncoding(r,_.Encoding,_.CharStrings.length)),_.charset&&(_.charset=t.CFF.readCharset(r,_.charset,_.CharStrings.length)),t.CFF._readFDict(r,_,m),_},t.CFF._readFDict=function(r,i,s){var a;for(var c in i.Private&&(a=i.Private[1],i.Private=t.CFF.readDict(r,a,a+i.Private[0]),i.Private.Subrs&&t.CFF.readSubrs(r,a+i.Private.Subrs,i.Private)),i)["FamilyName","FontName","FullName","Notice","version","Copyright"].indexOf(c)!=-1&&(i[c]=s[i[c]-426+35])},t.CFF.readSubrs=function(r,i,s){var a=t._bin,c=[];i=t.CFF.readIndex(r,i,c);var l,h=c.length;l=h<1240?107:h<33900?1131:32768,s.Bias=l,s.Subrs=[];for(var d=0;d<c.length-1;d++)s.Subrs.push(a.readBytes(r,i+c[d],c[d+1]-c[d]))},t.CFF.tableSE=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,0,111,112,113,114,0,115,116,117,118,119,120,121,122,0,123,0,124,125,126,127,128,129,130,131,0,132,133,0,134,135,136,137,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,138,0,139,0,0,0,0,140,141,142,143,0,0,0,0,0,144,0,0,0,145,0,0,146,147,148,149,0,0,0,0],t.CFF.glyphByUnicode=function(r,i){for(var s=0;s<r.charset.length;s++)if(r.charset[s]==i)return s;return-1},t.CFF.glyphBySE=function(r,i){return i<0||i>255?-1:t.CFF.glyphByUnicode(r,t.CFF.tableSE[i])},t.CFF.readEncoding=function(r,i,s){t._bin;var a=[".notdef"],c=r[i];if(i++,c!=0)throw"error: unknown encoding format: "+c;var l=r[i];i++;for(var h=0;h<l;h++)a.push(r[i+h]);return a},t.CFF.readCharset=function(r,i,s){var a=t._bin,c=[".notdef"],l=r[i];if(i++,l==0)for(var h=0;h<s;h++){var d=a.readUshort(r,i);i+=2,c.push(d)}else{if(l!=1&&l!=2)throw"error: format: "+l;for(;c.length<s;){d=a.readUshort(r,i),i+=2;var u=0;l==1?(u=r[i],i++):(u=a.readUshort(r,i),i+=2);for(h=0;h<=u;h++)c.push(d),d++}}return c},t.CFF.readIndex=function(r,i,s){var a=t._bin,c=a.readUshort(r,i)+1,l=r[i+=2];if(i++,l==1)for(var h=0;h<c;h++)s.push(r[i+h]);else if(l==2)for(h=0;h<c;h++)s.push(a.readUshort(r,i+2*h));else if(l==3)for(h=0;h<c;h++)s.push(16777215&a.readUint(r,i+3*h-1));else if(c!=1)throw"unsupported offset size: "+l+", count: "+c;return(i+=c*l)-1},t.CFF.getCharString=function(r,i,s){var a=t._bin,c=r[i],l=r[i+1];r[i+2],r[i+3],r[i+4];var h=1,d=null,u=null;c<=20&&(d=c,h=1),c==12&&(d=100*c+l,h=2),21<=c&&c<=27&&(d=c,h=1),c==28&&(u=a.readShort(r,i+1),h=3),29<=c&&c<=31&&(d=c,h=1),32<=c&&c<=246&&(u=c-139,h=1),247<=c&&c<=250&&(u=256*(c-247)+l+108,h=2),251<=c&&c<=254&&(u=256*-(c-251)-l-108,h=2),c==255&&(u=a.readInt(r,i+1)/65535,h=5),s.val=u!=null?u:"o"+d,s.size=h},t.CFF.readCharString=function(r,i,s){for(var a=i+s,c=t._bin,l=[];i<a;){var h=r[i],d=r[i+1];r[i+2],r[i+3],r[i+4];var u=1,_=null,p=null;h<=20&&(_=h,u=1),h==12&&(_=100*h+d,u=2),h!=19&&h!=20||(_=h,u=2),21<=h&&h<=27&&(_=h,u=1),h==28&&(p=c.readShort(r,i+1),u=3),29<=h&&h<=31&&(_=h,u=1),32<=h&&h<=246&&(p=h-139,u=1),247<=h&&h<=250&&(p=256*(h-247)+d+108,u=2),251<=h&&h<=254&&(p=256*-(h-251)-d-108,u=2),h==255&&(p=c.readInt(r,i+1)/65535,u=5),l.push(p!=null?p:"o"+_),i+=u}return l},t.CFF.readDict=function(r,i,s){for(var a=t._bin,c={},l=[];i<s;){var h=r[i],d=r[i+1];r[i+2],r[i+3],r[i+4];var u=1,_=null,p=null;if(h==28&&(p=a.readShort(r,i+1),u=3),h==29&&(p=a.readInt(r,i+1),u=5),32<=h&&h<=246&&(p=h-139,u=1),247<=h&&h<=250&&(p=256*(h-247)+d+108,u=2),251<=h&&h<=254&&(p=256*-(h-251)-d-108,u=2),h==255)throw p=a.readInt(r,i+1)/65535,u=5,"unknown number";if(h==30){var m=[];for(u=1;;){var A=r[i+u];u++;var g=A>>4,f=15&A;if(g!=15&&m.push(g),f!=15&&m.push(f),f==15)break}for(var y="",x=[0,1,2,3,4,5,6,7,8,9,".","e","e-","reserved","-","endOfNumber"],C=0;C<m.length;C++)y+=x[m[C]];p=parseFloat(y)}if(h<=21){if(_=["version","Notice","FullName","FamilyName","Weight","FontBBox","BlueValues","OtherBlues","FamilyBlues","FamilyOtherBlues","StdHW","StdVW","escape","UniqueID","XUID","charset","Encoding","CharStrings","Private","Subrs","defaultWidthX","nominalWidthX"][h],u=1,h==12)_=["Copyright","isFixedPitch","ItalicAngle","UnderlinePosition","UnderlineThickness","PaintType","CharstringType","FontMatrix","StrokeWidth","BlueScale","BlueShift","BlueFuzz","StemSnapH","StemSnapV","ForceBold",0,0,"LanguageGroup","ExpansionFactor","initialRandomSeed","SyntheticBase","PostScript","BaseFontName","BaseFontBlend",0,0,0,0,0,0,"ROS","CIDFontVersion","CIDFontRevision","CIDFontType","CIDCount","UIDBase","FDArray","FDSelect","FontName"][d],u=2}_!=null?(c[_]=l.length==1?l[0]:l,l=[]):l.push(p),i+=u}return c},t.cmap={},t.cmap.parse=function(r,i,s){r=new Uint8Array(r.buffer,i,s),i=0;var a=t._bin,c={};a.readUshort(r,i),i+=2;var l=a.readUshort(r,i);i+=2;var h=[];c.tables=[];for(var d=0;d<l;d++){var u=a.readUshort(r,i);i+=2;var _=a.readUshort(r,i);i+=2;var p=a.readUint(r,i);i+=4;var m="p"+u+"e"+_,A=h.indexOf(p);if(A==-1){var g;A=c.tables.length,h.push(p);var f=a.readUshort(r,p);f==0?g=t.cmap.parse0(r,p):f==4?g=t.cmap.parse4(r,p):f==6?g=t.cmap.parse6(r,p):f==12?g=t.cmap.parse12(r,p):console.debug("unknown format: "+f,u,_,p),c.tables.push(g)}if(c[m]!=null)throw"multiple tables for one platform+encoding";c[m]=A}return c},t.cmap.parse0=function(r,i){var s=t._bin,a={};a.format=s.readUshort(r,i),i+=2;var c=s.readUshort(r,i);i+=2,s.readUshort(r,i),i+=2,a.map=[];for(var l=0;l<c-6;l++)a.map.push(r[i+l]);return a},t.cmap.parse4=function(r,i){var s=t._bin,a=i,c={};c.format=s.readUshort(r,i),i+=2;var l=s.readUshort(r,i);i+=2,s.readUshort(r,i),i+=2;var h=s.readUshort(r,i);i+=2;var d=h/2;c.searchRange=s.readUshort(r,i),i+=2,c.entrySelector=s.readUshort(r,i),i+=2,c.rangeShift=s.readUshort(r,i),i+=2,c.endCount=s.readUshorts(r,i,d),i+=2*d,i+=2,c.startCount=s.readUshorts(r,i,d),i+=2*d,c.idDelta=[];for(var u=0;u<d;u++)c.idDelta.push(s.readShort(r,i)),i+=2;for(c.idRangeOffset=s.readUshorts(r,i,d),i+=2*d,c.glyphIdArray=[];i<a+l;)c.glyphIdArray.push(s.readUshort(r,i)),i+=2;return c},t.cmap.parse6=function(r,i){var s=t._bin,a={};a.format=s.readUshort(r,i),i+=2,s.readUshort(r,i),i+=2,s.readUshort(r,i),i+=2,a.firstCode=s.readUshort(r,i),i+=2;var c=s.readUshort(r,i);i+=2,a.glyphIdArray=[];for(var l=0;l<c;l++)a.glyphIdArray.push(s.readUshort(r,i)),i+=2;return a},t.cmap.parse12=function(r,i){var s=t._bin,a={};a.format=s.readUshort(r,i),i+=2,i+=2,s.readUint(r,i),i+=4,s.readUint(r,i),i+=4;var c=s.readUint(r,i);i+=4,a.groups=[];for(var l=0;l<c;l++){var h=i+12*l,d=s.readUint(r,h+0),u=s.readUint(r,h+4),_=s.readUint(r,h+8);a.groups.push([d,u,_])}return a},t.glyf={},t.glyf.parse=function(r,i,s,a){for(var c=[],l=0;l<a.maxp.numGlyphs;l++)c.push(null);return c},t.glyf._parseGlyf=function(r,i){var s=t._bin,a=r._data,c=t._tabOffset(a,"glyf",r._offset)+r.loca[i];if(r.loca[i]==r.loca[i+1])return null;var l={};if(l.noc=s.readShort(a,c),c+=2,l.xMin=s.readShort(a,c),c+=2,l.yMin=s.readShort(a,c),c+=2,l.xMax=s.readShort(a,c),c+=2,l.yMax=s.readShort(a,c),c+=2,l.xMin>=l.xMax||l.yMin>=l.yMax)return null;if(l.noc>0){l.endPts=[];for(var h=0;h<l.noc;h++)l.endPts.push(s.readUshort(a,c)),c+=2;var d=s.readUshort(a,c);if(c+=2,a.length-c<d)return null;l.instructions=s.readBytes(a,c,d),c+=d;var u=l.endPts[l.noc-1]+1;l.flags=[];for(h=0;h<u;h++){var _=a[c];if(c++,l.flags.push(_),(8&_)!=0){var p=a[c];c++;for(var m=0;m<p;m++)l.flags.push(_),h++}}l.xs=[];for(h=0;h<u;h++){var A=(2&l.flags[h])!=0,g=(16&l.flags[h])!=0;A?(l.xs.push(g?a[c]:-a[c]),c++):g?l.xs.push(0):(l.xs.push(s.readShort(a,c)),c+=2)}l.ys=[];for(h=0;h<u;h++)A=(4&l.flags[h])!=0,g=(32&l.flags[h])!=0,A?(l.ys.push(g?a[c]:-a[c]),c++):g?l.ys.push(0):(l.ys.push(s.readShort(a,c)),c+=2);var f=0,y=0;for(h=0;h<u;h++)f+=l.xs[h],y+=l.ys[h],l.xs[h]=f,l.ys[h]=y}else{var x;l.parts=[];do{x=s.readUshort(a,c),c+=2;var C={m:{a:1,b:0,c:0,d:1,tx:0,ty:0},p1:-1,p2:-1};if(l.parts.push(C),C.glyphIndex=s.readUshort(a,c),c+=2,1&x){var b=s.readShort(a,c);c+=2;var I=s.readShort(a,c);c+=2}else b=s.readInt8(a,c),c++,I=s.readInt8(a,c),c++;2&x?(C.m.tx=b,C.m.ty=I):(C.p1=b,C.p2=I),8&x?(C.m.a=C.m.d=s.readF2dot14(a,c),c+=2):64&x?(C.m.a=s.readF2dot14(a,c),c+=2,C.m.d=s.readF2dot14(a,c),c+=2):128&x&&(C.m.a=s.readF2dot14(a,c),c+=2,C.m.b=s.readF2dot14(a,c),c+=2,C.m.c=s.readF2dot14(a,c),c+=2,C.m.d=s.readF2dot14(a,c),c+=2)}while(32&x);if(256&x){var v=s.readUshort(a,c);c+=2,l.instr=[];for(h=0;h<v;h++)l.instr.push(a[c]),c++}}return l},t.GDEF={},t.GDEF.parse=function(r,i,s,a){var c=i;i+=4;var l=t._bin.readUshort(r,i);return{glyphClassDef:l===0?null:t._lctf.readClassDef(r,c+l)}},t.GPOS={},t.GPOS.parse=function(r,i,s,a){return t._lctf.parse(r,i,s,a,t.GPOS.subt)},t.GPOS.subt=function(r,i,s,a){var c=t._bin,l=s,h={};if(h.fmt=c.readUshort(r,s),s+=2,i==1||i==2||i==3||i==7||i==8&&h.fmt<=2){var d=c.readUshort(r,s);s+=2,h.coverage=t._lctf.readCoverage(r,d+l)}if(i==1&&h.fmt==1){var u=c.readUshort(r,s);s+=2,u!=0&&(h.pos=t.GPOS.readValueRecord(r,s,u))}else if(i==2&&h.fmt>=1&&h.fmt<=2){u=c.readUshort(r,s),s+=2;var _=c.readUshort(r,s);s+=2;var p=t._lctf.numOfOnes(u),m=t._lctf.numOfOnes(_);if(h.fmt==1){h.pairsets=[];var A=c.readUshort(r,s);s+=2;for(var g=0;g<A;g++){var f=l+c.readUshort(r,s);s+=2;var y=c.readUshort(r,f);f+=2;for(var x=[],C=0;C<y;C++){var b=c.readUshort(r,f);f+=2,u!=0&&(T=t.GPOS.readValueRecord(r,f,u),f+=2*p),_!=0&&(N=t.GPOS.readValueRecord(r,f,_),f+=2*m),x.push({gid2:b,val1:T,val2:N})}h.pairsets.push(x)}}if(h.fmt==2){var I=c.readUshort(r,s);s+=2;var v=c.readUshort(r,s);s+=2;var P=c.readUshort(r,s);s+=2;var M=c.readUshort(r,s);s+=2,h.classDef1=t._lctf.readClassDef(r,l+I),h.classDef2=t._lctf.readClassDef(r,l+v),h.matrix=[];for(g=0;g<P;g++){var B=[];for(C=0;C<M;C++){var T=null,N=null;u!=0&&(T=t.GPOS.readValueRecord(r,s,u),s+=2*p),_!=0&&(N=t.GPOS.readValueRecord(r,s,_),s+=2*m),B.push({val1:T,val2:N})}h.matrix.push(B)}}}else if(i==4&&h.fmt==1)h.markCoverage=t._lctf.readCoverage(r,c.readUshort(r,s)+l),h.baseCoverage=t._lctf.readCoverage(r,c.readUshort(r,s+2)+l),h.markClassCount=c.readUshort(r,s+4),h.markArray=t.GPOS.readMarkArray(r,c.readUshort(r,s+6)+l),h.baseArray=t.GPOS.readBaseArray(r,c.readUshort(r,s+8)+l,h.markClassCount);else if(i==6&&h.fmt==1)h.mark1Coverage=t._lctf.readCoverage(r,c.readUshort(r,s)+l),h.mark2Coverage=t._lctf.readCoverage(r,c.readUshort(r,s+2)+l),h.markClassCount=c.readUshort(r,s+4),h.mark1Array=t.GPOS.readMarkArray(r,c.readUshort(r,s+6)+l),h.mark2Array=t.GPOS.readBaseArray(r,c.readUshort(r,s+8)+l,h.markClassCount);else{if(i==9&&h.fmt==1){var D=c.readUshort(r,s);s+=2;var L=c.readUint(r,s);if(s+=4,a.ltype==9)a.ltype=D;else if(a.ltype!=D)throw"invalid extension substitution";return t.GPOS.subt(r,a.ltype,l+L)}console.debug("unsupported GPOS table LookupType",i,"format",h.fmt)}return h},t.GPOS.readValueRecord=function(r,i,s){var a=t._bin,c=[];return c.push(1&s?a.readShort(r,i):0),i+=1&s?2:0,c.push(2&s?a.readShort(r,i):0),i+=2&s?2:0,c.push(4&s?a.readShort(r,i):0),i+=4&s?2:0,c.push(8&s?a.readShort(r,i):0),i+=8&s?2:0,c},t.GPOS.readBaseArray=function(r,i,s){var a=t._bin,c=[],l=i,h=a.readUshort(r,i);i+=2;for(var d=0;d<h;d++){for(var u=[],_=0;_<s;_++)u.push(t.GPOS.readAnchorRecord(r,l+a.readUshort(r,i))),i+=2;c.push(u)}return c},t.GPOS.readMarkArray=function(r,i){var s=t._bin,a=[],c=i,l=s.readUshort(r,i);i+=2;for(var h=0;h<l;h++){var d=t.GPOS.readAnchorRecord(r,s.readUshort(r,i+2)+c);d.markClass=s.readUshort(r,i),a.push(d),i+=4}return a},t.GPOS.readAnchorRecord=function(r,i){var s=t._bin,a={};return a.fmt=s.readUshort(r,i),a.x=s.readShort(r,i+2),a.y=s.readShort(r,i+4),a},t.GSUB={},t.GSUB.parse=function(r,i,s,a){return t._lctf.parse(r,i,s,a,t.GSUB.subt)},t.GSUB.subt=function(r,i,s,a){var c=t._bin,l=s,h={};if(h.fmt=c.readUshort(r,s),s+=2,i!=1&&i!=2&&i!=4&&i!=5&&i!=6)return null;if(i==1||i==2||i==4||i==5&&h.fmt<=2||i==6&&h.fmt<=2){var d=c.readUshort(r,s);s+=2,h.coverage=t._lctf.readCoverage(r,l+d)}if(i==1&&h.fmt>=1&&h.fmt<=2){if(h.fmt==1)h.delta=c.readShort(r,s),s+=2;else if(h.fmt==2){var u=c.readUshort(r,s);s+=2,h.newg=c.readUshorts(r,s,u),s+=2*h.newg.length}}else if(i==2&&h.fmt==1){u=c.readUshort(r,s),s+=2,h.seqs=[];for(var _=0;_<u;_++){var p=c.readUshort(r,s)+l;s+=2;var m=c.readUshort(r,p);h.seqs.push(c.readUshorts(r,p+2,m))}}else if(i==4){h.vals=[],u=c.readUshort(r,s),s+=2;for(_=0;_<u;_++){var A=c.readUshort(r,s);s+=2,h.vals.push(t.GSUB.readLigatureSet(r,l+A))}}else if(i==5&&h.fmt==2){if(h.fmt==2){var g=c.readUshort(r,s);s+=2,h.cDef=t._lctf.readClassDef(r,l+g),h.scset=[];var f=c.readUshort(r,s);s+=2;for(_=0;_<f;_++){var y=c.readUshort(r,s);s+=2,h.scset.push(y==0?null:t.GSUB.readSubClassSet(r,l+y))}}}else if(i==6&&h.fmt==3){if(h.fmt==3){for(_=0;_<3;_++){u=c.readUshort(r,s),s+=2;for(var x=[],C=0;C<u;C++)x.push(t._lctf.readCoverage(r,l+c.readUshort(r,s+2*C)));s+=2*u,_==0&&(h.backCvg=x),_==1&&(h.inptCvg=x),_==2&&(h.ahedCvg=x)}u=c.readUshort(r,s),s+=2,h.lookupRec=t.GSUB.readSubstLookupRecords(r,s,u)}}else{if(i==7&&h.fmt==1){var b=c.readUshort(r,s);s+=2;var I=c.readUint(r,s);if(s+=4,a.ltype==9)a.ltype=b;else if(a.ltype!=b)throw"invalid extension substitution";return t.GSUB.subt(r,a.ltype,l+I)}console.debug("unsupported GSUB table LookupType",i,"format",h.fmt)}return h},t.GSUB.readSubClassSet=function(r,i){var s=t._bin.readUshort,a=i,c=[],l=s(r,i);i+=2;for(var h=0;h<l;h++){var d=s(r,i);i+=2,c.push(t.GSUB.readSubClassRule(r,a+d))}return c},t.GSUB.readSubClassRule=function(r,i){var s=t._bin.readUshort,a={},c=s(r,i),l=s(r,i+=2);i+=2,a.input=[];for(var h=0;h<c-1;h++)a.input.push(s(r,i)),i+=2;return a.substLookupRecords=t.GSUB.readSubstLookupRecords(r,i,l),a},t.GSUB.readSubstLookupRecords=function(r,i,s){for(var a=t._bin.readUshort,c=[],l=0;l<s;l++)c.push(a(r,i),a(r,i+2)),i+=4;return c},t.GSUB.readChainSubClassSet=function(r,i){var s=t._bin,a=i,c=[],l=s.readUshort(r,i);i+=2;for(var h=0;h<l;h++){var d=s.readUshort(r,i);i+=2,c.push(t.GSUB.readChainSubClassRule(r,a+d))}return c},t.GSUB.readChainSubClassRule=function(r,i){for(var s=t._bin,a={},c=["backtrack","input","lookahead"],l=0;l<c.length;l++){var h=s.readUshort(r,i);i+=2,l==1&&h--,a[c[l]]=s.readUshorts(r,i,h),i+=2*a[c[l]].length}return h=s.readUshort(r,i),i+=2,a.subst=s.readUshorts(r,i,2*h),i+=2*a.subst.length,a},t.GSUB.readLigatureSet=function(r,i){var s=t._bin,a=i,c=[],l=s.readUshort(r,i);i+=2;for(var h=0;h<l;h++){var d=s.readUshort(r,i);i+=2,c.push(t.GSUB.readLigature(r,a+d))}return c},t.GSUB.readLigature=function(r,i){var s=t._bin,a={chain:[]};a.nglyph=s.readUshort(r,i),i+=2;var c=s.readUshort(r,i);i+=2;for(var l=0;l<c-1;l++)a.chain.push(s.readUshort(r,i)),i+=2;return a},t.head={},t.head.parse=function(r,i,s){var a=t._bin,c={};return a.readFixed(r,i),i+=4,c.fontRevision=a.readFixed(r,i),i+=4,a.readUint(r,i),i+=4,a.readUint(r,i),i+=4,c.flags=a.readUshort(r,i),i+=2,c.unitsPerEm=a.readUshort(r,i),i+=2,c.created=a.readUint64(r,i),i+=8,c.modified=a.readUint64(r,i),i+=8,c.xMin=a.readShort(r,i),i+=2,c.yMin=a.readShort(r,i),i+=2,c.xMax=a.readShort(r,i),i+=2,c.yMax=a.readShort(r,i),i+=2,c.macStyle=a.readUshort(r,i),i+=2,c.lowestRecPPEM=a.readUshort(r,i),i+=2,c.fontDirectionHint=a.readShort(r,i),i+=2,c.indexToLocFormat=a.readShort(r,i),i+=2,c.glyphDataFormat=a.readShort(r,i),i+=2,c},t.hhea={},t.hhea.parse=function(r,i,s){var a=t._bin,c={};return a.readFixed(r,i),i+=4,c.ascender=a.readShort(r,i),i+=2,c.descender=a.readShort(r,i),i+=2,c.lineGap=a.readShort(r,i),i+=2,c.advanceWidthMax=a.readUshort(r,i),i+=2,c.minLeftSideBearing=a.readShort(r,i),i+=2,c.minRightSideBearing=a.readShort(r,i),i+=2,c.xMaxExtent=a.readShort(r,i),i+=2,c.caretSlopeRise=a.readShort(r,i),i+=2,c.caretSlopeRun=a.readShort(r,i),i+=2,c.caretOffset=a.readShort(r,i),i+=2,i+=8,c.metricDataFormat=a.readShort(r,i),i+=2,c.numberOfHMetrics=a.readUshort(r,i),i+=2,c},t.hmtx={},t.hmtx.parse=function(r,i,s,a){for(var c=t._bin,l={aWidth:[],lsBearing:[]},h=0,d=0,u=0;u<a.maxp.numGlyphs;u++)u<a.hhea.numberOfHMetrics&&(h=c.readUshort(r,i),i+=2,d=c.readShort(r,i),i+=2),l.aWidth.push(h),l.lsBearing.push(d);return l},t.kern={},t.kern.parse=function(r,i,s,a){var c=t._bin,l=c.readUshort(r,i);if(i+=2,l==1)return t.kern.parseV1(r,i-2,s,a);var h=c.readUshort(r,i);i+=2;for(var d={glyph1:[],rval:[]},u=0;u<h;u++){i+=2,s=c.readUshort(r,i),i+=2;var _=c.readUshort(r,i);i+=2;var p=_>>>8;if((p&=15)!=0)throw"unknown kern table format: "+p;i=t.kern.readFormat0(r,i,d)}return d},t.kern.parseV1=function(r,i,s,a){var c=t._bin;c.readFixed(r,i),i+=4;var l=c.readUint(r,i);i+=4;for(var h={glyph1:[],rval:[]},d=0;d<l;d++){c.readUint(r,i),i+=4;var u=c.readUshort(r,i);i+=2,c.readUshort(r,i),i+=2;var _=u>>>8;if((_&=15)!=0)throw"unknown kern table format: "+_;i=t.kern.readFormat0(r,i,h)}return h},t.kern.readFormat0=function(r,i,s){var a=t._bin,c=-1,l=a.readUshort(r,i);i+=2,a.readUshort(r,i),i+=2,a.readUshort(r,i),i+=2,a.readUshort(r,i),i+=2;for(var h=0;h<l;h++){var d=a.readUshort(r,i);i+=2;var u=a.readUshort(r,i);i+=2;var _=a.readShort(r,i);i+=2,d!=c&&(s.glyph1.push(d),s.rval.push({glyph2:[],vals:[]}));var p=s.rval[s.rval.length-1];p.glyph2.push(u),p.vals.push(_),c=d}return i},t.loca={},t.loca.parse=function(r,i,s,a){var c=t._bin,l=[],h=a.head.indexToLocFormat,d=a.maxp.numGlyphs+1;if(h==0)for(var u=0;u<d;u++)l.push(c.readUshort(r,i+(u<<1))<<1);if(h==1)for(u=0;u<d;u++)l.push(c.readUint(r,i+(u<<2)));return l},t.maxp={},t.maxp.parse=function(r,i,s){var a=t._bin,c={},l=a.readUint(r,i);return i+=4,c.numGlyphs=a.readUshort(r,i),i+=2,l==65536&&(c.maxPoints=a.readUshort(r,i),i+=2,c.maxContours=a.readUshort(r,i),i+=2,c.maxCompositePoints=a.readUshort(r,i),i+=2,c.maxCompositeContours=a.readUshort(r,i),i+=2,c.maxZones=a.readUshort(r,i),i+=2,c.maxTwilightPoints=a.readUshort(r,i),i+=2,c.maxStorage=a.readUshort(r,i),i+=2,c.maxFunctionDefs=a.readUshort(r,i),i+=2,c.maxInstructionDefs=a.readUshort(r,i),i+=2,c.maxStackElements=a.readUshort(r,i),i+=2,c.maxSizeOfInstructions=a.readUshort(r,i),i+=2,c.maxComponentElements=a.readUshort(r,i),i+=2,c.maxComponentDepth=a.readUshort(r,i),i+=2),c},t.name={},t.name.parse=function(r,i,s){var a=t._bin,c={};a.readUshort(r,i),i+=2;var l=a.readUshort(r,i);i+=2,a.readUshort(r,i);for(var h,d=["copyright","fontFamily","fontSubfamily","ID","fullName","version","postScriptName","trademark","manufacturer","designer","description","urlVendor","urlDesigner","licence","licenceURL","---","typoFamilyName","typoSubfamilyName","compatibleFull","sampleText","postScriptCID","wwsFamilyName","wwsSubfamilyName","lightPalette","darkPalette"],u=i+=2,_=0;_<l;_++){var p=a.readUshort(r,i);i+=2;var m=a.readUshort(r,i);i+=2;var A=a.readUshort(r,i);i+=2;var g=a.readUshort(r,i);i+=2;var f=a.readUshort(r,i);i+=2;var y=a.readUshort(r,i);i+=2;var x,C=d[g],b=u+12*l+y;if(p==0)x=a.readUnicode(r,b,f/2);else if(p==3&&m==0)x=a.readUnicode(r,b,f/2);else if(m==0)x=a.readASCII(r,b,f);else if(m==1)x=a.readUnicode(r,b,f/2);else if(m==3)x=a.readUnicode(r,b,f/2);else{if(p!=1)throw"unknown encoding "+m+", platformID: "+p;x=a.readASCII(r,b,f),console.debug("reading unknown MAC encoding "+m+" as ASCII")}var I="p"+p+","+A.toString(16);c[I]==null&&(c[I]={}),c[I][C!==void 0?C:g]=x,c[I]._lang=A}for(var v in c)if(c[v].postScriptName!=null&&c[v]._lang==1033)return c[v];for(var v in c)if(c[v].postScriptName!=null&&c[v]._lang==0)return c[v];for(var v in c)if(c[v].postScriptName!=null&&c[v]._lang==3084)return c[v];for(var v in c)if(c[v].postScriptName!=null)return c[v];for(var v in c){h=v;break}return console.debug("returning name table with languageID "+c[h]._lang),c[h]},t["OS/2"]={},t["OS/2"].parse=function(r,i,s){var a=t._bin.readUshort(r,i);i+=2;var c={};if(a==0)t["OS/2"].version0(r,i,c);else if(a==1)t["OS/2"].version1(r,i,c);else if(a==2||a==3||a==4)t["OS/2"].version2(r,i,c);else{if(a!=5)throw"unknown OS/2 table version: "+a;t["OS/2"].version5(r,i,c)}return c},t["OS/2"].version0=function(r,i,s){var a=t._bin;return s.xAvgCharWidth=a.readShort(r,i),i+=2,s.usWeightClass=a.readUshort(r,i),i+=2,s.usWidthClass=a.readUshort(r,i),i+=2,s.fsType=a.readUshort(r,i),i+=2,s.ySubscriptXSize=a.readShort(r,i),i+=2,s.ySubscriptYSize=a.readShort(r,i),i+=2,s.ySubscriptXOffset=a.readShort(r,i),i+=2,s.ySubscriptYOffset=a.readShort(r,i),i+=2,s.ySuperscriptXSize=a.readShort(r,i),i+=2,s.ySuperscriptYSize=a.readShort(r,i),i+=2,s.ySuperscriptXOffset=a.readShort(r,i),i+=2,s.ySuperscriptYOffset=a.readShort(r,i),i+=2,s.yStrikeoutSize=a.readShort(r,i),i+=2,s.yStrikeoutPosition=a.readShort(r,i),i+=2,s.sFamilyClass=a.readShort(r,i),i+=2,s.panose=a.readBytes(r,i,10),i+=10,s.ulUnicodeRange1=a.readUint(r,i),i+=4,s.ulUnicodeRange2=a.readUint(r,i),i+=4,s.ulUnicodeRange3=a.readUint(r,i),i+=4,s.ulUnicodeRange4=a.readUint(r,i),i+=4,s.achVendID=[a.readInt8(r,i),a.readInt8(r,i+1),a.readInt8(r,i+2),a.readInt8(r,i+3)],i+=4,s.fsSelection=a.readUshort(r,i),i+=2,s.usFirstCharIndex=a.readUshort(r,i),i+=2,s.usLastCharIndex=a.readUshort(r,i),i+=2,s.sTypoAscender=a.readShort(r,i),i+=2,s.sTypoDescender=a.readShort(r,i),i+=2,s.sTypoLineGap=a.readShort(r,i),i+=2,s.usWinAscent=a.readUshort(r,i),i+=2,s.usWinDescent=a.readUshort(r,i),i+=2},t["OS/2"].version1=function(r,i,s){var a=t._bin;return i=t["OS/2"].version0(r,i,s),s.ulCodePageRange1=a.readUint(r,i),i+=4,s.ulCodePageRange2=a.readUint(r,i),i+=4},t["OS/2"].version2=function(r,i,s){var a=t._bin;return i=t["OS/2"].version1(r,i,s),s.sxHeight=a.readShort(r,i),i+=2,s.sCapHeight=a.readShort(r,i),i+=2,s.usDefault=a.readUshort(r,i),i+=2,s.usBreak=a.readUshort(r,i),i+=2,s.usMaxContext=a.readUshort(r,i),i+=2},t["OS/2"].version5=function(r,i,s){var a=t._bin;return i=t["OS/2"].version2(r,i,s),s.usLowerOpticalPointSize=a.readUshort(r,i),i+=2,s.usUpperOpticalPointSize=a.readUshort(r,i),i+=2},t.post={},t.post.parse=function(r,i,s){var a=t._bin,c={};return c.version=a.readFixed(r,i),i+=4,c.italicAngle=a.readFixed(r,i),i+=4,c.underlinePosition=a.readShort(r,i),i+=2,c.underlineThickness=a.readShort(r,i),i+=2,c},t==null&&(t={}),t.U==null&&(t.U={}),t.U.codeToGlyph=function(r,i){var s=r.cmap,a=-1;if(s.p0e4!=null?a=s.p0e4:s.p3e1!=null?a=s.p3e1:s.p1e0!=null?a=s.p1e0:s.p0e3!=null&&(a=s.p0e3),a==-1)throw"no familiar platform and encoding!";var c=s.tables[a];if(c.format==0)return i>=c.map.length?0:c.map[i];if(c.format==4){for(var l=-1,h=0;h<c.endCount.length;h++)if(i<=c.endCount[h]){l=h;break}if(l==-1)return 0;if(c.startCount[l]>i)return 0;return 65535&(c.idRangeOffset[l]!=0?c.glyphIdArray[i-c.startCount[l]+(c.idRangeOffset[l]>>1)-(c.idRangeOffset.length-l)]:i+c.idDelta[l])}if(c.format==12){if(i>c.groups[c.groups.length-1][1])return 0;for(h=0;h<c.groups.length;h++){var d=c.groups[h];if(d[0]<=i&&i<=d[1])return d[2]+(i-d[0])}return 0}throw"unknown cmap table format "+c.format},t.U.glyphToPath=function(r,i){var s={cmds:[],crds:[]};if(r.SVG&&r.SVG.entries[i]){var a=r.SVG.entries[i];return a==null?s:(typeof a=="string"&&(a=t.SVG.toPath(a),r.SVG.entries[i]=a),a)}if(r.CFF){var c={x:0,y:0,stack:[],nStems:0,haveWidth:!1,width:r.CFF.Private?r.CFF.Private.defaultWidthX:0,open:!1},l=r.CFF,h=r.CFF.Private;if(l.ROS){for(var d=0;l.FDSelect[d+2]<=i;)d+=2;h=l.FDArray[l.FDSelect[d+1]].Private}t.U._drawCFF(r.CFF.CharStrings[i],c,l,h,s)}else r.glyf&&t.U._drawGlyf(i,r,s);return s},t.U._drawGlyf=function(r,i,s){var a=i.glyf[r];a==null&&(a=i.glyf[r]=t.glyf._parseGlyf(i,r)),a!=null&&(a.noc>-1?t.U._simpleGlyph(a,s):t.U._compoGlyph(a,i,s))},t.U._simpleGlyph=function(r,i){for(var s=0;s<r.noc;s++){for(var a=s==0?0:r.endPts[s-1]+1,c=r.endPts[s],l=a;l<=c;l++){var h=l==a?c:l-1,d=l==c?a:l+1,u=1&r.flags[l],_=1&r.flags[h],p=1&r.flags[d],m=r.xs[l],A=r.ys[l];if(l==a)if(u){if(!_){t.U.P.moveTo(i,m,A);continue}t.U.P.moveTo(i,r.xs[h],r.ys[h])}else _?t.U.P.moveTo(i,r.xs[h],r.ys[h]):t.U.P.moveTo(i,(r.xs[h]+m)/2,(r.ys[h]+A)/2);u?_&&t.U.P.lineTo(i,m,A):p?t.U.P.qcurveTo(i,m,A,r.xs[d],r.ys[d]):t.U.P.qcurveTo(i,m,A,(m+r.xs[d])/2,(A+r.ys[d])/2)}t.U.P.closePath(i)}},t.U._compoGlyph=function(r,i,s){for(var a=0;a<r.parts.length;a++){var c={cmds:[],crds:[]},l=r.parts[a];t.U._drawGlyf(l.glyphIndex,i,c);for(var h=l.m,d=0;d<c.crds.length;d+=2){var u=c.crds[d],_=c.crds[d+1];s.crds.push(u*h.a+_*h.b+h.tx),s.crds.push(u*h.c+_*h.d+h.ty)}for(d=0;d<c.cmds.length;d++)s.cmds.push(c.cmds[d])}},t.U._getGlyphClass=function(r,i){var s=t._lctf.getInterval(i,r);return s==-1?0:i[s+2]},t.U._applySubs=function(r,i,s,a){for(var c=r.length-i-1,l=0;l<s.tabs.length;l++)if(s.tabs[l]!=null){var h,d=s.tabs[l];if(!d.coverage||(h=t._lctf.coverageIndex(d.coverage,r[i]))!=-1){if(s.ltype==1)r[i],d.fmt==1?r[i]=r[i]+d.delta:r[i]=d.newg[h];else if(s.ltype==4)for(var u=d.vals[h],_=0;_<u.length;_++){var p=u[_],m=p.chain.length;if(!(m>c)){for(var A=!0,g=0,f=0;f<m;f++){for(;r[i+g+(1+f)]==-1;)g++;p.chain[f]!=r[i+g+(1+f)]&&(A=!1)}if(A){r[i]=p.nglyph;for(f=0;f<m+g;f++)r[i+f+1]=-1;break}}}else if(s.ltype==5&&d.fmt==2)for(var y=t._lctf.getInterval(d.cDef,r[i]),x=d.cDef[y+2],C=d.scset[x],b=0;b<C.length;b++){var I=C[b],v=I.input;if(!(v.length>c)){for(A=!0,f=0;f<v.length;f++){var P=t._lctf.getInterval(d.cDef,r[i+1+f]);if(y==-1&&d.cDef[P+2]!=v[f]){A=!1;break}}if(A){var M=I.substLookupRecords;for(_=0;_<M.length;_+=2)M[_],M[_+1]}}}else if(s.ltype==6&&d.fmt==3){if(!t.U._glsCovered(r,d.backCvg,i-d.backCvg.length))continue;if(!t.U._glsCovered(r,d.inptCvg,i))continue;if(!t.U._glsCovered(r,d.ahedCvg,i+d.inptCvg.length))continue;var B=d.lookupRec;for(b=0;b<B.length;b+=2){y=B[b];var T=a[B[b+1]];t.U._applySubs(r,i+y,T,a)}}}}},t.U._glsCovered=function(r,i,s){for(var a=0;a<i.length;a++)if(t._lctf.coverageIndex(i[a],r[s+a])==-1)return!1;return!0},t.U.glyphsToPath=function(r,i,s){for(var a={cmds:[],crds:[]},c=0,l=0;l<i.length;l++){var h=i[l];if(h!=-1){for(var d=l<i.length-1&&i[l+1]!=-1?i[l+1]:0,u=t.U.glyphToPath(r,h),_=0;_<u.crds.length;_+=2)a.crds.push(u.crds[_]+c),a.crds.push(u.crds[_+1]);s&&a.cmds.push(s);for(_=0;_<u.cmds.length;_++)a.cmds.push(u.cmds[_]);s&&a.cmds.push("X"),c+=r.hmtx.aWidth[h],l<i.length-1&&(c+=t.U.getPairAdjustment(r,h,d))}}return a},t.U.P={},t.U.P.moveTo=function(r,i,s){r.cmds.push("M"),r.crds.push(i,s)},t.U.P.lineTo=function(r,i,s){r.cmds.push("L"),r.crds.push(i,s)},t.U.P.curveTo=function(r,i,s,a,c,l,h){r.cmds.push("C"),r.crds.push(i,s,a,c,l,h)},t.U.P.qcurveTo=function(r,i,s,a,c){r.cmds.push("Q"),r.crds.push(i,s,a,c)},t.U.P.closePath=function(r){r.cmds.push("Z")},t.U._drawCFF=function(r,i,s,a,c){for(var{stack:l,nStems:h,haveWidth:d,width:u,open:_}=i,p=0,{x:m,y:A}=i,g=0,f=0,y=0,x=0,C=0,b=0,I=0,v=0,P=0,M=0,B={val:0,size:0};p<r.length;){t.CFF.getCharString(r,p,B);var T=B.val;if(p+=B.size,T=="o1"||T=="o18")l.length%2!=0&&!d&&(u=l.shift()+a.nominalWidthX),h+=l.length>>1,l.length=0,d=!0;else if(T=="o3"||T=="o23")l.length%2!=0&&!d&&(u=l.shift()+a.nominalWidthX),h+=l.length>>1,l.length=0,d=!0;else if(T=="o4")l.length>1&&!d&&(u=l.shift()+a.nominalWidthX,d=!0),_&&t.U.P.closePath(c),A+=l.pop(),t.U.P.moveTo(c,m,A),_=!0;else if(T=="o5")for(;l.length>0;)m+=l.shift(),A+=l.shift(),t.U.P.lineTo(c,m,A);else if(T=="o6"||T=="o7")for(var N=l.length,D=T=="o6",L=0;L<N;L++){var H=l.shift();D?m+=H:A+=H,D=!D,t.U.P.lineTo(c,m,A)}else if(T=="o8"||T=="o24"){N=l.length;for(var V=0;V+6<=N;)g=m+l.shift(),f=A+l.shift(),y=g+l.shift(),x=f+l.shift(),m=y+l.shift(),A=x+l.shift(),t.U.P.curveTo(c,g,f,y,x,m,A),V+=6;T=="o24"&&(m+=l.shift(),A+=l.shift(),t.U.P.lineTo(c,m,A))}else{if(T=="o11")break;if(T=="o1234"||T=="o1235"||T=="o1236"||T=="o1237")T=="o1234"&&(f=A,y=(g=m+l.shift())+l.shift(),M=x=f+l.shift(),b=x,v=A,m=(I=(C=(P=y+l.shift())+l.shift())+l.shift())+l.shift(),t.U.P.curveTo(c,g,f,y,x,P,M),t.U.P.curveTo(c,C,b,I,v,m,A)),T=="o1235"&&(g=m+l.shift(),f=A+l.shift(),y=g+l.shift(),x=f+l.shift(),P=y+l.shift(),M=x+l.shift(),C=P+l.shift(),b=M+l.shift(),I=C+l.shift(),v=b+l.shift(),m=I+l.shift(),A=v+l.shift(),l.shift(),t.U.P.curveTo(c,g,f,y,x,P,M),t.U.P.curveTo(c,C,b,I,v,m,A)),T=="o1236"&&(g=m+l.shift(),f=A+l.shift(),y=g+l.shift(),M=x=f+l.shift(),b=x,I=(C=(P=y+l.shift())+l.shift())+l.shift(),v=b+l.shift(),m=I+l.shift(),t.U.P.curveTo(c,g,f,y,x,P,M),t.U.P.curveTo(c,C,b,I,v,m,A)),T=="o1237"&&(g=m+l.shift(),f=A+l.shift(),y=g+l.shift(),x=f+l.shift(),P=y+l.shift(),M=x+l.shift(),C=P+l.shift(),b=M+l.shift(),I=C+l.shift(),v=b+l.shift(),Math.abs(I-m)>Math.abs(v-A)?m=I+l.shift():A=v+l.shift(),t.U.P.curveTo(c,g,f,y,x,P,M),t.U.P.curveTo(c,C,b,I,v,m,A));else if(T=="o14"){if(l.length>0&&!d&&(u=l.shift()+s.nominalWidthX,d=!0),l.length==4){var O=l.shift(),U=l.shift(),j=l.shift(),Y=l.shift(),X=t.CFF.glyphBySE(s,j),K=t.CFF.glyphBySE(s,Y);t.U._drawCFF(s.CharStrings[X],i,s,a,c),i.x=O,i.y=U,t.U._drawCFF(s.CharStrings[K],i,s,a,c)}_&&(t.U.P.closePath(c),_=!1)}else if(T=="o19"||T=="o20")l.length%2!=0&&!d&&(u=l.shift()+a.nominalWidthX),h+=l.length>>1,l.length=0,d=!0,p+=h+7>>3;else if(T=="o21")l.length>2&&!d&&(u=l.shift()+a.nominalWidthX,d=!0),A+=l.pop(),m+=l.pop(),_&&t.U.P.closePath(c),t.U.P.moveTo(c,m,A),_=!0;else if(T=="o22")l.length>1&&!d&&(u=l.shift()+a.nominalWidthX,d=!0),m+=l.pop(),_&&t.U.P.closePath(c),t.U.P.moveTo(c,m,A),_=!0;else if(T=="o25"){for(;l.length>6;)m+=l.shift(),A+=l.shift(),t.U.P.lineTo(c,m,A);g=m+l.shift(),f=A+l.shift(),y=g+l.shift(),x=f+l.shift(),m=y+l.shift(),A=x+l.shift(),t.U.P.curveTo(c,g,f,y,x,m,A)}else if(T=="o26")for(l.length%2&&(m+=l.shift());l.length>0;)g=m,f=A+l.shift(),m=y=g+l.shift(),A=(x=f+l.shift())+l.shift(),t.U.P.curveTo(c,g,f,y,x,m,A);else if(T=="o27")for(l.length%2&&(A+=l.shift());l.length>0;)f=A,y=(g=m+l.shift())+l.shift(),x=f+l.shift(),m=y+l.shift(),A=x,t.U.P.curveTo(c,g,f,y,x,m,A);else if(T=="o10"||T=="o29"){var J=T=="o10"?a:s;if(l.length==0)console.debug("error: empty stack");else{var ee=l.pop(),se=J.Subrs[ee+J.Bias];i.x=m,i.y=A,i.nStems=h,i.haveWidth=d,i.width=u,i.open=_,t.U._drawCFF(se,i,s,a,c),m=i.x,A=i.y,h=i.nStems,d=i.haveWidth,u=i.width,_=i.open}}else if(T=="o30"||T=="o31"){var ne=l.length,re=(V=0,T=="o31");for(V+=ne-(N=-3&ne);V<N;)re?(f=A,y=(g=m+l.shift())+l.shift(),A=(x=f+l.shift())+l.shift(),N-V==5?(m=y+l.shift(),V++):m=y,re=!1):(g=m,f=A+l.shift(),y=g+l.shift(),x=f+l.shift(),m=y+l.shift(),N-V==5?(A=x+l.shift(),V++):A=x,re=!0),t.U.P.curveTo(c,g,f,y,x,m,A),V+=4}else{if((T+"").charAt(0)=="o")throw console.debug("Unknown operation: "+T,r),T;l.push(T)}}}i.x=m,i.y=A,i.nStems=h,i.haveWidth=d,i.width=u,i.open=_};var n=t,o={Typr:n};return e.Typr=n,e.default=o,Object.defineProperty(e,"__esModule",{value:!0}),e}({}).Typr}/*!
Custom bundle of woff2otf (https://github.com/arty-name/woff2otf) with fflate
(https://github.com/101arrowz/fflate) for use in Troika text rendering. 
Original licenses apply: 
- fflate: https://github.com/101arrowz/fflate/blob/master/LICENSE (MIT)
- woff2otf.js: https://github.com/arty-name/woff2otf/blob/master/woff2otf.js (Apache2)
*/function jIo(){return function(e){var t=Uint8Array,n=Uint16Array,o=Uint32Array,r=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),i=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),s=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),a=function(T,N){for(var D=new n(31),L=0;L<31;++L)D[L]=N+=1<<T[L-1];var H=new o(D[30]);for(L=1;L<30;++L)for(var V=D[L];V<D[L+1];++V)H[V]=V-D[L]<<5|L;return[D,H]},c=a(r,2),l=c[0],h=c[1];l[28]=258,h[258]=28;for(var d=a(i,0)[0],u=new n(32768),_=0;_<32768;++_){var p=(43690&_)>>>1|(21845&_)<<1;p=(61680&(p=(52428&p)>>>2|(13107&p)<<2))>>>4|(3855&p)<<4,u[_]=((65280&p)>>>8|(255&p)<<8)>>>1}var m=function(T,N,D){for(var L=T.length,H=0,V=new n(N);H<L;++H)++V[T[H]-1];var O,U=new n(N);for(H=0;H<N;++H)U[H]=U[H-1]+V[H-1]<<1;if(D){O=new n(1<<N);var j=15-N;for(H=0;H<L;++H)if(T[H])for(var Y=H<<4|T[H],X=N-T[H],K=U[T[H]-1]++<<X,J=K|(1<<X)-1;K<=J;++K)O[u[K]>>>j]=Y}else for(O=new n(L),H=0;H<L;++H)T[H]&&(O[H]=u[U[T[H]-1]++]>>>15-T[H]);return O},A=new t(288);for(_=0;_<144;++_)A[_]=8;for(_=144;_<256;++_)A[_]=9;for(_=256;_<280;++_)A[_]=7;for(_=280;_<288;++_)A[_]=8;var g=new t(32);for(_=0;_<32;++_)g[_]=5;var f=m(A,9,1),y=m(g,5,1),x=function(T){for(var N=T[0],D=1;D<T.length;++D)T[D]>N&&(N=T[D]);return N},C=function(T,N,D){var L=N/8|0;return(T[L]|T[L+1]<<8)>>(7&N)&D},b=function(T,N){var D=N/8|0;return(T[D]|T[D+1]<<8|T[D+2]<<16)>>(7&N)},I=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],v=function(T,N,D){var L=Error(N||I[T]);if(L.code=T,Error.captureStackTrace&&Error.captureStackTrace(L,v),!D)throw L;return L},P=function(T,N,D){var L=T.length;if(!L||D&&!D.l&&L<5)return N||new t(0);var H=!N||D,V=!D||D.i;D||(D={}),N||(N=new t(3*L));var O,U=function(et){var vt=N.length;if(et>vt){var ht=new t(Math.max(2*vt,et));ht.set(N),N=ht}},j=D.f||0,Y=D.p||0,X=D.b||0,K=D.l,J=D.d,ee=D.m,se=D.n,ne=8*L;do{if(!K){D.f=j=C(T,Y,1);var re=C(T,Y+1,3);if(Y+=3,!re){var Z=T[(we=((O=Y)/8|0)+(7&O&&1)+4)-4]|T[we-3]<<8,te=we+Z;if(te>L){V&&v(0);break}H&&U(X+Z),N.set(T.subarray(we,te),X),D.b=X+=Z,D.p=Y=8*te;continue}if(re==1)K=f,J=y,ee=9,se=5;else if(re==2){var ie=C(T,Y,31)+257,le=C(T,Y+10,15)+4,ue=ie+C(T,Y+5,31)+1;Y+=14;for(var de=new t(ue),me=new t(19),Ae=0;Ae<le;++Ae)me[s[Ae]]=C(T,Y+3*Ae,7);Y+=3*le;var xe=x(me),Me=(1<<xe)-1,Re=m(me,xe,1);for(Ae=0;Ae<ue;){var we,_e=Re[C(T,Y,Me)];if(Y+=15&_e,(we=_e>>>4)<16)de[Ae++]=we;else{var ye=0,Se=0;for(we==16?(Se=3+C(T,Y,3),Y+=2,ye=de[Ae-1]):we==17?(Se=3+C(T,Y,7),Y+=3):we==18&&(Se=11+C(T,Y,127),Y+=7);Se--;)de[Ae++]=ye}}var Ne=de.subarray(0,ie),ke=de.subarray(ie);ee=x(Ne),se=x(ke),K=m(Ne,ee,1),J=m(ke,se,1)}else v(1);if(Y>ne){V&&v(0);break}}H&&U(X+131072);for(var nt=(1<<ee)-1,dt=(1<<se)-1,rt=Y;;rt=Y){var mt=(ye=K[b(T,Y)&nt])>>>4;if((Y+=15&ye)>ne){V&&v(0);break}if(ye||v(2),mt<256)N[X++]=mt;else{if(mt==256){rt=Y,K=null;break}var lt=mt-254;if(mt>264){var Ct=r[Ae=mt-257];lt=C(T,Y,(1<<Ct)-1)+l[Ae],Y+=Ct}var Nt=J[b(T,Y)&dt],Ht=Nt>>>4;if(Nt||v(3),Y+=15&Nt,ke=d[Ht],Ht>3)Ct=i[Ht],ke+=b(T,Y)&(1<<Ct)-1,Y+=Ct;if(Y>ne){V&&v(0);break}H&&U(X+131072);for(var Tt=X+lt;X<Tt;X+=4)N[X]=N[X-ke],N[X+1]=N[X+1-ke],N[X+2]=N[X+2-ke],N[X+3]=N[X+3-ke];X=Tt}}D.l=K,D.p=rt,D.b=X,K&&(j=1,D.m=ee,D.d=J,D.n=se)}while(!j);return X==N.length?N:function(et,vt,ht){(vt==null||vt<0)&&(vt=0),(ht==null||ht>et.length)&&(ht=et.length);var We=new(et instanceof n?n:et instanceof o?o:t)(ht-vt);return We.set(et.subarray(vt,ht)),We}(N,0,X)},M=new t(0),B=typeof TextDecoder<"u"&&new TextDecoder;try{B.decode(M,{stream:!0})}catch(T){}return e.convert_streams=function(T){var N=new DataView(T),D=0;function L(){var ie=N.getUint16(D);return D+=2,ie}function H(){var ie=N.getUint32(D);return D+=4,ie}function V(ie){Z.setUint16(te,ie),te+=2}function O(ie){Z.setUint32(te,ie),te+=4}for(var U={signature:H(),flavor:H(),length:H(),numTables:L(),reserved:L(),totalSfntSize:H(),majorVersion:L(),minorVersion:L(),metaOffset:H(),metaLength:H(),metaOrigLength:H(),privOffset:H(),privLength:H()},j=0;Math.pow(2,j)<=U.numTables;)j++;j--;for(var Y=16*Math.pow(2,j),X=16*U.numTables-Y,K=12,J=[],ee=0;ee<U.numTables;ee++)J.push({tag:H(),offset:H(),compLength:H(),origLength:H(),origChecksum:H()}),K+=16;var se,ne=new Uint8Array(12+16*J.length+J.reduce(function(ie,le){return ie+le.origLength+4},0)),re=ne.buffer,Z=new DataView(re),te=0;return O(U.flavor),V(U.numTables),V(Y),V(j),V(X),J.forEach(function(ie){O(ie.tag),O(ie.origChecksum),O(K),O(ie.origLength),ie.outOffset=K,(K+=ie.origLength)%4!=0&&(K+=4-K%4)}),J.forEach(function(ie){var le,ue=T.slice(ie.offset,ie.offset+ie.compLength);if(ie.compLength!=ie.origLength){var de=new Uint8Array(ie.origLength);le=new Uint8Array(ue,2),P(le,de)}else de=new Uint8Array(ue);ne.set(de,ie.outOffset);var me=0;(K=ie.outOffset+ie.origLength)%4!=0&&(me=4-K%4),ne.set(new Uint8Array(me).buffer,ie.outOffset+ie.origLength),se=K+me}),re.slice(0,se)},Object.defineProperty(e,"__esModule",{value:!0}),e}({}).convert_streams}function KIo(e,t){let n={M:2,L:2,Q:4,C:6,Z:0},o={C:"18g,ca,368,1kz",D:"17k,6,2,2+4,5+c,2+6,2+1,10+1,9+f,j+11,2+1,a,2,2+1,15+2,3,j+2,6+3,2+8,2,2,2+1,w+a,4+e,3+3,2,3+2,3+5,23+w,2f+4,3,2+9,2,b,2+3,3,1k+9,6+1,3+1,2+2,2+d,30g,p+y,1,1+1g,f+x,2,sd2+1d,jf3+4,f+3,2+4,2+2,b+3,42,2,4+2,2+1,2,3,t+1,9f+w,2,el+2,2+g,d+2,2l,2+1,5,3+1,2+1,2,3,6,16wm+1v",R:"17m+3,2,2,6+3,m,15+2,2+2,h+h,13,3+8,2,2,3+1,2,p+1,x,5+4,5,a,2,2,3,u,c+2,g+1,5,2+1,4+1,5j,6+1,2,b,2+2,f,2+1,1s+2,2,3+1,7,1ez0,2,2+1,4+4,b,4,3,b,42,2+2,4,3,2+1,2,o+3,ae,ep,x,2o+2,3+1,3,5+1,6",L:"x9u,jff,a,fd,jv",T:"4t,gj+33,7o+4,1+1,7c+18,2,2+1,2+1,2,21+a,2,1b+k,h,2u+6,3+5,3+1,2+3,y,2,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,3,7,6+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+d,1,1+1,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,ek,3+1,r+4,1e+4,6+5,2p+c,1+3,1,1+2,1+b,2db+2,3y,2p+v,ff+3,30+1,n9x,1+2,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,5s,6y+2,ea,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+9,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2,2b+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,470+8,at4+4,1o+6,t5,1s+3,2a,f5l+1,2+3,43o+2,a+7,1+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,1,gzau,v+2n,3l+6n"},r=1,i=2,s=4,a=8,c=16,l=32,h;function d(I){if(!h){let v={R:2,L:1,D:4,C:16,U:32,T:8};h=new Map;for(let P in o){let M=0;o[P].split(",").forEach((B)=>{let[T,N]=B.split("+");T=parseInt(T,36),N=N?parseInt(N,36):0,h.set(M+=T,v[P]);for(let D=N;D--;)h.set(++M,v[P])})}}return h.get(I)||32}let u=1,_=2,p=3,m=4,A=[null,"isol","init","fina","medi"];function g(I){let v=new Uint8Array(I.length),P=32,M=u,B=-1;for(let T=0;T<I.length;T++){let N=I.codePointAt(T),D=d(N)|0,L=u;if(D&8)continue;if(P&21){if(D&22){if(L=p,M===u||M===p)v[B]++}else if(D&33){if(M===_||M===m)v[B]--}}else if(P&34){if(M===_||M===m)v[B]--}if(M=v[T]=L,P=D,B=T,N>65535)T++}return v}function f(I,v){let P=[];for(let B=0;B<v.length;B++){let T=v.codePointAt(B);if(T>65535)B++;P.push(e.U.codeToGlyph(I,T))}let M=I.GSUB;if(M){let{lookupList:B,featureList:T}=M,N,D=/^(rlig|liga|mset|isol|init|fina|medi|half|pres|blws|ccmp)$/,L=[];T.forEach((H)=>{if(D.test(H.tag))for(let V=0;V<H.tab.length;V++){if(L[H.tab[V]])continue;L[H.tab[V]]=!0;let O=B[H.tab[V]],U=/^(isol|init|fina|medi)$/.test(H.tag);if(U&&!N)N=g(v);for(let j=0;j<P.length;j++)if(!N||!U||A[N[j]]===H.tag)e.U._applySubs(P,j,O,B)}})}return P}function y(I,v){let P=new Int16Array(v.length*3),M=0;for(;M<v.length;M++){let D=v[M];if(D===-1)continue;P[M*3+2]=I.hmtx.aWidth[D];let L=I.GPOS;if(L){let H=L.lookupList;for(let V=0;V<H.length;V++){let O=H[V];for(let U=0;U<O.tabs.length;U++){let j=O.tabs[U];if(O.ltype===1){if(e._lctf.coverageIndex(j.coverage,D)!==-1&&j.pos){N(j.pos,M);break}}else if(O.ltype===2){let Y=null,X=B();if(X!==-1){let K=e._lctf.coverageIndex(j.coverage,v[X]);if(K!==-1){if(j.fmt===1){let J=j.pairsets[K];for(let ee=0;ee<J.length;ee++)if(J[ee].gid2===D)Y=J[ee]}else if(j.fmt===2){let J=e.U._getGlyphClass(v[X],j.classDef1),ee=e.U._getGlyphClass(D,j.classDef2);Y=j.matrix[J][ee]}if(Y){if(Y.val1)N(Y.val1,X);if(Y.val2)N(Y.val2,M);break}}}}else if(O.ltype===4){let Y=e._lctf.coverageIndex(j.markCoverage,D);if(Y!==-1){let X=B(T),K=X===-1?-1:e._lctf.coverageIndex(j.baseCoverage,v[X]);if(K!==-1){let J=j.markArray[Y],ee=j.baseArray[K][J.markClass];P[M*3]=ee.x-J.x+P[X*3]-P[X*3+2],P[M*3+1]=ee.y-J.y+P[X*3+1];break}}}else if(O.ltype===6){let Y=e._lctf.coverageIndex(j.mark1Coverage,D);if(Y!==-1){let X=B();if(X!==-1){let K=v[X];if(x(I,K)===3){let J=e._lctf.coverageIndex(j.mark2Coverage,K);if(J!==-1){let ee=j.mark1Array[Y],se=j.mark2Array[J][ee.markClass];P[M*3]=se.x-ee.x+P[X*3]-P[X*3+2],P[M*3+1]=se.y-ee.y+P[X*3+1];break}}}}}}}}else if(I.kern&&!I.cff){let H=B();if(H!==-1){let V=I.kern.glyph1.indexOf(v[H]);if(V!==-1){let O=I.kern.rval[V].glyph2.indexOf(D);if(O!==-1)P[H*3+2]+=I.kern.rval[V].vals[O]}}}}return P;function B(D){for(let L=M-1;L>=0;L--)if(v[L]!==-1&&(!D||D(v[L])))return L;return-1}function T(D){return x(I,D)===1}function N(D,L){for(let H=0;H<3;H++)P[L*3+H]+=D[H]||0}}function x(I,v){let P=I.GDEF&&I.GDEF.glyphClassDef;return P?e.U._getGlyphClass(v,P):0}function C(...I){for(let v=0;v<I.length;v++)if(typeof I[v]==="number")return I[v]}function b(I){let v=Object.create(null),P=I["OS/2"],M=I.hhea,B=I.head.unitsPerEm,T=C(P&&P.sTypoAscender,M&&M.ascender,B),N={unitsPerEm:B,ascender:T,descender:C(P&&P.sTypoDescender,M&&M.descender,0),capHeight:C(P&&P.sCapHeight,T),xHeight:C(P&&P.sxHeight,T),lineGap:C(P&&P.sTypoLineGap,M&&M.lineGap),supportsCodePoint(D){return e.U.codeToGlyph(I,D)>0},forEachGlyph(D,L,H,V){let O=0,U=1/N.unitsPerEm*L,j=f(I,D),Y=0,X=y(I,j);return j.forEach((K,J)=>{if(K!==-1){let ee=v[K];if(!ee){let{cmds:se,crds:ne}=e.U.glyphToPath(I,K),re="",Z=0;for(let de=0,me=se.length;de<me;de++){let Ae=n[se[de]];re+=se[de];for(let xe=1;xe<=Ae;xe++)re+=(xe>1?",":"")+ne[Z++]}let te,ie,le,ue;if(ne.length){te=ie=1/0,le=ue=-1/0;for(let de=0,me=ne.length;de<me;de+=2){let Ae=ne[de],xe=ne[de+1];if(Ae<te)te=Ae;if(xe<ie)ie=xe;if(Ae>le)le=Ae;if(xe>ue)ue=xe}}else te=le=ie=ue=0;ee=v[K]={index:K,advanceWidth:I.hmtx.aWidth[K],xMin:te,yMin:ie,xMax:le,yMax:ue,path:re}}if(V.call(null,ee,O+X[J*3]*U,X[J*3+1]*U,Y),O+=X[J*3+2]*U,H)O+=H*L}Y+=D.codePointAt(Y)>65535?2:1}),O}};return N}return function(v){let P=new Uint8Array(v,0,4),M=e._bin.readASCII(P,0,4);if(M==="wOFF")v=t(v);else if(M==="wOF2")throw Error("woff2 fonts not supported");return b(e.parse(v)[0])}}var $Io=Fz({name:"Typr Font Parser",dependencies:[XIo,jIo,KIo],init(e,t,n){let o=e(),r=t();return n(o,r)}});/*!
Custom bundle of @unicode-font-resolver/client v1.0.2 (https://github.com/lojjic/unicode-font-resolver)
for use in Troika text rendering. 
Original MIT license applies
*/function qIo(){return function(e){var t=function(){this.buckets=new Map};t.prototype.add=function(y){var x=y>>5;this.buckets.set(x,(this.buckets.get(x)||0)|1<<(31&y))},t.prototype.has=function(y){var x=this.buckets.get(y>>5);return x!==void 0&&(x&1<<(31&y))!=0},t.prototype.serialize=function(){var y=[];return this.buckets.forEach(function(x,C){y.push((+C).toString(36)+":"+x.toString(36))}),y.join(",")},t.prototype.deserialize=function(y){var x=this;this.buckets.clear(),y.split(",").forEach(function(C){var b=C.split(":");x.buckets.set(parseInt(b[0],36),parseInt(b[1],36))})};var n=Math.pow(2,8),o=n-1,r=~o;function i(y){var x=function(b){return b&r}(y).toString(16),C=function(b){return(b&r)+n-1}(y).toString(16);return"codepoint-index/plane"+(y>>16)+"/"+x+"-"+C+".json"}function s(y,x){var C=y&o,b=x.codePointAt(C/6|0);return((b=(b||48)-48)&1<<C%6)!=0}function a(y,x){var C;(C=y,C.replace(/U\+/gi,"").replace(/^,+|,+$/g,"").split(/,+/).map(function(b){return b.split("-").map(function(I){return parseInt(I.trim(),16)})})).forEach(function(b){var I=b[0],v=b[1];v===void 0&&(v=I),x(I,v)})}function c(y,x){a(y,function(C,b){for(var I=C;I<=b;I++)x(I)})}var l={},h={},d=new WeakMap,u="https://cdn.jsdelivr.net/gh/lojjic/unicode-font-resolver@v1.0.1/packages/data";function _(y){var x=d.get(y);return x||(x=new t,c(y.ranges,function(C){return x.add(C)}),d.set(y,x)),x}var p,m=new Map;function A(y,x,C){return y[x]?x:y[C]?C:function(b){for(var I in b)return I}(y)}function g(y,x){var C=x;if(!y.includes(C)){C=1/0;for(var b=0;b<y.length;b++)Math.abs(y[b]-x)<Math.abs(C-x)&&(C=y[b])}return C}function f(y){return p||(p=new Set,c("9-D,20,85,A0,1680,2000-200A,2028-202F,205F,3000",function(x){p.add(x)})),p.has(y)}return e.CodePointSet=t,e.clearCache=function(){l={},h={}},e.getFontsForString=function(y,x){x===void 0&&(x={});var C,b=x.lang;b===void 0&&(b=/\p{Script=Hangul}/u.test(C=y)?"ko":/\p{Script=Hiragana}|\p{Script=Katakana}/u.test(C)?"ja":"en");var I=x.category;I===void 0&&(I="sans-serif");var v=x.style;v===void 0&&(v="normal");var P=x.weight;P===void 0&&(P=400);var M=(x.dataUrl||u).replace(/\/$/g,""),B=new Map,T=new Uint8Array(y.length),N={},D={},L=Array(y.length),H=new Map,V=!1;function O(Y){var X=m.get(Y);return X||(X=fetch(M+"/"+Y).then(function(K){if(!K.ok)throw Error(K.statusText);return K.json().then(function(J){if(!Array.isArray(J)||J[0]!==1)throw Error("Incorrect schema version; need 1, got "+J[0]);return J[1]})}).catch(function(K){if(M!==u)return V||(console.error('unicode-font-resolver: Failed loading from dataUrl "'+M+'", trying default CDN. '+K.message),V=!0),M=u,m.delete(Y),O(Y);throw K}),m.set(Y,X)),X}for(var U=function(Y){var X=y.codePointAt(Y),K=i(X);L[Y]=K,l[K]||H.has(K)||H.set(K,O(K).then(function(J){l[K]=J})),X>65535&&(Y++,j=Y)},j=0;j<y.length;j++)U(j);return Promise.all(H.values()).then(function(){H.clear();for(var Y=function(K){var J=y.codePointAt(K),ee=null,se=l[L[K]],ne=void 0;for(var re in se){var Z=D[re];if(Z===void 0&&(Z=D[re]=new RegExp(re).test(b||"en")),Z){for(var te in ne=re,se[re])if(s(J,se[re][te])){ee=te;break}break}}if(!ee){e:for(var ie in se)if(ie!==ne){for(var le in se[ie])if(s(J,se[ie][le])){ee=le;break e}}}ee||(console.debug("No font coverage for U+"+J.toString(16)),ee="latin"),L[K]=ee,h[ee]||H.has(ee)||H.set(ee,O("font-meta/"+ee+".json").then(function(ue){h[ee]=ue})),J>65535&&(K++,X=K)},X=0;X<y.length;X++)Y(X);return Promise.all(H.values())}).then(function(){for(var Y,X=null,K=0;K<y.length;K++){var J=y.codePointAt(K);if(X&&(f(J)||_(X).has(J)))T[K]=T[K-1];else{X=h[L[K]];var ee=N[X.id];if(!ee){var se=X.typeforms,ne=A(se,I,"sans-serif"),re=A(se[ne],v,"normal"),Z=g((Y=se[ne])===null||Y===void 0?void 0:Y[re],P);ee=N[X.id]=M+"/font-files/"+X.id+"/"+ne+"."+re+"."+Z+".woff"}var te=B.get(ee);te==null&&(te=B.size,B.set(ee,te)),T[K]=te}J>65535&&(K++,T[K]=T[K-1])}return{fontUrls:Array.from(B.keys()),chars:T}})},Object.defineProperty(e,"__esModule",{value:!0}),e}({})}function JIo(e,t){let n=Object.create(null),o=Object.create(null);function r(s,a){let c=(l)=>{console.error(`Failure loading font ${s}`,l)};try{let l=new XMLHttpRequest;l.open("get",s,!0),l.responseType="arraybuffer",l.onload=function(){if(l.status>=400)c(Error(l.statusText));else if(l.status>0)try{let h=e(l.response);h.src=s,a(h)}catch(h){c(h)}},l.onerror=c,l.send()}catch(l){c(l)}}function i(s,a){let c=n[s];if(c)a(c);else if(o[s])o[s].push(a);else o[s]=[a],r(s,(l)=>{l.src=s,n[s]=l,o[s].forEach((h)=>h(l)),delete o[s]})}return function(s,a,{lang:c,fonts:l=[],style:h="normal",weight:d="normal",unicodeFontsURL:u}={}){let _=new Uint8Array(s.length),p=[];if(!s.length)f();let m=new Map,A=[];if(h!=="italic")h="normal";if(typeof d!=="number")d=d==="bold"?700:400;if(l&&!Array.isArray(l))l=[l];if(l=l.slice().filter((x)=>!x.lang||x.lang.test(c)).reverse(),l.length){let I=0;(function v(P=0){for(let M=P,B=s.length;M<B;M++){let T=s.codePointAt(M);if(I===1&&p[_[M-1]].supportsCodePoint(T)||M>0&&/\s/.test(s[M])){if(_[M]=_[M-1],I===2)A[A.length-1][1]=M}else for(let N=_[M],D=l.length;N<=D;N++)if(N===D){let L=I===2?A[A.length-1]:A[A.length]=[M,M];L[1]=M,I=2}else{_[M]=N;let{src:L,unicodeRange:H}=l[N];if(!H||y(T,H)){let V=n[L];if(!V){i(L,()=>{v(M)});return}if(V.supportsCodePoint(T)){let O=m.get(V);if(typeof O!=="number")O=p.length,p.push(V),m.set(V,O);_[M]=O,I=1;break}}}if(T>65535&&M+1<B){if(_[M+1]=_[M],M++,I===2)A[A.length-1][1]=M}}g()})()}else A.push([0,s.length-1]),g();function g(){if(A.length){let x=A.map((C)=>s.substring(C[0],C[1]+1)).join(`
`);t.getFontsForString(x,{lang:c||void 0,style:h,weight:d,dataUrl:u}).then(({fontUrls:C,chars:b})=>{let I=p.length,v=0;A.forEach((M)=>{for(let B=0,T=M[1]-M[0];B<=T;B++)_[M[0]+B]=b[v++]+I;v++});let P=0;C.forEach((M,B)=>{i(M,(T)=>{if(p[B+I]=T,++P===C.length)f()})})})}else f()}function f(){a({chars:_,fonts:p})}function y(x,C){for(let b=0;b<C.length;b++){let[I,v=I]=C[b];if(I<=x&&x<=v)return!0}return!1}}}var ZIo=Fz({name:"FontResolver",dependencies:[JIo,$Io,qIo],init(e,t,n){return e(t,n())}});function e9o(e,t){let o=/[\u00AD\u034F\u061C\u115F-\u1160\u17B4-\u17B5\u180B-\u180E\u200B-\u200F\u202A-\u202E\u2060-\u206F\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFF8]/,r="[^\\S\\u00A0]",i=new RegExp("[^\\S\\u00A0]|[\\-\\u007C\\u00AD\\u2010\\u2012-\\u2014\\u2027\\u2056\\u2E17\\u2E40]");function s({text:p,lang:m,fonts:A,style:g,weight:f,preResolvedFonts:y,unicodeFontsURL:x},C){let b=({chars:I,fonts:v})=>{let P,M,B=[];for(let T=0;T<I.length;T++)if(I[T]!==M)M=I[T],B.push(P={start:T,end:T,fontObj:v[I[T]]});else P.end=T;C(B)};if(y)b(y);else e(p,b,{lang:m,fonts:A,style:g,weight:f,unicodeFontsURL:x})}function a({text:p="",font:m,lang:A,sdfGlyphSize:g=64,fontSize:f=400,fontWeight:y=1,fontStyle:x="normal",letterSpacing:C=0,lineHeight:b="normal",maxWidth:I=1/0,direction:v,textAlign:P="left",textIndent:M=0,whiteSpace:B="normal",overflowWrap:T="normal",anchorX:N=0,anchorY:D=0,metricsOnly:L=!1,unicodeFontsURL:H,preResolvedFonts:V=null,includeCaretPositions:O=!1,chunkedBoundsSize:U=8192,colorRanges:j=null},Y){let X=d(),K={fontLoad:0,typesetting:0};if(p.indexOf("\r")>-1)console.info("Typesetter: got text with \\r chars; normalizing to \\n"),p=p.replace(/\r\n/g,`
`).replace(/\r/g,`
`);f=+f,C=+C,I=+I,b=b||"normal",M=+M,s({text:p,lang:A,style:x,weight:y,fonts:typeof m==="string"?[{src:m}]:m,unicodeFontsURL:H,preResolvedFonts:V},(J)=>{K.fontLoad=d()-X;let ee=isFinite(I),se=null,ne=null,re=null,Z=null,te=null,ie=null,le=null,ue=null,de=0,me=0,Ae=B!=="nowrap",xe=new Map,Me=d(),Re=M,we=0,_e=new u,ye=[_e];J.forEach((dt)=>{let{fontObj:rt}=dt,{ascender:mt,descender:lt,unitsPerEm:Ct,lineGap:Nt,capHeight:Ht,xHeight:Tt}=rt,et=xe.get(rt);if(!et){let Ze=f/Ct,$e=b==="normal"?(mt-lt+Nt)*Ze:b*f,qe=($e-(mt-lt)*Ze)/2,ft=Math.min($e,(mt-lt)*Ze),It=(mt+lt)/2*Ze+ft/2;et={index:xe.size,src:rt.src,fontObj:rt,fontSizeMult:Ze,unitsPerEm:Ct,ascender:mt*Ze,descender:lt*Ze,capHeight:Ht*Ze,xHeight:Tt*Ze,lineHeight:$e,baseline:-qe-mt*Ze,caretTop:It,caretBottom:It-ft},xe.set(rt,et)}let{fontSizeMult:vt}=et,ht=p.slice(dt.start,dt.end+1),We,Le;rt.forEachGlyph(ht,f,C,(Ze,$e,qe,ft)=>{$e+=we,ft+=dt.start,We=$e,Le=Ze;let It=p.charAt(ft),ze=Ze.advanceWidth*vt,Xe=_e.count,it;if(!("isEmpty"in Ze))Ze.isWhitespace=!!It&&new RegExp("[^\\S\\u00A0]").test(It),Ze.canBreakAfter=!!It&&i.test(It),Ze.isEmpty=Ze.xMin===Ze.xMax||Ze.yMin===Ze.yMax||o.test(It);if(!Ze.isWhitespace&&!Ze.isEmpty)me++;if(Ae&&ee&&!Ze.isWhitespace&&$e+ze+Re>I&&Xe){if(_e.glyphAt(Xe-1).glyphObj.canBreakAfter)it=new u,Re=-$e;else for(let kt=Xe;kt--;)if(kt===0&&T==="break-word"){it=new u,Re=-$e;break}else if(_e.glyphAt(kt).glyphObj.canBreakAfter){it=_e.splitAt(kt+1);let Lt=it.glyphAt(0).x;Re-=Lt;for(let Wt=it.count;Wt--;)it.glyphAt(Wt).x-=Lt;break}if(it)_e.isSoftWrapped=!0,_e=it,ye.push(_e),de=I}let St=_e.glyphAt(_e.count);if(St.glyphObj=Ze,St.x=$e+Re,St.y=qe,St.width=ze,St.charIndex=ft,St.fontData=et,It===`
`)_e=new u,ye.push(_e),Re=-($e+ze+C*f)+M}),we=We+Le.advanceWidth*vt+C*f});let Se=0;ye.forEach((dt)=>{let rt=!0;for(let mt=dt.count;mt--;){let lt=dt.glyphAt(mt);if(rt&&!lt.glyphObj.isWhitespace){if(dt.width=lt.x+lt.width,dt.width>de)de=dt.width;rt=!1}let{lineHeight:Ct,capHeight:Nt,xHeight:Ht,baseline:Tt}=lt.fontData;if(Ct>dt.lineHeight)dt.lineHeight=Ct;let et=Tt-dt.baseline;if(et<0)dt.baseline+=et,dt.cap+=et,dt.ex+=et;dt.cap=Math.max(dt.cap,dt.baseline+Nt),dt.ex=Math.max(dt.ex,dt.baseline+Ht)}dt.baseline-=Se,dt.cap-=Se,dt.ex-=Se,Se+=dt.lineHeight});let Ne=0,ke=0;if(N){if(typeof N==="number")Ne=-N;else if(typeof N==="string")Ne=-de*(N==="left"?0:N==="center"?0.5:N==="right"?1:l(N))}if(D){if(typeof D==="number")ke=-D;else if(typeof D==="string")ke=D==="top"?0:D==="top-baseline"?-ye[0].baseline:D==="top-cap"?-ye[0].cap:D==="top-ex"?-ye[0].ex:D==="middle"?Se/2:D==="bottom"?Se:D==="bottom-baseline"?-ye[ye.length-1].baseline:l(D)*Se}if(!L){let dt=t.getEmbeddingLevels(p,v);if(se=new Uint16Array(me),ne=new Uint8Array(me),re=new Float32Array(me*2),Z={},le=[1/0,1/0,-1/0,-1/0],ue=[],O)ie=new Float32Array(p.length*4);if(j)te=new Uint8Array(me*3);let rt=0,mt=-1,lt=-1,Ct,Nt;if(ye.forEach((Ht,Tt)=>{let{count:et,width:vt}=Ht;if(et>0){let ht=0;for(let ft=et;ft--&&Ht.glyphAt(ft).glyphObj.isWhitespace;)ht++;let We=0,Le=0;if(P==="center")We=(de-vt)/2;else if(P==="right")We=de-vt;else if(P==="justify"&&Ht.isSoftWrapped){let ft=0;for(let It=et-ht;It--;)if(Ht.glyphAt(It).glyphObj.isWhitespace)ft++;Le=(de-vt)/ft}if(Le||We){let ft=0;for(let It=0;It<et;It++){let ze=Ht.glyphAt(It),Xe=ze.glyphObj;if(ze.x+=We+ft,Le!==0&&Xe.isWhitespace&&It<et-ht)ft+=Le,ze.width+=Le}}let Ze=t.getReorderSegments(p,dt,Ht.glyphAt(0).charIndex,Ht.glyphAt(Ht.count-1).charIndex);for(let ft=0;ft<Ze.length;ft++){let[It,ze]=Ze[ft],Xe=1/0,it=-1/0;for(let St=0;St<et;St++)if(Ht.glyphAt(St).charIndex>=It){let kt=St,Lt=St;for(;Lt<et;Lt++){let Wt=Ht.glyphAt(Lt);if(Wt.charIndex>ze)break;if(Lt<et-ht)Xe=Math.min(Xe,Wt.x),it=Math.max(it,Wt.x+Wt.width)}for(let Wt=kt;Wt<Lt;Wt++){let bn=Ht.glyphAt(Wt);bn.x=it-(bn.x+bn.width-Xe)}break}}let $e,qe=(ft)=>$e=ft;for(let ft=0;ft<et;ft++){let It=Ht.glyphAt(ft);$e=It.glyphObj;let ze=$e.index,Xe=dt.levels[It.charIndex]&1;if(Xe){let it=t.getMirroredCharacter(p[It.charIndex]);if(it)It.fontData.fontObj.forEachGlyph(it,0,0,qe)}if(O){let{charIndex:it,fontData:St}=It,kt=It.x+Ne,Lt=It.x+It.width+Ne;ie[it*4]=Xe?Lt:kt,ie[it*4+1]=Xe?kt:Lt,ie[it*4+2]=Ht.baseline+St.caretBottom+ke,ie[it*4+3]=Ht.baseline+St.caretTop+ke;let Wt=it-mt;if(Wt>1)h(ie,mt,Wt);mt=it}if(j){let{charIndex:it}=It;while(it>lt)if(lt++,j.hasOwnProperty(lt))Nt=j[lt]}if(!$e.isWhitespace&&!$e.isEmpty){let it=rt++,{fontSizeMult:St,src:kt,index:Lt}=It.fontData,Wt=Z[kt]||(Z[kt]={});if(!Wt[ze])Wt[ze]={path:$e.path,pathBounds:[$e.xMin,$e.yMin,$e.xMax,$e.yMax]};let bn=It.x+Ne,pn=It.y+Ht.baseline+ke;re[it*2]=bn,re[it*2+1]=pn;let wn=bn+$e.xMin*St,Fn=pn+$e.yMin*St,mn=bn+$e.xMax*St,_n=pn+$e.yMax*St;if(wn<le[0])le[0]=wn;if(Fn<le[1])le[1]=Fn;if(mn>le[2])le[2]=mn;if(_n>le[3])le[3]=_n;if(it%U===0)Ct={start:it,end:it,rect:[1/0,1/0,-1/0,-1/0]},ue.push(Ct);Ct.end++;let no=Ct.rect;if(wn<no[0])no[0]=wn;if(Fn<no[1])no[1]=Fn;if(mn>no[2])no[2]=mn;if(_n>no[3])no[3]=_n;if(se[it]=ze,ne[it]=Lt,j){let To=it*3;te[To]=Nt>>16&255,te[To+1]=Nt>>8&255,te[To+2]=Nt&255}}}}}),ie){let Ht=p.length-mt;if(Ht>1)h(ie,mt,Ht)}}let nt=[];xe.forEach(({index:dt,src:rt,unitsPerEm:mt,ascender:lt,descender:Ct,lineHeight:Nt,capHeight:Ht,xHeight:Tt})=>{nt[dt]={src:rt,unitsPerEm:mt,ascender:lt,descender:Ct,lineHeight:Nt,capHeight:Ht,xHeight:Tt}}),K.typesetting=d()-Me,Y({glyphIds:se,glyphFontIndices:ne,glyphPositions:re,glyphData:Z,fontData:nt,caretPositions:ie,glyphColors:te,chunkedBounds:ue,fontSize:f,topBaseline:ke+ye[0].baseline,blockBounds:[Ne,ke-Se,Ne+de,ke],visibleBounds:le,timings:K})})}function c(p,m){a({...p,metricsOnly:!0},(A)=>{let[g,f,y,x]=A.blockBounds;m({width:y-g,height:x-f})})}function l(p){let m=p.match(/^([\d.]+)%$/),A=m?parseFloat(m[1]):NaN;return isNaN(A)?0:A/100}function h(p,m,A){let g=p[m*4],f=p[m*4+1],y=p[m*4+2],x=p[m*4+3],C=(f-g)/A;for(let b=0;b<A;b++){let I=(m+b)*4;p[I]=g+C*b,p[I+1]=g+C*(b+1),p[I+2]=y,p[I+3]=x}}function d(){return(self.performance||Date).now()}function u(){this.data=[]}let _=["glyphObj","x","y","width","charIndex","fontData"];return u.prototype={width:0,lineHeight:0,baseline:0,cap:0,ex:0,isSoftWrapped:!1,get count(){return Math.ceil(this.data.length/_.length)},glyphAt(p){let m=u.flyweight;return m.data=this.data,m.index=p,m},splitAt(p){let m=new u;return m.data=this.data.splice(p*_.length),m}},u.flyweight=_.reduce((p,m,A,g)=>(Object.defineProperty(p,m,{get(){return this.data[this.index*_.length+A]},set(f){this.data[this.index*_.length+A]=f}}),p),{data:null,index:0}),{typeset:a,measure:c}}var Oz=()=>(self.performance||Date).now(),cfe=YQe(),Z5t;function t9o(e,t,n,o,r,i,s,a,c,l,h=!0){if(!h)return t4t(e,t,n,o,r,i,s,a,c,l);return o9o(e,t,n,o,r,i,s,a,c,l).then(null,(d)=>{if(!Z5t)console.warn("WebGL SDF generation failed, falling back to JS",d),Z5t=!0;return t4t(e,t,n,o,r,i,s,a,c,l)})}var afe=[],n9o=5,jQe=0;function l4t(){let e=Oz();while(afe.length&&Oz()-e<n9o)afe.shift()();jQe=afe.length?setTimeout(l4t,0):0}var o9o=(...e)=>new Promise((t,n)=>{if(afe.push(()=>{let o=Oz();try{cfe.webgl.generateIntoCanvas(...e),t({timing:Oz()-o})}catch(r){n(r)}}),!jQe)jQe=setTimeout(l4t,0)}),r9o=4,i9o=2000,e4t={},s9o=0;function t4t(e,t,n,o,r,i,s,a,c,l){let h="TroikaTextSDFGenerator_JS_"+s9o++%r9o,d=e4t[h];if(!d)d=e4t[h]={workerModule:Fz({name:h,workerId:h,dependencies:[YQe,Oz],init(u,_){let p=u().javascript.generate;return function(...m){let A=_();return{textureData:p(...m),timing:_()-A}}},getTransferables(u){return[u.textureData.buffer]}}),requests:0,idleTimer:null};return d.requests++,clearTimeout(d.idleTimer),d.workerModule(e,t,n,o,r,i).then(({textureData:u,timing:_})=>{let p=Oz(),m=new Uint8Array(u.length*4);for(let A=0;A<u.length;A++)m[A*4+l]=u[A];if(cfe.webglUtils.renderImageData(s,m,a,c,e,t,1<<3-l),_+=Oz()-p,--d.requests===0)d.idleTimer=setTimeout(()=>{X5t(h)},i9o);return{timing:_}})}function a9o(e){if(!e._warm)cfe.webgl.isSupported(e),e._warm=!0}var c9o=cfe.webglUtils.resizeWebGLCanvasWithoutClearing,AR={defaultFontURL:null,unicodeFontsURL:null,sdfGlyphSize:64,sdfMargin:0.0625,sdfExponent:9,textureWidth:2048,useWorker:!0},l9o=new No,h4t=!1;function tj(){return(self.performance||Date).now()}function d4t(e){if(h4t)console.warn("configureTextBuilder called after first font request; will be ignored.");else p4t(AR,e)}var n4t=Object.create(null);function h9o(e,t){h4t=!0,e=p4t({},e);let n=tj(),{defaultFontURL:o}=AR,r=[];if(o)r.push({label:"default",src:o4t(o)});if(e.font)r.push({label:"user",src:o4t(e.font)});if(e.font=r,e.text=""+e.text,e.sdfGlyphSize=e.sdfGlyphSize||AR.sdfGlyphSize,e.unicodeFontsURL=e.unicodeFontsURL||AR.unicodeFontsURL,e.colorRanges!=null){let _={};for(let p in e.colorRanges)if(e.colorRanges.hasOwnProperty(p)){let m=e.colorRanges[p];if(typeof m!=="number")m=l9o.set(m).getHex();_[p]=m}e.colorRanges=_}Object.freeze(e);let{textureWidth:i,sdfExponent:s}=AR,{sdfGlyphSize:a}=e,c=i/a*4,l=n4t[a];if(!l){let _=document.createElement("canvas");_.width=i,_.height=a*256/c,l=n4t[a]={glyphCount:0,sdfGlyphSize:a,sdfCanvas:_,sdfTexture:new vl(_,void 0,void 0,void 0,Ec,Ec),contextLost:!1,glyphsByFont:new Map},l.sdfTexture.generateMipmaps=!1,d9o(l)}let{sdfTexture:h,sdfCanvas:d}=l;(AR.useWorker?_4t:p9o)(e).then((_)=>{let{glyphIds:p,glyphFontIndices:m,fontData:A,glyphPositions:g,fontSize:f,timings:y}=_,x=[],C=new Float32Array(p.length*4),b=0,I=0,v=tj(),P=A.map((D)=>{let L=l.glyphsByFont.get(D.src);if(!L)l.glyphsByFont.set(D.src,L=new Map);return L});p.forEach((D,L)=>{let H=m[L],{src:V,unitsPerEm:O}=A[H],U=P[H].get(D);if(!U){let{path:J,pathBounds:ee}=_.glyphData[V][D],se=Math.max(ee[2]-ee[0],ee[3]-ee[1])/a*(AR.sdfMargin*a+0.5),ne=l.glyphCount++,re=[ee[0]-se,ee[1]-se,ee[2]+se,ee[3]+se];P[H].set(D,U={path:J,atlasIndex:ne,sdfViewBox:re}),x.push(U)}let{sdfViewBox:j}=U,Y=g[I++],X=g[I++],K=f/O;C[b++]=Y+j[0]*K,C[b++]=X+j[1]*K,C[b++]=Y+j[2]*K,C[b++]=X+j[3]*K,p[L]=U.atlasIndex}),y.quads=(y.quads||0)+(tj()-v);let M=tj();y.sdf={};let B=d.height,T=Math.ceil(l.glyphCount/c),N=Math.pow(2,Math.ceil(Math.log2(T*a)));if(N>B)console.info(`Increasing SDF texture size ${B}->${N}`),c9o(d,i,N),h.dispose();Promise.all(x.map((D)=>u4t(D,l,e.gpuAccelerateSDF).then(({timing:L})=>{y.sdf[D.atlasIndex]=L}))).then(()=>{if(x.length&&!l.contextLost)m4t(l),h.needsUpdate=!0;y.sdfTotal=tj()-M,y.total=tj()-n,t(Object.freeze({parameters:e,sdfTexture:h,sdfGlyphSize:a,sdfExponent:s,glyphBounds:C,glyphAtlasIndices:p,glyphColors:_.glyphColors,caretPositions:_.caretPositions,chunkedBounds:_.chunkedBounds,ascender:_.ascender,descender:_.descender,lineHeight:_.lineHeight,capHeight:_.capHeight,xHeight:_.xHeight,topBaseline:_.topBaseline,blockBounds:_.blockBounds,visibleBounds:_.visibleBounds,timings:_.timings}))})}),Promise.resolve().then(()=>{if(!l.contextLost)a9o(d)})}function u4t({path:e,atlasIndex:t,sdfViewBox:n},{sdfGlyphSize:o,sdfCanvas:r,contextLost:i},s){if(i)return Promise.resolve({timing:-1});let{textureWidth:a,sdfExponent:c}=AR,l=Math.max(n[2]-n[0],n[3]-n[1]),h=Math.floor(t/4),d=h%(a/o)*o,u=Math.floor(h/(a/o))*o,_=t%4;return t9o(o,o,e,n,l,c,r,d,u,_,s)}function d9o(e){let t=e.sdfCanvas;t.addEventListener("webglcontextlost",(n)=>{console.log("Context Lost",n),n.preventDefault(),e.contextLost=!0}),t.addEventListener("webglcontextrestored",(n)=>{console.log("Context Restored",n),e.contextLost=!1;let o=[];e.glyphsByFont.forEach((r)=>{r.forEach((i)=>{o.push(u4t(i,e,!0))})}),Promise.all(o).then(()=>{m4t(e),e.sdfTexture.needsUpdate=!0})})}function p4t(e,t){for(let n in t)if(t.hasOwnProperty(n))e[n]=t[n];return e}var ife;function o4t(e){if(!ife)ife=typeof document>"u"?{}:document.createElement("a");return ife.href=e,ife.href}function m4t(e){if(typeof createImageBitmap!=="function"){console.info("Safari<15: applying SDF canvas workaround");let{sdfCanvas:t,sdfTexture:n}=e,{width:o,height:r}=t,i=e.sdfCanvas.getContext("webgl"),s=n.image.data;if(!s||s.length!==o*r*4)s=new Uint8Array(o*r*4),n.image={width:o,height:r,data:s},n.flipY=!1,n.isDataTexture=!0;i.readPixels(0,0,o,r,i.RGBA,i.UNSIGNED_BYTE,s)}}var u9o=Fz({name:"Typesetter",dependencies:[e9o,ZIo,j5t],init(e,t,n){return e(t,n())}}),_4t=Fz({name:"Typesetter",dependencies:[u9o],init(e){return function(t){return new Promise((n)=>{e.typeset(t,n)})}},getTransferables(e){let t=[];for(let n in e)if(e[n]&&e[n].buffer)t.push(e[n].buffer);return t}}),p9o=_4t.onMainThread;var r4t={};function m9o(e){let t=r4t[e];if(!t)t=r4t[e]=new i1(1,1,e,e).translate(0.5,0.5,0);return t}var _9o="aTroikaGlyphBounds",i4t="aTroikaGlyphIndex",g9o="aTroikaGlyphColor";class g4t extends QQe{constructor(){super();this.detail=1,this.curveRadius=0,this.groups=[{start:0,count:1/0,materialIndex:0},{start:0,count:1/0,materialIndex:1}],this.boundingSphere=new v_,this.boundingBox=new Mu}computeBoundingSphere(){}computeBoundingBox(){}set detail(e){if(e!==this._detail){if(this._detail=e,typeof e!=="number"||e<1)e=1;let t=m9o(e);["position","normal","uv"].forEach((n)=>{this.attributes[n]=t.attributes[n].clone()}),this.setIndex(t.getIndex().clone())}}get detail(){return this._detail}set curveRadius(e){if(e!==this._curveRadius)this._curveRadius=e,this._updateBounds()}get curveRadius(){return this._curveRadius}updateGlyphs(e,t,n,o,r){this.updateAttributeData(_9o,e,4),this.updateAttributeData(i4t,t,1),this.updateAttributeData(g9o,r,3),this._blockBounds=n,this._chunkedBounds=o,this.instanceCount=t.length,this._updateBounds()}_updateBounds(){let e=this._blockBounds;if(e){let{curveRadius:t,boundingBox:n}=this;if(t){let{PI:o,floor:r,min:i,max:s,sin:a,cos:c}=Math,l=o/2,h=o*2,d=Math.abs(t),u=e[0]/d,_=e[2]/d,p=r((u+l)/h)!==r((_+l)/h)?-d:i(a(u)*d,a(_)*d),m=r((u-l)/h)!==r((_-l)/h)?d:s(a(u)*d,a(_)*d),A=r((u+o)/h)!==r((_+o)/h)?d*2:s(d-c(u)*d,d-c(_)*d);n.min.set(p,e[1],t<0?-A:0),n.max.set(m,e[3],t<0?0:A)}else n.min.set(e[0],e[1],0),n.max.set(e[2],e[3],0);n.getBoundingSphere(this.boundingSphere)}}applyClipRect(e){let t=this.getAttribute(i4t).count,n=this._chunkedBounds;if(n)for(let o=n.length;o--;){t=n[o].end;let r=n[o].rect;if(r[1]<e.w&&r[3]>e.y&&r[0]<e.z&&r[2]>e.x)break}this.instanceCount=t}updateAttributeData(e,t,n){let o=this.getAttribute(e);if(t)if(o&&o.array.length===t.length)o.array.set(t),o.needsUpdate=!0;else this.setAttribute(e,new Mz(t,n)),delete this._maxInstanceCount,this.dispose();else if(o)this.deleteAttribute(e)}}var A9o=`
uniform vec2 uTroikaSDFTextureSize;
uniform float uTroikaSDFGlyphSize;
uniform vec4 uTroikaTotalBounds;
uniform vec4 uTroikaClipRect;
uniform mat3 uTroikaOrient;
uniform bool uTroikaUseGlyphColors;
uniform float uTroikaEdgeOffset;
uniform float uTroikaBlurRadius;
uniform vec2 uTroikaPositionOffset;
uniform float uTroikaCurveRadius;
attribute vec4 aTroikaGlyphBounds;
attribute float aTroikaGlyphIndex;
attribute vec3 aTroikaGlyphColor;
varying vec2 vTroikaGlyphUV;
varying vec4 vTroikaTextureUVBounds;
varying float vTroikaTextureChannel;
varying vec3 vTroikaGlyphColor;
varying vec2 vTroikaGlyphDimensions;
`,f9o=`
vec4 bounds = aTroikaGlyphBounds;
bounds.xz += uTroikaPositionOffset.x;
bounds.yw -= uTroikaPositionOffset.y;

vec4 outlineBounds = vec4(
  bounds.xy - uTroikaEdgeOffset - uTroikaBlurRadius,
  bounds.zw + uTroikaEdgeOffset + uTroikaBlurRadius
);
vec4 clippedBounds = vec4(
  clamp(outlineBounds.xy, uTroikaClipRect.xy, uTroikaClipRect.zw),
  clamp(outlineBounds.zw, uTroikaClipRect.xy, uTroikaClipRect.zw)
);

vec2 clippedXY = (mix(clippedBounds.xy, clippedBounds.zw, position.xy) - bounds.xy) / (bounds.zw - bounds.xy);

position.xy = mix(bounds.xy, bounds.zw, clippedXY);

uv = (position.xy - uTroikaTotalBounds.xy) / (uTroikaTotalBounds.zw - uTroikaTotalBounds.xy);

float rad = uTroikaCurveRadius;
if (rad != 0.0) {
  float angle = position.x / rad;
  position.xz = vec2(sin(angle) * rad, rad - cos(angle) * rad);
  normal.xz = vec2(sin(angle), cos(angle));
}
  
position = uTroikaOrient * position;
normal = uTroikaOrient * normal;

vTroikaGlyphUV = clippedXY.xy;
vTroikaGlyphDimensions = vec2(bounds[2] - bounds[0], bounds[3] - bounds[1]);


float txCols = uTroikaSDFTextureSize.x / uTroikaSDFGlyphSize;
vec2 txUvPerSquare = uTroikaSDFGlyphSize / uTroikaSDFTextureSize;
vec2 txStartUV = txUvPerSquare * vec2(
  mod(floor(aTroikaGlyphIndex / 4.0), txCols),
  floor(floor(aTroikaGlyphIndex / 4.0) / txCols)
);
vTroikaTextureUVBounds = vec4(txStartUV, vec2(txStartUV) + txUvPerSquare);
vTroikaTextureChannel = mod(aTroikaGlyphIndex, 4.0);
`,y9o=`
uniform sampler2D uTroikaSDFTexture;
uniform vec2 uTroikaSDFTextureSize;
uniform float uTroikaSDFGlyphSize;
uniform float uTroikaSDFExponent;
uniform float uTroikaEdgeOffset;
uniform float uTroikaFillOpacity;
uniform float uTroikaBlurRadius;
uniform vec3 uTroikaStrokeColor;
uniform float uTroikaStrokeWidth;
uniform float uTroikaStrokeOpacity;
uniform bool uTroikaSDFDebug;
varying vec2 vTroikaGlyphUV;
varying vec4 vTroikaTextureUVBounds;
varying float vTroikaTextureChannel;
varying vec2 vTroikaGlyphDimensions;

float troikaSdfValueToSignedDistance(float alpha) {
  // Inverse of exponential encoding in webgl-sdf-generator
  
  float maxDimension = max(vTroikaGlyphDimensions.x, vTroikaGlyphDimensions.y);
  float absDist = (1.0 - pow(2.0 * (alpha > 0.5 ? 1.0 - alpha : alpha), 1.0 / uTroikaSDFExponent)) * maxDimension;
  float signedDist = absDist * (alpha > 0.5 ? -1.0 : 1.0);
  return signedDist;
}

float troikaGlyphUvToSdfValue(vec2 glyphUV) {
  vec2 textureUV = mix(vTroikaTextureUVBounds.xy, vTroikaTextureUVBounds.zw, glyphUV);
  vec4 rgba = texture2D(uTroikaSDFTexture, textureUV);
  float ch = floor(vTroikaTextureChannel + 0.5); //NOTE: can't use round() in WebGL1
  return ch == 0.0 ? rgba.r : ch == 1.0 ? rgba.g : ch == 2.0 ? rgba.b : rgba.a;
}

float troikaGlyphUvToDistance(vec2 uv) {
  return troikaSdfValueToSignedDistance(troikaGlyphUvToSdfValue(uv));
}

float troikaGetAADist() {
  
  #if defined(GL_OES_standard_derivatives) || __VERSION__ >= 300
  return length(fwidth(vTroikaGlyphUV * vTroikaGlyphDimensions)) * 0.5;
  #else
  return vTroikaGlyphDimensions.x / 64.0;
  #endif
}

float troikaGetFragDistValue() {
  vec2 clampedGlyphUV = clamp(vTroikaGlyphUV, 0.5 / uTroikaSDFGlyphSize, 1.0 - 0.5 / uTroikaSDFGlyphSize);
  float distance = troikaGlyphUvToDistance(clampedGlyphUV);
 
  // Extrapolate distance when outside bounds:
  distance += clampedGlyphUV == vTroikaGlyphUV ? 0.0 : 
    length((vTroikaGlyphUV - clampedGlyphUV) * vTroikaGlyphDimensions);

  

  return distance;
}

float troikaGetEdgeAlpha(float distance, float distanceOffset, float aaDist) {
  #if defined(IS_DEPTH_MATERIAL) || defined(IS_DISTANCE_MATERIAL)
  float alpha = step(-distanceOffset, -distance);
  #else

  float alpha = smoothstep(
    distanceOffset + aaDist,
    distanceOffset - aaDist,
    distance
  );
  #endif

  return alpha;
}
`,x9o=`
float aaDist = troikaGetAADist();
float fragDistance = troikaGetFragDistValue();
float edgeAlpha = uTroikaSDFDebug ?
  troikaGlyphUvToSdfValue(vTroikaGlyphUV) :
  troikaGetEdgeAlpha(fragDistance, uTroikaEdgeOffset, max(aaDist, uTroikaBlurRadius));

#if !defined(IS_DEPTH_MATERIAL) && !defined(IS_DISTANCE_MATERIAL)
vec4 fillRGBA = gl_FragColor;
fillRGBA.a *= uTroikaFillOpacity;
vec4 strokeRGBA = uTroikaStrokeWidth == 0.0 ? fillRGBA : vec4(uTroikaStrokeColor, uTroikaStrokeOpacity);
if (fillRGBA.a == 0.0) fillRGBA.rgb = strokeRGBA.rgb;
gl_FragColor = mix(fillRGBA, strokeRGBA, smoothstep(
  -uTroikaStrokeWidth - aaDist,
  -uTroikaStrokeWidth + aaDist,
  fragDistance
));
gl_FragColor.a *= edgeAlpha;
#endif

if (edgeAlpha == 0.0) {
  discard;
}
`;function C9o(e){let t=rfe(e,{chained:!0,extensions:{derivatives:!0},uniforms:{uTroikaSDFTexture:{value:null},uTroikaSDFTextureSize:{value:new ro},uTroikaSDFGlyphSize:{value:0},uTroikaSDFExponent:{value:0},uTroikaTotalBounds:{value:new zh(0,0,0,0)},uTroikaClipRect:{value:new zh(0,0,0,0)},uTroikaEdgeOffset:{value:0},uTroikaFillOpacity:{value:1},uTroikaPositionOffset:{value:new ro},uTroikaCurveRadius:{value:0},uTroikaBlurRadius:{value:0},uTroikaStrokeWidth:{value:0},uTroikaStrokeColor:{value:new No},uTroikaStrokeOpacity:{value:1},uTroikaOrient:{value:new Ya},uTroikaUseGlyphColors:{value:!0},uTroikaSDFDebug:{value:!1}},vertexDefs:A9o,vertexTransform:f9o,fragmentDefs:y9o,fragmentColorTransform:x9o,customRewriter({vertexShader:n,fragmentShader:o}){let r=/\buniform\s+vec3\s+diffuse\b/;if(r.test(o)){if(o=o.replace(r,"varying vec3 vTroikaGlyphColor").replace(/\bdiffuse\b/g,"vTroikaGlyphColor"),!r.test(n))n=n.replace(UQe,`uniform vec3 diffuse;
$&
vTroikaGlyphColor = uTroikaUseGlyphColors ? aTroikaGlyphColor / 255.0 : diffuse;
`)}return{vertexShader:n,fragmentShader:o}}});return t.transparent=!0,t.forceSinglePass=!0,Object.defineProperties(t,{isTroikaTextMaterial:{value:!0},shadowSide:{get(){return this.side},set(){}}}),t}var KQe=new Up({color:16777215,side:bd,transparent:!0}),s4t=8421504,a4t=new Gi,sfe=new Et,WQe=new Et,rie=[],b9o=new Et,XQe="+x+y";function c4t(e){return Array.isArray(e)?e[0]:e}var A4t=()=>{let e=new Mo(new i1(1,1),KQe);return A4t=()=>e,e},f4t=()=>{let e=new Mo(new i1(1,1,32,1),KQe);return f4t=()=>e,e},I9o={type:"syncstart"},v9o={type:"synccomplete"},y4t=["font","fontSize","fontStyle","fontWeight","lang","letterSpacing","lineHeight","maxWidth","overflowWrap","text","direction","textAlign","textIndent","whiteSpace","anchorX","anchorY","colorRanges","sdfGlyphSize"],S9o=y4t.concat("material","color","depthOffset","clipRect","curveRadius","orientation","glyphGeometryDetail");class nj extends Mo{constructor(){let e=new g4t;super(e,null);this.text="",this.anchorX=0,this.anchorY=0,this.curveRadius=0,this.direction="auto",this.font=null,this.unicodeFontsURL=null,this.fontSize=0.1,this.fontWeight="normal",this.fontStyle="normal",this.lang=null,this.letterSpacing=0,this.lineHeight="normal",this.maxWidth=1/0,this.overflowWrap="normal",this.textAlign="left",this.textIndent=0,this.whiteSpace="normal",this.material=null,this.color=null,this.colorRanges=null,this.outlineWidth=0,this.outlineColor=0,this.outlineOpacity=1,this.outlineBlur=0,this.outlineOffsetX=0,this.outlineOffsetY=0,this.strokeWidth=0,this.strokeColor=s4t,this.strokeOpacity=1,this.fillOpacity=1,this.depthOffset=0,this.clipRect=null,this.orientation=XQe,this.glyphGeometryDetail=1,this.sdfGlyphSize=null,this.gpuAccelerateSDF=!0,this.debugSDF=!1}sync(e){if(this._needsSync)if(this._needsSync=!1,this._isSyncing)(this._queuedSyncs||(this._queuedSyncs=[])).push(e);else this._isSyncing=!0,this.dispatchEvent(I9o),h9o({text:this.text,font:this.font,lang:this.lang,fontSize:this.fontSize||0.1,fontWeight:this.fontWeight||"normal",fontStyle:this.fontStyle||"normal",letterSpacing:this.letterSpacing||0,lineHeight:this.lineHeight||"normal",maxWidth:this.maxWidth,direction:this.direction||"auto",textAlign:this.textAlign,textIndent:this.textIndent,whiteSpace:this.whiteSpace,overflowWrap:this.overflowWrap,anchorX:this.anchorX,anchorY:this.anchorY,colorRanges:this.colorRanges,includeCaretPositions:!0,sdfGlyphSize:this.sdfGlyphSize,gpuAccelerateSDF:this.gpuAccelerateSDF,unicodeFontsURL:this.unicodeFontsURL},(t)=>{this._isSyncing=!1,this._textRenderInfo=t,this.geometry.updateGlyphs(t.glyphBounds,t.glyphAtlasIndices,t.blockBounds,t.chunkedBounds,t.glyphColors);let n=this._queuedSyncs;if(n)this._queuedSyncs=null,this._needsSync=!0,this.sync(()=>{n.forEach((o)=>o&&o())});if(this.dispatchEvent(v9o),e)e()})}onBeforeRender(e,t,n,o,r,i){if(this.sync(),r.isTroikaTextMaterial)this._prepareForRender(r)}dispose(){this.geometry.dispose()}get textRenderInfo(){return this._textRenderInfo||null}createDerivedMaterial(e){return C9o(e)}get material(){let e=this._derivedMaterial,t=this._baseMaterial||this._defaultMaterial||(this._defaultMaterial=KQe.clone());if(!e||!e.isDerivedFrom(t))e=this._derivedMaterial=this.createDerivedMaterial(t),t.addEventListener("dispose",function n(){t.removeEventListener("dispose",n),e.dispose()});if(this.hasOutline()){let n=e._outlineMtl;if(!n)n=e._outlineMtl=Object.create(e,{id:{value:e.id+0.1}}),n.isTextOutlineMaterial=!0,n.depthWrite=!1,n.map=null,e.addEventListener("dispose",function o(){e.removeEventListener("dispose",o),n.dispose()});return[n,e]}else return e}set material(e){if(e&&e.isTroikaTextMaterial)this._derivedMaterial=e,this._baseMaterial=e.baseMaterial;else this._baseMaterial=e}hasOutline(){return!!(this.outlineWidth||this.outlineBlur||this.outlineOffsetX||this.outlineOffsetY)}get glyphGeometryDetail(){return this.geometry.detail}set glyphGeometryDetail(e){this.geometry.detail=e}get curveRadius(){return this.geometry.curveRadius}set curveRadius(e){this.geometry.curveRadius=e}get customDepthMaterial(){return c4t(this.material).getDepthMaterial()}set customDepthMaterial(e){}get customDistanceMaterial(){return c4t(this.material).getDistanceMaterial()}set customDistanceMaterial(e){}_prepareForRender(e){let{isTextOutlineMaterial:t,uniforms:n}=e,o=this.textRenderInfo;if(o){let{sdfTexture:s,blockBounds:a}=o;n.uTroikaSDFTexture.value=s,n.uTroikaSDFTextureSize.value.set(s.image.width,s.image.height),n.uTroikaSDFGlyphSize.value=o.sdfGlyphSize,n.uTroikaSDFExponent.value=o.sdfExponent,n.uTroikaTotalBounds.value.fromArray(a),n.uTroikaUseGlyphColors.value=!t&&!!o.glyphColors;let c=0,l=0,h=0,d,u,_,p=0,m=0;if(t){let{outlineWidth:g,outlineOffsetX:f,outlineOffsetY:y,outlineBlur:x,outlineOpacity:C}=this;c=this._parsePercent(g)||0,l=Math.max(0,this._parsePercent(x)||0),d=C,p=this._parsePercent(f)||0,m=this._parsePercent(y)||0}else{if(h=Math.max(0,this._parsePercent(this.strokeWidth)||0),h){if(_=this.strokeColor,n.uTroikaStrokeColor.value.set(_==null?s4t:_),u=this.strokeOpacity,u==null)u=1}d=this.fillOpacity}n.uTroikaEdgeOffset.value=c,n.uTroikaPositionOffset.value.set(p,m),n.uTroikaBlurRadius.value=l,n.uTroikaStrokeWidth.value=h,n.uTroikaStrokeOpacity.value=u,n.uTroikaFillOpacity.value=d==null?1:d,n.uTroikaCurveRadius.value=this.curveRadius||0;let A=this.clipRect;if(A&&Array.isArray(A)&&A.length===4)n.uTroikaClipRect.value.fromArray(A);else{let g=(this.fontSize||0.1)*100;n.uTroikaClipRect.value.set(a[0]-g,a[1]-g,a[2]+g,a[3]+g)}this.geometry.applyClipRect(n.uTroikaClipRect.value)}n.uTroikaSDFDebug.value=!!this.debugSDF,e.polygonOffset=!!this.depthOffset,e.polygonOffsetFactor=e.polygonOffsetUnits=this.depthOffset||0;let r=t?this.outlineColor||0:this.color;if(r==null)delete e.color;else{let s=e.hasOwnProperty("color")?e.color:e.color=new No;if(r!==s._input||typeof r==="object")s.set(s._input=r)}let i=this.orientation||XQe;if(i!==e._orientation){let s=n.uTroikaOrient.value;i=i.replace(/[^-+xyz]/g,"");let a=i!==XQe&&i.match(/^([-+])([xyz])([-+])([xyz])$/);if(a){let[,c,l,h,d]=a;sfe.set(0,0,0)[l]=c==="-"?1:-1,WQe.set(0,0,0)[d]=h==="-"?-1:1,a4t.lookAt(b9o,sfe.cross(WQe),WQe),s.setFromMatrix4(a4t)}else s.identity();e._orientation=i}}_parsePercent(e){if(typeof e==="string"){let t=e.match(/^(-?[\d.]+)%$/),n=t?parseFloat(t[1]):NaN;e=(isNaN(n)?0:n/100)*this.fontSize}return e}localPositionToTextCoords(e,t=new ro){t.copy(e);let n=this.curveRadius;if(n)t.x=Math.atan2(e.x,Math.abs(n)-Math.abs(e.z))*Math.abs(n);return t}worldPositionToTextCoords(e,t=new ro){return sfe.copy(e),this.localPositionToTextCoords(this.worldToLocal(sfe),t)}raycast(e,t){let{textRenderInfo:n,curveRadius:o}=this;if(n){let r=n.blockBounds,i=o?f4t():A4t(),s=i.geometry,{position:a,uv:c}=s.attributes;for(let l=0;l<c.count;l++){let h=r[0]+c.getX(l)*(r[2]-r[0]),d=r[1]+c.getY(l)*(r[3]-r[1]),u=0;if(o)u=o-Math.cos(h/o)*o,h=Math.sin(h/o)*o;a.setXYZ(l,h,d,u)}s.boundingSphere=this.geometry.boundingSphere,s.boundingBox=this.geometry.boundingBox,i.matrixWorld=this.matrixWorld,i.material.side=this.material.side,rie.length=0,i.raycast(e,rie);for(let l=0;l<rie.length;l++)rie[l].object=this,t.push(rie[l])}}copy(e){let t=this.geometry;return super.copy(e),this.geometry=t,S9o.forEach((n)=>{this[n]=e[n]}),this}clone(){return new this.constructor().copy(this)}}y4t.forEach((e)=>{let t="_private_"+e;Object.defineProperty(nj.prototype,e,{get(){return this[t]},set(n){if(n!==this[t])this[t]=n,this._needsSync=!0}})});var sAs=new Mu,aAs=new No;var Sh=at(ln(),1);er();function QR([e,t],[n,o],{lineThickness:r=0}={}){if(r===0)return GA(e,t,n,o);return jSo(e,t,n,o)<=r}function GA(e,t,n,o){let r=Wie(e,t,n),i=Wie(e,t,o),s=Wie(n,o,e),a=Wie(n,o,t);if(r!==i&&s!==a)return!0;if(r===0&&hO(e,n,t))return!0;if(i===0&&hO(e,o,t))return!0;if(s===0&&hO(n,e,o))return!0;if(a===0&&hO(n,t,o))return!0;return!1}function Wie(e,t,n){let o=(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y);if(o===0)return 0;return o>0?1:2}function hO(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function jSo(e,t,n,o){if(e.x===t.x&&e.y===t.y)return ga(e,n,o);if(n.x===o.x&&n.y===o.y)return ga(n,e,t);if(GA(e,t,n,o))return 0;let r=[ga(e,n,o),ga(t,n,o),ga(n,e,t),ga(o,e,t)];return Math.min(...r)}function ga(e,t,n){let o=(n.x-t.x)**2+(n.y-t.y)**2;if(o===0)return Jl(e,t);let r=((e.x-t.x)*(n.x-t.x)+(e.y-t.y)*(n.y-t.y))/o;r=Math.max(0,Math.min(1,r));let i={x:t.x+r*(n.x-t.x),y:t.y+r*(n.y-t.y)};return Jl(e,i)}function Jl(e,t){let n=e.x-t.x,o=e.y-t.y;return Math.sqrt(n*n+o*o)}function c2e(e,t,n,o){let r=t.x-e.x,i=t.y-e.y,s=o.x-n.x,a=o.y-n.y,c=e.x-n.x,l=e.y-n.y,h=r*a-i*s;if(Math.abs(h)<0.0000000001)return null;let d=(l*s-c*a)/h,u=(r*l-i*c)/h,_=0.000000001;if(d>=-_&&d<=1+_&&u>=-_&&u<=1+_){let p=e.x+d*r,m=e.y+d*i;return{x:p,y:m}}return null}function Xie(e,t,n){let o=(c)=>c.x>=n.minX&&c.x<=n.maxX&&c.y>=n.minY&&c.y<=n.maxY;if(o(e)||o(t))return!0;let r={x:n.minX,y:n.minY},i={x:n.maxX,y:n.minY},s={x:n.minX,y:n.maxY},a={x:n.maxX,y:n.maxY};return GA(e,t,r,i)||GA(e,t,i,a)||GA(e,t,a,s)||GA(e,t,s,r)}var KSo=(e)=>{let t=[];for(let n=0;n<e.length;n++){let o=e[n],r=e[(n+1)%e.length];t.push([o,r])}return t},$So=(e,t,n)=>{let o=(e.y-t.y)*(n.x-t.x)-(e.x-t.x)*(n.y-t.y);if(Math.abs(o)>0.000000001)return!1;let r=(e.x-t.x)*(n.x-t.x)+(e.y-t.y)*(n.y-t.y);if(r<0)return!1;let i=(n.x-t.x)**2+(n.y-t.y)**2;if(i===0)return!1;if(r>i)return!1;return!0};var Db=(e,t)=>{if(t.length<3)return!1;let n=KSo(t);for(let[r,i]of n)if($So(e,r,i))return!0;let o=!1;for(let r=0,i=t.length-1;r<t.length;i=r++){let s=t[r].x,a=t[r].y,c=t[i].x,l=t[i].y;if(a>e.y!==l>e.y&&e.x<(c-s)*(e.y-a)/(l-a)+s)o=!o}return o};function kR(e){let t=e.width/2,n=e.height/2;return{minX:e.center.x-t,maxX:e.center.x+t,minY:e.center.y-n,maxY:e.center.y+n}}function l2e(e,t){let n=kR(e),o=kR(t),r=Math.max(n.minX-o.maxX,o.minX-n.maxX,0),i=Math.max(n.minY-o.maxY,o.minY-n.maxY,0),s={x:0,y:0},a={x:0,y:0};if(r===0&&i===0)return{distance:0,pointA:e.center,pointB:t.center};return s.x=td(e.center.x,o.minX,o.maxX),s.y=td(e.center.y,o.minY,o.maxY),a.x=td(t.center.x,n.minX,n.maxX),a.y=td(t.center.y,n.minY,n.maxY),{distance:Math.hypot(s.x-a.x,s.y-a.y),pointA:s,pointB:a}}function Ew(e,t){return l2e(e,t)}function td(e,t,n){return Math.max(t,Math.min(n,e))}function h2e(e,t){let n=Number.POSITIVE_INFINITY,o={x:0,y:0},r={x:0,y:0};for(let i of e)for(let s of t){let{distance:a,pointA:c,pointB:l}=l2e(i,s);if(a<n)n=a,o=c,r=l}return{pointA:o,pointB:r,distance:n}}function c5(e,t,n,o){if(e.x===t.x&&e.y===t.y)return ga(e,n,o);if(n.x===o.x&&n.y===o.y)return ga(n,e,t);if(GA(e,t,n,o))return 0;let r=[ga(e,n,o),ga(t,n,o),ga(n,e,t),ga(o,e,t)];return Math.min(...r)}function tHe(e,t,n){let o={x:n.minX,y:n.minY},r={x:n.maxX,y:n.minY},i={x:n.minX,y:n.maxY},s={x:n.maxX,y:n.maxY};if(GA(e,t,o,r)||GA(e,t,r,s)||GA(e,t,s,i)||GA(e,t,i,o))return 0;if(e.x>=n.minX&&e.x<=n.maxX&&e.y>=n.minY&&e.y<=n.maxY&&t.x>=n.minX&&t.x<=n.maxX&&t.y>=n.minY&&t.y<=n.maxY)return 0;let a=[ga(o,e,t),ga(r,e,t),ga(i,e,t),ga(s,e,t)];if(e.x>=n.minX&&e.x<=n.maxX&&e.y>=n.minY&&e.y<=n.maxY)return 0;if(t.x>=n.minX&&t.x<=n.maxX&&t.y>=n.minY&&t.y<=n.maxY)return 0;if(e.x<n.minX||e.x>n.maxX||e.y<n.minY||e.y>n.maxY){let c=td(e.x,n.minX,n.maxX),l=td(e.y,n.minY,n.maxY);a.push(Jl(e,{x:c,y:l}))}if(t.x<n.minX||t.x>n.maxX||t.y<n.minY||t.y>n.maxY){let c=td(t.x,n.minX,n.maxX),l=td(t.y,n.minY,n.maxY);a.push(Jl(t,{x:c,y:l}))}return Math.min(...a)}function jie(e,t,n){let o={x:n.x,y:n.y};if(e.x===t.x&&e.y===t.y)return Math.max(0,Jl(e,o)-n.radius);let r={x:t.x-e.x,y:t.y-e.y},i={x:o.x-e.x,y:o.y-e.y},s=r.x*r.x+r.y*r.y,a=Math.max(0,Math.min(1,(r.x*i.x+r.y*i.y)/s)),c={x:e.x+a*r.x,y:e.y+a*r.y},l=Jl(c,o);return Math.max(0,l-n.radius)}function Ly(e,t,n){let o=n.x-t.x,r=n.y-t.y,i=o*o+r*r;if(i===0)return{x:t.x,y:t.y};let s=((e.x-t.x)*o+(e.y-t.y)*r)/i;return s=Math.max(0,Math.min(1,s)),{x:t.x+s*o,y:t.y+s*r}}var Lj=(e,t)=>{let n={x:t.x-e.x,y:t.y-e.y},o=Math.sqrt(n.x**2+n.y**2);return{x:n.x/o,y:n.y/o}},Z7=(e)=>{switch(e){case"up":return{x:0,y:1};case"down":return{x:0,y:-1};case"left":return{x:-1,y:0};case"right":return{x:1,y:0}}};function nHe({rows:e,cols:t,xSpacing:n,ySpacing:o,width:r,height:i,offsetX:s=0,offsetY:a=0,yDirection:c="cartesian",centered:l=!0}){let h=n??1,d=o??1,u=r??t*h,_=i??e*d,p=l?-u/2:0,m=l?-_/2:0,A=r?r/t:h,g=i?i/e:d,f=[];for(let y=0;y<e;y++)for(let x=0;x<t;x++){let C=y*t+x,b=s+p+x*A+A/2,I=a+y*g+g/2,v=c==="cartesian"?a+m+(e-1-y)*g+g/2:a+m+y*g+g/2;f.push({index:C,center:{x:b,y:v},topLeft:{x:b-A/2,y:v+g/2},bottomRight:{x:b+A/2,y:v-g/2},row:y,col:x})}return f}function Bu(e){return(e%360+360)%360}function oHe(e,t){let n=t.width/2,o=t.height/2,r=t.center.x-n,i=t.center.x+n,s=t.center.y-o,a=t.center.y+o;if(e.x>=r&&e.x<=i&&e.y>=s&&e.y<=a)return 0;let c=td(e.x,r,i),l=td(e.y,s,a);return Jl(e,{x:c,y:l})}function rHe(e,t){if(e.x>=t.minX&&e.x<=t.maxX&&e.y>=t.minY&&e.y<=t.maxY)return 0;let n=td(e.x,t.minX,t.maxX),o=td(e.y,t.minY,t.maxY);return Jl(e,{x:n,y:o})}function dO(e,t){return{x:(e.x+t.x)/2,y:(e.y+t.y)/2}}function Hj(e,t){let n=e.x-t.x,o=e.y-t.y;return n*n+o*o}var iHe=(e,t)=>{let n=Math.max(0,Math.min(e.maxX,t.maxX)-Math.max(e.minX,t.minX)),o=Math.max(0,Math.min(e.maxY,t.maxY)-Math.max(e.minY,t.minY));return n*o};var LR=(e,t)=>{let n=e.maxX<t.minX?t.minX-e.maxX:t.maxX<e.minX?e.minX-t.maxX:0,o=e.maxY<t.minY?t.minY-e.maxY:t.maxY<e.minY?e.minY-t.maxY:0;return Math.sqrt(n*n+o*o)};var qp=(e,t)=>!(e.maxX<t.minX||t.maxX<e.minX||e.maxY<t.minY||t.maxY<e.minY);var Pd=(e)=>{let{center:t,width:n,height:o}=e,r=n/2,i=o/2;return{minX:t.x-r,maxX:t.x+r,minY:t.y-i,maxY:t.y+i}};var m3=(e)=>({x:(e.minX+e.maxX)/2,y:(e.minY+e.maxY)/2});var Hs=(e)=>{if(e.length===0)return null;let t=e[0].x,n=e[0].y,o=e[0].x,r=e[0].y;for(let i=1;i<e.length;i++){let s=e[i];if(s.x<t)t=s.x;if(s.y<n)n=s.y;if(s.x>o)o=s.x;if(s.y>r)r=s.y}return{minX:t,minY:n,maxX:o,maxY:r}};qt();yc();$p();er();$p();qt();er();er();er();qt();class d2e{constructor(e=1/0,t=Float64Array,n=Uint32Array){let o=e!==1/0;this.ids=o?new n(e):[],this.values=o?new t(e):[],this.capacity=e,this.length=0}clear(){this.length=0}push(e,t){if(this.length===this.capacity)throw RangeError("Queue is at capacity.");let n=this.length++;while(n>0){let o=n-1>>1,r=this.values[o];if(t>=r)break;this.ids[n]=this.ids[o],this.values[n]=r,n=o}this.ids[n]=e,this.values[n]=t}pop(){if(this.length===0)return;let e=this.ids,t=this.values,n=e[0],o=--this.length;if(o>0){let r=e[o],i=t[o],s=0,a=o>>1;while(s<a){let c=(s<<1)+1,l=c+1,h=c+(+(l<o)&+(t[l]<t[c]));if(t[h]>=i)break;e[s]=e[h],t[s]=t[h],s=h}e[s]=r,t[s]=i}return n}peek(){return this.length>0?this.ids[0]:void 0}peekValue(){return this.length>0?this.values[0]:void 0}shrink(){if(Array.isArray(this.ids))this.ids.length=this.length;if(Array.isArray(this.values))this.values.length=this.length}}var mvt=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],lHe=3;class _3{static from(e,t=0){if(t%8!==0)throw Error("byteOffset must be 8-byte aligned.");if(!e||e.byteLength===void 0||"buffer"in e)throw Error("Data must be an instance of ArrayBuffer or SharedArrayBuffer.");let[n,o]=new Uint8Array(e,t+0,2);if(n!==251)throw Error("Data does not appear to be in a Flatbush format.");let r=o>>4;if(r!==lHe)throw Error(`Got v${r} data when expected v${lHe}.`);let i=mvt[o&15];if(!i)throw Error("Unrecognized array type.");let[s]=new Uint16Array(e,t+2,1),[a]=new Uint32Array(e,t+4,1);return new _3(a,s,i,void 0,e,t)}constructor(e,t=16,n=Float64Array,o=ArrayBuffer,r,i=0){if(e===void 0)throw Error("Missing required argument: numItems.");if(isNaN(e)||e<=0)throw Error(`Unexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+t,2),65535),this.byteOffset=i;let s=e,a=s;this._levelBounds=[s*4];do s=Math.ceil(s/this.nodeSize),a+=s,this._levelBounds.push(a*4);while(s!==1);this.ArrayType=n,this.IndexArrayType=a<16384?Uint16Array:Uint32Array;let c=mvt.indexOf(n),l=a*4*n.BYTES_PER_ELEMENT;if(c<0)throw Error(`Unexpected typed array class: ${n}.`);let h=n,d=this.IndexArrayType;if(r)this.data=r,this._boxes=new h(r,i+8,a*4),this._indices=new d(r,i+8+l,a),this._pos=a*4,this.minX=this._boxes[this._pos-4],this.minY=this._boxes[this._pos-3],this.maxX=this._boxes[this._pos-2],this.maxY=this._boxes[this._pos-1];else{let u=this.data=new o(8+l+a*this.IndexArrayType.BYTES_PER_ELEMENT);this._boxes=new h(u,8,a*4),this._indices=new d(u,8+l,a),this._pos=0,this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,new Uint8Array(u,0,2).set([251,(lHe<<4)+c]),new Uint16Array(u,2,1)[0]=t,new Uint32Array(u,4,1)[0]=e}this._queue=new d2e}add(e,t,n=e,o=t){let r=this._pos,i=r>>2,s=this._boxes;if(this._indices[i]=i,s[r]=e,s[r+1]=t,s[r+2]=n,s[r+3]=o,this._pos=r+4,e<this.minX)this.minX=e;if(t<this.minY)this.minY=t;if(n>this.maxX)this.maxX=n;if(o>this.maxY)this.maxY=o;return i}finish(){if(this._pos>>2!==this.numItems)throw Error(`Added ${this._pos>>2} items when expected ${this.numItems}.`);let e=this._boxes;if(this.numItems<=this.nodeSize){e[this._pos++]=this.minX,e[this._pos++]=this.minY,e[this._pos++]=this.maxX,e[this._pos++]=this.maxY;return}let{numItems:t,minX:n,minY:o,nodeSize:r,_indices:i,_levelBounds:s}=this,a=this.maxX-n||1,c=this.maxY-o||1,l=new Int32Array(t),h=65535,d=h/a,u=h/c;for(let p=0,m=0;p<t;p++){let A=e[m++],g=e[m++],f=e[m++],y=e[m++],x=d*((A+f)/2-n)|0,C=u*((g+y)/2-o)|0;l[p]=sPo(x,C)}rPo(l,e,i,0,t-1,r);let _=t*4;for(let p=0,m=0;p<s.length-1;p++){let A=s[p];while(m<A){let g=m,f=e[m++],y=e[m++],x=e[m++],C=e[m++];for(let b=1;b<r&&m<A;b++)f=Math.min(f,e[m++]),y=Math.min(y,e[m++]),x=Math.max(x,e[m++]),C=Math.max(C,e[m++]);i[_>>2]=g,e[_++]=f,e[_++]=y,e[_++]=x,e[_++]=C}}this._pos=_}search(e,t,n,o,r){if(this._pos!==this._boxes.length)throw Error("Data not yet indexed - call index.finish().");let{_boxes:i,_levelBounds:s,_indices:a,nodeSize:c}=this,l=this.numItems*4,h=i.length-4,d=s.length-1,u=[],_=[],p=!1;while(h!==void 0){let m=Math.min(h+c*4,s[d]),A=h>=l;if(p)this._collectContained(h,m,d,l,_,r);else for(let g=h;g<m;g+=4){let f=i[g];if(n<f)continue;let y=i[g+1];if(o<y)continue;let x=i[g+2];if(e>x)continue;let C=i[g+3];if(t>C)continue;let b=a[g>>2]|0;if(A){let I=+(e<=f&&t<=y&&n>=x&&o>=C);u.push(b|I,d-1)}else if(r===void 0||r(b,f,y,x,C))_.push(b)}if(d=u.pop(),h=u.pop(),h!==void 0)p=(h&1)===1,h&=-2}return _}_collectContained(e,t,n,o,r,i){let s=this._boxes,a=this._indices,c=e;for(let h=n;h>0;h--)c=a[c>>2];let l=Math.min(c+(t-e)*this.nodeSize**n,o);if(i===void 0)for(;c<l;c+=4)r.push(a[c>>2]|0);else for(;c<l;c+=4){let h=a[c>>2]|0;if(i(h,s[c],s[c+1],s[c+2],s[c+3]))r.push(h)}}neighbors(e,t,n=1/0,o=1/0,r){if(this._pos!==this._boxes.length)throw Error("Data not yet indexed - call index.finish().");let{_boxes:i,_levelBounds:s,_indices:a,_queue:c,nodeSize:l}=this,h=this.numItems*4,d=l*4,u=[],_=o*o,p=n===1,m=_;c.push(i.length-4<<1,0);while(c.length){let A=c.ids[0];if(A&1){if(c.pop(),u.push(A>>1),u.length===n)break;continue}c.pop();let g=A>>1,f=g<h,y=Math.min(g+d,oPo(g,s));for(let x=g;x<y;x+=4){let C=i[x],b=i[x+1],I=i[x+2],v=i[x+3],P=Math.max(Math.max(C-e,e-I),0),M=Math.max(Math.max(b-t,t-v),0),B=P*P+M*M;if(B>m)continue;let T=a[x>>2]|0;if(f){if(r===void 0||r(T)){if(c.push(T<<1|1,B),p&&B<m)m=B}}else c.push(T<<1,B)}}return c.clear(),u}}function oPo(e,t){let n=0,o=t.length-1;while(n<o){let r=n+o>>1;if(t[r]>e)o=r;else n=r+1}return t[n]}function rPo(e,t,n,o,r,i){let s=[o,r];while(s.length){let a=s.pop()||0,c=s.pop()||0;if(a-c<=i&&Math.floor(c/i)>=Math.floor(a/i))continue;let l=e[c],h=e[c+a>>1],d=e[a],u=l>h!==l>d?l:h<l!==h<d?h:d,_=c-1,p=a+1;while(!0){do _++;while(e[_]<u);do p--;while(e[p]>u);if(_>=p)break;iPo(e,t,n,_,p)}s.push(c,p,p+1,a)}}function iPo(e,t,n,o,r){let i=e[o];e[o]=e[r],e[r]=i;let s=4*o,a=4*r,c=t[s],l=t[s+1],h=t[s+2],d=t[s+3];t[s]=t[a],t[s+1]=t[a+1],t[s+2]=t[a+2],t[s+3]=t[a+3],t[a]=c,t[a+1]=l,t[a+2]=h,t[a+3]=d;let u=n[o];n[o]=n[r],n[r]=u}function sPo(e,t){let n=e^t,o=65535^n,r=65535^(e|t),i=e&(t^65535),s=n|o>>1,a=n>>1^n,c=r^(r>>1^o&i>>1),l=i^(n&r>>1^i>>1);return n=s&s>>2^a&a>>2,o=s&a>>2^a&(s^a)>>2,r=c^(s&c>>2^a&l>>2),i=l^(a&c>>2^(s^a)&l>>2),s=n&n>>4^o&o>>4,a=n&o>>4^o&(n^o)>>4,c=r^(n&r>>4^o&i>>4),l=i^(o&r>>4^(n^o)&i>>4),r=c^(s&c>>8^a&l>>8),i=l^(a&c>>8^(s^a)&l>>8),r^=r>>1,i^=i>>1,n=e^t,o=i|65535^(n|r),n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,o=(o|o<<8)&16711935,o=(o|o<<4)&252645135,o=(o|o<<2)&858993459,o=(o|o<<1)&1431655765,((o<<1|n)>>>0)-2147483648}$p();$p();$p();$p();$p();$p();yc();qt();yc();qt();er();yc();er();$p();er();er();yc();er();$p();var j2e=at(As(),1);$p();er();er();yc();yc();$p();er();yc();yc();var K2e=at(As(),1);yc();qt();er();qt();er();er();yc();er();er();bp();yc();er();bp();yc();bp();yc();er();bp();yc();er();qt();yc();qt();er();er();er();var _vt=at(As(),1);var u2e=0.6,p2e=1;var aPo=at(As(),1);var cPo=(e)=>(e.ccwRotationDegrees??0)*Math.PI/180;var lPo=(e,t)=>{let n=Math.cos(t),o=Math.sin(t);return{x:e.x*n-e.y*o,y:e.x*o+e.y*n}},hHe=(e)=>hPo(e,cPo(e));var hPo=(e,t)=>{let n=e.width/2,o=e.height/2;return[{x:-n,y:-o},{x:n,y:-o},{x:n,y:o},{x:-n,y:o}].map((r)=>{let i=lPo(r,t);return{x:e.center.x+i.x,y:e.center.y+i.y}})};var dPo=2,uPo=12,pPo=12,m2e=(e)=>({tip:{...e},base:{...e},leftWing:{...e},rightWing:{...e}}),gvt=(e,t,n)=>{let o=e.x-t.x,r=e.y-t.y,i=Math.hypot(o,r);if(i===0)return m2e(e);let s=o/i,c=-(r/i)*(n/2),l=s*(n/2);return{tip:{...e},base:{...t},leftWing:{x:t.x+c,y:t.y+l},rightWing:{x:t.x-c,y:t.y-l}}};function _2e(e){let{start:t,end:n}=e,o=n.x-t.x,r=n.y-t.y,i=Math.hypot(o,r),s=dPo,a=uPo;if(i===0){let f=e.doubleSided?[m2e(t),m2e(t)]:[m2e(t)];return{shaftStart:{...t},shaftEnd:{...t},heads:f,shaftWidth:s,headLength:0,headWidth:a,length:i}}let c=o/i,l=r/i,h=Math.min(pPo,i*0.5),d=Math.max(h,s*2),u=e.doubleSided?i/2:i,_=Math.min(d,u),p={x:n.x-c*_,y:n.y-l*_},m=[gvt(n,p,a)],A={...t},g={...p};if(e.doubleSided){let f={x:t.x+c*_,y:t.y+l*_};m.unshift(gvt(t,f,a)),A=f}return{shaftStart:A,shaftEnd:g,heads:m,shaftWidth:s,headLength:_,headWidth:a,length:i}}function dHe(e){let t=_2e(e);return[t.shaftStart,t.shaftEnd,...t.heads.flatMap((o)=>[o.tip,o.base,o.leftWing,o.rightWing])].reduce((o,r)=>({minX:Math.min(o.minX,r.x),maxX:Math.max(o.maxX,r.x),minY:Math.min(o.minY,r.y),maxY:Math.max(o.maxY,r.y)}),{minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0})}var mPo=at(W0(),1),g2e=at(As(),1);var zg=Uint8Array,g3=Uint16Array,bHe=Int32Array,A2e=new zg([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),f2e=new zg([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),fHe=new zg([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ivt=function(e,t){var n=new g3(31);for(var o=0;o<31;++o)n[o]=t+=1<<e[o-1];var r=new bHe(n[30]);for(var o=1;o<30;++o)for(var i=n[o];i<n[o+1];++i)r[i]=i-n[o]<<5|o;return{b:n,r}},vvt=Ivt(A2e,2),{b:Svt,r:yHe}=vvt;Svt[28]=258,yHe[258]=28;var Pvt=Ivt(f2e,0),{b:_Po,r:xvt}=Pvt,xHe=new g3(32768);for(Oc=0;Oc<32768;++Oc)tS=(Oc&43690)>>1|(Oc&21845)<<1,tS=(tS&52428)>>2|(tS&13107)<<2,tS=(tS&61680)>>4|(tS&3855)<<4,xHe[Oc]=((tS&65280)>>8|(tS&255)<<8)>>1;var tS,Oc,nS=function(e,t,n){var o=e.length,r=0,i=new g3(t);for(;r<o;++r)if(e[r])++i[e[r]-1];var s=new g3(t);for(r=1;r<t;++r)s[r]=s[r-1]+i[r-1]<<1;var a;if(n){a=new g3(1<<t);var c=15-t;for(r=0;r<o;++r)if(e[r]){var l=r<<4|e[r],h=t-e[r],d=s[e[r]-1]++<<h;for(var u=d|(1<<h)-1;d<=u;++d)a[xHe[d]>>c]=l}}else{a=new g3(o);for(r=0;r<o;++r)if(e[r])a[r]=xHe[s[e[r]-1]++]>>15-e[r]}return a},HR=new zg(288);for(Oc=0;Oc<144;++Oc)HR[Oc]=8;var Oc;for(Oc=144;Oc<256;++Oc)HR[Oc]=9;var Oc;for(Oc=256;Oc<280;++Oc)HR[Oc]=7;var Oc;for(Oc=280;Oc<288;++Oc)HR[Oc]=8;var Oc,ese=new zg(32);for(Oc=0;Oc<32;++Oc)ese[Oc]=5;var Oc,gPo=nS(HR,9,0),APo=nS(HR,9,1),fPo=nS(ese,5,0),yPo=nS(ese,5,1),mHe=function(e){var t=e[0];for(var n=1;n<e.length;++n)if(e[n]>t)t=e[n];return t},L9=function(e,t,n){var o=t/8|0;return(e[o]|e[o+1]<<8)>>(t&7)&n},_He=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(t&7)},IHe=function(e){return(e+7)/8|0},Zie=function(e,t,n){if(t==null||t<0)t=0;if(n==null||n>e.length)n=e.length;return new zg(e.subarray(t,n))};var xPo=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],h5=function(e,t,n){var o=Error(t||xPo[e]);if(o.code=e,Error.captureStackTrace)Error.captureStackTrace(o,h5);if(!n)throw o;return o},Evt=function(e,t,n,o){var r=e.length,i=o?o.length:0;if(!r||t.f&&!t.l)return n||new zg(0);var s=!n,a=s||t.i!=2,c=t.i;if(s)n=new zg(r*3);var l=function(ie){var le=n.length;if(ie>le){var ue=new zg(Math.max(le*2,ie));ue.set(n),n=ue}},h=t.f||0,d=t.p||0,u=t.b||0,{l:_,d:p,m,n:A}=t,g=r*8;do{if(!_){h=L9(e,d,1);var f=L9(e,d+1,3);if(d+=3,!f){var y=IHe(d)+4,x=e[y-4]|e[y-3]<<8,C=y+x;if(C>r){if(c)h5(0);break}if(a)l(u+x);n.set(e.subarray(y,C),u),t.b=u+=x,t.p=d=C*8,t.f=h;continue}else if(f==1)_=APo,p=yPo,m=9,A=5;else if(f==2){var b=L9(e,d,31)+257,I=L9(e,d+10,15)+4,v=b+L9(e,d+5,31)+1;d+=14;var P=new zg(v),M=new zg(19);for(var B=0;B<I;++B)M[fHe[B]]=L9(e,d+B*3,7);d+=I*3;var T=mHe(M),N=(1<<T)-1,D=nS(M,T,1);for(var B=0;B<v;){var L=D[L9(e,d,N)];d+=L&15;var y=L>>4;if(y<16)P[B++]=y;else{var H=0,V=0;if(y==16)V=3+L9(e,d,3),d+=2,H=P[B-1];else if(y==17)V=3+L9(e,d,7),d+=3;else if(y==18)V=11+L9(e,d,127),d+=7;while(V--)P[B++]=H}}var O=P.subarray(0,b),U=P.subarray(b);m=mHe(O),A=mHe(U),_=nS(O,m,1),p=nS(U,A,1)}else h5(1);if(d>g){if(c)h5(0);break}}if(a)l(u+131072);var j=(1<<m)-1,Y=(1<<A)-1,X=d;for(;;X=d){var H=_[_He(e,d)&j],K=H>>4;if(d+=H&15,d>g){if(c)h5(0);break}if(!H)h5(2);if(K<256)n[u++]=K;else if(K==256){X=d,_=null;break}else{var J=K-254;if(K>264){var B=K-257,ee=A2e[B];J=L9(e,d,(1<<ee)-1)+Svt[B],d+=ee}var se=p[_He(e,d)&Y],ne=se>>4;if(!se)h5(3);d+=se&15;var U=_Po[ne];if(ne>3){var ee=f2e[ne];U+=_He(e,d)&(1<<ee)-1,d+=ee}if(d>g){if(c)h5(0);break}if(a)l(u+131072);var re=u+J;if(u<U){var Z=i-U,te=Math.min(U,re);if(Z+u<0)h5(3);for(;u<te;++u)n[u]=o[Z+u]}for(;u<re;++u)n[u]=n[u-U]}}if(t.l=_,t.p=X,t.b=u,t.f=h,_)h=1,t.m=m,t.d=p,t.n=A}while(!h);return u!=n.length&&s?Zie(n,0,u):n.subarray(0,u)},ww=function(e,t,n){n<<=t&7;var o=t/8|0;e[o]|=n,e[o+1]|=n>>8},qie=function(e,t,n){n<<=t&7;var o=t/8|0;e[o]|=n,e[o+1]|=n>>8,e[o+2]|=n>>16},gHe=function(e,t){var n=[];for(var o=0;o<e.length;++o)if(e[o])n.push({s:o,f:e[o]});var r=n.length,i=n.slice();if(!r)return{t:wvt,l:0};if(r==1){var s=new zg(n[0].s+1);return s[n[0].s]=1,{t:s,l:1}}n.sort(function(C,b){return C.f-b.f}),n.push({s:-1,f:25001});var a=n[0],c=n[1],l=0,h=1,d=2;n[0]={s:-1,f:a.f+c.f,l:a,r:c};while(h!=r-1)a=n[n[l].f<n[d].f?l++:d++],c=n[l!=h&&n[l].f<n[d].f?l++:d++],n[h++]={s:-1,f:a.f+c.f,l:a,r:c};var u=i[0].s;for(var o=1;o<r;++o)if(i[o].s>u)u=i[o].s;var _=new g3(u+1),p=CHe(n[h-1],_,0);if(p>t){var o=0,m=0,A=p-t,g=1<<A;i.sort(function(b,I){return _[I.s]-_[b.s]||b.f-I.f});for(;o<r;++o){var f=i[o].s;if(_[f]>t)m+=g-(1<<p-_[f]),_[f]=t;else break}m>>=A;while(m>0){var y=i[o].s;if(_[y]<t)m-=1<<t-_[y]++-1;else++o}for(;o>=0&&m;--o){var x=i[o].s;if(_[x]==t)--_[x],++m}p=t}return{t:new zg(_),l:p}},CHe=function(e,t,n){return e.s==-1?Math.max(CHe(e.l,t,n+1),CHe(e.r,t,n+1)):t[e.s]=n},Cvt=function(e){var t=e.length;while(t&&!e[--t]);var n=new g3(++t),o=0,r=e[0],i=1,s=function(c){n[o++]=c};for(var a=1;a<=t;++a)if(e[a]==r&&a!=t)++i;else{if(!r&&i>2){for(;i>138;i-=138)s(32754);if(i>2)s(i>10?i-11<<5|28690:i-3<<5|12305),i=0}else if(i>3){s(r),--i;for(;i>6;i-=6)s(8304);if(i>2)s(i-3<<5|8208),i=0}while(i--)s(r);i=1,r=e[a]}return{c:n.subarray(0,o),n:t}},Jie=function(e,t){var n=0;for(var o=0;o<t.length;++o)n+=e[o]*t[o];return n},Mvt=function(e,t,n){var o=n.length,r=IHe(t+2);e[r]=o&255,e[r+1]=o>>8,e[r+2]=e[r]^255,e[r+3]=e[r+1]^255;for(var i=0;i<o;++i)e[r+i+4]=n[i];return(r+4+o)*8},bvt=function(e,t,n,o,r,i,s,a,c,l,h){ww(t,h++,n),++r[256];var d=gHe(r,15),{t:u,l:_}=d,p=gHe(i,15),{t:m,l:A}=p,g=Cvt(u),{c:f,n:y}=g,x=Cvt(m),{c:C,n:b}=x,I=new g3(19);for(var v=0;v<f.length;++v)++I[f[v]&31];for(var v=0;v<C.length;++v)++I[C[v]&31];var P=gHe(I,7),{t:M,l:B}=P,T=19;for(;T>4&&!M[fHe[T-1]];--T);var N=l+5<<3,D=Jie(r,HR)+Jie(i,ese)+s,L=Jie(r,u)+Jie(i,m)+s+14+3*T+Jie(I,M)+2*I[16]+3*I[17]+7*I[18];if(c>=0&&N<=D&&N<=L)return Mvt(t,h,e.subarray(c,c+l));var H,V,O,U;if(ww(t,h,1+(L<D)),h+=2,L<D){H=nS(u,_,0),V=u,O=nS(m,A,0),U=m;var j=nS(M,B,0);ww(t,h,y-257),ww(t,h+5,b-1),ww(t,h+10,T-4),h+=14;for(var v=0;v<T;++v)ww(t,h+3*v,M[fHe[v]]);h+=3*T;var Y=[f,C];for(var X=0;X<2;++X){var K=Y[X];for(var v=0;v<K.length;++v){var J=K[v]&31;if(ww(t,h,j[J]),h+=M[J],J>15)ww(t,h,K[v]>>5&127),h+=K[v]>>12}}}else H=gPo,V=HR,O=fPo,U=ese;for(var v=0;v<a;++v){var ee=o[v];if(ee>255){var J=ee>>18&31;if(qie(t,h,H[J+257]),h+=V[J+257],J>7)ww(t,h,ee>>23&31),h+=A2e[J];var se=ee&31;if(qie(t,h,O[se]),h+=U[se],se>3)qie(t,h,ee>>5&8191),h+=f2e[se]}else qie(t,h,H[ee]),h+=V[ee]}return qie(t,h,H[256]),h+V[256]},CPo=new bHe([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),wvt=new zg(0),bPo=function(e,t,n,o,r,i){var s=i.z||e.length,a=new zg(o+s+5*(1+Math.ceil(s/7000))+r),c=a.subarray(o,a.length-r),l=i.l,h=(i.r||0)&7;if(t){if(h)c[0]=i.r>>3;var d=CPo[t-1],u=d>>13,_=d&8191,p=(1<<n)-1,m=i.p||new g3(32768),A=i.h||new g3(p+1),g=Math.ceil(n/3),f=2*g,y=function(de){return(e[de]^e[de+1]<<g^e[de+2]<<f)&p},x=new bHe(25000),C=new g3(288),b=new g3(32),I=0,v=0,P=i.i||0,M=0,B=i.w||0,T=0;for(;P+2<s;++P){var N=y(P),D=P&32767,L=A[N];if(m[D]=L,A[N]=D,B<=P){var H=s-P;if((I>7000||M>24576)&&(H>423||!l)){h=bvt(e,c,0,x,C,b,v,M,T,P-T,h),M=I=v=0,T=P;for(var V=0;V<286;++V)C[V]=0;for(var V=0;V<30;++V)b[V]=0}var O=2,U=0,j=_,Y=D-L&32767;if(H>2&&N==y(P-Y)){var X=Math.min(u,H)-1,K=Math.min(32767,P),J=Math.min(258,H);while(Y<=K&&--j&&D!=L){if(e[P+O]==e[P+O-Y]){var ee=0;for(;ee<J&&e[P+ee]==e[P+ee-Y];++ee);if(ee>O){if(O=ee,U=Y,ee>X)break;var se=Math.min(Y,ee-2),ne=0;for(var V=0;V<se;++V){var re=P-Y+V&32767,Z=m[re],te=re-Z&32767;if(te>ne)ne=te,L=re}}}D=L,L=m[D],Y+=D-L&32767}}if(U){x[M++]=268435456|yHe[O]<<18|xvt[U];var ie=yHe[O]&31,le=xvt[U]&31;v+=A2e[ie]+f2e[le],++C[257+ie],++b[le],B=P+O,++I}else x[M++]=e[P],++C[e[P]]}}for(P=Math.max(P,B);P<s;++P)x[M++]=e[P],++C[e[P]];if(h=bvt(e,c,l,x,C,b,v,M,T,P-T,h),!l)i.r=h&7|c[h/8|0]<<3,h-=7,i.h=A,i.p=m,i.i=P,i.w=B}else{for(var P=i.w||0;P<s+l;P+=65535){var ue=P+65535;if(ue>=s)c[h/8|0]=l,ue=s;h=Mvt(c,h+1,e.subarray(P,ue))}i.i=s}return Zie(a,0,o+IHe(h)+r)};var Bvt=function(){var e=1,t=0;return{p:function(n){var o=e,r=t,i=n.length|0;for(var s=0;s!=i;){var a=Math.min(s+2655,i);for(;s<a;++s)r+=o+=n[s];o=(o&65535)+15*(o>>16),r=(r&65535)+15*(r>>16)}e=o,t=r},d:function(){return e%=65521,t%=65521,(e&255)<<24|(e&65280)<<8|(t&255)<<8|t>>8}}},IPo=function(e,t,n,o,r){if(!r){if(r={l:1},t.dictionary){var i=t.dictionary.subarray(-32768),s=new zg(i.length+e.length);s.set(i),s.set(e,i.length),e=s,r.w=i.length}}return bPo(e,t.level==null?6:t.level,t.mem==null?r.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,n,o,r)};var Tvt=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};var vPo=function(e,t){var n=t.level,o=n==0?0:n<6?1:n==9?3:2;if(e[0]=120,e[1]=o<<6|(t.dictionary&&32),e[1]|=31-(e[0]<<8|e[1])%31,t.dictionary){var r=Bvt();r.p(t.dictionary),Tvt(e,2,r.d())}},Dvt=function(e,t){if((e[0]&15)!=8||e[0]>>4>7||(e[0]<<8|e[1])%31)h5(6,"invalid zlib data");if((e[1]>>5&1)==+!t)h5(6,"invalid zlib data: "+(e[1]&32?"need":"unexpected")+" dictionary");return(e[1]>>3&4)+2};var AHe=function(){function e(t,n){if(typeof t=="function")n=t,t={};this.ondata=n;var o=t&&t.dictionary&&t.dictionary.subarray(-32768);if(this.s={i:0,b:o?o.length:0},this.o=new zg(32768),this.p=new zg(0),o)this.o.set(o)}return e.prototype.e=function(t){if(!this.ondata)h5(5);if(this.d)h5(4);if(!this.p.length)this.p=t;else if(t.length){var n=new zg(this.p.length+t.length);n.set(this.p),n.set(t,this.p.length),this.p=n}},e.prototype.c=function(t){this.s.i=+(this.d=t||!1);var n=this.s.b,o=Evt(this.p,this.s,this.o);this.ondata(Zie(o,n,this.s.b),this.d),this.o=Zie(o,this.s.b-32768),this.s.b=this.o.length,this.p=Zie(this.p,this.s.p/8|0),this.s.p&=7},e.prototype.push=function(t,n){this.e(t),this.c(n)},e}();function Nvt(e,t){if(!t)t={};var n=Bvt();n.p(e);var o=IPo(e,t,t.dictionary?6:2,4);return vPo(o,t),Tvt(o,o.length-4,n.d()),o}var vHe=function(){function e(t,n){AHe.call(this,t,n),this.v=t&&t.dictionary?2:1}return e.prototype.push=function(t,n){if(AHe.prototype.e.call(this,t),this.v){if(this.p.length<6&&!n)return;this.p=this.p.subarray(Dvt(this.p,this.v-1)),this.v=0}if(n){if(this.p.length<4)h5(6,"invalid zlib data");this.p=this.p.subarray(0,-4)}AHe.prototype.c.call(this,n)},e}();function Rvt(e,t){return Evt(e.subarray(Dvt(e,t&&t.dictionary),-4),{i:2},t&&t.out,t&&t.dictionary)}var SPo=typeof TextDecoder<"u"&&new TextDecoder,PPo=0;try{SPo.decode(wvt,{stream:!0}),PPo=1}catch(e){}function SHe(e,t="utf8"){return new TextDecoder(t).decode(e)}var EPo=new TextEncoder;function Qvt(e){return EPo.encode(e)}var MPo=8192,wPo=(()=>{let e=new Uint8Array(4),t=new Uint32Array(e.buffer);return!((t[0]=1)&e[0])})(),PHe={int8:globalThis.Int8Array,uint8:globalThis.Uint8Array,int16:globalThis.Int16Array,uint16:globalThis.Uint16Array,int32:globalThis.Int32Array,uint32:globalThis.Uint32Array,uint64:globalThis.BigUint64Array,int64:globalThis.BigInt64Array,float32:globalThis.Float32Array,float64:globalThis.Float64Array};class pO{buffer;byteLength;byteOffset;length;offset;lastWrittenByte;littleEndian;_data;_mark;_marks;constructor(e=MPo,t={}){let n=!1;if(typeof e==="number")e=new ArrayBuffer(e);else n=!0,this.lastWrittenByte=e.byteLength;let o=t.offset?t.offset>>>0:0,r=e.byteLength-o,i=o;if(ArrayBuffer.isView(e)||e instanceof pO){if(e.byteLength!==e.buffer.byteLength)i=e.byteOffset+o;e=e.buffer}if(n)this.lastWrittenByte=r;else this.lastWrittenByte=0;this.buffer=e,this.length=r,this.byteLength=r,this.byteOffset=i,this.offset=0,this.littleEndian=!0,this._data=new DataView(this.buffer,i,r),this._mark=0,this._marks=[]}available(e=1){return this.offset+e<=this.length}isLittleEndian(){return this.littleEndian}setLittleEndian(){return this.littleEndian=!0,this}isBigEndian(){return!this.littleEndian}setBigEndian(){return this.littleEndian=!1,this}skip(e=1){return this.offset+=e,this}back(e=1){return this.offset-=e,this}seek(e){return this.offset=e,this}mark(){return this._mark=this.offset,this}reset(){return this.offset=this._mark,this}pushMark(){return this._marks.push(this.offset),this}popMark(){let e=this._marks.pop();if(e===void 0)throw Error("Mark stack empty");return this.seek(e),this}rewind(){return this.offset=0,this}ensureAvailable(e=1){if(!this.available(e)){let n=(this.offset+e)*2,o=new Uint8Array(n);o.set(new Uint8Array(this.buffer)),this.buffer=o.buffer,this.length=n,this.byteLength=n,this._data=new DataView(this.buffer)}return this}readBoolean(){return this.readUint8()!==0}readInt8(){return this._data.getInt8(this.offset++)}readUint8(){return this._data.getUint8(this.offset++)}readByte(){return this.readUint8()}readBytes(e=1){return this.readArray(e,"uint8")}readArray(e,t){let n=PHe[t].BYTES_PER_ELEMENT*e,o=this.byteOffset+this.offset,r=this.buffer.slice(o,o+n);if(this.littleEndian===wPo&&t!=="uint8"&&t!=="int8"){let s=new Uint8Array(this.buffer.slice(o,o+n));s.reverse();let a=new PHe[t](s.buffer);return this.offset+=n,a.reverse(),a}let i=new PHe[t](r);return this.offset+=n,i}readInt16(){let e=this._data.getInt16(this.offset,this.littleEndian);return this.offset+=2,e}readUint16(){let e=this._data.getUint16(this.offset,this.littleEndian);return this.offset+=2,e}readInt32(){let e=this._data.getInt32(this.offset,this.littleEndian);return this.offset+=4,e}readUint32(){let e=this._data.getUint32(this.offset,this.littleEndian);return this.offset+=4,e}readFloat32(){let e=this._data.getFloat32(this.offset,this.littleEndian);return this.offset+=4,e}readFloat64(){let e=this._data.getFloat64(this.offset,this.littleEndian);return this.offset+=8,e}readBigInt64(){let e=this._data.getBigInt64(this.offset,this.littleEndian);return this.offset+=8,e}readBigUint64(){let e=this._data.getBigUint64(this.offset,this.littleEndian);return this.offset+=8,e}readChar(){return String.fromCharCode(this.readInt8())}readChars(e=1){let t="";for(let n=0;n<e;n++)t+=this.readChar();return t}readUtf8(e=1){return SHe(this.readBytes(e))}decodeText(e=1,t="utf8"){return SHe(this.readBytes(e),t)}writeBoolean(e){return this.writeUint8(e?255:0),this}writeInt8(e){return this.ensureAvailable(1),this._data.setInt8(this.offset++,e),this._updateLastWrittenByte(),this}writeUint8(e){return this.ensureAvailable(1),this._data.setUint8(this.offset++,e),this._updateLastWrittenByte(),this}writeByte(e){return this.writeUint8(e)}writeBytes(e){this.ensureAvailable(e.length);for(let t=0;t<e.length;t++)this._data.setUint8(this.offset++,e[t]);return this._updateLastWrittenByte(),this}writeInt16(e){return this.ensureAvailable(2),this._data.setInt16(this.offset,e,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeUint16(e){return this.ensureAvailable(2),this._data.setUint16(this.offset,e,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeInt32(e){return this.ensureAvailable(4),this._data.setInt32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeUint32(e){return this.ensureAvailable(4),this._data.setUint32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat32(e){return this.ensureAvailable(4),this._data.setFloat32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat64(e){return this.ensureAvailable(8),this._data.setFloat64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigInt64(e){return this.ensureAvailable(8),this._data.setBigInt64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigUint64(e){return this.ensureAvailable(8),this._data.setBigUint64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeChar(e){return this.writeUint8(e.charCodeAt(0))}writeChars(e){for(let t=0;t<e.length;t++)this.writeUint8(e.charCodeAt(t));return this}writeUtf8(e){return this.writeBytes(Qvt(e))}toArray(){return new Uint8Array(this.buffer,this.byteOffset,this.lastWrittenByte)}getWrittenByteLength(){return this.lastWrittenByte-this.byteOffset}_updateLastWrittenByte(){if(this.offset>this.lastWrittenByte)this.lastWrittenByte=this.offset}}var Lvt=[];for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)if(t&1)t=3988292384^t>>>1;else t=t>>>1;Lvt[e]=t}var kvt=4294967295;function BPo(e,t,n){let o=e;for(let r=0;r<n;r++)o=Lvt[(o^t[r])&255]^o>>>8;return o}function Hvt(e,t){return(BPo(kvt,e,t)^kvt)>>>0}function EHe(e,t,n){let o=e.readUint32(),r=Hvt(new Uint8Array(e.buffer,e.byteOffset+e.offset-t-4,t),t);if(r!==o)throw Error(`CRC mismatch for chunk ${n}. Expected ${o}, found ${r}`)}function FR(e,t){e.writeUint32(Hvt(new Uint8Array(e.buffer,e.byteOffset+e.offset-t,t),t))}function y2e(e,t,n){for(let o=0;o<n;o++)t[o]=e[o]}function x2e(e,t,n,o){let r=0;for(;r<o;r++)t[r]=e[r];for(;r<n;r++)t[r]=e[r]+t[r-o]&255}function C2e(e,t,n,o){let r=0;if(n.length===0)for(;r<o;r++)t[r]=e[r];else for(;r<o;r++)t[r]=e[r]+n[r]&255}function b2e(e,t,n,o,r){let i=0;if(n.length===0){for(;i<r;i++)t[i]=e[i];for(;i<o;i++)t[i]=e[i]+(t[i-r]>>1)&255}else{for(;i<r;i++)t[i]=e[i]+(n[i]>>1)&255;for(;i<o;i++)t[i]=e[i]+(t[i-r]+n[i]>>1)&255}}function I2e(e,t,n,o,r){let i=0;if(n.length===0){for(;i<r;i++)t[i]=e[i];for(;i<o;i++)t[i]=e[i]+t[i-r]&255}else{for(;i<r;i++)t[i]=e[i]+n[i]&255;for(;i<o;i++)t[i]=e[i]+TPo(t[i-r],n[i],n[i-r])&255}}function TPo(e,t,n){let o=e+t-n,r=Math.abs(o-e),i=Math.abs(o-t),s=Math.abs(o-n);if(r<=i&&r<=s)return e;else if(i<=s)return t;else return n}function Fvt(e,t,n,o,r,i){switch(e){case 0:y2e(t,n,r);break;case 1:x2e(t,n,r,i);break;case 2:C2e(t,n,o,r);break;case 3:b2e(t,n,o,r,i);break;case 4:I2e(t,n,o,r,i);break;default:throw Error(`Unsupported filter: ${e}`)}}var DPo=new Uint16Array([255]),NPo=new Uint8Array(DPo.buffer),RPo=NPo[0]===255;function zvt(e){let{data:t,width:n,height:o,channels:r,depth:i}=e,s=[{x:0,y:0,xStep:8,yStep:8},{x:4,y:0,xStep:8,yStep:8},{x:0,y:4,xStep:4,yStep:8},{x:2,y:0,xStep:4,yStep:4},{x:0,y:2,xStep:2,yStep:4},{x:1,y:0,xStep:2,yStep:2},{x:0,y:1,xStep:1,yStep:2}],a=Math.ceil(i/8)*r,c=new Uint8Array(o*n*a),l=0;for(let h=0;h<7;h++){let d=s[h],u=Math.ceil((n-d.x)/d.xStep),_=Math.ceil((o-d.y)/d.yStep);if(u<=0||_<=0)continue;let p=u*a,m=new Uint8Array(p);for(let A=0;A<_;A++){let g=t[l++],f=t.subarray(l,l+p);l+=p;let y=new Uint8Array(p);Fvt(g,f,y,m,p,a),m.set(y);for(let x=0;x<u;x++){let C=d.x+x*d.xStep,b=d.y+A*d.yStep;if(C>=n||b>=o)continue;for(let I=0;I<a;I++)c[(b*n+C)*a+I]=y[x*a+I]}}}if(i===16){let h=new Uint16Array(c.buffer);if(RPo)for(let d=0;d<h.length;d++)h[d]=QPo(h[d]);return h}else return c}function QPo(e){return(e&255)<<8|e>>8&255}var kPo=new Uint16Array([255]),LPo=new Uint8Array(kPo.buffer),HPo=LPo[0]===255,FPo=new Uint8Array(0);function MHe(e){let{data:t,width:n,height:o,channels:r,depth:i}=e,s=Math.ceil(i/8)*r,a=Math.ceil(i/8*r*n),c=new Uint8Array(o*a),l=FPo,h=0,d,u;for(let _=0;_<o;_++){switch(d=t.subarray(h+1,h+1+a),u=c.subarray(_*a,(_+1)*a),t[h]){case 0:y2e(d,u,a);break;case 1:x2e(d,u,a,s);break;case 2:C2e(d,u,l,a);break;case 3:b2e(d,u,l,a,s);break;case 4:I2e(d,u,l,a,s);break;default:throw Error(`Unsupported filter: ${t[h]}`)}l=u,h+=a+1}if(i===16){let _=new Uint16Array(c.buffer);if(HPo)for(let p=0;p<_.length;p++)_[p]=zPo(_[p]);return _}else return c}function zPo(e){return(e&255)<<8|e>>8&255}var tse=Uint8Array.of(137,80,78,71,13,10,26,10);function Ovt(e){e.writeBytes(tse)}function wHe(e){if(!Vvt(e.readBytes(tse.length)))throw Error("wrong PNG signature")}function Vvt(e){if(e.length<tse.length)return!1;for(let t=0;t<tse.length;t++)if(e[t]!==tse[t])return!1;return!0}var BHe="tEXt",Yvt=0,Gvt=new TextDecoder("latin1");function Uvt(e){if(Wvt(e),e.length===0||e.length>79)throw Error("keyword length must be between 1 and 79")}var OPo=/^[\u0000-\u00FF]*$/;function Wvt(e){if(!OPo.test(e))throw Error("invalid latin1 text")}function Xvt(e,t,n){let o=THe(t);e[o]=VPo(t,n-o.length-1)}function jvt(e,t,n){Uvt(t),Wvt(n);let o=t.length+1+n.length;e.writeUint32(o),e.writeChars(BHe),e.writeChars(t),e.writeByte(Yvt),e.writeChars(n),FR(e,o+4)}function THe(e){e.mark();while(e.readByte()!==Yvt);let t=e.offset;e.reset();let n=Gvt.decode(e.readBytes(t-e.offset-1));return e.skip(1),Uvt(n),n}function VPo(e,t){return Gvt.decode(e.readBytes(t))}var Jp={UNKNOWN:-1,GREYSCALE:0,TRUECOLOUR:2,INDEXED_COLOUR:3,GREYSCALE_ALPHA:4,TRUECOLOUR_ALPHA:6},zj={UNKNOWN:-1,DEFLATE:0},nse={UNKNOWN:-1,ADAPTIVE:0},oS={UNKNOWN:-1,NO_INTERLACE:0,ADAM7:1},ose={NONE:0,BACKGROUND:1,PREVIOUS:2},v2e={SOURCE:0,OVER:1};class S2e extends pO{_checkCrc;_inflator;_png;_apng;_end;_hasPalette;_palette;_hasTransparency;_transparency;_compressionMethod;_filterMethod;_interlaceMethod;_colorType;_isAnimated;_numberOfFrames;_numberOfPlays;_frames;_writingDataChunks;_chunks;_inflatorResult;constructor(e,t={}){super(e);let{checkCrc:n=!1}=t;this._checkCrc=n,this._inflator=new vHe((o,r)=>{if(this._chunks.push(o),r){let i=this._chunks.reduce((a,c)=>a+c.length,0);this._inflatorResult=new Uint8Array(i);let s=0;for(let a of this._chunks)this._inflatorResult.set(a,s),s+=a.length;this._chunks=[]}}),this._chunks=[],this._png={width:-1,height:-1,channels:-1,data:new Uint8Array(0),depth:1,text:{}},this._apng={width:-1,height:-1,channels:-1,depth:1,numberOfFrames:1,numberOfPlays:0,text:{},frames:[]},this._end=!1,this._hasPalette=!1,this._palette=[],this._hasTransparency=!1,this._transparency=new Uint16Array(0),this._compressionMethod=zj.UNKNOWN,this._filterMethod=nse.UNKNOWN,this._interlaceMethod=oS.UNKNOWN,this._colorType=Jp.UNKNOWN,this._isAnimated=!1,this._numberOfFrames=1,this._numberOfPlays=0,this._frames=[],this._writingDataChunks=!1,this._inflatorResult=new Uint8Array(0),this.setBigEndian()}decode(){wHe(this);while(!this._end){let e=this.readUint32(),t=this.readChars(4);this.decodeChunk(e,t)}return this._inflator.push(new Uint8Array(0),!0),this.decodeImage(),this._png}decodeApng(){wHe(this);while(!this._end){let e=this.readUint32(),t=this.readChars(4);this.decodeApngChunk(e,t)}return this.decodeApngImage(),this._apng}decodeChunk(e,t){let n=this.offset;switch(t){case"IHDR":this.decodeIHDR();break;case"PLTE":this.decodePLTE(e);break;case"IDAT":this.decodeIDAT(e);break;case"IEND":this._end=!0;break;case"tRNS":this.decodetRNS(e);break;case"iCCP":this.decodeiCCP(e);break;case BHe:Xvt(this._png.text,this,e);break;case"pHYs":this.decodepHYs();break;default:this.skip(e);break}if(this.offset-n!==e)throw Error(`Length mismatch while decoding chunk ${t}`);if(this._checkCrc)EHe(this,e+4,t);else this.skip(4)}decodeApngChunk(e,t){let n=this.offset;if(t!=="fdAT"&&t!=="IDAT"&&this._writingDataChunks)this.pushDataToFrame();switch(t){case"acTL":this.decodeACTL();break;case"fcTL":this.decodeFCTL();break;case"fdAT":this.decodeFDAT(e);break;default:this.decodeChunk(e,t),this.offset=n+e;break}if(this.offset-n!==e)throw Error(`Length mismatch while decoding chunk ${t}`);if(this._checkCrc)EHe(this,e+4,t);else this.skip(4)}decodeIHDR(){let e=this._png;e.width=this.readUint32(),e.height=this.readUint32(),e.depth=YPo(this.readUint8());let t=this.readUint8();this._colorType=t;let n;switch(t){case Jp.GREYSCALE:n=1;break;case Jp.TRUECOLOUR:n=3;break;case Jp.INDEXED_COLOUR:n=1;break;case Jp.GREYSCALE_ALPHA:n=2;break;case Jp.TRUECOLOUR_ALPHA:n=4;break;case Jp.UNKNOWN:default:throw Error(`Unknown color type: ${t}`)}if(this._png.channels=n,this._compressionMethod=this.readUint8(),this._compressionMethod!==zj.DEFLATE)throw Error(`Unsupported compression method: ${this._compressionMethod}`);this._filterMethod=this.readUint8(),this._interlaceMethod=this.readUint8()}decodeACTL(){this._numberOfFrames=this.readUint32(),this._numberOfPlays=this.readUint32(),this._isAnimated=!0}decodeFCTL(){let e={sequenceNumber:this.readUint32(),width:this.readUint32(),height:this.readUint32(),xOffset:this.readUint32(),yOffset:this.readUint32(),delayNumber:this.readUint16(),delayDenominator:this.readUint16(),disposeOp:this.readUint8(),blendOp:this.readUint8(),data:new Uint8Array(0)};this._frames.push(e)}decodePLTE(e){if(e%3!==0)throw RangeError(`PLTE field length must be a multiple of 3. Got ${e}`);let t=e/3;this._hasPalette=!0;let n=[];this._palette=n;for(let o=0;o<t;o++)n.push([this.readUint8(),this.readUint8(),this.readUint8()])}decodeIDAT(e){this._writingDataChunks=!0;let t=e,n=this.offset+this.byteOffset;try{this._inflator.push(new Uint8Array(this.buffer,n,t),!1)}catch(o){throw Error("Error while decompressing the data:",{cause:o})}this.skip(e)}decodeFDAT(e){this._writingDataChunks=!0;let t=e,n=this.offset+this.byteOffset;n+=4,t-=4;try{this._inflator.push(new Uint8Array(this.buffer,n,t),!1)}catch(o){throw Error("Error while decompressing the data:",{cause:o})}this.skip(e)}decodetRNS(e){switch(this._colorType){case Jp.GREYSCALE:case Jp.TRUECOLOUR:{if(e%2!==0)throw RangeError(`tRNS chunk length must be a multiple of 2. Got ${e}`);if(e/2>this._png.width*this._png.height)throw Error(`tRNS chunk contains more alpha values than there are pixels (${e/2} vs ${this._png.width*this._png.height})`);this._hasTransparency=!0,this._transparency=new Uint16Array(e/2);for(let t=0;t<e/2;t++)this._transparency[t]=this.readUint16();break}case Jp.INDEXED_COLOUR:{if(e>this._palette.length)throw Error(`tRNS chunk contains more alpha values than there are palette colors (${e} vs ${this._palette.length})`);let t=0;for(;t<e;t++){let n=this.readByte();this._palette[t].push(n)}for(;t<this._palette.length;t++)this._palette[t].push(255);break}case Jp.UNKNOWN:case Jp.GREYSCALE_ALPHA:case Jp.TRUECOLOUR_ALPHA:default:throw Error(`tRNS chunk is not supported for color type ${this._colorType}`)}}decodeiCCP(e){let t=THe(this),n=this.readUint8();if(n!==zj.DEFLATE)throw Error(`Unsupported iCCP compression method: ${n}`);let o=this.readBytes(e-t.length-2);this._png.iccEmbeddedProfile={name:t,profile:Rvt(o)}}decodepHYs(){let e=this.readUint32(),t=this.readUint32(),n=this.readByte();this._png.resolution={x:e,y:t,unit:n}}decodeApngImage(){this._apng.width=this._png.width,this._apng.height=this._png.height,this._apng.channels=this._png.channels,this._apng.depth=this._png.depth,this._apng.numberOfFrames=this._numberOfFrames,this._apng.numberOfPlays=this._numberOfPlays,this._apng.text=this._png.text,this._apng.resolution=this._png.resolution;for(let e=0;e<this._numberOfFrames;e++){let t={sequenceNumber:this._frames[e].sequenceNumber,delayNumber:this._frames[e].delayNumber,delayDenominator:this._frames[e].delayDenominator,data:this._apng.depth===8?new Uint8Array(this._apng.width*this._apng.height*this._apng.channels):new Uint16Array(this._apng.width*this._apng.height*this._apng.channels)},n=this._frames.at(e);if(n){if(n.data=MHe({data:n.data,width:n.width,height:n.height,channels:this._apng.channels,depth:this._apng.depth}),this._hasPalette)this._apng.palette=this._palette;if(this._hasTransparency)this._apng.transparency=this._transparency;if(e===0||n.xOffset===0&&n.yOffset===0&&n.width===this._png.width&&n.height===this._png.height)t.data=n.data;else{let o=this._apng.frames.at(e-1);this.disposeFrame(n,o,t),this.addFrameDataToCanvas(t,n)}this._apng.frames.push(t)}}return this._apng}disposeFrame(e,t,n){switch(e.disposeOp){case ose.NONE:break;case ose.BACKGROUND:for(let o=0;o<this._png.height;o++)for(let r=0;r<this._png.width;r++){let i=(o*e.width+r)*this._png.channels;for(let s=0;s<this._png.channels;s++)n.data[i+s]=0}break;case ose.PREVIOUS:n.data.set(t.data);break;default:throw Error("Unknown disposeOp")}}addFrameDataToCanvas(e,t){let n=1<<this._png.depth,o=(r,i)=>{let s=((r+t.yOffset)*this._png.width+t.xOffset+i)*this._png.channels,a=(r*t.width+i)*this._png.channels;return{index:s,frameIndex:a}};switch(t.blendOp){case v2e.SOURCE:for(let r=0;r<t.height;r++)for(let i=0;i<t.width;i++){let{index:s,frameIndex:a}=o(r,i);for(let c=0;c<this._png.channels;c++)e.data[s+c]=t.data[a+c]}break;case v2e.OVER:for(let r=0;r<t.height;r++)for(let i=0;i<t.width;i++){let{index:s,frameIndex:a}=o(r,i);for(let c=0;c<this._png.channels;c++){let l=t.data[a+this._png.channels-1]/n,h=c%(this._png.channels-1)===0?1:t.data[a+c],d=Math.floor(l*h+(1-l)*e.data[s+c]);e.data[s+c]+=d}}break;default:throw Error("Unknown blendOp")}}decodeImage(){let e=this._inflatorResult;if(this._filterMethod!==nse.ADAPTIVE)throw Error(`Filter method ${this._filterMethod} not supported`);if(this._interlaceMethod===oS.NO_INTERLACE)this._png.data=MHe({data:e,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else if(this._interlaceMethod===oS.ADAM7)this._png.data=zvt({data:e,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else throw Error(`Interlace method ${this._interlaceMethod} not supported`);if(this._hasPalette)this._png.palette=this._palette;if(this._hasTransparency)this._png.transparency=this._transparency}pushDataToFrame(){this._inflator.push(new Uint8Array(0),!0);let e=this._inflatorResult,t=this._frames.at(-1);if(t)t.data=e;else this._frames.push({sequenceNumber:0,width:this._png.width,height:this._png.height,xOffset:0,yOffset:0,delayNumber:0,delayDenominator:0,disposeOp:ose.NONE,blendOp:v2e.SOURCE,data:e});this._inflator=new vHe((n,o)=>{if(this._chunks.push(n),o){let r=this._chunks.reduce((s,a)=>s+a.length,0);this._inflatorResult=new Uint8Array(r);let i=0;for(let s of this._chunks)this._inflatorResult.set(s,i),i+=s.length;this._chunks=[]}}),this._chunks=[],this._writingDataChunks=!1}}function YPo(e){if(e!==1&&e!==2&&e!==4&&e!==8&&e!==16)throw Error(`invalid bit depth: ${e}`);return e}var GPo={level:3};class P2e extends pO{_png;_zlibOptions;_colorType;_interlaceMethod;constructor(e,t={}){super();this._colorType=Jp.UNKNOWN,this._zlibOptions={...GPo,...t.zlib},this._png=this._checkData(e),this._interlaceMethod=(t.interlace==="Adam7"?oS.ADAM7:oS.NO_INTERLACE)??oS.NO_INTERLACE,this.setBigEndian()}encode(){if(Ovt(this),this.encodeIHDR(),this._png.palette){if(this.encodePLTE(),this._png.palette[0].length===4)this.encodeTRNS()}if(this.encodeData(),this._png.text)for(let[e,t]of Object.entries(this._png.text))jvt(this,e,t);return this.encodeIEND(),this.toArray()}encodeIHDR(){this.writeUint32(13),this.writeChars("IHDR"),this.writeUint32(this._png.width),this.writeUint32(this._png.height),this.writeByte(this._png.depth),this.writeByte(this._colorType),this.writeByte(zj.DEFLATE),this.writeByte(nse.ADAPTIVE),this.writeByte(this._interlaceMethod),FR(this,17)}encodeIEND(){this.writeUint32(0),this.writeChars("IEND"),FR(this,4)}encodePLTE(){let e=this._png.palette?.length*3;this.writeUint32(e),this.writeChars("PLTE");for(let t of this._png.palette)this.writeByte(t[0]),this.writeByte(t[1]),this.writeByte(t[2]);FR(this,4+e)}encodeTRNS(){let e=this._png.palette.filter((t)=>t.at(-1)!==255);this.writeUint32(e.length),this.writeChars("tRNS");for(let t of e)this.writeByte(t.at(-1));FR(this,4+e.length)}encodeIDAT(e){this.writeUint32(e.length),this.writeChars("IDAT"),this.writeBytes(e),FR(this,e.length+4)}encodeData(){let{width:e,height:t,channels:n,depth:o,data:r}=this._png,i=o<=8?Math.ceil(e*o/8)*n:Math.ceil(e*o/8*n/2),s=new pO().setBigEndian(),a=0;if(this._interlaceMethod===oS.NO_INTERLACE)for(let h=0;h<t;h++)if(s.writeByte(0),o===16)a=jPo(r,s,i,a);else a=WPo(r,s,i,a);else if(this._interlaceMethod===oS.ADAM7)a=XPo(this._png,r,s,a);let c=s.toArray(),l=Nvt(c,this._zlibOptions);this.encodeIDAT(l)}_checkData(e){let{colorType:t,channels:n,depth:o}=UPo(e,e.palette),r={width:Kvt(e.width,"width"),height:Kvt(e.height,"height"),channels:n,data:e.data,depth:o,text:e.text,palette:e.palette};this._colorType=t;let i=o<8?Math.ceil(r.width*o/8)*r.height*n:r.width*r.height*n;if(r.data.length!==i)throw RangeError(`wrong data size. Found ${r.data.length}, expected ${i}`);return r}}function Kvt(e,t){if(Number.isInteger(e)&&e>0)return e;throw TypeError(`${t} must be a positive integer`)}function UPo(e,t){let{channels:n=4,depth:o=8}=e;if(n!==4&&n!==3&&n!==2&&n!==1)throw RangeError(`unsupported number of channels: ${n}`);let r={channels:n,depth:o,colorType:Jp.UNKNOWN};switch(n){case 4:r.colorType=Jp.TRUECOLOUR_ALPHA;break;case 3:r.colorType=Jp.TRUECOLOUR;break;case 1:if(t)r.colorType=Jp.INDEXED_COLOUR;else r.colorType=Jp.GREYSCALE;break;case 2:r.colorType=Jp.GREYSCALE_ALPHA;break;default:throw Error("unsupported number of channels")}return r}function WPo(e,t,n,o){for(let r=0;r<n;r++)t.writeByte(e[o++]);return o}function XPo(e,t,n,o){let r=[{x:0,y:0,xStep:8,yStep:8},{x:4,y:0,xStep:8,yStep:8},{x:0,y:4,xStep:4,yStep:8},{x:2,y:0,xStep:4,yStep:4},{x:0,y:2,xStep:2,yStep:4},{x:1,y:0,xStep:2,yStep:2},{x:0,y:1,xStep:1,yStep:2}],{width:i,height:s,channels:a,depth:c}=e,l;if(c===16)l=a*c/8/2;else l=a*c/8;for(let h=0;h<7;h++){let d=r[h],u=Math.floor((i-d.x+d.xStep-1)/d.xStep),_=Math.floor((s-d.y+d.yStep-1)/d.yStep);if(u<=0||_<=0)continue;let p=u*l;for(let m=0;m<_;m++){let A=d.y+m*d.yStep,g=c<=8?new Uint8Array(p):new Uint16Array(p),f=0;for(let y=0;y<u;y++){let x=d.x+y*d.xStep;if(x<i&&A<s){let C=(A*i+x)*l;for(let b=0;b<l;b++)g[f++]=t[C+b]}}if(n.writeByte(0),c===8)n.writeBytes(g);else if(c===16)for(let y of g)n.writeByte(y>>8&255),n.writeByte(y&255)}}return o}function jPo(e,t,n,o){for(let r=0;r<n;r++)t.writeUint16(e[o++]);return o}function $vt(e,t){return new S2e(e,t).decode()}function DHe(e,t){return new P2e(e,t).encode()}H9();var w2e=at(As(),1);function Hy(e){let t=[...e.points||[],...(e.lines||[]).flatMap((n)=>n.points),...(e.polygons||[]).flatMap((n)=>n.points),...(e.rects||[]).flatMap((n)=>hHe(n)),...(e.circles||[]).flatMap((n)=>[{x:n.center.x-n.radius,y:n.center.y},{x:n.center.x+n.radius,y:n.center.y},{x:n.center.x,y:n.center.y-n.radius},{x:n.center.x,y:n.center.y+n.radius}]),...(e.arrows||[]).flatMap((n)=>{let o=dHe(n);return[{x:o.minX,y:o.minY},{x:o.maxX,y:o.maxY}]}),...(e.texts||[]).flatMap((n)=>{let o=n.fontSize??12,r=n.text.length*o*u2e,i=o*p2e,s=n.anchorSide??"center",a={top_left:{dx:0,dy:0},top_center:{dx:-r/2,dy:0},top_right:{dx:-r,dy:0},center_left:{dx:0,dy:-i/2},center:{dx:-r/2,dy:-i/2},center_right:{dx:-r,dy:-i/2},bottom_left:{dx:0,dy:-i},bottom_center:{dx:-r/2,dy:-i},bottom_right:{dx:-r,dy:-i}},{dx:c,dy:l}=a[s],h=n.x+c,d=n.y+l;return[{x:h,y:d},{x:h+r,y:d+i}]})];if(t.length===0)return{minX:-1,maxX:1,minY:-1,maxY:1};return t.reduce((n,o)=>({minX:Math.min(n.minX,o.x),maxX:Math.max(n.maxX,o.x),minY:Math.min(n.minY,o.y),maxY:Math.max(n.maxY,o.y)}),{minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0})}var nEo=at(As(),1);function B2e(e,t,n){return{...e,points:e.points?.map((o)=>({...o,x:o.x+t,y:o.y+n})),lines:e.lines?.map((o)=>({...o,points:o.points.map((r)=>({x:r.x+t,y:r.y+n}))})),infiniteLines:e.infiniteLines?.map((o)=>({...o,origin:{x:o.origin.x+t,y:o.origin.y+n}})),polygons:e.polygons?.map((o)=>({...o,points:o.points.map((r)=>({x:r.x+t,y:r.y+n}))})),rects:e.rects?.map((o)=>({...o,center:{x:o.center.x+t,y:o.center.y+n}})),circles:e.circles?.map((o)=>({...o,center:{x:o.center.x+t,y:o.center.y+n}})),arrows:e.arrows?.map((o)=>({...o,start:{x:o.start.x+t,y:o.start.y+n},end:{x:o.end.x+t,y:o.end.y+n}})),texts:e.texts?.map((o)=>({...o,x:o.x+t,y:o.y+n}))}}var Nb=(e,t)=>({...e,rects:[...e.rects??[],...t.rects??[]],points:[...e.points??[],...t.points??[]],lines:[...e.lines??[],...t.lines??[]],infiniteLines:[...e.infiniteLines??[],...t.infiniteLines??[]],polygons:[...e.polygons??[],...t.polygons??[]],circles:[...e.circles??[],...t.circles??[]],arrows:[...e.arrows??[],...t.arrows??[]],texts:[...e.texts??[],...t.texts??[]]});function zR(e,t={}){if(e.length===0)return{};let n=e[0],o=Hy(n),r=o.minY,i=[o];for(let s=1;s<e.length;s++){let a=e[s],c=Hy(a),l=o.maxX-o.minX,h=c.maxX-c.minX,d=(l+h)/8,u=o.maxX+d-c.minX,_=r-c.minY,p=B2e(a,u,_);n=Nb(n,p),o=Hy(p),i.push(o)}if(t.titles&&t.titles.length>0){let s=Hy(n),c=(s.maxX-s.minX)*0.025,l=t.titles.slice(0,i.length).map((h,d)=>{let u=i[d];return{x:(u.minX+u.maxX)/2,y:u.maxY+c,text:h,fontSize:c,anchorSide:"bottom_center"}});n=Nb(n,{texts:l})}return n}function rse(e,t={}){if(e.length===0)return{};let n=e[0],o=Hy(n),r=o.minX,i=[o];for(let s=1;s<e.length;s++){let a=e[s],c=Hy(a),l=o.maxY-o.minY,h=c.maxY-c.minY,d=(l+h)/8,u=r-c.minX,_=o.minY-d-c.maxY,p=B2e(a,u,_);n=Nb(n,p),o=Hy(p),i.push(o)}if(t.titles&&t.titles.length>0){let s=Hy(n),c=(s.maxY-s.minY)*0.025,l=t.titles.slice(0,i.length).map((h,d)=>{let u=i[d];return{x:u.minX-c,y:u.maxY,text:h,fontSize:c,anchorSide:"top_right"}});n=Nb(n,{texts:l})}return n}function ise(e,t){if(e.points)for(let n of e.points)n.step=t;if(e.lines)for(let n of e.lines)n.step=t;if(e.infiniteLines)for(let n of e.infiniteLines)n.step=t;if(e.polygons)for(let n of e.polygons)n.step=t;if(e.rects)for(let n of e.rects)n.step=t;if(e.circles)for(let n of e.circles)n.step=t;if(e.texts)for(let n of e.texts)n.step=t;if(e.arrows)for(let n of e.arrows)n.step=t;return e}var po=class{MAX_ITERATIONS=1e5;solved=!1;failed=!1;iterations=0;progress=0;error=null;activeSubSolver;failedSubSolvers;timeToSolve;stats={};_setupDone=!1;getSolverName(){return this.constructor.name}setup(){if(this._setupDone)return;this._setup(),this._setupDone=!0}_setup(){}step(){if(!this._setupDone)this.setup();if(this.solved)return;if(this.failed)return;this.iterations++;try{this._step()}catch(e){throw this.error=`${this.getSolverName()} error: ${e}`,this.failed=!0,e}if(!this.solved&&this.iterations>=this.MAX_ITERATIONS)this.tryFinalAcceptance();if(!this.solved&&this.iterations>=this.MAX_ITERATIONS)this.error=`${this.getSolverName()} ran out of iterations`,this.failed=!0;if("computeProgress"in this)this.progress=this.computeProgress()}_step(){}getConstructorParams(){throw Error("getConstructorParams not implemented")}getOutput(){return null}solve(){let e=Date.now();while(!this.solved&&!this.failed)this.step();let t=Date.now();this.timeToSolve=t-e}visualize(){return{lines:[],points:[],rects:[],circles:[]}}tryFinalAcceptance(){}preview(){return{lines:[],points:[],rects:[],circles:[]}}};function Pi(e,t,n,o={}){return{solverName:e,solverClass:t,getConstructorParams:n,onSolved:o.onSolved}}var Rb=class extends po{startTimeOfStage={};endTimeOfStage={};timeSpentOnStage={};firstIterationOfStage={};currentPipelineStageIndex=0;inputProblem;pipelineOutputs={};constructor(e){super();this.inputProblem=e,this.MAX_ITERATIONS=1e6}_step(){let e=this.pipelineDef[this.currentPipelineStageIndex];if(!e){this.solved=!0;return}if(this.activeSubSolver){if(this.activeSubSolver.step(),this.activeSubSolver.solved){this.endTimeOfStage[e.solverName]=performance.now(),this.timeSpentOnStage[e.solverName]=this.endTimeOfStage[e.solverName]-this.startTimeOfStage[e.solverName];let n=this.activeSubSolver.getOutput();if(n!==null)this.pipelineOutputs[e.solverName]=n;e.onSolved?.(this),this.activeSubSolver=null,this.currentPipelineStageIndex++}else if(this.activeSubSolver.failed)this.error=this.activeSubSolver?.error,this.failed=!0,this.activeSubSolver=null;return}let t=e.getConstructorParams(this);this.activeSubSolver=new e.solverClass(...t),this[e.solverName]=this.activeSubSolver,this.timeSpentOnStage[e.solverName]=0,this.startTimeOfStage[e.solverName]=performance.now(),this.firstIterationOfStage[e.solverName]=this.iterations}solveUntilStage(e){while(this.getCurrentStageName().toLowerCase()!==e.toLowerCase())if(this.step(),this.failed||this.solved)break}getCurrentStageName(){return this.pipelineDef[this.currentPipelineStageIndex]?.solverName??"none"}getStageProgress(){let e=this.pipelineDef.length;if(e===0)return 1;let t=this.activeSubSolver?.progress??0;return(this.currentPipelineStageIndex+t)/e}getStageStats(){let e={};for(let t of this.pipelineDef){let n=this.timeSpentOnStage[t.solverName]||0,o=this.firstIterationOfStage[t.solverName]||0,r=this.iterations,i=t.solverName===this.getCurrentStageName()?r-o:0,s=this.currentPipelineStageIndex>this.pipelineDef.findIndex((a)=>a.solverName===t.solverName);e[t.solverName]={timeSpent:n,iterations:i,completed:s}}return e}initialVisualize(){return null}finalVisualize(){return null}visualize(){if(!this.solved&&this.activeSubSolver)return this.activeSubSolver.visualize();let e=0,t=this.initialVisualize();if(t)ise(t,0),e=1;let n=null;if(this.solved)n=this.finalVisualize();let o=[t].filter(Boolean).concat(this.pipelineDef.map((r,i)=>{let a=this[r.solverName]?.visualize();if(!a)return null;return ise(a,i+e),a}).filter(Boolean));if(o.length===0)return{points:[],rects:[],lines:[],circles:[],texts:[]};if(this.solved&&n)ise(n,o.length+e+1),o.push(n);if(o.length===1)return o[0];return{points:o.flatMap((r)=>r.points||[]),rects:o.flatMap((r)=>r.rects||[]),lines:o.flatMap((r)=>r.lines||[]),circles:o.flatMap((r)=>r.circles||[]),texts:o.flatMap((r)=>r.texts||[])}}preview(){if(this.activeSubSolver)return this.activeSubSolver.preview();return super.preview()}computeProgress(){return this.getStageProgress()}getStageOutput(e){return this.pipelineOutputs[e]}getAllOutputs(){return{...this.pipelineOutputs}}hasStageOutput(e){return e in this.pipelineOutputs}getSolver(e){return this[e]}};yc();er();yc();er();qt();yc();er();er();var sEo=/\b(?:pcb|source|schematic|subcircuit)_[a-z0-9_]+\b/i,V2e=(e,t,n)=>{if(!e||e===t||t.length>0&&e.includes(t)||sEo.test(e))return n;return e},qj=(e,t)=>{for(let n of e){let o=V2e(n,t,"");if(o)return o}return""},yO=(e,t)=>Ks(e,t),qvt=(e,t)=>{let n=e.find((i)=>i.type==="source_component"&&i.source_component_id===t.source_component_id),o=n?.type==="source_component"?qj([n.name],n.source_component_id):"",r=qj([t.name,t.pin_number?.toString(),t.port_hints?.[0]],t.source_port_id);return`${o||"unnamed component"}.${r||"unnamed pin"}`},aS=(e,t)=>{let n=e.find((o)=>o.type==="pcb_port"&&o.pcb_port_id===t);if(n?.type==="pcb_port"){let o=e.find((a)=>a.type==="source_port"&&a.source_port_id===n.source_port_id),r=o?.type==="source_port"?e.find((a)=>a.type==="source_component"&&a.source_component_id===o.source_component_id):null,i=qj([r?.type==="source_component"?r.name:null],r?.type==="source_component"?r.source_component_id:""),s=qj([o?.type==="source_port"?o.name:null,o?.type==="source_port"?o.pin_number?.toString():null,o?.type==="source_port"?o.port_hints?.[0]:null],o?.type==="source_port"?o.source_port_id:"");if(i&&s)return`${i}.${s}`;if(s)return s}return"unnamed port"},iFe=(e,t)=>{let n=V2e(t.display_name,t.source_trace_id,"");if(n)return n;let o=(t.connected_source_port_ids??[]).map((r)=>{let i=e.find((h)=>h.type==="pcb_port"&&h.source_port_id===r);if(i?.type==="pcb_port"){let h=aS(e,i.pcb_port_id);return h==="unnamed port"?null:h}let s=e.find((h)=>h.type==="source_port"&&h.source_port_id===r);if(s?.type!=="source_port")return null;let a=e.find((h)=>h.type==="source_component"&&h.source_component_id===s.source_component_id),c=a?.type==="source_component"?V2e(a.name,a.source_component_id,""):"",l=qj([s.name,s.pin_number?.toString(),s.port_hints?.[0]],s.source_port_id);if(c&&l)return`${c}.${l}`;return l||null}).filter((r)=>Boolean(r));if(o.length>=2)return`${o[0]} to ${o[1]}`;if(o.length===1)return`trace connected to ${o[0]}`;return"unnamed trace"},Ks=(e,t)=>{let n=e.find((a)=>Za(a)===t);if(!n)return"unnamed element";if(n.type==="pcb_component"||n.type==="schematic_component"){let a=e.find((c)=>c.type==="source_component"&&c.source_component_id===n.source_component_id);if(a?.type==="source_component")return V2e(a.name,a.source_component_id,"unnamed component")}if((n.type==="pcb_smtpad"||n.type==="pcb_plated_hole")&&n.pcb_port_id){let a=aS(e,n.pcb_port_id);if(a!=="unnamed port")return a}if(n.type==="pcb_trace")return Dw(e,t);let r={pcb_smtpad:"SMD pad",pcb_plated_hole:"through-hole pad",pcb_via:"via",pcb_hole:"hole",pcb_bend:"bend",pcb_stiffener:"stiffener",pcb_keepout:"keepout",pcb_cutout:"cutout",pcb_copper_pour:"copper pour"}[n.type]??n.type.replace(/^(pcb|source|schematic)_/,"").replaceAll("_"," "),i="name"in n?n.name:void 0,s="description"in n?n.description:void 0;return qj([i,s,qLe(e,t)],t)||`unnamed ${r}`},Dw=(e,t)=>{let n=e.find((i)=>i.type==="pcb_trace"&&i.pcb_trace_id===t);if(n?.type==="pcb_trace"&&n.source_trace_id){let i=e.find((s)=>s.type==="source_trace"&&s.source_trace_id===n.source_trace_id);if(i?.type==="source_trace")return iFe(e,i)}if(n?.type!=="pcb_trace")return"unnamed trace";let r=[...new Set(n.route.flatMap((i)=>i.route_type==="wire"?[i.start_pcb_port_id,i.end_pcb_port_id]:[]).filter((i)=>Boolean(i)))].map((i)=>aS(e,i)).filter((i)=>i!=="unnamed port");if(r.length>=2)return`${r[0]} to ${r[1]}`;if(r.length===1)return`trace connected to ${r[0]}`;return"unnamed trace"};function aEo(e,t,n){let o=t.type==="pcb_smtpad"?"SMD pad":"through-hole pad",r=t.pcb_port_id?aS(e,t.pcb_port_id):null,i=ky([t]),s=(i.minX+i.maxX)/2,a=(i.minY+i.maxY)/2,c=`(${s.toFixed(2)}mm, ${a.toFixed(2)}mm)`;if(r)return`${o} ${r} at ${c}`;return`${o} #${n+1} at ${c}`}var Y8t=(e,t)=>{let n=t*Math.PI/180;return{x:e.x*Math.cos(n)-e.y*Math.sin(n),y:e.x*Math.sin(n)+e.y*Math.cos(n)}},Y2e=({x:e,y:t,width:n,height:o,ccwRotation:r})=>{let i=n/2,s=o/2;return[{x:-i,y:-s},{x:i,y:-s},{x:i,y:s},{x:-i,y:s}].map((a)=>{let c=Y8t(a,r);return{x:e+c.x,y:t+c.y}})},Bw=(e)=>{let t,n,o,r=0;if(e.type==="pcb_hole"){if(t=e.hole_width,n=e.hole_height,o=Math.min(t,n)/2,e.hole_shape==="rotated_pill")r=e.ccw_rotation}else if(e.type==="pcb_plated_hole")t=e.outer_width,n=e.outer_height,o=Math.min(t,n)/2,r=e.ccw_rotation;else if(t=e.width,n=e.height,o=e.radius,e.shape==="rotated_pill")r=e.ccw_rotation;let i=Math.max(Math.max(t,n)/2-o,0),s=t>=n?{x:i,y:0}:{x:0,y:i},a=Y8t(s,r);return{start:{x:e.x-a.x,y:e.y-a.y},end:{x:e.x+a.x,y:e.y+a.y},radius:o}},gse=(e)=>{if(e.type==="pcb_smtpad"){if(e.shape==="polygon")return e.points;if(e.shape==="rotated_rect")return Y2e({x:e.x,y:e.y,width:e.width,height:e.height,ccwRotation:e.ccw_rotation})}if(e.type==="pcb_plated_hole"&&"rect_pad_width"in e&&"rect_pad_height"in e)return Y2e({x:e.x,y:e.y,width:e.rect_pad_width,height:e.rect_pad_height,ccwRotation:"rect_ccw_rotation"in e&&typeof e.rect_ccw_rotation==="number"?e.rect_ccw_rotation:0});throw Error(`Expected polygonal pad geometry, got ${e.type} with shape "${e.shape}"`)},Jvt=(e)=>e.map((t,n)=>[t,e[(n+1)%e.length]]),UHe=(e,t,n,o)=>{let r=c2e(e,t,n,o);if(r)return{distance:0,pointOnA:r,pointOnB:r,center:r};let i=[{pointOnA:e,pointOnB:Ly(e,n,o)},{pointOnA:t,pointOnB:Ly(t,n,o)},{pointOnA:Ly(n,e,t),pointOnB:n},{pointOnA:Ly(o,e,t),pointOnB:o}],s=i[0],a=Hj(s.pointOnA,s.pointOnB);for(let c of i.slice(1)){let l=Hj(c.pointOnA,c.pointOnB);if(l<a)s=c,a=l}return{distance:c5(e,t,n,o),pointOnA:s.pointOnA,pointOnB:s.pointOnB,center:{x:(s.pointOnA.x+s.pointOnB.x)/2,y:(s.pointOnA.y+s.pointOnB.y)/2}}},Ase=(e,t,n)=>{if(n.length<3)return{distance:Number.POSITIVE_INFINITY,center:e,tracePoint:e,obstaclePoint:e};let o=Jvt(n).map(([i,s])=>c2e(e,t,i,s)).filter((i)=>i!==null);if(o.length>0){let i=t.x-e.x,s=t.y-e.y,a=i*i+s*s;return o.sort((c,l)=>{let h=((c.x-e.x)*i+(c.y-e.y)*s)/a,d=((l.x-e.x)*i+(l.y-e.y)*s)/a;return h-d}),{distance:0,center:o[0],tracePoint:o[0],obstaclePoint:o[0]}}if(Db(e,n)||Db(t,n)){let i={x:(e.x+t.x)/2,y:(e.y+t.y)/2};return{distance:0,center:i,tracePoint:i,obstaclePoint:i}}let r=UHe(e,t,n[0],n[1]);for(let[i,s]of Jvt(n).slice(1)){let a=UHe(e,t,i,s);if(a.distance<r.distance)r=a}return{distance:r.distance,center:r.center,tracePoint:r.pointOnA,obstaclePoint:r.pointOnB}},cEo=(e,t)=>{let n=Bw(t),o=UHe({x:e.x1,y:e.y1},{x:e.x2,y:e.y2},n.start,n.end);return{distance:o.distance,center:o.center,radius:n.radius,tracePoint:o.pointOnA,obstaclePoint:o.pointOnB}};function Zvt(e,t){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}var RHe=0.000000001,rS=0.000000001;function lEo(e,t){let n=(e.y-t.start.y)*(t.end.x-t.start.x)-(e.x-t.start.x)*(t.end.y-t.start.y);if(Math.abs(n)>RHe)return!1;let o=(e.x-t.start.x)*(t.end.x-t.start.x)+(e.y-t.start.y)*(t.end.y-t.start.y);if(o<-RHe)return!1;let r=(t.end.x-t.start.x)**2+(t.end.y-t.start.y)**2;return o<=r+RHe}function QHe(e,t){let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o],s=t[r];if(lEo(e,{start:i,end:s}))return!0;if(i.y>e.y!==s.y>e.y&&e.x<(s.x-i.x)*(e.y-i.y)/(s.y-i.y)+i.x)n=!n}return n}function tK(e,t){if(t.type==="pcb_smtpad"){if(t.shape==="circle")return Zvt(e,t)<=t.radius+rS;if(t.shape==="rect"){let n=t.width/2,o=t.height/2;return Math.abs(e.x-t.x)<=n+rS&&Math.abs(e.y-t.y)<=o+rS}if(t.shape==="rotated_rect")return QHe(e,gse(t));if(t.shape==="pill"||t.shape==="rotated_pill"){if(t.shape==="rotated_pill"){let c=Bw(t);return ga(e,c.start,c.end)<=c.radius+rS}let n=t.width/2,o=t.height/2,r=t.radius;if(Math.abs(e.x-t.x)<=n-r+rS&&Math.abs(e.y-t.y)<=o+rS)return!0;let i=Math.max(Math.abs(e.x-t.x)-(n-r),0),s=Math.max(Math.abs(e.y-t.y)-(o-r),0),a=r+rS;return i*i+s*s<=a*a}if(t.shape==="polygon")return QHe(e,t.points)}if(t.type==="pcb_plated_hole"){if(t.shape==="circle")return Zvt(e,t)<=t.outer_diameter/2+rS;if("rect_pad_width"in t&&"rect_pad_height"in t)return QHe(e,gse(t));if(t.shape==="oval"||t.shape==="pill")return Math.abs(e.x-t.x)<=t.outer_width/2+rS&&Math.abs(e.y-t.y)<=t.outer_height/2+rS}return!1}function Vg(e){if(e.type==="pcb_trace_segment")return[e.layer];if(e.type==="pcb_smtpad")return[e.layer];if(e.type==="pcb_plated_hole")return Array.isArray(e.layers)?e.layers:[...Hg];if(e.type==="pcb_hole")return[...Hg];if(e.type==="pcb_via")return Array.isArray(e.layers)?e.layers:[...Hg];if(e.type==="pcb_keepout")return Array.isArray(e.layers)?e.layers:[];return[]}function hEo(e,t){return e.route_type==="wire"&&Vg(t).includes(e.layer)&&tK(e,t)}var zy=0.000000001;function sFe(e){let t=new WeakMap,n=(o)=>{let r=t.get(o);if(!r)r={box:o.box,facePoints:[...o.faces].map((i)=>i.first.start),edges:[...o.edges].map((i)=>i.shape),edgeIndex:o.edges},t.set(o,r);return r};return(o,r)=>{if(o.isEmpty()||r.isEmpty())return!1;let i=n(o),s=n(r);if(i.box.xmin>s.box.xmax+e||i.box.xmax<s.box.xmin-e||i.box.ymin>s.box.ymax+e||i.box.ymax<s.box.ymin-e)return!1;if(i.facePoints.some((l)=>s.box.contains(l)&&r.contains(l))||s.facePoints.some((l)=>i.box.contains(l)&&o.contains(l)))return!0;let[a,c]=i.edges.length<=s.edges.length?[i,s]:[s,i];for(let l of a.edges){let h=l.box,d=new YA(h.xmin-e,h.ymin-e,h.xmax+e,h.ymax+e),u=c.edgeIndex.search(d);for(let _ of u)if(l.distanceTo(_.shape)[0]<=e)return!0}return!1}}var sS=1e6;function dEo({center:e,radius:t,holeRadius:n=0}){if(n>0)return NR(e,t*2,n*2).scale(sS,sS);return new El(new sO(new sa(e.x*sS,e.y*sS),t*sS))}function uEo(e,t){let n=new Map;for(let r of e){if(r.type!=="pcb_copper_pour"||!r.source_net_id)continue;let i=t.getNetConnectedToId(r.source_net_id);if(!i)continue;let s=n.get(i)??[];s.push({layer:r.layer,polygon:DR(r).scale(sS,sS)}),n.set(i,s)}let o=sFe(zy*sS);return(r)=>{let i=(n.get(r.netId)??[]).filter((a)=>r.layers.includes(a.layer));if(r.radius===0){let a=new sa(r.center.x*sS,r.center.y*sS);return i.some((c)=>c.polygon.contains(a))}if(i.length===0)return!1;let s=dEo(r);return i.some((a)=>o(s,a.polygon))}}var d1={min_trace_width:0.1,min_via_hole_edge_to_via_hole_edge_clearance:0.1,min_plated_hole_drill_edge_to_drill_edge_clearance:0.15,min_trace_to_hole_edge_clearance:0.2,min_trace_to_pad_edge_clearance:0.1,min_pad_edge_to_pad_edge_clearance:0.1,min_board_edge_clearance:0.2,min_via_hole_diameter:0.2,min_via_pad_diameter:0.3},pEo=0.1,{min_trace_width:WHe,min_via_pad_diameter:ICs,min_board_edge_clearance:vCs,min_via_hole_edge_to_via_hole_edge_clearance:SCs,min_via_hole_edge_to_via_hole_edge_clearance:PCs,min_pad_edge_to_pad_edge_clearance:ECs}=d1,x3=0.005,O9=(e)=>e.find((t)=>t.type==="pcb_board"),z9=(e,t)=>e?.[t],cS=(e)=>{if(e.type==="pcb_keepout"){if(e.shape==="outline")return{minX:Math.min(...e.outline.map((t)=>t.x)),minY:Math.min(...e.outline.map((t)=>t.y)),maxX:Math.max(...e.outline.map((t)=>t.x)),maxY:Math.max(...e.outline.map((t)=>t.y))};if(e.shape==="circle")return{minX:e.center.x-e.radius,minY:e.center.y-e.radius,maxX:e.center.x+e.radius,maxY:e.center.y+e.radius};return{minX:e.center.x-e.width/2,minY:e.center.y-e.height/2,maxX:e.center.x+e.width/2,maxY:e.center.y+e.height/2}}return ky([e])},XHe=(e)=>{if(e.type==="pcb_keepout"&&e.shape!=="outline")return e.center;let t=cS(e);return dO({x:t.minX,y:t.minY},{x:t.maxX,y:t.maxY})},mEo=(e)=>{if(e.type==="pcb_keepout"&&e.shape==="circle")return e.radius;let t=cS(e);return Math.min(t.maxX-t.minX,t.maxY-t.minY)/2},_O=(e)=>e.type==="pcb_via"||e.shape==="circle",gO=(e)=>e.type==="pcb_smtpad"&&(e.shape==="pill"||e.shape==="rotated_pill")||e.type==="pcb_plated_hole"&&(e.shape==="oval"||e.shape==="pill"),AO=(e)=>{let t=XHe(e);return{kind:"circle",x:t.x,y:t.y,radius:mEo(e)}},fO=(e)=>{if(e.type==="pcb_keepout"){if(e.shape==="outline")return{kind:"polygon",points:e.outline};if(e.shape!=="rect")throw Error(`Expected rectangular keepout, got ${e.shape}`);return{kind:"polygon",points:[{x:e.center.x-e.width/2,y:e.center.y-e.height/2},{x:e.center.x+e.width/2,y:e.center.y-e.height/2},{x:e.center.x+e.width/2,y:e.center.y+e.height/2},{x:e.center.x-e.width/2,y:e.center.y+e.height/2}]}}if(e.type==="pcb_smtpad"&&(e.shape==="polygon"||e.shape==="rotated_rect"))return{kind:"polygon",points:gse(e)};if(e.type==="pcb_plated_hole"&&"rect_pad_width"in e&&"rect_pad_height"in e)return{kind:"polygon",points:gse(e)};let t=cS(e);return{kind:"polygon",points:[{x:t.minX,y:t.minY},{x:t.maxX,y:t.minY},{x:t.maxX,y:t.maxY},{x:t.minX,y:t.maxY}]}},jHe=(e)=>{if(e.type!=="pcb_smtpad"||e.shape!=="rect"&&e.shape!=="rotated_rect"||!e.corner_radius||e.corner_radius<=0)return null;let t=Math.min(e.corner_radius,e.width/2,e.height/2);if(t===Math.min(e.width,e.height)/2)return{core:{...e,shape:"rotated_pill",radius:t,ccw_rotation:e.shape==="rotated_rect"?e.ccw_rotation:0},radius:0};return{core:{...e,width:e.width-2*t,height:e.height-2*t,corner_radius:0},radius:t}},y3=(e,t)=>{let n=jHe(e),o=jHe(t);if(n||o)return y3(n?.core??e,o?.core??t)-(n?.radius??0)-(o?.radius??0);if(gO(e)&&gO(t)){let r=Bw(e),i=Bw(t);return c5(r.start,r.end,i.start,i.end)-r.radius-i.radius}if(gO(e)&&_O(t)){let r=Bw(e);return jie(r.start,r.end,AO(t))-r.radius}if(_O(e)&&gO(t)){let r=Bw(t);return jie(r.start,r.end,AO(e))-r.radius}if(gO(e)){let r=Bw(e);return Ase(r.start,r.end,fO(t).points).distance-r.radius}if(gO(t)){let r=Bw(t);return Ase(r.start,r.end,fO(e).points).distance-r.radius}if(_O(e)&&_O(t))return ivt(AO(e),AO(t));if(_O(e))return JLe(AO(e),fO(t));if(_O(t))return JLe(AO(t),fO(e));return svt(fO(e),fO(t))},UR=(e)=>[...Ps(e).pcb_smtpad.list(),...Ps(e).pcb_plated_hole.list()],G8t=(e)=>Ps(e).pcb_trace.list().flatMap((n)=>{let o=[];for(let r=0;r<n.route.length-1;r++){let i=n.route[r],s=n.route[r+1];if(i.route_type!=="wire")continue;if(s.route_type!=="wire")continue;if(i.layer!==s.layer)continue;o.push({type:"pcb_trace_segment",pcb_trace_id:n.pcb_trace_id,_pcbTrace:n,thickness:"width"in i?i.width:("width"in s)?s.width:WHe,layer:i.layer,x1:i.x,y1:i.y,x2:s.x,y2:s.y})}return o}),kHe=({tracePoint:e,obstaclePoint:t,traceRadius:n,obstacleRadius:o})=>{let r=t.x-e.x,i=t.y-e.y,s=Math.hypot(r,i);if(s===0)return dO(e,t);let a=r/s,c=i/s;if(s<=n+o){let d=Math.max(-n,s-o),u=Math.min(n,s+o),_=(d+u)/2;return{x:e.x+a*_,y:e.y+c*_}}let l={x:e.x+a*n,y:e.y+c*n},h={x:t.x-a*o,y:t.y-c*o};return dO(l,h)},xse=(e,t)=>{let n=jHe(t);if(n)t=n.core;let o=n?.radius??0,r={x:e.x1,y:e.y1},i={x:e.x2,y:e.y2},s=e.thickness/2;if(t.type==="pcb_via"||_O(t)){let c=t.type==="pcb_via"?{x:t.x,y:t.y,radius:t.outer_diameter/2}:AO(t),l=Ly(c,r,i);return{gap:jie(r,i,c)-s,center:kHe({tracePoint:l,obstaclePoint:c,traceRadius:s,obstacleRadius:c.radius})}}if(gO(t)){let c=cEo(e,t);return{gap:c.distance-s-c.radius,center:kHe({tracePoint:c.tracePoint,obstaclePoint:c.obstaclePoint,traceRadius:s,obstacleRadius:c.radius})}}let a=Ase(r,i,fO(t).points);return{gap:a.distance-s-o,center:kHe({tracePoint:a.tracePoint,obstaclePoint:a.obstaclePoint,traceRadius:s,obstacleRadius:o})}},$j=(e)=>e<=0,_Eo=(e,t)=>xse({x1:e.x,y1:e.y,x2:e.x,y2:e.y,thickness:e.outer_diameter},t).center;function gEo(e){let t=e.find((r)=>r.type==="pcb_board")?.num_layers,n=Hg.filter((r)=>r.startsWith("inner"));if(t!==void 0)n=n.slice(0,Math.max(0,t-2));let o=["top",...n];if(t!==1)o.push("bottom");return o}function AEo(e){return e.filter((t)=>Number.isFinite(t.outer_diameter)&&t.outer_diameter>0).map((t)=>({id:t.pcb_via_id,layers:Vg(t),x:t.x,y:t.y,radius:t.outer_diameter/2,holeRadius:t.hole_diameter/2}))}function fEo({traces:e,vias:t},{circuitJson:n,connMap:o}){let r=gEo(n),i=[];for(let s of e)for(let a of s.route){if(a.route_type!=="via")continue;if(t.some((_)=>Math.hypot(_.x-a.x,_.y-a.y)<=zy&&(_.pcb_trace_id===s.pcb_trace_id||!_.pcb_trace_id&&o.areIdsConnected(_.pcb_via_id,s.pcb_trace_id))))continue;let l=r.indexOf(a.from_layer),h=r.indexOf(a.to_layer);if(l<0||h<0)continue;let d=a.outer_diameter,u;if(d!==void 0){if(!Number.isFinite(d)||d<=0)continue;u=d/2}i.push({id:s.pcb_trace_id,layers:r.slice(Math.min(l,h),Math.max(l,h)+1),x:a.x,y:a.y,radius:u})}return i}function yEo({viaCopper:e,pad:t}){if(e.radius===void 0)return tK(e,t);let n={type:"pcb_via",pcb_via_id:e.id,x:e.x,y:e.y,outer_diameter:e.radius*2,hole_diameter:0,layers:Hg.filter((o)=>e.layers.includes(o))};return y3(n,t)<=zy}function xEo({trace:e,viaCopper:t}){if(e.route_thickness_mode==="interpolated")return!1;for(let n=1;n<e.route.length;n++){let o=e.route[n-1],r=e.route[n];if(o.route_type!=="wire"||r.route_type!=="wire"||o.layer!==r.layer||!t.layers.includes(o.layer)||!Number.isFinite(o.width)||o.width<=0||Math.hypot(o.x-r.x,o.y-r.y)<=zy)continue;let i=0;if(t.radius!==void 0)i=t.radius+o.width/2;if(ga(t,o,r)<=i+zy)return!0}return!1}function CEo(e){let{circuitJson:t,connMap:n,touchesPour:o}=e,r=UR(t),i=t.filter((l)=>l.type==="pcb_trace"),s=t.filter((l)=>l.type==="pcb_via"),a=[...AEo(s),...fEo({traces:i,vias:s},e)],c=new Map;for(let l of a){if(!Number.isFinite(l.x)||!Number.isFinite(l.y))continue;let h=n.getNetConnectedToId(l.id);if(!h)continue;let d=o({netId:h,layers:l.layers,center:l,radius:l.radius??0,holeRadius:l.holeRadius})||r.some((m)=>n.getNetConnectedToId(Za(m))===h&&Vg(m).some((A)=>l.layers.includes(A))&&yEo({viaCopper:l,pad:m})),u=new Set;for(let m of i)if(n.getNetConnectedToId(m.pcb_trace_id)===h&&xEo({trace:m,viaCopper:l}))u.add(m.pcb_trace_id);let _={viaCopper:l,touchesPadOrPour:d,touchingTraceIds:u},p=c.get(h)??new Map;for(let m of l.layers){let A=p.get(m)??[];A.push(_),p.set(m,A)}c.set(h,p)}return c}function bEo({trace:e,point:t,width:n},{connMap:o,viaContactIndex:r}){if(!Number.isFinite(n)||n<=0)return!1;let i=o.getNetConnectedToId(e.pcb_trace_id);if(!i)return!1;return(r.get(i)?.get(t.layer)??[]).some(({viaCopper:a,touchesPadOrPour:c,touchingTraceIds:l})=>{if(!(c||[...l].some((u)=>u!==e.pcb_trace_id)))return!1;let d=0;if(a.radius!==void 0)d=a.radius+n/2;return Math.hypot(t.x-a.x,t.y-a.y)<=d+zy})}function U8t({route:e,anchorPoint:t,fromIndex:n,step:o}){let r=t;for(let i=n;i>=0&&i<e.length;i+=o){let s=e[i];if(s.route_type!=="wire"||s.layer!==t.layer||ga(r,t,s)>zy)break;r=s}return r}function IEo(e,t){if(e.route_thickness_mode==="interpolated")return;let{route:n}=e,o=0,r=1;if(t==="end")o=n.length-1,r=-1;let i=o+r;while(i>=0&&i<n.length){let s=n[o],a=n[i];if(s.route_type!=="wire"||a.route_type!=="wire"||s.layer!==a.layer)return;if(!(Math.hypot(s.x-a.x,s.y-a.y)<=zy)){let l=s.width;if(t==="end")l=a.width;let h=U8t({route:n,anchorPoint:s,fromIndex:i,step:r});return{width:l,inwardPoint:h}}o=i,i+=r}return}function vEo({route:e,startIndex:t,start:n,end:o}){let r=n;for(let i=t-1;i>=0;i--){let s=e[i];if(s.route_type!=="wire"||s.layer!==o.layer||ga(r,s,o)>zy)break;r=s}return r}function SEo(e,t){let n=new Map;for(let o of e){if(o.type!=="pcb_trace")continue;if(o.route_thickness_mode==="interpolated")continue;let r=t.getNetConnectedToId(o.pcb_trace_id);if(!r)continue;for(let i=0;i<o.route.length-1;i++){let s=o.route[i],a=o.route[i+1];if(s.route_type!=="wire"||a.route_type!=="wire")continue;if(s.layer!==a.layer)continue;if(Math.hypot(s.x-a.x,s.y-a.y)<=zy)continue;let c=vEo({route:o.route,startIndex:i,start:s,end:a}),l=U8t({route:o.route,anchorPoint:c,fromIndex:i+1,step:1}),h=n.get(r)??new Map,d=h.get(s.layer)??[];d.push({trace:o,start:s,end:a,centerlineStart:c,centerlineEnd:l}),h.set(s.layer,d),n.set(r,h)}}return n}function PEo({point:e,terminalSegment:t,segment:n}){let o=ga(e,n.start,n.end),r=t.width/2,i=n.start.width/2;if(o+r<=i+zy)return!0;if(ga(t.inwardPoint,n.centerlineStart,n.centerlineEnd)<=zy&&ga(e,n.centerlineStart,n.centerlineEnd)>zy)return!1;return o<=r+i+zy}function EEo(e,t){let n=e.filter((o)=>o.type==="pcb_smtpad"||o.type==="pcb_plated_hole").filter((o)=>o.pcb_port_id);return{circuitJson:e,portPads:n,connMap:t}}function X2e(e){return e.connMap??=Aa(e.circuitJson),e.connMap}function W8t(e){return e.touchesPour??=uEo(e.circuitJson,X2e(e)),e.touchesPour}function MEo(e){return e.traceWireSegmentsByNetAndLayer??=SEo(e.circuitJson,X2e(e)),e.traceWireSegmentsByNetAndLayer}function wEo(e){return e.viaContactIndex??=CEo({circuitJson:e.circuitJson,connMap:X2e(e),touchesPour:W8t(e)}),e.viaContactIndex}function BEo({trace:e,point:t,terminalSegment:n},o){let r=X2e(o),i=r.getNetConnectedToId(e.pcb_trace_id),s=W8t(o);if(i&&s({netId:i,layers:[t.layer],center:t,radius:n.width/2}))return!0;let a=MEo(o);if(i){if((a.get(i)?.get(t.layer)??[]).some((h)=>h.trace.pcb_trace_id!==e.pcb_trace_id&&PEo({point:t,terminalSegment:n,segment:h})))return!0}return bEo({trace:e,point:t,width:n.width},{connMap:r,viaContactIndex:wEo(o)})}function TEo({trace:e,endpoint:t,point:n,hasExpectedPorts:o},r){if(r.portPads.some((s)=>hEo(n,s)))return!1;let i=IEo(e,t);if(!i)return!o;return!BEo({trace:e,point:n,terminalSegment:i},r)}function DEo({trace:e,hasExpectedPorts:t},n){let o=[{endpoint:"start",point:e.route[0]},{endpoint:"end",point:e.route[e.route.length-1]}],r=[];for(let{endpoint:a,point:c}of o){if(c.route_type!=="wire")continue;if(TEo({trace:e,endpoint:a,point:c,hasExpectedPorts:t},n))r.push({endpoint:a,point:c})}let[i,s]=r;if(i&&s&&i.point.layer===s.point.layer&&Math.hypot(i.point.x-s.point.x,i.point.y-s.point.y)<=zy)r.pop();return r}function NEo(e,t={}){let n=EEo(e,t.connMap),o=new Map,r=new Set;for(let s of e){if(s.type==="source_trace")o.set(s.source_trace_id,s);if(s.type==="pcb_port")r.add(s.source_port_id)}let i=[];for(let s of e){if(s.type!=="pcb_trace"||s.route.length===0)continue;if(s.is_antenna_trace===!0)continue;let a=!1;if(s.source_trace_id){let c=o.get(s.source_trace_id);a=Boolean(c?.connected_source_port_ids.some((l)=>r.has(l)))}for(let{endpoint:c,point:l}of DEo({trace:s,hasExpectedPorts:a},n)){let h=Dw(e,s.pcb_trace_id);i.push({type:"pcb_trace_error",error_type:"pcb_trace_error",pcb_trace_error_id:`disconnected_endpoint_${s.pcb_trace_id}_${c}`,message:`Trace [${h}] has dangling endpoint at (${l.x.toFixed(2)}, ${l.y.toFixed(2)})`,source_trace_id:s.source_trace_id||`!${s.pcb_trace_id}`,pcb_trace_id:s.pcb_trace_id,center:{x:l.x,y:l.y},pcb_component_ids:[],pcb_port_ids:[]})}}return i}var KHe=(e,t)=>{let n={x:e.x1,y:e.y1},o={x:e.x2,y:e.y2},r={x:t.x1,y:t.y1},i={x:t.x2,y:t.y2},s={x:o.x-n.x,y:o.y-n.y},a={x:i.x-r.x,y:i.y-r.y},c=s.x*s.x+s.y*s.y,l=a.x*a.x+a.y*a.y;if(c===0||l===0){if(c===0&&l===0)return{x:(n.x+r.x)/2,y:(n.y+r.y)/2};if(c===0){let B=iS(((n.x-r.x)*a.x+(n.y-r.y)*a.y)/l,0,1),T={x:r.x+B*a.x,y:r.y+B*a.y};return{x:(n.x+T.x)/2,y:(n.y+T.y)/2}}let P=iS(((r.x-n.x)*s.x+(r.y-n.y)*s.y)/c,0,1),M={x:n.x+P*s.x,y:n.y+P*s.y};return{x:(M.x+r.x)/2,y:(M.y+r.y)/2}}let h={x:n.x-r.x,y:n.y-r.y},d=s.x*s.x+s.y*s.y,u=s.x*a.x+s.y*a.y,_=s.x*h.x+s.y*h.y,p=a.x*a.x+a.y*a.y,m=a.x*h.x+a.y*h.y,A=d*p-u*u;if(A<0.0000000001)return REo(n,o,r,i,s,a,c,l);let g=(u*m-p*_)/A,f=(d*m-u*_)/A;g=iS(g,0,1),f=iS(f,0,1),f=(g*u+m)/p,f=iS(f,0,1),g=(f*u-_)/d,g=iS(g,0,1);let y={x:n.x+g*s.x,y:n.y+g*s.y},x={x:r.x+f*a.x,y:r.y+f*a.y},C=y.x-x.x,b=y.y-x.y,I=Math.sqrt(C*C+b*b);return{x:(y.x+x.x)/2,y:(y.y+x.y)/2}},REo=(e,t,n,o,r,i,s,a)=>{let c=((n.x-e.x)*r.x+(n.y-e.y)*r.y)/s;c=iS(c,0,1);let l={x:e.x+c*r.x,y:e.y+c*r.y},h=((o.x-e.x)*r.x+(o.y-e.y)*r.y)/s;h=iS(h,0,1);let d={x:e.x+h*r.x,y:e.y+h*r.y},u=((e.x-n.x)*i.x+(e.y-n.y)*i.y)/a;u=iS(u,0,1);let _={x:n.x+u*i.x,y:n.y+u*i.y},p=((t.x-n.x)*i.x+(t.y-n.y)*i.y)/a;p=iS(p,0,1);let m={x:n.x+p*i.x,y:n.y+p*i.y},g=[{pointA:l,pointB:n,distance:Math.sqrt((l.x-n.x)**2+(l.y-n.y)**2)},{pointA:d,pointB:o,distance:Math.sqrt((d.x-o.x)**2+(d.y-o.y)**2)},{pointA:e,pointB:_,distance:Math.sqrt((e.x-_.x)**2+(e.y-_.y)**2)},{pointA:t,pointB:m,distance:Math.sqrt((t.x-m.x)**2+(t.y-m.y)**2)}].reduce((f,y)=>y.distance<f.distance?y:f);return{x:(g.pointA.x+g.pointB.x)/2,y:(g.pointA.y+g.pointB.y)/2}},iS=(e,t,n)=>Math.max(t,Math.min(n,e));function $He(e){if(e.route_type!=="wire")return[];return[e.start_pcb_port_id,e.end_pcb_port_id].filter((t)=>Boolean(t))}function QEo(e){let t=new Set;for(let n of e.route)for(let o of $He(n))t.add(o);return Array.from(t)}function cse(e){let t=new Set;for(let n of e)for(let o of QEo(n))t.add(o);return Array.from(t)}function kEo(e){let t=new Set(e.flatMap((r)=>r.type==="source_bus"&&r.max_length_skew!==void 0?r.source_trace_ids:[])),n=Ps(e),o=[];for(let r of e){if(r.type!=="pcb_trace")continue;if(!r.source_trace_id||!t.has(r.source_trace_id))continue;let i=[],s=[],a=0,c=0;for(let h=0;h<r.route.length-1;h++){s[h]=a;let d=r.route[h],u=r.route[h+1];if(d.route_type!=="wire"||u.route_type!=="wire"||d.layer!==u.layer){c++;continue}let _=Math.hypot(u.x-d.x,u.y-d.y);if(_===0)continue;i.push({type:"pcb_trace_segment",_pcbTrace:r,pcb_trace_id:r.pcb_trace_id,thickness:d.width,layer:d.layer,x1:d.x,y1:d.y,x2:u.x,y2:u.y,run:c,startDistance:a,endDistance:a+_}),a+=_}s[r.route.length-1]=a;let l;e:for(let h=0;h<i.length;h++){let d=i[h];for(let u=h+1;u<i.length;u++){let _=i[u];if(d.layer!==_.layer)continue;let p=(d.thickness+_.thickness)/2,m=(d.x2-d.x1)*(_.x2-_.x1)+(d.y2-d.y1)*(_.y2-_.y1),A=(d.x2-d.x1)*(_.y2-_.y1)-(d.y2-d.y1)*(_.x2-_.x1),g=Math.hypot(d.x2-d.x1,d.y2-d.y1)*Math.hypot(_.x2-_.x1,_.y2-_.y1),f=m>=-0.000000001*g,y=d.run===_.run&&_.startDistance===d.endDistance;if(y&&!(m<0&&Math.abs(A)<0.000000001))continue;if(!y&&d.run===_.run&&_.startDistance-d.endDistance<=Math.SQRT2*p&&f)continue;if(c5({x:d.x1,y:d.y1},{x:d.x2,y:d.y2},{x:_.x1,y:_.y1},{x:_.x2,y:_.y2})-p>0.000000001)continue;l=KHe(d,_);break e}}if(!l){let h=e.find((u)=>u.type==="pcb_board"),d=["top",...Hg.filter((u)=>u.startsWith("inner")).slice(0,h?Math.max(0,h.num_layers-2):void 0),...h?.num_layers===1?[]:["bottom"]];e:for(let u=0;u<r.route.length;u++){let _=r.route[u];if(_.route_type!=="via")continue;let p=n.pcb_via.list().find((y)=>(y.pcb_trace_id===r.pcb_trace_id||!y.pcb_trace_id&&y.source_trace_id===r.source_trace_id)&&Math.hypot(y.x-_.x,y.y-_.y)<=0.000000001),m=p?.outer_diameter??_.outer_diameter;if(m===void 0||!Number.isFinite(m)||m<=0)continue;let A=d.indexOf(_.from_layer),g=d.indexOf(_.to_layer),f=p?.layers??(A>=0&&g>=0?d.slice(Math.min(A,g),Math.max(A,g)+1):[]);for(let y of i){if(!f.includes(y.layer))continue;let x=(m+y.thickness)/2;if(Math.max(y.startDistance-s[u],s[u]-y.endDistance,0)<=x+0.000000001)continue;let b={...y,x1:_.x,y1:_.y,x2:_.x,y2:_.y};if(c5(_,_,{x:y.x1,y:y.y1},{x:y.x2,y:y.y2})-x>0.000000001)continue;l=KHe(y,b);break e}}}if(l){let h=n.source_trace.get(r.source_trace_id),d=(h?.connected_source_port_ids??[]).map((_)=>{let p=n.source_port.get(_),m=p?.source_component_id?n.source_component.get(p.source_component_id):void 0;return m?.name&&p?.name?`${m.name}.${p.name}`:void 0}).filter((_)=>Boolean(_)),u=h?.name||h?.display_name||d.join(" → ")||"unnamed";o.push({type:"pcb_trace_error",error_type:"pcb_trace_error",pcb_trace_error_id:`self_short_${r.pcb_trace_id}`,pcb_trace_id:r.pcb_trace_id,source_trace_id:r.source_trace_id,message:`PCB trace "${u}" shorts to itself, bypassing part of its length-matched route`,center:l,pcb_component_ids:[],pcb_port_ids:cse([r]),subcircuit_id:r.subcircuit_id})}}return o}function e8t(e,t){let n=p3.getTolerance(),o=e.edges.search(new YA(t.x-n,t.y-n,1/0,t.y+n)),r=!1;for(let i of o){if(!(i instanceof Zfe))throw Error("Expected a polygon edge in the spatial index");let s=i.shape;if(!(s instanceof Fg||s instanceof Kp))throw Error("Expected a segment or arc in the polygon");if(s.contains(t))return!0;if(s instanceof Fg){let{start:a,end:c}=s;if(a.y>t.y===c.y>t.y)continue;if(a.x+(t.y-a.y)*(c.x-a.x)/(c.y-a.y)>t.x)r=!r}else{let a=2*Math.PI,c=(s.startAngle%a+a)%a,l=new Kp(s.pc,s.r,c,c+(s.counterClockwise?s.sweep:-s.sweep),s.counterClockwise).breakToFunctional(),h=i.prev.shape instanceof Fg?i.prev.end.y:s.start.y,d=i.next.start.y;for(let[u,_]of l.entries()){let p=u===0?h:_.start.y,m=u===l.length-1?d:_.end.y;if(p>t.y===m>t.y)continue;let A=t.y-_.pc.y;if(Math.abs(A)>_.r)continue;let g=Math.sqrt((_.r-A)*(_.r+A));if(_.pc.x+(_.middle().x>=_.pc.x?g:-g)>t.x)r=!r}}}return r}var YR=0.000000001,F9=(e)=>new sa(e.x,e.y);function Nw(e,t){if(!Number.isFinite(e)||e<=0)throw Error(`${t} must be finite and positive`);return e}function Oy(e,t){return Nw(t,"radius"),new El(new sO(F9(e),t))}function f3(e){let t=e.filter((r,i)=>i===0||F9(r).distanceTo(F9(e[i-1]))[0]>YR);if(t.length>1&&F9(t[0]).distanceTo(F9(t.at(-1)))[0]<=YR)t.pop();if(t.length<2)throw Error("A ring needs at least two distinct vertices");let n=t.map((r,i)=>{let s=t[(i+1)%t.length];if(![r.x,r.y,r.bulge??0].every(Number.isFinite))throw Error("Non-finite ring vertex");let a=r.bulge??0;if(Math.abs(a)<=YR)return new Fg(F9(r),F9(s));let c=s.x-r.x,l=s.y-r.y,h=Math.hypot(c,l),d=h*(1-a*a)/(4*a),u=new sa((r.x+s.x)/2-l/h*d,(r.y+s.y)/2+c/h*d);return new Kp(u,h*(1+a*a)/(4*Math.abs(a)),Math.atan2(r.y-u.y,r.x-u.x),Math.atan2(s.y-u.y,s.x-u.x),a>0)}),o=new El;if(o.addFace(n),o.area()<=YR)throw Error("A ring must enclose a non-zero area");return o}function h1(e,t,n,o=0,r=0){if(Nw(t,"width"),Nw(n,"height"),!Number.isFinite(o)||!Number.isFinite(r)||r<0)throw Error("Invalid rectangle rotation or corner radius");let i=Math.min(r,t/2,n/2),s=t/2,a=n/2,c;if(i<=YR)c=f3([{x:-s,y:-a},{x:s,y:-a},{x:s,y:a},{x:-s,y:a}]);else{let l=[new sa(s-i,-a+i),new sa(s-i,a-i),new sa(-s+i,a-i),new sa(-s+i,-a+i)],h=[];for(let d=0;d<4;d++){let u=-Math.PI/2+d*Math.PI/2,_=new Kp(l[d],i,u,u+Math.PI/2,!0),p=l[(d+1)%4],m=new sa(p.x+i*Math.cos(u+Math.PI/2),p.y+i*Math.sin(u+Math.PI/2));if(h.push(_),_.end.distanceTo(m)[0]>YR)h.push(new Fg(_.end,m))}c=new El,c.addFace(h)}return c.rotate(o*Math.PI/180).translate(new Bj(e.x,e.y))}function qHe(e,t,n,o=n){let r=Nw(n,"trace width")/2,i=Nw(o,"trace width")/2,s=F9(e).distanceTo(F9(t))[0];if(s<=Math.abs(r-i)+YR)return Oy(r>=i?e:t,Math.max(r,i));let a=Math.atan2(t.y-e.y,t.x-e.x),c=Math.acos((r-i)/s),l=a-c,h=a+c,d=(_,p,m)=>new sa(_.x+p*Math.cos(m),_.y+p*Math.sin(m)),u=new El;return u.addFace([new Fg(d(e,r,l),d(t,i,l)),new Kp(F9(t),i,l,h,!0),new Fg(d(t,i,h),d(e,r,h)),new Kp(F9(e),r,h,l,!0)]),u}function G2e(e,t){let n=e.clone(),o=[...n.faces][0].orientation();for(let r of t){let i=r.clone();if([...i.faces][0].orientation()===o)i.reverse();for(let s of i.faces)n.addFace(s.shapes)}return n}function H2e(e,t,n,o=0,r=0.001){if(Nw(t,"ellipse width"),Nw(n,"ellipse height"),Nw(r,"curveTolerance"),Math.abs(t-n)<YR)return Oy(e,t/2);let i=Math.max(t,n)/2,s=Math.max(16,Math.ceil(Math.PI/Math.acos(Math.max(-1,1-r/i))));if(s>1e5)throw Error("curveTolerance requires more than 100000 ellipse segments");return f3(Array.from({length:s},(a,c)=>({x:t/2*Math.cos(c*2*Math.PI/s),y:n/2*Math.sin(c*2*Math.PI/s)}))).rotate(o*Math.PI/180).translate(new Bj(e.x,e.y))}function LEo(e,t){if(t.copperLayers){if(!t.copperLayers.length||new Set(t.copperLayers).size!==t.copperLayers.length)throw Error("copperLayers must be a non-empty list without duplicates");return[...t.copperLayers]}let o=e.find((r)=>r.type==="pcb_board")?.num_layers??2;for(let r of e){let i="layers"in r?r.layers:("layer"in r)?[r.layer]:[];if(Array.isArray(i))for(let s of i){let a=typeof s==="string"&&/^inner(\d+)$/.exec(s);if(a)o=Math.max(o,Number(a[1])+2)}if(r.type==="pcb_trace")for(let s of r.route)for(let a of s.route_type==="wire"?[s.layer]:s.route_type==="via"?[s.from_layer,s.to_layer]:[s.start_layer,s.end_layer]){let c=/^inner(\d+)$/.exec(a);if(c)o=Math.max(o,Number(c[1])+2)}}if(!Number.isInteger(o)||o<1||o>10)throw Error("Supported copper layer count is 1–10");return o===1?["top"]:["top",...Array.from({length:o-2},(r,i)=>`inner${i+1}`),"bottom"]}function dse(e,t){if(!e.length)return[];let n=e.map((o)=>t.indexOf(o));if(n.some((o)=>o<0))throw Error(`Layer is missing from copperLayers: ${e.join(", ")}`);return t.slice(Math.min(...n),Math.max(...n)+1)}function HEo(e){switch(e.shape){case"circle":return Oy(e,e.radius);case"polygon":return f3(e.points);case"rect":case"rotated_rect":return h1(e,e.width,e.height,"ccw_rotation"in e?e.ccw_rotation:0,e.rect_border_radius??e.corner_radius??0);case"pill":case"rotated_pill":return h1(e,e.width,e.height,"ccw_rotation"in e?e.ccw_rotation:0,e.radius)}}function FEo(e,t){switch(e.hole_shape){case"circle":return Oy(e,e.hole_diameter/2);case"square":return h1(e,e.hole_diameter,e.hole_diameter);case"rect":return h1(e,e.hole_width,e.hole_height);case"oval":return H2e(e,e.hole_width,e.hole_height,0,t);case"pill":case"rotated_pill":return h1(e,e.hole_width,e.hole_height,"ccw_rotation"in e?e.ccw_rotation:0,Math.min(e.hole_width,e.hole_height)/2)}}function zEo(e,t,n,o){let r,i,s={x:e.x+("hole_offset_x"in e?e.hole_offset_x??0:0),y:e.y+("hole_offset_y"in e?e.hole_offset_y??0:0)};switch(e.shape){case"circle":r=Oy(e,e.outer_diameter/2),i=Oy(e,e.hole_diameter/2);break;case"oval":r=H2e(e,e.outer_width,e.outer_height,e.ccw_rotation,o),i=H2e(e,e.hole_width,e.hole_height,e.ccw_rotation,o);break;case"pill":r=h1(e,e.outer_width,e.outer_height,e.ccw_rotation,Math.min(e.outer_width,e.outer_height)/2),i=h1(e,e.hole_width,e.hole_height,e.ccw_rotation,Math.min(e.hole_width,e.hole_height)/2);break;case"circular_hole_with_rect_pad":case"pill_hole_with_rect_pad":case"rotated_pill_hole_with_rect_pad":r=h1(e,e.rect_pad_width,e.rect_pad_height,"rect_ccw_rotation"in e?e.rect_ccw_rotation:0,e.rect_border_radius??0),i=e.shape==="circular_hole_with_rect_pad"?Oy(s,e.hole_diameter/2):h1(s,e.hole_width,e.hole_height,"hole_ccw_rotation"in e?e.hole_ccw_rotation:0,Math.min(e.hole_width,e.hole_height)/2);break;case"hole_with_polygon_pad":{let a=e.ccw_rotation??t;r=f3(e.pad_outline).rotate(a*Math.PI/180).translate(new Bj(e.x,e.y)),i=e.hole_shape==="circle"?Oy(s,e.hole_diameter/2):e.hole_shape==="oval"?H2e(s,e.hole_width,e.hole_height,a,o):h1(s,e.hole_width,e.hole_height,a,Math.min(e.hole_width,e.hole_height)/2);break}}return n?G2e(r,[i]):r}var LHe=(e,t)=>e.x===t.x&&e.y===t.y,t8t=(e,t)=>{let n=Math.hypot(e,t);return n?{x:e/n,y:t/n}:{x:1,y:0}};function OEo(e){let t=[{...e[0].start,width:e[0].startWidth},...e.map((i)=>({...i.end,width:i.endWidth}))],n=e.map((i)=>t8t(i.end.x-i.start.x,i.end.y-i.start.y)),o=[],r=[];for(let i=0;i<t.length;i++){let s=t[i];Nw(s.width,"interpolated trace width");let a=n[Math.max(0,i-1)],c=n[Math.min(i,n.length-1)],l=t8t(a.x+c.x,a.y+c.y),h=-l.y*s.width/2,d=l.x*s.width/2;o.push({x:s.x+h,y:s.y+d}),r.push({x:s.x-h,y:s.y-d})}return f3([...o,...r.reverse()])}function VEo(e,t){try{return Mj.subtract(e,t)}catch(n){if(!(n instanceof Error)||n.message!=="Unresolved boundary conflict in boolean operation")throw n;let o=new s2(1000,0,0,1000,0,0),r=new s2(0.001,0,0,0.001,0,0);return Mj.subtract(e.transform(o),t.transform(o)).transform(r)}}function YEo(e,t,n){let o=new Map,r=new Map,i=[],s=(a,c)=>o.set(a,[...o.get(a)??[],c]);for(let a of e.route){if(a.route_type==="via"){let c=a,l=a.outer_diameter??c.via_diameter;if(l===void 0)continue;let h=a.hole_diameter??c.via_hole_diameter,d=Oy(a,l/2),u=n&&h?Oy(a,h/2):void 0;for(let _ of dse([a.from_layer,a.to_layer],t))if(s(_,u?G2e(d,[u]):d),u)r.set(_,[...r.get(_)??[],u])}if(a.route_type==="through_pad")for(let c of new Set([a.start_layer,a.end_layer]))s(c,qHe(a.start,a.end,a.width))}for(let a=0;a<e.route.length-1;a++){let c=e.route[a],l=e.route[a+1],h=c.route_type==="through_pad"?c.end:c,d=l.route_type==="through_pad"?l.start:l;if(LHe(h,d))continue;let u=c.route_type==="wire"?[c.layer]:c.route_type==="via"?dse([c.from_layer,c.to_layer],t):[c.end_layer],_=l.route_type==="wire"?[l.layer]:l.route_type==="via"?dse([l.from_layer,l.to_layer],t):[l.start_layer],p=u.filter((g)=>_.includes(g));if(p.length!==1)throw Error(`Cannot determine one wire layer between route points ${a} and ${a+1}`);let m=p[0],A="width"in c?c.width:("width"in l)?l.width:void 0;if(A===void 0||LHe(h,d))continue;i.push({start:h,end:d,layer:m,startWidth:A,endWidth:"width"in l?l.width:A})}if(e.route_thickness_mode==="interpolated"){let a=[],c=()=>{if(a.length)s(a[0].layer,OEo(a)),a=[]};for(let l of i){let h=a.at(-1);if(h&&(h.layer!==l.layer||!LHe(h.end,l.start)||h.endWidth!==l.startWidth))c();a.push(l)}c()}else for(let a of i)s(a.layer,qHe(a.start,a.end,a.startWidth));for(let[a,c]of r)o.set(a,o.get(a).map((l)=>c.reduce((h,d)=>VEo(h,d),l)).filter((l)=>l.faces.size>0));return o}var GEo=["pcb_board","pcb_smtpad","pcb_plated_hole","pcb_hole","pcb_via","pcb_trace","pcb_copper_pour","pcb_cutout","pcb_keepout","pcb_courtyard_rect","pcb_courtyard_circle","pcb_courtyard_pill","pcb_courtyard_polygon","pcb_courtyard_outline"];function UEo(e){switch(e.shape){case"circle":return[Oy(e.center,e.radius)];case"rect":return[h1(e.center,e.width,e.height,e.rotation,e.corner_radius)];case"polygon":return[f3(e.points)];case"path":{if(e.slot_length!==void 0||e.space_between_slots!==void 0||e.slot_corner_radius!==void 0)throw Error("Patterned/custom-corner path cutouts are not supported; use explicit rect/polygon cutouts");return e.route.slice(1).map((t,n)=>qHe(e.route[n],t,e.slot_width))}}}function Jj(e,t={}){if(t.layer&&t.layers)throw Error("Specify layer or layers, not both");let n=t.layer?[t.layer]:t.layers,o=LEo(e,t),r={elements:[],warnings:[],bounds:void 0,copperLayers:o},i=new Map(e.filter((c)=>c.type==="pcb_component").map((c)=>[c.pcb_component_id,c.rotation])),s=t.curveTolerance??0.001;if(!Number.isFinite(s)||s<=0)throw Error("curveTolerance must be finite and positive");let a=t.includeDrillHoles!==!1;for(let c of e){if(!GEo.includes(c.type))continue;let l=c[`${c.type}_id`];if(t.elementTypes&&!t.elementTypes.includes(c.type))continue;if(t.elementIds&&!t.elementIds.includes(l))continue;let h="copper",d=[null],u=[],_;try{switch(c.type){case"pcb_smtpad":d=[c.layer],u=[HEo(c)];break;case"pcb_plated_hole":d=dse(c.layers,o),u=[zEo(c,i.get(c.pcb_component_id??"")??0,a,s)];break;case"pcb_via":{d=dse(c.layers,o);let m=Oy(c,c.outer_diameter/2);u=[a?G2e(m,[Oy(c,c.hole_diameter/2)]):m];break}case"pcb_trace":_=YEo(c,o,a),d=[..._.keys()];break;case"pcb_copper_pour":d=[c.layer],u=[c.shape==="rect"?h1(c.center,c.width,c.height,c.rotation):c.shape==="polygon"?f3(c.points):G2e(f3(c.brep_shape.outer_ring.vertices),c.brep_shape.inner_rings.map((m)=>f3(m.vertices)))];break;case"pcb_board":h="board",u=[c.outline?.length?f3(c.outline):h1(c.center,c.width,c.height)];break;case"pcb_hole":h="drill",u=[FEo(c,s)];break;case"pcb_cutout":h="cutout",u=UEo(c);break;case"pcb_keepout":h="keepout",d=c.layers,u=[c.shape==="circle"?Oy(c.center,c.radius):c.shape==="rect"?h1(c.center,c.width,c.height):f3(c.outline)];break;case"pcb_courtyard_rect":h="courtyard",d=[c.layer],u=[h1(c.center,c.width,c.height,c.ccw_rotation)];break;case"pcb_courtyard_circle":h="courtyard",d=[c.layer],u=[Oy(c.center,c.radius)];break;case"pcb_courtyard_pill":h="courtyard",d=[c.layer],u=[h1(c.center,c.width,c.height,0,c.radius)];break;case"pcb_courtyard_polygon":h="courtyard",d=[c.layer],u=[f3(c.points)];break;case"pcb_courtyard_outline":h="courtyard",d=[c.layer],u=[f3(c.outline)];break}if(t.roles&&!t.roles.includes(h))continue;let p=[];for(let m of new Set(d)){if(m===null?t.includeLayerless===!1:n&&!n.includes(m))continue;let A=_?.get(m)??u;if(!A.length)continue;let g=A.reduce((y,x)=>y.merge(x.box),A[0].box);if(![g.xmin,g.ymin,g.xmax,g.ymax].every(Number.isFinite))throw Error("Non-finite geometry bounds");let f={elementId:l,elementType:c.type,sourceElement:c,role:h,layer:m,shapes:A,bounds:g};p.push(f)}for(let m of p)r.elements.push(m),r.bounds=r.bounds?r.bounds.merge(m.bounds):m.bounds}catch(p){let m=p instanceof Error?p.message:String(p);if(t.strict)throw Error(`${l}: ${m}`);r.warnings.push({elementId:l,elementType:c.type,message:m})}}return r}function WEo(e,t){if(!e.box.intersect(t.box))return!1;return e.intersect(t).some((o)=>n8t(e,o)&&n8t(t,o))||[...t.faces].some((o)=>e8t(e,o.first.start))||[...e.faces].some((o)=>e8t(t,o.first.start))}function n8t(e,t){let n=p3.getTolerance();return e.edges.search(new YA(t.x-n,t.y-n,t.x+n,t.y+n)).length>0}function XEo(e,{connMap:t}={}){if(!e.some((s)=>s.type==="pcb_copper_pour"))return[];t??=Aa(e);let{elements:n}=Jj(e,{elementTypes:["pcb_smtpad","pcb_plated_hole","pcb_via","pcb_trace","pcb_copper_pour"],strict:!0}),o=new Map;for(let s of n){let a=o.get(s.layer)??[];for(let c of s.shapes)a.push({element:s,shape:c});o.set(s.layer,a)}let r=new Map([...o].map(([s,a])=>{let c=new _3(a.length);for(let{shape:l}of a){let h=l.box;c.add(h.xmin,h.ymin,h.xmax,h.ymax)}return c.finish(),[s,{index:c,entries:a}]})),i=new Map;for(let s of n){let a=s.sourceElement;if(a.type!=="pcb_copper_pour")continue;let c=a.source_net_id,{index:l,entries:h}=r.get(s.layer),d=new Set;for(let u of s.shapes){let _=u.box;for(let p of l.search(_.xmin,_.ymin,_.xmax,_.ymax))d.add(p)}for(let u of[...d].sort((_,p)=>_-p)){let{element:_,shape:p}=h[u];if(s.elementId===_.elementId)continue;let m=_.sourceElement.type==="pcb_copper_pour"?_.sourceElement.source_net_id:_.elementId;if(c&&m&&(c===m||t.areIdsConnected(c,m)))continue;let A=`copper_pour_short_${[s.elementId,_.elementId].sort().join("_")}`;if(i.has(A)||!s.shapes.some((g)=>WEo(g,p)))continue;i.set(A,{type:"pcb_placement_error",pcb_placement_error_id:A,error_type:"pcb_placement_error",message:`Copper pour ${Ks(e,s.elementId)} (${c?Ks(e,c):"unassigned net"}) shorts to ${Ks(e,_.elementId)} on ${s.layer} (accidental copper contact)`,subcircuit_id:a.subcircuit_id})}}return[...i.values()]}var T2e=0.000000001;function X8t(e){let t=new Map(e.filter((l)=>l.type==="pcb_port").map((l)=>[l.pcb_port_id,l])),n=e.filter((l)=>l.type==="pcb_smtpad"||l.type==="pcb_plated_hole"),o=new Map;for(let l of n){if(!l.pcb_port_id)continue;let h=o.get(l.pcb_port_id)??[];h.push(l),o.set(l.pcb_port_id,h)}let r=e.filter((l)=>l.type==="pcb_via"),i,s=()=>{if(i)return i;i=r.map((d)=>({...d,diameter:d.outer_diameter}));let l=e.find((d)=>d.type==="pcb_board"),h=["top",...Hg.filter((d)=>d.startsWith("inner")).slice(0,l?Math.max(0,l.num_layers-2):void 0),...l?.num_layers===1?[]:["bottom"]];for(let d of e){if(d.type!=="pcb_trace")continue;for(let u of d.route){if(u.route_type!=="via")continue;if(r.some((m)=>Math.hypot(m.x-u.x,m.y-u.y)<=T2e))continue;let _=h.indexOf(u.from_layer),p=h.indexOf(u.to_layer);if(_<0||p<0)continue;i.push({...u,layers:h.slice(Math.min(_,p),Math.max(_,p)+1),diameter:u.outer_diameter})}}return i},a=(l)=>{let h=o.get(l.pcb_port_id);return h?.length?[...new Set(h.flatMap(Vg))]:l.layers};return{ports:t,layersForPort:a,canConnect:(l,h)=>{let d=t.get(h);if(!d)return!0;let u=a(d);if(u.includes(l.layer))return!0;let _=o.get(h)??[];return s().some((p)=>{if(!p.layers.includes(l.layer)||!u.some((A)=>p.layers.includes(A)))return!1;if(p.diameter!==void 0&&(!Number.isFinite(p.diameter)||p.diameter<=0))return!1;let m=p.diameter===void 0?0:p.diameter/2+l.width/2;if(Math.hypot(l.x-p.x,l.y-p.y)>m+T2e)return!1;if(_.length===0)return Math.hypot(d.x-p.x,d.y-p.y)<=T2e;return _.some((A)=>{if(!Vg(A).some((g)=>p.layers.includes(g)))return!1;if(p.diameter===void 0)return tK(p,A);return y3({type:"pcb_via",pcb_via_id:"layer-contact",x:p.x,y:p.y,outer_diameter:p.diameter,hole_diameter:0,layers:p.layers},A)<=T2e})})}}}function j8t(e){let t=X8t(e);return e.flatMap((n)=>{if(n.type!=="pcb_trace")return[];return n.route.flatMap((o,r)=>{if(o.route_type!=="wire")return[];return[...new Set([o.start_pcb_port_id,o.end_pcb_port_id])].flatMap((i)=>{if(!i||t.canConnect(o,i))return[];let s=t.ports.get(i);return[{trace:n,point:o,index:r,port:s,padLayers:t.layersForPort(s)}]})})})}function jEo(e){if(!e.some((p)=>p.type==="pcb_via"||p.type==="pcb_plated_hole"||p.type==="pcb_copper_pour"||p.type==="pcb_trace"&&p.route.some((m)=>m.route_type==="via")))return[];let t=[],n=[],o=1e6,r=0.0000001*o,i=sFe(r),s=(p,m,A,g=!1,f=!1)=>{if(!A.isEmpty()){let y=A.scale(o,o);t.push({id:p,layers:m,geometry:{polygon:y},box:y.box,bridges:g,platedPort:f})}},a=new Map,c=(p)=>{if("polygon"in p.geometry)return p.geometry.polygon;let m=a.get(p);if(!m){let{start:A,end:g}=p.geometry;m=lO(A,g,A.width).scale(o,o),a.set(p,m)}return m},l=e.filter((p)=>p.type==="pcb_via"),h=new Map(e.filter((p)=>p.type==="pcb_component").map((p)=>[p.pcb_component_id,p])),d=e.find((p)=>p.type==="pcb_board"),u=["top",...Hg.filter((p)=>p.startsWith("inner")).slice(0,d?Math.max(0,d.num_layers-2):void 0),...d?.num_layers===1?[]:["bottom"]];for(let p of e)if(p.type==="pcb_via"){if(s(p.pcb_via_id,p.layers,BR(p,p.outer_diameter/2),!0),p.pcb_trace_id)n.push([p.pcb_via_id,p.pcb_trace_id])}else if(p.type==="pcb_plated_hole"){if(!p.pcb_port_id)continue;let m={...p,hole_offset_x:"hole_offset_x"in p?p.hole_offset_x??0:0,hole_offset_y:"hole_offset_y"in p?p.hole_offset_y??0:0};s(p.pcb_port_id,p.layers,RR(m,p.pcb_component_id?h.get(p.pcb_component_id)?.rotation:0),!0,!0)}else if(p.type==="pcb_copper_pour")s(p.pcb_copper_pour_id,[p.layer],DR(p),!0);else if(p.type==="pcb_trace"){if(p.route_thickness_mode==="interpolated")continue;for(let m=0;m<p.route.length;m++){let A=p.route[m],g=p.route[m+1];if(A.route_type==="wire"&&g?.route_type==="wire"&&A.layer===g.layer&&(A.x!==g.x||A.y!==g.y))if(A.width>0){let f=A.width/2;t.push({id:p.pcb_trace_id,layers:[A.layer],geometry:{start:A,end:g},box:{xmin:(Math.min(A.x,g.x)-f)*o,ymin:(Math.min(A.y,g.y)-f)*o,xmax:(Math.max(A.x,g.x)+f)*o,ymax:(Math.max(A.y,g.y)+f)*o},bridges:!1,platedPort:!1})}else s(p.pcb_trace_id,[A.layer],lO(A,g,A.width));else if(A.route_type==="via"){if(l.some((C)=>C.pcb_trace_id===p.pcb_trace_id&&Math.hypot(C.x-A.x,C.y-A.y)<0.000000001))continue;let f=u.indexOf(A.from_layer),y=u.indexOf(A.to_layer);if(f<0||y<0||!A.outer_diameter)continue;let x={type:"pcb_via",pcb_via_id:`${p.pcb_trace_id}_via_${m}`,x:A.x,y:A.y,outer_diameter:A.outer_diameter,hole_diameter:0,layers:u.slice(Math.min(f,y),Math.max(f,y)+1)};s(p.pcb_trace_id,x.layers,BR(x,x.outer_diameter/2),!0)}}}if(!t.length)return n;let _=new _3(t.length);for(let{box:p}of t)_.add(p.xmin,p.ymin,p.xmax,p.ymax);_.finish();for(let[p,m]of t.entries()){if(!m.bridges)continue;let A=m.box;for(let g of _.search(A.xmin-r,A.ymin-r,A.xmax+r,A.ymax+r)){let f=t[g];if(m.platedPort&&f.bridges||f.platedPort&&m.bridges||p===g||m.id===f.id||f.bridges&&g<p||!m.layers.some((y)=>f.layers.includes(y)))continue;if(i(c(m),c(f)))n.push([m.id,f.id])}}return n}function aFe(e){let t=new Fj;t.circuitJson=e;for(let c of e)if(c.type==="pcb_trace")t.traceIdToElm.set(c.pcb_trace_id,c);else if(c.type==="pcb_port")t.portIdToElm.set(c.pcb_port_id,c);let n=[...t.traceIdToElm.values()],o=new Map;for(let[c,l]of n.entries())for(let h=0;h<l.route.length-1;h++){let d=l.route[h],u=l.route[h+1];if(d.route_type!=="wire"||u.route_type!=="wire"||d.layer!==u.layer)continue;let _=d.width/2+0.000000001,p=o.get(d.layer)??[];p.push({traceIndex:c,segmentTrace:{...l,route:[d,u]},minX:Math.min(d.x,u.x)-_,minY:Math.min(d.y,u.y)-_,maxX:Math.max(d.x,u.x)+_,maxY:Math.max(d.y,u.y)+_}),o.set(d.layer,p)}let r=n.map(()=>new Set);for(let c of o.values()){let l=new _3(c.length);for(let h of c)l.add(h.minX,h.minY,h.maxX,h.maxY);l.finish();for(let h of c)for(let d of l.search(h.minX,h.minY,h.maxX,h.maxY)){let u=c[d],_=u.traceIndex,p=r[h.traceIndex];if(_>h.traceIndex&&!p.has(_)&&t._arePcbTracesConnected(h.segmentTrace,u.segmentTrace))p.add(_)}}let i=[];for(let[c,l]of r.entries())for(let h of[...l].sort((d,u)=>d-u))i.push([n[c].pcb_trace_id,n[h].pcb_trace_id]);let s=X8t(e),a=new Map;for(let c of n)for(let l of c.route){if(l.route_type!=="wire")continue;for(let h of new Set([l.start_pcb_port_id,l.end_pcb_port_id])){if(!h||!t.portIdToElm.has(h))continue;if(!s.canConnect(l,h))continue;let d=a.get(h)??[];d.push(l.start_pcb_port_id===h?[h,c.pcb_trace_id]:[c.pcb_trace_id,h]),a.set(h,d)}}for(let c of t.portIdToElm.keys())for(let l of a.get(c)??[])i.push(l);return i.push(...jEo(e)),t.connMap=new l5(Mw(i)),t}function o8t(e,t,n,o){return Math.sqrt((n-e)**2+(o-t)**2)}var cFe=(e)=>{let t=e.filter((i)=>i.type==="pcb_port"),n=e.filter((i)=>i.type==="pcb_smtpad"),o=e.filter((i)=>i.type==="pcb_trace");function r(i,s={}){let a=s.traceWidth||0,c=t.find((l)=>l.layers.includes(i.layer)&&o8t(l.x,l.y,i.x,i.y)<0.01);if(c)return c.pcb_port_id;if(s.isFirstOrLastPoint){let l=n.find((h)=>{if(h.layer!==i.layer)return!1;if(h.shape==="rect")return Math.abs(i.x-h.x)<h.width/2+a/2&&Math.abs(i.y-h.y)<h.height/2+a/2;else if(h.shape==="circle")return o8t(i.x,i.y,h.x,h.y)<h.radius;else if(h.shape==="pill"||h.shape==="rotated_pill")return tK(i,h)});if(l)return l.pcb_port_id??null}return null}for(let i of o)for(let s=0;s<i.route.length;s++){let a=i.route[s],c=s===0||s===i.route.length-1;if(a.route_type==="wire"){if(!a.start_pcb_port_id&&s===0){let l=r(a,{isFirstOrLastPoint:c,traceWidth:a.width});if(l)a.start_pcb_port_id=l}if(!a.end_pcb_port_id&&s===i.route.length-1){let l=r(a,{isFirstOrLastPoint:c,traceWidth:a.width});if(l)a.end_pcb_port_id=l}}}};function K8t(e,t){let r=sFe(0.09999999999999999),i=[],s=new Set,a=(g)=>t.getNetConnectedToId(g),c=(g)=>{if(!g.polygon.isEmpty())i.push({...g,polygon:g.polygon.scale(1e6,1e6)})};for(let g of e){if(g.type!=="pcb_copper_pour"||!g.source_net_id)continue;let f=a(g.source_net_id);if(!f)continue;s.add(f),c({polygon:DR(g),layers:[g.layer],netId:f,isPour:!0})}let l=new Map(e.filter((g)=>g.type==="pcb_component").map((g)=>[g.pcb_component_id,g]));if(s.size>0)for(let g of e){if(g.type==="pcb_trace"){let y=a(g.pcb_trace_id);if(!y||!s.has(y)||g.route_thickness_mode==="interpolated")continue;for(let x=0;x<g.route.length-1;x++){let C=g.route[x],b=g.route[x+1];if(C.route_type!=="wire"||b.route_type!=="wire"||C.layer!==b.layer)continue;c({polygon:lO(C,b,C.width),layers:[C.layer],netId:y})}continue}if(g.type!=="pcb_smtpad"&&g.type!=="pcb_plated_hole"&&g.type!=="pcb_via")continue;let f=a(Za(g));if(!f||!s.has(f))continue;if(g.type==="pcb_smtpad")c({polygon:kj(g),layers:[g.layer],netId:f,portIds:g.pcb_port_id?[g.pcb_port_id]:[]});else if(g.type==="pcb_plated_hole")c({polygon:RR(g,g.pcb_component_id?l.get(g.pcb_component_id)?.rotation:0),layers:g.layers,netId:f,portIds:g.pcb_port_id?[g.pcb_port_id]:[]});else c({polygon:NR(g,g.outer_diameter,g.hole_diameter),layers:g.layers,netId:f,portIds:g.pcb_port_ids})}let h=i.map((g,f)=>f),d=(g)=>{while(h[g]!==g)h[g]=h[h[g]],g=h[g];return g},u=i.map((g)=>g.polygon.box),_=i.map((g,f)=>f).sort((g,f)=>u[g].xmin-u[f].xmin);for(let g=0;g<_.length;g++){let f=_[g];for(let y=g+1;y<_.length;y++){let x=_[y];if(u[x].xmin>u[f].xmax+0.09999999999999999)break;if(d(f)===d(x)||i[f].netId!==i[x].netId)continue;if(u[x].ymin>u[f].ymax+0.09999999999999999||u[x].ymax<u[f].ymin-0.09999999999999999)continue;if(!i[f].layers.some((C)=>i[x].layers.includes(C)))continue;if(r(i[f].polygon,i[x].polygon))h[d(x)]=d(f)}}let p=new Set(i.flatMap((g,f)=>g.isPour?[d(f)]:[])),m=new Map;for(let[g,f]of i.entries()){if(!p.has(d(g)))continue;for(let y of f.portIds??[]){let x=m.get(y)??new Set;x.add(d(g)),m.set(y,x)}}let A=new Map;for(let g of e){if(g.type!=="pcb_port")continue;let f=a(g.pcb_port_id);if(!f||!s.has(f))continue;let y=A.get(f)??[];y.push(g.pcb_port_id),A.set(f,y)}return{isPortConnectedToNet(g,f){let y=m.get(g);return f.every((x)=>[...y??[]].some((C)=>i[C].netId===a(x)&&(A.get(i[C].netId)??[]).every((b)=>m.get(b)?.has(C))))},arePortsConnected(g){if(g.length<2)return!1;return[...m.get(g[0])??[]].some((f)=>g.every((y)=>m.get(y)?.has(f)))}}}function KEo(e,{connMap:t,pcbConnectivityMap:n}={}){cFe(e);let o=e.filter((u)=>u.type==="source_trace"),r=e.filter((u)=>u.type==="pcb_port"),i=e.filter((u)=>u.type==="source_net"),s=j8t(e).map(({trace:u,point:_,index:p,port:m,padLayers:A})=>({type:"pcb_port_not_connected_error",error_type:"pcb_port_not_connected_error",pcb_port_not_connected_error_id:`missing_layer_connection_${u.pcb_trace_id}_${p}_${m.pcb_port_id}`,pcb_port_ids:[m.pcb_port_id],pcb_component_ids:m.pcb_component_id?[m.pcb_component_id]:[],center:{x:_.x,y:_.y},message:`Port [${aS(e,m.pcb_port_id)}] on ${A.join(", ")} is not connected to trace [${Dw(e,u.pcb_trace_id)}] on ${_.layer}: missing via connection.`})),a=t??Aa(e);n??=aFe(e);let c,l=()=>c??=K8t(e,a),h=new Map;for(let u of r)h.set(u.source_port_id,u);let d=new Map(i.map((u)=>[u.source_net_id,u.name]));for(let u of o){let _=u.connected_source_port_ids;if(_.length===1&&u.connected_source_net_ids.length>0){let x=h.get(_[0]);if(!x)continue;if(n.getAllTracesConnectedToPort(x.pcb_port_id).length===0&&!l().isPortConnectedToNet(x.pcb_port_id,u.connected_source_net_ids)){let b=u.connected_source_net_ids.map((v)=>d.get(v)).filter((v)=>Boolean(v)),I=b.length>0?`net [${b.join(", ")}]`:"its connected net";s.push({type:"pcb_port_not_connected_error",message:`Port [${aS(e,x.pcb_port_id)}] is not connected to ${I} by a PCB trace.`,error_type:"pcb_port_not_connected_error",pcb_port_ids:[x.pcb_port_id],pcb_component_ids:x.pcb_component_id?[x.pcb_component_id]:[],pcb_port_not_connected_error_id:`pcb_port_not_connected_error_trace_${u.source_trace_id}`})}continue}if(_.length<2)continue;let p=[],m=[];for(let x of _){let C=h.get(x);if(C)p.push(C);else m.push(x)}if(p.length<2)continue;let A=p[0],g=a.getNetConnectedToId(A.pcb_port_id);if(a.getIdsConnectedToNet(g).filter((x)=>e.some((C)=>C.type==="pcb_trace"&&(("pcb_trace_id"in C)&&C.pcb_trace_id===x||("route_id"in C)&&C.route_id===x))).length===0&&!l().arePortsConnected(p.map((x)=>x.pcb_port_id))){if(new Set(p.map((C)=>C.pcb_component_id)).size>1)s.push({type:"pcb_port_not_connected_error",message:`Ports [${p.map((C)=>aS(e,C.pcb_port_id)).join(", ")}] are not connected together through the same net.`,error_type:"pcb_port_not_connected_error",pcb_port_ids:p.map((C)=>C.pcb_port_id),pcb_component_ids:p.map((C)=>C.pcb_component_id).filter((C)=>C!==void 0),pcb_port_not_connected_error_id:`pcb_port_not_connected_error_trace_${u.source_trace_id}`})}}return s}var $8t=(e)=>Jj(e.filter((t)=>t.type==="pcb_hole"),{elementTypes:["pcb_hole"],strict:!0,curveTolerance:0.000001}).elements,q8t=(e,t)=>{let n=t.sourceElement;if(n.type!=="pcb_hole")throw Error("Expected hole geometry");let o=new sa(e.x1,e.y1),r=new sa(e.x2,e.y2),i=1/0,s=Ly(n,o,r);if(n.hole_shape==="circle")i=ga(n,o,r)-n.hole_diameter/2;else{let a=new Fg(o,r);for(let c of t.shapes){let[l,h]=c.distanceTo(a),d=c.contains(o)||c.contains(r)?0:l;if(d<i)i=d,s=h.end}}return{gap:i-e.thickness/2,center:s}},nK=class{buckets;objectsById;getBounds;getId;CELL_SIZE=0.4;constructor({objects:e,getBounds:t,getId:n,CELL_SIZE:o}){this.buckets=new Map,this.objectsById=new Map,this.getBounds=t,this.getId=n??(()=>this._getNextId()),this.CELL_SIZE=o??this.CELL_SIZE;for(let r of e)this.addObject(r)}_idCounter=0;_getNextId(){return`${this._idCounter++}`}addObject(e){let t=this.getBounds(e),n=this.getId(e),o={...e,spatialIndexId:n};this.objectsById.set(n,o);let r=Math.floor(t.minX/this.CELL_SIZE),i=Math.floor(t.minY/this.CELL_SIZE),s=Math.floor(t.maxX/this.CELL_SIZE),a=Math.floor(t.maxY/this.CELL_SIZE);for(let c=r;c<=s;c++)for(let l=i;l<=a;l++){let h=`${c}x${l}`,d=this.buckets.get(h);if(!d)this.buckets.set(h,[o]);else d.push(o)}}removeObject(e){let t=this.objectsById.get(e);if(!t)return!1;this.objectsById.delete(e);let n=this.getBounds(t),o=Math.floor(n.minX/this.CELL_SIZE),r=Math.floor(n.minY/this.CELL_SIZE),i=Math.floor(n.maxX/this.CELL_SIZE),s=Math.floor(n.maxY/this.CELL_SIZE);for(let a=o;a<=i;a++)for(let c=r;c<=s;c++){let l=`${a}x${c}`,h=this.buckets.get(l);if(h){let d=h.findIndex((u)=>u.spatialIndexId===e);if(d!==-1){if(h.splice(d,1),h.length===0)this.buckets.delete(l)}}}return!0}getBucketKey(e,t){return`${Math.floor(e/this.CELL_SIZE)}x${Math.floor(t/this.CELL_SIZE)}`}getObjectsInBounds(e,t=0){let n=[],o=new Set,r=Math.floor((e.minX-t)/this.CELL_SIZE),i=Math.floor((e.minY-t)/this.CELL_SIZE),s=Math.floor((e.maxX+t)/this.CELL_SIZE),a=Math.floor((e.maxY+t)/this.CELL_SIZE);for(let c=r;c<=s;c++)for(let l=i;l<=a;l++){let h=`${c}x${l}`,d=this.buckets.get(h)||[];for(let u of d){let _=u.spatialIndexId;if(o.has(_))continue;o.add(_),n.push(u)}}return n}},r8t=(e,t)=>{let n={x:e.x1,y:e.y1},o={x:e.x2,y:e.y2},{minX:r,minY:i,maxX:s,maxY:a}=t;if(n.x===o.x&&n.y===o.y){let v=Math.max(r,Math.min(s,n.x)),P=Math.max(i,Math.min(a,n.y));if(v===n.x&&P===n.y)return{x:n.x,y:n.y};return{x:v,y:P}}let c=o.x-n.x,l=o.y-n.y,h=c!==0?(r-n.x)/c:Number.NEGATIVE_INFINITY,d=c!==0?(s-n.x)/c:Number.POSITIVE_INFINITY,u=l!==0?(i-n.y)/l:Number.NEGATIVE_INFINITY,_=l!==0?(a-n.y)/l:Number.POSITIVE_INFINITY,p=Math.max(Math.min(h,d),Math.min(u,_)),m=Math.min(Math.max(h,d),Math.max(u,_));if(p<=m&&m>=0&&p<=1){let v=Math.max(0,Math.min(1,p));return{x:n.x+v*c,y:n.y+v*l}}let A={x:Math.max(r,Math.min(s,n.x)),y:Math.max(i,Math.min(a,n.y))},g={x:Math.max(r,Math.min(s,o.x)),y:Math.max(i,Math.min(a,o.y))},f=(A.x-n.x)**2+(A.y-n.y)**2,y=(g.x-o.x)**2+(g.y-o.y)**2,x=[{start:{x:r,y:i},end:{x:s,y:i}},{start:{x:s,y:i},end:{x:s,y:a}},{start:{x:s,y:a},end:{x:r,y:a}},{start:{x:r,y:a},end:{x:r,y:i}}],C=Math.min(f,y),b=f<=y?A:g,I=(v,P,M)=>Math.max(P,Math.min(M,v));for(let v of x){let P={x:o.x-n.x,y:o.y-n.y},M={x:v.end.x-v.start.x,y:v.end.y-v.start.y},B={x:n.x-v.start.x,y:n.y-v.start.y},T=P.x*P.x+P.y*P.y,N=P.x*M.x+P.y*M.y,D=P.x*B.x+P.y*B.y,L=M.x*M.x+M.y*M.y,H=M.x*B.x+M.y*B.y,V=T*L-N*N;if(Math.abs(V)<0.0000000001)continue;let O=(N*H-L*D)/V,U=(T*H-N*D)/V;O=I(O,0,1),U=I(U,0,1);let j={x:n.x+O*P.x,y:n.y+O*P.y},Y={x:v.start.x+U*M.x,y:v.start.y+U*M.y},X=j.x-Y.x,K=j.y-Y.y,J=X*X+K*K;if(J<C)C=J,b={x:(j.x+Y.x)/2,y:(j.y+Y.y)/2}}return b},Wj=(e)=>{if(e.type==="pcb_hole"&&(e.hole_shape==="pill"||e.hole_shape==="rotated_pill")||e.type==="pcb_smtpad"&&e.shape==="rotated_pill"){let t=Bw(e);return{minX:Math.min(t.start.x,t.end.x)-t.radius,minY:Math.min(t.start.y,t.end.y)-t.radius,maxX:Math.max(t.start.x,t.end.x)+t.radius,maxY:Math.max(t.start.y,t.end.y)+t.radius}}if(e.type==="pcb_trace_segment")return{minX:Math.min(e.x1,e.x2),minY:Math.min(e.y1,e.y2),maxX:Math.max(e.x1,e.x2),maxY:Math.max(e.y1,e.y2)};if(e.type==="pcb_smtpad"||e.type==="pcb_plated_hole"){if(e.type==="pcb_smtpad"&&(e.shape==="rotated_rect"||e.shape==="polygon")||e.type==="pcb_plated_hole"&&"rect_pad_width"in e&&"rect_pad_height"in e){let n=gse(e);return{minX:Math.min(...n.map((o)=>o.x)),minY:Math.min(...n.map((o)=>o.y)),maxX:Math.max(...n.map((o)=>o.x)),maxY:Math.max(...n.map((o)=>o.y))}}}return ky([e])},$Eo=(e)=>{if(e.type==="pcb_port")return e.pcb_port_id;if(e.type==="pcb_smtpad")return e.pcb_smtpad_id;return e.pcb_plated_hole_id};function qEo(e,{connMap:t,minClearance:n}={}){let o=kEo(e);cFe(e),t??=Aa(e);let r=O9(e);n??=z9(r,"min_trace_to_pad_edge_clearance")??pEo;let s=Ps(e).pcb_trace.list().flatMap((C)=>{let b=[];for(let I=0;I<C.route.length-1;I++){let v=C.route[I],P=C.route[I+1];if(v.route_type!=="wire"&&v.route_type!=="via"||P.route_type!=="wire"&&P.route_type!=="via")continue;let M=v.route_type==="wire"?v:P;if(M.route_type!=="wire")continue;if(v.route_type==="wire"&&P.route_type==="wire"&&v.layer!==P.layer)continue;b.push({type:"pcb_trace_segment",pcb_trace_id:C.pcb_trace_id,_pcbTrace:C,thickness:Math.max(v.route_type==="wire"?v.width??WHe:0,P.route_type==="wire"?P.width??WHe:0),layer:M.layer,x1:v.x,y1:v.y,x2:P.x,y2:P.y})}return b}),a=Ps(e).pcb_smtpad.list(),c=Ps(e).pcb_plated_hole.list(),l=Ps(e).pcb_port.list(),h=Ps(e).pcb_hole.list(),d=new Map($8t(e).map((C)=>[C.elementId,C])),u=Ps(e).pcb_via.list(),_=Ps(e).pcb_keepout.list().filter((C)=>!C.allow_traces),p=[...l,...a,...c],m=new Map;for(let C of _){let b=new Set(C.excluded_pcb_component_ids??[]);if(b.size===0)continue;m.set(C.pcb_keepout_id,p.filter((I)=>I.pcb_component_id&&b.has(I.pcb_component_id)).map($Eo))}let A=[...s,...a,...c,...h,...u,..._],g=new nK({objects:A,getBounds:Wj}),f=(C)=>Ks(e,C),y=(C,b,I)=>{if($j(I))return`PCB trace ${C} overlaps with ${b} (accidental contact)`;return`PCB trace ${C} is too close to ${b} (gap: ${I.toFixed(3)}mm)`},x=new Set;for(let C of s){let b=n,I=Wj(C),v=g.getObjectsInBounds(I,b+C.thickness/2);if(C.x1===C.x2&&C.y1===C.y2)continue;for(let P of v){if(!Vg(P).includes(C.layer))continue;if(P.type==="pcb_keepout"&&(m.get(P.pcb_keepout_id)??[]).some((T)=>t.areIdsConnected(C.pcb_trace_id,T)))continue;if(P.type==="pcb_trace_segment"){let T=P;if(C.layer!==T.layer)continue;if(t.areIdsConnected(C.pcb_trace_id,T.pcb_trace_id))continue;let N=c5({x:C.x1,y:C.y1},{x:C.x2,y:C.y2},{x:T.x1,y:T.y1},{x:T.x2,y:T.y2})-C.thickness/2-T.thickness/2;if(N>n-x3)continue;let D=`overlap_${C.pcb_trace_id}_${T.pcb_trace_id}`,L=`overlap_${T.pcb_trace_id}_${C.pcb_trace_id}`;if(x.has(D))continue;if(x.has(L))continue;x.add(D),o.push({type:"pcb_trace_error",error_type:"pcb_trace_error",message:y(f(C.pcb_trace_id),f(T.pcb_trace_id),N),pcb_trace_id:C.pcb_trace_id,source_trace_id:"",pcb_trace_error_id:D,pcb_component_ids:[],center:KHe(C,T),pcb_port_ids:cse([C._pcbTrace,T._pcbTrace])});continue}let M=Za(P);if(t.areIdsConnected(C.pcb_trace_id,"pcb_trace_id"in P?P.pcb_trace_id:M))continue;if(P.type==="pcb_smtpad"||P.type==="pcb_plated_hole"||P.type==="pcb_via"){let{gap:T,center:N}=xse(C,P);if(!$j(T))continue;let D=`overlap_${C.pcb_trace_id}_${M}`;if(x.has(D))continue;x.add(D),o.push({type:"pcb_trace_error",error_type:"pcb_trace_error",message:y(f(C.pcb_trace_id),`${P.type} "${f(M)}"`,T),pcb_trace_id:C.pcb_trace_id,center:N,source_trace_id:"",pcb_trace_error_id:D,pcb_component_ids:["pcb_component_id"in P?P.pcb_component_id:void 0].filter(Boolean),pcb_port_ids:[...cse([C._pcbTrace]),"pcb_port_id"in P?P.pcb_port_id:void 0].filter(Boolean)});continue}if(P.type==="pcb_hole"){let{gap:T,center:N}=q8t(C,d.get(P.pcb_hole_id));if(!$j(T))continue;let D=`overlap_${C.pcb_trace_id}_${M}`;if(x.has(D))continue;x.add(D),o.push({type:"pcb_trace_error",error_type:"pcb_trace_error",message:y(f(C.pcb_trace_id),`${P.type} "${f(M)}"`,T),pcb_trace_id:C.pcb_trace_id,source_trace_id:C._pcbTrace.source_trace_id??"",pcb_trace_error_id:D,pcb_component_ids:P.pcb_component_id?[P.pcb_component_id]:[],pcb_port_ids:cse([C._pcbTrace]),center:N});continue}let B=tHe({x:C.x1,y:C.y1},{x:C.x2,y:C.y2},Wj(P))-C.thickness/2;if(B+x3<b){let T=`overlap_${C.pcb_trace_id}_${M}`;if(x.has(T))continue;if(x.add(T),P.type==="pcb_keepout"&&P.warning_only){o.push({type:"pcb_keepout_overlap_warning",warning_type:"pcb_keepout_overlap_warning",pcb_keepout_overlap_warning_id:`pcb_keepout_overlap_warning_${T}`,pcb_keepout_id:P.pcb_keepout_id,pcb_trace_ids:[C.pcb_trace_id],message:`PCB trace ${f(C.pcb_trace_id)} violates advisory PCB keepout "${Ks(e,P.pcb_keepout_id)}"`,center:r8t(C,Wj(P)),subcircuit_id:C._pcbTrace.subcircuit_id??P.subcircuit_id});continue}o.push({type:"pcb_trace_error",error_type:"pcb_trace_error",message:y(f(C.pcb_trace_id),`${P.type} "${f(Za(P))}"`,B),pcb_trace_id:C.pcb_trace_id,source_trace_id:"",pcb_trace_error_id:T,pcb_component_ids:["pcb_component_id"in P?P.pcb_component_id:void 0].filter(Boolean),center:r8t(C,Wj(P)),pcb_port_ids:[...cse([C._pcbTrace]),"pcb_port_id"in P?P.pcb_port_id:void 0].filter(Boolean)})}}}return o}var JEo=0.000000001,ZEo=(e)=>{if(e.type==="pcb_via")return"Via";if(e.type==="pcb_smtpad")return"SMT pad";if(e.type==="pcb_plated_hole")return"Plated hole";return"Copper pour"};function eMo(e){let t=O9(e);if(!t)return[];if(!e.some((c)=>c.type==="pcb_via"||c.type==="pcb_smtpad"||c.type==="pcb_plated_hole"||c.type==="pcb_copper_pour"))return[];let n=Jj([t],{strict:!0}).elements[0]?.shapes[0];if(!n)return[];let o=z9(t,"min_board_edge_clearance")??d1.min_board_edge_clearance;if(o===void 0)return[];let r=new Set(e.filter((c)=>c.type==="pcb_component").filter((c)=>c.is_allowed_to_be_off_board).map((c)=>c.pcb_component_id)),{elements:i}=Jj(e,{elementTypes:["pcb_via","pcb_smtpad","pcb_plated_hole","pcb_copper_pour"],includeDrillHoles:!1,strict:!0}),s=[],a=new Set;for(let c of i){if(a.has(c.elementId))continue;a.add(c.elementId);let l=c.sourceElement;if((l.type==="pcb_smtpad"||l.type==="pcb_plated_hole")&&l.pcb_component_id&&r.has(l.pcb_component_id))continue;let h=c.shapes.every((p)=>n.contains(p)),d=h?Math.min(...c.shapes.map((p)=>n.distanceTo(p)[0])):0;if(h&&d+JEo>=o)continue;let u=c.elementId,_=ZEo(l);s.push({type:"pcb_placement_error",pcb_placement_error_id:`copper_too_close_to_board_edge_${u}`,error_type:"pcb_placement_error",message:`${_} ${Ks(e,u)} violates copper-to-board-edge clearance (measured ${d.toFixed(3)}mm, required ${o.toFixed(3)}mm)`})}return s}function J8t(e){return e.area()>=0}function Z8t({center:e,size:t,rotationDeg:n=0}){let{x:o,y:r}=e,i=t.width/2,s=t.height/2,a=[new sa(o-i,r-s),new sa(o+i,r-s),new sa(o+i,r+s),new sa(o-i,r+s)],c=new El(a);if(n){let l=j2e.rotateDEG(n,o,r),h=a.map((d)=>{let u=j2e.applyToPoint(l,{x:d.x,y:d.y});return new sa(u.x,u.y)});c=new El(h)}if(!J8t(c))c.reverse();return c}function tMo({board:e}){if(e.outline&&e.outline.length>0){let t=e.outline.map((o)=>new sa(o.x,o.y)),n=new El(t);if(!J8t(n))n.reverse();return n}if(e.center&&typeof e.width==="number"&&typeof e.height==="number")return Z8t({center:e.center,size:{width:e.width,height:e.height},rotationDeg:0});return null}function nMo({circuitJson:e,component:t}){if(t.source_component_id){let n=e.find((o)=>o.type==="source_component"&&o.source_component_id===t.source_component_id);if(n&&"name"in n&&n.name)return n.name}return yO(e,t.pcb_component_id)}function oMo(e,t){let n=[...e.edges],o=n[0]?.shape;if(n.length===1&&o instanceof Kp&&p3.EQ(o.sweep,2*Math.PI)){let[i]=t.distanceTo(o.pc);return t.contains(o.pc)?o.r-i:o.r+i}let r=0;for(let i of n){let s=i.shape instanceof Kp?Math.ceil(i.shape.sweep/(Math.PI/32)):2;for(let a=0;a<=s;a++){let c=i.pointAtLength(i.length*a/s);if(!t.contains(c))r=Math.max(r,t.distanceTo(c)[0])}}return r||0.1}function rMo({componentBox:e,boardPoly:t}){let n=t.box,o=0,r=0;if(e.xmin<n.xmin)o=n.xmin-e.xmin;else if(e.xmax>n.xmax)o=n.xmax-e.xmax;if(e.ymin<n.ymin)r=n.ymin-e.ymin;else if(e.ymax>n.ymax)r=n.ymax-e.ymax;if(o===0&&r===0)return null;let i=o>=0?"right":"left",s=r>=0?"up":"down",a=Math.abs(Math.round(o*100)/100),c=Math.abs(Math.round(r*100)/100);if(a>0&&c>0)return`Try moving it ${a}mm ${i} and ${c}mm ${s} to fit within the board edge.`;if(a>0)return`Try moving it ${a}mm ${i} to fit within the board edge.`;return`Try moving it ${c}mm ${s} to fit within the board edge.`}function iMo(e){let t=e.find((s)=>s.type==="pcb_board");if(!t)return[];let n=tMo({board:t});if(!n)return[];let o=e.filter((s)=>s.type==="pcb_component");if(o.length===0)return[];let r=Jj(e,{elementTypes:["pcb_smtpad","pcb_plated_hole","pcb_hole","pcb_courtyard_circle","pcb_courtyard_rect","pcb_courtyard_pill","pcb_courtyard_polygon","pcb_courtyard_outline"],includeDrillHoles:!1,strict:!0}).elements,i=[];for(let s of o){if(s.is_allowed_to_be_off_board)continue;if(!s.center||typeof s.width!=="number"||typeof s.height!=="number")continue;if(s.width<=0||s.height<=0)continue;let a=Z8t({center:s.center,size:{width:s.width,height:s.height},rotationDeg:0}),c=r.filter(({sourceElement:g})=>("pcb_component_id"in g)&&g.pcb_component_id===s.pcb_component_id),l=c.filter(({role:g})=>g!=="courtyard").reduce((g,f)=>g?g.merge(f.bounds):f.bounds,void 0),h=c.flatMap(({shapes:g})=>g);if(!l||!p3.EQ(l.xmin,a.box.xmin)||!p3.EQ(l.xmax,a.box.xmax)||!p3.EQ(l.ymin,a.box.ymin)||!p3.EQ(l.ymax,a.box.ymax))h.push(a);let d=h.filter((g)=>g.area()>0&&!n.contains(g));if(d.length===0)continue;let u=h.reduce((g,f)=>g.merge(f.box),h[0].box),_=Math.max(...d.map((g)=>oMo(g,n))),p=nMo({circuitJson:e,component:s}),m=Math.round(_*100)/100,A=rMo({componentBox:u,boardPoly:n});i.push({type:"pcb_component_outside_board_error",error_type:"pcb_component_outside_board_error",pcb_component_outside_board_error_id:`pcb_component_outside_board_${s.pcb_component_id}`,message:`Component ${p} extends outside board boundaries by ${m}mm.${A?` ${A}`:""}`,pcb_component_id:s.pcb_component_id,pcb_board_id:t.pcb_board_id,component_center:s.center,component_bounds:{min_x:u.xmin,max_x:u.xmax,min_y:u.ymin,max_y:u.ymax},subcircuit_id:s.subcircuit_id,source_component_id:s.source_component_id})}return i}var i8t=32;function e7t({center:e,width:t,height:n,rotation:o=0}){let r=t/2,i=n/2,s=[{x:e.x-r,y:e.y-i},{x:e.x+r,y:e.y-i},{x:e.x+r,y:e.y+i},{x:e.x-r,y:e.y+i}],a=K2e.rotateDEG(o,e.x,e.y);return new El(s.map((c)=>{let l=o?K2e.applyToPoint(a,c):c;return new sa(l.x,l.y)}))}function sMo({center:e,radius:t}){return new El(Array.from({length:i8t},(n,o)=>{let r=2*Math.PI*o/i8t;return new sa(e.x+Math.cos(r)*t,e.y+Math.sin(r)*t)}))}function aMo(e){if(e.shape==="rect")return e7t({center:e.center,width:e.width,height:e.height,rotation:e.rotation??0});if(e.shape==="circle")return sMo({center:e.center,radius:e.radius});if(e.shape==="polygon")return new El(e.points.map((t)=>new sa(t.x,t.y)));return null}function s8t(e){return{minX:e.box.xmin,minY:e.box.ymin,maxX:e.box.xmax,maxY:e.box.ymax}}function cMo(e,t){if(!qp(s8t(e),s8t(t)))return!1;if(e.contains(t)||t.contains(e))return!0;try{let n=Mj.intersect(e,t);if(Array.isArray(n))return n.some((o)=>o.area()>0);return n.area()>0}catch{return!1}}function lMo(e){let t=e.filter((i)=>i.type==="pcb_cutout"),n=e.filter((i)=>i.type==="pcb_component");if(t.length===0||n.length===0)return[];let o=t.map((i)=>({cutout:i,polygon:aMo(i)})).filter((i)=>i.polygon!==null&&i.polygon.area()>0),r=[];for(let i of n){if(i.do_not_place)continue;if(!i.center||i.width<=0||i.height<=0)continue;let s=e7t({center:i.center,width:i.width,height:i.height});for(let{cutout:a,polygon:c}of o){if(a.pcb_component_id===i.pcb_component_id)continue;if(!cMo(s,c))continue;let l=yO(e,i.pcb_component_id),h=a.pcb_cutout_id;r.push({type:"pcb_placement_error",pcb_placement_error_id:`component_over_cutout_${i.pcb_component_id}_${h}`,error_type:"pcb_placement_error",message:`Component ${l} overlaps with cutout [${Ks(e,h)}]`,subcircuit_id:i.subcircuit_id})}}return r}var hMo=(e)=>{switch(e.type){case"pcb_courtyard_circle":return e.pcb_courtyard_circle_id;case"pcb_courtyard_outline":return e.pcb_courtyard_outline_id;case"pcb_courtyard_polygon":return e.pcb_courtyard_polygon_id;case"pcb_courtyard_rect":return e.pcb_courtyard_rect_id}},JHe=(e)=>{let t={type:"pcb_keepout",pcb_keepout_id:hMo(e),layers:[e.layer]};if(e.type==="pcb_courtyard_circle")return{...t,shape:"circle",center:e.center,radius:e.radius};let n=e.type==="pcb_courtyard_rect"?Y2e({x:e.center.x,y:e.center.y,width:e.width,height:e.height,ccwRotation:e.ccw_rotation??0}):e.type==="pcb_courtyard_polygon"?e.points:e.outline;return{...t,shape:"outline",outline:n,stroke_width:0}};function dMo(e){let t=e.filter((i)=>i.type==="pcb_keepout"&&!i.allow_placements),n=new Map(e.flatMap((i)=>i.type==="pcb_component"?[[i.pcb_component_id,i]]:[])),o=e.filter((i)=>i.type==="pcb_courtyard_rect"||i.type==="pcb_courtyard_circle"||i.type==="pcb_courtyard_outline"||i.type==="pcb_courtyard_polygon"),r=new Map;for(let i of o){let s=i.pcb_component_id,a=n.get(s);if(a?.do_not_place)continue;let c=JHe(i);for(let l of t){if(!l.layers.includes(i.layer))continue;if(l.excluded_pcb_component_ids?.includes(s))continue;let h=`courtyard_over_keepout_${s}_${l.pcb_keepout_id}`;if(r.has(h))continue;if(y3(c,l)>x3)continue;let d=Ks(e,s),u=Ks(e,l.pcb_keepout_id),_=a?.subcircuit_id??l.subcircuit_id;if(l.warning_only)r.set(h,{type:"pcb_keepout_overlap_warning",warning_type:"pcb_keepout_overlap_warning",pcb_keepout_overlap_warning_id:`pcb_keepout_overlap_warning_${h}`,pcb_keepout_id:l.pcb_keepout_id,pcb_component_ids:[s],message:`Courtyard of ${d} overlaps advisory PCB keepout "${u}"`,subcircuit_id:_});else r.set(h,{type:"pcb_placement_error",error_type:"pcb_placement_error",pcb_placement_error_id:h,message:`Courtyard of ${d} overlaps PCB keepout "${u}"`,subcircuit_id:_})}}return[...r.values()]}var uMo=(e)=>("pcb_component_id"in e)&&e.pcb_component_id?e.pcb_component_id:Za(e),a8t=(e,t)=>{if("pcb_component_id"in t&&t.pcb_component_id){let n=e.find((i)=>i.type==="pcb_component"&&i.pcb_component_id===t.pcb_component_id),o=n?.type==="pcb_component"?e.find((i)=>i.type==="source_component"&&i.source_component_id===n.source_component_id):void 0;return`component ${o?.type==="source_component"&&o.name?o.name:yO(e,t.pcb_component_id)}`}return t.type==="pcb_via"?`via ${Ks(e,t.pcb_via_id)}`:Ks(e,Za(t))};function pMo(e){let t=Ps(e).pcb_keepout.list();if(t.length===0)return[];let n=[...UR(e),...Ps(e).pcb_via.list()],o=new Map;for(let r of t){let i=new Set(r.excluded_pcb_component_ids??[]);for(let s of n){if(r.allow_placements&&s.type!=="pcb_via")continue;let a="pcb_component_id"in s?s.pcb_component_id:void 0;if(a&&i.has(a))continue;if(!Vg(s).some((d)=>r.layers.includes(d)))continue;if(y3(s,r)>x3)continue;let h=`copper_over_keepout_${uMo(s)}_${r.pcb_keepout_id}`;if(r.warning_only){let d=s.type==="pcb_smtpad"?"pcb_smtpad_ids":s.type==="pcb_plated_hole"?"pcb_plated_hole_ids":"pcb_via_ids",u=o.get(h);if(u?.type==="pcb_keepout_overlap_warning")u[d]=Array.from(new Set([...u[d]??[],Za(s)]));else o.set(h,{type:"pcb_keepout_overlap_warning",warning_type:"pcb_keepout_overlap_warning",pcb_keepout_overlap_warning_id:`pcb_keepout_overlap_warning_${h}`,pcb_keepout_id:r.pcb_keepout_id,message:`Copper for ${a8t(e,s)} overlaps advisory PCB keepout "${Ks(e,r.pcb_keepout_id)}"`,...a?{pcb_component_ids:[a]}:{},[d]:[Za(s)],subcircuit_id:s.subcircuit_id??r.subcircuit_id});continue}if(o.has(h))continue;o.set(h,{type:"pcb_placement_error",pcb_placement_error_id:h,error_type:"pcb_placement_error",message:`Copper for ${a8t(e,s)} overlaps ${r.description?`PCB keepout "${r.description}"`:"a PCB keepout"}`,subcircuit_id:s.subcircuit_id??r.subcircuit_id})}}return[...o.values()]}var Fy=0.000000001;function t7t(e){let t=new Map(e.flatMap((r)=>r.type==="pcb_board"&&r.subcircuit_id?[[r.subcircuit_id,r.pcb_board_id]]:[])),n=new Map(e.flatMap((r)=>r.type==="source_group"&&r.is_subcircuit&&r.subcircuit_id?[[r.subcircuit_id,r.parent_subcircuit_id]]:[])),o=new Map(e.flatMap((r)=>r.type==="pcb_component"?[[r.pcb_component_id,r]]:[]));return(r)=>{if("pcb_board_id"in r&&r.pcb_board_id)return r.pcb_board_id;if("positioned_relative_to_pcb_board_id"in r&&r.positioned_relative_to_pcb_board_id)return r.positioned_relative_to_pcb_board_id;let i="pcb_component_id"in r&&r.pcb_component_id?o.get(r.pcb_component_id):void 0;if(i?.positioned_relative_to_pcb_board_id)return i.positioned_relative_to_pcb_board_id;let s=("subcircuit_id"in r?r.subcircuit_id:void 0)??i?.subcircuit_id,a=new Set;while(s&&!a.has(s)){let c=t.get(s);if(c)return c;a.add(s),s=n.get(s)}}}function n7t(e){let t=new Map(e.filter((n)=>n.type==="pcb_board").map((n)=>[n.pcb_board_id,n]));return e.flatMap((n)=>{if(n.type!=="pcb_bend")return[];let o=t.get(n.pcb_board_id);if(!o)return[];let r=n.end.x-n.start.x,i=n.end.y-n.start.y,s=Math.hypot(r,i),a=n.bend_radius*Math.abs(n.bend_angle*Math.PI/180);if(!Number.isFinite(s)||!Number.isFinite(a)||s<=Fy||a<=Fy)return[];let c={x:r/s,y:i/s},l={x:-c.y*a/2,y:c.x*a/2},h={x:o.center.x+n.start.x,y:o.center.y+n.start.y},d={x:o.center.x+n.end.x,y:o.center.y+n.end.y},u=[{x:h.x+l.x,y:h.y+l.y},{x:d.x+l.x,y:d.y+l.y},{x:d.x-l.x,y:d.y-l.y},{x:h.x-l.x,y:h.y-l.y}],_={type:"pcb_keepout",pcb_keepout_id:n.pcb_bend_id,shape:"outline",outline:u,stroke_width:0,layers:["top","bottom"]};return[{bend:n,board:o,tangent:c,keepout:_}]})}function mMo(e,t){return(e.shape==="polygon"?e.outline:Y2e({x:e.center.x,y:e.center.y,width:e.width,height:e.height,ccwRotation:e.rotation??0})).map((o)=>({x:o.x+t.center.x,y:o.y+t.center.y}))}function _Mo(e){let t=n7t(e);if(t.length===0)return[];let n=t7t(e),o=[...UR(e),...e.filter((a)=>a.type==="pcb_via")].map((a)=>({element:a,boardId:n(a)}));for(let a of e){if(a.type!=="pcb_trace")continue;let c=n(a);for(let[l,h]of a.route.entries()){if(h.route_type!=="via")continue;let d=h.outer_diameter??h.hole_diameter??0;if(o.some(({element:p,boardId:m})=>p.type==="pcb_via"&&!(c&&m&&c!==m)&&Math.hypot(p.x-h.x,p.y-h.y)<=Fy&&p.layers.includes(h.from_layer)&&p.layers.includes(h.to_layer)&&(h.outer_diameter===void 0||Math.abs(p.outer_diameter-d)<=Fy)&&(h.hole_diameter===void 0||Math.abs(p.hole_diameter-h.hole_diameter)<=Fy)))continue;let _={type:"pcb_via",pcb_via_id:`${a.pcb_trace_id}_route_via_${l}`,pcb_trace_id:a.pcb_trace_id,x:h.x,y:h.y,outer_diameter:d,hole_diameter:h.hole_diameter??0,layers:[h.from_layer,h.to_layer],subcircuit_id:a.subcircuit_id};o.push({element:_,boardId:c})}}let r=e.filter((a)=>a.type==="pcb_stiffener"),i=[],s=(a,c,l)=>{i.push({type:"pcb_placement_error",pcb_placement_error_id:`bend_zone_${c.pcb_bend_id}_${a}`,error_type:"pcb_placement_error",message:`${Ks(e,a)} overlaps PCB bend zone ${Ks(e,c.pcb_bend_id)}`,subcircuit_id:l??c.subcircuit_id})};for(let{bend:a,board:c,keepout:l}of t){for(let{element:h,boardId:d}of o){if(d&&d!==c.pcb_board_id)continue;if(y3(h,l)<=Fy)s(Za(h),a,h.subcircuit_id)}for(let h of r){if(h.pcb_board_id!==c.pcb_board_id)continue;let d=mMo(h,c);if(d.length<3)continue;if(y3({...l,outline:d,pcb_keepout_id:h.pcb_stiffener_id},l)<=Fy)s(h.pcb_stiffener_id,a,h.subcircuit_id)}}return i}function gMo(e){let t=n7t(e);if(t.length===0)return[];let n=t7t(e),o=[];for(let r of e){if(r.type!=="pcb_trace")continue;let i=n(r);for(let{bend:s,tangent:a,keepout:c}of t){if(i&&i!==s.pcb_board_id)continue;let l;for(let h=1;h<r.route.length;h++){let d=r.route[h-1],u=r.route[h],_=d.route_type==="wire"?d:u.route_type==="wire"?u:void 0;if(!_)continue;let p=d.route_type==="through_pad"?d.end_layer===_.layer?d.end:d.start_layer===_.layer?d.start:void 0:d.route_type==="wire"?d.layer===_.layer?d:void 0:d.to_layer===_.layer?d:void 0,m=u.route_type==="through_pad"?u.start_layer===_.layer?u.start:u.end_layer===_.layer?u.end:void 0:u.route_type==="wire"?u.layer===_.layer?u:void 0:u.from_layer===_.layer?u:void 0;if(!p||!m)continue;let A=m.x-p.x,g=m.y-p.y,f=Math.hypot(A,g);if(f<=Fy)continue;if(Math.abs(A*a.x+g*a.y)/f<=Fy)continue;let x=Math.max(_.width,_.start_width??0,_.end_width??0)/2,C=Ase(p,m,c.outline);if(C.distance>x+Fy)continue;l={center:C.center,reason:"Non-perpendicular trace copper"};break}for(let h=1;!l&&h<r.route.length-1;h++){let d=r.route[h];if(d.route_type!=="wire")continue;let u=h-1,_=h+1;while(u>=0){let I=r.route[u];if(I.route_type!=="wire"||I.layer!==d.layer||Math.hypot(I.x-d.x,I.y-d.y)>Fy)break;u--}while(_<r.route.length){let I=r.route[_];if(I.route_type!=="wire"||I.layer!==d.layer||Math.hypot(I.x-d.x,I.y-d.y)>Fy)break;_++}let p=r.route[u],m=r.route[_];if(p?.route_type!=="wire"||m?.route_type!=="wire"||p.layer!==d.layer||m.layer!==d.layer)continue;let A={x:d.x-p.x,y:d.y-p.y},g={x:m.x-d.x,y:m.y-d.y},f=Math.hypot(A.x,A.y)*Math.hypot(g.x,g.y);if(f<=Fy)continue;let y=(A.x*g.x+A.y*g.y)/f,x=(A.x*g.y-A.y*g.x)/f;if(y>0&&Math.abs(x)<=Fy)continue;let C=Math.max(p.width,p.end_width??0,d.width,d.start_width??0)/2;if(Ase(d,d,c.outline).distance>C+Fy)continue;l={center:d,reason:"Trace corner"}}if(!l)continue;o.push({type:"pcb_trace_error",pcb_trace_error_id:`bend_zone_${s.pcb_bend_id}_${r.pcb_trace_id}`,error_type:"pcb_trace_error",message:`${l.reason} for ${Dw(e,r.pcb_trace_id)} overlaps PCB bend zone ${Ks(e,s.pcb_bend_id)}`,center:l.center,pcb_trace_id:r.pcb_trace_id,source_trace_id:r.source_trace_id??"",pcb_component_ids:r.pcb_component_id?[r.pcb_component_id]:[],pcb_port_ids:[],subcircuit_id:r.subcircuit_id??s.subcircuit_id})}}return o}function fse(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function AMo(e,t){return fse(e,t)<=x3}function fMo(e,{connMap:t,minClearance:n}={}){let o=e.filter((a)=>a.type==="pcb_via");if(o.length<2)return[];let r=O9(e);n??=z9(r,"min_via_hole_edge_to_via_hole_edge_clearance")??d1.min_via_hole_edge_to_via_hole_edge_clearance,t??=Aa(e);let i=[],s=new Set;for(let a=0;a<o.length;a++)for(let c=a+1;c<o.length;c++){let l=o[a],h=o[c];if(AMo(l,h))continue;if(!t.areIdsConnected(l.pcb_via_id,h.pcb_via_id))continue;let d=fse(l,h)-l.hole_diameter/2-h.hole_diameter/2;if(d+x3>=n)continue;let u=[l.pcb_via_id,h.pcb_via_id].sort().join("_");if(s.has(u))continue;s.add(u),i.push({type:"pcb_via_clearance_error",pcb_error_id:`same_net_vias_close_${u}`,message:`Vias ${Ks(e,l.pcb_via_id)} and ${Ks(e,h.pcb_via_id)} are too close together (gap: ${d.toFixed(3)}mm)`,error_type:"pcb_via_clearance_error",pcb_via_ids:[l.pcb_via_id,h.pcb_via_id],minimum_clearance:n,actual_clearance:d,pcb_center:{x:(l.x+h.x)/2,y:(l.y+h.y)/2}})}return i}function yMo(e,{connMap:t,minClearance:n}={}){let o=e.filter((c)=>c.type==="pcb_via");if(o.length<2)return[];let r=O9(e);n??=z9(r,"min_via_hole_edge_to_via_hole_edge_clearance")??d1.min_via_hole_edge_to_via_hole_edge_clearance;let i=z9(r,"min_pad_edge_to_pad_edge_clearance")??d1.min_pad_edge_to_pad_edge_clearance;t??=Aa(e);let s=[],a=new Set;for(let c=0;c<o.length;c++)for(let l=c+1;l<o.length;l++){let h=o[c],d=o[l];if(t.areIdsConnected(h.pcb_via_id,d.pcb_via_id))continue;let u=fse(h,d),_=u-h.hole_diameter/2-d.hole_diameter/2,p=n;if(_+x3>=p){if(!h.layers.some((A)=>d.layers.includes(A)))continue;if(_=u-h.outer_diameter/2-d.outer_diameter/2,p=i,_>=0&&_+x3>=p)continue}let m=[h.pcb_via_id,d.pcb_via_id].sort().join("_");if(a.has(m))continue;a.add(m),s.push({type:"pcb_via_clearance_error",pcb_error_id:`different_net_vias_close_${m}`,message:`Vias ${Ks(e,h.pcb_via_id)} and ${Ks(e,d.pcb_via_id)} from different nets are too close together (gap: ${_.toFixed(3)}mm)`,error_type:"pcb_via_clearance_error",pcb_via_ids:[h.pcb_via_id,d.pcb_via_id],minimum_clearance:p,actual_clearance:_,pcb_center:{x:(h.x+d.x)/2,y:(h.y+d.y)/2}})}return s}function xMo(e,t,n){let o=new Map,r=new Map;for(let i of[!1,!0]){let s=e.route[i?e.route.length-1:0];if(s?.route_type!=="wire")continue;let a=i?s.end_pcb_port_id:s.start_pcb_port_id;if(!a)continue;let c=t.filter((m)=>(m.type==="pcb_smtpad"||m.type==="pcb_plated_hole")&&m.pcb_port_id===a);if(!c.length)continue;let l=Jj(t,{elementIds:c.map((m)=>m.type==="pcb_smtpad"?m.pcb_smtpad_id:m.pcb_plated_hole_id),layers:[s.layer],roles:["copper"],includeDrillHoles:!1});if(l.warnings.length)continue;let h=l.elements.flatMap((m)=>m.shapes),d=(m)=>h.some((A)=>A.contains(m));if(!d(new sa(s.x,s.y)))continue;let u=!0,_=n,p=i?r:o;for(let m=i?e.route.length-2:0;m>=0&&m<e.route.length-1;m+=i?-1:1){let A=e.route[i?m+1:m],g=e.route[i?m:m+1];if(A.route_type!=="wire"||g.route_type!=="wire"||A.layer!==s.layer||g.layer!==s.layer)break;let f=new sa(A.x,A.y),y=new sa(g.x,g.y),x=new Fg(f,y),C=x.length;if(C===0)continue;let b=0;if(u){let v=[0,C,...h.flatMap((P)=>P.intersect(x).map((M)=>f.distanceTo(M)[0]))].sort((P,M)=>P-M);for(let P=0;P<v.length-1;P++){if(v[P+1]-v[P]<0.000000001)continue;let M=(v[P]+v[P+1])/(2*C);if(!d(new sa(A.x+(g.x-A.x)*M,A.y+(g.y-A.y)*M))){u=!1;break}b=v[P+1]}}let I=Math.min(C-b,_);if(b+=I,_-=I,p.set(m,b),b<C)break}}return{fromStart:o,fromEnd:r}}function CMo(e,{maxPadNeckdownLength:t}={}){if(t!==void 0&&(!Number.isFinite(t)||t<0))throw Error("maxPadNeckdownLength must be finite and nonnegative");let n=[],o=Ps(e),r=o.source_trace.list(),i=o.pcb_trace.list(),s=o.pcb_port.list(),a=Aa(e);for(let c of r){let l=c.min_trace_thickness;if(l===void 0)continue;let h=s.filter((m)=>c.connected_source_port_ids?.includes(m.source_port_id));if(h.length<2)continue;let d=a.getNetConnectedToId(h[0].pcb_port_id);if(!d)continue;let u=a.getIdsConnectedToNet(d),_=i.filter((m)=>u.includes(m.pcb_trace_id));if(_.length===0)continue;let p;for(let m of _){let A=xMo(m,e,t??l);for(let g=0;g<m.route.length-1;g++){let f=m.route[g],y=m.route[g+1];if(f.route_type!=="wire"||y.route_type!=="wire")continue;if(f.layer!==y.layer)continue;if(f.x===y.x&&f.y===y.y)continue;let x=m.route_thickness_mode==="interpolated";if(Math.min(f.width,x?y.width:f.width)>=l)continue;let C=0,b=1;if(x&&f.width!==y.width){let M=(l-f.width)/(y.width-f.width);if(f.width>=l)C=M;if(y.width>=l)b=M}let I=Math.hypot(y.x-f.x,y.y-f.y);if(C=Math.max(C,(A.fromStart.get(g)??0)/I),b=Math.min(b,1-(A.fromEnd.get(g)??0)/I),b-C<0.000000001)continue;let v=x?Math.min(f.width+(y.width-f.width)*C,f.width+(y.width-f.width)*b):f.width;if(p&&v>=p.width)continue;let P=(C+b)/2;p={pcb_trace_id:m.pcb_trace_id,center:{x:f.x+(y.x-f.x)*P,y:f.y+(y.y-f.y)*P},width:v}}}if(!p)continue;n.push({type:"pcb_trace_warning",pcb_trace_warning_id:`pcb_trace_warning_${c.source_trace_id}`,warning_type:"pcb_trace_warning",message:`Trace [${iFe(e,c)}] is routed thinner than requested (requested: ${l}mm, actual: ${p.width}mm).`,center:p.center,source_trace_id:c.source_trace_id,pcb_trace_id:p.pcb_trace_id,pcb_component_ids:Array.from(new Set(h.map((m)=>m.pcb_component_id).filter((m)=>m!==void 0))),pcb_port_ids:h.map((m)=>m.pcb_port_id)})}return n}function bMo(e,{connMap:t}={}){let n=[],o=e.filter((h)=>h.type==="source_trace"),r=e.filter((h)=>h.type==="pcb_trace"),i=e.filter((h)=>h.type==="pcb_port"),s=new Map(i.map((h)=>[h.source_port_id,h])),a=t??Aa(e),c,l=()=>c??=K8t(e,a);for(let h of o){if(!h.connected_source_port_ids?.length)continue;if((h.connected_source_net_ids?.length??0)>0)continue;if(h.connected_source_port_ids.length<2)continue;if(!r.some((u)=>a.areIdsConnected(h.source_trace_id,u.pcb_trace_id))){let u=h.connected_source_port_ids.map((p)=>s.get(p)).filter((p)=>p!==void 0);if(u.length===h.connected_source_port_ids.length&&l().arePortsConnected(u.map((p)=>p.pcb_port_id)))continue;let _=Array.from(new Set(u.map((p)=>p.pcb_component_id).filter((p)=>p!==void 0)));n.push({type:"pcb_trace_missing_error",pcb_trace_missing_error_id:`pcb_trace_missing_${h.source_trace_id}`,error_type:"pcb_trace_missing_error",message:`Trace [${iFe(e,h)}] is not connected (it has no PCB trace)`,source_trace_id:h.source_trace_id,pcb_component_ids:_,pcb_port_ids:u.map((p)=>p.pcb_port_id)})}}return n}var lse=0.000000001;function IMo(e,t){let n=new Map,o=UR(e),r=e.filter((d)=>d.type==="pcb_trace"),i=e.filter((d)=>d.type==="pcb_via"),a=e.find((d)=>d.type==="pcb_board")?.num_layers,l=["top",...Hg.filter((d)=>d.startsWith("inner")).slice(0,a===void 0?void 0:Math.max(0,a-2)),...a===1?[]:["bottom"]],h=(d,u,_)=>{if(![_.x,_.y].every(Number.isFinite))return;let p=t.getNetConnectedToId(d);if(!p)return;let m=o.some((y)=>{if(t.getNetConnectedToId(Za(y))!==p||!Vg(y).some((C)=>u.includes(C)))return!1;if(_.radius===void 0)return tK(_,y);let x={type:"pcb_via",pcb_via_id:d,x:_.x,y:_.y,outer_diameter:_.radius*2,hole_diameter:0,layers:u};return y3(x,y)<=lse}),A=new Set;for(let y of r){if(y.route_thickness_mode==="interpolated"||t.getNetConnectedToId(y.pcb_trace_id)!==p)continue;for(let x=1;x<y.route.length;x++){let C=y.route[x-1],b=y.route[x];if(C.route_type!=="wire"||b.route_type!=="wire"||C.layer!==b.layer||!u.includes(C.layer)||!Number.isFinite(C.width)||C.width<=0||Math.hypot(C.x-b.x,C.y-b.y)<=lse)continue;let I=_.radius===void 0?0:_.radius+C.width/2;if(ga(_,C,b)<=I+lse){A.add(y.pcb_trace_id);break}}}let g={..._,touchesPad:m,touchingTraceIds:A},f=n.get(p)??new Map;for(let y of u){let x=f.get(y)??[];x.push(g),f.set(y,x)}n.set(p,f)};for(let d of i){if(!Number.isFinite(d.outer_diameter)||d.outer_diameter<=0)continue;h(d.pcb_via_id,Vg(d),{x:d.x,y:d.y,ownerTraceId:d.pcb_trace_id,radius:d.outer_diameter/2})}for(let d of e){if(d.type!=="pcb_trace")continue;for(let u of d.route){if(u.route_type!=="via")continue;if(i.some((A)=>Math.hypot(A.x-u.x,A.y-u.y)<=lse&&(A.pcb_trace_id===d.pcb_trace_id||!A.pcb_trace_id&&t.areIdsConnected(A.pcb_via_id,d.pcb_trace_id))))continue;let _=l.indexOf(u.from_layer),p=l.indexOf(u.to_layer);if(_<0||p<0)continue;let m=u.outer_diameter;if(m!==void 0&&(!Number.isFinite(m)||m<=0))continue;h(d.pcb_trace_id,l.slice(Math.min(_,p),Math.max(_,p)+1),{x:u.x,y:u.y,ownerTraceId:d.pcb_trace_id,radius:m===void 0?void 0:m/2})}}return n}function c8t({point:e,width:t,ownerTrace:n,index:o,connectivity:r}){if(e.route_type!=="wire"||!Number.isFinite(t)||t<=0)return!1;let i=r.getNetConnectedToId(n.pcb_trace_id);if(!i)return!1;return(o.get(i)?.get(e.layer)??[]).some((s)=>{if(s.ownerTraceId===n.pcb_trace_id)return!1;if(!s.touchesPad&&![...s.touchingTraceIds].some((c)=>c!==n.pcb_trace_id))return!1;let a=s.radius===void 0?0:s.radius+t/2;return Math.hypot(e.x-s.x,e.y-s.y)<=a+lse})}var Vj=0.01;function vMo(e){let t=e.find((i)=>i.type==="pcb_board"),o=["top",...Hg.filter((i)=>i.startsWith("inner")).slice(0,t?Math.max(0,t.num_layers-2):void 0),...t?.num_layers===1?[]:["bottom"]],r=new Map;for(let i of e){if(i.type!=="pcb_via"||!i.pcb_trace_id)continue;let s=r.get(i.pcb_trace_id);if(s)s.push(i);else r.set(i.pcb_trace_id,[i])}return{stack:o,ownedViasByTrace:r}}function SMo({via:e,incoming:t,outgoing:n,traceId:o,context:{stack:r,ownedViasByTrace:i}}){let s=r.indexOf(e.from_layer),a=r.indexOf(e.to_layer);if(s<0||a<0)return!1;let c=i.get(o)?.filter((u)=>Math.abs(u.x-e.x)<Vj&&Math.abs(u.y-e.y)<Vj)??[],l=c.length>0?c.map((u)=>u.layers):[r.slice(Math.min(s,a),Math.max(s,a)+1)],h=Math.abs(t.x-e.x)<Vj&&Math.abs(t.y-e.y)<Vj,d=Math.abs(n.x-e.x)<Vj&&Math.abs(n.y-e.y)<Vj;return r.includes(t.layer)&&r.includes(n.layer)&&l.some((u)=>u.includes(t.layer)&&u.includes(n.layer))&&(h||t.layer===e.from_layer)&&(d||n.layer===e.to_layer)}var o7t=0.000000001,r7t=0.000000001;function Xj(e,t){return e.route_type==="wire"&&Vg(t).includes(e.layer)&&tK(e,t)}function PMo(e,t){let n=new Map;for(let o of e){if(o.route_thickness_mode==="interpolated")continue;let r=t.getNetConnectedToId(o.pcb_trace_id);if(!r)continue;for(let i=0;i<o.route.length-1;i++){let s=o.route[i],a=o.route[i+1];if(s.route_type!=="wire"||a.route_type!=="wire")continue;if(s.layer!==a.layer)continue;if(Math.hypot(s.x-a.x,s.y-a.y)<=r7t)continue;let c=n.get(r)??new Map,l=c.get(s.layer)??[];l.push({trace:o,start:s,end:a}),c.set(s.layer,l),n.set(r,c)}}return n}function l8t(e,t){if(e.route_thickness_mode==="interpolated")return;let n=t==="start"?0:e.route.length-2,o=t==="start"?1:-1;while(n>=0&&n<e.route.length-1){let r=e.route[n],i=e.route[n+1];if(r?.route_type!=="wire"||i?.route_type!=="wire"||r.layer!==i.layer)return;if(Math.hypot(r.x-i.x,r.y-i.y)>r7t)return r.width;n+=o}return}function h8t({point:e,endpointTraceCopperWidth:t,ownerTrace:n,traceWireSegmentsByNetAndLayer:o,fullConnectivityMap:r}){if(e.route_type!=="wire")return!1;let i=r.getNetConnectedToId(n.pcb_trace_id);if(!i)return!1;let s=o.get(i)?.get(e.layer)??[];for(let a of s){if(a.trace.pcb_trace_id===n.pcb_trace_id)continue;let c=t/2+a.start.width/2+o7t;if(ga(e,a.start,a.end)<=c)return!0}return!1}function d8t(e){if(e.route_type==="through_pad")return{x:(e.start.x+e.end.x)/2,y:(e.start.y+e.end.y)/2};return{x:e.x,y:e.y}}function u8t(e,t,n,o){return t.some((r)=>{if(!r.pcb_port_id||r.pcb_port_id===n)return!1;return o.get(r.pcb_port_id)?.some((s)=>Xj(e,s))??!1})}function EMo({firstPoint:e,lastPoint:t,port:n,expectedPorts:o,padMap:r}){let i,s=e.route_type==="wire"?e:void 0,a=t.route_type==="wire"?t:void 0,c=$He(e).includes(n.pcb_port_id),l=$He(t).includes(n.pcb_port_id);if(c&&s)i=s;else if(l&&a)i=a;else if(u8t(e,o,n.pcb_port_id,r)&&a)i=a;else if(u8t(t,o,n.pcb_port_id,r)&&s)i=s;else if(s&&a)i=fse(s,n)<=fse(a,n)?s:a;else if(s)i=s;else if(a)i=a;let h=d8t(e),d=d8t(t);return i?{x:i.x,y:i.y}:{x:(h.x+d.x)/2,y:(h.y+d.y)/2}}function MMo(e,{connMap:t,pcbConnectivityMap:n}={}){let o=vMo(e),r=j8t(e).map(({trace:b,point:I,index:v,port:P,padLayers:M})=>({type:"pcb_trace_error",error_type:"pcb_trace_error",pcb_trace_error_id:`missing_layer_connection_${b.pcb_trace_id}_${v}_${P.pcb_port_id}`,pcb_trace_id:b.pcb_trace_id,source_trace_id:b.source_trace_id??`!${b.pcb_trace_id}`,pcb_port_ids:[P.pcb_port_id],pcb_component_ids:P.pcb_component_id?[P.pcb_component_id]:[],center:{x:I.x,y:I.y},message:`Trace [${Dw(e,b.pcb_trace_id)}] on ${I.layer} is missing a via connection to port [${aS(e,P.pcb_port_id)}] on ${M.join(", ")}.`})),i=e.filter((b)=>b.type==="pcb_port"),s=e.filter((b)=>b.type==="pcb_trace"),a=e.filter((b)=>b.type==="source_trace"),c=e.filter((b)=>b.type==="pcb_smtpad"),l=e.filter((b)=>b.type==="pcb_plated_hole"),h=new Map,d=t,u,_=()=>(d??=Aa(e),d),p=()=>(u??=PMo(s,_()),u),m,A=()=>(m??=IMo(e,_()),m),g=new Set;for(let b of c)if(b.pcb_port_id)h.set(b.pcb_port_id,[...h.get(b.pcb_port_id)??[],b]);for(let b of l)if(b.pcb_port_id)h.set(b.pcb_port_id,[...h.get(b.pcb_port_id)??[],b]);let f=new Map,y=new Map;for(let b of s){let I=new Set,v=b.route[0],P=b.route.at(-1);for(let M of[v,P]){if(!M)continue;for(let[B,T]of h)if(T.some((N)=>Xj(M,N)))I.add(B)}f.set(b.pcb_trace_id,I);for(let M of I){let B=y.get(M)??new Set;B.add(b.pcb_trace_id),y.set(M,B)}}let x=new Map,C=(b)=>{let I=x.get(b.pcb_trace_id);if(I)return I;n??=aFe(e);let v=new Set,P=[b.pcb_trace_id];while(P.length>0){let B=P.pop();if(v.has(B))continue;v.add(B);for(let T of n.getAllTracesConnectedToTrace(B))if(!v.has(T.pcb_trace_id))P.push(T.pcb_trace_id);for(let T of f.get(B)??[])for(let N of y.get(T)??[])if(!v.has(N))P.push(N)}let M=s.filter((B)=>v.has(B.pcb_trace_id));for(let B of M)x.set(B.pcb_trace_id,M);return M};for(let b of s){if(b.route.length===0)continue;let I=b.route[0],v=b.route[b.route.length-1],P=a.find((T)=>T.source_trace_id===b.source_trace_id),M=P?i.filter((T)=>P.connected_source_port_ids?.includes(T.source_port_id)):[];for(let T=1;T<b.route.length-1;T++){let N=b.route[T-1],D=b.route[T],L=b.route[T+1];if(D.route_type==="via"){let H=N.route_type==="wire",V=L.route_type==="wire";if(H&&V){if(!SMo({via:D,incoming:N,outgoing:L,traceId:b.pcb_trace_id,context:o})){let O=Dw(e,b.pcb_trace_id);r.push({type:"pcb_trace_error",message:`Via in trace [${O}] does not connect its adjacent wire layers at position {x: ${D.x}, y: ${D.y}}.`,source_trace_id:P?.source_trace_id||b.source_trace_id||`!${b.pcb_trace_id}`,error_type:"pcb_trace_error",pcb_trace_id:b.pcb_trace_id,pcb_trace_error_id:`misaligned_via_${b.pcb_trace_id}_${T}`,pcb_component_ids:[],pcb_port_ids:[]})}}}}let B=Dw(e,b.pcb_trace_id);if(P&&M.length>0){if(g.has(P.source_trace_id))continue;g.add(P.source_trace_id)}for(let T of M){if(!T.pcb_port_id)continue;let N=h.get(T.pcb_port_id);if(!N?.length)continue;let D=N.some((V)=>Xj(I,V)),L=N.some((V)=>Xj(v,V));if(D||L)continue;if(C(b).some((V)=>f.get(V.pcb_trace_id)?.has(T.pcb_port_id)))continue;if(!D&&!L){let V=aS(e,T.pcb_port_id),O=N[0].type==="pcb_smtpad"?"SMD pad":"through-hole pad",U=EMo({firstPoint:I,lastPoint:v,port:T,expectedPorts:M,padMap:h});r.push({type:"pcb_trace_error",message:`Trace [${B}] is missing a connection to ${O} ${V}`,source_trace_id:P?.source_trace_id||b.source_trace_id||`!${b.pcb_trace_id}`,error_type:"pcb_trace_error",pcb_trace_id:b.pcb_trace_id,pcb_trace_error_id:`missing_connection_${b.pcb_trace_id}_${T.pcb_port_id}`,center:U,pcb_component_ids:[],pcb_port_ids:[T.pcb_port_id]})}}if(M.length===0){let T=!1,N=!1;for(let Y of h.values()){if(Y.some((X)=>Xj(I,X)))T=!0;if(Y.some((X)=>Xj(v,X)))N=!0}let D=!T?l8t(b,"start"):void 0,L=!N?l8t(b,"end"):void 0,H=D!==void 0&&h8t({point:I,endpointTraceCopperWidth:D,ownerTrace:b,traceWireSegmentsByNetAndLayer:p(),fullConnectivityMap:_()}),V=L!==void 0&&h8t({point:v,endpointTraceCopperWidth:L,ownerTrace:b,traceWireSegmentsByNetAndLayer:p(),fullConnectivityMap:_()}),O=T||H||D!==void 0&&c8t({point:I,width:D,ownerTrace:b,index:A(),connectivity:_()}),U=N||V||L!==void 0&&c8t({point:v,width:L,ownerTrace:b,index:A(),connectivity:_()}),j=I.route_type==="wire"&&v.route_type==="wire"&&I.layer===v.layer&&Math.hypot(I.x-v.x,I.y-v.y)<=o7t;if(!O&&I.route_type==="wire")r.push({type:"pcb_trace_error",message:`Trace [${B}] has disconnected endpoint at (${I.x.toFixed(2)}, ${I.y.toFixed(2)})`,source_trace_id:P?.source_trace_id||b.source_trace_id||`!${b.pcb_trace_id}`,error_type:"pcb_trace_error",pcb_trace_id:b.pcb_trace_id,pcb_trace_error_id:`disconnected_endpoint_${b.pcb_trace_id}_start`,center:{x:I.x,y:I.y},pcb_component_ids:[],pcb_port_ids:[]});if(!U&&v.route_type==="wire"&&!(j&&!O))r.push({type:"pcb_trace_error",message:`Trace [${B}] has disconnected endpoint at (${v.x.toFixed(2)}, ${v.y.toFixed(2)})`,source_trace_id:P?.source_trace_id||b.source_trace_id||`!${b.pcb_trace_id}`,error_type:"pcb_trace_error",pcb_trace_id:b.pcb_trace_id,pcb_trace_error_id:`disconnected_endpoint_${b.pcb_trace_id}_end`,center:{x:v.x,y:v.y},pcb_component_ids:[],pcb_port_ids:[]})}}return r}function wMo(e){if(e.outline&&e.outline.length>0)return e.outline.map((t)=>({x:t.x,y:t.y}));if(e.center&&typeof e.width==="number"&&typeof e.height==="number"){let t=e.center.x,n=e.center.y,o=e.width/2,r=e.height/2;return[{x:t-o,y:n-r},{x:t+o,y:n-r},{x:t+o,y:n+r},{x:t-o,y:n+r}]}return null}function BMo(e,t={}){let n=[],o=O9(e);if(!o)return n;let r=t.margin??z9(o,"min_board_edge_clearance")??d1.min_board_edge_clearance,i=wMo(o);if(!i)return n;let s=Ps(e).pcb_trace.list();for(let a of s){if(a.route.length<2)continue;for(let c=0;c<a.route.length-1;c++){let l=a.route[c],h=a.route[c+1];if(l.route_type!=="wire"||h.route_type!=="wire")continue;let d="width"in l?l.width:("width"in h)?h.width:0.1,u={x:l.x,y:l.y},_={x:h.x,y:h.y},p=Number.POSITIVE_INFINITY;for(let A=0;A<i.length;A++){let g=i[A],f=i[(A+1)%i.length],y=c5(u,_,g,f);if(y<p)p=y}let m=d/2+r;if(p<m){let A={type:"pcb_trace_error",error_type:"pcb_trace_error",pcb_trace_error_id:`trace_too_close_to_board_${a.pcb_trace_id}_segment_${c}`,message:`Trace too close to board edge (${p.toFixed(3)}mm < ${m.toFixed(3)}mm required, margin: ${r}mm)`,pcb_trace_id:a.pcb_trace_id,source_trace_id:a.source_trace_id||"",center:{x:(u.x+_.x)/2,y:(u.y+_.y)/2},pcb_component_ids:[],pcb_port_ids:[]};n.push(A)}}}return n}var ZHe=(e)=>e.type==="pcb_courtyard_circle"||e.type==="pcb_courtyard_outline"||e.type==="pcb_courtyard_polygon"||e.type==="pcb_courtyard_rect";function p8t(e){if(ZHe(e))return[e.layer];return Vg(e)}function TMo(e,t){if(e.length===0||t.length===0)return!0;return e.some((n)=>t.includes(n))}function DMo(e,t){let n=p8t(e),o=p8t(t);if(!TMo(n,o))return!1;if(e.type==="pcb_smtpad"&&t.type==="pcb_smtpad")return y3(e,t)<=0;if(e.type==="pcb_plated_hole"&&ZHe(t))return y3(e,JHe(t))<=0;if(ZHe(e)&&t.type==="pcb_plated_hole")return y3(t,JHe(e))<=0;let r=ky([e]),i=ky([t]);return qp(r,i)}var sse=(e)=>e.type==="pcb_courtyard_circle"||e.type==="pcb_courtyard_outline"||e.type==="pcb_courtyard_polygon"||e.type==="pcb_courtyard_rect",m8t=(e)=>e.type==="pcb_hole"||e.type==="pcb_plated_hole",_8t=(e,t)=>{if("pcb_port_id"in t&&t.pcb_port_id)return aS(e,t.pcb_port_id);let n=Za(t);return Ks(e,n)};function NMo(e){let t=[],n=new Set(e.flatMap((h)=>h.type==="pcb_component"&&h.do_not_place?[h.pcb_component_id]:[])),o=Aa(e),r=Ps(e).pcb_smtpad.list(),i=Ps(e).pcb_plated_hole.list(),s=Ps(e).pcb_hole.list(),a=e.filter(sse),c=new Map;for(let h of r){let d=h.pcb_component_id||`standalone_pad_${Za(h)}`;if(!c.has(d))c.set(d,{component_id:d,elements:[]});c.get(d).elements.push(h)}for(let h of i){let d=h.pcb_component_id||`standalone_plated_hole_${Za(h)}`;if(!c.has(d))c.set(d,{component_id:d,elements:[]});c.get(d).elements.push(h)}for(let h of s){let d=h.pcb_component_id||`standalone_hole_${Za(h)}`;if(!c.has(d))c.set(d,{component_id:d,elements:[h]})}for(let h of a){let d=h.pcb_component_id;if(!c.has(d))c.set(d,{component_id:d,elements:[]});c.get(d).elements.push(h)}for(let[h,d]of c)if(d.elements.length>0)d.bounds=ky(d.elements);let l=Array.from(c.values());for(let h=0;h<l.length;h++)for(let d=h+1;d<l.length;d++){let u=l[h],_=l[d],p=n.has(u.component_id)||n.has(_.component_id);if(!u.bounds||!_.bounds)continue;if(!qp(u.bounds,_.bounds))continue;for(let m of u.elements)for(let A of _.elements){let g=Za(m),f=Za(A);if(p&&(sse(m)||sse(A)))continue;if((sse(m)||sse(A))&&!m8t(m)&&!m8t(A))continue;if(m.type==="pcb_smtpad"&&A.type==="pcb_smtpad"&&o.areIdsConnected(g,f))continue;if(DMo(m,A)){let y=_8t(e,m),x=_8t(e,A),C={type:"pcb_footprint_overlap_error",pcb_error_id:`pcb_footprint_overlap_${g}_${f}`,error_type:"pcb_footprint_overlap_error",message:`${m.type} ${y} overlaps with ${A.type} ${x}`,pcb_component_ids:[m.pcb_component_id,A.pcb_component_id].filter((b)=>Boolean(b))};if(m.type==="pcb_smtpad"||A.type==="pcb_smtpad"){if(C.pcb_smtpad_ids=[],m.type==="pcb_smtpad")C.pcb_smtpad_ids.push(g);if(A.type==="pcb_smtpad")C.pcb_smtpad_ids.push(f)}if(m.type==="pcb_plated_hole"||A.type==="pcb_plated_hole"){if(C.pcb_plated_hole_ids=[],m.type==="pcb_plated_hole")C.pcb_plated_hole_ids.push(g);if(A.type==="pcb_plated_hole")C.pcb_plated_hole_ids.push(f)}if(m.type==="pcb_hole"||A.type==="pcb_hole"){if(C.pcb_hole_ids=[],m.type==="pcb_hole")C.pcb_hole_ids.push(g);if(A.type==="pcb_hole")C.pcb_hole_ids.push(f)}t.push(C)}}}return t}var RMo=new Set(["pcb_courtyard_circle","pcb_courtyard_outline","pcb_courtyard_polygon","pcb_courtyard_pill","pcb_courtyard_rect"]);function QMo(e){let t=new Set(e.flatMap((o)=>{if(o.type==="source_manually_placed_via")return[o.source_manually_placed_via_id];if(o.type==="source_component"&&o.ftype==="simple_test_point")return[o.source_component_id];return[]})),n=new Set(e.filter((o)=>RMo.has(o.type)).flatMap((o)=>("pcb_component_id"in o)&&o.pcb_component_id?[o.pcb_component_id]:[]));return e.filter((o)=>o.type==="pcb_component").filter((o)=>!n.has(o.pcb_component_id)&&(!o.source_component_id||!t.has(o.source_component_id))).map((o)=>{let r=o.source_component_id?e.find((s)=>s.type==="source_component"&&s.source_component_id===o.source_component_id):void 0,i=r?.type==="source_component"?r.name:yO(e,o.pcb_component_id);return{type:"pcb_component_missing_courtyard_warning",pcb_component_missing_courtyard_warning_id:`pcb_component_missing_courtyard_warning_${o.pcb_component_id}`,warning_type:"pcb_component_missing_courtyard_warning",message:`${i} has no courtyard`,pcb_component_id:o.pcb_component_id,source_component_id:o.source_component_id,subcircuit_id:o.subcircuit_id}})}var i7t=(e)=>{if(e.trace_length!==void 0)return e.trace_length;let t=0,n;for(let o of e.route){let r=o.route_type==="through_pad"?o.start:o;if(n)t+=Math.hypot(r.x-n.x,r.y-n.y);if(o.route_type==="via")t+=1.6;if(o.route_type==="through_pad")t+=Math.hypot(o.end.x-o.start.x,o.end.y-o.start.y),n=o.end;else n=o}return t},kMo=(e)=>{let t=new Set;for(let n of e.route){if(n.route_type!=="wire")continue;if(n.start_pcb_port_id)t.add(n.start_pcb_port_id);if(n.end_pcb_port_id)t.add(n.end_pcb_port_id)}return t},s7t=(e)=>{let t=e.filter((a)=>a.type==="source_trace"),n=e.filter((a)=>a.type==="pcb_trace"),o=e.filter((a)=>a.type==="pcb_port"),r=new Map;for(let a of o){if(!a.source_port_id)continue;let c=r.get(a.source_port_id)??new Set;c.add(a.pcb_port_id),r.set(a.source_port_id,c)}let i=new Map;for(let a of n){if(!a.source_trace_id)continue;let c=i.get(a.source_trace_id)??[];c.push(a),i.set(a.source_trace_id,c)}let s=new Map;for(let a of t){if(a.connected_source_port_ids.length!==2)continue;let c=a.connected_source_port_ids.map((h)=>r.get(h));if(c.some((h)=>!h?.size))continue;let l=new Set((i.get(a.source_trace_id)??[]).filter((h)=>{let d=kMo(h);return c.every((u)=>[...u].some((_)=>d.has(_)))}).map((h)=>h.pcb_trace_id));if(l.size>0)s.set(a.source_trace_id,l)}for(let[a,c]of s)i.set(a,i.get(a).filter((l)=>c.has(l.pcb_trace_id)));return i},LMo=(e)=>{let t=new Map(e.filter((r)=>r.type==="source_trace").map((r)=>[r.source_trace_id,r])),n=s7t(e),o=[];for(let[r,i]of n){let s=i[0],a=t.get(r);if(!a)continue;let c=a.max_length;if(typeof c!=="number")continue;let l=i.reduce((h,d)=>h+i7t(d),0);if(l<=c+0.000000001)continue;o.push({type:"pcb_trace_too_long_error",pcb_trace_too_long_error_id:`pcb_trace_too_long_error_${s.pcb_trace_id}`,error_type:"pcb_trace_too_long_error",message:`PCB trace is ${l.toFixed(2)}mm long, exceeding the ${c}mm maximum`,pcb_trace_id:s.pcb_trace_id,source_trace_id:a.source_trace_id,source_net_id:a.connected_source_net_ids[0],actual_trace_length:l,maximum_trace_length:c,subcircuit_id:s.subcircuit_id??a.subcircuit_id})}return o},HMo=(e)=>{let t=e.filter((i)=>i.type==="source_trace"),n=e.filter((i)=>i.type==="pcb_trace"),o=e.filter((i)=>i.type==="pcb_port"),r=[];for(let i of t){let s=i.max_via_count;if(typeof s!=="number")continue;let a=n.filter((h)=>h.source_trace_id===i.source_trace_id);if(a.length===0)continue;let c=a.reduce((h,d)=>h+d.route.filter((u)=>u.route_type==="via").length,0);if(c<=s)continue;let l=o.filter((h)=>h.source_port_id!==void 0&&i.connected_source_port_ids.includes(h.source_port_id));r.push({type:"pcb_trace_error",pcb_trace_error_id:`max_via_count_exceeded_${i.source_trace_id}`,error_type:"pcb_trace_error",message:`PCB trace uses ${c} vias, exceeding the ${s} maximum`,pcb_trace_id:a[0].pcb_trace_id,source_trace_id:i.source_trace_id,pcb_component_ids:[...new Set(l.map((h)=>h.pcb_component_id).filter((h)=>h!==void 0))],pcb_port_ids:l.map((h)=>h.pcb_port_id),subcircuit_id:a[0].subcircuit_id??i.subcircuit_id})}return r};function FMo(e,{connMap:t,minClearance:n}={}){let o=UR(e);if(o.length<2)return[];let r=O9(e);n??=z9(r,"min_pad_edge_to_pad_edge_clearance")??d1.min_pad_edge_to_pad_edge_clearance,t??=Aa(e);let i=new nK({objects:o,getBounds:cS,getId:(a)=>Za(a)}),s=new Map;for(let a of o){let c=Za(a),l=i.getObjectsInBounds(cS(a),n);for(let h of l){let d=Za(h);if(c===d)continue;if(!Vg(a).some((g)=>Vg(h).includes(g)))continue;if(t.areIdsConnected(c,d))continue;let u=[c,d].sort().join("_"),_=y3(a,h);if(_+x3>=n)continue;let p=XHe(a),m=XHe(h),A={type:"pcb_pad_pad_clearance_error",pcb_pad_pad_clearance_error_id:`pad_pad_clearance_${u}`,error_type:"pcb_pad_pad_clearance_error",message:`Pads ${Ks(e,c)} and ${Ks(e,d)} are too close (clearance: ${ul(_)}, minimum: ${ul(n)})`,pcb_pad_ids:[c,d],minimum_clearance:n,actual_clearance:_,center:{x:(p.x+m.x)/2,y:(p.y+m.y)/2}};if(!s.has(u))s.set(u,A)}}return Array.from(s.values())}function zMo(e,{connMap:t,minClearance:n}={}){let o=UR(e),r=G8t(e);if(o.length===0||r.length===0)return[];let i=O9(e);n??=z9(i,"min_trace_to_pad_edge_clearance")??d1.min_trace_to_pad_edge_clearance,t??=Aa(e);let s=new nK({objects:o,getBounds:cS,getId:(l)=>Za(l)}),a=new Map,c=new Set;for(let l of r){let h=s.getObjectsInBounds(Wj(l),n+l.thickness/2);for(let d of h){let u=Za(d);if(!Vg(d).includes(l.layer))continue;if(t.areIdsConnected(l.pcb_trace_id,u))continue;let _=`${u}_${l.pcb_trace_id}`,{gap:p,center:m}=xse(l,d);if($j(p)){a.delete(_),c.add(_);continue}if(c.has(_))continue;if(p+x3>=n)continue;let A={type:"pcb_pad_trace_clearance_error",pcb_pad_trace_clearance_error_id:`pad_trace_clearance_${_}`,error_type:"pcb_pad_trace_clearance_error",message:`Pad ${Ks(e,u)} and trace ${Ks(e,l.pcb_trace_id)} are too close (clearance: ${ul(p)}, minimum: ${ul(n)})`,pcb_pad_id:u,pcb_trace_id:l.pcb_trace_id,minimum_clearance:n,actual_clearance:p,center:m},g=a.get(_);if(!g||p<g.gap)a.set(_,{error:A,gap:p})}}return Array.from(a.values()).map(({error:l})=>l)}function OMo(e,{connMap:t,minClearance:n}={}){let o=e.filter((c)=>c.type==="pcb_via"),r=G8t(e).map((c)=>({...c,minX:Math.min(c.x1,c.x2),maxX:Math.max(c.x1,c.x2),minY:Math.min(c.y1,c.y2),maxY:Math.max(c.y1,c.y2),radius:Math.max(0,c.thickness/2),finiteBounds:Number.isFinite(c.x1)&&Number.isFinite(c.x2)&&Number.isFinite(c.y1)&&Number.isFinite(c.y2)&&Number.isFinite(c.thickness)}));if(o.length===0||r.length===0)return[];let i=O9(e);n??=z9(i,"min_trace_to_pad_edge_clearance")??d1.min_trace_to_pad_edge_clearance,t??=Aa(e);let s=new Map,a=new Set;for(let c of o){let l=Vg(c),h=Number.isFinite(c.x)&&Number.isFinite(c.y)&&Number.isFinite(c.outer_diameter)&&Number.isFinite(n),d=Math.max(0,c.outer_diameter/2)+Math.max(0,n)+x3;for(let u of r){let _=d+u.radius;if(h&&u.finiteBounds&&(c.x<u.minX-_||c.x>u.maxX+_||c.y<u.minY-_||c.y>u.maxY+_))continue;if(!l.includes(u.layer))continue;if(t.areIdsConnected(u.pcb_trace_id,c.pcb_via_id))continue;let p=`${c.pcb_via_id}_${u.pcb_trace_id}`,{gap:m,center:A}=xse(u,c);if($j(m)){s.delete(p),a.add(p);continue}if(a.has(p))continue;if(m+x3>=n)continue;let g={type:"pcb_via_trace_clearance_error",pcb_via_trace_clearance_error_id:`via_trace_clearance_${p}`,error_type:"pcb_via_trace_clearance_error",message:`Via ${Ks(e,c.pcb_via_id)} and trace ${Ks(e,u.pcb_trace_id)} are too close (clearance: ${ul(m)}, minimum: ${ul(n)})`,pcb_via_id:c.pcb_via_id,pcb_trace_id:u.pcb_trace_id,minimum_clearance:n,actual_clearance:m,center:A},f=s.get(p);if(!f||m<f.gap)s.set(p,{error:g,gap:m})}}return Array.from(s.values()).map(({error:c})=>c)}function VMo(e,{connMap:t,minClearance:n}={}){let o=e.filter((l)=>l.type==="pcb_via"),r=UR(e);if(o.length===0||r.length===0)return[];let i=O9(e),s=n??z9(i,"min_pad_edge_to_pad_edge_clearance")??d1.min_pad_edge_to_pad_edge_clearance;t??=Aa(e);let a=new nK({objects:r,getBounds:cS,getId:Za}),c=[];for(let l of o){let h=a.getObjectsInBounds(cS(l),s);for(let d of h){let u=Za(d);if(!Vg(l).some((p)=>Vg(d).includes(p)))continue;if(t.areIdsConnected(l.pcb_via_id,u))continue;let _=y3(l,d);if(_+x3>=s)continue;c.push({type:"pcb_pad_pad_clearance_error",pcb_pad_pad_clearance_error_id:`via_pad_clearance_${l.pcb_via_id}_${u}`,error_type:"pcb_pad_pad_clearance_error",message:`Via ${Ks(e,l.pcb_via_id)} and pad ${Ks(e,u)} are too close (clearance: ${ul(_)}, minimum: ${ul(s)})`,pcb_pad_ids:[l.pcb_via_id,u],minimum_clearance:s,actual_clearance:_,center:_Eo(l,d)})}}return c}var YMo=0.000000001;function GMo(e,t){let{gap:n}=xse({x1:e.x,y1:e.y,x2:e.x,y2:e.y,thickness:e.hole_diameter},t);return n<-YMo}function UMo(e){let t=O9(e);if(t&&"is_via_in_pad_allowed"in t&&t.is_via_in_pad_allowed===!0)return[];let n=e.filter((a)=>a.type==="pcb_via"),o=UR(e);if(n.length===0||o.length===0)return[];let r=new Map(o.map((a,c)=>[Za(a),c])),i=new nK({objects:o,getBounds:cS,getId:Za}),s=[];for(let a of n){let c=i.getObjectsInBounds(cS(a));for(let l of c){let h=Za(l),d=Vg(a),u=Vg(l);if(!d.some((m)=>u.includes(m)))continue;if(!GMo(a,l))continue;let _=r.get(h)??0,p=aEo(e,l,_);s.push({type:"pcb_placement_error",pcb_placement_error_id:`via_in_pad_${a.pcb_via_id}_${h}`,error_type:"pcb_placement_error",message:`Via hole at (${a.x.toFixed(2)}mm, ${a.y.toFixed(2)}mm) overlaps ${p}`,subcircuit_id:a.subcircuit_id??l.subcircuit_id})}}return s}var $2e=(e)=>{let t=new Set;for(let n of e){if(n.type==="pcb_pad_trace_clearance_error"&&typeof n.pcb_trace_id==="string"&&typeof n.pcb_pad_id==="string")t.add(`overlap_${n.pcb_trace_id}_${n.pcb_pad_id}`);if(n.type==="pcb_via_trace_clearance_error"&&typeof n.pcb_trace_id==="string"&&typeof n.pcb_via_id==="string")t.add(`overlap_${n.pcb_trace_id}_${n.pcb_via_id}`)}return e.filter((n)=>{let o=n;return!(o.type==="pcb_trace_error"&&typeof o.pcb_trace_error_id==="string"&&t.has(o.pcb_trace_error_id))})};function WMo(e){let t=[],n=e.filter((a)=>("source_component_id"in a)&&(a.type==="source_component"||a.type.startsWith("source_simple_"))),o=e.filter((a)=>a.type==="source_port"),r=e.filter((a)=>a.type==="source_trace"),i=new Set;for(let a of r)for(let c of a.connected_source_port_ids??[])i.add(c);let s=new Map;for(let a of n)if("internally_connected_source_port_ids"in a&&a.internally_connected_source_port_ids)s.set(a.source_component_id,a.internally_connected_source_port_ids);for(let a of s.values())for(let c of a)if(c.some((l)=>i.has(l)))for(let l of c)i.add(l);for(let a of o)if(a.must_be_connected===!0){if(!i.has(a.source_port_id)){let l=n.find((h)=>h.source_component_id===a.source_component_id)?.name??"Unknown";t.push({type:"source_pin_must_be_connected_error",source_pin_must_be_connected_error_id:`source_pin_must_be_connected_error_${a.source_port_id}`,error_type:"source_pin_must_be_connected_error",message:`Port ${a.name} on ${l} must be connected but is floating`,source_component_id:a.source_component_id??"",source_port_id:a.source_port_id,subcircuit_id:a.subcircuit_id})}}return t}var g8t=(e)=>{if(e===void 0)return;if(typeof e==="string"&&!/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?\s*(?:[pnumkKMGTµμ]?V)?$/i.test(e.trim()))return;try{let t=_h.parse(e);return Number.isFinite(t)?t:void 0}catch{return}};function XMo(e){let t=eS(e),n=e.filter((i)=>i.type==="source_port"),o=new Map;for(let i of n){let s=g8t(i.provides_voltage);if(s===void 0)continue;let a=t.getNetConnectedToId(i.source_port_id);if(a===void 0)continue;let c=o.get(a)??[];c.push({sourcePort:i,volts:s}),o.set(a,c)}let r=[];for(let i of n){let s=g8t(i.requires_voltage);if(s===void 0)continue;let a=t.getNetConnectedToId(i.source_port_id);if(a===void 0)continue;for(let c of o.get(a)??[]){if(c.sourcePort.source_port_id===i.source_port_id)continue;if(Math.abs(c.volts-s)<=0.000000001*Math.max(1,Math.abs(c.volts),Math.abs(s)))continue;r.push(bw.parse({type:"source_component_misconfigured_error",message:`${qvt(e,i)} requires ${s} V, but is connected to ${qvt(e,c.sourcePort)}, which provides ${c.volts} V.`,source_component_ids:[...new Set([i.source_component_id,c.sourcePort.source_component_id].filter((l)=>l!==void 0))],source_port_ids:[i.source_port_id,c.sourcePort.source_port_id],is_fatal:!0}))}}return r}function jMo(e){let t=e.filter((i)=>i.type==="source_component"&&(i.ftype==="simple_push_button"||i.ftype==="simple_switch")),n=e.filter((i)=>i.type==="source_port"),o=e.filter((i)=>i.type==="schematic_port"),r=[];for(let i of t){let s=o.flatMap((l)=>{let h=n.find((d)=>d.source_port_id===l.source_port_id&&d.source_component_id===i.source_component_id);if(!h)return[];return[h]});if(s.length!==2)continue;let a=s[0].subcircuit_connectivity_map_key,c=s[1].subcircuit_connectivity_map_key;if(!a)continue;if(a!==c)continue;r.push(bw.parse({type:"source_component_misconfigured_error",message:`Switch ${i.name} has both schematic contacts connected to the same net. Check internallyConnectedPins and the footprint pin mapping.`,source_component_ids:[i.source_component_id],source_port_ids:s.map((l)=>l.source_port_id),is_fatal:!0}))}return r}var KMo=["must_be_connected","provides_power","requires_power","provides_ground","requires_ground","provides_voltage","requires_voltage","do_not_connect","include_in_board_pinout","can_use_internal_pullup","is_using_internal_pullup","needs_external_pullup","can_use_internal_pulldown","is_using_internal_pulldown","needs_external_pulldown","can_use_open_drain","is_using_open_drain","can_use_push_pull","is_using_push_pull","should_have_decoupling_capacitor","recommended_decoupling_capacitor_capacitance","is_configured_for_i2c_sda","is_configured_for_i2c_scl","is_configured_for_spi_mosi","is_configured_for_spi_miso","is_configured_for_spi_sck","is_configured_for_spi_cs","is_configured_for_uart_tx","is_configured_for_uart_rx","supports_i2c_sda","supports_i2c_scl","supports_spi_mosi","supports_spi_miso","supports_spi_sck","supports_spi_cs","supports_uart_tx","supports_uart_rx"];function $Mo(e){return KMo.some((t)=>e[t]!==void 0)}function a7t(e){let t=[],n=Ps(e),o=n.source_component.list(),r=n.source_port.list(),i=new Map;for(let s of r){if(!s.source_component_id)continue;let a=i.get(s.source_component_id)??[];a.push(s),i.set(s.source_component_id,a)}for(let s of o){if(s.ftype!=="simple_chip")continue;let a=i.get(s.source_component_id)??[];if(a.length===0)continue;if(a.some((l)=>$Mo(l)))continue;t.push({type:"source_component_pins_underspecified_warning",source_component_pins_underspecified_warning_id:`source_component_pins_underspecified_warning_${s.source_component_id}`,warning_type:"source_component_pins_underspecified_warning",message:`All pins on ${s.name} are underspecified (no pinAttributes set)`,source_component_id:s.source_component_id,source_port_ids:a.map((l)=>l.source_port_id),subcircuit_id:a[0]?.subcircuit_id})}return t}var c7t=(e,t)=>e.ftype==="simple_chip"&&t.filter((n)=>n.do_not_connect!==!0).length>=2;function l7t(e){let t=[],n=Ps(e),o=n.source_component.list(),r=n.source_port.list(),i=new Map;for(let s of r){if(!s.source_component_id)continue;let a=i.get(s.source_component_id)??[];a.push(s),i.set(s.source_component_id,a)}for(let s of o){let a=i.get(s.source_component_id)??[];if(!c7t(s,a))continue;if(a.some((l)=>l.requires_power===!0))continue;t.push({type:"source_no_power_pin_defined_warning",source_no_power_pin_defined_warning_id:`source_no_power_pin_defined_warning_${s.source_component_id}`,warning_type:"source_no_power_pin_defined_warning",message:`${s.name} has no pin with requires_power=true`,source_component_id:s.source_component_id,source_port_ids:a.map((l)=>l.source_port_id),subcircuit_id:a[0]?.subcircuit_id})}return t}function h7t(e){let t=[],n=Ps(e),o=n.source_component.list(),r=n.source_port.list(),i=new Map;for(let s of r){if(!s.source_component_id)continue;let a=i.get(s.source_component_id)??[];a.push(s),i.set(s.source_component_id,a)}for(let s of o){let a=i.get(s.source_component_id)??[];if(!c7t(s,a))continue;if(a.some((l)=>l.requires_ground===!0))continue;t.push({type:"source_no_ground_pin_defined_warning",source_no_ground_pin_defined_warning_id:`source_no_ground_pin_defined_warning_${s.source_component_id}`,warning_type:"source_no_ground_pin_defined_warning",message:`${s.name} has no pin with requires_ground=true`,source_component_id:s.source_component_id,source_port_ids:a.map((l)=>l.source_port_id),subcircuit_id:a[0]?.subcircuit_id})}return t}var qMo=0.2,A8t=3,JMo=0.000000001;function ZMo(e){let t=e.filter((i)=>i.type==="schematic_component"),n=e.filter((i)=>i.type==="schematic_port"),o=new Map;for(let i of n){if(!i.schematic_component_id)continue;let s=o.get(i.schematic_component_id)??[];s.push(i),o.set(i.schematic_component_id,s)}let r=[];for(let i of t){if(!i.is_box_with_pins||i.size.height<=0)continue;let s=(o.get(i.schematic_component_id)??[]).filter((A)=>A.side_of_component==="left"||A.side_of_component==="right");if(s.length<2)continue;let a=s.map((A)=>A.center.y),c=Math.max(...a),l=Math.min(...a),h=i.center.y+i.size.height/2,d=i.center.y-i.size.height/2,_=(i.pin_spacing??qMo)*A8t,p={top:h-c,bottom:l-d},m=Ks(e,i.schematic_component_id);for(let A of["top","bottom"]){let g=p[A];if(g<=_+JMo||g<=0)continue;let f=A==="top"?"above":"below",y=`excessive_${A}_padding`;r.push({type:"schematic_component_styling_warning",schematic_component_styling_warning_id:`schematic_component_styling_warning_${i.schematic_component_id}_${y}`,warning_type:"schematic_component_styling_warning",message:`${m} has excessive empty space ${f} its pins (${g.toFixed(2)}mm, more than ${A8t} pin spacings)`,schematic_component_id:i.schematic_component_id,styling_issue_type:y,schematic_port_ids:s.map((x)=>x.schematic_port_id),source_component_id:i.source_component_id,schematic_sheet_id:i.schematic_sheet_id,subcircuit_id:i.subcircuit_id})}}return r}var ewo=(e)=>/^unnamed_[a-z0-9_-]+\d+$/i.test(e),two=(e,t)=>{let{center:n,size:o}=t,r=0.000000001;return e.position.x>=n.x-o.width/2-0.000000001&&e.position.x<=n.x+o.width/2+0.000000001&&e.position.y>=n.y-o.height/2-0.000000001&&e.position.y<=n.y+o.height/2+0.000000001};function nwo(e){let t=e.filter((c)=>c.type==="schematic_component"),n=e.filter((c)=>c.type==="source_component"),o=e.filter((c)=>c.type==="schematic_text"),r=new Map(n.map((c)=>[c.source_component_id,c])),i=new Map,s=[];for(let c of o){if(!c.schematic_component_id){if(c.schematic_symbol_id)s.push(c);continue}let l=i.get(c.schematic_component_id)??new Set;l.add(c.text.trim()),i.set(c.schematic_component_id,l)}let a=[];for(let c of t){if(c.symbol_name)continue;if(c.is_box_with_pins)continue;if(!c.source_component_id)continue;let l=r.get(c.source_component_id);if(!l)continue;let h=new Set([l.name,l.display_name].map((m)=>m?.trim()).filter((m)=>Boolean(m))),d=[...h].find((m)=>!ewo(m)),u=i.get(c.schematic_component_id),_=[...h].some((m)=>u?.has(m))||s.some((m)=>h.has(m.text.trim())&&two(m,c));if(d&&_)continue;let p=d??"Schematic component";a.push({type:"schematic_component_styling_warning",schematic_component_styling_warning_id:`schematic_component_styling_warning_${c.schematic_component_id}_missing_reference_designator_text`,warning_type:"schematic_component_styling_warning",message:`${p} is missing schematic reference designator text. For a custom symbol, add name="{REFDES}" inside the symbol.`,schematic_component_id:c.schematic_component_id,styling_issue_type:"missing_reference_designator_text",source_component_id:c.source_component_id,schematic_sheet_id:c.schematic_sheet_id,subcircuit_id:c.subcircuit_id})}return a}var Yj=0.000000001,owo=(e)=>e.display_pin_label??`pin ${e.pin_number}`;function rwo(e){let t=e.filter((i)=>i.type==="schematic_component"),n=e.filter((i)=>i.type==="schematic_port"),o=new Map;for(let i of n){if(!i.schematic_component_id)continue;let s=o.get(i.schematic_component_id)??[];s.push(i),o.set(i.schematic_component_id,s)}let r=[];for(let i of t){if(i.is_box_with_pins===!1||i.size.width<=0||i.size.height<=0)continue;let s=i.center.x-i.size.width/2,a=i.center.x+i.size.width/2,c=i.center.y-i.size.height/2,l=i.center.y+i.size.height/2,d=(o.get(i.schematic_component_id)??[]).filter((g)=>{if(g.side_of_component==="left"||g.side_of_component==="right")return g.center.y<c-Yj||g.center.y>l+Yj;if(g.side_of_component==="top"||g.side_of_component==="bottom")return g.center.x<s-Yj||g.center.x>a+Yj;return!1}).sort((g,f)=>{let y=g.side_of_component==="left"||g.side_of_component==="right",x=f.side_of_component==="left"||f.side_of_component==="right";if(y&&x)return f.center.y-g.center.y;if(!y&&!x)return g.center.x-f.center.x;return y?-1:1});if(d.length===0)continue;let u=Math.max(i.size.height,...d.filter((g)=>g.side_of_component==="left"||g.side_of_component==="right").map((g)=>2*Math.abs(g.center.y-i.center.y))),_=Math.max(i.size.width,...d.filter((g)=>g.side_of_component==="top"||g.side_of_component==="bottom").map((g)=>2*Math.abs(g.center.x-i.center.x))),p=[];if(u>i.size.height+Yj)p.push(`increase schHeight to at least ${u.toFixed(2)}mm`);if(_>i.size.width+Yj)p.push(`increase schWidth to at least ${_.toFixed(2)}mm`);let m=Ks(e,i.schematic_component_id),A=d.map(owo).join(", ");r.push({type:"schematic_component_styling_warning",schematic_component_styling_warning_id:`schematic_component_styling_warning_${i.schematic_component_id}_ports_outside_body`,warning_type:"schematic_component_styling_warning",message:`${m} has schematic pins outside its body (${A}); ${p.join(" and ")}`,schematic_component_id:i.schematic_component_id,styling_issue_type:"ports_outside_body",schematic_port_ids:d.map((g)=>g.schematic_port_id),source_component_id:i.source_component_id,schematic_sheet_id:i.schematic_sheet_id,subcircuit_id:i.subcircuit_id})}return r}var use=(e)=>{if(Number.isInteger(e))return String(e);return e.toFixed(3).replace(/\.0+$/,"").replace(/(\.\d*?)0+$/,"$1")},d7t=(e)=>{let t=use(e);return e>0?`+${t}`:t},iwo=(e)=>e.replaceAll("&","&amp;").replaceAll('"',"&quot;").replaceAll("<","&lt;").replaceAll(">","&gt;"),dn=(e,t,n,o)=>{if(n===void 0)return;let r=typeof n==="number"?o?.formatDelta?d7t(n):use(n):iwo(n);e.push(`${t}="${r}"`)};function u7t(e){let t=new Map,n=(r)=>{let i=t.get(r);if(i===void 0||i===r)return r;let s=n(i);return t.set(r,s),s},o=(r)=>{let i=r[0];if(!i)return;let s=n(i);for(let a of r.slice(1))t.set(n(a),s)};for(let r of e){if(r.type==="source_port"||r.type==="source_net"){let i=r.type==="source_port"?r.source_port_id:r.source_net_id;if(r.subcircuit_connectivity_map_key)o([i,`connectivity:${r.subcircuit_connectivity_map_key}`])}if(r.type==="source_trace")o([...r.connected_source_port_ids,...r.connected_source_net_ids,...r.subcircuit_connectivity_map_key?[`connectivity:${r.subcircuit_connectivity_map_key}`]:[]]);if(r.type==="source_component_internal_connection")o(r.source_port_ids);if(r.type==="source_component")for(let i of r.internally_connected_source_port_ids??[])o(i)}return n}var Zp=class{connected;components=new Map;portsByComponent=new Map;portsByNet=new Map;powerNets=new Set;groundNets=new Set;placements=new Map;schematicComponents=new Map;schematicPorts=new Map;constructor(e){this.connected=u7t(e.circuitJson);for(let t of e.componentPlacements)if(t.sourceComponentId)D2e(this.placements,t.sourceComponentId,t);for(let t of e.circuitJson){if(t.type==="source_component")this.components.set(t.source_component_id,t);if(t.type==="source_port"&&t.source_component_id)D2e(this.portsByComponent,t.source_component_id,t),D2e(this.portsByNet,this.connected(t.source_port_id),t);if(t.type==="source_net"){let n=this.connected(t.source_net_id);if(t.is_power||t.is_positive_voltage_source)this.powerNets.add(n);if(t.is_ground)this.groundNets.add(n)}if(t.type==="schematic_component")this.schematicComponents.set(t.schematic_component_id,t);if(t.type==="schematic_port"&&t.source_port_id)D2e(this.schematicPorts,t.source_port_id,t)}}placement(e){let t=this.placements.get(e);return t?.length===1?t[0]:void 0}port(e){let t=this.placement(e.source_component_id),n=this.schematicPorts.get(e.source_port_id)?.filter((o)=>o.schematic_component_id===t?.schematicComponentId);return n?.length===1?n[0]:void 0}namedPort(e,t){let n=this.portsByComponent.get(e)?.filter((o)=>o.name===t||o.port_hints?.includes(t));return n?.length===1?n[0]:void 0}twoTerminalNets(e){let t=this.portsByComponent.get(e);if(t?.length!==2)return;let n=this.connected(t[0].source_port_id),o=this.connected(t[1].source_port_id);if(n!==o)return[n,o]}isRail(e){return this.powerNets.has(e)||this.groundNets.has(e)}isDirectOpAmpFeedback(e){let t=this.twoTerminalNets(e);if(!t||t.some((n)=>this.isRail(n)))return!1;return t.some((n)=>(this.portsByNet.get(n)??[]).some((o)=>{let r=o.source_component_id;if(this.components.get(r)?.ftype!=="simple_op_amp")return!1;if(this.namedPort(r,"output")?.source_port_id!==o.source_port_id)return!1;return["inverting_input","non_inverting_input"].some((s)=>{let a=this.namedPort(r,s);if(!a)return!1;let c=this.connected(a.source_port_id);return c!==n&&t.includes(c)})}))}sameLocalScope(e,t){if(e.schematicSheetId!==t.schematicSheetId||e.subcircuitId!==t.subcircuitId)return!1;let n=this.schematicComponents.get(e.schematicComponentId??""),o=this.schematicComponents.get(t.schematicComponentId??"");if(!n||!o||n.schematic_group_id!==o.schematic_group_id)return!1;let r=this.components.get(e.sourceComponentId??""),i=this.components.get(t.sourceComponentId??"");return r?.source_group_id===i?.source_group_id&&r?.subcircuit_id===i?.subcircuit_id}};function D2e(e,t,n){let o=e.get(t);if(o)o.push(n);else e.set(t,[n])}var lFe=class extends po{constructor(e){super();this.params=e,this.index=new Zp(e.ctx);for(let t of e.ctx.circuitJson){if(t.type==="pcb_component"&&t.do_not_place)this.unpopulated.add(t.source_component_id);if(t.type==="source_port"){let n=this.index.connected(t.source_port_id);if(t.requires_ground||t.provides_ground)this.index.groundNets.add(n);if(t.requires_power||t.provides_power)this.index.powerNets.add(n)}}this.nets=[...this.index.portsByNet.keys()],this.solved=this.nets.length===0}params;index;nets;unpopulated=new Set;currentIndex=0;_step(){let e=this.nets[this.currentIndex++];if(this.solved=this.currentIndex>=this.nets.length,!e||this.index.isRail(e))return;let t=this.index,n=t.portsByNet.get(e);if(n.length!==3||new Set(n.map((b)=>b.source_component_id)).size!==3)return;let o=n.map((b)=>this.localPart(b.source_component_id));if(o.some((b)=>!b))return;let r=o.filter((b)=>b.component.ftype==="simple_diode"),i=o.filter((b)=>b.component.ftype==="simple_capacitor");if(r.length!==2||i.length!==1)return;let s=i[0],a=r[0],c=r[1];if(![a,c].every((b)=>t.sameLocalScope(s.placement,b.placement)))return;let l=(b)=>b.nets.find((I)=>I!==e),h=[l(a),l(c)],d=h.filter((b)=>t.groundNets.has(b));if(d.length!==1)return;let u=d[0],_=h.find((b)=>b!==u),p=l(s);if(p===_||p===u||t.isRail(p))return;let A=[...new Set((t.portsByNet.get(_)??[]).filter((b)=>t.components.get(b.source_component_id)?.ftype==="simple_capacitor").map((b)=>b.source_component_id))].filter((b)=>t.twoTerminalNets(b)?.includes(u));if(!A.length||A.some((b)=>{let I=this.localPart(b);return!I||!t.sameLocalScope(s.placement,I.placement)}))return;let g=[s.placement,a.placement,c.placement],f=n.map((b)=>t.port(b)),y=Math.max(...f.flatMap((b,I)=>f.slice(I+1).map((v)=>Math.hypot(b.center.x-v.center.x,b.center.y-v.center.y)))),x=Math.max(4,...g.map((b)=>3*Math.max(b.width,b.height)));if(y<=x)return;let C=g.map((b)=>b.sourceComponentName||"component");this.params.issues.push({lineItemType:"DiodeCapacitorJunctionTooSpreadOut",capacitorSchematicBox:s.placement,diodeSchematicBoxes:[a.placement,c.placement],maxJunctionPinDistance:y,maxRecommendedJunctionPinDistance:x,message:`Bring ${C.join(", ")} closer together so their shared junction can be read as one local diode-capacitor stage. Preserve pin connections, leave room for labels, and reroute affected traces.`})}localPart(e){let t=this.index.components.get(e),n=this.index.placement(e),o=this.index.portsByComponent.get(e),r=this.index.twoTerminalNets(e);if(!t||!n||!r||this.unpopulated.has(e)||o?.length!==2||![n.width,n.height].every((i)=>Number.isFinite(i)&&i>0)||t.ftype==="simple_capacitor"&&(!Number.isFinite(t.capacitance)||t.capacitance<=0)||o.some((i)=>{let s=this.index.port(i);return i.do_not_connect||!s||s.schematic_sheet_id!==n.schematicSheetId||!Number.isFinite(s.center.x)||!Number.isFinite(s.center.y)}))return;return{component:t,placement:n,ports:o,nets:r}}static issueToString(e){let t=[];return dn(t,"capacitorName",e.capacitorSchematicBox.sourceComponentName),dn(t,"diodeNames",e.diodeSchematicBoxes.map((n)=>n.sourceComponentName).join(",")),dn(t,"maxJunctionPinDistance",e.maxJunctionPinDistance),dn(t,"maxRecommendedJunctionPinDistance",e.maxRecommendedJunctionPinDistance),dn(t,"message",e.message),`<DiodeCapacitorJunctionTooSpreadOut ${t.join(" ")} />`}},hFe=class extends po{constructor(e){super();this.params=e,this.index=new Zp(e.ctx),this.ledIds=new Set([...this.index.components.values()].filter((t)=>t.ftype==="simple_led").map((t)=>t.source_component_id));for(let t of e.ctx.circuitJson)if(t.type==="pcb_component"&&t.do_not_place)this.unpopulated.add(t.source_component_id);this.solved=this.ledIds.size===0}params;index;ledIds;visited=new Set;unpopulated=new Set;_step(){let e=[...this.ledIds].find((l)=>!this.visited.has(l));if(!e){this.solved=!0;return}let t=[e];this.visited.add(e);let n=new Map;for(let l=0;l<t.length;l++){let h=t[l],d=new Set;for(let u of this.index.portsByComponent.get(h)??[])for(let _ of this.index.portsByNet.get(this.index.connected(u.source_port_id))??[]){let p=_.source_component_id;if(p===h||!this.ledIds.has(p))continue;if(d.add(p),!this.visited.has(p))this.visited.add(p),t.push(p)}n.set(h,d)}if(this.solved=this.visited.size===this.ledIds.size,t.length<3)return;let o=t.filter((l)=>n.get(l).size===1);if(o.length!==2||t.some((l)=>n.get(l).size>2))return;let r=[o.sort()[0]];while(r.length<t.length){let l=r.at(-1),h=r.at(-2),d=[...n.get(l)].find((u)=>u!==h);if(!d||r.includes(d))return;r.push(d)}let i=r.map((l)=>this.index.placement(l));if(i.some((l)=>!l))return;let s=i.filter((l)=>l!==void 0);if(s.some((l)=>!this.index.sameLocalScope(s[0],l)||![l.schX,l.schY,l.width,l.height].every(Number.isFinite)||l.width<=0||l.height<=0))return;for(let l of r){let h=this.index.portsByComponent.get(l)??[];if(this.unpopulated.has(l)||!this.index.twoTerminalNets(l)||h.some((u)=>u.do_not_connect))return;let d=this.index.placement(l);for(let u of h){let _=this.index.port(u);if(!_||_.schematic_sheet_id!==d.schematicSheetId||!Number.isFinite(_.center.x)||!Number.isFinite(_.center.y)||!_.facing_direction)return}}let a=[];for(let l=1;l<r.length;l++){let h=r[l-1],d=r[l],u=this.index.twoTerminalNets(h),_=this.index.twoTerminalNets(d).filter((I)=>u.includes(I));if(_.length!==1||this.index.isRail(_[0]))return;let p=this.index.portsByNet.get(_[0])??[];if(p.length!==2)return;let m=p.find((I)=>I.source_component_id===h),A=p.find((I)=>I.source_component_id===d),g=this.index.port(m),f=this.index.port(A),y=f.center.x-g.center.x,x=f.center.y-g.center.y,C=Math.hypot(y,x),b=Math.max(s[l-1].width,s[l-1].height,s[l].width,s[l].height);if(C>Math.max(4,3*b)&&(f8t(g,y,x)<-b||f8t(f,-y,-x)<-b))a.push({firstSourcePortId:m.source_port_id,secondSourcePortId:A.source_port_id,pinDistance:C})}if(!a.length)return;let c=s.map((l)=>l.sourceComponentName||"LED").join(", ");this.params.issues.push({lineItemType:"SeriesLedChainNotOrdered",ledSchematicBoxes:s,backtrackingConnections:a,message:`Arrange ${c} in their connected series order so adjacent LEDs do not require long connections behind their pins. Move or rotate the symbols while preserving anode/cathode connections; allow space for labels and reroute affected traces. A horizontal, vertical, or clearly connected folded chain is acceptable.`})}static issueToString(e){let t=[];return dn(t,"ledComponents",e.ledSchematicBoxes.map((n)=>n.sourceComponentName).join(",")),dn(t,"backtrackingConnections",e.backtrackingConnections.length),dn(t,"maxPinDistance",Math.max(...e.backtrackingConnections.map((n)=>n.pinDistance))),dn(t,"message",e.message),`<SeriesLedChainNotOrdered ${t.join(" ")} />`}};function f8t(e,t,n){switch(e.facing_direction){case"left":return-t;case"right":return t;case"up":return n;case"down":return-n;default:return 0}}var dFe=class extends po{constructor(e){super();this.params=e,this.index=new Zp(e.ctx);for(let t of e.ctx.circuitJson){if(t.type==="pcb_component"&&t.do_not_place)this.unpopulated.add(t.source_component_id);if(t.type==="source_port"){let n=this.index.connected(t.source_port_id);if(t.requires_ground||t.provides_ground)this.index.groundNets.add(n);if(t.requires_power||t.provides_power||t.requires_voltage!==void 0||t.provides_voltage!==void 0)this.index.powerNets.add(n)}}this.resistorIds=[...this.index.components.values()].filter((t)=>t.ftype==="simple_resistor").map((t)=>t.source_component_id),this.solved=this.resistorIds.length===0}params;index;resistorIds;unpopulated=new Set;currentIndex=0;_step(){let e=this.resistorIds[this.currentIndex++];this.solved=this.currentIndex>=this.resistorIds.length;let t=this.index,n=t.components.get(e),o=t.twoTerminalNets(e);if(n?.ftype!=="simple_resistor"||!Number.isFinite(n.resistance)||n.resistance<=0||!o)return;let r=o.filter((b)=>t.groundNets.has(b)&&!t.powerNets.has(b));if(r.length!==1)return;let i=r[0],s=o.find((b)=>b!==i);if(t.isRail(s))return;let a=t.portsByNet.get(s)??[];if(a.length!==3||a.some((b)=>b.do_not_connect))return;let c=a.find((b)=>t.components.get(b.source_component_id)?.ftype==="simple_capacitor"),l=a.find((b)=>t.components.get(b.source_component_id)?.ftype==="simple_chip");if(!c||!l)return;let h=c.source_component_id,d=t.components.get(h);if(d?.ftype!=="simple_capacitor"||!Number.isFinite(d.capacitance)||d.capacitance<=0||!t.twoTerminalNets(h)?.includes(i))return;let u=l.source_component_id;if((t.portsByComponent.get(u)?.length??0)<3)return;let _=t.placement(e),p=t.placement(h),m=t.placement(u);if(!_||!p||!m||[e,h,u].some((b)=>this.unpopulated.has(b)))return;if([_,p].some((b)=>b.schematicSheetId!==m.schematicSheetId||b.subcircuitId!==m.subcircuitId))return;if([_,p,m].some((b)=>![b.schX,b.schY,b.width,b.height].every(Number.isFinite)||b.width<=0||b.height<=0))return;let A=t.port(l);if(!A||A.schematic_sheet_id!==m.schematicSheetId)return;let g=this.pins(e,s,i,_),f=this.pins(h,s,i,p);if(!g||!f)return;let y=y8t(...g),x=y8t(...f);if(!y||!x)return;if(Math.abs(_.schX-p.schX)<(_.width+p.width)/2&&Math.abs(_.schY-p.schY)<(_.height+p.height)/2)return;let C;if(y!==x)C="different_axes";else{let b=y==="horizontal"?"x":"y",I=g.map((P)=>P.center[b]),v=f.map((P)=>P.center[b]);if((I[1]-I[0])*(v[1]-v[0])<0)C="crossed_connections";else{if(Math.min(Math.max(...I),Math.max(...v))-Math.max(Math.min(...I),Math.min(...v))>0.01)return;C="staggered"}}this.params.issues.push({lineItemType:"ParallelRcNotAligned",resistorSchematicBox:_,capacitorSchematicBox:p,chipSourcePortId:l.source_port_id,reason:C,message:`Draw ${_.sourceComponentName||"the resistor"} and ${p.sourceComponentName||"the capacitor"} as adjacent parallel branches with their shared nets at matching ends. Preserve all pin connections and capacitor polarity, leave room for labels, and reroute affected wires.`})}pins(e,t,n,o){let r=this.index.portsByComponent.get(e)??[];if(r.length!==2||r.some((c)=>c.do_not_connect))return;let i=[t,n].map((c)=>{let l=r.find((h)=>this.index.connected(h.source_port_id)===c);return l&&this.index.port(l)}),[s,a]=i;if(!s||!a||i.some((c)=>c.schematic_sheet_id!==o.schematicSheetId||!Number.isFinite(c.center.x)||!Number.isFinite(c.center.y)))return;return[s,a]}static issueToString(e){let t=[];return dn(t,"resistorComponentName",e.resistorSchematicBox.sourceComponentName),dn(t,"capacitorComponentName",e.capacitorSchematicBox.sourceComponentName),dn(t,"reason",e.reason),dn(t,"message",e.message),`<ParallelRcNotAligned ${t.join(" ")} />`}};function y8t(e,t){let n=new Set([e.facing_direction,t.facing_direction]);if(n.has("left")&&n.has("right")&&Math.abs(e.center.y-t.center.y)<0.01&&Math.abs(e.center.x-t.center.x)>0.01)return"horizontal";if(n.has("up")&&n.has("down")&&Math.abs(e.center.x-t.center.x)<0.01&&Math.abs(e.center.y-t.center.y)>0.01)return"vertical"}var uFe=class extends po{constructor(e){super();this.params=e,this.index=new Zp(e.ctx);for(let t of e.ctx.circuitJson)if(t.type==="pcb_component"&&t.do_not_place)this.unpopulated.add(t.source_component_id);this.resistorIds=[...this.index.components.values()].filter((t)=>t.ftype==="simple_resistor").map((t)=>t.source_component_id),this.solved=this.resistorIds.length===0}params;index;resistorIds;unpopulated=new Set;currentIndex=0;_step(){let e=this.resistorIds[this.currentIndex++];if(this.solved=this.currentIndex>=this.resistorIds.length,!e||this.unpopulated.has(e))return;let t=this.index,n=t.components.get(e),o=t.placement(e),r=t.twoTerminalNets(e),i=t.portsByComponent.get(e)??[];if(n?.ftype!=="simple_resistor"||!Number.isFinite(n.resistance)||n.resistance<=0||!o||!r||i.some((b)=>b.do_not_connect))return;let s=r.filter((b)=>t.groundNets.has(b)&&!t.powerNets.has(b));if(s.length!==1)return;let a=r.find((b)=>b!==s[0]);if(t.isRail(a))return;let c=t.portsByNet.get(a)??[];if(c.length!==2)return;let l=c.find((b)=>b.source_component_id!==e),h=c.find((b)=>b.source_component_id===e);if(!l||!h||l.do_not_connect||swo(l))return;let d=l.source_component_id,u=t.placement(d);if(t.components.get(d)?.ftype!=="simple_chip"||(t.portsByComponent.get(d)?.length??0)<3||this.unpopulated.has(d)||!u||!t.sameLocalScope(u,o))return;let _=t.port(l),p=t.port(h);if(!_||!p||[_,p].some((b)=>b.schematic_sheet_id!==u.schematicSheetId||!Number.isFinite(b.center.x)||!Number.isFinite(b.center.y))||[u,o].some((b)=>![b.schX,b.schY,b.width,b.height].every(Number.isFinite)||b.width<=0||b.height<=0))return;let m=_.facing_direction;if(!m)return;let A=m==="left"||m==="right",f=-(m==="left"||m==="down"?-1:1)*(A?o.schX-u.schX:o.schY-u.schY),y=A?(u.width+o.width)/2:(u.height+o.height)/2;if(f<=y+0.2)return;let x=Math.hypot(_.center.x-p.center.x,_.center.y-p.center.y),C=Math.max(4,3*Math.max(o.width,o.height));if(x<=C)return;this.params.issues.push({lineItemType:"ResistorSeparatedFromChipPin",hostSchematicBox:u,resistorSchematicBox:o,chipSourcePortId:l.source_port_id,resistorSourcePortId:h.source_port_id,pinDistance:x,maxRecommendedPinDistance:C,message:`Place ${o.sourceComponentName||"resistor"} beside its connected pin on the ${m} side of ${u.sourceComponentName||"chip"} so the resistor-to-ground branch can be read together. Preserve pin connections, leave room for labels, and reroute affected traces; exact alignment is not required.`})}static issueToString(e){let t=[];return dn(t,"hostComponentName",e.hostSchematicBox.sourceComponentName),dn(t,"resistorName",e.resistorSchematicBox.sourceComponentName),dn(t,"pinDistance",e.pinDistance),dn(t,"maxRecommendedPinDistance",e.maxRecommendedPinDistance),dn(t,"message",e.message),`<ResistorSeparatedFromChipPin ${t.join(" ")} />`}};function swo(e){return Boolean(e.requires_power||e.provides_power||e.requires_ground||e.provides_ground||e.requires_voltage!==void 0||e.provides_voltage!==void 0)}var pFe=class extends po{constructor(e){super();this.params=e;let t=new Zp(e.ctx),n=new Map;for(let o of t.components.values()){let r=o.ftype==="simple_diode"||o.ftype==="simple_led";if(!r&&o.ftype!=="simple_resistor")continue;let i=o.source_component_id,s=t.placement(i),a=t.twoTerminalNets(i)?.sort(),c=t.portsByComponent.get(i);if(!s||!a||!c)continue;let l=a.map((A)=>{let g=c.find((f)=>t.connected(f.source_port_id)===A);return g&&t.port(g)}),[h,d]=l,u={diode:r,box:s};if(h&&d&&!c.some((A)=>A.do_not_connect)&&l.every((A)=>A?.schematic_sheet_id===s.schematicSheetId))u.pins=[h,d],u.axis=awo(h,d);let _=JSON.stringify(a),p=n.get(_)??[],m=p.find((A)=>t.sameLocalScope(A[0].box,s));if(m)m.push(u);else{let A=[u];p.push(A),this.banks.push(A)}n.set(_,p)}this.solved=this.banks.length===0}params;banks=[];bankIndex=0;_step(){let e=this.banks[this.bankIndex++];if(this.solved=this.bankIndex>=this.banks.length,e.length!==2)return;let t=e.find((s)=>s.diode),n=e.find((s)=>!s.diode);if(!t?.pins||!t.axis||!n?.pins||!n.axis)return;let o=t.box,r=n.box;if(Math.abs(o.schX-r.schX)<(o.width+r.width)/2&&Math.abs(o.schY-r.schY)<(o.height+r.height)/2)return;let i;if(t.axis!==n.axis)i="different_axes";else{let s=t.axis==="horizontal"?"x":"y",a=t.pins.map((l)=>l.center[s]),c=n.pins.map((l)=>l.center[s]);if((a[1]-a[0])*(c[1]-c[0])<0)i="crossed_connections";else{if(Math.min(Math.max(...a),Math.max(...c))-Math.max(Math.min(...a),Math.min(...c))>0.01)return;i="staggered"}}this.params.issues.push({lineItemType:"ParallelDiodeResistorNotAligned",diodeSchematicBox:o,resistorSchematicBox:r,reason:i,message:`Draw ${o.sourceComponentName||"the diode"} and ${r.sourceComponentName||"the resistor"} as adjacent parallel rows or columns with their shared nets at matching ends. Preserve every pin connection and diode polarity, leave room for labels, and reroute the affected wires.`})}static issueToString(e){let t=[];return dn(t,"diodeComponentName",e.diodeSchematicBox.sourceComponentName),dn(t,"resistorComponentName",e.resistorSchematicBox.sourceComponentName),dn(t,"reason",e.reason),dn(t,"message",e.message),`<ParallelDiodeResistorNotAligned ${t.join(" ")} />`}};function awo(e,t){let n=new Set([e.facing_direction,t.facing_direction]);if(n.has("left")&&n.has("right")&&Math.abs(e.center.y-t.center.y)<0.01&&Math.abs(e.center.x-t.center.x)>0.01)return"horizontal";if(n.has("up")&&n.has("down")&&Math.abs(e.center.x-t.center.x)<0.01&&Math.abs(e.center.y-t.center.y)>0.01)return"vertical"}var jj=(e,t)=>Math.hypot(e.x-t.x,e.y-t.y),OR=0.001,mFe=class extends po{index;nodes=new Map;starts=[];currentIndex=0;issues;maxSpan;maxLength;constructor({ctx:e,issues:t,maxSpan:n=8,maxLength:o=16}){super();if(this.index=new Zp(e),this.issues=t,!Number.isFinite(n)||n<0||!Number.isFinite(o)||o<0)throw Error("Rail visibility thresholds must be finite and nonnegative");this.maxSpan=n,this.maxLength=o;let r=this.index,i=(l,h,d)=>{let u=JSON.stringify([d,h,Math.round(l.x/OR),Math.round(l.y/OR)]);if(!this.nodes.has(u))this.nodes.set(u,{point:l,net:h,sheet:d,links:[]});return u},s=(l,h,d)=>{let u=this.nodes.get(l),_=this.nodes.get(h),p=jj(u.point,_.point);u.links.push({to:h,length:p,...d}),_.links.push({to:l,length:p,...d})},a=new Map;for(let[l,h]of r.portsByComponent)for(let d of h){let u=r.port(d);if(!u)continue;let _=i(u.center,r.connected(d.source_port_id),u.schematic_sheet_id);if(a.set(d.source_port_id,_),h.length>2)this.starts.push({portId:d.source_port_id,componentId:l,nodeId:_})}for(let l of e.circuitJson){if(l.type!=="schematic_net_label"||!l.source_net_id||!l.anchor_position)continue;let h=r.connected(l.source_net_id);if(!r.isRail(h)||r.powerNets.has(h)&&r.groundNets.has(h))continue;let d=i(l.anchor_position,h,l.schematic_sheet_id);this.nodes.get(d).terminal=r.groundNets.has(h)?"ground":"power"}let c=[];for(let l of e.circuitJson){if(l.type!=="schematic_trace")continue;let h=cwo(l,e.circuitJson,r);if(!h)continue;for(let d of l.edges)c.push({from:i(d.from,h,l.schematic_sheet_id),to:i(d.to,h,l.schematic_sheet_id),traceId:l.schematic_trace_id})}for(let l of c){let h=this.nodes.get(l.from),d=this.nodes.get(l.to);if(jj(h.point,d.point)<OR)continue;let _=[...this.nodes].filter(([,p])=>p.net===h.net&&p.sheet===h.sheet&&lwo(p.point,h.point,d.point)).sort(([,p],[,m])=>jj(h.point,p.point)-jj(h.point,m.point));for(let p=1;p<_.length;p++)s(_[p-1][0],_[p][0],{traceId:l.traceId})}for(let[l,h]of r.components){if(!["simple_resistor","simple_capacitor","simple_inductor"].includes(h.ftype))continue;let d=r.portsByComponent.get(l);if(d?.length!==2||!r.twoTerminalNets(l))continue;let u=a.get(d[0].source_port_id),_=a.get(d[1].source_port_id);if(u&&_)s(u,_,{componentId:l})}this.solved=this.starts.length===0}_step(){let e=this.starts[this.currentIndex++];if(this.solved=this.currentIndex>=this.starts.length,!e)return;let t=this.index.portsByComponent.get(e.componentId)?.find((a)=>a.source_port_id===e.portId),n=t?this.index.port(t):void 0,o=n?.display_pin_label||t?.name||(n?.pin_number!==void 0?`pin${n.pin_number}`:"connected pin"),r=this.index.placement(e.componentId);if(!r)return;let i=[{id:e.nodeId,length:0,hops:0,path:[e.nodeId],links:[]}],s=new Map([[`${e.nodeId}:0`,0]]);while(i.length){i.sort((h,d)=>h.length-d.length);let a=i.shift(),c=`${a.id}:${a.hops}`;if(a.length!==s.get(c))continue;let l=this.nodes.get(a.id);if(l.terminal){let h=a.path.map((A)=>this.nodes.get(A).point),d=h.map((A)=>A.x),u=h.map((A)=>A.y),_={left:Math.min(...d),right:Math.max(...d),bottom:Math.min(...u),top:Math.max(...u)},p=Math.max(_.right-_.left,_.top-_.bottom);if(p<=this.maxSpan&&a.length<=this.maxLength)return;let m=[...new Set(a.links.flatMap((A)=>A.componentId?[A.componentId]:[]))];this.issues.push({lineItemType:"RailPathTooSpreadOut",hostSchematicBox:r,sourcePortId:e.portId,sourcePortName:o,railType:l.terminal,supportSchematicBoxes:m.flatMap((A)=>{let g=this.index.placement(A);return g?[g]:[]}),schematicTraceIds:[...new Set(a.links.flatMap((A)=>A.traceId?[A.traceId]:[]))],pathPoints:h,pathBounds:_,pathLength:a.length,pathSpan:p,maxRecommendedSpan:this.maxSpan,maxRecommendedPathLength:this.maxLength,message:`Visible path from ${r.sourceComponentName||"component"}.${o} to ${l.terminal} spans ${p.toFixed(2)} schematic units; move the connected support elements closer together near the pin and recompute their schematic traces.`});return}for(let h of l.links){if(a.path.includes(h.to))continue;if(h.componentId){let p=this.index.placement(h.componentId);if(a.hops>=3||!p||!this.index.sameLocalScope(r,p))continue}let d=a.length+h.length,u=a.hops+(h.componentId?1:0),_=`${h.to}:${u}`;if(d>=(s.get(_)??1/0))continue;s.set(_,d),i.push({id:h.to,length:d,hops:u,path:[...a.path,h.to],links:[...a.links,h]})}}}static issueToString(e){let t=[];return dn(t,"hostName",e.hostSchematicBox.sourceComponentName),dn(t,"pinName",e.sourcePortName),dn(t,"railType",e.railType),dn(t,"pathSpan",e.pathSpan),dn(t,"pathLength",e.pathLength),dn(t,"message",e.message),`<RailPathTooSpreadOut ${t.join(" ")} />`}};function cwo(e,t,n){if(e.subcircuit_connectivity_map_key)return n.connected(`connectivity:${e.subcircuit_connectivity_map_key}`);let o=t.find((i)=>i.type==="source_trace"&&i.source_trace_id===e.source_trace_id);if(o?.type!=="source_trace")return;let r=[...o.connected_source_port_ids,...o.connected_source_net_ids];return r[0]?n.connected(r[0]):void 0}function lwo(e,t,n){let o=n.x-t.x,r=n.y-t.y,i=jj(t,n);if(i<OR)return jj(t,e)<OR;let s=((e.x-t.x)*o+(e.y-t.y)*r)/i;return Math.abs((e.x-t.x)*r-(e.y-t.y)*o)/i<OR&&s>=-OR&&s<=i+OR}var _Fe=class extends po{constructor(e){super();this.params=e,this.index=new Zp(e.ctx);for(let t of e.ctx.circuitJson)if(t.type==="pcb_component"&&t.do_not_place)this.unpopulated.add(t.source_component_id);this.capacitorIds=[...this.index.components.values()].filter((t)=>t.ftype==="simple_capacitor").map((t)=>t.source_component_id),this.solved=this.capacitorIds.length===0}params;index;capacitorIds;unpopulated=new Set;currentIndex=0;_step(){let e=this.capacitorIds[this.currentIndex++];if(this.solved=this.currentIndex>=this.capacitorIds.length,!e||this.unpopulated.has(e))return;let t=this.index,n=t.components.get(e),o=t.placement(e),r=t.portsByComponent.get(e)??[],i=t.twoTerminalNets(e);if(n?.ftype!=="simple_capacitor"||!Number.isFinite(n.capacitance)||n.capacitance<=0||!o||!i||i.some((v)=>t.isRail(v))||r.some((v)=>v.do_not_connect||HHe(v)))return;let s=i.map((v)=>{let P=t.portsByNet.get(v)??[];if(P.length!==2)return;return P.find((M)=>M.source_component_id!==e)}),[a,c]=s;if(!a||!c||a.source_component_id!==c.source_component_id||a.do_not_connect||c.do_not_connect||HHe(a)||HHe(c))return;let l=a.source_component_id,h=t.placement(l);if(t.components.get(l)?.ftype!=="simple_chip"||this.unpopulated.has(l)||!h||!t.sameLocalScope(h,o))return;let d=[a,c],u=d.map((v)=>t.port(v)),_=r.map((v)=>t.port(v));if([...u,..._].some((v)=>!v||v.schematic_sheet_id!==h.schematicSheetId||!Number.isFinite(v.center.x)||!Number.isFinite(v.center.y))||[h,o].some((v)=>![v.schX,v.schY,v.width,v.height].every(Number.isFinite)||v.width<=0||v.height<=0))return;let p=u[0],m=u[1],A=p.facing_direction;if(!A||A!==m.facing_direction)return;let g=A==="left"||A==="right",f=A==="left"||A==="down"?-1:1,y=Math.hypot(p.center.x-m.center.x,p.center.y-m.center.y);if(y<0.01)return;let x=-f*(g?o.schX-h.schX:o.schY-h.schY),C=g?(h.width+o.width)/2:(h.height+o.height)/2;if(x<=C+0.2)return;let b=Math.max(...u.map((v,P)=>Math.hypot(v.center.x-_[P].center.x,v.center.y-_[P].center.y))),I=Math.max(4,3*Math.max(o.width,o.height),2*y);if(b<=I)return;this.params.issues.push({lineItemType:"CapacitorSeparatedFromChipPins",hostSchematicBox:h,capacitorSchematicBox:o,chipSourcePortIds:[d[0].source_port_id,d[1].source_port_id],maxPinDistance:b,maxRecommendedPinDistance:I,message:`Place ${o.sourceComponentName||"component"} beside its two connected pins on the ${A} side of ${h.sourceComponentName||"component"} so their connections can be read together. Preserve pin connections, leave room for labels, and reroute affected traces; exact alignment is not required.`})}static issueToString(e){let t=[];return dn(t,"hostComponentName",e.hostSchematicBox.sourceComponentName),dn(t,"capacitorName",e.capacitorSchematicBox.sourceComponentName),dn(t,"maxPinDistance",e.maxPinDistance),dn(t,"maxRecommendedPinDistance",e.maxRecommendedPinDistance),dn(t,"message",e.message),`<CapacitorSeparatedFromChipPins ${t.join(" ")} />`}};function HHe(e){return Boolean(e.requires_power||e.provides_power||e.requires_ground||e.provides_ground||e.requires_voltage!==void 0||e.provides_voltage!==void 0)}var gFe=class extends po{constructor(e){super();this.params=e,this.index=new Zp(e.ctx);for(let t of e.ctx.circuitJson)if(t.type==="pcb_component"&&t.do_not_place)this.unpopulated.add(t.source_component_id);for(let t of e.ctx.circuitJson)if(t.type==="pcb_component"&&!t.do_not_place)this.unpopulated.delete(t.source_component_id);this.inductorIds=[...this.index.components.values()].filter((t)=>t.ftype==="simple_inductor"&&!this.unpopulated.has(t.source_component_id)).map((t)=>t.source_component_id),this.solved=this.inductorIds.length===0}params;index;inductorIds;unpopulated=new Set;currentIndex=0;_step(){let e=this.inductorIds[this.currentIndex++];if(this.solved=this.currentIndex>=this.inductorIds.length,!e)return;let t=this.index,n=this.localPart(e),o=t.twoTerminalNets(e);if(!n||!o||o.some((d)=>t.isRail(d)))return;let r=o.map((d)=>{let u=t.portsByNet.get(d)??[];if(u.some((y)=>y.source_component_id!==e&&!this.unpopulated.has(y.source_component_id)&&t.components.get(y.source_component_id)?.ftype==="simple_inductor"))return;let _=u.filter((y)=>{let x=t.components.get(y.source_component_id),C=t.twoTerminalNets(y.source_component_id);return x?.ftype==="simple_capacitor"&&!this.unpopulated.has(y.source_component_id)&&C?.some((b)=>b!==d&&t.groundNets.has(b))});if(_.length!==1)return;let p=_[0],m=t.components.get(p.source_component_id);if(m.ftype!=="simple_capacitor"||!Number.isFinite(m.capacitance)||m.capacitance<=0)return;let A=this.localPart(p.source_component_id);if(!A||!t.sameLocalScope(n.placement,A.placement))return;let g=t.port(p),f=t.port(n.ports.find((y)=>t.connected(y.source_port_id)===d));return{placement:A.placement,ground:t.twoTerminalNets(p.source_component_id).find((y)=>y!==d),distance:Math.hypot(g.center.x-f.center.x,g.center.y-f.center.y)}}),[i,s]=r;if(!i||!s||i.ground!==s.ground)return;let a=[n.placement,i.placement,s.placement],c=Math.max(4,...a.map((d)=>3*Math.max(d.width,d.height))),l=Math.max(i.distance,s.distance);if(l<=c)return;let h=(d)=>d.sourceComponentName||"component";this.params.issues.push({lineItemType:"PiFilterComponentsNotGrouped",inductorSchematicBox:n.placement,firstCapacitorSchematicBox:i.placement,secondCapacitorSchematicBox:s.placement,maxSignalPinDistance:l,maxRecommendedSignalPinDistance:c,message:`Group ${h(i.placement)} and ${h(s.placement)} beside the connected ends of ${h(n.placement)} so the series path and both grounded branches of the pi filter can be read together. Preserve pin connections, allow room for labels, and reroute affected traces.`})}localPart(e){let t=this.index.placement(e),n=this.index.portsByComponent.get(e);if(!t||n?.length!==2||n.some((o)=>{let r=this.index.port(o);return o.do_not_connect||!r||r.schematic_sheet_id!==t.schematicSheetId||!Number.isFinite(r.center.x)||!Number.isFinite(r.center.y)}))return;return{placement:t,ports:n}}static issueToString(e){let t=[];return dn(t,"inductorName",e.inductorSchematicBox.sourceComponentName),dn(t,"firstCapacitorName",e.firstCapacitorSchematicBox.sourceComponentName),dn(t,"secondCapacitorName",e.secondCapacitorSchematicBox.sourceComponentName),dn(t,"maxSignalPinDistance",e.maxSignalPinDistance),dn(t,"maxRecommendedSignalPinDistance",e.maxRecommendedSignalPinDistance),dn(t,"message",e.message),`<PiFilterComponentsNotGrouped ${t.join(" ")} />`}},AFe=class extends po{constructor(e){super();this.params=e,this.index=new Zp(e.ctx),this.mosfetIds=[...this.index.components.keys()].filter((t)=>this.mosfetPorts(t)),this.solved=this.mosfetIds.length===0}params;index;mosfetIds;currentIndex=0;_step(){let e=this.mosfetIds[this.currentIndex++];if(this.solved=this.currentIndex>=this.mosfetIds.length,!e)return;let t=this.index,n=t.placement(e),o=this.mosfetPorts(e);if(!n)return;let r=t.connected(o.gate.source_port_id),i=t.connected(o.sources[0].source_port_id),s=t.connected(o.drains[0].source_port_id);if(new Set([r,i,s]).size!==3||t.isRail(r))return;if([o.gate,...o.sources,...o.drains].some((m)=>{let A=t.port(m);return!A||A.schematic_sheet_id!==n.schematicSheetId}))return;let a=(t.portsByNet.get(r)??[]).filter((m)=>m.source_component_id!==e);if(a.length!==2)return;let c=a.map((m)=>{let A=m.source_component_id,g=t.components.get(A),f=t.placement(A),y=t.twoTerminalNets(A);if(g?.ftype!=="simple_resistor"||!Number.isFinite(g.resistance)||g.resistance<=0||!f||!y||!t.sameLocalScope(n,f)||t.portsByComponent.get(A).some((x)=>{let C=t.port(x);return x.do_not_connect||!C||C.schematic_sheet_id!==n.schematicSheetId}))return;return{placement:f,otherNet:y.find((x)=>x!==r)}});if(c.some((m)=>!m))return;let l=c.filter((m)=>m.otherNet===i),h=c.filter((m)=>m.otherNet!==i);if(l.length!==1||h.length!==1)return;let d=l[0].placement,u=h[0].placement;if(h[0].otherNet===s||t.isRail(h[0].otherNet))return;let _=Math.max(6,3*Math.max(n.width,n.height)),p=Math.max(x8t(n,u),x8t(n,d));if(p<=_)return;this.params.issues.push({lineItemType:"MosfetGateNetworkNotGrouped",mosfetSchematicBox:n,seriesGateResistorSchematicBox:u,gateSourceResistorSchematicBox:d,maxBodyGap:p,maxRecommendedBodyGap:_,message:`Group ${u.sourceComponentName||"component"} and ${d.sourceComponentName||"component"} beside ${n.sourceComponentName||"component"}'s gate/source pins so the gate-drive branch can be read together. Preserve all pin connections, leave room for labels, and reroute affected traces.`})}mosfetPorts(e){let t=this.index.components.get(e)?.ftype;if(t!=="simple_mosfet"&&t!=="simple_chip")return;let n=this.index.portsByComponent.get(e)??[],o=n.filter((s)=>FHe(s,/^(G|GATE)$/)),r=n.filter((s)=>FHe(s,/^(S|SOURCE)[0-9]*$/)),i=n.filter((s)=>FHe(s,/^(D|DRAIN)[0-9]*$/));if(o.length!==1||!r.length||!i.length||o.length+r.length+i.length!==n.length||new Set([...o,...r,...i]).size!==n.length||n.some((s)=>s.do_not_connect))return;for(let s of[r,i])if(new Set(s.map((a)=>this.index.connected(a.source_port_id))).size!==1)return;return{gate:o[0],sources:r,drains:i}}static issueToString(e){let t=[];return dn(t,"mosfetName",e.mosfetSchematicBox.sourceComponentName),dn(t,"seriesGateResistorName",e.seriesGateResistorSchematicBox.sourceComponentName),dn(t,"gateSourceResistorName",e.gateSourceResistorSchematicBox.sourceComponentName),dn(t,"maxBodyGap",e.maxBodyGap),dn(t,"maxRecommendedBodyGap",e.maxRecommendedBodyGap),dn(t,"message",e.message),`<MosfetGateNetworkNotGrouped ${t.join(" ")} />`}};function FHe(e,t){return[e.name,...e.port_hints??[]].some((n)=>t.test(n.toUpperCase().replace(/[\s_]/g,"")))}function x8t(e,t){return Math.hypot(Math.max(0,Math.abs(e.schX-t.schX)-(e.width+t.width)/2),Math.max(0,Math.abs(e.schY-t.schY)-(e.height+t.height)/2))}var fFe=class extends po{constructor(e){super();this.params=e,this.index=new Zp(e.ctx),this.relayIds=[...this.index.components.keys()].filter((t)=>this.coilPorts(t)),this.solved=this.relayIds.length===0}params;index;relayIds;currentIndex=0;_step(){let e=this.relayIds[this.currentIndex++];if(this.solved=this.currentIndex>=this.relayIds.length,!e)return;let t=this.index,n=t.placement(e),o=this.coilPorts(e);if(!n||o.some((v)=>v.do_not_connect))return;let r=o.map((v)=>t.connected(v.source_port_id));if(r[0]===r[1])return;if(this.relayIds.some((v)=>v!==e&&this.coilPorts(v).every((P)=>r.includes(t.connected(P.source_port_id)))))return;let i=new Set((t.portsByNet.get(r[0])??[]).filter((v)=>t.components.get(v.source_component_id)?.ftype==="simple_diode").map((v)=>v.source_component_id).filter((v)=>t.twoTerminalNets(v)?.includes(r[1])));if(i.size!==1)return;let s=[...i][0],a=t.placement(s),c=this.uniquePort(s,/^(?:ANODE|A)$/),l=this.uniquePort(s,/^(?:CATHODE|K)$/);if(!a||!t.sameLocalScope(n,a)||!c||!l||c===l||c.do_not_connect||l.do_not_connect)return;let h=t.connected(c.source_port_id),d=t.connected(l.source_port_id);if(t.isRail(h)||t.groundNets.has(d)||!this.hasGroundedDriver(h,d))return;let u=o.map((v)=>t.port(v)),_=[c,l].map((v)=>t.port(v));if([...u,..._].some((v)=>!v||v.schematic_sheet_id!==n.schematicSheetId))return;let[p,m]=u,A=Math.min(p.center.x,m.center.x),g=Math.max(p.center.x,m.center.x),f=Math.min(p.center.y,m.center.y),y=Math.max(p.center.y,m.center.y),x=Math.max(A-(a.schX+a.width/2),a.schX-a.width/2-g,0),C=Math.max(f-(a.schY+a.height/2),a.schY-a.height/2-y,0),b=Math.hypot(x,C),I=Math.hypot(g-A,y-f);if(b<=Math.max(1.5,2*I)||b>Math.max(8,4*Math.max(n.width,n.height)))return;if(!this.params.ctx.circuitJson.some((v)=>v.type==="schematic_net_label"&&v.schematic_sheet_id===n.schematicSheetId&&v.anchor_position&&_.some((P)=>Math.hypot(P.center.x-v.anchor_position.x,P.center.y-v.anchor_position.y)<0.01&&!this.hasWireAtPin(P))))return;this.params.issues.push({lineItemType:"FlybackDiodeSeparatedFromRelayCoil",relaySchematicBox:n,diodeSchematicBox:a,coilSourcePortIds:[o[0].source_port_id,o[1].source_port_id],distanceFromCoilPins:b,message:`Place ${a.sourceComponentName||"component"} beside ${n.sourceComponentName||"component"}'s coil pins so the flyback protection loop can be read together. Preserve diode polarity and all pin connections; leave room for labels and reroute affected traces.`})}hasWireAtPin(e){return this.params.ctx.circuitJson.some((t)=>t.type==="schematic_trace"&&t.schematic_sheet_id===e.schematic_sheet_id&&t.edges.some(({from:n,to:o})=>{let r=o.x-n.x,i=o.y-n.y,s=r*r+i*i,a=s?Math.max(0,Math.min(1,((e.center.x-n.x)*r+(e.center.y-n.y)*i)/s)):0;return Math.hypot(e.center.x-n.x-a*r,e.center.y-n.y-a*i)<0.01}))}uniquePort(e,t){let n=this.index.portsByComponent.get(e)?.filter((o)=>ase(o,t));return n?.length===1?n[0]:void 0}coilPorts(e){if(this.index.components.get(e)?.ftype!=="simple_chip")return;let t=this.index.portsByComponent.get(e)??[];if(!this.uniquePort(e,/^(?:COM|COMMON)$/)||!t.some((o)=>ase(o,/^(?:NO|NC|NORMALLYOPEN|NORMALLYCLOSED)$/)))return;if(t.filter((o)=>ase(o,/^(?:COIL[A-B12]|A[12])$/)).length!==2)return;for(let[o,r]of[["COILA","COILB"],["COIL1","COIL2"],["A1","A2"]]){let i=this.uniquePort(e,new RegExp(`^${o}$`)),s=this.uniquePort(e,new RegExp(`^${r}$`));if(i&&s&&i!==s&&!ase(i,new RegExp(`^${r}$`))&&!ase(s,new RegExp(`^${o}$`)))return[i,s]}}hasGroundedDriver(e,t){return(this.index.portsByNet.get(e)??[]).some((n)=>{let o=n.source_component_id,r=this.index.components.get(o);if(r?.ftype!=="simple_chip"&&!(r?.ftype==="simple_transistor"&&r.transistor_type==="npn"))return!1;if(this.index.portsByComponent.get(o)?.length!==3)return!1;let i=this.uniquePort(o,/^(?:C|COLLECTOR)$/),s=this.uniquePort(o,/^(?:E|EMITTER)$/),a=this.uniquePort(o,/^(?:B|BASE)$/);if(!i||!s||!a||new Set([i,s,a]).size!==3||[i,s,a].some((h)=>h.do_not_connect)||i.source_port_id!==n.source_port_id)return!1;let c=this.index.connected(s.source_port_id),l=this.index.connected(a.source_port_id);return this.index.groundNets.has(c)&&!this.index.powerNets.has(c)&&new Set([e,t,c,l]).size===4})}static issueToString(e){let t=[];return dn(t,"relayName",e.relaySchematicBox.sourceComponentName),dn(t,"diodeName",e.diodeSchematicBox.sourceComponentName),dn(t,"distanceFromCoilPins",e.distanceFromCoilPins),dn(t,"message",e.message),`<FlybackDiodeSeparatedFromRelayCoil ${t.join(" ")} />`}};function ase(e,t){return[e.name,...e.port_hints??[]].some((n)=>t.test(n.toUpperCase().replace(/[\s_]/g,"")))}var VR=0.01,yFe=class extends po{constructor(e){super();this.params=e,this.index=new Zp(e.ctx),this.hostIds=[...this.index.components.values()].filter((t)=>t.ftype==="simple_chip").map((t)=>t.source_component_id),this.traces=e.ctx.circuitJson.filter((t)=>t.type==="schematic_trace"),this.solved=this.hostIds.length===0}params;index;hostIds;traces;currentIndex=0;_step(){let e=this.hostIds[this.currentIndex++];if(this.solved=this.currentIndex>=this.hostIds.length,!e)return;let t=this.index,n=t.placement(e),o=t.portsByComponent.get(e)??[],r=o.filter((N)=>zHe(N)==="positive"),i=o.filter((N)=>zHe(N)==="negative"),s=o.filter((N)=>pse(N,/^(?:OUT|VOUT|OUTPUT)$/));if(!n||r.length!==1||i.length!==1||s.length!==1||!o.some((N)=>pse(N,/^(?:VS|VCC|VDD)$/))||!o.some((N)=>pse(N,/^(?:GND|GROUND|VSS)$/)))return;let a=[r[0],i[0]],c=a.map((N)=>t.connected(N.source_port_id));if(a.some((N)=>N.do_not_connect)||c[0]===c[1]||c.includes(t.connected(s[0].source_port_id)))return;let l=a.map((N)=>t.port(N)),[h,d]=l;if(!h||!d||!h.facing_direction||h.facing_direction!==d.facing_direction||l.some((N)=>N.schematic_sheet_id!==n.schematicSheetId))return;let u=new Set((t.portsByNet.get(c[0])??[]).filter((N)=>t.components.get(N.source_component_id)?.ftype==="simple_resistor").map((N)=>N.source_component_id).filter((N)=>t.twoTerminalNets(N)?.includes(c[1])));if(u.size!==1)return;let _=[...u][0],p=t.components.get(_);if(p?.ftype!=="simple_resistor"||!Number.isFinite(p.resistance)||p.resistance<=0||p.resistance>1)return;if(c.some((N)=>(t.portsByNet.get(N)??[]).some((D)=>D.source_component_id!==e&&zHe(D)!==void 0&&t.components.get(D.source_component_id)?.ftype==="simple_chip")))return;let m=t.placement(_);if(!m||!t.sameLocalScope(n,m))return;let A=t.portsByComponent.get(_);if(A.some((N)=>N.do_not_connect))return;let g=c.map((N)=>t.port(A.find((D)=>t.connected(D.source_port_id)===N)));if(g.some((N)=>!N||N.schematic_sheet_id!==n.schematicSheetId))return;let f=h.facing_direction==="left"||h.facing_direction==="right",y=(N)=>f?N.y:N.x,x=y(h.center),C=y(d.center),b=Math.abs(x-C);if(b<VR)return;let I=f?m.schY:m.schX,v=(f?m.height:m.width)/2,P=Math.max(Math.min(x,C)-(I+v),I-v-Math.max(x,C));if(P<=Math.max(1.5,2*b)||Math.hypot(m.schX-n.schX,m.schY-n.schY)>Math.max(8,4*Math.max(n.width,n.height)))return;let M=l.map((N,D)=>this.hasVisibleConnection(g[D],N,c[D]));if(M[0]===M[1])return;let B=M[0]?1:0,T=c[B];if(!this.params.ctx.circuitJson.some((N)=>{if(N.type!=="schematic_net_label"||N.schematic_sheet_id!==n.schematicSheetId)return!1;if(N.source_net_id&&(t.connected(N.source_net_id)===T||t.connected(`connectivity:${N.source_net_id}`)===T))return!0;let D=g[B].center;if(N.anchor_position&&Math.hypot(N.anchor_position.x-D.x,N.anchor_position.y-D.y)<VR)return!0;return N.source_trace_id!==void 0&&this.sourceTraceTouchesNet(N.source_trace_id,T)}))return;this.params.issues.push({lineItemType:"CurrentSenseShuntSeparatedFromInputs",amplifierSchematicBox:n,shuntSchematicBox:m,positiveInputSourcePortId:a[0].source_port_id,negativeInputSourcePortId:a[1].source_port_id,inputBandGap:P,message:`Place ${m.sourceComponentName||"component"} near ${n.sourceComponentName||"component"}.${a[0].name}/${a[1].name}, so both sense connections can be read together. Move or rotate the shunt as needed; preserve all pin connections and leave room for labels.`})}hasVisibleConnection(e,t,n){let o=this.traces.filter((s)=>{if(s.schematic_sheet_id!==e.schematic_sheet_id)return!1;if(s.subcircuit_connectivity_map_key)return this.index.connected(`connectivity:${s.subcircuit_connectivity_map_key}`)===n;if(this.sourceTraceTouchesNet(s.source_trace_id,n))return!0;let a=[s.edges[0]?.from,s.edges.at(-1)?.to],c=new Set(this.params.ctx.circuitJson.flatMap((l)=>l.type==="schematic_port"&&l.source_port_id&&l.schematic_sheet_id===s.schematic_sheet_id&&a.some((h)=>h&&Math.hypot(h.x-l.center.x,h.y-l.center.y)<VR)?[this.index.connected(l.source_port_id)]:[]));return c.size===1&&c.has(n)}).flatMap((s)=>s.edges),r=o.filter((s)=>N2e(e.center,s.from,s.to)),i=new Set;for(let s=0;s<r.length;s++){let a=r[s];if(N2e(t.center,a.from,a.to))return!0;for(let[c,l]of o.entries()){if(i.has(c)||![a.from,a.to].some((h)=>N2e(h,l.from,l.to))&&![l.from,l.to].some((h)=>N2e(h,a.from,a.to)))continue;i.add(c),r.push(l)}}return!1}sourceTraceTouchesNet(e,t){if(!e)return!1;let n=this.params.ctx.circuitJson.find((o)=>o.type==="source_trace"&&o.source_trace_id===e);return n?.type==="source_trace"&&n.connected_source_port_ids.some((o)=>this.index.connected(o)===t)}static issueToString(e){let t=[];return dn(t,"amplifierName",e.amplifierSchematicBox.sourceComponentName),dn(t,"shuntName",e.shuntSchematicBox.sourceComponentName),dn(t,"inputBandGap",e.inputBandGap),dn(t,"message",e.message),`<CurrentSenseShuntSeparatedFromInputs ${t.join(" ")} />`}};function pse(e,t){return[e.name,...e.port_hints??[]].some((n)=>t.test(n.toUpperCase().replace(/[\s_]/g,"")))}function zHe(e){let t=pse(e,/^(?:IN\+|VIN\+|INPOS|VINPOS)$/),n=pse(e,/^(?:IN-|VIN-|INNEG|VINNEG)$/);return t===n?void 0:t?"positive":"negative"}function N2e(e,t,n){let o=n.x-t.x,r=n.y-t.y,i=Math.hypot(o,r);if(i<VR)return Math.hypot(e.x-t.x,e.y-t.y)<VR;let s=((e.x-t.x)*o+(e.y-t.y)*r)/i;return s>=-VR&&s<=i+VR&&Math.abs((e.x-t.x)*r-(e.y-t.y)*o)/i<VR}var xFe=class extends po{constructor(e){super();this.params=e,this.index=new Zp(e.ctx),this.resistorIds=[...this.index.components.values()].filter((t)=>t.ftype==="simple_resistor").map((t)=>t.source_component_id);for(let t of e.ctx.circuitJson)if(t.type==="source_net"&&t.is_positive_voltage_source)this.positiveNets.add(this.index.connected(t.source_net_id));this.solved=this.resistorIds.length===0}params;index;positiveNets=new Set;resistorIds;currentIndex=0;_step(){let e=this.resistorIds[this.currentIndex++];if(this.solved=this.currentIndex>=this.resistorIds.length,!e||!this.isResistor(e))return;let t=this.index,n=t.twoTerminalNets(e);if(!n)return;let o=n.filter((A)=>t.isRail(A));if(o.length!==1)return;let r=o[0];if(!this.positiveNets.has(r)||t.groundNets.has(r))return;let i=n.find((A)=>A!==r),s=t.portsByNet.get(i)??[],a=new Set(s.filter((A)=>t.components.get(A.source_component_id)?.ftype==="simple_resistor").map((A)=>A.source_component_id));if(a.size!==2)return;let c=[...a].find((A)=>A!==e);if(!this.isResistor(c))return;let l=t.twoTerminalNets(c),h=l?.find((A)=>A!==i);if(!l?.includes(i)||!h||!t.groundNets.has(h)||t.powerNets.has(h)||!s.some((A)=>!a.has(A.source_component_id)))return;let d=t.placement(e),u=t.placement(c);if(!d||!u||!t.sameLocalScope(d,u))return;let _=this.getDownwardResistorPorts(e,r,i),p=this.getDownwardResistorPorts(c,i,h);if(!_||!p)return;let m=u.schY-u.height/2-(d.schY+d.height/2);if(m<=1.5)return;this.params.issues.push({lineItemType:"VoltageDividerSupplyResistorBelowGroundResistor",supplyResistorSchematicBox:d,groundResistorSchematicBox:u,supplyTapSourcePortId:_.bottom.source_port_id,groundTapSourcePortId:p.top.source_port_id,reversedBodyGap:m,message:`Place ${d.sourceComponentName||"component"} above ${u.sourceComponentName||"component"}, close enough to read their shared divider tap. Preserve all connections and leave room for labels; exact alignment is not required.`})}isResistor(e){let t=this.index.components.get(e);return t?.ftype==="simple_resistor"&&Number.isFinite(t.resistance)&&t.resistance>0}getDownwardResistorPorts(e,t,n){let o=this.index,r=o.placement(e),i=o.portsByComponent.get(e);if(i.some((h)=>h.do_not_connect))return;let s=i.find((h)=>o.connected(h.source_port_id)===t),a=i.find((h)=>o.connected(h.source_port_id)===n);if(!s||!a)return;let c=o.port(s),l=o.port(a);if(!c||!l||c.schematic_sheet_id!==r.schematicSheetId||l.schematic_sheet_id!==r.schematicSheetId||c.facing_direction!=="up"||l.facing_direction!=="down"||c.center.y<=l.center.y)return;return{top:s,bottom:a}}static issueToString(e){let t=[];return dn(t,"supplyResistorName",e.supplyResistorSchematicBox.sourceComponentName),dn(t,"groundResistorName",e.groundResistorSchematicBox.sourceComponentName),dn(t,"reversedBodyGap",e.reversedBodyGap),dn(t,"message",e.message),`<VoltageDividerSupplyResistorBelowGroundResistor ${t.join(" ")} />`}},CFe=class extends po{constructor(e){super();this.params=e,this.index=new Zp(e.ctx),this.hostIds=[...this.index.components.values()].filter((t)=>t.ftype==="simple_chip").map((t)=>t.source_component_id),this.solved=this.hostIds.length===0}params;index;hostIds;currentIndex=0;_step(){let e=this.hostIds[this.currentIndex++];if(this.solved=this.currentIndex>=this.hostIds.length,!e)return;let t=this.index,n=t.placement(e),o=t.portsByComponent.get(e)??[];if(!n||o.some((I)=>!R2e(I)))return;let r=o.filter((I)=>R2e(I)==="input"),i=o.filter((I)=>R2e(I)==="output"),s=o.filter((I)=>R2e(I)==="ground");if(r.length!==1||i.length!==1||!s.length)return;let a=r[0],c=i[0];if([a,c,...s].some((I)=>I.do_not_connect))return;let l=t.connected(a.source_port_id),h=t.connected(c.source_port_id),d=new Set(s.map((I)=>t.connected(I.source_port_id)));if(d.size!==1)return;let u=[...d][0];if(new Set([l,h,u]).size!==3||!(t.groundNets.has(u)||s.some((I)=>I.requires_ground||I.provides_ground))||!(t.powerNets.has(l)||a.requires_power)||!(t.powerNets.has(h)||c.provides_power))return;let _=t.port(a),p=t.port(c);if(!_||!p||_.schematic_sheet_id!==n.schematicSheetId||p.schematic_sheet_id!==n.schematicSheetId)return;let m=_.facing_direction==="left"&&p.facing_direction==="right"||_.facing_direction==="right"&&p.facing_direction==="left",A=_.facing_direction==="up"&&p.facing_direction==="down"||_.facing_direction==="down"&&p.facing_direction==="up";if(!m&&!A)return;let g=p.facing_direction==="right"||p.facing_direction==="up"?1:-1;if(g*(m?p.center.x-_.center.x:p.center.y-_.center.y)<=0.01)return;let y=this.localCapacitor(n,l,u),x=this.localCapacitor(n,h,u);if(!y||!x)return;let C=(I,v)=>{let P=v*g*(m?I.schX-n.schX:I.schY-n.schY),M=m?(n.width+I.width)/2:(n.height+I.height)/2;return P>M+0.2};if(!C(y,1)||!C(x,-1))return;let b=n.sourceComponentName||"component";this.params.issues.push({lineItemType:"RegulatorCapacitorsOnWrongSides",regulatorSchematicBox:n,inputCapacitorSchematicBox:y,outputCapacitorSchematicBox:x,inputSourcePortId:a.source_port_id,outputSourcePortId:c.source_port_id,message:`Place ${y.sourceComponentName} near ${b}.${a.name} on the ${_.facing_direction} side and ${x.sourceComponentName} near ${b}.${c.name} on the ${p.facing_direction} side. Preserve all connections and leave room for labels; exact alignment is not required.`})}localCapacitor(e,t,n){let o=this.index,r=[],i=Math.max(6,4*Math.max(e.width,e.height)),s=new Set((o.portsByNet.get(t)??[]).map((a)=>a.source_component_id));for(let a of s){if(o.components.get(a)?.ftype!=="simple_capacitor")continue;let c=o.twoTerminalNets(a),l=o.placement(a);if(!c?.includes(n)||!l||!o.sameLocalScope(e,l))continue;if(Math.hypot(l.schX-e.schX,l.schY-e.schY)>i)continue;if(o.portsByComponent.get(a).some((d)=>d.do_not_connect||!o.port(d)||o.port(d).schematic_sheet_id!==e.schematicSheetId))continue;r.push(l)}return r.length===1?r[0]:void 0}static issueToString(e){let t=[];return dn(t,"regulatorName",e.regulatorSchematicBox.sourceComponentName),dn(t,"inputCapacitorName",e.inputCapacitorSchematicBox.sourceComponentName),dn(t,"outputCapacitorName",e.outputCapacitorSchematicBox.sourceComponentName),dn(t,"message",e.message),`<RegulatorCapacitorsOnWrongSides ${t.join(" ")} />`}};function R2e(e){let t=new Set;for(let n of[e.name,...e.port_hints??[]]){let o=n.toUpperCase().replace(/[ _-]/g,"");if(/^(?:VIN|IN|INPUT)$/.test(o))t.add("input");else if(/^(?:VOUT|OUT|OUTPUT)$/.test(o))t.add("output");else if(/^(?:GND\d*|VSS)$/.test(o))t.add("ground");else if(/^(?:EN|ENABLE|CE|SHDN|NC\d*|EP|PAD|ADJ|FB|BYP|BYPASS|NR|PG|PGOOD)$/.test(o))t.add("control")}return t.size===1?[...t][0]:void 0}function Tw(e,t,n,o){return{left:e-n/2,right:e+n/2,top:t+o/2,bottom:t-o/2}}function U2e(e,t){let n=Math.min(e.right,t.right)-Math.max(e.left,t.left),o=Math.min(e.top,t.top)-Math.max(e.bottom,t.bottom);return n>0&&o>0?{ow:n,oh:o}:null}var yse=0.01,C8t={right:{x:1,y:0},left:{x:-1,y:0},up:{x:0,y:1},down:{x:0,y:-1}},Og=(e,t)=>e.x*t.x+e.y*t.y,hse=(e,t)=>Math.abs(e.x-t.x)+Math.abs(e.y-t.y),GR=(e,t)=>hse(e,t)<=yse,Gj=(e)=>Math.round(e*100)/100,bFe=class extends po{constructor(e){super();this.params=e}params;_step(){let{ctx:e,issues:t}=this.params,n=new Zp(e);for(let r of n.portsByComponent.values())for(let i of r){let s=n.connected(i.source_port_id);if(i.requires_ground||i.provides_ground)n.groundNets.add(s);if(i.requires_power||i.provides_power)n.powerNets.add(s)}let o=e.circuitJson.filter((r)=>r.type==="schematic_trace");for(let[r,i]of n.components){if(i.ftype!=="simple_pin_header"&&i.ftype!=="simple_connector")continue;let s=n.placement(r),a=n.portsByComponent.get(r)??[];if(!s||a.length<2)continue;let c=a.map((V)=>n.port(V)),l=c[0]?.facing_direction;if(!l||c.some((V)=>!V||V.facing_direction!==l))continue;let h=C8t[l],d={x:-h.y,y:h.x},u=o.filter((V)=>V.schematic_sheet_id===s.schematicSheetId),_=e.circuitJson.filter((V)=>V.type==="schematic_net_label"&&V.schematic_sheet_id===s.schematicSheetId),p=[],m=!1;for(let V of a){let O=n.port(V),U=n.connected(V.source_port_id),j=(n.portsByNet.get(U)??[]).filter((J)=>J.source_port_id!==V.source_port_id),Y=u.filter((J)=>J.edges.some((ee)=>GR(ee.from,O.center)||GR(ee.to,O.center)));if(n.isRail(U)){if(Y.some((J)=>!_.some((ee)=>ee.anchor_position&&b8t(J,O.center,ee.anchor_position))))m=!0;continue}if(j.length===0){if(Y.length>0)m=!0;continue}let X=j.length===1?n.port(j[0]):void 0,K=j.length===1?n.placement(j[0].source_component_id):void 0;if(!X?.facing_direction||!K||!n.sameLocalScope(s,K)||Og(C8t[X.facing_direction],h)!==-1){m=!0;break}p.push({pin:O,peer:X,component:K})}if(m||p.length<2)continue;if(p.some((V)=>Og(V.peer.center,h)>=Og(V.pin.center,h)-2))continue;let A=p.map((V)=>u.filter((O)=>b8t(O,V.pin.center,V.peer.center)&&hwo(O)>=3)).filter((V)=>V.length>0);if(A.length<2)continue;let g=A.flat(),f=[...p].sort((V,O)=>Og(V.pin.center,d)-Og(O.pin.center,d));if(f.some((V,O)=>O>0&&Og(V.peer.center,d)<=Og(f[O-1].peer.center,d)+yse))continue;let y={x:s.schX,y:s.schY},x=Math.max(...p.map((V)=>Og(V.pin.center,h)-Og(y,h))),C=Math.min(...p.map((V)=>Og(V.peer.center,h)))-2-x,b=p.map((V)=>Og(V.peer.center,d)-Og(V.pin.center,d)+Og(y,d)).sort((V,O)=>V-O),I=b[Math.floor(b.length/2)],v={x:Gj(h.x*C+d.x*I),y:Gj(h.y*C+d.y*I)},P={x:v.x-y.x,y:v.y-y.y},M=(V)=>({x:V.center.x+P.x,y:V.center.y+P.y});if(p.some((V)=>hse(M(V.pin),V.peer.center)>hse(V.pin.center,V.peer.center)+yse))continue;let B=p.reduce((V,O)=>V+hse(O.pin.center,O.peer.center),0),T=p.reduce((V,O)=>V+hse(M(O.pin),O.peer.center),0);if(B-T<4||T>B*0.75)continue;let N=e.componentPlacements.filter((V)=>V.schematicSheetId===s.schematicSheetId&&V.schematicComponentId!==s.schematicComponentId),D=Tw(v.x,v.y,s.width+0.4,s.height+0.4);if(N.some((V)=>U2e(D,Tw(V.schX,V.schY,V.width,V.height))))continue;if(p.some((V)=>{let O=M(V.pin),U=V.peer.center,j=(Og(O,h)+Og(U,h))/2,Y=[O,{x:h.x*j+d.x*Og(O,d),y:h.y*j+d.y*Og(O,d)},{x:h.x*j+d.x*Og(U,d),y:h.y*j+d.y*Og(U,d)},U];return N.some((X)=>X.schematicComponentId!==V.component.schematicComponentId&&Y.slice(1).some((K,J)=>dwo(Y[J],K,X)))}))continue;let L=[...new Map(p.map((V)=>[V.component.schematicComponentId,V.component])).values()],H=s.sourceComponentName||"component";t.push({lineItemType:"ConnectorPositionCausesTraceDetours",connectorSchematicBox:s,connectedComponents:L,schematicTraceIds:[...new Set(g.map((V)=>V.schematic_trace_id))],evaluatedSignalCount:p.length,newSchX:v.x,newSchY:v.y,deltaSchX:Gj(P.x),deltaSchY:Gj(P.y),currentTotalSignalDistance:Gj(B),suggestedTotalSignalDistance:Gj(T),message:`Move ${H} to schX=${v.x}, schY=${v.y} so its signal pins face ${L.map((V)=>V.sourceComponentName||"component").join(", ")}. Preserve rotation and pin assignments; reroute the connections and attached rail labels.`})}this.solved=!0}static issueToString(e){let t=[];dn(t,"connectorComponentName",e.connectorSchematicBox.sourceComponentName),dn(t,"connectedComponents",e.connectedComponents.map((n)=>n.sourceComponentName||"component").join(","));for(let n of["evaluatedSignalCount","newSchX","newSchY","deltaSchX","deltaSchY","currentTotalSignalDistance","suggestedTotalSignalDistance"])dn(t,n,e[n]);return dn(t,"message",e.message),`<ConnectorPositionCausesTraceDetours ${t.join(" ")} />`}};function b8t(e,t,n){let o=e.edges[0]?.from,r=e.edges.at(-1)?.to;return!!o&&!!r&&(GR(o,t)&&GR(r,n)||GR(o,n)&&GR(r,t))}function hwo(e){let t,n=0;for(let o=0;o<e.edges.length;o++){let r=e.edges[o];if(o>0&&!GR(e.edges[o-1].to,r.from))return 0;if(GR(r.from,r.to))continue;let i=Math.abs(r.from.y-r.to.y)<yse?"x":Math.abs(r.from.x-r.to.x)<yse?"y":void 0;if(!i)return 0;if(t&&t!==i)n++;t=i}return n}function dwo(e,t,n){let o=Tw(n.schX,n.schY,n.width+0.2,n.height+0.2);return Math.max(e.x,t.x)>o.left&&Math.min(e.x,t.x)<o.right&&Math.max(e.y,t.y)>o.bottom&&Math.min(e.y,t.y)<o.top}var IFe=class extends po{index;positiveNets=new Set;transistorIds;issues;currentIndex=0;constructor({ctx:e,issues:t}){super();this.issues=t,this.index=new Zp(e);for(let n of e.circuitJson)if(n.type==="source_net"&&n.is_positive_voltage_source)this.positiveNets.add(this.index.connected(n.source_net_id));this.transistorIds=[...this.index.components.values()].filter((n)=>n.ftype==="simple_transistor"&&n.transistor_type==="npn").map((n)=>n.source_component_id),this.solved=this.transistorIds.length===0}_step(){let e=this.transistorIds[this.currentIndex++];if(this.solved=this.currentIndex>=this.transistorIds.length,!e)return;let t=this.index,n=t.placement(e);if(!n||t.portsByComponent.get(e)?.length!==3)return;let o=t.namedPort(e,"base"),r=t.namedPort(e,"collector"),i=t.namedPort(e,"emitter");if(!o||!r||!i)return;let s=t.connected(o.source_port_id),a=t.connected(r.source_port_id),c=t.connected(i.source_port_id);if(new Set([s,a,c]).size!==3||!t.groundNets.has(c)||t.powerNets.has(c)||t.isRail(s)||t.isRail(a))return;let l=(t.portsByNet.get(s)??[]).filter((O)=>O.source_component_id!==e);if(l.length!==1)return;let h=l[0].source_component_id,d=t.components.get(h),u=t.placement(h),p=t.twoTerminalNets(h)?.find((O)=>O!==s);if(d?.ftype!=="simple_resistor"||d.resistance<=0||!u||!t.sameLocalScope(n,u)||!p||t.isRail(p)||p===a)return;let m=(t.portsByNet.get(a)??[]).filter((O)=>O.source_component_id!==e),A=m.filter((O)=>t.components.get(O.source_component_id)?.ftype==="simple_chip");if(A.length!==1)return;let g=A[0].source_component_id,f=t.placement(g),x=t.twoTerminalNets(g)?.find((O)=>O!==a);if(!f||!t.sameLocalScope(n,f)||!x||!this.positiveNets.has(x)||t.groundNets.has(x))return;let C=m.filter((O)=>O.source_component_id!==g);if(C.length!==1)return;let b=C[0].source_component_id,I=t.placement(b),v=t.namedPort(b,"anode"),P=t.namedPort(b,"cathode");if(t.components.get(b)?.ftype!=="simple_diode"||!t.twoTerminalNets(b)||!v||!P||t.connected(v.source_port_id)!==a||t.connected(P.source_port_id)!==x||!I||!t.sameLocalScope(n,I))return;let M=t.port(r),B=t.port(i),T=t.port(o);if(!M||!B||!T)return;let N=M.facing_direction,D=B.facing_direction;if(!N||!D)return;let L=[];if(n.schY>=f.schY)L.push("transistor_not_below_load");if(N!=="up")L.push("collector_not_up");if(D!=="down")L.push("emitter_not_down");if(L.length===0)return;let H=n.sourceComponentName||"component",V=f.sourceComponentName||"component";this.issues.push({lineItemType:"LowSideTransistorNotAlignedWithLoad",transistorSchematicBox:n,loadSchematicBox:f,baseResistorSchematicBox:u,clampDiodeSchematicBox:I,collectorSourcePortId:r.source_port_id,emitterSourcePortId:i.source_port_id,collectorFacingDirection:N,emitterFacingDirection:D,placementProblems:L,message:`Arrange ${H} below ${V}, with its collector facing up toward the load and emitter facing down toward ground; place ${u.sourceComponentName||"component"} beside the base. Preserve all pin connections and reroute affected traces.`})}static issueToString(e){let t=[];return dn(t,"transistorName",e.transistorSchematicBox.sourceComponentName),dn(t,"loadName",e.loadSchematicBox.sourceComponentName),dn(t,"baseResistorName",e.baseResistorSchematicBox.sourceComponentName),dn(t,"clampDiodeName",e.clampDiodeSchematicBox.sourceComponentName),dn(t,"placementProblems",e.placementProblems.join(",")),dn(t,"collectorFacingDirection",e.collectorFacingDirection),dn(t,"emitterFacingDirection",e.emitterFacingDirection),dn(t,"message",e.message),`<LowSideTransistorNotAlignedWithLoad ${t.join(" ")} />`}},vFe=class extends po{constructor(e){super();this.params=e,this.index=new Zp(e.ctx),this.hostIds=[...this.index.components.values()].filter((t)=>t.ftype==="simple_chip").map((t)=>t.source_component_id),this.solved=this.hostIds.length===0}params;index;hostIds;reportedPairs=new Set;currentIndex=0;_step(){let e=this.hostIds[this.currentIndex++];if(this.solved=this.currentIndex>=this.hostIds.length,!e)return;let t=this.index.portsByComponent.get(e)??[],n=t.filter((C)=>I8t(C)==="positive"),o=t.filter((C)=>I8t(C)==="negative");if(n.length!==1||o.length!==1)return;let r=n[0],i=o[0],s=this.seriesResistor(r),a=this.seriesResistor(i);if(!s||!a||s.axis!==a.axis||!this.index.sameLocalScope(s.placement,a.placement)||new Set([s.hostNet,a.hostNet,s.interfaceNet,a.interfaceNet]).size!==4||!this.shareInterface(s,a,e))return;let c=[s.id,a.id].sort().join("\x00");if(this.reportedPairs.has(c))return;let l=s.placement,h=a.placement,d=s.axis==="horizontal",u=Math.abs(d?l.schX-h.schX:l.schY-h.schY),_=Math.abs(d?l.schY-h.schY:l.schX-h.schX),p=d?l.width:l.height,m=d?h.width:h.height,A=d?l.height:l.width,g=d?h.height:h.width;if(u-(p+m)/2<Math.max(p,m)||_>=(A+g)/2-0.01)return;this.reportedPairs.add(c);let y=l.sourceComponentName||"component",x=h.sourceComponentName||"component";this.params.issues.push({lineItemType:"UsbSeriesResistorsNotAligned",positiveResistorSchematicBox:l,negativeResistorSchematicBox:h,hostSourceComponentId:e,positiveSourcePortId:r.source_port_id,negativeSourcePortId:i.source_port_id,signalAxis:s.axis,message:`Place ${y} (D+) and ${x} (D−) near each other and draw clear traces to their corresponding USB ports. Exact alignment is not required; preserve pin assignments and leave space for labels.`})}seriesResistor(e){let t=this.index,n=t.connected(e.source_port_id);if(t.isRail(n))return;let o=new Set((t.portsByNet.get(n)??[]).filter((_)=>t.components.get(_.source_component_id)?.ftype==="simple_resistor").map((_)=>_.source_component_id));if(o.size!==1)return;let r=[...o][0],s=t.twoTerminalNets(r)?.find((_)=>_!==n),a=t.placement(r);if(!s||t.isRail(s)||!a)return;if((t.portsByNet.get(s)??[]).some((_)=>_.source_component_id!==r&&t.components.get(_.source_component_id)?.ftype==="simple_resistor"))return;let c=t.portsByComponent.get(r).map((_)=>t.port(_)),[l,h]=c;if(!l||!h)return;let d=new Set([l.facing_direction,h.facing_direction]),u;if(d.has("left")&&d.has("right")&&Math.abs(l.center.y-h.center.y)<0.01)u="horizontal";else if(d.has("up")&&d.has("down")&&Math.abs(l.center.x-h.center.x)<0.01)u="vertical";else return;return{id:r,placement:a,hostNet:n,interfaceNet:s,axis:u}}shareInterface(e,t,n){let o=(i)=>new Set((this.index.portsByNet.get(i)??[]).map((s)=>s.source_component_id).filter((s)=>s!==n&&s!==e.id&&s!==t.id&&(this.index.portsByComponent.get(s)?.length??0)>2)),r=o(e.interfaceNet);return[...o(t.interfaceNet)].some((i)=>r.has(i))}static issueToString(e){let t=[];return dn(t,"positiveResistorName",e.positiveResistorSchematicBox.sourceComponentName),dn(t,"negativeResistorName",e.negativeResistorSchematicBox.sourceComponentName),dn(t,"signalAxis",e.signalAxis),dn(t,"message",e.message),`<UsbSeriesResistorsNotAligned ${t.join(" ")} />`}};function I8t(e){let t=new Set;for(let n of[e.name,...e.port_hints??[]]){let o=n.toUpperCase();if(/^(?:USB_?)?D(?:P|\+|_POS)$/.test(o))t.add("positive");if(/^(?:USB_?)?D(?:M|N|-|_NEG)$/.test(o))t.add("negative")}return t.size===1?[...t][0]:void 0}function uwo(e){return e.filter((t)=>t!==void 0).reduce((t,n)=>Nb(t,n),{})}function pwo(e,t,n){return{rects:[{center:{x:e.schX,y:e.schY},width:e.width,height:e.height,stroke:t,fill:t.replace("0.95","0.15"),label:n}]}}function mwo(e){return{rects:e.filter((n)=>n.type==="schematic_box").map((n)=>{let o=n;return{center:{x:o.x,y:o.y},width:o.width,height:o.height,stroke:"hsl(0,0%,60%)"}})}}var SFe=class e extends po{static EPSILON=0.01;static ORIENTATION_MESSAGE='Use schOrientation="vertical" on this capacitor to fix the symbol orientation';ctx;out;schematicComponentById;sourceComponentById;capacitorPlacements;feedbackCapacitorIds;currentPlacementIndex=0;horizontalSymbolNames=new Set(["capacitor_left","capacitor_right"]);constructor({ctx:t,issues:n}){super();this.ctx=t,this.out=n,this.schematicComponentById=this.buildSchematicComponentById(t.circuitJson),this.sourceComponentById=this.buildSourceComponentById(t.circuitJson),this.capacitorPlacements=this.getCapacitorPlacements();let o=new Zp(t);this.feedbackCapacitorIds=new Set(this.capacitorPlacements.flatMap((r)=>r.sourceComponentId&&o.isDirectOpAmpFeedback(r.sourceComponentId)?[r.sourceComponentId]:[])),this.solved=this.capacitorPlacements.length===0}getCapacitorPlacements(){return this.ctx.componentPlacements.filter((t)=>t.sourceComponentId!==void 0&&this.sourceComponentById.get(t.sourceComponentId)?.ftype==="simple_capacitor").map((t)=>({schX:t.schX,schY:t.schY,width:t.width,height:t.height,sourceComponentId:t.sourceComponentId,sourceComponentName:t.sourceComponentName,schematicComponentId:t.schematicComponentId,schematicSheetId:t.schematicSheetId,schematicSheetName:t.schematicSheetName}))}_step(){let t=this.capacitorPlacements[this.currentPlacementIndex];if(!t){this.solved=!0;return}this.currentPlacementIndex+=1,this.solved=this.currentPlacementIndex>=this.capacitorPlacements.length;let n=this.getIssueForPlacement(t);if(n)this.out.push(n)}visualize(){let t=this.getFocusedPlacement();return uwo([mwo(this.ctx.circuitJson),t?pwo(t,"hsl(210, 100%, 50%, 0.95)","capacitorOrientation"):void 0])}getFocusedPlacement(){if(this.capacitorPlacements.length===0)return;let t=this.iterations===0?this.currentPlacementIndex:Math.max(0,this.currentPlacementIndex-1);return this.capacitorPlacements[t]}buildSchematicComponentById(t){return new Map(t.filter((n)=>n.type==="schematic_component").map((n)=>[n.schematic_component_id,n]))}buildSourceComponentById(t){return new Map(t.flatMap((n)=>{if(n.type!=="source_component"||!("source_component_id"in n)||typeof n.source_component_id!=="string")return[];return[{type:"source_component",source_component_id:n.source_component_id,ftype:"ftype"in n&&typeof n.ftype==="string"?n.ftype:void 0}]}).map((n)=>[n.source_component_id,n]))}createIssuePlacement(t){return{positionAnchor:"center",schX:t.schX,schY:t.schY,width:t.width,height:t.height,sourceComponentId:t.sourceComponentId,sourceComponentName:t.sourceComponentName,schematicComponentId:t.schematicComponentId,schematicSheetId:t.schematicSheetId,schematicSheetName:t.schematicSheetName}}getIssueForPlacement(t){if(!t.schematicComponentId||!t.sourceComponentId)return;let n=this.schematicComponentById.get(t.schematicComponentId);if(!n)return;if(!this.horizontalSymbolNames.has(n.symbol_name??""))return;if(this.feedbackCapacitorIds.has(t.sourceComponentId))return;if(this.isInlineWithHorizontalTraces(t.schematicComponentId))return;return{lineItemType:"CapacitorSymbolHorizontal",schematicBox:this.createIssuePlacement(t),message:e.ORIENTATION_MESSAGE}}isInlineWithHorizontalTraces(t){let n=this.ctx.circuitJson.filter((r)=>r.type==="schematic_port"&&r.schematic_component_id===t);if(n.length!==2)return!1;let o=n.map((r)=>this.getOutwardHorizontalTrace(r));return o.every((r)=>r!==void 0)&&o.some((r)=>r!==void 0&&r.edges.every((i)=>Math.abs(i.from.y-i.to.y)<=e.EPSILON))}getOutwardHorizontalTrace(t){if(t.facing_direction!=="left"&&t.facing_direction!=="right")return;return this.ctx.circuitJson.find((n)=>n.type==="schematic_trace"&&n.schematic_sheet_id===t.schematic_sheet_id&&n.edges.some((o)=>{let r=this.pointsEqual(o.from,t.center)?o.to:this.pointsEqual(o.to,t.center)?o.from:void 0;return r!==void 0&&Math.abs(r.y-t.center.y)<=e.EPSILON&&(t.facing_direction==="left"?r.x<t.center.x-e.EPSILON:r.x>t.center.x+e.EPSILON)}))}pointsEqual(t,n){return Math.abs(t.x-n.x)<=e.EPSILON&&Math.abs(t.y-n.y)<=e.EPSILON}static issueToString(t){let n=[];return dn(n,"componentName",t.schematicBox.sourceComponentName),dn(n,"schX",t.schematicBox.schX),dn(n,"schY",t.schematicBox.schY),dn(n,"width",t.schematicBox.width),dn(n,"height",t.schematicBox.height),dn(n,"message",t.message),`<CapacitorSymbolHorizontal ${n.join(" ")} />`}},PFe=class e extends po{constructor(t){super();this.params=t;let n=new Zp(t.ctx),o=new Set(n.powerNets),r=new Set(n.groundNets);for(let i of t.ctx.circuitJson)if(i.type==="source_net"){let s=n.connected(i.source_net_id);if(!this.netNames.has(s))this.netNames.set(s,i.name)}for(let i of n.portsByComponent.values())for(let s of i){if(s.do_not_connect)continue;let a=n.connected(s.source_port_id);if(s.provides_power||s.requires_power)o.add(a);if(s.provides_ground||s.requires_ground)r.add(a);if((o.has(a)||r.has(a))&&!this.netNames.has(a))this.netNames.set(a,s.name)}for(let i of n.components.values()){if(i.ftype!=="simple_capacitor")continue;let s=i.source_component_id,a=n.placement(s),c=n.twoTerminalNets(s),l=n.portsByComponent.get(s);if(!a||!c||!l||l.some((_)=>{let p=n.port(_);return _.do_not_connect||!p||p.schematic_sheet_id!==a.schematicSheetId}))continue;let h=c.find((_)=>o.has(_)&&!r.has(_)),d=c.find((_)=>r.has(_)&&!o.has(_));if(!h||!d)continue;let u=this.banks.find((_)=>_.power===h&&_.ground===d&&n.sameLocalScope(_.capacitors[0],a));if(u)u.capacitors.push(a);else this.banks.push({power:h,ground:d,capacitors:[a]})}this.solved=this.banks.length===0}params;static MIN_BODY_GAP=1;banks=[];netNames=new Map;bankIndex=0;_step(){let t=this.banks[this.bankIndex++];if(this.solved=this.bankIndex>=this.banks.length,t.capacitors.length<2)return;let n=Math.max(e.MIN_BODY_GAP,...t.capacitors.map((a)=>Math.max(a.width,a.height))),o=0,r=t.capacitors.slice(1).map((a)=>({box:a,gap:e.bodyGap(t.capacitors[0],a)}));while(r.length>0){let a=0;for(let l=1;l<r.length;l++)if(r[l].gap<r[a].gap)a=l;let c=r.splice(a,1)[0];o=Math.max(o,c.gap);for(let l of r)l.gap=Math.min(l.gap,e.bodyGap(c.box,l.box))}if(o<=n+0.000001)return;let i=this.netNames.get(t.power)??"power",s=this.netNames.get(t.ground)??"ground";this.params.issues.push({lineItemType:"DecouplingCapacitorsNotCloseTogether",railName:i,groundName:s,capacitorSchematicBoxes:t.capacitors,maxBodyGap:o,maxRecommendedBodyGap:n,message:`Group the decoupling capacitors between ${i} and ${s} closer together in this schematic block. Preserve their net connections.`})}static bodyGap(t,n){return Math.hypot(Math.max(0,Math.abs(t.schX-n.schX)-(t.width+n.width)/2),Math.max(0,Math.abs(t.schY-n.schY)-(t.height+n.height)/2))}static issueToString(t){let n=[];return dn(n,"rail",t.railName),dn(n,"ground",t.groundName),dn(n,"capacitorNames",t.capacitorSchematicBoxes.map((o)=>o.sourceComponentName||"component").join(", ")),dn(n,"maxBodyGap",t.maxBodyGap),dn(n,"maxRecommendedBodyGap",t.maxRecommendedBodyGap),dn(n,"message",t.message),`<DecouplingCapacitorsNotCloseTogether ${n.join(" ")} />`}};function F2e(e){let t=e.anchor_side;if(t==="top"||t==="bottom"){let c=e.anchor_position?.y??e.center.y,l=(e.text?.length??8)*0.13/2+0.1,h=e.center.x-0.1,d=e.center.x+0.1;if(t==="top")return{left:h,right:d,top:c,bottom:c-l*2};return{left:h,right:d,top:c+l*2,bottom:c}}let o=e.anchor_position?.x??e.center.x,i=Math.abs(e.center.x-o)+0.1,s=e.center.y+0.1,a=e.center.y-0.1;if(e.center.x>=o)return{left:o,right:e.center.x+i,top:s,bottom:a};return{left:e.center.x-i,right:o,top:s,bottom:a}}var mse=class extends po{constructor(e){super();this.params=e,this.placements=e.ctx.componentPlacements,this.netLabelsByComponentId=this.buildNetLabelsByComponentId(e.ctx.circuitJson),this.solved=this.placements.length<2}params;placements;netLabelsByComponentId;rawCollisions=[];firstIndex=0;secondIndex=1;_step(){if(this.firstIndex>=this.placements.length-1){this.buildAndPushIssues(),this.solved=!0;return}let e=this.placements[this.firstIndex],t=this.placements[this.secondIndex];if(this.detectPair(e,t),this.secondIndex++,this.secondIndex>=this.placements.length)this.firstIndex++,this.secondIndex=this.firstIndex+1}detectPair(e,t){if(e.schematicSheetId!==t.schematicSheetId)return;this.rawCollisions.push(...this.detectLabelLabel(e,t)),this.rawCollisions.push(...this.detectBoxLabel(e,t)),this.rawCollisions.push(...this.detectBoxLabel(t,e))}detectLabelLabel(e,t){let n=e,o=t;if(e.schX>t.schX)n=t,o=e;let r=n.schematicComponentId,i=o.schematicComponentId;if(!r||!i)return[];let s=this.netLabelsByComponentId.get(r)??[],a=this.netLabelsByComponentId.get(i)??[];if(s.length===0||a.length===0)return[];let c=[];for(let l of s)for(let h of a){let d=F2e(l),u=F2e(h);if(U2e(d,u))c.push({type:"label-label",bounds:{left:Math.max(d.left,u.left),right:Math.min(d.right,u.right),top:Math.min(d.top,u.top),bottom:Math.max(d.bottom,u.bottom)},leftComp:n,rightComp:o,leftId:r,rightId:i,xSeparation:d.right-u.left+0.1})}return c}detectBoxLabel(e,t){let n=e.schematicComponentId,o=t.schematicComponentId;if(!n||!o)return[];let r=this.netLabelsByComponentId.get(o)??[];if(r.length===0)return[];let i=Tw(e.schX,e.schY,e.width,e.height),s=e.schX<=t.schX,a=[];for(let c of r){let l=F2e(c);if(!U2e(i,l))continue;let h;if(s)h=i.right-l.left+0.1;else h=l.right-i.left+0.1;a.push({type:"box-label",bounds:{left:Math.max(i.left,l.left),right:Math.min(i.right,l.right),top:Math.min(i.top,l.top),bottom:Math.max(i.bottom,l.bottom)},boxComp:e,labelComp:t,boxId:n,labelId:o,xSeparation:h})}return a}buildAndPushIssues(){if(this.rawCollisions.length===0)return;let e=new Map;for(let t of this.rawCollisions){let o=(t.type==="label-label"?t.leftComp:t.boxComp).schematicSheetId??"",r=e.get(o);if(r)r.push(t);else e.set(o,[t])}for(let t of e.values())this.buildAndPushIssueForSheet(t)}buildAndPushIssueForSheet(e){let t=this.computeGlobalFixes(e);if(t.size===0)return;let n=new Set,o=[];for(let s of e){let a,c;if(s.type==="label-label")a=s.leftComp.sourceComponentName??"",c=s.rightComp.sourceComponentName??"";else a=s.boxComp.sourceComponentName??"",c=s.labelComp.sourceComponentName??"";let l=`${a}/${c}`;if(!n.has(l))n.add(l),o.push({comp1Name:a,comp2Name:c})}let r=e[0],i=r.type==="label-label"?r.leftComp:r.boxComp;this.params.issues.push({lineItemType:"NetLabelCollision",schematicSheetId:i.schematicSheetId,schematicSheetName:i.schematicSheetName,pairs:o,collisionBounds:e.map((s)=>s.bounds),moves:Array.from(t.values())})}computeGlobalFixes(e){let t=new Map;for(let l of this.placements)if(l.schematicComponentId)t.set(l.schematicComponentId,l);let n=new Map,o=(l,h,d)=>{let u=t.get(l),_=t.get(h);if(!u||!_)return;let p=_.schX-u.schX+d,m=`${l}|${h}`;n.set(m,Math.max(n.get(m)??0,p))};for(let l of e)if(l.type==="label-label")o(l.leftId,l.rightId,l.xSeparation);else if(l.boxComp.schX<=l.labelComp.schX)o(l.boxId,l.labelId,l.xSeparation);else o(l.labelId,l.boxId,l.xSeparation);let r=[...n.entries()].map(([l,h])=>{let d=l.indexOf("|");return{leftId:l.slice(0,d),rightId:l.slice(d+1),minSep:h}}),i=new Set,s=new Map;for(let{leftId:l,rightId:h}of r){if(i.add(l),i.add(h),!s.has(l))s.set(l,new Set);if(!s.has(h))s.set(h,new Set);s.get(l).add(h),s.get(h).add(l)}let a=new Set,c=new Map;for(let l of i){if(a.has(l))continue;let h=[],d=[l];a.add(l);while(d.length){let A=d.shift();h.push(A);for(let g of s.get(A)??[])if(!a.has(g))a.add(g),d.push(g)}h.sort((A,g)=>(t.get(A)?.schX??0)-(t.get(g)?.schX??0));let u=new Set(h),_=r.filter((A)=>u.has(A.leftId)&&u.has(A.rightId)),p=new Map;for(let A of h){let g=t.get(A)?.schX??0;for(let{leftId:f,rightId:y,minSep:x}of _)if(y===A&&p.has(f))g=Math.max(g,p.get(f)+x);p.set(A,g)}let m=[...p.entries()].reduce((A,[g,f])=>A+(f-(t.get(g)?.schX??0)),0);if(m>0.000000001){let A=m/h.length,g=new Map;for(let y of h){let x=(t.get(y)?.schX??0)-A;for(let{leftId:C,rightId:b,minSep:I}of _)if(b===y&&g.has(C))x=Math.max(x,g.get(C)+I);g.set(y,x)}let f=(y)=>[...y.entries()].reduce((x,[C,b])=>Math.max(x,Math.abs(b-(t.get(C)?.schX??0))),0);if(f(g)<f(p))for(let[y,x]of g)p.set(y,x)}for(let[A,g]of p){let f=t.get(A);if(!f||Math.abs(g-f.schX)<0.000000001)continue;c.set(A,{componentName:f.sourceComponentName||"component",newSchX:Math.round(g*100)/100,newSchY:Math.round(f.schY*100)/100})}}return c}buildNetLabelsByComponentId(e){let n=[];for(let r of e){if(r.type!=="schematic_port")continue;let i=r;if(!i.schematic_component_id)continue;n.push({componentId:i.schematic_component_id,cx:i.center.x,cy:i.center.y,schematicSheetId:i.schematic_sheet_id})}let o=new Map;for(let r of e){if(r.type!=="schematic_net_label")continue;let i=r;if(!i.anchor_position)continue;let{x:s,y:a}=i.anchor_position,c=n.filter((u)=>u.schematicSheetId===i.schematic_sheet_id&&Math.hypot(u.cx-s,u.cy-a)<0.0001);if(c.length===0)continue;if(new Set(c.map((u)=>u.componentId)).size!==1)continue;let h=c[0].componentId,d=o.get(h)??[];d.push(i),o.set(h,d)}return o}static netLabelCollisionToString(e){let t=e.pairs.map((o,r)=>`pair${r+1}="${o.comp1Name}/${o.comp2Name}"`).join(" "),n=e.moves.map((o)=>`    <Move componentName="${o.componentName}" newSchX="${o.newSchX}" newSchY="${o.newSchY}" />`);return[`<ComponentNetLabelCollision ${t}>`,'  <SuggestedFix note="Apply all moves simultaneously. Set schAutoLayoutEnabled on your circuit.">',...n,"  </SuggestedFix>","</ComponentNetLabelCollision>"].join(`
`)}};var EFe=class e extends po{static ALIGNMENT_EPSILON=0.01;ctx;out;constructor({ctx:t,issues:n}){super();this.ctx=t,this.out=n}_step(){let t=new Map(this.ctx.circuitJson.filter((r)=>r.type==="schematic_port").map((r)=>[r.schematic_port_id,r])),n=new Map(this.ctx.componentPlacements.flatMap((r)=>r.schematicComponentId?[[r.schematicComponentId,r]]:[])),o=new Map;for(let r of this.ctx.circuitJson.filter((i)=>i.type==="schematic_trace")){let i=this.getTracePinPair(r,t);if(!i)continue;let s=i.firstPort.schematic_component_id,a=i.secondPort.schematic_component_id;if(!s||!a||s===a)continue;let c=s<a?i:{firstPort:i.secondPort,secondPort:i.firstPort},l=[s,a].sort().join("\x00"),h=o.get(l)??[];if(!h.some((u)=>u.firstPort.schematic_port_id===c.firstPort.schematic_port_id&&u.secondPort.schematic_port_id===c.secondPort.schematic_port_id))h.push(c);o.set(l,h)}for(let r of o.values()){let i=this.findVerticalShiftIssue(r,n);if(i)this.out.push(i)}this.solved=!0}getTracePinPair(t,n){let o=t.edges?.[0],r=t.edges?.at(-1);if(!o||!r)return;let i=o.from_schematic_port_id??o.to_schematic_port_id,s=r.to_schematic_port_id??r.from_schematic_port_id,a=[...n.values()],c=i?n.get(i):this.findPortAtPoint(a,o.from,t.schematic_sheet_id),l=s?n.get(s):this.findPortAtPoint(a,r.to,t.schematic_sheet_id);if(!c||!l)return;if(c.schematic_port_id===l.schematic_port_id)return;if(c.schematic_sheet_id!==l.schematic_sheet_id)return;return{firstPort:c,secondPort:l}}findPortAtPoint(t,n,o){let{ALIGNMENT_EPSILON:r}=e;return t.find((i)=>i.schematic_sheet_id===o&&Math.abs(i.center.x-n.x)<=r&&Math.abs(i.center.y-n.y)<=r)}findVerticalShiftIssue(t,n){let o=t[0];if(!o)return;let r=n.get(o.firstPort.schematic_component_id),i=n.get(o.secondPort.schematic_component_id);if(!r||!i)return;let[s,a]=r.schX<=i.schX?[r,i]:[i,r],c=t.flatMap((A)=>{let[g,f]=A.firstPort.center.x<=A.secondPort.center.x?[A.firstPort,A.secondPort]:[A.secondPort,A.firstPort];return g.facing_direction==="right"&&f.facing_direction==="left"?[{leftPort:g,rightPort:f}]:[]});if(c.length<2)return;let{ALIGNMENT_EPSILON:l}=e,h=c.filter(({leftPort:A,rightPort:g})=>Math.abs(A.center.y-g.center.y)<=l).length,d=[];for(let A of c){let g=A.leftPort.center.y-A.rightPort.center.y;if(Math.abs(g)<=l)continue;let f=d.find((y)=>Math.abs(y.deltaSchY-g)<=l);if(f)f.pairs.push(A);else d.push({deltaSchY:g,pairs:[A]})}let u=d.sort((A,g)=>g.pairs.length-A.pairs.length||Math.abs(A.deltaSchY)-Math.abs(g.deltaSchY))[0];if(!u||u.pairs.length<2||u.pairs.length<=h)return;let _=a.sourceComponentName||"component",p=u.deltaSchY,m=a.schY+p;return{lineItemType:"ComponentPinsWouldAlignWithVerticalShift",firstComponent:s,secondComponent:a,targetComponent:a,deltaSchY:p,newSchY:m,currentlyAlignedPinCount:h,alignedPinCount:u.pairs.length,alignedPinPairs:u.pairs.map(({leftPort:A,rightPort:g})=>({firstPin:this.getPinLabel(A),secondPin:this.getPinLabel(g)})),message:`shift ${_} vertically by ${d7t(p)} to align ${u.pairs.length} connected pin pairs`}}getPinLabel(t){return t.display_pin_label??t.pin_number?.toString()}static issueToString(t){let n=[];return dn(n,"firstComponentName",t.firstComponent.sourceComponentName),dn(n,"secondComponentName",t.secondComponent.sourceComponentName),dn(n,"targetComponentName",t.targetComponent.sourceComponentName),dn(n,"deltaSchY",t.deltaSchY),dn(n,"newSchY",t.newSchY),dn(n,"currentlyAlignedPinCount",t.currentlyAlignedPinCount),dn(n,"alignedPinCount",t.alignedPinCount),dn(n,"message",t.message),`<ComponentPinsWouldAlignWithVerticalShift ${n.join(" ")} />`}},MFe=class e extends po{static ALIGNMENT_TOLERANCE=0.1;issues;networks;currentNetworkIndex=0;constructor({ctx:t,issues:n}){super();this.issues=n,this.networks=this.findCrystalLoadNetworks(t),this.solved=this.networks.length===0}_step(){let t=this.networks[this.currentNetworkIndex];if(!t){this.solved=!0;return}this.currentNetworkIndex+=1,this.solved=this.currentNetworkIndex>=this.networks.length;let n=Q2e(t.newSchX-t.crystal.schX),o=Q2e(t.newSchY-t.crystal.schY);if(Math.abs(n)<=e.ALIGNMENT_TOLERANCE&&Math.abs(o)<=e.ALIGNMENT_TOLERANCE)return;let r=t.crystal.sourceComponentName??"the crystal",i=t.firstLoadCapacitor.sourceComponentName??"the first load capacitor",s=t.secondLoadCapacitor.sourceComponentName??"the second load capacitor";this.issues.push({lineItemType:"CrystalNotCenteredOverLoadCapacitors",crystalSchematicBox:t.crystal,firstLoadCapacitorSchematicBox:t.firstLoadCapacitor,secondLoadCapacitorSchematicBox:t.secondLoadCapacitor,deltaSchX:n,deltaSchY:o,newSchX:t.newSchX,newSchY:t.newSchY,message:`move ${r} to schX=${t.newSchX}, schY=${t.newSchY} so it is centered between ${i} and ${s} and aligned with their load-side pins`})}findCrystalLoadNetworks(t){let n=new Map,o=new Map,r=new Map,i=new Map(t.componentPlacements.flatMap((c)=>c.sourceComponentId?[[c.sourceComponentId,c]]:[]));for(let c of t.circuitJson){if(c.type==="source_component")n.set(c.source_component_id,{sourceComponentId:c.source_component_id,ftype:"ftype"in c&&typeof c.ftype==="string"?c.ftype:void 0});if(c.type==="source_port"&&typeof c.source_component_id==="string"&&typeof c.subcircuit_connectivity_map_key==="string"){let l={sourcePortId:c.source_port_id,sourceComponentId:c.source_component_id,connectivityKey:c.subcircuit_connectivity_map_key},h=o.get(c.source_component_id)??[];h.push(l),o.set(c.source_component_id,h)}if(c.type==="schematic_port"&&c.source_port_id)r.set(c.source_port_id,c)}let s=new Map;for(let c of n.values()){if(c.ftype!=="simple_capacitor")continue;let l=o.get(c.sourceComponentId)??[];if(l.length!==2)continue;let h=l[0],d=l[1],u=i.get(c.sourceComponentId);if(!u)continue;for(let[_,p]of[[h,d],[d,h]]){let m=r.get(_.sourcePortId);if(!m)continue;let A=s.get(_.connectivityKey)??[];A.push({capacitor:u,loadPort:m,returnConnectivityKey:p.connectivityKey}),s.set(_.connectivityKey,A)}}let a=[];for(let c of n.values()){if(c.ftype!=="simple_crystal"&&c.ftype!=="simple_chip")continue;let l=o.get(c.sourceComponentId)??[];if(l.length!==2||l[0].connectivityKey===l[1].connectivityKey)continue;let h=l[0].connectivityKey,d=l[1].connectivityKey;if(![...o.entries()].some(([x,C])=>x!==c.sourceComponentId&&C.length>2&&C.some((b)=>b.connectivityKey===h)&&C.some((b)=>b.connectivityKey===d)))continue;let _=i.get(c.sourceComponentId);if(!_)continue;let p=s.get(l[0].connectivityKey)??[],m=s.get(l[1].connectivityKey)??[],A=p.flatMap((x)=>m.flatMap((C)=>{if(x.capacitor.sourceComponentId===C.capacitor.sourceComponentId||x.returnConnectivityKey!==C.returnConnectivityKey||x.returnConnectivityKey===h||x.returnConnectivityKey===d||x.capacitor.schematicSheetId!==_.schematicSheetId||C.capacitor.schematicSheetId!==_.schematicSheetId)return[];return[{firstConnection:x,secondConnection:C}]}));if(A.length===0)continue;let g=A.toSorted((x,C)=>v8t(x,_)-v8t(C,_))[0],f=[g.firstConnection.loadPort,g.secondConnection.loadPort],y=[g.firstConnection.capacitor,g.secondConnection.capacitor].toSorted((x,C)=>x.schX-C.schX);a.push({crystal:_,firstLoadCapacitor:y[0],secondLoadCapacitor:y[1],newSchX:Q2e((f[0].center.x+f[1].center.x)/2),newSchY:Q2e((f[0].center.y+f[1].center.y)/2)})}return a}static issueToString(t){let n=[];return dn(n,"crystalName",t.crystalSchematicBox.sourceComponentName),dn(n,"firstLoadCapacitorName",t.firstLoadCapacitorSchematicBox.sourceComponentName),dn(n,"secondLoadCapacitorName",t.secondLoadCapacitorSchematicBox.sourceComponentName),dn(n,"newSchX",t.newSchX),dn(n,"newSchY",t.newSchY),dn(n,"deltaSchX",t.deltaSchX,{formatDelta:!0}),dn(n,"deltaSchY",t.deltaSchY,{formatDelta:!0}),dn(n,"message",t.message),`<CrystalNotCenteredOverLoadCapacitors ${n.join(" ")} />`}},v8t=(e,t)=>S8t(e.firstConnection.capacitor,t)+S8t(e.secondConnection.capacitor,t),S8t=(e,t)=>Math.hypot(e.schX-t.schX,e.schY-t.schY),Q2e=(e)=>Math.round(e*100)/100,wFe=class e extends po{static DIODE_FTYPES=new Set(["simple_led","simple_diode"]);ctx;out;schematicTraces;currentIndex=0;sourceConnectivity;sourceComponentFtypeById;sourceComponentIdBySourcePortId;schematicPorts;schematicBoxBySourceComponentId;constructor({ctx:t,issues:n}){super();this.ctx=t,this.out=n;let{circuitJson:o}=t;this.sourceConnectivity=eS(o),this.sourceComponentFtypeById=this.buildSourceComponentFtypeById(o),this.sourceComponentIdBySourcePortId=this.buildSourceComponentIdBySourcePortId(o),this.schematicPorts=o.filter((r)=>r.type==="schematic_port"),this.schematicBoxBySourceComponentId=this.buildSchematicBoxBySourceComponentId(),this.schematicTraces=o.filter((r)=>r.type==="schematic_trace"),this.solved=this.schematicTraces.length===0}_step(){let t=this.schematicTraces[this.currentIndex];if(!t){this.solved=!0;return}if(this.currentIndex++,this.solved=this.currentIndex>=this.schematicTraces.length,!t.edges||t.edges.length===0)return;let n=t.edges[0],o=t.edges[t.edges.length-1];if(!n||!o)return;let r=n.from,i=o.to,s=t.schematic_sheet_id,a=this.findSourceComponentIdNearPoint(r,s),c=this.findSourceComponentIdNearPoint(i,s);if(!a||!c)return;let l=this.sourceComponentFtypeById.get(a),h=this.sourceComponentFtypeById.get(c),{DIODE_FTYPES:d}=e;if(!(d.has(l)&&h==="simple_resistor"||l==="simple_resistor"&&d.has(h)))return;let _=d.has(l)?a:c,p=l==="simple_resistor"?a:c,m=this.schematicBoxBySourceComponentId.get(_),A=this.schematicBoxBySourceComponentId.get(p);if(!m||!A)return;let g=this.findNearestPort(d.has(l)?r:i,s),f=this.findNearestPort(l==="simple_resistor"?r:i,s);if(!g?.center||!f?.center)return;if(!this.sourceConnectivity.areIdsConnected(g.source_port_id,f.source_port_id))return;let y=m.sourceComponentName||"component",x=A.sourceComponentName||"component",C=g?.display_pin_label??g?.pin_number?.toString(),b=f?.display_pin_label??f?.pin_number?.toString(),I=g?.facing_direction,v=f?.facing_direction,P=C?`${y}.${C}`:y,M=b?`${x}.${b}`:x,B=(T)=>({lineItemType:"DiodeResistorNotAligned",diodeSchematicBox:m,resistorSchematicBox:A,diodePin:C,resistorPin:b,diodePinFacingDirection:I,resistorPinFacingDirection:v,message:T});if(!e.isCoLinear(g.center,f.center)){this.out.push(B(`trace has corners — align ${y} and ${x} on same axis and rotate so ${P} faces ${M}`));return}if(I&&v&&!e.pinsFacingEachOther(g.center,I,f.center,v))this.out.push(B(`${P} and ${M} face away from each other — rotate ${y} so ${P} faces ${M}`))}static isCoLinear(t,n,o=0.01){return Math.abs(t.x-n.x)<o||Math.abs(t.y-n.y)<o}static pinsFacingEachOther(t,n,o,r){let i=o.x-t.x,s=o.y-t.y,a=n==="right"&&i>0||n==="left"&&i<0||n==="up"&&s>0||n==="down"&&s<0,c=r==="right"&&i<0||r==="left"&&i>0||r==="up"&&s<0||r==="down"&&s>0;return a&&c}static dist(t,n){return Math.sqrt((t.x-n.x)**2+(t.y-n.y)**2)}findNearestPort(t,n){let o,r=1/0;for(let i of this.schematicPorts){if(i.schematic_sheet_id!==n)continue;if(!i.center)continue;let s=e.dist(t,i.center);if(s<r)r=s,o=i}return o}findSourceComponentIdNearPoint(t,n){let o=this.findNearestPort(t,n);if(!o||!o.source_port_id)return;return this.sourceComponentIdBySourcePortId.get(o.source_port_id)}buildSourceComponentFtypeById(t){let n=new Map;for(let o of t)if(o.type==="source_component"&&"source_component_id"in o&&"ftype"in o&&typeof o.ftype==="string")n.set(o.source_component_id,o.ftype);return n}buildSourceComponentIdBySourcePortId(t){let n=new Map;for(let o of t)if(o.type==="source_port"&&"source_port_id"in o&&"source_component_id"in o&&typeof o.source_port_id==="string"&&typeof o.source_component_id==="string")n.set(o.source_port_id,o.source_component_id);return n}buildSchematicBoxBySourceComponentId(){let t=new Map;for(let n of this.ctx.componentPlacements)if(n.sourceComponentId)t.set(n.sourceComponentId,n);return t}static issueToString(t){let n=[];return dn(n,"diodeComponentName",t.diodeSchematicBox.sourceComponentName),dn(n,"diodePin",t.diodePin),dn(n,"resistorComponentName",t.resistorSchematicBox.sourceComponentName),dn(n,"resistorPin",t.resistorPin),dn(n,"message",t.message),`<DiodeResistorNotAligned ${n.join(" ")} />`}},BFe=class e extends po{static MIN_BODY_GAP=4;index;amplifierIds;issues;currentIndex=0;constructor({ctx:t,issues:n}){super();this.issues=n,this.index=new Zp(t),this.amplifierIds=[...this.index.components.values()].filter((o)=>o.ftype==="simple_op_amp").map((o)=>o.source_component_id),this.solved=this.amplifierIds.length===0}_step(){let t=this.amplifierIds[this.currentIndex++];if(this.solved=this.currentIndex>=this.amplifierIds.length,!t)return;let n=this.index,o=n.placement(t),r=n.namedPort(t,"output"),i=n.namedPort(t,"inverting_input");if(!o||!r||!i||!n.port(r)||!n.port(i))return;let s=n.connected(r.source_port_id),a=n.connected(i.source_port_id);if(s===a||n.isRail(s)||n.isRail(a))return;if((n.portsByNet.get(a)??[]).some((u)=>u.source_component_id!==t&&n.components.get(u.source_component_id)?.ftype==="simple_op_amp"))return;let c=[],l=new Set;for(let u of n.portsByNet.get(s)??[]){let _=u.source_component_id;if(l.has(_))continue;l.add(_);let p=n.components.get(_);if(p?.ftype!=="simple_resistor"&&p?.ftype!=="simple_capacitor")continue;if(p.ftype==="simple_resistor"&&!(p.resistance>0))continue;let m=n.twoTerminalNets(_);if(!m?.includes(a)||!m.includes(s))continue;let A=n.placement(_);if(!A||!n.sameLocalScope(o,A))return;c.push(A)}let h=c.flatMap((u)=>{let _=_wo(o,u),p=Math.max(e.MIN_BODY_GAP,3*Math.max(u.width,u.height));return _>p?[{schematicBox:u,bodyGap:_,maxRecommendedBodyGap:p}]:[]});if(h.length===0)return;let d=h.map(({schematicBox:u})=>u.sourceComponentName||"component").join(", ");this.issues.push({lineItemType:"FeedbackNetworkNotCompact",amplifierSchematicBox:o,feedbackComponents:c,distantComponents:h,outputSourcePortId:r.source_port_id,invertingInputSourcePortId:i.source_port_id,message:`consider grouping ${d} closer to ${o.sourceComponentName||"component"}, with a compact feedback return path above or below the amplifier`})}static issueToString(t){let n=[];return dn(n,"amplifierName",t.amplifierSchematicBox.sourceComponentName),dn(n,"feedbackComponentNames",t.feedbackComponents.map((o)=>o.sourceComponentName||"component").join(", ")),dn(n,"distantComponentNames",t.distantComponents.map(({schematicBox:o})=>o.sourceComponentName||"component").join(", ")),dn(n,"message",t.message),`<FeedbackNetworkNotCompact ${n.join(" ")} />`}};function _wo(e,t){return Math.hypot(Math.max(0,Math.abs(e.schX-t.schX)-(e.width+t.width)/2),Math.max(0,Math.abs(e.schY-t.schY)-(e.height+t.height)/2))}function p7t(e){let t=[],n=(o)=>{let r=e.portsByComponent.get(o);if(r?.length!==2)return!1;let i=e.port(r[0]),s=e.port(r[1]);return!!i&&!!s&&Math.abs(i.center.y-s.center.y)<0.01&&Math.abs(i.center.x-s.center.x)>0.01};for(let o of e.components.values()){if(o.ftype!=="simple_resistor"||o.resistance<=0)continue;let r=o.source_component_id,i=e.twoTerminalNets(r);if(!i||i.filter((y)=>e.isRail(y)).length!==1)continue;let s=i.find((y)=>e.isRail(y));if(e.powerNets.has(s)&&e.groundNets.has(s))continue;let a=i.find((y)=>y!==s),c=e.portsByNet.get(a)??[],l=c.filter((y)=>{let x=e.components.get(y.source_component_id)?.ftype;return x==="simple_switch"||x==="simple_push_button"});if(l.length!==1||c.filter((y)=>e.components.get(y.source_component_id)?.ftype==="simple_resistor").length!==1)continue;let h=l[0],d=h.source_component_id,u=e.components.get(d)?.ftype,p=e.twoTerminalNets(d)?.find((y)=>y!==a);if(!p)continue;let m=e.powerNets.has(s)?"up":"down";if(m==="up"?!e.groundNets.has(p)||e.powerNets.has(p):!e.powerNets.has(p)||e.groundNets.has(p))continue;if([r,d].some((y)=>e.portsByComponent.get(y)?.some((x)=>x.do_not_connect)))continue;let A=e.placement(r),g=e.placement(d),f=e.port(h);if(!A||!g||!f||!e.sameLocalScope(A,g))continue;t.push({resistor:A,switchBox:g,signalPort:h,signalSchY:f.center.y,pullDirection:m,horizontalPushbutton:u==="simple_push_button"&&n(r)&&n(d)})}return t}function m7t(e){return new Set(p7t(e).flatMap((t)=>t.horizontalPushbutton?[t.resistor.sourceComponentId,t.switchBox.sourceComponentId]:[]))}var TFe=class e extends po{static MIN_WRONG_SIDE_GAP=1.5;index;resistorIds;horizontalPushbuttonComponentIds;issues;currentIndex=0;constructor({ctx:t,issues:n}){super();this.issues=n,this.index=new Zp(t),this.horizontalPushbuttonComponentIds=m7t(this.index),this.resistorIds=[...this.index.components.values()].filter((o)=>o.ftype==="simple_resistor"&&o.resistance>0).map((o)=>o.source_component_id),this.solved=this.resistorIds.length===0}_step(){let t=this.resistorIds[this.currentIndex++];if(this.solved=this.currentIndex>=this.resistorIds.length,!t)return;if(this.horizontalPushbuttonComponentIds.has(t))return;let n=this.index,o=n.placement(t),r=n.twoTerminalNets(t);if(!o||!r)return;let i=r.filter((g)=>n.isRail(g));if(i.length!==1)return;let s=i[0];if(n.powerNets.has(s)&&n.groundNets.has(s))return;let a=n.groundNets.has(s)?"down":"up",c=r.find((g)=>g!==s),l=n.portsByNet.get(c)??[],h=l.filter((g)=>g.needs_external_pullup||g.needs_external_pulldown);if(h.length!==1)return;let d=h[0];if(d.needs_external_pullup&&d.needs_external_pulldown)return;if(a==="up"?!d.needs_external_pullup:!d.needs_external_pulldown)return;let u=n.placement(d.source_component_id),_=n.port(d);if(!u||!_||!n.sameLocalScope(u,o))return;if(l.some((g)=>{let f=g.source_component_id;if(f===t||f===d.source_component_id)return!1;if(n.components.get(f)?.ftype!=="simple_capacitor")return!0;let C=n.twoTerminalNets(f)?.find((I)=>I!==c);if(!C||!n.groundNets.has(C)||n.powerNets.has(C))return!0;let b=n.placement(f);return!b||!n.sameLocalScope(u,b)}))return;let p=_.center.y,m=a==="up"?p-(o.schY+o.height/2):o.schY-o.height/2-p;if(m<=e.MIN_WRONG_SIDE_GAP)return;let A=a==="up"?"above":"below";this.issues.push({lineItemType:"PullResistorOnWrongSide",resistorSchematicBox:o,hostSchematicBox:u,signalSourcePortId:d.source_port_id,signalPinName:d.name,signalSchY:p,pullDirection:a,preferredSide:A,wrongSideGap:m,maxRecommendedWrongSideGap:e.MIN_WRONG_SIDE_GAP,message:`consider placing ${o.sourceComponentName||"component"} ${A} ${u.sourceComponentName||"component"}.${d.name} so the pull-${a} branch reads toward ${a==="up"?"power":"ground"}`})}static issueToString(t){let n=[];return dn(n,"resistorName",t.resistorSchematicBox.sourceComponentName),dn(n,"hostName",t.hostSchematicBox.sourceComponentName),dn(n,"signalPin",t.signalPinName),dn(n,"pullDirection",t.pullDirection),dn(n,"preferredSide",t.preferredSide),dn(n,"signalSchY",t.signalSchY),dn(n,"wrongSideGap",t.wrongSideGap),dn(n,"message",t.message),`<PullResistorOnWrongSide ${n.join(" ")} />`}},_se=class e extends po{static EPSILON=0.01;index;powerNets;groundNets;positiveVoltageNets=new Set;componentIds;horizontalPushbuttonComponentIds;issues;currentIndex=0;constructor({ctx:t,issues:n}){super();this.issues=n,this.index=new Zp(t),this.horizontalPushbuttonComponentIds=m7t(this.index),this.powerNets=new Set(this.index.powerNets),this.groundNets=new Set(this.index.groundNets);for(let o of t.circuitJson){if(o.type==="source_net"&&o.is_positive_voltage_source)this.positiveVoltageNets.add(this.index.connected(o.source_net_id));if(o.type!=="source_port")continue;let r=this.index.connected(o.source_port_id);if(o.provides_power||o.requires_power)this.powerNets.add(r);if(o.provides_ground||o.requires_ground)this.groundNets.add(r)}this.componentIds=[...this.index.components.keys()].filter((o)=>this.index.portsByComponent.get(o)?.length===2),this.solved=this.componentIds.length===0}_step(){let t=this.componentIds[this.currentIndex++];if(this.solved=this.currentIndex>=this.componentIds.length,!t)return;let n=this.index,o=n.placement(t),r=n.components.get(t),i=n.twoTerminalNets(t);if(!o||!i)return;if(r?.ftype==="simple_inductor"&&!i.some((I)=>this.groundNets.has(I)))return;if(r?.ftype==="simple_diode"&&i.every((I)=>this.powerNets.has(I)))return;if(i.some((I)=>this.powerNets.has(I)&&this.groundNets.has(I)))return;let s=i.map((I)=>this.powerNets.has(I)?"power":this.groundNets.has(I)?"ground":void 0);if(s.every((I)=>I===void 0))return;let a=s.includes("power")?"power":"ground",c=i.flatMap((I,v)=>s[v]===a?[{net:I,index:v}]:[]),l=(c.find(({net:I})=>n.portsByNet.get(I)?.some((v)=>a==="power"?v.provides_power:v.provides_ground))??c.find(({net:I})=>(a==="power"?n.powerNets:n.groundNets).has(I))??c[0]).index,h=i[l],d=n.portsByComponent.get(t),u=d.find((I)=>n.connected(I.source_port_id)===h),_=d.find((I)=>I!==u),p=n.port(u),m=n.port(_);if(!p||!m)return;let A=n.connected(_.source_port_id),g=this.groundNets.has(A),f=r?.ftype==="simple_resistor"&&!this.powerNets.has(A)&&!g;if(this.positiveVoltageNets.has(h)&&(g||f)&&Math.abs(p.center.x-m.center.x)<=e.EPSILON&&p.center.y<m.center.y-e.EPSILON&&p.facing_direction==="down"&&m.facing_direction==="up"){this.issues.push({lineItemType:"TwoPinComponentHasInvertedRails",schematicBox:o,railSourcePortId:u.source_port_id,railPinName:u.name,railType:"power",deltaSchRotation:180,suggestedRailFacingDirection:"up",message:`rotate ${o.sourceComponentName||"component"} by 180° so its positive-supply pin faces up and its ${g?"ground":"signal"} pin faces down; preserve pin connections and reroute attached traces`});return}if(!(Math.abs(p.center.y-m.center.y)<=e.EPSILON&&Math.abs(p.center.x-m.center.x)>e.EPSILON&&(p.facing_direction==="left"&&m.facing_direction==="right"||p.facing_direction==="right"&&m.facing_direction==="left")))return;if(this.horizontalPushbuttonComponentIds.has(t))return;let C=a==="power"?"up":"down",b=p.facing_direction==="left"===(a==="power")?-90:90;this.issues.push({lineItemType:"TwoPinComponentShouldBeVertical",schematicBox:o,railSourcePortId:u.source_port_id,railPinName:u.name,railType:a,deltaSchRotation:b,suggestedRailFacingDirection:C,message:`rotate ${o.sourceComponentName||"component"} by ${b}° so its ${a}-connected pin faces ${C} and the component is vertical`})}static issueToString(t){let n=[];return dn(n,"componentName",t.schematicBox.sourceComponentName),dn(n,"railPin",t.railPinName),dn(n,"railType",t.railType),dn(n,"deltaSchRotation",t.deltaSchRotation),dn(n,"suggestedRailFacingDirection",t.suggestedRailFacingDirection),dn(n,"message",t.message),`<${t.lineItemType} ${n.join(" ")} />`}},k2e=0.1,gwo=0.15,Zj=0.02,Awo=0.000000001;function DFe(e,t,n){let o={left:e.schX-e.width/2,right:e.schX+e.width/2,top:e.schY+e.height/2,bottom:e.schY-e.height/2},r=[];for(let i of t){if(!i.side_of_component)continue;if(!i.display_pin_label)continue;let s=n(i),a=gwo/2;switch(i.side_of_component){case"left":{let c=o.left+k2e;r.push({side:i.side_of_component,xMin:c,xMax:c+s,yMin:i.center.y-a,yMax:i.center.y+a});break}case"right":{let c=o.right-k2e;r.push({side:i.side_of_component,xMin:c-s,xMax:c,yMin:i.center.y-a,yMax:i.center.y+a});break}case"top":{let c=o.top-k2e;r.push({side:i.side_of_component,xMin:i.center.x-a,xMax:i.center.x+a,yMin:c-s,yMax:c});break}case"bottom":{let c=o.bottom+k2e;r.push({side:i.side_of_component,xMin:i.center.x-a,xMax:i.center.x+a,yMin:c,yMax:c+s});break}}}return r}function _7t(e,t,n=Zj){return eFe(e.xMin,e.xMax,t.xMin,t.xMax,n)&&eFe(e.yMin,e.yMax,t.yMin,t.yMax,n)}function eFe(e,t,n,o,r=Zj){return Math.min(t,o)-Math.max(e,n)+r>Awo}function NFe(e){return new Set(e.flatMap((t)=>t.type==="schematic_component"&&t.is_box_with_pins!==!1&&!t.symbol_name&&!t.schematic_symbol_id?[t.schematic_component_id]:[]))}var Kj=(e)=>[{x:e.left,y:e.bottom},{x:e.right,y:e.bottom},{x:e.right,y:e.top},{x:e.left,y:e.top}],fwo=(e)=>{if(/\s/.test(e))return 0.28;if(/[ilI.,:;!'|]/.test(e))return 0.25;if(/[MW@%]/.test(e))return 0.9;if(/[mw]/.test(e))return 0.8;if(/[A-Z]/.test(e))return 0.67;return 0.56},z2e=(e)=>Array.from(e).reduce((t,n)=>t+fwo(n),0),ywo=(e,t)=>z2e(e)*t;function tFe(e){let t=e.font_size;if(!Number.isFinite(t)||t<=0||!Number.isFinite(e.rotation)||!Number.isFinite(e.position.x)||!Number.isFinite(e.position.y))return[];let n=e.anchor,o=n.includes("left")?0:n.includes("right")?1:0.5,r=n.includes("top")?0:n.includes("bottom")?t:t/2,i=-e.rotation*Math.PI/180,s=Math.cos(i),a=Math.sin(i);return e.text.split(`
`).flatMap((c,l)=>{let h=c.trim();if(!h)return[];let d=c.length-c.trimStart().length,u=(z2e(c.slice(0,d))-z2e(c)*o)*t;return[Kj({left:u,right:u+z2e(h)*t,top:r-l*t-t*0.05,bottom:r-(l+1)*t+t*0.05}).map(({x:p,y:m})=>({x:e.position.x+p*s-m*a,y:e.position.y+p*a+m*s}))]})}function nFe(e,t){for(let n of[e,t])for(let o=0;o<n.length;o++){let r=n[o],i=n[(o+1)%n.length],s=Math.hypot(i.x-r.x,i.y-r.y);if(s<0.000000001)continue;let a=-(i.y-r.y)/s,c=(i.x-r.x)/s,l=(u)=>u.map(({x:_,y:p})=>_*a+p*c),h=l(e),d=l(t);if(Math.min(Math.max(...h),Math.max(...d))-Math.max(Math.min(...h),Math.min(...d))<=0.000001)return!1}return!0}function oFe(e,t){let n=Math.hypot(t.x-e.x,t.y-e.y);if(n<0.000000001)return;let o=-(t.y-e.y)/n*0.01,r=(t.x-e.x)/n*0.01;return[{x:e.x+o,y:e.y+r},{x:t.x+o,y:t.y+r},{x:t.x-o,y:t.y-r},{x:e.x-o,y:e.y-r}]}function O2e(e,t,n){if(Math.hypot(t.x-e.x,t.y-e.y)<0.000000001)return!1;let o=0,r=1;for(let i=0;i<n.length;i++){let s=n[i],a=n[(i+1)%n.length],c=Math.hypot(a.x-s.x,a.y-s.y);if(c<0.000000001)continue;let l=-(a.y-s.y)/c,h=(a.x-s.x)/c,d=(e.x-s.x)*l+(e.y-s.y)*h-0.000001,u=(t.x-s.x)*l+(t.y-s.y)*h-0.000001;if(d<=0&&u<=0)return!1;if(d<=0)o=Math.max(o,-d/(u-d));if(u<=0)r=Math.min(r,-d/(u-d));if(r<=o)return!1}return r>o}var P8t=(e)=>{let t=e.flat();return{left:Math.min(...t.map((n)=>n.x)),right:Math.max(...t.map((n)=>n.x)),top:Math.max(...t.map((n)=>n.y)),bottom:Math.min(...t.map((n)=>n.y))}},RFe=class extends po{constructor(e){super();this.params=e;let{circuitJson:t,componentPlacements:n}=e.ctx;this.placementById=this.getPlacementBySchematicComponentId(n);let o=NFe(t);this.entries=Array.from(this.getPortsBySchematicComponentId(t)).filter(([r])=>o.has(r)),this.solved=this.entries.length===0}params;entries;placementById;currentIndex=0;_step(){let e=this.entries[this.currentIndex++];if(!e){this.solved=!0;return}this.solved=this.currentIndex>=this.entries.length;let[t,n]=e,o=this.placementById.get(t);if(!o)return;let r=DFe(o,n,(s)=>ywo(s.display_pin_label,0.15));if(r.length===0)return;let i=this.getCollisionSummary(r);if(i.overlappingSides.length===0)return;this.params.issues.push({lineItemType:"SchematicBoxInnerLabelCollision",schematicBox:o,overlappingSides:i.overlappingSides,message:this.getMessage(i.overlappingSides)})}static issueToString(e){let t=[];return dn(t,"message",e.message),dn(t,"componentName",e.schematicBox.sourceComponentName),dn(t,"currentSchWidth",e.schematicBox.width),dn(t,"currentSchHeight",e.schematicBox.height),dn(t,"overlappingSides",e.overlappingSides.join(",")),`<SchematicBoxInnerLabelCollision ${t.join(" ")} />`}getMessage(e){return`Inner labels are colliding. Increase the ${e.every((n)=>n==="left"||n==="right")?"schWidth":e.every((n)=>n==="top"||n==="bottom")?"schHeight":"schWidth or schHeight"}.`}isSchematicPort(e){return e.type==="schematic_port"}isSchematicSide(e){return e==="left"||e==="right"||e==="top"||e==="bottom"}getPlacementBySchematicComponentId(e){return new Map(e.filter((t)=>t.schematicComponentId).map((t)=>[t.schematicComponentId,t]))}getPortsBySchematicComponentId(e){let t=new Map;for(let n of e.filter((o)=>this.isSchematicPort(o))){if(!n.schematic_component_id)continue;if(!this.isSchematicSide(n.side_of_component))continue;let o=t.get(n.schematic_component_id);if(o)o.push(n);else t.set(n.schematic_component_id,[n])}return t}getCollisionSummary(e){let t=new Set;for(let n=0;n<e.length;n++)for(let o=n+1;o<e.length;o++){let r=e[n],i=e[o];if(r.side===i.side)continue;if(!_7t(r,i))continue;t.add(r.side),t.add(i.side)}return{overlappingSides:this.sortSides(Array.from(t))}}sortSides(e){let t={left:0,right:1,top:2,bottom:3};return e.sort((n,o)=>t[n]-t[o])}},QFe=class e extends po{constructor(t){super();this.params=t,this.placements=t.ctx.componentPlacements,this.solved=this.placements.length<2}params;placements;firstIndex=0;secondIndex=1;_step(){if(this.firstIndex>=this.placements.length-1){this.solved=!0;return}let t=this.getComponentOverlap(this.placements[this.firstIndex],this.placements[this.secondIndex]);if(t)this.params.issues.push(t);if(this.secondIndex++,this.secondIndex>=this.placements.length)this.firstIndex++,this.secondIndex=this.firstIndex+1;this.solved=this.firstIndex>=this.placements.length-1}getCenteredRectBounds(t){return{left:t.schX-t.width/2,right:t.schX+t.width/2,top:t.schY-t.height/2,bottom:t.schY+t.height/2}}getOverlapCorrectionSuggestions({firstComponent:t,secondComponent:n,overlapWidth:o,overlapHeight:r}){let i=t.width*t.height,s=n.width*n.height,a=i<=s?t:n,c=a===t?n:t,l=a.schX<=c.schX?-o:o,h=a.schY<=c.schY?-r:r;return[{targetComponentName:a.sourceComponentName,deltaSchX:l,deltaSchY:0,newSchX:a.schX+l,newSchY:a.schY},{targetComponentName:a.sourceComponentName,deltaSchX:0,deltaSchY:h,newSchX:a.schX,newSchY:a.schY+h}]}static issueToString(t){let n=[];return dn(n,"component1Name",t.firstComponent.sourceComponentName),dn(n,"component2Name",t.secondComponent.sourceComponentName),dn(n,"component1SchX",t.firstComponent.schX),dn(n,"component1SchY",t.firstComponent.schY),dn(n,"component2SchX",t.secondComponent.schX),dn(n,"component2SchY",t.secondComponent.schY),dn(n,"overlapWidth",t.overlapWidth),dn(n,"overlapHeight",t.overlapHeight),[`<ComponentOverlap ${n.join(" ")}>`,...t.correctionSuggestions.map(e.correctionSuggestionToString),"</ComponentOverlap>"].join(`
`)}static correctionSuggestionToString(t){let n=[];if(dn(n,"target",t.targetComponentName),t.deltaSchX!==0)dn(n,"newSchX",t.newSchX),dn(n,"deltaSchX",t.deltaSchX,{formatDelta:!0});if(t.deltaSchY!==0)dn(n,"newSchY",t.newSchY),dn(n,"deltaSchY",t.deltaSchY,{formatDelta:!0});return`<OverlapCorrectionSuggestion ${n.join(" ")} />`}getComponentOverlap(t,n){if(t.schematicSheetId!==n.schematicSheetId)return null;let o=this.getCenteredRectBounds(t),r=this.getCenteredRectBounds(n),i=Math.min(o.right,r.right)-Math.max(o.left,r.left),s=Math.min(o.bottom,r.bottom)-Math.max(o.top,r.top);if(i<=0||s<=0)return null;return{lineItemType:"ComponentOverlap",firstComponent:t,secondComponent:n,overlapWidth:i,overlapHeight:s,correctionSuggestions:this.getOverlapCorrectionSuggestions({firstComponent:t,secondComponent:n,overlapWidth:i,overlapHeight:s})}}};function g7t(e,t){let n;for(let o of e){if(o.type!=="schematic_path"&&o.type!=="schematic_circle"&&o.type!=="schematic_rect"||o.schematic_component_id!==t)continue;let r=(o.stroke_width??0.02)/2,i;if(o.type==="schematic_path"){if(!o.points.length)continue;i={xMin:Math.min(...o.points.map((s)=>s.x)),xMax:Math.max(...o.points.map((s)=>s.x)),yMin:Math.min(...o.points.map((s)=>s.y)),yMax:Math.max(...o.points.map((s)=>s.y))}}else{let s=o.type==="schematic_rect"?(o.rotation??0)*Math.PI/180:0,a=o.type==="schematic_circle"?2*o.radius:o.width,c=o.type==="schematic_circle"?2*o.radius:o.height,l=(Math.abs(a*Math.cos(s))+Math.abs(c*Math.sin(s)))/2,h=(Math.abs(a*Math.sin(s))+Math.abs(c*Math.cos(s)))/2;i={xMin:o.center.x-l,xMax:o.center.x+l,yMin:o.center.y-h,yMax:o.center.y+h}}i.xMin-=r,i.xMax+=r,i.yMin-=r,i.yMax+=r,n=n?{xMin:Math.min(n.xMin,i.xMin),xMax:Math.max(n.xMax,i.xMax),yMin:Math.min(n.yMin,i.yMin),yMax:Math.max(n.yMax,i.yMax)}:i}return n}var A7t=0.2,q2e=(e)=>Array.from(e.display_pin_label??"").length*0.095;function f7t(e,t,n,o,r=0,i){if(!Number.isFinite(n)||n<=0)return;if(t.some((m)=>!m.side_of_component))return;if(!M8t(e,t,Zj,i))return;let s=0,a=0;for(let m of t)if(m.side_of_component==="left"||m.side_of_component==="right")a=Math.max(a,2*(Math.abs(m.center.y-e.schY)+n));else s=Math.max(s,2*(Math.abs(m.center.x-e.schX)+n));let c=o.width===void 0?e.width:Math.max(o.width,s,E8t(e,t,"width",i)),l=o.height===void 0?e.height:Math.max(o.height,a,E8t(e,t,"height",i)),h=(m)=>m>0.000000001&&m>=r-0.000000001,d=h(e.width-c)?c:void 0,u=h(e.height-l)?l:void 0;if(d===void 0&&u===void 0)return;let _=[{width:d,height:u}];if(d!==void 0&&u!==void 0)_.push({width:d},{height:u});let p=(m)=>(m.width??e.width)*(m.height??e.height);return _.sort((m,A)=>p(m)-p(A)),_.find((m)=>M8t({...e,width:m.width??e.width,height:m.height??e.height},t,A7t,i))}function E8t(e,t,n,o){let r=e[n],i=n==="width"?e.schX:e.schY,s=n==="width"?"xMin":"yMin",a=n==="width"?"xMax":"yMax",c=n==="width"?"yMin":"xMin",l=n==="width"?"yMax":"xMax",h=(p)=>{if(n==="width")return p.side==="left"?-0.5:p.side==="right"?0.5:0;return p.side==="bottom"?-0.5:p.side==="top"?0.5:0},d=0,u=(p,m,A=0)=>{if(m>0)d=Math.max(d,r+(A-p)/m)},_=DFe(e,t,q2e);if(o)_.push(o);for(let p=0;p<_.length;p++){let m=_[p];u(m[s]-(i-r/2),h(m)+0.5),u(i+r/2-m[a],0.5-h(m));for(let A=p+1;A<_.length;A++){let g=_[A],f=m.side&&g.side&&m.side!==g.side?A7t:Zj;if(!eFe(m[c],m[l],g[c],g[l],f))continue;let[y,x]=m[a]<=g[s]?[m,g]:[g,m];u(x[s]-y[a],h(x)-h(y),f)}}return d}function M8t(e,t,n=Zj,o){if(!Number.isFinite(e.width)||!Number.isFinite(e.height))return!1;let r=DFe(e,t,q2e);if(o)r.push(o);for(let i=0;i<r.length;i++){let s=r[i];if(s.xMin<e.schX-e.width/2-0.000000001||s.xMax>e.schX+e.width/2+0.000000001||s.yMin<e.schY-e.height/2-0.000000001||s.yMax>e.schY+e.height/2+0.000000001)return!1;for(let a=i+1;a<r.length;a++){let c=r[a],l=s.side&&c.side&&s.side!==c.side?n:Zj;if(_7t(s,c,l))return!1}}return!0}var W2e=class extends po{constructor(e){super();this.params=e;let{circuitJson:t,componentPlacements:n}=e.ctx;this.placementById=this.getPlacementBySchematicComponentId(n),this.schematicComponentById=new Map(t.filter((r)=>r.type==="schematic_component").map((r)=>[r.schematic_component_id,r])),this.sourceComponentById=this.getSourceComponentById(t);let o=NFe(t);this.entries=Array.from(this.getPortsBySchematicComponentId(t)).filter(([r])=>o.has(r)),this.solved=this.entries.length===0}params;SCHEMATIC_BOX_TOO_WIDE_MESSAGE="Shrink schematic box width";PIN_HEADER_MAX_ALLOWED_GAP=0.1;GENERIC_MAX_ALLOWED_GAP=1;PIN_LABEL_EDGE_PADDING=0.1;GAP_COMPARISON_EPSILON=0.000000001;entries;placementById;schematicComponentById;sourceComponentById;currentIndex=0;_step(){let e=this.entries[this.currentIndex++];if(!e){this.solved=!0;return}this.solved=this.currentIndex>=this.entries.length;let[t,n]=e,o=this.placementById.get(t);if(!o)return;let r=this.getCenteredRectBounds(o),i=this.getLabelColumn("left",n),s=this.getLabelColumn("right",n),a=this.getSourceComponentFtype(o,this.sourceComponentById),c;if(i&&s)c=this.getInnerLabelEdge(r,s)-this.getInnerLabelEdge(r,i);else if(i&&i.labelCount>=4)c=r.right-this.getInnerLabelEdge(r,i);else if(s&&s.labelCount>=4)c=this.getInnerLabelEdge(r,s)-r.left;if(c===void 0)return;let l=a==="simple_pin_header"?this.PIN_HEADER_MAX_ALLOWED_GAP:this.GENERIC_MAX_ALLOWED_GAP;if(!this.exceedsMaxAllowedGap(c,l))return;let h=this.getSuggestedWidth({measuredInnerLabelHorizontalEmptySpace:c,maxAllowedInnerLabelHorizontalEmptySpace:l,currentWidth:o.width}),d=this.schematicComponentById.get(t)?.pin_spacing;if(d===void 0)return;let u=f7t(o,n,d,{width:h},0,g7t(this.params.ctx.circuitJson,t));if(u?.width===void 0)return;let _=u.width;if(a==="simple_pin_header")this.params.issues.push({lineItemType:"PinHeaderSchematicBoxTooWide",schematicBox:o,measuredInnerLabelHorizontalEmptySpace:c,maxAllowedInnerLabelHorizontalEmptySpace:l,suggestedSchWidth:_,message:this.SCHEMATIC_BOX_TOO_WIDE_MESSAGE});else this.params.issues.push({lineItemType:"GenericSchematicBoxTooWide",schematicBox:o,measuredInnerLabelHorizontalEmptySpace:c,maxAllowedInnerLabelHorizontalEmptySpace:l,suggestedSchWidth:_,message:this.SCHEMATIC_BOX_TOO_WIDE_MESSAGE})}static issueToString(e){let t=[];return dn(t,"message",e.message),dn(t,"componentName",e.schematicBox.sourceComponentName),dn(t,"currentSchWidth",e.schematicBox.width),dn(t,"measuredInnerLabelHorizontalEmptySpace",e.measuredInnerLabelHorizontalEmptySpace),dn(t,"maxAllowedInnerLabelHorizontalEmptySpace",e.maxAllowedInnerLabelHorizontalEmptySpace),dn(t,"suggestedSchWidth",e.suggestedSchWidth),`<${e.lineItemType} ${t.join(" ")} />`}isSchematicPort(e){return e.type==="schematic_port"}getSourceComponentWithFtype(e){if(e.type!=="source_component"||!("source_component_id"in e)||typeof e.source_component_id!=="string")return null;return{type:"source_component",source_component_id:e.source_component_id,ftype:"ftype"in e&&typeof e.ftype==="string"?e.ftype:void 0}}exceedsMaxAllowedGap(e,t){return e-t>this.GAP_COMPARISON_EPSILON}getCenteredRectBounds(e){return{left:e.schX-e.width/2,right:e.schX+e.width/2,top:e.schY+e.height/2,bottom:e.schY-e.height/2}}getSourceComponentById(e){return new Map(e.flatMap((t)=>{let n=this.getSourceComponentWithFtype(t);return n?[n]:[]}).map((t)=>[t.source_component_id,t]))}getPlacementBySchematicComponentId(e){return new Map(e.filter((t)=>t.schematicComponentId).map((t)=>[t.schematicComponentId,t]))}getPortsBySchematicComponentId(e){let t=new Map;for(let n of e.filter((o)=>this.isSchematicPort(o))){if(!n.schematic_component_id)continue;let o=t.get(n.schematic_component_id);if(o)o.push(n);else t.set(n.schematic_component_id,[n])}return t}getSourceComponentFtype(e,t){return e.sourceComponentId?t.get(e.sourceComponentId)?.ftype:void 0}getLabelColumn(e,t){let n=t.filter((o)=>o.side_of_component===e).flatMap((o)=>o.display_pin_label?[q2e(o)]:[]);if(n.length===0)return null;return{side:e,labelCount:n.length,maxLabelWidth:Math.max(...n)}}getInnerLabelEdge(e,t){return t.side==="left"?e.left+this.PIN_LABEL_EDGE_PADDING+t.maxLabelWidth:e.right-this.PIN_LABEL_EDGE_PADDING-t.maxLabelWidth}getSuggestedWidth(e){return e.currentWidth-e.measuredInnerLabelHorizontalEmptySpace+e.maxAllowedInnerLabelHorizontalEmptySpace}},kFe=class extends po{constructor(e){super();this.params=e;let{circuitJson:t,componentPlacements:n}=e.ctx;this.placementById=this.getPlacementBySchematicComponentId(n),this.schematicComponentById=this.getSchematicComponentById(t),this.sourcePortById=this.getSourcePortById(t);let o=NFe(t);this.entries=Array.from(this.getPortsBySchematicComponentId(t)).filter(([r])=>o.has(r)),this.solved=this.entries.length===0}params;MESSAGE="Move schematic pins closer to the box edge or change the schematic box";GAP_COMPARISON_EPSILON=0.000000001;entries;placementById;schematicComponentById;sourcePortById;currentIndex=0;_step(){let e=this.entries[this.currentIndex++];if(!e){this.solved=!0;return}this.solved=this.currentIndex>=this.entries.length;let[t,n]=e,o=this.placementById.get(t);if(!o)return;let r=this.getPinSpacing(o,this.schematicComponentById);if(r===null)return;let i=this.getMaxLabelLengthBySide(n),s=new Map;for(let m of n){if(!this.isSchematicSide(m.side_of_component))continue;let A=s.get(m.side_of_component)??[];A.push(m),s.set(m.side_of_component,A)}let a=[];for(let[m,A]of s){if(A.length===1)continue;for(let g of this.getBoxEdgeSidesForPinSide(m)){let f=this.getOuterPinBySide(g,A);if(!f)continue;let y=this.getPinPaddingToEdge(o,f,g),x=Math.max(r,this.getMaxAllowedPinPadding(r,g,i));if(!this.exceedsMaxAllowedGap(y,x+r))continue;a.push({schematicBox:o,pinSide:m,edgeSide:g,pinName:this.getPinName(f,this.sourcePortById),measuredPadding:y,maxAllowedPadding:x})}}if(!a.length)return;let c=a.map((m)=>this.createIssue(m)),l=c.flatMap((m)=>m.suggestedSchWidth===void 0?[]:[m.suggestedSchWidth]),h=c.flatMap((m)=>m.suggestedSchHeight===void 0?[]:[m.suggestedSchHeight]),d=f7t(o,n,r,{width:l.length?Math.max(...l):void 0,height:h.length?Math.max(...h):void 0},2*r,g7t(this.params.ctx.circuitJson,t));if(!d)return;let u=c.filter((m)=>d.width!==void 0&&m.suggestedSchWidth!==void 0||d.height!==void 0&&m.suggestedSchHeight!==void 0),_=u.reduce((m,A)=>A.excessPadding>m.excessPadding?A:m),p=[d.width===void 0?"":"width",d.height===void 0?"":"height"].filter(Boolean).join(" and ");this.params.issues.push({..._,paddingDetails:u.map(({pinSide:m,edgeSide:A,pinName:g,measuredPadding:f,maxAllowedPadding:y,excessPadding:x})=>({pinSide:m,edgeSide:A,pinName:g,measuredPadding:f,maxAllowedPadding:y,excessPadding:x})),suggestedSchWidth:d.width,suggestedSchHeight:d.height,message:`${this.MESSAGE} ${p}`})}static issueToString(e){let t=[];if(dn(t,"message",e.message),dn(t,"componentName",e.schematicBox.sourceComponentName),e.paddingDetails)dn(t,"pinSides",[...new Set(e.paddingDetails.map((n)=>n.pinSide))].join(",")),dn(t,"edgeSides",[...new Set(e.paddingDetails.map((n)=>n.edgeSide))].join(","));else dn(t,"pinSide",e.pinSide),dn(t,"edgeSide",e.edgeSide),dn(t,"pinName",e.pinName),dn(t,"measuredPadding",e.measuredPadding),dn(t,"maxAllowedPadding",e.maxAllowedPadding),dn(t,"excessPadding",e.excessPadding);return dn(t,"suggestedSchWidth",e.suggestedSchWidth),dn(t,"suggestedSchHeight",e.suggestedSchHeight),`<SchematicPinPaddingToEdgeTooLarge ${t.join(" ")} />`}isSchematicPort(e){return e.type==="schematic_port"}isSourcePort(e){return e.type==="source_port"}isSchematicComponent(e){return e.type==="schematic_component"}isHorizontalSide(e){return e==="left"||e==="right"}isVerticalSide(e){return e==="top"||e==="bottom"}isSchematicSide(e){return this.isHorizontalSide(e)||this.isVerticalSide(e)}exceedsMaxAllowedGap(e,t){return e-t>this.GAP_COMPARISON_EPSILON}getCenteredRectBounds(e){return{left:e.schX-e.width/2,right:e.schX+e.width/2,top:e.schY+e.height/2,bottom:e.schY-e.height/2}}getSourcePortById(e){return new Map(e.filter((t)=>this.isSourcePort(t)).map((t)=>[t.source_port_id,t]))}getSchematicComponentById(e){return new Map(e.filter((t)=>this.isSchematicComponent(t)).map((t)=>[t.schematic_component_id,t]))}getPlacementBySchematicComponentId(e){return new Map(e.filter((t)=>t.schematicComponentId).map((t)=>[t.schematicComponentId,t]))}getPortsBySchematicComponentId(e){let t=new Map;for(let n of e.filter((o)=>this.isSchematicPort(o))){if(!n.schematic_component_id)continue;let o=t.get(n.schematic_component_id);if(o)o.push(n);else t.set(n.schematic_component_id,[n])}return t}getPinSpacing(e,t){if(!e.schematicComponentId)return null;let n=t.get(e.schematicComponentId);return typeof n?.pin_spacing==="number"?n.pin_spacing:null}getPinName(e,t){let n=t.get(e.source_port_id);if(n?.name)return n.name;if(e.display_pin_label)return e.display_pin_label;if(n?.pin_number!==void 0)return String(n.pin_number);return}getMaxLabelLengthBySide(e){let t={left:0,right:0,top:0,bottom:0};for(let n of e){if(!this.isSchematicSide(n.side_of_component))continue;if(!n.display_pin_label)continue;t[n.side_of_component]=Math.max(t[n.side_of_component],q2e(n))}return t}getOuterPinBySide(e,t){if(t.length===0)return null;switch(e){case"top":return t.reduce((n,o)=>o.center.y>n.center.y?o:n);case"bottom":return t.reduce((n,o)=>o.center.y<n.center.y?o:n);case"left":return t.reduce((n,o)=>o.center.x<n.center.x?o:n);case"right":return t.reduce((n,o)=>o.center.x>n.center.x?o:n)}}getPinPaddingToEdge(e,t,n){let o=this.getCenteredRectBounds(e);switch(n){case"top":return Math.max(0,o.top-t.center.y);case"bottom":return Math.max(0,t.center.y-o.bottom);case"left":return Math.max(0,t.center.x-o.left);case"right":return Math.max(0,o.right-t.center.x)}}getBoxEdgeSidesForPinSide(e){return this.isHorizontalSide(e)?["top","bottom"]:["left","right"]}getMaxAllowedPinPadding(e,t,n){let o=this.isHorizontalSide(t)?["left","right"]:["top","bottom"];return(n[o[0]]+n[o[1]]+e)/2}createIssue(e){let t=Math.max(0,e.measuredPadding-e.maxAllowedPadding),n=t*2;return{lineItemType:"SchematicPinPaddingToEdgeTooLarge",pinSide:e.pinSide,edgeSide:e.edgeSide,pinName:e.pinName,schematicBox:e.schematicBox,measuredPadding:e.measuredPadding,maxAllowedPadding:e.maxAllowedPadding,excessPadding:t,suggestedSchWidth:this.isHorizontalSide(e.pinSide)?void 0:Math.max(0,e.schematicBox.width-n),suggestedSchHeight:this.isHorizontalSide(e.pinSide)?Math.max(0,e.schematicBox.height-n):void 0,message:this.isHorizontalSide(e.pinSide)?`${this.MESSAGE} height`:`${this.MESSAGE} width`}}},LFe=(e)=>{let t=new Map;for(let n of e)if(n.type==="schematic_sheet"&&n.name)t.set(n.schematic_sheet_id,n.name);return t},xwo=(e)=>e.type==="schematic_box",w8t=(e)=>e.type==="schematic_component",rFe=(e)=>e.schematic_sheet_id,Cwo=(e,t)=>{if(!t)return;return Ps(e).source_component.get(t)?.name},bwo=(e,t)=>{if(!e.schematic_component_id)return{};let n=Ps(t),o=n.schematic_component.get(e.schematic_component_id);if(!o?.source_component_id)return{};let r=n.source_component.get(o.source_component_id);return{sourceComponentId:o.source_component_id,sourceComponentName:r?.name}},Iwo=(e,t,n,o)=>{let r=rFe(e);if(r===void 0&&o)r=rFe(o);let i;if(r)i=n.get(r);let s={lineItemType:"SchematicBoxPlacement",positionAnchor:"center",schX:e.center.x,schY:e.center.y,width:o?.width??e.size.width,height:o?.height??e.size.height,sourceComponentId:e.source_component_id,sourceComponentName:Cwo(t,e.source_component_id),schematicComponentId:e.schematic_component_id,schematicSymbolId:o?.schematic_symbol_id??e.schematic_symbol_id,subcircuitId:e.subcircuit_id??o?.subcircuit_id};if(r)s.schematicSheetId=r;if(i)s.schematicSheetName=i;return s},vwo=(e,t,n)=>{let o=rFe(e),r;if(o)r=n.get(o);let i={lineItemType:"SchematicBoxPlacement",positionAnchor:"center",schX:e.x+e.width/2,schY:e.y+e.height/2,width:e.width,height:e.height,...bwo(e,t),schematicComponentId:e.schematic_component_id,schematicSymbolId:e.schematic_symbol_id,subcircuitId:e.subcircuit_id};if(o)i.schematicSheetId=o;if(r)i.schematicSheetName=r;return i},Swo=(e)=>{let t=e.filter(xwo).filter((i)=>i.schematic_component_id||i.schematic_symbol_id),n=LFe(e),o=new Set(e.filter(w8t).map((i)=>i.schematic_component_id)),r=[...e.filter(w8t).map((i)=>Iwo(i,e,n,t.find((s)=>s.schematic_component_id===i.schematic_component_id))),...t.filter((i)=>!i.schematic_component_id||!o.has(i.schematic_component_id)).map((i)=>vwo(i,e,n))];return{circuitJson:e,componentPlacements:r}},y7t=class extends po{constructor(e){super();this.params=e}params;_step(){let e=new Zp(this.params.ctx);for(let t of p7t(e)){let{resistor:n,switchBox:o,signalPort:r,signalSchY:i,pullDirection:s}=t;if(t.horizontalPushbutton)continue;let a=e.connected(r.source_port_id);if(e.portsByNet.get(a)?.length!==2)continue;if(r.needs_external_pullup||r.needs_external_pulldown)continue;let c=s==="up"?i-(n.schY+n.height/2):n.schY-n.height/2-i;if(c<=1.5)continue;let l=s==="up"?"above":"below";this.params.issues.push({lineItemType:"PullResistorOnWrongSide",resistorSchematicBox:n,hostSchematicBox:o,signalSourcePortId:r.source_port_id,signalPinName:r.name,signalSchY:i,pullDirection:s,preferredSide:l,wrongSideGap:c,maxRecommendedWrongSideGap:1.5,message:`place ${n.sourceComponentName} ${l} ${o.sourceComponentName} so the pull-${s} branch reads toward ${s==="up"?"power":"ground"}`})}this.solved=!0}};function x7t(e,t){let n=e.find((c)=>c.type==="source_trace"&&c.source_trace_id===t.source_trace_id);if(n?.type==="source_trace"&&n.name)return n.name;let o=t.edges[0],r=t.edges.at(-1),i=(c,l)=>{let h=e.filter((g)=>g.type==="schematic_port"&&g.schematic_sheet_id===t.schematic_sheet_id&&(l?g.schematic_port_id===l:Math.hypot(g.center.x-c.x,g.center.y-c.y)<=0.01));if(h.length!==1||h[0]?.type!=="schematic_port")return;let d=h[0],u=e.find((g)=>g.type==="source_port"&&g.source_port_id===d.source_port_id),_=e.find((g)=>g.type==="schematic_component"&&g.schematic_component_id===d.schematic_component_id),p=u?.type==="source_port"?u.source_component_id:_?.type==="schematic_component"?_.source_component_id:void 0,m=e.find((g)=>g.type==="source_component"&&g.source_component_id===p);if(m?.type!=="source_component"||!m.name)return;let A=u?.type==="source_port"&&u.name?u.name:d.pin_number!==void 0?`pin${d.pin_number}`:d.display_pin_label;return A?`${m.name}.${A}`:m.name},s=o&&i(o.from,o.from_schematic_port_id),a=r&&i(r.to,r.to_schematic_port_id);if(s&&a)return`${s} to ${a}`;return n?.type==="source_trace"&&n.display_name||s||a||"trace"}var Pwo=(e,t,n)=>{let o=[{x:e.x,y:e.y}],r=(e.x+t.x)/2,i=(e.y+t.y)/2,s={x:t.x,y:t.y};switch(t.facingDirection){case"x+":s.x+=n;break;case"x-":s.x-=n;break;case"y+":s.y+=n;break;case"y-":s.y-=n;break}let a=e.facingDirection??"none",c=t.facingDirection??"none",l=(u)=>{let _=o[o.length-1];if(_.x!==u.x||_.y!==u.y)o.push(u)},h=Math.abs(e.y-t.y)<=Math.max(0.000001,n*0.1),d=Math.abs(e.x-t.x)<=Math.max(0.000001,n*0.1);if(a==="none"&&c==="none")globalThis.__DEBUG_CALCULATE_ELBOW_CASE=1,l({x:r,y:e.y}),l({x:r,y:t.y});else if(a==="x+"&&c==="y+")if(globalThis.__DEBUG_CALCULATE_ELBOW_CASE=2,e.x>t.x&&e.y<t.y)globalThis.__DEBUG_CALCULATE_ELBOW_CASE=2.1,l({x:e.x+n,y:e.y}),l({x:e.x+n,y:t.y+n}),l({x:t.x,y:t.y+n});else if(!d&&!h&&e.x<t.x&&e.y>t.y)globalThis.__DEBUG_CALCULATE_ELBOW_CASE=2.2,l({x:t.x,y:e.y});else if(d)globalThis.__DEBUG_CALCULATE_ELBOW_CASE=2.3,l({x:e.x+n,y:e.y}),l({x:e.x+n,y:t.y+n}),l({x:t.x,y:t.y+n});else if(e.x<t.x)globalThis.__DEBUG_CALCULATE_ELBOW_CASE=2.4,l({x:r,y:e.y}),l({x:r,y:s.y}),l({x:t.x,y:s.y});else if(e.y<=t.y+n)globalThis.__DEBUG_CALCULATE_ELBOW_CASE=2.5,l({x:e.x+n,y:e.y}),l({x:e.x+n,y:e.y+n}),l({x:t.x,y:e.y+n}),l({x:t.x,y:t.y});else globalThis.__DEBUG_CALCULATE_ELBOW_CASE=2.6,l({x:e.x+n,y:e.y}),l({x:e.x+n,y:(e.y+t.y)/2}),l({x:t.x,y:(e.y+t.y)/2});else if(a==="x+"&&c==="x+"&&!h){globalThis.__DEBUG_CALCULATE_ELBOW_CASE=3;let u=Math.max(e.x+n,s.x);l({x:u,y:e.y}),l({x:u,y:t.y})}else if(a==="x+"&&c==="x+"&&h)globalThis.__DEBUG_CALCULATE_ELBOW_CASE=3.1,l({x:e.x+n,y:e.y}),l({x:e.x+n,y:e.y+n}),l({x:t.x+n,y:e.y+n}),l({x:t.x+n,y:t.y});else if(a==="x+"&&c==="y-")if(d&&e.y<=t.y)globalThis.__DEBUG_CALCULATE_ELBOW_CASE=4.11,l({x:e.x+n,y:e.y}),l({x:e.x+n,y:i}),l({x:t.x,y:i});else if(d&&e.y>t.y)globalThis.__DEBUG_CALCULATE_ELBOW_CASE=4.12,l({x:e.x+n,y:e.y}),l({x:e.x+n,y:t.y-n}),l({x:t.x,y:t.y-n});else if(e.x<t.x&&e.y<t.y)globalThis.__DEBUG_CALCULATE_ELBOW_CASE=4.2,l({x:t.x,y:e.y});else if(e.x>t.x&&e.y<t.y){globalThis.__DEBUG_CALCULATE_ELBOW_CASE=4.3;let u=e.x+n;l({x:u,y:e.y}),l({x:u,y:i}),l({x:t.x,y:i})}else if(e.x>t.x&&e.y>t.y){globalThis.__DEBUG_CALCULATE_ELBOW_CASE=4.4;let u=e.x+n;l({x:u,y:e.y}),l({x:u,y:s.y}),l({x:t.x,y:s.y})}else if(e.y===t.y)globalThis.__DEBUG_CALCULATE_ELBOW_CASE=4.5,l({x:e.x+n,y:e.y}),l({x:e.x+n,y:e.y-n}),l({x:t.x,y:e.y-n});else globalThis.__DEBUG_CALCULATE_ELBOW_CASE=4.6,l({x:r,y:e.y}),l({x:r,y:s.y}),l({x:t.x,y:s.y});else if(a==="x+"&&c==="x-"&&e.x+n>=t.x-n&&!h){globalThis.__DEBUG_CALCULATE_ELBOW_CASE=5;let u=e.x+n;l({x:u,y:e.y}),l({x:u,y:i}),l({x:s.x,y:i}),l({x:s.x,y:s.y})}else if(a==="x+"&&c==="x-"&&h&&t.x>e.x);else if(a==="x+"&&c==="x-"&&h)globalThis.__DEBUG_CALCULATE_ELBOW_CASE=7,l({x:e.x+n,y:e.y}),l({x:e.x+n,y:e.y+n}),l({x:t.x-n,y:e.y+n}),l({x:t.x-n,y:e.y});else{if(globalThis.__DEBUG_CALCULATE_ELBOW_CASE=8,a==="x+")l({x:e.x+n,y:e.y});l({x:r,y:o[o.length-1].y}),l({x:r,y:s.y}),l({x:s.x,y:s.y})}return l({x:t.x,y:t.y}),o},B8t=(e,t,n={})=>{let o=e,r=t,i=!1;if(o.x>r.x||o.x===r.x&&o.y>r.y)i=!0,[o,r]=[r,o];let s=o.facingDirection==="x-",a=o.facingDirection==="y-",c=(f)=>{let y=s?o.x-(f.x-o.x):f.x,x=a?o.y-(f.y-o.y):f.y,C=f.facingDirection;if(s){if(C==="x+")C="x-";else if(C==="x-")C="x+"}if(a){if(C==="y+")C="y-";else if(C==="y-")C="y+"}return{x:y,y:x,facingDirection:C}},l=(f,y)=>{let x=f.x-y.x,C=f.y-y.y,b=y.x+C,I=y.y-x,v=f.facingDirection;switch(v){case"x+":v="y-";break;case"y-":v="x-";break;case"x-":v="y+";break;case"y+":v="x+";break}return{x:b,y:I,facingDirection:v}},h=(f,y)=>{let x=f.x-y.x,C=f.y-y.y;return{x:y.x-C,y:y.y+x}},d=s||a?c(o):o,u=s||a?c(r):r,_=d,p=u,m=!1;if(d.facingDirection==="y+")m=!0,_={...d,facingDirection:"x+"},p=l(u,d);let A=n?.overshoot??0.1*Math.max(Math.abs(_.x-p.x),Math.abs(_.y-p.y)),g=Pwo(_,p,A);if(m)g=g.map((f)=>h(f,_));if(s||a)g=g.map(({x:f,y})=>({x:s?o.x-(f-o.x):f,y:a?o.y-(y-o.y):y}));return i?g.reverse():g},HFe=class e extends po{static EPSILON=0.01;ctx;out;constructor({ctx:t,issues:n}){super();this.ctx=t,this.out=n}_step(){let t=this.ctx.circuitJson.filter((i)=>i.type==="schematic_port"),n=new Map(t.map((i)=>[i.schematic_port_id,i])),o=new Map(this.ctx.componentPlacements.flatMap((i)=>i.schematicComponentId?[[i.schematicComponentId,i]]:[])),r=new Set;for(let i of this.ctx.circuitJson.filter((s)=>s.type==="schematic_trace")){let s=this.getTracePoints(i),a=this.countTurns(s);if(a!==3)continue;let c=[this.getCandidate({trace:i,points:s,atStart:!0,currentTurnCount:a,ports:t,portsById:n,placementsByComponentId:o}),this.getCandidate({trace:i,points:s,atStart:!1,currentTurnCount:a,ports:t,portsById:n,placementsByComponentId:o})].filter((h)=>Boolean(h));for(let h of[...c]){if(!h.target.sourceComponentName?.startsWith("U"))continue;for(let d of[s[0],s.at(-1)]){let u=this.findPortAtPoint(t,d,i.schematic_sheet_id),_=u?.schematic_component_id?o.get(u.schematic_component_id):void 0;if(!_||!/^[CR]/.test(_.sourceComponentName??""))continue;c.push({target:_,deltaSchX:-h.deltaSchX,deltaSchY:-h.deltaSchY,currentTurnCount:a,suggestedTurnCount:h.suggestedTurnCount})}}let l=(h)=>/^[CR]/.test(h.target.sourceComponentName??"")?0:h.target.sourceComponentName?.startsWith("U")?2:1;c.sort((h,d)=>l(h)-l(d));for(let h of c){if(this.wouldOverlapAnotherComponent(h))continue;if(!this.validateMove(i,h,t))continue;let d=[h.target.schematicComponentId,h.deltaSchX.toFixed(3),h.deltaSchY.toFixed(3)].join("\x00");if(r.has(d))break;r.add(d),this.out.push(this.makeIssue(i,h));break}}this.solved=!0}getCandidate({trace:t,points:n,atStart:o,currentTurnCount:r,ports:i,portsById:s,placementsByComponentId:a}){if(n.length<4)return;let c=o?0:n.length-1,l=o?1:n.length-2,h=o?2:n.length-3,d=o?3:n.length-4,u=n[c],_=n[l],p=n[h],m=n[d],A=o?t.edges[0]:t.edges.at(-1);if(!A)return;let g=o?A.from_schematic_port_id:A.to_schematic_port_id,f=g?s.get(g):this.findPortAtPoint(i,u,t.schematic_sheet_id);if(!f?.schematic_component_id||!f.facing_direction)return;let y=this.getAxis(u,_),x=this.getAxis(_,p),C=this.getAxis(p,m),b=f.facing_direction==="left"||f.facing_direction==="right"?"horizontal":"vertical";if(!y||!x||!C)return;if(y!==b||x===b||C!==b)return;if(!this.isPointInFacingDirection(u,_,f.facing_direction)||!this.isPointInFacingDirection(p,m,f.facing_direction))return;let I=a.get(f.schematic_component_id);if(!I)return;let v=p.x-_.x,P=p.y-_.y;if(Math.abs(v)<=e.EPSILON&&Math.abs(P)<=e.EPSILON)return;let M={x:u.x+v,y:u.y+P},B=o?[M,...n.slice(2)]:[...n.slice(0,-2),M],T=this.countTurns(B);if(T===void 0||T!==1||T>=r)return;return{target:I,deltaSchX:v,deltaSchY:P,currentTurnCount:r,suggestedTurnCount:T}}validateMove(t,n,o){let r=n.target.schematicComponentId,i=n.target.schematicSheetId,s=o.filter((x)=>x.schematic_sheet_id===i),a=s.filter((x)=>x.schematic_component_id===r),c=this.ctx.circuitJson.filter((x)=>x.type==="schematic_trace"&&x.schematic_sheet_id===i),l=(x,C)=>x.edges.some((b)=>b.from_schematic_port_id===C.schematic_port_id||b.to_schematic_port_id===C.schematic_port_id||this.pointsEqual(b.from,C.center)||this.pointsEqual(b.to,C.center)),h=c.filter((x)=>a.some((C)=>l(x,C)));if(!h.includes(t))return!1;if(this.ctx.circuitJson.some((x)=>x.type==="schematic_net_label"&&x.schematic_sheet_id===i&&a.some((C)=>this.pointsEqual(x.anchor_position??x.center,C.center))))return!1;let d=(x)=>({x:x.x+n.deltaSchX,y:x.y+n.deltaSchY}),u={left:"x-",right:"x+",up:"y+",down:"y-"},_=(x,C)=>({...C&&x.schematic_component_id===r?d(x.center):x.center,facingDirection:u[x.facing_direction]}),p=(x)=>x.slice(1).reduce((C,b,I)=>C+Math.abs(b.x-x[I].x)+Math.abs(b.y-x[I].y),0),m=(x)=>x.slice(1).map((C,b)=>({from:x[b],to:C})),A=Tw(n.target.schX+n.deltaSchX,n.target.schY+n.deltaSchY,n.target.width,n.target.height),g=c.filter((x)=>!h.includes(x));if(g.some((x)=>x.edges.some((C)=>O2e(C.from,C.to,Kj(A)))))return!1;let f=this.ctx.circuitJson.flatMap((x)=>{if(x.type==="schematic_net_label"&&x.schematic_sheet_id===i)return[Kj(F2e(x))];if(x.type!=="schematic_text"||x.schematic_sheet_id!==i)return[];return tFe(x.schematic_component_id===r?{...x,position:d(x.position)}:x)});if(f.some((x)=>nFe(x,Kj(A))))return!1;let y=[];for(let x of h){let C=this.getTracePoints(x);if(C.length<2||x.junctions?.length)return!1;let b=(N,D)=>{let L=s.filter((H)=>D?H.schematic_port_id===D:this.pointsEqual(H.center,N));return L.length===1&&this.pointsEqual(L[0].center,N)?L[0]:void 0},I=b(C[0],x.edges[0].from_schematic_port_id),v=b(C.at(-1),x.edges.at(-1).to_schematic_port_id);if(!I?.facing_direction||!v?.facing_direction)return!1;if(a.some((N)=>l(x,N)&&N!==I&&N!==v))return!1;let P=(N)=>!this.pointsEqual(N,I.center)&&!this.pointsEqual(N,v.center)&&m(C).some(({from:D,to:L})=>Math.abs(Math.hypot(N.x-D.x,N.y-D.y)+Math.hypot(N.x-L.x,N.y-L.y)-Math.hypot(L.x-D.x,L.y-D.y))<0.000001);if(c.some((N)=>N!==x&&N.edges.some((D)=>P(D.from)||P(D.to))))return!1;if(this.ctx.circuitJson.some((N)=>N.type==="schematic_net_label"&&N.schematic_sheet_id===i&&P(N.anchor_position??N.center)))return!1;let M=B8t(_(I,!0),_(v,!0)).filter((N,D,L)=>D===0||!this.pointsEqual(N,L[D-1])),B=this.countTurns(M),T=this.countTurns(C);if(M.length<2||B===void 0||T===void 0||B>T||p(M)>p(C)+0.000001)return!1;if(!this.isPointInFacingDirection(M[0],M[1],I.facing_direction)||!this.isPointInFacingDirection(M.at(-1),M.at(-2),v.facing_direction))return!1;if(x===t){let N=this.countTurns(B8t(_(I,!1),_(v,!1)));if(B>=T||N===void 0||B>=N)return!1;n.suggestedTurnCount=B}for(let N of m(M)){if(f.some((H)=>O2e(N.from,N.to,H)))return!1;if(this.ctx.componentPlacements.some((H)=>{if(H.schematicSheetId!==i)return!1;let V=H.schematicComponentId===r?A:Tw(H.schX,H.schY,H.width,H.height);return O2e(N.from,N.to,Kj(V))}))return!1;let D=oFe(N.from,N.to);if(!D)continue;if([...g.flatMap((H)=>H.edges),...y.flatMap((H)=>m(H.points))].some((H)=>{if([I,v].some((O)=>O.schematic_component_id!==r&&[N.from,N.to].some((U)=>this.pointsEqual(U,O.center))&&[H.from,H.to].some((U)=>this.pointsEqual(U,O.center)))&&this.getAxis(N.from,N.to)!==this.getAxis(H.from,H.to))return!1;let V=oFe(H.from,H.to);return V&&nFe(D,V)}))return!1}y.push({schematicTraceId:x.schematic_trace_id,points:M})}return n.suggestedTraces=y,!0}getTracePoints(t){let n=t.edges[0];if(!n)return[];let o=[n.from];for(let r of t.edges){let i=o.at(-1);if(!this.pointsEqual(i,r.from))return[];o.push(r.to)}return o}countTurns(t){let n=[];for(let[o,r]of t.slice(1).entries()){let i=t[o];if(this.pointsEqual(i,r))continue;let s=this.getAxis(i,r);if(!s)return;n.push(s)}return n.slice(1).filter((o,r)=>o!==n[r]).length}pointsEqual(t,n){let{EPSILON:o}=e;return Math.abs(t.x-n.x)<=o&&Math.abs(t.y-n.y)<=o}getAxis(t,n){let o=Math.abs(n.x-t.x),r=Math.abs(n.y-t.y),{EPSILON:i}=e;if(o<=i&&r>i)return"vertical";if(r<=i&&o>i)return"horizontal";return}isPointInFacingDirection(t,n,o){let{EPSILON:r}=e;switch(o){case"left":return n.x<t.x-r;case"right":return n.x>t.x+r;case"up":return n.y>t.y+r;case"down":return n.y<t.y-r}}findPortAtPoint(t,n,o){let{EPSILON:r}=e;return t.find((i)=>i.schematic_sheet_id===o&&Math.abs(i.center.x-n.x)<=r&&Math.abs(i.center.y-n.y)<=r)}wouldOverlapAnotherComponent(t){let n=Tw(t.target.schX+t.deltaSchX,t.target.schY+t.deltaSchY,t.target.width,t.target.height);return this.ctx.componentPlacements.some((o)=>{if(o===t.target)return!1;if(o.schematicSheetId!==t.target.schematicSheetId)return!1;return Boolean(U2e(n,Tw(o.schX,o.schY,o.width,o.height)))})}makeIssue(t,n){let o=n.target.sourceComponentName||"component",r=this.getMoveDirection(n.deltaSchX,n.deltaSchY),i=Math.abs(n.deltaSchX||n.deltaSchY),s=n.target.schX+n.deltaSchX,a=n.target.schY+n.deltaSchY;return{lineItemType:"TraceCanBeSimplifiedByMovingComponent",schematicTraceId:t.schematic_trace_id,traceName:x7t(this.ctx.circuitJson,t),targetComponent:n.target,deltaSchX:n.deltaSchX,deltaSchY:n.deltaSchY,newSchX:s,newSchY:a,currentTurnCount:n.currentTurnCount,suggestedTurnCount:n.suggestedTurnCount,suggestedTraces:n.suggestedTraces,message:`move ${o} ${r} by ${use(i)} (to schX=${use(s)}, schY=${use(a)}) to reduce this trace from ${n.currentTurnCount} turns to ${n.suggestedTurnCount}`}}getMoveDirection(t,n){if(Math.abs(t)>e.EPSILON)return t>0?"right":"left";return n>0?"up":"down"}static issueToString(t){let n=[];return dn(n,"traceName",t.traceName),dn(n,"targetComponentName",t.targetComponent.sourceComponentName),dn(n,"deltaSchX",t.deltaSchX,{formatDelta:!0}),dn(n,"deltaSchY",t.deltaSchY,{formatDelta:!0}),dn(n,"newSchX",t.newSchX),dn(n,"newSchY",t.newSchY),dn(n,"currentTurnCount",t.currentTurnCount),dn(n,"suggestedTurnCount",t.suggestedTurnCount),dn(n,"message",t.message),`<TraceCanBeSimplifiedByMovingComponent ${n.join(" ")} />`}};function Ewo(e){let t=new Set,n=new Map;for(let i of e){if(i.type!=="source_net"&&i.type!=="source_port")continue;let s=i.type==="source_net"?i.source_net_id:i.source_port_id;if(i.type==="source_net"?i.is_power||i.is_ground||i.is_positive_voltage_source:i.provides_power||i.requires_power||i.provides_ground||i.requires_ground)t.add(s);let c=i.subcircuit_connectivity_map_key;if(c!==void 0){let l=n.get(c)??[];l.push(s),n.set(c,l)}}let o=eS(e),r=Mw([...Object.values(o.netMap),...n.values()]);for(let i of Object.values(r))if(i.some((s)=>t.has(s)))for(let s of i)t.add(s);return t}var FFe=class e extends po{static EPSILON=0.01;ctx;out;powerOrGroundConnectionIds;constructor({ctx:t,issues:n}){super();this.ctx=t,this.out=n,this.powerOrGroundConnectionIds=Ewo(t.circuitJson)}_step(){let t=this.ctx.circuitJson.filter((s)=>s.type==="schematic_port"),n=new Map(t.map((s)=>[s.schematic_port_id,s])),o=new Map;for(let s of t){if(!s.schematic_component_id)continue;let a=o.get(s.schematic_component_id)??[];a.push(s),o.set(s.schematic_component_id,a)}let r=new Map(this.ctx.componentPlacements.flatMap((s)=>s.schematicComponentId?[[s.schematicComponentId,s]]:[])),i=new Map;for(let s of this.ctx.circuitJson.filter((a)=>a.type==="schematic_trace")){let a=this.getTracePoints(s),c=this.countTurns(a);if(c===void 0||c<2)continue;let l=this.getTraceEndpoints(s,a,t,n);if(!l)continue;for(let[h,d]of[l,[l[1],l[0]]]){let u=this.getFlipCandidate({trace:s,targetEndpoint:h,connectedEndpoint:d,currentTurnCount:c,portsByComponentId:o,placementsByComponentId:r});if(!u)continue;let _=u.targetPort.schematic_component_id,p=i.get(_);if(!p||this.isBetterCandidate(u,p))i.set(_,u)}}for(let s of i.values())this.out.push(this.makeIssue(s));this.solved=!0}getFlipCandidate({trace:t,targetEndpoint:n,connectedEndpoint:o,currentTurnCount:r,portsByComponentId:i,placementsByComponentId:s}){let a=n.port,c=o.port,l=a.schematic_component_id,h=c.schematic_component_id;if(!l||!h||l===h||a.schematic_sheet_id!==c.schematic_sheet_id)return;let d=i.get(l);if(d?.length!==2)return;if(d.some((x)=>x.source_port_id&&this.powerOrGroundConnectionIds.has(x.source_port_id)))return;if((i.get(h)??[]).length<=2)return;let _=d.find((x)=>x.schematic_port_id!==a.schematic_port_id);if(!_||!this.areOppositePorts(a,_))return;let p=a.facing_direction,m=_.facing_direction;if(!p||!m)return;if(!this.traceLeavesPortInFacingDirection(n))return;let A=c.center;if(this.isPointInFacingDirection(a.center,A,p)||!this.isPointInFacingDirection(_.center,A,m)||!c.facing_direction||!this.isPointInFacingDirection(A,_.center,c.facing_direction))return;let g=this.getMinimumTurnCount(_.center,A,m);if(g>=r)return;let f=s.get(l),y=s.get(h);if(!f||!y)return;return{trace:t,targetPort:a,targetPlacement:f,connectedPlacement:y,suggestedFacingDirection:m,currentTurnCount:r,suggestedTurnCount:g,traceLength:this.getTraceLength(n.pointsFromEndpoint)}}getTraceEndpoints(t,n,o,r){let i=t.edges[0],s=t.edges.at(-1);if(!i||!s||n.length<2)return;let a=i.from_schematic_port_id?r.get(i.from_schematic_port_id):this.findPortAtPoint(o,n[0],t.schematic_sheet_id),c=s.to_schematic_port_id?r.get(s.to_schematic_port_id):this.findPortAtPoint(o,n.at(-1),t.schematic_sheet_id);if(!a||!c)return;return[{port:a,pointsFromEndpoint:n},{port:c,pointsFromEndpoint:[...n].reverse()}]}getTracePoints(t){let n=t.edges[0];if(!n)return[];let o=[n.from];for(let r of t.edges){if(!this.pointsEqual(o.at(-1),r.from))return[];o.push(r.to)}return o}countTurns(t){let n=[];for(let[o,r]of t.slice(1).entries()){let i=t[o];if(this.pointsEqual(i,r))continue;let s=this.getAxis(i,r);if(!s)return;if(n.at(-1)!==s)n.push(s)}return Math.max(0,n.length-1)}traceLeavesPortInFacingDirection(t){let n=t.pointsFromEndpoint.find((o)=>!this.pointsEqual(o,t.port.center));return Boolean(n&&t.port.facing_direction&&this.isPointInFacingDirection(t.port.center,n,t.port.facing_direction))}areOppositePorts(t,n){let o=(t.facing_direction==="left"&&n.facing_direction==="right"||t.facing_direction==="right"&&n.facing_direction==="left")&&Math.abs(t.center.y-n.center.y)<=e.EPSILON,r=(t.facing_direction==="up"&&n.facing_direction==="down"||t.facing_direction==="down"&&n.facing_direction==="up")&&Math.abs(t.center.x-n.center.x)<=e.EPSILON;return o||r}getMinimumTurnCount(t,n,o){return(o==="left"||o==="right"?Math.abs(t.y-n.y)<=e.EPSILON:Math.abs(t.x-n.x)<=e.EPSILON)?0:1}isPointInFacingDirection(t,n,o){let{EPSILON:r}=e;switch(o){case"left":return n.x<t.x-r;case"right":return n.x>t.x+r;case"up":return n.y>t.y+r;case"down":return n.y<t.y-r}}getAxis(t,n){let o=Math.abs(t.x-n.x),r=Math.abs(t.y-n.y),{EPSILON:i}=e;if(o<=i&&r>i)return"vertical";if(r<=i&&o>i)return"horizontal";return}pointsEqual(t,n){let{EPSILON:o}=e;return Math.abs(t.x-n.x)<=o&&Math.abs(t.y-n.y)<=o}findPortAtPoint(t,n,o){return t.find((r)=>r.schematic_sheet_id===o&&this.pointsEqual(r.center,n))}getTraceLength(t){return t.slice(1).reduce((n,o,r)=>{let i=t[r];return n+Math.abs(o.x-i.x)+Math.abs(o.y-i.y)},0)}isBetterCandidate(t,n){let o=t.currentTurnCount-t.suggestedTurnCount,r=n.currentTurnCount-n.suggestedTurnCount;return o>r||o===r&&t.traceLength>n.traceLength}makeIssue(t){let n=t.targetPlacement.sourceComponentName||"component",o=t.connectedPlacement.sourceComponentName||"component",r=t.targetPort.pin_number?`pin${t.targetPort.pin_number}`:t.targetPort.display_pin_label;return{lineItemType:"TwoPinComponentCouldBeFlipped",schematicTraceId:t.trace.schematic_trace_id,traceName:x7t(this.ctx.circuitJson,t.trace),targetComponent:t.targetPlacement,connectedComponent:t.connectedPlacement,targetPin:r,currentFacingDirection:t.targetPort.facing_direction,suggestedFacingDirection:t.suggestedFacingDirection,deltaSchRotation:180,currentTurnCount:t.currentTurnCount,suggestedTurnCount:t.suggestedTurnCount,message:`rotate ${n} by 180° so ${r??"its connected pin"} faces ${o} and reduce this trace from ${t.currentTurnCount} turns to ${t.suggestedTurnCount}`}}static issueToString(t){let n=[];return dn(n,"traceName",t.traceName),dn(n,"targetComponentName",t.targetComponent.sourceComponentName),dn(n,"connectedComponentName",t.connectedComponent.sourceComponentName),dn(n,"targetPin",t.targetPin),dn(n,"currentFacingDirection",t.currentFacingDirection),dn(n,"suggestedFacingDirection",t.suggestedFacingDirection),dn(n,"deltaSchRotation",t.deltaSchRotation),dn(n,"currentTurnCount",t.currentTurnCount),dn(n,"suggestedTurnCount",t.suggestedTurnCount),dn(n,"message",t.message),`<TwoPinComponentCouldBeFlipped ${n.join(" ")} />`}};var zFe=class extends po{constructor(e){super();this.params=e;let{circuitJson:t}=e.ctx;this.netLabels=t.filter((n)=>this.isSchematicNetLabel(n)),this.tokenToInvolvedPin=this.buildTokenToInvolvedPinMap(t),this.schematicSheetNameById=LFe(t),this.solved=this.netLabels.length===0}params;VERBOSE_NET_LABEL_MESSAGE="Create trace with schDisplayLabel";netLabels;tokenToInvolvedPin;schematicSheetNameById;currentIndex=0;seen=new Set;_step(){let e=this.netLabels[this.currentIndex++];if(!e){this.solved=!0;return}this.solved=this.currentIndex>=this.netLabels.length;let t=`${e.schematic_sheet_id??""}:${e.text}`;if(!e.text.includes("/")||this.seen.has(t))return;this.seen.add(t);let n;if(e.schematic_sheet_id)n=this.schematicSheetNameById.get(e.schematic_sheet_id);let o={lineItemType:"VerboseSchematicNetLabel",schematicNetLabelId:e.schematic_net_label_id,sourceNetId:e.source_net_id,schematicSheetId:e.schematic_sheet_id,schematicSheetName:n,text:e.text,involvedPins:this.getInvolvedPins(e.text,this.tokenToInvolvedPin),schX:e.center.x,schY:e.center.y,message:this.VERBOSE_NET_LABEL_MESSAGE};this.params.issues.push(o)}static issueToString(e){let t=[];return dn(t,"message",e.message),dn(t,"text",e.text),dn(t,"involvedPins",e.involvedPins.join(",")),dn(t,"schSheetName",e.schematicSheetName),dn(t,"schX",e.schX),dn(t,"schY",e.schY),`<VerboseSchematicNetLabel ${t.join(" ")} />`}isSchematicNetLabel(e){return e.type==="schematic_net_label"}isSourcePort(e){return e.type==="source_port"}getSourceComponentWithName(e){if(e.type!=="source_component"||!("source_component_id"in e)||!("name"in e)||typeof e.source_component_id!=="string"||typeof e.name!=="string")return null;return{source_component_id:e.source_component_id,name:e.name}}getSourcePortNameCandidates(e){return[e.most_frequently_referenced_by_name,e.name,...e.port_hints??[],e.pin_number===void 0?void 0:String(e.pin_number)].filter((t)=>Boolean(t))}getBestSourcePortName(e){return e.most_frequently_referenced_by_name??e.name??(e.pin_number===void 0?"":`pin${e.pin_number}`)}buildTokenToInvolvedPinMap(e){let t=new Map(e.flatMap((o)=>{let r=this.getSourceComponentWithName(o);return r?[r]:[]}).map((o)=>[o.source_component_id,o])),n=new Map;for(let o of e.filter((r)=>this.isSourcePort(r))){if(!o.source_component_id)continue;let r=t.get(o.source_component_id);if(!r?.name)continue;let i=`${r.name}.${this.getBestSourcePortName(o)}`;for(let s of this.getSourcePortNameCandidates(o))n.set(`${r.name}_${s}`,i)}return n}getInvolvedPins(e,t){let n=new Set;for(let o of e.split("/")){let r=t.get(o);if(r)n.add(r)}return Array.from(n)}},OFe=class extends po{constructor(e){super();this.params=e;let{ctx:t}=e;this.sheetNames=LFe(t.circuitJson);let n=new Set(t.circuitJson.flatMap((r)=>r.type==="schematic_component"&&r.is_box_with_pins===!1&&!r.symbol_name?[r.schematic_component_id]:[])),o=new Set;this.texts=t.circuitJson.flatMap((r)=>{if(r.type!=="schematic_text")return[];if(r.schematic_component_id||r.schematic_symbol_id)return[];let i=tFe(r);if(!i.length)return[];let s=r.schematic_sheet_id,a=JSON.stringify([s,r.text,r.position.x,r.position.y,r.font_size,r.anchor,r.rotation,r.color]);if(o.has(a))return[];return o.add(a),[{text:r,isTraceLabel:Boolean("source_trace_id"in r&&r.source_trace_id),polygons:i,sheetId:s,object:{type:"text",id:r.schematic_text_id,text:r.text}}]}),this.obstacles=[...t.componentPlacements.flatMap((r)=>r.schematicComponentId&&!n.has(r.schematicComponentId)?[{object:{type:"component",id:r.schematicComponentId,componentName:r.sourceComponentName,schematicComponentId:r.schematicComponentId},polygons:[Kj(Tw(r.schX,r.schY,r.width,r.height))],sheetId:r.schematicSheetId}]:[]),...t.circuitJson.flatMap((r)=>r.type==="schematic_trace"?[{object:{type:"trace",id:r.schematic_trace_id},sheetId:r.schematic_sheet_id,segments:r.edges,polygons:r.edges.flatMap((i)=>{let s=oFe(i.from,i.to);return s?[s]:[]})}]:[])],this.solved=this.texts.length===0}params;texts;obstacles;sheetNames;index=0;_step(){let e=this.texts[this.index],n=[...this.obstacles,...this.texts.slice(this.index+1)].filter((o)=>this.collides(e,o));if(n.length){let o=e.isTraceLabel?void 0:this.findClearPosition(e);for(let r of n){let i=r.object.componentName??r.object.text;this.params.issues.push({lineItemType:"SchematicTextCollision",schematicSheetId:e.sheetId,schematicSheetName:e.sheetId?this.sheetNames.get(e.sheetId):void 0,schematicTextId:e.text.schematic_text_id,text:e.text.text,collidingObject:r.object,textBounds:P8t(e.polygons),collidingObjectBounds:P8t(r.polygons),suggestedMove:o,message:`Text "${e.text.text}" overlaps ${r.object.type}${i?` ${i}`:""}; ${e.isTraceLabel?"adjust the owning trace's label placement or remove stale duplicates to leave the visible text area clear.":"reposition the text to leave its visible area clear."}`})}}this.index++,this.solved=this.index>=this.texts.length}collides(e,t){if(e.sheetId!==t.sheetId)return!1;return e.polygons.some((n)=>t.segments?t.segments.some((o)=>O2e(o.from,o.to,n)):t.polygons.some((o)=>nFe(n,o)))}findClearPosition(e){let t=[...this.obstacles,...this.texts.filter((o)=>o!==e)],n=Math.max(0.1,e.text.font_size/2);for(let o=n;o<=Math.max(4,e.text.font_size*8);o+=n)for(let[r,i]of[[0,o],[0,-o],[-o,0],[o,0]]){let s=Math.round((e.text.position.x+r)*1000)/1000,a=Math.round((e.text.position.y+i)*1000)/1000,c={...e,polygons:tFe({...e.text,position:{x:s,y:a}})};if(t.every((l)=>!this.collides(c,l)))return{newSchX:s,newSchY:a}}return}static issueToString(e){let t=[];return dn(t,"text",e.text),dn(t,"collidingObjectType",e.collidingObject.type),dn(t,"collidingText",e.collidingObject.text),dn(t,"newSchX",e.suggestedMove?.newSchX),dn(t,"newSchY",e.suggestedMove?.newSchY),dn(t,"message",e.message),`<SchematicTextCollision ${t.join(" ")} />`}},VFe=class e extends po{constructor(t){super();this.params=t,this.networks=this.findNetworks(t.ctx),this.solved=this.networks.length===0}params;static MIN_DISTANCE=6;networks;index=0;_step(){let t=this.networks[this.index],n=t.members.slice(0,2),o=Math.max(e.MIN_DISTANCE,...n.map((i)=>3*Math.max(i.width,i.height))),r=n.map((i)=>Math.hypot(Math.max(0,Math.abs(i.schX-t.pinPosition.x)-i.width/2),Math.max(0,Math.abs(i.schY-t.pinPosition.y)-i.height/2)));if(r.some((i)=>i>o)){let i=t.host.sourceComponentName||"component",s=T8t(t.pin),a=n.map((c)=>c.sourceComponentName||"component").join(", ");this.params.issues.push({lineItemType:"ResetNetworkNotGrouped",hostSchematicBox:t.host,resetSourcePortId:t.pin.source_port_id,resetPinName:s,supportNetworkComponents:t.members,maxDistanceFromResetPin:Math.round(Math.max(...r)*100)/100,maxRecommendedDistance:o,message:`Group ${a} near ${i}.${s} so the reset pull-up and capacitor can be read together. Preserve all net connections; associated test points may remain in a debug area.`})}this.index++,this.solved=this.index>=this.networks.length}findNetworks(t){let n=u7t(t.circuitJson),o=t.circuitJson.filter((m)=>m.type==="source_component"),r=new Map(o.map((m)=>[m.source_component_id,m])),i=t.circuitJson.filter((m)=>m.type==="source_port"),s=new Map,a=new Map,c=new Set,l=new Set;for(let m of i){if(!m.source_component_id)continue;let A=s.get(m.source_component_id)??[];A.push(m),s.set(m.source_component_id,A);let g=n(m.source_port_id),f=a.get(g)??[];if(f.push(m),a.set(g,f),m.provides_power||m.requires_power)c.add(g);if(m.provides_ground||m.requires_ground)l.add(g)}for(let m of t.circuitJson){if(m.type!=="source_net")continue;if(m.is_power||m.is_positive_voltage_source)c.add(n(m.source_net_id));if(m.is_ground)l.add(n(m.source_net_id))}let h=new Map(t.componentPlacements.flatMap((m)=>m.sourceComponentId?[[m.sourceComponentId,m]]:[])),d=t.circuitJson.filter((m)=>m.type==="schematic_port"),u=new Map(t.circuitJson.filter((m)=>m.type==="schematic_component").map((m)=>[m.schematic_component_id,m])),_=[],p=new Set;for(let m of i){if(!m.source_component_id||!T8t(m)||m.do_not_connect)continue;if(r.get(m.source_component_id)?.ftype!=="simple_chip")continue;let A=n(m.source_port_id);if(p.has(A)||c.has(A)||l.has(A))continue;p.add(A);let g=a.get(A)??[];if(new Set(g.filter((B)=>B.source_component_id&&r.get(B.source_component_id)?.ftype==="simple_chip").map((B)=>B.source_component_id)).size!==1)continue;let y=h.get(m.source_component_id),x=d.find((B)=>B.source_port_id===m.source_port_id&&B.schematic_component_id===y?.schematicComponentId);if(!y||!x||x.schematic_sheet_id!==y.schematicSheetId)continue;let C=[],b=[],I=[],v=!1;for(let B of new Set(g.map((T)=>T.source_component_id))){if(!B||B===m.source_component_id)continue;let T=r.get(B)?.ftype,N=s.get(B)??[],D=h.get(B);if(T==="simple_connector"||T==="simple_pin_header")continue;if(!D){v=!0;break}if(T==="simple_test_point"&&N.length===1){I.push(D);continue}if(N.length!==2){v=!0;break}let L=N.find((V)=>n(V.source_port_id)!==A);if(!L){v=!0;break}let H=n(L.source_port_id);if(T==="simple_resistor"&&c.has(H)&&!l.has(H))C.push(D);else if(T==="simple_capacitor"&&l.has(H)&&!c.has(H))b.push(D);else{v=!0;break}}if(v||C.length!==1||b.length!==1)continue;let P=[...C,...b,...I],M=y.schematicComponentId?u.get(y.schematicComponentId)?.schematic_group_id:void 0;if(P.some((B)=>{let T=B.schematicComponentId?u.get(B.schematicComponentId)?.schematic_group_id:void 0;return B.schematicSheetId!==y.schematicSheetId||B.subcircuitId!==y.subcircuitId||T!==M}))continue;_.push({host:y,pin:m,pinPosition:x.center,members:P})}return _}static issueToString(t){let n=[];return dn(n,"hostComponentName",t.hostSchematicBox.sourceComponentName),dn(n,"resetPin",t.resetPinName),dn(n,"supportNetworkComponents",t.supportNetworkComponents.map((o)=>o.sourceComponentName||"component").join(",")),dn(n,"maxDistanceFromResetPin",t.maxDistanceFromResetPin),dn(n,"maxRecommendedDistance",t.maxRecommendedDistance),dn(n,"message",t.message),`<ResetNetworkNotGrouped ${n.join(" ")} />`}},T8t=(e)=>[e.name,...e.port_hints??[]].find((t)=>/^N?(RESET|RST)(N|B)?$/.test(t.toUpperCase().replace(/[_\-!~#/]/g,""))),Mwo={SeriesLedChainNotOrdered:[hFe],RailPathTooSpreadOut:[mFe],ResistorSeparatedFromChipPin:[uFe],CapacitorSeparatedFromChipPins:[_Fe],DiodeCapacitorJunctionTooSpreadOut:[lFe],PiFilterComponentsNotGrouped:[gFe],MosfetGateNetworkNotGrouped:[AFe],FlybackDiodeSeparatedFromRelayCoil:[fFe],ComponentOverlap:[QFe],SchematicBoxHasALotOfSurroundingWhitespace:[],CapacitorSymbolHorizontal:[SFe,_se],VerboseSchematicNetLabel:[zFe],PinHeaderSchematicBoxTooWide:[W2e],GenericSchematicBoxTooWide:[W2e],SchematicBoxInnerLabelCollision:[RFe],SchematicPinPaddingToEdgeTooLarge:[kFe],DiodeResistorNotAligned:[wFe],ParallelRcNotAligned:[dFe],ParallelDiodeResistorNotAligned:[pFe],ComponentPinsWouldAlignWithVerticalShift:[EFe],TraceCanBeSimplifiedByMovingComponent:[HFe],CrystalNotCenteredOverLoadCapacitors:[MFe],ComponentNetLabelCollision:[mse],ComponentBoxNetLabelCollision:[mse],NetLabelCollision:[mse],FeedbackNetworkNotCompact:[BFe],PullResistorOnWrongSide:[TFe,y7t],SchematicTextCollision:[OFe],ResetNetworkNotGrouped:[VFe],TwoPinComponentCouldBeFlipped:[FFe],TwoPinComponentShouldBeVertical:[_se],TwoPinComponentHasInvertedRails:[_se],DecouplingCapacitorsNotCloseTogether:[PFe],ConnectorPositionCausesTraceDetours:[bFe],LowSideTransistorNotAlignedWithLoad:[IFe],UsbSeriesResistorsNotAligned:[vFe],CurrentSenseShuntSeparatedFromInputs:[yFe],VoltageDividerSupplyResistorBelowGroundResistor:[xFe],RegulatorCapacitorsOnWrongSides:[CFe]},wwo=class extends Rb{ctx;issues=[];pipelineDef=[Pi("SeriesLedChainPlacementSolver",hFe,(e)=>[{ctx:e.ctx,issues:e.issues}]),Pi("ParallelRcPlacementSolver",dFe,(e)=>[{ctx:e.ctx,issues:e.issues}]),Pi("ParallelDiodeResistorPlacementSolver",pFe,(e)=>[{ctx:e.ctx,issues:e.issues}]),Pi("SchematicTextClearanceSolver",OFe,(e)=>[{ctx:e.ctx,issues:e.issues}]),Pi("ResetNetworkGroupingSolver",VFe,(e)=>[{ctx:e.ctx,issues:e.issues}]),Pi("SchematicBoxOverlapSolver",QFe,(e)=>[{ctx:e.ctx,issues:e.issues}]),Pi("CapacitorOrientationSolver",SFe,(e)=>[{ctx:e.ctx,issues:e.issues}]),Pi("VerboseNetLabelSolver",zFe,(e)=>[{ctx:e.ctx,issues:e.issues}]),Pi("SchematicBoxTooWideSolver",W2e,(e)=>[{ctx:e.ctx,issues:e.issues}]),Pi("SchematicPinPaddingToEdgeSolver",kFe,(e)=>[{ctx:e.ctx,issues:e.issues}]),Pi("SchematicBoxInnerLabelCollisionSolver",RFe,(e)=>[{ctx:e.ctx,issues:e.issues}]),Pi("DiodeResistorAlignmentSolver",wFe,(e)=>[{ctx:e.ctx,issues:e.issues}]),Pi("ComponentPinAlignmentSolver",EFe,(e)=>[{ctx:e.ctx,issues:e.issues}]),Pi("TraceSimplificationSolver",HFe,(e)=>[{ctx:e.ctx,issues:e.issues}]),Pi("CrystalLoadCapacitorPlacementSolver",MFe,(e)=>[{ctx:e.ctx,issues:e.issues}]),Pi("TwoPinComponentOrientationSolver",FFe,(e)=>[{ctx:e.ctx,issues:e.issues}]),Pi("FeedbackNetworkPlacementSolver",BFe,(e)=>[{ctx:e.ctx,issues:e.issues}]),Pi("TwoPinComponentRailOrientationSolver",_se,(e)=>[{ctx:e.ctx,issues:e.issues}]),Pi("PullResistorPlacementSolver",TFe,(e)=>[{ctx:e.ctx,issues:e.issues}]),Pi("SwitchPullResistorPlacementSolver",y7t,(e)=>[{ctx:e.ctx,issues:e.issues}]),Pi("ComponentNetLabelCollisionSolver",mse,(e)=>[{ctx:e.ctx,issues:e.issues}]),Pi("DecouplingCapacitorGroupingSolver",PFe,(e)=>[{ctx:e.ctx,issues:e.issues}]),Pi("ConnectorPlacementSolver",bFe,(e)=>[{ctx:e.ctx,issues:e.issues}]),Pi("LowSideTransistorPlacementSolver",IFe,(e)=>[{ctx:e.ctx,issues:e.issues}]),Pi("UsbSeriesResistorPlacementSolver",vFe,(e)=>[{ctx:e.ctx,issues:e.issues}]),Pi("RegulatorInputOutputCapacitorPlacementSolver",CFe,(e)=>[{ctx:e.ctx,issues:e.issues}]),Pi("VoltageDividerPlacementSolver",xFe,(e)=>[{ctx:e.ctx,issues:e.issues}]),Pi("CurrentSenseShuntPlacementSolver",yFe,(e)=>[{ctx:e.ctx,issues:e.issues}]),Pi("RelayFlybackDiodePlacementSolver",fFe,(e)=>[{ctx:e.ctx,issues:e.issues}]),Pi("DiodeCapacitorStagePlacementSolver",lFe,(e)=>[{ctx:e.ctx,issues:e.issues}]),Pi("PiFilterPlacementSolver",gFe,(e)=>[{ctx:e.ctx,issues:e.issues}]),Pi("MosfetGateNetworkPlacementSolver",AFe,(e)=>[{ctx:e.ctx,issues:e.issues}]),Pi("ChipPinResistorPlacementSolver",uFe,(e)=>[{ctx:e.ctx,issues:e.issues}]),Pi("ChipPinPairCapacitorPlacementSolver",_Fe,(e)=>[{ctx:e.ctx,issues:e.issues}]),Pi("RailPathVisibilitySolver",mFe,(e)=>[{ctx:e.ctx,issues:e.issues,maxSpan:e.railPathVisibility?.maxSpan,maxLength:e.railPathVisibility?.maxPathLength}])];selectedIssueTypes;railPathVisibility;constructor(e,t={}){super(e);if(this.railPathVisibility=t.railPathVisibility,t.issueTypes!==void 0){this.selectedIssueTypes=new Set(t.issueTypes);let n=new Set(t.issueTypes.flatMap((o)=>Mwo[o]));this.pipelineDef=this.pipelineDef.filter((o)=>n.has(o.solverClass))}}_setup(){this.ctx=Swo(this.inputProblem)}getOutput(){let e=new Set(this.issues.flatMap((t)=>t.lineItemType==="TwoPinComponentShouldBeVertical"&&t.schematicBox.schematicComponentId?[t.schematicBox.schematicComponentId]:[]));return{issues:this.issues.filter((t)=>t.lineItemType!=="CapacitorSymbolHorizontal"||!e.has(t.schematicBox.schematicComponentId??"")).filter((t)=>this.selectedIssueTypes===void 0||this.selectedIssueTypes.has(t.lineItemType)),componentPlacements:this.ctx.componentPlacements}}},D8t=0.01,Bwo=({issues:e,componentPlacements:t,circuitJson:n})=>{let o=new Set,r=new Map(t.flatMap((c)=>c.schematicComponentId?[[c.schematicComponentId,c]]:[])),i=new Map;for(let c of t){if(!c.sourceComponentName)continue;let l=i.get(c.sourceComponentName);if(l)l.push(c);else i.set(c.sourceComponentName,[c])}let s=(c)=>{if(!c)return;let l=c.schematicComponentId?r.get(c.schematicComponentId):t.find((h)=>h.sourceComponentId===c.sourceComponentId&&h.schX===c.schX&&h.schY===c.schY);if(l)o.add(l)},a=(c,l)=>{if(!c)return;for(let h of i.get(c)??[])if(l===void 0||h.schematicSheetId===l)o.add(h)};for(let c of e)switch(c.lineItemType){case"SeriesLedChainNotOrdered":for(let l of c.ledSchematicBoxes)s(l);break;case"ResistorSeparatedFromChipPin":s(c.hostSchematicBox),s(c.resistorSchematicBox);break;case"CapacitorSeparatedFromChipPins":s(c.hostSchematicBox),s(c.capacitorSchematicBox);break;case"DiodeCapacitorJunctionTooSpreadOut":s(c.capacitorSchematicBox);for(let l of c.diodeSchematicBoxes)s(l);break;case"PiFilterComponentsNotGrouped":s(c.inductorSchematicBox),s(c.firstCapacitorSchematicBox),s(c.secondCapacitorSchematicBox);break;case"MosfetGateNetworkNotGrouped":s(c.mosfetSchematicBox),s(c.seriesGateResistorSchematicBox),s(c.gateSourceResistorSchematicBox);break;case"FlybackDiodeSeparatedFromRelayCoil":s(c.relaySchematicBox),s(c.diodeSchematicBox);break;case"CurrentSenseShuntSeparatedFromInputs":s(c.amplifierSchematicBox),s(c.shuntSchematicBox);break;case"VoltageDividerSupplyResistorBelowGroundResistor":s(c.supplyResistorSchematicBox),s(c.groundResistorSchematicBox);break;case"RegulatorCapacitorsOnWrongSides":s(c.regulatorSchematicBox),s(c.inputCapacitorSchematicBox),s(c.outputCapacitorSchematicBox);break;case"UsbSeriesResistorsNotAligned":s(c.positiveResistorSchematicBox),s(c.negativeResistorSchematicBox);break;case"LowSideTransistorNotAlignedWithLoad":s(c.transistorSchematicBox),s(c.loadSchematicBox),s(c.baseResistorSchematicBox),s(c.clampDiodeSchematicBox);break;case"DecouplingCapacitorsNotCloseTogether":for(let l of c.capacitorSchematicBoxes)s(l);break;case"ConnectorPositionCausesTraceDetours":s(c.connectorSchematicBox);for(let l of c.connectedComponents)s(l);break;case"ResetNetworkNotGrouped":s(c.hostSchematicBox);for(let l of c.supportNetworkComponents)s(l);break;case"SchematicTextCollision":if(c.collidingObject.schematicComponentId)s(r.get(c.collidingObject.schematicComponentId));if(c.collidingObject.type==="trace")for(let l of R8t({schematicTraceId:c.collidingObject.id,circuitJson:n,placementByComponentId:r}))s(l);break;case"ComponentOverlap":s(c.firstComponent),s(c.secondComponent);break;case"SchematicBoxHasALotOfSurroundingWhitespace":case"CapacitorSymbolHorizontal":case"PinHeaderSchematicBoxTooWide":case"GenericSchematicBoxTooWide":case"SchematicBoxInnerLabelCollision":case"SchematicPinPaddingToEdgeTooLarge":s(c.schematicBox);break;case"VerboseSchematicNetLabel":for(let l of c.involvedPins)a(Two(l),c.schematicSheetId);break;case"ParallelRcNotAligned":s(c.resistorSchematicBox),s(c.capacitorSchematicBox);break;case"ParallelDiodeResistorNotAligned":case"DiodeResistorNotAligned":s(c.diodeSchematicBox),s(c.resistorSchematicBox);break;case"ComponentPinsWouldAlignWithVerticalShift":s(c.firstComponent),s(c.secondComponent),s(c.targetComponent);break;case"TraceCanBeSimplifiedByMovingComponent":s(c.targetComponent);for(let l of R8t({schematicTraceId:c.schematicTraceId,circuitJson:n,placementByComponentId:r}))o.add(l);break;case"CrystalNotCenteredOverLoadCapacitors":s(c.crystalSchematicBox),s(c.firstLoadCapacitorSchematicBox),s(c.secondLoadCapacitorSchematicBox);break;case"TwoPinComponentCouldBeFlipped":s(c.targetComponent),s(c.connectedComponent);break;case"FeedbackNetworkNotCompact":s(c.amplifierSchematicBox);for(let l of c.feedbackComponents)s(l);break;case"TwoPinComponentShouldBeVertical":case"TwoPinComponentHasInvertedRails":s(c.schematicBox);break;case"RailPathTooSpreadOut":s(c.hostSchematicBox);for(let l of c.supportSchematicBoxes)s(l);break;case"PullResistorOnWrongSide":s(c.resistorSchematicBox),s(c.hostSchematicBox);break;case"ComponentNetLabelCollision":s(c.firstComponent),s(c.secondComponent);break;case"ComponentBoxNetLabelCollision":s(c.boxComponent),s(c.labelComponent);break;case"NetLabelCollision":for(let l of c.pairs)a(l.comp1Name,c.schematicSheetId),a(l.comp2Name,c.schematicSheetId);for(let l of c.moves)a(l.componentName,c.schematicSheetId);break}return t.filter((c)=>o.has(c))},N8t=(e)=>{if("schematicSheetId"in e||"schematicSheetName"in e){let t="schematicSheetId"in e&&typeof e.schematicSheetId==="string"?e.schematicSheetId:void 0,n="schematicSheetName"in e&&typeof e.schematicSheetName==="string"?e.schematicSheetName:void 0;if(t||n)return{schematicSheetId:t,schematicSheetName:n}}for(let t of Object.values(e).flat())if(Dwo(t))return{schematicSheetId:t.schematicSheetId,schematicSheetName:t.schematicSheetName};return{}},Two=(e)=>{let t=e.lastIndexOf(".");return t===-1?e:e.slice(0,t)},Dwo=(e)=>Boolean(e&&typeof e==="object"&&"positionAnchor"in e&&e.positionAnchor==="center"&&"schX"in e&&"schY"in e&&"width"in e&&"height"in e),R8t=({schematicTraceId:e,circuitJson:t,placementByComponentId:n})=>{let o=t.find((l)=>l.type==="schematic_trace"&&l.schematic_trace_id===e),r=o?.edges[0],i=o?.edges.at(-1);if(!o||!r||!i)return[];let s=t.filter((l)=>l.type==="schematic_port"),a=new Map(s.map((l)=>[l.schematic_port_id,l]));return[r.from_schematic_port_id?a.get(r.from_schematic_port_id):Q8t(s,r.from,o.schematic_sheet_id),i.to_schematic_port_id?a.get(i.to_schematic_port_id):Q8t(s,i.to,o.schematic_sheet_id)].flatMap((l)=>{let h=l?.schematic_component_id?n.get(l.schematic_component_id):void 0;return h?[h]:[]})},Q8t=(e,t,n)=>e.find((o)=>o.schematic_sheet_id===n&&Math.abs(o.center.x-t.x)<=D8t&&Math.abs(o.center.y-t.y)<=D8t),Nwo=class{constructor(e,t=!1){this.lineItems=e,this.groupBySchematicSheet=t}lineItems;groupBySchematicSheet;getLineItems(){return this.lineItems}getIssues(e={}){return this.lineItems.flatMap((t)=>t.lineItemType==="SchematicPlacementIssues"?t.issues:[]).filter((t)=>(e.issueTypes===void 0||e.issueTypes.includes(t.lineItemType))&&(e.schematicSheetId===void 0||(N8t(t).schematicSheetId??"")===e.schematicSheetId))}getIssueCounts(e={}){let t={FlybackDiodeSeparatedFromRelayCoil:0,ComponentOverlap:0,SchematicBoxHasALotOfSurroundingWhitespace:0,CapacitorSymbolHorizontal:0,VerboseSchematicNetLabel:0,PinHeaderSchematicBoxTooWide:0,GenericSchematicBoxTooWide:0,SchematicBoxInnerLabelCollision:0,SchematicPinPaddingToEdgeTooLarge:0,DiodeResistorNotAligned:0,ParallelRcNotAligned:0,ParallelDiodeResistorNotAligned:0,ComponentPinsWouldAlignWithVerticalShift:0,TraceCanBeSimplifiedByMovingComponent:0,CrystalNotCenteredOverLoadCapacitors:0,ComponentNetLabelCollision:0,ComponentBoxNetLabelCollision:0,NetLabelCollision:0,FeedbackNetworkNotCompact:0,PullResistorOnWrongSide:0,SchematicTextCollision:0,ResetNetworkNotGrouped:0,TwoPinComponentCouldBeFlipped:0,TwoPinComponentShouldBeVertical:0,TwoPinComponentHasInvertedRails:0,DecouplingCapacitorsNotCloseTogether:0,ConnectorPositionCausesTraceDetours:0,LowSideTransistorNotAlignedWithLoad:0,UsbSeriesResistorsNotAligned:0,RegulatorCapacitorsOnWrongSides:0,VoltageDividerSupplyResistorBelowGroundResistor:0,CurrentSenseShuntSeparatedFromInputs:0,DiodeCapacitorJunctionTooSpreadOut:0,PiFilterComponentsNotGrouped:0,MosfetGateNetworkNotGrouped:0,CapacitorSeparatedFromChipPins:0,ResistorSeparatedFromChipPin:0,RailPathTooSpreadOut:0,SeriesLedChainNotOrdered:0};for(let n of this.getIssues(e))t[n.lineItemType]++;return t}getString(){return this.toString()}schematicBoxPlacementsToString(e){let t=[];return dn(t,"componentName",e.sourceComponentName),dn(t,"positionAnchor",e.positionAnchor),dn(t,"schX",e.schX),dn(t,"schY",e.schY),dn(t,"width",e.width),dn(t,"height",e.height),`<SchematicBoxPlacement ${t.join(" ")} />`}schematicIssuesToString(e){switch(e.lineItemType){case"SeriesLedChainNotOrdered":return hFe.issueToString(e);case"ResistorSeparatedFromChipPin":return uFe.issueToString(e);case"CapacitorSeparatedFromChipPins":return _Fe.issueToString(e);case"DiodeCapacitorJunctionTooSpreadOut":return lFe.issueToString(e);case"PiFilterComponentsNotGrouped":return gFe.issueToString(e);case"MosfetGateNetworkNotGrouped":return AFe.issueToString(e);case"CurrentSenseShuntSeparatedFromInputs":return yFe.issueToString(e);case"ComponentOverlap":return QFe.issueToString(e);case"CapacitorSymbolHorizontal":return SFe.issueToString(e);case"DecouplingCapacitorsNotCloseTogether":return PFe.issueToString(e);case"VerboseSchematicNetLabel":return zFe.issueToString(e);case"PinHeaderSchematicBoxTooWide":case"GenericSchematicBoxTooWide":return W2e.issueToString(e);case"SchematicBoxInnerLabelCollision":return RFe.issueToString(e);case"SchematicPinPaddingToEdgeTooLarge":return kFe.issueToString(e);case"ParallelRcNotAligned":return dFe.issueToString(e);case"ParallelDiodeResistorNotAligned":return pFe.issueToString(e);case"DiodeResistorNotAligned":return wFe.issueToString(e);case"ComponentPinsWouldAlignWithVerticalShift":return EFe.issueToString(e);case"TraceCanBeSimplifiedByMovingComponent":return HFe.issueToString(e);case"CrystalNotCenteredOverLoadCapacitors":return MFe.issueToString(e);case"TwoPinComponentCouldBeFlipped":return FFe.issueToString(e);case"FeedbackNetworkNotCompact":return BFe.issueToString(e);case"TwoPinComponentShouldBeVertical":case"TwoPinComponentHasInvertedRails":return _se.issueToString(e);case"RailPathTooSpreadOut":return mFe.issueToString(e);case"PullResistorOnWrongSide":return TFe.issueToString(e);case"NetLabelCollision":return mse.netLabelCollisionToString(e);case"SchematicTextCollision":return OFe.issueToString(e);case"ResetNetworkNotGrouped":return VFe.issueToString(e);case"ConnectorPositionCausesTraceDetours":return bFe.issueToString(e);case"LowSideTransistorNotAlignedWithLoad":return IFe.issueToString(e);case"FlybackDiodeSeparatedFromRelayCoil":return fFe.issueToString(e);case"VoltageDividerSupplyResistorBelowGroundResistor":return xFe.issueToString(e);case"RegulatorCapacitorsOnWrongSides":return CFe.issueToString(e);case"UsbSeriesResistorsNotAligned":return vFe.issueToString(e);default:return""}}toString(){let e=this.lineItems.filter((r)=>r.lineItemType==="SchematicBoxPlacement"),t=this.lineItems.flatMap((r)=>r.lineItemType==="SchematicPlacementIssues"?r.issues:[]);if(t.length===0)return"";if(!this.groupBySchematicSheet)return this.issueContextToLines(e,t).join(`
`);let n=new Map,o=(r)=>{let i=r.schematicSheetId??r.schematicSheetName??"__default__",s=n.get(i);if(s)return s;let a={...r,placements:[],issues:[]};return n.set(i,a),a};for(let r of t)o(N8t(r)).issues.push(r);for(let r of e)o({schematicSheetId:r.schematicSheetId,schematicSheetName:r.schematicSheetName}).placements.push(r);return[...n.values()].flatMap((r)=>{let i=[];return dn(i,"name",r.schematicSheetName),dn(i,"id",r.schematicSheetId),[`<SchematicSheet${i.length>0?` ${i.join(" ")}`:""}>`,...this.issueContextToLines(r.placements,r.issues),"</SchematicSheet>"]}).join(`
`)}issueContextToLines(e,t){return[...e.length>0?["<SchematicBoxPositions>",...e.map(this.schematicBoxPlacementsToString),"</SchematicBoxPositions>"]:[],"<SchematicPlacementIssues>",...t.map(this.schematicIssuesToString),"</SchematicPlacementIssues>"]}},Rwo=(e,t={})=>{let n=new wwo(e,t);n.solve();let{issues:o,componentPlacements:r}=n.getOutput(),s=[...Bwo({issues:o,componentPlacements:r,circuitJson:e}),...o.length>0?[{lineItemType:"SchematicPlacementIssues",issues:o}]:[]],a=new Set(e.flatMap((c)=>("schematic_sheet_id"in c)&&typeof c.schematic_sheet_id==="string"?[c.schematic_sheet_id]:[]));return new Nwo(s,a.size>1)},Qwo=["TwoPinComponentHasInvertedRails","RegulatorCapacitorsOnWrongSides","PullResistorOnWrongSide","VoltageDividerSupplyResistorBelowGroundResistor","SeriesLedChainNotOrdered","ParallelRcNotAligned"];function kwo(e){let t=Rwo(e,{issueTypes:Qwo}),n=Ps(e);return t.getIssues().flatMap((o)=>{let r,i,s;switch(o.lineItemType){case"TwoPinComponentHasInvertedRails":{r=o.schematicBox.schematicComponentId;let l=Ks(e,r??"");i="inverted_rails",s=`${l} has its positive-supply pin facing down. Rotate ${l} by 180° so that pin faces up, preserving pin connections, and reroute attached traces.`;break}case"RegulatorCapacitorsOnWrongSides":{r=o.regulatorSchematicBox.schematicComponentId;let l=Ks(e,r??""),h=Ks(e,o.inputCapacitorSchematicBox.schematicComponentId??""),d=Ks(e,o.outputCapacitorSchematicBox.schematicComponentId??"");i="regulator_capacitors_on_wrong_sides",s=`${h} and ${d} are on the wrong sides of ${l}. Move them beside their connected regulator pins, preserving connections and rerouting traces.`;break}case"PullResistorOnWrongSide":r=o.resistorSchematicBox.schematicComponentId,i="pull_resistor_on_wrong_side",s=`consider placing ${Ks(e,r??"")} ${o.preferredSide} ${Ks(e,o.hostSchematicBox.schematicComponentId??"")}.${Ks(e,o.signalSourcePortId)} so the pull-${o.pullDirection} branch reads toward ${o.pullDirection==="up"?"power":"ground"}`;break;case"VoltageDividerSupplyResistorBelowGroundResistor":{r=o.supplyResistorSchematicBox.schematicComponentId;let l=Ks(e,r??""),h=Ks(e,o.groundResistorSchematicBox.schematicComponentId??"");i="voltage_divider_supply_resistor_below_ground_resistor",s=`${l}, connected to the supply, is below ${h}, connected to ground. Place ${l} above ${h} so their shared divider tap is easy to follow. Preserve pin connections and reroute affected traces; exact alignment is not required.`;break}case"SeriesLedChainNotOrdered":{r=o.ledSchematicBoxes[0]?.schematicComponentId;let l=o.ledSchematicBoxes.map((h)=>Ks(e,h.schematicComponentId??"")).join(", ");i="series_led_chain_not_ordered",s=`The series chain ${l} requires long connections behind LED pins. Arrange the LEDs in their connected order, preserving anode/cathode connections, and reroute affected traces. A horizontal, vertical, or clearly connected folded chain is acceptable.`;break}case"ParallelRcNotAligned":{r=o.resistorSchematicBox.schematicComponentId;let l=Ks(e,r??""),h=Ks(e,o.capacitorSchematicBox.schematicComponentId??"");i="parallel_rc_not_aligned",s=`${l} and ${h} share chip-pin and ground connections but are not drawn as adjacent parallel branches. Place their shared connections at matching ends, preserving pin connections and capacitor polarity, and reroute affected traces.`;break}default:return[]}if(!r)return[];let a=n.schematic_component.get(r);if(!a)return[];let c=a.schematic_group_id?n.schematic_group.get(a.schematic_group_id):void 0;return[{type:"schematic_component_styling_warning",schematic_component_styling_warning_id:`schematic_component_styling_warning_${r}_${i}`,warning_type:"schematic_component_styling_warning",styling_issue_type:i,message:s,schematic_component_id:r,source_component_id:a.source_component_id,schematic_sheet_id:a.schematic_sheet_id,subcircuit_id:a.subcircuit_id??c?.subcircuit_id,schematic_port_ids:n.schematic_port.list().filter((l)=>l.schematic_component_id===r).map((l)=>l.schematic_port_id)}]})}var Lwo=Object.create,{getPrototypeOf:Hwo,defineProperty:k8t,getOwnPropertyNames:Fwo}=Object,L8t=Object.prototype.hasOwnProperty;function zwo(e){return this[e]}var Owo,Vwo,Ywo=(e,t,n)=>{var o=e!=null&&typeof e==="object";if(o){var r=t?Owo??=new WeakMap:Vwo??=new WeakMap,i=r.get(e);if(i)return i}n=e!=null?Lwo(Hwo(e)):{};let s=t||!e||!e.__esModule||!L8t.call(e,"default")?k8t(n,"default",{value:e,enumerable:!0}):n;if(e&&typeof e==="object"||typeof e==="function"){for(let a of Fwo(e))if(!L8t.call(s,a))k8t(s,a,{get:zwo.bind(e,a),enumerable:!0})}if(o)r.set(e,s);return s},Gwo=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Uwo=Gwo(function(e,t){(function(n,o){typeof e==="object"&&typeof t<"u"?t.exports=o():typeof define==="function"&&define.amd?define(o):(n=typeof globalThis<"u"?globalThis:n||self,n.svgson=o())})(e,function(){var n=function(Y){return Y!=null&&(o(Y)||r(Y)||!!Y._isBuffer)};function o(Y){return!!Y.constructor&&typeof Y.constructor.isBuffer==="function"&&Y.constructor.isBuffer(Y)}function r(Y){return typeof Y.readFloatLE==="function"&&typeof Y.slice==="function"&&o(Y.slice(0,0))}var i=Object.prototype.toString,s=function(Y){if(typeof Y>"u")return"undefined";if(Y===null)return"null";if(Y===!0||Y===!1||Y instanceof Boolean)return"boolean";if(typeof Y==="string"||Y instanceof String)return"string";if(typeof Y==="number"||Y instanceof Number)return"number";if(typeof Y==="function"||Y instanceof Function)return"function";if(typeof Array.isArray<"u"&&Array.isArray(Y))return"array";if(Y instanceof RegExp)return"regexp";if(Y instanceof Date)return"date";var X=i.call(Y);if(X==="[object RegExp]")return"regexp";if(X==="[object Date]")return"date";if(X==="[object Arguments]")return"arguments";if(X==="[object Error]")return"error";if(n(Y))return"buffer";if(X==="[object Set]")return"set";if(X==="[object WeakSet]")return"weakset";if(X==="[object Map]")return"map";if(X==="[object WeakMap]")return"weakmap";if(X==="[object Symbol]")return"symbol";if(X==="[object Int8Array]")return"int8array";if(X==="[object Uint8Array]")return"uint8array";if(X==="[object Uint8ClampedArray]")return"uint8clampedarray";if(X==="[object Int16Array]")return"int16array";if(X==="[object Uint16Array]")return"uint16array";if(X==="[object Int32Array]")return"int32array";if(X==="[object Uint32Array]")return"uint32array";if(X==="[object Float32Array]")return"float32array";if(X==="[object Float64Array]")return"float64array";return"object"};function a(Y,X){return X={exports:{}},Y(X,X.exports),X.exports}var c=a(function(Y){(function(){function X(K,J){if(typeof J!=="function")return K;var ee={};for(var se in K)if(Object.prototype.hasOwnProperty.call(K,se))ee[J(se,K[se])||se]=K[se];return ee}if(Y.exports)Y.exports=X;else window.rename=X})()}),l=function Y(X,K){var J=s(X);if(J!=="object"&&J!=="array")throw Error("expected an object");var ee=[];if(J==="object")X=c(X,K),ee={};for(var se in X)if(X.hasOwnProperty(se)){var ne=X[se];if(s(ne)==="object"||s(ne)==="array")ee[se]=Y(ne,K);else ee[se]=ne}return ee},h=a(function(Y){var X=Object.prototype.hasOwnProperty,K="~";function J(){}if(Object.create){if(J.prototype=Object.create(null),!new J().__proto__)K=!1}function ee(ne,re,Z){this.fn=ne,this.context=re,this.once=Z||!1}function se(){this._events=new J,this._eventsCount=0}se.prototype.eventNames=function(){var ne=[],re,Z;if(this._eventsCount===0)return ne;for(Z in re=this._events)if(X.call(re,Z))ne.push(K?Z.slice(1):Z);if(Object.getOwnPropertySymbols)return ne.concat(Object.getOwnPropertySymbols(re));return ne},se.prototype.listeners=function(ne,re){var Z=K?K+ne:ne,te=this._events[Z];if(re)return!!te;if(!te)return[];if(te.fn)return[te.fn];for(var ie=0,le=te.length,ue=Array(le);ie<le;ie++)ue[ie]=te[ie].fn;return ue},se.prototype.emit=function(ne,re,Z,te,ie,le){var ue=K?K+ne:ne;if(!this._events[ue])return!1;var de=this._events[ue],me=arguments.length,Ae,xe;if(de.fn){if(de.once)this.removeListener(ne,de.fn,void 0,!0);switch(me){case 1:return de.fn.call(de.context),!0;case 2:return de.fn.call(de.context,re),!0;case 3:return de.fn.call(de.context,re,Z),!0;case 4:return de.fn.call(de.context,re,Z,te),!0;case 5:return de.fn.call(de.context,re,Z,te,ie),!0;case 6:return de.fn.call(de.context,re,Z,te,ie,le),!0}for(xe=1,Ae=Array(me-1);xe<me;xe++)Ae[xe-1]=arguments[xe];de.fn.apply(de.context,Ae)}else{var Me=de.length,Re;for(xe=0;xe<Me;xe++){if(de[xe].once)this.removeListener(ne,de[xe].fn,void 0,!0);switch(me){case 1:de[xe].fn.call(de[xe].context);break;case 2:de[xe].fn.call(de[xe].context,re);break;case 3:de[xe].fn.call(de[xe].context,re,Z);break;case 4:de[xe].fn.call(de[xe].context,re,Z,te);break;default:if(!Ae)for(Re=1,Ae=Array(me-1);Re<me;Re++)Ae[Re-1]=arguments[Re];de[xe].fn.apply(de[xe].context,Ae)}}}return!0},se.prototype.on=function(ne,re,Z){var te=new ee(re,Z||this),ie=K?K+ne:ne;if(!this._events[ie])this._events[ie]=te,this._eventsCount++;else if(!this._events[ie].fn)this._events[ie].push(te);else this._events[ie]=[this._events[ie],te];return this},se.prototype.once=function(ne,re,Z){var te=new ee(re,Z||this,!0),ie=K?K+ne:ne;if(!this._events[ie])this._events[ie]=te,this._eventsCount++;else if(!this._events[ie].fn)this._events[ie].push(te);else this._events[ie]=[this._events[ie],te];return this},se.prototype.removeListener=function(ne,re,Z,te){var ie=K?K+ne:ne;if(!this._events[ie])return this;if(!re){if(--this._eventsCount===0)this._events=new J;else delete this._events[ie];return this}var le=this._events[ie];if(le.fn){if(le.fn===re&&(!te||le.once)&&(!Z||le.context===Z))if(--this._eventsCount===0)this._events=new J;else delete this._events[ie]}else{for(var ue=0,de=[],me=le.length;ue<me;ue++)if(le[ue].fn!==re||te&&!le[ue].once||Z&&le[ue].context!==Z)de.push(le[ue]);if(de.length)this._events[ie]=de.length===1?de[0]:de;else if(--this._eventsCount===0)this._events=new J;else delete this._events[ie]}return this},se.prototype.removeAllListeners=function(ne){var re;if(ne){if(re=K?K+ne:ne,this._events[re])if(--this._eventsCount===0)this._events=new J;else delete this._events[re]}else this._events=new J,this._eventsCount=0;return this},se.prototype.off=se.prototype.removeListener,se.prototype.addListener=se.prototype.on,se.prototype.setMaxListeners=function(){return this},se.prefixed=K,se.EventEmitter=se,Y.exports=se});function d(Y,X,K){if(X in Y)Object.defineProperty(Y,X,{value:K,enumerable:!0,configurable:!0,writable:!0});else Y[X]=K;return Y}var u=function(){},_={data:"state-data",cdata:"state-cdata",tagBegin:"state-tag-begin",tagName:"state-tag-name",tagEnd:"state-tag-end",attributeNameStart:"state-attribute-name-start",attributeName:"state-attribute-name",attributeNameEnd:"state-attribute-name-end",attributeValueBegin:"state-attribute-value-begin",attributeValue:"state-attribute-value"},p={lt:"action-lt",gt:"action-gt",space:"action-space",equal:"action-equal",quote:"action-quote",slash:"action-slash",char:"action-char",error:"action-error"},m={text:"text",openTag:"open-tag",closeTag:"close-tag",attributeName:"attribute-name",attributeValue:"attribute-value"},A={" ":p.space,"\t":p.space,"\n":p.space,"\r":p.space,"<":p.lt,">":p.gt,'"':p.quote,"'":p.quote,"=":p.equal,"/":p.slash},g=function(Y){return A[Y]||p.char},f=function(Y){var X,K,J,ee,se,ne,re,Z,te,ie;Y=Object.assign({debug:!1},Y);var le=new h,ue=_.data,de="",me="",Ae="",xe="",Me="",Re="",we=function(ye,Se){if(me[0]==="?"||me[0]==="!")return;var Ne={type:ye,value:Se};if(Y.debug)console.log("emit:",Ne);le.emit("data",Ne)};le.stateMachine=(ie={},d(ie,_.data,(X={},d(X,p.lt,function(){if(de.trim())we(m.text,de);me="",Me=!1,ue=_.tagBegin}),d(X,p.char,function(ye){de+=ye}),X)),d(ie,_.cdata,d({},p.char,function(ye){if(de+=ye,de.substr(-3)==="]]>")we(m.text,de.slice(0,-3)),de="",ue=_.data})),d(ie,_.tagBegin,(K={},d(K,p.space,u),d(K,p.char,function(ye){me=ye,ue=_.tagName}),d(K,p.slash,function(){me="",Me=!0}),K)),d(ie,_.tagName,(J={},d(J,p.space,function(){if(Me)ue=_.tagEnd;else ue=_.attributeNameStart,we(m.openTag,me)}),d(J,p.gt,function(){if(Me)we(m.closeTag,me);else we(m.openTag,me);de="",ue=_.data}),d(J,p.slash,function(){ue=_.tagEnd,we(m.openTag,me)}),d(J,p.char,function(ye){if(me+=ye,me==="![CDATA[")ue=_.cdata,de="",me=""}),J)),d(ie,_.tagEnd,(ee={},d(ee,p.gt,function(){we(m.closeTag,me),de="",ue=_.data}),d(ee,p.char,u),ee)),d(ie,_.attributeNameStart,(se={},d(se,p.char,function(ye){Ae=ye,ue=_.attributeName}),d(se,p.gt,function(){de="",ue=_.data}),d(se,p.space,u),d(se,p.slash,function(){Me=!0,ue=_.tagEnd}),se)),d(ie,_.attributeName,(ne={},d(ne,p.space,function(){ue=_.attributeNameEnd}),d(ne,p.equal,function(){we(m.attributeName,Ae),ue=_.attributeValueBegin}),d(ne,p.gt,function(){xe="",we(m.attributeName,Ae),we(m.attributeValue,xe),de="",ue=_.data}),d(ne,p.slash,function(){Me=!0,xe="",we(m.attributeName,Ae),we(m.attributeValue,xe),ue=_.tagEnd}),d(ne,p.char,function(ye){Ae+=ye}),ne)),d(ie,_.attributeNameEnd,(re={},d(re,p.space,u),d(re,p.equal,function(){we(m.attributeName,Ae),ue=_.attributeValueBegin}),d(re,p.gt,function(){xe="",we(m.attributeName,Ae),we(m.attributeValue,xe),de="",ue=_.data}),d(re,p.char,function(ye){xe="",we(m.attributeName,Ae),we(m.attributeValue,xe),Ae=ye,ue=_.attributeName}),re)),d(ie,_.attributeValueBegin,(Z={},d(Z,p.space,u),d(Z,p.quote,function(ye){Re=ye,xe="",ue=_.attributeValue}),d(Z,p.gt,function(){xe="",we(m.attributeValue,xe),de="",ue=_.data}),d(Z,p.char,function(ye){Re="",xe=ye,ue=_.attributeValue}),Z)),d(ie,_.attributeValue,(te={},d(te,p.space,function(ye){if(Re)xe+=ye;else we(m.attributeValue,xe),ue=_.attributeNameStart}),d(te,p.quote,function(ye){if(Re===ye)we(m.attributeValue,xe),ue=_.attributeNameStart;else xe+=ye}),d(te,p.gt,function(ye){if(Re)xe+=ye;else we(m.attributeValue,xe),de="",ue=_.data}),d(te,p.slash,function(ye){if(Re)xe+=ye;else we(m.attributeValue,xe),Me=!0,ue=_.tagEnd}),d(te,p.char,function(ye){xe+=ye}),te)),ie);var _e=function(ye){if(Y.debug)console.log(ue,ye);var Se=le.stateMachine[ue],Ne=Se[g(ye)]||Se[p.error]||Se[p.char];Ne(ye)};return le.write=function(ye){var Se=ye.length;for(var Ne=0;Ne<Se;Ne++)_e(ye[Ne])},le},y={State:_,Action:p,Type:m,create:f},x=y.Type,C={element:"element",text:"text"},b=function(Y){return Object.assign({name:"",type:C.element,value:"",parent:null,attributes:{},children:[]},Y)},I=function(Y){Y=Object.assign({stream:!1,parentNodes:!0,doneEvent:"done",tagPrefix:"tag:",emitTopLevelOnly:!1,debug:!1},Y);var X=void 0,K=void 0,J=void 0,ee=void 0,se=new h,ne=function(re){switch(re.type){case x.openTag:if(J===null)J=K,J.name=re.value;else{var Z=b({name:re.value,parent:J});J.children.push(Z),J=Z}break;case x.closeTag:var te=J.parent;if(!Y.parentNodes)J.parent=null;if(J.name!==re.value)break;if(Y.stream&&te===K)K.children=[],J.parent=null;if(!Y.emitTopLevelOnly||te===K)se.emit(Y.tagPrefix+J.name,J),se.emit("tag",J.name,J);if(J===K)X.removeAllListeners("data"),se.emit(Y.doneEvent,J),K=null;J=te;break;case x.text:if(J)J.children.push(b({type:C.text,value:re.value,parent:Y.parentNodes?J:null}));break;case x.attributeName:ee=re.value,J.attributes[ee]="";break;case x.attributeValue:J.attributes[ee]=re.value;break}};return se.reset=function(){X=y.create({debug:Y.debug}),X.on("data",ne),K=b(),J=null,ee="",se.parse=X.write},se.reset(),se},v=function(Y,X){X=Object.assign({},X,{stream:!1,tagPrefix:":"});var K=I(X),J=void 0;return K.on("done",function(ee){J=ee}),K.parse(Y),J},P={parseSync:v,create:I,NodeType:C},M=P.parseSync,B=function(Y){var X=M("<root>".concat(Y,"</root>"),{parentNodes:!1}),K=X.children&&X.children.length>0&&X.children.every(function(J){return J.name==="svg"});if(K)return X.children.length===1?X.children[0]:X.children;else throw Error("nothing to parse")},T=function(Y){return l(Y,function(X){if(!D(X))return N(X);return X})},N=function(Y){return Y.replace(/[-|:]([a-z])/gi,function(X,K){return K.toUpperCase()})},D=function(Y){return/^(data|aria)(-\w+)/.test(Y)},L=function(Y){if(Y){var X=String(Y);return/[&<>]/.test(X)?"<![CDATA[".concat(X.replace(/]]>/,"]]]]><![CDATA[>"),"]]>"):X}return""},H=function(Y){return String(Y).replace(/&/g,"&amp;").replace(/'/g,"&apos;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},V=function(Y){var X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},K=X.transformNode,J=K===void 0?function(re){return re}:K,ee=X.camelcase,se=ee===void 0?!1:ee,ne=function(re){var Z=J(re);if(se)Z=T(Z);return Z};return ne(B(Y))};function O(){for(var Y=arguments.length,X=Array(Y),K=0;K<Y;K++)X[K]=arguments[K];return new Promise(function(J,ee){try{var se=V.apply(void 0,X);J(se)}catch(ne){ee(ne)}})}var U=function Y(X){var K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},J=K.transformAttr,ee=J===void 0?function(de,me,Ae){return"".concat(de,'="').concat(Ae(me),'"')}:J,se=K.transformNode,ne=se===void 0?function(de){return de}:se,re=K.selfClose,Z=re===void 0?!0:re;if(Array.isArray(X))return X.map(function(de){return Y(de,{transformAttr:ee,selfClose:Z,transformNode:ne})}).join("");var te=ne(X);if(te.type==="text")return L(te.value);var ie="";for(var le in te.attributes){var ue=ee(le,te.attributes[le],H,te.name);ie+=ue?" ".concat(ue):""}return te.children&&te.children.length>0||!Z?"<".concat(te.name).concat(ie,">").concat(Y(te.children,{transformAttr:ee,transformNode:ne,selfClose:Z}),"</").concat(te.name,">"):"<".concat(te.name).concat(ie,"/>")},j=Object.assign({},{parse:O,parseSync:V,stringify:U});return j})}),H8t={"0":"M0.301025 0.257813 L0.206593 0.283385 L0.122042 0.361307 L0.075923 0.474441 L0.064942 0.642221 L0.091296 0.78289 L0.159376 0.899463 L0.257104 0.961214 L0.344948 0.961214 L0.442678 0.899463 L0.510757 0.78289 L0.537111 0.642221 L0.526131 0.474441 L0.480012 0.361307 L0.39546 0.283385 L0.301025 0.257813","1":"M0.220426 0.40845 L0.381626 0.270996 L0.381626 0.948966","2":"M0.110409 0.39212 L0.125621 0.342293 L0.170571 0.295823 L0.244237 0.26431 L0.291518 0.257813 L0.373319 0.263799 L0.434683 0.290705 L0.468239 0.331966 L0.480292 0.379913 L0.479492 0.411806 L0.465088 0.465192 L0.402571 0.568988 L0.245134 0.766438 L0.07959 0.948045 L0.522462 0.948045","3":"M0.081606 0.345073 L0.119154 0.315633 L0.178996 0.284091 L0.255265 0.257813 L0.349133 0.263062 L0.43127 0.289348 L0.48994 0.336662 L0.525141 0.394491 L0.513407 0.457577 L0.466472 0.504892 L0.384334 0.541692 L0.290464 0.56272 L0.20833 0.573235 L0.290464 0.583749 L0.384334 0.610035 L0.466472 0.652092 L0.519274 0.709922 L0.531007 0.773007 L0.50754 0.841351 L0.454738 0.899179 L0.3726 0.946494 L0.310412 0.961214 L0.209503 0.959111 L0.127367 0.946494 L0.071046 0.929671","4":"M0.418494 0.270996 L0.048828 0.724199 L0.553224 0.724199 M0.414181 0.578167 L0.414181 0.94897","5":"M0.074951 0.270996 L0.074951 0.614701 L0.267655 0.5695 L0.405247 0.586502 L0.460002 0.617189 L0.498028 0.660731 L0.527101 0.779401 L0.513352 0.841049 L0.477274 0.889568 L0.406378 0.93463 L0.324445 0.958337 L0.247399 0.962139 L0.182516 0.949767 L0.130068 0.925508 L0.074951 0.875607 M0.074951 0.270996 L0.527101 0.270996","6":"M0.428549 0.257813 L0.341433 0.285053 L0.26073 0.312099 L0.192188 0.360182 L0.138902 0.410969 L0.098219 0.500422 L0.070249 0.584267 L0.067264 0.670716 L0.065164 0.756863 L0.087163 0.820973 L0.108168 0.861042 L0.157916 0.913131 L0.210981 0.948192 L0.29279 0.961214 L0.384548 0.956206 L0.456409 0.924151 L0.507262 0.881077 L0.5349 0.821975 L0.537111 0.771889 L0.521634 0.718798 L0.498418 0.67372 L0.463042 0.636657 L0.414398 0.613617 L0.34696 0.598591 L0.28284 0.595587 L0.215403 0.605604 L0.145756 0.641665 L0.109274 0.678729 L0.064942 0.724006","7":"M0.071534 0.270996 L0.530519 0.270996 L0.495935 0.291702 L0.477752 0.305407 L0.435186 0.346112 L0.412067 0.374136 L0.388565 0.40796 L0.365315 0.448098 L0.342943 0.495062 L0.322081 0.549366 L0.303364 0.611524 L0.287416 0.68205 L0.270077 0.80465 L0.26253 0.94897","8":"M0.286761 0.257813 L0.210684 0.27162 L0.1414 0.305622 L0.092494 0.382125 L0.111513 0.450128 L0.16857 0.502193 L0.228345 0.539382 L0.377781 0.594635 L0.470161 0.645637 L0.52586 0.706203 L0.538087 0.792269 L0.506841 0.87621 L0.438915 0.927212 L0.339743 0.961214 L0.263666 0.959089 L0.174004 0.929337 L0.102003 0.881523 L0.063965 0.811395 L0.066682 0.741266 L0.102003 0.671139 L0.180797 0.608448 L0.259591 0.580822 L0.358762 0.548945 L0.456576 0.49688 L0.486463 0.446941 L0.487822 0.362999 L0.453859 0.302434 L0.384574 0.265245 L0.286761 0.257813","9":"M0.511026 0.437812 L0.491026 0.347812 L0.451026 0.297812 L0.391026 0.267812 L0.311026 0.257813 L0.231026 0.267812 L0.161026 0.297812 L0.111026 0.347812 L0.091026 0.417812 L0.111026 0.487812 L0.161026 0.537812 L0.231026 0.567812 L0.311026 0.577812 L0.391026 0.557812 L0.451026 0.517812 L0.491026 0.477812 L0.511026 0.437812 M0.510026 0.438812 L0.434026 0.636812 L0.381026 0.777812 L0.337026 0.879812 L0.301026 0.957812","!":"M0.301026 0.270996 L0.301026 0.749566 M0.251466 0.94897 L0.350587 0.94897",'"':"M0.16504 0.270996 L0.16504 0.523022 M0.437013 0.270996 L0.437013 0.523022","#":"M0.20958 0.282227 L0.146515 0.949754 M0.461844 0.282227 L0.398779 0.949754 M0.032999 0.526969 L0.600587 0.452796 M0.001465 0.82366 L0.569055 0.749486",$:"M0.307121 0.240234 L0.307121 1.083502 M0.490031 0.415915 L0.404676 0.328075 L0.23396 0.310507 L0.136407 0.398347 L0.099828 0.521324 L0.124213 0.591596 L0.197379 0.644299 L0.429061 0.697003 L0.502224 0.749708 L0.526613 0.837547 L0.477836 0.960526 L0.355897 1.013228 L0.197379 0.99566 L0.112021 0.942957 L0.07544 0.837547","'":"M0.301026 0.270996 L0.301026 0.523022","(":"M0.413087 0.241211 L0.372337 0.28347 L0.331589 0.334184 L0.290838 0.393349 L0.25009 0.460965 L0.219528 0.528584 L0.199153 0.5962 L0.188966 0.655364 L0.199153 0.714529 L0.219528 0.782146 L0.25009 0.849764 L0.290838 0.91738 L0.331589 0.976544 L0.372337 1.027258 L0.413087 1.069491",")":"M0.188966 0.241211 L0.229716 0.28347 L0.270466 0.334184 L0.311213 0.393349 L0.351964 0.460965 L0.382526 0.528584 L0.4029 0.5962 L0.413087 0.655364 L0.4029 0.714529 L0.382526 0.782146 L0.351964 0.849764 L0.311213 0.91738 L0.270466 0.976544 L0.229716 1.027258 L0.188966 1.069491","*":"M0.301026 0.458702 L0.301026 0.681942 M0.301026 0.458702 L0.520997 0.536834 M0.301026 0.458702 L0.439954 0.257813 M0.301026 0.458702 L0.162098 0.257813 M0.301026 0.458702 L0.081055 0.536834","+":"M0.042969 0.66845 L0.559083 0.66845 M0.301023 0.428223 L0.301023 0.908661",",":"M0.38672 0.852051 L0.215333 1.030661 L0.301025 1.119971","-":"M0.173829 0.686035 L0.428224 0.686035",".":"M0.362549 0.851074 L0.239503 0.851074","/":"M0.062501 1.035249 L0.539551 0.270996","<":"M0.559083 0.441895 L0.042969 0.66939 L0.042969 0.66939 L0.559083 0.896902","=":"M0.042969 0.545898 L0.559083 0.545898 M0.042969 0.80837 L0.559083 0.80837",">":"M0.042969 0.441895 L0.559083 0.66939 L0.559083 0.66939 L0.042969 0.896902",A:"M0.018067 0.94897 L0.290179 0.270996 L0.583986 0.94897 M0.155303 0.684521 L0.433548 0.684521",B:"M0.063965 0.94897 L0.063965 0.278953 L0.209356 0.270996 L0.342486 0.294394 L0.432179 0.37292 L0.418224 0.48773 L0.312686 0.549166 L0.084728 0.575531 L0.306377 0.589434 L0.468877 0.647456 L0.538087 0.736658 L0.5324 0.85202 L0.501247 0.902983 L0.42355 0.944398 L0.063965 0.94897",C:"M0.529054 0.419847 L0.498425 0.345196 L0.442238 0.292341 L0.33583 0.257813 L0.257199 0.268357 L0.187906 0.303748 L0.120243 0.385432 L0.072998 0.599844 L0.110073 0.815385 L0.165381 0.902183 L0.222883 0.942801 L0.334904 0.961214 L0.43253 0.937679 L0.504816 0.868999 L0.529054 0.772065",D:"M0.064454 0.94897 L0.071838 0.285078 L0.171217 0.270996 L0.247348 0.272633 L0.37101 0.306078 L0.462461 0.378304 L0.514748 0.475555 L0.535591 0.576392 L0.537599 0.652313 L0.528065 0.717381 L0.508562 0.772419 L0.445948 0.855695 L0.362356 0.90871 L0.225203 0.945862 L0.064454 0.94897",E:"M0.080078 0.270996 L0.080078 0.94897 M0.080078 0.270996 L0.521974 0.270996 M0.080078 0.609981 L0.389405 0.609981 M0.080078 0.94897 L0.521974 0.94897",F:"M0.086426 0.270996 L0.086426 0.94897 M0.091304 0.275607 L0.515626 0.275607 M0.091304 0.607677 L0.447344 0.607677",G:"M0.498034 0.284943 L0.374621 0.257813 L0.244219 0.268648 L0.160577 0.311997 L0.094556 0.398116 L0.056397 0.58404 L0.076752 0.785532 L0.120865 0.858197 L0.188947 0.916734 L0.271008 0.953591 L0.357069 0.961214 L0.43715 0.932047 L0.501262 0.858539 L0.545656 0.648611 L0.329595 0.648131",H:"M0.066895 0.270996 L0.066895 0.94897 M0.066895 0.595658 L0.530009 0.595658 M0.535157 0.270996 L0.535157 0.94897",I:"M0.301026 0.270996 L0.301026 0.94897",J:"M0.506839 0.270996 L0.507814 0.782193 L0.498468 0.846168 L0.480733 0.880789 L0.455864 0.90832 L0.426095 0.929408 L0.360746 0.954812 L0.302508 0.962139 L0.223573 0.953638 L0.16538 0.930312 L0.137072 0.907715 L0.116428 0.880312 L0.102822 0.848819 L0.095633 0.813947 L0.094239 0.776413",K:"M0.035401 0.270996 L0.035401 0.94897 M0.502258 0.316194 L0.035401 0.687823 M0.212484 0.582361 L0.566652 0.933903",L:"M0.07544 0.270996 L0.07544 0.94897 L0.526613 0.94897",M:"M0.042481 0.94897 L0.042481 0.270996 L0.301027 0.712492 L0.559571 0.270996 L0.559571 0.94897",N:"M0.067871 0.94897 L0.067871 0.270996 L0.534181 0.94897 L0.525031 0.270996",O:"M0.287293 0.961214 L0.19843 0.933567 L0.1172 0.849451 L0.057129 0.563945 L0.114348 0.350255 L0.18455 0.289392 L0.306101 0.257813 L0.42054 0.29572 L0.487543 0.365003 L0.544923 0.625294 L0.516366 0.789624 L0.465476 0.884596 L0.375084 0.949287 L0.287293 0.961214",P:"M0.070557 0.94897 L0.070557 0.28379 L0.20704 0.270996 L0.329134 0.278993 L0.408525 0.300514 L0.444022 0.317908 L0.500637 0.368929 L0.525796 0.423728 L0.531496 0.50384 L0.508934 0.554205 L0.473724 0.582043 L0.417577 0.604365 L0.336375 0.620372 L0.226014 0.629268 L0.082368 0.630258",Q:"M0.282435 1.050813 L0.195447 1.019646 L0.115933 0.924817 L0.057129 0.602943 L0.113139 0.362034 L0.18186 0.293418 L0.300844 0.257813 L0.412868 0.300553 L0.478457 0.37866 L0.534625 0.672103 L0.506671 0.857367 L0.456855 0.964437 L0.368371 1.037368 L0.282435 1.050813 M0.341225 0.815559 L0.544923 1.070653",R:"M0.034912 0.944112 L0.034912 0.288556 L0.227127 0.270996 L0.362038 0.276867 L0.443423 0.294907 L0.477644 0.309614 L0.505809 0.328757 L0.526616 0.352817 L0.544963 0.418061 L0.543241 0.475921 L0.524463 0.517817 L0.49076 0.546518 L0.444265 0.564799 L0.355195 0.578739 L0.047653 0.589627 M0.303054 0.617306 L0.56714 0.94897",S:"M0.483037 0.364333 L0.407613 0.267477 L0.22883 0.257813 L0.128623 0.327565 L0.087712 0.455539 L0.104656 0.518727 L0.168054 0.573307 L0.41928 0.617318 L0.503796 0.669342 L0.535157 0.759324 L0.493846 0.900055 L0.367668 0.961214 L0.205436 0.956661 L0.116711 0.907038 L0.066895 0.790334",T:"M0.022949 0.270996 L0.579103 0.270996 M0.309284 0.270996 L0.309284 0.94897",U:"M0.072022 0.270996 L0.07308 0.648875 L0.080372 0.75167 L0.099024 0.827813 L0.134786 0.885729 L0.181571 0.924023 L0.251464 0.95168 L0.339655 0.962139 L0.401553 0.951668 L0.45232 0.924086 L0.482701 0.891771 L0.495745 0.870529 L0.515699 0.81637 L0.525014 0.744626 L0.530031 0.272017",V:"M0.027832 0.270996 L0.320083 0.94897 L0.57422 0.270996",W:"M0 0.270996 L0.079799 0.940377 L0.285198 0.472884 L0.505255 0.94897 L0.602052 0.270996",X:"M0.009034 0.270996 L0.586805 0.94897 M0.593019 0.270996 L0.015246 0.94897",Y:"M0.018067 0.270996 L0.293132 0.574135 M0.583986 0.271959 L0.294954 0.57606 L0.305277 0.94897",Z:"M0.053711 0.270996 L0.548341 0.270996 L0.053711 0.94897 L0.548341 0.94897","[":"M0.404542 0.240234 L0.197511 0.240234 L0.197511 1.069424 L0.404542 1.069424","\\":"M0.062501 0.270996 L0.539551 1.035249","]":"M0.19751 0.240234 L0.404542 0.240234 L0.404542 1.069424 L0.19751 1.069424","^":"M0.035156 0.523931 L0.301024 0.270996 L0.566896 0.523931",_:"M0 1.160601 L0.602052 1.160601",a:"M0.527101 0.439941 L0.527101 0.973965 M0.527101 0.553824 L0.451366 0.477535 L0.376759 0.439941 L0.263722 0.439941 L0.187989 0.477535 L0.112255 0.553824 L0.074951 0.66881 L0.074951 0.745099 L0.112255 0.85898 L0.187989 0.93527 L0.263722 0.973965 L0.376759 0.973965 L0.451366 0.93527 L0.527101 0.85898",b:"M0.07666 0.240234 L0.07666 0.959985 M0.07666 0.582737 L0.151822 0.514237 L0.225865 0.480483 L0.338045 0.480483 L0.413211 0.514237 L0.488374 0.582737 L0.525392 0.685983 L0.525392 0.754485 L0.488374 0.856739 L0.413211 0.92524 L0.338045 0.959985 L0.225865 0.959985 L0.151822 0.92524 L0.07666 0.856739",c:"M0.512452 0.553823 L0.441624 0.477535 L0.371854 0.439941 L0.26614 0.439941 L0.195312 0.477535 L0.124486 0.553823 L0.0896 0.668808 L0.0896 0.745099 L0.124486 0.858979 L0.195312 0.93527 L0.26614 0.973965 L0.371854 0.973965 L0.441624 0.93527 L0.512452 0.858979",d:"M0.525392 0.240234 L0.525392 0.959985 M0.525392 0.582737 L0.450232 0.514237 L0.376189 0.480483 L0.264006 0.480483 L0.188844 0.514237 L0.11368 0.582737 L0.076661 0.685983 L0.076661 0.754485 L0.11368 0.856739 L0.188844 0.92524 L0.264006 0.959985 L0.376189 0.959985 L0.450232 0.92524 L0.525392 0.856739",e:"M0.059571 0.668808 L0.542482 0.668808 M0.542482 0.592521 L0.502641 0.516231 L0.461594 0.477535 L0.381914 0.439941 L0.261186 0.439941 L0.180299 0.477535 L0.099412 0.553823 L0.059571 0.668808 L0.059571 0.745099 L0.099412 0.858979 L0.180299 0.93527 L0.261186 0.973965 L0.381914 0.973965 L0.461594 0.93527 L0.542482 0.858979",f:"M0.512941 0.240234 L0.406984 0.240234 L0.301026 0.274346 L0.248047 0.374731 L0.248047 0.946817 M0.089112 0.476088 L0.459965 0.476088",g:"M0.525392 0.439941 L0.525392 0.989395 L0.488373 1.091918 L0.45023 1.126757 L0.376189 1.160601 L0.264004 1.160601 L0.188844 1.126757 L0.113681 1.058075 L0.076661 0.954555 M0.525392 0.542467 L0.45023 0.473786 L0.376189 0.439941 L0.264004 0.439941 L0.188844 0.473786 L0.113681 0.542467 L0.076661 0.645988 L0.076661 0.714669 L0.113681 0.817193 L0.188844 0.885875 L0.264004 0.920713 L0.376189 0.920713 L0.45023 0.885875 L0.525392 0.817193",h:"M0.092041 0.240234 L0.092041 0.946817 M0.092041 0.61058 L0.205937 0.509225 L0.282214 0.476086 L0.396109 0.476086 L0.47187 0.509225 L0.510011 0.61058 L0.510011 0.946817",i:"M0.261026 0.240234 L0.341026 0.240234 M0.300978 0.476089 L0.300978 0.946817",j:"M0.3853 0.240234 L0.447023 0.240234 M0.416159 0.465708 L0.416159 1.011689 L0.383887 1.108586 L0.252832 1.140264 L0.15503 1.108586",k:"M0.065186 0.240234 L0.065186 0.946817 M0.493824 0.476086 L0.065186 0.812323 M0.236758 0.677829 L0.536867 0.946817",l:"M0.301026 0.234863 L0.301026 0.946441",m:"M0.050538 0.439941 L0.050538 0.960796 M0.050538 0.588758 L0.114405 0.476607 L0.157178 0.439941 L0.236864 0.439941 L0.279637 0.476607 L0.32241 0.588758 L0.32241 0.960796 M0.32241 0.588758 L0.386281 0.476607 L0.428467 0.439941 L0.50874 0.439941 L0.551515 0.476607 L0.551515 0.960796",n:"M0.092041 0.439941 L0.092041 0.960796 M0.092041 0.588758 L0.205936 0.476607 L0.282216 0.439941 L0.396113 0.439941 L0.471871 0.476607 L0.510011 0.588758 L0.510011 0.960796",o:"M0.247175 0.439941 L0.175178 0.477535 L0.103186 0.553823 L0.066895 0.668808 L0.066895 0.745099 L0.103186 0.858979 L0.175178 0.93527 L0.247175 0.973965 L0.354874 0.973965 L0.426872 0.93527 L0.498866 0.858979 L0.535157 0.745099 L0.535157 0.668808 L0.498866 0.553823 L0.426872 0.477535 L0.354874 0.439941 L0.247175 0.439941",p:"M0.076904 0.439941 L0.076904 1.154244 M0.076904 0.541563 L0.151986 0.473487 L0.225944 0.439941 L0.338005 0.439941 L0.413087 0.473487 L0.488166 0.541563 L0.525148 0.644169 L0.525148 0.712246 L0.488166 0.813866 L0.413087 0.881942 L0.338005 0.916471 L0.225944 0.916471 L0.151986 0.881942 L0.076904 0.813866",q:"M0.525148 0.441895 L0.525148 1.156195 M0.525148 0.5435 L0.450067 0.47544 L0.376106 0.441895 L0.264042 0.441895 L0.188966 0.47544 L0.113885 0.5435 L0.076905 0.646108 L0.076905 0.714187 L0.113885 0.815809 L0.188966 0.883886 L0.264042 0.918418 L0.376106 0.918418 L0.450067 0.883886 L0.525148 0.815809",r:"M0.107422 0.439941 L0.107422 0.960796 M0.107422 0.663164 L0.155824 0.551014 L0.252626 0.476607 L0.349428 0.439941 L0.49463 0.439941",s:"M0.475556 0.477535 L0.400757 0.439941 L0.276092 0.439941 L0.176361 0.477535 L0.101563 0.553823 L0.101563 0.630112 L0.176361 0.668808 L0.301024 0.668808 L0.425688 0.745099 L0.50049 0.821387 L0.50049 0.897677 L0.425688 0.93527 L0.325956 0.973965 L0.201295 0.973965 L0.126496 0.93527 L0.101563 0.858979",t:"M0.246032 0.297852 L0.246032 0.826549 L0.301023 0.919323 L0.411011 0.950848 L0.520997 0.950848 M0.081055 0.515799 L0.466004 0.515799",u:"M0.092041 0.454102 L0.092041 0.826134 L0.13018 0.937211 L0.205936 0.974954 L0.319832 0.974954 L0.396113 0.937211 L0.510011 0.826134 M0.510011 0.454102 L0.510011 0.974954",v:"M0.048828 0.453125 L0.301026 0.961719 M0.553224 0.453125 L0.301026 0.961719",w:"M0 0.453125 L0.150512 0.961719 M0.301024 0.453125 L0.150512 0.961719 M0.301024 0.453125 L0.451539 0.961719 M0.602052 0.453125 L0.451539 0.961719",x:"M0.03711 0.453125 L0.564943 0.961719 M0.564943 0.453125 L0.03711 0.961719",y:"M0.084618 0.453125 L0.320232 0.921476 M0.55713 0.453125 L0.320232 0.921476 L0.242119 1.055289 L0.163369 1.122196 L0.084618 1.155166 L0.044922 1.155166",z:"M0.505373 0.452148 L0.09668 0.961651 M0.09668 0.452148 L0.505373 0.452148 M0.09668 0.961651 L0.505373 0.961651"},F8t={};for(let e in H8t){F8t[e]=[];let t=H8t[e].split("M").slice(1).map((n)=>n.split("L").map((o)=>o.trim().split(" ").map(parseFloat)));for(let n of t)for(let o=0;o<n.length-1;o++)F8t[e].push({x1:n[o][0],y1:1-n[o][1],x2:n[o+1][0],y2:1-n[o+1][1]})}var S6s=(()=>{let e=new Uint8Array(4),t=new Uint32Array(e.buffer);return!((t[0]=1)&e[0])})(),P6s={int8:globalThis.Int8Array,uint8:globalThis.Uint8Array,int16:globalThis.Int16Array,uint16:globalThis.Uint16Array,int32:globalThis.Int32Array,uint32:globalThis.Uint32Array,uint64:globalThis.BigUint64Array,int64:globalThis.BigInt64Array,float32:globalThis.Float32Array,float64:globalThis.Float64Array},Wwo=[];for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)if(t&1)t=3988292384^t>>>1;else t=t>>>1;Wwo[e]=t}var Xwo=new Uint16Array([255]),jwo=new Uint8Array(Xwo.buffer),E6s=jwo[0]===255,Kwo=new Uint16Array([255]),$wo=new Uint8Array(Kwo.buffer),M6s=$wo[0]===255,w6s=new Uint8Array(0),B6s=Uint8Array.of(137,80,78,71,13,10,26,10),T6s=new TextDecoder("latin1"),{cos:D6s,sin:N6s,PI:R6s}=Math,{tan:Q6s}=Math,k6s=Ywo(Uwo(),1);function OHe(e,t){if(e.points)for(let n of e.points)n.step=t;if(e.lines)for(let n of e.lines)n.step=t;if(e.infiniteLines)for(let n of e.infiniteLines)n.step=t;if(e.polygons)for(let n of e.polygons)n.step=t;if(e.rects)for(let n of e.rects)n.step=t;if(e.circles)for(let n of e.circles)n.step=t;if(e.texts)for(let n of e.texts)n.step=t;return e}var YFe=class{MAX_ITERATIONS=1e5;solved=!1;failed=!1;iterations=0;progress=0;error=null;activeSubSolver;failedSubSolvers;timeToSolve;stats={};_setupDone=!1;getSolverName(){return this.constructor.name}setup(){if(this._setupDone)return;this._setup(),this._setupDone=!0}_setup(){}step(){if(!this._setupDone)this.setup();if(this.solved)return;if(this.failed)return;this.iterations++;try{this._step()}catch(e){throw this.error=`${this.getSolverName()} error: ${e}`,this.failed=!0,e}if(!this.solved&&this.iterations>=this.MAX_ITERATIONS)this.tryFinalAcceptance();if(!this.solved&&this.iterations>=this.MAX_ITERATIONS)this.error=`${this.getSolverName()} ran out of iterations`,this.failed=!0;if("computeProgress"in this)this.progress=this.computeProgress()}_step(){}getConstructorParams(){throw Error("getConstructorParams not implemented")}getOutput(){return null}solve(){let e=Date.now();while(!this.solved&&!this.failed)this.step();let t=Date.now();this.timeToSolve=t-e}visualize(){return{lines:[],points:[],rects:[],circles:[]}}tryFinalAcceptance(){}preview(){return{lines:[],points:[],rects:[],circles:[]}}};function VHe(e,t,n,o={}){return{solverName:e,solverClass:t,getConstructorParams:n,onSolved:o.onSolved}}var qwo=class extends YFe{startTimeOfStage={};endTimeOfStage={};timeSpentOnStage={};firstIterationOfStage={};currentPipelineStageIndex=0;inputProblem;pipelineOutputs={};constructor(e){super();this.inputProblem=e,this.MAX_ITERATIONS=1e6}_step(){let e=this.pipelineDef[this.currentPipelineStageIndex];if(!e){this.solved=!0;return}if(this.activeSubSolver){if(this.activeSubSolver.step(),this.activeSubSolver.solved){this.endTimeOfStage[e.solverName]=performance.now(),this.timeSpentOnStage[e.solverName]=this.endTimeOfStage[e.solverName]-this.startTimeOfStage[e.solverName];let n=this.activeSubSolver.getOutput();if(n!==null)this.pipelineOutputs[e.solverName]=n;e.onSolved?.(this),this.activeSubSolver=null,this.currentPipelineStageIndex++}else if(this.activeSubSolver.failed)this.error=this.activeSubSolver?.error,this.failed=!0,this.activeSubSolver=null;return}let t=e.getConstructorParams(this);this.activeSubSolver=new e.solverClass(...t),this[e.solverName]=this.activeSubSolver,this.timeSpentOnStage[e.solverName]=0,this.startTimeOfStage[e.solverName]=performance.now(),this.firstIterationOfStage[e.solverName]=this.iterations}solveUntilStage(e){while(this.getCurrentStageName().toLowerCase()!==e.toLowerCase())if(this.step(),this.failed||this.solved)break}getCurrentStageName(){return this.pipelineDef[this.currentPipelineStageIndex]?.solverName??"none"}getStageProgress(){let e=this.pipelineDef.length;if(e===0)return 1;let t=this.activeSubSolver?.progress??0;return(this.currentPipelineStageIndex+t)/e}getStageStats(){let e={};for(let t of this.pipelineDef){let n=this.timeSpentOnStage[t.solverName]||0,o=this.firstIterationOfStage[t.solverName]||0,r=this.iterations,i=t.solverName===this.getCurrentStageName()?r-o:0,s=this.currentPipelineStageIndex>this.pipelineDef.findIndex((a)=>a.solverName===t.solverName);e[t.solverName]={timeSpent:n,iterations:i,completed:s}}return e}initialVisualize(){return null}finalVisualize(){return null}visualize(){if(!this.solved&&this.activeSubSolver)return this.activeSubSolver.visualize();let e=0,t=this.initialVisualize();if(t)OHe(t,0),e=1;let n=null;if(this.solved)n=this.finalVisualize();let o=[t].filter(Boolean).concat(this.pipelineDef.map((r,i)=>{let s=this[r.solverName]?.visualize();if(!s)return null;return OHe(s,i+e),s}).filter(Boolean));if(o.length===0)return{points:[],rects:[],lines:[],circles:[],texts:[]};if(this.solved&&n)OHe(n,o.length+e+1),o.push(n);if(o.length===1)return o[0];return{points:o.flatMap((r)=>r.points||[]),rects:o.flatMap((r)=>r.rects||[]),lines:o.flatMap((r)=>r.lines||[]),circles:o.flatMap((r)=>r.circles||[]),texts:o.flatMap((r)=>r.texts||[])}}preview(){if(this.activeSubSolver)return this.activeSubSolver.preview();return super.preview()}computeProgress(){return this.getStageProgress()}getStageOutput(e){return this.pipelineOutputs[e]}getAllOutputs(){return{...this.pipelineOutputs}}hasStageOutput(e){return e in this.pipelineOutputs}getSolver(e){return this[e]}};function z8t(e,t){if(e.route_type==="through_pad")return t?e.end:e.start;return{x:e.x,y:e.y}}function YHe(e,t){if(e.route_type==="wire")return e.layer;if(e.route_type==="via")return t?e.to_layer:e.from_layer;return t?e.end_layer:e.start_layer}function Jwo(e){let t=new Set;for(let o of e){if(o.type!=="source_bus")continue;if(o.max_length_skew===void 0&&o.target_length===void 0&&!o.length_match_source_trace_ids?.length)continue;for(let r of o.source_trace_ids)t.add(r);for(let r of o.length_match_source_trace_ids??[])t.add(r)}let n=[];for(let[o,r]of e.entries()){if(r.type!=="pcb_trace")continue;for(let i=0;i<r.route.length-1;i++){let s=r.route[i],a=r.route[i+1],c=(p)=>["wire","via","through_pad"].includes(p.route_type);if(!c(s)||!c(a))throw Error(r.pcb_trace_id+": unsupported route point at "+i);if(s.route_type!=="wire"&&a.route_type!=="wire")continue;if(YHe(s,!0)!==YHe(a,!1))continue;let l=z8t(s,!0),h=z8t(a,!1);if(![l.x,l.y,h.x,h.y].every(Number.isFinite))throw Error(r.pcb_trace_id+": nonfinite route coordinates at "+i);let d=Math.hypot(h.x-l.x,h.y-l.y);if(d<=0.000000001)continue;let u=s.route_type==="wire"?s:a,_=u.route_type==="wire"?Math.max(u.width,u.end_width??u.width):0;if(!Number.isFinite(_)||_<=0)throw Error(r.pcb_trace_id+": invalid wire width at "+i);n.push({pcbTraceId:r.pcb_trace_id,sourceTraceId:r.source_trace_id,pcbGroupId:r.pcb_group_id,subcircuitId:r.subcircuit_id,circuitJsonIndex:o,startRouteIndex:i,endRouteIndex:i+1,layer:YHe(s,!0),start:{...l},end:{...h},width:_,lengthMm:d})}}return{circuitJson:e,segments:n,lengthMatchedSourceTraceIds:t}}function Zwo(e){return e.map((t)=>({issue:t,color:"#ff5555",message:t.message}))}function eK(e,t){let n=Zwo(t);return{coordinateSystem:"cartesian",lines:[...e.segments.map((o)=>({points:[o.start,o.end],strokeColor:o.layer==="bottom"?"#60a5fa":"#94a3b8",strokeWidth:o.width})),...n.flatMap(({issue:o,color:r,message:i})=>(o.constituentSegments??[o]).map((s)=>({points:[s.start,s.end],strokeColor:r,strokeWidth:Math.max(s.width*2,0.25),label:i})))],points:n.map(({issue:o,color:r,message:i},s)=>({...o.location,color:r,label:s+1+": "+i}))}}function eBo(e,t,n){let o=n.x-t.x,r=n.y-t.y,i=o*o+r*r,s=i?Math.max(0,Math.min(1,((e.x-t.x)*o+(e.y-t.y)*r)/i)):0;return Math.hypot(e.x-t.x-s*o,e.y-t.y-s*r)}function C7t(e){let t=[],n=(o)=>{let r=[[0,o.length-1]];while(r.length){let[i,s]=r.pop();if(i===s)continue;let a=o[i].start,c=o[s].end,l=1/0,h=-1,d=i;for(let _=i;_<=s;_++){if(l=Math.min(l,o[_].width),_===s)continue;let p=eBo(o[_].end,a,c);if(p>h)h=p,d=_}if(h>l/2+0.000000001){r.push([d+1,s],[i,d]);continue}let u=o.slice(i,s+1);t.push({...o[i],endRouteIndex:o[s].endRouteIndex,end:c,width:u.reduce((_,p)=>Math.max(_,p.width),0),lengthMm:Math.hypot(c.x-a.x,c.y-a.y),constituentSegments:u,maxCenterlineDeviationMm:h<=0.000000001?0:h})}};for(let o of b7t(e))n(o);return[...e.segments.filter((o)=>!GFe(e,o)),...t]}function GFe(e,t){return t.sourceTraceId!==void 0&&(e.lengthMatchedSourceTraceIds?.has(t.sourceTraceId)??!1)}function b7t(e){let t=[],n=[];for(let o of e.segments){if(GFe(e,o)){if(n.length)t.push(n);n=[];continue}let r=n.at(-1);if(r){let i=e.circuitJson[o.circuitJsonIndex];if(!(r.circuitJsonIndex===o.circuitJsonIndex&&i.type==="pcb_trace"&&i.route.slice(r.endRouteIndex,o.startRouteIndex+1).every((s)=>s.route_type==="wire"&&s.layer===o.layer))||r.layer!==o.layer||Math.hypot(r.end.x-o.start.x,r.end.y-o.start.y)>0.000000001)t.push(n),n=[]}n.push(o)}if(n.length)t.push(n);return t}var tBo=class extends YFe{params;segments=[];nextSegment=0;candidates;constructor(e){super();if(this.params=e,!Number.isFinite(e.maxSegmentLengthMm)||e.maxSegmentLengthMm<=0)throw Error("maxSegmentLengthMm must be finite and positive");this.candidates=C7t(e.ctx),this.MAX_ITERATIONS=this.candidates.length+2}_step(){let e=this.candidates[this.nextSegment++];if(!e){this.solved=!0,this.progress=1;return}if(e.lengthMm>this.params.maxSegmentLengthMm)this.segments.push(e);this.progress=this.nextSegment/this.candidates.length,this.stats={segmentsChecked:this.nextSegment,candidateCount:this.segments.length}}getOutput(){return this.segments}visualize(){return eK(this.params.ctx,[])}getConstructorParams(){return[this.params]}};function I7t(e,t){let{start:n,end:o}=e,r=(e.constituentSegments??[e]).reduce((i,s)=>({minX:Math.min(i.minX,s.start.x-s.width/2,s.end.x-s.width/2),minY:Math.min(i.minY,s.start.y-s.width/2,s.end.y-s.width/2),maxX:Math.max(i.maxX,s.start.x+s.width/2,s.end.x+s.width/2),maxY:Math.max(i.maxY,s.start.y+s.width/2,s.end.y+s.width/2)}),{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0});return{...e,issueId:t+":"+e.circuitJsonIndex+":"+e.startRouteIndex,severity:"error",message:"",location:{x:(n.x+o.x)/2,y:(n.y+o.y)/2},bounds:r}}var v7t=class extends YFe{ctx;issues=[];nextSegment=0;constructor(e){super();this.ctx=e,this.MAX_ITERATIONS=e.segments.length+2}_step(){let e=this.ctx.segments[this.nextSegment++];if(!e){this.solved=!0,this.progress=1;return}let t=this.checkSegment(e);if(t)this.issues.push(t);this.progress=this.nextSegment/this.ctx.segments.length,this.stats={segmentsChecked:this.nextSegment,issueCount:this.issues.length}}getOutput(){return this.issues}visualize(){return eK(this.ctx,this.issues)}},nBo=class extends v7t{params;constructor(e){super({...e.ctx,segments:e.candidateSegments??C7t(e.ctx)});if(this.params=e,!Number.isFinite(e.maxSegmentLengthMm)||e.maxSegmentLengthMm<=0)throw Error("maxSegmentLengthMm must be finite and positive");if(!Number.isFinite(e.angleToleranceDegrees)||e.angleToleranceDegrees<0||e.angleToleranceDegrees>=22.5)throw Error("angleToleranceDegrees must be in [0, 22.5)");let t=new Set;for(let n of this.ctx.segments){if(!n.constituentSegments||!this.checkSegment(n))continue;for(let o of n.constituentSegments)t.add(o.circuitJsonIndex+":"+o.startRouteIndex)}this.ctx={...this.ctx,segments:this.ctx.segments.filter((n)=>n.constituentSegments||!t.has(n.circuitJsonIndex+":"+n.startRouteIndex))}}checkSegment(e){if(GFe(this.params.ctx,e))return;if(e.lengthMm<=this.params.maxSegmentLengthMm)return;let t=(Math.atan2(e.end.y-e.start.y,e.end.x-e.start.x)*180/Math.PI+360)%360,n=Math.round(t/45)*45,o=Math.abs(t-n),r=Math.atan2(2*(e.maxCenterlineDeviationMm??0),e.lengthMm)*180/Math.PI;if(o<=this.params.angleToleranceDegrees+r+0.0000000001)return;return{...I7t(e,"odd-angle"),lineItemType:"PcbTraceSegmentOddAngle",maxSegmentLengthMm:this.params.maxSegmentLengthMm,angleDegrees:t,nearestAllowedAngleDegrees:n%360,deviationDegrees:o,angleToleranceDegrees:this.params.angleToleranceDegrees,...e.constituentSegments?{angleUncertaintyDegrees:r}:{},message:e.pcbTraceId+(e.constituentSegments?" run "+e.startRouteIndex+" → "+e.endRouteIndex:" segment "+e.startRouteIndex)+" on "+e.layer+" is "+e.lengthMm.toFixed(3)+" mm long (threshold "+this.params.maxSegmentLengthMm+" mm) and at "+t.toFixed(3)+"°; nearest allowed direction "+n%360+"° (deviation "+o.toFixed(3)+"°, tolerance "+this.params.angleToleranceDegrees+"°"+(r?", approximation allowance "+r.toFixed(3)+"°":"")+")"}}visualize(){return eK(this.params.ctx,this.issues)}getConstructorParams(){return[this.params]}};function oBo(e){return(Math.atan2(e.end.y-e.start.y,e.end.x-e.start.x)*180/Math.PI+360)%360}function GHe(e,t){return Math.abs((e-t+540)%360-180)}var rBo=class extends v7t{params;bendCounts=new Map;constructor(e){super({...e.ctx,segments:[]});this.params=e;let t=e.minStaircaseBends??6,n=e.minStaircaseLengthMm??2,o=e.maxStairStepLengthMm??1;if(!Number.isInteger(t)||t<2)throw Error("minStaircaseBends must be an integer of at least 2");if(!Number.isFinite(n)||n<=0)throw Error("minStaircaseLengthMm must be finite and positive");if(!Number.isFinite(o)||o<=0)throw Error("maxStairStepLengthMm must be finite and positive");let r=[];for(let i of b7t(e.ctx)){let s=[];for(let a of i){let c=oBo(a),l=s.at(-1);if(l&&GHe(l.direction,c)<=4.0000000001)l.parts.push(a),l.lengthMm+=a.lengthMm;else s.push({direction:c,parts:[a],lengthMm:a.lengthMm})}for(let a=0;a<s.length-1;){let c=s[a],l=s[a+1],h=GHe(c.direction,l.direction);if(h<14.9999999999||h>90.0000000001||c.lengthMm>o+0.000000001||l.lengthMm>o+0.000000001){a++;continue}let d=a+2;while(d<s.length&&GHe(s[d].direction,s[a+(d-a)%2].direction)<=4.0000000001&&s[d].lengthMm<=o+0.000000001)d++;let u=s.slice(a,d).flatMap((p)=>p.parts),_=u.reduce((p,m)=>p+m.lengthMm,0);if(d-a-1>=t&&_+0.000000001>=n){let p={...u[0],end:u.at(-1).end,endRouteIndex:u.at(-1).endRouteIndex,width:u.reduce((m,A)=>Math.max(m,A.width),0),lengthMm:_,constituentSegments:u};r.push(p),this.bendCounts.set(p,d-a-1),a=d}else a=d-1}}this.ctx={...e.ctx,segments:r},this.MAX_ITERATIONS=r.length+2}checkSegment(e){let t=this.bendCounts.get(e);return{...I7t(e,"staircase"),lineItemType:"PcbTraceStaircase",bendCount:t,minStaircaseBends:this.params.minStaircaseBends??6,minStaircaseLengthMm:this.params.minStaircaseLengthMm??2,maxStairStepLengthMm:this.params.maxStairStepLengthMm??1,message:`${e.pcbTraceId} route ${e.startRouteIndex} → ${e.endRouteIndex} on ${e.layer} has ${t} alternating staircase bends over ${e.lengthMm.toFixed(3)} mm`}}visualize(){return eK(this.params.ctx,this.issues)}getConstructorParams(){return[this.params]}},iBo=class extends qwo{options;ctx;pipelineDef=[VHe("LongTraceSegmentSolver",tBo,(e)=>[{ctx:e.ctx,maxSegmentLengthMm:e.options.maxSegmentLengthMm??5}]),VHe("OddAngleTraceSegmentSolver",nBo,(e)=>[{ctx:e.ctx,candidateSegments:e.getSolver("LongTraceSegmentSolver").getOutput(),maxSegmentLengthMm:e.options.maxSegmentLengthMm??5,angleToleranceDegrees:e.options.angleToleranceDegrees??4}]),VHe("StaircaseTraceSolver",rBo,(e)=>[{ctx:e.ctx,minStaircaseBends:e.options.minStaircaseBends,minStaircaseLengthMm:e.options.minStaircaseLengthMm,maxStairStepLengthMm:e.options.maxStairStepLengthMm}])];constructor(e,t={}){super(e);if(this.options=t,t.issueTypes){let n=t.issueTypes.includes("PcbTraceSegmentOddAngle"),o=t.issueTypes.includes("PcbTraceStaircase");this.pipelineDef=this.pipelineDef.filter((r)=>r.solverName==="StaircaseTraceSolver"?o:n)}this.MAX_ITERATIONS=e.reduce((n,o)=>n+(o.type==="pcb_trace"?o.route.length*5:0),10)}_setup(){this.ctx=Jwo(this.inputProblem)}getOutput(){return{issues:[...this.getSolver("OddAngleTraceSegmentSolver")?.getOutput()??[],...this.getSolver("StaircaseTraceSolver")?.getOutput()??[]]}}getConstructorParams(){return[this.inputProblem,this.options]}initialVisualize(){return this.setup(),eK(this.ctx,[])}finalVisualize(){return this.setup(),eK(this.ctx,this.getOutput().issues)}};function sBo(e,t={}){let n=new iBo(e,t);if(n.solve(),n.failed)throw Error(n.error??"PCB style analysis failed");return n.getOutput()}function aBo(e){return sBo(e,{issueTypes:["PcbTraceSegmentOddAngle"]}).issues.filter((t)=>t.lineItemType==="PcbTraceSegmentOddAngle").map((t)=>({type:"pcb_trace_style_warning",pcb_trace_style_warning_id:`pcb_trace_style_warning_${t.pcbTraceId}_${t.startRouteIndex}_${t.endRouteIndex}`,warning_type:"pcb_trace_style_warning",styling_issue_type:"long_segment_at_odd_angle",pcb_trace_id:t.pcbTraceId,source_trace_id:t.sourceTraceId,subcircuit_id:t.subcircuitId,layer:t.layer,start_route_index:t.startRouteIndex,end_route_index:t.endRouteIndex,segment_start:t.start,segment_end:t.end,center:t.location,segment_length:t.lengthMm,minimum_segment_length:t.maxSegmentLengthMm,angle_degrees:t.angleDegrees,nearest_allowed_angle_degrees:t.nearestAllowedAngleDegrees,angle_deviation_degrees:t.deviationDegrees,angle_tolerance_degrees:t.angleToleranceDegrees,message:`${Dw(e,t.pcbTraceId)} has a ${t.lengthMm.toFixed(2)} mm segment on ${t.layer} at ${t.angleDegrees.toFixed(2)}°, ${t.deviationDegrees.toFixed(2)}° from the nearest allowed direction (${t.nearestAllowedAngleDegrees}°). Prefer a multiple of 45° for segments longer than ${t.maxSegmentLengthMm} mm (tolerance ${t.angleToleranceDegrees}°).`}))}function cBo(e,t,n){if(e.connected_source_port_ids.length!==2||!t.length)return;let o=e.connected_source_port_ids.map((A)=>n.filter((g)=>g.type==="pcb_port"&&g.source_port_id===A));if(o.some((A)=>A.length!==1))return;let r=new Map,i=new Set,s=[],a=(A,g)=>`${A.x.toFixed(6)},${A.y.toFixed(6)},${g}`,c=!0,l=(A,g,f,y,x)=>{if(![A.x,A.y,f.x,f.y,x].every(Number.isFinite)){c=!1;return}let C=a(A,g),b=a(f,y);if(C===b)return;let I=[C,b].sort().join("|");if(i.has(I)){c=!1;return}i.add(I);for(let[v,P,M,B]of[[C,A,g,b],[b,f,y,C]]){if(!r.has(v))r.set(v,{point:P,layer:M,edges:new Set});r.get(v).edges.add(B)}if(g===y){if(x<=0)c=!1;s.push({a:A,b:f,layer:g,width:x})}else if(Math.hypot(A.x-f.x,A.y-f.y)>0.000001)c=!1};for(let A of t)for(let g=0;g<A.route.length;g++){let f=A.route[g],y=A.route[g+1];if(f.route_type==="through_pad"||y?.route_type==="through_pad")return;if(f.route_type==="wire"&&f.width_interpolation_mode)return;if(f.route_type==="via")l(f,f.from_layer,f,f.to_layer,0);if(!y)continue;let x=f.route_type==="wire"?f.layer:f.to_layer,C=y.route_type==="wire"?y.layer:y.from_layer;if(x!==C){c=!1;continue}let b=f.route_type==="wire"?Math.max(f.width,f.end_width??f.width):y.route_type==="wire"?y.width:0;l(f,x,y,C,b)}for(let A of n.filter((g)=>g.type==="pcb_via")){let g=A.layers.filter((f)=>r.has(a(A,f)));if(g.length>2){c=!1;continue}if(g.length===2){let f=a(A,g[0]),y=a(A,g[1]);if(!i.has([f,y].sort().join("|")))l(A,g[0],A,g[1],0)}}if(!c||!s.length||[...r.values()].some((A)=>A.edges.size>2))return;let h=[...r.entries()].filter(([,A])=>A.edges.size===1);if(h.length!==2)return;let d=(A,g)=>A.layers.includes(g.layer)&&Math.hypot(A.x-g.point.x,A.y-g.point.y)<=0.00001,[u,_]=o.map((A)=>A[0]);if(!(d(u,h[0][1])&&d(_,h[1][1]))&&!(d(u,h[1][1])&&d(_,h[0][1])))return;let p=new Set,m=[h[0][0]];while(m.length){let A=m.pop();if(p.has(A))continue;p.add(A),m.push(...r.get(A).edges)}if(p.size!==r.size)return;return{length:s.reduce((A,g)=>A+Math.hypot(g.a.x-g.b.x,g.a.y-g.b.y),0),manhattan:Math.abs(u.x-_.x)+Math.abs(u.y-_.y),segments:s}}var Uj=(e,t)=>e.x*t.x+e.y*t.y,L2e=(e,t)=>({x:e.x-t.x,y:e.y-t.y});function lBo(e,t,n){let o=L2e(e.b,e.a),r=L2e(t.b,t.a),i=L2e(e.a,t.a),s=Uj(r,r);if(s===0)return[];let a=Uj(i,r)/s,c=Uj(o,r)/s,l=[0,1];if(Math.abs(c)>0.000000000000001){for(let d of[-a/c,(1-a)/c])if(d>0&&d<1)l.push(d)}l.sort((d,u)=>d-u);let h=[];for(let d=0;d<l.length-1;d++){let u=l[d],_=l[d+1],p=a+c*(u+_)/2,m=i,A=o;if(p>=1)m=L2e(e.a,t.b);else if(p>0)m={x:i.x-r.x*a,y:i.y-r.y*a},A={x:o.x-r.x*c,y:o.y-r.y*c};let g=Uj(A,A),f=2*Uj(m,A),y=Uj(m,m)-n*n;if(g<0.00000000000000000001){if(y<-0.000000000001)h.push([u,_]);continue}let x=f*f-4*g*y;if(x<=0)continue;let C=Math.sqrt(x),b=Math.max(u,(-f-C)/(2*g)),I=Math.min(_,(-f+C)/(2*g));if(I-b>0.0000000001)h.push([b,I])}return h}function hBo(e,t){let n=(i,s,a)=>(s.x-i.x)*(a.y-i.y)-(s.y-i.y)*(a.x-i.x),o=(i,s,a,c)=>Math.max(Math.min(i,s),Math.min(a,c))<=Math.min(Math.max(i,s),Math.max(a,c));if(o(e.a.x,e.b.x,t.a.x,t.b.x)&&o(e.a.y,e.b.y,t.a.y,t.b.y)&&n(e.a,e.b,t.a)*n(e.a,e.b,t.b)<=0&&n(t.a,t.b,e.a)*n(t.a,t.b,e.b)<=0)return 0;let r=(i,s)=>{let a=s.b.x-s.a.x,c=s.b.y-s.a.y,l=a*a+c*c,h=l?Math.max(0,Math.min(1,((i.x-s.a.x)*a+(i.y-s.a.y)*c)/l)):0;return Math.hypot(i.x-s.a.x-h*a,i.y-s.a.y-h*c)};return Math.min(r(e.a,t),r(e.b,t),r(t.a,e),r(t.b,e))}var mO=0.00000001,S7t=(e)=>[e.length_match_source_trace_ids,e.min_length,e.max_length,e.target_length,e.length_tolerance,e.pcb_trace_spacing,e.pcb_spacing_to_other_signals,e.target_impedance_min,e.target_impedance_max,e.target_differential_impedance_min,e.target_differential_impedance_max].some((t)=>t!==void 0);function dBo(e){let t=[],n=e.filter((_)=>_.type==="source_bus"),o=new Map(e.filter((_)=>_.type==="source_trace").map((_)=>[_.source_trace_id,_])),r=e.filter((_)=>_.type==="pcb_trace"),i=new Map;for(let _ of r){if(!_.source_trace_id)continue;let p=i.get(_.source_trace_id)??[];p.push(_),i.set(_.source_trace_id,p)}let s=new Map,a=(_)=>{if(!s.has(_)){let p=o.get(_);s.set(_,p&&cBo(p,i.get(_)??[],e))}return s.get(_)},c=[];for(let _ of r)for(let p=0;p<_.route.length-1;p++){let m=_.route[p],A=_.route[p+1];if(m.route_type==="through_pad"||A.route_type==="through_pad")continue;let g=m.route_type==="wire"?m.layer:m.to_layer,f=A.route_type==="wire"?A.layer:A.from_layer,y=Math.max(m.route_type==="wire"?Math.max(m.width,m.end_width??m.width):0,A.route_type==="wire"?Math.max(A.width,A.end_width??A.width):0);if(g!==f||y<=0||![m.x,m.y,A.x,A.y,y].every(Number.isFinite))continue;c.push({trace:_,segment:{a:m,b:A,layer:g,width:y}})}let l=c.length?new _3(c.length):void 0,h=0;for(let{segment:_}of c)h=Math.max(h,_.width),l.add(Math.min(_.a.x,_.b.x),Math.min(_.a.y,_.b.y),Math.max(_.a.x,_.b.x),Math.max(_.a.y,_.b.y));l?.finish();let d=(_,p)=>typeof _==="number"?_:_.width_multiplier*p,u=new Set(n.filter((_)=>_.differential_pair).map((_)=>[_.differential_pair.positive_source_trace_id,_.differential_pair.negative_source_trace_id].sort().join("|")));for(let _ of n){if(!S7t(_))continue;let p=[...new Set(_.source_trace_ids)],m=[...new Set([...p,..._.length_match_source_trace_ids??[]])],A=(v,P,M)=>({message:`${P?"Unverified ":""}bus ${Ks(e,_.source_bus_id)}: ${M}`,source_bus_id:_.source_bus_id,source_trace_ids:v,pcb_trace_ids:v.flatMap((B)=>(i.get(B)??[]).map((T)=>T.pcb_trace_id)),subcircuit_id:_.subcircuit_id}),g=(v,P,M=p[0])=>{t.push(Bfe.parse({type:"pcb_bus_routing_constraint_warning",pcb_bus_routing_constraint_warning_id:`pcb_bus_routing_constraint_warning_${_.source_bus_id}_${t.length}`,...A([M],!0,P),routing_rule:v}))},f=(v,P,M=p[0])=>{let B=v.routing_rule==="length_skew"?m:[M];t.push(wfe.parse({type:"pcb_bus_routing_constraint_error",pcb_bus_routing_constraint_error_id:`pcb_bus_routing_constraint_error_${_.source_bus_id}_${t.length}`,...A(B,!1,P),...v}))},y=(v,P)=>{let M=v.find((B)=>!a(B));if(M)g(P,"a signal lacks complete, unbranched pad-to-pad geometry",M);return!M};if(_.max_length_skew!==void 0&&y(m,"route_geometry")){let v=m.map((M)=>a(M).length),P=Math.max(...v)-Math.min(...v);if(P>_.max_length_skew+mO)f({routing_rule:"length_skew",actual_length_skew:P,maximum_length_skew:_.max_length_skew},`planar length skew is ${P.toFixed(3)} mm`,m[v.indexOf(Math.max(...v))])}let x=(v)=>{if(v===void 0||typeof v==="number")return v;let P=v.source_trace_ids??m;if(!P.length||!y(P,"reference_geometry"))return;return Math.max(...P.map((M)=>a(M).manhattan))+(v.offset??0)},C=x(_.min_length),b=x(_.max_length),I=x(_.target_length);if(_.target_length!==void 0&&_.length_tolerance===void 0)g("target_length","a target length requires an explicit length tolerance");else if(_.length_tolerance!==void 0&&_.target_length===void 0)g("target_length","a length tolerance requires an explicit target length");if([_.min_length,_.max_length,_.target_length].some((v)=>v!==void 0)&&y(p,"route_geometry"))for(let v of p){let P=a(v).length;if(C!==void 0&&P<C-mO)f({routing_rule:"min_length",actual_trace_length:P,minimum_trace_length:C},"planar length is below the declared minimum",v);if(b!==void 0&&P>b+mO)f({routing_rule:"max_length",actual_trace_length:P,maximum_trace_length:b},"planar length exceeds the declared maximum",v);if(I!==void 0&&_.length_tolerance!==void 0&&Math.abs(P-I)>_.length_tolerance+mO)f({routing_rule:"target_length",actual_trace_length:P,target_trace_length:I,length_tolerance:_.length_tolerance},"planar length is outside the target tolerance",v)}for(let v of p){if(_.pcb_trace_spacing===void 0&&_.pcb_spacing_to_other_signals===void 0)break;let P=a(v);if(!P){g("spacing_geometry","spacing requires supported route geometry",v);continue}let M=new Set;for(let B of P.segments){let T=Math.max(...[_.pcb_trace_spacing,_.pcb_spacing_to_other_signals].filter((N)=>N!==void 0).map((N)=>d(N,Math.max(B.width,h))));for(let N of l?.search(Math.min(B.a.x,B.b.x)-T,Math.min(B.a.y,B.b.y)-T,Math.max(B.a.x,B.b.x)+T,Math.max(B.a.y,B.b.y)+T)??[]){let{trace:D,segment:L}=c[N],H=D.source_trace_id;if(v===H||B.layer!==L.layer||H&&u.has([v,H].sort().join("|")))continue;if(H&&o.get(v)?.connected_source_net_ids.some((j)=>o.get(H)?.connected_source_net_ids.includes(j)))continue;let V=H!==void 0&&p.includes(H),O=V?_.pcb_trace_spacing:_.pcb_spacing_to_other_signals;if(O===void 0)continue;let U=d(O,Math.max(B.width,L.width));if(lBo(B,L,U-mO).length){let j=V?"pcb_trace_spacing":"pcb_spacing_to_other_signals";if(!M.has(j))f({routing_rule:j,other_pcb_trace_id:D.pcb_trace_id,other_source_trace_id:H,actual_centerline_spacing:hBo(B,L),minimum_centerline_spacing:U},`${Ks(e,v)} falls below declared centreline spacing`,v);M.add(j)}}}}for(let[v,P,M]of[[_.target_impedance,_.target_impedance_min,_.target_impedance_max],[_.target_differential_impedance,_.target_differential_impedance_min,_.target_differential_impedance_max]]){if([v,P,M].every((B)=>B===void 0))continue;if(v!==void 0&&(P!==void 0&&v<P-mO||M!==void 0&&v>M+mO))f({routing_rule:"impedance_target",target_impedance:v,minimum_impedance:P,maximum_impedance:M},"declared impedance target is outside its bounds");g("physical_impedance","actual impedance requires physical stackup analysis; declared targets are not measured impedance")}}return t}var uBo=(e)=>{let t=e.filter((r)=>r.type==="source_bus"),n=s7t(e),o=[];for(let r of t){if(r.max_length_skew===void 0||S7t(r))continue;let i=[...new Set(r.source_trace_ids)].flatMap((a)=>{let c=n.get(a)?.filter((l)=>l.trace_length!==void 0||l.route.length>1);if(!c?.length)return[];return[{id:a,traces:c,length:c.reduce((l,h)=>l+i7t(h),0)}]});if(i.length<2)continue;let s=Math.max(...i.map((a)=>a.length))-Math.min(...i.map((a)=>a.length));if(s<=r.max_length_skew+0.000000001)continue;o.push({type:"pcb_bus_length_skew_error",pcb_bus_length_skew_error_id:`pcb_bus_length_skew_error_${r.source_bus_id}`,error_type:"pcb_bus_length_skew_error",message:`PCB bus ${Ks(e,r.source_bus_id)} has ${s.toFixed(2)}mm length skew, exceeding the ${r.max_length_skew}mm maximum`,source_bus_id:r.source_bus_id,source_trace_ids:i.map((a)=>a.id),pcb_trace_ids:i.flatMap((a)=>a.traces.map((c)=>c.pcb_trace_id)),actual_length_skew:s,maximum_length_skew:r.max_length_skew,subcircuit_id:r.subcircuit_id})}return o};function oK(e,t){let n=new Map,o=new Map;for(let l of e){let h=Za(l);if(o.set(h,l),"pcb_component_id"in l&&l.pcb_component_id)n.set(h,l.pcb_component_id)}let r=t.flatMap((l)=>l.type==="pcb_footprint_overlap_error"?l.related_errors??[l]:[l]),i=new Map,s=new Map;for(let l of r){let h;if(l.type==="pcb_footprint_overlap_error"){if(l.pcb_keepout_ids?.length)continue;let _=l,p=[...l.pcb_smtpad_ids??[],...l.pcb_plated_hole_ids??[],...l.pcb_hole_ids??[]];if(p.some((m)=>!n.has(m)))continue;h=_.pcb_component_ids??p.map((m)=>n.get(m))}else if(l.type==="pcb_pad_pad_clearance_error"){if(l.pcb_pad_ids.some((_)=>!n.has(_)))continue;h=l.pcb_pad_ids.map((_)=>n.get(_))}else if(l.type==="pcb_courtyard_overlap_error")h=l.pcb_component_ids;else continue;if(h=[...new Set(h)].sort(),h.length!==2)continue;let d=JSON.stringify(h);s.set(l,d);let u=i.get(d)??[];u.push(l),i.set(d,u)}let a=new Map;for(let[l,h]of i){let d=h.filter((f)=>f.type==="pcb_footprint_overlap_error");if(h.length<2||d.length===0)continue;let u=JSON.parse(l),_=u.map((f)=>{let y=o.get(f),x=y?.type==="pcb_component"?o.get(y.source_component_id):void 0;return x?.type==="source_component"?x.name:f}),m=[[d.length,"footprint overlap"],[h.filter((f)=>f.type==="pcb_pad_pad_clearance_error").length,"pad clearance violation"],[h.filter((f)=>f.type==="pcb_courtyard_overlap_error").length,"courtyard conflict"]].filter(([f])=>f>0).map(([f,y])=>`${f} ${y}${f===1?"":"s"}`),A={type:"pcb_footprint_overlap_error",error_type:"pcb_footprint_overlap_error",pcb_error_id:`pcb_component_overlap_${u.join("_")}`,pcb_component_ids:u,message:`${_.join(" overlaps ")}: ${m.join(", ")}. Move the components apart.`,related_errors:h};if(h.some((f)=>f.is_fatal))A.is_fatal=!0;let g=new Set;for(let f of h)if(f.type==="pcb_footprint_overlap_error")for(let y of[...f.pcb_smtpad_ids??[],...f.pcb_plated_hole_ids??[],...f.pcb_hole_ids??[]])g.add(y);else if(f.type==="pcb_pad_pad_clearance_error")for(let y of f.pcb_pad_ids)g.add(y);for(let[f,y]of[["pcb_smtpad_ids","pcb_smtpad"],["pcb_plated_hole_ids","pcb_plated_hole"],["pcb_hole_ids","pcb_hole"]]){let x=[...g].filter((C)=>o.get(C)?.type===y).sort();if(x.length)A[f]=x}a.set(l,A)}let c=new Set;return r.flatMap((l)=>{let h=s.get(l),d=h===void 0?void 0:a.get(h);if(!d||h===void 0)return[l];if(c.has(h))return[];return c.add(h),[d]})}function pBo(e){let t=new Map,n=(s)=>{let a=s;while(t.has(a)&&t.get(a)!==a)a=t.get(a);while(t.has(s)&&t.get(s)!==a){let c=t.get(s);t.set(s,a),s=c}return a},o=(s)=>{if(s.length<2)return;let a=n(s[0]);for(let c of s.slice(1))t.set(n(c),a)},r=new Map;for(let s of e){if(s.type==="source_net"&&s.name.trim()){let a=r.get(s.name)??[];a.push(s),r.set(s.name,a)}if(s.type==="source_trace")o([...s.connected_source_net_ids.map((a)=>`net:${a}`),...s.connected_source_port_ids.map((a)=>`port:${a}`)]);if(s.type==="source_component_internal_connection")o(s.source_port_ids.map((a)=>`port:${a}`));if(s.type==="source_component")for(let a of s.internally_connected_source_port_ids??[])o(a.map((c)=>`port:${c}`))}let i=[];for(let[s,a]of r){let c=new Set(a.map((h)=>n(`net:${h.source_net_id}`)));if(c.size<2)continue;let l=a.map((h)=>h.source_net_id).sort();i.push({type:"source_confusing_net_name_warning",source_confusing_net_name_warning_id:`source_confusing_net_name_warning_${l[0]}`,warning_type:"source_confusing_net_name_warning",message:`Nets named "${s}" are not all connected (${c.size} separate electrical networks). Connect them or use distinct names to avoid confusion.`,source_net_ids:l,net_name:s,...a.every((h)=>h.subcircuit_id===a[0].subcircuit_id)?{subcircuit_id:a[0].subcircuit_id}:{}})}return i}function mBo(e){switch(e.insertion_direction){case"from_left":return"x-";case"from_right":return"x+";case"from_top":return"y+";case"from_bottom":return"y-";case"from_above":case"from_below":return null;default:return null}}function _Bo(e){if(e.insertion_direction)return mBo(e);if(!e.center||!e.cable_insertion_center)return null;let t=e.cable_insertion_center.x-e.center.x,n=e.cable_insertion_center.y-e.center.y;if(Math.abs(t)<0.000001&&Math.abs(n)<0.000001)return null;if(Math.abs(t)>=Math.abs(n))return t>=0?"x+":"x-";return n>=0?"y+":"y-"}function gBo(e,t){if(!e.center)return null;let n=[{direction:"x-",distance:e.center.x-t.minX},{direction:"x+",distance:t.maxX-e.center.x},{direction:"y-",distance:e.center.y-t.minY},{direction:"y+",distance:t.maxY-e.center.y}];return n.sort((o,r)=>o.distance-r.distance),n[0]?.direction??null}function UFe(e){let t=e.find((s)=>s.type==="pcb_board");if(!t)return[];let n=(()=>{try{return K9t(t)}catch{return null}})();if(!n)return[];let o=[],r=e.filter((s)=>s.type==="pcb_component"),i=new Set(e.filter((s)=>s.type==="source_component"&&s.ftype==="simple_pin_header").map((s)=>s.source_component_id));for(let s of r){if(!s.insertion_direction&&i.has(s.source_component_id))continue;let a=_Bo(s),c=gBo(s,n);if(!a||!c)continue;if(a===c)continue;let l=yO(e,s.pcb_component_id),h=s.insertion_direction?`${l} is facing ${a} but should face ${c} so the connector is accessible from the board edge`:`${l} is inferred to face ${a} from its cable insertion center because no explicit footprint insertionDirection is defined, but should face ${c} so the connector is accessible from the board edge. Set insertionDirection on the <footprint> to specify the actual direction in the footprint's unrotated orientation; for example, <footprint insertionDirection="from_above"> for a connector accessed from above the PCB (+Z).`;o.push({type:"pcb_connector_not_in_accessible_orientation_warning",warning_type:"pcb_connector_not_in_accessible_orientation_warning",pcb_connector_not_in_accessible_orientation_warning_id:`pcb_connector_not_in_accessible_orientation_warning_${s.pcb_component_id}`,message:h,pcb_component_id:s.pcb_component_id,source_component_id:s.source_component_id,pcb_board_id:t.pcb_board_id,facing_direction:a,recommended_facing_direction:c,subcircuit_id:s.subcircuit_id})}return o}function O8t(e){if(e.type==="pcb_courtyard_rect"){let t=e.width/2,n=e.height/2,o=[{x:-t,y:-n},{x:+t,y:-n},{x:+t,y:+n},{x:-t,y:+n}],r=(e.ccw_rotation??0)*Math.PI/180,i=Math.cos(r),s=Math.sin(r);return o.map(({x:a,y:c})=>({x:e.center.x+a*i-c*s,y:e.center.y+a*s+c*i}))}if(e.type==="pcb_courtyard_circle")return Array.from({length:32},(n,o)=>{let r=2*Math.PI*o/32;return{x:e.center.x+e.radius*Math.cos(r),y:e.center.y+e.radius*Math.sin(r)}});return e.outline}function V8t(e,t){return yO(e,t)}function ABo(e,t){if(e.some((n)=>Db(n,t)))return!0;if(t.some((n)=>Db(n,e)))return!0;for(let n=0;n<e.length;n++){let o=e[n],r=e[(n+1)%e.length];for(let i=0;i<t.length;i++){let s=t[i],a=t[(i+1)%t.length];if(GA(o,r,s,a))return!0}}return!1}function fBo(e){let t=new Set(e.flatMap((s)=>s.type==="pcb_component"&&s.do_not_place?[s.pcb_component_id]:[])),n=e.filter((s)=>s.type==="pcb_courtyard_rect"||s.type==="pcb_courtyard_circle"||s.type==="pcb_courtyard_outline").filter((s)=>!t.has(s.pcb_component_id)),o=new Map;for(let s of n){let a=s.pcb_component_id;if(!o.has(a))o.set(a,[]);o.get(a).push(s)}let r=Array.from(o.keys()),i=[];for(let s=0;s<r.length;s++)for(let a=s+1;a<r.length;a++){let c=r[s],l=r[a],h=!1;e:for(let d of o.get(c))for(let u of o.get(l)){if("layer"in d&&"layer"in u&&d.layer!==u.layer)continue;let _=O8t(d),p=O8t(u);if(ABo(_,p)){h=!0;break e}}if(h)i.push({type:"pcb_courtyard_overlap_error",pcb_error_id:`pcb_courtyard_overlap_${c}_${l}`,error_type:"pcb_courtyard_overlap_error",message:`Courtyard of ${V8t(e,c)} overlaps with courtyard of ${V8t(e,l)}`,pcb_component_ids:[c,l]})}return i}function yBo(e,{minClearance:t}={}){let n=t??z9(O9(e),"min_trace_to_hole_edge_clearance")??d1.min_trace_to_hole_edge_clearance;if(!Number.isFinite(n)||n<0)throw Error("Trace-to-hole clearance must be finite and non-negative");let o=$8t(e);if(o.length===0)return[];let r=new nK({objects:o,getId:(a)=>a.elementId,getBounds:(a)=>({minX:a.bounds.xmin,minY:a.bounds.ymin,maxX:a.bounds.xmax,maxY:a.bounds.ymax})}),i=new Map,s=new Set;for(let a of e){if(a.type!=="pcb_trace")continue;for(let c=1;c<a.route.length;c++){let l=a.route[c-1],h=a.route[c];if(l.route_type!=="wire"&&l.route_type!=="via"||h.route_type!=="wire"&&h.route_type!=="via")continue;if(l.route_type!=="wire"&&h.route_type!=="wire")continue;if(l.route_type==="wire"&&h.route_type==="wire"&&l.layer!==h.layer)continue;let d=Math.max(l.route_type==="wire"?l.width:0,h.route_type==="wire"?h.width:0)/2,u=r.getObjectsInBounds({minX:Math.min(l.x,h.x),minY:Math.min(l.y,h.y),maxX:Math.max(l.x,h.x),maxY:Math.max(l.y,h.y)},n+d);for(let _ of u){let p=_.sourceElement;if(p.type!=="pcb_hole")continue;let{gap:m,center:A}=q8t({x1:l.x,y1:l.y,x2:h.x,y2:h.y,thickness:d*2},_),g=`${a.pcb_trace_id}_${p.pcb_hole_id}`;if($j(m)){i.delete(g),s.add(g);continue}if(s.has(g))continue;if(m+0.000001>=n)continue;if((i.get(g)?.gap??1/0)<=m)continue;i.set(g,{gap:m,error:{type:"pcb_trace_error",error_type:"pcb_trace_error",pcb_trace_error_id:`overlap_${g}`,pcb_trace_id:a.pcb_trace_id,source_trace_id:a.source_trace_id??"",pcb_component_ids:p.pcb_component_id?[p.pcb_component_id]:[],pcb_port_ids:[],center:A,message:`Trace ${Dw(e,a.pcb_trace_id)} is too close to non-plated hole ${Ks(e,p.pcb_hole_id)} (gap: ${m.toFixed(6)}mm, required: ${n}mm)`}})}}}return Array.from(i.values(),({error:a})=>a)}var xBo=(e)=>e.type==="pcb_courtyard_circle"||e.type==="pcb_courtyard_outline"||e.type==="pcb_courtyard_polygon"||e.type==="pcb_courtyard_rect",CBo=(e,t)=>{if(t.type==="pcb_courtyard_circle"){let o=e.x-t.center.x,r=e.y-t.center.y;return o*o+r*r<=t.radius*t.radius}if(t.type==="pcb_courtyard_rect"){let o=-1*(t.ccw_rotation??0)*Math.PI/180,r=e.x-t.center.x,i=e.y-t.center.y,s=r*Math.cos(o)-i*Math.sin(o),a=r*Math.sin(o)+i*Math.cos(o);return Math.abs(s)<=t.width/2&&Math.abs(a)<=t.height/2}let n=t.type==="pcb_courtyard_polygon"?t.points:t.outline;return Db(e,n)},bBo=(e,t)=>{let n=e.find((r)=>r.type==="pcb_component"&&r.pcb_component_id===t),o=e.find((r)=>r.type==="source_component"&&r.source_component_id===n?.source_component_id);return(o&&"name"in o?o.name:void 0)??yO(e,t)};function IBo(e){let t=e.filter((c)=>c.type==="source_component"&&c.ftype==="simple_test_point"),n=new Set(t.map((c)=>c.source_component_id)),o=new Map(t.map((c)=>[c.source_component_id,c.name])),r=e.filter((c)=>c.type==="pcb_component"&&n.has(c.source_component_id)),i=e.filter(xBo),s=[],a=new Set;for(let c of r)for(let l of i){if(l.pcb_component_id===c.pcb_component_id)continue;if(l.layer!==c.layer)continue;if(!CBo(c.center,l))continue;let h=`${c.pcb_component_id}:${l.pcb_component_id}`;if(a.has(h))continue;a.add(h);let d=o.get(c.source_component_id)??"Test point",u=bBo(e,l.pcb_component_id);s.push({type:"pcb_placement_error",pcb_placement_error_id:`testpoint_in_courtyard_${c.pcb_component_id}_${l.pcb_component_id}`,error_type:"pcb_placement_error",message:`Test point ${d} is not accessible because it is inside the courtyard of ${u}`,subcircuit_id:c.subcircuit_id})}return s}async function J2e(e,{consolidateOverlaps:t=!0}={}){let n=[...eMo(e),...UMo(e),...iMo(e),...lMo(e),...pMo(e),..._Mo(e),...dMo(e),...NMo(e),...QMo(e),...FMo(e),...fBo(e),...UFe(e),...IBo(e)];return t?oK(e,n):n}async function P7t(e){return[...WMo(e),...XMo(e),...pBo(e),...jMo(e)]}async function E7t(e){return[...ZMo(e),...nwo(e),...rwo(e),...kwo(e)]}async function Z2e(e){cFe(e);let t={connMap:Aa(e),pcbConnectivityMap:aFe(e)};return[...KEo(e,t),...bMo(e,t),...CMo(e),...gMo(e),...LMo(e),...aBo(e),...uBo(e),...dBo(e),...HMo(e),...qEo(e,t),...XEo(e,t),...zMo(e,t),...yBo(e),...OMo(e,t),...VMo(e,t),...fMo(e,t),...yMo(e,t),...MMo(e,t),...NEo(e,t),...BMo(e)]}/*! Bundled license information:

@tscircuit/circuit-json-pcb-style-analysis/dist/index.js:
  (*!
  * Determine if an object is a Buffer
  *
  * @author   Feross Aboukhadijeh <https://feross.org>
  * @license  MIT
  *)
*/qt();qt();be();qt();be();be();be();be();qt();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();qt();be();be();qt();be();qt();be();qt();be();qt();be();qt();be();be();qt();be();be();qt();be();var eSt=at(ln(),1);be();be();qt();be();be();qt();be();be();be();be();be();qt();be();be();be();be();be();be();be();be();be();be();qt();be();qt();be();qt();be();qt();be();be();be();be();qt();be();qt();be();be();be();qt();be();qt();be();be();be();be();be();qt();be();qt();be();qt();be();qt();be();qt();be();qt();be();qt();be();qt();be();var CSt=at(ln(),1);be();be();be();be();be();be();be();be();qt();be();qt();be();qt();be();qt();be();qt();be();qt();be();qt();be();be();qt();be();be();qt();be();be();be();qt();be();qt();qt();be();qt();be();be();qt();be();qt();be();qt();be();be();qt();be();be();be();be();be();qt();be();be();be();be();qt();be();qt();be();qt();be();qt();be();qt();be();qt();be();qt();be();qt();be();be();qt();be();qt();be();qt();be();qt();qt();be();qt();qt();be();be();qt();qt();be();qt();be();be();be();qt();be();be();qt();be();qt();be();qt();be();qt();be();qt();be();qt();be();be();qt();be();qt();be();qt();be();qt();be();qt();be();be();qt();be();qt();be();qt();be();qt();be();qt();qt();be();qt();be();qt();qt();be();qt();be();qt();be();qt();be();qt();be();qt();be();qt();be();be();var yn=(e)=>{};yn("extra props b");yn("missing props b");yn(!0);yn("property a has mismatched types");var vBo=bt(["up","down","left","right"]),PIs=bt(["top-to-bottom","left-to-right","bottom-to-top","right-to-left"]);yn(!0);yn(!0);var SBo=k().regex(/^calc\(.*\)$/),Yn=Ke,E_=SBo.or(Ke),W7t=Ee({shape:ce("pill"),width:Yn,height:Yn}),X7t=Ee({shape:ce("rect"),width:Yn,height:Yn}),j7t=Ee({shape:ce("circle"),radius:Yn}),BIs=ss("shape",[W7t,X7t,j7t]);yn(!0);var Tu=xie((e)=>{if(e&&typeof e==="object"&&"default"in e)return e.default;return e},k()),Vy=Ee({x:Ke,y:Ke,z:Ke}),PBo=Ee({x:an([ge(),k()]),y:an([ge(),k()]),z:an([ge(),k()])}),EBo=["x+","x-","y+","y-","z+","z-"],K7t=bt(EBo),C3=Ee({rotationOffset:ge().or(PBo).optional(),positionOffset:Vy.optional(),modelOriginPosition:Vy.optional(),modelBounds:Ee({min:Vy,max:Vy}).optional(),size:Vy.optional(),modelUnitToMmScale:Yn.optional(),modelBoardNormalDirection:K7t.optional(),pcbRotationOffset:ge().optional(),zOffsetFromSurface:Yn.optional(),showAsTranslucentModel:Be().optional(),stepUrl:Tu.optional()});yn(!0);var MBo=C3.extend({stlUrl:Tu}),wBo=C3.extend({objUrl:Tu,mtlUrl:Tu.optional()}),BBo=C3.extend({gltfUrl:Tu}),TBo=C3.extend({glbUrl:Tu}),DBo=C3.extend({stepUrl:Tu}),NBo=C3.extend({wrlUrl:Tu}),RBo=C3.extend({jscad:Ss(Sd())}),CO=an([T4t(),k().min(1),cc((e)=>e&&typeof e==="object"&&("type"in e)&&("props"in e)),MBo,wBo,BBo,TBo,DBo,NBo,RBo]);yn(!0);var $7t=Ee({name:k().refine((e)=>e.trim().length>0,{message:"name cannot be empty"}),displayName:k().optional(),model:k().trim().min(1).optional(),modelUrl:Tu.refine((e)=>e.trim().length>0,{message:"modelUrl cannot be empty"}).optional(),cadModel:CO.optional(),children:cc().optional()}).refine((e)=>e.modelUrl===void 0||e.cadModel===void 0,{message:"Provide either modelUrl or cadModel, not both",path:["modelUrl"]}).refine((e)=>e.model===void 0||e.modelUrl===void 0&&e.cadModel===void 0,{message:"Provide only one of model, modelUrl, or cadModel",path:["model"]});yn(!0);var q7t=Ee({name:k().trim().min(1),from:k().trim().min(1),to:k().trim().min(1),standard:ce("usb_c").optional(),model:k().trim().min(1).optional()});yn(!0);var sze=Ee({name:k().trim().min(1),displayName:k().optional(),model:k().trim().min(1).optional(),modelUrl:Tu.refine((e)=>e.trim().length>0,"modelUrl cannot be empty").optional(),cadModel:CO.optional(),children:cc().optional()}).refine((e)=>[e.model,e.modelUrl,e.cadModel].filter((t)=>t!==void 0).length<=1,{message:"Provide only one of model, modelUrl, or cadModel",path:["model"]});yn(!0);var M7t=k().trim().regex(/^[A-Za-z_][A-Za-z0-9_-]*(?:\.[A-Za-z_][A-Za-z0-9_-]*)+$/,"Expected a qualified reference surface, e.g. part.face"),QBo=sze.and(Ee({mountedTo:M7t.optional(),fastenedTo:M7t.optional(),mountFace:k().trim().min(1).optional(),mountGap:Yn.pipe(ge().nonnegative().finite()).optional()})).superRefine((e,t)=>{if(e.mountedTo!==void 0&&e.fastenedTo!==void 0&&e.mountedTo!==e.fastenedTo)t.addIssue({code:Gt.custom,path:["fastenedTo"],message:"mountedTo and fastenedTo must refer to the same surface"});if(e.mountedTo===void 0&&e.fastenedTo===void 0){for(let n of["mountFace","mountGap"])if(e[n]!==void 0)t.addIssue({code:Gt.custom,path:[n],message:`${n} requires mountedTo or fastenedTo`})}}).transform(({fastenedTo:e,...t})=>{let n=t.mountedTo??e;return n===void 0?t:{...t,mountedTo:n}});yn(!0);var WFe=Yn.pipe(ge().positive().finite()),zIs=QBo.and(Ee({diameter:WFe.optional(),length:WFe.optional(),threadPitch:WFe.optional(),headType:bt(["socket","hex","pan","countersunk"]).optional()})).superRefine((e,t)=>{if([e.model,e.modelUrl,e.cadModel].some((o)=>o!==void 0)){for(let o of["diameter","length","threadPitch","headType"])if(e[o]!==void 0)t.addIssue({code:Gt.custom,path:[o],message:"Bolt dimensions and headType are exclusive with CAD sources"})}else for(let o of["diameter","length"])if(e[o]===void 0)t.addIssue({code:Gt.custom,path:[o],message:"Provide diameter and length, or an assembly CAD source"})}).transform((e)=>e.diameter===void 0?e:{...e,headType:e.headType??"socket"});yn(!0);var J7t=Ee({name:k().optional(),model:k().trim().min(1).optional(),modelUrl:Tu.refine((e)=>e.trim().length>0,{message:"modelUrl cannot be empty"}).optional()}).refine((e)=>e.model===void 0||e.modelUrl===void 0,{message:"Provide either model or modelUrl, not both",path:["model"]});yn(!0);var XFe=Yn.pipe(ge().finite()),w7t=Yn.pipe(ge().positive().finite()),Z7t=Ee({name:k().trim().min(1).default("anchor"),shape:ce("rect").default("rect"),plane:bt(["xy","xz","yz"]).default("xy"),normalDirection:bt(["x+","x-","y+","y-","z+","z-"]).optional(),centerXOffset:XFe.default(0),centerYOffset:XFe.default(0),centerZOffset:XFe.default(0),width:w7t.optional(),height:w7t.optional()}).refine((e)=>e.width===void 0===(e.height===void 0),{message:"Provide width and height together",path:["width"]}).superRefine((e,t)=>{let n=e.plane==="xy"?"z":e.plane==="xz"?"y":"x";if(e.normalDirection&&e.normalDirection[0]!==n)t.addIssue({code:Gt.custom,path:["normalDirection"],message:`normalDirection must be ${n}+ or ${n}- for plane ${e.plane}`})}).transform((e)=>({...e,normalDirection:e.normalDirection??(e.plane==="xy"?"z+":e.plane==="xz"?"y+":"x+")}));yn(!0);var tSt=Ee({name:k().trim().min(1),displayName:k().optional(),color:k().trim().min(1).optional(),material:bt(["pla","petg","nylon"]).optional(),children:cc().optional(),jscad:cc(eSt.isValidElement,"Expected jscad-fiber JSX").optional(),model:k().trim().min(1).optional(),modelUrl:Tu.refine((e)=>e.trim().length>0,"modelUrl cannot be empty").optional(),cadModel:CO.optional(),mountedTo:k().trim().regex(/^.+\.[^.]+$/,"Expected part.face").optional(),mountFace:k().trim().min(1).optional(),mountGap:Yn.pipe(ge().nonnegative().finite()).optional()}).superRefine((e,t)=>{if([e.jscad,e.model,e.modelUrl,e.cadModel].filter((n)=>n!==void 0).length!==1)t.addIssue({code:Gt.custom,path:["jscad"],message:"Provide exactly one of jscad, model, modelUrl, or cadModel"});if(e.mountedTo===void 0!==(e.mountFace===void 0))t.addIssue({code:Gt.custom,path:["mountFace"],message:"Provide mountedTo and mountFace together"});if(e.mountGap!==void 0&&e.mountedTo===void 0)t.addIssue({code:Gt.custom,path:["mountGap"],message:"mountGap requires mountedTo"})});yn(!0);var nSt=Ee({name:k().refine((e)=>e.trim().length>0,{message:"name cannot be empty"}),displayName:k().optional(),standard:bt(["nema8","nema17","nema23"]).optional(),model:k().trim().min(1).optional(),shaftFacingDirection:K7t.optional(),wireConnection:k().optional(),mountedTo:k().trim().regex(/^.+\.[^.]+$/,"Expected part.face").optional(),mountFace:k().trim().min(1).optional(),mountGap:Yn.pipe(ge().nonnegative().finite()).optional()}).superRefine((e,t)=>{if(e.mountedTo===void 0!==(e.mountFace===void 0))t.addIssue({code:Gt.custom,message:"Provide mountedTo and mountFace together",path:["mountFace"]});if(e.mountGap!==void 0&&e.mountedTo===void 0)t.addIssue({code:Gt.custom,message:"mountGap requires mountedTo",path:["mountGap"]});if(e.mountedTo!==void 0&&e.shaftFacingDirection!==void 0)t.addIssue({code:Gt.custom,message:"Mounted motors derive shaft direction from the mating faces",path:["shaftFacingDirection"]});if(e.model!==void 0&&e.wireConnection!==void 0)t.addIssue({code:Gt.custom,message:"Set wireConnection in the custom model string, or use standard",path:["wireConnection"]});if(e.standard===void 0&&e.model===void 0)t.addIssue({code:Gt.custom,message:"Provide standard or model",path:["standard"]});if(e.standard!==void 0&&e.model!==void 0)t.addIssue({code:Gt.custom,message:"Provide either standard or model, not both",path:["model"]})}).transform((e)=>e.mountedTo===void 0?{...e,shaftFacingDirection:e.shaftFacingDirection??"z+"}:e);yn(!0);var jFe=(e)=>k().refine((t)=>t.trim().length>0,{message:`${e} cannot be empty`}),B7t=(e)=>Yn.refine((t)=>Number.isFinite(t)&&t>0,{message:`${e} must be a positive finite distance`}),oSt=Ee({name:jFe("name"),model:k().trim().min(1).optional(),modelUrl:Tu.refine((e)=>e.trim().length>0,{message:"modelUrl cannot be empty"}).optional(),connectsTo:jFe("connectsTo"),width:B7t("width").optional(),height:B7t("height").optional(),cadModel:jFe("cadModel").optional()}).superRefine((e,t)=>{if(e.model!==void 0&&(e.modelUrl!==void 0||e.cadModel!==void 0))t.addIssue({code:Gt.custom,message:"Provide only one of model, modelUrl, or cadModel",path:["model"]});if(e.modelUrl!==void 0&&e.cadModel!==void 0)t.addIssue({code:Gt.custom,message:"Provide either modelUrl or cadModel, not both",path:["modelUrl"]});let n=e.width!==void 0,o=e.height!==void 0;if(n!==o){t.addIssue({code:Gt.custom,message:"width and height must be provided together",path:n?["height"]:["width"]});return}if(!n&&e.cadModel===void 0&&e.modelUrl===void 0&&e.model===void 0)t.addIssue({code:Gt.custom,message:"provide width and height, model, cadModel, or modelUrl",path:[]})});yn(!0);var kBo="[A-Za-z_][A-Za-z0-9_-]*(?:\\.[A-Za-z_][A-Za-z0-9_-]*)*",rSt="[A-Za-z_][A-Za-z0-9_-]*(?:\\.[A-Za-z_][A-Za-z0-9_-]*)+",LBo=new RegExp(`^${rSt}$`),HBo=new RegExp(`^${kBo}$`),FBo=new RegExp(`^calc\\(\\s*(${rSt})\\s*(?:([+-])\\s*((?:\\d+(?:\\.\\d*)?|\\.\\d+))\\s*(degcw|degccw))?\\s*\\)$`),zBo=k().trim().superRefine((e,t)=>{if(LBo.test(e))return;let n=FBo.exec(e);if(!n){t.addIssue({code:Gt.custom,message:"Expected a qualified mounting reference or calc(reference +/- Ndegcw|Ndegccw)"});return}if(n[3]!==void 0&&!Number.isFinite(Number(n[3])))t.addIssue({code:Gt.custom,message:"Mount rotation angle must be finite"})}),OBo=cc((e)=>typeof e==="string",{message:"Expected a board edge or component identity path"}).transform((e)=>e.trim()).refine((e)=>HBo.test(e),{message:"Expected a board edge or component identity path"}),VBo=bt(["top_layer_toward_mount_face","bottom_layer_toward_mount_face"]);var YBo=Ee({margin:Yn.optional(),widthDimensionOffset:Yn.optional(),heightDimensionOffset:Yn.optional(),depth:Yn.optional()}),KFe=YBo.shape,iSt=ss("shape",[W7t.extend(KFe),X7t.extend(KFe),j7t.extend(KFe)]);yn(!0);var sSt=Ee({name:k().optional(),boardRef:k().min(1),width:Yn.optional(),height:Yn.optional(),depth:Yn.optional(),wallThickness:Yn.default("2mm"),floorThickness:Yn.optional(),lidThickness:Yn.optional(),boardClearance:Yn.optional(),standoffHeight:Yn.optional(),topHeadroom:Yn.optional(),lidLipDepth:Yn.optional(),disableCutouts:Be().optional(),showHiddenEdges:Be().optional()});yn(!0);var Qb=st(k().or(ge()));yn(!0);var aze=cc((e)=>!0),Yy=Ee({x:Ke,y:Ke}),cze=Yy.extend({rotation:ii.optional()});yn(!0);var aSt=Ee({size:Yy.optional(),thickness:Ke.optional()});yn(!0);var GBo=Ee({font:aSt.optional()});yn(!0);var e1e=Ee({value:k(),at:cze.optional(),layer:k().optional(),uuid:k().optional(),hide:Be().optional(),effects:GBo.optional()});yn(!0);var UBo=Ee({Reference:e1e.optional(),Value:e1e.optional(),Datasheet:e1e.optional(),Description:e1e.optional()});yn(!0);var WBo=Ee({through_hole:Be().optional(),smd:Be().optional(),exclude_from_pos_files:Be().optional(),exclude_from_bom:Be().optional()});yn(!0);var XBo=Ee({name:k(),type:k(),shape:k().optional(),at:cze.optional(),size:Yy.optional(),drill:Ke.optional(),layers:st(k()).optional(),removeUnusedLayers:Be().optional(),uuid:k().optional()});yn(!0);var jBo=Ee({path:k(),offset:Vy.optional(),scale:Vy.optional(),rotate:Vy.optional()});yn(!0);var KBo=Ee({footprintName:k().optional(),version:an([ge(),k()]).optional(),generator:k().optional(),generatorVersion:an([ge(),k()]).optional(),layer:k().optional(),properties:UBo.optional(),attributes:WBo.optional(),pads:st(XBo).optional(),embeddedFonts:Be().optional(),model:jBo.optional()});yn(!0);var $Bo=Ee({hide:Be().optional()});yn(!0);var qBo=Ee({offset:Ke.optional(),hide:Be().optional()});yn(!0);var JBo=Ee({font:aSt.optional(),justify:an([k(),st(k())]).optional(),hide:Be().optional()});yn(!0);var xO=Ee({value:k(),id:an([ge(),k()]).optional(),at:cze.optional(),effects:JBo.optional()});yn(!0);var ZBo=Ee({Reference:xO.optional(),Value:xO.optional(),Footprint:xO.optional(),Datasheet:xO.optional(),Description:xO.optional(),ki_keywords:xO.optional(),ki_fp_filters:xO.optional()});yn(!0);var eTo=Ee({symbolName:k().optional(),extends:k().optional(),pinNumbers:$Bo.optional(),pinNames:qBo.optional(),excludeFromSim:Be().optional(),inBom:Be().optional(),onBoard:Be().optional(),properties:ZBo.optional(),embeddedFonts:Be().optional()});yn(!0);var lze=Ee({silkscreenFontSize:Ke.optional(),viaPadDiameter:Ke.optional(),viaHoleDiameter:Ke.optional(),silkscreenTextPosition:an([bt(["centered","outside","none"]),Ee({offsetX:ge(),offsetY:ge()})]).optional(),silkscreenTextVisibility:bt(["hidden","visible","inherit"]).optional()});yn(!0);var tTo=Ee({fontSize:ve.optional(),pcbX:E_.optional(),pcbY:E_.optional(),visibility:bt(["hidden","visible","inherit"]).optional()}),cSt=Ss(k(),tTo);yn(!0);var $Fe=bt(["i2c_sda","i2c_scl","spi_cs","spi_sck","spi_mosi","spi_miso","uart_tx","uart_rx"]),nTo=Ee({isInput:Be().optional(),isOutput:Be().optional(),isBidirectional:Be().optional(),isPassive:Be().optional(),canUseTriState:Be().optional(),isUsingTriState:Be().optional(),canUseOpenCollector:Be().optional(),isUsingOpenCollector:Be().optional(),canUseOpenEmitter:Be().optional(),isUsingOpenEmitter:Be().optional(),capabilities:st($Fe).optional(),activeCapabilities:st($Fe).optional(),activeCapability:$Fe.optional(),providesPower:Be().optional(),requiresPower:Be().optional(),providesGround:Be().optional(),requiresGround:Be().optional(),providesVoltage:an([k(),ge()]).optional(),requiresVoltage:an([k(),ge()]).optional(),requiredVoltageTolerance:an([ge(),k().trim().regex(/^(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?\s*%?$/,"Expected a tolerance fraction or percentage").transform((e)=>e.endsWith("%")?Number(e.slice(0,-1))/100:Number(e))]).pipe(ge().finite().min(0).max(1)).optional(),doNotConnect:Be().optional(),includeInBoardPinout:Be().optional(),highlightColor:k().optional(),mustBeConnected:Be().optional(),canUseInternalPullup:Be().optional(),isUsingInternalPullup:Be().optional(),needsExternalPullup:Be().optional(),canUseInternalPulldown:Be().optional(),isUsingInternalPulldown:Be().optional(),needsExternalPulldown:Be().optional(),canUseOpenDrain:Be().optional(),isUsingOpenDrain:Be().optional(),canUsePushPull:Be().optional(),isUsingPushPull:Be().optional(),shouldHaveDecouplingCapacitor:Be().optional(),recommendedDecouplingCapacitorCapacitance:an([k(),ge()]).optional(),isGpio:Be().optional()});yn(!0);var oTo=Ee({defaultPassiveSize:an([bt(["xs","sm","md"]),Ke]).optional(),defaultCapacitorOrientation:bt(["vertical","none"]).optional()});yn(!0);var rTo=cc((e)=>!0),Fs=Ee({pcbX:E_.optional(),pcbY:E_.optional(),pcbLeftEdgeX:E_.optional(),pcbRightEdgeX:E_.optional(),pcbTopEdgeY:E_.optional(),pcbBottomEdgeY:E_.optional(),pcbOffsetX:Ke.optional(),pcbOffsetY:Ke.optional(),pcbRotation:ii.optional(),pcbPositionAnchor:k().optional(),pcbPositionMode:bt(["relative_to_group_anchor","auto","relative_to_board_anchor","relative_to_component_anchor"]).optional(),shouldBeOnEdgeOfBoard:Be().optional(),layer:Lo.optional(),pcbMarginTop:Ke.optional(),pcbMarginRight:Ke.optional(),pcbMarginBottom:Ke.optional(),pcbMarginLeft:Ke.optional(),pcbMarginX:Ke.optional(),pcbMarginY:Ke.optional(),pcbStyle:lze.optional(),pcbSx:cSt.optional(),pcbRelative:Be().optional(),relative:Be().optional()});yn(!0);var s1e=Ee({pcbX:E_.optional(),pcbY:E_.optional(),pcbLeftEdgeX:E_.optional(),pcbRightEdgeX:E_.optional(),pcbTopEdgeY:E_.optional(),pcbBottomEdgeY:E_.optional(),pcbOffsetX:Ke.optional(),pcbOffsetY:Ke.optional(),pcbRotation:ii.optional(),pcbPositionAnchor:k().optional(),pcbPositionMode:bt(["relative_to_group_anchor","auto","relative_to_board_anchor","relative_to_component_anchor"]).optional(),shouldBeOnEdgeOfBoard:Be().optional(),pcbMarginTop:Ke.optional(),pcbMarginRight:Ke.optional(),pcbMarginBottom:Ke.optional(),pcbMarginLeft:Ke.optional(),pcbMarginX:Ke.optional(),pcbMarginY:Ke.optional(),pcbStyle:lze.optional(),pcbSx:cSt.optional(),schMarginTop:Ke.optional(),schMarginRight:Ke.optional(),schMarginBottom:Ke.optional(),schMarginLeft:Ke.optional(),schMarginX:Ke.optional(),schMarginY:Ke.optional(),schX:Ke.optional(),schY:Ke.optional(),schRotation:ii.optional(),layer:Lo.optional(),footprint:aze.optional(),symbol:rTo.optional(),schStyle:oTo.optional(),relative:Be().optional(),schRelative:Be().optional(),pcbRelative:Be().optional()});yn(!0);var Rw=Ee({supplierPartNumbers:Ss(j7,st(k())).optional()});yn(!0);var Du=s1e.merge(Rw).extend({key:Sd().optional(),name:k(),displayName:k().optional(),schSectionName:k().optional().describe('This component will be drawn as part of this section e.g. "Power"'),schSheetName:k().optional().describe('This component will be drawn as part of this sheet e.g. "Main"'),datasheetUrl:Tu.optional(),cadModel:CO.optional(),kicadFootprintMetadata:KBo.optional(),kicadSymbolMetadata:eTo.optional(),children:Sd().optional(),symbolName:k().optional(),doNotPlace:Be().optional(),isSmt:Be().optional().describe("Whether this component is surface mounted. True marks it as SMT; false marks it as through hole. Omit to let core infer mounting style from the footprint. Parsed unchanged with no aliases or schema conflicts; core determines solder paste generation, including for plated-hole pads."),allowOffBoard:Be().optional().describe("Allows the PCB component to hang off the board (e.g. for USB ports or displays)"),obstructsWithinBounds:Be().optional().describe("Does this component take up all the space within its bounds on a layer. This is generally true except for when separated pin headers are being represented by a single component (in which case, chips can be placed between the pin headers) or for tall modules where chips fit underneath"),showAsTranslucentModel:Be().optional().describe("Whether to show this component's CAD model as translucent in the 3D viewer."),pinAttributes:Ss(k(),nTo).optional(),mpn:k().describe("Manufacturer Part Number").optional(),mfn:k().describe("Manufacturer Part Number").optional(),manufacturerPartNumber:k().optional()});yn(!0);var lSt=["pin1","left","pin2","right"],Sse=["pin1","left","anode","pos","pin2","right","cathode","neg"],p9s=Ke.or(bt(["2x","3x","4x"])),hi=(e)=>{let t=[e.manufacturerPartNumber,e.mpn,e.mfn].map((n)=>n?.trim()).filter((n)=>Boolean(n));if(new Set(t).size>1)throw Error("Conflicting manufacturerPartNumber, mpn, and mfn: specify the same manufacturer part number for all aliases");return t[0]},iTo=Yy.extend({via:Be().optional(),fromLayer:Lo.optional(),toLayer:Lo.optional()}),sTo=iTo.superRefine((e,t)=>{if(e.via){if(!e.toLayer)t.addIssue({code:Gt.custom,message:"toLayer is required when via is true",path:["toLayer"]})}else if(e.fromLayer||e.toLayer)t.addIssue({code:Gt.custom,message:"fromLayer/toLayer are only allowed when via is true",path:["via"]})}),nze=st(an([sTo,k()]));yn(!0);yn(!0);var aTo=["Audio_Module/Reverb_BTDR-1H","Audio_Module/Reverb_BTDR-1V","Battery/BatteryClip_Keystone_54_D16-19mm","Battery/BatteryHolder_Bulgin_BX0034_1xAAA","Battery/BatteryHolder_Bulgin_BX0036_1xC","Battery/BatteryHolder_Bulgin_BX0123_1xCR123","Battery/BatteryHolder_ComfortableElectronic_CH273-2450_1x2450","Battery/BatteryHolder_Eagle_12BH611-GR","Battery/BatteryHolder_Keystone_103_1x20mm","Battery/BatteryHolder_Keystone_1042_1x18650","Battery/BatteryHolder_Keystone_104_1x23mm","Battery/BatteryHolder_Keystone_1057_1x2032","Battery/BatteryHolder_Keystone_1058_1x2032","Battery/BatteryHolder_Keystone_105_1x2430","Battery/BatteryHolder_Keystone_1060_1x2032","Battery/BatteryHolder_Keystone_106_1x20mm","Battery/BatteryHolder_Keystone_107_1x23mm","Battery/BatteryHolder_Keystone_2460_1xAA","Battery/BatteryHolder_Keystone_2462_2xAA","Battery/BatteryHolder_Keystone_2466_1xAAA","Battery/BatteryHolder_Keystone_2468_2xAAA","Battery/BatteryHolder_Keystone_2479_3xAAA","Battery/BatteryHolder_Keystone_2993","Battery/BatteryHolder_Keystone_2998_1x6.8mm","Battery/BatteryHolder_Keystone_3000_1x12mm","Battery/BatteryHolder_Keystone_3001_1x12mm","Battery/BatteryHolder_Keystone_3002_1x2032","Battery/BatteryHolder_Keystone_3008_1x2450","Battery/BatteryHolder_Keystone_3009_1x2450","Battery/BatteryHolder_Keystone_3034_1x20mm","Battery/BatteryHolder_Keystone_500","Battery/BatteryHolder_Keystone_590","Battery/BatteryHolder_LINX_BAT-HLD-012-SMT","Battery/BatteryHolder_MPD_BA9VPC_1xPP3","Battery/BatteryHolder_MPD_BC12AAPC_2xAA","Battery/BatteryHolder_MPD_BC2003_1x2032","Battery/BatteryHolder_MPD_BC2AAPC_2xAA","Battery/BatteryHolder_MPD_BH-18650-PC","Battery/BatteryHolder_MPD_BK-18650-PC2","Battery/BatteryHolder_MYOUNG_BS-07-A1BJ001_CR2032","Battery/BatteryHolder_Multicomp_BC-2001_1x2032","Battery/BatteryHolder_Renata_SMTU2032-LF_1x2032","Battery/BatteryHolder_Seiko_MS621F","Battery/BatteryHolder_TruPower_BH-331P_3xAA","Battery/Battery_CR1225","Battery/Battery_Panasonic_CR1025-VSK_Vertical_CircularHoles","Battery/Battery_Panasonic_CR1220-VCN_Vertical_CircularHoles","Battery/Battery_Panasonic_CR1632-V1AN_Vertical_CircularHoles","Battery/Battery_Panasonic_CR2025-V1AK_Vertical_CircularHoles","Battery/Battery_Panasonic_CR2032-HFN_Horizontal_CircularHoles","Battery/Battery_Panasonic_CR2032-VS1N_Vertical_CircularHoles","Battery/Battery_Panasonic_CR2354-VCN_Vertical_CircularHoles","Battery/Battery_Panasonic_CR2450-VAN_Vertical_CircularHoles","Battery/Battery_Panasonic_CR2477-VCN_Vertical_CircularHoles","Battery/Battery_Panasonic_CR3032-VCN_Vertical_CircularHoles","Button_Switch_Keyboard/SW_Cherry_MX_1.00u_PCB","Button_Switch_Keyboard/SW_Cherry_MX_1.00u_Plate","Button_Switch_Keyboard/SW_Cherry_MX_1.25u_PCB","Button_Switch_Keyboard/SW_Cherry_MX_1.25u_Plate","Button_Switch_Keyboard/SW_Cherry_MX_1.50u_PCB","Button_Switch_Keyboard/SW_Cherry_MX_1.50u_Plate","Button_Switch_Keyboard/SW_Cherry_MX_1.75u_PCB","Button_Switch_Keyboard/SW_Cherry_MX_1.75u_Plate","Button_Switch_Keyboard/SW_Cherry_MX_2.00u_PCB","Button_Switch_Keyboard/SW_Cherry_MX_2.00u_Plate","Button_Switch_Keyboard/SW_Cherry_MX_2.00u_Vertical_PCB","Button_Switch_Keyboard/SW_Cherry_MX_2.00u_Vertical_Plate","Button_Switch_Keyboard/SW_Cherry_MX_2.25u_PCB","Button_Switch_Keyboard/SW_Cherry_MX_2.25u_Plate","Button_Switch_Keyboard/SW_Cherry_MX_2.75u_PCB","Button_Switch_Keyboard/SW_Cherry_MX_2.75u_Plate","Button_Switch_Keyboard/SW_Cherry_MX_6.25u_PCB","Button_Switch_Keyboard/SW_Cherry_MX_6.25u_Plate","Button_Switch_Keyboard/SW_Cherry_MX_ISOEnter_PCB","Button_Switch_Keyboard/SW_Cherry_MX_ISOEnter_Plate","Button_Switch_Keyboard/SW_Matias_1.00u","Button_Switch_Keyboard/SW_Matias_1.25u","Button_Switch_Keyboard/SW_Matias_1.50u","Button_Switch_Keyboard/SW_Matias_1.75u","Button_Switch_Keyboard/SW_Matias_2.00u","Button_Switch_Keyboard/SW_Matias_2.25u","Button_Switch_Keyboard/SW_Matias_2.75u","Button_Switch_Keyboard/SW_Matias_6.25u","Button_Switch_Keyboard/SW_Matias_ISOEnter","Button_Switch_SMD/Nidec_Copal_CAS-120A","Button_Switch_SMD/Nidec_Copal_SH-7010A","Button_Switch_SMD/Nidec_Copal_SH-7010B","Button_Switch_SMD/Nidec_Copal_SH-7040B","Button_Switch_SMD/Panasonic_EVQPUJ_EVQPUA","Button_Switch_SMD/Panasonic_EVQPUK_EVQPUB","Button_Switch_SMD/Panasonic_EVQPUL_EVQPUC","Button_Switch_SMD/Panasonic_EVQPUM_EVQPUD","Button_Switch_SMD/SW_DIP_SPSTx01_Slide_6.7x4.1mm_W6.73mm_P2.54mm_LowProfile_JPin","Button_Switch_SMD/SW_DIP_SPSTx01_Slide_6.7x4.1mm_W8.61mm_P2.54mm_LowProfile","Button_Switch_SMD/SW_DIP_SPSTx01_Slide_9.78x4.72mm_W8.61mm_P2.54mm","Button_Switch_SMD/SW_DIP_SPSTx01_Slide_Copal_CHS-01A_W5.08mm_P1.27mm_JPin","Button_Switch_SMD/SW_DIP_SPSTx01_Slide_Copal_CHS-01B_W7.62mm_P1.27mm","Button_Switch_SMD/SW_DIP_SPSTx01_Slide_Copal_CVS-01xB_W5.9mm_P1mm","Button_Switch_SMD/SW_DIP_SPSTx01_Slide_Omron_A6S-110x_W8.9mm_P2.54mm","Button_Switch_SMD/SW_DIP_SPSTx02_Slide_6.7x6.64mm_W6.73mm_P2.54mm_LowProfile_JPin","Button_Switch_SMD/SW_DIP_SPSTx02_Slide_6.7x6.64mm_W8.61mm_P2.54mm_LowProfile","Button_Switch_SMD/SW_DIP_SPSTx02_Slide_9.78x7.26mm_W8.61mm_P2.54mm","Button_Switch_SMD/SW_DIP_SPSTx02_Slide_Copal_CHS-02A_W5.08mm_P1.27mm_JPin","Button_Switch_SMD/SW_DIP_SPSTx02_Slide_Copal_CHS-02B_W7.62mm_P1.27mm","Button_Switch_SMD/SW_DIP_SPSTx02_Slide_Copal_CVS-02xB_W5.9mm_P1mm","Button_Switch_SMD/SW_DIP_SPSTx02_Slide_KingTek_DSHP02TJ_W5.25mm_P1.27mm_JPin","Button_Switch_SMD/SW_DIP_SPSTx02_Slide_KingTek_DSHP02TS_W7.62mm_P1.27mm","Button_Switch_SMD/SW_DIP_SPSTx02_Slide_Omron_A6H-2101_W6.15mm_P1.27mm","Button_Switch_SMD/SW_DIP_SPSTx02_Slide_Omron_A6S-210x_W8.9mm_P2.54mm","Button_Switch_SMD/SW_DIP_SPSTx03_Slide_6.7x9.18mm_W6.73mm_P2.54mm_LowProfile_JPin","Button_Switch_SMD/SW_DIP_SPSTx03_Slide_6.7x9.18mm_W8.61mm_P2.54mm_LowProfile","Button_Switch_SMD/SW_DIP_SPSTx03_Slide_9.78x9.8mm_W8.61mm_P2.54mm","Button_Switch_SMD/SW_DIP_SPSTx03_Slide_Copal_CVS-03xB_W5.9mm_P1mm","Button_Switch_SMD/SW_DIP_SPSTx03_Slide_KingTek_DSHP03TJ_W5.25mm_P1.27mm_JPin","Button_Switch_SMD/SW_DIP_SPSTx03_Slide_KingTek_DSHP03TS_W7.62mm_P1.27mm","Button_Switch_SMD/SW_DIP_SPSTx03_Slide_Omron_A6S-310x_W8.9mm_P2.54mm","Button_Switch_SMD/SW_DIP_SPSTx04_Slide_6.7x11.72mm_W6.73mm_P2.54mm_LowProfile_JPin","Button_Switch_SMD/SW_DIP_SPSTx04_Slide_6.7x11.72mm_W8.61mm_P2.54mm_LowProfile","Button_Switch_SMD/SW_DIP_SPSTx04_Slide_9.78x12.34mm_W8.61mm_P2.54mm","Button_Switch_SMD/SW_DIP_SPSTx04_Slide_Copal_CHS-04A_W5.08mm_P1.27mm_JPin","Button_Switch_SMD/SW_DIP_SPSTx04_Slide_Copal_CHS-04B_W7.62mm_P1.27mm","Button_Switch_SMD/SW_DIP_SPSTx04_Slide_Copal_CVS-04xB_W5.9mm_P1mm","Button_Switch_SMD/SW_DIP_SPSTx04_Slide_KingTek_DSHP04TJ_W5.25mm_P1.27mm_JPin","Button_Switch_SMD/SW_DIP_SPSTx04_Slide_KingTek_DSHP04TS_W7.62mm_P1.27mm","Button_Switch_SMD/SW_DIP_SPSTx04_Slide_Omron_A6H-4101_W6.15mm_P1.27mm","Button_Switch_SMD/SW_DIP_SPSTx04_Slide_Omron_A6S-410x_W8.9mm_P2.54mm","Button_Switch_SMD/SW_DIP_SPSTx05_Slide_6.7x14.26mm_W6.73mm_P2.54mm_LowProfile_JPin","Button_Switch_SMD/SW_DIP_SPSTx05_Slide_6.7x14.26mm_W8.61mm_P2.54mm_LowProfile","Button_Switch_SMD/SW_DIP_SPSTx05_Slide_9.78x14.88mm_W8.61mm_P2.54mm","Button_Switch_SMD/SW_DIP_SPSTx05_Slide_KingTek_DSHP05TJ_W5.25mm_P1.27mm_JPin","Button_Switch_SMD/SW_DIP_SPSTx05_Slide_KingTek_DSHP05TS_W7.62mm_P1.27mm","Button_Switch_SMD/SW_DIP_SPSTx05_Slide_Omron_A6S-510x_W8.9mm_P2.54mm","Button_Switch_SMD/SW_DIP_SPSTx06_Slide_6.7x16.8mm_W6.73mm_P2.54mm_LowProfile_JPin","Button_Switch_SMD/SW_DIP_SPSTx06_Slide_6.7x16.8mm_W8.61mm_P2.54mm_LowProfile","Button_Switch_SMD/SW_DIP_SPSTx06_Slide_9.78x17.42mm_W8.61mm_P2.54mm","Button_Switch_SMD/SW_DIP_SPSTx06_Slide_Copal_CHS-06A_W5.08mm_P1.27mm_JPin","Button_Switch_SMD/SW_DIP_SPSTx06_Slide_Copal_CHS-06B_W7.62mm_P1.27mm","Button_Switch_SMD/SW_DIP_SPSTx06_Slide_KingTek_DSHP06TJ_W5.25mm_P1.27mm_JPin","Button_Switch_SMD/SW_DIP_SPSTx06_Slide_KingTek_DSHP06TS_W7.62mm_P1.27mm","Button_Switch_SMD/SW_DIP_SPSTx06_Slide_Omron_A6H-6101_W6.15mm_P1.27mm","Button_Switch_SMD/SW_DIP_SPSTx06_Slide_Omron_A6S-610x_W8.9mm_P2.54mm","Button_Switch_SMD/SW_DIP_SPSTx07_Slide_6.7x19.34mm_W6.73mm_P2.54mm_LowProfile_JPin","Button_Switch_SMD/SW_DIP_SPSTx07_Slide_6.7x19.34mm_W8.61mm_P2.54mm_LowProfile","Button_Switch_SMD/SW_DIP_SPSTx07_Slide_9.78x19.96mm_W8.61mm_P2.54mm","Button_Switch_SMD/SW_DIP_SPSTx07_Slide_KingTek_DSHP07TJ_W5.25mm_P1.27mm_JPin","Button_Switch_SMD/SW_DIP_SPSTx07_Slide_KingTek_DSHP07TS_W7.62mm_P1.27mm","Button_Switch_SMD/SW_DIP_SPSTx07_Slide_Omron_A6S-710x_W8.9mm_P2.54mm","Button_Switch_SMD/SW_DIP_SPSTx08_Slide_6.7x21.88mm_W6.73mm_P2.54mm_LowProfile_JPin","Button_Switch_SMD/SW_DIP_SPSTx08_Slide_6.7x21.88mm_W8.61mm_P2.54mm_LowProfile","Button_Switch_SMD/SW_DIP_SPSTx08_Slide_9.78x22.5mm_W8.61mm_P2.54mm","Button_Switch_SMD/SW_DIP_SPSTx08_Slide_Copal_CHS-08A_W5.08mm_P1.27mm_JPin","Button_Switch_SMD/SW_DIP_SPSTx08_Slide_Copal_CHS-08B_W7.62mm_P1.27mm","Button_Switch_SMD/SW_DIP_SPSTx08_Slide_Copal_CVS-08xB_W5.9mm_P1mm","Button_Switch_SMD/SW_DIP_SPSTx08_Slide_KingTek_DSHP08TJ_W5.25mm_P1.27mm_JPin","Button_Switch_SMD/SW_DIP_SPSTx08_Slide_KingTek_DSHP08TS_W7.62mm_P1.27mm","Button_Switch_SMD/SW_DIP_SPSTx08_Slide_Omron_A6H-8101_W6.15mm_P1.27mm","Button_Switch_SMD/SW_DIP_SPSTx08_Slide_Omron_A6S-810x_W8.9mm_P2.54mm","Button_Switch_SMD/SW_DIP_SPSTx09_Slide_6.7x24.42mm_W6.73mm_P2.54mm_LowProfile_JPin","Button_Switch_SMD/SW_DIP_SPSTx09_Slide_6.7x24.42mm_W8.61mm_P2.54mm_LowProfile","Button_Switch_SMD/SW_DIP_SPSTx09_Slide_9.78x25.04mm_W8.61mm_P2.54mm","Button_Switch_SMD/SW_DIP_SPSTx09_Slide_KingTek_DSHP09TJ_W5.25mm_P1.27mm_JPin","Button_Switch_SMD/SW_DIP_SPSTx09_Slide_KingTek_DSHP09TS_W7.62mm_P1.27mm","Button_Switch_SMD/SW_DIP_SPSTx09_Slide_Omron_A6S-910x_W8.9mm_P2.54mm","Button_Switch_SMD/SW_DIP_SPSTx10_Slide_6.7x26.96mm_W6.73mm_P2.54mm_LowProfile_JPin","Button_Switch_SMD/SW_DIP_SPSTx10_Slide_6.7x26.96mm_W8.61mm_P2.54mm_LowProfile","Button_Switch_SMD/SW_DIP_SPSTx10_Slide_9.78x27.58mm_W8.61mm_P2.54mm","Button_Switch_SMD/SW_DIP_SPSTx10_Slide_Copal_CHS-10A_W5.08mm_P1.27mm_JPin","Button_Switch_SMD/SW_DIP_SPSTx10_Slide_Copal_CHS-10B_W7.62mm_P1.27mm","Button_Switch_SMD/SW_DIP_SPSTx10_Slide_KingTek_DSHP10TJ_W5.25mm_P1.27mm_JPin","Button_Switch_SMD/SW_DIP_SPSTx10_Slide_KingTek_DSHP10TS_W7.62mm_P1.27mm","Button_Switch_SMD/SW_DIP_SPSTx10_Slide_Omron_A6H-10101_W6.15mm_P1.27mm","Button_Switch_SMD/SW_DIP_SPSTx10_Slide_Omron_A6S-1010x_W8.9mm_P2.54mm","Button_Switch_SMD/SW_DIP_SPSTx11_Slide_6.7x29.5mm_W6.73mm_P2.54mm_LowProfile_JPin","Button_Switch_SMD/SW_DIP_SPSTx11_Slide_6.7x29.5mm_W8.61mm_P2.54mm_LowProfile","Button_Switch_SMD/SW_DIP_SPSTx11_Slide_9.78x30.12mm_W8.61mm_P2.54mm","Button_Switch_SMD/SW_DIP_SPSTx12_Slide_6.7x32.04mm_W6.73mm_P2.54mm_LowProfile_JPin","Button_Switch_SMD/SW_DIP_SPSTx12_Slide_6.7x32.04mm_W8.61mm_P2.54mm_LowProfile","Button_Switch_SMD/SW_DIP_SPSTx12_Slide_9.78x32.66mm_W8.61mm_P2.54mm","Button_Switch_SMD/SW_DPDT_CK_JS202011JCQN","Button_Switch_SMD/SW_MEC_5GSH9","Button_Switch_SMD/SW_Push_1P1T-MP_NO_Horizontal_Alps_SKRTLAE010","Button_Switch_SMD/SW_Push_1P1T-SH_NO_CK_KMR2xxG","Button_Switch_SMD/SW_Push_1P1T_NO_CK_KMR2","Button_Switch_SMD/SW_Push_1P1T_NO_CK_KSC6xxG","Button_Switch_SMD/SW_Push_1P1T_NO_CK_KSC6xxJ","Button_Switch_SMD/SW_Push_1P1T_NO_CK_KSC7xxJ","Button_Switch_SMD/SW_Push_1P1T_NO_CK_KSC9xxG","Button_Switch_SMD/SW_Push_1P1T_NO_CK_KSC9xxJ","Button_Switch_SMD/SW_Push_1P1T_NO_CK_PTS125Sx43PSMTR","Button_Switch_SMD/SW_Push_1P1T_NO_CK_PTS125Sx43SMTR","Button_Switch_SMD/SW_Push_1P1T_NO_CK_PTS125Sx73PSMTR","Button_Switch_SMD/SW_Push_1P1T_NO_CK_PTS125Sx73SMTR","Button_Switch_SMD/SW_Push_1P1T_NO_CK_PTS125Sx85PSMTR","Button_Switch_SMD/SW_Push_1P1T_NO_CK_PTS125Sx85SMTR","Button_Switch_SMD/SW_Push_1P1T_NO_E-Switch_TL3301NxxxxxG","Button_Switch_SMD/SW_Push_1P1T_NO_Vertical_Wuerth_434133025816","Button_Switch_SMD/SW_Push_1P1T_XKB_TS-1187A","Button_Switch_SMD/SW_Push_1TS009xxxx-xxxx-xxxx_6x6x5mm","Button_Switch_SMD/SW_Push_SPST_NO_Alps_SKRK","Button_Switch_SMD/SW_SP3T_PCM13","Button_Switch_SMD/SW_SPDT_CK_JS102011SAQN","Button_Switch_SMD/SW_SPDT_PCM12","Button_Switch_SMD/SW_SPDT_REED_MSDM-DT","Button_Switch_SMD/SW_SPDT_Shouhan_MSK12C02","Button_Switch_SMD/SW_SPST_B3S-1000","Button_Switch_SMD/SW_SPST_B3S-1100","Button_Switch_SMD/SW_SPST_B3SL-1002P","Button_Switch_SMD/SW_SPST_B3SL-1022P","Button_Switch_SMD/SW_SPST_B3U-1000P-B","Button_Switch_SMD/SW_SPST_B3U-1000P","Button_Switch_SMD/SW_SPST_B3U-1100P-B","Button_Switch_SMD/SW_SPST_B3U-1100P","Button_Switch_SMD/SW_SPST_B3U-3000P-B","Button_Switch_SMD/SW_SPST_B3U-3000P","Button_Switch_SMD/SW_SPST_B3U-3100P-B","Button_Switch_SMD/SW_SPST_B3U-3100P","Button_Switch_SMD/SW_SPST_CK_KMS2xxG","Button_Switch_SMD/SW_SPST_CK_KMS2xxGP","Button_Switch_SMD/SW_SPST_CK_KXT3","Button_Switch_SMD/SW_SPST_CK_RS282G05A3","Button_Switch_SMD/SW_SPST_EVPBF","Button_Switch_SMD/SW_SPST_EVQP0","Button_Switch_SMD/SW_SPST_EVQP2_MiddlePushTravel_H2.5mm","Button_Switch_SMD/SW_SPST_EVQP2_ShortPushTravel_H2.1mm","Button_Switch_SMD/SW_SPST_EVQP2_ShortPushTravel_H2.5mm","Button_Switch_SMD/SW_SPST_EVQP7A","Button_Switch_SMD/SW_SPST_EVQP7C","Button_Switch_SMD/SW_SPST_EVQPE1","Button_Switch_SMD/SW_SPST_EVQQ2","Button_Switch_SMD/SW_SPST_FSMSM","Button_Switch_SMD/SW_SPST_GT-TC155X","Button_Switch_SMD/SW_SPST_Omron_B3FS-100xP","Button_Switch_SMD/SW_SPST_Omron_B3FS-101xP","Button_Switch_SMD/SW_SPST_Omron_B3FS-105xP","Button_Switch_SMD/SW_SPST_PTS645Sx43SMTR92","Button_Switch_SMD/SW_SPST_PTS647_Sx38","Button_Switch_SMD/SW_SPST_PTS647_Sx50","Button_Switch_SMD/SW_SPST_PTS647_Sx70","Button_Switch_SMD/SW_SPST_PTS810","Button_Switch_SMD/SW_SPST_Panasonic_EVQPL_3PL_5PL_PT_A08","Button_Switch_SMD/SW_SPST_Panasonic_EVQPL_3PL_5PL_PT_A15","Button_Switch_SMD/SW_SPST_REED_CT05-XXXX-G1","Button_Switch_SMD/SW_SPST_REED_CT05-XXXX-J1","Button_Switch_SMD/SW_SPST_REED_CT10-XXXX-G1","Button_Switch_SMD/SW_SPST_REED_CT10-XXXX-G2","Button_Switch_SMD/SW_SPST_REED_CT10-XXXX-G4","Button_Switch_SMD/SW_SPST_SKQG_WithStem","Button_Switch_SMD/SW_SPST_SKQG_WithoutStem","Button_Switch_SMD/SW_SPST_TL3305A","Button_Switch_SMD/SW_SPST_TL3305B","Button_Switch_SMD/SW_SPST_TL3305C","Button_Switch_SMD/SW_SPST_TL3342","Button_Switch_SMD/SW_SPST_TS-1088-xR020","Button_Switch_SMD/SW_SPST_TS-1088-xR025","Button_Switch_SMD/SW_Tactile_SPST_NO_Straight_CK_PTS636Sx25SMTRLFS","Button_Switch_THT/KSA_Tactile_SPST","Button_Switch_THT/Nidec_Copal_SH-7010C","Button_Switch_THT/Push_E-Switch_KS01Q01","Button_Switch_THT/SW_CK_JS202011AQN_DPDT_Angled","Button_Switch_THT/SW_CK_JS202011CQN_DPDT_Straight","Button_Switch_THT/SW_CW_GPTS203211B","Button_Switch_THT/SW_DIP_SPSTx01_Piano_10.8x4.1mm_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx01_Slide_6.7x4.1mm_W7.62mm_P2.54mm_LowProfile","Button_Switch_THT/SW_DIP_SPSTx01_Slide_9.78x4.72mm_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx02_Piano_10.8x6.64mm_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx02_Piano_CTS_Series194-2MSTN_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx02_Slide_6.7x6.64mm_W7.62mm_P2.54mm_LowProfile","Button_Switch_THT/SW_DIP_SPSTx02_Slide_9.78x7.26mm_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx03_Piano_10.8x9.18mm_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx03_Piano_CTS_Series194-3MSTN_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx03_Slide_6.7x9.18mm_W7.62mm_P2.54mm_LowProfile","Button_Switch_THT/SW_DIP_SPSTx03_Slide_9.78x9.8mm_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx04_Piano_10.8x11.72mm_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx04_Piano_CTS_Series194-4MSTN_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx04_Slide_6.7x11.72mm_W7.62mm_P2.54mm_LowProfile","Button_Switch_THT/SW_DIP_SPSTx04_Slide_9.78x12.34mm_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx05_Piano_10.8x14.26mm_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx05_Piano_CTS_Series194-5MSTN_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx05_Slide_6.7x14.26mm_W7.62mm_P2.54mm_LowProfile","Button_Switch_THT/SW_DIP_SPSTx05_Slide_9.78x14.88mm_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx06_Piano_10.8x16.8mm_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx06_Piano_CTS_Series194-6MSTN_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx06_Slide_6.7x16.8mm_W7.62mm_P2.54mm_LowProfile","Button_Switch_THT/SW_DIP_SPSTx06_Slide_9.78x17.42mm_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx07_Piano_10.8x19.34mm_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx07_Piano_CTS_Series194-7MSTN_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx07_Slide_6.7x19.34mm_W7.62mm_P2.54mm_LowProfile","Button_Switch_THT/SW_DIP_SPSTx07_Slide_9.78x19.96mm_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx08_Piano_10.8x21.88mm_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx08_Piano_CTS_Series194-8MSTN_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx08_Slide_6.7x21.88mm_W7.62mm_P2.54mm_LowProfile","Button_Switch_THT/SW_DIP_SPSTx08_Slide_9.78x22.5mm_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx09_Piano_10.8x24.42mm_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx09_Piano_CTS_Series194-9MSTN_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx09_Slide_6.7x24.42mm_W7.62mm_P2.54mm_LowProfile","Button_Switch_THT/SW_DIP_SPSTx09_Slide_9.78x25.04mm_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx10_Piano_10.8x26.96mm_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx10_Piano_CTS_Series194-10MSTN_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx10_Slide_6.7x26.96mm_W7.62mm_P2.54mm_LowProfile","Button_Switch_THT/SW_DIP_SPSTx10_Slide_9.78x27.58mm_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx11_Piano_10.8x29.5mm_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx11_Piano_CTS_Series194-11MSTN_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx11_Slide_6.7x29.5mm_W7.62mm_P2.54mm_LowProfile","Button_Switch_THT/SW_DIP_SPSTx11_Slide_9.78x30.12mm_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx12_Piano_10.8x32.04mm_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx12_Piano_CTS_Series194-12MSTN_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx12_Slide_6.7x32.04mm_W7.62mm_P2.54mm_LowProfile","Button_Switch_THT/SW_DIP_SPSTx12_Slide_9.78x32.66mm_W7.62mm_P2.54mm","Button_Switch_THT/SW_E-Switch_EG1224_SPDT_Angled","Button_Switch_THT/SW_E-Switch_EG1271_SPDT","Button_Switch_THT/SW_E-Switch_EG2219_DPDT_Angled","Button_Switch_THT/SW_Lever_1P2T_NKK_GW12LxH","Button_Switch_THT/SW_MEC_5GTH9","Button_Switch_THT/SW_NKK_BB15AH","Button_Switch_THT/SW_NKK_G1xJP","Button_Switch_THT/SW_NKK_GW12LJP","Button_Switch_THT/SW_NKK_NR01","Button_Switch_THT/SW_PUSH-12mm","Button_Switch_THT/SW_PUSH-12mm_Wuerth-430476085716","Button_Switch_THT/SW_PUSH_1P1T_6x3.5mm_H4.3_APEM_MJTP1243","Button_Switch_THT/SW_PUSH_1P1T_6x3.5mm_H5.0_APEM_MJTP1250","Button_Switch_THT/SW_PUSH_6mm","Button_Switch_THT/SW_PUSH_6mm_H13mm","Button_Switch_THT/SW_PUSH_6mm_H4.3mm","Button_Switch_THT/SW_PUSH_6mm_H5mm","Button_Switch_THT/SW_PUSH_6mm_H7.3mm","Button_Switch_THT/SW_PUSH_6mm_H8.5mm","Button_Switch_THT/SW_PUSH_6mm_H8mm","Button_Switch_THT/SW_PUSH_6mm_H9.5mm","Button_Switch_THT/SW_PUSH_E-Switch_FS5700DP_DPDT","Button_Switch_THT/SW_PUSH_LCD_E3_SAxxxx","Button_Switch_THT/SW_PUSH_LCD_E3_SAxxxx_SocketPins","Button_Switch_THT/SW_Push_1P1T_NO_LED_E-Switch_TL1250","Button_Switch_THT/SW_Push_1P2T_Vertical_E-Switch_800UDP8P1A1M6","Button_Switch_THT/SW_Push_2P1T_Toggle_CK_PVA1xxH1xxxxxxV2","Button_Switch_THT/SW_Push_2P1T_Toggle_CK_PVA1xxH2xxxxxxV2","Button_Switch_THT/SW_Push_2P1T_Toggle_CK_PVA1xxH3xxxxxxV2","Button_Switch_THT/SW_Push_2P1T_Toggle_CK_PVA1xxH4xxxxxxV2","Button_Switch_THT/SW_Push_2P2T_Toggle_CK_PVA2OAH5xxxxxxV2","Button_Switch_THT/SW_Push_2P2T_Toggle_CK_PVA2xxH1xxxxxxV2","Button_Switch_THT/SW_Push_2P2T_Toggle_CK_PVA2xxH2xxxxxxV2","Button_Switch_THT/SW_Push_2P2T_Toggle_CK_PVA2xxH3xxxxxxV2","Button_Switch_THT/SW_Push_2P2T_Toggle_CK_PVA2xxH4xxxxxxV2","Button_Switch_THT/SW_Push_2P2T_Vertical_E-Switch_800UDP8P1A1M6","Button_Switch_THT/SW_SPST_Omron_B3F-315x_Angled","Button_Switch_THT/SW_SPST_Omron_B3F-40xx","Button_Switch_THT/SW_SPST_Omron_B3F-50xx","Button_Switch_THT/SW_Slide-03_Wuerth-WS-SLTV_10x2.5x6.4_P2.54mm","Button_Switch_THT/SW_Slide_SP3T_Straight_CK_OS103012MU1QP1","Button_Switch_THT/SW_Slide_SPDT_Angled_CK_OS102011MA1Q","Button_Switch_THT/SW_Slide_SPDT_Straight_CK_OS102011MS2Q","Button_Switch_THT/SW_TH_Tactile_Omron_B3F-100x","Button_Switch_THT/SW_TH_Tactile_Omron_B3F-102x","Button_Switch_THT/SW_TH_Tactile_Omron_B3F-106x","Button_Switch_THT/SW_TH_Tactile_Omron_B3F-107x","Button_Switch_THT/SW_TH_Tactile_Omron_B3F-110x","Button_Switch_THT/SW_TH_Tactile_Omron_B3F-1110","Button_Switch_THT/SW_TH_Tactile_Omron_B3F-112x","Button_Switch_THT/SW_Tactile_SKHH_Angled","Button_Switch_THT/SW_Tactile_SPST_Angled_PTS645Vx31-2LFS","Button_Switch_THT/SW_Tactile_SPST_Angled_PTS645Vx39-2LFS","Button_Switch_THT/SW_Tactile_SPST_Angled_PTS645Vx58-2LFS","Button_Switch_THT/SW_Tactile_SPST_Angled_PTS645Vx83-2LFS","Button_Switch_THT/SW_Tactile_Straight_KSA0Axx1LFTR","Button_Switch_THT/SW_Tactile_Straight_KSL0Axx1LFTR","Button_Switch_THT/SW_XKB_DM1-16UC-1","Button_Switch_THT/SW_XKB_DM1-16UD-1","Button_Switch_THT/SW_XKB_DM1-16UP-1","Buzzer_Beeper/Buzzer_12x9.5RM7.6","Buzzer_Beeper/Buzzer_15x7.5RM7.6","Buzzer_Beeper/Buzzer_CUI_CPT-9019S-SMT","Buzzer_Beeper/Buzzer_D14mm_H7mm_P10mm","Buzzer_Beeper/Buzzer_Mallory_AST1109MLTRQ","Buzzer_Beeper/Buzzer_Mallory_AST1240MLQ","Buzzer_Beeper/Buzzer_Murata_PKLCS1212E","Buzzer_Beeper/Buzzer_Murata_PKMCS0909E","Buzzer_Beeper/Buzzer_TDK_PS1240P02BT_D12.2mm_H6.5mm","Buzzer_Beeper/Indicator_PUI_AI-1440-TWT-24V-2-R","Buzzer_Beeper/MagneticBuzzer_CUI_CMT-8504-100-SMT","Buzzer_Beeper/MagneticBuzzer_CUI_CST-931RP-A","Buzzer_Beeper/MagneticBuzzer_Kingstate_KCG0601","Buzzer_Beeper/MagneticBuzzer_Kobitone_254-EMB73-RO","Buzzer_Beeper/MagneticBuzzer_Kobitone_254-EMB84Q-RO","Buzzer_Beeper/MagneticBuzzer_PUI_AT-0927-TT-6-R","Buzzer_Beeper/MagneticBuzzer_PUI_SMT-1028-T-2-R","Buzzer_Beeper/MagneticBuzzer_ProSignal_ABI-009-RC","Buzzer_Beeper/MagneticBuzzer_ProSignal_ABI-010-RC","Buzzer_Beeper/MagneticBuzzer_ProSignal_ABT-410-RC","Buzzer_Beeper/MagneticBuzzer_ProjectsUnlimited_AI-4228-TWT-R","Buzzer_Beeper/MagneticBuzzer_StarMicronics_HGP","Buzzer_Beeper/MagneticBuzzer_StarMicronics_HMB-06_HMB-12","Buzzer_Beeper/MagneticBuzzer_StarMicronics_HMB","Buzzer_Beeper/MagneticBuzzer_StarMicronics_QMB-105","Buzzer_Beeper/MagneticBuzzer_StarMicronics_QMB-108","Buzzer_Beeper/MagneticBuzzer_StarMicronics_QMB-111","Buzzer_Beeper/MagneticBuzzer_StarMicronics_QMB","Buzzer_Beeper/MagneticBuzzer_StarMicronics_QMX","Buzzer_Beeper/MagneticBuzzer_StarMicronics_RMX","Buzzer_Beeper/MagneticBuzzer_StarMicronics_TMB","Buzzer_Beeper/MagneticBuzzer_StarMicronics_TMX-F","Buzzer_Beeper/MagneticBuzzer_StarMicronics_TMX-H","Buzzer_Beeper/PUIAudio_SMT_0825_S_4_R","Buzzer_Beeper/Speaker_CUI_CMR-1206S-67","Calibration_Scale/Gauge_100mm_Grid_Type1_CopperTop","Calibration_Scale/Gauge_100mm_Type1_CopperTop","Calibration_Scale/Gauge_100mm_Type1_SilkScreenTop","Calibration_Scale/Gauge_100mm_Type2_CopperTop","Calibration_Scale/Gauge_100mm_Type2_SilkScreenTop","Calibration_Scale/Gauge_10mm_Type1_CopperTop","Calibration_Scale/Gauge_10mm_Type1_SilkScreenTop","Calibration_Scale/Gauge_10mm_Type2_CopperTop","Calibration_Scale/Gauge_10mm_Type2_SilkScreenTop","Calibration_Scale/Gauge_10mm_Type3_CopperTop","Calibration_Scale/Gauge_10mm_Type3_SilkScreenTop","Calibration_Scale/Gauge_10mm_Type4_CopperTop","Calibration_Scale/Gauge_10mm_Type4_SilkScreenTop","Calibration_Scale/Gauge_10mm_Type5_CopperTop","Calibration_Scale/Gauge_10mm_Type5_SilkScreenTop","Calibration_Scale/Gauge_50mm_Type1_CopperTop","Calibration_Scale/Gauge_50mm_Type1_SilkScreenTop","Calibration_Scale/Gauge_50mm_Type2_CopperTop","Calibration_Scale/Gauge_50mm_Type2_SilkScreenTop","Capacitor_SMD/CP_Elec_10x10.5","Capacitor_SMD/CP_Elec_10x10","Capacitor_SMD/CP_Elec_10x12.5","Capacitor_SMD/CP_Elec_10x12.6","Capacitor_SMD/CP_Elec_10x14.3","Capacitor_SMD/CP_Elec_10x7.7","Capacitor_SMD/CP_Elec_10x7.9","Capacitor_SMD/CP_Elec_16x17.5","Capacitor_SMD/CP_Elec_16x22","Capacitor_SMD/CP_Elec_18x17.5","Capacitor_SMD/CP_Elec_18x22","Capacitor_SMD/CP_Elec_3x5.3","Capacitor_SMD/CP_Elec_3x5.4","Capacitor_SMD/CP_Elec_4x3.9","Capacitor_SMD/CP_Elec_4x3","Capacitor_SMD/CP_Elec_4x4.5","Capacitor_SMD/CP_Elec_4x5.3","Capacitor_SMD/CP_Elec_4x5.4","Capacitor_SMD/CP_Elec_4x5.7","Capacitor_SMD/CP_Elec_4x5.8","Capacitor_SMD/CP_Elec_5x3.9","Capacitor_SMD/CP_Elec_5x3","Capacitor_SMD/CP_Elec_5x4.4","Capacitor_SMD/CP_Elec_5x4.5","Capacitor_SMD/CP_Elec_5x5.3","Capacitor_SMD/CP_Elec_5x5.4","Capacitor_SMD/CP_Elec_5x5.7","Capacitor_SMD/CP_Elec_5x5.8","Capacitor_SMD/CP_Elec_5x5.9","Capacitor_SMD/CP_Elec_6.3x3.9","Capacitor_SMD/CP_Elec_6.3x3","Capacitor_SMD/CP_Elec_6.3x4.5","Capacitor_SMD/CP_Elec_6.3x4.9","Capacitor_SMD/CP_Elec_6.3x5.2","Capacitor_SMD/CP_Elec_6.3x5.3","Capacitor_SMD/CP_Elec_6.3x5.4","Capacitor_SMD/CP_Elec_6.3x5.4_Nichicon","Capacitor_SMD/CP_Elec_6.3x5.7","Capacitor_SMD/CP_Elec_6.3x5.8","Capacitor_SMD/CP_Elec_6.3x5.9","Capacitor_SMD/CP_Elec_6.3x7.7","Capacitor_SMD/CP_Elec_6.3x9.9","Capacitor_SMD/CP_Elec_8x10.5","Capacitor_SMD/CP_Elec_8x10","Capacitor_SMD/CP_Elec_8x11.9","Capacitor_SMD/CP_Elec_8x5.4","Capacitor_SMD/CP_Elec_8x6.2","Capacitor_SMD/CP_Elec_8x6.5","Capacitor_SMD/CP_Elec_8x6.7","Capacitor_SMD/CP_Elec_8x6.9","Capacitor_SMD/CP_Elec_CAP-XX_DMF3Zxxxxxxxx3D","Capacitor_SMD/C_01005_0402Metric","Capacitor_SMD/C_01005_0402Metric_Pad0.57x0.30mm_HandSolder","Capacitor_SMD/C_0201_0603Metric","Capacitor_SMD/C_0201_0603Metric_Pad0.64x0.40mm_HandSolder","Capacitor_SMD/C_0402_1005Metric","Capacitor_SMD/C_0402_1005Metric_Pad0.74x0.62mm_HandSolder","Capacitor_SMD/C_0504_1310Metric","Capacitor_SMD/C_0504_1310Metric_Pad0.83x1.28mm_HandSolder","Capacitor_SMD/C_0603_1608Metric","Capacitor_SMD/C_0603_1608Metric_Pad1.08x0.95mm_HandSolder","Capacitor_SMD/C_0805_2012Metric","Capacitor_SMD/C_0805_2012Metric_Pad1.18x1.45mm_HandSolder","Capacitor_SMD/C_1206_3216Metric","Capacitor_SMD/C_1206_3216Metric_Pad1.33x1.80mm_HandSolder","Capacitor_SMD/C_1210_3225Metric","Capacitor_SMD/C_1210_3225Metric_Pad1.33x2.70mm_HandSolder","Capacitor_SMD/C_1808_4520Metric","Capacitor_SMD/C_1808_4520Metric_Pad1.72x2.30mm_HandSolder","Capacitor_SMD/C_1812_4532Metric","Capacitor_SMD/C_1812_4532Metric_Pad1.57x3.40mm_HandSolder","Capacitor_SMD/C_1825_4564Metric","Capacitor_SMD/C_1825_4564Metric_Pad1.57x6.80mm_HandSolder","Capacitor_SMD/C_2220_5750Metric","Capacitor_SMD/C_2220_5750Metric_Pad1.97x5.40mm_HandSolder","Capacitor_SMD/C_2225_5664Metric","Capacitor_SMD/C_2225_5664Metric_Pad1.80x6.60mm_HandSolder","Capacitor_SMD/C_3640_9110Metric","Capacitor_SMD/C_3640_9110Metric_Pad2.10x10.45mm_HandSolder","Capacitor_SMD/C_Elec_10x10.2","Capacitor_SMD/C_Elec_3x5.4","Capacitor_SMD/C_Elec_4x5.4","Capacitor_SMD/C_Elec_4x5.8","Capacitor_SMD/C_Elec_5x5.4","Capacitor_SMD/C_Elec_5x5.8","Capacitor_SMD/C_Elec_6.3x5.4","Capacitor_SMD/C_Elec_6.3x5.8","Capacitor_SMD/C_Elec_6.3x7.7","Capacitor_SMD/C_Elec_8x10.2","Capacitor_SMD/C_Elec_8x5.4","Capacitor_SMD/C_Elec_8x6.2","Capacitor_SMD/C_Trimmer_Murata_TZB4-A","Capacitor_SMD/C_Trimmer_Murata_TZB4-B","Capacitor_SMD/C_Trimmer_Murata_TZC3","Capacitor_SMD/C_Trimmer_Murata_TZR1","Capacitor_SMD/C_Trimmer_Murata_TZW4","Capacitor_SMD/C_Trimmer_Murata_TZY2","Capacitor_SMD/C_Trimmer_Sprague-Goodman_SGC3","Capacitor_SMD/C_Trimmer_Voltronics_JN","Capacitor_SMD/C_Trimmer_Voltronics_JQ","Capacitor_SMD/C_Trimmer_Voltronics_JR","Capacitor_SMD/C_Trimmer_Voltronics_JV","Capacitor_SMD/C_Trimmer_Voltronics_JZ","Capacitor_THT/CP_Axial_L10.0mm_D4.5mm_P15.00mm_Horizontal","Capacitor_THT/CP_Axial_L10.0mm_D6.0mm_P15.00mm_Horizontal","Capacitor_THT/CP_Axial_L11.0mm_D5.0mm_P18.00mm_Horizontal","Capacitor_THT/CP_Axial_L11.0mm_D6.0mm_P18.00mm_Horizontal","Capacitor_THT/CP_Axial_L11.0mm_D8.0mm_P15.00mm_Horizontal","Capacitor_THT/CP_Axial_L18.0mm_D10.0mm_P25.00mm_Horizontal","Capacitor_THT/CP_Axial_L18.0mm_D6.5mm_P25.00mm_Horizontal","Capacitor_THT/CP_Axial_L18.0mm_D8.0mm_P25.00mm_Horizontal","Capacitor_THT/CP_Axial_L20.0mm_D10.0mm_P26.00mm_Horizontal","Capacitor_THT/CP_Axial_L20.0mm_D13.0mm_P26.00mm_Horizontal","Capacitor_THT/CP_Axial_L21.0mm_D8.0mm_P28.00mm_Horizontal","Capacitor_THT/CP_Axial_L25.0mm_D10.0mm_P30.00mm_Horizontal","Capacitor_THT/CP_Axial_L26.5mm_D20.0mm_P33.00mm_Horizontal","Capacitor_THT/CP_Axial_L29.0mm_D10.0mm_P35.00mm_Horizontal","Capacitor_THT/CP_Axial_L29.0mm_D13.0mm_P35.00mm_Horizontal","Capacitor_THT/CP_Axial_L29.0mm_D16.0mm_P35.00mm_Horizontal","Capacitor_THT/CP_Axial_L29.0mm_D20.0mm_P35.00mm_Horizontal","Capacitor_THT/CP_Axial_L30.0mm_D10.0mm_P35.00mm_Horizontal","Capacitor_THT/CP_Axial_L30.0mm_D12.5mm_P35.00mm_Horizontal","Capacitor_THT/CP_Axial_L30.0mm_D15.0mm_P35.00mm_Horizontal","Capacitor_THT/CP_Axial_L30.0mm_D18.0mm_P35.00mm_Horizontal","Capacitor_THT/CP_Axial_L34.5mm_D20.0mm_P41.00mm_Horizontal","Capacitor_THT/CP_Axial_L37.0mm_D13.0mm_P43.00mm_Horizontal","Capacitor_THT/CP_Axial_L37.0mm_D16.0mm_P43.00mm_Horizontal","Capacitor_THT/CP_Axial_L37.0mm_D20.0mm_P43.00mm_Horizontal","Capacitor_THT/CP_Axial_L38.0mm_D18.0mm_P44.00mm_Horizontal","Capacitor_THT/CP_Axial_L38.0mm_D21.0mm_P44.00mm_Horizontal","Capacitor_THT/CP_Axial_L40.0mm_D16.0mm_P48.00mm_Horizontal","Capacitor_THT/CP_Axial_L42.0mm_D23.0mm_P45.00mm_Horizontal","Capacitor_THT/CP_Axial_L42.0mm_D26.0mm_P45.00mm_Horizontal","Capacitor_THT/CP_Axial_L42.0mm_D29.0mm_P45.00mm_Horizontal","Capacitor_THT/CP_Axial_L42.0mm_D32.0mm_P45.00mm_Horizontal","Capacitor_THT/CP_Axial_L42.0mm_D35.0mm_P45.00mm_Horizontal","Capacitor_THT/CP_Axial_L42.5mm_D20.0mm_P49.00mm_Horizontal","Capacitor_THT/CP_Axial_L46.0mm_D20.0mm_P52.00mm_Horizontal","Capacitor_THT/CP_Axial_L55.0mm_D23.0mm_P60.00mm_Horizontal","Capacitor_THT/CP_Axial_L55.0mm_D26.0mm_P60.00mm_Horizontal","Capacitor_THT/CP_Axial_L55.0mm_D29.0mm_P60.00mm_Horizontal","Capacitor_THT/CP_Axial_L55.0mm_D32.0mm_P60.00mm_Horizontal","Capacitor_THT/CP_Axial_L55.0mm_D35.0mm_P60.00mm_Horizontal","Capacitor_THT/CP_Axial_L67.0mm_D23.0mm_P75.00mm_Horizontal","Capacitor_THT/CP_Axial_L67.0mm_D26.0mm_P75.00mm_Horizontal","Capacitor_THT/CP_Axial_L67.0mm_D29.0mm_P75.00mm_Horizontal","Capacitor_THT/CP_Axial_L67.0mm_D32.0mm_P75.00mm_Horizontal","Capacitor_THT/CP_Axial_L67.0mm_D35.0mm_P75.00mm_Horizontal","Capacitor_THT/CP_Axial_L80.0mm_D23.0mm_P85.00mm_Horizontal","Capacitor_THT/CP_Axial_L80.0mm_D26.0mm_P85.00mm_Horizontal","Capacitor_THT/CP_Axial_L80.0mm_D29.0mm_P85.00mm_Horizontal","Capacitor_THT/CP_Axial_L80.0mm_D32.0mm_P85.00mm_Horizontal","Capacitor_THT/CP_Axial_L80.0mm_D35.0mm_P85.00mm_Horizontal","Capacitor_THT/CP_Axial_L93.0mm_D23.0mm_P100.00mm_Horizontal","Capacitor_THT/CP_Axial_L93.0mm_D26.0mm_P100.00mm_Horizontal","Capacitor_THT/CP_Axial_L93.0mm_D29.0mm_P100.00mm_Horizontal","Capacitor_THT/CP_Axial_L93.0mm_D32.0mm_P100.00mm_Horizontal","Capacitor_THT/CP_Axial_L93.0mm_D35.0mm_P100.00mm_Horizontal","Capacitor_THT/CP_Radial_D10.0mm_P2.50mm","Capacitor_THT/CP_Radial_D10.0mm_P2.50mm_P5.00mm","Capacitor_THT/CP_Radial_D10.0mm_P3.50mm","Capacitor_THT/CP_Radial_D10.0mm_P3.80mm","Capacitor_THT/CP_Radial_D10.0mm_P5.00mm","Capacitor_THT/CP_Radial_D10.0mm_P5.00mm_P7.50mm","Capacitor_THT/CP_Radial_D10.0mm_P7.50mm","Capacitor_THT/CP_Radial_D12.5mm_P2.50mm","Capacitor_THT/CP_Radial_D12.5mm_P5.00mm","Capacitor_THT/CP_Radial_D12.5mm_P7.50mm","Capacitor_THT/CP_Radial_D13.0mm_P2.50mm","Capacitor_THT/CP_Radial_D13.0mm_P5.00mm","Capacitor_THT/CP_Radial_D13.0mm_P7.50mm","Capacitor_THT/CP_Radial_D14.0mm_P5.00mm","Capacitor_THT/CP_Radial_D14.0mm_P7.50mm","Capacitor_THT/CP_Radial_D16.0mm_P7.50mm","Capacitor_THT/CP_Radial_D17.0mm_P7.50mm","Capacitor_THT/CP_Radial_D18.0mm_P7.50mm","Capacitor_THT/CP_Radial_D22.0mm_P10.00mm_3pin_SnapIn","Capacitor_THT/CP_Radial_D22.0mm_P10.00mm_SnapIn","Capacitor_THT/CP_Radial_D24.0mm_P10.00mm_3pin_SnapIn","Capacitor_THT/CP_Radial_D24.0mm_P10.00mm_SnapIn","Capacitor_THT/CP_Radial_D25.0mm_P10.00mm_3pin_SnapIn","Capacitor_THT/CP_Radial_D25.0mm_P10.00mm_SnapIn","Capacitor_THT/CP_Radial_D26.0mm_P10.00mm_3pin_SnapIn","Capacitor_THT/CP_Radial_D26.0mm_P10.00mm_SnapIn","Capacitor_THT/CP_Radial_D30.0mm_P10.00mm_3pin_SnapIn","Capacitor_THT/CP_Radial_D30.0mm_P10.00mm_SnapIn","Capacitor_THT/CP_Radial_D35.0mm_P10.00mm_3pin_SnapIn","Capacitor_THT/CP_Radial_D35.0mm_P10.00mm_SnapIn","Capacitor_THT/CP_Radial_D4.0mm_P1.50mm","Capacitor_THT/CP_Radial_D4.0mm_P2.00mm","Capacitor_THT/CP_Radial_D40.0mm_P10.00mm_3pin_SnapIn","Capacitor_THT/CP_Radial_D40.0mm_P10.00mm_SnapIn","Capacitor_THT/CP_Radial_D5.0mm_P2.00mm","Capacitor_THT/CP_Radial_D5.0mm_P2.50mm","Capacitor_THT/CP_Radial_D6.3mm_P2.50mm","Capacitor_THT/CP_Radial_D7.5mm_P2.50mm","Capacitor_THT/CP_Radial_D8.0mm_P2.50mm","Capacitor_THT/CP_Radial_D8.0mm_P3.50mm","Capacitor_THT/CP_Radial_D8.0mm_P3.80mm","Capacitor_THT/CP_Radial_D8.0mm_P5.00mm","Capacitor_THT/CP_Radial_Tantal_D10.5mm_P2.50mm","Capacitor_THT/CP_Radial_Tantal_D10.5mm_P5.00mm","Capacitor_THT/CP_Radial_Tantal_D4.5mm_P2.50mm","Capacitor_THT/CP_Radial_Tantal_D4.5mm_P5.00mm","Capacitor_THT/CP_Radial_Tantal_D5.0mm_P2.50mm","Capacitor_THT/CP_Radial_Tantal_D5.0mm_P5.00mm","Capacitor_THT/CP_Radial_Tantal_D5.5mm_P2.50mm","Capacitor_THT/CP_Radial_Tantal_D5.5mm_P5.00mm","Capacitor_THT/CP_Radial_Tantal_D6.0mm_P2.50mm","Capacitor_THT/CP_Radial_Tantal_D6.0mm_P5.00mm","Capacitor_THT/CP_Radial_Tantal_D7.0mm_P2.50mm","Capacitor_THT/CP_Radial_Tantal_D7.0mm_P5.00mm","Capacitor_THT/CP_Radial_Tantal_D8.0mm_P2.50mm","Capacitor_THT/CP_Radial_Tantal_D8.0mm_P5.00mm","Capacitor_THT/CP_Radial_Tantal_D9.0mm_P2.50mm","Capacitor_THT/CP_Radial_Tantal_D9.0mm_P5.00mm","Capacitor_THT/C_Axial_L12.0mm_D10.5mm_P15.00mm_Horizontal","Capacitor_THT/C_Axial_L12.0mm_D10.5mm_P20.00mm_Horizontal","Capacitor_THT/C_Axial_L12.0mm_D6.5mm_P15.00mm_Horizontal","Capacitor_THT/C_Axial_L12.0mm_D6.5mm_P20.00mm_Horizontal","Capacitor_THT/C_Axial_L12.0mm_D7.5mm_P15.00mm_Horizontal","Capacitor_THT/C_Axial_L12.0mm_D7.5mm_P20.00mm_Horizontal","Capacitor_THT/C_Axial_L12.0mm_D8.5mm_P15.00mm_Horizontal","Capacitor_THT/C_Axial_L12.0mm_D8.5mm_P20.00mm_Horizontal","Capacitor_THT/C_Axial_L12.0mm_D9.5mm_P15.00mm_Horizontal","Capacitor_THT/C_Axial_L12.0mm_D9.5mm_P20.00mm_Horizontal","Capacitor_THT/C_Axial_L17.0mm_D6.5mm_P20.00mm_Horizontal","Capacitor_THT/C_Axial_L17.0mm_D6.5mm_P25.00mm_Horizontal","Capacitor_THT/C_Axial_L17.0mm_D7.0mm_P20.00mm_Horizontal","Capacitor_THT/C_Axial_L17.0mm_D7.0mm_P25.00mm_Horizontal","Capacitor_THT/C_Axial_L19.0mm_D7.5mm_P25.00mm_Horizontal","Capacitor_THT/C_Axial_L19.0mm_D8.0mm_P25.00mm_Horizontal","Capacitor_THT/C_Axial_L19.0mm_D9.0mm_P25.00mm_Horizontal","Capacitor_THT/C_Axial_L19.0mm_D9.5mm_P25.00mm_Horizontal","Capacitor_THT/C_Axial_L22.0mm_D10.5mm_P27.50mm_Horizontal","Capacitor_THT/C_Axial_L22.0mm_D9.5mm_P27.50mm_Horizontal","Capacitor_THT/C_Axial_L3.8mm_D2.6mm_P10.00mm_Horizontal","Capacitor_THT/C_Axial_L3.8mm_D2.6mm_P12.50mm_Horizontal","Capacitor_THT/C_Axial_L3.8mm_D2.6mm_P15.00mm_Horizontal","Capacitor_THT/C_Axial_L3.8mm_D2.6mm_P7.50mm_Horizontal","Capacitor_THT/C_Axial_L5.1mm_D3.1mm_P10.00mm_Horizontal","Capacitor_THT/C_Axial_L5.1mm_D3.1mm_P12.50mm_Horizontal","Capacitor_THT/C_Axial_L5.1mm_D3.1mm_P15.00mm_Horizontal","Capacitor_THT/C_Axial_L5.1mm_D3.1mm_P7.50mm_Horizontal","Capacitor_THT/C_Disc_D10.0mm_W2.5mm_P5.00mm","Capacitor_THT/C_Disc_D10.5mm_W5.0mm_P10.00mm","Capacitor_THT/C_Disc_D10.5mm_W5.0mm_P5.00mm","Capacitor_THT/C_Disc_D10.5mm_W5.0mm_P7.50mm","Capacitor_THT/C_Disc_D11.0mm_W5.0mm_P10.00mm","Capacitor_THT/C_Disc_D11.0mm_W5.0mm_P5.00mm","Capacitor_THT/C_Disc_D11.0mm_W5.0mm_P7.50mm","Capacitor_THT/C_Disc_D12.0mm_W4.4mm_P7.75mm","Capacitor_THT/C_Disc_D12.5mm_W5.0mm_P10.00mm","Capacitor_THT/C_Disc_D12.5mm_W5.0mm_P7.50mm","Capacitor_THT/C_Disc_D14.5mm_W5.0mm_P10.00mm","Capacitor_THT/C_Disc_D14.5mm_W5.0mm_P7.50mm","Capacitor_THT/C_Disc_D16.0mm_W5.0mm_P10.00mm","Capacitor_THT/C_Disc_D16.0mm_W5.0mm_P7.50mm","Capacitor_THT/C_Disc_D3.0mm_W1.6mm_P2.50mm","Capacitor_THT/C_Disc_D3.0mm_W2.0mm_P2.50mm","Capacitor_THT/C_Disc_D3.4mm_W2.1mm_P2.50mm","Capacitor_THT/C_Disc_D3.8mm_W2.6mm_P2.50mm","Capacitor_THT/C_Disc_D4.3mm_W1.9mm_P5.00mm","Capacitor_THT/C_Disc_D4.7mm_W2.5mm_P5.00mm","Capacitor_THT/C_Disc_D5.0mm_W2.5mm_P2.50mm","Capacitor_THT/C_Disc_D5.0mm_W2.5mm_P5.00mm","Capacitor_THT/C_Disc_D5.1mm_W3.2mm_P5.00mm","Capacitor_THT/C_Disc_D6.0mm_W2.5mm_P5.00mm","Capacitor_THT/C_Disc_D6.0mm_W4.4mm_P5.00mm","Capacitor_THT/C_Disc_D7.0mm_W2.5mm_P5.00mm","Capacitor_THT/C_Disc_D7.5mm_W2.5mm_P5.00mm","Capacitor_THT/C_Disc_D7.5mm_W4.4mm_P5.00mm","Capacitor_THT/C_Disc_D7.5mm_W5.0mm_P10.00mm","Capacitor_THT/C_Disc_D7.5mm_W5.0mm_P5.00mm","Capacitor_THT/C_Disc_D7.5mm_W5.0mm_P7.50mm","Capacitor_THT/C_Disc_D8.0mm_W2.5mm_P5.00mm","Capacitor_THT/C_Disc_D8.0mm_W5.0mm_P10.00mm","Capacitor_THT/C_Disc_D8.0mm_W5.0mm_P5.00mm","Capacitor_THT/C_Disc_D8.0mm_W5.0mm_P7.50mm","Capacitor_THT/C_Disc_D9.0mm_W2.5mm_P5.00mm","Capacitor_THT/C_Disc_D9.0mm_W5.0mm_P10.00mm","Capacitor_THT/C_Disc_D9.0mm_W5.0mm_P5.00mm","Capacitor_THT/C_Disc_D9.0mm_W5.0mm_P7.50mm","Capacitor_THT/C_Radial_D10.0mm_H12.5mm_P5.00mm","Capacitor_THT/C_Radial_D10.0mm_H16.0mm_P5.00mm","Capacitor_THT/C_Radial_D10.0mm_H20.0mm_P5.00mm","Capacitor_THT/C_Radial_D12.5mm_H20.0mm_P5.00mm","Capacitor_THT/C_Radial_D12.5mm_H25.0mm_P5.00mm","Capacitor_THT/C_Radial_D16.0mm_H25.0mm_P7.50mm","Capacitor_THT/C_Radial_D16.0mm_H31.5mm_P7.50mm","Capacitor_THT/C_Radial_D18.0mm_H35.5mm_P7.50mm","Capacitor_THT/C_Radial_D4.0mm_H5.0mm_P1.50mm","Capacitor_THT/C_Radial_D4.0mm_H7.0mm_P1.50mm","Capacitor_THT/C_Radial_D5.0mm_H11.0mm_P2.00mm","Capacitor_THT/C_Radial_D5.0mm_H5.0mm_P2.00mm","Capacitor_THT/C_Radial_D5.0mm_H7.0mm_P2.00mm","Capacitor_THT/C_Radial_D6.3mm_H11.0mm_P2.50mm","Capacitor_THT/C_Radial_D6.3mm_H5.0mm_P2.50mm","Capacitor_THT/C_Radial_D6.3mm_H7.0mm_P2.50mm","Capacitor_THT/C_Radial_D8.0mm_H11.5mm_P3.50mm","Capacitor_THT/C_Radial_D8.0mm_H7.0mm_P3.50mm","Capacitor_THT/C_Rect_L10.0mm_W2.5mm_P7.50mm_MKS4","Capacitor_THT/C_Rect_L10.0mm_W3.0mm_P7.50mm_FKS3_FKP3","Capacitor_THT/C_Rect_L10.0mm_W3.0mm_P7.50mm_MKS4","Capacitor_THT/C_Rect_L10.0mm_W4.0mm_P7.50mm_FKS3_FKP3","Capacitor_THT/C_Rect_L10.0mm_W4.0mm_P7.50mm_MKS4","Capacitor_THT/C_Rect_L10.0mm_W5.0mm_P5.00mm_P7.50mm","Capacitor_THT/C_Rect_L10.3mm_W4.5mm_P7.50mm_MKS4","Capacitor_THT/C_Rect_L10.3mm_W5.0mm_P7.50mm_MKS4","Capacitor_THT/C_Rect_L10.3mm_W5.7mm_P7.50mm_MKS4","Capacitor_THT/C_Rect_L10.3mm_W7.2mm_P7.50mm_MKS4","Capacitor_THT/C_Rect_L11.0mm_W2.8mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.0mm_W3.4mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.0mm_W3.5mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.0mm_W4.2mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.0mm_W4.3mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.0mm_W5.1mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.0mm_W5.3mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.0mm_W6.3mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.0mm_W6.4mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.0mm_W7.3mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.0mm_W8.8mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.5mm_W2.0mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.5mm_W2.6mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.5mm_W2.8mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.5mm_W3.2mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.5mm_W3.5mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.5mm_W3.6mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.5mm_W4.0mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.5mm_W4.3mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.5mm_W4.5mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.5mm_W5.0mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.5mm_W5.1mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.5mm_W5.2mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.5mm_W5.6mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.5mm_W6.4mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.5mm_W6.6mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.5mm_W6.9mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.5mm_W7.3mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.5mm_W7.5mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.5mm_W7.8mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.5mm_W8.0mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.5mm_W8.8mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.5mm_W9.5mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.5mm_W9.8mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L13.0mm_W3.0mm_P10.00mm_FKS3_FKP3_MKS4","Capacitor_THT/C_Rect_L13.0mm_W4.0mm_P10.00mm_FKS3_FKP3_MKS4","Capacitor_THT/C_Rect_L13.0mm_W5.0mm_P10.00mm_FKS3_FKP3_MKS4","Capacitor_THT/C_Rect_L13.0mm_W6.0mm_P10.00mm_FKS3_FKP3_MKS4","Capacitor_THT/C_Rect_L13.0mm_W6.5mm_P7.50mm_P10.00mm","Capacitor_THT/C_Rect_L13.0mm_W8.0mm_P10.00mm_FKS3_FKP3_MKS4","Capacitor_THT/C_Rect_L13.5mm_W4.0mm_P10.00mm_FKS3_FKP3_MKS4","Capacitor_THT/C_Rect_L13.5mm_W5.0mm_P10.00mm_FKS3_FKP3_MKS4","Capacitor_THT/C_Rect_L16.5mm_W10.7mm_P15.00mm_MKT","Capacitor_THT/C_Rect_L16.5mm_W10.9mm_P15.00mm_MKT","Capacitor_THT/C_Rect_L16.5mm_W11.2mm_P15.00mm_MKT","Capacitor_THT/C_Rect_L16.5mm_W11.8mm_P15.00mm_MKT","Capacitor_THT/C_Rect_L16.5mm_W13.5mm_P15.00mm_MKT","Capacitor_THT/C_Rect_L16.5mm_W13.7mm_P15.00mm_MKT","Capacitor_THT/C_Rect_L16.5mm_W13.9mm_P15.00mm_MKT","Capacitor_THT/C_Rect_L16.5mm_W4.7mm_P15.00mm_MKT","Capacitor_THT/C_Rect_L16.5mm_W4.9mm_P15.00mm_MKT","Capacitor_THT/C_Rect_L16.5mm_W5.0mm_P15.00mm_MKT","Capacitor_THT/C_Rect_L16.5mm_W6.0mm_P15.00mm_MKT","Capacitor_THT/C_Rect_L16.5mm_W7.0mm_P15.00mm_MKT","Capacitor_THT/C_Rect_L16.5mm_W7.3mm_P15.00mm_MKT","Capacitor_THT/C_Rect_L16.5mm_W8.7mm_P15.00mm_MKT","Capacitor_THT/C_Rect_L16.5mm_W8.9mm_P15.00mm_MKT","Capacitor_THT/C_Rect_L16.5mm_W9.0mm_P15.00mm_MKT","Capacitor_THT/C_Rect_L16.5mm_W9.2mm_P15.00mm_MKT","Capacitor_THT/C_Rect_L18.0mm_W11.0mm_P15.00mm_FKS3_FKP3","Capacitor_THT/C_Rect_L18.0mm_W5.0mm_P15.00mm_FKS3_FKP3","Capacitor_THT/C_Rect_L18.0mm_W6.0mm_P15.00mm_FKS3_FKP3","Capacitor_THT/C_Rect_L18.0mm_W7.0mm_P15.00mm_FKS3_FKP3","Capacitor_THT/C_Rect_L18.0mm_W8.0mm_P15.00mm_FKS3_FKP3","Capacitor_THT/C_Rect_L18.0mm_W9.0mm_P15.00mm_FKS3_FKP3","Capacitor_THT/C_Rect_L19.0mm_W11.0mm_P15.00mm_MKS4","Capacitor_THT/C_Rect_L19.0mm_W5.0mm_P15.00mm_MKS4","Capacitor_THT/C_Rect_L19.0mm_W6.0mm_P15.00mm_MKS4","Capacitor_THT/C_Rect_L19.0mm_W7.0mm_P15.00mm_MKS4","Capacitor_THT/C_Rect_L19.0mm_W8.0mm_P15.00mm_MKS4","Capacitor_THT/C_Rect_L19.0mm_W9.0mm_P15.00mm_MKS4","Capacitor_THT/C_Rect_L24.0mm_W10.1mm_P22.50mm_MKT","Capacitor_THT/C_Rect_L24.0mm_W10.3mm_P22.50mm_MKT","Capacitor_THT/C_Rect_L24.0mm_W10.9mm_P22.50mm_MKT","Capacitor_THT/C_Rect_L24.0mm_W12.2mm_P22.50mm_MKT","Capacitor_THT/C_Rect_L24.0mm_W12.6mm_P22.50mm_MKT","Capacitor_THT/C_Rect_L24.0mm_W12.8mm_P22.50mm_MKT","Capacitor_THT/C_Rect_L24.0mm_W7.0mm_P22.50mm_MKT","Capacitor_THT/C_Rect_L24.0mm_W8.3mm_P22.50mm_MKT","Capacitor_THT/C_Rect_L24.0mm_W8.6mm_P22.50mm_MKT","Capacitor_THT/C_Rect_L26.5mm_W10.5mm_P22.50mm_MKS4","Capacitor_THT/C_Rect_L26.5mm_W11.5mm_P22.50mm_MKS4","Capacitor_THT/C_Rect_L26.5mm_W5.0mm_P22.50mm_MKS4","Capacitor_THT/C_Rect_L26.5mm_W6.0mm_P22.50mm_MKS4","Capacitor_THT/C_Rect_L26.5mm_W7.0mm_P22.50mm_MKS4","Capacitor_THT/C_Rect_L26.5mm_W8.5mm_P22.50mm_MKS4","Capacitor_THT/C_Rect_L27.0mm_W11.0mm_P22.00mm","Capacitor_THT/C_Rect_L27.0mm_W9.0mm_P22.00mm","Capacitor_THT/C_Rect_L27.0mm_W9.0mm_P23.00mm","Capacitor_THT/C_Rect_L28.0mm_W10.0mm_P22.50mm_MKS4","Capacitor_THT/C_Rect_L28.0mm_W12.0mm_P22.50mm_MKS4","Capacitor_THT/C_Rect_L28.0mm_W8.0mm_P22.50mm_MKS4","Capacitor_THT/C_Rect_L29.0mm_W11.0mm_P27.50mm_MKT","Capacitor_THT/C_Rect_L29.0mm_W11.9mm_P27.50mm_MKT","Capacitor_THT/C_Rect_L29.0mm_W12.2mm_P27.50mm_MKT","Capacitor_THT/C_Rect_L29.0mm_W13.0mm_P27.50mm_MKT","Capacitor_THT/C_Rect_L29.0mm_W13.8mm_P27.50mm_MKT","Capacitor_THT/C_Rect_L29.0mm_W14.2mm_P27.50mm_MKT","Capacitor_THT/C_Rect_L29.0mm_W16.0mm_P27.50mm_MKT","Capacitor_THT/C_Rect_L29.0mm_W7.6mm_P27.50mm_MKT","Capacitor_THT/C_Rect_L29.0mm_W7.8mm_P27.50mm_MKT","Capacitor_THT/C_Rect_L29.0mm_W7.9mm_P27.50mm_MKT","Capacitor_THT/C_Rect_L29.0mm_W9.1mm_P27.50mm_MKT","Capacitor_THT/C_Rect_L29.0mm_W9.6mm_P27.50mm_MKT","Capacitor_THT/C_Rect_L31.5mm_W11.0mm_P27.50mm_MKS4","Capacitor_THT/C_Rect_L31.5mm_W13.0mm_P27.50mm_MKS4","Capacitor_THT/C_Rect_L31.5mm_W15.0mm_P27.50mm_MKS4","Capacitor_THT/C_Rect_L31.5mm_W17.0mm_P27.50mm_MKS4","Capacitor_THT/C_Rect_L31.5mm_W20.0mm_P27.50mm_MKS4","Capacitor_THT/C_Rect_L31.5mm_W9.0mm_P27.50mm_MKS4","Capacitor_THT/C_Rect_L32.0mm_W15.0mm_P27.00mm","Capacitor_THT/C_Rect_L33.0mm_W13.0mm_P27.50mm_MKS4","Capacitor_THT/C_Rect_L33.0mm_W15.0mm_P27.50mm_MKS4","Capacitor_THT/C_Rect_L33.0mm_W20.0mm_P27.50mm_MKS4","Capacitor_THT/C_Rect_L4.0mm_W2.5mm_P2.50mm","Capacitor_THT/C_Rect_L4.6mm_W2.0mm_P2.50mm_MKS02_FKP02","Capacitor_THT/C_Rect_L4.6mm_W3.0mm_P2.50mm_MKS02_FKP02","Capacitor_THT/C_Rect_L4.6mm_W3.8mm_P2.50mm_MKS02_FKP02","Capacitor_THT/C_Rect_L4.6mm_W4.6mm_P2.50mm_MKS02_FKP02","Capacitor_THT/C_Rect_L4.6mm_W5.5mm_P2.50mm_MKS02_FKP02","Capacitor_THT/C_Rect_L41.5mm_W11.0mm_P37.50mm_MKS4","Capacitor_THT/C_Rect_L41.5mm_W13.0mm_P37.50mm_MKS4","Capacitor_THT/C_Rect_L41.5mm_W15.0mm_P37.50mm_MKS4","Capacitor_THT/C_Rect_L41.5mm_W17.0mm_P37.50mm_MKS4","Capacitor_THT/C_Rect_L41.5mm_W19.0mm_P37.50mm_MKS4","Capacitor_THT/C_Rect_L41.5mm_W20.0mm_P37.50mm_MKS4","Capacitor_THT/C_Rect_L41.5mm_W24.0mm_P37.50mm_MKS4","Capacitor_THT/C_Rect_L41.5mm_W31.0mm_P37.50mm_MKS4","Capacitor_THT/C_Rect_L41.5mm_W35.0mm_P37.50mm_MKS4","Capacitor_THT/C_Rect_L41.5mm_W40.0mm_P37.50mm_MKS4","Capacitor_THT/C_Rect_L41.5mm_W9.0mm_P37.50mm_MKS4","Capacitor_THT/C_Rect_L7.0mm_W2.0mm_P5.00mm","Capacitor_THT/C_Rect_L7.0mm_W2.5mm_P5.00mm","Capacitor_THT/C_Rect_L7.0mm_W3.5mm_P2.50mm_P5.00mm","Capacitor_THT/C_Rect_L7.0mm_W3.5mm_P5.00mm","Capacitor_THT/C_Rect_L7.0mm_W4.5mm_P5.00mm","Capacitor_THT/C_Rect_L7.0mm_W6.0mm_P5.00mm","Capacitor_THT/C_Rect_L7.0mm_W6.5mm_P5.00mm","Capacitor_THT/C_Rect_L7.2mm_W11.0mm_P5.00mm_FKS2_FKP2_MKS2_MKP2","Capacitor_THT/C_Rect_L7.2mm_W2.5mm_P5.00mm","Capacitor_THT/C_Rect_L7.2mm_W2.5mm_P5.00mm_FKS2_FKP2_MKS2_MKP2","Capacitor_THT/C_Rect_L7.2mm_W3.0mm_P5.00mm_FKS2_FKP2_MKS2_MKP2","Capacitor_THT/C_Rect_L7.2mm_W3.5mm_P5.00mm","Capacitor_THT/C_Rect_L7.2mm_W3.5mm_P5.00mm_FKS2_FKP2_MKS2_MKP2","Capacitor_THT/C_Rect_L7.2mm_W4.5mm_P5.00mm","Capacitor_THT/C_Rect_L7.2mm_W4.5mm_P5.00mm_FKS2_FKP2_MKS2_MKP2","Capacitor_THT/C_Rect_L7.2mm_W5.0mm_P5.00mm","Capacitor_THT/C_Rect_L7.2mm_W5.5mm_P5.00mm_FKS2_FKP2_MKS2_MKP2","Capacitor_THT/C_Rect_L7.2mm_W6.0mm_P5.00mm","Capacitor_THT/C_Rect_L7.2mm_W7.2mm_P5.00mm","Capacitor_THT/C_Rect_L7.2mm_W7.2mm_P5.00mm_FKS2_FKP2_MKS2_MKP2","Capacitor_THT/C_Rect_L7.2mm_W8.5mm_P5.00mm_FKP2_FKP2_MKS2_MKP2","Capacitor_THT/C_Rect_L7.5mm_W6.5mm_P5.00mm","Capacitor_THT/C_Rect_L9.0mm_W2.5mm_P7.50mm_MKT","Capacitor_THT/C_Rect_L9.0mm_W2.6mm_P7.50mm_MKT","Capacitor_THT/C_Rect_L9.0mm_W2.7mm_P7.50mm_MKT","Capacitor_THT/C_Rect_L9.0mm_W3.2mm_P7.50mm_MKT","Capacitor_THT/C_Rect_L9.0mm_W3.3mm_P7.50mm_MKT","Capacitor_THT/C_Rect_L9.0mm_W3.4mm_P7.50mm_MKT","Capacitor_THT/C_Rect_L9.0mm_W3.6mm_P7.50mm_MKT","Capacitor_THT/C_Rect_L9.0mm_W3.8mm_P7.50mm_MKT","Capacitor_THT/C_Rect_L9.0mm_W3.9mm_P7.50mm_MKT","Capacitor_THT/C_Rect_L9.0mm_W4.0mm_P7.50mm_MKT","Capacitor_THT/C_Rect_L9.0mm_W4.2mm_P7.50mm_MKT","Capacitor_THT/C_Rect_L9.0mm_W4.9mm_P7.50mm_MKT","Capacitor_THT/C_Rect_L9.0mm_W5.1mm_P7.50mm_MKT","Capacitor_THT/C_Rect_L9.0mm_W5.7mm_P7.50mm_MKT","Capacitor_THT/C_Rect_L9.0mm_W6.4mm_P7.50mm_MKT","Capacitor_THT/C_Rect_L9.0mm_W6.7mm_P7.50mm_MKT","Capacitor_THT/C_Rect_L9.0mm_W7.7mm_P7.50mm_MKT","Capacitor_THT/C_Rect_L9.0mm_W8.5mm_P7.50mm_MKT","Capacitor_THT/C_Rect_L9.0mm_W9.5mm_P7.50mm_MKT","Capacitor_THT/C_Rect_L9.0mm_W9.8mm_P7.50mm_MKT","Capacitor_THT/DX_5R5HxxxxU_D11.5mm_P10.00mm","Capacitor_THT/DX_5R5VxxxxU_D11.5mm_P5.00mm","Capacitor_THT/DX_5R5VxxxxU_D19.0mm_P5.00mm","Capacitor_Tantalum_SMD/CP_EIA-1608-08_AVX-J","Capacitor_Tantalum_SMD/CP_EIA-1608-08_AVX-J_HandSolder","Capacitor_Tantalum_SMD/CP_EIA-1608-10_AVX-L","Capacitor_Tantalum_SMD/CP_EIA-1608-10_AVX-L_HandSolder","Capacitor_Tantalum_SMD/CP_EIA-2012-12_Kemet-R","Capacitor_Tantalum_SMD/CP_EIA-2012-12_Kemet-R_HandSolder","Capacitor_Tantalum_SMD/CP_EIA-2012-15_AVX-P","Capacitor_Tantalum_SMD/CP_EIA-2012-15_AVX-P_HandSolder","Capacitor_Tantalum_SMD/CP_EIA-3216-10_Kemet-I","Capacitor_Tantalum_SMD/CP_EIA-3216-10_Kemet-I_HandSolder","Capacitor_Tantalum_SMD/CP_EIA-3216-12_Kemet-S","Capacitor_Tantalum_SMD/CP_EIA-3216-12_Kemet-S_HandSolder","Capacitor_Tantalum_SMD/CP_EIA-3216-18_Kemet-A","Capacitor_Tantalum_SMD/CP_EIA-3216-18_Kemet-A_HandSolder","Capacitor_Tantalum_SMD/CP_EIA-3528-12_Kemet-T","Capacitor_Tantalum_SMD/CP_EIA-3528-12_Kemet-T_HandSolder","Capacitor_Tantalum_SMD/CP_EIA-3528-15_AVX-H","Capacitor_Tantalum_SMD/CP_EIA-3528-15_AVX-H_HandSolder","Capacitor_Tantalum_SMD/CP_EIA-3528-21_Kemet-B","Capacitor_Tantalum_SMD/CP_EIA-3528-21_Kemet-B_HandSolder","Capacitor_Tantalum_SMD/CP_EIA-6032-15_Kemet-U","Capacitor_Tantalum_SMD/CP_EIA-6032-15_Kemet-U_HandSolder","Capacitor_Tantalum_SMD/CP_EIA-6032-20_AVX-F","Capacitor_Tantalum_SMD/CP_EIA-6032-20_AVX-F_HandSolder","Capacitor_Tantalum_SMD/CP_EIA-6032-28_Kemet-C","Capacitor_Tantalum_SMD/CP_EIA-6032-28_Kemet-C_HandSolder","Capacitor_Tantalum_SMD/CP_EIA-7132-20_AVX-U","Capacitor_Tantalum_SMD/CP_EIA-7132-20_AVX-U_HandSolder","Capacitor_Tantalum_SMD/CP_EIA-7132-28_AVX-C","Capacitor_Tantalum_SMD/CP_EIA-7132-28_AVX-C_HandSolder","Capacitor_Tantalum_SMD/CP_EIA-7260-15_AVX-R","Capacitor_Tantalum_SMD/CP_EIA-7260-15_AVX-R_HandSolder","Capacitor_Tantalum_SMD/CP_EIA-7260-20_AVX-M","Capacitor_Tantalum_SMD/CP_EIA-7260-20_AVX-M_HandSolder","Capacitor_Tantalum_SMD/CP_EIA-7260-28_AVX-M","Capacitor_Tantalum_SMD/CP_EIA-7260-28_AVX-M_HandSolder","Capacitor_Tantalum_SMD/CP_EIA-7260-38_AVX-R","Capacitor_Tantalum_SMD/CP_EIA-7260-38_AVX-R_HandSolder","Capacitor_Tantalum_SMD/CP_EIA-7343-15_Kemet-W","Capacitor_Tantalum_SMD/CP_EIA-7343-15_Kemet-W_HandSolder","Capacitor_Tantalum_SMD/CP_EIA-7343-20_Kemet-V","Capacitor_Tantalum_SMD/CP_EIA-7343-20_Kemet-V_HandSolder","Capacitor_Tantalum_SMD/CP_EIA-7343-30_AVX-N","Capacitor_Tantalum_SMD/CP_EIA-7343-30_AVX-N_HandSolder","Capacitor_Tantalum_SMD/CP_EIA-7343-31_Kemet-D","Capacitor_Tantalum_SMD/CP_EIA-7343-31_Kemet-D_HandSolder","Capacitor_Tantalum_SMD/CP_EIA-7343-40_Kemet-Y","Capacitor_Tantalum_SMD/CP_EIA-7343-40_Kemet-Y_HandSolder","Capacitor_Tantalum_SMD/CP_EIA-7343-43_Kemet-X","Capacitor_Tantalum_SMD/CP_EIA-7343-43_Kemet-X_HandSolder","Capacitor_Tantalum_SMD/CP_EIA-7360-38_Kemet-E","Capacitor_Tantalum_SMD/CP_EIA-7360-38_Kemet-E_HandSolder","Capacitor_Tantalum_SMD/CP_EIA-7361-38_AVX-V","Capacitor_Tantalum_SMD/CP_EIA-7361-38_AVX-V_HandSolder","Capacitor_Tantalum_SMD/CP_EIA-7361-438_AVX-U","Capacitor_Tantalum_SMD/CP_EIA-7361-438_AVX-U_HandSolder","Connector/BJB_Pico_46.110.1001_Receptacle_Horizontal","Connector/Banana_Cliff_FCR7350B_S16N-PC_Horizontal","Connector/Banana_Cliff_FCR7350G_S16N-PC_Horizontal","Connector/Banana_Cliff_FCR7350L_S16N-PC_Horizontal","Connector/Banana_Cliff_FCR7350N_S16N-PC_Horizontal","Connector/Banana_Cliff_FCR7350R_S16N-PC_Horizontal","Connector/Banana_Cliff_FCR7350Y_S16N-PC_Horizontal","Connector/Banana_Jack_1Pin","Connector/Banana_Jack_2Pin","Connector/Banana_Jack_3Pin","Connector/CUI_PD-30","Connector/CUI_PD-30S","Connector/CUI_PD-30S_CircularHoles","Connector/CalTest_CT3151","Connector/Conn_C14_Receptacle_RightAngle_Schurter_DD21.01xx","Connector/Connector_SFP_and_Cage","Connector/DTF13-12Px","Connector/FanPinHeader_1x03_P2.54mm_Vertical","Connector/FanPinHeader_1x04_P2.54mm_Vertical","Connector/GB042-34S-H10","Connector/IHI_B6A-PCB-45_Vertical","Connector/JWT_A3963_1x02_P3.96mm_Vertical","Connector/Joint-Tech_C5080WR-04P_1x04_P5.08mm_Vertical","Connector/NS-Tech_Grove_1x04_P2mm_Vertical","Connector/OCN_OK-01GM030-04_2x15_P0.4mm_Vertical","Connector/SpringContact_Harwin_S1941-46R","Connector/Tag-Connect_TC2030-IDC-FP_2x03_P1.27mm_Vertical","Connector/Tag-Connect_TC2030-IDC-NL_2x03_P1.27mm_Vertical","Connector/Tag-Connect_TC2050-IDC-FP_2x05_P1.27mm_Vertical","Connector/Tag-Connect_TC2050-IDC-NL_2x05_P1.27mm_Vertical","Connector/Tag-Connect_TC2050-IDC-NL_2x05_P1.27mm_Vertical_with_bottom_clip","Connector/Tag-Connect_TC2070-IDC-FP_2x07_P1.27mm_Vertical","Connector_AMASS/AMASS_MR30PW-FB_1x03_P3.50mm_Horizontal","Connector_AMASS/AMASS_MR30PW-M_1x03_P3.50mm_Horizontal","Connector_AMASS/AMASS_XT30PW-F_1x02_P2.50mm_Horizontal","Connector_AMASS/AMASS_XT30PW-M_1x02_P2.50mm_Horizontal","Connector_AMASS/AMASS_XT30U-F_1x02_P5.0mm_Vertical","Connector_AMASS/AMASS_XT30U-M_1x02_P5.0mm_Vertical","Connector_AMASS/AMASS_XT30UPB-F_1x02_P5.0mm_Vertical","Connector_AMASS/AMASS_XT30UPB-M_1x02_P5.0mm_Vertical","Connector_AMASS/AMASS_XT60-F_1x02_P7.20mm_Vertical","Connector_AMASS/AMASS_XT60-M_1x02_P7.20mm_Vertical","Connector_AMASS/AMASS_XT60IPW-M_1x03_P7.20mm_Horizontal","Connector_AMASS/AMASS_XT60PW-F_1x02_P7.20mm_Horizontal","Connector_AMASS/AMASS_XT60PW-M_1x02_P7.20mm_Horizontal","Connector_AMASS/AMASS_XT90PW-M_1x02_P10.90mm_Horizontal","Connector_Amphenol/Amphenol_M8S-03PMMR-SF8001","Connector_Audio/Jack_3.5mm_CUI_SJ-3523-SMT_Horizontal","Connector_Audio/Jack_3.5mm_CUI_SJ-3524-SMT_Horizontal","Connector_Audio/Jack_3.5mm_CUI_SJ1-3513N_Horizontal","Connector_Audio/Jack_3.5mm_CUI_SJ1-3514N_Horizontal","Connector_Audio/Jack_3.5mm_CUI_SJ1-3515N_Horizontal","Connector_Audio/Jack_3.5mm_CUI_SJ1-3523N_Horizontal","Connector_Audio/Jack_3.5mm_CUI_SJ1-3524N_Horizontal","Connector_Audio/Jack_3.5mm_CUI_SJ1-3525N_Horizontal","Connector_Audio/Jack_3.5mm_CUI_SJ1-3533NG_Horizontal","Connector_Audio/Jack_3.5mm_CUI_SJ1-3533NG_Horizontal_CircularHoles","Connector_Audio/Jack_3.5mm_CUI_SJ1-3535NG_Horizontal","Connector_Audio/Jack_3.5mm_CUI_SJ1-3535NG_Horizontal_CircularHoles","Connector_Audio/Jack_3.5mm_CUI_SJ2-3593D-SMT_Horizontal","Connector_Audio/Jack_3.5mm_KoreanHropartsElec_PJ-320D-4A_Horizontal","Connector_Audio/Jack_3.5mm_Ledino_KB3SPRS_Horizontal","Connector_Audio/Jack_3.5mm_Lumberg_1503_02_Horizontal","Connector_Audio/Jack_3.5mm_Lumberg_1503_03_Horizontal","Connector_Audio/Jack_3.5mm_Lumberg_1503_07_Horizontal","Connector_Audio/Jack_3.5mm_PJ31060-I_Horizontal","Connector_Audio/Jack_3.5mm_PJ311_Horizontal","Connector_Audio/Jack_3.5mm_PJ320D_Horizontal","Connector_Audio/Jack_3.5mm_PJ320E_Horizontal","Connector_Audio/Jack_3.5mm_QingPu_WQP-PJ398SM_Vertical_CircularHoles","Connector_Audio/Jack_3.5mm_Switronic_ST-005-G_horizontal","Connector_Audio/Jack_3.5mm_Technik_TWP-3002_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NJ2FD-V_Vertical","Connector_Audio/Jack_6.35mm_Neutrik_NJ3FD-V_Vertical","Connector_Audio/Jack_6.35mm_Neutrik_NJ5FD-V_Vertical","Connector_Audio/Jack_6.35mm_Neutrik_NJ6FD-V_Vertical","Connector_Audio/Jack_6.35mm_Neutrik_NJ6TB-V_Vertical","Connector_Audio/Jack_6.35mm_Neutrik_NMJ4HCD2_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NMJ4HFD2_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NMJ4HFD3_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NMJ4HHD2_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NMJ6HCD2_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NMJ6HCD3_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NMJ6HFD2-AU_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NMJ6HFD2_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NMJ6HFD3_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NMJ6HFD4_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NMJ6HHD2_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NRJ3HF-1_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NRJ4HF-1_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NRJ4HF_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NRJ4HH-1_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NRJ4HH_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NRJ6HF-1-AU_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NRJ6HF-1_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NRJ6HF-AU_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NRJ6HF_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NRJ6HH-1_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NRJ6HH-AU_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NRJ6HH_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NRJ6HM-1-AU_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NRJ6HM-1-PRE_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NRJ6HM-1_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NSJ12HC_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NSJ12HF-1_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NSJ12HH-1_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NSJ12HL_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NSJ8HC_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NSJ8HL_Horizontal","Connector_Audio/Jack_XLR-6.35mm_Neutrik_NCJ10FI-H-0_Horizontal","Connector_Audio/Jack_XLR-6.35mm_Neutrik_NCJ10FI-H_Horizontal","Connector_Audio/Jack_XLR-6.35mm_Neutrik_NCJ10FI-V-0_Vertical","Connector_Audio/Jack_XLR-6.35mm_Neutrik_NCJ10FI-V_Vertical","Connector_Audio/Jack_XLR-6.35mm_Neutrik_NCJ5FI-H-0_Horizontal","Connector_Audio/Jack_XLR-6.35mm_Neutrik_NCJ5FI-H_Horizontal","Connector_Audio/Jack_XLR-6.35mm_Neutrik_NCJ5FI-V-0_Vertical","Connector_Audio/Jack_XLR-6.35mm_Neutrik_NCJ5FI-V_Vertical","Connector_Audio/Jack_XLR-6.35mm_Neutrik_NCJ6FA-H-0_Horizontal","Connector_Audio/Jack_XLR-6.35mm_Neutrik_NCJ6FA-H-DA_Horizontal","Connector_Audio/Jack_XLR-6.35mm_Neutrik_NCJ6FA-H_Horizontal","Connector_Audio/Jack_XLR-6.35mm_Neutrik_NCJ6FA-V-0_Vertical","Connector_Audio/Jack_XLR-6.35mm_Neutrik_NCJ6FA-V-DA_Vertical","Connector_Audio/Jack_XLR-6.35mm_Neutrik_NCJ6FA-V_Vertical","Connector_Audio/Jack_XLR-6.35mm_Neutrik_NCJ6FI-H-0_Horizontal","Connector_Audio/Jack_XLR-6.35mm_Neutrik_NCJ6FI-H_Horizontal","Connector_Audio/Jack_XLR-6.35mm_Neutrik_NCJ6FI-V-0_Vertical","Connector_Audio/Jack_XLR-6.35mm_Neutrik_NCJ6FI-V_Vertical","Connector_Audio/Jack_XLR-6.35mm_Neutrik_NCJ9FI-H-0_Horizontal","Connector_Audio/Jack_XLR-6.35mm_Neutrik_NCJ9FI-H_Horizontal","Connector_Audio/Jack_XLR-6.35mm_Neutrik_NCJ9FI-V-0_Vertical","Connector_Audio/Jack_XLR-6.35mm_Neutrik_NCJ9FI-V_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3FAAH-0_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FAAH1-0_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FAAH1-DA_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FAAH1_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FAAH2-0_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FAAH2_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FAAH_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FAAV-0_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3FAAV1-0_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3FAAV1-DA_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3FAAV1_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3FAAV2-0_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3FAAV2_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3FAAV_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3FAH-0_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FAH1-0_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FAH1-DA_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FAH1_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FAH2-0_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FAH2-DA_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FAH2_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FAHL-0_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FAHL1-0_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FAHL1_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FAHR-0_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FAHR1-0_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FAHR1_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FAHR2-0_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FAHR2_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FAH_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FAV-0_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3FAV1-0_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3FAV1-DA_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3FAV1_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3FAV2-0_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3FAV2-DA_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3FAV2_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3FAV_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3FBH1-B_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FBH1-DA_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FBH1-E_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FBH1_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FBH2-B_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FBH2-DA_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FBH2-E_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FBH2_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FBHL1_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FBV1-0_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3FBV1-B_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3FBV1-DA_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3FBV1_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3FBV2-B_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3FBV2-DA_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3FBV2-SW_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3FBV2_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3MAAH-0_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3MAAH-1_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3MAAH_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3MAAV-0_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3MAAV-1_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3MAAV_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3MAFH-PH_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3MAH-0_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3MAHL_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3MAHR_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3MAH_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3MAMH-PH_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3MAV-0_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3MAV_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3MBH-0_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3MBH-1_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3MBH-B_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3MBH-E_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3MBHL-B_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3MBHL_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3MBHR-B_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3MBHR_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3MBH_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3MBV-0_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3MBV-1_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3MBV-B_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3MBV-E_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3MBV-SW_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3MBV_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC4FAH-0_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC4FAH_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC4FAV-0_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC4FAV_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC4FBH_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC4FBV_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC4MAH_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC4MAV_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC4MBH_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC4MBV_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC5FAH-0_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC5FAH-DA_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC5FAH_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC5FAV-DA_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC5FAV-SW_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC5FAV_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC5FBH-B_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC5FBH_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC5FBV-B_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC5FBV-SW_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC5FBV_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC5MAH_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC5MAV-SW_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC5MAV_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC5MBH-B_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC5MBH_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC5MBV-B_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC5MBV-SW_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC5MBV_Vertical","Connector_Audio/Jack_speakON-6.35mm_Neutrik_NLJ2MDXX-H_Horizontal","Connector_Audio/Jack_speakON-6.35mm_Neutrik_NLJ2MDXX-V_Vertical","Connector_Audio/Jack_speakON_Neutrik_NL2MDXX-H-3_Horizontal","Connector_Audio/Jack_speakON_Neutrik_NL2MDXX-V_Vertical","Connector_Audio/Jack_speakON_Neutrik_NL4MDXX-H-2_Horizontal","Connector_Audio/Jack_speakON_Neutrik_NL4MDXX-H-3_Horizontal","Connector_Audio/Jack_speakON_Neutrik_NL4MDXX-V-2_Vertical","Connector_Audio/Jack_speakON_Neutrik_NL4MDXX-V-3_Vertical","Connector_Audio/Jack_speakON_Neutrik_NL4MDXX-V_Vertical","Connector_Audio/Jack_speakON_Neutrik_NL8MDXX-V-3_Vertical","Connector_Audio/Jack_speakON_Neutrik_NL8MDXX-V_Vertical","Connector_Audio/Jack_speakON_Neutrik_NLT4MD-V_Vertical","Connector_Audio/MiniXLR-5_Switchcraft_TRAPC_Horizontal","Connector_Audio/Plug_3.5mm_CUI_SP-3541","Connector_BarrelJack/BarrelJack_CLIFF_FC681465S_SMT_Horizontal","Connector_BarrelJack/BarrelJack_CUI_PJ-036AH-SMT_Horizontal","Connector_BarrelJack/BarrelJack_CUI_PJ-063AH_Horizontal","Connector_BarrelJack/BarrelJack_CUI_PJ-063AH_Horizontal_CircularHoles","Connector_BarrelJack/BarrelJack_CUI_PJ-079BH_Horizontal","Connector_BarrelJack/BarrelJack_CUI_PJ-102AH_Horizontal","Connector_BarrelJack/BarrelJack_GCT_DCJ200-10-A_Horizontal","Connector_BarrelJack/BarrelJack_Horizontal","Connector_BarrelJack/BarrelJack_Kycon_KLDX-0202-xC_Horizontal","Connector_BarrelJack/BarrelJack_SwitchcraftConxall_RAPC10U_Horizontal","Connector_BarrelJack/BarrelJack_Wuerth_694102107102_1.0x3.9mm","Connector_BarrelJack/BarrelJack_Wuerth_694103107102_1.35x3.9mm","Connector_BarrelJack/BarrelJack_Wuerth_694106106102_2.0x5.5mm","Connector_BarrelJack/BarrelJack_Wuerth_694108106102_2.5x5.5mm","Connector_BarrelJack/BarrelJack_Wuerth_6941xx301002","Connector_Card/CF-Card_3M_N7E50-A516xx-30","Connector_Card/CF-Card_3M_N7E50-E516xx-30","Connector_Card/SD-SIM_microSD-microSIM_Molex_104168-1620","Connector_Card/SD_Card_Device_16mm_SlotDepth","Connector_Card/SD_Hirose_DM1AA_SF_PEJ82","Connector_Card/SD_Kyocera_145638009211859+","Connector_Card/SD_Kyocera_145638009511859+","Connector_Card/SD_Kyocera_145638109211859+","Connector_Card/SD_Kyocera_145638109511859+","Connector_Card/SD_TE_2041021","Connector_Card/microSD_HC_Hirose_DM3AT-SF-PEJM5","Connector_Card/microSD_HC_Hirose_DM3BT-DSF-PEJS","Connector_Card/microSD_HC_Hirose_DM3D-SF","Connector_Card/microSD_HC_Molex_104031-0811","Connector_Card/microSD_HC_Molex_47219-2001","Connector_Card/microSD_HC_Wuerth_693072010801","Connector_Card/microSIM_JAE_SF53S006VCBR2000","Connector_Card/nanoSIM_GCT_SIM8060-6-0-14-00","Connector_Card/nanoSIM_GCT_SIM8060-6-1-14-00","Connector_Card/nanoSIM_Hinged_CUI_NSIM-2-C","Connector_Coaxial/BNC_Amphenol_031-5539_Vertical","Connector_Coaxial/BNC_Amphenol_031-6575_Horizontal","Connector_Coaxial/BNC_Amphenol_B6252HB-NPP3G-50_Horizontal","Connector_Coaxial/BNC_PanelMountable_Vertical","Connector_Coaxial/BNC_TEConnectivity_1478035_Horizontal","Connector_Coaxial/BNC_TEConnectivity_1478204_Vertical","Connector_Coaxial/BNC_Win_364A2x95_Horizontal","Connector_Coaxial/CoaxialSwitch_Hirose_MS-156C3_Horizontal","Connector_Coaxial/LEMO-EPG.00.302.NLN","Connector_Coaxial/LEMO-EPL.00.250.NTN","Connector_Coaxial/MMCX_Molex_73415-0961_Horizontal_0.8mm-PCB","Connector_Coaxial/MMCX_Molex_73415-0961_Horizontal_1.0mm-PCB","Connector_Coaxial/MMCX_Molex_73415-0961_Horizontal_1.6mm-PCB","Connector_Coaxial/MMCX_Molex_73415-1471_Vertical","Connector_Coaxial/SMA_Amphenol_132134-10_Vertical","Connector_Coaxial/SMA_Amphenol_132134-11_Vertical","Connector_Coaxial/SMA_Amphenol_132134-14_Vertical","Connector_Coaxial/SMA_Amphenol_132134-16_Vertical","Connector_Coaxial/SMA_Amphenol_132134_Vertical","Connector_Coaxial/SMA_Amphenol_132203-12_Horizontal","Connector_Coaxial/SMA_Amphenol_132289_EdgeMount","Connector_Coaxial/SMA_Amphenol_132291-12_Vertical","Connector_Coaxial/SMA_Amphenol_132291_Vertical","Connector_Coaxial/SMA_Amphenol_901-143_Horizontal","Connector_Coaxial/SMA_Amphenol_901-144_Vertical","Connector_Coaxial/SMA_BAT_Wireless_BWSMA-KWE-Z001","Connector_Coaxial/SMA_Molex_73251-1153_EdgeMount_Horizontal","Connector_Coaxial/SMA_Molex_73251-2120_EdgeMount_Horizontal","Connector_Coaxial/SMA_Molex_73251-2200_Horizontal","Connector_Coaxial/SMA_Samtec_SMA-J-P-H-ST-EM1_EdgeMount","Connector_Coaxial/SMA_Wurth_60312002114503_Vertical","Connector_Coaxial/SMA_Wurth_60312102114405_Vertical","Connector_Coaxial/SMB_Jack_Vertical","Connector_Coaxial/U.FL_Hirose_U.FL-R-SMT-1_Vertical","Connector_Coaxial/U.FL_Molex_MCRF_73412-0110_Vertical","Connector_Coaxial/WR-MMCX_Wuerth_66011102111302_Horizontal","Connector_Coaxial/WR-MMCX_Wuerth_66012102111404_Vertical","Connector_DIN/DIN41612_B2_2x16_Female_Vertical_THT","Connector_DIN/DIN41612_B2_2x16_Male_Horizontal_THT","Connector_DIN/DIN41612_B2_2x8_Female_Vertical_THT","Connector_DIN/DIN41612_B2_2x8_Male_Horizontal_THT","Connector_DIN/DIN41612_B3_2x10_Female_Vertical_THT","Connector_DIN/DIN41612_B3_2x10_Male_Horizontal_THT","Connector_DIN/DIN41612_B3_2x5_Female_Vertical_THT","Connector_DIN/DIN41612_B3_2x5_Male_Horizontal_THT","Connector_DIN/DIN41612_B_1x32_Female_Vertical_THT","Connector_DIN/DIN41612_B_1x32_Male_Horizontal_THT","Connector_DIN/DIN41612_B_2x16_Female_Vertical_THT","Connector_DIN/DIN41612_B_2x16_Male_Horizontal_THT","Connector_DIN/DIN41612_B_2x32_Female_Vertical_THT","Connector_DIN/DIN41612_B_2x32_Male_Horizontal_THT","Connector_DIN/DIN41612_C2_2x16_Female_Vertical_THT","Connector_DIN/DIN41612_C2_2x16_Male_Horizontal_THT","Connector_DIN/DIN41612_C2_3x16_Female_Vertical_THT","Connector_DIN/DIN41612_C2_3x16_Male_Horizontal_THT","Connector_DIN/DIN41612_C3_2x10_Female_Vertical_THT","Connector_DIN/DIN41612_C3_2x10_Male_Horizontal_THT","Connector_DIN/DIN41612_C3_3x10_Female_Vertical_THT","Connector_DIN/DIN41612_C3_3x10_Male_Horizontal_THT","Connector_DIN/DIN41612_C_1x32_Female_Vertical_THT","Connector_DIN/DIN41612_C_1x32_Male_Horizontal_THT","Connector_DIN/DIN41612_C_2x16_Female_Vertical_THT","Connector_DIN/DIN41612_C_2x16_Male_Horizontal_THT","Connector_DIN/DIN41612_C_2x32_Female_Vertical_THT","Connector_DIN/DIN41612_C_2x32_Male_Horizontal_THT","Connector_DIN/DIN41612_C_3x16_Female_Vertical_THT","Connector_DIN/DIN41612_C_3x16_Male_Horizontal_THT","Connector_DIN/DIN41612_C_3x32_Female_Vertical_THT","Connector_DIN/DIN41612_C_3x32_Male_Horizontal_THT","Connector_DIN/DIN41612_D_2x16_Female_Vertical_THT","Connector_DIN/DIN41612_D_2x16_Male_Horizontal_THT","Connector_DIN/DIN41612_D_2x8_Female_Vertical_THT","Connector_DIN/DIN41612_D_2x8_Male_Horizontal_THT","Connector_DIN/DIN41612_E_2x16_Female_Vertical_THT","Connector_DIN/DIN41612_E_2x16_Male_Horizontal_THT","Connector_DIN/DIN41612_E_2x16_RowsAC_Female_Vertical_THT","Connector_DIN/DIN41612_E_2x16_RowsAC_Male_Horizontal_THT","Connector_DIN/DIN41612_E_3x16_Female_Vertical_THT","Connector_DIN/DIN41612_E_3x16_Male_Horizontal_THT","Connector_DIN/DIN41612_F_2x16_Female_Vertical_THT","Connector_DIN/DIN41612_F_2x16_Male_Horizontal_THT","Connector_DIN/DIN41612_F_2x16_RowsZD_Female_Vertical_THT","Connector_DIN/DIN41612_F_2x16_RowsZD_Male_Horizontal_THT","Connector_DIN/DIN41612_F_3x16_Female_Vertical_THT","Connector_DIN/DIN41612_F_3x16_Male_Horizontal_THT","Connector_DIN/DIN41612_M-flat_3x14+6_Female_Vertical_THT","Connector_DIN/DIN41612_M-flat_3x20+4_Female_Vertical_THT","Connector_DIN/DIN41612_M-flat_3x26+2_Female_Vertical_THT","Connector_DIN/DIN41612_M-flat_3x8+8_Female_Vertical_THT","Connector_DIN/DIN41612_M-invers_3x14+6_Female_Horizontal_THT","Connector_DIN/DIN41612_M-invers_3x14+6_Male_Vertical_THT","Connector_DIN/DIN41612_M-invers_3x2+10_Female_Horizontal_THT","Connector_DIN/DIN41612_M-invers_3x2+10_Male_Vertical_THT","Connector_DIN/DIN41612_M-invers_3x20+4_Female_Horizontal_THT","Connector_DIN/DIN41612_M-invers_3x20+4_Male_Vertical_THT","Connector_DIN/DIN41612_M-invers_3x26+2_Female_Horizontal_THT","Connector_DIN/DIN41612_M-invers_3x26+2_Male_Vertical_THT","Connector_DIN/DIN41612_M-invers_3x8+8_Female_Horizontal_THT","Connector_DIN/DIN41612_M-invers_3x8+8_Male_Vertical_THT","Connector_DIN/DIN41612_M_3x14+6_Female_Vertical_THT","Connector_DIN/DIN41612_M_3x14+6_Male_Horizontal_THT","Connector_DIN/DIN41612_M_3x20+4_Female_Vertical_THT","Connector_DIN/DIN41612_M_3x20+4_Male_Horizontal_THT","Connector_DIN/DIN41612_M_3x26+2_Female_Vertical_THT","Connector_DIN/DIN41612_M_3x26+2_Male_Horizontal_THT","Connector_DIN/DIN41612_M_3x8+8_Female_Vertical_THT","Connector_DIN/DIN41612_M_3x8+8_Male_Horizontal_THT","Connector_DIN/DIN41612_Q2_2x16_Female_Horizontal_THT","Connector_DIN/DIN41612_Q2_2x16_Male_Vertical_THT","Connector_DIN/DIN41612_Q3_2x10_Female_Horizontal_THT","Connector_DIN/DIN41612_Q3_2x10_Male_Vertical_THT","Connector_DIN/DIN41612_Q_2x32_Female_Horizontal_THT","Connector_DIN/DIN41612_Q_2x32_Male_Vertical_THT","Connector_DIN/DIN41612_R2_2x16_Female_Horizontal_THT","Connector_DIN/DIN41612_R2_2x16_Male_Vertical_THT","Connector_DIN/DIN41612_R2_3x16_Female_Horizontal_THT","Connector_DIN/DIN41612_R2_3x16_Male_Vertical_THT","Connector_DIN/DIN41612_R3_2x10_Female_Horizontal_THT","Connector_DIN/DIN41612_R3_2x10_Male_Vertical_THT","Connector_DIN/DIN41612_R3_3x10_Female_Horizontal_THT","Connector_DIN/DIN41612_R3_3x10_Male_Vertical_THT","Connector_DIN/DIN41612_R_1x32_Female_Horizontal_THT","Connector_DIN/DIN41612_R_1x32_Male_Vertical_THT","Connector_DIN/DIN41612_R_2x16_Female_Horizontal_THT","Connector_DIN/DIN41612_R_2x16_Male_Vertical_THT","Connector_DIN/DIN41612_R_2x32_Female_Horizontal_THT","Connector_DIN/DIN41612_R_2x32_Male_Vertical_THT","Connector_DIN/DIN41612_R_3x16_Female_Horizontal_THT","Connector_DIN/DIN41612_R_3x16_Male_Vertical_THT","Connector_DIN/DIN41612_R_3x32_Female_Horizontal_THT","Connector_DIN/DIN41612_R_3x32_Male_Vertical_THT","Connector_Dsub/DSUB-15-HD_Pins_Horizontal_P2.29x1.90mm_EdgePinOffset3.03mm_Housed_MountingHolesOffset4.94mm","Connector_Dsub/DSUB-15-HD_Pins_Horizontal_P2.29x2.54mm_EdgePinOffset8.35mm_Housed_MountingHolesOffset10.89mm","Connector_Dsub/DSUB-15-HD_Pins_Vertical_P2.29x1.98mm_MountingHoles","Connector_Dsub/DSUB-15-HD_Socket_Horizontal_P2.29x1.90mm_EdgePinOffset3.03mm_Housed_MountingHolesOffset4.94mm","Connector_Dsub/DSUB-15-HD_Socket_Horizontal_P2.29x2.54mm_EdgePinOffset8.35mm_Housed_MountingHolesOffset10.89mm","Connector_Dsub/DSUB-15-HD_Socket_Vertical_P2.29x1.98mm_MountingHoles","Connector_Dsub/DSUB-15_Pins_EdgeMount_P2.77mm","Connector_Dsub/DSUB-15_Pins_Horizontal_P2.77x2.54mm_EdgePinOffset9.40mm","Connector_Dsub/DSUB-15_Pins_Horizontal_P2.77x2.84mm_EdgePinOffset14.56mm_Housed_MountingHolesOffset15.98mm","Connector_Dsub/DSUB-15_Pins_Horizontal_P2.77x2.84mm_EdgePinOffset14.56mm_Housed_MountingHolesOffset8.20mm","Connector_Dsub/DSUB-15_Pins_Horizontal_P2.77x2.84mm_EdgePinOffset4.94mm_Housed_MountingHolesOffset4.94mm","Connector_Dsub/DSUB-15_Pins_Horizontal_P2.77x2.84mm_EdgePinOffset7.70mm_Housed_MountingHolesOffset9.12mm","Connector_Dsub/DSUB-15_Pins_Horizontal_P2.77x2.84mm_EdgePinOffset9.40mm","Connector_Dsub/DSUB-15_Pins_Horizontal_P2.77x2.84mm_EdgePinOffset9.90mm_Housed_MountingHolesOffset11.32mm","Connector_Dsub/DSUB-15_Pins_Vertical_P2.77x2.84mm","Connector_Dsub/DSUB-15_Pins_Vertical_P2.77x2.84mm_MountingHoles","Connector_Dsub/DSUB-15_Socket_EdgeMount_P2.77mm","Connector_Dsub/DSUB-15_Socket_Horizontal_P2.77x2.54mm_EdgePinOffset9.40mm","Connector_Dsub/DSUB-15_Socket_Horizontal_P2.77x2.84mm_EdgePinOffset14.56mm_Housed_MountingHolesOffset15.98mm","Connector_Dsub/DSUB-15_Socket_Horizontal_P2.77x2.84mm_EdgePinOffset14.56mm_Housed_MountingHolesOffset8.20mm","Connector_Dsub/DSUB-15_Socket_Horizontal_P2.77x2.84mm_EdgePinOffset4.94mm_Housed_MountingHolesOffset4.94mm","Connector_Dsub/DSUB-15_Socket_Horizontal_P2.77x2.84mm_EdgePinOffset7.70mm_Housed_MountingHolesOffset9.12mm","Connector_Dsub/DSUB-15_Socket_Horizontal_P2.77x2.84mm_EdgePinOffset9.40mm","Connector_Dsub/DSUB-15_Socket_Horizontal_P2.77x2.84mm_EdgePinOffset9.90mm_Housed_MountingHolesOffset11.32mm","Connector_Dsub/DSUB-15_Socket_Vertical_P2.77x2.84mm","Connector_Dsub/DSUB-15_Socket_Vertical_P2.77x2.84mm_MountingHoles","Connector_Dsub/DSUB-25_Pins_EdgeMount_P2.77mm","Connector_Dsub/DSUB-25_Pins_Horizontal_P2.77x2.54mm_EdgePinOffset9.40mm","Connector_Dsub/DSUB-25_Pins_Horizontal_P2.77x2.84mm_EdgePinOffset14.56mm_Housed_MountingHolesOffset15.98mm","Connector_Dsub/DSUB-25_Pins_Horizontal_P2.77x2.84mm_EdgePinOffset14.56mm_Housed_MountingHolesOffset8.20mm","Connector_Dsub/DSUB-25_Pins_Horizontal_P2.77x2.84mm_EdgePinOffset4.94mm_Housed_MountingHolesOffset4.94mm","Connector_Dsub/DSUB-25_Pins_Horizontal_P2.77x2.84mm_EdgePinOffset7.70mm_Housed_MountingHolesOffset9.12mm","Connector_Dsub/DSUB-25_Pins_Horizontal_P2.77x2.84mm_EdgePinOffset9.40mm","Connector_Dsub/DSUB-25_Pins_Horizontal_P2.77x2.84mm_EdgePinOffset9.90mm_Housed_MountingHolesOffset11.32mm","Connector_Dsub/DSUB-25_Pins_Vertical_P2.77x2.84mm","Connector_Dsub/DSUB-25_Pins_Vertical_P2.77x2.84mm_MountingHoles","Connector_Dsub/DSUB-25_Socket_EdgeMount_P2.77mm","Connector_Dsub/DSUB-25_Socket_Horizontal_P2.77x2.54mm_EdgePinOffset9.40mm","Connector_Dsub/DSUB-25_Socket_Horizontal_P2.77x2.84mm_EdgePinOffset14.56mm_Housed_MountingHolesOffset15.98mm","Connector_Dsub/DSUB-25_Socket_Horizontal_P2.77x2.84mm_EdgePinOffset14.56mm_Housed_MountingHolesOffset8.20mm","Connector_Dsub/DSUB-25_Socket_Horizontal_P2.77x2.84mm_EdgePinOffset4.94mm_Housed_MountingHolesOffset4.94mm","Connector_Dsub/DSUB-25_Socket_Horizontal_P2.77x2.84mm_EdgePinOffset7.70mm_Housed_MountingHolesOffset9.12mm","Connector_Dsub/DSUB-25_Socket_Horizontal_P2.77x2.84mm_EdgePinOffset9.40mm","Connector_Dsub/DSUB-25_Socket_Horizontal_P2.77x2.84mm_EdgePinOffset9.90mm_Housed_MountingHolesOffset11.32mm","Connector_Dsub/DSUB-25_Socket_Vertical_P2.77x2.84mm","Connector_Dsub/DSUB-25_Socket_Vertical_P2.77x2.84mm_MountingHoles","Connector_Dsub/DSUB-26-HD_Pins_Horizontal_P2.29x1.90mm_EdgePinOffset3.03mm_Housed_MountingHolesOffset4.94mm","Connector_Dsub/DSUB-26-HD_Pins_Horizontal_P2.29x2.54mm_EdgePinOffset8.35mm_Housed_MountingHolesOffset10.89mm","Connector_Dsub/DSUB-26-HD_Pins_Vertical_P2.29x1.98mm_MountingHoles","Connector_Dsub/DSUB-26-HD_Socket_Horizontal_P2.29x1.90mm_EdgePinOffset3.03mm_Housed_MountingHolesOffset4.94mm","Connector_Dsub/DSUB-26-HD_Socket_Horizontal_P2.29x2.54mm_EdgePinOffset8.35mm_Housed_MountingHolesOffset10.89mm","Connector_Dsub/DSUB-26-HD_Socket_Vertical_P2.29x1.98mm_MountingHoles","Connector_Dsub/DSUB-37_Pins_EdgeMount_P2.77mm","Connector_Dsub/DSUB-37_Pins_Horizontal_P2.77x2.54mm_EdgePinOffset9.40mm","Connector_Dsub/DSUB-37_Pins_Horizontal_P2.77x2.84mm_EdgePinOffset14.56mm_Housed_MountingHolesOffset15.98mm","Connector_Dsub/DSUB-37_Pins_Horizontal_P2.77x2.84mm_EdgePinOffset14.56mm_Housed_MountingHolesOffset8.20mm","Connector_Dsub/DSUB-37_Pins_Horizontal_P2.77x2.84mm_EdgePinOffset4.94mm_Housed_MountingHolesOffset4.94mm","Connector_Dsub/DSUB-37_Pins_Horizontal_P2.77x2.84mm_EdgePinOffset7.70mm_Housed_MountingHolesOffset9.12mm","Connector_Dsub/DSUB-37_Pins_Horizontal_P2.77x2.84mm_EdgePinOffset9.40mm","Connector_Dsub/DSUB-37_Pins_Horizontal_P2.77x2.84mm_EdgePinOffset9.90mm_Housed_MountingHolesOffset11.32mm","Connector_Dsub/DSUB-37_Pins_Vertical_P2.77x2.84mm","Connector_Dsub/DSUB-37_Pins_Vertical_P2.77x2.84mm_MountingHoles","Connector_Dsub/DSUB-37_Socket_EdgeMount_P2.77mm","Connector_Dsub/DSUB-37_Socket_Horizontal_P2.77x2.54mm_EdgePinOffset9.40mm","Connector_Dsub/DSUB-37_Socket_Horizontal_P2.77x2.84mm_EdgePinOffset14.56mm_Housed_MountingHolesOffset15.98mm","Connector_Dsub/DSUB-37_Socket_Horizontal_P2.77x2.84mm_EdgePinOffset14.56mm_Housed_MountingHolesOffset8.20mm","Connector_Dsub/DSUB-37_Socket_Horizontal_P2.77x2.84mm_EdgePinOffset4.94mm_Housed_MountingHolesOffset4.94mm","Connector_Dsub/DSUB-37_Socket_Horizontal_P2.77x2.84mm_EdgePinOffset7.70mm_Housed_MountingHolesOffset9.12mm","Connector_Dsub/DSUB-37_Socket_Horizontal_P2.77x2.84mm_EdgePinOffset9.40mm","Connector_Dsub/DSUB-37_Socket_Horizontal_P2.77x2.84mm_EdgePinOffset9.90mm_Housed_MountingHolesOffset11.32mm","Connector_Dsub/DSUB-37_Socket_Vertical_P2.77x2.84mm","Connector_Dsub/DSUB-37_Socket_Vertical_P2.77x2.84mm_MountingHoles","Connector_Dsub/DSUB-44-HD_Pins_Horizontal_P2.29x1.90mm_EdgePinOffset3.03mm_Housed_MountingHolesOffset4.94mm","Connector_Dsub/DSUB-44-HD_Pins_Horizontal_P2.29x2.54mm_EdgePinOffset8.35mm_Housed_MountingHolesOffset10.89mm","Connector_Dsub/DSUB-44-HD_Pins_Vertical_P2.29x1.98mm_MountingHoles","Connector_Dsub/DSUB-44-HD_Socket_Horizontal_P2.29x1.90mm_EdgePinOffset3.03mm_Housed_MountingHolesOffset4.94mm","Connector_Dsub/DSUB-44-HD_Socket_Horizontal_P2.29x2.54mm_EdgePinOffset8.35mm_Housed_MountingHolesOffset10.89mm","Connector_Dsub/DSUB-44-HD_Socket_Vertical_P2.29x1.98mm_MountingHoles","Connector_Dsub/DSUB-62-HD_Pins_Horizontal_P2.41x1.90mm_EdgePinOffset3.03mm_Housed_MountingHolesOffset4.94mm","Connector_Dsub/DSUB-62-HD_Pins_Horizontal_P2.41x2.54mm_EdgePinOffset8.35mm_Housed_MountingHolesOffset10.89mm","Connector_Dsub/DSUB-62-HD_Pins_Vertical_P2.41x1.98mm_MountingHoles","Connector_Dsub/DSUB-62-HD_Socket_Horizontal_P2.41x1.90mm_EdgePinOffset3.03mm_Housed_MountingHolesOffset4.94mm","Connector_Dsub/DSUB-62-HD_Socket_Horizontal_P2.41x2.54mm_EdgePinOffset8.35mm_Housed_MountingHolesOffset10.89mm","Connector_Dsub/DSUB-62-HD_Socket_Vertical_P2.41x1.98mm_MountingHoles","Connector_Dsub/DSUB-9_Pins_EdgeMount_P2.77mm","Connector_Dsub/DSUB-9_Pins_Horizontal_P2.77x2.54mm_EdgePinOffset9.40mm","Connector_Dsub/DSUB-9_Pins_Horizontal_P2.77x2.84mm_EdgePinOffset14.56mm_Housed_MountingHolesOffset15.98mm","Connector_Dsub/DSUB-9_Pins_Horizontal_P2.77x2.84mm_EdgePinOffset14.56mm_Housed_MountingHolesOffset8.20mm","Connector_Dsub/DSUB-9_Pins_Horizontal_P2.77x2.84mm_EdgePinOffset4.94mm_Housed_MountingHolesOffset4.94mm","Connector_Dsub/DSUB-9_Pins_Horizontal_P2.77x2.84mm_EdgePinOffset7.70mm_Housed_MountingHolesOffset9.12mm","Connector_Dsub/DSUB-9_Pins_Horizontal_P2.77x2.84mm_EdgePinOffset9.40mm","Connector_Dsub/DSUB-9_Pins_Horizontal_P2.77x2.84mm_EdgePinOffset9.90mm_Housed_MountingHolesOffset11.32mm","Connector_Dsub/DSUB-9_Pins_Vertical_P2.77x2.84mm","Connector_Dsub/DSUB-9_Pins_Vertical_P2.77x2.84mm_MountingHoles","Connector_Dsub/DSUB-9_Socket_EdgeMount_P2.77mm","Connector_Dsub/DSUB-9_Socket_Horizontal_P2.77x2.54mm_EdgePinOffset9.40mm","Connector_Dsub/DSUB-9_Socket_Horizontal_P2.77x2.84mm_EdgePinOffset14.56mm_Housed_MountingHolesOffset15.98mm","Connector_Dsub/DSUB-9_Socket_Horizontal_P2.77x2.84mm_EdgePinOffset14.56mm_Housed_MountingHolesOffset8.20mm","Connector_Dsub/DSUB-9_Socket_Horizontal_P2.77x2.84mm_EdgePinOffset4.94mm_Housed_MountingHolesOffset4.94mm","Connector_Dsub/DSUB-9_Socket_Horizontal_P2.77x2.84mm_EdgePinOffset7.70mm_Housed_MountingHolesOffset9.12mm","Connector_Dsub/DSUB-9_Socket_Horizontal_P2.77x2.84mm_EdgePinOffset9.40mm","Connector_Dsub/DSUB-9_Socket_Horizontal_P2.77x2.84mm_EdgePinOffset9.90mm_Housed_MountingHolesOffset11.32mm","Connector_Dsub/DSUB-9_Socket_Vertical_P2.77x2.84mm","Connector_Dsub/DSUB-9_Socket_Vertical_P2.77x2.84mm_MountingHoles","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11004_1x04-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11005_1x05-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11006_1x06-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11007_1x07-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11008_1x08-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11009_1x09-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11010_1x10-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11011_1x11-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11012_1x12-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11013_1x13-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11014_1x14-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11015_1x15-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11016_1x16-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11017_1x17-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11018_1x18-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11019_1x19-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11020_1x20-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11021_1x21-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11022_1x22-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11023_1x23-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11024_1x24-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11025_1x25-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11026_1x26-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11027_1x27-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11028_1x28-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11029_1x29-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11030_1x30-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11031_1x31-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11032_1x32-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11033_1x33-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11034_1x34-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11035_1x35-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11036_1x36-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11037_1x37-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11038_1x38-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11039_1x39-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11040_1x40-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11041_1x41-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11042_1x42-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11043_1x43-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11044_1x44-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11045_1x45-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11046_1x46-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11047_1x47-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11048_1x48-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11049_1x49-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11050_1x50-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11051_1x51-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11052_1x52-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11053_1x53-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11054_1x54-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11055_1x55-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11056_1x56-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11057_1x57-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11058_1x58-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11059_1x59-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11060_1x60-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11004_1x04-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11005_1x05-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11006_1x06-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11007_1x07-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11008_1x08-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11009_1x09-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11010_1x10-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11011_1x11-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11012_1x12-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11013_1x13-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11014_1x14-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11015_1x15-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11016_1x16-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11017_1x17-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11018_1x18-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11019_1x19-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11020_1x20-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11021_1x21-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11022_1x22-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11023_1x23-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11024_1x24-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11025_1x25-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11026_1x26-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11027_1x27-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11028_1x28-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11029_1x29-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11030_1x30-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11031_1x31-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11032_1x32-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11033_1x33-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11034_1x34-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11035_1x35-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11036_1x36-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11037_1x37-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11038_1x38-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11039_1x39-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11040_1x40-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11041_1x41-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11042_1x42-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11043_1x43-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11044_1x44-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11045_1x45-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11046_1x46-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11047_1x47-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11048_1x48-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11049_1x49-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11050_1x50-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11051_1x51-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11052_1x52-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11053_1x53-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11054_1x54-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11055_1x55-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11056_1x56-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11057_1x57-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11058_1x58-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11059_1x59-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11060_1x60-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Hirose_FH12-10S-0.5SH_1x10-1MP_P0.50mm_Horizontal","Connector_FFC-FPC/Hirose_FH12-11S-0.5SH_1x11-1MP_P0.50mm_Horizontal","Connector_FFC-FPC/Hirose_FH12-12S-0.5SH_1x12-1MP_P0.50mm_Horizontal","Connector_FFC-FPC/Hirose_FH12-13S-0.5SH_1x13-1MP_P0.50mm_Horizontal","Connector_FFC-FPC/Hirose_FH12-14S-0.5SH_1x14-1MP_P0.50mm_Horizontal","Connector_FFC-FPC/Hirose_FH12-15S-0.5SH_1x15-1MP_P0.50mm_Horizontal","Connector_FFC-FPC/Hirose_FH12-16S-0.5SH_1x16-1MP_P0.50mm_Horizontal","Connector_FFC-FPC/Hirose_FH12-17S-0.5SH_1x17-1MP_P0.50mm_Horizontal","Connector_FFC-FPC/Hirose_FH12-18S-0.5SH_1x18-1MP_P0.50mm_Horizontal","Connector_FFC-FPC/Hirose_FH12-19S-0.5SH_1x19-1MP_P0.50mm_Horizontal","Connector_FFC-FPC/Hirose_FH12-20S-0.5SH_1x20-1MP_P0.50mm_Horizontal","Connector_FFC-FPC/Hirose_FH12-22S-0.5SH_1x22-1MP_P0.50mm_Horizontal","Connector_FFC-FPC/Hirose_FH12-24S-0.5SH_1x24-1MP_P0.50mm_Horizontal","Connector_FFC-FPC/Hirose_FH12-25S-0.5SH_1x25-1MP_P0.50mm_Horizontal","Connector_FFC-FPC/Hirose_FH12-26S-0.5SH_1x26-1MP_P0.50mm_Horizontal","Connector_FFC-FPC/Hirose_FH12-28S-0.5SH_1x28-1MP_P0.50mm_Horizontal","Connector_FFC-FPC/Hirose_FH12-30S-0.5SH_1x30-1MP_P0.50mm_Horizontal","Connector_FFC-FPC/Hirose_FH12-32S-0.5SH_1x32-1MP_P0.50mm_Horizontal","Connector_FFC-FPC/Hirose_FH12-33S-0.5SH_1x33-1MP_P0.50mm_Horizontal","Connector_FFC-FPC/Hirose_FH12-34S-0.5SH_1x34-1MP_P0.50mm_Horizontal","Connector_FFC-FPC/Hirose_FH12-35S-0.5SH_1x35-1MP_P0.50mm_Horizontal","Connector_FFC-FPC/Hirose_FH12-36S-0.5SH_1x36-1MP_P0.50mm_Horizontal","Connector_FFC-FPC/Hirose_FH12-40S-0.5SH_1x40-1MP_P0.50mm_Horizontal","Connector_FFC-FPC/Hirose_FH12-45S-0.5SH_1x45-1MP_P0.50mm_Horizontal","Connector_FFC-FPC/Hirose_FH12-50S-0.5SH_1x50-1MP_P0.50mm_Horizontal","Connector_FFC-FPC/Hirose_FH12-53S-0.5SH_1x53-1MP_P0.50mm_Horizontal","Connector_FFC-FPC/Hirose_FH12-6S-0.5SH_1x06-1MP_P0.50mm_Horizontal","Connector_FFC-FPC/Hirose_FH12-8S-0.5SH_1x08-1MP_P0.50mm_Horizontal","Connector_FFC-FPC/Hirose_FH26-13S-0.3SHW_2Rows-13Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Hirose_FH26-15S-0.3SHW_2Rows-15Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Hirose_FH26-17S-0.3SHW_2Rows-17Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Hirose_FH26-19S-0.3SHW_2Rows-19Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Hirose_FH26-21S-0.3SHW_2Rows-21Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Hirose_FH26-23S-0.3SHW_2Rows-23Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Hirose_FH26-25S-0.3SHW_2Rows-25Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Hirose_FH26-27S-0.3SHW_2Rows-27Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Hirose_FH26-29S-0.3SHW_2Rows-29Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Hirose_FH26-31S-0.3SHW_2Rows-31Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Hirose_FH26-33S-0.3SHW_2Rows-33Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Hirose_FH26-35S-0.3SHW_2Rows-35Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Hirose_FH26-37S-0.3SHW_2Rows-37Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Hirose_FH26-39S-0.3SHW_2Rows-39Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Hirose_FH26-41S-0.3SHW_2Rows-41Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Hirose_FH26-45S-0.3SHW_2Rows-45Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Hirose_FH26-51S-0.3SHW_2Rows-51Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Hirose_FH26-55S-0.3SHW_2Rows-55Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Hirose_FH26-57S-0.3SHW_2Rows-57Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Hirose_FH26-61S-0.3SHW_2Rows-61Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Hirose_FH26-71S-0.3SHW_2Rows-71Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Hirose_FH41-30S-0.5SH_1x30_1MP_1SH_P0.5mm_Horizontal","Connector_FFC-FPC/JAE_FF0825SA1_2Rows-25Pins_P0.40mm_Horizontal","Connector_FFC-FPC/JAE_FF0829SA1_2Rows-29Pins_P0.40mm_Horizontal","Connector_FFC-FPC/JAE_FF0841SA1_2Rows-41Pins_P0.40mm_Horizontal","Connector_FFC-FPC/JAE_FF0851SA1_2Rows-51Pins_P0.40mm_Horizontal","Connector_FFC-FPC/JAE_FF0871SA1_2Rows-71Pins_P0.40mm_Horizontal","Connector_FFC-FPC/JAE_FF0881SA1_2Rows-81Pins_P0.40mm_Horizontal","Connector_FFC-FPC/JUSHUO_AFA07-S04FCA-00_1x4-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/JUSHUO_AFA07-S05FCA-00_1x5-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/JUSHUO_AFA07-S06FCA-00_1x6-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/JUSHUO_AFA07-S07FCA-00_1x7-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/JUSHUO_AFA07-S08FCA-00_1x8-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/JUSHUO_AFA07-S09FCA-00_1x9-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/JUSHUO_AFA07-S10FCA-00_1x10-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/JUSHUO_AFA07-S11FCA-00_1x11-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/JUSHUO_AFA07-S12FCA-00_1x12-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/JUSHUO_AFA07-S13FCA-00_1x13-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/JUSHUO_AFA07-S14FCA-00_1x14-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/JUSHUO_AFA07-S15FCA-00_1x15-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/JUSHUO_AFA07-S16FCA-00_1x16-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/JUSHUO_AFA07-S17FCA-00_1x17-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/JUSHUO_AFA07-S18FCA-00_1x18-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/JUSHUO_AFA07-S19FCA-00_1x19-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/JUSHUO_AFA07-S20FCA-00_1x20-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/JUSHUO_AFA07-S21FCA-00_1x21-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/JUSHUO_AFA07-S22FCA-00_1x22-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/JUSHUO_AFA07-S23FCA-00_1x23-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/JUSHUO_AFA07-S24FCA-00_1x24-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/JUSHUO_AFA07-S25FCA-00_1x25-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/JUSHUO_AFA07-S26FCA-00_1x26-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/JUSHUO_AFA07-S27FCA-00_1x27-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/JUSHUO_AFA07-S28FCA-00_1x28-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/JUSHUO_AFA07-S29FCA-00_1x29-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/Jushuo_AFC07-S06FCA-00_1x6-1MP_P0.50_Horizontal","Connector_FFC-FPC/Jushuo_AFC07-S24FCA-00_1x24-1MP_P0.50_Horizontal","Connector_FFC-FPC/Molex_200528-0040_1x04-1MP_P1.00mm_Horizontal","Connector_FFC-FPC/Molex_200528-0050_1x05-1MP_P1.00mm_Horizontal","Connector_FFC-FPC/Molex_200528-0060_1x06-1MP_P1.00mm_Horizontal","Connector_FFC-FPC/Molex_200528-0070_1x07-1MP_P1.00mm_Horizontal","Connector_FFC-FPC/Molex_200528-0080_1x08-1MP_P1.00mm_Horizontal","Connector_FFC-FPC/Molex_200528-0090_1x09-1MP_P1.00mm_Horizontal","Connector_FFC-FPC/Molex_200528-0100_1x10-1MP_P1.00mm_Horizontal","Connector_FFC-FPC/Molex_200528-0110_1x11-1MP_P1.00mm_Horizontal","Connector_FFC-FPC/Molex_200528-0120_1x12-1MP_P1.00mm_Horizontal","Connector_FFC-FPC/Molex_200528-0130_1x13-1MP_P1.00mm_Horizontal","Connector_FFC-FPC/Molex_200528-0140_1x14-1MP_P1.00mm_Horizontal","Connector_FFC-FPC/Molex_200528-0150_1x15-1MP_P1.00mm_Horizontal","Connector_FFC-FPC/Molex_200528-0160_1x16-1MP_P1.00mm_Horizontal","Connector_FFC-FPC/Molex_200528-0170_1x17-1MP_P1.00mm_Horizontal","Connector_FFC-FPC/Molex_200528-0180_1x18-1MP_P1.00mm_Horizontal","Connector_FFC-FPC/Molex_200528-0190_1x19-1MP_P1.00mm_Horizontal","Connector_FFC-FPC/Molex_200528-0200_1x20-1MP_P1.00mm_Horizontal","Connector_FFC-FPC/Molex_200528-0210_1x21-1MP_P1.00mm_Horizontal","Connector_FFC-FPC/Molex_200528-0220_1x22-1MP_P1.00mm_Horizontal","Connector_FFC-FPC/Molex_200528-0230_1x23-1MP_P1.00mm_Horizontal","Connector_FFC-FPC/Molex_200528-0240_1x24-1MP_P1.00mm_Horizontal","Connector_FFC-FPC/Molex_200528-0250_1x25-1MP_P1.00mm_Horizontal","Connector_FFC-FPC/Molex_200528-0260_1x26-1MP_P1.00mm_Horizontal","Connector_FFC-FPC/Molex_200528-0270_1x27-1MP_P1.00mm_Horizontal","Connector_FFC-FPC/Molex_200528-0280_1x28-1MP_P1.00mm_Horizontal","Connector_FFC-FPC/Molex_200528-0290_1x29-1MP_P1.00mm_Horizontal","Connector_FFC-FPC/Molex_200528-0300_1x30-1MP_P1.00mm_Horizontal","Connector_FFC-FPC/Molex_502231-1500_1x15-1SH_P0.5mm_Vertical","Connector_FFC-FPC/Molex_502231-2400_1x24-1SH_P0.5mm_Vertical","Connector_FFC-FPC/Molex_502231-3300_1x33-1SH_P0.5mm_Vertical","Connector_FFC-FPC/Molex_502244-1530_1x15-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Molex_502244-2430_1x24-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Molex_502244-3330_1x33-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Molex_502250-1791_2Rows-17Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Molex_502250-2191_2Rows-21Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Molex_502250-2391_2Rows-23Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Molex_502250-2791_2Rows-27Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Molex_502250-3391_2Rows-33Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Molex_502250-3591_2Rows-35Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Molex_502250-3991_2Rows-39Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Molex_502250-4191_2Rows-41Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Molex_502250-5191_2Rows-51Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Molex_52559-3652_2x18-1MP_P0.5mm_Vertical","Connector_FFC-FPC/Molex_54132-5033_1x50-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Molex_54548-1071_1x10-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Omron_XF2M-4015-1A_1x40-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_0-1734839-5_1x05-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_0-1734839-6_1x06-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_0-1734839-7_1x07-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_0-1734839-8_1x08-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_0-1734839-9_1x09-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_1-1734839-0_1x10-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_1-1734839-1_1x11-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_1-1734839-2_1x12-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_1-1734839-3_1x13-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_1-1734839-4_1x14-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_1-1734839-5_1x15-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_1-1734839-6_1x16-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_1-1734839-7_1x17-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_1-1734839-8_1x18-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_1-1734839-9_1x19-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_1-84952-0_1x10-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_1-84952-1_1x11-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_1-84952-2_1x12-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_1-84952-3_1x13-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_1-84952-4_1x14-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_1-84952-5_1x15-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_1-84952-6_1x16-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_1-84952-7_1x17-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_1-84952-8_1x18-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_1-84952-9_1x19-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_1-84953-0_1x10-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_1-84953-1_1x11-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_1-84953-2_1x12-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_1-84953-3_1x13-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_1-84953-4_1x14-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_1-84953-5_1x15-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_1-84953-6_1x16-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_1-84953-7_1x17-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_1-84953-8_1x18-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_1-84953-9_1x19-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_1-84982-0_2Rows-10Pins-P1.0mm_Vertical","Connector_FFC-FPC/TE_1-84982-1_2Rows-11Pins-P1.0mm_Vertical","Connector_FFC-FPC/TE_1-84982-2_2Rows-12Pins-P1.0mm_Vertical","Connector_FFC-FPC/TE_1-84982-3_2Rows-13Pins-P1.0mm_Vertical","Connector_FFC-FPC/TE_1-84982-4_2Rows-14Pins-P1.0mm_Vertical","Connector_FFC-FPC/TE_1-84982-5_2Rows-15Pins-P1.0mm_Vertical","Connector_FFC-FPC/TE_1-84982-6_2Rows-16Pins-P1.0mm_Vertical","Connector_FFC-FPC/TE_1-84982-7_2Rows-17Pins-P1.0mm_Vertical","Connector_FFC-FPC/TE_1-84982-8_2Rows-18Pins-P1.0mm_Vertical","Connector_FFC-FPC/TE_1-84982-9_2Rows-19Pins-P1.0mm_Vertical","Connector_FFC-FPC/TE_2-1734839-0_1x20-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_2-1734839-1_1x21-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_2-1734839-2_1x22-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_2-1734839-3_1x23-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_2-1734839-4_1x24-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_2-1734839-5_1x25-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_2-1734839-6_1x26-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_2-1734839-7_1x27-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_2-1734839-8_1x28-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_2-1734839-9_1x29-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_2-84952-0_1x20-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_2-84952-1_1x21-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_2-84952-2_1x22-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_2-84952-3_1x23-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_2-84952-4_1x24-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_2-84952-5_1x25-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_2-84952-6_1x26-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_2-84952-7_1x27-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_2-84952-8_1x28-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_2-84952-9_1x29-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_2-84953-0_1x20-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_2-84953-1_1x21-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_2-84953-2_1x22-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_2-84953-3_1x23-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_2-84953-4_1x24-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_2-84953-5_1x25-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_2-84953-6_1x26-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_2-84953-7_1x27-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_2-84953-8_1x28-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_2-84953-9_1x29-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_2-84982-0_2Rows-20Pins-P1.0mm_Vertical","Connector_FFC-FPC/TE_2-84982-1_2Rows-21Pins-P1.0mm_Vertical","Connector_FFC-FPC/TE_2-84982-2_2Rows-22Pins-P1.0mm_Vertical","Connector_FFC-FPC/TE_2-84982-3_2Rows-23Pins-P1.0mm_Vertical","Connector_FFC-FPC/TE_2-84982-4_2Rows-24Pins-P1.0mm_Vertical","Connector_FFC-FPC/TE_2-84982-5_2Rows-25Pins-P1.0mm_Vertical","Connector_FFC-FPC/TE_2-84982-6_2Rows-26Pins-P1.0mm_Vertical","Connector_FFC-FPC/TE_2-84982-7_2Rows-27Pins-P1.0mm_Vertical","Connector_FFC-FPC/TE_2-84982-8_2Rows-28Pins-P1.0mm_Vertical","Connector_FFC-FPC/TE_2-84982-9_2Rows-29Pins-P1.0mm_Vertical","Connector_FFC-FPC/TE_3-1734839-0_1x30-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_3-1734839-1_1x31-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_3-1734839-2_1x32-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_3-1734839-3_1x33-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_3-1734839-4_1x34-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_3-1734839-5_1x35-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_3-1734839-6_1x36-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_3-1734839-7_1x37-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_3-1734839-8_1x38-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_3-1734839-9_1x39-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_3-84952-0_1x30-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_3-84953-0_1x30-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_3-84982-0_2Rows-30Pins-P1.0mm_Vertical","Connector_FFC-FPC/TE_4-1734839-0_1x40-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_4-1734839-1_1x41-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_4-1734839-2_1x42-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_4-1734839-3_1x43-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_4-1734839-4_1x44-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_4-1734839-5_1x45-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_4-1734839-6_1x46-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_4-1734839-7_1x47-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_4-1734839-8_1x48-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_4-1734839-9_1x49-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_5-1734839-0_1x50-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_84952-4_1x04-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_84952-5_1x05-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_84952-6_1x06-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_84952-7_1x07-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_84952-8_1x08-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_84952-9_1x09-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_84953-4_1x04-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_84953-5_1x05-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_84953-6_1x06-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_84953-7_1x07-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_84953-8_1x08-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_84953-9_1x09-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_84982-4_2Rows-04Pins-P1.0mm_Vertical","Connector_FFC-FPC/TE_84982-5_2Rows-05Pins-P1.0mm_Vertical","Connector_FFC-FPC/TE_84982-6_2Rows-06Pins-P1.0mm_Vertical","Connector_FFC-FPC/TE_84982-7_2Rows-07Pins-P1.0mm_Vertical","Connector_FFC-FPC/TE_84982-8_2Rows-08Pins-P1.0mm_Vertical","Connector_FFC-FPC/TE_84982-9_2Rows-09Pins-P1.0mm_Vertical","Connector_FFC-FPC/Wuerth_68611214422_1x12-1MP_P1.0mm_Horizontal","Connector_Harting/Harting_har-flexicon_14110213001xxx_1x02-MP_P2.54mm_Vertical","Connector_Harting/Harting_har-flexicon_14110213002xxx_1x02-MP_P2.54mm_Horizontal","Connector_Harting/Harting_har-flexicon_14110213010xxx_1x02-MP_P2.54mm_Horizontal","Connector_Harting/Harting_har-flexicon_14110313001xxx_1x03-MP_P2.54mm_Vertical","Connector_Harting/Harting_har-flexicon_14110313002xxx_1x03-MP_P2.54mm_Horizontal","Connector_Harting/Harting_har-flexicon_14110313010xxx_1x03-MP_P2.54mm_Horizontal","Connector_Harting/Harting_har-flexicon_14110413001xxx_1x04-MP_P2.54mm_Vertical","Connector_Harting/Harting_har-flexicon_14110413002xxx_1x04-MP_P2.54mm_Horizontal","Connector_Harting/Harting_har-flexicon_14110413010xxx_1x04-MP_P2.54mm_Horizontal","Connector_Harting/Harting_har-flexicon_14110513001xxx_1x05-MP_P2.54mm_Vertical","Connector_Harting/Harting_har-flexicon_14110513002xxx_1x05-MP_P2.54mm_Horizontal","Connector_Harting/Harting_har-flexicon_14110513010xxx_1x05-MP_P2.54mm_Horizontal","Connector_Harting/Harting_har-flexicon_14110613001xxx_1x06-MP_P2.54mm_Vertical","Connector_Harting/Harting_har-flexicon_14110613002xxx_1x06-MP_P2.54mm_Horizontal","Connector_Harting/Harting_har-flexicon_14110613010xxx_1x06-MP_P2.54mm_Horizontal","Connector_Harting/Harting_har-flexicon_14110713001xxx_1x07-MP_P2.54mm_Vertical","Connector_Harting/Harting_har-flexicon_14110713002xxx_1x07-MP_P2.54mm_Horizontal","Connector_Harting/Harting_har-flexicon_14110713010xxx_1x07-MP_P2.54mm_Horizontal","Connector_Harting/Harting_har-flexicon_14110813001xxx_1x08-MP_P2.54mm_Vertical","Connector_Harting/Harting_har-flexicon_14110813002xxx_1x08-MP_P2.54mm_Horizontal","Connector_Harting/Harting_har-flexicon_14110813010xxx_1x08-MP_P2.54mm_Horizontal","Connector_Harting/Harting_har-flexicon_14110913001xxx_1x09-MP_P2.54mm_Vertical","Connector_Harting/Harting_har-flexicon_14110913002xxx_1x09-MP_P2.54mm_Horizontal","Connector_Harting/Harting_har-flexicon_14110913010xxx_1x09-MP_P2.54mm_Horizontal","Connector_Harting/Harting_har-flexicon_14111013001xxx_1x10-MP_P2.54mm_Vertical","Connector_Harting/Harting_har-flexicon_14111013002xxx_1x10-MP_P2.54mm_Horizontal","Connector_Harting/Harting_har-flexicon_14111013010xxx_1x10-MP_P2.54mm_Horizontal","Connector_Harting/Harting_har-flexicon_14111113001xxx_1x11-MP_P2.54mm_Vertical","Connector_Harting/Harting_har-flexicon_14111113002xxx_1x11-MP_P2.54mm_Horizontal","Connector_Harting/Harting_har-flexicon_14111113010xxx_1x11-MP_P2.54mm_Horizontal","Connector_Harting/Harting_har-flexicon_14111213001xxx_1x12-MP_P2.54mm_Vertical","Connector_Harting/Harting_har-flexicon_14111213002xxx_1x12-MP_P2.54mm_Horizontal","Connector_Harting/Harting_har-flexicon_14111213010xxx_1x12-MP_P2.54mm_Horizontal","Connector_Harwin/Harwin_Gecko-G125-FVX0605L0X_2x03_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko-G125-FVX1005L0X_2x05_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko-G125-FVX1205L0X_2x06_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko-G125-FVX1605L0X_2x08_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko-G125-FVX2005L0X_2x10_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko-G125-FVX2605L0X_2x13_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko-G125-FVX3405L0X_2x17_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko-G125-FVX5005L0X_2x25_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko-G125-MVX0605L0X_2x03_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko-G125-MVX0605L1X_2x03_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko-G125-MVX1005L0X_2x05_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko-G125-MVX1005L1X_2x05_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko-G125-MVX1205L0X_2x06_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko-G125-MVX1205L1X_2x06_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko-G125-MVX1605L0X_2x08_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko-G125-MVX1605L1X_2x08_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko-G125-MVX2005L0X_2x10_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko-G125-MVX2005L1X_2x10_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko-G125-MVX2605L0X_2x13_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko-G125-MVX2605L1X_2x13_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko-G125-MVX3405L0X_2x17_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko-G125-MVX3405L1X_2x17_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko-G125-MVX5005L0X_2x25_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko-G125-MVX5005L1X_2x25_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko_G125-MS10605M2P_2x03_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko_G125-MS11005M2P_2x05_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko_G125-MS11205M2P_2x06_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko_G125-MS11605M2P_2x08_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko_G125-MS12005M2P_2x10_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko_G125-MS12605M2P_2x13_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko_G125-MS13405M2P_2x17_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko_G125-MS15005M2P_2x25_P1.25mm_Vertical","Connector_Harwin/Harwin_LTek-Male_02_P2.00mm_Vertical","Connector_Harwin/Harwin_LTek-Male_02_P2.00mm_Vertical_StrainRelief","Connector_Harwin/Harwin_LTek-Male_03_P2.00mm_Vertical","Connector_Harwin/Harwin_LTek-Male_03_P2.00mm_Vertical_StrainRelief","Connector_Harwin/Harwin_LTek-Male_04_P2.00mm_Vertical","Connector_Harwin/Harwin_LTek-Male_04_P2.00mm_Vertical_StrainRelief","Connector_Harwin/Harwin_LTek-Male_05_P2.00mm_Vertical","Connector_Harwin/Harwin_LTek-Male_05_P2.00mm_Vertical_StrainRelief","Connector_Harwin/Harwin_LTek-Male_06_P2.00mm_Vertical","Connector_Harwin/Harwin_LTek-Male_06_P2.00mm_Vertical_StrainRelief","Connector_Harwin/Harwin_LTek-Male_07_P2.00mm_Vertical","Connector_Harwin/Harwin_LTek-Male_07_P2.00mm_Vertical_StrainRelief","Connector_Harwin/Harwin_LTek-Male_17_P2.00mm_Vertical","Connector_Harwin/Harwin_LTek-Male_17_P2.00mm_Vertical_StrainRelief","Connector_Harwin/Harwin_LTek-Male_22_P2.00mm_Vertical","Connector_Harwin/Harwin_LTek-Male_22_P2.00mm_Vertical_StrainRelief","Connector_Harwin/Harwin_LTek-Male_2x02_P2.00mm_Vertical","Connector_Harwin/Harwin_LTek-Male_2x02_P2.00mm_Vertical_StrainRelief","Connector_Harwin/Harwin_LTek-Male_2x03_P2.00mm_Vertical","Connector_Harwin/Harwin_LTek-Male_2x03_P2.00mm_Vertical_StrainRelief","Connector_Harwin/Harwin_LTek-Male_2x04_P2.00mm_Vertical","Connector_Harwin/Harwin_LTek-Male_2x04_P2.00mm_Vertical_StrainRelief","Connector_Harwin/Harwin_LTek-Male_2x05_P2.00mm_Vertical","Connector_Harwin/Harwin_LTek-Male_2x05_P2.00mm_Vertical_StrainRelief","Connector_Harwin/Harwin_LTek-Male_2x06_P2.00mm_Vertical","Connector_Harwin/Harwin_LTek-Male_2x06_P2.00mm_Vertical_StrainRelief","Connector_Harwin/Harwin_LTek-Male_2x07_P2.00mm_Vertical","Connector_Harwin/Harwin_LTek-Male_2x07_P2.00mm_Vertical_StrainRelief","Connector_Harwin/Harwin_LTek-Male_2x08_P2.00mm_Vertical","Connector_Harwin/Harwin_LTek-Male_2x08_P2.00mm_Vertical_StrainRelief","Connector_Harwin/Harwin_LTek-Male_2x09_P2.00mm_Vertical","Connector_Harwin/Harwin_LTek-Male_2x09_P2.00mm_Vertical_StrainRelief","Connector_Harwin/Harwin_LTek-Male_2x10_P2.00mm_Vertical","Connector_Harwin/Harwin_LTek-Male_2x10_P2.00mm_Vertical_StrainRelief","Connector_Harwin/Harwin_LTek-Male_2x13_P2.00mm_Vertical","Connector_Harwin/Harwin_LTek-Male_2x13_P2.00mm_Vertical_StrainRelief","Connector_Harwin/Harwin_LTek-Male_2x17_P2.00mm_Vertical","Connector_Harwin/Harwin_LTek-Male_2x17_P2.00mm_Vertical_StrainRelief","Connector_Harwin/Harwin_LTek-Male_2x22_P2.00mm_Vertical","Connector_Harwin/Harwin_LTek-Male_2x22_P2.00mm_Vertical_StrainRelief","Connector_Harwin/Harwin_M20-7810245_2x02_P2.54mm_Vertical","Connector_Harwin/Harwin_M20-7810345_2x03_P2.54mm_Vertical","Connector_Harwin/Harwin_M20-7810445_2x04_P2.54mm_Vertical","Connector_Harwin/Harwin_M20-7810545_2x05_P2.54mm_Vertical","Connector_Harwin/Harwin_M20-7810645_2x06_P2.54mm_Vertical","Connector_Harwin/Harwin_M20-7810745_2x07_P2.54mm_Vertical","Connector_Harwin/Harwin_M20-7810845_2x08_P2.54mm_Vertical","Connector_Harwin/Harwin_M20-7810945_2x09_P2.54mm_Vertical","Connector_Harwin/Harwin_M20-7811045_2x10_P2.54mm_Vertical","Connector_Harwin/Harwin_M20-7811245_2x12_P2.54mm_Vertical","Connector_Harwin/Harwin_M20-7811545_2x15_P2.54mm_Vertical","Connector_Harwin/Harwin_M20-7812045_2x20_P2.54mm_Vertical","Connector_Harwin/Harwin_M20-89003xx_1x03_P2.54mm_Horizontal","Connector_Harwin/Harwin_M20-89004xx_1x04_P2.54mm_Horizontal","Connector_Harwin/Harwin_M20-89005xx_1x05_P2.54mm_Horizontal","Connector_Harwin/Harwin_M20-89006xx_1x06_P2.54mm_Horizontal","Connector_Harwin/Harwin_M20-89007xx_1x07_P2.54mm_Horizontal","Connector_Harwin/Harwin_M20-89008xx_1x08_P2.54mm_Horizontal","Connector_Harwin/Harwin_M20-89009xx_1x09_P2.54mm_Horizontal","Connector_Harwin/Harwin_M20-89010xx_1x10_P2.54mm_Horizontal","Connector_Harwin/Harwin_M20-89011xx_1x11_P2.54mm_Horizontal","Connector_Harwin/Harwin_M20-89012xx_1x12_P2.54mm_Horizontal","Connector_Harwin/Harwin_M20-89013xx_1x13_P2.54mm_Horizontal","Connector_Harwin/Harwin_M20-89014xx_1x14_P2.54mm_Horizontal","Connector_Harwin/Harwin_M20-89015xx_1x15_P2.54mm_Horizontal","Connector_Harwin/Harwin_M20-89016xx_1x16_P2.54mm_Horizontal","Connector_Harwin/Harwin_M20-89017xx_1x17_P2.54mm_Horizontal","Connector_Harwin/Harwin_M20-89018xx_1x18_P2.54mm_Horizontal","Connector_Harwin/Harwin_M20-89019xx_1x19_P2.54mm_Horizontal","Connector_Harwin/Harwin_M20-89020xx_1x20_P2.54mm_Horizontal","Connector_Hirose/Hirose_BM23FR0.6-16DP-0.35V_2x08_1MP_Vertical","Connector_Hirose/Hirose_BM23FR0.6-16DS-0.35V_2x08_P0.35_1MP_Vertical","Connector_Hirose/Hirose_BM24_BM24-40DP-2-0.35V_2x20_P0.35mm_PowerPin2_Vertical","Connector_Hirose/Hirose_BM24_BM24-40DS-2-0.35V_2x20_P0.35mm_PowerPin2_Vertical","Connector_Hirose/Hirose_DF11-10DP-2DSA_2x05_P2.00mm_Vertical","Connector_Hirose/Hirose_DF11-12DP-2DSA_2x06_P2.00mm_Vertical","Connector_Hirose/Hirose_DF11-14DP-2DSA_2x07_P2.00mm_Vertical","Connector_Hirose/Hirose_DF11-16DP-2DSA_2x08_P2.00mm_Vertical","Connector_Hirose/Hirose_DF11-18DP-2DSA_2x09_P2.00mm_Vertical","Connector_Hirose/Hirose_DF11-20DP-2DSA_2x10_P2.00mm_Vertical","Connector_Hirose/Hirose_DF11-22DP-2DSA_2x11_P2.00mm_Vertical","Connector_Hirose/Hirose_DF11-24DP-2DSA_2x12_P2.00mm_Vertical","Connector_Hirose/Hirose_DF11-26DP-2DSA_2x13_P2.00mm_Vertical","Connector_Hirose/Hirose_DF11-28DP-2DSA_2x14_P2.00mm_Vertical","Connector_Hirose/Hirose_DF11-30DP-2DSA_2x15_P2.00mm_Vertical","Connector_Hirose/Hirose_DF11-32DP-2DSA_2x16_P2.00mm_Vertical","Connector_Hirose/Hirose_DF11-4DP-2DSA_2x02_P2.00mm_Vertical","Connector_Hirose/Hirose_DF11-6DP-2DSA_2x03_P2.00mm_Vertical","Connector_Hirose/Hirose_DF11-8DP-2DSA_2x04_P2.00mm_Vertical","Connector_Hirose/Hirose_DF12_DF12C3.0-10DS-0.5V_2x05_P0.50mm_Vertical","Connector_Hirose/Hirose_DF12_DF12C3.0-14DS-0.5V_2x07_P0.50mm_Vertical","Connector_Hirose/Hirose_DF12_DF12C3.0-20DS-0.5V_2x10_P0.50mm_Vertical","Connector_Hirose/Hirose_DF12_DF12C3.0-30DS-0.5V_2x15_P0.50mm_Vertical","Connector_Hirose/Hirose_DF12_DF12C3.0-32DS-0.5V_2x16_P0.50mm_Vertical","Connector_Hirose/Hirose_DF12_DF12C3.0-36DS-0.5V_2x18_P0.50mm_Vertical","Connector_Hirose/Hirose_DF12_DF12C3.0-40DS-0.5V_2x20_P0.50mm_Vertical","Connector_Hirose/Hirose_DF12_DF12C3.0-50DS-0.5V_2x25_P0.50mm_Vertical","Connector_Hirose/Hirose_DF12_DF12C3.0-60DS-0.5V_2x30_P0.50mm_Vertical","Connector_Hirose/Hirose_DF12_DF12E3.0-10DP-0.5V_2x05_P0.50mm_Vertical","Connector_Hirose/Hirose_DF12_DF12E3.0-14DP-0.5V_2x07_P0.50mm_Vertical","Connector_Hirose/Hirose_DF12_DF12E3.0-20DP-0.5V_2x10_P0.50mm_Vertical","Connector_Hirose/Hirose_DF12_DF12E3.0-30DP-0.5V_2x15_P0.50mm_Vertical","Connector_Hirose/Hirose_DF12_DF12E3.0-32DP-0.5V_2x16_P0.50mm_Vertical","Connector_Hirose/Hirose_DF12_DF12E3.0-36DP-0.5V_2x18_P0.50mm_Vertical","Connector_Hirose/Hirose_DF12_DF12E3.0-40DP-0.5V_2x20_P0.50mm_Vertical","Connector_Hirose/Hirose_DF12_DF12E3.0-50DP-0.5V_2x25_P0.50mm_Vertical","Connector_Hirose/Hirose_DF12_DF12E3.0-60DP-0.5V_2x30_P0.50mm_Vertical","Connector_Hirose/Hirose_DF12_DF12E3.0-80DP-0.5V_2x40_P0.50mm_Vertical","Connector_Hirose/Hirose_DF13-02P-1.25DSA_1x02_P1.25mm_Vertical","Connector_Hirose/Hirose_DF13-02P-1.25DS_1x02_P1.25mm_Horizontal","Connector_Hirose/Hirose_DF13-03P-1.25DSA_1x03_P1.25mm_Vertical","Connector_Hirose/Hirose_DF13-03P-1.25DS_1x03_P1.25mm_Horizontal","Connector_Hirose/Hirose_DF13-04P-1.25DSA_1x04_P1.25mm_Vertical","Connector_Hirose/Hirose_DF13-04P-1.25DS_1x04_P1.25mm_Horizontal","Connector_Hirose/Hirose_DF13-05P-1.25DSA_1x05_P1.25mm_Vertical","Connector_Hirose/Hirose_DF13-05P-1.25DS_1x05_P1.25mm_Horizontal","Connector_Hirose/Hirose_DF13-06P-1.25DSA_1x06_P1.25mm_Vertical","Connector_Hirose/Hirose_DF13-06P-1.25DS_1x06_P1.25mm_Horizontal","Connector_Hirose/Hirose_DF13-07P-1.25DSA_1x07_P1.25mm_Vertical","Connector_Hirose/Hirose_DF13-07P-1.25DS_1x07_P1.25mm_Horizontal","Connector_Hirose/Hirose_DF13-08P-1.25DSA_1x08_P1.25mm_Vertical","Connector_Hirose/Hirose_DF13-08P-1.25DS_1x08_P1.25mm_Horizontal","Connector_Hirose/Hirose_DF13-09P-1.25DSA_1x09_P1.25mm_Vertical","Connector_Hirose/Hirose_DF13-09P-1.25DS_1x09_P1.25mm_Horizontal","Connector_Hirose/Hirose_DF13-10P-1.25DSA_1x10_P1.25mm_Vertical","Connector_Hirose/Hirose_DF13-10P-1.25DS_1x10_P1.25mm_Horizontal","Connector_Hirose/Hirose_DF13-11P-1.25DSA_1x11_P1.25mm_Vertical","Connector_Hirose/Hirose_DF13-11P-1.25DS_1x11_P1.25mm_Horizontal","Connector_Hirose/Hirose_DF13-12P-1.25DSA_1x12_P1.25mm_Vertical","Connector_Hirose/Hirose_DF13-12P-1.25DS_1x12_P1.25mm_Horizontal","Connector_Hirose/Hirose_DF13-13P-1.25DSA_1x13_P1.25mm_Vertical","Connector_Hirose/Hirose_DF13-14P-1.25DSA_1x14_P1.25mm_Vertical","Connector_Hirose/Hirose_DF13-14P-1.25DS_1x14_P1.25mm_Horizontal","Connector_Hirose/Hirose_DF13-15P-1.25DSA_1x15_P1.25mm_Vertical","Connector_Hirose/Hirose_DF13-15P-1.25DS_1x15_P1.25mm_Horizontal","Connector_Hirose/Hirose_DF13C_CL535-0402-2-51_1x02-1MP_P1.25mm_Vertical","Connector_Hirose/Hirose_DF13C_CL535-0403-5-51_1x03-1MP_P1.25mm_Vertical","Connector_Hirose/Hirose_DF13C_CL535-0404-8-51_1x04-1MP_P1.25mm_Vertical","Connector_Hirose/Hirose_DF13C_CL535-0405-0-51_1x05-1MP_P1.25mm_Vertical","Connector_Hirose/Hirose_DF13C_CL535-0406-3-51_1x06-1MP_P1.25mm_Vertical","Connector_Hirose/Hirose_DF13C_CL535-0407-6-51_1x07-1MP_P1.25mm_Vertical","Connector_Hirose/Hirose_DF13C_CL535-0408-9-51_1x08-1MP_P1.25mm_Vertical","Connector_Hirose/Hirose_DF13C_CL535-0409-1-51_1x09-1MP_P1.25mm_Vertical","Connector_Hirose/Hirose_DF13C_CL535-0410-4-51_1x10-1MP_P1.25mm_Vertical","Connector_Hirose/Hirose_DF13C_CL535-0411-3-51_1x11-1MP_P1.25mm_Vertical","Connector_Hirose/Hirose_DF13C_CL535-0412-6-51_1x12-1MP_P1.25mm_Vertical","Connector_Hirose/Hirose_DF13C_CL535-0414-1-51_1x14-1MP_P1.25mm_Vertical","Connector_Hirose/Hirose_DF13C_CL535-0415-4-51_1x15-1MP_P1.25mm_Vertical","Connector_Hirose/Hirose_DF3EA-02P-2H_1x02-1MP_P2.00mm_Horizontal","Connector_Hirose/Hirose_DF3EA-02P-2V_1x02-1MP_P2.00mm_Vertical","Connector_Hirose/Hirose_DF3EA-03P-2H_1x03-1MP_P2.00mm_Horizontal","Connector_Hirose/Hirose_DF3EA-03P-2V_1x03-1MP_P2.00mm_Vertical","Connector_Hirose/Hirose_DF3EA-04P-2H_1x04-1MP_P2.00mm_Horizontal","Connector_Hirose/Hirose_DF3EA-04P-2V_1x04-1MP_P2.00mm_Vertical","Connector_Hirose/Hirose_DF3EA-05P-2H_1x05-1MP_P2.00mm_Horizontal","Connector_Hirose/Hirose_DF3EA-05P-2V_1x05-1MP_P2.00mm_Vertical","Connector_Hirose/Hirose_DF3EA-06P-2H_1x06-1MP_P2.00mm_Horizontal","Connector_Hirose/Hirose_DF3EA-06P-2V_1x06-1MP_P2.00mm_Vertical","Connector_Hirose/Hirose_DF3EA-07P-2H_1x07-1MP_P2.00mm_Horizontal","Connector_Hirose/Hirose_DF3EA-07P-2V_1x07-1MP_P2.00mm_Vertical","Connector_Hirose/Hirose_DF3EA-08P-2H_1x08-1MP_P2.00mm_Horizontal","Connector_Hirose/Hirose_DF3EA-08P-2V_1x08-1MP_P2.00mm_Vertical","Connector_Hirose/Hirose_DF3EA-09P-2H_1x09-1MP_P2.00mm_Horizontal","Connector_Hirose/Hirose_DF3EA-09P-2V_1x09-1MP_P2.00mm_Vertical","Connector_Hirose/Hirose_DF3EA-10P-2H_1x10-1MP_P2.00mm_Horizontal","Connector_Hirose/Hirose_DF3EA-10P-2V_1x10-1MP_P2.00mm_Vertical","Connector_Hirose/Hirose_DF3EA-11P-2H_1x11-1MP_P2.00mm_Horizontal","Connector_Hirose/Hirose_DF3EA-11P-2V_1x11-1MP_P2.00mm_Vertical","Connector_Hirose/Hirose_DF3EA-12P-2H_1x12-1MP_P2.00mm_Horizontal","Connector_Hirose/Hirose_DF3EA-12P-2V_1x12-1MP_P2.00mm_Vertical","Connector_Hirose/Hirose_DF3EA-13P-2H_1x13-1MP_P2.00mm_Horizontal","Connector_Hirose/Hirose_DF3EA-13P-2V_1x13-1MP_P2.00mm_Vertical","Connector_Hirose/Hirose_DF3EA-14P-2H_1x14-1MP_P2.00mm_Horizontal","Connector_Hirose/Hirose_DF3EA-14P-2V_1x14-1MP_P2.00mm_Vertical","Connector_Hirose/Hirose_DF3EA-15P-2H_1x15-1MP_P2.00mm_Horizontal","Connector_Hirose/Hirose_DF3EA-15P-2V_1x15-1MP_P2.00mm_Vertical","Connector_Hirose/Hirose_DF52-10S-0.8H_1x10-1MP_P0.80mm_Horizontal","Connector_Hirose/Hirose_DF52-11S-0.8H_1x11-1MP_P0.80mm_Horizontal","Connector_Hirose/Hirose_DF52-12S-0.8H_1x12-1MP_P0.80mm_Horizontal","Connector_Hirose/Hirose_DF52-14S-0.8H_1x14-1MP_P0.80mm_Horizontal","Connector_Hirose/Hirose_DF52-15S-0.8H_1x15-1MP_P0.80mm_Horizontal","Connector_Hirose/Hirose_DF52-2S-0.8H_1x02-1MP_P0.80mm_Horizontal","Connector_Hirose/Hirose_DF52-3S-0.8H_1x03-1MP_P0.80mm_Horizontal","Connector_Hirose/Hirose_DF52-4S-0.8H_1x04-1MP_P0.80mm_Horizontal","Connector_Hirose/Hirose_DF52-5S-0.8H_1x05-1MP_P0.80mm_Horizontal","Connector_Hirose/Hirose_DF52-6S-0.8H_1x06-1MP_P0.80mm_Horizontal","Connector_Hirose/Hirose_DF52-7S-0.8H_1x07-1MP_P0.80mm_Horizontal","Connector_Hirose/Hirose_DF52-8S-0.8H_1x08-1MP_P0.80mm_Horizontal","Connector_Hirose/Hirose_DF52-9S-0.8H_1x09-1MP_P0.80mm_Horizontal","Connector_Hirose/Hirose_DF57H-2P-1.2V_1x02_P1.2mm_Socket","Connector_Hirose/Hirose_DF57H-2P-2.4V_1x02_P2.4mm_Socket","Connector_Hirose/Hirose_DF57H-3P-1.2V_1x03_P1.2mm_Socket","Connector_Hirose/Hirose_DF57H-4P-1.2V_1x04_P1.2mm_Socket","Connector_Hirose/Hirose_DF57H-5P-1.2V_1x05_P1.2mm_Socket","Connector_Hirose/Hirose_DF57H-6P-1.2V_1x06_P1.2mm_Socket","Connector_Hirose/Hirose_DF63-5P-3.96DSA_1x05_P3.96mm_Vertical","Connector_Hirose/Hirose_DF63-6P-3.96DSA_1x06_P3.96mm_Vertical","Connector_Hirose/Hirose_DF63M-1P-3.96DSA_1x01_P3.96mm_Vertical","Connector_Hirose/Hirose_DF63M-2P-3.96DSA_1x02_P3.96mm_Vertical","Connector_Hirose/Hirose_DF63M-3P-3.96DSA_1x03_P3.96mm_Vertical","Connector_Hirose/Hirose_DF63M-4P-3.96DSA_1x04_P3.96mm_Vertical","Connector_Hirose/Hirose_DF63R-1P-3.96DSA_1x01_P3.96mm_Vertical","Connector_Hirose/Hirose_DF63R-2P-3.96DSA_1x02_P3.96mm_Vertical","Connector_Hirose/Hirose_DF63R-3P-3.96DSA_1x03_P3.96mm_Vertical","Connector_Hirose/Hirose_DF63R-4P-3.96DSA_1x04_P3.96mm_Vertical","Connector_Hirose/Hirose_DF63R-5P-3.96DSA_1x05_P3.96mm_Vertical","Connector_Hirose/Hirose_FX10A-120P-SV_2x60-1MP_P0.5mm","Connector_Hirose/Hirose_FX10A-120S-SV_2x60-1MP_P0.5mm","Connector_Hirose/Hirose_FX10A-144P-SV_2x72-1MP_P0.5mm","Connector_Hirose/Hirose_FX10A-144S-SV_2x72-1MP_P0.5mm","Connector_Hirose/Hirose_FX10A-168P-SV_2x84-1MP_P0.5mm","Connector_Hirose/Hirose_FX10A-168S-SV_2x84-1MP_P0.5mm","Connector_Hirose/Hirose_FX10A-96P-SV_2x48-1MP_P0.5mm","Connector_Hirose/Hirose_FX10A-96S-SV_2x48-1MP_P0.5mm","Connector_Hirose/Hirose_FX10B-120P-SV_2x60-1MP_P0.5mm","Connector_Hirose/Hirose_FX10B-120S-SV_2x60-1MP_P0.5mm","Connector_Hirose/Hirose_FX10B-144P-SV_2x72-1MP_P0.5mm","Connector_Hirose/Hirose_FX10B-144S-SV_2x72-1MP_P0.5mm","Connector_Hirose/Hirose_FX10B-168P-SV_2x84-1MP_P0.5mm","Connector_Hirose/Hirose_FX10B-168S-SV_2x84-1MP_P0.5mm","Connector_Hirose/Hirose_FX10B-96P-SV_2x48-1MP_P0.5mm","Connector_Hirose/Hirose_FX10B-96S-SV_2x48-1MP_P0.5mm","Connector_Hirose_DF40/Hirose_DF40B(2.0)-12DS-0.4V_2x06-1MP_P0.4mm","Connector_Hirose_DF40/Hirose_DF40B(2.0)-80DS-0.4V_2x40-1MP_P0.4mm","Connector_Hirose_DF40/Hirose_DF40B-10DS-0.4V_2x05-1MP_P0.4mm","Connector_Hirose_DF40/Hirose_DF40B-12DS-0.4V_2x06-1MP_P0.4mm","Connector_Hirose_DF40/Hirose_DF40B-30DS-0.4V_2x15-1MP_P0.4mm","Connector_Hirose_DF40/Hirose_DF40B-50DS-0.4V_2x25-1MP_P0.4mm","Connector_Hirose_DF40/Hirose_DF40B-60DS-0.4V_2x30-1MP_P0.4mm","Connector_Hirose_DF40/Hirose_DF40B-80DS-0.4V_2x40-1MP_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C(2.0)-20DS-0.4V_2x10_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C(2.0)-24DS-0.4V_2x12_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C(2.0)-30DS-0.4V_2x15_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C(2.0)-40DS-0.4V_2x20_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C(2.0)-50DS-0.4V_2x25_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C(2.0)-60DS-0.4V_2x30_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C(2.0)-70DS-0.4V_2x35_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C(2.0)-80DS-0.4V_2x40_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C-100DP-0.4V_2x50-1MP_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C-100DS-0.4V_2x50_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C-10DP-0.4V_2x05-1MP_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C-120DP-0.4V_2x60-1MP_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C-120DS-0.4V_2x60_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C-12DP-0.4V_2x06-1MP_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C-20DP-0.4V_2x10-1MP_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C-20DS-0.4V_2x10_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C-24DP-0.4V_2x12-1MP_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C-24DS-0.4V_2x12_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C-30DP-0.4V_2x15-1MP_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C-30DS-0.4V_2x15_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C-34DP-0.4V_2x17-1MP_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C-34DS-0.4V_2x17_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C-40DP-0.4V_2x20-1MP_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C-40DS-0.4V_2x20_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C-44DP-0.4V_2x22-1MP_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C-50DP-0.4V_2x25-1MP_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C-50DS-0.4V_2x25_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C-60DP-0.4V_2x30-1MP_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C-60DS-0.4V_2x30_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C-70DP-0.4V_2x35-1MP_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C-70DS-0.4V_2x35_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C-80DP-0.4V_2x40-1MP_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C-80DS-0.4V_2x40_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C-90DP-0.4V_2x45-1MP_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C-90DS-0.4V_2x45_P0.4mm","Connector_Hirose_DF40/Hirose_DF40HB(2.5)-10DS-0.4V_2x05-1MP_P0.4mm","Connector_Hirose_DF40/Hirose_DF40HB(4.0)-50DS-0.4V_2x25-1MP_P0.4mm","Connector_Hirose_DF40/Hirose_DF40HC(2.5)-20DS-0.4V_2x10_P0.4mm","Connector_Hirose_DF40/Hirose_DF40HC(2.5)-30DS-0.4V_2x15_P0.4mm","Connector_Hirose_DF40/Hirose_DF40HC(2.5)-40DS-0.4V_2x20_P0.4mm","Connector_Hirose_DF40/Hirose_DF40HC(2.5)-50DS-0.4V_2x25_P0.4mm","Connector_Hirose_DF40/Hirose_DF40HC(2.5)-60DS-0.4V_2x30_P0.4mm","Connector_Hirose_DF40/Hirose_DF40HC(3.0)-100DS-0.4V_2x50_P0.4mm","Connector_Hirose_DF40/Hirose_DF40HC(3.0)-30DS-0.4V_2x15_P0.4mm","Connector_Hirose_DF40/Hirose_DF40HC(3.0)-40DS-0.4V_2x20_P0.4mm","Connector_Hirose_DF40/Hirose_DF40HC(3.0)-44DS-0.4V_2x22_P0.4mm","Connector_Hirose_DF40/Hirose_DF40HC(3.0)-50DS-0.4V_2x25_P0.4mm","Connector_Hirose_DF40/Hirose_DF40HC(3.0)-60DS-0.4V_2x30_P0.4mm","Connector_Hirose_DF40/Hirose_DF40HC(3.0)-70DS-0.4V_2x35_P0.4mm","Connector_Hirose_DF40/Hirose_DF40HC(3.0)-80DS-0.4V_2x40_P0.4mm","Connector_Hirose_DF40/Hirose_DF40HC(3.0)-90DS-0.4V_2x45_P0.4mm","Connector_Hirose_DF40/Hirose_DF40HC(3.5)-20DS-0.4V_2x10_P0.4mm","Connector_Hirose_DF40/Hirose_DF40HC(3.5)-30DS-0.4V_2x15_P0.4mm","Connector_Hirose_DF40/Hirose_DF40HC(3.5)-40DS-0.4V_2x20_P0.4mm","Connector_Hirose_DF40/Hirose_DF40HC(3.5)-50DS-0.4V_2x25_P0.4mm","Connector_Hirose_DF40/Hirose_DF40HC(3.5)-60DS-0.4V_2x30_P0.4mm","Connector_Hirose_DF40/Hirose_DF40HC(3.5)-80DS-0.4V_2x40_P0.4mm","Connector_Hirose_DF40/Hirose_DF40HC(4.0)-40DS-0.4V_2x20_P0.4mm","Connector_Hirose_DF40/Hirose_DF40HC(4.0)-50DS-0.4V_2x25_P0.4mm","Connector_Hirose_DF40/Hirose_DF40HC(4.0)-60DS-0.4V_2x30_P0.4mm","Connector_Hirose_DF40/Hirose_DF40HC(4.0)-80DS-0.4V_2x40_P0.4mm","Connector_Hirose_DF40/Hirose_DF40HC(4.0)-90DS-0.4V_2x45_P0.4mm","Connector_Hirose_FX8/Hirose_FX8-100P-SV_2x50_P0.6mm","Connector_Hirose_FX8/Hirose_FX8-100S-SV_2x50_P0.6mm","Connector_Hirose_FX8/Hirose_FX8-120P-SV_2x60_P0.6mm","Connector_Hirose_FX8/Hirose_FX8-120S-SV_2x60_P0.6mm","Connector_Hirose_FX8/Hirose_FX8-140P-SV_2x70_P0.6mm","Connector_Hirose_FX8/Hirose_FX8-140S-SV_2x70_P0.6mm","Connector_Hirose_FX8/Hirose_FX8-60P-SV_2x30_P0.6mm","Connector_Hirose_FX8/Hirose_FX8-60S-SV_2x30_P0.6mm","Connector_Hirose_FX8/Hirose_FX8-80P-SV_2x40_P0.6mm","Connector_Hirose_FX8/Hirose_FX8-80S-SV_2x40_P0.6mm","Connector_Hirose_FX8/Hirose_FX8-90P-SV_2x45_P0.6mm","Connector_Hirose_FX8/Hirose_FX8-90S-SV_2x45_P0.6mm","Connector_IDC/IDC-Header_2x03_P2.54mm_Horizontal","Connector_IDC/IDC-Header_2x03_P2.54mm_Vertical","Connector_IDC/IDC-Header_2x03_P2.54mm_Vertical_SMD","Connector_IDC/IDC-Header_2x04_P2.54mm_Horizontal","Connector_IDC/IDC-Header_2x04_P2.54mm_Vertical","Connector_IDC/IDC-Header_2x04_P2.54mm_Vertical_SMD","Connector_IDC/IDC-Header_2x05-1MP_P2.54mm_Latch12.0mm_Vertical","Connector_IDC/IDC-Header_2x05-1MP_P2.54mm_Latch6.5mm_Vertical","Connector_IDC/IDC-Header_2x05-1MP_P2.54mm_Latch9.5mm_Vertical","Connector_IDC/IDC-Header_2x05-1MP_P2.54mm_Latch_Horizontal","Connector_IDC/IDC-Header_2x05-1MP_P2.54mm_Latch_Vertical","Connector_IDC/IDC-Header_2x05_P2.54mm_Horizontal","Connector_IDC/IDC-Header_2x05_P2.54mm_Latch12.0mm_Vertical","Connector_IDC/IDC-Header_2x05_P2.54mm_Latch6.5mm_Vertical","Connector_IDC/IDC-Header_2x05_P2.54mm_Latch9.5mm_Vertical","Connector_IDC/IDC-Header_2x05_P2.54mm_Latch_Horizontal","Connector_IDC/IDC-Header_2x05_P2.54mm_Latch_Vertical","Connector_IDC/IDC-Header_2x05_P2.54mm_Vertical","Connector_IDC/IDC-Header_2x05_P2.54mm_Vertical_SMD","Connector_IDC/IDC-Header_2x06-1MP_P2.54mm_Latch12.0mm_Vertical","Connector_IDC/IDC-Header_2x06-1MP_P2.54mm_Latch6.5mm_Vertical","Connector_IDC/IDC-Header_2x06-1MP_P2.54mm_Latch9.5mm_Vertical","Connector_IDC/IDC-Header_2x06-1MP_P2.54mm_Latch_Horizontal","Connector_IDC/IDC-Header_2x06-1MP_P2.54mm_Latch_Vertical","Connector_IDC/IDC-Header_2x06_P2.54mm_Horizontal","Connector_IDC/IDC-Header_2x06_P2.54mm_Latch12.0mm_Vertical","Connector_IDC/IDC-Header_2x06_P2.54mm_Latch6.5mm_Vertical","Connector_IDC/IDC-Header_2x06_P2.54mm_Latch9.5mm_Vertical","Connector_IDC/IDC-Header_2x06_P2.54mm_Latch_Horizontal","Connector_IDC/IDC-Header_2x06_P2.54mm_Latch_Vertical","Connector_IDC/IDC-Header_2x06_P2.54mm_Vertical","Connector_IDC/IDC-Header_2x06_P2.54mm_Vertical_SMD","Connector_IDC/IDC-Header_2x07-1MP_P2.54mm_Latch12.0mm_Vertical","Connector_IDC/IDC-Header_2x07-1MP_P2.54mm_Latch6.5mm_Vertical","Connector_IDC/IDC-Header_2x07-1MP_P2.54mm_Latch9.5mm_Vertical","Connector_IDC/IDC-Header_2x07-1MP_P2.54mm_Latch_Horizontal","Connector_IDC/IDC-Header_2x07-1MP_P2.54mm_Latch_Vertical","Connector_IDC/IDC-Header_2x07_P2.54mm_Horizontal","Connector_IDC/IDC-Header_2x07_P2.54mm_Horizontal_Lock","Connector_IDC/IDC-Header_2x07_P2.54mm_Latch12.0mm_Vertical","Connector_IDC/IDC-Header_2x07_P2.54mm_Latch6.5mm_Vertical","Connector_IDC/IDC-Header_2x07_P2.54mm_Latch9.5mm_Vertical","Connector_IDC/IDC-Header_2x07_P2.54mm_Latch_Horizontal","Connector_IDC/IDC-Header_2x07_P2.54mm_Latch_Vertical","Connector_IDC/IDC-Header_2x07_P2.54mm_Vertical","Connector_IDC/IDC-Header_2x07_P2.54mm_Vertical_SMD","Connector_IDC/IDC-Header_2x08-1MP_P2.54mm_Latch12.0mm_Vertical","Connector_IDC/IDC-Header_2x08-1MP_P2.54mm_Latch6.5mm_Vertical","Connector_IDC/IDC-Header_2x08-1MP_P2.54mm_Latch9.5mm_Vertical","Connector_IDC/IDC-Header_2x08-1MP_P2.54mm_Latch_Horizontal","Connector_IDC/IDC-Header_2x08-1MP_P2.54mm_Latch_Vertical","Connector_IDC/IDC-Header_2x08_P2.54mm_Horizontal","Connector_IDC/IDC-Header_2x08_P2.54mm_Latch12.0mm_Vertical","Connector_IDC/IDC-Header_2x08_P2.54mm_Latch6.5mm_Vertical","Connector_IDC/IDC-Header_2x08_P2.54mm_Latch9.5mm_Vertical","Connector_IDC/IDC-Header_2x08_P2.54mm_Latch_Horizontal","Connector_IDC/IDC-Header_2x08_P2.54mm_Latch_Vertical","Connector_IDC/IDC-Header_2x08_P2.54mm_Vertical","Connector_IDC/IDC-Header_2x08_P2.54mm_Vertical_SMD","Connector_IDC/IDC-Header_2x09_P2.54mm_Horizontal","Connector_IDC/IDC-Header_2x09_P2.54mm_Vertical","Connector_IDC/IDC-Header_2x09_P2.54mm_Vertical_SMD","Connector_IDC/IDC-Header_2x10-1MP_P2.54mm_Latch12.0mm_Vertical","Connector_IDC/IDC-Header_2x10-1MP_P2.54mm_Latch6.5mm_Vertical","Connector_IDC/IDC-Header_2x10-1MP_P2.54mm_Latch9.5mm_Vertical","Connector_IDC/IDC-Header_2x10-1MP_P2.54mm_Latch_Horizontal","Connector_IDC/IDC-Header_2x10-1MP_P2.54mm_Latch_Vertical","Connector_IDC/IDC-Header_2x10_P2.54mm_Horizontal","Connector_IDC/IDC-Header_2x10_P2.54mm_Latch12.0mm_Vertical","Connector_IDC/IDC-Header_2x10_P2.54mm_Latch6.5mm_Vertical","Connector_IDC/IDC-Header_2x10_P2.54mm_Latch9.5mm_Vertical","Connector_IDC/IDC-Header_2x10_P2.54mm_Latch_Horizontal","Connector_IDC/IDC-Header_2x10_P2.54mm_Latch_Vertical","Connector_IDC/IDC-Header_2x10_P2.54mm_Vertical","Connector_IDC/IDC-Header_2x10_P2.54mm_Vertical_SMD","Connector_IDC/IDC-Header_2x11_P2.54mm_Horizontal","Connector_IDC/IDC-Header_2x11_P2.54mm_Vertical","Connector_IDC/IDC-Header_2x11_P2.54mm_Vertical_SMD","Connector_IDC/IDC-Header_2x12-1MP_P2.54mm_Latch12.0mm_Vertical","Connector_IDC/IDC-Header_2x12-1MP_P2.54mm_Latch6.5mm_Vertical","Connector_IDC/IDC-Header_2x12-1MP_P2.54mm_Latch9.5mm_Vertical","Connector_IDC/IDC-Header_2x12-1MP_P2.54mm_Latch_Horizontal","Connector_IDC/IDC-Header_2x12-1MP_P2.54mm_Latch_Vertical","Connector_IDC/IDC-Header_2x12_P2.54mm_Horizontal","Connector_IDC/IDC-Header_2x12_P2.54mm_Latch12.0mm_Vertical","Connector_IDC/IDC-Header_2x12_P2.54mm_Latch6.5mm_Vertical","Connector_IDC/IDC-Header_2x12_P2.54mm_Latch9.5mm_Vertical","Connector_IDC/IDC-Header_2x12_P2.54mm_Latch_Horizontal","Connector_IDC/IDC-Header_2x12_P2.54mm_Latch_Vertical","Connector_IDC/IDC-Header_2x12_P2.54mm_Vertical","Connector_IDC/IDC-Header_2x12_P2.54mm_Vertical_SMD","Connector_IDC/IDC-Header_2x13-1MP_P2.54mm_Latch12.0mm_Vertical","Connector_IDC/IDC-Header_2x13-1MP_P2.54mm_Latch6.5mm_Vertical","Connector_IDC/IDC-Header_2x13-1MP_P2.54mm_Latch9.5mm_Vertical","Connector_IDC/IDC-Header_2x13-1MP_P2.54mm_Latch_Horizontal","Connector_IDC/IDC-Header_2x13-1MP_P2.54mm_Latch_Vertical","Connector_IDC/IDC-Header_2x13_P2.54mm_Horizontal","Connector_IDC/IDC-Header_2x13_P2.54mm_Latch12.0mm_Vertical","Connector_IDC/IDC-Header_2x13_P2.54mm_Latch6.5mm_Vertical","Connector_IDC/IDC-Header_2x13_P2.54mm_Latch9.5mm_Vertical","Connector_IDC/IDC-Header_2x13_P2.54mm_Latch_Horizontal","Connector_IDC/IDC-Header_2x13_P2.54mm_Latch_Vertical","Connector_IDC/IDC-Header_2x13_P2.54mm_Vertical","Connector_IDC/IDC-Header_2x13_P2.54mm_Vertical_SMD","Connector_IDC/IDC-Header_2x15-1MP_P2.54mm_Latch12.0mm_Vertical","Connector_IDC/IDC-Header_2x15-1MP_P2.54mm_Latch6.5mm_Vertical","Connector_IDC/IDC-Header_2x15-1MP_P2.54mm_Latch9.5mm_Vertical","Connector_IDC/IDC-Header_2x15-1MP_P2.54mm_Latch_Horizontal","Connector_IDC/IDC-Header_2x15-1MP_P2.54mm_Latch_Vertical","Connector_IDC/IDC-Header_2x15_P2.54mm_Horizontal","Connector_IDC/IDC-Header_2x15_P2.54mm_Latch12.0mm_Vertical","Connector_IDC/IDC-Header_2x15_P2.54mm_Latch6.5mm_Vertical","Connector_IDC/IDC-Header_2x15_P2.54mm_Latch9.5mm_Vertical","Connector_IDC/IDC-Header_2x15_P2.54mm_Latch_Horizontal","Connector_IDC/IDC-Header_2x15_P2.54mm_Latch_Vertical","Connector_IDC/IDC-Header_2x15_P2.54mm_Vertical","Connector_IDC/IDC-Header_2x17-1MP_P2.54mm_Latch12.0mm_Vertical","Connector_IDC/IDC-Header_2x17-1MP_P2.54mm_Latch6.5mm_Vertical","Connector_IDC/IDC-Header_2x17-1MP_P2.54mm_Latch9.5mm_Vertical","Connector_IDC/IDC-Header_2x17-1MP_P2.54mm_Latch_Horizontal","Connector_IDC/IDC-Header_2x17-1MP_P2.54mm_Latch_Vertical","Connector_IDC/IDC-Header_2x17_P2.54mm_Horizontal","Connector_IDC/IDC-Header_2x17_P2.54mm_Latch12.0mm_Vertical","Connector_IDC/IDC-Header_2x17_P2.54mm_Latch6.5mm_Vertical","Connector_IDC/IDC-Header_2x17_P2.54mm_Latch9.5mm_Vertical","Connector_IDC/IDC-Header_2x17_P2.54mm_Latch_Horizontal","Connector_IDC/IDC-Header_2x17_P2.54mm_Latch_Vertical","Connector_IDC/IDC-Header_2x17_P2.54mm_Vertical","Connector_IDC/IDC-Header_2x20-1MP_P2.54mm_Latch12.0mm_Vertical","Connector_IDC/IDC-Header_2x20-1MP_P2.54mm_Latch6.5mm_Vertical","Connector_IDC/IDC-Header_2x20-1MP_P2.54mm_Latch9.5mm_Vertical","Connector_IDC/IDC-Header_2x20-1MP_P2.54mm_Latch_Horizontal","Connector_IDC/IDC-Header_2x20-1MP_P2.54mm_Latch_Vertical","Connector_IDC/IDC-Header_2x20_P2.54mm_Horizontal","Connector_IDC/IDC-Header_2x20_P2.54mm_Latch12.0mm_Vertical","Connector_IDC/IDC-Header_2x20_P2.54mm_Latch6.5mm_Vertical","Connector_IDC/IDC-Header_2x20_P2.54mm_Latch9.5mm_Vertical","Connector_IDC/IDC-Header_2x20_P2.54mm_Latch_Horizontal","Connector_IDC/IDC-Header_2x20_P2.54mm_Latch_Vertical","Connector_IDC/IDC-Header_2x20_P2.54mm_Vertical","Connector_IDC/IDC-Header_2x20_P2.54mm_Vertical_SMD","Connector_IDC/IDC-Header_2x22_P2.54mm_Horizontal","Connector_IDC/IDC-Header_2x22_P2.54mm_Vertical","Connector_IDC/IDC-Header_2x22_P2.54mm_Vertical_SMD","Connector_IDC/IDC-Header_2x25-1MP_P2.54mm_Latch12.0mm_Vertical","Connector_IDC/IDC-Header_2x25-1MP_P2.54mm_Latch6.5mm_Vertical","Connector_IDC/IDC-Header_2x25-1MP_P2.54mm_Latch9.5mm_Vertical","Connector_IDC/IDC-Header_2x25-1MP_P2.54mm_Latch_Horizontal","Connector_IDC/IDC-Header_2x25-1MP_P2.54mm_Latch_Vertical","Connector_IDC/IDC-Header_2x25_P2.54mm_Horizontal","Connector_IDC/IDC-Header_2x25_P2.54mm_Latch12.0mm_Vertical","Connector_IDC/IDC-Header_2x25_P2.54mm_Latch6.5mm_Vertical","Connector_IDC/IDC-Header_2x25_P2.54mm_Latch9.5mm_Vertical","Connector_IDC/IDC-Header_2x25_P2.54mm_Latch_Horizontal","Connector_IDC/IDC-Header_2x25_P2.54mm_Latch_Vertical","Connector_IDC/IDC-Header_2x25_P2.54mm_Vertical","Connector_IDC/IDC-Header_2x25_P2.54mm_Vertical_SMD","Connector_IDC/IDC-Header_2x30-1MP_P2.54mm_Latch12.0mm_Vertical","Connector_IDC/IDC-Header_2x30-1MP_P2.54mm_Latch6.5mm_Vertical","Connector_IDC/IDC-Header_2x30-1MP_P2.54mm_Latch9.5mm_Vertical","Connector_IDC/IDC-Header_2x30-1MP_P2.54mm_Latch_Horizontal","Connector_IDC/IDC-Header_2x30-1MP_P2.54mm_Latch_Vertical","Connector_IDC/IDC-Header_2x30_P2.54mm_Horizontal","Connector_IDC/IDC-Header_2x30_P2.54mm_Latch12.0mm_Vertical","Connector_IDC/IDC-Header_2x30_P2.54mm_Latch6.5mm_Vertical","Connector_IDC/IDC-Header_2x30_P2.54mm_Latch9.5mm_Vertical","Connector_IDC/IDC-Header_2x30_P2.54mm_Latch_Horizontal","Connector_IDC/IDC-Header_2x30_P2.54mm_Latch_Vertical","Connector_IDC/IDC-Header_2x30_P2.54mm_Vertical","Connector_IDC/IDC-Header_2x30_P2.54mm_Vertical_SMD","Connector_IDC/IDC-Header_2x32-1MP_P2.54mm_Latch12.0mm_Vertical","Connector_IDC/IDC-Header_2x32-1MP_P2.54mm_Latch6.5mm_Vertical","Connector_IDC/IDC-Header_2x32-1MP_P2.54mm_Latch9.5mm_Vertical","Connector_IDC/IDC-Header_2x32-1MP_P2.54mm_Latch_Horizontal","Connector_IDC/IDC-Header_2x32-1MP_P2.54mm_Latch_Vertical","Connector_IDC/IDC-Header_2x32_P2.54mm_Horizontal","Connector_IDC/IDC-Header_2x32_P2.54mm_Latch12.0mm_Vertical","Connector_IDC/IDC-Header_2x32_P2.54mm_Latch6.5mm_Vertical","Connector_IDC/IDC-Header_2x32_P2.54mm_Latch9.5mm_Vertical","Connector_IDC/IDC-Header_2x32_P2.54mm_Latch_Horizontal","Connector_IDC/IDC-Header_2x32_P2.54mm_Latch_Vertical","Connector_IDC/IDC-Header_2x32_P2.54mm_Vertical","Connector_JAE/JAE_LY20-10P-DLT1_2x05_P2.00mm_Horizontal","Connector_JAE/JAE_LY20-10P-DT1_2x05_P2.00mm_Vertical","Connector_JAE/JAE_LY20-12P-DLT1_2x06_P2.00mm_Horizontal","Connector_JAE/JAE_LY20-12P-DT1_2x06_P2.00mm_Vertical","Connector_JAE/JAE_LY20-14P-DLT1_2x07_P2.00mm_Horizontal","Connector_JAE/JAE_LY20-14P-DT1_2x07_P2.00mm_Vertical","Connector_JAE/JAE_LY20-16P-DLT1_2x08_P2.00mm_Horizontal","Connector_JAE/JAE_LY20-16P-DT1_2x08_P2.00mm_Vertical","Connector_JAE/JAE_LY20-18P-DLT1_2x09_P2.00mm_Horizontal","Connector_JAE/JAE_LY20-18P-DT1_2x09_P2.00mm_Vertical","Connector_JAE/JAE_LY20-20P-DLT1_2x10_P2.00mm_Horizontal","Connector_JAE/JAE_LY20-20P-DT1_2x10_P2.00mm_Vertical","Connector_JAE/JAE_LY20-22P-DLT1_2x11_P2.00mm_Horizontal","Connector_JAE/JAE_LY20-22P-DT1_2x11_P2.00mm_Vertical","Connector_JAE/JAE_LY20-24P-DLT1_2x12_P2.00mm_Horizontal","Connector_JAE/JAE_LY20-24P-DT1_2x12_P2.00mm_Vertical","Connector_JAE/JAE_LY20-26P-DLT1_2x13_P2.00mm_Horizontal","Connector_JAE/JAE_LY20-26P-DT1_2x13_P2.00mm_Vertical","Connector_JAE/JAE_LY20-28P-DLT1_2x14_P2.00mm_Horizontal","Connector_JAE/JAE_LY20-28P-DT1_2x14_P2.00mm_Vertical","Connector_JAE/JAE_LY20-30P-DLT1_2x15_P2.00mm_Horizontal","Connector_JAE/JAE_LY20-30P-DT1_2x15_P2.00mm_Vertical","Connector_JAE/JAE_LY20-32P-DLT1_2x16_P2.00mm_Horizontal","Connector_JAE/JAE_LY20-32P-DT1_2x16_P2.00mm_Vertical","Connector_JAE/JAE_LY20-34P-DLT1_2x17_P2.00mm_Horizontal","Connector_JAE/JAE_LY20-34P-DT1_2x17_P2.00mm_Vertical","Connector_JAE/JAE_LY20-36P-DLT1_2x18_P2.00mm_Horizontal","Connector_JAE/JAE_LY20-36P-DT1_2x18_P2.00mm_Vertical","Connector_JAE/JAE_LY20-38P-DLT1_2x19_P2.00mm_Horizontal","Connector_JAE/JAE_LY20-38P-DT1_2x19_P2.00mm_Vertical","Connector_JAE/JAE_LY20-40P-DLT1_2x20_P2.00mm_Horizontal","Connector_JAE/JAE_LY20-40P-DT1_2x20_P2.00mm_Vertical","Connector_JAE/JAE_LY20-42P-DLT1_2x21_P2.00mm_Horizontal","Connector_JAE/JAE_LY20-42P-DT1_2x21_P2.00mm_Vertical","Connector_JAE/JAE_LY20-44P-DLT1_2x22_P2.00mm_Horizontal","Connector_JAE/JAE_LY20-44P-DT1_2x22_P2.00mm_Vertical","Connector_JAE/JAE_LY20-4P-DLT1_2x02_P2.00mm_Horizontal","Connector_JAE/JAE_LY20-4P-DT1_2x02_P2.00mm_Vertical","Connector_JAE/JAE_LY20-6P-DLT1_2x03_P2.00mm_Horizontal","Connector_JAE/JAE_LY20-6P-DT1_2x03_P2.00mm_Vertical","Connector_JAE/JAE_LY20-8P-DLT1_2x04_P2.00mm_Horizontal","Connector_JAE/JAE_LY20-8P-DT1_2x04_P2.00mm_Vertical","Connector_JAE/JAE_MM70-314-310B1","Connector_JAE/JAE_SIM_Card_SF72S006","Connector_JAE_WP7B/JAE_WP7B-P034VA1-R8000_2x17-1MP_P0.4mm","Connector_JAE_WP7B/JAE_WP7B-P034VA1-R8000_Longpads_2x17-1MP_P0.4mm","Connector_JAE_WP7B/JAE_WP7B-P040VA1-R8000_2x20-1MP_P0.4mm","Connector_JAE_WP7B/JAE_WP7B-P040VA1-R8000_Longpads_2x20-1MP_P0.4mm","Connector_JAE_WP7B/JAE_WP7B-P050VA1-R8000_2x25-1MP_P0.4mm","Connector_JAE_WP7B/JAE_WP7B-P050VA1-R8000_Longpads_2x25-1MP_P0.4mm","Connector_JAE_WP7B/JAE_WP7B-P060VA1-R8000_2x30-1MP_P0.4mm","Connector_JAE_WP7B/JAE_WP7B-P060VA1-R8000_Longpads_2x30-1MP_P0.4mm","Connector_JAE_WP7B/JAE_WP7B-P070VA1-R8000_2x35-1MP_P0.4mm","Connector_JAE_WP7B/JAE_WP7B-P070VA1-R8000_Longpads_2x35-1MP_P0.4mm","Connector_JAE_WP7B/JAE_WP7B-S034VA1-R8000_2x17-1MP_P0.4mm","Connector_JAE_WP7B/JAE_WP7B-S034VA1-R8000_Longpads_2x17-1MP_P0.4mm","Connector_JAE_WP7B/JAE_WP7B-S040VA1-R8000_2x20-1MP_P0.4mm","Connector_JAE_WP7B/JAE_WP7B-S040VA1-R8000_Longpads_2x20-1MP_P0.4mm","Connector_JAE_WP7B/JAE_WP7B-S050VA1-R8000_2x25-1MP_P0.4mm","Connector_JAE_WP7B/JAE_WP7B-S050VA1-R8000_Longpads_2x25-1MP_P0.4mm","Connector_JAE_WP7B/JAE_WP7B-S060VA1-R8000_2x30-1MP_P0.4mm","Connector_JAE_WP7B/JAE_WP7B-S060VA1-R8000_Longpads_2x30-1MP_P0.4mm","Connector_JAE_WP7B/JAE_WP7B-S070VA1-R8000_2x35-1MP_P0.4mm","Connector_JAE_WP7B/JAE_WP7B-S070VA1-R8000_Longpads_2x35-1MP_P0.4mm","Connector_JST/JST_ACH_BM01B-ACHSS-A-GAN-ETF_1x01-1MP_P1.20mm_Vertical","Connector_JST/JST_ACH_BM02B-ACHSS-GAN-ETF_1x02-1MP_P1.20mm_Vertical","Connector_JST/JST_ACH_BM03B-ACHSS-GAN-ETF_1x03-1MP_P1.20mm_Vertical","Connector_JST/JST_ACH_BM04B-ACHSS-A-GAN-ETF_1x04-1MP_P1.20mm_Vertical","Connector_JST/JST_ACH_BM05B-ACHSS-A-GAN-ETF_1x05-1MP_P1.20mm_Vertical","Connector_JST/JST_AUH_BM03B-AUHKS-GA-TB_1x03-1MP_P1.50mm_Vertical","Connector_JST/JST_AUH_BM05B-AUHKS-GA-TB_1x05-1MP_P1.50mm_Vertical","Connector_JST/JST_EH_B10B-EH-A_1x10_P2.50mm_Vertical","Connector_JST/JST_EH_B11B-EH-A_1x11_P2.50mm_Vertical","Connector_JST/JST_EH_B12B-EH-A_1x12_P2.50mm_Vertical","Connector_JST/JST_EH_B13B-EH-A_1x13_P2.50mm_Vertical","Connector_JST/JST_EH_B14B-EH-A_1x14_P2.50mm_Vertical","Connector_JST/JST_EH_B15B-EH-A_1x15_P2.50mm_Vertical","Connector_JST/JST_EH_B2B-EH-A_1x02_P2.50mm_Vertical","Connector_JST/JST_EH_B3B-EH-A_1x03_P2.50mm_Vertical","Connector_JST/JST_EH_B4B-EH-A_1x04_P2.50mm_Vertical","Connector_JST/JST_EH_B5B-EH-A_1x05_P2.50mm_Vertical","Connector_JST/JST_EH_B6B-EH-A_1x06_P2.50mm_Vertical","Connector_JST/JST_EH_B7B-EH-A_1x07_P2.50mm_Vertical","Connector_JST/JST_EH_B8B-EH-A_1x08_P2.50mm_Vertical","Connector_JST/JST_EH_B9B-EH-A_1x09_P2.50mm_Vertical","Connector_JST/JST_EH_S10B-EH_1x10_P2.50mm_Horizontal","Connector_JST/JST_EH_S11B-EH_1x11_P2.50mm_Horizontal","Connector_JST/JST_EH_S12B-EH_1x12_P2.50mm_Horizontal","Connector_JST/JST_EH_S13B-EH_1x13_P2.50mm_Horizontal","Connector_JST/JST_EH_S14B-EH_1x14_P2.50mm_Horizontal","Connector_JST/JST_EH_S15B-EH_1x15_P2.50mm_Horizontal","Connector_JST/JST_EH_S2B-EH_1x02_P2.50mm_Horizontal","Connector_JST/JST_EH_S3B-EH_1x03_P2.50mm_Horizontal","Connector_JST/JST_EH_S4B-EH_1x04_P2.50mm_Horizontal","Connector_JST/JST_EH_S5B-EH_1x05_P2.50mm_Horizontal","Connector_JST/JST_EH_S6B-EH_1x06_P2.50mm_Horizontal","Connector_JST/JST_EH_S7B-EH_1x07_P2.50mm_Horizontal","Connector_JST/JST_EH_S8B-EH_1x08_P2.50mm_Horizontal","Connector_JST/JST_EH_S9B-EH_1x09_P2.50mm_Horizontal","Connector_JST/JST_GH_BM02B-GHS-TBT_1x02-1MP_P1.25mm_Vertical","Connector_JST/JST_GH_BM03B-GHS-TBT_1x03-1MP_P1.25mm_Vertical","Connector_JST/JST_GH_BM04B-GHS-TBT_1x04-1MP_P1.25mm_Vertical","Connector_JST/JST_GH_BM05B-GHS-TBT_1x05-1MP_P1.25mm_Vertical","Connector_JST/JST_GH_BM06B-GHS-TBT_1x06-1MP_P1.25mm_Vertical","Connector_JST/JST_GH_BM07B-GHS-TBT_1x07-1MP_P1.25mm_Vertical","Connector_JST/JST_GH_BM08B-GHS-TBT_1x08-1MP_P1.25mm_Vertical","Connector_JST/JST_GH_BM09B-GHS-TBT_1x09-1MP_P1.25mm_Vertical","Connector_JST/JST_GH_BM10B-GHS-TBT_1x10-1MP_P1.25mm_Vertical","Connector_JST/JST_GH_BM11B-GHS-TBT_1x11-1MP_P1.25mm_Vertical","Connector_JST/JST_GH_BM12B-GHS-TBT_1x12-1MP_P1.25mm_Vertical","Connector_JST/JST_GH_BM13B-GHS-TBT_1x13-1MP_P1.25mm_Vertical","Connector_JST/JST_GH_BM14B-GHS-TBT_1x14-1MP_P1.25mm_Vertical","Connector_JST/JST_GH_BM15B-GHS-TBT_1x15-1MP_P1.25mm_Vertical","Connector_JST/JST_GH_SM02B-GHS-TB_1x02-1MP_P1.25mm_Horizontal","Connector_JST/JST_GH_SM03B-GHS-TB_1x03-1MP_P1.25mm_Horizontal","Connector_JST/JST_GH_SM04B-GHS-TB_1x04-1MP_P1.25mm_Horizontal","Connector_JST/JST_GH_SM05B-GHS-TB_1x05-1MP_P1.25mm_Horizontal","Connector_JST/JST_GH_SM06B-GHS-TB_1x06-1MP_P1.25mm_Horizontal","Connector_JST/JST_GH_SM07B-GHS-TB_1x07-1MP_P1.25mm_Horizontal","Connector_JST/JST_GH_SM08B-GHS-TB_1x08-1MP_P1.25mm_Horizontal","Connector_JST/JST_GH_SM09B-GHS-TB_1x09-1MP_P1.25mm_Horizontal","Connector_JST/JST_GH_SM10B-GHS-TB_1x10-1MP_P1.25mm_Horizontal","Connector_JST/JST_GH_SM11B-GHS-TB_1x11-1MP_P1.25mm_Horizontal","Connector_JST/JST_GH_SM12B-GHS-TB_1x12-1MP_P1.25mm_Horizontal","Connector_JST/JST_GH_SM13B-GHS-TB_1x13-1MP_P1.25mm_Horizontal","Connector_JST/JST_GH_SM14B-GHS-TB_1x14-1MP_P1.25mm_Horizontal","Connector_JST/JST_GH_SM15B-GHS-TB_1x15-1MP_P1.25mm_Horizontal","Connector_JST/JST_J2100_B06B-J21DK-GGXR_2x03_P2.50x4.00mm_Vertical","Connector_JST/JST_J2100_B08B-J21DK-GGXR_2x04_P2.50x4.00mm_Vertical","Connector_JST/JST_J2100_B10B-J21DK-GGXR_2x05_P2.50x4.00mm_Vertical","Connector_JST/JST_J2100_B12B-J21DK-GGXR_2x06_P2.50x4.00mm_Vertical","Connector_JST/JST_J2100_B16B-J21DK-GGXR_2x08_P2.50x4.00mm_Vertical","Connector_JST/JST_J2100_B20B-J21DK-GGXR_2x10_P2.50x4.00mm_Vertical","Connector_JST/JST_J2100_S06B-J21DK-GGXR_2x03_P2.50mm_Horizontal","Connector_JST/JST_J2100_S08B-J21DK-GGXR_2x04_P2.50mm_Horizontal","Connector_JST/JST_J2100_S10B-J21DK-GGXR_2x05_P2.50mm_Horizontal","Connector_JST/JST_J2100_S12B-J21DK-GGXR_2x06_P2.50mm_Horizontal","Connector_JST/JST_J2100_S16B-J21DK-GGXR_2x08_P2.50mm_Horizontal","Connector_JST/JST_J2100_S20B-J21DK-GGXR_2x10_P2.50mm_Horizontal","Connector_JST/JST_JWPF_B02B-JWPF-SK-R_1x02_P2.00mm_Vertical","Connector_JST/JST_JWPF_B03B-JWPF-SK-R_1x03_P2.00mm_Vertical","Connector_JST/JST_JWPF_B04B-JWPF-SK-R_1x04_P2.00mm_Vertical","Connector_JST/JST_JWPF_B06B-JWPF-SK-R_2x03_P2.00mm_Vertical","Connector_JST/JST_JWPF_B08B-JWPF-SK-R_2x04_P2.00mm_Vertical","Connector_JST/JST_LEA_SM02B-LEASS-TF_1x02-1MP_P4.20mm_Horizontal","Connector_JST/JST_NV_B02P-NV_1x02_P5.00mm_Vertical","Connector_JST/JST_NV_B03P-NV_1x03_P5.00mm_Vertical","Connector_JST/JST_NV_B04P-NV_1x04_P5.00mm_Vertical","Connector_JST/JST_PHD_B10B-PHDSS_2x05_P2.00mm_Vertical","Connector_JST/JST_PHD_B12B-PHDSS_2x06_P2.00mm_Vertical","Connector_JST/JST_PHD_B14B-PHDSS_2x07_P2.00mm_Vertical","Connector_JST/JST_PHD_B16B-PHDSS_2x08_P2.00mm_Vertical","Connector_JST/JST_PHD_B18B-PHDSS_2x09_P2.00mm_Vertical","Connector_JST/JST_PHD_B20B-PHDSS_2x10_P2.00mm_Vertical","Connector_JST/JST_PHD_B22B-PHDSS_2x11_P2.00mm_Vertical","Connector_JST/JST_PHD_B24B-PHDSS_2x12_P2.00mm_Vertical","Connector_JST/JST_PHD_B26B-PHDSS_2x13_P2.00mm_Vertical","Connector_JST/JST_PHD_B28B-PHDSS_2x14_P2.00mm_Vertical","Connector_JST/JST_PHD_B30B-PHDSS_2x15_P2.00mm_Vertical","Connector_JST/JST_PHD_B32B-PHDSS_2x16_P2.00mm_Vertical","Connector_JST/JST_PHD_B34B-PHDSS_2x17_P2.00mm_Vertical","Connector_JST/JST_PHD_B8B-PHDSS_2x04_P2.00mm_Vertical","Connector_JST/JST_PHD_S10B-PHDSS_2x05_P2.00mm_Horizontal","Connector_JST/JST_PHD_S12B-PHDSS_2x06_P2.00mm_Horizontal","Connector_JST/JST_PHD_S14B-PHDSS_2x07_P2.00mm_Horizontal","Connector_JST/JST_PHD_S16B-PHDSS_2x08_P2.00mm_Horizontal","Connector_JST/JST_PHD_S18B-PHDSS_2x09_P2.00mm_Horizontal","Connector_JST/JST_PHD_S20B-PHDSS_2x10_P2.00mm_Horizontal","Connector_JST/JST_PHD_S22B-PHDSS_2x11_P2.00mm_Horizontal","Connector_JST/JST_PHD_S24B-PHDSS_2x12_P2.00mm_Horizontal","Connector_JST/JST_PHD_S26B-PHDSS_2x13_P2.00mm_Horizontal","Connector_JST/JST_PHD_S28B-PHDSS_2x14_P2.00mm_Horizontal","Connector_JST/JST_PHD_S30B-PHDSS_2x15_P2.00mm_Horizontal","Connector_JST/JST_PHD_S32B-PHDSS_2x16_P2.00mm_Horizontal","Connector_JST/JST_PHD_S34B-PHDSS_2x17_P2.00mm_Horizontal","Connector_JST/JST_PHD_S8B-PHDSS_2x04_P2.00mm_Horizontal","Connector_JST/JST_PH_B10B-PH-K_1x10_P2.00mm_Vertical","Connector_JST/JST_PH_B10B-PH-SM4-TB_1x10-1MP_P2.00mm_Vertical","Connector_JST/JST_PH_B11B-PH-K_1x11_P2.00mm_Vertical","Connector_JST/JST_PH_B11B-PH-SM4-TB_1x11-1MP_P2.00mm_Vertical","Connector_JST/JST_PH_B12B-PH-K_1x12_P2.00mm_Vertical","Connector_JST/JST_PH_B12B-PH-SM4-TB_1x12-1MP_P2.00mm_Vertical","Connector_JST/JST_PH_B13B-PH-K_1x13_P2.00mm_Vertical","Connector_JST/JST_PH_B13B-PH-SM4-TB_1x13-1MP_P2.00mm_Vertical","Connector_JST/JST_PH_B14B-PH-K_1x14_P2.00mm_Vertical","Connector_JST/JST_PH_B14B-PH-SM4-TB_1x14-1MP_P2.00mm_Vertical","Connector_JST/JST_PH_B15B-PH-K_1x15_P2.00mm_Vertical","Connector_JST/JST_PH_B15B-PH-SM4-TB_1x15-1MP_P2.00mm_Vertical","Connector_JST/JST_PH_B16B-PH-K_1x16_P2.00mm_Vertical","Connector_JST/JST_PH_B16B-PH-SM4-TB_1x16-1MP_P2.00mm_Vertical","Connector_JST/JST_PH_B2B-PH-K_1x02_P2.00mm_Vertical","Connector_JST/JST_PH_B2B-PH-SM4-TB_1x02-1MP_P2.00mm_Vertical","Connector_JST/JST_PH_B3B-PH-K_1x03_P2.00mm_Vertical","Connector_JST/JST_PH_B3B-PH-SM4-TB_1x03-1MP_P2.00mm_Vertical","Connector_JST/JST_PH_B4B-PH-K_1x04_P2.00mm_Vertical","Connector_JST/JST_PH_B4B-PH-SM4-TB_1x04-1MP_P2.00mm_Vertical","Connector_JST/JST_PH_B5B-PH-K_1x05_P2.00mm_Vertical","Connector_JST/JST_PH_B5B-PH-SM4-TB_1x05-1MP_P2.00mm_Vertical","Connector_JST/JST_PH_B6B-PH-K_1x06_P2.00mm_Vertical","Connector_JST/JST_PH_B6B-PH-SM4-TB_1x06-1MP_P2.00mm_Vertical","Connector_JST/JST_PH_B7B-PH-K_1x07_P2.00mm_Vertical","Connector_JST/JST_PH_B7B-PH-SM4-TB_1x07-1MP_P2.00mm_Vertical","Connector_JST/JST_PH_B8B-PH-K_1x08_P2.00mm_Vertical","Connector_JST/JST_PH_B8B-PH-SM4-TB_1x08-1MP_P2.00mm_Vertical","Connector_JST/JST_PH_B9B-PH-K_1x09_P2.00mm_Vertical","Connector_JST/JST_PH_B9B-PH-SM4-TB_1x09-1MP_P2.00mm_Vertical","Connector_JST/JST_PH_S10B-PH-K_1x10_P2.00mm_Horizontal","Connector_JST/JST_PH_S10B-PH-SM4-TB_1x10-1MP_P2.00mm_Horizontal","Connector_JST/JST_PH_S11B-PH-K_1x11_P2.00mm_Horizontal","Connector_JST/JST_PH_S11B-PH-SM4-TB_1x11-1MP_P2.00mm_Horizontal","Connector_JST/JST_PH_S12B-PH-K_1x12_P2.00mm_Horizontal","Connector_JST/JST_PH_S12B-PH-SM4-TB_1x12-1MP_P2.00mm_Horizontal","Connector_JST/JST_PH_S13B-PH-K_1x13_P2.00mm_Horizontal","Connector_JST/JST_PH_S13B-PH-SM4-TB_1x13-1MP_P2.00mm_Horizontal","Connector_JST/JST_PH_S14B-PH-K_1x14_P2.00mm_Horizontal","Connector_JST/JST_PH_S14B-PH-SM4-TB_1x14-1MP_P2.00mm_Horizontal","Connector_JST/JST_PH_S15B-PH-K_1x15_P2.00mm_Horizontal","Connector_JST/JST_PH_S15B-PH-SM4-TB_1x15-1MP_P2.00mm_Horizontal","Connector_JST/JST_PH_S16B-PH-K_1x16_P2.00mm_Horizontal","Connector_JST/JST_PH_S2B-PH-K_1x02_P2.00mm_Horizontal","Connector_JST/JST_PH_S2B-PH-SM4-TB_1x02-1MP_P2.00mm_Horizontal","Connector_JST/JST_PH_S3B-PH-K_1x03_P2.00mm_Horizontal","Connector_JST/JST_PH_S3B-PH-SM4-TB_1x03-1MP_P2.00mm_Horizontal","Connector_JST/JST_PH_S4B-PH-K_1x04_P2.00mm_Horizontal","Connector_JST/JST_PH_S4B-PH-SM4-TB_1x04-1MP_P2.00mm_Horizontal","Connector_JST/JST_PH_S5B-PH-K_1x05_P2.00mm_Horizontal","Connector_JST/JST_PH_S5B-PH-SM4-TB_1x05-1MP_P2.00mm_Horizontal","Connector_JST/JST_PH_S6B-PH-K_1x06_P2.00mm_Horizontal","Connector_JST/JST_PH_S6B-PH-SM4-TB_1x06-1MP_P2.00mm_Horizontal","Connector_JST/JST_PH_S7B-PH-K_1x07_P2.00mm_Horizontal","Connector_JST/JST_PH_S7B-PH-SM4-TB_1x07-1MP_P2.00mm_Horizontal","Connector_JST/JST_PH_S8B-PH-K_1x08_P2.00mm_Horizontal","Connector_JST/JST_PH_S8B-PH-SM4-TB_1x08-1MP_P2.00mm_Horizontal","Connector_JST/JST_PH_S9B-PH-K_1x09_P2.00mm_Horizontal","Connector_JST/JST_PH_S9B-PH-SM4-TB_1x09-1MP_P2.00mm_Horizontal","Connector_JST/JST_PUD_B08B-PUDSS_2x04_P2.00mm_Vertical","Connector_JST/JST_PUD_B10B-PUDSS_2x05_P2.00mm_Vertical","Connector_JST/JST_PUD_B12B-PUDSS_2x06_P2.00mm_Vertical","Connector_JST/JST_PUD_B14B-PUDSS_2x07_P2.00mm_Vertical","Connector_JST/JST_PUD_B16B-PUDSS_2x08_P2.00mm_Vertical","Connector_JST/JST_PUD_B18B-PUDSS_2x09_P2.00mm_Vertical","Connector_JST/JST_PUD_B20B-PUDSS_2x10_P2.00mm_Vertical","Connector_JST/JST_PUD_B22B-PUDSS_2x11_P2.00mm_Vertical","Connector_JST/JST_PUD_B24B-PUDSS_2x12_P2.00mm_Vertical","Connector_JST/JST_PUD_B26B-PUDSS_2x13_P2.00mm_Vertical","Connector_JST/JST_PUD_B28B-PUDSS_2x14_P2.00mm_Vertical","Connector_JST/JST_PUD_B30B-PUDSS_2x15_P2.00mm_Vertical","Connector_JST/JST_PUD_B32B-PUDSS_2x16_P2.00mm_Vertical","Connector_JST/JST_PUD_B34B-PUDSS_2x17_P2.00mm_Vertical","Connector_JST/JST_PUD_B36B-PUDSS_2x18_P2.00mm_Vertical","Connector_JST/JST_PUD_B38B-PUDSS_2x19_P2.00mm_Vertical","Connector_JST/JST_PUD_B40B-PUDSS_2x20_P2.00mm_Vertical","Connector_JST/JST_PUD_S08B-PUDSS-1_2x04_P2.00mm_Horizontal","Connector_JST/JST_PUD_S10B-PUDSS-1_2x05_P2.00mm_Horizontal","Connector_JST/JST_PUD_S12B-PUDSS-1_2x06_P2.00mm_Horizontal","Connector_JST/JST_PUD_S14B-PUDSS-1_2x07_P2.00mm_Horizontal","Connector_JST/JST_PUD_S16B-PUDSS-1_2x08_P2.00mm_Horizontal","Connector_JST/JST_PUD_S18B-PUDSS-1_2x09_P2.00mm_Horizontal","Connector_JST/JST_PUD_S20B-PUDSS-1_2x10_P2.00mm_Horizontal","Connector_JST/JST_PUD_S22B-PUDSS-1_2x11_P2.00mm_Horizontal","Connector_JST/JST_PUD_S24B-PUDSS-1_2x12_P2.00mm_Horizontal","Connector_JST/JST_PUD_S26B-PUDSS-1_2x13_P2.00mm_Horizontal","Connector_JST/JST_PUD_S28B-PUDSS-1_2x14_P2.00mm_Horizontal","Connector_JST/JST_PUD_S30B-PUDSS-1_2x15_P2.00mm_Horizontal","Connector_JST/JST_PUD_S32B-PUDSS-1_2x16_P2.00mm_Horizontal","Connector_JST/JST_PUD_S34B-PUDSS-1_2x17_P2.00mm_Horizontal","Connector_JST/JST_PUD_S36B-PUDSS-1_2x18_P2.00mm_Horizontal","Connector_JST/JST_PUD_S38B-PUDSS-1_2x19_P2.00mm_Horizontal","Connector_JST/JST_PUD_S40B-PUDSS-1_2x20_P2.00mm_Horizontal","Connector_JST/JST_SFH_SM02B-SFHRS-TF_1x02-1MP_P4.20mm_Horizontal","Connector_JST/JST_SHD_BM20B-SRDS-A-G-TF_2x10-1MP_P1.0mm_Vertical","Connector_JST/JST_SHD_BM20B-SRDS-G-TF_2x10-1MP_P1.0mm_Vertical","Connector_JST/JST_SHD_BM30B-SRDS-A-G-TF_2x15-1MP_P1.0mm_Vertical","Connector_JST/JST_SHD_BM30B-SRDS-G-TF_2x15-1MP_P1.0mm_Vertical","Connector_JST/JST_SHD_BM40B-SRDS-A-G-TF_2x20-1MP_P1.0mm_Vertical","Connector_JST/JST_SHD_BM40B-SRDS-G-TF_2x20-1MP_P1.0mm_Vertical","Connector_JST/JST_SHD_BM50B-SRDS-A-G-TF_2x25-1MP_P1.0mm_Vertical","Connector_JST/JST_SHD_BM50B-SRDS-G-TF_2x25-1MP_P1.0mm_Vertical","Connector_JST/JST_SHD_SM20B-SRDS-G-TF_2x10-1MP_P1.0mm_Horizontal","Connector_JST/JST_SHD_SM30B-SRDS-G-TF_2x15-1MP_P1.0mm_Horizontal","Connector_JST/JST_SHD_SM40B-SRDS-G-TF_2x20-1MP_P1.0mm_Horizontal","Connector_JST/JST_SHD_SM50B-SRDS-G-TF_2x25-1MP_P1.0mm_Horizontal","Connector_JST/JST_SHL_SM02B-SHLS-TF_1x02-1MP_P1.00mm_Horizontal","Connector_JST/JST_SHL_SM05B-SHLS-TF_1x05-1MP_P1.00mm_Horizontal","Connector_JST/JST_SHL_SM06B-SHLS-TF_1x06-1MP_P1.00mm_Horizontal","Connector_JST/JST_SHL_SM07B-SHLS-TF_1x07-1MP_P1.00mm_Horizontal","Connector_JST/JST_SHL_SM08B-SHLS-TF_1x08-1MP_P1.00mm_Horizontal","Connector_JST/JST_SHL_SM10B-SHLS-TF_1x10-1MP_P1.00mm_Horizontal","Connector_JST/JST_SHL_SM11B-SHLS-TF_1x11-1MP_P1.00mm_Horizontal","Connector_JST/JST_SHL_SM12B-SHLS-TF_1x12-1MP_P1.00mm_Horizontal","Connector_JST/JST_SHL_SM14B-SHLS-TF_1x14-1MP_P1.00mm_Horizontal","Connector_JST/JST_SHL_SM16B-SHLS-TF_1x16-1MP_P1.00mm_Horizontal","Connector_JST/JST_SHL_SM20B-SHLS-TF_1x20-1MP_P1.00mm_Horizontal","Connector_JST/JST_SHL_SM22B-SHLS-TF_1x22-1MP_P1.00mm_Horizontal","Connector_JST/JST_SHL_SM26B-SHLS-TF_1x26-1MP_P1.00mm_Horizontal","Connector_JST/JST_SHL_SM30B-SHLS-TF_1x30-1MP_P1.00mm_Horizontal","Connector_JST/JST_SH_BM02B-SRSS-TB_1x02-1MP_P1.00mm_Vertical","Connector_JST/JST_SH_BM03B-SRSS-TB_1x03-1MP_P1.00mm_Vertical","Connector_JST/JST_SH_BM04B-SRSS-TB_1x04-1MP_P1.00mm_Vertical","Connector_JST/JST_SH_BM05B-SRSS-TB_1x05-1MP_P1.00mm_Vertical","Connector_JST/JST_SH_BM06B-SRSS-TB_1x06-1MP_P1.00mm_Vertical","Connector_JST/JST_SH_BM07B-SRSS-TB_1x07-1MP_P1.00mm_Vertical","Connector_JST/JST_SH_BM08B-SRSS-TB_1x08-1MP_P1.00mm_Vertical","Connector_JST/JST_SH_BM09B-SRSS-TB_1x09-1MP_P1.00mm_Vertical","Connector_JST/JST_SH_BM10B-SRSS-TB_1x10-1MP_P1.00mm_Vertical","Connector_JST/JST_SH_BM11B-SRSS-TB_1x11-1MP_P1.00mm_Vertical","Connector_JST/JST_SH_BM12B-SRSS-TB_1x12-1MP_P1.00mm_Vertical","Connector_JST/JST_SH_BM13B-SRSS-TB_1x13-1MP_P1.00mm_Vertical","Connector_JST/JST_SH_BM14B-SRSS-TB_1x14-1MP_P1.00mm_Vertical","Connector_JST/JST_SH_BM15B-SRSS-TB_1x15-1MP_P1.00mm_Vertical","Connector_JST/JST_SH_SM02B-SRSS-TB_1x02-1MP_P1.00mm_Horizontal","Connector_JST/JST_SH_SM03B-SRSS-TB_1x03-1MP_P1.00mm_Horizontal","Connector_JST/JST_SH_SM04B-SRSS-TB_1x04-1MP_P1.00mm_Horizontal","Connector_JST/JST_SH_SM05B-SRSS-TB_1x05-1MP_P1.00mm_Horizontal","Connector_JST/JST_SH_SM06B-SRSS-TB_1x06-1MP_P1.00mm_Horizontal","Connector_JST/JST_SH_SM07B-SRSS-TB_1x07-1MP_P1.00mm_Horizontal","Connector_JST/JST_SH_SM08B-SRSS-TB_1x08-1MP_P1.00mm_Horizontal","Connector_JST/JST_SH_SM09B-SRSS-TB_1x09-1MP_P1.00mm_Horizontal","Connector_JST/JST_SH_SM10B-SRSS-TB_1x10-1MP_P1.00mm_Horizontal","Connector_JST/JST_SH_SM11B-SRSS-TB_1x11-1MP_P1.00mm_Horizontal","Connector_JST/JST_SH_SM12B-SRSS-TB_1x12-1MP_P1.00mm_Horizontal","Connector_JST/JST_SH_SM13B-SRSS-TB_1x13-1MP_P1.00mm_Horizontal","Connector_JST/JST_SH_SM14B-SRSS-TB_1x14-1MP_P1.00mm_Horizontal","Connector_JST/JST_SH_SM15B-SRSS-TB_1x15-1MP_P1.00mm_Horizontal","Connector_JST/JST_SH_SM20B-SRSS-TB_1x20-1MP_P1.00mm_Horizontal","Connector_JST/JST_SUR_BM02B-SURS-TF_1x02-1MP_P0.80mm_Vertical","Connector_JST/JST_SUR_BM03B-SURS-TF_1x03-1MP_P0.80mm_Vertical","Connector_JST/JST_SUR_BM04B-SURS-TF_1x04-1MP_P0.80mm_Vertical","Connector_JST/JST_SUR_BM05B-SURS-TF_1x05-1MP_P0.80mm_Vertical","Connector_JST/JST_SUR_BM06B-SURS-TF_1x06-1MP_P0.80mm_Vertical","Connector_JST/JST_SUR_BM08B-SURS-TF_1x08-1MP_P0.80mm_Vertical","Connector_JST/JST_SUR_BM10B-SURS-TF_1x10-1MP_P0.80mm_Vertical","Connector_JST/JST_SUR_BM12B-SURS-TF_1x12-1MP_P0.80mm_Vertical","Connector_JST/JST_SUR_BM14B-SURS-TF_1x14-1MP_P0.80mm_Vertical","Connector_JST/JST_SUR_BM15B-SURS-TF_1x15-1MP_P0.80mm_Vertical","Connector_JST/JST_SUR_BM16B-SURS-TF_1x16-1MP_P0.80mm_Vertical","Connector_JST/JST_SUR_BM17B-SURS-TF_1x17-1MP_P0.80mm_Vertical","Connector_JST/JST_SUR_BM20B-SURS-TF_1x20-1MP_P0.80mm_Vertical","Connector_JST/JST_SUR_SM02B-SURS-TF_1x02-1MP_P0.80mm_Horizontal","Connector_JST/JST_SUR_SM03B-SURS-TF_1x03-1MP_P0.80mm_Horizontal","Connector_JST/JST_SUR_SM04B-SURS-TF_1x04-1MP_P0.80mm_Horizontal","Connector_JST/JST_SUR_SM05B-SURS-TF_1x05-1MP_P0.80mm_Horizontal","Connector_JST/JST_SUR_SM06B-SURS-TF_1x06-1MP_P0.80mm_Horizontal","Connector_JST/JST_SUR_SM08B-SURS-TF_1x08-1MP_P0.80mm_Horizontal","Connector_JST/JST_SUR_SM10B-SURS-TF_1x10-1MP_P0.80mm_Horizontal","Connector_JST/JST_SUR_SM12B-SURS-TF_1x12-1MP_P0.80mm_Horizontal","Connector_JST/JST_SUR_SM14B-SURS-TF_1x14-1MP_P0.80mm_Horizontal","Connector_JST/JST_SUR_SM15B-SURS-TF_1x15-1MP_P0.80mm_Horizontal","Connector_JST/JST_SUR_SM16B-SURS-TF_1x16-1MP_P0.80mm_Horizontal","Connector_JST/JST_SUR_SM17B-SURS-TF_1x17-1MP_P0.80mm_Horizontal","Connector_JST/JST_SUR_SM20B-SURS-TF_1x20-1MP_P0.80mm_Horizontal","Connector_JST/JST_SUR_SM22B-SURS-TF_1x22-1MP_P0.80mm_Horizontal","Connector_JST/JST_VH_B10P-VH-B_1x10_P3.96mm_Vertical","Connector_JST/JST_VH_B10P-VH-FB-B_1x10_P3.96mm_Vertical","Connector_JST/JST_VH_B10P-VH_1x10_P3.96mm_Vertical","Connector_JST/JST_VH_B10PS-VH_1x10_P3.96mm_Horizontal","Connector_JST/JST_VH_B11P-VH-B_1x11_P3.96mm_Vertical","Connector_JST/JST_VH_B2P-VH-B_1x02_P3.96mm_Vertical","Connector_JST/JST_VH_B2P-VH-FB-B_1x02_P3.96mm_Vertical","Connector_JST/JST_VH_B2P-VH_1x02_P3.96mm_Vertical","Connector_JST/JST_VH_B2P3-VH_1x02_P7.92mm_Vertical","Connector_JST/JST_VH_B2PS-VH_1x02_P3.96mm_Horizontal","Connector_JST/JST_VH_B3P-VH-B_1x03_P3.96mm_Vertical","Connector_JST/JST_VH_B3P-VH-FB-B_1x03_P3.96mm_Vertical","Connector_JST/JST_VH_B3P-VH_1x03_P3.96mm_Vertical","Connector_JST/JST_VH_B3PS-VH_1x03_P3.96mm_Horizontal","Connector_JST/JST_VH_B4P-VH-B_1x04_P3.96mm_Vertical","Connector_JST/JST_VH_B4P-VH-FB-B_1x04_P3.96mm_Vertical","Connector_JST/JST_VH_B4P-VH_1x04_P3.96mm_Vertical","Connector_JST/JST_VH_B4PS-VH_1x04_P3.96mm_Horizontal","Connector_JST/JST_VH_B5P-VH-B_1x05_P3.96mm_Vertical","Connector_JST/JST_VH_B5P-VH-FB-B_1x05_P3.96mm_Vertical","Connector_JST/JST_VH_B5P-VH_1x05_P3.96mm_Vertical","Connector_JST/JST_VH_B5PS-VH_1x05_P3.96mm_Horizontal","Connector_JST/JST_VH_B6P-VH-B_1x06_P3.96mm_Vertical","Connector_JST/JST_VH_B6P-VH-FB-B_1x06_P3.96mm_Vertical","Connector_JST/JST_VH_B6P-VH_1x06_P3.96mm_Vertical","Connector_JST/JST_VH_B6PS-VH_1x06_P3.96mm_Horizontal","Connector_JST/JST_VH_B7P-VH-B_1x07_P3.96mm_Vertical","Connector_JST/JST_VH_B7P-VH-FB-B_1x07_P3.96mm_Vertical","Connector_JST/JST_VH_B7P-VH_1x07_P3.96mm_Vertical","Connector_JST/JST_VH_B7PS-VH_1x07_P3.96mm_Horizontal","Connector_JST/JST_VH_B8P-VH-B_1x08_P3.96mm_Vertical","Connector_JST/JST_VH_B8P-VH-FB-B_1x08_P3.96mm_Vertical","Connector_JST/JST_VH_B8P-VH_1x08_P3.96mm_Vertical","Connector_JST/JST_VH_B8PS-VH_1x08_P3.96mm_Horizontal","Connector_JST/JST_VH_B9P-VH-B_1x09_P3.96mm_Vertical","Connector_JST/JST_VH_B9P-VH-FB-B_1x09_P3.96mm_Vertical","Connector_JST/JST_VH_B9P-VH_1x09_P3.96mm_Vertical","Connector_JST/JST_VH_B9PS-VH_1x09_P3.96mm_Horizontal","Connector_JST/JST_VH_S2P-VH_1x02_P3.96mm_Horizontal","Connector_JST/JST_VH_S3P-VH_1x03_P3.96mm_Horizontal","Connector_JST/JST_VH_S4P-VH_1x04_P3.96mm_Horizontal","Connector_JST/JST_VH_S5P-VH_1x05_P3.96mm_Horizontal","Connector_JST/JST_VH_S6P-VH_1x06_P3.96mm_Horizontal","Connector_JST/JST_VH_S7P-VH_1x07_P3.96mm_Horizontal","Connector_JST/JST_XAG_SM05B-XAGKS-BN-TB_1x05-1MP_P2.50mm_Horizontal","Connector_JST/JST_XA_B02B-XASK-1-A_1x02_P2.50mm_Vertical","Connector_JST/JST_XA_B02B-XASK-1_1x02_P2.50mm_Vertical","Connector_JST/JST_XA_B03B-XASK-1-A_1x03_P2.50mm_Vertical","Connector_JST/JST_XA_B03B-XASK-1_1x03_P2.50mm_Vertical","Connector_JST/JST_XA_B04B-XASK-1-A_1x04_P2.50mm_Vertical","Connector_JST/JST_XA_B04B-XASK-1_1x04_P2.50mm_Vertical","Connector_JST/JST_XA_B05B-XASK-1-A_1x05_P2.50mm_Vertical","Connector_JST/JST_XA_B05B-XASK-1_1x05_P2.50mm_Vertical","Connector_JST/JST_XA_B06B-XASK-1-A_1x06_P2.50mm_Vertical","Connector_JST/JST_XA_B06B-XASK-1_1x06_P2.50mm_Vertical","Connector_JST/JST_XA_B07B-XASK-1-A_1x07_P2.50mm_Vertical","Connector_JST/JST_XA_B07B-XASK-1_1x07_P2.50mm_Vertical","Connector_JST/JST_XA_B08B-XASK-1-A_1x08_P2.50mm_Vertical","Connector_JST/JST_XA_B08B-XASK-1_1x08_P2.50mm_Vertical","Connector_JST/JST_XA_B09B-XASK-1-A_1x09_P2.50mm_Vertical","Connector_JST/JST_XA_B09B-XASK-1_1x09_P2.50mm_Vertical","Connector_JST/JST_XA_B10B-XASK-1-A_1x10_P2.50mm_Vertical","Connector_JST/JST_XA_B10B-XASK-1_1x10_P2.50mm_Vertical","Connector_JST/JST_XA_B11B-XASK-1-A_1x11_P2.50mm_Vertical","Connector_JST/JST_XA_B11B-XASK-1_1x11_P2.50mm_Vertical","Connector_JST/JST_XA_B12B-XASK-1-A_1x12_P2.50mm_Vertical","Connector_JST/JST_XA_B12B-XASK-1_1x12_P2.50mm_Vertical","Connector_JST/JST_XA_B13B-XASK-1-A_1x13_P2.50mm_Vertical","Connector_JST/JST_XA_B13B-XASK-1_1x13_P2.50mm_Vertical","Connector_JST/JST_XA_B14B-XASK-1-A_1x14_P2.50mm_Vertical","Connector_JST/JST_XA_B14B-XASK-1_1x14_P2.50mm_Vertical","Connector_JST/JST_XA_B15B-XASK-1-A_1x15_P2.50mm_Vertical","Connector_JST/JST_XA_B15B-XASK-1_1x15_P2.50mm_Vertical","Connector_JST/JST_XA_B18B-XASK-1_1x18_P2.50mm_Vertical","Connector_JST/JST_XA_B20B-XASK-1-A_1x20_P2.50mm_Vertical","Connector_JST/JST_XA_B20B-XASK-1_1x20_P2.50mm_Vertical","Connector_JST/JST_XA_S02B-XASK-1N-BN_1x02_P2.50mm_Horizontal","Connector_JST/JST_XA_S02B-XASK-1_1x02_P2.50mm_Horizontal","Connector_JST/JST_XA_S03B-XASK-1N-BN_1x03_P2.50mm_Horizontal","Connector_JST/JST_XA_S03B-XASK-1_1x03_P2.50mm_Horizontal","Connector_JST/JST_XA_S04B-XASK-1N-BN_1x04_P2.50mm_Horizontal","Connector_JST/JST_XA_S04B-XASK-1_1x04_P2.50mm_Horizontal","Connector_JST/JST_XA_S05B-XASK-1N-BN_1x05_P2.50mm_Horizontal","Connector_JST/JST_XA_S05B-XASK-1_1x05_P2.50mm_Horizontal","Connector_JST/JST_XA_S06B-XASK-1N-BN_1x06_P2.50mm_Horizontal","Connector_JST/JST_XA_S06B-XASK-1_1x06_P2.50mm_Horizontal","Connector_JST/JST_XA_S07B-XASK-1N-BN_1x07_P2.50mm_Horizontal","Connector_JST/JST_XA_S07B-XASK-1_1x07_P2.50mm_Horizontal","Connector_JST/JST_XA_S08B-XASK-1N-BN_1x08_P2.50mm_Horizontal","Connector_JST/JST_XA_S08B-XASK-1_1x08_P2.50mm_Horizontal","Connector_JST/JST_XA_S09B-XASK-1N-BN_1x09_P2.50mm_Horizontal","Connector_JST/JST_XA_S09B-XASK-1_1x09_P2.50mm_Horizontal","Connector_JST/JST_XA_S10B-XASK-1N-BN_1x10_P2.50mm_Horizontal","Connector_JST/JST_XA_S10B-XASK-1_1x10_P2.50mm_Horizontal","Connector_JST/JST_XA_S11B-XASK-1N-BN_1x11_P2.50mm_Horizontal","Connector_JST/JST_XA_S11B-XASK-1_1x11_P2.50mm_Horizontal","Connector_JST/JST_XA_S12B-XASK-1N-BN_1x12_P2.50mm_Horizontal","Connector_JST/JST_XA_S12B-XASK-1_1x12_P2.50mm_Horizontal","Connector_JST/JST_XA_S13B-XASK-1N-BN_1x13_P2.50mm_Horizontal","Connector_JST/JST_XA_S13B-XASK-1_1x13_P2.50mm_Horizontal","Connector_JST/JST_XA_S14B-XASK-1N-BN_1x14_P2.50mm_Horizontal","Connector_JST/JST_XA_S14B-XASK-1_1x14_P2.50mm_Horizontal","Connector_JST/JST_XH_B10B-XH-AM_1x10_P2.50mm_Vertical","Connector_JST/JST_XH_B10B-XH-A_1x10_P2.50mm_Vertical","Connector_JST/JST_XH_B11B-XH-A_1x11_P2.50mm_Vertical","Connector_JST/JST_XH_B12B-XH-AM_1x12_P2.50mm_Vertical","Connector_JST/JST_XH_B12B-XH-A_1x12_P2.50mm_Vertical","Connector_JST/JST_XH_B13B-XH-A_1x13_P2.50mm_Vertical","Connector_JST/JST_XH_B14B-XH-A_1x14_P2.50mm_Vertical","Connector_JST/JST_XH_B15B-XH-A_1x15_P2.50mm_Vertical","Connector_JST/JST_XH_B16B-XH-A_1x16_P2.50mm_Vertical","Connector_JST/JST_XH_B1B-XH-AM_1x01_P2.50mm_Vertical","Connector_JST/JST_XH_B20B-XH-A_1x20_P2.50mm_Vertical","Connector_JST/JST_XH_B2B-XH-AM_1x02_P2.50mm_Vertical","Connector_JST/JST_XH_B2B-XH-A_1x02_P2.50mm_Vertical","Connector_JST/JST_XH_B3B-XH-AM_1x03_P2.50mm_Vertical","Connector_JST/JST_XH_B3B-XH-A_1x03_P2.50mm_Vertical","Connector_JST/JST_XH_B4B-XH-AM_1x04_P2.50mm_Vertical","Connector_JST/JST_XH_B4B-XH-A_1x04_P2.50mm_Vertical","Connector_JST/JST_XH_B5B-XH-AM_1x05_P2.50mm_Vertical","Connector_JST/JST_XH_B5B-XH-A_1x05_P2.50mm_Vertical","Connector_JST/JST_XH_B6B-XH-AM_1x06_P2.50mm_Vertical","Connector_JST/JST_XH_B6B-XH-A_1x06_P2.50mm_Vertical","Connector_JST/JST_XH_B7B-XH-AM_1x07_P2.50mm_Vertical","Connector_JST/JST_XH_B7B-XH-A_1x07_P2.50mm_Vertical","Connector_JST/JST_XH_B8B-XH-AM_1x08_P2.50mm_Vertical","Connector_JST/JST_XH_B8B-XH-A_1x08_P2.50mm_Vertical","Connector_JST/JST_XH_B9B-XH-AM_1x09_P2.50mm_Vertical","Connector_JST/JST_XH_B9B-XH-A_1x09_P2.50mm_Vertical","Connector_JST/JST_XH_S10B-XH-A-1_1x10_P2.50mm_Horizontal","Connector_JST/JST_XH_S10B-XH-A_1x10_P2.50mm_Horizontal","Connector_JST/JST_XH_S11B-XH-A-1_1x11_P2.50mm_Horizontal","Connector_JST/JST_XH_S11B-XH-A_1x11_P2.50mm_Horizontal","Connector_JST/JST_XH_S12B-XH-A-1_1x12_P2.50mm_Horizontal","Connector_JST/JST_XH_S12B-XH-A_1x12_P2.50mm_Horizontal","Connector_JST/JST_XH_S13B-XH-A-1_1x13_P2.50mm_Horizontal","Connector_JST/JST_XH_S13B-XH-A_1x13_P2.50mm_Horizontal","Connector_JST/JST_XH_S14B-XH-A-1_1x14_P2.50mm_Horizontal","Connector_JST/JST_XH_S14B-XH-A_1x14_P2.50mm_Horizontal","Connector_JST/JST_XH_S15B-XH-A-1_1x15_P2.50mm_Horizontal","Connector_JST/JST_XH_S15B-XH-A_1x15_P2.50mm_Horizontal","Connector_JST/JST_XH_S16B-XH-A_1x16_P2.50mm_Horizontal","Connector_JST/JST_XH_S2B-XH-A-1_1x02_P2.50mm_Horizontal","Connector_JST/JST_XH_S2B-XH-A_1x02_P2.50mm_Horizontal","Connector_JST/JST_XH_S3B-XH-A-1_1x03_P2.50mm_Horizontal","Connector_JST/JST_XH_S3B-XH-A_1x03_P2.50mm_Horizontal","Connector_JST/JST_XH_S3B-XH-SM4-TB_1x03-1MP_P2.50mm_Horizontal","Connector_JST/JST_XH_S4B-XH-A-1_1x04_P2.50mm_Horizontal","Connector_JST/JST_XH_S4B-XH-A_1x04_P2.50mm_Horizontal","Connector_JST/JST_XH_S4B-XH-SM4-TB_1x04-1MP_P2.50mm_Horizontal","Connector_JST/JST_XH_S5B-XH-A-1_1x05_P2.50mm_Horizontal","Connector_JST/JST_XH_S5B-XH-A_1x05_P2.50mm_Horizontal","Connector_JST/JST_XH_S6B-XH-A-1_1x06_P2.50mm_Horizontal","Connector_JST/JST_XH_S6B-XH-A_1x06_P2.50mm_Horizontal","Connector_JST/JST_XH_S6B-XH-SM4-TB_1x06-1MP_P2.50mm_Horizontal","Connector_JST/JST_XH_S7B-XH-A-1_1x07_P2.50mm_Horizontal","Connector_JST/JST_XH_S7B-XH-A_1x07_P2.50mm_Horizontal","Connector_JST/JST_XH_S8B-XH-A-1_1x08_P2.50mm_Horizontal","Connector_JST/JST_XH_S8B-XH-A_1x08_P2.50mm_Horizontal","Connector_JST/JST_XH_S9B-XH-A-1_1x09_P2.50mm_Horizontal","Connector_JST/JST_XH_S9B-XH-A_1x09_P2.50mm_Horizontal","Connector_JST/JST_ZE_B02B-ZESK-1D_1x02_P1.50mm_Vertical","Connector_JST/JST_ZE_B03B-ZESK-1D_1x03_P1.50mm_Vertical","Connector_JST/JST_ZE_B03B-ZESK-D_1x03_P1.50mm_Vertical","Connector_JST/JST_ZE_B04B-ZESK-1D_1x04_P1.50mm_Vertical","Connector_JST/JST_ZE_B04B-ZESK-D_1x04_P1.50mm_Vertical","Connector_JST/JST_ZE_B05B-ZESK-1D_1x05_P1.50mm_Vertical","Connector_JST/JST_ZE_B05B-ZESK-D_1x05_P1.50mm_Vertical","Connector_JST/JST_ZE_B06B-ZESK-1D_1x06_P1.50mm_Vertical","Connector_JST/JST_ZE_B06B-ZESK-D_1x06_P1.50mm_Vertical","Connector_JST/JST_ZE_B07B-ZESK-1D_1x07_P1.50mm_Vertical","Connector_JST/JST_ZE_B07B-ZESK-D_1x07_P1.50mm_Vertical","Connector_JST/JST_ZE_B08B-ZESK-1D_1x08_P1.50mm_Vertical","Connector_JST/JST_ZE_B08B-ZESK-D_1x08_P1.50mm_Vertical","Connector_JST/JST_ZE_B09B-ZESK-1D_1x09_P1.50mm_Vertical","Connector_JST/JST_ZE_B09B-ZESK-D_1x09_P1.50mm_Vertical","Connector_JST/JST_ZE_B10B-ZESK-1D_1x10_P1.50mm_Vertical","Connector_JST/JST_ZE_B10B-ZESK-D_1x10_P1.50mm_Vertical","Connector_JST/JST_ZE_B11B-ZESK-1D_1x11_P1.50mm_Vertical","Connector_JST/JST_ZE_B11B-ZESK-D_1x11_P1.50mm_Vertical","Connector_JST/JST_ZE_B12B-ZESK-1D_1x12_P1.50mm_Vertical","Connector_JST/JST_ZE_B12B-ZESK-D_1x12_P1.50mm_Vertical","Connector_JST/JST_ZE_B13B-ZESK-1D_1x13_P1.50mm_Vertical","Connector_JST/JST_ZE_B13B-ZESK-D_1x13_P1.50mm_Vertical","Connector_JST/JST_ZE_B14B-ZESK-1D_1x14_P1.50mm_Vertical","Connector_JST/JST_ZE_B14B-ZESK-D_1x14_P1.50mm_Vertical","Connector_JST/JST_ZE_B15B-ZESK-1D_1x15_P1.50mm_Vertical","Connector_JST/JST_ZE_B15B-ZESK-D_1x15_P1.50mm_Vertical","Connector_JST/JST_ZE_B16B-ZESK-1D_1x16_P1.50mm_Vertical","Connector_JST/JST_ZE_B16B-ZESK-D_1x16_P1.50mm_Vertical","Connector_JST/JST_ZE_BM02B-ZESS-TBT_1x02-1MP_P1.50mm_Vertical","Connector_JST/JST_ZE_BM03B-ZESS-TBT_1x03-1MP_P1.50mm_Vertical","Connector_JST/JST_ZE_BM04B-ZESS-TBT_1x04-1MP_P1.50mm_Vertical","Connector_JST/JST_ZE_BM05B-ZESS-TBT_1x05-1MP_P1.50mm_Vertical","Connector_JST/JST_ZE_BM06B-ZESS-TBT_1x06-1MP_P1.50mm_Vertical","Connector_JST/JST_ZE_BM07B-ZESS-TBT_1x07-1MP_P1.50mm_Vertical","Connector_JST/JST_ZE_BM08B-ZESS-TBT_1x08-1MP_P1.50mm_Vertical","Connector_JST/JST_ZE_BM09B-ZESS-TBT_1x09-1MP_P1.50mm_Vertical","Connector_JST/JST_ZE_BM10B-ZESS-TBT_1x10-1MP_P1.50mm_Vertical","Connector_JST/JST_ZE_BM11B-ZESS-TBT_1x11-1MP_P1.50mm_Vertical","Connector_JST/JST_ZE_BM12B-ZESS-TBT_1x12-1MP_P1.50mm_Vertical","Connector_JST/JST_ZE_BM13B-ZESS-TBT_1x13-1MP_P1.50mm_Vertical","Connector_JST/JST_ZE_BM14B-ZESS-TBT_1x14-1MP_P1.50mm_Vertical","Connector_JST/JST_ZE_BM15B-ZESS-TBT_1x15-1MP_P1.50mm_Vertical","Connector_JST/JST_ZE_BM16B-ZESS-TBT_1x16-1MP_P1.50mm_Vertical","Connector_JST/JST_ZE_S02B-ZESK-2D_1x02_P1.50mm_Horizontal","Connector_JST/JST_ZE_S03B-ZESK-2D_1x03_P1.50mm_Horizontal","Connector_JST/JST_ZE_S04B-ZESK-2D_1x04_P1.50mm_Horizontal","Connector_JST/JST_ZE_S05B-ZESK-2D_1x05_P1.50mm_Horizontal","Connector_JST/JST_ZE_S06B-ZESK-2D_1x06_P1.50mm_Horizontal","Connector_JST/JST_ZE_S07B-ZESK-2D_1x07_P1.50mm_Horizontal","Connector_JST/JST_ZE_S08B-ZESK-2D_1x08_P1.50mm_Horizontal","Connector_JST/JST_ZE_S09B-ZESK-2D_1x09_P1.50mm_Horizontal","Connector_JST/JST_ZE_S10B-ZESK-2D_1x10_P1.50mm_Horizontal","Connector_JST/JST_ZE_S11B-ZESK-2D_1x11_P1.50mm_Horizontal","Connector_JST/JST_ZE_S12B-ZESK-2D_1x12_P1.50mm_Horizontal","Connector_JST/JST_ZE_S13B-ZESK-2D_1x13_P1.50mm_Horizontal","Connector_JST/JST_ZE_S14B-ZESK-2D_1x14_P1.50mm_Horizontal","Connector_JST/JST_ZE_S15B-ZESK-2D_1x15_P1.50mm_Horizontal","Connector_JST/JST_ZE_S16B-ZESK-2D_1x16_P1.50mm_Horizontal","Connector_JST/JST_ZE_SM02B-ZESS-TB_1x02-1MP_P1.50mm_Horizontal","Connector_JST/JST_ZE_SM03B-ZESS-TB_1x03-1MP_P1.50mm_Horizontal","Connector_JST/JST_ZE_SM04B-ZESS-TB_1x04-1MP_P1.50mm_Horizontal","Connector_JST/JST_ZE_SM05B-ZESS-TB_1x05-1MP_P1.50mm_Horizontal","Connector_JST/JST_ZE_SM06B-ZESS-TB_1x06-1MP_P1.50mm_Horizontal","Connector_JST/JST_ZE_SM07B-ZESS-TB_1x07-1MP_P1.50mm_Horizontal","Connector_JST/JST_ZE_SM08B-ZESS-TB_1x08-1MP_P1.50mm_Horizontal","Connector_JST/JST_ZE_SM09B-ZESS-TB_1x09-1MP_P1.50mm_Horizontal","Connector_JST/JST_ZE_SM10B-ZESS-TB_1x10-1MP_P1.50mm_Horizontal","Connector_JST/JST_ZE_SM11B-ZESS-TB_1x11-1MP_P1.50mm_Horizontal","Connector_JST/JST_ZE_SM12B-ZESS-TB_1x12-1MP_P1.50mm_Horizontal","Connector_JST/JST_ZE_SM13B-ZESS-TB_1x13-1MP_P1.50mm_Horizontal","Connector_JST/JST_ZE_SM14B-ZESS-TB_1x14-1MP_P1.50mm_Horizontal","Connector_JST/JST_ZE_SM15B-ZESS-TB_1x15-1MP_P1.50mm_Horizontal","Connector_JST/JST_ZE_SM16B-ZESS-TB_1x16-1MP_P1.50mm_Horizontal","Connector_JST/JST_ZH_B10B-ZR-SM4-TF_1x10-1MP_P1.50mm_Vertical","Connector_JST/JST_ZH_B10B-ZR_1x10_P1.50mm_Vertical","Connector_JST/JST_ZH_B11B-ZR-SM4-TF_1x11-1MP_P1.50mm_Vertical","Connector_JST/JST_ZH_B11B-ZR_1x11_P1.50mm_Vertical","Connector_JST/JST_ZH_B12B-ZR-SM4-TF_1x12-1MP_P1.50mm_Vertical","Connector_JST/JST_ZH_B12B-ZR_1x12_P1.50mm_Vertical","Connector_JST/JST_ZH_B13B-ZR-SM4-TF_1x13-1MP_P1.50mm_Vertical","Connector_JST/JST_ZH_B2B-ZR-SM4-TF_1x02-1MP_P1.50mm_Vertical","Connector_JST/JST_ZH_B2B-ZR_1x02_P1.50mm_Vertical","Connector_JST/JST_ZH_B3B-ZR-SM4-TF_1x03-1MP_P1.50mm_Vertical","Connector_JST/JST_ZH_B3B-ZR_1x03_P1.50mm_Vertical","Connector_JST/JST_ZH_B4B-ZR-SM4-TF_1x04-1MP_P1.50mm_Vertical","Connector_JST/JST_ZH_B4B-ZR_1x04_P1.50mm_Vertical","Connector_JST/JST_ZH_B5B-ZR-SM4-TF_1x05-1MP_P1.50mm_Vertical","Connector_JST/JST_ZH_B5B-ZR_1x05_P1.50mm_Vertical","Connector_JST/JST_ZH_B6B-ZR-SM4-TF_1x06-1MP_P1.50mm_Vertical","Connector_JST/JST_ZH_B6B-ZR_1x06_P1.50mm_Vertical","Connector_JST/JST_ZH_B7B-ZR-SM4-TF_1x07-1MP_P1.50mm_Vertical","Connector_JST/JST_ZH_B7B-ZR_1x07_P1.50mm_Vertical","Connector_JST/JST_ZH_B8B-ZR-SM4-TF_1x08-1MP_P1.50mm_Vertical","Connector_JST/JST_ZH_B8B-ZR_1x08_P1.50mm_Vertical","Connector_JST/JST_ZH_B9B-ZR-SM4-TF_1x09-1MP_P1.50mm_Vertical","Connector_JST/JST_ZH_B9B-ZR_1x09_P1.50mm_Vertical","Connector_JST/JST_ZH_S10B-ZR-SM4A-TF_1x10-1MP_P1.50mm_Horizontal","Connector_JST/JST_ZH_S11B-ZR-SM4A-TF_1x11-1MP_P1.50mm_Horizontal","Connector_JST/JST_ZH_S12B-ZR-SM4A-TF_1x12-1MP_P1.50mm_Horizontal","Connector_JST/JST_ZH_S13B-ZR-SM4A-TF_1x13-1MP_P1.50mm_Horizontal","Connector_JST/JST_ZH_S2B-ZR-SM4A-TF_1x02-1MP_P1.50mm_Horizontal","Connector_JST/JST_ZH_S3B-ZR-SM4A-TF_1x03-1MP_P1.50mm_Horizontal","Connector_JST/JST_ZH_S4B-ZR-SM4A-TF_1x04-1MP_P1.50mm_Horizontal","Connector_JST/JST_ZH_S5B-ZR-SM4A-TF_1x05-1MP_P1.50mm_Horizontal","Connector_JST/JST_ZH_S6B-ZR-SM4A-TF_1x06-1MP_P1.50mm_Horizontal","Connector_JST/JST_ZH_S7B-ZR-SM4A-TF_1x07-1MP_P1.50mm_Horizontal","Connector_JST/JST_ZH_S8B-ZR-SM4A-TF_1x08-1MP_P1.50mm_Horizontal","Connector_JST/JST_ZH_S9B-ZR-SM4A-TF_1x09-1MP_P1.50mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502382-0270_1x02-1MP_P1.25mm_Vertical","Connector_Molex/Molex_CLIK-Mate_502382-0370_1x03-1MP_P1.25mm_Vertical","Connector_Molex/Molex_CLIK-Mate_502382-0470_1x04-1MP_P1.25mm_Vertical","Connector_Molex/Molex_CLIK-Mate_502382-0570_1x05-1MP_P1.25mm_Vertical","Connector_Molex/Molex_CLIK-Mate_502382-0670_1x06-1MP_P1.25mm_Vertical","Connector_Molex/Molex_CLIK-Mate_502382-0770_1x07-1MP_P1.25mm_Vertical","Connector_Molex/Molex_CLIK-Mate_502382-0870_1x08-1MP_P1.25mm_Vertical","Connector_Molex/Molex_CLIK-Mate_502382-0970_1x09-1MP_P1.25mm_Vertical","Connector_Molex/Molex_CLIK-Mate_502382-1070_1x10-1MP_P1.25mm_Vertical","Connector_Molex/Molex_CLIK-Mate_502382-1170_1x11-1MP_P1.25mm_Vertical","Connector_Molex/Molex_CLIK-Mate_502382-1270_1x12-1MP_P1.25mm_Vertical","Connector_Molex/Molex_CLIK-Mate_502382-1370_1x13-1MP_P1.25mm_Vertical","Connector_Molex/Molex_CLIK-Mate_502382-1470_1x14-1MP_P1.25mm_Vertical","Connector_Molex/Molex_CLIK-Mate_502382-1570_1x15-1MP_P1.25mm_Vertical","Connector_Molex/Molex_CLIK-Mate_502386-0270_1x02-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502386-0370_1x03-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502386-0470_1x04-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502386-0570_1x05-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502386-0670_1x06-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502386-0770_1x07-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502386-0870_1x08-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502386-0970_1x09-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502386-1070_1x10-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502386-1170_1x11-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502386-1270_1x12-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502386-1370_1x13-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502386-1470_1x14-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502386-1570_1x15-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502443-0270_1x02-1MP_P2.00mm_Vertical","Connector_Molex/Molex_CLIK-Mate_502443-0370_1x03-1MP_P2.00mm_Vertical","Connector_Molex/Molex_CLIK-Mate_502443-0470_1x04-1MP_P2.00mm_Vertical","Connector_Molex/Molex_CLIK-Mate_502443-0570_1x05-1MP_P2.00mm_Vertical","Connector_Molex/Molex_CLIK-Mate_502443-0670_1x06-1MP_P2.00mm_Vertical","Connector_Molex/Molex_CLIK-Mate_502443-0770_1x07-1MP_P2.00mm_Vertical","Connector_Molex/Molex_CLIK-Mate_502443-0870_1x08-1MP_P2.00mm_Vertical","Connector_Molex/Molex_CLIK-Mate_502443-0970_1x09-1MP_P2.00mm_Vertical","Connector_Molex/Molex_CLIK-Mate_502443-1270_1x12-1MP_P2.00mm_Vertical","Connector_Molex/Molex_CLIK-Mate_502443-1370_1x13-1MP_P2.00mm_Vertical","Connector_Molex/Molex_CLIK-Mate_502443-1470_1x14-1MP_P2.00mm_Vertical","Connector_Molex/Molex_CLIK-Mate_502443-1570_1x15-1MP_P2.00mm_Vertical","Connector_Molex/Molex_CLIK-Mate_502494-0270_1x02-1MP_P2.00mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502494-0370_1x03-1MP_P2.00mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502494-0470_1x04-1MP_P2.00mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502494-0670_1x06-1MP_P2.00mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502494-0870_1x08-1MP_P2.00mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502494-1070_1x10-1MP_P2.00mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502494-1270_1x12-1MP_P2.00mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502494-1370_1x13-1MP_P2.00mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502494-1470_1x14-1MP_P2.00mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502494-1570_1x15-1MP_P2.00mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502585-0270_1x02-1MP_P1.50mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502585-0370_1x03-1MP_P1.50mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502585-0470_1x04-1MP_P1.50mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502585-0570_1x05-1MP_P1.50mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502585-0670_1x06-1MP_P1.50mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502585-0770_1x07-1MP_P1.50mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502585-0870_1x08-1MP_P1.50mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502585-0970_1x09-1MP_P1.50mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502585-1070_1x10-1MP_P1.50mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502585-1170_1x11-1MP_P1.50mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502585-1270_1x12-1MP_P1.50mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502585-1370_1x13-1MP_P1.50mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502585-1470_1x14-1MP_P1.50mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502585-1570_1x15-1MP_P1.50mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_505405-0270_1x02-1MP_P1.50mm_Vertical","Connector_Molex/Molex_CLIK-Mate_505405-0370_1x03-1MP_P1.50mm_Vertical","Connector_Molex/Molex_CLIK-Mate_505405-0470_1x04-1MP_P1.50mm_Vertical","Connector_Molex/Molex_CLIK-Mate_505405-0570_1x05-1MP_P1.50mm_Vertical","Connector_Molex/Molex_CLIK-Mate_505405-0670_1x06-1MP_P1.50mm_Vertical","Connector_Molex/Molex_CLIK-Mate_505405-0770_1x07-1MP_P1.50mm_Vertical","Connector_Molex/Molex_CLIK-Mate_505405-0870_1x08-1MP_P1.50mm_Vertical","Connector_Molex/Molex_CLIK-Mate_505405-0970_1x09-1MP_P1.50mm_Vertical","Connector_Molex/Molex_CLIK-Mate_505405-1070_1x10-1MP_P1.50mm_Vertical","Connector_Molex/Molex_CLIK-Mate_505405-1170_1x11-1MP_P1.50mm_Vertical","Connector_Molex/Molex_CLIK-Mate_505405-1270_1x12-1MP_P1.50mm_Vertical","Connector_Molex/Molex_CLIK-Mate_505405-1370_1x13-1MP_P1.50mm_Vertical","Connector_Molex/Molex_CLIK-Mate_505405-1470_1x14-1MP_P1.50mm_Vertical","Connector_Molex/Molex_CLIK-Mate_505405-1570_1x15-1MP_P1.50mm_Vertical","Connector_Molex/Molex_DuraClik_502352-0200_1x02-1MP_P2.00mm_Horizontal","Connector_Molex/Molex_DuraClik_502352-0300_1x03-1MP_P2.00mm_Horizontal","Connector_Molex/Molex_DuraClik_502352-0400_1x04-1MP_P2.00mm_Horizontal","Connector_Molex/Molex_DuraClik_502352-0500_1x05-1MP_P2.00mm_Horizontal","Connector_Molex/Molex_DuraClik_502352-0600_1x06-1MP_P2.00mm_Horizontal","Connector_Molex/Molex_DuraClik_502352-0700_1x07-1MP_P2.00mm_Horizontal","Connector_Molex/Molex_DuraClik_502352-0800_1x08-1MP_P2.00mm_Horizontal","Connector_Molex/Molex_DuraClik_502352-0900_1x09-1MP_P2.00mm_Horizontal","Connector_Molex/Molex_DuraClik_502352-1000_1x10-1MP_P2.00mm_Horizontal","Connector_Molex/Molex_DuraClik_502352-1100_1x11-1MP_P2.00mm_Horizontal","Connector_Molex/Molex_DuraClik_502352-1200_1x12-1MP_P2.00mm_Horizontal","Connector_Molex/Molex_DuraClik_502352-1300_1x13-1MP_P2.00mm_Horizontal","Connector_Molex/Molex_DuraClik_502352-1400_1x14-1MP_P2.00mm_Horizontal","Connector_Molex/Molex_DuraClik_502352-1500_1x15-1MP_P2.00mm_Horizontal","Connector_Molex/Molex_KK-254_AE-6410-02A_1x02_P2.54mm_Vertical","Connector_Molex/Molex_KK-254_AE-6410-03A_1x03_P2.54mm_Vertical","Connector_Molex/Molex_KK-254_AE-6410-04A_1x04_P2.54mm_Vertical","Connector_Molex/Molex_KK-254_AE-6410-05A_1x05_P2.54mm_Vertical","Connector_Molex/Molex_KK-254_AE-6410-06A_1x06_P2.54mm_Vertical","Connector_Molex/Molex_KK-254_AE-6410-07A_1x07_P2.54mm_Vertical","Connector_Molex/Molex_KK-254_AE-6410-08A_1x08_P2.54mm_Vertical","Connector_Molex/Molex_KK-254_AE-6410-09A_1x09_P2.54mm_Vertical","Connector_Molex/Molex_KK-254_AE-6410-10A_1x10_P2.54mm_Vertical","Connector_Molex/Molex_KK-254_AE-6410-11A_1x11_P2.54mm_Vertical","Connector_Molex/Molex_KK-254_AE-6410-12A_1x12_P2.54mm_Vertical","Connector_Molex/Molex_KK-254_AE-6410-13A_1x13_P2.54mm_Vertical","Connector_Molex/Molex_KK-254_AE-6410-14A_1x14_P2.54mm_Vertical","Connector_Molex/Molex_KK-254_AE-6410-15A_1x15_P2.54mm_Vertical","Connector_Molex/Molex_KK-254_AE-6410-16A_1x16_P2.54mm_Vertical","Connector_Molex/Molex_KK-396_5273-02A_1x02_P3.96mm_Vertical","Connector_Molex/Molex_KK-396_5273-03A_1x03_P3.96mm_Vertical","Connector_Molex/Molex_KK-396_5273-04A_1x04_P3.96mm_Vertical","Connector_Molex/Molex_KK-396_5273-05A_1x05_P3.96mm_Vertical","Connector_Molex/Molex_KK-396_5273-06A_1x06_P3.96mm_Vertical","Connector_Molex/Molex_KK-396_5273-07A_1x07_P3.96mm_Vertical","Connector_Molex/Molex_KK-396_5273-08A_1x08_P3.96mm_Vertical","Connector_Molex/Molex_KK-396_5273-09A_1x09_P3.96mm_Vertical","Connector_Molex/Molex_KK-396_5273-10A_1x10_P3.96mm_Vertical","Connector_Molex/Molex_KK-396_5273-11A_1x11_P3.96mm_Vertical","Connector_Molex/Molex_KK-396_5273-12A_1x12_P3.96mm_Vertical","Connector_Molex/Molex_KK-396_A-41791-0002_1x02_P3.96mm_Vertical","Connector_Molex/Molex_KK-396_A-41791-0003_1x03_P3.96mm_Vertical","Connector_Molex/Molex_KK-396_A-41791-0004_1x04_P3.96mm_Vertical","Connector_Molex/Molex_KK-396_A-41791-0005_1x05_P3.96mm_Vertical","Connector_Molex/Molex_KK-396_A-41791-0006_1x06_P3.96mm_Vertical","Connector_Molex/Molex_KK-396_A-41791-0007_1x07_P3.96mm_Vertical","Connector_Molex/Molex_KK-396_A-41791-0008_1x08_P3.96mm_Vertical","Connector_Molex/Molex_KK-396_A-41791-0009_1x09_P3.96mm_Vertical","Connector_Molex/Molex_KK-396_A-41791-0010_1x10_P3.96mm_Vertical","Connector_Molex/Molex_KK-396_A-41791-0011_1x11_P3.96mm_Vertical","Connector_Molex/Molex_KK-396_A-41791-0012_1x12_P3.96mm_Vertical","Connector_Molex/Molex_KK-396_A-41791-0013_1x13_P3.96mm_Vertical","Connector_Molex/Molex_KK-396_A-41791-0014_1x14_P3.96mm_Vertical","Connector_Molex/Molex_KK-396_A-41791-0015_1x15_P3.96mm_Vertical","Connector_Molex/Molex_KK-396_A-41791-0016_1x16_P3.96mm_Vertical","Connector_Molex/Molex_KK-396_A-41791-0017_1x17_P3.96mm_Vertical","Connector_Molex/Molex_KK-396_A-41791-0018_1x18_P3.96mm_Vertical","Connector_Molex/Molex_KK-396_A-41792-0002_1x02_P3.96mm_Horizontal","Connector_Molex/Molex_KK-396_A-41792-0003_1x03_P3.96mm_Horizontal","Connector_Molex/Molex_KK-396_A-41792-0004_1x04_P3.96mm_Horizontal","Connector_Molex/Molex_KK-396_A-41792-0005_1x05_P3.96mm_Horizontal","Connector_Molex/Molex_KK-396_A-41792-0006_1x06_P3.96mm_Horizontal","Connector_Molex/Molex_KK-396_A-41792-0007_1x07_P3.96mm_Horizontal","Connector_Molex/Molex_KK-396_A-41792-0008_1x08_P3.96mm_Horizontal","Connector_Molex/Molex_KK-396_A-41792-0009_1x09_P3.96mm_Horizontal","Connector_Molex/Molex_KK-396_A-41792-0010_1x10_P3.96mm_Horizontal","Connector_Molex/Molex_KK-396_A-41792-0011_1x11_P3.96mm_Horizontal","Connector_Molex/Molex_KK-396_A-41792-0012_1x12_P3.96mm_Horizontal","Connector_Molex/Molex_KK-396_A-41792-0013_1x13_P3.96mm_Horizontal","Connector_Molex/Molex_KK-396_A-41792-0014_1x14_P3.96mm_Horizontal","Connector_Molex/Molex_KK-396_A-41792-0015_1x15_P3.96mm_Horizontal","Connector_Molex/Molex_KK-396_A-41792-0016_1x16_P3.96mm_Horizontal","Connector_Molex/Molex_KK-396_A-41792-0017_1x17_P3.96mm_Horizontal","Connector_Molex/Molex_KK-396_A-41792-0018_1x18_P3.96mm_Horizontal","Connector_Molex/Molex_Mega-Fit_76825-0002_2x01_P5.70mm_Horizontal","Connector_Molex/Molex_Mega-Fit_76825-0004_2x02_P5.70mm_Horizontal","Connector_Molex/Molex_Mega-Fit_76825-0006_2x03_P5.70mm_Horizontal","Connector_Molex/Molex_Mega-Fit_76825-0008_2x04_P5.70mm_Horizontal","Connector_Molex/Molex_Mega-Fit_76825-0010_2x05_P5.70mm_Horizontal","Connector_Molex/Molex_Mega-Fit_76825-0012_2x06_P5.70mm_Horizontal","Connector_Molex/Molex_Mega-Fit_76829-0002_2x01_P5.70mm_Vertical","Connector_Molex/Molex_Mega-Fit_76829-0004_2x02_P5.70mm_Vertical","Connector_Molex/Molex_Mega-Fit_76829-0006_2x03_P5.70mm_Vertical","Connector_Molex/Molex_Mega-Fit_76829-0008_2x04_P5.70mm_Vertical","Connector_Molex/Molex_Mega-Fit_76829-0010_2x05_P5.70mm_Vertical","Connector_Molex/Molex_Mega-Fit_76829-0012_2x06_P5.70mm_Vertical","Connector_Molex/Molex_Mega-Fit_76829-0102_2x01_P5.70mm_Vertical","Connector_Molex/Molex_Mega-Fit_76829-0104_2x02_P5.70mm_Vertical","Connector_Molex/Molex_Mega-Fit_76829-0106_2x03_P5.70mm_Vertical","Connector_Molex/Molex_Mega-Fit_76829-0108_2x04_P5.70mm_Vertical","Connector_Molex/Molex_Mega-Fit_76829-0110_2x05_P5.70mm_Vertical","Connector_Molex/Molex_Mega-Fit_76829-0112_2x06_P5.70mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-0200_2x01_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-0210_2x01-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-0212_2x01_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-0215_2x01_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-0218_2x01-1MP_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-0221_2x01-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-0400_2x02_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-0410_2x02-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-0412_2x02_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-0415_2x02_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-0418_2x02-1MP_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-0421_2x02-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-0600_2x03_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-0610_2x03-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-0612_2x03_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-0615_2x03_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-0618_2x03-1MP_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-0621_2x03-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-0800_2x04_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-0810_2x04-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-0812_2x04_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-0815_2x04_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-0818_2x04-1MP_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-0821_2x04-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-1000_2x05_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-1010_2x05-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-1012_2x05_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-1015_2x05_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-1018_2x05-1MP_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-1021_2x05-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-1200_2x06_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-1210_2x06-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-1212_2x06_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-1215_2x06_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-1218_2x06-1MP_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-1221_2x06-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-1400_2x07_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-1410_2x07-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-1412_2x07_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-1415_2x07_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-1418_2x07-1MP_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-1421_2x07-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-1600_2x08_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-1610_2x08-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-1612_2x08_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-1615_2x08_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-1618_2x08-1MP_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-1621_2x08-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-1800_2x09_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-1810_2x09-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-1812_2x09_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-1815_2x09_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-1818_2x09-1MP_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-1821_2x09-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-2000_2x10_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-2010_2x10-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-2012_2x10_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-2015_2x10_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-2018_2x10-1MP_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-2021_2x10-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-2200_2x11_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-2210_2x11-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-2212_2x11_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-2215_2x11_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-2218_2x11-1MP_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-2221_2x11-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-2400_2x12_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-2410_2x12-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-2412_2x12_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-2415_2x12_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-2418_2x12-1MP_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-2421_2x12-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-0200_1x02_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-0210_1x02-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-0210_1x02-1MP_P3.00mm_Horizontal_PnP","Connector_Molex/Molex_Micro-Fit_3.0_43650-0212_1x02-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-0215_1x02_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-0221_1x02_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-0224_1x02-1MP_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-0300_1x03_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-0310_1x03-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-0310_1x03-1MP_P3.00mm_Horizontal_PnP","Connector_Molex/Molex_Micro-Fit_3.0_43650-0312_1x03-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-0315_1x03_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-0321_1x03_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-0324_1x03-1MP_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-0400_1x04_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-0410_1x04-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-0410_1x04-1MP_P3.00mm_Horizontal_PnP","Connector_Molex/Molex_Micro-Fit_3.0_43650-0412_1x04-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-0415_1x04_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-0421_1x04_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-0424_1x04-1MP_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-0500_1x05_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-0510_1x05-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-0510_1x05-1MP_P3.00mm_Horizontal_PnP","Connector_Molex/Molex_Micro-Fit_3.0_43650-0512_1x05-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-0515_1x05_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-0521_1x05_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-0524_1x05-1MP_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-0600_1x06_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-0610_1x06-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-0610_1x06-1MP_P3.00mm_Horizontal_PnP","Connector_Molex/Molex_Micro-Fit_3.0_43650-0612_1x06-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-0615_1x06_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-0621_1x06_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-0624_1x06-1MP_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-0700_1x07_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-0710_1x07-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-0710_1x07-1MP_P3.00mm_Horizontal_PnP","Connector_Molex/Molex_Micro-Fit_3.0_43650-0712_1x07-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-0715_1x07_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-0721_1x07_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-0724_1x07-1MP_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-0800_1x08_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-0810_1x08-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-0810_1x08-1MP_P3.00mm_Horizontal_PnP","Connector_Molex/Molex_Micro-Fit_3.0_43650-0812_1x08-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-0815_1x08_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-0821_1x08_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-0824_1x08-1MP_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-0900_1x09_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-0910_1x09-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-0910_1x09-1MP_P3.00mm_Horizontal_PnP","Connector_Molex/Molex_Micro-Fit_3.0_43650-0912_1x09-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-0915_1x09_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-0921_1x09_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-0924_1x09-1MP_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-1000_1x10_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-1010_1x10-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-1010_1x10-1MP_P3.00mm_Horizontal_PnP","Connector_Molex/Molex_Micro-Fit_3.0_43650-1012_1x10-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-1015_1x10_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-1021_1x10_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-1024_1x10-1MP_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-1100_1x11_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-1110_1x11-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-1110_1x11-1MP_P3.00mm_Horizontal_PnP","Connector_Molex/Molex_Micro-Fit_3.0_43650-1112_1x11-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-1115_1x11_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-1121_1x11_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-1124_1x11-1MP_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-1200_1x12_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-1210_1x12-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-1210_1x12-1MP_P3.00mm_Horizontal_PnP","Connector_Molex/Molex_Micro-Fit_3.0_43650-1212_1x12-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-1215_1x12_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-1221_1x12_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-1224_1x12-1MP_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Latch_53253-0270_1x02_P2.00mm_Vertical","Connector_Molex/Molex_Micro-Latch_53253-0370_1x03_P2.00mm_Vertical","Connector_Molex/Molex_Micro-Latch_53253-0470_1x04_P2.00mm_Vertical","Connector_Molex/Molex_Micro-Latch_53253-0570_1x05_P2.00mm_Vertical","Connector_Molex/Molex_Micro-Latch_53253-0670_1x06_P2.00mm_Vertical","Connector_Molex/Molex_Micro-Latch_53253-0770_1x07_P2.00mm_Vertical","Connector_Molex/Molex_Micro-Latch_53253-0870_1x08_P2.00mm_Vertical","Connector_Molex/Molex_Micro-Latch_53253-0970_1x09_P2.00mm_Vertical","Connector_Molex/Molex_Micro-Latch_53253-1070_1x10_P2.00mm_Vertical","Connector_Molex/Molex_Micro-Latch_53253-1170_1x11_P2.00mm_Vertical","Connector_Molex/Molex_Micro-Latch_53253-1270_1x12_P2.00mm_Vertical","Connector_Molex/Molex_Micro-Latch_53253-1370_1x13_P2.00mm_Vertical","Connector_Molex/Molex_Micro-Latch_53253-1470_1x14_P2.00mm_Vertical","Connector_Molex/Molex_Micro-Latch_53253-1570_1x15_P2.00mm_Vertical","Connector_Molex/Molex_Micro-Latch_53254-0270_1x02_P2.00mm_Horizontal","Connector_Molex/Molex_Micro-Latch_53254-0370_1x03_P2.00mm_Horizontal","Connector_Molex/Molex_Micro-Latch_53254-0470_1x04_P2.00mm_Horizontal","Connector_Molex/Molex_Micro-Latch_53254-0570_1x05_P2.00mm_Horizontal","Connector_Molex/Molex_Micro-Latch_53254-0670_1x06_P2.00mm_Horizontal","Connector_Molex/Molex_Micro-Latch_53254-0770_1x07_P2.00mm_Horizontal","Connector_Molex/Molex_Micro-Latch_53254-0870_1x08_P2.00mm_Horizontal","Connector_Molex/Molex_Micro-Latch_53254-0970_1x09_P2.00mm_Horizontal","Connector_Molex/Molex_Micro-Latch_53254-1070_1x10_P2.00mm_Horizontal","Connector_Molex/Molex_Micro-Latch_53254-1170_1x11_P2.00mm_Horizontal","Connector_Molex/Molex_Micro-Latch_53254-1270_1x12_P2.00mm_Horizontal","Connector_Molex/Molex_Micro-Latch_53254-1370_1x13_P2.00mm_Horizontal","Connector_Molex/Molex_Micro-Latch_53254-1470_1x14_P2.00mm_Horizontal","Connector_Molex/Molex_Micro-Latch_53254-1570_1x15_P2.00mm_Horizontal","Connector_Molex/Molex_MicroClasp_55932-0210_1x02_P2.00mm_Vertical","Connector_Molex/Molex_MicroClasp_55932-0230_1x02_P2.00mm_Vertical","Connector_Molex/Molex_MicroClasp_55932-0310_1x03_P2.00mm_Vertical","Connector_Molex/Molex_MicroClasp_55932-0330_1x03_P2.00mm_Vertical","Connector_Molex/Molex_MicroClasp_55932-0410_1x04_P2.00mm_Vertical","Connector_Molex/Molex_MicroClasp_55932-0430_1x04_P2.00mm_Vertical","Connector_Molex/Molex_MicroClasp_55932-0510_1x05_P2.00mm_Vertical","Connector_Molex/Molex_MicroClasp_55932-0530_1x05_P2.00mm_Vertical","Connector_Molex/Molex_MicroClasp_55932-0610_1x06_P2.00mm_Vertical","Connector_Molex/Molex_MicroClasp_55932-0630_1x06_P2.00mm_Vertical","Connector_Molex/Molex_MicroClasp_55932-0710_1x07_P2.00mm_Vertical","Connector_Molex/Molex_MicroClasp_55932-0730_1x07_P2.00mm_Vertical","Connector_Molex/Molex_MicroClasp_55932-0810_1x08_P2.00mm_Vertical","Connector_Molex/Molex_MicroClasp_55932-0830_1x08_P2.00mm_Vertical","Connector_Molex/Molex_MicroClasp_55932-0910_1x09_P2.00mm_Vertical","Connector_Molex/Molex_MicroClasp_55932-0930_1x09_P2.00mm_Vertical","Connector_Molex/Molex_MicroClasp_55932-1010_1x10_P2.00mm_Vertical","Connector_Molex/Molex_MicroClasp_55932-1030_1x10_P2.00mm_Vertical","Connector_Molex/Molex_MicroClasp_55932-1110_1x11_P2.00mm_Vertical","Connector_Molex/Molex_MicroClasp_55932-1130_1x11_P2.00mm_Vertical","Connector_Molex/Molex_MicroClasp_55932-1210_1x12_P2.00mm_Vertical","Connector_Molex/Molex_MicroClasp_55932-1230_1x12_P2.00mm_Vertical","Connector_Molex/Molex_MicroClasp_55932-1310_1x13_P2.00mm_Vertical","Connector_Molex/Molex_MicroClasp_55932-1330_1x13_P2.00mm_Vertical","Connector_Molex/Molex_MicroClasp_55932-1410_1x14_P2.00mm_Vertical","Connector_Molex/Molex_MicroClasp_55932-1430_1x14_P2.00mm_Vertical","Connector_Molex/Molex_MicroClasp_55932-1510_1x15_P2.00mm_Vertical","Connector_Molex/Molex_MicroClasp_55932-1530_1x15_P2.00mm_Vertical","Connector_Molex/Molex_MicroClasp_55935-0210_1x02_P2.00mm_Horizontal","Connector_Molex/Molex_MicroClasp_55935-0230_1x02_P2.00mm_Horizontal","Connector_Molex/Molex_MicroClasp_55935-0310_1x03_P2.00mm_Horizontal","Connector_Molex/Molex_MicroClasp_55935-0330_1x03_P2.00mm_Horizontal","Connector_Molex/Molex_MicroClasp_55935-0410_1x04_P2.00mm_Horizontal","Connector_Molex/Molex_MicroClasp_55935-0430_1x04_P2.00mm_Horizontal","Connector_Molex/Molex_MicroClasp_55935-0510_1x05_P2.00mm_Horizontal","Connector_Molex/Molex_MicroClasp_55935-0530_1x05_P2.00mm_Horizontal","Connector_Molex/Molex_MicroClasp_55935-0610_1x06_P2.00mm_Horizontal","Connector_Molex/Molex_MicroClasp_55935-0630_1x06_P2.00mm_Horizontal","Connector_Molex/Molex_MicroClasp_55935-0710_1x07_P2.00mm_Horizontal","Connector_Molex/Molex_MicroClasp_55935-0730_1x07_P2.00mm_Horizontal","Connector_Molex/Molex_MicroClasp_55935-0810_1x08_P2.00mm_Horizontal","Connector_Molex/Molex_MicroClasp_55935-0830_1x08_P2.00mm_Horizontal","Connector_Molex/Molex_MicroClasp_55935-0910_1x09_P2.00mm_Horizontal","Connector_Molex/Molex_MicroClasp_55935-0930_1x09_P2.00mm_Horizontal","Connector_Molex/Molex_MicroClasp_55935-1010_1x10_P2.00mm_Horizontal","Connector_Molex/Molex_MicroClasp_55935-1030_1x10_P2.00mm_Horizontal","Connector_Molex/Molex_MicroClasp_55935-1110_1x11_P2.00mm_Horizontal","Connector_Molex/Molex_MicroClasp_55935-1130_1x11_P2.00mm_Horizontal","Connector_Molex/Molex_MicroClasp_55935-1210_1x12_P2.00mm_Horizontal","Connector_Molex/Molex_MicroClasp_55935-1230_1x12_P2.00mm_Horizontal","Connector_Molex/Molex_MicroClasp_55935-1310_1x13_P2.00mm_Horizontal","Connector_Molex/Molex_MicroClasp_55935-1330_1x13_P2.00mm_Horizontal","Connector_Molex/Molex_MicroClasp_55935-1410_1x14_P2.00mm_Horizontal","Connector_Molex/Molex_MicroClasp_55935-1430_1x14_P2.00mm_Horizontal","Connector_Molex/Molex_MicroClasp_55935-1510_1x15_P2.00mm_Horizontal","Connector_Molex/Molex_MicroClasp_55935-1530_1x15_P2.00mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Jr_5566-02A2_2x01_P4.20mm_Vertical","Connector_Molex/Molex_Mini-Fit_Jr_5566-02A_2x01_P4.20mm_Vertical","Connector_Molex/Molex_Mini-Fit_Jr_5566-04A2_2x02_P4.20mm_Vertical","Connector_Molex/Molex_Mini-Fit_Jr_5566-04A_2x02_P4.20mm_Vertical","Connector_Molex/Molex_Mini-Fit_Jr_5566-06A2_2x03_P4.20mm_Vertical","Connector_Molex/Molex_Mini-Fit_Jr_5566-06A_2x03_P4.20mm_Vertical","Connector_Molex/Molex_Mini-Fit_Jr_5566-08A2_2x04_P4.20mm_Vertical","Connector_Molex/Molex_Mini-Fit_Jr_5566-08A_2x04_P4.20mm_Vertical","Connector_Molex/Molex_Mini-Fit_Jr_5566-10A2_2x05_P4.20mm_Vertical","Connector_Molex/Molex_Mini-Fit_Jr_5566-10A_2x05_P4.20mm_Vertical","Connector_Molex/Molex_Mini-Fit_Jr_5566-12A2_2x06_P4.20mm_Vertical","Connector_Molex/Molex_Mini-Fit_Jr_5566-12A_2x06_P4.20mm_Vertical","Connector_Molex/Molex_Mini-Fit_Jr_5566-14A2_2x07_P4.20mm_Vertical","Connector_Molex/Molex_Mini-Fit_Jr_5566-14A_2x07_P4.20mm_Vertical","Connector_Molex/Molex_Mini-Fit_Jr_5566-16A2_2x08_P4.20mm_Vertical","Connector_Molex/Molex_Mini-Fit_Jr_5566-16A_2x08_P4.20mm_Vertical","Connector_Molex/Molex_Mini-Fit_Jr_5566-18A2_2x09_P4.20mm_Vertical","Connector_Molex/Molex_Mini-Fit_Jr_5566-18A_2x09_P4.20mm_Vertical","Connector_Molex/Molex_Mini-Fit_Jr_5566-20A2_2x10_P4.20mm_Vertical","Connector_Molex/Molex_Mini-Fit_Jr_5566-20A_2x10_P4.20mm_Vertical","Connector_Molex/Molex_Mini-Fit_Jr_5566-22A2_2x11_P4.20mm_Vertical","Connector_Molex/Molex_Mini-Fit_Jr_5566-22A_2x11_P4.20mm_Vertical","Connector_Molex/Molex_Mini-Fit_Jr_5566-24A2_2x12_P4.20mm_Vertical","Connector_Molex/Molex_Mini-Fit_Jr_5566-24A_2x12_P4.20mm_Vertical","Connector_Molex/Molex_Mini-Fit_Jr_5569-02A1_2x01_P4.20mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Jr_5569-02A2_2x01_P4.20mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Jr_5569-04A1_2x02_P4.20mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Jr_5569-04A2_2x02_P4.20mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Jr_5569-06A1_2x03_P4.20mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Jr_5569-06A2_2x03_P4.20mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Jr_5569-08A1_2x04_P4.20mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Jr_5569-08A2_2x04_P4.20mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Jr_5569-10A1_2x05_P4.20mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Jr_5569-10A2_2x05_P4.20mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Jr_5569-12A1_2x06_P4.20mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Jr_5569-12A2_2x06_P4.20mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Jr_5569-14A1_2x07_P4.20mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Jr_5569-14A2_2x07_P4.20mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Jr_5569-16A1_2x08_P4.20mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Jr_5569-16A2_2x08_P4.20mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Jr_5569-18A1_2x09_P4.20mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Jr_5569-18A2_2x09_P4.20mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Jr_5569-20A1_2x10_P4.20mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Jr_5569-20A2_2x10_P4.20mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Jr_5569-22A1_2x11_P4.20mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Jr_5569-22A2_2x11_P4.20mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Jr_5569-24A1_2x12_P4.20mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Jr_5569-24A2_2x12_P4.20mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Sr_42819-22XX_1x02_P10.00mm_Vertical","Connector_Molex/Molex_Mini-Fit_Sr_42819-22XX_1x02_P10.00mm_Vertical_ThermalVias","Connector_Molex/Molex_Mini-Fit_Sr_42819-32XX_1x03_P10.00mm_Vertical","Connector_Molex/Molex_Mini-Fit_Sr_42819-32XX_1x03_P10.00mm_Vertical_ThermalVias","Connector_Molex/Molex_Mini-Fit_Sr_42819-42XX_1x04_P10.00mm_Vertical","Connector_Molex/Molex_Mini-Fit_Sr_42819-42XX_1x04_P10.00mm_Vertical_ThermalVias","Connector_Molex/Molex_Mini-Fit_Sr_42819-52XX_1x05_P10.00mm_Vertical","Connector_Molex/Molex_Mini-Fit_Sr_42819-52XX_1x05_P10.00mm_Vertical_ThermalVias","Connector_Molex/Molex_Mini-Fit_Sr_42819-62XX_1x06_P10.00mm_Vertical","Connector_Molex/Molex_Mini-Fit_Sr_42819-62XX_1x06_P10.00mm_Vertical_ThermalVias","Connector_Molex/Molex_Mini-Fit_Sr_42820-22XX_1x02_P10.00mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Sr_42820-22XX_1x02_P10.00mm_Horizontal_ThermalVias","Connector_Molex/Molex_Mini-Fit_Sr_42820-32XX_1x03_P10.00mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Sr_42820-32XX_1x03_P10.00mm_Horizontal_ThermalVias","Connector_Molex/Molex_Mini-Fit_Sr_42820-42XX_1x04_P10.00mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Sr_42820-42XX_1x04_P10.00mm_Horizontal_ThermalVias","Connector_Molex/Molex_Mini-Fit_Sr_42820-52XX_1x05_P10.00mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Sr_42820-52XX_1x05_P10.00mm_Horizontal_ThermalVias","Connector_Molex/Molex_Mini-Fit_Sr_42820-62XX_1x06_P10.00mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Sr_42820-62XX_1x06_P10.00mm_Horizontal_ThermalVias","Connector_Molex/Molex_Mini-Fit_Sr_43915-xx06_2x03_P10.00mm_Vertical","Connector_Molex/Molex_Mini-Fit_Sr_43915-xx06_2x03_P10.00mm_Vertical_ThermalVias","Connector_Molex/Molex_Mini-Fit_Sr_43915-xx08_2x04_P10.00mm_Vertical","Connector_Molex/Molex_Mini-Fit_Sr_43915-xx08_2x04_P10.00mm_Vertical_ThermalVias","Connector_Molex/Molex_Mini-Fit_Sr_43915-xx10_2x05_P10.00mm_Vertical","Connector_Molex/Molex_Mini-Fit_Sr_43915-xx10_2x05_P10.00mm_Vertical_ThermalVias","Connector_Molex/Molex_Mini-Fit_Sr_43915-xx12_2x06_P10.00mm_Vertical","Connector_Molex/Molex_Mini-Fit_Sr_43915-xx12_2x06_P10.00mm_Vertical_ThermalVias","Connector_Molex/Molex_Mini-Fit_Sr_43915-xx14_2x07_P10.00mm_Vertical","Connector_Molex/Molex_Mini-Fit_Sr_43915-xx14_2x07_P10.00mm_Vertical_ThermalVias","Connector_Molex/Molex_Nano-Fit_105309-xx02_1x02_P2.50mm_Vertical","Connector_Molex/Molex_Nano-Fit_105309-xx03_1x03_P2.50mm_Vertical","Connector_Molex/Molex_Nano-Fit_105309-xx04_1x04_P2.50mm_Vertical","Connector_Molex/Molex_Nano-Fit_105309-xx05_1x05_P2.50mm_Vertical","Connector_Molex/Molex_Nano-Fit_105309-xx06_1x06_P2.50mm_Vertical","Connector_Molex/Molex_Nano-Fit_105309-xx07_1x07_P2.50mm_Vertical","Connector_Molex/Molex_Nano-Fit_105309-xx08_1x08_P2.50mm_Vertical","Connector_Molex/Molex_Nano-Fit_105310-xx04_2x02_P2.50mm_Vertical","Connector_Molex/Molex_Nano-Fit_105310-xx06_2x03_P2.50mm_Vertical","Connector_Molex/Molex_Nano-Fit_105310-xx08_2x04_P2.50mm_Vertical","Connector_Molex/Molex_Nano-Fit_105310-xx10_2x05_P2.50mm_Vertical","Connector_Molex/Molex_Nano-Fit_105310-xx12_2x06_P2.50mm_Vertical","Connector_Molex/Molex_Nano-Fit_105310-xx14_2x07_P2.50mm_Vertical","Connector_Molex/Molex_Nano-Fit_105310-xx16_2x08_P2.50mm_Vertical","Connector_Molex/Molex_Nano-Fit_105313-xx02_1x02_P2.50mm_Horizontal","Connector_Molex/Molex_Nano-Fit_105313-xx03_1x03_P2.50mm_Horizontal","Connector_Molex/Molex_Nano-Fit_105313-xx04_1x04_P2.50mm_Horizontal","Connector_Molex/Molex_Nano-Fit_105313-xx05_1x05_P2.50mm_Horizontal","Connector_Molex/Molex_Nano-Fit_105313-xx06_1x06_P2.50mm_Horizontal","Connector_Molex/Molex_Nano-Fit_105313-xx07_1x07_P2.50mm_Horizontal","Connector_Molex/Molex_Nano-Fit_105313-xx08_1x08_P2.50mm_Horizontal","Connector_Molex/Molex_Nano-Fit_105314-xx04_2x02_P2.50mm_Horizontal","Connector_Molex/Molex_Nano-Fit_105314-xx06_2x03_P2.50mm_Horizontal","Connector_Molex/Molex_Nano-Fit_105314-xx08_2x04_P2.50mm_Horizontal","Connector_Molex/Molex_Nano-Fit_105314-xx10_2x05_P2.50mm_Horizontal","Connector_Molex/Molex_Nano-Fit_105314-xx12_2x06_P2.50mm_Horizontal","Connector_Molex/Molex_Nano-Fit_105314-xx14_2x07_P2.50mm_Horizontal","Connector_Molex/Molex_Nano-Fit_105314-xx16_2x08_P2.50mm_Horizontal","Connector_Molex/Molex_Panelmate_53780-0270_1x02-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_Panelmate_53780-0370_1x03-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_Panelmate_53780-0470_1x04-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_Panelmate_53780-0570_1x05-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_Panelmate_53780-0670_1x06-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_Panelmate_53780-0770_1x07-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_Panelmate_53780-0870_1x08-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_Panelmate_53780-0970_1x09-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_Panelmate_53780-1070_1x10-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_Panelmate_53780-1270_1x12-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_Panelmate_53780-1470_1x14-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_Panelmate_53780-1570_1x15-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_Panelmate_53780-1870_1x18-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_Panelmate_53780-3070_1x30-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_Pico-Clasp_202396-0207_1x02-1MP_P1.00mm_Horizontal","Connector_Molex/Molex_Pico-Clasp_202396-0307_1x03-1MP_P1.00mm_Horizontal","Connector_Molex/Molex_Pico-Clasp_202396-0407_1x04-1MP_P1.00mm_Horizontal","Connector_Molex/Molex_Pico-Clasp_202396-0507_1x05-1MP_P1.00mm_Horizontal","Connector_Molex/Molex_Pico-Clasp_202396-0607_1x06-1MP_P1.00mm_Horizontal","Connector_Molex/Molex_Pico-Clasp_202396-0707_1x07-1MP_P1.00mm_Horizontal","Connector_Molex/Molex_Pico-Clasp_202396-0807_1x08-1MP_P1.00mm_Horizontal","Connector_Molex/Molex_Pico-Clasp_202396-0907_1x09-1MP_P1.00mm_Horizontal","Connector_Molex/Molex_Pico-Clasp_202396-1007_1x10-1MP_P1.00mm_Horizontal","Connector_Molex/Molex_Pico-Clasp_202396-1107_1x11-1MP_P1.00mm_Horizontal","Connector_Molex/Molex_Pico-Clasp_202396-1207_1x12-1MP_P1.00mm_Horizontal","Connector_Molex/Molex_Pico-Clasp_202396-1307_1x13-1MP_P1.00mm_Horizontal","Connector_Molex/Molex_Pico-Clasp_202396-1407_1x14-1MP_P1.00mm_Horizontal","Connector_Molex/Molex_Pico-Clasp_202396-1507_1x15-1MP_P1.00mm_Horizontal","Connector_Molex/Molex_Pico-Clasp_501331-0207_1x02-1MP_P1.00mm_Vertical","Connector_Molex/Molex_Pico-Clasp_501331-0307_1x03-1MP_P1.00mm_Vertical","Connector_Molex/Molex_Pico-Clasp_501331-0407_1x04-1MP_P1.00mm_Vertical","Connector_Molex/Molex_Pico-Clasp_501331-0507_1x05-1MP_P1.00mm_Vertical","Connector_Molex/Molex_Pico-Clasp_501331-0607_1x06-1MP_P1.00mm_Vertical","Connector_Molex/Molex_Pico-Clasp_501331-0707_1x07-1MP_P1.00mm_Vertical","Connector_Molex/Molex_Pico-Clasp_501331-0807_1x08-1MP_P1.00mm_Vertical","Connector_Molex/Molex_Pico-Clasp_501331-0907_1x09-1MP_P1.00mm_Vertical","Connector_Molex/Molex_Pico-Clasp_501331-1007_1x10-1MP_P1.00mm_Vertical","Connector_Molex/Molex_Pico-Clasp_501331-1107_1x11-1MP_P1.00mm_Vertical","Connector_Molex/Molex_Pico-Clasp_501331-1207_1x12-1MP_P1.00mm_Vertical","Connector_Molex/Molex_Pico-Clasp_501331-1307_1x13-1MP_P1.00mm_Vertical","Connector_Molex/Molex_Pico-Clasp_501331-1407_1x14-1MP_P1.00mm_Vertical","Connector_Molex/Molex_Pico-Clasp_501331-1507_1x15-1MP_P1.00mm_Vertical","Connector_Molex/Molex_Pico-EZmate_78171-0002_1x02-1MP_P1.20mm_Vertical","Connector_Molex/Molex_Pico-EZmate_78171-0003_1x03-1MP_P1.20mm_Vertical","Connector_Molex/Molex_Pico-EZmate_78171-0004_1x04-1MP_P1.20mm_Vertical","Connector_Molex/Molex_Pico-EZmate_78171-0005_1x05-1MP_P1.20mm_Vertical","Connector_Molex/Molex_Pico-EZmate_Slim_202656-0021_1x02-1MP_P1.20mm_Vertical","Connector_Molex/Molex_Pico-Lock_205338-0002_1x02-1MP_P2.00mm_Horizontal","Connector_Molex/Molex_Pico-Lock_205338-0004_1x04-1MP_P2.00mm_Horizontal","Connector_Molex/Molex_Pico-Lock_205338-0006_1x06-1MP_P2.00mm_Horizontal","Connector_Molex/Molex_Pico-Lock_205338-0008_1x08-1MP_P2.00mm_Horizontal","Connector_Molex/Molex_Pico-Lock_205338-0010_1x10-1MP_P2.00mm_Horizontal","Connector_Molex/Molex_Pico-Lock_504050-0291_1x02-1MP_P1.50mm_Horizontal","Connector_Molex/Molex_Pico-Lock_504050-0391_1x03-1MP_P1.50mm_Horizontal","Connector_Molex/Molex_Pico-Lock_504050-0491_1x04-1MP_P1.50mm_Horizontal","Connector_Molex/Molex_Pico-Lock_504050-0591_1x05-1MP_P1.50mm_Horizontal","Connector_Molex/Molex_Pico-Lock_504050-0691_1x06-1MP_P1.50mm_Horizontal","Connector_Molex/Molex_Pico-Lock_504050-0791_1x07-1MP_P1.50mm_Horizontal","Connector_Molex/Molex_Pico-Lock_504050-0891_1x08-1MP_P1.50mm_Horizontal","Connector_Molex/Molex_Pico-Lock_504050-0991_1x09-1MP_P1.50mm_Horizontal","Connector_Molex/Molex_Pico-Lock_504050-1091_1x10-1MP_P1.50mm_Horizontal","Connector_Molex/Molex_Pico-Lock_504050-1191_1x11-1MP_P1.50mm_Horizontal","Connector_Molex/Molex_Pico-Lock_504050-1291_1x12-1MP_P1.50mm_Horizontal","Connector_Molex/Molex_Pico-SPOX_87437-1443_1x14-P1.5mm_Vertical","Connector_Molex/Molex_PicoBlade_53047-0210_1x02_P1.25mm_Vertical","Connector_Molex/Molex_PicoBlade_53047-0310_1x03_P1.25mm_Vertical","Connector_Molex/Molex_PicoBlade_53047-0410_1x04_P1.25mm_Vertical","Connector_Molex/Molex_PicoBlade_53047-0510_1x05_P1.25mm_Vertical","Connector_Molex/Molex_PicoBlade_53047-0610_1x06_P1.25mm_Vertical","Connector_Molex/Molex_PicoBlade_53047-0710_1x07_P1.25mm_Vertical","Connector_Molex/Molex_PicoBlade_53047-0810_1x08_P1.25mm_Vertical","Connector_Molex/Molex_PicoBlade_53047-0910_1x09_P1.25mm_Vertical","Connector_Molex/Molex_PicoBlade_53047-1010_1x10_P1.25mm_Vertical","Connector_Molex/Molex_PicoBlade_53047-1110_1x11_P1.25mm_Vertical","Connector_Molex/Molex_PicoBlade_53047-1210_1x12_P1.25mm_Vertical","Connector_Molex/Molex_PicoBlade_53047-1310_1x13_P1.25mm_Vertical","Connector_Molex/Molex_PicoBlade_53047-1410_1x14_P1.25mm_Vertical","Connector_Molex/Molex_PicoBlade_53047-1510_1x15_P1.25mm_Vertical","Connector_Molex/Molex_PicoBlade_53048-0210_1x02_P1.25mm_Horizontal","Connector_Molex/Molex_PicoBlade_53048-0310_1x03_P1.25mm_Horizontal","Connector_Molex/Molex_PicoBlade_53048-0410_1x04_P1.25mm_Horizontal","Connector_Molex/Molex_PicoBlade_53048-0510_1x05_P1.25mm_Horizontal","Connector_Molex/Molex_PicoBlade_53048-0610_1x06_P1.25mm_Horizontal","Connector_Molex/Molex_PicoBlade_53048-0710_1x07_P1.25mm_Horizontal","Connector_Molex/Molex_PicoBlade_53048-0810_1x08_P1.25mm_Horizontal","Connector_Molex/Molex_PicoBlade_53048-0910_1x09_P1.25mm_Horizontal","Connector_Molex/Molex_PicoBlade_53048-1010_1x10_P1.25mm_Horizontal","Connector_Molex/Molex_PicoBlade_53048-1110_1x11_P1.25mm_Horizontal","Connector_Molex/Molex_PicoBlade_53048-1210_1x12_P1.25mm_Horizontal","Connector_Molex/Molex_PicoBlade_53048-1310_1x13_P1.25mm_Horizontal","Connector_Molex/Molex_PicoBlade_53048-1410_1x14_P1.25mm_Horizontal","Connector_Molex/Molex_PicoBlade_53048-1510_1x15_P1.25mm_Horizontal","Connector_Molex/Molex_PicoBlade_53261-0271_1x02-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_PicoBlade_53261-0371_1x03-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_PicoBlade_53261-0471_1x04-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_PicoBlade_53261-0571_1x05-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_PicoBlade_53261-0671_1x06-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_PicoBlade_53261-0771_1x07-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_PicoBlade_53261-0871_1x08-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_PicoBlade_53261-0971_1x09-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_PicoBlade_53261-1071_1x10-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_PicoBlade_53261-1171_1x11-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_PicoBlade_53261-1271_1x12-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_PicoBlade_53261-1371_1x13-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_PicoBlade_53261-1471_1x14-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_PicoBlade_53261-1571_1x15-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_PicoBlade_53261-1771_1x17-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_PicoBlade_53398-0271_1x02-1MP_P1.25mm_Vertical","Connector_Molex/Molex_PicoBlade_53398-0371_1x03-1MP_P1.25mm_Vertical","Connector_Molex/Molex_PicoBlade_53398-0471_1x04-1MP_P1.25mm_Vertical","Connector_Molex/Molex_PicoBlade_53398-0571_1x05-1MP_P1.25mm_Vertical","Connector_Molex/Molex_PicoBlade_53398-0671_1x06-1MP_P1.25mm_Vertical","Connector_Molex/Molex_PicoBlade_53398-0771_1x07-1MP_P1.25mm_Vertical","Connector_Molex/Molex_PicoBlade_53398-0871_1x08-1MP_P1.25mm_Vertical","Connector_Molex/Molex_PicoBlade_53398-0971_1x09-1MP_P1.25mm_Vertical","Connector_Molex/Molex_PicoBlade_53398-1071_1x10-1MP_P1.25mm_Vertical","Connector_Molex/Molex_PicoBlade_53398-1171_1x11-1MP_P1.25mm_Vertical","Connector_Molex/Molex_PicoBlade_53398-1271_1x12-1MP_P1.25mm_Vertical","Connector_Molex/Molex_PicoBlade_53398-1371_1x13-1MP_P1.25mm_Vertical","Connector_Molex/Molex_PicoBlade_53398-1471_1x14-1MP_P1.25mm_Vertical","Connector_Molex/Molex_PicoBlade_53398-1571_1x15-1MP_P1.25mm_Vertical","Connector_Molex/Molex_Picoflex_90325-0004_2x02_P1.27mm_Vertical","Connector_Molex/Molex_Picoflex_90325-0006_2x03_P1.27mm_Vertical","Connector_Molex/Molex_Picoflex_90325-0008_2x04_P1.27mm_Vertical","Connector_Molex/Molex_Picoflex_90325-0010_2x05_P1.27mm_Vertical","Connector_Molex/Molex_Picoflex_90325-0012_2x06_P1.27mm_Vertical","Connector_Molex/Molex_Picoflex_90325-0014_2x07_P1.27mm_Vertical","Connector_Molex/Molex_Picoflex_90325-0016_2x08_P1.27mm_Vertical","Connector_Molex/Molex_Picoflex_90325-0018_2x09_P1.27mm_Vertical","Connector_Molex/Molex_Picoflex_90325-0020_2x10_P1.27mm_Vertical","Connector_Molex/Molex_Picoflex_90325-0022_2x11_P1.27mm_Vertical","Connector_Molex/Molex_Picoflex_90325-0024_2x12_P1.27mm_Vertical","Connector_Molex/Molex_Picoflex_90325-0026_2x13_P1.27mm_Vertical","Connector_Molex/Molex_Picoflex_90814-0004_2x02_P1.27mm_Vertical","Connector_Molex/Molex_Picoflex_90814-0006_2x03_P1.27mm_Vertical","Connector_Molex/Molex_Picoflex_90814-0008_2x04_P1.27mm_Vertical","Connector_Molex/Molex_Picoflex_90814-0010_2x05_P1.27mm_Vertical","Connector_Molex/Molex_Picoflex_90814-0012_2x06_P1.27mm_Vertical","Connector_Molex/Molex_Picoflex_90814-0014_2x07_P1.27mm_Vertical","Connector_Molex/Molex_Picoflex_90814-0016_2x08_P1.27mm_Vertical","Connector_Molex/Molex_Picoflex_90814-0018_2x09_P1.27mm_Vertical","Connector_Molex/Molex_Picoflex_90814-0020_2x10_P1.27mm_Vertical","Connector_Molex/Molex_Picoflex_90814-0022_2x11_P1.27mm_Vertical","Connector_Molex/Molex_Picoflex_90814-0024_2x12_P1.27mm_Vertical","Connector_Molex/Molex_Picoflex_90814-0026_2x13_P1.27mm_Vertical","Connector_Molex/Molex_SL_171971-0002_1x02_P2.54mm_Vertical","Connector_Molex/Molex_SL_171971-0003_1x03_P2.54mm_Vertical","Connector_Molex/Molex_SL_171971-0004_1x04_P2.54mm_Vertical","Connector_Molex/Molex_SL_171971-0005_1x05_P2.54mm_Vertical","Connector_Molex/Molex_SL_171971-0006_1x06_P2.54mm_Vertical","Connector_Molex/Molex_SL_171971-0007_1x07_P2.54mm_Vertical","Connector_Molex/Molex_SL_171971-0008_1x08_P2.54mm_Vertical","Connector_Molex/Molex_SL_171971-0009_1x09_P2.54mm_Vertical","Connector_Molex/Molex_SL_171971-0010_1x10_P2.54mm_Vertical","Connector_Molex/Molex_SL_171971-0011_1x11_P2.54mm_Vertical","Connector_Molex/Molex_SL_171971-0012_1x12_P2.54mm_Vertical","Connector_Molex/Molex_SL_171971-0013_1x13_P2.54mm_Vertical","Connector_Molex/Molex_SL_171971-0014_1x14_P2.54mm_Vertical","Connector_Molex/Molex_SL_171971-0015_1x15_P2.54mm_Vertical","Connector_Molex/Molex_SL_171971-0016_1x16_P2.54mm_Vertical","Connector_Molex/Molex_SL_171971-0017_1x17_P2.54mm_Vertical","Connector_Molex/Molex_SL_171971-0018_1x18_P2.54mm_Vertical","Connector_Molex/Molex_SL_171971-0019_1x19_P2.54mm_Vertical","Connector_Molex/Molex_SL_171971-0020_1x20_P2.54mm_Vertical","Connector_Molex/Molex_SL_171971-0021_1x21_P2.54mm_Vertical","Connector_Molex/Molex_SL_171971-0022_1x22_P2.54mm_Vertical","Connector_Molex/Molex_SL_171971-0023_1x23_P2.54mm_Vertical","Connector_Molex/Molex_SL_171971-0024_1x24_P2.54mm_Vertical","Connector_Molex/Molex_SL_171971-0025_1x25_P2.54mm_Vertical","Connector_Molex/Molex_SPOX_5267-02A_1x02_P2.50mm_Vertical","Connector_Molex/Molex_SPOX_5267-03A_1x03_P2.50mm_Vertical","Connector_Molex/Molex_SPOX_5267-04A_1x04_P2.50mm_Vertical","Connector_Molex/Molex_SPOX_5267-05A_1x05_P2.50mm_Vertical","Connector_Molex/Molex_SPOX_5267-06A_1x06_P2.50mm_Vertical","Connector_Molex/Molex_SPOX_5267-07A_1x07_P2.50mm_Vertical","Connector_Molex/Molex_SPOX_5267-08A_1x08_P2.50mm_Vertical","Connector_Molex/Molex_SPOX_5267-09A_1x09_P2.50mm_Vertical","Connector_Molex/Molex_SPOX_5267-10A_1x10_P2.50mm_Vertical","Connector_Molex/Molex_SPOX_5267-11A_1x11_P2.50mm_Vertical","Connector_Molex/Molex_SPOX_5267-12A_1x12_P2.50mm_Vertical","Connector_Molex/Molex_SPOX_5267-13A_1x13_P2.50mm_Vertical","Connector_Molex/Molex_SPOX_5267-14A_1x14_P2.50mm_Vertical","Connector_Molex/Molex_SPOX_5267-15A_1x15_P2.50mm_Vertical","Connector_Molex/Molex_SPOX_5268-02A_1x02_P2.50mm_Horizontal","Connector_Molex/Molex_SPOX_5268-03A_1x03_P2.50mm_Horizontal","Connector_Molex/Molex_SPOX_5268-04A_1x04_P2.50mm_Horizontal","Connector_Molex/Molex_SPOX_5268-05A_1x05_P2.50mm_Horizontal","Connector_Molex/Molex_SPOX_5268-06A_1x06_P2.50mm_Horizontal","Connector_Molex/Molex_SPOX_5268-07A_1x07_P2.50mm_Horizontal","Connector_Molex/Molex_SPOX_5268-08A_1x08_P2.50mm_Horizontal","Connector_Molex/Molex_SPOX_5268-09A_1x09_P2.50mm_Horizontal","Connector_Molex/Molex_SPOX_5268-10A_1x10_P2.50mm_Horizontal","Connector_Molex/Molex_SPOX_5268-11A_1x11_P2.50mm_Horizontal","Connector_Molex/Molex_SPOX_5268-12A_1x12_P2.50mm_Horizontal","Connector_Molex/Molex_SPOX_5268-13A_1x13_P2.50mm_Horizontal","Connector_Molex/Molex_SPOX_5268-14A_1x14_P2.50mm_Horizontal","Connector_Molex/Molex_SPOX_5268-15A_1x15_P2.50mm_Horizontal","Connector_Molex/Molex_Sabre_43160-0102_1x02_P7.49mm_Vertical","Connector_Molex/Molex_Sabre_43160-0102_1x02_P7.49mm_Vertical_ThermalVias","Connector_Molex/Molex_Sabre_43160-0103_1x03_P7.49mm_Vertical","Connector_Molex/Molex_Sabre_43160-0103_1x03_P7.49mm_Vertical_ThermalVias","Connector_Molex/Molex_Sabre_43160-0104_1x04_P7.49mm_Vertical","Connector_Molex/Molex_Sabre_43160-0104_1x04_P7.49mm_Vertical_ThermalVias","Connector_Molex/Molex_Sabre_43160-0105_1x05_P7.49mm_Vertical","Connector_Molex/Molex_Sabre_43160-0105_1x05_P7.49mm_Vertical_ThermalVias","Connector_Molex/Molex_Sabre_43160-0106_1x06_P7.49mm_Vertical","Connector_Molex/Molex_Sabre_43160-0106_1x06_P7.49mm_Vertical_ThermalVias","Connector_Molex/Molex_Sabre_43160-1102_1x02_P7.49mm_Horizontal","Connector_Molex/Molex_Sabre_43160-1102_1x02_P7.49mm_Horizontal_ThermalVias","Connector_Molex/Molex_Sabre_43160-1103_1x03_P7.49mm_Horizontal","Connector_Molex/Molex_Sabre_43160-1103_1x03_P7.49mm_Horizontal_ThermalVias","Connector_Molex/Molex_Sabre_43160-1104_1x04_P7.49mm_Horizontal","Connector_Molex/Molex_Sabre_43160-1104_1x04_P7.49mm_Horizontal_ThermalVias","Connector_Molex/Molex_Sabre_43160-1105_1x05_P7.49mm_Horizontal","Connector_Molex/Molex_Sabre_43160-1105_1x05_P7.49mm_Horizontal_ThermalVias","Connector_Molex/Molex_Sabre_43160-1106_1x06_P7.49mm_Horizontal","Connector_Molex/Molex_Sabre_43160-1106_1x06_P7.49mm_Horizontal_ThermalVias","Connector_Molex/Molex_Sabre_43160-2102_1x02_P7.49mm_Vertical","Connector_Molex/Molex_Sabre_43160-2102_1x02_P7.49mm_Vertical_ThermalVias","Connector_Molex/Molex_Sabre_43160-2103_1x03_P7.49mm_Vertical","Connector_Molex/Molex_Sabre_43160-2103_1x03_P7.49mm_Vertical_ThermalVias","Connector_Molex/Molex_Sabre_43160-2104_1x04_P7.49mm_Vertical","Connector_Molex/Molex_Sabre_43160-2104_1x04_P7.49mm_Vertical_ThermalVias","Connector_Molex/Molex_Sabre_43160-2105_1x05_P7.49mm_Vertical","Connector_Molex/Molex_Sabre_43160-2105_1x05_P7.49mm_Vertical_ThermalVias","Connector_Molex/Molex_Sabre_43160-2106_1x06_P7.49mm_Vertical","Connector_Molex/Molex_Sabre_43160-2106_1x06_P7.49mm_Vertical_ThermalVias","Connector_Molex/Molex_Sabre_46007-1102_1x02_P7.49mm_Horizontal","Connector_Molex/Molex_Sabre_46007-1102_1x02_P7.49mm_Horizontal_ThermalVias","Connector_Molex/Molex_Sabre_46007-1103_1x03_P7.49mm_Horizontal","Connector_Molex/Molex_Sabre_46007-1103_1x03_P7.49mm_Horizontal_ThermalVias","Connector_Molex/Molex_Sabre_46007-1104_1x04_P7.49mm_Horizontal","Connector_Molex/Molex_Sabre_46007-1104_1x04_P7.49mm_Horizontal_ThermalVias","Connector_Molex/Molex_Sabre_46007-1105_1x05_P7.49mm_Horizontal","Connector_Molex/Molex_Sabre_46007-1105_1x05_P7.49mm_Horizontal_ThermalVias","Connector_Molex/Molex_Sabre_46007-1106_1x06_P7.49mm_Horizontal","Connector_Molex/Molex_Sabre_46007-1106_1x06_P7.49mm_Horizontal_ThermalVias","Connector_Molex/Molex_SlimStack_501920-3001_2x15_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_501920-4001_2x20_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_501920-5001_2x25_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_502426-0810_2x04_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_502426-1410_2x07_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_502426-2010_2x10_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_502426-2210_2x11_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_502426-2410_2x12_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_502426-2610_2x13_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_502426-3010_2x15_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_502426-3210_2x16_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_502426-3410_2x17_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_502426-4010_2x20_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_502426-4410_2x22_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_502426-5010_2x25_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_502426-6010_2x30_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_502426-6410_2x32_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_502426-8010_2x40_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_502430-0820_2x04_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_502430-1410_2x07_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_502430-2010_2x10_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_502430-2210_2x11_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_502430-2410_2x12_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_502430-2610_2x13_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_502430-3010_2x15_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_502430-3210_2x16_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_502430-3410_2x17_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_502430-4010_2x20_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_502430-4410_2x22_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_502430-5010_2x25_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_502430-6010_2x30_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_502430-6410_2x32_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_502430-8010_2x40_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_52991-0208_2x10_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_52991-0308_2x15_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_52991-0408_2x20_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_52991-0508_2x25_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_52991-0608_2x30_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_52991-0708_2x35_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_52991-0808_2x40_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_53748-0208_2x10_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_53748-0308_2x15_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_53748-0408_2x20_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_53748-0608_2x30_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_53748-0708_2x35_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_53748-0808_2x40_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_54722-0164_2x08_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_54722-0204_2x10_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_54722-0224_2x11_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_54722-0244_2x12_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_54722-0304_2x15_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_54722-0344_2x17_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_54722-0404_2x20_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_54722-0504_2x25_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_54722-0604_2x30_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_54722-0804_2x40_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_55560-0161_2x08_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_55560-0201_2x10_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_55560-0221_2x11_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_55560-0241_2x12_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_55560-0301_2x15_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_55560-0341_2x17_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_55560-0401_2x20_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_55560-0501_2x25_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_55560-0601_2x30_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_55560-0801_2x40_P0.50mm_Vertical","Connector_Molex_Milligrid/Molex_8783204xx_2x02_P2.0mm_Header_Vertical","Connector_Molex_Milligrid/Molex_8783206xx_2x03_P2.0mm_Header_Vertical","Connector_Molex_Milligrid/Molex_8783206xx_2x03_P2.0mm_Header_Vertical_MountingPegs","Connector_Molex_Milligrid/Molex_8783206xx_2x03_P2.0mm_Header_Vertical_Polarized","Connector_Molex_Milligrid/Molex_8783206xx_2x03_P2.0mm_Header_Vertical_Polarized_MountingPegs","Connector_Molex_Milligrid/Molex_8783208xx_2x04_P2.0mm_Header_Vertical","Connector_Molex_Milligrid/Molex_8783208xx_2x04_P2.0mm_Header_Vertical_MountingPegs","Connector_Molex_Milligrid/Molex_8783208xx_2x04_P2.0mm_Header_Vertical_Polarized","Connector_Molex_Milligrid/Molex_8783208xx_2x04_P2.0mm_Header_Vertical_Polarized_MountingPegs","Connector_Molex_Milligrid/Molex_8783210xx_2x05_P2.0mm_Header_Vertical","Connector_Molex_Milligrid/Molex_8783210xx_2x05_P2.0mm_Header_Vertical_MountingPegs","Connector_Molex_Milligrid/Molex_8783210xx_2x05_P2.0mm_Header_Vertical_Polarized","Connector_Molex_Milligrid/Molex_8783210xx_2x05_P2.0mm_Header_Vertical_Polarized_MountingPegs","Connector_Molex_Milligrid/Molex_8783212xx_2x06_P2.0mm_Header_Vertical","Connector_Molex_Milligrid/Molex_8783212xx_2x06_P2.0mm_Header_Vertical_MountingPegs","Connector_Molex_Milligrid/Molex_8783212xx_2x06_P2.0mm_Header_Vertical_Polarized","Connector_Molex_Milligrid/Molex_8783212xx_2x06_P2.0mm_Header_Vertical_Polarized_MountingPegs","Connector_Molex_Milligrid/Molex_8783214xx_2x07_P2.0mm_Header_Vertical_Polarized","Connector_Molex_Milligrid/Molex_8783214xx_2x07_P2.0mm_Header_Vertical_Polarized_MountingPegs","Connector_Molex_Milligrid/Molex_8783216xx_2x08_P2.0mm_Header_Vertical_Polarized","Connector_Molex_Milligrid/Molex_8783216xx_2x08_P2.0mm_Header_Vertical_Polarized_MountingPegs","Connector_Molex_Milligrid/Molex_8783218xx_2x09_P2.0mm_Header_Vertical_Polarized","Connector_Molex_Milligrid/Molex_8783218xx_2x09_P2.0mm_Header_Vertical_Polarized_MountingPegs","Connector_Molex_Milligrid/Molex_8783220xx_2x10_P2.0mm_Header_Vertical_Polarized","Connector_Molex_Milligrid/Molex_8783220xx_2x10_P2.0mm_Header_Vertical_Polarized_MountingPegs","Connector_Molex_Milligrid/Molex_8783222xx_2x11_P2.0mm_Header_Vertical_Polarized","Connector_Molex_Milligrid/Molex_8783222xx_2x11_P2.0mm_Header_Vertical_Polarized_MountingPegs","Connector_Molex_Milligrid/Molex_8783224xx_2x12_P2.0mm_Header_Vertical_Polarized","Connector_Molex_Milligrid/Molex_8783224xx_2x12_P2.0mm_Header_Vertical_Polarized_MountingPegs","Connector_Molex_Milligrid/Molex_8783226xx_2x13_P2.0mm_Header_Vertical_Polarized","Connector_Molex_Milligrid/Molex_8783226xx_2x13_P2.0mm_Header_Vertical_Polarized_MountingPegs","Connector_Molex_Milligrid/Molex_8783228xx_2x14_P2.0mm_Header_Vertical_Polarized","Connector_Molex_Milligrid/Molex_8783228xx_2x14_P2.0mm_Header_Vertical_Polarized_MountingPegs","Connector_Molex_Milligrid/Molex_8783230xx_2x15_P2.0mm_Header_Vertical_Polarized","Connector_Molex_Milligrid/Molex_8783230xx_2x15_P2.0mm_Header_Vertical_Polarized_MountingPegs","Connector_Molex_Milligrid/Molex_8783232xx_2x16_P2.0mm_Header_Vertical_Polarized","Connector_Molex_Milligrid/Molex_8783232xx_2x16_P2.0mm_Header_Vertical_Polarized_MountingPegs","Connector_Molex_Milligrid/Molex_8783234xx_2x17_P2.0mm_Header_Vertical_Polarized","Connector_Molex_Milligrid/Molex_8783234xx_2x17_P2.0mm_Header_Vertical_Polarized_MountingPegs","Connector_Molex_Milligrid/Molex_8783236xx_2x18_P2.0mm_Header_Vertical_Polarized","Connector_Molex_Milligrid/Molex_8783236xx_2x18_P2.0mm_Header_Vertical_Polarized_MountingPegs","Connector_Molex_Milligrid/Molex_8783238xx_2x19_P2.0mm_Header_Vertical_Polarized","Connector_Molex_Milligrid/Molex_8783238xx_2x19_P2.0mm_Header_Vertical_Polarized_MountingPegs","Connector_Molex_Milligrid/Molex_8783240xx_2x20_P2.0mm_Header_Vertical_Polarized","Connector_Molex_Milligrid/Molex_8783240xx_2x20_P2.0mm_Header_Vertical_Polarized_MountingPegs","Connector_Molex_Milligrid/Molex_8783242xx_2x21_P2.0mm_Header_Vertical_Polarized","Connector_Molex_Milligrid/Molex_8783242xx_2x21_P2.0mm_Header_Vertical_Polarized_MountingPegs","Connector_Molex_Milligrid/Molex_8783244xx_2x22_P2.0mm_Header_Vertical_Polarized","Connector_Molex_Milligrid/Molex_8783244xx_2x22_P2.0mm_Header_Vertical_Polarized_MountingPegs","Connector_Molex_Milligrid/Molex_8783246xx_2x23_P2.0mm_Header_Vertical_Polarized","Connector_Molex_Milligrid/Molex_8783246xx_2x23_P2.0mm_Header_Vertical_Polarized_MountingPegs","Connector_Molex_Milligrid/Molex_8783248xx_2x24_P2.0mm_Header_Vertical_Polarized","Connector_Molex_Milligrid/Molex_8783248xx_2x24_P2.0mm_Header_Vertical_Polarized_MountingPegs","Connector_Molex_Milligrid/Molex_8783250xx_2x25_P2.0mm_Header_Vertical_Polarized","Connector_Molex_Milligrid/Molex_8783250xx_2x25_P2.0mm_Header_Vertical_Polarized_MountingPegs","Connector_PCBEdge/4UCON_10156_2x40_P1.27mm_Socket_Horizontal","Connector_PCBEdge/BUS_AT","Connector_PCBEdge/BUS_PCI","Connector_PCBEdge/BUS_PCI_Express_Mini","Connector_PCBEdge/BUS_PCI_Express_Mini_Dual","Connector_PCBEdge/BUS_PCI_Express_Mini_Full","Connector_PCBEdge/BUS_PCI_Express_Mini_Half","Connector_PCBEdge/BUS_PCIexpress_x1","Connector_PCBEdge/BUS_PCIexpress_x16","Connector_PCBEdge/BUS_PCIexpress_x4","Connector_PCBEdge/BUS_PCIexpress_x8","Connector_PCBEdge/DEC_double_long","Connector_PCBEdge/DEC_double_short","Connector_PCBEdge/DEC_quad_long","Connector_PCBEdge/DEC_quad_short","Connector_PCBEdge/DEC_single_long","Connector_PCBEdge/DEC_single_short","Connector_PCBEdge/JAE_MM60-EZH039-Bx_BUS_PCI_Express_Holder","Connector_PCBEdge/JAE_MM60-EZH059-Bx_BUS_PCI_Express_Holder","Connector_PCBEdge/M.2_22110-xx-B","Connector_PCBEdge/M.2_22110-xx-M","Connector_PCBEdge/M.2_2230-xx-A","Connector_PCBEdge/M.2_2230-xx-B","Connector_PCBEdge/M.2_2230-xx-E","Connector_PCBEdge/M.2_2230-xx-M","Connector_PCBEdge/M.2_2242-xx-B","Connector_PCBEdge/M.2_2242-xx-M","Connector_PCBEdge/M.2_2260-xx-B","Connector_PCBEdge/M.2_2260-xx-M","Connector_PCBEdge/M.2_2280-xx-B","Connector_PCBEdge/M.2_2280-xx-M","Connector_PCBEdge/M.2_3030-xx-A","Connector_PCBEdge/M.2_3030-xx-E","Connector_PCBEdge/M.2_3042-xx-B","Connector_PCBEdge/SODIMM-200_1.8V_Card_edge","Connector_PCBEdge/SODIMM-200_2.5V_Card_edge","Connector_PCBEdge/SODIMM-260_DDR4_H4.0-5.2_OrientationStd_Socket","Connector_PCBEdge/Samtec_MECF-05-01-L-DV-WT_2x05_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-05-01-L-DV_2x05_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-05-01-NP-L-DV-WT_2x05_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-05-01-NP-L-DV_2x05_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-05-02-L-DV-WT_2x05_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-05-02-L-DV_2x05_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-05-02-NP-L-DV-WT_2x05_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-05-02-NP-L-DV_2x05_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-05-0_-L-DV_2x05_P1.27mm_Polarized_Edge","Connector_PCBEdge/Samtec_MECF-05-0_-NP-L-DV_2x05_P1.27mm_Edge","Connector_PCBEdge/Samtec_MECF-08-01-L-DV-WT_2x08_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-08-01-L-DV_2x08_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-08-01-NP-L-DV-WT_2x08_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-08-01-NP-L-DV_2x08_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-08-02-L-DV-WT_2x08_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-08-02-L-DV_2x08_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-08-02-NP-L-DV-WT_2x08_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-08-02-NP-L-DV_2x08_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-08-0_-L-DV_2x08_P1.27mm_Polarized_Edge","Connector_PCBEdge/Samtec_MECF-08-0_-NP-L-DV_2x08_P1.27mm_Edge","Connector_PCBEdge/Samtec_MECF-20-01-L-DV-WT_2x20_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-20-01-L-DV_2x20_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-20-01-NP-L-DV-WT_2x20_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-20-01-NP-L-DV_2x20_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-20-02-L-DV-WT_2x20_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-20-02-L-DV_2x20_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-20-02-NP-L-DV-WT_2x20_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-20-02-NP-L-DV_2x20_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-20-0_-L-DV_2x20_P1.27mm_Polarized_Edge","Connector_PCBEdge/Samtec_MECF-20-0_-NP-L-DV_2x20_P1.27mm_Edge","Connector_PCBEdge/Samtec_MECF-30-01-L-DV-WT_2x30_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-30-01-L-DV_2x30_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-30-01-NP-L-DV-WT_2x30_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-30-01-NP-L-DV_2x30_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-30-02-L-DV-WT_2x30_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-30-02-L-DV_2x30_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-30-02-NP-L-DV-WT_2x30_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-30-02-NP-L-DV_2x30_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-30-0_-L-DV_2x30_P1.27mm_Polarized_Edge","Connector_PCBEdge/Samtec_MECF-30-0_-NP-L-DV_2x30_P1.27mm_Edge","Connector_PCBEdge/Samtec_MECF-40-01-L-DV-WT_2x40_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-40-01-L-DV_2x40_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-40-01-NP-L-DV-WT_2x40_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-40-01-NP-L-DV_2x40_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-40-02-L-DV-WT_2x40_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-40-02-L-DV_2x40_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-40-02-NP-L-DV-WT_2x40_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-40-02-NP-L-DV_2x40_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-40-0_-L-DV_2x40_P1.27mm_Polarized_Edge","Connector_PCBEdge/Samtec_MECF-40-0_-NP-L-DV_2x40_P1.27mm_Edge","Connector_PCBEdge/Samtec_MECF-50-01-L-DV-WT_2x50_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-50-01-L-DV_2x50_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-50-01-NP-L-DV-WT_2x50_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-50-01-NP-L-DV_2x50_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-50-02-L-DV-WT_2x50_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-50-02-L-DV_2x50_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-50-02-NP-L-DV-WT_2x50_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-50-02-NP-L-DV_2x50_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-50-0_-L-DV_2x50_P1.27mm_Polarized_Edge","Connector_PCBEdge/Samtec_MECF-50-0_-NP-L-DV_2x50_P1.27mm_Edge","Connector_PCBEdge/Samtec_MECF-60-01-L-DV-WT_2x60_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-60-01-L-DV_2x60_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-60-01-NP-L-DV-WT_2x60_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-60-01-NP-L-DV_2x60_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-60-02-L-DV-WT_2x60_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-60-02-L-DV_2x60_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-60-02-NP-L-DV-WT_2x60_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-60-02-NP-L-DV_2x60_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-60-0_-L-DV_2x60_P1.27mm_Polarized_Edge","Connector_PCBEdge/Samtec_MECF-60-0_-NP-L-DV_2x60_P1.27mm_Edge","Connector_PCBEdge/Samtec_MECF-70-01-L-DV-WT_2x70_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-70-01-L-DV_2x70_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-70-01-NP-L-DV-WT_2x70_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-70-01-NP-L-DV_2x70_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-70-02-L-DV-WT_2x70_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-70-02-L-DV_2x70_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-70-02-NP-L-DV-WT_2x70_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-70-02-NP-L-DV_2x70_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-70-0_-L-DV_2x70_P1.27mm_Polarized_Edge","Connector_PCBEdge/Samtec_MECF-70-0_-NP-L-DV_2x70_P1.27mm_Edge","Connector_PCBEdge/molex_EDGELOCK_2-CKT","Connector_PCBEdge/molex_EDGELOCK_4-CKT","Connector_PCBEdge/molex_EDGELOCK_6-CKT","Connector_PCBEdge/molex_EDGELOCK_8-CKT","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBA_2,5_10-G-7,62_1x10_P7.62mm_Horizontal","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBA_2,5_10-G_1x10_P7.50mm_Horizontal","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBA_2,5_11-G-7,62_1x11_P7.62mm_Horizontal","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBA_2,5_11-G_1x11_P7.50mm_Horizontal","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBA_2,5_12-G-7,62_1x12_P7.62mm_Horizontal","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBA_2,5_12-G_1x12_P7.50mm_Horizontal","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBA_2,5_2-G-7,62_1x02_P7.62mm_Horizontal","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBA_2,5_2-G_1x02_P7.50mm_Horizontal","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBA_2,5_3-G-7,62_1x03_P7.62mm_Horizontal","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBA_2,5_3-G_1x03_P7.50mm_Horizontal","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBA_2,5_4-G-7,62_1x04_P7.62mm_Horizontal","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBA_2,5_4-G_1x04_P7.50mm_Horizontal","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBA_2,5_5-G-7,62_1x05_P7.62mm_Horizontal","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBA_2,5_5-G_1x05_P7.50mm_Horizontal","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBA_2,5_6-G-7,62_1x06_P7.62mm_Horizontal","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBA_2,5_6-G_1x06_P7.50mm_Horizontal","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBA_2,5_7-G-7,62_1x07_P7.62mm_Horizontal","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBA_2,5_7-G_1x07_P7.50mm_Horizontal","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBA_2,5_8-G-7,62_1x08_P7.62mm_Horizontal","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBA_2,5_8-G_1x08_P7.50mm_Horizontal","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBA_2,5_9-G-7,62_1x09_P7.62mm_Horizontal","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBA_2,5_9-G_1x09_P7.50mm_Horizontal","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBVA_2,5_10-G-7,62_1x10_P7.62mm_Vertical","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBVA_2,5_10-G_1x10_P7.50mm_Vertical","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBVA_2,5_11-G-7,62_1x11_P7.62mm_Vertical","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBVA_2,5_11-G_1x11_P7.50mm_Vertical","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBVA_2,5_12-G-7,62_1x12_P7.62mm_Vertical","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBVA_2,5_12-G_1x12_P7.50mm_Vertical","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBVA_2,5_2-G-7,62_1x02_P7.62mm_Vertical","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBVA_2,5_2-G_1x02_P7.50mm_Vertical","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBVA_2,5_3-G-7,62_1x03_P7.62mm_Vertical","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBVA_2,5_3-G_1x03_P7.50mm_Vertical","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBVA_2,5_4-G-7,62_1x04_P7.62mm_Vertical","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBVA_2,5_4-G_1x04_P7.50mm_Vertical","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBVA_2,5_5-G-7,62_1x05_P7.62mm_Vertical","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBVA_2,5_5-G_1x05_P7.50mm_Vertical","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBVA_2,5_6-G-7,62_1x06_P7.62mm_Vertical","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBVA_2,5_6-G_1x06_P7.50mm_Vertical","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBVA_2,5_7-G-7,62_1x07_P7.62mm_Vertical","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBVA_2,5_7-G_1x07_P7.50mm_Vertical","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBVA_2,5_8-G-7,62_1x08_P7.62mm_Vertical","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBVA_2,5_8-G_1x08_P7.50mm_Vertical","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBVA_2,5_9-G-7,62_1x09_P7.62mm_Vertical","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBVA_2,5_9-G_1x09_P7.50mm_Vertical","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBV_2,5_10-GF-7,62_1x10_P7.62mm_Vertical_ThreadedFlange","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBV_2,5_10-GF-7,62_1x10_P7.62mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBV_2,5_11-GF-7,62_1x11_P7.62mm_Vertical_ThreadedFlange","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBV_2,5_11-GF-7,62_1x11_P7.62mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBV_2,5_12-GF-7,62_1x12_P7.62mm_Vertical_ThreadedFlange","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBV_2,5_12-GF-7,62_1x12_P7.62mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBV_2,5_2-GF-7,62_1x02_P7.62mm_Vertical_ThreadedFlange","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBV_2,5_2-GF-7,62_1x02_P7.62mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBV_2,5_3-GF-7,62_1x03_P7.62mm_Vertical_ThreadedFlange","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBV_2,5_3-GF-7,62_1x03_P7.62mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBV_2,5_4-GF-7,62_1x04_P7.62mm_Vertical_ThreadedFlange","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBV_2,5_4-GF-7,62_1x04_P7.62mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBV_2,5_5-GF-7,62_1x05_P7.62mm_Vertical_ThreadedFlange","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBV_2,5_5-GF-7,62_1x05_P7.62mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBV_2,5_6-GF-7,62_1x06_P7.62mm_Vertical_ThreadedFlange","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBV_2,5_6-GF-7,62_1x06_P7.62mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBV_2,5_7-GF-7,62_1x07_P7.62mm_Vertical_ThreadedFlange","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBV_2,5_7-GF-7,62_1x07_P7.62mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBV_2,5_8-GF-7,62_1x08_P7.62mm_Vertical_ThreadedFlange","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBV_2,5_8-GF-7,62_1x08_P7.62mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBV_2,5_9-GF-7,62_1x09_P7.62mm_Vertical_ThreadedFlange","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBV_2,5_9-GF-7,62_1x09_P7.62mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_GMSTB/PhoenixContact_GMSTB_2,5_10-GF-7,62_1x10_P7.62mm_Horizontal_ThreadedFlange","Connector_Phoenix_GMSTB/PhoenixContact_GMSTB_2,5_10-GF-7,62_1x10_P7.62mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_GMSTB/PhoenixContact_GMSTB_2,5_11-GF-7,62_1x11_P7.62mm_Horizontal_ThreadedFlange","Connector_Phoenix_GMSTB/PhoenixContact_GMSTB_2,5_11-GF-7,62_1x11_P7.62mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_GMSTB/PhoenixContact_GMSTB_2,5_12-GF-7,62_1x12_P7.62mm_Horizontal_ThreadedFlange","Connector_Phoenix_GMSTB/PhoenixContact_GMSTB_2,5_12-GF-7,62_1x12_P7.62mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_GMSTB/PhoenixContact_GMSTB_2,5_2-GF-7,62_1x02_P7.62mm_Horizontal_ThreadedFlange","Connector_Phoenix_GMSTB/PhoenixContact_GMSTB_2,5_2-GF-7,62_1x02_P7.62mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_GMSTB/PhoenixContact_GMSTB_2,5_3-GF-7,62_1x03_P7.62mm_Horizontal_ThreadedFlange","Connector_Phoenix_GMSTB/PhoenixContact_GMSTB_2,5_3-GF-7,62_1x03_P7.62mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_GMSTB/PhoenixContact_GMSTB_2,5_4-GF-7,62_1x04_P7.62mm_Horizontal_ThreadedFlange","Connector_Phoenix_GMSTB/PhoenixContact_GMSTB_2,5_4-GF-7,62_1x04_P7.62mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_GMSTB/PhoenixContact_GMSTB_2,5_5-GF-7,62_1x05_P7.62mm_Horizontal_ThreadedFlange","Connector_Phoenix_GMSTB/PhoenixContact_GMSTB_2,5_5-GF-7,62_1x05_P7.62mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_GMSTB/PhoenixContact_GMSTB_2,5_6-GF-7,62_1x06_P7.62mm_Horizontal_ThreadedFlange","Connector_Phoenix_GMSTB/PhoenixContact_GMSTB_2,5_6-GF-7,62_1x06_P7.62mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_GMSTB/PhoenixContact_GMSTB_2,5_7-GF-7,62_1x07_P7.62mm_Horizontal_ThreadedFlange","Connector_Phoenix_GMSTB/PhoenixContact_GMSTB_2,5_7-GF-7,62_1x07_P7.62mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_GMSTB/PhoenixContact_GMSTB_2,5_8-GF-7,62_1x08_P7.62mm_Horizontal_ThreadedFlange","Connector_Phoenix_GMSTB/PhoenixContact_GMSTB_2,5_8-GF-7,62_1x08_P7.62mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_GMSTB/PhoenixContact_GMSTB_2,5_9-GF-7,62_1x09_P7.62mm_Horizontal_ThreadedFlange","Connector_Phoenix_GMSTB/PhoenixContact_GMSTB_2,5_9-GF-7,62_1x09_P7.62mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_10-G-3.5_1x10_P3.50mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_10-G-3.81_1x10_P3.81mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_10-GF-3.5_1x10_P3.50mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_10-GF-3.5_1x10_P3.50mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_10-GF-3.81_1x10_P3.81mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_10-GF-3.81_1x10_P3.81mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_11-G-3.5_1x11_P3.50mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_11-G-3.81_1x11_P3.81mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_11-GF-3.5_1x11_P3.50mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_11-GF-3.5_1x11_P3.50mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_11-GF-3.81_1x11_P3.81mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_11-GF-3.81_1x11_P3.81mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_12-G-3.5_1x12_P3.50mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_12-G-3.81_1x12_P3.81mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_12-GF-3.5_1x12_P3.50mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_12-GF-3.5_1x12_P3.50mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_12-GF-3.81_1x12_P3.81mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_12-GF-3.81_1x12_P3.81mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_13-G-3.5_1x13_P3.50mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_13-G-3.81_1x13_P3.81mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_13-GF-3.5_1x13_P3.50mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_13-GF-3.5_1x13_P3.50mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_13-GF-3.81_1x13_P3.81mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_13-GF-3.81_1x13_P3.81mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_14-G-3.5_1x14_P3.50mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_14-G-3.81_1x14_P3.81mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_14-GF-3.5_1x14_P3.50mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_14-GF-3.5_1x14_P3.50mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_14-GF-3.81_1x14_P3.81mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_14-GF-3.81_1x14_P3.81mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_15-G-3.5_1x15_P3.50mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_15-G-3.81_1x15_P3.81mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_15-GF-3.5_1x15_P3.50mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_15-GF-3.5_1x15_P3.50mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_15-GF-3.81_1x15_P3.81mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_15-GF-3.81_1x15_P3.81mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_16-G-3.5_1x16_P3.50mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_16-G-3.81_1x16_P3.81mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_16-GF-3.5_1x16_P3.50mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_16-GF-3.5_1x16_P3.50mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_16-GF-3.81_1x16_P3.81mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_16-GF-3.81_1x16_P3.81mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_2-G-3.5_1x02_P3.50mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_2-G-3.81_1x02_P3.81mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_2-GF-3.5_1x02_P3.50mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_2-GF-3.5_1x02_P3.50mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_2-GF-3.81_1x02_P3.81mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_2-GF-3.81_1x02_P3.81mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_3-G-3.5_1x03_P3.50mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_3-G-3.81_1x03_P3.81mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_3-GF-3.5_1x03_P3.50mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_3-GF-3.5_1x03_P3.50mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_3-GF-3.81_1x03_P3.81mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_3-GF-3.81_1x03_P3.81mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_4-G-3.5_1x04_P3.50mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_4-G-3.81_1x04_P3.81mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_4-GF-3.5_1x04_P3.50mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_4-GF-3.5_1x04_P3.50mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_4-GF-3.81_1x04_P3.81mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_4-GF-3.81_1x04_P3.81mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_5-G-3.5_1x05_P3.50mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_5-G-3.81_1x05_P3.81mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_5-GF-3.5_1x05_P3.50mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_5-GF-3.5_1x05_P3.50mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_5-GF-3.81_1x05_P3.81mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_5-GF-3.81_1x05_P3.81mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_6-G-3.5_1x06_P3.50mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_6-G-3.81_1x06_P3.81mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_6-GF-3.5_1x06_P3.50mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_6-GF-3.5_1x06_P3.50mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_6-GF-3.81_1x06_P3.81mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_6-GF-3.81_1x06_P3.81mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_7-G-3.5_1x07_P3.50mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_7-G-3.81_1x07_P3.81mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_7-GF-3.5_1x07_P3.50mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_7-GF-3.5_1x07_P3.50mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_7-GF-3.81_1x07_P3.81mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_7-GF-3.81_1x07_P3.81mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_8-G-3.5_1x08_P3.50mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_8-G-3.81_1x08_P3.81mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_8-GF-3.5_1x08_P3.50mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_8-GF-3.5_1x08_P3.50mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_8-GF-3.81_1x08_P3.81mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_8-GF-3.81_1x08_P3.81mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_9-G-3.5_1x09_P3.50mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_9-G-3.81_1x09_P3.81mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_9-GF-3.5_1x09_P3.50mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_9-GF-3.5_1x09_P3.50mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_9-GF-3.81_1x09_P3.81mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_9-GF-3.81_1x09_P3.81mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_10-G-3.5_1x10_P3.50mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_10-G-3.81_1x10_P3.81mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_10-GF-3.5_1x10_P3.50mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_10-GF-3.5_1x10_P3.50mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_10-GF-3.81_1x10_P3.81mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_10-GF-3.81_1x10_P3.81mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_11-G-3.5_1x11_P3.50mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_11-G-3.81_1x11_P3.81mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_11-GF-3.5_1x11_P3.50mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_11-GF-3.5_1x11_P3.50mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_11-GF-3.81_1x11_P3.81mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_11-GF-3.81_1x11_P3.81mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_12-G-3.5_1x12_P3.50mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_12-G-3.81_1x12_P3.81mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_12-GF-3.5_1x12_P3.50mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_12-GF-3.5_1x12_P3.50mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_12-GF-3.81_1x12_P3.81mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_12-GF-3.81_1x12_P3.81mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_13-G-3.5_1x13_P3.50mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_13-G-3.81_1x13_P3.81mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_13-GF-3.5_1x13_P3.50mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_13-GF-3.5_1x13_P3.50mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_13-GF-3.81_1x13_P3.81mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_13-GF-3.81_1x13_P3.81mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_14-G-3.5_1x14_P3.50mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_14-G-3.81_1x14_P3.81mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_14-GF-3.5_1x14_P3.50mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_14-GF-3.5_1x14_P3.50mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_14-GF-3.81_1x14_P3.81mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_14-GF-3.81_1x14_P3.81mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_15-G-3.5_1x15_P3.50mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_15-G-3.81_1x15_P3.81mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_15-GF-3.5_1x15_P3.50mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_15-GF-3.5_1x15_P3.50mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_15-GF-3.81_1x15_P3.81mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_15-GF-3.81_1x15_P3.81mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_16-G-3.5_1x16_P3.50mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_16-G-3.81_1x16_P3.81mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_16-GF-3.5_1x16_P3.50mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_16-GF-3.5_1x16_P3.50mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_16-GF-3.81_1x16_P3.81mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_16-GF-3.81_1x16_P3.81mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_2-G-3.5_1x02_P3.50mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_2-G-3.81_1x02_P3.81mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_2-GF-3.5_1x02_P3.50mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_2-GF-3.5_1x02_P3.50mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_2-GF-3.81_1x02_P3.81mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_2-GF-3.81_1x02_P3.81mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_3-G-3.5_1x03_P3.50mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_3-G-3.81_1x03_P3.81mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_3-GF-3.5_1x03_P3.50mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_3-GF-3.5_1x03_P3.50mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_3-GF-3.81_1x03_P3.81mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_3-GF-3.81_1x03_P3.81mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_4-G-3.5_1x04_P3.50mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_4-G-3.81_1x04_P3.81mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_4-GF-3.5_1x04_P3.50mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_4-GF-3.5_1x04_P3.50mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_4-GF-3.81_1x04_P3.81mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_4-GF-3.81_1x04_P3.81mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_5-G-3.5_1x05_P3.50mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_5-G-3.81_1x05_P3.81mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_5-GF-3.5_1x05_P3.50mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_5-GF-3.5_1x05_P3.50mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_5-GF-3.81_1x05_P3.81mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_5-GF-3.81_1x05_P3.81mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_6-G-3.5_1x06_P3.50mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_6-G-3.81_1x06_P3.81mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_6-GF-3.5_1x06_P3.50mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_6-GF-3.5_1x06_P3.50mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_6-GF-3.81_1x06_P3.81mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_6-GF-3.81_1x06_P3.81mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_7-G-3.5_1x07_P3.50mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_7-G-3.81_1x07_P3.81mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_7-GF-3.5_1x07_P3.50mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_7-GF-3.5_1x07_P3.50mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_7-GF-3.81_1x07_P3.81mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_7-GF-3.81_1x07_P3.81mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_8-G-3.5_1x08_P3.50mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_8-G-3.81_1x08_P3.81mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_8-GF-3.5_1x08_P3.50mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_8-GF-3.5_1x08_P3.50mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_8-GF-3.81_1x08_P3.81mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_8-GF-3.81_1x08_P3.81mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_9-G-3.5_1x09_P3.50mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_9-G-3.81_1x09_P3.81mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_9-GF-3.5_1x09_P3.50mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_9-GF-3.5_1x09_P3.50mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_9-GF-3.81_1x09_P3.81mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_9-GF-3.81_1x09_P3.81mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_10-G-5.08_1x10_P5.08mm_Vertical","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_10-GF-5.08_1x10_P5.08mm_Vertical_ThreadedFlange","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_10-GF-5.08_1x10_P5.08mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_11-G-5.08_1x11_P5.08mm_Vertical","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_11-GF-5.08_1x11_P5.08mm_Vertical_ThreadedFlange","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_11-GF-5.08_1x11_P5.08mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_12-G-5.08_1x12_P5.08mm_Vertical","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_12-GF-5.08_1x12_P5.08mm_Vertical_ThreadedFlange","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_12-GF-5.08_1x12_P5.08mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_2-G-5.08_1x02_P5.08mm_Vertical","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_2-GF-5.08_1x02_P5.08mm_Vertical_ThreadedFlange","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_2-GF-5.08_1x02_P5.08mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_3-G-5.08_1x03_P5.08mm_Vertical","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_3-GF-5.08_1x03_P5.08mm_Vertical_ThreadedFlange","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_3-GF-5.08_1x03_P5.08mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_4-G-5.08_1x04_P5.08mm_Vertical","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_4-GF-5.08_1x04_P5.08mm_Vertical_ThreadedFlange","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_4-GF-5.08_1x04_P5.08mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_5-G-5.08_1x05_P5.08mm_Vertical","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_5-GF-5.08_1x05_P5.08mm_Vertical_ThreadedFlange","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_5-GF-5.08_1x05_P5.08mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_6-G-5.08_1x06_P5.08mm_Vertical","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_6-GF-5.08_1x06_P5.08mm_Vertical_ThreadedFlange","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_6-GF-5.08_1x06_P5.08mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_7-G-5.08_1x07_P5.08mm_Vertical","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_7-GF-5.08_1x07_P5.08mm_Vertical_ThreadedFlange","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_7-GF-5.08_1x07_P5.08mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_8-G-5.08_1x08_P5.08mm_Vertical","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_8-GF-5.08_1x08_P5.08mm_Vertical_ThreadedFlange","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_8-GF-5.08_1x08_P5.08mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_9-G-5.08_1x09_P5.08mm_Vertical","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_9-GF-5.08_1x09_P5.08mm_Vertical_ThreadedFlange","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_9-GF-5.08_1x09_P5.08mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_10-G-5.08_1x10_P5.08mm_Horizontal","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_10-GF-5.08_1x10_P5.08mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_10-GF-5.08_1x10_P5.08mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_11-G-5.08_1x11_P5.08mm_Horizontal","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_11-GF-5.08_1x11_P5.08mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_11-GF-5.08_1x11_P5.08mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_12-G-5.08_1x12_P5.08mm_Horizontal","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_12-GF-5.08_1x12_P5.08mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_12-GF-5.08_1x12_P5.08mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_2-G-5.08_1x02_P5.08mm_Horizontal","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_2-GF-5.08_1x02_P5.08mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_2-GF-5.08_1x02_P5.08mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_3-G-5.08_1x03_P5.08mm_Horizontal","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_3-GF-5.08_1x03_P5.08mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_3-GF-5.08_1x03_P5.08mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_4-G-5.08_1x04_P5.08mm_Horizontal","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_4-GF-5.08_1x04_P5.08mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_4-GF-5.08_1x04_P5.08mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_5-G-5.08_1x05_P5.08mm_Horizontal","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_5-GF-5.08_1x05_P5.08mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_5-GF-5.08_1x05_P5.08mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_6-G-5.08_1x06_P5.08mm_Horizontal","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_6-GF-5.08_1x06_P5.08mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_6-GF-5.08_1x06_P5.08mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_7-G-5.08_1x07_P5.08mm_Horizontal","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_7-GF-5.08_1x07_P5.08mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_7-GF-5.08_1x07_P5.08mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_8-G-5.08_1x08_P5.08mm_Horizontal","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_8-GF-5.08_1x08_P5.08mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_8-GF-5.08_1x08_P5.08mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_9-G-5.08_1x09_P5.08mm_Horizontal","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_9-GF-5.08_1x09_P5.08mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_9-GF-5.08_1x09_P5.08mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_10-G-5,08_1x10_P5.08mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_10-G_1x10_P5.00mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_11-G-5,08_1x11_P5.08mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_11-G_1x11_P5.00mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_12-G-5,08_1x12_P5.08mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_12-G_1x12_P5.00mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_13-G-5,08_1x13_P5.08mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_13-G_1x13_P5.00mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_14-G-5,08_1x14_P5.08mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_14-G_1x14_P5.00mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_15-G-5,08_1x15_P5.08mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_15-G_1x15_P5.00mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_16-G-5,08_1x16_P5.08mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_16-G_1x16_P5.00mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_2-G-5,08_1x02_P5.08mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_2-G_1x02_P5.00mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_3-G-5,08_1x03_P5.08mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_3-G_1x03_P5.00mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_4-G-5,08_1x04_P5.08mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_4-G_1x04_P5.00mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_5-G-5,08_1x05_P5.08mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_5-G_1x05_P5.00mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_6-G-5,08_1x06_P5.08mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_6-G_1x06_P5.00mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_7-G-5,08_1x07_P5.08mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_7-G_1x07_P5.00mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_8-G-5,08_1x08_P5.08mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_8-G_1x08_P5.00mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_9-G-5,08_1x09_P5.08mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_9-G_1x09_P5.00mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_10-G-5,08_1x10_P5.08mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_10-G_1x10_P5.00mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_11-G-5,08_1x11_P5.08mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_11-G_1x11_P5.00mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_12-G-5,08_1x12_P5.08mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_12-G_1x12_P5.00mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_13-G-5,08_1x13_P5.08mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_13-G_1x13_P5.00mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_14-G-5,08_1x14_P5.08mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_14-G_1x14_P5.00mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_15-G-5,08_1x15_P5.08mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_15-G_1x15_P5.00mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_16-G-5,08_1x16_P5.08mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_16-G_1x16_P5.00mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_2-G-5,08_1x02_P5.08mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_2-G_1x02_P5.00mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_3-G-5,08_1x03_P5.08mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_3-G_1x03_P5.00mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_4-G-5,08_1x04_P5.08mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_4-G_1x04_P5.00mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_5-G-5,08_1x05_P5.08mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_5-G_1x05_P5.00mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_6-G-5,08_1x06_P5.08mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_6-G_1x06_P5.00mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_7-G-5,08_1x07_P5.08mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_7-G_1x07_P5.00mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_8-G-5,08_1x08_P5.08mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_8-G_1x08_P5.00mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_9-G-5,08_1x09_P5.08mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_9-G_1x09_P5.00mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_10-GF-5,08_1x10_P5.08mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_10-GF-5,08_1x10_P5.08mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_10-GF_1x10_P5.00mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_10-GF_1x10_P5.00mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_11-GF-5,08_1x11_P5.08mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_11-GF-5,08_1x11_P5.08mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_11-GF_1x11_P5.00mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_11-GF_1x11_P5.00mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_12-GF-5,08_1x12_P5.08mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_12-GF-5,08_1x12_P5.08mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_12-GF_1x12_P5.00mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_12-GF_1x12_P5.00mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_13-GF-5,08_1x13_P5.08mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_13-GF-5,08_1x13_P5.08mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_13-GF_1x13_P5.00mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_13-GF_1x13_P5.00mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_14-GF-5,08_1x14_P5.08mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_14-GF-5,08_1x14_P5.08mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_14-GF_1x14_P5.00mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_14-GF_1x14_P5.00mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_15-GF-5,08_1x15_P5.08mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_15-GF-5,08_1x15_P5.08mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_15-GF_1x15_P5.00mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_15-GF_1x15_P5.00mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_16-GF-5,08_1x16_P5.08mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_16-GF-5,08_1x16_P5.08mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_16-GF_1x16_P5.00mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_16-GF_1x16_P5.00mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_2-GF-5,08_1x02_P5.08mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_2-GF-5,08_1x02_P5.08mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_2-GF_1x02_P5.00mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_2-GF_1x02_P5.00mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_3-GF-5,08_1x03_P5.08mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_3-GF-5,08_1x03_P5.08mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_3-GF_1x03_P5.00mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_3-GF_1x03_P5.00mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_4-GF-5,08_1x04_P5.08mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_4-GF-5,08_1x04_P5.08mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_4-GF_1x04_P5.00mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_4-GF_1x04_P5.00mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_5-GF-5,08_1x05_P5.08mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_5-GF-5,08_1x05_P5.08mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_5-GF_1x05_P5.00mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_5-GF_1x05_P5.00mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_6-GF-5,08_1x06_P5.08mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_6-GF-5,08_1x06_P5.08mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_6-GF_1x06_P5.00mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_6-GF_1x06_P5.00mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_7-GF-5,08_1x07_P5.08mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_7-GF-5,08_1x07_P5.08mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_7-GF_1x07_P5.00mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_7-GF_1x07_P5.00mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_8-GF-5,08_1x08_P5.08mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_8-GF-5,08_1x08_P5.08mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_8-GF_1x08_P5.00mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_8-GF_1x08_P5.00mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_9-GF-5,08_1x09_P5.08mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_9-GF-5,08_1x09_P5.08mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_9-GF_1x09_P5.00mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_9-GF_1x09_P5.00mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_10-GF-5,08_1x10_P5.08mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_10-GF-5,08_1x10_P5.08mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_10-GF_1x10_P5.00mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_10-GF_1x10_P5.00mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_11-GF-5,08_1x11_P5.08mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_11-GF-5,08_1x11_P5.08mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_11-GF_1x11_P5.00mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_11-GF_1x11_P5.00mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_12-GF-5,08_1x12_P5.08mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_12-GF-5,08_1x12_P5.08mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_12-GF_1x12_P5.00mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_12-GF_1x12_P5.00mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_13-GF-5,08_1x13_P5.08mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_13-GF-5,08_1x13_P5.08mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_13-GF_1x13_P5.00mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_13-GF_1x13_P5.00mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_14-GF-5,08_1x14_P5.08mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_14-GF-5,08_1x14_P5.08mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_14-GF_1x14_P5.00mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_14-GF_1x14_P5.00mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_15-GF-5,08_1x15_P5.08mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_15-GF-5,08_1x15_P5.08mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_15-GF_1x15_P5.00mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_15-GF_1x15_P5.00mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_16-GF-5,08_1x16_P5.08mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_16-GF-5,08_1x16_P5.08mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_16-GF_1x16_P5.00mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_16-GF_1x16_P5.00mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_2-GF-5,08_1x02_P5.08mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_2-GF-5,08_1x02_P5.08mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_2-GF_1x02_P5.00mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_2-GF_1x02_P5.00mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_3-GF-5,08_1x03_P5.08mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_3-GF-5,08_1x03_P5.08mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_3-GF_1x03_P5.00mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_3-GF_1x03_P5.00mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_4-GF-5,08_1x04_P5.08mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_4-GF-5,08_1x04_P5.08mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_4-GF_1x04_P5.00mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_4-GF_1x04_P5.00mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_5-GF-5,08_1x05_P5.08mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_5-GF-5,08_1x05_P5.08mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_5-GF_1x05_P5.00mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_5-GF_1x05_P5.00mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_6-GF-5,08_1x06_P5.08mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_6-GF-5,08_1x06_P5.08mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_6-GF_1x06_P5.00mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_6-GF_1x06_P5.00mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_7-GF-5,08_1x07_P5.08mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_7-GF-5,08_1x07_P5.08mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_7-GF_1x07_P5.00mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_7-GF_1x07_P5.00mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_8-GF-5,08_1x08_P5.08mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_8-GF-5,08_1x08_P5.08mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_8-GF_1x08_P5.00mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_8-GF_1x08_P5.00mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_9-GF-5,08_1x09_P5.08mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_9-GF-5,08_1x09_P5.08mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_9-GF_1x09_P5.00mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_9-GF_1x09_P5.00mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_SPT/PhoenixContact_SPT_1.5_10-H-3.5_1x10_P3.5mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_1.5_11-H-3.5_1x11_P3.5mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_1.5_12-H-3.5_1x12_P3.5mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_1.5_2-H-3.5_1x02_P3.5mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_1.5_3-H-3.5_1x03_P3.5mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_1.5_4-H-3.5_1x04_P3.5mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_1.5_5-H-3.5_1x05_P3.5mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_1.5_6-H-3.5_1x06_P3.5mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_1.5_7-H-3.5_1x07_P3.5mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_1.5_8-H-3.5_1x08_P3.5mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_1.5_9-H-3.5_1x09_P3.5mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_1-H-5.0_1x01_P5.0mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_10-H-5.0-EX_1x10_P5.0mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_10-H-5.0_1x10_P5.0mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_10-V-5.0-EX_1x10_P5.0mm_Vertical","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_11-H-5.0-EX_1x11_P5.0mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_11-H-5.0_1x11_P5.0mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_11-V-5.0-EX_1x11_P5.0mm_Vertical","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_12-H-5.0-EX_1x12_P5.0mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_12-H-5.0_1x12_P5.0mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_12-V-5.0-EX_1x12_P5.0mm_Vertical","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_2-H-5.0-EX_1x02_P5.0mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_2-H-5.0_1x02_P5.0mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_2-V-5.0-EX_1x02_P5.0mm_Vertical","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_3-H-5.0-EX_1x03_P5.0mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_3-H-5.0_1x03_P5.0mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_3-V-5.0-EX_1x03_P5.0mm_Vertical","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_4-H-5.0-EX_1x04_P5.0mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_4-H-5.0_1x04_P5.0mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_4-V-5.0-EX_1x04_P5.0mm_Vertical","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_5-H-5.0-EX_1x05_P5.0mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_5-H-5.0_1x05_P5.0mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_5-V-5.0-EX_1x05_P5.0mm_Vertical","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_6-H-5.0-EX_1x06_P5.0mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_6-H-5.0_1x06_P5.0mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_6-V-5.0-EX_1x06_P5.0mm_Vertical","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_7-H-5.0-EX_1x07_P5.0mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_7-H-5.0_1x07_P5.0mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_7-V-5.0-EX_1x07_P5.0mm_Vertical","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_8-H-5.0-EX_1x08_P5.0mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_8-H-5.0_1x08_P5.0mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_8-V-5.0-EX_1x08_P5.0mm_Vertical","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_9-H-5.0-EX_1x09_P5.0mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_9-H-5.0_1x09_P5.0mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_9-V-5.0-EX_1x09_P5.0mm_Vertical","Connector_Phoenix_SPT/PhoenixContact_SPT_5_1-H-7.5_1x01_P7.5mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_5_1-V-7.5_1x01_P7.5mm_Vertical","Connector_Phoenix_SPT/PhoenixContact_SPT_5_10-H-7.5-ZB_1x10_P7.5mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_5_10-V-7.5-ZB_1x10_P7.5mm_Vertical","Connector_Phoenix_SPT/PhoenixContact_SPT_5_11-H-7.5-ZB_1x11_P7.5mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_5_11-V-7.5-ZB_1x11_P7.5mm_Vertical","Connector_Phoenix_SPT/PhoenixContact_SPT_5_12-H-7.5-ZB_1x12_P7.5mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_5_12-V-7.5-ZB_1x12_P7.5mm_Vertical","Connector_Phoenix_SPT/PhoenixContact_SPT_5_2-H-7.5-ZB_1x02_P7.5mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_5_2-V-7.5_1x02_P7.5mm_Vertical","Connector_Phoenix_SPT/PhoenixContact_SPT_5_3-H-7.5-ZB_1x03_P7.5mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_5_3-H-7.5_1x03_P7.5mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_5_3-V-7.5-ZB_1x03_P7.5mm_Vertical","Connector_Phoenix_SPT/PhoenixContact_SPT_5_4-H-7.5-ZB_1x04_P7.5mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_5_5-H-7.5-ZB_1x05_P7.5mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_5_5-V-7.5-ZB_1x05_P7.5mm_Vertical","Connector_Phoenix_SPT/PhoenixContact_SPT_5_6-H-7.5-ZB_1x06_P7.5mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_5_6-V-7.5-ZB_1x06_P7.5mm_Vertical","Connector_Phoenix_SPT/PhoenixContact_SPT_5_7-H-7.5-ZB_1x07_P7.5mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_5_7-V-7.5-ZB_1x07_P7.5mm_Vertical","Connector_Phoenix_SPT/PhoenixContact_SPT_5_8-H-7.5-ZB_1x08_P7.5mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_5_8-V-7.5-ZB_1x08_P7.5mm_Vertical","Connector_Phoenix_SPT/PhoenixContact_SPT_5_9-H-7.5-ZB_1x09_P7.5mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_5_9-V-7.5-ZB_1x09_P7.5mm_Vertical","Connector_Pin/Pin_D0.7mm_L6.5mm_W1.8mm_FlatFork","Connector_Pin/Pin_D0.9mm_L10.0mm_W2.4mm_FlatFork","Connector_Pin/Pin_D1.0mm_L10.0mm","Connector_Pin/Pin_D1.0mm_L10.0mm_LooseFit","Connector_Pin/Pin_D1.1mm_L10.2mm_W3.5mm_Flat","Connector_Pin/Pin_D1.1mm_L8.5mm_W2.5mm_FlatFork","Connector_Pin/Pin_D1.2mm_L10.2mm_W2.9mm_FlatFork","Connector_Pin/Pin_D1.2mm_L11.3mm_W3.0mm_Flat","Connector_Pin/Pin_D1.3mm_L10.0mm_W3.5mm_Flat","Connector_Pin/Pin_D1.3mm_L11.0mm","Connector_Pin/Pin_D1.3mm_L11.0mm_LooseFit","Connector_Pin/Pin_D1.3mm_L11.3mm_W2.8mm_Flat","Connector_Pin/Pin_D1.4mm_L8.5mm_W2.8mm_FlatFork","Connector_PinHeader_1.00mm/PinHeader_1x01_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x01_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x02_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x02_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x02_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x02_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x03_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x03_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x03_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x03_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x04_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x04_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x04_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x04_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x05_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x05_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x05_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x05_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x06_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x06_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x06_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x06_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x07_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x07_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x07_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x07_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x08_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x08_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x08_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x08_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x09_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x09_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x09_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x09_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x10_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x10_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x10_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x10_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x11_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x11_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x11_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x11_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x12_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x12_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x12_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x12_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x13_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x13_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x13_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x13_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x14_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x14_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x14_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x14_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x15_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x15_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x15_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x15_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x16_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x16_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x16_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x16_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x17_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x17_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x17_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x17_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x18_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x18_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x18_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x18_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x19_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x19_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x19_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x19_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x20_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x20_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x20_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x20_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x21_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x21_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x21_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x21_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x22_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x22_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x22_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x22_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x23_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x23_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x23_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x23_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x24_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x24_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x24_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x24_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x25_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x25_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x25_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x25_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x26_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x26_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x26_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x26_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x27_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x27_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x27_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x27_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x28_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x28_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x28_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x28_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x29_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x29_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x29_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x29_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x30_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x30_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x30_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x30_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x31_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x31_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x31_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x31_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x32_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x32_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x32_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x32_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x33_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x33_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x33_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x33_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x34_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x34_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x34_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x34_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x35_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x35_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x35_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x35_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x36_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x36_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x36_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x36_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x37_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x37_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x37_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x37_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x38_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x38_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x38_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x38_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x39_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x39_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x39_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x39_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x40_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x40_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x40_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x40_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_2x01_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x01_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x01_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x02_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x02_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x02_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x03_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x03_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x03_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x04_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x04_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x04_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x05_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x05_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x05_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x06_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x06_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x06_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x07_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x07_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x07_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x08_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x08_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x08_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x09_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x09_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x09_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x10_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x10_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x10_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x11_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x11_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x11_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x12_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x12_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x12_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x13_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x13_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x13_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x14_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x14_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x14_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x15_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x15_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x15_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x16_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x16_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x16_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x17_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x17_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x17_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x18_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x18_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x18_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x19_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x19_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x19_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x20_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x20_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x20_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x21_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x21_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x21_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x22_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x22_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x22_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x23_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x23_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x23_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x24_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x24_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x24_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x25_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x25_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x25_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x26_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x26_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x26_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x27_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x27_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x27_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x28_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x28_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x28_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x29_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x29_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x29_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x30_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x30_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x30_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x31_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x31_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x31_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x32_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x32_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x32_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x33_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x33_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x33_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x34_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x34_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x34_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x35_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x35_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x35_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x36_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x36_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x36_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x37_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x37_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x37_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x38_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x38_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x38_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x39_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x39_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x39_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x40_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x40_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x40_P1.00mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_1x01_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x01_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x02_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x02_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x02_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x02_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x03_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x03_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x03_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x03_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x04_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x04_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x04_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x04_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x05_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x05_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x05_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x05_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x06_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x06_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x06_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x06_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x07_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x07_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x07_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x07_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x08_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x08_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x08_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x08_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x09_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x09_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x09_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x09_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x10_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x10_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x10_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x10_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x11_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x11_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x11_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x11_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x12_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x12_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x12_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x12_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x13_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x13_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x13_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x13_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x14_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x14_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x14_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x14_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x15_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x15_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x15_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x15_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x16_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x16_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x16_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x16_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x17_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x17_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x17_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x17_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x18_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x18_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x18_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x18_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x19_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x19_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x19_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x19_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x20_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x20_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x20_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x20_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x21_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x21_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x21_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x21_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x22_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x22_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x22_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x22_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x23_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x23_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x23_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x23_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x24_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x24_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x24_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x24_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x25_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x25_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x25_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x25_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x26_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x26_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x26_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x26_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x27_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x27_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x27_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x27_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x28_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x28_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x28_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x28_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x29_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x29_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x29_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x29_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x30_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x30_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x30_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x30_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x31_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x31_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x31_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x31_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x32_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x32_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x32_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x32_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x33_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x33_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x33_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x33_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x34_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x34_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x34_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x34_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x35_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x35_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x35_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x35_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x36_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x36_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x36_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x36_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x37_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x37_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x37_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x37_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x38_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x38_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x38_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x38_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x39_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x39_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x39_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x39_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x40_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x40_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x40_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x40_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_2x01_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x01_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x01_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x02_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x02_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x02_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x03_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x03_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x03_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x04_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x04_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x04_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x05_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x05_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x05_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x06_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x06_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x06_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x07_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x07_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x07_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x08_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x08_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x08_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x09_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x09_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x09_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x10_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x10_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x10_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x11_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x11_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x11_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x12_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x12_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x12_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x13_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x13_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x13_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x14_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x14_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x14_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x15_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x15_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x15_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x16_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x16_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x16_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x17_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x17_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x17_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x18_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x18_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x18_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x19_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x19_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x19_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x20_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x20_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x20_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x21_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x21_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x21_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x22_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x22_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x22_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x23_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x23_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x23_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x24_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x24_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x24_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x25_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x25_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x25_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x26_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x26_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x26_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x27_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x27_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x27_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x28_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x28_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x28_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x29_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x29_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x29_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x30_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x30_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x30_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x31_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x31_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x31_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x32_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x32_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x32_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x33_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x33_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x33_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x34_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x34_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x34_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x35_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x35_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x35_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x36_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x36_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x36_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x37_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x37_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x37_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x38_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x38_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x38_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x39_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x39_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x39_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x40_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x40_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x40_P1.27mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_1x01_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x01_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x02_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x02_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x02_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x02_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x03_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x03_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x03_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x03_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x04_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x04_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x04_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x04_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x05_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x05_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x05_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x05_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x06_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x06_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x06_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x06_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x07_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x07_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x07_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x07_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x08_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x08_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x08_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x08_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x09_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x09_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x09_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x09_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x10_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x10_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x10_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x10_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x11_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x11_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x11_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x11_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x12_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x12_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x12_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x12_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x13_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x13_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x13_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x13_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x14_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x14_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x14_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x14_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x15_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x15_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x15_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x15_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x16_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x16_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x16_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x16_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x17_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x17_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x17_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x17_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x18_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x18_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x18_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x18_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x19_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x19_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x19_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x19_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x20_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x20_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x20_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x20_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x21_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x21_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x21_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x21_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x22_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x22_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x22_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x22_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x23_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x23_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x23_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x23_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x24_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x24_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x24_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x24_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x25_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x25_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x25_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x25_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x26_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x26_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x26_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x26_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x27_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x27_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x27_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x27_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x28_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x28_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x28_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x28_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x29_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x29_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x29_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x29_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x30_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x30_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x30_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x30_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x31_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x31_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x31_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x31_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x32_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x32_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x32_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x32_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x33_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x33_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x33_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x33_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x34_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x34_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x34_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x34_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x35_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x35_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x35_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x35_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x36_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x36_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x36_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x36_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x37_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x37_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x37_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x37_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x38_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x38_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x38_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x38_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x39_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x39_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x39_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x39_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x40_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x40_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x40_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x40_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_2x01_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x01_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x01_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x02_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x02_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x02_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x03_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x03_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x03_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x04_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x04_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x04_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x05_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x05_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x05_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x06_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x06_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x06_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x07_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x07_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x07_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x08_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x08_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x08_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x09_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x09_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x09_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x10_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x10_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x10_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x11_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x11_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x11_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x12_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x12_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x12_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x13_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x13_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x13_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x14_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x14_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x14_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x15_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x15_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x15_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x16_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x16_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x16_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x17_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x17_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x17_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x18_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x18_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x18_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x19_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x19_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x19_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x20_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x20_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x20_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x21_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x21_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x21_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x22_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x22_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x22_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x23_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x23_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x23_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x24_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x24_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x24_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x25_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x25_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x25_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x26_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x26_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x26_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x27_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x27_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x27_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x28_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x28_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x28_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x29_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x29_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x29_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x30_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x30_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x30_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x31_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x31_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x31_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x32_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x32_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x32_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x33_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x33_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x33_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x34_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x34_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x34_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x35_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x35_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x35_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x36_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x36_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x36_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x37_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x37_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x37_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x38_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x38_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x38_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x39_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x39_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x39_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x40_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x40_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x40_P2.00mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_1x01_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x01_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x02_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x02_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x02_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x02_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x03_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x03_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x03_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x03_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x04_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x04_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x04_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x04_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x05_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x05_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x05_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x05_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x06_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x06_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x06_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x06_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x07_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x07_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x07_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x07_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x08_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x08_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x08_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x08_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x09_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x09_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x09_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x09_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x10_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x10_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x10_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x10_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x11_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x11_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x11_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x11_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x12_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x12_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x12_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x12_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x13_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x13_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x13_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x13_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x14_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x14_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x14_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x14_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x15_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x15_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x15_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x15_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x16_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x16_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x16_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x16_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x17_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x17_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x17_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x17_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x18_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x18_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x18_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x18_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x19_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x19_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x19_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x19_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x20_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x20_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x20_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x20_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x21_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x21_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x21_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x21_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x22_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x22_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x22_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x22_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x23_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x23_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x23_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x23_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x24_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x24_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x24_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x24_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x25_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x25_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x25_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x25_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x26_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x26_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x26_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x26_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x27_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x27_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x27_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x27_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x28_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x28_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x28_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x28_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x29_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x29_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x29_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x29_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x30_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x30_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x30_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x30_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x31_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x31_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x31_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x31_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x32_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x32_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x32_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x32_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x33_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x33_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x33_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x33_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x34_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x34_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x34_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x34_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x35_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x35_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x35_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x35_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x36_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x36_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x36_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x36_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x37_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x37_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x37_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x37_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x38_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x38_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x38_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x38_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x39_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x39_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x39_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x39_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x40_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x40_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x40_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x40_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_2x01_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x01_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x01_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x02_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x02_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x02_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x03_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x03_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x03_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x04_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x04_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x04_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x05_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x05_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x05_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x06_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x06_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x06_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x07_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x07_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x07_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x08_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x08_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x08_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x09_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x09_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x09_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x10_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x10_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x10_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x11_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x11_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x11_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x12_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x12_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x12_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x13_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x13_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x13_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x14_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x14_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x14_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x15_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x15_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x15_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x16_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x16_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x16_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x17_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x17_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x17_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x18_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x18_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x18_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x19_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x19_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x19_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x20_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x20_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x20_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x21_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x21_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x21_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x22_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x22_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x22_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x23_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x23_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x23_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x24_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x24_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x24_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x25_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x25_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x25_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x26_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x26_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x26_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x27_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x27_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x27_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x28_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x28_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x28_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x29_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x29_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x29_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x30_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x30_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x30_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x31_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x31_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x31_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x32_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x32_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x32_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x33_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x33_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x33_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x34_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x34_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x34_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x35_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x35_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x35_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x36_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x36_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x36_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x37_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x37_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x37_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x38_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x38_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x38_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x39_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x39_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x39_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x40_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x40_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x40_P2.54mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_1x02_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x02_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x02_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x03_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x03_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x03_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x04_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x04_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x04_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x05_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x05_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x05_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x06_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x06_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x06_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x07_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x07_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x07_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x08_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x08_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x08_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x09_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x09_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x09_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x10_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x10_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x10_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x11_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x11_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x11_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x12_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x12_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x12_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x13_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x13_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x13_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x14_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x14_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x14_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x15_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x15_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x15_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x16_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x16_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x16_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x17_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x17_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x17_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x18_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x18_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x18_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x19_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x19_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x19_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x20_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x20_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x20_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x21_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x21_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x21_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x22_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x22_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x22_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x23_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x23_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x23_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x24_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x24_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x24_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x25_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x25_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x25_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x26_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x26_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x26_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x27_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x27_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x27_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x28_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x28_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x28_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x29_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x29_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x29_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x30_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x30_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x30_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x31_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x31_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x31_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x32_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x32_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x32_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x33_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x33_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x33_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x34_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x34_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x34_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x35_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x35_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x35_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x36_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x36_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x36_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x37_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x37_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x37_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x38_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x38_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x38_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x39_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x39_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x39_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x40_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x40_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x40_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_2x02_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x03_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x04_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x05_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x06_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x07_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x08_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x09_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x10_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x11_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x12_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x13_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x14_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x15_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x16_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x17_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x18_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x19_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x20_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x21_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x22_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x23_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x24_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x25_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x26_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x27_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x28_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x29_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x30_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x31_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x32_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x33_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x34_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x35_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x36_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x37_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x38_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x39_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x40_P1.00mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_1x01_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x02_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x02_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x02_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x03_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x03_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x03_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x04_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x04_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x04_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x05_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x05_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x05_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x06_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x06_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x06_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x07_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x07_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x07_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x08_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x08_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x08_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x09_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x09_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x09_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x10_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x10_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x10_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x11_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x11_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x11_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x12_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x12_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x12_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x13_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x13_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x13_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x14_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x14_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x14_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x15_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x15_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x15_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x16_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x16_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x16_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x17_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x17_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x17_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x18_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x18_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x18_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x19_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x19_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x19_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x20_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x20_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x20_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x21_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x21_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x21_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x22_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x22_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x22_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x23_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x23_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x23_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x24_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x24_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x24_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x25_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x25_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x25_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x26_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x26_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x26_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x27_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x27_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x27_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x28_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x28_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x28_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x29_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x29_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x29_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x30_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x30_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x30_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x31_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x31_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x31_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x32_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x32_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x32_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x33_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x33_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x33_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x34_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x34_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x34_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x35_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x35_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x35_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x36_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x36_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x36_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x37_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x37_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x37_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x38_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x38_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x38_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x39_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x39_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x39_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x40_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x40_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x40_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_2x01_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x01_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x02_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x02_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x03_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x03_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x03_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x04_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x04_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x04_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x05_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x05_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x05_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x06_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x06_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x06_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x07_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x07_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x07_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x08_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x08_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x08_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x09_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x09_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x09_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x10_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x10_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x10_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x11_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x11_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x11_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x12_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x12_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x12_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x13_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x13_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x13_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x14_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x14_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x14_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x15_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x15_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x15_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x16_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x16_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x16_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x17_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x17_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x17_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x18_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x18_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x18_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x19_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x19_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x19_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x20_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x20_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x20_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x21_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x21_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x21_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x22_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x22_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x22_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x23_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x23_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x23_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x24_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x24_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x24_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x25_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x25_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x25_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x26_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x26_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x26_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x27_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x27_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x27_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x28_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x28_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x28_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x29_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x29_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x29_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x30_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x30_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x30_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x31_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x31_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x31_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x32_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x32_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x32_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x33_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x33_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x33_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x34_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x34_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x34_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x35_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x35_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x35_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x36_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x36_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x36_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x37_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x37_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x37_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x38_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x38_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x38_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x39_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x39_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x39_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x40_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x40_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x40_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x41_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x42_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x43_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x44_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x45_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x46_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x47_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x48_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x49_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x50_P1.27mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x01_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x01_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x02_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x02_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x02_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x02_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x03_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x03_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x03_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x03_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x04_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x04_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x04_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x04_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x05_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x05_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x05_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x05_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x06_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x06_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x06_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x06_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x07_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x07_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x07_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x07_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x08_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x08_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x08_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x08_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x09_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x09_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x09_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x09_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x10_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x10_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x10_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x10_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x11_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x11_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x11_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x11_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x12_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x12_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x12_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x12_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x13_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x13_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x13_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x13_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x14_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x14_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x14_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x14_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x15_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x15_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x15_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x15_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x16_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x16_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x16_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x16_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x17_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x17_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x17_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x17_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x18_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x18_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x18_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x18_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x19_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x19_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x19_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x19_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x20_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x20_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x20_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x20_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x21_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x21_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x21_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x21_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x22_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x22_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x22_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x22_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x23_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x23_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x23_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x23_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x24_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x24_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x24_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x24_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x25_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x25_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x25_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x25_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x26_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x26_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x26_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x26_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x27_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x27_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x27_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x27_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x28_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x28_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x28_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x28_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x29_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x29_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x29_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x29_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x30_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x30_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x30_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x30_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x31_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x31_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x31_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x31_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x32_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x32_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x32_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x32_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x33_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x33_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x33_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x33_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x34_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x34_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x34_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x34_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x35_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x35_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x35_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x35_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x36_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x36_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x36_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x36_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x37_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x37_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x37_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x37_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x38_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x38_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x38_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x38_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x39_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x39_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x39_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x39_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x40_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x40_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x40_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x40_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_2x01_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x01_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x01_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x02_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x02_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x02_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x03_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x03_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x03_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x04_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x04_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x04_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x05_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x05_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x05_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x06_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x06_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x06_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x07_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x07_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x07_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x08_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x08_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x08_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x09_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x09_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x09_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x10_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x10_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x10_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x11_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x11_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x11_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x12_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x12_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x12_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x13_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x13_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x13_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x14_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x14_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x14_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x15_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x15_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x15_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x16_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x16_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x16_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x17_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x17_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x17_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x18_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x18_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x18_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x19_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x19_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x19_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x20_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x20_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x20_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x21_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x21_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x21_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x22_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x22_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x22_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x23_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x23_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x23_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x24_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x24_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x24_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x25_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x25_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x25_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x26_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x26_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x26_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x27_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x27_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x27_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x28_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x28_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x28_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x29_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x29_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x29_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x30_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x30_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x30_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x31_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x31_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x31_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x32_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x32_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x32_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x33_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x33_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x33_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x34_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x34_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x34_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x35_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x35_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x35_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x36_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x36_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x36_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x37_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x37_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x37_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x38_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x38_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x38_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x39_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x39_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x39_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x40_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x40_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x40_P2.00mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_1x01_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x01_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x02_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x02_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x02_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x02_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x03_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x03_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x03_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x03_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x04_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x04_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x04_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x04_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x05_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x05_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x05_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x05_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x06_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x06_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x06_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x06_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x07_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x07_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x07_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x07_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x08_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x08_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x08_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x08_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x09_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x09_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x09_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x09_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x10_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x10_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x10_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x10_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x11_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x11_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x11_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x11_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x12_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x12_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x12_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x12_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x13_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x13_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x13_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x13_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x14_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x14_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x14_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x14_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x15_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x15_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x15_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x15_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x16_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x16_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x16_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x16_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x17_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x17_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x17_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x17_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x18_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x18_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x18_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x18_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x19_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x19_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x19_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x19_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x20_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x20_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x20_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x20_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x21_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x21_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x21_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x21_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x22_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x22_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x22_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x22_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x23_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x23_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x23_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x23_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x24_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x24_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x24_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x24_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x25_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x25_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x25_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x25_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x26_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x26_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x26_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x26_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x27_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x27_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x27_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x27_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x28_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x28_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x28_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x28_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x29_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x29_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x29_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x29_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x30_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x30_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x30_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x30_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x31_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x31_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x31_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x31_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x32_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x32_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x32_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x32_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x33_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x33_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x33_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x33_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x34_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x34_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x34_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x34_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x35_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x35_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x35_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x35_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x36_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x36_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x36_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x36_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x37_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x37_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x37_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x37_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x38_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x38_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x38_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x38_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x39_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x39_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x39_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x39_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x40_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x40_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x40_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x40_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_2x01_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x01_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x01_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x02_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x02_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x02_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x03_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x03_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x03_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x04_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x04_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x04_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x05_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x05_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x05_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x06_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x06_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x06_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x07_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x07_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x07_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x08_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x08_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x08_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x09_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x09_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x09_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x10_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x10_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x10_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x11_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x11_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x11_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x12_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x12_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x12_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x13_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x13_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x13_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x14_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x14_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x14_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x15_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x15_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x15_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x16_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x16_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x16_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x17_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x17_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x17_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x18_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x18_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x18_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x19_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x19_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x19_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x20_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x20_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x20_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x21_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x21_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x21_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x22_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x22_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x22_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x23_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x23_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x23_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x24_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x24_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x24_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x25_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x25_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x25_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x26_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x26_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x26_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x27_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x27_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x27_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x28_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x28_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x28_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x29_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x29_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x29_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x30_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x30_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x30_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x31_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x31_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x31_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x32_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x32_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x32_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x33_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x33_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x33_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x34_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x34_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x34_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x35_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x35_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x35_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x36_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x36_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x36_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x37_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x37_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x37_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x38_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x38_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x38_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x39_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x39_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x39_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x40_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x40_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x40_P2.54mm_Vertical_SMD","Connector_RJ/RJ12_Amphenol_54601-x06_Horizontal","Connector_RJ/RJ14_Connfly_DS1133-S4_Horizontal","Connector_RJ/RJ25_Wayconn_MJEA-660X1_Horizontal","Connector_RJ/RJ45_Abracon_ARJP11A-MA_Horizontal","Connector_RJ/RJ45_Amphenol_54602-x08_Horizontal","Connector_RJ/RJ45_Amphenol_RJHSE5380-08","Connector_RJ/RJ45_Amphenol_RJHSE5380","Connector_RJ/RJ45_Amphenol_RJHSE538X-02","Connector_RJ/RJ45_Amphenol_RJHSE538X-04","Connector_RJ/RJ45_Amphenol_RJHSE538X","Connector_RJ/RJ45_Amphenol_RJMG1BD3B8K1ANR","Connector_RJ/RJ45_BEL_SS74301-00x_Vertical","Connector_RJ/RJ45_Bel_SI-60062-F","Connector_RJ/RJ45_Bel_V895-1001-AW_Vertical","Connector_RJ/RJ45_Cetus_J1B1211CCD_Horizontal","Connector_RJ/RJ45_Connfly_DS1128-09-S8xx-S_Horizontal","Connector_RJ/RJ45_HALO_HFJ11-x2450E-LxxRL_Horizontal","Connector_RJ/RJ45_HALO_HFJ11-x2450ERL_Horizontal","Connector_RJ/RJ45_HALO_HFJ11-x2450HRL_Horizontal","Connector_RJ/RJ45_Hanrun_HR911105A_Horizontal","Connector_RJ/RJ45_Kycon_G7LX-A88S7-BP-xx_Horizontal","Connector_RJ/RJ45_Molex_0855135013_Vertical","Connector_RJ/RJ45_Molex_9346520x_Horizontal","Connector_RJ/RJ45_Ninigi_GE","Connector_RJ/RJ45_OST_PJ012-8P8CX_Vertical","Connector_RJ/RJ45_Plug_Metz_AJP92A8813","Connector_RJ/RJ45_Pulse_JK00177NL_Horizontal","Connector_RJ/RJ45_Pulse_JK0654219NL_Horizontal","Connector_RJ/RJ45_Pulse_JXD6-0001NL_Horizontal","Connector_RJ/RJ45_RCH_RC01937","Connector_RJ/RJ45_UDE_RB1-125B8G1A","Connector_RJ/RJ45_Wuerth_74980111211_Horizontal","Connector_RJ/RJ45_Wuerth_7499010001A_Horizontal","Connector_RJ/RJ45_Wuerth_7499010121A_Horizontal","Connector_RJ/RJ45_Wuerth_7499010211A_Horizontal","Connector_RJ/RJ45_Wuerth_7499111446_Horizontal","Connector_RJ/RJ45_Wuerth_7499151120_Horizontal","Connector_RJ/RJ9_Evercom_5301-440xxx_Horizontal","Connector_SATA_SAS/SAS-mini_TEConnectivity_1888174_Vertical","Connector_SATA_SAS/SATA_Amphenol_10029364-001LF_Horizontal","Connector_Samtec/Samtec_FMC_ASP-134486-01_10x40_P1.27mm_Vertical","Connector_Samtec/Samtec_FMC_ASP-134602-01_10x40_P1.27mm_Vertical","Connector_Samtec/Samtec_FMC_ASP-134604-01_4x40_Vertical","Connector_Samtec/Samtec_LSHM-105-xx.x-x-DV-N_2x05_P0.50mm_Vertical","Connector_Samtec/Samtec_LSHM-105-xx.x-x-DV-S_2x05-1SH_P0.50mm_Vertical","Connector_Samtec/Samtec_LSHM-110-xx.x-x-DV-N_2x10_P0.50mm_Vertical","Connector_Samtec/Samtec_LSHM-110-xx.x-x-DV-S_2x10-1SH_P0.50mm_Vertical","Connector_Samtec/Samtec_LSHM-120-xx.x-x-DV-N_2x20_P0.50mm_Vertical","Connector_Samtec/Samtec_LSHM-120-xx.x-x-DV-S_2x20-1SH_P0.50mm_Vertical","Connector_Samtec/Samtec_LSHM-130-xx.x-x-DV-N_2x30_P0.50mm_Vertical","Connector_Samtec/Samtec_LSHM-130-xx.x-x-DV-S_2x30-1SH_P0.50mm_Vertical","Connector_Samtec/Samtec_LSHM-140-xx.x-x-DV-N_2x40_P0.50mm_Vertical","Connector_Samtec/Samtec_LSHM-140-xx.x-x-DV-S_2x40-1SH_P0.50mm_Vertical","Connector_Samtec/Samtec_LSHM-150-xx.x-x-DV-N_2x50_P0.50mm_Vertical","Connector_Samtec/Samtec_LSHM-150-xx.x-x-DV-S_2x50-1SH_P0.50mm_Vertical","Connector_Samtec/Samtec_SS4-10-3.00-x-D-K-xR_2x10_P0.4mm_Socket","Connector_Samtec/Samtec_SS4-10-3.50-x-D-K-xR_2x10_P0.4mm_Socket","Connector_Samtec/Samtec_SS4-15-3.00-x-D-K-xR_2x15_P0.4mm_Socket","Connector_Samtec/Samtec_SS4-15-3.50-x-D-K-xR_2x15_P0.4mm_Socket","Connector_Samtec/Samtec_SS4-20-3.00-x-D-K-xR_2x20_P0.4mm_Socket","Connector_Samtec/Samtec_SS4-20-3.50-x-D-K-xR_2x20_P0.4mm_Socket","Connector_Samtec/Samtec_SS4-30-3.00-x-D-K-xR_2x30_P0.4mm_Socket","Connector_Samtec/Samtec_SS4-30-3.50-x-D-K-xR_2x30_P0.4mm_Socket","Connector_Samtec/Samtec_SS4-40-3.00-x-D-K-xR_2x40_P0.4mm_Socket","Connector_Samtec/Samtec_SS4-40-3.50-x-D-K-xR_2x40_P0.4mm_Socket","Connector_Samtec/Samtec_SS4-50-3.00-x-D-K-xR_2x50_P0.4mm_Socket","Connector_Samtec/Samtec_SS4-50-3.50-x-D-K-xR_2x50_P0.4mm_Socket","Connector_Samtec_EdgeRate/Samtec_ERF8-005-XX.X-DV-L_2x05_P0.8mm_Socket_Latch","Connector_Samtec_EdgeRate/Samtec_ERF8-005-XX.X-DV_2x05_P0.8mm_Socket","Connector_Samtec_EdgeRate/Samtec_ERF8-010-XX.X-DV-L_2x10_P0.8mm_Socket_Latch","Connector_Samtec_EdgeRate/Samtec_ERF8-010-XX.X-DV_2x10_P0.8mm_Socket","Connector_Samtec_EdgeRate/Samtec_ERF8-011-XX.X-DV-L_2x11_P0.8mm_Socket_Latch","Connector_Samtec_EdgeRate/Samtec_ERF8-011-XX.X-DV_2x11_P0.8mm_Socket","Connector_Samtec_EdgeRate/Samtec_ERF8-013-XX.X-DV-L_2x13_P0.8mm_Socket_Latch","Connector_Samtec_EdgeRate/Samtec_ERF8-013-XX.X-DV_2x13_P0.8mm_Socket","Connector_Samtec_EdgeRate/Samtec_ERF8-020-XX.X-DV-L_2x20_P0.8mm_Socket_Latch","Connector_Samtec_EdgeRate/Samtec_ERF8-020-XX.X-DV_2x20_P0.8mm_Socket","Connector_Samtec_EdgeRate/Samtec_ERF8-025-XX.X-DV-L_2x25_P0.8mm_Socket_Latch","Connector_Samtec_EdgeRate/Samtec_ERF8-025-XX.X-DV_2x25_P0.8mm_Socket","Connector_Samtec_EdgeRate/Samtec_ERF8-030-XX.X-DV-L_2x30_P0.8mm_Socket_Latch","Connector_Samtec_EdgeRate/Samtec_ERF8-030-XX.X-DV_2x30_P0.8mm_Socket","Connector_Samtec_EdgeRate/Samtec_ERF8-035-XX.X-DV-L_2x35_P0.8mm_Socket_Latch","Connector_Samtec_EdgeRate/Samtec_ERF8-035-XX.X-DV_2x35_P0.8mm_Socket","Connector_Samtec_EdgeRate/Samtec_ERF8-040-XX.X-DV-L_2x40_P0.8mm_Socket_Latch","Connector_Samtec_EdgeRate/Samtec_ERF8-040-XX.X-DV_2x40_P0.8mm_Socket","Connector_Samtec_EdgeRate/Samtec_ERF8-049-XX.X-DV-L_2x49_P0.8mm_Socket_Latch","Connector_Samtec_EdgeRate/Samtec_ERF8-049-XX.X-DV_2x49_P0.8mm_Socket","Connector_Samtec_EdgeRate/Samtec_ERF8-050-XX.X-DV-L_2x50_P0.8mm_Socket_Latch","Connector_Samtec_EdgeRate/Samtec_ERF8-050-XX.X-DV_2x50_P0.8mm_Socket","Connector_Samtec_EdgeRate/Samtec_ERF8-060-XX.X-DV-L_2x60_P0.8mm_Socket_Latch","Connector_Samtec_EdgeRate/Samtec_ERF8-060-XX.X-DV_2x60_P0.8mm_Socket","Connector_Samtec_EdgeRate/Samtec_ERF8-070-XX.X-DV-L_2x70_P0.8mm_Socket_Latch","Connector_Samtec_EdgeRate/Samtec_ERF8-070-XX.X-DV_2x70_P0.8mm_Socket","Connector_Samtec_EdgeRate/Samtec_ERF8-075-XX.X-DV-L_2x75_P0.8mm_Socket_Latch","Connector_Samtec_EdgeRate/Samtec_ERF8-075-XX.X-DV_2x75_P0.8mm_Socket","Connector_Samtec_EdgeRate/Samtec_ERF8-100-XX.X-DV-L_2x100_P0.8mm_Socket_Latch","Connector_Samtec_EdgeRate/Samtec_ERF8-100-XX.X-DV_2x100_P0.8mm_Socket","Connector_Samtec_EdgeRate/Samtec_ERM8-005-XX.X-DV-L_2x05_P0.8mm_Terminal_Latch","Connector_Samtec_EdgeRate/Samtec_ERM8-005-XX.X-DV_2x05_P0.8mm_Terminal","Connector_Samtec_EdgeRate/Samtec_ERM8-010-XX.X-DV-L_2x10_P0.8mm_Terminal_Latch","Connector_Samtec_EdgeRate/Samtec_ERM8-010-XX.X-DV_2x10_P0.8mm_Terminal","Connector_Samtec_EdgeRate/Samtec_ERM8-011-XX.X-DV-L_2x11_P0.8mm_Terminal_Latch","Connector_Samtec_EdgeRate/Samtec_ERM8-011-XX.X-DV_2x11_P0.8mm_Terminal","Connector_Samtec_EdgeRate/Samtec_ERM8-013-XX.X-DV-L_2x13_P0.8mm_Terminal_Latch","Connector_Samtec_EdgeRate/Samtec_ERM8-013-XX.X-DV_2x13_P0.8mm_Terminal","Connector_Samtec_EdgeRate/Samtec_ERM8-020-XX.X-DV-L_2x20_P0.8mm_Terminal_Latch","Connector_Samtec_EdgeRate/Samtec_ERM8-020-XX.X-DV_2x20_P0.8mm_Terminal","Connector_Samtec_EdgeRate/Samtec_ERM8-025-XX.X-DV-L_2x25_P0.8mm_Terminal_Latch","Connector_Samtec_EdgeRate/Samtec_ERM8-025-XX.X-DV_2x25_P0.8mm_Terminal","Connector_Samtec_EdgeRate/Samtec_ERM8-030-XX.X-DV-L_2x30_P0.8mm_Terminal_Latch","Connector_Samtec_EdgeRate/Samtec_ERM8-030-XX.X-DV_2x30_P0.8mm_Terminal","Connector_Samtec_EdgeRate/Samtec_ERM8-035-XX.X-DV-L_2x35_P0.8mm_Terminal_Latch","Connector_Samtec_EdgeRate/Samtec_ERM8-035-XX.X-DV_2x35_P0.8mm_Terminal","Connector_Samtec_EdgeRate/Samtec_ERM8-040-XX.X-DV-L_2x40_P0.8mm_Terminal_Latch","Connector_Samtec_EdgeRate/Samtec_ERM8-040-XX.X-DV_2x40_P0.8mm_Terminal","Connector_Samtec_EdgeRate/Samtec_ERM8-049-XX.X-DV-L_2x49_P0.8mm_Terminal_Latch","Connector_Samtec_EdgeRate/Samtec_ERM8-049-XX.X-DV_2x49_P0.8mm_Terminal","Connector_Samtec_EdgeRate/Samtec_ERM8-050-XX.X-DV-L_2x50_P0.8mm_Terminal_Latch","Connector_Samtec_EdgeRate/Samtec_ERM8-050-XX.X-DV_2x50_P0.8mm_Terminal","Connector_Samtec_EdgeRate/Samtec_ERM8-060-XX.X-DV-L_2x60_P0.8mm_Terminal_Latch","Connector_Samtec_EdgeRate/Samtec_ERM8-060-XX.X-DV_2x60_P0.8mm_Terminal","Connector_Samtec_EdgeRate/Samtec_ERM8-070-XX.X-DV-L_2x70_P0.8mm_Terminal_Latch","Connector_Samtec_EdgeRate/Samtec_ERM8-070-XX.X-DV_2x70_P0.8mm_Terminal","Connector_Samtec_EdgeRate/Samtec_ERM8-075-XX.X-DV-L_2x75_P0.8mm_Terminal_Latch","Connector_Samtec_EdgeRate/Samtec_ERM8-075-XX.X-DV_2x75_P0.8mm_Terminal","Connector_Samtec_EdgeRate/Samtec_ERM8-100-XX.X-DV-L_2x100_P0.8mm_Terminal_Latch","Connector_Samtec_EdgeRate/Samtec_ERM8-100-XX.X-DV_2x100_P0.8mm_Terminal","Connector_Samtec_FSI/Samtec_FSI-105-03-X-D-AD_2x05_P1.0mm_Socket_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-105-03-X-D_2x05_P1.0mm_Socket","Connector_Samtec_FSI/Samtec_FSI-105-XX-X-D-AD_2x05_P1.0mm_Mate_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-105-XX-X-D-AD_2x05_P1.0mm_Socket_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-105-XX-X-D_2x05_P1.0mm_Mate","Connector_Samtec_FSI/Samtec_FSI-105-XX-X-D_2x05_P1.0mm_Socket","Connector_Samtec_FSI/Samtec_FSI-110-03-X-D-AD_2x10_P1.0mm_Socket_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-110-03-X-D-M-AD_2x10_P1.0mm_Socket_Threaded_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-110-03-X-D-M_2x10_P1.0mm_Socket_Threaded","Connector_Samtec_FSI/Samtec_FSI-110-03-X-D_2x10_P1.0mm_Socket","Connector_Samtec_FSI/Samtec_FSI-110-XX-X-D-AD_2x10_P1.0mm_Mate_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-110-XX-X-D-AD_2x10_P1.0mm_Socket_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-110-XX-X-D-M-AD_2x10_P1.0mm_Mate_Threaded_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-110-XX-X-D-M-AD_2x10_P1.0mm_Socket_Threaded_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-110-XX-X-D-M_2x10_P1.0mm_Mate_Threaded","Connector_Samtec_FSI/Samtec_FSI-110-XX-X-D-M_2x10_P1.0mm_Socket_Threaded","Connector_Samtec_FSI/Samtec_FSI-110-XX-X-D_2x10_P1.0mm_Mate","Connector_Samtec_FSI/Samtec_FSI-110-XX-X-D_2x10_P1.0mm_Socket","Connector_Samtec_FSI/Samtec_FSI-115-03-X-D-AD_2x15_P1.0mm_Socket_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-115-03-X-D_2x15_P1.0mm_Socket","Connector_Samtec_FSI/Samtec_FSI-115-XX-X-D-AD_2x15_P1.0mm_Mate_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-115-XX-X-D-AD_2x15_P1.0mm_Socket_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-115-XX-X-D_2x15_P1.0mm_Mate","Connector_Samtec_FSI/Samtec_FSI-115-XX-X-D_2x15_P1.0mm_Socket","Connector_Samtec_FSI/Samtec_FSI-120-03-X-D-AD_2x20_P1.0mm_Socket_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-120-03-X-D-M-AD_2x20_P1.0mm_Socket_Threaded_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-120-03-X-D-M_2x20_P1.0mm_Socket_Threaded","Connector_Samtec_FSI/Samtec_FSI-120-03-X-D_2x20_P1.0mm_Socket","Connector_Samtec_FSI/Samtec_FSI-120-XX-X-D-AD_2x20_P1.0mm_Mate_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-120-XX-X-D-AD_2x20_P1.0mm_Socket_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-120-XX-X-D-M-AD_2x20_P1.0mm_Mate_Threaded_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-120-XX-X-D-M-AD_2x20_P1.0mm_Socket_Threaded_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-120-XX-X-D-M_2x20_P1.0mm_Mate_Threaded","Connector_Samtec_FSI/Samtec_FSI-120-XX-X-D-M_2x20_P1.0mm_Socket_Threaded","Connector_Samtec_FSI/Samtec_FSI-120-XX-X-D_2x20_P1.0mm_Mate","Connector_Samtec_FSI/Samtec_FSI-120-XX-X-D_2x20_P1.0mm_Socket","Connector_Samtec_FSI/Samtec_FSI-125-03-X-D-AD_2x25_P1.0mm_Socket_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-125-03-X-D_2x25_P1.0mm_Socket","Connector_Samtec_FSI/Samtec_FSI-125-XX-X-D-AD_2x25_P1.0mm_Mate_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-125-XX-X-D-AD_2x25_P1.0mm_Socket_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-125-XX-X-D_2x25_P1.0mm_Mate","Connector_Samtec_FSI/Samtec_FSI-125-XX-X-D_2x25_P1.0mm_Socket","Connector_Samtec_FSI/Samtec_FSI-130-03-X-D-AD_2x30_P1.0mm_Socket_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-130-03-X-D-M-AD_2x30_P1.0mm_Socket_Threaded_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-130-03-X-D-M_2x30_P1.0mm_Socket_Threaded","Connector_Samtec_FSI/Samtec_FSI-130-03-X-D_2x30_P1.0mm_Socket","Connector_Samtec_FSI/Samtec_FSI-130-XX-X-D-AD_2x30_P1.0mm_Mate_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-130-XX-X-D-AD_2x30_P1.0mm_Socket_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-130-XX-X-D-M-AD_2x30_P1.0mm_Mate_Threaded_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-130-XX-X-D-M-AD_2x30_P1.0mm_Socket_Threaded_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-130-XX-X-D-M_2x30_P1.0mm_Mate_Threaded","Connector_Samtec_FSI/Samtec_FSI-130-XX-X-D-M_2x30_P1.0mm_Socket_Threaded","Connector_Samtec_FSI/Samtec_FSI-130-XX-X-D_2x30_P1.0mm_Mate","Connector_Samtec_FSI/Samtec_FSI-130-XX-X-D_2x30_P1.0mm_Socket","Connector_Samtec_FSI/Samtec_FSI-135-03-X-D-AD_2x35_P1.0mm_Socket_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-135-03-X-D_2x35_P1.0mm_Socket","Connector_Samtec_FSI/Samtec_FSI-135-XX-X-D-AD_2x35_P1.0mm_Mate_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-135-XX-X-D-AD_2x35_P1.0mm_Socket_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-135-XX-X-D_2x35_P1.0mm_Mate","Connector_Samtec_FSI/Samtec_FSI-135-XX-X-D_2x35_P1.0mm_Socket","Connector_Samtec_FSI/Samtec_FSI-140-03-X-D-AD_2x40_P1.0mm_Socket_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-140-03-X-D-M-AD_2x40_P1.0mm_Pol20_Socket_Threaded_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-140-03-X-D-M_2x40_P1.0mm_Pol20_Socket_Threaded","Connector_Samtec_FSI/Samtec_FSI-140-03-X-D_2x40_P1.0mm_Socket","Connector_Samtec_FSI/Samtec_FSI-140-XX-X-D-AD_2x40_P1.0mm_Mate_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-140-XX-X-D-AD_2x40_P1.0mm_Socket_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-140-XX-X-D-M-AD_2x40_P1.0mm_Pol20_Mate_Threaded_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-140-XX-X-D-M-AD_2x40_P1.0mm_Pol20_Socket_Threaded_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-140-XX-X-D-M_2x40_P1.0mm_Pol20_Mate_Threaded","Connector_Samtec_FSI/Samtec_FSI-140-XX-X-D-M_2x40_P1.0mm_Pol20_Socket_Threaded","Connector_Samtec_FSI/Samtec_FSI-140-XX-X-D_2x40_P1.0mm_Mate","Connector_Samtec_FSI/Samtec_FSI-140-XX-X-D_2x40_P1.0mm_Socket","Connector_Samtec_FSI/Samtec_FSI-145-03-X-D-AD_2x45_P1.0mm_Socket_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-145-03-X-D_2x45_P1.0mm_Socket","Connector_Samtec_FSI/Samtec_FSI-145-XX-X-D-AD_2x45_P1.0mm_Mate_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-145-XX-X-D-AD_2x45_P1.0mm_Socket_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-145-XX-X-D_2x45_P1.0mm_Mate","Connector_Samtec_FSI/Samtec_FSI-145-XX-X-D_2x45_P1.0mm_Socket","Connector_Samtec_FSI/Samtec_FSI-150-03-X-D-AD_2x50_P1.0mm_Socket_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-150-03-X-D-M-AD_2x50_P1.0mm_Pol25_Socket_Threaded_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-150-03-X-D-M_2x50_P1.0mm_Pol25_Socket_Threaded","Connector_Samtec_FSI/Samtec_FSI-150-03-X-D_2x50_P1.0mm_Socket","Connector_Samtec_FSI/Samtec_FSI-150-XX-X-D-AD_2x50_P1.0mm_Mate_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-150-XX-X-D-AD_2x50_P1.0mm_Socket_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-150-XX-X-D-M-AD_2x50_P1.0mm_Pol25_Mate_Threaded_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-150-XX-X-D-M-AD_2x50_P1.0mm_Pol25_Socket_Threaded_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-150-XX-X-D-M_2x50_P1.0mm_Pol25_Mate_Threaded","Connector_Samtec_FSI/Samtec_FSI-150-XX-X-D-M_2x50_P1.0mm_Pol25_Socket_Threaded","Connector_Samtec_FSI/Samtec_FSI-150-XX-X-D_2x50_P1.0mm_Mate","Connector_Samtec_FSI/Samtec_FSI-150-XX-X-D_2x50_P1.0mm_Socket","Connector_Samtec_HLE_SMD/Samtec_HLE-102-02-xxx-DV-BE-LC_2x02_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-102-02-xxx-DV-BE_2x02_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-102-02-xxx-DV-LC_2x02_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-102-02-xxx-DV_2x02_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-103-02-xxx-DV-BE-LC_2x03_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-103-02-xxx-DV-BE_2x03_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-103-02-xxx-DV-LC_2x03_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-103-02-xxx-DV_2x03_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-104-02-xxx-DV-A_2x04_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-104-02-xxx-DV-BE-A_2x04_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-104-02-xxx-DV-BE-LC_2x04_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-104-02-xxx-DV-BE_2x04_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-104-02-xxx-DV-LC_2x04_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-104-02-xxx-DV_2x04_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-105-02-xxx-DV-A_2x05_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-105-02-xxx-DV-BE-A_2x05_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-105-02-xxx-DV-BE-LC_2x05_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-105-02-xxx-DV-BE_2x05_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-105-02-xxx-DV-LC_2x05_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-105-02-xxx-DV_2x05_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-106-02-xxx-DV-A_2x06_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-106-02-xxx-DV-BE-A_2x06_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-106-02-xxx-DV-BE-LC_2x06_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-106-02-xxx-DV-BE_2x06_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-106-02-xxx-DV-LC_2x06_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-106-02-xxx-DV_2x06_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-107-02-xxx-DV-A_2x07_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-107-02-xxx-DV-BE-A_2x07_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-107-02-xxx-DV-BE-LC_2x07_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-107-02-xxx-DV-BE_2x07_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-107-02-xxx-DV-LC_2x07_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-107-02-xxx-DV_2x07_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-108-02-xxx-DV-A_2x08_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-108-02-xxx-DV-BE-A_2x08_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-108-02-xxx-DV-BE-LC_2x08_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-108-02-xxx-DV-BE_2x08_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-108-02-xxx-DV-LC_2x08_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-108-02-xxx-DV_2x08_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-109-02-xxx-DV-A_2x09_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-109-02-xxx-DV-BE-A_2x09_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-109-02-xxx-DV-BE-LC_2x09_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-109-02-xxx-DV-BE_2x09_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-109-02-xxx-DV-LC_2x09_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-109-02-xxx-DV_2x09_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-110-02-xxx-DV-A_2x10_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-110-02-xxx-DV-BE-A_2x10_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-110-02-xxx-DV-BE-LC_2x10_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-110-02-xxx-DV-BE_2x10_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-110-02-xxx-DV-LC_2x10_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-110-02-xxx-DV_2x10_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-111-02-xxx-DV-A_2x11_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-111-02-xxx-DV-BE-A_2x11_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-111-02-xxx-DV-BE-LC_2x11_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-111-02-xxx-DV-BE_2x11_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-111-02-xxx-DV-LC_2x11_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-111-02-xxx-DV_2x11_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-112-02-xxx-DV-A_2x12_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-112-02-xxx-DV-BE-A_2x12_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-112-02-xxx-DV-BE-LC_2x12_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-112-02-xxx-DV-BE_2x12_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-112-02-xxx-DV-LC_2x12_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-112-02-xxx-DV_2x12_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-113-02-xxx-DV-A_2x13_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-113-02-xxx-DV-BE-A_2x13_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-113-02-xxx-DV-BE-LC_2x13_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-113-02-xxx-DV-BE_2x13_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-113-02-xxx-DV-LC_2x13_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-113-02-xxx-DV_2x13_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-114-02-xxx-DV-A_2x14_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-114-02-xxx-DV-BE-A_2x14_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-114-02-xxx-DV-BE-LC_2x14_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-114-02-xxx-DV-BE_2x14_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-114-02-xxx-DV-LC_2x14_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-114-02-xxx-DV_2x14_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-115-02-xxx-DV-A_2x15_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-115-02-xxx-DV-BE-A_2x15_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-115-02-xxx-DV-BE-LC_2x15_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-115-02-xxx-DV-BE_2x15_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-115-02-xxx-DV-LC_2x15_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-115-02-xxx-DV_2x15_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-116-02-xxx-DV-A_2x16_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-116-02-xxx-DV-BE-A_2x16_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-116-02-xxx-DV-BE-LC_2x16_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-116-02-xxx-DV-BE_2x16_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-116-02-xxx-DV-LC_2x16_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-116-02-xxx-DV_2x16_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-117-02-xxx-DV-A_2x17_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-117-02-xxx-DV-BE-A_2x17_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-117-02-xxx-DV-BE-LC_2x17_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-117-02-xxx-DV-BE_2x17_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-117-02-xxx-DV-LC_2x17_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-117-02-xxx-DV_2x17_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-118-02-xxx-DV-A_2x18_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-118-02-xxx-DV-BE-A_2x18_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-118-02-xxx-DV-BE-LC_2x18_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-118-02-xxx-DV-BE_2x18_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-118-02-xxx-DV-LC_2x18_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-118-02-xxx-DV_2x18_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-119-02-xxx-DV-A_2x19_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-119-02-xxx-DV-BE-A_2x19_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-119-02-xxx-DV-BE-LC_2x19_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-119-02-xxx-DV-BE_2x19_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-119-02-xxx-DV-LC_2x19_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-119-02-xxx-DV_2x19_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-120-02-xxx-DV-A_2x20_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-120-02-xxx-DV-BE-A_2x20_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-120-02-xxx-DV-BE-LC_2x20_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-120-02-xxx-DV-BE_2x20_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-120-02-xxx-DV-LC_2x20_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-120-02-xxx-DV_2x20_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-121-02-xxx-DV-A_2x21_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-121-02-xxx-DV-BE-A_2x21_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-121-02-xxx-DV-BE-LC_2x21_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-121-02-xxx-DV-BE_2x21_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-121-02-xxx-DV-LC_2x21_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-121-02-xxx-DV_2x21_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-122-02-xxx-DV-A_2x22_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-122-02-xxx-DV-BE-A_2x22_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-122-02-xxx-DV-BE-LC_2x22_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-122-02-xxx-DV-BE_2x22_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-122-02-xxx-DV-LC_2x22_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-122-02-xxx-DV_2x22_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-123-02-xxx-DV-A_2x23_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-123-02-xxx-DV-BE-A_2x23_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-123-02-xxx-DV-BE-LC_2x23_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-123-02-xxx-DV-BE_2x23_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-123-02-xxx-DV-LC_2x23_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-123-02-xxx-DV_2x23_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-124-02-xxx-DV-A_2x24_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-124-02-xxx-DV-BE-A_2x24_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-124-02-xxx-DV-BE-LC_2x24_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-124-02-xxx-DV-BE_2x24_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-124-02-xxx-DV-LC_2x24_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-124-02-xxx-DV_2x24_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-125-02-xxx-DV-A_2x25_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-125-02-xxx-DV-BE-A_2x25_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-125-02-xxx-DV-BE-LC_2x25_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-125-02-xxx-DV-BE_2x25_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-125-02-xxx-DV-LC_2x25_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-125-02-xxx-DV_2x25_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-126-02-xxx-DV-A_2x26_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-126-02-xxx-DV-BE-A_2x26_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-126-02-xxx-DV-BE-LC_2x26_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-126-02-xxx-DV-BE_2x26_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-126-02-xxx-DV-LC_2x26_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-126-02-xxx-DV_2x26_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-127-02-xxx-DV-A_2x27_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-127-02-xxx-DV-BE-A_2x27_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-127-02-xxx-DV-BE-LC_2x27_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-127-02-xxx-DV-BE_2x27_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-127-02-xxx-DV-LC_2x27_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-127-02-xxx-DV_2x27_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-128-02-xxx-DV-A_2x28_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-128-02-xxx-DV-BE-A_2x28_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-128-02-xxx-DV-BE-LC_2x28_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-128-02-xxx-DV-BE_2x28_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-128-02-xxx-DV-LC_2x28_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-128-02-xxx-DV_2x28_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-129-02-xxx-DV-A_2x29_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-129-02-xxx-DV-BE-A_2x29_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-129-02-xxx-DV-BE-LC_2x29_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-129-02-xxx-DV-BE_2x29_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-129-02-xxx-DV-LC_2x29_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-129-02-xxx-DV_2x29_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-130-02-xxx-DV-A_2x30_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-130-02-xxx-DV-BE-A_2x30_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-130-02-xxx-DV-BE-LC_2x30_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-130-02-xxx-DV-BE_2x30_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-130-02-xxx-DV-LC_2x30_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-130-02-xxx-DV_2x30_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-131-02-xxx-DV-A_2x31_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-131-02-xxx-DV-BE-A_2x31_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-131-02-xxx-DV-BE-LC_2x31_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-131-02-xxx-DV-BE_2x31_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-131-02-xxx-DV-LC_2x31_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-131-02-xxx-DV_2x31_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-132-02-xxx-DV-A_2x32_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-132-02-xxx-DV-BE-A_2x32_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-132-02-xxx-DV-BE-LC_2x32_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-132-02-xxx-DV-BE_2x32_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-132-02-xxx-DV-LC_2x32_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-132-02-xxx-DV_2x32_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-133-02-xxx-DV-A_2x33_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-133-02-xxx-DV-BE-A_2x33_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-133-02-xxx-DV-BE-LC_2x33_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-133-02-xxx-DV-BE_2x33_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-133-02-xxx-DV-LC_2x33_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-133-02-xxx-DV_2x33_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-134-02-xxx-DV-A_2x34_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-134-02-xxx-DV-BE-A_2x34_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-134-02-xxx-DV-BE-LC_2x34_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-134-02-xxx-DV-BE_2x34_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-134-02-xxx-DV-LC_2x34_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-134-02-xxx-DV_2x34_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-135-02-xxx-DV-A_2x35_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-135-02-xxx-DV-BE-A_2x35_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-135-02-xxx-DV-BE-LC_2x35_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-135-02-xxx-DV-BE_2x35_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-135-02-xxx-DV-LC_2x35_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-135-02-xxx-DV_2x35_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-136-02-xxx-DV-A_2x36_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-136-02-xxx-DV-BE-A_2x36_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-136-02-xxx-DV-BE-LC_2x36_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-136-02-xxx-DV-BE_2x36_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-136-02-xxx-DV-LC_2x36_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-136-02-xxx-DV_2x36_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-137-02-xxx-DV-A_2x37_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-137-02-xxx-DV-BE-A_2x37_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-137-02-xxx-DV-BE-LC_2x37_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-137-02-xxx-DV-BE_2x37_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-137-02-xxx-DV-LC_2x37_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-137-02-xxx-DV_2x37_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-138-02-xxx-DV-A_2x38_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-138-02-xxx-DV-BE-A_2x38_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-138-02-xxx-DV-BE-LC_2x38_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-138-02-xxx-DV-BE_2x38_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-138-02-xxx-DV-LC_2x38_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-138-02-xxx-DV_2x38_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-139-02-xxx-DV-A_2x39_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-139-02-xxx-DV-BE-A_2x39_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-139-02-xxx-DV-BE-LC_2x39_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-139-02-xxx-DV-BE_2x39_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-139-02-xxx-DV-LC_2x39_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-139-02-xxx-DV_2x39_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-140-02-xxx-DV-A_2x40_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-140-02-xxx-DV-BE-A_2x40_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-140-02-xxx-DV-BE-LC_2x40_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-140-02-xxx-DV-BE_2x40_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-140-02-xxx-DV-LC_2x40_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-140-02-xxx-DV_2x40_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-141-02-xxx-DV-A_2x41_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-141-02-xxx-DV-BE-A_2x41_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-141-02-xxx-DV-BE-LC_2x41_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-141-02-xxx-DV-BE_2x41_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-141-02-xxx-DV-LC_2x41_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-141-02-xxx-DV_2x41_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-142-02-xxx-DV-A_2x42_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-142-02-xxx-DV-BE-A_2x42_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-142-02-xxx-DV-BE-LC_2x42_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-142-02-xxx-DV-BE_2x42_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-142-02-xxx-DV-LC_2x42_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-142-02-xxx-DV_2x42_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-143-02-xxx-DV-A_2x43_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-143-02-xxx-DV-BE-A_2x43_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-143-02-xxx-DV-BE-LC_2x43_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-143-02-xxx-DV-BE_2x43_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-143-02-xxx-DV-LC_2x43_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-143-02-xxx-DV_2x43_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-144-02-xxx-DV-A_2x44_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-144-02-xxx-DV-BE-A_2x44_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-144-02-xxx-DV-BE-LC_2x44_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-144-02-xxx-DV-BE_2x44_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-144-02-xxx-DV-LC_2x44_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-144-02-xxx-DV_2x44_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-145-02-xxx-DV-A_2x45_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-145-02-xxx-DV-BE-A_2x45_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-145-02-xxx-DV-BE-LC_2x45_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-145-02-xxx-DV-BE_2x45_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-145-02-xxx-DV-LC_2x45_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-145-02-xxx-DV_2x45_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-146-02-xxx-DV-A_2x46_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-146-02-xxx-DV-BE-A_2x46_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-146-02-xxx-DV-BE-LC_2x46_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-146-02-xxx-DV-BE_2x46_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-146-02-xxx-DV-LC_2x46_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-146-02-xxx-DV_2x46_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-147-02-xxx-DV-A_2x47_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-147-02-xxx-DV-BE-A_2x47_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-147-02-xxx-DV-BE-LC_2x47_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-147-02-xxx-DV-BE_2x47_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-147-02-xxx-DV-LC_2x47_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-147-02-xxx-DV_2x47_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-148-02-xxx-DV-A_2x48_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-148-02-xxx-DV-BE-A_2x48_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-148-02-xxx-DV-BE-LC_2x48_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-148-02-xxx-DV-BE_2x48_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-148-02-xxx-DV-LC_2x48_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-148-02-xxx-DV_2x48_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-149-02-xxx-DV-A_2x49_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-149-02-xxx-DV-BE-A_2x49_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-149-02-xxx-DV-BE-LC_2x49_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-149-02-xxx-DV-BE_2x49_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-149-02-xxx-DV-LC_2x49_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-149-02-xxx-DV_2x49_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-150-02-xxx-DV-A_2x50_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-150-02-xxx-DV-BE-A_2x50_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-150-02-xxx-DV-BE-LC_2x50_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-150-02-xxx-DV-BE_2x50_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-150-02-xxx-DV-LC_2x50_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-150-02-xxx-DV_2x50_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-104-02-xx-DV-PE-LC_2x04_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-104-02-xx-DV-PE_2x04_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-104-02-xx-DV-TE_2x04_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-105-02-xx-DV-PE-LC_2x05_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-105-02-xx-DV-PE_2x05_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-105-02-xx-DV-TE_2x05_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-106-02-xx-DV-PE-LC_2x06_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-106-02-xx-DV-PE_2x06_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-106-02-xx-DV-TE_2x06_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-107-02-xx-DV-PE-LC_2x07_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-107-02-xx-DV-PE_2x07_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-107-02-xx-DV-TE_2x07_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-108-02-xx-DV-PE-LC_2x08_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-108-02-xx-DV-PE_2x08_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-108-02-xx-DV-TE_2x08_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-109-02-xx-DV-PE-LC_2x09_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-109-02-xx-DV-PE_2x09_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-109-02-xx-DV-TE_2x09_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-110-02-xx-DV-PE-LC_2x10_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-110-02-xx-DV-PE_2x10_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-110-02-xx-DV-TE_2x10_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-111-02-xx-DV-PE-LC_2x11_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-111-02-xx-DV-PE_2x11_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-111-02-xx-DV-TE_2x11_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-112-02-xx-DV-PE-LC_2x12_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-112-02-xx-DV-PE_2x12_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-112-02-xx-DV-TE_2x12_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-113-02-xx-DV-PE-LC_2x13_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-113-02-xx-DV-PE_2x13_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-113-02-xx-DV-TE_2x13_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-114-02-xx-DV-PE-LC_2x14_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-114-02-xx-DV-PE_2x14_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-114-02-xx-DV-TE_2x14_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-115-02-xx-DV-PE-LC_2x15_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-115-02-xx-DV-PE_2x15_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-115-02-xx-DV-TE_2x15_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-116-02-xx-DV-PE-LC_2x16_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-116-02-xx-DV-PE_2x16_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-116-02-xx-DV-TE_2x16_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-117-02-xx-DV-PE-LC_2x17_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-117-02-xx-DV-PE_2x17_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-117-02-xx-DV-TE_2x17_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-118-02-xx-DV-PE-LC_2x18_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-118-02-xx-DV-PE_2x18_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-118-02-xx-DV-TE_2x18_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-119-02-xx-DV-PE-LC_2x19_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-119-02-xx-DV-PE_2x19_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-119-02-xx-DV-TE_2x19_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-120-02-xx-DV-PE-LC_2x20_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-120-02-xx-DV-PE_2x20_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-120-02-xx-DV-TE_2x20_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-121-02-xx-DV-PE-LC_2x21_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-121-02-xx-DV-PE_2x21_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-121-02-xx-DV-TE_2x21_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-122-02-xx-DV-PE-LC_2x22_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-122-02-xx-DV-PE_2x22_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-122-02-xx-DV-TE_2x22_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-123-02-xx-DV-PE-LC_2x23_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-123-02-xx-DV-PE_2x23_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-123-02-xx-DV-TE_2x23_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-124-02-xx-DV-PE-LC_2x24_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-124-02-xx-DV-PE_2x24_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-124-02-xx-DV-TE_2x24_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-125-02-xx-DV-PE-LC_2x25_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-125-02-xx-DV-PE_2x25_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-125-02-xx-DV-TE_2x25_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-126-02-xx-DV-PE-LC_2x26_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-126-02-xx-DV-PE_2x26_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-126-02-xx-DV-TE_2x26_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-127-02-xx-DV-PE-LC_2x27_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-127-02-xx-DV-PE_2x27_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-127-02-xx-DV-TE_2x27_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-128-02-xx-DV-PE-LC_2x28_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-128-02-xx-DV-PE_2x28_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-128-02-xx-DV-TE_2x28_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-129-02-xx-DV-PE-LC_2x29_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-129-02-xx-DV-PE_2x29_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-129-02-xx-DV-TE_2x29_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-130-02-xx-DV-PE-LC_2x30_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-130-02-xx-DV-PE_2x30_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-130-02-xx-DV-TE_2x30_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-131-02-xx-DV-PE-LC_2x31_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-131-02-xx-DV-PE_2x31_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-131-02-xx-DV-TE_2x31_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-132-02-xx-DV-PE-LC_2x32_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-132-02-xx-DV-PE_2x32_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-132-02-xx-DV-TE_2x32_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-133-02-xx-DV-PE-LC_2x33_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-133-02-xx-DV-PE_2x33_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-133-02-xx-DV-TE_2x33_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-134-02-xx-DV-PE-LC_2x34_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-134-02-xx-DV-PE_2x34_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-134-02-xx-DV-TE_2x34_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-135-02-xx-DV-PE-LC_2x35_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-135-02-xx-DV-PE_2x35_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-135-02-xx-DV-TE_2x35_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-136-02-xx-DV-PE-LC_2x36_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-136-02-xx-DV-PE_2x36_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-136-02-xx-DV-TE_2x36_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-137-02-xx-DV-PE-LC_2x37_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-137-02-xx-DV-PE_2x37_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-137-02-xx-DV-TE_2x37_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-138-02-xx-DV-PE-LC_2x38_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-138-02-xx-DV-PE_2x38_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-138-02-xx-DV-TE_2x38_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-139-02-xx-DV-PE-LC_2x39_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-139-02-xx-DV-PE_2x39_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-139-02-xx-DV-TE_2x39_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-140-02-xx-DV-PE-LC_2x40_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-140-02-xx-DV-PE_2x40_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-140-02-xx-DV-TE_2x40_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-141-02-xx-DV-PE-LC_2x41_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-141-02-xx-DV-PE_2x41_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-141-02-xx-DV-TE_2x41_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-142-02-xx-DV-PE-LC_2x42_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-142-02-xx-DV-PE_2x42_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-142-02-xx-DV-TE_2x42_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-143-02-xx-DV-PE-LC_2x43_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-143-02-xx-DV-PE_2x43_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-143-02-xx-DV-TE_2x43_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-144-02-xx-DV-PE-LC_2x44_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-144-02-xx-DV-PE_2x44_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-144-02-xx-DV-TE_2x44_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-145-02-xx-DV-PE-LC_2x45_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-145-02-xx-DV-PE_2x45_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-145-02-xx-DV-TE_2x45_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-146-02-xx-DV-PE-LC_2x46_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-146-02-xx-DV-PE_2x46_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-146-02-xx-DV-TE_2x46_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-147-02-xx-DV-PE-LC_2x47_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-147-02-xx-DV-PE_2x47_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-147-02-xx-DV-TE_2x47_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-148-02-xx-DV-PE-LC_2x48_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-148-02-xx-DV-PE_2x48_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-148-02-xx-DV-TE_2x48_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-149-02-xx-DV-PE-LC_2x49_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-149-02-xx-DV-PE_2x49_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-149-02-xx-DV-TE_2x49_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-150-02-xx-DV-PE-LC_2x50_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-150-02-xx-DV-PE_2x50_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-150-02-xx-DV-TE_2x50_P2.54mm_Horizontal","Connector_Samtec_HPM_THT/Samtec_HPM-01-01-x-S_Straight_1x01_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-01-05-x-S_Straight_1x01_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-02-01-x-S_Straight_1x02_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-02-05-x-S_Straight_1x02_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-03-01-x-S_Straight_1x03_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-03-05-x-S_Straight_1x03_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-04-01-x-S_Straight_1x04_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-04-05-x-S_Straight_1x04_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-05-01-x-S_Straight_1x05_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-05-05-x-S_Straight_1x05_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-06-01-x-S_Straight_1x06_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-06-05-x-S_Straight_1x06_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-07-01-x-S_Straight_1x07_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-07-05-x-S_Straight_1x07_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-08-01-x-S_Straight_1x08_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-08-05-x-S_Straight_1x08_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-09-01-x-S_Straight_1x09_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-09-05-x-S_Straight_1x09_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-10-01-x-S_Straight_1x10_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-10-05-x-S_Straight_1x10_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-11-01-x-S_Straight_1x11_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-11-05-x-S_Straight_1x11_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-12-01-x-S_Straight_1x12_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-12-05-x-S_Straight_1x12_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-13-01-x-S_Straight_1x13_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-13-05-x-S_Straight_1x13_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-14-01-x-S_Straight_1x14_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-14-05-x-S_Straight_1x14_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-15-01-x-S_Straight_1x15_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-15-05-x-S_Straight_1x15_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-16-01-x-S_Straight_1x16_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-16-05-x-S_Straight_1x16_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-17-01-x-S_Straight_1x17_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-17-05-x-S_Straight_1x17_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-18-01-x-S_Straight_1x18_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-18-05-x-S_Straight_1x18_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-19-01-x-S_Straight_1x19_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-19-05-x-S_Straight_1x19_Pitch5.08mm","Connector_Samtec_HSEC8/Samtec_HSEC8-109-01-X-DV-A-BL_2x09_P0.8mm_Pol04_Socket_WeldTabs_BoardLocks","Connector_Samtec_HSEC8/Samtec_HSEC8-109-01-X-DV-A-WT_2x09_P0.8mm_Pol04_Socket_WeldTabs","Connector_Samtec_HSEC8/Samtec_HSEC8-109-X-X-DV-BL_2x09_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-109-X-X-DV_2x09_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-109-X-X-DV_2x09_P0.8mm_Wing_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-110-01-X-DV-A-BL_2x10_P0.8mm_Socket_WeldTabs_BoardLocks","Connector_Samtec_HSEC8/Samtec_HSEC8-110-01-X-DV-A-WT_2x10_P0.8mm_Socket_WeldTabs","Connector_Samtec_HSEC8/Samtec_HSEC8-110-01-X-DV-A_2x10_P0.8mm_Socket_AlignmentPins","Connector_Samtec_HSEC8/Samtec_HSEC8-110-01-X-DV_2x10_P0.8mm_Socket","Connector_Samtec_HSEC8/Samtec_HSEC8-110-03-X-DV-A-WT_2x10_P0.8mm_Socket_WeldTabs","Connector_Samtec_HSEC8/Samtec_HSEC8-110-03-X-DV-A_2x10_P0.8mm_Socket_AlignmentPins","Connector_Samtec_HSEC8/Samtec_HSEC8-110-03-X-DV_2x10_P0.8mm_Socket","Connector_Samtec_HSEC8/Samtec_HSEC8-110-X-X-DV-BL_2x10_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-110-X-X-DV_2x10_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-110-X-X-DV_2x10_P0.8mm_Wing_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-1100-01-X-DV-A-BL_2x100_P0.8mm_Pol32_Socket_WeldTabs_BoardLocks","Connector_Samtec_HSEC8/Samtec_HSEC8-1100-01-X-DV-A-WT_2x100_P0.8mm_Pol32_Socket_WeldTabs","Connector_Samtec_HSEC8/Samtec_HSEC8-1100-01-X-DV-A_2x100_P0.8mm_Pol32_Socket_AlignmentPins","Connector_Samtec_HSEC8/Samtec_HSEC8-1100-01-X-DV_2x100_P0.8mm_Pol32_Socket","Connector_Samtec_HSEC8/Samtec_HSEC8-1100-03-X-DV-A-WT_2x100_P0.8mm_Pol32_Socket_WeldTabs","Connector_Samtec_HSEC8/Samtec_HSEC8-1100-03-X-DV-A_2x100_P0.8mm_Pol32_Socket_AlignmentPins","Connector_Samtec_HSEC8/Samtec_HSEC8-1100-03-X-DV_2x100_P0.8mm_Pol32_Socket","Connector_Samtec_HSEC8/Samtec_HSEC8-1100-X-X-DV-BL_2x100_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-1100-X-X-DV_2x100_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-1100-X-X-DV_2x100_P0.8mm_Wing_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-113-01-X-DV-A-BL_2x13_P0.8mm_Pol06_Socket_WeldTabs_BoardLocks","Connector_Samtec_HSEC8/Samtec_HSEC8-113-01-X-DV-A-WT_2x13_P0.8mm_Pol06_Socket_WeldTabs","Connector_Samtec_HSEC8/Samtec_HSEC8-113-01-X-DV-A_2x13_P0.8mm_Pol06_Socket_AlignmentPins","Connector_Samtec_HSEC8/Samtec_HSEC8-113-01-X-DV_2x13_P0.8mm_Pol06_Socket","Connector_Samtec_HSEC8/Samtec_HSEC8-113-X-X-DV-BL_2x13_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-113-X-X-DV_2x13_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-113-X-X-DV_2x13_P0.8mm_Wing_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-120-01-X-DV-A-BL_2x20_P0.8mm_Socket_WeldTabs_BoardLocks","Connector_Samtec_HSEC8/Samtec_HSEC8-120-01-X-DV-A-WT_2x20_P0.8mm_Socket_WeldTabs","Connector_Samtec_HSEC8/Samtec_HSEC8-120-01-X-DV-A_2x20_P0.8mm_Socket_AlignmentPins","Connector_Samtec_HSEC8/Samtec_HSEC8-120-01-X-DV_2x20_P0.8mm_Socket","Connector_Samtec_HSEC8/Samtec_HSEC8-120-03-X-DV-A-WT_2x20_P0.8mm_Socket_WeldTabs","Connector_Samtec_HSEC8/Samtec_HSEC8-120-03-X-DV-A_2x20_P0.8mm_Socket_AlignmentPins","Connector_Samtec_HSEC8/Samtec_HSEC8-120-03-X-DV_2x20_P0.8mm_Socket","Connector_Samtec_HSEC8/Samtec_HSEC8-120-X-X-DV-BL_2x20_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-120-X-X-DV_2x20_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-120-X-X-DV_2x20_P0.8mm_Wing_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-125-01-X-DV-A-BL_2x25_P0.8mm_Pol06_Socket_WeldTabs_BoardLocks","Connector_Samtec_HSEC8/Samtec_HSEC8-125-01-X-DV-A-WT_2x25_P0.8mm_Pol06_Socket_WeldTabs","Connector_Samtec_HSEC8/Samtec_HSEC8-125-01-X-DV-A_2x25_P0.8mm_Pol06_Socket_AlignmentPins","Connector_Samtec_HSEC8/Samtec_HSEC8-125-01-X-DV_2x25_P0.8mm_Pol06_Socket","Connector_Samtec_HSEC8/Samtec_HSEC8-125-X-X-DV-BL_2x25_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-125-X-X-DV_2x25_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-125-X-X-DV_2x25_P0.8mm_Wing_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-130-01-X-DV-A-BL_2x30_P0.8mm_Socket_WeldTabs_BoardLocks","Connector_Samtec_HSEC8/Samtec_HSEC8-130-01-X-DV-A-WT_2x30_P0.8mm_Socket_WeldTabs","Connector_Samtec_HSEC8/Samtec_HSEC8-130-01-X-DV-A_2x30_P0.8mm_Socket_AlignmentPins","Connector_Samtec_HSEC8/Samtec_HSEC8-130-01-X-DV_2x30_P0.8mm_Socket","Connector_Samtec_HSEC8/Samtec_HSEC8-130-03-X-DV-A-WT_2x30_P0.8mm_Socket_WeldTabs","Connector_Samtec_HSEC8/Samtec_HSEC8-130-03-X-DV-A_2x30_P0.8mm_Socket_AlignmentPins","Connector_Samtec_HSEC8/Samtec_HSEC8-130-03-X-DV_2x30_P0.8mm_Socket","Connector_Samtec_HSEC8/Samtec_HSEC8-130-X-X-DV-BL_2x30_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-130-X-X-DV_2x30_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-130-X-X-DV_2x30_P0.8mm_Wing_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-137-01-X-DV-A-BL_2x37_P0.8mm_Pol21_Socket_WeldTabs_BoardLocks","Connector_Samtec_HSEC8/Samtec_HSEC8-137-01-X-DV-A-WT_2x37_P0.8mm_Pol21_Socket_WeldTabs","Connector_Samtec_HSEC8/Samtec_HSEC8-137-01-X-DV-A_2x37_P0.8mm_Pol21_Socket_AlignmentPins","Connector_Samtec_HSEC8/Samtec_HSEC8-137-01-X-DV_2x37_P0.8mm_Pol21_Socket","Connector_Samtec_HSEC8/Samtec_HSEC8-137-X-X-DV-BL_2x37_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-137-X-X-DV_2x37_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-137-X-X-DV_2x37_P0.8mm_Wing_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-140-01-X-DV-A-BL_2x40_P0.8mm_Pol22_Socket_WeldTabs_BoardLocks","Connector_Samtec_HSEC8/Samtec_HSEC8-140-01-X-DV-A-WT_2x40_P0.8mm_Pol22_Socket_WeldTabs","Connector_Samtec_HSEC8/Samtec_HSEC8-140-01-X-DV-A_2x40_P0.8mm_Pol22_Socket_AlignmentPins","Connector_Samtec_HSEC8/Samtec_HSEC8-140-01-X-DV_2x40_P0.8mm_Pol22_Socket","Connector_Samtec_HSEC8/Samtec_HSEC8-140-03-X-DV-A-WT_2x40_P0.8mm_Pol22_Socket_WeldTabs","Connector_Samtec_HSEC8/Samtec_HSEC8-140-03-X-DV-A_2x40_P0.8mm_Pol22_Socket_AlignmentPins","Connector_Samtec_HSEC8/Samtec_HSEC8-140-03-X-DV_2x40_P0.8mm_Pol22_Socket","Connector_Samtec_HSEC8/Samtec_HSEC8-140-X-X-DV-BL_2x40_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-140-X-X-DV_2x40_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-140-X-X-DV_2x40_P0.8mm_Wing_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-149-01-X-DV-A-BL_2x49_P0.8mm_Pol27_Socket_WeldTabs_BoardLocks","Connector_Samtec_HSEC8/Samtec_HSEC8-149-01-X-DV-A-WT_2x49_P0.8mm_Pol27_Socket_WeldTabs","Connector_Samtec_HSEC8/Samtec_HSEC8-149-01-X-DV-A_2x49_P0.8mm_Pol27_Socket_AlignmentPins","Connector_Samtec_HSEC8/Samtec_HSEC8-149-01-X-DV_2x49_P0.8mm_Pol27_Socket","Connector_Samtec_HSEC8/Samtec_HSEC8-149-X-X-DV-BL_2x49_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-149-X-X-DV_2x49_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-149-X-X-DV_2x49_P0.8mm_Wing_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-150-01-X-DV-A-BL_2x50_P0.8mm_Pol27_Socket_WeldTabs_BoardLocks","Connector_Samtec_HSEC8/Samtec_HSEC8-150-01-X-DV-A-WT_2x50_P0.8mm_Pol27_Socket_WeldTabs","Connector_Samtec_HSEC8/Samtec_HSEC8-150-01-X-DV-A_2x50_P0.8mm_Pol27_Socket_AlignmentPins","Connector_Samtec_HSEC8/Samtec_HSEC8-150-01-X-DV_2x50_P0.8mm_Pol27_Socket","Connector_Samtec_HSEC8/Samtec_HSEC8-150-03-X-DV-A-WT_2x50_P0.8mm_Pol27_Socket_WeldTabs","Connector_Samtec_HSEC8/Samtec_HSEC8-150-03-X-DV-A_2x50_P0.8mm_Pol27_Socket_AlignmentPins","Connector_Samtec_HSEC8/Samtec_HSEC8-150-03-X-DV_2x50_P0.8mm_Pol27_Socket","Connector_Samtec_HSEC8/Samtec_HSEC8-150-X-X-DV-BL_2x50_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-150-X-X-DV_2x50_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-150-X-X-DV_2x50_P0.8mm_Wing_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-160-01-X-DV-A-BL_2x60_P0.8mm_Pol32_Socket_WeldTabs_BoardLocks","Connector_Samtec_HSEC8/Samtec_HSEC8-160-01-X-DV-A-WT_2x60_P0.8mm_Pol32_Socket_WeldTabs","Connector_Samtec_HSEC8/Samtec_HSEC8-160-01-X-DV-A_2x60_P0.8mm_Pol32_Socket_AlignmentPins","Connector_Samtec_HSEC8/Samtec_HSEC8-160-01-X-DV_2x60_P0.8mm_Pol32_Socket","Connector_Samtec_HSEC8/Samtec_HSEC8-160-03-X-DV-A-WT_2x60_P0.8mm_Pol32_Socket_WeldTabs","Connector_Samtec_HSEC8/Samtec_HSEC8-160-03-X-DV-A_2x60_P0.8mm_Pol32_Socket_AlignmentPins","Connector_Samtec_HSEC8/Samtec_HSEC8-160-03-X-DV_2x60_P0.8mm_Pol32_Socket","Connector_Samtec_HSEC8/Samtec_HSEC8-160-X-X-DV-BL_2x60_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-160-X-X-DV_2x60_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-160-X-X-DV_2x60_P0.8mm_Wing_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-170-01-X-DV-A-BL_2x70_P0.8mm_Pol32_Socket_WeldTabs_BoardLocks","Connector_Samtec_HSEC8/Samtec_HSEC8-170-01-X-DV-A-WT_2x70_P0.8mm_Pol32_Socket_WeldTabs","Connector_Samtec_HSEC8/Samtec_HSEC8-170-01-X-DV-A_2x70_P0.8mm_Pol32_Socket_AlignmentPins","Connector_Samtec_HSEC8/Samtec_HSEC8-170-01-X-DV_2x70_P0.8mm_Pol32_Socket","Connector_Samtec_HSEC8/Samtec_HSEC8-170-03-X-DV-A-WT_2x70_P0.8mm_Pol32_Socket_WeldTabs","Connector_Samtec_HSEC8/Samtec_HSEC8-170-03-X-DV-A_2x70_P0.8mm_Pol32_Socket_AlignmentPins","Connector_Samtec_HSEC8/Samtec_HSEC8-170-03-X-DV_2x70_P0.8mm_Pol32_Socket","Connector_Samtec_HSEC8/Samtec_HSEC8-170-X-X-DV-BL_2x70_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-170-X-X-DV_2x70_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-170-X-X-DV_2x70_P0.8mm_Wing_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-180-01-X-DV-A-BL_2x80_P0.8mm_Pol32_Socket_WeldTabs_BoardLocks","Connector_Samtec_HSEC8/Samtec_HSEC8-180-01-X-DV-A-WT_2x80_P0.8mm_Pol32_Socket_WeldTabs","Connector_Samtec_HSEC8/Samtec_HSEC8-180-01-X-DV-A_2x80_P0.8mm_Pol32_Socket_AlignmentPins","Connector_Samtec_HSEC8/Samtec_HSEC8-180-01-X-DV_2x80_P0.8mm_Pol32_Socket","Connector_Samtec_HSEC8/Samtec_HSEC8-180-03-X-DV-A-WT_2x80_P0.8mm_Pol32_Socket_WeldTabs","Connector_Samtec_HSEC8/Samtec_HSEC8-180-03-X-DV-A_2x80_P0.8mm_Pol32_Socket_AlignmentPins","Connector_Samtec_HSEC8/Samtec_HSEC8-180-03-X-DV_2x80_P0.8mm_Pol32_Socket","Connector_Samtec_HSEC8/Samtec_HSEC8-180-X-X-DV-BL_2x80_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-180-X-X-DV_2x80_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-180-X-X-DV_2x80_P0.8mm_Wing_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-190-01-X-DV-A-BL_2x90_P0.8mm_Pol32_Socket_WeldTabs_BoardLocks","Connector_Samtec_HSEC8/Samtec_HSEC8-190-01-X-DV-A-WT_2x90_P0.8mm_Pol32_Socket_WeldTabs","Connector_Samtec_HSEC8/Samtec_HSEC8-190-01-X-DV-A_2x90_P0.8mm_Pol32_Socket_AlignmentPins","Connector_Samtec_HSEC8/Samtec_HSEC8-190-01-X-DV_2x90_P0.8mm_Pol32_Socket","Connector_Samtec_HSEC8/Samtec_HSEC8-190-03-X-DV-A-WT_2x90_P0.8mm_Pol32_Socket_WeldTabs","Connector_Samtec_HSEC8/Samtec_HSEC8-190-03-X-DV-A_2x90_P0.8mm_Pol32_Socket_AlignmentPins","Connector_Samtec_HSEC8/Samtec_HSEC8-190-03-X-DV_2x90_P0.8mm_Pol32_Socket","Connector_Samtec_HSEC8/Samtec_HSEC8-190-X-X-DV-BL_2x90_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-190-X-X-DV_2x90_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-190-X-X-DV_2x90_P0.8mm_Wing_Edge","Connector_Samtec_LTMM/Samtec_LTMM-104-02-X-D-SM-LC_2x04_P2.0mm_Header_Vertical_LockingClip","Connector_Samtec_LTMM/Samtec_LTMM-104-02-X-D-SM_2x04_P2.0mm_Header_Vertical","Connector_Samtec_LTMM/Samtec_LTMM-105-02-X-D-SM-LC_2x05_P2.0mm_Header_Vertical_LockingClip","Connector_Samtec_LTMM/Samtec_LTMM-105-02-X-D-SM_2x05_P2.0mm_Header_Vertical","Connector_Samtec_LTMM/Samtec_LTMM-106-02-X-D-SM-LC_2x06_P2.0mm_Header_Vertical_LockingClip","Connector_Samtec_LTMM/Samtec_LTMM-106-02-X-D-SM_2x06_P2.0mm_Header_Vertical","Connector_Samtec_LTMM/Samtec_LTMM-107-02-X-D-SM-LC_2x07_P2.0mm_Header_Vertical_LockingClip","Connector_Samtec_LTMM/Samtec_LTMM-107-02-X-D-SM_2x07_P2.0mm_Header_Vertical","Connector_Samtec_LTMM/Samtec_LTMM-108-02-X-D-SM-LC_2x08_P2.0mm_Header_Vertical_LockingClip","Connector_Samtec_LTMM/Samtec_LTMM-108-02-X-D-SM_2x08_P2.0mm_Header_Vertical","Connector_Samtec_LTMM/Samtec_LTMM-110-02-X-D-SM-LC_2x10_P2.0mm_Header_Vertical_LockingClip","Connector_Samtec_LTMM/Samtec_LTMM-110-02-X-D-SM_2x10_P2.0mm_Header_Vertical","Connector_Samtec_LTMM/Samtec_LTMM-112-02-X-D-SM-LC_2x12_P2.0mm_Header_Vertical_LockingClip","Connector_Samtec_LTMM/Samtec_LTMM-112-02-X-D-SM_2x12_P2.0mm_Header_Vertical","Connector_Samtec_LTMM/Samtec_LTMM-113-02-X-D-SM-LC_2x13_P2.0mm_Header_Vertical_LockingClip","Connector_Samtec_LTMM/Samtec_LTMM-113-02-X-D-SM_2x13_P2.0mm_Header_Vertical","Connector_Samtec_LTMM/Samtec_LTMM-115-02-X-D-SM-LC_2x15_P2.0mm_Header_Vertical_LockingClip","Connector_Samtec_LTMM/Samtec_LTMM-115-02-X-D-SM_2x15_P2.0mm_Header_Vertical","Connector_Samtec_LTMM/Samtec_LTMM-117-02-X-D-SM-LC_2x17_P2.0mm_Header_Vertical_LockingClip","Connector_Samtec_LTMM/Samtec_LTMM-117-02-X-D-SM_2x17_P2.0mm_Header_Vertical","Connector_Samtec_LTMM/Samtec_LTMM-120-02-X-D-SM-LC_2x20_P2.0mm_Header_Vertical_LockingClip","Connector_Samtec_LTMM/Samtec_LTMM-120-02-X-D-SM_2x20_P2.0mm_Header_Vertical","Connector_Samtec_LTMM/Samtec_LTMM-122-02-X-D-SM-LC_2x22_P2.0mm_Header_Vertical_LockingClip","Connector_Samtec_LTMM/Samtec_LTMM-122-02-X-D-SM_2x22_P2.0mm_Header_Vertical","Connector_Samtec_LTMM/Samtec_LTMM-125-02-X-D-SM-LC_2x25_P2.0mm_Header_Vertical_LockingClip","Connector_Samtec_LTMM/Samtec_LTMM-125-02-X-D-SM_2x25_P2.0mm_Header_Vertical","Connector_Samtec_MicroMate/Samtec_T1M-02-X-S-RA_1x02-1MP_P1.0mm_Terminal_Horizontal","Connector_Samtec_MicroMate/Samtec_T1M-02-X-S-V_1x02-1MP_P1.0mm_Terminal_Vertical","Connector_Samtec_MicroMate/Samtec_T1M-02-X-SH-L_1x02-1MP_P1.0mm_Terminal_Horizontal_Latch","Connector_Samtec_MicroMate/Samtec_T1M-02-X-SV-L_1x02-1MP_P1.0mm_Terminal_Vertical_Latch","Connector_Samtec_MicroMate/Samtec_T1M-03-X-S-RA_1x03-1MP_P1.0mm_Terminal_Horizontal","Connector_Samtec_MicroMate/Samtec_T1M-03-X-S-V_1x03-1MP_P1.0mm_Terminal_Vertical","Connector_Samtec_MicroMate/Samtec_T1M-03-X-SH-L_1x03-1MP_P1.0mm_Terminal_Horizontal_Latch","Connector_Samtec_MicroMate/Samtec_T1M-03-X-SV-L_1x03-1MP_P1.0mm_Terminal_Vertical_Latch","Connector_Samtec_MicroMate/Samtec_T1M-04-X-S-RA_1x04-1MP_P1.0mm_Terminal_Horizontal","Connector_Samtec_MicroMate/Samtec_T1M-04-X-S-V_1x04-1MP_P1.0mm_Terminal_Vertical","Connector_Samtec_MicroMate/Samtec_T1M-04-X-SH-L_1x04-1MP_P1.0mm_Terminal_Horizontal_Latch","Connector_Samtec_MicroMate/Samtec_T1M-04-X-SV-L_1x04-1MP_P1.0mm_Terminal_Vertical_Latch","Connector_Samtec_MicroMate/Samtec_T1M-05-X-S-RA_1x05-1MP_P1.0mm_Terminal_Horizontal","Connector_Samtec_MicroMate/Samtec_T1M-05-X-S-V_1x05-1MP_P1.0mm_Terminal_Vertical","Connector_Samtec_MicroMate/Samtec_T1M-05-X-SH-L_1x05-1MP_P1.0mm_Terminal_Horizontal_Latch","Connector_Samtec_MicroMate/Samtec_T1M-05-X-SV-L_1x05-1MP_P1.0mm_Terminal_Vertical_Latch","Connector_Samtec_MicroMate/Samtec_T1M-06-X-S-RA_1x06-1MP_P1.0mm_Terminal_Horizontal","Connector_Samtec_MicroMate/Samtec_T1M-06-X-S-V_1x06-1MP_P1.0mm_Terminal_Vertical","Connector_Samtec_MicroMate/Samtec_T1M-06-X-SH-L_1x06-1MP_P1.0mm_Terminal_Horizontal_Latch","Connector_Samtec_MicroMate/Samtec_T1M-06-X-SV-L_1x06-1MP_P1.0mm_Terminal_Vertical_Latch","Connector_Samtec_MicroMate/Samtec_T1M-07-X-S-RA_1x07-1MP_P1.0mm_Terminal_Horizontal","Connector_Samtec_MicroMate/Samtec_T1M-07-X-S-V_1x07-1MP_P1.0mm_Terminal_Vertical","Connector_Samtec_MicroMate/Samtec_T1M-07-X-SH-L_1x07-1MP_P1.0mm_Terminal_Horizontal_Latch","Connector_Samtec_MicroMate/Samtec_T1M-07-X-SV-L_1x07-1MP_P1.0mm_Terminal_Vertical_Latch","Connector_Samtec_MicroMate/Samtec_T1M-08-X-S-RA_1x08-1MP_P1.0mm_Terminal_Horizontal","Connector_Samtec_MicroMate/Samtec_T1M-08-X-S-V_1x08-1MP_P1.0mm_Terminal_Vertical","Connector_Samtec_MicroMate/Samtec_T1M-08-X-SH-L_1x08-1MP_P1.0mm_Terminal_Horizontal_Latch","Connector_Samtec_MicroMate/Samtec_T1M-08-X-SV-L_1x08-1MP_P1.0mm_Terminal_Vertical_Latch","Connector_Samtec_MicroMate/Samtec_T1M-09-X-S-RA_1x09-1MP_P1.0mm_Terminal_Horizontal","Connector_Samtec_MicroMate/Samtec_T1M-09-X-S-V_1x09-1MP_P1.0mm_Terminal_Vertical","Connector_Samtec_MicroMate/Samtec_T1M-09-X-SH-L_1x09-1MP_P1.0mm_Terminal_Horizontal_Latch","Connector_Samtec_MicroMate/Samtec_T1M-09-X-SV-L_1x09-1MP_P1.0mm_Terminal_Vertical_Latch","Connector_Samtec_MicroMate/Samtec_T1M-10-X-S-RA_1x10-1MP_P1.0mm_Terminal_Horizontal","Connector_Samtec_MicroMate/Samtec_T1M-10-X-S-V_1x10-1MP_P1.0mm_Terminal_Vertical","Connector_Samtec_MicroMate/Samtec_T1M-10-X-SH-L_1x10-1MP_P1.0mm_Terminal_Horizontal_Latch","Connector_Samtec_MicroMate/Samtec_T1M-10-X-SV-L_1x10-1MP_P1.0mm_Terminal_Vertical_Latch","Connector_Samtec_MicroMate/Samtec_T1M-11-X-S-RA_1x11-1MP_P1.0mm_Terminal_Horizontal","Connector_Samtec_MicroMate/Samtec_T1M-11-X-S-V_1x11-1MP_P1.0mm_Terminal_Vertical","Connector_Samtec_MicroMate/Samtec_T1M-11-X-SH-L_1x11-1MP_P1.0mm_Terminal_Horizontal_Latch","Connector_Samtec_MicroMate/Samtec_T1M-11-X-SV-L_1x11-1MP_P1.0mm_Terminal_Vertical_Latch","Connector_Samtec_MicroMate/Samtec_T1M-12-X-S-RA_1x12-1MP_P1.0mm_Terminal_Horizontal","Connector_Samtec_MicroMate/Samtec_T1M-12-X-S-V_1x12-1MP_P1.0mm_Terminal_Vertical","Connector_Samtec_MicroMate/Samtec_T1M-12-X-SH-L_1x12-1MP_P1.0mm_Terminal_Horizontal_Latch","Connector_Samtec_MicroMate/Samtec_T1M-12-X-SV-L_1x12-1MP_P1.0mm_Terminal_Vertical_Latch","Connector_Samtec_MicroMate/Samtec_T1M-13-X-S-RA_1x13-1MP_P1.0mm_Terminal_Horizontal","Connector_Samtec_MicroMate/Samtec_T1M-13-X-S-V_1x13-1MP_P1.0mm_Terminal_Vertical","Connector_Samtec_MicroMate/Samtec_T1M-13-X-SH-L_1x13-1MP_P1.0mm_Terminal_Horizontal_Latch","Connector_Samtec_MicroMate/Samtec_T1M-13-X-SV-L_1x13-1MP_P1.0mm_Terminal_Vertical_Latch","Connector_Samtec_MicroMate/Samtec_T1M-14-X-S-RA_1x14-1MP_P1.0mm_Terminal_Horizontal","Connector_Samtec_MicroMate/Samtec_T1M-14-X-S-V_1x14-1MP_P1.0mm_Terminal_Vertical","Connector_Samtec_MicroMate/Samtec_T1M-14-X-SH-L_1x14-1MP_P1.0mm_Terminal_Horizontal_Latch","Connector_Samtec_MicroMate/Samtec_T1M-14-X-SV-L_1x14-1MP_P1.0mm_Terminal_Vertical_Latch","Connector_Samtec_MicroMate/Samtec_T1M-15-X-S-RA_1x15-1MP_P1.0mm_Terminal_Horizontal","Connector_Samtec_MicroMate/Samtec_T1M-15-X-S-V_1x15-1MP_P1.0mm_Terminal_Vertical","Connector_Samtec_MicroMate/Samtec_T1M-15-X-SH-L_1x15-1MP_P1.0mm_Terminal_Horizontal_Latch","Connector_Samtec_MicroMate/Samtec_T1M-15-X-SV-L_1x15-1MP_P1.0mm_Terminal_Vertical_Latch","Connector_Samtec_MicroMate/Samtec_T1M-16-X-S-RA_1x16-1MP_P1.0mm_Terminal_Horizontal","Connector_Samtec_MicroMate/Samtec_T1M-16-X-S-V_1x16-1MP_P1.0mm_Terminal_Vertical","Connector_Samtec_MicroMate/Samtec_T1M-16-X-SH-L_1x16-1MP_P1.0mm_Terminal_Horizontal_Latch","Connector_Samtec_MicroMate/Samtec_T1M-16-X-SV-L_1x16-1MP_P1.0mm_Terminal_Vertical_Latch","Connector_Samtec_MicroMate/Samtec_T1M-17-X-S-RA_1x17-1MP_P1.0mm_Terminal_Horizontal","Connector_Samtec_MicroMate/Samtec_T1M-17-X-S-V_1x17-1MP_P1.0mm_Terminal_Vertical","Connector_Samtec_MicroMate/Samtec_T1M-17-X-SH-L_1x17-1MP_P1.0mm_Terminal_Horizontal_Latch","Connector_Samtec_MicroMate/Samtec_T1M-17-X-SV-L_1x17-1MP_P1.0mm_Terminal_Vertical_Latch","Connector_Samtec_MicroMate/Samtec_T1M-18-X-S-RA_1x18-1MP_P1.0mm_Terminal_Horizontal","Connector_Samtec_MicroMate/Samtec_T1M-18-X-S-V_1x18-1MP_P1.0mm_Terminal_Vertical","Connector_Samtec_MicroMate/Samtec_T1M-18-X-SH-L_1x18-1MP_P1.0mm_Terminal_Horizontal_Latch","Connector_Samtec_MicroMate/Samtec_T1M-18-X-SV-L_1x18-1MP_P1.0mm_Terminal_Vertical_Latch","Connector_Samtec_MicroMate/Samtec_T1M-19-X-S-RA_1x19-1MP_P1.0mm_Terminal_Horizontal","Connector_Samtec_MicroMate/Samtec_T1M-19-X-S-V_1x19-1MP_P1.0mm_Terminal_Vertical","Connector_Samtec_MicroMate/Samtec_T1M-19-X-SH-L_1x19-1MP_P1.0mm_Terminal_Horizontal_Latch","Connector_Samtec_MicroMate/Samtec_T1M-19-X-SV-L_1x19-1MP_P1.0mm_Terminal_Vertical_Latch","Connector_Samtec_MicroMate/Samtec_T1M-20-X-S-RA_1x20-1MP_P1.0mm_Terminal_Horizontal","Connector_Samtec_MicroMate/Samtec_T1M-20-X-S-V_1x20-1MP_P1.0mm_Terminal_Vertical","Connector_Samtec_MicroMate/Samtec_T1M-20-X-SH-L_1x20-1MP_P1.0mm_Terminal_Horizontal_Latch","Connector_Samtec_MicroMate/Samtec_T1M-20-X-SV-L_1x20-1MP_P1.0mm_Terminal_Vertical_Latch","Connector_Samtec_MicroPower/Samtec_UMPS-02-XX.X-X-V-S-W_1x02-1MP_P2.0mm_Socket_WeldTab","Connector_Samtec_MicroPower/Samtec_UMPS-02-XX.X-X-V-S_1x02_P2.0mm_Socket","Connector_Samtec_MicroPower/Samtec_UMPS-03-XX.X-X-V-S-W_1x03-1MP_P2.0mm_Socket_WeldTab","Connector_Samtec_MicroPower/Samtec_UMPS-03-XX.X-X-V-S_1x03_P2.0mm_Socket","Connector_Samtec_MicroPower/Samtec_UMPS-04-XX.X-X-V-S-W_1x04-1MP_P2.0mm_Socket_WeldTab","Connector_Samtec_MicroPower/Samtec_UMPS-04-XX.X-X-V-S_1x04_P2.0mm_Socket","Connector_Samtec_MicroPower/Samtec_UMPS-05-XX.X-X-V-S-W_1x05-1MP_P2.0mm_Socket_WeldTab","Connector_Samtec_MicroPower/Samtec_UMPS-05-XX.X-X-V-S_1x05_P2.0mm_Socket","Connector_Samtec_MicroPower/Samtec_UMPS-06-XX.X-X-V-S-W_1x06-1MP_P2.0mm_Socket_WeldTab","Connector_Samtec_MicroPower/Samtec_UMPS-06-XX.X-X-V-S_1x06_P2.0mm_Socket","Connector_Samtec_MicroPower/Samtec_UMPS-07-XX.X-X-V-S-W_1x07-1MP_P2.0mm_Socket_WeldTab","Connector_Samtec_MicroPower/Samtec_UMPS-07-XX.X-X-V-S_1x07_P2.0mm_Socket","Connector_Samtec_MicroPower/Samtec_UMPS-08-XX.X-X-V-S-W_1x08-1MP_P2.0mm_Socket_WeldTab","Connector_Samtec_MicroPower/Samtec_UMPS-08-XX.X-X-V-S_1x08_P2.0mm_Socket","Connector_Samtec_MicroPower/Samtec_UMPS-09-XX.X-X-V-S-W_1x09-1MP_P2.0mm_Socket_WeldTab","Connector_Samtec_MicroPower/Samtec_UMPS-09-XX.X-X-V-S_1x09_P2.0mm_Socket","Connector_Samtec_MicroPower/Samtec_UMPS-10-XX.X-X-V-S-W_1x10-1MP_P2.0mm_Socket_WeldTab","Connector_Samtec_MicroPower/Samtec_UMPS-10-XX.X-X-V-S_1x10_P2.0mm_Socket","Connector_Samtec_MicroPower/Samtec_UMPT-02-XX.X-X-V-S-W_1x02-1MP_P2.0mm_Terminal_WeldTab","Connector_Samtec_MicroPower/Samtec_UMPT-02-XX.X-X-V-S_1x02_P2.0mm_Terminal","Connector_Samtec_MicroPower/Samtec_UMPT-03-XX.X-X-V-S-W_1x03-1MP_P2.0mm_Terminal_WeldTab","Connector_Samtec_MicroPower/Samtec_UMPT-03-XX.X-X-V-S_1x03_P2.0mm_Terminal","Connector_Samtec_MicroPower/Samtec_UMPT-04-XX.X-X-V-S-W_1x04-1MP_P2.0mm_Terminal_WeldTab","Connector_Samtec_MicroPower/Samtec_UMPT-04-XX.X-X-V-S_1x04_P2.0mm_Terminal","Connector_Samtec_MicroPower/Samtec_UMPT-05-XX.X-X-V-S-W_1x05-1MP_P2.0mm_Terminal_WeldTab","Connector_Samtec_MicroPower/Samtec_UMPT-05-XX.X-X-V-S_1x05_P2.0mm_Terminal","Connector_Samtec_MicroPower/Samtec_UMPT-06-XX.X-X-V-S-W_1x06-1MP_P2.0mm_Terminal_WeldTab","Connector_Samtec_MicroPower/Samtec_UMPT-06-XX.X-X-V-S_1x06_P2.0mm_Terminal","Connector_Samtec_MicroPower/Samtec_UMPT-07-XX.X-X-V-S-W_1x07-1MP_P2.0mm_Terminal_WeldTab","Connector_Samtec_MicroPower/Samtec_UMPT-07-XX.X-X-V-S_1x07_P2.0mm_Terminal","Connector_Samtec_MicroPower/Samtec_UMPT-08-XX.X-X-V-S-W_1x08-1MP_P2.0mm_Terminal_WeldTab","Connector_Samtec_MicroPower/Samtec_UMPT-08-XX.X-X-V-S_1x08_P2.0mm_Terminal","Connector_Samtec_MicroPower/Samtec_UMPT-09-XX.X-X-V-S-W_1x09-1MP_P2.0mm_Terminal_WeldTab","Connector_Samtec_MicroPower/Samtec_UMPT-09-XX.X-X-V-S_1x09_P2.0mm_Terminal","Connector_Samtec_MicroPower/Samtec_UMPT-10-XX.X-X-V-S-W_1x10-1MP_P2.0mm_Terminal_WeldTab","Connector_Samtec_MicroPower/Samtec_UMPT-10-XX.X-X-V-S_1x10_P2.0mm_Terminal","Connector_Stocko/Stocko_MKS_1651-6-0-202_1x2_P2.50mm_Vertical","Connector_Stocko/Stocko_MKS_1652-6-0-202_1x2_P2.50mm_Vertical","Connector_Stocko/Stocko_MKS_1653-6-0-303_1x3_P2.50mm_Vertical","Connector_Stocko/Stocko_MKS_1654-6-0-404_1x4_P2.50mm_Vertical","Connector_Stocko/Stocko_MKS_1655-6-0-505_1x5_P2.50mm_Vertical","Connector_Stocko/Stocko_MKS_1656-6-0-606_1x6_P2.50mm_Vertical","Connector_Stocko/Stocko_MKS_1657-6-0-707_1x7_P2.50mm_Vertical","Connector_Stocko/Stocko_MKS_1658-6-0-808_1x8_P2.50mm_Vertical","Connector_Stocko/Stocko_MKS_1659-6-0-909_1x9_P2.50mm_Vertical","Connector_Stocko/Stocko_MKS_1660-6-0-1010_1x10_P2.50mm_Vertical","Connector_Stocko/Stocko_MKS_1661-6-0-1111_1x11_P2.50mm_Vertical","Connector_Stocko/Stocko_MKS_1662-6-0-1212_1x12_P2.50mm_Vertical","Connector_Stocko/Stocko_MKS_1663-6-0-1313_1x13_P2.50mm_Vertical","Connector_Stocko/Stocko_MKS_1664-6-0-1414_1x14_P2.50mm_Vertical","Connector_Stocko/Stocko_MKS_1665-6-0-1515_1x15_P2.50mm_Vertical","Connector_Stocko/Stocko_MKS_1666-6-0-1616_1x16_P2.50mm_Vertical","Connector_Stocko/Stocko_MKS_1667-6-0-1717_1x17_P2.50mm_Vertical","Connector_Stocko/Stocko_MKS_1668-6-0-1818_1x18_P2.50mm_Vertical","Connector_Stocko/Stocko_MKS_1669-6-0-1919_1x19_P2.50mm_Vertical","Connector_Stocko/Stocko_MKS_1670-6-0-2020_1x20_P2.50mm_Vertical","Connector_TE-Connectivity/TE_1-826576-3_1x13_P3.96mm_Vertical","Connector_TE-Connectivity/TE_1-826576-5_1x15_P3.96mm_Vertical","Connector_TE-Connectivity/TE_1-826576-6_1x16_P3.96mm_Vertical","Connector_TE-Connectivity/TE_1-826576-7_1x17_P3.96mm_Vertical","Connector_TE-Connectivity/TE_1-826576-8_1x18_P3.96mm_Vertical","Connector_TE-Connectivity/TE_2-826576-0_1x20_P3.96mm_Vertical","Connector_TE-Connectivity/TE_2834006-1_1x01_P4.0mm_Horizontal","Connector_TE-Connectivity/TE_2834006-2_1x02_P4.0mm_Horizontal","Connector_TE-Connectivity/TE_2834006-3_1x03_P4.0mm_Horizontal","Connector_TE-Connectivity/TE_2834006-4_1x04_P4.0mm_Horizontal","Connector_TE-Connectivity/TE_2834006-5_1x05_P4.0mm_Horizontal","Connector_TE-Connectivity/TE_3-826576-6_1x36_P3.96mm_Vertical","Connector_TE-Connectivity/TE_440054-2_1x02_P2.00mm_Vertical","Connector_TE-Connectivity/TE_440055-2_1x02_P2.00mm_Horizontal","Connector_TE-Connectivity/TE_5767171-1_2x19_P0.635mm_Vertical","Connector_TE-Connectivity/TE_826576-2_1x02_P3.96mm_Vertical","Connector_TE-Connectivity/TE_826576-3_1x03_P3.96mm_Vertical","Connector_TE-Connectivity/TE_826576-5_1x05_P3.96mm_Vertical","Connector_TE-Connectivity/TE_826576-6_1x06_P3.96mm_Vertical","Connector_TE-Connectivity/TE_826576-7_1x07_P3.96mm_Vertical","Connector_TE-Connectivity/TE_826576-8_1x08_P3.96mm_Vertical","Connector_TE-Connectivity/TE_826576-9_1x09_P3.96mm_Vertical","Connector_TE-Connectivity/TE_AMPSEAL_1-776087-x_3Rows_23_P0.4mm_Horizontal","Connector_TE-Connectivity/TE_MATE-N-LOK_1-770182-x_3x03_P4.14mm_Vertical","Connector_TE-Connectivity/TE_MATE-N-LOK_1-770186-x_3x04_P4.14mm_Vertical","Connector_TE-Connectivity/TE_MATE-N-LOK_1-770190-x_3x05_P4.14mm_Vertical","Connector_TE-Connectivity/TE_MATE-N-LOK_1-770621-x_2x06_P4.14mm_Vertical","Connector_TE-Connectivity/TE_MATE-N-LOK_1-770858-x_2x05_P4.14mm_Vertical","Connector_TE-Connectivity/TE_MATE-N-LOK_1-770866-x_1x02_P4.14mm_Vertical","Connector_TE-Connectivity/TE_MATE-N-LOK_1-770870-x_1x03_P4.14mm_Vertical","Connector_TE-Connectivity/TE_MATE-N-LOK_1-770874-x_2x02_P4.14mm_Vertical","Connector_TE-Connectivity/TE_MATE-N-LOK_1-770875-x_2x03_P4.14mm_Vertical","Connector_TE-Connectivity/TE_MATE-N-LOK_1-770966-x_1x02_P4.14mm_Horizontal","Connector_TE-Connectivity/TE_MATE-N-LOK_1-770967-x_1x03_P4.14mm_Horizontal","Connector_TE-Connectivity/TE_MATE-N-LOK_1-770968-x_2x02_P4.14mm_Horizontal","Connector_TE-Connectivity/TE_MATE-N-LOK_1-770969-x_2x03_P4.14mm_Horizontal","Connector_TE-Connectivity/TE_MATE-N-LOK_1-770970-x_2x04_P4.14mm_Horizontal","Connector_TE-Connectivity/TE_MATE-N-LOK_1-770971-x_2x05_P4.14mm_Horizontal","Connector_TE-Connectivity/TE_MATE-N-LOK_1-770972-x_2x06_P4.14mm_Horizontal","Connector_TE-Connectivity/TE_MATE-N-LOK_1-770973-x_2x07_P4.14mm_Horizontal","Connector_TE-Connectivity/TE_MATE-N-LOK_1-770974-x_2x08_P4.14mm_Horizontal","Connector_TE-Connectivity/TE_MATE-N-LOK_1-794067-x_2x07_P4.14mm_Vertical","Connector_TE-Connectivity/TE_MATE-N-LOK_1-794068-x_2x08_P4.14mm_Vertical","Connector_TE-Connectivity/TE_MATE-N-LOK_1-794069-x_2x09_P4.14mm_Vertical","Connector_TE-Connectivity/TE_MATE-N-LOK_1-794070-x_2x10_P4.14mm_Vertical","Connector_TE-Connectivity/TE_MATE-N-LOK_1-794071-x_2x11_P4.14mm_Vertical","Connector_TE-Connectivity/TE_MATE-N-LOK_1-794072-x_2x12_P4.14mm_Vertical","Connector_TE-Connectivity/TE_MATE-N-LOK_1-794073-x_2x04_P4.14mm_Vertical","Connector_TE-Connectivity/TE_MATE-N-LOK_1-794105-x_2x09_P4.14mm_Horizontal","Connector_TE-Connectivity/TE_MATE-N-LOK_1-794106-x_2x10_P4.14mm_Horizontal","Connector_TE-Connectivity/TE_MATE-N-LOK_1-794107-x_2x11_P4.14mm_Horizontal","Connector_TE-Connectivity/TE_MATE-N-LOK_1-794108-x_2x12_P4.14mm_Horizontal","Connector_TE-Connectivity/TE_MATE-N-LOK_1-794374-x_1x01_P4.14mm_Horizontal","Connector_TE-Connectivity/TE_MATE-N-LOK_350211-1_1x04_P5.08mm_Vertical","Connector_TE-Connectivity/TE_Micro-MaTch_1-215079-0_2x05_P1.27mm_Vertical","Connector_TE-Connectivity/TE_Micro-MaTch_1-215079-2_2x06_P1.27mm_Vertical","Connector_TE-Connectivity/TE_Micro-MaTch_1-215079-4_2x07_P1.27mm_Vertical","Connector_TE-Connectivity/TE_Micro-MaTch_1-215079-6_2x08_P1.27mm_Vertical","Connector_TE-Connectivity/TE_Micro-MaTch_1-215079-8_2x09_P1.27mm_Vertical","Connector_TE-Connectivity/TE_Micro-MaTch_2-215079-0_2x10_P1.27mm_Vertical","Connector_TE-Connectivity/TE_Micro-MaTch_215079-4_2x02_P1.27mm_Vertical","Connector_TE-Connectivity/TE_Micro-MaTch_215079-6_2x03_P1.27mm_Vertical","Connector_TE-Connectivity/TE_Micro-MaTch_215079-8_2x04_P1.27mm_Vertical","Connector_TE-Connectivity/TE_T4041037031-000_M8_03_Socket_Straight","Connector_TE-Connectivity/TE_T4041037041-000_M8_04_Socket_Straight","Connector_USB/USB3_A_Molex_48393-001","Connector_USB/USB3_A_Molex_48406-0001_Horizontal_Stacked","Connector_USB/USB3_A_Plug_Wuerth_692112030100_Horizontal","Connector_USB/USB3_A_Receptacle_Wuerth_692122030100","Connector_USB/USB3_Micro-B_Connfly_DS1104-01","Connector_USB/USB_A_CNCTech_1001-011-01101_Horizontal","Connector_USB/USB_A_CUI_UJ2-ADH-TH_Horizontal_Stacked","Connector_USB/USB_A_Connfly_DS1095","Connector_USB/USB_A_Connfly_DS1098_Horizontal","Connector_USB/USB_A_Kycon_KUSBX-AS1N-B_Horizontal","Connector_USB/USB_A_Molex_105057_Vertical","Connector_USB/USB_A_Molex_48037-2200_Horizontal","Connector_USB/USB_A_Molex_67643_Horizontal","Connector_USB/USB_A_Receptacle_GCT_USB1046","Connector_USB/USB_A_Receptacle_XKB_U231-091N-4BLRA00-S","Connector_USB/USB_A_Stewart_SS-52100-001_Horizontal","Connector_USB/USB_A_TE_292303-7_Horizontal","Connector_USB/USB_A_Wuerth_614004134726_Horizontal","Connector_USB/USB_A_Wuerth_61400826021_Horizontal_Stacked","Connector_USB/USB_B_Amphenol_MUSB-D511_Vertical_Rugged","Connector_USB/USB_B_Lumberg_2411_02_Horizontal","Connector_USB/USB_B_OST_USB-B1HSxx_Horizontal","Connector_USB/USB_B_TE_5787834_Vertical","Connector_USB/USB_C_Plug_JAE_DX07P024AJ1","Connector_USB/USB_C_Plug_Molex_105444","Connector_USB/USB_C_Plug_ShenzhenJingTuoJin_918-118A2021Y40002_Vertical","Connector_USB/USB_C_Receptacle_Amphenol_12401548E4-2A","Connector_USB/USB_C_Receptacle_Amphenol_12401548E4-2A_CircularHoles","Connector_USB/USB_C_Receptacle_Amphenol_12401610E4-2A","Connector_USB/USB_C_Receptacle_Amphenol_12401610E4-2A_CircularHoles","Connector_USB/USB_C_Receptacle_Amphenol_12401948E412A","Connector_USB/USB_C_Receptacle_Amphenol_124019772112A","Connector_USB/USB_C_Receptacle_CNCTech_C-ARA1-AK51X","Connector_USB/USB_C_Receptacle_G-Switch_GT-USB-7010ASV","Connector_USB/USB_C_Receptacle_G-Switch_GT-USB-7025","Connector_USB/USB_C_Receptacle_G-Switch_GT-USB-7051x","Connector_USB/USB_C_Receptacle_GCT_USB4085","Connector_USB/USB_C_Receptacle_GCT_USB4105-xx-A_16P_TopMnt_Horizontal","Connector_USB/USB_C_Receptacle_GCT_USB4110","Connector_USB/USB_C_Receptacle_GCT_USB4115-03-C","Connector_USB/USB_C_Receptacle_GCT_USB4125-xx-x-0190_6P_TopMnt_Horizontal","Connector_USB/USB_C_Receptacle_GCT_USB4125-xx-x_6P_TopMnt_Horizontal","Connector_USB/USB_C_Receptacle_GCT_USB4135-GF-A_6P_TopMnt_Horizontal","Connector_USB/USB_C_Receptacle_HCTL_HC-TYPE-C-16P-01A","Connector_USB/USB_C_Receptacle_HRO_TYPE-C-31-M-12","Connector_USB/USB_C_Receptacle_HRO_TYPE-C-31-M-17","Connector_USB/USB_C_Receptacle_JAE_DX07S016JA1R1500","Connector_USB/USB_C_Receptacle_JAE_DX07S024WJ1R350","Connector_USB/USB_C_Receptacle_JAE_DX07S024WJ3R400","Connector_USB/USB_C_Receptacle_Molex_105450-0101","Connector_USB/USB_C_Receptacle_Palconn_UTC16-G","Connector_USB/USB_C_Receptacle_XKB_U262-16XN-4BVC11","Connector_USB/USB_Micro-AB_Molex_47590-0001","Connector_USB/USB_Micro-B_Amphenol_10103594-0001LF_Horizontal","Connector_USB/USB_Micro-B_Amphenol_10104110_Horizontal","Connector_USB/USB_Micro-B_Amphenol_10118193-0001LF_Horizontal","Connector_USB/USB_Micro-B_Amphenol_10118193-0002LF_Horizontal","Connector_USB/USB_Micro-B_Amphenol_10118194-0001LF_Horizontal","Connector_USB/USB_Micro-B_Amphenol_10118194_Horizontal","Connector_USB/USB_Micro-B_GCT_USB3076-30-A","Connector_USB/USB_Micro-B_Molex-105017-0001","Connector_USB/USB_Micro-B_Molex-105133-0001","Connector_USB/USB_Micro-B_Molex-105133-0031","Connector_USB/USB_Micro-B_Molex_47346-0001","Connector_USB/USB_Micro-B_Technik_TWP-4002D-H3","Connector_USB/USB_Micro-B_Wuerth_614105150721_Vertical","Connector_USB/USB_Micro-B_Wuerth_614105150721_Vertical_CircularHoles","Connector_USB/USB_Micro-B_Wuerth_629105150521","Connector_USB/USB_Micro-B_Wuerth_629105150521_CircularHoles","Connector_USB/USB_Micro-B_XKB_U254-051T-4BH83-F1S","Connector_USB/USB_Mini-B_AdamTech_MUSB-B5-S-VT-TSMT-1_SMD_Vertical","Connector_USB/USB_Mini-B_Lumberg_2486_01_Horizontal","Connector_USB/USB_Mini-B_Tensility_54-00023_Vertical","Connector_USB/USB_Mini-B_Tensility_54-00023_Vertical_CircularHoles","Connector_USB/USB_Mini-B_Wuerth_65100516121_Horizontal","Connector_Video/DVI-D_Molex_74320-4004_Horizontal","Connector_Video/DVI-I_Molex_74320-1004_Horizontal","Connector_Video/HDMI_A_Amphenol_10029449-x01xLF_Horizontal","Connector_Video/HDMI_A_Contact_Technology_19APL2_Horizontal","Connector_Video/HDMI_A_Kycon_KDMIX-SL1-NS-WS-B15_VerticalRightAngle","Connector_Video/HDMI_A_Molex_208658-1001_Horizontal","Connector_Video/HDMI_Micro-D_Molex_46765-0xxx","Connector_Video/HDMI_Micro-D_Molex_46765-1xxx","Connector_Video/HDMI_Micro-D_Molex_46765-2xxx","Connector_Wago/Wago_734-132_1x02_P3.50mm_Vertical","Connector_Wago/Wago_734-133_1x03_P3.50mm_Vertical","Connector_Wago/Wago_734-134_1x04_P3.50mm_Vertical","Connector_Wago/Wago_734-135_1x05_P3.50mm_Vertical","Connector_Wago/Wago_734-136_1x06_P3.50mm_Vertical","Connector_Wago/Wago_734-137_1x07_P3.50mm_Vertical","Connector_Wago/Wago_734-138_1x08_P3.50mm_Vertical","Connector_Wago/Wago_734-139_1x09_P3.50mm_Vertical","Connector_Wago/Wago_734-140_1x10_P3.50mm_Vertical","Connector_Wago/Wago_734-141_1x11_P3.50mm_Vertical","Connector_Wago/Wago_734-142_1x12_P3.50mm_Vertical","Connector_Wago/Wago_734-143_1x13_P3.50mm_Vertical","Connector_Wago/Wago_734-144_1x14_P3.50mm_Vertical","Connector_Wago/Wago_734-146_1x16_P3.50mm_Vertical","Connector_Wago/Wago_734-148_1x18_P3.50mm_Vertical","Connector_Wago/Wago_734-150_1x20_P3.50mm_Vertical","Connector_Wago/Wago_734-154_1x24_P3.50mm_Vertical","Connector_Wago/Wago_734-162_1x02_P3.50mm_Horizontal","Connector_Wago/Wago_734-163_1x03_P3.50mm_Horizontal","Connector_Wago/Wago_734-164_1x04_P3.50mm_Horizontal","Connector_Wago/Wago_734-165_1x05_P3.50mm_Horizontal","Connector_Wago/Wago_734-166_1x06_P3.50mm_Horizontal","Connector_Wago/Wago_734-167_1x07_P3.50mm_Horizontal","Connector_Wago/Wago_734-168_1x08_P3.50mm_Horizontal","Connector_Wago/Wago_734-169_1x09_P3.50mm_Horizontal","Connector_Wago/Wago_734-170_1x10_P3.50mm_Horizontal","Connector_Wago/Wago_734-171_1x11_P3.50mm_Horizontal","Connector_Wago/Wago_734-172_1x12_P3.50mm_Horizontal","Connector_Wago/Wago_734-173_1x13_P3.50mm_Horizontal","Connector_Wago/Wago_734-174_1x14_P3.50mm_Horizontal","Connector_Wago/Wago_734-176_1x16_P3.50mm_Horizontal","Connector_Wago/Wago_734-178_1x18_P3.50mm_Horizontal","Connector_Wago/Wago_734-180_1x20_P3.50mm_Horizontal","Connector_Wago/Wago_734-184_1x24_P3.50mm_Horizontal","Connector_Wire/SolderWire-0.127sqmm_1x01_D0.48mm_OD1mm","Connector_Wire/SolderWire-0.127sqmm_1x01_D0.48mm_OD1mm_Relief","Connector_Wire/SolderWire-0.127sqmm_1x01_D0.48mm_OD1mm_Relief2x","Connector_Wire/SolderWire-0.127sqmm_1x02_P3.7mm_D0.48mm_OD1mm","Connector_Wire/SolderWire-0.127sqmm_1x02_P3.7mm_D0.48mm_OD1mm_Relief","Connector_Wire/SolderWire-0.127sqmm_1x02_P3.7mm_D0.48mm_OD1mm_Relief2x","Connector_Wire/SolderWire-0.127sqmm_1x03_P3.7mm_D0.48mm_OD1mm","Connector_Wire/SolderWire-0.127sqmm_1x03_P3.7mm_D0.48mm_OD1mm_Relief","Connector_Wire/SolderWire-0.127sqmm_1x03_P3.7mm_D0.48mm_OD1mm_Relief2x","Connector_Wire/SolderWire-0.127sqmm_1x04_P3.7mm_D0.48mm_OD1mm","Connector_Wire/SolderWire-0.127sqmm_1x04_P3.7mm_D0.48mm_OD1mm_Relief","Connector_Wire/SolderWire-0.127sqmm_1x04_P3.7mm_D0.48mm_OD1mm_Relief2x","Connector_Wire/SolderWire-0.127sqmm_1x05_P3.7mm_D0.48mm_OD1mm","Connector_Wire/SolderWire-0.127sqmm_1x05_P3.7mm_D0.48mm_OD1mm_Relief","Connector_Wire/SolderWire-0.127sqmm_1x05_P3.7mm_D0.48mm_OD1mm_Relief2x","Connector_Wire/SolderWire-0.127sqmm_1x06_P3.7mm_D0.48mm_OD1mm","Connector_Wire/SolderWire-0.127sqmm_1x06_P3.7mm_D0.48mm_OD1mm_Relief","Connector_Wire/SolderWire-0.127sqmm_1x06_P3.7mm_D0.48mm_OD1mm_Relief2x","Connector_Wire/SolderWire-0.15sqmm_1x01_D0.5mm_OD1.5mm","Connector_Wire/SolderWire-0.15sqmm_1x01_D0.5mm_OD1.5mm_Relief","Connector_Wire/SolderWire-0.15sqmm_1x01_D0.5mm_OD1.5mm_Relief2x","Connector_Wire/SolderWire-0.15sqmm_1x02_P4mm_D0.5mm_OD1.5mm","Connector_Wire/SolderWire-0.15sqmm_1x02_P4mm_D0.5mm_OD1.5mm_Relief","Connector_Wire/SolderWire-0.15sqmm_1x02_P4mm_D0.5mm_OD1.5mm_Relief2x","Connector_Wire/SolderWire-0.15sqmm_1x03_P4mm_D0.5mm_OD1.5mm","Connector_Wire/SolderWire-0.15sqmm_1x03_P4mm_D0.5mm_OD1.5mm_Relief","Connector_Wire/SolderWire-0.15sqmm_1x03_P4mm_D0.5mm_OD1.5mm_Relief2x","Connector_Wire/SolderWire-0.15sqmm_1x04_P4mm_D0.5mm_OD1.5mm","Connector_Wire/SolderWire-0.15sqmm_1x04_P4mm_D0.5mm_OD1.5mm_Relief","Connector_Wire/SolderWire-0.15sqmm_1x04_P4mm_D0.5mm_OD1.5mm_Relief2x","Connector_Wire/SolderWire-0.15sqmm_1x05_P4mm_D0.5mm_OD1.5mm","Connector_Wire/SolderWire-0.15sqmm_1x05_P4mm_D0.5mm_OD1.5mm_Relief","Connector_Wire/SolderWire-0.15sqmm_1x05_P4mm_D0.5mm_OD1.5mm_Relief2x","Connector_Wire/SolderWire-0.15sqmm_1x06_P4mm_D0.5mm_OD1.5mm","Connector_Wire/SolderWire-0.15sqmm_1x06_P4mm_D0.5mm_OD1.5mm_Relief","Connector_Wire/SolderWire-0.15sqmm_1x06_P4mm_D0.5mm_OD1.5mm_Relief2x","Connector_Wire/SolderWire-0.1sqmm_1x01_D0.4mm_OD1mm","Connector_Wire/SolderWire-0.1sqmm_1x01_D0.4mm_OD1mm_Relief","Connector_Wire/SolderWire-0.1sqmm_1x01_D0.4mm_OD1mm_Relief2x","Connector_Wire/SolderWire-0.1sqmm_1x02_P3.6mm_D0.4mm_OD1mm","Connector_Wire/SolderWire-0.1sqmm_1x02_P3.6mm_D0.4mm_OD1mm_Relief","Connector_Wire/SolderWire-0.1sqmm_1x02_P3.6mm_D0.4mm_OD1mm_Relief2x","Connector_Wire/SolderWire-0.1sqmm_1x03_P3.6mm_D0.4mm_OD1mm","Connector_Wire/SolderWire-0.1sqmm_1x03_P3.6mm_D0.4mm_OD1mm_Relief","Connector_Wire/SolderWire-0.1sqmm_1x03_P3.6mm_D0.4mm_OD1mm_Relief2x","Connector_Wire/SolderWire-0.1sqmm_1x04_P3.6mm_D0.4mm_OD1mm","Connector_Wire/SolderWire-0.1sqmm_1x04_P3.6mm_D0.4mm_OD1mm_Relief","Connector_Wire/SolderWire-0.1sqmm_1x04_P3.6mm_D0.4mm_OD1mm_Relief2x","Connector_Wire/SolderWire-0.1sqmm_1x05_P3.6mm_D0.4mm_OD1mm","Connector_Wire/SolderWire-0.1sqmm_1x05_P3.6mm_D0.4mm_OD1mm_Relief","Connector_Wire/SolderWire-0.1sqmm_1x05_P3.6mm_D0.4mm_OD1mm_Relief2x","Connector_Wire/SolderWire-0.1sqmm_1x06_P3.6mm_D0.4mm_OD1mm","Connector_Wire/SolderWire-0.1sqmm_1x06_P3.6mm_D0.4mm_OD1mm_Relief","Connector_Wire/SolderWire-0.1sqmm_1x06_P3.6mm_D0.4mm_OD1mm_Relief2x","Connector_Wire/SolderWire-0.25sqmm_1x01_D0.65mm_OD1.7mm","Connector_Wire/SolderWire-0.25sqmm_1x01_D0.65mm_OD1.7mm_Relief","Connector_Wire/SolderWire-0.25sqmm_1x01_D0.65mm_OD1.7mm_Relief2x","Connector_Wire/SolderWire-0.25sqmm_1x01_D0.65mm_OD2mm","Connector_Wire/SolderWire-0.25sqmm_1x01_D0.65mm_OD2mm_Relief","Connector_Wire/SolderWire-0.25sqmm_1x01_D0.65mm_OD2mm_Relief2x","Connector_Wire/SolderWire-0.25sqmm_1x02_P4.2mm_D0.65mm_OD1.7mm","Connector_Wire/SolderWire-0.25sqmm_1x02_P4.2mm_D0.65mm_OD1.7mm_Relief","Connector_Wire/SolderWire-0.25sqmm_1x02_P4.2mm_D0.65mm_OD1.7mm_Relief2x","Connector_Wire/SolderWire-0.25sqmm_1x02_P4.5mm_D0.65mm_OD2mm","Connector_Wire/SolderWire-0.25sqmm_1x02_P4.5mm_D0.65mm_OD2mm_Relief","Connector_Wire/SolderWire-0.25sqmm_1x02_P4.5mm_D0.65mm_OD2mm_Relief2x","Connector_Wire/SolderWire-0.25sqmm_1x03_P4.2mm_D0.65mm_OD1.7mm","Connector_Wire/SolderWire-0.25sqmm_1x03_P4.2mm_D0.65mm_OD1.7mm_Relief","Connector_Wire/SolderWire-0.25sqmm_1x03_P4.2mm_D0.65mm_OD1.7mm_Relief2x","Connector_Wire/SolderWire-0.25sqmm_1x03_P4.5mm_D0.65mm_OD2mm","Connector_Wire/SolderWire-0.25sqmm_1x03_P4.5mm_D0.65mm_OD2mm_Relief","Connector_Wire/SolderWire-0.25sqmm_1x03_P4.5mm_D0.65mm_OD2mm_Relief2x","Connector_Wire/SolderWire-0.25sqmm_1x04_P4.2mm_D0.65mm_OD1.7mm","Connector_Wire/SolderWire-0.25sqmm_1x04_P4.2mm_D0.65mm_OD1.7mm_Relief","Connector_Wire/SolderWire-0.25sqmm_1x04_P4.2mm_D0.65mm_OD1.7mm_Relief2x","Connector_Wire/SolderWire-0.25sqmm_1x04_P4.5mm_D0.65mm_OD2mm","Connector_Wire/SolderWire-0.25sqmm_1x04_P4.5mm_D0.65mm_OD2mm_Relief","Connector_Wire/SolderWire-0.25sqmm_1x04_P4.5mm_D0.65mm_OD2mm_Relief2x","Connector_Wire/SolderWire-0.25sqmm_1x05_P4.2mm_D0.65mm_OD1.7mm","Connector_Wire/SolderWire-0.25sqmm_1x05_P4.2mm_D0.65mm_OD1.7mm_Relief","Connector_Wire/SolderWire-0.25sqmm_1x05_P4.2mm_D0.65mm_OD1.7mm_Relief2x","Connector_Wire/SolderWire-0.25sqmm_1x05_P4.5mm_D0.65mm_OD2mm","Connector_Wire/SolderWire-0.25sqmm_1x05_P4.5mm_D0.65mm_OD2mm_Relief","Connector_Wire/SolderWire-0.25sqmm_1x05_P4.5mm_D0.65mm_OD2mm_Relief2x","Connector_Wire/SolderWire-0.25sqmm_1x06_P4.2mm_D0.65mm_OD1.7mm","Connector_Wire/SolderWire-0.25sqmm_1x06_P4.2mm_D0.65mm_OD1.7mm_Relief","Connector_Wire/SolderWire-0.25sqmm_1x06_P4.2mm_D0.65mm_OD1.7mm_Relief2x","Connector_Wire/SolderWire-0.25sqmm_1x06_P4.5mm_D0.65mm_OD2mm","Connector_Wire/SolderWire-0.25sqmm_1x06_P4.5mm_D0.65mm_OD2mm_Relief","Connector_Wire/SolderWire-0.25sqmm_1x06_P4.5mm_D0.65mm_OD2mm_Relief2x","Connector_Wire/SolderWire-0.5sqmm_1x01_D0.9mm_OD2.1mm","Connector_Wire/SolderWire-0.5sqmm_1x01_D0.9mm_OD2.1mm_Relief","Connector_Wire/SolderWire-0.5sqmm_1x01_D0.9mm_OD2.1mm_Relief2x","Connector_Wire/SolderWire-0.5sqmm_1x01_D0.9mm_OD2.3mm","Connector_Wire/SolderWire-0.5sqmm_1x01_D0.9mm_OD2.3mm_Relief","Connector_Wire/SolderWire-0.5sqmm_1x01_D0.9mm_OD2.3mm_Relief2x","Connector_Wire/SolderWire-0.5sqmm_1x02_P4.6mm_D0.9mm_OD2.1mm","Connector_Wire/SolderWire-0.5sqmm_1x02_P4.6mm_D0.9mm_OD2.1mm_Relief","Connector_Wire/SolderWire-0.5sqmm_1x02_P4.6mm_D0.9mm_OD2.1mm_Relief2x","Connector_Wire/SolderWire-0.5sqmm_1x02_P4.8mm_D0.9mm_OD2.3mm","Connector_Wire/SolderWire-0.5sqmm_1x02_P4.8mm_D0.9mm_OD2.3mm_Relief","Connector_Wire/SolderWire-0.5sqmm_1x02_P4.8mm_D0.9mm_OD2.3mm_Relief2x","Connector_Wire/SolderWire-0.5sqmm_1x03_P4.6mm_D0.9mm_OD2.1mm","Connector_Wire/SolderWire-0.5sqmm_1x03_P4.6mm_D0.9mm_OD2.1mm_Relief","Connector_Wire/SolderWire-0.5sqmm_1x03_P4.6mm_D0.9mm_OD2.1mm_Relief2x","Connector_Wire/SolderWire-0.5sqmm_1x03_P4.8mm_D0.9mm_OD2.3mm","Connector_Wire/SolderWire-0.5sqmm_1x03_P4.8mm_D0.9mm_OD2.3mm_Relief","Connector_Wire/SolderWire-0.5sqmm_1x03_P4.8mm_D0.9mm_OD2.3mm_Relief2x","Connector_Wire/SolderWire-0.5sqmm_1x04_P4.6mm_D0.9mm_OD2.1mm","Connector_Wire/SolderWire-0.5sqmm_1x04_P4.6mm_D0.9mm_OD2.1mm_Relief","Connector_Wire/SolderWire-0.5sqmm_1x04_P4.6mm_D0.9mm_OD2.1mm_Relief2x","Connector_Wire/SolderWire-0.5sqmm_1x04_P4.8mm_D0.9mm_OD2.3mm","Connector_Wire/SolderWire-0.5sqmm_1x04_P4.8mm_D0.9mm_OD2.3mm_Relief","Connector_Wire/SolderWire-0.5sqmm_1x04_P4.8mm_D0.9mm_OD2.3mm_Relief2x","Connector_Wire/SolderWire-0.5sqmm_1x05_P4.6mm_D0.9mm_OD2.1mm","Connector_Wire/SolderWire-0.5sqmm_1x05_P4.6mm_D0.9mm_OD2.1mm_Relief","Connector_Wire/SolderWire-0.5sqmm_1x05_P4.6mm_D0.9mm_OD2.1mm_Relief2x","Connector_Wire/SolderWire-0.5sqmm_1x05_P4.8mm_D0.9mm_OD2.3mm","Connector_Wire/SolderWire-0.5sqmm_1x05_P4.8mm_D0.9mm_OD2.3mm_Relief","Connector_Wire/SolderWire-0.5sqmm_1x05_P4.8mm_D0.9mm_OD2.3mm_Relief2x","Connector_Wire/SolderWire-0.5sqmm_1x06_P4.6mm_D0.9mm_OD2.1mm","Connector_Wire/SolderWire-0.5sqmm_1x06_P4.6mm_D0.9mm_OD2.1mm_Relief","Connector_Wire/SolderWire-0.5sqmm_1x06_P4.6mm_D0.9mm_OD2.1mm_Relief2x","Connector_Wire/SolderWire-0.5sqmm_1x06_P4.8mm_D0.9mm_OD2.3mm","Connector_Wire/SolderWire-0.5sqmm_1x06_P4.8mm_D0.9mm_OD2.3mm_Relief","Connector_Wire/SolderWire-0.5sqmm_1x06_P4.8mm_D0.9mm_OD2.3mm_Relief2x","Connector_Wire/SolderWire-0.75sqmm_1x01_D1.25mm_OD2.3mm","Connector_Wire/SolderWire-0.75sqmm_1x01_D1.25mm_OD2.3mm_Relief","Connector_Wire/SolderWire-0.75sqmm_1x01_D1.25mm_OD2.3mm_Relief2x","Connector_Wire/SolderWire-0.75sqmm_1x01_D1.25mm_OD3.5mm","Connector_Wire/SolderWire-0.75sqmm_1x01_D1.25mm_OD3.5mm_Relief","Connector_Wire/SolderWire-0.75sqmm_1x01_D1.25mm_OD3.5mm_Relief2x","Connector_Wire/SolderWire-0.75sqmm_1x02_P4.8mm_D1.25mm_OD2.3mm","Connector_Wire/SolderWire-0.75sqmm_1x02_P4.8mm_D1.25mm_OD2.3mm_Relief","Connector_Wire/SolderWire-0.75sqmm_1x02_P4.8mm_D1.25mm_OD2.3mm_Relief2x","Connector_Wire/SolderWire-0.75sqmm_1x02_P7mm_D1.25mm_OD3.5mm","Connector_Wire/SolderWire-0.75sqmm_1x02_P7mm_D1.25mm_OD3.5mm_Relief","Connector_Wire/SolderWire-0.75sqmm_1x02_P7mm_D1.25mm_OD3.5mm_Relief2x","Connector_Wire/SolderWire-0.75sqmm_1x03_P4.8mm_D1.25mm_OD2.3mm","Connector_Wire/SolderWire-0.75sqmm_1x03_P4.8mm_D1.25mm_OD2.3mm_Relief","Connector_Wire/SolderWire-0.75sqmm_1x03_P4.8mm_D1.25mm_OD2.3mm_Relief2x","Connector_Wire/SolderWire-0.75sqmm_1x03_P7mm_D1.25mm_OD3.5mm","Connector_Wire/SolderWire-0.75sqmm_1x03_P7mm_D1.25mm_OD3.5mm_Relief","Connector_Wire/SolderWire-0.75sqmm_1x03_P7mm_D1.25mm_OD3.5mm_Relief2x","Connector_Wire/SolderWire-0.75sqmm_1x04_P4.8mm_D1.25mm_OD2.3mm","Connector_Wire/SolderWire-0.75sqmm_1x04_P4.8mm_D1.25mm_OD2.3mm_Relief","Connector_Wire/SolderWire-0.75sqmm_1x04_P4.8mm_D1.25mm_OD2.3mm_Relief2x","Connector_Wire/SolderWire-0.75sqmm_1x04_P7mm_D1.25mm_OD3.5mm","Connector_Wire/SolderWire-0.75sqmm_1x04_P7mm_D1.25mm_OD3.5mm_Relief","Connector_Wire/SolderWire-0.75sqmm_1x04_P7mm_D1.25mm_OD3.5mm_Relief2x","Connector_Wire/SolderWire-0.75sqmm_1x05_P4.8mm_D1.25mm_OD2.3mm","Connector_Wire/SolderWire-0.75sqmm_1x05_P4.8mm_D1.25mm_OD2.3mm_Relief","Connector_Wire/SolderWire-0.75sqmm_1x05_P4.8mm_D1.25mm_OD2.3mm_Relief2x","Connector_Wire/SolderWire-0.75sqmm_1x05_P7mm_D1.25mm_OD3.5mm","Connector_Wire/SolderWire-0.75sqmm_1x05_P7mm_D1.25mm_OD3.5mm_Relief","Connector_Wire/SolderWire-0.75sqmm_1x05_P7mm_D1.25mm_OD3.5mm_Relief2x","Connector_Wire/SolderWire-0.75sqmm_1x06_P4.8mm_D1.25mm_OD2.3mm","Connector_Wire/SolderWire-0.75sqmm_1x06_P4.8mm_D1.25mm_OD2.3mm_Relief","Connector_Wire/SolderWire-0.75sqmm_1x06_P4.8mm_D1.25mm_OD2.3mm_Relief2x","Connector_Wire/SolderWire-0.75sqmm_1x06_P7mm_D1.25mm_OD3.5mm","Connector_Wire/SolderWire-0.75sqmm_1x06_P7mm_D1.25mm_OD3.5mm_Relief","Connector_Wire/SolderWire-0.75sqmm_1x06_P7mm_D1.25mm_OD3.5mm_Relief2x","Connector_Wire/SolderWire-1.5sqmm_1x01_D1.7mm_OD3.9mm","Connector_Wire/SolderWire-1.5sqmm_1x01_D1.7mm_OD3.9mm_Relief","Connector_Wire/SolderWire-1.5sqmm_1x01_D1.7mm_OD3.9mm_Relief2x","Connector_Wire/SolderWire-1.5sqmm_1x01_D1.7mm_OD3mm","Connector_Wire/SolderWire-1.5sqmm_1x01_D1.7mm_OD3mm_Relief","Connector_Wire/SolderWire-1.5sqmm_1x01_D1.7mm_OD3mm_Relief2x","Connector_Wire/SolderWire-1.5sqmm_1x02_P6mm_D1.7mm_OD3mm","Connector_Wire/SolderWire-1.5sqmm_1x02_P6mm_D1.7mm_OD3mm_Relief","Connector_Wire/SolderWire-1.5sqmm_1x02_P6mm_D1.7mm_OD3mm_Relief2x","Connector_Wire/SolderWire-1.5sqmm_1x02_P7.8mm_D1.7mm_OD3.9mm","Connector_Wire/SolderWire-1.5sqmm_1x02_P7.8mm_D1.7mm_OD3.9mm_Relief","Connector_Wire/SolderWire-1.5sqmm_1x02_P7.8mm_D1.7mm_OD3.9mm_Relief2x","Connector_Wire/SolderWire-1.5sqmm_1x03_P6mm_D1.7mm_OD3mm","Connector_Wire/SolderWire-1.5sqmm_1x03_P6mm_D1.7mm_OD3mm_Relief","Connector_Wire/SolderWire-1.5sqmm_1x03_P6mm_D1.7mm_OD3mm_Relief2x","Connector_Wire/SolderWire-1.5sqmm_1x03_P7.8mm_D1.7mm_OD3.9mm","Connector_Wire/SolderWire-1.5sqmm_1x03_P7.8mm_D1.7mm_OD3.9mm_Relief","Connector_Wire/SolderWire-1.5sqmm_1x03_P7.8mm_D1.7mm_OD3.9mm_Relief2x","Connector_Wire/SolderWire-1.5sqmm_1x04_P6mm_D1.7mm_OD3mm","Connector_Wire/SolderWire-1.5sqmm_1x04_P6mm_D1.7mm_OD3mm_Relief","Connector_Wire/SolderWire-1.5sqmm_1x04_P6mm_D1.7mm_OD3mm_Relief2x","Connector_Wire/SolderWire-1.5sqmm_1x04_P7.8mm_D1.7mm_OD3.9mm","Connector_Wire/SolderWire-1.5sqmm_1x04_P7.8mm_D1.7mm_OD3.9mm_Relief","Connector_Wire/SolderWire-1.5sqmm_1x04_P7.8mm_D1.7mm_OD3.9mm_Relief2x","Connector_Wire/SolderWire-1.5sqmm_1x05_P6mm_D1.7mm_OD3mm","Connector_Wire/SolderWire-1.5sqmm_1x05_P6mm_D1.7mm_OD3mm_Relief","Connector_Wire/SolderWire-1.5sqmm_1x05_P6mm_D1.7mm_OD3mm_Relief2x","Connector_Wire/SolderWire-1.5sqmm_1x05_P7.8mm_D1.7mm_OD3.9mm","Connector_Wire/SolderWire-1.5sqmm_1x05_P7.8mm_D1.7mm_OD3.9mm_Relief","Connector_Wire/SolderWire-1.5sqmm_1x05_P7.8mm_D1.7mm_OD3.9mm_Relief2x","Connector_Wire/SolderWire-1.5sqmm_1x06_P6mm_D1.7mm_OD3mm","Connector_Wire/SolderWire-1.5sqmm_1x06_P6mm_D1.7mm_OD3mm_Relief","Connector_Wire/SolderWire-1.5sqmm_1x06_P6mm_D1.7mm_OD3mm_Relief2x","Connector_Wire/SolderWire-1.5sqmm_1x06_P7.8mm_D1.7mm_OD3.9mm","Connector_Wire/SolderWire-1.5sqmm_1x06_P7.8mm_D1.7mm_OD3.9mm_Relief","Connector_Wire/SolderWire-1.5sqmm_1x06_P7.8mm_D1.7mm_OD3.9mm_Relief2x","Connector_Wire/SolderWire-1sqmm_1x01_D1.4mm_OD2.7mm","Connector_Wire/SolderWire-1sqmm_1x01_D1.4mm_OD2.7mm_Relief","Connector_Wire/SolderWire-1sqmm_1x01_D1.4mm_OD2.7mm_Relief2x","Connector_Wire/SolderWire-1sqmm_1x01_D1.4mm_OD3.9mm","Connector_Wire/SolderWire-1sqmm_1x01_D1.4mm_OD3.9mm_Relief","Connector_Wire/SolderWire-1sqmm_1x01_D1.4mm_OD3.9mm_Relief2x","Connector_Wire/SolderWire-1sqmm_1x02_P5.4mm_D1.4mm_OD2.7mm","Connector_Wire/SolderWire-1sqmm_1x02_P5.4mm_D1.4mm_OD2.7mm_Relief","Connector_Wire/SolderWire-1sqmm_1x02_P5.4mm_D1.4mm_OD2.7mm_Relief2x","Connector_Wire/SolderWire-1sqmm_1x02_P7.8mm_D1.4mm_OD3.9mm","Connector_Wire/SolderWire-1sqmm_1x02_P7.8mm_D1.4mm_OD3.9mm_Relief","Connector_Wire/SolderWire-1sqmm_1x02_P7.8mm_D1.4mm_OD3.9mm_Relief2x","Connector_Wire/SolderWire-1sqmm_1x03_P5.4mm_D1.4mm_OD2.7mm","Connector_Wire/SolderWire-1sqmm_1x03_P5.4mm_D1.4mm_OD2.7mm_Relief","Connector_Wire/SolderWire-1sqmm_1x03_P5.4mm_D1.4mm_OD2.7mm_Relief2x","Connector_Wire/SolderWire-1sqmm_1x03_P7.8mm_D1.4mm_OD3.9mm","Connector_Wire/SolderWire-1sqmm_1x03_P7.8mm_D1.4mm_OD3.9mm_Relief","Connector_Wire/SolderWire-1sqmm_1x03_P7.8mm_D1.4mm_OD3.9mm_Relief2x","Connector_Wire/SolderWire-1sqmm_1x04_P5.4mm_D1.4mm_OD2.7mm","Connector_Wire/SolderWire-1sqmm_1x04_P5.4mm_D1.4mm_OD2.7mm_Relief","Connector_Wire/SolderWire-1sqmm_1x04_P5.4mm_D1.4mm_OD2.7mm_Relief2x","Connector_Wire/SolderWire-1sqmm_1x04_P7.8mm_D1.4mm_OD3.9mm","Connector_Wire/SolderWire-1sqmm_1x04_P7.8mm_D1.4mm_OD3.9mm_Relief","Connector_Wire/SolderWire-1sqmm_1x04_P7.8mm_D1.4mm_OD3.9mm_Relief2x","Connector_Wire/SolderWire-1sqmm_1x05_P5.4mm_D1.4mm_OD2.7mm","Connector_Wire/SolderWire-1sqmm_1x05_P5.4mm_D1.4mm_OD2.7mm_Relief","Connector_Wire/SolderWire-1sqmm_1x05_P5.4mm_D1.4mm_OD2.7mm_Relief2x","Connector_Wire/SolderWire-1sqmm_1x05_P7.8mm_D1.4mm_OD3.9mm","Connector_Wire/SolderWire-1sqmm_1x05_P7.8mm_D1.4mm_OD3.9mm_Relief","Connector_Wire/SolderWire-1sqmm_1x05_P7.8mm_D1.4mm_OD3.9mm_Relief2x","Connector_Wire/SolderWire-1sqmm_1x06_P5.4mm_D1.4mm_OD2.7mm","Connector_Wire/SolderWire-1sqmm_1x06_P5.4mm_D1.4mm_OD2.7mm_Relief","Connector_Wire/SolderWire-1sqmm_1x06_P5.4mm_D1.4mm_OD2.7mm_Relief2x","Connector_Wire/SolderWire-1sqmm_1x06_P7.8mm_D1.4mm_OD3.9mm","Connector_Wire/SolderWire-1sqmm_1x06_P7.8mm_D1.4mm_OD3.9mm_Relief","Connector_Wire/SolderWire-1sqmm_1x06_P7.8mm_D1.4mm_OD3.9mm_Relief2x","Connector_Wire/SolderWire-2.5sqmm_1x01_D2.4mm_OD3.6mm","Connector_Wire/SolderWire-2.5sqmm_1x01_D2.4mm_OD3.6mm_Relief","Connector_Wire/SolderWire-2.5sqmm_1x01_D2.4mm_OD3.6mm_Relief2x","Connector_Wire/SolderWire-2.5sqmm_1x01_D2.4mm_OD4.4mm","Connector_Wire/SolderWire-2.5sqmm_1x01_D2.4mm_OD4.4mm_Relief","Connector_Wire/SolderWire-2.5sqmm_1x01_D2.4mm_OD4.4mm_Relief2x","Connector_Wire/SolderWire-2.5sqmm_1x02_P7.2mm_D2.4mm_OD3.6mm","Connector_Wire/SolderWire-2.5sqmm_1x02_P7.2mm_D2.4mm_OD3.6mm_Relief","Connector_Wire/SolderWire-2.5sqmm_1x02_P7.2mm_D2.4mm_OD3.6mm_Relief2x","Connector_Wire/SolderWire-2.5sqmm_1x02_P8.8mm_D2.4mm_OD4.4mm","Connector_Wire/SolderWire-2.5sqmm_1x02_P8.8mm_D2.4mm_OD4.4mm_Relief","Connector_Wire/SolderWire-2.5sqmm_1x02_P8.8mm_D2.4mm_OD4.4mm_Relief2x","Connector_Wire/SolderWire-2.5sqmm_1x03_P7.2mm_D2.4mm_OD3.6mm","Connector_Wire/SolderWire-2.5sqmm_1x03_P7.2mm_D2.4mm_OD3.6mm_Relief","Connector_Wire/SolderWire-2.5sqmm_1x03_P7.2mm_D2.4mm_OD3.6mm_Relief2x","Connector_Wire/SolderWire-2.5sqmm_1x03_P8.8mm_D2.4mm_OD4.4mm","Connector_Wire/SolderWire-2.5sqmm_1x03_P8.8mm_D2.4mm_OD4.4mm_Relief","Connector_Wire/SolderWire-2.5sqmm_1x03_P8.8mm_D2.4mm_OD4.4mm_Relief2x","Connector_Wire/SolderWire-2.5sqmm_1x04_P7.2mm_D2.4mm_OD3.6mm","Connector_Wire/SolderWire-2.5sqmm_1x04_P7.2mm_D2.4mm_OD3.6mm_Relief","Connector_Wire/SolderWire-2.5sqmm_1x04_P7.2mm_D2.4mm_OD3.6mm_Relief2x","Connector_Wire/SolderWire-2.5sqmm_1x04_P8.8mm_D2.4mm_OD4.4mm","Connector_Wire/SolderWire-2.5sqmm_1x04_P8.8mm_D2.4mm_OD4.4mm_Relief","Connector_Wire/SolderWire-2.5sqmm_1x04_P8.8mm_D2.4mm_OD4.4mm_Relief2x","Connector_Wire/SolderWire-2.5sqmm_1x05_P7.2mm_D2.4mm_OD3.6mm","Connector_Wire/SolderWire-2.5sqmm_1x05_P7.2mm_D2.4mm_OD3.6mm_Relief","Connector_Wire/SolderWire-2.5sqmm_1x05_P7.2mm_D2.4mm_OD3.6mm_Relief2x","Connector_Wire/SolderWire-2.5sqmm_1x05_P8.8mm_D2.4mm_OD4.4mm","Connector_Wire/SolderWire-2.5sqmm_1x05_P8.8mm_D2.4mm_OD4.4mm_Relief","Connector_Wire/SolderWire-2.5sqmm_1x05_P8.8mm_D2.4mm_OD4.4mm_Relief2x","Connector_Wire/SolderWire-2.5sqmm_1x06_P7.2mm_D2.4mm_OD3.6mm","Connector_Wire/SolderWire-2.5sqmm_1x06_P7.2mm_D2.4mm_OD3.6mm_Relief","Connector_Wire/SolderWire-2.5sqmm_1x06_P7.2mm_D2.4mm_OD3.6mm_Relief2x","Connector_Wire/SolderWire-2.5sqmm_1x06_P8.8mm_D2.4mm_OD4.4mm","Connector_Wire/SolderWire-2.5sqmm_1x06_P8.8mm_D2.4mm_OD4.4mm_Relief","Connector_Wire/SolderWire-2.5sqmm_1x06_P8.8mm_D2.4mm_OD4.4mm_Relief2x","Connector_Wire/SolderWire-2sqmm_1x01_D2mm_OD3.9mm","Connector_Wire/SolderWire-2sqmm_1x01_D2mm_OD3.9mm_Relief","Connector_Wire/SolderWire-2sqmm_1x01_D2mm_OD3.9mm_Relief2x","Connector_Wire/SolderWire-2sqmm_1x02_P7.8mm_D2mm_OD3.9mm","Connector_Wire/SolderWire-2sqmm_1x02_P7.8mm_D2mm_OD3.9mm_Relief","Connector_Wire/SolderWire-2sqmm_1x02_P7.8mm_D2mm_OD3.9mm_Relief2x","Connector_Wire/SolderWire-2sqmm_1x03_P7.8mm_D2mm_OD3.9mm","Connector_Wire/SolderWire-2sqmm_1x03_P7.8mm_D2mm_OD3.9mm_Relief","Connector_Wire/SolderWire-2sqmm_1x03_P7.8mm_D2mm_OD3.9mm_Relief2x","Connector_Wire/SolderWire-2sqmm_1x04_P7.8mm_D2mm_OD3.9mm","Connector_Wire/SolderWire-2sqmm_1x04_P7.8mm_D2mm_OD3.9mm_Relief","Connector_Wire/SolderWire-2sqmm_1x04_P7.8mm_D2mm_OD3.9mm_Relief2x","Connector_Wire/SolderWire-2sqmm_1x05_P7.8mm_D2mm_OD3.9mm","Connector_Wire/SolderWire-2sqmm_1x05_P7.8mm_D2mm_OD3.9mm_Relief","Connector_Wire/SolderWire-2sqmm_1x05_P7.8mm_D2mm_OD3.9mm_Relief2x","Connector_Wire/SolderWire-2sqmm_1x06_P7.8mm_D2mm_OD3.9mm","Connector_Wire/SolderWire-2sqmm_1x06_P7.8mm_D2mm_OD3.9mm_Relief","Connector_Wire/SolderWire-2sqmm_1x06_P7.8mm_D2mm_OD3.9mm_Relief2x","Connector_Wire/SolderWire-4sqmm_1x01_D3mm_OD6mm","Connector_Wire/SolderWire-4sqmm_1x01_D3mm_OD6mm_Relief","Connector_Wire/SolderWire-4sqmm_1x01_D3mm_OD6mm_Relief2x","Connector_Wire/SolderWire-4sqmm_1x02_P12mm_D3mm_OD6mm","Connector_Wire/SolderWire-4sqmm_1x02_P12mm_D3mm_OD6mm_Relief","Connector_Wire/SolderWire-4sqmm_1x02_P12mm_D3mm_OD6mm_Relief2x","Connector_Wire/SolderWire-4sqmm_1x03_P12mm_D3mm_OD6mm","Connector_Wire/SolderWire-4sqmm_1x03_P12mm_D3mm_OD6mm_Relief","Connector_Wire/SolderWire-4sqmm_1x03_P12mm_D3mm_OD6mm_Relief2x","Connector_Wire/SolderWire-4sqmm_1x04_P12mm_D3mm_OD6mm","Connector_Wire/SolderWire-4sqmm_1x04_P12mm_D3mm_OD6mm_Relief","Connector_Wire/SolderWire-4sqmm_1x04_P12mm_D3mm_OD6mm_Relief2x","Connector_Wire/SolderWire-4sqmm_1x05_P12mm_D3mm_OD6mm","Connector_Wire/SolderWire-4sqmm_1x05_P12mm_D3mm_OD6mm_Relief","Connector_Wire/SolderWire-4sqmm_1x05_P12mm_D3mm_OD6mm_Relief2x","Connector_Wire/SolderWire-4sqmm_1x06_P12mm_D3mm_OD6mm","Connector_Wire/SolderWire-4sqmm_1x06_P12mm_D3mm_OD6mm_Relief","Connector_Wire/SolderWire-4sqmm_1x06_P12mm_D3mm_OD6mm_Relief2x","Connector_Wire/SolderWire-6sqmm_1x01_D3.5mm_OD7mm","Connector_Wire/SolderWire-6sqmm_1x01_D3.5mm_OD7mm_Relief","Connector_Wire/SolderWire-6sqmm_1x01_D3.5mm_OD7mm_Relief2x","Connector_Wire/SolderWire-6sqmm_1x02_P14mm_D3.5mm_OD7mm","Connector_Wire/SolderWire-6sqmm_1x02_P14mm_D3.5mm_OD7mm_Relief","Connector_Wire/SolderWire-6sqmm_1x02_P14mm_D3.5mm_OD7mm_Relief2x","Connector_Wire/SolderWire-6sqmm_1x03_P14mm_D3.5mm_OD7mm","Connector_Wire/SolderWire-6sqmm_1x03_P14mm_D3.5mm_OD7mm_Relief","Connector_Wire/SolderWire-6sqmm_1x03_P14mm_D3.5mm_OD7mm_Relief2x","Connector_Wire/SolderWire-6sqmm_1x04_P14mm_D3.5mm_OD7mm","Connector_Wire/SolderWire-6sqmm_1x04_P14mm_D3.5mm_OD7mm_Relief","Connector_Wire/SolderWire-6sqmm_1x04_P14mm_D3.5mm_OD7mm_Relief2x","Connector_Wire/SolderWire-6sqmm_1x05_P14mm_D3.5mm_OD7mm","Connector_Wire/SolderWire-6sqmm_1x05_P14mm_D3.5mm_OD7mm_Relief","Connector_Wire/SolderWire-6sqmm_1x05_P14mm_D3.5mm_OD7mm_Relief2x","Connector_Wire/SolderWire-6sqmm_1x06_P14mm_D3.5mm_OD7mm","Connector_Wire/SolderWire-6sqmm_1x06_P14mm_D3.5mm_OD7mm_Relief","Connector_Wire/SolderWire-6sqmm_1x06_P14mm_D3.5mm_OD7mm_Relief2x","Connector_Wire/SolderWirePad_1x01_SMD_1.5x3mm","Connector_Wire/SolderWirePad_1x01_SMD_1x2mm","Connector_Wire/SolderWirePad_1x01_SMD_2x4mm","Connector_Wire/SolderWirePad_1x01_SMD_3x6mm","Connector_Wire/SolderWirePad_1x01_SMD_4x8mm","Connector_Wire/SolderWirePad_1x01_SMD_5x10mm","Connector_Wuerth/Wuerth_WR-PHD_610004243021_SMD_2x02_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_610006243021_SMD_2x03_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_610008243021_SMD_2x04_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_610010243021_SMD_2x05_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_610012243021_SMD_2x06_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_610016243021_SMD_2x08_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_610018243021_SMD_2x09_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_610020243021_SMD_2x10_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_610022243021_SMD_2x11_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_610024243021_SMD_2x12_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_610026243021_SMD_2x13_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_610032243021_SMD_2x16_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_610034243021_SMD_2x17_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_613004216921_Large_2x02_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_61300425721_Standard_2x02_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_613006216921_Large_2x03_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_61300625721_Standard_2x03_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_613008216921_Large_2x04_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_61300825721_Standard_2x04_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_613010216921_Large_2x05_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_61301025721_Standard_2x05_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_613012216921_Large_2x06_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_61301225721_Standard_2x06_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_613016216921_Large_2x08_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_61301625721_Standard_2x08_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_613018216921_Large_2x09_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_613020216921_Large_2x10_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_61302025721_Standard_2x10_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_613022216921_Large_2x11_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_613024216921_Large_2x12_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_61302425721_Standard_2x12_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_613026216921_Large_2x13_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_61302625721_Standard_2x13_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_613032216921_Large_2x16_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_61303225721_Standard_2x16_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_613034216921_Large_2x17_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_61303425721_Standard_2x17_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-WTB_64800211622_1x02_P1.50mm_Vertical","Connector_Wuerth/Wuerth_WR-WTB_64800311622_1x03_P1.50mm_Vertical","Connector_Wuerth/Wuerth_WR-WTB_64800411622_1x04_P1.50mm_Vertical","Connector_Wuerth/Wuerth_WR-WTB_64800511622_1x05_P1.50mm_Vertical","Connector_Wuerth/Wuerth_WR-WTB_64800611622_1x06_P1.50mm_Vertical","Connector_Wuerth/Wuerth_WR-WTB_64800711622_1x07_P1.50mm_Vertical","Connector_Wuerth/Wuerth_WR-WTB_64800811622_1x08_P1.50mm_Vertical","Connector_Wuerth/Wuerth_WR-WTB_64800911622_1x09_P1.50mm_Vertical","Connector_Wuerth/Wuerth_WR-WTB_64801011622_1x10_P1.50mm_Vertical","Connector_Zhaoxing/Zhaoxing_VH_ZX-VH3.96-10PLT_1x10-1MP_P3.96mm_Vertical","Connector_Zhaoxing/Zhaoxing_VH_ZX-VH3.96-2PLT_1x02-1MP_P3.96mm_Vertical","Connector_Zhaoxing/Zhaoxing_VH_ZX-VH3.96-3PLT_1x03-1MP_P3.96mm_Vertical","Connector_Zhaoxing/Zhaoxing_VH_ZX-VH3.96-4PLT_1x04-1MP_P3.96mm_Vertical","Connector_Zhaoxing/Zhaoxing_VH_ZX-VH3.96-5PLT_1x05-1MP_P3.96mm_Vertical","Connector_Zhaoxing/Zhaoxing_VH_ZX-VH3.96-6PLT_1x06-1MP_P3.96mm_Vertical","Connector_Zhaoxing/Zhaoxing_VH_ZX-VH3.96-7PLT_1x07-1MP_P3.96mm_Vertical","Connector_Zhaoxing/Zhaoxing_VH_ZX-VH3.96-8PLT_1x08-1MP_P3.96mm_Vertical","Connector_Zhaoxing/Zhaoxing_VH_ZX-VH3.96-9PLT_1x09-1MP_P3.96mm_Vertical","Converter_ACDC/Converter_ACDC_CUI_PBO-3-Sxx_THT_Vertical","Converter_ACDC/Converter_ACDC_Hahn_HS-400xx_THT","Converter_ACDC/Converter_ACDC_Hi-Link_HLK-10Mxx","Converter_ACDC/Converter_ACDC_Hi-Link_HLK-12MxxA","Converter_ACDC/Converter_ACDC_Hi-Link_HLK-20Mxx","Converter_ACDC/Converter_ACDC_Hi-Link_HLK-2Mxx","Converter_ACDC/Converter_ACDC_Hi-Link_HLK-30Mxx","Converter_ACDC/Converter_ACDC_Hi-Link_HLK-5Mxx","Converter_ACDC/Converter_ACDC_Hi-Link_HLK-PMxx","Converter_ACDC/Converter_ACDC_MeanWell_IRM-02-xx_SMD","Converter_ACDC/Converter_ACDC_MeanWell_IRM-02-xx_THT","Converter_ACDC/Converter_ACDC_MeanWell_IRM-03-xx_SMD","Converter_ACDC/Converter_ACDC_MeanWell_IRM-03-xx_THT","Converter_ACDC/Converter_ACDC_MeanWell_IRM-05-xx_THT","Converter_ACDC/Converter_ACDC_MeanWell_IRM-10-xx_THT","Converter_ACDC/Converter_ACDC_MeanWell_IRM-20-xx_THT","Converter_ACDC/Converter_ACDC_MeanWell_IRM-60-xx_THT","Converter_ACDC/Converter_ACDC_MeanWell_MFM-10-xx_THT","Converter_ACDC/Converter_ACDC_MeanWell_MFM-15-xx_THT","Converter_ACDC/Converter_ACDC_Murata_BAC05SxxDC_THT","Converter_ACDC/Converter_ACDC_RECOM_RAC01-xxSGB_THT","Converter_ACDC/Converter_ACDC_RECOM_RAC04-xxSGx_THT","Converter_ACDC/Converter_ACDC_RECOM_RAC05-xxSK_THT","Converter_ACDC/Converter_ACDC_Recom_RAC20-xxDK_THT","Converter_ACDC/Converter_ACDC_Recom_RAC20-xxSK_THT","Converter_ACDC/Converter_ACDC_TRACO_TMF_051xx_THT","Converter_ACDC/Converter_ACDC_TRACO_TMF_101xx_THT","Converter_ACDC/Converter_ACDC_TRACO_TMF_201xx_THT","Converter_ACDC/Converter_ACDC_TRACO_TMF_301xx_THT","Converter_ACDC/Converter_ACDC_TRACO_TMG_071xx_THT","Converter_ACDC/Converter_ACDC_TRACO_TMG_151xx_THT","Converter_ACDC/Converter_ACDC_TRACO_TMLM-04_THT","Converter_ACDC/Converter_ACDC_TRACO_TMLM-05_THT","Converter_ACDC/Converter_ACDC_TRACO_TMLM-10-20_THT","Converter_ACDC/Converter_ACDC_TRACO_TMPW10_1xx_THT","Converter_ACDC/Converter_ACDC_TRACO_TMPW25_1xx_THT","Converter_ACDC/Converter_ACDC_TRACO_TMPW5-1xx_THT","Converter_ACDC/Converter_ACDC_TRACO_TPP-15-1xx-D_THT","Converter_ACDC/Converter_ACDC_Vigortronix_VTX-214-010-1xx_THT","Converter_ACDC/Converter_ACDC_Vigortronix_VTX-214-010-2xx_THT","Converter_ACDC/Converter_ACDC_Vigortronix_VTX-214-015-1xx_THT","Converter_ACDC/Converter_ACDC_ZETTLER_ZPI03Sxx00WC_THT","Converter_DCDC/Converter_DCDC_Artesyn_ATA_SMD","Converter_DCDC/Converter_DCDC_Bothhand_CFUDxxxx_THT","Converter_DCDC/Converter_DCDC_Bothhand_CFUSxxxxEH_THT","Converter_DCDC/Converter_DCDC_Bothhand_CFUSxxxx_THT","Converter_DCDC/Converter_DCDC_Cincon_EC5BExx_Dual_THT","Converter_DCDC/Converter_DCDC_Cincon_EC5BExx_Single_THT","Converter_DCDC/Converter_DCDC_Cincon_EC6Cxx_Dual-Triple_THT","Converter_DCDC/Converter_DCDC_Cincon_EC6Cxx_Single_THT","Converter_DCDC/Converter_DCDC_Cyntec_MUN12AD01-SH","Converter_DCDC/Converter_DCDC_Cyntec_MUN12AD03-SH","Converter_DCDC/Converter_DCDC_Hamamatsu_C11204-1_THT","Converter_DCDC/Converter_DCDC_MeanWell_NID30_THT","Converter_DCDC/Converter_DCDC_MeanWell_NID60_THT","Converter_DCDC/Converter_DCDC_MeanWell_NSD10_THT","Converter_DCDC/Converter_DCDC_Murata_CRE1xxxxxx3C_THT","Converter_DCDC/Converter_DCDC_Murata_CRE1xxxxxxDC_THT","Converter_DCDC/Converter_DCDC_Murata_CRE1xxxxxxSC_THT","Converter_DCDC/Converter_DCDC_Murata_MEE1SxxxxSC_THT","Converter_DCDC/Converter_DCDC_Murata_MEE3SxxxxSC_THT","Converter_DCDC/Converter_DCDC_Murata_MGJ2DxxxxxxSC_THT","Converter_DCDC/Converter_DCDC_Murata_MGJ3","Converter_DCDC/Converter_DCDC_Murata_MYRxP","Converter_DCDC/Converter_DCDC_Murata_NCS1SxxxxSC_THT","Converter_DCDC/Converter_DCDC_Murata_NMAxxxxDC_THT","Converter_DCDC/Converter_DCDC_Murata_NMAxxxxSC_THT","Converter_DCDC/Converter_DCDC_Murata_NXExSxxxxMC_SMD","Converter_DCDC/Converter_DCDC_Murata_OKI-78SR_Horizontal","Converter_DCDC/Converter_DCDC_Murata_OKI-78SR_Vertical","Converter_DCDC/Converter_DCDC_RECOM_R-78B-2.0_THT","Converter_DCDC/Converter_DCDC_RECOM_R-78E-0.5_THT","Converter_DCDC/Converter_DCDC_RECOM_R-78HB-0.5L_THT","Converter_DCDC/Converter_DCDC_RECOM_R-78HB-0.5_THT","Converter_DCDC/Converter_DCDC_RECOM_R-78S-0.1_THT","Converter_DCDC/Converter_DCDC_RECOM_R5xxxDA_THT","Converter_DCDC/Converter_DCDC_RECOM_R5xxxPA_THT","Converter_DCDC/Converter_DCDC_RECOM_RCD-24_THT","Converter_DCDC/Converter_DCDC_RECOM_RPA60-xxxxSFW","Converter_DCDC/Converter_DCDC_RECOM_RPMx.x-x.0","Converter_DCDC/Converter_DCDC_Silvertel_Ag54xx","Converter_DCDC/Converter_DCDC_Silvertel_Ag5810","Converter_DCDC/Converter_DCDC_Silvertel_Ag99xxLP_THT","Converter_DCDC/Converter_DCDC_TRACO_TBA1-xxxxE_Dual_THT","Converter_DCDC/Converter_DCDC_TRACO_TBA1-xxxxE_Single_THT","Converter_DCDC/Converter_DCDC_TRACO_TBA1-xxxx_THT","Converter_DCDC/Converter_DCDC_TRACO_TBA2-xxxx_Dual_THT","Converter_DCDC/Converter_DCDC_TRACO_TBA2-xxxx_Single_THT","Converter_DCDC/Converter_DCDC_TRACO_TDN_5-xxxxWISM_SMD","Converter_DCDC/Converter_DCDC_TRACO_TDN_5-xxxxWI_THT","Converter_DCDC/Converter_DCDC_TRACO_TDU1-xxxx_THT","Converter_DCDC/Converter_DCDC_TRACO_TEA1-xxxxE_THT","Converter_DCDC/Converter_DCDC_TRACO_TEA1-xxxxHI_THT","Converter_DCDC/Converter_DCDC_TRACO_TEA1-xxxx_THT","Converter_DCDC/Converter_DCDC_TRACO_TEC2-12xxWI_24xxWI_48xxWI_THT","Converter_DCDC/Converter_DCDC_TRACO_TEC3-24xxUI_THT","Converter_DCDC/Converter_DCDC_TRACO_TEL12-xxxx_THT","Converter_DCDC/Converter_DCDC_TRACO_TEN10-110xxWIRH_THT","Converter_DCDC/Converter_DCDC_TRACO_TEN10-xxxx_Dual_THT","Converter_DCDC/Converter_DCDC_TRACO_TEN10-xxxx_Single_THT","Converter_DCDC/Converter_DCDC_TRACO_TEN10-xxxx_THT","Converter_DCDC/Converter_DCDC_TRACO_TEN20-110xxWIRH_THT","Converter_DCDC/Converter_DCDC_TRACO_TEN20-xxxx-N4_THT","Converter_DCDC/Converter_DCDC_TRACO_TEN20-xxxx_THT","Converter_DCDC/Converter_DCDC_TRACO_TEN30-xxxxUIR_THT","Converter_DCDC/Converter_DCDC_TRACO_TEN40-110xxWIRH_THT","Converter_DCDC/Converter_DCDC_TRACO_TEP150-721xUIR_THT","Converter_DCDC/Converter_DCDC_TRACO_TES1-051x_121x_241x_Single_SMD","Converter_DCDC/Converter_DCDC_TRACO_TES1-052x_122x_242x_Dual_SMD","Converter_DCDC/Converter_DCDC_TRACO_THB10-xxxx_Dual_THT","Converter_DCDC/Converter_DCDC_TRACO_THB10-xxxx_Single_THT","Converter_DCDC/Converter_DCDC_TRACO_THD_15-xxxxWIN_THT","Converter_DCDC/Converter_DCDC_TRACO_THL30-xxxxWI_THT","Converter_DCDC/Converter_DCDC_TRACO_THL40-xxxxWI_THT","Converter_DCDC/Converter_DCDC_TRACO_THN10-xxxxUIR_THT","Converter_DCDC/Converter_DCDC_TRACO_THN30-xxxx_THT","Converter_DCDC/Converter_DCDC_TRACO_THR40-72xxWI_THT","Converter_DCDC/Converter_DCDC_TRACO_TMA-05xxD_12xxD_Dual_THT","Converter_DCDC/Converter_DCDC_TRACO_TMA-05xxS_12xxS_Single_THT","Converter_DCDC/Converter_DCDC_TRACO_TMA-15xxD_24xxD_Dual_THT","Converter_DCDC/Converter_DCDC_TRACO_TMA-15xxS_24xxS_Single_THT","Converter_DCDC/Converter_DCDC_TRACO_TME_03xxS_05xxS_12xxS_Single_THT","Converter_DCDC/Converter_DCDC_TRACO_TME_24xxS_Single_THT","Converter_DCDC/Converter_DCDC_TRACO_TMR-1-xxxx_Dual_THT","Converter_DCDC/Converter_DCDC_TRACO_TMR-1-xxxx_Single_THT","Converter_DCDC/Converter_DCDC_TRACO_TMR-1SM_SMD","Converter_DCDC/Converter_DCDC_TRACO_TMR10-24xxWIR_48xxWIR_72xxWIR_THT","Converter_DCDC/Converter_DCDC_TRACO_TMR2-xxxxWI_THT","Converter_DCDC/Converter_DCDC_TRACO_TMR4-xxxxWI_THT","Converter_DCDC/Converter_DCDC_TRACO_TMU3-05xx_12xx_THT","Converter_DCDC/Converter_DCDC_TRACO_TMU3-24xx_THT","Converter_DCDC/Converter_DCDC_TRACO_TMV-051xD_121xD_Dual_THT","Converter_DCDC/Converter_DCDC_TRACO_TMV-051xS_121xS_Single_THT","Converter_DCDC/Converter_DCDC_TRACO_TMV-241xD_Dual_THT","Converter_DCDC/Converter_DCDC_TRACO_TMV-241xS_Single_THT","Converter_DCDC/Converter_DCDC_TRACO_TOS06-05SIL_THT","Converter_DCDC/Converter_DCDC_TRACO_TOS06-12SIL_THT","Converter_DCDC/Converter_DCDC_TRACO_TRA3-xxxx_THT","Converter_DCDC/Converter_DCDC_TRACO_TRI1-xxxxSM_SMD","Converter_DCDC/Converter_DCDC_TRACO_TRI1-xxxx_THT","Converter_DCDC/Converter_DCDC_TRACO_TRI10_Dual_THT","Converter_DCDC/Converter_DCDC_TRACO_TRI10_Single_THT","Converter_DCDC/Converter_DCDC_TRACO_TRN3-xx1x_Single_THT","Converter_DCDC/Converter_DCDC_TRACO_TRN3-xx2x_Dual_THT","Converter_DCDC/Converter_DCDC_TRACO_TSR-1_THT","Converter_DCDC/Converter_DCDC_TRACO_TSR0.5-24xxSM_241xxSM_SMD","Converter_DCDC/Converter_DCDC_TRACO_TSR0.5-24xx_TSR0.5-24xxx_THT","Converter_DCDC/Converter_DCDC_TRACO_TSR0.6-48xxWI_TSR0.6-48xxxWI_THT","Converter_DCDC/Converter_DCDC_TRACO_TSR1-xxxxE_THT","Converter_DCDC/Converter_DCDC_TRACO_TSR1.5-24xxE_24120E_THT","Converter_DCDC/Converter_DCDC_TRACO_TSR2-24xxN_TSR2-24xxxN_THT","Converter_DCDC/Converter_DCDC_TRACO_TSR2-xxxx_THT","Converter_DCDC/Converter_DCDC_XP_POWER-IA48xxD_THT","Converter_DCDC/Converter_DCDC_XP_POWER-IA48xxS_THT","Converter_DCDC/Converter_DCDC_XP_POWER-IAxxxxD_THT","Converter_DCDC/Converter_DCDC_XP_POWER-IAxxxxS_THT","Converter_DCDC/Converter_DCDC_XP_POWER-IHxxxxDH_THT","Converter_DCDC/Converter_DCDC_XP_POWER-IHxxxxD_THT","Converter_DCDC/Converter_DCDC_XP_POWER-IHxxxxSH_THT","Converter_DCDC/Converter_DCDC_XP_POWER-IHxxxxS_THT","Converter_DCDC/Converter_DCDC_XP_POWER-ISU02_SMD","Converter_DCDC/Converter_DCDC_XP_POWER-ITQxxxxS-H_THT","Converter_DCDC/Converter_DCDC_XP_POWER-ITXxxxxSA_THT","Converter_DCDC/Converter_DCDC_XP_POWER-ITxxxxxS_THT","Converter_DCDC/Converter_DCDC_XP_POWER_JTDxxxxxxx_THT","Converter_DCDC/Converter_DCDC_XP_POWER_JTExxxxDxx_THT","Converter_DCDC/Converter_DCDC_muRata_MEJ1DxxxxSC_THT","Converter_DCDC/Converter_DCDC_muRata_MEJ1SxxxxSC_THT","Crystal/Crystal_AT310_D3.0mm_L10.0mm_Horizontal","Crystal/Crystal_AT310_D3.0mm_L10.0mm_Horizontal_1EP_style1","Crystal/Crystal_AT310_D3.0mm_L10.0mm_Horizontal_1EP_style2","Crystal/Crystal_AT310_D3.0mm_L10.0mm_Vertical","Crystal/Crystal_C26-LF_D2.1mm_L6.5mm_Horizontal","Crystal/Crystal_C26-LF_D2.1mm_L6.5mm_Horizontal_1EP_style1","Crystal/Crystal_C26-LF_D2.1mm_L6.5mm_Horizontal_1EP_style2","Crystal/Crystal_C26-LF_D2.1mm_L6.5mm_Vertical","Crystal/Crystal_C38-LF_D3.0mm_L8.0mm_Horizontal","Crystal/Crystal_C38-LF_D3.0mm_L8.0mm_Horizontal_1EP_style1","Crystal/Crystal_C38-LF_D3.0mm_L8.0mm_Horizontal_1EP_style2","Crystal/Crystal_C38-LF_D3.0mm_L8.0mm_Vertical","Crystal/Crystal_DS10_D1.0mm_L4.3mm_Horizontal","Crystal/Crystal_DS10_D1.0mm_L4.3mm_Horizontal_1EP_style1","Crystal/Crystal_DS10_D1.0mm_L4.3mm_Horizontal_1EP_style2","Crystal/Crystal_DS10_D1.0mm_L4.3mm_Vertical","Crystal/Crystal_DS15_D1.5mm_L5.0mm_Horizontal","Crystal/Crystal_DS15_D1.5mm_L5.0mm_Horizontal_1EP_style1","Crystal/Crystal_DS15_D1.5mm_L5.0mm_Horizontal_1EP_style2","Crystal/Crystal_DS15_D1.5mm_L5.0mm_Vertical","Crystal/Crystal_DS26_D2.0mm_L6.0mm_Horizontal","Crystal/Crystal_DS26_D2.0mm_L6.0mm_Horizontal_1EP_style1","Crystal/Crystal_DS26_D2.0mm_L6.0mm_Horizontal_1EP_style2","Crystal/Crystal_DS26_D2.0mm_L6.0mm_Vertical","Crystal/Crystal_HC18-U_Horizontal","Crystal/Crystal_HC18-U_Horizontal_1EP_style1","Crystal/Crystal_HC18-U_Horizontal_1EP_style2","Crystal/Crystal_HC18-U_Vertical","Crystal/Crystal_HC33-U_Horizontal","Crystal/Crystal_HC33-U_Horizontal_1EP_style1","Crystal/Crystal_HC33-U_Horizontal_1EP_style2","Crystal/Crystal_HC33-U_Vertical","Crystal/Crystal_HC35-U","Crystal/Crystal_HC49-4H_Vertical","Crystal/Crystal_HC49-U-3Pin_Vertical","Crystal/Crystal_HC49-U_Horizontal","Crystal/Crystal_HC49-U_Horizontal_1EP_style1","Crystal/Crystal_HC49-U_Horizontal_1EP_style2","Crystal/Crystal_HC49-U_Vertical","Crystal/Crystal_HC50_Horizontal","Crystal/Crystal_HC50_Horizontal_1EP_style1","Crystal/Crystal_HC50_Horizontal_1EP_style2","Crystal/Crystal_HC50_Vertical","Crystal/Crystal_HC51-U_Vertical","Crystal/Crystal_HC51_Horizontal","Crystal/Crystal_HC51_Horizontal_1EP_style1","Crystal/Crystal_HC51_Horizontal_1EP_style2","Crystal/Crystal_HC52-6mm_Horizontal","Crystal/Crystal_HC52-6mm_Horizontal_1EP_style1","Crystal/Crystal_HC52-6mm_Horizontal_1EP_style2","Crystal/Crystal_HC52-6mm_Vertical","Crystal/Crystal_HC52-8mm_Horizontal","Crystal/Crystal_HC52-8mm_Horizontal_1EP_style1","Crystal/Crystal_HC52-8mm_Horizontal_1EP_style2","Crystal/Crystal_HC52-8mm_Vertical","Crystal/Crystal_HC52-U-3Pin_Vertical","Crystal/Crystal_HC52-U_Horizontal","Crystal/Crystal_HC52-U_Horizontal_1EP_style1","Crystal/Crystal_HC52-U_Horizontal_1EP_style2","Crystal/Crystal_HC52-U_Vertical","Crystal/Crystal_Round_D1.0mm_Vertical","Crystal/Crystal_Round_D1.5mm_Vertical","Crystal/Crystal_Round_D2.0mm_Vertical","Crystal/Crystal_Round_D3.0mm_Vertical","Crystal/Crystal_SMD_0603-2Pin_6.0x3.5mm","Crystal/Crystal_SMD_0603-2Pin_6.0x3.5mm_HandSoldering","Crystal/Crystal_SMD_0603-4Pin_6.0x3.5mm","Crystal/Crystal_SMD_0603-4Pin_6.0x3.5mm_HandSoldering","Crystal/Crystal_SMD_1210-4Pin_1.2x1.0mm","Crystal/Crystal_SMD_1210-4Pin_1.2x1.0mm_RotB","Crystal/Crystal_SMD_2012-2Pin_2.0x1.2mm","Crystal/Crystal_SMD_2012-2Pin_2.0x1.2mm_HandSoldering","Crystal/Crystal_SMD_2016-4Pin_2.0x1.6mm","Crystal/Crystal_SMD_2520-4Pin_2.5x2.0mm","Crystal/Crystal_SMD_3215-2Pin_3.2x1.5mm","Crystal/Crystal_SMD_3225-4Pin_3.2x2.5mm","Crystal/Crystal_SMD_3225-4Pin_3.2x2.5mm_HandSoldering","Crystal/Crystal_SMD_5032-2Pin_5.0x3.2mm","Crystal/Crystal_SMD_5032-2Pin_5.0x3.2mm_HandSoldering","Crystal/Crystal_SMD_5032-4Pin_5.0x3.2mm","Crystal/Crystal_SMD_7050-2Pin_7.0x5.0mm","Crystal/Crystal_SMD_7050-2Pin_7.0x5.0mm_HandSoldering","Crystal/Crystal_SMD_7050-4Pin_7.0x5.0mm","Crystal/Crystal_SMD_Abracon_ABM10-4Pin_2.5x2.0mm","Crystal/Crystal_SMD_Abracon_ABM3-2Pin_5.0x3.2mm","Crystal/Crystal_SMD_Abracon_ABM3-2Pin_5.0x3.2mm_HandSoldering","Crystal/Crystal_SMD_Abracon_ABM3B-4Pin_5.0x3.2mm","Crystal/Crystal_SMD_Abracon_ABM3C-4Pin_5.0x3.2mm","Crystal/Crystal_SMD_Abracon_ABM7-2Pin_6.0x3.5mm","Crystal/Crystal_SMD_Abracon_ABM8AIG-4Pin_3.2x2.5mm","Crystal/Crystal_SMD_Abracon_ABM8G-4Pin_3.2x2.5mm","Crystal/Crystal_SMD_Abracon_ABS25-4Pin_8.0x3.8mm","Crystal/Crystal_SMD_Citizen_CS325S-4Pin_3.2x2.5mm","Crystal/Crystal_SMD_ECS_CSM3X-2Pin_7.6x4.1mm","Crystal/Crystal_SMD_EuroQuartz_EQ161-2Pin_3.2x1.5mm","Crystal/Crystal_SMD_EuroQuartz_EQ161-2Pin_3.2x1.5mm_HandSoldering","Crystal/Crystal_SMD_EuroQuartz_MJ-4Pin_5.0x3.2mm","Crystal/Crystal_SMD_EuroQuartz_MJ-4Pin_5.0x3.2mm_HandSoldering","Crystal/Crystal_SMD_EuroQuartz_MQ-4Pin_7.0x5.0mm","Crystal/Crystal_SMD_EuroQuartz_MQ-4Pin_7.0x5.0mm_HandSoldering","Crystal/Crystal_SMD_EuroQuartz_MQ2-2Pin_7.0x5.0mm","Crystal/Crystal_SMD_EuroQuartz_MQ2-2Pin_7.0x5.0mm_HandSoldering","Crystal/Crystal_SMD_EuroQuartz_MT-4Pin_3.2x2.5mm","Crystal/Crystal_SMD_EuroQuartz_MT-4Pin_3.2x2.5mm_HandSoldering","Crystal/Crystal_SMD_EuroQuartz_X22-4Pin_2.5x2.0mm","Crystal/Crystal_SMD_EuroQuartz_X22-4Pin_2.5x2.0mm_HandSoldering","Crystal/Crystal_SMD_FOX_FE-2Pin_7.5x5.0mm","Crystal/Crystal_SMD_FOX_FE-2Pin_7.5x5.0mm_HandSoldering","Crystal/Crystal_SMD_FOX_FQ7050-2Pin_7.0x5.0mm","Crystal/Crystal_SMD_FOX_FQ7050-2Pin_7.0x5.0mm_HandSoldering","Crystal/Crystal_SMD_FOX_FQ7050-4Pin_7.0x5.0mm","Crystal/Crystal_SMD_FrontierElectronics_FM206","Crystal/Crystal_SMD_G8-2Pin_3.2x1.5mm","Crystal/Crystal_SMD_G8-2Pin_3.2x1.5mm_HandSoldering","Crystal/Crystal_SMD_HC49-SD","Crystal/Crystal_SMD_HC49-SD_HandSoldering","Crystal/Crystal_SMD_MicroCrystal_CC1V-T1A-2Pin_8.0x3.7mm","Crystal/Crystal_SMD_MicroCrystal_CC1V-T1A-2Pin_8.0x3.7mm_HandSoldering","Crystal/Crystal_SMD_MicroCrystal_CC4V-T1A-2Pin_5.0x1.9mm","Crystal/Crystal_SMD_MicroCrystal_CC4V-T1A-2Pin_5.0x1.9mm_HandSoldering","Crystal/Crystal_SMD_MicroCrystal_CC5V-T1A-2Pin_4.1x1.5mm","Crystal/Crystal_SMD_MicroCrystal_CC5V-T1A-2Pin_4.1x1.5mm_HandSoldering","Crystal/Crystal_SMD_MicroCrystal_CC7V-T1A-2Pin_3.2x1.5mm","Crystal/Crystal_SMD_MicroCrystal_CC7V-T1A-2Pin_3.2x1.5mm_HandSoldering","Crystal/Crystal_SMD_MicroCrystal_CC8V-T1A-2Pin_2.0x1.2mm","Crystal/Crystal_SMD_MicroCrystal_CC8V-T1A-2Pin_2.0x1.2mm_HandSoldering","Crystal/Crystal_SMD_MicroCrystal_CM9V-T1A-2Pin_1.6x1.0mm","Crystal/Crystal_SMD_MicroCrystal_CM9V-T1A-2Pin_1.6x1.0mm_HandSoldering","Crystal/Crystal_SMD_MicroCrystal_MS1V-T1K","Crystal/Crystal_SMD_MicroCrystal_MS3V-T1R","Crystal/Crystal_SMD_Qantek_QC5CB-2Pin_5x3.2mm","Crystal/Crystal_SMD_SeikoEpson_FA128-4Pin_2.0x1.6mm","Crystal/Crystal_SMD_SeikoEpson_FA238-4Pin_3.2x2.5mm","Crystal/Crystal_SMD_SeikoEpson_FA238-4Pin_3.2x2.5mm_HandSoldering","Crystal/Crystal_SMD_SeikoEpson_FA238V-4Pin_3.2x2.5mm","Crystal/Crystal_SMD_SeikoEpson_FA238V-4Pin_3.2x2.5mm_HandSoldering","Crystal/Crystal_SMD_SeikoEpson_MA406-4Pin_11.7x4.0mm","Crystal/Crystal_SMD_SeikoEpson_MA406-4Pin_11.7x4.0mm_HandSoldering","Crystal/Crystal_SMD_SeikoEpson_MA505-2Pin_12.7x5.1mm","Crystal/Crystal_SMD_SeikoEpson_MA505-2Pin_12.7x5.1mm_HandSoldering","Crystal/Crystal_SMD_SeikoEpson_MA506-4Pin_12.7x5.1mm","Crystal/Crystal_SMD_SeikoEpson_MA506-4Pin_12.7x5.1mm_HandSoldering","Crystal/Crystal_SMD_SeikoEpson_MC146-4Pin_6.7x1.5mm","Crystal/Crystal_SMD_SeikoEpson_MC146-4Pin_6.7x1.5mm_HandSoldering","Crystal/Crystal_SMD_SeikoEpson_MC156-4Pin_7.1x2.5mm","Crystal/Crystal_SMD_SeikoEpson_MC156-4Pin_7.1x2.5mm_HandSoldering","Crystal/Crystal_SMD_SeikoEpson_MC306-4Pin_8.0x3.2mm","Crystal/Crystal_SMD_SeikoEpson_MC306-4Pin_8.0x3.2mm_HandSoldering","Crystal/Crystal_SMD_SeikoEpson_MC405-2Pin_9.6x4.1mm","Crystal/Crystal_SMD_SeikoEpson_MC405-2Pin_9.6x4.1mm_HandSoldering","Crystal/Crystal_SMD_SeikoEpson_MC406-4Pin_9.6x4.1mm","Crystal/Crystal_SMD_SeikoEpson_MC406-4Pin_9.6x4.1mm_HandSoldering","Crystal/Crystal_SMD_SeikoEpson_TSX3225-4Pin_3.2x2.5mm","Crystal/Crystal_SMD_SeikoEpson_TSX3225-4Pin_3.2x2.5mm_HandSoldering","Crystal/Crystal_SMD_TXC_7A-2Pin_5x3.2mm","Crystal/Crystal_SMD_TXC_7M-4Pin_3.2x2.5mm","Crystal/Crystal_SMD_TXC_7M-4Pin_3.2x2.5mm_HandSoldering","Crystal/Crystal_SMD_TXC_9HT11-2Pin_2.0x1.2mm","Crystal/Crystal_SMD_TXC_9HT11-2Pin_2.0x1.2mm_HandSoldering","Crystal/Crystal_SMD_TXC_AX_8045-2Pin_8.0x4.5mm","Crystal/Crystal_SMD_WE_12SMX-4Pin_7.0x5.0mm","Crystal/Crystal_SMD_WE_CFPX-104-4Pin_5.0x3.2mm","Crystal/Crystal_SMD_WE_CFPX-180-4Pin_3.2x2.5mm","Crystal/Crystal_SMD_WE_CFPX-218-4Pin_2.5x2.0mm","Crystal/Crystal_SMD_WE_IQXC-240-4Pin_1.2x1.0mm","Crystal/Crystal_SMD_WE_IQXC-26-4Pin_1.6x1.2mm","Crystal/Crystal_SMD_WE_IQXC-42-4Pin_2.0x1.6mm","Crystal/Resonator-2Pin_W10.0mm_H5.0mm","Crystal/Resonator-2Pin_W6.0mm_H3.0mm","Crystal/Resonator-2Pin_W7.0mm_H2.5mm","Crystal/Resonator-2Pin_W8.0mm_H3.5mm","Crystal/Resonator-3Pin_W10.0mm_H5.0mm","Crystal/Resonator-3Pin_W6.0mm_H3.0mm","Crystal/Resonator-3Pin_W7.0mm_H2.5mm","Crystal/Resonator-3Pin_W8.0mm_H3.5mm","Crystal/Resonator_Murata_CSTLSxxxG-3Pin_W8.0mm_H3.0mm","Crystal/Resonator_Murata_CSTLSxxxX-3Pin_W5.5mm_H3.0mm","Crystal/Resonator_Murata_DSN6-3Pin_W7.0mm_H2.5mm","Crystal/Resonator_Murata_DSS6-3Pin_W7.0mm_H2.5mm","Crystal/Resonator_SMD-3Pin_7.2x3.0mm","Crystal/Resonator_SMD-3Pin_7.2x3.0mm_HandSoldering","Crystal/Resonator_SMD_Murata_CDSCB-2Pin_4.5x2.0mm","Crystal/Resonator_SMD_Murata_CDSCB-2Pin_4.5x2.0mm_HandSoldering","Crystal/Resonator_SMD_Murata_CSTCR_4.5x2x1.15mm","Crystal/Resonator_SMD_Murata_CSTxExxV-3Pin_3.0x1.1mm","Crystal/Resonator_SMD_Murata_CSTxExxV-3Pin_3.0x1.1mm_HandSoldering","Crystal/Resonator_SMD_Murata_SFECV-3Pin_6.9x2.9mm","Crystal/Resonator_SMD_Murata_SFECV-3Pin_6.9x2.9mm_HandSoldering","Crystal/Resonator_SMD_Murata_SFSKA-3Pin_7.9x3.8mm","Crystal/Resonator_SMD_Murata_SFSKA-3Pin_7.9x3.8mm_HandSoldering","Crystal/Resonator_SMD_Murata_TPSKA-3Pin_7.9x3.8mm","Crystal/Resonator_SMD_Murata_TPSKA-3Pin_7.9x3.8mm_HandSoldering","Diode_SMD/D_01005_0402Metric","Diode_SMD/D_01005_0402Metric_Pad0.57x0.30mm_HandSolder","Diode_SMD/D_0201_0603Metric","Diode_SMD/D_0201_0603Metric_Pad0.64x0.40mm_HandSolder","Diode_SMD/D_0402_1005Metric","Diode_SMD/D_0402_1005Metric_Pad0.77x0.64mm_HandSolder","Diode_SMD/D_0603_1608Metric","Diode_SMD/D_0603_1608Metric_Pad1.05x0.95mm_HandSolder","Diode_SMD/D_0805_2012Metric","Diode_SMD/D_0805_2012Metric_Pad1.15x1.40mm_HandSolder","Diode_SMD/D_1206_3216Metric","Diode_SMD/D_1206_3216Metric_Pad1.42x1.75mm_HandSolder","Diode_SMD/D_1210_3225Metric","Diode_SMD/D_1210_3225Metric_Pad1.42x2.65mm_HandSolder","Diode_SMD/D_1812_4532Metric","Diode_SMD/D_1812_4532Metric_Pad1.30x3.40mm_HandSolder","Diode_SMD/D_2010_5025Metric","Diode_SMD/D_2010_5025Metric_Pad1.52x2.65mm_HandSolder","Diode_SMD/D_2114_3652Metric","Diode_SMD/D_2114_3652Metric_Pad1.85x3.75mm_HandSolder","Diode_SMD/D_2512_6332Metric","Diode_SMD/D_2512_6332Metric_Pad1.52x3.35mm_HandSolder","Diode_SMD/D_3220_8050Metric","Diode_SMD/D_3220_8050Metric_Pad2.65x5.15mm_HandSolder","Diode_SMD/D_MELF-RM10_Universal_Handsoldering","Diode_SMD/D_MELF","Diode_SMD/D_MELF_Handsoldering","Diode_SMD/D_MicroMELF","Diode_SMD/D_MicroMELF_Handsoldering","Diode_SMD/D_MicroSMP_LargeAnode","Diode_SMD/D_MicroSMP_LargeCathode","Diode_SMD/D_MiniMELF","Diode_SMD/D_MiniMELF_Handsoldering","Diode_SMD/D_PowerDI-123","Diode_SMD/D_PowerDI-5","Diode_SMD/D_Powermite2_LargeAnode","Diode_SMD/D_Powermite2_LargeCathode","Diode_SMD/D_Powermite3","Diode_SMD/D_Powermite_LargeAnode","Diode_SMD/D_Powermite_LargeCathode","Diode_SMD/D_QFN_3.3x3.3mm_P0.65mm","Diode_SMD/D_SC-80","Diode_SMD/D_SC-80_HandSoldering","Diode_SMD/D_SMA-SMB_Universal_Handsoldering","Diode_SMD/D_SMA","Diode_SMD/D_SMA_Handsoldering","Diode_SMD/D_SMB-SMC_Universal_Handsoldering","Diode_SMD/D_SMB","Diode_SMD/D_SMB_Handsoldering","Diode_SMD/D_SMB_Modified","Diode_SMD/D_SMC-RM10_Universal_Handsoldering","Diode_SMD/D_SMC","Diode_SMD/D_SMC_Handsoldering","Diode_SMD/D_SMF","Diode_SMD/D_SMP_DO-220AA","Diode_SMD/D_SOD-110","Diode_SMD/D_SOD-123","Diode_SMD/D_SOD-123F","Diode_SMD/D_SOD-128","Diode_SMD/D_SOD-323","Diode_SMD/D_SOD-323F","Diode_SMD/D_SOD-323_HandSoldering","Diode_SMD/D_SOD-523","Diode_SMD/D_SOD-882","Diode_SMD/D_SOD-882D","Diode_SMD/D_SOD-923","Diode_SMD/D_TUMD2","Diode_SMD/Diode_Bridge_Bourns_CD-DF4xxS","Diode_SMD/Diode_Bridge_Diotec_ABS","Diode_SMD/Diode_Bridge_Diotec_MicroDil_3.0x3.0x1.8mm","Diode_SMD/Diode_Bridge_Diotec_SO-DIL-Slim","Diode_SMD/Diode_Bridge_OnSemi_SDIP-4L","Diode_SMD/Diode_Bridge_Vishay_DFS","Diode_SMD/Diode_Bridge_Vishay_DFSFlat","Diode_SMD/Diode_Bridge_Vishay_MBLS","Diode_SMD/Infineon_SG-WLL-2-3_0.58x0.28_P0.36mm","Diode_SMD/Littelfuse_PolyZen-LS","Diode_SMD/Nexperia_CFP3_SOD-123W","Diode_SMD/Nexperia_DSN0603-2_0.6x0.3mm_P0.4mm","Diode_SMD/Nexperia_DSN1608-2_1.6x0.8mm","Diode_SMD/ST_D_SMC","Diode_SMD/ST_QFN-2L_1.6x1.0mm","Diode_SMD/Vishay_SMPA","Diode_THT/D_5KPW_P12.70mm_Horizontal","Diode_THT/D_5KPW_P7.62mm_Vertical_AnodeUp","Diode_THT/D_5KPW_P7.62mm_Vertical_CathodeUp","Diode_THT/D_5KP_P10.16mm_Horizontal","Diode_THT/D_5KP_P12.70mm_Horizontal","Diode_THT/D_5KP_P7.62mm_Vertical_AnodeUp","Diode_THT/D_5KP_P7.62mm_Vertical_CathodeUp","Diode_THT/D_5W_P10.16mm_Horizontal","Diode_THT/D_5W_P12.70mm_Horizontal","Diode_THT/D_5W_P5.08mm_Vertical_AnodeUp","Diode_THT/D_5W_P5.08mm_Vertical_CathodeUp","Diode_THT/D_A-405_P10.16mm_Horizontal","Diode_THT/D_A-405_P12.70mm_Horizontal","Diode_THT/D_A-405_P2.54mm_Vertical_AnodeUp","Diode_THT/D_A-405_P2.54mm_Vertical_CathodeUp","Diode_THT/D_A-405_P5.08mm_Vertical_AnodeUp","Diode_THT/D_A-405_P5.08mm_Vertical_CathodeUp","Diode_THT/D_A-405_P7.62mm_Horizontal","Diode_THT/D_DO-15_P10.16mm_Horizontal","Diode_THT/D_DO-15_P12.70mm_Horizontal","Diode_THT/D_DO-15_P15.24mm_Horizontal","Diode_THT/D_DO-15_P2.54mm_Vertical_AnodeUp","Diode_THT/D_DO-15_P2.54mm_Vertical_CathodeUp","Diode_THT/D_DO-15_P3.81mm_Vertical_AnodeUp","Diode_THT/D_DO-15_P3.81mm_Vertical_CathodeUp","Diode_THT/D_DO-15_P5.08mm_Vertical_AnodeUp","Diode_THT/D_DO-15_P5.08mm_Vertical_CathodeUp","Diode_THT/D_DO-201AD_P12.70mm_Horizontal","Diode_THT/D_DO-201AD_P15.24mm_Horizontal","Diode_THT/D_DO-201AD_P3.81mm_Vertical_AnodeUp","Diode_THT/D_DO-201AD_P3.81mm_Vertical_CathodeUp","Diode_THT/D_DO-201AD_P5.08mm_Vertical_AnodeUp","Diode_THT/D_DO-201AD_P5.08mm_Vertical_CathodeUp","Diode_THT/D_DO-201AE_P12.70mm_Horizontal","Diode_THT/D_DO-201AE_P15.24mm_Horizontal","Diode_THT/D_DO-201AE_P3.81mm_Vertical_AnodeUp","Diode_THT/D_DO-201AE_P3.81mm_Vertical_CathodeUp","Diode_THT/D_DO-201AE_P5.08mm_Vertical_AnodeUp","Diode_THT/D_DO-201AE_P5.08mm_Vertical_CathodeUp","Diode_THT/D_DO-201_P12.70mm_Horizontal","Diode_THT/D_DO-201_P15.24mm_Horizontal","Diode_THT/D_DO-201_P3.81mm_Vertical_AnodeUp","Diode_THT/D_DO-201_P3.81mm_Vertical_CathodeUp","Diode_THT/D_DO-201_P5.08mm_Vertical_AnodeUp","Diode_THT/D_DO-201_P5.08mm_Vertical_CathodeUp","Diode_THT/D_DO-247_Horizontal_TabDown","Diode_THT/D_DO-247_Horizontal_TabUp","Diode_THT/D_DO-247_Vertical","Diode_THT/D_DO-27_P12.70mm_Horizontal","Diode_THT/D_DO-27_P15.24mm_Horizontal","Diode_THT/D_DO-27_P5.08mm_Vertical_AnodeUp","Diode_THT/D_DO-27_P5.08mm_Vertical_CathodeUp","Diode_THT/D_DO-34_SOD68_P10.16mm_Horizontal","Diode_THT/D_DO-34_SOD68_P12.70mm_Horizontal","Diode_THT/D_DO-34_SOD68_P2.54mm_Vertical_AnodeUp","Diode_THT/D_DO-34_SOD68_P2.54mm_Vertical_CathodeUp","Diode_THT/D_DO-34_SOD68_P5.08mm_Vertical_AnodeUp","Diode_THT/D_DO-34_SOD68_P5.08mm_Vertical_CathodeUp","Diode_THT/D_DO-34_SOD68_P7.62mm_Horizontal","Diode_THT/D_DO-35_SOD27_P10.16mm_Horizontal","Diode_THT/D_DO-35_SOD27_P12.70mm_Horizontal","Diode_THT/D_DO-35_SOD27_P2.54mm_Vertical_AnodeUp","Diode_THT/D_DO-35_SOD27_P2.54mm_Vertical_CathodeUp","Diode_THT/D_DO-35_SOD27_P3.81mm_Vertical_AnodeUp","Diode_THT/D_DO-35_SOD27_P3.81mm_Vertical_CathodeUp","Diode_THT/D_DO-35_SOD27_P5.08mm_Vertical_AnodeUp","Diode_THT/D_DO-35_SOD27_P5.08mm_Vertical_CathodeUp","Diode_THT/D_DO-35_SOD27_P7.62mm_Horizontal","Diode_THT/D_DO-41_SOD81_P10.16mm_Horizontal","Diode_THT/D_DO-41_SOD81_P12.70mm_Horizontal","Diode_THT/D_DO-41_SOD81_P2.54mm_Vertical_AnodeUp","Diode_THT/D_DO-41_SOD81_P2.54mm_Vertical_CathodeUp","Diode_THT/D_DO-41_SOD81_P3.81mm_Vertical_AnodeUp","Diode_THT/D_DO-41_SOD81_P3.81mm_Vertical_CathodeUp","Diode_THT/D_DO-41_SOD81_P5.08mm_Vertical_AnodeUp","Diode_THT/D_DO-41_SOD81_P5.08mm_Vertical_CathodeUp","Diode_THT/D_DO-41_SOD81_P7.62mm_Horizontal","Diode_THT/D_P600_R-6_P12.70mm_Horizontal","Diode_THT/D_P600_R-6_P20.00mm_Horizontal","Diode_THT/D_P600_R-6_P7.62mm_Vertical_AnodeUp","Diode_THT/D_P600_R-6_P7.62mm_Vertical_CathodeUp","Diode_THT/D_T-1_P10.16mm_Horizontal","Diode_THT/D_T-1_P12.70mm_Horizontal","Diode_THT/D_T-1_P2.54mm_Vertical_AnodeUp","Diode_THT/D_T-1_P2.54mm_Vertical_CathodeUp","Diode_THT/D_T-1_P5.08mm_Horizontal","Diode_THT/Diode_Bridge_15.1x15.1x6.3mm_P10.9mm","Diode_THT/Diode_Bridge_15.2x15.2x6.3mm_P10.9mm","Diode_THT/Diode_Bridge_15.7x15.7x6.3mm_P10.8mm","Diode_THT/Diode_Bridge_16.7x16.7x6.3mm_P10.8mm","Diode_THT/Diode_Bridge_19.0x19.0x6.8mm_P12.7mm","Diode_THT/Diode_Bridge_19.0x3.5x10.0mm_P5.0mm","Diode_THT/Diode_Bridge_28.6x28.6x7.3mm_P18.0mm_P11.6mm","Diode_THT/Diode_Bridge_32.0x5.6x17.0mm_P10.0mm_P7.5mm","Diode_THT/Diode_Bridge_Comchip_SCVB-L","Diode_THT/Diode_Bridge_DIGITRON_KBPC_T","Diode_THT/Diode_Bridge_DIP-4_W5.08mm_P2.54mm","Diode_THT/Diode_Bridge_DIP-4_W7.62mm_P5.08mm","Diode_THT/Diode_Bridge_GeneSiC_KBPC_T","Diode_THT/Diode_Bridge_GeneSiC_KBPC_W","Diode_THT/Diode_Bridge_IXYS_GUFP","Diode_THT/Diode_Bridge_Round_D8.9mm","Diode_THT/Diode_Bridge_Round_D9.0mm","Diode_THT/Diode_Bridge_Round_D9.8mm","Diode_THT/Diode_Bridge_Vishay_GBL","Diode_THT/Diode_Bridge_Vishay_GBU","Diode_THT/Diode_Bridge_Vishay_KBL","Diode_THT/Diode_Bridge_Vishay_KBPC1","Diode_THT/Diode_Bridge_Vishay_KBPC6","Diode_THT/Diode_Bridge_Vishay_KBPM","Diode_THT/Diode_Bridge_Vishay_KBU","Display/AG12864E","Display/Adafruit_SSD1306","Display/Adafruit_SSD1306_No_Mounting_Holes","Display/CR2013-MI2120","Display/DL1416","Display/EA-eDIP128B-XXX","Display/EA_DOGL128-6","Display/EA_DOGM128-6","Display/EA_DOGS104X-A","Display/EA_DOGXL160-7","Display/EA_DOGXL160-7_Backlight","Display/EA_T123X-I2C","Display/EA_eDIP160-XXX","Display/EA_eDIP240-XXX","Display/EA_eDIP320X-XXX","Display/EA_eDIPTFT32-XXX","Display/EA_eDIPTFT43-ATC","Display/EA_eDIPTFT43-XXX","Display/EA_eDIPTFT57-XXX","Display/EA_eDIPTFT70-ATC","Display/EA_eDIPTFT70-XXX","Display/ER-OLED0.42-1W_Folded","Display/ERM19264","Display/ER_OLEDM0.91_1x-I2C","Display/HDSM-441B_HDSM-443B","Display/HDSM-541B_HDSM-543B","Display/HDSP-4830","Display/HDSP-4832","Display/HDSP-4836","Display/HDSP-4840","Display/HDSP-4850","Display/HDSP-48xx","Display/HLCP-J100","Display/HY1602E","Display/LCD-016N002L","Display/LM16255","Display/NHD-0420H1Z","Display/NHD-C0220BiZ-FSRGB","Display/NHD-C0220BiZ","Display/NHD-C12832A1Z-FSRGB","Display/Noritake_CU20025-Ux1J","Display/OLED-128O064D","Display/RC1602A","Display/WC1602A","Display_7Segment/7SEGMENT-LED__HDSM531_HDSM533_SMD","Display_7Segment/7SegmentLED_LTS6760_LTS6780","Display_7Segment/AD-121F2","Display_7Segment/AFF_2x7SEG-DIGIT_10mm","Display_7Segment/CA56-12CGKWA","Display_7Segment/CA56-12EWA","Display_7Segment/CA56-12SEKWA","Display_7Segment/CA56-12SRWA","Display_7Segment/CA56-12SURKWA","Display_7Segment/CA56-12SYKWA","Display_7Segment/CC56-12GWA","Display_7Segment/CC56-12YWA","Display_7Segment/D1X8K","Display_7Segment/DA04-11CGKWA","Display_7Segment/DA04-11SEKWA","Display_7Segment/DA04-11SURKWA","Display_7Segment/DA04-11SYKWA","Display_7Segment/DA56-11CGKWA","Display_7Segment/DA56-11SEKWA","Display_7Segment/DA56-11SURKWA","Display_7Segment/DA56-11SYKWA","Display_7Segment/DE113-XX-XX","Display_7Segment/DE114-RS-20","Display_7Segment/DE119-XX-XX","Display_7Segment/DE122-XX-XX","Display_7Segment/DE152-XX-XX","Display_7Segment/DE170-XX-XX","Display_7Segment/ELD_426XXXX","Display_7Segment/HDSP-7401","Display_7Segment/HDSP-7507","Display_7Segment/HDSP-7801","Display_7Segment/HDSP-7807","Display_7Segment/HDSP-A151","Display_7Segment/HDSP-A401","Display_7Segment/KCSC02-105","Display_7Segment/KCSC02-106","Display_7Segment/KCSC02-107","Display_7Segment/KCSC02-123","Display_7Segment/KCSC02-136","Display_7Segment/LTC-4627Jx","Display_7Segment/MAN3410A","Display_7Segment/MAN3420A","Display_7Segment/MAN3610A","Display_7Segment/MAN3620A","Display_7Segment/MAN3630A","Display_7Segment/MAN3810A","Display_7Segment/MAN3820A","Display_7Segment/MAN71A","Display_7Segment/MAN72A","Display_7Segment/MAN73A","Display_7Segment/SA15-11xxx","Display_7Segment/SBC18-11SURKCGKWA","Display_7Segment/Sx39-1xxxxx","Ferrite_THT/LairdTech_28C0236-0JW-10","Fiducial/Fiducial_0.5mm_Mask1.5mm","Fiducial/Fiducial_0.5mm_Mask1mm","Fiducial/Fiducial_0.5mm_Mask2mm","Fiducial/Fiducial_0.75mm_Mask1.5mm","Fiducial/Fiducial_0.75mm_Mask2.25mm","Fiducial/Fiducial_1.5mm_Mask3mm","Fiducial/Fiducial_1.5mm_Mask4.5mm","Fiducial/Fiducial_1mm_Mask2mm","Fiducial/Fiducial_1mm_Mask3mm","Fiducial/Fiducial_Cross_1.5mm_Mask2mm","Filter/Filter_1109-5_1.1x0.9mm","Filter/Filter_1411-5_1.4x1.1mm","Filter/Filter_Bourns_SRF0905_6.0x9.2mm","Filter/Filter_FILTERCON_1FPxx","Filter/Filter_KEMET_PZB300_24.0x12.5mm_P10.0mm","Filter/Filter_Mini-Circuits_FV1206-1","Filter/Filter_Mini-Circuits_FV1206-4","Filter/Filter_Mini-Circuits_FV1206-5","Filter/Filter_Mini-Circuits_FV1206-6","Filter/Filter_Mini-Circuits_FV1206-7","Filter/Filter_Mini-Circuits_FV1206","Filter/Filter_Murata_BNX025","Filter/Filter_Murata_BNX025_ThermalVias","Filter/Filter_Murata_SFECF-6","Filter/Filter_Murata_SFECF-6_HandSoldering","Filter/Filter_SAW-6_3.8x3.8mm","Filter/Filter_SAW-8_3.8x3.8mm","Filter/Filter_SAW_Epcos_DCC6C_3x3mm","Filter/Filter_Schaffner_FN405","Filter/Filter_Schaffner_FN406","Fuse/FuseHolder_Blade_ATO_Littelfuse_FLR_178.6165","Fuse/Fuse_0402_1005Metric","Fuse/Fuse_0402_1005Metric_Pad0.77x0.64mm_HandSolder","Fuse/Fuse_0603_1608Metric","Fuse/Fuse_0603_1608Metric_Pad1.05x0.95mm_HandSolder","Fuse/Fuse_0805_2012Metric","Fuse/Fuse_0805_2012Metric_Pad1.15x1.40mm_HandSolder","Fuse/Fuse_1206_3216Metric","Fuse/Fuse_1206_3216Metric_Pad1.42x1.75mm_HandSolder","Fuse/Fuse_1210_3225Metric","Fuse/Fuse_1210_3225Metric_Pad1.42x2.65mm_HandSolder","Fuse/Fuse_1812_4532Metric","Fuse/Fuse_1812_4532Metric_Pad1.30x3.40mm_HandSolder","Fuse/Fuse_2010_5025Metric","Fuse/Fuse_2010_5025Metric_Pad1.52x2.65mm_HandSolder","Fuse/Fuse_2512_6332Metric","Fuse/Fuse_2512_6332Metric_Pad1.52x3.35mm_HandSolder","Fuse/Fuse_2920_7451Metric","Fuse/Fuse_2920_7451Metric_Pad2.10x5.45mm_HandSolder","Fuse/Fuse_BelFuse_0ZRE0005FF_L8.3mm_W3.8mm","Fuse/Fuse_BelFuse_0ZRE0008FF_L8.3mm_W3.8mm","Fuse/Fuse_BelFuse_0ZRE0012FF_L8.3mm_W3.8mm","Fuse/Fuse_BelFuse_0ZRE0016FF_L9.9mm_W3.8mm","Fuse/Fuse_BelFuse_0ZRE0025FF_L9.6mm_W3.8mm","Fuse/Fuse_BelFuse_0ZRE0033FF_L11.4mm_W3.8mm","Fuse/Fuse_BelFuse_0ZRE0040FF_L11.5mm_W3.8mm","Fuse/Fuse_BelFuse_0ZRE0055FF_L14.0mm_W4.1mm","Fuse/Fuse_BelFuse_0ZRE0075FF_L11.5mm_W4.8mm","Fuse/Fuse_BelFuse_0ZRE0100FF_L18.7mm_W5.1mm","Fuse/Fuse_BelFuse_0ZRE0125FF_L21.2mm_W5.3mm","Fuse/Fuse_BelFuse_0ZRE0150FF_L23.4mm_W5.3mm","Fuse/Fuse_BelFuse_0ZRE0200FF_L24.9mm_W6.1mm","Fuse/Fuse_Blade_ATO_directSolder","Fuse/Fuse_Blade_Mini_directSolder","Fuse/Fuse_Bourns_MF-RG1000","Fuse/Fuse_Bourns_MF-RG1100","Fuse/Fuse_Bourns_MF-RG300","Fuse/Fuse_Bourns_MF-RG400","Fuse/Fuse_Bourns_MF-RG500","Fuse/Fuse_Bourns_MF-RG600","Fuse/Fuse_Bourns_MF-RG650","Fuse/Fuse_Bourns_MF-RG700","Fuse/Fuse_Bourns_MF-RG800","Fuse/Fuse_Bourns_MF-RG900","Fuse/Fuse_Bourns_MF-RHT050","Fuse/Fuse_Bourns_MF-RHT070","Fuse/Fuse_Bourns_MF-RHT100","Fuse/Fuse_Bourns_MF-RHT1000","Fuse/Fuse_Bourns_MF-RHT1100","Fuse/Fuse_Bourns_MF-RHT1300","Fuse/Fuse_Bourns_MF-RHT200","Fuse/Fuse_Bourns_MF-RHT300","Fuse/Fuse_Bourns_MF-RHT400","Fuse/Fuse_Bourns_MF-RHT500","Fuse/Fuse_Bourns_MF-RHT550","Fuse/Fuse_Bourns_MF-RHT600","Fuse/Fuse_Bourns_MF-RHT650","Fuse/Fuse_Bourns_MF-RHT700","Fuse/Fuse_Bourns_MF-RHT750","Fuse/Fuse_Bourns_MF-RHT800","Fuse/Fuse_Bourns_MF-RHT900","Fuse/Fuse_Bourns_MF-SM_7.98x5.44mm","Fuse/Fuse_Bourns_MF-SM_9.5x6.71mm","Fuse/Fuse_Bourns_TBU-CA","Fuse/Fuse_Littelfuse-LVR100","Fuse/Fuse_Littelfuse-LVR125","Fuse/Fuse_Littelfuse-LVR200","Fuse/Fuse_Littelfuse-NANO2-451_453","Fuse/Fuse_Littelfuse-NANO2-462","Fuse/Fuse_Littelfuse-NANO2-885","Fuse/Fuse_Littelfuse_372_D8.50mm","Fuse/Fuse_Littelfuse_395Series","Fuse/Fuse_Schurter_UMT250","Fuse/Fuse_Schurter_UMZ250","Fuse/Fuse_SunFuse-6HP","Fuse/Fuseholder_Blade_ATO_Littelfuse_Pudenz_2_Pin","Fuse/Fuseholder_Blade_Mini_Keystone_3568","Fuse/Fuseholder_Clip-5x20mm_Bel_FC-203-22_Lateral_P17.80x5.00mm_D1.17mm_Horizontal","Fuse/Fuseholder_Clip-5x20mm_Eaton_1A5601-01_Inline_P20.80x6.76mm_D1.70mm_Horizontal","Fuse/Fuseholder_Clip-5x20mm_Keystone_3512P_Inline_P23.62x7.27mm_D1.02x2.41x1.02x1.57mm_Horizontal","Fuse/Fuseholder_Clip-5x20mm_Keystone_3512_Inline_P23.62x7.27mm_D1.02x1.57mm_Horizontal","Fuse/Fuseholder_Clip-5x20mm_Keystone_3517_Inline_P23.11x6.76mm_D1.70mm_Horizontal","Fuse/Fuseholder_Clip-5x20mm_Keystone_3518P_Inline_P23.11x6.76mm_D2.44x1.70mm_Horizontal","Fuse/Fuseholder_Clip-5x20mm_Littelfuse_100_Inline_P20.50x4.60mm_D1.30mm_Horizontal","Fuse/Fuseholder_Clip-5x20mm_Littelfuse_111_Inline_P20.00x5.00mm_D1.05mm_Horizontal","Fuse/Fuseholder_Clip-5x20mm_Littelfuse_111_Lateral_P18.80x5.00mm_D1.17mm_Horizontal","Fuse/Fuseholder_Clip-5x20mm_Littelfuse_445-030_Inline_P20.50x5.20mm_D1.30mm_Horizontal","Fuse/Fuseholder_Clip-5x20mm_Littelfuse_519_Inline_P20.60x5.00mm_D1.00mm_Horizontal","Fuse/Fuseholder_Clip-5x20mm_Littelfuse_520_Inline_P20.50x5.80mm_D1.30mm_Horizontal","Fuse/Fuseholder_Clip-5x20mm_Littelfuse_521_Lateral_P17.00x5.00mm_D1.30mm_Horizontal","Fuse/Fuseholder_Clip-5x20mm_Schurter_CQM_Inline_P20.60x5.00mm_D1.00mm_Horizontal","Fuse/Fuseholder_Clip-5x20mm_Schurter_OG_Lateral_P15.00x5.00mm_D1.3mm_Horizontal","Fuse/Fuseholder_Clip-6.3x32mm_Littelfuse_102071_Inline_P34.70x7.60mm_D2.00mm_Horizontal","Fuse/Fuseholder_Clip-6.3x32mm_Littelfuse_102_122_Inline_P34.21x7.62mm_D1.98mm_Horizontal","Fuse/Fuseholder_Clip-6.3x32mm_Littelfuse_102_Inline_P34.21x7.62mm_D2.54mm_Horizontal","Fuse/Fuseholder_Clip-6.3x32mm_Littelfuse_122_Inline_P34.21x7.62mm_D2.54mm_Horizontal","Fuse/Fuseholder_Cylinder-5x20mm_Bulgin_FX0456_Vertical_Closed","Fuse/Fuseholder_Cylinder-5x20mm_Bulgin_FX0457_Horizontal_Closed","Fuse/Fuseholder_Cylinder-5x20mm_EATON_H15-V-1_Vertical_Closed","Fuse/Fuseholder_Cylinder-5x20mm_EATON_HBV_Vertical_Closed","Fuse/Fuseholder_Cylinder-5x20mm_EATON_HBW_Vertical_Closed","Fuse/Fuseholder_Cylinder-5x20mm_Schurter_0031_8201_Horizontal_Open","Fuse/Fuseholder_Cylinder-5x20mm_Schurter_FAB_0031-355x_Horizontal_Closed","Fuse/Fuseholder_Cylinder-5x20mm_Schurter_FPG4_Vertical_Closed","Fuse/Fuseholder_Cylinder-5x20mm_Schurter_FUP_0031.2510_Horizontal_Closed","Fuse/Fuseholder_Cylinder-5x20mm_Schurter_OGN-SMD_Horizontal_Open","Fuse/Fuseholder_Cylinder-5x20mm_Stelvio-Kontek_PTF78_Horizontal_Open","Fuse/Fuseholder_Cylinder-5x20mm_Wuerth_696103101002-SMD_Horizontal_Open","Fuse/Fuseholder_Cylinder-6.3x32mm_Schurter_0031-8002_Horizontal_Open","Fuse/Fuseholder_Cylinder-6.3x32mm_Schurter_FUP_0031.2520_Horizontal_Closed","Fuse/Fuseholder_Keystone_3555-2","Fuse/Fuseholder_Littelfuse_100_series_5x20mm","Fuse/Fuseholder_Littelfuse_100_series_5x25mm","Fuse/Fuseholder_Littelfuse_100_series_5x30mm","Fuse/Fuseholder_Littelfuse_445_030_series_5x20mm","Fuse/Fuseholder_Littelfuse_445_030_series_5x25mm","Fuse/Fuseholder_Littelfuse_445_030_series_5x30mm","Fuse/Fuseholder_Littelfuse_Nano2_154x","Fuse/Fuseholder_Littelfuse_Nano2_157x","Fuse/Fuseholder_TR5_Littelfuse_No560_No460","Fuse/GDT_Bourns_2038","Fuse/GDT_Yageo_3RxxxxL-6","Fuse/GDT_Yageo_3RxxxxM-6","Heatsink/Heatsink_125x35x50mm_3xFixationM3","Heatsink/Heatsink_35x26mm_1xFixation3mm_Fischer-SK486-35","Heatsink/Heatsink_38x38mm_SpringFixation","Heatsink/Heatsink_62x40mm_2xFixation3mm","Heatsink/Heatsink_AAVID_573300D00010G_TO-263","Heatsink/Heatsink_AAVID_576802B03900G","Heatsink/Heatsink_AAVID_590302B03600G","Heatsink/Heatsink_AAVID_Extruded_531002B00000G_34.9x12.7mm_H25.4mm","Heatsink/Heatsink_AAVID_Extruded_531002B02100G_34.9x12.7mm_H25.4mm","Heatsink/Heatsink_AAVID_Extruded_531002B02500G_34.9x12.7mm_H25.4mm","Heatsink/Heatsink_AAVID_Extruded_531102B00000G_34.9x12.7mm_H38.1mm","Heatsink/Heatsink_AAVID_Extruded_531102B02100G_34.9x12.7mm_H38.1mm","Heatsink/Heatsink_AAVID_Extruded_531102B02500G_34.9x12.7mm_H38.1mm","Heatsink/Heatsink_AAVID_Extruded_531102V02500G_34.9x12.7mm_H38.1mm","Heatsink/Heatsink_AAVID_Extruded_531202B00000G_34.9x12.7mm_H50.8mm","Heatsink/Heatsink_AAVID_Extruded_531202B02100G_34.9x12.7mm_H50.8mm","Heatsink/Heatsink_AAVID_Extruded_531202B02500G_34.9x12.7mm_H50.8mm","Heatsink/Heatsink_AAVID_Extruded_531302B02500G_34.9x12.7mm_H63.5mm","Heatsink/Heatsink_AAVID_TV5G_TO220_Horizontal","Heatsink/Heatsink_Fischer_FK224xx2201_25x8.3mm","Heatsink/Heatsink_Fischer_FK24413D2PAK_26x13mm","Heatsink/Heatsink_Fischer_FK24413DPAK_23x13mm","Heatsink/Heatsink_Fischer_SK104-STC-STIC_35x13mm_2xDrill2.5mm","Heatsink/Heatsink_Fischer_SK104-STCB_35x13mm__2xDrill3.5mm_ScrewM3","Heatsink/Heatsink_Fischer_SK129-STS_42x25mm_2xDrill2.5mm","Heatsink/Heatsink_SheetType_50x7mm_2Fixations","Heatsink/Heatsink_Stonecold_HS-130_30x12mm_2xFixation2.5mm","Heatsink/Heatsink_Stonecold_HS-132_32x14mm_2xFixation1.5mm","Heatsink/Heatsink_Stonecold_HS-S01_13.21x6.35mm","Heatsink/Heatsink_Stonecold_HS-S02_13.21x9.53mm","Heatsink/Heatsink_Stonecold_HS-S03_13.21x12.7mm","Inductor_SMD/L_01005_0402Metric","Inductor_SMD/L_01005_0402Metric_Pad0.57x0.30mm_HandSolder","Inductor_SMD/L_0201_0603Metric","Inductor_SMD/L_0201_0603Metric_Pad0.64x0.40mm_HandSolder","Inductor_SMD/L_0402_1005Metric","Inductor_SMD/L_0402_1005Metric_Pad0.77x0.64mm_HandSolder","Inductor_SMD/L_0603_1608Metric","Inductor_SMD/L_0603_1608Metric_Pad1.05x0.95mm_HandSolder","Inductor_SMD/L_0805_2012Metric","Inductor_SMD/L_0805_2012Metric_Pad1.05x1.20mm_HandSolder","Inductor_SMD/L_10.4x10.4_H4.8","Inductor_SMD/L_1008_2520Metric","Inductor_SMD/L_1008_2520Metric_Pad1.43x2.20mm_HandSolder","Inductor_SMD/L_1206_3216Metric","Inductor_SMD/L_1206_3216Metric_Pad1.22x1.90mm_HandSolder","Inductor_SMD/L_1210_3225Metric","Inductor_SMD/L_1210_3225Metric_Pad1.42x2.65mm_HandSolder","Inductor_SMD/L_12x12mm_H4.5mm","Inductor_SMD/L_12x12mm_H6mm","Inductor_SMD/L_12x12mm_H8mm","Inductor_SMD/L_1806_4516Metric","Inductor_SMD/L_1806_4516Metric_Pad1.45x1.90mm_HandSolder","Inductor_SMD/L_1812_4532Metric","Inductor_SMD/L_1812_4532Metric_Pad1.30x3.40mm_HandSolder","Inductor_SMD/L_2010_5025Metric","Inductor_SMD/L_2010_5025Metric_Pad1.52x2.65mm_HandSolder","Inductor_SMD/L_2512_6332Metric","Inductor_SMD/L_2512_6332Metric_Pad1.52x3.35mm_HandSolder","Inductor_SMD/L_6.3x6.3_H3","Inductor_SMD/L_7.3x7.3_H3.5","Inductor_SMD/L_7.3x7.3_H4.5","Inductor_SMD/L_APV_ANR252010","Inductor_SMD/L_APV_ANR252012","Inductor_SMD/L_APV_ANR3010","Inductor_SMD/L_APV_ANR3012","Inductor_SMD/L_APV_ANR3015","Inductor_SMD/L_APV_ANR4010","Inductor_SMD/L_APV_ANR4012","Inductor_SMD/L_APV_ANR4018","Inductor_SMD/L_APV_ANR4020","Inductor_SMD/L_APV_ANR4026","Inductor_SMD/L_APV_ANR4030","Inductor_SMD/L_APV_ANR5012","Inductor_SMD/L_APV_ANR5020","Inductor_SMD/L_APV_ANR5040","Inductor_SMD/L_APV_ANR5045","Inductor_SMD/L_APV_ANR6020","Inductor_SMD/L_APV_ANR6028","Inductor_SMD/L_APV_ANR6045","Inductor_SMD/L_APV_ANR8040","Inductor_SMD/L_APV_ANR8065","Inductor_SMD/L_APV_APH0412","Inductor_SMD/L_APV_APH0420","Inductor_SMD/L_APV_APH0518","Inductor_SMD/L_APV_APH0530","Inductor_SMD/L_APV_APH0615","Inductor_SMD/L_APV_APH0618","Inductor_SMD/L_APV_APH0620","Inductor_SMD/L_APV_APH0624","Inductor_SMD/L_APV_APH0630","Inductor_SMD/L_APV_APH0640","Inductor_SMD/L_APV_APH0650","Inductor_SMD/L_APV_APH0840","Inductor_SMD/L_APV_APH0850","Inductor_SMD/L_APV_APH1030","Inductor_SMD/L_APV_APH1040","Inductor_SMD/L_APV_APH1050","Inductor_SMD/L_APV_APH1240","Inductor_SMD/L_APV_APH1250","Inductor_SMD/L_APV_APH1260","Inductor_SMD/L_APV_APH1265","Inductor_SMD/L_APV_APH1770","Inductor_SMD/L_APV_APH2213","Inductor_SMD/L_AVX_LMLP07A7","Inductor_SMD/L_Abracon_ASPI-0425","Inductor_SMD/L_Abracon_ASPI-0630LR","Inductor_SMD/L_Abracon_ASPI-3012S","Inductor_SMD/L_Abracon_ASPI-4030S","Inductor_SMD/L_Abracon_ASPIAIG-F4020","Inductor_SMD/L_Bourns-SRN1060","Inductor_SMD/L_Bourns-SRN4018","Inductor_SMD/L_Bourns-SRN6028","Inductor_SMD/L_Bourns-SRN8040_8x8.15mm","Inductor_SMD/L_Bourns-SRR1005","Inductor_SMD/L_Bourns-SRU1028_10.0x10.0mm","Inductor_SMD/L_Bourns-SRU8028_8.0x8.0mm","Inductor_SMD/L_Bourns-SRU8043","Inductor_SMD/L_Bourns_SDR0604","Inductor_SMD/L_Bourns_SDR1806","Inductor_SMD/L_Bourns_SRF1260","Inductor_SMD/L_Bourns_SRN6045TA","Inductor_SMD/L_Bourns_SRN8040TA","Inductor_SMD/L_Bourns_SRP1038C_10.0x10.0mm","Inductor_SMD/L_Bourns_SRP1050WA","Inductor_SMD/L_Bourns_SRP1245A","Inductor_SMD/L_Bourns_SRP1770TA_16.9x16.9mm","Inductor_SMD/L_Bourns_SRP2313AA","Inductor_SMD/L_Bourns_SRP5030T","Inductor_SMD/L_Bourns_SRP6060FA","Inductor_SMD/L_Bourns_SRP7028A_7.3x6.6mm","Inductor_SMD/L_Bourns_SRR1208_12.7x12.7mm","Inductor_SMD/L_Bourns_SRR1210A","Inductor_SMD/L_Bourns_SRR1260","Inductor_SMD/L_Bourns_SRU5016_5.2x5.2mm","Inductor_SMD/L_Cenker_CKCS201610","Inductor_SMD/L_Cenker_CKCS252010","Inductor_SMD/L_Cenker_CKCS252012","Inductor_SMD/L_Cenker_CKCS3012","Inductor_SMD/L_Cenker_CKCS3015","Inductor_SMD/L_Cenker_CKCS4018","Inductor_SMD/L_Cenker_CKCS4020","Inductor_SMD/L_Cenker_CKCS4030","Inductor_SMD/L_Cenker_CKCS5020","Inductor_SMD/L_Cenker_CKCS5040","Inductor_SMD/L_Cenker_CKCS6020","Inductor_SMD/L_Cenker_CKCS6028","Inductor_SMD/L_Cenker_CKCS6045","Inductor_SMD/L_Cenker_CKCS8040","Inductor_SMD/L_Cenker_CKCS8060","Inductor_SMD/L_Cenker_CKCS8080","Inductor_SMD/L_Changjiang_FNR252010S","Inductor_SMD/L_Changjiang_FNR252012S","Inductor_SMD/L_Changjiang_FNR3010S","Inductor_SMD/L_Changjiang_FNR3012S","Inductor_SMD/L_Changjiang_FNR3015S","Inductor_SMD/L_Changjiang_FNR3021S","Inductor_SMD/L_Changjiang_FNR4010S","Inductor_SMD/L_Changjiang_FNR4012S","Inductor_SMD/L_Changjiang_FNR4015S","Inductor_SMD/L_Changjiang_FNR4018S","Inductor_SMD/L_Changjiang_FNR4020S","Inductor_SMD/L_Changjiang_FNR4026S","Inductor_SMD/L_Changjiang_FNR4030S","Inductor_SMD/L_Changjiang_FNR5012S","Inductor_SMD/L_Changjiang_FNR5015S","Inductor_SMD/L_Changjiang_FNR5020S","Inductor_SMD/L_Changjiang_FNR5030S","Inductor_SMD/L_Changjiang_FNR5040S","Inductor_SMD/L_Changjiang_FNR5045S","Inductor_SMD/L_Changjiang_FNR6020S","Inductor_SMD/L_Changjiang_FNR6028S","Inductor_SMD/L_Changjiang_FNR6040S","Inductor_SMD/L_Changjiang_FNR6045S","Inductor_SMD/L_Changjiang_FNR8040S","Inductor_SMD/L_Changjiang_FNR8050S","Inductor_SMD/L_Changjiang_FNR8065S","Inductor_SMD/L_Changjiang_FTC100765D","Inductor_SMD/L_Changjiang_FTC121065S","Inductor_SMD/L_Changjiang_FTC141207S","Inductor_SMD/L_Changjiang_FTC141208S","Inductor_SMD/L_Changjiang_FTC141265S","Inductor_SMD/L_Changjiang_FTC160808S","Inductor_SMD/L_Changjiang_FTC160865S","Inductor_SMD/L_Changjiang_FTC201208S","Inductor_SMD/L_Changjiang_FTC201210S","Inductor_SMD/L_Changjiang_FTC201212S","Inductor_SMD/L_Changjiang_FTC201265S","Inductor_SMD/L_Changjiang_FTC201607S","Inductor_SMD/L_Changjiang_FTC201608S","Inductor_SMD/L_Changjiang_FTC201610D","Inductor_SMD/L_Changjiang_FTC201610S","Inductor_SMD/L_Changjiang_FTC201612S","Inductor_SMD/L_Changjiang_FTC201655S","Inductor_SMD/L_Changjiang_FTC201665S","Inductor_SMD/L_Changjiang_FTC252008S","Inductor_SMD/L_Changjiang_FTC252010S","Inductor_SMD/L_Changjiang_FTC252012S","Inductor_SMD/L_Changjiang_FTC252075S","Inductor_SMD/L_Changjiang_FTC303010D","Inductor_SMD/L_Changjiang_FTC303012D","Inductor_SMD/L_Changjiang_FTC303015D","Inductor_SMD/L_Changjiang_FTC303018D","Inductor_SMD/L_Changjiang_FTC303020D","Inductor_SMD/L_Changjiang_FTC322510S","Inductor_SMD/L_Changjiang_FTC322512S","Inductor_SMD/L_Changjiang_FTC322520S","Inductor_SMD/L_Changjiang_FTC404010S","Inductor_SMD/L_Changjiang_FTC404012S","Inductor_SMD/L_Changjiang_FTC404020S","Inductor_SMD/L_Changjiang_FTC404030S","Inductor_SMD/L_Changjiang_FXL0412","Inductor_SMD/L_Changjiang_FXL0420","Inductor_SMD/L_Changjiang_FXL0518","Inductor_SMD/L_Changjiang_FXL0530","Inductor_SMD/L_Changjiang_FXL0615","Inductor_SMD/L_Changjiang_FXL0618","Inductor_SMD/L_Changjiang_FXL0624","Inductor_SMD/L_Changjiang_FXL0630","Inductor_SMD/L_Changjiang_FXL0640","Inductor_SMD/L_Changjiang_FXL0650","Inductor_SMD/L_Changjiang_FXL0840","Inductor_SMD/L_Changjiang_FXL1030","Inductor_SMD/L_Changjiang_FXL1040","Inductor_SMD/L_Changjiang_FXL1050","Inductor_SMD/L_Changjiang_FXL1340","Inductor_SMD/L_Changjiang_FXL1350","Inductor_SMD/L_Changjiang_FXL1360","Inductor_SMD/L_Changjiang_FXL1365","Inductor_SMD/L_Changjiang_FXL1770","Inductor_SMD/L_Changjiang_FXL2213","Inductor_SMD/L_Chilisin_BMRA00040415","Inductor_SMD/L_Chilisin_BMRA00040420","Inductor_SMD/L_Chilisin_BMRA00050520","Inductor_SMD/L_Chilisin_BMRA00050530","Inductor_SMD/L_Chilisin_BMRB00050512","Inductor_SMD/L_Chilisin_BMRB00050518-B","Inductor_SMD/L_Chilisin_BMRB00050518","Inductor_SMD/L_Chilisin_BMRB00060612","Inductor_SMD/L_Chilisin_BMRB00060618","Inductor_SMD/L_Chilisin_BMRB00060624","Inductor_SMD/L_Chilisin_BMRB00060650","Inductor_SMD/L_Chilisin_BMRF00101040","Inductor_SMD/L_Chilisin_BMRF00131350","Inductor_SMD/L_Chilisin_BMRF00131360","Inductor_SMD/L_Chilisin_BMRF00171770","Inductor_SMD/L_Chilisin_BMRG00101030","Inductor_SMD/L_Chilisin_BMRG00131360","Inductor_SMD/L_Chilisin_BMRx00040412","Inductor_SMD/L_Chilisin_BMRx00050512-B","Inductor_SMD/L_Chilisin_BMRx00050515","Inductor_SMD/L_Chilisin_BMRx00060615","Inductor_SMD/L_Chilisin_BMRx00060630","Inductor_SMD/L_Chilisin_BWVS00322515","Inductor_SMD/L_Chilisin_BWVS00404012","Inductor_SMD/L_Chilisin_BWVS00404018","Inductor_SMD/L_Chilisin_BWVS00404026","Inductor_SMD/L_Chilisin_BWVS00505020","Inductor_SMD/L_Chilisin_BWVS00505030","Inductor_SMD/L_Chilisin_BWVS00505040","Inductor_SMD/L_Chilisin_BWVS00606020","Inductor_SMD/L_Chilisin_BWVS00606028","Inductor_SMD/L_Chilisin_BWVS00606045","Inductor_SMD/L_Chilisin_BWVS00808040","Inductor_SMD/L_Coilcraft_0403HQ_1008Metric","Inductor_SMD/L_Coilcraft_0604HQ_1610Metric","Inductor_SMD/L_Coilcraft_0805HQ_2012Metric","Inductor_SMD/L_Coilcraft_1008HQ_2520Metric","Inductor_SMD/L_Coilcraft_1008HQ_2520Metric_LowProfile","Inductor_SMD/L_Coilcraft_1515SQ-47N","Inductor_SMD/L_Coilcraft_1515SQ-68N","Inductor_SMD/L_Coilcraft_1515SQ-82N","Inductor_SMD/L_Coilcraft_2222SQ-111","Inductor_SMD/L_Coilcraft_2222SQ-131","Inductor_SMD/L_Coilcraft_2222SQ-161","Inductor_SMD/L_Coilcraft_2222SQ-181","Inductor_SMD/L_Coilcraft_2222SQ-221","Inductor_SMD/L_Coilcraft_2222SQ-271","Inductor_SMD/L_Coilcraft_2222SQ-301","Inductor_SMD/L_Coilcraft_2222SQ-90N","Inductor_SMD/L_Coilcraft_2929SQ-331","Inductor_SMD/L_Coilcraft_2929SQ-361","Inductor_SMD/L_Coilcraft_2929SQ-391","Inductor_SMD/L_Coilcraft_2929SQ-431","Inductor_SMD/L_Coilcraft_2929SQ-501","Inductor_SMD/L_Coilcraft_LPS3010","Inductor_SMD/L_Coilcraft_LPS3314","Inductor_SMD/L_Coilcraft_LPS4018","Inductor_SMD/L_Coilcraft_LPS4414","Inductor_SMD/L_Coilcraft_LPS5030","Inductor_SMD/L_Coilcraft_MOS6020-XXX","Inductor_SMD/L_Coilcraft_MSS1038-XXX","Inductor_SMD/L_Coilcraft_MSS1038T-XXX","Inductor_SMD/L_Coilcraft_MSS1048-XXX","Inductor_SMD/L_Coilcraft_MSS1048T-XXX","Inductor_SMD/L_Coilcraft_MSS1210-XXX","Inductor_SMD/L_Coilcraft_MSS1210H-XXX","Inductor_SMD/L_Coilcraft_MSS1246-XXX","Inductor_SMD/L_Coilcraft_MSS1246H-XXX","Inductor_SMD/L_Coilcraft_MSS1246T-XXX","Inductor_SMD/L_Coilcraft_MSS1260-XXX","Inductor_SMD/L_Coilcraft_MSS1260H-XXX","Inductor_SMD/L_Coilcraft_MSS1260T-XXX","Inductor_SMD/L_Coilcraft_MSS1278-XXX","Inductor_SMD/L_Coilcraft_MSS1278H-XXX","Inductor_SMD/L_Coilcraft_MSS1278T-XXX","Inductor_SMD/L_Coilcraft_MSS1514V-XXX","Inductor_SMD/L_Coilcraft_MSS1583-XXX","Inductor_SMD/L_Coilcraft_MSS1812T-XXX","Inductor_SMD/L_Coilcraft_MSS7348-XXX","Inductor_SMD/L_Coilcraft_XAL1010-XXX","Inductor_SMD/L_Coilcraft_XAL1030-XXX","Inductor_SMD/L_Coilcraft_XAL1060-XXX","Inductor_SMD/L_Coilcraft_XAL1350-XXX","Inductor_SMD/L_Coilcraft_XAL1510-103","Inductor_SMD/L_Coilcraft_XAL1510-153","Inductor_SMD/L_Coilcraft_XAL1510-223","Inductor_SMD/L_Coilcraft_XAL1510-333","Inductor_SMD/L_Coilcraft_XAL1510-472","Inductor_SMD/L_Coilcraft_XAL1510-682","Inductor_SMD/L_Coilcraft_XAL1510-822","Inductor_SMD/L_Coilcraft_XAL1513-153","Inductor_SMD/L_Coilcraft_XAL1580-102","Inductor_SMD/L_Coilcraft_XAL1580-132","Inductor_SMD/L_Coilcraft_XAL1580-182","Inductor_SMD/L_Coilcraft_XAL1580-202","Inductor_SMD/L_Coilcraft_XAL1580-302","Inductor_SMD/L_Coilcraft_XAL1580-401","Inductor_SMD/L_Coilcraft_XAL1580-452","Inductor_SMD/L_Coilcraft_XAL1580-532","Inductor_SMD/L_Coilcraft_XAL1580-612","Inductor_SMD/L_Coilcraft_XAL1580-741","Inductor_SMD/L_Coilcraft_XAL4020-XXX","Inductor_SMD/L_Coilcraft_XAL4030-XXX","Inductor_SMD/L_Coilcraft_XAL4040-XXX","Inductor_SMD/L_Coilcraft_XAL5020-XXX","Inductor_SMD/L_Coilcraft_XAL5030-XXX","Inductor_SMD/L_Coilcraft_XAL5050-XXX","Inductor_SMD/L_Coilcraft_XAL6020-XXX","Inductor_SMD/L_Coilcraft_XAL6030-XXX","Inductor_SMD/L_Coilcraft_XAL6060-XXX","Inductor_SMD/L_Coilcraft_XAL7020-102","Inductor_SMD/L_Coilcraft_XAL7020-122","Inductor_SMD/L_Coilcraft_XAL7020-151","Inductor_SMD/L_Coilcraft_XAL7020-152","Inductor_SMD/L_Coilcraft_XAL7020-222","Inductor_SMD/L_Coilcraft_XAL7020-271","Inductor_SMD/L_Coilcraft_XAL7020-331","Inductor_SMD/L_Coilcraft_XAL7020-471","Inductor_SMD/L_Coilcraft_XAL7020-681","Inductor_SMD/L_Coilcraft_XAL7030-102","Inductor_SMD/L_Coilcraft_XAL7030-103","Inductor_SMD/L_Coilcraft_XAL7030-152","Inductor_SMD/L_Coilcraft_XAL7030-161","Inductor_SMD/L_Coilcraft_XAL7030-222","Inductor_SMD/L_Coilcraft_XAL7030-272","Inductor_SMD/L_Coilcraft_XAL7030-301","Inductor_SMD/L_Coilcraft_XAL7030-332","Inductor_SMD/L_Coilcraft_XAL7030-472","Inductor_SMD/L_Coilcraft_XAL7030-562","Inductor_SMD/L_Coilcraft_XAL7030-601","Inductor_SMD/L_Coilcraft_XAL7030-682","Inductor_SMD/L_Coilcraft_XAL7030-822","Inductor_SMD/L_Coilcraft_XAL7050-XXX","Inductor_SMD/L_Coilcraft_XAL7070-XXX","Inductor_SMD/L_Coilcraft_XAL8050-223","Inductor_SMD/L_Coilcraft_XAL8080-XXX","Inductor_SMD/L_Coilcraft_XFL2010","Inductor_SMD/L_Coilcraft_XxL4020","Inductor_SMD/L_Coilcraft_XxL4030","Inductor_SMD/L_Coilcraft_XxL4040","Inductor_SMD/L_CommonModeChoke_Bourns_SRF1260","Inductor_SMD/L_CommonModeChoke_Coilank_ACM1210","Inductor_SMD/L_CommonModeChoke_Coilank_ACM1608","Inductor_SMD/L_CommonModeChoke_Coilank_ACM2012","Inductor_SMD/L_CommonModeChoke_Coilank_ACM2520","Inductor_SMD/L_CommonModeChoke_Coilank_ACM3216","Inductor_SMD/L_CommonModeChoke_Coilank_ACM3225","Inductor_SMD/L_CommonModeChoke_Coilank_ACM4532","Inductor_SMD/L_CommonModeChoke_Coilcraft_0603USB","Inductor_SMD/L_CommonModeChoke_Coilcraft_0805USB","Inductor_SMD/L_CommonModeChoke_Coilcraft_1812CAN","Inductor_SMD/L_CommonModeChoke_Murata_DLW5BTMxxxSQ2x_5x5mm","Inductor_SMD/L_CommonModeChoke_TDK_ACM2520-2P","Inductor_SMD/L_CommonModeChoke_TDK_ACM2520-3P","Inductor_SMD/L_CommonModeChoke_TDK_ACM7060","Inductor_SMD/L_CommonModeChoke_Wuerth_WE-SL5-HC","Inductor_SMD/L_CommonModeChoke_Wuerth_WE-SL5","Inductor_SMD/L_CommonModeChoke_XR_XRGM0905C","Inductor_SMD/L_CommonMode_Bourns_DR331","Inductor_SMD/L_CommonMode_Delevan_4222","Inductor_SMD/L_CommonMode_Wuerth_WE-SL2","Inductor_SMD/L_CommonMode_Wurth_WE-CNSW-1206","Inductor_SMD/L_Eaton_MCL2012V1","Inductor_SMD/L_Fastron_PISN","Inductor_SMD/L_Fastron_PISN_Handsoldering","Inductor_SMD/L_Fastron_PISR","Inductor_SMD/L_Fastron_PISR_Handsoldering","Inductor_SMD/L_Ferrocore_DLG-0302","Inductor_SMD/L_Ferrocore_DLG-0403","Inductor_SMD/L_Ferrocore_DLG-0504","Inductor_SMD/L_Ferrocore_DLG-0703","Inductor_SMD/L_Ferrocore_DLG-0705","Inductor_SMD/L_Ferrocore_DLG-1004","Inductor_SMD/L_Ferrocore_DLG-1005","Inductor_SMD/L_KOHERelec_MDA5030","Inductor_SMD/L_KOHERelec_MDA7030","Inductor_SMD/L_Murata_DEM3512C","Inductor_SMD/L_Murata_DEM3518C","Inductor_SMD/L_Murata_DFE201610P","Inductor_SMD/L_Murata_LQH2MCNxxxx02_2.0x1.6mm","Inductor_SMD/L_Murata_LQH55DN_5.7x5.0mm","Inductor_SMD/L_Neosid_Air-Coil_SML_1turn_HDM0131A","Inductor_SMD/L_Neosid_Air-Coil_SML_2turn_HAM0231A","Inductor_SMD/L_Neosid_Air-Coil_SML_2turn_HDM0231A","Inductor_SMD/L_Neosid_Air-Coil_SML_3turn_HAM0331A","Inductor_SMD/L_Neosid_Air-Coil_SML_3turn_HDM0331A","Inductor_SMD/L_Neosid_Air-Coil_SML_4turn_HAM0431A","Inductor_SMD/L_Neosid_Air-Coil_SML_4turn_HDM0431A","Inductor_SMD/L_Neosid_Air-Coil_SML_5turn_HAM0531A","Inductor_SMD/L_Neosid_Air-Coil_SML_5turn_HDM0531A","Inductor_SMD/L_Neosid_Air-Coil_SML_6-10turn_HAM0631A-HAM1031A","Inductor_SMD/L_Neosid_Air-Coil_SML_6-10turn_HDM0431A-HDM1031A","Inductor_SMD/L_Neosid_Air-Coil_SML_6turn_HAM0631A","Inductor_SMD/L_Neosid_MicroCoil_Ms36-L","Inductor_SMD/L_Neosid_Ms42","Inductor_SMD/L_Neosid_Ms50","Inductor_SMD/L_Neosid_Ms50T","Inductor_SMD/L_Neosid_Ms85","Inductor_SMD/L_Neosid_Ms85T","Inductor_SMD/L_Neosid_Ms95","Inductor_SMD/L_Neosid_Ms95T","Inductor_SMD/L_Neosid_Ms95a","Inductor_SMD/L_Neosid_SM-NE127","Inductor_SMD/L_Neosid_SM-NE127_HandSoldering","Inductor_SMD/L_Neosid_SM-NE150","Inductor_SMD/L_Neosid_SM-NE95H","Inductor_SMD/L_Neosid_SM-PIC0512H","Inductor_SMD/L_Neosid_SM-PIC0602H","Inductor_SMD/L_Neosid_SM-PIC0612H","Inductor_SMD/L_Neosid_SM-PIC1004H","Inductor_SMD/L_Neosid_SMS-ME3010","Inductor_SMD/L_Neosid_SMS-ME3015","Inductor_SMD/L_Neosid_SMs42","Inductor_SMD/L_Neosid_SMs50","Inductor_SMD/L_Neosid_SMs85","Inductor_SMD/L_Neosid_SMs95_SMs95p","Inductor_SMD/L_Panasonic_PCC-M0530M","Inductor_SMD/L_Panasonic_PCC-M0540M","Inductor_SMD/L_Panasonic_PCC-M0630M","Inductor_SMD/L_Panasonic_PCC-M0645M","Inductor_SMD/L_Panasonic_PCC-M0750M","Inductor_SMD/L_Panasonic_PCC-M0754M","Inductor_SMD/L_Panasonic_PCC-M0850M","Inductor_SMD/L_Panasonic_PCC-M0854M","Inductor_SMD/L_Panasonic_PCC-M1040ML","Inductor_SMD/L_Panasonic_PCC-M1050M","Inductor_SMD/L_Panasonic_PCC-M1050ML","Inductor_SMD/L_Panasonic_PCC-M1054M","Inductor_SMD/L_Panasonic_PCC-M1060ML","Inductor_SMD/L_Pulse_P059x","Inductor_SMD/L_Pulse_PA4320","Inductor_SMD/L_Pulse_PA4332","Inductor_SMD/L_Pulse_PA4334","Inductor_SMD/L_Pulse_PA4340","Inductor_SMD/L_Pulse_PA4341","Inductor_SMD/L_Pulse_PA4344","Inductor_SMD/L_Pulse_PA4349","Inductor_SMD/L_Pulse_PA5402","Inductor_SMD/L_SOREDE_SNR.1050_10x10x5mm","Inductor_SMD/L_SXN_SMDRI124","Inductor_SMD/L_SXN_SMDRI125","Inductor_SMD/L_SXN_SMDRI127","Inductor_SMD/L_SXN_SMDRI62","Inductor_SMD/L_SXN_SMDRI64","Inductor_SMD/L_SXN_SMDRI73","Inductor_SMD/L_SXN_SMDRI74","Inductor_SMD/L_SXN_SMMS1770","Inductor_SMD/L_Sagami_CER1242B","Inductor_SMD/L_Sagami_CER1257B","Inductor_SMD/L_Sagami_CER1277B","Inductor_SMD/L_Sagami_CWR1242C","Inductor_SMD/L_Sagami_CWR1257C","Inductor_SMD/L_Sagami_CWR1277C","Inductor_SMD/L_SigTra_SC3316F","Inductor_SMD/L_Sumida_CDMC6D28_7.25x6.5mm","Inductor_SMD/L_Sumida_CR75","Inductor_SMD/L_Sunlord_MWSA0402S","Inductor_SMD/L_Sunlord_MWSA0412S","Inductor_SMD/L_Sunlord_MWSA0503S","Inductor_SMD/L_Sunlord_MWSA0518S","Inductor_SMD/L_Sunlord_MWSA0602S","Inductor_SMD/L_Sunlord_MWSA0603S","Inductor_SMD/L_Sunlord_MWSA0604S","Inductor_SMD/L_Sunlord_MWSA0605S","Inductor_SMD/L_Sunlord_MWSA0615S","Inductor_SMD/L_Sunlord_MWSA0618S","Inductor_SMD/L_Sunlord_MWSA0624S","Inductor_SMD/L_Sunlord_MWSA0804S","Inductor_SMD/L_Sunlord_MWSA1003S","Inductor_SMD/L_Sunlord_MWSA1004S","Inductor_SMD/L_Sunlord_MWSA1005S","Inductor_SMD/L_Sunlord_MWSA1204S-100","Inductor_SMD/L_Sunlord_MWSA1204S-150","Inductor_SMD/L_Sunlord_MWSA1204S-1R0","Inductor_SMD/L_Sunlord_MWSA1204S-1R5","Inductor_SMD/L_Sunlord_MWSA1204S-220","Inductor_SMD/L_Sunlord_MWSA1204S-2R2","Inductor_SMD/L_Sunlord_MWSA1204S-3R3","Inductor_SMD/L_Sunlord_MWSA1204S-4R7","Inductor_SMD/L_Sunlord_MWSA1204S-6R8","Inductor_SMD/L_Sunlord_MWSA1204S-R22","Inductor_SMD/L_Sunlord_MWSA1204S-R47","Inductor_SMD/L_Sunlord_MWSA1204S-R68","Inductor_SMD/L_Sunlord_MWSA1204S-R82","Inductor_SMD/L_Sunlord_MWSA1205S-100","Inductor_SMD/L_Sunlord_MWSA1205S-150","Inductor_SMD/L_Sunlord_MWSA1205S-1R0","Inductor_SMD/L_Sunlord_MWSA1205S-1R5","Inductor_SMD/L_Sunlord_MWSA1205S-220","Inductor_SMD/L_Sunlord_MWSA1205S-2R2","Inductor_SMD/L_Sunlord_MWSA1205S-330","Inductor_SMD/L_Sunlord_MWSA1205S-3R3","Inductor_SMD/L_Sunlord_MWSA1205S-470","Inductor_SMD/L_Sunlord_MWSA1205S-4R7","Inductor_SMD/L_Sunlord_MWSA1205S-6R8","Inductor_SMD/L_Sunlord_MWSA1205S-R22","Inductor_SMD/L_Sunlord_MWSA1205S-R36","Inductor_SMD/L_Sunlord_MWSA1205S-R50","Inductor_SMD/L_Sunlord_MWSA1205S-R68","Inductor_SMD/L_Sunlord_MWSA1205S-R82","Inductor_SMD/L_Sunlord_MWSA1206S-100","Inductor_SMD/L_Sunlord_MWSA1206S-101","Inductor_SMD/L_Sunlord_MWSA1206S-120","Inductor_SMD/L_Sunlord_MWSA1206S-121","Inductor_SMD/L_Sunlord_MWSA1206S-150","Inductor_SMD/L_Sunlord_MWSA1206S-151","Inductor_SMD/L_Sunlord_MWSA1206S-180","Inductor_SMD/L_Sunlord_MWSA1206S-1R5","Inductor_SMD/L_Sunlord_MWSA1206S-220","Inductor_SMD/L_Sunlord_MWSA1206S-270","Inductor_SMD/L_Sunlord_MWSA1206S-2R2","Inductor_SMD/L_Sunlord_MWSA1206S-330","Inductor_SMD/L_Sunlord_MWSA1206S-3R3","Inductor_SMD/L_Sunlord_MWSA1206S-470","Inductor_SMD/L_Sunlord_MWSA1206S-4R7","Inductor_SMD/L_Sunlord_MWSA1206S-5R6","Inductor_SMD/L_Sunlord_MWSA1206S-680","Inductor_SMD/L_Sunlord_MWSA1206S-6R8","Inductor_SMD/L_Sunlord_MWSA1206S-8R2","Inductor_SMD/L_Sunlord_MWSA1206S-R68","Inductor_SMD/L_Sunlord_MWSA1265S","Inductor_SMD/L_Sunlord_MWSA1707S","Inductor_SMD/L_Sunlord_MWSA2213S","Inductor_SMD/L_Sunlord_SWPA252010S","Inductor_SMD/L_Sunlord_SWPA252012S","Inductor_SMD/L_Sunlord_SWPA3010S","Inductor_SMD/L_Sunlord_SWPA3012S","Inductor_SMD/L_Sunlord_SWPA3015S","Inductor_SMD/L_Sunlord_SWPA4010S","Inductor_SMD/L_Sunlord_SWPA4012S","Inductor_SMD/L_Sunlord_SWPA4018S","Inductor_SMD/L_Sunlord_SWPA4020S","Inductor_SMD/L_Sunlord_SWPA4026S","Inductor_SMD/L_Sunlord_SWPA4030S","Inductor_SMD/L_Sunlord_SWPA5012S","Inductor_SMD/L_Sunlord_SWPA5020S","Inductor_SMD/L_Sunlord_SWPA5040S","Inductor_SMD/L_Sunlord_SWPA6020S","Inductor_SMD/L_Sunlord_SWPA6028S","Inductor_SMD/L_Sunlord_SWPA6040S","Inductor_SMD/L_Sunlord_SWPA6045S","Inductor_SMD/L_Sunlord_SWPA8040S","Inductor_SMD/L_Sunlord_SWRB1204S","Inductor_SMD/L_Sunlord_SWRB1205S","Inductor_SMD/L_Sunlord_SWRB1207S","Inductor_SMD/L_TDK_MLZ1608","Inductor_SMD/L_TDK_MLZ2012_h0.85mm","Inductor_SMD/L_TDK_MLZ2012_h1.25mm","Inductor_SMD/L_TDK_NLV25_2.5x2.0mm","Inductor_SMD/L_TDK_NLV32_3.2x2.5mm","Inductor_SMD/L_TDK_SLF10145","Inductor_SMD/L_TDK_SLF10165","Inductor_SMD/L_TDK_SLF12555","Inductor_SMD/L_TDK_SLF12565","Inductor_SMD/L_TDK_SLF12575","Inductor_SMD/L_TDK_SLF6025","Inductor_SMD/L_TDK_SLF6028","Inductor_SMD/L_TDK_SLF6045","Inductor_SMD/L_TDK_SLF7032","Inductor_SMD/L_TDK_SLF7045","Inductor_SMD/L_TDK_SLF7055","Inductor_SMD/L_TDK_VLF10040","Inductor_SMD/L_TDK_VLP8040","Inductor_SMD/L_TDK_VLS6045EX_VLS6045AF","Inductor_SMD/L_TaiTech_TMPC1265_13.5x12.5mm","Inductor_SMD/L_Taiyo-Yuden_BK_Array_1206_3216Metric","Inductor_SMD/L_Taiyo-Yuden_MD-1616","Inductor_SMD/L_Taiyo-Yuden_MD-2020","Inductor_SMD/L_Taiyo-Yuden_MD-3030","Inductor_SMD/L_Taiyo-Yuden_MD-4040","Inductor_SMD/L_Taiyo-Yuden_MD-5050","Inductor_SMD/L_Taiyo-Yuden_NR-10050_9.8x10.0mm","Inductor_SMD/L_Taiyo-Yuden_NR-10050_9.8x10.0mm_HandSoldering","Inductor_SMD/L_Taiyo-Yuden_NR-20xx","Inductor_SMD/L_Taiyo-Yuden_NR-20xx_HandSoldering","Inductor_SMD/L_Taiyo-Yuden_NR-24xx","Inductor_SMD/L_Taiyo-Yuden_NR-24xx_HandSoldering","Inductor_SMD/L_Taiyo-Yuden_NR-30xx","Inductor_SMD/L_Taiyo-Yuden_NR-30xx_HandSoldering","Inductor_SMD/L_Taiyo-Yuden_NR-40xx","Inductor_SMD/L_Taiyo-Yuden_NR-40xx_HandSoldering","Inductor_SMD/L_Taiyo-Yuden_NR-50xx","Inductor_SMD/L_Taiyo-Yuden_NR-50xx_HandSoldering","Inductor_SMD/L_Taiyo-Yuden_NR-60xx","Inductor_SMD/L_Taiyo-Yuden_NR-60xx_HandSoldering","Inductor_SMD/L_Taiyo-Yuden_NR-80xx","Inductor_SMD/L_Taiyo-Yuden_NR-80xx_HandSoldering","Inductor_SMD/L_TechFuse_SL0420","Inductor_SMD/L_TechFuse_SL0520","Inductor_SMD/L_TechFuse_SL0530","Inductor_SMD/L_TechFuse_SL0620","Inductor_SMD/L_TechFuse_SL0624","Inductor_SMD/L_TechFuse_SL0630","Inductor_SMD/L_TechFuse_SL0650","Inductor_SMD/L_TechFuse_SL1040","Inductor_SMD/L_TechFuse_SL1050","Inductor_SMD/L_TechFuse_SL1250","Inductor_SMD/L_TechFuse_SL1265","Inductor_SMD/L_TracoPower_TCK-047_5.2x5.8mm","Inductor_SMD/L_TracoPower_TCK-141","Inductor_SMD/L_Vishay_IFSC-1515AH_4x4x1.8mm","Inductor_SMD/L_Vishay_IHLP-1212","Inductor_SMD/L_Vishay_IHLP-1616","Inductor_SMD/L_Vishay_IHLP-2020","Inductor_SMD/L_Vishay_IHLP-2525","Inductor_SMD/L_Vishay_IHLP-3232","Inductor_SMD/L_Vishay_IHLP-4040","Inductor_SMD/L_Vishay_IHLP-5050","Inductor_SMD/L_Vishay_IHLP-6767","Inductor_SMD/L_Vishay_IHSM-3825","Inductor_SMD/L_Vishay_IHSM-4825","Inductor_SMD/L_Vishay_IHSM-5832","Inductor_SMD/L_Vishay_IHSM-7832","Inductor_SMD/L_Walsin_WLFM201209x","Inductor_SMD/L_Walsin_WLFM201609x","Inductor_SMD/L_Walsin_WLFM252009x","Inductor_SMD/L_Wuerth_HCF-2013","Inductor_SMD/L_Wuerth_HCF-2815","Inductor_SMD/L_Wuerth_HCF-2818","Inductor_SMD/L_Wuerth_HCI-1030","Inductor_SMD/L_Wuerth_HCI-1040","Inductor_SMD/L_Wuerth_HCI-1050","Inductor_SMD/L_Wuerth_HCI-1335","Inductor_SMD/L_Wuerth_HCI-1350","Inductor_SMD/L_Wuerth_HCI-1365","Inductor_SMD/L_Wuerth_HCI-1890","Inductor_SMD/L_Wuerth_HCI-2212","Inductor_SMD/L_Wuerth_HCI-5040","Inductor_SMD/L_Wuerth_HCI-7030","Inductor_SMD/L_Wuerth_HCI-7040","Inductor_SMD/L_Wuerth_HCI-7050","Inductor_SMD/L_Wuerth_HCM-1050","Inductor_SMD/L_Wuerth_HCM-1052","Inductor_SMD/L_Wuerth_HCM-1070","Inductor_SMD/L_Wuerth_HCM-1078","Inductor_SMD/L_Wuerth_HCM-1190","Inductor_SMD/L_Wuerth_HCM-1240","Inductor_SMD/L_Wuerth_HCM-1350","Inductor_SMD/L_Wuerth_HCM-1390","Inductor_SMD/L_Wuerth_HCM-7050","Inductor_SMD/L_Wuerth_HCM-7070","Inductor_SMD/L_Wuerth_LQFS-3818","Inductor_SMD/L_Wuerth_LQFS-4818","Inductor_SMD/L_Wuerth_LQFS-4828","Inductor_SMD/L_Wuerth_MAPI-1610","Inductor_SMD/L_Wuerth_MAPI-2010","Inductor_SMD/L_Wuerth_MAPI-2506","Inductor_SMD/L_Wuerth_MAPI-2508","Inductor_SMD/L_Wuerth_MAPI-2510","Inductor_SMD/L_Wuerth_MAPI-2512","Inductor_SMD/L_Wuerth_MAPI-3010","Inductor_SMD/L_Wuerth_MAPI-3012","Inductor_SMD/L_Wuerth_MAPI-3015","Inductor_SMD/L_Wuerth_MAPI-3020","Inductor_SMD/L_Wuerth_MAPI-4020","Inductor_SMD/L_Wuerth_MAPI-4030","Inductor_SMD/L_Wuerth_MAPI-5020","Inductor_SMD/L_Wuerth_MAPI-5030","Inductor_SMD/L_Wuerth_PMCI-160808","Inductor_SMD/L_Wuerth_PMCI-201210","Inductor_SMD/L_Wuerth_PMCI-201610","Inductor_SMD/L_Wuerth_PMCI-252010","Inductor_SMD/L_Wuerth_PMCI-252012","Inductor_SMD/L_Wuerth_PMCI-322510","Inductor_SMD/L_Wuerth_PMCI-322512","Inductor_SMD/L_Wuerth_PMCI-322515","Inductor_SMD/L_Wuerth_PMFI-201610","Inductor_SMD/L_Wuerth_PMFI-201610_PMCI-compatible","Inductor_SMD/L_Wuerth_PMFI-252012","Inductor_SMD/L_Wuerth_PMFI-252012_PMCI-compatible","Inductor_SMD/L_Wuerth_PMFI-322512","Inductor_SMD/L_Wuerth_PMFI-322512_PMCI-compatible","Inductor_SMD/L_Wuerth_PMFI-353220","Inductor_SMD/L_Wuerth_WE-DD-Typ-L-Typ-XL-Typ-XXL","Inductor_SMD/L_Wuerth_WE-DD-Typ-M-Typ-S","Inductor_SMD/L_Wuerth_WE-GF-1210","Inductor_SMD/L_Wuerth_WE-PD-Typ-7345","Inductor_SMD/L_Wuerth_WE-PD-Typ-LS","Inductor_SMD/L_Wuerth_WE-PD-Typ-LS_Handsoldering","Inductor_SMD/L_Wuerth_WE-PD-Typ-M-Typ-S","Inductor_SMD/L_Wuerth_WE-PD-Typ-M-Typ-S_Handsoldering","Inductor_SMD/L_Wuerth_WE-PD2-Typ-L","Inductor_SMD/L_Wuerth_WE-PD2-Typ-MS","Inductor_SMD/L_Wuerth_WE-PD2-Typ-XL","Inductor_SMD/L_Wuerth_WE-PD4-Typ-X","Inductor_SMD/L_Wuerth_WE-PDF","Inductor_SMD/L_Wuerth_WE-PDF_Handsoldering","Inductor_SMD/L_Wuerth_WE-TPC-3816","Inductor_SMD/L_Wuerth_XHMI-6060","Inductor_SMD/L_Wuerth_XHMI-8080","Inductor_SMD/L_Wurth_WE-CAIR-5910","Inductor_SMD_Wurth/L_Wurth_WE-LQSH-2010","Inductor_SMD_Wurth/L_Wurth_WE-LQSH-2512","Inductor_SMD_Wurth/L_Wurth_WE-LQSH-3012","Inductor_SMD_Wurth/L_Wurth_WE-LQSH-4020","Inductor_THT/Choke_EPCOS_B82722A","Inductor_THT/Choke_Schaffner_RN102-04-14.0x14.0mm","Inductor_THT/Choke_Schaffner_RN112-04-17.7x17.1mm","Inductor_THT/Choke_Schaffner_RN114-04-22.5x21.5mm","Inductor_THT/Choke_Schaffner_RN116-04-22.5x21.5mm","Inductor_THT/Choke_Schaffner_RN122-04-28.0x27.0mm","Inductor_THT/Choke_Schaffner_RN142-04-33.1x32.5mm","Inductor_THT/Choke_Schaffner_RN143-04-33.1x32.5mm","Inductor_THT/Choke_Schaffner_RN152-04-43.0x41.8mm","Inductor_THT/Choke_Schaffner_RN202-04-8.8x18.2mm","Inductor_THT/Choke_Schaffner_RN204-04-9.0x14.0mm","Inductor_THT/Choke_Schaffner_RN212-04-12.5x18.0mm","Inductor_THT/Choke_Schaffner_RN214-04-15.5x23.0mm","Inductor_THT/Choke_Schaffner_RN216-04-15.5x23.0mm","Inductor_THT/Choke_Schaffner_RN218-04-12.5x18.0mm","Inductor_THT/Choke_Schaffner_RN222-04-18.0x31.0mm","Inductor_THT/Choke_Schaffner_RN232-04-18.0x31.0mm","Inductor_THT/Choke_Schaffner_RN242-04-18.0x31.0mm","Inductor_THT/L_Axial_L11.0mm_D4.5mm_P15.24mm_Horizontal_Fastron_MECC","Inductor_THT/L_Axial_L11.0mm_D4.5mm_P5.08mm_Vertical_Fastron_MECC","Inductor_THT/L_Axial_L11.0mm_D4.5mm_P7.62mm_Vertical_Fastron_MECC","Inductor_THT/L_Axial_L12.0mm_D5.0mm_P15.24mm_Horizontal_Fastron_MISC","Inductor_THT/L_Axial_L12.0mm_D5.0mm_P5.08mm_Vertical_Fastron_MISC","Inductor_THT/L_Axial_L12.0mm_D5.0mm_P7.62mm_Vertical_Fastron_MISC","Inductor_THT/L_Axial_L12.8mm_D5.8mm_P20.32mm_Horizontal_Fastron_HBCC","Inductor_THT/L_Axial_L12.8mm_D5.8mm_P25.40mm_Horizontal_Fastron_HBCC","Inductor_THT/L_Axial_L12.8mm_D5.8mm_P5.08mm_Vertical_Fastron_HBCC","Inductor_THT/L_Axial_L12.8mm_D5.8mm_P7.62mm_Vertical_Fastron_HBCC","Inductor_THT/L_Axial_L13.0mm_D4.5mm_P15.24mm_Horizontal_Fastron_HCCC","Inductor_THT/L_Axial_L13.0mm_D4.5mm_P5.08mm_Vertical_Fastron_HCCC","Inductor_THT/L_Axial_L13.0mm_D4.5mm_P7.62mm_Vertical_Fastron_HCCC","Inductor_THT/L_Axial_L14.0mm_D4.5mm_P15.24mm_Horizontal_Fastron_LACC","Inductor_THT/L_Axial_L14.0mm_D4.5mm_P5.08mm_Vertical_Fastron_LACC","Inductor_THT/L_Axial_L14.0mm_D4.5mm_P7.62mm_Vertical_Fastron_LACC","Inductor_THT/L_Axial_L14.5mm_D5.8mm_P20.32mm_Horizontal_Fastron_HBCC","Inductor_THT/L_Axial_L14.5mm_D5.8mm_P25.40mm_Horizontal_Fastron_HBCC","Inductor_THT/L_Axial_L14.5mm_D5.8mm_P5.08mm_Vertical_Fastron_HBCC","Inductor_THT/L_Axial_L14.5mm_D5.8mm_P7.62mm_Vertical_Fastron_HBCC","Inductor_THT/L_Axial_L16.0mm_D6.3mm_P20.32mm_Horizontal_Fastron_VHBCC","Inductor_THT/L_Axial_L16.0mm_D6.3mm_P25.40mm_Horizontal_Fastron_VHBCC","Inductor_THT/L_Axial_L16.0mm_D6.3mm_P5.08mm_Vertical_Fastron_VHBCC","Inductor_THT/L_Axial_L16.0mm_D6.3mm_P7.62mm_Vertical_Fastron_VHBCC","Inductor_THT/L_Axial_L16.0mm_D7.5mm_P20.32mm_Horizontal_Fastron_XHBCC","Inductor_THT/L_Axial_L16.0mm_D7.5mm_P25.40mm_Horizontal_Fastron_XHBCC","Inductor_THT/L_Axial_L16.0mm_D7.5mm_P5.08mm_Vertical_Fastron_XHBCC","Inductor_THT/L_Axial_L16.0mm_D7.5mm_P7.62mm_Vertical_Fastron_XHBCC","Inductor_THT/L_Axial_L16.0mm_D9.5mm_P20.32mm_Horizontal_Vishay_IM-10-37","Inductor_THT/L_Axial_L16.0mm_D9.5mm_P5.08mm_Vertical_Vishay_IM-10-37","Inductor_THT/L_Axial_L17.5mm_D12.0mm_P20.32mm_Horizontal_Vishay_IM-10-46","Inductor_THT/L_Axial_L17.5mm_D12.0mm_P7.62mm_Vertical_Vishay_IM-10-46","Inductor_THT/L_Axial_L20.0mm_D8.0mm_P25.40mm_Horizontal","Inductor_THT/L_Axial_L20.0mm_D8.0mm_P5.08mm_Vertical","Inductor_THT/L_Axial_L20.0mm_D8.0mm_P7.62mm_Vertical","Inductor_THT/L_Axial_L20.3mm_D12.1mm_P28.50mm_Horizontal_Vishay_IHA-101","Inductor_THT/L_Axial_L20.3mm_D12.1mm_P7.62mm_Vertical_Vishay_IHA-101","Inductor_THT/L_Axial_L20.3mm_D12.7mm_P25.40mm_Horizontal_Vishay_IHA-201","Inductor_THT/L_Axial_L20.3mm_D12.7mm_P7.62mm_Vertical_Vishay_IHA-201","Inductor_THT/L_Axial_L23.4mm_D12.7mm_P32.00mm_Horizontal_Vishay_IHA-203","Inductor_THT/L_Axial_L23.4mm_D12.7mm_P7.62mm_Vertical_Vishay_IHA-203","Inductor_THT/L_Axial_L24.0mm_D7.1mm_P30.48mm_Horizontal_Vishay_IM-10-28","Inductor_THT/L_Axial_L24.0mm_D7.1mm_P5.08mm_Vertical_Vishay_IM-10-28","Inductor_THT/L_Axial_L24.0mm_D7.5mm_P27.94mm_Horizontal_Fastron_MESC","Inductor_THT/L_Axial_L24.0mm_D7.5mm_P5.08mm_Vertical_Fastron_MESC","Inductor_THT/L_Axial_L24.0mm_D7.5mm_P7.62mm_Vertical_Fastron_MESC","Inductor_THT/L_Axial_L26.0mm_D10.0mm_P30.48mm_Horizontal_Fastron_77A","Inductor_THT/L_Axial_L26.0mm_D10.0mm_P5.08mm_Vertical_Fastron_77A","Inductor_THT/L_Axial_L26.0mm_D10.0mm_P7.62mm_Vertical_Fastron_77A","Inductor_THT/L_Axial_L26.0mm_D11.0mm_P30.48mm_Horizontal_Fastron_77A","Inductor_THT/L_Axial_L26.0mm_D11.0mm_P5.08mm_Vertical_Fastron_77A","Inductor_THT/L_Axial_L26.0mm_D11.0mm_P7.62mm_Vertical_Fastron_77A","Inductor_THT/L_Axial_L26.0mm_D9.0mm_P30.48mm_Horizontal_Fastron_77A","Inductor_THT/L_Axial_L26.0mm_D9.0mm_P5.08mm_Vertical_Fastron_77A","Inductor_THT/L_Axial_L26.0mm_D9.0mm_P7.62mm_Vertical_Fastron_77A","Inductor_THT/L_Axial_L26.7mm_D12.1mm_P35.00mm_Horizontal_Vishay_IHA-103","Inductor_THT/L_Axial_L26.7mm_D12.1mm_P7.62mm_Vertical_Vishay_IHA-103","Inductor_THT/L_Axial_L26.7mm_D14.0mm_P35.00mm_Horizontal_Vishay_IHA-104","Inductor_THT/L_Axial_L26.7mm_D14.0mm_P7.62mm_Vertical_Vishay_IHA-104","Inductor_THT/L_Axial_L29.9mm_D14.0mm_P38.00mm_Horizontal_Vishay_IHA-105","Inductor_THT/L_Axial_L29.9mm_D14.0mm_P7.62mm_Vertical_Vishay_IHA-105","Inductor_THT/L_Axial_L30.0mm_D8.0mm_P35.56mm_Horizontal_Fastron_77A","Inductor_THT/L_Axial_L30.0mm_D8.0mm_P5.08mm_Vertical_Fastron_77A","Inductor_THT/L_Axial_L30.0mm_D8.0mm_P7.62mm_Vertical_Fastron_77A","Inductor_THT/L_Axial_L5.0mm_D3.6mm_P10.00mm_Horizontal_Murata_BL01RN1A2A2","Inductor_THT/L_Axial_L5.3mm_D2.2mm_P10.16mm_Horizontal_Vishay_IM-1","Inductor_THT/L_Axial_L5.3mm_D2.2mm_P2.54mm_Vertical_Vishay_IM-1","Inductor_THT/L_Axial_L5.3mm_D2.2mm_P7.62mm_Horizontal_Vishay_IM-1","Inductor_THT/L_Axial_L6.6mm_D2.7mm_P10.16mm_Horizontal_Vishay_IM-2","Inductor_THT/L_Axial_L6.6mm_D2.7mm_P2.54mm_Vertical_Vishay_IM-2","Inductor_THT/L_Axial_L7.0mm_D3.3mm_P10.16mm_Horizontal_Fastron_MICC","Inductor_THT/L_Axial_L7.0mm_D3.3mm_P12.70mm_Horizontal_Fastron_MICC","Inductor_THT/L_Axial_L7.0mm_D3.3mm_P2.54mm_Vertical_Fastron_MICC","Inductor_THT/L_Axial_L7.0mm_D3.3mm_P5.08mm_Vertical_Fastron_MICC","Inductor_THT/L_Axial_L9.5mm_D4.0mm_P12.70mm_Horizontal_Fastron_SMCC","Inductor_THT/L_Axial_L9.5mm_D4.0mm_P15.24mm_Horizontal_Fastron_SMCC","Inductor_THT/L_Axial_L9.5mm_D4.0mm_P2.54mm_Vertical_Fastron_SMCC","Inductor_THT/L_Axial_L9.5mm_D4.0mm_P5.08mm_Vertical_Fastron_SMCC","Inductor_THT/L_CommonMode_PulseElectronics_PH9455x105NL_1","Inductor_THT/L_CommonMode_PulseElectronics_PH9455x155NL_1","Inductor_THT/L_CommonMode_PulseElectronics_PH9455x205NL_1","Inductor_THT/L_CommonMode_PulseElectronics_PH9455x405NL_1","Inductor_THT/L_CommonMode_PulseElectronics_PH9455x705NL_1","Inductor_THT/L_CommonMode_PulseElectronics_PH9455xxx6NL_2","Inductor_THT/L_CommonMode_TDK_B82746S4143A040","Inductor_THT/L_CommonMode_TDK_B82746S6702A040","Inductor_THT/L_CommonMode_TDK_B82747E6163A040","Inductor_THT/L_CommonMode_TDK_B82747E6203A040","Inductor_THT/L_CommonMode_TDK_B82747E6253A040","Inductor_THT/L_CommonMode_TDK_B82747E6353A040","Inductor_THT/L_CommonMode_TDK_B82767S4123N030","Inductor_THT/L_CommonMode_TDK_B82767S4193N030","Inductor_THT/L_CommonMode_TDK_B82767S4263N030","Inductor_THT/L_CommonMode_Toroid_Vertical_L13.0mm_W7.5mm_Px6.00mm_Py5.00mm_PRODTech_PDMCAT1065","Inductor_THT/L_CommonMode_Toroid_Vertical_L19.3mm_W10.8mm_Px6.35mm_Py15.24mm_Bourns_8100","Inductor_THT/L_CommonMode_Toroid_Vertical_L21.0mm_W10.0mm_Px5.08mm_Py12.70mm_Murata_5100","Inductor_THT/L_CommonMode_Toroid_Vertical_L22.0mm_W12.0mm_Px9.00mm_Py8.00mm_PRODTech_PDMCAT18107-102ML","Inductor_THT/L_CommonMode_Toroid_Vertical_L22.0mm_W12.0mm_Px9.00mm_Py8.00mm_PRODTech_PDMCAT18107-103ML","Inductor_THT/L_CommonMode_Toroid_Vertical_L22.0mm_W12.0mm_Px9.00mm_Py8.00mm_PRODTech_PDMCAT18107-202ML","Inductor_THT/L_CommonMode_Toroid_Vertical_L22.0mm_W12.0mm_Px9.00mm_Py8.00mm_PRODTech_PDMCAT18107-203ML","Inductor_THT/L_CommonMode_Toroid_Vertical_L22.0mm_W12.0mm_Px9.00mm_Py8.00mm_PRODTech_PDMCAT18107-502ML","Inductor_THT/L_CommonMode_Toroid_Vertical_L24.0mm_W16.3mm_Px10.16mm_Py20.32mm_Murata_5200","Inductor_THT/L_CommonMode_Toroid_Vertical_L30.5mm_W15.2mm_Px10.16mm_Py20.32mm_Bourns_8100","Inductor_THT/L_CommonMode_Toroid_Vertical_L34.3mm_W20.3mm_Px15.24mm_Py22.86mm_Bourns_8100","Inductor_THT/L_CommonMode_Toroid_Vertical_L36.8mm_W20.3mm_Px15.24mm_Py22.86mm_Bourns_8100","Inductor_THT/L_CommonMode_Toroid_Vertical_L38.1mm_W20.3mm_Px15.24mm_Py22.86mm_Bourns_8100","Inductor_THT/L_CommonMode_Toroid_Vertical_L39.4mm_W20.3mm_Px15.24mm_Py22.86mm_Bourns_8100","Inductor_THT/L_CommonMode_Toroid_Vertical_L41.9mm_W20.3mm_Px15.24mm_Py22.86mm_Bourns_8100","Inductor_THT/L_CommonMode_Toroid_Vertical_L43.2mm_W22.9mm_Px17.78mm_Py30.48mm_Bourns_8100","Inductor_THT/L_CommonMode_VAC_T60405-S6123-X140","Inductor_THT/L_CommonMode_VAC_T60405-S6123-X240","Inductor_THT/L_CommonMode_VAC_T60405-S6123-X402","Inductor_THT/L_CommonMode_Wuerth_WE-CMB-L","Inductor_THT/L_CommonMode_Wuerth_WE-CMB-M","Inductor_THT/L_CommonMode_Wuerth_WE-CMB-S","Inductor_THT/L_CommonMode_Wuerth_WE-CMB-XL","Inductor_THT/L_CommonMode_Wuerth_WE-CMB-XS","Inductor_THT/L_CommonMode_Wuerth_WE-CMB-XXL","Inductor_THT/L_Mount_Lodestone_VTM120","Inductor_THT/L_Mount_Lodestone_VTM160","Inductor_THT/L_Mount_Lodestone_VTM254","Inductor_THT/L_Mount_Lodestone_VTM280","Inductor_THT/L_Mount_Lodestone_VTM950-6","Inductor_THT/L_Radial_D10.0mm_P5.00mm_Fastron_07M","Inductor_THT/L_Radial_D10.0mm_P5.00mm_Fastron_07P","Inductor_THT/L_Radial_D10.0mm_P5.00mm_Neosid_SD12_style3","Inductor_THT/L_Radial_D10.0mm_P5.00mm_Neosid_SD12k_style3","Inductor_THT/L_Radial_D10.5mm_P4.00x5.00mm_Murata_1200RS","Inductor_THT/L_Radial_D10.5mm_P5.00mm_Abacron_AISR-01","Inductor_THT/L_Radial_D12.0mm_P10.00mm_Neosid_SD12_style1","Inductor_THT/L_Radial_D12.0mm_P10.00mm_Neosid_SD12k_style1","Inductor_THT/L_Radial_D12.0mm_P5.00mm_Fastron_11P","Inductor_THT/L_Radial_D12.0mm_P5.00mm_Neosid_SD12_style2","Inductor_THT/L_Radial_D12.0mm_P5.00mm_Neosid_SD12k_style2","Inductor_THT/L_Radial_D12.0mm_P6.00mm_Murata_1900R","Inductor_THT/L_Radial_D12.5mm_P7.00mm_Fastron_09HCP","Inductor_THT/L_Radial_D12.5mm_P9.00mm_Fastron_09HCP","Inductor_THT/L_Radial_D13.5mm_P7.00mm_Fastron_09HCP","Inductor_THT/L_Radial_D14.2mm_P10.00mm_Neosid_SD14","Inductor_THT/L_Radial_D16.0mm_P10.00mm_Panasonic_15E-L","Inductor_THT/L_Radial_D16.8mm_P11.43mm_Vishay_IHB-1","Inductor_THT/L_Radial_D16.8mm_P12.07mm_Vishay_IHB-1","Inductor_THT/L_Radial_D16.8mm_P12.70mm_Vishay_IHB-1","Inductor_THT/L_Radial_D18.0mm_P10.00mm","Inductor_THT/L_Radial_D21.0mm_P14.61mm_Vishay_IHB-2","Inductor_THT/L_Radial_D21.0mm_P15.00mm_Vishay_IHB-2","Inductor_THT/L_Radial_D21.0mm_P15.24mm_Vishay_IHB-2","Inductor_THT/L_Radial_D21.0mm_P15.75mm_Vishay_IHB-2","Inductor_THT/L_Radial_D21.0mm_P19.00mm","Inductor_THT/L_Radial_D24.0mm_P24.00mm","Inductor_THT/L_Radial_D24.4mm_P22.90mm_Murata_1400series","Inductor_THT/L_Radial_D24.4mm_P23.10mm_Murata_1400series","Inductor_THT/L_Radial_D24.4mm_P23.40mm_Murata_1400series","Inductor_THT/L_Radial_D24.4mm_P23.70mm_Murata_1400series","Inductor_THT/L_Radial_D24.4mm_P23.90mm_Murata_1400series","Inductor_THT/L_Radial_D27.9mm_P18.29mm_Vishay_IHB-3","Inductor_THT/L_Radial_D27.9mm_P19.05mm_Vishay_IHB-3","Inductor_THT/L_Radial_D27.9mm_P20.07mm_Vishay_IHB-3","Inductor_THT/L_Radial_D28.0mm_P29.20mm","Inductor_THT/L_Radial_D29.8mm_P28.30mm_Murata_1400series","Inductor_THT/L_Radial_D29.8mm_P28.50mm_Murata_1400series","Inductor_THT/L_Radial_D29.8mm_P28.80mm_Murata_1400series","Inductor_THT/L_Radial_D29.8mm_P29.00mm_Murata_1400series","Inductor_THT/L_Radial_D29.8mm_P29.30mm_Murata_1400series","Inductor_THT/L_Radial_D40.6mm_P26.16mm_Vishay_IHB-5","Inductor_THT/L_Radial_D40.6mm_P27.18mm_Vishay_IHB-4","Inductor_THT/L_Radial_D40.6mm_P27.94mm_Vishay_IHB-4","Inductor_THT/L_Radial_D40.6mm_P27.94mm_Vishay_IHB-5","Inductor_THT/L_Radial_D40.6mm_P28.70mm_Vishay_IHB-5","Inductor_THT/L_Radial_D50.8mm_P33.27mm_Vishay_IHB-6","Inductor_THT/L_Radial_D50.8mm_P34.29mm_Vishay_IHB-6","Inductor_THT/L_Radial_D50.8mm_P35.81mm_Vishay_IHB-6","Inductor_THT/L_Radial_D50.8mm_P36.32mm_Vishay_IHB-6","Inductor_THT/L_Radial_D50.8mm_P38.86mm_Vishay_IHB-6","Inductor_THT/L_Radial_D6.0mm_P4.00mm","Inductor_THT/L_Radial_D7.0mm_P3.00mm","Inductor_THT/L_Radial_D7.2mm_P3.00mm_Murata_1700","Inductor_THT/L_Radial_D7.5mm_P3.50mm_Fastron_07P","Inductor_THT/L_Radial_D7.5mm_P5.00mm_Fastron_07P","Inductor_THT/L_Radial_D7.8mm_P5.00mm_Fastron_07HCP","Inductor_THT/L_Radial_D8.7mm_P5.00mm_Fastron_07HCP","Inductor_THT/L_Radial_D9.5mm_P5.00mm_Fastron_07HVP","Inductor_THT/L_Radial_L10.2mm_W10.2mm_Px7.62mm_Py7.62mm_Pulse_LP-30","Inductor_THT/L_Radial_L11.5mm_W11.5mm_Px6.00mm_Py6.00mm_Neosid_NE-CPB-11EN_Drill1.3mm","Inductor_THT/L_Radial_L11.5mm_W11.5mm_Px6.00mm_Py6.00mm_Neosid_NE-CPB-11EN_Drill1.5mm","Inductor_THT/L_Radial_L11.5mm_W11.5mm_Px6.00mm_Py6.00mm_Neosid_NE-CPB-11EN_Drill1.7mm","Inductor_THT/L_Radial_L11.5mm_W11.5mm_Px6.00mm_Py6.00mm_Neosid_NE-CPB-11EN_Drill1.8mm","Inductor_THT/L_Radial_L12.6mm_W12.6mm_Px9.52mm_Py9.52mm_Pulse_LP-37","Inductor_THT/L_Radial_L16.1mm_W16.1mm_Px7.62mm_Py12.70mm_Pulse_LP-44","Inductor_THT/L_Radial_L7.5mm_W4.6mm_P5.00mm_Neosid_SD75","Inductor_THT/L_Radial_L8.0mm_W8.0mm_P5.00mm_Neosid_NE-CPB-07E","Inductor_THT/L_Radial_L8.0mm_W8.0mm_P5.00mm_Neosid_SD8","Inductor_THT/L_Radial_L9.1mm_W9.1mm_Px6.35mm_Py6.35mm_Pulse_LP-25","Inductor_THT/L_SELF1408","Inductor_THT/L_SELF1418","Inductor_THT/L_Toroid_Horizontal_D11.2mm_P17.00mm_Diameter12-5mm_Amidon-T44","Inductor_THT/L_Toroid_Horizontal_D12.7mm_P20.00mm_Diameter14-5mm_Amidon-T50","Inductor_THT/L_Toroid_Horizontal_D16.8mm_P14.70mm_Vishay_TJ3","Inductor_THT/L_Toroid_Horizontal_D16.8mm_P14.70mm_Vishay_TJ3_BigPads","Inductor_THT/L_Toroid_Horizontal_D17.3mm_P15.24mm_Bourns_2000","Inductor_THT/L_Toroid_Horizontal_D21.8mm_P19.10mm_Bourns_2100","Inductor_THT/L_Toroid_Horizontal_D21.8mm_P19.60mm_Bourns_2100","Inductor_THT/L_Toroid_Horizontal_D22.4mm_P19.80mm_Vishay_TJ4","Inductor_THT/L_Toroid_Horizontal_D24.1mm_P21.80mm_Bourns_2200","Inductor_THT/L_Toroid_Horizontal_D24.1mm_P23.10mm_Bourns_2200","Inductor_THT/L_Toroid_Horizontal_D25.4mm_P22.90mm_Vishay_TJ5","Inductor_THT/L_Toroid_Horizontal_D25.4mm_P22.90mm_Vishay_TJ5_BigPads","Inductor_THT/L_Toroid_Horizontal_D26.0mm_P5.08mm","Inductor_THT/L_Toroid_Horizontal_D28.0mm_P25.10mm_Bourns_2200","Inductor_THT/L_Toroid_Horizontal_D28.0mm_P26.67mm_Bourns_2200","Inductor_THT/L_Toroid_Horizontal_D3.2mm_P6.40mm_Diameter3-5mm_Amidon-T12","Inductor_THT/L_Toroid_Horizontal_D32.5mm_P28.90mm_Bourns_2300","Inductor_THT/L_Toroid_Horizontal_D32.5mm_P30.00mm_Bourns_2300","Inductor_THT/L_Toroid_Horizontal_D35.1mm_P31.00mm_Vishay_TJ6","Inductor_THT/L_Toroid_Horizontal_D4.1mm_P8.00mm_Diameter4-5mm_Amidon-T16","Inductor_THT/L_Toroid_Horizontal_D40.0mm_P48.26mm","Inductor_THT/L_Toroid_Horizontal_D41.9mm_P37.60mm_Vishay_TJ7","Inductor_THT/L_Toroid_Horizontal_D49.3mm_P44.60mm_Vishay_TJ8","Inductor_THT/L_Toroid_Horizontal_D5.1mm_P9.00mm_Diameter6-5mm_Amidon-T20","Inductor_THT/L_Toroid_Horizontal_D6.5mm_P10.00mm_Diameter7-5mm_Amidon-T25","Inductor_THT/L_Toroid_Horizontal_D69.1mm_P63.20mm_Vishay_TJ9","Inductor_THT/L_Toroid_Horizontal_D7.8mm_P13.00mm_Diameter9-5mm_Amidon-T30","Inductor_THT/L_Toroid_Horizontal_D9.5mm_P15.00mm_Diameter10-5mm_Amidon-T37","Inductor_THT/L_Toroid_Vertical_L10.0mm_W5.0mm_P5.08mm","Inductor_THT/L_Toroid_Vertical_L13.0mm_W6.5mm_P5.60mm","Inductor_THT/L_Toroid_Vertical_L14.0mm_W5.6mm_P5.30mm_Bourns_5700","Inductor_THT/L_Toroid_Vertical_L14.0mm_W6.3mm_P4.57mm_Pulse_A","Inductor_THT/L_Toroid_Vertical_L14.7mm_W8.6mm_P5.58mm_Pulse_KM-1","Inductor_THT/L_Toroid_Vertical_L16.0mm_W8.0mm_P7.62mm","Inductor_THT/L_Toroid_Vertical_L16.3mm_W7.1mm_P7.11mm_Pulse_H","Inductor_THT/L_Toroid_Vertical_L16.4mm_W7.6mm_P6.60mm_Vishay_TJ3","Inductor_THT/L_Toroid_Vertical_L16.5mm_W11.4mm_P7.62mm_Pulse_KM-2","Inductor_THT/L_Toroid_Vertical_L16.8mm_W9.2mm_P7.10mm_Vishay_TJ3","Inductor_THT/L_Toroid_Vertical_L16.8mm_W9.2mm_P7.10mm_Vishay_TJ3_BigPads","Inductor_THT/L_Toroid_Vertical_L17.8mm_W8.1mm_P7.62mm_Bourns_5700","Inductor_THT/L_Toroid_Vertical_L17.8mm_W9.7mm_P7.11mm_Pulse_B","Inductor_THT/L_Toroid_Vertical_L19.1mm_W8.1mm_P7.10mm_Bourns_5700","Inductor_THT/L_Toroid_Vertical_L21.6mm_W11.4mm_P7.62mm_Pulse_KM-3","Inductor_THT/L_Toroid_Vertical_L21.6mm_W8.4mm_P8.38mm_Pulse_G","Inductor_THT/L_Toroid_Vertical_L21.6mm_W9.1mm_P8.40mm_Bourns_5700","Inductor_THT/L_Toroid_Vertical_L21.6mm_W9.5mm_P7.11mm_Pulse_C","Inductor_THT/L_Toroid_Vertical_L22.4mm_W10.2mm_P7.90mm_Vishay_TJ4","Inductor_THT/L_Toroid_Vertical_L24.6mm_W15.5mm_P11.44mm_Pulse_KM-4","Inductor_THT/L_Toroid_Vertical_L25.4mm_W14.7mm_P12.20mm_Vishay_TJ5","Inductor_THT/L_Toroid_Vertical_L25.4mm_W14.7mm_P12.20mm_Vishay_TJ5_BigPads","Inductor_THT/L_Toroid_Vertical_L26.7mm_W14.0mm_P10.16mm_Pulse_D","Inductor_THT/L_Toroid_Vertical_L28.6mm_W14.3mm_P11.43mm_Bourns_5700","Inductor_THT/L_Toroid_Vertical_L31.8mm_W15.9mm_P13.50mm_Bourns_5700","Inductor_THT/L_Toroid_Vertical_L33.0mm_W17.8mm_P12.70mm_Pulse_KM-5","Inductor_THT/L_Toroid_Vertical_L35.1mm_W21.1mm_P18.50mm_Vishay_TJ6","Inductor_THT/L_Toroid_Vertical_L35.6mm_W17.8mm_P12.70mm_Pulse_E","Inductor_THT/L_Toroid_Vertical_L41.9mm_W17.8mm_P12.70mm_Pulse_F","Inductor_THT/L_Toroid_Vertical_L41.9mm_W19.1mm_P15.80mm_Vishay_TJ7","Inductor_THT/L_Toroid_Vertical_L46.0mm_W19.1mm_P21.80mm_Bourns_5700","Inductor_THT/L_Toroid_Vertical_L48.8mm_W25.4mm_P20.80mm_Vishay_TJ8","Inductor_THT/L_Toroid_Vertical_L54.0mm_W23.8mm_P20.10mm_Bourns_5700","Inductor_THT/L_Toroid_Vertical_L67.6mm_W36.1mm_P31.80mm_Vishay_TJ9","Inductor_THT_Wurth/L_Wurth_WE-HCFT-2012_LeadDiameter1.2mm","Inductor_THT_Wurth/L_Wurth_WE-HCFT-2012_LeadDiameter1.5mm","Inductor_THT_Wurth/L_Wurth_WE-HCFT-2504","Inductor_THT_Wurth/L_Wurth_WE-HCFT-3521","Inductor_THT_Wurth/L_Wurth_WE-HCFT-3533_LeadDiameter1.8mm","Inductor_THT_Wurth/L_Wurth_WE-HCFT-3533_LeadDiameter2.0mm","Inductor_THT_Wurth/L_Wurth_WE-HCFT-3540_LeadDiameter0.8mm","Inductor_THT_Wurth/L_Wurth_WE-HCFT-3540_LeadDiameter1.3mm","Inductor_THT_Wurth/L_Wurth_WE-HCFT-3540_LeadDiameter1.5mm","Inductor_THT_Wurth/L_Wurth_WE-HCFT-3540_LeadDiameter2.0mm","Jumper/Jumper_Harwin_S1621_P10.9mm","Jumper/SolderJumper-2_P1.3mm_Bridged2Bar_Pad1.0x1.5mm","Jumper/SolderJumper-2_P1.3mm_Bridged2Bar_RoundedPad1.0x1.5mm","Jumper/SolderJumper-2_P1.3mm_Bridged_Pad1.0x1.5mm","Jumper/SolderJumper-2_P1.3mm_Bridged_RoundedPad1.0x1.5mm","Jumper/SolderJumper-2_P1.3mm_Open_Pad1.0x1.5mm","Jumper/SolderJumper-2_P1.3mm_Open_RoundedPad1.0x1.5mm","Jumper/SolderJumper-2_P1.3mm_Open_TrianglePad1.0x1.5mm","Jumper/SolderJumper-3_P1.3mm_Bridged123_Pad1.0x1.5mm","Jumper/SolderJumper-3_P1.3mm_Bridged123_Pad1.0x1.5mm_NumberLabels","Jumper/SolderJumper-3_P1.3mm_Bridged123_RoundedPad1.0x1.5mm","Jumper/SolderJumper-3_P1.3mm_Bridged123_RoundedPad1.0x1.5mm_NumberLabels","Jumper/SolderJumper-3_P1.3mm_Bridged12_Pad1.0x1.5mm","Jumper/SolderJumper-3_P1.3mm_Bridged12_Pad1.0x1.5mm_NumberLabels","Jumper/SolderJumper-3_P1.3mm_Bridged12_RoundedPad1.0x1.5mm","Jumper/SolderJumper-3_P1.3mm_Bridged12_RoundedPad1.0x1.5mm_NumberLabels","Jumper/SolderJumper-3_P1.3mm_Bridged2Bar123_Pad1.0x1.5mm","Jumper/SolderJumper-3_P1.3mm_Bridged2Bar123_Pad1.0x1.5mm_NumberLabels","Jumper/SolderJumper-3_P1.3mm_Bridged2Bar123_RoundedPad1.0x1.5mm","Jumper/SolderJumper-3_P1.3mm_Bridged2Bar123_RoundedPad1.0x1.5mm_NumberLabels","Jumper/SolderJumper-3_P1.3mm_Bridged2Bar12_Pad1.0x1.5mm","Jumper/SolderJumper-3_P1.3mm_Bridged2Bar12_Pad1.0x1.5mm_NumberLabels","Jumper/SolderJumper-3_P1.3mm_Bridged2Bar12_RoundedPad1.0x1.5mm","Jumper/SolderJumper-3_P1.3mm_Bridged2Bar12_RoundedPad1.0x1.5mm_NumberLabels","Jumper/SolderJumper-3_P1.3mm_Open_Pad1.0x1.5mm","Jumper/SolderJumper-3_P1.3mm_Open_Pad1.0x1.5mm_NumberLabels","Jumper/SolderJumper-3_P1.3mm_Open_RoundedPad1.0x1.5mm","Jumper/SolderJumper-3_P1.3mm_Open_RoundedPad1.0x1.5mm_NumberLabels","Jumper/SolderJumper-3_P2.0mm_Open_TrianglePad1.0x1.5mm","Jumper/SolderJumper-3_P2.0mm_Open_TrianglePad1.0x1.5mm_NumberLabels","LED_SMD/LED-APA102-2020","LED_SMD/LED-L1T2_LUMILEDS","LED_SMD/LED_01005_0402Metric","LED_SMD/LED_01005_0402Metric_Pad0.57x0.30mm_HandSolder","LED_SMD/LED_0201_0603Metric","LED_SMD/LED_0201_0603Metric_Pad0.64x0.40mm_HandSolder","LED_SMD/LED_0402_1005Metric","LED_SMD/LED_0402_1005Metric_Pad0.77x0.64mm_HandSolder","LED_SMD/LED_0603_1608Metric","LED_SMD/LED_0603_1608Metric_Pad1.05x0.95mm_HandSolder","LED_SMD/LED_0805_2012Metric","LED_SMD/LED_0805_2012Metric_Pad1.15x1.40mm_HandSolder","LED_SMD/LED_1206_3216Metric","LED_SMD/LED_1206_3216Metric_Pad1.42x1.75mm_HandSolder","LED_SMD/LED_1206_3216Metric_ReverseMount_Hole1.8x2.4mm","LED_SMD/LED_1210_3225Metric","LED_SMD/LED_1210_3225Metric_Pad1.42x2.65mm_HandSolder","LED_SMD/LED_1812_4532Metric","LED_SMD/LED_1812_4532Metric_Pad1.30x3.40mm_HandSolder","LED_SMD/LED_1W_3W_R8","LED_SMD/LED_2010_5025Metric","LED_SMD/LED_2010_5025Metric_Pad1.52x2.65mm_HandSolder","LED_SMD/LED_2512_6332Metric","LED_SMD/LED_2512_6332Metric_Pad1.52x3.35mm_HandSolder","LED_SMD/LED_ASMB-KTF0-0A306","LED_SMD/LED_Avago_PLCC4_3.2x2.8mm_CW","LED_SMD/LED_Avago_PLCC6_3x2.8mm","LED_SMD/LED_CSP_Samsung_LH181B_2.36x2.36mm","LED_SMD/LED_Cree-PLCC4_2x2mm_CW","LED_SMD/LED_Cree-PLCC4_3.2x2.8mm_CCW","LED_SMD/LED_Cree-PLCC4_5x5mm_CW","LED_SMD/LED_Cree-PLCC6_4.7x1.5mm","LED_SMD/LED_Cree-XB","LED_SMD/LED_Cree-XH","LED_SMD/LED_Cree-XHP35","LED_SMD/LED_Cree-XHP50_12V_HighDensity","LED_SMD/LED_Cree-XHP50_12V_HighIntensity","LED_SMD/LED_Cree-XHP50_3V_HighDensity","LED_SMD/LED_Cree-XHP50_3V_HighIntensity","LED_SMD/LED_Cree-XHP50_6V_HighDensity","LED_SMD/LED_Cree-XHP50_6V_HighIntensity","LED_SMD/LED_Cree-XHP70_12V","LED_SMD/LED_Cree-XHP70_6V","LED_SMD/LED_Cree-XP-G","LED_SMD/LED_Cree-XP","LED_SMD/LED_Cree-XQ","LED_SMD/LED_Cree-XQ_HandSoldering","LED_SMD/LED_Dialight_591","LED_SMD/LED_Everlight-SMD3528_3.5x2.8mm_67-21ST","LED_SMD/LED_Foshan-NTD3528_3.5x2.8mm","LED_SMD/LED_Inolux_IN-P55TATRGB_PLCC6_5.0x5.5mm_P1.8mm","LED_SMD/LED_Inolux_IN-PI554FCH_PLCC4_5.0x5.0mm_P3.2mm","LED_SMD/LED_Kingbright_AAA3528ESGCT","LED_SMD/LED_Kingbright_APA1606_1.6x0.6mm_Horizontal","LED_SMD/LED_Kingbright_APDA3020VBCD","LED_SMD/LED_Kingbright_APFA3010_3x1.5mm_Horizontal","LED_SMD/LED_Kingbright_APHBM2012_2x1.25mm","LED_SMD/LED_Kingbright_KPA-3010_3x2x1mm","LED_SMD/LED_Kingbright_KPBD-3224","LED_SMD/LED_LiteOn_LTST-C19HE1WT","LED_SMD/LED_LiteOn_LTST-C235KGKRKT","LED_SMD/LED_LiteOn_LTST-C295K_1.6x0.8mm","LED_SMD/LED_LiteOn_LTST-E563C_PLCC4_5.0x5.0mm_P3.2mm","LED_SMD/LED_LiteOn_LTST-E563C_PLCC4_5.0x5.0mm_P3.2mm_HandSoldering","LED_SMD/LED_LiteOn_LTST-S326","LED_SMD/LED_Lumex_SML-LX0303SIUPGUSB","LED_SMD/LED_Lumex_SML-LX0404SIUPGUSB","LED_SMD/LED_Luminus_MP-3030-1100_3.0x3.0mm","LED_SMD/LED_OPSCO_SK6812_PLCC4_5.0x5.0mm_P3.1mm","LED_SMD/LED_Osram_Lx_P47F_D2mm_ReverseMount","LED_SMD/LED_PLCC-2_3.4x3.0mm_AK","LED_SMD/LED_PLCC-2_3.4x3.0mm_KA","LED_SMD/LED_PLCC-2_3x2mm_AK","LED_SMD/LED_PLCC-2_3x2mm_KA","LED_SMD/LED_PLCC_2835","LED_SMD/LED_PLCC_2835_Handsoldering","LED_SMD/LED_RGB_1210","LED_SMD/LED_RGB_5050-6","LED_SMD/LED_RGB_Cree-PLCC-6_6x5mm_P2.1mm","LED_SMD/LED_RGB_Everlight_EASV3015RGBA0_Horizontal","LED_SMD/LED_RGB_Getian_GT-P6PRGB4303","LED_SMD/LED_RGB_Lumex_SML-LXT0805SIUGUBW","LED_SMD/LED_RGB_PLCC-6","LED_SMD/LED_RGB_Wuerth-PLCC4_3.2x2.8mm_150141M173100","LED_SMD/LED_RGB_Wuerth_150080M153000","LED_SMD/LED_ROHM_SMLVN6","LED_SMD/LED_SK6805_PLCC4_2.4x2.7mm_P1.3mm","LED_SMD/LED_SK6812MINI-E_3.2x2.8mm_P1.5mm_ReverseMount","LED_SMD/LED_SK6812MINI_PLCC4_3.5x3.5mm_P1.75mm","LED_SMD/LED_SK6812_EC15_1.5x1.5mm","LED_SMD/LED_SK6812_PLCC4_5.0x5.0mm_P3.2mm","LED_SMD/LED_WS2812B-2020_PLCC4_2.0x2.0mm","LED_SMD/LED_WS2812B-Mini_PLCC4_3.5x3.5mm","LED_SMD/LED_WS2812B_PLCC4_5.0x5.0mm_P3.2mm","LED_SMD/LED_WS2812_PLCC6_5.0x5.0mm_P1.6mm","LED_SMD/LED_Wurth_150044M155260","LED_SMD/LED_Yuji_5730","LED_SMD/LED_miniPLCC_2315","LED_SMD/LED_miniPLCC_2315_Handsoldering","LED_THT/LED_BL-FL7680RGB","LED_THT/LED_D1.8mm_W1.8mm_H2.4mm_Horizontal_O1.27mm_Z1.6mm","LED_THT/LED_D1.8mm_W1.8mm_H2.4mm_Horizontal_O1.27mm_Z4.9mm","LED_THT/LED_D1.8mm_W1.8mm_H2.4mm_Horizontal_O1.27mm_Z8.2mm","LED_THT/LED_D1.8mm_W1.8mm_H2.4mm_Horizontal_O3.81mm_Z1.6mm","LED_THT/LED_D1.8mm_W1.8mm_H2.4mm_Horizontal_O3.81mm_Z4.9mm","LED_THT/LED_D1.8mm_W1.8mm_H2.4mm_Horizontal_O3.81mm_Z8.2mm","LED_THT/LED_D1.8mm_W1.8mm_H2.4mm_Horizontal_O6.35mm_Z1.6mm","LED_THT/LED_D1.8mm_W1.8mm_H2.4mm_Horizontal_O6.35mm_Z4.9mm","LED_THT/LED_D1.8mm_W1.8mm_H2.4mm_Horizontal_O6.35mm_Z8.2mm","LED_THT/LED_D1.8mm_W3.3mm_H2.4mm","LED_THT/LED_D10.0mm-3","LED_THT/LED_D10.0mm","LED_THT/LED_D2.0mm_W4.0mm_H2.8mm_FlatTop","LED_THT/LED_D2.0mm_W4.8mm_H2.5mm_FlatTop","LED_THT/LED_D20.0mm","LED_THT/LED_D3.0mm-3","LED_THT/LED_D3.0mm","LED_THT/LED_D3.0mm_Clear","LED_THT/LED_D3.0mm_FlatTop","LED_THT/LED_D3.0mm_Horizontal_O1.27mm_Z10.0mm","LED_THT/LED_D3.0mm_Horizontal_O1.27mm_Z2.0mm","LED_THT/LED_D3.0mm_Horizontal_O1.27mm_Z2.0mm_Clear","LED_THT/LED_D3.0mm_Horizontal_O1.27mm_Z2.0mm_IRBlack","LED_THT/LED_D3.0mm_Horizontal_O1.27mm_Z2.0mm_IRGrey","LED_THT/LED_D3.0mm_Horizontal_O1.27mm_Z6.0mm","LED_THT/LED_D3.0mm_Horizontal_O3.81mm_Z10.0mm","LED_THT/LED_D3.0mm_Horizontal_O3.81mm_Z2.0mm","LED_THT/LED_D3.0mm_Horizontal_O3.81mm_Z6.0mm","LED_THT/LED_D3.0mm_Horizontal_O6.35mm_Z10.0mm","LED_THT/LED_D3.0mm_Horizontal_O6.35mm_Z2.0mm","LED_THT/LED_D3.0mm_Horizontal_O6.35mm_Z6.0mm","LED_THT/LED_D3.0mm_IRBlack","LED_THT/LED_D3.0mm_IRGrey","LED_THT/LED_D4.0mm","LED_THT/LED_D5.0mm-3","LED_THT/LED_D5.0mm-3_Horizontal_O3.81mm_Z3.0mm","LED_THT/LED_D5.0mm-4_RGB","LED_THT/LED_D5.0mm-4_RGB_Staggered_Pins","LED_THT/LED_D5.0mm-4_RGB_Wide_Pins","LED_THT/LED_D5.0mm","LED_THT/LED_D5.0mm_Clear","LED_THT/LED_D5.0mm_FlatTop","LED_THT/LED_D5.0mm_Horizontal_O1.27mm_Z15.0mm","LED_THT/LED_D5.0mm_Horizontal_O1.27mm_Z3.0mm","LED_THT/LED_D5.0mm_Horizontal_O1.27mm_Z3.0mm_Clear","LED_THT/LED_D5.0mm_Horizontal_O1.27mm_Z3.0mm_IRBlack","LED_THT/LED_D5.0mm_Horizontal_O1.27mm_Z3.0mm_IRGrey","LED_THT/LED_D5.0mm_Horizontal_O1.27mm_Z9.0mm","LED_THT/LED_D5.0mm_Horizontal_O3.81mm_Z15.0mm","LED_THT/LED_D5.0mm_Horizontal_O3.81mm_Z3.0mm","LED_THT/LED_D5.0mm_Horizontal_O3.81mm_Z9.0mm","LED_THT/LED_D5.0mm_Horizontal_O6.35mm_Z15.0mm","LED_THT/LED_D5.0mm_Horizontal_O6.35mm_Z3.0mm","LED_THT/LED_D5.0mm_Horizontal_O6.35mm_Z9.0mm","LED_THT/LED_D5.0mm_IRBlack","LED_THT/LED_D5.0mm_IRGrey","LED_THT/LED_D8.0mm-3","LED_THT/LED_D8.0mm","LED_THT/LED_Oval_W5.2mm_H3.8mm","LED_THT/LED_Rectangular_W3.0mm_H2.0mm","LED_THT/LED_Rectangular_W3.9mm_H1.8mm","LED_THT/LED_Rectangular_W3.9mm_H1.9mm","LED_THT/LED_Rectangular_W5.0mm_H2.0mm-3Pins","LED_THT/LED_Rectangular_W5.0mm_H2.0mm","LED_THT/LED_Rectangular_W5.0mm_H2.0mm_Horizontal_O1.27mm_Z1.0mm","LED_THT/LED_Rectangular_W5.0mm_H2.0mm_Horizontal_O1.27mm_Z3.0mm","LED_THT/LED_Rectangular_W5.0mm_H2.0mm_Horizontal_O1.27mm_Z5.0mm","LED_THT/LED_Rectangular_W5.0mm_H2.0mm_Horizontal_O3.81mm_Z1.0mm","LED_THT/LED_Rectangular_W5.0mm_H2.0mm_Horizontal_O3.81mm_Z3.0mm","LED_THT/LED_Rectangular_W5.0mm_H2.0mm_Horizontal_O3.81mm_Z5.0mm","LED_THT/LED_Rectangular_W5.0mm_H2.0mm_Horizontal_O6.35mm_Z1.0mm","LED_THT/LED_Rectangular_W5.0mm_H2.0mm_Horizontal_O6.35mm_Z3.0mm","LED_THT/LED_Rectangular_W5.0mm_H2.0mm_Horizontal_O6.35mm_Z5.0mm","LED_THT/LED_Rectangular_W5.0mm_H5.0mm","LED_THT/LED_Rectangular_W7.62mm_H4.55mm_P5.08mm_R3","LED_THT/LED_SideEmitter_Rectangular_W4.5mm_H1.6mm","LED_THT/LED_VCCLite_5381H1_6.35x6.35mm","LED_THT/LED_VCCLite_5381H3_6.35x6.35mm","LED_THT/LED_VCCLite_5381H5_6.35x6.35mm","LED_THT/LED_VCCLite_5381H7_6.35x6.35mm","Module/A20_OLINUXINO_LIME2","Module/Adafruit_Feather","Module/Adafruit_Feather_32u4_FONA","Module/Adafruit_Feather_32u4_FONA_WithMountingHoles","Module/Adafruit_Feather_32u4_RFM","Module/Adafruit_Feather_32u4_RFM_WithMountingHoles","Module/Adafruit_Feather_M0_RFM","Module/Adafruit_Feather_M0_RFM_WithMountingHoles","Module/Adafruit_Feather_M0_Wifi","Module/Adafruit_Feather_M0_Wifi_WithMountingHoles","Module/Adafruit_Feather_WICED","Module/Adafruit_Feather_WICED_WithMountingHoles","Module/Adafruit_Feather_WithMountingHoles","Module/Adafruit_HUZZAH_ESP8266_breakout","Module/Adafruit_HUZZAH_ESP8266_breakout_WithMountingHoles","Module/Arduino_Nano","Module/Arduino_Nano_WithMountingHoles","Module/Arduino_UNO_R2","Module/Arduino_UNO_R2_WithMountingHoles","Module/Arduino_UNO_R3","Module/Arduino_UNO_R3_WithMountingHoles","Module/BeagleBoard_PocketBeagle","Module/Carambola2","Module/Electrosmith_Daisy_Seed","Module/Flipper_Zero_Angled","Module/Flipper_Zero_Straight","Module/Google_Coral_SMT_TPU_Module","Module/Maple_Mini","Module/Olimex_MOD-WIFI-ESP8266-DEV","Module/Onion_Omega2+","Module/Onion_Omega2S","Module/Pololu_Breakout-16_15.2x20.3mm","Module/RaspberryPi_Pico_Common_SMD","Module/RaspberryPi_Pico_Common_THT","Module/RaspberryPi_Pico_Common_Unspecified","Module/RaspberryPi_Pico_SMD","Module/RaspberryPi_Pico_SMD_HandSolder","Module/RaspberryPi_Pico_W_SMD","Module/RaspberryPi_Pico_W_SMD_HandSolder","Module/Raspberry_Pi_Zero_Socketed_THT_FaceDown_MountingHoles","Module/ST_Morpho_Connector_144_STLink","Module/ST_Morpho_Connector_144_STLink_MountingHoles","Module/Sipeed-M1","Module/Sipeed-M1W","Module/Texas_EUK_R-PDSS-T7_THT","Module/Texas_EUS_R-PDSS-T5_THT","Module/Texas_EUW_R-PDSS-T7_THT","Motors/Vybronics_VZ30C1T8219732L","MountingEquipment/DINRailAdapter_3xM3_PhoenixContact_1201578","MountingHole/MountingHole_2.1mm","MountingHole/MountingHole_2.2mm_M2","MountingHole/MountingHole_2.2mm_M2_DIN965","MountingHole/MountingHole_2.2mm_M2_DIN965_Pad","MountingHole/MountingHole_2.2mm_M2_DIN965_Pad_TopBottom","MountingHole/MountingHole_2.2mm_M2_DIN965_Pad_TopOnly","MountingHole/MountingHole_2.2mm_M2_ISO14580","MountingHole/MountingHole_2.2mm_M2_ISO14580_Pad","MountingHole/MountingHole_2.2mm_M2_ISO14580_Pad_TopBottom","MountingHole/MountingHole_2.2mm_M2_ISO14580_Pad_TopOnly","MountingHole/MountingHole_2.2mm_M2_ISO7380","MountingHole/MountingHole_2.2mm_M2_ISO7380_Pad","MountingHole/MountingHole_2.2mm_M2_ISO7380_Pad_TopBottom","MountingHole/MountingHole_2.2mm_M2_ISO7380_Pad_TopOnly","MountingHole/MountingHole_2.2mm_M2_Pad","MountingHole/MountingHole_2.2mm_M2_Pad_TopBottom","MountingHole/MountingHole_2.2mm_M2_Pad_TopOnly","MountingHole/MountingHole_2.2mm_M2_Pad_Via","MountingHole/MountingHole_2.5mm","MountingHole/MountingHole_2.5mm_Pad","MountingHole/MountingHole_2.5mm_Pad_TopBottom","MountingHole/MountingHole_2.5mm_Pad_TopOnly","MountingHole/MountingHole_2.5mm_Pad_Via","MountingHole/MountingHole_2.7mm","MountingHole/MountingHole_2.7mm_M2.5","MountingHole/MountingHole_2.7mm_M2.5_DIN965","MountingHole/MountingHole_2.7mm_M2.5_DIN965_Pad","MountingHole/MountingHole_2.7mm_M2.5_DIN965_Pad_TopBottom","MountingHole/MountingHole_2.7mm_M2.5_DIN965_Pad_TopOnly","MountingHole/MountingHole_2.7mm_M2.5_ISO14580","MountingHole/MountingHole_2.7mm_M2.5_ISO14580_Pad","MountingHole/MountingHole_2.7mm_M2.5_ISO14580_Pad_TopBottom","MountingHole/MountingHole_2.7mm_M2.5_ISO14580_Pad_TopOnly","MountingHole/MountingHole_2.7mm_M2.5_ISO7380","MountingHole/MountingHole_2.7mm_M2.5_ISO7380_Pad","MountingHole/MountingHole_2.7mm_M2.5_ISO7380_Pad_TopBottom","MountingHole/MountingHole_2.7mm_M2.5_ISO7380_Pad_TopOnly","MountingHole/MountingHole_2.7mm_M2.5_Pad","MountingHole/MountingHole_2.7mm_M2.5_Pad_TopBottom","MountingHole/MountingHole_2.7mm_M2.5_Pad_TopOnly","MountingHole/MountingHole_2.7mm_M2.5_Pad_Via","MountingHole/MountingHole_2.7mm_Pad","MountingHole/MountingHole_2.7mm_Pad_TopBottom","MountingHole/MountingHole_2.7mm_Pad_TopOnly","MountingHole/MountingHole_2.7mm_Pad_Via","MountingHole/MountingHole_2mm","MountingHole/MountingHole_3.2mm_M3","MountingHole/MountingHole_3.2mm_M3_DIN965","MountingHole/MountingHole_3.2mm_M3_DIN965_Pad","MountingHole/MountingHole_3.2mm_M3_DIN965_Pad_TopBottom","MountingHole/MountingHole_3.2mm_M3_DIN965_Pad_TopOnly","MountingHole/MountingHole_3.2mm_M3_ISO14580","MountingHole/MountingHole_3.2mm_M3_ISO14580_Pad","MountingHole/MountingHole_3.2mm_M3_ISO14580_Pad_TopBottom","MountingHole/MountingHole_3.2mm_M3_ISO14580_Pad_TopOnly","MountingHole/MountingHole_3.2mm_M3_ISO7380","MountingHole/MountingHole_3.2mm_M3_ISO7380_Pad","MountingHole/MountingHole_3.2mm_M3_ISO7380_Pad_TopBottom","MountingHole/MountingHole_3.2mm_M3_ISO7380_Pad_TopOnly","MountingHole/MountingHole_3.2mm_M3_Pad","MountingHole/MountingHole_3.2mm_M3_Pad_TopBottom","MountingHole/MountingHole_3.2mm_M3_Pad_TopOnly","MountingHole/MountingHole_3.2mm_M3_Pad_Via","MountingHole/MountingHole_3.5mm","MountingHole/MountingHole_3.5mm_Pad","MountingHole/MountingHole_3.5mm_Pad_TopBottom","MountingHole/MountingHole_3.5mm_Pad_TopOnly","MountingHole/MountingHole_3.5mm_Pad_Via","MountingHole/MountingHole_3.7mm","MountingHole/MountingHole_3.7mm_Pad","MountingHole/MountingHole_3.7mm_Pad_TopBottom","MountingHole/MountingHole_3.7mm_Pad_TopOnly","MountingHole/MountingHole_3.7mm_Pad_Via","MountingHole/MountingHole_3mm","MountingHole/MountingHole_3mm_Pad","MountingHole/MountingHole_3mm_Pad_TopBottom","MountingHole/MountingHole_3mm_Pad_TopOnly","MountingHole/MountingHole_3mm_Pad_Via","MountingHole/MountingHole_4.3mm_M4","MountingHole/MountingHole_4.3mm_M4_DIN965","MountingHole/MountingHole_4.3mm_M4_DIN965_Pad","MountingHole/MountingHole_4.3mm_M4_DIN965_Pad_TopBottom","MountingHole/MountingHole_4.3mm_M4_DIN965_Pad_TopOnly","MountingHole/MountingHole_4.3mm_M4_ISO14580","MountingHole/MountingHole_4.3mm_M4_ISO14580_Pad","MountingHole/MountingHole_4.3mm_M4_ISO14580_Pad_TopBottom","MountingHole/MountingHole_4.3mm_M4_ISO14580_Pad_TopOnly","MountingHole/MountingHole_4.3mm_M4_ISO7380","MountingHole/MountingHole_4.3mm_M4_ISO7380_Pad","MountingHole/MountingHole_4.3mm_M4_ISO7380_Pad_TopBottom","MountingHole/MountingHole_4.3mm_M4_ISO7380_Pad_TopOnly","MountingHole/MountingHole_4.3mm_M4_Pad","MountingHole/MountingHole_4.3mm_M4_Pad_TopBottom","MountingHole/MountingHole_4.3mm_M4_Pad_TopOnly","MountingHole/MountingHole_4.3mm_M4_Pad_Via","MountingHole/MountingHole_4.3x6.2mm_M4_Pad","MountingHole/MountingHole_4.3x6.2mm_M4_Pad_Via","MountingHole/MountingHole_4.5mm","MountingHole/MountingHole_4.5mm_Pad","MountingHole/MountingHole_4.5mm_Pad_TopBottom","MountingHole/MountingHole_4.5mm_Pad_TopOnly","MountingHole/MountingHole_4.5mm_Pad_Via","MountingHole/MountingHole_4mm","MountingHole/MountingHole_4mm_Pad","MountingHole/MountingHole_4mm_Pad_TopBottom","MountingHole/MountingHole_4mm_Pad_TopOnly","MountingHole/MountingHole_4mm_Pad_Via","MountingHole/MountingHole_5.3mm_M5","MountingHole/MountingHole_5.3mm_M5_DIN965","MountingHole/MountingHole_5.3mm_M5_DIN965_Pad","MountingHole/MountingHole_5.3mm_M5_DIN965_Pad_TopBottom","MountingHole/MountingHole_5.3mm_M5_DIN965_Pad_TopOnly","MountingHole/MountingHole_5.3mm_M5_ISO14580","MountingHole/MountingHole_5.3mm_M5_ISO14580_Pad","MountingHole/MountingHole_5.3mm_M5_ISO14580_Pad_TopBottom","MountingHole/MountingHole_5.3mm_M5_ISO14580_Pad_TopOnly","MountingHole/MountingHole_5.3mm_M5_ISO7380","MountingHole/MountingHole_5.3mm_M5_ISO7380_Pad","MountingHole/MountingHole_5.3mm_M5_ISO7380_Pad_TopBottom","MountingHole/MountingHole_5.3mm_M5_ISO7380_Pad_TopOnly","MountingHole/MountingHole_5.3mm_M5_Pad","MountingHole/MountingHole_5.3mm_M5_Pad_TopBottom","MountingHole/MountingHole_5.3mm_M5_Pad_TopOnly","MountingHole/MountingHole_5.3mm_M5_Pad_Via","MountingHole/MountingHole_5.5mm","MountingHole/MountingHole_5.5mm_Pad","MountingHole/MountingHole_5.5mm_Pad_TopBottom","MountingHole/MountingHole_5.5mm_Pad_TopOnly","MountingHole/MountingHole_5.5mm_Pad_Via","MountingHole/MountingHole_5mm","MountingHole/MountingHole_5mm_Pad","MountingHole/MountingHole_5mm_Pad_TopBottom","MountingHole/MountingHole_5mm_Pad_TopOnly","MountingHole/MountingHole_5mm_Pad_Via","MountingHole/MountingHole_6.4mm_M6","MountingHole/MountingHole_6.4mm_M6_DIN965","MountingHole/MountingHole_6.4mm_M6_DIN965_Pad","MountingHole/MountingHole_6.4mm_M6_DIN965_Pad_TopBottom","MountingHole/MountingHole_6.4mm_M6_DIN965_Pad_TopOnly","MountingHole/MountingHole_6.4mm_M6_ISO14580","MountingHole/MountingHole_6.4mm_M6_ISO14580_Pad","MountingHole/MountingHole_6.4mm_M6_ISO14580_Pad_TopBottom","MountingHole/MountingHole_6.4mm_M6_ISO14580_Pad_TopOnly","MountingHole/MountingHole_6.4mm_M6_ISO7380","MountingHole/MountingHole_6.4mm_M6_ISO7380_Pad","MountingHole/MountingHole_6.4mm_M6_ISO7380_Pad_TopBottom","MountingHole/MountingHole_6.4mm_M6_ISO7380_Pad_TopOnly","MountingHole/MountingHole_6.4mm_M6_Pad","MountingHole/MountingHole_6.4mm_M6_Pad_TopBottom","MountingHole/MountingHole_6.4mm_M6_Pad_TopOnly","MountingHole/MountingHole_6.4mm_M6_Pad_Via","MountingHole/MountingHole_6.5mm","MountingHole/MountingHole_6.5mm_Pad","MountingHole/MountingHole_6.5mm_Pad_TopBottom","MountingHole/MountingHole_6.5mm_Pad_TopOnly","MountingHole/MountingHole_6.5mm_Pad_Via","MountingHole/MountingHole_6mm","MountingHole/MountingHole_6mm_Pad","MountingHole/MountingHole_6mm_Pad_TopBottom","MountingHole/MountingHole_6mm_Pad_TopOnly","MountingHole/MountingHole_6mm_Pad_Via","MountingHole/MountingHole_8.4mm_M8","MountingHole/MountingHole_8.4mm_M8_Pad","MountingHole/MountingHole_8.4mm_M8_Pad_TopBottom","MountingHole/MountingHole_8.4mm_M8_Pad_TopOnly","MountingHole/MountingHole_8.4mm_M8_Pad_Via","MountingHole/ToolingHole_1.152mm","Mounting_Wuerth/Mounting_Wuerth_WA-SMSE-ExternalM3_H10mm_9771100360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSE-ExternalM3_H11mm_9771110360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSE-ExternalM3_H12mm_9771120360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSE-ExternalM3_H13mm_9771130360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSE-ExternalM3_H14mm_9771140360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSE-ExternalM3_H15mm_9771150360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSE-ExternalM3_H5mm_9771050360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSE-ExternalM3_H6mm_9771060360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSE-ExternalM3_H7mm_9771070360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSE-ExternalM3_H8mm_9771080360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSE-ExternalM3_H9mm_9771090360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M1.6_H0.5mm_9774005633","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M1.6_H1.5mm_9774015633","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M1.6_H1mm_9774010633","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M1.6_H2.5mm_9774025633","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M1.6_H2.5mm_ThreadDepth1.5mm_97730256332","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M1.6_H2.5mm_ThreadDepth1.5mm_NoNPTH_97730256330","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M1.6_H2mm_9774020633","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M1.6_H3.5mm_ThreadDepth2mm_97730356332","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M1.6_H3.5mm_ThreadDepth2mm_97730356334","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M1.6_H3.5mm_ThreadDepth2mm_NoNPTH_97730356330","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M1.6_H3mm_9774030633","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M1.6_H3mm_ThreadDepth1.8mm_97730306332","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M1.6_H3mm_ThreadDepth1.8mm_NoNPTH_97730306330","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M1.6_H4.5mm_ThreadDepth2mm_97730456332","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M1.6_H4.5mm_ThreadDepth2mm_97730456334","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M1.6_H4.5mm_ThreadDepth2mm_NoNPTH_97730456330","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M1.6_H4mm_ThreadDepth2mm_97730406332","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M1.6_H4mm_ThreadDepth2mm_97730406334","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M1.6_H4mm_ThreadDepth2mm_NoNPTH_97730406330","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M1.6_H5mm_ThreadDepth2mm_97730506332","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M1.6_H5mm_ThreadDepth2mm_97730506334","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M1.6_H5mm_ThreadDepth2mm_NoNPTH_97730506330","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M1.6_H6mm_ThreadDepth2mm_97730606332","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M1.6_H6mm_ThreadDepth2mm_97730606334","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M1.6_H6mm_ThreadDepth2mm_NoNPTH_97730606330","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2.5_H0.5mm_9774005151","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2.5_H1.5mm_9774015151","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2.5_H10mm_9774100151","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2.5_H1mm_9774010151","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2.5_H2.5mm_9774025151","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2.5_H2.7mm_9774027151","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2.5_H2mm_9774020151","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2.5_H3.5mm_9774035151","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2.5_H3mm_9774030151","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2.5_H4.5mm_9774045151","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2.5_H4mm_9774040151","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2.5_H5.5mm_9774055151","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2.5_H5mm_9774050151","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2.5_H6.5mm_9774065151","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2.5_H6mm_9774060151","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2.5_H7.5mm_9774075151","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2.5_H7mm_9774070151","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2.5_H8.5mm_9774085151","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2.5_H8mm_9774080151","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2.5_H9.5mm_9774095151","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2.5_H9mm_9774090151","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2_H0.5mm_9774005243","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2_H1.5mm_9774015243","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2_H1mm_9774010243","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2_H2.5mm_9774025243","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2_H2mm_9774020243","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2_H3.5mm_9774035243","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2_H3mm_9774030243","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2_H4.5mm_9774045243","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2_H4mm_9774040243","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2_H5mm_9774050243","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2_H6mm_9774060243","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2_H7mm_9774070243","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2_H8mm_9774080243","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M3_H0.5mm_9774005360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M3_H1.5mm_9774015360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M3_H10mm_9774100360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M3_H11mm_9774110360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M3_H12mm_9774120360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M3_H13mm_9774130360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M3_H14mm_9774140360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M3_H15mm_9774150360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M3_H16mm_9774160360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M3_H1mm_9774010360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M3_H2.5mm_9774025360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M3_H2mm_9774020360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M3_H3mm_9774030360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M3_H4mm_9774040360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M3_H5mm_9774050360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M3_H6mm_9774060360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M3_H7mm_9774070360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M3_H8mm_9774080360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M3_H9mm_9774090360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M4_H10mm_9774100482","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M4_H1mm_9774010482","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M4_H2mm_9774020482","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M4_H3mm_9774030482","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M4_H4mm_9774040482","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M4_H5mm_9774050482","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M4_H6mm_9774060482","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M4_H7mm_9774070482","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M4_H8mm_9774080482","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M4_H9mm_9774090482","Mounting_Wuerth/Mounting_Wuerth_WA-SMSR-3.2mm_H10.6mm_ReverseMount_9775106960","Mounting_Wuerth/Mounting_Wuerth_WA-SMSR-3.2mm_H11.6mm_ReverseMount_9775116960","Mounting_Wuerth/Mounting_Wuerth_WA-SMSR-3.2mm_H2.6mm_ReverseMount_9775026960","Mounting_Wuerth/Mounting_Wuerth_WA-SMSR-3.2mm_H3.1mm_ReverseMount_9775031960","Mounting_Wuerth/Mounting_Wuerth_WA-SMSR-3.2mm_H3.6mm_ReverseMount_9775036960","Mounting_Wuerth/Mounting_Wuerth_WA-SMSR-3.2mm_H4.1mm_ReverseMount_9775041960","Mounting_Wuerth/Mounting_Wuerth_WA-SMSR-3.2mm_H4.6mm_ReverseMount_9775046960","Mounting_Wuerth/Mounting_Wuerth_WA-SMSR-3.2mm_H5.1mm_ReverseMount_9775051960","Mounting_Wuerth/Mounting_Wuerth_WA-SMSR-3.2mm_H5.6mm_ReverseMount_9775056960","Mounting_Wuerth/Mounting_Wuerth_WA-SMSR-3.2mm_H6.6mm_ReverseMount_9775066960","Mounting_Wuerth/Mounting_Wuerth_WA-SMSR-3.2mm_H7.6mm_ReverseMount_9775076960","Mounting_Wuerth/Mounting_Wuerth_WA-SMSR-3.2mm_H8.6mm_ReverseMount_9775086960","Mounting_Wuerth/Mounting_Wuerth_WA-SMSR-3.2mm_H9.6mm_ReverseMount_9775096960","Mounting_Wuerth/Mounting_Wuerth_WA-SMSR-M3_H10.6mm_ReverseMount_9775106360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSR-M3_H11.6mm_ReverseMount_9775116360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSR-M3_H2.6mm_ReverseMount_9775026360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSR-M3_H3.1mm_ReverseMount_9775031360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSR-M3_H3.6mm_ReverseMount_9775036360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSR-M3_H4.1mm_ReverseMount_9775041360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSR-M3_H4.6mm_ReverseMount_9775046360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSR-M3_H5.1mm_ReverseMount_9775051360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSR-M3_H5.6mm_ReverseMount_9775056360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSR-M3_H6.6mm_ReverseMount_9775066360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSR-M3_H7.6mm_ReverseMount_9775076360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSR-M3_H8.6mm_ReverseMount_9775086360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSR-M3_H9.6mm_ReverseMount_9775096360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSSR-3.3mm_H10mm_SnapRivet_9776100960","Mounting_Wuerth/Mounting_Wuerth_WA-SMSSR-3.3mm_H2.5mm_SnapRivet_9776025960","Mounting_Wuerth/Mounting_Wuerth_WA-SMSSR-3.3mm_H2mm_SnapRivet_9776020960","Mounting_Wuerth/Mounting_Wuerth_WA-SMSSR-3.3mm_H3mm_SnapRivet_9776030960","Mounting_Wuerth/Mounting_Wuerth_WA-SMSSR-3.3mm_H4mm_SnapRivet_9776040960","Mounting_Wuerth/Mounting_Wuerth_WA-SMSSR-3.3mm_H5mm_SnapRivet_9776050960","Mounting_Wuerth/Mounting_Wuerth_WA-SMSSR-3.3mm_H6mm_SnapRivet_9776060960","Mounting_Wuerth/Mounting_Wuerth_WA-SMSSR-3.3mm_H7mm_SnapRivet_9776070960","Mounting_Wuerth/Mounting_Wuerth_WA-SMSSR-3.3mm_H8mm_SnapRivet_9776080960","Mounting_Wuerth/Mounting_Wuerth_WA-SMSSR-3.3mm_H9mm_SnapRivet_9776090960","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-2.25mm_H1.5mm_9774015943","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-2.25mm_H1mm_9774010943","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-2.25mm_H2.5mm_9774025943","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-2.25mm_H2mm_9774020943","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-2.25mm_H3.5mm_9774035943","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-2.25mm_H3mm_9774030943","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-2.25mm_H4.5mm_9774045943","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-2.25mm_H4mm_9774040943","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-2.25mm_H5mm_9774050943","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-2.25mm_H6mm_9774060943","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-2.25mm_H7mm_9774070943","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-2.25mm_H8mm_9774080943","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-2.7mm_H1.5mm_9774015951","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-2.7mm_H10mm_9774100951","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-2.7mm_H1mm_9774010951","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-2.7mm_H2.5mm_9774025951","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-2.7mm_H2mm_9774020951","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-2.7mm_H3mm_9774030951","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-2.7mm_H4mm_9774040951","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-2.7mm_H5.5mm_9774055951","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-2.7mm_H5mm_9774050951","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-2.7mm_H6.5mm_9774065951","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-2.7mm_H6mm_9774060951","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-2.7mm_H7mm_9774070951","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-2.7mm_H8mm_9774080951","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-2.7mm_H9mm_9774090951","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-3.3mm_H1.5mm_9774015960","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-3.3mm_H10mm_9774100960","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-3.3mm_H11mm_9774110960","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-3.3mm_H12mm_9774120960","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-3.3mm_H13mm_9774130960","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-3.3mm_H14mm_9774140960","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-3.3mm_H15mm_9774150960","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-3.3mm_H16mm_9774160960","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-3.3mm_H1mm_9774010960","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-3.3mm_H2.5mm_9774025960","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-3.3mm_H2mm_9774020960","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-3.3mm_H3mm_9774030960","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-3.3mm_H4mm_9774040960","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-3.3mm_H5mm_9774050960","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-3.3mm_H6mm_9774060960","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-3.3mm_H7mm_9774070960","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-3.3mm_H8mm_9774080960","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-3.3mm_H9mm_9774090960","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-4.5mm_H10mm_9774100982","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-4.5mm_H1mm_9774010982","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-4.5mm_H2mm_9774020982","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-4.5mm_H3mm_9774030982","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-4.5mm_H4mm_9774040982","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-4.5mm_H5mm_9774050982","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-4.5mm_H6mm_9774060982","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-4.5mm_H7mm_9774070982","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-4.5mm_H8mm_9774080982","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-4.5mm_H9mm_9774090982","Mounting_Wuerth/Mounting_Wuerth_WP-SMRA-D3.3mm_L7mm_7466300_Horizontal","Mounting_Wuerth/Mounting_Wuerth_WP-SMRA-M3_L7mm_7466303_Horizontal","NetTie/NetTie-2_SMD_Pad0.5mm","NetTie/NetTie-2_SMD_Pad2.0mm","NetTie/NetTie-2_THT_Pad0.3mm","NetTie/NetTie-2_THT_Pad1.0mm","NetTie/NetTie-3_SMD_Pad0.5mm","NetTie/NetTie-3_SMD_Pad2.0mm","NetTie/NetTie-3_THT_Pad0.3mm","NetTie/NetTie-3_THT_Pad1.0mm","NetTie/NetTie-4_SMD_Pad0.5mm","NetTie/NetTie-4_SMD_Pad2.0mm","NetTie/NetTie-4_THT_Pad0.3mm","NetTie/NetTie-4_THT_Pad1.0mm","OptoDevice/ADNS-9800","OptoDevice/AGILENT_HFBR-152x","OptoDevice/AGILENT_HFBR-252x","OptoDevice/AMS_TSL2550_SMD","OptoDevice/AMS_TSL25911FN","OptoDevice/Broadcom_AFBR-16xxZ_Horizontal","OptoDevice/Broadcom_AFBR-16xxZ_Tilted","OptoDevice/Broadcom_AFBR-16xxZ_Vertical","OptoDevice/Broadcom_APDS-9160-003","OptoDevice/Broadcom_APDS-9301","OptoDevice/Broadcom_DFN-6_2x2mm_P0.65mm","OptoDevice/Broadcom_LGA-8_2x2mm_P0.53mm","OptoDevice/Broadcom_LGA-8_2x2mm_P0.5mm","OptoDevice/Everlight_IRM-H6xxT","OptoDevice/Everlight_ITR1201SR10AR","OptoDevice/Everlight_ITR8307","OptoDevice/Everlight_ITR8307F43","OptoDevice/Everlight_ITR8307_Reverse","OptoDevice/Everlight_ITR9608-F","OptoDevice/Finder_34.81","OptoDevice/Hamamatsu_C12880","OptoDevice/Hamamatsu_S13360-30CS","OptoDevice/Hamamatsu_S14160-6050HS","OptoDevice/Kingbright_KPS-3227","OptoDevice/Kingbright_KPS-5130","OptoDevice/Kingbright_KRC011_Horizontal","OptoDevice/Kingbright_KRC011_Vertical","OptoDevice/Kodenshi_LG206D","OptoDevice/Kodenshi_LG206L","OptoDevice/Kodenshi_SG105","OptoDevice/Kodenshi_SG105F","OptoDevice/Kodenshi_SG105_Reverse","OptoDevice/LaserDiode_TO18-D5.6-3","OptoDevice/LaserDiode_TO3.3-D3.3-3","OptoDevice/LaserDiode_TO38ICut-3","OptoDevice/LaserDiode_TO5-D9-3","OptoDevice/LaserDiode_TO56-3","OptoDevice/Lightpipe_Bivar_RLP1-400-650","OptoDevice/Lightpipe_Bivar_SLP3-150-100-F","OptoDevice/Lightpipe_Bivar_SLP3-150-100-R","OptoDevice/Lightpipe_Bivar_SLP3-150-150-F","OptoDevice/Lightpipe_Bivar_SLP3-150-150-R","OptoDevice/Lightpipe_Bivar_SLP3-150-200-R","OptoDevice/Lightpipe_Bivar_SLP3-150-250-F","OptoDevice/Lightpipe_Bivar_SLP3-150-250-R","OptoDevice/Lightpipe_Bivar_SLP3-150-300-F","OptoDevice/Lightpipe_Bivar_SLP3-150-300-R","OptoDevice/Lightpipe_Bivar_SLP3-150-450-R","OptoDevice/Lightpipe_Dialight_515-1064F","OptoDevice/Lightpipe_LPF-C012303S","OptoDevice/Lightpipe_LPF-C013301S","OptoDevice/Lightpipe_Mentor_1275.x00x","OptoDevice/Lightpipe_Mentor_1276.1004","OptoDevice/Lightpipe_Mentor_1276.2004","OptoDevice/Lite-On_LTR-303ALS-01","OptoDevice/Luna_NSL-32","OptoDevice/Maxim_OLGA-14_3.3x5.6mm_P0.8mm","OptoDevice/ONSemi_QSE15x","OptoDevice/OnSemi_CASE100AQ","OptoDevice/OnSemi_CASE100CY","OptoDevice/Osram_BP104-SMD","OptoDevice/Osram_BPW34S-SMD","OptoDevice/Osram_BPW82","OptoDevice/Osram_DIL2_4.3x4.65mm_P5.08mm","OptoDevice/Osram_LPT80A","OptoDevice/Osram_SFH205","OptoDevice/Osram_SFH2201","OptoDevice/Osram_SFH225","OptoDevice/Osram_SFH2430","OptoDevice/Osram_SFH2440","OptoDevice/Osram_SFH3710","OptoDevice/Osram_SFH9x0x","OptoDevice/Osram_SMD-SmartDIL","OptoDevice/Panasonic_APV-AQY_SSOP-4_4.45x2.65mm_P1.27mm","OptoDevice/PerkinElmer_VTL5C","OptoDevice/PerkinElmer_VTL5Cx2","OptoDevice/R_LDR_10x8.5mm_P7.6mm_Vertical","OptoDevice/R_LDR_11x9.4mm_P8.2mm_Vertical","OptoDevice/R_LDR_12x10.8mm_P9.0mm_Vertical","OptoDevice/R_LDR_4.9x4.2mm_P2.54mm_Vertical","OptoDevice/R_LDR_5.0x4.1mm_P3mm_Vertical","OptoDevice/R_LDR_5.1x4.3mm_P3.4mm_Vertical","OptoDevice/R_LDR_5.2x5.2mm_P3.5mm_Horizontal","OptoDevice/R_LDR_7x6mm_P5.1mm_Vertical","OptoDevice/R_LDR_D13.8mm_P9.0mm_Vertical","OptoDevice/R_LDR_D20mm_P17.5mm_Vertical","OptoDevice/R_LDR_D6.4mm_P3.4mm_Vertical","OptoDevice/Renesas_DFN-6_1.5x1.6mm_P0.5mm","OptoDevice/Rohm_RPR-0720","OptoDevice/ST_VL53L0X","OptoDevice/Sharp_GP2S700HCP","OptoDevice/Sharp_GP2Y0A41SK0F","OptoDevice/Sharp_IS471F","OptoDevice/Sharp_IS485","OptoDevice/Siemens_SFH900","OptoDevice/Toshiba_TORX170_TORX173_TORX193_TORX194","OptoDevice/Toshiba_TOTX170_TOTX173_TOTX193_TOTX194","OptoDevice/Vishay_CAST-3Pin","OptoDevice/Vishay_CNY70","OptoDevice/Vishay_MINICAST-3Pin","OptoDevice/Vishay_MINIMOLD-3Pin","OptoDevice/Vishay_MOLD-3Pin","OptoDevice/Vishay_TCRT5000","Oscillator/Oscillator_DIP-14","Oscillator/Oscillator_DIP-14_LargePads","Oscillator/Oscillator_DIP-8","Oscillator/Oscillator_DIP-8_LargePads","Oscillator/Oscillator_OCXO_Morion_MV267","Oscillator/Oscillator_OCXO_Morion_MV317","Oscillator/Oscillator_SMD_Abracon_ABLNO","Oscillator/Oscillator_SMD_Abracon_ASCO-4Pin_1.6x1.2mm","Oscillator/Oscillator_SMD_Abracon_ASDMB-4Pin_2.5x2.0mm","Oscillator/Oscillator_SMD_Abracon_ASE-4Pin_3.2x2.5mm","Oscillator/Oscillator_SMD_Abracon_ASE-4Pin_3.2x2.5mm_HandSoldering","Oscillator/Oscillator_SMD_Abracon_ASV-4Pin_7.0x5.1mm","Oscillator/Oscillator_SMD_Abracon_ASV-4Pin_7.0x5.1mm_HandSoldering","Oscillator/Oscillator_SMD_Diodes_FN-4Pin_7.0x5.0mm","Oscillator/Oscillator_SMD_ECS_2520MV-xxx-xx-4Pin_2.5x2.0mm","Oscillator/Oscillator_SMD_EuroQuartz_XO32-4Pin_3.2x2.5mm","Oscillator/Oscillator_SMD_EuroQuartz_XO32-4Pin_3.2x2.5mm_RotB","Oscillator/Oscillator_SMD_EuroQuartz_XO32-4Pin_3.2x2.5mm_RotB_HandSoldering","Oscillator/Oscillator_SMD_EuroQuartz_XO53-4Pin_5.0x3.2mm","Oscillator/Oscillator_SMD_EuroQuartz_XO53-4Pin_5.0x3.2mm_HandSoldering","Oscillator/Oscillator_SMD_EuroQuartz_XO91-4Pin_7.0x5.0mm","Oscillator/Oscillator_SMD_EuroQuartz_XO91-4Pin_7.0x5.0mm_HandSoldering","Oscillator/Oscillator_SMD_Fordahl_DFAS1-6Pin_14.8x9.1mm","Oscillator/Oscillator_SMD_Fordahl_DFAS11-4Pin_7.0x5.0mm","Oscillator/Oscillator_SMD_Fordahl_DFAS11-4Pin_7.0x5.0mm_HandSoldering","Oscillator/Oscillator_SMD_Fordahl_DFAS15-4Pin_5.0x3.2mm","Oscillator/Oscillator_SMD_Fordahl_DFAS15-4Pin_5.0x3.2mm_HandSoldering","Oscillator/Oscillator_SMD_Fordahl_DFAS2-4Pin_7.3x5.1mm","Oscillator/Oscillator_SMD_Fordahl_DFAS2-4Pin_7.3x5.1mm_HandSoldering","Oscillator/Oscillator_SMD_Fordahl_DFAS3-4Pin_9.1x7.2mm","Oscillator/Oscillator_SMD_Fordahl_DFAS3-4Pin_9.1x7.2mm_HandSoldering","Oscillator/Oscillator_SMD_Fordahl_DFAS7-4Pin_19.9x12.9mm","Oscillator/Oscillator_SMD_Fordahl_DFAS7-4Pin_19.9x12.9mm_HandSoldering","Oscillator/Oscillator_SMD_Fox_FT5H_5.0x3.2mm","Oscillator/Oscillator_SMD_IDT_JS6-6_5.0x3.2mm_P1.27mm","Oscillator/Oscillator_SMD_IDT_JU6-6_7.0x5.0mm_P2.54mm","Oscillator/Oscillator_SMD_IQD_IQXO70-4Pin_7.5x5.0mm","Oscillator/Oscillator_SMD_IQD_IQXO70-4Pin_7.5x5.0mm_HandSoldering","Oscillator/Oscillator_SMD_Kyocera_2520-6Pin_2.5x2.0mm","Oscillator/Oscillator_SMD_Kyocera_KC2520Z-4Pin_2.5x2.0mm","Oscillator/Oscillator_SMD_OCXO_ConnorWinfield_OH300","Oscillator/Oscillator_SMD_SI570_SI571_HandSoldering","Oscillator/Oscillator_SMD_SI570_SI571_Standard","Oscillator/Oscillator_SMD_SeikoEpson_SG210-4Pin_2.5x2.0mm","Oscillator/Oscillator_SMD_SeikoEpson_SG210-4Pin_2.5x2.0mm_HandSoldering","Oscillator/Oscillator_SMD_SeikoEpson_SG3030CM","Oscillator/Oscillator_SMD_SeikoEpson_SG8002CA-4Pin_7.0x5.0mm","Oscillator/Oscillator_SMD_SeikoEpson_SG8002CA-4Pin_7.0x5.0mm_HandSoldering","Oscillator/Oscillator_SMD_SeikoEpson_SG8002CE-4Pin_3.2x2.5mm","Oscillator/Oscillator_SMD_SeikoEpson_SG8002CE-4Pin_3.2x2.5mm_HandSoldering","Oscillator/Oscillator_SMD_SeikoEpson_SG8002JA-4Pin_14.0x8.7mm","Oscillator/Oscillator_SMD_SeikoEpson_SG8002JA-4Pin_14.0x8.7mm_HandSoldering","Oscillator/Oscillator_SMD_SeikoEpson_SG8002JC-4Pin_10.5x5.0mm","Oscillator/Oscillator_SMD_SeikoEpson_SG8002JC-4Pin_10.5x5.0mm_HandSoldering","Oscillator/Oscillator_SMD_SeikoEpson_SG8002LB-4Pin_5.0x3.2mm","Oscillator/Oscillator_SMD_SeikoEpson_SG8002LB-4Pin_5.0x3.2mm_HandSoldering","Oscillator/Oscillator_SMD_SeikoEpson_TG2520SMN-xxx-xxxxxx-4Pin_2.5x2.0mm","Oscillator/Oscillator_SMD_SiT_PQFN-4Pin_2.0x1.6mm","Oscillator/Oscillator_SMD_SiT_PQFN-4Pin_2.5x2.0mm","Oscillator/Oscillator_SMD_SiT_PQFN-4Pin_3.2x2.5mm","Oscillator/Oscillator_SMD_SiT_PQFN-4Pin_5.0x3.2mm","Oscillator/Oscillator_SMD_SiT_PQFN-4Pin_7.0x5.0mm","Oscillator/Oscillator_SMD_SiTime_PQFD-6L_3.2x2.5mm","Oscillator/Oscillator_SMD_SiTime_SiT9121-6Pin_3.2x2.5mm","Oscillator/Oscillator_SMD_Silicon_Labs_LGA-6_2.5x3.2mm_P1.25mm","Oscillator/Oscillator_SMD_TCXO_G158","Oscillator/Oscillator_SMD_TXC_7C-4Pin_5.0x3.2mm","Oscillator/Oscillator_SMD_TXC_7C-4Pin_5.0x3.2mm_HandSoldering","Oscillator/Oscillator_SeikoEpson_SG-8002DB","Oscillator/Oscillator_SeikoEpson_SG-8002DC","Package_BGA/Alliance_TFBGA-36_6x8mm_Layout6x8_P0.75mm","Package_BGA/Alliance_TFBGA-54_8x8mm_Layout9x9_P0.8mm","Package_BGA/Analog_BGA-165_11.9x16mm_Layout11x15_P1.0mm","Package_BGA/Analog_BGA-209_9.5x16mm_Layout11x19_P0.8mm","Package_BGA/Analog_BGA-28_4x6.25mm_Layout4x7_P0.8mm","Package_BGA/Analog_BGA-49_6.25x6.25mm_Layout7x7_P0.8mm","Package_BGA/Analog_BGA-77_9x15mm_Layout7x11_P1.27mm","Package_BGA/BGA-100_11.0x11.0mm_Layout10x10_P1.0mm_Ball0.5mm_Pad0.4mm_NSMD","Package_BGA/BGA-100_12x18mm_Layout10x17_P1mm","Package_BGA/BGA-100_14x18mm_Layout10x17_P1mm","Package_BGA/BGA-100_6.0x6.0mm_Layout11x11_P0.5mm_Ball0.3mm_Pad0.25mm_NSMD","Package_BGA/BGA-1023_33.0x33.0mm_Layout32x32_P1.0mm","Package_BGA/BGA-1156_35.0x35.0mm_Layout34x34_P1.0mm","Package_BGA/BGA-121_9.0x9.0mm_Layout11x11_P0.8mm_Ball0.4mm_Pad0.35mm_NSMD","Package_BGA/BGA-1295_37.5x37.5mm_Layout36x36_P1.0mm","Package_BGA/BGA-132_12x18mm_Layout11x17_P1.0mm","Package_BGA/BGA-132_12x18mm_Layout11x17_P1mm","Package_BGA/BGA-144_13.0x13.0mm_Layout12x12_P1.0mm","Package_BGA/BGA-144_7.0x7.0mm_Layout13x13_P0.5mm_Ball0.3mm_Pad0.25mm_NSMD","Package_BGA/BGA-152_14x18mm_Layout13x17_P0.5mm","Package_BGA/BGA-152_14x18mm_Layout13x17_P1mm","Package_BGA/BGA-153_8.0x8.0mm_Layout15x15_P0.5mm_Ball0.3mm_Pad0.25mm_NSMD","Package_BGA/BGA-169_11.0x11.0mm_Layout13x13_P0.8mm_Ball0.5mm_Pad0.4mm_NSMD","Package_BGA/BGA-16_1.92x1.92mm_Layout4x4_P0.5mm","Package_BGA/BGA-196_15x15mm_Layout14x14_P1.0mm","Package_BGA/BGA-200_10x14.5mm_Layout12x22_P0.8x0.65mm","Package_BGA/BGA-24_6x8mm_Layout5x5_P1.0mm","Package_BGA/BGA-24_8x8mm_Layout5x5_P1.0mm","Package_BGA/BGA-256_11.0x11.0mm_Layout20x20_P0.5mm_Ball0.3mm_Pad0.25mm_NSMD","Package_BGA/BGA-256_14.0x14.0mm_Layout16x16_P0.8mm_Ball0.45mm_Pad0.32mm_NSMD","Package_BGA/BGA-256_17.0x17.0mm_Layout16x16_P1.0mm_Ball0.5mm_Pad0.4mm_NSMD","Package_BGA/BGA-25_6.35x6.35mm_Layout5x5_P1.27mm","Package_BGA/BGA-324_15.0x15.0mm_Layout18x18_P0.8mm_Ball0.5mm_Pad0.4mm_NSMD","Package_BGA/BGA-324_15x15mm_Layout18x18_P0.8mm","Package_BGA/BGA-324_19.0x19.0mm_Layout18x18_P1.0mm_Ball0.5mm_Pad0.4mm_NSMD","Package_BGA/BGA-352_35.0x35.0mm_Layout26x26_P1.27mm","Package_BGA/BGA-36_3.396x3.466mm_Layout6x6_P0.4mm_Ball0.25mm_Pad0.2mm_NSMD","Package_BGA/BGA-400_21.0x21.0mm_Layout20x20_P1.0mm","Package_BGA/BGA-484_23.0x23.0mm_Layout22x22_P1.0mm","Package_BGA/BGA-48_8.0x9.0mm_Layout6x8_P0.8mm","Package_BGA/BGA-529_19x19mm_Layout23x23_P0.8mm","Package_BGA/BGA-624_21x21mm_Layout25x25_P0.8mm","Package_BGA/BGA-625_21.0x21.0mm_Layout25x25_P0.8mm","Package_BGA/BGA-63_9x11mm_Layout10x12_P0.8mm","Package_BGA/BGA-64_9.0x9.0mm_Layout10x10_P0.8mm","Package_BGA/BGA-672_27.0x27.0mm_Layout26x26_P1.0mm_Ball0.6mm_Pad0.5mm_NSMD","Package_BGA/BGA-676_27.0x27.0mm_Layout26x26_P1.0mm_Ball0.6mm_Pad0.5mm_NSMD","Package_BGA/BGA-68_5.0x5.0mm_Layout9x9_P0.5mm_Ball0.3mm_Pad0.25mm_NSMD","Package_BGA/BGA-81_4.496x4.377mm_Layout9x9_P0.4mm_Ball0.25mm_Pad0.2mm_NSMD","Package_BGA/BGA-90_8.0x13.0mm_Layout2x3x15_P0.8mm","Package_BGA/BGA-96_9.0x13.0mm_Layout2x3x16_P0.8mm","Package_BGA/BGA-9_1.6x1.6mm_Layout3x3_P0.5mm","Package_BGA/EPC_BGA-4_0.9x0.9mm_Layout2x2_P0.45mm","Package_BGA/FB-BGA-484_23.0x23.0mm_Layout22x22_P1.0mm","Package_BGA/FBGA-78_7.5x10.5mm_Layout9x13_P0.8mm","Package_BGA/FBGA-78_7.5x10.6mm_Layout9x13_P0.8mm","Package_BGA/FBGA-78_7.5x11mm_Layout2x3x13_P0.8mm","Package_BGA/FBGA-78_8x10.5mm_Layout9x13_P0.8mm","Package_BGA/FBGA-78_9x10.5mm_Layout9x13_P0.8mm","Package_BGA/FBGA-78_9x10.6mm_Layout9x13_P0.8mm","Package_BGA/FBGA-96_7.5x13.5mm_Layout9x16_P0.8mm","Package_BGA/FBGA-96_7.5x13mm_Layout9x16_P0.8mm","Package_BGA/FBGA-96_8x13mm_Layout9x16_P0.8mm","Package_BGA/FBGA-96_8x14mm_Layout9x16_P0.8mm","Package_BGA/FBGA-96_9x13mm_Layout9x16_P0.8mm","Package_BGA/FBGA-96_9x14mm_Layout9x16_P0.8mm","Package_BGA/FCPBGA-780_23x23mm_Layout28x28_P0.8mm","Package_BGA/Fujitsu_WLP-15_2.28x3.092mm_Layout3x5_P0.4mm","Package_BGA/Infineon_LFBGA-292_17x17mm_Layout20x20_P0.8mm","Package_BGA/Infineon_TFBGA-48_6x10mm_Layout6x8_P0.75mm","Package_BGA/LFBGA-100_10x10mm_Layout10x10_P0.8mm","Package_BGA/LFBGA-144_10x10mm_Layout12x12_P0.8mm","Package_BGA/LFBGA-153_11.5x13mm_Layout14x14_P0.5mm","Package_BGA/LFBGA-169_12x16mm_Layout14x28_P0.5mm","Package_BGA/LFBGA-169_12x18mm_Layout14x28_P0.5mm","Package_BGA/LFBGA-169_14x18mm_Layout14x28_P0.5mm","Package_BGA/LFBGA-289_14x14mm_Layout17x17_P0.8mm","Package_BGA/LFBGA-400_16x16mm_Layout20x20_P0.8mm","Package_BGA/LFBGA-484_18x18mm_Layout22x22_P0.8mm","Package_BGA/Lattice_caBGA-381_17x17mm_Layout20x20_P0.8mm","Package_BGA/Lattice_caBGA-381_17x17mm_Layout20x20_P0.8mm_SMD","Package_BGA/Lattice_caBGA-756_27x27mm_Layout32x32_P0.8mm","Package_BGA/Lattice_iCE40_csBGA-132_8x8mm_Layout14x14_P0.5mm","Package_BGA/Linear_BGA-133_15.0x15.0mm_Layout12x12_P1.27mm","Package_BGA/MAPBGA-272_9x9mm_Layout17x17_P0.5mm","Package_BGA/MAPBGA-289_14x14mm_Layout17x17_P0.8mm","Package_BGA/Maxim_WLP-12","Package_BGA/Maxim_WLP-12_2.008x1.608mm_Layout4x3_P0.4mm","Package_BGA/Maxim_WLP-9_1.595x1.415_Layout3x3_P0.4mm_Ball0.27mm_Pad0.25mm_NSMD","Package_BGA/Microchip_FCG1152_BGA-1152_35x35mm_Layout34x34_P1.0mm","Package_BGA/Microchip_FCSG325_BGA-325_11x11mm_Layout21x21_P0.5mm","Package_BGA/Microchip_FCSG536_BGA-536_16x16mm_Layout30x30_P0.5mm","Package_BGA/Microchip_FCVG484_BGA-484_19x19mm_Layout22x22_P0.8mm","Package_BGA/Microchip_FCVG784_BGA-784_23x23mm_Layout28x28_P0.8mm","Package_BGA/Microchip_TFBGA-196_11x11mm_Layout14x14_P0.75mm_SMD","Package_BGA/Micron_FBGA-78_7.5x10.6mm_Layout9x13_P0.8mm","Package_BGA/Micron_FBGA-78_8x10.5mm_Layout9x13_P0.8mm","Package_BGA/Micron_FBGA-78_9x10.5mm_Layout9x13_P0.8mm","Package_BGA/Micron_FBGA-96_7.5x13.5mm_Layout9x16_P0.8mm","Package_BGA/Micron_FBGA-96_8x14mm_Layout9x16_P0.8mm","Package_BGA/Micron_FBGA-96_9x14mm_Layout9x16_P0.8mm","Package_BGA/NXP_SOT1982-1_VFBGA-98_7x7mm_Layout13x13_P0.5mm","Package_BGA/NXP_SOT2162-1_VFBGA-59_4x4mm_Layout9x9_P0.4mm","Package_BGA/NXP_TFBGA-50_5x5mm_Layout9x9_P0.5mm","Package_BGA/NXP_VFBGA-42_2.6x3mm_Layout6x7_P0.4mm","Package_BGA/ST_LFBGA-354_16x16mm_Layout19x19_P0.8mm","Package_BGA/ST_LFBGA-448_18x18mm_Layout22x22_P0.8mm","Package_BGA/ST_TFBGA-169_7x7mm_Layout13x13_P0.5mm","Package_BGA/ST_TFBGA-225_13x13mm_Layout15x15_P0.8mm","Package_BGA/ST_TFBGA-257_10x10mm_Layout19x19_P0.5mmP0.65mm","Package_BGA/ST_TFBGA-320_11x11mm_Layout21x21_P0.5mm","Package_BGA/ST_TFBGA-361_12x12mm_Layout23x23_P0.5mmP0.65mm","Package_BGA/ST_TFBGA-436_18x18mm_Layout22x22_P0.8mm","Package_BGA/ST_UFBGA-121_6x6mm_Layout11x11_P0.5mm","Package_BGA/ST_UFBGA-129_7x7mm_Layout13x13_P0.5mm","Package_BGA/ST_UFBGA-59_5x5mm_Layout8x8_P0.5mm","Package_BGA/ST_UFBGA-73_5x5mm_Layout9x9_P0.5mm","Package_BGA/ST_UFBGA-81_5x5mm_Layout9x9_P0.5mm","Package_BGA/ST_VFBGA-361_10x10mm_Layout19x19_P0.5mm","Package_BGA/ST_VFBGA-424_14x14mm_Layout27x27_P0.5mmP0.5x0.5mm_Stagger","Package_BGA/ST_uTFBGA-36_3.6x3.6mm_Layout6x6_P0.5mm","Package_BGA/TFBGA-100_5.5x5.5mm_Layout10x10_P0.5mm","Package_BGA/TFBGA-100_8x8mm_Layout10x10_P0.8mm","Package_BGA/TFBGA-100_9.0x9.0mm_Layout10x10_P0.8mm","Package_BGA/TFBGA-121_10x10mm_Layout11x11_P0.8mm","Package_BGA/TFBGA-169_9x9mm_Layout13x13_P0.65mm","Package_BGA/TFBGA-216_13x13mm_Layout15x15_P0.8mm","Package_BGA/TFBGA-225_10x10mm_Layout15x15_P0.65mm","Package_BGA/TFBGA-256_13x13mm_Layout16x16_P0.8mm","Package_BGA/TFBGA-265_14x14mm_Layout17x17_P0.8mm","Package_BGA/TFBGA-289_9x9mm_Layout17x17_P0.5mm","Package_BGA/TFBGA-324_12x12mm_Layout18x18_P0.65mm","Package_BGA/TFBGA-361_13x13mm_Layout19x19_P0.65mm","Package_BGA/TFBGA-48_6x10mm_Layout6x8_P0.75mm","Package_BGA/TFBGA-49_3x3mm_Layout7x7_P0.4mm","Package_BGA/TFBGA-576_16x16mm_Layout24x24_P0.65mm","Package_BGA/TFBGA-644_19x19mm_Layout28x28_P0.65mm","Package_BGA/TFBGA-64_5x5mm_Layout8x8_P0.5mm","Package_BGA/TFBGA-81_5x5mm_Layout9x9_P0.5mm","Package_BGA/Texas_BGA-289_15x15mm_Layout17x17_P0.8mm","Package_BGA/Texas_DSBGA-10_1.36x1.86mm_Layout3x4_P0.5mm","Package_BGA/Texas_DSBGA-12_1.36x1.86mm_Layout3x4_P0.5mm","Package_BGA/Texas_DSBGA-12_2.11x1.61mm_Layout4x3_P0.5mm","Package_BGA/Texas_DSBGA-16_2.39x2.39mm_Layout4x4_P0.5mm","Package_BGA/Texas_DSBGA-28_1.9x3mm_Layout4x7_P0.4mm","Package_BGA/Texas_DSBGA-49_3.33x3.488mm_Layout7x7_P0.4mm","Package_BGA/Texas_DSBGA-5_0.822x1.116mm_Layout2x1x2_P0.4mm","Package_BGA/Texas_DSBGA-5_0.8875x1.3875mm_Layout2x3_P0.5mm","Package_BGA/Texas_DSBGA-5_1.5855x1.6365mm_Layout3x2_P0.5mm","Package_BGA/Texas_DSBGA-64_3.415x3.535mm_Layout8x8_P0.4mm","Package_BGA/Texas_DSBGA-6_0.704x1.054mm_Layout2x3_P0.35mm","Package_BGA/Texas_DSBGA-6_0.757x1.01mm_Layout2x3_P0.35mm","Package_BGA/Texas_DSBGA-6_0.76x1.16mm_Layout2x3_P0.4mm","Package_BGA/Texas_DSBGA-6_0.855x1.255mm_Layout2x3_P0.4mm_LevelB","Package_BGA/Texas_DSBGA-6_0.855x1.255mm_Layout2x3_P0.4mm_LevelC","Package_BGA/Texas_DSBGA-6_0.95x1.488mm_Layout2x3_P0.4mm","Package_BGA/Texas_DSBGA-6_0.9x1.4mm_Layout2x3_P0.5mm","Package_BGA/Texas_DSBGA-8_0.705x1.468mm_Layout2x4_P0.4mm","Package_BGA/Texas_DSBGA-8_0.9x1.9mm_Layout2x4_P0.5mm","Package_BGA/Texas_DSBGA-8_1.43x1.41mm_Layout3x3_P0.5mm","Package_BGA/Texas_DSBGA-8_1.5195x1.5195mm_Layout3x3_P0.5mm","Package_BGA/Texas_DSBGA-9_1.4715x1.4715mm_Layout3x3_P0.5mm","Package_BGA/Texas_DSBGA-9_1.62x1.58mm_Layout3x3_P0.5mm","Package_BGA/Texas_MicroStar_Junior_BGA-113_7x7mm_Layout12x12_P0.5mm","Package_BGA/Texas_MicroStar_Junior_BGA-12_2.0x2.5mm_Layout4x3_P0.5mm","Package_BGA/Texas_MicroStar_Junior_BGA-80_5.0x5.0mm_Layout9x9_P0.5mm","Package_BGA/Texas_PicoStar_BGA-4_0.758x0.758mm_Layout2x2_P0.4mm","Package_BGA/Texas_YFP0020_DSBGA-20_1.588x1.988mm_Layout4x5_P0.4mm","Package_BGA/UCBGA-36_2.5x2.5mm_Layout6x6_P0.4mm","Package_BGA/UCBGA-49_3x3mm_Layout7x7_P0.4mm","Package_BGA/UCBGA-81_4x4mm_Layout9x9_P0.4mm","Package_BGA/UFBGA-100_7x7mm_Layout12x12_P0.5mm","Package_BGA/UFBGA-132_7x7mm_Layout12x12_P0.5mm","Package_BGA/UFBGA-132_7x7mm_P0.5mm","Package_BGA/UFBGA-144_10x10mm_Layout12x12_P0.8mm","Package_BGA/UFBGA-144_7x7mm_Layout12x12_P0.5mm","Package_BGA/UFBGA-15_3.0x3.0mm_Layout4x4_P0.65mm","Package_BGA/UFBGA-169_7x7mm_Layout13x13_P0.5mm","Package_BGA/UFBGA-201_10x10mm_Layout15x15_P0.65mm","Package_BGA/UFBGA-32_4.0x4.0mm_Layout6x6_P0.5mm","Package_BGA/UFBGA-64_5x5mm_Layout8x8_P0.5mm","Package_BGA/VFBGA-100_7.0x7.0mm_Layout10x10_P0.65mm","Package_BGA/VFBGA-49_5.0x5.0mm_Layout7x7_P0.65mm","Package_BGA/VFBGA-86_6x6mm_Layout10x10_P0.55mm","Package_BGA/WLP-4_0.728x0.728mm_Layout2x2_P0.35mm","Package_BGA/WLP-4_0.83x0.83mm_P0.4mm","Package_BGA/WLP-4_0.86x0.86mm_P0.4mm","Package_BGA/WLP-9_1.468x1.448mm_Layout3x3_P0.4mm","Package_BGA/XBGA-121_10x10mm_Layout11x11_P0.8mm","Package_BGA/XFBGA-121_8x8mm_Layout11x11_P0.65mm","Package_BGA/XFBGA-36_3.5x3.5mm_Layout6x6_P0.5mm","Package_BGA/XFBGA-64_5.0x5.0mm_Layout8x8_P0.5mm","Package_BGA/Xilinx_CLG225","Package_BGA/Xilinx_CLG400","Package_BGA/Xilinx_CLG484_CLG485","Package_BGA/Xilinx_CPG236","Package_BGA/Xilinx_CPG238","Package_BGA/Xilinx_CPGA196","Package_BGA/Xilinx_CSG324","Package_BGA/Xilinx_CSG325","Package_BGA/Xilinx_CSGA225","Package_BGA/Xilinx_CSGA324","Package_BGA/Xilinx_FBG484","Package_BGA/Xilinx_FBG676","Package_BGA/Xilinx_FBG900","Package_BGA/Xilinx_FFG1156","Package_BGA/Xilinx_FFG1157_FFG1158","Package_BGA/Xilinx_FFG1761","Package_BGA/Xilinx_FFG1926_FFG1927_FFG1928_FFG1930","Package_BGA/Xilinx_FFG676","Package_BGA/Xilinx_FFG900_FFG901","Package_BGA/Xilinx_FFV1761","Package_BGA/Xilinx_FGG484","Package_BGA/Xilinx_FGG676","Package_BGA/Xilinx_FGGA484","Package_BGA/Xilinx_FGGA676","Package_BGA/Xilinx_FHG1761","Package_BGA/Xilinx_FLG1925_FLG1926_FLG1928_FLG1930","Package_BGA/Xilinx_FTG256","Package_BGA/Xilinx_FTGB196","Package_BGA/Xilinx_RB484","Package_BGA/Xilinx_RB676","Package_BGA/Xilinx_RF1156","Package_BGA/Xilinx_RF1157_RF1158","Package_BGA/Xilinx_RF1761","Package_BGA/Xilinx_RF1930","Package_BGA/Xilinx_RF676","Package_BGA/Xilinx_RF900","Package_BGA/Xilinx_RFG676","Package_BGA/Xilinx_RS484","Package_BGA/Xilinx_SBG484","Package_BGA/Xilinx_SBG485","Package_BGA/csBGA-64_5x5mm_Layout8x8_P0.5mm","Package_BGA/ucBGA-64_4x4mm_Layout8x8_P0.4mm","Package_CSP/Analog_LFCSP-16-1EP_4x4mm_P0.65mm_EP2.1x2.1mm","Package_CSP/Analog_LFCSP-16-1EP_4x4mm_P0.65mm_EP2.1x2.1mm_ThermalVias","Package_CSP/Analog_LFCSP-16-1EP_4x4mm_P0.65mm_EP2.35x2.35mm","Package_CSP/Analog_LFCSP-16-1EP_4x4mm_P0.65mm_EP2.35x2.35mm_ThermalVias","Package_CSP/Analog_LFCSP-8-1EP_3x3mm_P0.5mm_EP1.53x1.85mm","Package_CSP/Analog_LFCSP-UQ-10_1.3x1.6mm_P0.4mm","Package_CSP/Anpec_WLCSP-20_1.76x2.03mm_Layout4x5_P0.4mm","Package_CSP/Dialog_WLCSP-34_4.54x1.66mm_Layout17x4_P0.25x0.34mm","Package_CSP/DiodesInc_GEA20_WLCSP-20_1.7x2.1mm_Layout4x5_P0.4mm","Package_CSP/Efinix_WLCSP-64_3.5353x3.3753mm_Layout8x8_P0.4mm","Package_CSP/Efinix_WLCSP-80_4.4567x3.5569mm_Layout10x8_P0.4mm","Package_CSP/LFCSP-10_2x2mm_P0.5mm","Package_CSP/LFCSP-16-1EP_3x3mm_P0.5mm_EP1.3x1.3mm","Package_CSP/LFCSP-16-1EP_3x3mm_P0.5mm_EP1.3x1.3mm_ThermalVias","Package_CSP/LFCSP-16-1EP_3x3mm_P0.5mm_EP1.5x1.5mm","Package_CSP/LFCSP-16-1EP_3x3mm_P0.5mm_EP1.6x1.6mm","Package_CSP/LFCSP-16-1EP_3x3mm_P0.5mm_EP1.6x1.6mm_ThermalVias","Package_CSP/LFCSP-16-1EP_3x3mm_P0.5mm_EP1.7x1.7mm","Package_CSP/LFCSP-16-1EP_3x3mm_P0.5mm_EP1.7x1.7mm_ThermalVias","Package_CSP/LFCSP-16-1EP_3x3mm_P0.5mm_EP1.854x1.854mm","Package_CSP/LFCSP-16-1EP_4x4mm_P0.65mm_EP2.1x2.1mm","Package_CSP/LFCSP-16-1EP_4x4mm_P0.65mm_EP2.4x2.4mm","Package_CSP/LFCSP-16-1EP_4x4mm_P0.65mm_EP2.4x2.4mm_ThermalVias","Package_CSP/LFCSP-16-1EP_4x4mm_P0.65mm_EP2.6x2.6mm","Package_CSP/LFCSP-16-1EP_4x4mm_P0.65mm_EP2.6x2.6mm_ThermalVias","Package_CSP/LFCSP-16_3x3mm_P0.5mm","Package_CSP/LFCSP-20-1EP_4x4mm_P0.5mm_EP2.1x2.1mm","Package_CSP/LFCSP-20-1EP_4x4mm_P0.5mm_EP2.1x2.1mm_ThermalVias","Package_CSP/LFCSP-20-1EP_4x4mm_P0.5mm_EP2.5x2.5mm","Package_CSP/LFCSP-20-1EP_4x4mm_P0.5mm_EP2.5x2.5mm_ThermalVias","Package_CSP/LFCSP-20-1EP_4x4mm_P0.5mm_EP2.6x2.6mm","Package_CSP/LFCSP-20-1EP_4x4mm_P0.5mm_EP2.6x2.6mm_ThermalVias","Package_CSP/LFCSP-24-1EP_4x4mm_P0.5mm_EP0.5x0.5mm","Package_CSP/LFCSP-24-1EP_4x4mm_P0.5mm_EP2.3x2.3mm","Package_CSP/LFCSP-24-1EP_4x4mm_P0.5mm_EP2.3x2.3mm_ThermalVias","Package_CSP/LFCSP-24-1EP_4x4mm_P0.5mm_EP2.5x2.5mm","Package_CSP/LFCSP-24-1EP_4x4mm_P0.5mm_EP2.5x2.5mm_ThermalVias","Package_CSP/LFCSP-28-1EP_5x5mm_P0.5mm_EP3.14x3.14mm","Package_CSP/LFCSP-28-1EP_5x5mm_P0.5mm_EP3.14x3.14mm_ThermalVias","Package_CSP/LFCSP-32-1EP_5x5mm_P0.5mm_EP3.1x3.1mm","Package_CSP/LFCSP-32-1EP_5x5mm_P0.5mm_EP3.1x3.1mm_ThermalVias","Package_CSP/LFCSP-32-1EP_5x5mm_P0.5mm_EP3.25x3.25mm","Package_CSP/LFCSP-32-1EP_5x5mm_P0.5mm_EP3.5x3.5mm","Package_CSP/LFCSP-32-1EP_5x5mm_P0.5mm_EP3.5x3.5mm_ThermalVias","Package_CSP/LFCSP-32-1EP_5x5mm_P0.5mm_EP3.6x3.6mm","Package_CSP/LFCSP-32-1EP_5x5mm_P0.5mm_EP3.6x3.6mm_ThermalVias","Package_CSP/LFCSP-40-1EP_6x6mm_P0.5mm_EP3.9x3.9mm","Package_CSP/LFCSP-40-1EP_6x6mm_P0.5mm_EP3.9x3.9mm_ThermalVias","Package_CSP/LFCSP-40-1EP_6x6mm_P0.5mm_EP4.65x4.65mm","Package_CSP/LFCSP-40-1EP_6x6mm_P0.5mm_EP4.65x4.65mm_ThermalVias","Package_CSP/LFCSP-40-1EP_6x6mm_P0.5mm_EP4.6x4.6mm","Package_CSP/LFCSP-40-1EP_6x6mm_P0.5mm_EP4.6x4.6mm_ThermalVias","Package_CSP/LFCSP-48-1EP_7x7mm_P0.5mm_EP4.1x4.1mm","Package_CSP/LFCSP-48-1EP_7x7mm_P0.5mm_EP4.1x4.1mm_ThermalVias","Package_CSP/LFCSP-56-1EP_8x8mm_P0.5mm_EP6.6x6.6mm","Package_CSP/LFCSP-56-1EP_8x8mm_P0.5mm_EP6.6x6.6mm_ThermalVias","Package_CSP/LFCSP-6-1EP_2x2mm_P0.65mm_EP1x1.6mm","Package_CSP/LFCSP-64-1EP_9x9mm_P0.5mm_EP5.21x5.21mm","Package_CSP/LFCSP-64-1EP_9x9mm_P0.5mm_EP5.21x5.21mm_ThermalVias","Package_CSP/LFCSP-72-1EP_10x10mm_P0.5mm_EP5.3x5.3mm","Package_CSP/LFCSP-72-1EP_10x10mm_P0.5mm_EP5.3x5.3mm_ThermalVias","Package_CSP/LFCSP-72-1EP_10x10mm_P0.5mm_EP6.15x6.15mm","Package_CSP/LFCSP-8-1EP_3x2mm_P0.5mm_EP1.6x1.65mm","Package_CSP/LFCSP-8-1EP_3x3mm_P0.5mm_EP1.45x1.74mm","Package_CSP/LFCSP-8-1EP_3x3mm_P0.5mm_EP1.6x2.34mm","Package_CSP/LFCSP-8-1EP_3x3mm_P0.5mm_EP1.6x2.34mm_ThermalVias","Package_CSP/LFCSP-8_2x2mm_P0.5mm","Package_CSP/LFCSP-VQ-24-1EP_4x4mm_P0.5mm_EP2.642x2.642mm","Package_CSP/LFCSP-VQ-48-1EP_7x7mm_P0.5mm","Package_CSP/LFCSP-WD-10-1EP_3x3mm_P0.5mm_EP1.64x2.38mm","Package_CSP/LFCSP-WD-10-1EP_3x3mm_P0.5mm_EP1.64x2.38mm_ThermalVias","Package_CSP/LFCSP-WD-8-1EP_3x3mm_P0.65mm_EP1.6x2.44mm","Package_CSP/LFCSP-WD-8-1EP_3x3mm_P0.65mm_EP1.6x2.44mm_ThermalVias","Package_CSP/Macronix_WLCSP-12_2.02x2.09mm_Layout4x4_P0.5mm","Package_CSP/Maxim_WLCSP-35_2.998x2.168mm_Layout7x5_P0.4mm","Package_CSP/NXP_SOT1444-5_WLCSP-49_3.44x3.44mm_Layout7x7_P0.4mm","Package_CSP/NXP_SOT1450-2_WLCSP-100_5.07x5.07mm_Layout10x10_P0.5mm","Package_CSP/Nexperia_WLCSP-15_2.37x1.17mm_Layout6x3_P0.4mmP0.8mm","Package_CSP/OnSemi_ODCSP36_BGA-36_6.13x6.13mm_Layout6x6_P1.0mm","Package_CSP/OnSemi_ODCSP36_BGA-36_6.13x6.13mm_Layout6x6_P1.0mm_ManualAssembly","Package_CSP/OnSemi_ODCSP8_BGA-8_3.16x3.16mm_Layout3x3_P1.26mm","Package_CSP/OnSemi_ODCSP8_BGA-8_3.16x3.16mm_Layout3x3_P1.26mm_ManualAssembly","Package_CSP/ST_WLCSP-100_4.437x4.456mm_Layout10x10_P0.4mm","Package_CSP/ST_WLCSP-100_4.4x4.38mm_Layout10x10_P0.4mm_Offcenter","Package_CSP/ST_WLCSP-100_Die422","Package_CSP/ST_WLCSP-100_Die446","Package_CSP/ST_WLCSP-100_Die452","Package_CSP/ST_WLCSP-100_Die461","Package_CSP/ST_WLCSP-101_3.86x3.79mm_Layout11x19_P0.35mm_Stagger","Package_CSP/ST_WLCSP-104_Die437","Package_CSP/ST_WLCSP-115_3.73x4.15mm_Layout11x21_P0.35mm_Stagger","Package_CSP/ST_WLCSP-115_4.63x4.15mm_Layout21x11_P0.4mm_Stagger","Package_CSP/ST_WLCSP-12_1.7x1.42mm_Layout4x6_P0.35mm_Stagger","Package_CSP/ST_WLCSP-132_4.57x4.37mm_Layout12x11_P0.35mm","Package_CSP/ST_WLCSP-143_Die419","Package_CSP/ST_WLCSP-143_Die449","Package_CSP/ST_WLCSP-144_Die470","Package_CSP/ST_WLCSP-150_5.38x5.47mm_Layout13x23_P0.4mm_Stagger","Package_CSP/ST_WLCSP-156_4.96x4.64mm_Layout13x12_P0.35mm","Package_CSP/ST_WLCSP-168_Die434","Package_CSP/ST_WLCSP-180_Die451","Package_CSP/ST_WLCSP-18_1.86x2.14mm_Layout7x5_P0.4mm_Stagger","Package_CSP/ST_WLCSP-19_1.643x2.492mm_Layout4x11_P0.35mm_Stagger","Package_CSP/ST_WLCSP-208_5.38x5.47mm_Layout26x16_P0.35mm_Stagger","Package_CSP/ST_WLCSP-208_5.8x5.6mm_Layout26x16_P0.35mm_Stagger","Package_CSP/ST_WLCSP-20_1.94x2.4mm_Layout4x5_P0.4mm","Package_CSP/ST_WLCSP-25_2.33x2.24mm_Layout5x5_P0.4mm","Package_CSP/ST_WLCSP-25_2.3x2.48mm_Layout5x5_P0.4mm","Package_CSP/ST_WLCSP-25_Die425","Package_CSP/ST_WLCSP-25_Die444","Package_CSP/ST_WLCSP-25_Die457","Package_CSP/ST_WLCSP-27_2.34x2.55mm_Layout9x6_P0.4mm_Stagger","Package_CSP/ST_WLCSP-36_2.58x3.07mm_Layout6x6_P0.4mm","Package_CSP/ST_WLCSP-36_2.652x2.592mm_Layout7x12_P0.4mm_Stagger_Offcenter","Package_CSP/ST_WLCSP-36_2.83x2.99mm_Layout7x13_P0.4mm_Stagger_Offcenter","Package_CSP/ST_WLCSP-36_Die417","Package_CSP/ST_WLCSP-36_Die440","Package_CSP/ST_WLCSP-36_Die445","Package_CSP/ST_WLCSP-36_Die458","Package_CSP/ST_WLCSP-39_2.76x2.78mm_Layout11x7_P0.4mm_Stagger","Package_CSP/ST_WLCSP-41_2.98x2.76mm_Layout13x7_P0.4mm_Stagger","Package_CSP/ST_WLCSP-42_2.93x2.82mm_Layout12x7_P0.4mm_Stagger","Package_CSP/ST_WLCSP-49_3.14x3.14mm_Layout7x7_P0.4mm_Offcenter","Package_CSP/ST_WLCSP-49_3.15x3.13mm_Layout7x7_P0.4mm","Package_CSP/ST_WLCSP-49_3.3x3.38mm_Layout7x7_P0.4mm_Offcenter","Package_CSP/ST_WLCSP-49_Die423","Package_CSP/ST_WLCSP-49_Die431","Package_CSP/ST_WLCSP-49_Die433","Package_CSP/ST_WLCSP-49_Die435","Package_CSP/ST_WLCSP-49_Die438","Package_CSP/ST_WLCSP-49_Die439","Package_CSP/ST_WLCSP-49_Die447","Package_CSP/ST_WLCSP-49_Die448","Package_CSP/ST_WLCSP-52_3.09x3.15mm_Layout13x8_P0.4mm_Stagger","Package_CSP/ST_WLCSP-56_3.38x3.38mm_Layout14x8_P0.4mm_Stagger","Package_CSP/ST_WLCSP-63_Die427","Package_CSP/ST_WLCSP-64_3.56x3.52mm_Layout8x8_P0.4mm","Package_CSP/ST_WLCSP-64_Die414","Package_CSP/ST_WLCSP-64_Die427","Package_CSP/ST_WLCSP-64_Die435","Package_CSP/ST_WLCSP-64_Die436","Package_CSP/ST_WLCSP-64_Die441","Package_CSP/ST_WLCSP-64_Die442","Package_CSP/ST_WLCSP-64_Die462","Package_CSP/ST_WLCSP-66_Die411","Package_CSP/ST_WLCSP-66_Die432","Package_CSP/ST_WLCSP-72_3.38x3.38mm_Layout16x9_P0.35mm_Stagger","Package_CSP/ST_WLCSP-72_Die415","Package_CSP/ST_WLCSP-80_3.5x3.27mm_Layout10x16_P0.35mm_Stagger_Offcenter","Package_CSP/ST_WLCSP-81_4.02x4.27mm_Layout9x9_P0.4mm","Package_CSP/ST_WLCSP-81_4.36x4.07mm_Layout9x9_P0.4mm","Package_CSP/ST_WLCSP-81_Die415","Package_CSP/ST_WLCSP-81_Die421","Package_CSP/ST_WLCSP-81_Die463","Package_CSP/ST_WLCSP-90_4.2x3.95mm_Layout18x10_P0.4mm_Stagger","Package_CSP/ST_WLCSP-90_Die413","Package_CSP/ST_WLCSP-99_4.42x3.77mm_Layout11x9_P0.35mm","Package_CSP/WLCSP-12_1.403x1.555mm_Layout6x4_P0.4mm_Stagger","Package_CSP/WLCSP-12_1.56x1.56mm_P0.4mm","Package_CSP/WLCSP-16_1.409x1.409mm_Layout4x4_P0.35mm","Package_CSP/WLCSP-16_2.225x2.17mm_Layout4x4_P0.5mm","Package_CSP/WLCSP-16_4x4_B2.17x2.32mm_P0.5mm","Package_CSP/WLCSP-20_1.934x2.434mm_Layout4x5_P0.4mm","Package_CSP/WLCSP-20_1.994x1.609mm_Layout5x4_P0.4mm","Package_CSP/WLCSP-20_1.994x1.94mm_Layout4x5_P0.4mm","Package_CSP/WLCSP-36_2.374x2.459mm_Layout6x6_P0.35mm","Package_CSP/WLCSP-36_2.82x2.67mm_Layout6x6_P0.4mm","Package_CSP/WLCSP-4_0.64x0.64mm_Layout2x2_P0.35mm","Package_CSP/WLCSP-4_0.89x0.89mm_Layout2x2_P0.5mm","Package_CSP/WLCSP-56_3.170x3.444mm_Layout7x8_P0.4mm","Package_CSP/WLCSP-6_1.46x1.1mm_Layout3x2_P0.4mm","Package_CSP/WLCSP-6_1.4x1.0mm_P0.4mm","Package_CSP/WLCSP-81_4.41x3.76mm_P0.4mm","Package_CSP/WLCSP-8_1.551x2.284mm_Layout2x4_P0.5mm","Package_CSP/WLCSP-8_1.58x1.63x0.35mm_Layout3x5_P0.35x0.4mm_Ball0.25mm_Pad0.25mm_NSMD","Package_CSP/WLCSP-9_1.21x1.22mm_Layout3x3_P0.4mm","Package_CSP/Xilinx_CSG48_7.0x7.0mm_Layout7x7_P0.8mm","Package_CSP/pSemi_CSP-16_1.64x2.04mm_P0.4mm","Package_CSP/pSemi_CSP-16_1.64x2.04mm_P0.4mm_Pad0.18mm","Package_DFN_QFN/AMS_QFN-4-1EP_2x2mm_P0.95mm_EP0.7x1.6mm","Package_DFN_QFN/AO_AOZ666xDI_DFN-8-1EP_3x3mm_P0.65mm_EP1.25x2.7mm","Package_DFN_QFN/AO_DFN-8-1EP_5.55x5.2mm_P1.27mm_EP4.12x4.6mm","Package_DFN_QFN/Analog_QFN-28-36-2EP_5x6mm_P0.5mm","Package_DFN_QFN/ArtInChip_QFN-100-1EP_12x12mm_P0.4mm_EP7.4x7.4mm","Package_DFN_QFN/ArtInChip_QFN-100-1EP_12x12mm_P0.4mm_EP7.4x7.4mm_ThermalVias","Package_DFN_QFN/ArtInChip_QFN-68-1EP_7x7mm_P0.35mm_EP5.49x5.49mm","Package_DFN_QFN/ArtInChip_QFN-68-1EP_7x7mm_P0.35mm_EP5.49x5.49mm_ThermalVias","Package_DFN_QFN/ArtInChip_QFN-88-1EP_10x10mm_P0.4mm_EP6.74x6.74mm","Package_DFN_QFN/ArtInChip_QFN-88-1EP_10x10mm_P0.4mm_EP6.74x6.74mm_ThermalVias","Package_DFN_QFN/CDFN-4_2.5x3.2mm_P2.1mm","Package_DFN_QFN/CDFN-4_2x2.5mm_P1.65mm","Package_DFN_QFN/CDFN-4_3.2x5mm_P2.54mm","Package_DFN_QFN/Cypress_QFN-56-1EP_8x8mm_P0.5mm_EP6.22x6.22mm_ThermalVias","Package_DFN_QFN/DFN-10-1EP_2.6x2.6mm_P0.5mm_EP1.3x2.2mm","Package_DFN_QFN/DFN-10-1EP_2.6x2.6mm_P0.5mm_EP1.3x2.2mm_ThermalVias","Package_DFN_QFN/DFN-10-1EP_2x3mm_P0.5mm_EP0.64x2.4mm","Package_DFN_QFN/DFN-10-1EP_3x3mm_P0.5mm_EP1.55x2.48mm","Package_DFN_QFN/DFN-10-1EP_3x3mm_P0.5mm_EP1.58x2.35mm","Package_DFN_QFN/DFN-10-1EP_3x3mm_P0.5mm_EP1.58x2.35mm_ThermalVias","Package_DFN_QFN/DFN-10-1EP_3x3mm_P0.5mm_EP1.646x3.1mm","Package_DFN_QFN/DFN-10-1EP_3x3mm_P0.5mm_EP1.646x3.1mm_ThermalVias","Package_DFN_QFN/DFN-10-1EP_3x3mm_P0.5mm_EP1.65x2.38mm","Package_DFN_QFN/DFN-10-1EP_3x3mm_P0.5mm_EP1.65x2.38mm_ThermalVias","Package_DFN_QFN/DFN-10-1EP_3x3mm_P0.5mm_EP1.75x2.7mm","Package_DFN_QFN/DFN-10-1EP_3x3mm_P0.5mm_EP1.7x2.5mm","Package_DFN_QFN/DFN-10_2x2mm_P0.4mm","Package_DFN_QFN/DFN-12-1EP_2x3mm_P0.45mm_EP0.64x2.4mm","Package_DFN_QFN/DFN-12-1EP_3x3mm_P0.45mm_EP1.65x2.38mm","Package_DFN_QFN/DFN-12-1EP_3x3mm_P0.45mm_EP1.65x2.38mm_ThermalVias","Package_DFN_QFN/DFN-12-1EP_3x3mm_P0.5mm_EP1.6x2.5mm","Package_DFN_QFN/DFN-12-1EP_3x3mm_P0.5mm_EP1.6x2.5mm_ThermalVias","Package_DFN_QFN/DFN-12-1EP_3x3mm_P0.5mm_EP2.05x2.86mm","Package_DFN_QFN/DFN-12-1EP_3x4mm_P0.5mm_EP1.7x3.3mm","Package_DFN_QFN/DFN-12-1EP_4x4mm_P0.5mm_EP2.66x3.38mm","Package_DFN_QFN/DFN-12-1EP_4x4mm_P0.65mm_EP2.64x3.54mm","Package_DFN_QFN/DFN-14-1EP_3x3mm_P0.4mm_EP1.78x2.35mm","Package_DFN_QFN/DFN-14-1EP_3x4.5mm_P0.65mm_EP1.65x4.25mm","Package_DFN_QFN/DFN-14-1EP_3x4.5mm_P0.65mm_EP1.65x4.25mm_ThermalVias","Package_DFN_QFN/DFN-14-1EP_3x4mm_P0.5mm_EP1.7x3.3mm","Package_DFN_QFN/DFN-14_1.35x3.5mm_P0.5mm","Package_DFN_QFN/DFN-16-1EP_3x4mm_P0.45mm_EP1.7x3.3mm","Package_DFN_QFN/DFN-16-1EP_3x5mm_P0.5mm_EP1.66x4.4mm","Package_DFN_QFN/DFN-16-1EP_4x5mm_P0.5mm_EP2.44x4.34mm","Package_DFN_QFN/DFN-16-1EP_5x5mm_P0.5mm_EP3.46x4mm","Package_DFN_QFN/DFN-18-1EP_3x5mm_P0.5mm_EP1.66x4.4mm","Package_DFN_QFN/DFN-18-1EP_4x5mm_P0.5mm_EP2.44x4.34mm","Package_DFN_QFN/DFN-20-1EP_5x6mm_P0.5mm_EP3.24x4.24mm","Package_DFN_QFN/DFN-22-1EP_5x6mm_P0.5mm_EP3.14x4.3mm","Package_DFN_QFN/DFN-24-1EP_4x7mm_P0.5mm_EP2.64x6.44mm","Package_DFN_QFN/DFN-32-1EP_4x7mm_P0.4mm_EP2.64x6.44mm","Package_DFN_QFN/DFN-44-1EP_5x8.9mm_P0.4mm_EP3.7x8.4mm","Package_DFN_QFN/DFN-4_5x7mm_P5.08mm","Package_DFN_QFN/DFN-6-1EP_1.2x1.2mm_P0.4mm_EP0.3x0.94mm_PullBack","Package_DFN_QFN/DFN-6-1EP_2x1.6mm_P0.5mm_EP1.15x1.3mm","Package_DFN_QFN/DFN-6-1EP_2x1.8mm_P0.5mm_EP1.2x1.6mm","Package_DFN_QFN/DFN-6-1EP_2x2mm_P0.5mm_EP0.61x1.42mm","Package_DFN_QFN/DFN-6-1EP_2x2mm_P0.5mm_EP0.6x1.37mm","Package_DFN_QFN/DFN-6-1EP_2x2mm_P0.5mm_EP0.7x1.6mm","Package_DFN_QFN/DFN-6-1EP_2x2mm_P0.65mm_EP1.01x1.7mm","Package_DFN_QFN/DFN-6-1EP_2x2mm_P0.65mm_EP1x1.6mm","Package_DFN_QFN/DFN-6-1EP_3x2mm_P0.5mm_EP1.65x1.35mm","Package_DFN_QFN/DFN-6-1EP_3x3mm_P0.95mm_EP1.7x2.6mm","Package_DFN_QFN/DFN-6-1EP_3x3mm_P1mm_EP1.5x2.4mm","Package_DFN_QFN/DFN-6_1.3x1.2mm_P0.4mm","Package_DFN_QFN/DFN-6_1.6x1.3mm_P0.4mm","Package_DFN_QFN/DFN-8-1EP_1.5x1.5mm_P0.4mm_EP0.7x1.2mm","Package_DFN_QFN/DFN-8-1EP_2x2mm_P0.45mm_EP0.64x1.37mm","Package_DFN_QFN/DFN-8-1EP_2x2mm_P0.5mm_EP0.6x1.2mm","Package_DFN_QFN/DFN-8-1EP_2x2mm_P0.5mm_EP0.86x1.55mm","Package_DFN_QFN/DFN-8-1EP_2x2mm_P0.5mm_EP0.8x1.6mm","Package_DFN_QFN/DFN-8-1EP_2x2mm_P0.5mm_EP0.9x1.3mm","Package_DFN_QFN/DFN-8-1EP_2x2mm_P0.5mm_EP0.9x1.5mm","Package_DFN_QFN/DFN-8-1EP_2x2mm_P0.5mm_EP0.9x1.6mm","Package_DFN_QFN/DFN-8-1EP_2x2mm_P0.5mm_EP0.9x1.7mm","Package_DFN_QFN/DFN-8-1EP_2x2mm_P0.5mm_EP1.05x1.75mm","Package_DFN_QFN/DFN-8-1EP_2x3mm_P0.5mm_EP0.61x2.2mm","Package_DFN_QFN/DFN-8-1EP_3x2mm_P0.45mm_EP1.66x1.36mm","Package_DFN_QFN/DFN-8-1EP_3x2mm_P0.5mm_EP1.36x1.46mm","Package_DFN_QFN/DFN-8-1EP_3x2mm_P0.5mm_EP1.3x1.5mm","Package_DFN_QFN/DFN-8-1EP_3x2mm_P0.5mm_EP1.75x1.45mm","Package_DFN_QFN/DFN-8-1EP_3x2mm_P0.5mm_EP1.7x1.4mm","Package_DFN_QFN/DFN-8-1EP_3x2mm_P0.5mm_EP1.7x1.6mm","Package_DFN_QFN/DFN-8-1EP_3x3mm_P0.5mm_EP1.65x2.38mm","Package_DFN_QFN/DFN-8-1EP_3x3mm_P0.5mm_EP1.65x2.38mm_ThermalVias","Package_DFN_QFN/DFN-8-1EP_3x3mm_P0.5mm_EP1.66x2.38mm","Package_DFN_QFN/DFN-8-1EP_3x3mm_P0.5mm_EP1.7x2.4mm","Package_DFN_QFN/DFN-8-1EP_3x3mm_P0.65mm_EP1.2x2.15mm","Package_DFN_QFN/DFN-8-1EP_3x3mm_P0.65mm_EP1.2x2.15mm_ThermalVias","Package_DFN_QFN/DFN-8-1EP_3x3mm_P0.65mm_EP1.55x2.4mm","Package_DFN_QFN/DFN-8-1EP_3x3mm_P0.65mm_EP1.5x2.25mm","Package_DFN_QFN/DFN-8-1EP_3x3mm_P0.65mm_EP1.6x2.56mm","Package_DFN_QFN/DFN-8-1EP_3x3mm_P0.65mm_EP1.6x2.56mm_ThermalVias","Package_DFN_QFN/DFN-8-1EP_3x3mm_P0.65mm_EP1.7x2.05mm","Package_DFN_QFN/DFN-8-1EP_4x4mm_P0.8mm_EP2.39x2.21mm","Package_DFN_QFN/DFN-8-1EP_4x4mm_P0.8mm_EP2.3x3.24mm","Package_DFN_QFN/DFN-8-1EP_4x4mm_P0.8mm_EP2.5x3.6mm","Package_DFN_QFN/DFN-8-1EP_6x5mm_P1.27mm_EP2x2mm","Package_DFN_QFN/DFN-8-1EP_6x5mm_P1.27mm_EP4x4mm","Package_DFN_QFN/DFN-8_2x2mm_P0.5mm","Package_DFN_QFN/DFN-S-8-1EP_6x5mm_P1.27mm","Package_DFN_QFN/DHVQFN-14-1EP_2.5x3mm_P0.5mm_EP1x1.5mm","Package_DFN_QFN/DHVQFN-14-1EP_2.5x3mm_P0.5mm_EP1x1.5mm_ThermalVias","Package_DFN_QFN/DHVQFN-16-1EP_2.5x3.5mm_P0.5mm_EP1x2mm","Package_DFN_QFN/DHVQFN-20-1EP_2.5x4.5mm_P0.5mm_EP1x3mm","Package_DFN_QFN/DHWQFN-14-1EP_2.5x3mm_P0.5mm_EP1x1.5mm","Package_DFN_QFN/DHWQFN-14-1EP_2.5x3mm_P0.5mm_EP1x1.5mm_ThermalVias","Package_DFN_QFN/Diodes_DFN1006-3","Package_DFN_QFN/Diodes_UDFN-10_1x2.5mm_P0.5mm","Package_DFN_QFN/Diodes_UDFN2020-6_Type-F","Package_DFN_QFN/Diodes_UDFN3810-9_TYPE_B","Package_DFN_QFN/Diodes_ZL32_TQFN-32-1EP_3x6mm_P0.4mm_EP1.25x3.5mm","Package_DFN_QFN/EPC_QFN-13-3EP_3.5x5mm_P0.5mm","Package_DFN_QFN/HVQFN-16-1EP_3x3mm_P0.5mm_EP1.5x1.5mm","Package_DFN_QFN/HVQFN-24-1EP_4x4mm_P0.5mm_EP2.1x2.1mm","Package_DFN_QFN/HVQFN-24-1EP_4x4mm_P0.5mm_EP2.5x2.5mm","Package_DFN_QFN/HVQFN-24-1EP_4x4mm_P0.5mm_EP2.5x2.5mm_ThermalVias","Package_DFN_QFN/HVQFN-24-1EP_4x4mm_P0.5mm_EP2.6x2.6mm","Package_DFN_QFN/HVQFN-24-1EP_4x4mm_P0.5mm_EP2.6x2.6mm_ThermalVias","Package_DFN_QFN/HVQFN-32-1EP_5x5mm_P0.5mm_EP3.1x3.1mm","Package_DFN_QFN/HVQFN-32-1EP_5x5mm_P0.5mm_EP3.1x3.1mm_ThermalVias","Package_DFN_QFN/HVQFN-36-1EP_6x6mm_P0.5mm_EP3.9x3.9mm","Package_DFN_QFN/HVQFN-36-1EP_6x6mm_P0.5mm_EP3.9x3.9mm_ThermalVias","Package_DFN_QFN/HVQFN-40-1EP_6x6mm_P0.5mm_EP4.1x4.1mm","Package_DFN_QFN/HVQFN-40-1EP_6x6mm_P0.5mm_EP4.1x4.1mm_ThermalVias","Package_DFN_QFN/HXQFN-16-1EP_3x3mm_P0.5mm_EP1.85x1.85mm","Package_DFN_QFN/HXQFN-16-1EP_3x3mm_P0.5mm_EP1.85x1.85mm_ThermalVias","Package_DFN_QFN/IDT_QFN-12-1EP_2x2mm_P0.5mm_EP1.1x1.1mm","Package_DFN_QFN/IDT_QFN-12-1EP_2x2mm_P0.5mm_EP1.1x1.1mm_ThermalVias","Package_DFN_QFN/Infineon_MLPQ-16-14-1EP_4x4mm_P0.5mm","Package_DFN_QFN/Infineon_MLPQ-40-32-1EP_7x7mm_P0.5mm","Package_DFN_QFN/Infineon_MLPQ-48-1EP_7x7mm_P0.5mm_EP5.15x5.15mm","Package_DFN_QFN/Infineon_MLPQ-48-1EP_7x7mm_P0.5mm_EP5.55x5.55mm","Package_DFN_QFN/Infineon_PQFN-22-15-4EP_6x5mm_P0.65mm","Package_DFN_QFN/Infineon_PQFN-44-31-5EP_7x7mm_P0.5mm","Package_DFN_QFN/LQFN-10-1EP_2x2mm_P0.5mm_EP0.7x0.7mm","Package_DFN_QFN/LQFN-12-1EP_2x2mm_P0.5mm_EP0.7x0.7mm","Package_DFN_QFN/LQFN-16-1EP_3x3mm_P0.5mm_EP1.7x1.7mm","Package_DFN_QFN/Linear_DE14MA","Package_DFN_QFN/Linear_UGK52_QFN-46-52","Package_DFN_QFN/MLF-20-1EP_4x4mm_P0.5mm_EP2.6x2.6mm","Package_DFN_QFN/MLF-20-1EP_4x4mm_P0.5mm_EP2.6x2.6mm_ThermalVias","Package_DFN_QFN/MLF-6-1EP_1.6x1.6mm_P0.5mm_EP0.5x1.26mm","Package_DFN_QFN/MLF-8-1EP_3x3mm_P0.65mm_EP1.55x2.3mm","Package_DFN_QFN/MLF-8-1EP_3x3mm_P0.65mm_EP1.55x2.3mm_ThermalVias","Package_DFN_QFN/MLPQ-16-1EP_4x4mm_P0.65mm_EP2.8x2.8mm","Package_DFN_QFN/MPS_QFN-12_2x2mm_P0.4mm","Package_DFN_QFN/MPS_QFN-16_3x3mm_P0.5mm","Package_DFN_QFN/Maxim_FC2QFN-14_2.5x2.5mm_P0.5mm","Package_DFN_QFN/Maxim_TDFN-10-1EP_3x3mm_P0.5mm_EP1.58x2.35mm","Package_DFN_QFN/Maxim_TDFN-12-1EP_3x3mm_P0.5mm_EP1.7x2.5mm","Package_DFN_QFN/Maxim_TDFN-12-1EP_3x3mm_P0.5mm_EP1.7x2.5mm_ThermalVias","Package_DFN_QFN/Maxim_TDFN-6-1EP_3x3mm_P0.95mm_EP1.5x2.3mm","Package_DFN_QFN/Maxim_WSON-8-1EP_3x2mm_P0.5mm_EP1.75x1.63mm","Package_DFN_QFN/Micrel_MLF-8-1EP_2x2mm_P0.5mm_EP0.6x1.2mm","Package_DFN_QFN/Micrel_MLF-8-1EP_2x2mm_P0.5mm_EP0.6x1.2mm_ThermalVias","Package_DFN_QFN/Micrel_MLF-8-1EP_2x2mm_P0.5mm_EP0.8x1.3mm_ThermalVias","Package_DFN_QFN/Microchip_8E-16","Package_DFN_QFN/Microchip_DRQFN-44-1EP_5x5mm_P0.7mm_EP2.65x2.65mm","Package_DFN_QFN/Microchip_DRQFN-44-1EP_5x5mm_P0.7mm_EP2.65x2.65mm_ThermalVias","Package_DFN_QFN/Microchip_DRQFN-64-1EP_7x7mm_P0.65mm_EP4.1x4.1mm","Package_DFN_QFN/Microchip_DRQFN-64-1EP_7x7mm_P0.65mm_EP4.1x4.1mm_ThermalVias","Package_DFN_QFN/Microsemi_QFN-40-32-2EP_6x8mm_P0.5mm","Package_DFN_QFN/Mini-Circuits_DL805","Package_DFN_QFN/Mini-Circuits_FG873-4_3x3mm","Package_DFN_QFN/NXP_LQFN-48-1EP_7x7mm_P0.5mm_EP3.5x3.5mm_16xMask0.45x0.45","Package_DFN_QFN/NXP_LQFN-48-1EP_7x7mm_P0.5mm_EP3.5x3.5mm_16xMask0.45x0.45_ThermalVias","Package_DFN_QFN/NXP_VQFN-16-1EP_4x4mm_P0.65mm_EP2.1x2.1mm","Package_DFN_QFN/Nordic_AQFN-73-1EP_7x7mm_P0.5mm","Package_DFN_QFN/Nordic_AQFN-94-1EP_7x7mm_P0.4mm","Package_DFN_QFN/OnSemi_DFN-14-1EP_4x4mm_P0.5mm_EP2.7x3.4mm","Package_DFN_QFN/OnSemi_DFN-8_2x2mm_P0.5mm","Package_DFN_QFN/OnSemi_SIP-38-6EP-9x7mm_P0.65mm_EP1.2x1.2mm","Package_DFN_QFN/OnSemi_UDFN-16-1EP_1.35x3.3mm_P0.4mm_EP0.4x2.8mm","Package_DFN_QFN/OnSemi_UDFN-8_1.2x1.8mm_P0.4mm","Package_DFN_QFN/OnSemi_VCT-28_3.5x3.5mm_P0.4mm","Package_DFN_QFN/OnSemi_XDFN-10_1.35x2.2mm_P0.4mm","Package_DFN_QFN/OnSemi_XDFN4-1EP_1.0x1.0mm_EP0.52x0.52mm","Package_DFN_QFN/PQFN-8-EP_6x5mm_P1.27mm_Generic","Package_DFN_QFN/Panasonic_HQFN-16-1EP_4x4mm_P0.65mm_EP2.9x2.9mm","Package_DFN_QFN/Panasonic_HSON-8_8x8mm_P2.00mm","Package_DFN_QFN/QFN-12-1EP_3x3mm_P0.51mm_EP1.45x1.45mm","Package_DFN_QFN/QFN-12-1EP_3x3mm_P0.5mm_EP1.45x1.45mm","Package_DFN_QFN/QFN-12-1EP_3x3mm_P0.5mm_EP1.45x1.45mm_ThermalVias","Package_DFN_QFN/QFN-12-1EP_3x3mm_P0.5mm_EP1.65x1.65mm","Package_DFN_QFN/QFN-12-1EP_3x3mm_P0.5mm_EP1.65x1.65mm_ThermalVias","Package_DFN_QFN/QFN-12-1EP_3x3mm_P0.5mm_EP1.6x1.6mm","Package_DFN_QFN/QFN-12-1EP_3x3mm_P0.5mm_EP1.6x1.6mm_ThermalVias","Package_DFN_QFN/QFN-16-1EP_1.8x2.6mm_P0.4mm_EP0.7x1.5mm","Package_DFN_QFN/QFN-16-1EP_1.8x2.6mm_P0.4mm_EP0.7x1.5mm_ThermalVias","Package_DFN_QFN/QFN-16-1EP_3x3mm_P0.5mm_EP1.45x1.45mm","Package_DFN_QFN/QFN-16-1EP_3x3mm_P0.5mm_EP1.45x1.45mm_ThermalVias","Package_DFN_QFN/QFN-16-1EP_3x3mm_P0.5mm_EP1.675x1.675mm","Package_DFN_QFN/QFN-16-1EP_3x3mm_P0.5mm_EP1.75x1.75mm","Package_DFN_QFN/QFN-16-1EP_3x3mm_P0.5mm_EP1.75x1.75mm_ThermalVias","Package_DFN_QFN/QFN-16-1EP_3x3mm_P0.5mm_EP1.7x1.7mm","Package_DFN_QFN/QFN-16-1EP_3x3mm_P0.5mm_EP1.7x1.7mm_ThermalVias","Package_DFN_QFN/QFN-16-1EP_3x3mm_P0.5mm_EP1.9x1.9mm","Package_DFN_QFN/QFN-16-1EP_3x3mm_P0.5mm_EP1.9x1.9mm_ThermalVias","Package_DFN_QFN/QFN-16-1EP_4x4mm_P0.5mm_EP2.45x2.45mm","Package_DFN_QFN/QFN-16-1EP_4x4mm_P0.5mm_EP2.45x2.45mm_ThermalVias","Package_DFN_QFN/QFN-16-1EP_4x4mm_P0.65mm_EP2.15x2.15mm","Package_DFN_QFN/QFN-16-1EP_4x4mm_P0.65mm_EP2.15x2.15mm_ThermalVias","Package_DFN_QFN/QFN-16-1EP_4x4mm_P0.65mm_EP2.1x2.1mm","Package_DFN_QFN/QFN-16-1EP_4x4mm_P0.65mm_EP2.1x2.1mm_ThermalVias","Package_DFN_QFN/QFN-16-1EP_4x4mm_P0.65mm_EP2.5x2.5mm","Package_DFN_QFN/QFN-16-1EP_4x4mm_P0.65mm_EP2.5x2.5mm_ThermalVias","Package_DFN_QFN/QFN-16-1EP_4x4mm_P0.65mm_EP2.7x2.7mm","Package_DFN_QFN/QFN-16-1EP_4x4mm_P0.65mm_EP2.7x2.7mm_PullBack","Package_DFN_QFN/QFN-16-1EP_4x4mm_P0.65mm_EP2.7x2.7mm_PullBack_ThermalVias","Package_DFN_QFN/QFN-16-1EP_4x4mm_P0.65mm_EP2.7x2.7mm_ThermalVias","Package_DFN_QFN/QFN-16-1EP_5x5mm_P0.8mm_EP2.7x2.7mm","Package_DFN_QFN/QFN-16-1EP_5x5mm_P0.8mm_EP2.7x2.7mm_ThermalVias","Package_DFN_QFN/QFN-20-1EP_3.5x3.5mm_P0.5mm_EP2x2mm","Package_DFN_QFN/QFN-20-1EP_3.5x3.5mm_P0.5mm_EP2x2mm_ThermalVias","Package_DFN_QFN/QFN-20-1EP_3x3mm_P0.45mm_EP1.6x1.6mm","Package_DFN_QFN/QFN-20-1EP_3x3mm_P0.45mm_EP1.6x1.6mm_ThermalVias","Package_DFN_QFN/QFN-20-1EP_3x3mm_P0.4mm_EP1.65x1.65mm","Package_DFN_QFN/QFN-20-1EP_3x3mm_P0.4mm_EP1.65x1.65mm_ThermalVias","Package_DFN_QFN/QFN-20-1EP_3x4mm_P0.5mm_EP1.65x2.65mm","Package_DFN_QFN/QFN-20-1EP_3x4mm_P0.5mm_EP1.65x2.65mm_ThermalVias","Package_DFN_QFN/QFN-20-1EP_4x4mm_P0.5mm_EP2.5x2.5mm","Package_DFN_QFN/QFN-20-1EP_4x4mm_P0.5mm_EP2.5x2.5mm_ThermalVias","Package_DFN_QFN/QFN-20-1EP_4x4mm_P0.5mm_EP2.6x2.6mm","Package_DFN_QFN/QFN-20-1EP_4x4mm_P0.5mm_EP2.6x2.6mm_ThermalVias","Package_DFN_QFN/QFN-20-1EP_4x4mm_P0.5mm_EP2.7x2.7mm","Package_DFN_QFN/QFN-20-1EP_4x4mm_P0.5mm_EP2.7x2.7mm_ThermalVias","Package_DFN_QFN/QFN-20-1EP_4x5mm_P0.5mm_EP2.65x3.65mm","Package_DFN_QFN/QFN-20-1EP_4x5mm_P0.5mm_EP2.65x3.65mm_ThermalVias","Package_DFN_QFN/QFN-20-1EP_5x5mm_P0.65mm_EP3.35x3.35mm","Package_DFN_QFN/QFN-20-1EP_5x5mm_P0.65mm_EP3.35x3.35mm_ThermalVias","Package_DFN_QFN/QFN-24-1EP_3x3mm_P0.4mm_EP1.75x1.6mm","Package_DFN_QFN/QFN-24-1EP_3x3mm_P0.4mm_EP1.75x1.6mm_ThermalVias","Package_DFN_QFN/QFN-24-1EP_3x4mm_P0.4mm_EP1.65x2.65mm","Package_DFN_QFN/QFN-24-1EP_3x4mm_P0.4mm_EP1.65x2.65mm_ThermalVias","Package_DFN_QFN/QFN-24-1EP_4x4mm_P0.5mm_EP2.15x2.15mm","Package_DFN_QFN/QFN-24-1EP_4x4mm_P0.5mm_EP2.15x2.15mm_ThermalVias","Package_DFN_QFN/QFN-24-1EP_4x4mm_P0.5mm_EP2.5x2.5mm","Package_DFN_QFN/QFN-24-1EP_4x4mm_P0.5mm_EP2.65x2.65mm","Package_DFN_QFN/QFN-24-1EP_4x4mm_P0.5mm_EP2.65x2.65mm_ThermalVias","Package_DFN_QFN/QFN-24-1EP_4x4mm_P0.5mm_EP2.6x2.6mm","Package_DFN_QFN/QFN-24-1EP_4x4mm_P0.5mm_EP2.6x2.6mm_ThermalVias","Package_DFN_QFN/QFN-24-1EP_4x4mm_P0.5mm_EP2.75x2.75mm","Package_DFN_QFN/QFN-24-1EP_4x4mm_P0.5mm_EP2.75x2.75mm_ThermalVias","Package_DFN_QFN/QFN-24-1EP_4x4mm_P0.5mm_EP2.7x2.6mm","Package_DFN_QFN/QFN-24-1EP_4x4mm_P0.5mm_EP2.7x2.6mm_ThermalVias","Package_DFN_QFN/QFN-24-1EP_4x4mm_P0.5mm_EP2.7x2.7mm","Package_DFN_QFN/QFN-24-1EP_4x4mm_P0.5mm_EP2.7x2.7mm_ThermalVias","Package_DFN_QFN/QFN-24-1EP_4x4mm_P0.5mm_EP2.8x2.8mm","Package_DFN_QFN/QFN-24-1EP_4x4mm_P0.5mm_EP2.8x2.8mm_ThermalVias","Package_DFN_QFN/QFN-24-1EP_4x5mm_P0.5mm_EP2.65x3.65mm","Package_DFN_QFN/QFN-24-1EP_4x5mm_P0.5mm_EP2.65x3.65mm_ThermalVias","Package_DFN_QFN/QFN-24-1EP_5x5mm_P0.65mm_EP3.25x3.25mm","Package_DFN_QFN/QFN-24-1EP_5x5mm_P0.65mm_EP3.25x3.25mm_ThermalVias","Package_DFN_QFN/QFN-24-1EP_5x5mm_P0.65mm_EP3.2x3.2mm","Package_DFN_QFN/QFN-24-1EP_5x5mm_P0.65mm_EP3.2x3.2mm_ThermalVias","Package_DFN_QFN/QFN-24-1EP_5x5mm_P0.65mm_EP3.4x3.4mm","Package_DFN_QFN/QFN-24-1EP_5x5mm_P0.65mm_EP3.4x3.4mm_ThermalVias","Package_DFN_QFN/QFN-24-1EP_5x5mm_P0.65mm_EP3.6x3.6mm","Package_DFN_QFN/QFN-24-1EP_5x5mm_P0.65mm_EP3.6x3.6mm_ThermalVias","Package_DFN_QFN/QFN-28-1EP_3x6mm_P0.5mm_EP1.7x4.75mm","Package_DFN_QFN/QFN-28-1EP_3x6mm_P0.5mm_EP1.7x4.75mm_ThermalVias","Package_DFN_QFN/QFN-28-1EP_4x4mm_P0.45mm_EP2.4x2.4mm","Package_DFN_QFN/QFN-28-1EP_4x4mm_P0.45mm_EP2.4x2.4mm_ThermalVias","Package_DFN_QFN/QFN-28-1EP_4x4mm_P0.45mm_EP2.6x2.6mm","Package_DFN_QFN/QFN-28-1EP_4x4mm_P0.4mm_EP2.3x2.3mm","Package_DFN_QFN/QFN-28-1EP_4x4mm_P0.4mm_EP2.3x2.3mm_ThermalVias","Package_DFN_QFN/QFN-28-1EP_4x4mm_P0.4mm_EP2.4x2.4mm","Package_DFN_QFN/QFN-28-1EP_4x4mm_P0.4mm_EP2.4x2.4mm_ThermalVias","Package_DFN_QFN/QFN-28-1EP_4x5mm_P0.5mm_EP2.65x3.65mm","Package_DFN_QFN/QFN-28-1EP_4x5mm_P0.5mm_EP2.65x3.65mm_ThermalVias","Package_DFN_QFN/QFN-28-1EP_5x5mm_P0.5mm_EP2.7x2.7mm","Package_DFN_QFN/QFN-28-1EP_5x5mm_P0.5mm_EP2.7x2.7mm_ThermalVias","Package_DFN_QFN/QFN-28-1EP_5x5mm_P0.5mm_EP3.1x3.1mm","Package_DFN_QFN/QFN-28-1EP_5x5mm_P0.5mm_EP3.1x3.1mm_ThermalVias","Package_DFN_QFN/QFN-28-1EP_5x5mm_P0.5mm_EP3.25x3.25mm","Package_DFN_QFN/QFN-28-1EP_5x5mm_P0.5mm_EP3.25x3.25mm_ThermalVias","Package_DFN_QFN/QFN-28-1EP_5x5mm_P0.5mm_EP3.35x3.35mm","Package_DFN_QFN/QFN-28-1EP_5x5mm_P0.5mm_EP3.35x3.35mm_ThermalVias","Package_DFN_QFN/QFN-28-1EP_5x5mm_P0.5mm_EP3.75x3.75mm","Package_DFN_QFN/QFN-28-1EP_5x5mm_P0.5mm_EP3.75x3.75mm_ThermalVias","Package_DFN_QFN/QFN-28-1EP_5x6mm_P0.5mm_EP3.65x4.65mm","Package_DFN_QFN/QFN-28-1EP_5x6mm_P0.5mm_EP3.65x4.65mm_ThermalVias","Package_DFN_QFN/QFN-28-1EP_6x6mm_P0.65mm_EP4.25x4.25mm","Package_DFN_QFN/QFN-28-1EP_6x6mm_P0.65mm_EP4.25x4.25mm_ThermalVias","Package_DFN_QFN/QFN-28-1EP_6x6mm_P0.65mm_EP4.8x4.8mm","Package_DFN_QFN/QFN-28-1EP_6x6mm_P0.65mm_EP4.8x4.8mm_ThermalVias","Package_DFN_QFN/QFN-28_4x4mm_P0.5mm","Package_DFN_QFN/QFN-32-1EP_4x4mm_P0.4mm_EP2.65x2.65mm","Package_DFN_QFN/QFN-32-1EP_4x4mm_P0.4mm_EP2.65x2.65mm_ThermalVias","Package_DFN_QFN/QFN-32-1EP_4x4mm_P0.4mm_EP2.9x2.9mm","Package_DFN_QFN/QFN-32-1EP_4x4mm_P0.4mm_EP2.9x2.9mm_ThermalVias","Package_DFN_QFN/QFN-32-1EP_5x5mm_P0.5mm_EP3.1x3.1mm","Package_DFN_QFN/QFN-32-1EP_5x5mm_P0.5mm_EP3.1x3.1mm_ThermalVias","Package_DFN_QFN/QFN-32-1EP_5x5mm_P0.5mm_EP3.3x3.3mm","Package_DFN_QFN/QFN-32-1EP_5x5mm_P0.5mm_EP3.3x3.3mm_ThermalVias","Package_DFN_QFN/QFN-32-1EP_5x5mm_P0.5mm_EP3.45x3.45mm","Package_DFN_QFN/QFN-32-1EP_5x5mm_P0.5mm_EP3.45x3.45mm_ThermalVias","Package_DFN_QFN/QFN-32-1EP_5x5mm_P0.5mm_EP3.65x3.65mm","Package_DFN_QFN/QFN-32-1EP_5x5mm_P0.5mm_EP3.65x3.65mm_ThermalVias","Package_DFN_QFN/QFN-32-1EP_5x5mm_P0.5mm_EP3.6x3.6mm","Package_DFN_QFN/QFN-32-1EP_5x5mm_P0.5mm_EP3.6x3.6mm_ThermalVias","Package_DFN_QFN/QFN-32-1EP_5x5mm_P0.5mm_EP3.7x3.7mm","Package_DFN_QFN/QFN-32-1EP_5x5mm_P0.5mm_EP3.7x3.7mm_ThermalVias","Package_DFN_QFN/QFN-32-1EP_7x7mm_P0.65mm_EP4.65x4.65mm","Package_DFN_QFN/QFN-32-1EP_7x7mm_P0.65mm_EP4.65x4.65mm_ThermalVias","Package_DFN_QFN/QFN-32-1EP_7x7mm_P0.65mm_EP4.7x4.7mm","Package_DFN_QFN/QFN-32-1EP_7x7mm_P0.65mm_EP4.7x4.7mm_ThermalVias","Package_DFN_QFN/QFN-32-1EP_7x7mm_P0.65mm_EP5.4x5.4mm","Package_DFN_QFN/QFN-32-1EP_7x7mm_P0.65mm_EP5.4x5.4mm_ThermalVias","Package_DFN_QFN/QFN-36-1EP_5x6mm_P0.5mm_EP3.6x4.1mm","Package_DFN_QFN/QFN-36-1EP_5x6mm_P0.5mm_EP3.6x4.1mm_ThermalVias","Package_DFN_QFN/QFN-36-1EP_5x6mm_P0.5mm_EP3.6x4.6mm","Package_DFN_QFN/QFN-36-1EP_5x6mm_P0.5mm_EP3.6x4.6mm_ThermalVias","Package_DFN_QFN/QFN-36-1EP_6x6mm_P0.5mm_EP3.7x3.7mm","Package_DFN_QFN/QFN-36-1EP_6x6mm_P0.5mm_EP3.7x3.7mm_ThermalVias","Package_DFN_QFN/QFN-36-1EP_6x6mm_P0.5mm_EP4.1x4.1mm","Package_DFN_QFN/QFN-36-1EP_6x6mm_P0.5mm_EP4.1x4.1mm_ThermalVias","Package_DFN_QFN/QFN-38-1EP_4x6mm_P0.4mm_EP2.65x4.65mm","Package_DFN_QFN/QFN-38-1EP_4x6mm_P0.4mm_EP2.65x4.65mm_ThermalVias","Package_DFN_QFN/QFN-40-1EP_5x5mm_P0.4mm_EP3.6x3.6mm","Package_DFN_QFN/QFN-40-1EP_5x5mm_P0.4mm_EP3.6x3.6mm_ThermalVias","Package_DFN_QFN/QFN-40-1EP_5x5mm_P0.4mm_EP3.8x3.8mm","Package_DFN_QFN/QFN-40-1EP_5x5mm_P0.4mm_EP3.8x3.8mm_ThermalVias","Package_DFN_QFN/QFN-40-1EP_6x6mm_P0.5mm_EP4.6x4.6mm","Package_DFN_QFN/QFN-40-1EP_6x6mm_P0.5mm_EP4.6x4.6mm_ThermalVias","Package_DFN_QFN/QFN-42-1EP_5x6mm_P0.4mm_EP3.7x4.7mm","Package_DFN_QFN/QFN-42-1EP_5x6mm_P0.4mm_EP3.7x4.7mm_ThermalVias","Package_DFN_QFN/QFN-44-1EP_7x7mm_P0.5mm_EP5.15x5.15mm","Package_DFN_QFN/QFN-44-1EP_7x7mm_P0.5mm_EP5.15x5.15mm_ThermalVias","Package_DFN_QFN/QFN-44-1EP_7x7mm_P0.5mm_EP5.2x5.2mm","Package_DFN_QFN/QFN-44-1EP_7x7mm_P0.5mm_EP5.2x5.2mm_ThermalVias","Package_DFN_QFN/QFN-44-1EP_8x8mm_P0.65mm_EP6.45x6.45mm","Package_DFN_QFN/QFN-44-1EP_8x8mm_P0.65mm_EP6.45x6.45mm_ThermalVias","Package_DFN_QFN/QFN-44-1EP_9x9mm_P0.65mm_EP7.5x7.5mm","Package_DFN_QFN/QFN-44-1EP_9x9mm_P0.65mm_EP7.5x7.5mm_ThermalVias","Package_DFN_QFN/QFN-48-1EP_5x5mm_P0.35mm_EP3.7x3.7mm","Package_DFN_QFN/QFN-48-1EP_5x5mm_P0.35mm_EP3.7x3.7mm_ThermalVias","Package_DFN_QFN/QFN-48-1EP_6x6mm_P0.4mm_EP4.2x4.2mm","Package_DFN_QFN/QFN-48-1EP_6x6mm_P0.4mm_EP4.2x4.2mm_ThermalVias","Package_DFN_QFN/QFN-48-1EP_6x6mm_P0.4mm_EP4.3x4.3mm","Package_DFN_QFN/QFN-48-1EP_6x6mm_P0.4mm_EP4.3x4.3mm_ThermalVias","Package_DFN_QFN/QFN-48-1EP_6x6mm_P0.4mm_EP4.4x4.4mm","Package_DFN_QFN/QFN-48-1EP_6x6mm_P0.4mm_EP4.4x4.4mm_ThermalVias","Package_DFN_QFN/QFN-48-1EP_6x6mm_P0.4mm_EP4.66x4.66mm","Package_DFN_QFN/QFN-48-1EP_6x6mm_P0.4mm_EP4.66x4.66mm_ThermalVias","Package_DFN_QFN/QFN-48-1EP_6x6mm_P0.4mm_EP4.6x4.6mm","Package_DFN_QFN/QFN-48-1EP_6x6mm_P0.4mm_EP4.6x4.6mm_ThermalVias","Package_DFN_QFN/QFN-48-1EP_7x7mm_P0.5mm_EP3.5x3.5mm","Package_DFN_QFN/QFN-48-1EP_7x7mm_P0.5mm_EP3.5x3.5mm_ThermalVias","Package_DFN_QFN/QFN-48-1EP_7x7mm_P0.5mm_EP5.15x5.15mm","Package_DFN_QFN/QFN-48-1EP_7x7mm_P0.5mm_EP5.15x5.15mm_ThermalVias","Package_DFN_QFN/QFN-48-1EP_7x7mm_P0.5mm_EP5.1x5.1mm","Package_DFN_QFN/QFN-48-1EP_7x7mm_P0.5mm_EP5.1x5.1mm_ThermalVias","Package_DFN_QFN/QFN-48-1EP_7x7mm_P0.5mm_EP5.3x5.3mm","Package_DFN_QFN/QFN-48-1EP_7x7mm_P0.5mm_EP5.3x5.3mm_ThermalVias","Package_DFN_QFN/QFN-48-1EP_7x7mm_P0.5mm_EP5.45x5.45mm","Package_DFN_QFN/QFN-48-1EP_7x7mm_P0.5mm_EP5.45x5.45mm_ThermalVias","Package_DFN_QFN/QFN-48-1EP_7x7mm_P0.5mm_EP5.6x5.6mm","Package_DFN_QFN/QFN-48-1EP_7x7mm_P0.5mm_EP5.6x5.6mm_ThermalVias","Package_DFN_QFN/QFN-48-1EP_7x7mm_P0.5mm_EP5.7x5.7mm","Package_DFN_QFN/QFN-48-1EP_7x7mm_P0.5mm_EP5.7x5.7mm_ThermalVias","Package_DFN_QFN/QFN-48-1EP_8x8mm_P0.5mm_EP6.2x6.2mm","Package_DFN_QFN/QFN-48-1EP_8x8mm_P0.5mm_EP6.2x6.2mm_ThermalVias","Package_DFN_QFN/QFN-52-1EP_7x8mm_P0.5mm_EP5.41x6.45mm","Package_DFN_QFN/QFN-52-1EP_7x8mm_P0.5mm_EP5.41x6.45mm_ThermalVias","Package_DFN_QFN/QFN-56-1EP_7x7mm_P0.4mm_EP3.2x3.2mm","Package_DFN_QFN/QFN-56-1EP_7x7mm_P0.4mm_EP3.2x3.2mm_ThermalVias","Package_DFN_QFN/QFN-56-1EP_7x7mm_P0.4mm_EP4x4mm","Package_DFN_QFN/QFN-56-1EP_7x7mm_P0.4mm_EP4x4mm_ThermalVias","Package_DFN_QFN/QFN-56-1EP_7x7mm_P0.4mm_EP5.6x5.6mm","Package_DFN_QFN/QFN-56-1EP_7x7mm_P0.4mm_EP5.6x5.6mm_ThermalVias","Package_DFN_QFN/QFN-56-1EP_8x8mm_P0.5mm_EP4.3x4.3mm","Package_DFN_QFN/QFN-56-1EP_8x8mm_P0.5mm_EP4.3x4.3mm_ThermalVias","Package_DFN_QFN/QFN-56-1EP_8x8mm_P0.5mm_EP4.5x5.2mm","Package_DFN_QFN/QFN-56-1EP_8x8mm_P0.5mm_EP4.5x5.2mm_ThermalVias","Package_DFN_QFN/QFN-56-1EP_8x8mm_P0.5mm_EP4.5x5.2mm_ThermalVias_TopTented","Package_DFN_QFN/QFN-56-1EP_8x8mm_P0.5mm_EP5.6x5.6mm","Package_DFN_QFN/QFN-56-1EP_8x8mm_P0.5mm_EP5.6x5.6mm_ThermalVias","Package_DFN_QFN/QFN-56-1EP_8x8mm_P0.5mm_EP5.9x5.9mm","Package_DFN_QFN/QFN-56-1EP_8x8mm_P0.5mm_EP5.9x5.9mm_ThermalVias","Package_DFN_QFN/QFN-56-1EP_8x8mm_P0.5mm_EP6.1x6.1mm","Package_DFN_QFN/QFN-56-1EP_8x8mm_P0.5mm_EP6.1x6.1mm_ThermalVias","Package_DFN_QFN/QFN-60-1EP_7x7mm_P0.4mm_EP3.4x3.4mm","Package_DFN_QFN/QFN-60-1EP_7x7mm_P0.4mm_EP3.4x3.4mm_ThermalVias","Package_DFN_QFN/QFN-64-1EP_8x8mm_P0.4mm_EP6.5x6.5mm","Package_DFN_QFN/QFN-64-1EP_8x8mm_P0.4mm_EP6.5x6.5mm_ThermalVias","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP3.4x3.4mm","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP3.4x3.4mm_ThermalVias","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP3.8x3.8mm","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP3.8x3.8mm_ThermalVias","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP4.1x4.1mm","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP4.1x4.1mm_ThermalVias","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP4.35x4.35mm","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP4.35x4.35mm_ThermalVias","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP4.7x4.7mm","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP4.7x4.7mm_ThermalVias","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP5.2x5.2mm","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP5.2x5.2mm_ThermalVias","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP5.45x5.45mm","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP5.45x5.45mm_ThermalVias","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP5.4x5.4mm","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP5.4x5.4mm_ThermalVias","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP5.7x5.7mm","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP5.7x5.7mm_ThermalVias","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP6x6mm","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP6x6mm_ThermalVias","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP7.15x7.15mm","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP7.15x7.15mm_ThermalVias","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP7.25x7.25mm","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP7.35x7.35mm","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP7.3x7.3mm","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP7.3x7.3mm_ThermalVias","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP7.5x7.5mm","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP7.5x7.5mm_ThermalVias","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP7.65x7.65mm","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP7.65x7.65mm_ThermalVias","Package_DFN_QFN/QFN-68-1EP_8x8mm_P0.4mm_EP5.2x5.2mm","Package_DFN_QFN/QFN-68-1EP_8x8mm_P0.4mm_EP5.2x5.2mm_ThermalVias","Package_DFN_QFN/QFN-68-1EP_8x8mm_P0.4mm_EP6.4x6.4mm","Package_DFN_QFN/QFN-68-1EP_8x8mm_P0.4mm_EP6.4x6.4mm_ThermalVias","Package_DFN_QFN/QFN-72-1EP_10x10mm_P0.5mm_EP6x6mm","Package_DFN_QFN/QFN-72-1EP_10x10mm_P0.5mm_EP6x6mm_ThermalVias","Package_DFN_QFN/QFN-76-1EP_9x9mm_P0.4mm_EP3.8x3.8mm","Package_DFN_QFN/QFN-76-1EP_9x9mm_P0.4mm_EP3.8x3.8mm_ThermalVias","Package_DFN_QFN/QFN-76-1EP_9x9mm_P0.4mm_EP5.81x6.31mm","Package_DFN_QFN/QFN-76-1EP_9x9mm_P0.4mm_EP5.81x6.31mm_ThermalVias","Package_DFN_QFN/QFN-8-1EP_6x5mm_P1.27mm_EP3.4x4.2mm","Package_DFN_QFN/QFN-80-1EP_10x10mm_P0.4mm_EP3.4x3.4mm","Package_DFN_QFN/QFN-80-1EP_10x10mm_P0.4mm_EP3.4x3.4mm_ThermalVias","Package_DFN_QFN/Qorvo_DFN-8-1EP_2x2mm_P0.5mm","Package_DFN_QFN/Qorvo_TQFN66-48-1EP_6x6mm_P0.4mm_EP4.2x4.2mm","Package_DFN_QFN/Qorvo_TQFN66-48-1EP_6x6mm_P0.4mm_EP4.2x4.2mm_ThermalVias","Package_DFN_QFN/ROHM_DFN0604-3","Package_DFN_QFN/Renesas_UQFN-16_2x2mm_P0.4mm","Package_DFN_QFN/Renesas_UQFN-20_2x3mm_P0.4mm_LayoutBorder4x6y","Package_DFN_QFN/ST_DFN-10-1EP_3x3mm_P0.5mm_EP0.62x0.98mm","Package_DFN_QFN/ST_DFN-10-1EP_3x3mm_P0.5mm_EP0.62x0.98mm_ThermalVias","Package_DFN_QFN/ST_UFDFPN-12-1EP_3x3mm_P0.5mm_EP1.4x2.55mm","Package_DFN_QFN/ST_UFQFPN-20_3x3mm_P0.5mm","Package_DFN_QFN/ST_UQFN-6L_1.5x1.7mm_P0.5mm","Package_DFN_QFN/SiliconLabs_QFN-20-1EP_3x3mm_P0.5mm_EP1.8x1.8mm","Package_DFN_QFN/SiliconLabs_QFN-20-1EP_3x3mm_P0.5mm_EP1.8x1.8mm_ThermalVias","Package_DFN_QFN/TDFN-10-1EP_2x3mm_P0.5mm_EP0.9x2mm","Package_DFN_QFN/TDFN-10-1EP_2x3mm_P0.5mm_EP0.9x2mm_ThermalVias","Package_DFN_QFN/TDFN-12-1EP_3x3mm_P0.4mm_EP1.7x2.45mm","Package_DFN_QFN/TDFN-12-1EP_3x3mm_P0.4mm_EP1.7x2.45mm_ThermalVias","Package_DFN_QFN/TDFN-12_2x3mm_P0.5mm","Package_DFN_QFN/TDFN-14-1EP_3x3mm_P0.4mm_EP1.78x2.35mm","Package_DFN_QFN/TDFN-14-1EP_3x3mm_P0.4mm_EP1.78x2.35mm_ThermalVias","Package_DFN_QFN/TDFN-6-1EP_1.2x1.2mm_P0.4mm_EP0.3x0.94mm","Package_DFN_QFN/TDFN-6-1EP_2.5x2.5mm_P0.65mm_EP1.3x2mm","Package_DFN_QFN/TDFN-6-1EP_2.5x2.5mm_P0.65mm_EP1.3x2mm_ThermalVias","Package_DFN_QFN/TDFN-8-1EP_2x2mm_P0.5mm_EP0.8x1.2mm","Package_DFN_QFN/TDFN-8-1EP_3x2mm_P0.5mm_EP1.3x1.4mm","Package_DFN_QFN/TDFN-8-1EP_3x2mm_P0.5mm_EP1.4x1.4mm","Package_DFN_QFN/TDFN-8-1EP_3x2mm_P0.5mm_EP1.80x1.65mm","Package_DFN_QFN/TDFN-8-1EP_3x2mm_P0.5mm_EP1.80x1.65mm_ThermalVias","Package_DFN_QFN/TDFN-8_1.4x1.6mm_P0.4mm","Package_DFN_QFN/TQFN-16-1EP_3x3mm_P0.5mm_EP1.23x1.23mm","Package_DFN_QFN/TQFN-16-1EP_3x3mm_P0.5mm_EP1.23x1.23mm_ThermalVias","Package_DFN_QFN/TQFN-16-1EP_3x3mm_P0.5mm_EP1.6x1.6mm","Package_DFN_QFN/TQFN-16-1EP_4x4mm_P0.65mm_EP2.1x2.1mm","Package_DFN_QFN/TQFN-16-1EP_4x4mm_P0.65mm_EP2.1x2.1mm_ThermalVias","Package_DFN_QFN/TQFN-16-1EP_5x5mm_P0.8mm_EP2.29x2.29mm","Package_DFN_QFN/TQFN-16-1EP_5x5mm_P0.8mm_EP2.29x2.29mm_ThermalVias","Package_DFN_QFN/TQFN-16-1EP_5x5mm_P0.8mm_EP3.1x3.1mm","Package_DFN_QFN/TQFN-16-1EP_5x5mm_P0.8mm_EP3.1x3.1mm_ThermalVias","Package_DFN_QFN/TQFN-20-1EP_4x4mm_P0.5mm_EP2.1x2.1mm","Package_DFN_QFN/TQFN-20-1EP_4x4mm_P0.5mm_EP2.1x2.1mm_ThermalVias","Package_DFN_QFN/TQFN-20-1EP_4x4mm_P0.5mm_EP2.9x2.9mm","Package_DFN_QFN/TQFN-20-1EP_4x4mm_P0.5mm_EP2.9x2.9mm_ThermalVias","Package_DFN_QFN/TQFN-20-1EP_5x5mm_P0.65mm_EP3.1x3.1mm","Package_DFN_QFN/TQFN-20-1EP_5x5mm_P0.65mm_EP3.1x3.1mm_ThermalVias","Package_DFN_QFN/TQFN-20-1EP_5x5mm_P0.65mm_EP3.25x3.25mm","Package_DFN_QFN/TQFN-20-1EP_5x5mm_P0.65mm_EP3.25x3.25mm_ThermalVias","Package_DFN_QFN/TQFN-24-1EP_4x4mm_P0.5mm_EP2.1x2.1mm","Package_DFN_QFN/TQFN-24-1EP_4x4mm_P0.5mm_EP2.1x2.1mm_ThermalVias","Package_DFN_QFN/TQFN-24-1EP_4x4mm_P0.5mm_EP2.6x2.6mm","Package_DFN_QFN/TQFN-24-1EP_4x4mm_P0.5mm_EP2.6x2.6mm_ThermalVias","Package_DFN_QFN/TQFN-24-1EP_4x4mm_P0.5mm_EP2.8x2.8mm_PullBack","Package_DFN_QFN/TQFN-24-1EP_4x4mm_P0.5mm_EP2.8x2.8mm_PullBack_ThermalVias","Package_DFN_QFN/TQFN-28-1EP_5x5mm_P0.5mm_EP2.7x2.7mm","Package_DFN_QFN/TQFN-28-1EP_5x5mm_P0.5mm_EP2.7x2.7mm_ThermalVias","Package_DFN_QFN/TQFN-28-1EP_5x5mm_P0.5mm_EP3.25x3.25mm","Package_DFN_QFN/TQFN-28-1EP_5x5mm_P0.5mm_EP3.25x3.25mm_ThermalVias","Package_DFN_QFN/TQFN-32-1EP_5x5mm_P0.5mm_EP2.1x2.1mm","Package_DFN_QFN/TQFN-32-1EP_5x5mm_P0.5mm_EP2.1x2.1mm_ThermalVias","Package_DFN_QFN/TQFN-32-1EP_5x5mm_P0.5mm_EP3.1x3.1mm","Package_DFN_QFN/TQFN-32-1EP_5x5mm_P0.5mm_EP3.1x3.1mm_ThermalVias","Package_DFN_QFN/TQFN-32-1EP_5x5mm_P0.5mm_EP3.4x3.4mm","Package_DFN_QFN/TQFN-32-1EP_5x5mm_P0.5mm_EP3.4x3.4mm_ThermalVias","Package_DFN_QFN/TQFN-40-1EP_5x5mm_P0.4mm_EP3.5x3.5mm","Package_DFN_QFN/TQFN-40-1EP_5x5mm_P0.4mm_EP3.5x3.5mm_ThermalVias","Package_DFN_QFN/TQFN-44-1EP_7x7mm_P0.5mm_EP4.7x4.7mm","Package_DFN_QFN/TQFN-44-1EP_7x7mm_P0.5mm_EP4.7x4.7mm_ThermalVias","Package_DFN_QFN/TQFN-48-1EP_7x7mm_P0.5mm_EP5.1x5.1mm","Package_DFN_QFN/TQFN-48-1EP_7x7mm_P0.5mm_EP5.1x5.1mm_ThermalVias","Package_DFN_QFN/Texas_B3QFN-14-1EP_5x5.5mm_P0.65mm","Package_DFN_QFN/Texas_B3QFN-14-1EP_5x5.5mm_P0.65mm_ThermalVia","Package_DFN_QFN/Texas_DLH0010A_WSON-10-1EP_2.2x2mm_P0.4mm_EP0.9x1.5mm","Package_DFN_QFN/Texas_DLH0010A_WSON-10-1EP_2.2x2mm_P0.4mm_EP0.9x1.5mm_ThermalVias","Package_DFN_QFN/Texas_DRB0008A","Package_DFN_QFN/Texas_DSQ0010A_WSON-10-1EP_2x2mm_P0.4mm_EP0.9x1.5mm","Package_DFN_QFN/Texas_DSQ0010A_WSON-10-1EP_2x2mm_P0.4mm_EP0.9x1.5mm_ThermalVias","Package_DFN_QFN/Texas_MOF0009A","Package_DFN_QFN/Texas_PicoStar_DFN-3_0.69x0.60mm","Package_DFN_QFN/Texas_QFN-41_10x16mm","Package_DFN_QFN/Texas_R-PUQFN-N10","Package_DFN_QFN/Texas_R-PUQFN-N12","Package_DFN_QFN/Texas_RDX0007A_QFN-FCMOD-7-3.3x4mm-P0.5mm_4EP","Package_DFN_QFN/Texas_REE0036A_WQFN-36-1EP_4x5mm_P0.4mm_EP2.7x3.7mm","Package_DFN_QFN/Texas_REE0036A_WQFN-36-1EP_4x5mm_P0.4mm_EP2.7x3.7mm_ThermalVias","Package_DFN_QFN/Texas_REF0038A_WQFN-38-2EP_6x4mm_P0.4","Package_DFN_QFN/Texas_RGC0064B_VQFN-64-1EP_9x9mm_P0.5mm_EP4.25x4.25mm","Package_DFN_QFN/Texas_RGC0064B_VQFN-64-1EP_9x9mm_P0.5mm_EP4.25x4.25mm_ThermalVias","Package_DFN_QFN/Texas_RGE0024C_VQFN-24-1EP_4x4mm_P0.5mm_EP2.1x2.1mm","Package_DFN_QFN/Texas_RGE0024C_VQFN-24-1EP_4x4mm_P0.5mm_EP2.1x2.1mm_ThermalVias","Package_DFN_QFN/Texas_RGE0024H_VQFN-24-1EP_4x4mm_P0.5mm_EP2.7x2.7mm","Package_DFN_QFN/Texas_RGE0024H_VQFN-24-1EP_4x4mm_P0.5mm_EP2.7x2.7mm_ThermalVias","Package_DFN_QFN/Texas_RGP0020D_VQFN-20-1EP_4x4mm_P0.5mm_EP2.7x2.7mm","Package_DFN_QFN/Texas_RGP0020D_VQFN-20-1EP_4x4mm_P0.5mm_EP2.7x2.7mm_ThermalVias","Package_DFN_QFN/Texas_RGP0020H_VQFN-20-1EP_4x4mm_P0.5mm_EP2.4x2.4mm","Package_DFN_QFN/Texas_RGP0020H_VQFN-20-1EP_4x4mm_P0.5mm_EP2.4x2.4mm_ThermalVias","Package_DFN_QFN/Texas_RGV0016A_VQFN-16-1EP_4x4mm_P0.65mm_EP2.1x2.1mm","Package_DFN_QFN/Texas_RGV0016A_VQFN-16-1EP_4x4mm_P0.65mm_EP2.1x2.1mm_ThermalVias","Package_DFN_QFN/Texas_RGW0020A_VQFN-20-1EP_5x5mm_P0.65mm_EP3.15x3.15mm","Package_DFN_QFN/Texas_RGW0020A_VQFN-20-1EP_5x5mm_P0.65mm_EP3.15x3.15mm_ThermalVias","Package_DFN_QFN/Texas_RGY_R-PVQFN-N16_EP2.05x2.55mm","Package_DFN_QFN/Texas_RGY_R-PVQFN-N16_EP2.05x2.55mm_ThermalVias","Package_DFN_QFN/Texas_RGY_R-PVQFN-N20_EP2.05x3.05mm","Package_DFN_QFN/Texas_RGY_R-PVQFN-N20_EP2.05x3.05mm_ThermalVias","Package_DFN_QFN/Texas_RGY_R-PVQFN-N24_EP2.05x3.1mm","Package_DFN_QFN/Texas_RGY_R-PVQFN-N24_EP2.05x3.1mm_ThermalVias","Package_DFN_QFN/Texas_RGZ0048A_VQFN-48-1EP_7x7mm_P0.5mm_EP5.15x5.15mm","Package_DFN_QFN/Texas_RGZ0048A_VQFN-48-1EP_7x7mm_P0.5mm_EP5.15x5.15mm_ThermalVias","Package_DFN_QFN/Texas_RHA0040B_VQFN-40-1EP_6x6mm_P0.5mm_EP4.15x4.15mm","Package_DFN_QFN/Texas_RHA0040B_VQFN-40-1EP_6x6mm_P0.5mm_EP4.15x4.15mm_ThermalVias","Package_DFN_QFN/Texas_RHA0040D_VQFN-40-1EP_6x6mm_P0.5mm_EP2.9x2.9mm","Package_DFN_QFN/Texas_RHA0040D_VQFN-40-1EP_6x6mm_P0.5mm_EP2.9x2.9mm_ThermalVias","Package_DFN_QFN/Texas_RHA0040E_VQFN-40-1EP_6x6mm_P0.5mm_EP3.52x2.62mm","Package_DFN_QFN/Texas_RHA0040E_VQFN-40-1EP_6x6mm_P0.5mm_EP3.52x2.62mm_ThermalVias","Package_DFN_QFN/Texas_RHA_VQFN-40-1EP_6x6mm_P0.5mm_EP4.6x4.6mm","Package_DFN_QFN/Texas_RHA_VQFN-40-1EP_6x6mm_P0.5mm_EP4.6x4.6mm_ThermalVias","Package_DFN_QFN/Texas_RHB0032E_VQFN-32-1EP_5x5mm_P0.5mm_EP3.45x3.45mm","Package_DFN_QFN/Texas_RHB0032E_VQFN-32-1EP_5x5mm_P0.5mm_EP3.45x3.45mm_ThermalVias","Package_DFN_QFN/Texas_RHB0032M_VQFN-32-1EP_5x5mm_P0.5mm_EP2.1x2.1mm","Package_DFN_QFN/Texas_RHB0032M_VQFN-32-1EP_5x5mm_P0.5mm_EP2.1x2.1mm_ThermalVias","Package_DFN_QFN/Texas_RHF0024A_VQFN-24-1EP_4x5mm_P0.5mm_EP2.65x3.65mm","Package_DFN_QFN/Texas_RHF0024A_VQFN-24-1EP_4x5mm_P0.5mm_EP2.65x3.65mm_ThermalVias","Package_DFN_QFN/Texas_RHH0036C_VQFN-36-1EP_6x6mm_P0.5mm_EP4.4x4.4mm","Package_DFN_QFN/Texas_RHH0036C_VQFN-36-1EP_6x6mm_P0.5mm_EP4.4x4.4mm_ThermalVias","Package_DFN_QFN/Texas_RJE0020A_VQFN-20-1EP_3x3mm_P0.45mm_EP0.675x0.76mm","Package_DFN_QFN/Texas_RJE0020A_VQFN-20-1EP_3x3mm_P0.45mm_EP0.675x0.76mm_ThermalVias","Package_DFN_QFN/Texas_RMG0012A_WQFN-12_1.8x1.8mm_P0.4mm","Package_DFN_QFN/Texas_RMQ0024A_WQFN-24-1EP_3x3mm_P0.4mm_EP1.9x1.9mm","Package_DFN_QFN/Texas_RMQ0024A_WQFN-24-1EP_3x3mm_P0.4mm_EP1.9x1.9mm_ThermalVias","Package_DFN_QFN/Texas_RNH0030A_WQFN-30-1EP_2.5x4.5mm_P0.4mm_EP1.2x3.2mm","Package_DFN_QFN/Texas_RNH0030A_WQFN-30-1EP_2.5x4.5mm_P0.4mm_EP1.2x3.2mm_ThermalVias","Package_DFN_QFN/Texas_RNN0018A","Package_DFN_QFN/Texas_RNP0030B_WQFN-30-1EP_4x6mm_P0.5mm_EP1.8x4.5mm","Package_DFN_QFN/Texas_RNP0030B_WQFN-30-1EP_4x6mm_P0.5mm_EP1.8x4.5mm_ThermalVias","Package_DFN_QFN/Texas_RNQ0040A_WQFN-40-1EP_6x4mm_P0.4mm_EP4.7x2.7mm","Package_DFN_QFN/Texas_RNQ0040A_WQFN-40-1EP_6x4mm_P0.4mm_EP4.7x2.7mm_ThermalVias","Package_DFN_QFN/Texas_RNX0012C_VQFN-14-11-1EP_2x3mm_P0.5mm_EP0.25x1.825mm","Package_DFN_QFN/Texas_RPU0010A_VQFN-HR-10_2x2mm_P0.5mm","Package_DFN_QFN/Texas_RQM0029A_VQFN-29_4x4mm_P0.4mm","Package_DFN_QFN/Texas_RRW0024A_WQFN-24-1EP_3x3mm_P0.4mm_EP1.9x1.9mm","Package_DFN_QFN/Texas_RRW0024A_WQFN-24-1EP_3x3mm_P0.4mm_EP1.9x1.9mm_ThermalVias","Package_DFN_QFN/Texas_RSA_VQFN-16-1EP_4x4mm_P0.65mm_EP2.7x2.7mm","Package_DFN_QFN/Texas_RSA_VQFN-16-1EP_4x4mm_P0.65mm_EP2.7x2.7mm_ThermalVias","Package_DFN_QFN/Texas_RSN_WQFN-32-1EP_4x4mm_P0.4mm_EP2.8x2.8mm","Package_DFN_QFN/Texas_RSN_WQFN-32-1EP_4x4mm_P0.4mm_EP2.8x2.8mm_ThermalVias","Package_DFN_QFN/Texas_RSW0010A_UQFN-10_1.4x1.8mm_P0.4mm","Package_DFN_QFN/Texas_RTE0016D_WQFN-16-1EP_3x3mm_P0.5mm_EP0.8x0.8mm","Package_DFN_QFN/Texas_RTE0016D_WQFN-16-1EP_3x3mm_P0.5mm_EP0.8x0.8mm_ThermalVias","Package_DFN_QFN/Texas_RTE_WQFN-16-1EP_3x3mm_P0.5mm_EP1.2x0.8mm","Package_DFN_QFN/Texas_RTE_WQFN-16-1EP_3x3mm_P0.5mm_EP1.2x0.8mm_ThermalVias","Package_DFN_QFN/Texas_RTW_WQFN-24-1EP_4x4mm_P0.5mm_EP2.7x2.7mm","Package_DFN_QFN/Texas_RTW_WQFN-24-1EP_4x4mm_P0.5mm_EP2.7x2.7mm_ThermalVias","Package_DFN_QFN/Texas_RTY_WQFN-16-1EP_4x4mm_P0.65mm_EP2.1x2.1mm","Package_DFN_QFN/Texas_RTY_WQFN-16-1EP_4x4mm_P0.65mm_EP2.1x2.1mm_ThermalVias","Package_DFN_QFN/Texas_RUK0020B_WQFN-20-1EP_3x3mm_P0.4mm_EP1.7x1.7mm","Package_DFN_QFN/Texas_RUK0020B_WQFN-20-1EP_3x3mm_P0.4mm_EP1.7x1.7mm_ThermalVias","Package_DFN_QFN/Texas_RUM0016A_WQFN-16-1EP_4x4mm_P0.65mm_EP2.6x2.6mm","Package_DFN_QFN/Texas_RUM0016A_WQFN-16-1EP_4x4mm_P0.65mm_EP2.6x2.6mm_ThermalVias","Package_DFN_QFN/Texas_RUM0016E_WQFN-16-1EP_4x4mm_P0.65mm_EP2.5x2.5mm","Package_DFN_QFN/Texas_RUM0016E_WQFN-16-1EP_4x4mm_P0.65mm_EP2.5x2.5mm_ThermalVias","Package_DFN_QFN/Texas_RUN0010A_WQFN-10_2x2mm_P0.5mm","Package_DFN_QFN/Texas_RVA_VQFN-16-1EP_3.5x3.5mm_P0.5mm_EP2.14x2.14mm","Package_DFN_QFN/Texas_RVA_VQFN-16-1EP_3.5x3.5mm_P0.5mm_EP2.14x2.14mm_ThermalVias","Package_DFN_QFN/Texas_RVC0020A_WQFN-20-1EP_3x4mm_P0.5mm_EP1.6x2.6mm","Package_DFN_QFN/Texas_RVC0020A_WQFN-20-1EP_3x4mm_P0.5mm_EP1.6x2.6mm_ThermalVias","Package_DFN_QFN/Texas_RVE0028A_VQFN-28-1EP_3.5x4.5mm_P0.4mm_EP2.1x3.1mm","Package_DFN_QFN/Texas_RVE0028A_VQFN-28-1EP_3.5x4.5mm_P0.4mm_EP2.1x3.1mm_ThermalVias","Package_DFN_QFN/Texas_RWH0032A","Package_DFN_QFN/Texas_RWH0032A_ThermalVias","Package_DFN_QFN/Texas_RWU0007A_VQFN-7_2x2mm_P0.5mm","Package_DFN_QFN/Texas_S-PDSO-N10_EP1.2x2mm","Package_DFN_QFN/Texas_S-PDSO-N10_EP1.2x2mm_ThermalVias","Package_DFN_QFN/Texas_S-PVQFN-N14","Package_DFN_QFN/Texas_S-PVQFN-N14_ThermalVias","Package_DFN_QFN/Texas_S-PWQFN-N100_EP5.5x5.5mm","Package_DFN_QFN/Texas_S-PWQFN-N100_EP5.5x5.5mm_ThermalVias","Package_DFN_QFN/Texas_S-PWQFN-N20","Package_DFN_QFN/Texas_S-PX2QFN-14","Package_DFN_QFN/Texas_UQFN-10_1.5x2mm_P0.5mm","Package_DFN_QFN/Texas_UQFN-8_1.5x1.5mm_P0.5mm","Package_DFN_QFN/Texas_VQFN-HR-12_2x2.5mm_P0.5mm","Package_DFN_QFN/Texas_VQFN-HR-12_2x2.5mm_P0.5mm_ThermalVias","Package_DFN_QFN/Texas_VQFN-HR-20_3x2.5mm_P0.5mm_RQQ0011A","Package_DFN_QFN/Texas_VQFN-RHL-20","Package_DFN_QFN/Texas_VQFN-RHL-20_ThermalVias","Package_DFN_QFN/Texas_VQFN-RNR0011A-11","Package_DFN_QFN/Texas_WQFN-MR-100_3x3-DapStencil","Package_DFN_QFN/Texas_WQFN-MR-100_ThermalVias_3x3-DapStencil","Package_DFN_QFN/Texas_X2QFN-12_1.6x1.6mm_P0.4mm","Package_DFN_QFN/Texas_X2QFN-RUE-12_1.4x2mm_P0.4mm","Package_DFN_QFN/UDC-QFN-20-4EP_3x4mm_P0.5mm_EP0.41x0.25mm","Package_DFN_QFN/UDFN-10_1.35x2.6mm_P0.5mm","Package_DFN_QFN/UDFN-4-1EP_1x1mm_P0.65mm_EP0.48x0.48mm","Package_DFN_QFN/UDFN-9_1.0x3.8mm_P0.5mm","Package_DFN_QFN/UFQFPN-32-1EP_5x5mm_P0.5mm_EP3.5x3.5mm","Package_DFN_QFN/UFQFPN-32-1EP_5x5mm_P0.5mm_EP3.5x3.5mm_ThermalVias","Package_DFN_QFN/UQFN-10_1.3x1.8mm_P0.4mm","Package_DFN_QFN/UQFN-10_1.4x1.8mm_P0.4mm","Package_DFN_QFN/UQFN-10_1.6x2.1mm_P0.5mm","Package_DFN_QFN/UQFN-12-1EP_2x2mm_P0.4mm_EP1.1x1.1mm","Package_DFN_QFN/UQFN-16-1EP_3x3mm_P0.5mm_EP1.75x1.75mm","Package_DFN_QFN/UQFN-16-1EP_4x4mm_P0.65mm_EP2.6x2.6mm","Package_DFN_QFN/UQFN-16-1EP_4x4mm_P0.65mm_EP2.6x2.6mm_ThermalVias","Package_DFN_QFN/UQFN-16-1EP_4x4mm_P0.65mm_EP2.7x2.7mm","Package_DFN_QFN/UQFN-16_1.8x2.6mm_P0.4mm","Package_DFN_QFN/UQFN-20-1EP_3x3mm_P0.4mm_EP1.7x1.7mm","Package_DFN_QFN/UQFN-20-1EP_3x3mm_P0.4mm_EP1.7x1.7mm_ThermalVias","Package_DFN_QFN/UQFN-20-1EP_3x3mm_P0.4mm_EP1.85x1.85mm","Package_DFN_QFN/UQFN-20-1EP_3x3mm_P0.4mm_EP1.85x1.85mm_ThermalVias","Package_DFN_QFN/UQFN-20-1EP_4x4mm_P0.5mm_EP2.8x2.8mm","Package_DFN_QFN/UQFN-20-1EP_4x4mm_P0.5mm_EP2.8x2.8mm_ThermalVias","Package_DFN_QFN/UQFN-20_3x3mm_P0.4mm","Package_DFN_QFN/UQFN-28-1EP_4x4mm_P0.4mm_EP2.35x2.35mm","Package_DFN_QFN/UQFN-28-1EP_4x4mm_P0.4mm_EP2.35x2.35mm_ThermalVias","Package_DFN_QFN/UQFN-32_5x5mm_P0.5mm","Package_DFN_QFN/UQFN-40-1EP_5x5mm_P0.4mm_EP3.8x3.8mm","Package_DFN_QFN/UQFN-40-1EP_5x5mm_P0.4mm_EP3.8x3.8mm_ThermalVias","Package_DFN_QFN/UQFN-48-1EP_6x6mm_P0.4mm_EP4.45x4.45mm","Package_DFN_QFN/UQFN-48-1EP_6x6mm_P0.4mm_EP4.45x4.45mm_ThermalVias","Package_DFN_QFN/UQFN-48-1EP_6x6mm_P0.4mm_EP4.62x4.62mm","Package_DFN_QFN/UQFN-48-1EP_6x6mm_P0.4mm_EP4.62x4.62mm_ThermalVias","Package_DFN_QFN/VDFN-8-1EP_2x2mm_P0.5mm_EP0.9x1.7mm","Package_DFN_QFN/VQFN-100-1EP_12x12mm_P0.4mm_EP8x8mm","Package_DFN_QFN/VQFN-100-1EP_12x12mm_P0.4mm_EP8x8mm_ThermalVias","Package_DFN_QFN/VQFN-12-1EP_4x4mm_P0.8mm_EP2.1x2.1mm","Package_DFN_QFN/VQFN-12-1EP_4x4mm_P0.8mm_EP2.1x2.1mm_ThermalVias","Package_DFN_QFN/VQFN-16-1EP_3x3mm_P0.5mm_EP1.1x1.1mm","Package_DFN_QFN/VQFN-16-1EP_3x3mm_P0.5mm_EP1.1x1.1mm_ThermalVias","Package_DFN_QFN/VQFN-16-1EP_3x3mm_P0.5mm_EP1.45x1.45mm","Package_DFN_QFN/VQFN-16-1EP_3x3mm_P0.5mm_EP1.45x1.45mm_ThermalVias","Package_DFN_QFN/VQFN-16-1EP_3x3mm_P0.5mm_EP1.68x1.68mm","Package_DFN_QFN/VQFN-16-1EP_3x3mm_P0.5mm_EP1.68x1.68mm_ThermalVias","Package_DFN_QFN/VQFN-16-1EP_3x3mm_P0.5mm_EP1.6x1.6mm","Package_DFN_QFN/VQFN-16-1EP_3x3mm_P0.5mm_EP1.6x1.6mm_ThermalVias","Package_DFN_QFN/VQFN-16-1EP_3x3mm_P0.5mm_EP1.8x1.8mm","Package_DFN_QFN/VQFN-16-1EP_3x3mm_P0.5mm_EP1.8x1.8mm_ThermalVias","Package_DFN_QFN/VQFN-20-1EP_3x3mm_P0.45mm_EP1.55x1.55mm","Package_DFN_QFN/VQFN-20-1EP_3x3mm_P0.45mm_EP1.55x1.55mm_ThermalVias","Package_DFN_QFN/VQFN-20-1EP_3x3mm_P0.4mm_EP1.7x1.7mm","Package_DFN_QFN/VQFN-20-1EP_3x3mm_P0.4mm_EP1.7x1.7mm_ThermalVias","Package_DFN_QFN/VQFN-24-1EP_4x4mm_P0.5mm_EP2.45x2.45mm","Package_DFN_QFN/VQFN-24-1EP_4x4mm_P0.5mm_EP2.45x2.45mm_ThermalVias","Package_DFN_QFN/VQFN-24-1EP_4x4mm_P0.5mm_EP2.5x2.5mm","Package_DFN_QFN/VQFN-24-1EP_4x4mm_P0.5mm_EP2.5x2.5mm_ThermalVias","Package_DFN_QFN/VQFN-28-1EP_4x4mm_P0.45mm_EP2.4x2.4mm","Package_DFN_QFN/VQFN-28-1EP_4x4mm_P0.45mm_EP2.4x2.4mm_ThermalVias","Package_DFN_QFN/VQFN-28-1EP_4x5mm_P0.5mm_EP2.55x3.55mm","Package_DFN_QFN/VQFN-28-1EP_4x5mm_P0.5mm_EP2.55x3.55mm_ThermalVias","Package_DFN_QFN/VQFN-28-1EP_5x5mm_P0.5mm_EP3.25x3.25mm","Package_DFN_QFN/VQFN-28-1EP_5x5mm_P0.5mm_EP3.25x3.25mm_ThermalVias","Package_DFN_QFN/VQFN-28-1EP_5x5mm_P0.5mm_EP3.7x3.7mm","Package_DFN_QFN/VQFN-28-1EP_5x5mm_P0.5mm_EP3.7x3.7mm_ThermalVias","Package_DFN_QFN/VQFN-32-1EP_4x4mm_P0.4mm_EP2.8x2.8mm","Package_DFN_QFN/VQFN-32-1EP_4x4mm_P0.4mm_EP2.8x2.8mm_ThermalVias","Package_DFN_QFN/VQFN-32-1EP_5x5mm_P0.5mm_EP3.15x3.15mm","Package_DFN_QFN/VQFN-32-1EP_5x5mm_P0.5mm_EP3.15x3.15mm_ThermalVias","Package_DFN_QFN/VQFN-32-1EP_5x5mm_P0.5mm_EP3.1x3.1mm","Package_DFN_QFN/VQFN-32-1EP_5x5mm_P0.5mm_EP3.1x3.1mm_ThermalVias","Package_DFN_QFN/VQFN-32-1EP_5x5mm_P0.5mm_EP3.5x3.5mm","Package_DFN_QFN/VQFN-32-1EP_5x5mm_P0.5mm_EP3.5x3.5mm_ThermalVias","Package_DFN_QFN/VQFN-40-1EP_5x5mm_P0.4mm_EP3.3x3.3mm","Package_DFN_QFN/VQFN-40-1EP_5x5mm_P0.4mm_EP3.3x3.3mm_ThermalVias","Package_DFN_QFN/VQFN-40-1EP_5x5mm_P0.4mm_EP3.5x3.5mm","Package_DFN_QFN/VQFN-40-1EP_5x5mm_P0.4mm_EP3.5x3.5mm_ThermalVias","Package_DFN_QFN/VQFN-40-1EP_5x5mm_P0.4mm_EP3.6x3.6mm","Package_DFN_QFN/VQFN-40-1EP_5x5mm_P0.4mm_EP3.6x3.6mm_ThermalVias","Package_DFN_QFN/VQFN-40-1EP_5x5mm_P0.4mm_EP3.7x3.7mm","Package_DFN_QFN/VQFN-40-1EP_5x5mm_P0.4mm_EP3.7x3.7mm_ThermalVias","Package_DFN_QFN/VQFN-40-1EP_6x6mm_P0.5mm_EP3.5x3.5mm","Package_DFN_QFN/VQFN-40-1EP_6x6mm_P0.5mm_EP3.5x3.5mm_ThermalVias","Package_DFN_QFN/VQFN-46-1EP_5x6mm_P0.4mm_EP2.8x3.8mm","Package_DFN_QFN/VQFN-46-1EP_5x6mm_P0.4mm_EP2.8x3.8mm_ThermalVias","Package_DFN_QFN/VQFN-48-1EP_6x6mm_P0.4mm_EP4.1x4.1mm","Package_DFN_QFN/VQFN-48-1EP_6x6mm_P0.4mm_EP4.1x4.1mm_ThermalVias","Package_DFN_QFN/VQFN-48-1EP_7x7mm_P0.5mm_EP2.6x2.6mm","Package_DFN_QFN/VQFN-48-1EP_7x7mm_P0.5mm_EP2.6x2.6mm_ThermalVias","Package_DFN_QFN/VQFN-48-1EP_7x7mm_P0.5mm_EP4.1x4.1mm","Package_DFN_QFN/VQFN-48-1EP_7x7mm_P0.5mm_EP4.1x4.1mm_ThermalVias","Package_DFN_QFN/VQFN-48-1EP_7x7mm_P0.5mm_EP4.2x4.2mm","Package_DFN_QFN/VQFN-48-1EP_7x7mm_P0.5mm_EP4.2x4.2mm_ThermalVias","Package_DFN_QFN/VQFN-48-1EP_7x7mm_P0.5mm_EP5.15x5.15mm","Package_DFN_QFN/VQFN-48-1EP_7x7mm_P0.5mm_EP5.15x5.15mm_ThermalVias","Package_DFN_QFN/VQFN-56-1EP_8x8mm_P0.5mm_EP5.1x4.96mm","Package_DFN_QFN/VQFN-56-1EP_8x8mm_P0.5mm_EP5.1x4.96mm_ThermalVias","Package_DFN_QFN/VQFN-56-1EP_8x8mm_P0.5mm_EP5.5x5.06mm","Package_DFN_QFN/VQFN-56-1EP_8x8mm_P0.5mm_EP5.5x5.06mm_ThermalVias","Package_DFN_QFN/VQFN-64-1EP_9x9mm_P0.5mm_EP5.4x5.4mm","Package_DFN_QFN/VQFN-64-1EP_9x9mm_P0.5mm_EP5.4x5.4mm_ThermalVias","Package_DFN_QFN/VQFN-64-1EP_9x9mm_P0.5mm_EP7.15x7.15mm","Package_DFN_QFN/VQFN-64-1EP_9x9mm_P0.5mm_EP7.15x7.15mm_ThermalVias","Package_DFN_QFN/VQFN-68-1EP_8x8mm_P0.4mm_EP4.3x4.3mm","Package_DFN_QFN/Vishay_PowerPAK_MLP44-24L","Package_DFN_QFN/Vishay_PowerPAK_MLP44-24L_ThermalVias","Package_DFN_QFN/Vishay_PowerPAK_MLP55-27L","Package_DFN_QFN/Vishay_PowerPAK_MLP55-27L_R","Package_DFN_QFN/Vishay_PowerPAK_MLP55-27L_R_ThermalVias","Package_DFN_QFN/Vishay_PowerPAK_MLP55-27L_ThermalVias","Package_DFN_QFN/W-PDFN-8-1EP_6x5mm_P1.27mm_EP3x3mm","Package_DFN_QFN/WCH_QFN-16-1EP_3x3mm_P0.5mm_EP1.8x1.8mm","Package_DFN_QFN/WDFN-10-1EP_3x3mm_P0.5mm_EP1.8x2.5mm","Package_DFN_QFN/WDFN-10-1EP_3x3mm_P0.5mm_EP1.8x2.5mm_ThermalVias","Package_DFN_QFN/WDFN-12-1EP_3x3mm_P0.45mm_EP1.7x2.5mm","Package_DFN_QFN/WDFN-6-2EP_4.0x2.6mm_P0.65mm","Package_DFN_QFN/WDFN-8-1EP_2x2.2mm_P0.5mm_EP0.80x0.54","Package_DFN_QFN/WDFN-8-1EP_2x2mm_P0.5mm_EP0.8x1.2mm","Package_DFN_QFN/WDFN-8-1EP_3x2mm_P0.5mm_EP1.3x1.4mm","Package_DFN_QFN/WDFN-8-1EP_4x3mm_P0.65mm_EP2.4x1.8mm","Package_DFN_QFN/WDFN-8-1EP_4x3mm_P0.65mm_EP2.4x1.8mm_ThermalVias","Package_DFN_QFN/WDFN-8-1EP_6x5mm_P1.27mm_EP3.4x4mm","Package_DFN_QFN/WDFN-8-1EP_8x6mm_P1.27mm_EP6x4.8mm","Package_DFN_QFN/WDFN-8-1EP_8x6mm_P1.27mm_EP6x4.8mm_ThermalVias","Package_DFN_QFN/WDFN-8_2x2mm_P0.5mm","Package_DFN_QFN/WFDFPN-8-1EP_3x2mm_P0.5mm_EP1.25x1.35mm","Package_DFN_QFN/WQFN-14-1EP_2.5x2.5mm_P0.5mm_EP1.45x1.45mm","Package_DFN_QFN/WQFN-14-1EP_2.5x2.5mm_P0.5mm_EP1.45x1.45mm_ThermalVias","Package_DFN_QFN/WQFN-16-1EP_3x3mm_P0.5mm_EP1.68x1.68mm","Package_DFN_QFN/WQFN-16-1EP_3x3mm_P0.5mm_EP1.68x1.68mm_ThermalVias","Package_DFN_QFN/WQFN-16-1EP_3x3mm_P0.5mm_EP1.6x1.6mm","Package_DFN_QFN/WQFN-16-1EP_3x3mm_P0.5mm_EP1.6x1.6mm_ThermalVias","Package_DFN_QFN/WQFN-16-1EP_3x3mm_P0.5mm_EP1.75x1.75mm","Package_DFN_QFN/WQFN-16-1EP_3x3mm_P0.5mm_EP1.75x1.75mm_ThermalVias","Package_DFN_QFN/WQFN-16-1EP_4x4mm_P0.5mm_EP2.6x2.6mm","Package_DFN_QFN/WQFN-16-1EP_4x4mm_P0.5mm_EP2.6x2.6mm_ThermalVias","Package_DFN_QFN/WQFN-20-1EP_2.5x4.5mm_P0.5mm_EP1x2.9mm","Package_DFN_QFN/WQFN-20-1EP_3x3mm_P0.4mm_EP1.7x1.7mm","Package_DFN_QFN/WQFN-20-1EP_3x3mm_P0.4mm_EP1.7x1.7mm_ThermalVias","Package_DFN_QFN/WQFN-20-1EP_4x4mm_P0.5mm_EP2.7x2.7mm","Package_DFN_QFN/WQFN-20-1EP_4x4mm_P0.5mm_EP2.7x2.7mm_ThermalVias","Package_DFN_QFN/WQFN-24-1EP_4x4mm_P0.5mm_EP2.45x2.45mm","Package_DFN_QFN/WQFN-24-1EP_4x4mm_P0.5mm_EP2.45x2.45mm_ThermalVias","Package_DFN_QFN/WQFN-24-1EP_4x4mm_P0.5mm_EP2.6x2.6mm","Package_DFN_QFN/WQFN-24-1EP_4x4mm_P0.5mm_EP2.6x2.6mm_ThermalVias","Package_DFN_QFN/WQFN-28-1EP_4x4mm_P0.4mm_EP2.7x2.7mm","Package_DFN_QFN/WQFN-28-1EP_4x4mm_P0.4mm_EP2.7x2.7mm_ThermalVias","Package_DFN_QFN/WQFN-32-1EP_5x5mm_P0.5mm_EP3.1x3.1mm","Package_DFN_QFN/WQFN-38-1EP_5x7mm_P0.5mm_EP2.7x4.7mm","Package_DFN_QFN/WQFN-38-1EP_5x7mm_P0.5mm_EP2.7x4.7mm_ThermalVias","Package_DFN_QFN/WQFN-38-1EP_5x7mm_P0.5mm_EP3.15x5.15mm","Package_DFN_QFN/WQFN-38-1EP_5x7mm_P0.5mm_EP3.15x5.15mm_ThermalVias","Package_DFN_QFN/WQFN-38-1EP_5x7mm_P0.5mm_EP3.65x5.65mm","Package_DFN_QFN/WQFN-38-1EP_5x7mm_P0.5mm_EP3.65x5.65mm_ThermalVias","Package_DFN_QFN/WQFN-42-1EP_3.5x9mm_P0.5mm_EP2.05x7.55mm","Package_DFN_QFN/WQFN-42-1EP_3.5x9mm_P0.5mm_EP2.05x7.55mm_ThermalVias","Package_DIP/CERDIP-14_W7.62mm_SideBrazed","Package_DIP/CERDIP-14_W7.62mm_SideBrazed_LongPads","Package_DIP/CERDIP-14_W7.62mm_SideBrazed_LongPads_Socket","Package_DIP/CERDIP-14_W7.62mm_SideBrazed_Socket","Package_DIP/CERDIP-16_W7.62mm_SideBrazed","Package_DIP/CERDIP-16_W7.62mm_SideBrazed_LongPads","Package_DIP/CERDIP-16_W7.62mm_SideBrazed_LongPads_Socket","Package_DIP/CERDIP-16_W7.62mm_SideBrazed_Socket","Package_DIP/CERDIP-18_W7.62mm_SideBrazed","Package_DIP/CERDIP-18_W7.62mm_SideBrazed_LongPads","Package_DIP/CERDIP-18_W7.62mm_SideBrazed_LongPads_Socket","Package_DIP/CERDIP-18_W7.62mm_SideBrazed_Socket","Package_DIP/CERDIP-20_W7.62mm_SideBrazed","Package_DIP/CERDIP-20_W7.62mm_SideBrazed_LongPads","Package_DIP/CERDIP-20_W7.62mm_SideBrazed_LongPads_Socket","Package_DIP/CERDIP-20_W7.62mm_SideBrazed_Socket","Package_DIP/CERDIP-22_W7.62mm_SideBrazed","Package_DIP/CERDIP-22_W7.62mm_SideBrazed_LongPads","Package_DIP/CERDIP-22_W7.62mm_SideBrazed_LongPads_Socket","Package_DIP/CERDIP-22_W7.62mm_SideBrazed_Socket","Package_DIP/CERDIP-24_W7.62mm_SideBrazed","Package_DIP/CERDIP-24_W7.62mm_SideBrazed_LongPads","Package_DIP/CERDIP-24_W7.62mm_SideBrazed_LongPads_Socket","Package_DIP/CERDIP-24_W7.62mm_SideBrazed_Socket","Package_DIP/CERDIP-28_W7.62mm_SideBrazed","Package_DIP/CERDIP-28_W7.62mm_SideBrazed_LongPads","Package_DIP/CERDIP-28_W7.62mm_SideBrazed_LongPads_Socket","Package_DIP/CERDIP-28_W7.62mm_SideBrazed_Socket","Package_DIP/CERDIP-8_W7.62mm_SideBrazed","Package_DIP/CERDIP-8_W7.62mm_SideBrazed_LongPads","Package_DIP/CERDIP-8_W7.62mm_SideBrazed_LongPads_Socket","Package_DIP/CERDIP-8_W7.62mm_SideBrazed_Socket","Package_DIP/DIP-10_W10.16mm","Package_DIP/DIP-10_W10.16mm_LongPads","Package_DIP/DIP-10_W7.62mm","Package_DIP/DIP-10_W7.62mm_LongPads","Package_DIP/DIP-10_W7.62mm_SMDSocket_SmallPads","Package_DIP/DIP-10_W7.62mm_Socket","Package_DIP/DIP-10_W7.62mm_Socket_LongPads","Package_DIP/DIP-10_W8.89mm_SMDSocket_LongPads","Package_DIP/DIP-12_W10.16mm","Package_DIP/DIP-12_W10.16mm_LongPads","Package_DIP/DIP-12_W7.62mm","Package_DIP/DIP-12_W7.62mm_LongPads","Package_DIP/DIP-12_W7.62mm_SMDSocket_SmallPads","Package_DIP/DIP-12_W7.62mm_Socket","Package_DIP/DIP-12_W7.62mm_Socket_LongPads","Package_DIP/DIP-12_W8.89mm_SMDSocket_LongPads","Package_DIP/DIP-14_W10.16mm","Package_DIP/DIP-14_W10.16mm_LongPads","Package_DIP/DIP-14_W7.62mm","Package_DIP/DIP-14_W7.62mm_LongPads","Package_DIP/DIP-14_W7.62mm_SMDSocket_SmallPads","Package_DIP/DIP-14_W7.62mm_Socket","Package_DIP/DIP-14_W7.62mm_Socket_LongPads","Package_DIP/DIP-14_W8.89mm_SMDSocket_LongPads","Package_DIP/DIP-16_W10.16mm","Package_DIP/DIP-16_W10.16mm_LongPads","Package_DIP/DIP-16_W7.62mm","Package_DIP/DIP-16_W7.62mm_LongPads","Package_DIP/DIP-16_W7.62mm_SMDSocket_SmallPads","Package_DIP/DIP-16_W7.62mm_Socket","Package_DIP/DIP-16_W7.62mm_Socket_LongPads","Package_DIP/DIP-16_W8.89mm_SMDSocket_LongPads","Package_DIP/DIP-18_W7.62mm","Package_DIP/DIP-18_W7.62mm_LongPads","Package_DIP/DIP-18_W7.62mm_SMDSocket_SmallPads","Package_DIP/DIP-18_W7.62mm_Socket","Package_DIP/DIP-18_W7.62mm_Socket_LongPads","Package_DIP/DIP-18_W8.89mm_SMDSocket_LongPads","Package_DIP/DIP-20_W7.62mm","Package_DIP/DIP-20_W7.62mm_LongPads","Package_DIP/DIP-20_W7.62mm_SMDSocket_SmallPads","Package_DIP/DIP-20_W7.62mm_Socket","Package_DIP/DIP-20_W7.62mm_Socket_LongPads","Package_DIP/DIP-20_W8.89mm_SMDSocket_LongPads","Package_DIP/DIP-22_W10.16mm","Package_DIP/DIP-22_W10.16mm_LongPads","Package_DIP/DIP-22_W10.16mm_SMDSocket_SmallPads","Package_DIP/DIP-22_W10.16mm_Socket","Package_DIP/DIP-22_W10.16mm_Socket_LongPads","Package_DIP/DIP-22_W11.43mm_SMDSocket_LongPads","Package_DIP/DIP-22_W7.62mm","Package_DIP/DIP-22_W7.62mm_LongPads","Package_DIP/DIP-22_W7.62mm_SMDSocket_SmallPads","Package_DIP/DIP-22_W7.62mm_Socket","Package_DIP/DIP-22_W7.62mm_Socket_LongPads","Package_DIP/DIP-22_W8.89mm_SMDSocket_LongPads","Package_DIP/DIP-24_18.0mmx34.29mm_W15.24mm","Package_DIP/DIP-24_18.0mmx34.29mm_W15.24mm_LongPads","Package_DIP/DIP-24_18.0mmx34.29mm_W15.24mm_SMDSocket_SmallPads","Package_DIP/DIP-24_18.0mmx34.29mm_W15.24mm_Socket","Package_DIP/DIP-24_18.0mmx34.29mm_W15.24mm_Socket_LongPads","Package_DIP/DIP-24_W10.16mm","Package_DIP/DIP-24_W10.16mm_LongPads","Package_DIP/DIP-24_W10.16mm_SMDSocket_SmallPads","Package_DIP/DIP-24_W10.16mm_Socket","Package_DIP/DIP-24_W10.16mm_Socket_LongPads","Package_DIP/DIP-24_W11.43mm_SMDSocket_LongPads","Package_DIP/DIP-24_W15.24mm","Package_DIP/DIP-24_W15.24mm_LongPads","Package_DIP/DIP-24_W15.24mm_SMDSocket_SmallPads","Package_DIP/DIP-24_W15.24mm_Socket","Package_DIP/DIP-24_W15.24mm_Socket_LongPads","Package_DIP/DIP-24_W16.51mm_SMDSocket_LongPads","Package_DIP/DIP-24_W7.62mm","Package_DIP/DIP-24_W7.62mm_LongPads","Package_DIP/DIP-24_W7.62mm_SMDSocket_SmallPads","Package_DIP/DIP-24_W7.62mm_Socket","Package_DIP/DIP-24_W7.62mm_Socket_LongPads","Package_DIP/DIP-24_W8.89mm_SMDSocket_LongPads","Package_DIP/DIP-26_W15.24mm","Package_DIP/DIP-26_W15.24mm_LongPads","Package_DIP/DIP-26_W15.24mm_SMDSocket_SmallPads","Package_DIP/DIP-26_W15.24mm_Socket","Package_DIP/DIP-26_W15.24mm_Socket_LongPads","Package_DIP/DIP-26_W16.51mm_SMDSocket_LongPads","Package_DIP/DIP-28_W15.24mm","Package_DIP/DIP-28_W15.24mm_LongPads","Package_DIP/DIP-28_W15.24mm_SMDSocket_SmallPads","Package_DIP/DIP-28_W15.24mm_Socket","Package_DIP/DIP-28_W15.24mm_Socket_LongPads","Package_DIP/DIP-28_W16.51mm_SMDSocket_LongPads","Package_DIP/DIP-28_W7.62mm","Package_DIP/DIP-28_W7.62mm_LongPads","Package_DIP/DIP-28_W7.62mm_SMDSocket_SmallPads","Package_DIP/DIP-28_W7.62mm_Socket","Package_DIP/DIP-28_W7.62mm_Socket_LongPads","Package_DIP/DIP-28_W8.89mm_SMDSocket_LongPads","Package_DIP/DIP-32_W15.24mm","Package_DIP/DIP-32_W15.24mm_LongPads","Package_DIP/DIP-32_W15.24mm_SMDSocket_SmallPads","Package_DIP/DIP-32_W15.24mm_Socket","Package_DIP/DIP-32_W15.24mm_Socket_LongPads","Package_DIP/DIP-32_W16.51mm_SMDSocket_LongPads","Package_DIP/DIP-32_W7.62mm","Package_DIP/DIP-40_W15.24mm","Package_DIP/DIP-40_W15.24mm_LongPads","Package_DIP/DIP-40_W15.24mm_SMDSocket_SmallPads","Package_DIP/DIP-40_W15.24mm_Socket","Package_DIP/DIP-40_W15.24mm_Socket_LongPads","Package_DIP/DIP-40_W16.51mm_SMDSocket_LongPads","Package_DIP/DIP-40_W25.4mm","Package_DIP/DIP-40_W25.4mm_LongPads","Package_DIP/DIP-40_W25.4mm_SMDSocket_SmallPads","Package_DIP/DIP-40_W25.4mm_Socket","Package_DIP/DIP-40_W25.4mm_Socket_LongPads","Package_DIP/DIP-40_W26.67mm_SMDSocket_LongPads","Package_DIP/DIP-42_W15.24mm","Package_DIP/DIP-42_W15.24mm_LongPads","Package_DIP/DIP-42_W15.24mm_SMDSocket_SmallPads","Package_DIP/DIP-42_W15.24mm_Socket","Package_DIP/DIP-42_W15.24mm_Socket_LongPads","Package_DIP/DIP-42_W16.51mm_SMDSocket_LongPads","Package_DIP/DIP-48_W15.24mm","Package_DIP/DIP-48_W15.24mm_LongPads","Package_DIP/DIP-48_W15.24mm_SMDSocket_SmallPads","Package_DIP/DIP-48_W15.24mm_Socket","Package_DIP/DIP-48_W15.24mm_Socket_LongPads","Package_DIP/DIP-48_W16.51mm_SMDSocket_LongPads","Package_DIP/DIP-4_W10.16mm","Package_DIP/DIP-4_W10.16mm_LongPads","Package_DIP/DIP-4_W7.62mm","Package_DIP/DIP-4_W7.62mm_LongPads","Package_DIP/DIP-4_W7.62mm_SMDSocket_SmallPads","Package_DIP/DIP-4_W7.62mm_Socket","Package_DIP/DIP-4_W7.62mm_Socket_LongPads","Package_DIP/DIP-4_W8.89mm_SMDSocket_LongPads","Package_DIP/DIP-5-6_W10.16mm","Package_DIP/DIP-5-6_W10.16mm_LongPads","Package_DIP/DIP-5-6_W7.62mm","Package_DIP/DIP-5-6_W7.62mm_LongPads","Package_DIP/DIP-5-6_W7.62mm_SMDSocket_SmallPads","Package_DIP/DIP-5-6_W7.62mm_Socket","Package_DIP/DIP-5-6_W7.62mm_Socket_LongPads","Package_DIP/DIP-5-6_W8.89mm_SMDSocket_LongPads","Package_DIP/DIP-64_W15.24mm","Package_DIP/DIP-64_W15.24mm_LongPads","Package_DIP/DIP-64_W15.24mm_SMDSocket_SmallPads","Package_DIP/DIP-64_W15.24mm_Socket","Package_DIP/DIP-64_W15.24mm_Socket_LongPads","Package_DIP/DIP-64_W16.51mm_SMDSocket_LongPads","Package_DIP/DIP-64_W22.86mm","Package_DIP/DIP-64_W22.86mm_LongPads","Package_DIP/DIP-64_W22.86mm_SMDSocket_SmallPads","Package_DIP/DIP-64_W22.86mm_Socket","Package_DIP/DIP-64_W22.86mm_Socket_LongPads","Package_DIP/DIP-64_W24.13mm_SMDSocket_LongPads","Package_DIP/DIP-64_W25.4mm","Package_DIP/DIP-64_W25.4mm_LongPads","Package_DIP/DIP-64_W25.4mm_SMDSocket_SmallPads","Package_DIP/DIP-64_W25.4mm_Socket","Package_DIP/DIP-64_W25.4mm_Socket_LongPads","Package_DIP/DIP-64_W26.67mm_SMDSocket_LongPads","Package_DIP/DIP-6_W10.16mm","Package_DIP/DIP-6_W10.16mm_LongPads","Package_DIP/DIP-6_W7.62mm","Package_DIP/DIP-6_W7.62mm_LongPads","Package_DIP/DIP-6_W7.62mm_SMDSocket_SmallPads","Package_DIP/DIP-6_W7.62mm_Socket","Package_DIP/DIP-6_W7.62mm_Socket_LongPads","Package_DIP/DIP-6_W8.89mm_SMDSocket_LongPads","Package_DIP/DIP-8-16_W7.62mm","Package_DIP/DIP-8-16_W7.62mm_Socket","Package_DIP/DIP-8-16_W7.62mm_Socket_LongPads","Package_DIP/DIP-8-N6_W7.62mm","Package_DIP/DIP-8-N7_W7.62mm","Package_DIP/DIP-8_W10.16mm","Package_DIP/DIP-8_W10.16mm_LongPads","Package_DIP/DIP-8_W7.62mm","Package_DIP/DIP-8_W7.62mm_LongPads","Package_DIP/DIP-8_W7.62mm_SMDSocket_SmallPads","Package_DIP/DIP-8_W7.62mm_Socket","Package_DIP/DIP-8_W7.62mm_Socket_LongPads","Package_DIP/DIP-8_W8.89mm_SMDSocket_LongPads","Package_DIP/Fairchild_LSOP-8","Package_DIP/IXYS_Flatpak-8_6.3x9.7mm_P2.54mm","Package_DIP/IXYS_SMD-8_6.3x9.7mm_P2.54mm","Package_DIP/PowerIntegrations_PDIP-8B","Package_DIP/PowerIntegrations_PDIP-8C","Package_DIP/PowerIntegrations_SDIP-10C","Package_DIP/PowerIntegrations_SMD-8","Package_DIP/PowerIntegrations_SMD-8B","Package_DIP/PowerIntegrations_SMD-8C","Package_DIP/PowerIntegrations_eDIP-12B","Package_DIP/SMDIP-10_W11.48mm","Package_DIP/SMDIP-10_W7.62mm","Package_DIP/SMDIP-10_W9.53mm","Package_DIP/SMDIP-10_W9.53mm_Clearance8mm","Package_DIP/SMDIP-12_W11.48mm","Package_DIP/SMDIP-12_W7.62mm","Package_DIP/SMDIP-12_W9.53mm","Package_DIP/SMDIP-12_W9.53mm_Clearance8mm","Package_DIP/SMDIP-14_W11.48mm","Package_DIP/SMDIP-14_W7.62mm","Package_DIP/SMDIP-14_W9.53mm","Package_DIP/SMDIP-14_W9.53mm_Clearance8mm","Package_DIP/SMDIP-16_W11.48mm","Package_DIP/SMDIP-16_W7.62mm","Package_DIP/SMDIP-16_W9.53mm","Package_DIP/SMDIP-16_W9.53mm_Clearance8mm","Package_DIP/SMDIP-18_W11.48mm","Package_DIP/SMDIP-18_W7.62mm","Package_DIP/SMDIP-18_W9.53mm","Package_DIP/SMDIP-18_W9.53mm_Clearance8mm","Package_DIP/SMDIP-20_W11.48mm","Package_DIP/SMDIP-20_W7.62mm","Package_DIP/SMDIP-20_W9.53mm","Package_DIP/SMDIP-20_W9.53mm_Clearance8mm","Package_DIP/SMDIP-22_W11.48mm","Package_DIP/SMDIP-22_W7.62mm","Package_DIP/SMDIP-22_W9.53mm","Package_DIP/SMDIP-22_W9.53mm_Clearance8mm","Package_DIP/SMDIP-24_W11.48mm","Package_DIP/SMDIP-24_W15.24mm","Package_DIP/SMDIP-24_W7.62mm","Package_DIP/SMDIP-24_W9.53mm","Package_DIP/SMDIP-28_W15.24mm","Package_DIP/SMDIP-32_W11.48mm","Package_DIP/SMDIP-32_W15.24mm","Package_DIP/SMDIP-32_W7.62mm","Package_DIP/SMDIP-32_W9.53mm","Package_DIP/SMDIP-40_W15.24mm","Package_DIP/SMDIP-40_W25.24mm","Package_DIP/SMDIP-42_W15.24mm","Package_DIP/SMDIP-48_W15.24mm","Package_DIP/SMDIP-4_W11.48mm","Package_DIP/SMDIP-4_W7.62mm","Package_DIP/SMDIP-4_W9.53mm","Package_DIP/SMDIP-4_W9.53mm_Clearance8mm","Package_DIP/SMDIP-64_W15.24mm","Package_DIP/SMDIP-6_W11.48mm","Package_DIP/SMDIP-6_W7.62mm","Package_DIP/SMDIP-6_W9.53mm","Package_DIP/SMDIP-6_W9.53mm_Clearance8mm","Package_DIP/SMDIP-8_W11.48mm","Package_DIP/SMDIP-8_W7.62mm","Package_DIP/SMDIP-8_W9.53mm","Package_DIP/SMDIP-8_W9.53mm_Clearance8mm","Package_DIP/Toshiba_11-7A9","Package_DIP/Vishay_HVM-DIP-3_W7.62mm","Package_DirectFET/DirectFET_L4","Package_DirectFET/DirectFET_L6","Package_DirectFET/DirectFET_L8","Package_DirectFET/DirectFET_LA","Package_DirectFET/DirectFET_M2","Package_DirectFET/DirectFET_M4","Package_DirectFET/DirectFET_MA","Package_DirectFET/DirectFET_MB","Package_DirectFET/DirectFET_MC","Package_DirectFET/DirectFET_MD","Package_DirectFET/DirectFET_ME","Package_DirectFET/DirectFET_MF","Package_DirectFET/DirectFET_MN","Package_DirectFET/DirectFET_MP","Package_DirectFET/DirectFET_MQ","Package_DirectFET/DirectFET_MT","Package_DirectFET/DirectFET_MU","Package_DirectFET/DirectFET_MX","Package_DirectFET/DirectFET_MZ","Package_DirectFET/DirectFET_S1","Package_DirectFET/DirectFET_S2","Package_DirectFET/DirectFET_S3C","Package_DirectFET/DirectFET_SA","Package_DirectFET/DirectFET_SB","Package_DirectFET/DirectFET_SC","Package_DirectFET/DirectFET_SH","Package_DirectFET/DirectFET_SJ","Package_DirectFET/DirectFET_SQ","Package_DirectFET/DirectFET_ST","Package_LCC/Analog_LCC-8_5x5mm_P1.27mm","Package_LCC/MO047AD_PLCC-52_19.1x19.1mm_P1.27mm","Package_LCC/PLCC-20","Package_LCC/PLCC-20_9.0x9.0mm_P1.27mm","Package_LCC/PLCC-20_SMD-Socket","Package_LCC/PLCC-20_THT-Socket","Package_LCC/PLCC-28","Package_LCC/PLCC-28_SMD-Socket","Package_LCC/PLCC-28_THT-Socket","Package_LCC/PLCC-32_11.4x14.0mm_P1.27mm","Package_LCC/PLCC-32_THT-Socket","Package_LCC/PLCC-44","Package_LCC/PLCC-44_16.6x16.6mm_P1.27mm","Package_LCC/PLCC-44_SMD-Socket","Package_LCC/PLCC-44_THT-Socket","Package_LCC/PLCC-52","Package_LCC/PLCC-52_SMD-Socket","Package_LCC/PLCC-52_THT-Socket","Package_LCC/PLCC-68","Package_LCC/PLCC-68_24.2x24.2mm_P1.27mm","Package_LCC/PLCC-68_SMD-Socket","Package_LCC/PLCC-68_THT-Socket","Package_LCC/PLCC-84","Package_LCC/PLCC-84_29.3x29.3mm_P1.27mm","Package_LCC/PLCC-84_SMD-Socket","Package_LCC/PLCC-84_THT-Socket","Package_LGA/AMS_LGA-10-1EP_2.7x4mm_P0.6mm","Package_LGA/AMS_LGA-20_4.7x4.5mm_P0.65mm","Package_LGA/AMS_OLGA-8_2x3.1mm_P0.8mm","Package_LGA/Bosch_LGA-14_3x2.5mm_P0.5mm","Package_LGA/Bosch_LGA-16_4.5x3mm_P0.5mm_LayoutBorder7x1y_ClockwisePinNumbering","Package_LGA/Bosch_LGA-8_2.5x2.5mm_P0.65mm_ClockwisePinNumbering","Package_LGA/Bosch_LGA-8_2x2.5mm_P0.65mm_ClockwisePinNumbering","Package_LGA/Bosch_LGA-8_3x3mm_P0.8mm_ClockwisePinNumbering","Package_LGA/Infineon_PG-TSNP-6-10_0.7x1.1mm_0.7x1.1mm_P0.4mm","Package_LGA/Kionix_LGA-12_2x2mm_P0.5mm_LayoutBorder2x4y","Package_LGA/LGA-12_2x2mm_P0.5mm","Package_LGA/LGA-14_2x2mm_P0.35mm_LayoutBorder3x4y","Package_LGA/LGA-14_3x2.5mm_P0.5mm_LayoutBorder3x4y","Package_LGA/LGA-14_3x5mm_P0.8mm_LayoutBorder1x6y","Package_LGA/LGA-16_3x3mm_P0.5mm","Package_LGA/LGA-16_3x3mm_P0.5mm_LayoutBorder3x5y","Package_LGA/LGA-16_4x4mm_P0.65mm_LayoutBorder4x4y","Package_LGA/LGA-24L_3x3.5mm_P0.43mm","Package_LGA/LGA-28_5.2x3.8mm_P0.5mm","Package_LGA/LGA-8_3x5mm_P1.25mm","Package_LGA/LGA-8_8x6.2mm_P1.27mm","Package_LGA/LGA-8_8x6mm_P1.27mm","Package_LGA/Linear_LGA-133_15.0x15.0mm_Layout12x12_P1.27mm","Package_LGA/MPS_LGA-18-10EP_12x12mm_P3.3mm","Package_LGA/NXP_LGA-8_3x5mm_P1.25mm_H1.1mm","Package_LGA/NXP_LGA-8_3x5mm_P1.25mm_H1.2mm","Package_LGA/NXP_USON-8_1x1.35mm_P0.35mm","Package_LGA/Nordic_nRF9151-LAxx_LGA-80-33EP_12.1x11.1mm_P0.5mm","Package_LGA/Nordic_nRF9160-SIxx_LGA-102-59EP_16.0x10.5mm_P0.5mm","Package_LGA/Rohm_MLGA010V020A_LGA-10_2x2mm_P0.45mm_LayoutBorder2x3y","Package_LGA/ST_CCLGA-7L_2.8x2.8mm_P1.15mm_H1.95mm","Package_LGA/ST_HLGA-10_2.5x2.5mm_P0.6mm_LayoutBorder3x2y","Package_LGA/ST_HLGA-10_2x2mm_P0.5mm_LayoutBorder3x2y","Package_LGA/Texas_SIL0008C_MicroSiP-8-1EP_2.8x3mm_P0.65mm_EP1.1x1.9mm","Package_LGA/Texas_SIL0008C_MicroSiP-8-1EP_2.8x3mm_P0.65mm_EP1.1x1.9mm_ThermalVias","Package_LGA/Texas_SIL0008D_MicroSiP-8-1EP_2.8x3mm_P0.65mm_EP1.1x1.9mm","Package_LGA/Texas_SIL0008D_MicroSiP-8-1EP_2.8x3mm_P0.65mm_EP1.1x1.9mm_ThermalVias","Package_LGA/Texas_SIL0010A_MicroSiP-10-1EP_3.8x3mm_P0.6mm_EP0.7x2.9mm","Package_LGA/Texas_SIL0010A_MicroSiP-10-1EP_3.8x3mm_P0.6mm_EP0.7x2.9mm_ThermalVias","Package_LGA/VLGA-4_2x2.5mm_P1.65mm","Package_LGA/ublox_LGA-53_4.5x4.5mm_Layout9x9_P0.5mm","Package_QFP/EQFP-144-1EP_20x20mm_P0.5mm_EP4x4mm","Package_QFP/EQFP-144-1EP_20x20mm_P0.5mm_EP4x4mm_ThermalVias","Package_QFP/EQFP-144-1EP_20x20mm_P0.5mm_EP5x5mm","Package_QFP/EQFP-144-1EP_20x20mm_P0.5mm_EP5x5mm_ThermalVias","Package_QFP/EQFP-144-1EP_20x20mm_P0.5mm_EP6.61x5.615mm","Package_QFP/EQFP-144-1EP_20x20mm_P0.5mm_EP6.61x5.615mm_ThermalVias","Package_QFP/EQFP-144-1EP_20x20mm_P0.5mm_EP7.2x6.35mm","Package_QFP/EQFP-144-1EP_20x20mm_P0.5mm_EP7.2x6.35mm_ThermalVias","Package_QFP/EQFP-144-1EP_20x20mm_P0.5mm_EP8.93x8.7mm","Package_QFP/EQFP-144-1EP_20x20mm_P0.5mm_EP8.93x8.7mm_ThermalVias","Package_QFP/Hitachi_FP80B_PQFP-80_14x20mm_P0.8mm","Package_QFP/LQFP-100-1EP_14x14mm_P0.5mm_EP6.9x6.9mm","Package_QFP/LQFP-100-1EP_14x14mm_P0.5mm_EP6.9x6.9mm_ThermalVias","Package_QFP/LQFP-100_14x14mm_P0.5mm","Package_QFP/LQFP-128_14x14mm_P0.4mm","Package_QFP/LQFP-128_14x20mm_P0.5mm","Package_QFP/LQFP-144-1EP_20x20mm_P0.5mm_EP6.5x6.5mm","Package_QFP/LQFP-144-1EP_20x20mm_P0.5mm_EP6.5x6.5mm_ThermalVias","Package_QFP/LQFP-144_20x20mm_P0.5mm","Package_QFP/LQFP-160_24x24mm_P0.5mm","Package_QFP/LQFP-176-1EP_24x24mm_P0.5mm_EP6.6x6.6mm","Package_QFP/LQFP-176-1EP_24x24mm_P0.5mm_EP6.6x6.6mm_ThermalVias","Package_QFP/LQFP-176_20x20mm_P0.4mm","Package_QFP/LQFP-176_24x24mm_P0.5mm","Package_QFP/LQFP-208_28x28mm_P0.5mm","Package_QFP/LQFP-216_24x24mm_P0.4mm","Package_QFP/LQFP-32_5x5mm_P0.5mm","Package_QFP/LQFP-32_7x7mm_P0.8mm","Package_QFP/LQFP-36_7x7mm_P0.65mm","Package_QFP/LQFP-44_10x10mm_P0.8mm","Package_QFP/LQFP-48-1EP_7x7mm_P0.5mm_EP3.6x3.6mm","Package_QFP/LQFP-48-1EP_7x7mm_P0.5mm_EP3.6x3.6mm_ThermalVias","Package_QFP/LQFP-48_7x7mm_P0.5mm","Package_QFP/LQFP-52-1EP_10x10mm_P0.65mm_EP4.8x4.8mm","Package_QFP/LQFP-52-1EP_10x10mm_P0.65mm_EP4.8x4.8mm_ThermalVias","Package_QFP/LQFP-52_10x10mm_P0.65mm","Package_QFP/LQFP-52_14x14mm_P1mm","Package_QFP/LQFP-64-1EP_10x10mm_P0.5mm_EP5x5mm","Package_QFP/LQFP-64-1EP_10x10mm_P0.5mm_EP5x5mm_ThermalVias","Package_QFP/LQFP-64-1EP_10x10mm_P0.5mm_EP6.5x6.5mm","Package_QFP/LQFP-64-1EP_10x10mm_P0.5mm_EP6.5x6.5mm_ThermalVias","Package_QFP/LQFP-64_10x10mm_P0.5mm","Package_QFP/LQFP-64_14x14mm_P0.8mm","Package_QFP/LQFP-64_7x7mm_P0.4mm","Package_QFP/LQFP-80_10x10mm_P0.4mm","Package_QFP/LQFP-80_12x12mm_P0.5mm","Package_QFP/LQFP-80_14x14mm_P0.65mm","Package_QFP/MO112AC1_PQFP-52_10x10mm_P0.65mm","Package_QFP/Microchip_PQFP-44_10x10mm_P0.8mm","Package_QFP/PQFP-100_14x20mm_P0.65mm","Package_QFP/PQFP-112_20x20mm_P0.65mm","Package_QFP/PQFP-128_28x28mm_P0.8mm","Package_QFP/PQFP-132_24x24mm_P0.635mm","Package_QFP/PQFP-132_24x24mm_P0.635mm_i386","Package_QFP/PQFP-144_28x28mm_P0.65mm","Package_QFP/PQFP-160_28x28mm_P0.65mm","Package_QFP/PQFP-168_28x28mm_P0.65mm","Package_QFP/PQFP-208_28x28mm_P0.5mm","Package_QFP/PQFP-240_32.1x32.1mm_P0.5mm","Package_QFP/PQFP-256_28x28mm_P0.4mm","Package_QFP/PQFP-44_10x10mm_P0.8mm","Package_QFP/PQFP-64_14x14mm_P0.8mm","Package_QFP/PQFP-80_14x14mm_P0.65mm","Package_QFP/PQFP-80_14x20mm_P0.8mm","Package_QFP/TQFP-100-1EP_14x14mm_P0.5mm_EP5x5mm","Package_QFP/TQFP-100-1EP_14x14mm_P0.5mm_EP5x5mm_ThermalVias","Package_QFP/TQFP-100_12x12mm_P0.4mm","Package_QFP/TQFP-100_14x14mm_P0.5mm","Package_QFP/TQFP-120_14x14mm_P0.4mm","Package_QFP/TQFP-128_14x14mm_P0.4mm","Package_QFP/TQFP-144_16x16mm_P0.4mm","Package_QFP/TQFP-144_20x20mm_P0.5mm","Package_QFP/TQFP-176_20x20mm_P0.4mm","Package_QFP/TQFP-176_24x24mm_P0.5mm","Package_QFP/TQFP-32_5x5mm_P0.5mm","Package_QFP/TQFP-32_7x7mm_P0.8mm","Package_QFP/TQFP-44-1EP_10x10mm_P0.8mm_EP4.5x4.5mm","Package_QFP/TQFP-44-1EP_10x10mm_P0.8mm_EP4.5x4.5mm_ThermalVias","Package_QFP/TQFP-44_10x10mm_P0.8mm","Package_QFP/TQFP-48-1EP_7x7mm_P0.5mm_EP3.5x3.5mm","Package_QFP/TQFP-48-1EP_7x7mm_P0.5mm_EP3.5x3.5mm_ThermalVias","Package_QFP/TQFP-48-1EP_7x7mm_P0.5mm_EP4.11x4.11mm","Package_QFP/TQFP-48-1EP_7x7mm_P0.5mm_EP5x5mm","Package_QFP/TQFP-48-1EP_7x7mm_P0.5mm_EP5x5mm_ThermalVias","Package_QFP/TQFP-48_7x7mm_P0.5mm","Package_QFP/TQFP-52-1EP_10x10mm_P0.65mm_EP6.5x6.5mm","Package_QFP/TQFP-52-1EP_10x10mm_P0.65mm_EP6.5x6.5mm_ThermalVias","Package_QFP/TQFP-64-1EP_10x10mm_P0.5mm_EP5.305x5.305mm","Package_QFP/TQFP-64-1EP_10x10mm_P0.5mm_EP5.305x5.305mm_ThermalVias","Package_QFP/TQFP-64_10x10mm_P0.5mm","Package_QFP/TQFP-64_14x14mm_P0.8mm","Package_QFP/TQFP-64_7x7mm_P0.4mm","Package_QFP/TQFP-80-1EP_14x14mm_P0.65mm_EP9.5x9.5mm","Package_QFP/TQFP-80-1EP_14x14mm_P0.65mm_EP9.5x9.5mm_ThermalVias","Package_QFP/TQFP-80_12x12mm_P0.5mm","Package_QFP/TQFP-80_14x14mm_P0.65mm","Package_QFP/Texas_PHP0048E_HTQFP-48-1EP_7x7mm_P0.5mm_EP6.5x6.5mm_Mask3.62x3.62mm","Package_QFP/Texas_PHP0048E_HTQFP-48-1EP_7x7mm_P0.5mm_EP6.5x6.5mm_Mask3.62x3.62mm_ThermalVias","Package_QFP/Texas_TQFP-64-1EP_10x10mm_P0.5mm_EP8x8mm_Mask4.44x4.44mm","Package_QFP/Texas_TQFP-64-1EP_10x10mm_P0.5mm_EP8x8mm_Mask4.44x4.44mm_ThermalVias","Package_QFP/Texas_TQFP-64-1EP_10x10mm_P0.5mm_EP8x8mm_Mask5x5mm","Package_QFP/Texas_TQFP-64-1EP_10x10mm_P0.5mm_EP8x8mm_Mask5x5mm_ThermalVias","Package_SIP/PowerIntegrations_eSIP-7C","Package_SIP/PowerIntegrations_eSIP-7F","Package_SIP/SIP-8_19x3mm_P2.54mm","Package_SIP/SIP-9_21.54x3mm_P2.54mm","Package_SIP/SIP-9_22.3x3mm_P2.54mm","Package_SIP/SIP3_11.6x8.5mm","Package_SIP/SIP4_Sharp-SSR_P7.62mm_Angled","Package_SIP/SIP4_Sharp-SSR_P7.62mm_Angled_NoHole","Package_SIP/SIP4_Sharp-SSR_P7.62mm_Straight","Package_SIP/SIP9_Housing","Package_SIP/SIP9_Housing_BigPads","Package_SIP/SLA704XM","Package_SIP/STK672-040-E","Package_SIP/STK672-080-E","Package_SIP/Sanyo_STK4xx-15_59.2x8.0mm_P2.54mm","Package_SIP/Sanyo_STK4xx-15_78.0x8.0mm_P2.54mm","Package_SO/Analog_MSOP-12-16-1EP_3x4.039mm_P0.5mm_EP1.651x2.845mm","Package_SO/Analog_MSOP-12-16-1EP_3x4.039mm_P0.5mm_EP1.651x2.845mm_ThermalVias","Package_SO/Analog_MSOP-12-16_3x4.039mm_P0.5mm","Package_SO/Diodes_PSOP-8","Package_SO/Diodes_SO-8EP","Package_SO/ETSSOP-20-1EP_4.4x6.5mm_P0.65mm_EP3x4.2mm","Package_SO/HSOP-20-1EP_11.0x15.9mm_P1.27mm_SlugDown","Package_SO/HSOP-20-1EP_11.0x15.9mm_P1.27mm_SlugDown_ThermalVias","Package_SO/HSOP-20-1EP_11.0x15.9mm_P1.27mm_SlugUp","Package_SO/HSOP-32-1EP_7.5x11mm_P0.65mm_EP4.7x4.7mm","Package_SO/HSOP-36-1EP_11.0x15.9mm_P0.65mm_SlugDown","Package_SO/HSOP-36-1EP_11.0x15.9mm_P0.65mm_SlugDown_ThermalVias","Package_SO/HSOP-36-1EP_11.0x15.9mm_P0.65mm_SlugUp","Package_SO/HSOP-54-1EP_7.5x17.9mm_P0.65mm_EP4.6x4.6mm","Package_SO/HSOP-8-1EP_3.9x4.9mm_P1.27mm_EP2.3x2.3mm","Package_SO/HSOP-8-1EP_3.9x4.9mm_P1.27mm_EP2.3x2.3mm_ThermalVias","Package_SO/HSOP-8-1EP_3.9x4.9mm_P1.27mm_EP2.41x3.1mm","Package_SO/HSOP-8-1EP_3.9x4.9mm_P1.27mm_EP2.41x3.1mm_ThermalVias","Package_SO/HTSOP-8-1EP_3.9x4.9mm_P1.27mm_EP2.4x3.2mm","Package_SO/HTSOP-8-1EP_3.9x4.9mm_P1.27mm_EP2.4x3.2mm_ThermalVias","Package_SO/HTSSOP-16-1EP_4.4x5mm_P0.65mm_EP3.4x5mm","Package_SO/HTSSOP-16-1EP_4.4x5mm_P0.65mm_EP3.4x5mm_Mask2.46x2.31mm","Package_SO/HTSSOP-16-1EP_4.4x5mm_P0.65mm_EP3.4x5mm_Mask2.46x2.31mm_ThermalVias","Package_SO/HTSSOP-16-1EP_4.4x5mm_P0.65mm_EP3.4x5mm_Mask2.66x2.46mm","Package_SO/HTSSOP-16-1EP_4.4x5mm_P0.65mm_EP3.4x5mm_Mask2.66x2.46mm_ThermalVias","Package_SO/HTSSOP-16-1EP_4.4x5mm_P0.65mm_EP3.4x5mm_Mask3x3mm_ThermalVias","Package_SO/HTSSOP-16-1EP_4.4x5mm_P0.65mm_EP3x3mm","Package_SO/HTSSOP-20-1EP_4.4x6.5mm_P0.65mm_EP2.74x3.86mm","Package_SO/HTSSOP-20-1EP_4.4x6.5mm_P0.65mm_EP2.85x4mm","Package_SO/HTSSOP-20-1EP_4.4x6.5mm_P0.65mm_EP3.4x6.5mm","Package_SO/HTSSOP-20-1EP_4.4x6.5mm_P0.65mm_EP3.4x6.5mm_Mask2.4x3.7mm","Package_SO/HTSSOP-20-1EP_4.4x6.5mm_P0.65mm_EP3.4x6.5mm_Mask2.75x3.43mm","Package_SO/HTSSOP-20-1EP_4.4x6.5mm_P0.65mm_EP3.4x6.5mm_Mask2.75x3.43mm_ThermalVias","Package_SO/HTSSOP-20-1EP_4.4x6.5mm_P0.65mm_EP3.4x6.5mm_Mask2.96x2.96mm","Package_SO/HTSSOP-20-1EP_4.4x6.5mm_P0.65mm_EP3.4x6.5mm_Mask2.96x2.96mm_ThermalVias","Package_SO/HTSSOP-20-1EP_4.4x6.5mm_P0.65mm_EP3.4x6.5mm_ThermalVias","Package_SO/HTSSOP-24-1EP_4.4x7.8mm_P0.65mm_EP3.2x5mm","Package_SO/HTSSOP-24-1EP_4.4x7.8mm_P0.65mm_EP3.4x7.8mm_Mask2.44x3.42mm","Package_SO/HTSSOP-24-1EP_4.4x7.8mm_P0.65mm_EP3.4x7.8mm_Mask2.44x3.42mm_ThermalVias","Package_SO/HTSSOP-24-1EP_4.4x7.8mm_P0.65mm_EP3.4x7.8mm_Mask2.4x2.98mm","Package_SO/HTSSOP-24-1EP_4.4x7.8mm_P0.65mm_EP3.4x7.8mm_Mask2.4x2.98mm_ThermalVias","Package_SO/HTSSOP-24-1EP_4.4x7.8mm_P0.65mm_EP3.4x7.8mm_Mask2.4x4.68mm","Package_SO/HTSSOP-24-1EP_4.4x7.8mm_P0.65mm_EP3.4x7.8mm_Mask2.4x4.68mm_ThermalVias","Package_SO/HTSSOP-28-1EP_4.4x9.7mm_P0.65mm_EP2.75x6.2mm","Package_SO/HTSSOP-28-1EP_4.4x9.7mm_P0.65mm_EP2.75x6.2mm_ThermalVias","Package_SO/HTSSOP-28-1EP_4.4x9.7mm_P0.65mm_EP2.85x5.4mm","Package_SO/HTSSOP-28-1EP_4.4x9.7mm_P0.65mm_EP2.85x5.4mm_ThermalVias","Package_SO/HTSSOP-28-1EP_4.4x9.7mm_P0.65mm_EP3.4x9.5mm","Package_SO/HTSSOP-28-1EP_4.4x9.7mm_P0.65mm_EP3.4x9.5mm_Mask2.4x6.17mm","Package_SO/HTSSOP-28-1EP_4.4x9.7mm_P0.65mm_EP3.4x9.5mm_Mask2.4x6.17mm_ThermalVias","Package_SO/HTSSOP-28-1EP_4.4x9.7mm_P0.65mm_EP3.4x9.5mm_ThermalVias","Package_SO/HTSSOP-32-1EP_6.1x11mm_P0.65mm_EP5.2x11mm_Mask4.11x4.36mm","Package_SO/HTSSOP-32-1EP_6.1x11mm_P0.65mm_EP5.2x11mm_Mask4.11x4.36mm_ThermalVias","Package_SO/HTSSOP-38-1EP_4.4x9.7mm_P0.5mm_EP1.5x3.3mm","Package_SO/HTSSOP-38-1EP_4.4x9.7mm_P0.5mm_EP1.5x3.3mm_ThermalVias","Package_SO/HTSSOP-38-1EP_4.4x9.7mm_P0.5mm_EP2.74x4.75mm","Package_SO/HTSSOP-38-1EP_4.4x9.7mm_P0.5mm_EP2.74x4.75mm_ThermalVias","Package_SO/HTSSOP-38-1EP_4.4x9.7mm_P0.5mm_EP3.05x6.65mm","Package_SO/HTSSOP-38-1EP_4.4x9.7mm_P0.5mm_EP3.05x6.65mm_ThermalVias","Package_SO/HTSSOP-38-1EP_6.1x12.5mm_P0.65mm_EP5.2x12.5mm_Mask3.39x6.35mm","Package_SO/HTSSOP-38-1EP_6.1x12.5mm_P0.65mm_EP5.2x12.5mm_Mask3.39x6.35mm_ThermalVias","Package_SO/HTSSOP-44-1EP_6.1x14mm_P0.635mm_EP5.2x14mm_Mask4.31x8.26mm","Package_SO/HTSSOP-44-1EP_6.1x14mm_P0.635mm_EP5.2x14mm_Mask4.31x8.26mm_ThermalVias","Package_SO/HTSSOP-44_6.1x14mm_P0.635mm_TopEP4.14x7.01mm","Package_SO/HTSSOP-56-1EP_6.1x14mm_P0.5mm_EP3.61x6.35mm","Package_SO/HVSSOP-10-1EP_3x3mm_P0.5mm_EP1.83x1.89mm","Package_SO/HVSSOP-10-1EP_3x3mm_P0.5mm_EP1.83x1.89mm_ThermalVias","Package_SO/HVSSOP-8-1EP_3x3mm_P0.65mm_EP1.57x1.89mm","Package_SO/HVSSOP-8-1EP_3x3mm_P0.65mm_EP1.57x1.89mm_ThermalVias","Package_SO/Infineon_PG-DSO-12-11","Package_SO/Infineon_PG-DSO-12-11_ThermalVias","Package_SO/Infineon_PG-DSO-12-9","Package_SO/Infineon_PG-DSO-12-9_ThermalVias","Package_SO/Infineon_PG-DSO-20-30","Package_SO/Infineon_PG-DSO-20-30_ThermalVias","Package_SO/Infineon_PG-DSO-20-32","Package_SO/Infineon_PG-DSO-20-85","Package_SO/Infineon_PG-DSO-20-85_ThermalVias","Package_SO/Infineon_PG-DSO-20-87","Package_SO/Infineon_PG-DSO-20-U03_7.5x12.8mm","Package_SO/Infineon_PG-DSO-8-24_4x5mm","Package_SO/Infineon_PG-DSO-8-27_3.9x4.9mm_EP2.65x3mm","Package_SO/Infineon_PG-DSO-8-27_3.9x4.9mm_EP2.65x3mm_ThermalVias","Package_SO/Infineon_PG-DSO-8-43","Package_SO/Infineon_PG-DSO-8-59_7.5x6.3mm","Package_SO/Infineon_PG-TSDSO-14-22","Package_SO/Infineon_SOIC-20W_7.6x12.8mm_P1.27mm","Package_SO/JEITA_SOIC-16_3.9x9.9mm_P1.27mm","Package_SO/JEITA_SOIC-8_3.9x4.9mm_P1.27mm","Package_SO/Linear_HTSSOP-31-38-1EP_4.4x9.7mm_P0.5mm_EP2.74x4.75mm","Package_SO/Linear_HTSSOP-31-38-1EP_4.4x9.7mm_P0.5mm_EP2.74x4.75mm_ThermalVias","Package_SO/MSOP-10-1EP_3x3mm_P0.5mm_EP1.68x1.88mm","Package_SO/MSOP-10-1EP_3x3mm_P0.5mm_EP1.68x1.88mm_ThermalVias","Package_SO/MSOP-10-1EP_3x3mm_P0.5mm_EP1.73x1.98mm","Package_SO/MSOP-10-1EP_3x3mm_P0.5mm_EP1.73x1.98mm_ThermalVias","Package_SO/MSOP-10-1EP_3x3mm_P0.5mm_EP2.2x3.1mm_Mask1.83x1.89mm","Package_SO/MSOP-10-1EP_3x3mm_P0.5mm_EP2.2x3.1mm_Mask1.83x1.89mm_ThermalVias","Package_SO/MSOP-10_3x3mm_P0.5mm","Package_SO/MSOP-12-1EP_3x4.039mm_P0.65mm_EP1.651x2.845mm","Package_SO/MSOP-12-1EP_3x4.039mm_P0.65mm_EP1.651x2.845mm_ThermalVias","Package_SO/MSOP-12_3x4.039mm_P0.65mm","Package_SO/MSOP-16-1EP_3x4.039mm_P0.5mm_EP1.651x2.845mm","Package_SO/MSOP-16-1EP_3x4.039mm_P0.5mm_EP1.651x2.845mm_ThermalVias","Package_SO/MSOP-16_3x4.039mm_P0.5mm","Package_SO/MSOP-8-1EP_3x3mm_P0.65mm_EP1.5x1.8mm","Package_SO/MSOP-8-1EP_3x3mm_P0.65mm_EP1.5x1.8mm_ThermalVias","Package_SO/MSOP-8-1EP_3x3mm_P0.65mm_EP1.68x1.88mm","Package_SO/MSOP-8-1EP_3x3mm_P0.65mm_EP1.68x1.88mm_ThermalVias","Package_SO/MSOP-8-1EP_3x3mm_P0.65mm_EP1.73x1.85mm","Package_SO/MSOP-8-1EP_3x3mm_P0.65mm_EP1.73x1.85mm_ThermalVias","Package_SO/MSOP-8-1EP_3x3mm_P0.65mm_EP1.95x2.15mm","Package_SO/MSOP-8-1EP_3x3mm_P0.65mm_EP1.95x2.15mm_ThermalVias","Package_SO/MSOP-8-1EP_3x3mm_P0.65mm_EP2.5x3mm_Mask1.73x2.36mm","Package_SO/MSOP-8-1EP_3x3mm_P0.65mm_EP2.5x3mm_Mask1.73x2.36mm_ThermalVias","Package_SO/MSOP-8_3x3mm_P0.65mm","Package_SO/NXP_HTSSOP-28-1EP_4.4x9.7mm_P0.65mm_EP2.2x3.4mm","Package_SO/NXP_HTSSOP-28-1EP_4.4x9.7mm_P0.65mm_EP2.2x3.4mm_ThermalVias","Package_SO/ONSemi_SO-8FL_488AA","Package_SO/OnSemi_751EP_SOIC-4_3.9x4.725mm_P2.54mm","Package_SO/OnSemi_Micro8","Package_SO/PSOP-44_16.9x27.17mm_P1.27mm","Package_SO/PowerIntegrations_SO-8","Package_SO/PowerIntegrations_SO-8B","Package_SO/PowerIntegrations_SO-8C","Package_SO/PowerIntegrations_eSOP-12B","Package_SO/PowerPAK_SO-8L_Single","Package_SO/PowerPAK_SO-8_Dual","Package_SO/PowerPAK_SO-8_Single","Package_SO/PowerSSO-16-1EP_3.9x4.9mm_P0.5mm_EP2.5x3.61mm","Package_SO/PowerSSO-16-1EP_3.9x4.9mm_P0.5mm_EP2.5x3.61mm_ThermalVias","Package_SO/QSOP-16_3.9x4.9mm_P0.635mm","Package_SO/QSOP-20_3.9x8.7mm_P0.635mm","Package_SO/QSOP-24_3.9x8.7mm_P0.635mm","Package_SO/QSOP-28_3.9x9.9mm_P0.635mm","Package_SO/Renesas_SOP-32_11.4x20.75mm_P1.27mm","Package_SO/SO-14_3.9x8.65mm_P1.27mm","Package_SO/SO-14_5.3x10.2mm_P1.27mm","Package_SO/SO-16_3.9x9.9mm_P1.27mm","Package_SO/SO-16_5.3x10.2mm_P1.27mm","Package_SO/SO-20-1EP_7.52x12.825mm_P1.27mm_EP6.045x12.09mm_Mask3.56x4.47mm","Package_SO/SO-20-1EP_7.52x12.825mm_P1.27mm_EP6.045x12.09mm_Mask3.56x4.47mm_ThermalVias","Package_SO/SO-20_12.8x7.5mm_P1.27mm","Package_SO/SO-20_5.3x12.6mm_P1.27mm","Package_SO/SO-24_5.3x15mm_P1.27mm","Package_SO/SO-4_4.4x2.3mm_P1.27mm","Package_SO/SO-4_4.4x3.6mm_P2.54mm","Package_SO/SO-4_4.4x3.9mm_P2.54mm","Package_SO/SO-4_4.4x4.3mm_P2.54mm","Package_SO/SO-4_7.6x3.6mm_P2.54mm","Package_SO/SO-5-6_4.55x3.7mm_P1.27mm","Package_SO/SO-6L_10x3.84mm_P1.27mm","Package_SO/SO-6_4.4x3.6mm_P1.27mm","Package_SO/SO-8_3.9x4.9mm_P1.27mm","Package_SO/SOIC-10_3.9x4.9mm_P1mm","Package_SO/SOIC-14-16_3.9x9.9mm_P1.27mm","Package_SO/SOIC-14W_7.5x9mm_P1.27mm","Package_SO/SOIC-14_3.9x8.7mm_P1.27mm","Package_SO/SOIC-16W-12_7.5x10.3mm_P1.27mm","Package_SO/SOIC-16W_5.3x10.2mm_P1.27mm","Package_SO/SOIC-16W_7.5x10.3mm_P1.27mm","Package_SO/SOIC-16W_7.5x12.8mm_P1.27mm","Package_SO/SOIC-16_3.9x9.9mm_P1.27mm","Package_SO/SOIC-16_4.55x10.3mm_P1.27mm","Package_SO/SOIC-18W_7.5x11.6mm_P1.27mm","Package_SO/SOIC-20W_7.5x12.8mm_P1.27mm","Package_SO/SOIC-20W_7.5x15.4mm_P1.27mm","Package_SO/SOIC-24W_7.5x15.4mm_P1.27mm","Package_SO/SOIC-28W_7.5x17.9mm_P1.27mm","Package_SO/SOIC-28W_7.5x18.7mm_P1.27mm","Package_SO/SOIC-32_7.518x20.777mm_P1.27mm","Package_SO/SOIC-4_4.55x2.6mm_P1.27mm","Package_SO/SOIC-4_4.55x3.7mm_P2.54mm","Package_SO/SOIC-5-6_4.4x3.6mm_P1.27mm","Package_SO/SOIC-8-1EP_3.9x4.9mm_P1.27mm_EP2.29x3mm","Package_SO/SOIC-8-1EP_3.9x4.9mm_P1.27mm_EP2.29x3mm_ThermalVias","Package_SO/SOIC-8-1EP_3.9x4.9mm_P1.27mm_EP2.41x3.3mm","Package_SO/SOIC-8-1EP_3.9x4.9mm_P1.27mm_EP2.41x3.3mm_ThermalVias","Package_SO/SOIC-8-1EP_3.9x4.9mm_P1.27mm_EP2.41x3.81mm","Package_SO/SOIC-8-1EP_3.9x4.9mm_P1.27mm_EP2.41x3.81mm_ThermalVias","Package_SO/SOIC-8-1EP_3.9x4.9mm_P1.27mm_EP2.514x3.2mm","Package_SO/SOIC-8-1EP_3.9x4.9mm_P1.27mm_EP2.514x3.2mm_ThermalVias","Package_SO/SOIC-8-1EP_3.9x4.9mm_P1.27mm_EP2.62x3.51mm","Package_SO/SOIC-8-1EP_3.9x4.9mm_P1.27mm_EP2.62x3.51mm_ThermalVias","Package_SO/SOIC-8-1EP_3.9x4.9mm_P1.27mm_EP2.71x3.7mm","Package_SO/SOIC-8-1EP_3.9x4.9mm_P1.27mm_EP2.71x3.7mm_ThermalVias","Package_SO/SOIC-8-1EP_3.9x4.9mm_P1.27mm_EP2.95x4.9mm_Mask2.34x2.34mm","Package_SO/SOIC-8-1EP_3.9x4.9mm_P1.27mm_EP2.95x4.9mm_Mask2.34x2.34mm_ThermalVias","Package_SO/SOIC-8-1EP_3.9x4.9mm_P1.27mm_EP2.95x4.9mm_Mask2.71x3.4mm","Package_SO/SOIC-8-1EP_3.9x4.9mm_P1.27mm_EP2.95x4.9mm_Mask2.71x3.4mm_ThermalVias","Package_SO/SOIC-8-N7_3.9x4.9mm_P1.27mm","Package_SO/SOIC-8_3.81x9.347mm_P2.54mm","Package_SO/SOIC-8_3.9x4.9mm_P1.27mm","Package_SO/SOIC-8_5.3x5.3mm_P1.27mm","Package_SO/SOIC-8_5.3x6.2mm_P1.27mm","Package_SO/SOIC-8_7.5x5.85mm_P1.27mm","Package_SO/SOJ-24_7.62x15.875mm_P1.27mm","Package_SO/SOJ-28_10.16x18.415mm_P1.27mm","Package_SO/SOJ-28_7.62x18.415mm_P1.27mm","Package_SO/SOJ-32_10.16x20.955mm_P1.27mm","Package_SO/SOJ-32_7.62x20.955mm_P1.27mm","Package_SO/SOJ-36_10.16x23.495mm_P1.27mm","Package_SO/SOJ-44_10.16x28.575mm_P1.27mm","Package_SO/SOP-16_4.4x10.4mm_P1.27mm","Package_SO/SOP-16_4.55x10.3mm_P1.27mm","Package_SO/SOP-18_7.495x11.515mm_P1.27mm","Package_SO/SOP-18_7x12.5mm_P1.27mm","Package_SO/SOP-20_7.5x12.8mm_P1.27mm","Package_SO/SOP-24_7.5x15.4mm_P1.27mm","Package_SO/SOP-28_8.4x18.16mm_P1.27mm","Package_SO/SOP-32_11.305x20.495mm_P1.27mm","Package_SO/SOP-44_12.6x28.5mm_P1.27mm","Package_SO/SOP-44_13.3x28.2mm_P1.27mm","Package_SO/SOP-4_3.8x4.1mm_P2.54mm","Package_SO/SOP-4_4.4x2.6mm_P1.27mm","Package_SO/SOP-4_7.5x4.1mm_P2.54mm","Package_SO/SOP-8-1EP_4.57x4.57mm_P1.27mm_EP4.57x4.45mm","Package_SO/SOP-8-1EP_4.57x4.57mm_P1.27mm_EP4.57x4.45mm_ThermalVias","Package_SO/SOP-8_3.76x4.96mm_P1.27mm","Package_SO/SOP-8_6.605x9.655mm_P2.54mm","Package_SO/SOP-8_6.62x9.15mm_P2.54mm","Package_SO/SSO-4_6.7x5.1mm_P2.54mm_Clearance8mm","Package_SO/SSO-6_6.8x4.6mm_P1.27mm_Clearance7mm","Package_SO/SSO-6_6.8x4.6mm_P1.27mm_Clearance8mm","Package_SO/SSO-7-8_6.4x9.78mm_P2.54mm","Package_SO/SSO-8-7_6.4x9.7mm_P2.54mm","Package_SO/SSO-8_13.6x6.3mm_P1.27mm_Clearance14.2mm","Package_SO/SSO-8_6.7x9.8mm_P2.54mm_Clearance8mm","Package_SO/SSO-8_6.8x5.9mm_P1.27mm_Clearance7mm","Package_SO/SSO-8_6.8x5.9mm_P1.27mm_Clearance8mm","Package_SO/SSO-8_9.6x6.3mm_P1.27mm_Clearance10.5mm","Package_SO/SSOP-10-1EP_3.9x4.9mm_P1mm_EP2.1x3.3mm","Package_SO/SSOP-10-1EP_3.9x4.9mm_P1mm_EP2.1x3.3mm_ThermalVias","Package_SO/SSOP-10_3.9x4.9mm_P1.00mm","Package_SO/SSOP-14_5.3x6.2mm_P0.65mm","Package_SO/SSOP-16_3.9x4.9mm_P0.635mm","Package_SO/SSOP-16_4.4x5.2mm_P0.65mm","Package_SO/SSOP-16_5.3x6.2mm_P0.65mm","Package_SO/SSOP-18_4.4x6.5mm_P0.65mm","Package_SO/SSOP-20_3.9x8.7mm_P0.635mm","Package_SO/SSOP-20_4.4x6.5mm_P0.65mm","Package_SO/SSOP-20_5.3x7.2mm_P0.65mm","Package_SO/SSOP-24_3.9x8.7mm_P0.635mm","Package_SO/SSOP-24_5.3x8.2mm_P0.65mm","Package_SO/SSOP-28_3.9x9.9mm_P0.635mm","Package_SO/SSOP-28_5.3x10.2mm_P0.65mm","Package_SO/SSOP-40_8.8x17.5mm_P0.8mm","Package_SO/SSOP-44_5.3x12.8mm_P0.5mm","Package_SO/SSOP-48_5.3x12.8mm_P0.5mm","Package_SO/SSOP-48_7.5x15.9mm_P0.635mm","Package_SO/SSOP-4_4.4x2.6mm_P1.27mm","Package_SO/SSOP-56_7.5x18.5mm_P0.635mm","Package_SO/SSOP-8_2.95x2.8mm_P0.65mm","Package_SO/SSOP-8_3.95x5.21x3.27mm_P1.27mm","Package_SO/SSOP-8_3.9x5.05mm_P1.27mm","Package_SO/SSOP-8_5.3x3mm_P0.65mm","Package_SO/STC_SOP-16_3.9x9.9mm_P1.27mm","Package_SO/ST_MultiPowerSO-30","Package_SO/ST_PowerSSO-24_SlugDown","Package_SO/ST_PowerSSO-24_SlugDown_ThermalVias","Package_SO/ST_PowerSSO-24_SlugUp","Package_SO/ST_PowerSSO-36_SlugDown","Package_SO/ST_PowerSSO-36_SlugDown_ThermalVias","Package_SO/ST_PowerSSO-36_SlugUp","Package_SO/TI_SO-PowerPAD-8","Package_SO/TI_SO-PowerPAD-8_ThermalVias","Package_SO/TSOP-5_1.65x3.05mm_P0.95mm","Package_SO/TSOP-6_1.65x3.05mm_P0.95mm","Package_SO/TSOP-I-24_12.4x6mm_P0.5mm","Package_SO/TSOP-I-24_14.4x6mm_P0.5mm","Package_SO/TSOP-I-24_16.4x6mm_P0.5mm","Package_SO/TSOP-I-24_18.4x6mm_P0.5mm","Package_SO/TSOP-I-28_11.8x8mm_P0.55mm","Package_SO/TSOP-I-32_11.8x8mm_P0.5mm","Package_SO/TSOP-I-32_12.4x8mm_P0.5mm","Package_SO/TSOP-I-32_14.4x8mm_P0.5mm","Package_SO/TSOP-I-32_16.4x8mm_P0.5mm","Package_SO/TSOP-I-32_18.4x8mm_P0.5mm","Package_SO/TSOP-I-32_18.4x8mm_P0.5mm_Reverse","Package_SO/TSOP-I-40_12.4x10mm_P0.5mm","Package_SO/TSOP-I-40_14.4x10mm_P0.5mm","Package_SO/TSOP-I-40_16.4x10mm_P0.5mm","Package_SO/TSOP-I-40_18.4x10mm_P0.5mm","Package_SO/TSOP-I-48_12.4x12mm_P0.5mm","Package_SO/TSOP-I-48_14.4x12mm_P0.5mm","Package_SO/TSOP-I-48_16.4x12mm_P0.5mm","Package_SO/TSOP-I-48_18.4x12mm_P0.5mm","Package_SO/TSOP-I-56_14.4x14mm_P0.5mm","Package_SO/TSOP-I-56_16.4x14mm_P0.5mm","Package_SO/TSOP-I-56_18.4x14mm_P0.5mm","Package_SO/TSOP-II-32_21.0x10.2mm_P1.27mm","Package_SO/TSOP-II-40-44_10.16x18.37mm_P0.8mm","Package_SO/TSOP-II-44_10.16x18.41mm_P0.8mm","Package_SO/TSOP-II-54_22.2x10.16mm_P0.8mm","Package_SO/TSSOP-100_6.1x20.8mm_P0.4mm","Package_SO/TSSOP-10_3x3mm_P0.5mm","Package_SO/TSSOP-14-1EP_4.4x5mm_P0.65mm","Package_SO/TSSOP-14_4.4x3.6mm_P0.4mm","Package_SO/TSSOP-14_4.4x5mm_P0.65mm","Package_SO/TSSOP-16-1EP_4.4x5mm_P0.65mm","Package_SO/TSSOP-16-1EP_4.4x5mm_P0.65mm_EP3x3mm","Package_SO/TSSOP-16-1EP_4.4x5mm_P0.65mm_EP3x3mm_ThermalVias","Package_SO/TSSOP-16_4.4x3.6mm_P0.4mm","Package_SO/TSSOP-16_4.4x5mm_P0.65mm","Package_SO/TSSOP-20-1EP_4.4x6.5mm_P0.65mm_EP2.15x3.35mm","Package_SO/TSSOP-20_4.4x5mm_P0.4mm","Package_SO/TSSOP-20_4.4x5mm_P0.5mm","Package_SO/TSSOP-20_4.4x6.5mm_P0.65mm","Package_SO/TSSOP-24_4.4x5mm_P0.4mm","Package_SO/TSSOP-24_4.4x6.5mm_P0.5mm","Package_SO/TSSOP-24_4.4x7.8mm_P0.65mm","Package_SO/TSSOP-24_6.1x7.8mm_P0.65mm","Package_SO/TSSOP-28-1EP_4.4x9.7mm_P0.65mm_EP2.74x4.75mm","Package_SO/TSSOP-28-1EP_4.4x9.7mm_P0.65mm_EP2.74x4.75mm_ThermalVias","Package_SO/TSSOP-28-1EP_4.4x9.7mm_P0.65mm_EP2.85x6.7mm","Package_SO/TSSOP-28-1EP_4.4x9.7mm_P0.65mm_EP3.05x7.56mm","Package_SO/TSSOP-28-1EP_4.4x9.7mm_P0.65mm_EP3.05x7.56mm_ThermalVias","Package_SO/TSSOP-28-1EP_4.4x9.7mm_P0.65mm_EP3.4x9.7mm_Mask3.1x4.05mm","Package_SO/TSSOP-28-1EP_4.4x9.7mm_P0.65mm_EP3.4x9.7mm_Mask3.1x4.05mm_ThermalVias","Package_SO/TSSOP-28_4.4x7.8mm_P0.5mm","Package_SO/TSSOP-28_4.4x9.7mm_P0.65mm","Package_SO/TSSOP-28_6.1x7.8mm_P0.5mm","Package_SO/TSSOP-28_6.1x9.7mm_P0.65mm","Package_SO/TSSOP-28_8x9.7mm_P0.65mm","Package_SO/TSSOP-30_4.4x7.8mm_P0.5mm","Package_SO/TSSOP-30_6.1x9.7mm_P0.65mm","Package_SO/TSSOP-32_4.4x6.5mm_P0.4mm","Package_SO/TSSOP-32_6.1x11mm_P0.65mm","Package_SO/TSSOP-32_8x11mm_P0.65mm","Package_SO/TSSOP-36_4.4x7.8mm_P0.4mm","Package_SO/TSSOP-36_4.4x9.7mm_P0.5mm","Package_SO/TSSOP-36_6.1x12.5mm_P0.65mm","Package_SO/TSSOP-36_6.1x7.8mm_P0.4mm","Package_SO/TSSOP-36_6.1x9.7mm_P0.5mm","Package_SO/TSSOP-36_8x12.5mm_P0.65mm","Package_SO/TSSOP-36_8x9.7mm_P0.5mm","Package_SO/TSSOP-38_4.4x9.7mm_P0.5mm","Package_SO/TSSOP-38_6.1x12.5mm_P0.65mm","Package_SO/TSSOP-40_6.1x11mm_P0.5mm","Package_SO/TSSOP-40_6.1x14mm_P0.65mm","Package_SO/TSSOP-40_8x11mm_P0.5mm","Package_SO/TSSOP-40_8x14mm_P0.65mm","Package_SO/TSSOP-44_4.4x11.2mm_P0.5mm","Package_SO/TSSOP-44_4.4x11mm_P0.5mm","Package_SO/TSSOP-44_6.1x11mm_P0.5mm","Package_SO/TSSOP-48_4.4x9.7mm_P0.4mm","Package_SO/TSSOP-48_6.1x12.5mm_P0.5mm","Package_SO/TSSOP-48_6.1x9.7mm_P0.4mm","Package_SO/TSSOP-48_8x12.5mm_P0.5mm","Package_SO/TSSOP-48_8x9.7mm_P0.4mm","Package_SO/TSSOP-4_4.4x5mm_P4mm","Package_SO/TSSOP-50_4.4x12.5mm_P0.5mm","Package_SO/TSSOP-52_6.1x11mm_P0.4mm","Package_SO/TSSOP-52_8x11mm_P0.4mm","Package_SO/TSSOP-56_4.4x11.3mm_P0.4mm","Package_SO/TSSOP-56_6.1x12.5mm_P0.4mm","Package_SO/TSSOP-56_6.1x14mm_P0.5mm","Package_SO/TSSOP-56_8x12.5mm_P0.4mm","Package_SO/TSSOP-56_8x14mm_P0.5mm","Package_SO/TSSOP-60_8x12.5mm_P0.4mm","Package_SO/TSSOP-64_6.1x14mm_P0.4mm","Package_SO/TSSOP-64_6.1x17mm_P0.5mm","Package_SO/TSSOP-64_8x14mm_P0.4mm","Package_SO/TSSOP-68_8x14mm_P0.4mm","Package_SO/TSSOP-80_6.1x17mm_P0.4mm","Package_SO/TSSOP-8_3x3mm_P0.65mm","Package_SO/TSSOP-8_4.4x3mm_P0.65mm","Package_SO/Texas_DAD0032A_HTSSOP-32_6.1x11mm_P0.65mm_TopEP3.71x3.81mm","Package_SO/Texas_DGN0008B_VSSOP-8-1EP_3x3mm_P0.65mm_EP2x3mm_Mask1.88x1.98mm","Package_SO/Texas_DGN0008B_VSSOP-8-1EP_3x3mm_P0.65mm_EP2x3mm_Mask1.88x1.98mm_ThermalVias","Package_SO/Texas_DGN0008D_VSSOP-8-1EP_3x3mm_P0.65mm_EP2x2.94mm_Mask1.57x1.89mm","Package_SO/Texas_DGN0008D_VSSOP-8-1EP_3x3mm_P0.65mm_EP2x2.94mm_Mask1.57x1.89mm_ThermalVias","Package_SO/Texas_DGN0008G_VSSOP-8-1EP_3x3mm_P0.65mm_EP2x2.94mm_Mask1.846x2.15mm","Package_SO/Texas_DGN0008G_VSSOP-8-1EP_3x3mm_P0.65mm_EP2x2.94mm_Mask1.846x2.15mm_ThermalVias","Package_SO/Texas_DGS0020A_TSSOP-20_3x5.1mm_P0.5mm","Package_SO/Texas_DKD0036A_HSSOP-36_11x15.9mm_P0.65mm_TopEP5.85x12.65mm","Package_SO/Texas_DYY0016A_TSOT-23-16_2x4.2mm_P0.5mm","Package_SO/Texas_HSOP-8-1EP_3.9x4.9mm_P1.27mm","Package_SO/Texas_HSOP-8-1EP_3.9x4.9mm_P1.27mm_ThermalVias","Package_SO/Texas_HTSOP-8-1EP_3.9x4.9mm_P1.27mm_EP2.95x4.9mm_Mask2.4x3.1mm_ThermalVias","Package_SO/Texas_HTSSOP-14-1EP_4.4x5mm_P0.65mm_EP3.4x5mm_Mask3.155x3.255mm","Package_SO/Texas_HTSSOP-14-1EP_4.4x5mm_P0.65mm_EP3.4x5mm_Mask3.155x3.255mm_ThermalVias","Package_SO/Texas_PW0020A_TSSOP-20_4.4x6.5mm_P0.65mm","Package_SO/Texas_PWP0020A","Package_SO/Texas_PWP0028V_TSSOP-28-1EP_4.4x9.7mm_P0.65mm_EP3.4x9.7mm_Mask2.94x5.62mm","Package_SO/Texas_PWP0028V_TSSOP-28-1EP_4.4x9.7mm_P0.65mm_EP3.4x9.7mm_Mask2.94x5.62mm_ThermalVias","Package_SO/Texas_R-PDSO-G8_EP2.95x4.9mm_Mask2.4x3.1mm","Package_SO/Texas_R-PDSO-G8_EP2.95x4.9mm_Mask2.4x3.1mm_ThermalVias","Package_SO/Texas_S-PDSO-G8_3x3mm_P0.65mm","Package_SO/Toshiba_SOIC-4-6_4.4x3.6mm_P1.27mm","Package_SO/Toshiba_SOIC-5-6_4.4x3.6mm_P1.27mm","Package_SO/VSO-40_7.6x15.4mm_P0.762mm","Package_SO/VSO-56_11.1x21.5mm_P0.75mm","Package_SO/VSSOP-8_2.3x2mm_P0.5mm","Package_SO/VSSOP-8_3x3mm_P0.65mm","Package_SO/Vishay_PowerPAK_1212-8_Dual","Package_SO/Vishay_PowerPAK_1212-8_Single","Package_SO/Zetex_SM8","Package_SON/Diodes_PowerDI3333-8","Package_SON/Diodes_PowerDI3333-8_UXC_3.3x3.3mm_P0.65mm","Package_SON/EPSON_CE-USON-10_USON-10_3.2x2.5mm_P0.7mm","Package_SON/Fairchild_DualPower33-6_3x3mm","Package_SON/Fairchild_MicroPak-6_1.0x1.45mm_P0.5mm","Package_SON/Fairchild_MicroPak2-6_1.0x1.0mm_P0.35mm","Package_SON/HUSON-3-1EP_2x2mm_P1.3mm_EP1.1x1.6mm","Package_SON/HVSON-8-1EP_3x3mm_P0.65mm_EP1.6x2.4mm","Package_SON/HVSON-8-1EP_4x4mm_P0.8mm_EP2.2x3.1mm","Package_SON/Infineon_PG-LSON-8-1","Package_SON/Infineon_PG-TDSON-8_6.15x5.15mm","Package_SON/Infineon_PG-TISON-8-2","Package_SON/Infineon_PG-TISON-8-3","Package_SON/Infineon_PG-TISON-8-4","Package_SON/Infineon_PG-TISON-8-5","Package_SON/MPS_USON-6_1.2x1.6mm_P0.5mm","Package_SON/MPS_VSON-6_1x1.5mm_P0.5mm","Package_SON/MicroCrystal_C7_SON-8_1.5x3.2mm_P0.9mm","Package_SON/Microchip_USON-10-1EP_3x3mm_P0.5mm_EP1.8x2.5mm","Package_SON/Microchip_USON-10-1EP_3x3mm_P0.5mm_EP1.8x2.5mm_ThermalVias","Package_SON/NXP_XSON-16","Package_SON/Nexperia_HUSON-12_USON-12-1EP_1.35x2.5mm_P0.4mm_EP0.4x2mm","Package_SON/Nexperia_HUSON-16_USON-16-1EP_1.35x3.3mm_P0.4mm_EP0.4x2.8mm","Package_SON/Nexperia_HUSON-8_USON-8-1EP_1.35x1.7mm_P0.4mm_EP0.4x1.2mm","Package_SON/ROHM_VML0806","Package_SON/RTC_SMD_MicroCrystal_C3_2.5x3.7mm","Package_SON/SON-8-1EP_3x2mm_P0.5mm_EP1.4x1.6mm","Package_SON/ST_PowerFLAT-6L_5x6mm_P1.27mm","Package_SON/ST_PowerFLAT_HV-5_8x8mm","Package_SON/ST_PowerFLAT_HV-8_5x6mm","Package_SON/Texas_DPY0002A_0.6x1mm_P0.65mm","Package_SON/Texas_DQK","Package_SON/Texas_DQX002A","Package_SON/Texas_DRC0010J","Package_SON/Texas_DRC0010J_ThermalVias","Package_SON/Texas_DRX_WSON-10_2.5x2.5mm_P0.5mm","Package_SON/Texas_DSC0010J","Package_SON/Texas_DSC0010J_ThermalVias","Package_SON/Texas_DSG0008A_WSON-8-1EP_2x2mm_P0.5mm_EP0.9x1.6mm","Package_SON/Texas_DSG0008A_WSON-8-1EP_2x2mm_P0.5mm_EP0.9x1.6mm_ThermalVias","Package_SON/Texas_PWSON-N6","Package_SON/Texas_R-PUSON-N14","Package_SON/Texas_R-PUSON-N8_USON-8-1EP_1.6x2.1mm_P0.5mm_EP0.4x1.7mm","Package_SON/Texas_R-PWSON-N12_EP0.4x2mm","Package_SON/Texas_S-PDSO-N12","Package_SON/Texas_S-PVSON-N10","Package_SON/Texas_S-PVSON-N10_ThermalVias","Package_SON/Texas_S-PVSON-N8","Package_SON/Texas_S-PVSON-N8_ThermalVias","Package_SON/Texas_S-PWSON-N10","Package_SON/Texas_S-PWSON-N10_ThermalVias","Package_SON/Texas_S-PWSON-N8_EP1.2x2mm","Package_SON/Texas_S-PWSON-N8_EP1.2x2mm_ThermalVias","Package_SON/Texas_USON-6_1x1.45mm_P0.5mm_SMD","Package_SON/Texas_VSON-HR-8_1.5x2mm_P0.5mm","Package_SON/Texas_X2SON-4-1EP_1.1x1.4mm_P0.5mm_EP0.8x0.6mm","Package_SON/Texas_X2SON-4-1EP_1.1x1.4mm_P0.5mm_EP0.8x0.6mm_ThermalVias","Package_SON/Texas_X2SON-4_1x1mm_P0.65mm","Package_SON/Texas_X2SON-5_0.8x0.8mm_P0.48mm","Package_SON/Texas_X2SON-5_0.8x0.8mm_P0.48mm_RoutingVia","Package_SON/USON-10_2.5x1.0mm_P0.5mm","Package_SON/USON-20_2x4mm_P0.4mm","Package_SON/VSON-10-1EP_3x3mm_P0.5mm_EP1.2x2mm","Package_SON/VSON-10-1EP_3x3mm_P0.5mm_EP1.2x2mm_ThermalVias","Package_SON/VSON-10-1EP_3x3mm_P0.5mm_EP1.65x2.4mm","Package_SON/VSON-10-1EP_3x3mm_P0.5mm_EP1.65x2.4mm_ThermalVias","Package_SON/VSON-14-1EP_3x4.45mm_P0.65mm_EP1.6x4.2mm","Package_SON/VSON-14-1EP_3x4.45mm_P0.65mm_EP1.6x4.2mm_ThermalVias","Package_SON/VSON-8-1EP_3x3mm_P0.65mm_EP1.65x2.4mm","Package_SON/VSON-8-1EP_3x3mm_P0.65mm_EP1.65x2.4mm_ThermalVias","Package_SON/VSON-8-1EP_3x3mm_P0.65mm_EP1.6x2.4mm","Package_SON/VSON-8_1.5x2mm_P0.5mm","Package_SON/VSON-8_3.3x3.3mm_P0.65mm_NexFET","Package_SON/VSONP-8-1EP_5x6_P1.27mm","Package_SON/WSON-10-1EP_2.5x2.5mm_P0.5mm_EP1.2x2mm","Package_SON/WSON-10-1EP_2.5x2.5mm_P0.5mm_EP1.2x2mm_ThermalVias","Package_SON/WSON-10-1EP_2x3mm_P0.5mm_EP0.84x2.4mm","Package_SON/WSON-10-1EP_2x3mm_P0.5mm_EP0.84x2.4mm_ThermalVias","Package_SON/WSON-10-1EP_4x3mm_P0.5mm_EP2.2x2mm","Package_SON/WSON-10-1EP_4x4mm_P0.8mm_EP2.6x3mm","Package_SON/WSON-10-1EP_4x4mm_P0.8mm_EP2.6x3mm_ThermalVias","Package_SON/WSON-12-1EP_3x2mm_P0.5mm_EP1x2.65","Package_SON/WSON-12-1EP_3x2mm_P0.5mm_EP1x2.65_ThermalVias","Package_SON/WSON-12-1EP_3x3mm_P0.5mm_EP1.5x2.5mm","Package_SON/WSON-12-1EP_3x3mm_P0.5mm_EP1.5x2.5mm_ThermalVias","Package_SON/WSON-12-1EP_4x4mm_P0.5mm_EP2.6x3mm","Package_SON/WSON-12-1EP_4x4mm_P0.5mm_EP2.6x3mm_ThermalVias","Package_SON/WSON-14-1EP_4.0x4.0mm_P0.5mm_EP2.6x2.6mm","Package_SON/WSON-16_3.3x1.35_P0.4mm","Package_SON/WSON-6-1EP_2x2mm_P0.65mm_EP1x1.6mm","Package_SON/WSON-6-1EP_2x2mm_P0.65mm_EP1x1.6mm_ThermalVias","Package_SON/WSON-6-1EP_3x3mm_P0.95mm","Package_SON/WSON-6_1.5x1.5mm_P0.5mm","Package_SON/WSON-8-1EP_2x2mm_P0.5mm_EP0.9x1.6mm","Package_SON/WSON-8-1EP_2x2mm_P0.5mm_EP0.9x1.6mm_ThermalVias","Package_SON/WSON-8-1EP_3x2.5mm_P0.5mm_EP1.2x1.5mm_PullBack","Package_SON/WSON-8-1EP_3x2.5mm_P0.5mm_EP1.2x1.5mm_PullBack_ThermalVias","Package_SON/WSON-8-1EP_3x3mm_P0.5mm_EP1.2x2mm","Package_SON/WSON-8-1EP_3x3mm_P0.5mm_EP1.2x2mm_ThermalVias","Package_SON/WSON-8-1EP_3x3mm_P0.5mm_EP1.45x2.4mm","Package_SON/WSON-8-1EP_3x3mm_P0.5mm_EP1.45x2.4mm_ThermalVias","Package_SON/WSON-8-1EP_3x3mm_P0.5mm_EP1.6x2.0mm","Package_SON/WSON-8-1EP_4x4mm_P0.8mm_EP1.98x3mm","Package_SON/WSON-8-1EP_4x4mm_P0.8mm_EP1.98x3mm_ThermalVias","Package_SON/WSON-8-1EP_4x4mm_P0.8mm_EP2.2x3mm","Package_SON/WSON-8-1EP_4x4mm_P0.8mm_EP2.2x3mm_ThermalVias","Package_SON/WSON-8-1EP_4x4mm_P0.8mm_EP2.6x3mm","Package_SON/WSON-8-1EP_4x4mm_P0.8mm_EP2.6x3mm_ThermalVias","Package_SON/WSON-8-1EP_6x5mm_P1.27mm_EP3.4x4.3mm","Package_SON/WSON-8-1EP_6x5mm_P1.27mm_EP3.4x4mm","Package_SON/WSON-8-1EP_8x6mm_P1.27mm_EP3.4x4.3mm","Package_SON/Winbond_USON-8-1EP_3x2mm_P0.5mm_EP0.2x1.6mm","Package_SON/Winbond_USON-8-2EP_3x4mm_P0.8mm_EP0.2x0.8mm","Package_SON/X2SON-8_1.4x1mm_P0.35mm","Package_SO_J-Lead/TSOC-6_3.76x3.94mm_P1.27mm","Package_TO_SOT_SMD/ATPAK-2","Package_TO_SOT_SMD/Analog_KS-4","Package_TO_SOT_SMD/Diodes_SOT-553","Package_TO_SOT_SMD/HVSOF5","Package_TO_SOT_SMD/HVSOF6","Package_TO_SOT_SMD/Infineon_PG-HDSOP-10-1","Package_TO_SOT_SMD/Infineon_PG-HSOF-8-1","Package_TO_SOT_SMD/Infineon_PG-HSOF-8-1_ThermalVias","Package_TO_SOT_SMD/Infineon_PG-HSOF-8-2","Package_TO_SOT_SMD/Infineon_PG-HSOF-8-2_ThermalVias","Package_TO_SOT_SMD/Infineon_PG-HSOF-8-2_ThermalVias2","Package_TO_SOT_SMD/Infineon_PG-HSOF-8-3","Package_TO_SOT_SMD/Infineon_PG-HSOF-8-3_ThermalVias","Package_TO_SOT_SMD/Infineon_PG-TO-220-7Lead_TabPin8","Package_TO_SOT_SMD/Infineon_PG-TSFP-3-1","Package_TO_SOT_SMD/LFPAK33","Package_TO_SOT_SMD/LFPAK56","Package_TO_SOT_SMD/LFPAK88","Package_TO_SOT_SMD/Nexperia_CFP15_SOT-1289","Package_TO_SOT_SMD/OnSemi_ECH8","Package_TO_SOT_SMD/PQFN_8x8","Package_TO_SOT_SMD/PowerMacro_M234_NoHole","Package_TO_SOT_SMD/PowerMacro_M234_WithHole","Package_TO_SOT_SMD/ROHM_SOT-457_ClockwisePinNumbering","Package_TO_SOT_SMD/Rohm_HRP7","Package_TO_SOT_SMD/SC-59","Package_TO_SOT_SMD/SC-59_Handsoldering","Package_TO_SOT_SMD/SC-70-8","Package_TO_SOT_SMD/SC-74-6_1.55x2.9mm_P0.95mm","Package_TO_SOT_SMD/SC-74A-5_1.55x2.9mm_P0.95mm","Package_TO_SOT_SMD/SC-82AA","Package_TO_SOT_SMD/SC-82AA_Handsoldering","Package_TO_SOT_SMD/SC-82AB","Package_TO_SOT_SMD/SC-82AB_Handsoldering","Package_TO_SOT_SMD/SOT-1123","Package_TO_SOT_SMD/SOT-1333-1","Package_TO_SOT_SMD/SOT-1334-1","Package_TO_SOT_SMD/SOT-143","Package_TO_SOT_SMD/SOT-143R","Package_TO_SOT_SMD/SOT-143R_Handsoldering","Package_TO_SOT_SMD/SOT-143_Handsoldering","Package_TO_SOT_SMD/SOT-223-3_TabPin2","Package_TO_SOT_SMD/SOT-223-5","Package_TO_SOT_SMD/SOT-223-6","Package_TO_SOT_SMD/SOT-223-6_TabPin3","Package_TO_SOT_SMD/SOT-223-8","Package_TO_SOT_SMD/SOT-223","Package_TO_SOT_SMD/SOT-23-3","Package_TO_SOT_SMD/SOT-23-5","Package_TO_SOT_SMD/SOT-23-5_HandSoldering","Package_TO_SOT_SMD/SOT-23-6","Package_TO_SOT_SMD/SOT-23-6_Handsoldering","Package_TO_SOT_SMD/SOT-23-8","Package_TO_SOT_SMD/SOT-23-8_Handsoldering","Package_TO_SOT_SMD/SOT-23","Package_TO_SOT_SMD/SOT-23W","Package_TO_SOT_SMD/SOT-23W_Handsoldering","Package_TO_SOT_SMD/SOT-23_Handsoldering","Package_TO_SOT_SMD/SOT-323_SC-70","Package_TO_SOT_SMD/SOT-343_SC-70-4","Package_TO_SOT_SMD/SOT-353_SC-70-5","Package_TO_SOT_SMD/SOT-363_SC-70-6","Package_TO_SOT_SMD/SOT-383F","Package_TO_SOT_SMD/SOT-383FL","Package_TO_SOT_SMD/SOT-416","Package_TO_SOT_SMD/SOT-457T","Package_TO_SOT_SMD/SOT-523","Package_TO_SOT_SMD/SOT-543","Package_TO_SOT_SMD/SOT-553","Package_TO_SOT_SMD/SOT-563","Package_TO_SOT_SMD/SOT-583-8","Package_TO_SOT_SMD/SOT-665","Package_TO_SOT_SMD/SOT-666","Package_TO_SOT_SMD/SOT-723","Package_TO_SOT_SMD/SOT-883","Package_TO_SOT_SMD/SOT-886","Package_TO_SOT_SMD/SOT-89-3","Package_TO_SOT_SMD/SOT-89-3_Handsoldering","Package_TO_SOT_SMD/SOT-89-5","Package_TO_SOT_SMD/SOT-89-5_Handsoldering","Package_TO_SOT_SMD/SOT-963","Package_TO_SOT_SMD/SuperSOT-3","Package_TO_SOT_SMD/SuperSOT-6","Package_TO_SOT_SMD/SuperSOT-8","Package_TO_SOT_SMD/TDSON-8-1","Package_TO_SOT_SMD/TO-252-2","Package_TO_SOT_SMD/TO-252-2_TabPin1","Package_TO_SOT_SMD/TO-252-3_TabPin2","Package_TO_SOT_SMD/TO-252-3_TabPin4","Package_TO_SOT_SMD/TO-252-4","Package_TO_SOT_SMD/TO-252-5_TabPin3","Package_TO_SOT_SMD/TO-252-5_TabPin6","Package_TO_SOT_SMD/TO-263-2","Package_TO_SOT_SMD/TO-263-2_TabPin1","Package_TO_SOT_SMD/TO-263-3_TabPin2","Package_TO_SOT_SMD/TO-263-3_TabPin4","Package_TO_SOT_SMD/TO-263-4","Package_TO_SOT_SMD/TO-263-5_TabPin3","Package_TO_SOT_SMD/TO-263-5_TabPin6","Package_TO_SOT_SMD/TO-263-6","Package_TO_SOT_SMD/TO-263-7_TabPin4","Package_TO_SOT_SMD/TO-263-7_TabPin8","Package_TO_SOT_SMD/TO-263-9_TabPin10","Package_TO_SOT_SMD/TO-263-9_TabPin5","Package_TO_SOT_SMD/TO-268-2","Package_TO_SOT_SMD/TO-269AA","Package_TO_SOT_SMD/TO-277A","Package_TO_SOT_SMD/TO-277B","Package_TO_SOT_SMD/TO-50-3_LongPad-NoHole_Housing","Package_TO_SOT_SMD/TO-50-3_LongPad-WithHole_Housing","Package_TO_SOT_SMD/TO-50-3_ShortPad-NoHole_Housing","Package_TO_SOT_SMD/TO-50-3_ShortPad-WithHole_Housing","Package_TO_SOT_SMD/TO-50-4_LongPad-NoHole_Housing","Package_TO_SOT_SMD/TO-50-4_LongPad-WithHole_Housing","Package_TO_SOT_SMD/TO-50-4_ShortPad-NoHole_Housing","Package_TO_SOT_SMD/TO-50-4_ShortPad-WithHole_Housing","Package_TO_SOT_SMD/TSOT-23-5","Package_TO_SOT_SMD/TSOT-23-5_HandSoldering","Package_TO_SOT_SMD/TSOT-23-6","Package_TO_SOT_SMD/TSOT-23-6_HandSoldering","Package_TO_SOT_SMD/TSOT-23-8","Package_TO_SOT_SMD/TSOT-23-8_HandSoldering","Package_TO_SOT_SMD/TSOT-23","Package_TO_SOT_SMD/TSOT-23_HandSoldering","Package_TO_SOT_SMD/Texas_DDF0008A_SOT-8_1.6x2.9mm_P0.65mm","Package_TO_SOT_SMD/Texas_DRT-3","Package_TO_SOT_SMD/Texas_NDQ","Package_TO_SOT_SMD/Texas_NDW-7_TabPin4","Package_TO_SOT_SMD/Texas_NDW-7_TabPin8","Package_TO_SOT_SMD/Texas_NDY0011A","Package_TO_SOT_SMD/Texas_R-PDSO-G5_DCK-5","Package_TO_SOT_SMD/Texas_R-PDSO-G6","Package_TO_SOT_SMD/Texas_R-PDSO-N5_DRL-5","Package_TO_SOT_SMD/Texas_R-PDSO-N6_DRL-6","Package_TO_SOT_SMD/VSOF5","Package_TO_SOT_SMD/Vishay_PowerPAK_SC70-6L_Dual","Package_TO_SOT_SMD/Vishay_PowerPAK_SC70-6L_Single","Package_TO_SOT_THT/Analog_TO-46-4_ThermalShield","Package_TO_SOT_THT/Fairchild_TO-220F-6L","Package_TO_SOT_THT/Heraeus_TO-92-2","Package_TO_SOT_THT/NEC_Molded_7x4x9mm","Package_TO_SOT_THT/PowerIntegrations_TO-220-7C","Package_TO_SOT_THT/SIPAK-1EP_Horizontal_TabDown","Package_TO_SOT_THT/SIPAK_Vertical","Package_TO_SOT_THT/SOD-70_P2.54mm","Package_TO_SOT_THT/SOD-70_P5.08mm","Package_TO_SOT_THT/SOT-227","Package_TO_SOT_THT/TO-100-10","Package_TO_SOT_THT/TO-100-10_Window","Package_TO_SOT_THT/TO-11-2","Package_TO_SOT_THT/TO-11-2_Window","Package_TO_SOT_THT/TO-11-3","Package_TO_SOT_THT/TO-11-3_Window","Package_TO_SOT_THT/TO-12-4","Package_TO_SOT_THT/TO-12-4_Window","Package_TO_SOT_THT/TO-126-2_Horizontal_TabDown","Package_TO_SOT_THT/TO-126-2_Horizontal_TabUp","Package_TO_SOT_THT/TO-126-2_Vertical","Package_TO_SOT_THT/TO-126-3_Horizontal_TabDown","Package_TO_SOT_THT/TO-126-3_Horizontal_TabUp","Package_TO_SOT_THT/TO-126-3_Vertical","Package_TO_SOT_THT/TO-17-4","Package_TO_SOT_THT/TO-17-4_Window","Package_TO_SOT_THT/TO-18-2","Package_TO_SOT_THT/TO-18-2_Lens","Package_TO_SOT_THT/TO-18-2_Window","Package_TO_SOT_THT/TO-18-3","Package_TO_SOT_THT/TO-18-3_Lens","Package_TO_SOT_THT/TO-18-3_Window","Package_TO_SOT_THT/TO-18-4","Package_TO_SOT_THT/TO-18-4_Lens","Package_TO_SOT_THT/TO-18-4_Window","Package_TO_SOT_THT/TO-218-2_Horizontal_TabDown","Package_TO_SOT_THT/TO-218-2_Horizontal_TabUp","Package_TO_SOT_THT/TO-218-2_Vertical","Package_TO_SOT_THT/TO-218-3_Horizontal_TabDown","Package_TO_SOT_THT/TO-218-3_Horizontal_TabUp","Package_TO_SOT_THT/TO-218-3_Vertical","Package_TO_SOT_THT/TO-220-11_P3.4x2.54mm_StaggerEven_Lead5.84mm_TabDown","Package_TO_SOT_THT/TO-220-11_P3.4x2.54mm_StaggerOdd_Lead5.84mm_TabDown","Package_TO_SOT_THT/TO-220-11_P3.4x5.08mm_StaggerEven_Lead4.58mm_Vertical","Package_TO_SOT_THT/TO-220-11_P3.4x5.08mm_StaggerOdd_Lead4.58mm_Vertical","Package_TO_SOT_THT/TO-220-11_P3.4x5.08mm_StaggerOdd_Lead8.45mm_TabDown","Package_TO_SOT_THT/TO-220-15_P2.54x2.54mm_StaggerEven_Lead5.84mm_TabDown","Package_TO_SOT_THT/TO-220-15_P2.54x2.54mm_StaggerOdd_Lead5.84mm_TabDown","Package_TO_SOT_THT/TO-220-15_P2.54x5.08mm_StaggerEven_Lead4.58mm_Vertical","Package_TO_SOT_THT/TO-220-15_P2.54x5.08mm_StaggerOdd_Lead4.58mm_Vertical","Package_TO_SOT_THT/TO-220-2_Horizontal_TabDown","Package_TO_SOT_THT/TO-220-2_Horizontal_TabUp","Package_TO_SOT_THT/TO-220-2_Vertical","Package_TO_SOT_THT/TO-220-3_Horizontal_TabDown","Package_TO_SOT_THT/TO-220-3_Horizontal_TabUp","Package_TO_SOT_THT/TO-220-3_Vertical","Package_TO_SOT_THT/TO-220-4_Horizontal_TabDown","Package_TO_SOT_THT/TO-220-4_Horizontal_TabUp","Package_TO_SOT_THT/TO-220-4_P5.08x3.7mm_StaggerEven_Lead3.8mm_Vertical","Package_TO_SOT_THT/TO-220-4_P5.08x3.7mm_StaggerOdd_Lead3.8mm_Vertical","Package_TO_SOT_THT/TO-220-4_P5.08x3.8mm_StaggerEven_Lead5.85mm_TabDown","Package_TO_SOT_THT/TO-220-4_P5.08x3.8mm_StaggerOdd_Lead5.85mm_TabDown","Package_TO_SOT_THT/TO-220-4_Vertical","Package_TO_SOT_THT/TO-220-5_Horizontal_TabDown","Package_TO_SOT_THT/TO-220-5_Horizontal_TabUp","Package_TO_SOT_THT/TO-220-5_P3.4x3.7mm_StaggerEven_Lead3.8mm_Vertical","Package_TO_SOT_THT/TO-220-5_P3.4x3.7mm_StaggerOdd_Lead3.8mm_Vertical","Package_TO_SOT_THT/TO-220-5_P3.4x3.8mm_StaggerEven_Lead7.13mm_TabDown","Package_TO_SOT_THT/TO-220-5_P3.4x3.8mm_StaggerOdd_Lead7.13mm_TabDown","Package_TO_SOT_THT/TO-220-5_Vertical","Package_TO_SOT_THT/TO-220-7_P2.54x3.7mm_StaggerEven_Lead3.8mm_Vertical","Package_TO_SOT_THT/TO-220-7_P2.54x3.7mm_StaggerOdd_Lead3.8mm_Vertical","Package_TO_SOT_THT/TO-220-7_P2.54x3.8mm_StaggerEven_Lead5.85mm_TabDown","Package_TO_SOT_THT/TO-220-7_P2.54x3.8mm_StaggerOdd_Lead5.85mm_TabDown","Package_TO_SOT_THT/TO-220-7_P2.54x5.08mm_StaggerOdd_Lead3.08mm_Vertical","Package_TO_SOT_THT/TO-220-7_P2.54x5.1mm_StaggerOdd_Lead8.025mm_TabDown","Package_TO_SOT_THT/TO-220-8_Vertical","Package_TO_SOT_THT/TO-220-9_P1.93x5.08mm_StaggerOdd_Lead3.378mm_Vertical","Package_TO_SOT_THT/TO-220-9_P1.94x3.7mm_StaggerEven_Lead3.8mm_Vertical","Package_TO_SOT_THT/TO-220-9_P1.94x3.7mm_StaggerOdd_Lead3.8mm_Vertical","Package_TO_SOT_THT/TO-220-9_P1.94x3.8mm_StaggerEven_Lead5.85mm_TabDown","Package_TO_SOT_THT/TO-220-9_P1.94x3.8mm_StaggerOdd_Lead5.85mm_TabDown","Package_TO_SOT_THT/TO-220F-11_P3.4x5.08mm_StaggerEven_Lead5.08mm_Vertical","Package_TO_SOT_THT/TO-220F-11_P3.4x5.08mm_StaggerOdd_Lead5.08mm_Vertical","Package_TO_SOT_THT/TO-220F-15_P2.54x5.08mm_StaggerEven_Lead5.08mm_Vertical","Package_TO_SOT_THT/TO-220F-15_P2.54x5.08mm_StaggerOdd_Lead5.08mm_Vertical","Package_TO_SOT_THT/TO-220F-2_Horizontal_TabDown","Package_TO_SOT_THT/TO-220F-2_Horizontal_TabUp","Package_TO_SOT_THT/TO-220F-2_Vertical","Package_TO_SOT_THT/TO-220F-3_Horizontal_TabDown","Package_TO_SOT_THT/TO-220F-3_Horizontal_TabUp","Package_TO_SOT_THT/TO-220F-3_Vertical","Package_TO_SOT_THT/TO-220F-4_Horizontal_TabDown","Package_TO_SOT_THT/TO-220F-4_Horizontal_TabUp","Package_TO_SOT_THT/TO-220F-4_P5.08x2.05mm_StaggerEven_Lead1.85mm_Vertical","Package_TO_SOT_THT/TO-220F-4_P5.08x2.05mm_StaggerOdd_Lead1.85mm_Vertical","Package_TO_SOT_THT/TO-220F-4_P5.08x3.7mm_StaggerEven_Lead3.5mm_Vertical","Package_TO_SOT_THT/TO-220F-4_P5.08x3.7mm_StaggerOdd_Lead3.5mm_Vertical","Package_TO_SOT_THT/TO-220F-4_Vertical","Package_TO_SOT_THT/TO-220F-5_Horizontal_TabDown","Package_TO_SOT_THT/TO-220F-5_Horizontal_TabUp","Package_TO_SOT_THT/TO-220F-5_P3.4x2.06mm_StaggerEven_Lead1.86mm_Vertical","Package_TO_SOT_THT/TO-220F-5_P3.4x2.06mm_StaggerOdd_Lead1.86mm_Vertical","Package_TO_SOT_THT/TO-220F-5_P3.4x3.7mm_StaggerEven_Lead3.5mm_Vertical","Package_TO_SOT_THT/TO-220F-5_P3.4x3.7mm_StaggerOdd_Lead3.5mm_Vertical","Package_TO_SOT_THT/TO-220F-5_Vertical","Package_TO_SOT_THT/TO-220F-7_P2.54x3.7mm_StaggerEven_Lead3.5mm_Vertical","Package_TO_SOT_THT/TO-220F-7_P2.54x3.7mm_StaggerOdd_Lead3.5mm_Vertical","Package_TO_SOT_THT/TO-220F-9_P1.8x3.7mm_StaggerEven_Lead3.5mm_Vertical","Package_TO_SOT_THT/TO-220F-9_P1.8x3.7mm_StaggerOdd_Lead3.5mm_Vertical","Package_TO_SOT_THT/TO-247-2_Horizontal_TabDown","Package_TO_SOT_THT/TO-247-2_Horizontal_TabUp","Package_TO_SOT_THT/TO-247-2_Vertical","Package_TO_SOT_THT/TO-247-3_Horizontal_TabDown","Package_TO_SOT_THT/TO-247-3_Horizontal_TabUp","Package_TO_SOT_THT/TO-247-3_Vertical","Package_TO_SOT_THT/TO-247-4_Horizontal_TabDown","Package_TO_SOT_THT/TO-247-4_Horizontal_TabUp","Package_TO_SOT_THT/TO-247-4_Vertical","Package_TO_SOT_THT/TO-247-5_Horizontal_TabDown","Package_TO_SOT_THT/TO-247-5_Horizontal_TabUp","Package_TO_SOT_THT/TO-247-5_Vertical","Package_TO_SOT_THT/TO-251-2-1EP_Horizontal_TabDown","Package_TO_SOT_THT/TO-251-2_Vertical","Package_TO_SOT_THT/TO-251-3-1EP_Horizontal_TabDown","Package_TO_SOT_THT/TO-251-3_Vertical","Package_TO_SOT_THT/TO-262-3-1EP_Horizontal_TabDown","Package_TO_SOT_THT/TO-262-3_Vertical","Package_TO_SOT_THT/TO-262-5-1EP_Horizontal_TabDown","Package_TO_SOT_THT/TO-262-5_Vertical","Package_TO_SOT_THT/TO-264-2_Horizontal_TabDown","Package_TO_SOT_THT/TO-264-2_Horizontal_TabUp","Package_TO_SOT_THT/TO-264-2_Vertical","Package_TO_SOT_THT/TO-264-3_Horizontal_TabDown","Package_TO_SOT_THT/TO-264-3_Horizontal_TabUp","Package_TO_SOT_THT/TO-264-3_Vertical","Package_TO_SOT_THT/TO-264-5_Horizontal_TabDown","Package_TO_SOT_THT/TO-264-5_Horizontal_TabUp","Package_TO_SOT_THT/TO-264-5_Vertical","Package_TO_SOT_THT/TO-3","Package_TO_SOT_THT/TO-33-4","Package_TO_SOT_THT/TO-33-4_Window","Package_TO_SOT_THT/TO-38-2","Package_TO_SOT_THT/TO-38-2_Window","Package_TO_SOT_THT/TO-38-3","Package_TO_SOT_THT/TO-38-3_Window","Package_TO_SOT_THT/TO-39-10","Package_TO_SOT_THT/TO-39-10_Window","Package_TO_SOT_THT/TO-39-2","Package_TO_SOT_THT/TO-39-2_Window","Package_TO_SOT_THT/TO-39-3","Package_TO_SOT_THT/TO-39-3_Window","Package_TO_SOT_THT/TO-39-4","Package_TO_SOT_THT/TO-39-4_Window","Package_TO_SOT_THT/TO-39-6","Package_TO_SOT_THT/TO-39-6_Window","Package_TO_SOT_THT/TO-39-8","Package_TO_SOT_THT/TO-39-8_Window","Package_TO_SOT_THT/TO-3P-3_Horizontal_TabDown","Package_TO_SOT_THT/TO-3P-3_Horizontal_TabUp","Package_TO_SOT_THT/TO-3P-3_Vertical","Package_TO_SOT_THT/TO-3PB-3_Horizontal_TabDown","Package_TO_SOT_THT/TO-3PB-3_Horizontal_TabUp","Package_TO_SOT_THT/TO-3PB-3_Vertical","Package_TO_SOT_THT/TO-46-2","Package_TO_SOT_THT/TO-46-2_Pin2Center","Package_TO_SOT_THT/TO-46-2_Pin2Center_Window","Package_TO_SOT_THT/TO-46-2_Window","Package_TO_SOT_THT/TO-46-3","Package_TO_SOT_THT/TO-46-3_Pin2Center","Package_TO_SOT_THT/TO-46-3_Pin2Center_Window","Package_TO_SOT_THT/TO-46-3_Window","Package_TO_SOT_THT/TO-46-4","Package_TO_SOT_THT/TO-46-4_Window","Package_TO_SOT_THT/TO-5-10","Package_TO_SOT_THT/TO-5-10_Window","Package_TO_SOT_THT/TO-5-2","Package_TO_SOT_THT/TO-5-2_Window","Package_TO_SOT_THT/TO-5-3","Package_TO_SOT_THT/TO-5-3_Window","Package_TO_SOT_THT/TO-5-4","Package_TO_SOT_THT/TO-5-4_Window","Package_TO_SOT_THT/TO-5-6","Package_TO_SOT_THT/TO-5-6_Window","Package_TO_SOT_THT/TO-5-8","Package_TO_SOT_THT/TO-5-8_PD5.08","Package_TO_SOT_THT/TO-5-8_PD5.08_Window","Package_TO_SOT_THT/TO-5-8_Window","Package_TO_SOT_THT/TO-52-2","Package_TO_SOT_THT/TO-52-2_Window","Package_TO_SOT_THT/TO-52-3","Package_TO_SOT_THT/TO-52-3_Window","Package_TO_SOT_THT/TO-72-4","Package_TO_SOT_THT/TO-72-4_Window","Package_TO_SOT_THT/TO-75-6","Package_TO_SOT_THT/TO-75-6_Window","Package_TO_SOT_THT/TO-78-10","Package_TO_SOT_THT/TO-78-10_Window","Package_TO_SOT_THT/TO-78-6","Package_TO_SOT_THT/TO-78-6_Window","Package_TO_SOT_THT/TO-78-8","Package_TO_SOT_THT/TO-78-8_Window","Package_TO_SOT_THT/TO-8-2","Package_TO_SOT_THT/TO-8-2_Window","Package_TO_SOT_THT/TO-8-3","Package_TO_SOT_THT/TO-8-3_Window","Package_TO_SOT_THT/TO-92-2","Package_TO_SOT_THT/TO-92-2_Horizontal1","Package_TO_SOT_THT/TO-92-2_Horizontal2","Package_TO_SOT_THT/TO-92-2_W4.0mm_Horizontal_FlatSideDown","Package_TO_SOT_THT/TO-92-2_W4.0mm_Horizontal_FlatSideUp","Package_TO_SOT_THT/TO-92-2_Wide","Package_TO_SOT_THT/TO-92","Package_TO_SOT_THT/TO-92Flat","Package_TO_SOT_THT/TO-92L","Package_TO_SOT_THT/TO-92L_HandSolder","Package_TO_SOT_THT/TO-92L_Inline","Package_TO_SOT_THT/TO-92L_Inline_Wide","Package_TO_SOT_THT/TO-92L_Wide","Package_TO_SOT_THT/TO-92Mini-2","Package_TO_SOT_THT/TO-92S","Package_TO_SOT_THT/TO-92_HandSolder","Package_TO_SOT_THT/TO-92_Horizontal1","Package_TO_SOT_THT/TO-92_Horizontal2","Package_TO_SOT_THT/TO-92_Inline","Package_TO_SOT_THT/TO-92_Inline_Horizontal1","Package_TO_SOT_THT/TO-92_Inline_Horizontal2","Package_TO_SOT_THT/TO-92_Inline_W4.0mm_Horizontal_FlatSideDown","Package_TO_SOT_THT/TO-92_Inline_W4.0mm_Horizontal_FlatSideUp","Package_TO_SOT_THT/TO-92_Inline_Wide","Package_TO_SOT_THT/TO-92_W4.0mm_StaggerEven_Horizontal_FlatSideDown","Package_TO_SOT_THT/TO-92_W4.0mm_StaggerEven_Horizontal_FlatSideUp","Package_TO_SOT_THT/TO-92_Wide","Package_TO_SOT_THT/TO-99-6","Package_TO_SOT_THT/TO-99-6_Window","Package_TO_SOT_THT/TO-99-8","Package_TO_SOT_THT/TO-99-8_Window","Panelization/BreakLine_11h_D0.5mm_P0.85mm","Panelization/BreakLine_1h_D0.5mm_P0.85mm","Panelization/BreakLine_2h_D0.5mm_P0.85mm","Panelization/BreakLine_2h_D0.5mm_P1.7mm","Panelization/BreakLine_3h_D0.5mm_P0.85mm","Panelization/BreakLine_3h_D0.5mm_P1.7mm","Panelization/BreakLine_5h_D0.5mm_P0.85mm","Panelization/BreakLine_7h_D0.5mm_P0.85mm","Panelization/BreakLine_9h_D0.5mm_P0.85mm","Panelization/MouseBite-Part_2.0x2.0mm_0h","Panelization/MouseBite-Part_2.0x2.0mm_inset_D0.5mm_P0.85mm_4h_Trace","Panelization/MouseBite-Part_2.0x2.0mm_inset_D0.5mm_P0.85mm_5h","Panelization/MouseBite-Part_2.0x2.0mm_outset_D0.5mm_P0.85mm_2h_Trace","Panelization/MouseBite-Part_2.0x2.0mm_outset_D0.5mm_P0.85mm_3h","Panelization/MouseBite-Part_2.0x4.5mm_0h","Panelization/MouseBite-Part_2.0x4.5mm_inset_D0.5mm_P0.85mm_5h_Trace","Panelization/MouseBite-Part_2.0x4.5mm_inset_D0.5mm_P0.85mm_7h","Panelization/MouseBite-Part_2.0x4.5mm_outset_D0.5mm_P0.85mm_5h_Trace","Panelization/MouseBite-Part_2.0x4.5mm_outset_D0.5mm_P0.85mm_7h","Panelization/MouseBite-Slot-Jumper_01005","Panelization/MouseBite-Slot-Jumper_0201","Panelization/MouseBite-Slot_2.0x2.0mm_inset_D0.5mm_P0.85mm_4h_Trace","Panelization/MouseBite-Slot_2.0x2.0mm_inset_D0.5mm_P0.85mm_5h","Panelization/MouseBite-Slot_2.0x2.0mm_outset_D0.5mm_P0.85mm_2h_Trace","Panelization/MouseBite-Slot_2.0x2.0mm_outset_D0.5mm_P0.85mm_3h","Panelization/MouseBite-Slot_2.0x4.5mm_inset_D0.5mm_P0.85mm_5h_Trace","Panelization/MouseBite-Slot_2.0x4.5mm_inset_D0.5mm_P0.85mm_7h","Panelization/MouseBite-Slot_2.0x4.5mm_outset_D0.5mm_P0.85mm_5h_Trace","Panelization/MouseBite-Slot_2.0x4.5mm_outset_D0.5mm_P0.85mm_7h","Panelization/MouseBite-Slot_2.54x2.54mm_on-edge_D0.5mm_P0.85mm_4h_Trace","Panelization/MouseBite-Slot_2.54x5.08mm_on-edge_D0.5mm_P0.85mm_5h_Trace","Potentiometer_SMD/Potentiometer_ACP_CA14-VSMD_Vertical","Potentiometer_SMD/Potentiometer_ACP_CA14-VSMD_Vertical_Hole","Potentiometer_SMD/Potentiometer_ACP_CA6-VSMD_Vertical","Potentiometer_SMD/Potentiometer_ACP_CA6-VSMD_Vertical_Hole","Potentiometer_SMD/Potentiometer_ACP_CA9-VSMD_Vertical","Potentiometer_SMD/Potentiometer_ACP_CA9-VSMD_Vertical_Hole","Potentiometer_SMD/Potentiometer_Bourns_3214G_Horizontal","Potentiometer_SMD/Potentiometer_Bourns_3214J_Horizontal","Potentiometer_SMD/Potentiometer_Bourns_3214W_Vertical","Potentiometer_SMD/Potentiometer_Bourns_3214X_Vertical","Potentiometer_SMD/Potentiometer_Bourns_3224G_Horizontal","Potentiometer_SMD/Potentiometer_Bourns_3224J_Horizontal","Potentiometer_SMD/Potentiometer_Bourns_3224W_Vertical","Potentiometer_SMD/Potentiometer_Bourns_3224X_Vertical","Potentiometer_SMD/Potentiometer_Bourns_3269P_Horizontal","Potentiometer_SMD/Potentiometer_Bourns_3269W_Vertical","Potentiometer_SMD/Potentiometer_Bourns_3269X_Horizontal","Potentiometer_SMD/Potentiometer_Bourns_3314G_Vertical","Potentiometer_SMD/Potentiometer_Bourns_3314J_Vertical","Potentiometer_SMD/Potentiometer_Bourns_3314R-1_Vertical_Hole","Potentiometer_SMD/Potentiometer_Bourns_3314R-GM5_Vertical_Hole","Potentiometer_SMD/Potentiometer_Bourns_3314S_Horizontal","Potentiometer_SMD/Potentiometer_Bourns_PRS11S_Vertical","Potentiometer_SMD/Potentiometer_Bourns_TC33X_Vertical","Potentiometer_SMD/Potentiometer_Vishay_TS53YJ_Vertical","Potentiometer_SMD/Potentiometer_Vishay_TS53YL_Vertical","Potentiometer_THT/Potentiometer_ACP_CA14-H2,5_Horizontal","Potentiometer_THT/Potentiometer_ACP_CA14-H4_Horizontal","Potentiometer_THT/Potentiometer_ACP_CA14-H5_Horizontal","Potentiometer_THT/Potentiometer_ACP_CA14V-15_Vertical","Potentiometer_THT/Potentiometer_ACP_CA14V-15_Vertical_Hole","Potentiometer_THT/Potentiometer_ACP_CA6-H2,5_Horizontal","Potentiometer_THT/Potentiometer_ACP_CA9-H2,5_Horizontal","Potentiometer_THT/Potentiometer_ACP_CA9-H3,8_Horizontal","Potentiometer_THT/Potentiometer_ACP_CA9-H5_Horizontal","Potentiometer_THT/Potentiometer_ACP_CA9-V10_Vertical","Potentiometer_THT/Potentiometer_ACP_CA9-V10_Vertical_Hole","Potentiometer_THT/Potentiometer_Alpha_RD901F-40-00D_Single_Vertical","Potentiometer_THT/Potentiometer_Alpha_RD901F-40-00D_Single_Vertical_CircularHoles","Potentiometer_THT/Potentiometer_Alpha_RD902F-40-00D_Dual_Vertical","Potentiometer_THT/Potentiometer_Alpha_RD902F-40-00D_Dual_Vertical_CircularHoles","Potentiometer_THT/Potentiometer_Alps_RK097_Dual_Horizontal","Potentiometer_THT/Potentiometer_Alps_RK097_Dual_Horizontal_Switch","Potentiometer_THT/Potentiometer_Alps_RK097_Single_Horizontal","Potentiometer_THT/Potentiometer_Alps_RK097_Single_Horizontal_Switch","Potentiometer_THT/Potentiometer_Alps_RK09K_Single_Horizontal","Potentiometer_THT/Potentiometer_Alps_RK09K_Single_Vertical","Potentiometer_THT/Potentiometer_Alps_RK09L_Double_Horizontal","Potentiometer_THT/Potentiometer_Alps_RK09L_Double_Vertical","Potentiometer_THT/Potentiometer_Alps_RK09L_Single_Horizontal","Potentiometer_THT/Potentiometer_Alps_RK09L_Single_Vertical","Potentiometer_THT/Potentiometer_Alps_RK09Y11_Single_Horizontal","Potentiometer_THT/Potentiometer_Alps_RK163_Dual_Horizontal","Potentiometer_THT/Potentiometer_Alps_RK163_Single_Horizontal","Potentiometer_THT/Potentiometer_Bourns_20P_Horizontal","Potentiometer_THT/Potentiometer_Bourns_3005_Horizontal","Potentiometer_THT/Potentiometer_Bourns_3006P_Horizontal","Potentiometer_THT/Potentiometer_Bourns_3006W_Horizontal","Potentiometer_THT/Potentiometer_Bourns_3006Y_Horizontal","Potentiometer_THT/Potentiometer_Bourns_3009P_Horizontal","Potentiometer_THT/Potentiometer_Bourns_3009Y_Horizontal","Potentiometer_THT/Potentiometer_Bourns_3266P_Horizontal","Potentiometer_THT/Potentiometer_Bourns_3266W_Vertical","Potentiometer_THT/Potentiometer_Bourns_3266X_Horizontal","Potentiometer_THT/Potentiometer_Bourns_3266Y_Vertical","Potentiometer_THT/Potentiometer_Bourns_3266Z_Horizontal","Potentiometer_THT/Potentiometer_Bourns_3296P_Horizontal","Potentiometer_THT/Potentiometer_Bourns_3296W_Vertical","Potentiometer_THT/Potentiometer_Bourns_3296X_Horizontal","Potentiometer_THT/Potentiometer_Bourns_3296Y_Vertical","Potentiometer_THT/Potentiometer_Bourns_3296Z_Horizontal","Potentiometer_THT/Potentiometer_Bourns_3299P_Horizontal","Potentiometer_THT/Potentiometer_Bourns_3299W_Vertical","Potentiometer_THT/Potentiometer_Bourns_3299X_Horizontal","Potentiometer_THT/Potentiometer_Bourns_3299Y_Vertical","Potentiometer_THT/Potentiometer_Bourns_3299Z_Horizontal","Potentiometer_THT/Potentiometer_Bourns_3339H_Vertical","Potentiometer_THT/Potentiometer_Bourns_3339P_Vertical","Potentiometer_THT/Potentiometer_Bourns_3339P_Vertical_HandSoldering","Potentiometer_THT/Potentiometer_Bourns_3339S_Horizontal","Potentiometer_THT/Potentiometer_Bourns_3339W_Horizontal","Potentiometer_THT/Potentiometer_Bourns_3386C_Horizontal","Potentiometer_THT/Potentiometer_Bourns_3386F_Vertical","Potentiometer_THT/Potentiometer_Bourns_3386H_Horizontal","Potentiometer_THT/Potentiometer_Bourns_3386P_Vertical","Potentiometer_THT/Potentiometer_Bourns_3386W_Horizontal","Potentiometer_THT/Potentiometer_Bourns_3386X_Horizontal","Potentiometer_THT/Potentiometer_Bourns_PTA1543_Single_Slide","Potentiometer_THT/Potentiometer_Bourns_PTA2043_Single_Slide","Potentiometer_THT/Potentiometer_Bourns_PTA3043_Single_Slide","Potentiometer_THT/Potentiometer_Bourns_PTA4543_Single_Slide","Potentiometer_THT/Potentiometer_Bourns_PTA6043_Single_Slide","Potentiometer_THT/Potentiometer_Bourns_PTV09A-1_Single_Vertical","Potentiometer_THT/Potentiometer_Bourns_PTV09A-2_Single_Horizontal","Potentiometer_THT/Potentiometer_Bourns_PTV112-4_Dual_Vertical","Potentiometer_THT/Potentiometer_Omeg_PC16BU_Horizontal","Potentiometer_THT/Potentiometer_Omeg_PC16BU_Vertical","Potentiometer_THT/Potentiometer_Piher_PC-16_Dual_Horizontal","Potentiometer_THT/Potentiometer_Piher_PC-16_Single_Horizontal","Potentiometer_THT/Potentiometer_Piher_PC-16_Single_Vertical","Potentiometer_THT/Potentiometer_Piher_PC-16_Triple_Horizontal","Potentiometer_THT/Potentiometer_Piher_PT-10-H01_Horizontal","Potentiometer_THT/Potentiometer_Piher_PT-10-H05_Horizontal","Potentiometer_THT/Potentiometer_Piher_PT-10-V05_Vertical","Potentiometer_THT/Potentiometer_Piher_PT-10-V10_Vertical","Potentiometer_THT/Potentiometer_Piher_PT-10-V10_Vertical_Hole","Potentiometer_THT/Potentiometer_Piher_PT-15-H01_Horizontal","Potentiometer_THT/Potentiometer_Piher_PT-15-H05_Horizontal","Potentiometer_THT/Potentiometer_Piher_PT-15-H06_Horizontal","Potentiometer_THT/Potentiometer_Piher_PT-15-H25_Horizontal","Potentiometer_THT/Potentiometer_Piher_PT-15-V02_Vertical","Potentiometer_THT/Potentiometer_Piher_PT-15-V02_Vertical_Hole","Potentiometer_THT/Potentiometer_Piher_PT-15-V15_Vertical","Potentiometer_THT/Potentiometer_Piher_PT-15-V15_Vertical_Hole","Potentiometer_THT/Potentiometer_Piher_PT-6-H_Horizontal","Potentiometer_THT/Potentiometer_Piher_PT-6-V_Vertical","Potentiometer_THT/Potentiometer_Piher_PT-6-V_Vertical_Hole","Potentiometer_THT/Potentiometer_Piher_T-16H_Double_Horizontal","Potentiometer_THT/Potentiometer_Piher_T-16H_Single_Horizontal","Potentiometer_THT/Potentiometer_Piher_T-16L_Single_Vertical_Hole","Potentiometer_THT/Potentiometer_Runtron_RM-063_Horizontal","Potentiometer_THT/Potentiometer_Runtron_RM-065_Vertical","Potentiometer_THT/Potentiometer_TT_P0915N","Potentiometer_THT/Potentiometer_Vishay_148-149_Dual_Horizontal","Potentiometer_THT/Potentiometer_Vishay_148-149_Single_Horizontal","Potentiometer_THT/Potentiometer_Vishay_148-149_Single_Vertical","Potentiometer_THT/Potentiometer_Vishay_148E-149E_Dual_Horizontal","Potentiometer_THT/Potentiometer_Vishay_148E-149E_Single_Horizontal","Potentiometer_THT/Potentiometer_Vishay_248BH-249BH_Single_Horizontal","Potentiometer_THT/Potentiometer_Vishay_248GJ-249GJ_Single_Horizontal","Potentiometer_THT/Potentiometer_Vishay_248GJ-249GJ_Single_Vertical","Potentiometer_THT/Potentiometer_Vishay_43_Horizontal","Potentiometer_THT/Potentiometer_Vishay_T7-YA_Single_Vertical","Potentiometer_THT/Potentiometer_Vishay_T73XW_Horizontal","Potentiometer_THT/Potentiometer_Vishay_T73XX_Horizontal","Potentiometer_THT/Potentiometer_Vishay_T73YP_Vertical","Potentiometer_THT/Potentiometer_Vishay_T93XA_Horizontal","Potentiometer_THT/Potentiometer_Vishay_T93YA_Vertical","RF/Skyworks_SKY13575_639LF","RF/Skyworks_SKY65404-31","RF_Antenna/AVX_M620720","RF_Antenna/Abracon_APAES868R8060C16-T","RF_Antenna/Abracon_PRO-OB-440","RF_Antenna/Abracon_PRO-OB-471","RF_Antenna/Antenova_SR4G013_GPS","RF_Antenna/Astrocast_AST50127-00","RF_Antenna/Coilcraft_MA5532-AE_RFID","RF_Antenna/Johanson_2450AT18x100","RF_Antenna/Johanson_2450AT18x100_2400-2500Mhz","RF_Antenna/Johanson_2450AT43F0100","RF_Antenna/Johanson_2450AT43F0100_2400-2500Mhz","RF_Antenna/Molex_47948-0001_2.4Ghz","RF_Antenna/NiceRF_SW868-TH13_868Mhz","RF_Antenna/Pulse_W3000","RF_Antenna/Pulse_W3011","RF_Antenna/Texas_SWRA117D_2.4GHz_Left","RF_Antenna/Texas_SWRA117D_2.4GHz_Right","RF_Antenna/Texas_SWRA416_868MHz_915MHz","RF_Converter/Anaren_0805_2012Metric-6","RF_Converter/Balun_Johanson_0896BM15A0001","RF_Converter/Balun_Johanson_0900FM15K0039","RF_Converter/Balun_Johanson_0900PC15J0013","RF_Converter/Balun_Johanson_1.6x0.8mm","RF_Converter/Balun_Johanson_5400BL15B050E","RF_Converter/RF_Attenuator_Susumu_PAT1220","RF_GPS/Linx_RXM-GPS","RF_GPS/OriginGPS_ORG1510","RF_GPS/Quectel_L70-R","RF_GPS/Quectel_L76","RF_GPS/Quectel_L80-R","RF_GPS/Quectel_L96","RF_GPS/SIM28ML","RF_GPS/Sierra_XA11X0","RF_GPS/Sierra_XM11X0","RF_GPS/ublox_LEA","RF_GPS/ublox_MAX","RF_GPS/ublox_NEO","RF_GPS/ublox_SAM-M8Q","RF_GPS/ublox_SAM-M8Q_HandSolder","RF_GPS/ublox_ZED","RF_GPS/ublox_ZOE_M8","RF_GSM/Quectel_BC66","RF_GSM/Quectel_BC95","RF_GSM/Quectel_BG95","RF_GSM/Quectel_BG96","RF_GSM/Quectel_M95","RF_GSM/SIMCom_SIM800C","RF_GSM/SIMCom_SIM900","RF_GSM/Telit_SE150A4","RF_GSM/Telit_xL865","RF_GSM/ublox_LENA-R8_LGA-100","RF_GSM/ublox_SARA_LGA-96","RF_Mini-Circuits/Mini-Circuits_BK377","RF_Mini-Circuits/Mini-Circuits_BK377_LandPatternPL-005","RF_Mini-Circuits/Mini-Circuits_CD541_H2.08mm","RF_Mini-Circuits/Mini-Circuits_CD542_H2.84mm","RF_Mini-Circuits/Mini-Circuits_CD542_LandPatternPL-052","RF_Mini-Circuits/Mini-Circuits_CD542_LandPatternPL-094","RF_Mini-Circuits/Mini-Circuits_CD636_H4.11mm","RF_Mini-Circuits/Mini-Circuits_CD636_LandPatternPL-035","RF_Mini-Circuits/Mini-Circuits_CD637_H5.23mm","RF_Mini-Circuits/Mini-Circuits_CK605","RF_Mini-Circuits/Mini-Circuits_CK605_LandPatternPL-012","RF_Mini-Circuits/Mini-Circuits_DB1627","RF_Mini-Circuits/Mini-Circuits_GP1212","RF_Mini-Circuits/Mini-Circuits_GP1212_LandPatternPL-176","RF_Mini-Circuits/Mini-Circuits_GP731","RF_Mini-Circuits/Mini-Circuits_GP731_LandPatternPL-176","RF_Mini-Circuits/Mini-Circuits_HF1139","RF_Mini-Circuits/Mini-Circuits_HF1139_LandPatternPL-230","RF_Mini-Circuits/Mini-Circuits_HQ1157","RF_Mini-Circuits/Mini-Circuits_HZ1198","RF_Mini-Circuits/Mini-Circuits_HZ1198_LandPatternPL-247","RF_Mini-Circuits/Mini-Circuits_MMM168","RF_Mini-Circuits/Mini-Circuits_MMM168_LandPatternPL-225","RF_Mini-Circuits/Mini-Circuits_QQQ130_ClockwisePinNumbering","RF_Mini-Circuits/Mini-Circuits_QQQ130_LandPattern_PL-236_ClockwisePinNumbering","RF_Mini-Circuits/Mini-Circuits_TT1224_ClockwisePinNumbering","RF_Mini-Circuits/Mini-Circuits_TT1224_LandPatternPL-258_ClockwisePinNumbering","RF_Mini-Circuits/Mini-Circuits_TTT167","RF_Mini-Circuits/Mini-Circuits_TTT167_LandPatternPL-079","RF_Mini-Circuits/Mini-Circuits_YY161","RF_Mini-Circuits/Mini-Circuits_YY161_LandPatternPL-049","RF_Module/Ai-Thinker-Ra-01-LoRa","RF_Module/Astrocast_AST50147-00","RF_Module/Atmel_ATSAMR21G18-MR210UA_NoRFPads","RF_Module/BLE112-A","RF_Module/BM78SPPS5xC2","RF_Module/CMWX1ZZABZ","RF_Module/CYBLE-21Pin-10x10mm","RF_Module/DWM1000","RF_Module/DecaWave_DWM1001","RF_Module/Digi_XBee_SMT","RF_Module/E18-MS1-PCB","RF_Module/E73-2G4M04S","RF_Module/ESP-01","RF_Module/ESP-07","RF_Module/ESP-12E","RF_Module/ESP-WROOM-02","RF_Module/ESP32-C3-DevKitM-1","RF_Module/ESP32-C3-WROOM-02","RF_Module/ESP32-C3-WROOM-02U","RF_Module/ESP32-C6-MINI-1","RF_Module/ESP32-S2-MINI-1","RF_Module/ESP32-S2-MINI-1U","RF_Module/ESP32-S2-WROVER","RF_Module/ESP32-S3-WROOM-1","RF_Module/ESP32-S3-WROOM-1U","RF_Module/ESP32-S3-WROOM-2","RF_Module/ESP32-WROOM-32","RF_Module/ESP32-WROOM-32D","RF_Module/ESP32-WROOM-32E","RF_Module/ESP32-WROOM-32U","RF_Module/ESP32-WROOM-32UE","RF_Module/Garmin_M8-35_9.8x14.0mm_Layout6x6_P1.5mm","RF_Module/HOPERF_RFM69HW","RF_Module/HOPERF_RFM9XW_SMD","RF_Module/HOPERF_RFM9XW_THT","RF_Module/Heltec_HT-CT62","RF_Module/IQRF_TRx2DA_KON-SIM-01","RF_Module/IQRF_TRx2D_KON-SIM-01","RF_Module/Jadak_Thingmagic_M6e-Nano","RF_Module/Laird_BL652","RF_Module/Laird_BL653","RF_Module/MCU_Seeed_ESP32C3","RF_Module/MOD-nRF8001","RF_Module/Microchip_BM83","RF_Module/Microchip_RN4871","RF_Module/Modtronix_inAir9","RF_Module/MonoWireless_TWE-L-WX","RF_Module/NINA-B111","RF_Module/Particle_P1","RF_Module/RAK3172","RF_Module/RAK4200","RF_Module/RAK811","RF_Module/RFDigital_RFD77101","RF_Module/RMC20452T","RF_Module/RN2483","RF_Module/RN42","RF_Module/RN42N","RF_Module/Raytac_MDBT42Q","RF_Module/Raytac_MDBT50Q","RF_Module/ST-SiP-LGA-86-11x7.3mm","RF_Module/ST_SPBTLE","RF_Module/TD1205","RF_Module/TD1208","RF_Module/Taiyo-Yuden_EYSGJNZWY","RF_Module/WEMOS_C3_mini","RF_Module/WEMOS_D1_mini_light","RF_Module/ZETA-433-SO_SMD","RF_Module/ZETA-433-SO_THT","RF_Module/nRF24L01_Breakout","RF_Shielding/Laird_Technologies_97-2002_25.40x25.40mm","RF_Shielding/Laird_Technologies_97-2003_12.70x13.37mm","RF_Shielding/Laird_Technologies_BMI-S-101_13.66x12.70mm","RF_Shielding/Laird_Technologies_BMI-S-102_16.50x16.50mm","RF_Shielding/Laird_Technologies_BMI-S-103_26.21x26.21mm","RF_Shielding/Laird_Technologies_BMI-S-104_32.00x32.00mm","RF_Shielding/Laird_Technologies_BMI-S-105_38.10x25.40mm","RF_Shielding/Laird_Technologies_BMI-S-106_36.83x33.68mm","RF_Shielding/Laird_Technologies_BMI-S-107_44.37x44.37mm","RF_Shielding/Laird_Technologies_BMI-S-201-F_13.66x12.70mm","RF_Shielding/Laird_Technologies_BMI-S-202-F_16.50x16.50mm","RF_Shielding/Laird_Technologies_BMI-S-203-F_26.21x26.21mm","RF_Shielding/Laird_Technologies_BMI-S-204-F_32.00x32.00mm","RF_Shielding/Laird_Technologies_BMI-S-205-F_38.10x25.40mm","RF_Shielding/Laird_Technologies_BMI-S-206-F_36.83x33.68mm","RF_Shielding/Laird_Technologies_BMI-S-207-F_44.37x44.37mm","RF_Shielding/Laird_Technologies_BMI-S-208-F_39.60x39.60mm","RF_Shielding/Laird_Technologies_BMI-S-209-F_29.36x18.50mm","RF_Shielding/Laird_Technologies_BMI-S-210-F_44.00x30.50mm","RF_Shielding/Laird_Technologies_BMI-S-230-F_50.8x38.1mm","RF_Shielding/Wuerth_36103205_20x20mm","RF_Shielding/Wuerth_36103255_25x25mm","RF_Shielding/Wuerth_36103305_30x30mm","RF_Shielding/Wuerth_36103505_50x50mm","RF_Shielding/Wuerth_36103605_60x60mm","RF_Shielding/Wuerth_36503205_20x20mm","RF_Shielding/Wuerth_36503255_25x25mm","RF_Shielding/Wuerth_36503305_30x30mm","RF_Shielding/Wuerth_36503505_50x50mm","RF_Shielding/Wuerth_36503605_60x60mm","RF_WiFi/USR-C322","Relay_SMD/Relay_2P2T_10x6mm_TE_IMxxG","Relay_SMD/Relay_DPDT_AXICOM_IMSeries_JLeg","Relay_SMD/Relay_DPDT_FRT5_SMD","Relay_SMD/Relay_DPDT_Kemet_EE2_NU","Relay_SMD/Relay_DPDT_Kemet_EE2_NUH","Relay_SMD/Relay_DPDT_Kemet_EE2_NUH_DoubleCoil","Relay_SMD/Relay_DPDT_Kemet_EE2_NUX_DoubleCoil","Relay_SMD/Relay_DPDT_Kemet_EE2_NUX_NKX","Relay_SMD/Relay_DPDT_Kemet_EE2_NU_DoubleCoil","Relay_SMD/Relay_DPDT_Omron_G6H-2F","Relay_SMD/Relay_DPDT_Omron_G6K-2F-Y","Relay_SMD/Relay_DPDT_Omron_G6K-2F","Relay_SMD/Relay_DPDT_Omron_G6K-2G-Y","Relay_SMD/Relay_DPDT_Omron_G6K-2G","Relay_SMD/Relay_DPDT_Omron_G6S-2F","Relay_SMD/Relay_DPDT_Omron_G6S-2G","Relay_SMD/Relay_DPDT_Omron_G6SK-2F","Relay_SMD/Relay_DPDT_Omron_G6SK-2G","Relay_SMD/Relay_Fujitsu_FTR-B3S","Relay_SMD/Relay_SPDT_AXICOM_HF3Series_50ohms_Pitch1.27mm","Relay_SMD/Relay_SPDT_AXICOM_HF3Series_75ohms_Pitch1.27mm","Relay_THT/Relay_1-Form-A_Schrack-RYII_RM5mm","Relay_THT/Relay_1-Form-B_Schrack-RYII_RM5mm","Relay_THT/Relay_1-Form-C_Schrack-RYII_RM3.2mm","Relay_THT/Relay_3PST_COTO_3650","Relay_THT/Relay_3PST_COTO_3660","Relay_THT/Relay_DPDT_AXICOM_IMSeries_Pitch3.2mm","Relay_THT/Relay_DPDT_AXICOM_IMSeries_Pitch5.08mm","Relay_THT/Relay_DPDT_FRT5","Relay_THT/Relay_DPDT_Finder_30.22","Relay_THT/Relay_DPDT_Finder_40.52","Relay_THT/Relay_DPDT_Finder_40.62","Relay_THT/Relay_DPDT_Fujitsu_FTR-F1C","Relay_THT/Relay_DPDT_Hongfa_HF115F-2Z-x4","Relay_THT/Relay_DPDT_Kemet_EC2_NJ","Relay_THT/Relay_DPDT_Kemet_EC2_NJ_DoubleCoil","Relay_THT/Relay_DPDT_Kemet_EC2_NU","Relay_THT/Relay_DPDT_Kemet_EC2_NU_DoubleCoil","Relay_THT/Relay_DPDT_Omron_G2RL-2","Relay_THT/Relay_DPDT_Omron_G5V-2","Relay_THT/Relay_DPDT_Omron_G6A","Relay_THT/Relay_DPDT_Omron_G6AK","Relay_THT/Relay_DPDT_Omron_G6H-2","Relay_THT/Relay_DPDT_Omron_G6K-2P-Y","Relay_THT/Relay_DPDT_Omron_G6K-2P","Relay_THT/Relay_DPDT_Omron_G6S-2","Relay_THT/Relay_DPDT_Omron_G6SK-2","Relay_THT/Relay_DPDT_Panasonic_JW2","Relay_THT/Relay_DPDT_Schrack-RT2-FormC-Dual-Coil_RM5mm","Relay_THT/Relay_DPDT_Schrack-RT2-FormC_RM5mm","Relay_THT/Relay_DPST_COTO_3602","Relay_THT/Relay_DPST_Fujitsu_FTR-F1A","Relay_THT/Relay_DPST_Omron_G2RL-2A","Relay_THT/Relay_DPST_Schrack-RT2-FormA_RM5mm","Relay_THT/Relay_NCR_HHG1D-1","Relay_THT/Relay_SPDT_CUI_SR5","Relay_THT/Relay_SPDT_Finder_32.21-x000","Relay_THT/Relay_SPDT_Finder_34.51_Horizontal","Relay_THT/Relay_SPDT_Finder_34.51_Vertical","Relay_THT/Relay_SPDT_Finder_36.11","Relay_THT/Relay_SPDT_Finder_40.11","Relay_THT/Relay_SPDT_Finder_40.31","Relay_THT/Relay_SPDT_Finder_40.41","Relay_THT/Relay_SPDT_Finder_40.51","Relay_THT/Relay_SPDT_Finder_40.61","Relay_THT/Relay_SPDT_Fujitsu_FTR-LYCA005x_FormC_Vertical","Relay_THT/Relay_SPDT_HJR-4102","Relay_THT/Relay_SPDT_Hongfa_HF3F-L-xx-1ZL1T","Relay_THT/Relay_SPDT_Hongfa_HF3F-L-xx-1ZL2T-R","Relay_THT/Relay_SPDT_Hongfa_HF3F-L-xx-1ZL2T","Relay_THT/Relay_SPDT_Hongfa_JQC-3FF_0XX-1Z","Relay_THT/Relay_SPDT_HsinDa_Y14","Relay_THT/Relay_SPDT_Omron-G5LE-1","Relay_THT/Relay_SPDT_Omron-G5Q-1","Relay_THT/Relay_SPDT_Omron_G2RL-1-E","Relay_THT/Relay_SPDT_Omron_G2RL-1","Relay_THT/Relay_SPDT_Omron_G5V-1","Relay_THT/Relay_SPDT_Omron_G6E","Relay_THT/Relay_SPDT_Omron_G6EK","Relay_THT/Relay_SPDT_Panasonic_DR-L","Relay_THT/Relay_SPDT_Panasonic_DR-L2","Relay_THT/Relay_SPDT_Panasonic_DR","Relay_THT/Relay_SPDT_Panasonic_JW1_FormC","Relay_THT/Relay_SPDT_PotterBrumfield_T9AP5D52_12V30A","Relay_THT/Relay_SPDT_RAYEX-L90","Relay_THT/Relay_SPDT_RAYEX-L90S","Relay_THT/Relay_SPDT_SANYOU_SRD_Series_Form_C","Relay_THT/Relay_SPDT_Schrack-RP-II-1-16A-FormC_RM5mm","Relay_THT/Relay_SPDT_Schrack-RP-II-1-FormC_RM3.5mm","Relay_THT/Relay_SPDT_Schrack-RP-II-1-FormC_RM5mm","Relay_THT/Relay_SPDT_Schrack-RT1-16A-FormC_RM5mm","Relay_THT/Relay_SPDT_Schrack-RT1-FormC_RM3.5mm","Relay_THT/Relay_SPDT_Schrack-RT1-FormC_RM5mm","Relay_THT/Relay_SPDT_StandexMeder_SIL_Form1C","Relay_THT/Relay_SPST-NO_Fujitsu_FTR-LYAA005x_FormA_Vertical","Relay_THT/Relay_SPST_Finder_32.21-x300","Relay_THT/Relay_SPST_Hongfa_HF3F-L-xx-1HL1T","Relay_THT/Relay_SPST_Hongfa_HF3F-L-xx-1HL2T-R","Relay_THT/Relay_SPST_Hongfa_HF3F-L-xx-1HL2T","Relay_THT/Relay_SPST_Hongfa_JQC-3FF_0XX-1H","Relay_THT/Relay_SPST_Omron-G5Q-1A","Relay_THT/Relay_SPST_Omron_G2RL-1A-E","Relay_THT/Relay_SPST_Omron_G2RL-1A","Relay_THT/Relay_SPST_Omron_G5NB","Relay_THT/Relay_SPST_Omron_G5PZ","Relay_THT/Relay_SPST_Panasonic_ADW11","Relay_THT/Relay_SPST_Panasonic_ALFG_FormA","Relay_THT/Relay_SPST_Panasonic_ALFG_FormA_CircularHoles","Relay_THT/Relay_SPST_Panasonic_JW1_FormA","Relay_THT/Relay_SPST_PotterBrumfield_T9AP1D52_12V30A","Relay_THT/Relay_SPST_RAYEX-L90A","Relay_THT/Relay_SPST_RAYEX-L90AS","Relay_THT/Relay_SPST_RAYEX-L90B","Relay_THT/Relay_SPST_RAYEX-L90BS","Relay_THT/Relay_SPST_SANYOU_SRD_Series_Form_A","Relay_THT/Relay_SPST_SANYOU_SRD_Series_Form_B","Relay_THT/Relay_SPST_Schrack-RP-II-1-16A-FormA_RM5mm","Relay_THT/Relay_SPST_Schrack-RP-II-1-FormA_RM3.5mm","Relay_THT/Relay_SPST_Schrack-RP-II-1-FormA_RM5mm","Relay_THT/Relay_SPST_Schrack-RP3SL-1coil_RM5mm","Relay_THT/Relay_SPST_Schrack-RP3SL_RM5mm","Relay_THT/Relay_SPST_Schrack-RT1-16A-FormA_RM5mm","Relay_THT/Relay_SPST_Schrack-RT1-FormA_RM3.5mm","Relay_THT/Relay_SPST_Schrack-RT1-FormA_RM5mm","Relay_THT/Relay_SPST_StandexMeder_MS_Form1AB","Relay_THT/Relay_SPST_StandexMeder_SIL_Form1A","Relay_THT/Relay_SPST_StandexMeder_SIL_Form1B","Relay_THT/Relay_SPST_TE_PCH-1xxx2M","Relay_THT/Relay_SPST_TE_PCN-1xxD3MHZ","Relay_THT/Relay_SPST_Zettler-AZSR131","Relay_THT/Relay_Socket_3PDT_Omron_PLE11-0","Relay_THT/Relay_Socket_4PDT_Omron_PY14-02","Relay_THT/Relay_Socket_DPDT_Finder_96.12","Relay_THT/Relay_Socket_DPDT_Omron_PLE08-0","Relay_THT/Relay_StandexMeder_DIP_HighProfile","Relay_THT/Relay_StandexMeder_DIP_LowProfile","Relay_THT/Relay_StandexMeder_UMS","Relay_THT/Relay_Tyco_V23072_Sealed","Resistor_SMD/R_01005_0402Metric","Resistor_SMD/R_01005_0402Metric_Pad0.57x0.30mm_HandSolder","Resistor_SMD/R_0201_0603Metric","Resistor_SMD/R_0201_0603Metric_Pad0.64x0.40mm_HandSolder","Resistor_SMD/R_0402_1005Metric","Resistor_SMD/R_0402_1005Metric_Pad0.72x0.64mm_HandSolder","Resistor_SMD/R_0508_1220Metric","Resistor_SMD/R_0508_1220Metric_Pad1.12x2.15mm_HandSolder","Resistor_SMD/R_0603_1608Metric","Resistor_SMD/R_0603_1608Metric_Pad0.98x0.95mm_HandSolder","Resistor_SMD/R_0612_1632Metric","Resistor_SMD/R_0612_1632Metric_Pad1.18x3.40mm_HandSolder","Resistor_SMD/R_0805_2012Metric","Resistor_SMD/R_0805_2012Metric_Pad1.20x1.40mm_HandSolder","Resistor_SMD/R_0815_2038Metric","Resistor_SMD/R_0815_2038Metric_Pad1.20x4.05mm_HandSolder","Resistor_SMD/R_1020_2550Metric","Resistor_SMD/R_1020_2550Metric_Pad1.33x5.20mm_HandSolder","Resistor_SMD/R_1206_3216Metric","Resistor_SMD/R_1206_3216Metric_Pad1.30x1.75mm_HandSolder","Resistor_SMD/R_1210_3225Metric","Resistor_SMD/R_1210_3225Metric_Pad1.30x2.65mm_HandSolder","Resistor_SMD/R_1218_3246Metric","Resistor_SMD/R_1218_3246Metric_Pad1.22x4.75mm_HandSolder","Resistor_SMD/R_1225_3264Metric","Resistor_SMD/R_1225_3264Metric_Pad1.47x6.45mm_HandSolder","Resistor_SMD/R_1812_4532Metric","Resistor_SMD/R_1812_4532Metric_Pad1.30x3.40mm_HandSolder","Resistor_SMD/R_2010_5025Metric","Resistor_SMD/R_2010_5025Metric_Pad1.40x2.65mm_HandSolder","Resistor_SMD/R_2512_6332Metric","Resistor_SMD/R_2512_6332Metric_Pad1.40x3.35mm_HandSolder","Resistor_SMD/R_2816_7142Metric","Resistor_SMD/R_2816_7142Metric_Pad3.20x4.45mm_HandSolder","Resistor_SMD/R_4020_10251Metric","Resistor_SMD/R_4020_10251Metric_Pad1.65x5.30mm_HandSolder","Resistor_SMD/R_Array_Concave_2x0603","Resistor_SMD/R_Array_Concave_4x0402","Resistor_SMD/R_Array_Concave_4x0603","Resistor_SMD/R_Array_Convex_2x0402","Resistor_SMD/R_Array_Convex_2x0603","Resistor_SMD/R_Array_Convex_2x0606","Resistor_SMD/R_Array_Convex_2x1206","Resistor_SMD/R_Array_Convex_4x0402","Resistor_SMD/R_Array_Convex_4x0603","Resistor_SMD/R_Array_Convex_4x0612","Resistor_SMD/R_Array_Convex_4x1206","Resistor_SMD/R_Array_Convex_5x0603","Resistor_SMD/R_Array_Convex_5x1206","Resistor_SMD/R_Array_Convex_8x0602","Resistor_SMD/R_Cat16-2","Resistor_SMD/R_Cat16-4","Resistor_SMD/R_Cat16-8","Resistor_SMD/R_MELF_MMB-0207","Resistor_SMD/R_MicroMELF_MMU-0102","Resistor_SMD/R_MiniMELF_MMA-0204","Resistor_SMD/R_Shunt_Isabellenhuette_BVR4026","Resistor_SMD/R_Shunt_Ohmite_LVK12","Resistor_SMD/R_Shunt_Ohmite_LVK20","Resistor_SMD/R_Shunt_Ohmite_LVK24","Resistor_SMD/R_Shunt_Ohmite_LVK25","Resistor_SMD/R_Shunt_Vishay_WSK2512_6332Metric_T1.19mm","Resistor_SMD/R_Shunt_Vishay_WSK2512_6332Metric_T2.21mm","Resistor_SMD/R_Shunt_Vishay_WSK2512_6332Metric_T2.66mm","Resistor_SMD/R_Shunt_Vishay_WSKW0612","Resistor_SMD/R_Shunt_Vishay_WSR2_WSR3","Resistor_SMD/R_Shunt_Vishay_WSR2_WSR3_KelvinConnection","Resistor_THT/R_Array_SIP10","Resistor_THT/R_Array_SIP11","Resistor_THT/R_Array_SIP12","Resistor_THT/R_Array_SIP13","Resistor_THT/R_Array_SIP14","Resistor_THT/R_Array_SIP4","Resistor_THT/R_Array_SIP5","Resistor_THT/R_Array_SIP6","Resistor_THT/R_Array_SIP7","Resistor_THT/R_Array_SIP8","Resistor_THT/R_Array_SIP9","Resistor_THT/R_Axial_DIN0204_L3.6mm_D1.6mm_P1.90mm_Vertical","Resistor_THT/R_Axial_DIN0204_L3.6mm_D1.6mm_P2.54mm_Vertical","Resistor_THT/R_Axial_DIN0204_L3.6mm_D1.6mm_P5.08mm_Horizontal","Resistor_THT/R_Axial_DIN0204_L3.6mm_D1.6mm_P5.08mm_Vertical","Resistor_THT/R_Axial_DIN0204_L3.6mm_D1.6mm_P7.62mm_Horizontal","Resistor_THT/R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal","Resistor_THT/R_Axial_DIN0207_L6.3mm_D2.5mm_P15.24mm_Horizontal","Resistor_THT/R_Axial_DIN0207_L6.3mm_D2.5mm_P2.54mm_Vertical","Resistor_THT/R_Axial_DIN0207_L6.3mm_D2.5mm_P5.08mm_Vertical","Resistor_THT/R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_Horizontal","Resistor_THT/R_Axial_DIN0309_L9.0mm_D3.2mm_P12.70mm_Horizontal","Resistor_THT/R_Axial_DIN0309_L9.0mm_D3.2mm_P15.24mm_Horizontal","Resistor_THT/R_Axial_DIN0309_L9.0mm_D3.2mm_P2.54mm_Vertical","Resistor_THT/R_Axial_DIN0309_L9.0mm_D3.2mm_P20.32mm_Horizontal","Resistor_THT/R_Axial_DIN0309_L9.0mm_D3.2mm_P25.40mm_Horizontal","Resistor_THT/R_Axial_DIN0309_L9.0mm_D3.2mm_P5.08mm_Vertical","Resistor_THT/R_Axial_DIN0411_L9.9mm_D3.6mm_P12.70mm_Horizontal","Resistor_THT/R_Axial_DIN0411_L9.9mm_D3.6mm_P15.24mm_Horizontal","Resistor_THT/R_Axial_DIN0411_L9.9mm_D3.6mm_P20.32mm_Horizontal","Resistor_THT/R_Axial_DIN0411_L9.9mm_D3.6mm_P25.40mm_Horizontal","Resistor_THT/R_Axial_DIN0411_L9.9mm_D3.6mm_P5.08mm_Vertical","Resistor_THT/R_Axial_DIN0411_L9.9mm_D3.6mm_P7.62mm_Vertical","Resistor_THT/R_Axial_DIN0414_L11.9mm_D4.5mm_P15.24mm_Horizontal","Resistor_THT/R_Axial_DIN0414_L11.9mm_D4.5mm_P20.32mm_Horizontal","Resistor_THT/R_Axial_DIN0414_L11.9mm_D4.5mm_P25.40mm_Horizontal","Resistor_THT/R_Axial_DIN0414_L11.9mm_D4.5mm_P5.08mm_Vertical","Resistor_THT/R_Axial_DIN0414_L11.9mm_D4.5mm_P7.62mm_Vertical","Resistor_THT/R_Axial_DIN0516_L15.5mm_D5.0mm_P20.32mm_Horizontal","Resistor_THT/R_Axial_DIN0516_L15.5mm_D5.0mm_P25.40mm_Horizontal","Resistor_THT/R_Axial_DIN0516_L15.5mm_D5.0mm_P30.48mm_Horizontal","Resistor_THT/R_Axial_DIN0516_L15.5mm_D5.0mm_P5.08mm_Vertical","Resistor_THT/R_Axial_DIN0516_L15.5mm_D5.0mm_P7.62mm_Vertical","Resistor_THT/R_Axial_DIN0614_L14.3mm_D5.7mm_P15.24mm_Horizontal","Resistor_THT/R_Axial_DIN0614_L14.3mm_D5.7mm_P20.32mm_Horizontal","Resistor_THT/R_Axial_DIN0614_L14.3mm_D5.7mm_P25.40mm_Horizontal","Resistor_THT/R_Axial_DIN0614_L14.3mm_D5.7mm_P5.08mm_Vertical","Resistor_THT/R_Axial_DIN0614_L14.3mm_D5.7mm_P7.62mm_Vertical","Resistor_THT/R_Axial_DIN0617_L17.0mm_D6.0mm_P20.32mm_Horizontal","Resistor_THT/R_Axial_DIN0617_L17.0mm_D6.0mm_P25.40mm_Horizontal","Resistor_THT/R_Axial_DIN0617_L17.0mm_D6.0mm_P30.48mm_Horizontal","Resistor_THT/R_Axial_DIN0617_L17.0mm_D6.0mm_P5.08mm_Vertical","Resistor_THT/R_Axial_DIN0617_L17.0mm_D6.0mm_P7.62mm_Vertical","Resistor_THT/R_Axial_DIN0918_L18.0mm_D9.0mm_P22.86mm_Horizontal","Resistor_THT/R_Axial_DIN0918_L18.0mm_D9.0mm_P25.40mm_Horizontal","Resistor_THT/R_Axial_DIN0918_L18.0mm_D9.0mm_P30.48mm_Horizontal","Resistor_THT/R_Axial_DIN0918_L18.0mm_D9.0mm_P7.62mm_Vertical","Resistor_THT/R_Axial_DIN0922_L20.0mm_D9.0mm_P25.40mm_Horizontal","Resistor_THT/R_Axial_DIN0922_L20.0mm_D9.0mm_P30.48mm_Horizontal","Resistor_THT/R_Axial_DIN0922_L20.0mm_D9.0mm_P7.62mm_Vertical","Resistor_THT/R_Axial_Power_L20.0mm_W6.4mm_P22.40mm","Resistor_THT/R_Axial_Power_L20.0mm_W6.4mm_P25.40mm","Resistor_THT/R_Axial_Power_L20.0mm_W6.4mm_P30.48mm","Resistor_THT/R_Axial_Power_L20.0mm_W6.4mm_P5.08mm_Vertical","Resistor_THT/R_Axial_Power_L20.0mm_W6.4mm_P7.62mm_Vertical","Resistor_THT/R_Axial_Power_L25.0mm_W6.4mm_P27.94mm","Resistor_THT/R_Axial_Power_L25.0mm_W6.4mm_P30.48mm","Resistor_THT/R_Axial_Power_L25.0mm_W9.0mm_P10.16mm_Vertical","Resistor_THT/R_Axial_Power_L25.0mm_W9.0mm_P27.94mm","Resistor_THT/R_Axial_Power_L25.0mm_W9.0mm_P30.48mm","Resistor_THT/R_Axial_Power_L25.0mm_W9.0mm_P7.62mm_Vertical","Resistor_THT/R_Axial_Power_L38.0mm_W6.4mm_P40.64mm","Resistor_THT/R_Axial_Power_L38.0mm_W6.4mm_P45.72mm","Resistor_THT/R_Axial_Power_L38.0mm_W9.0mm_P40.64mm","Resistor_THT/R_Axial_Power_L38.0mm_W9.0mm_P45.72mm","Resistor_THT/R_Axial_Power_L48.0mm_W12.5mm_P10.16mm_Vertical","Resistor_THT/R_Axial_Power_L48.0mm_W12.5mm_P55.88mm","Resistor_THT/R_Axial_Power_L48.0mm_W12.5mm_P60.96mm","Resistor_THT/R_Axial_Power_L48.0mm_W12.5mm_P7.62mm_Vertical","Resistor_THT/R_Axial_Power_L50.0mm_W9.0mm_P55.88mm","Resistor_THT/R_Axial_Power_L50.0mm_W9.0mm_P60.96mm","Resistor_THT/R_Axial_Power_L60.0mm_W14.0mm_P10.16mm_Vertical","Resistor_THT/R_Axial_Power_L60.0mm_W14.0mm_P66.04mm","Resistor_THT/R_Axial_Power_L60.0mm_W14.0mm_P71.12mm","Resistor_THT/R_Axial_Power_L75.0mm_W9.0mm_P81.28mm","Resistor_THT/R_Axial_Power_L75.0mm_W9.0mm_P86.36mm","Resistor_THT/R_Axial_Shunt_L22.2mm_W8.0mm_PS14.30mm_P25.40mm","Resistor_THT/R_Axial_Shunt_L22.2mm_W9.5mm_PS14.30mm_P25.40mm","Resistor_THT/R_Axial_Shunt_L35.3mm_W9.5mm_PS25.40mm_P38.10mm","Resistor_THT/R_Axial_Shunt_L47.6mm_W12.7mm_PS34.93mm_P50.80mm","Resistor_THT/R_Axial_Shunt_L47.6mm_W9.5mm_PS34.93mm_P50.80mm","Resistor_THT/R_Bare_Metal_Element_L12.4mm_W4.8mm_P11.40mm","Resistor_THT/R_Bare_Metal_Element_L16.3mm_W4.8mm_P15.30mm","Resistor_THT/R_Bare_Metal_Element_L21.3mm_W4.8mm_P20.30mm","Resistor_THT/R_Box_L13.0mm_W4.0mm_P9.00mm","Resistor_THT/R_Box_L14.0mm_W5.0mm_P9.00mm","Resistor_THT/R_Box_L26.0mm_W5.0mm_P20.00mm","Resistor_THT/R_Box_L8.4mm_W2.5mm_P5.08mm","Resistor_THT/R_Radial_Power_L11.0mm_W7.0mm_P5.00mm","Resistor_THT/R_Radial_Power_L12.0mm_W8.0mm_P5.00mm","Resistor_THT/R_Radial_Power_L13.0mm_W9.0mm_P5.00mm","Resistor_THT/R_Radial_Power_L16.1mm_W9.0mm_P7.37mm","Resistor_THT/R_Radial_Power_L7.0mm_W8.0mm_Px2.40mm_Py2.30mm","Resistor_THT/R_Radial_Power_L9.0mm_W10.0mm_Px2.70mm_Py2.30mm","Rotary_Encoder/RotaryEncoder_Alps_EC11E-Switch_Vertical_H20mm","Rotary_Encoder/RotaryEncoder_Alps_EC11E-Switch_Vertical_H20mm_CircularMountingHoles","Rotary_Encoder/RotaryEncoder_Alps_EC11E-Switch_Vertical_H20mm_MountingHoles","Rotary_Encoder/RotaryEncoder_Alps_EC11E_Vertical_H20mm","Rotary_Encoder/RotaryEncoder_Alps_EC11E_Vertical_H20mm_CircularMountingHoles","Rotary_Encoder/RotaryEncoder_Alps_EC12E-Switch_Vertical_H20mm","Rotary_Encoder/RotaryEncoder_Alps_EC12E-Switch_Vertical_H20mm_CircularMountingHoles","Rotary_Encoder/RotaryEncoder_Alps_EC12E_Vertical_H20mm","Rotary_Encoder/RotaryEncoder_Alps_EC12E_Vertical_H20mm_CircularMountingHoles","Rotary_Encoder/RotaryEncoder_Bourns_Horizontal_PEC09-2xxxF-Nxxxx","Rotary_Encoder/RotaryEncoder_Bourns_Horizontal_PEC09-2xxxF-Sxxxx","Rotary_Encoder/RotaryEncoder_Bourns_Horizontal_PEC12R-2x17F-Nxxxx","Rotary_Encoder/RotaryEncoder_Bourns_Horizontal_PEC12R-2x17F-Sxxxx","Rotary_Encoder/RotaryEncoder_Bourns_Horizontal_PEL12D-2x16F-Sxxxx","Rotary_Encoder/RotaryEncoder_Bourns_Horizontal_PEL12D-2x18F-Sxxxx","Rotary_Encoder/RotaryEncoder_Bourns_Horizontal_PEL12D-2x21F-Sxxxx","Rotary_Encoder/RotaryEncoder_Bourns_Horizontal_PEL12D-2x25S-Sxxxx","Rotary_Encoder/RotaryEncoder_Bourns_Horizontal_PEL12D-2x26F-Sxxxx","Rotary_Encoder/RotaryEncoder_Bourns_Horizontal_PEL12D-2x31F-Sxxxx","Rotary_Encoder/RotaryEncoder_Bourns_Vertical_PEC12R-3x17F-Nxxxx","Rotary_Encoder/RotaryEncoder_Bourns_Vertical_PEC12R-3x17F-Sxxxx","Rotary_Encoder/RotaryEncoder_Bourns_Vertical_PEL12D-4x25S-Sxxxx","Rotary_Encoder/RotaryEncoder_Bourns_Vertical_PEL12D-4xxxF-Sxxxx","Sensor/ASAIR_AM2302_P2.54mm_Lead2.75mm_TabDown","Sensor/ASAIR_AM2302_P2.54mm_Vertical","Sensor/Aosong_DHT11_5.5x12.0_P2.54mm","Sensor/Avago_APDS-9960","Sensor/LuminOX_LOX-O2","Sensor/MQ-6","Sensor/Rohm_RPR-0521RS","Sensor/SHT1x","Sensor/SPEC_110-xxx_SMD-10Pin_20x20mm_P4.0mm","Sensor/Senseair_S8_Down","Sensor/Senseair_S8_Up","Sensor/Sensirion_SCD4x-1EP_10.1x10.1mm_P1.25mm_EP4.8x4.8mm","Sensor/Sensortech_MiCS_5x7mm_P1.25mm","Sensor/TGS-5141","Sensor/Winson_GM-402B_5x5mm_P1.27mm","Sensor_Audio/CUI_CMC-4013-SMT","Sensor_Audio/Infineon_PG-LLGA-5-1","Sensor_Audio/Infineon_PG-LLGA-5-2","Sensor_Audio/InvenSense_ICS-43434-6_3.5x2.65mm","Sensor_Audio/Knowles_LGA-5_3.5x2.65mm","Sensor_Audio/Knowles_LGA-6_4.72x3.76mm","Sensor_Audio/Knowles_SPH0645LM4H-6_3.5x2.65mm","Sensor_Audio/POM-2244P-C3310-2-R","Sensor_Audio/ST_HLGA-6_3.76x4.72mm_P1.65mm","Sensor_Current/AKM_CQ_7","Sensor_Current/AKM_CQ_7S","Sensor_Current/AKM_CQ_VSOP-24_5.6x7.9mm_P0.65mm","Sensor_Current/AKM_CZ_SSOP-10_6.5x8.1mm_P0.95mm","Sensor_Current/Allegro_CB_PFF","Sensor_Current/Allegro_CB_PSF","Sensor_Current/Allegro_CB_PSS","Sensor_Current/Allegro_PSOF-7_4.8x6.4mm_P1.60mm","Sensor_Current/Allegro_QFN-12-10-1EP_3x3mm_P0.5mm","Sensor_Current/Allegro_QSOP-24_3.9x8.7mm_P0.635mm","Sensor_Current/Allegro_SIP-4","Sensor_Current/Diodes_SIP-3_4.1x1.5mm_P1.27mm","Sensor_Current/Diodes_SIP-3_4.1x1.5mm_P2.65mm","Sensor_Current/Honeywell_CSLW","Sensor_Current/LEM_CKSR","Sensor_Current/LEM_HO40-NP","Sensor_Current/LEM_HO8-NP","Sensor_Current/LEM_HO8-NSM","Sensor_Current/LEM_HTFS","Sensor_Current/LEM_HX02-P","Sensor_Current/LEM_HX03-P-SP2","Sensor_Current/LEM_HX04-P","Sensor_Current/LEM_HX05-NP","Sensor_Current/LEM_HX05-P-SP2","Sensor_Current/LEM_HX06-P","Sensor_Current/LEM_HX10-NP","Sensor_Current/LEM_HX10-P-SP2","Sensor_Current/LEM_HX15-NP","Sensor_Current/LEM_HX15-P-SP2","Sensor_Current/LEM_HX20-P-SP2","Sensor_Current/LEM_HX25-P-SP2","Sensor_Current/LEM_HX50-P-SP2","Sensor_Current/LEM_LA25-NP","Sensor_Current/LEM_LA25-P","Sensor_Current/LEM_LTSR-NP","Sensor_Distance/AMS_OLGA12","Sensor_Distance/ST_VL53L1x","Sensor_Humidity/Sensirion_DFN-4-1EP_2x2mm_P1mm_EP0.7x1.6mm","Sensor_Humidity/Sensirion_DFN-4_1.5x1.5mm_P0.8mm_SHT4x_NoCentralPad","Sensor_Humidity/Sensirion_DFN-8-1EP_2.5x2.5mm_P0.5mm_EP1.1x1.7mm","Sensor_Humidity/Texas_S-PWSON-N6-HDC2080","Sensor_Motion/Analog_LGA-16_3.25x3mm_P0.5mm_LayoutBorder3x5y","Sensor_Motion/InvenSense_QFN-24_3x3mm_P0.4mm","Sensor_Motion/InvenSense_QFN-24_3x3mm_P0.4mm_NoMask","Sensor_Motion/InvenSense_QFN-24_4x4mm_P0.5mm","Sensor_Motion/InvenSense_QFN-24_4x4mm_P0.5mm_NoMask","Sensor_Pressure/CFSensor_XGZP6859D_7x7mm","Sensor_Pressure/CFSensor_XGZP6897x","Sensor_Pressure/CFSensor_XGZP6899x","Sensor_Pressure/Freescale_98ARH99066A","Sensor_Pressure/Freescale_98ARH99089A","Sensor_Pressure/Honeywell_40PCxxxG1A","Sensor_Pressure/Honeywell_ABPDAN","Sensor_Pressure/TE_MS5525DSO-DBxxxyS","Sensor_Pressure/TE_MS5837-xxBA","Sensor_Voltage/LEM_LV25-P","Socket/3M_Textool_240-1288-00-0602J_2x20_P2.54mm","Socket/DIP_Socket-14_W4.3mm_W5.08mm_W7.62mm_W10.16mm_W10.9mm_3M_214-3339-00-0602J","Socket/DIP_Socket-16_W4.3mm_W5.08mm_W7.62mm_W10.16mm_W10.9mm_3M_216-3340-00-0602J","Socket/DIP_Socket-18_W4.3mm_W5.08mm_W7.62mm_W10.16mm_W10.9mm_3M_218-3341-00-0602J","Socket/DIP_Socket-20_W4.3mm_W5.08mm_W7.62mm_W10.16mm_W10.9mm_3M_220-3342-00-0602J","Socket/DIP_Socket-22_W6.9mm_W7.62mm_W10.16mm_W12.7mm_W13.5mm_3M_222-3343-00-0602J","Socket/DIP_Socket-24_W11.9mm_W12.7mm_W15.24mm_W17.78mm_W18.5mm_3M_224-1275-00-0602J","Socket/DIP_Socket-24_W4.3mm_W5.08mm_W7.62mm_W10.16mm_W10.9mm_3M_224-5248-00-0602J","Socket/DIP_Socket-28_W11.9mm_W12.7mm_W15.24mm_W17.78mm_W18.5mm_3M_228-1277-00-0602J","Socket/DIP_Socket-28_W6.9mm_W7.62mm_W10.16mm_W12.7mm_W13.5mm_3M_228-4817-00-0602J","Socket/DIP_Socket-32_W11.9mm_W12.7mm_W15.24mm_W17.78mm_W18.5mm_3M_232-1285-00-0602J","Socket/DIP_Socket-40_W11.9mm_W12.7mm_W15.24mm_W17.78mm_W18.5mm_3M_240-1280-00-0602J","Socket/DIP_Socket-40_W22.1mm_W22.86mm_W25.4mm_W27.94mm_W28.7mm_3M_240-3639-00-0602J","Socket/DIP_Socket-42_W11.9mm_W12.7mm_W15.24mm_W17.78mm_W18.5mm_3M_242-1281-00-0602J","Socket/Wells_648-0482211SA01","Symbol/CE-Logo_11.2x8mm_SilkScreen","Symbol/CE-Logo_16.8x12mm_SilkScreen","Symbol/CE-Logo_28x20mm_SilkScreen","Symbol/CE-Logo_42x30mm_SilkScreen","Symbol/CE-Logo_56.1x40mm_SilkScreen","Symbol/CE-Logo_8.5x6mm_SilkScreen","Symbol/ESD-Logo_13.2x12mm_SilkScreen","Symbol/ESD-Logo_22x20mm_SilkScreen","Symbol/ESD-Logo_33x30mm_SilkScreen","Symbol/ESD-Logo_44.1x40mm_SilkScreen","Symbol/ESD-Logo_6.6x6mm_SilkScreen","Symbol/ESD-Logo_8.9x8mm_SilkScreen","Symbol/EasterEgg_EWG1308-2013_ClassA","Symbol/FCC-Logo_14.6x12mm_SilkScreen","Symbol/FCC-Logo_24.2x20mm_SilkScreen","Symbol/FCC-Logo_36.3x30mm_SilkScreen","Symbol/FCC-Logo_48.3x40mm_SilkScreen","Symbol/FCC-Logo_7.3x6mm_SilkScreen","Symbol/FCC-Logo_9.6x8mm_SilkScreen","Symbol/KiCad-Logo2_12mm_Copper","Symbol/KiCad-Logo2_12mm_SilkScreen","Symbol/KiCad-Logo2_20mm_Copper","Symbol/KiCad-Logo2_20mm_SilkScreen","Symbol/KiCad-Logo2_30mm_Copper","Symbol/KiCad-Logo2_30mm_SilkScreen","Symbol/KiCad-Logo2_40mm_Copper","Symbol/KiCad-Logo2_40mm_SilkScreen","Symbol/KiCad-Logo2_5mm_Copper","Symbol/KiCad-Logo2_5mm_SilkScreen","Symbol/KiCad-Logo2_6mm_Copper","Symbol/KiCad-Logo2_6mm_SilkScreen","Symbol/KiCad-Logo2_8mm_Copper","Symbol/KiCad-Logo2_8mm_SilkScreen","Symbol/KiCad-Logo_12mm_Copper","Symbol/KiCad-Logo_12mm_SilkScreen","Symbol/KiCad-Logo_20mm_Copper","Symbol/KiCad-Logo_20mm_SilkScreen","Symbol/KiCad-Logo_30mm_Copper","Symbol/KiCad-Logo_30mm_SilkScreen","Symbol/KiCad-Logo_40mm_Copper","Symbol/KiCad-Logo_40mm_SilkScreen","Symbol/KiCad-Logo_5mm_Copper","Symbol/KiCad-Logo_5mm_SilkScreen","Symbol/KiCad-Logo_6mm_Copper","Symbol/KiCad-Logo_6mm_SilkScreen","Symbol/KiCad-Logo_8mm_Copper","Symbol/KiCad-Logo_8mm_SilkScreen","Symbol/LayerMarker_10_14x2.54mm_TextH1mm_P1.27mm_AlNum","Symbol/LayerMarker_10_14x2.54mm_TextH1mm_P1.27mm_AlNum_BottomMirrored","Symbol/LayerMarker_10_14x2.54mm_TextH1mm_P1.27mm_AlNum_LowerMirrored","Symbol/LayerMarker_10_14x2.54mm_TextH1mm_P1.27mm_Named","Symbol/LayerMarker_10_14x2.54mm_TextH1mm_P1.27mm_Named_BottomMirrored","Symbol/LayerMarker_10_14x2.54mm_TextH1mm_P1.27mm_Named_LowerMirrored","Symbol/LayerMarker_12_16.5x2.54mm_TextH1mm_P1.27mm_AlNum","Symbol/LayerMarker_12_16.5x2.54mm_TextH1mm_P1.27mm_AlNum_BottomMirrored","Symbol/LayerMarker_12_16.5x2.54mm_TextH1mm_P1.27mm_AlNum_LowerMirrored","Symbol/LayerMarker_14_19.1x2.54mm_TextH1mm_P1.27mm_AlNum","Symbol/LayerMarker_14_19.1x2.54mm_TextH1mm_P1.27mm_AlNum_BottomMirrored","Symbol/LayerMarker_14_19.1x2.54mm_TextH1mm_P1.27mm_AlNum_LowerMirrored","Symbol/LayerMarker_16_21.6x2.54mm_TextH1mm_P1.27mm_AlNum","Symbol/LayerMarker_16_21.6x2.54mm_TextH1mm_P1.27mm_AlNum_BottomMirrored","Symbol/LayerMarker_16_21.6x2.54mm_TextH1mm_P1.27mm_AlNum_LowerMirrored","Symbol/LayerMarker_18_24.1x2.54mm_TextH1mm_P1.27mm_AlNum","Symbol/LayerMarker_18_24.1x2.54mm_TextH1mm_P1.27mm_AlNum_BottomMirrored","Symbol/LayerMarker_18_24.1x2.54mm_TextH1mm_P1.27mm_AlNum_LowerMirrored","Symbol/LayerMarker_20_26.7x2.54mm_TextH1mm_P1.27mm_AlNum","Symbol/LayerMarker_20_26.7x2.54mm_TextH1mm_P1.27mm_AlNum_BottomMirrored","Symbol/LayerMarker_20_26.7x2.54mm_TextH1mm_P1.27mm_AlNum_LowerMirrored","Symbol/LayerMarker_22_29.2x2.54mm_TextH1mm_P1.27mm_AlNum","Symbol/LayerMarker_22_29.2x2.54mm_TextH1mm_P1.27mm_AlNum_BottomMirrored","Symbol/LayerMarker_22_29.2x2.54mm_TextH1mm_P1.27mm_AlNum_LowerMirrored","Symbol/LayerMarker_24_31.8x2.54mm_TextH1mm_P1.27mm_AlNum","Symbol/LayerMarker_24_31.8x2.54mm_TextH1mm_P1.27mm_AlNum_BottomMirrored","Symbol/LayerMarker_24_31.8x2.54mm_TextH1mm_P1.27mm_AlNum_LowerMirrored","Symbol/LayerMarker_26_34.3x2.54mm_TextH1mm_P1.27mm_AlNum","Symbol/LayerMarker_26_34.3x2.54mm_TextH1mm_P1.27mm_AlNum_BottomMirrored","Symbol/LayerMarker_26_34.3x2.54mm_TextH1mm_P1.27mm_AlNum_LowerMirrored","Symbol/LayerMarker_28_36.8x2.54mm_TextH1mm_P1.27mm_AlNum","Symbol/LayerMarker_28_36.8x2.54mm_TextH1mm_P1.27mm_AlNum_BottomMirrored","Symbol/LayerMarker_28_36.8x2.54mm_TextH1mm_P1.27mm_AlNum_LowerMirrored","Symbol/LayerMarker_2_3.81x2.54mm_TextH1mm_P1.27mm","Symbol/LayerMarker_2_3.81x2.54mm_TextH1mm_P1.27mm_BottomMirrored","Symbol/LayerMarker_2_3.81x2.54mm_TextH1mm_P1.27mm_Named","Symbol/LayerMarker_2_3.81x2.54mm_TextH1mm_P1.27mm_Named_BottomMirrored","Symbol/LayerMarker_30_39.4x2.54mm_TextH1mm_P1.27mm_AlNum","Symbol/LayerMarker_30_39.4x2.54mm_TextH1mm_P1.27mm_AlNum_BottomMirrored","Symbol/LayerMarker_30_39.4x2.54mm_TextH1mm_P1.27mm_AlNum_LowerMirrored","Symbol/LayerMarker_32_41.9x2.54mm_TextH1mm_P1.27mm_AlNum","Symbol/LayerMarker_32_41.9x2.54mm_TextH1mm_P1.27mm_AlNum_BottomMirrored","Symbol/LayerMarker_32_41.9x2.54mm_TextH1mm_P1.27mm_AlNum_LowerMirrored","Symbol/LayerMarker_4_6.35x2.54mm_TextH1mm_P1.27mm","Symbol/LayerMarker_4_6.35x2.54mm_TextH1mm_P1.27mm_BottomMirrored","Symbol/LayerMarker_4_6.35x2.54mm_TextH1mm_P1.27mm_LowerMirrored","Symbol/LayerMarker_4_6.35x2.54mm_TextH1mm_P1.27mm_Named","Symbol/LayerMarker_4_6.35x2.54mm_TextH1mm_P1.27mm_Named_BottomMirrored","Symbol/LayerMarker_4_6.35x2.54mm_TextH1mm_P1.27mm_Named_LowerMirrored","Symbol/LayerMarker_6_8.89x2.54mm_TextH1mm_P1.27mm","Symbol/LayerMarker_6_8.89x2.54mm_TextH1mm_P1.27mm_BottomMirrored","Symbol/LayerMarker_6_8.89x2.54mm_TextH1mm_P1.27mm_LowerMirrored","Symbol/LayerMarker_6_8.89x2.54mm_TextH1mm_P1.27mm_Named","Symbol/LayerMarker_6_8.89x2.54mm_TextH1mm_P1.27mm_Named_BottomMirrored","Symbol/LayerMarker_6_8.89x2.54mm_TextH1mm_P1.27mm_Named_LowerMirrored","Symbol/LayerMarker_8_11.4x2.54mm_TextH1mm_P1.27mm","Symbol/LayerMarker_8_11.4x2.54mm_TextH1mm_P1.27mm_BottomMirrored","Symbol/LayerMarker_8_11.4x2.54mm_TextH1mm_P1.27mm_LowerMirrored","Symbol/LayerMarker_8_11.4x2.54mm_TextH1mm_P1.27mm_Named","Symbol/LayerMarker_8_11.4x2.54mm_TextH1mm_P1.27mm_Named_BottomMirrored","Symbol/LayerMarker_8_11.4x2.54mm_TextH1mm_P1.27mm_Named_LowerMirrored","Symbol/OSHW-Logo2_14.6x12mm_Copper","Symbol/OSHW-Logo2_14.6x12mm_SilkScreen","Symbol/OSHW-Logo2_24.3x20mm_Copper","Symbol/OSHW-Logo2_24.3x20mm_SilkScreen","Symbol/OSHW-Logo2_36.5x30mm_Copper","Symbol/OSHW-Logo2_36.5x30mm_SilkScreen","Symbol/OSHW-Logo2_48.7x40mm_Copper","Symbol/OSHW-Logo2_48.7x40mm_SilkScreen","Symbol/OSHW-Logo2_7.3x6mm_Copper","Symbol/OSHW-Logo2_7.3x6mm_SilkScreen","Symbol/OSHW-Logo2_9.8x8mm_Copper","Symbol/OSHW-Logo2_9.8x8mm_SilkScreen","Symbol/OSHW-Logo_11.4x12mm_Copper","Symbol/OSHW-Logo_11.4x12mm_SilkScreen","Symbol/OSHW-Logo_19x20mm_Copper","Symbol/OSHW-Logo_19x20mm_SilkScreen","Symbol/OSHW-Logo_28.5x30mm_Copper","Symbol/OSHW-Logo_28.5x30mm_SilkScreen","Symbol/OSHW-Logo_38.1x40mm_Copper","Symbol/OSHW-Logo_38.1x40mm_SilkScreen","Symbol/OSHW-Logo_5.7x6mm_Copper","Symbol/OSHW-Logo_5.7x6mm_SilkScreen","Symbol/OSHW-Logo_7.5x8mm_Copper","Symbol/OSHW-Logo_7.5x8mm_SilkScreen","Symbol/OSHW-Symbol_13.4x12mm_Copper","Symbol/OSHW-Symbol_13.4x12mm_SilkScreen","Symbol/OSHW-Symbol_22.3x20mm_Copper","Symbol/OSHW-Symbol_22.3x20mm_SilkScreen","Symbol/OSHW-Symbol_33.5x30mm_Copper","Symbol/OSHW-Symbol_33.5x30mm_SilkScreen","Symbol/OSHW-Symbol_44.5x40mm_Copper","Symbol/OSHW-Symbol_44.5x40mm_SilkScreen","Symbol/OSHW-Symbol_6.7x6mm_Copper","Symbol/OSHW-Symbol_6.7x6mm_SilkScreen","Symbol/OSHW-Symbol_8.9x8mm_Copper","Symbol/OSHW-Symbol_8.9x8mm_SilkScreen","Symbol/Polarity_Center_Negative_12mm_SilkScreen","Symbol/Polarity_Center_Negative_20mm_SilkScreen","Symbol/Polarity_Center_Negative_30mm_SilkScreen","Symbol/Polarity_Center_Negative_40mm_SilkScreen","Symbol/Polarity_Center_Negative_6mm_SilkScreen","Symbol/Polarity_Center_Negative_8mm_SilkScreen","Symbol/Polarity_Center_Positive_12mm_SilkScreen","Symbol/Polarity_Center_Positive_20mm_SilkScreen","Symbol/Polarity_Center_Positive_30mm_SilkScreen","Symbol/Polarity_Center_Positive_40mm_SilkScreen","Symbol/Polarity_Center_Positive_6mm_SilkScreen","Symbol/Polarity_Center_Positive_8mm_SilkScreen","Symbol/RoHS-Logo_12mm_SilkScreen","Symbol/RoHS-Logo_20mm_SilkScreen","Symbol/RoHS-Logo_30mm_SilkScreen","Symbol/RoHS-Logo_40mm_SilkScreen","Symbol/RoHS-Logo_6mm_SilkScreen","Symbol/RoHS-Logo_8mm_SilkScreen","Symbol/Screw_Generic_2.0x3.0mm_SilkScreen","Symbol/Smolhaj_Scale_0.1","Symbol/Symbol_Attention_Triangle_17x15mm_Copper","Symbol/Symbol_Attention_Triangle_8x7mm_Copper","Symbol/Symbol_Barrel_Polarity","Symbol/Symbol_CC-Attribution_CopperTop_Big","Symbol/Symbol_CC-Attribution_CopperTop_Small","Symbol/Symbol_CC-Noncommercial_CopperTop_Big","Symbol/Symbol_CC-Noncommercial_CopperTop_Small","Symbol/Symbol_CC-PublicDomain_CopperTop_Big","Symbol/Symbol_CC-PublicDomain_CopperTop_Small","Symbol/Symbol_CC-PublicDomain_SilkScreenTop_Big","Symbol/Symbol_CC-ShareAlike_CopperTop_Big","Symbol/Symbol_CC-ShareAlike_CopperTop_Small","Symbol/Symbol_CreativeCommonsPublicDomain_CopperTop_Small","Symbol/Symbol_CreativeCommonsPublicDomain_SilkScreenTop_Small","Symbol/Symbol_CreativeCommons_CopperTop_Type1_Big","Symbol/Symbol_CreativeCommons_CopperTop_Type2_Big","Symbol/Symbol_CreativeCommons_CopperTop_Type2_Small","Symbol/Symbol_CreativeCommons_SilkScreenTop_Type2_Big","Symbol/Symbol_Danger_18x16mm_Copper","Symbol/Symbol_Danger_8x8mm_Copper","Symbol/Symbol_ESD-Logo-Text_CopperTop","Symbol/Symbol_ESD-Logo_CopperTop","Symbol/Symbol_GNU-GPL_CopperTop_Big","Symbol/Symbol_GNU-GPL_CopperTop_Small","Symbol/Symbol_GNU-Logo_CopperTop","Symbol/Symbol_GNU-Logo_SilkscreenTop","Symbol/Symbol_HighVoltage_NoTriangle_2x5mm_Copper","Symbol/Symbol_HighVoltage_NoTriangle_6x15mm_Copper","Symbol/Symbol_HighVoltage_Triangle_17x15mm_Copper","Symbol/Symbol_HighVoltage_Triangle_6x6mm_Copper","Symbol/Symbol_HighVoltage_Triangle_8x7mm_Copper","Symbol/UKCA-Logo_12x12mm_SilkScreen","Symbol/UKCA-Logo_20x20mm_SilkScreen","Symbol/UKCA-Logo_30x30mm_SilkScreen","Symbol/UKCA-Logo_40x40mm_SilkScreen","Symbol/UKCA-Logo_6x6mm_SilkScreen","Symbol/UKCA-Logo_8x8mm_SilkScreen","Symbol/WEEE-Logo_14x20mm_SilkScreen","Symbol/WEEE-Logo_21x30mm_SilkScreen","Symbol/WEEE-Logo_28.1x40mm_SilkScreen","Symbol/WEEE-Logo_4.2x6mm_SilkScreen","Symbol/WEEE-Logo_5.6x8mm_SilkScreen","Symbol/WEEE-Logo_8.4x12mm_SilkScreen","TerminalBlock/TerminalBlock_MaiXu_MX126-5.0-02P_1x02_P5.00mm","TerminalBlock/TerminalBlock_MaiXu_MX126-5.0-03P_1x03_P5.00mm","TerminalBlock/TerminalBlock_MaiXu_MX126-5.0-04P_1x04_P5.00mm","TerminalBlock/TerminalBlock_MaiXu_MX126-5.0-05P_1x05_P5.00mm","TerminalBlock/TerminalBlock_MaiXu_MX126-5.0-06P_1x06_P5.00mm","TerminalBlock/TerminalBlock_MaiXu_MX126-5.0-07P_1x07_P5.00mm","TerminalBlock/TerminalBlock_MaiXu_MX126-5.0-08P_1x08_P5.00mm","TerminalBlock/TerminalBlock_MaiXu_MX126-5.0-09P_1x09_P5.00mm","TerminalBlock/TerminalBlock_MaiXu_MX126-5.0-10P_1x10_P5.00mm","TerminalBlock/TerminalBlock_MaiXu_MX126-5.0-11P_1x11_P5.00mm","TerminalBlock/TerminalBlock_MaiXu_MX126-5.0-12P_1x12_P5.00mm","TerminalBlock/TerminalBlock_MaiXu_MX126-5.0-13P_1x13_P5.00mm","TerminalBlock/TerminalBlock_MaiXu_MX126-5.0-14P_1x14_P5.00mm","TerminalBlock/TerminalBlock_MaiXu_MX126-5.0-15P_1x15_P5.00mm","TerminalBlock/TerminalBlock_MaiXu_MX126-5.0-16P_1x16_P5.00mm","TerminalBlock/TerminalBlock_MaiXu_MX126-5.0-17P_1x17_P5.00mm","TerminalBlock/TerminalBlock_MaiXu_MX126-5.0-18P_1x18_P5.00mm","TerminalBlock/TerminalBlock_MaiXu_MX126-5.0-19P_1x19_P5.00mm","TerminalBlock/TerminalBlock_MaiXu_MX126-5.0-20P_1x20_P5.00mm","TerminalBlock/TerminalBlock_MaiXu_MX126-5.0-21P_1x21_P5.00mm","TerminalBlock/TerminalBlock_MaiXu_MX126-5.0-22P_1x22_P5.00mm","TerminalBlock/TerminalBlock_MaiXu_MX126-5.0-23P_1x23_P5.00mm","TerminalBlock/TerminalBlock_MaiXu_MX126-5.0-24P_1x24_P5.00mm","TerminalBlock/TerminalBlock_Xinya_XY308-2.54-10P_1x10_P2.54mm_Horizontal","TerminalBlock/TerminalBlock_Xinya_XY308-2.54-11P_1x11_P2.54mm_Horizontal","TerminalBlock/TerminalBlock_Xinya_XY308-2.54-12P_1x12_P2.54mm_Horizontal","TerminalBlock/TerminalBlock_Xinya_XY308-2.54-13P_1x13_P2.54mm_Horizontal","TerminalBlock/TerminalBlock_Xinya_XY308-2.54-14P_1x14_P2.54mm_Horizontal","TerminalBlock/TerminalBlock_Xinya_XY308-2.54-15P_1x15_P2.54mm_Horizontal","TerminalBlock/TerminalBlock_Xinya_XY308-2.54-16P_1x16_P2.54mm_Horizontal","TerminalBlock/TerminalBlock_Xinya_XY308-2.54-17P_1x17_P2.54mm_Horizontal","TerminalBlock/TerminalBlock_Xinya_XY308-2.54-18P_1x18_P2.54mm_Horizontal","TerminalBlock/TerminalBlock_Xinya_XY308-2.54-19P_1x19_P2.54mm_Horizontal","TerminalBlock/TerminalBlock_Xinya_XY308-2.54-20P_1x20_P2.54mm_Horizontal","TerminalBlock/TerminalBlock_Xinya_XY308-2.54-21P_1x21_P2.54mm_Horizontal","TerminalBlock/TerminalBlock_Xinya_XY308-2.54-22P_1x22_P2.54mm_Horizontal","TerminalBlock/TerminalBlock_Xinya_XY308-2.54-23P_1x23_P2.54mm_Horizontal","TerminalBlock/TerminalBlock_Xinya_XY308-2.54-2P_1x02_P2.54mm_Horizontal","TerminalBlock/TerminalBlock_Xinya_XY308-2.54-3P_1x03_P2.54mm_Horizontal","TerminalBlock/TerminalBlock_Xinya_XY308-2.54-4P_1x04_P2.54mm_Horizontal","TerminalBlock/TerminalBlock_Xinya_XY308-2.54-5P_1x05_P2.54mm_Horizontal","TerminalBlock/TerminalBlock_Xinya_XY308-2.54-6P_1x06_P2.54mm_Horizontal","TerminalBlock/TerminalBlock_Xinya_XY308-2.54-7P_1x07_P2.54mm_Horizontal","TerminalBlock/TerminalBlock_Xinya_XY308-2.54-8P_1x08_P2.54mm_Horizontal","TerminalBlock/TerminalBlock_Xinya_XY308-2.54-9P_1x09_P2.54mm_Horizontal","TerminalBlock_4Ucon/TerminalBlock_4Ucon_1x02_P3.50mm_Horizontal","TerminalBlock_4Ucon/TerminalBlock_4Ucon_1x02_P3.50mm_Vertical","TerminalBlock_4Ucon/TerminalBlock_4Ucon_1x03_P3.50mm_Horizontal","TerminalBlock_4Ucon/TerminalBlock_4Ucon_1x03_P3.50mm_Vertical","TerminalBlock_4Ucon/TerminalBlock_4Ucon_1x04_P3.50mm_Horizontal","TerminalBlock_4Ucon/TerminalBlock_4Ucon_1x04_P3.50mm_Vertical","TerminalBlock_4Ucon/TerminalBlock_4Ucon_1x05_P3.50mm_Horizontal","TerminalBlock_4Ucon/TerminalBlock_4Ucon_1x05_P3.50mm_Vertical","TerminalBlock_4Ucon/TerminalBlock_4Ucon_1x06_P3.50mm_Horizontal","TerminalBlock_4Ucon/TerminalBlock_4Ucon_1x06_P3.50mm_Vertical","TerminalBlock_4Ucon/TerminalBlock_4Ucon_1x07_P3.50mm_Horizontal","TerminalBlock_4Ucon/TerminalBlock_4Ucon_1x07_P3.50mm_Vertical","TerminalBlock_4Ucon/TerminalBlock_4Ucon_1x08_P3.50mm_Horizontal","TerminalBlock_4Ucon/TerminalBlock_4Ucon_1x08_P3.50mm_Vertical","TerminalBlock_4Ucon/TerminalBlock_4Ucon_1x09_P3.50mm_Horizontal","TerminalBlock_4Ucon/TerminalBlock_4Ucon_1x09_P3.50mm_Vertical","TerminalBlock_4Ucon/TerminalBlock_4Ucon_1x10_P3.50mm_Horizontal","TerminalBlock_4Ucon/TerminalBlock_4Ucon_1x10_P3.50mm_Vertical","TerminalBlock_4Ucon/TerminalBlock_4Ucon_1x11_P3.50mm_Horizontal","TerminalBlock_4Ucon/TerminalBlock_4Ucon_1x11_P3.50mm_Vertical","TerminalBlock_4Ucon/TerminalBlock_4Ucon_1x12_P3.50mm_Horizontal","TerminalBlock_4Ucon/TerminalBlock_4Ucon_1x12_P3.50mm_Vertical","TerminalBlock_4Ucon/TerminalBlock_4Ucon_1x13_P3.50mm_Horizontal","TerminalBlock_4Ucon/TerminalBlock_4Ucon_1x13_P3.50mm_Vertical","TerminalBlock_4Ucon/TerminalBlock_4Ucon_1x14_P3.50mm_Horizontal","TerminalBlock_4Ucon/TerminalBlock_4Ucon_1x14_P3.50mm_Vertical","TerminalBlock_4Ucon/TerminalBlock_4Ucon_1x15_P3.50mm_Horizontal","TerminalBlock_4Ucon/TerminalBlock_4Ucon_1x15_P3.50mm_Vertical","TerminalBlock_Altech/Altech_AK100_1x02_P5.00mm","TerminalBlock_Altech/Altech_AK100_1x03_P5.00mm","TerminalBlock_Altech/Altech_AK100_1x04_P5.00mm","TerminalBlock_Altech/Altech_AK100_1x05_P5.00mm","TerminalBlock_Altech/Altech_AK100_1x06_P5.00mm","TerminalBlock_Altech/Altech_AK100_1x07_P5.00mm","TerminalBlock_Altech/Altech_AK100_1x08_P5.00mm","TerminalBlock_Altech/Altech_AK100_1x09_P5.00mm","TerminalBlock_Altech/Altech_AK100_1x10_P5.00mm","TerminalBlock_Altech/Altech_AK100_1x11_P5.00mm","TerminalBlock_Altech/Altech_AK100_1x12_P5.00mm","TerminalBlock_Altech/Altech_AK100_1x13_P5.00mm","TerminalBlock_Altech/Altech_AK100_1x14_P5.00mm","TerminalBlock_Altech/Altech_AK100_1x15_P5.00mm","TerminalBlock_Altech/Altech_AK100_1x16_P5.00mm","TerminalBlock_Altech/Altech_AK100_1x17_P5.00mm","TerminalBlock_Altech/Altech_AK100_1x18_P5.00mm","TerminalBlock_Altech/Altech_AK100_1x19_P5.00mm","TerminalBlock_Altech/Altech_AK100_1x20_P5.00mm","TerminalBlock_Altech/Altech_AK100_1x21_P5.00mm","TerminalBlock_Altech/Altech_AK100_1x22_P5.00mm","TerminalBlock_Altech/Altech_AK100_1x23_P5.00mm","TerminalBlock_Altech/Altech_AK100_1x24_P5.00mm","TerminalBlock_Altech/Altech_AK300_1x02_P5.00mm_45-Degree","TerminalBlock_Altech/Altech_AK300_1x03_P5.00mm_45-Degree","TerminalBlock_Altech/Altech_AK300_1x04_P5.00mm_45-Degree","TerminalBlock_Altech/Altech_AK300_1x05_P5.00mm_45-Degree","TerminalBlock_Altech/Altech_AK300_1x06_P5.00mm_45-Degree","TerminalBlock_Altech/Altech_AK300_1x07_P5.00mm_45-Degree","TerminalBlock_Altech/Altech_AK300_1x08_P5.00mm_45-Degree","TerminalBlock_Altech/Altech_AK300_1x09_P5.00mm_45-Degree","TerminalBlock_Altech/Altech_AK300_1x10_P5.00mm_45-Degree","TerminalBlock_Altech/Altech_AK300_1x11_P5.00mm_45-Degree","TerminalBlock_Altech/Altech_AK300_1x12_P5.00mm_45-Degree","TerminalBlock_Altech/Altech_AK300_1x13_P5.00mm_45-Degree","TerminalBlock_Altech/Altech_AK300_1x14_P5.00mm_45-Degree","TerminalBlock_Altech/Altech_AK300_1x15_P5.00mm_45-Degree","TerminalBlock_Altech/Altech_AK300_1x16_P5.00mm_45-Degree","TerminalBlock_Altech/Altech_AK300_1x17_P5.00mm_45-Degree","TerminalBlock_Altech/Altech_AK300_1x18_P5.00mm_45-Degree","TerminalBlock_Altech/Altech_AK300_1x19_P5.00mm_45-Degree","TerminalBlock_Altech/Altech_AK300_1x20_P5.00mm_45-Degree","TerminalBlock_Altech/Altech_AK300_1x21_P5.00mm_45-Degree","TerminalBlock_Altech/Altech_AK300_1x22_P5.00mm_45-Degree","TerminalBlock_Altech/Altech_AK300_1x23_P5.00mm_45-Degree","TerminalBlock_Altech/Altech_AK300_1x24_P5.00mm_45-Degree","TerminalBlock_CUI/TerminalBlock_CUI_TB007-508-02_1x02_P5.08mm_Horizontal","TerminalBlock_CUI/TerminalBlock_CUI_TB007-508-03_1x03_P5.08mm_Horizontal","TerminalBlock_CUI/TerminalBlock_CUI_TB007-508-04_1x04_P5.08mm_Horizontal","TerminalBlock_CUI/TerminalBlock_CUI_TB007-508-05_1x05_P5.08mm_Horizontal","TerminalBlock_CUI/TerminalBlock_CUI_TB007-508-06_1x06_P5.08mm_Horizontal","TerminalBlock_CUI/TerminalBlock_CUI_TB007-508-07_1x07_P5.08mm_Horizontal","TerminalBlock_CUI/TerminalBlock_CUI_TB007-508-08_1x08_P5.08mm_Horizontal","TerminalBlock_CUI/TerminalBlock_CUI_TB007-508-09_1x09_P5.08mm_Horizontal","TerminalBlock_CUI/TerminalBlock_CUI_TB007-508-10_1x10_P5.08mm_Horizontal","TerminalBlock_CUI/TerminalBlock_CUI_TB007-508-11_1x11_P5.08mm_Horizontal","TerminalBlock_CUI/TerminalBlock_CUI_TB007-508-12_1x12_P5.08mm_Horizontal","TerminalBlock_CUI/TerminalBlock_CUI_TB007-508-13_1x13_P5.08mm_Horizontal","TerminalBlock_CUI/TerminalBlock_CUI_TB007-508-14_1x14_P5.08mm_Horizontal","TerminalBlock_CUI/TerminalBlock_CUI_TB007-508-15_1x15_P5.08mm_Horizontal","TerminalBlock_CUI/TerminalBlock_CUI_TB007-508-16_1x16_P5.08mm_Horizontal","TerminalBlock_CUI/TerminalBlock_CUI_TB007-508-17_1x17_P5.08mm_Horizontal","TerminalBlock_CUI/TerminalBlock_CUI_TB007-508-18_1x18_P5.08mm_Horizontal","TerminalBlock_CUI/TerminalBlock_CUI_TB007-508-19_1x19_P5.08mm_Horizontal","TerminalBlock_CUI/TerminalBlock_CUI_TB007-508-20_1x20_P5.08mm_Horizontal","TerminalBlock_CUI/TerminalBlock_CUI_TB007-508-21_1x21_P5.08mm_Horizontal","TerminalBlock_CUI/TerminalBlock_CUI_TB007-508-22_1x22_P5.08mm_Horizontal","TerminalBlock_CUI/TerminalBlock_CUI_TB007-508-23_1x23_P5.08mm_Horizontal","TerminalBlock_CUI/TerminalBlock_CUI_TB007-508-24_1x24_P5.08mm_Horizontal","TerminalBlock_Degson/Degson_DG246-3.81-03P","TerminalBlock_Degson/TerminalBlock_Degson_DG250-3.5-01P_1x01_P3.50mm_45Degree","TerminalBlock_Degson/TerminalBlock_Degson_DG250-3.5-02P_1x02_P3.50mm_45Degree","TerminalBlock_Degson/TerminalBlock_Degson_DG250-3.5-03P_1x03_P3.50mm_45Degree","TerminalBlock_Degson/TerminalBlock_Degson_DG250-3.5-04P_1x04_P3.50mm_45Degree","TerminalBlock_Degson/TerminalBlock_Degson_DG250-3.5-05P_1x05_P3.50mm_45Degree","TerminalBlock_Degson/TerminalBlock_Degson_DG250-3.5-06P_1x06_P3.50mm_45Degree","TerminalBlock_Degson/TerminalBlock_Degson_DG250-3.5-07P_1x07_P3.50mm_45Degree","TerminalBlock_Degson/TerminalBlock_Degson_DG250-3.5-08P_1x08_P3.50mm_45Degree","TerminalBlock_Degson/TerminalBlock_Degson_DG250-3.5-09P_1x09_P3.50mm_45Degree","TerminalBlock_Degson/TerminalBlock_Degson_DG250-3.5-10P_1x10_P3.50mm_45Degree","TerminalBlock_Degson/TerminalBlock_Degson_DG250-3.5-11P_1x11_P3.50mm_45Degree","TerminalBlock_Degson/TerminalBlock_Degson_DG250-3.5-12P_1x12_P3.50mm_45Degree","TerminalBlock_Degson/TerminalBlock_Degson_DG250-3.5-14P_1x14_P3.50mm_45Degree","TerminalBlock_Degson/TerminalBlock_Degson_DG250-3.5-15P_1x15_P3.50mm_45Degree","TerminalBlock_Degson/TerminalBlock_Degson_DG250-3.5-16P_1x16_P3.50mm_45Degree","TerminalBlock_Degson/TerminalBlock_Degson_DG250-3.5-18P_1x18_P3.50mm_45Degree","TerminalBlock_Degson/TerminalBlock_Degson_DG250-3.5-19P_1x19_P3.50mm_45Degree","TerminalBlock_Degson/TerminalBlock_Degson_DG250-3.5-20P_1x20_P3.50mm_45Degree","TerminalBlock_Degson/TerminalBlock_Degson_DG250-3.5-24P_1x24_P3.50mm_45Degree","TerminalBlock_Degson/TerminalBlock_Degson_DG250-3.5-44P_1x44_P3.50mm_45Degree","TerminalBlock_Degson/TerminalBlock_Degson_DG250-3.5-45P_1x45_P3.50mm_45Degree","TerminalBlock_Dinkle/TerminalBlock_Dinkle_DT-55-B01X-02_P10.00mm","TerminalBlock_Dinkle/TerminalBlock_Dinkle_DT-55-B01X-03_P10.00mm","TerminalBlock_Dinkle/TerminalBlock_Dinkle_DT-55-B01X-04_P10.00mm","TerminalBlock_Dinkle/TerminalBlock_Dinkle_DT-55-B01X-05_P10.00mm","TerminalBlock_Dinkle/TerminalBlock_Dinkle_DT-55-B01X-06_P10.00mm","TerminalBlock_Dinkle/TerminalBlock_Dinkle_DT-55-B01X-07_P10.00mm","TerminalBlock_Dinkle/TerminalBlock_Dinkle_DT-55-B01X-08_P10.00mm","TerminalBlock_Dinkle/TerminalBlock_Dinkle_DT-55-B01X-09_P10.00mm","TerminalBlock_Dinkle/TerminalBlock_Dinkle_DT-55-B01X-10_P10.00mm","TerminalBlock_Dinkle/TerminalBlock_Dinkle_DT-55-B01X-11_P10.00mm","TerminalBlock_Dinkle/TerminalBlock_Dinkle_DT-55-B01X-12_P10.00mm","TerminalBlock_Dinkle/TerminalBlock_Dinkle_DT-55-B01X-13_P10.00mm","TerminalBlock_Dinkle/TerminalBlock_Dinkle_DT-55-B01X-14_P10.00mm","TerminalBlock_Dinkle/TerminalBlock_Dinkle_DT-55-B01X-15_P10.00mm","TerminalBlock_Dinkle/TerminalBlock_Dinkle_DT-55-B01X-16_P10.00mm","TerminalBlock_Dinkle/TerminalBlock_Dinkle_DT-55-B01X-17_P10.00mm","TerminalBlock_Dinkle/TerminalBlock_Dinkle_DT-55-B01X-18_P10.00mm","TerminalBlock_Dinkle/TerminalBlock_Dinkle_DT-55-B01X-19_P10.00mm","TerminalBlock_Dinkle/TerminalBlock_Dinkle_DT-55-B01X-20_P10.00mm","TerminalBlock_Dinkle/TerminalBlock_Dinkle_DT-55-B01X-21_P10.00mm","TerminalBlock_Dinkle/TerminalBlock_Dinkle_DT-55-B01X-22_P10.00mm","TerminalBlock_Dinkle/TerminalBlock_Dinkle_DT-55-B01X-23_P10.00mm","TerminalBlock_Dinkle/TerminalBlock_Dinkle_DT-55-B01X-24_P10.00mm","TerminalBlock_Dinkle/TerminalBlock_Dinkle_DT-55-B01X-25_P10.00mm","TerminalBlock_Dinkle/TerminalBlock_Dinkle_DT-55-B01X-26_P10.00mm","TerminalBlock_Dinkle/TerminalBlock_Dinkle_DT-55-B01X-27_P10.00mm","TerminalBlock_Dinkle/TerminalBlock_Dinkle_DT-55-B01X-28_P10.00mm","TerminalBlock_Dinkle/TerminalBlock_Dinkle_DT-55-B01X-29_P10.00mm","TerminalBlock_Dinkle/TerminalBlock_Dinkle_DT-55-B01X-30_P10.00mm","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_360271_1x01_Horizontal_ScrewM3.0_Boxed","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_360272_1x01_Horizontal_ScrewM2.6","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_360273_1x01_Horizontal_ScrewM2.6_WireProtection","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_360291_1x01_Horizontal_ScrewM3.0_Boxed","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_360322_1x01_Horizontal_ScrewM3.0_WireProtection","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_360381_1x01_Horizontal_ScrewM3.0","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_360410_1x01_Horizontal_ScrewM3.0","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_360425_1x01_Horizontal_ScrewM4.0_Boxed","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type011_RT05502HBLC_1x02_P5.00mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type011_RT05503HBLC_1x03_P5.00mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type011_RT05504HBLC_1x04_P5.00mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type011_RT05505HBLC_1x05_P5.00mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type011_RT05506HBLC_1x06_P5.00mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type055_RT01502HDWU_1x02_P5.00mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type055_RT01503HDWU_1x03_P5.00mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type055_RT01504HDWU_1x04_P5.00mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type059_RT06302HBWC_1x02_P3.50mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type059_RT06303HBWC_1x03_P3.50mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type059_RT06304HBWC_1x04_P3.50mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type059_RT06305HBWC_1x05_P3.50mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type059_RT06306HBWC_1x06_P3.50mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type067_RT01902HDWC_1x02_P10.00mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type067_RT01903HDWC_1x03_P10.00mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type067_RT01904HDWC_1x04_P10.00mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type067_RT01905HDWC_1x05_P10.00mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type073_RT02602HBLU_1x02_P5.08mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type073_RT02603HBLU_1x03_P5.08mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type086_RT03402HBLC_1x02_P3.81mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type086_RT03403HBLC_1x03_P3.81mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type086_RT03404HBLC_1x04_P3.81mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type086_RT03405HBLC_1x05_P3.81mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type086_RT03406HBLC_1x06_P3.81mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type094_RT03502HBLU_1x02_P5.00mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type094_RT03503HBLU_1x03_P5.00mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type094_RT03504HBLU_1x04_P5.00mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type094_RT03505HBLU_1x05_P5.00mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type094_RT03506HBLU_1x06_P5.00mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type101_RT01602HBWC_1x02_P5.08mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type101_RT01603HBWC_1x03_P5.08mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type101_RT01604HBWC_1x04_P5.08mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type101_RT01605HBWC_1x05_P5.08mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type101_RT01606HBWC_1x06_P5.08mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type171_RT13702HBWC_1x02_P7.50mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type171_RT13703HBWC_1x03_P7.50mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type171_RT13704HBWC_1x04_P7.50mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type171_RT13705HBWC_1x05_P7.50mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type171_RT13706HBWC_1x06_P7.50mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type175_RT02702HBLC_1x02_P7.50mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type175_RT02703HBLC_1x03_P7.50mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type175_RT02704HBLC_1x04_P7.50mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type175_RT02705HBLC_1x05_P7.50mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type175_RT02706HBLC_1x06_P7.50mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type205_RT04502UBLC_1x02_P5.00mm_45Degree","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type205_RT04503UBLC_1x03_P5.00mm_45Degree","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type205_RT04504UBLC_1x04_P5.00mm_45Degree","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type205_RT04505UBLC_1x05_P5.00mm_45Degree","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type205_RT04506UBLC_1x06_P5.00mm_45Degree","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type701_RT11L02HGLU_1x02_P6.35mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type701_RT11L03HGLU_1x03_P6.35mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type703_RT10N02HGLU_1x02_P9.52mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type703_RT10N03HGLU_1x03_P9.52mm_Horizontal","TerminalBlock_Ningbo-Kagnex/TerminalBlock_Ningbo-Kagnex_HB9500M_1x02_P9.5mm","TerminalBlock_Ningbo-Kagnex/TerminalBlock_Ningbo-Kagnex_HB9500M_1x03_P9.5mm","TerminalBlock_Ningbo-Kagnex/TerminalBlock_Ningbo-Kagnex_HB9500M_1x04_P9.5mm","TerminalBlock_Ningbo-Kagnex/TerminalBlock_Ningbo-Kagnex_HB9500M_1x05_P9.5mm","TerminalBlock_Ningbo-Kagnex/TerminalBlock_Ningbo-Kagnex_HB9500M_1x06_P9.5mm","TerminalBlock_Ningbo-Kagnex/TerminalBlock_Ningbo-Kagnex_HB9500M_1x07_P9.5mm","TerminalBlock_Ningbo-Kagnex/TerminalBlock_Ningbo-Kagnex_HB9500M_1x08_P9.5mm","TerminalBlock_Ningbo-Kagnex/TerminalBlock_Ningbo-Kagnex_HB9500M_1x09_P9.5mm","TerminalBlock_Ningbo-Kagnex/TerminalBlock_Ningbo-Kagnex_HB9500M_1x10_P9.5mm","TerminalBlock_Ningbo-Kagnex/TerminalBlock_Ningbo-Kagnex_HB9500M_1x11_P9.5mm","TerminalBlock_Ningbo-Kagnex/TerminalBlock_Ningbo-Kagnex_HB9500M_1x12_P9.5mm","TerminalBlock_Ningbo-Kagnex/TerminalBlock_Ningbo-Kagnex_HB9500_1x02_P9.5mm","TerminalBlock_Ningbo-Kagnex/TerminalBlock_Ningbo-Kagnex_HB9500_1x03_P9.5mm","TerminalBlock_Ningbo-Kagnex/TerminalBlock_Ningbo-Kagnex_HB9500_1x04_P9.5mm","TerminalBlock_Ningbo-Kagnex/TerminalBlock_Ningbo-Kagnex_HB9500_1x05_P9.5mm","TerminalBlock_Ningbo-Kagnex/TerminalBlock_Ningbo-Kagnex_HB9500_1x06_P9.5mm","TerminalBlock_Ningbo-Kagnex/TerminalBlock_Ningbo-Kagnex_HB9500_1x07_P9.5mm","TerminalBlock_Ningbo-Kagnex/TerminalBlock_Ningbo-Kagnex_HB9500_1x08_P9.5mm","TerminalBlock_Ningbo-Kagnex/TerminalBlock_Ningbo-Kagnex_HB9500_1x09_P9.5mm","TerminalBlock_Ningbo-Kagnex/TerminalBlock_Ningbo-Kagnex_HB9500_1x10_P9.5mm","TerminalBlock_Ningbo-Kagnex/TerminalBlock_Ningbo-Kagnex_HB9500_1x11_P9.5mm","TerminalBlock_Ningbo-Kagnex/TerminalBlock_Ningbo-Kagnex_HB9500_1x12_P9.5mm","TerminalBlock_Philmore/TerminalBlock_Philmore_TB132_1x02_P5.00mm_Horizontal","TerminalBlock_Philmore/TerminalBlock_Philmore_TB133_1x03_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-10-5.08_1x10_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-10_1x10_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-11-5.08_1x11_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-11_1x11_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-12-5.08_1x12_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-12_1x12_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-13-5.08_1x13_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-13_1x13_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-14-5.08_1x14_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-14_1x14_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-15-5.08_1x15_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-15_1x15_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-16-5.08_1x16_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-16_1x16_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-2-5.08_1x02_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-2_1x02_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-3-5.08_1x03_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-3_1x03_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-4-5.08_1x04_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-4_1x04_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-5-5.08_1x05_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-5_1x05_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-6-5.08_1x06_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-6_1x06_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-7-5.08_1x07_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-7_1x07_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-8-5.08_1x08_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-8_1x08_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-9-5.08_1x09_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-9_1x09_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1-10-3.81_1x10_P3.81mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1-11-3.81_1x11_P3.81mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1-12-3.81_1x12_P3.81mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1-13-3.81_1x13_P3.81mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1-2-3.81_1x02_P3.81mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1-3-3.81_1x03_P3.81mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1-4-3.81_1x04_P3.81mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1-5-3.81_1x05_P3.81mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1-6-3.81_1x06_P3.81mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1-7-3.81_1x07_P3.81mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1-8-3.81_1x08_P3.81mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1-9-3.81_1x09_P3.81mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-3-10-5.08_1x10_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-3-11-5.08_1x11_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-3-12-5.08_1x12_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-3-13-5.08_1x13_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-3-14-5.08_1x14_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-3-15-5.08_1x15_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-3-16-5.08_1x16_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-3-2-5.08_1x02_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-3-3-5.08_1x03_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-3-4-5.08_1x04_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-3-5-5.08_1x05_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-3-6-5.08_1x06_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-3-7-5.08_1x07_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-3-8-5.08_1x08_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-3-9-5.08_1x09_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MPT-0,5-10-2.54_1x10_P2.54mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MPT-0,5-11-2.54_1x11_P2.54mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MPT-0,5-12-2.54_1x12_P2.54mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MPT-0,5-2-2.54_1x02_P2.54mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MPT-0,5-3-2.54_1x03_P2.54mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MPT-0,5-4-2.54_1x04_P2.54mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MPT-0,5-5-2.54_1x05_P2.54mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MPT-0,5-6-2.54_1x06_P2.54mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MPT-0,5-7-2.54_1x07_P2.54mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MPT-0,5-8-2.54_1x08_P2.54mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MPT-0,5-9-2.54_1x09_P2.54mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-10-3.5-H_1x10_P3.50mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-10-5.0-H_1x10_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-11-3.5-H_1x11_P3.50mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-11-5.0-H_1x11_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-12-3.5-H_1x12_P3.50mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-12-5.0-H_1x12_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-13-3.5-H_1x13_P3.50mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-13-5.0-H_1x13_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-14-3.5-H_1x14_P3.50mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-14-5.0-H_1x14_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-15-3.5-H_1x15_P3.50mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-15-5.0-H_1x15_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-16-3.5-H_1x16_P3.50mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-16-5.0-H_1x16_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-2-3.5-H_1x02_P3.50mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-2-5.0-H_1x02_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-3-3.5-H_1x03_P3.50mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-3-5.0-H_1x03_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-4-3.5-H_1x04_P3.50mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-4-5.0-H_1x04_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-5-3.5-H_1x05_P3.50mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-5-5.0-H_1x05_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-6-3.5-H_1x06_P3.50mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-6-5.0-H_1x06_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-7-3.5-H_1x07_P3.50mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-7-5.0-H_1x07_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-8-3.5-H_1x08_P3.50mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-8-5.0-H_1x08_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-9-3.5-H_1x09_P3.50mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-9-5.0-H_1x09_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PTSM-0,5-2-2,5-V-SMD_1x02-1MP_P2.50mm_Vertical","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PTSM-0,5-2-2.5-H-THR_1x02_P2.50mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PTSM-0,5-2-2.5-V-THR_1x02_P2.50mm_Vertical","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PTSM-0,5-2-HV-2.5-SMD_1x02-1MP_P2.50mm_Vertical","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PTSM-0,5-3-2,5-V-SMD_1x03-1MP_P2.50mm_Vertical","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PTSM-0,5-3-2.5-H-THR_1x03_P2.50mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PTSM-0,5-3-2.5-V-THR_1x03_P2.50mm_Vertical","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PTSM-0,5-3-HV-2.5-SMD_1x03-1MP_P2.50mm_Vertical","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PTSM-0,5-4-2,5-V-SMD_1x04-1MP_P2.50mm_Vertical","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PTSM-0,5-4-2.5-H-THR_1x04_P2.50mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PTSM-0,5-4-2.5-V-THR_1x04_P2.50mm_Vertical","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PTSM-0,5-4-HV-2.5-SMD_1x04-1MP_P2.50mm_Vertical","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PTSM-0,5-5-2,5-V-SMD_1x05-1MP_P2.50mm_Vertical","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PTSM-0,5-5-2.5-H-THR_1x05_P2.50mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PTSM-0,5-5-2.5-V-THR_1x05_P2.50mm_Vertical","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PTSM-0,5-5-HV-2.5-SMD_1x05-1MP_P2.50mm_Vertical","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PTSM-0,5-6-2,5-V-SMD_1x06-1MP_P2.50mm_Vertical","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PTSM-0,5-6-2.5-H-THR_1x06_P2.50mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PTSM-0,5-6-2.5-V-THR_1x06_P2.50mm_Vertical","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PTSM-0,5-6-HV-2.5-SMD_1x06-1MP_P2.50mm_Vertical","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PTSM-0,5-7-2,5-V-SMD_1x07-1MP_P2.50mm_Vertical","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PTSM-0,5-7-2.5-H-THR_1x07_P2.50mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PTSM-0,5-7-2.5-V-THR_1x07_P2.50mm_Vertical","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PTSM-0,5-7-HV-2.5-SMD_1x07-1MP_P2.50mm_Vertical","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PTSM-0,5-8-2,5-V-SMD_1x08-1MP_P2.50mm_Vertical","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PTSM-0,5-8-2.5-H-THR_1x08_P2.50mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PTSM-0,5-8-2.5-V-THR_1x08_P2.50mm_Vertical","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PTSM-0,5-8-HV-2.5-SMD_1x08-1MP_P2.50mm_Vertical","TerminalBlock_RND/TerminalBlock_RND_205-00001_1x02_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00002_1x03_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00003_1x04_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00004_1x05_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00005_1x06_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00006_1x07_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00007_1x08_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00008_1x09_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00009_1x10_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00010_1x11_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00011_1x12_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00012_1x02_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00013_1x03_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00014_1x04_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00015_1x05_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00016_1x06_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00017_1x07_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00018_1x08_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00019_1x09_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00020_1x10_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00021_1x11_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00022_1x12_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00023_1x02_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00024_1x03_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00025_1x04_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00026_1x05_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00027_1x06_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00028_1x07_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00029_1x08_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00030_1x09_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00031_1x10_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00032_1x11_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00033_1x12_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00045_1x02_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00046_1x03_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00047_1x04_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00048_1x05_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00049_1x06_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00050_1x07_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00051_1x08_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00052_1x09_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00053_1x10_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00054_1x11_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00055_1x12_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00056_1x02_P5.00mm_45Degree","TerminalBlock_RND/TerminalBlock_RND_205-00057_1x03_P5.00mm_45Degree","TerminalBlock_RND/TerminalBlock_RND_205-00058_1x04_P5.00mm_45Degree","TerminalBlock_RND/TerminalBlock_RND_205-00059_1x05_P5.00mm_45Degree","TerminalBlock_RND/TerminalBlock_RND_205-00060_1x06_P5.00mm_45Degree","TerminalBlock_RND/TerminalBlock_RND_205-00061_1x07_P5.00mm_45Degree","TerminalBlock_RND/TerminalBlock_RND_205-00062_1x08_P5.00mm_45Degree","TerminalBlock_RND/TerminalBlock_RND_205-00063_1x09_P5.00mm_45Degree","TerminalBlock_RND/TerminalBlock_RND_205-00064_1x10_P5.00mm_45Degree","TerminalBlock_RND/TerminalBlock_RND_205-00065_1x11_P5.00mm_45Degree","TerminalBlock_RND/TerminalBlock_RND_205-00066_1x12_P5.00mm_45Degree","TerminalBlock_RND/TerminalBlock_RND_205-00067_1x02_P7.50mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00068_1x03_P7.50mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00069_1x04_P7.50mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00070_1x05_P7.50mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00071_1x06_P7.50mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00072_1x07_P7.50mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00073_1x08_P7.50mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00074_1x09_P7.50mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00075_1x10_P7.50mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00076_1x11_P7.50mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00077_1x12_P7.50mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00078_1x02_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00079_1x03_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00080_1x04_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00081_1x05_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00082_1x06_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00083_1x07_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00084_1x08_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00085_1x09_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00086_1x10_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00087_1x11_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00088_1x12_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00232_1x02_P5.08mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00233_1x03_P5.08mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00234_1x04_P5.08mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00235_1x05_P5.08mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00236_1x06_P5.08mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00237_1x07_P5.08mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00238_1x08_P5.08mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00239_1x09_P5.08mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00240_1x10_P5.08mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00241_1x02_P10.16mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00241_1x11_P5.08mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00242_1x03_P10.16mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00242_1x12_P5.08mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00243_1x04_P10.16mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00244_1x05_P10.16mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00245_1x06_P10.16mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00246_1x07_P10.16mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00247_1x08_P10.16mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00248_1x09_P10.16mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00249_1x10_P10.16mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00250_1x11_P10.16mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00251_1x12_P10.16mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00276_1x02_P5.00mm_Vertical","TerminalBlock_RND/TerminalBlock_RND_205-00277_1x03_P5.00mm_Vertical","TerminalBlock_RND/TerminalBlock_RND_205-00278_1x04_P5.00mm_Vertical","TerminalBlock_RND/TerminalBlock_RND_205-00279_1x05_P5.00mm_Vertical","TerminalBlock_RND/TerminalBlock_RND_205-00280_1x06_P5.00mm_Vertical","TerminalBlock_RND/TerminalBlock_RND_205-00281_1x07_P5.00mm_Vertical","TerminalBlock_RND/TerminalBlock_RND_205-00282_1x08_P5.00mm_Vertical","TerminalBlock_RND/TerminalBlock_RND_205-00283_1x09_P5.00mm_Vertical","TerminalBlock_RND/TerminalBlock_RND_205-00284_1x10_P5.00mm_Vertical","TerminalBlock_RND/TerminalBlock_RND_205-00285_1x11_P5.00mm_Vertical","TerminalBlock_RND/TerminalBlock_RND_205-00286_1x12_P5.00mm_Vertical","TerminalBlock_RND/TerminalBlock_RND_205-00287_1x02_P5.08mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00288_1x03_P5.08mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00289_1x04_P5.08mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00290_1x05_P5.08mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00291_1x06_P5.08mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00292_1x07_P5.08mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00293_1x08_P5.08mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00294_1x09_P5.08mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00295_1x10_P5.08mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00296_1x11_P5.08mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00297_1x12_P5.08mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00298_1x02_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00299_1x03_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00300_1x04_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00301_1x05_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00302_1x06_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00303_1x07_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00304_1x08_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00305_1x09_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00306_1x10_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00307_1x11_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00308_1x12_P10.00mm_Horizontal","TerminalBlock_TE-Connectivity/TerminalBlock_TE_1-282834-0_1x10_P2.54mm_Horizontal","TerminalBlock_TE-Connectivity/TerminalBlock_TE_1-282834-1_1x11_P2.54mm_Horizontal","TerminalBlock_TE-Connectivity/TerminalBlock_TE_1-282834-2_1x12_P2.54mm_Horizontal","TerminalBlock_TE-Connectivity/TerminalBlock_TE_282834-2_1x02_P2.54mm_Horizontal","TerminalBlock_TE-Connectivity/TerminalBlock_TE_282834-3_1x03_P2.54mm_Horizontal","TerminalBlock_TE-Connectivity/TerminalBlock_TE_282834-4_1x04_P2.54mm_Horizontal","TerminalBlock_TE-Connectivity/TerminalBlock_TE_282834-5_1x05_P2.54mm_Horizontal","TerminalBlock_TE-Connectivity/TerminalBlock_TE_282834-6_1x06_P2.54mm_Horizontal","TerminalBlock_TE-Connectivity/TerminalBlock_TE_282834-7_1x07_P2.54mm_Horizontal","TerminalBlock_TE-Connectivity/TerminalBlock_TE_282834-8_1x08_P2.54mm_Horizontal","TerminalBlock_TE-Connectivity/TerminalBlock_TE_282834-9_1x09_P2.54mm_Horizontal","TerminalBlock_WAGO/TerminalBlock_WAGO_233-502_2x02_P2.54mm","TerminalBlock_WAGO/TerminalBlock_WAGO_233-503_2x03_P2.54mm","TerminalBlock_WAGO/TerminalBlock_WAGO_233-504_2x04_P2.54mm","TerminalBlock_WAGO/TerminalBlock_WAGO_233-505_2x05_P2.54mm","TerminalBlock_WAGO/TerminalBlock_WAGO_233-506_2x06_P2.54mm","TerminalBlock_WAGO/TerminalBlock_WAGO_233-507_2x07_P2.54mm","TerminalBlock_WAGO/TerminalBlock_WAGO_233-508_2x08_P2.54mm","TerminalBlock_WAGO/TerminalBlock_WAGO_233-509_2x09_P2.54mm","TerminalBlock_WAGO/TerminalBlock_WAGO_233-510_2x10_P2.54mm","TerminalBlock_WAGO/TerminalBlock_WAGO_233-512_2x12_P2.54mm","TerminalBlock_WAGO/TerminalBlock_WAGO_236-101_1x01_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-102_1x02_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-103_1x03_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-104_1x04_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-105_1x05_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-106_1x06_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-107_1x07_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-108_1x08_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-109_1x09_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-110_1x10_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-111_1x11_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-112_1x12_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-113_1x13_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-114_1x14_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-115_1x15_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-116_1x16_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-124_1x24_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-136_1x36_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-148_1x48_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-201_1x01_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-202_1x02_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-203_1x03_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-204_1x04_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-205_1x05_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-206_1x06_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-207_1x07_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-208_1x08_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-209_1x09_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-210_1x10_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-211_1x11_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-212_1x12_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-213_1x13_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-214_1x14_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-215_1x15_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-216_1x16_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-224_1x24_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-301_1x01_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-302_1x02_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-303_1x03_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-304_1x04_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-305_1x05_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-306_1x06_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-307_1x07_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-308_1x08_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-309_1x09_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-310_1x10_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-311_1x11_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-312_1x12_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-313_1x13_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-314_1x14_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-315_1x15_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-316_1x16_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-324_1x24_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-401_1x01_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-402_1x02_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-403_1x03_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-404_1x04_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-405_1x05_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-406_1x06_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-407_1x07_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-408_1x08_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-409_1x09_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-410_1x10_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-411_1x11_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-412_1x12_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-413_1x13_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-414_1x14_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-415_1x15_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-416_1x16_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-424_1x24_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-436_1x36_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-448_1x48_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-501_1x01_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-502_1x02_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-503_1x03_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-504_1x04_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-505_1x05_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-506_1x06_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-507_1x07_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-508_1x08_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-509_1x09_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-510_1x10_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-511_1x11_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-512_1x12_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-513_1x13_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-514_1x14_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-515_1x15_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-516_1x16_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-524_1x24_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-601_1x01_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-602_1x02_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-603_1x03_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-604_1x04_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-605_1x05_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-606_1x06_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-607_1x07_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-608_1x08_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-609_1x09_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-610_1x10_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-611_1x11_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-612_1x12_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-613_1x13_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-614_1x14_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-615_1x15_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-616_1x16_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-624_1x24_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_2601-1102_1x02_P3.50mm_Horizontal","TerminalBlock_WAGO/TerminalBlock_WAGO_2601-1103_1x03_P3.50mm_Horizontal","TerminalBlock_WAGO/TerminalBlock_WAGO_2601-1104_1x04_P3.50mm_Horizontal","TerminalBlock_WAGO/TerminalBlock_WAGO_2601-1105_1x05_P3.50mm_Horizontal","TerminalBlock_WAGO/TerminalBlock_WAGO_2601-1106_1x06_P3.50mm_Horizontal","TerminalBlock_WAGO/TerminalBlock_WAGO_2601-1108_1x08_P3.50mm_Horizontal","TerminalBlock_WAGO/TerminalBlock_WAGO_2601-1109_1x09_P3.50mm_Horizontal","TerminalBlock_WAGO/TerminalBlock_WAGO_2601-1110_1x10_P3.50mm_Horizontal","TerminalBlock_WAGO/TerminalBlock_WAGO_2601-1111_1x11_P3.50mm_Horizontal","TerminalBlock_WAGO/TerminalBlock_WAGO_2601-1112_1x12_P3.50mm_Horizontal","TerminalBlock_WAGO/TerminalBlock_WAGO_2601-3102_1x02_P3.50mm_Vertical","TerminalBlock_WAGO/TerminalBlock_WAGO_2601-3103_1x03_P3.50mm_Vertical","TerminalBlock_WAGO/TerminalBlock_WAGO_2601-3104_1x04_P3.50mm_Vertical","TerminalBlock_WAGO/TerminalBlock_WAGO_2601-3105_1x05_P3.50mm_Vertical","TerminalBlock_WAGO/TerminalBlock_WAGO_2601-3106_1x06_P3.50mm_Vertical","TerminalBlock_WAGO/TerminalBlock_WAGO_2601-3107_1x07_P3.50mm_Vertical","TerminalBlock_WAGO/TerminalBlock_WAGO_2601-3108_1x08_P3.50mm_Vertical","TerminalBlock_WAGO/TerminalBlock_WAGO_2601-3109_1x09_P3.50mm_Vertical","TerminalBlock_WAGO/TerminalBlock_WAGO_2601-3110_1x10_P3.50mm_Vertical","TerminalBlock_WAGO/TerminalBlock_WAGO_2601-3111_1x11_P3.50mm_Vertical","TerminalBlock_WAGO/TerminalBlock_WAGO_2601-3112_1x12_P3.50mm_Vertical","TerminalBlock_WAGO/TerminalBlock_WAGO_2601-3114_1x14_P3.50mm_Vertical","TerminalBlock_WAGO/TerminalBlock_WAGO_2601-3124_1x24_P3.50mm_Vertical","TerminalBlock_WAGO/TerminalBlock_WAGO_804-101_1x01_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-102_1x02_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-103_1x03_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-104_1x04_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-105_1x05_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-106_1x06_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-107_1x07_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-108_1x08_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-109_1x09_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-110_1x10_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-111_1x11_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-112_1x12_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-113_1x13_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-114_1x14_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-115_1x15_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-116_1x16_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-124_1x24_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-301_1x01_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-302_1x02_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-303_1x03_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-304_1x04_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-305_1x05_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-306_1x06_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-307_1x07_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-308_1x08_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-309_1x09_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-310_1x10_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-311_1x11_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-312_1x12_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-316_1x16_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-324_1x24_P7.50mm_45Degree","TerminalBlock_Wuerth/Wuerth_691311400102_P7.62mm","TerminalBlock_Wuerth/Wuerth_REDCUBE-THR_WP-THRBU_74650073_THR","TerminalBlock_Wuerth/Wuerth_REDCUBE-THR_WP-THRBU_74650074_THR","TerminalBlock_Wuerth/Wuerth_REDCUBE-THR_WP-THRBU_74650094_THR","TerminalBlock_Wuerth/Wuerth_REDCUBE-THR_WP-THRBU_74650173_THR","TerminalBlock_Wuerth/Wuerth_REDCUBE-THR_WP-THRBU_74650174_THR","TerminalBlock_Wuerth/Wuerth_REDCUBE-THR_WP-THRBU_74650194_THR","TerminalBlock_Wuerth/Wuerth_REDCUBE-THR_WP-THRBU_74650195_THR","TerminalBlock_Wuerth/Wuerth_REDCUBE-THR_WP-THRBU_74655095_THR","TerminalBlock_Wuerth/Wuerth_REDCUBE-THR_WP-THRSH_74651173_THR","TerminalBlock_Wuerth/Wuerth_REDCUBE-THR_WP-THRSH_74651174_THR","TerminalBlock_Wuerth/Wuerth_REDCUBE-THR_WP-THRSH_74651175_THR","TerminalBlock_Wuerth/Wuerth_REDCUBE-THR_WP-THRSH_74651194_THR","TerminalBlock_Wuerth/Wuerth_REDCUBE-THR_WP-THRSH_74651195_THR","TestPoint/TestPoint_2Pads_Pitch2.54mm_Drill0.8mm","TestPoint/TestPoint_2Pads_Pitch5.08mm_Drill1.3mm","TestPoint/TestPoint_Bridge_Pitch2.0mm_Drill0.7mm","TestPoint/TestPoint_Bridge_Pitch2.54mm_Drill0.7mm","TestPoint/TestPoint_Bridge_Pitch2.54mm_Drill1.0mm","TestPoint/TestPoint_Bridge_Pitch2.54mm_Drill1.3mm","TestPoint/TestPoint_Bridge_Pitch3.81mm_Drill1.3mm","TestPoint/TestPoint_Bridge_Pitch5.08mm_Drill0.7mm","TestPoint/TestPoint_Bridge_Pitch5.08mm_Drill1.3mm","TestPoint/TestPoint_Bridge_Pitch6.35mm_Drill1.3mm","TestPoint/TestPoint_Bridge_Pitch7.62mm_Drill1.3mm","TestPoint/TestPoint_Keystone_5000-5004_Miniature","TestPoint/TestPoint_Keystone_5005-5009_Compact","TestPoint/TestPoint_Keystone_5010-5014_Multipurpose","TestPoint/TestPoint_Keystone_5015_Micro_Mini","TestPoint/TestPoint_Keystone_5019_Miniature","TestPoint/TestPoint_Loop_D1.80mm_Drill1.0mm_Beaded","TestPoint/TestPoint_Loop_D2.50mm_Drill1.0mm","TestPoint/TestPoint_Loop_D2.50mm_Drill1.0mm_LowProfile","TestPoint/TestPoint_Loop_D2.50mm_Drill1.85mm","TestPoint/TestPoint_Loop_D2.54mm_Drill1.5mm_Beaded","TestPoint/TestPoint_Loop_D2.60mm_Drill0.9mm_Beaded","TestPoint/TestPoint_Loop_D2.60mm_Drill1.4mm_Beaded","TestPoint/TestPoint_Loop_D2.60mm_Drill1.6mm_Beaded","TestPoint/TestPoint_Loop_D3.50mm_Drill0.9mm_Beaded","TestPoint/TestPoint_Loop_D3.50mm_Drill1.4mm_Beaded","TestPoint/TestPoint_Loop_D3.80mm_Drill2.0mm","TestPoint/TestPoint_Loop_D3.80mm_Drill2.5mm","TestPoint/TestPoint_Loop_D3.80mm_Drill2.8mm","TestPoint/TestPoint_Pad_1.0x1.0mm","TestPoint/TestPoint_Pad_1.5x1.5mm","TestPoint/TestPoint_Pad_2.0x2.0mm","TestPoint/TestPoint_Pad_2.5x2.5mm","TestPoint/TestPoint_Pad_3.0x3.0mm","TestPoint/TestPoint_Pad_4.0x4.0mm","TestPoint/TestPoint_Pad_D1.0mm","TestPoint/TestPoint_Pad_D1.5mm","TestPoint/TestPoint_Pad_D2.0mm","TestPoint/TestPoint_Pad_D2.5mm","TestPoint/TestPoint_Pad_D3.0mm","TestPoint/TestPoint_Pad_D4.0mm","TestPoint/TestPoint_Plated_Hole_D2.0mm","TestPoint/TestPoint_Plated_Hole_D3.0mm","TestPoint/TestPoint_Plated_Hole_D4.0mm","TestPoint/TestPoint_Plated_Hole_D5.0mm","TestPoint/TestPoint_THTPad_1.0x1.0mm_Drill0.5mm","TestPoint/TestPoint_THTPad_1.5x1.5mm_Drill0.7mm","TestPoint/TestPoint_THTPad_2.0x2.0mm_Drill1.0mm","TestPoint/TestPoint_THTPad_2.5x2.5mm_Drill1.2mm","TestPoint/TestPoint_THTPad_3.0x3.0mm_Drill1.5mm","TestPoint/TestPoint_THTPad_4.0x4.0mm_Drill2.0mm","TestPoint/TestPoint_THTPad_D1.0mm_Drill0.5mm","TestPoint/TestPoint_THTPad_D1.5mm_Drill0.7mm","TestPoint/TestPoint_THTPad_D2.0mm_Drill1.0mm","TestPoint/TestPoint_THTPad_D2.5mm_Drill1.2mm","TestPoint/TestPoint_THTPad_D3.0mm_Drill1.5mm","TestPoint/TestPoint_THTPad_D4.0mm_Drill2.0mm","Transformer_SMD/Pulse_P0926NL","Transformer_SMD/Pulse_PA1323NL","Transformer_SMD/Pulse_PA2001NL","Transformer_SMD/Pulse_PA2002NL-PA2008NL-PA2009NL","Transformer_SMD/Pulse_PA2004NL","Transformer_SMD/Pulse_PA2005NL","Transformer_SMD/Pulse_PA2006NL","Transformer_SMD/Pulse_PA2007NL","Transformer_SMD/Pulse_PA2777NL","Transformer_SMD/Pulse_PA3493NL","Transformer_SMD/Transformer_Coilcraft_CST1","Transformer_SMD/Transformer_Coilcraft_CST2","Transformer_SMD/Transformer_Coilcraft_CST2010","Transformer_SMD/Transformer_CurrentSense_8.4x7.2mm","Transformer_SMD/Transformer_ED8_4-Lead_10.5x8mm_P5mm","Transformer_SMD/Transformer_Ethernet_Bel_S558-5999-T7-F","Transformer_SMD/Transformer_Ethernet_Bourns_PT61017PEL","Transformer_SMD/Transformer_Ethernet_Bourns_PT61020EL","Transformer_SMD/Transformer_Ethernet_Bourns_SM13126PEL","Transformer_SMD/Transformer_Ethernet_CNDtek_H1102N","Transformer_SMD/Transformer_Ethernet_HALO_TG111-MSC13","Transformer_SMD/Transformer_Ethernet_Halo_N2_SO-16_7.11x12.7mm","Transformer_SMD/Transformer_Ethernet_Halo_N5_SO-16_7.11x12.7mm","Transformer_SMD/Transformer_Ethernet_Halo_N6_SO-16_7.11x14.73mm","Transformer_SMD/Transformer_Ethernet_Wuerth_749013011A","Transformer_SMD/Transformer_Ethernet_YDS_30F-51NL_SO-24_7.1x15.1mm","Transformer_SMD/Transformer_MACOM_SM-22","Transformer_SMD/Transformer_MiniCircuits_AT224-1A","Transformer_SMD/Transformer_Murata_78250JC","Transformer_SMD/Transformer_NF_ETAL_P2781","Transformer_SMD/Transformer_NF_ETAL_P2781_HandSoldering","Transformer_SMD/Transformer_NF_ETAL_P3000","Transformer_SMD/Transformer_NF_ETAL_P3000_HandSoldering","Transformer_SMD/Transformer_NF_ETAL_P3181","Transformer_SMD/Transformer_NF_ETAL_P3181_HandSoldering","Transformer_SMD/Transformer_NF_ETAL_P3188","Transformer_SMD/Transformer_NF_ETAL_P3188_HandSoldering","Transformer_SMD/Transformer_NF_ETAL_P3191","Transformer_SMD/Transformer_NF_ETAL_P3191_HandSoldering","Transformer_SMD/Transformer_Pulse_H1100NL","Transformer_SMD/Transformer_Wuerth_750315371","Transformer_SMD/Transformer_Wurth_WE-AGDT-EP7","Transformer_THT/Autotransformer_Toroid_1Tap_Horizontal_D10.5mm_Amidon-T37","Transformer_THT/Autotransformer_Toroid_1Tap_Horizontal_D12.5mm_Amidon-T44","Transformer_THT/Autotransformer_Toroid_1Tap_Horizontal_D14.0mm_Amidon-T50","Transformer_THT/Autotransformer_Toroid_1Tap_Horizontal_D9.0mm_Amidon-T30","Transformer_THT/Autotransformer_ZS1052-AC","Transformer_THT/Transformer_37x44","Transformer_THT/Transformer_Breve_TEZ-22x24","Transformer_THT/Transformer_Breve_TEZ-28x33","Transformer_THT/Transformer_Breve_TEZ-35x42","Transformer_THT/Transformer_Breve_TEZ-38x45","Transformer_THT/Transformer_Breve_TEZ-44x52","Transformer_THT/Transformer_Breve_TEZ-47x57","Transformer_THT/Transformer_CHK_EI30-2VA_1xSec","Transformer_THT/Transformer_CHK_EI30-2VA_2xSec","Transformer_THT/Transformer_CHK_EI30-2VA_Neutral","Transformer_THT/Transformer_CHK_EI38-3VA_1xSec","Transformer_THT/Transformer_CHK_EI38-3VA_2xSec","Transformer_THT/Transformer_CHK_EI38-3VA_Neutral","Transformer_THT/Transformer_CHK_EI42-5VA_1xSec","Transformer_THT/Transformer_CHK_EI42-5VA_2xSec","Transformer_THT/Transformer_CHK_EI42-5VA_Neutral","Transformer_THT/Transformer_CHK_EI48-10VA_1xSec","Transformer_THT/Transformer_CHK_EI48-10VA_2xSec","Transformer_THT/Transformer_CHK_EI48-10VA_Neutral","Transformer_THT/Transformer_CHK_EI48-8VA_1xSec","Transformer_THT/Transformer_CHK_EI48-8VA_2xSec","Transformer_THT/Transformer_CHK_EI48-8VA_Neutral","Transformer_THT/Transformer_CHK_EI54-12VA_1xSec","Transformer_THT/Transformer_CHK_EI54-12VA_2xSec","Transformer_THT/Transformer_CHK_EI54-12VA_Neutral","Transformer_THT/Transformer_CHK_EI54-16VA_1xSec","Transformer_THT/Transformer_CHK_EI54-16VA_2xSec","Transformer_THT/Transformer_CHK_EI54-16VA_Neutral","Transformer_THT/Transformer_CHK_UI30-4VA_Flat","Transformer_THT/Transformer_CHK_UI39-10VA_Flat","Transformer_THT/Transformer_Coilcraft_Q4434-B_Rhombus-T1311","Transformer_THT/Transformer_EPCOS_B66359A1013T_Horizontal","Transformer_THT/Transformer_EPCOS_B66359J1014T_Vertical","Transformer_THT/Transformer_Microphone_Lundahl_LL1538","Transformer_THT/Transformer_Microphone_Lundahl_LL1587","Transformer_THT/Transformer_Myrra_74040_Horizontal","Transformer_THT/Transformer_Myrra_EF20_7408x","Transformer_THT/Transformer_Myrra_EI30-5_44000_Horizontal","Transformer_THT/Transformer_NF_ETAL_1-1_P1200","Transformer_THT/Transformer_NF_ETAL_P1165","Transformer_THT/Transformer_NF_ETAL_P3324","Transformer_THT/Transformer_NF_ETAL_P3356","Transformer_THT/Transformer_Toroid_Horizontal_D10.5mm_Amidon-T37","Transformer_THT/Transformer_Toroid_Horizontal_D12.5mm_Amidon-T44","Transformer_THT/Transformer_Toroid_Horizontal_D14.0mm_Amidon-T50","Transformer_THT/Transformer_Toroid_Horizontal_D18.0mm","Transformer_THT/Transformer_Toroid_Horizontal_D9.0mm_Amidon-T30","Transformer_THT/Transformer_Toroid_Tapped_Horizontal_D10.5mm_Amidon-T37","Transformer_THT/Transformer_Toroid_Tapped_Horizontal_D12.5mm_Amidon-T44","Transformer_THT/Transformer_Toroid_Tapped_Horizontal_D14.0mm_Amidon-T50","Transformer_THT/Transformer_Toroid_Tapped_Horizontal_D9.0mm_Amidon-T30","Transformer_THT/Transformer_Triad_VPP16-310","Transformer_THT/Transformer_Wuerth_750343373","Transformer_THT/Transformer_Wuerth_760871131","Transformer_THT/Transformer_Zeming_ZMCT103C","Transformer_THT/Transformer_Zeming_ZMPT101K","Transistor_Power/GaN_Systems_GaNPX-3_5x6.6mm_Drain2.93x0.6mm","Transistor_Power/GaN_Systems_GaNPX-3_5x6.6mm_Drain3.76x0.6mm","Transistor_Power/GaN_Systems_GaNPX-4_7x8.4mm","Transistor_Power_Module/Infineon_AG-ECONO2","Transistor_Power_Module/Infineon_AG-ECONO3","Transistor_Power_Module/Infineon_AG-ECONO3B","Transistor_Power_Module/Infineon_EasyPACK-1B","Transistor_Power_Module/Infineon_EasyPACK-1B_PressFIT","Transistor_Power_Module/Infineon_EasyPIM-1B","Transistor_Power_Module/Infineon_EasyPIM-2B","Transistor_Power_Module/Littelfuse_Package_H_XBN2MM","Transistor_Power_Module/Littelfuse_Package_H_XN2MM","Transistor_Power_Module/Littelfuse_Package_W_XBN2MM","Transistor_Power_Module/Littelfuse_Package_W_XN2MM","Transistor_Power_Module/ST_ACEPACK-2-CIB","Transistor_Power_Module/ST_ACEPACK-2-CIB_PressFIT","Transistor_Power_Module/ST_SDIP-25L","Valve/Valve_ECC-83-1","Valve/Valve_ECC-83-2","Valve/Valve_EURO","Valve/Valve_Glimm","Valve/Valve_Mini_G","Valve/Valve_Mini_P","Valve/Valve_Mini_Pentode_Linear","Valve/Valve_Noval_G","Valve/Valve_Noval_P","Valve/Valve_Octal","Varistor/RV_Disc_D12mm_W3.9mm_P7.5mm","Varistor/RV_Disc_D12mm_W4.2mm_P7.5mm","Varistor/RV_Disc_D12mm_W4.3mm_P7.5mm","Varistor/RV_Disc_D12mm_W4.4mm_P7.5mm","Varistor/RV_Disc_D12mm_W4.5mm_P7.5mm","Varistor/RV_Disc_D12mm_W4.6mm_P7.5mm","Varistor/RV_Disc_D12mm_W4.7mm_P7.5mm","Varistor/RV_Disc_D12mm_W4.8mm_P7.5mm","Varistor/RV_Disc_D12mm_W4mm_P7.5mm","Varistor/RV_Disc_D12mm_W5.1mm_P7.5mm","Varistor/RV_Disc_D12mm_W5.4mm_P7.5mm","Varistor/RV_Disc_D12mm_W5.8mm_P7.5mm","Varistor/RV_Disc_D12mm_W5mm_P7.5mm","Varistor/RV_Disc_D12mm_W6.1mm_P7.5mm","Varistor/RV_Disc_D12mm_W6.2mm_P7.5mm","Varistor/RV_Disc_D12mm_W6.3mm_P7.5mm","Varistor/RV_Disc_D12mm_W6.7mm_P7.5mm","Varistor/RV_Disc_D12mm_W7.1mm_P7.5mm","Varistor/RV_Disc_D12mm_W7.5mm_P7.5mm","Varistor/RV_Disc_D12mm_W7.9mm_P7.5mm","Varistor/RV_Disc_D15.5mm_W11mm_P7.5mm","Varistor/RV_Disc_D15.5mm_W3.9mm_P7.5mm","Varistor/RV_Disc_D15.5mm_W4.2mm_P7.5mm","Varistor/RV_Disc_D15.5mm_W4.3mm_P7.5mm","Varistor/RV_Disc_D15.5mm_W4.4mm_P7.5mm","Varistor/RV_Disc_D15.5mm_W4.5mm_P7.5mm","Varistor/RV_Disc_D15.5mm_W4.6mm_P7.5mm","Varistor/RV_Disc_D15.5mm_W4.7mm_P7.5mm","Varistor/RV_Disc_D15.5mm_W4.8mm_P7.5mm","Varistor/RV_Disc_D15.5mm_W4.9mm_P7.5mm","Varistor/RV_Disc_D15.5mm_W4mm_P7.5mm","Varistor/RV_Disc_D15.5mm_W5.2mm_P7.5mm","Varistor/RV_Disc_D15.5mm_W5.4mm_P7.5mm","Varistor/RV_Disc_D15.5mm_W5.9mm_P7.5mm","Varistor/RV_Disc_D15.5mm_W5mm_P7.5mm","Varistor/RV_Disc_D15.5mm_W6.1mm_P7.5mm","Varistor/RV_Disc_D15.5mm_W6.3mm_P7.5mm","Varistor/RV_Disc_D15.5mm_W6.4mm_P7.5mm","Varistor/RV_Disc_D15.5mm_W6.8mm_P7.5mm","Varistor/RV_Disc_D15.5mm_W7.2mm_P7.5mm","Varistor/RV_Disc_D15.5mm_W7.5mm_P7.5mm","Varistor/RV_Disc_D15.5mm_W8mm_P7.5mm","Varistor/RV_Disc_D16.5mm_W6.7mm_P7.5mm","Varistor/RV_Disc_D21.5mm_W11.4mm_P10mm","Varistor/RV_Disc_D21.5mm_W4.3mm_P10mm","Varistor/RV_Disc_D21.5mm_W4.4mm_P10mm","Varistor/RV_Disc_D21.5mm_W4.5mm_P10mm","Varistor/RV_Disc_D21.5mm_W4.6mm_P10mm","Varistor/RV_Disc_D21.5mm_W4.7mm_P10mm","Varistor/RV_Disc_D21.5mm_W4.8mm_P10mm","Varistor/RV_Disc_D21.5mm_W4.9mm_P10mm","Varistor/RV_Disc_D21.5mm_W5.1mm_P10mm","Varistor/RV_Disc_D21.5mm_W5.3mm_P10mm","Varistor/RV_Disc_D21.5mm_W5.4mm_P10mm","Varistor/RV_Disc_D21.5mm_W5.6mm_P10mm","Varistor/RV_Disc_D21.5mm_W5.8mm_P10mm","Varistor/RV_Disc_D21.5mm_W5mm_P10mm","Varistor/RV_Disc_D21.5mm_W6.1mm_P7.5mm","Varistor/RV_Disc_D21.5mm_W6.3mm_P10mm","Varistor/RV_Disc_D21.5mm_W6.5mm_P10mm","Varistor/RV_Disc_D21.5mm_W6.7mm_P10mm","Varistor/RV_Disc_D21.5mm_W6.8mm_P10mm","Varistor/RV_Disc_D21.5mm_W7.1mm_P10mm","Varistor/RV_Disc_D21.5mm_W7.5mm_P10mm","Varistor/RV_Disc_D21.5mm_W7.9mm_P10mm","Varistor/RV_Disc_D21.5mm_W8.4mm_P10mm","Varistor/RV_Disc_D7mm_W3.4mm_P5mm","Varistor/RV_Disc_D7mm_W3.5mm_P5mm","Varistor/RV_Disc_D7mm_W3.6mm_P5mm","Varistor/RV_Disc_D7mm_W3.7mm_P5mm","Varistor/RV_Disc_D7mm_W3.8mm_P5mm","Varistor/RV_Disc_D7mm_W3.9mm_P5mm","Varistor/RV_Disc_D7mm_W4.2mm_P5mm","Varistor/RV_Disc_D7mm_W4.3mm_P5mm","Varistor/RV_Disc_D7mm_W4.5mm_P5mm","Varistor/RV_Disc_D7mm_W4.8mm_P5mm","Varistor/RV_Disc_D7mm_W4.9mm_P5mm","Varistor/RV_Disc_D7mm_W4mm_P5mm","Varistor/RV_Disc_D7mm_W5.1mm_P5mm","Varistor/RV_Disc_D7mm_W5.4mm_P5mm","Varistor/RV_Disc_D7mm_W5.5mm_P5mm","Varistor/RV_Disc_D7mm_W5.7mm_P5mm","Varistor/RV_Disc_D9mm_W3.3mm_P5mm","Varistor/RV_Disc_D9mm_W3.4mm_P5mm","Varistor/RV_Disc_D9mm_W3.5mm_P5mm","Varistor/RV_Disc_D9mm_W3.6mm_P5mm","Varistor/RV_Disc_D9mm_W3.7mm_P5mm","Varistor/RV_Disc_D9mm_W3.8mm_P5mm","Varistor/RV_Disc_D9mm_W3.9mm_P5mm","Varistor/RV_Disc_D9mm_W4.1mm_P5mm","Varistor/RV_Disc_D9mm_W4.2mm_P5mm","Varistor/RV_Disc_D9mm_W4.4mm_P5mm","Varistor/RV_Disc_D9mm_W4.5mm_P5mm","Varistor/RV_Disc_D9mm_W4.8mm_P5mm","Varistor/RV_Disc_D9mm_W4mm_P5mm","Varistor/RV_Disc_D9mm_W5.2mm_P5mm","Varistor/RV_Disc_D9mm_W5.4mm_P5mm","Varistor/RV_Disc_D9mm_W5.5mm_P5mm","Varistor/RV_Disc_D9mm_W5.7mm_P5mm","Varistor/RV_Disc_D9mm_W6.1mm_P5mm","Varistor/RV_Rect_V25S440P_L26.5mm_W8.2mm_P12.7mm","Varistor/Varistor_Panasonic_VF"];var cTo=Object.fromEntries(aTo.map((e)=>[e,`kicad:${e}`]));var WR=bt(["vertical","horizontal","pos_top","pos_bottom","pos_left","pos_right","neg_top","neg_bottom","neg_left","neg_right"]).describe("horizontal means pins go 1->2 rightward and vertical means pins go 1->2 downward (generally, positive on top)");yn(!0);var lTo=Ee({pins:st(an([ge(),k()])),direction:an([ce("top-to-bottom"),ce("left-to-right"),ce("bottom-to-top"),ce("right-to-left")])}),hTo=st(an([ge(),k()])),t1e=(e)=>an([lTo,hTo]).transform((t)=>Array.isArray(t)?{pins:t,direction:e}:t),i1e=Ee({leftSize:ge().optional().describe("@deprecated, use leftPinCount"),topSize:ge().optional().describe("@deprecated, use topPinCount"),rightSize:ge().optional().describe("@deprecated, use rightPinCount"),bottomSize:ge().optional().describe("@deprecated, use bottomPinCount"),leftPinCount:ge().optional(),rightPinCount:ge().optional(),topPinCount:ge().optional(),bottomPinCount:ge().optional(),leftSide:t1e("top-to-bottom").optional(),rightSide:t1e("top-to-bottom").optional(),topSide:t1e("left-to-right").optional(),bottomSide:t1e("left-to-right").optional()}),a1e=i1e;yn(!0);var Pse=Ss(Ee({marginLeft:Ke.optional(),marginRight:Ke.optional(),marginTop:Ke.optional(),marginBottom:Ke.optional(),leftMargin:Ke.optional(),rightMargin:Ke.optional(),topMargin:Ke.optional(),bottomMargin:Ke.optional()}));yn(!0);var M_=k().regex(/^[A-Za-z0-9_]+$/),c1e=bt(["xs","sm","default","md"]).or(Ke.pipe(ge().finite())).describe("distance between pin1 and pin2 of the schematic symbol"),dTo=bt(["input","output","bidirectional","tri_state","passive","free","unspecified","power_in","power_out","open_collector","open_emitter","no_connect"]),uTo=bt(["line","inverted","clock","inverted_clock","input_low","clock_low","output_low","falling_edge_clock","nonlogic"]),pTo=Ee({electricalType:dTo.optional(),graphicStyle:uTo.optional(),pinLength:Yn.optional(),nameTextSize:Yn.optional(),numberTextSize:Yn.optional()});yn(!0);var mTo=cc((e)=>typeof e==="function"),lS=bt(["top_left","top_center","top_right","center_left","center","center_right","bottom_left","bottom_center","bottom_right"]),Ese=Ee({edit_event_id:k(),in_progress:Be().optional(),created_at:ge()});yn(!0);var _To=Ese.extend({pcb_edit_event_type:ce("edit_component_location").describe("deprecated"),edit_event_type:ce("edit_pcb_component_location"),pcb_component_id:k(),original_center:Ee({x:ge(),y:ge()}),new_center:Ee({x:ge(),y:ge()})});yn(!0);var gTo=Ese.extend({pcb_edit_event_type:ce("edit_trace_hint").describe("deprecated"),edit_event_type:ce("edit_pcb_trace_hint").optional(),pcb_port_id:k(),pcb_trace_hint_id:k().optional(),route:st(Ee({x:ge(),y:ge(),via:Be().optional()}))});yn(!0);var ATo=Ese.extend({edit_event_type:ce("edit_schematic_component_location"),schematic_component_id:k(),original_center:Ee({x:ge(),y:ge()}),new_center:Ee({x:ge(),y:ge()})});yn(!0);var R9s=Ese.extend({edit_event_type:ce("edit_pcb_group_location"),pcb_group_id:k(),original_center:Ee({x:ge(),y:ge()}),new_center:Ee({x:ge(),y:ge()})});yn(!0);var k9s=Ese.extend({edit_event_type:ce("edit_schematic_group_location"),schematic_group_id:k(),original_center:Ee({x:ge(),y:ge()}),new_center:Ee({x:ge(),y:ge()})});yn(!0);var H9s=an([_To,gTo,ATo]);yn(!0);var fTo=Ee({selector:k(),relative_to:k().optional().default("group_center").describe("Can be a selector or 'group_center'"),center:jo});yn(!0);var yTo=Ee({pcb_port_selector:k(),offsets:st(r2)});yn(!0);var xTo=Ee({selector:k(),relative_to:k().optional().default("group_center").describe("Can be a selector or 'group_center'"),center:jo});yn(!0);var CTo=Ee({pcb_placements:st(fTo).optional(),manual_trace_hints:st(yTo).optional(),schematic_placements:st(xTo).optional()});yn(!0);var bO=k().or(st(k()).readonly()).or(st(k())),b3=(e)=>Ss(bt(e),bO),Cse=Ee({layoutMode:bt(["grid","flex","match-adapt","relative","none"]).optional(),position:bt(["absolute","relative"]).optional(),grid:Be().optional(),gridCols:ge().or(k()).optional(),gridRows:ge().or(k()).optional(),gridTemplateRows:k().optional(),gridTemplateColumns:k().optional(),gridTemplate:k().optional(),gridGap:ge().or(k()).optional(),gridRowGap:ge().or(k()).optional(),gridColumnGap:ge().or(k()).optional(),flex:Be().or(k()).optional(),flexDirection:bt(["row","column"]).optional(),alignItems:bt(["start","center","end","stretch"]).optional(),justifyContent:bt(["start","center","end","stretch","space-between","space-around","space-evenly"]).optional(),flexRow:Be().optional(),flexColumn:Be().optional(),gap:ge().or(k()).optional(),pack:Be().optional().describe("Pack the contents of this group using a packing strategy"),packOrderStrategy:bt(["largest_to_smallest","first_to_last","highest_to_lowest_pin_count"]).optional(),packPlacementStrategy:bt(["shortest_connection_along_outline"]).optional(),padding:ve.optional(),paddingLeft:ve.optional(),paddingRight:ve.optional(),paddingTop:ve.optional(),paddingBottom:ve.optional(),paddingX:ve.optional(),paddingY:ve.optional(),width:ve.optional(),height:ve.optional(),matchAdapt:Be().optional(),matchAdaptTemplate:Sd().optional()});yn(!0);var T7t=Ee({strokeWidth:ve.optional(),dashed:Be().optional(),solid:Be().optional()}),bTo=cc((e)=>typeof e==="string"),hSt=Ee({minTraceWidth:ve.optional(),minViaHoleEdgeToViaHoleEdgeClearance:ve.optional(),minViaEdgeToPadEdgeClearance:ve.optional(),minPlatedHoleDrillEdgeToDrillEdgeClearance:ve.optional(),minTraceToPadEdgeClearance:ve.optional(),minTraceToHoleEdgeClearance:ve.refine((e)=>Number.isFinite(e)&&e>=0,{message:"minTraceToHoleEdgeClearance must be finite and non-negative"}).optional(),minPadEdgeToPadEdgeClearance:ve.optional(),minBoardEdgeClearance:ve.optional(),minViaHoleDiameter:ve.optional(),minViaPadDiameter:ve.optional()}),dSt=Ee({serverUrl:Tu.optional(),inputFormat:bt(["simplified","circuit-json"]).optional(),serverMode:bt(["job","solve-endpoint"]).optional(),serverCacheEnabled:Be().optional(),cache:cc((e)=>!0).optional(),traceClearance:ve.optional(),availableJumperTypes:st(bt(["1206x4","0603"])).optional(),allowViaInPad:Be().optional().describe("Allows the autorouter to place vias inside connected pads. Omitted or false keeps via-in-pad routing disabled."),groupMode:bt(["sequential_trace","subcircuit","sequential-trace"]).optional(),algorithmFn:cc((e)=>typeof e==="function"||e===void 0).optional(),implicitBreakoutPointSolverFn:cc((e)=>typeof e==="function"||e===void 0).optional(),preset:bt(["sequential_trace","subcircuit","default","auto","auto_local","auto_cloud","auto_jumper","tscircuit_beta","krt","freerouting","simplify","laser_prefab","single_layer_fanout","fanout","dogbone","bus_lanes","single_layer_routing","auto-jumper","sequential-trace","auto-local","auto-cloud"]).transform((e)=>e==="single_layer_routing"?"bus_lanes":e).optional(),local:Be().optional()}),ITo=an([ce("sequential_trace"),ce("subcircuit"),ce("default"),ce("auto"),ce("auto_local"),ce("auto_cloud"),ce("auto_jumper"),ce("tscircuit_beta"),ce("krt"),ce("freerouting"),ce("simplify"),ce("laser_prefab"),ce("single_layer_fanout"),ce("fanout"),ce("dogbone"),ce("bus_lanes"),ce("single_layer_routing").transform(()=>"bus_lanes"),ce("auto-jumper"),ce("sequential-trace"),ce("auto-local"),ce("auto-cloud")]),vTo=k(),l1e=an([dSt,ITo,vTo]),STo=bt(["1x","1.5x","2x","5x","10x","100x"]),uSt=bt(["none","basic","conservative"]),PTo=bt(["beta_pipeline1","beta_pipeline3","beta_pipeline4","beta_pipeline5","beta_pipeline7","beta_pipeline9","latest"]),ETo=cc((e)=>typeof e==="string").transform((e)=>{let t=PTo.safeParse(e);if(t.success)return t.data;return console.warn(`Unknown autorouterVersion "${e}", falling back to "latest".`),"latest"}),hze=s1e.extend({name:k().optional(),children:Sd().optional(),schTitle:k().optional(),schSheetName:k().optional().describe('This group will be drawn as part of this sheet e.g. "Main"'),key:Sd().optional(),showAsSchematicBox:Be().optional(),connections:Ss(k(),bO.optional()).optional(),schPinArrangement:a1e.optional(),schPinSpacing:ve.optional(),schPinStyle:Pse.optional(),...Cse.shape,grid:Cse.shape.grid.describe("@deprecated use pcbGrid"),flex:Cse.shape.flex.describe("@deprecated use pcbFlex"),pcbGrid:Be().optional(),pcbGridCols:ge().or(k()).optional(),pcbGridRows:ge().or(k()).optional(),pcbGridTemplateRows:k().optional(),pcbGridTemplateColumns:k().optional(),pcbGridTemplate:k().optional(),pcbGridGap:ge().or(k()).optional(),pcbGridRowGap:ge().or(k()).optional(),pcbGridColumnGap:ge().or(k()).optional(),pcbFlex:Be().or(k()).optional(),pcbFlexGap:ge().or(k()).optional(),pcbFlexDirection:bt(["row","column"]).optional(),pcbAlignItems:bt(["start","center","end","stretch"]).optional(),pcbJustifyContent:bt(["start","center","end","stretch","space-between","space-around","space-evenly"]).optional(),pcbFlexRow:Be().optional(),pcbFlexColumn:Be().optional(),pcbGap:ge().or(k()).optional(),pcbPack:Be().optional(),pcbPackGap:ge().or(k()).optional(),schGrid:Be().optional(),schGridCols:ge().or(k()).optional(),schGridRows:ge().or(k()).optional(),schGridTemplateRows:k().optional(),schGridTemplateColumns:k().optional(),schGridTemplate:k().optional(),schGridGap:ge().or(k()).optional(),schGridRowGap:ge().or(k()).optional(),schGridColumnGap:ge().or(k()).optional(),schFlex:Be().or(k()).optional(),schFlexGap:ge().or(k()).optional(),schFlexDirection:bt(["row","column"]).optional(),schAlignItems:bt(["start","center","end","stretch"]).optional(),schJustifyContent:bt(["start","center","end","stretch","space-between","space-around","space-evenly"]).optional(),schFlexRow:Be().optional(),schFlexColumn:Be().optional(),schGap:ge().or(k()).optional(),schPack:Be().optional(),schMatchAdapt:Be().optional(),pcbWidth:ve.optional(),pcbHeight:ve.optional(),minTraceWidth:ve.optional(),nominalTraceWidth:ve.optional(),schWidth:ve.optional(),schHeight:ve.optional(),pcbLayout:Cse.optional(),schLayout:Cse.optional(),cellBorder:T7t.nullable().optional(),border:T7t.nullable().optional(),schPadding:ve.optional(),schPaddingLeft:ve.optional(),schPaddingRight:ve.optional(),schPaddingTop:ve.optional(),schPaddingBottom:ve.optional(),pcbPadding:ve.optional(),pcbPaddingLeft:ve.optional(),pcbPaddingRight:ve.optional(),pcbPaddingTop:ve.optional(),pcbPaddingBottom:ve.optional(),pcbAnchorAlignment:bTo.optional()}),pSt=cc((e)=>("findPart"in e)),h1e=hze.extend({manualEdits:CTo.optional(),schAutoLayoutEnabled:Be().optional(),schTraceAutoLabelEnabled:Be().optional(),schMaxTraceDistance:Ke.optional(),routingDisabled:Be().optional(),placementDrcChecksDisabled:Be().optional(),bomDisabled:Be().optional(),defaultTraceWidth:ve.optional(),...hSt.shape,nominalTraceWidth:ve.optional(),partsEngine:pSt.optional(),_subcircuitCachingEnabled:Be().optional(),pcbRouteCache:cc((e)=>!0).optional(),autorouter:l1e.optional(),preflightRoutingCheckPolicy:uSt.optional(),autorouterEffortLevel:STo.optional(),autorouterVersion:ETo.optional(),square:Be().optional(),emptyArea:k().optional(),filledArea:k().optional(),width:Ke.optional(),height:Ke.optional(),outline:st(Yy).optional(),outlineOffsetX:Ke.optional(),outlineOffsetY:Ke.optional(),circuitJson:st(Sd()).optional(),exposedNets:st(k()).optional(),exposeNets:Be().optional()}),MTo=h1e.extend({subcircuit:ce(!0)}),mSt=ss("subcircuit",[hze.extend({subcircuit:ce(!1).optional()}),MTo]);yn(!0);yn(!0);yn(!0);yn(!0);yn(!0);var rK=cc((e)=>typeof e==="string"),wTo=Ee({...Yy.shape,isCastellatedHole:Be().optional(),holeDiameter:Yn.optional(),padDiameter:Yn.optional(),connectsTo:k().or(st(k())).optional()}).superRefine((e,t)=>{if(e.isCastellatedHole){if(e.holeDiameter===void 0)t.addIssue({code:Gt.custom,path:["holeDiameter"],message:"holeDiameter is required for a castellated hole"});if(e.padDiameter===void 0)t.addIssue({code:Gt.custom,path:["padDiameter"],message:"padDiameter is required for a castellated hole"});return}if(e.holeDiameter!==void 0||e.padDiameter!==void 0||e.connectsTo!==void 0)t.addIssue({code:Gt.custom,path:["isCastellatedHole"],message:"isCastellatedHole must be true when castellated hole props are provided"})}),dze=h1e.omit({connections:!0}).extend({mountedTo:k().trim().min(1).optional().describe('e.g. "NEMA17.backface".'),mountGap:Yn.pipe(ge().nonnegative().finite()).optional().describe('Clearance from the mounting face, e.g. "6mm".'),mountRotationAnchor:OBo.optional().describe('e.g. "J_USB" or "rightedge".'),mountRotation:zBo.optional().describe('e.g. "calc(NEMA17.wireside-90degcw)".'),mountOrientation:VBo.optional().describe('e.g. "top_layer_toward_mount_face".'),fabricatorPreset:bt(["jlcpcb_economy","jlcpcb_standard","jlcpcb_economy_20260912","jlcpcb_standard_20260912"]).optional().describe("Fabricator preset, preserved as supplied. Omitted leaves the preset unset."),material:bt(["fr4","fr1","flex"]).default("fr4"),layers:an([ce(1),ce(2),ce(4),ce(6),ce(8),ce(10)]).default(2),allowBlindAndBuriedVias:Be().default(!1).describe("Whether the autorouter may generate blind and buried vias. Defaults to false, which restricts newly generated vias to the full board stack."),routeRemaining:Be().optional().describe("Whether to route remaining unrouted connections after explicit routing phases. Boolean values are preserved; omitted leaves the setting unset. No aliases or prop conflicts are introduced, and existing boards require no migration."),defaultViaTenting:an([Be(),bt(["both_sides","top_and_bottom_tented","top_tented","bottom_tented","exposed"])]).transform((e)=>{if(e===!0||e==="both_sides")return"top_and_bottom_tented";if(e===!1)return"exposed";return e}).optional(),borderRadius:Yn.optional(),thickness:Yn.optional(),boardAnchorPosition:Yy.optional(),anchorAlignment:lS.optional(),boardAnchorAlignment:lS.optional().describe("Prefer using anchorAlignment when possible"),outline:st(wTo).optional(),title:k().optional(),solderMaskColor:rK.optional(),topSolderMaskColor:rK.optional(),bottomSolderMaskColor:rK.optional(),silkscreenColor:rK.optional(),topSilkscreenColor:rK.optional(),bottomSilkscreenColor:rK.optional(),doubleSidedAssembly:Be().optional().default(!1),isViaInPadAllowed:Be().optional().describe("Allows intentional via-in-pad designs to pass DRC. Omitted or false keeps via-in-pad disallowed."),automaticPoursEnabled:Be().default(!1).describe("Whether implicit copper pours should be generated automatically. Defaults to false."),enableViaStitching:Be().default(!1).describe("Whether to stitch copper pours on the same net across layers with vias. Defaults to false."),viaStitchPitch:Yn.pipe(ge().positive().finite()).optional().describe("Positive center-to-center stitching via spacing in millimeters or a unit string, parsed to millimeters. Omitted uses the solver default. Does not enable stitching by itself."),schematicDisabled:Be().optional()});yn(!0);yn(!0);var n1e=Yn.pipe(ge().finite()),_St=Ee({name:k().optional(),x1:n1e,y1:n1e,x2:n1e,y2:n1e,bendAngle:ii.pipe(ge().finite()),bendRadius:Yn.pipe(ge().finite().positive()),tearReliefRadius:Yn.pipe(ge().finite().positive()).optional(),bendSide:bt(["left","right"])}).refine(({x1:e,y1:t,x2:n,y2:o})=>e!==n||t!==o,{message:"Bend centerline endpoints must be distinct",path:["x2"]});yn(!0);var D7t=Yn.pipe(ge().finite()),qFe=Yn.pipe(ge().finite().positive()),JFe=Fs.omit({layer:!0}).extend({name:k().optional(),layer:bt(["top","bottom"])}),gSt=ss("shape",[JFe.extend({shape:ce("rect"),width:qFe,height:qFe,radius:Fm().optional(),points:Fm().optional()}),JFe.extend({shape:ce("circle"),radius:qFe,width:Fm().optional(),height:Fm().optional(),points:Fm().optional()}),JFe.extend({shape:ce("polygon"),points:st(Ee({x:D7t,y:D7t})).min(3).refine((e)=>{let t=e.reduce((n,o,r)=>{let i=e[(r+1)%e.length];return n+o.x*i.y-i.x*o.y},0);return Number.isFinite(t)&&t!==0},"Solder-mask opening must enclose a nonzero area"),width:Fm().optional(),height:Fm().optional(),radius:Fm().optional()})]),oze=Yn.pipe(ge().finite().positive()),N7t=Yn.pipe(ge().finite()),R7t=Fs.omit({layer:!0}).extend({name:k().optional(),layer:bt(["top","bottom"]),material:bt(["fr4","polyimide","stainless_steel","aluminum"]),thickness:oze,adhesiveThickness:Yn.pipe(ge().finite().nonnegative()).optional()}),ASt=ss("shape",[R7t.extend({shape:ce("rect"),width:oze,height:oze,outline:Fm().optional()}),R7t.extend({shape:ce("polygon"),outline:st(Ee({x:N7t,y:N7t})).min(3).refine((e)=>{let t=e.reduce((n,o,r)=>{let i=e[(r+1)%e.length];return n+o.x*i.y-i.x*o.y},0);return Number.isFinite(t)&&t!==0},"Stiffener outline must enclose a nonzero area"),width:Fm().optional(),height:Fm().optional()})]),uze=hze.omit({width:!0,height:!0,layoutMode:!0,children:!0}).extend({width:Yn.optional(),height:Yn.optional(),children:Sd().optional(),anchorAlignment:lS.optional(),noSolderMask:Be().optional(),panelizationMethod:bt(["tab-routing","outline_routing","none"]).optional(),boardGap:Yn.optional(),layoutMode:bt(["grid","pack","none"]).optional(),row:ge().optional(),col:ge().optional(),cellWidth:Yn.optional(),cellHeight:Yn.optional(),tabWidth:Yn.optional(),tabLength:Yn.optional(),mouseBites:Be().optional(),edgePadding:Yn.optional(),edgePaddingLeft:Yn.optional(),edgePaddingRight:Yn.optional(),edgePaddingTop:Yn.optional(),edgePaddingBottom:Yn.optional(),_subcircuitCachingEnabled:Be().optional()});yn(!0);var fSt=uze;yn(!0);var o1e=Yn.refine(Number.isFinite,"Coordinate must be finite"),ZFe=Yn.refine((e)=>Number.isFinite(e)&&e>0,"Distance must be positive and finite"),BTo=ss("route_type",[Ee({route_type:ce("wire"),x:o1e,y:o1e,width:ZFe,width_interpolation_mode:bt(["linear","quadratic"]).optional().describe("Interpolate width from this point to the next wire point."),layer:Lo}),Ee({route_type:ce("via"),x:o1e,y:o1e,from_layer:Lo,to_layer:Lo,via_diameter:ZFe.optional(),via_hole_diameter:ZFe.optional()})]),Mse=Ee({connection:k().min(1),route:st(BTo).min(2).superRefine((e,t)=>{let n=e[0],o=n?.route_type==="via"?n.from_layer:n?.layer;for(let[r,i]of e.entries()){if(i.route_type==="wire"&&i.width_interpolation_mode){let s=e[r+1];if(s?.route_type!=="wire"||s.layer!==i.layer||s.x===i.x&&s.y===i.y)t.addIssue({code:"custom",path:[r,"width_interpolation_mode"],message:"Width interpolation requires a distinct next wire point on the same layer"})}if((i.route_type==="wire"?i.layer:i.from_layer)!==o)t.addIssue({code:"custom",message:"A fanout trace path must use vias for layer changes"});if(i.route_type==="via")o=i.to_layer}})}),bse=Yn.refine((e)=>e>=0,{message:"Fanout boundary padding cannot be negative"}),TTo=an([bse,Ee({top:bse.optional(),right:bse.optional(),bottom:bse.optional(),left:bse.optional()})]);yn(!0);var pze=["topside_left","topside_center","topside_right","rightside_top","rightside_center","rightside_bottom","bottomside_right","bottomside_center","bottomside_left","leftside_bottom","leftside_center","leftside_top","center"],Q7t=bt(pze),DTo=an([lS,Q7t,Ee({direction:an([lS,Q7t])})]),ySt=Ee({busFanoutDirections:Ss(DTo).optional(),fanoutBoundaryPadding:TTo.optional(),fanoutRoutingLayers:st(Lo).min(1).optional(),fanoutPourNetMap:Ss(Lo,an([k(),st(k()).min(1)])).optional()});yn(!0);var NTo=Yn.refine((e)=>e>=0,{message:"Fanout margin cannot be negative"}),xSt=h1e.extend({autorouter:l1e.default("fanout"),pcbTracePaths:st(Mse).optional(),padding:Yn.optional(),paddingLeft:Yn.optional(),paddingRight:Yn.optional(),paddingTop:Yn.optional(),paddingBottom:Yn.optional(),fanoutMargin:NTo.optional(),...ySt.shape});yn(!0);var RTo=k().or(st(k()).readonly()).or(st(k())),bSt=st(M_).readonly().or(st(M_)),QTo=cc().pipe(Ss(k(),RTo)),kTo=cc((e)=>!!e&&typeof e==="object"&&("type"in e)&&("props"in e)),LTo=cc((e)=>CSt.isValidElement(e)&&e.type==="internalcircuit"),mze=Ss(M_,M_.or(st(M_).readonly()).or(st(M_)));yn(!0);var HTo=Ee({manufacturerPartNumber:k().optional(),supplierPartNumber:Ss(j7,st(k())).optional()}),u1=Du.extend({manufacturerPartNumber:k().optional(),pinLabels:mze.optional(),showPinAliases:Be().optional(),pcbPinLabels:Ss(k(),k()).optional(),internallyConnectedPins:st(st(an([k(),ge()]))).optional(),externallyConnectedPins:st(st(k())).optional(),schPinArrangement:i1e.optional(),schPortArrangement:i1e.optional(),pinCompatibleVariants:st(HTo).optional(),schPinStyle:Pse.optional(),schPinSpacing:Ke.optional(),schWidth:Ke.optional(),schHeight:Ke.optional(),noSchematicRepresentation:Be().optional(),schShowInternalCircuit:Be().optional().default(!1),noConnect:bSt.optional(),connections:QTo.optional(),spiceModel:kTo.optional(),internalCircuit:LTo.optional()});yn(!0);var ISt=u1;yn(!0);var _ze=Du.extend({manufacturerPartNumber:k().optional(),pinLabels:Ss(ge().or(M_),M_.or(st(M_))).optional(),schPinStyle:Pse.optional(),schPinSpacing:Ke.optional(),schWidth:Ke.optional(),schHeight:Ke.optional(),schDirection:bt(["left","right"]).optional(),schPinArrangement:a1e.optional(),schPortArrangement:i1e.optional(),pcbPinLabels:Ss(k(),k()).optional(),pinCount:an([ce(2),ce(3)]).optional(),internallyConnectedPins:st(st(an([k(),ge()]))).optional(),connections:cc().pipe(Ss(k(),bO)).optional()});yn(!0);var vSt=_ze.extend({bridgedPins:st(st(k())).optional(),bridged:Be().optional()});yn(!0);var FTo=bt(["usb_c","m2","jst_sh","jst_gh","jst_zh","jst_ph","jst_xh","jst_vh"]),SSt=u1.extend({standard:FTo.optional(),pinCount:ge().int().positive().optional()});yn(!0);var PSt=Du.extend({standard:bt(["TSC0001_36P_XALT_2025_11","0805","0603","1206"]).optional(),pinLabels:Ss(ge().or(M_),M_.or(st(M_))).optional(),internallyConnectedPins:st(st(an([k(),ge()]))).optional()});yn(!0);var ESt=Du.extend({currentRating:an([ge(),k()]),voltageRating:an([ge(),k()]).optional(),schShowRatings:Be().optional(),schOrientation:WR.optional(),connections:Ss(k(),an([k(),st(k()).readonly(),st(k())])).optional()}),zTo="0.04in",OTo="0.1in",VTo=(e)=>{if(!e||typeof e!=="object")return e;let t={...e};if(t.shape!==void 0)return t;if(t.padOutline!==void 0)return t.shape="hole_with_polygon_pad",t;if(t.rectPadWidth!==void 0||t.rectPadHeight!==void 0){if(t.holeDiameter!==void 0)return t.shape="circular_hole_with_rect_pad",t;return t.shape="pill_hole_with_rect_pad",t}if(t.outerDiameter!==void 0||t.holeDiameter!==void 0||t.padDiameter!==void 0)return t.shape="circle",t;if(t.outerWidth!==void 0||t.outerHeight!==void 0)return t.shape=t.rectPad===!0?"pill":"oval",t;return t.shape="circle",t.holeDiameter=zTo,t.outerDiameter=OTo,t},r1e=cc().transform((e)=>{if(e===void 0)return;return Ke.parse(e)}),YTo=ss("shape",[Fs.omit({pcbRotation:!0,layer:!0}).extend({name:k().optional(),connectsTo:k().or(st(k())).optional(),shape:ce("circle"),holeDiameter:Ke,outerDiameter:Ke,padDiameter:Ke.optional().describe("Diameter of the copper pad"),portHints:Qb.optional(),solderMaskMargin:Ke.optional(),coveredWithSolderMask:Be().optional()}),Fs.omit({layer:!0}).extend({name:k().optional(),connectsTo:k().or(st(k())).optional(),shape:ce("oval"),outerWidth:Ke,outerHeight:Ke,holeWidth:r1e,holeHeight:r1e,innerWidth:Ke.optional().describe("DEPRECATED use holeWidth"),innerHeight:Ke.optional().describe("DEPRECATED use holeHeight"),portHints:Qb.optional(),solderMaskMargin:Ke.optional(),coveredWithSolderMask:Be().optional()}),Fs.omit({layer:!0}).extend({name:k().optional(),connectsTo:k().or(st(k())).optional(),shape:ce("pill"),rectPad:Be().optional(),outerWidth:Ke,outerHeight:Ke,holeWidth:r1e,holeHeight:r1e,innerWidth:Ke.optional().describe("DEPRECATED use holeWidth"),innerHeight:Ke.optional().describe("DEPRECATED use holeHeight"),portHints:Qb.optional(),holeOffsetX:Ke.optional(),holeOffsetY:Ke.optional(),solderMaskMargin:Ke.optional(),coveredWithSolderMask:Be().optional()}),Fs.omit({layer:!0}).extend({name:k().optional(),connectsTo:k().or(st(k())).optional(),shape:ce("circular_hole_with_rect_pad"),holeDiameter:Ke,rectPadWidth:Ke,rectPadHeight:Ke,rectBorderRadius:Ke.optional(),holeShape:ce("circle").optional(),padShape:ce("rect").optional(),portHints:Qb.optional(),holeOffsetX:Ke.optional(),holeOffsetY:Ke.optional(),solderMaskMargin:Ke.optional(),coveredWithSolderMask:Be().optional()}),Fs.omit({layer:!0}).extend({name:k().optional(),connectsTo:k().or(st(k())).optional(),shape:ce("pill_hole_with_rect_pad"),holeShape:ce("pill").optional(),padShape:ce("rect").optional(),holeWidth:Ke,holeHeight:Ke,rectPadWidth:Ke,rectPadHeight:Ke,rectBorderRadius:Ke.optional(),portHints:Qb.optional(),holeOffsetX:Ke.optional(),holeOffsetY:Ke.optional(),solderMaskMargin:Ke.optional(),coveredWithSolderMask:Be().optional()}),Fs.omit({pcbRotation:!0,layer:!0}).extend({name:k().optional(),connectsTo:k().or(st(k())).optional(),shape:ce("hole_with_polygon_pad"),holeShape:bt(["circle","oval","pill","rotated_pill"]),holeDiameter:Ke.optional(),holeWidth:Ke.optional(),holeHeight:Ke.optional(),padOutline:st(Yy),holeOffsetX:Ke,holeOffsetY:Ke,portHints:Qb.optional(),solderMaskMargin:Ke.optional(),coveredWithSolderMask:Be().optional()})]).transform((e)=>{if("innerWidth"in e&&e.innerWidth!==void 0)e.holeWidth??=e.innerWidth;if("innerHeight"in e&&e.innerHeight!==void 0)e.holeHeight??=e.innerHeight;return e}),MSt=xie(VTo,YTo);yn(!0);var GTo=["pin1","pin2","pos","neg"],UTo=new Set(["01005","0201","0402","0504","0603","0805","1206","1210","1812","2010","2512"]),WTo=(e)=>{if(typeof e!=="string")return e;if(!UTo.has(e))return e;return`res${e}`},XTo=aze.optional().transform(WTo),wSt=Du.extend({footprint:XTo,resistance:s5,tolerance:an([k(),ge()]).transform((e)=>{if(typeof e==="string"){if(e.endsWith("%"))return parseFloat(e.slice(0,-1))/100;return parseFloat(e)}return e}).pipe(ge().min(0,"Tolerance must be non-negative").max(1,"Tolerance cannot be greater than 100%")).optional(),pullupFor:k().optional(),pullupTo:k().optional(),pulldownFor:k().optional(),pulldownTo:k().optional(),schOrientation:WR.optional(),schSize:c1e.optional(),connections:b3(GTo).optional()}),BSt=lSt;yn(!0);var jTo=["pin1","pin2","pin3"],TSt=Du.extend({maxResistance:s5,pinVariant:bt(["two_pin","three_pin"]).optional(),connections:b3(jTo).optional()});yn(!0);var KTo=["pin1","left","pin2","right","pin3","pin4"],DSt=Du.extend({frequency:Xp,loadCapacitance:k9,maxTraceLength:Ke.optional(),manufacturerPartNumber:k().optional(),pinVariant:bt(["two_pin","four_pin"]).optional(),schOrientation:WR.optional(),connections:b3(KTo).optional()});yn(!0);var NSt=Du.extend({frequency:Xp,loadCapacitance:k9,pinVariant:bt(["no_ground","ground_pin","two_ground_pins"]).optional()});yn(!0);var vvs=dze.extend({leftPinCount:ge().optional(),rightPinCount:ge().optional(),topPinCount:ge().optional(),bottomPinCount:ge().optional(),leftPins:st(k()).optional(),rightPins:st(k()).optional(),topPins:st(k()).optional(),bottomPins:st(k()).optional(),pinPitch:Ke.optional(),innerHoles:Be().optional()});yn(!0);var $To=["pin1","pin2","pos","neg","anode","cathode"],RSt=Du.extend({capacitance:k9,maxVoltageRating:_h.optional(),schShowRatings:Be().optional().default(!1),polarized:Be().optional().default(!1),decouplingFor:k().optional(),decouplingTo:k().optional(),bypassFor:k().optional(),bypassTo:k().optional(),maxDecouplingTraceLength:Ke.optional(),schOrientation:WR.optional(),schSize:c1e.optional(),connections:b3($To).optional()}),QSt=Sse;yn(!0);var kSt=Ee({name:k(),connectsTo:k().or(st(k())).optional(),routingPhaseIndex:ge().nullable().optional(),highlightColor:k().optional(),isPowerNet:Be().optional(),isGroundNet:Be().optional(),nominalTraceWidth:Ke.optional()});yn(!0);var d1e=Du.extend({soldermaskPullback:Yn.optional(),padDiameter:Yn});yn(!0);var Bvs=Ee({name:k().optional(),pcbOnly:Be().optional(),schOnly:Be().optional()});yn(!0);var qTo=Ee({pcb:ce(!0).optional(),xDist:Yn,left:k(),right:k(),edgeToEdge:ce(!0).optional(),centerToCenter:ce(!0).optional()});yn(!0);var JTo=Ee({pcb:ce(!0).optional(),yDist:Yn,top:k(),bottom:k(),edgeToEdge:ce(!0).optional(),centerToCenter:ce(!0).optional()});yn(!0);var ZTo=Ee({pcb:ce(!0).optional(),sameY:ce(!0).optional(),for:st(k())});yn(!0);var eDo=Ee({pcb:ce(!0).optional(),sameX:ce(!0).optional(),for:st(k())});yn(!0);var LSt=an([qTo,JTo,ZTo,eDo]);yn(!0);var tDo=Fs.omit({layer:!0,pcbRotation:!0}).extend({name:k().optional(),shape:ce("rect"),width:Yn,height:Yn});yn(!0);var nDo=Fs.omit({layer:!0,pcbRotation:!0}).extend({name:k().optional(),shape:ce("circle"),radius:Yn});yn(!0);var oDo=Fs.omit({layer:!0,pcbRotation:!0}).extend({name:k().optional(),shape:ce("polygon"),points:st(Yy)});yn(!0);var HSt=ss("shape",[tDo,nDo,oDo]),FSt=Ee({name:k().optional(),checkFn:mTo});yn(!0);var rDo=Fs.omit({pcbRotation:!0}).extend({name:k().optional(),shape:ce("rect"),width:Yn,height:Yn,rectBorderRadius:Yn.optional(),cornerRadius:Yn.optional(),portHints:Qb.optional(),coveredWithSolderMask:Be().optional(),solderMaskMargin:Yn.optional(),solderMaskMarginLeft:Yn.optional(),solderMaskMarginRight:Yn.optional(),solderMaskMarginTop:Yn.optional(),solderMaskMarginBottom:Yn.optional(),noSolderPaste:Be().optional(),solderPasteMargin:Yn.optional()});yn(!0);var iDo=Fs.omit({pcbRotation:!0}).extend({name:k().optional(),shape:ce("rotated_rect"),width:Yn,height:Yn,ccwRotation:ge(),cornerRadius:Yn.optional(),portHints:Qb.optional(),coveredWithSolderMask:Be().optional(),solderMaskMargin:Yn.optional(),solderMaskMarginLeft:Yn.optional(),solderMaskMarginRight:Yn.optional(),solderMaskMarginTop:Yn.optional(),solderMaskMarginBottom:Yn.optional(),noSolderPaste:Be().optional(),solderPasteMargin:Yn.optional()});yn(!0);var sDo=Fs.omit({pcbRotation:!0}).extend({name:k().optional(),shape:ce("circle"),radius:Yn,portHints:Qb.optional(),coveredWithSolderMask:Be().optional(),solderMaskMargin:Yn.optional(),noSolderPaste:Be().optional(),solderPasteMargin:Yn.optional()});yn(!0);var aDo=Fs.omit({pcbRotation:!0}).extend({name:k().optional(),shape:ce("pill"),width:Yn,height:Yn,radius:Yn,portHints:Qb.optional(),coveredWithSolderMask:Be().optional(),solderMaskMargin:Yn.optional(),noSolderPaste:Be().optional(),solderPasteMargin:Yn.optional()});yn(!0);var cDo=Fs.omit({pcbRotation:!0}).extend({name:k().optional(),shape:ce("rotated_pill"),width:Yn,height:Yn,radius:Yn,ccwRotation:ge(),portHints:Qb.optional(),coveredWithSolderMask:Be().optional(),solderMaskMargin:Yn.optional(),noSolderPaste:Be().optional(),solderPasteMargin:Yn.optional()});yn(!0);var lDo=Fs.omit({pcbRotation:!0}).extend({name:k().optional(),shape:ce("polygon"),points:st(Yy),portHints:Qb.optional(),coveredWithSolderMask:Be().optional(),solderMaskMargin:Yn.optional(),noSolderPaste:Be().optional(),solderPasteMargin:Yn.optional()});yn(!0);var zSt=ss("shape",[sDo,rDo,iDo,aDo,cDo,lDo]);yn(!0);var hDo=Fs.omit({pcbRotation:!0}).extend({shape:ce("rect"),width:Yn,height:Yn});yn(!0);var dDo=Fs.omit({pcbRotation:!0}).extend({shape:ce("circle"),radius:Yn});yn(!0);var OSt=an([dDo,hDo]);yn(!0);var uDo=Fs.extend({name:k().optional(),shape:ce("circle").optional(),diameter:Yn.optional(),radius:Yn.optional(),solderMaskMargin:Yn.optional(),coveredWithSolderMask:Be().optional()}).transform((e)=>({...e,diameter:e.diameter??2*e.radius,radius:e.radius??e.diameter/2})),pDo=Fs.extend({name:k().optional(),shape:ce("pill"),width:Yn,height:Yn,solderMaskMargin:Yn.optional(),coveredWithSolderMask:Be().optional()}),mDo=Fs.extend({name:k().optional(),shape:ce("oval"),width:Yn,height:Yn,solderMaskMargin:Yn.optional(),coveredWithSolderMask:Be().optional()}),_Do=Fs.extend({name:k().optional(),shape:ce("rect"),width:Yn,height:Yn,solderMaskMargin:Yn.optional(),coveredWithSolderMask:Be().optional()}),VSt=an([uDo,pDo,mDo,_Do]);yn(!0);var gDo=["2.4ghz_quarter_wave_monopole","2.4ghz_meandered_monopole","2.4ghz_inverted_f","2.4ghz_meandered_inverted_f","2.4ghz_folded_dipole"],ADo=bt(gDo),fDo=["2.4ghz","5ghz","6ghz","dual_band_2.4ghz_5ghz","tri_band_2.4ghz_5ghz_6ghz"],yDo=bt(fDo),YSt=Du.extend({antennaShape:ADo.optional(),frequencyBand:yDo.optional(),pcbPath:nze.optional()});yn(!0);var Ise=an([k(),cc((e)=>typeof e==="object"&&e!==null&&("getPortSelector"in e)&&typeof e.getPortSelector==="function")]),eze=Ee({key:k().optional(),name:k().optional(),displayName:k().optional(),thickness:Ke.optional(),width:Ke.optional().describe("Alias for trace thickness"),schematicRouteHints:st(Yy).optional(),pcbRouteHints:st(r2).optional(),pcbTeardrops:Be().optional().describe("Enable PCB trace teardrops."),pcbTeardropStart:Be().optional().describe("Teardrop at the start (from) of trace"),pcbTeardropEnd:Be().optional().describe("Teardrop at the end (to) of trace"),pcbPathRelativeTo:k().optional(),pcbPath:nze.optional(),pcbPaths:st(nze).optional(),routingPhaseIndex:ge().nullable().optional(),pcbStraightLine:Be().optional().describe("Draw a straight pcb trace between the connected points"),schDisplayLabel:k().optional(),schStroke:k().optional(),highlightColor:k().optional(),maxLength:Ke.optional(),maxViaCount:ge().int().nonnegative().optional().describe("Maximum number of vias allowed in the PCB trace route"),connectsTo:k().or(st(k())).optional()}),GSt=an([eze.extend({path:st(Ise)}),eze.extend({from:Ise,to:Ise}),eze.extend({start:Ise,end:Ise})]),gze=Ke.pipe(ge().nonnegative().finite()),sK=an([gze,Ee({reference:ce("longest_manhattan"),of:st(k().min(1)).min(1).optional(),offset:Ke.pipe(ge().finite()).optional()}).strict()]);yn(!0);function USt(e,t){if(Boolean(e.targetLength!==void 0)!==Boolean(e.lengthTolerance!==void 0))t.addIssue({code:Gt.custom,path:["lengthTolerance"],message:"targetLength and lengthTolerance must be supplied together"});if(e.lengthMatchTo!==void 0&&e.maxLengthSkew===void 0)t.addIssue({code:Gt.custom,path:["maxLengthSkew"],message:"lengthMatchTo requires an explicit maxLengthSkew"});let n=(s)=>typeof s==="number"?{basis:"absolute",amount:s}:{basis:JSON.stringify([s.reference,s.of?[...s.of].sort():null]),amount:s.offset??0},o=e.minLength===void 0?void 0:n(e.minLength),r=e.maxLength===void 0?void 0:n(e.maxLength),i=e.targetLength===void 0?void 0:n(e.targetLength);if(o&&r&&o.basis===r.basis&&o.amount>r.amount)t.addIssue({code:Gt.custom,path:["maxLength"],message:"maxLength cannot be below minLength for the same reference"});if(i&&o&&i.basis===o.basis&&i.amount+(e.lengthTolerance??0)<o.amount||i&&r&&i.basis===r.basis&&i.amount-(e.lengthTolerance??0)>r.amount)t.addIssue({code:Gt.custom,path:["targetLength"],message:"targetLength tolerance window does not intersect the declared length bounds"})}var WSt=an([k().min(1),st(k().min(1)).min(1)]),xDo=k().regex(/^\s*(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?\s*w\s*$/i).transform((e)=>({widthMultiplier:Number(e.trim().replace(/w$/i,""))})).pipe(Ee({widthMultiplier:ge().positive().finite()})),CDo=Ke.pipe(ge().positive().finite()),rze=an([xDo,CDo]);yn(!0);var vse=an([ge(),k().refine((e)=>!/(?:±|\+\/-)/.test(e),"Use a scalar impedance for explicit bounds")]).pipe(s5).pipe(ge().positive().finite()),k7t=/^([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)\s*(.*?)$/i,bDo=k().regex(/(?:±|\+\/-)/).transform((e,t)=>{let n=e.trim().split(/\s*(?:±|\+\/-)\s*/),o=n.length===2?n[0].match(k7t):null,r=n.length===2?n[1].match(k7t):null;if(!o||!r)return t.addIssue({code:Gt.custom,message:"Use a nominal impedance ± an absolute ohm tolerance"}),Cie;let i=/^(?:[yzafpnumkKMGTPEZYµμ])?(?:ohms?|Ω)$/i;if(o[2]&&!i.test(o[2])||r[2]&&!i.test(r[2]))return t.addIssue({code:Gt.custom,message:"Use an absolute ohm tolerance, not a percentage or another unit"}),Cie;let s=s5.safeParse(`${o[1]}${o[2]||r[2]||"ohm"}`),a=s5.safeParse(`${r[1]}${r[2]||o[2]||"ohm"}`);if(!s.success||!a.success||!Number.isFinite(s.data)||!Number.isFinite(a.data)||s.data<=0||a.data<0)return t.addIssue({code:Gt.custom,message:"Nominal impedance must be positive and tolerance nonnegative, in ohms"}),Cie;return{nominal:s.data,min:s.data-a.data,max:s.data+a.data}}).pipe(Ee({nominal:ge().positive().finite(),min:ge().positive().finite(),max:ge().positive().finite()})),IDo=vse,XSt=an([bDo,IDo]);yn(!0);function jSt(e,t,n,o,r){if(t!==void 0&&n!==void 0&&t>n)o.addIssue({code:Gt.custom,path:[`${r}Max`],message:"Maximum impedance cannot be below minimum impedance"});if(typeof e==="object"){for(let[i,s,a]of[["Min",t,e.min],["Max",n,e.max]])if(s!==void 0&&Math.abs(s-a)>0.000000001*Math.max(1,Math.abs(a)))o.addIssue({code:Gt.custom,path:[`${r}${i}`],message:"Explicit impedance bound conflicts with the target tolerance"})}else if(e!==void 0&&(t!==void 0&&e<t||n!==void 0&&e>n))o.addIssue({code:Gt.custom,path:[r],message:"Target impedance must lie within its declared bounds"})}var KSt=Ee({name:k().optional(),lengthMatchTo:WSt.optional(),minLength:sK.optional(),maxLength:sK.optional(),targetLength:sK.optional(),lengthTolerance:gze.optional(),pcbTraceSpacing:rze.optional(),pcbSpacingToOtherSignals:rze.optional(),connections:st(k()).min(1),routingPhaseIndex:ge().nullable().optional(),maxLengthSkew:Ke.pipe(ge().min(0).finite()).optional(),targetImpedance:XSt.optional(),targetImpedanceMin:vse.optional(),targetImpedanceMax:vse.optional(),pcbTraceWidth:Ke.pipe(ge().positive().finite()).optional(),pcbAllowedLayers:st(Lo).min(1).optional(),preferredLayer:Lo.optional(),preferredLayers:st(Lo).min(1).optional()}).superRefine((e,t)=>{USt(e,t),jSt(e.targetImpedance,e.targetImpedanceMin,e.targetImpedanceMax,t,"targetImpedance")}).transform(({targetImpedance:e,...t})=>{if(e===void 0)return t;if(typeof e==="number")return{...t,targetImpedance:e};return{...t,targetImpedance:e.nominal,targetImpedanceMin:e.min,targetImpedanceMax:e.max}});yn(!0);var $St=Ee({name:k().optional(),lengthMatchTo:WSt.optional(),minLength:sK.optional(),maxLength:sK.optional(),targetLength:sK.optional(),lengthTolerance:gze.optional(),pcbSpacingToOtherSignals:rze.optional(),positiveConnection:k(),negativeConnection:k(),maxLengthSkew:Ke.pipe(ge().min(0).finite()).optional(),targetDifferentialImpedance:XSt.optional(),targetDifferentialImpedanceMin:vse.optional(),targetDifferentialImpedanceMax:vse.optional(),pcbTraceGap:Ke.pipe(ge().positive().finite()).optional(),maxUncoupledLength:Ke.pipe(ge().min(0).finite()).optional()}).superRefine((e,t)=>{USt(e,t),jSt(e.targetDifferentialImpedance,e.targetDifferentialImpedanceMin,e.targetDifferentialImpedanceMax,t,"targetDifferentialImpedance")}).transform(({targetDifferentialImpedance:e,...t})=>{if(e===void 0)return t;if(typeof e==="number")return{...t,targetDifferentialImpedance:e};return{...t,targetDifferentialImpedance:e.nominal,targetDifferentialImpedanceMin:e.min,targetDifferentialImpedanceMax:e.max}});yn(!0);var L7t=bt(["from_left","from_right","from_top","from_bottom","from_above","from_below","from_x_neg","from_x_pos","from_y_pos","from_y_neg","from_z_pos","from_z_neg","from_front","from_back"]);yn(!0);var qSt=Ee({children:Sd().optional(),name:k().optional(),originalLayer:Lo.default("top").optional(),circuitJson:st(Sd()).optional(),src:aze.describe("Can be a footprint or kicad string").optional(),insertionDirection:L7t.optional().describe("Direction a cable or mating part is attached from, named for the side of the footprint it approaches from, in its unrotated orientation."),cutoutApertureDirection:L7t.optional().describe("Direction the part's enclosure opening faces, in its unrotated orientation. Distinct from insertionDirection: a side-actuated switch is installed from above and actuated from the side. Falls back to insertionDirection when absent.")});yn(!0);var JSt=Ee({originalFacingDirection:bt(["up","down","left","right"]).default("right").optional(),width:Yn.optional(),height:Yn.optional(),fit:bt(["fill","contain","stretch"]).optional(),viewbox:Ee({minX:Yn,maxX:Yn,minY:Yn,maxY:Yn}).refine((e)=>e.maxX>e.minX,{message:"viewbox maxX must exceed minX",path:["maxX"]}).refine((e)=>e.maxY>e.minY,{message:"viewbox maxY must exceed minY",path:["maxY"]}).optional(),name:k().optional()});yn(!0);var vDo=ge().or(k().endsWith("mAh")).transform((e)=>{if(typeof e==="string"){let t=e.replace("mAh",""),n=Number.parseFloat(t);if(Number.isNaN(n))throw Error("Invalid capacity");return n}return e}).describe("Battery capacity in mAh"),SDo=Sse,ZSt=Du.extend({capacity:vDo.optional(),voltage:_h.optional(),standard:bt(["AA","AAA","9V","CR2032","18650","C"]).optional(),schOrientation:WR.optional(),connections:b3(SDo).optional()});yn(!0);var ePt=h1e.extend({mpn:u1.shape.mpn,mfn:u1.shape.mfn,manufacturerPartNumber:u1.shape.manufacturerPartNumber,pinLabels:u1.shape.pinLabels,showPinAliases:u1.shape.showPinAliases,pcbPinLabels:u1.shape.pcbPinLabels,schPortArrangement:u1.shape.schPortArrangement,pinCompatibleVariants:u1.shape.pinCompatibleVariants,noSchematicRepresentation:u1.shape.noSchematicRepresentation,internallyConnectedPins:u1.shape.internallyConnectedPins,externallyConnectedPins:u1.shape.externallyConnectedPins,boardToBoardDistance:Yn.optional(),mountOrientation:bt(["faceDown","faceUp"]).optional()});yn(!0);var PDo=bt(["vertical","horizontal"]).describe("vertical means pins go 1->2 downward and horizontal means pins go 1->2 rightward");yn(!0);var tPt=Du.extend({pinCount:ge(),pitch:Ke.optional(),schFacingDirection:bt(["up","down","left","right"]).optional(),gender:bt(["male","female"]).optional().default("male"),showSilkscreenPinLabels:Be().optional(),pcbPinLabels:Ss(k(),k()).optional(),doubleRow:Be().optional(),rightAngle:Be().optional(),pcbOrientation:PDo.optional(),holeDiameter:Ke.optional(),platedDiameter:Ke.optional(),pinLabels:Ss(k(),M_).or(st(M_)).optional(),connections:cc().pipe(Ss(k(),bO)).optional(),facingDirection:bt(["left","right"]).optional(),schPinArrangement:a1e.optional(),schPinStyle:Pse.optional(),schPinSpacing:Ke.optional(),schWidth:Ke.optional(),schHeight:Ke.optional(),connectsFromAbove:Be().optional(),connectsFromBelow:Be().optional()}).superRefine((e,t)=>{if(e.connectsFromAbove&&e.connectsFromBelow)t.addIssue({code:Gt.custom,message:"connectsFromAbove and connectsFromBelow are opposites; set at most one"})}).transform((e)=>{let t=e.layer??(e.connectsFromBelow?"bottom":e.connectsFromAbove?"top":void 0);return t===void 0?e:{...e,layer:t}});yn(!0);var a8s=Ee({net:k().optional(),connection:k().optional(),schX:Yn.optional(),schY:Yn.optional(),schRotation:ii.optional(),anchorSide:bt(["left","top","right","bottom"]).optional()});yn(!0);var nPt=Ee({net:k().optional(),connection:k().optional(),connectsTo:k().or(st(k())).optional(),inline:Be().optional(),schX:Yn.optional(),schY:Yn.optional(),schRotation:ii.optional(),anchorSide:bt(["left","top","right","bottom"]).optional()});yn(!0);var oPt=u1.extend({});yn(!0);yn(!0);var rPt=cc((e)=>typeof e==="string"),iPt=Ee({method:bt(["trap","gear"]).optional(),reltol:an([ge(),k()]).optional(),abstol:an([ge(),k()]).optional(),vntol:an([ge(),k()]).optional()}),u1e={name:k().optional(),spiceEngine:rPt.optional(),spiceOptions:iPt.optional(),graphIndependentAxes:Be().optional(),children:cc().optional()},sPt=Ee({name:k().optional(),simulationType:ce("spice_transient_analysis").default("spice_transient_analysis"),duration:wc.optional(),startTime:wc.optional(),timePerStep:wc.optional(),spiceEngine:rPt.optional(),spiceOptions:iPt.optional(),graphIndependentAxes:Be().optional()});yn(!0);var H7t=wc.refine((e)=>e>0,"Time must be positive"),aPt=Ee({...u1e,duration:H7t.default("10ms"),startTime:wc.default("0ms"),timePerStep:H7t.default("0.01ms")}).superRefine((e,t)=>{if(e.startTime<0||e.startTime>e.duration)t.addIssue({code:Gt.custom,path:["startTime"],message:"startTime must be between zero and duration"})});yn(!0);var cPt=Ee({...u1e});yn(!0);var tze=an([_h,l1]),lPt=Ee({...u1e,sweepSource:k().min(1),sweepStart:tze,sweepStop:tze,sweepStep:tze.refine((e)=>e!==0,"sweepStep must be nonzero")}).superRefine((e,t)=>{if(Math.sign(e.sweepStop-e.sweepStart)!==Math.sign(e.sweepStep))t.addIssue({code:Gt.custom,path:["sweepStep"],message:"sweepStep must move from sweepStart toward sweepStop"})});yn(!0);var hPt=Ee({...u1e,sweepType:bt(["linear","decade","octave"]),startFrequency:Xp.refine((e)=>e>0,"startFrequency must be positive"),stopFrequency:Xp.refine((e)=>e>0,"stopFrequency must be positive"),samplesPerInterval:ge().int().positive().optional(),sampleCount:ge().int().positive().optional()}).superRefine((e,t)=>{if(e.stopFrequency<=e.startFrequency)t.addIssue({code:Gt.custom,path:["stopFrequency"],message:"stopFrequency must be greater than startFrequency"});if(e.sweepType==="linear"){if(e.sampleCount===void 0)t.addIssue({code:Gt.custom,path:["sampleCount"],message:"sampleCount is required for a linear AC sweep"});if(e.samplesPerInterval!==void 0)t.addIssue({code:Gt.custom,path:["samplesPerInterval"],message:"samplesPerInterval is only valid for decade or octave sweeps"});return}if(e.samplesPerInterval===void 0)t.addIssue({code:Gt.custom,path:["samplesPerInterval"],message:"samplesPerInterval is required for decade or octave sweeps"});if(e.sampleCount!==void 0)t.addIssue({code:Gt.custom,path:["sampleCount"],message:"sampleCount is only valid for a linear sweep"})});yn(!0);var iK=k().trim().min(1,"Provide a nonempty selector"),EDo="[+-]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+-]?\\d+)?",MDo={"":1,y:0.000000000000000000000001,z:0.000000000000000000001,a:0.000000000000000001,f:0.000000000000001,p:0.000000000001,n:0.000000001,u:0.000001,µ:0.000001,μ:0.000001,m:0.001,k:1000,M:1e6,G:1e9,T:1000000000000,P:1000000000000000,E:1000000000000000000,Z:1000000000000000000000,Y:1000000000000000000000000};function dPt(e,t,n){let o=new RegExp(`^(${EDo})\\s*(?:([yzafpnumkMGTPEZYµμ]?)(?:${e}))?$`);return an([ge(),k().trim().regex(o,`Use ${t} or a unit string, e.g. ${n}`)]).transform((r)=>{if(typeof r==="number")return r;let i=o.exec(r);return Number(i[1])*MDo[i[2]??""]}).pipe(ge().finite().positive(`${t} must be greater than zero`))}var wDo=dPt("A","peak amperes","5mA"),F7t=dPt("ohms?|Ohms?|Ω","real ohms","100ohm"),uPt=Ee({name:k().trim().min(1).optional(),source:iK,load:iK,ground:iK,current:wDo,returnSource:iK,returnSink:iK,sourceImpedance:F7t,loadImpedance:F7t,trace:iK.optional(),returnSourceLayer:Lo.optional(),returnSinkLayer:Lo.optional()}).strict();yn(!0);var pPt=Ee({name:k().trim().min(1).optional(),children:cc().optional()}).strict();yn(!0);var BDo=s5.pipe(ge()),TDo=k9.pipe(ge()),DDo=pj.pipe(ge()),NDo=_h.pipe(ge()),RDo=l1.pipe(ge()),wse=(e)=>({name:k().optional(),values:st(e).min(1).optional(),start:e.optional(),stop:e.optional(),step:e.optional()}),QDo=Ee({...wse(BDo),parameterType:ce("resistance"),resistorRef:k().min(1)}).strict(),kDo=Ee({...wse(TDo),parameterType:ce("capacitance"),capacitorRef:k().min(1)}).strict(),LDo=Ee({...wse(DDo),parameterType:ce("inductance"),inductorRef:k().min(1)}).strict(),HDo=Ee({...wse(NDo),parameterType:ce("voltage"),net:k().min(1)}).strict(),FDo=Ee({...wse(RDo),parameterType:ce("current"),currentSourceRef:k().min(1)}).strict(),zDo=(e,t)=>{let n=e.values!==void 0,o=[e.start,e.stop,e.step].filter((i)=>i!==void 0).length,r=o>0;if(n===r){t.addIssue({code:Gt.custom,message:"Provide either values or start/stop/step"});return}if(o!==0&&o!==3){t.addIssue({code:Gt.custom,message:"start, stop, and step must be provided together"});return}if(e.step===0)t.addIssue({code:Gt.custom,path:["step"],message:"step must be nonzero"});if(e.start!==void 0&&e.stop!==void 0&&e.step!==void 0&&Math.sign(e.stop-e.start)!==Math.sign(e.step))t.addIssue({code:Gt.custom,path:["step"],message:"step must move from start toward stop"})},mPt=ss("parameterType",[QDo,kDo,LDo,HDo,FDo]).superRefine(zDo);yn(!0);yn(!0);yn(!0);yn(!0);yn(!0);yn(!0);var _Pt=Ee({key:Sd().optional(),name:k().optional(),autorouter:l1e.optional(),algorithmFn:dSt.shape.algorithmFn,preflightRoutingCheckPolicy:uSt.optional(),phaseIndex:ge().optional(),pcbTracePaths:st(Mse).optional(),...hSt.shape,region:Ee({shape:ce("rect").optional(),minX:ge(),maxX:ge(),minY:ge(),maxY:ge()}).optional(),connection:k().optional(),connections:st(k()).optional(),reroute:Be().optional(),...ySt.shape}).superRefine((e,t)=>{let n=e.autorouter==="simplify"||typeof e.autorouter==="object"&&e.autorouter?.preset==="simplify";if(n&&e.reroute!==!0)console.warn('The "simplify" autorouter preset should only be used with reroute=true');if(e.reroute!==void 0&&!(n&&e.reroute===!0)&&e.region===void 0&&e.connection===void 0&&e.connections===void 0)t.addIssue({code:Gt.custom,message:"region, connection, or connections is required when reroute is provided",path:["region"]})});yn(!0);var gPt=Ee({source:k(),spicePinMapping:Ss(k(),k()).optional()});yn(!0);var ODo=["pin1","pin2","pin3","emitter","collector","base","gate","source","drain"],APt=Du.extend({type:bt(["npn","pnp","bjt","jfet","mosfet","igbt"]),connections:b3(ODo).optional()});yn(!0);var VDo=["pin1","drain","pin2","source","pin3","gate"],fPt=Du.extend({channelType:bt(["n","p"]),mosfetMode:bt(["enhancement","depletion"]),symbolDrainSide:bt(["left","right","top","bottom"]).optional(),symbolSourceSide:bt(["left","right","top","bottom"]).optional(),symbolGateSide:bt(["left","right","top","bottom"]).optional(),connections:b3(VDo).optional()});yn(!0);var YDo=["inverting_input","non_inverting_input","output","positive_supply","negative_supply"],yPt=Du.extend({connections:b3(YDo).optional()});yn(!0);var GDo=lSt,xPt=Du.extend({inductance:pj,maxCurrentRating:an([k(),ge()]).optional(),schOrientation:WR.optional(),connections:b3(GDo).optional()});yn(!0);var T8s=Ee({children:cc().optional()});yn(!0);var Aze=Sse,UDo=bt(["anode","cathode","pin1","pin2","pos","neg"]),WDo=k().or(st(k()).readonly()).or(st(k())),XDo=Ss(UDo,WDo),CPt=Ss(bt(Aze),M_.or(st(M_).readonly()).or(st(M_))),jDo=bt(["standard","schottky","zener","avalanche","photo","tvs"]),bPt=Du.extend({connections:XDo.optional(),variant:jDo.optional().default("standard"),standard:Be().optional(),schottky:Be().optional(),zener:Be().optional(),avalanche:Be().optional(),photo:Be().optional(),tvs:Be().optional(),schOrientation:WR.optional(),schSize:c1e.optional(),pinLabels:CPt.optional()}).superRefine((e,t)=>{if([e.standard,e.schottky,e.zener,e.avalanche,e.photo,e.tvs].filter(Boolean).length>1)return t.addIssue({code:Gt.custom,message:"Exactly one diode variant must be enabled",path:[]}),us}).transform((e)=>{let t={...e,standard:!1,schottky:!1,zener:!1,avalanche:!1,photo:!1,tvs:!1};if(e.standard)t.standard=!0;else if(e.schottky)t.schottky=!0;else if(e.zener)t.zener=!0;else if(e.photo)t.photo=!0;else if(e.tvs)t.tvs=!0;else switch(e.variant){case"standard":t.standard=!0;break;case"schottky":t.schottky=!0;break;case"zener":t.zener=!0;break;case"avalanche":t.avalanche=!0;break;case"photo":t.photo=!0;break;case"tvs":t.tvs=!0;break;default:t.standard=!0}return t});yn(!0);var KDo=Ss(bt(["1","2"]),M_.or(st(M_).readonly()).or(st(M_))).transform((e)=>({...e["1"]===void 0?{}:{pin1:e["1"]},...e["2"]===void 0?{}:{pin2:e["2"]}})),IPt=Du.extend({color:k().optional(),wavelength:k().optional(),schDisplayValue:k().optional(),schOrientation:WR.optional(),schSize:c1e.optional(),pinLabels:CPt.or(KDo).optional(),connections:b3(Sse).optional(),laser:Be().optional()}),vPt=Sse,SPt=Du.extend({type:bt(["spst","spdt","dpst","dpdt"]).optional(),isNormallyClosed:Be().optional().default(!1),spst:Be().optional(),spdt:Be().optional(),dpst:Be().optional(),dpdt:Be().optional(),pinLabels:mze.optional(),noConnect:bSt.optional(),simSwitchFrequency:Xp.optional(),simCloseAt:wc.optional(),simOpenAt:wc.optional(),simStartClosed:Be().optional(),simStartOpen:Be().optional(),connections:cc().pipe(Ss(k(),bO)).optional()}).transform((e)=>{let t={...e};if(t.dpdt)t.type="dpdt";else if(t.spst)t.type="spst";else if(t.spdt)t.type="spdt";else if(t.dpst)t.type="dpst";switch(t.type){case"spdt":t.spdt=!0;break;case"spst":t.spst=!0;break;case"dpst":t.dpst=!0;break;case"dpdt":t.dpdt=!0;break}return t});yn(!0);var PPt=Fs.extend({text:k(),anchorAlignment:bt(["center","top_left","top_right","bottom_left","bottom_right"]).default("center"),font:bt(["tscircuit2024"]).optional(),fontSize:ve.optional(),color:k().optional()});yn(!0);var EPt=Fs.omit({pcbRotation:!0}).extend({width:Ke,height:Ke,strokeWidth:Ke.optional(),isFilled:Be().optional(),hasStroke:Be().optional(),isStrokeDashed:Be().optional(),color:k().optional(),cornerRadius:Ke.optional()}),MPt=Fs.omit({pcbLeftEdgeX:!0,pcbRightEdgeX:!0,pcbTopEdgeY:!0,pcbBottomEdgeY:!0,pcbX:!0,pcbY:!0,pcbOffsetX:!0,pcbOffsetY:!0,pcbRotation:!0}).extend({route:st(r2),strokeWidth:ve.optional(),color:k().optional(),isFilled:Be().optional(),hasStroke:Be().optional()}),z7t=an([k(),Yy]),wPt=Fs.omit({pcbLeftEdgeX:!0,pcbRightEdgeX:!0,pcbTopEdgeY:!0,pcbBottomEdgeY:!0,pcbX:!0,pcbY:!0,pcbOffsetX:!0,pcbOffsetY:!0,pcbRotation:!0}).extend({from:z7t,to:z7t,text:k().optional(),offset:Ke.optional(),offsetDirection:Ee({x:ge().finite(),y:ge().finite()}).optional(),font:bt(["tscircuit2024"]).optional(),fontSize:ve.optional(),color:k().optional(),arrowSize:Ke.optional(),units:bt(["in","mm"]).optional(),outerEdgeToEdge:ce(!0).optional(),centerToCenter:ce(!0).optional(),innerEdgeToEdge:ce(!0).optional()});yn(!0);var W8s=Ee({layer:k().optional(),thickness:Ke.optional(),route:st(r2)}),p1e=s1e.extend({name:k().optional(),fromLayer:Lo.optional(),toLayer:Lo.optional(),holeDiameter:Ke.optional(),outerDiameter:Ke.optional(),layers:st(Lo).optional(),connectsTo:k().or(st(k())).optional(),netIsAssignable:Be().optional(),tented:an([Be(),bt(["both_sides","top_and_bottom_tented","top_tented","bottom_tented","exposed"])]).transform((e)=>{if(e===!0||e==="both_sides")return"top_and_bottom_tented";if(e===!1)return"exposed";return e}).optional()});yn(!0);var $Do=Ee({pin1:bO}).strict(),BPt=Du.extend({connections:$Do.optional(),footprintVariant:bt(["pad","through_hole"]).optional(),padShape:bt(["rect","circle"]).optional().default("circle"),padDiameter:Ke.optional(),holeDiameter:Ke.optional(),width:Ke.optional(),height:Ke.optional()}).refine((e)=>e.footprintVariant!=="through_hole"||e.holeDiameter!==void 0,{message:"holeDiameter is required for through_hole testpoints"});yn(!0);var TPt=Fs.omit({pcbRotation:!0,layer:!0}).extend({connection:k()});yn(!0);var DPt=an([Fs.omit({pcbRotation:!0}).extend({shape:ce("circle"),radius:Ke,layers:st(Lo).optional(),warningOnly:Be().optional(),allowTraces:Be().optional(),allowPlacements:Be().optional(),excludeRefs:st(k()).optional().describe('Component selectors excluded from the keepout, such as ".ANT1"')}),Fs.extend({shape:ce("rect"),width:Ke,height:Ke,layers:st(Lo).optional(),warningOnly:Be().optional(),allowTraces:Be().optional(),allowPlacements:Be().optional(),excludeRefs:st(k()).optional().describe('Component selectors excluded from the keepout, such as ".ANT1"')})]),NPt=Fs.extend({width:Ke,height:Ke,strokeWidth:Ke.optional(),isFilled:Be().optional(),hasStroke:Be().optional(),isStrokeDashed:Be().optional(),color:k().optional()}),RPt=Fs.omit({pcbLeftEdgeX:!0,pcbRightEdgeX:!0,pcbTopEdgeY:!0,pcbBottomEdgeY:!0,pcbX:!0,pcbY:!0,pcbOffsetX:!0,pcbOffsetY:!0,pcbRotation:!0}).extend({outline:st(Yy),strokeWidth:ve.optional(),isClosed:Be().optional(),isStrokeDashed:Be().optional(),color:k().optional()}),QPt=Fs.omit({pcbRotation:!0}).extend({radius:Ke}),s7s=Fs.omit({pcbRotation:!0}).extend({width:Ke,height:Ke,radius:Ke}),kPt=Ee({name:k().optional(),layer:Lo,connectsTo:k(),crosshatch:Be().optional(),crosshatchPitch:Yn.pipe(ge().finite().positive()).optional(),crosshatchWidth:Yn.pipe(ge().finite().positive()).optional(),unbroken:Be().optional().describe("Reserves the pour region during autorouting so unrelated traces do not split it. Vias may still cross the region using antipads."),padMargin:Yn.optional(),traceMargin:Yn.optional(),clearance:Yn.optional(),boardEdgeMargin:Yn.optional(),cutoutMargin:Yn.optional(),useThermalReliefs:Be().optional(),outline:st(Yy).optional(),coveredWithSolderMask:Be().optional().default(!0)}).superRefine((e,t)=>{if(e.crosshatch&&(e.crosshatchWidth??0.25)>=(e.crosshatchPitch??1))t.addIssue({code:Gt.custom,path:["crosshatchWidth"],message:"crosshatchWidth must be less than crosshatchPitch"})});yn(!0);var LPt=Ee({originalLayer:Lo.default("top").optional(),children:Sd().optional()});yn(!0);var HPt=Ee({pcbX:E_.optional(),pcbY:E_.optional(),pcbLeftEdgeX:E_.optional(),pcbRightEdgeX:E_.optional(),pcbTopEdgeY:E_.optional(),pcbBottomEdgeY:E_.optional(),pcbOffsetX:Yn.optional(),pcbOffsetY:Yn.optional(),pcbZ:Yn.optional()}),qDo=C3.extend({modelUrl:Tu,stepUrl:Tu.optional()}),JDo=qDo.merge(HPt);yn(!0);var ZDo=C3.extend({model:k().trim().min(1).optional(),modelUrl:Tu.optional()}).merge(HPt).refine((e)=>e.model===void 0!==(e.modelUrl===void 0),{message:"Provide exactly one of model or modelUrl",path:["model"]}).transform(({model:e,...t})=>({...t,modelUrl:e===void 0?t.modelUrl:/^https?:\/\//i.test(e)?e:`https://modelcdn.tscircuit.com/jscad_models/${encodeURIComponent(e)}.glb`})).pipe(JDo);yn(!0);var FPt=an([T4t(),Tu,ZDo]),zPt=Du.extend({voltage:_h}),eNo=["pin1","pin2","pos","neg"],tNo=an([k(),ge()]).transform((e)=>{if(typeof e==="string"){if(e.endsWith("%"))return parseFloat(e.slice(0,-1))/100;return parseFloat(e)}return e}).pipe(ge().min(0,"Duty cycle must be non-negative").max(1,"Duty cycle cannot be greater than 100%")),OPt=Du.extend({voltage:_h.optional(),frequency:Xp.optional(),peakToPeakVoltage:_h.optional(),waveShape:bt(["sinewave","square","triangle","sawtooth"]).optional(),phase:ii.optional(),dutyCycle:tNo.optional(),pulseDelay:wc.optional(),riseTime:wc.optional(),fallTime:wc.optional(),pulseWidth:wc.optional(),period:wc.optional(),acMagnitude:_h.optional(),acPhase:ii.optional(),connections:b3(eNo).optional()});yn(!0);var nNo=["pin1","pin2","pos","neg"],oNo=an([k(),ge()]).transform((e)=>{if(typeof e==="string"){if(e.endsWith("%"))return parseFloat(e.slice(0,-1))/100;return parseFloat(e)}return e}).pipe(ge().min(0,"Duty cycle must be non-negative").max(1,"Duty cycle cannot be greater than 100%")),VPt=Du.extend({current:l1.optional(),frequency:Xp.optional(),peakToPeakCurrent:l1.optional(),waveShape:bt(["sinewave","square","triangle","sawtooth"]).optional(),phase:ii.optional(),dutyCycle:oNo.optional(),acMagnitude:l1.optional(),acPhase:ii.optional(),connections:b3(nNo).optional()});yn(!0);var YPt=Du.omit({name:!0}).extend({name:k().optional(),connectsTo:k(),referenceTo:k().optional(),color:k().optional(),graphDisplayName:k().optional(),graphCenter:ge().optional(),graphVerticalOffset:ge().or(k()).optional(),graphVoltagePerDiv:ge().or(k()).optional()});yn(!0);var rNo=["pin1","pin2","pos","neg"],iNo=(e)=>e.pos!==void 0&&e.neg!==void 0||e.pin1!==void 0&&e.pin2!==void 0,GPt=Du.extend({connections:b3(rNo).refine(iNo,"Ammeter connections must include either pos/neg or pin1/pin2"),color:k().optional(),graphDisplayName:k().optional(),graphCenter:ge().optional(),graphVerticalOffset:ge().or(k()).optional(),graphCurrentPerDiv:ge().or(k()).optional()});yn(!0);var UPt=Ee({center:jo,radius:Ke,startAngleDegrees:ii,endAngleDegrees:ii,direction:bt(["clockwise","counterclockwise"]).default("counterclockwise"),strokeWidth:Ke.optional(),color:k().optional(),isDashed:Be().optional().default(!1)});yn(!0);var b7s=Ee({children:Sd().optional()});yn(!0);var WPt=Ee({name:k().optional(),chipRef:k().optional(),pinLabels:mze.optional(),schPinArrangement:a1e.optional(),schPinStyle:Pse.optional(),schX:Ke.optional(),schY:Ke.optional(),schSectionName:k().optional(),schSheetName:k().optional(),width:Ke.optional(),height:Ke.optional(),overlay:st(k()).optional(),padding:Ke.optional(),paddingLeft:Ke.optional(),paddingRight:Ke.optional(),paddingTop:Ke.optional(),paddingBottom:Ke.optional(),title:k().optional(),titleAlignment:lS.default("top_left"),titleColor:k().optional(),titleFontSize:Ke.optional(),titleInside:Be().default(!1),strokeStyle:bt(["solid","dashed"]).default("solid")}).refine((e)=>e.width!==void 0&&e.height!==void 0||Array.isArray(e.overlay)&&e.overlay.length>0,{message:"Must provide either both `width` and `height`, or a non-empty `overlay` array."}).refine((e)=>!(e.width!==void 0&&e.height!==void 0&&Array.isArray(e.overlay)&&e.overlay.length>0),{message:"Cannot provide both `width`/`height` and `overlay` at the same time."});yn(!0);var sNo=cc().pipe(Ss(k(),bO)).refine((e)=>Object.keys(e).length>0,{message:"connections must map at least one schematic symbol port"}),XPt=Ee({name:k().min(1),displayName:k().optional(),chipRef:k().min(1).optional(),symbolName:k().min(1),connections:sNo.optional(),schX:Yn.optional(),schY:Yn.optional(),schRotation:ii.optional(),schSectionName:k().optional(),schSheetName:k().optional()});yn(!0);var jPt=Ee({center:jo,radius:Ke,strokeWidth:Ke.optional(),color:k().optional(),isFilled:Be().optional().default(!1),fillColor:k().optional(),isDashed:Be().optional().default(!1)});yn(!0);var KPt=Ee({schX:Ke.optional(),schY:Ke.optional(),width:Ke,height:Ke,rotation:ii.default(0),strokeWidth:Ke.optional(),color:k().optional(),isFilled:Be().optional().default(!1),fillColor:k().optional(),isDashed:Be().optional().default(!1)});yn(!0);var $Pt=Ee({x1:Ke,y1:Ke,x2:Ke,y2:Ke,strokeWidth:Ke.optional(),color:k().optional(),isDashed:Be().optional().default(!1),dashLength:Ke.optional(),dashGap:Ke.optional()});yn(!0);var aNo=bt(["center","left","right","top","bottom"]),qPt=Ee({schX:Ke.optional(),schY:Ke.optional(),text:k(),fontSize:ge().default(1),anchor:an([aNo.describe("legacy"),lS]).default("center"),color:k().default("#000000"),schRotation:ii.default(0)});yn(!0);var JPt=Ee({points:st(jo).optional(),svgPath:k().optional(),strokeWidth:Ke.optional(),strokeColor:k().optional(),dashLength:Ke.optional(),dashGap:Ke.optional(),isFilled:Be().optional().default(!1),fillColor:k().optional()});yn(!0);var ZPt=Ee({schX:Ke.optional(),schY:Ke.optional(),children:Sd().optional(),cellPadding:Ke.optional(),borderWidth:Ke.optional(),anchor:lS.optional(),fontSize:Ke.optional()});yn(!0);var eEt=Ee({children:Sd().optional(),height:Ke.optional()});yn(!0);var tEt=Ee({children:k().optional(),horizontalAlign:bt(["left","center","right"]).optional(),verticalAlign:bt(["top","middle","bottom"]).optional(),fontSize:Ke.optional(),rowSpan:ge().optional(),colSpan:ge().optional(),width:Ke.optional(),text:k().optional()});yn(!0);var nEt=Ee({displayName:k().optional(),name:k(),sectionTitleFontSize:Ke.optional()});yn(!0);var oEt=Ee({name:k().optional(),displayName:k().optional(),sheetIndex:ge().optional(),sheetSize:bt(["A4","ANSI_B"]).default("A4"),sheetWidth:Ke.pipe(ge().positive()).optional(),sheetHeight:Ke.pipe(ge().positive()).optional(),children:Sd().optional()});yn(!0);var cNo=Tu.refine((e)=>e.trim().length>0,{message:"imageUrl cannot be empty"}),O7t=(e)=>Yn.refine((t)=>Number.isFinite(t)&&t>0,{message:`${e} must be a positive finite distance`}),rEt=Ee({imageUrl:cNo.optional(),svgContent:k().refine((e)=>e.trim().length>0,{message:"svgContent cannot be empty"}).optional(),width:O7t("width").optional(),height:O7t("height").optional()}).superRefine(({imageUrl:e,svgContent:t},n)=>{if(e===void 0&&t===void 0)n.addIssue({code:Gt.custom,message:"At least one of imageUrl or svgContent is required"})});yn(!0);var iEt=Fs.extend({text:k(),anchorAlignment:lS.default("center"),font:bt(["tscircuit2024"]).optional(),fontSize:ve.optional(),layers:st(Lo).optional(),knockout:Be().optional(),mirrored:Be().optional()}),sEt=Fs.extend({text:k(),anchorAlignment:lS.default("center"),font:bt(["tscircuit2024"]).optional(),fontSize:ve.optional(),isKnockout:Be().optional(),knockoutPadding:ve.optional(),knockoutPaddingLeft:ve.optional(),knockoutPaddingRight:ve.optional(),knockoutPaddingTop:ve.optional(),knockoutPaddingBottom:ve.optional(),layers:st(Lo).optional()}),aEt=Fs.omit({pcbLeftEdgeX:!0,pcbRightEdgeX:!0,pcbTopEdgeY:!0,pcbBottomEdgeY:!0,pcbX:!0,pcbY:!0,pcbOffsetX:!0,pcbOffsetY:!0,pcbRotation:!0}).extend({route:st(r2),strokeWidth:ve.optional()}),cEt=Fs.omit({pcbX:!0,pcbY:!0,pcbOffsetX:!0,pcbOffsetY:!0,pcbRotation:!0}).extend({strokeWidth:Ke,x1:Ke,y1:Ke,x2:Ke,y2:Ke}),lEt=Fs.omit({pcbRotation:!0}).extend({filled:Be().default(!0).optional(),stroke:bt(["dashed","solid","none"]).optional(),strokeWidth:Ke.optional(),width:Ke,height:Ke,cornerRadius:Ke.optional()}),hEt=Fs.omit({pcbRotation:!0}).extend({isFilled:Be().optional(),isOutline:Be().optional(),strokeWidth:Ke.optional(),radius:Ke}),dEt=Fs.omit({layer:!0,pcbStyle:!0,pcbSx:!0}).extend({imageUrl:Tu,width:Yn,height:Yn,layer:jp.optional()});yn(!0);var V7t=Ee({x:Ke,y:Ke,via:Be().optional(),toLayer:Lo.optional()}),uEt=Ee({for:k().optional().describe("Selector for the port you're targeting, not required if you're inside a trace"),order:ge().optional(),offset:r2.or(V7t).optional(),offsets:st(r2).or(st(V7t)).optional(),traceWidth:ge().optional()}),pEt=s1e.extend({name:k().optional(),pinNumber:ge().optional(),schStemLength:ge().optional(),schPinLabelFontSize:bt(["default","sm"]).or(Ke.refine((e)=>Number.isFinite(e)&&e>0,{message:"Schematic pin-label font size must be positive and finite"})).optional(),aliases:st(k()).optional(),layer:k().optional(),layers:st(k()).optional(),schX:ge().optional(),schY:ge().optional(),direction:vBo.optional(),connectsTo:k().or(st(k())).optional(),kicadPinMetadata:pTo.optional(),hasInversionCircle:Be().optional()}),mEt=Fs.extend({text:k(),anchorAlignment:bt(["center","top_left","top_right","bottom_left","bottom_right"]).default("center"),font:bt(["tscircuit2024"]).optional(),fontSize:ve.optional(),color:k().optional()});yn(!0);var _Et=Fs.omit({pcbRotation:!0}).extend({width:Ke,height:Ke,strokeWidth:Ke.optional(),isFilled:Be().optional(),hasStroke:Be().optional(),isStrokeDashed:Be().optional(),color:k().optional(),cornerRadius:Ke.optional()});yn(!0);var gEt=Fs.omit({pcbLeftEdgeX:!0,pcbRightEdgeX:!0,pcbTopEdgeY:!0,pcbBottomEdgeY:!0,pcbX:!0,pcbY:!0,pcbOffsetX:!0,pcbOffsetY:!0,pcbRotation:!0}).extend({route:st(r2),strokeWidth:ve.optional(),color:k().optional()});yn(!0);var AEt=Fs.omit({pcbLeftEdgeX:!0,pcbRightEdgeX:!0,pcbTopEdgeY:!0,pcbBottomEdgeY:!0,pcbX:!0,pcbY:!0,pcbOffsetX:!0,pcbOffsetY:!0,pcbRotation:!0}).extend({x1:Ke,y1:Ke,x2:Ke,y2:Ke,strokeWidth:Ke.optional(),color:k().optional(),isDashed:Be().optional()});yn(!0);var Y7t=an([k(),Yy]),fEt=Fs.omit({pcbLeftEdgeX:!0,pcbRightEdgeX:!0,pcbTopEdgeY:!0,pcbBottomEdgeY:!0,pcbX:!0,pcbY:!0,pcbOffsetX:!0,pcbOffsetY:!0,pcbRotation:!0}).extend({from:Y7t,to:Y7t,text:k().optional(),offset:Ke.optional(),offsetDirection:Ee({x:ge().finite(),y:ge().finite()}).optional(),font:bt(["tscircuit2024"]).optional(),fontSize:ve.optional(),color:k().optional(),arrowSize:Ke.optional(),units:bt(["in","mm"]).optional(),outerEdgeToEdge:ce(!0).optional(),centerToCenter:ce(!0).optional(),innerEdgeToEdge:ce(!0).optional()});yn(!0);var yEt=st(Sd()).describe("Circuit JSON"),ize=Ee({footprintCircuitJson:st(Sd()),cadModel:CO.optional()}),G7t=xR().args(k()).returns(CR(ize)).or(xR().args(k(),Ee({resolvedPcbStyle:lze.optional()}).optional()).returns(CR(ize))).describe("A function that takes a path and returns Circuit JSON"),lNo=Ee({loadFromUrl:xR().args(k()).returns(CR(ize)).describe("A function that takes a footprint file URL and returns Circuit JSON")}),hNo=Ee({engineVersionString:k().optional(),simulationResultCircuitJson:yEt}),dNo=Ee({simulate:xR().args(k()).returns(CR(hNo)).describe("A function that takes a SPICE string and returns a simulation result")}),uNo=cc((e)=>typeof e==="string"),U7t=Ee({run:xR().args().returns(CR(Xz())).describe("Run the autorouter"),getOutputSimpleRouteJson:xR().args().returns(CR(Sd())).describe("Get the resulting SimpleRouteJson")}),pNo=Ee({createAutorouter:xR().args(Sd(),Sd().optional()).returns(an([U7t,CR(U7t)])).describe("Create an autorouter instance")}),mNo=cc((e)=>typeof e==="function").describe("A fetch-like function to use for platform requests"),_No=cc((e)=>typeof e==="object"&&e!==null&&("getItem"in e)&&typeof e.getItem==="function"&&("setItem"in e)&&typeof e.setItem==="function"),gNo=cc((e)=>typeof e==="object"&&e!==null&&("runDrcChecks"in e)&&typeof e.runDrcChecks==="function"),ANo=Ee({partsEngine:pSt.optional(),checkAvailability:Be().describe("Opt in to networked JLCPCB availability checks during rendering. Disabled by default; enabling adds non-deterministic diagnostics.").optional(),fabricatorEngine:gNo.optional(),autorouter:l1e.optional(),autorouterMap:Ss(k(),pNo).optional(),allowLegacyAutorouters:Be().optional(),registryApiUrl:Tu.optional(),cloudAutorouterUrl:Tu.optional(),jscdnBaseUrl:Tu.optional(),projectName:k().optional(),projectBaseUrl:Tu.optional(),version:k().optional(),url:Tu.optional(),printBoardInformationToSilkscreen:Be().optional(),includeBoardFiles:st(k()).describe('The board files to automatically build with "tsci build", defaults to ["**/*.circuit.tsx"]. Can be an array of files or globs').optional(),snapshotsDir:k().describe('The directory where snapshots are stored for "tsci snapshot", defaults to "tests/__snapshots__"').optional(),defaultSpiceEngine:uNo.optional(),unitPreference:bt(["mm","in","mil"]).optional(),localCacheEngine:_No.optional(),useCloudAutorouter:Be().optional(),enablePartOrientationAnalysis:Be().optional(),pcbPackSolverTimeoutMs:ge().finite().positive().optional(),pcbDisabled:Be().optional(),routingDisabled:Be().optional(),schematicDisabled:Be().optional(),partsEngineDisabled:Be().optional(),analogSimulationDisabled:Be().optional(),drcChecksDisabled:Be().optional(),netlistDrcChecksDisabled:Be().optional(),routingDrcChecksDisabled:Be().optional(),placementDrcChecksDisabled:Be().optional(),pinSpecificationDrcChecksDisabled:Be().optional(),spiceEngineMap:Ss(k(),dNo).optional(),footprintLibraryMap:Ss(k(),an([G7t,Ss(k(),an([yEt,G7t]))])).optional(),footprintFileParserMap:Ss(k(),lNo).optional(),resolveProjectStaticFileImportUrl:xR().args(k()).returns(CR(k())).describe("A function that returns a string URL for static files for the project").optional(),platformFetch:mNo.optional()});yn(!0);var fNo=ANo,bSs=fNo.pick({projectName:!0,projectBaseUrl:!0,version:!0,url:!0,printBoardInformationToSilkscreen:!0,includeBoardFiles:!0,snapshotsDir:!0,defaultSpiceEngine:!0,pcbDisabled:!0,schematicDisabled:!0,analogSimulationDisabled:!0});yn(!0);qt();be();var Dse=new Set,fze=!1;function V9(e,t,n=2){let o=t&&t.length,r=o?t[0]*n:e.length;if(Dse.size)Dse.clear();let i=IEt(e,0,r,n,!0),s=[];if(!i||i.next===i.prev)return s;let a=0,c=0,l=0;if(o)i=INo(e,t,i,n);if(e.length>80*n){a=e[0],c=e[1];let h=a,d=c;for(let u=n;u<r;u+=n){let _=e[u],p=e[u+1];if(_<a)a=_;if(p<c)c=p;if(_>h)h=_;if(p>d)d=p}l=Math.max(h-a,d-c),l=l!==0?32767/l:0}return yze(i,s,a,c,l),s}function IEt(e,t,n,o,r){let i=null;if(r===kNo(e,t,n,o)>0)for(let s=t;s<n;s+=o)i=bEt(s/o|0,e[s],e[s+1],i);else for(let s=n-o;s>=t;s-=o)i=bEt(s/o|0,e[s],e[s+1],i);if(i&&Nse(i,i.next))Qse(i),i=i.next;return i}function vO(e,t=e){let n=t===e,o=e,r;do if(r=!1,o!==o.next&&(Dse.size===0||!Dse.has(o))&&(Nse(o,o.next)||w_(o.prev,o,o.next)===0)){if(n||o===t)t=o.prev;fze=!0,Qse(o),o=o.prev,r=!0}else if(n||o!==t)o=o.next,r=!n;while(r||o!==t);return t}function yze(e,t,n,o,r){if(r)BNo(e,n,o,r);let i=e,s=!1;while(e.prev!==e.next){let a=e.prev,c=e.next;if(w_(a,e,c)<0&&(r?xNo(e,n,o,r):yNo(e))){t.push(a.i,e.i,c.i),Qse(e),e=c,i=c;continue}if(e=c,e===i){if(fze=!1,e=vO(e),fze){i=e;continue}if(!s){e=CNo(e,t),i=e,s=!0;continue}bNo(e,t,n,o,r);break}}}function yNo(e){let t=e.prev,n=e,o=e.next,r=t.x,i=n.x,s=o.x,a=t.y,c=n.y,l=o.y,h=Math.min(r,i,s),d=Math.min(a,c,l),u=Math.max(r,i,s),_=Math.max(a,c,l),p=o.next;while(p!==t){if(p.x>=h&&p.x<=u&&p.y>=d&&p.y<=_&&!(r===p.x&&a===p.y)&&A1e(r,a,i,c,s,l,p.x,p.y)&&w_(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function xNo(e,t,n,o){let r=e.prev,i=e,s=e.next,a=r.x,c=i.x,l=s.x,h=r.y,d=i.y,u=s.y,_=Math.min(a,c,l),p=Math.min(h,d,u),m=Math.max(a,c,l),A=Math.max(h,d,u),g=Ize(_,p,t,n,o),f=Ize(m,A,t,n,o),y=e.prevZ;while(y&&y.z>=g){if(y.x>=_&&y.x<=m&&y.y>=p&&y.y<=A&&y!==s&&!(a===y.x&&h===y.y)&&A1e(a,h,c,d,l,u,y.x,y.y)&&w_(y.prev,y,y.next)>=0)return!1;y=y.prevZ}let x=e.nextZ;while(x&&x.z<=f){if(x.x>=_&&x.x<=m&&x.y>=p&&x.y<=A&&x!==s&&!(a===x.x&&h===x.y)&&A1e(a,h,c,d,l,u,x.x,x.y)&&w_(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function CNo(e,t){let n=e,o=!1;do{let r=n.prev,i=n.next.next;if(PEt(r,n,n.next,i,!1)&&Rse(r,i)&&Rse(i,r))t.push(r.i,n.i,i.i),Qse(n),Qse(n.next),n=e=i,o=!0;n=n.next}while(n!==e);return o?vO(n):n}function bNo(e,t,n,o,r){let i=e;do{let s=i.next.next;while(s!==i.prev){if(i.i!==s.i&&NNo(i,s)){let a=EEt(i,s);i=vO(i,i.next),a=vO(a,a.next),yze(i,t,n,o,r),yze(a,t,n,o,r);return}s=s.next}i=i.next}while(i!==e)}var xze=!1;function INo(e,t,n,o){let r=[];for(let i=0,s=t.length;i<s;i++){let a=t[i]*o,c=i<s-1?t[i+1]*o:e.length,l=IEt(e,a,c,o,!1);if(l===l.next)Dse.add(l);r.push(DNo(l))}r.sort(vNo),PNo(e.length/o,t.length),SEt(n,n),xze=!0;for(let i=0;i<r.length;i++)n=SNo(r[i],n);return xze=!1,vO(n)}function vNo(e,t){return e.x-t.x||e.y-t.y||(e.next.y-e.y)/(e.next.x-e.x)-(t.next.y-t.y)/(t.next.x-t.x)}function SNo(e,t){let n=MNo(e,t);if(!n)return t;let o=EEt(n,e),r=o.next;return SEt(n,r.next),vO(o,o.next),vO(n,n.next)}var vEt=16,em=new Float64Array(0),g1e=0,Cze=[],bze=[];function PNo(e,t){let n=Math.ceil((e+2*t)/vEt)+t+2;if(em.length<n*4)em=new Float64Array(n*4);g1e=0}function SEt(e,t){let n=e;do{let o=g1e++;Cze[o]=n;let r=n.x,i=n.y,s=n.x,a=n.y,c=0;do{let h=n.next;if(n.z=o,h.x<r)r=h.x;if(h.x>s)s=h.x;if(h.y<i)i=h.y;if(h.y>a)a=h.y;n=h}while(++c<vEt&&n!==t);bze[o]=n;let l=o*4;em[l]=r,em[l+1]=i,em[l+2]=s,em[l+3]=a}while(n!==t)}function ENo(e,t){let n=e.z*4;if(t.x<em[n])em[n]=t.x;if(t.y<em[n+1])em[n+1]=t.y;if(t.x>em[n+2])em[n+2]=t.x;if(t.y>em[n+3])em[n+3]=t.y}function xEt(e){let t=bze[e];while(t.prev.next!==t)t=t.next;return bze[e]=t,t}function CEt(e){let t=Cze[e];while(t.prev.next!==t)t=t.next;return Cze[e]=t,t}function MNo(e,t){let n=t,{x:o,y:r}=e,i=-1/0,s;if(Nse(e,n))return n;for(let u=0,_=0;u<g1e;u++,_+=4){if(r<em[_+1]||r>em[_+3]||em[_]>o||em[_+2]<=i)continue;let p=xEt(u);n=CEt(u);do{if(n.prev.next===n){if(Nse(e,n.next))return n.next;else if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){let m=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(m<=o&&m>i){if(i=m,s=n.x<n.next.x?n:n.next,m===o)return s}}}n=n.next}while(n!==p)}if(!s)return null;let a=s.x,c=s.y,l=Math.min(r,c),h=Math.max(r,c),d=1/0;for(let u=0,_=0;u<g1e;u++,_+=4){if(em[_+2]<a||em[_]>o||em[_+3]<l||em[_+1]>h)continue;let p=xEt(u);n=CEt(u);do{if(n.prev.next===n&&o>=n.x&&n.x>=a&&o!==n.x&&A1e(r<c?o:i,r,a,c,r<c?i:o,r,n.x,n.y)){let m=Math.abs(r-n.y)/(o-n.x);if((Rse(n,e)||n.y===r&&n.next.y===r&&n.next.x>o)&&(m<d||m===d&&(n.x>s.x||n.x===s.x&&wNo(s,n))))s=n,d=m}n=n.next}while(n!==p)}return s}function wNo(e,t){return w_(e.prev,e,t.prev)<0&&w_(t.next,e,e.next)<0}var I3=[],aK=[],IO=new Uint32Array(0),Bse=new Uint32Array(0),Tse=new Uint32Array(256);function BNo(e,t,n,o){let r=e,i=0;do r.z=Ize(r.x,r.y,t,n,o),I3[i++]=r,r=r.next;while(r!==e);TNo(i);let s=null;for(let a=0;a<i;a++){let c=I3[a];if(c.prevZ=s,s)s.nextZ=c;s=c}s.nextZ=null,I3.fill(null,0,i),aK.fill(null,0,i)}function TNo(e){if(e<=32){for(let t=1;t<e;t++){let n=I3[t],o=n.z,r=t-1;while(r>=0&&I3[r].z>o)I3[r+1]=I3[r],r--;I3[r+1]=n}return}if(IO.length<e)IO=new Uint32Array(e),Bse=new Uint32Array(e),aK=Array(e);for(let t=0;t<e;t++)IO[t]=I3[t].z;m1e(e,I3,IO,aK,Bse,0),m1e(e,aK,Bse,I3,IO,8),m1e(e,I3,IO,aK,Bse,16),m1e(e,aK,Bse,I3,IO,24)}function m1e(e,t,n,o,r,i){Tse.fill(0);for(let a=0;a<e;a++)Tse[n[a]>>>i&255]++;let s=0;for(let a=0;a<256;a++){let c=Tse[a];Tse[a]=s,s+=c}for(let a=0;a<e;a++){let c=n[a],l=Tse[c>>>i&255]++;o[l]=t[a],r[l]=c}}function Ize(e,t,n,o,r){return e=(e-n)*r|0,t=(t-o)*r|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function DNo(e){let t=e,n=e;do{if(t.x<n.x||t.x===n.x&&t.y<n.y)n=t;t=t.next}while(t!==e);return n}function A1e(e,t,n,o,r,i,s,a){return(r-s)*(t-a)>=(e-s)*(i-a)&&(e-s)*(o-a)>=(n-s)*(t-a)&&(n-s)*(i-a)>=(r-s)*(o-a)}function NNo(e,t){let n=Nse(e,t)&&w_(e.prev,e,e.next)>0&&w_(t.prev,t,t.next)>0;return e.next.i!==t.i&&(n||Rse(e,t)&&Rse(t,e)&&(w_(e.prev,e,t.prev)!==0||w_(e,t.prev,t)!==0))&&!RNo(e,t)&&(n||QNo(e,t))}function w_(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function Nse(e,t){return e.x===t.x&&e.y===t.y}function PEt(e,t,n,o,r=!0){let i=w_(e,t,n),s=w_(e,t,o),a=w_(n,o,e),c=w_(n,o,t);if((i>0&&s<0||i<0&&s>0)&&(a>0&&c<0||a<0&&c>0))return!0;if(!r)return!1;if(i===0&&_1e(e,n,t))return!0;if(s===0&&_1e(e,o,t))return!0;if(a===0&&_1e(n,e,o))return!0;if(c===0&&_1e(n,t,o))return!0;return!1}function _1e(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function RNo(e,t){let n=Math.min(e.x,t.x),o=Math.max(e.x,t.x),r=Math.min(e.y,t.y),i=Math.max(e.y,t.y),s=e;do{let a=s.next;if(s.x>o&&a.x>o||s.x<n&&a.x<n||s.y>i&&a.y>i||s.y<r&&a.y<r){s=a;continue}if(s.i!==e.i&&a.i!==e.i&&s.i!==t.i&&a.i!==t.i&&PEt(s,a,e,t))return!0;s=a}while(s!==e);return!1}function Rse(e,t){return w_(e.prev,e,e.next)<0?w_(e,t,e.next)>=0&&w_(e,e.prev,t)>=0:w_(e,t,e.prev)<0||w_(e,e.next,t)<0}function QNo(e,t){let n=e,o=!1,r=(e.x+t.x)/2,i=(e.y+t.y)/2;do{let s=n.next;if(n.y>i!==s.y>i&&r<(s.x-n.x)*(i-n.y)/(s.y-n.y)+n.x)o=!o;n=s}while(n!==e);return o}function EEt(e,t){let n=vze(e.i,e.x,e.y),o=vze(t.i,t.x,t.y),r=e.next,i=t.prev;return e.next=t,t.prev=e,n.next=r,r.prev=n,o.next=n,n.prev=o,i.next=o,o.prev=i,o}function bEt(e,t,n,o){let r=vze(e,t,n);if(!o)r.prev=r,r.next=r;else r.next=o.next,r.prev=o,o.next.prev=r,o.next=r;return r}function Qse(e){if(e.next.prev=e.prev,e.prev.next=e.next,e.prevZ)e.prevZ.nextZ=e.nextZ;if(e.nextZ)e.nextZ.prevZ=e.prevZ;if(xze)ENo(e.prev,e.next)}function vze(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null}}function kNo(e,t,n,o){let r=0;for(let i=t,s=n-o;i<n;i+=o)r+=(e[s]-e[i])*(e[i+1]+e[s+1]),s=i;return r}qt();qt();be();be();be();be();var MEt={in:25.4,inch:25.4,mil:0.0254,mm:1,m:1000,cm:10,ft:304.8,feet:304.8},ki=(e)=>{let t=typeof e==="number"?"mm":e.replace(/^[^a-zA-Z]+/g,"").toLowerCase();if(!t)t="mm";let n=typeof e==="number"?e:Number.parseFloat(e.split(t)[0]);if(t in MEt)return n*MEt[t];throw Error(`Unsupported unit: ${t}`)};var Zl=ki;qt();be();qt();be();qt();qt();be();qt();be();qt();be();qt();be();qt();be();qt();be();qt();be();qt();be();qt();be();be();qt();qt();be();qt();be();qt();qt();qt();be();be();qt();be();qt();be();qt();be();qt();be();be();qt();be();qt();be();qt();be();qt();be();qt();be();be();qt();qt();be();be();qt();qt();be();qt();be();qt();be();qt();be();qt();be();qt();be();qt();be();qt();be();qt();be();qt();be();be();qt();be();qt();be();qt();be();qt();be();qt();be();qt();be();qt();be();qt();be();qt();be();qt();be();qt();be();qt();be();qt();be();be();qt();be();qt();be();qt();be();qt();be();qt();be();qt();be();qt();be();qt();be();be();be();qt();be();be();qt();be();qt();be();qt();be();qt();be();qt();be();qt();be();qt();qt();be();qt();be();be();qt();be();qt();be();qt();be();be();qt();be();be();qt();qt();be();qt();be();qt();be();qt();be();be();qt();be();qt();be();be();be();qt();be();be();qt();be();qt();be();qt();be();var LNo=Object.defineProperty,HNo=(e,t)=>{for(var n in t)LNo(e,n,{get:t[n],enumerable:!0})},kw={};HNo(kw,{axial:()=>zQo,bga:()=>RRo,breakoutheaders:()=>oko,cap:()=>nRo,crystal:()=>rRo,d2pak:()=>JEt,dfn:()=>fQo,diode:()=>tRo,dip:()=>UNo,do219ad:()=>xQo,dpak:()=>qEt,electrolytic:()=>oFo,fpc:()=>sFo,hc49:()=>sko,headermodule:()=>IQo,jst:()=>fHo,lcc:()=>ezo,led:()=>iRo,led2835:()=>aRo,led5050:()=>lRo,lga:()=>tko,lqfp:()=>ZQo,m2host:()=>OFo,melf:()=>PLo,micromelf:()=>BLo,minimelf:()=>fLo,mlp:()=>jRo,mountedpcbmodule:()=>YFo,ms012:()=>MQo,ms013:()=>BQo,msop:()=>MHo,pad:()=>ako,pinrow:()=>uMt,platedhole:()=>wFo,potentiometer:()=>eFo,pushbutton:()=>XQo,qfn:()=>URo,qfp:()=>XRo,quad:()=>qR,radial:()=>YQo,res:()=>BRo,rj45:()=>UQo,sma:()=>RLo,smb:()=>VLo,smbf:()=>cFo,smc:()=>WLo,smdpads:()=>yFo,smdpinheader:()=>EFo,smdpushbutton:()=>CFo,smdslideswitch:()=>SFo,smf:()=>HLo,smtpad:()=>AFo,sod110:()=>xHo,sod123:()=>kQo,sod123f:()=>Uko,sod123fl:()=>Kko,sod123w:()=>Iko,sod128:()=>oLo,sod323:()=>Eko,sod323f:()=>Oko,sod323fl:()=>RHo,sod323he:()=>Tko,sod323w:()=>BHo,sod523:()=>pko,sod723:()=>Zko,sod80:()=>yko,sod882:()=>Lko,sod882d:()=>bLo,sod923:()=>Nko,soic:()=>kRo,solderjumper:()=>UHo,son:()=>HHo,sop8:()=>Ako,sot:()=>TFo,sot143:()=>RFo,sot223:()=>$Lo,sot23:()=>hQo,sot23w:()=>iHo,sot25:()=>mQo,sot323:()=>pFo,sot343:()=>LFo,sot363:()=>oQo,sot457:()=>jHo,sot563:()=>PQo,sot723:()=>DQo,sot886:()=>sQo,sot89:()=>pLo,sot963:()=>qHo,ssop:()=>qRo,stampboard:()=>KQo,stampreceiver:()=>JQo,to220:()=>gMt,to220f:()=>gLo,to252:()=>KNo,to263:()=>$No,to92:()=>dko,to92l:()=>XFo,to92s:()=>dHo,tqfp:()=>WRo,tssop:()=>eQo,usba:()=>qFo,usbcmidmount:()=>KFo,usbmicro:()=>ZFo,vson:()=>zHo,vssop:()=>SHo,wson:()=>GHo});var Jo=(e,t,n)=>({type:"pcb_silkscreen_text",pcb_silkscreen_text_id:"silkscreen_text_1",font:"tscircuit2024",font_size:n,pcb_component_id:"pcb_component_1",text:"{REF}",layer:"top",anchor_position:{x:e,y:t},anchor_alignment:"center"}),cK=k().or(st(Sd())).transform((e)=>{if(Array.isArray(e))return e;if(e.startsWith("(")&&e.endsWith(")"))e=e.slice(1,-1);return e.split(",").map((t)=>{let n=Number(t);return isNaN(n)?t:n})}).pipe(st(k().or(ge()))),FNo=bt(["leftside","rightside"]),zNo=bt(["topside","bottomside"]),ONo=bt(["left","right"]),VNo=bt(["top","bottom"]),KEt=cK.pipe(an([c1([FNo,VNo]),c1([zNo,ONo])])),Yo=Ee({norefdes:Be().optional().describe("disable reference designator label"),invert:Be().optional().describe("install the part backwards: for a pin header, the LONG pins pass through the board instead of the short ones. It does not change which side of the board the part is on — that is the component's `layer`"),faceup:Be().optional().describe("DEPRECATED, and a no-op for through-hole parts. It meant 'the male pin header should face upwards, out of the top layer', which is what a correctly mounted header does by default; its other effect was to delete the pins below the board, leaving a through-hole part that cannot be soldered into its own plated holes. Use `layer` for which side of the board a part is on, and `invert` to install it backwards"),nosilkscreen:Be().optional().describe("omit all silkscreen elements from the footprint"),rounded:ve.refine((e)=>e>=0,{message:"rounded radius must be non-negative"}).optional().describe("corner radius applied to all rectangular copper pads"),pin1location:KEt.optional().describe("rotate the footprint to place pin 1 on a requested side"),cathodepin:X7.number().pipe(an([ce(1),ce(2)])).optional().describe("identify which diode pad is the cathode"),anodepin:X7.number().pipe(an([ce(1),ce(2)])).optional().describe("identify which diode pad is the anode")}),Li=(e,t,n,o,r)=>({pcb_plated_hole_id:"",type:"pcb_plated_hole",shape:"circle",x:t,y:n,hole_diameter:ki(o),outer_diameter:ki(r),pcb_port_id:"",layers:["top","bottom"],port_hints:[e.toString()]}),Gy=(e)=>{let{pn:t,x:n,y:o,holeDiameter:r,rectPadWidth:i,rectPadHeight:s,holeOffsetX:a=0,holeOffsetY:c=0,rectBorderRadius:l}=e;return{pcb_plated_hole_id:"",type:"pcb_plated_hole",shape:"circular_hole_with_rect_pad",x:n,y:o,hole_diameter:ki(r),hole_shape:"circle",pad_shape:"rect",rect_pad_width:ki(i),rect_pad_height:ki(s),...l!==void 0&&{rect_border_radius:l},pcb_port_id:"",layers:["top","bottom"],port_hints:[t.toString()],hole_offset_x:a,hole_offset_y:c}},w1e=Array.from({length:9},(e,t)=>Math.cos(t/8*Math.PI-Math.PI)).map((e)=>({x:e,y:-Math.sqrt(1-e**2)})),Uy=(e)=>{if(e.length<2)throw Error("Rect union outline requires at least two bounds");for(let l of e)if(l.minX>=l.maxX||l.minY>=l.maxY)throw Error("Each rectangle bound must have min < max on both axes");for(let l=1;l<e.length;l++){let h=e[l-1],d=e[l];if(d.minX<h.minX||d.maxX>h.maxX||d.minY>h.minY||d.maxY<h.maxY)throw Error("Bounds must be ordered outer-to-inner with tighter X and larger Y span")}let t=()=>{let l=[],h=e.length-1;l.push({x:e[h].minX,y:e[h].maxY});while(h>0){let d=e[h],u=e[h-1];l.push({x:d.minX,y:u.maxY}),l.push({x:u.minX,y:u.maxY}),h-=1}return l},n=()=>{let l=[],h=e.length-1;l.push({x:e[h].maxX,y:e[h].maxY});while(h>0){let d=e[h],u=e[h-1];l.push({x:d.maxX,y:u.maxY}),l.push({x:u.maxX,y:u.maxY}),h-=1}return l},o=()=>{let l=[],h=e.length-1;l.push({x:e[h].maxX,y:e[h].minY});while(h>0){let d=e[h],u=e[h-1];l.push({x:d.maxX,y:u.minY}),l.push({x:u.maxX,y:u.minY}),h-=1}return l},r=()=>{let l=[],h=e.length-1;l.push({x:e[h].minX,y:e[h].minY});while(h>0){let d=e[h],u=e[h-1];l.push({x:d.minX,y:u.minY}),l.push({x:u.minX,y:u.minY}),h-=1}return l},i=t(),s=n(),a=o(),c=r();return[...i.reverse(),...s,...a.reverse(),...c]};function KR(e){if(typeof e==="string"){if(e.trim().toLowerCase().endsWith("mil"))return parseFloat(e)*0.0254;return parseFloat(e)}return Number(e)}var f1e=an([k(),ge()]).transform((e)=>KR(e)),YNo=(e)=>Yo.extend({fn:k(),num_pins:ge().optional().default(6),wide:Be().optional(),narrow:Be().optional(),w:f1e.optional(),p:f1e.default(e.p??"2.54mm"),id:f1e.optional(),od:f1e.optional(),nosquareplating:Be().optional().default(!1).describe("do not use rectangular pad for pin 1")}).transform((t)=>{if(!t.id&&!t.od)if(Math.abs(t.p-1.27)<0.01)t.id=KR("0.55mm"),t.od=KR("0.95mm");else t.id=KR("0.8mm"),t.od=KR("1.6mm");else if(!t.id)t.id=t.od*0.6666666666666666;else if(!t.od)t.od=t.id*1.5;if(!t.w)if(t.wide)t.w=KR("600mil");else if(t.narrow)t.w=KR("300mil");else t.w=KR(e.w??"300mil");return t}),GNo=YNo({}),wEt=(e,t,n,o,r)=>{let i=e/2,s=t<=i,a=i-1,c=o,l=c*a;if(s)return{x:-n/2,y:l/2-(t-1)*c};return{x:n/2,y:-l/2+(t-i-1)*c}},UNo=(e)=>{let t=GNo.parse(e),n=[];for(let g=0;g<t.num_pins;g++){let{x:f,y}=wEt(t.num_pins,g+1,t.w,t.p??2.54,t.nosquareplating);if(g===0&&!t.nosquareplating){n.push(Gy({pn:g+1,x:f,y,holeDiameter:t.id??"0.8mm",rectPadWidth:t.od??"1mm",rectPadHeight:t.od??"1mm"}));continue}n.push(Li(g+1,f,y,t.id??"0.8mm",t.od??"1mm"))}let o=(t.num_pins/2-1)*t.p+t.od,i=t.w-t.od-1,s=(t.num_pins/2-1)*t.p+t.od+0.4,a={layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"silkscreen_path_1",route:[{x:-i/2,y:-s/2},{x:-i/2,y:s/2},...w1e.map(({x:g,y:f})=>({x:g*i/6,y:f*i/6+s/2})),{x:i/2,y:s/2},{x:i/2,y:-s/2},{x:-i/2,y:-s/2}],type:"pcb_silkscreen_path",stroke_width:0.1},c=[];for(let g=0;g<t.num_pins;g++){let f=g+1,y=f<=t.num_pins/2,x=wEt(t.num_pins,f,t.w,t.p??2.54,t.nosquareplating),C=0.6,b=y?x.x-t.od/2-0.6:x.x+t.od/2+0.6,I=0.3;c.push({type:"pcb_fabrication_note_text",pcb_fabrication_note_text_id:`pin_${f}`,layer:"top",pcb_component_id:`pin_${f}`,text:`{pin${f}}`,anchor_position:{x:b,y:x.y+0.15},font_size:0.3,font:"tscircuit2024",anchor_alignment:y?"top_right":"top_left"})}let l=Jo(0,s/2+0.5,0.4),h=t.w+t.od,d=o,u=h/2+0.25,_=u,p=d/2+0.72,m=p,A={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",outline:Uy([{minX:-u,maxX:u,minY:-m,maxY:m},{minX:-_,maxX:_,minY:-p,maxY:p}]),layer:"top"};return{circuitJson:[...n,a,l,...c,A],parameters:t}},Ao=(e,t,n,o,r,i)=>({type:"pcb_smtpad",x:t,y:n,width:o,height:r,layer:"top",shape:"rect",...i!==void 0&&{corner_radius:i},pcb_smtpad_id:"",port_hints:Array.isArray(e)?e.map((s)=>s.toString()):[e.toString()]}),Es=(e,t={})=>({type:"pcb_silkscreen_path",layer:t.layer||"top",pcb_component_id:t.pcb_component_id||"",pcb_silkscreen_path_id:t.pcb_silkscreen_path_id||"",route:e,stroke_width:t.stroke_width||0.1}),WNo=Yo.extend({fn:k(),num_pins:an([ce(3),ce(6)]).default(3),p:ve.default("2.29mm").describe("pitch between adjacent lead positions"),pw:ve.default("1.6mm").describe("lead pad width along the pin column"),pl:ve.default("3mm").describe("lead pad length toward the package"),tabw:ve.default("6.2mm").describe("large tab pad width"),tabh:ve.default("5.8mm").describe("large tab pad height"),span:ve.default("6.85mm").describe("center-to-center distance from the leads to the tab"),w:ve.default("6.6mm").describe("package body width"),h:ve.default("6.5mm").describe("package body height"),string:k().optional()}),XNo={p:"2.54mm",pw:"1.5mm",pl:"3.5mm",tabw:"8.38mm",tabh:"10.7mm",span:"10.21mm",w:"10.1mm",h:"10.1mm"},jNo=(e)=>{if(e.num_pins===3||e.num_pins===6)return e.num_pins;let t=e.string?.match(/^(?:d2pak|to252|to263)_(\d+)/i),n=Number.parseInt(t?.[1]??"3",10);if(n===5||n===6)return 6;return 3},$Et=(e,t)=>{let n=WNo.parse({...t,...e,num_pins:jNo(e)}),{num_pins:o,p:r,pw:i,pl:s,tabw:a,tabh:c,span:l,w:h,h:d}=n,u=o===3?2:5,_=-l/2,p=l/2,m=[];for(let T=0;T<u;T++){let N=o===3?T*2+1:T+1,D=o===3?(1-T*2)*r:((u-1)/2-T)*r;m.push(Ao(N,_,D,s,i))}m.push(Ao(o===3?2:6,p,0,a,c));let A=-h/2,g=h/2,f=Math.min(_-s/2,p-a/2),y=Math.max(_+s/2,p+a/2),x=(o===3?r:(u-1)/2*r)+i/2,C=Math.max(x,c/2),b=Math.max(C,d/2)+0.2,I=[Es([{x:A,y:b},{x:g,y:b}]),Es([{x:A,y:-b},{x:g,y:-b}]),Es([{x:_-0.3,y:b+0.15},{x:_,y:b+0.45},{x:_+0.3,y:b+0.15}])],v=Math.min(f,A)-0.25,P=Math.max(y,g)+0.25,M=Math.max(C,d/2)+0.25,B={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:(v+P)/2,y:0},width:P-v,height:M*2,layer:"top"};return{circuitJson:[...m,...I,Jo(0,M+0.55,0.5),B],parameters:n}},qEt=(e)=>$Et(e),JEt=(e)=>$Et(e,XNo),KNo=qEt,$No=JEt,ZEt=[{imperial:"01005",metric:"0402",p_mm_min:0.5,pw_mm_min:0.4,ph_mm_min:0.3,w_mm_min:0.58,h_mm_min:0.21,courtyard_width_mm:1.2,courtyard_height_mm:0.6},{imperial:"0504",metric:"1310",p_mm_min:1.1,pw_mm_min:0.65,ph_mm_min:1.3,w_mm_min:0.58,h_mm_min:0.21},{imperial:"1812",metric:"4532",p_mm_min:4.275,pw_mm_min:1.125,ph_mm_min:3.4,w_mm_min:5.4,h_mm_min:3.4,courtyard_width_mm:5.9,courtyard_height_mm:3.9,rounded_pads:!0,nonpolarizedSilkscreen:{line_half_length_mm:1.386252,line_y_mm:1.71,stroke_width_mm:0.12}},{imperial:"0201",metric:"0603",p_mm_min:0.66,pw_mm_min:0.46,ph_mm_min:0.4,w_mm_min:0.9,h_mm_min:0.3,courtyard_width_mm:1.4,courtyard_height_mm:0.7,rounded_pads:!0},{imperial:"0402",metric:"1005",p_mm_min:1.02,pw_mm_min:0.54,ph_mm_min:0.64,w_mm_min:1.56,h_mm_min:0.64,courtyard_width_mm:1.86,courtyard_height_mm:0.94,rounded_pads:!0,nonpolarizedSilkscreen:{line_half_length_mm:0.153641,line_y_mm:0.38,stroke_width_mm:0.12}},{imperial:"0603",metric:"1608",p_mm_min:1.65,pw_mm_min:0.8,ph_mm_min:0.95,w_mm_min:2.45,h_mm_min:0.95,courtyard_width_mm:2.96,courtyard_height_mm:1.46,rounded_pads:!0,nonpolarizedSilkscreen:{line_half_length_mm:0.237258,line_y_mm:0.5225,stroke_width_mm:0.12}},{imperial:"0805",metric:"2012",p_mm_min:1.825,pw_mm_min:1.025,ph_mm_min:1.4,w_mm_min:2.8499999999999996,h_mm_min:1.4,courtyard_width_mm:3.36,courtyard_height_mm:1.9,rounded_pads:!0,nonpolarizedSilkscreen:{line_half_length_mm:0.227064,line_y_mm:0.735,stroke_width_mm:0.12}},{imperial:"1206",metric:"3216",p_mm_min:2.925,pw_mm_min:1.125,ph_mm_min:1.75,w_mm_min:4.05,h_mm_min:1.75,courtyard_width_mm:4.56,courtyard_height_mm:2.26,rounded_pads:!0,nonpolarizedSilkscreen:{line_half_length_mm:0.727064,line_y_mm:0.91,stroke_width_mm:0.12}},{imperial:"1210",metric:"3225",p_mm_min:2.925,pw_mm_min:1.125,ph_mm_min:2.65,w_mm_min:4.05,h_mm_min:2.65,courtyard_width_mm:4.56,courtyard_height_mm:3.16,rounded_pads:!0,nonpolarizedSilkscreen:{line_half_length_mm:0.723737,line_y_mm:1.355,stroke_width_mm:0.12}},{imperial:"2010",metric:"5025",p_mm_min:4.625,pw_mm_min:1.225,ph_mm_min:2.65,w_mm_min:5.85,h_mm_min:2.65,courtyard_width_mm:6.36,courtyard_height_mm:3.16,rounded_pads:!0,nonpolarizedSilkscreen:{line_half_length_mm:1.527064,line_y_mm:1.36,stroke_width_mm:0.12}},{imperial:"2512",metric:"6332",p_mm_min:5.925,pw_mm_min:1.225,ph_mm_min:3.35,w_mm_min:7.15,h_mm_min:3.35,courtyard_width_mm:7.66,courtyard_height_mm:3.86,rounded_pads:!0,nonpolarizedSilkscreen:{line_half_length_mm:2.177064,line_y_mm:1.71,stroke_width_mm:0.12}}],qNo=Object.fromEntries(ZEt.map((e)=>[e.metric,e])),JNo=Object.fromEntries(ZEt.map((e)=>[e.imperial,e])),BEt=(e,t)=>({type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:e,height:t,layer:"top"}),FSs=Yo.extend({fn:k().optional(),string:k().optional(),tht:Be(),p:ve.optional(),pw:ve.optional(),ph:ve.optional(),metric:Ke.optional(),imperial:Ke.optional(),w:ve.optional(),h:ve.optional(),cyw:ve.optional().describe("courtyard width"),cyh:ve.optional().describe("courtyard height"),nonpolarized:Be().optional(),textbottom:Be().optional(),roundedPads:Be().optional()}),B1e=(e)=>{let{fn:t,tht:n,p:o,pw:r,ph:i,metric:s,imperial:a,w:c,h:l,cyw:h,cyh:d,nonpolarized:u,textbottom:_,roundedPads:p,string:m}=e;if(typeof c==="string")c=Zl(c);if(typeof l==="string")l=Zl(l);if(typeof h==="string")h=Zl(h);if(typeof d==="string")d=Zl(d);if(typeof o==="string")o=Zl(o);if(typeof r==="string")r=Zl(r);if(typeof i==="string")i=Zl(i);if(l!==void 0&&c!==void 0&&l>c)throw Error("height cannot be greater than width (rotated footprint not yet implemented)");let A;if(s)A=qNo[s];if(a)A=JNo[a];if(A)c=A.w_mm_min,l=A.h_mm_min,o=A.p_mm_min,r=A.pw_mm_min,i=A.ph_mm_min;if(o===void 0||r===void 0||i===void 0)throw Error("Could not determine required pad dimensions (p, pw, ph)");let g=[],f=t==="res"&&(u===!0||typeof m!=="string"||/^res(?:\d{4}|\d{5})(?:_|$)/i.test(m))?A?.nonpolarizedSilkscreen:void 0;if(f?.stroke_width_mm){let{line_half_length_mm:v=0,line_y_mm:P=0,stroke_width_mm:M}=f;g=[{type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:-v,y:P},{x:v,y:P}],stroke_width:M,pcb_silkscreen_path_id:""},{type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:-v,y:-P},{x:v,y:-P}],stroke_width:M,pcb_silkscreen_path_id:""}]}else g=[{type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:o/2,y:i/2+0.4},{x:-o/2-r/2-0.2,y:i/2+0.4},{x:-o/2-r/2-0.2,y:-i/2-0.4},{x:o/2,y:-i/2-0.4}],stroke_width:0.1,pcb_silkscreen_path_id:""}];let y=_?-i/2-0.9:i/2+0.9,x=Jo(0,y,0.2),C=A?.courtyard_width_mm&&A.courtyard_height_mm?BEt(A.courtyard_width_mm,A.courtyard_height_mm):h!==void 0&&d!==void 0?BEt(h,d):null,I=p??A?.rounded_pads??!1?Math.min(0.125,Math.min(r,i)/8):void 0;if(n)return[Li(1,-o/2,0,r,r*1/0.8),Li(2,o/2,0,r,r*1/0.8),...g,x,...C?[C]:[]];return[Ao(["1","left"],-o/2,0,r,i,I),Ao(["2","right"],o/2,0,r,i,I),...g,x,...C?[C]:[]]},ZNo=(e)=>{let{POSITIVE_INFINITY:t,NEGATIVE_INFINITY:n,POSITIVE_INFINITY:o,NEGATIVE_INFINITY:r}=Number;for(let i of e){if(i.type==="pcb_smtpad")t=Math.min(t,i.x-i.width/2),n=Math.max(n,i.x+i.width/2),o=Math.min(o,i.y-i.height/2),r=Math.max(r,i.y+i.height/2);if(i.type==="pcb_plated_hole")t=Math.min(t,i.x-i.outer_diameter/2),n=Math.max(n,i.x+i.outer_diameter/2),o=Math.min(o,i.y-i.outer_diameter/2),r=Math.max(r,i.y+i.outer_diameter/2)}if(!Number.isFinite(t)||!Number.isFinite(n)||!Number.isFinite(o)||!Number.isFinite(r))throw Error("Could not determine diode copper bounds");return{minX:t,maxX:n,minY:o,maxY:r}},Dze=(e,t={})=>T1e(ZNo(e),t),eRo=({anodePin:e,cathodePin:t})=>{if(e!==void 0&&e!==1&&e!==2)throw Error("Diode anode pin must be 1 or 2");if(t!==void 0&&t!==1&&t!==2)throw Error("Diode cathode pin must be 1 or 2");if(e!==void 0&&t!==void 0){if(e===t)throw Error("Diode anode and cathode cannot use the same pin");return t}if(t!==void 0)return t;if(e===1)return 2;if(e===2)return 1;return},X0=(e)=>{let t=e.p??e.pad_spacing;if(t===void 0||e.pl===void 0||e.pw===void 0)throw Error("Diode fabrication note requires p or pad_spacing, pl, and pw");let n=ve.parse(t),o=ve.parse(e.pl),r=ve.parse(e.pw);return T1e({minX:-n/2-o/2,maxX:n/2+o/2,minY:-r/2,maxY:r/2},{anodePin:e.anodepin,cathodePin:e.cathodepin})},T1e=(e,t={})=>{let n=[],o=e.maxX-e.minX,r=e.maxY-e.minY,i=(e.minX+e.maxX)/2,s=(e.minY+e.maxY)/2,c=eRo(t)===1?(b)=>2*i-b:(b)=>b,l=r*0.28,h=l*2,d=o*0.2,u=1.25,_=Math.min(d,h*1.25),p=i-_/2,m=i+_/2,A=_*0.18,g=p+A,f=m-A,y=Math.max(Math.min(o,r)*0.035,0.01),x=Math.max(Math.min(o,r)*0.25,0.1),C=(b)=>t.idSuffix?`${b}_${t.idSuffix}`:b;return n.push({type:"pcb_fabrication_note_path",pcb_fabrication_note_path_id:C("diode_fabrication_note_anode_leg"),pcb_component_id:"",layer:"top",stroke_width:y,route:[{x:c(p),y:s},{x:c(g),y:s}]},{type:"pcb_fabrication_note_path",pcb_fabrication_note_path_id:C("diode_fabrication_note_triangle"),pcb_component_id:"",layer:"top",stroke_width:y,route:[{x:c(g),y:s+l},{x:c(f),y:s},{x:c(g),y:s-l},{x:c(g),y:s+l}]},{type:"pcb_fabrication_note_path",pcb_fabrication_note_path_id:C("diode_fabrication_note_cathode"),pcb_component_id:"",layer:"top",stroke_width:y,route:[{x:c(f),y:s+l},{x:c(f),y:s-l}]},{type:"pcb_fabrication_note_path",pcb_fabrication_note_path_id:C("diode_fabrication_note_cathode_leg"),pcb_component_id:"",layer:"top",stroke_width:y,route:[{x:c(f),y:s},{x:c(m),y:s}]},{type:"pcb_fabrication_note_text",pcb_fabrication_note_text_id:C("diode_fabrication_note_positive"),pcb_component_id:"",layer:"top",font:"tscircuit2024",font_size:x,text:"+",anchor_position:{x:c(e.minX+o*0.125),y:s},anchor_alignment:"center"},{type:"pcb_fabrication_note_text",pcb_fabrication_note_text_id:C("diode_fabrication_note_negative"),pcb_component_id:"",layer:"top",font:"tscircuit2024",font_size:x,text:"-",anchor_position:{x:c(e.maxX-o*0.125),y:s},anchor_alignment:"center"}),n},tRo=(e)=>{let t=B1e({...e,roundedPads:!0}),{anodepin:n,cathodepin:o}=Yo.parse(e);return{circuitJson:t.concat(Dze(t,{anodePin:n,cathodePin:o})),parameters:e}},nRo=(e)=>({circuitJson:B1e(e),parameters:e}),oRo=Yo.extend({fn:ce("crystal"),num_pins:ce(4).default(4),px:ve.default("2.2mm").describe("horizontal pad center pitch"),py:ve.default("1.7mm").describe("vertical pad center pitch"),pw:ve.default("1.4mm").describe("pad width"),ph:ve.default("1.2mm").describe("pad height")}),rRo=(e)=>{let t=oRo.parse(e),{px:n,py:o,pw:r,ph:i}=t,s=[Ao(1,-n/2,-o/2,r,i),Ao(2,n/2,-o/2,r,i),Ao(3,n/2,o/2,r,i),Ao(4,-n/2,o/2,r,i)],a=(n+r)/2+0.2,c=(o+i)/2+0.2,l=Es([{x:-a,y:-c},{x:a,y:-c},{x:a,y:c},{x:-a,y:c},{x:-a,y:-c}]),h=Jo(0,c+0.6,0.5),d={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:n+r+0.5,height:o+i+0.5,layer:"top"};return{circuitJson:[...s,l,h,d],parameters:t}},iRo=(e)=>{let t=B1e(e),{anodepin:n,cathodepin:o}=Yo.parse(e);return{circuitJson:t.concat(Dze(t,{anodePin:n,cathodePin:o})).map((i)=>{if(i.type!=="pcb_silkscreen_path")return i;return{...i,route:i.route.map((s)=>({...s,x:-s.x}))}}),parameters:e}},sRo=Yo.extend({fn:ce("led2835"),num_pins:ce(2).default(2),p1w:ve.default("2.2mm").describe("pin 1 (anode) pad width"),p2w:ve.default("1.25mm").describe("pin 2 (cathode) pad width"),ph:ve.default("2.2mm").describe("pad height"),p1x:ve.default("-0.9mm").describe("pin 1 pad center x"),p2x:ve.default("1.375mm").describe("pin 2 pad center x"),w:ve.default("3.5mm").describe("package body width"),h:ve.default("2.8mm").describe("package body height")}),aRo=(e)=>{let t=sRo.parse(e),{p1w:n,p2w:o,ph:r,p1x:i,p2x:s,w:a,h:c}=t,l=[Ao(1,i,0,n,r),Ao(2,s,0,o,r)],h=a/2+0.45,d=c/2+0.2,u=[Es([{x:s-o/2,y:-d},{x:-h,y:-d},{x:-h,y:d},{x:s-o/2,y:d}])],_=Jo(0,d+0.8,0.5),p={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:(i-n/2+s+o/2)/2,y:0},width:s+o/2-(i-n/2)+0.5,height:Math.max(c,r)+0.5,layer:"top"},m=T1e({minX:Math.min(i-n/2,s-o/2),maxX:Math.max(i+n/2,s+o/2),minY:-r/2,maxY:r/2},{anodePin:t.anodepin,cathodePin:t.cathodepin});return{circuitJson:[...l,...u,_,p,...m],parameters:t}},cRo=Yo.extend({fn:ce("led5050"),num_pins:ce(6).default(6),p:ve.default("1.7mm").describe("pin pitch along each column"),rowspan:ve.default("4.8mm").describe("distance between pad columns"),pl:ve.default("2mm").describe("pad length across the package edge"),pw:ve.default("1.1mm").describe("pad width along the pin column"),w:ve.default("5mm").describe("package body width"),h:ve.default("5mm").describe("package body height")}),lRo=(e)=>{let t=cRo.parse(e),{p:n,rowspan:o,pl:r,pw:i,w:s,h:a}=t,c=[];for(let A=0;A<3;A++)c.push(Ao(A+1,-o/2,n-A*n,r,i)),c.push(Ao(6-A,o/2,n-A*n,r,i));let l=s/2,h=a/2+0.2,d=[Es([{x:-l,y:h},{x:l,y:h}]),Es([{x:-l,y:-h},{x:l,y:-h}]),Es([{x:-o/2-r/2-0.4,y:n+i/2},{x:-o/2-r/2-0.4,y:n-i/2}])],u=Jo(0,h+0.8,0.5),_={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:o+r+0.5,height:Math.max(a,2*n+i)+0.5,layer:"top"},m=[{color:"green",y:n},{color:"red",y:0},{color:"blue",y:-n}].flatMap(({color:A,y:g})=>T1e({minX:-o/2-r/2,maxX:o/2+r/2,minY:g-i/2,maxY:g+i/2},{idSuffix:A}));return{circuitJson:[...c,...d,u,_,...m],parameters:t}},lK=(e)=>{let{padSpacing:t,padWidth:n,padHeight:o,padPitch:r,numRows:i,textbottom:s,courtyardOutline:a}=e,c=[],l=(i-1)*(r/2);for(let M=0;M<i;M++)c.push(l-M*r);let h=[];c.forEach((M,B)=>{h.push(Ao(B+1,-t/2,M,n,o))}),c.slice().reverse().forEach((M,B)=>{h.push(Ao(B+i+1,t/2,M,n,o))});let d=Math.max(...c)+o/2+0.4,u=Math.min(...c)-o/2-0.4,_=-t/2-n/2-0.4,p=t/2+n/2+0.4,m={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:p*0.5,y:d},{x:_*0.5,y:d}],stroke_width:0.12,pcb_silkscreen_path_id:"silkscreen_top"},A={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:p*0.5,y:u},{x:_*0.5,y:u}],stroke_width:0.12,pcb_silkscreen_path_id:"silkscreen_bottom"},g=-t/2,f=Math.max(...c),y=0.2,x=g-n/2-0.1,C=f+o/2+0.1,b={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"pin1_marker",route:[{x,y:C},{x:x-y,y:C},{x,y:C+y},{x,y:C}],stroke_width:0.1},I=s?u-0.9:d+0.9,v=Jo(0,I,0.2),P=a?{type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",layer:"top",outline:a}:null;return[...h,m,A,b,v,...P?[P]:[]]},hRo=Yo.extend({pw:ve.default("0.5mm"),ph:ve.default("0.4mm"),p:ve.default("0.7mm"),textbottom:Be().optional(),convex:Be().optional(),concave:Be().optional()}),dRo=1,uRo=(e)=>{let t=hRo.parse(e);if(t.concave===!0)return[];let n=Zl(t.pw),o=Zl(t.ph),r=Zl(t.p);return lK({padSpacing:dRo,padWidth:n,padHeight:o,padPitch:r,numRows:2,textbottom:t.textbottom,convex:t.convex,concave:t.concave,courtyardOutline:[{x:-1,y:0.95},{x:-1,y:-0.95},{x:1,y:-0.95},{x:1,y:0.95}]})},pRo=Yo.extend({pw:ve.default("0.5mm"),ph:ve.default("0.32mm"),p:ve.default("0.5mm"),textbottom:Be().optional(),convex:Be().optional(),concave:Be().optional()}),mRo=1,_Ro=(e)=>{let t=pRo.parse(e),n=Zl(t.pw),o=Zl(t.ph),r=Zl(t.p);return lK({padSpacing:mRo,padWidth:n,padHeight:o,padPitch:r,numRows:4,textbottom:t.textbottom,convex:t.convex,concave:t.concave,courtyardOutline:[{x:-1,y:1.25},{x:-1,y:-1.25},{x:1,y:-1.25},{x:1,y:1.25}]})},gRo=Yo.extend({pw:ve.default("0.9mm"),ph:ve.default("0.4mm"),p:ve.default("0.8mm"),textbottom:Be().optional(),convex:Be().optional(),concave:Be().optional()}),ARo=1.7,fRo=(e)=>{let t=gRo.parse(e),n=Zl(t.pw),o=Zl(t.ph),r=Zl(t.p);return lK({padSpacing:ARo,padWidth:n,padHeight:o,padPitch:r,numRows:2,textbottom:t.textbottom,convex:t.convex,concave:t.concave,courtyardOutline:[{x:-1.55,y:1.05},{x:-1.55,y:-1.05},{x:1.55,y:-1.05},{x:1.55,y:1.05}]})},yRo=Yo.extend({pw:ve.default("0.9mm"),ph:ve.default("0.4mm"),p:ve.default("0.8mm"),textbottom:Be().optional(),convex:Be().optional(),concave:Be().optional()}),xRo=1.7,CRo=(e)=>{let t=yRo.parse(e),n=Zl(t.pw),o=Zl(t.ph),r=Zl(t.p);return lK({padSpacing:xRo,padWidth:n,padHeight:o,padPitch:r,numRows:4,textbottom:t.textbottom,convex:t.convex,concave:t.concave,courtyardOutline:[{x:-1.55,y:1.88},{x:-1.55,y:-1.87},{x:1.55,y:-1.87},{x:1.55,y:1.88}]})},bRo=Yo.extend({pw:ve.default("0.7mm"),ph:ve.default("0.64mm"),p:ve.default("0.94mm"),textbottom:Be().optional(),convex:Be().optional(),concave:Be().optional()}),IRo=1.4,vRo=(e)=>{let t=bRo.parse(e),n=Zl(t.pw),o=Zl(t.ph),r=Zl(t.p);return lK({padSpacing:IRo,padWidth:n,padHeight:o,padPitch:r,numRows:2,textbottom:t.textbottom,convex:t.convex,concave:t.concave,courtyardOutline:[{x:-1.3,y:1.05},{x:-1.3,y:-1.05},{x:1.3,y:-1.05},{x:1.3,y:1.05}]})},SRo=Yo.extend({pw:ve.default("0.9mm"),ph:ve.default("0.9mm"),p:ve.default("1.34mm"),textbottom:Be().optional(),convex:Be().optional(),concave:Be().optional()}),PRo=3,ERo=(e)=>{let t=SRo.parse(e),n=Zl(t.pw),o=Zl(t.ph),r=Zl(t.p);return lK({padSpacing:PRo,padWidth:n,padHeight:o,padPitch:r,numRows:4,textbottom:t.textbottom,convex:t.convex,concave:t.concave,courtyardOutline:[{x:-2.21,y:2.85},{x:-2.21,y:-2.85},{x:2.2,y:-2.85},{x:2.2,y:2.85}]})},MRo=(e)=>{let t=e.array??e.x;if(typeof t==="number")return Number.isNaN(t)?void 0:t;if(typeof t==="string"){let n=Number.parseInt(t,10);return Number.isNaN(n)?void 0:n}if(typeof e.imperial==="string"){let o=e.imperial.match(/x(2|4)$/)?.[1];if(o)return Number.parseInt(o,10)}return},wRo=(e)=>{if(!e)return;return(typeof e==="number"?`${e}`:e).split(/[_x]/)[0]},BRo=(e)=>{let t=MRo(e),n=wRo(e.imperial);if(t===2&&n==="0402")return{circuitJson:uRo(e),parameters:e};if(t===4&&n==="0402")return{circuitJson:_Ro(e),parameters:e};if(t===2&&n==="0603")return{circuitJson:fRo(e),parameters:e};if(t===4&&n==="0603")return{circuitJson:CRo(e),parameters:e};if(t===2&&n==="0606")return{circuitJson:vRo(e),parameters:e};if(t===4&&n==="1206")return{circuitJson:ERo(e),parameters:e};return{circuitJson:B1e(e),parameters:e}},P1e=(e,{x:t,y:n,radius:o})=>({type:"pcb_smtpad",x:t,y:n,radius:o,layer:"top",shape:"circle",pcb_smtpad_id:"",port_hints:Array.isArray(e)?e.map((r)=>r.toString()):[e.toString()]}),TRo="ABCDEFGHIJKLMNOPQRSTUVWXYZ",p5=k().transform((e)=>{let[t,n]=e.split(/[x ]/);return{x:ve.parse(t??""),y:ve.parse(n??"")}}).pipe(Ee({x:ge(),y:ge()})),eMt="ABCDEFGHJKLMNPRTUVWY",tMt=(e,t=eMt)=>{let n=e+1,o="";while(n>0)n--,o=t[n%t.length]+o,n=Math.floor(n/t.length);return o},DRo=bt(["rowmajor","columnmajor","ballcoords"]),NRo=Yo.extend({fn:k(),num_pins:ge().optional().default(64),grid:p5.optional(),p:Ke.default("0.8mm"),w:ve.optional(),h:ve.optional(),ball:ve.optional().describe("ball diameter"),pad:ve.optional().describe("pad width/height"),circularpads:Be().optional().default(!0).describe("use circular pads"),tlorigin:Be().optional(),blorigin:Be().optional(),trorigin:Be().optional(),brorigin:Be().optional(),pinnumbering:xie((e)=>typeof e==="string"?e.trim().replace(/^\(([^()]*)\)$/,"$1"):e,DRo).optional().describe("rowmajor or columnmajor numeric IDs, or ball-coordinate IDs"),missing:cK.default([])}).transform((e,t)=>{let n="tl";if(e.blorigin)n="bl";if(e.trorigin)n="tr";if(e.brorigin)n="br";if(!e.grid){let i=Math.ceil(Math.sqrt(e.num_pins));e.grid={x:i,y:i}}let o=Array.from({length:e.grid.y},(i,s)=>tMt(s,e.pinnumbering?eMt:TRo));if(e.missing)e.missing=e.missing.map((i)=>{if(typeof i==="number")return i;if(i==="center")return"center";if(i==="topleft")return"topleft";let s=i.match(/^([A-Z]+)(\d+)$/);if(!s)return i;let a=o.indexOf(s[1]),c=Number.parseInt(s[2])-1;if(a<0||c<0||c>=e.grid.x)t.addIssue({code:Gt.custom,path:["missing"],message:`Missing ball ${i} is outside the BGA grid or row alphabet`});return a*e.grid.x+c+1});return{...e,origin:n,rowLabels:o}}),RRo=(e)=>{let t=NRo.parse(e),{num_pins:n,grid:o,p:r,w:i,h:s,ball:a,pad:c,missing:l}=t;a??=0.5905511811023622*r,c??=t.ball===void 0?r*0.5:a*0.8;let h=[],d=(l??[]).filter((U)=>typeof U==="number"),u=o.x*o.y-n;if(l.length===0&&u>0){if(Math.sqrt(u)%1===0)l.push("center");else if(u===1)l.push("topleft")}if(l?.includes("center")){let U=Math.floor(Math.sqrt(u)),j=Math.floor((o.x-U)/2),Y=Math.floor((o.y-U)/2);for(let X=Y;X<Y+U;X++)for(let K=j;K<j+U;K++)d.push(X*o.x+K+1)}if(l?.includes("topleft"))d.push(1);let _=new Set(d),p=Array.from({length:o.x*o.y},(U,j)=>j+1).filter((U)=>!_.has(U));if(t.pinnumbering==="columnmajor"){let U=(j)=>(j-1)%o.x*o.y+Math.floor((j-1)/o.x);p.sort((j,Y)=>U(j)-U(Y))}let m=new Map(p.map((U,j)=>[U,j+1]));for(let U=0;U<o.y;U++)for(let j=0;j<o.x;j++){let Y=(j-(o.x-1)/2)*r,X=(U-(o.y-1)/2)*r,K=j,J=U;switch(t.origin){case"bl":K=j,J=o.y-1-U;break;case"br":K=o.x-1-j,J=o.y-1-U;break;case"tr":K=o.x-1-j,J=U;break;case"tl":default:break}let ee=m.get(J*o.x+K+1);if(ee===void 0)continue;let se=`${t.rowLabels[J]}${K+1}`,ne=t.pinnumbering==="ballcoords"?[se]:[ee,se];h.push(t.circularpads?P1e(ne,{x:Y,y:X,radius:c/2}):Ao(ne,Y,X,c,c))}let A=Jo(0,o.y*r/2,0.2),g=r/6,f,y=o.x*r/2,x=o.y*r/2;switch(t.origin){case"bl":f=[{x:-y,y:-x},{x:-y,y:-x-g},{x:-y-g,y:-x},{x:-y,y:-x}];break;case"br":f=[{x:y,y:-x},{x:y,y:-x-g},{x:y+g,y:-x},{x:y,y:-x}];break;case"tr":f=[{x:y,y:x},{x:y,y:x+g},{x:y+g,y:x},{x:y,y:x}];break;case"tl":default:f=[{x:-y,y:x},{x:-y,y:x+g},{x:-y-g,y:x},{x:-y,y:x}];break}if(t.pinnumbering)f=f.map(({x:U,y:j})=>({x:U,y:-j}));let C={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"pin1_marker",route:f,stroke_width:0.05},b=(o.x-1)*r+c,I=(o.y-1)*r+c,v=i??b,P=s??I,M=Math.max(b/2,v/2),B=Math.max(I/2,P/2),T=1.715,N=1.765,D=M+T,L=D,H=B+N,V=H,O={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",outline:Uy([{minX:-D,maxX:D,minY:-V,maxY:V},{minX:-L,maxX:L,minY:-H,maxY:H}]),layer:"top"};return{circuitJson:[...h,A,C,O],parameters:t}},$R=(e,t,n,o,r)=>({type:"pcb_smtpad",x:t,y:n,width:o,height:r,radius:Math.min(o,r)/2,layer:"top",shape:"pill",pcb_smtpad_id:"",port_hints:Array.isArray(e)?e.map((i)=>i.toString()):[e.toString()]}),hK={thermalpadcenteroffsetx:ve.optional().default(0),thermalpadcenteroffsety:ve.optional().default(0)},Lw=(e,t)=>Ao(["thermalpad"],t.x,t.y,e.x,e.y),EO=(e)=>Yo.extend({fn:k(),num_pins:ge().optional().default(8),w:ve.default(ve.parse(e.w??"5.3mm")),p:ve.default(ve.parse(e.p??"1.27mm")),pw:ve.default(ve.parse(e.pw??"0.6mm")),pl:ve.default(ve.parse(e.pl??"1.0mm")),legsoutside:Be().optional().default(e.legsoutside??!1),pillpads:Be().optional().default(e.pillpads??!1),thermalpad:p5.optional(),...hK,silkscreen_stroke_width:ge().optional().default(0.1)}).transform((t)=>{if(!t.pw&&!t.pl)t.pw=ve.parse("0.6mm"),t.pl=ve.parse("1.0mm");else if(!t.pw)t.pw=t.pl*0.6;else if(!t.pl)t.pl=t.pw*1.6666666666666667;return t}),QRo=EO({}),Nze=(e)=>{if(e.widthincludeslegs!==void 0)e.legsoutside=!e.widthincludeslegs;let{num_pins:t,pn:n,w:o,p:r,pl:i,legsoutside:s}=e,a=t/2,c=n<=a,l=a-1,h=r,d=h*l,u=s?i/2:-i/2;if(c)return{x:-o/2-u,y:d/2-(n-1)*h};return{x:o/2+u,y:-d/2+(n-a-1)*h}},kRo=(e)=>{let t=QRo.parse(e);return{circuitJson:kse(t),parameters:t}},kse=(e)=>{let t=[],n=Math.min(e.pl,e.pw)/8,o=0,r=0;for(let g=0;g<e.num_pins;g++){let{x:f,y}=Nze({num_pins:e.num_pins,pn:g+1,w:e.w,p:e.p,pl:e.pl,legsoutside:e.legsoutside});if(o=Math.max(o,Math.abs(f)+e.pl/2),r=Math.max(r,Math.abs(y)+e.pw/2),e.pillpads)t.push($R(g+1,f,y,e.pl,e.pw));else t.push(Ao(g+1,f,y,e.pl,e.pw,n))}if(e.thermalpad)t.push(Lw(e.thermalpad,{x:e.thermalpadcenteroffsetx,y:e.thermalpadcenteroffsety}));let i=Math.min(1,e.p/2),s=e.w-(e.legsoutside?0:e.pl*2)-0.2,a=(e.num_pins/2-1)*e.p+e.pw+i,c=Jo(0,a/2+0.4,a/12),l={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"silkscreen_path_1",stroke_width:e.silkscreen_stroke_width??0.1,route:[{x:-s/2,y:-a/2},{x:-s/2,y:a/2},...w1e.map(({x:g,y:f})=>({x:g*s/6,y:f*s/6+a/2})),{x:s/2,y:a/2},{x:s/2,y:-a/2},{x:-s/2,y:-a/2}]},h=e.w/2,d=a/2,u=Math.max(o,h)+0.25,_=Math.min(r,d)+0.25,p=Math.min(o,h)+0.25,m=Math.max(r,d)+0.25,A={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",layer:"top",outline:Uy([{minX:-u,maxX:u,minY:-_,maxY:_},{minX:-p,maxX:p,minY:-m,maxY:m}])};return[...t,l,c,A]},nMt=({num_pins:e,sidePinCounts:t,cw:n,ccw:o,startingpin:r})=>{let i=[],s=t.left,a=s+1,c=t.left+t.bottom,l=c+1,h=t.left+t.bottom+t.right,d=h+1,u=1,_={};for(let p of r??[])_[p]=!0;if(!_.leftside&&!_.topside&&!_.rightside&&!_.bottomside)_.leftside=!0;if(!_.bottompin&&!_.leftpin&&!_.rightpin&&!_.toppin){if(_.leftside)_.toppin=!0;else if(_.topside)_.rightpin=!0;else if(_.rightside)_.bottompin=!0;else if(_.bottomside)_.leftpin=!0}if(_.leftside&&_.toppin)u=1;else if(_.leftside&&_.bottompin)u=s;else if(_.bottomside&&_.leftpin)u=a;else if(_.bottomside&&_.rightpin)u=c;else if(_.rightside&&_.bottompin)u=l;else if(_.rightside&&_.toppin)u=h;else if(_.topside&&_.rightpin)u=d;else if(_.topside&&_.leftpin)u=e;i.push(-1);for(let p=0;p<e;p++)if(i[u]=p+1,o||!n){if(u++,u>e)u=1}else if(u--,u<1)u=e;return i},TEt=(e,t,n,o)=>{if(t!==void 0&&o!==void 0&&t!==o)throw Error(`Conflicting ${e} (${t}) and ${n} (${o})`);return o??t},oMt=(e)=>{let t=TEt("lrpins",e.lrpins,"leftrightpins",e.leftrightpins),n=TEt("tbpins",e.tbpins,"topbottompins",e.topbottompins),o=e.num_pins/4,r={left:e.leftpins??t??o,top:e.toppins??n??o,right:e.rightpins??t??o,bottom:e.bottompins??n??o};if([e.leftpins,e.toppins,e.rightpins,e.bottompins,e.lrpins,e.leftrightpins,e.tbpins,e.topbottompins].some((s)=>s!==void 0)){let s=Object.entries(r),a=s.find(([,l])=>!Number.isInteger(l)||l<1);if(a)throw Error(`Quad ${a[0]} pin count must be a positive integer, got ${a[1]}`);let c=s.reduce((l,[,h])=>l+h,0);if(c!==e.num_pins)throw Error(`Quad side pin counts left=${r.left}, top=${r.top}, right=${r.right}, bottom=${r.bottom} require ${c} pins, got ${e.num_pins}`)}return r},E1e=bt(["leftside","topside","rightside","bottomside","toppin","bottompin","leftpin","rightpin"]),XR=X7.number().int().positive().optional(),D1e=Yo.extend({fn:k(),cc:Be().default(!0).optional(),ccw:Be().default(!0).optional(),startingpin:k().or(st(E1e)).transform((e)=>typeof e==="string"?e.slice(1,-1).split(","):e).pipe(st(E1e)).optional(),num_pins:ge().optional().default(64),leftpins:XR,toppins:XR,rightpins:XR,bottompins:XR,lrpins:XR,leftrightpins:XR,tbpins:XR,topbottompins:XR,w:ve.optional(),h:ve.optional(),p:ve.default(ve.parse("0.5mm")),px:ve.optional().describe("top and bottom side pad pitch"),py:ve.optional().describe("left and right side pad pitch"),pw:ve.optional(),pl:ve.optional(),lrpw:ve.optional().describe("alias for leftrightpadwidth"),lrpl:ve.optional().describe("alias for leftrightpadlength"),leftrightpadwidth:ve.optional().describe("left and right side pad width"),leftrightpadlength:ve.optional().describe("left and right side pad length"),thermalpad:an([ce(!0),p5]).optional(),...hK,pillpads:Be().optional().default(!1),legsoutside:Be().default(!1)}),N1e=(e)=>{if(e.lrpw!==void 0&&e.leftrightpadwidth!==void 0&&e.lrpw!==e.leftrightpadwidth)throw Error(`Conflicting lrpw (${e.lrpw}) and leftrightpadwidth (${e.leftrightpadwidth})`);if(e.lrpl!==void 0&&e.leftrightpadlength!==void 0&&e.lrpl!==e.leftrightpadlength)throw Error(`Conflicting lrpl (${e.lrpl}) and leftrightpadlength (${e.leftrightpadlength})`);if(e.leftrightpadwidth=e.leftrightpadwidth??e.lrpw,e.leftrightpadlength=e.leftrightpadlength??e.lrpl,e.w&&!e.h)e.h=e.w;else if(!e.w&&e.h)e.w=e.h;let t=oMt(e),n=Math.max(t.top,t.bottom),o=Math.max(t.left,t.right),r=e.px??e.p,i=e.py??e.p;if(!e.p&&!e.pw&&!e.pl&&e.w){let s=n+4;e.p=e.w/s}if(!e.p&&e.w&&e.h&&e.pw&&e.pl){let s=(e.w-e.pl*2)/Math.max(n-1,1),a=(e.h-e.pl*2)/Math.max(o-1,1);e.p=(s+a)/2}if(!e.w&&!e.h&&e.p)e.w=r*(n+4),e.h=i*(o+4);if(e.p&&!e.pw&&!e.pl)e.pw=e.p/2,e.pl=e.p/2;else if(!e.pw)e.pw=e.pl*0.6;else if(!e.pl)e.pl=e.pw*1.6666666666666667;return e},rMt=D1e.transform(N1e),LRo=["left","bottom","right","top"],HRo=(e)=>{let{sidePinCounts:t,pn:n,w:o,h:r,p:i,px:s,py:a,pl:c,leftRightPadLength:l,legsoutside:h}=e,d=[t.left,t.bottom,t.right,t.top],u=0,_=n-1;while(u<d.length-1&&_>=d[u])_-=d[u],u+=1;let p=d[u],m=LRo[u],A=m==="left"||m==="right"?a??i:s??i,g=m==="left"||m==="right"?l??c:c,f=A*(p-1),y=A*(p-1),x=h?g/2:-g/2;switch(m){case"left":return{x:-o/2-x+0.1,y:y/2-_*A,o:"vert"};case"bottom":return{x:-f/2+_*A,y:-r/2-x+0.1,o:"horz"};case"right":return{x:o/2+x-0.1,y:-y/2+_*A,o:"vert"};case"top":return{x:f/2-_*A,y:r/2+x-0.1,o:"horz"};default:throw Error("Invalid pin number")}},qR=(e)=>{let t=rMt.parse(e),n=t.leftrightpadwidth??t.lrpw??t.pw,o=t.leftrightpadlength??t.lrpl??t.pl,r=oMt(t),i=[],s=0,a=0,c=nMt({...t,sidePinCounts:r}),l=Math.max(r.left,r.right),h=Math.max(r.top,r.bottom),d=r.left,u=d+1,_=r.left+r.bottom,p=_+1,m=r.left+r.bottom+r.right,A=m+1,g=t.num_pins;for(let D=0;D<t.num_pins;D++){let{x:L,y:H,o:V}=HRo({sidePinCounts:r,pin_count:t.num_pins,pn:D+1,w:t.w,h:t.h,p:t.p??0.5,px:t.px,py:t.py,pl:t.pl,leftRightPadLength:o,legsoutside:t.legsoutside}),O=V==="vert",U=O?n:t.pw,j=O?o:t.pl;if(V==="vert")[U,j]=[j,U];let Y=Math.min(U,j)/8,X=c[D+1];s=Math.max(s,Math.abs(L)+U/2),a=Math.max(a,Math.abs(H)+j/2),i.push(t.pillpads?$R(X,L,H,U,j):Ao(X,L,H,U,j,Y))}if(t.thermalpad){let D={x:t.thermalpadcenteroffsetx,y:t.thermalpadcenteroffsety};if(typeof t.thermalpad==="boolean"){let L=(t.px??t.p)*(h-1)+t.pw,H=(t.py??t.p)*(l-1)+n;s=Math.max(s,Math.abs(D.x)+L/2),a=Math.max(a,Math.abs(D.y)+H/2),i.push(Lw({x:L,y:H},D))}else s=Math.max(s,Math.abs(D.x)+t.thermalpad.x/2),a=Math.max(a,Math.abs(D.y)+t.thermalpad.y/2),i.push(Lw(t.thermalpad,D))}let f=[];for(let[D,L,H]of[["top-left",-1,1],["bottom-left",-1,-1],["bottom-right",1,-1],["top-right",1,1]]){let V=t.w/2*L,O=t.h/2*H,U="none",j=V,Y=O,X=t.pw*2;if(c[1]===1&&D==="top-left")U="in1";else if(c[g]===1&&D==="top-left")U="in2";else if(c[A]===1&&D==="top-right")U="in2";else if(c[m]===1&&D==="top-right")U="in1";else if(c[d]===1&&D==="bottom-left")U="in1";else if(c[u]===1&&D==="bottom-left")U="in2";else if(c[_]===1&&D==="bottom-right")U="in1";else if(c[p]===1&&D==="bottom-right")U="in2";let K=U==="in1"?1:-1;if(t.legsoutside){let J=U==="in1"?t.pl/2:t.pw/2,ee=U==="in1"?t.pw/2:t.pl/2;j+=J*L*K,Y-=ee*H*K}if(U==="none"||t.legsoutside)f.push({layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:`pcb_silkscreen_path_${D}`,route:[{x:V-X*L,y:O},{x:V,y:O},{x:V,y:O-X*H}],type:"pcb_silkscreen_path",stroke_width:0.1});if((U==="in1"||U==="in2")&&!t.legsoutside)f.push({layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:`pcb_silkscreen_path_${D}_1`,route:[{x:V-X*L,y:O},{x:V-X*L/2,y:O}],type:"pcb_silkscreen_path",stroke_width:0},{layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:`pcb_silkscreen_path_${D}_2`,route:[{x:V,y:O-X*H/2},{x:V,y:O-X*H}],type:"pcb_silkscreen_path",stroke_width:0.1});if(U==="in1"||U==="in2")f.push({layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:`pcb_silkscreen_path_${D}_3`,route:[{x:j-0.2*-L,y:Y+0.2*K},{x:j,y:Y},{x:j+0.2*K*-L,y:Y+0.2},{x:j-0.2*-L,y:Y+0.2*K}],type:"pcb_silkscreen_path",stroke_width:0.1})}let y=Jo(0,t.h/2+(t.legsoutside?t.pl*1.2:0.5),0.3),x=(D)=>Math.ceil(D/0.05)*0.05,C=(h-1)*(t.px??t.p)+t.pw,b=(l-1)*(t.py??t.p)+n,I=C/2+0.25,v=b/2+0.25,P=t.w/2+0.25,M=t.h/2+0.25,B=Math.max(P,x(s+0.25)),T=Math.max(M,x(a+0.25)),N={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",layer:"top",outline:Uy([{minX:-B,maxX:B,minY:-v,maxY:v},{minX:-P,maxX:P,minY:-M,maxY:M},{minX:-I,maxX:I,minY:-T,maxY:T}])};return{circuitJson:[...i,...f,y,N],parameters:t}},FRo=p5.refine(({x:e,y:t})=>Number.isInteger(e)&&Number.isInteger(t)&&e>0&&t>0,"thermal via grid dimensions must be positive integers"),Sze=ve.refine((e)=>e>0,{message:"thermal via dimensions must be positive"}),iMt=Ee({thermalvias:an([ce(!0),FRo]).optional(),thermalviapitch:Sze.optional(),thermalviaid:Sze.optional().describe("thermal via inner (hole) diameter"),thermalviaod:Sze.optional().describe("thermal via outer diameter")}),y1e={grid:{x:4,y:4},pitch:ve.parse("1mm"),holeDiameter:ve.parse("0.3048mm"),outerDiameter:ve.parse("0.6096mm")},zRo=(e,t)=>{if(!e.thermalvias)return[];let n=e.thermalvias===!0?y1e.grid:e.thermalvias,o=e.thermalviapitch??y1e.pitch,r=e.thermalviaid??y1e.holeDiameter,i=e.thermalviaod??y1e.outerDiameter;if(i<r)throw Error("thermalviaod must be greater than or equal to thermalviaid");let s=(n.x-1)*o+i,a=(n.y-1)*o+i;if(s>t.width||a>t.height)throw Error("thermal via grid must fit inside thermalpad");return Array.from({length:n.x*n.y},(c,l)=>{let h=l%n.x,d=Math.floor(l/n.x);return{pcb_via_id:"",type:"pcb_via",x:t.x+(h-(n.x-1)/2)*o,y:t.y+(d-(n.y-1)/2)*o,hole_diameter:r,outer_diameter:i,layers:["top","bottom"]}})},sMt=(e,t)=>{if(!t.thermalvias)return e;let n=e.find((o)=>o.type==="pcb_smtpad"&&o.port_hints.includes("thermalpad"));if(!n)throw Error("thermalvias requires a thermalpad");return[...e,...zRo(t,n)]},DEt=ve.refine((e)=>Number.isFinite(e)&&e>0,"QFN dimensions must be positive finite lengths"),Pze=Ee({x:ge(),y:ge()}),ORo=D1e.extend(iMt.shape).extend({fn:ce("qfn"),rows:X7.number().pipe(an([ce(1),ce(2)])).default(1),grid:p5.or(Pze).refine(({x:e,y:t})=>Number.isInteger(e)&&Number.isInteger(t)&&e>0&&t>0,"QFN grid must contain positive integer side counts").optional().describe("outer row sites: top/bottom by left/right"),thermalpad:an([ce(!0),p5,Pze]).optional(),thermalvias:an([ce(!0),p5,Pze]).refine((e)=>e===!0||e===void 0||Number.isInteger(e.x)&&Number.isInteger(e.y)&&e.x>0&&e.y>0,"thermal via grid dimensions must be positive integers").optional(),rowgap:DEt.optional().describe("center gap between outer and inner rows"),rowspan:DEt.optional().describe("opposing outer-row center span, on both axes"),staggered:Be().default(!1).describe("shift the inner rows left and down by half their pitch"),circularpads:Be().default(!1).describe("circular lands with diameter pw"),pinnumbering:xie((e)=>typeof e==="string"?e.replace(/^\(([^()]*)\)$/,"$1"):e,ce("ballcoords")).optional(),missing:cK.default([]).describe("omit nominal pin numbers or package-coordinate sites")}).transform((e)=>{let t=Math.min(e.px??e.p,e.py??e.p,e.rowgap??e.p)/2,n=e.pw??(e.rows===2?t:0.25),o=e.pl??(e.circularpads?n:e.rows===2?t:0.875);if(e.circularpads&&(e.pillpads||o!==n))throw Error("Circular QFN pads require equal pl/pw and no pillpads");if(e.circularpads){if(e.leftrightpadwidth!==void 0||e.leftrightpadlength!==void 0||e.lrpw!==void 0||e.lrpl!==void 0)throw Error("Circular QFN pads use one diameter and no left/right pad overrides");for(let c of[e.p,e.px,e.py,n,o,e.w,e.h])if(c!==void 0&&(!Number.isFinite(c)||c<=0))throw Error("QFN dimensions must be positive finite lengths")}if(e.rows===1){if(e.staggered||e.rowgap!==void 0||e.rowspan!==void 0)throw Error("QFN rowgap, rowspan, and staggered require rows2");let c=e.grid?{leftpins:e.grid.y,rightpins:e.grid.y,toppins:e.grid.x,bottompins:e.grid.x}:{};for(let l of["leftpins","rightpins","toppins","bottompins"])if(e[l]!==void 0&&c[l]!==void 0&&e[l]!==c[l])throw Error("QFN grid conflicts with explicit side counts");return N1e({...e,...c,pl:o,pw:n})}if(e.cc===!1||e.ccw===!1||e.startingpin||e.leftrightpadwidth!==void 0||e.leftrightpadlength!==void 0||e.lrpw!==void 0||e.lrpl!==void 0)throw Error("Two-row QFN uses counterclockwise grid numbering and uniform pad sizes");for(let c of["leftpins","rightpins","toppins","bottompins","lrpins","leftrightpins","tbpins","topbottompins"])if(e[c]!==void 0)throw Error("Two-row QFN uses grid instead of explicit side counts");let r=(e.num_pins+8)/8,i=e.grid??{x:r,y:r};if(!Number.isInteger(i.x)||!Number.isInteger(i.y)||i.x<3||i.y<3||4*(i.x+i.y)-8!==e.num_pins)throw Error("Two-row QFN grid requires 4*(x+y)-8 nominal sites");let s=e.w??e.h??(i.x+2)*(e.px??e.p),a=e.h??e.w??(i.y+2)*(e.py??e.p);for(let c of[e.p,e.px??e.p,e.py??e.p,n,o,s,a])if(!Number.isFinite(c)||c<=0)throw Error("QFN dimensions must be positive finite lengths");return{...e,grid:i,w:s,h:a,pl:o,pw:n,rowgap:e.rowgap??e.p}}),VRo=(e)=>{let t=e.grid,n=[],o=e.rowspan??e.w-e.pl-0.2,r=e.rowspan??e.h-e.pl-0.2;for(let i of[0,1]){let s=t.x-2*i,a=t.y-2*i,c=o/2-i*e.rowgap,l=r/2-i*e.rowgap;if(c<=0||l<=0)throw Error("QFN rowgap leaves no inner-row span");let h=e.px??e.p,d=e.py??e.p,u=i&&e.staggered?-h/2:0,_=i&&e.staggered?-d/2:0,p=(g)=>i?4+2*g-(e.staggered?1:0):g===t.x-1?2*t.x-1:2+2*g,m=(g)=>i?2+2*g+(e.staggered?1:0):g===0?1:2*g,A=(g,f,y,x,C)=>{n.push({x:g,y:f,label:`${tMt(y)}${x}`,vertical:C,number:n.length+1})};for(let g=0;g<a;g++)A(-c,((a-1)/2-g)*d+_,m(g),i+1,!0);for(let g=0;g<s;g++)A((g-(s-1)/2)*h+u,-l,2*t.y-1-i,p(g),!1);for(let g=a-1;g>=0;g--)A(c,((a-1)/2-g)*d+_,m(g),2*t.x-i,!0);for(let g=s-1;g>=0;g--)A((g-(s-1)/2)*h+u,l,i,p(g),!1)}return n},NEt=(e,t)=>{let n=new Set;for(let o of t.missing){let r=typeof o==="number"?e.find((i)=>i.number===o):e.find((i)=>i.label===o);if(!r)throw Error(`QFN missing site ${o} is outside the nominal package`);if(n.has(r.number))throw Error("QFN missing sites must not contain duplicates");n.add(r.number)}return e.filter((o)=>!n.has(o.number))},YRo=(e,t)=>{if(t.pinnumbering==="ballcoords")return[e.label];return[e.number]},GRo=(e,t)=>{let n=e.map((o)=>{if(o.shape!=="circle"&&o.shape!=="rect"&&o.shape!=="pill")throw Error("Unsupported QFN pad shape");return{pad:o,x:o.x,y:o.y,rx:o.shape==="circle"?o.radius:o.width/2,ry:o.shape==="circle"?o.radius:o.height/2}});for(let[o,r]of n.entries()){if(r.rx<=0||r.ry<=0||Math.abs(r.x)+r.rx>t.w/2+0.0000000001||Math.abs(r.y)+r.ry>t.h/2+0.0000000001)throw Error("QFN copper must fit inside the package body");for(let i of n.slice(o+1)){let s=Math.abs(r.x-i.x),a=Math.abs(r.y-i.y),c;if(r.pad.shape==="circle"&&i.pad.shape==="circle")c=Math.hypot(s,a)<=r.rx+i.rx+0.0000000001;else if(r.pad.shape==="circle"||i.pad.shape==="circle"){let l=r.pad.shape==="circle"?r:i,h=r.pad.shape==="circle"?i:r;c=Math.hypot(Math.max(s-h.rx,0),Math.max(a-h.ry,0))<=l.rx+0.0000000001}else c=s<=r.rx+i.rx+0.0000000001&&a<=r.ry+i.ry+0.0000000001;if(c)throw Error(`QFN copper for ${r.pad.port_hints?.[0]} and ${i.pad.port_hints?.[0]} overlaps`)}}},URo=(e)=>{let t=ORo.parse({...e,legsoutside:!1}),n;if(t.rows===1){let o=typeof t.thermalpad==="object"?`${t.thermalpad.x}x${t.thermalpad.y}mm`:t.thermalpad,r=qR({...e,...t,thermalpad:o}),i=r.circuitJson.filter((l)=>l.type==="pcb_smtpad"&&(l.shape==="rect"||l.shape==="pill")&&!l.port_hints?.includes("thermalpad"));if(t.pinnumbering||t.missing.some((l)=>typeof l==="string"))throw Error("QFN package-coordinate numbering requires rows2");let s=i.map((l)=>({number:Number(l.port_hints?.[0]),label:l.port_hints[0],x:l.x,y:l.y,vertical:!1})),a=NEt(s,t),c=new Set(a.map((l)=>l.number));if(n=r.circuitJson.filter((l)=>l.type!=="pcb_smtpad"||l.port_hints?.includes("thermalpad")||c.has(Number(l.port_hints?.[0]))),t.circularpads)n=n.map((l)=>l.type==="pcb_smtpad"&&l.shape==="rect"&&!l.port_hints?.includes("thermalpad")?P1e(l.port_hints??[],{x:l.x,y:l.y,radius:t.pw/2}):l)}else{let r=NEt(VRo(t),t).map((a)=>{let c=YRo(a,t);if(t.circularpads)return P1e(c,{x:a.x,y:a.y,radius:t.pw/2});return(t.pillpads?$R:Ao)(c,a.x,a.y,a.vertical?t.pl:t.pw,a.vertical?t.pw:t.pl)});if(t.thermalpad){let a=t.thermalpad===!0?{x:(t.rowspan??t.w-t.pl-0.2)-2*t.rowgap-2*t.pl,y:(t.rowspan??t.h-t.pl-0.2)-2*t.rowgap-2*t.pl}:t.thermalpad,c=Lw(a,{x:t.thermalpadcenteroffsetx,y:t.thermalpadcenteroffsety});if(t.pinnumbering==="ballcoords")c.port_hints=["EP","thermalpad"];r.push(c)}GRo(r,t);let i={leftpins:t.grid.y,rightpins:t.grid.y,toppins:t.grid.x,bottompins:t.grid.x},s=qR({fn:"qfn",num_pins:2*(t.grid.x+t.grid.y),...i,w:t.w,h:t.h,p:t.p,px:t.px,py:t.py,pw:t.pw,pl:t.pl}).circuitJson.filter((a)=>a.type!=="pcb_smtpad");n=[...r,...s]}return{circuitJson:sMt(n,t),parameters:t}},WRo=(e)=>{if(e.legsoutside=!0,!e.p)switch(e.num_pins){case 32:e.p=0.8;break;case 44:case 48:e.p=0.5;break;case 64:case 80:case 100:e.p=0.5;break;case 144:e.p=0.5;break}if(!e.pl)switch(e.num_pins){case 32:case 44:case 48:case 64:case 80:case 100:e.pl=1.475;break;case 144:e.pl=1.6;break}if(!e.pw)switch(e.num_pins){case 32:e.pw=0.55;break;case 44:case 48:case 64:case 80:case 100:e.pw=0.3;break;case 144:e.pw=0.25;break}return qR(e)},XRo=(e)=>{e.legsoutside=!0;let t=rMt.parse(e);if(!e.p)switch(e.num_pins){case 44:case 64:e.p=0.8;break;case 52:if(e.w===14)e.p=1;else e.p=0.65;break;case 208:e.p=0.5;break}if(!e.pl)switch(e.num_pins){case 44:case 52:case 64:e.pl=2.25;break;case 208:e.pl=1.65;break;default:e.pl=t.pl*4;break}if(!e.pw)switch(e.num_pins){case 44:case 64:e.pw=0.5;break;case 52:if(e.w===14)e.pw=0.45;else e.pw=0.55;break;case 208:e.pw=0.3;break;default:e.pw=t.pw;break}return qR(e)},PPs=D1e.extend({}).transform(N1e),jRo=(e)=>{if(e.legsoutside=!1,e.thermalpad===void 0)e.thermalpad=!0;return qR(e)},KRo=Yo.extend({fn:k(),bodywidth:ve.refine((e)=>Number.isFinite(e)&&e>0,{message:"bodywidth must be a positive finite length"}).optional().describe("physical body X size before footprint rotation, independent of copper"),bodyheight:ve.refine((e)=>Number.isFinite(e)&&e>0,{message:"bodyheight must be a positive finite length"}).optional().describe("physical body Y size before footprint rotation, independent of copper"),bodythickness:ve.refine((e)=>Number.isFinite(e)&&e>0,{message:"bodythickness must be a positive finite length"}).optional().describe("physical body Z size, excluding board standoff; metadata for 3D consumers"),num_pins:ge().optional().default(8),w:ve.default(ve.parse("3.9mm")),p:ve.default(ve.parse("1.27mm")),pw:ve.optional(),pl:ve.optional(),legsoutside:Be().optional().default(!1),thermalpad:p5.optional(),...hK,silkscreen_stroke_width:ge().optional().default(0.1)}).transform((e)=>{if(e.pw==null&&e.pl==null)e.pw=ve.parse("0.51mm"),e.pl=ve.parse("1.1mm");else if(e.pw==null)e.pw=e.pl*0.4636363636363636;else if(e.pl==null)e.pl=e.pw*2.1568627450980395;return e}),$Ro=(e)=>{let{num_pins:t,pn:n,w:o,p:r}=e,i=t/2,s=n<=i,a=i-1,c=r,l=c*a,h=o+ve.parse("0.2mm"),d=(s?-1:1)*(h/2);if(s)return{x:d,y:l/2-(n-1)*c};return{x:d,y:-l/2+(n-i-1)*c}},qRo=(e)=>{let t=KRo.parse(e),n=[],o=Math.min(t.pl,t.pw)/8;for(let g=0;g<t.num_pins;g++){let{x:f,y}=$Ro({num_pins:t.num_pins,pn:g+1,w:t.w,p:t.p,pl:t.pl,legsoutside:t.legsoutside});n.push(Ao(g+1,f,y,t.pl,t.pw,o))}if(t.thermalpad)n.push(Lw(t.thermalpad,{x:t.thermalpadcenteroffsetx,y:t.thermalpadcenteroffsety}));let r=Math.min(1,t.p/2),i=t.w-(t.legsoutside?0:t.pl)-0.2,s=(t.num_pins/2-1)*t.p+t.pw+r,a=Jo(0,s/2+0.4,s/12),c={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"silkscreen_path_1",stroke_width:t.silkscreen_stroke_width??0.1,route:[{x:-i/2,y:-s/2},{x:-i/2,y:s/2},...w1e.map(({x:g,y:f})=>({x:g*i/6,y:f*i/6+s/2})),{x:i/2,y:s/2},{x:i/2,y:-s/2},{x:-i/2,y:-s/2}]},l=(t.num_pins/2-1)*t.p+t.pw,h=t.legsoutside?t.w/2+t.pl:(t.w+0.2)/2+t.pl/2,d=l/2,u=h+0.25,_=u,p=d+0.445,m=p,A={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",outline:Uy([{minX:-u,maxX:u,minY:-m,maxY:m},{minX:-_,maxX:_,minY:-p,maxY:p}]),layer:"top"};if(t.bodywidth!==void 0||t.bodyheight!==void 0){let g=t.bodywidth===void 0?u:t.bodywidth/2+0.25,f=t.bodyheight===void 0?p:t.bodyheight/2+0.25;for(let y of n){if(y.type!=="pcb_smtpad"||y.shape!=="rect")continue;g=Math.max(g,Math.abs(y.x)+y.width/2+0.25),f=Math.max(f,Math.abs(y.y)+y.height/2+0.25)}A.outline=[{x:-g,y:-f},{x:g,y:-f},{x:g,y:f},{x:-g,y:f},{x:-g,y:-f}]}return{circuitJson:[...n,c,a,A],parameters:t}},JRo=Yo.extend({fn:k(),num_pins:ge().optional().default(8),w:ve.default(ve.parse("3.0mm")),p:ve.default(ve.parse("0.5mm")),pw:ve.default(ve.parse("0.30mm")),pl:ve.default(ve.parse("1.45mm")),legsoutside:Be().optional().default(!0),thermalpad:p5.optional(),...hK,silkscreen_stroke_width:ge().optional().default(0.1)}),ZRo=(e)=>{let{num_pins:t,pn:n,w:o,p:r,pl:i,legsoutside:s}=e,a=t/2,c=n<=a,l=a-1,h=r*l,d=s?i/2:-i/2;if(c)return{x:-o/2-d,y:h/2-(n-1)*r};return{x:o/2+d,y:-h/2+(n-a-1)*r}},eQo=(e)=>{let t={...e},n=t.p,o=typeof n==="string"||typeof n==="number"?ve.parse(n):void 0,r=o!=null&&o<=ve.parse("0.5mm"),i=JRo.parse(t),s=[],a=i.rounded??Math.min(i.pl,i.pw)/8,c=r?i.w-ve.parse("0.15mm"):i.w;for(let C=0;C<i.num_pins;C++){let{x:b,y:I}=ZRo({num_pins:i.num_pins,pn:C+1,w:c,p:i.p,pl:i.pl,legsoutside:i.legsoutside});s.push(Ao(C+1,b,I,i.pl,i.pw,a))}if(i.thermalpad)s.push(Lw(i.thermalpad,{x:i.thermalpadcenteroffsetx,y:i.thermalpadcenteroffsety}));let l=Math.min(1,i.p/2),h=i.w-(i.legsoutside?0:i.pl*2)-0.2,d=(i.num_pins/2-1)*i.p+i.pw+l,u=Jo(0,d/2+0.4,d/12),_={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"silkscreen_path_1",stroke_width:i.silkscreen_stroke_width??0.1,route:[{x:-h/2,y:-d/2},{x:-h/2,y:d/2},...w1e.map(({x:C,y:b})=>({x:C*h/6,y:b*h/6+d/2})),{x:h/2,y:d/2},{x:h/2,y:-d/2},{x:-h/2,y:-d/2}]},p=(i.num_pins/2-1)*i.p+i.pw,m=i.w/2+(i.legsoutside?i.pl:0),A=i.w/2+0.25,g=m+0.18,f=p/2+0.25,y=f+0.35,x={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",layer:"top",outline:Uy([{minX:-g,maxX:g,minY:-f,maxY:f},{minX:-A,maxX:A,minY:-y,maxY:y}])};return{circuitJson:[...s,_,u,x],parameters:i}},tQo=[{x:-1.45,y:0.93},{x:-0.73,y:0.93},{x:-0.73,y:1.1},{x:0.73,y:1.1},{x:0.73,y:0.93},{x:1.45,y:0.93},{x:1.45,y:-0.93},{x:0.73,y:-0.93},{x:0.73,y:-1.1},{x:-0.73,y:-1.1},{x:-0.73,y:-0.93},{x:-1.45,y:-0.93}],nQo=Yo.extend({fn:k(),num_pins:ce(6).default(6),w:k().default("3.1mm"),h:k().default("2.0mm"),p:k().default("0.65mm"),pl:k().default("1.03mm"),pw:k().default("0.35mm"),string:k().optional()}),oQo=(e)=>{let t=nQo.parse({...e,fn:"sot363"}),n=ve.parse(t.w),o=ve.parse(t.h),r=ve.parse(t.p),i=ve.parse(t.pl),s=ve.parse(t.pw),a=Math.min(i,s)/8,c=[];for(let m=0;m<6;m++){let{x:A,y:g}=REt(m+1,n,r,i);c.push(Ao(m+1,A,g,i,s,a))}let l={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:-n/4,y:o/2+0.1},{x:n/4,y:o/2+0.1}],stroke_width:0.05,pcb_silkscreen_path_id:""},h={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:-n/4,y:-o/2-0.1},{x:n/4,y:-o/2-0.1}],stroke_width:0.05,pcb_silkscreen_path_id:""},d=REt(1,n,r,i),u={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"pin_marker_1",route:[{x:d.x-i/2-0.3,y:d.y},{x:d.x-i/2-0.45,y:d.y+0.15},{x:d.x-i/2-0.45,y:d.y-0.15},{x:d.x-i/2-0.3,y:d.y}],stroke_width:0.05,pcb_silkscreen_path_id:"pin_marker_1"},_=Jo(0,o/2+0.4,0.25),p={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",outline:tQo,layer:"top"};return{circuitJson:[...c,l,h,_,u,p],parameters:t}},REt=(e,t,n,o)=>{let r=t/2-o/2;if(e<=3)return{x:-0.84,y:n-(e-1)*n};return{x:0.84,y:-n+(e-4)*n}},rQo=[{x:-0.75,y:1},{x:-0.75,y:-1},{x:0.75,y:-1},{x:0.75,y:1}],iQo=Yo.extend({fn:k(),num_pins:ce(6).default(6),w:k().default("1.01mm"),h:k().default("1.45mm"),p:k().default("0.5mm"),pl:k().default("0.33mm"),pw:k().default("0.27mm"),string:k().optional()}),sQo=(e)=>{let t=iQo.parse({...e,fn:"sot886"}),n=ve.parse(t.w),o=ve.parse(t.h),r=ve.parse(t.p),i=ve.parse(t.pl),s=ve.parse(t.pw),a=Math.min(i,s)/8,c=[];for(let m=0;m<6;m++){let{x:A,y:g}=QEt(m+1,n,r,i);c.push(Ao(m+1,A,g,i,s,a))}let l={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:-n/2,y:o/2},{x:n/2,y:o/2}],stroke_width:0.05,pcb_silkscreen_path_id:""},h={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:-n/2,y:-o/2},{x:n/2,y:-o/2}],stroke_width:0.05,pcb_silkscreen_path_id:""},d=QEt(1,n,r,i),u={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"pin_marker_1",route:[{x:d.x-i/2-0.3,y:d.y},{x:d.x-i/2-0.45,y:d.y+0.15},{x:d.x-i/2-0.45,y:d.y-0.15},{x:d.x-i/2-0.3,y:d.y}],stroke_width:0.05,pcb_silkscreen_path_id:"pin_marker_1"},_=Jo(0,o/2+0.4,0.25),p={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",outline:rQo,layer:"top"};return{circuitJson:[...c,l,h,_,u,p],parameters:t}},QEt=(e,t,n,o)=>{let r=t/2-o/2;if(e<=3)return{x:-r,y:n-(e-1)*n};return{x:r,y:-n+(e-4)*n}},aQo=[{x:-2.05,y:1.5},{x:-1.05,y:1.5},{x:-1.05,y:1.7},{x:1.05,y:1.7},{x:1.05,y:0.55},{x:2.05,y:0.55},{x:2.05,y:-0.55},{x:1.05,y:-0.55},{x:1.05,y:-1.7},{x:-1.05,y:-1.7},{x:-1.05,y:-1.5},{x:-2.05,y:-1.5},{x:-2.05,y:-0.39},{x:-1.05,y:-0.39},{x:-1.05,y:0.39},{x:-2.05,y:0.39}],cQo=[{x:-2.05,y:1.5},{x:-1.05,y:1.5},{x:-1.05,y:1.7},{x:1.05,y:1.7},{x:1.05,y:1.5},{x:2.05,y:1.5},{x:2.05,y:0.39},{x:1.05,y:0.39},{x:1.05,y:-0.39},{x:2.05,y:-0.39},{x:2.05,y:-1.5},{x:1.05,y:-1.5},{x:1.05,y:-1.7},{x:-1.05,y:-1.7},{x:-1.05,y:-1.5},{x:-2.05,y:-1.5}],aMt=Yo.extend({fn:k(),num_pins:ge().default(3),w:k().default("2.275mm"),h:k().default("2.74mm"),pl:k().default("1.325mm"),pw:k().default("0.6mm"),p:k().default("0.95mm"),string:k().optional()}),lQo=EO({p:"0.95mm",w:"1.6mm",legsoutside:!0}),hQo=(e)=>{let t=e.string?.match(/^sot23_(\d+)/),n=t?Number.parseInt(t[1],10):3;if(n===6||n===8){let r=lQo.parse({...e,num_pins:n});return{circuitJson:kse(r),parameters:r}}let o=aMt.parse({...e,num_pins:n});if(o.num_pins===3)return{circuitJson:uQo(o),parameters:o};if(o.num_pins===5)return{circuitJson:cMt(o),parameters:o};throw Error("Invalid number of pins")},dQo=(e)=>{let{pn:t,w:n,h:o,pl:r,p:i}=e;if(t===1)return{x:-n/2,y:i};if(t===2)return{x:-n/2,y:-i};return{x:n/2,y:0}},uQo=(e)=>{let t=[],n=Number.parseFloat(e.w),o=Number.parseFloat(e.h),r=Number.parseFloat(e.pl),i=Number.parseFloat(e.pw),s=Number.parseFloat(e.p),a=e.rounded??Math.min(r,i)/8;for(let h=0;h<e.num_pins;h++){let{x:d,y:u}=dQo({num_pins:e.num_pins,pn:h+1,w:n,h:o,pl:r,p:s});t.push(Ao(h+1,d,u,r,i,a))}let c=Jo(0,Number.parseInt(e.h),0.3),l={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",outline:aQo,layer:"top"};return[...t,c,l]},kEt=(e)=>{let{w:t,p:n,h:o,pn:r}=e;if(r===1)return{x:-t/2,y:n};if(r===2)return{x:-t/2,y:0};if(r===3)return{x:-t/2,y:-n};if(r===4)return{x:t/2,y:-n};if(r===5)return{x:t/2,y:n};throw Error("Invalid pin number")},cMt=(e)=>{let t=[],n=Number.parseFloat(e.w),o=Number.parseFloat(e.h),r=Number.parseFloat(e.p),i=Number.parseFloat(e.pl),s=Number.parseFloat(e.pw),a=e.rounded??Math.min(i,s)/8;for(let f=1;f<=e.num_pins;f++){let{x:y,y:x}=kEt({w:n,h:o,p:r,pn:f});t.push(Ao(f,y,x,i,s,a))}let c=(e.num_pins+1)/2*r,l=o,h={layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"silkscreen_path_1",route:[{x:-c/3,y:l/2+r/1.3},{x:c/3,y:l/2+r/1.3}],type:"pcb_silkscreen_path",stroke_width:0.05},d={layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"silkscreen_path_2",route:[{x:-c/3,y:-l/2-r/1.3},{x:c/3,y:-l/2-r/1.3}],type:"pcb_silkscreen_path",stroke_width:0.05},u=Jo(0,l+0.3,0.3),_=kEt({w:n,h:o,p:r,pn:1});_.x=_.x-s*1.5;let p=0.3,m=0.4,A={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"pin1_indicator",route:[{x:_.x+p/2,y:_.y},{x:_.x-p/2,y:_.y+m/2},{x:_.x-p/2,y:_.y-m/2},{x:_.x+p/2,y:_.y}],stroke_width:0.05},g={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",outline:cQo,layer:"top"};return[...t,u,h,d,A,g]},pQo=aMt.extend({}),mQo=(e)=>{let t=pQo.parse({...e,num_pins:5});return{circuitJson:cMt(t),parameters:t}},_Qo=[{name:"top-left",dx:-1,dy:1},{name:"top-right",dx:1,dy:1},{name:"bottom-left",dx:-1,dy:-1},{name:"bottom-right",dx:1,dy:-1}],Rze=(e,t)=>({type:"pcb_smtpad",points:t,layer:"top",shape:"polygon",pcb_smtpad_id:"",port_hints:Array.isArray(e)?e.map((n)=>n.toString()):[e.toString()]}),SO=ve.refine((e)=>e>0,{message:"DFN mechanical dimension must be positive"}),x1e=ve.refine((e)=>e>=0,{message:"DFN mechanical dimension must be non-negative"}),gQo=Ee({bodywidth:SO.optional(),bodylength:SO.optional(),bodythickness:SO.optional(),standoff:x1e.optional(),terminalinset:x1e.optional(),terminallength:SO.optional(),terminalwidth:SO.optional(),terminalpitch:SO.optional(),terminalthickness:SO.optional(),pin1terminalchamfer:x1e.optional(),pin1markwidth:x1e.optional()}),AQo=EO({}).and(iMt).and(gQo),fQo=(e)=>{let t=Be().optional().parse(e.cornerpads),n=e.cornerpadcutlength===void 0?void 0:ve.parse(e.cornerpadcutlength),o=cK.parse(e.missing??[]);if(o.some((P)=>typeof P!=="number"))throw Error("DFN missing positions must be pad numbers");let r=[...new Set(o)];if(r.length!==o.length)throw Error("DFN missing positions must not contain duplicates");let i={...AQo.parse(e),cornerpads:t,cornerpadcutlength:n,missing:r};if(i.bodythickness!==void 0&&i.standoff!==void 0&&i.standoff>=i.bodythickness)throw Error("DFN standoff must be less than bodythickness");if(i.terminalthickness!==void 0&&i.bodythickness!==void 0&&i.terminalthickness>i.bodythickness)throw Error("DFN terminalthickness must not exceed bodythickness");if(i.pin1markwidth!==void 0&&i.bodywidth!==void 0&&i.pin1markwidth>=i.bodywidth/2)throw Error("DFN pin1markwidth must be less than half bodywidth");let s=i.num_pins;if(r.some((P)=>P<1||P>s))throw Error("DFN missing position is outside the nominal pad range");if(t){if(s!==4||r.length>0||i.pillpads)throw Error("DFN corner pads require four nominal pads with none missing");if(n===void 0||n<=0||n>Math.min(i.pl,i.pw))throw Error("DFN corner pads require a valid cornerpadcutlength")}let a=new Set(r),c=[],l=Math.min(i.pl,i.pw)/8,h=0,d=1;for(let P=1;P<=s;P+=1){if(a.has(P))continue;let{x:M,y:B}=Nze({num_pins:s,pn:P,w:i.w,p:i.p??1.27,pl:i.pl,widthincludeslegs:!0});if(h=Math.max(h,Math.abs(B)+i.pw/2),t){let T=Math.sign(M),N=Math.sign(B),D=M-T*i.pl/2,L=B-N*i.pw/2,H=M+T*i.pl/2,V=B+N*i.pw/2;c.push(Rze(d,[{x:D,y:L+N*n},{x:D,y:V},{x:H,y:V},{x:H,y:L},{x:D+T*n,y:L}]))}else c.push((i.pillpads?$R:Ao)(d,M,B,i.pl??"1mm",i.pw??"0.6mm",l));d+=1}if(i.thermalpad)c.push(Lw(i.thermalpad,{x:i.thermalpadcenteroffsetx,y:i.thermalpadcenteroffsety}));let u=Math.min(1,i.p/2),_=i.w+u,p=h*2+u,m=[];for(let P of _Qo){let{dx:M,dy:B}=P;m.push({layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"",route:[{x:M*_/2-M*i.p,y:B*p/2},{x:M*_/2,y:B*p/2},{x:M*_/2,y:B*p/2-B*i.p}],type:"pcb_silkscreen_path",stroke_width:0.1})}let A=i.p/4,g=-_/2-A/2,f=p/2-i.p/2;m.push({layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"",type:"pcb_silkscreen_path",route:[{x:g,y:f},{x:g-A,y:f+A},{x:g-A,y:f-A},{x:g,y:f}],stroke_width:0.1});let y=Jo(0,p/2+0.4,p/12),x=(P)=>Math.ceil(P/0.05)*0.05,C=x(i.w/2+0.25),b=x(h+0.45),I={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:C*2,height:b*2,layer:"top"},v=[...c,y,...m,I];return{circuitJson:sMt(v,i),parameters:i}};var u5=ve.refine((e)=>e>0,{message:"dimension must be positive"}),Eze=ve.refine((e)=>e>=0,{message:"dimension must be non-negative"}),LEt=X7.number().pipe(an([ce(1),ce(2)])),lMt=(e,t)=>Yo.extend({[e]:ce(!0).optional(),fn:ce(e),string:k().optional(),origin:k().optional(),num_pins:ce(2).default(2),p:u5.default(ve.parse(t.p)).describe("pad center-to-center pitch"),pw:u5.default(ve.parse(t.pw)).describe("pad size along the package length"),ph:u5.default(ve.parse(t.ph)).describe("pad size along the package width"),cyw:u5.optional().describe("courtyard width"),cyh:u5.optional().describe("courtyard height"),bodylength:u5.default(ve.parse(t.bodylength)),bodywidth:u5.default(ve.parse(t.bodywidth)),bodyheight:u5.default(ve.parse(t.bodyheight)),leadspan:u5.default(ve.parse(t.leadspan)),cathodelength:u5.default(ve.parse(t.cathodelength)),cathodewidth:u5.default(ve.parse(t.cathodewidth)),anodelength:u5.default(ve.parse(t.anodelength)),anodewidth:u5.default(ve.parse(t.anodewidth)),terminalthickness:u5.default(ve.parse(t.terminalthickness)),standoff:Eze.default(ve.parse(t.standoff)),taperinset:Eze.default(ve.parse(t.taperinset)),markingwidth:Eze.default(ve.parse(t.markingwidth)),cathodepin:LEt.default(1),anodepin:LEt.default(2)}).strict().superRefine((n,o)=>{if(n.cathodepin===n.anodepin)o.addIssue({code:Gt.custom,message:"anode and cathode must use different pins",path:["cathodepin"]});if(n.bodyheight<=n.standoff)o.addIssue({code:Gt.custom,message:"bodyheight must be greater than standoff",path:["bodyheight"]});if(n.terminalthickness>=n.bodyheight)o.addIssue({code:Gt.custom,message:"terminalthickness must be less than bodyheight",path:["terminalthickness"]});if(n.standoff>=n.terminalthickness)o.addIssue({code:Gt.custom,message:"standoff must be less than terminalthickness",path:["standoff"]});if(n.leadspan<n.bodylength)o.addIssue({code:Gt.custom,message:"leadspan must be at least bodylength",path:["leadspan"]});if(n.taperinset*2>=Math.min(n.bodylength,n.bodywidth))o.addIssue({code:Gt.custom,message:"taperinset is too large for the body dimensions",path:["taperinset"]});if(n.markingwidth>n.bodylength)o.addIssue({code:Gt.custom,message:"markingwidth must not exceed bodylength",path:["markingwidth"]});let r=(n.leadspan-n.bodylength)/2;if(n.cathodelength<=r||n.anodelength<=r||n.cathodelength+n.anodelength>=n.leadspan||n.cathodewidth>n.bodywidth||n.anodewidth>n.bodywidth)o.addIssue({code:Gt.custom,message:"terminal dimensions are incompatible with the package body",path:["leadspan"]});if(n.markingwidth*2>=n.bodylength-n.taperinset*2)o.addIssue({code:Gt.custom,message:"markingwidth is too large for the tapered body",path:["markingwidth"]})}).transform((n)=>{let{[e]:o,string:r,...i}=n;return i}),hMt=(e)=>{let t=[Ao(1,-e.p/2,0,e.pw,e.ph),Ao(2,e.p/2,0,e.pw,e.ph)],n=e.bodylength/2,o=e.bodywidth/2,r=[o,-o].map((l,h)=>({type:"pcb_silkscreen_path",pcb_silkscreen_path_id:`flat_lead_body_${h}`,pcb_component_id:"",layer:"top",stroke_width:0.1,route:[{x:-n,y:l},{x:n,y:l}]})),i=e.p/2+e.pw/2,s=e.cyw??Math.max(i,n)*2+0.5,a=e.cyh??Math.max(e.ph/2,o)*2+0.5,c={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:s,height:a,layer:"top"};return[...t,...Dze(t,{cathodePin:e.cathodepin,anodePin:e.anodepin}),...r,Jo(0,a/2+0.4,0.3),c]},yQo=lMt("do219ad",{p:"1.84mm",pw:"1.35mm",ph:"0.95mm",bodylength:"2.2mm",bodywidth:"1.3mm",bodyheight:"0.68mm",leadspan:"2.5mm",cathodelength:"1.3mm",cathodewidth:"0.88mm",anodelength:"0.65mm",anodewidth:"0.65mm",terminalthickness:"0.195mm",standoff:"0.11mm",taperinset:"0.05mm",markingwidth:"0.23mm"}),xQo=(e)=>{let t=yQo.parse(e);return{circuitJson:hMt(t),parameters:t}};function dMt({pinlabeltextalignleft:e,pinlabeltextalignright:t,pinlabelorthogonal:n}){let o="top";if(n)o="left";else o="top";if(e)if(n)o="bottom";else o="right";if(t)if(n)o="top";else o="left";return o}var PO=({fs:e,pn:t,anchor_x:n,anchor_y:o,textalign:r="center",anchorplacement:i,orthogonal:s=!1,verticallyinverted:a=!1,layer:c="top"})=>{let l=0;if(s&&a)l=270;else if(a)l=180;else if(s)l=90;else l=0;let h="center";if(r!=="center"){if(h=r==="left"?a?"center_right":"center_left":a?"center_left":"center_right",i){let u={top:{x:0,y:1},bottom:{x:0,y:-1},left:{x:-1,y:0},right:{x:1,y:0}}[i],_=l*Math.PI/180,p={x:Math.cos(_),y:Math.sin(_)},m=u.x*p.x+u.y*p.y;if(Math.abs(m)>0.5)h=m>0?"center_left":"center_right"}}if(c==="bottom"){if(h==="center_left")h="center_right";else if(h==="center_right")h="center_left"}return{type:"pcb_silkscreen_text",pcb_silkscreen_text_id:"silkscreen_text_1",font:"tscircuit2024",font_size:e,pcb_component_id:"pcb_component_1",text:`{PIN${t}}`,layer:c,anchor_position:{x:n,y:o},anchor_alignment:h,ccw_rotation:l}},CQo=bt(["rowmajor","columnmajor"]),bQo=Yo.extend({fn:k(),num_pins:ge().optional().default(6),rows:an([k(),ge()]).transform((e)=>Number(e)).optional().default(1).describe("number of rows"),cols:an([k(),ge()]).transform((e)=>Number(e)).optional().describe("number of nominal columns in a sparse grid"),pinnumbering:xie((e)=>typeof e==="string"?e.trim().replace(/^\(([^()]*)\)$/,"$1"):e,CQo).optional().describe("rowmajor or columnmajor grid numbering; omitted preserves the existing traversal"),p:ve.default("0.1in").describe("pitch"),py:ve.optional().describe("vertical row pitch"),id:ve.default("1.0mm").describe("inner diameter"),od:ve.default("1.5mm").describe("outer diameter"),missing:cK.default([]).describe("row-major nominal grid positions to omit"),male:Be().optional().describe("for male pin headers"),female:Be().optional().describe("for female pin headers"),smd:Be().optional().describe("surface mount device"),surfacemount:Be().optional().describe("surface mount device (verbose)"),rightangle:Be().optional().describe("right angle"),pw:ve.optional().default("1.0mm").describe("pad width for SMD"),pl:ve.optional().default("2.0mm").describe("pad length for SMD"),cyw:ve.pipe(ge().finite().positive()).optional().describe("explicit courtyard width"),cyh:ve.pipe(ge().finite().positive()).optional().describe("explicit courtyard height"),pinlabeltextalignleft:Be().optional().default(!1),pinlabeltextaligncenter:Be().optional().default(!1),pinlabeltextalignright:Be().optional().default(!1),pinlabelverticallyinverted:Be().optional().default(!1),pinlabelorthogonal:Be().optional().default(!1),nosquareplating:Be().optional().default(!1).describe("do not use rectangular pad for pin 1"),nopinlabels:Be().optional().default(!1).describe("omit silkscreen pin labels"),doublesidedpinlabel:Be().optional().default(!1).describe("add silkscreen pins in top and bottom layers"),bottomsidepinlabel:Be().optional().default(!1).describe("place the silkscreen reference text on the bottom layer instead of top"),silkscreenborder:Be().optional().default(!1).describe("add a rectangular silkscreen border around the pin row"),silkscreenlabel:k().transform((e)=>e.startsWith("(")&&e.endsWith(")")?e.slice(1,-1):e).optional().describe("replace the reference designator with a custom silkscreen label")}).transform((e)=>{let t=dMt(e);return{...e,pinlabelAnchorSide:t,male:e.male??!e.female,female:e.female??!1,smd:e.smd??e.surfacemount??!1,rightangle:e.rightangle??!1}}).superRefine((e,t)=>{if(e.male&&e.female)t.addIssue({code:Gt.custom,message:"'male' and 'female' cannot both be true; it should be male or female.",path:["male","female"]});if(e.cols!==void 0&&(!Number.isInteger(e.cols)||e.cols<1))t.addIssue({code:Gt.custom,message:"'cols' must be a positive integer",path:["cols"]});if(e.missing.some((n)=>typeof n!=="number"))t.addIssue({code:Gt.custom,message:"'missing' positions must be pad numbers",path:["missing"]})}),uMt=(e)=>{let t=bQo.parse(e),{p:n,py:o,id:r,od:i,rows:s,cols:a,pinnumbering:c,num_pins:l,missing:h,pinlabelAnchorSide:d,pinlabelverticallyinverted:u,pinlabelorthogonal:_,pinlabeltextalignleft:p,pinlabeltextalignright:m,nopinlabels:A,doublesidedpinlabel:g,bottomsidepinlabel:f,silkscreenborder:y,silkscreenlabel:x}=t,C="center";if(p)C="left";else if(m)C="right";let b=[],I={center:null},v=h,P=new Set(v);if(P.size!==v.length)throw Error("Pinrow missing positions must not contain duplicates");let M=l+v.length,B=a??Math.ceil(M/s),T=B*s,N=a!==void 0||v.length>0||c!==void 0;if(N&&T!==M)throw Error(`Pinrow grid has ${T} positions, but ${M} are required for ${l} pins and ${v.length} missing positions`);if(v.some((Ae)=>!Number.isInteger(Ae)||Ae<1||Ae>T))throw Error("Pinrow missing position is outside the nominal grid");let D=o??n,L=(s-1)*D,H=L/2,V=-D,O=({xoff:Ae,yoff:xe,od:Me,anchorSide:Re,smd:we,pw:_e,pl:ye})=>{let Se=0,Ne=0;if(we){let ke=Me/5;switch(Re){case"right":Se=_e/2+ke;break;case"top":Ne=ye/2+ke;break;case"bottom":Ne=-(ye/2+ke);break;case"left":Se=-(_e/2+ke);break}}else{let ke=Me/2+0.6;switch(Re){case"right":Se=ke;break;case"top":Ne=ke;break;case"bottom":Ne=-ke;break;case"left":Se=-ke;break}}return{anchor_x:Ae+Se,anchor_y:xe+Ne}},U=(Ae,xe,Me)=>{if(Ae===1)I.center={x:xe,y:Me};if(t.smd)b.push(Ao(Ae,xe,Me,t.pw,t.pl));else if(Ae===1&&!t.nosquareplating)b.push(Gy({pn:Ae,x:xe,y:Me,holeDiameter:r,rectPadWidth:i,rectPadHeight:i}));else b.push(Li(Ae,xe,Me,r,i));let{anchor_x:Re,anchor_y:we}=O({xoff:xe,yoff:Me,od:i,anchorSide:d,smd:t.smd,pw:t.pw,pl:t.pl});if(!A){if(!f)b.push(PO({fs:i/5,pn:Ae,anchor_x:Re,anchor_y:we,anchorplacement:d,textalign:C,orthogonal:_,verticallyinverted:u,layer:"top"}));else b.push(PO({fs:i/5,pn:Ae,anchor_x:Re,anchor_y:we,anchorplacement:d,textalign:C,orthogonal:_,verticallyinverted:u,layer:"bottom"}));if(g)b.push(PO({fs:i/5,pn:Ae,anchor_x:Re,anchor_y:we,anchorplacement:d,textalign:C,orthogonal:_,verticallyinverted:u,layer:"bottom"}))}},j=new Set;if(N){let Ae=-((B-1)/2)*n,xe=1;for(let Me=0;Me<T;Me++){let Re=c==="columnmajor"?Me%s:Math.floor(Me/B),we=c==="columnmajor"?Math.floor(Me/s):Me%B,_e=Re*B+we+1;if(P.has(_e))continue;let ye=Ae+we*n,Se=H+Re*V,Ne=`${ye},${Se}`;if(j.has(Ne))throw Error(`Overlap at ${Ne}`);j.add(Ne),U(xe++,ye,Se)}}else if(s===1){let Ae=-((l-1)/2)*n;for(let xe=0;xe<l;xe++){let Me=xe+1,Re=Ae+xe*n,we=`${Re},0`;if(j.has(we))throw Error(`Overlap at ${we}`);j.add(we),U(Me,Re,0)}}else if(s>2&&B>2){let xe=-((B-1)/2)*n,Me=1;for(let Re=0;Re<s&&Me<=l;Re++)for(let we=0;we<B&&Me<=l;we++){let _e=xe+we*n,ye=H+Re*V,Se=`${_e},${ye}`;if(j.has(Se))throw Error(`Overlap at ${Se}`);j.add(Se),U(Me++,_e,ye)}}else{let xe=-((B-1)/2)*n,Me=1,Re=0,we=s-1,_e=0,ye=B-1;while(Me<=l&&Re<=we&&_e<=ye){for(let Se=Re;Se<=we&&Me<=l;Se++){let Ne=xe+_e*n,ke=H+Se*V,nt=`${Ne},${ke}`;if(j.has(nt))throw Error(`Overlap at ${nt}`);j.add(nt),U(Me++,Ne,ke)}_e++;for(let Se=_e;Se<=ye&&Me<=l;Se++){let Ne=xe+Se*n,ke=H+we*V,nt=`${Ne},${ke}`;if(j.has(nt))throw Error(`Overlap at ${nt}`);j.add(nt),U(Me++,Ne,ke)}if(we--,_e<=ye){for(let Se=we;Se>=Re&&Me<=l;Se--){let Ne=xe+ye*n,ke=H+Se*V,nt=`${Ne},${ke}`;if(j.has(nt))throw Error(`Overlap at ${nt}`);j.add(nt),U(Me++,Ne,ke)}ye--}if(Re<=we){for(let Se=ye;Se>=_e&&Me<=l;Se--){let Ne=xe+Se*n,ke=H+Re*V,nt=`${Ne},${ke}`;if(j.has(nt))throw Error(`Overlap at ${nt}`);j.add(nt),U(Me++,Ne,ke)}Re++}}if(Me-1<l)throw Error(`Missing pins: assigned ${Me-1}, expected ${l}`)}let Y=t.smd?t.pw/2:i/2,X=t.smd?t.pl/2:i/2,K=(B-1)*n,J=K/2+n/2+1,ee=Math.max(L/2+X+1,n/2+1),se=y?Es([{x:-J,y:-ee},{x:J,y:-ee},{x:J,y:ee},{x:-J,y:ee},{x:-J,y:-ee}]):null,ne=(()=>{let Ae=I.center;if(t.fn!=="headermodule"||!Ae)return null;let xe=Math.max(0.3,Math.min(0.6,n/4)),Me=0.15;if(d==="top"||d==="bottom"){let Se=Math.sign(Ae.x)||(d==="top"?-1:1),Ne=Ae.x+Se*(Y+Me),ke=Ne+Se*xe;return Es([{x:Ne,y:Ae.y},{x:ke,y:Ae.y-xe},{x:ke,y:Ae.y+xe},{x:Ne,y:Ae.y}],{pcb_component_id:"pin_marker_1",pcb_silkscreen_path_id:"pin_marker_1"})}let we=Math.sign(Ae.y)||1,_e=Ae.y+we*(X+Me),ye=_e+we*xe;return Es([{x:Ae.x,y:_e},{x:Ae.x-xe,y:ye},{x:Ae.x+xe,y:ye},{x:Ae.x,y:_e}],{pcb_component_id:"pin_marker_1",pcb_silkscreen_path_id:"pin_marker_1"})})(),re=x?{type:"pcb_silkscreen_text",pcb_silkscreen_text_id:"silkscreen_text_1",font:"tscircuit2024",font_size:0.8,pcb_component_id:"pcb_component_1",text:x,layer:"top",anchor_position:{x:0,y:0},anchor_alignment:"center"}:Jo(0,L/2+n,0.5),Z=K/2+Y,te=L/2+X,ie=K/2+n/2,le=L/2+n/2,ue=Math.max(Z+0.25,ie+0.5),de=Math.max(te+0.25,le+0.5),me={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:t.cyw??2*ue,height:t.cyh??2*de,layer:"top"};return{circuitJson:[...b,...se?[se]:[],...ne?[ne]:[],re,me],parameters:t}},IQo=(e)=>uMt({...e,fn:"headermodule"}),vQo=[{x:-1.2,y:0.83},{x:-0.75,y:0.83},{x:-0.75,y:0.95},{x:0.75,y:0.95},{x:0.75,y:0.83},{x:1.2,y:0.83},{x:1.2,y:-0.83},{x:0.75,y:-0.83},{x:0.75,y:-0.95},{x:-0.75,y:-0.95},{x:-0.75,y:-0.83},{x:-1.2,y:-0.83}],SQo=Yo.extend({fn:k(),num_pins:ce(6).default(6),w:k().default("2.1mm"),h:k().default("2.45mm"),p:k().default("0.5mm"),pl:k().default("0.675mm"),pw:k().default("0.35mm"),string:k().optional()}),PQo=(e)=>{let t=SQo.parse({...e,fn:"sot563"}),n=ve.parse(t.w),o=ve.parse(t.h),r=ve.parse(t.p),i=ve.parse(t.pl),s=ve.parse(t.pw),a=Math.min(i,s)/8,c=[];for(let m=0;m<6;m++){let{x:A,y:g}=HEt(m+1,n,r,i);c.push(Ao(m+1,A,g,i,s,a))}let l={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:-n/2,y:o/2},{x:n/2,y:o/2}],stroke_width:0.05,pcb_silkscreen_path_id:""},h={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:-n/2,y:-o/2},{x:n/2,y:-o/2}],stroke_width:0.05,pcb_silkscreen_path_id:""},d=HEt(1,n,r,i),u={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"pin_marker_1",route:[{x:d.x-i/2-0.3,y:d.y},{x:d.x-i/2-0.45,y:d.y+0.15},{x:d.x-i/2-0.45,y:d.y-0.15},{x:d.x-i/2-0.3,y:d.y}],stroke_width:0.05,pcb_silkscreen_path_id:"pin_marker_1"},_=Jo(0,o/2+0.4,0.25),p={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",outline:vQo,layer:"top"};return{circuitJson:[...c,l,h,_,u,p],parameters:t}},HEt=(e,t,n,o)=>{let r=t/2-o/2;if(e<=3)return{x:-r,y:n-(e-1)*n};return{x:r,y:-n+(e-4)*n}},EQo=EO({p:"1.27mm",w:"3.9mm",legsoutside:!0}),MQo=(e)=>{let t=EQo.parse({...e,num_pins:8});return{circuitJson:kse(t),parameters:t}},wQo=EO({p:"1.27mm",w:"7.5mm",legsoutside:!0}),BQo=(e)=>{let t=wQo.parse({...e,num_pins:16});return{circuitJson:kse(t),parameters:t}},TQo=Yo.extend({fn:k(),num_pins:ce(3).default(3),w:k().default("1.2mm"),h:k().default("1.2mm"),pw:k().default("0.40mm"),pl:k().default("0.45mm"),p:k().default("0.575mm")}),DQo=(e)=>{let t=TQo.parse(e),n=RQo(t),o=Jo(0,ve.parse(t.h),0.2),r=1.8,i=1.8,s={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",outline:[{x:-0.9,y:0.9},{x:0.9,y:0.9},{x:0.9,y:-0.9},{x:-0.9,y:-0.9}],layer:"top"};return{circuitJson:[...n,o,s],parameters:t}},NQo=(e)=>{let{pn:t,w:n,h:o,pl:r,p:i}=e;if(t===1)return{x:i,y:0};if(t===2)return{x:-i,y:-0.4};return{x:-i,y:0.4}},RQo=(e)=>{let t=[],n=Number.parseFloat(e.w),o=Number.parseFloat(e.h),r=Number.parseFloat(e.pl),i=Number.parseFloat(e.pw),s=Number.parseFloat(e.p),a=Math.min(r,i)/8;for(let c=0;c<3;c++){let{x:l,y:h}=NQo({num_pins:e.num_pins,pn:c+1,w:n,h:o,pl:r,p:s});t.push(Ao(c+1,l,h,r,i,a))}return t},QQo=Yo.extend({fn:k(),num_pins:ce(2).default(2),w:k().default("2.36mm"),h:k().default("1.22mm"),pl:k().default("0.9mm"),pw:k().default("1.2mm"),p:k().default("3.30mm")}),kQo=(e)=>{let t=QQo.parse(e),n=ve.parse(t.h),o=Jo(0,n/4+0.4,0.3),r=4.7,i=2.3,s={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:4.7,height:2.3,layer:"top"};return{circuitJson:HQo(t).concat(...X0(t),o,s),parameters:t}},LQo=(e)=>{let{pn:t,p:n}=e;if(t===1)return{x:-n/2,y:0};else return{x:n/2,y:0}},HQo=(e)=>{let t=[];for(let n=1;n<=e.num_pins;n++){let{x:o,y:r}=LQo({pn:n,p:ve.parse(e.p)});t.push(Ao(n,o,r,ve.parse(e.pl),ve.parse(e.pw),0.1125))}return t},FQo=Yo.extend({fn:k(),p:ve.optional().default("2.54mm"),id:ve.optional().default("0.7mm"),od:ve.optional().default("1.4mm")}),zQo=(e)=>{let t=FQo.parse(e),{p:n,id:o,od:r}=t,i=[Li(1,-n/2,0,o,r),Li(2,n/2,0,o,r)],s={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:-n/2+r+o/2,y:0},{x:n/2-r-o/2,y:0}],stroke_width:0.1,pcb_silkscreen_path_id:""},a=Jo(0,1.5,0.5),c=-n/2,l=n/2,h=r/2,d=r/2,u=c-h-0.35,_=l+h+0.26,p=d+0.35,m=u,A=_,g=p,f={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",outline:Uy([{minX:u,maxX:_,minY:-g,maxY:g},{minX:m,maxX:A,minY:-p,maxY:p}]),layer:"top"};return{circuitJson:[...i,s,a,f],parameters:t}},OQo=(e,t,n,o,r,i=0.1)=>{let s=[],a=[],c=Math.max(1,Math.ceil(Math.PI*n/i)),l=Math.PI/c;for(let h=0;h<=c;h++){let d=h*l,u=e+Math.cos(d)*n,_=t+Math.sin(d)*n;if(u<e-o&&_>=t-r/2&&_<=t+r/2)continue;s.push({x:u,y:_})}for(let h=0;h<=c;h++){let d=Math.PI+h*l,u=e+Math.cos(d)*n,_=t+Math.sin(d)*n;if(u<e-o&&_>=t-r/2&&_<=t+r/2)continue;a.push({x:u,y:_})}return{topArc:s,bottomArc:a}},VQo=Yo.extend({fn:k(),p:ve.optional().default("5mm"),id:ve.optional().default("0.8mm"),od:ve.optional().default("1.6mm"),ceramic:Be().optional(),electrolytic:Be().optional(),polarized:Be().optional()}),YQo=(e)=>{let t=VQo.parse(e),{p:n,id:o,od:r}=t;if(o===0.8&&r===1.6)t.id=n===5?0.8:n*0.25,t.od=n===5?1.6:n*0.5;let i=[Li(1,-n/2,0,t.id,t.od),Li(2,n/2,0,t.id,t.od)],s=n+0.1,{topArc:a,bottomArc:c}=OQo(0,0,s,t.od/2,t.od),l=0.02*n,h={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:a,stroke_width:l,pcb_silkscreen_path_id:""},d={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:c,stroke_width:l,pcb_silkscreen_path_id:""},u={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:0,y:s},{x:0,y:-s}],stroke_width:l,pcb_silkscreen_path_id:""},_=0.1*n,p=-(n+_+0.04*n),m=s-_-0.08*n,A={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:p-_,y:m},{x:p+_,y:m}],stroke_width:l,pcb_silkscreen_path_id:""},g={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:p,y:m-_},{x:p,y:m+_}],stroke_width:l,pcb_silkscreen_path_id:""},f=Jo(0,s+0.12*n,0.1*n),y=[...i,h,d,u,f];if(t.electrolytic===!0||t.polarized===!0)y.push(A,g);let C=n+0.25,b={type:"pcb_courtyard_circle",pcb_courtyard_circle_id:"",pcb_component_id:"",center:{x:0,y:0},radius:C,layer:"top"};return y.push(b),{circuitJson:y,parameters:t}},GQo=Yo.extend({fn:ce("rj45"),num_pins:an([ce(10),ce(14)]).default(10),ledpins:Be().default(!1).describe("add the four through-hole LED connections as pins 9 through 12"),firstpinleft:Be().default(!1).describe("mirror the eight signal pins so pin 1 is on the left"),firstpintop:Be().default(!1).describe("mirror the eight signal pins so pin 1 is in the top row"),p:ve.default("1.02mm").describe("horizontal signal-pin pitch"),py:ve.default("1.78mm").describe("signal-row pitch"),id:ve.default("0.9144mm").describe("signal and LED hole diameter"),od:ve.default("1.524mm").describe("signal and LED outer diameter"),shieldx:ve.default("8.13mm").describe("shield-pin x offset from the footprint center"),shieldy:ve.default("0.13mm").describe("signed shield-pin y offset from the signal-row center"),shieldid:ve.default("1.8mm").describe("shield-pin hole diameter"),shieldod:ve.default("2.5mm").describe("shield-pin outer diameter"),holex:ve.default("6.35mm").describe("locator-hole x offset from the footprint center"),holey:ve.default("-3.43mm").describe("signed locator-hole y offset from the signal-row center"),holed:ve.default("3.25mm").describe("locator-hole diameter"),ledx:ve.default("4.57mm").describe("inner LED-pin x offset from the footprint center"),ledp:ve.default("2.29mm").describe("pitch within each LED-pin pair"),ledy:ve.default("5.7mm").describe("signed LED-pin y offset from the signal-row center"),w:ve.default("16.26mm").describe("connector body width"),h:ve.default("15.88mm").describe("connector body height"),bodyy:ve.default("-0.96mm").describe("signed connector body center y offset")}),UQo=(e)=>{let t=e.ledpins===!0||e.num_pins===14,n=GQo.parse({...e,ledpins:t,num_pins:t?14:10}),{ledpins:o,firstpinleft:r,firstpintop:i,p:s,py:a,id:c,od:l,shieldx:h,shieldy:d,shieldid:u,shieldod:_,holex:p,holey:m,holed:A,ledx:g,ledp:f,ledy:y,w:x,h:C,bodyy:b}=n,I=(ue)=>Number(ue.toFixed(12)),v=Array.from({length:8},(ue,de)=>{let me=de+1,Ae=(3.5-de)*s,xe=de%2===0?-a/2:a/2,Me=I(r?-Ae:Ae),Re=I(i?-xe:xe);return Li(me,Me,Re,c,l)}),P=o?[Li(9,I(-g-f),y,c,l),Li(10,-g,y,c,l),Li(11,g,y,c,l),Li(12,I(g+f),y,c,l)]:[],M=o?14:9,B=o?13:10,T=r!==i,N=T?B:M,D=T?M:B,L=[Li(N,-h,d,u,_),Li(D,h,d,u,_)],H=[-p,p].map((ue)=>({type:"pcb_hole",pcb_hole_id:"",pcb_component_id:"",hole_shape:"circle",hole_diameter:A,x:ue,y:m})),V=-x/2,O=x/2,U=b-C/2,j=b+C/2,Y=_/2+0.2,X=[[U,Math.min(j,d-Y)],[Math.max(U,d+Y),j]].filter(([ue,de])=>de-ue>0.01),K=[Es([{x:V,y:U},{x:O,y:U}]),Es([{x:V,y:j},{x:O,y:j}]),...X.flatMap(([ue,de])=>[Es([{x:V,y:ue},{x:V,y:de}]),Es([{x:O,y:ue},{x:O,y:de}])])],J=Math.min(-h-_/2,-p-A/2,o?-g-f-l/2:0),ee=-J,se=Math.min(d-_/2,m-A/2,-a/2-l/2,o?y-l/2:Number.POSITIVE_INFINITY),ne=Math.max(d+_/2,m+A/2,a/2+l/2,o?y+l/2:Number.NEGATIVE_INFINITY),re=Math.min(V,J)-0.25,Z=Math.max(O,ee)+0.25,te=Math.min(U,se)-0.25,ie=Math.max(j,ne)+0.25,le={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:(re+Z)/2,y:(te+ie)/2},width:Z-re,height:ie-te,layer:"top"};return{circuitJson:[...H,...v,...P,...L,...K,Jo(0,ie+0.55,0.5),le],parameters:n}},WQo=Yo.extend({fn:ce("pushbutton"),w:ve.default(4.5),h:ve.default(6.5),id:ve.default(1),od:ve.default(1.2)}),XQo=(e)=>{let t=WQo.parse(e),{w:n,h:o,id:r}=t,i=[Li(1,-n/2,o/2,r,r*1.5),Li(2,-n/2,-o/2,r,r*1.5),Li(3,n/2,-o/2,r,r*1.5),Li(4,n/2,o/2,r,r*1.5)],s=[Es([{x:-n/2,y:-o/2},{x:-n/2,y:o/2}]),Es([{x:n/2,y:-o/2},{x:n/2,y:o/2}]),Es([{x:-n/2,y:0},{x:-n/5,y:0},{x:n/5*1/Math.sqrt(2),y:o/8}]),Es([{x:n/2,y:0},{x:n/5,y:0}])],a=Jo(0,o/2+0.4,0.5),c=r*1.5/2,l=n,h=o,d=l/2+c,u=h/2+c,_=d+0.5,p=u+0.5,m={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:2*_,height:2*p,layer:"top"};return{circuitJson:[...i,...s,a,m],parameters:t}},pMt=Yo.extend({fn:k(),w:ve.default("22.58mm"),h:ve.optional(),left:ve.optional().default(20),right:ve.optional().default(20),top:ve.optional().default(2),bottom:ve.optional().default(2),p:ve.default(ve.parse("2.54mm")),pw:ve.default(ve.parse("1.6mm")),pl:ve.default(ve.parse("2.4mm")),innerhole:Be().default(!1),innerholeedgedistance:ve.default(ve.parse("1.61mm")),silkscreenlabels:Be().default(!1),silkscreenlabelmargin:ve.default(ve.parse("0.1mm"))}),jQo=(e)=>{let t=pMt.parse(e);if(t.left&&t.right)return Math.max(t.left,t.right)*t.p;if(t.left)return t.left*t.p;if(t.right)return t.right*t.p;return 51},C1e=(e,t,n)=>{let o=[],r=1,i=0.6;if(n==="right")o=[{x:e+r/2,y:t},{x:e-r/2,y:t+i/2},{x:e-r/2,y:t-i/2},{x:e+r/2,y:t}];if(n==="left")o=[{x:e-r/2,y:t},{x:e+r/2,y:t+i/2},{x:e+r/2,y:t-i/2},{x:e-r/2,y:t}];if(n==="top")o=[{x:e,y:t+r/2},{x:e-i/2,y:t-r/2},{x:e+i/2,y:t-r/2},{x:e,y:t+r/2}];if(n==="bottom")o=[{x:e,y:t-r/2},{x:e-i/2,y:t+r/2},{x:e+i/2,y:t+r/2},{x:e,y:t-r/2}];return o},KQo=(e)=>{let t=pMt.parse(e),n=t.h??jQo(t),o=[],r=[],i=[],s=[],a=1,c=a,l=t.left+t.right+(t.bottom??0)+(t.top??0),d=`pin${l}`.length*0.7/2;if(t.right){let m=-((t.right-1)/2)*t.p;for(let A=0;A<t.right;A++){if(A===0&&!t.left&&!t.bottom&&!t.silkscreenlabels)s=C1e(t.w/2-t.pl*1.4,m+A*t.p,"right");if(o.push(Ao(A+1+t.left+(t.bottom??0),t.w/2-t.pl/2,m+A*t.p,t.pl,t.pw)),t.silkscreenlabels){let g=A+1+t.left+(t.bottom??0),f=`pin${g}`;i.push({type:"pcb_silkscreen_text",pcb_silkscreen_text_id:`pin_${g}`,pcb_component_id:"1",layer:"top",anchor_position:{x:t.w/2-t.pl-(d+t.silkscreenlabelmargin),y:m+A*t.p},text:f,font_size:0.7,font:"tscircuit2024",anchor_alignment:"center"})}if(t.innerhole)r.push(Li(A+1+t.left+(t.bottom??0)+l,t.w/2,m+A*t.p,a,c)),r.push(Li(A+1+t.left+(t.bottom??0)+l*2,t.w/2-t.innerholeedgedistance,m+A*t.p,a,c))}}if(t.left){let m=(t.left-1)/2*t.p;for(let A=0;A<t.left;A++){if(A===0&&!t.silkscreenlabels)s=C1e(-t.w/2+t.pl*1.4,m-A*t.p,"left");if(o.push(Ao(A+1,-t.w/2+t.pl/2,m-A*t.p,t.pl,t.pw)),t.silkscreenlabels){let g=A+1,f=`pin${g}`;i.push({type:"pcb_silkscreen_text",pcb_silkscreen_text_id:`pin_${g}`,pcb_component_id:"1",layer:"top",anchor_position:{x:-t.w/2+t.pl+(d+t.silkscreenlabelmargin),y:m-A*t.p},text:f,font_size:0.7,font:"tscircuit2024",anchor_alignment:"center"})}if(t.innerhole)r.push(Li(A+1+l,-t.w/2,m-A*t.p,a,c)),r.push(Li(A+1+l*2,-t.w/2+t.innerholeedgedistance,m-A*t.p,a,c))}}if(t.top){let m=(t.top-1)/2*t.p;for(let A=0;A<t.top;A++){if(A===0&&!t.left&&!t.bottom&&!t.right&&!t.silkscreenlabels)s=C1e(m-A*t.p,n/2-t.pl*1.4,"top");if(o.push(Ao(A+1+t.left+t.right+(t.bottom??0),m-A*t.p,n/2-t.pl/2,t.pw,t.pl)),t.silkscreenlabels){let g=A+1+t.left+t.right+(t.bottom??0),f=`pin${g}`;i.push({type:"pcb_silkscreen_text",pcb_silkscreen_text_id:`pin_${g}`,pcb_component_id:"1",layer:"top",anchor_position:{x:m-A*t.p,y:n/2-t.pl-(d+t.silkscreenlabelmargin)},text:f,font_size:0.7,font:"tscircuit2024",anchor_alignment:"center",ccw_rotation:270})}if(t.innerhole)r.push(Li(A+1+t.left+t.right+(t.bottom??0)+l,m-A*t.p,n/2,a,c)),r.push(Li(A+1+t.left+t.right+(t.bottom??0)+l*2,m-A*t.p,n/2-t.innerholeedgedistance,a,c))}}if(t.bottom){let m=-((t.bottom-1)/2)*t.p;for(let A=0;A<t.bottom;A++){if(A===0&&!t.left&&!t.silkscreenlabels)s=C1e(m+A*t.p,-n/2+t.pl*1.4,"bottom");if(o.push(Ao(A+1+t.left,m+A*t.p,-n/2+t.pl/2,t.pw,t.pl)),t.silkscreenlabels){let g=A+1+t.left,f=`pin${g}`;i.push({type:"pcb_silkscreen_text",pcb_silkscreen_text_id:`pin_${g}`,pcb_component_id:"1",layer:"top",anchor_position:{x:m+A*t.p,y:-n/2+t.pl+(d+t.silkscreenlabelmargin)},text:f,font_size:0.7,font:"tscircuit2024",anchor_alignment:"center",ccw_rotation:90})}if(t.innerhole)r.push(Li(A+1+t.left+l,m+A*t.p,-n/2,a,c)),r.push(Li(A+1+t.left+l*2,m+A*t.p,-n/2+t.innerholeedgedistance,a,c))}}let u={type:"pcb_silkscreen_path",pcb_silkscreen_path_id:"pcb_silkscreen_triangle_1",pcb_component_id:"2",route:s,stroke_width:0.1,layer:"top"},_={type:"pcb_silkscreen_path",pcb_silkscreen_path_id:"pcb_silkscreen_path_1",pcb_component_id:"1",route:[{x:-t.w/2,y:n/2},{x:t.w/2,y:n/2},{x:t.w/2,y:-n/2},{x:-t.w/2,y:-n/2},{x:-t.w/2,y:n/2}],stroke_width:0.1,layer:"top"},p=Jo(0,n/1.8,n/25);return{circuitJson:[...o,...r,...i,_,...t.silkscreenlabels?[]:[u],p],parameters:t}},mMt=Yo.extend({fn:k(),w:ve.default("22.58mm"),h:ve.optional(),left:ve.optional().default(20),right:ve.optional().default(20),top:ve.optional().default(2),bottom:ve.optional().default(2),p:ve.default(ve.parse("2.54mm")),pw:ve.default(ve.parse("1.6mm")),pl:ve.default(ve.parse("3.2mm")),innerhole:Be().default(!1),innerholeedgedistance:ve.default(ve.parse("1.61mm"))}),$Qo=(e)=>{let t=mMt.parse(e);if(t.left&&t.right)return Math.max(t.left,t.right)*t.p;if(t.left)return t.left*t.p;if(t.right)return t.right*t.p;return 51},qQo=(e,t,n,o=1,r=0.6)=>{let i=o/2,s=r/2;return{left:[{x:e+i,y:t},{x:e-i,y:t+s},{x:e-i,y:t-s},{x:e+i,y:t}],right:[{x:e-i,y:t},{x:e+i,y:t+s},{x:e+i,y:t-s},{x:e-i,y:t}],top:[{x:e,y:t-i},{x:e-s,y:t+i},{x:e+s,y:t+i},{x:e,y:t-i}],bottom:[{x:e,y:t+i},{x:e-s,y:t-i},{x:e+s,y:t-i},{x:e,y:t+i}]}[n]},JQo=(e)=>{let t=mMt.parse(e),n=t.h??$Qo(t),o=[],r=[],i=[],s=1,a=1.2,c=t.left+t.right+(t.bottom??0)+(t.top??0),l=[],h=1;if(t.left){let p=(t.left-1)/2*t.p;for(let m=0;m<t.left;m++){if(m===0)l=qQo(-t.w/2-t.pl/2,p-m*t.p,"left");o.push(Ao(h,-t.w/2+t.pl/2,p-m*t.p,t.pl,t.pw)),r.push({type:"pcb_silkscreen_text",pcb_silkscreen_text_id:`pin_${h}`,pcb_component_id:"1",layer:"top",anchor_position:{x:-t.w/2+t.pl/2-4.5,y:p-m*t.p},text:`pin${h}`,font_size:0.7,font:"tscircuit2024",anchor_alignment:"center"}),h++,t.innerhole&&i.push(Li(h+c,-t.w/2+t.innerholeedgedistance,p-m*t.p,1,1.2))}}if(t.bottom){let p=(t.bottom-1)/2*t.p;for(let m=t.bottom-1;m>=0;m--)o.push(Ao(h,p-m*t.p,-n/2+t.pl/2,t.pw,t.pl)),r.push({type:"pcb_silkscreen_text",pcb_silkscreen_text_id:`pin_${h}`,pcb_component_id:"1",layer:"top",anchor_position:{x:p-m*t.p,y:-n/2+t.pl/2-3.2},text:`pin${h}`,font_size:0.7,font:"tscircuit2024",anchor_alignment:"center"}),h++,t.innerhole&&i.push(Li(h+c,p-m*t.p,-n/2+t.innerholeedgedistance,1,1.2))}if(t.right){let p=-((t.right-1)/2)*t.p;for(let m=0;m<t.right;m++)o.push(Ao(h,t.w/2-t.pl/2,p+m*t.p,t.pl,t.pw)),r.push({type:"pcb_silkscreen_text",pcb_silkscreen_text_id:`pin_${h}`,pcb_component_id:"1",layer:"top",anchor_position:{x:t.w/2-t.pl/2+3.7,y:p+m*t.p},text:`pin${h}`,font_size:0.7,font:"tscircuit2024",anchor_alignment:"center"}),h++,t.innerhole&&i.push(Li(h+c,t.w/2-t.innerholeedgedistance,p+m*t.p,1,1.2))}if(t.top){let p=-((t.top-1)/2)*t.p;for(let m=t.top-1;m>=0;m--)o.push(Ao(h,p+m*t.p,n/2-t.pl/2,t.pw,t.pl)),r.push({type:"pcb_silkscreen_text",pcb_silkscreen_text_id:`pin_${h}`,pcb_component_id:"1",layer:"top",anchor_position:{x:p+m*t.p,y:n/2-t.pl/2+3.2},text:`pin${h}`,font_size:0.7,font:"tscircuit2024",anchor_alignment:"center"}),h++,t.innerhole&&i.push(Li(h+c,p+m*t.p,n/2-t.innerholeedgedistance,1,1.2))}let d={type:"pcb_silkscreen_path",pcb_silkscreen_path_id:"1",pcb_component_id:"1",layer:"top",route:l,stroke_width:0.1},u={type:"pcb_silkscreen_path",pcb_silkscreen_path_id:"pcb_silkscreen_path_1",pcb_component_id:"1",route:[{x:-t.w/2-t.pl/3,y:n/2+t.pl/3},{x:t.w/2+t.pl/3,y:n/2+t.pl/3},{x:t.w/2+t.pl/3,y:-n/2-t.pl/3},{x:-t.w/2-t.pl/3,y:-n/2-t.pl/3},{x:-t.w/2-t.pl/3,y:n/2+t.pl/3}],stroke_width:0.1,layer:"top"},_=Jo(0,n/1.8,n/25);return{circuitJson:[...i,...o,...r,u,d,_],parameters:t}},ZQo=(e)=>{if(e.legsoutside=!0,!e.pl)e.pl=1.5;if(!e.pw)e.pw=0.3;return qR(e)},b1e=ve.refine((e)=>Number.isFinite(e)&&e>0,{message:"pitch must be a positive finite length"}),eko=Yo.extend({fn:k(),bodywidth:ve.refine((e)=>Number.isFinite(e)&&e>0,{message:"bodywidth must be a positive finite length"}).optional().describe("physical body X size before footprint rotation, independent of copper"),bodyheight:ve.refine((e)=>Number.isFinite(e)&&e>0,{message:"bodyheight must be a positive finite length"}).optional().describe("physical body Y size before footprint rotation, independent of copper"),bodythickness:ve.refine((e)=>Number.isFinite(e)&&e>0,{message:"bodythickness must be a positive finite length"}).optional().describe("physical body Z size, excluding board standoff; metadata for 3D consumers"),num_pins:ge().int().positive().optional().default(14),grid:p5.optional(),p:ve.default(ve.parse("0.5mm")),px:b1e.optional().describe("top and bottom row pitch"),py:b1e.optional().describe("left and right row pitch"),lrendpitch:b1e.optional().describe("first and last gaps on left and right rows"),tbendpitch:b1e.optional().describe("first and last gaps on top and bottom rows"),cw:Be().optional(),ccw:Be().optional(),startingpin:k().or(st(E1e)).transform((e)=>typeof e==="string"?e.slice(1,-1).split(","):e).pipe(st(E1e)).optional(),w:ve.optional(),h:ve.optional(),pw:ve.default(ve.parse("0.28mm")),pl:ve.default(ve.parse("0.7mm")),pillpads:Be().optional().default(!1)}),tko=(e)=>{let t=eko.parse(e),n=t.num_pins/2;if(!Number.isInteger(n))throw Error("LGA footprints require an even number of perimeter pads");let o=t.grid??{x:Math.ceil(n/2),y:Math.floor(n/2)};if(!Number.isInteger(o.x)||!Number.isInteger(o.y)||o.x<0||o.y<0||o.x+o.y<=0||2*(o.x+o.y)!==t.num_pins)throw Error(`LGA grid ${o.x}x${o.y} requires ${2*(o.x+o.y)} pads, got ${t.num_pins}`);if(t.cw&&t.ccw)throw Error("Choose either cw or ccw numbering");for(let[v,P,M]of[[o.x,t.lrendpitch,"left/right"],[o.y,t.tbendpitch,"top/bottom"]])if(P!==void 0&&v<3)throw Error(`${M} end pitch requires at least three pads per row`);let r=(v,P,M)=>M===void 0?(v-1)*P:2*M+(v-3)*P,i=t.w??r(o.y,t.px??t.p,t.tbendpitch)+2*t.pl,s=t.h??r(o.x,t.py??t.p,t.lrendpitch)+2*t.pl,a={left:o.x,right:o.x,top:o.y,bottom:o.y};for(let v of["left","right","top","bottom"])if(t.startingpin?.includes(`${v}side`)&&a[v]===0)throw Error(`Starting side ${v} has no pads`);let c=nMt({...t,sidePinCounts:a}),l=(v,P,M,B)=>{if(B===void 0)return((v-1)/2-P)*M;return(2*B+(v-3)*M)/2-(P===0?0:B+(P-1)*M+(P===v-1?B-M:0))},h=(i-t.pl)/2,d=(s-t.pl)/2,u=[],_=(v,P,M,B,T)=>{u.push(t.pillpads?$R(c[v],P,M,B,T):Ao(c[v],P,M,B,T))},p=1;for(let v=0;v<o.x;v+=1)_(p++,-h,l(o.x,v,t.py??t.p,t.lrendpitch),t.pl,t.pw);for(let v=0;v<o.y;v+=1)_(p++,-l(o.y,v,t.px??t.p,t.tbendpitch)||0,-d,t.pw,t.pl);for(let v=0;v<o.x;v+=1)_(p++,h,-l(o.x,v,t.py??t.p,t.lrendpitch)||0,t.pl,t.pw);for(let v=0;v<o.y;v+=1)_(p++,l(o.y,v,t.px??t.p,t.tbendpitch),d,t.pw,t.pl);let m=Math.max(t.pw,0.15),A=u.find((v)=>v.type==="pcb_smtpad"&&(v.shape==="rect"||v.shape==="pill")&&Boolean(v.port_hints?.includes("1"))),g=A.x>0?1:-1,f=A.y<0?-1:1,y={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"pin1_marker",stroke_width:0.1,route:[{x:g*i/2,y:f*(s/2-m)},{x:g*i/2,y:f*s/2},{x:g*(i/2-m),y:f*s/2}]},x=0.25,C=i/2+x,b=s/2+x;if(t.bodywidth!==void 0||t.bodyheight!==void 0){C=Math.max(i,t.bodywidth??i)/2+x,b=Math.max(s,t.bodyheight??s)/2+x;for(let v of u){if(v.type!=="pcb_smtpad"||v.shape!=="rect"&&v.shape!=="pill")continue;C=Math.max(C,Math.abs(v.x)+v.width/2+x),b=Math.max(b,Math.abs(v.y)+v.height/2+x)}}let I={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",layer:"top",outline:[{x:-C,y:-b},{x:C,y:-b},{x:C,y:b},{x:-C,y:b},{x:-C,y:-b}]};return{circuitJson:[...u,y,Jo(0,s/2+0.5,0.3),I],parameters:{...t,grid:o,w:i,h:s}}},_Mt=Yo.extend({fn:k(),w:ve.default("10mm"),h:ve.optional(),left:ve.optional().default(20),right:ve.optional().default(20),top:ve.optional().default(0),bottom:ve.optional().default(0),p:ve.default(ve.parse("2.54mm")),id:ve.optional().default(ve.parse("1mm")),od:ve.optional().default(ve.parse("1.5mm"))}),nko=(e)=>{let t=_Mt.parse(e);if(t.left&&t.right)return Math.max(t.left,t.right)*t.p;if(t.left)return t.left*t.p;if(t.right)return t.right*t.p;return 51},I1e=(e,t,n,o=1,r=0.6)=>{let i=o/2,s=r/2;return{left:[{x:e+i,y:t},{x:e-i,y:t+s},{x:e-i,y:t-s},{x:e+i,y:t}],right:[{x:e-i,y:t},{x:e+i,y:t+s},{x:e+i,y:t-s},{x:e-i,y:t}],top:[{x:e,y:t-i},{x:e-s,y:t+i},{x:e+s,y:t+i},{x:e,y:t-i}],bottom:[{x:e,y:t+i},{x:e-s,y:t-i},{x:e+s,y:t-i},{x:e,y:t+i}]}[n]},oko=(e)=>{let t=_Mt.parse(e),n=t.h??nko(t),o=[],{id:r,od:i}=t,s=[];if(t.right){let h=-((t.right-1)/2)*t.p;for(let d=0;d<t.right;d++){if(d===0&&!t.left&&!t.bottom)s=I1e(t.w/2+i*1.4,h+d*t.p,"right");o.push(Li(d+1+t.left+(t.bottom??0),t.w/2,h+d*t.p,r,i))}}if(t.left){let h=-((t.left-1)/2)*t.p;for(let d=0;d<t.left;d++){if(d===t.left-1)s=I1e(-t.w/2-i*1.4,h+d*t.p,"left");o.push(Li(d+1,-t.w/2,h+d*t.p,r,i))}}if(t.top){let h=-((t.top-1)/2)*t.p;for(let d=0;d<t.top;d++){if(d===t.top-1&&!t.left&&!t.bottom&&!t.right)s=I1e(h+d*t.p,n/2+i*1.4,"top");o.push(Li(d+1+t.right+(t.bottom??0)+t.left,h+d*t.p,n/2,r,i))}}if(t.bottom){let h=-((t.bottom-1)/2)*t.p;for(let d=0;d<t.bottom;d++){if(d===0&&!t.left)s=I1e(h+d*t.p,-n/2-i*1.4,"bottom");o.push(Li(d+1+t.left,h+d*t.p,-n/2,r,i))}}let a={type:"pcb_silkscreen_path",pcb_silkscreen_path_id:"1",pcb_component_id:"1",layer:"top",route:s,stroke_width:0.1},c={type:"pcb_silkscreen_path",pcb_silkscreen_path_id:"pcb_silkscreen_path_1",pcb_component_id:"1",route:[{x:-t.w/2-i,y:n/2+i},{x:t.w/2+i,y:n/2+i},{x:t.w/2+i,y:-n/2-i},{x:-t.w/2-i,y:-n/2-i},{x:-t.w/2-i,y:n/2+i}],stroke_width:0.1,layer:"top"},l=Jo(0,n/1.7,n/25);return{circuitJson:[...o,c,l,a],parameters:t}},rko=(e)=>{let{centerX:t,centerY:n,straightHalfLength:o,radius:r,arcSegmentCount:i=9,orientation:s="horizontal"}=e;if(o<0)throw Error("Capsule straightHalfLength must be non-negative");if(r<=0)throw Error("Capsule radius must be positive");if(i<2)throw Error("Capsule arcSegmentCount must be at least 2");if(s==="horizontal"){let d=t-o,u=t+o,_=Array.from({length:i+1},(m,A)=>{let g=Math.PI/2-A*Math.PI/i;return{x:u+Math.cos(g)*r,y:n+Math.sin(g)*r}}),p=Array.from({length:i+1},(m,A)=>{let g=-Math.PI/2+A*Math.PI/i;return{x:d-Math.cos(g)*r,y:n+Math.sin(g)*r}});return[{x:d,y:n+r},{x:u,y:n+r},..._.slice(1,-1),{x:u,y:n-r},{x:d,y:n-r},...p.slice(1,-1)]}let a=n-o,c=n+o,l=Array.from({length:i+1},(d,u)=>{let _=Math.PI-u*Math.PI/i;return{x:t+Math.cos(_)*r,y:c+Math.sin(_)*r}}),h=Array.from({length:i+1},(d,u)=>{let _=u*Math.PI/i;return{x:t+Math.cos(_)*r,y:a-Math.sin(_)*r}});return[{x:t-r,y:a},{x:t-r,y:c},...l.slice(1,-1),{x:t+r,y:c},{x:t+r,y:a},...h.slice(1,-1)]},FEt=(e,t,n,o)=>Array.from({length:25},(r,i)=>{let s=i/24*Math.PI-Math.PI/2;return{x:e+(o==="right"?1:-1)*Math.cos(s)*n,y:t+Math.sin(s)*n}}),iko=Yo.extend({fn:k(),p:ve.optional().default("4.88mm"),id:ve.optional().default("0.8mm"),od:ve.optional().default("1.5mm"),w:ve.optional().default("5.6mm"),h:ve.optional().default("3.5mm")}),sko=(e)=>{let t=iko.parse(e),{p:n,id:o,od:r,w:i,h:s}=t,a=s/2,c=[Li(1,-n/2,0,o,r),Li(2,n/2,0,o,r)],l=FEt(-i/2,0,a,"left"),h=FEt(i/2,0,a,"right"),d={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[...l,...l.slice(1).reverse(),{x:-i/2,y:-s/2},{x:i/2,y:-s/2},...h,{x:i/2,y:s/2},{x:-i/2,y:s/2}],stroke_width:0.1,pcb_silkscreen_path_id:""},u=Jo(0,n/4,0.5),p=n/2+r/2,m=Math.max(s/2+0.25,i/2+0.03),A={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",outline:rko({centerX:0,centerY:0,straightHalfLength:p,radius:m,arcSegmentCount:9}),layer:"top"};return{circuitJson:[...c,d,u,A],parameters:t}},_Es=Yo.extend({w:ve,h:ve}),ako=(e)=>{let{w:t,h:n}=e,o=ki(t),r=ki(n);return{circuitJson:[Ao(1,0,0,o,r),Jo(0,r/2+0.5,0.2)],parameters:e}},dS=(e,t,n,o,r,i)=>({pcb_plated_hole_id:"",type:"pcb_plated_hole",shape:"pill",x:t,y:n,outer_width:ki(r),outer_height:ki(i),hole_width:ki(o),hole_height:ki(o),pcb_port_id:"",layers:["top","bottom"],port_hints:[e.toString()],ccw_rotation:0}),cko=[{x:-2.5,y:4.75},{x:-2.5,y:-0.25},{x:2.5,y:-0.25},{x:2.5,y:4.75}],lko=Yo.extend({fn:k(),num_pins:an([ce(3),ce(2)]).default(3),p:k().default("1.27mm"),id:k().default("0.72mm"),od:k().default("0.95mm"),w:k().default("4.5mm"),h:k().default("4.5mm"),inline:Be().default(!1),string:k().optional()}),hko=(e,t,n)=>Array.from({length:25},(o,r)=>{let i=r/24*Math.PI;return{x:e+Math.cos(i)*n,y:t+Math.sin(i)*n}}),dko=(e)=>{let t=e.string?.match(/^to92_(\d+)/),n=t?Number.parseInt(t[1],10):3,o=lko.parse({...e,num_pins:n}),{p:r,id:i,od:s,w:a,h:c,inline:l}=o,h=Number.parseFloat(c)/2,d=Number.parseFloat(r),u=Number.parseFloat(i),_=Number.parseFloat(s),p=_,m=_*1.4285714285714286,A=[];if(o.num_pins===3)if(l)A=[Gy({pn:1,x:-d,y:h-d,holeDiameter:u,rectPadWidth:_,rectPadHeight:m}),dS(2,0,h-d,u,p,m),dS(3,d,h-d,u,p,m)];else A=[Gy({pn:1,x:-d,y:h-d,holeDiameter:u,rectPadWidth:_,rectPadHeight:_}),Li(2,0,h,u,_),Li(3,d,h-d,u,_)];else if(o.num_pins===2)A=[Gy({pn:1,x:-d,y:h-d,holeDiameter:u,rectPadWidth:p,rectPadHeight:m}),dS(2,d,h-d,u,p,m)];else throw Error("Invalid number of pins for TO-92");let g=Number.parseFloat(a)/2,f=hko(0,h,g),y={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[...f,{x:-g,y:0},{x:g,y:0},f[0]],stroke_width:0.1,pcb_silkscreen_path_id:""},x=Jo(0,h+1,0.5),C={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",outline:cko,layer:"top"};return{circuitJson:[...A,y,x,C],parameters:o}},uko=Yo.extend({fn:k(),num_pins:ce(2).default(2),w:k().default("2.15mm"),h:k().default("0.7mm"),pl:k().default("0.6mm"),pw:k().default("0.7mm"),p:k().default("1.4mm")}),pko=(e)=>{let t=uko.parse(e),n=Jo(0,ve.parse(t.h),0.3),o={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:ve.parse(t.p)/2,y:ve.parse(t.h)/2+0.2},{x:-ve.parse(t.w)/2-0.2,y:ve.parse(t.h)/2+0.2},{x:-ve.parse(t.w)/2-0.2,y:-ve.parse(t.h)/2-0.2},{x:ve.parse(t.p)/2,y:-ve.parse(t.h)/2-0.2}],stroke_width:0.1,pcb_silkscreen_path_id:""},r=2.5,i=1.4,s={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:2.5,height:1.4,layer:"top"};return{circuitJson:_ko(t).concat(...X0(t),o,n,s),parameters:t}},mko=(e)=>{let{pn:t,p:n}=e;if(t===1)return{x:-n/2,y:0};else return{x:n/2,y:0}},_ko=(e)=>{let t=[],n=ve.parse(e.p),o=ve.parse(e.pl),r=ve.parse(e.pw),i=0.075;for(let s=1;s<=e.num_pins;s++){let{x:a,y:c}=mko({pn:s,p:n});t.push(Ao(s,a,c,o,r,0.075))}return t},gko=EO({w:"7.05mm",p:"1.27mm",pw:"0.65mm",pl:"1.975mm"}),Ako=(e)=>{let t=gko.parse(e),n=[],o=Math.min(t.pl,t.pw)/8;for(let _=0;_<t.num_pins;_++){let{x:p,y:m}=Nze({num_pins:t.num_pins,pn:_+1,w:t.w,p:t.p??1.27,pl:t.pl,widthincludeslegs:!0});n.push(Ao(_+1,p,m,t.pl,t.pw,o))}let r=(t.num_pins/2-1)*t.p+t.pw,i=Jo(0,r/2+1,r/12),s={layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"",type:"pcb_silkscreen_path",route:[{x:-t.w/3,y:r/2+0.4},{x:t.w/3,y:r/2+0.4}],stroke_width:0.1},a=(t.num_pins/2-1)*t.p+t.pw,c=t.w/2-1.395,l=t.w/2+0.255,h=a/2+0.25,d=a/2+0.5,u={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",layer:"top",outline:Uy([{minX:-l,maxX:l,minY:-h,maxY:h},{minX:-c,maxX:c,minY:-d,maxY:d}])};return{circuitJson:[...n,i,s,u],parameters:t}},fko=Yo.extend({fn:k(),num_pins:ce(2).default(2),w:k().default("5.0mm"),h:k().default("2.30mm"),pl:k().default("1.25mm"),pw:k().default("2mm"),p:k().default("3.75mm")}),yko=(e)=>{let t=fko.parse(e),n=Jo(0,ve.parse(t.h)/2+1,0.3),o={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:ve.parse(t.p)/2+0.5,y:ve.parse(t.h)/2+0.5},{x:-ve.parse(t.w)/2-0.5,y:ve.parse(t.h)/2+0.5},{x:-ve.parse(t.w)/2-0.5,y:-ve.parse(t.h)/2-0.5},{x:ve.parse(t.p)/2+0.5,y:-ve.parse(t.h)/2-0.5}],stroke_width:0.1,pcb_silkscreen_path_id:""},r=5.1,i=2.8,s={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:5.1,height:2.8,layer:"top"};return{circuitJson:Cko(t).concat(...X0(t),o,n,s),parameters:t}},xko=(e)=>{let{pn:t,p:n}=e;return t===1?{x:-n/2,y:0}:{x:n/2,y:0}},Cko=(e)=>{let t=[];for(let n=1;n<=e.num_pins;n++){let{x:o,y:r}=xko({pn:n,p:ve.parse(e.p)});t.push(Ao(n,o,r,ve.parse(e.pl),ve.parse(e.pw)))}return t},bko=Yo.extend({fn:k(),num_pins:ce(2).default(2),w:k().default("4.4mm"),h:k().default("1.7mm"),pl:k().default("1.2mm"),pw:k().default("1.2mm"),p:k().default("2.8mm")}),Iko=(e)=>{let t=bko.parse(e),n=Jo(0,ve.parse(t.h)-0.5,0.3),o={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:ve.parse(t.p)/2,y:ve.parse(t.h)/2},{x:-ve.parse(t.w)/2-0.2,y:ve.parse(t.h)/2},{x:-ve.parse(t.w)/2-0.2,y:-ve.parse(t.h)/2},{x:ve.parse(t.p)/2,y:-ve.parse(t.h)/2}],stroke_width:0.1,pcb_silkscreen_path_id:""},r=4.5,i=2.2,s={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:4.5,height:2.2,layer:"top"};return{circuitJson:Sko(t).concat(...X0(t),o,n,s),parameters:t}},vko=(e)=>{let{pn:t,p:n}=e;if(t===1)return{x:-n/2,y:0};return{x:n/2,y:0}},Sko=(e)=>{let t=[];for(let n=1;n<=e.num_pins;n++){let{x:o,y:r}=vko({pn:n,p:ve.parse(e.p)});t.push(Ao(n,o,r,ve.parse(e.pl),ve.parse(e.pw)))}return t},Pko=Yo.extend({fn:k(),num_pins:ce(2).default(2),w:k().default("3.30mm"),h:k().default("1.80mm"),pl:k().default("0.60mm"),pw:k().default("0.45mm"),p:k().default("2.1mm")}),Eko=(e)=>{let t=Pko.parse(e),n=Jo(0,ve.parse(t.h)-0.5,0.3),o={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:ve.parse(t.p)/2,y:ve.parse(t.h)/2},{x:-ve.parse(t.w)/2,y:ve.parse(t.h)/2},{x:-ve.parse(t.w)/2,y:-ve.parse(t.h)/2},{x:ve.parse(t.p)/2,y:-ve.parse(t.h)/2}],stroke_width:0.1,pcb_silkscreen_path_id:""},r=3.2,i=1.9,s={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:3.2,height:1.9,layer:"top"};return{circuitJson:wko(t).concat(...X0(t),o,n,s),parameters:t}},Mko=(e)=>{let{pn:t,p:n}=e;if(t===1)return{x:-n/2,y:0};return{x:n/2,y:0}},wko=(e)=>{let t=[],n=ve.parse(e.p),o=ve.parse(e.pl),r=ve.parse(e.pw),i=0.05625;for(let s=1;s<=e.num_pins;s++){let{x:a,y:c}=Mko({pn:s,p:n});t.push(Ao(s,a,c,o,r,0.05625))}return t},Bko=lMt("sod323he",{p:"2.1001mm",pw:"0.8mm",ph:"1.1mm",bodylength:"2mm",bodywidth:"1.4mm",bodyheight:"0.6mm",leadspan:"2.5mm",cathodelength:"0.55mm",cathodewidth:"0.8mm",anodelength:"0.55mm",anodewidth:"0.8mm",terminalthickness:"0.17mm",standoff:"0.05mm",taperinset:"0.15mm",markingwidth:"0.2mm"}),Tko=(e)=>{let t=Bko.parse(e);return{circuitJson:hMt(t),parameters:t}},Dko=Yo.extend({fn:k(),num_pins:ce(2).default(2),w:k().default("1.4mm"),h:k().default("0.9mm"),pl:k().default("0.36mm"),pw:k().default("0.25mm"),p:k().default("0.85mm")}),Nko=(e)=>{let t=Dko.parse(e),n=ve.parse(t.w),o=ve.parse(t.h),r=ve.parse(t.pl),i=ve.parse(t.pw),s=ve.parse(t.p),a=Jo(0,o,0.3),c={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:s/2+0.15,y:o/2},{x:-n/2-0.15,y:o/2},{x:-n/2-0.15,y:-o/2},{x:s/2+0.15,y:-o/2}],stroke_width:0.1,pcb_silkscreen_path_id:""},l=s+r,h=i,d=n/2,u=o/2,_=l/2,p=h/2,m=Math.max(d,_),A=Math.max(u,p),g=Math.min(d,_),f=Math.min(u,p),y=m+0.05,x=g-0.055,C=A,b=f+0.155,I={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",outline:Uy([{minX:-y,maxX:y,minY:-b,maxY:b},{minX:-x,maxX:x,minY:-C,maxY:C}]),layer:"top"};return{circuitJson:Qko(t).concat(...X0(t),c,a,I),parameters:t}},Rko=(e)=>{let{pn:t,p:n}=e;if(t===1)return{x:-n/2,y:0};else return{x:n/2,y:0}},Qko=(e)=>{let t=[],n=ve.parse(e.p),o=ve.parse(e.pl),r=ve.parse(e.pw),i=0.03125;for(let s=1;s<=e.num_pins;s++){let{x:a,y:c}=Rko({pn:s,p:n});t.push(Ao(s,a,c,o,r,0.03125))}return t},kko=Yo.extend({fn:k(),num_pins:ce(2).default(2),w:k().default("1.3mm"),h:k().default("0.9mm"),pl:k().default("0.4mm"),pw:k().default("0.7mm"),p:k().default("0.7mm")}),Lko=(e)=>{let t=kko.parse(e),n=Jo(0,ve.parse(t.h)+0.1,0.3),o={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:ve.parse(t.p)/2+0.2,y:ve.parse(t.h)/2+0.2},{x:-ve.parse(t.w)/2-0.2,y:ve.parse(t.h)/2+0.2},{x:-ve.parse(t.w)/2-0.2,y:-ve.parse(t.h)/2-0.2},{x:ve.parse(t.p)/2+0.2,y:-ve.parse(t.h)/2-0.2}],stroke_width:0.1,pcb_silkscreen_path_id:""},r=1.6,i=1.2,s={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:1.6,height:1.2,layer:"top"};return{circuitJson:Fko(t).concat(...X0(t),o,n,s),parameters:t}},Hko=(e)=>{let{pn:t,p:n}=e;if(t===1)return{x:-n/2,y:0};else return{x:n/2,y:0}},Fko=(e)=>{let t=[];for(let n=1;n<=e.num_pins;n++){let{x:o,y:r}=Hko({pn:n,p:ve.parse(e.p)});t.push(Ao(n,o,r,ve.parse(e.pl),ve.parse(e.pw),0.025))}return t},zko=Yo.extend({fn:k(),num_pins:ce(2).default(2),w:k().default("3.05mm"),h:k().default("1.4mm"),pl:k().default("0.5mm"),pw:k().default("0.5mm"),pad_spacing:k().default("2.2mm")}),Oko=(e)=>{let t=zko.parse(e),n=Jo(0,ve.parse(t.h),0.3),o={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:ve.parse(t.pad_spacing)/2,y:ve.parse(t.h)/2},{x:-ve.parse(t.w)/2-0.2,y:ve.parse(t.h)/2},{x:-ve.parse(t.w)/2-0.2,y:-ve.parse(t.h)/2},{x:ve.parse(t.pad_spacing)/2,y:-ve.parse(t.h)/2}],stroke_width:0.1,pcb_silkscreen_path_id:""},r=3.2,i=1.9,s={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:3.2,height:1.9,layer:"top"};return{circuitJson:Yko(t).concat(...X0(t),o,n,s),parameters:t}},Vko=(e)=>{let{pn:t,pad_spacing:n}=e;if(t===1)return{x:-n/2,y:0};else return{x:n/2,y:0}},Yko=(e)=>{let t=[];for(let n=1;n<=e.num_pins;n++){let{x:o,y:r}=Vko({pn:n,pad_spacing:ve.parse(e.pad_spacing)});t.push(Ao(n,o,r,ve.parse(e.pl),ve.parse(e.pw),0.0625))}return t},Gko=Yo.extend({fn:k(),num_pins:ce(2).default(2),w:k().default("4.4mm"),h:k().default("2.1mm"),pl:k().default("1.10mm"),pw:k().default("1.10mm"),p:k().default("2.8mm")}),Uko=(e)=>{let t=Gko.parse(e),n=Jo(0,ve.parse(t.h),0.3),o={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:ve.parse(t.p)/2,y:ve.parse(t.h)/2},{x:-ve.parse(t.w)/2-0.2,y:ve.parse(t.h)/2},{x:-ve.parse(t.w)/2-0.2,y:-ve.parse(t.h)/2},{x:ve.parse(t.p)/2,y:-ve.parse(t.h)/2}],stroke_width:0.1,pcb_silkscreen_path_id:""},r=4.4,i=2.3,s={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:4.4,height:2.3,layer:"top"};return{circuitJson:Xko(t).concat(...X0(t),o,n,s),parameters:t}},Wko=(e)=>{let{pn:t,p:n}=e;if(t===1)return{x:-n/2,y:0};else return{x:n/2,y:0}},Xko=(e)=>{let t=[],n=ve.parse(e.p),o=ve.parse(e.pl),r=ve.parse(e.pw),i=0.125;for(let s=1;s<=e.num_pins;s++){let{x:a,y:c}=Wko({pn:s,p:n});t.push(Ao(s,a,c,o,r,0.125))}return t},jko=Yo.extend({fn:k(),num_pins:ce(2).default(2),w:k().default("4.4mm"),h:k().default("2.1mm"),pl:k().default("0.91mm"),pw:k().default("1.22mm"),p:k().default("3.146mm")}),Kko=(e)=>{let t=jko.parse(e),n=Jo(0,ve.parse(t.h),0.3),o={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:ve.parse(t.p)/2,y:ve.parse(t.h)/2},{x:-ve.parse(t.w)/2-0.2,y:ve.parse(t.h)/2},{x:-ve.parse(t.w)/2-0.2,y:-ve.parse(t.h)/2},{x:ve.parse(t.p)/2,y:-ve.parse(t.h)/2}],stroke_width:0.1,pcb_silkscreen_path_id:""},r=4.9,i=2.7,s={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:4.9,height:2.7,layer:"top"};return{circuitJson:qko(t).concat(...X0(t),o,n,s),parameters:t}},$ko=(e)=>{let{pn:t,p:n}=e;if(t===1)return{x:-n/2,y:0};else return{x:n/2,y:0}},qko=(e)=>{let t=[];for(let n=1;n<=e.num_pins;n++){let{x:o,y:r}=$ko({pn:n,p:ve.parse(e.p)});t.push(Ao(n,o,r,ve.parse(e.pl),ve.parse(e.pw)))}return t},Jko=Yo.extend({fn:k(),num_pins:ce(2).default(2),w:k().default("1.80mm"),h:k().default("1.00mm"),pl:k().default("0.66mm"),pw:k().default("0.5mm"),p:k().default("0.8mm")}),Zko=(e)=>{let t=Jko.parse(e),n=Jo(0,ve.parse(t.h),0.3),o={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:ve.parse(t.p)/2,y:ve.parse(t.h)/2},{x:-ve.parse(t.w)/2-0.1,y:ve.parse(t.h)/2},{x:-ve.parse(t.w)/2-0.1,y:-ve.parse(t.h)/2},{x:ve.parse(t.p)/2,y:-ve.parse(t.h)/2}],stroke_width:0.1,pcb_silkscreen_path_id:""},r=2.3,i=1.5,s={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:2.3,height:1.5,layer:"top"};return{circuitJson:tLo(t).concat(...X0(t),o,n,s),parameters:t}},eLo=(e)=>{let{pn:t,p:n}=e;if(t===1)return{x:-n/2,y:0};else return{x:n/2,y:0}},tLo=(e)=>{let t=[];for(let n=1;n<=e.num_pins;n++){let{x:o,y:r}=eLo({pn:n,p:ve.parse(e.p)});t.push(Ao(n,o,r,ve.parse(e.pl),ve.parse(e.pw)))}return t},nLo=Yo.extend({fn:k(),num_pins:ce(2).default(2),w:k().default("6.2mm"),h:k().default("3.4mm"),pl:k().default("1.4mm"),pw:k().default("2.1mm"),p:k().default("4.4mm")}),oLo=(e)=>{let t=nLo.parse(e),n=Jo(0,ve.parse(t.h)/2+0.4,0.3),o={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:ve.parse(t.p)/2,y:ve.parse(t.h)/2},{x:-ve.parse(t.w)/2-0.2,y:ve.parse(t.h)/2},{x:-ve.parse(t.w)/2-0.2,y:-ve.parse(t.h)/2},{x:ve.parse(t.p)/2,y:-ve.parse(t.h)/2}],stroke_width:0.1,pcb_silkscreen_path_id:""},r=6.3,i=3,s={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:6.3,height:3,layer:"top"};return{circuitJson:iLo(t).concat(...X0(t),o,n,s),parameters:t}},rLo=(e)=>{let{pn:t,p:n}=e;if(t===1)return{x:-n/2,y:0};else return{x:n/2,y:0}},iLo=(e)=>{let t=[];for(let n=1;n<=e.num_pins;n++){let{x:o,y:r}=rLo({pn:n,p:ve.parse(e.p)});t.push(Ao(n,o,r,ve.parse(e.pl),ve.parse(e.pw),0.125))}return t},sLo=[{x:-2.85,y:-2.5},{x:-2.85,y:2.5},{x:2.25,y:2.5},{x:2.25,y:-2.5}],aLo=[{x:-2.85,y:-2.5},{x:-2.85,y:2.5},{x:2.85,y:2.5},{x:2.85,y:-2.5}],cLo=[{x:0.9,y:0.5},{x:2.6,y:0.5},{x:2.6,y:-0.5},{x:0.9,y:-0.5},{x:0.4,y:-1},{x:-0.4,y:-1},{x:-0.9,y:-0.5},{x:-2.6,y:-0.5},{x:-2.6,y:0.5},{x:-0.9,y:0.5},{x:-0.4,y:1},{x:0.4,y:1}],lLo=[{x:2,y:-0.8665},{x:-1.125,y:-0.8665},{x:-1.125,y:-0.45},{x:-2.6,y:-0.45},{x:-2.6,y:0.45},{x:-1.125,y:0.45},{x:-1.125,y:0.8665},{x:2,y:0.8665}],hLo=Yo.extend({fn:k(),num_pins:an([ce(3),ce(5)]).default(3),w:k().default("4.20mm"),h:k().default("4.80mm"),pl:k().default("1.3mm"),pw:k().default("0.9mm"),p:k().default("1.5mm"),string:k().optional()}),dLo=(e)=>{let t=Number.parseFloat(e.p),n=Number.parseFloat(e.pw),o=Number.parseFloat(e.w),r=Number.parseFloat(e.pl),i=Math.min(r,n)/8,s=-o/2+0.15,a=o/2-1,c=Number.parseFloat(e.h)/2,l=[Ao(1,s,t,r,n,i),Rze(2,lLo),Ao(3,s,-t,r,n,i)],h=Jo(0,c+0.5,0.3),d={layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"silkscreen_path_1",route:[{x:-a,y:c},{x:a,y:c},{x:a,y:c/2+0.5}],type:"pcb_silkscreen_path",stroke_width:0.1},u={layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"silkscreen_path_2",route:[{x:-a,y:-c},{x:a,y:-c},{x:a,y:-c/2-0.5}],type:"pcb_silkscreen_path",stroke_width:0.1},_={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",outline:sLo,layer:"top"};return[...l,d,u,h,_]},uLo=(e)=>{let t=Math.min(1.5,0.7)/8,n=[Ao(1,-1.85,-1.5,1.5,0.7,t),Ao(2,-1.85,1.5,1.5,0.7,t),Rze(3,cLo),Ao(4,1.85,-1.5,1.5,0.7,t),Ao(5,1.85,1.5,1.5,0.7,t)],o=Number.parseFloat(e.w)/2-1,r=Number.parseFloat(e.h)/2,i=Jo(0,r+0.5,0.3),s={layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"silkscreen_path_1",route:[{x:-o,y:r},{x:o,y:r}],type:"pcb_silkscreen_path",stroke_width:0.1},a={layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"silkscreen_path_2",route:[{x:-o,y:-r},{x:o,y:-r}],type:"pcb_silkscreen_path",stroke_width:0.1},c={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",outline:aLo,layer:"top"};return[...n,s,a,i,c]},pLo=(e)=>{let t=e.string?.match(/^sot89_(\d+)/),n=t?Number.parseInt(t[1],10):3,o=hLo.parse({...e,num_pins:n});if(o.num_pins===3)return{circuitJson:dLo(o),parameters:o};if(o.num_pins===5)return{circuitJson:uLo(o),parameters:o};throw Error("Invalid number of pins for SOT89")},mLo=Yo.extend({fn:k(),p:ve.optional().default("5.0mm"),id:ve.optional().default("1.0mm"),od:ve.optional().default("1.9mm"),w:ve.optional().default("13mm"),h:ve.optional().default("7mm"),num_pins:ge().optional(),string:k().optional()}),gMt=(e)=>{let t=mLo.parse(e),{id:n,od:o,w:r,h:i,string:s}=t,a=t.num_pins??Number.parseInt(s?.match(/^to220(?:_|-)(\d+)/i)?.[1]??"3"),c=-1,l=r/2,h=i/2,d=2.5,u=r*0.4,_=Math.max(2.5,u/(a-1)),p=Array.from({length:a},(L,H)=>{let V=a%2===0?(H-a/2+0.5)*_:(H-Math.floor(a/2))*_;return Li(H+1,V,-1,n,o)}),m={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:-l,y:-h},{x:l,y:-h},{x:l,y:h},{x:-l,y:h},{x:-l,y:-h}],stroke_width:0.1,pcb_silkscreen_path_id:""},A=-h+2*i/3,g={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:-l,y:A},{x:l,y:A}],stroke_width:0.1,pcb_silkscreen_path_id:""},f=[{type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:-r/6,y:A},{x:-r/6,y:h}],stroke_width:0.1,pcb_silkscreen_path_id:""},{type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:r/6,y:A},{x:r/6,y:h}],stroke_width:0.1,pcb_silkscreen_path_id:""}],y=Jo(0,i/2+0.6,0.5),x=Math.max(...p.map((L)=>Math.abs(L.x)))+o/2,C=-1+o/2,b=-1-o/2,I=Math.max(x+0.25,l-o*0.59),v=h-o*0.63,P=b-(o/2+0.01),M=-I,B=I,T=Math.min(P,b-0.25),N=Math.max(v,C+0.25),D={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:(M+B)/2,y:(T+N)/2},width:B-M,height:N-T,layer:"top"};return{circuitJson:[...p,m,g,...f,y,D],parameters:{...t,p:_}}},Mze=2.54,_Lo=Yo.extend({fn:k(),id:ve.optional().default("1.2mm"),od:ve.optional().default("1.905mm"),ph:ve.optional().default("2mm"),w:ve.optional().default("13mm"),h:ve.optional().default("7mm"),num_pins:ge().optional(),string:k().optional()}),gLo=(e)=>{let t=_Lo.parse(e),n=t.num_pins??Number.parseInt(t.string?.match(/^to220f(?:_|-)(\d+)/i)?.[1]??"3"),o=gMt({...t,fn:"to220",string:t.string?.replace(/^to220f/i,"to220"),num_pins:n}),r=-1,i=Array.from({length:n},(a,c)=>{let l=n%2===0?(c-n/2+0.5)*Mze:(c-Math.floor(n/2))*Mze;if(c===0)return Gy({pn:1,x:l,y:-1,holeDiameter:t.id,rectPadWidth:t.od,rectPadHeight:t.ph});return dS(c+1,l,-1,ki(t.id),ki(t.od),ki(t.ph))}),s=o.circuitJson.filter((a)=>a.type!=="pcb_plated_hole");return{circuitJson:[...i,...s],parameters:{...t,p:Mze,num_pins:n}}},ALo=Yo.extend({fn:k(),num_pins:ce(2).default(2),w:k().default("5.40mm"),h:k().default("2.30mm"),pl:k().default("1.30mm"),pw:k().default("1.70mm"),p:k().default("3.5mm")}),fLo=(e)=>{let t=ALo.parse(e),n=Jo(0,ve.parse(t.h)/2+0.4,0.3),o={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:ve.parse(t.p)/2,y:ve.parse(t.h)/2},{x:-ve.parse(t.w)/2,y:ve.parse(t.h)/2},{x:-ve.parse(t.w)/2,y:-ve.parse(t.h)/2},{x:ve.parse(t.p)/2,y:-ve.parse(t.h)/2}],stroke_width:0.1,pcb_silkscreen_path_id:""},r=5.3,i=2.2,s={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:5.3,height:2.2,layer:"top"};return{circuitJson:xLo(t).concat(...X0(t),o,n,s),parameters:t}},yLo=(e)=>{let{pn:t,p:n}=e;return t===1?{x:-n/2,y:0}:{x:n/2,y:0}},xLo=(e)=>{let t=[];for(let n=1;n<=e.num_pins;n++){let{x:o,y:r}=yLo({pn:n,p:ve.parse(e.p)});t.push(Ao(n,o,r,ve.parse(e.pl),ve.parse(e.pw),0.125))}return t},CLo=Yo.extend({fn:k(),num_pins:ce(2).default(2),w:k().default("1.90mm"),h:k().default("1.33mm"),pl:k().default("0.5mm"),pw:k().default("0.7mm"),p:k().default("0.8mm")}),bLo=(e)=>{let t=CLo.parse(e),n=Jo(0,ve.parse(t.h)+0.1,0.3),o={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:ve.parse(t.p)/2+0.1,y:ve.parse(t.h)/2},{x:-ve.parse(t.w)/2,y:ve.parse(t.h)/2},{x:-ve.parse(t.w)/2,y:-ve.parse(t.h)/2},{x:ve.parse(t.p)/2+0.1,y:-ve.parse(t.h)/2}],stroke_width:0.1,pcb_silkscreen_path_id:""},r=1.8,i=1.2,s={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:1.8,height:1.2,layer:"top"};return{circuitJson:vLo(t).concat(...X0(t),o,n,s),parameters:t}};var ILo=(e)=>{let{pn:t,p:n}=e;if(t===1)return{x:-n/2,y:0};else return{x:n/2,y:0}},vLo=(e)=>{let t=[];for(let n=1;n<=e.num_pins;n++){let{x:o,y:r}=ILo({pn:n,p:ve.parse(e.p)});t.push(Ao(n,o,r,ve.parse(e.pl),ve.parse(e.pw),0.0625))}return t},SLo=Yo.extend({fn:k(),num_pins:ce(2).default(2),w:k().default("7.0mm"),h:k().default("3.35mm"),pl:k().default("1.50mm"),pw:k().default("2.70mm"),p:k().default("4.8mm")}),PLo=(e)=>{let t=SLo.parse(e),n=Jo(0,ve.parse(t.h),0.3),o={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:ve.parse(t.p)/2,y:ve.parse(t.h)/2},{x:-ve.parse(t.w)/2,y:ve.parse(t.h)/2},{x:-ve.parse(t.w)/2,y:-ve.parse(t.h)/2},{x:ve.parse(t.p)/2,y:-ve.parse(t.h)/2}],stroke_width:0.1,pcb_silkscreen_path_id:""},r=6.8,i=3.2,s={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:6.8,height:3.2,layer:"top"};return{circuitJson:MLo(t).concat(...X0(t),o,n,s),parameters:t}},ELo=(e)=>{let{pn:t,p:n}=e;if(t===1)return{x:-n/2,y:0};else return{x:n/2,y:0}},MLo=(e)=>{let t=[];for(let n=1;n<=e.num_pins;n++){let{x:o,y:r}=ELo({pn:n,p:ve.parse(e.p)});t.push(Ao(n,o,r,ve.parse(e.pl),ve.parse(e.pw),0.125))}return t},wLo=Yo.extend({fn:k(),num_pins:ce(2).default(2),w:k().default("3.0mm"),h:k().default("1.80mm"),pl:k().default("0.80mm"),pw:k().default("1.20mm"),p:k().default("1.6mm")}),BLo=(e)=>{let t=wLo.parse(e),n=Jo(0,ve.parse(t.h),0.3),o={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:ve.parse(t.p)/2,y:ve.parse(t.h)/2},{x:-ve.parse(t.w)/2-0.1,y:ve.parse(t.h)/2},{x:-ve.parse(t.w)/2-0.1,y:-ve.parse(t.h)/2},{x:ve.parse(t.p)/2,y:-ve.parse(t.h)/2}],stroke_width:0.1,pcb_silkscreen_path_id:""},r=2.9,i=1.7,s={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:2.9,height:1.7,layer:"top"};return{circuitJson:DLo(t).concat(...X0(t),o,n,s),parameters:t}},TLo=(e)=>{let{pn:t,p:n}=e;if(t===1)return{x:-n/2,y:0};else return{x:n/2,y:0}},DLo=(e)=>{let t=[];for(let n=1;n<=e.num_pins;n++){let{x:o,y:r}=TLo({pn:n,p:ve.parse(e.p)});t.push(Ao(n,o,r,ve.parse(e.pl),ve.parse(e.pw),0.1))}return t},NLo=Yo.extend({fn:k(),num_pins:ce(2).default(2),w:k().default("7.10mm"),h:k().default("3.40mm"),pl:k().default("2.50mm"),pw:k().default("1.80mm"),p:k().default("4.00mm")}),RLo=(e)=>{let t=NLo.parse(e),n=Jo(0,ve.parse(t.h)/2+0.5,0.3),o={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:ve.parse(t.p)/2,y:ve.parse(t.h)/2},{x:-ve.parse(t.w)/2-0.5,y:ve.parse(t.h)/2},{x:-ve.parse(t.w)/2-0.5,y:-ve.parse(t.h)/2},{x:ve.parse(t.p)/2,y:-ve.parse(t.h)/2}],stroke_width:0.1,pcb_silkscreen_path_id:""},r=7,i=3.5,s={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:7,height:3.5,layer:"top"};return{circuitJson:kLo(t).concat(...X0(t),o,n,s),parameters:t}},QLo=(e)=>{let{pn:t,p:n}=e;if(t===1)return{x:-n/2,y:0};return{x:n/2,y:0}},kLo=(e)=>{let t=[];for(let n=1;n<=e.num_pins;n++){let{x:o,y:r}=QLo({pn:n,p:ve.parse(e.p)});t.push(Ao(n,o,r,ve.parse(e.pl),ve.parse(e.pw),0.125))}return t},LLo=Yo.extend({fn:k(),num_pins:ce(2).default(2),w:k().default("4.80mm"),h:k().default("2.10mm"),pl:k().default("1.30mm"),pw:k().default("1.40mm"),p:k().default("2.9mm")}),HLo=(e)=>{let t=LLo.parse(e),n=Jo(0,ve.parse(t.h)-0.5,0.3),o={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:ve.parse(t.p)/2,y:ve.parse(t.h)/2},{x:-ve.parse(t.w)/2,y:ve.parse(t.h)/2},{x:-ve.parse(t.w)/2,y:-ve.parse(t.h)/2},{x:ve.parse(t.p)/2,y:-ve.parse(t.h)/2}],stroke_width:0.1,pcb_silkscreen_path_id:""},r=4.7,i=2.3,s={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:4.7,height:2.3,layer:"top"};return{circuitJson:zLo(t).concat(...X0(t),o,n,s),parameters:t}},FLo=(e)=>{let{pn:t,p:n}=e;if(t===1)return{x:-n/2,y:0};else return{x:n/2,y:0}},zLo=(e)=>{let t=[];for(let n=1;n<=e.num_pins;n++){let{x:o,y:r}=FLo({pn:n,p:ve.parse(e.p)});t.push(Ao(n,o,r,ve.parse(e.pl),ve.parse(e.pw),0.125))}return t},OLo=Yo.extend({fn:k(),num_pins:ce(2).default(2),w:k().default("7.30mm"),h:k().default("4.40mm"),pl:k().default("2.50mm"),pw:k().default("2.30mm"),p:k().default("4.30mm")}),VLo=(e)=>{let t=OLo.parse(e),n=Jo(0,ve.parse(t.h)/2+0.5,0.3),o={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:ve.parse(t.p)/2,y:ve.parse(t.h)/2},{x:-ve.parse(t.w)/2-0.1,y:ve.parse(t.h)/2},{x:-ve.parse(t.w)/2-0.1,y:-ve.parse(t.h)/2},{x:ve.parse(t.p)/2,y:-ve.parse(t.h)/2}],stroke_width:0.1,pcb_silkscreen_path_id:""},r=7.3,i=4.5,s={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:7.3,height:4.5,layer:"top"};return{circuitJson:GLo(t).concat(...X0(t),o,n,s),parameters:t}},YLo=(e)=>{let{pn:t,p:n}=e;if(t===1)return{x:-n/2,y:0};else return{x:n/2,y:0}},GLo=(e)=>{let t=[];for(let n=1;n<=e.num_pins;n++){let{x:o,y:r}=YLo({pn:n,p:ve.parse(e.p)});t.push(Ao(n,o,r,ve.parse(e.pl),ve.parse(e.pw),0.125))}return t},ULo=Yo.extend({fn:k(),num_pins:ce(2).default(2),w:k().default("10.70mm"),h:k().default("6.60mm"),pl:k().default("2.50mm"),pw:k().default("3.30mm"),p:k().default("6.80mm")}),WLo=(e)=>{let t=ULo.parse(e),n=Jo(0,3,0.3),o={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:ve.parse(t.p)/2,y:ve.parse(t.h)/2-0.8},{x:-ve.parse(t.w)/2-0.8,y:ve.parse(t.h)/2-0.8},{x:-ve.parse(t.w)/2-0.8,y:-ve.parse(t.h)/2+0.8},{x:ve.parse(t.p)/2,y:-ve.parse(t.h)/2+0.8}],stroke_width:0.1,pcb_silkscreen_path_id:""},r=9.8,i=6.7,s={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:9.8,height:6.7,layer:"top"};return{circuitJson:jLo(t).concat(...X0(t),o,n,s),parameters:t}},XLo=(e)=>{let{pn:t,p:n}=e;if(t===1)return{x:-n/2,y:0};return{x:n/2,y:0}},jLo=(e)=>{let t=[];for(let n=1;n<=e.num_pins;n++){let{x:o,y:r}=XLo({pn:n,p:ve.parse(e.p)});t.push(Ao(n,o,r,ve.parse(e.pl),ve.parse(e.pw),0.125))}return t},KLo=Yo.extend({fn:k(),num_pins:ge().default(4),w:k().default("8.50mm"),h:k().default("6.90mm"),pl:k().default("2mm"),pw:k().default("1.5mm"),p:k().default("2.30mm"),tabpl:k().optional(),tabpw:k().default("3.8mm"),taboffset:k().default("0mm"),string:k().optional()}),$Lo=(e)=>{let t=e.string?.match(/^sot223_(\d+)/),n=t?Number.parseInt(t[1],10):4;if(n===8){let r=ZLo.parse({...e,num_pins:n});return{circuitJson:kse(r),parameters:r}}let o=KLo.parse({...e,num_pins:n});if(o.num_pins===4)return{circuitJson:JLo(o),parameters:o};if(o.num_pins===5)return{circuitJson:tHo(o),parameters:o};if(o.num_pins===6)return{circuitJson:oHo(o),parameters:o};throw Error("Invalid number of pins")},qLo=(e)=>{let{pn:t,w:n,h:o,pl:r,p:i,taboffset:s}=e;if(t===1)return{x:-n/2+1.1,y:i};if(t===2)return{x:-n/2+1.1,y:0};if(t===3)return{x:-n/2+1.1,y:-i};return{x:n/2-1.1+s,y:0}},JLo=(e)=>{let t=[],n=0,o=0,r=Number.parseFloat(e.w),i=Number.parseFloat(e.h),s=Number.parseFloat(e.pl),a=Number.parseFloat(e.p),c=Number.parseFloat(e.pw),l=Number.parseFloat(e.tabpl??e.pl),h=Number.parseFloat(e.tabpw),d=Number.parseFloat(e.taboffset);for(let b=0;b<e.num_pins;b++){let{x:I,y:v}=qLo({num_pins:e.num_pins,pn:b+1,w:r,h:i,pl:s,p:a,taboffset:d}),P=b===3?h:c,M=b===3?l:s,B=Math.min(M,P)/8;n=Math.max(n,Math.abs(I)+M/2),o=Math.max(o,Math.abs(v)+P/2),t.push(Ao(b+1,I,v,M,P,B))}let u=Jo(0,0,0.3),_=r/2-2.4,p=i/2,m={layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"silkscreen_path_1",route:[{x:-_,y:p},{x:_,y:p},{x:_,y:p/2+0.5}],type:"pcb_silkscreen_path",stroke_width:0.1},A={layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"silkscreen_path_2",route:[{x:-_,y:-p},{x:_,y:-p},{x:_,y:-p/2-0.5}],type:"pcb_silkscreen_path",stroke_width:0.1},g=r/2,f=i/2,y=Math.max(n+0.25,g+0.15),x=Math.max(o+0.25,f+0.15),C={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:2*y,height:2*x,layer:"top"};return[...t,m,A,u,C]},ZLo=EO({p:"0.90mm",w:"2.8mm",legsoutside:!0}),eHo=(e)=>{let{p:t,h:n,pn:o,w:r}=e;if(o===1)return{x:-r/2+1.2,y:t/2+t};if(o===2)return{x:-r/2+1.2,y:t/2};if(o===3)return{x:-r/2+1.2,y:-t/2};if(o===4)return{x:-r/2+1.2,y:-t/2-t};if(o===5)return{x:r/2-1,y:0};throw Error("Invalid pin number")},tHo=(e)=>{let t=[],n=0,o=0,r=Number.parseFloat(e.w),i=Number.parseFloat(e.h);for(let A=1;A<=e.num_pins;A++){let{x:g,y:f}=eHo({h:i,p:1.5,pn:A,w:r}),y=Number.parseFloat(e.pw),x=Number.parseFloat(e.pl);if(A===5)y=3.4,x=1.8;else y=1,x=2.2;let C=Math.min(x,y)/8;n=Math.max(n,Math.abs(g)+x/2),o=Math.max(o,Math.abs(f)+y/2),t.push(Ao(A,g,f,x,y,C))}let s=r/2-2.4,a=i/2,c={layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"silkscreen_path_1",route:[{x:-s,y:a},{x:s,y:a},{x:s,y:a/2+0.5}],type:"pcb_silkscreen_path",stroke_width:0.1},l={layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"silkscreen_path_2",route:[{x:-s,y:-a},{x:s,y:-a},{x:s,y:-a/2-0.5}],type:"pcb_silkscreen_path",stroke_width:0.1},h=Jo(0,0,0.3),d=r/2,u=i/2,_=Math.max(n+0.25,d+0.15),p=Math.max(o+0.25,u+0.15),m={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:2*_,height:2*p,layer:"top"};return[...t,c,l,h,m]},nHo=(e)=>{let{p:t,h:n,pn:o,w:r}=e;if(o===1)return{x:-r/2+1.2,y:2*t};if(o===2)return{x:-r/2+1.2,y:t};if(o===3)return{x:-r/2+1.2,y:0};if(o===4)return{x:-r/2+1.2,y:-t};if(o===5)return{x:-r/2+1.2,y:-2*t};if(o===6)return{x:r/2-1.175,y:0};throw Error("Invalid pin number")},oHo=(e)=>{let t=[],n=0,o=0,r=Number.parseFloat(e.h),i=8.7;for(let A=1;A<=e.num_pins;A++){let{x:g,y:f}=nHo({h:r,p:1.3,pn:A,w:i}),y=Number.parseFloat(e.pw),x=Number.parseFloat(e.pl);if(A===6)y=3.4,x=2.15;else y=0.6,x=2.2;let C=Math.min(x,y)/8;n=Math.max(n,Math.abs(g)+x/2),o=Math.max(o,Math.abs(f)+y/2),t.push(Ao(A,g,f,x,y,C))}let s=Number.parseFloat(e.w)/2-2.4,a=r/2,c={layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"silkscreen_path_1",route:[{x:-s,y:a},{x:s,y:a},{x:s,y:a/2+0.5}],type:"pcb_silkscreen_path",stroke_width:0.1},l={layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"silkscreen_path_2",route:[{x:-s,y:-a},{x:s,y:-a},{x:s,y:-a/2-0.5}],type:"pcb_silkscreen_path",stroke_width:0.1},h=Jo(0,0,0.3),d=Number.parseFloat(e.w)/2,u=r/2,_=Math.max(n+0.25,d+0.15),p=Math.max(o+0.25,u+0.15),m={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:2*_,height:2*p,layer:"top"};return[...t,c,l,h,m]},rHo=Yo.extend({fn:k(),num_pins:ge().default(3),w:k().default("3.40mm"),h:k().default("3.30mm"),pl:k().default("1mm"),pw:k().default("0.7mm"),p:k().default("1.2mm"),string:k().optional()}),iHo=(e)=>{let t=e.string?.match(/^sot23w_(\d+)/),n=t?Number.parseInt(t[1],3):3,o=rHo.parse({...e,num_pins:n});if(o.num_pins===3)return{circuitJson:aHo(o),parameters:o};throw Error("Invalid number of pins")},sHo=(e)=>{let{pn:t,w:n,h:o,pl:r,p:i}=e;if(t===1)return{x:-i,y:0.95};if(t===2)return{x:-i,y:-0.95};return{x:i,y:0}},aHo=(e)=>{let t=[],n=Number.parseFloat(e.w),o=Number.parseFloat(e.h),r=Number.parseFloat(e.pl),i=Number.parseFloat(e.pw),s=Number.parseFloat(e.p),a=Math.min(r,i)/8;for(let y=0;y<e.num_pins;y++){let{x,y:C}=sHo({num_pins:e.num_pins,pn:y+1,w:n,h:o,pl:r,p:s});t.push(Ao(y+1,x,C,r,i,a))}let c=Jo(0,Number.parseInt(e.h)/2+1,0.3),l=n/2-1,h=o/2,d={layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"silkscreen_path_1",route:[{x:-l,y:h},{x:l+0.3,y:h},{x:l+0.3,y:h/2}],type:"pcb_silkscreen_path",stroke_width:0.1},u={layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"silkscreen_path_2",route:[{x:-l,y:-h},{x:l+0.3,y:-h},{x:l+0.3,y:-h/2}],type:"pcb_silkscreen_path",stroke_width:0.1},_=s+r/2,p=0.95+i/2,m=o/2,A=_+0.25,g=Math.max(p+0.25,m+0.09),f={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:2*A,height:2*g,layer:"top"};return[...t,d,u,c,f]},cHo=Yo.extend({fn:k(),num_pins:an([ce(3),ce(2)]).default(3),p:k().default("1.27mm"),id:k().default("0.72mm"),od:k().default("0.95mm"),w:k().default("2.5mm"),h:k().default("4.2mm"),string:k().optional()}),lHo=(e)=>{let{p:t,id:n,od:o,w:r,h:i}=e,s=Number.parseFloat(i)/2,a=Number.parseFloat(t);return[Li(1,-a,s-a,n,o),Li(2,0,s-a,n,o),Li(3,a,s-a,n,o)]},hHo=(e)=>{let{p:t,id:n,od:o,h:r}=e,i=Number.parseFloat(r)/2,s=Number.parseFloat(t),a=Number.parseFloat(n),c=Number.parseFloat(o),l=c*1.4285714285714286;return[Gy({pn:1,x:-s,y:i-s,holeDiameter:a,rectPadWidth:c,rectPadHeight:l}),dS(2,s,i-s,a,c,l)]},dHo=(e)=>{let t=e.string?.match(/^to92s_(\d+)/),n=t?Number.parseInt(t[1],10):3,o=cHo.parse({...e,num_pins:n}),r=[];if(o.num_pins===3)r=lHo(o);else if(o.num_pins===2)r=hHo(o);else throw Error("Invalid number of pins for TO-92");let i=Number.parseFloat(o.h)/2,s=Number.parseFloat(o.p),a={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:-i,y:i-s},{x:-1.9,y:0},{x:1.9,y:0},{x:i,y:i-s},{x:1.5,y:Number.parseFloat(o.h)/2+0.5},{x:-1.5,y:Number.parseFloat(o.h)/2+0.5},{x:-i,y:i-s}],stroke_width:0.1,pcb_silkscreen_path_id:""},c=Jo(0,i+1,0.5),l=Number.parseFloat(o.od),h=i-s,d=-s-l/2,u=s+l/2,_=h-l/2,p=h+l/2,m=-i,A=i,g=0,f=i+0.5,y=Math.min(d,m)-0.25,x=Math.max(u,A)+0.25,C=Math.min(_,g)-0.25,b=Math.max(p,f)+0.25,I={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:(y+x)/2,y:(C+b)/2},width:x-y,height:b-C,layer:"top"};return{circuitJson:[...r,a,c,I],parameters:o}},uHo=Yo.extend({fn:k(),p:ve.optional(),id:ve.optional(),pw:ve.optional(),pl:ve.optional(),w:ve.optional(),h:ve.optional(),mpx:ve.optional().describe("center-to-center distance between the SMD mounting pads"),mpy:ve.optional().describe("mounting-pad row distance from the signal-pad row"),mpw:ve.optional().describe("SMD mounting pad width"),mpl:ve.optional().describe("SMD mounting pad length"),mounttop:Be().optional().describe("place SMD mounting pads above the signal-pad row"),smd:Be().optional().describe("Generic surface-mount JST-style connector with one signal row and two mounting pads."),sh:Be().optional().describe('JST SH (Surface-mount) connector family. SH stands for "Super High-density".'),ph:Be().optional().describe('JST PH (Through-hole) connector family. PH stands for "Pin Header".'),zh:Be().optional().describe("JST ZH (Through-hole) connector family. 1.5mm pitch wire-to-board."),xh:Be().optional().describe("JST XH (Through-hole) connector family. 2.5mm pitch wire-to-board."),string:k().optional()}),pHo=()=>({minX:Number.POSITIVE_INFINITY,maxX:Number.NEGATIVE_INFINITY,minY:Number.POSITIVE_INFINITY,maxY:Number.NEGATIVE_INFINITY}),jR=({bounds:e,centerX:t,centerY:n,width:o,height:r})=>{let i=o/2,s=r/2;e.minX=Math.min(e.minX,t-i),e.maxX=Math.max(e.maxX,t+i),e.minY=Math.min(e.minY,n-s),e.maxY=Math.max(e.maxY,n+s)},mHo={ph:{p:ve.parse("2mm"),id:ve.parse("0.75mm"),pw:ve.parse("1.20mm"),pl:ve.parse("1.75mm"),h:ve.parse("5mm")},sh:{p:ve.parse("1mm"),pw:ve.parse("0.6mm"),pl:ve.parse("1.55mm"),w:ve.parse("5.8mm"),h:ve.parse("7.8mm")},smd:{p:ve.parse("2mm"),id:0,pw:ve.parse("1mm"),pl:ve.parse("3mm"),mpw:ve.parse("1.8mm"),mpl:ve.parse("3mm"),mpy:ve.parse("2.5mm"),w:ve.parse("8mm"),h:ve.parse("5mm")},zh:{p:ve.parse("1.5mm"),id:ve.parse("0.73mm"),pw:ve.parse("1.03mm"),pl:ve.parse("1.73mm"),w:ve.parse("3mm"),h:ve.parse("3.5mm")},xh:{p:ve.parse("2.5mm"),pw:ve.parse("1.7mm")}};function _Ho(e){if(e.smd)return"smd";if(e.sh)return"sh";if(e.ph)return"ph";if(e.zh)return"zh";if(e.xh)return"xh";return"ph"}function gHo({variant:e,numPins:t,p:n,id:o,pw:r,pl:i,mpx:s,mpy:a,mpw:c,mpl:l,mounttop:h}){let d=[],u=pHo(),_=0;if(e==="smd"){let p=-((t-1)/2)*n;for(let A=0;A<t;A++){let g=p+A*n;d.push(Ao(A+1,g,0,r,i)),jR({bounds:u,centerX:g,centerY:0,width:r,height:i})}let m=a===0?0:(h?1:-1)*a;for(let[A,g]of[-s/2,s/2].entries())d.push(Ao(t+A+1,g,m,c,l)),jR({bounds:u,centerX:g,centerY:m,width:c,height:l});_=Math.max(i/2,l/2)}else if(e==="ph"){let p=-((t-1)/2)*n;for(let m=0;m<t;m++){let A=p+m*n;if(m===0)d.push(Gy({pn:m+1,x:A,y:0,holeDiameter:o,rectPadWidth:r,rectPadHeight:i,rectBorderRadius:0.1249998}));else d.push(dS(m+1,A,0,o,r,i));jR({bounds:u,centerX:A,centerY:0,width:r,height:i}),_=Math.max(_,i/2)}}else if(e==="zh"){let p=-((t-1)/2)*n;for(let m=0;m<t;m++){let A=p+m*n;if(m===0)d.push(Gy({pn:m+1,x:A,y:0,holeDiameter:o,rectPadWidth:r,rectPadHeight:i,rectBorderRadius:0.12499977}));else d.push(dS(m+1,A,0,o,r,i));jR({bounds:u,centerX:A,centerY:0,width:r,height:i}),_=Math.max(_,i/2)}}else if(e==="xh"){let p=-((t-1)/2)*n;for(let m=0;m<t;m++){let A=p+m*n;if(m===0)d.push(Gy({pn:m+1,x:A,y:0,holeDiameter:o,rectPadWidth:r,rectPadHeight:i,rectBorderRadius:0.12500015}));else d.push(dS(m+1,A,0,o,r,i));jR({bounds:u,centerX:A,centerY:0,width:r,height:i}),_=Math.max(_,i/2)}}else{let p=-((t-1)/2)*n;for(let A=0;A<t;A++){let g=p+A*n;d.push(Ao(A+1,g,-1.325,r,i)),jR({bounds:u,centerX:g,centerY:-1.325,width:r,height:i}),_=Math.max(_,i/2)}let m=(t-1)/2*n+1.3;d.push(Ao(t+1,-m,1.22,1.2,1.8)),d.push(Ao(t+2,m,1.22,1.2,1.8)),jR({bounds:u,centerX:-m,centerY:1.22,width:1.2,height:1.8}),jR({bounds:u,centerX:m,centerY:1.22,width:1.2,height:1.8}),_=Math.max(_,0.9)}return{pads:d,padBounds:u,maxPadHalfY:_}}function AHo({variant:e,w:t,h:n,numPins:o,p:r}){let i=(s)=>({type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:s,stroke_width:0.1,pcb_silkscreen_path_id:""});if(e==="smd")return[i([{x:-t/2,y:-n/2},{x:t/2,y:-n/2},{x:t/2,y:n/2},{x:-t/2,y:n/2},{x:-t/2,y:-n/2}])];else if(e==="ph"){let s=n/2+0.5,a=s-n;return[i([{x:-t/2,y:s},{x:t/2,y:s},{x:t/2,y:a},{x:-t/2,y:a},{x:-t/2,y:s}])]}else if(e==="zh"&&o&&r){let s=(o-1)*r,a=-s/2-1.5,c=s/2+1.5,l=-n/2,h=n/2;return[i([{x:a,y:l},{x:c,y:l},{x:c,y:h},{x:a,y:h},{x:a,y:l}])]}else if(e==="xh"&&o&&r){let s=-((o-1)/2)*r,a=Array.from({length:o},(y,x)=>s+x*r),c=a[0],l=a[o-1],h=(c+l)/2,d=-2.75,u=-3.51,_=2.46,p=2.75,m=1.5,A=0.2,g=(y,x,C,b)=>i([{x:y,y:x},{x:C,y:x},{x:C,y:b},{x:y,y:b},{x:y,y:x}]),f=[];if(f.push(g(c-2.56,2.46,l+2.56,-3.51)),f.push(i([{x:c-1.6,y:2.75},{x:c-2.85,y:2.75},{x:c-2.85,y:1.5}])),f.push(i([{x:c-2.55,y:0.2},{x:c-1.8,y:0.2},{x:c-1.8,y:-2.75},{x:h,y:-2.75}])),f.push(i([{x:l+2.55,y:0.2},{x:l+1.8,y:0.2},{x:l+1.8,y:-2.75},{x:h,y:-2.75}])),f.push(g(c-2.55,2.45,c-0.75,1.7)),l-0.75>c+0.75)f.push(g(c+0.75,2.45,l-0.75,1.7));return f.push(g(l+0.75,2.45,l+2.55,1.7)),f}else return[]}var fHo=(e)=>{let t=uHo.parse(e),n=_Ho(t),o=mHo[n],r,i=e.num_pins;if(typeof i==="number")r=i;let s=typeof e.string==="string"?e.string:"",a=s.match(/(?:^|_)jst(\d+)(?:_|$)/),c=s.match(/(?:^|_)zh(\d+)(?:_|$)/);if(a&&a[1]){let te=Number.parseInt(a[1],10);if(!Number.isNaN(te))r=te}if(c&&c[1]){let te=Number.parseInt(c[1],10);if(!Number.isNaN(te))r=te}if(typeof r!=="number")throw Error(`JST requires an explicit pin count (e.g. jst6_sh or .jst(6))${t.string?`, from string "${t.string}"`:""}`);let l=t.p??o.p,h=t.id??(n==="xh"?r===2?1:0.95:o.id),d=t.pw??o.pw,u=t.pl??(n==="xh"?r===2?2:1.95:o.pl),_=(r-1)*l+4,p=n==="xh"?(r-1)*l+5.12:n==="ph"?_:o.w,m=t.w??p,A=t.h??(n==="xh"?5.97:o.h),g=t.mpx??(r-1)*l+3.4,f=t.mpy??o.mpy??0,y=t.mpw??o.mpw??0,x=t.mpl??o.mpl??0,C=t.mounttop??!1,b=gHo({variant:n,numPins:r,p:l,id:h,pw:d,pl:u,mpx:g,mpy:f,mpw:y,mpl:x,mounttop:C}),{pads:I,padBounds:v,maxPadHalfY:P}=b,M=n==="smd"?Math.max(m,2*Math.max(Math.abs(v.minX),Math.abs(v.maxX))+0.4):m,B=n==="smd"?Math.max(A,2*Math.max(Math.abs(v.minY),Math.abs(v.maxY))+0.4):A,T=AHo({variant:n,w:M,h:B,numPins:r,p:l}),N=Jo(0,B/2+1,0.5),D=T.flatMap((te)=>te.route),L=D.map((te)=>te.x),H=D.map((te)=>te.y),V=L.length>0&&H.length>0,O=V?Math.min(v.minX,Math.min(...L)):v.minX,U=V?Math.max(v.maxX,Math.max(...L)):v.maxX,j=V?Math.min(v.minY,Math.min(...H)):v.minY,Y=V?Math.max(v.maxY,Math.max(...H)):v.maxY,X=0.5,K=0.05,J=P+0.085,ee=O-X,se=U+X,ne=j-J,re=Y+K,Z=n==="ph"?{type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:-0.55},width:(r-1)*l+4.9,height:5.5,layer:"top"}:n==="xh"?{type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:-0.525},width:(r-1)*l+5.9,height:6.75,layer:"top"}:{type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:(ee+se)/2,y:(ne+re)/2},width:se-ee,height:re-ne,layer:"top"};return{circuitJson:[...I,...T,N,Z],parameters:{...t,p:l,id:h,pw:d,pl:u,w:m,h:A,num_pins:r,sh:n==="sh",ph:n==="ph",smd:n==="smd",zh:n==="zh",xh:n==="xh",...n==="smd"?{mpx:g,mpy:f,mpw:y,mpl:x,mounttop:C}:{}}}},yHo=Yo.extend({fn:k(),num_pins:ce(2).default(2),w:k().default("3.30mm"),h:k().default("1.70mm"),pl:k().default("0.80mm"),pw:k().default("1mm"),p:k().default("1.90mm")}),xHo=(e)=>{let t=yHo.parse(e),n=Jo(0,ve.parse(t.h)/2+0.5,0.3),o={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:ve.parse(t.p)/2,y:ve.parse(t.h)/2},{x:-ve.parse(t.w)/2,y:ve.parse(t.h)/2},{x:-ve.parse(t.w)/2,y:-ve.parse(t.h)/2},{x:ve.parse(t.p)/2,y:-ve.parse(t.h)/2}],stroke_width:0.1,pcb_silkscreen_path_id:""},r=3.2,i=2,s={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:3.2,height:2,layer:"top"};return{circuitJson:bHo(t).concat(...X0(t),o,n,s),parameters:t}},CHo=(e)=>{let{pn:t,p:n}=e;if(t===1)return{x:-n/2,y:0};return{x:n/2,y:0}},bHo=(e)=>{let t=[];for(let n=1;n<=e.num_pins;n++){let{x:o,y:r}=CHo({pn:n,p:ve.parse(e.p)});t.push(Ao(n,o,r,ve.parse(e.pl),ve.parse(e.pw),0.1))}return t},IHo=(e)=>{switch(e){case 8:return{w:"3.06mm",h:"3.14mm",p:"0.65mm",pl:"1.6mm",pw:"0.5mm"};case 10:return{w:"3.10mm",h:"3.33mm",p:"0.5mm",pl:"1.45mm",pw:"0.3mm"};default:return{w:"3.06mm",h:"3.14mm",p:"0.65mm",pl:"1.6mm",pw:"0.5mm"}}},vHo=Yo.extend({fn:k(),num_pins:an([ce(8),ce(10)]).default(8),w:k().optional(),h:k().optional(),p:k().optional(),pl:k().optional(),pw:k().optional(),thermalpad:p5.optional(),...hK,string:k().optional()}),SHo=(e)=>{let t=vHo.parse(e),n=IHo(t.num_pins),o=ve.parse(t.w||n.w),r=ve.parse(t.h||n.h),i=ve.parse(t.p||n.p),s=ve.parse(t.pl||n.pl),a=ve.parse(t.pw||n.pw),c=Math.min(s,a)/8,l=[],h=t.num_pins/2;for(let P=0;P<t.num_pins;P++){let{x:M,y:B}=zEt(t.num_pins,P+1,o,i),T=P<h?P+1:t.num_pins-(P-h);l.push(Ao(T,M,B,s,a,c))}if(t.thermalpad)l.push(Lw(t.thermalpad,{x:t.thermalpadcenteroffsetx,y:t.thermalpadcenteroffsety}));let d=o,u=r,_={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:-d/2,y:u/2},{x:d/2,y:u/2}],stroke_width:0.05,pcb_silkscreen_path_id:""},p={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:-d/2,y:-u/2},{x:d/2,y:-u/2}],stroke_width:0.05,pcb_silkscreen_path_id:""},m=zEt(t.num_pins,1,d,i),A={x:m.x-0.8,y:m.y},g={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"pin_marker_1",route:[{x:A.x-0.4,y:A.y},{x:A.x-0.7,y:A.y+0.3},{x:A.x-0.7,y:A.y-0.3},{x:A.x-0.4,y:A.y}],stroke_width:0.05,pcb_silkscreen_path_id:"pin_marker_1"},f=Jo(0,u/2+0.5,0.3),y=(t.num_pins/2-1)*i+a,x=o/2+0.25,C=x+1.43,b=y/2+0.255,I=r/2+0.25,v={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",layer:"top",outline:Uy([{minX:-C,maxX:C,minY:-b,maxY:b},{minX:-x,maxX:x,minY:-I,maxY:I}])};return{circuitJson:[...l,_,p,f,g,v],parameters:t}},zEt=(e,t,n,o)=>{let r=e/2,i=(t-1)%r,s=t<=r?-1:1,a=(r-1)/2-i;return{x:s*2.11,y:a*o}},PHo=(e)=>{switch(e){case 10:return{w:"3.10mm",h:"3.32mm",p:"0.5mm",pl:"1.63mm",pw:"0.33mm"};case 12:return{w:"3mm",h:"4mm",p:"0.65mm",pl:"0.88mm",pw:"0.4mm"};case 16:return{w:"3.10mm",h:"4mm",p:"0.5mm",pl:"0.88mm",pw:"0.3mm"};default:return{w:"3.10mm",h:"3.32mm",p:"0.65mm",pl:"1.63mm",pw:"0.4mm"}}},EHo=Yo.extend({fn:k(),num_pins:an([ce(8),ce(10),ce(12),ce(16)]).default(8),w:k().optional(),h:k().optional(),p:k().optional(),pl:k().optional(),pw:k().optional(),thermalpad:p5.optional(),...hK,string:k().optional()}),OEt=(e,t,n,o,r)=>{let i=e/2,s=(t-1)%i,a=t<=i?-1:1,c=(i-1)/2-s,l=ve.parse("0.2mm");return{x:a*(n/2+r/2-l),y:c*o}},MHo=(e)=>{let t=EHo.parse(e),n=PHo(t.num_pins),o=ve.parse(t.w||n.w),r=ve.parse(t.h||n.h),i=ve.parse(t.p||n.p),s=ve.parse(t.pl||n.pl),a=ve.parse(t.pw||n.pw),c=Math.min(s,a)/8,l=[];for(let v=0;v<t.num_pins;v++){let{x:P,y:M}=OEt(t.num_pins,v+1,o,i,s);l.push(Ao(v+1,P,M,s,a,c))}if(t.thermalpad)l.push(Lw(t.thermalpad,{x:t.thermalpadcenteroffsetx,y:t.thermalpadcenteroffsety}));let h=o,d=r,u={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:-h/2,y:d/2},{x:h/2,y:d/2}],stroke_width:0.05,pcb_silkscreen_path_id:""},_={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:-h/2,y:-d/2},{x:h/2,y:-d/2}],stroke_width:0.05,pcb_silkscreen_path_id:""},p=OEt(t.num_pins,1,h,i,s),m={x:p.x-0.8,y:p.y},A={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"pin_marker_1",route:[{x:m.x-0.4,y:m.y},{x:m.x-0.7,y:m.y+0.3},{x:m.x-0.7,y:m.y-0.3},{x:m.x-0.4,y:m.y}],stroke_width:0.05,pcb_silkscreen_path_id:"pin_marker_1"},g=Jo(0,d/2+0.5,0.3),f=(t.num_pins/2-1)*i+a,y=o/2+0.25,x=y+1.43,C=f/2+0.255,b=r/2+0.25,I={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",layer:"top",outline:Uy([{minX:-x,maxX:x,minY:-C,maxY:C},{minX:-y,maxX:y,minY:-b,maxY:b}])};return{circuitJson:[...l,u,_,g,A,I],parameters:t}},wHo=Yo.extend({fn:k(),num_pins:ce(2).default(2),w:k().default("3.8mm"),h:k().default("1.65mm"),pl:k().default("1.2mm"),pw:k().default("1.2mm"),pad_spacing:k().default("2.6mm")}),BHo=(e)=>{let t=wHo.parse(e),n=Jo(0,ve.parse(t.h),0.3),o={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:ve.parse(t.pad_spacing)/2,y:ve.parse(t.h)/2},{x:-ve.parse(t.w)/2-0.2,y:ve.parse(t.h)/2},{x:-ve.parse(t.w)/2-0.2,y:-ve.parse(t.h)/2},{x:ve.parse(t.pad_spacing)/2,y:-ve.parse(t.h)/2}],stroke_width:0.1,pcb_silkscreen_path_id:""},r=4.3,i=2.15,s={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:4.3,height:2.15,layer:"top"};return{circuitJson:DHo(t).concat(...X0(t),o,n,s),parameters:t}},THo=(e)=>{let{pn:t,pad_spacing:n}=e;if(t===1)return{x:-n/2,y:0};else return{x:n/2,y:0}},DHo=(e)=>{let t=[];for(let n=1;n<=e.num_pins;n++){let{x:o,y:r}=THo({pn:n,pad_spacing:ve.parse(e.pad_spacing)});t.push(Ao(n,o,r,ve.parse(e.pl),ve.parse(e.pw)))}return t},NHo=Yo.extend({fn:k(),num_pins:ce(2).default(2),w:k().default("3.20mm"),h:k().default("1.65mm"),pl:k().default("0.8mm"),pw:k().default("0.9mm"),pad_spacing:k().default("2.1mm")}),RHo=(e)=>{let t=NHo.parse(e),n=Jo(0,ve.parse(t.h),0.3),o={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:ve.parse(t.pad_spacing)/2,y:ve.parse(t.h)/2},{x:-ve.parse(t.w)/2-0.2,y:ve.parse(t.h)/2},{x:-ve.parse(t.w)/2-0.2,y:-ve.parse(t.h)/2},{x:ve.parse(t.pad_spacing)/2,y:-ve.parse(t.h)/2}],stroke_width:0.1,pcb_silkscreen_path_id:""},r=3.7,i=2.15,s={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:3.7,height:2.15,layer:"top"};return{circuitJson:kHo(t).concat(...X0(t),o,n,s),parameters:t}},QHo=(e)=>{let{pn:t,pad_spacing:n}=e;if(t===1)return{x:-n/2,y:0};else return{x:n/2,y:0}},kHo=(e)=>{let t=[];for(let n=1;n<=e.num_pins;n++){let{x:o,y:r}=QHo({pn:n,pad_spacing:ve.parse(e.pad_spacing)});t.push(Ao(n,o,r,ve.parse(e.pl),ve.parse(e.pw)))}return t},LHo=Yo.extend({fn:k(),num_pins:an([ce(6),ce(8)]).default(8),w:k().default("3mm"),h:k().default("3mm"),p:k().default("0.5mm"),pl:k().default("0.52mm"),pw:k().default("0.35mm"),epw:k().default("1.40mm"),eph:k().default("1.60mm"),string:k().optional(),ep:Be().default(!1)}),HHo=(e)=>{if(e.string&&e.string.includes("_ep"))e.ep=!0;let t=e.string?.match(/^son_(\d+)/),n=t?Number.parseInt(t[1],10):e.num_pins||8,o=LHo.parse({...e,num_pins:n}),r=ve.parse(o.w),i=ve.parse(o.h),s=ve.parse(o.p),a=ve.parse(o.pl),c=ve.parse(o.pw),l=ve.parse(o.epw),h=ve.parse(o.eph),d=Math.min(a,c)/8,u=[];for(let N=0;N<o.num_pins;N++){let{x:D,y:L}=wze(o.num_pins,N+1,r,s);u.push(Ao(N+1,D,L,a,c,d))}if(o.ep)u.push(Ao(o.num_pins+1,0,0,l,h));let _=r,p=i,m={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:-_/2,y:p/2},{x:_/2,y:p/2}],stroke_width:0.05,pcb_silkscreen_path_id:""},A={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:-_/2,y:-p/2},{x:_/2,y:-p/2}],stroke_width:0.05,pcb_silkscreen_path_id:""},g=wze(o.num_pins,1,_,s),f={x:g.x-0.4,y:g.y},y={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"pin_marker_1",route:[{x:f.x-0.4,y:f.y},{x:f.x-0.7,y:f.y+0.3},{x:f.x-0.7,y:f.y-0.3},{x:f.x-0.4,y:f.y}],stroke_width:0.05,pcb_silkscreen_path_id:"pin_marker_1"},x=Jo(0,p/2+0.5,0.3),C=Math.abs(wze(o.num_pins,1,r,s).x),b=(o.num_pins/2-1)*s+c,I=C*2+a,v=r/2+0.25,P=I/2+0.25,M=b/2+0.25,B=i/2+0.25,T={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",layer:"top",outline:Uy([{minX:-P,maxX:P,minY:-M,maxY:M},{minX:-v,maxX:v,minY:-B,maxY:B}])};return{circuitJson:[...u,m,A,x,y,T],parameters:o}},wze=(e,t,n,o)=>{let r=e/2,i=(t-1)%r,s=t<=r?-1:1,a=(r-1)/2-i;return{x:s*ve.parse("1.4mm"),y:a*o}},FHo=Yo.extend({fn:k(),num_pins:ge().optional().default(8),p:Ke.describe("pitch (distance between center of each pin)"),w:ve.describe("width between vertical rows of pins"),grid:p5.describe("width and height of the border of the footprint"),ep:p5.default("0x0mm").describe("width and height of the central exposed thermal pad"),epx:ve.default("0mm").describe("x offset of the center of the central exposed thermal pad"),pinw:ve.describe("width of the pin pads"),pinh:ve.describe("height of the pin pads")}),zHo=(e)=>{let t=FHo.parse(e),{num_pins:n,p:o,w:r,grid:i,ep:s,epx:a,pinw:c,pinh:l}=t;if(n%2!==0)throw Error("invalid number of pins");let h=[],d=Math.min(c,l)/8;for(let v=0;v<n;v++){let{pinX:P,pinY:M}=OHo({pinCount:n,pinIndex:v,width:r,pitch:o});h.push(Ao(v+1,P,M,c,l,d))}if(s.x>0&&s.y>0)h.push(Ao(t.num_pins+1,a,0,s.x,s.y));let u=VHo(i),_=Jo(0,i.y/2+o,i.y/6),p=(n/2-1)*o+l,m=r+c,A=i.x/2+0.25,g=m/2+0.25,f=p/2+0.25,y=p/2+0.45+Math.max(0,0.8-o),x=Math.min(i.y/2+0.25,y),C=Math.max(0,0.37-Math.max(0,g-A-0.38)*1.4),b=Math.max(f,x-C),I={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",layer:"top",outline:Uy([{minX:-g,maxX:g,minY:-b,maxY:b},{minX:-A,maxX:A,minY:-x,maxY:x}])};return{circuitJson:[...h,...u,_,I],parameters:t}},OHo=(e)=>{let t=0,n=0,o=(e.pinCount/2-1)*e.pitch/2,r=e.pinCount/2;if(e.pinIndex+1<=r)t=e.pitch*e.pinIndex-o,n=0-e.width/2;else t=e.pitch*(e.pinCount-e.pinIndex-1)-o,n=e.width/2;return{pinX:n,pinY:t}},VHo=(e)=>{let n=e.y/30;return[{layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"",type:"pcb_silkscreen_path",route:[{x:-e.x/2-0.1,y:e.y/2+0.1-n},{x:-e.x/2-0.1,y:e.y/2+0.1},{x:e.x/2+0.1,y:e.y/2+0.1},{x:e.x/2+0.1,y:e.y/2+0.1-n}],stroke_width:e.y/30},{layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"",type:"pcb_silkscreen_path",route:[{x:-e.x/2-0.1,y:-e.y/2-0.1+n},{x:-e.x/2-0.1,y:-e.y/2-0.1},{x:e.x/2+0.1,y:-e.y/2-0.1},{x:e.x/2+0.1,y:-e.y/2-0.1+n}],stroke_width:e.y/30}]},YHo=Yo.extend({fn:ce("wson"),num_pins:ce(8).default(8),p:ve.default("0.5mm").describe("pin pitch"),rowspan:ve.default("3.015mm").describe("distance between pad rows"),pl:ve.default("0.6mm").describe("pad length across the package edge"),pw:ve.default("0.28mm").describe("pad width along the pin row"),ep:Be().default(!0).describe("include the exposed pad"),epw:ve.default("1.7mm").describe("exposed pad width"),eph:ve.default("0.3mm").describe("exposed pad height"),w:ve.default("2mm").describe("package body width"),h:ve.default("3mm").describe("package body height")}),GHo=(e)=>{let t=YHo.parse(e),{p:n,rowspan:o,pl:r,pw:i,ep:s,epw:a,eph:c,w:l,h}=t,d=[],u=-3*n/2;for(let f=0;f<4;f+=1){let y=u+f*n;d.push(Ao(f+1,y,-o/2,i,r)),d.push(Ao(8-f,y,o/2,i,r))}if(s)d.push(Ao(9,0,0,a,c));let _=[Es([{x:-l/2,y:-h/2},{x:-l/2,y:h/2}]),Es([{x:l/2,y:-h/2},{x:l/2,y:h/2}])],p=Jo(0,Math.max(h/2,(o+r)/2)+0.6,0.5),m=Math.max(3*n+i,s?a:0),A=Math.max(o+r,s?c:0),g={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:Math.max(l,m)+0.5,height:Math.max(h,A)+0.5,layer:"top"};return{circuitJson:[...d,..._,p,g],parameters:t}},UHo=(e)=>{let{num_pins:t,bridged:n,p:o=2.54,pw:r=1.5,ph:i=1.5}=e,s=ve.parse(o),a=ve.parse(r),c=ve.parse(i),l=Math.min(c/4,0.5),h=[];for(let M=0;M<t;M++)h.push(Ao(M+1,M*s,0,a,c));let d=[];if(n){let M=n.split("").map(Number);if(M.length>1)for(let B=0;B<M.length-1;B++){let T=M[B],N=M[B+1];if(typeof T==="number"&&typeof N==="number"&&!isNaN(T)&&!isNaN(N)){let D=(T-1)*s,L=(N-1)*s,H=Math.sign(L-D),V=D+H*(a/2),O=L-H*(a/2);d.push({type:"pcb_trace",pcb_trace_id:"",route:[{start_pcb_port_id:`{PIN${T}}`,x:V,y:0,width:l,layer:"top",route_type:"wire"},{end_pcb_port_id:`{PIN${N}}`,x:O,y:0,width:l,layer:"top",route_type:"wire"}]})}}}let u=(t-1)*s+a+0.7,_=c+1,p=(t-1)*s/2,m=0,A={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"outline",route:[{x:p-u/2,y:m-_/2},{x:p+u/2,y:m-_/2},{x:p+u/2,y:m+_/2},{x:p-u/2,y:m+_/2},{x:p-u/2,y:m-_/2}],stroke_width:0.15},g=0.6,f=m+_/2+g,y=Jo(p,f,0.4),x=(t-1)*s,C=x/2+a/2,b=c/2,I=C+0.5,v=b+0.5,P={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:x/2,y:0},width:2*I,height:2*v,layer:"top"};return{circuitJson:[...h,...d,A,y,P],parameters:e}},AMt={fn:ce("sot457"),num_pins:ce(6).default(6),pillh:k().default("0.45mm"),pillw:k().default("1.45mm"),pl:k(),pw:k(),p:k(),wave:Be().optional(),reflow:Be().optional()},WHo=Yo.extend({...AMt,h:k().default("2.5mm"),w:k().default("2.7mm"),pl:k().default("0.8mm"),pw:k().default("0.55mm"),p:k().default("0.95mm")}),XHo=Yo.extend({...AMt,h:k().default("3mm"),w:k().default("4mm"),pillr:k().default("0.225mm"),pl:k().default("1.45mm"),pw:k().default("1.5mm"),p:k().default("1.475mm")}).transform((e)=>({...e,wave:e.wave??(e.reflow===void 0?!0:!e.reflow),reflow:e.reflow??(e.wave===void 0?!1:!e.wave)})),Qw=(e)=>Number.parseFloat(e.replace("mm","")),VEt=({pitch:e,width:t,pinNumber:n})=>{let i={1:{x:-t/2-0.1,y:e},2:{x:-t/2-0.1,y:0},3:{x:-t/2-0.1,y:-e},4:{x:t/2+0.1,y:-e},5:{x:t/2+0.1,y:0},6:{x:t/2+0.1,y:e}}[n];if(!i)throw Error(`Invalid pin number: ${n}`);return i},YEt=(e)=>{let t=[],n=Qw(e.p),o=Qw(e.pl),r=Qw(e.pw),i=Qw(e.w),s=Qw(e.h),a=Math.min(o,r)/8;if(e.wave){let A={1:({padWidth:g,padHeight:f})=>Ao(1,-n,n,f,g,a),2:({padWidth:g,padHeight:f})=>Ao(2,-n,-n,f,g,a),3:({padWidth:g,padHeight:f})=>$R(3,-n,0,Qw(e.pillw),Qw(e.pillh)),4:({padWidth:g,padHeight:f})=>$R(4,n,0,Qw(e.pillw),Qw(e.pillh)),5:({padWidth:g,padHeight:f})=>Ao(5,n,n,f,g,a),6:({padWidth:g,padHeight:f})=>Ao(6,n,-n,f,g,a)};for(let g=1;g<=e.num_pins;g++){let f=A[g];if(f)t.push(f({padWidth:o,padHeight:r}))}}else for(let A=1;A<=e.num_pins;A++){let{x:g,y:f}=VEt({pitch:n,width:i,pinNumber:A});t.push(Ao(A,g,f,o,r,a))}let c={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"silkscreen_path_1",route:[{x:-i/3,y:s/2+n/1.3},{x:i/3,y:s/2+n/1.3}],stroke_width:0.05},l={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"silkscreen_path_2",route:[{x:-i/3,y:-s/2-n/1.3},{x:i/3,y:-s/2-n/1.3}],stroke_width:0.05},h=Jo(0,s+0.5,0.3),d=VEt({pitch:n,width:i,pinNumber:1}),u=e.wave?1:0.5,_=e.wave?0.7:0.3;d.x-=e.wave?r:r*1.7;let p={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"pin1_indicator",route:[{x:d.x+u/2,y:d.y},{x:d.x-u/2,y:d.y+_/2},{x:d.x-u/2,y:d.y-_/2},{x:d.x+u/2,y:d.y}],stroke_width:0.05},m;if(e.wave){let A=2*n,g=2*n,f=A/2+r/2,y=g/2+o/2,x=f+0.25,C=y+0.25;m={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:2*x,height:2*C,layer:"top"}}else{let g=i/2+0.1+o/2,f=n+r/2,y=i/2,x=s/2,C=g+0.25,b=y+0.08,I=f+0.25,v=Math.max(x+0.45,I);m={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",outline:Uy([{minX:-C,maxX:C,minY:-I,maxY:I},{minX:-b,maxX:b,minY:-v,maxY:v}]),layer:"top"}}return[h,c,l,p,...t,m]},jHo=(e)=>{if(e.wave){let n=XHo.parse({...e,fn:"sot457"});return{circuitJson:YEt(n),parameters:n}}let t=WHo.parse(e);return{circuitJson:YEt(t),parameters:t}},KHo=[{x:-0.8,y:0.75},{x:0.8,y:0.75},{x:0.8,y:-0.75},{x:-0.8,y:-0.75}],$Ho=Yo.extend({fn:k(),num_pins:ce(6).default(6),w:k().default("1.1mm"),h:k().default("1.45mm"),p:k().default("0.35mm"),pl:k().default("0.2mm"),pw:k().default("0.2mm"),string:k().optional()}),qHo=(e)=>{let t=$Ho.parse({...e,fn:"sot963"}),n=ve.parse(t.w),o=ve.parse(t.h),r=ve.parse(t.p),i=ve.parse(t.pl),s=ve.parse(t.pw),a=Math.min(i,s)/8,c=[];for(let m=0;m<6;m++){let{x:A,y:g}=GEt(m+1,n,r,i);c.push(Ao(m+1,A,g,i,s,a))}let l={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:-n/2,y:o/2},{x:n/2,y:o/2}],stroke_width:0.05,pcb_silkscreen_path_id:""},h={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:-n/2,y:-o/2},{x:n/2,y:-o/2}],stroke_width:0.05,pcb_silkscreen_path_id:""},d=GEt(1,n,r,i),u={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"pin_marker_1",route:[{x:d.x-i/2-0.3,y:d.y},{x:d.x-i/2-0.45,y:d.y+0.15},{x:d.x-i/2-0.45,y:d.y-0.15},{x:d.x-i/2-0.3,y:d.y}],stroke_width:0.05,pcb_silkscreen_path_id:"pin_marker_1"},_=Jo(0,o/2+0.4,0.25),p={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",outline:KHo,layer:"top"};return{circuitJson:[...c,l,h,_,u,p],parameters:t}},GEt=(e,t,n,o)=>{let r=t/2-o/2;if(e<=3)return{x:-r,y:n-(e-1)*n};return{x:r,y:-n+(e-4)*n}},JHo=Yo.extend({fn:k(),num_pins:an([ce(3),ce(2)]).default(3),p:k().default("5mm"),id:k().default("1.25mm"),od:k().default("2.35mm"),ca:k().default("14mm").describe("Caliper axis (width or diameter of the potentiometer body or adjustment knob)"),w:k().default("5.35mm"),h:k().default("4mm"),string:k().optional()}),ZHo=(e)=>{let{p:t,id:n,od:o,h:r}=e,i=Number.parseFloat(r),s=Number.parseFloat(t);return[Li(1,0,s,n,o),Li(2,i,0,n,o),Li(3,0,-s,n,o)]},eFo=(e)=>{let t=e.string?.match(/^potentiometer_(\d+)/),n=t?Number.parseInt(t[1],10):3,o=JHo.parse({...e,num_pins:n}),r=[];if(o.num_pins===3)r=ZHo(o);let i=Number.parseFloat(o.ca)/2+0.15,s=Number.parseFloat(o.w),a=Number.parseFloat(o.od)/2+0.35,c={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:0,y:i-1.75},{x:0,y:i},{x:s,y:i},{x:s,y:a}],stroke_width:0.1,pcb_silkscreen_path_id:""},l={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:s,y:-a},{x:s,y:-i},{x:0,y:-i},{x:0,y:-i+1.75}],stroke_width:0.1,pcb_silkscreen_path_id:""},h=Number.parseFloat(o.w)/2,d=Jo(h,i+1,0.5),u=Number.parseFloat(o.od)/2,_=Number.parseFloat(o.h),p=Number.parseFloat(o.ca)/2,m=-(u+0.25),A=_+u+0.25,g=p+0.25,f={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:(m+A)/2,y:0},width:A-m,height:2*g,layer:"top"};return{circuitJson:[...r,c,l,d,f],parameters:o}},tFo=Yo.extend({fn:k(),p:ve.optional().default("7.5mm"),id:ve.optional().default("1mm"),od:ve.optional().default("2mm"),d:ve.optional().default("10.5mm")}),nFo=(e,t,n,o,r)=>{let i=[],s=[];for(let a=0;a<=50;a++){let c=a/50*Math.PI,l=e+Math.cos(c)*n,h=t+Math.sin(c)*n;if(l<e-o&&h>=t-r/2&&h<=t+r/2)continue;i.push({x:l,y:h})}for(let a=0;a<=50;a++){let c=Math.PI+a/50*Math.PI,l=e+Math.cos(c)*n,h=t+Math.sin(c)*n;if(l<e-o&&h>=t-r/2&&h<=t+r/2)continue;s.push({x:l,y:h})}return{topArc:i,bottomArc:s}},oFo=(e)=>{let t=tFo.parse(e),{p:n,id:o,od:r,d:i}=t,s=[Gy({pn:1,x:-n/2,y:0,holeDiameter:o,rectPadWidth:r,rectPadHeight:r}),Li(2,n/2,0,o,r)],{topArc:a,bottomArc:c}=nFo(0,0,i/2+0.1,r/2,r),l={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:a,stroke_width:0.1,pcb_silkscreen_path_id:""},h={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:c,stroke_width:0.1,pcb_silkscreen_path_id:""},d={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:0,y:i/2+0.1},{x:0,y:-(i/2+0.1)}],stroke_width:0.1,pcb_silkscreen_path_id:""},u=-(i/2+0.5),_=r/2+1.5,p=0.5,m={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:u-0.5,y:_},{x:u+0.5,y:_}],stroke_width:0.1,pcb_silkscreen_path_id:""},A={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:u,y:_-0.5},{x:u,y:_+0.5}],stroke_width:0.1,pcb_silkscreen_path_id:""},g=Jo(0,i/2+1,0.5),f=i/2,y=n/2+r/2,x=0.25,C=Math.max(f,y)+0.25,b={type:"pcb_courtyard_circle",pcb_courtyard_circle_id:"",pcb_component_id:"",center:{x:0,y:0},radius:C,layer:"top"};return{circuitJson:[...s,l,h,d,m,A,g,b],parameters:t}},rFo=Yo.extend({fn:ce("fpc"),num_pins:X7.number().int().min(2),p:ve.default("0.5mm").describe("contact pad pitch"),pw:ve.default("0.3mm").describe("contact pad width"),pl:ve.default("1.25mm").describe("contact pad length"),staggered:Be().default(!1).describe("alternate contacts between two rows"),reverse:Be().default(!1).describe("place pin 1 on the upper row when staggered"),py:ve.default("2.4mm").describe("staggered row center pitch"),toppl:ve.optional().describe("upper-row contact pad length"),bottompl:ve.optional().describe("lower-row contact pad length"),mpx:ve.optional().describe("mounting pad center pitch"),mpy:ve.optional().describe("mounting pad row distance from the contact-row center"),mounttop:Be().default(!1).describe("place the mounting pads above the contact-row center"),mpw:ve.default("2mm").describe("mounting pad width"),mpl:ve.default("2.5mm").describe("mounting pad length")}),Bze=(...e)=>Ao(...e),iFo=(e)=>({maxX:Math.max(...e.map((t)=>t.x+t.width/2)),maxY:Math.max(...e.map((t)=>t.y+t.height/2)),minX:Math.min(...e.map((t)=>t.x-t.width/2)),minY:Math.min(...e.map((t)=>t.y-t.height/2))}),sFo=(e)=>{let t=rFo.parse(e),{num_pins:n,p:o,pw:r,pl:i,staggered:s,reverse:a,py:c,toppl:l,bottompl:h,mounttop:d,mpw:u,mpl:_}=t,p=(n-1)*o,m=t.mpx??p+(s?3.5:3.38),A=t.mpy??(s?0:2.575),g=A===0?0:(d?1:-1)*A,f=-p/2,y=Array.from({length:n},(H,V)=>{let O=s&&V%2===1!==a,U=s?O?c/2:-c/2:0,j=O?l??i:h??i;return Bze(V+1,f+V*o,U,r,j)}),x=[Bze(n+1,m/2,g,u,_),Bze(n+2,-m/2,g,u,_)],C=[...y,...x],b=iFo(C),I=Math.min(p/2+r/2,m/2-u/2),v=b.maxY+0.2,P=b.minY-0.2,M=y[0],B=M.x-M.width/2-0.2,T=M.y,N=[Es([{x:-I,y:v},{x:I,y:v}]),Es([{x:-I,y:P},{x:I,y:P}]),Es([{x:B-0.25,y:T-0.25},{x:B,y:T},{x:B-0.25,y:T+0.25}])],D=Jo(0,v+0.7,0.5),L={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:(b.minX+b.maxX)/2,y:(b.minY+b.maxY)/2},width:b.maxX-b.minX+0.5,height:b.maxY-b.minY+0.5,layer:"top"};return{circuitJson:[...C,...N,D,L],parameters:{...t,mpx:m,mpy:A,toppl:l??i,bottompl:h??i}}},aFo=Yo.extend({fn:k(),num_pins:ce(2).default(2),w:k().default("6.5mm"),h:k().default("3mm"),pl:k().default("1.75mm"),pw:k().default("2.40mm"),p:k().default("4.75mm")}),cFo=(e)=>{let t=aFo.parse(e),n=Jo(0,ve.parse(t.h)-0.5,0.3),o={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:ve.parse(t.p)/2,y:ve.parse(t.h)/2},{x:-ve.parse(t.w)/2-0.3,y:ve.parse(t.h)/2},{x:-ve.parse(t.w)/2-0.3,y:-ve.parse(t.h)/2},{x:ve.parse(t.p)/2,y:-ve.parse(t.h)/2}],stroke_width:0.1,pcb_silkscreen_path_id:""},r=7,i=3.5,s={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:7,height:3.5,layer:"top"};return{circuitJson:hFo(t).concat(...X0(t),o,n,s),parameters:t}},lFo=(e)=>{let{pn:t,p:n}=e;if(t===1)return{x:-n/2,y:0};return{x:n/2,y:0}},hFo=(e)=>{let t=[],n=ve.parse(e.p),o=ve.parse(e.pl),r=ve.parse(e.pw),i=0.125;for(let s=1;s<=e.num_pins;s++){let{x:a,y:c}=lFo({pn:s,p:n});t.push(Ao(s,a,c,o,r,0.125))}return t},dFo=[{x:-1.45,y:0.98},{x:-0.73,y:0.98},{x:-0.73,y:1.1},{x:0.73,y:1.1},{x:0.73,y:0.33},{x:1.45,y:0.33},{x:1.45,y:-0.33},{x:0.73,y:-0.33},{x:0.73,y:-1.1},{x:-0.73,y:-1.1},{x:-0.73,y:-0.98},{x:-1.45,y:-0.98},{x:-1.45,y:-0.32},{x:-0.73,y:-0.32},{x:-0.73,y:0.32},{x:-1.45,y:0.32}],uFo=Yo.extend({fn:k(),num_pins:ge().default(3),w:k().default("2.45mm"),h:k().default("2.40mm"),pl:k().default("0.92mm"),pw:k().default("0.45mm"),p:k().default("0.891mm"),string:k().optional()}),pFo=(e)=>{let t=e.string?.match(/^sot323_(\d+)/),n=t?Number.parseInt(t[1],3):3,o=uFo.parse({...e,num_pins:n});if(o.num_pins===3)return{circuitJson:_Fo(o),parameters:o};throw Error("Invalid number of pins")},mFo=(e)=>{let{pn:t,w:n,h:o,pl:r,p:i}=e;if(t===1)return{x:-i,y:0.65};if(t===2)return{x:-i,y:-0.65};return{x:i,y:0}},_Fo=(e)=>{let t=[],n=Number.parseFloat(e.w),o=Number.parseFloat(e.h),r=Number.parseFloat(e.pl),i=Number.parseFloat(e.pw),s=Number.parseFloat(e.p),a=Math.min(r,i)/8;for(let p=0;p<e.num_pins;p++){let{x:m,y:A}=mFo({num_pins:e.num_pins,pn:p+1,w:n,h:o,pl:r,p:s});t.push(Ao(p+1,m,A,r,i,a))}let c=Jo(0,Number.parseInt(e.h)/2+1,0.3),l=n/2-r,h=o/2,d={layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"silkscreen_path_1",route:[{x:-l,y:h+0.3},{x:l,y:h+0.3},{x:l,y:h/2}],type:"pcb_silkscreen_path",stroke_width:0.1},u={layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"silkscreen_path_2",route:[{x:-l,y:-h-0.3},{x:l,y:-h-0.3},{x:l,y:-h/2}],type:"pcb_silkscreen_path",stroke_width:0.1},_={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",outline:dFo,layer:"top"};return[...t,d,u,c,_]},gFo=Yo.extend({fn:k(),circle:Be().optional(),rect:Be().optional(),square:Be().optional(),pill:Be().optional(),d:ve.optional(),pd:ve.optional(),diameter:ve.optional(),r:ve.optional(),pr:ve.optional(),radius:ve.optional(),w:ve.optional(),pw:ve.optional(),width:ve.optional(),h:ve.optional(),ph:ve.optional(),height:ve.optional(),s:ve.optional(),size:ve.optional(),string:k().optional()}).transform((e)=>{let t="rect";if(e.circle)t="circle";if(e.square)t="square";if(e.rect)t="rect";if(e.pill)t="pill";let n,o,r;if(t==="circle")if(e.r!==void 0)n=ki(e.r);else if(e.pr!==void 0)n=ki(e.pr);else if(e.radius!==void 0)n=ki(e.radius);else if(e.d!==void 0)n=ki(e.d)/2;else if(e.pd!==void 0)n=ki(e.pd)/2;else if(e.diameter!==void 0)n=ki(e.diameter)/2;else n=ki("1mm")/2;else{if(e.w!==void 0)o=ki(e.w);else if(e.pw!==void 0)o=ki(e.pw);else if(e.width!==void 0)o=ki(e.width);else if(e.s!==void 0)o=ki(e.s);else if(e.size!==void 0)o=ki(e.size);else o=ki("1mm");if(e.h!==void 0)r=ki(e.h);else if(e.ph!==void 0)r=ki(e.ph);else if(e.height!==void 0)r=ki(e.height);else if(t==="square")r=o;else if(t==="rect")r=o;else r=ki("1mm")}return{fn:e.fn,shape:t,radius:n,width:o,height:r}}),AFo=(e)=>{let t=gFo.parse(e),{shape:n,radius:o,width:r,height:i}=t,s,a;if(n==="circle")s=P1e(1,{x:0,y:0,radius:o}),a=o+0.5;else if(n==="pill")s=$R(1,0,0,r,i),a=Math.max(r,i)/2+0.5;else s=Ao(1,0,0,r,i),a=i/2+0.5;return{circuitJson:[s,Jo(0,a,0.2)],parameters:t}},fFo=Yo.extend({fn:ce("smdpads"),num_pins:ge().int().positive().default(3),p:ve.default("1mm").describe("pad center pitch"),pw:ve.default("1mm").describe("outer pad width"),ph:ve.default("1mm").describe("pad height"),cyw:ve.optional().describe("courtyard width"),cyh:ve.optional().describe("courtyard height"),centerpadwidth:ve.optional().describe("center pad width")}).superRefine((e,t)=>{if(e.centerpadwidth!==void 0&&e.num_pins%2===0)t.addIssue({code:Gt.custom,message:"'centerpadwidth' requires an odd number of SMD pads",path:["centerpadwidth"]})}),yFo=(e)=>{let t=fFo.parse(e),{num_pins:n,p:o,pw:r,ph:i,cyw:s,cyh:a,centerpadwidth:c}=t,l=Math.ceil(n/2),h=-((n-1)*o)/2,d=Array.from({length:n},(g,f)=>{let y=f+1,x=c!==void 0&&y===l?c:r;return Ao(y,h+f*o,0,x,i)}),u=(n-1)*o/2+r/2,_=c?c/2:0,p=Math.max(u,_),m=s!==void 0&&a!==void 0?{width:s,height:a}:{width:p*2+0.5,height:i+0.5},A={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:m.width,height:m.height,layer:"top"};return{circuitJson:[...d,Jo(0,i/2+0.8,0.4),A],parameters:t}},xFo=Yo.extend({fn:ce("smdpushbutton"),num_pins:ce(4).default(4),px:ve.default("4.2mm").describe("horizontal pad center pitch"),py:ve.default("2.15mm").describe("vertical pad center pitch"),pw:ve.default("1.05mm").describe("pad width"),ph:ve.default("0.7mm").describe("pad height")}),CFo=(e)=>{let t=xFo.parse(e),{px:n,py:o,pw:r,ph:i}=t,s=[Ao(1,-n/2,o/2,r,i),Ao(2,n/2,o/2,r,i),Ao(3,-n/2,-o/2,r,i),Ao(4,n/2,-o/2,r,i)],a=Math.max(n/2-r/2-0.15,0.2),c=o/2+i/2+0.1,l=Math.max(o/2-i/2-0.15,0.2),h=[Es([{x:-a,y:c},{x:a,y:c}]),Es([{x:-a,y:-c},{x:a,y:-c}]),Es([{x:-n/2,y:-l},{x:-n/2,y:l}]),Es([{x:n/2,y:-l},{x:n/2,y:l}])],d=Jo(0,c+0.6,0.5),u={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:n+r+0.5,height:o+i+0.5,layer:"top"};return{circuitJson:[...s,...h,d,u],parameters:t}},bFo=(e)=>({x:(e.minX+e.maxX)/2,y:(e.minY+e.maxY)/2}),IFo=(e)=>{if(e.length===0)return null;let t=e[0].x,n=e[0].y,o=e[0].x,r=e[0].y;for(let i=1;i<e.length;i++){let s=e[i];if(s.x<t)t=s.x;if(s.y<n)n=s.y;if(s.x>o)o=s.x;if(s.y>r)r=s.y}return{minX:t,minY:n,maxX:o,maxY:r}},vFo=Yo.extend({fn:ce("smdslideswitch"),num_pins:ce(7).default(7),signalcols:X7.number().int().min(3).default(3),missing:cK.default([]),p:ve.default("1mm").describe("signal-pad column pitch"),pw:ve.default("0.7mm").describe("signal-pad width"),pl:ve.default("1.5mm").describe("signal-pad length"),mounty:ve.default("-1.8mm").describe("Y position of the mounting-pad row center"),mpx:ve.default("5.5mm").describe("horizontal center-to-center mounting-pad distance"),mpy:ve.default("2.2mm").describe("vertical center-to-center mounting-pad distance"),mpw:ve.default("1mm").describe("mounting-pad width"),mpl:ve.default("0.8mm").describe("mounting-pad length"),holex:ve.default("1.5mm").describe("alignment-hole X distance from the footprint center"),holey:ve.optional().describe("alignment-hole Y position; defaults to mounty"),holed:ve.default("0.9mm").describe("alignment-hole diameter"),noholes:Be().optional().default(!1)}),SFo=(e)=>{let t=vFo.parse(e),{num_pins:n,signalcols:o,missing:r,p:i,pw:s,pl:a,mounty:c,mpx:l,mpy:h,mpw:d,mpl:u,holex:_,holed:p,noholes:m}=t,A=t.holey??c,g=r.find((X)=>typeof X!=="number"||!Number.isInteger(X)||X<1||X>o);if(g!==void 0)throw Error(`Invalid missing signal column "${g}" for signalcols${o}`);let f=new Set(r.filter((X)=>typeof X==="number")),y=o-f.size;if(y+4!==n)throw Error(`smdslideswitch${n} needs ${n-4} signal pads, but signalcols${o}_missing(${[...f].join(",")}) creates ${y}`);let x=(X)=>Number(X.toFixed(12)),C=[],b=-((o-1)*i)/2,I=1;for(let X=1;X<=o;X++){if(f.has(X))continue;C.push(Ao(I,x(b+(X-1)*i),0,s,a)),I++}let v=c+h/2,P=c-h/2,M=[{x:x(-l/2),y:x(v)},{x:x(l/2),y:x(v)},{x:x(-l/2),y:x(P)},{x:x(l/2),y:x(P)}];for(let X of M)C.push(Ao(I,X.x,X.y,d,u)),I++;let B=m?[]:[-_,_].map((X)=>({type:"pcb_hole",pcb_hole_id:"",pcb_component_id:"",hole_shape:"circle",hole_diameter:p,x:X,y:A})),T=Math.max(l/2-d/2-0.2,i),N=-a/2-0.2,D=P+u/2+0.2,L=[Es([{x:-T,y:N},{x:T,y:N}]),Es([{x:-T,y:D},{x:T,y:D}]),Es([{x:-T,y:D},{x:-T,y:N}]),Es([{x:T,y:D},{x:T,y:N}])],H=b+(o-1)*i,V=IFo([{x:b-s/2,y:-a/2},{x:H+s/2,y:a/2},{x:-l/2-d/2,y:P-u/2},{x:l/2+d/2,y:v+u/2},...!m?[{x:-_-p/2,y:A-p/2},{x:_+p/2,y:A+p/2}]:[]]);if(!V)throw Error("Could not determine SMD slide-switch bounds");let O=0.25,U=bFo(V),j={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:U,width:V.maxX-V.minX+O*2,height:V.maxY-V.minY+O*2,layer:"top"},Y=Jo(U.x,V.maxY+0.6,0.5);return{circuitJson:[...C,...B,...L,Y,j],parameters:t}},PFo=Yo.extend({fn:ce("smdpinheader"),num_pins:ge().int().positive().default(6),p:ve.default("2.54mm").describe("contact pitch"),py:ve.default("3.31mm").describe("center-to-center distance between alternating pad rows"),pw:ve.default("1mm").describe("pad width"),ph:ve.default("2.51mm").describe("pad height"),bh:ve.default("2.5mm").describe("plastic body height"),male:ce(!0).default(!0),female:ce(!1).default(!1),smd:ce(!0).default(!0)}),EFo=(e)=>{let t=PFo.parse(e),{num_pins:n,p:o,py:r,pw:i,ph:s,bh:a}=t,c=-((n-1)*o)/2,l=Array.from({length:n},(C,b)=>Ao(b+1,c+b*o,b%2===0?r/2:-r/2,i,s)),h=n*o/2,d=a/2,u=Math.min(0.5,a/4),_=(C,b,I=-h)=>{let v=i/2+0.2,P=[],M=I;for(let B=b;B<n;B+=2){let T=c+B*o,N=T-v;if(N>M)P.push(Es([{x:M,y:C},{x:N,y:C}]));M=T+v}if(M<h)P.push(Es([{x:M,y:C},{x:h,y:C}]));return P},p=[..._(d,0,-h+u),..._(-d,1),Es([{x:h,y:-d},{x:h,y:d}]),Es([{x:-h,y:-d},{x:-h,y:d-u},{x:-h+u,y:d}])],m=(n-1)*o/2+i/2,A=r/2+s/2,g=Math.max(h,m)+0.25,f=Math.max(d,A)+0.25,y={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:2*g,height:2*f,layer:"top"},x=Jo(0,f+0.6,0.5);return{circuitJson:[...l,...p,x,y],parameters:t}},MFo=Yo.extend({fn:k(),d:ve.optional(),hd:ve.optional(),r:ve.optional(),hr:ve.optional(),pd:ve.optional(),pr:ve.optional(),squarepad:Be().optional().default(!1)}).transform((e)=>{let t;if(e.d!==void 0)t=ki(e.d);else if(e.hd!==void 0)t=ki(e.hd);else if(e.r!==void 0)t=ki(e.r)*2;else if(e.hr!==void 0)t=ki(e.hr)*2;else t=ki("1mm");let n;if(e.pd!==void 0)n=ki(e.pd);else if(e.pr!==void 0)n=ki(e.pr)*2;else n=t*1.5;return{fn:e.fn,d:t,pd:n,squarepad:e.squarepad??!1}}),wFo=(e)=>{let t=MFo.parse(e),{d:n,pd:o,squarepad:r}=t;return{circuitJson:[r?Gy({pn:1,x:0,y:0,holeDiameter:n,rectPadWidth:o,rectPadHeight:o}):Li(1,0,0,n,o),Jo(0,o/2+0.5,0.2)],parameters:t}},BFo=Yo.extend({fn:k(),num_pins:ce(6).default(6),h:k().default("1.3mm"),pl:k().default("1.325mm"),pw:k().default("0.6mm"),p:k().default("0.95mm")}),TFo=(e)=>{let t=BFo.parse(e);return{circuitJson:DFo(t),parameters:t}},UEt=(e)=>{let{p:t,h:n,pn:o}=e;if(o===1)return{x:-n/2-0.4875,y:t};if(o===2)return{x:-n/2-0.4875,y:0};if(o===3)return{x:-n/2-0.4875,y:-t};if(o===4)return{x:n/2+0.4875,y:-t};if(o===5)return{x:n/2+0.4875,y:0};if(o===6)return{x:n/2+0.4875,y:t};throw Error("Invalid pin number")},DFo=(e)=>{let t=[],n=Number.parseFloat(e.h),o=Number.parseFloat(e.p),r=Number.parseFloat(e.pl),i=Number.parseFloat(e.pw),s=Math.min(r,i)/8;for(let v=1;v<=e.num_pins;v++){let{x:P,y:M}=UEt({h:n,p:o,pn:v});t.push(Ao(v,P,M,r,i,s))}let a=e.num_pins/2*o,c=n,l={layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"silkscreen_path_1",route:[{x:-a/3,y:c/2+Number.parseFloat(e.p)/1.3},{x:a/3,y:c/2+o/1.3}],type:"pcb_silkscreen_path",stroke_width:0.05},h={layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"silkscreen_path_2",route:[{x:-a/3,y:-c/2-o/1.3},{x:a/3,y:-c/2-o/1.3}],type:"pcb_silkscreen_path",stroke_width:0.05},d=Jo(0,c+0.3,0.3),u=UEt({h:n,p:o,pn:1});u.x=u.x-i*1.5;let _=0.7,p=0.3,m={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"pin1_indicator",route:[{x:u.x+_/2-0.2,y:u.y},{x:u.x-_/2,y:u.y+p/2},{x:u.x-_/2,y:u.y-p/2},{x:u.x+_/2-0.2,y:u.y}],stroke_width:0.05},A=n/2+0.4875,g=o*2+i,f=A+r/2,y=n/2+0.4,x=f+0.25,C=g/2+0.25,b=C+0.2,I={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",layer:"top",outline:Uy([{minX:-x,maxX:x,minY:-C,maxY:C},{minX:-y,maxX:y,minY:-b,maxY:b}])};return[...t,d,l,h,m,I]},NFo=Yo.extend({fn:ce("sot143"),num_pins:ce(4).default(4),p:ve.default("2.382774mm"),px:ve.default("1.89992mm"),pw:ve.default("0.8382mm"),ph:ve.default("0.8382mm"),pin1padwidth:ve.default("1.1938mm"),pin1centeroffsetx:ve.default("0.199898mm"),w:ve.default("3mm"),h:ve.default("2.9mm")}),RFo=(e)=>{let t=NFo.parse(e),{p:n,px:o,pw:r,ph:i,pin1padwidth:s,pin1centeroffsetx:a,w:c,h:l}=t,h=o/2,d=n/2,u=[Ao(1,-h+a,-d,s,i),Ao(2,h,-d,r,i),Ao(3,h,d,r,i),Ao(4,-h,d,r,i)],_=c/2,p=l/2,m=[Es([{x:-_,y:-p/2},{x:-_,y:p/2}]),Es([{x:_,y:p/2},{x:_,y:-p/2}])],A=o+Math.max(s,r),g=n+i,f={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:Math.max(c,A)+0.5,height:Math.max(l,g)+0.5,layer:"top"};return{circuitJson:[...u,...m,Jo(0,Math.max(p,g/2)+0.8,0.4),f],parameters:t}},QFo=[{x:-1.703,y:0.98},{x:-0.983,y:0.98},{x:-0.983,y:1.1},{x:0.477,y:1.1},{x:0.477,y:0.98},{x:1.197,y:0.98},{x:1.197,y:-0.98},{x:0.477,y:-0.98},{x:0.477,y:-1.1},{x:-0.983,y:-1.1},{x:-0.983,y:-0.98},{x:-1.703,y:-0.98}],kFo=Yo.extend({fn:k(),num_pins:ge().default(4),w:k().default("3.2mm"),h:k().default("2.6mm"),pl:k().default("1.05mm"),pw:k().default("0.45mm"),p:k().default("0.55mm"),string:k().optional()}),LFo=(e)=>{let t=e.string?.match(/^sot343_(\d+)/),n=t?Number.parseInt(t[1],4):4,o=kFo.parse({...e,num_pins:n});if(o.num_pins===4)return{circuitJson:FFo(o),parameters:o};throw Error("Invalid number of pins")},HFo=(e)=>{let{pn:t,p:n}=e;if(t===1)return{x:-n*1.92,y:-0.65};if(t===2)return{x:-n*1.92,y:0.65};if(t===3)return{x:n,y:0.65};if(t===4)return{x:n,y:-0.65};return{x:0,y:0}},FFo=(e)=>{let t=[],n=Number.parseFloat(e.w),o=Number.parseFloat(e.h),r=Number.parseFloat(e.pl),i=Number.parseFloat(e.pw),s=Number.parseFloat(e.p),a=Math.min(r,i)/8,c=1/0,l=-1/0,h=1/0,d=-1/0;for(let C=0;C<e.num_pins;C++){let{x:b,y:I}=HFo({num_pins:e.num_pins,pn:C+1,w:n,h:o,pl:r,p:s});if(t.push(Ao(C+1,b,I,r,i,a)),b<c)c=b;if(b>l)l=b;if(I<h)h=I;if(I>d)d=I}let u=(c+l)/2,_=d-h,p=o*0.3,m=_/2+p,A=n*0.8;if(o<=2.6)A/=2;let g=Jo(u,m+0.5,0.3),f={layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"silkscreen_path_top",route:[{x:u-A/2,y:m},{x:u+A/2,y:m}],type:"pcb_silkscreen_path",stroke_width:0.1},y={layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"silkscreen_path_bottom",route:[{x:u-A/2,y:-m},{x:u+A/2,y:-m}],type:"pcb_silkscreen_path",stroke_width:0.1},x={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",outline:QFo,layer:"top"};return[...t,f,y,g,x]},zFo=Yo.extend({fn:k()}),OFo=(e)=>{let t=zFo.parse(e),n=[],o=0.35,r=1.5,i=0.5,s=0.25,a=0.5,c=75,l=-18.5;for(let v=0;v<75;v++){let P=v+1;if(P>=24&&P<=31)continue;let M=-18.5-v*0.25,B=P%2===0,T=1.5+(B?0.25:0),D=0.5-T/2,L=Ao(P,D,M,T,0.35);L.layer=B?"bottom":"top",n.push(L)}let h=1.1683999999999999,d=3.4798,u=6.6293999999999995,_={type:"pcb_cutout",pcb_cutout_id:"",shape:"rect",center:{x:-d/2+0.75,y:-18.5-u},width:d,height:h},p={x:-0.5,y:-18.5},m={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"pin_marker_1",route:[{x:p.x-0.4,y:p.y},{x:p.x-0.7,y:p.y+0.3},{x:p.x-0.7,y:p.y-0.3},{x:p.x-0.4,y:p.y}],stroke_width:0.05,pcb_silkscreen_path_id:"pin_marker_1"},A=1/0,g=-1/0,f=1/0,y=-1/0,x=(v,P,M=0,B=0)=>{A=Math.min(A,v-M/2),g=Math.max(g,v+M/2),f=Math.min(f,P-B/2),y=Math.max(y,P+B/2)};for(let v of n){let P=v;x(P.x,P.y,P.width,P.height)}x(_.center.x,_.center.y,_.width,_.height);for(let v of m.route)x(v.x,v.y);let C=(A+g)/2,b=(f+y)/2,I=(v)=>{if(typeof v.x==="number")v.x-=C;if(typeof v.y==="number")v.y-=b;if(v.center)v.center.x-=C,v.center.y-=b;if(Array.isArray(v.route))v.route=v.route.map((P)=>({x:P.x-C,y:P.y-b}))};for(let v of n)I(v);return I(_),I(m),{circuitJson:[...n,_,m],parameters:t}};var VFo=Yo.extend({fn:k(),numPins:ge().optional().default(0),rows:an([k(),ge()]).transform((e)=>Number(e)).optional().default(1).describe("number of rows"),p:ve.default("2.54mm").describe("pitch"),id:ve.default("1.0mm").describe("inner diameter"),od:ve.default("1.5mm").describe("outer diameter"),male:Be().optional().describe("the module uses male headers"),nopin:Be().optional().default(!1).describe("omit pins rendering"),female:Be().optional().describe("the module uses female headers"),smd:Be().optional().describe("surface mount device"),pinlabeltextalignleft:Be().optional().default(!1),pinlabeltextaligncenter:Be().optional().default(!1),pinlabeltextalignright:Be().optional().default(!1),pinlabelverticallyinverted:Be().optional().default(!1),pinlabelorthogonal:Be().optional().default(!1),nopinlabels:Be().optional().default(!1).describe("omit silkscreen pin labels"),doublesidedpinlabel:Be().optional().default(!1).describe("add silkscreen pins in top and bottom layers"),bottomsidepinlabel:Be().optional().default(!1).describe("place the silkscreen reference text on the bottom layer instead of top"),pinRowSide:bt(["left","right","top","bottom"]).optional().default("left"),pinrowleft:Be().optional().default(!1),pinrowright:Be().optional().default(!1),pinrowtop:Be().optional().default(!1),pinrowbottom:Be().optional().default(!1),pinrowleftpins:an([k(),ge()]).transform((e)=>Number(e)).optional(),pinrowrightpins:an([k(),ge()]).transform((e)=>Number(e)).optional(),pinrowtoppins:an([k(),ge()]).transform((e)=>Number(e)).optional(),pinrowbottompins:an([k(),ge()]).transform((e)=>Number(e)).optional(),width:ve.optional(),height:ve.optional(),pinRowHoleEdgeToEdgeDist:ve.default("2mm"),holes:an([k(),st(k())]).optional().transform((e)=>{if(!e)return e;if(Array.isArray(e))return e;if(e.startsWith("(")&&e.endsWith(")"))return e.slice(1,-1).split(",").map((t)=>t.trim());return[e]}),holeXDist:ve.optional(),holeYDist:ve.optional(),holeInset:ve.default("1mm"),pinrow:an([k(),ge()]).optional(),usbposition:bt(["left","right","top","bottom"]).optional().default("left"),usbleft:Be().optional().default(!1),usbtop:Be().optional().default(!1),usbright:Be().optional().default(!1),usbbottom:Be().optional().default(!1),usbtype:bt(["micro","c"]).optional(),usbmicro:Be().optional().default(!1),usbc:Be().optional().default(!1),screen:Be().optional().default(!1).describe("add silkscreen outline for screen/display area"),screenwidth:ve.optional(),screenheight:ve.optional(),screencenteroffsetx:ve.optional(),screencenteroffsety:ve.optional()}).transform((e)=>{let t=dMt(e),n=e.pinRowSide;if(e.pinrowleft)n="left";if(e.pinrowright)n="right";if(e.pinrowtop)n="top";if(e.pinrowbottom)n="bottom";let o=e.usbposition;if(e.usbleft)o="left";if(e.usbtop)o="top";if(e.usbright)o="right";if(e.usbbottom)o="bottom";let r=e.usbtype;if(e.usbmicro)r="micro";if(e.usbc)r="c";if(e.pinrow!==void 0)e.numPins=Number(e.pinrow);let i={left:e.pinrowleftpins,right:e.pinrowrightpins,top:e.pinrowtoppins,bottom:e.pinrowbottompins},s=Object.values(i).some((x)=>x!==void 0&&x>0),a=(i.left??0)>0&&(i.right??0)>0,c=(i.top??0)>0&&(i.bottom??0)>0;if(s){if((i.left??0)>0)n="left";else if((i.right??0)>0)n="right";else if((i.top??0)>0)n="top";else if((i.bottom??0)>0)n="bottom";e.numPins=(i.left??0)+(i.right??0)+(i.top??0)+(i.bottom??0)}let l=Math.ceil(e.numPins/e.rows),h=Math.max(i.left??0,i.right??0),d=Math.max(i.top??0,i.bottom??0),u,_;if(s){let x=a?e.p:0,C=c?e.p:0;u=(d>0?(d-1)*e.p:0)+2*e.pinRowHoleEdgeToEdgeDist+x,_=(h>0?(h-1)*e.p:0)+2*e.pinRowHoleEdgeToEdgeDist+C}else if(n==="left"||n==="right")u=(e.rows-1)*e.p+2*e.pinRowHoleEdgeToEdgeDist,_=(l-1)*e.p+2*e.pinRowHoleEdgeToEdgeDist;else _=(e.rows-1)*e.p+2*e.pinRowHoleEdgeToEdgeDist,u=(l-1)*e.p+2*e.pinRowHoleEdgeToEdgeDist;if(e.numPins===0)u=10,_=10;let p=e.width??u,m=e.height??_,A=e.screenwidth??p*0.95,g=e.screenheight??m*0.95,f=e.screencenteroffsetx??0,y=e.screencenteroffsety??0;return{...e,pinlabelAnchorSide:t,pinRowSide:n,usbposition:o,usbtype:r,male:e.male??!e.female,female:e.female??!1,width:p,height:m,screenwidth:A,screenheight:g,screencenteroffsetx:f,screencenteroffsety:y,pinrowleftpins:i.left,pinrowrightpins:i.right,pinrowtoppins:i.top,pinrowbottompins:i.bottom}}).superRefine((e,t)=>{if(e.male&&e.female)t.addIssue({code:Gt.custom,message:"'male' and 'female' cannot both be true; it should be male or female.",path:["male","female"]})}),YFo=(e)=>{let t=VFo.parse(e),{p:n,id:o,od:r,rows:i,numPins:s,pinlabelAnchorSide:a,pinlabelverticallyinverted:c,pinlabelorthogonal:l,pinlabeltextalignleft:h,pinlabeltextalignright:d,nopinlabels:u,doublesidedpinlabel:_,bottomsidepinlabel:p,pinRowSide:m,width:A,height:g,pinRowHoleEdgeToEdgeDist:f,holes:y,holeXDist:x,holeYDist:C,holeInset:b,pinrowleftpins:I,pinrowrightpins:v,pinrowtoppins:P,pinrowbottompins:M,usbposition:B,usbtype:T,screen:N,screenwidth:D,screenheight:L,screencenteroffsetx:H,screencenteroffsety:V}=t,O="center";if(h)O="left";else if(d)O="right";let U=[],j={left:I,right:v,top:P,bottom:M},Y=Object.values(j).some((J)=>J!==void 0&&J>0),X=(J,ee,se,ne)=>{if(t.smd)U.push(Ao(J,ee,se,t.od,t.od));else if(J===1)U.push(Gy({pn:J,x:ee,y:se,holeDiameter:o,rectPadWidth:r,rectPadHeight:r}));else U.push(Li(J,ee,se,o,r));if(!u){let re=ee+(ne==="left"?-r:ne==="right"?r:0),Z=se+(ne==="top"?r:ne==="bottom"?-r:0);if(!p)U.push(PO({fs:r/5,pn:J,anchor_x:re,anchor_y:Z,anchorplacement:ne,textalign:O,orthogonal:l,verticallyinverted:c,layer:"top"}));if(_||p)U.push(PO({fs:r/5,pn:J,anchor_x:re,anchor_y:Z,anchorplacement:ne,textalign:O,orthogonal:l,verticallyinverted:c,layer:"bottom"}))}};if(Y){let J=n,ee=1,se=j.left??0,ne=j.right??0,re=j.top??0,Z=j.bottom??0,te=(ie,le)=>{if(le<=0)return;if(ie==="left"||ie==="right"){let ue=ie==="left"?-A/2+f:A/2-f,de=(le-1)/2*J;for(let me=0;me<le;me++)X(ee,ue,de-me*J,ie),ee++}else{let ue=ie==="top"?g/2-f:-g/2+f,de=-((le-1)/2)*J;for(let me=0;me<le;me++)X(ee,de+me*J,ue,ie),ee++}};te("left",se),te("right",ne),te("top",re),te("bottom",Z)}else{let J=n,ee=0,se=0,ne=0,re=0,Z=0,te=0,ie=Math.ceil(s/i);if(m==="left"||m==="right")ee=m==="left"?-A/2+f:A/2-f,se=(ie-1)/2*J,ne=0,re=-J,Z=m==="left"?J:-J,te=0;else ee=-(ie-1)/2*J,se=m==="top"?g/2-f:-g/2+f,ne=J,re=0,Z=0,te=m==="top"?-J:J;let le=1;for(let ue=0;ue<i&&le<=s;ue++)for(let de=0;de<ie&&le<=s;de++){let me=ee+de*ne+ue*Z,Ae=se+de*re+ue*te;if(t.smd)U.push(Ao(le,me,Ae,t.od,t.od));else if(le===1)U.push(Gy({pn:le,x:me,y:Ae,holeDiameter:o,rectPadWidth:r,rectPadHeight:r}));else U.push(Li(le,me,Ae,o,r));if(!u){let xe=me+(m==="left"?-r:m==="right"?r:0),Me=Ae+(m==="top"?r:m==="bottom"?-r:0);if(!p)U.push(PO({fs:r/5,pn:le,anchor_x:xe,anchor_y:Me,anchorplacement:a,textalign:O,orthogonal:l,verticallyinverted:c,layer:"top"}));if(_||p)U.push(PO({fs:r/5,pn:le,anchor_x:xe,anchor_y:Me,anchorplacement:a,textalign:O,orthogonal:l,verticallyinverted:c,layer:"bottom"}))}le++}}if(y)for(let J of y){let ee=0,se=0;if(J==="topleft")ee=-A/2+b,se=g/2-b;else if(J==="topright")ee=A/2-b,se=g/2-b;else if(J==="bottomleft")ee=-A/2+b,se=-g/2+b;else if(J==="bottomright")ee=A/2-b,se=-g/2+b;else if(J==="center")ee=0,se=0;if(x!==void 0)ee+=x;if(C!==void 0)se+=C;U.push(Li(s+y.indexOf(J)+1,ee,se,o,r))}if(!t.nosilkscreen){let J=[{x:-A/2,y:-g/2},{x:A/2,y:-g/2},{x:A/2,y:g/2},{x:-A/2,y:g/2},{x:-A/2,y:-g/2}];U.push(Es(J,{stroke_width:0.1,layer:"top"}))}let K=Jo(0,g/2+1,0.5);if(U.push(K),B&&T){let J,ee;if(T==="c")J=8,ee=3;else if(T==="micro")J=6,ee=2;else return{circuitJson:U,parameters:t};let se;if(B==="left")se=[{x:-A/2,y:-J/2},{x:-A/2+ee,y:-J/2},{x:-A/2+ee,y:J/2},{x:-A/2,y:J/2},{x:-A/2,y:-J/2}];else if(B==="right")se=[{x:A/2-ee,y:-J/2},{x:A/2,y:-J/2},{x:A/2,y:J/2},{x:A/2-ee,y:J/2},{x:A/2-ee,y:-J/2}];else if(B==="top")se=[{x:-J/2,y:g/2-ee},{x:J/2,y:g/2-ee},{x:J/2,y:g/2},{x:-J/2,y:g/2},{x:-J/2,y:g/2-ee}];else if(B==="bottom")se=[{x:-J/2,y:-g/2},{x:J/2,y:-g/2},{x:J/2,y:-g/2+ee},{x:-J/2,y:-g/2+ee},{x:-J/2,y:-g/2}];else return{circuitJson:U,parameters:t};U.push(Es(se,{stroke_width:0.1,layer:"top"}))}if(N){let J=D/2,ee=L/2,se=H,ne=V,re=[{x:-J+se,y:-ee+ne},{x:J+se,y:-ee+ne},{x:J+se,y:ee+ne},{x:-J+se,y:ee+ne},{x:-J+se,y:-ee+ne}];U.push(Es(re,{stroke_width:0.05,layer:"top"}))}return{circuitJson:U,parameters:t}},GFo=[{x:-1.45,y:2.75},{x:-1.45,y:-1.85},{x:4.05,y:-1.85},{x:4.05,y:2.75}],UFo=[{x:-1.55,y:2.75},{x:-1.55,y:-1.85},{x:3.95,y:-1.85},{x:3.95,y:2.75}],WFo=Yo.extend({fn:k(),num_pins:ge().default(3),inline:Be().default(!1),p:k().default("1.27mm"),id:k().default("0.75mm"),od:k().default("1.3mm"),w:k().default("4.8mm"),h:k().default("4.0mm")}),XFo=(e)=>{let t=WFo.parse(e),n=Number.parseFloat(t.p),o=Number.parseFloat(t.w),r=Number.parseFloat(t.h),i=t.inline?1.05:Number.parseFloat(t.od),s=t.inline?1.5:i,a=[Gy({pn:1,x:0,y:0,holeDiameter:t.id,rectPadWidth:i,rectPadHeight:s}),t.inline?dS(2,n,0,Number.parseFloat(t.id),i,s):Li(2,n,n,t.id,i),t.inline?dS(3,n*2,0,Number.parseFloat(t.id),i,s):Li(3,n*2,0,t.id,i)],c=o/2,l=t.inline?n-0.09:n,h=0.2,d=0.2+c-r,u=Array.from({length:32},(A,g)=>{let f=Math.PI*g/31;return{x:l+c*Math.cos(f),y:0.2+c*Math.sin(f)}}),_={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"",stroke_width:0.12,route:[...u,{x:l-c,y:d},{x:l+c,y:d},u[0]]},p=Jo(l,0.2+c+1,0.5),m={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",outline:t.inline?UFo:GFo,layer:"top"};return{circuitJson:[...a,_,p,m],parameters:t}},jFo=Yo.extend({fn:ce("usbcmidmount"),num_pins:ce(16).default(16),pinstart:X7.number().int().positive().default(1),split:Be().default(!1).describe("emit all 16 contact lands"),reverse:Be().default(!1).describe("number contact lands right-to-left"),noholes:Be().default(!1).describe("omit the two locator holes"),rowy:ve.default("2.125mm").describe("contact pad row y position"),ph:ve.default("1.1mm").describe("contact pad height"),pw:ve.default("0.3mm").describe("signal contact pad width"),powerpw:ve.default("0.55mm").describe("merged power pad width"),powerx:ve.default("3.2mm").describe("outer merged power pad x"),shellx:ve.default("4.325mm").describe("shell tab x position"),topy:ve.default("1.575mm").describe("upper shell tab y position"),bottomy:ve.default("2.625mm").describe("lower shell tab negative y magnitude"),tophw:ve.default("0.6mm").describe("upper shell slot width"),tophh:ve.default("1.5mm").describe("upper shell slot height"),topring:ve.default("0.25mm").describe("upper shell annular ring"),bottomhw:ve.default("0.6mm").describe("lower shell slot width"),bottomhh:ve.default("1.2mm").describe("lower shell slot height"),bottomring:ve.default("0.3mm").describe("lower shell annular ring"),holex:ve.default("2.89mm").describe("locator hole x position"),holey:ve.default("1.055mm").describe("locator hole y position"),holed:ve.default("0.7mm").describe("locator hole diameter"),bodybottom:ve.default("5.225mm").describe("connector body negative y extent")}),v1e=({pin:e,x:t,y:n,holeWidth:o,holeHeight:r,outerWidth:i,outerHeight:s})=>({type:"pcb_plated_hole",shape:"pill",pcb_plated_hole_id:"",pcb_component_id:"",pcb_port_id:"",x:t,y:n,hole_width:o,hole_height:r,outer_width:i,outer_height:s,ccw_rotation:0,layers:["top","bottom"],port_hints:[e.toString()]}),KFo=(e)=>{let t=jFo.parse(e),{pinstart:n,split:o,reverse:r,noholes:i,rowy:s,ph:a,pw:c,powerpw:l,powerx:h,shellx:d,topy:u,bottomy:_,tophw:p,tophh:m,topring:A,bottomhw:g,bottomhh:f,bottomring:y,holex:x,holey:C,holed:b,bodybottom:I}=t,v=i?[]:[-x,x].map((ne)=>({type:"pcb_hole",pcb_hole_id:"",pcb_component_id:"",hole_shape:"circle",hole_diameter:b,x:ne,y:C})),P=[v1e({pin:n,x:-d,y:u,holeWidth:p,holeHeight:m,outerWidth:p+2*A,outerHeight:m+2*A}),v1e({pin:n+1,x:d,y:u,holeWidth:p,holeHeight:m,outerWidth:p+2*A,outerHeight:m+2*A}),v1e({pin:n+2,x:-d,y:-_,holeWidth:g,holeHeight:f,outerWidth:g+2*y,outerHeight:f+2*y}),v1e({pin:n+3,x:d,y:-_,holeWidth:g,holeHeight:f,outerWidth:g+2*y,outerHeight:f+2*y})],M=Number((h-0.8).toFixed(12)),B=[-h,-M,-1.75,-1.25,-0.75,-0.25,0.25,0.75,1.25,1.75,M,h],N=o?[-3.35,-3.05,-2.55,-2.25,-1.75,-1.25,-0.75,-0.25,0.25,0.75,1.25,1.75,2.25,2.55,3.05,3.35]:B,D=r?N.slice().reverse():N,L=o?D.map(()=>c):D.map((ne,re)=>re<2||re>=D.length-2?l:c),H=D.map((ne,re)=>Ao(n+4+re,ne,s,L[re],a)),V=Math.min(d-Math.max(p,g)/2-0.2,4.5),O=[Es([{x:-V,y:-_+f/2+y+0.2},{x:-V,y:u-m/2-A-0.2}]),Es([{x:V,y:-_+f/2+y+0.2},{x:V,y:u-m/2-A-0.2}]),Es([{x:-V,y:-I},{x:V,y:-I}])],U=Math.max(s+a/2,u+m/2+A),j=Math.min(-I,-_-f/2-y),Y=-d-Math.max(p+2*A,g+2*y)/2-0.25,X=-Y,K=U+0.25,J=j-0.25,ee=Jo(0,K+0.75,0.5),se={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:(K+J)/2},width:X-Y,height:K-J,layer:"top"};return{circuitJson:[...v,...P,...H,...O,ee,se],parameters:t}},hS=ve.refine((e)=>Number.isFinite(e)&&e>0,"dimension must be finite and positive"),$Fo=Yo.extend({fn:ce("usba"),num_pins:ce(4).default(4),tht:ce(!0).default(!0),smd:ce(!1).default(!1),pinstart:X7.number().int().positive().default(1),reverse:Be().default(!1),p:hS.default("2.5mm").describe("pitch within each outer contact pair"),centerp:hS.default("2mm").describe("pitch between the two inner contacts"),id:hS.default("0.92mm").describe("electrical contact drill diameter"),ring:hS.default("0.3mm").describe("electrical contact annular ring"),shieldspan:hS.default("13.14mm").describe("shell mounting-hole center span"),shieldy:ve.refine(Number.isFinite,"dimension must be finite").default("-2.71mm").describe("signed shell row offset from the contact row"),shieldid:hS.default("2.3mm").describe("shell mounting-hole drill diameter"),shieldring:hS.default("0.3mm").describe("shell mounting-hole annular ring"),w:hS.default("13.1mm").describe("body width"),h:hS.default("13.85mm").describe("body length toward mating edge"),bodybottom:hS.default("12.99mm").describe("mating-edge distance from contact row")}).superRefine((e,t)=>{if(e.id+2*e.ring>=Math.min(e.p,e.centerp))t.addIssue({code:Gt.custom,path:["ring"],message:"contact lands must remain separate"});if(e.shieldid+2*e.shieldring>=e.shieldspan)t.addIssue({code:Gt.custom,path:["shieldring"],message:"shell mounting lands must remain separate"});if(e.bodybottom>e.h)t.addIssue({code:Gt.custom,path:["bodybottom"],message:"mating edge offset must fit within body length"})}),qFo=(e)=>{let t=$Fo.parse(e),{pinstart:n,reverse:o,p:r,centerp:i,id:s,ring:a,shieldspan:c,shieldy:l,shieldid:h,shieldring:d,w:u,h:_,bodybottom:p}=t,m=(L)=>Number(L.toFixed(12)),A=m(s+2*a),g=m(h+2*d),f=i/2,y=f+r,C=[-y,-f,f,y].map((L,H)=>Li(n+H,m(o?-L:L),0,s,A)),b=[Li(n+4,-c/2,l,h,g),Li(n+5,c/2,l,h,g)],I=m(_-p),v=g/2+0.2,P=[[-p,Math.min(I,l-v)],[Math.max(-p,l+v),I]].filter(([L,H])=>H>L),M=[Es([{x:-u/2,y:-p},{x:u/2,y:-p}]),Es([{x:-u/2,y:I},{x:u/2,y:I}]),...P.flatMap(([L,H])=>[-u/2,u/2].map((V)=>Es([{x:V,y:L},{x:V,y:H}])))],B=Math.max(u/2,y+A/2,c/2+g/2),T=Math.max(I,A/2,l+g/2)+0.25,N=Math.min(-p,-A/2,l-g/2)-0.25,D={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:m((T+N)/2)},width:m(2*(B+0.25)),height:m(T-N),layer:"top"};return{circuitJson:[...C,...b,...M,Jo(0,T+0.55,0.5),D],parameters:t}},UA=ve.refine((e)=>Number.isFinite(e)&&e>0,"dimension must be finite and positive"),WEt=ve.refine(Number.isFinite,"dimension must be finite"),JFo=Yo.extend({fn:ce("usbmicro"),num_pins:ce(5).default(5),frontflange:ce(!0).default(!0),noflange:ce(!1).default(!1),pinstart:X7.number().int().positive().default(1),reverse:Be().default(!1),p:UA.default("0.65mm").describe("electrical contact pitch"),pw:UA.default("0.4mm").describe("electrical contact pad width"),ph:UA.default("1.35mm").describe("electrical contact pad height"),rowy:WEt.default("2.675mm").describe("contact row from front slots"),rearspan:UA.default("5mm").describe("rear shell slot center span"),reary:WEt.default("2.7mm").describe("rear shell row from front slots"),rearhw:UA.default("0.85mm").describe("rear shell slot width"),rearhh:UA.default("0.55mm").describe("rear shell slot height"),rearring:UA.default("0.2mm").describe("rear shell annular ring"),frontspan:UA.default("7mm").describe("front shell slot center span"),fronthw:UA.default("0.5mm").describe("front shell slot width"),fronthh:UA.default("1.15mm").describe("front shell slot height"),frontpw:UA.default("1mm").describe("centered front shell land width"),frontph:UA.default("1.55mm").describe("centered front shell land height"),tabspan:UA.default("2mm").describe("inner shell SMT tab center span"),tabpw:UA.default("1.5mm").describe("inner shell SMT tab pad width"),tabph:UA.default("1.55mm").describe("inner shell SMT tab pad height"),w:UA.default("8mm").describe("body width including front flange"),bodytop:UA.default("2.7mm").describe("body extent behind front slots"),bodybottom:UA.default("2.3mm").describe("body extent toward mating edge")}).superRefine((e,t)=>{for(let[n,o,r]of[[e.pw>=e.p,"pw","contact pads must be narrower than pitch"],[e.frontpw<=e.fronthw,"frontpw","front land must surround slot width"],[e.frontph<=e.fronthh,"frontph","front land must surround slot height"],[e.tabpw>=e.tabspan,"tabpw","inner shell pads must remain separate"]])if(n)t.addIssue({code:Gt.custom,path:[o],message:r})}),ZFo=(e)=>{let t=JFo.parse(e),{pinstart:n,reverse:o,p:r,pw:i,ph:s,rowy:a,rearspan:c,reary:l,rearhw:h,rearhh:d,rearring:u,frontspan:_,fronthw:p,fronthh:m,frontpw:A,frontph:g,tabspan:f,tabpw:y,tabph:x,w:C,bodytop:b,bodybottom:I}=t,v=(j)=>Number(j.toFixed(12)),P=Array.from({length:5},(j,Y)=>Ao(n+Y,v((o?2-Y:Y-2)*r),a,i,s)),M=(j,Y,X,K,J,ee,se)=>({type:"pcb_plated_hole",shape:"pill",pcb_plated_hole_id:"",pcb_component_id:"",pcb_port_id:"",x:Y,y:X,hole_width:K,hole_height:J,outer_width:v(ee),outer_height:v(se),ccw_rotation:0,layers:["top","bottom"],port_hints:[String(j)]}),B=[M(n+5,-c/2,l,h,d,h+2*u,d+2*u),M(n+6,c/2,l,h,d,h+2*u,d+2*u),M(n+7,-_/2,0,p,m,A,g),M(n+8,_/2,0,p,m,A,g)],T=[Ao(n+9,-f/2,0,y,x),Ao(n+10,f/2,0,y,x)],N=Math.max(g,x)/2+0.2,D=[[-I,Math.min(b,-N)],[Math.max(-I,N),b]].filter(([j,Y])=>Y>j),L=[Es([{x:-C/2,y:-I},{x:C/2,y:-I}]),...D.flatMap(([j,Y])=>[-C/2,C/2].map((X)=>Es([{x:X,y:j},{x:X,y:Y}])))],H=Math.max(C/2,2*r+i/2,c/2+h/2+u,_/2+A/2,f/2+y/2),V=Math.max(b,a+s/2,l+d/2+u,g/2,x/2)+0.25,O=Math.min(-I,a-s/2,l-d/2-u,-g/2,-x/2)-0.25,U={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:v((V+O)/2)},width:v(2*(H+0.25)),height:v(V-O),layer:"top"};return{circuitJson:[...P,...B,...T,...L,Jo(0,V+0.55,0.5),U],parameters:t}},gws=D1e.extend({}).transform(N1e),ezo=(e)=>{if(e.legsoutside=!1,!e.pl)e.pl=1;if(!e.pw)e.pw=0.6;return qR(e)},tzo=(e,t)=>{let n=e.filter((o)=>o.type==="pcb_silkscreen_text");if(n.length===0)return e;for(let o of n)if(t.norefdes)o.text="";return e},nzo=(e,t)=>{if(!t.nosilkscreen)return e;return e.filter((n)=>n.type!=="pcb_silkscreen_path"&&n.type!=="pcb_silkscreen_text")},ozo=(e,t)=>{if(!t)return e;let n=e.filter((h)=>h.type==="pcb_smtpad"||h.type==="pcb_plated_hole");if(n.length===0)return e;let{POSITIVE_INFINITY:o,NEGATIVE_INFINITY:r,POSITIVE_INFINITY:i,NEGATIVE_INFINITY:s}=Number,a=(h,d,u=0,_=0)=>{let p=h-u/2,m=h+u/2,A=d-_/2,g=d+_/2;o=Math.min(o,p),r=Math.max(r,m),i=Math.min(i,A),s=Math.max(s,g)};for(let h of n)if(h.type==="pcb_smtpad"){if(h.shape==="polygon"){for(let _ of h.points)a(_.x,_.y);continue}let d=h.shape==="circle"?h.radius*2:h.width,u=h.shape==="circle"?h.radius*2:h.height;if(h.shape==="rotated_rect"){let _=h.ccw_rotation*Math.PI/180,p=Math.abs(Math.cos(_)),m=Math.abs(Math.sin(_));[d,u]=[d*p+u*m,d*m+u*p]}a(h.x,h.y,d,u)}else if(h.type==="pcb_plated_hole"){let d=h.outer_diameter??h.hole_diameter;a(h.x,h.y,d,d)}let c=0,l=0;switch(t){case"center":c=(o+r)/2,l=(i+s)/2;break;case"bottomleft":c=o,l=i;break;case"bottomcenter":case"centerbottom":c=(o+r)/2,l=i;break;case"topcenter":case"centertop":c=(o+r)/2,l=s;break;case"leftcenter":case"centerleft":c=o,l=(i+s)/2;break;case"rightcenter":case"centerright":c=r,l=(i+s)/2;break;case"pin1":{let h=n.find((d)=>d.port_hints?.[0]==="1")||n[0];c=h.x,l=h.y;break}}if(c===0&&l===0)return e;for(let h of e){if(typeof h.x==="number")h.x-=c;if(typeof h.y==="number")h.y-=l;if(h.center&&typeof h.center.x==="number")h.center.x-=c,h.center.y-=l;for(let d of["points","outline","route"]){if(!Array.isArray(h[d]))continue;for(let u of h[d])u.x-=c,u.y-=l}if((h.type==="pcb_silkscreen_text"||h.type==="pcb_fabrication_note_text")&&h.anchor_position)h.anchor_position.x-=c,h.anchor_position.y-=l}return e},rzo=[0,90,180,270],M1e=(e,t)=>{switch(t){case 90:return{x:-e.y,y:e.x};case 180:return{x:-e.x,y:-e.y};case 270:return{x:e.y,y:-e.x};default:return{...e}}},XEt=(e)=>{if(typeof e.x==="number"&&typeof e.y==="number")return{x:e.x,y:e.y};if(Array.isArray(e.points)&&e.points.length>0){let t=e.points.map((o)=>o.x),n=e.points.map((o)=>o.y);return{x:(Math.min(...t)+Math.max(...t))/2,y:(Math.min(...n)+Math.max(...n))/2}}return null},izo=(e)=>e.port_hints?.some((t)=>/^(?:pin)?1$/i.test(String(t))),szo=(e,t,[n,o])=>{let r=e.map((g)=>g.x),i=e.map((g)=>g.y),s=Math.min(...r),a=Math.max(...r),c=Math.min(...i),l=Math.max(...i),h=(s+a)/2,d=(c+l)/2,u=a-s,_=l-c,p=Math.max(u,_,1)*0.000001,m=n==="leftside"&&Math.abs(t.x-s)<=p||n==="rightside"&&Math.abs(t.x-a)<=p||n==="topside"&&Math.abs(t.y-l)<=p||n==="bottomside"&&Math.abs(t.y-c)<=p,A=o==="left"&&(u<=p||t.x<h-p)||o==="right"&&(u<=p||t.x>h+p)||o==="top"&&(_<=p||t.y>d+p)||o==="bottom"&&(_<=p||t.y<d-p);return m&&A},Tze=(e,t)=>{if(!e||typeof e!=="object"||typeof e.x!=="number"||typeof e.y!=="number")return;let n=M1e(e,t);e.x=n.x,e.y=n.y},S1e=(e)=>(e%360+360)%360,azo=(e,t)=>{switch(e.shape){case"rect":return{...e,shape:"rotated_rect",ccw_rotation:S1e(t)};case"pill":return{...e,shape:"rotated_pill",ccw_rotation:S1e(t)};case"rotated_rect":case"rotated_pill":return{...e,ccw_rotation:S1e(e.ccw_rotation+t)};default:return e}},czo=(e,t)=>{if(t===0)return e;return e.map((n)=>{let o=structuredClone(n);if(typeof o.x==="number"&&typeof o.y==="number"){let r=M1e(o,t);o.x=r.x,o.y=r.y}Tze(o.center,t),Tze(o.anchor_position,t);for(let r of["route","outline","points"]){if(!Array.isArray(o[r]))continue;for(let i of o[r])Tze(i,t)}if(o.type==="pcb_smtpad")return azo(o,t);if(o.type==="pcb_plated_hole"||o.type==="pcb_silkscreen_text"||o.type==="pcb_fabrication_note_text")o.ccw_rotation=S1e(Number(o.ccw_rotation??0)+t);if((t===90||t===270)&&(o.type==="pcb_courtyard_rect"||o.type==="pcb_silkscreen_rect"||o.type==="pcb_fabrication_note_rect"||o.type==="pcb_cutout"&&o.shape==="rect"))[o.width,o.height]=[o.height,o.width];return o})},lzo=(e,t)=>{if(!t)return e;let n=e.filter((a)=>a.type==="pcb_smtpad"||a.type==="pcb_plated_hole"),o=n.find(izo),r=n.map(XEt).filter((a)=>a!==null),i=o?XEt(o):null;if(!o||!i||r.length===0)throw Error(`pin1location(${t.join(",")}) requires a footprint with a pad whose port_hints contain "1" or "pin1"`);let s=rzo.find((a)=>{let c=r.map((h)=>M1e(h,a)),l=M1e(i,a);return szo(c,l,t)});if(s===void 0)throw Error(`pin1location(${t.join(",")}) cannot be reached with a rotation; the requested location may be the mirrored orientation of this footprint`);return czo(e,s)},jEt=(e,t,n)=>Math.min(e,t/2,n/2),hzo=(e,t)=>{if(t===void 0)return e;let n=ki(t);if(!Number.isFinite(n)||n<0)throw Error(`rounded radius must be a non-negative length, got "${t}"`);for(let o of e){if(o.type==="pcb_smtpad"&&(o.shape==="rect"||o.shape==="rotated_rect"))o.corner_radius=jEt(n,o.width,o.height);if(o.type==="pcb_plated_hole"&&"rect_pad_width"in o&&"rect_pad_height"in o)o.rect_border_radius=jEt(n,o.rect_pad_width,o.rect_pad_height)}return e};function dzo(e){return e!==null&&e!==void 0}var uzo=(e)=>e.trim().replace(/^do-219ad(?=_|$)/i,"do219ad").replace(/^sod-323he(?=_|$)/i,"sod323he").replace(/^pinheader(?=[\d_]|$)/i,"pinrow").replace(/^d2pak(\d+)(?=_|$)/i,"d2pak_$1").replace(/^to-252(?:-(\d+))?(?=_|$)/i,(t,n)=>n?`to252_${n}`:"to252").replace(/^to-263(?:-(\d+))?(?=_|$)/i,(t,n)=>n?`to263_${n}`:"to263").replace(/^sot-23(?:-(\d+))?(?=_|$)/i,(t,n)=>n?`sot23_${n}`:"sot23").replace(/^sot23-(\d+)(?=_|$)/i,"sot23_$1").replace(/^sot-223-(\d+)(?=_|$)/i,"sot223_$1").replace(/^to-220f-(\d+)(?=_|$)/i,"to220f_$1").replace(/^jst_(ph|sh|zh|xh)_(\d+)(?=_|$)/i,"jst$2_$1"),pzo=(e)=>e.replace(/([+-]?(?:\d+(?:\.\d*)?|\.\d+))\s*(?:um|µm)(?=$|[x,() ])/gi,(t)=>`${Number(ve.parse(t).toPrecision(12))}mm`),mzo=(e)=>{let t=R1e(),n=uzo(e),r=n.replace(/^((?:\d{4}|\d{5}))(?=$|_|x)/,"res$1").replace(/^zh(\d+)(?=$|_)/,"jst$1_zh").split(/_(?!metric)/).map((i)=>{let s=i.match(/^(pin1location)(\(.*\))$/i);if(s)return{fn:s[1].toLowerCase(),v:s[2]};let a=i.match(/((?:(?:p\d+|pin1)[a-zA-Z]+(?=[\(\d\.\+\-\?]))|[a-zA-Z]+)([\(\d\.\+\-\?].*)?/);if(!a)return null;let[,c,l]=a;if(!c)return null;let h=c.toLowerCase();if(l?.includes("?"))return null;return{fn:h,v:l}}).filter(dzo);for(let{fn:i,v:s}of r)t=t[i](s);return t.setString(n),t},_zo=()=>Object.keys(kw);var R1e=()=>{let e=new Proxy({},{get:(t,n)=>{if(n==="soup"||n==="circuitJson"){if("fn"in t&&kw[t.fn])return()=>{let{circuitJson:o}=kw[t.fn](t),r=nzo(o,t),i=tzo(r,t),s=lzo(i,t.pin1location?KEt.parse(t.pin1location):void 0),a=hzo(s,t.rounded);return ozo(a,t.origin)};if(!kw[t.fn])throw Error(`Invalid footprint function, got "${t.fn}"${t.string?`, from string "${t.string}"`:""}`);return()=>{throw Error(`No function found for footprinter, make sure to specify .dip, .lr, .p, etc. Got "${n}"`)}}if(n==="json"){if(!kw[t.fn])throw Error(`Invalid footprint function, got "${t.fn}"${t.string?`, from string "${t.string}"`:""}`);return()=>kw[t.fn](t).parameters}if(n==="getFootprintNames")return()=>Object.keys(kw);if(n==="params")return()=>t;if(n==="setString")return(o)=>(t.string=o,e);return(...o)=>{let r=o[0],i=typeof r==="string"?pzo(r):r;if(Object.keys(t).length===0)if(`${n}${r}`in kw)t[`${n}${r}`]=!0,t.fn=`${n}${r}`;else if(t[n]=!0,t.fn=n,n==="res"||n==="cap"||n==="led"||n==="diode"){if(r)if(typeof r==="string"&&r.includes("_metric"))t.metric=r.split("_metric")[0];else t.imperial=r}else t.num_pins=Number.isNaN(Number.parseFloat(r))?void 0:Number.parseFloat(r);else if(!r&&["w","h","p"].includes(n));else t[n]=n==="pin1location"&&o.length>1?o:i??!0;return e}}});return e};R1e.string=mzo;R1e.getFootprintNames=_zo;var Ah=R1e;qt();var P4n=at(j0(),1);qt();var RMt=at(j0(),1),LMt=at(j0(),1),FMt=at(j0(),1);qt();Yfe();var bMt=at(As(),1),kze=(e,t={})=>{let n=e._internal_store;if(!n){n={counts:{}},e._internal_store=n;for(let r of e){let i=r.type,s=r[`${i}_id`];if(!s)continue;let a=Number.parseInt(s.split("_").pop());if(!Number.isNaN(a))n.counts[i]=Math.max(n.counts[i]??0,a)}}return new Proxy({},{get:(r,i)=>{if(i==="toArray")return()=>e;return{get:(s)=>e.find((a)=>a.type===i&&a[`${i}_id`]===s),getUsing:(s)=>{let a=Object.keys(s);if(a.length!==1)throw Error("getUsing requires exactly one key, e.g. { pcb_component_id }");let c=a[0],l=c.replace("_id",""),h=e.find((d)=>d.type===l&&d[c]===s[c]);if(!h)return null;return e.find((d)=>d.type===i&&d[`${i}_id`]===h[`${i}_id`])},getWhere:(s)=>{let a=Object.keys(s);return e.find((c)=>c.type===i&&a.every((l)=>c[l]===s[l]))},list:(s)=>{let a=!s?[]:Object.keys(s);return e.filter((c)=>c.type===i&&a.every((l)=>c[l]===s[l]))},insert:(s)=>{n.counts[i]??=-1,n.counts[i]++;let a=n.counts[i],c={type:i,[`${i}_id`]:`${i}_${a}`,...s};if(t.validateInserts)(PR[i]??SR).parse(c);return e.push(c),c},delete:(s)=>{let a=e.find((c)=>c[`${i}_id`]===s);if(!a)return;e.splice(e.indexOf(a),1)},update:(s,a)=>{let c=e.find((l)=>l.type===i&&l[`${i}_id`]===s);if(!c)return;return Object.assign(c,a),c},select:(s)=>{if(i==="source_component")return e.find((a)=>a.type==="source_component"&&a.name===s.replace(/\./g,""));else if(i==="pcb_port"||i==="source_port"||i==="schematic_port"){let[a,c]=s.replace(/\./g,"").split(/[\s\>]+/),l=e.find((d)=>d.type==="source_component"&&d.name===a);if(!l)return null;let h=e.find((d)=>d.type==="source_port"&&d.source_component_id===l.source_component_id&&(d.name===c||(d.port_hints??[]).includes(c)));if(!h)return null;if(i==="source_port")return h;if(i==="pcb_port")return e.find((d)=>d.type==="pcb_port"&&d.source_port_id===h.source_port_id);else if(i==="schematic_port")return e.find((d)=>d.type==="schematic_port"&&d.source_port_id===h.source_port_id)}}}}})};kze.unparsed=kze;var WA=kze;yc();var Vzo=at(vMt(),1);yc();yc();var SMt="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var PMt=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));while(e--)t+=SMt[n[e]&63];return t};yc();var BO=(e,t)=>Math.abs(e.x-t.x)+Math.abs(e.y-t.y),EMt=(e,t)=>{let n=t.x-e.x,o=t.y-e.y;if(Math.abs(n)>Math.abs(o))return{dx:Math.sign(n),dy:0};else return{dx:0,dy:Math.sign(o)}},DMt=(e,t,n)=>Math.abs(e.x-t.x)*Math.abs(n.dx)+Math.abs(e.y-t.y)*Math.abs(n.dy),NMt=(e,t=0.1)=>`${Math.round(e.x/t)},${Math.round(e.y/t)}`,MMt=(e,t)=>Math.abs(e-t)<0.0001,QMt=(e,t,{viaDiameter:n=0.5}={})=>{let o=[];for(let r=0;r<e.length-1;r++){let[i,s]=[e[r],e[r+1]],a=r-1>=0?e[r-1]:null,c=MMt(i.y,s.y),l=MMt(i.x,s.x);if(!c&&!l)throw Error(`getObstaclesFromTrace currently only supports horizontal and vertical traces (not diagonals) Conflicting trace: ${t}, start: (${i.x}, ${i.y}), end: (${s.x}, ${s.y})`);let h={type:"rect",layers:[i.layer],center:{x:(i.x+s.x)/2,y:(i.y+s.y)/2},width:c?Math.abs(i.x-s.x):0.1,height:l?Math.abs(i.y-s.y):0.1,connectedTo:[t]};if(o.push(h),a&&a.layer===i.layer&&i.layer!==s.layer){let d={type:"rect",layers:[i.layer,s.layer],center:{x:i.x,y:i.y},connectedTo:[t],width:n,height:n};o.push(d)}}return o},kMt=class{obstacles;GRID_STEP=0.1;constructor(e){this.obstacles=e.map((t)=>({...t,left:t.center.x-t.width/2,right:t.center.x+t.width/2,top:t.center.y+t.height/2,bottom:t.center.y-t.height/2}))}getObstacleAt(e,t,n){n??=this.GRID_STEP;for(let o of this.obstacles){let r=o.width/2+n,i=o.height/2+n;if(e>=o.center.x-r&&e<=o.center.x+r&&t>=o.center.y-i&&t<=o.center.y+i)return o}return null}isObstacleAt(e,t,n){return this.getObstacleAt(e,t,n)!==null}getDirectionDistancesToNearestObstacle(e,t){let{GRID_STEP:n}=this,o={left:1/0,top:1/0,bottom:1/0,right:1/0};for(let r of this.obstacles)if(r.type==="rect"){let i=r.center.x-r.width/2-n,s=r.center.x+r.width/2+n,a=r.center.y+r.height/2+n,c=r.center.y-r.height/2-n;if(t>=c&&t<=a&&e>i)o.left=Math.min(o.left,e-s);if(t>=c&&t<=a&&e<s)o.right=Math.min(o.right,i-e);if(e>=i&&e<=s&&t<a)o.top=Math.min(o.top,c-t);if(e>=i&&e<=s&&t>c)o.bottom=Math.min(o.bottom,t-a)}return o}getOrthoDirectionCollisionInfo(e,t,{margin:n=0}={}){let{x:o,y:r}=e,{dx:i,dy:s}=t,a=1/0,c=null;for(let l of this.obstacles){let h=l.left-n,d=l.right+n,u=l.top+n,_=l.bottom-n,p=null;if(i===1&&s===0){if(r>_&&r<u&&o<l.left)p=l.left-o}else if(i===-1&&s===0){if(r>_&&r<u&&o>l.right)p=o-l.right}else if(i===0&&s===1){if(o>h&&o<d&&r<l.bottom)p=l.bottom-r}else if(i===0&&s===-1){if(o>h&&o<d&&r>l.top)p=r-l.top}if(p!==null&&p<a)a=p,c=l}return{dx:i,dy:s,wallDistance:a,obstacle:c}}getObstaclesOverlappingRegion(e){let t=[];for(let n of this.obstacles){let{left:o,right:r,top:i,bottom:s}=n;if(o<=e.maxX&&r>=e.minX&&i<=e.maxY&&s>=e.minY)t.push(n)}return t}};function Qzo(e){if(e.length<4)return e;let t=[{...e[0]}],n=e[0].layer;for(let o=1;o<e.length;o++){let r={start:e[o-1],end:e[o]},i=e[o].route_type==="via"||e[o-1].route_type==="via";if(e[o].layer!==n||i){t.push({...e[o]}),n=e[o].layer;continue}let s=!1,a=null,c=-1;for(let h=0;h<t.length-1;h++){let d={start:t[h],end:t[h+1]};if(d.start.layer!==r.start.layer)continue;if(d.start.layer===r.start.layer){let u=kzo(d,r);if(u){s=!0,a={...u,layer:n},c=h;break}}}if(s&&a)t.splice(c+1),t.push(a);let l=t[t.length-1];if(l.x!==e[o].x||l.y!==e[o].y)t.push(e[o])}return t}function kzo(e,t){if(e.start.x===e.end.x&&t.start.x===t.end.x||e.start.y===e.end.y&&t.start.y===t.end.y)return null;let n;if(e.start.x===e.end.x){let o=e.start.x,r=t.start.y;n={...e.start,x:o,y:r}}else{let o=t.start.x,r=e.start.y;n={...e.start,x:o,y:r}}if(wMt(n,e)&&wMt(n,t))return n;return null}function wMt(e,t){return e.x>=Math.min(t.start.x,t.end.x)&&e.x<=Math.max(t.start.x,t.end.x)&&e.y>=Math.min(t.start.y,t.end.y)&&e.y<=Math.max(t.start.y,t.end.y)}function Lzo(e){let t=[e[0]];for(let n=1;n<e.length-1;n++){let[o,r,i]=[e[n-1],e[n],e[n+1]];if(t.push(r),r.route_type!=="wire"||o.route_type!=="wire"||i.route_type!=="wire")continue;if(o.layer===r.layer&&r.layer!==i.layer)t.push({route_type:"via",from_layer:r.layer,to_layer:i.layer,x:r.x,y:r.y})}return t.push(e[e.length-1]),t}var wws=LMt.default("autorouter:shortenPathWithShortcuts");function Hzo(e,t){if(e.length<=2)return e;let n=[e[0]];for(let o=1;o<e.length;o++){let r={start:n[n.length-1],end:e[o]},i=-1,s=r.start.x===r.end.x,a=r.start.y===r.end.y;for(let c=o+1;c<e.length;c++){if(c<=i)continue;let l={start:e[c],end:e[c+1]};if(!l.end)continue;let h=l.start.x===l.end.x,d=l.start.y===l.end.y,u=s&&h,_=a&&d;if(_&&u)continue;if(!(u||_))continue;let m=!1,A=Math.min(r.start.x,r.end.x),g=Math.max(r.start.x,r.end.x),f=Math.min(l.start.x,l.end.x),y=Math.max(l.start.x,l.end.x),x=Math.min(r.start.y,r.end.y),C=Math.max(r.start.y,r.end.y),b=Math.min(l.start.y,l.end.y),I=Math.max(l.start.y,l.end.y);if(_)m=A<=y&&g>=f;else if(u)m=x<=I&&C>=b;if(!m)continue;let v=[],P=n[n.length-1],M=e[c+2];if(!M)continue;if(_&&f<g&&M.x===f)v.push({x:f,y:r.start.y,layer:r.start.layer});if(_&&y>A&&M.x===y)v.push({x:y,y:r.start.y,layer:r.start.layer});if(u&&b<C&&M.y===b)v.push({x:r.start.x,y:b,layer:r.start.layer});if(u&&I>x&&M.y===I)v.push({x:r.start.x,y:I,layer:r.start.layer});let B=null;for(let T of v){if(t(P,T)||t(M,T))continue;B=T;break}if(!B)continue;n.push(B),o=c+1,i=c+1;break}if(i===-1)n.push(e[o])}if(n[n.length-1]!==e[e.length-1])n.push(e[e.length-1]);return n}var wO=RMt.default("autorouting-dataset:astar"),HMt=class{openSet=[];closedSet=new Set;debug=!1;debugSolutions;debugMessage=null;debugTraceCount=0;input;obstacles;allObstacles;startNode;goalPoint;GRID_STEP;OBSTACLE_MARGIN;MAX_ITERATIONS;isRemovePathLoopsEnabled;isShortenPathWithShortcutsEnabled;GREEDY_MULTIPLIER=1.1;iterations=-1;constructor(e){if(this.input=e.input,this.allObstacles=e.input.obstacles,this.startNode=e.startNode,this.goalPoint=e.goalPoint?{l:0,...e.goalPoint}:void 0,this.GRID_STEP=e.GRID_STEP??0.1,this.OBSTACLE_MARGIN=e.OBSTACLE_MARGIN??0.15,this.MAX_ITERATIONS=e.MAX_ITERATIONS??100,this.debug=e.debug??wO.enabled,this.isRemovePathLoopsEnabled=e.isRemovePathLoopsEnabled??!1,this.isShortenPathWithShortcutsEnabled=e.isShortenPathWithShortcutsEnabled??!1,this.debug)wO.enabled=!0;if(wO.enabled)this.debugSolutions={},this.debugMessage=""}getNeighbors(e){return[]}isSameNode(e,t){return BO(e,t)<this.GRID_STEP}computeG(e,t){return e.g+BO(e,t)}computeH(e){return BO(e,this.goalPoint)}getNodeName(e){return NMt(e,this.GRID_STEP)}solveOneStep(){this.iterations+=1;let{openSet:e,closedSet:t,GRID_STEP:n,goalPoint:o}=this;e.sort((a,c)=>a.f-c.f);let r=e.shift();if(this.computeH(r)<=n*2)return{solved:!0,current:r,newNeighbors:[]};this.closedSet.add(this.getNodeName(r));let s=[];for(let a of this.getNeighbors(r)){if(t.has(this.getNodeName(a)))continue;let c=this.computeG(r,a),l=this.openSet.find((h)=>this.isSameNode(h,a));if(!l||c<l.g){let h=this.computeH(a),d=c+h*this.GREEDY_MULTIPLIER,u={...a,g:c,h,f:d,obstacleHit:a.obstacleHit??void 0,manDistFromParent:BO(r,a),nodesInPath:r.nodesInPath+1,parent:r,enterMarginCost:a.enterMarginCost,travelMarginCostFactor:a.travelMarginCostFactor};e.push(u),s.push(u)}}if(wO.enabled)e.sort((a,c)=>a.f-c.f),this.drawDebugSolution({current:r,newNeighbors:s});return{solved:!1,current:r,newNeighbors:s}}getStartNode(e){return{x:e.pointsToConnect[0].x,y:e.pointsToConnect[0].y,manDistFromParent:0,f:0,g:0,h:0,nodesInPath:0,parent:null}}layerToIndex(e){return 0}indexToLayer(e){return"top"}preprocessConnectionBeforeSolving(e){return e}solveConnection(e){if(e.pointsToConnect.length>2)throw Error("GeneralizedAstarAutorouter doesn't currently support 2+ points in a connection");e=this.preprocessConnectionBeforeSolving(e);let{pointsToConnect:t}=e;this.iterations=0,this.closedSet=new Set,this.startNode=this.getStartNode(e),this.goalPoint={...t[t.length-1],l:this.layerToIndex(t[t.length-1].layer)},this.openSet=[this.startNode];while(this.iterations<this.MAX_ITERATIONS){let{solved:n,current:o}=this.solveOneStep();if(n){let r=[],i=o;while(i){let s=i.l;r.unshift({x:i.x,y:i.y,layer:s!==void 0?this.indexToLayer(s):t[0].layer}),i=i.parent}if(wO.enabled)this.debugMessage+=`t${this.debugTraceCount}: ${this.iterations} iterations
`;if(this.isRemovePathLoopsEnabled)r=Qzo(r);if(this.isShortenPathWithShortcutsEnabled)r=Hzo(r,(s,a)=>{if(s.x===a.x&&s.y===a.y)return!1;let c=this.obstacles.getOrthoDirectionCollisionInfo({x:s.x,y:s.y,l:this.layerToIndex(s.layer)??0},{dx:Math.sign(a.x-s.x),dy:Math.sign(a.y-s.y),dl:0},{margin:0.05}),l=Math.sqrt((s.x-a.x)**2+(s.y-a.y)**2);return c.wallDistance<l});return{solved:!0,route:r,connectionName:e.name}}if(this.openSet.length===0)break}if(wO.enabled)this.debugMessage+=`t${this.debugTraceCount}: ${this.iterations} iterations (failed)
`;return{solved:!1,connectionName:e.name}}createObstacleList({dominantLayer:e,connection:t,obstaclesFromTraces:n}){return new kMt(this.allObstacles.filter((o)=>!o.connectedTo.includes(t.name)).filter((o)=>o.layers.includes(e)).concat(n??[]))}postprocessConnectionSolveResult(e,t){return t}solve(){let e=[],t=[];this.debugTraceCount=0;for(let n of this.input.connections){let o=n.pointsToConnect[0].layer??"top";this.debugTraceCount+=1,this.obstacles=this.createObstacleList({dominantLayer:o,connection:n,obstaclesFromTraces:t});let r=this.solveConnection(n);if(r=this.postprocessConnectionSolveResult(n,r),e.push(r),wO.enabled)this.drawDebugTraceObstacles(t);if(r.solved)t.push(...QMt(r.route.map((i)=>({x:i.x,y:i.y,layer:i.layer??o})),n.name))}return e}solveAndMapToTraces(){return this.solve().flatMap((t)=>{if(!t.solved)return[];return[{type:"pcb_trace",pcb_trace_id:`pcb_trace_for_${t.connectionName}`,route:Lzo(t.route.map((n)=>({route_type:"wire",x:n.x,y:n.y,width:this.input.minTraceWidth,layer:n.layer})))}]})}getDebugGroup(){let e=`t${this.debugTraceCount}_iter[${this.iterations-1}]`;if(this.iterations<30)return e;if(this.iterations<100&&this.iterations%10===0)return e;if(this.iterations<1000&&this.iterations%100===0)return e;if(!this.debugSolutions)return e;return null}drawDebugTraceObstacles(e){let{debugTraceCount:t,debugSolutions:n}=this;for(let o in n)if(o.startsWith(`t${t}_`))n[o].push(...e.map((r,i)=>({type:"pcb_smtpad",pcb_component_id:"",layer:r.layers[0],width:r.width,shape:"rect",x:r.center.x,y:r.center.y,pcb_smtpad_id:`trace_obstacle_${i}`,height:r.height})))}drawDebugSolution({current:e,newNeighbors:t}){let n=this.getDebugGroup();if(!n)return;let{openSet:o,debugTraceCount:r,debugSolutions:i}=this;i[n]??=[];let s=i[n];s.push({type:"pcb_fabrication_note_text",pcb_fabrication_note_text_id:`debug_note_${e.x}_${e.y}`,font:"tscircuit2024",font_size:0.25,text:"X"+(e.l!==void 0?e.l:""),pcb_component_id:"",layer:"top",anchor_position:{x:e.x,y:e.y},anchor_alignment:"center"});for(let a=0;a<o.length;a++){let c=o[a];s.push({type:"pcb_fabrication_note_path",pcb_component_id:"",pcb_fabrication_note_path_id:`note_path_${c.x}_${c.y}`,layer:"top",route:[[0,0.05],[0.05,0],[0,-0.05],[-0.05,0],[0,0.05]].map(([l,h])=>({x:c.x+l,y:c.y+h})),stroke_width:0.01}),s.push({type:"pcb_fabrication_note_text",pcb_fabrication_note_text_id:`debug_note_${c.x}_${c.y}`,font:"tscircuit2024",font_size:0.03,text:a.toString(),pcb_component_id:"",layer:"top",anchor_position:{x:c.x,y:c.y},anchor_alignment:"center"})}if(e.parent){let a=[],c=e;while(c)a.unshift(c),c=c.parent;s.push({type:"pcb_fabrication_note_path",pcb_component_id:"",pcb_fabrication_note_path_id:`note_path_${e.x}_${e.y}`,layer:"top",route:a,stroke_width:0.01})}}},Fzo=FMt.default("autorouting-dataset:infinite-grid-ijump-astar:get-distance-to-overcome-obstacle");function Lze({node:e,travelDir:t,wallDir:n,obstacle:o,obstacles:r,obstaclesInRow:i=0,OBSTACLE_MARGIN:s=0.15,SHOULD_DETECT_CONJOINED_OBSTACLES:a=!1,MAX_CONJOINED_OBSTACLES:c=20}){let l;if(t.dx===0)if(t.dy>0)l=o.center.y+o.height/2-e.y;else l=e.y-(o.center.y-o.height/2);else if(t.dx>0)l=o.center.x+o.width/2-e.x;else l=e.x-(o.center.x-o.width/2);if(l+=s,a&&i<c){let h=r.getObstacleAt(e.x+t.dx*l+n.dx*(n.wallDistance+0.001),e.y+t.dy*l+n.dy*(n.wallDistance+0.001));if(h===o)return l;if(h&&h.type==="rect"){let d=t.dy===0,u=d?o.height:o.width;if((d?h.height:h.width)>u)return Fzo("next obstacle on path is bigger, not trying to overcome it"),l;let p=Lze({node:{x:e.x+t.dx*l,y:e.y+t.dy*l},travelDir:t,wallDir:n,obstacle:h,obstacles:r,obstaclesInRow:i+1,SHOULD_DETECT_CONJOINED_OBSTACLES:a,MAX_CONJOINED_OBSTACLES:c,OBSTACLE_MARGIN:s});l+=p}}return l}var zzo=class extends HMt{MAX_ITERATIONS=200;getNeighbors(e){let t=this.obstacles,n=this.goalPoint,o;if(!e.parent)o=EMt(e,n);else o=EMt(e.parent,e);let r=[{dx:0,dy:1},{dx:1,dy:0},{dx:0,dy:-1},{dx:-1,dy:0}].filter((s)=>{if(s.dx===o.dx*-1&&s.dy===o.dy*-1)return!1;else if(s.dx===o.dx&&s.dy===o.dy&&e.parent?.obstacleHit)return!1;return!0}).map((s)=>t.getOrthoDirectionCollisionInfo(e,s,{margin:this.OBSTACLE_MARGIN})).filter((s)=>s.wallDistance>=this.OBSTACLE_MARGIN),i=[];for(let s of r){let a=null;if(e?.obstacleHit)a=Lze({node:e,travelDir:s,wallDir:{...o,wallDistance:this.OBSTACLE_MARGIN},obstacle:e.obstacleHit,obstacles:t,OBSTACLE_MARGIN:this.OBSTACLE_MARGIN,SHOULD_DETECT_CONJOINED_OBSTACLES:!0});let c=DMt(e,n,s),l=(s.dx===0||Math.sign(n.x-e.x)===s.dx)&&(s.dy===0||Math.sign(n.y-e.y)===s.dy);if(c<s.wallDistance&&c>0&&l)i.push({...s,travelDistance:c});else if(a!==null&&a<s.wallDistance)i.push({...s,travelDistance:a});else if(s.wallDistance!==1/0)i.push({...s,travelDistance:s.wallDistance-this.OBSTACLE_MARGIN})}return i.filter((s)=>!t.isObstacleAt(e.x+s.dx*s.travelDistance,e.y+s.dy*s.travelDistance)).map((s)=>({x:e.x+s.dx*s.travelDistance,y:e.y+s.dy*s.travelDistance,obstacleHit:s.obstacle}))}};function Ozo(e,t=4){let{center:n,width:o,height:r,rotation:i}=e,s=[],a=i*Math.PI/180,c=Math.cos(a),l=Math.sin(a),h=(i%360+360)%360;if(r<=o?h>=45&&h<135||h>=225&&h<315:h>=135&&h<225||h>=315||h<45){let u=o/t;for(let _=0;_<t;_++){let p=(_-t/2+0.5)*u,m=-p*c,A=-p*l,g=u*1.1,f=Math.abs(r*c)+Math.abs(u*l);s.push({center:{x:n.x+m,y:n.y+A},width:g,height:f})}}else{let u=r/t;for(let _=0;_<t;_++){let p=(_-t/2+0.5)*u,m=-p*l,A=p*c,g=Math.abs(o*c)+Math.abs(u*l),f=u*1.1;s.push({center:{x:n.x+m,y:n.y+A},width:g,height:f})}}return s}var L1e=["top","inner1","inner2","bottom"],zMt=(e,t)=>{let n=(r)=>t?r.concat(r.map((i)=>t?.getNetConnectedToId(i)).filter(Boolean)):r,o=[];for(let r of e)if(r.type==="pcb_smtpad"){if(r.shape==="circle")o.push({type:"oval",layers:[r.layer],center:{x:r.x,y:r.y},width:r.radius*2,height:r.radius*2,connectedTo:n([r.pcb_smtpad_id])});else if(r.shape==="rect")o.push({type:"rect",layers:[r.layer],center:{x:r.x,y:r.y},width:r.width,height:r.height,connectedTo:n([r.pcb_smtpad_id])});else if(r.shape==="rotated_rect"){let i={center:{x:r.x,y:r.y},width:r.width,height:r.height,rotation:r.ccw_rotation},s=Ozo(i);for(let a of s)o.push({type:"rect",layers:[r.layer],center:a.center,width:a.width,height:a.height,connectedTo:n([r.pcb_smtpad_id])})}}else if(r.type==="pcb_keepout"){if(r.shape==="circle")o.push({type:"oval",layers:r.layers,center:{x:r.center.x,y:r.center.y},width:r.radius*2,height:r.radius*2,connectedTo:[]});else if(r.shape==="rect")o.push({type:"rect",layers:r.layers,center:{x:r.center.x,y:r.center.y},width:r.width,height:r.height,connectedTo:[]})}else if(r.type==="pcb_hole"){if(r.hole_shape==="oval")o.push({type:"oval",center:{x:r.x,y:r.y},width:r.hole_width,height:r.hole_height,connectedTo:[]});else if(r.hole_shape==="square")o.push({type:"rect",layers:L1e,center:{x:r.x,y:r.y},width:r.hole_diameter,height:r.hole_diameter,connectedTo:[]});else if(r.hole_shape==="round"||r.hole_shape==="circle")o.push({type:"rect",layers:L1e,center:{x:r.x,y:r.y},width:r.hole_diameter,height:r.hole_diameter,connectedTo:[]})}else if(r.type==="pcb_plated_hole"){if(r.shape==="circle")o.push({type:"oval",layers:L1e,center:{x:r.x,y:r.y},width:r.outer_diameter,height:r.outer_diameter,connectedTo:n([r.pcb_plated_hole_id])});else if(r.shape==="oval"||r.shape==="pill")o.push({type:"oval",layers:L1e,center:{x:r.x,y:r.y},width:r.outer_width,height:r.outer_height,connectedTo:n([r.pcb_plated_hole_id])})}else if(r.type==="pcb_trace"){let i=QMt(r.route.map((s)=>({x:s.x,y:s.y,layer:"layer"in s?s.layer:s.from_layer})),r.source_trace_id);o.push(...i)}else if(r.type==="pcb_via")o.push({type:"rect",layers:r.layers,center:{x:r.x,y:r.y},connectedTo:[],width:r.outer_diameter,height:r.outer_diameter});return o};function BMt(e){let{pcbConnMap:t,goalElementId:n}=e;if(!n.startsWith("pcb_port_"))throw Error(`Currently alternative goal boxes must have a goal id with prefix "pcb_port_" (got ${n})`);let o=t.getAllTracesConnectedToPort(n);return zMt(o).map((r)=>({...r,connectedTo:[n]}))}var OMt=(e)=>{let{connection:t,pcbConnMap:n}=e;if(t.pointsToConnect.length!==2)throw Error(`Connection must have exactly 2 points for alternative goal boxes (got ${t.pointsToConnect.length})`);let[o,r]=t.pointsToConnect;if(!o.pcb_port_id||!r.pcb_port_id)throw Error(`Connection points must have pcb_port_id for alternative goal box calculation (got ${o.pcb_port_id} and ${r.pcb_port_id})`);let i=BMt({goalElementId:o.pcb_port_id,pcbConnMap:n}).concat([{center:o,width:0.01,height:0.01,connectedTo:[o.pcb_port_id],layers:[o.layer],type:"rect"}]),s=BMt({goalElementId:r.pcb_port_id,pcbConnMap:n}).concat([{center:r,width:0.01,height:0.01,connectedTo:[r.pcb_port_id],layers:[r.layer],type:"rect"}]);if(i.length<=1&&s.length<=1)return{...t,startPoint:o,endPoint:r,goalBoxes:[]};let a=h2e(i,s),c,l,h;if(i.length>=s.length)c={...r,...a.pointB},l={...o,...a.pointA},h=i;else c={...o,...a.pointA},l={...r,...a.pointB},h=s;return{startPoint:c,endPoint:l,goalBoxes:h,name:t.name,pointsToConnect:[c,l]}},Yzo=(e,t={})=>{let n={minTraceWidth:0.1};n.layerCount=t.layerCount??1,n.obstacles=zMt(e,t.connMap),n.connections=[];for(let r of e)if(r.type==="source_trace"){if(e.some((a)=>a.type==="pcb_trace"&&a.source_trace_id===r.source_trace_id))continue;let s={name:r.source_trace_id,pointsToConnect:r.connected_source_port_ids.map((a)=>{let c=WA(e).pcb_port.getWhere({source_port_id:a});if(!c)throw Error(`Could not find pcb_port for source_port_id "${a}"`);return{x:c.x,y:c.y,layer:c.layers?.[0]??"top",pcb_port_id:c.pcb_port_id}})};if(t.optimizeWithGoalBoxes){let a=new Fj(e);s=OMt({connection:s,pcbConnMap:a})}n.connections.push(s),Gzo(n.obstacles,s.pointsToConnect,s.name)}let o={minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0};for(let r of n.obstacles)o.minX=Math.min(o.minX,r.center.x-r.width/2),o.maxX=Math.max(o.maxX,r.center.x+r.width/2),o.minY=Math.min(o.minY,r.center.y-r.height/2),o.maxY=Math.max(o.maxY,r.center.y+r.height/2);for(let r of n.connections)for(let i of r.pointsToConnect)o.minX=Math.min(o.minX,i.x),o.maxX=Math.max(o.maxX,i.x),o.minY=Math.min(o.minY,i.y),o.maxY=Math.max(o.maxY,i.y);return n.bounds=o,n},Gzo=(e,t,n)=>{for(let o of t)for(let r of e)if(Uzo(o,r))r.connectedTo.push(n)};function Uzo(e,t){let n=t.width/2,o=t.height/2;if(t.type==="rect")return e.x>=t.center.x-n&&e.x<=t.center.x+n&&e.y>=t.center.y-o&&e.y<=t.center.y+o;else if(t.type==="oval"){let r=(e.x-t.center.x)/n,i=(e.y-t.center.y)/o;return r*r+i*i<=1}return!1}function TMt(e,t){let n=t.x>e.x?1:t.x<e.x?-1:0,o=t.y>e.y?1:t.y<e.y?-1:0,r=t.l>e.l?1:t.l<e.l?-1:0;return{dx:n,dy:o,dl:r}}var Hze={1:["top"],2:["top","bottom"],4:["top","inner1","inner2","bottom"]},Wzo=(e)=>Hze[e];function VMt(e,t){let o=Hze[e].indexOf(t);if(o===-1)throw Error(`Invalid layer for getLayerIndex (for layerCount === ${e}): "${t}"`);return o}function Xzo(e,t){let o=Hze[e][t];if(!o)throw Error(`Invalid index for indexToLayer (for layerCount === ${e}): "${t}"`);return o}var jzo=class extends kMt{obstacles;GRID_STEP=0.1;layerCount;constructor(e,t){super([]);this.layerCount=e;let n=Wzo(e);this.obstacles=t.flatMap((o)=>o.layers.filter((r)=>n.includes(r)).map((r)=>({...o,left:o.center.x-o.width/2,right:o.center.x+o.width/2,top:o.center.y+o.height/2,bottom:o.center.y-o.height/2,l:VMt(e,r)})))}getObstacleAt(e,t,n,o){o??=this.GRID_STEP;for(let r of this.obstacles){if(r.l!==n)continue;let i=r.width/2+o,s=r.height/2+o;if(e>=r.center.x-i&&e<=r.center.x+i&&t>=r.center.y-s&&t<=r.center.y+s)return r}return null}isObstacleAt(e,t,n,o){return this.getObstacleAt(e,t,n,o)!==null}getDirectionDistancesToNearestObstacle3d(e,t,n){let{GRID_STEP:o}=this,r={left:1/0,top:1/0,bottom:1/0,right:1/0};for(let i of this.obstacles){if(i.l!==n)continue;if(i.type==="rect"){let s=i.center.x-i.width/2-o,a=i.center.x+i.width/2+o,c=i.center.y+i.height/2+o,l=i.center.y-i.height/2-o;if(t>=l&&t<=c&&e>s)r.left=Math.min(r.left,e-a);if(t>=l&&t<=c&&e<a)r.right=Math.min(r.right,s-e);if(e>=s&&e<=a&&t<c)r.top=Math.min(r.top,l-t);if(e>=s&&e<=a&&t>l)r.bottom=Math.min(r.bottom,t-c)}}return r}getOrthoDirectionCollisionInfo(e,t,{margin:n=0}={}){let{x:o,y:r,l:i}=e,{dx:s,dy:a,dl:c}=t,l=1/0,h=null;if(c!==0){let d=i+c;if(this.isObstacleAt(o,r,d,n))l=1,h=this.getObstacleAt(o,r,d,n);else l=1;return{dx:s,dy:a,dl:c,wallDistance:l,obstacle:h}}else{for(let d of this.obstacles){if(d.l!==i)continue;let u=d.left-n,_=d.right+n,p=d.top+n,m=d.bottom-n,A=null;if(s===1&&a===0){if(r>m&&r<p&&o<d.left)A=d.left-o}else if(s===-1&&a===0){if(r>m&&r<p&&o>d.right)A=o-d.right}else if(s===0&&a===1){if(o>u&&o<_&&r<d.bottom)A=d.bottom-r}else if(s===0&&a===-1){if(o>u&&o<_&&r>d.top)A=r-d.top}if(A!==null&&A<l)l=A,h=d}return{dx:s,dy:a,dl:0,wallDistance:l,obstacle:h}}}getObstaclesOverlappingRegion(e){let t=[];for(let n of this.obstacles){if(n.l!==e.l)continue;let{left:o,right:r,top:i,bottom:s}=n;if(o<=e.maxX&&r>=e.minX&&i>=e.minY&&s<=e.maxY)t.push(n)}return t}},H1e=class extends HMt{MAX_ITERATIONS=500;VIA_COST=4;VIA_DIAMETER=0.5;allowLayerChange=!0;layerCount;obstacles;optimizeWithGoalBoxes;connMap;pcbConnMap;GOAL_RUSH_FACTOR=1.1;defaultGoalViaMargin=0.5;marginsWithCosts;get largestMargin(){return this.marginsWithCosts[0].margin}constructor(e){super(e);this.layerCount=e.input.layerCount??2,this.MAX_ITERATIONS=e.MAX_ITERATIONS??this.MAX_ITERATIONS,this.VIA_COST=e.VIA_COST??this.VIA_COST,this.connMap=e.connMap,this.pcbConnMap=e.pcbConnMap??new Fj,this.optimizeWithGoalBoxes=e.optimizeWithGoalBoxes??!1,this.obstacles=null,this.marginsWithCosts=e.marginsWithCosts??[{margin:1,enterCost:0,travelCostFactor:1},{margin:this.OBSTACLE_MARGIN,enterCost:10,travelCostFactor:2}]}preprocessConnectionBeforeSolving(e){if(!this.optimizeWithGoalBoxes)return e;return OMt({connection:e,pcbConnMap:this.pcbConnMap})}postprocessConnectionSolveResult(e,t){if(!t.solved)return t;if(this.optimizeWithGoalBoxes){let n=t.route.map((o)=>({x:o.x,y:o.y,route_type:"wire",layer:o.layer,width:this.input.minTraceWidth}));n[0].start_pcb_port_id=e.pointsToConnect[0].pcb_port_id,n[n.length-1].end_pcb_port_id=e.pointsToConnect[1].pcb_port_id,this.pcbConnMap.addTrace({type:"pcb_trace",pcb_trace_id:`postprocess_trace_${PMt(8)}`,route:n})}return t}createObstacleList({dominantLayer:e,connection:t,obstaclesFromTraces:n}){let o=this.connMap?this.connMap.getNetConnectedToId(t.name):t.name;if(!o)throw Error(`The connection.name "${t.name}" wasn't present in the full connectivity map`);return new jzo(this.layerCount,this.allObstacles.filter((r)=>!r.connectedTo.includes(o)).concat(n??[]))}computeG(e,t){let n=e.g+BO(e,t)*(e.travelMarginCostFactor??1)+(t.enterMarginCost??0);if(t.l??e.l!==-1??-1)n+=this.VIA_COST;return n}computeH(e){let t=Math.abs(e.x-this.goalPoint.x),n=Math.abs(e.y-this.goalPoint.y),o=Math.abs(e.l-this.goalPoint.l);return(t+n)**this.GOAL_RUSH_FACTOR+o*this.VIA_COST}getStartNode(e){return{...super.getStartNode(e),l:this.layerToIndex(e.pointsToConnect[0].layer)}}layerToIndex(e){return VMt(this.layerCount,e)}indexToLayer(e){return Xzo(this.layerCount,e)}getNodeName(e){return`${NMt(e,this.GRID_STEP)}-${e.l??0}`}hasSpaceForVia(e,t){return e.every((n)=>this.obstacles.getObstaclesOverlappingRegion({minX:t.x-this.VIA_DIAMETER/2-this.OBSTACLE_MARGIN,minY:t.y-this.VIA_DIAMETER/2-this.OBSTACLE_MARGIN,maxX:t.x+this.VIA_DIAMETER/2+this.OBSTACLE_MARGIN,maxY:t.y+this.VIA_DIAMETER/2+this.OBSTACLE_MARGIN,l:n}).length===0)}getNeighborsSurroundingGoal(e){let t=this.obstacles,n=this.goalPoint,o=[],r=[{dx:1,dy:0,dl:0},{dx:-1,dy:0,dl:0},{dx:0,dy:1,dl:0},{dx:0,dy:-1,dl:0}],i=this.VIA_DIAMETER+this.OBSTACLE_MARGIN+this.defaultGoalViaMargin;for(let s of r){let a={x:e.x+s.dx*i,y:e.y+s.dy*i,l:e.l+s.dl,obstacleHit:null};if(!this.hasSpaceForVia([e.l,n.l],a))continue;o.push(a)}return o}getNeighbors(e){let t=this.obstacles,n=this.goalPoint,o=BO(e,n);if(o<=this.OBSTACLE_MARGIN)return this.getNeighborsSurroundingGoal(e);let r;if(!e.parent)r=TMt(e,n);else r=TMt(e.parent,e);let i=[{dx:0,dy:1,dl:0},{dx:1,dy:0,dl:0},{dx:0,dy:-1,dl:0},{dx:-1,dy:0,dl:0}],s=o>this.VIA_DIAMETER+this.OBSTACLE_MARGIN,a=BO(e,this.startNode)>this.VIA_DIAMETER+this.OBSTACLE_MARGIN;if(this.allowLayerChange&&s&&a){if(e.l<this.layerCount-1)i.push({dx:0,dy:0,dl:1});if(e.l>0)i.push({dx:0,dy:0,dl:-1})}let c=i.filter((h)=>{if(h.dx===r.dx*-1&&h.dy===r.dy*-1&&h.dl===r.dl*-1)return!1;else if(h.dx===r.dx&&h.dy===r.dy&&h.dl===r.dl&&e.parent?.obstacleHit)return!1;return!0}).map((h)=>t.getOrthoDirectionCollisionInfo(e,h,{margin:this.OBSTACLE_MARGIN})).filter((h)=>!(h.wallDistance<this.OBSTACLE_MARGIN)),l=[];for(let h of c){let d=h.dx===0&&h.dy===0&&h.dl===1,u=h.dx===0&&h.dy===0&&h.dl===-1;if(d||u){if(![e.l,e.l+h.dl].every((g)=>t.getObstaclesOverlappingRegion({minX:e.x-this.VIA_DIAMETER/2-this.OBSTACLE_MARGIN,minY:e.y-this.VIA_DIAMETER/2-this.OBSTACLE_MARGIN,maxX:e.x+this.VIA_DIAMETER/2+this.OBSTACLE_MARGIN,maxY:e.y+this.VIA_DIAMETER/2+this.OBSTACLE_MARGIN,l:g}).length===0))continue}if(d){if(e.l<this.layerCount-1)l.push({...h,travelDistance:0,enterMarginCost:0,travelMarginCostFactor:1});continue}if(u){if(e.l>0)l.push({...h,travelDistance:0,enterMarginCost:0,travelMarginCostFactor:1});continue}let _=null;if(e?.obstacleHit)_=Lze({node:e,travelDir:h,wallDir:{...r,wallDistance:this.OBSTACLE_MARGIN},obstacle:e.obstacleHit,obstacles:t,OBSTACLE_MARGIN:this.OBSTACLE_MARGIN,SHOULD_DETECT_CONJOINED_OBSTACLES:!0});let p=DMt(e,n,h),m=(h.dx===0||Math.sign(n.x-e.x)===h.dx)&&(h.dy===0||Math.sign(n.y-e.y)===h.dy);if(p<h.wallDistance&&p>0&&m){let A=e.l===n.l,g=0;if(!A&&Math.abs(p-o)<this.GRID_STEP)g=this.VIA_DIAMETER+this.OBSTACLE_MARGIN+this.defaultGoalViaMargin;l.push({...h,travelDistance:p-g,enterMarginCost:0,travelMarginCostFactor:1})}else if(_!==null&&_<h.wallDistance){for(let{margin:A,enterCost:g,travelCostFactor:f}of this.marginsWithCosts)if(_-this.OBSTACLE_MARGIN+A*2<h.wallDistance)l.push({...h,travelDistance:_-this.OBSTACLE_MARGIN+A,enterMarginCost:g,travelMarginCostFactor:f});if(h.wallDistance===1/0)l.push({...h,travelDistance:p,enterMarginCost:0,travelMarginCostFactor:1});else if(h.wallDistance>this.largestMargin){for(let{margin:A,enterCost:g,travelCostFactor:f}of this.marginsWithCosts)if(h.wallDistance>this.largestMargin+A)l.push({...h,travelDistance:h.wallDistance-A,enterMarginCost:g,travelMarginCostFactor:f})}}else if(h.wallDistance!==1/0){for(let{margin:A,enterCost:g,travelCostFactor:f}of this.marginsWithCosts)if(h.wallDistance>A)l.push({...h,travelDistance:h.wallDistance-A,enterMarginCost:g,travelMarginCostFactor:f})}}return l.map((h)=>({x:e.x+h.dx*h.travelDistance,y:e.y+h.dy*h.travelDistance,l:e.l+h.dl,obstacleHit:h.obstacle,travelMarginCostFactor:h.travelMarginCostFactor,enterMarginCost:h.enterMarginCost}))}};function YMt(e){let t=Yzo(e),n=new zzo({input:t});return{solution:n.solveAndMapToTraces(),debugSolutions:n.debugSolutions,debugMessage:n.debugMessage}}qt();yc();var zm;(function(e){e.Root="root",e.Text="text",e.Directive="directive",e.Comment="comment",e.Script="script",e.Style="style",e.Tag="tag",e.CDATA="cdata",e.Doctype="doctype"})(zm||(zm={}));function GMt(e){return e.type===zm.Tag||e.type===zm.Script||e.type===zm.Style}var UMt=zm.Root,WMt=zm.Text,XMt=zm.Directive,jMt=zm.Comment,KMt=zm.Script,$Mt=zm.Style,qMt=zm.Tag,JMt=zm.CDATA,ZMt=zm.Doctype;function a2(e){return GMt(e)}function Fse(e){return e.type===zm.CDATA}function Hw(e){return e.type===zm.Text}function F1e(e){return e.type===zm.Comment}function ewt(e){return e.type===zm.Root}function p1(e){return Object.prototype.hasOwnProperty.call(e,"children")}var twt=/["&'<>$\x80-\uFFFF]/g,nwt=new Map([[34,"&quot;"],[38,"&amp;"],[39,"&apos;"],[60,"&lt;"],[62,"&gt;"]]),$zo=String.prototype.codePointAt!=null?(e,t)=>e.codePointAt(t):(e,t)=>(e.charCodeAt(t)&64512)===55296?(e.charCodeAt(t)-55296)*1024+e.charCodeAt(t+1)-56320+65536:e.charCodeAt(t);function z1e(e){let t="",n=0,o;while((o=twt.exec(e))!==null){let r=o.index,i=e.charCodeAt(r),s=nwt.get(i);if(s!==void 0)t+=e.substring(n,r)+s,n=r+1;else t+=`${e.substring(n,r)}&#x${$zo(e,r).toString(16)};`,n=twt.lastIndex+=Number((i&64512)===55296)}return t+e.substr(n)}function Fze(e,t){return function(o){let r,i=0,s="";while(r=e.exec(o)){if(i!==r.index)s+=o.substring(i,r.index);s+=t.get(r[0].charCodeAt(0)),i=r.index+1}return s+o.substring(i)}}var qzo=Fze(/[&<>'"]/g,nwt),zze=Fze(/["&\u00A0]/g,new Map([[34,"&quot;"],[38,"&amp;"],[160,"&nbsp;"]])),Oze=Fze(/[&<>\u00A0]/g,new Map([[38,"&amp;"],[60,"&lt;"],[62,"&gt;"],[160,"&nbsp;"]]));var owt;(function(e){e[e.XML=0]="XML",e[e.HTML=1]="HTML"})(owt||(owt={}));var rwt;(function(e){e[e.UTF8=0]="UTF8",e[e.ASCII=1]="ASCII",e[e.Extensive=2]="Extensive",e[e.Attribute=3]="Attribute",e[e.Text=4]="Text"})(rwt||(rwt={}));var iwt=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map((e)=>[e.toLowerCase(),e])),swt=new Map(["definitionURL","attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map((e)=>[e.toLowerCase(),e]));var Jzo=new Set(["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"]);function Zzo(e){return e.replace(/"/g,"&quot;")}function eOo(e,t){var n;if(!e)return;let o=((n=t.encodeEntities)!==null&&n!==void 0?n:t.decodeEntities)===!1?Zzo:t.xmlMode||t.encodeEntities!=="utf8"?z1e:zze;return Object.keys(e).map((r)=>{var i,s;let a=(i=e[r])!==null&&i!==void 0?i:"";if(t.xmlMode==="foreign")r=(s=swt.get(r))!==null&&s!==void 0?s:r;if(!t.emptyAttrs&&!t.xmlMode&&a==="")return r;return`${r}="${o(a)}"`}).join(" ")}var awt=new Set(["area","base","basefont","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr"]);function Vze(e,t={}){let n="length"in e?e:[e],o="";for(let r=0;r<n.length;r++)o+=tOo(n[r],t);return o}var cwt=Vze;function tOo(e,t){switch(e.type){case UMt:return Vze(e.children,t);case ZMt:case XMt:return iOo(e);case jMt:return cOo(e);case JMt:return aOo(e);case KMt:case $Mt:case qMt:return rOo(e,t);case WMt:return sOo(e,t)}}var nOo=new Set(["mi","mo","mn","ms","mtext","annotation-xml","foreignObject","desc","title"]),oOo=new Set(["svg","math"]);function rOo(e,t){var n;if(t.xmlMode==="foreign"){if(e.name=(n=iwt.get(e.name))!==null&&n!==void 0?n:e.name,e.parent&&nOo.has(e.parent.name))t={...t,xmlMode:!1}}if(!t.xmlMode&&oOo.has(e.name))t={...t,xmlMode:"foreign"};let o=`<${e.name}`,r=eOo(e.attribs,t);if(r)o+=` ${r}`;if(e.children.length===0&&(t.xmlMode?t.selfClosingTags!==!1:t.selfClosingTags&&awt.has(e.name))){if(!t.xmlMode)o+=" ";o+="/>"}else{if(o+=">",e.children.length>0)o+=Vze(e.children,t);if(t.xmlMode||!awt.has(e.name))o+=`</${e.name}>`}return o}function iOo(e){return`<${e.data}>`}function sOo(e,t){var n;let o=e.data||"";if(((n=t.encodeEntities)!==null&&n!==void 0?n:t.decodeEntities)!==!1&&!(!t.xmlMode&&e.parent&&Jzo.has(e.parent.name)))o=t.xmlMode||t.encodeEntities!=="utf8"?z1e(o):Oze(o);return o}function aOo(e){return`<![CDATA[${e.children[0].data}]]>`}function cOo(e){return`<!--${e.data}-->`}function lwt(e,t){return cwt(e,t)}function lOo(e,t){return p1(e)?e.children.map((n)=>lwt(n,t)).join(""):""}function O1e(e){if(Array.isArray(e))return e.map(O1e).join("");if(a2(e))return e.name==="br"?`
`:O1e(e.children);if(Fse(e))return O1e(e.children);if(Hw(e))return e.data;return""}function zse(e){if(Array.isArray(e))return e.map(zse).join("");if(p1(e)&&!F1e(e))return zse(e.children);if(Hw(e))return e.data;return""}function Yze(e){if(Array.isArray(e))return e.map(Yze).join("");if(p1(e)&&(e.type===zm.Tag||Fse(e)))return Yze(e.children);if(Hw(e))return e.data;return""}function hwt(e){return p1(e)?e.children:[]}function dwt(e){return e.parent||null}function hOo(e){let t=dwt(e);if(t!=null)return hwt(t);let n=[e],{prev:o,next:r}=e;while(o!=null)n.unshift(o),{prev:o}=o;while(r!=null)n.push(r),{next:r}=r;return n}function dOo(e,t){var n;return(n=e.attribs)===null||n===void 0?void 0:n[t]}function uOo(e,t){return e.attribs!=null&&Object.prototype.hasOwnProperty.call(e.attribs,t)&&e.attribs[t]!=null}function pOo(e){return e.name}function mOo(e){let{next:t}=e;while(t!==null&&!a2(t))({next:t}=t);return t}function _Oo(e){let{prev:t}=e;while(t!==null&&!a2(t))({prev:t}=t);return t}function Ose(e){if(e.prev)e.prev.next=e.next;if(e.next)e.next.prev=e.prev;if(e.parent){let t=e.parent.children,n=t.lastIndexOf(e);if(n>=0)t.splice(n,1)}e.next=null,e.prev=null,e.parent=null}function gOo(e,t){let n=t.prev=e.prev;if(n)n.next=t;let o=t.next=e.next;if(o)o.prev=t;let r=t.parent=e.parent;if(r){let i=r.children;i[i.lastIndexOf(e)]=t,e.parent=null}}function AOo(e,t){if(Ose(t),t.next=null,t.parent=e,e.children.push(t)>1){let n=e.children[e.children.length-2];n.next=t,t.prev=n}else t.prev=null}function fOo(e,t){Ose(t);let{parent:n}=e,o=e.next;if(t.next=o,t.prev=e,e.next=t,t.parent=n,o){if(o.prev=t,n){let r=n.children;r.splice(r.lastIndexOf(o),0,t)}}else if(n)n.children.push(t)}function yOo(e,t){if(Ose(t),t.parent=e,t.prev=null,e.children.unshift(t)!==1){let n=e.children[1];n.prev=t,t.next=n}else t.next=null}function xOo(e,t){Ose(t);let{parent:n}=e;if(n){let o=n.children;o.splice(o.indexOf(e),0,t)}if(e.prev)e.prev.next=t;t.parent=n,t.prev=e.prev,t.next=e,e.prev=t}function mK(e,t,n=!0,o=1/0){return uwt(e,Array.isArray(t)?t:[t],n,o)}function uwt(e,t,n,o){let r=[],i=[Array.isArray(t)?t:[t]],s=[0];for(;;){if(s[0]>=i[0].length){if(s.length===1)return r;i.shift(),s.shift();continue}let a=i[0][s[0]++];if(e(a)){if(r.push(a),--o<=0)return r}if(n&&p1(a)&&a.children.length>0)s.unshift(0),i.unshift(a.children)}}function COo(e,t){return t.find(e)}function V1e(e,t,n=!0){let o=Array.isArray(t)?t:[t];for(let r=0;r<o.length;r++){let i=o[r];if(a2(i)&&e(i))return i;if(n&&p1(i)&&i.children.length>0){let s=V1e(e,i.children,!0);if(s)return s}}return null}function pwt(e,t){return(Array.isArray(t)?t:[t]).some((n)=>a2(n)&&e(n)||p1(n)&&pwt(e,n.children))}function bOo(e,t){let n=[],o=[Array.isArray(t)?t:[t]],r=[0];for(;;){if(r[0]>=o[0].length){if(o.length===1)return n;o.shift(),r.shift();continue}let i=o[0][r[0]++];if(a2(i)&&e(i))n.push(i);if(p1(i)&&i.children.length>0)r.unshift(0),o.unshift(i.children)}}var Y1e={tag_name(e){if(typeof e==="function")return(t)=>a2(t)&&e(t.name);else if(e==="*")return a2;return(t)=>a2(t)&&t.name===e},tag_type(e){if(typeof e==="function")return(t)=>e(t.type);return(t)=>t.type===e},tag_contains(e){if(typeof e==="function")return(t)=>Hw(t)&&e(t.data);return(t)=>Hw(t)&&t.data===e}};function Gze(e,t){if(typeof t==="function")return(n)=>a2(n)&&t(n.attribs[e]);return(n)=>a2(n)&&n.attribs[e]===t}function IOo(e,t){return(n)=>e(n)||t(n)}function mwt(e){let t=Object.keys(e).map((n)=>{let o=e[n];return Object.prototype.hasOwnProperty.call(Y1e,n)?Y1e[n](o):Gze(n,o)});return t.length===0?null:t.reduce(IOo)}function vOo(e,t){let n=mwt(e);return n?n(t):!0}function SOo(e,t,n,o=1/0){let r=mwt(e);return r?mK(r,t,n,o):[]}function POo(e,t,n=!0){if(!Array.isArray(t))t=[t];return V1e(Gze("id",e),t,n)}function TO(e,t,n=!0,o=1/0){return mK(Y1e.tag_name(e),t,n,o)}function EOo(e,t,n=!0,o=1/0){return mK(Gze("class",e),t,n,o)}function MOo(e,t,n=!0,o=1/0){return mK(Y1e.tag_type(e),t,n,o)}function wOo(e){let t=e.length;while(--t>=0){let n=e[t];if(t>0&&e.lastIndexOf(n,t-1)>=0){e.splice(t,1);continue}for(let o=n.parent;o;o=o.parent)if(e.includes(o)){e.splice(t,1);break}}return e}var kb;(function(e){e[e.DISCONNECTED=1]="DISCONNECTED",e[e.PRECEDING=2]="PRECEDING",e[e.FOLLOWING=4]="FOLLOWING",e[e.CONTAINS=8]="CONTAINS",e[e.CONTAINED_BY=16]="CONTAINED_BY"})(kb||(kb={}));function _wt(e,t){let n=[],o=[];if(e===t)return 0;let r=p1(e)?e:e.parent;while(r)n.unshift(r),r=r.parent;r=p1(t)?t:t.parent;while(r)o.unshift(r),r=r.parent;let i=Math.min(n.length,o.length),s=0;while(s<i&&n[s]===o[s])s++;if(s===0)return kb.DISCONNECTED;let a=n[s-1],c=a.children,l=n[s],h=o[s];if(c.indexOf(l)>c.indexOf(h)){if(a===t)return kb.FOLLOWING|kb.CONTAINED_BY;return kb.FOLLOWING}if(a===e)return kb.PRECEDING|kb.CONTAINS;return kb.PRECEDING}function BOo(e){return e=e.filter((t,n,o)=>!o.includes(t,n+1)),e.sort((t,n)=>{let o=_wt(t,n);if(o&kb.PRECEDING)return-1;else if(o&kb.FOLLOWING)return 1;return 0}),e}function TOo(e){let t=G1e(kOo,e);return!t?null:t.name==="feed"?DOo(t):NOo(t)}function DOo(e){var t;let n=e.children,o={type:"atom",items:TO("entry",n).map((s)=>{var a;let{children:c}=s,l={media:gwt(c)};m5(l,"id","id",c),m5(l,"title","title",c);let h=(a=G1e("link",c))===null||a===void 0?void 0:a.attribs.href;if(h)l.link=h;let d=JR("summary",c)||JR("content",c);if(d)l.description=d;let u=JR("updated",c);if(u)l.pubDate=new Date(u);return l})};m5(o,"id","id",n),m5(o,"title","title",n);let r=(t=G1e("link",n))===null||t===void 0?void 0:t.attribs.href;if(r)o.link=r;m5(o,"description","subtitle",n);let i=JR("updated",n);if(i)o.updated=new Date(i);return m5(o,"author","email",n,!0),o}function NOo(e){var t,n;let o=(n=(t=G1e("channel",e.children))===null||t===void 0?void 0:t.children)!==null&&n!==void 0?n:[],r={type:e.name.substr(0,3),id:"",items:TO("item",e.children).map((s)=>{let{children:a}=s,c={media:gwt(a)};m5(c,"id","guid",a),m5(c,"title","title",a),m5(c,"link","link",a),m5(c,"description","description",a);let l=JR("pubDate",a)||JR("dc:date",a);if(l)c.pubDate=new Date(l);return c})};m5(r,"title","title",o),m5(r,"link","link",o),m5(r,"description","description",o);let i=JR("lastBuildDate",o);if(i)r.updated=new Date(i);return m5(r,"author","managingEditor",o,!0),r}var ROo=["url","type","lang"],QOo=["fileSize","bitrate","framerate","samplingrate","channels","duration","height","width"];function gwt(e){return TO("media:content",e).map((t)=>{let{attribs:n}=t,o={medium:n.medium,isDefault:!!n.isDefault};for(let r of ROo)if(n[r])o[r]=n[r];for(let r of QOo)if(n[r])o[r]=parseInt(n[r],10);if(n.expression)o.expression=n.expression;return o})}function G1e(e,t){return TO(e,t,!0,1)[0]}function JR(e,t,n=!1){return zse(TO(e,t,n,1)).trim()}function m5(e,t,n,o,r=!1){let i=JR(n,o,r);if(i)e[t]=i}function kOo(e){return e==="rss"||e==="feed"||e==="rdf:RDF"}var oOe=at(DO(),1);var as;(function(e){e.Attribute="attribute",e.Pseudo="pseudo",e.PseudoElement="pseudo-element",e.Tag="tag",e.Universal="universal",e.Adjacent="adjacent",e.Child="child",e.Descendant="descendant",e.Parent="parent",e.Sibling="sibling",e.ColumnCombinator="column-combinator"})(as||(as={}));var Om;(function(e){e.Any="any",e.Element="element",e.End="end",e.Equals="equals",e.Exists="exists",e.Hyphen="hyphen",e.Not="not",e.Start="start"})(Om||(Om={}));var fwt=/^[^\\#]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/,LOo=/\\([\da-f]{1,6}\s?|(\s)|.)/gi,HOo=new Map([[126,Om.Element],[94,Om.Start],[36,Om.End],[42,Om.Any],[33,Om.Not],[124,Om.Hyphen]]),FOo=new Set(["has","not","matches","is","where","host","host-context"]);function xwt(e){switch(e.type){case as.Adjacent:case as.Child:case as.Descendant:case as.Parent:case as.Sibling:case as.ColumnCombinator:return!0;default:return!1}}var zOo=new Set(["contains","icontains"]);function OOo(e,t,n){let o=parseInt(t,16)-65536;return o!==o||n?t:o<0?String.fromCharCode(o+65536):String.fromCharCode(o>>10|55296,o&1023|56320)}function Vse(e){return e.replace(LOo,OOo)}function Uze(e){return e===39||e===34}function ywt(e){return e===32||e===9||e===10||e===12||e===13}function Yse(e){let t=[],n=Cwt(t,`${e}`,0);if(n<e.length)throw Error(`Unmatched selector: ${e.slice(n)}`);return t}function Cwt(e,t,n){let o=[];function r(u){let _=t.slice(n+u).match(fwt);if(!_)throw Error(`Expected name, found ${t.slice(n)}`);let[p]=_;return n+=u+p.length,Vse(p)}function i(u){n+=u;while(n<t.length&&ywt(t.charCodeAt(n)))n++}function s(){n+=1;let u=n,_=1;for(;_>0&&n<t.length;n++)if(t.charCodeAt(n)===40&&!a(n))_++;else if(t.charCodeAt(n)===41&&!a(n))_--;if(_)throw Error("Parenthesis not matched");return Vse(t.slice(u,n-1))}function a(u){let _=0;while(t.charCodeAt(--u)===92)_++;return(_&1)===1}function c(){if(o.length>0&&xwt(o[o.length-1]))throw Error("Did not expect successive traversals.")}function l(u){if(o.length>0&&o[o.length-1].type===as.Descendant){o[o.length-1].type=u;return}c(),o.push({type:u})}function h(u,_){o.push({type:as.Attribute,name:u,action:_,value:r(1),namespace:null,ignoreCase:"quirks"})}function d(){if(o.length&&o[o.length-1].type===as.Descendant)o.pop();if(o.length===0)throw Error("Empty sub-selector");e.push(o)}if(i(0),t.length===n)return n;e:while(n<t.length){let u=t.charCodeAt(n);switch(u){case 32:case 9:case 10:case 12:case 13:{if(o.length===0||o[0].type!==as.Descendant)c(),o.push({type:as.Descendant});i(1);break}case 62:{l(as.Child),i(1);break}case 60:{l(as.Parent),i(1);break}case 126:{l(as.Sibling),i(1);break}case 43:{l(as.Adjacent),i(1);break}case 46:{h("class",Om.Element);break}case 35:{h("id",Om.Equals);break}case 91:{i(1);let _,p=null;if(t.charCodeAt(n)===124)_=r(1);else if(t.startsWith("*|",n))p="*",_=r(2);else if(_=r(0),t.charCodeAt(n)===124&&t.charCodeAt(n+1)!==61)p=_,_=r(1);i(0);let m=Om.Exists,A=HOo.get(t.charCodeAt(n));if(A){if(m=A,t.charCodeAt(n+1)!==61)throw Error("Expected `=`");i(2)}else if(t.charCodeAt(n)===61)m=Om.Equals,i(1);let g="",f=null;if(m!=="exists"){if(Uze(t.charCodeAt(n))){let C=t.charCodeAt(n),b=n+1;while(b<t.length&&(t.charCodeAt(b)!==C||a(b)))b+=1;if(t.charCodeAt(b)!==C)throw Error("Attribute value didn't end");g=Vse(t.slice(n+1,b)),n=b+1}else{let C=n;while(n<t.length&&(!ywt(t.charCodeAt(n))&&t.charCodeAt(n)!==93||a(n)))n+=1;g=Vse(t.slice(C,n))}i(0);let x=t.charCodeAt(n)|32;if(x===115)f=!1,i(1);else if(x===105)f=!0,i(1)}if(t.charCodeAt(n)!==93)throw Error("Attribute selector didn't terminate");n+=1;let y={type:as.Attribute,name:_,action:m,value:g,namespace:p,ignoreCase:f};o.push(y);break}case 58:{if(t.charCodeAt(n+1)===58){o.push({type:as.PseudoElement,name:r(2).toLowerCase(),data:t.charCodeAt(n)===40?s():null});continue}let _=r(1).toLowerCase(),p=null;if(t.charCodeAt(n)===40)if(FOo.has(_)){if(Uze(t.charCodeAt(n+1)))throw Error(`Pseudo-selector ${_} cannot be quoted`);if(p=[],n=Cwt(p,t,n+1),t.charCodeAt(n)!==41)throw Error(`Missing closing parenthesis in :${_} (${t})`);n+=1}else{if(p=s(),zOo.has(_)){let m=p.charCodeAt(0);if(m===p.charCodeAt(p.length-1)&&Uze(m))p=p.slice(1,-1)}p=Vse(p)}o.push({type:as.Pseudo,name:_,data:p});break}case 44:{d(),o=[],i(1);break}default:{if(t.startsWith("/*",n)){let m=t.indexOf("*/",n+2);if(m<0)throw Error("Comment was not terminated");if(n=m+2,o.length===0)i(0);break}let _=null,p;if(u===42)n+=1,p="*";else if(u===124){if(p="",t.charCodeAt(n+1)===124){l(as.ColumnCombinator),i(2);break}}else if(fwt.test(t.slice(n)))p=r(0);else break e;if(t.charCodeAt(n)===124&&t.charCodeAt(n+1)!==124)if(_=p,t.charCodeAt(n+1)===42)p="*",n+=2;else p=r(1);o.push(p==="*"?{type:as.Universal,namespace:_}:{type:as.Tag,name:p,namespace:_})}}}return d(),n}var Fw=at(DO(),1);var bwt=new Map([[as.Universal,50],[as.Tag,30],[as.Attribute,1],[as.Pseudo,0]]);function Gse(e){return!bwt.has(e.type)}var VOo=new Map([[Om.Exists,10],[Om.Equals,8],[Om.Not,7],[Om.Start,6],[Om.End,6],[Om.Any,5]]);function Wze(e){let t=e.map(Iwt);for(let n=1;n<e.length;n++){let o=t[n];if(o<0)continue;for(let r=n-1;r>=0&&o<t[r];r--){let i=e[r+1];e[r+1]=e[r],e[r]=i,t[r+1]=t[r],t[r]=o}}}function Iwt(e){var t,n;let o=(t=bwt.get(e.type))!==null&&t!==void 0?t:-1;if(e.type===as.Attribute){if(o=(n=VOo.get(e.action))!==null&&n!==void 0?n:4,e.action===Om.Equals&&e.name==="id")o=9;if(e.ignoreCase)o>>=1}else if(e.type===as.Pseudo)if(!e.data)o=3;else if(e.name==="has"||e.name==="contains")o=0;else if(Array.isArray(e.data)){if(o=Math.min(...e.data.map((r)=>Math.min(...r.map(Iwt)))),o<0)o=0}else o=2;return o}var Use=at(DO(),1),YOo=/[-[\]{}()*+?.,\\^$|#\s]/g;function vwt(e){return e.replace(YOo,"\\$&")}var GOo=new Set(["accept","accept-charset","align","alink","axis","bgcolor","charset","checked","clear","codetype","color","compact","declare","defer","dir","direction","disabled","enctype","face","frame","hreflang","http-equiv","lang","language","link","media","method","multiple","nohref","noresize","noshade","nowrap","readonly","rel","rev","rules","scope","scrolling","selected","shape","target","text","type","valign","valuetype","vlink"]);function NO(e,t){return typeof e.ignoreCase==="boolean"?e.ignoreCase:e.ignoreCase==="quirks"?!!t.quirksMode:!t.xmlMode&&GOo.has(e.name)}var Swt={equals(e,t,n){let{adapter:o}=n,{name:r}=t,{value:i}=t;if(NO(t,n))return i=i.toLowerCase(),(s)=>{let a=o.getAttributeValue(s,r);return a!=null&&a.length===i.length&&a.toLowerCase()===i&&e(s)};return(s)=>o.getAttributeValue(s,r)===i&&e(s)},hyphen(e,t,n){let{adapter:o}=n,{name:r}=t,{value:i}=t,s=i.length;if(NO(t,n))return i=i.toLowerCase(),function(c){let l=o.getAttributeValue(c,r);return l!=null&&(l.length===s||l.charAt(s)==="-")&&l.substr(0,s).toLowerCase()===i&&e(c)};return function(c){let l=o.getAttributeValue(c,r);return l!=null&&(l.length===s||l.charAt(s)==="-")&&l.substr(0,s)===i&&e(c)}},element(e,t,n){let{adapter:o}=n,{name:r,value:i}=t;if(/\s/.test(i))return Use.default.falseFunc;let s=new RegExp(`(?:^|\\s)${vwt(i)}(?:$|\\s)`,NO(t,n)?"i":"");return function(c){let l=o.getAttributeValue(c,r);return l!=null&&l.length>=i.length&&s.test(l)&&e(c)}},exists(e,{name:t},{adapter:n}){return(o)=>n.hasAttrib(o,t)&&e(o)},start(e,t,n){let{adapter:o}=n,{name:r}=t,{value:i}=t,s=i.length;if(s===0)return Use.default.falseFunc;if(NO(t,n))return i=i.toLowerCase(),(a)=>{let c=o.getAttributeValue(a,r);return c!=null&&c.length>=s&&c.substr(0,s).toLowerCase()===i&&e(a)};return(a)=>{var c;return!!((c=o.getAttributeValue(a,r))===null||c===void 0?void 0:c.startsWith(i))&&e(a)}},end(e,t,n){let{adapter:o}=n,{name:r}=t,{value:i}=t,s=-i.length;if(s===0)return Use.default.falseFunc;if(NO(t,n))return i=i.toLowerCase(),(a)=>{var c;return((c=o.getAttributeValue(a,r))===null||c===void 0?void 0:c.substr(s).toLowerCase())===i&&e(a)};return(a)=>{var c;return!!((c=o.getAttributeValue(a,r))===null||c===void 0?void 0:c.endsWith(i))&&e(a)}},any(e,t,n){let{adapter:o}=n,{name:r,value:i}=t;if(i==="")return Use.default.falseFunc;if(NO(t,n)){let s=new RegExp(vwt(i),"i");return function(c){let l=o.getAttributeValue(c,r);return l!=null&&l.length>=i.length&&s.test(l)&&e(c)}}return(s)=>{var a;return!!((a=o.getAttributeValue(s,r))===null||a===void 0?void 0:a.includes(i))&&e(s)}},not(e,t,n){let{adapter:o}=n,{name:r}=t,{value:i}=t;if(i==="")return(s)=>!!o.getAttributeValue(s,r)&&e(s);else if(NO(t,n))return i=i.toLowerCase(),(s)=>{let a=o.getAttributeValue(s,r);return(a==null||a.length!==i.length||a.toLowerCase()!==i)&&e(s)};return(s)=>o.getAttributeValue(s,r)!==i&&e(s)}};var UOo=new Set([9,10,12,13,32]);function Pwt(e){if(e=e.trim().toLowerCase(),e==="even")return[2,0];else if(e==="odd")return[2,1];let t=0,n=0,o=i(),r=s();if(t<e.length&&e.charAt(t)==="n")if(t++,n=o*(r!==null&&r!==void 0?r:1),a(),t<e.length)o=i(),a(),r=s();else o=r=0;if(r===null||t<e.length)throw Error(`n-th rule couldn't be parsed ('${e}')`);return[n,o*r];function i(){if(e.charAt(t)==="-")return t++,-1;if(e.charAt(t)==="+")t++;return 1}function s(){let c=t,l=0;while(t<e.length&&e.charCodeAt(t)>=48&&e.charCodeAt(t)<=57)l=l*10+(e.charCodeAt(t)-48),t++;return t===c?null:l}function a(){while(t<e.length&&UOo.has(e.charCodeAt(t)))t++}}var Xze=at(DO(),1);function Ewt(e){let t=e[0],n=e[1]-1;if(n<0&&t<=0)return Xze.default.falseFunc;if(t===-1)return(i)=>i<=n;if(t===0)return(i)=>i===n;if(t===1)return n<0?Xze.default.trueFunc:(i)=>i>=n;let o=Math.abs(t),r=(n%o+o)%o;return t>1?(i)=>i>=n&&i%o===r:(i)=>i<=n&&i%o===r}function _K(e){return Ewt(Pwt(e))}var _5=at(DO(),1);function W1e(e,t){return(n)=>{let o=t.getParent(n);return o!=null&&t.isTag(o)&&e(n)}}var Wse={contains(e,t,{adapter:n}){return function(r){return e(r)&&n.getText(r).includes(t)}},icontains(e,t,{adapter:n}){let o=t.toLowerCase();return function(i){return e(i)&&n.getText(i).toLowerCase().includes(o)}},"nth-child"(e,t,{adapter:n,equals:o}){let r=_K(t);if(r===_5.default.falseFunc)return _5.default.falseFunc;if(r===_5.default.trueFunc)return W1e(e,n);return function(s){let a=n.getSiblings(s),c=0;for(let l=0;l<a.length;l++){if(o(s,a[l]))break;if(n.isTag(a[l]))c++}return r(c)&&e(s)}},"nth-last-child"(e,t,{adapter:n,equals:o}){let r=_K(t);if(r===_5.default.falseFunc)return _5.default.falseFunc;if(r===_5.default.trueFunc)return W1e(e,n);return function(s){let a=n.getSiblings(s),c=0;for(let l=a.length-1;l>=0;l--){if(o(s,a[l]))break;if(n.isTag(a[l]))c++}return r(c)&&e(s)}},"nth-of-type"(e,t,{adapter:n,equals:o}){let r=_K(t);if(r===_5.default.falseFunc)return _5.default.falseFunc;if(r===_5.default.trueFunc)return W1e(e,n);return function(s){let a=n.getSiblings(s),c=0;for(let l=0;l<a.length;l++){let h=a[l];if(o(s,h))break;if(n.isTag(h)&&n.getName(h)===n.getName(s))c++}return r(c)&&e(s)}},"nth-last-of-type"(e,t,{adapter:n,equals:o}){let r=_K(t);if(r===_5.default.falseFunc)return _5.default.falseFunc;if(r===_5.default.trueFunc)return W1e(e,n);return function(s){let a=n.getSiblings(s),c=0;for(let l=a.length-1;l>=0;l--){let h=a[l];if(o(s,h))break;if(n.isTag(h)&&n.getName(h)===n.getName(s))c++}return r(c)&&e(s)}},root(e,t,{adapter:n}){return(o)=>{let r=n.getParent(o);return(r==null||!n.isTag(r))&&e(o)}},scope(e,t,n,o){let{equals:r}=n;if(!o||o.length===0)return Wse.root(e,t,n);if(o.length===1)return(i)=>r(o[0],i)&&e(i);return(i)=>o.includes(i)&&e(i)},hover:jze("isHovered"),visited:jze("isVisited"),active:jze("isActive")};function jze(e){return function(n,o,{adapter:r}){let i=r[e];if(typeof i!=="function")return _5.default.falseFunc;return function(a){return i(a)&&n(a)}}}var X1e={empty(e,{adapter:t}){return!t.getChildren(e).some((n)=>t.isTag(n)||t.getText(n)!=="")},"first-child"(e,{adapter:t,equals:n}){if(t.prevElementSibling)return t.prevElementSibling(e)==null;let o=t.getSiblings(e).find((r)=>t.isTag(r));return o!=null&&n(e,o)},"last-child"(e,{adapter:t,equals:n}){let o=t.getSiblings(e);for(let r=o.length-1;r>=0;r--){if(n(e,o[r]))return!0;if(t.isTag(o[r]))break}return!1},"first-of-type"(e,{adapter:t,equals:n}){let o=t.getSiblings(e),r=t.getName(e);for(let i=0;i<o.length;i++){let s=o[i];if(n(e,s))return!0;if(t.isTag(s)&&t.getName(s)===r)break}return!1},"last-of-type"(e,{adapter:t,equals:n}){let o=t.getSiblings(e),r=t.getName(e);for(let i=o.length-1;i>=0;i--){let s=o[i];if(n(e,s))return!0;if(t.isTag(s)&&t.getName(s)===r)break}return!1},"only-of-type"(e,{adapter:t,equals:n}){let o=t.getName(e);return t.getSiblings(e).every((r)=>n(e,r)||!t.isTag(r)||t.getName(r)!==o)},"only-child"(e,{adapter:t,equals:n}){return t.getSiblings(e).every((o)=>n(e,o)||!t.isTag(o))}};function Kze(e,t,n,o){if(n===null){if(e.length>o)throw Error(`Pseudo-class :${t} requires an argument`)}else if(e.length===o)throw Error(`Pseudo-class :${t} doesn't have any arguments`)}var $ze={"any-link":":is(a, area, link)[href]",link:":any-link:not(:visited)",disabled:`:is(
        :is(button, input, select, textarea, optgroup, option)[disabled],
        optgroup[disabled] > option,
        fieldset[disabled]:not(fieldset[disabled] legend:first-of-type *)
    )`,enabled:":not(:disabled)",checked:":is(:is(input[type=radio], input[type=checkbox])[checked], option:selected)",required:":is(input, select, textarea)[required]",optional:":is(input, select, textarea):not([required])",selected:"option:is([selected], select:not([multiple]):not(:has(> option[selected])) > :first-of-type)",checkbox:"[type=checkbox]",file:"[type=file]",password:"[type=password]",radio:"[type=radio]",reset:"[type=reset]",image:"[type=image]",submit:"[type=submit]",parent:":not(:empty)",header:":is(h1, h2, h3, h4, h5, h6)",button:":is(button, input[type=button])",input:":is(input, textarea, select, button)",text:"input:is(:not([type!='']), [type=text])"};var Lb=at(DO(),1);var Zze={};function eOe(e,t){if(e===Lb.default.falseFunc)return Lb.default.falseFunc;return(n)=>t.isTag(n)&&e(n)}function tOe(e,t){let n=t.getSiblings(e);if(n.length<=1)return[];let o=n.indexOf(e);if(o<0||o===n.length-1)return[];return n.slice(o+1).filter(t.isTag)}function Jze(e){return{xmlMode:!!e.xmlMode,lowerCaseAttributeNames:!!e.lowerCaseAttributeNames,lowerCaseTags:!!e.lowerCaseTags,quirksMode:!!e.quirksMode,cacheResults:!!e.cacheResults,pseudos:e.pseudos,adapter:e.adapter,equals:e.equals}}var qze=(e,t,n,o,r)=>{let i=r(t,Jze(n),o);return i===Lb.default.trueFunc?e:i===Lb.default.falseFunc?Lb.default.falseFunc:(s)=>i(s)&&e(s)},j1e={is:qze,matches:qze,where:qze,not(e,t,n,o,r){let i=r(t,Jze(n),o);return i===Lb.default.falseFunc?e:i===Lb.default.trueFunc?Lb.default.falseFunc:(s)=>!i(s)&&e(s)},has(e,t,n,o,r){let{adapter:i}=n,s=Jze(n);s.relativeSelector=!0;let a=t.some((h)=>h.some(Gse))?[Zze]:void 0,c=r(t,s,a);if(c===Lb.default.falseFunc)return Lb.default.falseFunc;let l=eOe(c,i);if(a&&c!==Lb.default.trueFunc){let{shouldTestNextSiblings:h=!1}=c;return(d)=>{if(!e(d))return!1;a[0]=d;let u=i.getChildren(d),_=h?[...u,...tOe(d,i)]:u;return i.existsOne(l,_)}}return(h)=>e(h)&&i.existsOne(l,i.getChildren(h))}};function Mwt(e,t,n,o,r){var i;let{name:s,data:a}=t;if(Array.isArray(a)){if(!(s in j1e))throw Error(`Unknown pseudo-class :${s}(${a})`);return j1e[s](e,a,n,o,r)}let c=(i=n.pseudos)===null||i===void 0?void 0:i[s],l=typeof c==="string"?c:$ze[s];if(typeof l==="string"){if(a!=null)throw Error(`Pseudo ${s} doesn't have any arguments`);let h=Yse(l);return j1e.is(e,h,n,o,r)}if(typeof c==="function")return Kze(c,s,a,1),(h)=>c(h,a)&&e(h);if(s in Wse)return Wse[s](e,a,n,o);if(s in X1e){let h=X1e[s];return Kze(h,s,a,2),(d)=>h(d,n,a)&&e(d)}throw Error(`Unknown pseudo-class :${s}`)}function nOe(e,t){let n=t.getParent(e);if(n&&t.isTag(n))return n;return null}function wwt(e,t,n,o,r){let{adapter:i,equals:s}=n;switch(t.type){case as.PseudoElement:throw Error("Pseudo-elements are not supported by css-select");case as.ColumnCombinator:throw Error("Column combinators are not yet supported by css-select");case as.Attribute:{if(t.namespace!=null)throw Error("Namespaced attributes are not yet supported by css-select");if(!n.xmlMode||n.lowerCaseAttributeNames)t.name=t.name.toLowerCase();return Swt[t.action](e,t,n)}case as.Pseudo:return Mwt(e,t,n,o,r);case as.Tag:{if(t.namespace!=null)throw Error("Namespaced tag names are not yet supported by css-select");let{name:a}=t;if(!n.xmlMode||n.lowerCaseTags)a=a.toLowerCase();return function(l){return i.getName(l)===a&&e(l)}}case as.Descendant:{if(n.cacheResults===!1||typeof WeakSet>"u")return function(l){let h=l;while(h=nOe(h,i))if(e(h))return!0;return!1};let a=new WeakSet;return function(l){let h=l;while(h=nOe(h,i))if(!a.has(h)){if(i.isTag(h)&&e(h))return!0;a.add(h)}return!1}}case"_flexibleDescendant":return function(c){let l=c;do if(e(l))return!0;while(l=nOe(l,i));return!1};case as.Parent:return function(c){return i.getChildren(c).some((l)=>i.isTag(l)&&e(l))};case as.Child:return function(c){let l=i.getParent(c);return l!=null&&i.isTag(l)&&e(l)};case as.Sibling:return function(c){let l=i.getSiblings(c);for(let h=0;h<l.length;h++){let d=l[h];if(s(c,d))break;if(i.isTag(d)&&e(d))return!0}return!1};case as.Adjacent:{if(i.prevElementSibling)return function(c){let l=i.prevElementSibling(c);return l!=null&&e(l)};return function(c){let l=i.getSiblings(c),h;for(let d=0;d<l.length;d++){let u=l[d];if(s(c,u))break;if(i.isTag(u))h=u}return!!h&&e(h)}}case as.Universal:{if(t.namespace!=null&&t.namespace!=="*")throw Error("Namespaced universal selectors are not yet supported by css-select");return e}}}function Bwt(e,t,n){let o=K1e(e,t,n);return eOe(o,t.adapter)}function K1e(e,t,n){let o=typeof e==="string"?Yse(e):e;return $1e(o,t,n)}function Twt(e){return e.type===as.Pseudo&&(e.name==="scope"||Array.isArray(e.data)&&e.data.some((t)=>t.some(Twt)))}var WOo={type:as.Descendant},XOo={type:"_flexibleDescendant"},jOo={type:as.Pseudo,name:"scope",data:null};function KOo(e,{adapter:t},n){let o=!!(n===null||n===void 0?void 0:n.every((r)=>{let i=t.isTag(r)&&t.getParent(r);return r===Zze||i&&t.isTag(i)}));for(let r of e){if(r.length>0&&Gse(r[0])&&r[0].type!==as.Descendant);else if(o&&!r.some(Twt))r.unshift(WOo);else continue;r.unshift(jOo)}}function $1e(e,t,n){var o;e.forEach(Wze),n=(o=t.context)!==null&&o!==void 0?o:n;let r=Array.isArray(n),i=n&&(Array.isArray(n)?n:[n]);if(t.relativeSelector!==!1)KOo(e,t,i);else if(e.some((c)=>c.length>0&&Gse(c[0])))throw Error("Relative selectors are not allowed when the `relativeSelector` option is disabled");let s=!1,a=e.map((c)=>{if(c.length>=2){let[l,h]=c;if(l.type!==as.Pseudo||l.name!=="scope");else if(r&&h.type===as.Descendant)c[1]=XOo;else if(h.type===as.Adjacent||h.type===as.Sibling)s=!0}return $Oo(c,t,i)}).reduce(qOo,Fw.default.falseFunc);return a.shouldTestNextSiblings=s,a}function $Oo(e,t,n){var o;return e.reduce((r,i)=>r===Fw.default.falseFunc?Fw.default.falseFunc:wwt(r,i,t,n,$1e),(o=t.rootFunc)!==null&&o!==void 0?o:Fw.default.trueFunc)}function qOo(e,t){if(t===Fw.default.falseFunc||e===Fw.default.trueFunc)return e;if(e===Fw.default.falseFunc||t===Fw.default.trueFunc)return t;return function(o){return e(o)||t(o)}}var Dwt=(e,t)=>e===t,JOo={adapter:U1e,equals:Dwt};function Nwt(e){var t,n,o,r;let i=e!==null&&e!==void 0?e:JOo;return(t=i.adapter)!==null&&t!==void 0||(i.adapter=U1e),(n=i.equals)!==null&&n!==void 0||(i.equals=(r=(o=i.adapter)===null||o===void 0?void 0:o.equals)!==null&&r!==void 0?r:Dwt),i}function rOe(e){return function(n,o,r){let i=Nwt(o);return e(n,i,r)}}var dTs=rOe(Bwt),uTs=rOe(K1e),pTs=rOe($1e);function Rwt(e){return function(n,o,r){let i=Nwt(r);if(typeof n!=="function")n=K1e(n,i,o);let s=ZOo(o,i.adapter,n.shouldTestNextSiblings);return e(n,s,i)}}function ZOo(e,t,n=!1){if(n)e=eVo(e,t);return Array.isArray(e)?t.removeSubsets(e):t.getChildren(e)}function eVo(e,t){let n=Array.isArray(e)?e.slice(0):[e],o=n.length;for(let r=0;r<o;r++){let i=tOe(n[r],t);n.push(...i)}return n}var RO=Rwt((e,t,n)=>e===oOe.default.falseFunc||!t||t.length===0?[]:n.adapter.findAll(e,t)),gK=Rwt((e,t,n)=>e===oOe.default.falseFunc||!t||t.length===0?null:n.adapter.findOne(e,t));var vea=at(j0(),1),M4n=at(j0(),1);qt();function _o(e,t){return Array.isArray(t)?[e.a*t[0]+e.c*t[1]+e.e,e.b*t[0]+e.d*t[1]+e.f]:{x:e.a*t.x+e.c*t.y+e.e,y:e.b*t.x+e.d*t.y+e.f}}function Qwt(e,t){return t.map((n)=>_o(e,n))}function fh(){return{a:1,c:0,e:0,b:0,d:1,f:0}}function Xse(e){let{a:t,b:n,c:o,d:r,e:i,f:s}=e,a=t*r-n*o;return{a:r/a,b:n/-a,c:o/-a,d:t/a,e:(r*i-o*s)/-a,f:(n*i-t*s)/a}}function QO(e){return typeof e>"u"}function Ii(e,t=0){return{a:1,c:0,e,b:0,d:1,f:t}}function kO(...e){e=Array.isArray(e[0])?e[0]:e;let t=(n,o)=>({a:n.a*o.a+n.c*o.b,c:n.a*o.c+n.c*o.d,e:n.a*o.e+n.c*o.f+n.e,b:n.b*o.a+n.d*o.b,d:n.b*o.c+n.d*o.d,f:n.b*o.e+n.d*o.f+n.f});switch(e.length){case 0:throw Error("no matrices provided");case 1:return e[0];case 2:return t(e[0],e[1]);default:{let[n,o,...r]=e,i=t(n,o);return kO(i,...r)}}}function Hi(...e){return kO(...e)}var{cos:tVo,sin:nVo,PI:oVo}=Math;function Yg(e,t,n){let o=tVo(e),r=nVo(e),i={a:o,c:-r,e:0,b:r,d:o,f:0};if(QO(t)||QO(n))return i;return kO([Ii(t,n),i,Ii(-t,-n)])}function Hb(e,t=void 0,n=void 0){return Yg(e*oVo/180,t,n)}function Fb(e,t=void 0,n=void 0,o=void 0){if(QO(t))t=e;let r={a:e,c:0,e:0,b:0,d:t,f:0};if(QO(n)||QO(o))return r;return kO([Ii(n,o),r,Ii(-n,-o)])}var{tan:LTs}=Math;function rVo(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n}function q1e(e,t,n,o){var r=Error.call(this,e);if(Object.setPrototypeOf)Object.setPrototypeOf(r,q1e.prototype);return r.expected=t,r.found=n,r.location=o,r.name="SyntaxError",r}rVo(q1e,Error);function iOe(e,t,n){if(n=n||" ",e.length>t)return e;return t-=e.length,n+=n.repeat(t),e+n.slice(0,t)}q1e.prototype.format=function(e){var t="Error: "+this.message;if(this.location){var n=null,o;for(o=0;o<e.length;o++)if(e[o].source===this.location.source){n=e[o].text.split(/\r\n|\n|\r/g);break}var r=this.location.start,i=this.location.source&&typeof this.location.source.offset==="function"?this.location.source.offset(r):r,s=this.location.source+":"+i.line+":"+i.column;if(n){var a=this.location.end,c=iOe("",i.line.toString().length," "),l=n[r.line-1],h=r.line===a.line?a.column:l.length+1,d=h-r.column||1;t+=`
 --> `+s+`
`+c+` |
`+i.line+" | "+l+`
`+c+" | "+iOe("",r.column-1," ")+iOe("",d,"^")}else t+=`
 at `+s}return t};q1e.buildMessage=function(e,t){var n={literal:function(l){return'"'+r(l.text)+'"'},class:function(l){var h=l.parts.map(function(d){return Array.isArray(d)?i(d[0])+"-"+i(d[1]):i(d)});return"["+(l.inverted?"^":"")+h.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(l){return l.description}};function o(l){return l.charCodeAt(0).toString(16).toUpperCase()}function r(l){return l.replace(/\\/g,"\\\\").replace(/"/g,"\\\"").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(h){return"\\x0"+o(h)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(h){return"\\x"+o(h)})}function i(l){return l.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(h){return"\\x0"+o(h)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(h){return"\\x"+o(h)})}function s(l){return n[l.type](l)}function a(l){var h=l.map(s),d,u;if(h.sort(),h.length>0){for(d=1,u=1;d<h.length;d++)if(h[d-1]!==h[d])h[u]=h[d],u++;h.length=u}switch(h.length){case 1:return h[0];case 2:return h[0]+" or "+h[1];default:return h.slice(0,-1).join(", ")+", or "+h[h.length-1]}}function c(l){return l?'"'+r(l)+'"':"end of input"}return"Expected "+a(e)+" but "+c(t)+" found."};function Zd(e,t=!1,n=!1){if(t)if(n)e=Hi(e,Fb(-1,-1));else e=Hi(e,Fb(1,-1));else if(n)e=Hi(e,Fb(-1,1));let o=e.a,r=e.b,i=e.c,s=e.d,a,c,l;if(o!==0||i!==0){let h=Math.hypot(o,i);a=h,c=(o*s-r*i)/h;let d=Math.acos(o/h);l=i>0?-d:d}else if(r!==0||s!==0){let h=Math.hypot(r,s);a=(o*s-r*i)/h,c=h;let d=Math.acos(r/h);l=Math.PI/2+(s>0?-d:d)}else a=0,c=0,l=0;if(n)a=-a;if(t)c=-c;return{translate:{tx:e.e,ty:e.f},scale:{sx:a,sy:c},rotation:{angle:l}}}function ZR(){return{a:-1,c:0,e:0,b:0,d:1,f:0}}K0();be();$p();$p();var oRt={name:"@tscircuit/capacity-autorouter",main:"./dist/index.js",version:"0.0.993",type:"module",repository:{type:"git",url:"https://github.com/tscircuit/tscircuit-autorouter"},files:["dist"],scripts:{prepublishOnly:"bun run build && bun scripts/check-published-autorouter-version.ts",start:"cosmos",build:"tsup ./lib/index.ts --minify terser --external @tscircuit/core --external circuit-to-svg --format esm --dts --sourcemap",bench:"bun test tests/spatial-index-bench.test.ts",format:"biome format --write .","format:check":"biome format .","vercel-build":"NODE_OPTIONS=--max-old-space-size=6144 cosmos-export","run-sample":"bun scripts/run-sample.ts","repomix:lib":"repomix --ignore 'testing/**,**/TwoRouteHighDensitySolver/**,**/RouteStitchingSolver/**,solvers/CapacitySegmentPointOptimizer/CapacitySegmentPointOptimizer.ts' lib","bug-report":"bun run scripts/download-bug-report.ts","bug-report-with-test":"bun run scripts/create-bug-report-test.ts"},devDependencies:{"@biomejs/biome":"^1.9.4","@radix-ui/react-icons":"^1.3.2","@radix-ui/react-menubar":"^1.1.14","@react-hook/resize-observer":"^2.0.2","@resvg/resvg-js":"^2.6.2","@tsci/seveibar.dataset-srj13":"git+https://github.com/tscircuit/dataset-srj13.git#56db70039aeb28a76540fe951b5a96be60f9e949","@tsci/dataset-srj23-partially-routed-subcircuits":"git+https://github.com/tscircuit/dataset-srj23-partially-routed-subcircuits.git#53fc559","@tsci/tscircuit.dataset-srj16-bga-breakouts":"git+https://github.com/tscircuit/dataset-srj16-bga-breakouts.git#e8b2e70e1f50a0dba3ad977e140766f53b9b75fb","@tsci/tscircuit.dataset-srj19-bga-passive-overlays":"git+https://github.com/tscircuit/dataset-srj19.git#5104d03ed72a9090d76ea1f42ae9f4bc439f7534","@tsci/tscircuit.dataset-srj20-partial-bga-breakouts":"git+https://github.com/tscircuit/dataset-srj20.git#9384fb8f45fb479b97178ddfa42fc74c69afbbec","@tsci/0hmX.multi-component-dataset-srj01":"git+https://github.com/tscircuit/multi-component-dataset-srj01.git#abf9d17c966d466b56ac21b735c6bb6f4518919d","@tsci/tscircuit.dataset-srj12-bus-routing":"git+https://github.com/tscircuit/dataset-srj12-bus-routing.git#ba82f86a7d1288566b7144eb8661ad2549c5f328","@tscircuit/autorouting-dataset-01":"git+https://github.com/tscircuit/autorouting-dataset-01.git#b97f5052a2359ab2da3f186765c6a5e839535efb","@tscircuit/checks":"^0.0.259","@tscircuit/circuit-json-util":"^0.0.114","@tscircuit/core":"0.0.337","@tscircuit/curvy-trace-solver":"^0.0.10","@tscircuit/dataset-srj05":"git+https://github.com/tscircuit/dataset-srj05.git#9a49c126a89c083dc4d2b72cd17184735f637762","@tscircuit/dataset-srj24":"git+https://github.com/tscircuit/dataset-srj24.git#6340ee442bc36cc5a0fd3c9b84070548ed5f416a","@tscircuit/dataset-srj27-power-traces":"git+https://github.com/tscircuit/dataset-srj27-power-traces.git#eb24d36","@tscircuit/dataset-srj28-partially-prerouted":"git+https://github.com/tscircuit/dataset-srj28-partially-prerouted.git#5b1673544b6ade4480612539ba6574ad414fddc0","@tscircuit/dataset-srj29-ddr3-bga-pairs":"git+https://github.com/ShiboSoftwareDev/dataset-srj29-ddr3-bga-pairs.git#585c3abd4c6ce4be52bbc430b1d5e6dcc9b4ea30","@tscircuit/dataset-srj33-drc-failures":"git+https://github.com/tscircuit/dataset-srj33-drc-failures.git#f566b62be0f83395d9ab63ddc068f9d645b68b16","@tscircuit/fanout-solver":"^0.0.29","@tscircuit/fanout-for-pipeline9-fixtures":"npm:@tscircuit/fanout-solver@0.0.66","@tscircuit/fixed-via-hypergraph-solver":"https://codeload.github.com/tscircuit/fixed-via-hypergraph-solver/tar.gz/bed37a6201b5dd07c9cc68b828917ecc20d6d049","@tscircuit/hypergraph":"^0.0.71","@tscircuit/jumper-topology-generator":"^0.0.4","@tscircuit/krt-wasm":"^0.1.0","@tscircuit/length-matching-solver":"git+https://github.com/tscircuit/length-matching-solver.git#6a85c3ac7cc90f593b177790a988df8b26ece1e7","@tscircuit/math-utils":"^0.0.36","@tscircuit/power-trace-expander":"git+https://github.com/tscircuit/power-trace-expander.git#ab0071efa0be5d5a9cdaf60a6729512ee47c6645","@tscircuit/rectdiff":"git+https://github.com/tscircuit/rectdiff.git#d3a8b095035f4e7d03cdb19f2fdb7a554c6c008a","@tscircuit/repair04":"https://codeload.github.com/tscircuit/repair04/tar.gz/81d4585d335ea1958a1c6569e4064c58cba44bad","@tscircuit/solver-utils":"^0.0.16","@tscircuit/trace-simplification-solver":"github:tscircuit/trace-simplification-solver#404f2ab10bac05bccf9b11e6b30bdd16d0694b07","@types/bun":"^1.2.23","@types/fast-json-stable-stringify":"^2.1.2","@types/object-hash":"^3.0.6","@types/rbush":"^4.0.0","@types/react":"^19.0.8","@types/react-dom":"^19.0.3","@vercel/node":"^5.1.7","@vitejs/plugin-react":"^4.3.4","bun-match-svg":"^0.0.14","circuit-json-to-connectivity-map":"^0.0.34","circuit-json":"^0.0.525","circuit-to-svg":"^0.0.220",clsx:"^2.1.1","dataset-srj11-45-degree":"git+https://github.com/tscircuit/dataset-srj11-45-degree.git#c49dd43c38f85fa2777c7d67393df413ca8d5a75","dataset-srj18":"git+https://github.com/tscircuit/dataset-srj18.git#100e8957ce789b5b288e14c476dc83f4efc5214b",flatbush:"^4.4.0","format-si-unit":"0.0.12","graphics-debug":"0.0.99","high-density-dataset-z04":"git+https://github.com/tscircuit/high-density-dataset-z04.git#b9128ed52f5a50102b6526319be1d4ec33dca2c2","kicad-to-circuit-json":"0.0.77",kleur:"^4.1.5","looks-same":"9","pcb-poly-hyper-graph":"https://codeload.github.com/tscircuit/pcb-poly-hyper-graph/tar.gz/80db1463c4a47506eeda15b2c14d59679de900f8",rbush:"^4.0.1",react:"18","react-for-pipeline9-fixtures":"npm:react@19.2.8","react-cosmos":"^6.2.3","react-cosmos-plugin-vite":"^6.2.0","react-dom":"18","react-konva":"18",recharts:"^2.15.1","tailwind-merge":"^3.2.0",terser:"^5.43.1","tiny-hypergraph":"git+https://github.com/tscircuit/tiny-hypergraph.git#e5e1d34f6df3f9b364dc420b17ec5c97cd487fa0","tiny-hypergraph-poly":"git+https://github.com/tscircuit/tiny-hypergraph.git#7b93b4c",tsup:"^8.3.6","tscircuit-for-pipeline9-fixtures":"npm:tscircuit@0.0.2467",typescript:"^5.9.3","use-mouse-matrix-transform":"^1.3.0",vite:"^6.0.11","vite-tsconfig-paths":"^5.1.4","zdwiel-dataset":"git+https://github.com/dwiel/tscircuit-benchmark.git#be36518b5bf51755dae92c230061ab3cf4e3e063","high-density-repair01":"git+https://github.com/tscircuit/high-density-repair01.git#27b3392c38ed4474b0557c73640b261155e28c27","high-density-repair02":"https://codeload.github.com/tscircuit/high-density-repair02/tar.gz/1981ac8d3547772cb4b0267f26c7a0c2fd4dea09","high-density-repair03":"https://codeload.github.com/tscircuit/high-density-repair03/tar.gz/79c9b022a678b1f0289059962bf49f253310a5dc","@tscircuit/high-density-a01":"git+https://github.com/tscircuit/high-density-a01.git#44005d6b9dde7d93a3d3a4815b4e7c8c52b59d34","@tscircuit/high-density-a13":"git+https://github.com/tscircuit/high-density-a01.git#c6812cebd44b09f29f2fee929837b313b822f2ae","@tscircuit/high-density-b01":"git+https://github.com/tscircuit/high-density-b01.git#e651cab6c314e7aab6df31fd6067277436f67148"},dependencies:{"fast-json-stable-stringify":"^2.1.0","object-hash":"^3.0.0","stack-svgs":"^0.0.1","@tscircuit/pcb-trace-linter":"github:tscircuit/pcb-trace-linter#4c035f9d40ffb03ba547a08975b5e64b20371123"}};K0();qt();qt();yc();yc();rae();qt();var nta=at(ln(),1),X4n=at(iRt(),1),ive=at(EUe(),1);be();qt();qt();qt();qt();be();qt();be();qt();var Wer=Object.keys({a:1,b:0,c:0,d:1,e:0,f:0,m11:1,m12:0,m13:0,m14:0,m21:0,m22:1,m23:0,m24:0,m31:0,m32:0,m33:1,m34:0,m41:0,m42:0,m43:0,m44:1,is2D:!0,isIdentity:!0}),aRt=(e)=>(e instanceof Float64Array||e instanceof Float32Array||Array.isArray(e)&&e.every((t)=>typeof t==="number"))&&[6,16].some((t)=>e.length===t),cRt=(e)=>typeof DOMMatrix<"u"&&e instanceof DOMMatrix||e instanceof m1||typeof e==="object"&&Wer.every((t)=>e&&(t in e)),k5e=(e,t)=>{if(!aRt(e))throw TypeError(`CSSMatrix: "${Array.from(e).join(",")}" must be an array with 6/16 numbers.`);if(e.length===16){let[c,l,h,d,u,_,p,m,A,g,f,y,x,C,b,I]=e;return sae(t??new m1,c,l,h,d,u,_,p,m,A,g,f,y,x,C,b,I)}let[n,o,r,i,s,a]=e;return sae(t??new m1,n,o,0,0,r,i,0,0,0,0,1,0,s,a,0,1)},sae=(e,t,n,o,r,i,s,a,c,l,h,d,u,_,p,m,A)=>(e.m11=t,e.a=t,e.m21=i,e.c=i,e.m31=l,e.m41=_,e.e=_,e.m12=n,e.b=n,e.m22=s,e.d=s,e.m32=h,e.m42=p,e.f=p,e.m13=o,e.m23=a,e.m33=d,e.m43=m,e.m14=r,e.m24=c,e.m34=u,e.m44=A,e),MUe=(e,t,n,o,r,i,s,a,c,l,h,d,u,_,p,m)=>sae(new m1,e,t,n,o,r,i,s,a,c,l,h,d,u,_,p,m),Q5e=(e,t)=>{if(cRt(e))return sae(t??new m1,e.m11,e.m12,e.m13,e.m14,e.m21,e.m22,e.m23,e.m24,e.m31,e.m32,e.m33,e.m34,e.m41,e.m42,e.m43,e.m44);throw TypeError(`CSSMatrix: "${JSON.stringify(e)}" is not a DOMMatrix / CSSMatrix / JSON compatible object.`)},wUe=(e)=>{if(typeof e!=="string")throw TypeError(`CSSMatrix: "${JSON.stringify(e)}" is not a string.`);let t=String(e).replace(/\s/g,""),n=new m1,o=`CSSMatrix: invalid transform string "${e}"`,r=/([\w-]+)\(([^)]*)\)/g,i=0,s;while(s=r.exec(t)){let a=s[1],c=s[2];if(i+=s[0].length,!c)throw TypeError(o);let l=c.split(",").map((A)=>A.includes("rad")?parseFloat(A)*(180/Math.PI):parseFloat(A)),[h,d,u,_]=l,p=[h,d,u],m=[h,d,u,_];if(a==="perspective"&&h&&[d,u].every((A)=>A===void 0))n.m34=-1/h;else if(a.includes("matrix")&&[6,16].includes(l.length)&&l.every((A)=>!Number.isNaN(+A))){let A=l.map((g)=>Math.abs(g)<0.000001?0:g);n.multiplySelf(k5e(A))}else if(a==="translate3d"&&p.every((A)=>!Number.isNaN(+A)))n.translateSelf(h,d,u);else if(a==="translate"&&h&&u===void 0)n.translateSelf(h,d||0,0);else if(a==="rotate3d"&&m.every((A)=>!Number.isNaN(+A))&&_)n.rotateAxisAngleSelf(h,d,u,_);else if(a==="rotate"&&h&&[d,u].every((A)=>A===void 0))n.rotateSelf(0,0,h);else if(a==="scale3d"&&p.every((A)=>!Number.isNaN(+A))&&p.some((A)=>A!==1))n.scaleSelf(h,d,u);else if(a==="scale"&&!Number.isNaN(h)&&(h!==1||d!==1)&&u===void 0){let A=Number.isNaN(+d)?h:d;n.scaleSelf(h,A,1)}else if(a==="skew"&&(h||!Number.isNaN(h)&&d)&&u===void 0)n.skewSelf(h,d||0);else if(["translate","rotate","scale","skew"].some((A)=>a.includes(A))&&/[XYZ]/.test(a)&&h&&[d,u].every((A)=>A===void 0))if(a==="skewX"||a==="skewY")n[a==="skewX"?"skewXSelf":"skewYSelf"](h);else{let A=a.replace(/[XYZ]/,""),g=a.replace(A,""),f=["X","Y","Z"].indexOf(g),y=A==="scale"?1:0,x=A+"Self",C=[f===0?h:y,f===1?h:y,f===2?h:y];n[x](...C)}else throw TypeError(o)}if(i!==t.length)throw TypeError(o);return n},Xer=(e,t)=>{if(t)return[e.a,e.b,e.c,e.d,e.e,e.f];return[e.m11,e.m12,e.m13,e.m14,e.m21,e.m22,e.m23,e.m24,e.m31,e.m32,e.m33,e.m34,e.m41,e.m42,e.m43,e.m44]},jer=(e,t,n)=>{let o=new m1;return o.m41=e,o.e=e,o.m42=t,o.f=t,o.m43=n,o},BUe=(e,t,n)=>{let o=new m1,r=Math.PI/180,i=e*r,s=t*r,a=n*r,c=Math.cos(i),l=-Math.sin(i),h=Math.cos(s),d=-Math.sin(s),u=Math.cos(a),_=-Math.sin(a),p=h*u,m=-h*_;o.m11=p,o.a=p,o.m12=m,o.b=m,o.m13=d;let A=l*d*u+c*_;o.m21=A,o.c=A;let g=c*u-l*d*_;return o.m22=g,o.d=g,o.m23=-l*h,o.m31=l*_-c*d*u,o.m32=l*u+c*d*_,o.m33=c*h,o},TUe=(e=0,t=0,n=0,o=0)=>{let r=new m1,i=Math.sqrt(e*e+t*t+n*n);if(i===0)return r;let s=e/i,a=t/i,c=n/i,l=o*(Math.PI/360),h=Math.sin(l),d=Math.cos(l),u=h*h,_=s*s,p=a*a,m=c*c,A=1-2*(p+m)*u;r.m11=A,r.a=A;let g=2*(s*a*u+c*h*d);r.m12=g,r.b=g,r.m13=2*(s*c*u-a*h*d);let f=2*(a*s*u-c*h*d);r.m21=f,r.c=f;let y=1-2*(m+_)*u;return r.m22=y,r.d=y,r.m23=2*(a*c*u+s*h*d),r.m31=2*(c*s*u+a*h*d),r.m32=2*(c*a*u-s*h*d),r.m33=1-2*(_+p)*u,r},Ker=(e,t,n)=>{let o=new m1;return o.m11=e,o.a=e,o.m22=t,o.d=t,o.m33=n,o},DUe=(e,t)=>{let n=new m1;if(e){let o=e*Math.PI/180,r=Math.tan(o);n.m21=r,n.c=r}if(t){let o=t*Math.PI/180,r=Math.tan(o);n.m12=r,n.b=r}return n},$er=(e)=>DUe(e,0),qer=(e)=>DUe(0,e),lRt=(e,t,n)=>{let o=t.m11*e.m11+t.m12*e.m21+t.m13*e.m31+t.m14*e.m41,r=t.m11*e.m12+t.m12*e.m22+t.m13*e.m32+t.m14*e.m42,i=t.m11*e.m13+t.m12*e.m23+t.m13*e.m33+t.m14*e.m43,s=t.m11*e.m14+t.m12*e.m24+t.m13*e.m34+t.m14*e.m44,a=t.m21*e.m11+t.m22*e.m21+t.m23*e.m31+t.m24*e.m41,c=t.m21*e.m12+t.m22*e.m22+t.m23*e.m32+t.m24*e.m42,l=t.m21*e.m13+t.m22*e.m23+t.m23*e.m33+t.m24*e.m43,h=t.m21*e.m14+t.m22*e.m24+t.m23*e.m34+t.m24*e.m44,d=t.m31*e.m11+t.m32*e.m21+t.m33*e.m31+t.m34*e.m41,u=t.m31*e.m12+t.m32*e.m22+t.m33*e.m32+t.m34*e.m42,_=t.m31*e.m13+t.m32*e.m23+t.m33*e.m33+t.m34*e.m43,p=t.m31*e.m14+t.m32*e.m24+t.m33*e.m34+t.m34*e.m44,m=t.m41*e.m11+t.m42*e.m21+t.m43*e.m31+t.m44*e.m41,A=t.m41*e.m12+t.m42*e.m22+t.m43*e.m32+t.m44*e.m42,g=t.m41*e.m13+t.m42*e.m23+t.m43*e.m33+t.m44*e.m43,f=t.m41*e.m14+t.m42*e.m24+t.m43*e.m34+t.m44*e.m44;return n.m11=o,n.a=o,n.m21=a,n.c=a,n.m31=d,n.m41=m,n.e=m,n.m12=r,n.b=r,n.m22=c,n.d=c,n.m32=u,n.m42=A,n.f=A,n.m13=i,n.m23=l,n.m33=_,n.m43=g,n.m14=s,n.m24=h,n.m34=p,n.m44=f,n},sRt=(e,t)=>lRt(e,t,new m1),m1=class{static Translate=jer;static Rotate=BUe;static RotateAxisAngle=TUe;static Scale=Ker;static SkewX=$er;static SkewY=qer;static Skew=DUe;static Multiply=sRt;static fromArray=k5e;static fromMatrix=Q5e;static fromString=wUe;static toArray=Xer;static isCompatibleArray=aRt;static isCompatibleObject=cRt;constructor(e){if(e){if(typeof e==="string"&&e.length&&e!=="none")return wUe(e);if(Array.isArray(e)||e instanceof Float64Array||e instanceof Float32Array)return k5e(e);if(typeof e==="object")return Q5e(e)}return this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0,this.m11=1,this.m12=0,this.m13=0,this.m14=0,this.m21=0,this.m22=1,this.m23=0,this.m24=0,this.m31=0,this.m32=0,this.m33=1,this.m34=0,this.m41=0,this.m42=0,this.m43=0,this.m44=1,this}get isIdentity(){return this.m11===1&&this.m12===0&&this.m13===0&&this.m14===0&&this.m21===0&&this.m22===1&&this.m23===0&&this.m24===0&&this.m31===0&&this.m32===0&&this.m33===1&&this.m34===0&&this.m41===0&&this.m42===0&&this.m43===0&&this.m44===1}get is2D(){return this.m31===0&&this.m32===0&&this.m33===1&&this.m34===0&&this.m43===0&&this.m44===1}setMatrixValue(e){if(typeof e==="string"&&e.length&&e!=="none"){let t=wUe(e);return sae(this,t.m11,t.m12,t.m13,t.m14,t.m21,t.m22,t.m23,t.m24,t.m31,t.m32,t.m33,t.m34,t.m41,t.m42,t.m43,t.m44)}if(Array.isArray(e)||e instanceof Float64Array||e instanceof Float32Array)return k5e(e,this);if(typeof e==="object")return Q5e(e,this);return this}toFloat32Array(e){return e?new Float32Array([this.a,this.b,this.c,this.d,this.e,this.f]):new Float32Array([this.m11,this.m12,this.m13,this.m14,this.m21,this.m22,this.m23,this.m24,this.m31,this.m32,this.m33,this.m34,this.m41,this.m42,this.m43,this.m44])}toFloat64Array(e){return e?new Float64Array([this.a,this.b,this.c,this.d,this.e,this.f]):new Float64Array([this.m11,this.m12,this.m13,this.m14,this.m21,this.m22,this.m23,this.m24,this.m31,this.m32,this.m33,this.m34,this.m41,this.m42,this.m43,this.m44])}toString(){let{is2D:e}=this,t=this.toFloat64Array(e).join(", ");return`${e?"matrix":"matrix3d"}(${t})`}toJSON(){let{is2D:e,isIdentity:t}=this;return{a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f,m11:this.m11,m12:this.m12,m13:this.m13,m14:this.m14,m21:this.m21,m22:this.m22,m23:this.m23,m24:this.m24,m31:this.m31,m32:this.m32,m33:this.m33,m34:this.m34,m41:this.m41,m42:this.m42,m43:this.m43,m44:this.m44,is2D:e,isIdentity:t}}multiply(e){return sRt(this,e)}translate(e,t,n){let o=t??0,r=n??0,{m11:i,m12:s,m13:a,m14:c,m21:l,m22:h,m23:d,m24:u,m31:_,m32:p,m33:m,m34:A,m41:g,m42:f,m43:y,m44:x}=this,C=e*i+o*l+r*_+g,b=e*s+o*h+r*p+f,I=e*a+o*d+r*m+y,v=e*c+o*u+r*A+x;return MUe(i,s,a,c,l,h,d,u,_,p,m,A,C,b,I,v)}scale(e,t,n){let o=t??e,r=n??1,{m41:i,m42:s,m43:a,m44:c}=this;return MUe(this.m11*e,this.m12*e,this.m13*e,this.m14*e,this.m21*o,this.m22*o,this.m23*o,this.m24*o,this.m31*r,this.m32*r,this.m33*r,this.m34*r,i,s,a,c)}rotate(e,t,n){let o=e,r=t||0,i=n||0;if(typeof e==="number"&&typeof t>"u"&&typeof n>"u")i=o,o=0,r=0;return this.multiply(BUe(o,r,i))}rotateAxisAngle(e=0,t=0,n=0,o=0){if([e,t,n,o].some((r)=>!Number.isFinite(r)))throw TypeError("CSSMatrix: expecting 4 values");if(Math.sqrt(e*e+t*t+n*n)===0)return Q5e(this);return this.multiply(TUe(e,t,n,o))}skewX(e){return this.skew(e,0)}skewY(e){return this.skew(0,e)}skew(e,t){let n=e?Math.tan(e*Math.PI/180):0,o=t?Math.tan(t*Math.PI/180):0,{m11:r,m12:i,m13:s,m14:a,m21:c,m22:l,m23:h,m24:d}=this;return MUe(r+o*c,i+o*l,s+o*h,a+o*d,n*r+c,n*i+l,n*s+h,n*a+d,this.m31,this.m32,this.m33,this.m34,this.m41,this.m42,this.m43,this.m44)}multiplySelf(e){return lRt(this,e,this),this}translateSelf(e,t,n){let o=t??0,r=n??0,{m11:i,m12:s,m13:a,m14:c,m21:l,m22:h,m23:d,m24:u,m31:_,m32:p,m33:m,m34:A,m41:g,m42:f,m43:y,m44:x}=this,C=e*i+o*l+r*_+g,b=e*s+o*h+r*p+f,I=e*a+o*d+r*m+y,v=e*c+o*u+r*A+x;return this.m41=C,this.e=C,this.m42=b,this.f=b,this.m43=I,this.m44=v,this}scaleSelf(e,t,n){let o=t??e,r=n??1;return this.m11*=e,this.a*=e,this.m12*=e,this.b*=e,this.m13*=e,this.m14*=e,this.m21*=o,this.c*=o,this.m22*=o,this.d*=o,this.m23*=o,this.m24*=o,this.m31*=r,this.m32*=r,this.m33*=r,this.m34*=r,this}rotateSelf(e,t,n){let o=e,r=t||0,i=n||0;if(typeof e==="number"&&typeof t>"u"&&typeof n>"u")i=o,o=0,r=0;return this.multiplySelf(BUe(o,r,i))}rotateAxisAngleSelf(e=0,t=0,n=0,o=0){if([e,t,n,o].some((r)=>!Number.isFinite(r)))throw TypeError("CSSMatrix: expecting 4 values");if(Math.sqrt(e*e+t*t+n*n)===0)return this;return this.multiplySelf(TUe(e,t,n,o))}skewXSelf(e){return this.skewSelf(e,0)}skewYSelf(e){return this.skewSelf(0,e)}skewSelf(e,t){let n=e?Math.tan(e*Math.PI/180):0,o=t?Math.tan(t*Math.PI/180):0,{m11:r,m12:i,m13:s,m14:a,m21:c,m22:l,m23:h,m24:d}=this,u=r+o*c,_=i+o*l,p=s+o*h,m=a+o*d,A=n*r+c,g=n*i+l,f=n*s+h,y=n*a+d;return this.m11=u,this.a=u,this.m12=_,this.b=_,this.m13=p,this.m14=m,this.m21=A,this.c=A,this.m22=g,this.d=g,this.m23=f,this.m24=y,this}transformPoint(e){let t=this.m11*e.x+this.m21*e.y+this.m31*e.z+this.m41*e.w,n=this.m12*e.x+this.m22*e.y+this.m32*e.z+this.m42*e.w,o=this.m13*e.x+this.m23*e.y+this.m33*e.z+this.m43*e.w,r=this.m14*e.x+this.m24*e.y+this.m34*e.z+this.m44*e.w;return typeof DOMPoint<"u"&&e instanceof DOMPoint?new DOMPoint(t,n,o,r):{x:t,y:n,z:o,w:r}}};/*!
* SVGPathCommander v2.3.3 (http://thednp.github.io/svg-path-commander)
* Copyright 2026 © thednp
* Licensed under MIT (https://github.com/thednp/svg-path-commander/blob/master/LICENSE)
*/var Jer="2.3.3",gS=([e,t],[n,o],r)=>[e+(n-e)*r,t+(o-t)*r],W5e=(e,t)=>Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1])),QK=(e,t,n,o)=>W5e([e,t],[n,o]),L5e=(e,t,n,o,r)=>{let i={x:e,y:t};if(typeof r==="number"){let s=W5e([e,t],[n,o]);if(r<=0)i={x:e,y:t};else if(r>=s)i={x:n,y:o};else{let[a,c]=gS([e,t],[n,o],r/s);i={x:a,y:c}}}return i},NUe=(e,t,n,o)=>{let{min:r,max:i}=Math;return[r(e,n),r(t,o),i(e,n),i(t,o)]},Zer={getLineBBox:NUe,getLineLength:QK,getPointAtLineLength:L5e},lae=[-0.06405689286260563,0.06405689286260563,-0.1911188674736163,0.1911188674736163,-0.3150426796961634,0.3150426796961634,-0.4337935076260451,0.4337935076260451,-0.5454214713888396,0.5454214713888396,-0.6480936519369755,0.6480936519369755,-0.7401241915785544,0.7401241915785544,-0.820001985973903,0.820001985973903,-0.8864155270044011,0.8864155270044011,-0.9382745520027328,0.9382745520027328,-0.9747285559713095,0.9747285559713095,-0.9951872199970213,0.9951872199970213],WUe=[0.12793819534675216,0.12793819534675216,0.1258374563468283,0.1258374563468283,0.12167047292780339,0.12167047292780339,0.1155056680537256,0.1155056680537256,0.10744427011596563,0.10744427011596563,0.09761865210411388,0.09761865210411388,0.08619016153195327,0.08619016153195327,0.0733464814110803,0.0733464814110803,0.05929858491543678,0.05929858491543678,0.04427743881741981,0.04427743881741981,0.028531388628933663,0.028531388628933663,0.0123412297999872,0.0123412297999872],X5e=(e)=>{let t=[];for(let n=e,o=n.length,r=o-1;o>1;o-=1,r-=1){let i=[];for(let s=0;s<r;s+=1)i.push({x:r*(n[s+1].x-n[s].x),y:r*(n[s+1].y-n[s].y),t:0});t.push(i),n=i}return t},j5e=(e,t)=>{if(t===0)return e[0].t=0,e[0];let n=e.length-1;if(t===1)return e[n].t=1,e[n];let o=1-t,r=e;if(n===0)return e[0].t=t,e[0];if(n===1)return{x:o*r[0].x+t*r[1].x,y:o*r[0].y+t*r[1].y,t};let i=o*o,s=t*t,a=0,c=0,l=0,h=0;if(n===2)r=[r[0],r[1],r[2],{x:0,y:0}],a=i,c=o*t*2,l=s;else if(n===3)a=i*o,c=i*t*3,l=o*s*3,h=t*s;return{x:a*r[0].x+c*r[1].x+l*r[2].x+h*r[3].x,y:a*r[0].y+c*r[1].y+l*r[2].y+h*r[3].y,t}},yRt=(e,t)=>{let n=e(t),o=n.x*n.x+n.y*n.y;return Math.sqrt(o)},xRt=(e)=>K5e(e,1),K5e=(e,t)=>{let n=t/2,o=lae.length,r=0;for(let i=0,s;i<o;i++)s=n*lae[i]+n,r+=WUe[i]*yRt(e,s);return n*r},$5e=(e)=>{let t=[];for(let n=0,o=e.length,r=2;n<o;n+=r)t.push({x:e[n],y:e[n+1]});return t},etr=(e,t)=>{let n=X5e($5e(e));return K5e((o)=>j5e(n[0],o),t)},XUe=(e,t)=>{let n=X5e($5e(e)),o=(s)=>j5e(n[0],s),r=0,i=1;for(let s=0;s<25;s+=1){let a=(r+i)/2;if(K5e(o,a)<t)r=a;else i=a}return(r+i)/2},pae=(e)=>{let t=$5e(e),n=X5e(t);return xRt((o)=>j5e(n[0],o))},ttr=0.00000001,H5e=([e,t,n])=>{let o=Math.min(e,n),r=Math.max(e,n);if(t>=e?n>=t:n<=t)return[o,r];let i=(e*n-t*t)/(e-2*t+n);return i<o?[i,r]:[o,i]},RUe=([e,t,n,o])=>{let r=e-3*t+3*n-o;if(Math.abs(r)<0.00000001){if(e===o&&e===t)return[e,o];return H5e([e,-0.5*e+1.5*t,e-3*t+3*n])}let i=-e*n+e*o-t*n-t*o+t*t+n*n;if(i<=0)return[Math.min(e,o),Math.max(e,o)];let s=Math.sqrt(i),a=Math.min(e,o),c=Math.max(e,o),l=e-2*t+n;for(let h=(l+s)/r,d=1;d<=2;h=(l-s)/r,d++)if(h>0&&h<1){let u=e*(1-h)*(1-h)*(1-h)+t*3*(1-h)*(1-h)*h+n*3*(1-h)*h*h+o*h*h*h;if(u<a)a=u;if(u>c)c=u}return[a,c]},ntr={bezierLength:xRt,bezierLengthAtT:K5e,calculateBezier:yRt,CBEZIER_MINMAX_EPSILON:ttr,computeBezier:j5e,Cvalues:WUe,deriveBezier:X5e,getBezierLength:pae,getBezierLengthAtT:etr,getBezierPoints:$5e,getTAtBezierLength:XUe,minmaxC:RUe,minmaxQ:H5e,Tvalues:lae},F5e=(e,t,n)=>{let o=n<0?-1:1,r=Math.abs(n),i=Math.PI/2,s=0,a=r,c=0;while(a>0){let l=Math.min(i,a),h=l/2,d=0;for(let u=0,_=lae.length;u<_;u+=1){let p=c+h*lae[u]+h;d+=WUe[u]*Math.sqrt((e*Math.sin(p))**2+(t*Math.cos(p))**2)}s+=h*d,c+=l,a-=l}return o*s},z5e=(e,t,n,o)=>F5e(e,t,o)-F5e(e,t,n),otr=(e,t,n)=>Math.abs(F5e(e,t,n)),OO=(e,t,n,o,r,i)=>{let{sin:s,cos:a}=Math,c=a(r),l=s(r),h=n*a(i),d=o*s(i);return[e+c*h-l*d,t+l*h+c*d]},QUe=(e,t)=>{let{x:n,y:o}=e,{x:r,y:i}=t,s=n*r+o*i,a=Math.sqrt((n**2+o**2)*(r**2+i**2));return(n*i-o*r<0?-1:1)*Math.acos(s/a)},q5e=(e,t,n,o,r,i,s,a,c)=>{let{abs:l,sin:h,cos:d,sqrt:u,PI:_}=Math,p=l(n),m=l(o),A=(r%360+360)%360*(_/180);if(e===a&&t===c)return{rx:p,ry:m,startAngle:0,endAngle:0,center:{x:a,y:c}};if(p===0||m===0)return{rx:p,ry:m,startAngle:0,endAngle:0,center:{x:(a+e)/2,y:(c+t)/2}};let g=(e-a)/2,f=(t-c)/2,y={x:d(A)*g+h(A)*f,y:-h(A)*g+d(A)*f},x=y.x**2/p**2+y.y**2/m**2;if(x>1)p*=u(x),m*=u(x);let C=(p**2*m**2-p**2*y.y**2-m**2*y.x**2)/(p**2*y.y**2+m**2*y.x**2);C=C<0?0:C;let b=(i!==s?1:-1)*u(C),I={x:b*(p*y.y/m),y:b*(-(m*y.x)/p)},v={x:d(A)*I.x-h(A)*I.y+(e+a)/2,y:h(A)*I.x+d(A)*I.y+(t+c)/2},P={x:(y.x-I.x)/p,y:(y.y-I.y)/m},M=QUe({x:1,y:0},P),B={x:(-y.x-I.x)/p,y:(-y.y-I.y)/m},T=QUe(P,B);if(!s&&T>0)T-=2*_;else if(s&&T<0)T+=2*_;return T%=2*_,{center:v,startAngle:M,endAngle:M+T,rx:p,ry:m}},jUe=(e,t,n,o,r,i,s,a,c)=>{let{rx:l,ry:h,startAngle:d,endAngle:u}=q5e(e,t,n,o,r,i,s,a,c);return Math.abs(z5e(l,h,d,u))},CRt=(e,t,n,o,r,i,s,a,c,l)=>{let h={x:e,y:t},{center:d,rx:u,ry:_,startAngle:p,endAngle:m}=q5e(e,t,n,o,r,i,s,a,c);if(typeof l==="number"){let A=m-p,g=Math.abs(z5e(u,_,p,m));if(l<=0)h={x:e,y:t};else if(l>=g)h={x:a,y:c};else{if(e===a&&t===c)return{x:a,y:c};if(u===0||_===0)return L5e(e,t,a,c,l);let{PI:f,cos:y,sin:x}=Math,C=(r%360+360)%360*(f/180),b=0,I=1;for(let B=0;B<25;B+=1){let T=(b+I)/2;if(Math.abs(z5e(u,_,p,p+A*T))<l)b=T;else I=T}let v=p+A*((b+I)/2),P=u*y(v),M=_*x(v);h={x:y(C)*P-x(C)*M+d.x,y:x(C)*P+y(C)*M+d.y}}}return h},bRt=(e,t,n,o,r,i,s,a,c)=>{let{center:l,rx:h,ry:d,startAngle:u,endAngle:_}=q5e(e,t,n,o,r,i,s,a,c),p=_-u,{min:m,max:A,tan:g,atan2:f,PI:y}=Math,{x,y:C}=l,b=r*y/180,I=g(b),v=f(-d*I,h),P=v,M=v+y,B=f(d,h*I),T=B+y,N=[a],D=[c],L=m(e,a),H=A(e,a),V=m(t,c),O=A(t,c),U=_-p*0.00001,j=OO(x,C,h,d,b,U),Y=_-p*0.99999,X=OO(x,C,h,d,b,Y);if(j[0]>H||X[0]>H){let K=OO(x,C,h,d,b,P);N.push(K[0]),D.push(K[1])}if(j[0]<L||X[0]<L){let K=OO(x,C,h,d,b,M);N.push(K[0]),D.push(K[1])}if(j[1]<V||X[1]<V){let K=OO(x,C,h,d,b,T);N.push(K[0]),D.push(K[1])}if(j[1]>O||X[1]>O){let K=OO(x,C,h,d,b,B);N.push(K[0]),D.push(K[1])}return L=m.apply([],N),V=m.apply([],D),H=A.apply([],N),O=A.apply([],D),[L,V,H,O]},rtr={angleBetween:QUe,arcLength:otr,arcLengthAtAngle:F5e,arcLengthBetween:z5e,arcPoint:OO,getArcBBox:bRt,getArcLength:jUe,getArcProps:q5e,getPointAtArcLength:CRt},IRt=([e,t,n,o,r,i,s,a],c)=>{let l=1-c;return{x:l**3*e+3*l**2*c*n+3*l*c**2*r+c**3*s,y:l**3*t+3*l**2*c*o+3*l*c**2*i+c**3*a}},YO=(e,t,n,o,r,i,s,a)=>pae([e,t,n,o,r,i,s,a]),O5e=(e,t,n,o,r,i,s,a,c)=>{let l=typeof c==="number",h={x:e,y:t};if(l){let d=[e,t,n,o,r,i,s,a],u=pae(d);if(c<=0);else if(c>=u)h={x:s,y:a};else{let _=XUe(d,c);h=IRt(d,_)}}return h},hae=(e,t,n,o,r,i,s,a)=>{let c=RUe([e,n,r,s]),l=RUe([t,o,i,a]);return[c[0],l[0],c[1],l[1]]},itr={getCubicBBox:hae,getCubicLength:YO,getPointAtCubicLength:O5e,getPointAtCubicSegmentLength:IRt},vRt=([e,t,n,o,r,i],s)=>{let a=1-s;return{x:a**2*e+2*a*s*n+s**2*r,y:a**2*t+2*a*s*o+s**2*i}},V5e=(e,t,n,o,r,i)=>pae([e,t,n,o,r,i]),SRt=(e,t,n,o,r,i,s)=>{let a=typeof s==="number",c={x:e,y:t};if(a){let l=[e,t,n,o,r,i],h=pae(l);if(s<=0);else if(s>=h)c={x:r,y:i};else{let d=XUe(l,s);c=vRt(l,d)}}return c},kUe=(e,t,n,o,r,i)=>{let s=H5e([e,n,r]),a=H5e([t,o,i]);return[s[0],a[0],s[1],a[1]]},str={getPointAtQuadLength:SRt,getPointAtQuadSegmentLength:vRt,getQuadBBox:kUe,getQuadLength:V5e},kK=(e)=>{let t=e.length,n=-1,o,r=e[t-1],i=0;while(++n<t)o=r,r=e[n],i+=o[1]*r[0]-o[0]*r[1];return i/2},atr=(e)=>e.reduce((t,n,o)=>{if(o)return t+W5e(e[o-1],n);return 0},0),ctr=(e)=>{if(e.length===0)return[0,0];let t=0,n=0;for(let[r,i]of e)t+=r,n+=i;let o=e.length;return[t/o,n/o]},ltr={polygonArea:kK,polygonLength:atr,polygonCentroid:ctr},aae=(e,t,n)=>{let{sin:o,cos:r}=Math;return{x:e*r(n)-t*o(n),y:e*o(n)+t*r(n)}},Ed=(e,t)=>{let n=t>=1?10**t:1;return t>0?Math.round(e*n)/n:Math.round(e)},nQ={origin:[0,0,0],round:4},NK={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},LUe=(e)=>{let t=e.pathValue[e.segmentStart],n=t.toLowerCase(),{data:o}=e,r=0;while(o.length-r>=NK[n]){if(n==="m"&&o.length-r>2){let i=[,,,];i[0]=t,i[1]=o[r],i[2]=o[r+1],e.segments.push(i),r+=2,n="l",t=t==="m"?"l":"L"}else{let i=NK[n],s=Array(i+1);s[0]=t;for(let a=0;a<i;a+=1)s[a+1]=o[r+a];e.segments.push(s),r+=i}if(!NK[n])break}},Gg="SVGPathCommanderError",PRt=(e)=>{let{index:t,pathValue:n}=e,o=n.charCodeAt(t);if(o===48){e.param=0,e.index+=1;return}if(o===49){e.param=1,e.index+=1;return}e.err=`${Gg}: invalid Arc flag "${n[t]}", expecting 0 or 1 at index ${t}`},eQ=(e)=>e>=48&&e<=57,tQ="Invalid path value",ERt=(e)=>{let{max:t,pathValue:n,index:o}=e,r=o,i=!1,s=!1,a=!1,c=!1,l;if(r>=t){e.err=`${Gg}: ${tQ} at index ${r}, "pathValue" is missing param`;return}if(l=n.charCodeAt(r),l===43||l===45)r+=1,l=n.charCodeAt(r);if(!eQ(l)&&l!==46){e.err=`${Gg}: ${tQ} at index ${r}, "${n[r]}" is not a number`;return}if(l!==46){if(i=l===48,r+=1,l=n.charCodeAt(r),i&&r<t){if(l&&eQ(l)){e.err=`${Gg}: ${tQ} at index ${o}, "${n[o]}" illegal number`;return}}while(r<t&&eQ(n.charCodeAt(r)))r+=1,s=!0;l=n.charCodeAt(r)}if(l===46){c=!0,r+=1;while(eQ(n.charCodeAt(r)))r+=1,a=!0;l=n.charCodeAt(r)}if(l===101||l===69){if(c&&!s&&!a){e.err=`${Gg}: ${tQ} at index ${r}, "${n[r]}" invalid float exponent`;return}if(r+=1,l=n.charCodeAt(r),l===43||l===45)r+=1;if(r<t&&eQ(n.charCodeAt(r)))while(r<t&&eQ(n.charCodeAt(r)))r+=1;else{e.err=`${Gg}: ${tQ} at index ${r}, "${n[r]}" invalid integer exponent`;return}}e.index=r,e.param=htr(n,o,r)},htr=(e,t,n)=>{let o=t,r=1,i=0,s=0,a=0,c=!1,l=1,h=0,d=e.charCodeAt(o);if(d===43)o+=1;else if(d===45)r=-1,o+=1;for(;o<n;o+=1){let _=e.charCodeAt(o);if(_===46)c=!0;else if(_===101||_===69){o+=1;let p=e.charCodeAt(o);if(p===43)o+=1;else if(p===45)l=-1,o+=1;for(;o<n;o+=1)h=h*10+(e.charCodeAt(o)-48)}else{let p=_-48;if(p!==0||i!==0)a+=1;if(i=i*10+p,c)s+=1}}if(a>15||a===0)return+e.slice(t,n);let u=l*h-s;if(u>22||u<-22)return+e.slice(t,n);if(u>=0)return r*i*10**u;return r*i/10**-u},MRt=(e)=>[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279,10,13,8232,8233,32,9,11,12,160].includes(e),RK=(e)=>{let{pathValue:t,max:n}=e;while(e.index<n&&MRt(t.charCodeAt(e.index)))e.index+=1},wRt=(e)=>{switch(e|32){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:return!0;default:return!1}},BRt=(e)=>eQ(e)||e===43||e===45||e===46,TRt=(e)=>(e|32)===97,DRt=(e)=>{switch(e|32){case 109:case 77:return!0;default:return!1}},KUe=(e)=>{let{max:t,pathValue:n,index:o,segments:r}=e,i=n.charCodeAt(o),s=NK[n[o].toLowerCase()];if(e.segmentStart=o,!wRt(i)){e.err=`${Gg}: ${tQ} "${n[o]}" is not a path command at index ${o}`;return}let a=r[r.length-1];if(!DRt(i)&&a?.[0]?.toLocaleLowerCase()==="z"){e.err=`${Gg}: ${tQ} "${n[o]}" is not a MoveTo path command at index ${o}`;return}if(e.index+=1,RK(e),e.data=[],!s){LUe(e);return}for(;;){for(let c=s;c>0;c-=1){if(TRt(i)&&(c===3||c===4))PRt(e);else ERt(e);if(e.err.length)return;if(e.data.push(e.param),RK(e),e.index<t&&n.charCodeAt(e.index)===44)e.index+=1,RK(e)}if(e.index>=e.max)break;if(!BRt(n.charCodeAt(e.index)))break}LUe(e)},$Ue=class{constructor(e){this.segments=[],this.pathValue=e,this.max=e.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""}},g5=(e)=>{if(typeof e!=="string")return e.slice(0);let t=new $Ue(e);RK(t);while(t.index<t.max&&!t.err.length)KUe(t);if(!t.err.length){if(t.segments.length)t.segments[0][0]="M"}else throw TypeError(t.err);return t.segments},mae=(e,t,n,o)=>{let[r]=e,i=r.toUpperCase();if(t===0||i===r)return e;if(i==="A")return[i,e[1],e[2],e[3],e[4],e[5],e[6]+n,e[7]+o];else if(i==="V")return[i,e[1]+o];else if(i==="H")return[i,e[1]+n];else if(i==="L")return[i,e[1]+n,e[2]+o];else if(i==="C")return[i,e[1]+n,e[2]+o,e[3]+n,e[4]+o,e[5]+n,e[6]+o];else{let s=[],a=e.length;for(let c=1;c<a;c+=1)s.push(e[c]+(c%2?n:o));return[i].concat(s)}},Wy=(e,t)=>{let n=0,o=0,r=0,i=0,s=0;while(s<e.length){let a=e[s],[c]=a,l=c.charCodeAt(0),h=l>=97,d=h?String.fromCharCode(l-32):c,u=t(a,s,n,o);if(u===!1)break;if(d==="Z")n=r,o=i;else if(d==="H")n=a[1]+(h?n:0);else if(d==="V")o=a[1]+(h?o:0);else{let _=a.length;if(n=a[_-2]+(h?n:0),o=a[_-1]+(h?o:0),d==="M")r=n,i=o}if(u)e[s]=u;s+=1}return e},Y5e=(e)=>{let t=g5(e);return Wy(t,mae)},qUe=(e,t,n,o)=>{let[r]=e,i=r.toLowerCase();if(t===0||r===i)return e;if(i==="a")return[i,e[1],e[2],e[3],e[4],e[5],e[6]-n,e[7]-o];else if(i==="v")return[i,e[1]-o];else if(i==="h")return[i,e[1]-n];else if(i==="l")return[i,e[1]-n,e[2]-o];else{let s=[],a=e.length;for(let c=1;c<a;c+=1)s.push(e[c]-(c%2?n:o));return[i].concat(s)}},hRt=(e)=>{let t=g5(e);return Wy(t,qUe)},_ae=(e,t,n,o,r,i,s,a,c,l)=>{let h=e,d=t,u=n,_=o,p=a,m=c,A=Math.PI*120/180,g=Math.PI/180*(+r||0),f=[],y,x,C,b,I;if(!l){y=aae(h,d,-g),h=y.x,d=y.y,y=aae(p,m,-g),p=y.x,m=y.y;let Y=(h-p)/2,X=(d-m)/2,K=Y*Y/(u*u)+X*X/(_*_);if(K>1)K=Math.sqrt(K),u*=K,_*=K;let J=u*u,ee=_*_,se=(i===s?-1:1)*Math.sqrt(Math.abs((J*ee-J*X*X-ee*Y*Y)/(J*X*X+ee*Y*Y)));if(b=se*u*X/_+(h+p)/2,I=se*-_*Y/u+(d+m)/2,x=Math.asin(((d-I)/_*1e9>>0)/1e9),C=Math.asin(((m-I)/_*1e9>>0)/1e9),x=h<b?Math.PI-x:x,C=p<b?Math.PI-C:C,x<0)x=Math.PI*2+x;if(C<0)C=Math.PI*2+C;if(s&&x>C)x-=Math.PI*2;if(!s&&C>x)C-=Math.PI*2}else[x,C,b,I]=l;let v=C-x;if(Math.abs(v)>A){let Y=C,X=p,K=m;C=x+A*(s&&C>x?1:-1),p=b+u*Math.cos(C),m=I+_*Math.sin(C),f=_ae(p,m,u,_,r,0,s,X,K,[C,Y,b,I])}v=C-x;let P=Math.cos(x),M=Math.sin(x),B=Math.cos(C),T=Math.sin(C),N=Math.tan(v/4),D=1.3333333333333333*u*N,L=1.3333333333333333*_*N,H=[h,d],V=[h+D*M,d-L*P],O=[p+D*T,m-L*B],U=[p,m];if(V[0]=2*H[0]-V[0],V[1]=2*H[1]-V[1],l)return[V[0],V[1],O[0],O[1],U[0],U[1]].concat(f);f=[V[0],V[1],O[0],O[1],U[0],U[1]].concat(f);let j=[];for(let Y=0,X=f.length;Y<X;Y+=1)j[Y]=Y%2?aae(f[Y-1],f[Y],g).y:aae(f[Y],f[Y+1],g).x;return j},NRt=(e,t,n,o,r,i)=>[0.3333333333333333*e+0.6666666666666666*n,0.3333333333333333*t+0.6666666666666666*o,0.3333333333333333*r+0.6666666666666666*n,0.3333333333333333*i+0.6666666666666666*o,r,i],HUe=(e,t,n,o)=>{let r=gS([e,t],[n,o],0.3333333333333333),i=gS([e,t],[n,o],0.6666666666666666);return[r[0],r[1],i[0],i[1],n,o]},RRt=(e,t)=>{let n=e[0],o=e.slice(1).map(Number),[r,i]=o,{x1:s,y1:a}=t;if(!"TQ".includes(n))t.qx=null,t.qy=null;if(n==="M")return t.mx=r,t.my=i,t.x=r,t.y=i,e;else if(n==="A")return["C"].concat(_ae(s,a,o[0],o[1],o[2],o[3],o[4],o[5],o[6]));else if(n==="Q")return t.qx=r,t.qy=i,["C"].concat(NRt(s,a,o[0],o[1],o[2],o[3]));else if(n==="L")return["C"].concat(HUe(s,a,r,i));else if(n==="Z")return["C"].concat(HUe(s,a,t.mx,t.my));return e},J5e=(e,t)=>{let[n]=e,o=n.toUpperCase(),r=n!==o,{x1:i,y1:s,x2:a,y2:c,x:l,y:h}=t,d=e.slice(1),u=d.map((_,p)=>_+(r?p%2?h:l:0));if(!"TQ".includes(o))t.qx=null,t.qy=null;if(o==="A")return u=d.slice(0,-2).concat(d[5]+(r?l:0),d[6]+(r?h:0)),["A"].concat(u);else if(o==="H")return["L",e[1]+(r?l:0),s];else if(o==="V")return["L",i,e[1]+(r?h:0)];else if(o==="L")return["L",e[1]+(r?l:0),e[2]+(r?h:0)];else if(o==="M")return["M",e[1]+(r?l:0),e[2]+(r?h:0)];else if(o==="C")return["C"].concat(u);else if(o==="S"){let _=i*2-a,p=s*2-c;return t.x1=_,t.y1=p,["C",_,p].concat(u)}else if(o==="T"){let _=t.qx!=null?i*2-t.qx:i,p=t.qy!=null?s*2-t.qy:s;return t.qx=_,t.qy=p,["Q",_,p].concat(u)}else if(o==="Q"){let[_,p]=u;return t.qx=_,t.qy=p,["Q"].concat(u)}else if(o==="Z")return["Z"];return e},Z5e={mx:0,my:0,x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},oQ=(e)=>{let t={...Z5e},n=g5(e);return Wy(n,(o,r,i,s)=>{t.x=i,t.y=s;let a=J5e(o,t);if(a[0]==="M")t.mx=a[1],t.my=a[2];let c=RRt(a,t);if(c[0]==="C"&&c.length>7)n.splice(r+1,0,["C"].concat(c.slice(7))),c=c.slice(0,7);let l=c.length;return t.x1=+c[l-2],t.y1=+c[l-1],t.x2=+c[l-4]||t.x1,t.y2=+c[l-3]||t.y1,c})},FUe=(e,t)=>{let n=e.length,{round:o}=nQ,r=e[0],i="";o=t==="off"?t:typeof t==="number"&&t>=0?t:typeof o==="number"&&o>=0?o:"off";let s=o==="off"?0:10**o;for(let a=0;a<n;a+=1){r=e[a];let c=r[0],l=r.length;if(i+=c,o==="off"){for(let h=1;h<l;h+=1)if(i+=r[h],h!==l-1)i+=" "}else for(let h=1;h<l;h+=1)if(i+=Math.round(r[h]*s)/s,h!==l-1)i+=" "}return i},zUe=(e)=>{if(!e)return{x:0,y:0,width:0,height:0,x2:0,y2:0,cx:0,cy:0,cz:0};let t=g5(e),n="M",o=0,r=0,{max:i,min:s}=Math,a=1/0,c=1/0,l=-1/0,h=-1/0,d=0,u=0,_=0,p=0,m=0,A=0,g=0,f=0,y=null,x=null;Wy(t,(I,v,P,M)=>{[n]=I;let B=n.charCodeAt(0),T=B>=97,N=T?String.fromCharCode(B-32):n,D=T?mae(I,v,P,M):I,L=N==="V"?["L",P,D[1]]:N==="H"?["L",D[1],M]:D;if([n]=L,N!=="T"&&N!=="Q")y=null,x=null;if(n==="M")[,o,r]=L,d=o,u=r,_=o,p=r;else if(n==="L")[d,u,_,p]=NUe(P,M,L[1],L[2]);else if(n==="A")[d,u,_,p]=bRt(P,M,L[1],L[2],L[3],L[4],L[5],L[6],L[7]);else if(n==="S"){let H=m*2-g,V=A*2-f;[d,u,_,p]=hae(P,M,H,V,L[1],L[2],L[3],L[4])}else if(n==="C")[d,u,_,p]=hae(P,M,L[1],L[2],L[3],L[4],L[5],L[6]);else if(n==="T")y=y===null?P:m*2-y,x=x===null?M:A*2-x,[d,u,_,p]=kUe(P,M,y,x,L[1],L[2]);else if(n==="Q")y=L[1],x=L[2],[d,u,_,p]=kUe(P,M,L[1],L[2],L[3],L[4]);else if(n==="Z")[d,u,_,p]=NUe(P,M,o,r);if(a=s(d,a),c=s(u,c),l=i(_,l),h=i(p,h),n==="Z")m=o,A=r;else{let H=L.length;m=L[H-2],A=L[H-1]}if(n==="C")g=L[3],f=L[4];else if(n==="S")g=L[1],f=L[2];else g=m,f=A});let C=l-a,b=h-c;return{width:C,height:b,x:a,y:c,x2:l,y2:h,cx:a+C/2,cy:c+b/2,cz:Math.max(C,b)+Math.min(C,b)/2}},Uw=(e)=>{let t=g5(e),n=0,o=0,r=0,i=0,s=null,a=null,c="M",l=0,h=0,d=0;return Wy(t,(u,_,p,m)=>{[c]=u;let A=c.toUpperCase(),g=A!==c?mae(u,_,p,m):u.slice(0),f=A==="V"?["L",p,g[1]]:A==="H"?["L",g[1],m]:g;if([c]=f,!"TQ".includes(A))s=null,a=null;if(c==="M")[,l,h]=f;else if(c==="L")d+=QK(p,m,f[1],f[2]);else if(c==="A")d+=jUe(p,m,f[1],f[2],f[3],f[4],f[5],f[6],f[7]);else if(c==="S"){let y=n*2-r,x=o*2-i;d+=YO(p,m,y,x,f[1],f[2],f[3],f[4])}else if(c==="C")d+=YO(p,m,f[1],f[2],f[3],f[4],f[5],f[6]);else if(c==="T")s=s===null?p:n*2-s,a=a===null?m:o*2-a,d+=V5e(p,m,s,a,f[1],f[2]);else if(c==="Q")s=f[1],a=f[2],d+=V5e(p,m,f[1],f[2],f[3],f[4]);else if(c==="Z")d+=QK(p,m,l,h);[n,o]=c==="Z"?[l,h]:f.slice(-2),[r,i]=c==="C"?[f[3],f[4]]:c==="S"?[f[1],f[2]]:[n,o]}),d},JUe=0.00001,U9=(e)=>{let t=g5(e),n={...Z5e};return Wy(t,(o,r,i,s)=>{n.x=i,n.y=s;let a=J5e(o,n),c=a.length;return n.x1=+a[c-2],n.y1=+a[c-1],n.x2=+a[c-4]||n.x1,n.y2=+a[c-3]||n.y1,a})},cae=(e,t)=>{let n=U9(e),o=!1,r=[],[i,s]=n[0].slice(1),a=typeof t==="number",c={x:i,y:s},l=0,h=c,d=0;if(!a||t<0.00001)return c;return Wy(n,(u,_,p,m)=>{let A=u[0];if(o=A==="M",r=!o?[p,m].concat(u.slice(1)):r,o)[,i,s]=u,c={x:i,y:s},l=0;else if(A==="L")c=L5e(r[0],r[1],r[2],r[3],t-d),l=QK(r[0],r[1],r[2],r[3]);else if(A==="A")c=CRt(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],t-d),l=jUe(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8]);else if(A==="C")c=O5e(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],t-d),l=YO(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7]);else if(A==="Q")c=SRt(r[0],r[1],r[2],r[3],r[4],r[5],t-d),l=V5e(r[0],r[1],r[2],r[3],r[4],r[5]);else if(A==="Z")r=[p,m,i,s],c=L5e(r[0],r[1],r[2],r[3],t-d),l=QK(r[0],r[1],r[2],r[3]);if(d<t)h=c;else return!1;d+=l}),h},ZUe=(e,t)=>{let n=g5(e),o=n.slice(0),r=Uw(o),i=o.length-1,s=0,a=0,c=n[0];if(i<=0||!t||!Number.isFinite(t))return{segment:c,index:0,length:a,lengthAtSegment:s};if(t>=r)return o=n.slice(0,-1),s=Uw(o),a=r-s,c=n[i],{segment:c,index:i,length:a,lengthAtSegment:s};let l=[];while(i>0)c=o[i],o=o.slice(0,-1),s=Uw(o),a=r-s,r=s,l.push({segment:c,index:i,length:a,lengthAtSegment:s}),i-=1;return l.find(({lengthAtSegment:h})=>h<=t)},e4e=(e,t)=>{let n=g5(e),o=U9(n),r=Uw(o),i=(y)=>{let x=y.x-t.x,C=y.y-t.y;return x*x+C*C},s=8,a,c={x:0,y:0},l=0,h=0,d=1/0;for(let y=0;y<=r;y+=s)if(a=cae(o,y),l=i(a),l<d)c=a,h=y,d=l;s/=2;let u,_,p=0,m=0,A=0,g=0;while(s>0.000001){if(p=h-s,u=cae(o,p),A=i(u),m=h+s,_=cae(o,m),g=i(_),p>=0&&A<d)c=u,h=p,d=A;else if(m<=r&&g<d)c=_,h=m,d=g;else s/=2;if(s<0.00001)break}let f=ZUe(n,h);return{closest:c,distance:Math.sqrt(d),segment:f}},dtr=(e,t)=>e4e(e,t).closest,utr=(e,t,n,o,r,i,s,a)=>3*((a-t)*(n+r)-(s-e)*(o+i)+o*(e-r)-n*(t-i)+a*(r+e/3)-s*(i+t/3))/20,QRt=(e)=>{let t=0,n=0,o=0;return oQ(e).map((r)=>{switch(r[0]){case"M":return[,t,n]=r,0;default:return o=utr(t,n,r[1],r[2],r[3],r[4],r[5],r[6]),[t,n]=r.slice(-2),o}}).reduce((r,i)=>r+i,0)},ptr=(e)=>QRt(oQ(e))>=0,mtr=(e,t)=>ZUe(e,t).segment,_tr=(e,t)=>e4e(e,t).segment,gae=(e)=>Array.isArray(e)&&e.every((t)=>{let n=t[0].toLowerCase();return NK[n]===t.length-1&&"achlmqstvz".includes(n)&&t.slice(1).every(Number.isFinite)})&&e.length>0,kRt=(e)=>gae(e)&&e.every(([t])=>t===t.toUpperCase()),t4e=(e)=>kRt(e)&&e.every(([t])=>"ACLMQZ".includes(t)),dae=(e)=>t4e(e)&&e.every(([t])=>"MLVHZ".includes(t)),gtr=(e)=>t4e(e)&&e.every(([t])=>"MC".includes(t)),Atr=(e,t)=>{let{distance:n}=e4e(e,t);return Math.abs(n)<JUe},ftr=(e)=>gae(e)&&e.slice(1).every(([t])=>t===t.toLowerCase()),LRt=(e)=>{if(typeof e!=="string"||!e.length)return!1;let t=new $Ue(e);RK(t);while(t.index<t.max&&!t.err.length)KUe(t);return!t.err.length&&"mM".includes(t.segments[0][0])};function LK(e){let t=[],[n,o]=[0,0];return Wy(e,(r)=>{let i=r[0];if(i==="M")[n,o]=[r[1],r[2]],t.push([n,o]);else if(i==="L")t.push([r[1],r[2]]);else if(i==="C")t.push([r[5],r[6]]);else if(i==="A")t.push([r[6],r[7]]);else if(i==="Z")t.push([n,o]);else throw TypeError(`${Gg}: path command "${i}" is not supported`)}),t}var uae={line:["x1","y1","x2","y2"],circle:["cx","cy","r"],ellipse:["cx","cy","rx","ry"],rect:["width","height","x","y","rx","ry"],polygon:["points"],polyline:["points"],glyph:["d"]},HRt=(e)=>e!==void 0&&e!==null&&typeof e==="object"&&e.nodeType===1,ytr=(e)=>{let{x1:t,y1:n,x2:o,y2:r}=e;return[t,n,o,r]=[t,n,o,r].map((i)=>+i),[["M",t,n],["L",o,r]]},xtr=(e)=>{let t=[],n=(e.points||"").trim().split(/[\s|,]/).map((r)=>+r),o=0;while(o<n.length)t.push([o?"L":"M",n[o],n[o+1]]),o+=2;return e.type==="polygon"?[...t,["z"]]:t},Ctr=(e)=>{let{cx:t,cy:n,r:o}=e;return[t,n,o]=[t,n,o].map((r)=>+r),[["M",t-o,n],["a",o,o,0,1,0,2*o,0],["a",o,o,0,1,0,-2*o,0]]},btr=(e)=>{let{cx:t,cy:n}=e,o=e.rx||0,r=e.ry||o;return[t,n,o,r]=[t,n,o,r].map((i)=>+i),[["M",t-o,n],["a",o,r,0,1,0,2*o,0],["a",o,r,0,1,0,-2*o,0]]},Itr=(e)=>{let t=+e.x||0,n=+e.y||0,o=+e.width,r=+e.height,i=+(e.rx||0),s=+(e.ry||i);if(i||s){if(i*2>o)i-=(i*2-o)/2;if(s*2>r)s-=(s*2-r)/2;return[["M",t+i,n],["h",o-i*2],["s",i,0,i,s],["v",r-s*2],["s",0,s,-i,s],["h",-o+i*2],["s",-i,0,-i,-s],["v",-r+s*2],["s",0,-s,i,-s]]}return[["M",t,n],["h",o],["v",r],["H",t],["Z"]]},FRt=(e)=>{let t=Object.keys(uae),n=HRt(e),o=n?e.tagName:null;if(o&&[...t,"path"].every((c)=>o!==c))throw TypeError(`${Gg}: "${o}" is not SVGElement`);let r=n?o:e.type,i=uae[r],s={type:r};if(n)i.forEach((c)=>{s[c]=e.getAttribute(c)});else Object.assign(s,e);let a=[];if(r==="circle")a=Ctr(s);else if(r==="ellipse")a=btr(s);else if(["polyline","polygon"].includes(r))a=xtr(s);else if(r==="rect")a=Itr(s);else if(r==="line")a=ytr(s);else if(["glyph","path"].includes(r))a=g5(n?e.getAttribute("d")||"":e.d||"");if(gae(a)&&a.length)return a;return!1},vtr=(e,t,n)=>{let o=n||document,r=Object.keys(uae),i=HRt(e),s=i?e.tagName:null;if(s==="path")throw TypeError(`${Gg}: "${s}" is already SVGPathElement`);if(s&&r.every((p)=>s!==p))throw TypeError(`${Gg}: "${s}" is not SVGElement`);let a=o.createElementNS("http://www.w3.org/2000/svg","path"),c=i?s:e.type,l=uae[c],h={type:c},d=nQ.round,u=FRt(e),_=u&&u.length?FUe(u,d):"";if(i){l.forEach((p)=>{h[p]=e.getAttribute(p)});for(let p=0;p<e.attributes.length;p++){let m=e.attributes[p];if(m&&!l.includes(m.name))a.setAttribute(m.name,m.value)}}else Object.assign(h,e),Object.keys(h).forEach((p)=>{if(!l.includes(p)&&p!=="type")a.setAttribute(p.replace(/[A-Z]/g,(m)=>`-${m.toLowerCase()}`),h[p])});if(LRt(_)){if(a.setAttribute("d",_),t&&i)e.before(a,e),e.remove();return a}return!1},OUe=(e)=>{if(typeof e==="string"){let t=e.match(/[Mm]/g);return t?t.length>1:!1}if(gae(e)){let t=0;for(let n of e)if(n[0].toUpperCase()==="M"){if(t++,t>1)return!0}return!1}throw TypeError(Gg+": expected string or PathArray")};function HK(e){return t4e(e)&&e.every(([t])=>"MLVH".includes(t))}var eWe=(e)=>e[e.length-1][0].toUpperCase()==="Z",zRt=(e,t,n,o)=>{let[r]=e,{round:i}=nQ,s=typeof i==="number"?i:4,a=t.slice(1),{x1:c,y1:l,x2:h,y2:d,x:u,y:_}=n,[p,m]=a.slice(-2),A=e;if(!"TQ".includes(r))n.qx=null,n.qy=null;if(r==="L"){if(Ed(u,s)===Ed(p,s))return["V",m];else if(Ed(_,s)===Ed(m,s))return["H",p]}else if(r==="C"){let[g,f]=a;if(n.x1=g,n.y1=f,"CS".includes(o)&&(Ed(g,s)===Ed(c*2-h,s)&&Ed(f,s)===Ed(l*2-d,s)||Ed(c,s)===Ed(h*2-u,s)&&Ed(l,s)===Ed(d*2-_,s)))return["S",a[2],a[3],a[4],a[5]]}else if(r==="Q"){let[g,f]=a;if(n.qx=g,n.qy=f,"QT".includes(o)&&Ed(g,s)===Ed(c*2-h,s)&&Ed(f,s)===Ed(l*2-d,s))return["T",a[2],a[3]]}return A},G5e=(e,t)=>{let n=e.slice(1).map((o)=>Ed(o,t));return[e[0]].concat(n)},dRt=(e,t)=>{let n=Y5e(e),o=typeof t==="number"&&t>=0?t:2,r={...Z5e},i=[],s="M",a="Z";return Wy(n,(c,l,h,d)=>{r.x=h,r.y=d;let u=J5e(c,r),_=c;if(s=c[0],i[l]=s,l){a=i[l-1];let m=zRt(c,u,r,a),A=G5e(m,o),g=A.join(""),f=qUe(m,l,h,d),y=G5e(f,o),x=y.join("");_=g.length<x.length?A:y}let p=u.length;return r.x1=+u[p-2],r.y1=+u[p-1],r.x2=+u[p-4]||r.x1,r.y2=+u[p-3]||r.y1,_})},VO=(e)=>{let t=Y5e(e),n=U9(t),o=t.length,r=t[o-1][0]==="Z",i=Wy(t,(s,a)=>{let c=n[a],l=a&&t[a-1],h=l&&l[0],d=t[a+1],u=d&&d[0],_=s[0],[p,m]=n[a?a-1:o-1].slice(-2),A=s;switch(_){case"M":A=r?["Z"]:[_,p,m];break;case"A":A=[_,s[1],s[2],s[3],s[4],s[5]===1?0:1,p,m];break;case"C":if(d&&u==="S")A=["S",s[1],s[2],p,m];else A=[_,s[3],s[4],s[1],s[2],p,m];break;case"S":if(h&&"CS".includes(h)&&(!d||u!=="S"))A=["C",c[3],c[4],c[1],c[2],p,m];else A=[_,c[1],c[2],p,m];break;case"Q":if(d&&u==="T")A=["T",p,m];else A=[_,s[1],s[2],p,m];break;case"T":if(h&&"QT".includes(h)&&(!d||u!=="T"))A=["Q",c[1],c[2],p,m];else A=[_,p,m];break;case"Z":A=["M",p,m];break;case"H":A=[_,p];break;case"V":A=[_,m];break;default:A=[_].concat(s.slice(1,-2),p,m)}return A});return r?i.reverse():[i[0]].concat(i.slice(1).reverse())},U5e=(e)=>{let t=[],n=g5(e),o=[],r=-1,i=0,s=0,a=0,c=0;return Wy(n,(l,h,d,u)=>{let _=l[0],p=_.toUpperCase(),m=_===_.toLowerCase(),A=l.slice(1);if(p==="M")r+=1,[i,s]=A,i+=m?d:0,s+=m?u:0,a=i,c=s,o=[m?[p,a,c]:l];else{if(p==="Z")i=a,s=c;else if(p==="H")[,i]=l,i+=m?d:0;else if(p==="V")[,s]=l,s+=m?u:0;else[i,s]=l.slice(-2),i+=m?d:0,s+=m?u:0;o.push(l)}t[r]=o}),t},ORt=(e)=>{let t=new m1,{origin:n}=e,[o,r]=n,{translate:i}=e,{rotate:s}=e,{skew:a}=e,{scale:c}=e;if(Array.isArray(i)&&i.length>=2&&i.every((l)=>!Number.isNaN(+l))&&i.some((l)=>l!==0))t=t.translate(...i);else if(typeof i==="number"&&!Number.isNaN(i))t=t.translate(i);if(s||a||c){if(t=t.translate(o,r),Array.isArray(s)&&s.length>=2&&s.every((l)=>!Number.isNaN(+l))&&s.some((l)=>l!==0))t=t.rotate(...s);else if(typeof s==="number"&&!Number.isNaN(s))t=t.rotate(s);if(Array.isArray(a)&&a.length===2&&a.every((l)=>!Number.isNaN(+l))&&a.some((l)=>l!==0))t=a[0]?t.skewX(a[0]):t,t=a[1]?t.skewY(a[1]):t;else if(typeof a==="number"&&!Number.isNaN(a))t=t.skewX(a);if(Array.isArray(c)&&c.length>=2&&c.every((l)=>!Number.isNaN(+l))&&c.some((l)=>l!==1))t=t.scale(...c);else if(typeof c==="number"&&!Number.isNaN(c))t=t.scale(c);t=t.translate(-o,-r)}return t},Str=(e,t)=>{if(e.is2D)return[e.a*t[0]+e.c*t[1]+e.e*t[3],e.b*t[0]+e.d*t[1]+e.f*t[3],0,1];let n=m1.Translate(t[0],t[1],t[2]);return[,,,n.m44]=t,n=e.multiply(n),[n.m41,n.m42,n.m43,n.m44]},VUe=(e,t,n)=>{let[o,r,i]=n,[s,a,c]=Str(e,[t[0],t[1],0,1]),l=s-o,h=a-r,d=c-i;return[l*(Math.abs(i)/Math.abs(d)||1)+o,h*(Math.abs(i)/Math.abs(d)||1)+r]},Ptr=(e,t,n,o,r,i,s,a,c)=>{let l=[],h=0,d=0,u=0,_=0,p=0,m=0,A=0,g=0;for(let f=0,y=e.length;f<y;f+=1){let x=e[f],C=x[0],b=C.charCodeAt(0),I=b>=97,v=I?String.fromCharCode(b-32):C,P=f===0&&I?C:v;if(v==="Z"){l.push(["Z"]),p=A,m=g;continue}if(v==="V"){let M=x[1]+(I?m:0);if(u=t*p+o*M+i-a+a,_=n*p+r*M+s-c+c,h!==u&&d!==_)l.push(["L",u,_]);else if(d===_)l.push(["H",u]);else if(h===u)l.push(["V",_]);else l.push(["L",p,M]);m=M,h=u,d=_;continue}if(v==="H"){let M=x[1]+(I?p:0);if(u=t*M+o*m+i-a+a,_=n*M+r*m+s-c+c,h!==u&&d!==_)l.push(["L",u,_]);else if(d===_)l.push(["H",u]);else if(h===u)l.push(["V",_]);else l.push(["L",M,m]);p=M,h=u,d=_;continue}if(v==="A"){let M=x[6]+(I?p:0),B=x[7]+(I?m:0),T=_ae(p,m,x[1],x[2],x[3],x[4],x[5],M,B),N=T.length,D=0;if(N>0)do{let L=["C"],H=D+6;for(let V=D;V<H;V+=2)u=t*T[V]+o*T[V+1]+i-a+a,_=n*T[V]+r*T[V+1]+s-c+c,L.push(u,_);l.push(L),D=H}while(D<N);else l.push(["C"]);if(N>0)p=T[N-2],m=T[N-1];else p=M,m=B;h=u,d=_;continue}if(v==="L"){let M=x[1]+(I?p:0),B=x[2]+(I?m:0);if(u=t*M+o*B+i-a+a,_=n*M+r*B+s-c+c,h!==u&&d!==_)l.push(["L",u,_]);else if(d===_)l.push(["H",u]);else if(h===u)l.push(["V",_]);else l.push(["L",M,B]);p=M,m=B,h=u,d=_;continue}{let M=[P],B=x.length;for(let T=1;T<B;T+=2){let N=x[T]+(I?p:0),D=x[T+1]+(I?m:0);u=t*N+o*D+i-a+a,_=n*N+r*D+s-c+c,M.push(u,_)}if(l.push(M),p=x[B-2]+(I?p:0),m=x[B-1]+(I?m:0),v==="M")A=p,g=m;h=u,d=_}}return l},uRt=(e,t)=>{let n=g5(e),o=t&&Object.keys(t);if(!t||o&&!o.length)return n.slice(0);if(!t.origin)Object.assign(t,{origin:nQ.origin});let r=t.origin,i=ORt(t);if(i.isIdentity)return n.slice(0);if(i.is2D)return Ptr(n,i.a,i.b,i.c,i.d,i.e,i.f,r[0],r[1]);let s=0,a=0,c=0,l=0,h=0,d=0;return Wy(n,(u,_,p,m)=>{let[A]=u,g=A.toUpperCase(),f=g!==A?mae(u,_,p,m):u.slice(0),y=g==="A"?["C"].concat(_ae(p,m,f[1],f[2],f[3],f[4],f[5],f[6],f[7])):g==="V"?["L",p,f[1]]:g==="H"?["L",f[1],m]:f;if(y[0]==="C"&&y.length>7){let x=y.slice(0,7);n.splice(_+1,0,["C"].concat(y.slice(7))),y=x}if(y[0]==="L"){if([c,l]=VUe(i,[y[1],y[2]],r),s!==c&&a!==l)y=["L",c,l];else if(a===l)y=["H",c];else if(s===c)y=["V",l]}else for(h=1,d=y.length;h<d;h+=2)[c,l]=VUe(i,[+y[h],+y[h+1]],r),y[h]=c,y[h+1]=l;return s=c,a=l,y})},Etr=(e)=>{let t=e.slice(1).map((n,o,r)=>!o?e[0].slice(1).concat(n.slice(1)):r[o-1].slice(-2).concat(n.slice(1))).map((n)=>n.map((o,r)=>n[n.length-r-2*(1-r%2)])).reverse();return[["M"].concat(t[0].slice(0,2))].concat(t.map((n)=>["C"].concat(n.slice(2))))},YUe=(e,t)=>{let{round:n}=nQ;if(n=t==="off"?t:typeof t==="number"&&t>=0?t:typeof n==="number"&&n>=0?n:"off",n==="off")return e.slice(0);return Wy(e,(o)=>G5e(o,n))},GUe=(e)=>{let t=g5(e);if(eWe(t)){let n=U9(t),o=t.length,r=o-2,[i,s]=n[0].slice(1),[a,c]=n[r].slice(-2);if(i===a&&s===c)t.splice(o-1,1)}};function VRt(e,t,n,o,r,i,s,a,c){let[l,h]=gS([e,t],[n,o],c),[d,u]=gS([n,o],[r,i],c),[_,p]=gS([r,i],[s,a],c),[m,A]=gS([l,h],[d,u],c),[g,f]=gS([d,u],[_,p],c),[y,x]=gS([m,A],[g,f],c);return[[e,t,l,h,m,A,y,x],[y,x,g,f,_,p,s,a]]}var pRt=(e)=>{let t=U9(e);if(!dae(t)&&!HK(t))throw TypeError(`${Gg}: pathValue is not a polyline/polygon`);if(!eWe(t))return t;let n=[t[0]],[o,r]=t[0].slice(1);for(let i=1;i<t.length;i++){let s=t[i];if(s[0].toUpperCase()==="Z")n.push(["L",o,r]);else n.push(s)}return n};function Mtr(e,t,n,o,r){if(r<=1)return[[e,t,n,o]];let i=[],s=n-e,a=o-t,c=e,l=t,h=0;while(h<r){let d=1/(r-h),u=e+d*s,_=t+d*a;i.push([c,l,u,_]),c=u,l=_,h++}return i}function YRt(e,t){if(t<=1)throw TypeError(`${Gg}: target must be >= 2`);let n=Uw(e);if(n===0)return Array(e.length).fill(1);let o=n/t,r=HK(e),i=[1],s=[0];Wy(e,(l,h,d,u)=>{if(h>0){let[_,p]=l.slice(-2),m=r?QK(d,u,_,p):YO(d,u,l[1],l[2],l[3],l[4],l[5],l[6]);s.push(m),i.push(1)}});let a=1;for(let l=1;l<s.length;l++){let h=s[l],d=h>o?Math.round(h/o):1;i[l]=d,a+=d}let c=t-a;if(c!==0){let l=[];for(let d=1;d<s.length;d++)if(s[d]>0)l.push([d,s[d]]);let h=l.length;if(c<0){l.sort((d,u)=>d[1]-u[1]);for(let d=0;d<h;d++){let u=l[d][0];if(i[u]>1&&l[d][1]>0)i[u]--,c++;if(c===0)break;else if(d===h-1)d=0}}else if(c>0){l.sort((d,u)=>u[1]-d[1]);for(let d=0;d<h;d++){let u=l[d][0];if(l[d][1]>0)i[u]++,c--;if(c===0)break;else if(d===h-1)d=0}}}return i}function mRt(e,t){if(e.length<2||t<=1)return e;let n=YRt(e,t),o=0,r=[e[0]],i=e.length,s=e[0][1],a=e[0][2];for(let c=1;c<i;c++){let[l,h]=e[c].slice(1),d=n[c];if(d>=1){let u=Mtr(s,a,l,h,d);for(let _ of u)r.push(["L",_[2],_[3]]),o++}s=l,a=h}if(r.length!==t)console.warn(`${Gg}: requested ${t} segments, got ${r.length}. Adjusted on last segment.`);return r}function wtr(e,t,n,o,r,i,s,a,c){if(c<=1)return[[e,t,n,o,r,i,s,a]];let l=[],h=e,d=t,u=n,_=o,p=r,m=i,A=s,g=a,f=0;while(f<c){let y=1/(c-f),[x,C]=VRt(h,d,u,_,p,m,A,g,y);l.push(x),[h,d,u,_,p,m,A,g]=C,f++}return l}function _Rt(e,t){if(e.length<2||t<=1)return e;let n=YRt(e,t),o=0,r=[e[0]],i=e.length,s=e[0][1],a=e[0][2];for(let c=1;c<i;c++){let l=e[c],[h,d]=l.slice(-2),u=n[c];if(u>=1){let _=wtr(s,a,l[1],l[2],l[3],l[4],l[5],l[6],u);for(let p of _)r.push(["C",p[2],p[3],p[4],p[5],p[6],p[7]]),o++}s=h,a=d}if(r.length!==t)console.warn(`${Gg}: requested ${t} segments, got ${r.length}.`);return r}function Btr(e){let t=e.length,n=t-1,o,r=[];for(let i=0;i<t;i++){o=[];for(let s=0;s<t;s++){let a=i+s,c;if(s===0||e[a]&&e[a][0]==="M"){c=e[a],o.push(["M",...c.slice(-2)]);continue}if(a>=t)a-=n;o.push(e[a])}r.push(o)}return r}function Ttr(e,t,n){let o=n||Btr(e);if(e.length!==t.length)throw TypeError(Gg+": paths must have the same number of segments after equalization");let r=0,i=1/0;for(let s=0;s<o.length;s++){let a=o[s],c=a.length,l=0;for(let h=0;h<c;h++){let d=a[h],u=t[h],_=d.slice(-2),p=u.slice(-2),m=_[0]-p[0],A=_[1]-p[1];l+=m*m+A*A}if(l<i)i=l,r=s}return o[r]}var Dtr={mode:"auto",sampleSize:10,roundValues:4,reverse:!0,close:!1,target:void 0},UUe=(e,t,n={})=>{let{close:o,mode:r,reverse:i,roundValues:s,target:a}=Object.assign(Dtr,n),c=U9(e),l=U9(t);GUe(c),GUe(l);let h=(dae(c)||HK(c))&&(dae(l)||HK(l));if(h&&r==="auto")c=pRt(c),l=pRt(l);else h=!1,c=oQ(c),l=oQ(l);let d=kK(LK(c)),u=kK(LK(l));if(i!==!1&&Math.sign(d)!==Math.sign(u))l=VO(l);let _=c.length,p=l.length,m=Math.max(_,p),A=m;if(typeof a!=="number"){let y=(Uw(c)+Uw(l))/2,x=y/Math.max(_,p),C=Math.max(m,Math.round(y/Math.max(x,1)));A=Math.min(C,Math.max(_,p)*3)}else if(a>=m)A=a;else console.warn('equalizeSegments "target" option: '+a+", expected >= "+m);let g=c,f=l;if(h)g=mRt(c,A),f=mRt(l,A);else g=_Rt(c,A),f=_Rt(l,A);if(f=Ttr(f,g),typeof s==="number"&&s!==4)g=YUe(g,s),f=YUe(f,s);if(o)g.push(["Z"]),f.push(["Z"]);return[g,f]},G9=(e,[t,n])=>{let[o,r,i,s]=e;return t>=o&&t<=i&&n>=r&&n<=s},tWe=(e,t)=>{let[n,o,r,i]=e,[s,a,c,l]=t;return G9(t,[n,o])||G9(t,[r,o])||G9(t,[n,i])||G9(t,[r,i])||G9(e,[s,a])||G9(e,[c,a])||G9(e,[s,l])||G9(e,[c,l])||(n<c&&n>s||s<r&&s>n)&&(o<l&&o>a||a<i&&a>o)},gRt=([e,t])=>[["M",e,t],["L",e+0.001,t],["L",e+0.001,t+0.001],["L",e,t+0.001],["L",e,t],["Z"]];function Ntr(e,t){let n=e.bbox,o=[];for(let i=0;i<t.length;i++){let{bbox:s,size:a}=t[i],c=n.cx-s.cx,l=n.cy-s.cy,h=Math.sqrt(c*c+l*l),d=Math.abs(e.size-a)/Math.max(e.size,a,0.000001),u=G9([n.x,n.y,n.x2,n.y2],[s.cx,s.cy])||G9([s.x,s.y,s.x2,s.y2],[n.cx,n.cy]),_=tWe([n.x,n.y,n.x2,n.y2],[s.x,s.y,s.x2,s.y2]);o.push({index:i,hasOverlap:u,boxIntersect:_,sizeDifference:d,centeredDistance:h})}let r=o.filter((i)=>i.hasOverlap&&i.boxIntersect);if(r.length>0){let i=r[0];for(let s=1;s<r.length;s++)if(r[s].centeredDistance<i.centeredDistance)i=r[s];return t.splice(i.index,1)[0]}return null}function ARt(e,t){let n=[];e.sort((o,r)=>r.size-o.size),t.sort((o,r)=>r.size-o.size);while(e.length>0){let o=e.shift(),r=Ntr(o,t);if(r)n.push([o.path,r.path]);else{let i=[o.bbox.cx,o.bbox.cy];n.push([o.path,gRt(i)])}}while(t.length>0){let o=t.shift(),r=[o.bbox.cx,o.bbox.cy];n.push([gRt(r),o.path])}return n}var fRt=(e)=>{let t=[],n=[];for(let o of e){let r=kK(LK(o)),i=zUe(o),s={isPoly:dae(o)||HK(o),size:i.width*i.height,path:o,signedArea:r,area:Math.abs(r),bbox:i};if(r>0)t.push(s);else n.push(s)}return{outers:t,inners:n}},Rtr={mode:"auto",roundValues:4,close:!1,sampleSize:10},Qtr=(e,t,n={})=>{let o=Object.assign(Rtr,n),r=U9(e),i=U9(t),s=OUe(r),a=OUe(i);if(!s&&!a)return UUe(r,i,o);let c=kK(LK(r)),l=kK(LK(i)),h=r,d=i;if(Math.sign(c)<0)h=VO(h);if(Math.sign(l)<0)d=VO(d);let u=U5e(h),_=U5e(d),{outers:p,inners:m}=fRt(u),{outers:A,inners:g}=fRt(_),f=ARt(p,A),y=ARt(m,g),x=[];for(let[C,b]of[...f,...y]){let[I,v]=UUe(C,b,{...o,reverse:!1});x.push([I,v])}return[x.map((C)=>C[0]).flat(),x.map((C)=>C[1]).flat()]},ktr=(e,t,n,o,r,i,s,a)=>{if(Math.max(e,n)<Math.min(r,s)||Math.min(e,n)>Math.max(r,s)||Math.max(t,o)<Math.min(i,a)||Math.min(t,o)>Math.max(i,a))return;let c=(e*o-t*n)*(r-s)-(e-n)*(r*a-i*s),l=(e*o-t*n)*(i-a)-(t-o)*(r*a-i*s),h=(e-n)*(i-a)-(t-o)*(r-s);if(!h)return;let d=c/h,u=l/h,_=Ed(d,2),p=Ed(u,2);if(_<Ed(Math.min(e,n),2)||_>Ed(Math.max(e,n),2)||_<Ed(Math.min(r,s),2)||_>Ed(Math.max(r,s),2)||p<Ed(Math.min(t,o),2)||p>Ed(Math.max(t,o),2)||p<Ed(Math.min(i,a),2)||p>Ed(Math.max(i,a),2))return;return{x:d,y:u}},Ltr=(e,t,n)=>{let o=hae(...e),r=hae(...t),{justCount:i,epsilon:s}=Object.assign({justCount:!0,epsilon:JUe},n);if(!tWe(o,r))return i?0:[];let a=YO(...e),c=YO(...t),l=Math.max(a/5>>0,1),h=Math.max(c/5>>0,1),d=[],u=[],_={},p=i?0:[];for(let m=0;m<l+1;m++){let A=O5e(...e,m/l*a);d.push({x:A.x,y:A.y,t:m/l})}for(let m=0;m<h+1;m++){let A=O5e(...t,m/h*c);u.push({x:A.x,y:A.y,t:m/h})}for(let m=0;m<l;m++)for(let A=0;A<h;A++){let g=1+s,f=d[m],y=d[m+1],x=u[A],C=u[A+1],b=Math.abs(y.x-f.x)<0.001?"y":"x",I=Math.abs(C.x-x.x)<0.001?"y":"x",v=ktr(f.x,f.y,y.x,y.y,x.x,x.y,C.x,C.y);if(v){if(_[v.x.toFixed(4)]==v.y.toFixed(4))continue;_[v.x.toFixed(4)]=v.y.toFixed(4);let P=f.t+Math.abs((v[b]-f[b])/(y[b]-f[b]))*(y.t-f.t),M=x.t+Math.abs((v[I]-x[I])/(C[I]-x[I]))*(C.t-x.t);if(P>=0&&P<=g&&M>=0&&M<=g)if(i)p++;else p.push({x:v.x,y:v.y,t1:Math.min(P,1),t2:Math.min(M,1)})}}return p},Htr=(e,t,n=!0)=>{let o=oQ(e),r=oQ(t),i=0,s=0,a=0,c=0,l=0,h=0,d=0,u=0,_=[i,s,i,s,l,h,l,h],p=[a,c,a,c,d,u,d,u],m=0,A=[],g=o.length,f=r.length;for(let y=0;y<g;y++){let x=o[y];if(x[0]=="M")i=x[1],s=x[2],l=i,h=s;else{if(x[0]=="C")_=[i,s,x[1],x[2],x[3],x[4],x[5],x[6]],i=_[6],s=_[7];else _=[i,s,i,s,l,h,l,h],i=l,s=h;for(let C=0;C<f;C++){let b=r[C];if(b[0]=="M")a=b[1],c=b[2],d=a,u=c;else if(b[0]=="C")p=[a,c,b[1],b[2],b[3],b[4],b[5],b[6]],a=p[6],c=p[7];let I=Ltr(_,p,{justCount:n});if(n)m+=I;else A.push(...I)}}}return n?m:A},Ftr=class{constructor(e,t){let n=t||{},o=typeof e>"u";if(o||!e.length)throw TypeError(`${Gg}: "pathValue" is ${o?"undefined":"empty"}`);this.segments=g5(e);let{round:r,origin:i}=n,s;if(Number.isInteger(r)||r==="off")s=r;else s=nQ.round;let a=nQ.origin;if(Array.isArray(i)&&i.length>=2){let[c,l,h]=i.map(Number);a=[!Number.isNaN(c)?c:0,!Number.isNaN(l)?l:0,!Number.isNaN(h)?h:0]}return this.round=s,this.origin=a,this}get bbox(){return zUe(this.segments)}get length(){return Uw(this.segments)}getBBox(){return this.bbox}getTotalLength(){return this.length}getPointAtLength(e){return cae(this.segments,e)}toAbsolute(){let{segments:e}=this;return this.segments=Y5e(e),this}toRelative(){let{segments:e}=this;return this.segments=hRt(e),this}toCurve(){let{segments:e}=this;return this.segments=oQ(e),this}reverse(e){let{segments:t}=this,n=U5e(t),o=n.length>1?n:!1,r=o?o.map((s,a)=>{if(e)return a?VO(s):s.slice(0);return VO(s)}):t.slice(0),i=[];if(o)i=r.flat(1);else i=e?t:VO(t);return this.segments=i.slice(0),this}normalize(){let{segments:e}=this;return this.segments=U9(e),this}optimize(){let{segments:e}=this,t=this.round==="off"?2:this.round;return this.segments=dRt(e,t),this}transform(e){if(!e||typeof e!=="object"||typeof e==="object"&&!["translate","rotate","skew","scale"].some((a)=>(a in e)))return this;let{segments:t,origin:[n,o,r]}=this,i={};for(let[a,c]of Object.entries(e))if(a==="skew"&&Array.isArray(c))i[a]=c.map(Number);else if((a==="rotate"||a==="translate"||a==="origin"||a==="scale")&&Array.isArray(c))i[a]=c.map(Number);else if(a!=="origin"&&typeof Number(c)==="number")i[a]=Number(c);let{origin:s}=i;if(Array.isArray(s)&&s.length>=2){let[a,c,l]=s.map(Number);i.origin=[!Number.isNaN(a)?a:n,!Number.isNaN(c)?c:o,l||r]}else i.origin=[n,o,r];return this.segments=uRt(t,i),this}flipX(){let{cx:e,cy:t}=this.bbox;return this.transform({rotate:[0,180,0],origin:[e,t,0]}),this}flipY(){let{cx:e,cy:t}=this.bbox;return this.transform({rotate:[180,0,0],origin:[e,t,0]}),this}toString(){return FUe(this.segments,this.round)}dispose(){Object.keys(this).forEach((e)=>delete this[e])}static options=nQ;static CSSMatrix=m1;static arcTools=rtr;static bezierTools=ntr;static cubicTools=itr;static lineTools=Zer;static polygonTools=ltr;static quadTools=str;static pathToAbsolute=Y5e;static pathToRelative=hRt;static pathToCurve=oQ;static pathToString=FUe;static distanceSquareRoot=W5e;static midPoint=gS;static rotateVector=aae;static roundTo=Ed;static parsePathString=g5;static finalizeSegment=LUe;static invalidPathValue=tQ;static isArcCommand=TRt;static isDigit=eQ;static isDigitStart=BRt;static isMoveCommand=DRt;static isPathCommand=wRt;static isSpace=MRt;static paramsCount=NK;static paramsParser=Z5e;static PathParser=$Ue;static scanFlag=PRt;static scanParam=ERt;static scanSegment=KUe;static skipSpaces=RK;static distanceEpsilon=JUe;static fixPath=GUe;static getClosestPoint=dtr;static getDrawDirection=ptr;static getPathArea=QRt;static getPathBBox=zUe;static getPointAtLength=cae;static getPropertiesAtLength=ZUe;static getPropertiesAtPoint=e4e;static getSegmentAtLength=mtr;static getSegmentOfPoint=_tr;static getTotalLength=Uw;static isAbsoluteArray=kRt;static isCurveArray=gtr;static isPolygonArray=dae;static isNormalizedArray=t4e;static isPathArray=gae;static isPointInStroke=Atr;static isRelativeArray=ftr;static isValidPath=LRt;static samplePolygon=LK;static shapeParams=uae;static shapeToPath=vtr;static shapeToPathArray=FRt;static absolutizeSegment=mae;static arcToCubic=_ae;static getSVGMatrix=ORt;static iterate=Wy;static lineToCubic=HUe;static normalizePath=U9;static normalizeSegment=J5e;static optimizePath=dRt;static projection2d=VUe;static quadToCubic=NRt;static relativizeSegment=qUe;static reverseCurve=Etr;static reversePath=VO;static roundPath=YUe;static roundSegment=G5e;static segmentToCubic=RRt;static shortenSegment=zRt;static splitPath=U5e;static equalizePaths=Qtr;static equalizeSegments=UUe;static splitCubicSegment=VRt;static transformPath=uRt;static isPointInsideBBox=G9;static pathsIntersection=Htr;static boundingBoxIntersect=tWe;static isMultiPath=OUe;static isClosedPath=eWe;static isPolylineArray=HK;static version=Jer};var FK=Ftr;qt();$p();qt();K0();var A6=at(ln(),1);be();var hm=at(fS(),1),I3n=at(bWe(),1);qt();be();qt();var lZ=at(fS(),1);function iQ(){return new IWe}class IWe{index={};array=[];size(){return this.array.length}empty(){return this.array.length===0}itemAt(e){return this.array[e]}contains(e){return this.index[e.id()]!==void 0}find(e){let t=this.index[e.id()];return t===void 0?void 0:this.array[t]}setDefault(e,t){let n=this.index[e.id()];if(n===void 0){let o=new r4e(e,t());return this.index[e.id()]=this.array.length,this.array.push(o),o}else return this.array[n]}insert(e,t){let n=new r4e(e,t),o=this.index[e.id()];if(o===void 0)this.index[e.id()]=this.array.length,this.array.push(n);else this.array[o]=n;return n}erase(e){let t=this.index[e.id()];if(t===void 0)return;this.index[e.id()]=void 0;let n=this.array[t],o=this.array.pop();if(n!==o)this.array[t]=o,this.index[o.first.id()]=t;return n}copy(){let e=new IWe;for(let t=0;t<this.array.length;t++){let n=this.array[t].copy();e.array[t]=n,e.index[n.first.id()]=t}return e}}class r4e{first;second;constructor(e,t){this.first=e,this.second=t}copy(){return new r4e(this.first,this.second)}}class sQ{constructor(e=""){this._name=e}id(){return this._id}name(){return this._name}setName(e){this._name=e}context(){return this._context}setContext(e){this._context=e}value(){return this._value}setValue(e){this._value=e}plus(e){return new Md(this,e)}minus(e){return new Md(this,typeof e==="number"?-e:[-1,e])}multiply(e){return new Md([e,this])}divide(e){return new Md([1/e,this])}toJSON(){return{name:this._name,value:this._value}}toString(){return this._context+"["+this._name+":"+this._value+"]"}_name;_value=0;_context=null;_id=Vur++}var Vur=0;class Md{constructor(){let e=Yur(arguments);this._terms=e.terms,this._constant=e.constant}terms(){return this._terms}constant(){return this._constant}value(){let e=this._constant;for(let t=0,n=this._terms.size();t<n;t++){let o=this._terms.itemAt(t);e+=o.first.value()*o.second}return e}plus(e){return new Md(this,e)}minus(e){return new Md(this,typeof e==="number"?-e:[-1,e])}multiply(e){return new Md([e,this])}divide(e){return new Md([1/e,this])}isConstant(){return this._terms.size()==0}toString(){let e=this._terms.array.map(function(t){return t.second+"*"+t.first.toString()}).join(" + ");if(!this.isConstant()&&this._constant!==0)e+=" + ";return e+=this._constant,e}_terms;_constant}function Yur(e){let t=0,n=()=>0,o=iQ();for(let r=0,i=e.length;r<i;++r){let s=e[r];if(typeof s==="number")t+=s;else if(s instanceof sQ)o.setDefault(s,n).second+=1;else if(s instanceof Md){t+=s.constant();let a=s.terms();for(let c=0,l=a.size();c<l;c++){let h=a.itemAt(c);o.setDefault(h.first,n).second+=h.second}}else if(s instanceof Array){if(s.length!==2)throw Error("array must have length 2");let a=s[0],c=s[1];if(typeof a!=="number")throw Error("array item 0 must be a number");if(c instanceof sQ)o.setDefault(c,n).second+=a;else if(c instanceof Md){t+=c.constant()*a;let l=c.terms();for(let h=0,d=l.size();h<d;h++){let u=l.itemAt(h);o.setDefault(u.first,n).second+=u.second*a}}else throw Error("array item 1 must be a variable or expression")}else throw Error("invalid Expression argument: "+s)}return{terms:o,constant:t}}class Oh{static create(e,t,n,o=1){let r=0;return r+=Math.max(0,Math.min(1000,e*o))*1e6,r+=Math.max(0,Math.min(1000,t*o))*1000,r+=Math.max(0,Math.min(1000,n*o)),r}static required=Oh.create(1000,1000,1000);static strong=Oh.create(1,0,0);static medium=Oh.create(0,1,0);static weak=Oh.create(0,0,1);static clip(e){return Math.max(0,Math.min(Oh.required,e))}}var tm;(function(e){e[e.Le=0]="Le",e[e.Ge=1]="Ge",e[e.Eq=2]="Eq"})(tm||(tm={}));class XA{constructor(e,t,n,o=Oh.required){if(this._operator=t,this._strength=Oh.clip(o),n===void 0&&e instanceof Md)this._expression=e;else this._expression=e.minus(n)}id(){return this._id}expression(){return this._expression}op(){return this._operator}strength(){return this._strength}toString(){return this._expression.toString()+" "+["<=",">=","="][this._operator]+" 0 ("+this._strength.toString()+")"}_expression;_operator;_strength;_id=Gur++}var Gur=0;class fae{maxIterations=1000;constructor(){}createConstraint(e,t,n,o=Oh.required){let r=new XA(e,t,n,o);return this.addConstraint(r),r}addConstraint(e){if(this._cnMap.find(e)!==void 0)throw Error("duplicate constraint");let n=this._createRow(e),{row:o,tag:r}=n,i=this._chooseSubject(o,r);if(i.type()===Ul.Invalid&&o.allDummies())if(!i4e(o.constant()))throw Error("unsatisfiable constraint");else i=r.marker;if(i.type()===Ul.Invalid){if(!this._addWithArtificialVariable(o))throw Error("unsatisfiable constraint")}else o.solveFor(i),this._substitute(i,o),this._rowMap.insert(i,o);this._cnMap.insert(e,r),this._optimize(this._objective)}removeConstraint(e){let t=this._cnMap.erase(e);if(t===void 0)throw Error("unknown constraint");this._removeConstraintEffects(e,t.second);let n=t.second.marker,o=this._rowMap.erase(n);if(o===void 0){let r=this._getMarkerLeavingSymbol(n);if(r.type()===Ul.Invalid)throw Error("failed to find leaving row");o=this._rowMap.erase(r),o.second.solveForEx(r,n),this._substitute(n,o.second)}this._optimize(this._objective)}hasConstraint(e){return this._cnMap.contains(e)}getConstraints(){return this._cnMap.array.map(({first:e})=>e)}addEditVariable(e,t){if(this._editMap.find(e)!==void 0)throw Error("duplicate edit variable");if(t=Oh.clip(t),t===Oh.required)throw Error("bad required strength");let o=new Md(e),r=new XA(o,tm.Eq,void 0,t);this.addConstraint(r);let s={tag:this._cnMap.find(r).second,constraint:r,constant:0};this._editMap.insert(e,s)}removeEditVariable(e){let t=this._editMap.erase(e);if(t===void 0)throw Error("unknown edit variable");this.removeConstraint(t.second.constraint)}hasEditVariable(e){return this._editMap.contains(e)}suggestValue(e,t){let n=this._editMap.find(e);if(n===void 0)throw Error("unknown edit variable");let o=this._rowMap,r=n.second,i=t-r.constant;r.constant=t;let s=r.tag.marker,a=o.find(s);if(a!==void 0){if(a.second.add(-i)<0)this._infeasibleRows.push(s);this._dualOptimize();return}let c=r.tag.other;if(a=o.find(c),a!==void 0){if(a.second.add(i)<0)this._infeasibleRows.push(c);this._dualOptimize();return}for(let l=0,h=o.size();l<h;++l){let d=o.itemAt(l),u=d.second,_=u.coefficientFor(s);if(_!==0&&u.add(i*_)<0&&d.first.type()!==Ul.External)this._infeasibleRows.push(d.first)}this._dualOptimize()}updateVariables(){let e=this._varMap,t=this._rowMap;for(let n=0,o=e.size();n<o;++n){let r=e.itemAt(n),i=t.find(r.second);if(i!==void 0)r.first.setValue(i.second.constant());else r.first.setValue(0)}}_getVarSymbol(e){let t=()=>this._makeSymbol(Ul.External);return this._varMap.setDefault(e,t).second}_createRow(e){let t=e.expression(),n=new s4e(t.constant()),o=t.terms();for(let a=0,c=o.size();a<c;++a){let l=o.itemAt(a);if(!i4e(l.second)){let h=this._getVarSymbol(l.first),d=this._rowMap.find(h);if(d!==void 0)n.insertRow(d.second,l.second);else n.insertSymbol(h,l.second)}}let r=this._objective,i=e.strength(),s={marker:aQ,other:aQ};switch(e.op()){case tm.Le:case tm.Ge:{let a=e.op()===tm.Le?1:-1,c=this._makeSymbol(Ul.Slack);if(s.marker=c,n.insertSymbol(c,a),i<Oh.required){let l=this._makeSymbol(Ul.Error);s.other=l,n.insertSymbol(l,-a),r.insertSymbol(l,i)}break}case tm.Eq:{if(i<Oh.required){let a=this._makeSymbol(Ul.Error),c=this._makeSymbol(Ul.Error);s.marker=a,s.other=c,n.insertSymbol(a,-1),n.insertSymbol(c,1),r.insertSymbol(a,i),r.insertSymbol(c,i)}else{let a=this._makeSymbol(Ul.Dummy);s.marker=a,n.insertSymbol(a)}break}}if(n.constant()<0)n.reverseSign();return{row:n,tag:s}}_chooseSubject(e,t){let n=e.cells();for(let r=0,i=n.size();r<i;++r){let s=n.itemAt(r);if(s.first.type()===Ul.External)return s.first}let o=t.marker.type();if(o===Ul.Slack||o===Ul.Error){if(e.coefficientFor(t.marker)<0)return t.marker}if(o=t.other.type(),o===Ul.Slack||o===Ul.Error){if(e.coefficientFor(t.other)<0)return t.other}return aQ}_addWithArtificialVariable(e){let t=this._makeSymbol(Ul.Slack);this._rowMap.insert(t,e.copy()),this._artificial=e.copy(),this._optimize(this._artificial);let n=i4e(this._artificial.constant());this._artificial=null;let o=this._rowMap.erase(t);if(o!==void 0){let i=o.second;if(i.isConstant())return n;let s=this._anyPivotableSymbol(i);if(s.type()===Ul.Invalid)return!1;i.solveForEx(t,s),this._substitute(s,i),this._rowMap.insert(s,i)}let r=this._rowMap;for(let i=0,s=r.size();i<s;++i)r.itemAt(i).second.removeSymbol(t);return this._objective.removeSymbol(t),n}_substitute(e,t){let n=this._rowMap;for(let o=0,r=n.size();o<r;++o){let i=n.itemAt(o);if(i.second.substitute(e,t),i.second.constant()<0&&i.first.type()!==Ul.External)this._infeasibleRows.push(i.first)}if(this._objective.substitute(e,t),this._artificial)this._artificial.substitute(e,t)}_optimize(e){let t=0;while(t<this.maxIterations){let n=this._getEnteringSymbol(e);if(n.type()===Ul.Invalid)return;let o=this._getLeavingSymbol(n);if(o.type()===Ul.Invalid)throw Error("the objective is unbounded");let r=this._rowMap.erase(o).second;r.solveForEx(o,n),this._substitute(n,r),this._rowMap.insert(n,r),t++}throw Error("solver iterations exceeded")}_dualOptimize(){let e=this._rowMap,t=this._infeasibleRows;while(t.length!==0){let n=t.pop(),o=e.find(n);if(o!==void 0&&o.second.constant()<0){let r=this._getDualEnteringSymbol(o.second);if(r.type()===Ul.Invalid)throw Error("dual optimize failed");let i=o.second;e.erase(n),i.solveForEx(n,r),this._substitute(r,i),e.insert(r,i)}}}_getEnteringSymbol(e){let t=e.cells();for(let n=0,o=t.size();n<o;++n){let r=t.itemAt(n),i=r.first;if(r.second<0&&i.type()!==Ul.Dummy)return i}return aQ}_getDualEnteringSymbol(e){let t=Number.MAX_VALUE,n=aQ,o=e.cells();for(let r=0,i=o.size();r<i;++r){let s=o.itemAt(r),{first:a,second:c}=s;if(c>0&&a.type()!==Ul.Dummy){let h=this._objective.coefficientFor(a)/c;if(h<t)t=h,n=a}}return n}_getLeavingSymbol(e){let t=Number.MAX_VALUE,n=aQ,o=this._rowMap;for(let r=0,i=o.size();r<i;++r){let s=o.itemAt(r),a=s.first;if(a.type()!==Ul.External){let c=s.second,l=c.coefficientFor(e);if(l<0){let h=-c.constant()/l;if(h<t)t=h,n=a}}}return n}_getMarkerLeavingSymbol(e){let t=Number.MAX_VALUE,n=t,o=t,r=aQ,i=r,s=r,a=r,c=this._rowMap;for(let l=0,h=c.size();l<h;++l){let d=c.itemAt(l),u=d.second,_=u.coefficientFor(e);if(_===0)continue;let p=d.first;if(p.type()===Ul.External)a=p;else if(_<0){let m=-u.constant()/_;if(m<n)n=m,i=p}else{let m=u.constant()/_;if(m<o)o=m,s=p}}if(i!==r)return i;if(s!==r)return s;return a}_removeConstraintEffects(e,t){if(t.marker.type()===Ul.Error)this._removeMarkerEffects(t.marker,e.strength());if(t.other.type()===Ul.Error)this._removeMarkerEffects(t.other,e.strength())}_removeMarkerEffects(e,t){let n=this._rowMap.find(e);if(n!==void 0)this._objective.insertRow(n.second,-t);else this._objective.insertSymbol(e,-t)}_anyPivotableSymbol(e){let t=e.cells();for(let n=0,o=t.size();n<o;++n){let r=t.itemAt(n),i=r.first.type();if(i===Ul.Slack||i===Ul.Error)return r.first}return aQ}_makeSymbol(e){return new vWe(e,this._idTick++)}_cnMap=Uur();_rowMap=Wur();_varMap=Xur();_editMap=jur();_infeasibleRows=[];_objective=new s4e;_artificial=null;_idTick=0}function i4e(e){let t=0.00000001;return e<0?-e<t:e<t}function Uur(){return iQ()}function Wur(){return iQ()}function Xur(){return iQ()}function jur(){return iQ()}var Ul;(function(e){e[e.Invalid=0]="Invalid",e[e.External=1]="External",e[e.Slack=2]="Slack",e[e.Error=3]="Error",e[e.Dummy=4]="Dummy"})(Ul||(Ul={}));class vWe{constructor(e,t){this._id=t,this._type=e}id(){return this._id}type(){return this._type}_id;_type}var aQ=new vWe(Ul.Invalid,-1);class s4e{constructor(e=0){this._constant=e}cells(){return this._cellMap}constant(){return this._constant}isConstant(){return this._cellMap.empty()}allDummies(){let e=this._cellMap;for(let t=0,n=e.size();t<n;++t)if(e.itemAt(t).first.type()!==Ul.Dummy)return!1;return!0}copy(){let e=new s4e(this._constant);return e._cellMap=this._cellMap.copy(),e}add(e){return this._constant+=e}insertSymbol(e,t=1){let n=this._cellMap.setDefault(e,()=>0);if(i4e(n.second+=t))this._cellMap.erase(e)}insertRow(e,t=1){this._constant+=e._constant*t;let n=e._cellMap;for(let o=0,r=n.size();o<r;++o){let i=n.itemAt(o);this.insertSymbol(i.first,i.second*t)}}removeSymbol(e){this._cellMap.erase(e)}reverseSign(){this._constant=-this._constant;let e=this._cellMap;for(let t=0,n=e.size();t<n;++t){let o=e.itemAt(t);o.second=-o.second}}solveFor(e){let t=this._cellMap,o=-1/t.erase(e).second;this._constant*=o;for(let r=0,i=t.size();r<i;++r)t.itemAt(r).second*=o}solveForEx(e,t){this.insertSymbol(e,-1),this.solveFor(t)}coefficientFor(e){let t=this._cellMap.find(e);return t!==void 0?t.second:0}substitute(e,t){let n=this._cellMap.erase(e);if(n!==void 0)this.insertRow(t,n.second)}_cellMap=iQ();_constant}var E3n=at(j0(),1);er();er();qt();qt();qt();var N3n=at(j0(),1),zrt=at(ln(),1),Q3n=at(ln(),1);qt();er();qt();er();bp();K0();er();qt();var cLt=()=>({minX:Number.POSITIVE_INFINITY,maxX:Number.NEGATIVE_INFINITY,minY:Number.POSITIVE_INFINITY,maxY:Number.NEGATIVE_INFINITY}),WO=(e,t,n)=>{e.minX=Math.min(e.minX,t),e.maxX=Math.max(e.maxX,t),e.minY=Math.min(e.minY,n),e.maxY=Math.max(e.maxY,n)},UO=(e,t,n,o,r)=>{WO(e,t-o/2,n-r/2),WO(e,t+o/2,n+r/2)},lLt=(e)=>Number.isFinite(e.minX)&&Number.isFinite(e.maxX)&&Number.isFinite(e.minY)&&Number.isFinite(e.maxY),Kur=(e)=>e.find((t)=>t.type==="pcb_component"),$ur=(e,t)=>{if(!t)return[];return e.filter((n)=>("pcb_component_id"in n)&&n.pcb_component_id===t)},qur=(e)=>{switch(e){case"from_left":case"from_x_neg":return"left";case"from_right":case"from_x_pos":return"right";case"from_top":case"from_y_pos":case"from_front":return"top";case"from_bottom":case"from_y_neg":case"from_back":return"bottom";case"from_above":case"from_z_pos":return"above";case"from_below":case"from_z_neg":return"below";default:return}},Jur=(e)=>{if(!("insertion_direction"in e))return;return typeof e.insertion_direction==="string"?e.insertion_direction:void 0},Zur=(e,t)=>{let n=cLt();for(let o of e){if(o.type==="pcb_smtpad"){if("points"in o)for(let r of o.points)WO(n,r.x,r.y);else if("x"in o&&"y"in o&&"width"in o&&"height"in o)UO(n,o.x,o.y,o.width,o.height);else if("x"in o&&"y"in o&&"radius"in o)UO(n,o.x,o.y,o.radius*2,o.radius*2);continue}if(o.type==="pcb_plated_hole"){if("outer_width"in o&&"outer_height"in o)UO(n,o.x,o.y,o.outer_width,o.outer_height);else if("outer_diameter"in o)UO(n,o.x,o.y,o.outer_diameter,o.outer_diameter);continue}if(o.type==="pcb_hole"){if("hole_diameter"in o)UO(n,o.x,o.y,o.hole_diameter,o.hole_diameter);else if("hole_width"in o&&"hole_height"in o)UO(n,o.x,o.y,o.hole_width,o.hole_height);continue}if(o.type==="pcb_silkscreen_path"){for(let r of o.route)WO(n,r.x,r.y);continue}if(o.type==="pcb_component")UO(n,o.center.x,o.center.y,o.width,o.height)}return lLt(n)?n:t},e0r=(e,t)=>{let n=cLt();for(let o of e){if(o.type==="pcb_smtpad"){if("x"in o&&"y"in o)WO(n,o.x,o.y);if("points"in o)for(let r of o.points)WO(n,r.x,r.y)}if(o.type==="pcb_plated_hole"&&o.pcb_port_id)WO(n,o.x,o.y)}return lLt(n)?n:t},hLt=(e)=>{let t=Kur(e);if(!t)return{x:0,y:0,side:"bottom"};let n={minX:t.center.x-t.width/2,maxX:t.center.x+t.width/2,minY:t.center.y-t.height/2,maxY:t.center.y+t.height/2},o=$ur(e,t.pcb_component_id),r=Zur(o,n),i=e0r(o,n),s={left:i.minX-r.minX,right:r.maxX-i.maxX,top:r.maxY-i.maxY,bottom:i.minY-r.minY},a=Object.entries(s).sort((p,m)=>m[1]-p[1])[0]?.[0]??"bottom",c=qur(Jur(t))??a,l=r.maxX-r.minX,h=r.maxY-r.minY,d=Math.max(0.4,Math.min(l,h)*0.08),u=(r.minX+r.maxX)/2,_=(r.minY+r.maxY)/2;if(c==="above"||c==="below")return{x:u,y:_,side:c,pcbComponentId:t.pcb_component_id};if(c==="top")return{x:u,y:r.maxY+d,side:c,pcbComponentId:t.pcb_component_id};if(c==="left")return{x:r.minX-d,y:_,side:c,pcbComponentId:t.pcb_component_id};if(c==="right")return{x:r.maxX+d,y:_,side:c,pcbComponentId:t.pcb_component_id};return{x:u,y:r.minY-d,side:"bottom",pcbComponentId:t.pcb_component_id}};qt();K0();K0();var QUt=at(a4e(),1);var ein=at(a4e(),1),oin=at(a4e(),1),{create:t0r,defineProperty:Tje,getOwnPropertyDescriptor:n0r,getOwnPropertyNames:sUt,getPrototypeOf:o0r}=Object,r0r=Object.prototype.hasOwnProperty,Um=(e,t)=>function(){return t||(0,e[sUt(e)[0]])((t={exports:{}}).exports,t),t.exports},ube=(e,t)=>{for(var n in t)Tje(e,n,{get:t[n],enumerable:!0})},Dje=(e,t,n)=>(n=e!=null?t0r(o0r(e)):{},((o,r,i,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of sUt(r))r0r.call(o,a)||a===i||Tje(o,a,{get:()=>r[a],enumerable:!(s=n0r(r,a))||s.enumerable});return o})(!t&&e&&e.__esModule?n:Tje(n,"default",{value:e,enumerable:!0}),e)),i0r=Um({"node_modules/is-buffer/index.js"(e,t){function n(o){return!!o.constructor&&typeof o.constructor.isBuffer=="function"&&o.constructor.isBuffer(o)}t.exports=function(o){return o!=null&&(n(o)||function(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&n(r.slice(0,0))}(o)||!!o._isBuffer)}}}),s0r=Um({"node_modules/kind-of/index.js"(e,t){var n=i0r(),o=Object.prototype.toString;t.exports=function(r){if(r===void 0)return"undefined";if(r===null)return"null";if(r===!0||r===!1||r instanceof Boolean)return"boolean";if(typeof r=="string"||r instanceof String)return"string";if(typeof r=="number"||r instanceof Number)return"number";if(typeof r=="function"||r instanceof Function)return"function";if(Array.isArray!==void 0&&Array.isArray(r))return"array";if(r instanceof RegExp)return"regexp";if(r instanceof Date)return"date";var i=o.call(r);return i==="[object RegExp]"?"regexp":i==="[object Date]"?"date":i==="[object Arguments]"?"arguments":i==="[object Error]"?"error":n(r)?"buffer":i==="[object Set]"?"set":i==="[object WeakSet]"?"weakset":i==="[object Map]"?"map":i==="[object WeakMap]"?"weakmap":i==="[object Symbol]"?"symbol":i==="[object Int8Array]"?"int8array":i==="[object Uint8Array]"?"uint8array":i==="[object Uint8ClampedArray]"?"uint8clampedarray":i==="[object Int16Array]"?"int16array":i==="[object Uint16Array]"?"uint16array":i==="[object Int32Array]"?"int32array":i==="[object Uint32Array]"?"uint32array":i==="[object Float32Array]"?"float32array":i==="[object Float64Array]"?"float64array":"object"}}}),a0r=Um({"node_modules/rename-keys/index.js"(e,t){(function(){function n(o,r){if(typeof r!="function")return o;var i={};for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(i[r(s,o[s])||s]=o[s]);return i}t!==void 0&&t.exports?t.exports=n:typeof define=="function"&&define.amd?define([],function(){return n}):window.rename=n})()}}),c0r=Um({"node_modules/deep-rename-keys/index.js"(e,t){var n=s0r(),o=a0r();t.exports=function r(i,s){var a=n(i);if(a!=="object"&&a!=="array")throw Error("expected an object");var c=[];for(var l in a==="object"&&(i=o(i,s),c={}),i)if(i.hasOwnProperty(l)){var h=i[l];n(h)==="object"||n(h)==="array"?c[l]=r(h,s):c[l]=h}return c}}}),l0r=Um({"node_modules/xml-reader/node_modules/eventemitter3/index.js"(e,t){var n=Object.prototype.hasOwnProperty,o="~";function r(){}function i(a,c,l){this.fn=a,this.context=c,this.once=l||!1}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(o=!1)),s.prototype.eventNames=function(){var a,c,l=[];if(this._eventsCount===0)return l;for(c in a=this._events)n.call(a,c)&&l.push(o?c.slice(1):c);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(a)):l},s.prototype.listeners=function(a,c){var l=o?o+a:a,h=this._events[l];if(c)return!!h;if(!h)return[];if(h.fn)return[h.fn];for(var d=0,u=h.length,_=Array(u);d<u;d++)_[d]=h[d].fn;return _},s.prototype.emit=function(a,c,l,h,d,u){var _=o?o+a:a;if(!this._events[_])return!1;var p,m,A=this._events[_],g=arguments.length;if(A.fn){switch(A.once&&this.removeListener(a,A.fn,void 0,!0),g){case 1:return A.fn.call(A.context),!0;case 2:return A.fn.call(A.context,c),!0;case 3:return A.fn.call(A.context,c,l),!0;case 4:return A.fn.call(A.context,c,l,h),!0;case 5:return A.fn.call(A.context,c,l,h,d),!0;case 6:return A.fn.call(A.context,c,l,h,d,u),!0}for(m=1,p=Array(g-1);m<g;m++)p[m-1]=arguments[m];A.fn.apply(A.context,p)}else{var f,y=A.length;for(m=0;m<y;m++)switch(A[m].once&&this.removeListener(a,A[m].fn,void 0,!0),g){case 1:A[m].fn.call(A[m].context);break;case 2:A[m].fn.call(A[m].context,c);break;case 3:A[m].fn.call(A[m].context,c,l);break;case 4:A[m].fn.call(A[m].context,c,l,h);break;default:if(!p)for(f=1,p=Array(g-1);f<g;f++)p[f-1]=arguments[f];A[m].fn.apply(A[m].context,p)}}return!0},s.prototype.on=function(a,c,l){var h=new i(c,l||this),d=o?o+a:a;return this._events[d]?this._events[d].fn?this._events[d]=[this._events[d],h]:this._events[d].push(h):(this._events[d]=h,this._eventsCount++),this},s.prototype.once=function(a,c,l){var h=new i(c,l||this,!0),d=o?o+a:a;return this._events[d]?this._events[d].fn?this._events[d]=[this._events[d],h]:this._events[d].push(h):(this._events[d]=h,this._eventsCount++),this},s.prototype.removeListener=function(a,c,l,h){var d=o?o+a:a;if(!this._events[d])return this;if(!c)return--this._eventsCount===0?this._events=new r:delete this._events[d],this;var u=this._events[d];if(u.fn)u.fn!==c||h&&!u.once||l&&u.context!==l||(--this._eventsCount===0?this._events=new r:delete this._events[d]);else{for(var _=0,p=[],m=u.length;_<m;_++)(u[_].fn!==c||h&&!u[_].once||l&&u[_].context!==l)&&p.push(u[_]);p.length?this._events[d]=p.length===1?p[0]:p:--this._eventsCount===0?this._events=new r:delete this._events[d]}return this},s.prototype.removeAllListeners=function(a){var c;return a?(c=o?o+a:a,this._events[c]&&(--this._eventsCount===0?this._events=new r:delete this._events[c])):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prototype.setMaxListeners=function(){return this},s.prefixed=o,s.EventEmitter=s,t!==void 0&&(t.exports=s)}}),h0r=Um({"node_modules/xml-lexer/node_modules/eventemitter3/index.js"(e,t){var n=Object.prototype.hasOwnProperty,o="~";function r(){}function i(a,c,l){this.fn=a,this.context=c,this.once=l||!1}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(o=!1)),s.prototype.eventNames=function(){var a,c,l=[];if(this._eventsCount===0)return l;for(c in a=this._events)n.call(a,c)&&l.push(o?c.slice(1):c);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(a)):l},s.prototype.listeners=function(a,c){var l=o?o+a:a,h=this._events[l];if(c)return!!h;if(!h)return[];if(h.fn)return[h.fn];for(var d=0,u=h.length,_=Array(u);d<u;d++)_[d]=h[d].fn;return _},s.prototype.emit=function(a,c,l,h,d,u){var _=o?o+a:a;if(!this._events[_])return!1;var p,m,A=this._events[_],g=arguments.length;if(A.fn){switch(A.once&&this.removeListener(a,A.fn,void 0,!0),g){case 1:return A.fn.call(A.context),!0;case 2:return A.fn.call(A.context,c),!0;case 3:return A.fn.call(A.context,c,l),!0;case 4:return A.fn.call(A.context,c,l,h),!0;case 5:return A.fn.call(A.context,c,l,h,d),!0;case 6:return A.fn.call(A.context,c,l,h,d,u),!0}for(m=1,p=Array(g-1);m<g;m++)p[m-1]=arguments[m];A.fn.apply(A.context,p)}else{var f,y=A.length;for(m=0;m<y;m++)switch(A[m].once&&this.removeListener(a,A[m].fn,void 0,!0),g){case 1:A[m].fn.call(A[m].context);break;case 2:A[m].fn.call(A[m].context,c);break;case 3:A[m].fn.call(A[m].context,c,l);break;case 4:A[m].fn.call(A[m].context,c,l,h);break;default:if(!p)for(f=1,p=Array(g-1);f<g;f++)p[f-1]=arguments[f];A[m].fn.apply(A[m].context,p)}}return!0},s.prototype.on=function(a,c,l){var h=new i(c,l||this),d=o?o+a:a;return this._events[d]?this._events[d].fn?this._events[d]=[this._events[d],h]:this._events[d].push(h):(this._events[d]=h,this._eventsCount++),this},s.prototype.once=function(a,c,l){var h=new i(c,l||this,!0),d=o?o+a:a;return this._events[d]?this._events[d].fn?this._events[d]=[this._events[d],h]:this._events[d].push(h):(this._events[d]=h,this._eventsCount++),this},s.prototype.removeListener=function(a,c,l,h){var d=o?o+a:a;if(!this._events[d])return this;if(!c)return--this._eventsCount===0?this._events=new r:delete this._events[d],this;var u=this._events[d];if(u.fn)u.fn!==c||h&&!u.once||l&&u.context!==l||(--this._eventsCount===0?this._events=new r:delete this._events[d]);else{for(var _=0,p=[],m=u.length;_<m;_++)(u[_].fn!==c||h&&!u[_].once||l&&u[_].context!==l)&&p.push(u[_]);p.length?this._events[d]=p.length===1?p[0]:p:--this._eventsCount===0?this._events=new r:delete this._events[d]}return this},s.prototype.removeAllListeners=function(a){var c;return a?(c=o?o+a:a,this._events[c]&&(--this._eventsCount===0?this._events=new r:delete this._events[c])):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prototype.setMaxListeners=function(){return this},s.prefixed=o,s.EventEmitter=s,t!==void 0&&(t.exports=s)}}),d0r=Um({"node_modules/xml-lexer/dist/lexer.js"(e,t){function n(l,h,d){return h in l?Object.defineProperty(l,h,{value:d,enumerable:!0,configurable:!0,writable:!0}):l[h]=d,l}var o=h0r(),r=function(){},i={data:"state-data",cdata:"state-cdata",tagBegin:"state-tag-begin",tagName:"state-tag-name",tagEnd:"state-tag-end",attributeNameStart:"state-attribute-name-start",attributeName:"state-attribute-name",attributeNameEnd:"state-attribute-name-end",attributeValueBegin:"state-attribute-value-begin",attributeValue:"state-attribute-value"},s={lt:"action-lt",gt:"action-gt",space:"action-space",equal:"action-equal",quote:"action-quote",slash:"action-slash",char:"action-char",error:"action-error"},a={text:"text",openTag:"open-tag",closeTag:"close-tag",attributeName:"attribute-name",attributeValue:"attribute-value"},c={" ":s.space,"\t":s.space,"\n":s.space,"\r":s.space,"<":s.lt,">":s.gt,'"':s.quote,"'":s.quote,"=":s.equal,"/":s.slash};t.exports={State:i,Action:s,Type:a,create:function(l){var h,d,u,_,p,m,A,g,f,y;l=Object.assign({debug:!1},l);var x=new o,C=i.data,b="",I="",v="",P="",M="",B="",T=function(D,L){if(I[0]!=="?"&&I[0]!=="!"){var H={type:D,value:L};l.debug&&console.log("emit:",H),x.emit("data",H)}};x.stateMachine=(n(y={},i.data,(n(h={},s.lt,function(){b.trim()&&T(a.text,b),I="",M=!1,C=i.tagBegin}),n(h,s.char,function(D){b+=D}),h)),n(y,i.cdata,n({},s.char,function(D){(b+=D).substr(-3)==="]]>"&&(T(a.text,b.slice(0,-3)),b="",C=i.data)})),n(y,i.tagBegin,(n(d={},s.space,r),n(d,s.char,function(D){I=D,C=i.tagName}),n(d,s.slash,function(){I="",M=!0}),d)),n(y,i.tagName,(n(u={},s.space,function(){M?C=i.tagEnd:(C=i.attributeNameStart,T(a.openTag,I))}),n(u,s.gt,function(){T(M?a.closeTag:a.openTag,I),b="",C=i.data}),n(u,s.slash,function(){C=i.tagEnd,T(a.openTag,I)}),n(u,s.char,function(D){(I+=D)==="![CDATA["&&(C=i.cdata,b="",I="")}),u)),n(y,i.tagEnd,(n(_={},s.gt,function(){T(a.closeTag,I),b="",C=i.data}),n(_,s.char,r),_)),n(y,i.attributeNameStart,(n(p={},s.char,function(D){v=D,C=i.attributeName}),n(p,s.gt,function(){b="",C=i.data}),n(p,s.space,r),n(p,s.slash,function(){M=!0,C=i.tagEnd}),p)),n(y,i.attributeName,(n(m={},s.space,function(){C=i.attributeNameEnd}),n(m,s.equal,function(){T(a.attributeName,v),C=i.attributeValueBegin}),n(m,s.gt,function(){P="",T(a.attributeName,v),T(a.attributeValue,P),b="",C=i.data}),n(m,s.slash,function(){M=!0,P="",T(a.attributeName,v),T(a.attributeValue,P),C=i.tagEnd}),n(m,s.char,function(D){v+=D}),m)),n(y,i.attributeNameEnd,(n(A={},s.space,r),n(A,s.equal,function(){T(a.attributeName,v),C=i.attributeValueBegin}),n(A,s.gt,function(){P="",T(a.attributeName,v),T(a.attributeValue,P),b="",C=i.data}),n(A,s.char,function(D){P="",T(a.attributeName,v),T(a.attributeValue,P),v=D,C=i.attributeName}),A)),n(y,i.attributeValueBegin,(n(g={},s.space,r),n(g,s.quote,function(D){B=D,P="",C=i.attributeValue}),n(g,s.gt,function(){T(a.attributeValue,P=""),b="",C=i.data}),n(g,s.char,function(D){B="",P=D,C=i.attributeValue}),g)),n(y,i.attributeValue,(n(f={},s.space,function(D){B?P+=D:(T(a.attributeValue,P),C=i.attributeNameStart)}),n(f,s.quote,function(D){B===D?(T(a.attributeValue,P),C=i.attributeNameStart):P+=D}),n(f,s.gt,function(D){B?P+=D:(T(a.attributeValue,P),b="",C=i.data)}),n(f,s.slash,function(D){B?P+=D:(T(a.attributeValue,P),M=!0,C=i.tagEnd)}),n(f,s.char,function(D){P+=D}),f)),y);var N=function(D){l.debug&&console.log(C,D);var L=x.stateMachine[C],H=L[function(V){return c[V]||s.char}(D)]||L[s.error]||L[s.char];H(D)};return x.write=function(D){for(var L=D.length,H=0;H<L;H++)N(D[H])},x}}}}),u0r=Um({"node_modules/xml-reader/dist/reader.js"(e,t){var n=l0r(),o=d0r(),r=o.Type,i={element:"element",text:"text"},s=function(c){return Object.assign({name:"",type:i.element,value:"",parent:null,attributes:{},children:[]},c)},a=function(c){c=Object.assign({stream:!1,parentNodes:!0,doneEvent:"done",tagPrefix:"tag:",emitTopLevelOnly:!1,debug:!1},c);var l=void 0,h=void 0,d=void 0,u=void 0,_=new n,p=function(m){switch(m.type){case r.openTag:if(d===null)(d=h).name=m.value;else{var A=s({name:m.value,parent:d});d.children.push(A),d=A}break;case r.closeTag:var g=d.parent;if(c.parentNodes||(d.parent=null),d.name!==m.value)break;c.stream&&g===h&&(h.children=[],d.parent=null),c.emitTopLevelOnly&&g!==h||(_.emit(c.tagPrefix+d.name,d),_.emit("tag",d.name,d)),d===h&&(l.removeAllListeners("data"),_.emit(c.doneEvent,d),h=null),d=g;break;case r.text:d&&d.children.push(s({type:i.text,value:m.value,parent:c.parentNodes?d:null}));break;case r.attributeName:u=m.value,d.attributes[u]="";break;case r.attributeValue:d.attributes[u]=m.value}};return _.reset=function(){(l=o.create({debug:c.debug})).on("data",p),h=s(),d=null,u="",_.parse=l.write},_.reset(),_};t.exports={parseSync:function(c,l){l=Object.assign({},l,{stream:!1,tagPrefix:":"});var h=a(l),d=void 0;return h.on("done",function(u){d=u}),h.parse(c),d},create:a,NodeType:i}}}),pbe=Um({"node_modules/binary-search-bounds/search-bounds.js"(e,t){function n(c,l,h,d,u){for(var _=u+1;d<=u;){var p=d+u>>>1,m=c[p];(h!==void 0?h(m,l):m-l)>=0?(_=p,u=p-1):d=p+1}return _}function o(c,l,h,d,u){for(var _=u+1;d<=u;){var p=d+u>>>1,m=c[p];(h!==void 0?h(m,l):m-l)>0?(_=p,u=p-1):d=p+1}return _}function r(c,l,h,d,u){for(var _=d-1;d<=u;){var p=d+u>>>1,m=c[p];(h!==void 0?h(m,l):m-l)<0?(_=p,d=p+1):u=p-1}return _}function i(c,l,h,d,u){for(var _=d-1;d<=u;){var p=d+u>>>1,m=c[p];(h!==void 0?h(m,l):m-l)<=0?(_=p,d=p+1):u=p-1}return _}function s(c,l,h,d,u){for(;d<=u;){var _=d+u>>>1,p=c[_],m=h!==void 0?h(p,l):p-l;if(m===0)return _;m<=0?d=_+1:u=_-1}return-1}function a(c,l,h,d,u,_){return typeof h=="function"?_(c,l,h,d===void 0?0:0|d,u===void 0?c.length-1:0|u):_(c,l,void 0,h===void 0?0:0|h,d===void 0?c.length-1:0|d)}t.exports={ge:function(c,l,h,d,u){return a(c,l,h,d,u,n)},gt:function(c,l,h,d,u){return a(c,l,h,d,u,o)},lt:function(c,l,h,d,u){return a(c,l,h,d,u,r)},le:function(c,l,h,d,u){return a(c,l,h,d,u,i)},eq:function(c,l,h,d,u){return a(c,l,h,d,u,s)}}}}),G$e=Um({"node_modules/two-product/two-product.js"(e,t){t.exports=function(o,r,i){var s=o*r,a=n*o,c=a-(a-o),l=o-c,h=n*r,d=h-(h-r),u=r-d,_=l*u-(s-c*d-l*d-c*u);if(i)return i[0]=_,i[1]=s,i;return[_,s]};var n=+(Math.pow(2,27)+1)}}),aUt=Um({"node_modules/robust-sum/robust-sum.js"(e,t){t.exports=function(n,o){var r=0|n.length,i=0|o.length;if(r===1&&i===1)return function(v,P){var M=v+P,B=M-v,T=M-B,N=P-B,D=v-T,L=D+N;if(L)return[L,M];return[M]}(n[0],o[0]);var s,a,c=Array(r+i),l=0,h=0,d=0,u=Math.abs,_=n[h],p=u(_),m=o[d],A=u(m);p<A?(a=_,(h+=1)<r&&(p=u(_=n[h]))):(a=m,(d+=1)<i&&(A=u(m=o[d]))),h<r&&p<A||d>=i?(s=_,(h+=1)<r&&(p=u(_=n[h]))):(s=m,(d+=1)<i&&(A=u(m=o[d])));var g,f,y=s+a,x=y-s,C=a-x,b=C,I=y;for(;h<r&&d<i;)p<A?(s=_,(h+=1)<r&&(p=u(_=n[h]))):(s=m,(d+=1)<i&&(A=u(m=o[d]))),(C=(a=b)-(x=(y=s+a)-s))&&(c[l++]=C),b=I-((g=I+y)-(f=g-I))+(y-f),I=g;for(;h<r;)(C=(a=b)-(x=(y=(s=_)+a)-s))&&(c[l++]=C),b=I-((g=I+y)-(f=g-I))+(y-f),I=g,(h+=1)<r&&(_=n[h]);for(;d<i;)(C=(a=b)-(x=(y=(s=m)+a)-s))&&(c[l++]=C),b=I-((g=I+y)-(f=g-I))+(y-f),I=g,(d+=1)<i&&(m=o[d]);return b&&(c[l++]=b),I&&(c[l++]=I),l||(c[l++]=0),c.length=l,c}}}),p0r=Um({"node_modules/two-sum/two-sum.js"(e,t){t.exports=function(n,o,r){var i=n+o,s=i-n,a=o-s,c=n-(i-s);if(r)return r[0]=c+a,r[1]=i,r;return[c+a,i]}}}),cUt=Um({"node_modules/robust-scale/robust-scale.js"(e,t){var n=G$e(),o=p0r();t.exports=function(r,i){var s=r.length;if(s===1){var a=n(r[0],i);return a[0]?a:[a[1]]}var c=Array(2*s),l=[0.1,0.1],h=[0.1,0.1],d=0;n(r[0],i,l),l[0]&&(c[d++]=l[0]);for(var u=1;u<s;++u){n(r[u],i,h);var _=l[1];o(_,h[0],l),l[0]&&(c[d++]=l[0]);var p=h[1],m=l[1],A=p+m,g=m-(A-p);l[1]=A,g&&(c[d++]=g)}return l[1]&&(c[d++]=l[1]),d===0&&(c[d++]=0),c.length=d,c}}}),lUt=Um({"node_modules/robust-subtract/robust-diff.js"(e,t){t.exports=function(n,o){var r=0|n.length,i=0|o.length;if(r===1&&i===1)return function(v,P){var M=v+P,B=M-v,T=M-B,N=P-B,D=v-T,L=D+N;if(L)return[L,M];return[M]}(n[0],-o[0]);var s,a,c=Array(r+i),l=0,h=0,d=0,u=Math.abs,_=n[h],p=u(_),m=-o[d],A=u(m);p<A?(a=_,(h+=1)<r&&(p=u(_=n[h]))):(a=m,(d+=1)<i&&(A=u(m=-o[d]))),h<r&&p<A||d>=i?(s=_,(h+=1)<r&&(p=u(_=n[h]))):(s=m,(d+=1)<i&&(A=u(m=-o[d])));var g,f,y=s+a,x=y-s,C=a-x,b=C,I=y;for(;h<r&&d<i;)p<A?(s=_,(h+=1)<r&&(p=u(_=n[h]))):(s=m,(d+=1)<i&&(A=u(m=-o[d]))),(C=(a=b)-(x=(y=s+a)-s))&&(c[l++]=C),b=I-((g=I+y)-(f=g-I))+(y-f),I=g;for(;h<r;)(C=(a=b)-(x=(y=(s=_)+a)-s))&&(c[l++]=C),b=I-((g=I+y)-(f=g-I))+(y-f),I=g,(h+=1)<r&&(_=n[h]);for(;d<i;)(C=(a=b)-(x=(y=(s=m)+a)-s))&&(c[l++]=C),b=I-((g=I+y)-(f=g-I))+(y-f),I=g,(d+=1)<i&&(m=-o[d]);return b&&(c[l++]=b),I&&(c[l++]=I),l||(c[l++]=0),c.length=l,c}}}),m0r=Um({"node_modules/robust-orientation/orientation.js"(e,t){var n=G$e(),o=aUt(),r=cUt(),i=lUt();function s(m,A,g,f){return function(y,x,C){var b=m(m(A(x[1],C[0]),A(-C[1],x[0])),m(A(y[1],x[0]),A(-x[1],y[0]))),I=m(A(y[1],C[0]),A(-C[1],y[0])),v=f(b,I);return v[v.length-1]}}function a(m,A,g,f){return function(y,x,C,b){var I=m(m(g(m(A(C[1],b[0]),A(-b[1],C[0])),x[2]),m(g(m(A(x[1],b[0]),A(-b[1],x[0])),-C[2]),g(m(A(x[1],C[0]),A(-C[1],x[0])),b[2]))),m(g(m(A(x[1],b[0]),A(-b[1],x[0])),y[2]),m(g(m(A(y[1],b[0]),A(-b[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),b[2])))),v=m(m(g(m(A(C[1],b[0]),A(-b[1],C[0])),y[2]),m(g(m(A(y[1],b[0]),A(-b[1],y[0])),-C[2]),g(m(A(y[1],C[0]),A(-C[1],y[0])),b[2]))),m(g(m(A(x[1],C[0]),A(-C[1],x[0])),y[2]),m(g(m(A(y[1],C[0]),A(-C[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),C[2])))),P=f(I,v);return P[P.length-1]}}function c(m,A,g,f){return function(y,x,C,b,I){var v=m(m(m(g(m(g(m(A(b[1],I[0]),A(-I[1],b[0])),C[2]),m(g(m(A(C[1],I[0]),A(-I[1],C[0])),-b[2]),g(m(A(C[1],b[0]),A(-b[1],C[0])),I[2]))),x[3]),m(g(m(g(m(A(b[1],I[0]),A(-I[1],b[0])),x[2]),m(g(m(A(x[1],I[0]),A(-I[1],x[0])),-b[2]),g(m(A(x[1],b[0]),A(-b[1],x[0])),I[2]))),-C[3]),g(m(g(m(A(C[1],I[0]),A(-I[1],C[0])),x[2]),m(g(m(A(x[1],I[0]),A(-I[1],x[0])),-C[2]),g(m(A(x[1],C[0]),A(-C[1],x[0])),I[2]))),b[3]))),m(g(m(g(m(A(C[1],b[0]),A(-b[1],C[0])),x[2]),m(g(m(A(x[1],b[0]),A(-b[1],x[0])),-C[2]),g(m(A(x[1],C[0]),A(-C[1],x[0])),b[2]))),-I[3]),m(g(m(g(m(A(b[1],I[0]),A(-I[1],b[0])),x[2]),m(g(m(A(x[1],I[0]),A(-I[1],x[0])),-b[2]),g(m(A(x[1],b[0]),A(-b[1],x[0])),I[2]))),y[3]),g(m(g(m(A(b[1],I[0]),A(-I[1],b[0])),y[2]),m(g(m(A(y[1],I[0]),A(-I[1],y[0])),-b[2]),g(m(A(y[1],b[0]),A(-b[1],y[0])),I[2]))),-x[3])))),m(m(g(m(g(m(A(x[1],I[0]),A(-I[1],x[0])),y[2]),m(g(m(A(y[1],I[0]),A(-I[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),I[2]))),b[3]),m(g(m(g(m(A(x[1],b[0]),A(-b[1],x[0])),y[2]),m(g(m(A(y[1],b[0]),A(-b[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),b[2]))),-I[3]),g(m(g(m(A(C[1],b[0]),A(-b[1],C[0])),x[2]),m(g(m(A(x[1],b[0]),A(-b[1],x[0])),-C[2]),g(m(A(x[1],C[0]),A(-C[1],x[0])),b[2]))),y[3]))),m(g(m(g(m(A(C[1],b[0]),A(-b[1],C[0])),y[2]),m(g(m(A(y[1],b[0]),A(-b[1],y[0])),-C[2]),g(m(A(y[1],C[0]),A(-C[1],y[0])),b[2]))),-x[3]),m(g(m(g(m(A(x[1],b[0]),A(-b[1],x[0])),y[2]),m(g(m(A(y[1],b[0]),A(-b[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),b[2]))),C[3]),g(m(g(m(A(x[1],C[0]),A(-C[1],x[0])),y[2]),m(g(m(A(y[1],C[0]),A(-C[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),C[2]))),-b[3]))))),P=m(m(m(g(m(g(m(A(b[1],I[0]),A(-I[1],b[0])),C[2]),m(g(m(A(C[1],I[0]),A(-I[1],C[0])),-b[2]),g(m(A(C[1],b[0]),A(-b[1],C[0])),I[2]))),y[3]),g(m(g(m(A(b[1],I[0]),A(-I[1],b[0])),y[2]),m(g(m(A(y[1],I[0]),A(-I[1],y[0])),-b[2]),g(m(A(y[1],b[0]),A(-b[1],y[0])),I[2]))),-C[3])),m(g(m(g(m(A(C[1],I[0]),A(-I[1],C[0])),y[2]),m(g(m(A(y[1],I[0]),A(-I[1],y[0])),-C[2]),g(m(A(y[1],C[0]),A(-C[1],y[0])),I[2]))),b[3]),g(m(g(m(A(C[1],b[0]),A(-b[1],C[0])),y[2]),m(g(m(A(y[1],b[0]),A(-b[1],y[0])),-C[2]),g(m(A(y[1],C[0]),A(-C[1],y[0])),b[2]))),-I[3]))),m(m(g(m(g(m(A(C[1],I[0]),A(-I[1],C[0])),x[2]),m(g(m(A(x[1],I[0]),A(-I[1],x[0])),-C[2]),g(m(A(x[1],C[0]),A(-C[1],x[0])),I[2]))),y[3]),g(m(g(m(A(C[1],I[0]),A(-I[1],C[0])),y[2]),m(g(m(A(y[1],I[0]),A(-I[1],y[0])),-C[2]),g(m(A(y[1],C[0]),A(-C[1],y[0])),I[2]))),-x[3])),m(g(m(g(m(A(x[1],I[0]),A(-I[1],x[0])),y[2]),m(g(m(A(y[1],I[0]),A(-I[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),I[2]))),C[3]),g(m(g(m(A(x[1],C[0]),A(-C[1],x[0])),y[2]),m(g(m(A(y[1],C[0]),A(-C[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),C[2]))),-I[3])))),M=f(v,P);return M[M.length-1]}}function l(m){return(m===3?s:m===4?a:c)(o,n,r,i)}var h=l(3),d=l(4),u=[function(){return 0},function(){return 0},function(m,A){return A[0]-m[0]},function(m,A,g){var f,y=(m[1]-g[1])*(A[0]-g[0]),x=(m[0]-g[0])*(A[1]-g[1]),C=y-x;if(y>0){if(x<=0)return C;f=y+x}else{if(!(y<0))return C;if(x>=0)return C;f=-(y+x)}var b=0.00000000000000033306690738754716*f;return C>=b||C<=-b?C:h(m,A,g)},function(m,A,g,f){var y=m[0]-f[0],x=A[0]-f[0],C=g[0]-f[0],b=m[1]-f[1],I=A[1]-f[1],v=g[1]-f[1],P=m[2]-f[2],M=A[2]-f[2],B=g[2]-f[2],T=x*v,N=C*I,D=C*b,L=y*v,H=y*I,V=x*b,O=P*(T-N)+M*(D-L)+B*(H-V),U=0.0000000000000007771561172376103*((Math.abs(T)+Math.abs(N))*Math.abs(P)+(Math.abs(D)+Math.abs(L))*Math.abs(M)+(Math.abs(H)+Math.abs(V))*Math.abs(B));return O>U||-O>U?O:d(m,A,g,f)}];function _(m){var A=u[m.length];return A||(A=u[m.length]=l(m.length)),A.apply(void 0,m)}function p(m,A,g,f,y,x,C){return function(b,I,v,P,M){switch(arguments.length){case 0:case 1:return 0;case 2:return f(b,I);case 3:return y(b,I,v);case 4:return x(b,I,v,P);case 5:return C(b,I,v,P,M)}for(var B=Array(arguments.length),T=0;T<arguments.length;++T)B[T]=arguments[T];return m(B)}}(function(){for(;u.length<=5;)u.push(l(u.length));t.exports=p.apply(void 0,[_].concat(u));for(var m=0;m<=5;++m)t.exports[m]=u[m]})()}}),_0r=Um({"node_modules/cdt2d/lib/monotone.js"(e,t){var n=pbe(),o=m0r()[3];function r(u,_,p,m,A){this.a=u,this.b=_,this.idx=p,this.lowerIds=m,this.upperIds=A}function i(u,_,p,m){this.a=u,this.b=_,this.type=p,this.idx=m}function s(u,_){var p=u.a[0]-_.a[0]||u.a[1]-_.a[1]||u.type-_.type;return p||(u.type!==0&&(p=o(u.a,u.b,_.b))?p:u.idx-_.idx)}function a(u,_){return o(u.a,u.b,_)}function c(u,_,p,m,A){for(var g=n.lt(_,m,a),f=n.gt(_,m,a),y=g;y<f;++y){for(var x=_[y],C=x.lowerIds,b=C.length;b>1&&o(p[C[b-2]],p[C[b-1]],m)>0;)u.push([C[b-1],C[b-2],A]),b-=1;C.length=b,C.push(A);var I=x.upperIds;for(b=I.length;b>1&&o(p[I[b-2]],p[I[b-1]],m)<0;)u.push([I[b-2],I[b-1],A]),b-=1;I.length=b,I.push(A)}}function l(u,_){var p;return(p=u.a[0]<_.a[0]?o(u.a,u.b,_.a):o(_.b,_.a,u.a))?p:(p=_.b[0]<u.b[0]?o(u.a,u.b,_.b):o(_.b,_.a,u.b))||u.idx-_.idx}function h(u,_,p){var m=n.le(u,p,l),A=u[m],g=A.upperIds,f=g[g.length-1];A.upperIds=[f],u.splice(m+1,0,new r(p.a,p.b,p.idx,[f],g))}function d(u,_,p){var m=p.a;p.a=p.b,p.b=m;var A=n.eq(u,p,l),g=u[A];u[A-1].upperIds=g.upperIds,u.splice(A,1)}t.exports=function(u,_){for(var p=u.length,m=_.length,A=[],g=0;g<p;++g)A.push(new i(u[g],null,0,g));for(g=0;g<m;++g){var f=_[g],y=u[f[0]],x=u[f[1]];y[0]<x[0]?A.push(new i(y,x,2,g),new i(x,y,1,g)):y[0]>x[0]&&A.push(new i(x,y,2,g),new i(y,x,1,g))}A.sort(s);for(var C=A[0].a[0]-(1+Math.abs(A[0].a[0]))*Math.pow(2,-52),b=[new r([C,1],[C,0],-1,[],[],[],[])],I=[],v=(g=0,A.length);g<v;++g){var P=A[g],M=P.type;M===0?c(I,b,u,P.a,P.idx):M===2?h(b,u,P):d(b,u,P)}return I}}}),g0r=Um({"node_modules/cdt2d/lib/triangulation.js"(e,t){var n=pbe();function o(s,a){this.stars=s,this.edges=a}t.exports=function(s,a){for(var c=Array(s),l=0;l<s;++l)c[l]=[];return new o(c,a)};var r=o.prototype;function i(s,a,c){for(var l=1,h=s.length;l<h;l+=2)if(s[l-1]===a&&s[l]===c)return s[l-1]=s[h-2],s[l]=s[h-1],void(s.length=h-2)}r.isConstraint=function(){var s=[0,0];function a(c,l){return c[0]-l[0]||c[1]-l[1]}return function(c,l){return s[0]=Math.min(c,l),s[1]=Math.max(c,l),n.eq(this.edges,s,a)>=0}}(),r.removeTriangle=function(s,a,c){var l=this.stars;i(l[s],a,c),i(l[a],c,s),i(l[c],s,a)},r.addTriangle=function(s,a,c){var l=this.stars;l[s].push(a,c),l[a].push(c,s),l[c].push(s,a)},r.opposite=function(s,a){for(var c=this.stars[a],l=1,h=c.length;l<h;l+=2)if(c[l]===s)return c[l-1];return-1},r.flip=function(s,a){var c=this.opposite(s,a),l=this.opposite(a,s);this.removeTriangle(s,a,c),this.removeTriangle(a,s,l),this.addTriangle(s,l,c),this.addTriangle(a,c,l)},r.edges=function(){for(var s=this.stars,a=[],c=0,l=s.length;c<l;++c)for(var h=s[c],d=0,u=h.length;d<u;d+=2)a.push([h[d],h[d+1]]);return a},r.cells=function(){for(var s=this.stars,a=[],c=0,l=s.length;c<l;++c)for(var h=s[c],d=0,u=h.length;d<u;d+=2){var _=h[d],p=h[d+1];c<Math.min(_,p)&&a.push([c,_,p])}return a}}}),A0r=Um({"node_modules/robust-in-sphere/in-sphere.js"(e,t){var n=G$e(),o=aUt(),r=lUt(),i=cUt();function s(p){return(p===3?a:p===4?c:p===5?l:h)(o,r,n,i)}function a(p,m,A,g){return function(f,y,x){var C=A(f[0],f[0]),b=g(C,y[0]),I=g(C,x[0]),v=A(y[0],y[0]),P=g(v,f[0]),M=g(v,x[0]),B=A(x[0],x[0]),T=g(B,f[0]),N=g(B,y[0]),D=p(m(N,M),m(P,b)),L=m(T,I),H=m(D,L);return H[H.length-1]}}function c(p,m,A,g){return function(f,y,x,C){var b=p(A(f[0],f[0]),A(f[1],f[1])),I=g(b,y[0]),v=g(b,x[0]),P=g(b,C[0]),M=p(A(y[0],y[0]),A(y[1],y[1])),B=g(M,f[0]),T=g(M,x[0]),N=g(M,C[0]),D=p(A(x[0],x[0]),A(x[1],x[1])),L=g(D,f[0]),H=g(D,y[0]),V=g(D,C[0]),O=p(A(C[0],C[0]),A(C[1],C[1])),U=g(O,f[0]),j=g(O,y[0]),Y=g(O,x[0]),X=p(p(g(m(Y,V),y[1]),p(g(m(j,N),-x[1]),g(m(H,T),C[1]))),p(g(m(j,N),f[1]),p(g(m(U,P),-y[1]),g(m(B,I),C[1])))),K=p(p(g(m(Y,V),f[1]),p(g(m(U,P),-x[1]),g(m(L,v),C[1]))),p(g(m(H,T),f[1]),p(g(m(L,v),-y[1]),g(m(B,I),x[1])))),J=m(X,K);return J[J.length-1]}}function l(p,m,A,g){return function(f,y,x,C,b){var I=p(A(f[0],f[0]),p(A(f[1],f[1]),A(f[2],f[2]))),v=g(I,y[0]),P=g(I,x[0]),M=g(I,C[0]),B=g(I,b[0]),T=p(A(y[0],y[0]),p(A(y[1],y[1]),A(y[2],y[2]))),N=g(T,f[0]),D=g(T,x[0]),L=g(T,C[0]),H=g(T,b[0]),V=p(A(x[0],x[0]),p(A(x[1],x[1]),A(x[2],x[2]))),O=g(V,f[0]),U=g(V,y[0]),j=g(V,C[0]),Y=g(V,b[0]),X=p(A(C[0],C[0]),p(A(C[1],C[1]),A(C[2],C[2]))),K=g(X,f[0]),J=g(X,y[0]),ee=g(X,x[0]),se=g(X,b[0]),ne=p(A(b[0],b[0]),p(A(b[1],b[1]),A(b[2],b[2]))),re=g(ne,f[0]),Z=g(ne,y[0]),te=g(ne,x[0]),ie=g(ne,C[0]),le=p(p(p(g(p(g(m(ie,se),x[1]),p(g(m(te,Y),-C[1]),g(m(ee,j),b[1]))),y[2]),p(g(p(g(m(ie,se),y[1]),p(g(m(Z,H),-C[1]),g(m(J,L),b[1]))),-x[2]),g(p(g(m(te,Y),y[1]),p(g(m(Z,H),-x[1]),g(m(U,D),b[1]))),C[2]))),p(g(p(g(m(ee,j),y[1]),p(g(m(J,L),-x[1]),g(m(U,D),C[1]))),-b[2]),p(g(p(g(m(ie,se),y[1]),p(g(m(Z,H),-C[1]),g(m(J,L),b[1]))),f[2]),g(p(g(m(ie,se),f[1]),p(g(m(re,B),-C[1]),g(m(K,M),b[1]))),-y[2])))),p(p(g(p(g(m(Z,H),f[1]),p(g(m(re,B),-y[1]),g(m(N,v),b[1]))),C[2]),p(g(p(g(m(J,L),f[1]),p(g(m(K,M),-y[1]),g(m(N,v),C[1]))),-b[2]),g(p(g(m(ee,j),y[1]),p(g(m(J,L),-x[1]),g(m(U,D),C[1]))),f[2]))),p(g(p(g(m(ee,j),f[1]),p(g(m(K,M),-x[1]),g(m(O,P),C[1]))),-y[2]),p(g(p(g(m(J,L),f[1]),p(g(m(K,M),-y[1]),g(m(N,v),C[1]))),x[2]),g(p(g(m(U,D),f[1]),p(g(m(O,P),-y[1]),g(m(N,v),x[1]))),-C[2]))))),ue=p(p(p(g(p(g(m(ie,se),x[1]),p(g(m(te,Y),-C[1]),g(m(ee,j),b[1]))),f[2]),g(p(g(m(ie,se),f[1]),p(g(m(re,B),-C[1]),g(m(K,M),b[1]))),-x[2])),p(g(p(g(m(te,Y),f[1]),p(g(m(re,B),-x[1]),g(m(O,P),b[1]))),C[2]),g(p(g(m(ee,j),f[1]),p(g(m(K,M),-x[1]),g(m(O,P),C[1]))),-b[2]))),p(p(g(p(g(m(te,Y),y[1]),p(g(m(Z,H),-x[1]),g(m(U,D),b[1]))),f[2]),g(p(g(m(te,Y),f[1]),p(g(m(re,B),-x[1]),g(m(O,P),b[1]))),-y[2])),p(g(p(g(m(Z,H),f[1]),p(g(m(re,B),-y[1]),g(m(N,v),b[1]))),x[2]),g(p(g(m(U,D),f[1]),p(g(m(O,P),-y[1]),g(m(N,v),x[1]))),-b[2])))),de=m(le,ue);return de[de.length-1]}}function h(p,m,A,g){return function(f,y,x,C,b,I){var v=p(p(A(f[0],f[0]),A(f[1],f[1])),p(A(f[2],f[2]),A(f[3],f[3]))),P=g(v,y[0]),M=g(v,x[0]),B=g(v,C[0]),T=g(v,b[0]),N=g(v,I[0]),D=p(p(A(y[0],y[0]),A(y[1],y[1])),p(A(y[2],y[2]),A(y[3],y[3]))),L=g(D,f[0]),H=g(D,x[0]),V=g(D,C[0]),O=g(D,b[0]),U=g(D,I[0]),j=p(p(A(x[0],x[0]),A(x[1],x[1])),p(A(x[2],x[2]),A(x[3],x[3]))),Y=g(j,f[0]),X=g(j,y[0]),K=g(j,C[0]),J=g(j,b[0]),ee=g(j,I[0]),se=p(p(A(C[0],C[0]),A(C[1],C[1])),p(A(C[2],C[2]),A(C[3],C[3]))),ne=g(se,f[0]),re=g(se,y[0]),Z=g(se,x[0]),te=g(se,b[0]),ie=g(se,I[0]),le=p(p(A(b[0],b[0]),A(b[1],b[1])),p(A(b[2],b[2]),A(b[3],b[3]))),ue=g(le,f[0]),de=g(le,y[0]),me=g(le,x[0]),Ae=g(le,C[0]),xe=g(le,I[0]),Me=p(p(A(I[0],I[0]),A(I[1],I[1])),p(A(I[2],I[2]),A(I[3],I[3]))),Re=g(Me,f[0]),we=g(Me,y[0]),_e=g(Me,x[0]),ye=g(Me,C[0]),Se=g(Me,b[0]),Ne=p(p(p(g(p(p(g(p(g(m(Se,xe),C[1]),p(g(m(ye,ie),-b[1]),g(m(Ae,te),I[1]))),x[2]),g(p(g(m(Se,xe),x[1]),p(g(m(_e,ee),-b[1]),g(m(me,J),I[1]))),-C[2])),p(g(p(g(m(ye,ie),x[1]),p(g(m(_e,ee),-C[1]),g(m(Z,K),I[1]))),b[2]),g(p(g(m(Ae,te),x[1]),p(g(m(me,J),-C[1]),g(m(Z,K),b[1]))),-I[2]))),y[3]),p(g(p(p(g(p(g(m(Se,xe),C[1]),p(g(m(ye,ie),-b[1]),g(m(Ae,te),I[1]))),y[2]),g(p(g(m(Se,xe),y[1]),p(g(m(we,U),-b[1]),g(m(de,O),I[1]))),-C[2])),p(g(p(g(m(ye,ie),y[1]),p(g(m(we,U),-C[1]),g(m(re,V),I[1]))),b[2]),g(p(g(m(Ae,te),y[1]),p(g(m(de,O),-C[1]),g(m(re,V),b[1]))),-I[2]))),-x[3]),g(p(p(g(p(g(m(Se,xe),x[1]),p(g(m(_e,ee),-b[1]),g(m(me,J),I[1]))),y[2]),g(p(g(m(Se,xe),y[1]),p(g(m(we,U),-b[1]),g(m(de,O),I[1]))),-x[2])),p(g(p(g(m(_e,ee),y[1]),p(g(m(we,U),-x[1]),g(m(X,H),I[1]))),b[2]),g(p(g(m(me,J),y[1]),p(g(m(de,O),-x[1]),g(m(X,H),b[1]))),-I[2]))),C[3]))),p(p(g(p(p(g(p(g(m(ye,ie),x[1]),p(g(m(_e,ee),-C[1]),g(m(Z,K),I[1]))),y[2]),g(p(g(m(ye,ie),y[1]),p(g(m(we,U),-C[1]),g(m(re,V),I[1]))),-x[2])),p(g(p(g(m(_e,ee),y[1]),p(g(m(we,U),-x[1]),g(m(X,H),I[1]))),C[2]),g(p(g(m(Z,K),y[1]),p(g(m(re,V),-x[1]),g(m(X,H),C[1]))),-I[2]))),-b[3]),g(p(p(g(p(g(m(Ae,te),x[1]),p(g(m(me,J),-C[1]),g(m(Z,K),b[1]))),y[2]),g(p(g(m(Ae,te),y[1]),p(g(m(de,O),-C[1]),g(m(re,V),b[1]))),-x[2])),p(g(p(g(m(me,J),y[1]),p(g(m(de,O),-x[1]),g(m(X,H),b[1]))),C[2]),g(p(g(m(Z,K),y[1]),p(g(m(re,V),-x[1]),g(m(X,H),C[1]))),-b[2]))),I[3])),p(g(p(p(g(p(g(m(Se,xe),C[1]),p(g(m(ye,ie),-b[1]),g(m(Ae,te),I[1]))),y[2]),g(p(g(m(Se,xe),y[1]),p(g(m(we,U),-b[1]),g(m(de,O),I[1]))),-C[2])),p(g(p(g(m(ye,ie),y[1]),p(g(m(we,U),-C[1]),g(m(re,V),I[1]))),b[2]),g(p(g(m(Ae,te),y[1]),p(g(m(de,O),-C[1]),g(m(re,V),b[1]))),-I[2]))),f[3]),g(p(p(g(p(g(m(Se,xe),C[1]),p(g(m(ye,ie),-b[1]),g(m(Ae,te),I[1]))),f[2]),g(p(g(m(Se,xe),f[1]),p(g(m(Re,N),-b[1]),g(m(ue,T),I[1]))),-C[2])),p(g(p(g(m(ye,ie),f[1]),p(g(m(Re,N),-C[1]),g(m(ne,B),I[1]))),b[2]),g(p(g(m(Ae,te),f[1]),p(g(m(ue,T),-C[1]),g(m(ne,B),b[1]))),-I[2]))),-y[3])))),p(p(p(g(p(p(g(p(g(m(Se,xe),y[1]),p(g(m(we,U),-b[1]),g(m(de,O),I[1]))),f[2]),g(p(g(m(Se,xe),f[1]),p(g(m(Re,N),-b[1]),g(m(ue,T),I[1]))),-y[2])),p(g(p(g(m(we,U),f[1]),p(g(m(Re,N),-y[1]),g(m(L,P),I[1]))),b[2]),g(p(g(m(de,O),f[1]),p(g(m(ue,T),-y[1]),g(m(L,P),b[1]))),-I[2]))),C[3]),g(p(p(g(p(g(m(ye,ie),y[1]),p(g(m(we,U),-C[1]),g(m(re,V),I[1]))),f[2]),g(p(g(m(ye,ie),f[1]),p(g(m(Re,N),-C[1]),g(m(ne,B),I[1]))),-y[2])),p(g(p(g(m(we,U),f[1]),p(g(m(Re,N),-y[1]),g(m(L,P),I[1]))),C[2]),g(p(g(m(re,V),f[1]),p(g(m(ne,B),-y[1]),g(m(L,P),C[1]))),-I[2]))),-b[3])),p(g(p(p(g(p(g(m(Ae,te),y[1]),p(g(m(de,O),-C[1]),g(m(re,V),b[1]))),f[2]),g(p(g(m(Ae,te),f[1]),p(g(m(ue,T),-C[1]),g(m(ne,B),b[1]))),-y[2])),p(g(p(g(m(de,O),f[1]),p(g(m(ue,T),-y[1]),g(m(L,P),b[1]))),C[2]),g(p(g(m(re,V),f[1]),p(g(m(ne,B),-y[1]),g(m(L,P),C[1]))),-b[2]))),I[3]),g(p(p(g(p(g(m(ye,ie),x[1]),p(g(m(_e,ee),-C[1]),g(m(Z,K),I[1]))),y[2]),g(p(g(m(ye,ie),y[1]),p(g(m(we,U),-C[1]),g(m(re,V),I[1]))),-x[2])),p(g(p(g(m(_e,ee),y[1]),p(g(m(we,U),-x[1]),g(m(X,H),I[1]))),C[2]),g(p(g(m(Z,K),y[1]),p(g(m(re,V),-x[1]),g(m(X,H),C[1]))),-I[2]))),f[3]))),p(p(g(p(p(g(p(g(m(ye,ie),x[1]),p(g(m(_e,ee),-C[1]),g(m(Z,K),I[1]))),f[2]),g(p(g(m(ye,ie),f[1]),p(g(m(Re,N),-C[1]),g(m(ne,B),I[1]))),-x[2])),p(g(p(g(m(_e,ee),f[1]),p(g(m(Re,N),-x[1]),g(m(Y,M),I[1]))),C[2]),g(p(g(m(Z,K),f[1]),p(g(m(ne,B),-x[1]),g(m(Y,M),C[1]))),-I[2]))),-y[3]),g(p(p(g(p(g(m(ye,ie),y[1]),p(g(m(we,U),-C[1]),g(m(re,V),I[1]))),f[2]),g(p(g(m(ye,ie),f[1]),p(g(m(Re,N),-C[1]),g(m(ne,B),I[1]))),-y[2])),p(g(p(g(m(we,U),f[1]),p(g(m(Re,N),-y[1]),g(m(L,P),I[1]))),C[2]),g(p(g(m(re,V),f[1]),p(g(m(ne,B),-y[1]),g(m(L,P),C[1]))),-I[2]))),x[3])),p(g(p(p(g(p(g(m(_e,ee),y[1]),p(g(m(we,U),-x[1]),g(m(X,H),I[1]))),f[2]),g(p(g(m(_e,ee),f[1]),p(g(m(Re,N),-x[1]),g(m(Y,M),I[1]))),-y[2])),p(g(p(g(m(we,U),f[1]),p(g(m(Re,N),-y[1]),g(m(L,P),I[1]))),x[2]),g(p(g(m(X,H),f[1]),p(g(m(Y,M),-y[1]),g(m(L,P),x[1]))),-I[2]))),-C[3]),g(p(p(g(p(g(m(Z,K),y[1]),p(g(m(re,V),-x[1]),g(m(X,H),C[1]))),f[2]),g(p(g(m(Z,K),f[1]),p(g(m(ne,B),-x[1]),g(m(Y,M),C[1]))),-y[2])),p(g(p(g(m(re,V),f[1]),p(g(m(ne,B),-y[1]),g(m(L,P),C[1]))),x[2]),g(p(g(m(X,H),f[1]),p(g(m(Y,M),-y[1]),g(m(L,P),x[1]))),-C[2]))),I[3]))))),ke=p(p(p(g(p(p(g(p(g(m(Se,xe),C[1]),p(g(m(ye,ie),-b[1]),g(m(Ae,te),I[1]))),x[2]),g(p(g(m(Se,xe),x[1]),p(g(m(_e,ee),-b[1]),g(m(me,J),I[1]))),-C[2])),p(g(p(g(m(ye,ie),x[1]),p(g(m(_e,ee),-C[1]),g(m(Z,K),I[1]))),b[2]),g(p(g(m(Ae,te),x[1]),p(g(m(me,J),-C[1]),g(m(Z,K),b[1]))),-I[2]))),f[3]),p(g(p(p(g(p(g(m(Se,xe),C[1]),p(g(m(ye,ie),-b[1]),g(m(Ae,te),I[1]))),f[2]),g(p(g(m(Se,xe),f[1]),p(g(m(Re,N),-b[1]),g(m(ue,T),I[1]))),-C[2])),p(g(p(g(m(ye,ie),f[1]),p(g(m(Re,N),-C[1]),g(m(ne,B),I[1]))),b[2]),g(p(g(m(Ae,te),f[1]),p(g(m(ue,T),-C[1]),g(m(ne,B),b[1]))),-I[2]))),-x[3]),g(p(p(g(p(g(m(Se,xe),x[1]),p(g(m(_e,ee),-b[1]),g(m(me,J),I[1]))),f[2]),g(p(g(m(Se,xe),f[1]),p(g(m(Re,N),-b[1]),g(m(ue,T),I[1]))),-x[2])),p(g(p(g(m(_e,ee),f[1]),p(g(m(Re,N),-x[1]),g(m(Y,M),I[1]))),b[2]),g(p(g(m(me,J),f[1]),p(g(m(ue,T),-x[1]),g(m(Y,M),b[1]))),-I[2]))),C[3]))),p(p(g(p(p(g(p(g(m(ye,ie),x[1]),p(g(m(_e,ee),-C[1]),g(m(Z,K),I[1]))),f[2]),g(p(g(m(ye,ie),f[1]),p(g(m(Re,N),-C[1]),g(m(ne,B),I[1]))),-x[2])),p(g(p(g(m(_e,ee),f[1]),p(g(m(Re,N),-x[1]),g(m(Y,M),I[1]))),C[2]),g(p(g(m(Z,K),f[1]),p(g(m(ne,B),-x[1]),g(m(Y,M),C[1]))),-I[2]))),-b[3]),g(p(p(g(p(g(m(Ae,te),x[1]),p(g(m(me,J),-C[1]),g(m(Z,K),b[1]))),f[2]),g(p(g(m(Ae,te),f[1]),p(g(m(ue,T),-C[1]),g(m(ne,B),b[1]))),-x[2])),p(g(p(g(m(me,J),f[1]),p(g(m(ue,T),-x[1]),g(m(Y,M),b[1]))),C[2]),g(p(g(m(Z,K),f[1]),p(g(m(ne,B),-x[1]),g(m(Y,M),C[1]))),-b[2]))),I[3])),p(g(p(p(g(p(g(m(Se,xe),x[1]),p(g(m(_e,ee),-b[1]),g(m(me,J),I[1]))),y[2]),g(p(g(m(Se,xe),y[1]),p(g(m(we,U),-b[1]),g(m(de,O),I[1]))),-x[2])),p(g(p(g(m(_e,ee),y[1]),p(g(m(we,U),-x[1]),g(m(X,H),I[1]))),b[2]),g(p(g(m(me,J),y[1]),p(g(m(de,O),-x[1]),g(m(X,H),b[1]))),-I[2]))),f[3]),g(p(p(g(p(g(m(Se,xe),x[1]),p(g(m(_e,ee),-b[1]),g(m(me,J),I[1]))),f[2]),g(p(g(m(Se,xe),f[1]),p(g(m(Re,N),-b[1]),g(m(ue,T),I[1]))),-x[2])),p(g(p(g(m(_e,ee),f[1]),p(g(m(Re,N),-x[1]),g(m(Y,M),I[1]))),b[2]),g(p(g(m(me,J),f[1]),p(g(m(ue,T),-x[1]),g(m(Y,M),b[1]))),-I[2]))),-y[3])))),p(p(p(g(p(p(g(p(g(m(Se,xe),y[1]),p(g(m(we,U),-b[1]),g(m(de,O),I[1]))),f[2]),g(p(g(m(Se,xe),f[1]),p(g(m(Re,N),-b[1]),g(m(ue,T),I[1]))),-y[2])),p(g(p(g(m(we,U),f[1]),p(g(m(Re,N),-y[1]),g(m(L,P),I[1]))),b[2]),g(p(g(m(de,O),f[1]),p(g(m(ue,T),-y[1]),g(m(L,P),b[1]))),-I[2]))),x[3]),g(p(p(g(p(g(m(_e,ee),y[1]),p(g(m(we,U),-x[1]),g(m(X,H),I[1]))),f[2]),g(p(g(m(_e,ee),f[1]),p(g(m(Re,N),-x[1]),g(m(Y,M),I[1]))),-y[2])),p(g(p(g(m(we,U),f[1]),p(g(m(Re,N),-y[1]),g(m(L,P),I[1]))),x[2]),g(p(g(m(X,H),f[1]),p(g(m(Y,M),-y[1]),g(m(L,P),x[1]))),-I[2]))),-b[3])),p(g(p(p(g(p(g(m(me,J),y[1]),p(g(m(de,O),-x[1]),g(m(X,H),b[1]))),f[2]),g(p(g(m(me,J),f[1]),p(g(m(ue,T),-x[1]),g(m(Y,M),b[1]))),-y[2])),p(g(p(g(m(de,O),f[1]),p(g(m(ue,T),-y[1]),g(m(L,P),b[1]))),x[2]),g(p(g(m(X,H),f[1]),p(g(m(Y,M),-y[1]),g(m(L,P),x[1]))),-b[2]))),I[3]),g(p(p(g(p(g(m(Ae,te),x[1]),p(g(m(me,J),-C[1]),g(m(Z,K),b[1]))),y[2]),g(p(g(m(Ae,te),y[1]),p(g(m(de,O),-C[1]),g(m(re,V),b[1]))),-x[2])),p(g(p(g(m(me,J),y[1]),p(g(m(de,O),-x[1]),g(m(X,H),b[1]))),C[2]),g(p(g(m(Z,K),y[1]),p(g(m(re,V),-x[1]),g(m(X,H),C[1]))),-b[2]))),f[3]))),p(p(g(p(p(g(p(g(m(Ae,te),x[1]),p(g(m(me,J),-C[1]),g(m(Z,K),b[1]))),f[2]),g(p(g(m(Ae,te),f[1]),p(g(m(ue,T),-C[1]),g(m(ne,B),b[1]))),-x[2])),p(g(p(g(m(me,J),f[1]),p(g(m(ue,T),-x[1]),g(m(Y,M),b[1]))),C[2]),g(p(g(m(Z,K),f[1]),p(g(m(ne,B),-x[1]),g(m(Y,M),C[1]))),-b[2]))),-y[3]),g(p(p(g(p(g(m(Ae,te),y[1]),p(g(m(de,O),-C[1]),g(m(re,V),b[1]))),f[2]),g(p(g(m(Ae,te),f[1]),p(g(m(ue,T),-C[1]),g(m(ne,B),b[1]))),-y[2])),p(g(p(g(m(de,O),f[1]),p(g(m(ue,T),-y[1]),g(m(L,P),b[1]))),C[2]),g(p(g(m(re,V),f[1]),p(g(m(ne,B),-y[1]),g(m(L,P),C[1]))),-b[2]))),x[3])),p(g(p(p(g(p(g(m(me,J),y[1]),p(g(m(de,O),-x[1]),g(m(X,H),b[1]))),f[2]),g(p(g(m(me,J),f[1]),p(g(m(ue,T),-x[1]),g(m(Y,M),b[1]))),-y[2])),p(g(p(g(m(de,O),f[1]),p(g(m(ue,T),-y[1]),g(m(L,P),b[1]))),x[2]),g(p(g(m(X,H),f[1]),p(g(m(Y,M),-y[1]),g(m(L,P),x[1]))),-b[2]))),-C[3]),g(p(p(g(p(g(m(Z,K),y[1]),p(g(m(re,V),-x[1]),g(m(X,H),C[1]))),f[2]),g(p(g(m(Z,K),f[1]),p(g(m(ne,B),-x[1]),g(m(Y,M),C[1]))),-y[2])),p(g(p(g(m(re,V),f[1]),p(g(m(ne,B),-y[1]),g(m(L,P),C[1]))),x[2]),g(p(g(m(X,H),f[1]),p(g(m(Y,M),-y[1]),g(m(L,P),x[1]))),-C[2]))),b[3]))))),nt=m(Ne,ke);return nt[nt.length-1]}}var d=[function(){return 0},function(){return 0},function(){return 0}];function u(p){var m=d[p.length];return m||(m=d[p.length]=s(p.length)),m.apply(void 0,p)}function _(p,m,A,g,f,y,x,C){return function(b,I,v,P,M,B){switch(arguments.length){case 0:case 1:return 0;case 2:return g(b,I);case 3:return f(b,I,v);case 4:return y(b,I,v,P);case 5:return x(b,I,v,P,M);case 6:return C(b,I,v,P,M,B)}for(var T=Array(arguments.length),N=0;N<arguments.length;++N)T[N]=arguments[N];return p(T)}}(function(){for(;d.length<=6;)d.push(s(d.length));t.exports=_.apply(void 0,[u].concat(d));for(var p=0;p<=6;++p)t.exports[p]=d[p]})()}}),f0r=Um({"node_modules/cdt2d/lib/delaunay.js"(e,t){var n=A0r()[4];pbe();function o(r,i,s,a,c,l){var h=i.opposite(a,c);if(!(h<0)){if(c<a){var d=a;a=c,c=d,d=l,l=h,h=d}i.isConstraint(a,c)||n(r[a],r[c],r[l],r[h])<0&&s.push(a,c)}}t.exports=function(r,i){for(var s=[],a=r.length,c=i.stars,l=0;l<a;++l)for(var h=c[l],d=1;d<h.length;d+=2)if(!((m=h[d])<l)&&!i.isConstraint(l,m)){for(var u=h[d-1],_=-1,p=1;p<h.length;p+=2)if(h[p-1]===m){_=h[p];break}_<0||n(r[l],r[m],r[u],r[_])<0&&s.push(l,m)}for(;s.length>0;){for(var m=s.pop(),A=(u=-1,_=-1,h=c[l=s.pop()],1);A<h.length;A+=2){var g=h[A-1],f=h[A];g===m?_=f:f===m&&(u=g)}u<0||_<0||(n(r[l],r[m],r[u],r[_])>=0||(i.flip(l,m),o(r,i,s,u,l,_),o(r,i,s,l,_,u),o(r,i,s,_,m,u),o(r,i,s,m,u,_)))}}}}),y0r=Um({"node_modules/cdt2d/lib/filter.js"(e,t){var n=pbe();function o(i,s,a,c,l,h,d){this.cells=i,this.neighbor=s,this.flags=c,this.constraint=a,this.active=l,this.next=h,this.boundary=d}function r(i,s){return i[0]-s[0]||i[1]-s[1]||i[2]-s[2]}t.exports=function(i,s,a){var c=function(C,b){for(var I=C.cells(),v=I.length,P=0;P<v;++P){var M=(j=I[P])[0],B=j[1],T=j[2];B<T?B<M&&(j[0]=B,j[1]=T,j[2]=M):T<M&&(j[0]=T,j[1]=M,j[2]=B)}I.sort(r);var N=Array(v);for(P=0;P<N.length;++P)N[P]=0;var D=[],L=[],H=Array(3*v),V=Array(3*v),O=null;b&&(O=[]);var U=new o(I,H,V,N,D,L,O);for(P=0;P<v;++P)for(var j=I[P],Y=0;Y<3;++Y){M=j[Y],B=j[(Y+1)%3];var X=H[3*P+Y]=U.locate(B,M,C.opposite(B,M)),K=V[3*P+Y]=C.isConstraint(M,B);X<0&&(K?L.push(P):(D.push(P),N[P]=1),b&&O.push([B,M,-1]))}return U}(i,a);if(s===0)return a?c.cells.concat(c.boundary):c.cells;var l=1,{active:h,next:d,flags:u,cells:_,constraint:p,neighbor:m}=c;for(;h.length>0||d.length>0;){for(;h.length>0;){var A=h.pop();if(u[A]!==-l){u[A]=l,_[A];for(var g=0;g<3;++g){var f=m[3*A+g];f>=0&&u[f]===0&&(p[3*A+g]?d.push(f):(h.push(f),u[f]=l))}}}var y=d;d=h,h=y,d.length=0,l=-l}var x=function(C,b,I){for(var v=0,P=0;P<C.length;++P)b[P]===I&&(C[v++]=C[P]);return C.length=v,C}(_,u,s);if(a)return x.concat(c.boundary);return x},o.prototype.locate=function(){var i=[0,0,0];return function(s,a,c){var l=s,h=a,d=c;return a<c?a<s&&(l=a,h=c,d=s):c<s&&(l=c,h=s,d=a),l<0?-1:(i[0]=l,i[1]=h,i[2]=d,n.eq(this.cells,i,r))}}()}}),x0r=Um({"node_modules/cdt2d/cdt2d.js"(e,t){var n=_0r(),o=g0r(),r=f0r(),i=y0r();function s(l){return[Math.min(l[0],l[1]),Math.max(l[0],l[1])]}function a(l,h){return l[0]-h[0]||l[1]-h[1]}function c(l,h,d){return h in l?l[h]:d}t.exports=function(l,h,d){Array.isArray(h)?(d=d||{},h=h||[]):(d=h||{},h=[]);var u=!!c(d,"delaunay",!0),_=!!c(d,"interior",!0),p=!!c(d,"exterior",!0),m=!!c(d,"infinity",!1);if(!_&&!p||l.length===0)return[];var A=n(l,h);if(u||_!==p||m){for(var g=o(l.length,function(x){return x.map(s).sort(a)}(h)),f=0;f<A.length;++f){var y=A[f];g.addTriangle(y[0],y[1],y[2])}return u&&r(l,g),p?_?m?i(g,0,m):g.cells():i(g,1,m):i(g,-1)}return A}}});function oB(e,t){return Array.isArray(t)?[e.a*t[0]+e.c*t[1]+e.e,e.b*t[0]+e.d*t[1]+e.f]:{x:e.a*t.x+e.c*t.y+e.e,y:e.b*t.x+e.d*t.y+e.f}}function hUt(e,t){return t.map((n)=>oB(e,n))}function dUt(e){let{a:t,b:n,c:o,d:r,e:i,f:s}=e,a=t*r-n*o;return{a:r/a,b:n/-a,c:o/-a,d:t/a,e:(r*i-o*s)/-a,f:(n*i-t*s)/a}}function pLt(e){return e===void 0}function DV(e,t=0){return{a:1,c:0,e,b:0,d:1,f:t}}function U$e(...e){let t=(n,o)=>({a:n.a*o.a+n.c*o.b,c:n.a*o.c+n.c*o.d,e:n.a*o.e+n.c*o.f+n.e,b:n.b*o.a+n.d*o.b,d:n.b*o.c+n.d*o.d,f:n.b*o.e+n.d*o.f+n.f});switch((e=Array.isArray(e[0])?e[0]:e).length){case 0:throw Error("no matrices provided");case 1:return e[0];case 2:return t(e[0],e[1]);default:{let[n,o,...r]=e;return U$e(t(n,o),...r)}}}function W$e(...e){return U$e(...e)}var{cos:C0r,sin:b0r,PI:I0r}=Math;function uUt(e,t,n){let o=C0r(e),r=b0r(e),i={a:o,c:-r,e:0,b:r,d:o,f:0};return pLt(t)||pLt(n)?i:U$e([DV(t,n),i,DV(-t,-n)])}function pUt(e,t=void 0,n=void 0){return uUt(e*I0r/180,t,n)}var{tan:nLs}=Math,v0r=(Dje(c0r()),Dje(u0r()),(()=>{let e=new Uint8Array(4);new Uint32Array(e.buffer)[0]=1,e[0]})(),globalThis.Int8Array,globalThis.Uint8Array,globalThis.Int16Array,globalThis.Uint16Array,globalThis.Int32Array,globalThis.Uint32Array,globalThis.BigUint64Array,globalThis.BigInt64Array,globalThis.Float32Array,globalThis.Float64Array,[]);for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)1&t?t=3988292384^t>>>1:t>>>=1;v0r[e]=t}var S0r=new Uint16Array([255]),P0r=(new Uint8Array(S0r.buffer)[0],new Uint16Array([255]));new Uint8Array(P0r.buffer)[0],new Uint8Array(0),Uint8Array.of(137,80,78,71,13,10,26,10),new TextDecoder("latin1");function P5(){return P5=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},P5.apply(null,arguments)}function eCe(e,t){return(eCe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n})(e,t)}function mUt(e){return(mUt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(e)}function _Ut(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(_Ut=function(){return!!e})()}function Nje(e){var t=typeof Map=="function"?new Map:void 0;return Nje=function(n){if(n===null||!function(r){try{return Function.toString.call(r).indexOf("[native code]")!==-1}catch(i){return typeof r=="function"}}(n))return n;if(typeof n!="function")throw TypeError("Super expression must either be null or a function");if(t!==void 0){if(t.has(n))return t.get(n);t.set(n,o)}function o(){return function(r,i,s){if(_Ut())return Reflect.construct.apply(null,arguments);var a=[null];a.push.apply(a,i);var c=new(r.bind.apply(r,a));return s&&eCe(c,s.prototype),c}(n,arguments,mUt(this).constructor)}return o.prototype=Object.create(n.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),eCe(o,n)},Nje(e)}var E0r={1:`Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }).

`,2:`Passed invalid arguments to hsla, please pass multiple numbers e.g. hsla(360, 0.75, 0.4, 0.7) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75, alpha: 0.7 }).

`,3:`Passed an incorrect argument to a color function, please pass a string representation of a color.

`,4:`Couldn't generate valid rgb string from %s, it returned %s.

`,5:`Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.

`,6:`Passed invalid arguments to rgb, please pass multiple numbers e.g. rgb(255, 205, 100) or an object e.g. rgb({ red: 255, green: 205, blue: 100 }).

`,7:`Passed invalid arguments to rgba, please pass multiple numbers e.g. rgb(255, 205, 100, 0.75) or an object e.g. rgb({ red: 255, green: 205, blue: 100, alpha: 0.75 }).

`,8:`Passed invalid argument to toColorString, please pass a RgbColor, RgbaColor, HslColor or HslaColor object.

`,9:`Please provide a number of steps to the modularScale helper.

`,10:`Please pass a number or one of the predefined scales to the modularScale helper as the ratio.

`,11:`Invalid value passed as base to modularScale, expected number or em string but got "%s"

`,12:`Expected a string ending in "px" or a number passed as the first argument to %s(), got "%s" instead.

`,13:`Expected a string ending in "px" or a number passed as the second argument to %s(), got "%s" instead.

`,14:`Passed invalid pixel value ("%s") to %s(), please pass a value like "12px" or 12.

`,15:`Passed invalid base value ("%s") to %s(), please pass a value like "12px" or 12.

`,16:`You must provide a template to this method.

`,17:`You passed an unsupported selector state to this method.

`,18:`minScreen and maxScreen must be provided as stringified numbers with the same units.

`,19:`fromSize and toSize must be provided as stringified numbers with the same units.

`,20:`expects either an array of objects or a single object with the properties prop, fromSize, and toSize.

`,21:"expects the objects in the first argument array to have the properties `prop`, `fromSize`, and `toSize`.\n\n",22:"expects the first argument object to have the properties `prop`, `fromSize`, and `toSize`.\n\n",23:`fontFace expects a name of a font-family.

`,24:`fontFace expects either the path to the font file(s) or a name of a local copy.

`,25:`fontFace expects localFonts to be an array.

`,26:`fontFace expects fileFormats to be an array.

`,27:`radialGradient requries at least 2 color-stops to properly render.

`,28:`Please supply a filename to retinaImage() as the first argument.

`,29:`Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.

`,30:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",31:`The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation

`,32:`To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])
To pass a single animation please supply them in simple values, e.g. animation('rotate', '2s')

`,33:`The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation

`,34:`borderRadius expects a radius value as a string or number as the second argument.

`,35:`borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.

`,36:`Property must be a string value.

`,37:`Syntax Error at %s.

`,38:`Formula contains a function that needs parentheses at %s.

`,39:`Formula is missing closing parenthesis at %s.

`,40:`Formula has too many closing parentheses at %s.

`,41:`All values in a formula must have the same unit or be unitless.

`,42:`Please provide a number of steps to the modularScale helper.

`,43:`Please pass a number or one of the predefined scales to the modularScale helper as the ratio.

`,44:`Invalid value passed as base to modularScale, expected number or em/rem string but got %s.

`,45:`Passed invalid argument to hslToColorString, please pass a HslColor or HslaColor object.

`,46:`Passed invalid argument to rgbToColorString, please pass a RgbColor or RgbaColor object.

`,47:`minScreen and maxScreen must be provided as stringified numbers with the same units.

`,48:`fromSize and toSize must be provided as stringified numbers with the same units.

`,49:`Expects either an array of objects or a single object with the properties prop, fromSize, and toSize.

`,50:`Expects the objects in the first argument array to have the properties prop, fromSize, and toSize.

`,51:`Expects the first argument object to have the properties prop, fromSize, and toSize.

`,52:`fontFace expects either the path to the font file(s) or a name of a local copy.

`,53:`fontFace expects localFonts to be an array.

`,54:`fontFace expects fileFormats to be an array.

`,55:`fontFace expects a name of a font-family.

`,56:`linearGradient requries at least 2 color-stops to properly render.

`,57:`radialGradient requries at least 2 color-stops to properly render.

`,58:`Please supply a filename to retinaImage() as the first argument.

`,59:`Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.

`,60:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",61:`Property must be a string value.

`,62:`borderRadius expects a radius value as a string or number as the second argument.

`,63:`borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.

`,64:`The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation.

`,65:`To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s').

`,66:`The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation.

`,67:`You must provide a template to this method.

`,68:`You passed an unsupported selector state to this method.

`,69:`Expected a string ending in "px" or a number passed as the first argument to %s(), got %s instead.

`,70:`Expected a string ending in "px" or a number passed as the second argument to %s(), got %s instead.

`,71:`Passed invalid pixel value %s to %s(), please pass a value like "12px" or 12.

`,72:`Passed invalid base value %s to %s(), please pass a value like "12px" or 12.

`,73:`Please provide a valid CSS variable.

`,74:`CSS variable not found and no default was provided.

`,75:`important requires a valid style object, got a %s instead.

`,76:`fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.

`,77:`remToPx expects a value in "rem" but you provided it in "%s".

`,78:`base must be set in "px" or "%" but you set it in "%s".
`};function M0r(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];var o,r=t[0],i=[];for(o=1;o<t.length;o+=1)i.push(t[o]);return i.forEach(function(s){r=r.replace(/%[a-z]/,s)}),r}var I5=function(e){var t,n;function o(r){var i;for(var s=arguments.length,a=Array(s>1?s-1:0),c=1;c<s;c++)a[c-1]=arguments[c];return i=e.call(this,M0r.apply(void 0,[E0r[r]].concat(a)))||this,function(l){if(l===void 0)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return l}(i)}return n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,eCe(t,n),o}(Nje(Error));function mLt(e,t){return e.substr(-t.length)===t}var w0r=/^([+-]?(?:\d+|\d*\.\d+))([a-z]*|%)$/;function _Lt(e){return typeof e!="string"?e:e.match(w0r)?parseFloat(e):e}var gLt=function(e){return function(t,n){n===void 0&&(n="16px");var o=t,r=n;if(typeof t=="string"){if(!mLt(t,"px"))throw new I5(69,e,t);o=_Lt(t)}if(typeof n=="string"){if(!mLt(n,"px"))throw new I5(70,e,n);r=_Lt(n)}if(typeof o=="string")throw new I5(71,t,e);if(typeof r=="string")throw new I5(72,n,e);return""+o/r+e}};gLt("em"),gLt("rem");function SWe(e){return Math.round(255*e)}function B0r(e,t,n){return SWe(e)+","+SWe(t)+","+SWe(n)}function Hce(e,t,n,o){if(o===void 0&&(o=B0r),t===0)return o(n,n,n);var r=(e%360+360)%360/60,i=(1-Math.abs(2*n-1))*t,s=i*(1-Math.abs(r%2-1)),a=0,c=0,l=0;r>=0&&r<1?(a=i,c=s):r>=1&&r<2?(a=s,c=i):r>=2&&r<3?(c=i,l=s):r>=3&&r<4?(c=s,l=i):r>=4&&r<5?(a=s,l=i):r>=5&&r<6&&(a=i,l=s);var h=n-i/2;return o(a+h,c+h,l+h)}var ALt={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},T0r=/^#[a-fA-F0-9]{6}$/,D0r=/^#[a-fA-F0-9]{8}$/,N0r=/^#[a-fA-F0-9]{3}$/,R0r=/^#[a-fA-F0-9]{4}$/,PWe=/^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i,Q0r=/^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i,k0r=/^hsl\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i,L0r=/^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;function NV(e){if(typeof e!="string")throw new I5(3);var t=function(u){if(typeof u!="string")return u;var _=u.toLowerCase();return ALt[_]?"#"+ALt[_]:u}(e);if(t.match(T0r))return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16)};if(t.match(D0r)){var n=parseFloat((parseInt(""+t[7]+t[8],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16),alpha:n}}if(t.match(N0r))return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16)};if(t.match(R0r)){var o=parseFloat((parseInt(""+t[4]+t[4],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16),alpha:o}}var r=PWe.exec(t);if(r)return{red:parseInt(""+r[1],10),green:parseInt(""+r[2],10),blue:parseInt(""+r[3],10)};var i=Q0r.exec(t.substring(0,50));if(i)return{red:parseInt(""+i[1],10),green:parseInt(""+i[2],10),blue:parseInt(""+i[3],10),alpha:parseFloat(""+i[4])>1?parseFloat(""+i[4])/100:parseFloat(""+i[4])};var s=k0r.exec(t);if(s){var a="rgb("+Hce(parseInt(""+s[1],10),parseInt(""+s[2],10)/100,parseInt(""+s[3],10)/100)+")",c=PWe.exec(a);if(!c)throw new I5(4,t,a);return{red:parseInt(""+c[1],10),green:parseInt(""+c[2],10),blue:parseInt(""+c[3],10)}}var l=L0r.exec(t.substring(0,50));if(l){var h="rgb("+Hce(parseInt(""+l[1],10),parseInt(""+l[2],10)/100,parseInt(""+l[3],10)/100)+")",d=PWe.exec(h);if(!d)throw new I5(4,t,h);return{red:parseInt(""+d[1],10),green:parseInt(""+d[2],10),blue:parseInt(""+d[3],10),alpha:parseFloat(""+l[4])>1?parseFloat(""+l[4])/100:parseFloat(""+l[4])}}throw new I5(5)}function ek(e){return function(t){var n,o=t.red/255,r=t.green/255,i=t.blue/255,s=Math.max(o,r,i),a=Math.min(o,r,i),c=(s+a)/2;if(s===a)return t.alpha!==void 0?{hue:0,saturation:0,lightness:c,alpha:t.alpha}:{hue:0,saturation:0,lightness:c};var l=s-a,h=c>0.5?l/(2-s-a):l/(s+a);switch(s){case o:n=(r-i)/l+(r<i?6:0);break;case r:n=(i-o)/l+2;break;default:n=(o-r)/l+4}return n*=60,t.alpha!==void 0?{hue:n,saturation:h,lightness:c,alpha:t.alpha}:{hue:n,saturation:h,lightness:c}}(NV(e))}var Rje=function(e){return e.length===7&&e[1]===e[2]&&e[3]===e[4]&&e[5]===e[6]?"#"+e[1]+e[3]+e[5]:e};function ZO(e){var t=e.toString(16);return t.length===1?"0"+t:t}function EWe(e){return ZO(Math.round(255*e))}function H0r(e,t,n){return Rje("#"+EWe(e)+EWe(t)+EWe(n))}function c4e(e,t,n){return Hce(e,t,n,H0r)}function Qje(e,t,n){if(typeof e=="number"&&typeof t=="number"&&typeof n=="number")return Rje("#"+ZO(e)+ZO(t)+ZO(n));if(typeof e=="object"&&t===void 0&&n===void 0)return Rje("#"+ZO(e.red)+ZO(e.green)+ZO(e.blue));throw new I5(6)}function mbe(e,t,n,o){if(typeof e=="string"&&typeof t=="number"){var r=NV(e);return"rgba("+r.red+","+r.green+","+r.blue+","+t+")"}if(typeof e=="number"&&typeof t=="number"&&typeof n=="number"&&typeof o=="number")return o>=1?Qje(e,t,n):"rgba("+e+","+t+","+n+","+o+")";if(typeof e=="object"&&t===void 0&&n===void 0&&o===void 0)return e.alpha>=1?Qje(e.red,e.green,e.blue):"rgba("+e.red+","+e.green+","+e.blue+","+e.alpha+")";throw new I5(7)}function tk(e){if(typeof e!="object")throw new I5(8);if(function(t){return typeof t.red=="number"&&typeof t.green=="number"&&typeof t.blue=="number"&&typeof t.alpha=="number"}(e))return mbe(e);if(function(t){return typeof t.red=="number"&&typeof t.green=="number"&&typeof t.blue=="number"&&(typeof t.alpha!="number"||t.alpha===void 0)}(e))return Qje(e);if(function(t){return typeof t.hue=="number"&&typeof t.saturation=="number"&&typeof t.lightness=="number"&&typeof t.alpha=="number"}(e))return function(t,n,o,r){if(typeof t=="number"&&typeof n=="number"&&typeof o=="number"&&typeof r=="number")return r>=1?c4e(t,n,o):"rgba("+Hce(t,n,o)+","+r+")";if(typeof t=="object"&&n===void 0&&o===void 0&&r===void 0)return t.alpha>=1?c4e(t.hue,t.saturation,t.lightness):"rgba("+Hce(t.hue,t.saturation,t.lightness)+","+t.alpha+")";throw new I5(2)}(e);if(function(t){return typeof t.hue=="number"&&typeof t.saturation=="number"&&typeof t.lightness=="number"&&(typeof t.alpha!="number"||t.alpha===void 0)}(e))return function(t,n,o){if(typeof t=="number"&&typeof n=="number"&&typeof o=="number")return c4e(t,n,o);if(typeof t=="object"&&n===void 0&&o===void 0)return c4e(t.hue,t.saturation,t.lightness);throw new I5(1)}(e);throw new I5(8)}function gUt(e,t,n){return function(){var o=n.concat(Array.prototype.slice.call(arguments));return o.length>=t?e.apply(this,o):gUt(e,t,o)}}function L3(e){return gUt(e,e.length,[])}L3(function(e,t){if(t==="transparent")return t;var n=ek(t);return tk(P5({},n,{hue:n.hue+parseFloat(e)}))});function Rq(e,t,n){return Math.max(e,Math.min(t,n))}L3(function(e,t){if(t==="transparent")return t;var n=ek(t);return tk(P5({},n,{lightness:Rq(0,1,n.lightness-parseFloat(e))}))});L3(function(e,t){if(t==="transparent")return t;var n=ek(t);return tk(P5({},n,{saturation:Rq(0,1,n.saturation-parseFloat(e))}))});L3(function(e,t){if(t==="transparent")return t;var n=ek(t);return tk(P5({},n,{lightness:Rq(0,1,n.lightness+parseFloat(e))}))});var AUt=L3(function(e,t,n){if(t==="transparent")return n;if(n==="transparent")return t;if(e===0)return n;var o=NV(t),r=P5({},o,{alpha:typeof o.alpha=="number"?o.alpha:1}),i=NV(n),s=P5({},i,{alpha:typeof i.alpha=="number"?i.alpha:1}),a=r.alpha-s.alpha,c=2*parseFloat(e)-1,l=((c*a===-1?c:c+a)/(1+c*a)+1)/2,h=1-l;return mbe({red:Math.floor(r.red*l+s.red*h),green:Math.floor(r.green*l+s.green*h),blue:Math.floor(r.blue*l+s.blue*h),alpha:r.alpha*parseFloat(e)+s.alpha*(1-parseFloat(e))})});L3(function(e,t){if(t==="transparent")return t;var n=NV(t);return mbe(P5({},n,{alpha:Rq(0,1,(100*(typeof n.alpha=="number"?n.alpha:1)+100*parseFloat(e))/100)}))});L3(function(e,t){if(t==="transparent")return t;var n=ek(t);return tk(P5({},n,{saturation:Rq(0,1,n.saturation+parseFloat(e))}))});L3(function(e,t){return t==="transparent"?t:tk(P5({},ek(t),{hue:parseFloat(e)}))});L3(function(e,t){return t==="transparent"?t:tk(P5({},ek(t),{lightness:parseFloat(e)}))});L3(function(e,t){return t==="transparent"?t:tk(P5({},ek(t),{saturation:parseFloat(e)}))});L3(function(e,t){return t==="transparent"?t:AUt(parseFloat(e),"rgb(0, 0, 0)",t)});L3(function(e,t){return t==="transparent"?t:AUt(parseFloat(e),"rgb(255, 255, 255)",t)});var A$=L3(function(e,t){if(t==="transparent")return t;var n=NV(t);return mbe(P5({},n,{alpha:Rq(0,1,+(100*(typeof n.alpha=="number"?n.alpha:1)-100*parseFloat(e)).toFixed(2)/100)}))}),fLt={0:"M0.301025 0.257813 L0.206593 0.283385 L0.122042 0.361307 L0.075923 0.474441 L0.064942 0.642221 L0.091296 0.78289 L0.159376 0.899463 L0.257104 0.961214 L0.344948 0.961214 L0.442678 0.899463 L0.510757 0.78289 L0.537111 0.642221 L0.526131 0.474441 L0.480012 0.361307 L0.39546 0.283385 L0.301025 0.257813",1:"M0.220426 0.40845 L0.381626 0.270996 L0.381626 0.948966",2:"M0.110409 0.39212 L0.125621 0.342293 L0.170571 0.295823 L0.244237 0.26431 L0.291518 0.257813 L0.373319 0.263799 L0.434683 0.290705 L0.468239 0.331966 L0.480292 0.379913 L0.479492 0.411806 L0.465088 0.465192 L0.402571 0.568988 L0.245134 0.766438 L0.07959 0.948045 L0.522462 0.948045",3:"M0.081606 0.345073 L0.119154 0.315633 L0.178996 0.284091 L0.255265 0.257813 L0.349133 0.263062 L0.43127 0.289348 L0.48994 0.336662 L0.525141 0.394491 L0.513407 0.457577 L0.466472 0.504892 L0.384334 0.541692 L0.290464 0.56272 L0.20833 0.573235 L0.290464 0.583749 L0.384334 0.610035 L0.466472 0.652092 L0.519274 0.709922 L0.531007 0.773007 L0.50754 0.841351 L0.454738 0.899179 L0.3726 0.946494 L0.310412 0.961214 L0.209503 0.959111 L0.127367 0.946494 L0.071046 0.929671",4:"M0.418494 0.270996 L0.048828 0.724199 L0.553224 0.724199 M0.414181 0.578167 L0.414181 0.94897",5:"M0.074951 0.270996 L0.074951 0.614701 L0.267655 0.5695 L0.405247 0.586502 L0.460002 0.617189 L0.498028 0.660731 L0.527101 0.779401 L0.513352 0.841049 L0.477274 0.889568 L0.406378 0.93463 L0.324445 0.958337 L0.247399 0.962139 L0.182516 0.949767 L0.130068 0.925508 L0.074951 0.875607 M0.074951 0.270996 L0.527101 0.270996",6:"M0.428549 0.257813 L0.341433 0.285053 L0.26073 0.312099 L0.192188 0.360182 L0.138902 0.410969 L0.098219 0.500422 L0.070249 0.584267 L0.067264 0.670716 L0.065164 0.756863 L0.087163 0.820973 L0.108168 0.861042 L0.157916 0.913131 L0.210981 0.948192 L0.29279 0.961214 L0.384548 0.956206 L0.456409 0.924151 L0.507262 0.881077 L0.5349 0.821975 L0.537111 0.771889 L0.521634 0.718798 L0.498418 0.67372 L0.463042 0.636657 L0.414398 0.613617 L0.34696 0.598591 L0.28284 0.595587 L0.215403 0.605604 L0.145756 0.641665 L0.109274 0.678729 L0.064942 0.724006",7:"M0.071534 0.270996 L0.530519 0.270996 L0.495935 0.291702 L0.477752 0.305407 L0.435186 0.346112 L0.412067 0.374136 L0.388565 0.40796 L0.365315 0.448098 L0.342943 0.495062 L0.322081 0.549366 L0.303364 0.611524 L0.287416 0.68205 L0.270077 0.80465 L0.26253 0.94897",8:"M0.286761 0.257813 L0.210684 0.27162 L0.1414 0.305622 L0.092494 0.382125 L0.111513 0.450128 L0.16857 0.502193 L0.228345 0.539382 L0.377781 0.594635 L0.470161 0.645637 L0.52586 0.706203 L0.538087 0.792269 L0.506841 0.87621 L0.438915 0.927212 L0.339743 0.961214 L0.263666 0.959089 L0.174004 0.929337 L0.102003 0.881523 L0.063965 0.811395 L0.066682 0.741266 L0.102003 0.671139 L0.180797 0.608448 L0.259591 0.580822 L0.358762 0.548945 L0.456576 0.49688 L0.486463 0.446941 L0.487822 0.362999 L0.453859 0.302434 L0.384574 0.265245 L0.286761 0.257813",9:"M0.511026 0.437812 L0.491026 0.347812 L0.451026 0.297812 L0.391026 0.267812 L0.311026 0.257813 L0.231026 0.267812 L0.161026 0.297812 L0.111026 0.347812 L0.091026 0.417812 L0.111026 0.487812 L0.161026 0.537812 L0.231026 0.567812 L0.311026 0.577812 L0.391026 0.557812 L0.451026 0.517812 L0.491026 0.477812 L0.511026 0.437812 M0.510026 0.438812 L0.434026 0.636812 L0.381026 0.777812 L0.337026 0.879812 L0.301026 0.957812","!":"M0.301026 0.270996 L0.301026 0.749566 M0.251466 0.94897 L0.350587 0.94897",'"':"M0.16504 0.270996 L0.16504 0.523022 M0.437013 0.270996 L0.437013 0.523022","#":"M0.20958 0.282227 L0.146515 0.949754 M0.461844 0.282227 L0.398779 0.949754 M0.032999 0.526969 L0.600587 0.452796 M0.001465 0.82366 L0.569055 0.749486",$:"M0.307121 0.240234 L0.307121 1.083502 M0.490031 0.415915 L0.404676 0.328075 L0.23396 0.310507 L0.136407 0.398347 L0.099828 0.521324 L0.124213 0.591596 L0.197379 0.644299 L0.429061 0.697003 L0.502224 0.749708 L0.526613 0.837547 L0.477836 0.960526 L0.355897 1.013228 L0.197379 0.99566 L0.112021 0.942957 L0.07544 0.837547","'":"M0.301026 0.270996 L0.301026 0.523022","(":"M0.413087 0.241211 L0.372337 0.28347 L0.331589 0.334184 L0.290838 0.393349 L0.25009 0.460965 L0.219528 0.528584 L0.199153 0.5962 L0.188966 0.655364 L0.199153 0.714529 L0.219528 0.782146 L0.25009 0.849764 L0.290838 0.91738 L0.331589 0.976544 L0.372337 1.027258 L0.413087 1.069491",")":"M0.188966 0.241211 L0.229716 0.28347 L0.270466 0.334184 L0.311213 0.393349 L0.351964 0.460965 L0.382526 0.528584 L0.4029 0.5962 L0.413087 0.655364 L0.4029 0.714529 L0.382526 0.782146 L0.351964 0.849764 L0.311213 0.91738 L0.270466 0.976544 L0.229716 1.027258 L0.188966 1.069491","*":"M0.301026 0.458702 L0.301026 0.681942 M0.301026 0.458702 L0.520997 0.536834 M0.301026 0.458702 L0.439954 0.257813 M0.301026 0.458702 L0.162098 0.257813 M0.301026 0.458702 L0.081055 0.536834","+":"M0.042969 0.66845 L0.559083 0.66845 M0.301023 0.428223 L0.301023 0.908661",",":"M0.38672 0.852051 L0.215333 1.030661 L0.301025 1.119971","-":"M0.173829 0.686035 L0.428224 0.686035",".":"M0.362549 0.851074 L0.239503 0.851074","/":"M0.062501 1.035249 L0.539551 0.270996","<":"M0.559083 0.441895 L0.042969 0.66939 L0.042969 0.66939 L0.559083 0.896902","=":"M0.042969 0.545898 L0.559083 0.545898 M0.042969 0.80837 L0.559083 0.80837",">":"M0.042969 0.441895 L0.559083 0.66939 L0.559083 0.66939 L0.042969 0.896902",A:"M0.018067 0.94897 L0.290179 0.270996 L0.583986 0.94897 M0.155303 0.684521 L0.433548 0.684521",B:"M0.063965 0.94897 L0.063965 0.278953 L0.209356 0.270996 L0.342486 0.294394 L0.432179 0.37292 L0.418224 0.48773 L0.312686 0.549166 L0.084728 0.575531 L0.306377 0.589434 L0.468877 0.647456 L0.538087 0.736658 L0.5324 0.85202 L0.501247 0.902983 L0.42355 0.944398 L0.063965 0.94897",C:"M0.529054 0.419847 L0.498425 0.345196 L0.442238 0.292341 L0.33583 0.257813 L0.257199 0.268357 L0.187906 0.303748 L0.120243 0.385432 L0.072998 0.599844 L0.110073 0.815385 L0.165381 0.902183 L0.222883 0.942801 L0.334904 0.961214 L0.43253 0.937679 L0.504816 0.868999 L0.529054 0.772065",D:"M0.064454 0.94897 L0.071838 0.285078 L0.171217 0.270996 L0.247348 0.272633 L0.37101 0.306078 L0.462461 0.378304 L0.514748 0.475555 L0.535591 0.576392 L0.537599 0.652313 L0.528065 0.717381 L0.508562 0.772419 L0.445948 0.855695 L0.362356 0.90871 L0.225203 0.945862 L0.064454 0.94897",E:"M0.080078 0.270996 L0.080078 0.94897 M0.080078 0.270996 L0.521974 0.270996 M0.080078 0.609981 L0.389405 0.609981 M0.080078 0.94897 L0.521974 0.94897",F:"M0.086426 0.270996 L0.086426 0.94897 M0.091304 0.275607 L0.515626 0.275607 M0.091304 0.607677 L0.447344 0.607677",G:"M0.498034 0.284943 L0.374621 0.257813 L0.244219 0.268648 L0.160577 0.311997 L0.094556 0.398116 L0.056397 0.58404 L0.076752 0.785532 L0.120865 0.858197 L0.188947 0.916734 L0.271008 0.953591 L0.357069 0.961214 L0.43715 0.932047 L0.501262 0.858539 L0.545656 0.648611 L0.329595 0.648131",H:"M0.066895 0.270996 L0.066895 0.94897 M0.066895 0.595658 L0.530009 0.595658 M0.535157 0.270996 L0.535157 0.94897",I:"M0.301026 0.270996 L0.301026 0.94897",J:"M0.506839 0.270996 L0.507814 0.782193 L0.498468 0.846168 L0.480733 0.880789 L0.455864 0.90832 L0.426095 0.929408 L0.360746 0.954812 L0.302508 0.962139 L0.223573 0.953638 L0.16538 0.930312 L0.137072 0.907715 L0.116428 0.880312 L0.102822 0.848819 L0.095633 0.813947 L0.094239 0.776413",K:"M0.035401 0.270996 L0.035401 0.94897 M0.502258 0.316194 L0.035401 0.687823 M0.212484 0.582361 L0.566652 0.933903",L:"M0.07544 0.270996 L0.07544 0.94897 L0.526613 0.94897",M:"M0.042481 0.94897 L0.042481 0.270996 L0.301027 0.712492 L0.559571 0.270996 L0.559571 0.94897",N:"M0.067871 0.94897 L0.067871 0.270996 L0.534181 0.94897 L0.525031 0.270996",O:"M0.287293 0.961214 L0.19843 0.933567 L0.1172 0.849451 L0.057129 0.563945 L0.114348 0.350255 L0.18455 0.289392 L0.306101 0.257813 L0.42054 0.29572 L0.487543 0.365003 L0.544923 0.625294 L0.516366 0.789624 L0.465476 0.884596 L0.375084 0.949287 L0.287293 0.961214",P:"M0.070557 0.94897 L0.070557 0.28379 L0.20704 0.270996 L0.329134 0.278993 L0.408525 0.300514 L0.444022 0.317908 L0.500637 0.368929 L0.525796 0.423728 L0.531496 0.50384 L0.508934 0.554205 L0.473724 0.582043 L0.417577 0.604365 L0.336375 0.620372 L0.226014 0.629268 L0.082368 0.630258",Q:"M0.282435 1.050813 L0.195447 1.019646 L0.115933 0.924817 L0.057129 0.602943 L0.113139 0.362034 L0.18186 0.293418 L0.300844 0.257813 L0.412868 0.300553 L0.478457 0.37866 L0.534625 0.672103 L0.506671 0.857367 L0.456855 0.964437 L0.368371 1.037368 L0.282435 1.050813 M0.341225 0.815559 L0.544923 1.070653",R:"M0.034912 0.944112 L0.034912 0.288556 L0.227127 0.270996 L0.362038 0.276867 L0.443423 0.294907 L0.477644 0.309614 L0.505809 0.328757 L0.526616 0.352817 L0.544963 0.418061 L0.543241 0.475921 L0.524463 0.517817 L0.49076 0.546518 L0.444265 0.564799 L0.355195 0.578739 L0.047653 0.589627 M0.303054 0.617306 L0.56714 0.94897",S:"M0.483037 0.364333 L0.407613 0.267477 L0.22883 0.257813 L0.128623 0.327565 L0.087712 0.455539 L0.104656 0.518727 L0.168054 0.573307 L0.41928 0.617318 L0.503796 0.669342 L0.535157 0.759324 L0.493846 0.900055 L0.367668 0.961214 L0.205436 0.956661 L0.116711 0.907038 L0.066895 0.790334",T:"M0.022949 0.270996 L0.579103 0.270996 M0.309284 0.270996 L0.309284 0.94897",U:"M0.072022 0.270996 L0.07308 0.648875 L0.080372 0.75167 L0.099024 0.827813 L0.134786 0.885729 L0.181571 0.924023 L0.251464 0.95168 L0.339655 0.962139 L0.401553 0.951668 L0.45232 0.924086 L0.482701 0.891771 L0.495745 0.870529 L0.515699 0.81637 L0.525014 0.744626 L0.530031 0.272017",V:"M0.027832 0.270996 L0.320083 0.94897 L0.57422 0.270996",W:"M0 0.270996 L0.079799 0.940377 L0.285198 0.472884 L0.505255 0.94897 L0.602052 0.270996",X:"M0.009034 0.270996 L0.586805 0.94897 M0.593019 0.270996 L0.015246 0.94897",Y:"M0.018067 0.270996 L0.293132 0.574135 M0.583986 0.271959 L0.294954 0.57606 L0.305277 0.94897",Z:"M0.053711 0.270996 L0.548341 0.270996 L0.053711 0.94897 L0.548341 0.94897","[":"M0.404542 0.240234 L0.197511 0.240234 L0.197511 1.069424 L0.404542 1.069424","\\":"M0.062501 0.270996 L0.539551 1.035249","]":"M0.19751 0.240234 L0.404542 0.240234 L0.404542 1.069424 L0.19751 1.069424","^":"M0.035156 0.523931 L0.301024 0.270996 L0.566896 0.523931",_:"M0 1.160601 L0.602052 1.160601",a:"M0.527101 0.439941 L0.527101 0.973965 M0.527101 0.553824 L0.451366 0.477535 L0.376759 0.439941 L0.263722 0.439941 L0.187989 0.477535 L0.112255 0.553824 L0.074951 0.66881 L0.074951 0.745099 L0.112255 0.85898 L0.187989 0.93527 L0.263722 0.973965 L0.376759 0.973965 L0.451366 0.93527 L0.527101 0.85898",b:"M0.07666 0.240234 L0.07666 0.959985 M0.07666 0.582737 L0.151822 0.514237 L0.225865 0.480483 L0.338045 0.480483 L0.413211 0.514237 L0.488374 0.582737 L0.525392 0.685983 L0.525392 0.754485 L0.488374 0.856739 L0.413211 0.92524 L0.338045 0.959985 L0.225865 0.959985 L0.151822 0.92524 L0.07666 0.856739",c:"M0.512452 0.553823 L0.441624 0.477535 L0.371854 0.439941 L0.26614 0.439941 L0.195312 0.477535 L0.124486 0.553823 L0.0896 0.668808 L0.0896 0.745099 L0.124486 0.858979 L0.195312 0.93527 L0.26614 0.973965 L0.371854 0.973965 L0.441624 0.93527 L0.512452 0.858979",d:"M0.525392 0.240234 L0.525392 0.959985 M0.525392 0.582737 L0.450232 0.514237 L0.376189 0.480483 L0.264006 0.480483 L0.188844 0.514237 L0.11368 0.582737 L0.076661 0.685983 L0.076661 0.754485 L0.11368 0.856739 L0.188844 0.92524 L0.264006 0.959985 L0.376189 0.959985 L0.450232 0.92524 L0.525392 0.856739",e:"M0.059571 0.668808 L0.542482 0.668808 M0.542482 0.592521 L0.502641 0.516231 L0.461594 0.477535 L0.381914 0.439941 L0.261186 0.439941 L0.180299 0.477535 L0.099412 0.553823 L0.059571 0.668808 L0.059571 0.745099 L0.099412 0.858979 L0.180299 0.93527 L0.261186 0.973965 L0.381914 0.973965 L0.461594 0.93527 L0.542482 0.858979",f:"M0.512941 0.240234 L0.406984 0.240234 L0.301026 0.274346 L0.248047 0.374731 L0.248047 0.946817 M0.089112 0.476088 L0.459965 0.476088",g:"M0.525392 0.439941 L0.525392 0.989395 L0.488373 1.091918 L0.45023 1.126757 L0.376189 1.160601 L0.264004 1.160601 L0.188844 1.126757 L0.113681 1.058075 L0.076661 0.954555 M0.525392 0.542467 L0.45023 0.473786 L0.376189 0.439941 L0.264004 0.439941 L0.188844 0.473786 L0.113681 0.542467 L0.076661 0.645988 L0.076661 0.714669 L0.113681 0.817193 L0.188844 0.885875 L0.264004 0.920713 L0.376189 0.920713 L0.45023 0.885875 L0.525392 0.817193",h:"M0.092041 0.240234 L0.092041 0.946817 M0.092041 0.61058 L0.205937 0.509225 L0.282214 0.476086 L0.396109 0.476086 L0.47187 0.509225 L0.510011 0.61058 L0.510011 0.946817",i:"M0.261026 0.240234 L0.341026 0.240234 M0.300978 0.476089 L0.300978 0.946817",j:"M0.3853 0.240234 L0.447023 0.240234 M0.416159 0.465708 L0.416159 1.011689 L0.383887 1.108586 L0.252832 1.140264 L0.15503 1.108586",k:"M0.065186 0.240234 L0.065186 0.946817 M0.493824 0.476086 L0.065186 0.812323 M0.236758 0.677829 L0.536867 0.946817",l:"M0.301026 0.234863 L0.301026 0.946441",m:"M0.050538 0.439941 L0.050538 0.960796 M0.050538 0.588758 L0.114405 0.476607 L0.157178 0.439941 L0.236864 0.439941 L0.279637 0.476607 L0.32241 0.588758 L0.32241 0.960796 M0.32241 0.588758 L0.386281 0.476607 L0.428467 0.439941 L0.50874 0.439941 L0.551515 0.476607 L0.551515 0.960796",n:"M0.092041 0.439941 L0.092041 0.960796 M0.092041 0.588758 L0.205936 0.476607 L0.282216 0.439941 L0.396113 0.439941 L0.471871 0.476607 L0.510011 0.588758 L0.510011 0.960796",o:"M0.247175 0.439941 L0.175178 0.477535 L0.103186 0.553823 L0.066895 0.668808 L0.066895 0.745099 L0.103186 0.858979 L0.175178 0.93527 L0.247175 0.973965 L0.354874 0.973965 L0.426872 0.93527 L0.498866 0.858979 L0.535157 0.745099 L0.535157 0.668808 L0.498866 0.553823 L0.426872 0.477535 L0.354874 0.439941 L0.247175 0.439941",p:"M0.076904 0.439941 L0.076904 1.154244 M0.076904 0.541563 L0.151986 0.473487 L0.225944 0.439941 L0.338005 0.439941 L0.413087 0.473487 L0.488166 0.541563 L0.525148 0.644169 L0.525148 0.712246 L0.488166 0.813866 L0.413087 0.881942 L0.338005 0.916471 L0.225944 0.916471 L0.151986 0.881942 L0.076904 0.813866",q:"M0.525148 0.441895 L0.525148 1.156195 M0.525148 0.5435 L0.450067 0.47544 L0.376106 0.441895 L0.264042 0.441895 L0.188966 0.47544 L0.113885 0.5435 L0.076905 0.646108 L0.076905 0.714187 L0.113885 0.815809 L0.188966 0.883886 L0.264042 0.918418 L0.376106 0.918418 L0.450067 0.883886 L0.525148 0.815809",r:"M0.107422 0.439941 L0.107422 0.960796 M0.107422 0.663164 L0.155824 0.551014 L0.252626 0.476607 L0.349428 0.439941 L0.49463 0.439941",s:"M0.475556 0.477535 L0.400757 0.439941 L0.276092 0.439941 L0.176361 0.477535 L0.101563 0.553823 L0.101563 0.630112 L0.176361 0.668808 L0.301024 0.668808 L0.425688 0.745099 L0.50049 0.821387 L0.50049 0.897677 L0.425688 0.93527 L0.325956 0.973965 L0.201295 0.973965 L0.126496 0.93527 L0.101563 0.858979",t:"M0.246032 0.297852 L0.246032 0.826549 L0.301023 0.919323 L0.411011 0.950848 L0.520997 0.950848 M0.081055 0.515799 L0.466004 0.515799",u:"M0.092041 0.454102 L0.092041 0.826134 L0.13018 0.937211 L0.205936 0.974954 L0.319832 0.974954 L0.396113 0.937211 L0.510011 0.826134 M0.510011 0.454102 L0.510011 0.974954",v:"M0.048828 0.453125 L0.301026 0.961719 M0.553224 0.453125 L0.301026 0.961719",w:"M0 0.453125 L0.150512 0.961719 M0.301024 0.453125 L0.150512 0.961719 M0.301024 0.453125 L0.451539 0.961719 M0.602052 0.453125 L0.451539 0.961719",x:"M0.03711 0.453125 L0.564943 0.961719 M0.564943 0.453125 L0.03711 0.961719",y:"M0.084618 0.453125 L0.320232 0.921476 M0.55713 0.453125 L0.320232 0.921476 L0.242119 1.055289 L0.163369 1.122196 L0.084618 1.155166 L0.044922 1.155166",z:"M0.505373 0.452148 L0.09668 0.961651 M0.09668 0.452148 L0.505373 0.452148 M0.09668 0.961651 L0.505373 0.961651"},yLt={};for(let e in fLt){yLt[e]=[];let t=fLt[e].split("M").slice(1).map((n)=>n.split("L").map((o)=>o.trim().split(" ").map(parseFloat)));for(let n of t)for(let o=0;o<n.length-1;o++)yLt[e].push({x1:n[o][0],y1:1-n[o][1],x2:n[o+1][0],y2:1-n[o+1][1]})}var pV=(e,t)=>({...e,rects:[...e.rects??[],...t.rects??[]],points:[...e.points??[],...t.points??[]],lines:[...e.lines??[],...t.lines??[]],infiniteLines:[...e.infiniteLines??[],...t.infiniteLines??[]],polygons:[...e.polygons??[],...t.polygons??[]],circles:[...e.circles??[],...t.circles??[]],arrows:[...e.arrows??[],...t.arrows??[]],texts:[...e.texts??[],...t.texts??[]]});function MWe(e,t){if(e.points)for(let n of e.points)n.step=t;if(e.lines)for(let n of e.lines)n.step=t;if(e.infiniteLines)for(let n of e.infiniteLines)n.step=t;if(e.polygons)for(let n of e.polygons)n.step=t;if(e.rects)for(let n of e.rects)n.step=t;if(e.circles)for(let n of e.circles)n.step=t;if(e.texts)for(let n of e.texts)n.step=t;if(e.arrows)for(let n of e.arrows)n.step=t;return e}var Da=class{MAX_ITERATIONS=1e5;solved=!1;failed=!1;iterations=0;progress=0;error=null;activeSubSolver;failedSubSolvers;timeToSolve;stats={};_setupDone=!1;getSolverName(){return this.constructor.name}setup(){this._setupDone||(this._setup(),this._setupDone=!0)}_setup(){}step(){if(this._setupDone||this.setup(),!this.solved&&!this.failed){this.iterations++;try{this._step()}catch(e){throw this.error=`${this.getSolverName()} error: ${e}`,this.failed=!0,e}!this.solved&&this.iterations>=this.MAX_ITERATIONS&&this.tryFinalAcceptance(),!this.solved&&this.iterations>=this.MAX_ITERATIONS&&(this.error=`${this.getSolverName()} ran out of iterations`,this.failed=!0),"computeProgress"in this&&(this.progress=this.computeProgress())}}_step(){}getConstructorParams(){throw Error("getConstructorParams not implemented")}getOutput(){return null}solve(){let e=Date.now();for(;!this.solved&&!this.failed;)this.step();let t=Date.now();this.timeToSolve=t-e}visualize(){return{lines:[],points:[],rects:[],circles:[]}}tryFinalAcceptance(){}preview(){return{lines:[],points:[],rects:[],circles:[]}}};function Z0(e,t,n,o={}){return{solverName:e,solverClass:t,getConstructorParams:n,onSolved:o.onSolved}}var rP=class extends Da{startTimeOfStage={};endTimeOfStage={};timeSpentOnStage={};firstIterationOfStage={};currentPipelineStageIndex=0;inputProblem;pipelineOutputs={};constructor(e){super(),this.inputProblem=e,this.MAX_ITERATIONS=1e6}_step(){let e=this.pipelineDef[this.currentPipelineStageIndex];if(!e)return void(this.solved=!0);if(this.activeSubSolver){if(this.activeSubSolver.step(),this.activeSubSolver.solved){this.endTimeOfStage[e.solverName]=performance.now(),this.timeSpentOnStage[e.solverName]=this.endTimeOfStage[e.solverName]-this.startTimeOfStage[e.solverName];let n=this.activeSubSolver.getOutput();n!==null&&(this.pipelineOutputs[e.solverName]=n),e.onSolved?.(this),this.activeSubSolver=null,this.currentPipelineStageIndex++}else this.activeSubSolver.failed&&(this.error=this.activeSubSolver?.error,this.failed=!0,this.activeSubSolver=null);return}let t=e.getConstructorParams(this);this.activeSubSolver=new e.solverClass(...t),this[e.solverName]=this.activeSubSolver,this.timeSpentOnStage[e.solverName]=0,this.startTimeOfStage[e.solverName]=performance.now(),this.firstIterationOfStage[e.solverName]=this.iterations}solveUntilStage(e){for(;this.getCurrentStageName().toLowerCase()!==e.toLowerCase()&&(this.step(),!this.failed&&!this.solved););}getCurrentStageName(){return this.pipelineDef[this.currentPipelineStageIndex]?.solverName??"none"}getStageProgress(){let e=this.pipelineDef.length;if(e===0)return 1;let t=this.activeSubSolver?.progress??0;return(this.currentPipelineStageIndex+t)/e}getStageStats(){let e={};for(let t of this.pipelineDef){let n=this.timeSpentOnStage[t.solverName]||0,o=this.firstIterationOfStage[t.solverName]||0,r=this.iterations,i=t.solverName===this.getCurrentStageName()?r-o:0,s=this.currentPipelineStageIndex>this.pipelineDef.findIndex((a)=>a.solverName===t.solverName);e[t.solverName]={timeSpent:n,iterations:i,completed:s}}return e}initialVisualize(){return null}finalVisualize(){return null}visualize(){if(!this.solved&&this.activeSubSolver)return this.activeSubSolver.visualize();let e=0,t=this.initialVisualize();t&&(MWe(t,0),e=1);let n=null;this.solved&&(n=this.finalVisualize());let o=[t].filter(Boolean).concat(this.pipelineDef.map((r,i)=>{let s=this[r.solverName],a=s?.visualize();return a?(MWe(a,i+e),a):null}).filter(Boolean));return o.length===0?{points:[],rects:[],lines:[],circles:[],texts:[]}:(this.solved&&n&&(MWe(n,o.length+e+1),o.push(n)),o.length===1?o[0]:{points:o.flatMap((r)=>r.points||[]),rects:o.flatMap((r)=>r.rects||[]),lines:o.flatMap((r)=>r.lines||[]),circles:o.flatMap((r)=>r.circles||[]),texts:o.flatMap((r)=>r.texts||[])})}preview(){return this.activeSubSolver?this.activeSubSolver.preview():super.preview()}computeProgress(){return this.getStageProgress()}getStageOutput(e){return this.pipelineOutputs[e]}getAllOutputs(){return{...this.pipelineOutputs}}hasStageOutput(e){return e in this.pipelineOutputs}getSolver(e){return this[e]}},F0r=class{constructor(e=1/0,t=Float64Array,n=Uint32Array){let o=e!==1/0;this.ids=o?new n(e):[],this.values=o?new t(e):[],this.capacity=e,this.length=0}clear(){this.length=0}push(e,t){if(this.length===this.capacity)throw RangeError("Queue is at capacity.");let n=this.length++;for(;n>0;){let o=n-1>>1,r=this.values[o];if(t>=r)break;this.ids[n]=this.ids[o],this.values[n]=r,n=o}this.ids[n]=e,this.values[n]=t}pop(){if(this.length===0)return;let e=this.ids,t=this.values,n=e[0],o=--this.length;if(o>0){let r=e[o],i=t[o],s=0,a=o>>1;for(;s<a;){let c=1+(s<<1),l=c+1,h=c+(+(l<o)&+(t[l]<t[c]));if(t[h]>=i)break;e[s]=e[h],t[s]=t[h],s=h}e[s]=r,t[s]=i}return n}peek(){return this.length>0?this.ids[0]:void 0}peekValue(){return this.length>0?this.values[0]:void 0}shrink(){Array.isArray(this.ids)&&(this.ids.length=this.length),Array.isArray(this.values)&&(this.values.length=this.length)}},xLt=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],R_=class e{static from(t,n=0){if(n%8!=0)throw Error("byteOffset must be 8-byte aligned.");if(!t||t.byteLength===void 0||"buffer"in t)throw Error("Data must be an instance of ArrayBuffer or SharedArrayBuffer.");let[o,r]=new Uint8Array(t,n+0,2);if(o!==251)throw Error("Data does not appear to be in a Flatbush format.");let i=r>>4;if(i!==3)throw Error(`Got v${i} data when expected v3.`);let s=xLt[15&r];if(!s)throw Error("Unrecognized array type.");let[a]=new Uint16Array(t,n+2,1),[c]=new Uint32Array(t,n+4,1);return new e(c,a,s,void 0,t,n)}constructor(t,n=16,o=Float64Array,r=ArrayBuffer,i,s=0){if(t===void 0)throw Error("Missing required argument: numItems.");if(isNaN(t)||t<=0)throw Error(`Unexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+n,2),65535),this.byteOffset=s;let a=t,c=a;this._levelBounds=[4*a];do a=Math.ceil(a/this.nodeSize),c+=a,this._levelBounds.push(4*c);while(a!==1);this.ArrayType=o,this.IndexArrayType=c<16384?Uint16Array:Uint32Array;let l=xLt.indexOf(o),h=4*c*o.BYTES_PER_ELEMENT;if(l<0)throw Error(`Unexpected typed array class: ${o}.`);let d=o,u=this.IndexArrayType;if(i)this.data=i,this._boxes=new d(i,s+8,4*c),this._indices=new u(i,s+8+h,c),this._pos=4*c,this.minX=this._boxes[this._pos-4],this.minY=this._boxes[this._pos-3],this.maxX=this._boxes[this._pos-2],this.maxY=this._boxes[this._pos-1];else{let _=this.data=new r(8+h+c*this.IndexArrayType.BYTES_PER_ELEMENT);this._boxes=new d(_,8,4*c),this._indices=new u(_,8+h,c),this._pos=0,this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,new Uint8Array(_,0,2).set([251,48+l]),new Uint16Array(_,2,1)[0]=n,new Uint32Array(_,4,1)[0]=t}this._queue=new F0r}add(t,n,o=t,r=n){let i=this._pos,s=i>>2,a=this._boxes;return this._indices[s]=s,a[i]=t,a[i+1]=n,a[i+2]=o,a[i+3]=r,this._pos=i+4,t<this.minX&&(this.minX=t),n<this.minY&&(this.minY=n),o>this.maxX&&(this.maxX=o),r>this.maxY&&(this.maxY=r),s}finish(){if(this._pos>>2!==this.numItems)throw Error(`Added ${this._pos>>2} items when expected ${this.numItems}.`);let t=this._boxes;if(this.numItems<=this.nodeSize)return t[this._pos++]=this.minX,t[this._pos++]=this.minY,t[this._pos++]=this.maxX,void(t[this._pos++]=this.maxY);let{numItems:n,minX:o,minY:r,nodeSize:i,_indices:s,_levelBounds:a}=this,c=this.maxX-o||1,l=this.maxY-r||1,h=new Int32Array(n),d=65535/c,u=65535/l;for(let p=0,m=0;p<n;p++){let A=t[m++],g=t[m++],f=d*((A+t[m++])/2-o)|0,y=u*((g+t[m++])/2-r)|0;h[p]=V0r(f,y)}(function(p,m,A,g,f,y){let x=[g,f];for(;x.length;){let C=x.pop()||0,b=x.pop()||0;if(C-b<=y&&Math.floor(b/y)>=Math.floor(C/y))continue;let I=p[b],v=p[b+C>>1],P=p[C],M=I>v!=I>P?I:v<I!=v<P?v:P,B=b-1,T=C+1;for(;;){do B++;while(p[B]<M);do T--;while(p[T]>M);if(B>=T)break;O0r(p,m,A,B,T)}x.push(b,T,T+1,C)}})(h,t,s,0,n-1,i);let _=4*n;for(let p=0,m=0;p<a.length-1;p++){let A=a[p];for(;m<A;){let g=m,f=t[m++],y=t[m++],x=t[m++],C=t[m++];for(let b=1;b<i&&m<A;b++)f=Math.min(f,t[m++]),y=Math.min(y,t[m++]),x=Math.max(x,t[m++]),C=Math.max(C,t[m++]);s[_>>2]=g,t[_++]=f,t[_++]=y,t[_++]=x,t[_++]=C}}this._pos=_}search(t,n,o,r,i){if(this._pos!==this._boxes.length)throw Error("Data not yet indexed - call index.finish().");let{_boxes:s,_levelBounds:a,_indices:c,nodeSize:l}=this,h=4*this.numItems,d=s.length-4,u=a.length-1,_=[],p=[],m=!1;for(;d!==void 0;){let A=Math.min(d+4*l,a[u]),g=d>=h;if(m)this._collectContained(d,A,u,h,p,i);else for(let f=d;f<A;f+=4){let y=s[f];if(o<y)continue;let x=s[f+1];if(r<x)continue;let C=s[f+2];if(t>C)continue;let b=s[f+3];if(n>b)continue;let I=0|c[f>>2];if(g){let v=+(t<=y&&n<=x&&o>=C&&r>=b);_.push(I|v,u-1)}else(i===void 0||i(I,y,x,C,b))&&p.push(I)}u=_.pop(),d=_.pop(),d!==void 0&&(m=!(1&~d),d&=-2)}return p}_collectContained(t,n,o,r,i,s){let a=this._boxes,c=this._indices,l=t;for(let d=o;d>0;d--)l=c[l>>2];let h=Math.min(l+(n-t)*this.nodeSize**o,r);if(s===void 0)for(;l<h;l+=4)i.push(0|c[l>>2]);else for(;l<h;l+=4){let d=0|c[l>>2];s(d,a[l],a[l+1],a[l+2],a[l+3])&&i.push(d)}}neighbors(t,n,o=1/0,r=1/0,i){if(this._pos!==this._boxes.length)throw Error("Data not yet indexed - call index.finish().");let{_boxes:s,_levelBounds:a,_indices:c,_queue:l,nodeSize:h}=this,d=4*this.numItems,u=4*h,_=[],p=o===1,m=r*r;for(l.push(s.length-4<<1,0);l.length;){let A=l.ids[0];if(1&A){if(l.pop(),_.push(A>>1),_.length===o)break;continue}l.pop();let g=A>>1,f=g<d,y=Math.min(g+u,z0r(g,a));for(let x=g;x<y;x+=4){let C=s[x],b=s[x+1],I=s[x+2],v=s[x+3],P=Math.max(Math.max(C-t,t-I),0),M=Math.max(Math.max(b-n,n-v),0),B=P*P+M*M;if(B>m)continue;let T=0|c[x>>2];f?(i===void 0||i(T))&&(l.push(T<<1|1,B),p&&B<m&&(m=B)):l.push(T<<1,B)}}return l.clear(),_}};function z0r(e,t){let n=0,o=t.length-1;for(;n<o;){let r=n+o>>1;t[r]>e?o=r:n=r+1}return t[n]}function O0r(e,t,n,o,r){let i=e[o];e[o]=e[r],e[r]=i;let s=4*o,a=4*r,c=t[s],l=t[s+1],h=t[s+2],d=t[s+3];t[s]=t[a],t[s+1]=t[a+1],t[s+2]=t[a+2],t[s+3]=t[a+3],t[a]=c,t[a+1]=l,t[a+2]=h,t[a+3]=d;let u=n[o];n[o]=n[r],n[r]=u}function V0r(e,t){let n=e^t,o=65535^n,r=65535^(e|t),i=e&(65535^t),s=n|o>>1,a=n>>1^n,c=r^r>>1^o&i>>1,l=i^n&r>>1^i>>1;return n=s&s>>2^a&a>>2,o=s&a>>2^a&(s^a)>>2,r=c^s&c>>2^a&l>>2,i=l^a&c>>2^(s^a)&l>>2,s=n&n>>4^o&o>>4,a=n&o>>4^o&(n^o)>>4,c=r^n&r>>4^o&i>>4,l=i^o&r>>4^(n^o)&i>>4,r=c^s&c>>8^a&l>>8,i=l^a&c>>8^(s^a)&l>>8,r^=r>>1,i^=i>>1,n=e^t,o=i|65535^(n|r),n=16711935&(n|n<<8),n=252645135&(n|n<<4),n=858993459&(n|n<<2),n=1431655765&(n|n<<1),o=16711935&(o|o<<8),o=252645135&(o|o<<4),o=858993459&(o|o<<2),o=1431655765&(o|o<<1),((o<<1|n)>>>0)-2147483648}var j9=0.0001,Uae=[{facingDirection:"x-",dx:-1,dy:0,startX:-0.5,startY:0.5,endX:-0.5,endY:-0.5},{facingDirection:"x+",dx:1,dy:0,startX:0.5,startY:0.5,endX:0.5,endY:-0.5},{facingDirection:"y-",dx:0,dy:-1,startX:-0.5,startY:-0.5,endX:0.5,endY:-0.5},{facingDirection:"y+",dx:0,dy:1,startX:0.5,startY:0.5,endX:-0.5,endY:0.5}],CLt={"x-":Uae.find((e)=>e.facingDirection==="x-"),"x+":Uae.find((e)=>e.facingDirection==="x+"),"y-":Uae.find((e)=>e.facingDirection==="y-"),"y+":Uae.find((e)=>e.facingDirection==="y+")},Y0r={"x-":{x:-1,y:0},"x+":{x:1,y:0},"y-":{x:0,y:-1},"y+":{x:0,y:1}},wWe=(e,t)=>{let{dir:n,amt:o}=t,r=Y0r[n];return e.map((i)=>({x:i.x+r.x*o,y:i.y+r.y*o}))},Wae=0.0001;function bLt(e){let t=[];for(let n of e)for(let o of Uae){let r={x:n.center.x+n.width*o.startX,y:n.center.y+n.height*o.startY},i={x:n.center.x+n.width*o.endX,y:n.center.y+n.height*o.endY};r.x>i.x&&([r,i]=[i,r]),Math.abs(r.x-i.x)<Wae&&r.y>i.y&&([r,i]=[i,r]);for(let s of n.availableZ)t.push({parent:n,start:r,end:i,facingDirection:o.facingDirection,z:s})}return t}var G0r=class extends Da{constructor(e){super(),this.input=e;let t=this.input.targetMeshNodes??this.input.allMeshNodes,n=new Set(t.map((r)=>r.capacityMeshNodeId)),o=this.input.allMeshNodes.filter((r)=>!n.has(r.capacityMeshNodeId));this.unprocessedEdges=bLt(t),this.allEdges=[...this.unprocessedEdges,...bLt(o)],this.edgeSpatialIndex=new R_(this.allEdges.length);for(let r of this.allEdges)this.edgeSpatialIndex.add(r.start.x,r.start.y,r.end.x,r.end.y);this.edgeSpatialIndex.finish()}input;allEdges;unprocessedEdges=[];segmentsWithAdjacentEmptySpace=[];edgeSpatialIndex;lastCandidateEdge=null;lastOverlappingEdges=null;lastUncoveredSegments=null;_step(){if(this.unprocessedEdges.length===0)return this.solved=!0,this.lastCandidateEdge=null,this.lastOverlappingEdges=null,void(this.lastUncoveredSegments=null);let e=this.unprocessedEdges.shift();this.lastCandidateEdge=e;let t=this.edgeSpatialIndex.search(e.start.x-Wae,e.start.y-Wae,e.end.x+Wae,e.end.y+Wae).map((o)=>this.allEdges[o]).filter((o)=>o.z===e.z);this.lastOverlappingEdges=t;let n=function(o,r){let i=Math.abs(o.start.y-o.end.y)<j9,s=Math.abs(o.start.x-o.end.x)<j9;if(!i&&!s)return[];let a=i?"x":"y",c=i?"y":"x",l=o.start[c],h=o.start[a],d=o.end[a],u=Math.min(h,d),_=Math.max(h,d),p=(y)=>Math.max(u,Math.min(_,y)),m=[];for(let y of r){if(y===o)continue;let x=Math.abs(y.start.y-y.end.y)<j9,C=Math.abs(y.start.x-y.end.x)<j9;if(a==="x"&&!x)continue;if(a==="y"&&!C)continue;if(Math.abs(y.start[c]-l)>j9)continue;let b=Math.min(y.start[a],y.end[a]),I=Math.max(y.start[a],y.end[a]),v=p(b),P=p(I);P-v>j9&&m.push({s:v,e:P})}if(m.length===0)return[{...o,start:{...o.start},end:{...o.end}}];m.sort((y,x)=>y.s-x.s);let A=[];for(let y of m){let x=A[A.length-1];!x||y.s>x.e+j9?A.push({...y}):x.e=Math.max(x.e,y.e)}let g=[],f=u;for(let y of A)if(y.s>f+j9&&g.push({s:f,e:y.s}),f=Math.max(f,y.e),f>=_-j9)break;return _>f+j9&&g.push({s:f,e:_}),g.length===0?[]:g.filter((y)=>y.e-y.s>j9).map((y)=>{let x=a==="x"?{x:y.s,y:l}:{x:l,y:y.s},C=a==="x"?{x:y.e,y:l}:{x:l,y:y.e};return{parent:o.parent,facingDirection:o.facingDirection,start:x,end:C,z:o.z}})}(e,t);this.lastUncoveredSegments=n,this.segmentsWithAdjacentEmptySpace.push(...n)}getOutput(){return{segmentsWithAdjacentEmptySpace:this.segmentsWithAdjacentEmptySpace}}visualize(){let e={title:"FindSegmentsWithAdjacentEmptySpace",coordinateSystem:"cartesian",rects:[],points:[],lines:[],circles:[],infiniteLines:[],polygons:[],arrows:[],texts:[]};for(let t of this.input.allMeshNodes)e.rects.push({center:t.center,width:t.width,height:t.height,stroke:"rgba(0, 0, 0, 0.1)"});for(let t of this.unprocessedEdges)e.lines.push({points:wWe([t.start,t.end],{dir:t.facingDirection,amt:-0.1}),strokeColor:"rgba(0, 0, 255, 0.5)",strokeDash:"5 5"});for(let t of this.segmentsWithAdjacentEmptySpace)e.lines.push({points:[t.start,t.end],strokeColor:"rgba(0,255,0, 0.5)"});if(this.lastCandidateEdge&&e.lines.push({points:[this.lastCandidateEdge.start,this.lastCandidateEdge.end],strokeColor:"blue"}),this.lastOverlappingEdges)for(let t of this.lastOverlappingEdges)e.lines.push({points:wWe([t.start,t.end],{dir:t.facingDirection,amt:0.05}),strokeColor:"red",strokeDash:"2 2"});if(this.lastUncoveredSegments)for(let t of this.lastUncoveredSegments)e.lines.push({points:wWe([t.start,t.end],{dir:t.facingDirection,amt:-0.05}),strokeColor:"green",strokeDash:"2 2"});return e}};function fUt(e,t,n=0,o=e.length-1,r=U0r){for(;o>n;){if(o-n>600){let c=o-n+1,l=t-n+1,h=Math.log(c),d=0.5*Math.exp(2*h/3),u=0.5*Math.sqrt(h*d*(c-d)/c)*(l-c/2<0?-1:1);fUt(e,t,Math.max(n,Math.floor(t-l*d/c+u)),Math.min(o,Math.floor(t+(c-l)*d/c+u)),r)}let i=e[t],s=n,a=o;for(yae(e,n,t),r(e[o],i)>0&&yae(e,n,o);s<a;){for(yae(e,s,a),s++,a--;r(e[s],i)<0;)s++;for(;r(e[a],i)>0;)a--}r(e[n],i)===0?yae(e,n,a):(a++,yae(e,a,o)),a<=t&&(n=a+1),t<=a&&(o=a-1)}}function yae(e,t,n){let o=e[t];e[t]=e[n],e[n]=o}function U0r(e,t){return e<t?-1:e>t?1:0}var JV=class{constructor(e=9){this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(0.4*this._maxEntries)),this.clear()}all(){return this._all(this.data,[])}search(e){let t=this.data,n=[];if(!h4e(e,t))return n;let o=this.toBBox,r=[];for(;t;){for(let i=0;i<t.children.length;i++){let s=t.children[i],a=t.leaf?o(s):s;h4e(e,a)&&(t.leaf?n.push(s):TWe(e,a)?this._all(s,n):r.push(s))}t=r.pop()}return n}collides(e){let t=this.data;if(!h4e(e,t))return!1;let n=[];for(;t;){for(let o=0;o<t.children.length;o++){let r=t.children[o],i=t.leaf?this.toBBox(r):r;if(h4e(e,i)){if(t.leaf||TWe(e,i))return!0;n.push(r)}}t=n.pop()}return!1}load(e){if(!e||!e.length)return this;if(e.length<this._minEntries){for(let n=0;n<e.length;n++)this.insert(e[n]);return this}let t=this._build(e.slice(),0,e.length-1,0);if(this.data.children.length)if(this.data.height===t.height)this._splitRoot(this.data,t);else{if(this.data.height<t.height){let n=this.data;this.data=t,t=n}this._insert(t,this.data.height-t.height-1,!0)}else this.data=t;return this}insert(e){return e&&this._insert(e,this.data.height-1),this}clear(){return this.data=a$([]),this}remove(e,t){if(!e)return this;let n=this.data,o=this.toBBox(e),r=[],i=[],s,a,c;for(;n||r.length;){if(n||(n=r.pop(),a=r[r.length-1],s=i.pop(),c=!0),n.leaf){let l=W0r(e,n.children,t);if(l!==-1)return n.children.splice(l,1),r.push(n),this._condense(r),this}c||n.leaf||!TWe(n,o)?a?(s++,n=a.children[s],c=!1):n=null:(r.push(n),i.push(s),s=0,a=n,n=n.children[0])}return this}toBBox(e){return e}compareMinX(e,t){return e.minX-t.minX}compareMinY(e,t){return e.minY-t.minY}toJSON(){return this.data}fromJSON(e){return this.data=e,this}_all(e,t){let n=[];for(;e;)e.leaf?t.push(...e.children):n.push(...e.children),e=n.pop();return t}_build(e,t,n,o){let r=n-t+1,i,s=this._maxEntries;if(r<=s)return i=a$(e.slice(t,n+1)),OK(i,this.toBBox),i;o||(o=Math.ceil(Math.log(r)/Math.log(s)),s=Math.ceil(r/Math.pow(s,o-1))),i=a$([]),i.leaf=!1,i.height=o;let a=Math.ceil(r/s),c=a*Math.ceil(Math.sqrt(s));ILt(e,t,n,c,this.compareMinX);for(let l=t;l<=n;l+=c){let h=Math.min(l+c-1,n);ILt(e,l,h,a,this.compareMinY);for(let d=l;d<=h;d+=a){let u=Math.min(d+a-1,h);i.children.push(this._build(e,d,u,o-1))}}return OK(i,this.toBBox),i}_chooseSubtree(e,t,n,o){for(;o.push(t),!t.leaf&&o.length-1!==n;){let r,i=1/0,s=1/0;for(let a=0;a<t.children.length;a++){let c=t.children[a],l=BWe(c),h=K0r(e,c)-l;h<s?(s=h,i=l<i?l:i,r=c):h===s&&l<i&&(i=l,r=c)}t=r||t.children[0]}return t}_insert(e,t,n){let o=n?e:this.toBBox(e),r=[],i=this._chooseSubtree(o,this.data,t,r);for(i.children.push(e),jae(i,o);t>=0&&r[t].children.length>this._maxEntries;)this._split(r,t),t--;this._adjustParentBBoxes(o,r,t)}_split(e,t){let n=e[t],o=n.children.length,r=this._minEntries;this._chooseSplitAxis(n,r,o);let i=this._chooseSplitIndex(n,r,o),s=a$(n.children.splice(i,n.children.length-i));s.height=n.height,s.leaf=n.leaf,OK(n,this.toBBox),OK(s,this.toBBox),t?e[t-1].children.push(s):this._splitRoot(n,s)}_splitRoot(e,t){this.data=a$([e,t]),this.data.height=e.height+1,this.data.leaf=!1,OK(this.data,this.toBBox)}_chooseSplitIndex(e,t,n){let o,r=1/0,i=1/0;for(let s=t;s<=n-t;s++){let a=Xae(e,0,s,this.toBBox),c=Xae(e,s,n,this.toBBox),l=$0r(a,c),h=BWe(a)+BWe(c);l<r?(r=l,o=s,i=h<i?h:i):l===r&&h<i&&(i=h,o=s)}return o||n-t}_chooseSplitAxis(e,t,n){let o=e.leaf?this.compareMinX:X0r,r=e.leaf?this.compareMinY:j0r;this._allDistMargin(e,t,n,o)<this._allDistMargin(e,t,n,r)&&e.children.sort(o)}_allDistMargin(e,t,n,o){e.children.sort(o);let r=this.toBBox,i=Xae(e,0,t,r),s=Xae(e,n-t,n,r),a=l4e(i)+l4e(s);for(let c=t;c<n-t;c++){let l=e.children[c];jae(i,e.leaf?r(l):l),a+=l4e(i)}for(let c=n-t-1;c>=t;c--){let l=e.children[c];jae(s,e.leaf?r(l):l),a+=l4e(s)}return a}_adjustParentBBoxes(e,t,n){for(let o=n;o>=0;o--)jae(t[o],e)}_condense(e){for(let t,n=e.length-1;n>=0;n--)e[n].children.length===0?n>0?(t=e[n-1].children,t.splice(t.indexOf(e[n]),1)):this.clear():OK(e[n],this.toBBox)}};function W0r(e,t,n){if(!n)return t.indexOf(e);for(let o=0;o<t.length;o++)if(n(e,t[o]))return o;return-1}function OK(e,t){Xae(e,0,e.children.length,t,e)}function Xae(e,t,n,o,r){r||(r=a$(null)),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(let i=t;i<n;i++){let s=e.children[i];jae(r,e.leaf?o(s):s)}return r}function jae(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function X0r(e,t){return e.minX-t.minX}function j0r(e,t){return e.minY-t.minY}function BWe(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function l4e(e){return e.maxX-e.minX+(e.maxY-e.minY)}function K0r(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function $0r(e,t){let n=Math.max(e.minX,t.minX),o=Math.max(e.minY,t.minY),r=Math.min(e.maxX,t.maxX),i=Math.min(e.maxY,t.maxY);return Math.max(0,r-n)*Math.max(0,i-o)}function TWe(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function h4e(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function a$(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function ILt(e,t,n,o,r){let i=[t,n];for(;i.length;){if((n=i.pop())-(t=i.pop())<=o)continue;let s=t+Math.ceil((n-t)/o/2)*o;fUt(e,s,t,n,r),i.push(t,s,s,n)}}var vLt=(e)=>({minX:Math.min(...e.map((t)=>t.x)),minY:Math.min(...e.map((t)=>t.y)),maxX:Math.max(...e.map((t)=>t.x)),maxY:Math.max(...e.map((t)=>t.y))});function Ru(e,t,n,o){let r=d4e(e,t,n),i=d4e(e,t,o),s=d4e(n,o,e),a=d4e(n,o,t);return r!==i&&s!==a||(!(r!==0||!u4e(e,n,t))||(!(i!==0||!u4e(e,o,t))||(!(s!==0||!u4e(n,e,o))||!(a!==0||!u4e(n,t,o)))))}function d4e(e,t,n){let o=(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y);return o===0?0:o>0?1:2}function u4e(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function xc(e,t,n){let o=(n.x-t.x)**2+(n.y-t.y)**2;if(o===0)return kn(e,t);let r=((e.x-t.x)*(n.x-t.x)+(e.y-t.y)*(n.y-t.y))/o;return r=Math.max(0,Math.min(1,r)),kn(e,{x:t.x+r*(n.x-t.x),y:t.y+r*(n.y-t.y)})}function kn(e,t){let n=e.x-t.x,o=e.y-t.y;return Math.sqrt(n*n+o*o)}function pB(e,t,n,o){let r=t.x-e.x,i=t.y-e.y,s=o.x-n.x,a=o.y-n.y,c=e.x-n.x,l=e.y-n.y,h=r*a-i*s;if(Math.abs(h)<0.0000000001)return null;let d=(l*s-c*a)/h,u=(r*l-i*c)/h,_=0.000000001;if(d>=-0.000000001&&d<=1+_&&u>=-0.000000001&&u<=1+_)return{x:e.x+d*r,y:e.y+d*i};return null}var yUt=(e)=>{if("minX"in e)return e;let t=e.width/2,n=e.height/2;return{minX:e.center.x-t,minY:e.center.y-n,maxX:e.center.x+t,maxY:e.center.y+n}},X$e=(e)=>[{x:e.minX,y:e.minY},{x:e.maxX,y:e.minY},{x:e.maxX,y:e.maxY},{x:e.minX,y:e.maxY}],xUt=(e)=>{let t=[];for(let n=0;n<e.length;n++){let o=e[n],r=e[(n+1)%e.length];t.push([o,r])}return t},q0r=(e,t,n)=>{let o=(e.y-t.y)*(n.x-t.x)-(e.x-t.x)*(n.y-t.y);if(Math.abs(o)>0.000000001)return!1;let r=(e.x-t.x)*(n.x-t.x)+(e.y-t.y)*(n.y-t.y);if(r<0)return!1;let i=(n.x-t.x)**2+(n.y-t.y)**2;return i!==0&&!(r>i)},tCe=(e,t)=>e.x>=t.minX&&e.x<=t.maxX&&e.y>=t.minY&&e.y<=t.maxY,Fce=(e,t)=>{if(t.length<3)return!1;let n=xUt(t);for(let[r,i]of n)if(q0r(e,r,i))return!0;let o=!1;for(let r=0,i=t.length-1;r<t.length;i=r++){let s=t[r].x,a=t[r].y,c=t[i].x,l=t[i].y;a>e.y!=l>e.y&&e.x<(c-s)*(e.y-a)/(l-a)+s&&(o=!o)}return o},CUt=(e,t)=>{let n=X$e(e),o=[[n[0],n[1]],[n[1],n[2]],[n[2],n[3]],[n[3],n[0]]],r=xUt(t);for(let[i,s]of r)for(let[a,c]of o)if(Ru(i,s,a,c))return!0;return!1},nCe=(e,t)=>((n,o)=>!(o.length<3)&&(!!o.some((r)=>tCe(r,n))||(!!X$e(n).some((r)=>Fce(r,o))||CUt(n,o))))(yUt(e),t),bUt=(e,t)=>((n,o)=>!(o.length<3)&&(!!X$e(n).every((r)=>Fce(r,o))&&!CUt(n,o)))(yUt(e),t);function Bi(e){let t=e.width/2,n=e.height/2;return{minX:e.center.x-t,maxX:e.center.x+t,minY:e.center.y-n,maxY:e.center.y+n}}function h2(e,t,n){return Math.max(t,Math.min(n,e))}function Q_(e,t,n,o){if(e.x===t.x&&e.y===t.y)return xc(e,n,o);if(n.x===o.x&&n.y===o.y)return xc(n,e,t);if(Ru(e,t,n,o))return 0;let r=[xc(e,n,o),xc(t,n,o),xc(n,e,t),xc(o,e,t)];return Math.min(...r)}function ZV(e,t,n){let o={x:n.minX,y:n.minY},r={x:n.maxX,y:n.minY},i={x:n.minX,y:n.maxY},s={x:n.maxX,y:n.maxY};if(Ru(e,t,o,r)||Ru(e,t,r,s)||Ru(e,t,s,i)||Ru(e,t,i,o))return 0;if(e.x>=n.minX&&e.x<=n.maxX&&e.y>=n.minY&&e.y<=n.maxY&&t.x>=n.minX&&t.x<=n.maxX&&t.y>=n.minY&&t.y<=n.maxY)return 0;let a=[xc(o,e,t),xc(r,e,t),xc(i,e,t),xc(s,e,t)];if(e.x>=n.minX&&e.x<=n.maxX&&e.y>=n.minY&&e.y<=n.maxY)return 0;if(t.x>=n.minX&&t.x<=n.maxX&&t.y>=n.minY&&t.y<=n.maxY)return 0;if(e.x<n.minX||e.x>n.maxX||e.y<n.minY||e.y>n.maxY){let c=h2(e.x,n.minX,n.maxX),l=h2(e.y,n.minY,n.maxY);a.push(kn(e,{x:c,y:l}))}if(t.x<n.minX||t.x>n.maxX||t.y<n.minY||t.y>n.maxY){let c=h2(t.x,n.minX,n.maxX),l=h2(t.y,n.minY,n.maxY);a.push(kn(t,{x:c,y:l}))}return Math.min(...a)}function KS(e,t,n){let o=n.width/2,r=n.height/2;return ZV(e,t,{minX:n.center.x-o,maxX:n.center.x+o,minY:n.center.y-r,maxY:n.center.y+r})}function XQ(e,t,n){let o={x:n.x,y:n.y};if(e.x===t.x&&e.y===t.y)return Math.max(0,kn(e,o)-n.radius);let r=t.x-e.x,i=t.y-e.y,s=o.x-e.x,a=o.y-e.y,c=r*r+i*i,l=Math.max(0,Math.min(1,(r*s+i*a)/c)),h=kn({x:e.x+l*r,y:e.y+l*i},o);return Math.max(0,h-n.radius)}function Vm(e,t,n){let o=n.x-t.x,r=n.y-t.y,i=o*o+r*r;if(i===0)return{x:t.x,y:t.y};let s=((e.x-t.x)*o+(e.y-t.y)*r)/i;return s=Math.max(0,Math.min(1,s)),{x:t.x+s*o,y:t.y+s*r}}var kje=(e,t)=>{let n=t.x-e.x,o=t.y-e.y,r=Math.sqrt(n**2+o**2);return{x:n/r,y:o/r}};function iP(e,t){let n=t.width/2,o=t.height/2,r=t.center.x-n,i=t.center.x+n,s=t.center.y-o,a=t.center.y+o;if(e.x>=r&&e.x<=i&&e.y>=s&&e.y<=a)return 0;return kn(e,{x:h2(e.x,r,i),y:h2(e.y,s,a)})}function IUt(e,t){if(e.x>=t.minX&&e.x<=t.maxX&&e.y>=t.minY&&e.y<=t.maxY)return 0;return kn(e,{x:h2(e.x,t.minX,t.maxX),y:h2(e.y,t.minY,t.maxY)})}function RV(e,t){return{x:(e.x+t.x)/2,y:(e.y+t.y)/2}}function BS(e,t){let n=e.x-t.x,o=e.y-t.y;return n*n+o*o}var mB=(e,t)=>!(e.maxX<t.minX||t.maxX<e.minX||e.maxY<t.minY||t.maxY<e.minY),tu=(e)=>{let{center:t,width:n,height:o}=e,r=n/2,i=o/2;return{minX:t.x-r,maxX:t.x+r,minY:t.y-i,maxY:t.y+i}},j$e=(e)=>{if(e.length===0)return null;let t=e[0].x,n=e[0].y,o=e[0].x,r=e[0].y;for(let i=1;i<e.length;i++){let s=e[i];s.x<t&&(t=s.x),s.y<n&&(n=s.y),s.x>o&&(o=s.x),s.y>r&&(r=s.y)}return{minX:t,minY:n,maxX:o,maxY:r}},Ob=0.0001,J0r=class extends Da{constructor(e){super(),this.input=e,this.input.bounds&&((t)=>{let{minX:n,maxX:o,minY:r,maxY:i}=t;if(![n,o,r,i].every(Number.isFinite))throw Error(`ExpandEdgesToEmptySpaceSolver bounds must be finite, got ${JSON.stringify(t)}`);if(n>o||r>i)throw Error(`ExpandEdgesToEmptySpaceSolver bounds must satisfy minX <= maxX and minY <= maxY, got ${JSON.stringify(t)}`)})(this.input.bounds),this.unprocessedSegments=[...this.input.segmentsWithAdjacentEmptySpace],this.rectSpatialIndex=new JV,this.rectSpatialIndex.load(this.input.boardVoid?.boardVoidRects.map((t,n)=>({capacityMeshNodeId:`void-rect-${n}`,center:{x:t.x+t.width/2,y:t.y+t.height/2},width:t.width,height:t.height,availableZ:Array.from({length:this.input.boardVoid?.layerCount||0},(o,r)=>r),layer:"void",minX:t.x,minY:t.y,maxX:t.x+t.width,maxY:t.y+t.height}))||[]),this.rectSpatialIndex.load(this.input.inputMeshNodes.map((t)=>({...t,minX:t.center.x-t.width/2,minY:t.center.y-t.height/2,maxX:t.center.x+t.width/2,maxY:t.center.y+t.height/2})))}input;unprocessedSegments=[];expandedSegments=[];lastSegment=null;lastSearchBounds=null;lastCollidingNodes=null;lastSearchCorner1=null;lastSearchCorner2=null;lastExpandedSegment=null;rectSpatialIndex;_step(){if(this.unprocessedSegments.length===0)return void(this.solved=!0);let e=this.unprocessedSegments.shift();this.lastSegment=e;let t=this.input.bounds,n=e;if(t){let C=((b,I)=>{let v={...b.start},P={...b.end};if(CLt[b.facingDirection].dx!==0){if(v.x<I.minX||v.x>I.maxX)return null;v.y=Math.max(I.minY,Math.min(I.maxY,v.y)),P.y=Math.max(I.minY,Math.min(I.maxY,P.y))}else{if(v.y<I.minY||v.y>I.maxY)return null;v.x=Math.max(I.minX,Math.min(I.maxX,v.x)),P.x=Math.max(I.minX,Math.min(I.maxX,P.x))}return{...b,start:v,end:P}})(e,t);if(!C)return;n=C,this.lastSegment=C}let{dx:o,dy:r}=CLt[n.facingDirection],i=n.end.x-n.start.x,s=n.end.y-n.start.y,a=Math.sqrt(i**2+s**2);if(a<Ob)return;let c=i/a,l=s/a,h=t?((C,b)=>{switch(C.facingDirection){case"x+":return b.maxX-C.start.x;case"x-":return C.start.x-b.minX;case"y+":return b.maxY-C.start.y;case"y-":return C.start.y-b.minY}})(n,t):1/0;if(h<Ob)return;let d={x:n.start.x+o*Ob+c*Ob*10,y:n.start.y+r*Ob+l*Ob*10},u={x:n.end.x+o*Ob-c*Ob*10,y:n.end.y+r*Ob-l*Ob*10};this.lastSearchCorner1=d,this.lastSearchCorner2=u;let _=[];for(let C=1;t||C<1000;C*=4){let b=Math.min(C,h),I=vLt([d,u,{x:d.x+o*b,y:d.y+r*b},{x:u.x+o*b,y:u.y+r*b}]);if(this.lastSearchBounds=I,_=this.rectSpatialIndex.search(I).filter((v)=>v.availableZ.includes(n.z)).filter((v)=>v.capacityMeshNodeId!==n.parent.capacityMeshNodeId),_.length>0)break;if(C>=h)break}if(_.length===0&&!t)return;this.lastCollidingNodes=_;let p=h;for(let C of _){let b=KS(n.start,n.end,C);b<p&&(p=b)}let m=p,A=vLt([n.start,n.end,{x:n.start.x+o*m,y:n.start.y+r*m},{x:n.end.x+o*m,y:n.end.y+r*m}]),g={x:(A.minX+A.maxX)/2,y:(A.minY+A.maxY)/2},f=A.maxX-A.minX,y=A.maxY-A.minY,x={segment:n,newNode:{capacityMeshNodeId:`new-${n.parent.capacityMeshNodeId}-${this.expandedSegments.length}`,center:g,width:f,height:y,availableZ:[n.z],layer:n.parent.layer}};this.lastExpandedSegment=x,f<Ob||y<Ob||(this.expandedSegments.push(x),this.rectSpatialIndex.insert({...x.newNode,...A}))}getOutput(){return{expandedSegments:this.expandedSegments}}visualize(){let e={title:"ExpandEdgesToEmptySpace",coordinateSystem:"cartesian",rects:[],points:[],lines:[],circles:[],infiniteLines:[],polygons:[],arrows:[],texts:[]};for(let t of this.input.inputMeshNodes)e.rects.push({center:t.center,width:t.width,height:t.height,stroke:"rgba(0, 0, 0, 0.1)",layer:`z${t.availableZ.join(",")}`,label:[`node ${t.capacityMeshNodeId}`,`z:${t.availableZ.join(",")}`].join(`
`)});for(let{newNode:t}of this.expandedSegments)e.rects.push({center:t.center,width:t.width,height:t.height,fill:"green",label:`expandedSegment (z=${t.availableZ.join(",")})`,layer:`z${t.availableZ.join(",")}`});if(this.lastSegment&&e.lines.push({points:[this.lastSegment.start,this.lastSegment.end],strokeColor:"rgba(0, 0, 255, 0.5)"}),this.lastSearchBounds&&e.rects.push({center:{x:(this.lastSearchBounds.minX+this.lastSearchBounds.maxX)/2,y:(this.lastSearchBounds.minY+this.lastSearchBounds.maxY)/2},width:this.lastSearchBounds.maxX-this.lastSearchBounds.minX,height:this.lastSearchBounds.maxY-this.lastSearchBounds.minY,fill:"rgba(0, 0, 255, 0.25)"}),this.lastSearchCorner1&&this.lastSearchCorner2&&(e.points.push({x:this.lastSearchCorner1.x,y:this.lastSearchCorner1.y,color:"rgba(0, 0, 255, 0.5)",label:["searchCorner1",`z=${this.lastSegment?.z}`].join(`
`)}),e.points.push({x:this.lastSearchCorner2.x,y:this.lastSearchCorner2.y,color:"rgba(0, 0, 255, 0.5)",label:["searchCorner2",`z=${this.lastSegment?.z}`].join(`
`)})),this.lastExpandedSegment&&e.rects.push({center:this.lastExpandedSegment.newNode.center,width:this.lastExpandedSegment.newNode.width,height:this.lastExpandedSegment.newNode.height,fill:"purple",label:`expandedSegment (z=${this.lastExpandedSegment.segment.z})`}),this.lastCollidingNodes)for(let t of this.lastCollidingNodes)e.rects.push({center:t.center,width:t.width,height:t.height,fill:"rgba(255, 0, 0, 0.5)"});return e}},Z0r=class extends rP{findSegmentsWithAdjacentEmptySpaceSolver;expandEdgesToEmptySpaceSolver;outputNodes=[];passExpandedCounts=[];currentPassNodes=[];currentTargetNodes=[];currentPassIndex=0;expandedNodeIds=new Set;maxGapFillPasses=1;pipelineDef=[Z0("findSegmentsWithAdjacentEmptySpaceSolver",G0r,(e)=>[{allMeshNodes:e.currentPassNodes,targetMeshNodes:e.currentTargetNodes}],{onSolved:()=>{}}),Z0("expandEdgesToEmptySpaceSolver",J0r,(e)=>[{inputMeshNodes:e.currentPassNodes,segmentsWithAdjacentEmptySpace:e.findSegmentsWithAdjacentEmptySpaceSolver.getOutput().segmentsWithAdjacentEmptySpace,boardVoid:e.inputProblem.boardVoid,bounds:e.inputProblem.bounds}],{onSolved:(e)=>{e.completePass()}})];_setup(){this.outputNodes=[...this.inputProblem.meshNodes],this.currentPassNodes=[...this.inputProblem.meshNodes],this.currentTargetNodes=[...this.inputProblem.meshNodes],this.passExpandedCounts=[],this.currentPassIndex=0,this.expandedNodeIds.clear();let e=this.inputProblem.maxGapFillPasses;this.maxGapFillPasses=Number.isFinite(e)?Math.max(1,Math.floor(e)):1}completePass(){let e=(this.expandEdgesToEmptySpaceSolver?.getOutput().expandedSegments??[]).map((t)=>t.newNode);for(let t of e)this.expandedNodeIds.add(t.capacityMeshNodeId);this.passExpandedCounts.push(e.length),this.currentPassNodes=[...this.currentPassNodes,...e],this.currentTargetNodes=e,this.outputNodes=this.currentPassNodes,e.length===0||this.currentPassIndex+1>=this.maxGapFillPasses||(this.currentPassIndex+=1,this.currentPipelineStageIndex=-1)}getOutput(){return{outputNodes:this.outputNodes.length?this.outputNodes:this.inputProblem.meshNodes}}initialVisualize(){let e={title:"GapFillSolverPipeline - Initial",coordinateSystem:"cartesian",rects:[],points:[],lines:[],circles:[],infiniteLines:[],polygons:[],arrows:[],texts:[]};for(let t of this.inputProblem.meshNodes)e.rects.push({center:t.center,width:t.width,height:t.height,stroke:"rgba(0, 0, 0, 0.3)",fill:"rgba(100, 100, 100, 0.1)",layer:`z${t.availableZ.join(",")}`,label:[`node ${t.capacityMeshNodeId}`,`z:${t.availableZ.join(",")}`].join(`
`)});return e}finalVisualize(){let e={title:"GapFillSolverPipeline - Final",coordinateSystem:"cartesian",rects:[],points:[],lines:[],circles:[],infiniteLines:[],polygons:[],arrows:[],texts:[]},{outputNodes:t}=this.getOutput();for(let n of t){let o=this.expandedNodeIds.has(n.capacityMeshNodeId);e.rects.push({center:n.center,width:n.width,height:n.height,stroke:o?"rgba(0, 128, 0, 0.8)":"rgba(0, 0, 0, 0.3)",fill:o?"rgba(0, 200, 0, 0.3)":"rgba(100, 100, 100, 0.1)",layer:`z${n.availableZ.join(",")}`,label:[`${o?"[expanded] ":""}node ${n.capacityMeshNodeId}`,`z:${n.availableZ.join(",")}`].join(`
`)})}return e}};function SLt(e){let t=e.toLowerCase();if(t==="top")return-1e6;if(t==="bottom")return 1e6;let n=/^inner(\d+)$/i.exec(t);return n?parseInt(n[1],10)||0:100+t.charCodeAt(0)}function K$e(e){let t=function(l){return Array.from(new Set(l)).sort((h,d)=>{let u=SLt(h),_=SLt(d);return u!==_?u-_:h.localeCompare(d)})}((e.obstacles??[]).flatMap((l)=>l.layers??[])),n=Math.max(1,e.layerCount||t.length||1),o=Array.from({length:n},(l,h)=>h===0?"top":h===n-1?"bottom":`inner${h}`),r=[],i=new Set,s=(l)=>{let h=l.toLowerCase();i.has(h)||(i.add(h),r.push(l))};o.forEach(s),t.forEach(s);let a=r.slice(0,n),c=new Map;return a.forEach((l,h)=>c.set(l.toLowerCase(),h)),r.slice(a.length).forEach((l)=>{let h=l.toLowerCase();c.set(h,((d)=>{if(a.length<=1)return 0;if(d==="top")return 0;if(d==="bottom")return a.length-1;let u=/^inner(\d+)$/i.exec(d);if(u){if(a.length<=2)return a.length-1;let _=parseInt(u[1],10),p=a.length-2;return Math.min(p,Math.max(1,Number.isFinite(_)?_:1))}return 0})(h))}),{layerNames:a,zIndexByName:c}}function $$e(e,t){if(e.zLayers?.length)return Array.from(new Set(e.zLayers)).sort((o,r)=>o-r);let n=(e.layers??[]).map((o)=>t.get(o.toLowerCase())).filter((o)=>typeof o=="number");return Array.from(new Set(n)).sort((o,r)=>o-r)}function q$e(e){let{width:t,height:n}=e;return typeof t!="number"||typeof n!="number"?null:{x:e.center.x-t/2,y:e.center.y-n/2,width:t,height:n}}var oCe=(e)=>{let t=[{fill:"#dbeafe",stroke:"#3b82f6"},{fill:"#fef3c7",stroke:"#f59e0b"},{fill:"#d1fae5",stroke:"#10b981"},{fill:"#e9d5ff",stroke:"#a855f7"},{fill:"#fed7aa",stroke:"#f97316"},{fill:"#fecaca",stroke:"#ef4444"}];return t[Math.min(...e)%t.length]},hr=0.000000001,PLt=(e,t)=>e>t+hr,vUt=(e,t)=>e>t-hr,ELt=(e,t)=>e<t-hr,SUt=(e,t)=>e<t+hr;function BQ(e,t){return!(e.x+e.width<=t.x+hr||t.x+t.width<=e.x+hr||e.y+e.height<=t.y+hr||t.y+t.height<=e.y+hr)}function xce(e,t){let n=t.x,o=t.x+t.width,r=t.y,i=t.y+t.height;if(e.x>=n&&e.x<=o&&e.y>=r&&e.y<=i)return Math.min(e.x-n,o-e.x,e.y-r,i-e.y);let s=e.x<n?n-e.x:e.x>o?e.x-o:0,a=e.y<r?r-e.y:e.y>i?e.y-i:0;return s===0?a:a===0?s:Math.hypot(s,a)}function MLt(e,t){let n=Math.max(e[0],t[0]),o=Math.min(e[1],t[1]);return o>n+hr?[n,o]:null}function PUt(e,t){if(!BQ(e,t))return[e];let n=MLt([e.x,e.x+e.width],[t.x,t.x+t.width]),o=MLt([e.y,e.y+e.height],[t.y,t.y+t.height]);if(!n||!o)return[e];let[r,i]=n,[s,a]=o,c=[];r>e.x+hr&&c.push({x:e.x,y:e.y,width:r-e.x,height:e.height}),e.x+e.width>i+hr&&c.push({x:i,y:e.y,width:e.x+e.width-i,height:e.height});let l=Math.max(0,i-r);return l>hr&&s>e.y+hr&&c.push({x:r,y:e.y,width:l,height:s-e.y}),l>hr&&e.y+e.height>a+hr&&c.push({x:r,y:a,width:l,height:e.y+e.height-a}),c.filter((h)=>h.width>hr&&h.height>hr)}var J$e=(e,t)=>!t||t<=0?e:{x:e.x-t,y:e.y-t,width:e.width+2*t,height:e.height+2*t},cQ=(e)=>({x:e.center.x-e.width/2,y:e.center.y-e.height/2,width:e.width,height:e.height}),wLt=(e)=>e.width*e.height,DWe=(e)=>({...e,center:{...e.center},availableZ:[...e.availableZ]}),BLt=(e,t,n)=>({...e,capacityMeshNodeId:n,center:{x:t.x+t.width/2,y:t.y+t.height/2},width:t.width,height:t.height,availableZ:[...e.availableZ],layer:`z${e.availableZ.join(",")}`}),xae=(e)=>!e._containsObstacle&&!e._containsTarget,TLt=(e,t)=>e.availableZ.length===1&&e.availableZ[0]===t,epr=(e,t)=>Math.abs(e.x-t.x)<=hr&&Math.abs(e.y-t.y)<=hr&&Math.abs(e.width-t.width)<=hr&&Math.abs(e.height-t.height)<=hr,EUt=(e,t)=>{let n=[e];for(let o of t){if(n.length===0)return n;let r=[];for(let i of n)r.push(...PUt(i,o));n=r}return n},DLt=(e,t)=>EUt(e,t).length===0,tpr=class extends Da{constructor(e){super(),this.input=e}input;outputNodes=[];promotedNodeIds=new Set;residualNodeIds=new Set;_setup(){this.outputNodes=this.input.meshNodes.map(DWe),this.promotedNodeIds.clear(),this.residualNodeIds.clear()}_step(){this.outputNodes=this.processOuterLayerContainmentMerges(),this.solved=!0}processOuterLayerContainmentMerges(){let e=this.input.simpleRouteJson,t=Math.max(1,e.layerCount||1);if(t<3)return this.input.meshNodes.map(DWe);let n=t-1,o=Math.max(e.minViaDiameter??0,e.minTraceWidth||0),r=this.input.meshNodes.map(DWe),i=this.buildObstaclesByLayer(t);if(!i.slice(1,-1).some((m)=>m.some((A)=>A.obstacle.isCopperPour)))return r;let s=r.filter((m)=>xae(m)&&(TLt(m,0)||TLt(m,n))),a=r.filter((m)=>!xae(m)),c=a.filter((m)=>m.availableZ.includes(0)||m.availableZ.includes(n)).map(cQ),l=new Map;l.set(0,r.filter((m)=>xae(m)&&m.availableZ.includes(0))),l.set(n,r.filter((m)=>xae(m)&&m.availableZ.includes(n)));let h=[],d=[],u=s.filter((m)=>m.width+hr>=o&&m.height+hr>=o).sort((m,A)=>wLt(cQ(A))-wLt(cQ(m)));for(let m of u){let A=m.availableZ[0],g=A===0?n:0,f=cQ(m);if(c.some((b)=>BQ(b,f)))continue;let y=(l.get(g)??[]).filter((b)=>BQ(f,cQ(b))),x=y[0]?.availableZ;if(!x)continue;if(d.some((b)=>BQ(f,b)))continue;if(!this.isTransitCompatibleAcrossIntermediateLayers({rect:f,fromZ:A,toZ:g,obstaclesByLayer:i}))continue;if(!DLt(f,y.map(cQ)))continue;let C=y.every((b)=>b.availableZ.length===x.length&&b.availableZ.every((I)=>x.includes(I)))?[{rect:f,availableZ:x}]:y.map((b)=>{let I=cQ(b),v=Math.max(f.x,I.x),P=Math.max(f.y,I.y);return{rect:{x:v,y:P,width:Math.min(f.x+f.width,I.x+I.width)-v,height:Math.min(f.y+f.height,I.y+I.height)-P},availableZ:b.availableZ}});for(let[b,I]of C.entries()){if(I.rect.width+hr<o||I.rect.height+hr<o)continue;let v=[...new Set([A,...I.availableZ])].sort((M,B)=>M-B),P=b===0?m.capacityMeshNodeId:`${m.capacityMeshNodeId}-outer-support-${b}`;h.push(BLt({...m,availableZ:v},I.rect,P)),d.push(I.rect),this.promotedNodeIds.add(P)}}if(h.length===0)return r;let _=0,p=[];for(let m of r.filter(xae)){let A=cQ(m);if(m.availableZ.filter((f)=>f===0||f===n).length===0){p.push(m);continue}let g=EUt(A,d);if(g.length===1&&epr(g[0],A))p.push(m);else for(let f of g){let y=BLt(m,f,`${m.capacityMeshNodeId}-outer-merge-${_++}`);p.push(y),this.residualNodeIds.add(y.capacityMeshNodeId)}}return[...a,...h,...p]}buildObstaclesByLayer(e){let t=Array.from({length:e},()=>[]);for(let n of this.input.simpleRouteJson.obstacles??[]){let o=q$e(n);if(!o)continue;let r=J$e(o,this.input.obstacleClearance??0),i=$$e(n,this.input.zIndexByName);for(let s of i)s<0||s>=e||t[s].push({obstacle:n,rect:r})}return t}isTransitCompatibleAcrossIntermediateLayers(e){let{rect:t,fromZ:n,toZ:o,obstaclesByLayer:r}=e,i=Math.min(n,o),s=Math.max(n,o);if(s-i<2)return!1;let a=!1;for(let c=i+1;c<s;c++){let l=(r[c]??[]).filter((h)=>BQ(h.rect,t));if(l.length===0)continue;if(l.some((h)=>!h.obstacle.isCopperPour))return!1;if(!DLt(t,l.map((h)=>h.rect)))return!1;a=!0}return a}getOutput(){return{outputNodes:this.outputNodes}}visualize(){return{title:"OuterLayerContainmentMergeSolver",coordinateSystem:"cartesian",rects:this.outputNodes.map((e)=>{let t=oCe(e.availableZ),n=this.promotedNodeIds.has(e.capacityMeshNodeId),o=this.residualNodeIds.has(e.capacityMeshNodeId);return{center:e.center,width:e.width,height:e.height,stroke:n?"rgba(22, 163, 74, 0.95)":o?"rgba(37, 99, 235, 0.95)":t.stroke,fill:e._containsObstacle?"rgba(239, 68, 68, 0.35)":n?"rgba(34, 197, 94, 0.28)":o?"rgba(59, 130, 246, 0.18)":t.fill,layer:`z${e.availableZ.join(",")}`,label:[`node ${e.capacityMeshNodeId}`,`z:${e.availableZ.join(",")}`].join(`
`)}}),points:[],lines:[],texts:[]}}},p4e=0.000000001,npr=(e)=>Math.abs(e.rect.x+e.rect.width/2-e.startX)<p4e&&Math.abs(e.rect.y+e.rect.height/2-e.startY)<p4e&&Math.abs(e.rect.width-e.initialW)<p4e&&Math.abs(e.rect.height-e.initialH)<p4e,opr=({rect:e,bounds:t})=>({x:e.x,y:e.y,width:t.x+t.width-e.x,height:e.height}),rpr=({rect:e,bounds:t})=>({x:e.x,y:e.y,width:e.width,height:t.y+t.height-e.y}),ipr=({rect:e,bounds:t})=>({x:t.x,y:e.y,width:e.x-t.x,height:e.height}),spr=({rect:e,bounds:t})=>({x:e.x,y:t.y,width:e.width,height:e.y-t.y}),m4e=(e,t=0.000001)=>Math.round(e/t)*t,apr=(e)=>({x:m4e(e.x),y:m4e(e.y),width:m4e(e.width),height:m4e(e.height)});function cpr(e){let{r:t,bounds:n,blockers:o,maxAspect:r}=e,i=n.x+n.width-t.x;for(let a of o)if(t.y+t.height>a.y+hr&&a.y+a.height>t.y+hr){if(vUt(a.x,t.x+t.width))i=Math.min(i,a.x-t.x);else if(a.x+a.width>t.x+t.width-hr&&a.x<t.x+t.width+hr)return 0}let s=Math.max(0,i-t.width);if(s<=0)return 0;if(r!=null){let{width:a,height:c}=t;a>=c&&(s=Math.min(s,r*c-a))}return Math.max(0,s)}function lpr(e){let{r:t,bounds:n,blockers:o,maxAspect:r}=e,i=n.y+n.height-t.y;for(let a of o)if(t.x+t.width>a.x+hr&&a.x+a.width>t.x+hr){if(vUt(a.y,t.y+t.height))i=Math.min(i,a.y-t.y);else if(a.y+a.height>t.y+t.height-hr&&a.y<t.y+t.height+hr)return 0}let s=Math.max(0,i-t.height);if(s<=0)return 0;if(r!=null){let{width:a,height:c}=t;c>=a&&(s=Math.min(s,r*a-c))}return Math.max(0,s)}function hpr(e){let{r:t,bounds:n,blockers:o,maxAspect:r}=e,i=n.x;for(let a of o)if(t.y+t.height>a.y+hr&&a.y+a.height>t.y+hr){if(SUt(a.x+a.width,t.x))i=Math.max(i,a.x+a.width);else if(a.x<t.x+hr&&a.x+a.width>t.x-hr)return 0}let s=Math.max(0,t.x-i);if(s<=0)return 0;if(r!=null){let{width:a,height:c}=t;a>=c&&(s=Math.min(s,r*c-a))}return Math.max(0,s)}function dpr(e){let{r:t,bounds:n,blockers:o,maxAspect:r}=e,i=n.y;for(let a of o)if(t.x+t.width>a.x+hr&&a.x+a.width>t.x+hr){if(SUt(a.y+a.height,t.y))i=Math.max(i,a.y+a.height);else if(a.y<t.y+hr&&a.y+a.height>t.y-hr)return 0}let s=Math.max(0,t.y-i);if(s<=0)return 0;if(r!=null){let{width:a,height:c}=t;c>=a&&(s=Math.min(s,r*a-c))}return Math.max(0,s)}var NLt=(e)=>{let{rect:t,seen:n,blockers:o}=e;n.has(t)||(n.add(t),o.push(t))};function MUt(e){let{startX:t,startY:n,gridSize:o,bounds:r,obsticalIndexByLayer:i,placedIndexByLayer:s,initialCellRatio:a,maxAspectRatio:c,minReq:l}=e,h=Math.max(0.000000001,o*a),d=Math.max(h,l.width),u=Math.max(h,l.height),_=[],p=new Set,m=s.length,A=[],g=(C)=>{let b=((I)=>{let{bounds:v,rect:P}=I,M=Math.max(v.x,P.x),B=Math.max(v.y,P.y),T=Math.min(v.x+v.width,P.x+P.width),N=Math.min(v.y+v.height,P.y+P.height);return T<=M+hr||N<=B+hr?null:{minX:M,minY:B,maxX:T,maxY:N}})({bounds:r,rect:C});if(b){for(let I of A)if(I.minX<=b.minX&&I.minY<=b.minY&&I.maxX>=b.maxX&&I.maxY>=b.maxY)return;for(let I of e.zLayers){let v=i[I];if(v)for(let M of v.search(b))NLt({rect:M,seen:p,blockers:_});let P=s[I];if(P)for(let M of P.search(b))M.zLayers.length>=m&&(npr({rect:M,startX:t,startY:n,initialW:d,initialH:u})||NLt({rect:M,seen:p,blockers:_}))}for(let I=A.length-1;I>=0;I--){let v=A[I];b.minX<=v.minX&&b.minY<=v.minY&&b.maxX>=v.maxX&&b.maxY>=v.maxY&&A.splice(I,1)}A.push(b)}},f=[{ox:0,oy:0},{ox:-d,oy:0},{ox:0,oy:-u},{ox:-d,oy:-u},{ox:-d/2,oy:-u/2}],y=null,x=0;e:for(let C of f){let b={x:t+C.ox,y:n+C.oy,width:d,height:u};if(g(b),ELt(b.x,r.x)||ELt(b.y,r.y)||PLt(b.x+b.width,r.x+r.width)||PLt(b.y+b.height,r.y+r.height))continue;for(let B of _)if(BQ(b,B))continue e;let I=0.000001,v=1000,P=!0,M=0;for(;P&&M<v;){M++,P=!1;let B={bounds:r,blockers:_,maxAspect:c};g(opr({rect:b,bounds:r}));let T=cpr({...B,r:b});T>I&&(b={...b,width:b.width+T},g(b),P=!0),g(rpr({rect:b,bounds:r}));let N=lpr({...B,r:b});N>I&&(b={...b,height:b.height+N},g(b),P=!0),g(ipr({rect:b,bounds:r}));let D=hpr({...B,r:b});D>I&&(b={x:b.x-D,y:b.y,width:b.width+D,height:b.height},g(b),P=!0),g(spr({rect:b,bounds:r}));let L=dpr({...B,r:b});L>I&&(b={x:b.x,y:b.y-L,width:b.width,height:b.height+L},g(b),P=!0)}if(b.width+hr>=l.width&&b.height+hr>=l.height){let B=b.width*b.height;B>x&&(y=apr(b),x=B)}}return y}function upr(e){let t=Math.max(e.width,e.height);return[t/8,t/16,t/32]}function Lje(e){let t={minX:e.point.x,minY:e.point.y,maxX:e.point.x,maxY:e.point.y};for(let n=0;n<e.layerCount;n++){let o=e.obstacleIndexByLayer[n],r=!!o&&o.collides(t),i=e.placedIndexByLayer[n],s=!!i&&i.collides(t);if(!r&&!s)return!1}return!0}function Hje(e){let{x:t,y:n,z:o,layerCount:r,minSpan:i,maxSpan:s,obstacleIndexByLayer:a,additionalBlockersByLayer:c}=e,l=(_)=>{let p={minX:t,minY:n,maxX:t,maxY:n},m=a[_];if(m&&m.collides(p))return!1;return!(c?.[_]??[]).some((A)=>{return(f={x:t,y:n}).x>=(g=A).x-hr&&f.x<=g.x+g.width+hr&&f.y>=g.y-hr&&f.y<=g.y+g.height+hr;var g,f})},h=o,d=o;for(;h-1>=0&&l(h-1);)h--;for(;d+1<r&&l(d+1);)d++;if(typeof s=="number"){let _=((p,m,A)=>Math.max(m,Math.min(A,p)))(s,1,r);for(;d-h+1>_;)o-h>d-o?h++:d--}let u=[];for(let _=h;_<=d;_++)u.push(_);return u.length>=i?u:[]}var ppr=(e,t=0.000001)=>Math.round(e/t)*t,T3=(e,t=0.000001)=>Math.round(e/t)*t,mpr=(e)=>("minX"in e)?{x:e.minX,y:e.minY,width:e.maxX-e.minX,height:e.maxY-e.minY}:e;function _pr(e){let{segment:t,coveringIntervals:n,hasReversedIntervals:o,minSegmentLength:r}=e,i=T3(t.lineStart),s=T3(t.lineEnd),a=T3(t.clipStart),c=T3(t.clipEnd),l=[];if(o||a>c)l=n.filter((_)=>_.sourceIndex!==t.sourceIndex).map((_)=>{let p=Math.max(a,_.start),m=Math.min(c,_.end);return{start:Math.min(p,m),end:Math.max(p,m)}}).filter((_)=>_.end>_.start+hr).sort((_,p)=>_.start-p.start);else{let _=1/0,p=-1/0;for(let m of n){if(m.sourceIndex===t.sourceIndex)continue;let A=Math.max(a,m.start),g=Math.min(c,m.end);g<A?m.end<a?_=Math.min(_,g):p=Math.max(p,A):g>A+hr&&l.push({start:A,end:g})}a>_+hr&&l.unshift({start:_,end:a}),p>c+hr&&l.push({start:c,end:p})}if(l.length===0)return[{start:i,end:s,center:(i+s)/2}];let h=[],d=l[0].start,u=l[0].end;d>i+hr&&d-i>=r&&h.push({start:i,end:d,center:(i+d)/2});for(let _=1;_<l.length;_++){let p=l[_];p.start<=u+hr?u=Math.max(u,p.end):(p.start-u>=r&&h.push({start:u,end:p.start,center:(u+p.start)/2}),u=p.end)}return u<s-hr&&s-u>=r&&h.push({start:u,end:s,center:(u+s)/2}),h}function gpr(e){let{bounds:t,minSize:n,layerCount:o,obstacleIndexByLayer:r,placedIndexByLayer:i,hardPlacedByLayer:s}=e,a=[],c=Math.max(0.15*n,3*hr),l=0,h=new Map,d=Array.from({length:o},(m,A)=>[...r[A]?.all()??[],...s[A]??[]].map(mpr)),u=d.map((m)=>{if(m.length===0)return null;let A=new R_(m.length);for(let g of m){let f=g.x+g.width,y=g.y+g.height;A.add(Math.min(g.x,f),Math.min(g.y,y),Math.max(g.x,f),Math.max(g.y,y))}return A.finish(),A});function _(m){let A=T3(m.x),g=T3(m.y),{z:f}=m,y=A,x=g;if(y<t.x+hr||x<t.y+hr||y>t.x+t.width-hr||x>t.y+t.height-hr)return;let C=((I)=>`${I.z}|${I.x.toFixed(6)}|${I.y.toFixed(6)}`)({x:y,y:x,z:f}),b=h.get(C);b&&(b.order<m.order||b.order===m.order&&b.pointOrder<=m.pointOrder)||function(I){return Lje({layerCount:o,obstacleIndexByLayer:r,placedIndexByLayer:i,point:I})}({x:y,y:x})||h.set(C,{x:y,y:x,z:f,order:m.order,pointOrder:m.pointOrder})}for(let m=0;m<o;m++){let A=(d[m]??[]).map((M)=>({x:T3(M.x),y:T3(M.y),width:T3(M.width),height:T3(M.height)})),g=A.length>0?new R_(A.length):null;if(g){for(let M of A)g.add(M.x,M.y,M.x+M.width,M.y+M.height);g.finish()}let f=new Map,y=new Map,x=(M)=>{let B=M.vertical?f:y,T=B.get(M.coordinate);T?T.push(M.edgeOrdinal):B.set(M.coordinate,[M.edgeOrdinal])},C=l,b=0,I=[{x:t.x+c,y:t.y+c},{x:t.x+t.width-c,y:t.y+c},{x:t.x+c,y:t.y+t.height-c},{x:t.x+t.width-c,y:t.y+t.height-c}];for(let M of I)_({...M,z:m,order:C+b++,pointOrder:0});let v=b;for(let M of[t.y+c,t.y+t.height-c])x({vertical:!1,coordinate:M,edgeOrdinal:b++});for(let M of[t.x+c,t.x+t.width-c])x({vertical:!0,coordinate:M,edgeOrdinal:b++});let P=b;for(let M=0;M<A.length;M++){let B=A[M];for(let T of[B.x-c,B.x+B.width+c]){let N=b++;T>t.x+hr&&T<t.x+t.width-hr&&x({vertical:!0,coordinate:T,edgeOrdinal:N})}for(let T of[B.y-c,B.y+B.height+c]){let N=b++;T>t.y+hr&&T<t.y+t.height-hr&&x({vertical:!1,coordinate:T,edgeOrdinal:N})}}l=C+b;for(let M of[!0,!1]){let B=M?f:y;for(let[T,N]of B){let D=g?M?g.search(T,-1/0,T,1/0):g.search(-1/0,T,1/0,T):[],L=[],H=!1;for(let V of D){let O=A[V];if(M?O.x>T||O.x+O.width<T:O.y>T||O.y+O.height<T)continue;let U=T3(M?O.y:O.x),j=T3(M?O.y+O.height:O.x+O.width);L.push({start:U,end:j,sourceIndex:V}),j<U&&(H=!0)}L.sort((V,O)=>V.start-O.start);for(let V of N){let O=V<P,U=V-P,j=O?void 0:Math.floor(U/4),Y=O?t:A[j],X=O?V===v||V===v+2:U%4==0||U%4==2,K=M?Y.x:Y.y,J=M?Y.width:Y.height,ee=O?X?K+c:K+J-c:X?K-c:K+J+c,se=M?Y.y:Y.x,ne=M?Y.y+Y.height:Y.x+Y.width,re=_pr({segment:{lineStart:O?se+c:se,lineEnd:O?ne-c:ne,clipStart:se,clipEnd:ne,sourceIndex:j},coveringIntervals:L,hasReversedIntervals:H,minSegmentLength:0.5*n}),Z=0;for(let te of re){let ie=(ue)=>_({...M?{x:ee,y:ue,z:m}:{x:ue,y:ee,z:m},order:C+V,pointOrder:Z++}),le=te.end-te.start;if(O){if(le<n)continue;ie(te.center),le>1.5*n&&(ie(te.start+0.4*n),ie(te.end-0.4*n))}else ie(te.center)}}}}}let p=[...h.values()].sort((m,A)=>m.order-A.order||m.pointOrder-A.pointOrder);for(let{x:m,y:A,z:g}of p){let f=d[g]??[],y=xce({x:m,y:A},t),x=u[g];if(x){let I=x.neighbors(m,A,1)[0];y=Math.min(y,xce({x:m,y:A},f[I]));let v=x.search(m-y,A-y,m+y,A+y);for(let P of v)y=Math.min(y,xce({x:m,y:A},f[P]))}let C=T3(y),b=Hje({x:m,y:A,z:g,layerCount:o,minSpan:1,maxSpan:void 0,obstacleIndexByLayer:r,additionalBlockersByLayer:s});a.push({x:m,y:A,z:g,distance:C,zSpanLen:b.length,isEdgeSeed:!0})}return a.sort((m,A)=>A.zSpanLen-m.zSpanLen||A.distance-m.distance||m.z-A.z||m.x-A.x||m.y-A.y),a}var k$=(e,t)=>({...e,minX:e.x,minY:e.y,maxX:e.x+e.width,maxY:e.y+e.height,zLayers:t.zLayers});function wUt(e,t){let n=e.placed[t],{rect:o,zLayers:r}=n,i=e.layerCount,s=[],a=[];for(let l=0;l<e.placed.length;l++){if(l===t)continue;let h=e.placed[l];if(h.zLayers.length>=i)continue;if(!BQ(h.rect,o))continue;let d=h.zLayers.filter((A)=>r.includes(A));if(d.length===0)continue;let u=PUt(h.rect,o);s.push(l);let _=h.zLayers.filter((A)=>!r.includes(A));_.length>0&&a.push({rect:h.rect,zLayers:_});let p=Math.min(e.options.minSingle.width,e.options.minMulti.width),m=Math.min(e.options.minSingle.height,e.options.minMulti.height);for(let A of u)A.width+hr>=p&&A.height+hr>=m&&a.push({rect:A,zLayers:d.slice()})}let c=(l,h)=>l.minX===h.minX&&l.minY===h.minY&&l.maxX===h.maxX&&l.maxY===h.maxY;s.sort((l,h)=>h-l).forEach((l)=>{let h=e.placed.splice(l,1)[0];if(e.placedIndexByLayer)for(let d of h.zLayers){let u=e.placedIndexByLayer[d];u&&u.remove(k$(h.rect,{zLayers:h.zLayers}),c)}});for(let l of a){e.placed.push(l);for(let h of l.zLayers)if(e.placedIndexByLayer){let d=e.placedIndexByLayer[h];d&&d.insert(k$(l.rect,{zLayers:l.zLayers.slice()}))}}}var Apr=class extends Da{constructor(e){super(),this.input=e}input;srj;layerNames;layerCount;bounds;options;boardVoidRects;gridIndex;candidates;placed;placedIndexByLayer;hardPlacedByLayer;expansionIndex;edgeAnalysisDone;totalSeedsThisGrid;consumedSeedsThisGrid;_setup(){let e=this.input.simpleRouteJson,t=this.input.gridOptions??{},n=this.input.layerNames&&this.input.zIndexByName,{layerNames:o,zIndexByName:r}=n?{layerNames:this.input.layerNames,zIndexByName:this.input.zIndexByName}:K$e({obstacles:e.obstacles,layerCount:e.layerCount}),i=Math.max(1,o.length,e.layerCount||1),s={x:e.bounds.minX,y:e.bounds.minY,width:e.bounds.maxX-e.bounds.minX,height:e.bounds.maxY-e.bounds.minY},a=Math.max(0.01,e.minTraceWidth||0.15),c={...{gridSizes:[],initialCellRatio:0.2,maxAspectRatio:3,minSingle:{width:2*a,height:2*a},minMulti:{width:4*a,height:4*a,minLayers:Math.min(2,Math.max(1,e.layerCount||1))},preferMultiLayer:!0,maxMultiLayerSpan:void 0},...t,gridSizes:t.gridSizes??upr(s)};this.srj=e,this.layerNames=o,this.layerCount=i,this.bounds=s,this.options=c,this.boardVoidRects=this.input.boardVoidRects,this.gridIndex=0,this.candidates=[],this.placed=[],this.placedIndexByLayer=Array.from({length:i},()=>new JV),this.hardPlacedByLayer=Array.from({length:i},()=>[]),this.expansionIndex=0,this.edgeAnalysisDone=!1,this.totalSeedsThisGrid=0,this.consumedSeedsThisGrid=0,this.stats={gridIndex:this.gridIndex}}_step(){this._stepGrid(),this.stats.gridIndex=this.gridIndex,this.stats.placed=this.placed.length}_stepGrid(){let{gridSizes:e,initialCellRatio:t,maxAspectRatio:n,minSingle:o,minMulti:r,preferMultiLayer:i,maxMultiLayerSpan:s}=this.options,a=e[this.gridIndex];if(this.candidates.length===0&&this.consumedSeedsThisGrid===0&&(this.candidates=function(u){let{bounds:_,gridSize:p,layerCount:m,obstacleIndexByLayer:A,placedIndexByLayer:g,hardPlacedByLayer:f}=u,y=new Map,x=Array.from({length:m},(b,I)=>[...A[I]?.all()??[],...f[I]??[]]);for(let b=_.x;b<_.x+_.width;b+=p)for(let I=_.y;I<_.y+_.height;I+=p){if(Math.abs(b-_.x)<hr||Math.abs(I-_.y)<hr||b>_.x+_.width-p-hr||I>_.y+_.height-p-hr)continue;if(Lje({layerCount:m,obstacleIndexByLayer:A,placedIndexByLayer:g,point:{x:b,y:I}}))continue;let v=[],P=0;for(let V=0;V<m;V++){let O=Hje({x:b,y:I,z:V,layerCount:m,minSpan:1,maxSpan:void 0,obstacleIndexByLayer:A,additionalBlockersByLayer:f});O.length>v.length&&(v=O,P=V)}let M=v.length?v[Math.floor(v.length/2)]:P,B=x[M]??[],T=xce({x:b,y:I},_);for(let V of B)T=Math.min(T,xce({x:b,y:I},V));let N=ppr(T),D=`${b.toFixed(6)}|${I.toFixed(6)}`,L={x:b,y:I,z:M,distance:N,zSpanLen:v.length},H=y.get(D);(!H||L.zSpanLen>(H.zSpanLen??0)||L.zSpanLen===H.zSpanLen&&L.distance>H.distance)&&y.set(D,L)}let C=Array.from(y.values());return C.sort((b,I)=>I.zSpanLen-b.zSpanLen||I.distance-b.distance||b.z-I.z||b.x-I.x||b.y-I.y),C}({bounds:this.bounds,gridSize:a,layerCount:this.layerCount,hardPlacedByLayer:this.hardPlacedByLayer,obstacleIndexByLayer:this.input.obstacleIndexByLayer,placedIndexByLayer:this.placedIndexByLayer}),this.totalSeedsThisGrid=this.candidates.length,this.consumedSeedsThisGrid=0),this.consumedSeedsThisGrid>=this.candidates.length){if(this.gridIndex+1<e.length)return this.gridIndex+=1,this.candidates=[],this.totalSeedsThisGrid=0,void(this.consumedSeedsThisGrid=0);if(!this.edgeAnalysisDone){let u=Math.min(o.width,o.height);return this.candidates=gpr({bounds:this.bounds,minSize:u,layerCount:this.layerCount,obstacleIndexByLayer:this.input.obstacleIndexByLayer,placedIndexByLayer:this.placedIndexByLayer,hardPlacedByLayer:this.hardPlacedByLayer}),this.edgeAnalysisDone=!0,this.totalSeedsThisGrid=this.candidates.length,void(this.consumedSeedsThisGrid=0)}return this.candidates=[],this.solved=!0,void(this.expansionIndex=0)}let c=this.candidates[this.consumedSeedsThisGrid++];if(Lje({layerCount:this.layerCount,obstacleIndexByLayer:this.input.obstacleIndexByLayer,placedIndexByLayer:this.placedIndexByLayer,point:{x:c.x,y:c.y}}))return;let l=Hje({x:c.x,y:c.y,z:c.z,layerCount:this.layerCount,minSpan:r.minLayers,maxSpan:s,obstacleIndexByLayer:this.input.obstacleIndexByLayer,additionalBlockersByLayer:this.hardPlacedByLayer}),h=[];l.length>=r.minLayers&&h.push({kind:"multi",layers:l,minReq:{width:r.width,height:r.height}}),h.push({kind:"single",layers:[c.z],minReq:{width:o.width,height:o.height}});let d=i?h:h.reverse();for(let u of d){let _=MUt({startX:c.x,startY:c.y,gridSize:a,bounds:this.bounds,obsticalIndexByLayer:this.input.obstacleIndexByLayer,placedIndexByLayer:this.placedIndexByLayer,initialCellRatio:t,maxAspectRatio:n,minReq:u.minReq,zLayers:u.layers});if(!_)continue;let p={rect:_,zLayers:[...u.layers]},m=this.placed.push(p)-1;for(let A of u.layers){let g=this.placedIndexByLayer[A];g&&g.insert(k$(_,{zLayers:p.zLayers}))}if(wUt({layerCount:this.layerCount,placed:this.placed,options:this.options,placedIndexByLayer:this.placedIndexByLayer},m),p.zLayers.length>=this.layerCount)for(let A of p.zLayers)this.hardPlacedByLayer[A].push(p.rect);return}}computeProgress(){if(this.solved)return 1;let e=this.options.gridSizes.length,t=this.gridIndex/(e+1),n=Math.max(1,this.totalSeedsThisGrid),o=n?this.consumedSeedsThisGrid/n:1;return Math.min(0.999,t+o*(1/(e+1)))}getOutput(){return{layerNames:this.layerNames,layerCount:this.layerCount,bounds:this.bounds,options:this.options,boardVoidRects:this.boardVoidRects,gridIndex:this.gridIndex,candidates:this.candidates,placed:this.placed,expansionIndex:this.expansionIndex,edgeAnalysisDone:this.edgeAnalysisDone,totalSeedsThisGrid:this.totalSeedsThisGrid,consumedSeedsThisGrid:this.consumedSeedsThisGrid,obstacles:this.srj.obstacles,obstacleClearance:this.input.obstacleClearance}}visualize(){let e=[],t=[],n=[],o=this.srj??this.input.simpleRouteJson,r=o.bounds.minX,i=o.bounds.maxX,s=o.bounds.minY,a=o.bounds.maxY;o.outline&&o.outline.length>1?n.push({points:[...o.outline,o.outline[0]],strokeColor:"#111827",strokeWidth:0.01,label:"outline"}):e.push({center:{x:(r+i)/2,y:(s+a)/2},width:i-r,height:a-s,fill:"none",stroke:"#111827",label:"board"});for(let c of o.obstacles??[])c.type!=="rect"&&c.type!=="oval"||e.push({center:{x:c.center.x,y:c.center.y},width:c.width,height:c.height,fill:"#fee2e2",stroke:"#ef4444",layer:"obstacle",label:"obstacle"});if(this.boardVoidRects){let c=null;if(o.outline&&o.outline.length>0){let l=o.outline.map((_)=>_.x),h=o.outline.map((_)=>_.y),d=Math.min(...l),u=Math.min(...h);c={x:d,y:u,width:Math.max(...l)-d,height:Math.max(...h)-u}}for(let l of this.boardVoidRects)c&&!BQ(l,c)||e.push({center:{x:l.x+l.width/2,y:l.y+l.height/2},width:l.width,height:l.height,fill:"rgba(0, 0, 0, 0.5)",stroke:"none",label:"void"})}if(this.candidates?.length)for(let c of this.candidates)t.push({x:c.x,y:c.y,label:`z:${c.z}`});if(this.placed?.length)for(let c of this.placed){let l=oCe(c.zLayers);e.push({center:{x:c.rect.x+c.rect.width/2,y:c.rect.y+c.rect.height/2},width:c.rect.width,height:c.rect.height,fill:l.fill,stroke:l.stroke,layer:`z${c.zLayers.join(",")}`,label:`free
z:${c.zLayers.join(",")}`})}return{title:"RectDiff Grid",coordinateSystem:"cartesian",rects:e,points:t,lines:n}}},fpr=(e,t)=>e.minX===t.minX&&e.minY===t.minY&&e.maxX===t.maxX&&e.maxY===t.maxY,ypr=class extends Da{constructor(e){super(),this.input=e}input;placedIndexByLayer=[];_meshNodes=[];_setup(){this.stats={gridIndex:this.input.gridIndex},this.placedIndexByLayer=Array.from({length:this.input.layerCount},()=>new JV);for(let e of this.input.placed)for(let t of e.zLayers){let n=this.placedIndexByLayer[t];n&&n.insert(k$(e.rect,{zLayers:e.zLayers}))}}_step(){this.solved||(this._stepExpansion(),this.stats.gridIndex=this.input.gridIndex,this.stats.placed=this.input.placed.length,this.input.expansionIndex>=this.input.placed.length&&this.finalizeIfNeeded())}_stepExpansion(){if(this.input.expansionIndex>=this.input.placed.length)return;let e=this.input.expansionIndex,t=this.input.placed[e],n=this.input.options.gridSizes[this.input.options.gridSizes.length-1],o=t.rect,r=MUt({startX:t.rect.x+t.rect.width/2,startY:t.rect.y+t.rect.height/2,gridSize:n,bounds:this.input.bounds,obsticalIndexByLayer:this.input.obstacleIndexByLayer,placedIndexByLayer:this.placedIndexByLayer,initialCellRatio:0,maxAspectRatio:null,minReq:{width:t.rect.width,height:t.rect.height},zLayers:t.zLayers});if(r){this.input.placed[e]={rect:r,zLayers:t.zLayers};for(let i of t.zLayers){let s=this.placedIndexByLayer[i];s&&(s.remove(k$(o,{zLayers:t.zLayers}),fpr),s.insert(k$(r,{zLayers:t.zLayers})))}wUt({layerCount:this.input.layerCount,placed:this.input.placed,options:this.input.options,placedIndexByLayer:this.placedIndexByLayer},e)}this.input.expansionIndex+=1}finalizeIfNeeded(){if(this.solved)return;let e=function(t){let n=t.placed.map((o)=>({minX:o.rect.x,minY:o.rect.y,maxX:o.rect.x+o.rect.width,maxY:o.rect.y+o.rect.height,zLayers:[...o.zLayers].sort((r,i)=>r-i)}));for(let o of t.obstacles??[]){let r=q$e(o);if(!r)continue;let i=t.obstacleClearance?{x:r.x-t.obstacleClearance,y:r.y-t.obstacleClearance,width:r.width+2*t.obstacleClearance,height:r.height+2*t.obstacleClearance}:r,s=o.zLayers?.length&&o.zLayers.length>0?o.zLayers:$$e(o,t.zIndexByName);n.push({minX:i.x,minY:i.y,maxX:i.x+i.width,maxY:i.y+i.height,zLayers:[...new Set(s)].sort((a,c)=>a-c),isObstacle:!0,connectedTo:[...o.connectedTo]})}return n}({placed:this.input.placed,obstacles:this.input.obstacles,zIndexByName:this.input.zIndexByName,boardVoidRects:this.input.boardVoidRects,obstacleClearance:this.input.obstacleClearance});this._meshNodes=function(t){let n=0,o=[];for(let r of t){let i=Math.max(0,r.maxX-r.minX),s=Math.max(0,r.maxY-r.minY);i<=0||s<=0||r.zLayers.length===0||o.push({capacityMeshNodeId:"cmn_"+n++,center:{x:(r.minX+r.maxX)/2,y:(r.minY+r.maxY)/2},width:i,height:s,layer:"top",availableZ:r.zLayers.slice(),_containsObstacle:r.isObstacle,_containsTarget:r.isObstacle,...r.connectedTo?.length?{_connectedTo:[...r.connectedTo]}:{}})}return o}(e),this.solved=!0}computeProgress(){if(this.solved)return 1;let e=this.input.options.gridSizes.length,t=e/(e+1),n=Math.max(1,this.input.placed.length),o=n?this.input.expansionIndex/n:1;return Math.min(0.999,t+o*(1/(e+1)))}getOutput(){if(this.solved)return{meshNodes:this._meshNodes};return{meshNodes:this.input.placed.map((e,t)=>({capacityMeshNodeId:`expand-preview-${t}`,center:{x:e.rect.x+e.rect.width/2,y:e.rect.y+e.rect.height/2},width:e.rect.width,height:e.rect.height,availableZ:e.zLayers.slice(),layer:`z${e.zLayers.join(",")}`}))}}visualize(){let e=[];for(let t of this.input.placed??[])e.push({center:{x:t.rect.x+t.rect.width/2,y:t.rect.y+t.rect.height/2},width:t.rect.width,height:t.rect.height,stroke:"rgba(37, 99, 235, 0.9)",fill:"rgba(191, 219, 254, 0.5)",layer:`z${t.zLayers.join(",")}`,label:`expanded
z:${t.zLayers.join(",")}`});return{title:"RectDiff Expansion",coordinateSystem:"cartesian",rects:e,points:[],lines:[]}}},xpr=class extends rP{rectDiffSeedingSolver;rectDiffExpansionSolver;obstacleIndexByLayer;layerNames;zIndexByName;constructor(e){super(e);let{obstacleIndexByLayer:t,layerNames:n,zIndexByName:o}=((r)=>{let{srj:i,boardVoidRects:s,obstacleClearance:a}=r,{layerNames:c,zIndexByName:l}=K$e({obstacles:i.obstacles,layerCount:i.layerCount}),h=Math.max(1,c.length,i.layerCount||1),d=(i.bounds.minX,i.bounds.minY,i.bounds.maxX,i.bounds.minX,i.bounds.maxY,i.bounds.minY,Array.from({length:h},()=>new JV)),u=(_,p)=>{let m={..._,minX:_.x,minY:_.y,maxX:_.x+_.width,maxY:_.y+_.height,zLayers:[p]};d[p]?.insert(m)};if(i.outline&&i.outline.length>2)for(let _ of s??[])for(let p=0;p<h;p++)u(_,p);for(let _ of i.obstacles??[]){let p=q$e(_);if(!p)continue;let m=J$e(p,a??0),A=$$e(_,l),g=A.filter((f)=>f<0||f>=h);if(g.length)throw Error(`RectDiff: obstacle uses z-layer indices ${g.join(",")} outside 0-${h-1}`);_.zLayers&&_.zLayers.length!==0||!A.length||(_.zLayers=A);for(let f of A)u(m,f)}return{obstacleIndexByLayer:d,layerNames:c,zIndexByName:l}})({srj:{bounds:e.bounds,obstacles:e.obstacles,connections:e.connections,outline:e.outline?.outline,layerCount:e.layerCount,minTraceWidth:e.minTraceWidth},boardVoidRects:e.boardVoidRects,obstacleClearance:e.obstacleClearance});this.obstacleIndexByLayer=t,this.layerNames=e.layerNames??n,this.zIndexByName=e.zIndexByName??o}pipelineDef=[Z0("rectDiffSeedingSolver",Apr,(e)=>[{simpleRouteJson:{bounds:e.inputProblem.bounds,obstacles:e.inputProblem.obstacles,connections:e.inputProblem.connections,outline:e.inputProblem.outline?.outline,layerCount:e.inputProblem.layerCount,minTraceWidth:e.inputProblem.minTraceWidth},gridOptions:e.inputProblem.gridOptions,obstacleIndexByLayer:e.obstacleIndexByLayer,boardVoidRects:e.inputProblem.boardVoidRects,layerNames:e.layerNames,zIndexByName:e.zIndexByName,obstacleClearance:e.inputProblem.obstacleClearance}]),Z0("rectDiffExpansionSolver",ypr,(e)=>{let t=e.rectDiffSeedingSolver?.getOutput();if(!t)throw Error("RectDiffSeedingSolver did not produce output");return[{layerNames:t.layerNames??[],boardVoidRects:e.inputProblem.boardVoidRects??[],layerCount:e.inputProblem.layerCount,bounds:t.bounds,candidates:t.candidates,consumedSeedsThisGrid:t.placed.length,totalSeedsThisGrid:t.candidates.length,placed:t.placed,edgeAnalysisDone:t.edgeAnalysisDone,gridIndex:t.gridIndex,expansionIndex:t.expansionIndex,obstacleIndexByLayer:e.obstacleIndexByLayer,options:t.options,zIndexByName:e.zIndexByName,layerNamesCanonical:e.layerNames,obstacles:e.inputProblem.obstacles,obstacleClearance:e.inputProblem.obstacleClearance}]})];getConstructorParams(){return[this.inputProblem]}getOutput(){if(this.rectDiffExpansionSolver)return this.rectDiffExpansionSolver.getOutput();if(this.rectDiffSeedingSolver)return{meshNodes:this.rectDiffSeedingSolver.getOutput().placed.map((e,t)=>({capacityMeshNodeId:`grid-${t}`,center:{x:e.rect.x+e.rect.width/2,y:e.rect.y+e.rect.height/2},width:e.rect.width,height:e.rect.height,availableZ:e.zLayers,layer:`z${e.zLayers.join(",")}`}))};return{meshNodes:[]}}visualize(){return this.rectDiffExpansionSolver?this.rectDiffExpansionSolver.visualize():this.rectDiffSeedingSolver?this.rectDiffSeedingSolver.visualize():{title:"RectDiff Grid Pipeline",coordinateSystem:"cartesian",rects:[],points:[],lines:[]}}},RLt=(e)=>{let{srj:t,clearance:n}=e,o=n??0;if(o<=0)return{title:"Obstacle Clearance",coordinateSystem:"cartesian",rects:[]};let r=[];for(let i of t.obstacles??[]){if(i.type!=="rect"&&i.type!=="oval")continue;let s={x:i.center.x-i.width/2-o,y:i.center.y-i.height/2-o,width:i.width+2*o,height:i.height+2*o};r.push({center:{x:s.x+s.width/2,y:s.y+s.height/2},width:s.width,height:s.height,stroke:"rgba(202, 138, 4, 0.9)",fill:"rgba(234, 179, 8, 0.15)",layer:"obstacle-clearance",label:`clearance
z:${(i.zLayers??[]).join(",")||"all"}`})}return{title:"Obstacle Clearance",coordinateSystem:"cartesian",rects:r}};function Cpr(e,t,n={}){if(!t||t.length<3)return[];let o=t.length>120,r=o?function(_,p){let m=(f)=>Math.round(f/p)*p,A=new Set,g=[];for(let f of _){let y=m(f.x),x=m(f.y),C=`${y},${x}`;A.has(C)||(A.add(C),g.push({x:y,y:x}))}return g}(t,Math.max(e.width,e.height)/120):t,i=new Set([e.x,e.x+e.width]),s=new Set([e.y,e.y+e.height]);for(let _ of r)i.add(_.x),s.add(_.y);(function({polygon:_,xs:p,ys:m,minGridSize:A}){let g=[],f=0;for(let x=0;x<_.length;x++){let C=_[x],b=_[(x+1)%_.length],I=Math.abs(b.x-C.x),v=Math.abs(b.y-C.y);if(I<=hr||v<=hr)continue;let P=Math.max(I,v);g.push({start:C,end:b,span:P}),f+=P}if(g.length===0)return;let y=Math.max(A,f/256);for(let{start:x,end:C,span:b}of g){let I=Math.max(1,Math.ceil(b/y));for(let v=1;v<I;v++){let P=v/I;p.add(x.x+(C.x-x.x)*P),m.add(x.y+(C.y-x.y)*P)}}})({polygon:r,xs:i,ys:s,minGridSize:Math.max(hr,n.minGridSize??Math.max(e.width,e.height)/256)});let a=Array.from(i).sort((_,p)=>_-p),c=Array.from(s).sort((_,p)=>_-p),l=[];for(let _=0;_<a.length-1;_++)for(let p=0;p<c.length-1;p++){let m=a[_],A=a[_+1],g=c[p],f=c[p+1],y=(m+A)/2,x=(g+f)/2;if(y>=e.x&&y<=e.x+e.width&&x>=e.y&&x<=e.y+e.height)(o?[{x:y,y:x}]:[{x:y,y:x},{x:m,y:g},{x:A,y:g},{x:m,y:f},{x:A,y:f}]).every((C)=>Fce(C,t))||l.push({x:m,y:g,width:A-m,height:f-g})}let h=[];l.sort((_,p)=>Math.abs(_.y-p.y)>hr?_.y-p.y:_.x-p.x);let d=null;for(let _ of l){if(!d){d=_;continue}let p=Math.abs(d.y-_.y)<hr,m=Math.abs(d.height-_.height)<hr,A=Math.abs(d.x+d.width-_.x)<hr;p&&m&&A?d.width+=_.width:(h.push(d),d=_)}d&&h.push(d),h.sort((_,p)=>Math.abs(_.x-p.x)>hr?_.x-p.x:_.y-p.y);let u=[];d=null;for(let _ of h){if(!d){d=_;continue}let p=Math.abs(d.x-_.x)<hr,m=Math.abs(d.width-_.width)<hr,A=Math.abs(d.y+d.height-_.y)<hr;p&&m&&A?d.height+=_.height:(u.push(d),d=_)}return d&&u.push(d),u}var Qq=class extends rP{rectDiffGridSolverPipeline;gapFillSolver;outerLayerContainmentMergeSolver;boardVoidRects;zIndexByName;layerNames;pipelineDef=[Z0("rectDiffGridSolverPipeline",xpr,(e)=>[{bounds:e.inputProblem.simpleRouteJson.bounds,obstacles:e.inputProblem.simpleRouteJson.obstacles,connections:e.inputProblem.simpleRouteJson.connections,outline:e.inputProblem.simpleRouteJson.outline?{outline:e.inputProblem.simpleRouteJson.outline}:void 0,layerCount:e.inputProblem.simpleRouteJson.layerCount,gridOptions:e.inputProblem.gridOptions,boardVoidRects:e.boardVoidRects,layerNames:e.layerNames,zIndexByName:e.zIndexByName,minTraceWidth:e.inputProblem.simpleRouteJson.minTraceWidth,obstacleClearance:e.inputProblem.obstacleClearance}]),Z0("gapFillSolver",Z0r,(e)=>[{meshNodes:e.rectDiffGridSolverPipeline?.getOutput().meshNodes??[],bounds:e.inputProblem.simpleRouteJson.bounds,boardVoid:{boardVoidRects:e.boardVoidRects||[],layerCount:e.inputProblem.simpleRouteJson.layerCount||0},maxGapFillPasses:e.inputProblem.maxGapFillPasses}]),Z0("outerLayerContainmentMergeSolver",tpr,(e)=>[{meshNodes:e.gapFillSolver?.getOutput().outputNodes??e.rectDiffGridSolverPipeline?.getOutput().meshNodes??[],simpleRouteJson:e.inputProblem.simpleRouteJson,zIndexByName:e.zIndexByName??new Map,obstacleClearance:e.inputProblem.obstacleClearance}])];_setup(){let{zIndexByName:e,layerNames:t}=K$e({obstacles:this.inputProblem.simpleRouteJson.obstacles,layerCount:this.inputProblem.simpleRouteJson.layerCount});if(this.zIndexByName=e,this.layerNames=t,this.inputProblem.simpleRouteJson.outline){let n=Math.max(0,this.inputProblem.simpleRouteJson.minBoardEdgeClearance??0);this.boardVoidRects=Cpr({x:this.inputProblem.simpleRouteJson.bounds.minX-n,y:this.inputProblem.simpleRouteJson.bounds.minY-n,width:this.inputProblem.simpleRouteJson.bounds.maxX-this.inputProblem.simpleRouteJson.bounds.minX+2*n,height:this.inputProblem.simpleRouteJson.bounds.maxY-this.inputProblem.simpleRouteJson.bounds.minY+2*n},this.inputProblem.simpleRouteJson.outline??[],{minGridSize:this.inputProblem.simpleRouteJson.minTraceWidth}).map((o)=>J$e(o,n))}}getConstructorParams(){return[this.inputProblem]}getOutput(){let e=this.outerLayerContainmentMergeSolver?.getOutput();if(e)return{meshNodes:e.outputNodes};let t=this.gapFillSolver?.getOutput();return t?{meshNodes:t.outputNodes}:this.rectDiffGridSolverPipeline?this.rectDiffGridSolverPipeline.getOutput():{meshNodes:[]}}initialVisualize(){let e=function(o,r="RectDiff"){let i=[],s=[],a=o.bounds.minX,c=o.bounds.maxX,l=o.bounds.minY,h=o.bounds.maxY;o.outline&&o.outline.length>1?s.push({points:[...o.outline,o.outline[0]],strokeColor:"#111827",strokeWidth:0.01,label:"outline"}):i.push({center:{x:(a+c)/2,y:(l+h)/2},width:c-a,height:h-l,fill:"none",stroke:"#111827",label:"board"});for(let d of o.obstacles??[])if(d.type==="rect"||d.type==="oval"){let u=(d.zLayers??[]).join(",")||"all";i.push({center:{x:d.center.x,y:d.center.y},width:d.width,height:d.height,fill:"#fee2e2",stroke:"#ef4444",layer:"obstacle",label:`obstacle
z:${u}`})}return{title:r,coordinateSystem:"cartesian",rects:i,points:[],lines:s}}(this.inputProblem.simpleRouteJson,"RectDiffPipeline - Initial"),t=RLt({srj:this.inputProblem.simpleRouteJson,clearance:this.inputProblem.obstacleClearance}),n={title:"Initial Nodes",coordinateSystem:"cartesian",rects:(this.rectDiffGridSolverPipeline?.getOutput().meshNodes??[]).map((o)=>({center:o.center,width:o.width,height:o.height,stroke:"rgba(0, 0, 0, 0.3)",fill:"rgba(100, 100, 100, 0.1)",layer:`z${o.availableZ.join(",")}`,label:[`node ${o.capacityMeshNodeId}`,`z:${o.availableZ.join(",")}`].join(`
`)}))};return pV(pV(e,t),n)}finalVisualize(){return(({srj:e,meshNodes:t,obstacleClearance:n})=>{let o=(({srj:s})=>({title:"SimpleRoute Outline",coordinateSystem:"cartesian",lines:s.outline&&s.outline.length>1?[{points:[...s.outline,s.outline[0]],strokeColor:"#111827",strokeWidth:0.1,label:"outline"}]:[{points:[{x:s.bounds.minX,y:s.bounds.minY},{x:s.bounds.maxX,y:s.bounds.minY},{x:s.bounds.maxX,y:s.bounds.maxY},{x:s.bounds.minX,y:s.bounds.maxY},{x:s.bounds.minX,y:s.bounds.minY}],strokeColor:"#111827",strokeWidth:0.1,label:"bounds"}]}))({srj:e}),r=RLt({srj:e,clearance:n}),i=t.map((s)=>({center:s.center,width:s.width,height:s.height,stroke:oCe(s.availableZ).stroke,fill:s._containsObstacle?"#fca5a5":oCe(s.availableZ).fill,layer:`z${s.availableZ.join(",")}`,label:`node ${s.capacityMeshNodeId}
z:${s.availableZ.join(",")}`}));return pV(pV({title:"RectDiffPipeline - Final",coordinateSystem:"cartesian",rects:i,lines:[],points:[],texts:[]},o),r)})({srj:this.inputProblem.simpleRouteJson,meshNodes:this.getOutput().meshNodes,obstacleClearance:this.inputProblem.obstacleClearance})}},bpr=class{cacheHitsByPrefix={};cacheMissesByPrefix={};isSyncCache=!0;cacheHits=0;cacheMisses=0;cache=new Map;getCachedSolutionSync(e){let t=this.cache.get(e);if(t!==void 0){this.cacheHits++;let n=e.split(":")[0];return this.cacheHitsByPrefix[n]=(this.cacheHitsByPrefix[n]||0)+1,structuredClone(t)}{this.cacheMisses++;let n=e.split(":")[0];return void(this.cacheMissesByPrefix[n]=(this.cacheMissesByPrefix[n]||0)+1)}}async getCachedSolution(e){return this.getCachedSolutionSync(e)}setCachedSolutionSync(e,t){this.cache.set(e,structuredClone(t))}async setCachedSolution(e,t){this.setCachedSolutionSync(e,t)}clearCache(){this.cache.clear(),this.cacheHits=0,this.cacheMisses=0,this.cacheHitsByPrefix={},this.cacheMissesByPrefix={}}getAllCacheKeys(){return Array.from(this.cache.keys())}},NWe="tscircuit_autorouter_cache_",Ipr=class{isSyncCache=!0;cacheHits=0;cacheMisses=0;cacheHitsByPrefix={};cacheMissesByPrefix={};constructor(){}getKey(e){return`${NWe}${e}`}getCachedSolutionSync(e){if(typeof localStorage>"u")return;let t=this.getKey(e);try{let n=localStorage.getItem(t);if(n!==null){let o=JSON.parse(n);this.cacheHits++;let r=e.split(":")[0];return this.cacheHitsByPrefix[r]=(this.cacheHitsByPrefix[r]||0)+1,o}{this.cacheMisses++;let o=e.split(":")[0];return void(this.cacheMissesByPrefix[o]=(this.cacheMissesByPrefix[o]||0)+1)}}catch(n){console.error(`Error getting cached solution sync for ${t}:`,n),this.cacheMisses++;let o=e.split(":")[0];return void(this.cacheMissesByPrefix[o]=(this.cacheMissesByPrefix[o]||0)+1)}}async getCachedSolution(e){return this.getCachedSolutionSync(e)}setCachedSolutionSync(e,t){if(typeof localStorage>"u")return;let n=this.getKey(e);try{let o=JSON.stringify(t);localStorage.setItem(n,o)}catch(o){console.error(`Error setting cached solution sync for ${n}:`,o),o instanceof DOMException&&(o.name==="QuotaExceededError"||o.name==="NS_ERROR_DOM_QUOTA_REACHED")&&console.warn(`LocalStorage quota exceeded. Failed to cache solution for ${n}. Consider clearing the cache.`)}}async setCachedSolution(e,t){this.setCachedSolutionSync(e,t)}clearCache(){if(typeof localStorage<"u")try{let e=[];for(let t=0;t<localStorage.length;t++){let n=localStorage.key(t);n?.startsWith(NWe)&&e.push(n)}e.forEach((t)=>localStorage.removeItem(t)),console.log(`Cleared ${e.length} items from LocalStorage cache.`)}catch(e){console.error("Error clearing LocalStorage cache:",e)}finally{this.cacheHits=0,this.cacheMisses=0,this.cacheHitsByPrefix={},this.cacheMissesByPrefix={}}}getAllCacheKeys(){let e=[];for(let t=0;t<1e4;t++){let n=localStorage.key(t);if(!n)break;n.includes(NWe)&&e.push(n)}return e}};function vpr(){return globalThis.TSCIRCUIT_AUTOROUTER_LOCAL_STORAGE_CACHE||_be(),globalThis.TSCIRCUIT_AUTOROUTER_LOCAL_STORAGE_CACHE}function hv(){return globalThis.TSCIRCUIT_AUTOROUTER_IN_MEMORY_CACHE||_be(),globalThis.TSCIRCUIT_AUTOROUTER_IN_MEMORY_CACHE}function _be(){globalThis.TSCIRCUIT_AUTOROUTER_LOCAL_STORAGE_CACHE??=new Ipr,globalThis.TSCIRCUIT_AUTOROUTER_IN_MEMORY_CACHE??=new bpr}function zce(e){let t={minX:e.center.x-e.width/2,maxX:e.center.x+e.width/2,minY:e.center.y-e.height/2,maxY:e.center.y+e.height/2};for(let n of e.portPoints)n.x<t.minX&&(t.minX=n.x),n.x>t.maxX&&(t.maxX=n.x),n.y<t.minY&&(t.minY=n.y),n.y>t.maxY&&(t.maxY=n.y);return t}var BUt=(e,t)=>e<=t?[e,t]:[t,e],Fje=(e)=>`${e[0]}|${e[1]}`,Spr=({portPointId:e,currentNodeId:t,inputNodes:n,connectionNodeIdsByPortPointId:o})=>{let r=e?o?.get(e):void 0;if(e&&!o)for(let a of n){let c=a.portPoints.find((l)=>l.portPointId===e);if(c?.connectionNodeIds){r=c.connectionNodeIds;break}}if(!r||r.length!==2)return[t,t];let[i,s]=r;return i&&s?BUt(i,s):[t,t]},zje=0.000001,lQ=(e,t)=>Math.abs(e-t)<=zje,Ppr=({nodeAId:e,nodeBId:t,nodeBounds:n})=>{if(e===t)return null;let o=n.get(e),r=n.get(t);if(!o||!r)return null;let i=BUt(e,t),s=Fje(i);if(lQ(o.maxX,r.minX)||lQ(r.maxX,o.minX)){let a=Math.max(o.minY,r.minY),c=Math.min(o.maxY,r.maxY),l=c-a;if(l>zje){let h=lQ(o.maxX,r.minX)?o.maxX:o.minX;return{ownerNodeIds:i,ownerPairKey:s,orientation:"vertical",x1:h,y1:a,x2:h,y2:c,center:{x:h,y:(a+c)/2},length:l,nodeSideByOwnerId:lQ(o.maxX,r.minX)?{[e]:"right",[t]:"left"}:{[e]:"left",[t]:"right"}}}}if(lQ(o.maxY,r.minY)||lQ(r.maxY,o.minY)){let a=Math.max(o.minX,r.minX),c=Math.min(o.maxX,r.maxX),l=c-a;if(l>zje){let h=lQ(o.maxY,r.minY)?o.maxY:o.minY;return{ownerNodeIds:i,ownerPairKey:s,orientation:"horizontal",x1:a,y1:h,x2:c,y2:h,center:{x:(a+c)/2,y:h},length:l,nodeSideByOwnerId:lQ(o.maxY,r.minY)?{[e]:"top",[t]:"bottom"}:{[e]:"bottom",[t]:"top"}}}}return null},Epr=({portPoint:e,ownerNodeIds:t,inputNodes:n})=>{for(let o of t){let r=n.find((s)=>s.capacityMeshNodeId===o);if(r?._containsTarget)return!0;if(r?.portPoints.find((s)=>s.portPointId===e.portPointId)?.connectionNodeIds?.some((s)=>n.find((a)=>a.capacityMeshNodeId===s)?._containsTarget))return!0}return!1},si=(e,t)=>e==="top"?0:e==="bottom"?t-1:parseInt(e.slice(5));function wle(e,t){return[...new Set(e)].filter((n)=>Number.isInteger(n)&&n>=0&&n<t).sort((n,o)=>n-o)}function Ble(e,t){return wle(e.map((n)=>si(n,t)),t)}var VK=0.000001,QLt=({sharedEdge:e,obstacles:t,z:n,layerCount:o})=>{for(let r of t){let i=r.zLayers??(o===void 0?void 0:r.layers.map((h)=>si(h,o)));if(n!==void 0&&i&&!i.includes(n))continue;let s=r.center.x-r.width/2,a=r.center.x+r.width/2,c=r.center.y-r.height/2,l=r.center.y+r.height/2;if(e.orientation!=="vertical"){if(Math.abs(e.y1-c)<VK||Math.abs(e.y1-l)<VK){let h=Math.max(e.x1,s);if(Math.min(e.x2,a)-h>VK)return!0}}else if(Math.abs(e.x1-s)<VK||Math.abs(e.x1-a)<VK){let h=Math.max(e.y1,c);if(Math.min(e.y2,l)-h>VK)return!0}}return!1},Tle=class extends Da{constructor(e){super(),this.input=e;for(let o of e.nodeWithPortPoints)this.mapOfNodeIdToBounds.set(o.capacityMeshNodeId,e.useLayerAwareGeometry?{minX:o.center.x-o.width/2,maxX:o.center.x+o.width/2,minY:o.center.y-o.height/2,maxY:o.center.y+o.height/2}:zce(o));let t=new Map,n=((o)=>{let r=new Map;for(let i of o){let s=new Set;for(let a of i.portPoints){let c=a.portPointId;c&&!s.has(c)&&(s.add(c),!r.has(c)&&a.connectionNodeIds&&r.set(c,a.connectionNodeIds))}}return r})(e.inputNodesWithPortPoints);for(let o of e.nodeWithPortPoints)for(let r of o.portPoints){if(!r.portPointId)continue;let i=Spr({portPointId:r.portPointId,currentNodeId:o.capacityMeshNodeId,inputNodes:e.inputNodesWithPortPoints,connectionNodeIdsByPortPointId:n}),s=Fje(i),a=this.mapOfOwnerPairToPortPoints.get(s)??[];a.some((c)=>c.portPointId&&c.portPointId===r.portPointId)||a.push({...r,ownerNodeIds:i,ownerPairKey:s}),this.mapOfOwnerPairToPortPoints.set(s,a),t.set(s,i)}this.mapOfOwnerPairToSharedEdge=(({ownerPairs:o,nodeBounds:r})=>{let i=new Map;for(let s of o){let[a,c]=s;if(a===c)continue;let l=Ppr({nodeAId:a,nodeBId:c,nodeBounds:r});l&&i.set(Fje(s),l)}return i})({ownerPairs:Array.from(t.values()),nodeBounds:this.mapOfNodeIdToBounds}),this.ownerPairsToProcess=Array.from(this.mapOfOwnerPairToSharedEdge.keys()),this.ownerPairsToProcess.sort((o,r)=>{let i=this.mapOfOwnerPairToSharedEdge.get(o),s=this.mapOfOwnerPairToSharedEdge.get(r);return i.center.x-s.center.x||i.center.y-s.center.y})}input;getSolverName(){return"UniformPortDistributionSolver"}mapOfNodeIdToBounds=new Map;mapOfOwnerPairToPortPoints=new Map;mapOfOwnerPairToSharedEdge=new Map;ownerPairsToProcess=[];currentOwnerPairBeingProcessed=null;redistributedNodes=[];step(){if(this.ownerPairsToProcess.length===0)return this.rebuildNodes(),void(this.solved=!0);this.currentOwnerPairBeingProcessed=this.ownerPairsToProcess.shift();let e=this.currentOwnerPairBeingProcessed,t=this.mapOfOwnerPairToSharedEdge.get(e);if(!t)return;let n=this.mapOfOwnerPairToPortPoints.get(e)??[],o=QLt({sharedEdge:t,obstacles:this.input.obstacles});if(!this.input.useLayerAwareGeometry&&o)return;let r=new Map;for(let a of n)r.set(a.z,(r.get(a.z)??0)+1);let i=[];for(let a of n)this.input.preserveSolitaryPorts&&o&&r.get(a.z)===1||QLt({sharedEdge:t,obstacles:this.input.obstacles,z:this.input.useLayerAwareGeometry?a.z:void 0,layerCount:this.input.layerCount})||Epr({portPoint:a,ownerNodeIds:a.ownerNodeIds,inputNodes:this.input.inputNodesWithPortPoints})||i.push(a);let s=(({sharedEdge:a,portPoints:c})=>{if(c.length===0)return[];let l=new Map;for(let u of c){let _=u.z??0,p=l.get(_)??[];p.push(u),l.set(_,p)}let h=[],d=Array.from(l.keys()).sort((u,_)=>u-_);for(let u of d){let _=l.get(u),p=_.length;_.sort((m,A)=>a.orientation==="horizontal"?m.x-A.x:m.y-A.y);for(let m=0;m<p;m++){let A=(2*m+1)/(2*p),g=a.orientation==="horizontal"?a.x1+a.length*A:a.x1,f=a.orientation==="horizontal"?a.y1:a.y1+a.length*A;h.push({..._[m],x:g,y:f})}}return h})({sharedEdge:t,portPoints:i});this.mapOfOwnerPairToPortPoints.set(e,s)}rebuildNodes(){let e=new Map;for(let n of this.mapOfOwnerPairToPortPoints.values())for(let o of n)o.portPointId&&e.set(o.portPointId,{x:o.x,y:o.y});let t=(n)=>{if(n.portPointId&&e.has(n.portPointId)){let o=e.get(n.portPointId);return{...n,x:o.x,y:o.y}}return n};this.redistributedNodes=this.input.nodeWithPortPoints.map((n)=>({...n,portPoints:n.portPoints.map(t),portPointsInPairs:n.portPointsInPairs?.map(([o,r])=>[t(o),t(r)])}))}getOutput=()=>this.redistributedNodes;visualize(){return(({obstacles:e,nodeWithPortPoints:t,mapOfOwnerPairToPortPoints:n,mapOfOwnerPairToSharedEdge:o,ownerPairsToProcess:r,currentOwnerPairBeingProcessed:i,mapOfNodeIdToBounds:s})=>{let a=e.filter((p)=>!p.isCopperPour).map((p)=>({...p,fill:"#ec000070"})),c=[],l=[],h=new Map,d=new Map,u=new Map,_=(p)=>p.portPointId?h.get(p.portPointId)??{x:p.x,y:p.y}:{x:p.x,y:p.y};for(let p of t)for(let m of p.portPoints)m.portPointId&&(h.set(m.portPointId,{x:m.x,y:m.y}),d.set(m.portPointId,m.z??0));for(let p of n.values())for(let m of p)m.portPointId&&(h.set(m.portPointId,{x:m.x,y:m.y}),d.set(m.portPointId,m.z??0),u.set(m.portPointId,`${m.ownerNodeIds[0]}&${m.ownerNodeIds[1]}`));t.forEach((p)=>{let m=s.get(p.capacityMeshNodeId);if(m){let A=(m.minX+m.maxX)/2,g=(m.minY+m.maxY)/2,f=m.maxX-m.minX,y=m.maxY-m.minY;a.push({center:{x:A,y:g},width:f,height:y,fill:"#00000030",label:`${p.capacityMeshNodeId}`})}p.portPoints.forEach((A)=>{if(!A.portPointId)return;let g=h.get(A.portPointId),f=d.get(A.portPointId)??0,y=u.get(A.portPointId)??`${p.capacityMeshNodeId}&${p.capacityMeshNodeId}`;c.push({x:g.x,y:g.y,label:`z:${f}
o:${y}`}),p.portPointsInPairs?.length||p.portPoints.forEach((x)=>{if(x.portPointId&&A!==x&&A.connectionName===x.connectionName){let C=h.get(x.portPointId);l.push({points:[g,C],strokeColor:"#fff822c9"})}})}),p.portPointsInPairs?.forEach(([A,g])=>{l.push({points:[_(A),_(g)],strokeColor:"#fff822c9"})})});for(let p of r){let m=o.get(p);m&&l.push({points:[{x:m.x1,y:m.y1},{x:m.x2,y:m.y2}],strokeColor:"orange",strokeWidth:0.01})}if(i){let p=o.get(i);p&&(l.push({points:[{x:p.x1,y:p.y1},{x:p.x2,y:p.y2}],strokeColor:"red",strokeWidth:0.03}),c.push({x:p.center.x,y:p.center.y,label:p.ownerPairKey}))}for(let p of o.values())l.push({points:[{x:p.x1,y:p.y1},{x:p.x2,y:p.y2}],strokeColor:"#33b5ff80",strokeWidth:0.006});return{rects:a,lines:l,points:c}})({obstacles:this.input.obstacles,nodeWithPortPoints:this.input.nodeWithPortPoints,mapOfOwnerPairToPortPoints:this.mapOfOwnerPairToPortPoints,mapOfOwnerPairToSharedEdge:this.mapOfOwnerPairToSharedEdge,ownerPairsToProcess:this.ownerPairsToProcess,currentOwnerPairBeingProcessed:this.currentOwnerPairBeingProcessed,mapOfNodeIdToBounds:this.mapOfNodeIdToBounds})}},_B=(e,t,n)=>e.connectedTo.some((o)=>o===t.connectionName||o===t.rootConnectionName||(n?.areIdsConnected(t.connectionName,o)??!1)||t.rootConnectionName!==void 0&&(n?.areIdsConnected(t.rootConnectionName,o)??!1));function mV(e){return!("layers"in e)&&typeof e.layer=="string"}function l2(e){return E5(e)[0]}function E5(e){if(function(t){return!("layer"in t)&&Array.isArray(t.layers)}(e))return e.layers;if(mV(e))return[e.layer];throw Error("Connection point must specify either layer or layers, never both")}var nd=(e,t)=>{if(e===1&&t===1)return"inner1";if(e<0||e>=t)throw Error(`Invalid z "${e}" for layer count: ${t}`);return e===0?"top":e===t-1?"bottom":`inner${e}`},RWe=(e,t)=>!!e&&!!t&&Math.abs(e.x-t.x)<=0.000000000001&&Math.abs(e.y-t.y)<=0.000000000001,_4e=(e,t)=>iP(e,t)<=0.000001,Mpr=(e,t,n,o)=>t.toNextSegmentType==="through_obstacle"||(o.connectedMultilayerObstacles?o.connectedMultilayerObstacles.some((r)=>_4e(t,r)&&_4e(n,r)):o.obstacles?.some((r)=>((i)=>(i.__zLayers?.length??i.layers?.length??0)>1)(r)&&_4e(t,r)&&_4e(n,r)&&_B(r,e,o.connMap))??!1),kLt=({endpoint:e,endpointLayer:t,connectionPoints:n,tolerance:o})=>{let r;for(let i of n){if(!mV(i)||!i.terminalVia)continue;if(i.layer!==t)continue;let s=kn(i,e);s>o||(!r||s<r.distance)&&(r={point:i,distance:s})}return r?.point},k3=(e,t,n={})=>{let o=[];if(e.route.length===0)return o;let r=[],i=e.route[0].z;for(let a=0;a<e.route.length;a++){let c=e.route[a];if(c.z!==i){let l=r[r.length-1],h=nd(i,t);for(let u of r)o.push({route_type:"wire",x:u.x,y:u.y,width:u.traceThickness??e.traceThickness,layer:h});let d=nd(c.z,t);if(l&&Mpr(e,l,c,n))o.push({route_type:"through_obstacle",start:{x:l.x,y:l.y},end:{x:c.x,y:c.y},from_layer:h,to_layer:d,width:l.traceThickness??e.traceThickness,...l.toNextSegmentCircuitJsonMetadata?{circuitJsonMetadata:l.toNextSegmentCircuitJsonMetadata}:{}});else e.vias.some((u)=>Math.abs(u.x-c.x)<0.001&&Math.abs(u.y-c.y)<0.001)&&o.push({route_type:"via",x:c.x,y:c.y,from_layer:h,to_layer:d,via_diameter:e.viaDiameter,...n.defaultViaHoleDiameter!==void 0?{via_hole_diameter:n.defaultViaHoleDiameter}:{}});r=[c],i=c.z}else RWe(r[r.length-1],c)||r.push(c)}let s=nd(i,t);for(let a of r)o.push({route_type:"wire",x:a.x,y:a.y,width:a.traceThickness??e.traceThickness,layer:s});if(e.jumpers&&e.jumpers.length>0){let a=nd(e.route[0]?.z??0,t);for(let c of e.jumpers)o.push({route_type:"jumper",start:c.start,end:c.end,footprint:c.footprint,layer:a})}return(({route:a,hdRoute:c,layerCount:l,connectionPoints:h=[],tolerance:d=0.25,defaultViaHoleDiameter:u})=>{if(a.length===0||c.route.length===0||!h.length)return a;if(!h.some((B)=>mV(B)&&B.terminalVia))return a;let _=a.filter((B)=>B.route_type!=="jumper"),p=a.filter((B)=>B.route_type==="jumper");if(_.length===0)return a;let m=c.route[0],A=c.route[c.route.length-1],g=nd(m.z,l),f=nd(A.z,l),y=kLt({endpoint:m,endpointLayer:g,connectionPoints:h,tolerance:d}),x=kLt({endpoint:A,endpointLayer:f,connectionPoints:h,tolerance:d}),C=[],b=[],I=_[0],v=_[_.length-1],P=m.traceThickness??c.traceThickness,M=A.traceThickness??c.traceThickness;return y?.terminalVia&&(C.push({route_type:"via",x:y.x,y:y.y,from_layer:y.layer,to_layer:y.terminalVia.toLayer,via_diameter:y.terminalVia.viaDiameter??c.viaDiameter,...u!==void 0?{via_hole_diameter:u}:{}}),I?.route_type==="wire"&&I.layer===y.layer&&RWe(I,y)||C.push({route_type:"wire",x:y.x,y:y.y,width:P,layer:y.layer})),x?.terminalVia&&(v?.route_type==="wire"&&v.layer===x.layer&&RWe(v,x)||b.push({route_type:"wire",x:x.x,y:x.y,width:M,layer:x.layer}),b.push({route_type:"via",x:x.x,y:x.y,from_layer:x.layer,to_layer:x.terminalVia.toLayer,via_diameter:x.terminalVia.viaDiameter??c.viaDiameter,...u!==void 0?{via_hole_diameter:u}:{}})),[...C,..._,...b,...p]})({route:o,hdRoute:e,layerCount:t,connectionPoints:n.connectionPoints,tolerance:n.terminalViaAttachTolerance,defaultViaHoleDiameter:n.defaultViaHoleDiameter})},LLt=["blue","orange","purple","cyan","magenta","yellowgreen","darkgoldenrod","deeppink"],JA=(e,t)=>{let n={};for(let o=0;o<e.connections.length;o++){let r=e.connections[o],i=t?.getNetConnectedToId(r.name);i&&!n[i]&&(n[i]=`hsl(${300*o/e.connections.length}, 100%, 50%)`),n[r.name]=(i?n[i]:null)??`hsl(${340*o/e.connections.length}, 100%, 50%)`}return n},zi=(e,t)=>{try{return A$(t,e)}catch(n){return console.error(n),e}},Oce=(e,t=1)=>{if(!e)return"rgba(0, 0, 0, 0.5)";let n=300*e.split("").reduce((o,r)=>o+r.charCodeAt(0),0)/e.length%360;return t<1?`hsla(${n}, 100%, 50%, ${t})`:`hsl(${n}, 100%, 50%)`},HLt=(e)=>{let t=new Set;return e.filter((n)=>!t.has(n)&&(t.add(n),!0))},Cae=(e,t,n)=>{if(!t)return;let o=e.get(t);o?o.includes(n)||o.push(n):e.set(t,[n])},bB=(e)=>{let t=new Map;for(let n of e.connections){let o=n.__rootConnectionNames??[n.name];for(let r of o){Cae(t,n.name,r),Cae(t,r,r),Cae(t,n.__netConnectionName,r);for(let i of n.pointsToConnect)Cae(t,i.pointId,r),Cae(t,i.pcb_port_id,r)}}return(n)=>((o,r=[])=>{let i=HLt(r).join(", ");return o.layers.map((s)=>i?`${s}
${i}`:s).join(`
`)})(n,((o,r)=>HLt([...o.connectedTo.flatMap((i)=>r.get(i)??[]),...(o.offBoardConnectsTo??[]).flatMap((i)=>r.get(i)??[])]))(n,t))},Kae=(e,t)=>`z${Ble(e,t).join(",")}`,IB=(e,t)=>Kae(E5(e),t),TUt=(e,t)=>e.__zLayers&&e.__zLayers.length>0?wle(e.__zLayers,t):Ble(e.layers,t),$S=(e,t)=>`z${TUt(e,t).join(",")}`,FLt=(...e)=>e.find((t)=>typeof t=="number"&&Number.isFinite(t)),rm=(e)=>{let t=FLt(e.min_via_hole_diameter,e.minViaHoleDiameter),n=FLt(e.min_via_pad_diameter,e.minViaPadDiameter,e.minViaDiameter),o=Math.max(n??e.minViaDiameter??0.3,t??0);return{padDiameter:o,holeDiameter:t??0.5*o}},QV={"0603":{length:1.65,width:0.95,padLength:0.8,padWidth:0.95},1206:{length:3.2,width:1.6,padLength:0.6,padWidth:1.6},"1206x4_pair":{length:2.7,width:0.5,padLength:0.8,padWidth:0.5}},zLt={top:"red",bottom:"blue",inner1:"green",inner2:"yellow",inner3:"orange",inner4:"purple",inner5:"cyan",inner6:"magenta",inner7:"lime",inner8:"brown"};function OLt(e){if(Object.hasOwn(zLt,e))return zLt[e];let t=/^inner([1-9]\d*)$/.exec(e);if(t)return`hsl(${137*Number(t[1])%360}, 70%, 45%)`;throw Error(`No visualization color for layer "${e}"`)}var rx=(e,t={})=>{let n=[],o=[],r=[],i=[],s=JA(e),a=t.traceColorMode??"layer",c=e.layerCount,l=rm(e),h=bB(e);if(e.connections)for(let d of e.connections)for(let u of d.pointsToConnect){let _=E5(u),p=d.__rootConnectionNames??[d.name];r.push({x:u.x,y:u.y,color:s[d.name],layer:IB(u,c),label:[d.name,p.join(", "),_.join(",")].join(`
`)})}if(e.traces)for(let d of e.traces){let u=e.minTraceWidth,_=d.route.filter((A)=>A.route_type==="jumper"),p=(A,g)=>{for(let y of _){let x=Math.abs(A.x-y.start.x)<0.01&&Math.abs(A.y-y.start.y)<0.01&&Math.abs(g.x-y.end.x)<0.01&&Math.abs(g.y-y.end.y)<0.01,C=Math.abs(A.x-y.end.x)<0.01&&Math.abs(A.y-y.end.y)<0.01&&Math.abs(g.x-y.start.x)<0.01&&Math.abs(g.y-y.start.y)<0.01;if(x||C)return!0}return!1};for(let A of d.route)if(A.route_type==="via"){let g=si(A.from_layer,c),f=si(A.to_layer,c),y=(A.via_diameter??l.padDiameter)/2,x=Array.from({length:Math.abs(f-g)+1},(C,b)=>Math.min(g,f)+b);o.push({center:{x:A.x,y:A.y},radius:y,fill:a==="net"?s[d.connection_name]:"blue",stroke:"none",layer:`z${x.join(",")}`})}else if(A.route_type==="through_obstacle"){let g=s[d.connection_name]??"purple";n.push({points:[A.start,A.end],strokeColor:zi(g,0.35),strokeWidth:A.width,strokeDash:[0.1,0.1],layer:Kae([A.from_layer,A.to_layer],c),label:`${d.connection_name} through_obstacle`})}let m;for(let A=0;A<d.route.length-1;A++){let g=d.route[A],f=d.route[A+1];if(g.route_type==="jumper"){m=void 0;let y=s[d.connection_name]??"rgba(255, 165, 0, 0.8)",x=g.footprint,C=QV[x==="1206x4_pair"?"1206x4_pair":"0603"]??QV["0603"],b=g.end.x-g.start.x,I=g.end.y-g.start.y,v=Math.abs(b)>Math.abs(I),P=v?C.padLength:C.padWidth,M=v?C.padWidth:C.padLength;i.push({center:g.start,width:P,height:M,fill:zi(y,0.5),stroke:"rgba(0, 0, 0, 0.5)",layer:Kae([g.layer],c)}),i.push({center:g.end,width:P,height:M,fill:zi(y,0.5),stroke:"rgba(0, 0, 0, 0.5)",layer:Kae([g.layer],c)}),n.push({points:[g.start,g.end],strokeColor:"rgba(100, 100, 100, 0.8)",strokeWidth:0.3*C.padWidth,layer:Kae([g.layer],c)})}else if(g.route_type==="wire"&&f.route_type==="wire"&&f.layer===g.layer){if(p({x:g.x,y:g.y},{x:f.x,y:f.y})){m=void 0;continue}u=g.width;let y=g.layer==="top",x=a==="net"?s[d.connection_name]:OLt(g.layer),C=`z${si(g.layer,c)}`;if(m&&m.layer===C&&m.strokeWidth===u){m.points.push({x:f.x,y:f.y});continue}m={points:[{x:g.x,y:g.y},{x:f.x,y:f.y}],layer:C,strokeWidth:u,strokeColor:y?x:zi(x,0.5),...a==="net"?{label:d.connection_name}:{},...y?{}:{strokeDash:[0.2,0.2]}},n.push(m)}else m=void 0}}for(let d of e.obstacles){if(d.isCopperPour)continue;let u=TUt(d,c);if(u.length===0)throw Error(`Cannot visualize obstacle "${d.obstacleId??"unknown"}" without a valid layer: layers=${d.layers.join(",")}, __zLayers=${d.__zLayers?.join(",")??"unset"}, layerCount=${c}`);let _=OLt((u.length===1?nd(u[0],c):null)==="bottom"?"bottom":"top"),p=0.5**u.length;i.push({center:d.center,width:d.width,height:d.height,ccwRotationDegrees:d.ccwRotationDegrees,fill:zi(_,p),layer:$S(d,c),label:h(d)})}if(e.jumpers)for(let d of e.jumpers)for(let u of d.pads)i.push({center:u.center,width:u.width,height:u.height,ccwRotationDegrees:u.ccwRotationDegrees,fill:"rgba(255, 165, 0, 0.3)",stroke:"rgba(255, 165, 0, 0.8)",layer:$S(u,c)});return{rects:i,circles:o,lines:n,points:r}};function wpr([e,t],[n,o],{lineThickness:r=0}={}){if(r===0)return VLt(e,t,n,o);return function(s,a,c,l){if(s.x===a.x&&s.y===a.y)return YK(s,c,l);if(c.x===l.x&&c.y===l.y)return YK(c,s,a);if(VLt(s,a,c,l))return 0;let h=[YK(s,c,l),YK(a,c,l),YK(c,s,a),YK(l,s,a)];return Math.min(...h)}(e,t,n,o)<=r}function VLt(e,t,n,o){let r=g4e(e,t,n),i=g4e(e,t,o),s=g4e(n,o,e),a=g4e(n,o,t);return r!==i&&s!==a||(!(r!==0||!A4e(e,n,t))||(!(i!==0||!A4e(e,o,t))||(!(s!==0||!A4e(n,e,o))||!(a!==0||!A4e(n,t,o)))))}function g4e(e,t,n){let o=(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y);return o===0?0:o>0?1:2}function A4e(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function YK(e,t,n){let o=(n.x-t.x)**2+(n.y-t.y)**2;if(o===0)return YLt(e,t);let r=((e.x-t.x)*(n.x-t.x)+(e.y-t.y)*(n.y-t.y))/o;return r=Math.max(0,Math.min(1,r)),YLt(e,{x:t.x+r*(n.x-t.x),y:t.y+r*(n.y-t.y)})}function YLt(e,t){let n=e.x-t.x,o=e.y-t.y;return Math.sqrt(n*n+o*o)}function Z$e(e){let t=new Map,n=0;function o(r){for(let[,s]of t)if(s.has(r))return s;let i=new Set;return t.set("connectivity_net"+n++,i),i}for(let r of e){let i=null;for(let s of r){if(i){if(!i.has(s)){let a=o(s);if(a!==i){for(let c of a)i.add(c);t.delete(Array.from(t.entries()).find(([,c])=>c===a)[0])}}}else i=o(s);i.add(s)}}return Object.fromEntries(Array.from(t.entries()).map(([r,i])=>[r,Array.from(i)]))}var kV=class{netMap;idToNetMap;constructor(e){this.netMap=e,this.idToNetMap={};for(let[t,n]of Object.entries(e))for(let o of n)this.idToNetMap[o]=t}addConnections(e){for(let t of e){let n=new Set;for(let r of t){let i=this.idToNetMap[r];i&&n.add(i)}let o;if(n.size===0)o=`connectivity_net${Object.keys(this.netMap).length}`,this.netMap[o]=[];else if(n.size===1)o=n.values().next().value??`connectivity_net${Object.keys(this.netMap).length}`;else{o=n.values().next().value??`connectivity_net${Object.keys(this.netMap).length}`;for(let r of n)if(r!==o){this.netMap[o].push(...this.netMap[r]),this.netMap[r]=this.netMap[o];for(let i of this.netMap[o])this.idToNetMap[i]=o}}for(let r of t)this.netMap[o].includes(r)||this.netMap[o].push(r),this.idToNetMap[r]=o}}getIdsConnectedToNet(e){return this.netMap[e]||[]}getNetConnectedToId(e){return this.idToNetMap[e]}areIdsConnected(e,t){if(e===t)return!0;let n=this.getNetConnectedToId(e);if(!n)return!1;let o=this.getNetConnectedToId(t);return!!o&&(n===o||o===e||o===e)}areAllIdsConnected(e){let t=this.getNetConnectedToId(e[0]);for(let n of e){let o=this.getNetConnectedToId(n);if(o===void 0)return!1;if(o!==t)return!1}return!0}},eY=(e)=>{let t=[];for(let o of e)if(o.type==="source_trace")t.push([o.source_trace_id,...o.connected_source_port_ids??[],...o.connected_source_net_ids??[]].filter(Boolean));else if(o.type==="pcb_port"){let{pcb_port_id:r,source_port_id:i}=o;i&&r&&t.push([i,r])}else if(o.type==="pcb_smtpad"){let{pcb_smtpad_id:r,pcb_port_id:i}=o;i&&r&&t.push([r,i])}else if(o.type==="pcb_plated_hole"){let{pcb_plated_hole_id:r,pcb_port_id:i}=o;i&&r&&t.push([r,i])}else if(o.type==="pcb_trace"){let{pcb_trace_id:r,source_trace_id:i}=o,s=Array.isArray(o.route)?o.route.filter((a)=>a&&a.route_type==="wire"):[];if(i&&r&&t.push([r,i]),Array.isArray(s)){let a=s.find((l)=>l?.start_pcb_port_id)?.start_pcb_port_id,c=s.find((l)=>l?.end_pcb_port_id)?.end_pcb_port_id;a&&r&&t.push([a,r]),r&&c&&t.push([r,c])}}else if(o.type==="pcb_via"){let{pcb_via_id:r,pcb_trace_id:i,source_trace_id:s,source_net_id:a}=o,c=[...o.pcb_port_ids??[],i,s,a].filter((l)=>Boolean(l));r&&c.length>0&&t.push([r,...c])}else if(o.type==="source_component"&&o.internally_connected_source_port_ids)for(let r of o.internally_connected_source_port_ids)t.push(r);let n=Z$e(t);return new kV(n)},Bpr=class{circuitJson;traceIdToElm;portIdToElm;connMap;constructor(e){this.circuitJson=e||[],this.traceIdToElm=new Map,this.portIdToElm=new Map,e?(this._buildTraceMap(),this._buildPortMap(),this.connMap=this._buildTraceConnectivityMap()):this.connMap=new kV({})}_buildPortMap(){for(let e of this.circuitJson)e.type==="pcb_port"&&this.portIdToElm.set(e.pcb_port_id,e)}_buildTraceMap(){for(let e of this.circuitJson)e.type==="pcb_trace"&&this.traceIdToElm.set(e.pcb_trace_id,e)}_buildTraceConnectivityMap(){let e=[],t=Array.from(this.traceIdToElm.keys());for(let n=0;n<t.length;n++)for(let o=n+1;o<t.length;o++){let r=this.traceIdToElm.get(t[n]),i=this.traceIdToElm.get(t[o]);this._arePcbTracesConnected(r,i)&&e.push([t[n],t[o]])}for(let n of this.portIdToElm.values())for(let o of this.traceIdToElm.values())for(let r of o.route)r.route_type==="wire"&&(r.start_pcb_port_id===n.pcb_port_id?e.push([n.pcb_port_id,o.pcb_trace_id]):r.end_pcb_port_id===n.pcb_port_id&&e.push([o.pcb_trace_id,n.pcb_port_id]));return new kV(Z$e(e))}addTrace(e){this.traceIdToElm.set(e.pcb_trace_id,e);let t=[];for(let n of e.route)n.route_type==="wire"&&(n.start_pcb_port_id&&t.push([n.start_pcb_port_id,e.pcb_trace_id]),n.end_pcb_port_id&&t.push([n.end_pcb_port_id,e.pcb_trace_id]));this.connMap.addConnections(t)}_arePcbTracesConnected(e,t){for(let n=0;n<e.route.length-1;n++){let o=e.route[n],r=e.route[n+1];if(o.route_type!=="wire")continue;if(r.route_type!=="wire")continue;if(o.layer!==r.layer)continue;let i=Math.min(o.x,r.x),s=Math.min(o.y,r.y),a=Math.max(o.x,r.x),c=Math.max(o.y,r.y),l=Number.isFinite(i)&&Number.isFinite(s)&&Number.isFinite(a)&&Number.isFinite(c);for(let h=0;h<t.route.length-1;h++){let d=t.route[h],u=t.route[h+1];if(d.route_type!=="wire")continue;if(u.route_type!=="wire")continue;if(d.layer!==u.layer)continue;if(o.layer!==d.layer)continue;let _=(o.width+d.width)/2,p=Math.max(0,_)+0.000000001;if(l&&Number.isFinite(d.x)&&Number.isFinite(d.y)&&Number.isFinite(u.x)&&Number.isFinite(u.y)&&Number.isFinite(_)&&(Math.min(d.x,u.x)>a+p||Math.max(d.x,u.x)<i-p||Math.min(d.y,u.y)>c+p||Math.max(d.y,u.y)<s-p))continue;if(wpr([o,r],[d,u],{lineThickness:_}))return!0}}return!1}areTracesConnected(e,t){return this.connMap.areIdsConnected(e,t)}getAllTracesConnectedToTrace(e){let t=this.connMap.getNetConnectedToId(e);return t?this.connMap.getIdsConnectedToNet(t).filter((n)=>this.traceIdToElm.has(n)).map((n)=>this.traceIdToElm.get(n)):[]}getAllTracesConnectedToPort(e){let t=this.connMap.getNetConnectedToId(e);return t?this.connMap.getIdsConnectedToNet(t).filter((n)=>this.traceIdToElm.has(n)).map((n)=>this.traceIdToElm.get(n)):[]}},GLt=(e)=>`${Math.round(100*e.x)},${Math.round(100*e.y)}`,im=(e)=>{let t=new kV({});for(let n of e.connections){for(let o of n.__rootConnectionNames??[])t.addConnections([[n.name,o]]);n.__netConnectionName&&t.addConnections([[n.name,n.__netConnectionName]]);for(let o of n.pointsToConnect)t.addConnections([[n.name,`${GLt(o)}:${E5(o).map((r)=>si(r,e.layerCount)).sort().join("-")}`]]),"pcb_port_id"in o&&o.pcb_port_id&&t.addConnections([[n.name,o.pcb_port_id]]),o.pointId&&t.addConnections([[n.name,o.pointId]])}for(let n of e.obstacles){let o=n.offBoardConnectsTo??[],r=Array.from(new Set([n.obstacleId,...n.connectedTo,...o,`${GLt(n.center)}:${n.layers.map((i)=>si(i,e.layerCount)).sort().join("-")}`].filter(Boolean)));r.length>0&&t.addConnections([r])}for(let n of e.traces??[]){let o=Array.from(new Set([n.pcb_trace_id,n.connection_name,...n.connectsTo??[]].filter(Boolean)));o.length>0&&t.addConnections([o])}return t},nk=(e)=>{let t=new kV({});for(let n of e.connections){let o=n.externallyConnectedPointIds??[];t.addConnections(o)}for(let n of e.traces??[]){let o=n.connectsTo??[];o.length!==0&&t.addConnections([[n.pcb_trace_id,...o]])}return t},ei=class{MAX_ITERATIONS=1000;solved=!1;failed=!1;iterations=0;progress=0;error=null;activeSubSolver;failedSubSolvers;timeToSolve;stats={};pendingEffects;cacheHit;cacheKey;cacheToSolveSpaceTransform;getSolverName(){return this.constructor.name}step(){if(!this.solved&&!this.failed){this.iterations++;try{this._step()}catch(e){throw this.error=`${this.getSolverName()} error: ${e}`,console.error(this.error),this.failed=!0,e}!this.solved&&this.iterations>this.MAX_ITERATIONS&&this.tryFinalAcceptance(),!this.solved&&this.iterations>this.MAX_ITERATIONS&&(this.error=`${this.getSolverName()} ran out of iterations (MAX_ITERATIONS=${this.MAX_ITERATIONS})`,this.failed=!0),"computeProgress"in this&&(this.progress=this.computeProgress())}}_step(){}getConstructorParams(){throw Error("getConstructorParams not implemented")}solve(){let e=Date.now();for(;!this.solved&&!this.failed;)this.step();let t=Date.now();this.timeToSolve=t-e}visualize(){return{lines:[],points:[],rects:[],circles:[]}}tryFinalAcceptance(){}preview(){return{lines:[],points:[],rects:[],circles:[]}}};function eq(e){let t=new Map;for(let n of e)for(let o of n.nodeIds)t.set(o,[...t.get(o)??[],n]);return t}var tY=class extends ei{getSolverName(){return"AvailableSegmentPointSolver"}nodes;edges;traceWidth;obstacleMargin;minPortSpacing;nodeMap;nodeEdgeMap;sharedEdgeSegments=[];edgeSegmentMap=new Map;portPointMap=new Map;colorMap;shouldReturnCrampedPortPoints;constructor({nodes:e,edges:t,traceWidth:n,obstacleMargin:o,colorMap:r,shouldReturnCrampedPortPoints:i}){super(),this.nodes=e,this.edges=t,this.traceWidth=n,this.obstacleMargin=o??0.15,this.shouldReturnCrampedPortPoints=i,this.minPortSpacing=this.traceWidth+this.obstacleMargin,this.colorMap=r??{},this.nodeMap=new Map(e.map((s)=>[s.capacityMeshNodeId,s])),this.nodeEdgeMap=eq(t),this.MAX_ITERATIONS=1}_step(){this.computeAllSharedEdgeSegments(),this.solved=!0}computeAllSharedEdgeSegments(){for(let e of this.edges){let[t,n]=e.nodeIds,o=this.nodeMap.get(t),r=this.nodeMap.get(n);if(!o||!r)continue;let i=this.computeSharedEdgeSegment(e,o,r);if(i){this.sharedEdgeSegments.push(i),this.edgeSegmentMap.set(e.capacityMeshEdgeId,i);for(let s of i.portPoints)this.portPointMap.set(s.segmentPortPointId,s)}}}computeSharedEdgeSegment(e,t,n){let o=this.findOverlappingSegment(t,n);if(!o)return null;let r=t.availableZ.filter((g)=>n.availableZ.includes(g));if(r.length===0)return null;let i=Math.sqrt((o.end.x-o.start.x)**2+(o.end.y-o.start.y)**2),s=Boolean(t._isNarrowQfpPadGap||n._isNarrowQfpPadGap),a=3*this.minPortSpacing/4,c=Math.max(0,i-2*a);if(c<=0&&!t._containsTarget&&!n._containsTarget){if(!this.shouldReturnCrampedPortPoints)return null;let g=[];for(let f of r)g.push({segmentPortPointId:`${e.capacityMeshEdgeId}_pp0_z${f}_cramped`,x:(o.start.x+o.end.x)/2,y:(o.start.y+o.end.y)/2,availableZ:[f],nodeIds:[t.capacityMeshNodeId,n.capacityMeshNodeId],edgeId:e.capacityMeshEdgeId,connectionName:null,distToCentermostPortOnZ:0,cramped:!0});return{edgeId:e.capacityMeshEdgeId,nodeIds:[t.capacityMeshNodeId,n.capacityMeshNodeId],start:o.start,end:o.end,availableZ:r,portPoints:g}}let l=Math.max(1,Math.floor(c/this.minPortSpacing)+1);if(t._offBoardConnectionId||n._offBoardConnectionId){if(t._offBoardConnectionId&&!n._offBoardConnectionId){if(this.shouldSkipOffBoardPortPoint(t,n))return null}else if(n._offBoardConnectionId&&!t._offBoardConnectionId&&this.shouldSkipOffBoardPortPoint(n,t))return null;l=1}let h=[],d=o.end.x-o.start.x,u=o.end.y-o.start.y,_=(o.start.x+o.end.x)/2,p=(o.start.y+o.end.y)/2;l>5&&(l=5+Math.floor(l/4));let m=[];for(let g=0;g<l;g++){let f;f=i===0||l===1?0.5:(a+c*g/(l-1))/i;let y=o.start.x+d*f,x=o.start.y+u*f,C=Math.sqrt((y-_)**2+(x-p)**2);m.push({x:y,y:x,distToCenter:C})}let A=m.reduce((g,f)=>f.distToCenter<g.distToCenter?f:g);for(let g=0;g<l;g++){let{x:f,y}=m[g],x=Math.sqrt((f-A.x)**2+(y-A.y)**2);for(let C of r){let b={segmentPortPointId:`${e.capacityMeshEdgeId}_pp${g}_z${C}`,x:f,y,availableZ:[C],nodeIds:[t.capacityMeshNodeId,n.capacityMeshNodeId],edgeId:e.capacityMeshEdgeId,connectionName:null,distToCentermostPortOnZ:x,cramped:s};h.push(b)}}return{edgeId:e.capacityMeshEdgeId,nodeIds:[t.capacityMeshNodeId,n.capacityMeshNodeId],start:o.start,end:o.end,availableZ:r,portPoints:h}}shouldSkipOffBoardPortPoint(e,t){let n=this.nodeEdgeMap.get(t.capacityMeshNodeId)??[];for(let o of n){let r=o.nodeIds[0]===t.capacityMeshNodeId?o.nodeIds[1]:o.nodeIds[0];if(r===e.capacityMeshNodeId)continue;let i=this.nodeMap.get(r);if(i?._offBoardConnectionId!==e._offBoardConnectionId)continue;if(this.nodes.filter((a)=>a._offBoardConnectionId===e._offBoardConnectionId).length!==2)continue;let s={x:(e.center.x+i.center.x)/2,y:(e.center.y+i.center.y)/2};if(s.x>=t.center.x-t.width/2&&s.x<=t.center.x+t.width/2&&s.y>=t.center.y-t.height/2&&s.y<=t.center.y+t.height/2)return!0}return!1}findOverlappingSegment(e,t){let n={start:Math.max(e.center.x-e.width/2,t.center.x-t.width/2),end:Math.min(e.center.x+e.width/2,t.center.x+t.width/2)},o={start:Math.max(e.center.y-e.height/2,t.center.y-t.height/2),end:Math.min(e.center.y+e.height/2,t.center.y+t.height/2)},r=n.end-n.start,i=o.end-o.start;if(r<-0.0001||i<-0.0001)return null;if(r<i){let s=(n.start+n.end)/2;return{start:{x:s,y:o.start},end:{x:s,y:o.end}}}{let s=(o.start+o.end)/2;return{start:{x:n.start,y:s},end:{x:n.end,y:s}}}}getAvailablePortPointsBetweenNodes(e,t){let n=this.edges.find((r)=>r.nodeIds[0]===e&&r.nodeIds[1]===t||r.nodeIds[0]===t&&r.nodeIds[1]===e);if(!n)return[];let o=this.edgeSegmentMap.get(n.capacityMeshEdgeId);return o?o.portPoints.filter((r)=>r.connectionName===null):[]}getPortPointsForEdge(e,t){let n=this.edges.find((r)=>r.nodeIds[0]===e&&r.nodeIds[1]===t||r.nodeIds[0]===t&&r.nodeIds[1]===e);if(!n)return[];return this.edgeSegmentMap.get(n.capacityMeshEdgeId)?.portPoints??[]}assignPortPoint(e,t,n){let o=this.portPointMap.get(e);return!!o&&(o.connectionName===null&&(o.connectionName=t,o.rootConnectionName=n,!0))}releasePortPoint(e){let t=this.portPointMap.get(e);return!!t&&(t.connectionName=null,t.rootConnectionName=void 0,!0)}getAvailablePortCountForEdge(e,t){return this.getAvailablePortPointsBetweenNodes(e,t).length}getOutput(){return this.sharedEdgeSegments}visualize(){let e={lines:[],points:[],rects:[],circles:[]};for(let t of this.sharedEdgeSegments){e.lines.push({points:[t.start,t.end],strokeColor:"rgba(100, 100, 100, 0.5)"});for(let n of t.portPoints){let o=n.connectionName?this.colorMap[n.connectionName]??"blue":"rgba(0, 200, 0, 0.7)";n.cramped?e.rects.push({center:{x:n.x,y:n.y},width:0.1,height:0.1,fill:o,layer:`z${n.availableZ.join(",")}`,label:`cramped ${n.segmentPortPointId}`}):e.circles.push({center:{x:n.x,y:n.y},radius:this.traceWidth/2,fill:o,layer:`z${n.availableZ.join(",")}`,label:[n.segmentPortPointId,n.connectionName,n.availableZ.join(","),`cd: ${n.distToCentermostPortOnZ}`,`connects: ${n.nodeIds.join(",")}`].filter(Boolean).join(`
`)})}}return e}};function gbe(e,t){let n=e.center.x-e.width/2,o=e.center.x+e.width/2,r=e.center.y-e.height/2,i=e.center.y+e.height/2,s=t.center.x-t.width/2,a=t.center.x+t.width/2,c=t.center.y-t.height/2,l=t.center.y+t.height/2,d=(Math.abs(o-s)<0.001||Math.abs(n-a)<0.001)&&Math.min(i,l)-Math.max(r,c)>=0.001,u=(Math.abs(i-c)<0.001||Math.abs(r-l)<0.001)&&Math.min(o,a)-Math.max(n,s)>=0.001;return d||u}var Tpr=class extends ei{constructor(e){super(),this.nodes=e,this.edges=[]}nodes;getSolverName(){return"CapacityMeshEdgeSolver"}edges;nodeMap;getNextCapacityMeshEdgeId(){return`ce${this.edges.length}`}_step(){this.edges=[];for(let e=0;e<this.nodes.length;e++)for(let t=e+1;t<this.nodes.length;t++)!(this.nodes[e]._strawNode&&this.nodes[t]._strawNode&&this.nodes[e]._strawParentCapacityMeshNodeId===this.nodes[t]._strawParentCapacityMeshNodeId)&&gbe(this.nodes[e],this.nodes[t])&&this.doNodesHaveSharedLayer(this.nodes[e],this.nodes[t])&&this.edges.push({capacityMeshEdgeId:this.getNextCapacityMeshEdgeId(),nodeIds:[this.nodes[e].capacityMeshNodeId,this.nodes[t].capacityMeshNodeId]});this.handleTargetNodes(),this.solved=!0}handleTargetNodes(){let e=this.nodes.filter((n)=>n._containsTarget),t=new Map(this.nodes.map((n)=>[n.capacityMeshNodeId,n]));for(let n=0;n<e.length;n++)for(let o=n+1;o<e.length;o++){let r=e[n],i=e[o];this.doNodesHaveSharedLayer(r,i)&&(this.doNodesTouchOrOverlap(r,i)&&(this.hasEdgeBetween(r,i)||this.edges.push({capacityMeshEdgeId:this.getNextCapacityMeshEdgeId(),nodeIds:[r.capacityMeshNodeId,i.capacityMeshNodeId]})))}for(let n of e){if(!n._containsObstacle||!n._targetConnectionName)continue;if(!this.edges.some((o)=>{if(!o.nodeIds.includes(n.capacityMeshNodeId))return!1;let r=o.nodeIds[0]===n.capacityMeshNodeId?o.nodeIds[1]:o.nodeIds[0],i=t.get(r);return!!i&&(!i._containsObstacle&&!i._containsTarget&&this.doNodesHaveSharedLayer(n,i))}))throw Error(`Target obstacle region "${n.capacityMeshNodeId}" for connection "${n._targetConnectionName}" has no bordering routing edge`)}}doNodesHaveSharedLayer(e,t){return e.availableZ.some((n)=>t.availableZ.includes(n))}hasEdgeBetween(e,t){return this.edges.some((n)=>n.nodeIds.includes(e.capacityMeshNodeId)&&n.nodeIds.includes(t.capacityMeshNodeId))}doNodesTouchOrOverlap(e,t){let o=e.center.x-e.width/2,r=e.center.x+e.width/2,i=e.center.y-e.height/2,s=e.center.y+e.height/2,a=t.center.x-t.width/2,c=t.center.x+t.width/2,l=t.center.y-t.height/2,h=t.center.y+t.height/2;return o<=c+0.001&&r+0.001>=a&&i<=h+0.001&&s+0.001>=l}visualize(){let e=new Map;for(let n of this.edges)for(let o of n.nodeIds)e.set(o,1+(e.get(o)??0));let t={lines:[],points:[],rects:this.nodes.map((n)=>{let o=Math.min(...n.availableZ);return{width:Math.max(n.width-2,0.8*n.width),height:Math.max(n.height-2,0.8*n.height),center:{x:n.center.x+o*n.width*0.05,y:n.center.y-o*n.width*0.05},fill:n._containsObstacle?"rgba(255,0,0,0.1)":{"0,1":"rgba(0,0,0,0.1)",0:"rgba(0,200,200, 0.1)",1:"rgba(0,0,200, 0.1)"}[n.availableZ.join(",")]??"rgba(0,200,200,0.1)",label:[n.capacityMeshNodeId,`availableZ: ${n.availableZ.join(",")}`,`target? ${n._containsTarget??!1}`,`obs? ${n._containsObstacle??!1}`,`conn: ${e.get(n.capacityMeshNodeId)??0}`].join(`
`),layer:`z${n.availableZ.join(",")}`}}),circles:[]};if(!this.nodeMap){this.nodeMap=new Map;for(let n of this.nodes)this.nodeMap.set(n.capacityMeshNodeId,n)}for(let n of this.edges){let o=this.nodeMap.get(n.nodeIds[0]),r=this.nodeMap.get(n.nodeIds[1]);if(o?.center&&r?.center){let i=Math.min(...o.availableZ),s=Math.min(...r.availableZ),a={x:o.center.x+i*o.width*0.05,y:o.center.y-i*o.width*0.05},c={x:r.center.x+s*r.width*0.05,y:r.center.y-s*r.width*0.05},l=Array.from(new Set([...o.availableZ,...r.availableZ])).sort();t.lines.push({layer:`z${l.join(",")}`,points:[a,c],strokeDash:o.availableZ.join(",")===r.availableZ.join(",")?void 0:"10 5"})}}return t}},eqe=class{constructor(e){this.nodes=e,this.buckets=new Map;for(let t of e){let n=t.center.x-t.width/2,o=t.center.y-t.height/2,r=t.center.x+t.width/2,i=t.center.y+t.height/2,s=Math.floor(n/this.CELL_SIZE),a=Math.floor(r/this.CELL_SIZE),c=Math.floor(o/this.CELL_SIZE),l=Math.floor(i/this.CELL_SIZE);for(let h=s;h<=a;h++)for(let d=c;d<=l;d++){let u=`${h}x${d}`,_=this.buckets.get(u);_?_.push(t):this.buckets.set(u,[t])}}}nodes;buckets;CELL_SIZE=0.4;getBucketKey(e,t){return`${Math.floor(e/this.CELL_SIZE)}x${Math.floor(t/this.CELL_SIZE)}`}getNodesInArea(e,t,n,o){let r=[],i=new Set,s=e-n/2,a=t-o/2,c=e+n/2,l=t+o/2,h=Math.floor(s/this.CELL_SIZE),d=Math.floor(c/this.CELL_SIZE),u=Math.floor(a/this.CELL_SIZE),_=Math.floor(l/this.CELL_SIZE);for(let p=h;p<=d;p++)for(let m=u;m<=_;m++){let A=`${p}x${m}`,g=this.buckets.get(A)||[];for(let f of g)i.has(f.capacityMeshNodeId)||(i.add(f.capacityMeshNodeId),r.push(f))}return r}},ok=class extends Tpr{constructor(e){super(e),this.nodes=e,this.MAX_ITERATIONS=1e7,this.nodeTree=new eqe(this.nodes),this.currentNodeIndex=0,this.edgeSet=new Set}nodes;getSolverName(){return"CapacityMeshEdgeSolver2_NodeTreeOptimization"}nodeTree;currentNodeIndex;edgeSet;_step(){if(this.currentNodeIndex>=this.nodes.length)return this.handleTargetNodes(),void(this.solved=!0);let e=this.nodes[this.currentNodeIndex],t=this.nodeTree.getNodesInArea(e.center.x,e.center.y,2*e.width,2*e.height);for(let n of t){if(!gbe(e,n))continue;let o=e._strawNode&&n._strawNode&&e._strawParentCapacityMeshNodeId===n._strawParentCapacityMeshNodeId;e.capacityMeshNodeId===n.capacityMeshNodeId||o||!this.doNodesHaveSharedLayer(e,n)||this.edgeSet.has(`${e.capacityMeshNodeId}-${n.capacityMeshNodeId}`)||(this.edgeSet.add(`${e.capacityMeshNodeId}-${n.capacityMeshNodeId}`),this.edgeSet.add(`${n.capacityMeshNodeId}-${e.capacityMeshNodeId}`),this.edges.push({capacityMeshEdgeId:this.getNextCapacityMeshEdgeId(),nodeIds:[e.capacityMeshNodeId,n.capacityMeshNodeId]}))}this.currentNodeIndex++}},Bl=(...e)=>{let t={points:[],lines:[],circles:[],rects:[],polygons:[],infiniteLines:[],arrows:[],texts:[]};return e.forEach((n,o)=>{n&&(n.lines&&(t.lines=[...t.lines||[],...n.lines.map((r)=>({...r,step:o}))]),n.points&&(t.points=[...t.points||[],...n.points.map((r)=>({...r,step:o}))]),n.circles&&(t.circles=[...t.circles||[],...n.circles.map((r)=>({...r,step:o}))]),n.rects&&(t.rects=[...t.rects||[],...n.rects.map((r)=>({...r,step:o}))]),n.polygons&&(t.polygons=[...t.polygons||[],...n.polygons.map((r)=>({...r,step:o}))]),n.infiniteLines&&(t.infiniteLines=[...t.infiniteLines||[],...n.infiniteLines.map((r)=>({...r,step:o}))]),n.arrows&&(t.arrows=[...t.arrows||[],...n.arrows.map((r)=>({...r,step:o}))]),n.texts&&(t.texts=[...t.texts||[],...n.texts.map((r)=>({...r,step:o}))]))}),t};function Abe(e,t,n){let o=[],r=null;for(let i=0;i<e.length;i++){let s=e[i];r?r.z===s.z?r.points.push({x:s.x,y:s.y}):(o.push(r),r={points:[{x:s.x,y:s.y}],z:s.z,connectionName:t,color:n}):r={points:[{x:s.x,y:s.y}],z:s.z,connectionName:t,color:n},i===e.length-1&&r&&o.push(r)}return o}function TS(e,t){return{x:e.a*t.x+e.b*t.y+e.c,y:e.d*t.x+e.e*t.y+e.f}}var Oje=(e,t,n)=>{let[o,r]=e;if(o===r)return;let i=((s,a)=>{let c=s.portPointId??`${s.connectionName}:${s.x}:${s.y}:${s.z}`,l=a.portPointId??`${a.connectionName}:${a.x}:${a.y}:${a.z}`;return c<l?`${c}|${l}`:`${l}|${c}`})(o,r);t.has(i)||(t.add(i),n.push(e))},ULt=(e,t,n)=>{for(let o=0;o<e.length-1;o++)Oje([e[o],e[o+1]],t,n)},DUt=(e)=>{let t=[],n=new Set,o=((s)=>{let a=new Map;for(let c of s)c.portPointId&&a.set(c.portPointId,c);return a})(e);for(let s of e){if(s.prevPortPointId){let a=o.get(s.prevPortPointId);a&&a.connectionName===s.connectionName&&Oje([a,s],n,t)}if(s.nextPortPointId){let a=o.get(s.nextPortPointId);a&&a.connectionName===s.connectionName&&Oje([s,a],n,t)}}if(t.length===0)return ULt(e,n,t),t;let r=((s)=>{let a=new Set;for(let[c,l]of s)c.portPointId&&a.add(c.portPointId),l.portPointId&&a.add(l.portPointId);return a})(t),i=e.filter((s)=>!s.portPointId||!r.has(s.portPointId));return ULt(i,n,t),t};function f4e(e,t,n){return Math.max(t,Math.min(n,e))}function NUt(e){let t=e.planeSize*e.layers,n=e.connectionCount,o=Math.sqrt(n),r=Math.max(1,e.maxIterations),i=f4e(Math.round(t*(8+1.2*o)),150000,12000000),s=f4e(Math.round(i*e.effort),150000,12000000),a=f4e(Math.round(0.2*r),150000,2000000);return{maxIterationsIters:Math.max(1,Math.min(r,Math.max(a,s))),baseSearchBudgetIters:f4e(Math.round(t*(10+0.8*o)*e.effort),50000,4000000)}}function QWe(e,t){for(let n=e;n;n=n.prev)if(n.id===t)return!0;return!1}var Dpr=class{f=[];seq=[];id=[];n=0;push(e,t,n){let o=this.n++;for(this.f[o]=e,this.seq[o]=t,this.id[o]=n;o>0;){let r=o-1>>1;if(this.less(r,o))break;this.swap(o,r),o=r}}pop(){let e=this.id[0];return this.n--,this.n>0&&(this.f[0]=this.f[this.n],this.seq[0]=this.seq[this.n],this.id[0]=this.id[this.n],this.siftDown(0)),e}get size(){return this.n}clear(){this.n=0}siftDown(e){for(;;){let t=2*e+1,n=t+1;if(t>=this.n)return;let o=t;if(n<this.n&&!this.less(t,n)&&(o=n),this.less(e,o))return;this.swap(e,o),e=o}}less(e,t){let n=this.f[e],o=this.f[t];return n!==o?n<o:this.seq[e]<this.seq[t]}swap(e,t){let n=this.f[e];this.f[e]=this.f[t],this.f[t]=n;let o=this.seq[e];this.seq[e]=this.seq[t],this.seq[t]=o;let r=this.id[e];this.id[e]=this.id[t],this.id[t]=r}},Npr=[-1,-1,-1,0,0,1,1,1],Rpr=[-1,0,1,-1,1,-1,0,1],y4e=class extends Da{getSolverName(){return"HighDensitySolverA01"}nodeWithPortPoints;cellSizeMm;viaDiameter;MAX_RIPS;maxCellCount;traceThickness;traceMargin;viaMinDistFromBorder;showPenaltyMap;showUsedCellMap;effort;stepMultiplier;hyperParameters;initialPenaltyFn;useExactViaTraceClearance=!1;ripHistoryCostMultiplier=0;rows;cols;layers;gridOrigin;gridToBoundsTransform;availableZ;zToLayer;layerToZ;connNameToId;connIdToName;connIdToRootNet;overlapFriendlyRootNets;planeSize;usedCellsFlat;portOwnerFlat;usedDiagFlat;penalty2d;visitedStamp;sharedCrossRootPortCells;stamp=0;viaOccupantScanOffsetsDr;viaOccupantScanOffsetsDc;viaOccupantScanOffsetsLen;viaOwnersByCell;viaCenterIndicesByConn;viaTraceClearanceMm;outputCellStepX;outputCellStepY;minViaRow;maxViaRow;minViaCol;maxViaCol;usedIndicesByConn;usedDiagIndicesByConn;unsolvedSegs;solvedRoutes;activeConnSeg=null;activeConnId=-1;crossLayerSearch=!1;nodePool;heap;seqCounter=0;_viaOccs=[];viaOccupantsByCell=new Map;ripCount;totalRipEvents=0;searchIterations=0;consecutiveSkips=0;penaltyCap;baseSearchBudgetIters;_moveCost=0;_moveRipped=null;get unsolvedConnections(){return this.unsolvedSegs}get solvedConnectionsMap(){return this.solvedRoutes}get activeConnection(){if(!this.activeConnSeg)return null;let e=this.activeConnSeg;return{connectionName:this.connIdToName[e.connId]??"",start:{row:e.startRow,col:e.startCol,z:e.startZ,x:0,y:0},end:{row:e.endRow,col:e.endCol,z:e.endZ,x:0,y:0}}}get openSet(){return{length:this.heap?.size??0}}get gridStats(){return{cells:this.planeSize||0,layers:this.layers||0,states:(this.planeSize||0)*(this.layers||0)}}constructor(e){super(),this.nodeWithPortPoints=e.nodeWithPortPoints,this.cellSizeMm=e.cellSizeMm,this.viaDiameter=e.viaDiameter,this.maxCellCount=e.maxCellCount,this.traceThickness=e.traceThickness??0.1,this.traceMargin=e.traceMargin??0.15,this.viaMinDistFromBorder=e.viaMinDistFromBorder??0.15,this.showPenaltyMap=e.showPenaltyMap??!1,this.showUsedCellMap=e.showUsedCellMap??!1,this.effort=e.effort??1,this.stepMultiplier=Math.max(1,Math.floor(e.stepMultiplier??1)),this.hyperParameters={shuffleSeed:0,ripCost:10,ripTracePenalty:0.5,ripViaPenalty:0.75,viaBaseCost:0.1,greedyMultiplier:1.5,...e.hyperParameters},this.MAX_ITERATIONS=1e8,this.MAX_RIPS=200,this.initialPenaltyFn=e.initialPenaltyFn}getConstructorParams(){return[{nodeWithPortPoints:this.nodeWithPortPoints,cellSizeMm:this.cellSizeMm,viaDiameter:this.viaDiameter,maxCellCount:this.maxCellCount,stepMultiplier:this.stepMultiplier,traceThickness:this.traceThickness,traceMargin:this.traceMargin,viaMinDistFromBorder:this.viaMinDistFromBorder,showPenaltyMap:this.showPenaltyMap,showUsedCellMap:this.showUsedCellMap,effort:this.effort,hyperParameters:this.hyperParameters,initialPenaltyFn:this.initialPenaltyFn}]}_setup(){let{nodeWithPortPoints:e,cellSizeMm:t}=this,{width:n,height:o,center:r}=e;this.availableZ=e.availableZ??[...new Set(e.portPoints.map((h)=>h.z))].sort((h,d)=>h-d),this.rows=Math.floor(o/t),this.cols=Math.floor(n/t),this.layers=this.availableZ.length,this.planeSize=this.rows*this.cols;let i=this.layers*this.planeSize;if(this.maxCellCount!==void 0&&i>this.maxCellCount)return this.error=`Cell count ${i} exceeds maxCellCount ${this.maxCellCount}`,void(this.failed=!0);let s=this.layers*Math.max(0,this.rows-1)*Math.max(0,this.cols-1)*2;this.zToLayer=new Map,this.layerToZ=new Map;for(let h=0;h<this.availableZ.length;h++){let d=this.availableZ[h];this.zToLayer.set(d,h),this.layerToZ.set(h,d)}if(this.gridOrigin={x:r.x-n/2,y:r.y-o/2},this.gridToBoundsTransform=function(h){let{originX:d,originY:u,rows:_,cols:p,cellSizeMm:m,width:A,height:g}=h,f,y,x,C;return p>1?(f=A/((p-1)*m),y=d*(1-f)-0.5*m*f):(f=1,y=d+A/2-(d+0.5*m)),_>1?(x=g/((_-1)*m),C=u*(1-x)-0.5*m*x):(x=1,C=u+g/2-(u+0.5*m)),{a:f,b:0,c:y,d:0,e:x,f:C}}({originX:this.gridOrigin.x,originY:this.gridOrigin.y,rows:this.rows,cols:this.cols,cellSizeMm:t,width:n,height:o}),this.outputCellStepX=this.cols>1?n/(this.cols-1):n,this.outputCellStepY=this.rows>1?o/(this.rows-1):o,this.connNameToId=new Map,this.connIdToName=[],this.connIdToRootNet=[],this.overlapFriendlyRootNets=new Set,this.penalty2d=new Float64Array(this.planeSize),this.initialPenaltyFn)for(let h=0;h<this.rows;h++){let d=h*this.cols;for(let u=0;u<this.cols;u++){let _=this.gridOrigin.x+(u+0.5)*t,p=this.gridOrigin.y+(h+0.5)*t,m=(u+0.5)/this.cols,A=(h+0.5)/this.rows;this.penalty2d[d+u]=this.initialPenaltyFn({x:_,y:p,px:m,py:A,row:h,col:u})}}this.usedCellsFlat=new Int32Array(i).fill(-1),this.portOwnerFlat=new Int32Array(i).fill(-1),this.usedDiagFlat=new Int32Array(s).fill(-1),this.visitedStamp=new Uint32Array(i),this.stamp=0;let a=function(h){let d=h.radiusMm/h.cellSizeMm,u=Math.round(d),_=Math.abs(d-u)<=0.000000001?u:Math.ceil(d),p=_*_,m=[],A=[];for(let g=-_;g<=_;g++)for(let f=-_;f<=_;f++)g*g+f*f<=p&&(m.push(g),A.push(f));return{rowOffsets:new Int32Array(m),columnOffsets:new Int32Array(A),length:m.length}}({radiusMm:this.viaDiameter/2,cellSizeMm:t});if(this.viaOccupantScanOffsetsLen=a.length,this.viaOccupantScanOffsetsDr=a.rowOffsets,this.viaOccupantScanOffsetsDc=a.columnOffsets,this.viaOwnersByCell=new Map,this.viaCenterIndicesByConn=[],this.viaTraceClearanceMm=this.viaDiameter/2+this.traceThickness/2,this.viaMinDistFromBorder>0){let h=Math.ceil(this.viaMinDistFromBorder/t);this.minViaRow=h,this.maxViaRow=this.rows-1-h,this.minViaCol=h,this.maxViaCol=this.cols-1-h}else this.minViaRow=0,this.maxViaRow=this.rows-1,this.minViaCol=0,this.maxViaCol=this.cols-1;this.unsolvedSegs=this.buildConnectionSegs(),this.sharedCrossRootPortCells=new Set;let c=new Map;for(let h of this.nodeWithPortPoints.portPoints){let d=this.connNameToId.get(h.connectionName);if(d===void 0)continue;let u=this.pointToCell(h),_=(u.z*this.rows+u.row)*this.cols+u.col,p=this.connIdToRootNet[d],m=c.get(_);m===void 0?c.set(_,p):m!==p&&this.sharedCrossRootPortCells.add(_);let A=this.portOwnerFlat[_];this.portOwnerFlat[_]=A===-1||A===d?d:-2}this.solvedRoutes=new Map,this.usedIndicesByConn=[],this.usedDiagIndicesByConn=[],this.ripCount=[],this.consecutiveSkips=0,this.penaltyCap=0.5*this.hyperParameters.ripCost,this.shuffleConnections();let l=NUt({planeSize:this.planeSize,layers:this.layers,connectionCount:this.unsolvedSegs.length,effort:this.effort,maxIterations:this.MAX_ITERATIONS});this.baseSearchBudgetIters=l.baseSearchBudgetIters,this.MAX_ITERATIONS=l.maxIterationsIters,this.activeConnSeg=null,this.activeConnId=-1,this.nodePool=[],this.heap=new Dpr,this.seqCounter=0}_step(){for(let e=0;e<this.stepMultiplier;e++){if(this.solved||this.failed)return;this.stepOnce()}}stepOnce(){if(!this.activeConnSeg){if(this.unsolvedSegs.length===0)return void(this.solved=!0);let y=this.unsolvedSegs.shift();this.activeConnSeg=y,this.activeConnId=y.connId,this.crossLayerSearch=y.startZ!==y.endZ,this.viaOccupantsByCell.clear(),this.nodePool=[],this.heap.clear(),this.seqCounter=0,this.searchIterations=0,this.nextStamp();let x=this.computeH(y.startZ,y.startRow,y.startCol,y.endZ,y.endRow,y.endCol)*this.hyperParameters.greedyMultiplier;return this.nodePool.push({z:y.startZ,row:y.startRow,col:y.startCol,g:0,f:x,parentIdx:-1,ripped:null}),void this.heap.push(x,this.seqCounter++,0)}this.searchIterations++;let e=this.ripCount[this.activeConnId]??0,t=Math.round(this.baseSearchBudgetIters*(1+0.25*Math.min(e,10)));if(this.searchIterations>t){let y=this.penalty2d;for(let x=0;x<y.length;x++)y[x]=0.9*y[x];return this.unsolvedSegs.push(this.activeConnSeg),this.activeConnSeg=null,this.activeConnId=-1,this.heap.clear(),this.nodePool=[],this.consecutiveSkips++,void(this.consecutiveSkips>=3*this.unsolvedSegs.length&&(this.error=`Convergence failure: ${this.unsolvedSegs.length} connections stuck`,this.failed=!0))}if(this.heap.size===0)return this.error=`No path found for ${this.connIdToName[this.activeConnId]}`,void(this.failed=!0);let n=this.heap.pop(),o=this.nodePool[n],{z:r,row:i,col:s,g:a,ripped:c}=o,l=(r*this.rows+i)*this.cols+s;if(this.visitedStamp[l]===this.stamp)return;this.visitedStamp[l]=this.stamp;let h=this.activeConnSeg;if(r===h.endZ&&i===h.endRow&&s===h.endCol)return this.finalizeRoute(n),this.activeConnSeg=null,void(this.activeConnId=-1);let{endZ:d,endRow:u,endCol:_}=h,p=this.activeConnId,m=this.rows,A=this.cols,g=(this.cellSizeMm,this.visitedStamp),f=this.stamp;for(let y=0;y<8;y++){let x=i+Npr[y],C=s+Rpr[y];if(x<0||x>=m||C<0||C>=A)continue;if(g[(r*m+x)*A+C]===f)continue;if(this.computeMoveCostAndRips(p,r,i,s,r,x,C,c),this._moveCost<0)continue;let b=a+this._moveCost,I=b+this.computeH(r,x,C,d,u,_)*this.hyperParameters.greedyMultiplier,v=this.nodePool.length;this.nodePool.push({z:r,row:x,col:C,g:b,f:I,parentIdx:n,ripped:this._moveRipped}),this.heap.push(I,this.seqCounter++,v)}if(i>=this.minViaRow&&i<=this.maxViaRow&&s>=this.minViaCol&&s<=this.maxViaCol)for(let y=0;y<this.layers;y++){if(y===r)continue;if(g[(y*m+i)*A+s]===f)continue;if(this.computeMoveCostAndRips(p,r,i,s,y,i,s,c),this._moveCost<0)continue;let x=a+this._moveCost,C=x+this.computeH(y,i,s,d,u,_)*this.hyperParameters.greedyMultiplier,b=this.nodePool.length;this.nodePool.push({z:y,row:i,col:s,g:x,f:C,parentIdx:n,ripped:this._moveRipped}),this.heap.push(C,this.seqCounter++,b)}}getRipCost(e){return this.hyperParameters.ripCost*(1+this.ripHistoryCostMultiplier*(this.ripCount[e]??0))}computeMoveCostAndRips(e,t,n,o,r,i,s,a){let c=0,l=a,h=this.cols;if(t!==r){c+=this.hyperParameters.viaBaseCost,c+=Math.min(this.penalty2d[i*h+s],this.penaltyCap);let d=(r*this.rows+i)*h+s,u=this.portOwnerFlat[d],_=this.connIdToRootNet[u]===this.connIdToRootNet[e]&&this.overlapFriendlyRootNets.has(this.connIdToRootNet[e]),p=this.activeConnSeg,m=!!p&&r===p.endZ&&i===p.endRow&&s===p.endCol;if(u>=0&&u!==e&&!_&&!m)return this._moveCost=-1,void(this._moveRipped=l);this.fillViaOccupants(i,s,e);let A=this._viaOccs;for(let g=0;g<A.length;g++){let f=A[g];QWe(l,f)||(c+=this.getRipCost(f),l={id:f,prev:l}),c+=this.hyperParameters.ripViaPenalty}}else{let d=n>i?n-i:i-n,u=o>s?o-s:s-o;c+=(d+u>1?Math.SQRT2:1)*this.cellSizeMm,c+=Math.min(this.penalty2d[i*h+s],this.penaltyCap);let _=(r*this.rows+i)*h+s,p=this.portOwnerFlat[_],m=this.connIdToRootNet[p]===this.connIdToRootNet[e]&&this.overlapFriendlyRootNets.has(this.connIdToRootNet[e]),A=this.activeConnSeg,g=!!A&&r===A.endZ&&i===A.endRow&&s===A.endCol;if(p>=0&&p!==e&&!m&&!g)return this._moveCost=-1,void(this._moveRipped=l);let f=this.usedCellsFlat[_],y=this.connIdToRootNet[f]===this.connIdToRootNet[e]&&this.overlapFriendlyRootNets.has(this.connIdToRootNet[e]);if(f===-1||f===e||y||(QWe(l,f)||(c+=this.getRipCost(f),l={id:f,prev:l}),c+=this.hyperParameters.ripTracePenalty),this.viaOwnersByCell.size>0){this.fillTraceSegmentViaOccupants(n,o,i,s,e);let x=this._viaOccs;for(let C=0;C<x.length;C++){let b=x[C];QWe(l,b)||(c+=this.getRipCost(b),l={id:b,prev:l}),c+=this.hyperParameters.ripViaPenalty}}if(d===1&&u===1){let x=n<i?n:i,C=o<s?o:s,b=1^(n<i&&o<s||n>i&&o>s?0:1),I=this.cols-1,v=2*((r*(this.rows-1)+x)*I+C),P=this.usedDiagFlat[v+b],M=this.connIdToRootNet[P]===this.connIdToRootNet[e]&&this.overlapFriendlyRootNets.has(this.connIdToRootNet[e]);if(P!==-1&&P!==e&&!M)return this._moveCost=-1,void(this._moveRipped=l)}}this._moveCost=c,this._moveRipped=l}fillViaOccupants(e,t,n){let o=this._viaOccs;o.length=0;let r=e*this.cols+t,i=this.viaOccupantsByCell.get(r);if(i){for(let u of i)o.push(u);return}let s=this.rows,a=this.cols,c=this.viaOccupantScanOffsetsDr,l=this.viaOccupantScanOffsetsDc,h=this.viaOccupantScanOffsetsLen,d=this.usedCellsFlat;for(let u=0;u<this.layers;u++){let _=u*this.planeSize;for(let p=0;p<h;p++){let m=e+c[p],A=t+l[p];if(m<0||A<0||m>=s||A>=a)continue;let g=d[_+m*a+A];if(g===-1||g===n)continue;if(this.connIdToRootNet[g]===this.connIdToRootNet[n]&&this.overlapFriendlyRootNets.has(this.connIdToRootNet[n]))continue;let f=!1;for(let y=0;y<o.length;y++)if(o[y]===g){f=!0;break}f||o.push(g)}}this.viaOccupantsByCell.set(r,o.slice())}fillTraceSegmentViaOccupants(e,t,n,o,r){let i=this._viaOccs;i.length=0;let s=Math.min(e,n),a=Math.max(e,n),c=Math.min(t,o),l=Math.max(t,o),h=this.viaTraceClearanceMm/this.outputCellStepY,d=this.viaTraceClearanceMm/this.outputCellStepX,u=(o-t)*this.outputCellStepX,_=(n-e)*this.outputCellStepY,p=u*u+_*_,m=this.viaTraceClearanceMm*this.viaTraceClearanceMm;for(let[A,g]of this.viaOwnersByCell){let f=Math.floor(A/this.cols),y=A-f*this.cols;if(f<s-h||f>a+h||y<c-d||y>l+d)continue;let x=(y-t)*this.outputCellStepX,C=(f-e)*this.outputCellStepY,b=p===0?0:Math.max(0,Math.min(1,(x*u+C*_)/p)),I=x-u*b,v=C-_*b;if(!(I*I+v*v>=m))for(let P of g){if(P===r)continue;this.connIdToRootNet[P]===this.connIdToRootNet[r]&&this.overlapFriendlyRootNets.has(this.connIdToRootNet[r])||(i.includes(P)||i.push(P))}}}shouldSkipFixedPortHalo(e,t){let n=this.portOwnerFlat[e];if(n===t)return!1;if(n===-2)return!0;if(n<0)return!1;return!(this.connIdToRootNet[n]===this.connIdToRootNet[t]&&this.overlapFriendlyRootNets.has(this.connIdToRootNet[t]))}nextStamp(){this.stamp=this.stamp+1>>>0,this.stamp===0&&(this.visitedStamp.fill(0),this.stamp=1)}computeH(e,t,n,o,r,i){let s=Math.abs(t-r)+Math.abs(n-i);if(e===o)return s*this.cellSizeMm;if(!this.crossLayerSearch)return s*this.cellSizeMm+this.hyperParameters.viaBaseCost;let a=Math.max(this.minViaRow,Math.min(this.maxViaRow,t)),c=Math.max(this.minViaCol,Math.min(this.maxViaCol,n)),l=Math.max(this.minViaRow,Math.min(this.maxViaRow,r)),h=Math.max(this.minViaCol,Math.min(this.maxViaCol,i)),d=Math.abs(t-a)+Math.abs(n-c)+Math.abs(a-r)+Math.abs(c-i),u=Math.abs(t-l)+Math.abs(n-h)+Math.abs(l-r)+Math.abs(h-i);return Math.max(Math.min(d,u),s)*this.cellSizeMm+this.hyperParameters.viaBaseCost}internConn(e,t){let n=this.connNameToId.get(e);if(n!==void 0)return n;let o=this.connIdToName.length;var r;return this.connIdToName.push(e),this.connIdToRootNet.push((r=e,t??r.replace(/_mst\d+$/,""))),this.connNameToId.set(e,o),o}buildConnectionSegs(){let e=new Map;for(let o of this.nodeWithPortPoints.portPoints){let r=o.connectionName;e.has(r)||e.set(r,{points:[],rootConnectionName:o.rootConnectionName}),e.get(r).points.push(o)}let t=[],n=new Set;for(let[o,r]of e){let i=r.points,s=DUt(i);if(s.length===0)continue;let a=this.internConn(o,r.rootConnectionName);for(let[c,l]of s){let h=this.pointToCell(c),d=this.pointToCell(l),u=`${h.z}:${h.row}:${h.col}`,_=`${d.z}:${d.row}:${d.col}`,p=u<_?`${u}|${_}`:`${_}|${u}`,m=r.rootConnectionName??o,A=`${m}|${p}`;n.has(A)?this.overlapFriendlyRootNets.add(m):(n.add(A),t.push({connId:a,startZ:h.z,startRow:h.row,startCol:h.col,startPoint:c,endZ:d.z,endRow:d.row,endCol:d.col,endPoint:l}))}}return t}pointToCell(e){let t=Math.max(0,Math.min(this.cols-1,Math.round((e.x-this.gridOrigin.x)/this.cellSizeMm-0.5))),n=Math.max(0,Math.min(this.rows-1,Math.round((e.y-this.gridOrigin.y)/this.cellSizeMm-0.5)));return{z:this.zToLayer.get(e.z)??0,row:n,col:t}}shuffleConnections(){let e=this.unsolvedSegs,t=this.hyperParameters.shuffleSeed,n=()=>(t=1664525*t+1013904223&4294967295,(t>>>0)/4294967295);for(let o=e.length-1;o>0;o--){let r=Math.floor(n()*(o+1)),i=e[o];e[o]=e[r],e[r]=i}}finalizeRoute(e){this.consecutiveSkips=Math.max(0,this.consecutiveSkips-1);let t=[],n=e;for(;n>=0;){let b=this.nodePool[n];t.push({z:b.z,row:b.row,col:b.col}),n=b.parentIdx}for(t.reverse();t.length>1;){let b=t[0],I=(b.z*this.rows+b.row)*this.cols+b.col;if(!this.sharedCrossRootPortCells.has(I))break;t.shift()}for(;t.length>1;){let b=t[t.length-1],I=(b.z*this.rows+b.row)*this.cols+b.col;if(!this.sharedCrossRootPortCells.has(I))break;t.pop()}let o=[];for(let b=1;b<t.length;b++)t[b].z!==t[b-1].z&&o.push({row:t[b].row,col:t[b].col});let r=t[0],i=t[t.length-1],s=this.activeConnId,a=[];for(let b=this.nodePool[e].ripped;b;b=b.prev)a.push(b.id);for(let b=0;b<a.length;b++)if(this.ripTrace(a[b]),this.failed)return;let c=Math.ceil(this.traceMargin/this.cellSizeMm),l=[],h=this.rows,d=this.cols,u=this.usedCellsFlat;for(let b=0;b<t.length;b++){let I=t[b];for(let v=-c;v<=c;v++)for(let P=-c;P<=c;P++){let M=I.row+v,B=I.col+P;if(M<0||M>=h||B<0||B>=d)continue;let T=(I.z*h+M)*d+B;if((M!==I.row||B!==I.col)&&this.shouldSkipFixedPortHalo(T,s))continue;let N=u[T],D=this.connIdToRootNet[N]===this.connIdToRootNet[s]&&this.overlapFriendlyRootNets.has(this.connIdToRootNet[s]);(N===-1||N===s||D)&&(u[T]=s,l.push(T))}}let _=[],p=this.viaOccupantScanOffsetsDr,m=this.viaOccupantScanOffsetsDc,A=this.viaOccupantScanOffsetsLen;for(let b=0;b<o.length;b++){let I=o[b];for(let v=0;v<this.layers;v++){let P=v*this.planeSize;for(let M=0;M<A;M++){let B=I.row+p[M],T=I.col+m[M];if(B<0||B>=h||T<0||T>=d)continue;let N=P+B*d+T;if((B!==I.row||T!==I.col)&&this.shouldSkipFixedPortHalo(N,s))continue;let D=u[N],L=this.connIdToRootNet[D]===this.connIdToRootNet[s]&&this.overlapFriendlyRootNets.has(this.connIdToRootNet[s]);if(D!==-1&&D!==s&&!L){let H=!1;for(let V=0;V<_.length;V++)if(_[V]===D){H=!0;break}H||_.push(D)}u[N]=s,l.push(N)}}}let g=[],f=this.cols-1;for(let b=1;b<t.length;b++){let I=t[b-1],v=t[b];if(I.z!==v.z)continue;let P=I.row>v.row?I.row-v.row:v.row-I.row,M=I.col>v.col?I.col-v.col:v.col-I.col;if(P!==1||M!==1)continue;let B=I.row<v.row?I.row:v.row,T=I.col<v.col?I.col:v.col,N=I.row<v.row&&I.col<v.col||I.row>v.row&&I.col>v.col?0:1,D=1^N,L=2*((I.z*(this.rows-1)+B)*f+T),H=L+D,V=this.usedDiagFlat[H],O=this.connIdToRootNet[V]===this.connIdToRootNet[s]&&this.overlapFriendlyRootNets.has(this.connIdToRootNet[s]);if(V!==-1&&V!==s&&!O)continue;let U=L+N;this.usedDiagFlat[U]=s,g.push(U)}for(;this.usedIndicesByConn.length<=s;)this.usedIndicesByConn.push([]);let y=this.usedIndicesByConn[s]??[];for(y.push(...l),this.usedIndicesByConn[s]=y;this.usedDiagIndicesByConn.length<=s;)this.usedDiagIndicesByConn.push([]);let x=this.usedDiagIndicesByConn[s]??[];x.push(...g),this.usedDiagIndicesByConn[s]=x;let C=this.solvedRoutes.get(s)??[];if(C.push({connId:s,startZ:r.z,startRow:r.row,startCol:r.col,startPoint:this.activeConnSeg.startPoint,endZ:i.z,endRow:i.row,endCol:i.col,endPoint:this.activeConnSeg.endPoint,cells:t,viaCells:o}),this.solvedRoutes.set(s,C),this.useExactViaTraceClearance){for(;this.viaCenterIndicesByConn.length<=s;)this.viaCenterIndicesByConn.push([]);let b=this.viaCenterIndicesByConn[s]??[];for(let I of o){let v=I.row*this.cols+I.col,P=this.viaOwnersByCell.get(v)??new Set;P.has(s)||(P.add(s),b.push(v)),this.viaOwnersByCell.set(v,P)}this.viaCenterIndicesByConn[s]=b}for(let b=0;b<_.length;b++)if(this.ripTrace(_[b]),this.failed)return;if(a.length>0||_.length>0){let b=this.penalty2d,I=this.penaltyCap;if(this.totalRipEvents>50)for(let v=0;v<b.length;v++)b[v]=0.99*b[v];else for(let v=0;v<b.length;v++)b[v]>I&&(b[v]=0.5*b[v])}}ripTrace(e){for(;this.ripCount.length<=e;)this.ripCount.push(0);if(this.ripCount[e]++,this.totalRipEvents++,this.totalRipEvents>=this.MAX_RIPS)return this.error=`Convergence failure: exceeded MAX_RIPS ${this.MAX_RIPS}`,void(this.failed=!0);let t=this.solvedRoutes.get(e)??[];if(t.length>0){let i=this.cols;for(let s of t){for(let a=0;a<s.cells.length;a++){let c=s.cells[a],l=c.row*i+c.col;this.penalty2d[l]=this.penalty2d[l]+this.hyperParameters.ripTracePenalty}for(let a=0;a<s.viaCells.length;a++){let c=s.viaCells[a],l=c.row*i+c.col;this.penalty2d[l]=this.penalty2d[l]+this.hyperParameters.ripViaPenalty}}}let n=this.usedIndicesByConn[e];if(n){let i=this.usedCellsFlat;for(let s=0;s<n.length;s++){let a=n[s];i[a]===e&&(i[a]=-1)}this.usedIndicesByConn[e]=[]}let o=this.usedDiagIndicesByConn[e];if(o){let i=this.usedDiagFlat;for(let s=0;s<o.length;s++){let a=o[s];i[a]===e&&(i[a]=-1)}this.usedDiagIndicesByConn[e]=[]}let r=this.viaCenterIndicesByConn[e];if(r){for(let i of r){let s=this.viaOwnersByCell.get(i);s&&(s.delete(e),s.size===0&&this.viaOwnersByCell.delete(i))}this.viaCenterIndicesByConn[e]=[]}if(t.length>0){this.solvedRoutes.delete(e);for(let i of t)this.unsolvedSegs.push({connId:e,startZ:i.startZ,startRow:i.startRow,startCol:i.startCol,startPoint:i.startPoint,endZ:i.endZ,endRow:i.endRow,endCol:i.endCol,endPoint:i.endPoint})}}visualize(){let e=["red","blue","orange","green"],t=[],n=[],o=[],r=[],{width:i,height:s,center:a}=this.nodeWithPortPoints;r.push({center:{x:a.x,y:a.y},width:i,height:s,stroke:"gray"});let c=this.gridToBoundsTransform;if(this.showPenaltyMap&&this.penalty2d){let d=0;for(let u=0;u<this.penalty2d.length;u++)this.penalty2d[u]>d&&(d=this.penalty2d[u]);if(d>0)for(let u=0;u<this.rows;u++)for(let _=0;_<this.cols;_++){let p=this.penalty2d[u*this.cols+_];if(p<=0)continue;let m=Math.min(0.6,p/d*0.6),A=TS(c,{x:this.gridOrigin.x+(_+0.5)*this.cellSizeMm,y:this.gridOrigin.y+(u+0.5)*this.cellSizeMm});r.push({center:A,width:this.cellSizeMm*c.a,height:this.cellSizeMm*c.e,fill:`rgba(255,165,0,${m.toFixed(3)})`})}}if(this.showUsedCellMap&&this.usedCellsFlat)for(let d=0;d<this.layers;d++)for(let u=0;u<this.rows;u++)for(let _=0;_<this.cols;_++){if(this.usedCellsFlat[(d*this.rows+u)*this.cols+_]===-1)continue;let p=TS(c,{x:this.gridOrigin.x+(_+0.5)*this.cellSizeMm,y:this.gridOrigin.y+(u+0.5)*this.cellSizeMm});r.push({center:p,width:this.cellSizeMm*c.a,height:this.cellSizeMm*c.e,fill:"rgba(0,0,255,0.5)"})}for(let d of this.nodeWithPortPoints.portPoints)t.push({x:d.x,y:d.y,color:e[d.z]??"gray",label:d.connectionName});let l=["rgba(255,0,0,0.75)","rgba(0,0,255,0.75)","rgba(255,165,0,0.75)","rgba(0,128,0,0.75)"],h=this.getOutput();for(let d of h){if(d.route.length<2)continue;let u=0;for(let _=1;_<d.route.length;_++){let p=d.route[_-1];d.route[_].z!==p.z&&(_-u>=2&&n.push({points:d.route.slice(u,_).map((m)=>({x:m.x,y:m.y})),strokeColor:l[p.z]??"rgba(128,128,128,0.75)",strokeWidth:this.traceThickness}),u=_)}if(d.route.length-u>=2){let _=d.route[u].z;n.push({points:d.route.slice(u).map((p)=>({x:p.x,y:p.y})),strokeColor:l[_]??"rgba(128,128,128,0.75)",strokeWidth:this.traceThickness})}}for(let d of h)for(let u of d.vias)o.push({center:{x:u.x,y:u.y},radius:this.viaDiameter/2,fill:"rgba(0,0,0,0.3)",stroke:"black"});if(this.activeConnSeg&&this.visitedStamp){let d=this.stamp;for(let u=0;u<this.layers;u++)for(let _=0;_<this.rows;_++)for(let p=0;p<this.cols;p++){if(this.visitedStamp[(u*this.rows+_)*this.cols+p]!==d)continue;let m=TS(c,{x:this.gridOrigin.x+(p+0.5)*this.cellSizeMm,y:this.gridOrigin.y+(_+0.5)*this.cellSizeMm});t.push({x:m.x,y:m.y,color:"rgba(0,0,255,0.2)"})}}return{points:t,lines:n,circles:o,rects:r,coordinateSystem:"cartesian",title:`HighDensityA01 [${this.solvedRoutes?.size??0} solved, ${this.unsolvedSegs?.length??0} remaining]`}}getOutput(){let e=this.gridToBoundsTransform,t=[];for(let[n,o]of this.solvedRoutes??[]){let r=this.connIdToName[n];for(let i of o){let s=i.cells.map((a)=>{let c=this.gridOrigin.x+(a.col+0.5)*this.cellSizeMm,l=this.gridOrigin.y+(a.row+0.5)*this.cellSizeMm,h=TS(e,{x:c,y:l});return{x:h.x,y:h.y,z:this.layerToZ.get(a.z)??a.z}});s.length>0&&(s[0]={...i.startPoint},s.length>1&&(s[s.length-1]={...i.endPoint})),t.push({connectionName:r,rootConnectionName:this.connIdToRootNet[n],regionId:this.nodeWithPortPoints.capacityMeshNodeId,traceThickness:this.traceThickness,viaDiameter:this.viaDiameter,route:s,vias:i.viaCells.map((a)=>{let c=this.gridOrigin.x+(a.col+0.5)*this.cellSizeMm,l=this.gridOrigin.y+(a.row+0.5)*this.cellSizeMm;return TS(e,{x:c,y:l})})})}}return t}},kWe=["left","top","right","bottom","middle"],Qpr=class{f=new Float64Array(1024);seq=new Uint32Array(1024);id=new Int32Array(1024);n=0;push(e,t,n){this.ensureCapacity(this.n+1);let o=this.n++;for(this.f[o]=e,this.seq[o]=t,this.id[o]=n;o>0;){let r=o-1>>1;if(this.less(r,o))break;this.swap(o,r),o=r}}pop(){let e=this.id[0];return this.n--,this.n>0&&(this.f[0]=this.f[this.n],this.seq[0]=this.seq[this.n],this.id[0]=this.id[this.n],this.siftDown(0)),e}get size(){return this.n}clear(){this.n=0}ensureCapacity(e){if(e<=this.f.length)return;let t=this.f.length;for(;t<e;)t*=2;let n=new Float64Array(t);n.set(this.f),this.f=n;let o=new Uint32Array(t);o.set(this.seq),this.seq=o;let r=new Int32Array(t);r.set(this.id),this.id=r}siftDown(e){for(;;){let t=2*e+1,n=t+1;if(t>=this.n)return;let o=t;if(n<this.n&&!this.less(t,n)&&(o=n),this.less(e,o))return;this.swap(e,o),e=o}}less(e,t){let n=this.f[e],o=this.f[t];return n!==o?n<o:this.seq[e]<this.seq[t]}swap(e,t){let n=this.f[e];this.f[e]=this.f[t],this.f[t]=n;let o=this.seq[e];this.seq[e]=this.seq[t],this.seq[t]=o;let r=this.id[e];this.id[e]=this.id[t],this.id[t]=r}},kpr=class{z=new Int32Array(1024);cellId=new Int32Array(1024);g=new Float64Array(1024);parent=new Int32Array(1024);ripHead=new Int32Array(1024).fill(-1);ripCount=new Int32Array(1024);length=0;clear(){this.length=0}push(e,t,n,o,r,i){this.ensureCapacity(this.length+1);let s=this.length++;return this.z[s]=e,this.cellId[s]=t,this.g[s]=n,this.parent[s]=o,this.ripHead[s]=r,this.ripCount[s]=i,s}ensureCapacity(e){if(e<=this.z.length)return;let t=this.z.length;for(;t<e;)t*=2;let n=new Int32Array(t);n.set(this.z),this.z=n;let o=new Int32Array(t);o.set(this.cellId),this.cellId=o;let r=new Float64Array(t);r.set(this.g),this.g=r;let i=new Int32Array(t);i.set(this.parent),this.parent=i;let s=new Int32Array(t);s.fill(-1),s.set(this.ripHead.subarray(0,this.length)),this.ripHead=s;let a=new Int32Array(t);a.set(this.ripCount.subarray(0,this.length)),this.ripCount=a}},Lpr=class{connId=new Int32Array(1024);prev=new Int32Array(1024).fill(-1);length=0;clear(){this.length=0}append(e,t){this.ensureCapacity(this.length+1);let n=this.length++;return this.connId[n]=t,this.prev[n]=e,n}contains(e,t){for(let n=e;n>=0;n=this.prev[n])if(this.connId[n]===t)return!0;return!1}collect(e,t){t.length=0;for(let n=e;n>=0;n=this.prev[n])t.push(this.connId[n])}ensureCapacity(e){if(e<=this.connId.length)return;let t=this.connId.length;for(;t<e;)t*=2;let n=new Int32Array(t);n.set(this.connId),this.connId=n;let o=new Int32Array(t);o.fill(-1),o.set(this.prev.subarray(0,this.length)),this.prev=o}};function SS(e,t,n){return Math.max(t,Math.min(n,e))}function x4e(e,t){for(let n=0;n<e.length;n++)if(e[n]===t)return;e.push(t)}function WLt(e,t){for(let n=0;n<e.length;n++)if(e[n].cellId===t.cellId)return;e.push(t)}function LWe(e,t,n,o,r,i,s){let a=e-SS(e,o,i),c=t-SS(t,r,s);return a*a+c*c<=n*n}var XLt,C4e=class extends Da{getSolverName(){return"HighDensitySolverA03"}nodeWithPortPoints;highResolutionCellSize;highResolutionCellThickness;lowResolutionCellSize;viaDiameter;MAX_RIPS;maxCellCount;traceThickness;traceMargin;viaMinDistFromBorder;showPenaltyMap;showUsedCellMap;effort;enableDiagonalMoves;stepMultiplier;hyperParameters;initialPenaltyFn;boundsMinX;boundsMaxX;boundsMinY;boundsMaxY;gridToBoundsTransform;availableZ;zToLayer;layerToZ;layers;fineRows;fineCols;lowScale;bandRows;bandCols;regions;planeSize;cellCenterX;cellCenterY;cellMinX;cellMinY;cellMaxX;cellMaxY;cellWidth;cellHeight;cellRegion;cellRow;cellCol;viaAllowed;neighborOffset;neighborIds;neighborCosts;usedCellsFlat;sharedCellsFlat;portOwnerFlat;penalty2d;ripStateBuckets;visitedStamp;bestGStamp;bestGValue;visitedFlatStamp;sharedCrossRootPortFlat;stamp=0;connNameToId;connIdToName;connIdToRootNet;overlapFriendlyRootNets;usedIndicesByConn;unsolvedSegs;solvedRoutes;activeConnSeg=null;activeConnId=-1;nodePool;heap;ripChain;seqCounter=0;_viaOccs=[];viaOccupantsByCell=new Map;_cellOccs=[];_rippedIds=[];ripCount;totalRipEvents=0;searchIterations=0;consecutiveSkips=0;penaltyCap;baseSearchBudgetIters;_moveCost=0;_moveRippedHead=-1;_moveRipCount=0;traceKeepoutRadius;viaKeepoutRadius;get unsolvedConnections(){return this.unsolvedSegs}get solvedConnectionsMap(){let e=new Map;for(let t=0;t<this.solvedRoutes.length;t++){let n=this.getSolvedRoutesForConn(t);n.length>0&&e.set(t,n)}return e}get activeConnection(){if(!this.activeConnSeg)return null;let e=this.activeConnSeg.startCellId,t=this.activeConnSeg.endCellId;return{connectionName:this.connIdToName[this.activeConnSeg.connId]??"",start:{cellId:e,region:kWe[this.cellRegion[e]],row:this.cellRow[e],col:this.cellCol[e],x:this.cellCenterX[e],y:this.cellCenterY[e],z:this.activeConnSeg.startZ},end:{cellId:t,region:kWe[this.cellRegion[t]],row:this.cellRow[t],col:this.cellCol[t],x:this.cellCenterX[t],y:this.cellCenterY[t],z:this.activeConnSeg.endZ}}}get openSet(){return{length:this.heap?.size??0}}get gridStats(){return{cells:this.planeSize||0,layers:this.layers||0,states:(this.planeSize||0)*(this.layers||0),ripStateBuckets:this.ripStateBuckets||0,neighborEdges:this.neighborIds?.length??0,regionCounts:this.regions?Object.fromEntries(this.regions.map((e)=>[e.name,e.rows*e.cols])):{}}}constructor(e){super(),this.nodeWithPortPoints=e.nodeWithPortPoints,this.highResolutionCellSize=e.highResolutionCellSize??0.1,this.highResolutionCellThickness=Math.max(1,Math.floor(e.highResolutionCellThickness??8)),this.lowResolutionCellSize=e.lowResolutionCellSize??0.4,this.viaDiameter=e.viaDiameter,this.maxCellCount=e.maxCellCount,this.traceThickness=e.traceThickness??0.1,this.traceMargin=e.traceMargin??0.15,this.viaMinDistFromBorder=e.viaMinDistFromBorder??0.15,this.showPenaltyMap=e.showPenaltyMap??!1,this.showUsedCellMap=e.showUsedCellMap??!1,this.effort=e.effort??1,this.enableDiagonalMoves=e.enableDiagonalMoves??!1,this.stepMultiplier=Math.max(1,Math.floor(e.stepMultiplier??1)),this.hyperParameters={shuffleSeed:0,ripCost:8,ripTracePenalty:0.5,ripViaPenalty:0.75,viaBaseCost:0.1,greedyMultiplier:1.5,...e.hyperParameters},this.MAX_ITERATIONS=1e8,this.MAX_RIPS=200,this.initialPenaltyFn=e.initialPenaltyFn}getConstructorParams(){return[{nodeWithPortPoints:this.nodeWithPortPoints,highResolutionCellSize:this.highResolutionCellSize,highResolutionCellThickness:this.highResolutionCellThickness,lowResolutionCellSize:this.lowResolutionCellSize,viaDiameter:this.viaDiameter,maxCellCount:this.maxCellCount,stepMultiplier:this.stepMultiplier,traceThickness:this.traceThickness,traceMargin:this.traceMargin,viaMinDistFromBorder:this.viaMinDistFromBorder,showPenaltyMap:this.showPenaltyMap,showUsedCellMap:this.showUsedCellMap,effort:this.effort,enableDiagonalMoves:this.enableDiagonalMoves,hyperParameters:this.hyperParameters,initialPenaltyFn:this.initialPenaltyFn}]}_setup(){let{nodeWithPortPoints:e}=this,{width:t,height:n,center:o}=e,r=this.lowResolutionCellSize/this.highResolutionCellSize,i=Math.round(r);if(!Number.isFinite(r)||r<=0||Math.abs(r-i)>0.000000001)return this.error="lowResolutionCellSize must be a positive integer multiple of highResolutionCellSize",void(this.failed=!0);this.lowScale=Math.max(1,i),this.availableZ=e.availableZ??[...new Set(e.portPoints.map((u)=>u.z))].sort((u,_)=>u-_),this.layers=this.availableZ.length,this.zToLayer=new Map,this.layerToZ=new Map;for(let u=0;u<this.availableZ.length;u++){let _=this.availableZ[u];this.zToLayer.set(_,u),this.layerToZ.set(u,_)}this.boundsMinX=o.x-t/2,this.boundsMaxX=o.x+t/2,this.boundsMinY=o.y-n/2,this.boundsMaxY=o.y+n/2,this.traceKeepoutRadius=this.traceMargin+this.traceThickness/2,this.viaKeepoutRadius=this.viaDiameter/2+this.traceKeepoutRadius,this.buildFiveRegionGrid(t,n),this.gridToBoundsTransform=this.computeGridToBoundsTransform();let s=this.layers*this.planeSize;if(this.maxCellCount!==void 0&&s>this.maxCellCount)return this.error=`Cell count ${s} exceeds maxCellCount ${this.maxCellCount}`,void(this.failed=!0);this.connNameToId=new Map,this.connIdToName=[],this.connIdToRootNet=[],this.overlapFriendlyRootNets=new Set,this.unsolvedSegs=this.buildConnectionSegs(),this.penalty2d=new Float64Array(this.planeSize);let a=t>0?1/t:0,c=n>0?1/n:0;for(let u=0;u<this.planeSize;u++){let _=0;this.initialPenaltyFn&&(_+=this.initialPenaltyFn({x:this.cellCenterX[u],y:this.cellCenterY[u],px:(this.cellCenterX[u]-this.boundsMinX)*a,py:(this.cellCenterY[u]-this.boundsMinY)*c,cellId:u,region:kWe[this.cellRegion[u]],row:this.cellRow[u],col:this.cellCol[u]})),this.penalty2d[u]=_}this.usedCellsFlat=new Int32Array(s).fill(-1),this.sharedCellsFlat=Array.from({length:s},()=>{}),this.portOwnerFlat=new Int32Array(s).fill(-1),this.sharedCrossRootPortFlat=new Uint8Array(s),this.ripStateBuckets=1;let l=s;this.visitedStamp=new Uint32Array(l),this.bestGStamp=new Uint32Array(l),this.bestGValue=new Float64Array(l),this.visitedFlatStamp=new Uint32Array(s),this.stamp=0;let h=new Map;for(let u of this.nodeWithPortPoints.portPoints){let _=this.connNameToId.get(u.connectionName);if(_===void 0)continue;let p=this.pointToCell(u),m=p.z*this.planeSize+p.cellId,A=this.connIdToRootNet[_],g=h.get(m);g===void 0?h.set(m,A):g!==A&&(this.sharedCrossRootPortFlat[m]=1);let f=this.portOwnerFlat[m];this.portOwnerFlat[m]=f===-1||f===_?_:-2}this.solvedRoutes=[],this.usedIndicesByConn=[],this.ripCount=[],this.consecutiveSkips=0,this.penaltyCap=0.5*this.hyperParameters.ripCost,this.shuffleConnections();let d=NUt({planeSize:this.planeSize,layers:this.layers,connectionCount:this.unsolvedSegs.length,effort:this.effort,maxIterations:this.MAX_ITERATIONS});this.baseSearchBudgetIters=d.baseSearchBudgetIters,this.MAX_ITERATIONS=d.maxIterationsIters,this.activeConnSeg=null,this.activeConnId=-1,this.nodePool=new kpr,this.heap=new Qpr,this.ripChain=new Lpr,this.seqCounter=0}_step(){for(let e=0;e<this.stepMultiplier;e++){if(this.solved||this.failed)return;this.stepOnce()}}buildFiveRegionGrid(e,t){this.fineCols=Math.max(1,Math.ceil(e/this.highResolutionCellSize)),this.fineRows=Math.max(1,Math.ceil(t/this.highResolutionCellSize)),this.bandCols=Math.min(this.highResolutionCellThickness,Math.floor(this.fineCols/2)),this.bandRows=Math.min(this.highResolutionCellThickness,Math.floor(this.fineRows/2));let n=Math.max(0,this.fineCols-2*this.bandCols),o=Math.max(0,this.fineRows-2*this.bandRows),r=n,i=n;this.regions=[{id:0,name:"left",fineOriginRow:0,fineOriginCol:0,fineRows:this.fineRows,fineCols:this.bandCols,cellScale:1,rows:this.fineRows,cols:this.bandCols,offset:0},{id:1,name:"top",fineOriginRow:0,fineOriginCol:this.bandCols,fineRows:this.bandRows,fineCols:r,cellScale:1,rows:this.bandRows,cols:r,offset:0},{id:2,name:"right",fineOriginRow:0,fineOriginCol:this.fineCols-this.bandCols,fineRows:this.fineRows,fineCols:this.bandCols,cellScale:1,rows:this.fineRows,cols:this.bandCols,offset:0},{id:3,name:"bottom",fineOriginRow:this.fineRows-this.bandRows,fineOriginCol:this.bandCols,fineRows:this.bandRows,fineCols:i,cellScale:1,rows:this.bandRows,cols:i,offset:0},{id:4,name:"middle",fineOriginRow:this.bandRows,fineOriginCol:this.bandCols,fineRows:o,fineCols:n,cellScale:this.lowScale,rows:o>0?Math.ceil(o/this.lowScale):0,cols:n>0?Math.ceil(n/this.lowScale):0,offset:0}];let s=0;for(let x=0;x<this.regions.length;x++)this.regions[x].offset=s,s+=this.regions[x].rows*this.regions[x].cols;this.planeSize=s,this.cellCenterX=new Float64Array(this.planeSize),this.cellCenterY=new Float64Array(this.planeSize),this.cellMinX=new Float64Array(this.planeSize),this.cellMinY=new Float64Array(this.planeSize),this.cellMaxX=new Float64Array(this.planeSize),this.cellMaxY=new Float64Array(this.planeSize),this.cellWidth=new Float64Array(this.planeSize),this.cellHeight=new Float64Array(this.planeSize),this.cellRegion=new Uint8Array(this.planeSize),this.cellRow=new Int32Array(this.planeSize),this.cellCol=new Int32Array(this.planeSize),this.viaAllowed=new Uint8Array(this.planeSize);for(let x=0;x<this.regions.length;x++){let C=this.regions[x];for(let b=0;b<C.rows;b++){let I=C.fineOriginRow+b*C.cellScale,v=Math.min(C.fineOriginRow+C.fineRows,I+C.cellScale),P=this.boundsMinY+I*this.highResolutionCellSize,M=Math.min(this.boundsMaxY,this.boundsMinY+v*this.highResolutionCellSize);for(let B=0;B<C.cols;B++){let T=C.fineOriginCol+B*C.cellScale,N=Math.min(C.fineOriginCol+C.fineCols,T+C.cellScale),D=this.boundsMinX+T*this.highResolutionCellSize,L=Math.min(this.boundsMaxX,this.boundsMinX+N*this.highResolutionCellSize),H=this.cellIdFor(C.id,b,B);this.cellCenterX[H]=(D+L)/2,this.cellCenterY[H]=(P+M)/2,this.cellMinX[H]=D,this.cellMinY[H]=P,this.cellMaxX[H]=L,this.cellMaxY[H]=M,this.cellWidth[H]=L-D,this.cellHeight[H]=M-P,this.cellRegion[H]=C.id,this.cellRow[H]=b,this.cellCol[H]=B;let V=Math.min(this.cellCenterX[H]-this.boundsMinX,this.boundsMaxX-this.cellCenterX[H],this.cellCenterY[H]-this.boundsMinY,this.boundsMaxY-this.cellCenterY[H]);this.viaAllowed[H]=V>=this.viaMinDistFromBorder?1:0}}}let a=Array.from({length:this.planeSize},()=>[]),c=(x,C)=>{if(x===C||x<0||C<0)return;let b=this.cellCenterX[x]-this.cellCenterX[C],I=this.cellCenterY[x]-this.cellCenterY[C],v=Math.hypot(b,I);WLt(a[x],{cellId:C,cost:v}),WLt(a[C],{cellId:x,cost:v})};for(let x=0;x<this.regions.length;x++){let C=this.regions[x];for(let b=0;b<C.rows;b++)for(let I=0;I<C.cols;I++){let v=this.cellIdFor(C.id,b,I);b+1<C.rows&&c(v,this.cellIdFor(C.id,b+1,I)),I+1<C.cols&&c(v,this.cellIdFor(C.id,b,I+1)),this.enableDiagonalMoves&&b+1<C.rows&&(I+1<C.cols&&c(v,this.cellIdFor(C.id,b+1,I+1)),I>0&&c(v,this.cellIdFor(C.id,b+1,I-1)))}}let l=this.regions[0],h=this.regions[1],d=this.regions[2],u=this.regions[3],_=this.regions[4],p=l.rows>0&&l.cols>0,m=h.rows>0&&h.cols>0,A=d.rows>0&&d.cols>0,g=u.rows>0&&u.cols>0,f=_.rows>0&&_.cols>0;if(p&&m)for(let x=0;x<this.bandRows;x++)c(this.cellIdFor(0,x,l.cols-1),this.cellIdFor(1,x,0));if(m&&A)for(let x=0;x<this.bandRows;x++)c(this.cellIdFor(1,x,h.cols-1),this.cellIdFor(2,x,0));if(p&&g)for(let x=this.fineRows-this.bandRows;x<this.fineRows;x++)c(this.cellIdFor(0,x,l.cols-1),this.cellIdFor(3,x-(this.fineRows-this.bandRows),0));if(g&&A)for(let x=this.fineRows-this.bandRows;x<this.fineRows;x++)c(this.cellIdFor(3,x-(this.fineRows-this.bandRows),u.cols-1),this.cellIdFor(2,x,0));if(p&&f)for(let x=this.bandRows;x<this.fineRows-this.bandRows;x++)c(this.cellIdFor(0,x,l.cols-1),this.cellIdFor(4,Math.floor((x-this.bandRows)/this.lowScale),0));if(A&&f)for(let x=this.bandRows;x<this.fineRows-this.bandRows;x++)c(this.cellIdFor(4,Math.floor((x-this.bandRows)/this.lowScale),_.cols-1),this.cellIdFor(2,x,0));if(m&&f)for(let x=this.bandCols;x<this.fineCols-this.bandCols;x++)c(this.cellIdFor(1,h.rows-1,x-this.bandCols),this.cellIdFor(4,0,Math.floor((x-this.bandCols)/this.lowScale)));if(g&&f)for(let x=this.bandCols;x<this.fineCols-this.bandCols;x++)c(this.cellIdFor(4,_.rows-1,Math.floor((x-this.bandCols)/this.lowScale)),this.cellIdFor(3,0,x-this.bandCols));if(!f&&!m&&!g&&p&&A)for(let x=0;x<Math.min(l.rows,d.rows);x++)c(this.cellIdFor(0,x,l.cols-1),this.cellIdFor(2,x,0));if(!f&&!p&&!A&&m&&g)for(let x=0;x<Math.min(h.cols,u.cols);x++)c(this.cellIdFor(1,h.rows-1,x),this.cellIdFor(3,0,x));let y=this.flattenNeighborLists(a);this.neighborOffset=y.offset,this.neighborIds=y.ids,this.neighborCosts=y.costs}cellIdFor(e,t,n){let o=this.regions[e];return o.offset+t*o.cols+n}stepOnce(){if(!this.activeConnSeg){if(this.unsolvedSegs.length===0)return void(this.solved=!0);let f=this.unsolvedSegs.shift();this.activeConnSeg=f,this.activeConnId=f.connId,this.viaOccupantsByCell.clear(),this.nodePool.clear(),this.ripChain.clear(),this.heap.clear(),this.seqCounter=0,this.searchIterations=0,this.nextStamp();let y=this.computeH(f.startZ,f.startCellId,f.endZ,f.endCellId)*this.hyperParameters.greedyMultiplier,x=this.nodePool.push(f.startZ,f.startCellId,0,-1,-1,0),C=f.startZ*this.planeSize+f.startCellId,b=this.getSearchStateIdx(C,0);return this.bestGStamp[b]=this.stamp,this.bestGValue[b]=0,void this.heap.push(y,this.seqCounter++,x)}this.searchIterations++;let e=this.ripCount[this.activeConnId]??0,t=Math.round(this.baseSearchBudgetIters*(1+0.25*Math.min(e,10)));if(this.searchIterations>t){let f=this.penalty2d;for(let y=0;y<f.length;y++)f[y]=0.9*f[y];return this.unsolvedSegs.push(this.activeConnSeg),this.activeConnSeg=null,this.activeConnId=-1,this.heap.clear(),this.nodePool.clear(),this.consecutiveSkips++,void(this.consecutiveSkips>=Math.max(3,3*this.unsolvedSegs.length)&&(this.error=`Convergence failure: ${this.unsolvedSegs.length} connections stuck`,this.failed=!0))}if(this.heap.size===0)return this.error=`No path found for ${this.connIdToName[this.activeConnId]}`,void(this.failed=!0);let n=this.heap.pop(),o=this.nodePool.z[n],r=this.nodePool.cellId[n],i=this.nodePool.g[n],s=this.nodePool.ripHead[n],a=this.nodePool.ripCount[n],c=o*this.planeSize+r,l=this.getSearchStateIdx(c,a);if(this.visitedStamp[l]===this.stamp)return;this.visitedStamp[l]=this.stamp,this.visitedFlatStamp[c]=this.stamp;let h=this.activeConnSeg;if(o===h.endZ&&r===h.endCellId)return this.finalizeRoute(n),this.activeConnSeg=null,void(this.activeConnId=-1);let d=this.visitedStamp,u=this.stamp,_=this.activeConnId,{endZ:p,endCellId:m}=h,A=this.neighborOffset[r],g=this.neighborOffset[r+1];for(let f=A;f<g;f++){let y=this.neighborIds[f],x=o*this.planeSize+y;if(this.computeMoveCostAndRips(_,o,y,!1,s,a,this.neighborCosts[f]),this._moveCost<0)continue;let C=this.getSearchStateIdx(x,this._moveRipCount);if(d[C]===u)continue;let b=i+this._moveCost;if(this.bestGStamp[C]===u&&b>=this.bestGValue[C])continue;this.bestGStamp[C]=u,this.bestGValue[C]=b;let I=b+this.computeH(o,y,p,m)*this.hyperParameters.greedyMultiplier,v=this.nodePool.push(o,y,b,n,this._moveRippedHead,this._moveRipCount);this.heap.push(I,this.seqCounter++,v)}if(this.viaAllowed[r])for(let f=0;f<this.layers;f++){if(f===o)continue;let y=f*this.planeSize+r;if(this.computeMoveCostAndRips(_,f,r,!0,s,a,0),this._moveCost<0)continue;let x=this.getSearchStateIdx(y,this._moveRipCount);if(d[x]===u)continue;let C=i+this._moveCost;if(this.bestGStamp[x]===u&&C>=this.bestGValue[x])continue;this.bestGStamp[x]=u,this.bestGValue[x]=C;let b=C+this.computeH(f,r,p,m)*this.hyperParameters.greedyMultiplier,I=this.nodePool.push(f,r,C,n,this._moveRippedHead,this._moveRipCount);this.heap.push(b,this.seqCounter++,I)}}computeMoveCostAndRips(e,t,n,o,r,i,s){let a=0,c=r,l=i,h=t*this.planeSize+n;if(o){a+=this.hyperParameters.viaBaseCost,a+=Math.min(this.penalty2d[n],this.penaltyCap);let d=this.portOwnerFlat[h],u=this.allowSharedUse(e,d),_=this.activeConnSeg,p=!!_&&t===_.endZ&&n===_.endCellId;if(d>=0&&d!==e&&!u&&!p)return this._moveCost=-1,void(this._moveRippedHead=c);this.fillViaOccupants(n,e);let m=this._viaOccs;for(let A=0;A<m.length;A++){let g=m[A];this.ripChain.contains(c,g)||(a+=this.hyperParameters.ripCost,c=this.ripChain.append(c,g),l++),a+=this.hyperParameters.ripViaPenalty}}else{a+=s,a+=Math.min(this.penalty2d[n],this.penaltyCap);let d=this.portOwnerFlat[h],u=this.allowSharedUse(e,d),_=this.activeConnSeg,p=!!_&&t===_.endZ&&n===_.endCellId;if(d>=0&&d!==e&&!u&&!p)return this._moveCost=-1,void(this._moveRippedHead=c);this.fillTraceOccupants(h,e,this._cellOccs);for(let m=0;m<this._cellOccs.length;m++){let A=this._cellOccs[m];this.ripChain.contains(c,A)||(a+=this.hyperParameters.ripCost,c=this.ripChain.append(c,A),l++),a+=this.hyperParameters.ripTracePenalty}}this._moveCost=a,this._moveRippedHead=c,this._moveRipCount=l}fillViaOccupants(e,t){let n=this._viaOccs;n.length=0;let o=this.viaOccupantsByCell.get(e);if(o){for(let s of o)n.push(s);return}let r=this.cellCenterX[e],i=this.cellCenterY[e];this.forEachCellNearCircle(r,i,this.viaKeepoutRadius,(s)=>{if(LWe(r,i,this.viaKeepoutRadius,this.cellMinX[s],this.cellMinY[s],this.cellMaxX[s],this.cellMaxY[s]))for(let a=0;a<this.layers;a++)this.pushFlatOccupants(a*this.planeSize+s,t,n)}),this.viaOccupantsByCell.set(e,n.slice())}fillTraceOccupants(e,t,n){n.length=0,this.pushFlatOccupants(e,t,n)}pushFlatOccupants(e,t,n){let o=this.usedCellsFlat[e];o===-1||o===t||this.allowSharedUse(t,o)||x4e(n,o);let r=this.sharedCellsFlat[e];if(r)for(let i=0;i<r.length;i++){let s=r[i];s!==t&&(this.allowSharedUse(t,s)||x4e(n,s))}}addSharedOccupant(e,t){if(this.usedCellsFlat[e]===t)return;let n=this.sharedCellsFlat[e];n||(n=[],this.sharedCellsFlat[e]=n),x4e(n,t)}replaceOccupants(e,t){this.usedCellsFlat[e]=t,this.sharedCellsFlat[e]=void 0}removeOccupant(e,t){let n=this.sharedCellsFlat[e];if(this.usedCellsFlat[e]===t)return void(n&&n.length>0?(this.usedCellsFlat[e]=n.pop(),n.length===0&&(this.sharedCellsFlat[e]=void 0)):this.usedCellsFlat[e]=-1);if(!n)return;let o=n.indexOf(t);o!==-1&&(n.splice(o,1),n.length===0&&(this.sharedCellsFlat[e]=void 0))}allowSharedUse(e,t){if(t<0)return!1;return this.connIdToRootNet[t]===this.connIdToRootNet[e]}shouldSkipFixedPortHalo(e,t){let n=this.portOwnerFlat[e];return n!==t&&(n===-2||!(n<0)&&!this.allowSharedUse(t,n))}nextStamp(){this.stamp=this.stamp+1>>>0,this.stamp===0&&(this.visitedStamp.fill(0),this.bestGStamp.fill(0),this.visitedFlatStamp.fill(0),this.stamp=1)}getSearchStateIdx(e,t){return e}computeH(e,t,n,o){let r=Math.hypot(this.cellCenterX[t]-this.cellCenterX[o],this.cellCenterY[t]-this.cellCenterY[o]);return e===n?r:r+this.hyperParameters.viaBaseCost}internConn(e,t){let n=this.connNameToId.get(e);if(n!==void 0)return n;let o=this.connIdToName.length;var r;return this.connIdToName.push(e),this.connIdToRootNet.push((r=e,t??r.replace(/_mst\d+$/,""))),this.connNameToId.set(e,o),o}buildConnectionSegs(){let e=new Map;for(let o of this.nodeWithPortPoints.portPoints){let r=o.connectionName;e.has(r)||e.set(r,{points:[],rootConnectionName:o.rootConnectionName}),e.get(r).points.push(o)}let t=[],n=new Set;for(let[o,r]of e){let i=r.points,s=DUt(i);if(s.length===0)continue;let a=this.internConn(o,r.rootConnectionName);for(let[c,l]of s){let h=this.pointToCell(c),d=this.pointToCell(l),u=`${h.z}:${h.cellId}`,_=`${d.z}:${d.cellId}`,p=u<_?`${u}|${_}`:`${_}|${u}`,m=r.rootConnectionName??o,A=`${m}|${p}`;n.has(A)?this.overlapFriendlyRootNets.add(m):(n.add(A),t.push({connId:a,startZ:h.z,startCellId:h.cellId,startPoint:c,endZ:d.z,endCellId:d.cellId,endPoint:l}))}}return t}pointToCell(e){let t=SS(Math.floor((e.x-this.boundsMinX)/this.highResolutionCellSize),0,this.fineCols-1),n=SS(Math.floor((e.y-this.boundsMinY)/this.highResolutionCellSize),0,this.fineRows-1),o=4;t<this.bandCols?o=0:t>=this.fineCols-this.bandCols?o=2:n<this.bandRows?o=1:n>=this.fineRows-this.bandRows&&(o=3);let r=this.regions[o],i=n-r.fineOriginRow,s=t-r.fineOriginCol,a=SS(Math.floor(i/r.cellScale),0,Math.max(0,r.rows-1)),c=SS(Math.floor(s/r.cellScale),0,Math.max(0,r.cols-1));return{z:this.zToLayer.get(e.z)??0,cellId:this.cellIdFor(o,a,c)}}shuffleConnections(){let e=this.unsolvedSegs,t=this.hyperParameters.shuffleSeed>>>0,n=()=>(t=Math.imul(t,1664525)+1013904223>>>0,t/4294967295);for(let o=e.length-1;o>0;o--){let r=Math.floor(n()*(o+1)),i=e[o];e[o]=e[r],e[r]=i}}finalizeRoute(e){this.consecutiveSkips=Math.max(0,this.consecutiveSkips-1);let t=[],n=e;for(;n>=0;){let l=this.nodePool.z[n],h=this.nodePool.cellId[n];t.push(l*this.planeSize+h),n=this.nodePool.parent[n]}for(t.reverse();t.length>1&&this.sharedCrossRootPortFlat[t[0]];)t.shift();for(;t.length>1&&this.sharedCrossRootPortFlat[t[t.length-1]];)t.pop();let o=this.extractViaCellIds(t),r=this.activeConnId;this.ripChain.collect(this.nodePool.ripHead[e],this._rippedIds);for(let l=0;l<this._rippedIds.length;l++)if(this.ripTrace(this._rippedIds[l]),this.failed)return;let i=[];for(let l=0;l<t.length;l++){let h=t[l],d=Math.floor(h/this.planeSize),u=h-d*this.planeSize;this.markTraceFootprint(r,d,u,i)}let s=[];for(let l=0;l<o.length;l++)this.markViaFootprint(r,o[l],i,s);for(;this.usedIndicesByConn.length<=r;)this.usedIndicesByConn.push(void 0);let a=this.usedIndicesByConn[r]??[];for(a.push(...i),this.usedIndicesByConn[r]=a;this.solvedRoutes.length<=r;)this.solvedRoutes.push(void 0);let c=this.solvedRoutes[r]??[];c.push({connId:r,states:Int32Array.from(t),viaCellIds:Int32Array.from(o),startPoint:this.activeConnSeg.startPoint,endPoint:this.activeConnSeg.endPoint}),this.solvedRoutes[r]=c;for(let l=0;l<s.length;l++)if(this.ripTrace(s[l]),this.failed)return;if(this._rippedIds.length>0||s.length>0){let l=this.penalty2d,h=this.penaltyCap;if(this.totalRipEvents>50)for(let d=0;d<l.length;d++)l[d]=0.99*l[d];else for(let d=0;d<l.length;d++)l[d]>h&&(l[d]=0.5*l[d])}}extractViaCellIds(e){let t=[];for(let n=1;n<e.length;n++){let o=e[n-1],r=e[n],i=Math.floor(o/this.planeSize),s=Math.floor(r/this.planeSize);i!==s&&t.push(r-s*this.planeSize)}return t}markTraceFootprint(e,t,n,o){let r=this.cellCenterX[n],i=this.cellCenterY[n];this.forEachCellNearCircle(r,i,this.traceKeepoutRadius,(s)=>{if(!LWe(r,i,this.traceKeepoutRadius,this.cellMinX[s],this.cellMinY[s],this.cellMaxX[s],this.cellMaxY[s]))return;let a=t*this.planeSize+s;if(s!==n&&this.shouldSkipFixedPortHalo(a,e))return;let c=this.usedCellsFlat[a],l=this.allowSharedUse(e,c);(c===-1||c===e||l)&&(c!==-1&&c!==e?this.addSharedOccupant(a,e):this.usedCellsFlat[a]=e,o.push(a))})}markViaFootprint(e,t,n,o){let r=this.cellCenterX[t],i=this.cellCenterY[t];this.forEachCellNearCircle(r,i,this.viaKeepoutRadius,(s)=>{if(LWe(r,i,this.viaKeepoutRadius,this.cellMinX[s],this.cellMinY[s],this.cellMaxX[s],this.cellMaxY[s]))for(let a=0;a<this.layers;a++){let c=a*this.planeSize+s;if(s!==t&&this.shouldSkipFixedPortHalo(c,e))continue;if(this.fillTraceOccupants(c,e,this._cellOccs),this._cellOccs.length>0){for(let h=0;h<this._cellOccs.length;h++)x4e(o,this._cellOccs[h]);this.replaceOccupants(c,e),n.push(c);continue}let l=this.usedCellsFlat[c];l!==-1&&l!==e?this.addSharedOccupant(c,e):this.usedCellsFlat[c]=e,n.push(c)}})}forEachCellNearCircle(e,t,n,o){let r=SS(Math.floor((e-n-this.boundsMinX)/this.highResolutionCellSize),0,this.fineCols-1),i=SS(Math.floor((e+n-this.boundsMinX)/this.highResolutionCellSize),0,this.fineCols-1),s=SS(Math.floor((t-n-this.boundsMinY)/this.highResolutionCellSize),0,this.fineRows-1),a=SS(Math.floor((t+n-this.boundsMinY)/this.highResolutionCellSize),0,this.fineRows-1);for(let c=0;c<this.regions.length;c++){let l=this.regions[c];if(l.rows===0||l.cols===0)continue;let h=Math.max(s,l.fineOriginRow),d=Math.min(a,l.fineOriginRow+l.fineRows-1),u=Math.max(r,l.fineOriginCol),_=Math.min(i,l.fineOriginCol+l.fineCols-1);if(h>d)continue;if(u>_)continue;let p=Math.floor((h-l.fineOriginRow)/l.cellScale),m=Math.floor((d-l.fineOriginRow)/l.cellScale),A=Math.floor((u-l.fineOriginCol)/l.cellScale),g=Math.floor((_-l.fineOriginCol)/l.cellScale);for(let f=p;f<=m;f++)for(let y=A;y<=g;y++)o(this.cellIdFor(l.id,f,y))}}ripTrace(e){for(;this.ripCount.length<=e;)this.ripCount.push(0);if(this.ripCount[e]++,this.totalRipEvents++,this.totalRipEvents>=this.MAX_RIPS)return this.error=`Convergence failure: exceeded MAX_RIPS ${this.MAX_RIPS}`,void(this.failed=!0);let t=this.getSolvedRoutesForConn(e);if(t.length>0)for(let o of t){for(let r=0;r<o.states.length;r++){let i=o.states[r]%this.planeSize;this.penalty2d[i]=this.penalty2d[i]+this.hyperParameters.ripTracePenalty}for(let r=0;r<o.viaCellIds.length;r++){let i=o.viaCellIds[r];this.penalty2d[i]=this.penalty2d[i]+this.hyperParameters.ripViaPenalty}}let n=this.usedIndicesByConn[e];if(n){for(let o=0;o<n.length;o++)this.removeOccupant(n[o],e);this.usedIndicesByConn[e]=void 0}if(t.length>0){this.solvedRoutes[e]=void 0;for(let o of t){let r=o.states[0],i=o.states[o.states.length-1],s=Math.floor(r/this.planeSize),a=Math.floor(i/this.planeSize);this.unsolvedSegs.push({connId:e,startZ:s,startCellId:r-s*this.planeSize,startPoint:o.startPoint,endZ:a,endCellId:i-a*this.planeSize,endPoint:o.endPoint})}}}flattenNeighborLists(e){let t=new Int32Array(e.length+1),n=0;for(let s=0;s<e.length;s++)t[s]=n,n+=e[s].length;t[e.length]=n;let o=new Int32Array(n),r=new Float32Array(n),i=0;for(let s=0;s<e.length;s++){let a=e[s];for(let c=0;c<a.length;c++){let l=a[c];o[i]=l.cellId,r[i]=l.cost,i++}}return{offset:t,ids:o,costs:r}}visualize(){let e=["red","blue","orange","green"],t=this.gridToBoundsTransform,n=[],o=[],r=[],i=[];if(i.push({center:{x:this.nodeWithPortPoints.center.x,y:this.nodeWithPortPoints.center.y},width:this.nodeWithPortPoints.width,height:this.nodeWithPortPoints.height,stroke:"gray"}),this.showPenaltyMap&&this.penalty2d){let c=0;for(let l=0;l<this.penalty2d.length;l++)this.penalty2d[l]>c&&(c=this.penalty2d[l]);if(c>0)for(let l=0;l<this.planeSize;l++){let h=this.penalty2d[l];if(h<=0)continue;let d=TS(t,{x:this.cellCenterX[l],y:this.cellCenterY[l]}),u=Math.min(0.6,h/c*0.6);i.push({center:d,width:this.cellWidth[l]*t.a,height:this.cellHeight[l]*t.e,fill:`rgba(255,165,0,${u.toFixed(3)})`})}}if(this.showUsedCellMap&&this.usedCellsFlat)for(let c=0;c<this.layers;c++){let l=c*this.planeSize;for(let h=0;h<this.planeSize;h++){if(this.usedCellsFlat[l+h]===-1)continue;let d=TS(t,{x:this.cellCenterX[h],y:this.cellCenterY[h]});i.push({center:d,width:this.cellWidth[h]*t.a,height:this.cellHeight[h]*t.e,fill:"rgba(0,0,255,0.5)"})}}for(let c of this.nodeWithPortPoints.portPoints)n.push({x:c.x,y:c.y,color:e[c.z]??"gray",label:c.connectionName});let s=["rgba(255,0,0,0.75)","rgba(0,0,255,0.75)","rgba(255,165,0,0.75)","rgba(0,128,0,0.75)"],a=this.getOutput();for(let c of a){if(c.route.length<2)continue;let l=0;for(let h=1;h<c.route.length;h++){let d=c.route[h-1];c.route[h].z!==d.z&&(h-l>=2&&o.push({points:c.route.slice(l,h).map((u)=>({x:u.x,y:u.y})),strokeColor:s[d.z]??"rgba(128,128,128,0.75)",strokeWidth:this.traceThickness}),l=h)}if(c.route.length-l>=2){let h=c.route[l].z;o.push({points:c.route.slice(l).map((d)=>({x:d.x,y:d.y})),strokeColor:s[h]??"rgba(128,128,128,0.75)",strokeWidth:this.traceThickness})}}for(let c of a)for(let l of c.vias)r.push({center:{x:l.x,y:l.y},radius:this.viaDiameter/2,fill:"rgba(0,0,0,0.3)",stroke:"black"});if(this.activeConnSeg&&this.visitedFlatStamp){let c=this.stamp;for(let l=0;l<this.layers;l++){let h=l*this.planeSize;for(let d=0;d<this.planeSize;d++){if(this.visitedFlatStamp[h+d]!==c)continue;let u=TS(t,{x:this.cellCenterX[d],y:this.cellCenterY[d]});n.push({x:u.x,y:u.y,color:"rgba(0,0,255,0.2)"})}}}return{points:n,lines:o,circles:r,rects:i,coordinateSystem:"cartesian",title:`${this.getSolverName()} [${this.getSolvedRouteCount()} solved, ${this.unsolvedSegs?.length??0} remaining]`}}getOutput(){let e=this.gridToBoundsTransform,t=[];for(let n=0;n<this.solvedRoutes.length;n++){let o=this.getSolvedRoutesForConn(n);if(o.length===0)continue;let r=this.connIdToName[n];for(let i of o){let s=Array.from(i.states,(a)=>{let c=Math.floor(a/this.planeSize),l=a-c*this.planeSize,h=TS(e,{x:this.cellCenterX[l],y:this.cellCenterY[l]});return{x:h.x,y:h.y,z:this.layerToZ.get(c)??c}});s.length===1?(s[0]={...i.startPoint},s.push({...i.endPoint})):s.length>1&&(s[0]={...i.startPoint},s[s.length-1]={...i.endPoint}),t.push({connectionName:r,rootConnectionName:this.connIdToRootNet[n],regionId:this.nodeWithPortPoints.capacityMeshNodeId,traceThickness:this.traceThickness,viaDiameter:this.viaDiameter,route:s,vias:Array.from(i.viaCellIds,(a)=>TS(e,{x:this.cellCenterX[a],y:this.cellCenterY[a]}))})}}return t}getSolvedRoutesForConn(e){let t=this.solvedRoutes[e];return t?Array.isArray(t)?t:[t]:[]}getSolvedRouteCount(){let e=0;for(let t=0;t<this.solvedRoutes.length;t++)e+=this.getSolvedRoutesForConn(t).length;return e}computeGridToBoundsTransform(){let e=1/0,t=-1/0,n=1/0,o=-1/0;for(let h=0;h<this.planeSize;h++){let d=this.cellCenterX[h],u=this.cellCenterY[h];d<e&&(e=d),d>t&&(t=d),u<n&&(n=u),u>o&&(o=u)}let r=t-e,i=o-n,s=this.boundsMaxX-this.boundsMinX,a=this.boundsMaxY-this.boundsMinY,c=r>0?s/r:1,l=i>0?a/i:1;return{a:c,b:0,c:r>0?this.boundsMinX-c*e:(this.boundsMinX+this.boundsMaxX)/2-e,d:0,e:l,f:i>0?this.boundsMinY-l*n:(this.boundsMinY+this.boundsMaxY)/2-n}}},Hpr=class{begin;run;copyParents;constructor(e,t,n,o,r){let i=e*t,s=i*n,a=new Float64Array(s),c=new Int32Array(s),l=new Uint32Array(s),h=new Int32Array(s),d=new Uint8Array(s),u,_,p,m,A,g,f,y,x=0,C=0,b=0,I=1024,v=new Float64Array(I),P=new Int32Array(I),M=new Uint32Array(I);for(let H=0;H<s;H++){let V=H%i,O=V%e,U=Math.floor(V/e),j=Math.floor(H/i);h[H]=V,d[H]=Number(O>0)|Number(O+1<e)<<1|Number(U>0)<<2|Number(U+1<t)<<3|j%2<<4}function B(H,V){let O=b++;for(;O>0;){let U=O-1>>1;if(v[U]<=V)break;v[O]=v[U],P[O]=P[U],M[O]=M[U],O=U}v[O]=V,P[O]=H,l[H]=l[H]+1>>>0,M[O]=l[H]}let T=0,N=0;function D(){T=P[0],N=M[0];let H=--b;if(!H)return;let V=P[H],O=M[H],U=v[H],j=0;for(;2*j+1<b;){let Y=2*j+1;if(Y+1<b&&v[Y+1]<v[Y]&&Y++,U<=v[Y])break;v[j]=v[Y],P[j]=P[Y],M[j]=M[Y],j=Y}v[j]=U,P[j]=V,M[j]=O}function L(H,V,O,U,j,Y){let X=Y+V;if(X>=a[H])return;if(p[H]&&H!==x)return;if(O&&m[U])return;let K=O?_[U]:u[H],J=O?g[U]:A[H],ee=X+C*K+J;ee>=a[H]||(a[H]=ee,c[H]=j,B(H,ee+f[H]))}this.begin=(H,V,O,U)=>{({traceCost:u,viaCost:_,fixed:p,fixedVia:m,history:A,viaHistory:g,viaAllowed:y}=H),f=H.heuristicCost,x=O,C=U,b=0,a.fill(1/0),c.fill(-1),l.fill(0),a[V]=0,B(V,f[V])},this.run=(H,V)=>{let O=0,U=0;for(;U<H;){if(O>=V)return{status:3,expansions:O};if(!b)return{status:2,expansions:O};if(b+4+n>I){I*=2;let se=new Float64Array(I),ne=new Int32Array(I),re=new Uint32Array(I);se.set(v),ne.set(P),re.set(M),v=se,P=ne,M=re;continue}D(),U++;let j=T;if(N!==l[j])continue;let Y=a[j];if(O++,j===x)return{status:1,expansions:O};let X=h[j],K=d[j],J=o*(16&K?1.05:1),ee=r*(16&K?1:1.05);if(1&K&&L(j-1,J,!1,0,j,Y),2&K&&L(j+1,J,!1,0,j,Y),4&K&&L(j-e,ee,!1,0,j,Y),8&K&&L(j+e,ee,!1,0,j,Y),y[X])for(let se=0;se<n;se++){let ne=se*i+X;ne!==j&&L(ne,0.8,!0,X,j,Y)}}return{status:0,expansions:O}},this.copyParents=(H)=>H.set(c)}},Fpr=class{exports;offsets=[];states;heapCapacity=1024;constructor(e,t,n,o,r){XLt??=new WebAssembly.Module(Uint8Array.from(atob("AGFzbQEAAAABHwVgB39/f3x8f38AYAF/AGAAAX9gA39/fABgAn9/AX8DBwYAAQICAwQFAwEAAgYPAn8BQYCABAt/AEGAgQQLB2kIBm1lbW9yeQIACWNvbmZpZ3VyZQAAEXNldF9oZWFwX2NhcGFjaXR5AAEOZ2V0X2V4cGFuc2lvbnMAAghnZXRfcG9wcwADDGJlZ2luX3NlYXJjaAAEA3J1bgAFC19faGVhcF9iYXNlAwEK0h8G8wcEBX8FewR/BHtBACEHQQAgAjYChICEgABBACAANgKAgISAAEEAIAY2AqCAhIAAQQAgASAAbCIINgKIgISAAEEAIAggAmwiCTYCjICEgABBACADOQOQgISAAEEAIAQ5A5iAhIAAQQAgBSgCBDYCqICEgABBACAFKAIINgKsgISAAEEAIAUoAgw2ArCAhIAAQQAgBSgCEDYCtICEgABBACAFKAIUNgK4gISAAEEAIAUoAgA2AqSAhIAAQQAgBSgCGDYCvICEgABBACAFKAIcNgLAgISAAEEAIAUoAiA2AsSAhIAAQQAgBSgCJDYCyICEgABBACAFKAIoIgo2AsyAhIAAQQAgBSgCLCILNgLQgISAAEEAIAUoAjA2AtSAhIAAQQAgBSgCNDYC2ICEgAACQCAJQQFIDQACQCAJQQhJDQAgCyACIAFsIABsQQJ0IgVqIgIgCksgCiAFaiIFIAtLcQ0AIApBhICEgABJIAVBgICEgABLcQ0AIAtBhICEgABJIAJBgICEgABLcQ0AIAH9ESEMIAD9ESENIAj9ESEOQQD9CQKAgISAACEP/QwAAAAAAQAAAAIAAAADAAAAIRAgCiEFIAshAiAJQfz///8HcSIHIQYDQCAFIBAgEP0bACAO/RsAbSIR/REgEP0bASAO/RsBbSIS/RwBIBD9GwIgDv0bAm0iE/0cAiAQ/RsDIA79GwNtIhT9HAMgDv21Af2xASIV/QsCACACIBX9GwAgDf0bAG39ESAV/RsBIA39GwFt/RwBIBX9GwIgDf0bAm39HAIgFf0bAyAN/RsDbf0cAyIW/QwAAAAAAAAAAAAAAAAAAAAAIhf9O/0MBAAAAAQAAAAEAAAABAAAACIY/U4gFSAWIA39tQH9sQEiFSAX/Tj9sQEgEUECb/0RIBJBAm/9HAEgE0ECb/0cAiAUQQJv/RwDQQT9qwH9UCAV/QwBAAAAAQAAAAEAAAABAAAAIhf9rgEgD/05/QwCAAAAAgAAAAIAAAACAAAA/U79UCAWIBf9rgEgDP05/QwIAAAACAAAAAgAAAAIAAAA/U79UP0LAgAgBUEQaiEFIAJBEGohAiAQIBj9rgEhECAGQXxqIgYNAAsgCSAHRg0BC0EAIAFrIRMgCiAHQQJ0IgJqIQUgCyACaiECQQAgCGshFANAIAUgByAUIAcgCG0iBmxqIhE2AgAgAkEEQQAgESAAbSIRQQBKGyAHIAAgEyAGbCARa2wiEmpBAEdyIAZBAm9BBHRyQQJBACAHQQFqIgYgEmpBACgCgICEgABIG3JBCEEAIBFBAWogAUgbcjYCACAFQQRqIQUgAkEEaiECIAYhByAJIAZHDQALCwsNAEEAIAA2AqCAhIAACwsAQQAoAtyAhIAACwsAQQAoAuCAhIAAC4gFAQl/QQAgAjkD6ICEgABBACABNgLkgISAAEEAKALUgISAACEDQQAoAsSAhIAAIQQCQEEAKAKMgISAACIFQQFIDQBBACgCyICEgAAhBkEAIQcCQCAFQQRJDQBBACEHIAMgBmtBCEkNACAEIQEgBiEIIAMhCSAFQf7///8HcSIHIQoDQCAIQn83AgAgAf0MAAAAAAAA8H8AAAAAAADwf/0LAwAgCUIANwIAIAFBEGohASAIQQhqIQggCUEIaiEJIApBfmoiCg0ACyAFIAdGDQELIAchCwJAIAUgB2tBA3EiCkUNACAHIApqIQsgBCAHQQN0aiEBIAYgB0ECdCIJaiEIIAMgCWohCQNAIAhBfzYCACABQoCAgICAgID4/wA3AwAgCUEANgIAIAFBCGohASAIQQRqIQggCUEEaiEJIApBf2oiCg0ACwsgByAFa0F8Sw0AIAtBAnQhByAFIAtrIQUgBCALQQN0aiEBIAMhCgNAIAYgB2oiCEF/NgIAIAogB2oiCUEANgIAIAhBBGpBfzYCACAJQQRqQQA2AgAgCEEIakF/NgIAIAlBCGpBADYCACAIQQxqQX82AgAgAUKAgICAgICA+P8ANwMAIAFBCGpCgICAgICAgPj/ADcDACABQRBqQoCAgICAgID4/wA3AwAgAUEYakKAgICAgICA+P8ANwMAIAlBDGpBADYCACABQSBqIQEgBkEQaiEGIApBEGohCiAFQXxqIgUNAAsLQQBBATYC8ICEgAAgBCAAQQN0IghqQgA3AwAgAyAAQQJ0aiIBIAEoAgBBAWoiCTYCAEEAKALYgISAACIBQQAoAryAhIAAIAhqKwMAOQMAIAEgCTYCDCABIAA2AggLqhIMC38BfAN/AnwNfwF+AXwDfwJ8AX8BfAN/QQAhAkEAQQA2AuCAhIAAQQBBADYC3ICEgAACQCAAQQFIDQBBACgChICEgAAiA0EEaiEEQQAoAriAhIAAIQVBACgCqICEgAAhBkEAKAKwgISAACEHQQAoAoiAhIAAIQhBACgCwICEgAAhCUEAKAKAgISAACEKQQAoAryAhIAAIQtBACgCyICEgAAhDEEAKwPogISAACENQQAoArSAhIAAIQ5BACgCpICEgAAhD0EAKAKsgISAACEQQQArA5iAhIAAIRFBACsDkICEgAAhEkEAKALQgISAACETQQAoAsyAhIAAIRRBACgC5ICEgAAhFUEAKALEgISAACEWQQAoAtSAhIAAIRdBACgC2ICEgAAhGEEAKAKggISAACEZQQAoAvCAhIAAIRpBACEbQQAhHANAAkAgHCABSA0AQQMPCwJAIBoNAEECDwsCQCAaIARqIBlMDQBBBA8LQQAgGkF/aiIdNgLwgISAACAYKAIMIR4gGCgCCCEfAkAgHUUNACAYIB1BBHRqIgIpAwghICACKwMAISFBACECAkAgGkEDSA0AQQAhIkEBISNBACEkA0ACQAJAICRBAmoiJCAdSA0AICMhAgwBCyAjIQIgGCAkQQR0aisDACAYICNBBHRqKwMAY0UNACAkIQILAkAgISAYIAJBBHRqIiMrAwBlRQ0AICIhAgwCCyAYICJBBHRqICP9AAMA/QsDACACISIgAkEBdCIkQQFyIiMgHUgNAAsLIBggAkEEdGoiAiAgNwMIIAIgITkDAAtBACAbQQFqIhs2AuCAhIAAAkACQCAeIBcgH0ECdCIjaigCAEYNACAdIRoMAQtBASECQQAgHEEBaiIcNgLcgISAACAfIBVGDQIgFiAfQQN0aisDACEhIBJEzczMzMzM8D9EAAAAAAAA8D8gEyAjaigCACICQRBxIiIboiElIBQgI2ooAgAhIwJAAkAgAkEBcQ0AIB0hGgwBCwJAICEgJaAiJiAWIB9Bf2oiHkEDdCIkaiInKwMAIihmRQ0AIB0hGgwBCwJAIB4gFUYNACAQIB5qLQAAQf8BcUUNACAdIRoMAQsCQCAOICRqKwMAICYgDSAPIB5BAXRqLwEAuKKgoCImIChmRQ0AIB0hGgwBCyAMIB5BAnQiKWogHzYCACAnICY5AwBBACAaNgLwgISAACAmIAsgJGorAwCgISYCQCAaQQJIDQADQCAYIB1Bf2pBAXYiJEEEdGoiJysDACAmZQ0BIBggHUEEdGogJ/0AAwD9CwMAICQhHSAkDQALQQAhHQsgFyApaiIkICQoAgBBAWoiJDYCACAYIB1BBHRqIh0gJjkDACAdICQ2AgwgHSAeNgIIC0QAAAAAAADwP0TNzMzMzMzwPyAiGyEmAkACQCACQQJxDQAgGiEdDAELAkAgISAloCIlIBYgH0EBaiIeQQN0IiJqIh0rAwAiKGZFDQAgGiEdDAELAkAgHiAVRg0AIBAgHmotAABB/wFxRQ0AIBohHQwBCwJAIA4gImorAwAgJSANIA8gHkEBdGovAQC4oqCgIiUgKGZFDQAgGiEdDAELIAwgHkECdCInaiAfNgIAIB0gJTkDAEEAIBpBAWoiHTYC8ICEgAAgJSALICJqKwMAoCElAkAgGkEBSA0AA0AgGCAaQX9qQQF2IiJBBHRqIiQrAwAgJWUNASAYIBpBBHRqICT9AAMA/QsDACAiIRogIg0AC0EAIRoLIBcgJ2oiIiAiKAIAQQFqIiI2AgAgGCAaQQR0aiIaICU5AwAgGiAiNgIMIBogHjYCCAsgESAmoiElAkACQCACQQRxDQAgHSEiDAELAkAgISAloCImIBYgHyAKayIeQQN0IhpqIiIrAwAiKGZFDQAgHSEiDAELAkAgHiAVRg0AIBAgHmotAABB/wFxRQ0AIB0hIgwBCwJAIA4gGmorAwAgJiANIA8gHkEBdGovAQC4oqCgIiYgKGZFDQAgHSEiDAELIAwgHkECdCInaiAfNgIAICIgJjkDAEEAIB1BAWoiIjYC8ICEgAAgJiALIBpqKwMAoCEmAkAgHUEBSA0AA0AgGCAdQX9qQQF2IhpBBHRqIiQrAwAgJmUNASAYIB1BBHRqICT9AAMA/QsDACAaIR0gGg0AC0EAIR0LIBcgJ2oiGiAaKAIAQQFqIho2AgAgGCAdQQR0aiIdICY5AwAgHSAaNgIMIB0gHjYCCAsCQAJAIAJBCHENACAiIRoMAQsCQCAhICWgIiUgFiAKIB9qIiRBA3QiAmoiHSsDACImZkUNACAiIRoMAQsCQCAkIBVGDQAgECAkai0AAEH/AXFFDQAgIiEaDAELAkAgDiACaisDACAlIA0gDyAkQQF0ai8BALiioKAiJSAmZkUNACAiIRoMAQsgDCAkQQJ0Ih5qIB82AgAgHSAlOQMAQQAgIkEBaiIaNgLwgISAACAlIAsgAmorAwCgISUCQCAiQQFIDQADQCAYICJBf2pBAXYiAkEEdGoiHSsDACAlZQ0BIBggIkEEdGogHf0AAwD9CwMAIAIhIiACDQALQQAhIgsgFyAeaiICIAIoAgBBAWoiHTYCACAYICJBBHRqIgIgJTkDACACIB02AgwgAiAkNgIICyAJICNqLQAARQ0AIANBAUgNACAHICNqIR4gIUSamZmZmZnpP6AhISAFICNBA3RqIScgBiAjQQF0aiEpQQAhAgNAAkAgCCACbCAjaiIdIB9GDQAgISAWIB1BA3QiImoiJCsDACIlZg0AAkAgHSAVRg0AIBAgHWotAABB/wFxDQELIB4tAAANACAnKwMAICEgDSApLwEAuKKgoCImICVmDQAgDCAdQQJ0IipqIB82AgAgJCAmOQMAQQAgGkEBaiIrNgLwgISAACAmIAsgImorAwCgISUCQCAaQQFIDQADQCAYIBpBf2pBAXYiIkEEdGoiJCsDACAlZQ0BIBggGkEEdGogJP0AAwD9CwMAICIhGiAiDQALQQAhGgsgFyAqaiIiICIoAgBBAWoiIjYCACAYIBpBBHRqIhogJTkDACAaICI2AgwgGiAdNgIIICshGgsgAkEBaiICIANHDQALCyAbIABHDQALQQAhAgsgAgsAdQRuYW1lAAwLa2VybmVsLndhc20BTAYACWNvbmZpZ3VyZQERc2V0X2hlYXBfY2FwYWNpdHkCDmdldF9leHBhbnNpb25zAwhnZXRfcG9wcwQMYmVnaW5fc2VhcmNoBQNydW4HEgEAD19fc3RhY2tfcG9pbnRlcgAvCXByb2R1Y2VycwEMcHJvY2Vzc2VkLWJ5AQ5Ib21lYnJldyBjbGFuZwYyMi4xLjgAnQEPdGFyZ2V0X2ZlYXR1cmVzCSsLYnVsay1tZW1vcnkrD2J1bGstbWVtb3J5LW9wdCsWY2FsbC1pbmRpcmVjdC1vdmVybG9uZysKbXVsdGl2YWx1ZSsPbXV0YWJsZS1nbG9iYWxzKxNub250cmFwcGluZy1mcHRvaW50Kw9yZWZlcmVuY2UtdHlwZXMrCHNpZ24tZXh0KwdzaW1kMTI4"),(c)=>c.charCodeAt(0))),this.exports=new WebAssembly.Instance(XLt).exports;let i=e*t;this.states=i*n;let s=Number(this.exports.__heap_base.value),a=s;s+=56;for(let c of[2*this.states,2*i,this.states,i,8*this.states,8*i,8*this.states,i,8*this.states,4*this.states,4*this.states,4*this.states,4*this.states,16*this.heapCapacity])s=8*Math.ceil(s/8),this.offsets.push(s),s+=c;this.ensureMemory(s),new Int32Array(this.exports.memory.buffer,a,14).set(this.offsets),this.exports.configure(e,t,n,o,r,a,this.heapCapacity)}ensureMemory(e){let t=this.exports.memory;e>t.buffer.byteLength&&t.grow(Math.ceil((e-t.buffer.byteLength)/65536))}begin(e,t,n,o){let r=new Uint8Array(this.exports.memory.buffer),i=[e.traceCost,e.viaCost,e.fixed,e.fixedVia,e.history,e.viaHistory,e.heuristicCost,e.viaAllowed];for(let s=0;s<i.length;s++){let a=i[s];r.set(new Uint8Array(a.buffer,a.byteOffset,a.byteLength),this.offsets[s])}this.exports.begin_search(t,n,o)}run(e,t){let n=0,o=0,r=Math.ceil(e);for(;r>0;)if(o=this.exports.run(Math.min(r,1e6),Math.min(Math.ceil(t-n),2147483647)),r-=this.exports.get_pops(),n+=this.exports.get_expansions(),o===4)this.heapCapacity*=2,this.ensureMemory(this.offsets[13]+16*this.heapCapacity),this.exports.set_heap_capacity(this.heapCapacity);else if(o!==0)break;return{status:o,expansions:n}}copyParents(e){e.set(new Int32Array(this.exports.memory.buffer,this.offsets[9],this.states))}},Vje=(e,t,n)=>{let[o,r]=e;if(o===r)return;let i=((s,a)=>{let c=s.portPointId??`${s.connectionName}:${s.x}:${s.y}:${s.z}`,l=a.portPointId??`${a.connectionName}:${a.x}:${a.y}:${a.z}`;return c<l?`${c}|${l}`:`${l}|${c}`})(o,r);t.has(i)||(t.add(i),n.push(e))},jLt=(e,t,n)=>{for(let o=0;o<e.length-1;o++)Vje([e[o],e[o+1]],t,n)},zpr=(e)=>{let t=[],n=new Set,o=((s)=>{let a=new Map;for(let c of s)c.portPointId&&a.set(c.portPointId,c);return a})(e);for(let s of e){if(s.prevPortPointId){let a=o.get(s.prevPortPointId);a&&a.connectionName===s.connectionName&&Vje([a,s],n,t)}if(s.nextPortPointId){let a=o.get(s.nextPortPointId);a&&a.connectionName===s.connectionName&&Vje([s,a],n,t)}}if(t.length===0)return jLt(e,n,t),t;let r=((s)=>{let a=new Set;for(let[c,l]of s)c.portPointId&&a.add(c.portPointId),l.portPointId&&a.add(l.portPointId);return a})(t),i=e.filter((s)=>!s.portPointId||!r.has(s.portPointId));return jLt(i,n,t),t},$ae=0.000000001,b4e=0.01,bae=0.000001;function I4e(e,t,n){return(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x)}function RUt(e,t,n,o){let r=I4e(n,o,e),i=I4e(n,o,t),s=I4e(e,t,n),a=I4e(e,t,o);if((r>$ae&&i<-0.000000001||r<-0.000000001&&i>$ae)&&(s>$ae&&a<-0.000000001||s<-0.000000001&&a>$ae)){let c=r/(r-i);return{x:e.x+c*(t.x-e.x),y:e.y+c*(t.y-e.y)}}return null}function Opr(e,t){let n=[];for(let o=0;o<e.route.length-1;o++){let r=e.route[o],i=e.route[o+1];r.z===t&&i.z===t&&n.push([{x:r.x,y:r.y},{x:i.x,y:i.y}])}return n}function Vpr(e,t){return e.route.filter((n)=>n.z===t).map((n)=>({x:n.x,y:n.y}))}function Yje(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function tqe(e,t,n=0.01){return Math.abs(e.x-t.x)<n&&Math.abs(e.y-t.y)<n}function KLt(e,t,n){let o=new Set,r=[e.route[0],e.route[e.route.length-1]];for(let i of r)i&&i.z===t&&i.portPointId&&tqe(i,n)&&o.add(i.portPointId);return o}function Gje(e,t,n,o){let r=KLt(e,n,o);if(r.size===0)return!1;let i=KLt(t,n,o);if(i.size===0)return!1;for(let s of r)if(i.has(s))return!0;return!1}function Ypr(e,t,n,o){let r=[t.a,t.b],i=[o.a,o.b];for(let s of r)for(let a of i)if(tqe(s,a)&&Gje(e,n,t.z,s))return!0;return!1}function f$(e,t,n){let o=n.x-t.x,r=n.y-t.y,i=o*o+r*r;if(i<=$ae)return Yje(e,t);let s=e.x-t.x,a=e.y-t.y,c=Math.max(0,Math.min(1,(s*o+a*r)/i)),l=t.x+o*c,h=t.y+r*c;return Math.hypot(e.x-l,e.y-h)}function Gpr(e,t,n,o){return RUt(e,t,n,o)?0:Math.min(f$(e,n,o),f$(t,n,o),f$(n,e,t),f$(o,e,t))}function $Lt(e){return e.rootConnectionName??e.connectionName.replace(/_mst\d+$/,"")}function Iae(e,t){e.push(t)}function Upr(e){let t=function(o){let r=[],i=new Set;for(let s of o)for(let a of s.route)i.add(a.z);for(let s of i){let a=o.map((c)=>({points:Vpr(c,s),segments:Opr(c,s),root:$Lt(c)}));for(let c=0;c<o.length;c++){let l=o[c],{points:h,segments:d,root:u}=a[c];for(let _=c+1;_<o.length;_++){let p=o[_],{points:m,segments:A,root:g}=a[_];if(u===g)continue;let f=new Set;for(let y of h)for(let x of m)if(tqe(y,x)){if(Gje(l,p,s,y))continue;let C=`${y.x.toFixed(2)},${y.y.toFixed(2)}`;if(f.has(C))continue;f.add(C),r.push({trace1:l.connectionName,trace2:p.connectionName,z:s,point:y,type:"shared_point"})}for(let[y,x]of d)for(let[C,b]of A){let I=RUt(y,x,C,b);I&&r.push({trace1:l.connectionName,trace2:p.connectionName,z:s,point:I,type:"crossing",seg1:[y,x],seg2:[C,b]})}}}}return r}(e).map((o)=>({trace1:o.trace1,trace2:o.trace2,type:o.type,z:o.z,point:o.point,seg1:o.seg1,seg2:o.seg2,distance:0,requiredDistance:0})),n=e.map((o)=>{let r=function(c){let l=[];for(let h=0;h<c.route.length-1;h++){let d=c.route[h],u=c.route[h+1];d.z===u.z&&l.push({minX:Math.min(d.x,u.x),maxX:Math.max(d.x,u.x),minY:Math.min(d.y,u.y),maxY:Math.max(d.y,u.y),z:d.z,a:{x:d.x,y:d.y},b:{x:u.x,y:u.y}})}return l}(o),i=new Set,s=new Map,a=new Map;for(let c of o.route){i.add(c.z);let l=s.get(c.z)??[];l.push({x:c.x,y:c.y}),s.set(c.z,l)}for(let c of r){let l=a.get(c.z)??[];l.push(c),a.set(c.z,l)}return{route:o,rootNet:$Lt(o),pointsByLayer:s,segmentsByLayer:a,segments:r,vias:o.vias.map((c)=>({x:c.x,y:c.y})),traceRadius:o.traceThickness/2,viaRadius:o.viaDiameter/2,zLayers:i}});for(let o=0;o<n.length;o++){let r=n[o];for(let i=o+1;i<n.length;i++){let s=n[i];if(r.rootNet===s.rootNet)continue;let a=new Set([...r.zLayers.values(),...s.zLayers.values()]);for(let l of a){let h=r.segmentsByLayer.get(l)??[],d=s.segmentsByLayer.get(l)??[],u=r.pointsByLayer.get(l)??[],_=s.pointsByLayer.get(l)??[],p=r.traceRadius+s.traceRadius;for(let m of h)for(let A of d){if(m.minX-A.maxX>=p||A.minX-m.maxX>=p||m.minY-A.maxY>=p||A.minY-m.maxY>=p)continue;let g=Gpr(m.a,m.b,A.a,A.b);g+bae>=p||(g<=b4e&&Ypr(r.route,m,s.route,A)||Iae(t,{trace1:r.route.connectionName,trace2:s.route.connectionName,type:g<=b4e?"shared_point":"trace_clearance",z:l,distance:g,requiredDistance:p,seg1:[m.a,m.b],seg2:[A.a,A.b]}))}for(let m of u)for(let A of _){if(Math.abs(m.x-A.x)>=p||Math.abs(m.y-A.y)>=p)continue;let g=Yje(m,A);g+bae>=p||(g<=b4e&&Gje(r.route,s.route,l,m)||Iae(t,{trace1:r.route.connectionName,trace2:s.route.connectionName,type:g<=b4e?"shared_point":"trace_clearance",z:l,distance:g,requiredDistance:p,point:m,point2:A}))}}let c=r.viaRadius+s.viaRadius;for(let l of r.vias)for(let h of s.vias){if(Math.abs(l.x-h.x)>=c||Math.abs(l.y-h.y)>=c)continue;let d=Yje(l,h);d+bae>=c||Iae(t,{trace1:r.route.connectionName,trace2:s.route.connectionName,type:"via_via_clearance",z:null,distance:d,requiredDistance:c,point:l,point2:h})}for(let l of r.vias){let h=r.viaRadius+s.traceRadius;for(let d of s.segments){if(l.x-d.maxX>=h||d.minX-l.x>=h||l.y-d.maxY>=h||d.minY-l.y>=h)continue;let u=f$(l,d.a,d.b);u+bae>=h||Iae(t,{trace1:r.route.connectionName,trace2:s.route.connectionName,type:"via_trace_clearance",z:d.z,distance:u,requiredDistance:h,point:l,seg2:[d.a,d.b]})}}for(let l of s.vias){let h=s.viaRadius+r.traceRadius;for(let d of r.segments){if(l.x-d.maxX>=h||d.minX-l.x>=h||l.y-d.maxY>=h||d.minY-l.y>=h)continue;let u=f$(l,d.a,d.b);u+bae>=h||Iae(t,{trace1:r.route.connectionName,trace2:s.route.connectionName,type:"via_trace_clearance",z:d.z,distance:u,requiredDistance:h,point:l,seg1:[d.a,d.b]})}}}}return t}var IS=class extends Da{nodeWithPortPoints;props;traceThickness;traceMargin;viaDiameter;hyperParameters;phase="routing";round=0;routingIterations=0;routedCount=0;conflictCount=0;rerouteCount=0;bestConflictCount=1/0;broadNegotiations=0;stagnantRounds=0;violations=[];connections=[];activeConnectionIndex=-1;rows=0;cols=0;plane=0;layers=[];pitchX=0;pitchY=0;left=0;bottom=0;routes=new Map;pairCache=new WeakMap;queue=[];traceCost;viaCost;fixed;fixedVia;history;viaHistory;parent;searchKernel;heuristicCost;heuristicCache=new Map;viaAllowed;goal=0;presentCost=0.5;randomState=1;constructor(e){super(),this.props=e,this.nodeWithPortPoints=e.nodeWithPortPoints,this.traceThickness=e.traceThickness??0.1,this.traceMargin=e.traceMargin??0.1,this.viaDiameter=e.viaDiameter??0.3,this.hyperParameters={shuffleSeed:0,greedyMultiplier:1.1,...e.hyperParameters};for(let t of[e.cellSizeMm??0.1,this.traceThickness,this.viaDiameter,e.stepMultiplier??1000,e.maxRounds??200,e.maxSearchIterations??50000000,this.hyperParameters.greedyMultiplier])if(!Number.isFinite(t)||t<=0)throw Error("A13 dimensions and search limits must be positive and finite");if(!Number.isFinite(this.traceMargin)||this.traceMargin<0)throw Error("traceMargin must be nonnegative");this.MAX_ITERATIONS=1e8}getSolverName(){return"HighDensitySolverA13"}getConstructorParams(){return[{...this.props}]}_setup(){let e=this.nodeWithPortPoints;if(e.width<=0||e.height<=0)throw Error("Node dimensions must be positive");this.cols=Math.ceil(e.width/(this.props.cellSizeMm??0.1))+1,this.rows=Math.ceil(e.height/(this.props.cellSizeMm??0.1))+1,this.pitchX=e.width/(this.cols-1),this.pitchY=e.height/(this.rows-1),this.left=e.center.x-e.width/2,this.bottom=e.center.y-e.height/2,this.layers=e.availableZ??[...new Set(e.portPoints.map((i)=>i.z))].sort((i,s)=>i-s),this.plane=this.rows*this.cols;let t=this.plane*this.layers.length;if(t>2000000)throw Error("A13 grid exceeds two million states");this.traceCost=new Uint16Array(t),this.viaCost=new Uint16Array(this.plane),this.fixed=new Uint8Array(t),this.fixedVia=new Uint8Array(this.plane),this.history=new Float64Array(t),this.viaHistory=new Float64Array(this.plane),this.heuristicCost=new Float64Array(t),this.viaAllowed=new Uint8Array(this.plane);let n=Math.max(this.viaDiameter/2,this.props.viaMinDistFromBorder??this.viaDiameter/2);for(let i=0;i<this.plane;i++){let s=this.point(i);s.x-this.left>=n&&this.left+e.width-s.x>=n&&s.y-this.bottom>=n&&this.bottom+e.height-s.y>=n&&(this.viaAllowed[i]=1)}this.parent=new Int32Array(t);let o=this.props.searchBackend==="wasm"?Fpr:Hpr;this.searchKernel=new o(this.cols,this.rows,this.layers.length,this.pitchX,this.pitchY);let r=new Map;for(let i of e.portPoints){if(!this.layers.includes(i.z))throw Error("Port is on an unavailable layer");let s=r.get(i.connectionName)??[];s.push(i),r.set(i.connectionName,s)}for(let i of r.values())for(let[s,a]of zpr(i))this.connections.push({start:s,end:a,root:s.rootConnectionName??s.connectionName.replace(/_mst\d+$/,"")});this.randomState=this.hyperParameters.shuffleSeed+1>>>0,this.queue=this.shuffle(this.connections.map((i,s)=>s))}shuffle(e){for(let t=e.length-1;t>0;t--){this.randomState=Math.imul(this.randomState,1664525)+1013904223>>>0;let n=this.randomState%(t+1);[e[t],e[n]]=[e[n],e[t]]}return e}index(e){let t=Math.max(0,Math.min(this.cols-1,Math.round((e.x-this.left)/this.pitchX))),n=Math.max(0,Math.min(this.rows-1,Math.round((e.y-this.bottom)/this.pitchY)));return this.layers.indexOf(e.z)*this.plane+n*this.cols+t}point(e){let t=e%this.plane;return{x:this.left+t%this.cols*this.pitchX,y:this.bottom+Math.floor(t/this.cols)*this.pitchY,z:this.layers[Math.floor(e/this.plane)]}}capsule(e,t,n,o){let r=Math.max(0,Math.floor((Math.min(e.x,t.x)-n-this.left)/this.pitchX)),i=Math.min(this.cols-1,Math.ceil((Math.max(e.x,t.x)+n-this.left)/this.pitchX)),s=Math.max(0,Math.floor((Math.min(e.y,t.y)-n-this.bottom)/this.pitchY)),a=Math.min(this.rows-1,Math.ceil((Math.max(e.y,t.y)+n-this.bottom)/this.pitchY)),c=t.x-e.x,l=t.y-e.y,h=c*c+l*l;for(let d=s;d<=a;d++)for(let u=r;u<=i;u++){let _=this.left+u*this.pitchX,p=this.bottom+d*this.pitchY,m=h?Math.max(0,Math.min(1,((_-e.x)*c+(p-e.y)*l)/h)):0;(_-e.x-m*c)**2+(p-e.y-m*l)**2<n*n-0.000000000001&&o(d*this.cols+u)}}prepareSearch(e){this.activeConnectionIndex=e;let t=this.connections[e];this.traceCost.fill(0),this.viaCost.fill(0),this.fixed.fill(0),this.fixedVia.fill(0);for(let[i,s]of this.routes)if(this.connections[i].root!==t.root){for(let a of s.traceFootprint)this.traceCost[a]++;for(let a of s.viaFootprint)this.viaCost[a]++}for(let i of this.connections)if(i.root!==t.root)for(let s of[i.start,i.end])this.capsule(s,s,this.traceThickness+this.traceMargin,(a)=>{this.fixed[this.layers.indexOf(s.z)*this.plane+a]=1}),this.capsule(s,s,(this.traceThickness+this.viaDiameter)/2+this.traceMargin,(a)=>{this.fixedVia[a]=1});let n=this.index(t.start);this.goal=this.index(t.end);let o=this.point(this.goal),r=this.heuristicCache.get(this.goal);if(r)this.heuristicCost=r;else{this.heuristicCost=new Float64Array(this.parent.length);for(let s=0;s<this.layers.length;s++)for(let a=0;a<this.rows;a++){let c=Math.abs(this.bottom+a*this.pitchY-o.y);for(let l=0;l<this.cols;l++)this.heuristicCost[s*this.plane+a*this.cols+l]=(Math.abs(this.left+l*this.pitchX-o.x)+c+(this.layers[s]===o.z?0:0.8))*this.hyperParameters.greedyMultiplier}let i=Math.floor(8388608/this.heuristicCost.byteLength);i>0&&(this.heuristicCache.size>=i&&this.heuristicCache.delete(this.heuristicCache.keys().next().value),this.heuristicCache.set(this.goal,this.heuristicCost))}this.searchKernel.begin({traceCost:this.traceCost,viaCost:this.viaCost,fixed:this.fixed,fixedVia:this.fixedVia,history:this.history,viaHistory:this.viaHistory,heuristicCost:this.heuristicCost,viaAllowed:this.viaAllowed},n,this.goal,this.presentCost)}_step(){if(this.phase==="negotiating")return void this.negotiate();if(this.activeConnectionIndex<0){let n=this.queue.shift();if(n===void 0)return void(this.phase="negotiating");this.prepareSearch(n)}let{status:e,expansions:t}=this.searchKernel.run(this.props.stepMultiplier??1000,(this.props.maxSearchIterations??50000000)-this.routingIterations);this.routingIterations+=t,e===1?(this.searchKernel.copyParents(this.parent),this.commit(this.goal)):e===2?(this.failed=!0,this.error=`No path between fixed terminals of ${this.connections[this.activeConnectionIndex].start.connectionName}`):e===3&&(this.failed=!0,this.error="A13 exhausted its search budget")}commit(e){let t=this.activeConnectionIndex,n=this.connections[t],o=[];for(let u=e;u!==-1;u=this.parent[u])o.push(u);o.reverse();let r=[{...n.start},...o.map((u)=>this.point(u)),{...n.end}],i=[];for(let u of r){let _=i.at(-1),p=i.at(-2);_&&_.x===u.x&&_.y===u.y&&_.z===u.z||(p&&_&&p.z===u.z&&_.z===u.z&&(_.x-p.x)*(u.y-_.y)===(_.y-p.y)*(u.x-_.x)&&i.pop(),i.push(u))}i[0]={...n.start},i[i.length-1]={...n.end};let s=[],a=[];for(let u=1;u<o.length;u++)if(Math.floor(o[u]/this.plane)!==Math.floor(o[u-1]/this.plane)){let _=this.point(o[u]);s.push({x:_.x,y:_.y}),a.push(o[u]%this.plane)}let c={connectionName:n.start.connectionName,rootConnectionName:n.root,regionId:this.nodeWithPortPoints.capacityMeshNodeId,traceThickness:this.traceThickness,viaDiameter:this.viaDiameter,route:i,vias:s},l=new Set,h=new Set,d=new Set;for(let u=1;u<i.length;u++){let _=i[u-1],p=i[u];_.z===p.z&&(this.capsule(_,p,0.00001,(m)=>d.add(this.layers.indexOf(_.z)*this.plane+m)),this.capsule(_,p,this.traceThickness+this.traceMargin,(m)=>l.add(this.layers.indexOf(_.z)*this.plane+m)),this.capsule(_,p,(this.traceThickness+this.viaDiameter)/2+this.traceMargin,(m)=>h.add(m)))}for(let u of s)this.capsule(u,u,(this.viaDiameter+this.traceThickness)/2+this.traceMargin,(_)=>{for(let p=0;p<this.layers.length;p++)l.add(p*this.plane+_)}),this.capsule(u,u,this.viaDiameter+this.traceMargin,(_)=>h.add(_));this.routes.has(t)&&this.rerouteCount++,this.routes.set(t,{output:c,clearanceOutput:{...c,traceThickness:c.traceThickness+this.traceMargin,viaDiameter:c.viaDiameter+this.traceMargin},traceFootprint:[...l],traceFootprintSet:l,viaFootprint:[...h],viaFootprintSet:h,cells:[...d],viaCells:a}),this.routedCount=this.routes.size,this.activeConnectionIndex=-1}getPair(e,t){let n=this.pairCache.get(e);n||(n=new WeakMap,this.pairCache.set(e,n));let o=n.get(t);return o||(o={cells:[...e.cells.filter((r)=>t.traceFootprintSet.has(r)),...t.cells.filter((r)=>e.traceFootprintSet.has(r))],vias:[...e.viaCells.filter((r)=>t.viaFootprintSet.has(r)),...t.viaCells.filter((r)=>e.viaFootprintSet.has(r))],violations:Upr([e.clearanceOutput,t.clearanceOutput])},n.set(t,o)),o}negotiate(){this.round++;let e=new Set,t=new Set,n=new Set;for(let[s,a]of this.routes)for(let[c,l]of this.routes){if(c<=s||this.connections[s].root===this.connections[c].root)continue;let h=this.getPair(a,l);if(h.cells.length||h.vias.length){e.add(s),e.add(c);for(let d of h.cells)t.add(d);for(let d of h.vias)n.add(d)}}let o=[...this.routes.entries()].sort(([s],[a])=>s-a),r=new Map;for(let[,s]of o)for(let a of s.output.route)r.has(a.z)||r.set(a.z,[]);let i=[];for(let s=0;s<o.length;s++)for(let a=s+1;a<o.length;a++){let[c,l]=o[s],[h,d]=o[a];if(this.connections[c].root!==this.connections[h].root)for(let u of this.getPair(l,d).violations)u.requiredDistance===0?r.get(u.z).push(u):i.push(u)}this.violations=[...r.values()].flat().concat(i);for(let s of this.violations){for(let a=0;a<this.connections.length;a++)[s.trace1,s.trace2].includes(this.connections[a].start.connectionName)&&e.add(a);for(let a of[s.point,s.point2])if(a){let c=this.index({...a,z:this.layers[0]})%this.plane;n.add(c),s.z!==null&&t.add(this.layers.indexOf(s.z)*this.plane+c)}}if(this.conflictCount=e.size,this.stagnantRounds=this.conflictCount<this.bestConflictCount?0:this.stagnantRounds+1,this.bestConflictCount=Math.min(this.bestConflictCount,this.conflictCount),this.stats={round:this.round,conflictedRoutes:this.conflictCount,geometryViolations:this.violations.length,reroutes:this.rerouteCount,searchExpansions:this.routingIterations},!this.violations.length&&this.routes.size===this.connections.length)return this.solved=!0,this.stats.conflictedRoutes=0,this.conflictCount=0,this.bestConflictCount=0,void(this.phase="complete");if(this.round>=(this.props.maxRounds??200))return this.failed=!0,void(this.error=`Negotiation exhausted ${this.round} rounds (${this.conflictCount} conflicted routes)`);for(let s of t)this.history[s]+=0.15;for(let s of n)this.viaHistory[s]+=0.15;this.presentCost=Math.min(20,1.08*this.presentCost),this.stagnantRounds>=8?(this.queue=this.shuffle(this.connections.map((s,a)=>a)),this.presentCost=Math.max(0.5,this.presentCost/2),this.stagnantRounds=0,this.broadNegotiations++):this.queue=this.shuffle([...e]),this.phase="routing"}getOutput(){return[...this.routes.entries()].sort(([e],[t])=>e-t).map(([,e])=>e.output)}visualize(){let e=this.nodeWithPortPoints,t={title:`A13 negotiated congestion · round ${this.round} · ${this.conflictCount} conflicted routes`,rects:[{center:e.center,width:e.width,height:e.height,stroke:"#475569",fill:"transparent"}],points:e.portPoints.map((n)=>({...n,color:n.z===0?"red":"blue",layer:`z${n.z}`,label:n.connectionName})),lines:[],circles:[]};for(let n of this.getOutput()){for(let o=1;o<n.route.length;o++){let r=n.route[o-1],i=n.route[o];r.z===i.z&&t.lines.push({points:[r,i],strokeColor:r.z===0?"#ef4444":"#3b82f6",strokeWidth:this.traceThickness,layer:`z${r.z}`})}for(let o of n.vias)t.circles.push({center:o,radius:this.viaDiameter/2,fill:"#cbd5e1",stroke:"#334155",layer:`z${this.layers.join(",")}`})}for(let n of this.violations.slice(0,50))n.point&&t.circles.push({center:n.point,radius:0.2,stroke:"#f59e0b",fill:"transparent"});return t}},HWe=(e)=>({minX:Math.min(e[0].x,e[1].x),maxX:Math.max(e[0].x,e[1].x),minY:Math.min(e[0].y,e[1].y),maxY:Math.max(e[0].y,e[1].y)});function z3e(e,t){let n=e.x-t.x,o=e.y-t.y;return n*n+o*o}function y$(e,t,n){let o=z3e(t,n);if(o===0)return z3e(e,t);let r=((e.x-t.x)*(n.x-t.x)+(e.y-t.y)*(n.y-t.y))/o;return r=Math.max(0,Math.min(1,r)),z3e(e,{x:t.x+r*(n.x-t.x),y:t.y+r*(n.y-t.y)})}function Wpr(e,t,n,o){if(Ru(e,t,n,o))return 0;let r={x:e.x,y:e.y},i={x:t.x,y:t.y},s={x:n.x,y:n.y},a={x:o.x,y:o.y};return Math.min(y$(r,s,a),y$(i,s,a),y$(s,r,i),y$(a,r,i))}var rCe=class{segmentBuckets;viaBuckets;CELL_SIZE;maximumCopperRadius=0;constructor(e,t=1){this.segmentBuckets=new Map,this.viaBuckets=new Map,this.CELL_SIZE=t;for(let n of e)if(n&&n.connectionName){if(this.maximumCopperRadius=Math.max(this.maximumCopperRadius,n.traceThickness/2,n.viaDiameter/2),n.route&&n.route.length>=2)for(let o=0;o<n.route.length-1;o++){let r=n.route[o],i=n.route[o+1];if(r.x===i.x&&r.y===i.y)continue;if(r.insideJumperPad&&i.insideJumperPad)continue;let s=[r,i],a=HWe(s),c={segmentId:`${n.connectionName}-seg-${o}`,segment:s,parentRoute:n},l=Math.floor(a.minX/this.CELL_SIZE),h=Math.floor((a.maxX+0.000000001)/this.CELL_SIZE),d=Math.floor(a.minY/this.CELL_SIZE),u=Math.floor((a.maxY+0.000000001)/this.CELL_SIZE);for(let _=l;_<=h;_++)for(let p=d;p<=u;p++){let m=`${_}x${p}`,A=this.segmentBuckets.get(m);A||(A=[],this.segmentBuckets.set(m,A)),A.push(c)}}if(n.vias&&n.vias.length>0)for(let o=0;o<n.vias.length;o++){let r=n.vias[o];if(r==null)continue;let i={viaId:`${n.connectionName}-via-${o}`,x:r.x,y:r.y,parentRoute:n},s=`${Math.floor(r.x/this.CELL_SIZE)}x${Math.floor(r.y/this.CELL_SIZE)}`,a=this.viaBuckets.get(s);a||(a=[],this.viaBuckets.set(s,a)),a.push(i)}}else console.warn("Skipping route with missing data:",n)}getConflictingRoutesForSegment(e,t,n){let o=HWe([e,t]),r=n+this.maximumCopperRadius,i=o.minX-r,s=o.minY-r,a=o.maxX+r,c=o.maxY+r,l=Math.floor(i/this.CELL_SIZE),h=Math.floor((a+0.000000001)/this.CELL_SIZE),d=Math.floor(s/this.CELL_SIZE),u=Math.floor((c+0.000000001)/this.CELL_SIZE),_=new Map,p=new Set,m=new Set,A={x:e.x,y:e.y},g={x:t.x,y:t.y};for(let y=l;y<=h;y++)for(let x=d;x<=u;x++){let C=`${y}x${x}`,b=this.segmentBuckets.get(C);if(b)for(let v of b){if(p.has(v.segmentId))continue;p.add(v.segmentId);let P=v.parentRoute,[M,B]=v.segment;if(e.z!==t.z||M.z!==B.z||M.z!==e.z)continue;let T=n+P.traceThickness/2,N=T*T,D=Wpr(e,t,M,B);if(D<N){let L=P.connectionName,H=_.get(L);(!H||D<H.minDistSq)&&_.set(L,{route:P,minDistSq:D})}}let I=this.viaBuckets.get(C);if(I)for(let v of I){if(m.has(v.viaId))continue;m.add(v.viaId);let P=v.parentRoute,M={x:v.x,y:v.y},B=n+P.viaDiameter/2,T=B*B,N=y$(M,A,g);if(N<T){let D=P.connectionName,L=_.get(D);(!L||N<L.minDistSq)&&_.set(D,{route:P,minDistSq:N})}}}let f=[];for(let y of _.values())f.push({conflictingRoute:y.route,distance:Math.sqrt(y.minDistSq)});return f}removeRoute(e){for(let[t,n]of this.segmentBuckets){let o=n.filter((r)=>r.parentRoute.connectionName!==e);o.length===0?this.segmentBuckets.delete(t):o.length!==n.length&&this.segmentBuckets.set(t,o)}for(let[t,n]of this.viaBuckets){let o=n.filter((r)=>r.parentRoute.connectionName!==e);o.length===0?this.viaBuckets.delete(t):o.length!==n.length&&this.viaBuckets.set(t,o)}}addRoute(e){if(!e||!e.connectionName)return void console.warn("Skipping route with missing data:",e);if(this.maximumCopperRadius=Math.max(this.maximumCopperRadius,e.traceThickness/2,e.viaDiameter/2),e.route&&e.route.length>=2)for(let t=0;t<e.route.length-1;t++){let n=e.route[t],o=e.route[t+1];if(n.x===o.x&&n.y===o.y)continue;if(n.insideJumperPad&&o.insideJumperPad)continue;let r=[n,o],i=HWe(r),s={segmentId:`${e.connectionName}-seg-${t}`,segment:r,parentRoute:e},a=Math.floor(i.minX/this.CELL_SIZE),c=Math.floor((i.maxX+0.000000001)/this.CELL_SIZE),l=Math.floor(i.minY/this.CELL_SIZE),h=Math.floor((i.maxY+0.000000001)/this.CELL_SIZE);for(let d=a;d<=c;d++)for(let u=l;u<=h;u++){let _=`${d}x${u}`,p=this.segmentBuckets.get(_);p||(p=[],this.segmentBuckets.set(_,p)),p.push(s)}}if(e.vias&&e.vias.length>0)for(let t=0;t<e.vias.length;t++){let n=e.vias[t];if(n==null)continue;let o={viaId:`${e.connectionName}-via-${t}`,x:n.x,y:n.y,parentRoute:e},r=`${Math.floor(n.x/this.CELL_SIZE)}x${Math.floor(n.y/this.CELL_SIZE)}`,i=this.viaBuckets.get(r);i||(i=[],this.viaBuckets.set(r,i)),i.push(o)}}getConflictingRoutesNearPoint(e,t){let n=t+this.maximumCopperRadius,o=e.x-n,r=e.y-n,i=e.x+n,s=e.y+n,a=Math.floor(o/this.CELL_SIZE),c=Math.floor((i+0.000000001)/this.CELL_SIZE),l=Math.floor(r/this.CELL_SIZE),h=Math.floor((s+0.000000001)/this.CELL_SIZE),d=new Map,u=new Set,_=new Set;for(let m=a;m<=c;m++)for(let A=l;A<=h;A++){let g=`${m}x${A}`,f=this.segmentBuckets.get(g);if(f)for(let x of f){if(u.has(x.segmentId))continue;u.add(x.segmentId);let C=x.segment[0],b=x.segment[1];if(C.z!==b.z||C.z!==e.z)continue;let I=x.parentRoute,v={x:x.segment[0].x,y:x.segment[0].y},P={x:x.segment[1].x,y:x.segment[1].y},M=t+I.traceThickness/2,B=M*M,T=y$(e,v,P);if(T<B){let N=I.connectionName,D=d.get(N);(!D||T<D.minDistSq)&&d.set(N,{route:I,minDistSq:T})}}let y=this.viaBuckets.get(g);if(y)for(let x of y){if(_.has(x.viaId))continue;_.add(x.viaId);let C=x.parentRoute,b={x:x.x,y:x.y},I=t+C.viaDiameter/2,v=I*I,P=z3e(e,b);if(P<v){let M=C.connectionName,B=d.get(M);(!B||P<B.minDistSq)&&d.set(M,{route:C,minDistSq:P})}}}let p=[];for(let m of d.values())p.push({conflictingRoute:m.route,distance:Math.sqrt(m.minDistSq)});return p}};function nqe(e){let t=e;for(let r=0;r<10;r++)t=16807*t%2147483647;let n=t;t=(69069*e+1)%2147483647;for(let r=0;r<10;r++)t=48271*t%2147483647;let o=t;return()=>{let r=n;n=o,r^=r<<23,r^=r>>>17,r^=o,r^=o>>>26,o=r;let i=(n+o)/4294967296;return i-Math.floor(i)}}var Xpr={1:[[0]],2:[[0,1],[1,0]],3:[[0,1,2],[2,0,1],[1,0,2],[0,2,1],[1,2,0],[2,1,0]],4:[[0,1,2,3],[2,0,1,3],[1,3,2,0],[3,0,1,2],[0,2,1,3],[2,1,3,0],[3,0,2,1],[1,2,0,3],[3,1,0,2],[0,3,2,1],[2,3,0,1],[2,3,1,0],[1,2,3,0],[3,1,2,0],[0,1,3,2],[0,2,3,1],[0,3,1,2],[1,0,2,3],[1,0,3,2],[1,3,0,2],[2,0,3,1],[2,1,0,3],[3,2,0,1],[3,2,1,0]]};function e6(e,t){if(t===0)return e;if(e.length===0)return e;if(e.length<=4){let r=Xpr[e.length];return r[t%r.length].map((i)=>e[i])}let n=nqe(t),o=e.slice();for(let r=0;r<o.length;r++){let i=Math.floor(n()*o.length),s=Math.floor(n()*(r+1));[o[i],o[s]]=[o[s],o[i]]}return o}var jpr=class{heap=[];constructor(e){this.heap=[];for(let t of e)this.enqueue(t)}dequeue(){if(this.heap.length===0)return null;let e=this.heap[0];return this.heap[0]=this.heap[this.heap.length-1],this.heap.pop(),this.heapifyDown(),e}peek(){return this.heap.length===0?null:this.heap[0]}enqueue(e){this.heap.push(e),this.heapifyUp()}heapifyUp(){let e=this.heap.length-1,t=this.heap[e];for(;e>0;){let n=Math.floor((e-1)/2),o=this.heap[n];if(o.f<=t.f)break;this.heap[e]=o,e=n}this.heap[e]=t}heapifyDown(){let e=0,t=this.heap.length,n=this.heap[e];if(n){for(;;){let o=2*e+1;if(o>=t)break;let r=o+1,i=o;if(r<t&&this.heap[r].f<this.heap[o].f&&(i=r),n.f<this.heap[i].f)break;this.heap[e]=this.heap[i],e=i}this.heap[e]=n}}getTopN(e){return[...this.heap].sort((t,n)=>t.f-n.f).slice(0,e)}},GK=(e,t,n=[])=>[e,t?`rootConnectionName: ${t}`:void 0,...n].filter(Boolean).join(`
`),Kpr=class extends ei{getSolverName(){return"SingleHighDensityRouteSolver"}obstacleRoutes;bounds;boundsSize;boundsCenter;A;B;straightLineDistance;viaDiameter;traceThickness;obstacleMargin;layerCount;availableZ;minCellSize=0.05;cellStep=0.05;GREEDY_MULTIPLER=1.1;numRoutes;VIA_PENALTY_FACTOR=0.3;CELL_SIZE_FACTOR;NEARBY_SEGMENT_CLEARANCE;exploredNodes;viasInPathByNode=new WeakMap;gridMinXIndex;gridMinYIndex;gridWidth;gridHeight;candidates;connectionName;rootConnectionName;regionId;solvedPath=null;futureConnections;hyperParameters;connMap;obstacleSegments=[];obstacleSegmentIndex=null;obstacleSegmentsByLayer=new Map;obstacleSegmentIndexByLayer=new Map;obstacleVias=[];obstacleViaIndex=null;freePlanarObstaclePoints=new Map;cachedPlanarTraceProximity;cachedPlanarViaProximity;debug_exploredNodesOrdered;debug_nodesTooCloseToObstacle;debug_nodePathToParentIntersectsObstacle;debugEnabled;initialNodeGridOffset;constructor(e){super(),this.bounds=e.bounds,this.connMap=e.connMap,this.hyperParameters=e.hyperParameters??{},this.CELL_SIZE_FACTOR=this.hyperParameters.CELL_SIZE_FACTOR??1,this.boundsSize={width:this.bounds.maxX-this.bounds.minX,height:this.bounds.maxY-this.bounds.minY},this.boundsCenter={x:(this.bounds.minX+this.bounds.maxX)/2,y:(this.bounds.minY+this.bounds.maxY)/2},this.connectionName=e.connectionName,this.rootConnectionName=e.rootConnectionName,this.regionId=e.regionId,this.obstacleRoutes=e.obstacleRoutes,this.A=e.A,this.B=e.B,this.viaDiameter=e.viaDiameter??0.3,this.traceThickness=e.traceThickness??0.15,this.obstacleMargin=e.obstacleMargin??0.15,this.layerCount=e.layerCount??2,this.availableZ=e.availableZ&&e.availableZ.length>0?[...new Set(e.availableZ)].sort((d,u)=>d-u):Array.from({length:this.layerCount},(d,u)=>u),this.exploredNodes=new Set,this.straightLineDistance=kn(this.A,this.B),this.futureConnections=e.futureConnections??[],this.NEARBY_SEGMENT_CLEARANCE=e.nearbySegmentClearance??0.15,this.debugEnabled=e.captureSearchDebug??!0,this.MAX_ITERATIONS=1e4,this.debug_exploredNodesOrdered=[],this.debug_nodesTooCloseToObstacle=new Set,this.debug_nodePathToParentIntersectsObstacle=new Set,this.numRoutes=this.obstacleRoutes.length+this.futureConnections.length,this.buildObstacleIndexes();let t=Math.ceil(5*(this.numRoutes+1)),n=this.boundsSize.width/this.cellStep,o=this.boundsSize.height/this.cellStep;for(;n*o>t**2&&!(2*this.cellStep>e.minDistBetweenEnteringPoints);)this.cellStep*=2,n=this.boundsSize.width/this.cellStep,o=this.boundsSize.height/this.cellStep;this.cellStep*=this.CELL_SIZE_FACTOR,this.gridMinXIndex=Math.round(this.bounds.minX/this.cellStep)-1,this.gridMinYIndex=Math.round(this.bounds.minY/this.cellStep)-1;let r=Math.round(this.bounds.maxX/this.cellStep)+1,i=Math.round(this.bounds.maxY/this.cellStep)+1;this.gridWidth=r-this.gridMinXIndex+1,this.gridHeight=i-this.gridMinYIndex+1;let s=Math.abs(this.A.x-this.bounds.minX)<0.001&&Math.abs(this.B.x-this.bounds.minX)<0.001||Math.abs(this.A.x-this.bounds.maxX)<0.001&&Math.abs(this.B.x-this.bounds.maxX)<0.001||Math.abs(this.A.y-this.bounds.minY)<0.001&&Math.abs(this.B.y-this.bounds.minY)<0.001||Math.abs(this.A.y-this.bounds.maxY)<0.001&&Math.abs(this.B.y-this.bounds.maxY)<0.001;this.futureConnections&&this.futureConnections.length===0&&this.obstacleRoutes.length===0&&!s&&this.handleSimpleCases();let a={x:Math.round(e.A.x/(this.cellStep/2))*(this.cellStep/2),y:Math.round(e.A.y/(this.cellStep/2))*(this.cellStep/2)};this.initialNodeGridOffset={x:a.x-Math.round(e.A.x/this.cellStep)*this.cellStep,y:a.y-Math.round(e.A.y/this.cellStep)*this.cellStep};let c={...e.A,z:e.A.z??0,g:0,h:0,f:0,parent:null},l={...e.A,...a,z:e.A.z??0,g:0,h:0,f:0,parent:c},h=(Math.abs(l.x-e.A.x)>0.000000001||Math.abs(l.y-e.A.y)>0.000000001)&&(this.isNodeTooCloseToObstacle(l)||this.isNodeTooCloseToEdge(l,!1)||this.doesPathToParentIntersectObstacle(l));this.candidates=new jpr([h?c:l])}handleSimpleCases(){this.solved=!0;let{A:e,B:t}=this,n=e.z===t.z?[e,t]:[e,{...this.boundsCenter,z:this.A.z},{...this.boundsCenter,z:t.z},t];this.solvedPath={connectionName:this.connectionName,rootConnectionName:this.rootConnectionName,regionId:this.regionId,route:n,traceThickness:this.traceThickness,viaDiameter:this.viaDiameter,vias:this.A.z===this.B.z?[]:[this.boundsCenter]}}get viaPenaltyDistance(){return this.cellStep+this.straightLineDistance*this.VIA_PENALTY_FACTOR}isNodeTooCloseToObstacle(e,t,n,o){if(t??=this.obstacleMargin,n&&e.parent){let h=this.getViasInNodePath(e.parent);for(let d of h)if(kn(e,d)<this.viaDiameter/2+t)return!0}let r=this.traceThickness+t,i=this.viaDiameter/2+this.traceThickness/2+t,s=!n&&this.gridWidth!==void 0&&(!o||o.pointQueryProximity===r)&&(this.obstacleViaIndex!==null||this.obstacleSegmentIndexByLayer.has(e.z))?o?.pointKey??this.getNodeKey(e):void 0;if(s!==void 0){this.cachedPlanarTraceProximity===r&&this.cachedPlanarViaProximity===i||(this.freePlanarObstaclePoints.clear(),this.cachedPlanarTraceProximity=r,this.cachedPlanarViaProximity=i);let h=this.freePlanarObstaclePoints.get(s);if(h&&h.x===e.x&&h.y===e.y&&h.z===e.z)return!1}let a=o?.segments??(n?this.obstacleSegments:this.obstacleSegmentsByLayer.get(e.z)),c=o?.segmentIds??(n?this.obstacleSegmentIndex:this.obstacleSegmentIndexByLayer.get(e.z))?.search(e.x-r,e.y-r,e.x+r,e.y+r)??[],l=o?.segmentBounds;if(a)for(let h of c){let d=a[h];if(d&&!d.connectedToCurrentConnection&&((n||d.z===e.z)&&!(l&&(l.maxX<d.minX||l.maxY<d.minY||l.minX>d.maxX||l.minY>d.maxY)||o&&(e.x+r<d.minX||e.y+r<d.minY||e.x-r>d.maxX||e.y-r>d.maxY)||!(Math.sqrt(qae(e,d.A,d.deltaX,d.deltaY,d.lengthSquared))<r))))return!0}if(this.obstacleViaIndex){let h=this.obstacleViaIndex.search(e.x-i,e.y-i,e.x+i,e.y+i);for(let d of h){let u=this.obstacleVias[d];if(u&&kn(e,u)<i)return!0}}return s!==void 0&&this.freePlanarObstaclePoints.set(s,{x:e.x,y:e.y,z:e.z}),!1}isNodeTooCloseToEdge(e,t){let n=t?this.viaDiameter/2+this.obstacleMargin/2:this.obstacleMargin/2,o=e.x<this.bounds.minX+n||e.x>this.bounds.maxX-n||e.y<this.bounds.minY+n||e.y>this.bounds.maxY-n;return!(o&&!t&&(kn(e,this.B)<2*n||kn(e,this.A)<2*n))&&o}doesPathToParentIntersectObstacle(e,t){let n=e.parent;if(!n)return!1;let o=t?.segments??this.obstacleSegmentsByLayer.get(e.z);if(!o)return!1;let r=e.z===n.z&&this.obstacleSegments.length>0?this.NEARBY_SEGMENT_CLEARANCE:0,i=Math.min(e.x,n.x),s=Math.max(e.x,n.x),a=Math.min(e.y,n.y),c=Math.max(e.y,n.y),l=t?.segmentIds??this.obstacleSegmentIndexByLayer.get(e.z)?.search(i-r,a-r,s+r,c+r)??[],h=t?.segmentBounds,d=n.x-e.x,u=n.y-e.y,_=d**2+u**2;for(let p of l){let m=o[p];if(m&&!m.connectedToCurrentConnection&&(m.z===e.z&&!(h&&(h.maxX<m.minX||h.maxY<m.minY||h.minX>m.maxX||h.minY>m.maxY)||t&&(s+r<m.minX||c+r<m.minY||i-r>m.maxX||a-r>m.maxY)))){if(Ru(e,n,m.A,m.B))return!0;if(r>0&&qpr(e,n,d,u,_,m)<r)return!0}}return!1}getPlanarObstacleQuery(e,t,n){let o=e.parent;if(!o)return;let r=t?void 0:this.obstacleSegmentIndexByLayer.get(e.z),i=t?.segments??this.obstacleSegmentsByLayer.get(e.z);if(!i||!t&&!r)return;let s=this.traceThickness+this.obstacleMargin,a=e.z===o.z&&this.obstacleSegments.length>0?this.NEARBY_SEGMENT_CLEARANCE:0,c=Math.min(e.x-s,o.x-a),l=Math.min(e.y-s,o.y-a),h=Math.max(e.x+s,o.x+a),d=Math.max(e.y+s,o.y+a);if(t){let u=t.segmentBounds??={minX:c,minY:l,maxX:h,maxY:d};return u.minX=c,u.minY=l,u.maxX=h,u.maxY=d,t.pointQueryProximity=s,t.pointKey=n,t}return{segments:i,segmentIds:r.search(c,l,h,d),pointQueryProximity:s,pointKey:n}}getPlanarNeighborObstacleQuery(e){let t=this.obstacleSegmentIndexByLayer.get(e.z),n=this.obstacleSegmentsByLayer.get(e.z);if(!t||!n)return;let o=this.traceThickness+this.obstacleMargin,r=this.obstacleSegments.length>0?this.NEARBY_SEGMENT_CLEARANCE:0,{minX:i,minY:s,maxX:a,maxY:c}=this.bounds,l=UK(e.x-this.cellStep,i,a),h=UK(e.y-this.cellStep,s,c),d=UK(e.x+this.cellStep,i,a),u=UK(e.y+this.cellStep,s,c);return{segments:n,segmentIds:t.search(Math.min(l-o,e.x-r),Math.min(h-o,e.y-r),Math.max(d+o,e.x+r),Math.max(u+o,e.y+r))}}buildObstacleIndexes(){if(this.freePlanarObstaclePoints.clear(),this.obstacleRoutes.length===0)return this.obstacleSegmentIndex=null,this.obstacleSegmentsByLayer.clear(),this.obstacleSegmentIndexByLayer.clear(),void(this.obstacleViaIndex=null);let e=[],t=[];for(let n of this.obstacleRoutes){let o=this.connMap?.areIdsConnected?.(this.connectionName,n.connectionName)??!1;for(let r of $pr(n)){let i=r.B.x-r.A.x,s=r.B.y-r.A.y;e.push({...r,deltaX:i,deltaY:s,lengthSquared:i**2+s**2,minX:Math.min(r.A.x,r.B.x),minY:Math.min(r.A.y,r.B.y),maxX:Math.max(r.A.x,r.B.x),maxY:Math.max(r.A.y,r.B.y),connectedToCurrentConnection:o})}for(let r of n.vias)t.push(r)}if(this.obstacleSegments=e,this.obstacleVias=t,this.obstacleSegmentsByLayer.clear(),this.obstacleSegmentIndexByLayer.clear(),e.length>0){let n=new R_(e.length);for(let o of e)n.add(o.minX,o.minY,o.maxX,o.maxY);n.finish(),this.obstacleSegmentIndex=n;for(let o of e){if(o.connectedToCurrentConnection)continue;let r=this.obstacleSegmentsByLayer.get(o.z);r?r.push(o):this.obstacleSegmentsByLayer.set(o.z,[o])}for(let[o,r]of this.obstacleSegmentsByLayer){let i=new R_(r.length);for(let s of r)i.add(s.minX,s.minY,s.maxX,s.maxY);i.finish(),this.obstacleSegmentIndexByLayer.set(o,i)}}else this.obstacleSegmentIndex=null;if(t.length>0){let n=new R_(t.length);for(let o of t)n.add(o.x,o.y,o.x,o.y);n.finish(),this.obstacleViaIndex=n}else this.obstacleViaIndex=null}computeH(e){return kn(e,this.B)+(e.z!==this.B.z?this.viaPenaltyDistance:0)}computeG(e){return(e.parent?.g??0)+(e.z===e.parent?.z?0:this.viaPenaltyDistance)+kn(e,e.parent)}computeF(e,t){return e+t*this.GREEDY_MULTIPLER}setNodeCosts(e){e.g=this.computeG(e),e.h=this.computeH(e),e.f=this.computeF(e.g,e.h)}getNodeKey(e){let t=Math.round(e.x/this.cellStep)-this.gridMinXIndex,n=Math.round(e.y/this.cellStep)-this.gridMinYIndex;return(e.z*this.gridHeight+n)*this.gridWidth+t}getNeighbors(e){let t=[],n,o=!1,{maxX:r,minX:i,maxY:s,minY:a}=this.bounds;for(let c=-1;c<=1;c++)for(let l=-1;l<=1;l++){if(c===0&&l===0)continue;let h={x:UK(e.x+c*this.cellStep,i,r),y:UK(e.y+l*this.cellStep,a,s),z:e.z,g:e.g,h:e.h,f:e.f,parent:e},d=this.getNodeKey(h);if(this.exploredNodes.has(d))continue;o||(n=this.getPlanarNeighborObstacleQuery(e),o=!0);let u=this.getPlanarObstacleQuery(h,n,d);this.isNodeTooCloseToObstacle(h,void 0,!1,u)?(this.debugEnabled&&this.debug_nodesTooCloseToObstacle.add(d),this.exploredNodes.add(d)):this.isNodeTooCloseToEdge(h,!1)?this.exploredNodes.add(d):this.doesPathToParentIntersectObstacle(h,u)?(this.debugEnabled&&this.debug_nodePathToParentIntersectsObstacle.add(d),this.exploredNodes.add(d)):(this.setNodeCosts(h),t.push(h))}for(let c of this.availableZ){if(c===e.z)continue;let l={x:e.x,y:e.y,z:c,g:e.g,h:e.h,f:e.f,parent:e};this.exploredNodes.has(this.getNodeKey(l))||this.isNodeTooCloseToObstacle(l,this.viaDiameter/2+this.obstacleMargin/2,!0)||this.isNodeTooCloseToEdge(l,!0)||(this.setNodeCosts(l),t.push(l))}return t}getNodePath(e){let t=[];for(;e;)t.push(e),e=e.parent;return t}getViasInNodePath(e){let t=this.viasInPathByNode.get(e);if(t)return t;let n=e.parent,o=n?this.getViasInNodePath(n):[],r=n&&e.z!==n.z?[{x:e.x,y:e.y},...o]:o;return this.viasInPathByNode.set(e,r),r}setSolvedPath(e){let t=this.getNodePath(e);t.reverse();let n=[];for(let o=0;o<t.length-1;o++)t[o].z!==t[o+1].z&&n.push({x:t[o].x,y:t[o].y});this.solvedPath={connectionName:this.connectionName,rootConnectionName:this.rootConnectionName,regionId:this.regionId,traceThickness:this.traceThickness,viaDiameter:this.viaDiameter,route:t.map((o)=>({x:o.x,y:o.y,z:o.z})).concat([this.B]),vias:n}}computeProgress(e,t,n){if(t===void 0||n===void 0)return Number.NaN;n||(t+=this.viaPenaltyDistance);let o=1-t/this.straightLineDistance;return Math.max(this.progress||0,2/Math.PI*Math.atan(0.112*o/(1-o)))}_step(){let e=this.candidates.dequeue(),t=e?this.getNodeKey(e):void 0;for(;e&&t&&this.exploredNodes.has(t);)e=this.candidates.dequeue(),t=e?this.getNodeKey(e):void 0;if(!e||!t)return this.failed=!0,void(this.error="Ran out of candidate nodes to explore");this.exploredNodes.add(t),this.debugEnabled&&this.debug_exploredNodesOrdered.push({key:t,x:Math.round(e.x/this.cellStep)*this.cellStep+this.initialNodeGridOffset.x,y:Math.round(e.y/this.cellStep)*this.cellStep+this.initialNodeGridOffset.y,z:e.z});let n=kn(e,this.B);this.progress=this.computeProgress(e,n,e.z===this.B.z),n<=this.cellStep*Math.SQRT2&&e.z===this.B.z&&!this.doesPathToParentIntersectObstacle({...e,parent:e,x:this.B.x,y:this.B.y})&&(this.solved=!0,this.setSolvedPath(e));let o=this.getNeighbors(e);for(let r of o)this.candidates.enqueue(r)}visualize(){let e={lines:[],points:[],rects:[],circles:[]};e.points.push({x:this.A.x,y:this.A.y,label:GK(this.connectionName,this.rootConnectionName,["Input A",`z: ${this.A.z}`]),color:"orange"}),e.points.push({x:this.B.x,y:this.B.y,label:GK(this.connectionName,this.rootConnectionName,["Input B",`z: ${this.B.z}`]),color:"orange"}),e.lines.push({points:[this.A,this.B],strokeColor:"rgba(255, 0, 0, 0.5)",label:GK(this.connectionName,this.rootConnectionName,["Direct Input Connection"])});for(let t=0;t<this.obstacleRoutes.length;t++){let n=this.obstacleRoutes[t];for(let o=0;o<n.route.length-1;o++){let r=n.route[o].z;e.lines.push({points:[n.route[o],n.route[o+1]],strokeColor:r===0?"rgba(255, 0, 0, 0.75)":"rgba(255, 128, 0, 0.25)",strokeWidth:n.traceThickness,label:GK(n.connectionName,n.rootConnectionName,["Obstacle Route"]),layer:`obstacle${t.toString()}`})}}for(let t=0;t<this.debug_exploredNodesOrdered.length;t++){let{key:n,x:o,y:r,z:i}=this.debug_exploredNodesOrdered[t];this.debug_nodesTooCloseToObstacle.has(n)||(this.debug_nodePathToParentIntersectsObstacle.has(n)||e.rects.push({center:{x:o+i*this.cellStep/20,y:r+i*this.cellStep/20},fill:i===0?`rgba(255,0,255,${0.3-t/this.debug_exploredNodesOrdered.length*0.2})`:`rgba(0,0,255,${0.3-t/this.debug_exploredNodesOrdered.length*0.2})`,width:0.9*this.cellStep,height:0.9*this.cellStep,label:`Explored (z=${i})`}))}if(this.candidates.peek()){let t=this.candidates.peek();e.rects.push({center:{x:t.x+t.z*this.cellStep/20,y:t.y+t.z*this.cellStep/20},fill:"rgba(0, 255, 0, 0.8)",width:0.9*this.cellStep,height:0.9*this.cellStep,label:`Next (z=${t.z})`})}for(let t of this.obstacleRoutes)for(let n of t.vias)e.circles.push({center:{x:n.x,y:n.y},radius:this.viaDiameter/2,fill:"rgba(255, 0, 0, 0.5)",label:"Via"});if(this.solvedPath){e.lines.push({points:this.solvedPath.route,strokeColor:"green",label:GK(this.solvedPath.connectionName,this.solvedPath.rootConnectionName,["Solved Route"])});for(let t of this.solvedPath.vias)e.circles.push({center:t,radius:this.viaDiameter/2,fill:"green",label:GK(this.solvedPath.connectionName,this.solvedPath.rootConnectionName,["Via"])})}return e}};function $pr(e){let t=[];for(let n=0;n<e.route.length-1;n++)e.route[n].z===e.route[n+1].z&&t.push({z:e.route[n].z,A:e.route[n],B:e.route[n+1]});return t}function UK(e,t,n){return Math.max(t,Math.min(e,n))}function qpr(e,t,n,o,r,i){return Math.sqrt(Math.min(qae(e,i.A,i.deltaX,i.deltaY,i.lengthSquared),qae(t,i.A,i.deltaX,i.deltaY,i.lengthSquared),qae(i.A,e,n,o,r),qae(i.B,e,n,o,r)))}function qae(e,t,n,o,r){if(r===0){let h=e.x-t.x,d=e.y-t.y;return h*h+d*d}let i=Math.max(0,Math.min(1,((e.x-t.x)*n+(e.y-t.y)*o)/r)),s=t.x+i*n,a=t.y+i*o,c=e.x-s,l=e.y-a;return c*c+l*l}var qLt=class extends Kpr{FUTURE_CONNECTION_PROX_TRACE_PENALTY_FACTOR=2;FUTURE_CONNECTION_PROX_VIA_PENALTY_FACTOR=1;FUTURE_CONNECTION_PROXIMITY_VD=10;MISALIGNED_DIST_PENALTY_FACTOR=5;VIA_PENALTY_FACTOR_2=1;FLIP_TRACE_ALIGNMENT_DIRECTION=!1;FUTURE_CONNECTION_VIA_TRACE_CLEARANCE=0.1;futureConnectionPoints;futureConnectionSegmentsCache=null;closestFuturePointCacheCoordinates=new Float64Array(1024);closestFuturePointCacheIndices=new Int32Array(256).fill(-2);cachedFutureConnectionPoints;cachedFutureConnectionPointCount=0;constructor(e){super({...e,nearbySegmentClearance:e.nearbySegmentClearance??(e.traceThickness??0.15)/2+(e.obstacleMargin??0.15)});for(let o in e.hyperParameters)this[o]=e.hyperParameters[o];let t=this.boundsSize.width/this.viaDiameter,n=Math.max(1,this.numRoutes);this.VIA_PENALTY_FACTOR=t/n*0.3*this.VIA_PENALTY_FACTOR_2,this.futureConnectionPoints=this.futureConnections.flatMap((o)=>o.points)}getClosestFutureConnectionPoint(e){this.cachedFutureConnectionPoints===this.futureConnectionPoints&&this.cachedFutureConnectionPointCount===this.futureConnectionPoints.length||(this.closestFuturePointCacheIndices.fill(-2),this.cachedFutureConnectionPoints=this.futureConnectionPoints,this.cachedFutureConnectionPointCount=this.futureConnectionPoints.length);let t=this.getNodeKey(e),n=Number.isSafeInteger(t)?Math.abs(t%256):-1,o=4*n,r=this.viaPenaltyDistance,i=this.closestFuturePointCacheIndices[n];if(n>=0&&i>=-1&&this.closestFuturePointCacheCoordinates[o]===e.x&&this.closestFuturePointCacheCoordinates[o+1]===e.y&&this.closestFuturePointCacheCoordinates[o+2]===e.z&&this.closestFuturePointCacheCoordinates[o+3]===r)return i===-1?null:this.futureConnectionPoints[i];let s=1/0,a=null,c=-1,l=0;for(let h of this.futureConnectionPoints){let d=kn(e,h)+(e.z!==h.z?this.viaPenaltyDistance:0);d<s&&(s=d,a=h,c=l),l++}return n>=0&&(this.closestFuturePointCacheCoordinates[o]=e.x,this.closestFuturePointCacheCoordinates[o+1]=e.y,this.closestFuturePointCacheCoordinates[o+2]=e.z,this.closestFuturePointCacheCoordinates[o+3]=r,this.closestFuturePointCacheIndices[n]=c),a}getFutureConnectionSegments(){if(this.futureConnectionSegmentsCache)return this.futureConnectionSegmentsCache;let e=[];for(let t of this.futureConnections){if(t.connectionName===this.connectionName||(this.connMap?.areIdsConnected?.(this.connectionName,t.connectionName)??!1))continue;let[n,...o]=t.points;if(n)for(let r of o)Math.abs(n.x-r.x)<0.000000001&&Math.abs(n.y-r.y)<0.000000001||e.push({connectionName:t.connectionName,start:n,end:r})}return this.futureConnectionSegmentsCache=e,e}isViaTooCloseToFutureConnectionTrace(e){let t=this.viaDiameter/2+this.traceThickness/2+this.FUTURE_CONNECTION_VIA_TRACE_CLEARANCE;for(let n of this.getFutureConnectionSegments())if(xc(e,n.start,n.end)<t)return!0;return!1}isNodeTooCloseToObstacle(e,t,n,o){return!!super.isNodeTooCloseToObstacle(e,t,n,o)||!(!n||!this.isViaTooCloseToFutureConnectionTrace(e))}diminishCloseToGoal(e){let t=kn(e,this.B);return 1-Math.exp(-t/this.straightLineDistance*5)}getFutureConnectionPenalty(e,t){let n=0,o=this.getClosestFutureConnectionPoint(e),r=kn(e,this.B);if(o){let i=kn(e,o);if(r<=i)return 0;let s=i/(this.viaDiameter*this.FUTURE_CONNECTION_PROXIMITY_VD);n=(t?this.straightLineDistance*this.FUTURE_CONNECTION_PROX_VIA_PENALTY_FACTOR:this.straightLineDistance*this.FUTURE_CONNECTION_PROX_TRACE_PENALTY_FACTOR)*Math.exp(5*-s)}return n}computeH(e){let t=kn(e,this.B)**1.6;return this.straightLineDistance,t+(e.z!==this.B.z?this.viaPenaltyDistance:0)+this.getFutureConnectionPenalty(e,e.z!==e.parent?.z)}computeG(e){let t=Math.abs(e.x-e.parent.x),n=Math.abs(e.y-e.parent.y),o=Math.sqrt(t**2+n**2),r=e.z%2==0,i=this.FLIP_TRACE_ALIGNMENT_DIRECTION?r?t:n:r?n:t;return(e.parent?.g??0)+(e.z===e.parent?.z?0:this.viaPenaltyDistance)+o+i*this.MISALIGNED_DIST_PENALTY_FACTOR+this.getFutureConnectionPenalty(e,e.z!==e.parent?.z)}setNodeCosts(e){let t=Math.abs(e.x-e.parent.x),n=Math.abs(e.y-e.parent.y),o=Math.sqrt(t**2+n**2),r=e.z%2==0,i=this.FLIP_TRACE_ALIGNMENT_DIRECTION?r?t:n:r?n:t,s=(e.parent?.g??0)+(e.z===e.parent?.z?0:this.viaPenaltyDistance)+o+i*this.MISALIGNED_DIST_PENALTY_FACTOR,a=kn(e,this.B)**1.6+(e.z!==this.B.z?this.viaPenaltyDistance:0),c=this.getFutureConnectionPenalty(e,e.z!==e.parent?.z);e.g=s+c,e.h=a+c,e.f=this.computeF(e.g,e.h)}},Jpr=(e)=>{let t=1/0,n=e.portPoints;for(let o=0;o<n.length;o++)for(let r=o+1;r<n.length;r++){let i=n[o],s=n[r];if(i.z!==s.z)continue;if(i.rootConnectionName&&i.rootConnectionName===s.rootConnectionName)continue;let a=Math.sqrt((i.x-s.x)**2+(i.y-s.y)**2);t=Math.min(t,a)}return t===1/0?0:t},kUt=(e)=>{let t=new Map,n=new Map,o=new Map;for(let{connectionName:r,rootConnectionName:i,x:s,y:a,z:c}of e.portPoints){i&&n.set(r,i);let l=t.get(r),h=o.get(r);l&&h||(l=[],h=new Set,t.set(r,l),o.set(r,h));let d=c??0,u=`${s.toFixed(6)},${a.toFixed(6)},${d}`;h.has(u)||(h.add(u),l.push({x:s,y:a,z:d}))}return{connectionPointsByName:t,rootConnectionNameByConnectionName:n,minDistBetweenEnteringPoints:Jpr(e)}},FWe=(e,t,n=[])=>[e,t?`rootConnectionName: ${t}`:void 0,...n].filter(Boolean).join(`
`),Zpr=(e)=>`${e.x.toFixed(6)},${e.y.toFixed(6)},${e.z}`,fbe=class extends ei{getSolverName(){return"IntraNodeRouteSolver"}nodeWithPortPoints;colorMap;unsolvedConnections;originalConnectionPointsByName;rootConnectionNameByConnectionName;totalConnections;solvedRoutes;failedSubSolvers;hyperParameters;minDistBetweenEnteringPoints;viaDiameter;traceWidth;obstacleMargin;captureSearchDebug;rerouteAttemptsByConnection;POSTROUTE_VIA_TRACE_CLEARANCE=0.1;MAX_POSTROUTE_REPAIR_ATTEMPTS=2;activeSubSolver=null;connMap;get failedSolvers(){return this.failedSubSolvers}get activeSolver(){return this.activeSubSolver}constructor(e){let{nodeWithPortPoints:t,colorMap:n}=e;super(),this.nodeWithPortPoints=t,this.colorMap=n??{},this.solvedRoutes=[],this.hyperParameters=e.hyperParameters??{},this.failedSubSolvers=[],this.connMap=e.connMap,this.viaDiameter=e.viaDiameter??0.3,this.traceWidth=e.traceWidth??0.15,this.obstacleMargin=e.obstacleMargin??0.15,this.captureSearchDebug=e.captureSearchDebug??!0;let o=e.precomputedIntraNodeRouteParams??kUt(t);this.rootConnectionNameByConnectionName=new Map(o.rootConnectionNameByConnectionName),this.originalConnectionPointsByName=new Map(Array.from(o.connectionPointsByName.entries()).map(([r,i])=>[r,i.map((s)=>({...s}))])),this.unsolvedConnections=Array.from(this.originalConnectionPointsByName.entries().map(([r,i])=>({connectionName:r,rootConnectionName:this.rootConnectionNameByConnectionName.get(r),points:[...i]}))),this.rerouteAttemptsByConnection=new Map,this.hyperParameters.SHUFFLE_SEED&&(this.unsolvedConnections=e6(this.unsolvedConnections,this.hyperParameters.SHUFFLE_SEED??0),this.unsolvedConnections=this.unsolvedConnections.map(({points:r,...i},s)=>({...i,points:e6(r,7117*s+(this.hyperParameters.SHUFFLE_SEED??0))}))),this.totalConnections=this.unsolvedConnections.length,this.MAX_ITERATIONS=1000*this.totalConnections**1.5,this.minDistBetweenEnteringPoints=o.minDistBetweenEnteringPoints}computeProgress(){return(this.solvedRoutes.length+(this.activeSubSolver?.progress||0))/this.totalConnections}getSingleRouteSolverOpts(e){let{connectionName:t,rootConnectionName:n,points:o}=e;return{connectionName:t,rootConnectionName:n,regionId:this.nodeWithPortPoints.capacityMeshNodeId,minDistBetweenEnteringPoints:this.minDistBetweenEnteringPoints,bounds:zce(this.nodeWithPortPoints),A:{x:o[0].x,y:o[0].y,z:o[0].z},B:{x:o[o.length-1].x,y:o[o.length-1].y,z:o[o.length-1].z},obstacleRoutes:this.connMap?this.solvedRoutes.filter((r)=>!this.connMap.areIdsConnected(r.connectionName,t)):this.solvedRoutes,futureConnections:this.unsolvedConnections,layerCount:this.nodeWithPortPoints.portPoints.reduce((r,i)=>Math.max(r,(i.z??0)+1),2),availableZ:this.nodeWithPortPoints.availableZ&&this.nodeWithPortPoints.availableZ.length>0?this.nodeWithPortPoints.availableZ:[...new Set(this.nodeWithPortPoints.portPoints.map((r)=>r.z??0))].sort((r,i)=>r-i),hyperParameters:this.hyperParameters,connMap:this.connMap,viaDiameter:this.viaDiameter,traceThickness:this.traceWidth,obstacleMargin:this.obstacleMargin,captureSearchDebug:this.captureSearchDebug}}trySolveSamePointLayerChange(e){let t=this.getSingleRouteSolverOpts(e),n=new qLt(t),{A:o,B:r}=t,i={x:o.x,y:o.y};if(!emr(n,i,o,r))return!1;let s=[{x:o.x,y:o.y,z:o.z},{...i,z:o.z},{...i,z:r.z},{x:r.x,y:r.y,z:r.z}].filter((a,c,l)=>c===0||Math.abs(a.x-l[c-1].x)>0.000001||Math.abs(a.y-l[c-1].y)>0.000001||a.z!==l[c-1].z);return this.solvedRoutes.push({connectionName:e.connectionName,rootConnectionName:e.rootConnectionName,regionId:this.nodeWithPortPoints.capacityMeshNodeId,traceThickness:this.traceWidth,viaDiameter:this.viaDiameter,route:s,vias:[{x:i.x,y:i.y}]}),!0}queueExtraBranchesForMultiPointConnection(e){let[t,...n]=((o)=>{let r=new Set,i=[];for(let s of o){let a=Zpr(s);r.has(a)||(r.add(a),i.push(s))}return i})(e.points);if(!t||n.length<=1)return!1;for(let o of n)this.unsolvedConnections.push({connectionName:e.connectionName,rootConnectionName:e.rootConnectionName,points:[t,o]});return!0}getAvailableZLayers(){return this.nodeWithPortPoints.availableZ&&this.nodeWithPortPoints.availableZ.length>0?[...new Set(this.nodeWithPortPoints.availableZ)].sort((e,t)=>e-t):[...new Set(this.nodeWithPortPoints.portPoints.map((e)=>e.z??0))].sort((e,t)=>e-t)}getFirstSolvedViaTraceConflict(){if(this.solvedRoutes.length<2)return null;let e=new rCe(this.solvedRoutes),t=this.getAvailableZLayers();for(let n of this.solvedRoutes){let o=n.viaDiameter/2+this.POSTROUTE_VIA_TRACE_CLEARANCE;for(let r of n.vias)for(let i of t){let s=e.getConflictingRoutesNearPoint({x:r.x,y:r.y,z:i},o).filter(({conflictingRoute:a})=>a.connectionName!==n.connectionName&&!this.connMap?.areIdsConnected(n.connectionName,a.connectionName));if(s.length>0)return{route:n,via:r,conflictingRoute:s[0].conflictingRoute}}}return null}queueConnectionForPostrouteRepair(e){let t=this.originalConnectionPointsByName.get(e);return!(!t||t.length<2)&&(this.solvedRoutes=this.solvedRoutes.filter((n)=>n.connectionName!==e),this.unsolvedConnections.push({connectionName:e,rootConnectionName:this.rootConnectionNameByConnectionName.get(e),points:t.map((n)=>({...n}))}),this.rerouteAttemptsByConnection.set(e,(this.rerouteAttemptsByConnection.get(e)??0)+1),!0)}_step(){if(this.activeSubSolver){if(this.activeSubSolver.step(),this.progress=this.computeProgress(),this.activeSubSolver.solved)this.solvedRoutes.push(this.activeSubSolver.solvedPath),this.activeSubSolver=null;else if(this.activeSubSolver.failed){let t=this.activeSubSolver;this.activeSubSolver=null,this.error=t.error,this.captureSearchDebug&&this.failedSubSolvers.push(t),this.failed=!0}return}let e=this.unsolvedConnections.pop();if(this.progress=this.computeProgress(),!e){let t=this.getFirstSolvedViaTraceConflict();if(t){if((this.rerouteAttemptsByConnection.get(t.route.connectionName)??0)>=this.MAX_POSTROUTE_REPAIR_ATTEMPTS)return this.error=["Post-route via/trace clearance repair exceeded retry budget",`route: ${t.route.connectionName}`,`conflicts with: ${t.conflictingRoute.connectionName}`,`via: (${t.via.x.toFixed(3)}, ${t.via.y.toFixed(3)})`].join(`
`),void(this.failed=!0);if(this.queueConnectionForPostrouteRepair(t.route.connectionName))return void(this.progress=this.computeProgress())}return void(this.solved=this.failedSubSolvers.length===0)}if(e.points.length!==1&&!(e.points.length>2&&this.queueExtraBranchesForMultiPointConnection(e))){if(e.points.length===2){let[t,n]=e.points,o=Math.abs(t.x-n.x)<0.000001,r=Math.abs(t.y-n.y)<0.000001;if(o&&r&&t.z===n.z)return;if(o&&r&&t.z!==n.z&&this.trySolveSamePointLayerChange(e))return}this.activeSubSolver=new qLt(this.getSingleRouteSolverOpts(e))}}visualize(){let e={lines:[],points:[],rects:[],circles:[]};for(let s of this.nodeWithPortPoints.portPoints)e.points.push({x:s.x,y:s.y,label:FWe(s.connectionName,s.rootConnectionName,[`layer: ${s.z}`]),color:this.colorMap[s.connectionName]??"blue"});for(let s=0;s<this.solvedRoutes.length;s++){let a=this.solvedRoutes[s];if(a.route.length>0){let c=this.colorMap[a.connectionName]??"blue",l=a.rootConnectionName??this.rootConnectionNameByConnectionName.get(a.connectionName);for(let h=0;h<a.route.length-1;h++){let d=a.route[h],u=a.route[h+1];e.lines.push({points:[d,u],label:FWe(a.connectionName,l,[`layer: ${d.z}`]),strokeColor:d.z===0?zi(c,0.2):zi(c,0.8),layer:`route-layer-${d.z}`,step:s,strokeWidth:a.traceThickness})}for(let h of a.vias)e.circles.push({center:{x:h.x,y:h.y},radius:a.viaDiameter/2,fill:zi(c,0.5),layer:"via",step:s,label:FWe(a.connectionName,l,["via"])})}}let t=zce(this.nodeWithPortPoints),{minX:n,minY:o,maxX:r,maxY:i}=t;return e.lines.push({points:[{x:n,y:o},{x:r,y:o},{x:r,y:i},{x:n,y:i},{x:n,y:o}],strokeColor:"rgba(255, 0, 0, 0.25)",strokeDash:"4 4",layer:"border"}),e}},emr=(e,t,n,o)=>{let r={x:t.x,y:t.y,z:n.z,parent:{x:n.x,y:n.y,z:n.z,g:0,h:0,f:0,parent:null},g:0,h:0,f:0};return!e.isNodeTooCloseToObstacle(r,e.viaDiameter/2+e.obstacleMargin/2,!0)&&!e.isNodeTooCloseToEdge(r,!0)},Vb=(e)=>Math.round(200*e)/200,JLt=(e)=>typeof structuredClone=="function"?structuredClone(e):JSON.parse(JSON.stringify(e));_be();var oqe=class extends fbe{getSolverName(){return"CachedIntraNodeRouteSolver"}cacheProvider;cacheHit=!1;hasAttemptedToUseCache=!1;initialUnsolvedConnections;constructor(e){super(e),this.cacheProvider=e.cacheProvider===void 0?hv():e.cacheProvider,this.initialUnsolvedConnections=this.unsolvedConnections.map((t)=>({...t,points:t.points.map((n)=>({...n}))})),(this.solved||this.failed)&&this.cacheProvider&&!this.cacheHit&&this.saveToCacheSync()}_step(){if(!this.hasAttemptedToUseCache&&this.cacheProvider&&this.attemptToUseCacheSync())return;let e=this.solved,t=this.failed;super._step(),!this.cacheProvider||this.cacheHit||!this.solved&&!this.failed||e||t||this.saveToCacheSync()}computeCacheKeyAndTransform(){let e=this.nodeWithPortPoints.center,t=this.initialUnsolvedConnections.map(({connectionName:l,rootConnectionName:h,points:d})=>({connectionName:l,rootConnectionName:h,points:d.map((u)=>({connectionName:l,x:Vb(u.x-e.x),y:Vb(u.y-e.y),z:u.z??0}))})),n=[...this.nodeWithPortPoints.portPoints].sort((l,h)=>l.connectionName!==h.connectionName?l.connectionName.localeCompare(h.connectionName):(l.portPointId??"")!==(h.portPointId??"")?(l.portPointId??"").localeCompare(h.portPointId??""):l.x!==h.x?l.x-h.x:l.y!==h.y?l.y-h.y:(l.z??0)-(h.z??0)).map((l)=>({connectionName:l.connectionName,rootConnectionName:l.rootConnectionName,portPointId:l.portPointId,prevPortPointId:l.prevPortPointId,nextPortPointId:l.nextPortPointId,x:Vb(l.x-e.x),y:Vb(l.y-e.y),z:l.z??0})),o=Object.fromEntries(Object.entries(this.hyperParameters??{}).filter(([,l])=>l!==void 0).sort(([l],[h])=>l.localeCompare(h))),r=this.connMap?this.initialUnsolvedConnections.map(({connectionName:l})=>({connectionName:l,connectedIds:[...new Set(this.connMap.getIdsConnectedToNet(l)??[])].sort()})):void 0,i={cacheSchemaVersion:6,node:{width:Vb(this.nodeWithPortPoints.width),height:Vb(this.nodeWithPortPoints.height),center:{x:Vb(this.nodeWithPortPoints.center.x),y:Vb(this.nodeWithPortPoints.center.y)},availableZ:this.nodeWithPortPoints.availableZ?[...this.nodeWithPortPoints.availableZ].sort():void 0,portPoints:n},normalizedConnections:t,normalizedHyperParameters:o,minDistBetweenEnteringPoints:Vb(this.minDistBetweenEnteringPoints),traceWidth:Vb(this.traceWidth),viaDiameter:Vb(this.viaDiameter),obstacleMargin:Vb(this.obstacleMargin),normalizedConnMap:r},s=JSON.stringify(i,(l,h)=>typeof h!="number"||Number.isFinite(h)?typeof h=="string"&&(h==="u:"||h.startsWith("n:")||h.startsWith("s:"))?`s:${h}`:h===void 0?"u:":h:`n:${h.toString()}`),a=`intranode-solver:${QUt.default(s)}`,c={};return this.cacheKey=a,this.cacheToSolveSpaceTransform=c,{cacheKey:a,cacheToSolveSpaceTransform:c}}applyCachedSolution(e){e.success?(this.solvedRoutes=JLt(e.solvedRoutes),this.solved=!0,this.failed=!1):(this.solvedRoutes=[],this.failedSubSolvers=[],this.solved=!1,this.failed=!0,this.error=e.error??this.error),this.unsolvedConnections=[],this.activeSubSolver=null,this.cacheHit=!0,this.progress=1}attemptToUseCacheSync(){if(this.hasAttemptedToUseCache=!0,!this.cacheProvider?.isSyncCache)return!1;if(!this.cacheKey)try{this.computeCacheKeyAndTransform()}catch(e){return console.error("Error computing cache key:",e),!1}if(!this.cacheKey)return console.error("Failed to compute cache key."),!1;try{let e=this.cacheProvider.getCachedSolutionSync(this.cacheKey);if(e!=null)return this.applyCachedSolution(e),!0}catch(e){console.error("Error attempting to use cache:",e)}return!1}saveToCacheSync(){if(!this.cacheProvider?.isSyncCache)return;if(!this.cacheKey)try{this.computeCacheKeyAndTransform()}catch(t){return void console.error("Error computing cache key during save:",t)}if(!this.cacheKey)return void console.error("Failed to compute cache key before saving.");let e=this.failed?{success:!1,error:this.error??void 0}:{success:!0,solvedRoutes:JLt(this.solvedRoutes)};try{this.cacheProvider.setCachedSolutionSync(this.cacheKey,e)}catch(t){console.error("Error saving solution to cache:",t)}}},LUt=(e,t)=>{let n={};return e.portPoints.forEach((o,r)=>{n[o.connectionName]=`hsl(${360*r/e.portPoints.length}, 100%, 50%)`}),n},tmr=class extends ei{getSolverName(){return"ViaPossibilitiesSolver2"}bounds;maxViaCount;portPairMap;colorMap;nodeWidth;availableZ;hyperParameters;VIA_INTERSECTION_BUFFER_DISTANCE=0.05;PLACEHOLDER_WALL_BUFFER_DISTANCE=0.1;NEW_HEAD_WALL_BUFFER_DISTANCE=0.05;viaDiameter;unprocessedConnections;completedPaths=new Map;placeholderPaths=new Map;currentHead;currentConnectionName;currentPath;currentViaCount;constructor({nodeWithPortPoints:e,colorMap:t,hyperParameters:n,viaDiameter:o}){super(),this.MAX_ITERATIONS=1e5,this.colorMap=t??LUt(e),this.maxViaCount=5,this.bounds=zce(e),this.nodeWidth=this.bounds.maxX-this.bounds.minX,this.portPairMap=((i)=>{let s=new Map;return i.portPoints.forEach((a)=>{s.has(a.connectionName)?s.get(a.connectionName).end=a:s.set(a.connectionName,{start:a,end:null,connectionName:a.connectionName})}),s})(e),this.stats.solutionsFound=0,this.availableZ=e.availableZ??[0,1],this.hyperParameters=n??{SHUFFLE_SEED:0},this.viaDiameter=o??0.3,this.unprocessedConnections=Array.from(this.portPairMap.keys()).sort(),n?.SHUFFLE_SEED&&(this.unprocessedConnections=e6(this.unprocessedConnections,n.SHUFFLE_SEED));for(let[i,{start:s,end:a}]of this.portPairMap.entries())if(s.z===a.z){let c=Math.abs(s.x-a.x)<0.000000001,l=Math.abs(s.y-a.y)<0.000000001;c||l?this.placeholderPaths.set(i,[s,this._padByPlaceholderWallBuffer(s),this._padByPlaceholderWallBuffer(a),a]):this.placeholderPaths.set(i,[s,a])}else{let c=(s.x+a.x)/2,l=(s.y+a.y)/2,h=this._padByPlaceholderWallBuffer({x:c,y:l,z:s.z}),d=this._padByPlaceholderWallBuffer({x:c,y:l,z:a.z});this.placeholderPaths.set(i,[s,this._padByPlaceholderWallBuffer(s),h,d,this._padByPlaceholderWallBuffer(a),a])}this.currentConnectionName=this.unprocessedConnections.pop();let r=this.portPairMap.get(this.currentConnectionName).start;this.currentHead=this._padByNewHeadWallBuffer(r),this.currentPath=[r,this.currentHead],this.currentViaCount=0,this.placeholderPaths.delete(this.currentConnectionName)}_padByNewHeadWallBuffer(e){return{x:h2(e.x,this.bounds.minX+this.NEW_HEAD_WALL_BUFFER_DISTANCE,this.bounds.maxX-this.NEW_HEAD_WALL_BUFFER_DISTANCE),y:h2(e.y,this.bounds.minY+this.NEW_HEAD_WALL_BUFFER_DISTANCE,this.bounds.maxY-this.NEW_HEAD_WALL_BUFFER_DISTANCE),z:e.z}}_padByPlaceholderWallBuffer(e){return{x:h2(e.x,this.bounds.minX+this.PLACEHOLDER_WALL_BUFFER_DISTANCE,this.bounds.maxX-this.PLACEHOLDER_WALL_BUFFER_DISTANCE),y:h2(e.y,this.bounds.minY+this.PLACEHOLDER_WALL_BUFFER_DISTANCE,this.bounds.maxY-this.PLACEHOLDER_WALL_BUFFER_DISTANCE),z:e.z}}_step(){if(this.solved)return;let e=this.portPairMap.get(this.currentConnectionName).end,t=[this.currentHead,e],n=null,o=null,r=(s)=>{for(let a of s.values())for(let c=0;c<a.length-1;c++){let l=[a[c],a[c+1]];if(l[0].x===l[1].x&&l[0].y===l[1].y)continue;if(l[0].z!==this.currentHead.z)continue;let h=pB(t[0],t[1],l[0],l[1]);if(h){let d=kn(this.currentHead,h);if(d<0.000001)continue;(!n||d<n.dist)&&(n={point:h,dist:d},o=l[0].z)}}};r(this.completedPaths),r(this.placeholderPaths);let i=this.currentHead.z!==e.z;if((n||i)&&(this.currentViaCount++,this.currentViaCount>=this.maxViaCount))return this.failed=!0,void(this.error=`Exceeded max via count of ${this.maxViaCount}`);if(n){let s,a=n.dist;if(a<=this.VIA_INTERSECTION_BUFFER_DISTANCE+0.000001)s=RV(this.currentHead,n.point);else{let d=n.point,u=d.x-this.currentHead.x,_=d.y-this.currentHead.y,p=(a-this.VIA_INTERSECTION_BUFFER_DISTANCE)/a;s={x:this.currentHead.x+u*p,y:this.currentHead.y+_*p}}let c=this.availableZ.find((d)=>d!==o);if(c===void 0)return this.error="Could not determine next Z level for via placement!",void(this.failed=!0);let l={...s,z:this.currentHead.z},h={...s,z:c};this.currentPath.push(l,h),this.currentHead=h}else if(i){let s,a=kn(this.currentHead,e);if(a<this.VIA_INTERSECTION_BUFFER_DISTANCE)s=RV(this.currentHead,e);else{let d=e.x-this.currentHead.x,u=e.y-this.currentHead.y,_=(a-this.VIA_INTERSECTION_BUFFER_DISTANCE)/a;s={x:this.currentHead.x+d*_,y:this.currentHead.y+u*_}}let c=e.z,l={...s,z:this.currentHead.z},h={...s,z:c};this.currentPath.push(l,h),this.currentHead=h}else if(this.currentPath.push(e),this.completedPaths.set(this.currentConnectionName,this.currentPath),this.unprocessedConnections.length===0)this.solved=!0,this.stats.solutionsFound=1;else{this.currentConnectionName=this.unprocessedConnections.pop();let{start:s}=this.portPairMap.get(this.currentConnectionName);this.currentHead=this._padByNewHeadWallBuffer(s),this.currentPath=[s,this.currentHead],this.currentViaCount=0,this.placeholderPaths.delete(this.currentConnectionName)}}visualize(){let e={points:[],lines:[],circles:[],rects:[],title:"Via Possibilities Solver State",coordinateSystem:"cartesian"},t=this.colorMap;e.lines.push({points:[{x:this.bounds.minX,y:this.bounds.minY},{x:this.bounds.maxX,y:this.bounds.minY},{x:this.bounds.maxX,y:this.bounds.maxY},{x:this.bounds.minX,y:this.bounds.maxY},{x:this.bounds.minX,y:this.bounds.minY}],strokeColor:"gray",strokeWidth:0.01});for(let[o,{start:r,end:i}]of this.portPairMap.entries()){let s=this.colorMap[o]??"black";e.points.push({x:r.x,y:r.y,color:s,label:`Port: ${o} Start (z${r.z})`}),e.points.push({x:i.x,y:i.y,color:s,label:`Port: ${o} End (z${i.z})`})}let n=(o,r)=>{for(let[i,s]of o.entries()){let a=t[i]??"black";for(let c=0;c<s.length-1;c++){let l=s[c],h=s[c+1];l.x===h.x&&l.y===h.y&&l.z!==h.z?e.circles.push({center:{x:l.x,y:l.y},radius:this.viaDiameter/2,fill:zi(a,0.5),label:`${r}: ${i} Via (z${l.z}->z${h.z})`}):e.lines.push({points:[l,h],strokeColor:zi(a,0.5),strokeDash:l.z===0?void 0:[0.1,0.1],strokeWidth:0.1,label:`${r}: ${i} (z${l.z})`})}}};if(n(this.placeholderPaths,"Placeholder"),n(this.completedPaths,"Completed"),this.currentPath&&this.currentPath.length>0){let o=t[this.currentConnectionName]??"orange";for(let r=0;r<this.currentPath.length-1;r++){let i=this.currentPath[r],s=this.currentPath[r+1];i.x===s.x&&i.y===s.y&&i.z!==s.z?e.circles.push({center:{x:i.x,y:i.y},radius:this.viaDiameter/2,fill:zi(o,0.5),label:`Current: ${this.currentConnectionName} Via (z${i.z}->z${s.z})`}):e.lines.push({points:[i,s],strokeColor:zi(o,0.5),strokeWidth:0.15,strokeDash:"2,2",label:`Current: ${this.currentConnectionName} (z${i.z})`})}e.points.push({x:this.currentHead.x,y:this.currentHead.y,color:"green",label:`Current Head: ${this.currentConnectionName} (z${this.currentHead.z})`})}return e}},v4e=(e)=>Math.round(1e4*e),HUt=(e)=>{let t=0,n=[],o=[];for(let i of e.portPoints){if(n.some((a)=>a.connectionName===i.connectionName))continue;if(o.some((a)=>a.connectionName===i.connectionName))continue;let s={connectionName:i.connectionName,z:i.z,points:[{x:v4e(i.x),y:v4e(i.y),z:i.z}]};for(let a of e.portPoints)i.connectionName===a.connectionName&&(i.x===a.x&&i.y===a.y||s.points.push({x:v4e(a.x),y:v4e(a.y),z:a.z}));s.points.some((a)=>a.z!==s.z)?o.push(s):n.push(s)}n=n.filter((i)=>i.points.length>1);for(let i=0;i<n.length;i++)for(let s=i+1;s<n.length;s++){let a=n[i],c=n[s];a.z===c.z&&Ru(a.points[0],a.points[1],c.points[0],c.points[1])&&t++}let r=0;for(let i=0;i<o.length;i++)for(let s=i+1;s<o.length;s++){let a=o[i],c=o[s];Ru(a.points[0],a.points[1],c.points[0],c.points[1])&&r++}return{numSameLayerCrossings:t,numEntryExitLayerChanges:o.length,numTransitionPairCrossings:r}},nmr=(e)=>{let{start:t,end:n,segmentsPerPolyline:o,viaPositions:r,viaCount:i,availableZ:s}=e,a=function(_,p){let m=Array(_).fill(0);if(p===0)return m;if(p===_)return m.fill(1);if(p<=_/2){let A=Math.floor(_/p),g=Math.floor((_-(A*(p-1)+1))/2);for(let f=0;f<p;f++)m[g+f*A]=1}else{let A=_-p,g=Math.floor(_/A),f=Math.floor((_-(g*(A-1)+1))/2);m.fill(1);for(let y=0;y<A;y++)m[f+y*g]=0}return m}(o,i),c=a.map(()=>null),l=0,h=t.z1,d=s.indexOf(t.z1);for(let _=0;_<a.length;_++)if(a[_]===1){let p=s[(d+l+1)%s.length];c[_]={...r[l],z1:h,z2:p},h=p,l++}let u=t;for(let _=0;_<c.length;_++){if(c[_]){u=c[_];continue}let p=n,m=c.length;for(let y=_+1;y<c.length;y++)if(c[y]){p=c[y],m=y;break}let A=m-_,g=p.x-u.x,f=p.y-u.y;for(let y=1/(A+1),x=0;_+x!==m;y+=1/(A+1),x++)c[_+x]={x:u.x+g*y,y:u.y+f*y,z1:u.z2,z2:u.z2}}return c},tq=0.000000001;function iCe(e,t){return Math.abs(e-t)<tq}function zWe(e){return`${Math.round(e.x/tq)}:${Math.round(e.y/tq)}`}function OWe(e,t,n,o){return e*o-t*n}function omr(e,t,n,o){let r={x:t.x-e.x,y:t.y-e.y},i={x:o.x-n.x,y:o.y-n.y},s=OWe(r.x,r.y,i.x,i.y),a={x:n.x-e.x,y:n.y-e.y};if(iCe(s,0))return null;let c=OWe(a.x,a.y,i.x,i.y)/s,l=OWe(a.x,a.y,r.x,r.y)/s;return c>=-0.000000001&&c<=1+tq&&l>=-0.000000001&&l<=1+tq?{x:e.x+c*r.x,y:e.y+c*r.y}:null}function ZLt(e,t,n){return iCe(Math.hypot(e.x-t.x,e.y-t.y)+Math.hypot(e.x-n.x,e.y-n.y),Math.hypot(t.x-n.x,t.y-n.y))}function rmr(e,t){let n=[],o=new Map;for(let m of e){let A=[m.start,...m.mPoints,m.end];for(let f=0;f<A.length-1;f++){let y=A[f],x=A[f+1],C=y.z2;if(n.push({start:{x:y.x,y:y.y},end:{x:x.x,y:x.y},connectionName:m.connectionName,layer:C}),y.z1!==y.z2){let b=zWe(y);o.has(b)||o.set(b,{point:y,connectionName:m.connectionName})}}let g=A[A.length-1];if(g.z1!==g.z2){let f=zWe(g);o.has(f)||o.set(f,{point:g,connectionName:m.connectionName})}}let r=[{start:{x:t.minX,y:t.minY},end:{x:t.maxX,y:t.minY},connectionName:null,layer:0},{start:{x:t.maxX,y:t.minY},end:{x:t.maxX,y:t.maxY},connectionName:null,layer:0},{start:{x:t.maxX,y:t.maxY},end:{x:t.minX,y:t.maxY},connectionName:null,layer:0},{start:{x:t.minX,y:t.maxY},end:{x:t.minX,y:t.minY},connectionName:null,layer:0}];n.push(...r);let i=new Map,s=0;function a(m,A){let g=zWe(m),f=i.get(g);if(!f){let y=o.has(g);f={id:s++,x:m.x,y:m.y,isVia:y,connectionNames:new Set,outgoingEdges:[]},i.set(g,f),y&&o.get(g)&&f.connectionNames.add(o.get(g).connectionName)}return A&&f.connectionNames.add(A),f}for(let m of n)a(m.start,m.connectionName),a(m.end,m.connectionName);let c=new Map;for(let m of n)c.set(m,[]);for(let m=0;m<n.length;m++)for(let A=m+1;A<n.length;A++){if(n[m].layer!==n[A].layer)continue;let g=omr(n[m].start,n[m].end,n[A].start,n[A].end);g&&(a(g),ZLt(g,n[m].start,n[m].end)&&c.get(n[m]).push(g),ZLt(g,n[A].start,n[A].end)&&c.get(n[A]).push(g))}let l=[],h=0;for(let m of n){let A=[m.start,...c.get(m),m.end];A.sort((f,y)=>{let x=m.end.x-m.start.x,C=m.end.y-m.start.y;return Math.abs(x)>Math.abs(C)?(f.x-m.start.x)/x-(y.x-m.start.x)/x:Math.abs(C)<tq?0:(f.y-m.start.y)/C-(y.y-m.start.y)/C});let g=[];if(A.length>0){g.push(A[0]);for(let f=1;f<A.length;f++)iCe(A[f].x,A[f-1].x)&&iCe(A[f].y,A[f-1].y)||g.push(A[f])}for(let f=0;f<g.length-1;f++){let y=g[f],x=g[f+1],C=a(y,m.connectionName),b=a(x,m.connectionName);if(C===b)continue;let I={id:h++,origin:C,twin:null,next:null,face:null,connectionName:m.connectionName,layer:m.layer,visited:!1},v={id:h++,origin:b,twin:I,next:null,face:null,connectionName:m.connectionName,layer:m.layer,visited:!1};I.twin=v,l.push(I,v),C.outgoingEdges.push(I),b.outgoingEdges.push(v)}}for(let m of i.values()){m.outgoingEdges.sort((g,f)=>{let y=g.twin.origin,x=f.twin.origin;return Math.atan2(y.y-m.y,y.x-m.x)-Math.atan2(x.y-m.y,x.x-m.x)});let A=m.outgoingEdges.length;for(let g=0;g<A;g++){let f=m.outgoingEdges[g],y=m.outgoingEdges[(g-1+A)%A];f.twin&&(f.twin.next=y)}}let d=[],u=0,_=null,p=-1/0;for(let m of l){if(m.visited)continue;let A={id:u++,outerComponent:m,innerComponents:[],isOuterFace:!1};d.push(A);let g=m,f=[],y=[],x=new Set,C=0;do{if(!g||g.visited){console.warn("Face traversal encountered visited edge or null, breaking loop.",A.id),f.length=0;break}g.visited=!0,g.face=A,f.push(g),y.push(g.origin),g.connectionName!==null&&x.add(g.connectionName);let b=g.origin,I=g.twin.origin;C+=b.x*I.y-I.x*b.y,g=g.next}while(g!==m&&g!==null);if(g===m){if(C=0.5*Math.abs(C),C>p&&(p=C,_&&(_.isOuterFace=!1),_=A,A.isOuterFace=!0),!A.isOuterFace&&f.length>0){if([...x].filter((b)=>b!==null).length>1){let b=!1;for(let I of y)if(I.isVia){b=!0;break}if(!b)return!0}}}else console.warn(`Face ${A.id} did not close properly.`),d.pop(),u--}return!1}var FUt=(e)=>{if(e.length===0)return[[]];let t=[];for(let n=0;n<e.length;n++){let o=e[n],r=[...e.slice(0,n),...e.slice(n+1)],i=FUt(r);for(let s of i)t.push([o,...s])}return t},Uje=0.000000001;function sCe(e,t,n=0.000000001){return Math.abs(e-t)<n}function VWe(e,t,n,o){return e*o-t*n}function imr(e,t,n,o){let r={x:t.x-e.x,y:t.y-e.y},i={x:o.x-n.x,y:o.y-n.y},s=VWe(r.x,r.y,i.x,i.y);if(sCe(s,0))return null;let a={x:n.x-e.x,y:n.y-e.y},c=VWe(a.x,a.y,i.x,i.y)/s,l=VWe(a.x,a.y,r.x,r.y)/s;return c<-0.000000001||c>1+Uje||l<-0.000000001||l>1+Uje?null:{x:e.x+c*r.x,y:e.y+c*r.y}}function smr(e){let t=0;for(let n=0,o=e.length;n<o;++n){let r=(n+1)%o;t+=e[n].x*e[r].y-e[r].x*e[n].y}return 0.5*t}function amr(e){let t=0,n=0,o=0;for(let r=0,i=e.length;r<i;++r){let s=(r+1)%i,a=e[r].x*e[s].y-e[s].x*e[r].y;t+=a,n+=(e[r].x+e[s].x)*a,o+=(e[r].y+e[s].y)*a}return t*=0.5,sCe(t,0)?null:(n/=6*t,o/=6*t,{x:n,y:o})}var cmr=class{x;y;out;connectionNames;constructor(e,t){this.x=e,this.y=t,this.out=[],this.connectionNames=new Set}},eHt=class{orig;dest;twin;next;visited;constructor(e,t){this.orig=e,this.dest=t,this.twin=null,this.next=null,this.visited=!1}};function lmr(e,t){let n=[...t,{start:{x:e.minX,y:e.minY},end:{x:e.maxX,y:e.minY}},{start:{x:e.maxX,y:e.minY},end:{x:e.maxX,y:e.maxY}},{start:{x:e.maxX,y:e.maxY},end:{x:e.minX,y:e.maxY}},{start:{x:e.minX,y:e.maxY},end:{x:e.minX,y:e.minY}}],o=n.map(()=>[]);for(let d=0;d<n.length;++d){let u=n[d];o[d].push(u.start,u.end)}for(let d=0;d<n.length;++d)for(let u=d+1;u<n.length;++u){let _=imr(n[d].start,n[d].end,n[u].start,n[u].end);_&&(o[d].push(_),o[u].push(_))}let r=new Map,i=[];function s(d){let u=function(_,p=0.000000001){return`${Math.round(_.x/p)}:${Math.round(_.y/p)}`}(d);if(!r.has(u)){let _=i.length;return r.set(u,_),i.push(new cmr(d.x,d.y)),_}return r.get(u)}let a=[];for(let d=0;d<n.length;++d){let u=n[d],_=o[d].slice();_.sort((p,m)=>{let A=u.end.x-u.start.x,g=u.end.y-u.start.y;return(sCe(Math.abs(A),0)?(p.y-u.start.y)/g:(p.x-u.start.x)/A)-(sCe(Math.abs(A),0)?(m.y-u.start.y)/g:(m.x-u.start.x)/A)});for(let p=0;p<_.length-1;++p){let m=_[p],A=_[p+1],g=s(m),f=s(A);g!==f&&(a.push([g,f]),u.connectionName&&(i[g].connectionNames.add(u.connectionName),i[f].connectionNames.add(u.connectionName)))}}let c=[];for(let[d,u]of a){let _=new eHt(d,u),p=new eHt(u,d);_.twin=c.length+1,p.twin=c.length;let m=c.length;c.push(_,p),i[d].out.push(m),i[u].out.push(m+1)}for(let d=0;d<i.length;++d){let u=i[d];u.out.sort((p,m)=>{let A=c[p],g=c[m],f=i[A.dest],y=i[g.dest];return Math.atan2(f.y-u.y,f.x-u.x)-Math.atan2(y.y-u.y,y.x-u.x)});let _=u.out.length;for(let p=0;p<_;++p){let m=u.out[p],A=u.out[(p-1+_)%_],g=c[m];g.twin!==null&&(c[g.twin].next=A)}}let l=[],h=[];for(let d=0;d<c.length;++d){if(c[d].visited)continue;let u=d,_=[],p=[];do{if(u===null)break;let m=c[u];m.visited=!0,_.push(i[m.orig]),p.push(u),u=m.next}while(u!==null&&u!==d&&!c[u].visited);if(_.length<3)continue;if(smr(_)>Uje){let m=amr(_);m&&(l.push(m),h.push({vertices:_.map((A)=>({x:A.x,y:A.y,connectionNames:A.connectionNames.size>0?A.connectionNames:void 0})),centroid:m}))}}return{centroids:l,faces:h,allVertices:i}}function hmr(e,t){if(e>t)throw Error("oneCount cannot be greater than length");if(e<0||t<0)throw Error("oneCount and length must be non-negative");let n=[];return function o(r,i,s){s!==t?(r[s]=0,o(r,i,s+1),i>0&&(r[s]=1,o(r,i-1,s+1))):i===0&&n.push([...r])}(Array(t).fill(0),e,0),n}var zUt=class extends ei{getSolverName(){return"MultiHeadPolyLineIntraNodeSolver"}nodeWithPortPoints;colorMap;hyperParameters;connMap;candidates;bounds;solvedRoutes=[];unsolvedConnections=[];SEGMENTS_PER_POLYLINE;cellSize;MAX_CANDIDATES=50000;viaDiameter=0.3;obstacleMargin=0.1;traceWidth=0.15;availableZ=[];uniqueConnections=0;BOUNDARY_PADDING;lastCandidate=null;maxViaCount;minViaCount;phase="setup";progress=0;constructor(e){super(),this.MAX_ITERATIONS=1e4,this.nodeWithPortPoints=e.nodeWithPortPoints,this.colorMap=e.colorMap??LUt(e.nodeWithPortPoints),this.hyperParameters=e.hyperParameters??{},this.SEGMENTS_PER_POLYLINE=e.hyperParameters?.SEGMENTS_PER_POLYLINE??3,this.BOUNDARY_PADDING=e.hyperParameters?.BOUNDARY_PADDING??0.05,this.connMap=e.connMap,this.viaDiameter=e.viaDiameter??this.viaDiameter,this.cellSize=this.nodeWithPortPoints.width/1024,this.candidates=[],this.availableZ=this.nodeWithPortPoints.availableZ??[0,1],this.bounds={minX:this.nodeWithPortPoints.center.x-this.nodeWithPortPoints.width/2,maxX:this.nodeWithPortPoints.center.x+this.nodeWithPortPoints.width/2,minY:this.nodeWithPortPoints.center.y-this.nodeWithPortPoints.height/2,maxY:this.nodeWithPortPoints.center.y+this.nodeWithPortPoints.height/2};let t=this.nodeWithPortPoints.width*this.nodeWithPortPoints.height,n=(this.viaDiameter+2*this.obstacleMargin+this.traceWidth/2)**2,o=new Set(this.nodeWithPortPoints.portPoints.map((s)=>s.connectionName)).size;this.uniqueConnections=o;let{numSameLayerCrossings:r,numEntryExitLayerChanges:i}=HUt(this.nodeWithPortPoints);if(this.minViaCount=2*r+i,this.maxViaCount=Math.min(Math.floor(t/n),Math.ceil(1.5*o)),this.minViaCount>this.SEGMENTS_PER_POLYLINE*(o/2))return this.failed=!0,void(this.error=`Not possible to solve problem with given SEGMENTS_PER_POLYLINE (${this.SEGMENTS_PER_POLYLINE}), atleast ${this.minViaCount} vias are required`);this.maxViaCount>this.SEGMENTS_PER_POLYLINE&&(this.maxViaCount=this.SEGMENTS_PER_POLYLINE),this.maxViaCount<this.minViaCount&&(this.maxViaCount=this.minViaCount)}computeMinGapBtwPolyLines(e){let t=[],n=[],o=[];for(let r=0;r<e.length;r++){let i=e[r],s=[i.start,...i.mPoints,i.end],a=new Map(this.availableZ.map((c)=>[c,[]]));for(let c=0;c<s.length-1;c++){let l=[s[c],s[c+1]],h=l[0].z2;a.has(h)||a.set(h,[]),a.get(h).push(l)}n.push(a),o.push(s.filter((c)=>c.z1!==c.z2))}for(let r=0;r<e.length;r++){let i=n[r],s=o[r];for(let a=r+1;a<e.length;a++){if(this.connMap?.areIdsConnected(e[r].connectionName,e[a].connectionName))continue;let c=n[a],l=o[a],h=1;for(let d of this.availableZ){let u=i.get(d)??[],_=c.get(d)??[];for(let p of u)for(let m of _)h=Math.min(h,Q_(p[0],p[1],m[0],m[1])-this.traceWidth);for(let p of s)for(let m of _)h=Math.min(h,xc(p,m[0],m[1])-this.traceWidth/2-this.viaDiameter/2);for(let p of l)for(let m of u)h=Math.min(h,xc(p,m[0],m[1])-this.traceWidth/2-this.viaDiameter/2);for(let p of s)for(let m of l)h=Math.min(h,kn(p,m)-this.viaDiameter)}t.push(h)}}return t}insertCandidate(e){let t=0,n=this.candidates.length-1;for(;t<=n;){let o=Math.floor((t+n)/2);this.candidates[o].f<e.f?t=o+1:n=o-1}this.candidates.splice(t,0,e)}setupInitialPolyLines(){let e=new Map;this.nodeWithPortPoints.portPoints.forEach((i)=>{e.has(i.connectionName)?e.get(i.connectionName).end={...i,z1:i.z??0,z2:i.z??0}:e.set(i.connectionName,{start:{...i,z1:i.z??0,z2:i.z??0},end:null})});for(let[i,s]of e.entries())s.end===null&&e.delete(i);if(e.size===0)return this.failed=!0,void(this.error="No port pairs found, can't solve");let t=Array.from(e.entries()),n=((i,s,a,c)=>{let l=[];for(let[,d]of i){let u=d.start.z1!==d.end.z1,_=[];for(let p=0;p<=s;p++){let m=p%2!=0;u&&m?_.push(p):u||m||_.push(p)}l.push(_)}if(l.length===0)return[[]];let h=((d)=>{if(!d||d.length===0)return[[]];let u=[[]];for(let _ of d){let p=[];for(let m of u)for(let A of _)p.push([...m,A]);u=p}return u})(l).filter((d)=>{for(let u=0;u<d.length;u++)if(d.reduce((_,p)=>_+p,0)<c)return!1;return!0});return h=h.filter((d)=>{for(let u=0;u<i.length;u++){let[,_]=i[u];if(_.start.z1!==_.start.z2&&d[u]===0)return!1}return!0}),h=h.filter((d)=>{for(let u=0;u<i.length;u++){let[,_]=i[u];if(i[u][1].start.z1===i[u][1].start.z2)for(let p=u+1;p<i.length;p++){if(i[p][1].start.z1!==i[p][1].start.z2)continue;let[,m]=i[p];if(_.start.z1===_.end.z1&&m.start.z1===m.end.z1&&_.start.z1===m.start.z1&&Ru(_.start,_.end,m.start,m.end)&&d[u]+d[p]<2)return!1}}return!0}),h=h.filter((d)=>!(d.reduce((u,_)=>u+_,0)>a)),h})(t,this.SEGMENTS_PER_POLYLINE,this.maxViaCount,this.minViaCount),o=((i)=>{let{bounds:s,portPairsEntries:a,viaCountVariants:c}=i,{centroids:l}=lmr(s,a.map(([d,u])=>u)),h=[];for(let d of c){let u=d.reduce((m,A)=>m+A,0),_=l;if(l.length<u){_=[];let m=Math.ceil(Math.sqrt(u)),A=m;for(let g=0;g<m;g++)for(let f=0;f<A;f++)_.push({x:s.minX+(f+1)/(A+1)*(s.maxX-s.minX),y:s.minY+(g+1)/(m+1)*(s.maxY-s.minY)})}let p=hmr(u,_.length);for(let m of p){let A=[];for(let g=0;g<m.length;g++)m[g]===1&&A.push(_[g]);h.push({viaPositions:A,viaCountVariant:d})}}return h})({portPairsEntries:t,viaCountVariants:n,bounds:this.bounds}),r=[];for(let{viaCountVariant:i,viaPositions:s}of o){let a=FUt(s);for(let c of a)r.push({viaCountVariant:i,viaPositions:c})}for(let{viaPositions:i,viaCountVariant:s}of r){let a=[],c=0;for(let u=0;u<t.length;u++){let[_,p]=t[u],m=s[u],A=i.slice(c,c+m),g=nmr({start:p.start,end:p.end,segmentsPerPolyline:this.SEGMENTS_PER_POLYLINE,viaPositions:A,viaCount:m,availableZ:this.availableZ});c+=m,a.push({connectionName:_,start:p.start,end:p.end,mPoints:g})}if(rmr(a,this.bounds))continue;let l=this.computeMinGapBtwPolyLines(a),h=this.computeH({minGaps:l,forces:[]}),d={polyLines:a,g:0,h,f:h,viaCount:s.reduce((u,_)=>u+_,0),minGaps:l};if(this.checkIfSolved(d))return void(this.candidates=[d]);if(this.candidates.push(d),this.candidates.length>this.MAX_CANDIDATES)return}this.candidates.sort((i,s)=>i.f-s.f)}computeG(e,t){return t.g+0.000005+0.000005*t.viaCount*100}computeH(e){let t=0;for(let n of e.forces??[])for(let o of n)for(let r of o.values())t+=r.fx*r.fx+r.fy*r.fy;return t}getNeighbors(e){let{polyLines:t}=e,n=t.length,s=Array.from({length:n},(_,p)=>Array.from({length:t[p].mPoints.length},()=>new Map)),a=(_,p,m,A,g)=>{if(p>0&&p<t[_].mPoints.length+1){let f=p-1,y=s[_][f],x=y.get(m)||{fx:0,fy:0};y.set(m,{fx:x.fx+A,fy:x.fy+g})}};for(let _=0;_<n;_++)for(let p=_+1;p<n;p++){let m=t[_],A=t[p],g=[m.start,...m.mPoints,m.end],f=[A.start,...A.mPoints,A.end],y=[],x=[];for(let I=0;I<g.length-1;I++)y.push({p1:g[I],p2:g[I+1],layer:g[I].z2,p1Idx:I,p2Idx:I+1});g.forEach((I,v)=>{I.z1!==I.z2&&x.push({point:I,layers:[I.z1,I.z2],index:v})});let C=[],b=[];for(let I=0;I<f.length-1;I++)C.push({p1:f[I],p2:f[I+1],layer:f[I].z2,p1Idx:I,p2Idx:I+1});f.forEach((I,v)=>{I.z1!==I.z2&&b.push({point:I,layers:[I.z1,I.z2],index:v})});for(let I of y)for(let v of C)if(I.layer===v.layer){if(Q_(I.p1,I.p2,v.p1,v.p2)<0.000001)continue;let P={x:(I.p1.x+I.p2.x)/2,y:(I.p1.y+I.p2.y)/2},M={x:(v.p1.x+v.p2.x)/2,y:(v.p1.y+v.p2.y)/2},B=P.x-M.x,T=P.y-M.y,N=B*B+T*T;if(N>0.000001){let D=Math.sqrt(N),L=(Math.exp(-6*D),`seg:${p}:${v.p1Idx}:${v.p2Idx}`),H=`seg:${_}:${I.p1Idx}:${I.p2Idx}`,V=(O,U,j,Y,X,K,J)=>{let ee=Vm(O,j.p1,j.p2),se=O.x-ee.x,ne=O.y-ee.y,re=se*se+ne*ne;if(re<=0.000001)return;let Z=Math.sqrt(re),te=0.02*Math.exp(-6*Z),ie=se/Z*te,le=ne/Z*te;a(Y,U,K,ie,le),a(X,j.p1Idx,J,-ie/2,-le/2),a(X,j.p2Idx,J,-ie/2,-le/2)};V(I.p1,I.p1Idx,v,_,p,L,H),V(I.p2,I.p2Idx,v,_,p,L,H),V(v.p1,v.p1Idx,I,p,_,H,L),V(v.p2,v.p2Idx,I,p,_,H,L)}}for(let I of x)for(let v of C)if(I.layers.includes(v.layer)){let P=Vm(I.point,v.p1,v.p2),M=I.point.x-P.x,B=I.point.y-P.y,T=M*M+B*B;if(T>0.000001){let N=Math.sqrt(T),D=2,L=N;N<this.viaDiameter/2?(D*=4,L=Math.max(0.000001,N)):L=Math.max(0.000001,N-this.viaDiameter/2);let H=D*0.02*Math.exp(-6*L),V=M/N*H,O=B/N*H,U=`seg:${p}:${v.p1Idx}:${v.p2Idx}`;a(_,I.index,U,V,O);let j=`via:${_}:${I.index}`;a(p,v.p1Idx,j,-V/2,-O/2),a(p,v.p2Idx,j,-V/2,-O/2)}}for(let I of b)for(let v of y)if(I.layers.includes(v.layer)){let P=Vm(I.point,v.p1,v.p2),M=I.point.x-P.x,B=I.point.y-P.y,T=M*M+B*B;if(T>0.000001){let N=Math.sqrt(T),D=2,L=N;N<this.viaDiameter/2?(D*=4,L=Math.max(0.000001,N)):L=Math.max(0.000001,N-this.viaDiameter/2);let H=D*0.02*Math.exp(-6*L),V=M/N*H,O=B/N*H,U=`seg:${_}:${v.p1Idx}:${v.p2Idx}`;a(p,I.index,U,V,O);let j=`via:${p}:${I.index}`;a(_,v.p1Idx,j,-V/2,-O/2),a(_,v.p2Idx,j,-V/2,-O/2)}}for(let I of x)for(let v of b)if(I.layers.filter((P)=>v.layers.includes(P)).length>0){let P=I.point.x-v.point.x,M=I.point.y-v.point.y,B=P*P+M*M;if(B>0.000001){let T=Math.sqrt(B),N=2,D=T;T<this.viaDiameter?(N*=4,D=Math.max(0.000001,T)):D=Math.max(0.000001,T-this.viaDiameter);let L=N*0.02*Math.exp(-6*D),H=P/T*L,V=M/T*L,O=`via:${p}:${v.index}`,U=`via:${_}:${I.index}`;a(_,I.index,O,H,V),a(p,v.index,U,-H,-V)}}}for(let _=0;_<n;_++){let p=t[_],m=[p.start,...p.mPoints,p.end],A=[];if(m.forEach((g,f)=>{g.z1!==g.z2&&A.push({point:g,layers:[g.z1,g.z2],index:f})}),!(A.length<2))for(let g=0;g<A.length;g++)for(let f=g+1;f<A.length;f++){let y=A[g],x=A[f],C=y.point.x-x.point.x,b=y.point.y-x.point.y,I=C*C+b*b;if(I>0.000001){let v=Math.sqrt(I),P=2,M=v;v<this.viaDiameter?(P*=4,M=Math.max(0.000001,v)):M=Math.max(0.000001,v-this.viaDiameter);let B=P*0.02*Math.exp(-6*M),T=C/v*B,N=b/v*B,D=`via:${_}:${x.index}`,L=`via:${_}:${y.index}`;a(_,y.index,D,T,N),a(_,x.index,L,-T,-N)}}}let c=t.map((_)=>({..._,mPoints:_.mPoints.map((p)=>({...p}))})),l=!1;for(let _=0;_<n;_++)for(let p=0;p<c[_].mPoints.length;p++){let m=c[_].mPoints[p],A=s[_][p],g={fx:0,fy:0};for(let C of A.values())g.fx+=C.fx,g.fy+=C.fy;let f=m.z1!==m.z2,y=m.x+g.fx,x=m.y+g.fy;if(f){let C=this.viaDiameter/2,b=0,I=0,v=this.viaDiameter/2+this.BOUNDARY_PADDING,P=this.bounds.minX+v,M=this.bounds.maxX-v,B=this.bounds.minY+v,T=this.bounds.maxY-v,N=P+C-m.x,D=m.x-(M-C),L=B+C-m.y,H=m.y-(T-C);N>0?b=0.008*(Math.exp(N/(2*this.obstacleMargin))-1):D>0&&(b=-0.008*(Math.exp(D/(2*this.obstacleMargin))-1)),L>0?I=0.008*(Math.exp(L/(2*this.obstacleMargin))-1):H>0&&(I=-0.008*(Math.exp(H/(2*this.obstacleMargin))-1)),g.fx+=b,g.fy+=I,y=m.x+g.fx,x=m.y+g.fy}else{let C=this.traceWidth/2+this.BOUNDARY_PADDING;y=Math.max(this.bounds.minX+C,Math.min(this.bounds.maxX-C,y)),x=Math.max(this.bounds.minY+C,Math.min(this.bounds.maxY-C,x))}Math.abs(g.fx)<0.000001&&Math.abs(g.fy)<0.000001||(Math.abs(m.x-y)>0.000001||Math.abs(m.y-x)>0.000001)&&(m.x=y,m.y=x,l=!0)}if(!l)return[];let h=this.computeMinGapBtwPolyLines(c),d=this.computeG(c,e),u=this.computeH({minGaps:h,forces:s});return[{polyLines:c,g:d,h:u,f:Math.round(5*d)/5+u,minGaps:h,forces:s,viaCount:e.viaCount}]}checkIfSolved(e){let t=e.minGaps.every((o)=>o>=this.obstacleMargin),n=e.polyLines.every((o)=>o.mPoints.every((r)=>{let i=(r.z1!==r.z2?this.viaDiameter/2:this.traceWidth/2)+this.BOUNDARY_PADDING;return((s,a,c=0)=>s.x>=a.minX+c&&s.x<=a.maxX-c&&s.y>=a.minY+c&&s.y<=a.maxY-c)(r,this.bounds,i)}));return t&&n}tryFinalAcceptance(){let e=this.hyperParameters?.MINIMUM_FINAL_ACCEPTANCE_GAP??void 0;if(e===void 0||this.lastCandidate===null||this.lastCandidate.minGaps.length===0)return;return Math.min(...this.lastCandidate.minGaps)>=e?(this.solved=!0,void this._setSolvedRoutes()):void 0}_step(){if(this.phase==="setup")return this.setupInitialPolyLines(),void(this.phase="solving");let e=this.candidates.shift();if(!e){if(this.tryFinalAcceptance(),this.solved)return;return this.failed=!0,void(this.error="No candidates left")}if(this.lastCandidate=e,this.checkIfSolved(e))return this.solved=!0,void this._setSolvedRoutes();if(!e)return void(this.failed=!0);let t=this.getNeighbors(e);for(let n of t)this.insertCandidate(n)}visualize(){let e={points:[],lines:[],rects:[],circles:[],coordinateSystem:"cartesian",title:"MultiHeadPolyLineIntraNodeSolver Visualization"};e.lines.push({points:[{x:this.bounds.minX,y:this.bounds.minY},{x:this.bounds.maxX,y:this.bounds.minY},{x:this.bounds.maxX,y:this.bounds.maxY},{x:this.bounds.minX,y:this.bounds.maxY},{x:this.bounds.minX,y:this.bounds.minY}],strokeColor:"gray"});let t=this.lastCandidate??this.candidates[0];if(t?.hasClosedSameLayerFace){let n=0.1*(this.bounds.maxX-this.bounds.minX),o=0.1*(this.bounds.maxY-this.bounds.minY);e.rects.push({center:{x:this.bounds.maxX+0.6*n,y:this.bounds.maxY+0.6*o},width:n,height:o,fill:"red",label:"HAS CLOSED FACE"})}for(let n of this.nodeWithPortPoints.portPoints)e.points.push({x:n.x,y:n.y,label:`${n.connectionName} (Port z=${n.z??0})`,color:this.colorMap[n.connectionName]??"blue"});return t&&t.polyLines.forEach((n,o)=>{let r=this.colorMap[n.connectionName]??"purple",i=[n.start,...n.mPoints,n.end];for(let s=0;s<i.length-1;s++){let a=i[s],c=i[s+1],l=a.z2,h=l===0,d=h?r:zi(r,0.5);e.lines.push({points:[a,c],strokeColor:d,strokeWidth:this.traceWidth,strokeDash:h?void 0:[0.15,0.15],label:`${n.connectionName} segment (z=${l})`})}i.forEach((s,a)=>{let c=s.z1!==s.z2,l=s.z1,h=a>0&&a<i.length-1,d="",u="";if(h){let _=a-1,p=t.forces?.[o]?.[_];if(p&&p.size>0){let m={fx:0,fy:0};p.forEach((A,g)=>{if(m.fx+=A.fx,m.fy+=A.fy,Math.abs(A.fx)>0.000001||Math.abs(A.fy)>0.000001){let f=g.split(":"),y=f[0],x=parseInt(f[1],10),C=t.polyLines[x],b=this.colorMap[C.connectionName]??"gray",v={x:s.x+A.fx*20,y:s.y+A.fy*20},P=C.connectionName;if(y==="via")P+=` Via ${parseInt(f[2],10)}`;else if(y==="seg")P+=` Seg ${parseInt(f[2],10)}-${parseInt(f[3],10)}`;e.lines.push({points:[s,v],strokeColor:b,strokeWidth:0.02,strokeDash:"2,2",label:`Force by ${P} on ${n.connectionName} mPoint ${_}`})}}),(Math.abs(m.fx)>0.000001||Math.abs(m.fy)>0.000001)&&(u=`
Net Force: (${m.fx.toFixed(3)}, ${m.fy.toFixed(3)})`)}}if(c)d=`Via (${n.connectionName} z=${s.z1} -> z=${s.z2})${u}`,e.circles.push({center:s,radius:this.viaDiameter/2,fill:zi(r,0.5),label:d});else if(h){let _=l===0?r:zi(r,0.5);d=`mPoint (${n.connectionName} z=${l})${u}`,e.circles.push({center:s,radius:this.cellSize/8,fill:_,label:d})}})}),e}_setSolvedRoutes(){if(!this.solved||!this.lastCandidate)return[];let e=[];for(let t of this.lastCandidate.polyLines){let n=[],o=[],r=[t.start,...t.mPoints,t.end];for(let i=0;i<r.length;i++){let s=r[i];n.push({x:s.x,y:s.y,z:s.z1}),s.z1!==s.z2&&(o.push({x:s.x,y:s.y}),n.push({x:s.x,y:s.y,z:s.z2}))}e.push({connectionName:t.connectionName,regionId:this.nodeWithPortPoints.capacityMeshNodeId,traceThickness:this.traceWidth,viaDiameter:this.viaDiameter,route:n,vias:o})}this.solvedRoutes=e}},rqe=class extends zUt{forceWorkspace={netForces:[],geometry:[]};prepareForceWorkspace(e){let{netForces:t,geometry:n}=this.forceWorkspace;t.length=e.length,n.length=e.length;for(let o=0;o<e.length;o++){let r=e[o],i=t[o];i||(i=[],t[o]=i),i.length=r.mPoints.length;for(let d=0;d<i.length;d++){let u=i[d];u?(u.fx=0,u.fy=0):i[d]={fx:0,fy:0}}let s=n[o];s||(s={segments:[],vias:[]},n[o]=s);let{segments:a,vias:c}=s,l=r.mPoints.length+1;a.length=l;let h=0;for(let d=0;d<=l;d++){let u=d===0?r.start:d===l?r.end:r.mPoints[d-1];if(d<l){let _=d+1===l?r.end:r.mPoints[d],p=_.x-u.x,m=_.y-u.y,A=a[d];A?(A.p1=u,A.p2=_,A.deltaX=p,A.deltaY=m,A.lengthSquared=p*p+m*m,A.layer=u.z2,A.p1Idx=d,A.p2Idx=d+1,A.p1Force=i[d-1],A.p2Force=i[d],A.lastTargetLine=-1,A.lastEndpointIndex=-1,A.lastFx=0,A.lastFy=0,A.lastForceActive=!1):(A={p1:u,p2:_,deltaX:p,deltaY:m,lengthSquared:p*p+m*m,layer:u.z2,p1Idx:d,p2Idx:d+1,p1Force:i[d-1],p2Force:i[d],lastTargetLine:-1,lastEndpointIndex:-1,lastFx:0,lastFy:0,lastForceActive:!1},a[d]=A)}if(u.z1!==u.z2){let _=c[h];_?(_.point=u,_.layers[0]=u.z1,_.layers[1]=u.z2,_.index=d,_.force=i[d-1]):(_={point:u,layers:[u.z1,u.z2],index:d,force:i[d-1]},c[h]=_),h++}}c.length=h}return this.forceWorkspace}getSolverName(){return"MultiHeadPolyLineIntraNodeSolver2"}computeG(e,t){return t.g+0.000005+0.000005*t.viaCount*100}computeH(e){let{minGaps:t}=e,n=0;for(let o of t)o<0&&(n+=this.obstacleMargin),o<this.obstacleMargin&&(n+=this.obstacleMargin-o);return 0.011*n}_step(){if(this.phase==="setup")return this.setupInitialPolyLines(),void(this.phase="solving");let e=this.candidates.shift();if(!e){if(this.tryFinalAcceptance(),this.solved)return;return void(this.failed=!0)}if(this.lastCandidate=e,this.checkIfSolved(e))return this.solved=!0,void this._setSolvedRoutes();let t=!1,n=0,o=e.magForceApplied===void 0?1:10;for(let r=0;r<o;r++){let i=this.applyForcesToPolyLines(e.polyLines);if(n+=i.magForceApplied,t=i.lastStepMoved,!i.lastStepMoved)break}if(e.magForceApplied=n,e.minGaps=this.computeMinGapBtwPolyLines(e.polyLines),this.checkIfSolved(e))return this.solved=!0,void this._setSolvedRoutes();e.g=this.computeG(e.polyLines,e),e.h=this.computeH(e),e.f=e.g+e.h,t&&this.insertCandidate(e)}applyForcesToPolyLines(e){let t=0,n=e.length,o=0.02,r=0.008,i=0.000001,{netForces:s,geometry:a}=this.prepareForceWorkspace(e),c=(h,d,u,_,p)=>{let m,A;if(u.lastTargetLine===_&&u.lastEndpointIndex===d){if(!u.lastForceActive)return;m=u.lastFx,A=u.lastFy}else{let g=u.p1.x,f=u.p1.y;if(u.lengthSquared!==0){let v=Math.max(0,Math.min(1,((h.x-u.p1.x)*u.deltaX+(h.y-u.p1.y)*u.deltaY)/u.lengthSquared));g+=v*u.deltaX,f+=v*u.deltaY}let y=h.x-g,x=h.y-f,C=y*y+x*x;if(u.lastTargetLine=_,u.lastEndpointIndex=d,C<=i)return void(u.lastForceActive=!1);let b=Math.sqrt(C),I=0.02*Math.exp(-6*b);m=y/b*I,A=x/b*I,u.lastFx=m,u.lastFy=A,u.lastForceActive=!0}p&&(p.fx+=m,p.fy+=A),u.p1Force&&(u.p1Force.fx+=-m/2,u.p1Force.fy+=-A/2),u.p2Force&&(u.p2Force.fx+=-m/2,u.p2Force.fy+=-A/2)};for(let h=0;h<n;h++)for(let d=h+1;d<n;d++){let{segments:u,vias:_}=a[h],{segments:p,vias:m}=a[d];for(let A of u)for(let g of p)A.layer===g.layer&&(c(A.p1,A.p1Idx,g,h,A.p1Force),c(A.p2,A.p2Idx,g,h,A.p2Force),c(g.p1,g.p1Idx,A,d,g.p1Force),c(g.p2,g.p2Idx,A,d,g.p2Force));for(let A of _)for(let g of p)if(A.layers.includes(g.layer)){let f=Vm(A.point,g.p1,g.p2),y=A.point.x-f.x,x=A.point.y-f.y,C=y*y+x*x;if(C>i){let b=Math.sqrt(C),I=2,v=b;b<this.viaDiameter/2?(I*=4,v=Math.max(i,b)):v=Math.max(i,b-this.viaDiameter/2);let P=I*o*Math.exp(-6*v),M=y/b*P,B=x/b*P;A.force&&(A.force.fx+=M,A.force.fy+=B),g.p1Force&&(g.p1Force.fx+=-M/2,g.p1Force.fy+=-B/2),g.p2Force&&(g.p2Force.fx+=-M/2,g.p2Force.fy+=-B/2)}}for(let A of m)for(let g of u)if(A.layers.includes(g.layer)){let f=Vm(A.point,g.p1,g.p2),y=A.point.x-f.x,x=A.point.y-f.y,C=y*y+x*x;if(C>i){let b=Math.sqrt(C),I=2,v=b;b<this.viaDiameter/2?(I*=4,v=Math.max(i,b)):v=Math.max(i,b-this.viaDiameter/2);let P=I*o*Math.exp(-6*v),M=y/b*P,B=x/b*P;A.force&&(A.force.fx+=M,A.force.fy+=B),g.p1Force&&(g.p1Force.fx+=-M/2,g.p1Force.fy+=-B/2),g.p2Force&&(g.p2Force.fx+=-M/2,g.p2Force.fy+=-B/2)}}for(let A of _)for(let g of m)if(A.layers.filter((f)=>g.layers.includes(f)).length>0){let f=A.point.x-g.point.x,y=A.point.y-g.point.y,x=f*f+y*y;if(x>i){let C=Math.sqrt(x),b=2,I=C;C<this.viaDiameter?(b*=4,I=Math.max(i,C)):I=Math.max(i,C-this.viaDiameter);let v=b*o*Math.exp(-6*I),P=f/C*v,M=y/C*v;A.force&&(A.force.fx+=P,A.force.fy+=M),g.force&&(g.force.fx+=-P,g.force.fy+=-M)}}}for(let h=0;h<n;h++){let{vias:d}=a[h];if(!(d.length<2))for(let u=0;u<d.length;u++)for(let _=u+1;_<d.length;_++){let p=d[u],m=d[_],A=p.point.x-m.point.x,g=p.point.y-m.point.y,f=A*A+g*g;if(f>i){let y=Math.sqrt(f),x=2,C=y;y<this.viaDiameter?(x*=4,C=Math.max(i,y)):C=Math.max(i,y-this.viaDiameter);let b=x*o*Math.exp(-6*C),I=A/y*b,v=g/y*b;p.force&&(p.force.fx+=I,p.force.fy+=v),m.force&&(m.force.fx+=-I,m.force.fy+=-v)}}}let l=!1;for(let h=0;h<n;h++)for(let d=0;d<e[h].mPoints.length;d++){let u=e[h].mPoints[d],_=s[h][d],p=u.z1!==u.z2,{fx:m,fy:A}=_,g=u.x+m,f=u.y+A;if(p){let y=this.viaDiameter/2,x=0,C=0,b=this.viaDiameter/2+this.BOUNDARY_PADDING,I=this.bounds.minX+b,v=this.bounds.maxX-b,P=this.bounds.minY+b,M=this.bounds.maxY-b,B=I+y-u.x,T=u.x-(v-y),N=P+y-u.y,D=u.y-(M-y);B>0?x=r*(Math.exp(B/(2*this.obstacleMargin))-1):T>0&&(x=-0.008*(Math.exp(T/(2*this.obstacleMargin))-1)),N>0?C=r*(Math.exp(N/(2*this.obstacleMargin))-1):D>0&&(C=-0.008*(Math.exp(D/(2*this.obstacleMargin))-1)),m+=x,A+=C,g=u.x+m,f=u.y+A}else{let y=this.traceWidth/2+this.BOUNDARY_PADDING;g=Math.max(this.bounds.minX+y,Math.min(this.bounds.maxX-y,g)),f=Math.max(this.bounds.minY+y,Math.min(this.bounds.maxY-y,f))}if(Math.abs(m)<i&&Math.abs(A)<i)continue;t+=Math.sqrt(m*m+A*A),(Math.abs(u.x-g)>i||Math.abs(u.y-f)>i)&&(u.x=g,u.y=f,l=!0)}return{lastStepMoved:l,magForceApplied:t}}},tHt=(e)=>e.flatMap((t)=>`${t.connectionName}-${t.mPoints.map((n)=>`${n.x.toFixed(2)},${n.y.toFixed(2)},${n.z1},${n.z2}`)}`).sort().join("|"),OUt=class extends rqe{getSolverName(){return"MultiHeadPolyLineIntraNodeSolver3"}constructor(e){super(e),this.MAX_ITERATIONS=1000}createInitialCandidateFromSeed(e,t){let n=new tmr({nodeWithPortPoints:this.nodeWithPortPoints,colorMap:this.colorMap,hyperParameters:{SHUFFLE_SEED:e},viaDiameter:this.viaDiameter});if(n.solve(),n.failed||!n.solved)return this.failed=!0,this.error=`ViaPossibilitiesSolver2 failed with: ${n.error}`,null;let o=[],r=0;for(let[c,l]of n.completedPaths.entries()){if(l.length<2){console.warn(`Skipping connection "${c}" due to insufficient points (${l.length}) in ViaPossibilitiesSolver2 path.`);continue}let h=l[0],d=l[l.length-1],u=l.slice(1,-1),_=[],p=0,m=h.z;for(let f=0;f<u.length;f++){let y=u[f],x=f+1<u.length?u[f+1]:d,C=m,b=f+1<u.length&&y.x===x.x&&y.y===x.y&&y.z!==x.z?x.z:y.z;_.push({x:y.x,y:y.y,z1:C,z2:b}),C!==b?(p++,f++,m=b):m=y.z}r+=p;let A=this.SEGMENTS_PER_POLYLINE,g=_.length+1;for(;g<A;){let f=-1,y=-1,x=null,C=null,b=[{...h,z1:h.z,z2:h.z,connectionName:c},..._,{...d,z1:d.z,z2:d.z,connectionName:c}];for(let B=0;B<b.length-1;B++){let T=b[B],N=b[B+1];if(T.x===N.x&&T.y===N.y)continue;let D=kn(T,N);D>f&&(f=D,y=B,x=T,C=N)}if(y===-1||!x||!C){console.warn(`Could not find longest segment for ${c} while trying to reach ${A} segments.`);break}let I=(x.x+C.x)/2,v=(x.y+C.y)/2,P=x.z2,M={x:I,y:v,z1:P,z2:P};_.splice(y,0,M),g++}o.push({connectionName:c,start:{...h,z1:h.z,z2:h.z},end:{...d,z1:d.z,z2:d.z},mPoints:_})}if(o.length===0)return this.failed=!0,this.error="No valid polylines generated from ViaPossibilitiesSolver2.",console.error(this.error),null;if(t?.has(tHt(o)))return null;let i=this.computeMinGapBtwPolyLines(o),s=this.computeH({minGaps:i,forces:[]}),a={polyLines:o,g:0,h:s,f:0+s,viaCount:r,minGaps:i};return a.g=this.computeG(o,a),a.f=a.g+a.h,a}setupInitialPolyLines(){this.candidates=[];let e=Math.min(2000,function(o){if(!Number.isInteger(o)||o<0)throw RangeError("n must be a non-negative integer");let r=1;for(let i=2;i<=o;i++)r*=i;return r}(this.uniqueConnections)),t=new Set,n=this.createInitialCandidateFromSeed===dmr&&this.computeMinGapBtwPolyLines===umr&&this.computeH===pmr&&this.computeG===mmr;for(let o=0;o<e;o++){let r=n?this.createInitialCandidateFromSeed(o,t):this.createInitialCandidateFromSeed(o);if(!r)continue;let i=tHt(r.polyLines);t.has(i)||(t.add(i),this.candidates.push(r))}this.candidates.sort((o,r)=>o.f-r.f)}},dmr=OUt.prototype.createInitialCandidateFromSeed,umr=zUt.prototype.computeMinGapBtwPolyLines,pmr=rqe.prototype.computeH,mmr=rqe.prototype.computeG,nHt=(e)=>e.portPointId??`${e.connectionName}:${e.x}:${e.y}:${e.z}`,Wje=(e,t)=>{let[n,o]=e;if(n===o)return!1;let r=((i)=>{let[s,a]=i,c=nHt(s),l=nHt(a);return c<l?`${c}|${l}`:`${l}|${c}`})(e);return!t.seenPairKeys.has(r)&&(t.seenPairKeys.add(r),t.pairs.push(e),!0)},oHt=(e,t)=>{for(let n=0;n<e.length-1;n++)Wje([e[n],e[n+1]],t)},Vce=(e)=>{let t=[],n=new Set,o=new Map(e.filter((a)=>typeof a.portPointId=="string").map((a)=>[a.portPointId,a])),r={pairs:t,seenPairKeys:n};for(let a of e){if(a.prevPortPointId){let c=o.get(a.prevPortPointId);c&&c.connectionName===a.connectionName&&Wje([c,a],r)}if(a.nextPortPointId){let c=o.get(a.nextPortPointId);c&&c.connectionName===a.connectionName&&Wje([a,c],r)}}if(t.length===0)return oHt(e,r),t;let i=new Set(t.flatMap(([a,c])=>[a.portPointId,c.portPointId]).filter(Boolean)),s=e.filter((a)=>!a.portPointId||!i.has(a.portPointId));return oHt(s,r),t},QS=0.000001,rHt=0.02,vae=(e)=>`${e.x.toFixed(6)},${e.y.toFixed(6)}`,_V=(e,t)=>Math.abs(e.x-t.x)<QS&&Math.abs(e.y-t.y)<QS,iHt=(e)=>({minX:e.center.x-e.width/2,maxX:e.center.x+e.width/2,minY:e.center.y-e.height/2,maxY:e.center.y+e.height/2}),_mr=(e,t)=>e.x>=t.minX-QS&&e.x<=t.maxX+QS&&e.y>=t.minY-QS&&e.y<=t.maxY+QS,gmr=(e,t,n)=>{for(let o of n)if(!_V(o,e)&&!_V(o,t)&&xc(o,e,t)<0.0001)return!0;return!1},Amr=(e,t,n)=>{for(let o of n)if(!(_V(e,o.A)||_V(e,o.B)||_V(t,o.A)||_V(t,o.B))&&Ru(e,t,o.A,o.B))return!0;return!1},fmr=(e,t)=>{let n=[];for(let o of e){let r=o.rootConnectionName??o.connectionName;if(r!==t)for(let i=0;i<o.route.length-1;i++){let s=o.route[i],a=o.route[i+1];s.z===a.z&&n.push({A:{x:s.x,y:s.y},B:{x:a.x,y:a.y},rootConnectionName:r})}}return n},ymr=(e,t)=>e.portPoints.filter((n)=>(n.rootConnectionName??n.connectionName)!==t).map((n)=>({x:n.x,y:n.y}));function*VUt(e,t=e.length){if(t<=1)yield e.slice();else for(let n=0;n<t;n++)[e[n],e[t-1]]=[e[t-1],e[n]],yield*VUt(e,t-1),[e[n],e[t-1]]=[e[t-1],e[n]]}var xmr=({A:e,B:t,bounds:n,obstacleSegments:o,foreignPorts:r})=>{let i=[{x:e.x,y:e.y},{x:t.x,y:t.y},{x:(n.minX+n.maxX)/2,y:(n.minY+n.maxY)/2},{x:n.minX,y:n.minY},{x:n.maxX,y:n.minY},{x:n.maxX,y:n.maxY},{x:n.minX,y:n.maxY}],s=[...o.flatMap((A)=>[A.A,A.B]),...r,{x:e.x,y:e.y},{x:t.x,y:t.y}];for(let A of s)for(let g of[-0.02,0,rHt])for(let f of[-0.02,0,rHt]){let y={x:A.x+g,y:A.y+f};_mr(y,n)&&i.push(y)}let a=((A)=>{let g=new Set,f=[];for(let y of A){let x=vae(y);g.has(x)||(g.add(x),f.push(y))}return f})(i),c=vae(e),l=vae(t),h=new Map(a.map((A)=>[vae(A),A])),d=new Map,u=new Map,_=new Set;for(let A of a){let g=vae(A);d.set(g,g===c?0:1/0),u.set(g,null),_.add(g)}for(;_.size>0;){let A=null,g=1/0;for(let y of _){let x=d.get(y)??1/0;(x<g-QS||Math.abs(x-g)<=QS&&(A===null||y<A))&&(g=x,A=y)}if(!A||g===1/0)break;if(_.delete(A),A===l)break;let f=h.get(A);for(let y of _){let x=h.get(y);if(_V(f,x))continue;if(Amr(f,x,o))continue;if(gmr(f,x,r))continue;let C=g+kn(f,x),b=d.get(y)??1/0,I=u.get(y);(C<b-QS||Math.abs(C-b)<=QS&&(I==null||A<I))&&(d.set(y,C),u.set(y,A))}}if((d.get(l)??1/0)===1/0)return null;let p=[],m=l;for(;m;)p.push(h.get(m)),m=u.get(m)??null;return p.reverse(),p.map((A)=>({x:A.x,y:A.y,z:e.z}))},sHt=class extends ei{getSolverName(){return"SingleLayerNoDifferentRootIntersectionsIntraNodeSolver"}nodeWithPortPoints;traceWidth;viaDiameter;solvedRoutes=[];constructor(e){super(),this.nodeWithPortPoints=e.nodeWithPortPoints,this.traceWidth=e.traceWidth??0.15,this.viaDiameter=e.viaDiameter??0.3,this.MAX_ITERATIONS=1}static isApplicable(e){if(((r)=>r.availableZ?.length?[...new Set(r.availableZ)].sort((i,s)=>i-s):[...new Set(r.portPoints.map((i)=>i.z??0))].sort((i,s)=>i-s))(e).length!==1)return!1;if(e.portPoints.length>12)return!1;let n=iHt(e);if(e.portPoints.some((r)=>((i,s)=>Math.abs(i.y-s.minY)<0.001?"top":Math.abs(i.x-s.maxX)<0.001?"right":Math.abs(i.y-s.maxY)<0.001?"bottom":Math.abs(i.x-s.minX)<0.001?"left":null)(r,n)===null))return!1;let o=new Map;for(let r of e.portPoints)o.set(r.connectionName,(o.get(r.connectionName)??0)+1);return[...o.values()].some((r)=>r>2)}buildTaskGroups(){let e=new Map;for(let t of this.nodeWithPortPoints.portPoints){let n=e.get(t.connectionName)??[];n.push(t),e.set(t.connectionName,n)}return e}trySolveNode(){let e=iHt(this.nodeWithPortPoints),t=this.buildTaskGroups(),n=Array.from(t.entries()).flatMap(([r,i])=>Vce(i).map(([s,a])=>({connectionName:r,rootConnectionName:s.rootConnectionName??a.rootConnectionName??r,A:s,B:a}))),o=n.length<=6?VUt(n.slice()):[n];for(let r of o){let i=[],s=!1;for(let a of r){let c=fmr(i,a.rootConnectionName),l=ymr(this.nodeWithPortPoints,a.rootConnectionName),h=xmr({A:a.A,B:a.B,bounds:e,obstacleSegments:c,foreignPorts:l});if(!h||h.length<2){s=!0;break}i.push({connectionName:a.connectionName,rootConnectionName:a.rootConnectionName,regionId:this.nodeWithPortPoints.capacityMeshNodeId,traceThickness:this.traceWidth,viaDiameter:this.viaDiameter,route:h,vias:[]})}if(!s)return i}return null}_step(){let e=this.trySolveNode();if(!e)return this.failed=!0,void(this.error="Failed to find a single-layer route set without different-root intersections");this.solvedRoutes=e,this.stats={routeCount:e.length,distinctRoots:new Set(e.map((t)=>t.rootConnectionName??t.connectionName)).size},this.solved=!0}visualize(){return{lines:this.solvedRoutes.map((e)=>({points:e.route,strokeColor:"cyan",strokeWidth:e.traceThickness,label:`${e.connectionName}
root: ${e.rootConnectionName??e.connectionName}`})),points:this.nodeWithPortPoints.portPoints.map((e)=>({x:e.x,y:e.y,color:"blue",label:`${e.connectionName}
root: ${e.rootConnectionName??e.connectionName}`})),rects:[],circles:[]}}},aHt=(e)=>e.min<=e.max?h2(e.value,e.min,e.max):e.value,Cmr=class extends ei{getSolverName(){return"SingleTransitionIntraNodeSolver"}nodeWithPortPoints;routes;viaDiameter;traceThickness;obstacleMargin;solvedRoutes=[];bounds;constructor(e){if(super(),this.nodeWithPortPoints=e.nodeWithPortPoints,this.viaDiameter=e?.viaDiameter??0.3,this.traceThickness=e?.traceThickness??0.15,this.obstacleMargin=e?.obstacleMargin??0.1,this.routes=this.extractRoutesFromNode(),this.bounds=this.calculateBounds(),this.routes.length!==1)return this.failed=!0,void(this.error=`Expected 1 route, but got ${this.routes.length}`);let t=this.routes[0];if(t.A.z===void 0||t.B.z===void 0)return this.failed=!0,void(this.error="Route points should have predefined z values");if(t.A.z===t.B.z)return this.failed=!0,void(this.error="Only one route provided, but it has no transition");let n=this.viaDiameter/2+this.obstacleMargin,o={x:aHt({value:(t.A.x+t.B.x)/2,min:this.bounds.minX+n,max:this.bounds.maxX-n}),y:aHt({value:(t.A.y+t.B.y)/2,min:this.bounds.minY+n,max:this.bounds.maxY-n})};this.solvedRoutes.push(this.createTransitionRoute({start:t.A,end:t.B,via:o,connectionName:t.connectionName})),this.solved=!0}extractRoutesFromNode(){let e=[],t=this.nodeWithPortPoints.portPoints,n=new Map;for(let o of t){let{connectionName:r}=o;n.has(r)||n.set(r,[]),n.get(r).push(o)}for(let[o,r]of n.entries())for(let[i,s]of Vce(r))e.push({A:{...i},B:{...s},connectionName:o});return e}calculateBounds(){return{minX:this.nodeWithPortPoints.center.x-this.nodeWithPortPoints.width/2,maxX:this.nodeWithPortPoints.center.x+this.nodeWithPortPoints.width/2,minY:this.nodeWithPortPoints.center.y-this.nodeWithPortPoints.height/2,maxY:this.nodeWithPortPoints.center.y+this.nodeWithPortPoints.height/2}}createTransitionRoute(e){let{start:t,end:n,via:o,connectionName:r}=e,i=[{x:t.x,y:t.y,z:t.z},{x:o.x,y:o.y,z:t.z},{x:o.x,y:o.y,z:n.z},{x:n.x,y:n.y,z:n.z}];return{connectionName:r,regionId:this.nodeWithPortPoints.capacityMeshNodeId,route:i,traceThickness:this.traceThickness,viaDiameter:this.viaDiameter,vias:[o]}}_step(){this.solved=!0}visualize(){let e={lines:[],points:[],rects:[],circles:[]};if(e.rects.push({center:{x:(this.bounds.minX+this.bounds.maxX)/2,y:(this.bounds.minY+this.bounds.maxY)/2},width:this.bounds.maxX-this.bounds.minX,height:this.bounds.maxY-this.bounds.minY,stroke:"rgba(0, 0, 0, 0.5)",fill:"rgba(240, 240, 240, 0.1)",label:"PCB Bounds"}),this.routes.length>0)for(let t of this.routes)e.points.push({x:t.A.x,y:t.A.y,label:`${t.connectionName} start (z=${t.A.z})`,color:"orange"}),e.points.push({x:t.B.x,y:t.B.y,label:`${t.connectionName} end (z=${t.B.z})`,color:"orange"}),e.lines.push({points:[t.A,t.B],strokeColor:"rgba(255, 0, 0, 0.5)",label:`${t.connectionName} direct`});for(let t=0;t<this.solvedRoutes.length;t++){let n=this.solvedRoutes[t];for(let r=0;r<n.route.length-1;r++){let i=n.route[r],s=n.route[r+1];e.lines.push({points:[i,s],strokeColor:"rgba(0, 255, 0, 0.75)",strokeDash:i.z!==n.route[0].z?[0.2,0.2]:void 0,strokeWidth:n.traceThickness,label:`${n.connectionName} z=${i.z}`})}for(let r of n.vias)e.circles.push({center:r,radius:this.viaDiameter/2,fill:"rgba(0, 0, 255, 0.8)",stroke:"black",label:"Solved Via"}),e.circles.push({center:r,radius:this.viaDiameter/2+this.obstacleMargin,fill:"rgba(0, 0, 255, 0.3)",stroke:"black",label:"Via Margin"})}return e}},kq=(e,t=2)=>{let n=Array.from({length:t},(o,r)=>r);return e.map((o)=>{let r=wle(o.__zLayers??(o.layers?Ble(o.layers,t):void 0)??n,t);return{...o,__zLayers:r.length>0?r:n}})},cHt=0.000001,lHt=(e)=>{let{point:t,obstacle:n}=e,o=n.width/2+cHt,r=n.height/2+cHt;return Math.abs(t.x-n.center.x)<=o&&Math.abs(t.y-n.center.y)<=r},bmr=class e extends ei{getSolverName(){return"SingleTransitionThroughObstacleIntraNodeSolver"}nodeWithPortPoints;routes;obstacles;viaDiameter;traceThickness;connMap;solvedRoutes=[];constructor(t){if(super(),this.nodeWithPortPoints=t.nodeWithPortPoints,this.obstacles=kq(t.obstacles??[],t.layerCount??2),this.connMap=t.connMap,this.viaDiameter=t.viaDiameter??0.3,this.traceThickness=t.traceThickness??0.15,this.routes=this.extractRoutesFromNode(),this.routes.length===0)return this.failed=!0,void(this.error="Expected at least 1 route");if(this.routes.some((o)=>o.A.z===void 0||o.B.z===void 0))return this.failed=!0,void(this.error="Route points should have predefined z values");if(!this.routes.some((o)=>o.A.z!==o.B.z))return this.failed=!0,void(this.error="No route transitions through an obstacle");let n=this.routes.map((o)=>this.getContainingThroughObstacle(o));if(n.some((o)=>!o))return this.failed=!0,void(this.error="No same-net multilayer obstacle contains every route");this.solvedRoutes.push(...this.routes.map((o,r)=>({connectionName:o.connectionName,rootConnectionName:o.rootConnectionName,regionId:this.nodeWithPortPoints.capacityMeshNodeId,route:[{x:o.A.x,y:o.A.y,z:o.A.z,...o.A.z!==o.B.z?{toNextSegmentType:"through_obstacle",...n[r].circuitJsonMetadata?{toNextSegmentCircuitJsonMetadata:n[r].circuitJsonMetadata}:{}}:{}},{x:o.B.x,y:o.B.y,z:o.B.z}],traceThickness:this.traceThickness,viaDiameter:this.viaDiameter,vias:[]}))),this.solved=!0}static isApplicable(t){return new e(t).solved}extractRoutesFromNode(){let t=[],n=new Map;for(let o of this.nodeWithPortPoints.portPoints){let{connectionName:r}=o;n.has(r)||n.set(r,[]),n.get(r).push(o)}for(let[o,r]of n.entries())for(let[i,s]of Vce(r))t.push({A:{...i},B:{...s},connectionName:o,rootConnectionName:i.rootConnectionName??s.rootConnectionName});return t}getContainingThroughObstacle(t){let n=t.A.z,o=t.B.z;return n===void 0||o===void 0?null:this.obstacles.find((r)=>{return!(r.__zLayers.length<2)&&(!(!r.__zLayers.includes(n)||!r.__zLayers.includes(o))&&(!!(i={obstacle:r,connectionName:t.connectionName,connMap:this.connMap}).obstacle.connectedTo.some((s)=>s===i.connectionName||(i.connMap?.areIdsConnected(i.connectionName,s)??!1))&&(lHt({point:t.A,obstacle:r})&&lHt({point:t.B,obstacle:r}))));var i})??null}_step(){this.solved=!0}visualize(){let t={lines:[],points:[],rects:[],circles:[]};for(let n of this.obstacles)t.rects.push({center:n.center,width:n.width,height:n.height,fill:"rgba(128, 0, 128, 0.2)",stroke:"rgba(128, 0, 128, 0.6)",label:`through obstacle candidate
z: ${n.__zLayers.join(",")}`});for(let n of this.solvedRoutes){t.lines.push({points:n.route,strokeColor:"rgba(0, 180, 0, 0.8)",strokeDash:"4, 3",strokeWidth:n.traceThickness,label:`${n.connectionName} through_obstacle`});for(let o of n.route)t.points.push({x:o.x,y:o.y,color:"green",label:`${n.connectionName}
z: ${o.z}`})}return t}},Yb=0.000001,hHt=({value:e,min:t,max:n})=>e>=t&&e<=n,S4e=({value:e,target:t,epsilon:n})=>Math.abs(e-t)<=n,YUt=({point:e,bounds:t,epsilon:n=0.000001})=>{if(![e.x,e.y,t.minX,t.maxX,t.minY,t.maxY].every((d)=>(({value:u})=>Number.isFinite(u))({value:d})))return"outside";if(e.x<t.minX-n||e.x>t.maxX+n||e.y<t.minY-n||e.y>t.maxY+n)return"outside";let o=S4e({value:e.x,target:t.minX,epsilon:n}),r=S4e({value:e.x,target:t.maxX,epsilon:n}),i=S4e({value:e.y,target:t.minY,epsilon:n}),s=S4e({value:e.y,target:t.maxY,epsilon:n}),a=o||r,c=i||s;if(a&&c)return"on-boundary";let l=hHt({value:e.y,min:t.minY,max:t.maxY}),h=hHt({value:e.x,min:t.minX,max:t.maxX});return a&&l||c&&h?"on-boundary":"inside"};function Imr(e,t,n,o,r){let i={x:(e.x+t.x+n.x)/3,y:(e.y+t.y+n.y)/3},s=(f,y)=>Math.sqrt((y.x-f.x)**2+(y.y-f.y)**2),a=(f)=>{let y=s(f,e),x=s(f,t),C=s(f,n),b=f.x>=r.minX&&f.x<=r.maxX&&f.y>=r.minY&&f.y<=r.maxY;return y>=o&&x>=o&&C>=o&&b};if(a(i))return i;let c=(f,y,x)=>{let C=f.x-y.x,b=f.y-y.y,I=Math.sqrt(C*C+b*b);return I<0.0000000001?{x:y.x+x,y:y.y}:{x:y.x+C/I*x,y:y.y+b/I*x}},l=(f,y,x)=>{let C=y.x-f.x,b=y.y-f.y,I=Math.sqrt(C*C+b*b);if(I>2*x-0.0000000001||I<0.0000000001)return[];let v=I*I/(2*I),P=Math.sqrt(Math.max(0,x*x-v*v)),M=f.x+C*v/I,B=f.y+b*v/I,T={x:M+P*b/I,y:B-P*C/I},N={x:M-P*b/I,y:B+P*C/I},D=[],L=0.000001;return Math.abs(s(T,f)-x)<L&&Math.abs(s(T,y)-x)<L&&D.push(T),Math.abs(s(N,f)-x)<L&&Math.abs(s(N,y)-x)<L&&D.push(N),D},h=[c(i,e,o),c(i,t,o),c(i,n,o),...l(e,t,o),...l(t,n,o),...l(n,e,o)],d=h.filter(a);if(d.length>0){let f=d.filter((y)=>!((x)=>Math.abs(x.x-r.minX)<0.000001||Math.abs(x.x-r.maxX)<0.000001||Math.abs(x.y-r.minY)<0.000001||Math.abs(x.y-r.maxY)<0.000001)(y));if(f.length>0)return f.sort((y,x)=>s(y,i)-s(x,i)),f[0]}let u=null,_=1/0;for(let f=r.minX+1;f<r.maxX;f+=5)for(let y=r.minY+1;y<r.maxY;y+=5){let x={x:f,y};if(a(x)){let C=s(x,i);C<_&&(_=C,u=x)}}if(u!==null)return u;let p=[];for(let f=0;f<=100;f++){let y=f/100;p.push({x:r.minX+y*(r.maxX-r.minX),y:r.minY}),p.push({x:r.maxX,y:r.minY+y*(r.maxY-r.minY)}),p.push({x:r.maxX-y*(r.maxX-r.minX),y:r.maxY}),p.push({x:r.minX,y:r.maxY-y*(r.maxY-r.minY)})}let m=p.filter(a);if(m.length>0)return m.sort((f,y)=>s(f,i)-s(y,i)),m[0];let A=1/0,g={x:r.minX,y:r.minY};for(let f of[...h,...p])if(f.x>=r.minX&&f.x<=r.maxX&&f.y>=r.minY&&f.y<=r.maxY){let y=Math.max(0,o-s(f,e))+Math.max(0,o-s(f,t))+Math.max(0,o-s(f,n));y<A&&(A=y,g=f)}return g}function XO(e,t,n){let o=dHt(t,e,n.center,n.radius),r=dHt(e,t,n.center,n.radius),i=hQ(o,t),s=hQ(e,r),c;if(i>0.000001&&s>0.000001){c={x:(o.x+r.x)/2,y:(o.y+r.y)/2};let l=hQ(o,c),h=hQ(r,c);if(Math.abs(l-h)>0.5*Math.min(l,h)){let u=hQ(e,o),_=hQ(t,r),p=u+_;if(p>0.000001){let m=_/p,A=u/p;c={x:o.x*m+r.x*A,y:o.y*m+r.y*A}}}let d=hQ(c,n.center);if(d<1.05*n.radius){let u={x:(c.x-n.center.x)/d,y:(c.y-n.center.y)/d};c={x:n.center.x+u.x*n.radius*1.2,y:n.center.y+u.y*n.radius*1.2}}}else{let l={x:(e.x+t.x)/2,y:(e.y+t.y)/2},h=hQ(l,n.center);if(h<1.1*n.radius){let d={x:(l.x-n.center.x)/h,y:(l.y-n.center.y)/h};c={x:n.center.x+d.x*n.radius*1.2,y:n.center.y+d.y*n.radius*1.2}}else c=l}return{B:o,D:r,E:c}}function dHt(e,t,n,o){let r=[n.x-e.x,n.y-e.y],i=Math.sqrt(r[0]*r[0]+r[1]*r[1]);if(i<=o){if(i<0.00000001){let A=[t.x-e.x,t.y-e.y],g=Math.sqrt(A[0]*A[0]+A[1]*A[1]);return g<0.00000001?{x:n.x+o,y:n.y}:{x:n.x+A[0]/g*o,y:n.y+A[1]/g*o}}let m=[r[0]/i,r[1]/i];return{x:n.x-m[0]*o,y:n.y-m[1]*o}}let s=[t.x-e.x,t.y-e.y],a=Math.sqrt(i*i-o*o),c=[r[0]/i,r[1]/i],l=[-c[1],c[0]],h=[c[1],-c[0]],d=s[0]*l[0]+s[1]*l[1]>s[0]*h[0]+s[1]*h[1]?l:h,u=o/i,_=a/i,p=[c[0]*_+d[0]*u,c[1]*_+d[1]*u];return{x:e.x+a*p[0],y:e.y+a*p[1]}}function hQ(e,t){let n=t.x-e.x,o=t.y-e.y;return Math.sqrt(n*n+o*o)}var A1=0.000000001;function uHt(e,t,n,o="cw"){let r=Cce(e,n),i=Cce(t,n);return Math.abs(i-r)<A1?{left:0,top:0,right:0,bottom:0}:function(s,a,c,l){let h=c.maxX-c.minX,d=c.maxY-c.minY;if(h<A1&&d<A1)return{left:0,top:0,right:0,bottom:0};let u=2*(h+d);if(u<A1)return{left:0,top:0,right:0,bottom:0};let _=h/u*(2*Math.PI),p=(h+d)/u*(2*Math.PI),m=(h+h+d)/u*(2*Math.PI),A=2*Math.PI,g=[{name:"top",start:0,end:_,length:h},{name:"right",start:_,end:p,length:d},{name:"bottom",start:p,end:m,length:h},{name:"left",start:m,end:A,length:d}],f={left:0,top:0,right:0,bottom:0},y=(x,C,b,I,v)=>{let P=C>2*Math.PI-A1?2*Math.PI:C;if(P<=x+A1)return 0;if(v){let M=Math.max(x,b),B=Math.min(P,2*Math.PI),T=Math.max(0,B-M),N=Math.max(x,0),D=Math.min(P,I);return T+Math.max(0,D-N)}{let M=Math.max(x,b),B=Math.min(P,I);return Math.max(0,B-M)}};for(let x of g){let C=x.end-x.start;if(C<A1||x.length<A1)continue;let b=0;if(l==="cw"){let I=s>a+A1;b=y(x.start,x.end,s,a,I)}else{let I=a>s+A1;b=y(x.start,x.end,a,s,I)}if(b>A1){let I=b/C;f[x.name]+=Math.max(0,Number.isFinite(I)?I:0)}}for(let x in f)f[x]=Math.max(0,Math.min(1,f[x]));return f}(r,i,n,o)}function Cce(e,t){let n=t.maxX-t.minX,o=t.maxY-t.minY;if(n<A1&&o<A1)return 0;let r=2*(n+o);if(r<A1)return 0;let i=0;if(Math.abs(e.y-t.maxY)<=Yb&&e.x>=t.minX-Yb&&e.x<=t.maxX+Yb)i=Math.max(0,Math.min(n,e.x-t.minX));else if(Math.abs(e.x-t.maxX)<=Yb&&e.y>=t.minY-Yb&&e.y<=t.maxY+Yb)i=n+Math.max(0,Math.min(o,t.maxY-e.y));else if(Math.abs(e.y-t.minY)<=Yb&&e.x>=t.minX-Yb&&e.x<=t.maxX+Yb)i=n+o+Math.max(0,Math.min(n,t.maxX-e.x));else{if(!(Math.abs(e.x-t.minX)<=Yb&&e.y>=t.minY-Yb&&e.y<=t.maxY+Yb))throw Error(`Point (${e.x}, ${e.y}) does not lie on the boundary defined by ${JSON.stringify(t)}`);i=n+o+n+Math.max(0,Math.min(o,e.y-t.minY))}return i=Math.max(0,Math.min(r,i)),r>A1?i/r*(2*Math.PI):0}function vmr(e,t,n,o){return function({angleA:r,angleB:i,angleC:s}){let a=Math.cos(r),c=Math.sin(r),l=Math.cos(i),h=Math.sin(i),d=Math.cos(s);return(l-a)*(Math.sin(s)-c)-(h-c)*(d-a)<0?"ccw":"cw"}({angleA:Cce(e,o),angleB:Cce(t,o),angleC:Cce(n,o)})}var Smr=class extends ei{getSolverName(){return"SingleTransitionCrossingRouteSolver"}nodeWithPortPoints;routes;viaDiameter;traceThickness;obstacleMargin;layerCount=2;debugViaPositions;solvedRoutes=[];bounds;constructor(e){if(super(),this.nodeWithPortPoints=e.nodeWithPortPoints,this.viaDiameter=e?.viaDiameter??0.3,this.traceThickness=e?.traceThickness??0.15,this.obstacleMargin=e?.obstacleMargin??0.1,this.layerCount=e?.layerCount??2,this.debugViaPositions=[],this.routes=this.extractRoutesFromNode(),this.bounds=this.calculateBounds(),this.routes.length!==2)return this.failed=!0,void(this.error=`Expected 2 routes, but got ${this.routes.length}`);let t=this.routes.flatMap((s)=>[s.A,s.B]).map((s)=>this.getPortPointBoundsPosition(s));if(t.includes("outside"))return this.failed=!0,void(this.error="Invalid route input: SingleTransitionCrossingRouteSolver received port point(s) outside node bounds");if(t.includes("inside"))return void(this.failed=!0);this.routes=this.routes.map((s)=>({...s,A:this.snapPortPointToBounds(s.A),B:this.snapPortPointToBounds(s.B)}));let[n,o]=this.routes,r=n.A.z!==n.B.z,i=o.A.z!==o.B.z;return r&&i||!r&&!i?(this.failed=!0,void(this.error="Exactly one route must have a layer transition")):void 0}extractRoutesFromNode(){let e=[],t=this.nodeWithPortPoints.portPoints,n=new Map;for(let o of t){let{connectionName:r}=o;n.has(r)||n.set(r,[]),n.get(r)?.push(o)}for(let[o,r]of n.entries())r.length===2&&e.push({A:{...r[0],z:r[0].z??0},B:{...r[1],z:r[1].z??0},connectionName:o});return e}calculateBounds(){return{minX:this.nodeWithPortPoints.center.x-this.nodeWithPortPoints.width/2,maxX:this.nodeWithPortPoints.center.x+this.nodeWithPortPoints.width/2,minY:this.nodeWithPortPoints.center.y-this.nodeWithPortPoints.height/2,maxY:this.nodeWithPortPoints.center.y+this.nodeWithPortPoints.height/2}}getPortPointBoundsPosition(e){return YUt({point:e,bounds:this.bounds})}snapPortPointToBounds(e){let t=h2(e.x,this.bounds.minX,this.bounds.maxX),n=h2(e.y,this.bounds.minY,this.bounds.maxY);return[{distance:Math.abs(e.y-this.bounds.maxY),point:{...e,x:t,y:this.bounds.maxY}},{distance:Math.abs(e.x-this.bounds.maxX),point:{...e,x:this.bounds.maxX,y:n}},{distance:Math.abs(e.y-this.bounds.minY),point:{...e,x:t,y:this.bounds.minY}},{distance:Math.abs(e.x-this.bounds.minX),point:{...e,x:this.bounds.minX,y:n}}].reduce((o,r)=>r.distance<o.distance?r:o).point}doRoutesCross(e,t){return Ru(e.A,e.B,t.A,t.B)}calculateViaPosition(e,t){let n=t.A.z,o=e.A.z!==n?e.A:e.B,r=2*this.obstacleMargin+this.viaDiameter/2+this.traceThickness,i=this.obstacleMargin+this.viaDiameter/2,s=t.A,a=o,c=t.B,l=vmr(s,a,c,this.bounds),h=function(u,_,p,m,A){let g=uHt(u,_,m,A),f=uHt(_,p,m,A),y={left:Math.min(1,g.left+f.left),top:Math.min(1,g.top+f.top),right:Math.min(1,g.right+f.right),bottom:Math.min(1,g.bottom+f.bottom)};for(let x in y)Math.abs(y[x])<A1&&(y[x]=0);return y}(s,a,c,this.bounds,l),d={minX:this.bounds.minX+(h.left>0.5?r:i),minY:this.bounds.minY+(h.bottom>0.5?r:i),maxX:this.bounds.maxX-(h.right>0.5?r:i),maxY:this.bounds.maxY-(h.top>0.5?r:i)};return d.maxY<d.minY&&(d.minY=(d.minY+d.maxY)/2,d.maxY=d.minY),d.maxX<d.minX&&(d.minX=(d.minX+d.maxX)/2,d.maxX=d.minX),Imr(s,a,c,r,d)}createTransitionRoute(e,t,n,o){let r=[{x:e.x,y:e.y,z:e.z??0},{x:n.x,y:n.y,z:e.z??0},{x:n.x,y:n.y,z:t.z??0},{x:t.x,y:t.y,z:t.z??0}];return{connectionName:o,regionId:this.nodeWithPortPoints.capacityMeshNodeId,route:r,traceThickness:this.traceThickness,viaDiameter:this.viaDiameter,vias:[n]}}createFlatRoute(e,t,n,o,r,i){o.z,e.z;let s=this.viaDiameter/2+this.traceThickness/2+this.obstacleMargin,a=((A,g,f,y)=>{let x=f.x-A.x,C=f.y-A.y;return((b,I)=>({x:(b.x+I.x)/2,y:(b.y+I.y)/2}))({x:A.x+x*g,y:A.y+C*g},{x:f.x-x*y,y:f.y-C*y})})(n,this.viaDiameter,o.z!==e.z?o:r,this.traceThickness),c={center:{x:n.x,y:n.y},radius:s},l=XO(e,a,c).E,h=XO(a,t,c).E,d=XO(e,l,c).E,u=XO(l,a,c).E,_=XO(a,h,c).E,p=XO(h,t,c).E,m=XO(u,_,c).E;return{connectionName:i,regionId:this.nodeWithPortPoints.capacityMeshNodeId,route:[{x:e.x,y:e.y,z:e.z??0},{x:d.x,y:d.y,z:e.z??0},{x:l.x,y:l.y,z:e.z??0},{x:u.x,y:u.y,z:e.z??0},{x:m.x,y:m.y,z:e.z??0},{x:_.x,y:_.y,z:e.z??0},{x:h.x,y:h.y,z:e.z??0},{x:p.x,y:p.y,z:e.z??0},{x:t.x,y:t.y,z:t.z??0}],traceThickness:this.traceThickness,viaDiameter:this.viaDiameter,vias:[]}}trySolve(){let[e,t]=this.routes,n=e.A.z!==e.B.z,o=n?e:t,r=n?t:e,i=this.calculateViaPosition(o,r);if(!i)return!1;this.debugViaPositions.push({via:i});let s=this.createTransitionRoute(o.A,o.B,i,o.connectionName),a=this.createFlatRoute(r.A,r.B,i,o.A,o.B,r.connectionName);return this.solvedRoutes.push(s,a),!0}_step(){if(!this.doRoutesCross(this.routes[0],this.routes[1]))return this.failed=!0,void(this.error="Can only solve routes that have a single transition crossing");this.trySolve()?this.solved=!0:(this.failed=!0,this.error="Failed to find a valid via position and route path")}visualize(){let e={lines:[],points:[],rects:[],circles:[]};e.rects.push({center:{x:(this.bounds.minX+this.bounds.maxX)/2,y:(this.bounds.minY+this.bounds.maxY)/2},width:this.bounds.maxX-this.bounds.minX,height:this.bounds.maxY-this.bounds.minY,stroke:"rgba(0, 0, 0, 0.5)",fill:"rgba(240, 240, 240, 0.1)",label:"PCB Bounds"});for(let t of this.routes)e.points.push({x:t.A.x,y:t.A.y,label:`${t.connectionName} start (z=${t.A.z})`,color:"orange"}),e.points.push({x:t.B.x,y:t.B.y,label:`${t.connectionName} end (z=${t.B.z})`,color:"orange"}),e.lines.push({points:[t.A,t.B],strokeColor:"rgba(255, 0, 0, 0.5)",label:`${t.connectionName} direct`});for(let t=0;t<this.debugViaPositions.length;t++){let{via:n}=this.debugViaPositions[t];e.circles.push({center:n,radius:this.viaDiameter/2,fill:"rgba(255, 165, 0, 0.7)",stroke:"rgba(0, 0, 0, 0.5)",label:`Computed Via (attempt ${t+1})`});let o=this.viaDiameter/2+this.obstacleMargin;e.circles.push({center:n,radius:o,stroke:"rgba(255, 165, 0, 0.7)",fill:"rgba(0, 0, 0, 0)",label:"Safety Margin"})}for(let t=0;t<this.solvedRoutes.length;t++){let n=this.solvedRoutes[t],o=t%2==0?"rgba(0, 255, 0, 0.75)":"rgba(255, 0, 255, 0.75)";for(let r=0;r<n.route.length-1;r++){let i=n.route[r],s=n.route[r+1];e.lines.push({points:[i,s],strokeColor:o,strokeDash:i.z!==n.route[0].z?[0.2,0.2]:void 0,strokeWidth:n.traceThickness,label:`${n.connectionName} z=${i.z}`})}for(let r of n.vias)e.circles.push({center:r,radius:this.viaDiameter/2,fill:"rgba(0, 0, 255, 0.8)",stroke:"black",label:"Solved Via"}),e.circles.push({center:r,radius:this.viaDiameter/2+this.obstacleMargin,fill:"rgba(0, 0, 255, 0.3)",stroke:"black",label:"Via Margin"})}return e}getSolvedRoutes(){return this.solvedRoutes}};function Pmr({A:e,B:t,C:n,D:o,E:r,F:i,radius:s,margin:a,subdivisions:c=0}){let l=(I,v)=>({x:(I.x+v.x)/2,y:(I.y+v.y)/2}),h=(I,v,P)=>{let M=v.x-I.x,B=v.y-I.y,T=Math.sqrt(M*M+B*B),N=M/T,D=B/T,L=-D,H=N;return{midpoint:{x:(I.x+v.x)/2,y:(I.y+v.y)/2},A_Opp:{x:I.x-N*P,y:I.y-D*P},A_Right:{x:I.x+L*P,y:I.y+H*P},A_Left:{x:I.x-L*P,y:I.y-H*P},B_Opp:{x:v.x+N*P,y:v.y+D*P},B_Right:{x:v.x+L*P,y:v.y+H*P},B_Left:{x:v.x-L*P,y:v.y-H*P}}},d=(I,v)=>{let P=kn(I,v.start),M=kn(I,v.end),B=kn(v.start,v.end);return Math.abs(P+M-B)<0.0001},u=(I,v)=>{let{start:P,end:M}=I,{start:B,end:T}=v;if(d(P,v)||d(M,v)||d(B,I)||d(T,I))return!0;let N=M.x-P.x,D=M.y-P.y,L=T.x-B.x,H=T.y-B.y,V=N*H-D*L;if(Math.abs(V)<0.0001)return!1;let O=B.x-P.x,U=B.y-P.y,j=(O*H-U*L)/V,Y=(O*D-U*N)/V;return j>0&&j<1&&Y>0&&Y<1},_=(I,v)=>{let P=[];for(let B=0;B<I.length-1;B++)P.push({start:I[B],end:I[B+1]});let M=[];for(let B=0;B<v.length-1;B++)M.push({start:v[B],end:v[B+1]});for(let B of P)for(let T of M)if(u(B,T))return!0;return!1},p=(I)=>{let v=0;for(let P=1;P<I.length;P++){let M=I[P].x-I[P-1].x,B=I[P].y-I[P-1].y;v+=Math.sqrt(M*M+B*B)}return v},m=(I,v)=>{let{start:P,end:M}=I,B=M.x-P.x,T=M.y-P.y,N=B*B+T*T;if(N===0)return{...P,t:0};let D=Math.max(0,Math.min(1,((v.x-P.x)*B+(v.y-P.y)*T)/N));return{x:P.x+D*B,y:P.y+D*T,t:D}},A=(I,v,P)=>{let M=m(I,v);if(kn(M,v)>=P)return M;let B=M.x-v.x,T=M.y-v.y,N=Math.sqrt(B*B+T*T);if(N===0){let D=I.end.x-I.start.x,L=I.end.y-I.start.y,H=Math.sqrt(D*D+L*L);return{x:v.x+P*D/H,y:v.y+P*L/H,t:M.t,isSpecial:!0,specialType:v===e?"A":"B"}}return{x:v.x+P*B/N,y:v.y+P*T/N,t:M.t,isSpecial:!0,specialType:v===e?"A":"B"}},g=h(e,t,s),f=h(e,t,s+a),y=(I,v,P,M,B)=>{let T=I.points;if(T.length<2)return T;let N=P+M,D=[T[0]];for(let L=0;L<T.length-1;L++){let H={start:T[L],end:T[L+1]};if(xc(v,H.start,H.end)<N){let V=m(H,v),O=V.x-v.x,U=V.y-v.y,j=Math.sqrt(O*O+U*U),Y=null;if(j>0.000001)Y={x:v.x+N*O/j,y:v.y+N*U/j};else{let X=H.end.x-H.start.x,K=H.end.y-H.start.y,J=Math.sqrt(X*X+K*K);J>0.000001&&(Y={x:v.x+N*X/J,y:v.y+N*K/J})}Y&&kn(H.start,Y)>s/10&&D.push(Y)}kn(D[D.length-1],H.end)>s/10&&D.push(H.end)}if(D.length>1){let L=[D[0]];for(let H=1;H<D.length;H++)kn(L[L.length-1],D[H])>s/10&&L.push(D[H]);return L}return D},x=(()=>{let I=[[n,g.B_Left,g.B_Opp,g.B_Right,l(g.midpoint,l(g.B_Right,g.A_Right)),l(g.midpoint,l(g.A_Left,g.B_Left)),g.A_Left,g.A_Opp,g.A_Right,o],[n,g.B_Right,g.B_Opp,g.B_Left,l(g.midpoint,l(g.A_Left,g.B_Left)),l(g.midpoint,l(g.A_Right,g.B_Right)),g.A_Right,g.A_Opp,g.A_Left,o],[o,g.B_Left,g.B_Opp,g.B_Right,l(g.midpoint,l(g.A_Right,g.B_Right)),l(g.midpoint,l(g.A_Left,g.B_Left)),g.A_Left,g.A_Opp,g.A_Right,n],[o,g.B_Right,g.B_Opp,g.B_Left,l(g.midpoint,l(g.A_Left,g.B_Left)),l(g.midpoint,l(g.A_Right,g.B_Right)),g.A_Right,g.A_Opp,g.A_Left,n]],v=[];for(let U=0;U<I.length;U++){let j=I[U],Y={start:j[0],end:j[1]},X={start:j[j.length-2],end:j[j.length-1]},K={start:j[3],end:j[4]};u(Y,X)||u(Y,K)||u(X,K)||v.push({index:U+1,path:j,length:p(j)})}if(v.length===0)return{index:0,path:[]};let P=v.sort((U,j)=>U.length-j.length)[0],M=[...P.path],B=M[0],T=kn(B,M[2]),N=kn(B,M[3]),D=T<N?2:3;(T<kn(B,M[1])||N<kn(B,M[1]))&&M.splice(1,D-1);let L=M[M.length-1],H=kn(L,M[M.length-3]),V=kn(L,M[M.length-4]),O=H<V?M.length-3:M.length-4;return(H<kn(L,M[M.length-2])||V<kn(L,M[M.length-2]))&&M.splice(O+1,M.length-O-2),{index:P.index,path:M,startsAt:M[0]===n?"C":"D",goesTo:M[M.length-1]===n?"C":"D"}})(),C=c>0?((I,v)=>{if(I.length<2)return I;let P=[I[0]];for(let M=0;M<I.length-1;M++){let B={start:I[M],end:I[M+1]},T={x:(B.start.x+B.end.x)/2,y:(B.start.y+B.end.y)/2},N=kn(T,e),D=kn(T,t);if((N<=s||D<=s)&&Math.abs(N-D)>0.0001){let L=m(B,e),H=m(B,t),V=kn(L,e),O=kn(H,t)<s,U=V<s?A(B,e,s):null,j=O?A(B,t,s):null,Y=[];if(kn(B.start,B.end)>s/2&&v>0)for(let X=1;X<=v;X++){let K=X/(v+1),J={x:B.start.x+K*(B.end.x-B.start.x),y:B.start.y+K*(B.end.y-B.start.y),t:K,isSpecial:!1},ee=kn(J,e),se=kn(J,t);ee<s||se<s||(U&&Math.abs(J.t-U.t)<0.1||j&&Math.abs(J.t-j.t)<0.1||Y.push(J))}if(U&&Y.push(U),j&&Y.push(j),Y.sort((X,K)=>X.t-K.t),Y.length>1){let X=[Y[0]];for(let K=1;K<Y.length;K++){let J=X[X.length-1],ee=Y[K];kn(J,ee)>s/10&&X.push(ee)}Y=X}Y.forEach((X)=>P.push(X))}P.push(I[M+1])}if(P.length>1){let M=[P[0]];for(let B=1;B<P.length;B++){let T=M[M.length-1],N=P[B];kn(T,N)>s/10&&M.push(N)}return M}return P})(x.path,c):x.path,b=(()=>{if(x.path.length===0)return null;let I=(()=>{let T=l(g.A_Right,g.B_Right),N=l(g.B_Left,g.A_Left);return[{startsAt:"E",goesTo:"B",points:[r,t]},{startsAt:"E",goesTo:"A",points:[r,e]},{startsAt:"F",goesTo:"B",points:[i,t]},{startsAt:"F",goesTo:"A",points:[i,e]},{startsAt:"E",goesTo:"B",points:[r,T,t]},{startsAt:"E",goesTo:"A",points:[r,T,e]},{startsAt:"F",goesTo:"B",points:[i,T,t]},{startsAt:"F",goesTo:"A",points:[i,T,e]},{startsAt:"E",goesTo:"B",points:[r,N,t]},{startsAt:"E",goesTo:"A",points:[r,N,e]},{startsAt:"F",goesTo:"B",points:[i,N,t]},{startsAt:"F",goesTo:"A",points:[i,N,e]},{startsAt:"E",goesTo:"B",points:[r,f.A_Right,T,t]},{startsAt:"F",goesTo:"B",points:[i,f.B_Right,T,t]},{startsAt:"E",goesTo:"A",points:[r,f.B_Left,N,e]},{startsAt:"F",goesTo:"A",points:[i,f.A_Left,N,e]},{startsAt:"E",goesTo:"B",points:[r,f.A_Left,N,t]},{startsAt:"E",goesTo:"A",points:[r,f.B_Right,T,e]},{startsAt:"E",goesTo:"B",points:[r,f.A_Opp,f.A_Right,T,t]},{startsAt:"E",goesTo:"A",points:[r,f.B_Opp,f.B_Left,N,e]},{startsAt:"F",goesTo:"B",points:[i,f.A_Opp,f.A_Left,N,t]},{startsAt:"F",goesTo:"A",points:[i,f.B_Opp,f.B_Right,T,e]},{startsAt:"F",goesTo:"A",points:[i,f.B_Opp,f.B_Left,N,e]},{startsAt:"E",goesTo:"B",points:[r,f.A_Opp,f.A_Left,N,t]},{startsAt:"E",goesTo:"A",points:[r,f.B_Opp,f.B_Right,T,e]},{startsAt:"E",goesTo:"B",points:[r,f.A_Left,f.A_Opp,f.A_Right,T,t]},{startsAt:"E",goesTo:"A",points:[r,f.B_Right,f.B_Opp,f.B_Left,N,e]},{startsAt:"F",goesTo:"B",points:[i,f.A_Right,f.A_Opp,f.A_Left,N,t]},{startsAt:"F",goesTo:"A",points:[i,f.B_Left,f.B_Opp,f.B_Right,T,e]},{startsAt:"F",goesTo:"A",points:[i,f.B_Right,f.B_Opp,f.B_Left,N,e]},{startsAt:"E",goesTo:"B",points:[r,f.A_Right,f.A_Opp,f.A_Left,N,t]},{startsAt:"E",goesTo:"A",points:[r,f.B_Left,f.B_Opp,f.B_Right,T,e]}].map((D,L)=>({...D,index:L}))})(),v=I.filter((T)=>T.startsAt==="E"),P=I.filter((T)=>T.startsAt==="F"),M=[],B=[];for(let T of v)if(!_(T.points,x.path)){M.push(T);break}for(let T of P)if(!_(T.points,x.path)){B.push(T);break}return M.length===0||B.length===0?null:{line1:M[0],line2:B[0]}})();if(b){let I=b.line1.goesTo==="A"?t:e,v=b.line2.goesTo==="A"?t:e,P=y(b.line1,I,s,a),M=y(b.line2,v,s,a);b={line1:{...b.line1,points:P},line2:{...b.line2,points:M}}}return{jPair:b,optimalPath:{startsAt:x.startsAt,goesTo:x.goesTo,points:C}}}var Emr=class extends ei{getSolverName(){return"TwoCrossingRoutesHighDensitySolver"}nodeWithPortPoints;routes;viaDiameter;traceThickness;obstacleMargin;layerCount=2;debugViaPositions;escapeLayer=1;solvedRoutes=[];bounds;constructor(e){if(super(),this.nodeWithPortPoints=e.nodeWithPortPoints,this.viaDiameter=e?.viaDiameter??0.3,this.traceThickness=e?.traceThickness??0.15,this.obstacleMargin=e?.obstacleMargin??0.1,this.layerCount=e?.layerCount??2,this.debugViaPositions=[],this.routes=this.extractRoutesFromNode(),this.bounds=this.calculateBounds(),this.routes.length!==2)return this.failed=!0,void(this.error=`Expected 2 routes, but got ${this.routes.length}`);let[t,n]=this.routes;if(t.startPort.z!==t.endPort.z)return this.failed=!0,void(this.error="Route A must start and end on the same layer");if(n.startPort.z!==n.endPort.z)return this.failed=!0,void(this.error="Route B must start and end on the same layer");if(t.startPort.z!==n.startPort.z)return this.failed=!0,void(this.error="Both routes must be on the same layer");t.startPort.z===0?this.escapeLayer=1:this.escapeLayer=0}extractRoutesFromNode(){let e=[],t=this.nodeWithPortPoints.portPoints,n=new Map;for(let o of t){let{connectionName:r}=o;n.has(r)||n.set(r,[]),n.get(r)?.push(o)}for(let[o,r]of n.entries())r.length===2&&e.push({startPort:{...r[0],z:r[0].z??0},endPort:{...r[1],z:r[1].z??0},connectionName:o});return e}calculateBounds(){return{minX:this.nodeWithPortPoints.center.x-this.nodeWithPortPoints.width/2,maxX:this.nodeWithPortPoints.center.x+this.nodeWithPortPoints.width/2,minY:this.nodeWithPortPoints.center.y-this.nodeWithPortPoints.height/2,maxY:this.nodeWithPortPoints.center.y+this.nodeWithPortPoints.height/2}}doRoutesCross(e,t){return Ru(e.startPort,e.endPort,t.startPort,t.endPort)}calculateViaPositions(e,t){let n=this.bounds.maxX-this.bounds.minX,o=this.bounds.maxY-this.bounds.minY,r=this.bounds.minX,i=this.bounds.minY,s={width:n-2*this.obstacleMargin-this.viaDiameter,height:o-2*this.obstacleMargin-this.viaDiameter,x:r+this.obstacleMargin+this.viaDiameter/2,y:i+this.obstacleMargin+this.viaDiameter/2},a=this.viaDiameter+this.obstacleMargin,{startPort:c,endPort:l}=t,h=[{x:s.x,y:s.y},{x:s.x+s.width,y:s.y},{x:s.x+s.width,y:s.y+s.height},{x:s.x,y:s.y+s.height}],d=(y,x)=>kn(y,x),u=[];h.forEach((y,x)=>{d(y,c)>=a&&d(y,l)>=a&&u.push({...y,type:"corner",index:x})});let _=[{p1:h[0],p2:h[1]},{p1:h[1],p2:h[2]},{p1:h[2],p2:h[3]},{p1:h[3],p2:h[0]}];if([c,l].forEach((y,x)=>{_.forEach((C,b)=>{((I,v)=>{let{x:P,y:M,r:B}=I,T=v.p1.x,N=v.p1.y,D=v.p2.x,L=v.p2.y;if(Math.abs(D-T)<0.001){let se=T,ne=B*B-(se-P)**2;if(ne<0)return[];if(Math.abs(ne)<0.001){let ie=M;return ie>=Math.min(N,L)&&ie<=Math.max(N,L)?[{x:se,y:ie}]:[]}let re=M+Math.sqrt(ne),Z=M-Math.sqrt(ne),te=[];return re>=Math.min(N,L)&&re<=Math.max(N,L)&&te.push({x:se,y:re}),Z>=Math.min(N,L)&&Z<=Math.max(N,L)&&te.push({x:se,y:Z}),te}let H=(L-N)/(D-T),V=N-H*T,O=1+H*H,U=2*(H*V-H*M-P),j=U*U-4*O*(P*P+(V-M)*(V-M)-B*B);if(j<0)return[];if(Math.abs(j)<0.001){let se=-U/(2*O),ne=H*se+V;return se>=Math.min(T,D)&&se<=Math.max(T,D)&&ne>=Math.min(N,L)&&ne<=Math.max(N,L)?[{x:se,y:ne}]:[]}let Y=(-U+Math.sqrt(j))/(2*O),X=(-U-Math.sqrt(j))/(2*O),K=H*Y+V,J=H*X+V,ee=[];return Y>=Math.min(T,D)&&Y<=Math.max(T,D)&&K>=Math.min(N,L)&&K<=Math.max(N,L)&&ee.push({x:Y,y:K}),X>=Math.min(T,D)&&X<=Math.max(T,D)&&J>=Math.min(N,L)&&J<=Math.max(N,L)&&ee.push({x:X,y:J}),ee})({...y,r:a},C).forEach((I)=>{d(I,x===0?l:c)>=a&&u.push({...I,type:"intersection",circle:x,edge:b})})})}),u.length<2){let y=0.8*a;if(h.forEach((x,C)=>{d(x,c)>=y&&d(x,l)>=y&&!u.some((b)=>b.x===x.x&&b.y===x.y)&&u.push({...x,type:"relaxed_corner",index:C})}),u.length<2){let x=[...h].sort((C,b)=>{let I=Math.min(d(C,c),d(C,l));return Math.min(d(b,c),d(b,l))-I});for(let C of x)if(!u.some((b)=>b.x===C.x&&b.y===C.y)&&(u.push({...C,type:"forced_corner"}),u.length>=2))break}}if(u.length<2)return null;let p=0,m=[u[0],u[u.length>1?1:0]];for(let y=0;y<u.length;y++)for(let x=y+1;x<u.length;x++){let C=d(u[y],u[x]);C>p&&(p=C,m=[u[y],u[x]])}let A={x:m[0].x,y:m[0].y},g={x:m[1].x,y:m[1].y},f=kn(A,e.startPort);return kn(g,e.startPort)<f&&([A,g]=[g,A]),{via1:A,via2:g}}trySolveAOverB(e,t,n=!1){let o=n?this.calculateViaPositions(e,t):this.calculateViaPositions(t,e);if(!o)return!1;this.debugViaPositions.push(o);let{via1:r,via2:i}=this.pushViasFromEndpoints(this.moveViasAsCloseAsPossible(o));this.debugViaPositions.push({via1:r,via2:i});let{jPair:s,optimalPath:a}=Pmr({A:r,B:i,C:e.startPort,D:e.endPort,E:t.startPort,F:t.endPort,radius:this.viaDiameter/2+this.obstacleMargin+this.traceThickness/2*1.5,margin:2*this.obstacleMargin+this.traceThickness/2*1.5,subdivisions:1});if(!s)return!1;let c={connectionName:e.connectionName,regionId:this.nodeWithPortPoints.capacityMeshNodeId,route:a.points.map((h)=>({x:h.x,y:h.y,z:e.startPort.z??0})),traceThickness:this.traceThickness,viaDiameter:this.viaDiameter,vias:[]};s.line2.points.reverse();let l={connectionName:t.connectionName,regionId:this.nodeWithPortPoints.capacityMeshNodeId,route:[...s.line1.points.map((h)=>({x:h.x,y:h.y,z:t.startPort.z??0})),{...s.line1.points[s.line1.points.length-1],z:this.escapeLayer},{...s.line2.points[0],z:this.escapeLayer},...s.line2.points.map((h)=>({x:h.x,y:h.y,z:t.startPort.z??0}))],traceThickness:this.traceThickness,viaDiameter:this.viaDiameter,vias:[r,i]};return this.solvedRoutes.push(c,l),!0}pushViasFromEndpoints(e){let t={...e.via1},n={...e.via2},o=[this.routes[0].startPort,this.routes[0].endPort,this.routes[1].startPort,this.routes[1].endPort],r=this.getMinDistanceBetweenViaCenters(),i=this.viaDiameter/2+2*this.traceThickness+2*this.obstacleMargin;for(let a=0;a<10;a++){let c=!1,l=!1,h=0.9**a;for(let u of o){let _=kn(t,u);if(_<i){let m=(i-_)*h,A=t.x-u.x,g=t.y-u.y,f=Math.sqrt(A*A+g*g);f>0.000001&&(t.x+=A/f*m,t.y+=g/f*m,c=!0)}let p=kn(n,u);if(p<i){let m=(i-p)*h,A=n.x-u.x,g=n.y-u.y,f=Math.sqrt(A*A+g*g);f>0.000001&&(n.x+=A/f*m,n.y+=g/f*m,l=!0)}}let d=kn(t,n);if(d<r){let u=(r-d)/2,_=n.x-t.x,p=n.y-t.y,m=Math.sqrt(_*_+p*p);m>0.000001?(t.x-=_/m*u,t.y-=p/m*u,n.x+=_/m*u,n.y+=p/m*u,c=!0,l=!0):(t.x-=u,n.x+=u,c=!0,l=!0)}if(!c&&!l)break}let s=kn(t,n);if(s<r){let a=(r-s)/2,c=n.x-t.x,l=n.y-t.y,h=Math.sqrt(c*c+l*l);h>0.000001?(t.x-=c/h*a,t.y-=l/h*a,n.x+=c/h*a,n.y+=l/h*a):(t.x-=a,n.x+=a)}return{via1:t,via2:n}}getMinDistanceBetweenViaCenters(){return this.viaDiameter+this.traceThickness+2*this.obstacleMargin}moveViasAsCloseAsPossible(e){let{via1:t,via2:n}=e,o=this.getMinDistanceBetweenViaCenters(),r=kn(t,n);if(r<=o)return e;let i=n.x-t.x,s=n.y-t.y,a=Math.sqrt(i*i+s*s),c=i/a,l=s/a,h=(t.x,n.x,t.y,n.y,(r-o)/2);return{via1:{x:t.x+c*h,y:t.y+l*h},via2:{x:n.x-c*h,y:n.y-l*h}}}handleRoutesDontCross(){let[e,t]=this.routes,n={connectionName:e.connectionName,regionId:this.nodeWithPortPoints.capacityMeshNodeId,route:[{x:e.startPort.x,y:e.startPort.y,z:e.startPort.z??0},{x:e.endPort.x,y:e.endPort.y,z:e.endPort.z??0}],traceThickness:this.traceThickness,viaDiameter:this.viaDiameter,vias:[]},o={connectionName:t.connectionName,regionId:this.nodeWithPortPoints.capacityMeshNodeId,route:[{x:t.startPort.x,y:t.startPort.y,z:t.startPort.z??0},{x:t.endPort.x,y:t.endPort.y,z:t.endPort.z??0}],traceThickness:this.traceThickness,viaDiameter:this.viaDiameter,vias:[]};this.solvedRoutes.push(n,o),this.solved=!0}_step(){if(this.routes.length!==2)return void(this.failed=!0);let[e,t]=this.routes;this.doRoutesCross(e,t)?this.trySolveAOverB(e,t)||this.trySolveAOverB(t,e)||this.trySolveAOverB(e,t,!0)||this.trySolveAOverB(t,e,!0)?this.solved=!0:(this.failed=!0,this.error="All crossover strategies failed"):this.handleRoutesDontCross()}visualize(){let e={lines:[],points:[],rects:[],circles:[]};e.rects.push({center:{x:(this.bounds.minX+this.bounds.maxX)/2,y:(this.bounds.minY+this.bounds.maxY)/2},width:this.bounds.maxX-this.bounds.minX,height:this.bounds.maxY-this.bounds.minY,stroke:"rgba(0, 0, 0, 0.5)",fill:"rgba(240, 240, 240, 0.1)"});for(let[t,n]of[["Route A",this.routes[0]],["Route B",this.routes[1]]])e.points.push({x:n.startPort.x,y:n.startPort.y,label:`${t}
${n.connectionName} start`,color:"orange"}),e.points.push({x:n.endPort.x,y:n.endPort.y,label:`${t}
${n.connectionName} end`,color:"orange"}),e.lines.push({points:[n.startPort,n.endPort],strokeColor:"rgba(255, 0, 0, 0.5)",label:`${t}
${n.connectionName} direct`});for(let t=0;t<this.debugViaPositions.length;t++){let{via1:n,via2:o}=this.debugViaPositions[t],r=["rgba(255, 165, 0, 0.3)","rgba(128, 0, 128, 0.3)"],i=r[t%r.length];e.circles.push({center:n,radius:this.viaDiameter/2,fill:i,stroke:"rgba(0, 0, 0, 0.3)",label:`Computed Via A (attempt ${t+1})`}),e.circles.push({center:o,radius:this.viaDiameter/2,fill:i,stroke:"rgba(0, 0, 0, 0.3)",label:`Computed Via B (attempt ${t+1})`});let s=this.viaDiameter/2+this.obstacleMargin;e.circles.push({center:n,radius:s,stroke:i,fill:"rgba(0, 0, 0, 0)",label:`Debug Via 1 Safety Margin (attempt ${t+1})`}),e.circles.push({center:o,radius:s,stroke:i,fill:"rgba(0, 0, 0, 0)",label:`Debug Via 2 Safety Margin (attempt ${t+1})`}),e.lines.push({points:[this.routes[t%2].startPort,n,o,this.routes[t%2].endPort],strokeColor:`${i.substring(0,i.lastIndexOf(","))}, 0.3)`,strokeDash:[5,5],label:`Potential Route (attempt ${t+1})`})}for(let t=0;t<this.solvedRoutes.length;t++){let n=this.solvedRoutes[t],o=t%2==0?"rgba(0, 255, 0, 0.75)":"rgba(255, 0, 255, 0.75)";for(let r=0;r<n.route.length-1;r++){let i=n.route[r],s=n.route[r+1];e.lines.push({points:[i,s],strokeColor:o,strokeDash:i.z===1?[0.2,0.2]:void 0,strokeWidth:n.traceThickness,label:`${n.connectionName} z=${i.z}`}),i._label&&e.points.push({x:i.x,y:i.y,label:i._label})}for(let r of n.vias)e.circles.push({center:r,radius:this.viaDiameter/2,fill:"rgba(0, 0, 255, 0.8)",stroke:"black",label:"Solved Via"}),e.circles.push({center:r,radius:this.viaDiameter/2+this.obstacleMargin,fill:"rgba(0, 0, 255, 0.3)",stroke:"black",label:"Solved Via Margin"})}return e}getSolvedRoutes(){return this.solvedRoutes}},ybe=class extends ei{getSolverName(){return"HyperParameterSupervisorSolver"}GREEDY_MULTIPLIER=1.2;MIN_SUBSTEPS=1;supervisedSolvers;winningSolver;getHyperParameterDefs(){throw Error("Not implemented")}getCombinationDefs(){return null}getHyperParameterCombinations(e){e||(e=this.getHyperParameterDefs());let t=[];if(e.length===0)return[{}];let[n,...o]=e,r=this.getHyperParameterCombinations(o);return n.possibleValues.forEach((i)=>{r.forEach((s)=>{t.push({...s,...i})})}),t}initializeSolvers(){let e=this.getHyperParameterDefs(),t=this.getCombinationDefs()??[e.map((n)=>n.name)];this.supervisedSolvers=[];for(let n of t){let o=this.getHyperParameterCombinations(e.filter((r)=>n.includes(r.name)));for(let r of o){let i=this.generateSolver(r),s=this.computeG(i);this.supervisedSolvers.push({hyperParameters:r,solver:i,h:0,g:s,f:s})}}}generateSolver(e){throw Error("Not implemented")}computeG(e){return e.iterations/e.MAX_ITERATIONS}computeH(e){return 1-(e.progress||0)}computeF(e,t){return e+t*this.GREEDY_MULTIPLIER}getSupervisedSolverWithBestFitness(){let e=1/0,t=null;for(let n of this.supervisedSolvers??[]){if(n.solver.solved)return n;if(n.solver.failed)continue;let o=n.f;o<e&&(e=o,t=n)}return t}getFailureMessage(){return`All solvers failed in hyper solver. Example failures: ${this.supervisedSolvers?.sort((e,t)=>t.f-e.f)?.slice(0,5).map((e)=>e.solver.error).join(", ")}`}_step(){this.supervisedSolvers||this.initializeSolvers();let e=this.getSupervisedSolverWithBestFitness();if(!e)return this.failed=!0,void(this.error=this.getFailureMessage());for(let t=0;t<this.MIN_SUBSTEPS;t++)e.solver.step();this.activeSubSolver=e.solver,e.g=this.computeG(e.solver),e.h=this.computeH(e.solver),e.f=this.computeF(e.g,e.h),e.solver.solved&&(this.solved=!0,this.winningSolver=e.solver,this.onSolve?.(e))}onSolve(e){}visualize(){let e=this.getSupervisedSolverWithBestFitness(),t={lines:[],circles:[],points:[],rects:[]};return e&&(t=e.solver.visualize()),t}};function LV(e,t,n){let o=t.z!==n.z&&e.allowBlindAndBuriedVias!==!0;return{minZ:o?0:Math.min(t.z,n.z),maxZ:o?e.layerCount-1:Math.max(t.z,n.z)}}var Mmr=class{values=[];positions;constructor(e){if(e===void 0)this.positions=new Map;else{if(!Number.isSafeInteger(e)||e<=0)throw Error("repair04: dense path queue requires a positive grid size");let t=new Int32Array(e);this.positions={get:(n)=>t[n]===0?void 0:t[n]-1,set:(n,o)=>{t[n]=o+1},delete:(n)=>{t[n]=0}}}}get length(){return this.values.length}push(e){let t=this.positions.get(e.id);if(t===void 0)t=this.values.length,this.values.push(e);else if(e.priority>this.values[t].priority)throw Error("repair04: queued path priorities may only decrease");for(;t>0;){let n=Math.floor((t-1)/2),o=this.values[n];if(o.priority<=e.priority)break;this.values[t]=o,this.positions.set(o.id,t),t=n}this.values[t]=e,this.positions.set(e.id,t)}pop(){let e=this.values[0];if(!e)throw Error("repair04: cannot pop an empty path queue");let t=this.values.pop();if(this.positions.delete(e.id),this.values.length){let n=0;for(;2*n+1<this.values.length;){let o=2*n+1;o+1<this.values.length&&this.values[o+1].priority<this.values[o].priority&&o++;let r=this.values[o];if(r.priority>=t.priority)break;this.values[n]=r,this.positions.set(r.id,n),n=o}this.values[n]=t,this.positions.set(t.id,n)}return e}},iqe=(e,t)=>{let n=[];for(let o=0;o<e.route.length;o+=1){let r=e.route[o];if(r.route_type!=="via"){n.push(structuredClone(r));continue}let i=n[n.length-1],s=e.route[o+1],a=i?.route_type==="wire"?i.width:s?.route_type==="wire"?s.width:t,c=s?.route_type==="wire"?s.width:a;i?.route_type==="wire"&&i.x===r.x&&i.y===r.y&&i.layer===r.from_layer||n.push({route_type:"wire",x:r.x,y:r.y,layer:r.from_layer,width:a}),n.push(structuredClone(r)),s?.route_type==="wire"&&s.x===r.x&&s.y===r.y&&s.layer===r.to_layer||n.push({route_type:"wire",x:r.x,y:r.y,layer:r.to_layer,width:c})}return{...structuredClone(e),route:n}};function sqe(e,t,n){return Math.max(n?0:t,e.defaultObstacleMargin??0,e.minViaEdgeToPadEdgeClearance??0)}var Ar=0.00000001,qy=(e,t,n=0)=>e.x>=t.minX+n-Ar&&e.x<=t.maxX-n+Ar&&e.y>=t.minY+n-Ar&&e.y<=t.maxY-n+Ar,hB=(e,t,n)=>{let o=0,r=1;for(let[i,s,a,c]of[[e.x,t.x-e.x,n.minX,n.maxX],[e.y,t.y-e.y,n.minY,n.maxY]]){if(i===void 0||s===void 0||a===void 0||c===void 0)throw Error("Invalid segment clipping axis");if(Math.abs(s)<=Ar){if(i<a-Ar||i>c+Ar)return;continue}let l=(a-i)/s,h=(c-i)/s;if(o=Math.max(o,Math.min(l,h)),r=Math.min(r,Math.max(l,h)),r<o-Ar)return}return[Math.max(0,o),Math.min(1,r)]},L$=(e,t,n)=>{if(n<=Ar)return structuredClone(e);if(n>=0.99999999)return structuredClone(t);let o={...structuredClone(e),x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n};return delete o.pcb_port_id,o},Jb=(e,t)=>Math.abs(e.x-t.x)<=Ar&&Math.abs(e.y-t.y)<=Ar&&e.z===t.z,Ml=(e)=>Array.isArray(e)?`[${e.map(Ml).join(",")}]`:e!==null&&typeof e=="object"?`{${Object.keys(e).filter((t)=>e[t]!==void 0).sort().map((t)=>`${JSON.stringify(t)}:${Ml(e[t])}`).join(",")}}`:JSON.stringify(e)??"undefined",Xje=(e,t,n)=>{if(e.route.length===1)return structuredClone(e.route);let o=(i)=>{let s=Math.min(Math.floor(i),e.route.length-2);return L$(e.route[s],e.route[s+1],i-s)},r=[o(t)];for(let i=Math.floor(t)+1;i<n-Ar;i+=1)r.push(structuredClone(e.route[i]));return n>t+Ar&&r.push(o(n)),r},GUt=(e,t,n)=>{let o=Xje(e,t,n),r=Object.fromEntries(Object.entries(e).filter(([s])=>s!=="route"&&s!=="vias")),i=e.vias.filter((s)=>o.some((a)=>Math.hypot(a.x-s.x,a.y-s.y)<=Ar));return Ml({metadata:r,points:o,vias:i})},aCe={};ube(aCe,{all_layers:()=>zWt,any_circuit_element:()=>_Kt,any_soup_element:()=>gCe,any_source_component:()=>TWt,asset:()=>aWt,base_circuit_json_error:()=>yh,battery_capacity:()=>sWt,brep_shape:()=>bXt,cadModelDefaultDirectionMap:()=>pgr,cad_component:()=>tKt,cad_model_axis_directions:()=>eKt,cad_model_formats:()=>ugr,capacitance:()=>lqe,circuit_json_footprint_load_error:()=>wjt,current:()=>sq,distance:()=>qn,duration_ms:()=>Nle,experiment_type:()=>cKt,external_footprint_load_error:()=>Mjt,frequency:()=>nY,getZodPrefixedIdWithDefault:()=>yo,inductance:()=>rWt,kicadAt:()=>Cbe,kicadEffects:()=>cWt,kicadFont:()=>dqe,kicadFootprintAttributes:()=>hWt,kicadFootprintMetadata:()=>pWt,kicadFootprintModel:()=>uWt,kicadFootprintPad:()=>dWt,kicadFootprintProperties:()=>lWt,kicadProperty:()=>Jae,kicadSymbolEffects:()=>gWt,kicadSymbolMetadata:()=>fWt,kicadSymbolPinNames:()=>_Wt,kicadSymbolPinNumbers:()=>mWt,kicadSymbolProperties:()=>AWt,kicadSymbolProperty:()=>CQ,layer_ref:()=>Tc,layer_string:()=>Jje,length:()=>dr,manufacturing_drc_properties:()=>SXt,ms:()=>zV,ninePointAnchor:()=>vB,pcbRenderLayer:()=>F_r,pcb_autorouting_error:()=>Tjt,pcb_board:()=>qXt,pcb_breakout_point:()=>Qjt,pcb_component:()=>PXt,pcb_component_invalid_layer_error:()=>Ujt,pcb_component_not_on_board_edge_error:()=>Gjt,pcb_component_outside_board_error:()=>Yjt,pcb_connector_not_in_accessible_orientation_warning:()=>Njt,pcb_copper_pour:()=>Vjt,pcb_copper_pour_brep:()=>zjt,pcb_copper_pour_polygon:()=>Ojt,pcb_copper_pour_rect:()=>Fjt,pcb_copper_text:()=>ijt,pcb_courtyard_circle:()=>Zjt,pcb_courtyard_outline:()=>qjt,pcb_courtyard_overlap_error:()=>xjt,pcb_courtyard_polygon:()=>Jjt,pcb_courtyard_rect:()=>$jt,pcb_cutout:()=>Pjt,pcb_cutout_circle:()=>Ijt,pcb_cutout_path:()=>Sjt,pcb_cutout_polygon:()=>vjt,pcb_cutout_rect:()=>bjt,pcb_fabrication_note_dimension:()=>pjt,pcb_fabrication_note_path:()=>djt,pcb_fabrication_note_rect:()=>ujt,pcb_fabrication_note_text:()=>hjt,pcb_footprint_overlap_error:()=>yjt,pcb_ground_plane:()=>kjt,pcb_ground_plane_region:()=>Ljt,pcb_group:()=>Bjt,pcb_hole:()=>NXt,pcb_hole_circle_or_square_shape:()=>W_r,pcb_hole_circle_shape:()=>G_r,pcb_hole_oval_shape:()=>X_r,pcb_hole_pill_shape:()=>j_r,pcb_hole_rect_shape:()=>U_r,pcb_hole_rotated_pill_shape:()=>K_r,pcb_keepout:()=>Cjt,pcb_manual_edit_conflict_warning:()=>Djt,pcb_missing_footprint_error:()=>Ejt,pcb_net:()=>KXt,pcb_note_dimension:()=>fjt,pcb_note_line:()=>Ajt,pcb_note_path:()=>gjt,pcb_note_rect:()=>_jt,pcb_note_text:()=>mjt,pcb_pad_pad_clearance_error:()=>jjt,pcb_pad_trace_clearance_error:()=>Kjt,pcb_panel:()=>JXt,pcb_panelization_placement_error:()=>ejt,pcb_placement_error:()=>ZXt,pcb_plated_hole:()=>RXt,pcb_port:()=>QXt,pcb_port_not_connected_error:()=>jXt,pcb_port_not_matched_error:()=>XXt,pcb_route_hint:()=>IXt,pcb_route_hints:()=>Y_r,pcb_silkscreen_circle:()=>ajt,pcb_silkscreen_line:()=>njt,pcb_silkscreen_oval:()=>cjt,pcb_silkscreen_path:()=>ojt,pcb_silkscreen_pill:()=>ljt,pcb_silkscreen_rect:()=>sjt,pcb_silkscreen_text:()=>rjt,pcb_smtpad:()=>LXt,pcb_smtpad_pill:()=>kXt,pcb_solder_paste:()=>HXt,pcb_text:()=>FXt,pcb_thermal_spoke:()=>Hjt,pcb_trace:()=>YXt,pcb_trace_error:()=>UXt,pcb_trace_hint:()=>tjt,pcb_trace_missing_error:()=>WXt,pcb_trace_route_point:()=>VXt,pcb_trace_route_point_via:()=>OXt,pcb_trace_route_point_wire:()=>zXt,pcb_trace_warning:()=>GXt,pcb_via:()=>$Xt,pcb_via_clearance_error:()=>Wjt,pcb_via_trace_clearance_error:()=>Xjt,point:()=>Jr,point3:()=>rB,point_with_bulge:()=>CXt,port_arrangement:()=>JWt,position:()=>L_r,position3:()=>H_r,resistance:()=>xbe,ring:()=>Zje,rotation:()=>Ym,route_hint_point:()=>vXt,schematic_arc:()=>rXt,schematic_box:()=>XWt,schematic_circle:()=>oXt,schematic_component:()=>ZWt,schematic_component_port_arrangement_by_sides:()=>qWt,schematic_component_port_arrangement_by_size:()=>$Wt,schematic_debug_line:()=>uXt,schematic_debug_object:()=>mXt,schematic_debug_object_base:()=>Ibe,schematic_debug_point:()=>pXt,schematic_debug_rect:()=>dXt,schematic_error:()=>lXt,schematic_group:()=>AXt,schematic_layout_error:()=>hXt,schematic_line:()=>tXt,schematic_manual_edit_conflict_warning:()=>gXt,schematic_net_label:()=>cXt,schematic_path:()=>jWt,schematic_pin_styles:()=>KWt,schematic_port:()=>aXt,schematic_rect:()=>nXt,schematic_sheet:()=>xXt,schematic_symbol:()=>eXt,schematic_table:()=>fXt,schematic_table_cell:()=>yXt,schematic_text:()=>sXt,schematic_trace:()=>iXt,schematic_voltage_probe:()=>_Xt,simulation_ac_current_source:()=>sKt,simulation_ac_voltage_source:()=>oKt,simulation_current_source:()=>aKt,simulation_dc_current_source:()=>iKt,simulation_dc_voltage_source:()=>nKt,simulation_experiment:()=>lKt,simulation_op_amp:()=>mKt,simulation_switch:()=>dKt,simulation_transient_voltage_graph:()=>hKt,simulation_unknown_experiment_error:()=>pKt,simulation_voltage_probe:()=>uKt,simulation_voltage_source:()=>rKt,size:()=>hqe,source_ambiguous_port_reference:()=>HWt,source_board:()=>LWt,source_component_base:()=>ou,source_component_internal_connection:()=>NWt,source_component_pins_underspecified_warning:()=>GWt,source_failed_to_create_component_error:()=>PWt,source_group:()=>QWt,source_i2c_misconfigured_error:()=>Qqe,source_interconnect:()=>wWt,source_invalid_component_property_error:()=>Tqe,source_manually_placed_via:()=>OWt,source_missing_manufacturer_part_number_warning:()=>Rqe,source_missing_property_error:()=>SWt,source_net:()=>kWt,source_no_ground_pin_defined_warning:()=>YWt,source_no_power_pin_defined_warning:()=>VWt,source_pcb_ground_plane:()=>FWt,source_pin_attributes:()=>bWt,source_pin_missing_trace_warning:()=>Nqe,source_pin_must_be_connected_error:()=>UWt,source_port:()=>DWt,source_project_metadata:()=>Bqe,source_property_ignored_warning:()=>EWt,source_simple_battery:()=>fqe,source_simple_capacitor:()=>pqe,source_simple_chip:()=>gqe,source_simple_connector:()=>vWt,source_simple_crystal:()=>IWt,source_simple_current_source:()=>CWt,source_simple_diode:()=>bbe,source_simple_fiducial:()=>yWt,source_simple_ground:()=>xWt,source_simple_inductor:()=>yqe,source_simple_led:()=>_qe,source_simple_mosfet:()=>Eqe,source_simple_op_amp:()=>Mqe,source_simple_pin_header:()=>bqe,source_simple_pinout:()=>Iqe,source_simple_potentiometer:()=>Cqe,source_simple_power_source:()=>Aqe,source_simple_push_button:()=>xqe,source_simple_resistor:()=>mqe,source_simple_resonator:()=>vqe,source_simple_switch:()=>wqe,source_simple_test_point:()=>Pqe,source_simple_transistor:()=>Sqe,source_simple_voltage_probe:()=>MWt,source_simple_voltage_source:()=>BWt,source_trace:()=>RWt,source_trace_not_connected_error:()=>Dqe,supplier_footprint_mismatch_warning:()=>Rjt,supplier_name:()=>uqe,time:()=>k_r,timestamp:()=>iWt,unknown_error_finding_part:()=>WWt,visible_layer:()=>d2,voltage:()=>gB,wave_shape:()=>Lqe});var wl,A5,YWe,E={};ube(E,{BRAND:()=>Jmr,DIRTY:()=>hCe,EMPTY_PATH:()=>Tmr,INVALID:()=>fs,NEVER:()=>Q_r,OK:()=>ix,ParseStatus:()=>M5,Schema:()=>hc,ZodAny:()=>rq,ZodArray:()=>FV,ZodBigInt:()=>Uce,ZodBoolean:()=>Wce,ZodBranded:()=>aqe,ZodCatch:()=>nle,ZodDate:()=>Xce,ZodDefault:()=>tle,ZodDiscriminatedUnion:()=>KUt,ZodEffects:()=>tv,ZodEnum:()=>Dle,ZodError:()=>ov,ZodFirstPartyTypeKind:()=>ws,ZodFunction:()=>qUt,ZodIntersection:()=>qce,ZodIssueCode:()=>Go,ZodLazy:()=>Jce,ZodLiteral:()=>Zce,ZodMap:()=>pCe,ZodNaN:()=>_Ce,ZodNativeEnum:()=>ele,ZodNever:()=>dB,ZodNull:()=>Kce,ZodNullable:()=>KQ,ZodNumber:()=>Gce,ZodObject:()=>Zb,ZodOptional:()=>GS,ZodParsedType:()=>jr,ZodPipeline:()=>cqe,ZodPromise:()=>iq,ZodReadonly:()=>ole,ZodRecord:()=>$Ut,ZodSchema:()=>hc,ZodSet:()=>mCe,ZodString:()=>oq,ZodSymbol:()=>dCe,ZodTransformer:()=>tv,ZodTuple:()=>jQ,ZodType:()=>hc,ZodUndefined:()=>jce,ZodUnion:()=>$ce,ZodUnknown:()=>SV,ZodVoid:()=>uCe,addIssueToContext:()=>wr,any:()=>a_r,array:()=>d_r,bigint:()=>n_r,boolean:()=>nWt,coerce:()=>R_r,custom:()=>ZUt,date:()=>o_r,datetimeRegex:()=>jUt,defaultErrorMap:()=>nq,discriminatedUnion:()=>__r,effect:()=>gHt,enum:()=>v_r,function:()=>C_r,getErrorMap:()=>cCe,getParsedType:()=>Zw,instanceof:()=>e_r,intersection:()=>g_r,isAborted:()=>jje,isAsync:()=>Yce,isDirty:()=>Kje,isValid:()=>HV,late:()=>Zmr,lazy:()=>b_r,literal:()=>I_r,makeIssue:()=>lCe,map:()=>y_r,nan:()=>t_r,nativeEnum:()=>S_r,never:()=>l_r,null:()=>s_r,nullable:()=>M_r,number:()=>tWt,object:()=>u_r,objectUtil:()=>YWe,oboolean:()=>N_r,onumber:()=>D_r,optional:()=>E_r,ostring:()=>T_r,pipeline:()=>B_r,preprocess:()=>w_r,promise:()=>P_r,quotelessJson:()=>wmr,record:()=>f_r,set:()=>x_r,setErrorMap:()=>Bmr,strictObject:()=>p_r,string:()=>eWt,symbol:()=>r_r,transformer:()=>gHt,tuple:()=>A_r,undefined:()=>i_r,union:()=>m_r,unknown:()=>c_r,util:()=>wl,void:()=>h_r}),(A5=wl||(wl={})).assertEqual=(e)=>{},A5.assertIs=function(e){},A5.assertNever=function(e){throw Error()},A5.arrayToEnum=(e)=>{let t={};for(let n of e)t[n]=n;return t},A5.getValidEnumValues=(e)=>{let t=A5.objectKeys(e).filter((o)=>typeof e[e[o]]!="number"),n={};for(let o of t)n[o]=e[o];return A5.objectValues(n)},A5.objectValues=(e)=>A5.objectKeys(e).map(function(t){return e[t]}),A5.objectKeys=typeof Object.keys=="function"?(e)=>Object.keys(e):(e)=>{let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},A5.find=(e,t)=>{for(let n of e)if(t(n))return n},A5.isInteger=typeof Number.isInteger=="function"?(e)=>Number.isInteger(e):(e)=>typeof e=="number"&&Number.isFinite(e)&&Math.floor(e)===e,A5.joinValues=function(e,t=" | "){return e.map((n)=>typeof n=="string"?`'${n}'`:n).join(t)},A5.jsonStringifyReplacer=(e,t)=>typeof t=="bigint"?t.toString():t,(YWe||(YWe={})).mergeShapes=(e,t)=>({...e,...t});var jr=wl.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Zw=(e)=>{switch(typeof e){case"undefined":return jr.undefined;case"string":return jr.string;case"number":return Number.isNaN(e)?jr.nan:jr.number;case"boolean":return jr.boolean;case"function":return jr.function;case"bigint":return jr.bigint;case"symbol":return jr.symbol;case"object":return Array.isArray(e)?jr.array:e===null?jr.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?jr.promise:typeof Map<"u"&&e instanceof Map?jr.map:typeof Set<"u"&&e instanceof Set?jr.set:typeof Date<"u"&&e instanceof Date?jr.date:jr.object;default:return jr.unknown}},Go=wl.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),wmr=(e)=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ov=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=(o)=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){let n=t||function(i){return i.message},o={_errors:[]},r=(i)=>{for(let s of i.issues)if(s.code==="invalid_union")s.unionErrors.map(r);else if(s.code==="invalid_return_type")r(s.returnTypeError);else if(s.code==="invalid_arguments")r(s.argumentsError);else if(s.path.length===0)o._errors.push(n(s));else{let a=o,c=0;for(;c<s.path.length;){let l=s.path[c];c===s.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(n(s))):a[l]=a[l]||{_errors:[]},a=a[l],c++}}};return r(this),o}static assert(t){if(!(t instanceof e))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,wl.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=(n)=>n.message){let n={},o=[];for(let r of this.issues)if(r.path.length>0){let i=r.path[0];n[i]=n[i]||[],n[i].push(t(r))}else o.push(t(r));return{formErrors:o,fieldErrors:n}}get formErrors(){return this.flatten()}};ov.create=(e)=>new ov(e);var nq=(e,t)=>{let n;switch(e.code){case Go.invalid_type:n=e.received===jr.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case Go.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,wl.jsonStringifyReplacer)}`;break;case Go.unrecognized_keys:n=`Unrecognized key(s) in object: ${wl.joinValues(e.keys,", ")}`;break;case Go.invalid_union:n="Invalid input";break;case Go.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${wl.joinValues(e.options)}`;break;case Go.invalid_enum_value:n=`Invalid enum value. Expected ${wl.joinValues(e.options)}, received '${e.received}'`;break;case Go.invalid_arguments:n="Invalid function arguments";break;case Go.invalid_return_type:n="Invalid function return type";break;case Go.invalid_date:n="Invalid date";break;case Go.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):("startsWith"in e.validation)?n=`Invalid input: must start with "${e.validation.startsWith}"`:("endsWith"in e.validation)?n=`Invalid input: must end with "${e.validation.endsWith}"`:wl.assertNever(e.validation):n=e.validation!=="regex"?`Invalid ${e.validation}`:"Invalid";break;case Go.too_small:n=e.type==="array"?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"||e.type==="bigint"?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case Go.too_big:n=e.type==="array"?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case Go.custom:n="Invalid input";break;case Go.invalid_intersection_types:n="Intersection results could not be merged";break;case Go.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Go.not_finite:n="Number must be finite";break;default:n=t.defaultError,wl.assertNever(e)}return{message:n}},UUt=nq;function Bmr(e){UUt=e}function cCe(){return UUt}var lCe=(e)=>{let{data:t,path:n,errorMaps:o,issueData:r}=e,i=[...n,...r.path||[]],s={...r,path:i};if(r.message!==void 0)return{...r,path:i,message:r.message};let a="",c=o.filter((l)=>!!l).slice().reverse();for(let l of c)a=l(s,{data:t,defaultError:a}).message;return{...r,path:i,message:a}},Tmr=[];function wr(e,t){let n=cCe(),o=lCe({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===nq?void 0:nq].filter((r)=>!!r)});e.common.issues.push(o)}var vi,pHt,M5=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){let o=[];for(let r of n){if(r.status==="aborted")return fs;r.status==="dirty"&&t.dirty(),o.push(r.value)}return{status:t.value,value:o}}static async mergeObjectAsync(t,n){let o=[];for(let r of n){let i=await r.key,s=await r.value;o.push({key:i,value:s})}return e.mergeObjectSync(t,o)}static mergeObjectSync(t,n){let o={};for(let r of n){let{key:i,value:s}=r;if(i.status==="aborted")return fs;if(s.status==="aborted")return fs;i.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),i.value==="__proto__"||s.value===void 0&&!r.alwaysSet||(o[i.value]=s.value)}return{status:t.value,value:o}}},fs=Object.freeze({status:"aborted"}),hCe=(e)=>({status:"dirty",value:e}),ix=(e)=>({status:"valid",value:e}),jje=(e)=>e.status==="aborted",Kje=(e)=>e.status==="dirty",HV=(e)=>e.status==="valid",Yce=(e)=>typeof Promise<"u"&&e instanceof Promise;(pHt=vi||(vi={})).errToObj=(e)=>typeof e=="string"?{message:e}:e||{},pHt.toString=(e)=>typeof e=="string"?e:e?.message;var qS=class{constructor(e,t,n,o){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},mHt=(e,t)=>{if(HV(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new ov(e.common.issues);return this._error=n,this._error}}};function Wa(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:o,description:r}=e;if(t&&(n||o))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(t)return{errorMap:t,description:r};return{errorMap:(i,s)=>{let{message:a}=e;return i.code==="invalid_enum_value"?{message:a??s.defaultError}:s.data===void 0?{message:a??o??s.defaultError}:i.code!=="invalid_type"?{message:s.defaultError}:{message:a??n??s.defaultError}},description:r}}var GWe,hc=class{get description(){return this._def.description}_getType(e){return Zw(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Zw(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new M5,ctx:{common:e.parent.common,data:e.data,parsedType:Zw(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(Yce(t))throw Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Zw(e)},o=this._parseSync({data:e,path:n.path,parent:n});return mHt(n,o)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Zw(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:t});return HV(n)?{value:n.value}:{issues:t.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then((n)=>HV(n)?{value:n.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Zw(e)},o=this._parse({data:e,path:n.path,parent:n}),r=await(Yce(o)?o:Promise.resolve(o));return mHt(n,r)}refine(e,t){let n=(o)=>typeof t=="string"||t===void 0?{message:t}:typeof t=="function"?t(o):t;return this._refinement((o,r)=>{let i=e(o),s=()=>r.addIssue({code:Go.custom,...n(o)});return typeof Promise<"u"&&i instanceof Promise?i.then((a)=>!!a||(s(),!1)):!!i||(s(),!1)})}refinement(e,t){return this._refinement((n,o)=>!!e(n)||(o.addIssue(typeof t=="function"?t(n,o):t),!1))}_refinement(e){return new tv({schema:this,typeName:ws.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(t)=>this["~validate"](t)}}optional(){return GS.create(this,this._def)}nullable(){return KQ.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return FV.create(this)}promise(){return iq.create(this,this._def)}or(e){return $ce.create([this,e],this._def)}and(e){return qce.create(this,e,this._def)}transform(e){return new tv({...Wa(this._def),schema:this,typeName:ws.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e=="function"?e:()=>e;return new tle({...Wa(this._def),innerType:this,defaultValue:t,typeName:ws.ZodDefault})}brand(){return new aqe({typeName:ws.ZodBranded,type:this,...Wa(this._def)})}catch(e){let t=typeof e=="function"?e:()=>e;return new nle({...Wa(this._def),innerType:this,catchValue:t,typeName:ws.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return cqe.create(this,e)}readonly(){return ole.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Dmr=/^c[^\s-]{8,}$/i,Nmr=/^[0-9a-z]+$/,Rmr=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Qmr=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,kmr=/^[a-z0-9_-]{21}$/i,Lmr=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Hmr=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Fmr=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,zmr=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Omr=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Vmr=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Ymr=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Gmr=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Umr=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,WUt="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Wmr=new RegExp(`^${WUt}$`);function XUt(e){let t="[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e.precision?"+":"?"}`}function Xmr(e){return new RegExp(`^${XUt(e)}$`)}function jUt(e){let t=`${WUt}T${XUt(e)}`,n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function jmr(e,t){return!(t!=="v4"&&t||!zmr.test(e))||!(t!=="v6"&&t||!Vmr.test(e))}function Kmr(e,t){if(!Lmr.test(e))return!1;try{let[n]=e.split(".");if(!n)return!1;let o=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),r=JSON.parse(atob(o));return typeof r=="object"&&r!==null&&((!("typ"in r)||r?.typ==="JWT")&&(!!r.alg&&(!t||r.alg===t)))}catch{return!1}}function $mr(e,t){return!(t!=="v4"&&t||!Omr.test(e))||!(t!=="v6"&&t||!Ymr.test(e))}var oq=class e extends hc{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==jr.string){let r=this._getOrReturnCtx(t);return wr(r,{code:Go.invalid_type,expected:jr.string,received:r.parsedType}),fs}let n=new M5,o;for(let r of this._def.checks)if(r.kind==="min")t.data.length<r.value&&(o=this._getOrReturnCtx(t,o),wr(o,{code:Go.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),n.dirty());else if(r.kind==="max")t.data.length>r.value&&(o=this._getOrReturnCtx(t,o),wr(o,{code:Go.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),n.dirty());else if(r.kind==="length"){let i=t.data.length>r.value,s=t.data.length<r.value;(i||s)&&(o=this._getOrReturnCtx(t,o),i?wr(o,{code:Go.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}):s&&wr(o,{code:Go.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}),n.dirty())}else if(r.kind==="email")Fmr.test(t.data)||(o=this._getOrReturnCtx(t,o),wr(o,{validation:"email",code:Go.invalid_string,message:r.message}),n.dirty());else if(r.kind==="emoji")GWe||(GWe=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),GWe.test(t.data)||(o=this._getOrReturnCtx(t,o),wr(o,{validation:"emoji",code:Go.invalid_string,message:r.message}),n.dirty());else if(r.kind==="uuid")Qmr.test(t.data)||(o=this._getOrReturnCtx(t,o),wr(o,{validation:"uuid",code:Go.invalid_string,message:r.message}),n.dirty());else if(r.kind==="nanoid")kmr.test(t.data)||(o=this._getOrReturnCtx(t,o),wr(o,{validation:"nanoid",code:Go.invalid_string,message:r.message}),n.dirty());else if(r.kind==="cuid")Dmr.test(t.data)||(o=this._getOrReturnCtx(t,o),wr(o,{validation:"cuid",code:Go.invalid_string,message:r.message}),n.dirty());else if(r.kind==="cuid2")Nmr.test(t.data)||(o=this._getOrReturnCtx(t,o),wr(o,{validation:"cuid2",code:Go.invalid_string,message:r.message}),n.dirty());else if(r.kind==="ulid")Rmr.test(t.data)||(o=this._getOrReturnCtx(t,o),wr(o,{validation:"ulid",code:Go.invalid_string,message:r.message}),n.dirty());else if(r.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),wr(o,{validation:"url",code:Go.invalid_string,message:r.message}),n.dirty()}else if(r.kind==="regex")r.regex.lastIndex=0,r.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),wr(o,{validation:"regex",code:Go.invalid_string,message:r.message}),n.dirty());else if(r.kind==="trim")t.data=t.data.trim();else if(r.kind==="includes")t.data.includes(r.value,r.position)||(o=this._getOrReturnCtx(t,o),wr(o,{code:Go.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),n.dirty());else if(r.kind==="toLowerCase")t.data=t.data.toLowerCase();else if(r.kind==="toUpperCase")t.data=t.data.toUpperCase();else if(r.kind==="startsWith")t.data.startsWith(r.value)||(o=this._getOrReturnCtx(t,o),wr(o,{code:Go.invalid_string,validation:{startsWith:r.value},message:r.message}),n.dirty());else if(r.kind==="endsWith")t.data.endsWith(r.value)||(o=this._getOrReturnCtx(t,o),wr(o,{code:Go.invalid_string,validation:{endsWith:r.value},message:r.message}),n.dirty());else if(r.kind==="datetime")jUt(r).test(t.data)||(o=this._getOrReturnCtx(t,o),wr(o,{code:Go.invalid_string,validation:"datetime",message:r.message}),n.dirty());else if(r.kind==="date")Wmr.test(t.data)||(o=this._getOrReturnCtx(t,o),wr(o,{code:Go.invalid_string,validation:"date",message:r.message}),n.dirty());else if(r.kind==="time")Xmr(r).test(t.data)||(o=this._getOrReturnCtx(t,o),wr(o,{code:Go.invalid_string,validation:"time",message:r.message}),n.dirty());else r.kind==="duration"?Hmr.test(t.data)||(o=this._getOrReturnCtx(t,o),wr(o,{validation:"duration",code:Go.invalid_string,message:r.message}),n.dirty()):r.kind==="ip"?jmr(t.data,r.version)||(o=this._getOrReturnCtx(t,o),wr(o,{validation:"ip",code:Go.invalid_string,message:r.message}),n.dirty()):r.kind==="jwt"?Kmr(t.data,r.alg)||(o=this._getOrReturnCtx(t,o),wr(o,{validation:"jwt",code:Go.invalid_string,message:r.message}),n.dirty()):r.kind==="cidr"?$mr(t.data,r.version)||(o=this._getOrReturnCtx(t,o),wr(o,{validation:"cidr",code:Go.invalid_string,message:r.message}),n.dirty()):r.kind==="base64"?Gmr.test(t.data)||(o=this._getOrReturnCtx(t,o),wr(o,{validation:"base64",code:Go.invalid_string,message:r.message}),n.dirty()):r.kind==="base64url"?Umr.test(t.data)||(o=this._getOrReturnCtx(t,o),wr(o,{validation:"base64url",code:Go.invalid_string,message:r.message}),n.dirty()):wl.assertNever(r);return{status:n.value,value:t.data}}_regex(t,n,o){return this.refinement((r)=>t.test(r),{validation:n,code:Go.invalid_string,...vi.errToObj(o)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...vi.errToObj(t)})}url(t){return this._addCheck({kind:"url",...vi.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...vi.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...vi.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...vi.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...vi.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...vi.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...vi.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...vi.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...vi.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...vi.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...vi.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...vi.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:t?.precision===void 0?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...vi.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:t?.precision===void 0?null:t?.precision,...vi.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...vi.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...vi.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...vi.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...vi.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...vi.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...vi.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...vi.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...vi.errToObj(n)})}nonempty(t){return this.min(1,vi.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((t)=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find((t)=>t.kind==="date")}get isTime(){return!!this._def.checks.find((t)=>t.kind==="time")}get isDuration(){return!!this._def.checks.find((t)=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find((t)=>t.kind==="email")}get isURL(){return!!this._def.checks.find((t)=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find((t)=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find((t)=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((t)=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((t)=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((t)=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find((t)=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find((t)=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find((t)=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find((t)=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find((t)=>t.kind==="base64url")}get minLength(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};function qmr(e,t){let n=(e.toString().split(".")[1]||"").length,o=(t.toString().split(".")[1]||"").length,r=n>o?n:o;return Number.parseInt(e.toFixed(r).replace(".",""))%Number.parseInt(t.toFixed(r).replace(".",""))/10**r}oq.create=(e)=>new oq({checks:[],typeName:ws.ZodString,coerce:e?.coerce??!1,...Wa(e)});var Gce=class e extends hc{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==jr.number){let r=this._getOrReturnCtx(t);return wr(r,{code:Go.invalid_type,expected:jr.number,received:r.parsedType}),fs}let n,o=new M5;for(let r of this._def.checks)if(r.kind==="int")wl.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),wr(n,{code:Go.invalid_type,expected:"integer",received:"float",message:r.message}),o.dirty());else if(r.kind==="min")(r.inclusive?t.data<r.value:t.data<=r.value)&&(n=this._getOrReturnCtx(t,n),wr(n,{code:Go.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),o.dirty());else if(r.kind==="max")(r.inclusive?t.data>r.value:t.data>=r.value)&&(n=this._getOrReturnCtx(t,n),wr(n,{code:Go.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),o.dirty());else r.kind==="multipleOf"?qmr(t.data,r.value)!==0&&(n=this._getOrReturnCtx(t,n),wr(n,{code:Go.not_multiple_of,multipleOf:r.value,message:r.message}),o.dirty()):r.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),wr(n,{code:Go.not_finite,message:r.message}),o.dirty()):wl.assertNever(r);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,vi.toString(n))}gt(t,n){return this.setLimit("min",t,!1,vi.toString(n))}lte(t,n){return this.setLimit("max",t,!0,vi.toString(n))}lt(t,n){return this.setLimit("max",t,!1,vi.toString(n))}setLimit(t,n,o,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:o,message:vi.toString(r)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:vi.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:vi.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:vi.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:vi.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:vi.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:vi.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:vi.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:vi.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:vi.toString(t)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find((t)=>t.kind==="int"||t.kind==="multipleOf"&&wl.isInteger(t.value))}get isFinite(){let t=null,n=null;for(let o of this._def.checks){if(o.kind==="finite"||o.kind==="int"||o.kind==="multipleOf")return!0;o.kind==="min"?(n===null||o.value>n)&&(n=o.value):o.kind==="max"&&(t===null||o.value<t)&&(t=o.value)}return Number.isFinite(n)&&Number.isFinite(t)}};Gce.create=(e)=>new Gce({checks:[],typeName:ws.ZodNumber,coerce:e?.coerce||!1,...Wa(e)});var Uce=class e extends hc{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==jr.bigint)return this._getInvalidInput(t);let n,o=new M5;for(let r of this._def.checks)if(r.kind==="min")(r.inclusive?t.data<r.value:t.data<=r.value)&&(n=this._getOrReturnCtx(t,n),wr(n,{code:Go.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),o.dirty());else if(r.kind==="max")(r.inclusive?t.data>r.value:t.data>=r.value)&&(n=this._getOrReturnCtx(t,n),wr(n,{code:Go.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),o.dirty());else r.kind==="multipleOf"?t.data%r.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),wr(n,{code:Go.not_multiple_of,multipleOf:r.value,message:r.message}),o.dirty()):wl.assertNever(r);return{status:o.value,value:t.data}}_getInvalidInput(t){let n=this._getOrReturnCtx(t);return wr(n,{code:Go.invalid_type,expected:jr.bigint,received:n.parsedType}),fs}gte(t,n){return this.setLimit("min",t,!0,vi.toString(n))}gt(t,n){return this.setLimit("min",t,!1,vi.toString(n))}lte(t,n){return this.setLimit("max",t,!0,vi.toString(n))}lt(t,n){return this.setLimit("max",t,!1,vi.toString(n))}setLimit(t,n,o,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:o,message:vi.toString(r)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:vi.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:vi.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:vi.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:vi.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:vi.toString(n)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};Uce.create=(e)=>new Uce({checks:[],typeName:ws.ZodBigInt,coerce:e?.coerce??!1,...Wa(e)});var Wce=class extends hc{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==jr.boolean){let t=this._getOrReturnCtx(e);return wr(t,{code:Go.invalid_type,expected:jr.boolean,received:t.parsedType}),fs}return ix(e.data)}};Wce.create=(e)=>new Wce({typeName:ws.ZodBoolean,coerce:e?.coerce||!1,...Wa(e)});var Xce=class e extends hc{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==jr.date){let r=this._getOrReturnCtx(t);return wr(r,{code:Go.invalid_type,expected:jr.date,received:r.parsedType}),fs}if(Number.isNaN(t.data.getTime()))return wr(this._getOrReturnCtx(t),{code:Go.invalid_date}),fs;let n=new M5,o;for(let r of this._def.checks)r.kind==="min"?t.data.getTime()<r.value&&(o=this._getOrReturnCtx(t,o),wr(o,{code:Go.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),n.dirty()):r.kind==="max"?t.data.getTime()>r.value&&(o=this._getOrReturnCtx(t,o),wr(o,{code:Go.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),n.dirty()):wl.assertNever(r);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:vi.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:vi.toString(n)})}get minDate(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}};Xce.create=(e)=>new Xce({checks:[],coerce:e?.coerce||!1,typeName:ws.ZodDate,...Wa(e)});var dCe=class extends hc{_parse(e){if(this._getType(e)!==jr.symbol){let t=this._getOrReturnCtx(e);return wr(t,{code:Go.invalid_type,expected:jr.symbol,received:t.parsedType}),fs}return ix(e.data)}};dCe.create=(e)=>new dCe({typeName:ws.ZodSymbol,...Wa(e)});var jce=class extends hc{_parse(e){if(this._getType(e)!==jr.undefined){let t=this._getOrReturnCtx(e);return wr(t,{code:Go.invalid_type,expected:jr.undefined,received:t.parsedType}),fs}return ix(e.data)}};jce.create=(e)=>new jce({typeName:ws.ZodUndefined,...Wa(e)});var Kce=class extends hc{_parse(e){if(this._getType(e)!==jr.null){let t=this._getOrReturnCtx(e);return wr(t,{code:Go.invalid_type,expected:jr.null,received:t.parsedType}),fs}return ix(e.data)}};Kce.create=(e)=>new Kce({typeName:ws.ZodNull,...Wa(e)});var rq=class extends hc{constructor(){super(...arguments),this._any=!0}_parse(e){return ix(e.data)}};rq.create=(e)=>new rq({typeName:ws.ZodAny,...Wa(e)});var SV=class extends hc{constructor(){super(...arguments),this._unknown=!0}_parse(e){return ix(e.data)}};SV.create=(e)=>new SV({typeName:ws.ZodUnknown,...Wa(e)});var dB=class extends hc{_parse(e){let t=this._getOrReturnCtx(e);return wr(t,{code:Go.invalid_type,expected:jr.never,received:t.parsedType}),fs}};dB.create=(e)=>new dB({typeName:ws.ZodNever,...Wa(e)});var uCe=class extends hc{_parse(e){if(this._getType(e)!==jr.undefined){let t=this._getOrReturnCtx(e);return wr(t,{code:Go.invalid_type,expected:jr.void,received:t.parsedType}),fs}return ix(e.data)}};uCe.create=(e)=>new uCe({typeName:ws.ZodVoid,...Wa(e)});var FV=class e extends hc{_parse(t){let{ctx:n,status:o}=this._processInputParams(t),r=this._def;if(n.parsedType!==jr.array)return wr(n,{code:Go.invalid_type,expected:jr.array,received:n.parsedType}),fs;if(r.exactLength!==null){let s=n.data.length>r.exactLength.value,a=n.data.length<r.exactLength.value;(s||a)&&(wr(n,{code:s?Go.too_big:Go.too_small,minimum:a?r.exactLength.value:void 0,maximum:s?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),o.dirty())}if(r.minLength!==null&&n.data.length<r.minLength.value&&(wr(n,{code:Go.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),o.dirty()),r.maxLength!==null&&n.data.length>r.maxLength.value&&(wr(n,{code:Go.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),o.dirty()),n.common.async)return Promise.all([...n.data].map((s,a)=>r.type._parseAsync(new qS(n,s,n.path,a)))).then((s)=>M5.mergeArray(o,s));let i=[...n.data].map((s,a)=>r.type._parseSync(new qS(n,s,n.path,a)));return M5.mergeArray(o,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:vi.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:vi.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:vi.toString(n)}})}nonempty(t){return this.min(1,t)}};function c$(e){if(e instanceof Zb){let t={};for(let n in e.shape){let o=e.shape[n];t[n]=GS.create(c$(o))}return new Zb({...e._def,shape:()=>t})}return e instanceof FV?new FV({...e._def,type:c$(e.element)}):e instanceof GS?GS.create(c$(e.unwrap())):e instanceof KQ?KQ.create(c$(e.unwrap())):e instanceof jQ?jQ.create(e.items.map((t)=>c$(t))):e}FV.create=(e,t)=>new FV({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ws.ZodArray,...Wa(t)});var Zb=class e extends hc{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),n=wl.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==jr.object){let c=this._getOrReturnCtx(t);return wr(c,{code:Go.invalid_type,expected:jr.object,received:c.parsedType}),fs}let{status:n,ctx:o}=this._processInputParams(t),{shape:r,keys:i}=this._getCached(),s=[];if(!(this._def.catchall instanceof dB&&this._def.unknownKeys==="strip"))for(let c in o.data)i.includes(c)||s.push(c);let a=[];for(let c of i){let l=r[c],h=o.data[c];a.push({key:{status:"valid",value:c},value:l._parse(new qS(o,h,o.path,c)),alwaysSet:c in o.data})}if(this._def.catchall instanceof dB){let c=this._def.unknownKeys;if(c==="passthrough")for(let l of s)a.push({key:{status:"valid",value:l},value:{status:"valid",value:o.data[l]}});else if(c==="strict")s.length>0&&(wr(o,{code:Go.unrecognized_keys,keys:s}),n.dirty());else if(c!=="strip")throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let l of s){let h=o.data[l];a.push({key:{status:"valid",value:l},value:c._parse(new qS(o,h,o.path,l)),alwaysSet:l in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let c=[];for(let l of a){let h=await l.key,d=await l.value;c.push({key:h,value:d,alwaysSet:l.alwaysSet})}return c}).then((c)=>M5.mergeObjectSync(n,c)):M5.mergeObjectSync(n,a)}get shape(){return this._def.shape()}strict(t){return vi.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,o)=>{let r=this._def.errorMap?.(n,o).message??o.defaultError;return n.code==="unrecognized_keys"?{message:vi.errToObj(t).message??r}:{message:r}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:ws.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let o of wl.objectKeys(t))t[o]&&this.shape[o]&&(n[o]=this.shape[o]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let o of wl.objectKeys(this.shape))t[o]||(n[o]=this.shape[o]);return new e({...this._def,shape:()=>n})}deepPartial(){return c$(this)}partial(t){let n={};for(let o of wl.objectKeys(this.shape)){let r=this.shape[o];t&&!t[o]?n[o]=r:n[o]=r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let o of wl.objectKeys(this.shape))if(t&&!t[o])n[o]=this.shape[o];else{let r=this.shape[o];for(;r instanceof GS;)r=r._def.innerType;n[o]=r}return new e({...this._def,shape:()=>n})}keyof(){return JUt(wl.objectKeys(this.shape))}};Zb.create=(e,t)=>new Zb({shape:()=>e,unknownKeys:"strip",catchall:dB.create(),typeName:ws.ZodObject,...Wa(t)}),Zb.strictCreate=(e,t)=>new Zb({shape:()=>e,unknownKeys:"strict",catchall:dB.create(),typeName:ws.ZodObject,...Wa(t)}),Zb.lazycreate=(e,t)=>new Zb({shape:e,unknownKeys:"strip",catchall:dB.create(),typeName:ws.ZodObject,...Wa(t)});var $ce=class extends hc{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;if(t.common.async)return Promise.all(n.map(async(o)=>{let r={...t,common:{...t.common,issues:[]},parent:null};return{result:await o._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}})).then(function(o){for(let i of o)if(i.result.status==="valid")return i.result;for(let i of o)if(i.result.status==="dirty")return t.common.issues.push(...i.ctx.common.issues),i.result;let r=o.map((i)=>new ov(i.ctx.common.issues));return wr(t,{code:Go.invalid_union,unionErrors:r}),fs});{let o,r=[];for(let s of n){let a={...t,common:{...t.common,issues:[]},parent:null},c=s._parseSync({data:t.data,path:t.path,parent:a});if(c.status==="valid")return c;c.status!=="dirty"||o||(o={result:c,ctx:a}),a.common.issues.length&&r.push(a.common.issues)}if(o)return t.common.issues.push(...o.ctx.common.issues),o.result;let i=r.map((s)=>new ov(s));return wr(t,{code:Go.invalid_union,unionErrors:i}),fs}}get options(){return this._def.options}};$ce.create=(e,t)=>new $ce({options:e,typeName:ws.ZodUnion,...Wa(t)});var xQ=(e)=>e instanceof Jce?xQ(e.schema):e instanceof tv?xQ(e.innerType()):e instanceof Zce?[e.value]:e instanceof Dle?e.options:e instanceof ele?wl.objectValues(e.enum):e instanceof tle?xQ(e._def.innerType):e instanceof jce?[void 0]:e instanceof Kce?[null]:e instanceof GS?[void 0,...xQ(e.unwrap())]:e instanceof KQ?[null,...xQ(e.unwrap())]:e instanceof aqe||e instanceof ole?xQ(e.unwrap()):e instanceof nle?xQ(e._def.innerType):[],KUt=class e extends hc{_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==jr.object)return wr(n,{code:Go.invalid_type,expected:jr.object,received:n.parsedType}),fs;let o=this.discriminator,r=n.data[o],i=this.optionsMap.get(r);return i?n.common.async?i._parseAsync({data:n.data,path:n.path,parent:n}):i._parseSync({data:n.data,path:n.path,parent:n}):(wr(n,{code:Go.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),fs)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,o){let r=new Map;for(let i of n){let s=xQ(i.shape[t]);if(!s.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let a of s){if(r.has(a))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);r.set(a,i)}}return new e({typeName:ws.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:r,...Wa(o)})}};function $je(e,t){let n=Zw(e),o=Zw(t);if(e===t)return{valid:!0,data:e};if(n===jr.object&&o===jr.object){let r=wl.objectKeys(t),i=wl.objectKeys(e).filter((a)=>r.indexOf(a)!==-1),s={...e,...t};for(let a of i){let c=$je(e[a],t[a]);if(!c.valid)return{valid:!1};s[a]=c.data}return{valid:!0,data:s}}if(n===jr.array&&o===jr.array){if(e.length!==t.length)return{valid:!1};let r=[];for(let i=0;i<e.length;i++){let s=$je(e[i],t[i]);if(!s.valid)return{valid:!1};r.push(s.data)}return{valid:!0,data:r}}return n===jr.date&&o===jr.date&&+e===+t?{valid:!0,data:e}:{valid:!1}}var qce=class extends hc{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),o=(r,i)=>{if(jje(r)||jje(i))return fs;let s=$je(r.value,i.value);return s.valid?((Kje(r)||Kje(i))&&t.dirty(),{status:t.value,value:s.data}):(wr(n,{code:Go.invalid_intersection_types}),fs)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([r,i])=>o(r,i)):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};qce.create=(e,t,n)=>new qce({left:e,right:t,typeName:ws.ZodIntersection,...Wa(n)});var jQ=class e extends hc{_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==jr.array)return wr(o,{code:Go.invalid_type,expected:jr.array,received:o.parsedType}),fs;if(o.data.length<this._def.items.length)return wr(o,{code:Go.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),fs;!this._def.rest&&o.data.length>this._def.items.length&&(wr(o,{code:Go.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let r=[...o.data].map((i,s)=>{let a=this._def.items[s]||this._def.rest;return a?a._parse(new qS(o,i,o.path,s)):null}).filter((i)=>!!i);return o.common.async?Promise.all(r).then((i)=>M5.mergeArray(n,i)):M5.mergeArray(n,r)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};jQ.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new jQ({items:e,typeName:ws.ZodTuple,rest:null,...Wa(t)})};var $Ut=class e extends hc{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==jr.object)return wr(o,{code:Go.invalid_type,expected:jr.object,received:o.parsedType}),fs;let r=[],i=this._def.keyType,s=this._def.valueType;for(let a in o.data)r.push({key:i._parse(new qS(o,a,o.path,a)),value:s._parse(new qS(o,o.data[a],o.path,a)),alwaysSet:a in o.data});return o.common.async?M5.mergeObjectAsync(n,r):M5.mergeObjectSync(n,r)}get element(){return this._def.valueType}static create(t,n,o){return new e(n instanceof hc?{keyType:t,valueType:n,typeName:ws.ZodRecord,...Wa(o)}:{keyType:oq.create(),valueType:t,typeName:ws.ZodRecord,...Wa(n)})}},pCe=class extends hc{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==jr.map)return wr(n,{code:Go.invalid_type,expected:jr.map,received:n.parsedType}),fs;let o=this._def.keyType,r=this._def.valueType,i=[...n.data.entries()].map(([s,a],c)=>({key:o._parse(new qS(n,s,n.path,[c,"key"])),value:r._parse(new qS(n,a,n.path,[c,"value"]))}));if(n.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let a of i){let c=await a.key,l=await a.value;if(c.status==="aborted"||l.status==="aborted")return fs;c.status!=="dirty"&&l.status!=="dirty"||t.dirty(),s.set(c.value,l.value)}return{status:t.value,value:s}})}{let s=new Map;for(let a of i){let{key:c,value:l}=a;if(c.status==="aborted"||l.status==="aborted")return fs;c.status!=="dirty"&&l.status!=="dirty"||t.dirty(),s.set(c.value,l.value)}return{status:t.value,value:s}}}};pCe.create=(e,t,n)=>new pCe({valueType:t,keyType:e,typeName:ws.ZodMap,...Wa(n)});var mCe=class e extends hc{_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==jr.set)return wr(o,{code:Go.invalid_type,expected:jr.set,received:o.parsedType}),fs;let r=this._def;r.minSize!==null&&o.data.size<r.minSize.value&&(wr(o,{code:Go.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),n.dirty()),r.maxSize!==null&&o.data.size>r.maxSize.value&&(wr(o,{code:Go.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),n.dirty());let i=this._def.valueType;function s(c){let l=new Set;for(let h of c){if(h.status==="aborted")return fs;h.status==="dirty"&&n.dirty(),l.add(h.value)}return{status:n.value,value:l}}let a=[...o.data.values()].map((c,l)=>i._parse(new qS(o,c,o.path,l)));return o.common.async?Promise.all(a).then((c)=>s(c)):s(a)}min(t,n){return new e({...this._def,minSize:{value:t,message:vi.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:vi.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}};mCe.create=(e,t)=>new mCe({valueType:e,minSize:null,maxSize:null,typeName:ws.ZodSet,...Wa(t)});var qUt=class e extends hc{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==jr.function)return wr(n,{code:Go.invalid_type,expected:jr.function,received:n.parsedType}),fs;function o(a,c){return lCe({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,cCe(),nq].filter((l)=>!!l),issueData:{code:Go.invalid_arguments,argumentsError:c}})}function r(a,c){return lCe({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,cCe(),nq].filter((l)=>!!l),issueData:{code:Go.invalid_return_type,returnTypeError:c}})}let i={errorMap:n.common.contextualErrorMap},s=n.data;if(this._def.returns instanceof iq){let a=this;return ix(async function(...c){let l=new ov([]),h=await a._def.args.parseAsync(c,i).catch((u)=>{throw l.addIssue(o(c,u)),l}),d=await Reflect.apply(s,this,h);return await a._def.returns._def.type.parseAsync(d,i).catch((u)=>{throw l.addIssue(r(d,u)),l})})}{let a=this;return ix(function(...c){let l=a._def.args.safeParse(c,i);if(!l.success)throw new ov([o(c,l.error)]);let h=Reflect.apply(s,this,l.data),d=a._def.returns.safeParse(h,i);if(!d.success)throw new ov([r(h,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:jQ.create(t).rest(SV.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,o){return new e({args:t||jQ.create([]).rest(SV.create()),returns:n||SV.create(),typeName:ws.ZodFunction,...Wa(o)})}},Jce=class extends hc{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};Jce.create=(e,t)=>new Jce({getter:e,typeName:ws.ZodLazy,...Wa(t)});var Zce=class extends hc{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return wr(t,{received:t.data,code:Go.invalid_literal,expected:this._def.value}),fs}return{status:"valid",value:e.data}}get value(){return this._def.value}};function JUt(e,t){return new Dle({values:e,typeName:ws.ZodEnum,...Wa(t)})}Zce.create=(e,t)=>new Zce({value:e,typeName:ws.ZodLiteral,...Wa(t)});var Dle=class e extends hc{_parse(t){if(typeof t.data!="string"){let n=this._getOrReturnCtx(t),o=this._def.values;return wr(n,{expected:wl.joinValues(o),received:n.parsedType,code:Go.invalid_type}),fs}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let n=this._getOrReturnCtx(t),o=this._def.values;return wr(n,{received:n.data,code:Go.invalid_enum_value,options:o}),fs}return ix(t.data)}get options(){return this._def.values}get enum(){let t={};for(let n of this._def.values)t[n]=n;return t}get Values(){let t={};for(let n of this._def.values)t[n]=n;return t}get Enum(){let t={};for(let n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter((o)=>!t.includes(o)),{...this._def,...n})}};Dle.create=JUt;var ele=class extends hc{_parse(e){let t=wl.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==jr.string&&n.parsedType!==jr.number){let o=wl.objectValues(t);return wr(n,{expected:wl.joinValues(o),received:n.parsedType,code:Go.invalid_type}),fs}if(this._cache||(this._cache=new Set(wl.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let o=wl.objectValues(t);return wr(n,{received:n.data,code:Go.invalid_enum_value,options:o}),fs}return ix(e.data)}get enum(){return this._def.values}};ele.create=(e,t)=>new ele({values:e,typeName:ws.ZodNativeEnum,...Wa(t)});var iq=class extends hc{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==jr.promise&&t.common.async===!1)return wr(t,{code:Go.invalid_type,expected:jr.promise,received:t.parsedType}),fs;let n=t.parsedType===jr.promise?t.data:Promise.resolve(t.data);return ix(n.then((o)=>this._def.type.parseAsync(o,{path:t.path,errorMap:t.common.contextualErrorMap})))}};iq.create=(e,t)=>new iq({type:e,typeName:ws.ZodPromise,...Wa(t)});var tv=class extends hc{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ws.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),o=this._def.effect||null,r={addIssue:(i)=>{wr(n,i),i.fatal?t.abort():t.dirty()},get path(){return n.path}};if(r.addIssue=r.addIssue.bind(r),o.type==="preprocess"){let i=o.transform(n.data,r);if(n.common.async)return Promise.resolve(i).then(async(s)=>{if(t.value==="aborted")return fs;let a=await this._def.schema._parseAsync({data:s,path:n.path,parent:n});return a.status==="aborted"?fs:a.status==="dirty"||t.value==="dirty"?hCe(a.value):a});{if(t.value==="aborted")return fs;let s=this._def.schema._parseSync({data:i,path:n.path,parent:n});return s.status==="aborted"?fs:s.status==="dirty"||t.value==="dirty"?hCe(s.value):s}}if(o.type==="refinement"){let i=(s)=>{let a=o.refinement(s,r);if(n.common.async)return Promise.resolve(a);if(a instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?fs:(s.status==="dirty"&&t.dirty(),i(s.value),{status:t.value,value:s.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((s)=>s.status==="aborted"?fs:(s.status==="dirty"&&t.dirty(),i(s.value).then(()=>({status:t.value,value:s.value}))))}if(o.type==="transform"){if(n.common.async===!1){let i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!HV(i))return fs;let s=o.transform(i.value,r);if(s instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:s}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((i)=>HV(i)?Promise.resolve(o.transform(i.value,r)).then((s)=>({status:t.value,value:s})):fs)}wl.assertNever(o)}};tv.create=(e,t,n)=>new tv({schema:e,typeName:ws.ZodEffects,effect:t,...Wa(n)}),tv.createWithPreprocess=(e,t,n)=>new tv({schema:t,effect:{type:"preprocess",transform:e},typeName:ws.ZodEffects,...Wa(n)});var GS=class extends hc{_parse(e){return this._getType(e)===jr.undefined?ix(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};GS.create=(e,t)=>new GS({innerType:e,typeName:ws.ZodOptional,...Wa(t)});var KQ=class extends hc{_parse(e){return this._getType(e)===jr.null?ix(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};KQ.create=(e,t)=>new KQ({innerType:e,typeName:ws.ZodNullable,...Wa(t)});var tle=class extends hc{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===jr.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};tle.create=(e,t)=>new tle({innerType:e,typeName:ws.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Wa(t)});var nle=class extends hc{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},o=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Yce(o)?o.then((r)=>({status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new ov(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new ov(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};nle.create=(e,t)=>new nle({innerType:e,typeName:ws.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Wa(t)});var _Ce=class extends hc{_parse(e){if(this._getType(e)!==jr.nan){let t=this._getOrReturnCtx(e);return wr(t,{code:Go.invalid_type,expected:jr.nan,received:t.parsedType}),fs}return{status:"valid",value:e.data}}};_Ce.create=(e)=>new _Ce({typeName:ws.ZodNaN,...Wa(e)});var Jmr=Symbol("zod_brand"),aqe=class extends hc{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},cqe=class e extends hc{_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.common.async)return(async()=>{let r=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});return r.status==="aborted"?fs:r.status==="dirty"?(n.dirty(),hCe(r.value)):this._def.out._parseAsync({data:r.value,path:o.path,parent:o})})();{let r=this._def.in._parseSync({data:o.data,path:o.path,parent:o});return r.status==="aborted"?fs:r.status==="dirty"?(n.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:o.path,parent:o})}}static create(t,n){return new e({in:t,out:n,typeName:ws.ZodPipeline})}},ole=class extends hc{_parse(e){let t=this._def.innerType._parse(e),n=(o)=>(HV(o)&&(o.value=Object.freeze(o.value)),o);return Yce(t)?t.then((o)=>n(o)):n(t)}unwrap(){return this._def.innerType}};function _Ht(e,t){let n=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof n=="string"?{message:n}:n}function ZUt(e,t={},n){return e?rq.create().superRefine((o,r)=>{let i=e(o);if(i instanceof Promise)return i.then((s)=>{if(!s){let a=_Ht(t,o),c=a.fatal??n??!0;r.addIssue({code:"custom",...a,fatal:c})}});if(!i){let s=_Ht(t,o),a=s.fatal??n??!0;r.addIssue({code:"custom",...s,fatal:a})}}):rq.create()}ole.create=(e,t)=>new ole({innerType:e,typeName:ws.ZodReadonly,...Wa(t)});var ws,tl,Zmr={object:Zb.lazycreate};(tl=ws||(ws={})).ZodString="ZodString",tl.ZodNumber="ZodNumber",tl.ZodNaN="ZodNaN",tl.ZodBigInt="ZodBigInt",tl.ZodBoolean="ZodBoolean",tl.ZodDate="ZodDate",tl.ZodSymbol="ZodSymbol",tl.ZodUndefined="ZodUndefined",tl.ZodNull="ZodNull",tl.ZodAny="ZodAny",tl.ZodUnknown="ZodUnknown",tl.ZodNever="ZodNever",tl.ZodVoid="ZodVoid",tl.ZodArray="ZodArray",tl.ZodObject="ZodObject",tl.ZodUnion="ZodUnion",tl.ZodDiscriminatedUnion="ZodDiscriminatedUnion",tl.ZodIntersection="ZodIntersection",tl.ZodTuple="ZodTuple",tl.ZodRecord="ZodRecord",tl.ZodMap="ZodMap",tl.ZodSet="ZodSet",tl.ZodFunction="ZodFunction",tl.ZodLazy="ZodLazy",tl.ZodLiteral="ZodLiteral",tl.ZodEnum="ZodEnum",tl.ZodEffects="ZodEffects",tl.ZodNativeEnum="ZodNativeEnum",tl.ZodOptional="ZodOptional",tl.ZodNullable="ZodNullable",tl.ZodDefault="ZodDefault",tl.ZodCatch="ZodCatch",tl.ZodPromise="ZodPromise",tl.ZodBranded="ZodBranded",tl.ZodPipeline="ZodPipeline",tl.ZodReadonly="ZodReadonly";var e_r=(e,t={message:`Input not instance of ${e.name}`})=>ZUt((n)=>n instanceof e,t),eWt=oq.create,tWt=Gce.create,t_r=_Ce.create,n_r=Uce.create,nWt=Wce.create,o_r=Xce.create,r_r=dCe.create,i_r=jce.create,s_r=Kce.create,a_r=rq.create,c_r=SV.create,l_r=dB.create,h_r=uCe.create,d_r=FV.create,{create:u_r,strictCreate:p_r}=Zb,m_r=$ce.create,__r=KUt.create,g_r=qce.create,A_r=jQ.create,f_r=$Ut.create,y_r=pCe.create,x_r=mCe.create,C_r=qUt.create,b_r=Jce.create,I_r=Zce.create,v_r=Dle.create,S_r=ele.create,P_r=iq.create,gHt=tv.create,E_r=GS.create,M_r=KQ.create,w_r=tv.createWithPreprocess,B_r=cqe.create,T_r=()=>eWt().optional(),D_r=()=>tWt().optional(),N_r=()=>nWt().optional(),R_r={string:(e)=>oq.create({...e,coerce:!0}),number:(e)=>Gce.create({...e,coerce:!0}),boolean:(e)=>Wce.create({...e,coerce:!0}),bigint:(e)=>Uce.create({...e,coerce:!0}),date:(e)=>Xce.create({...e,coerce:!0})},Q_r=fs,oWt={Hz:{baseUnit:"Hz",variants:{MHz:1e6,kHz:1000,Hz:1}},g:{baseUnit:"g",variants:{kg:1000,g:1}},"Ω":{baseUnit:"Ω",variants:{"mΩ":0.001,"Ω":1,"kΩ":1000,"KΩ":1000,kohm:1000,"MΩ":1e6,"GΩ":1e9,"TΩ":1000000000000}},V:{baseUnit:"V",variants:{mV:0.001,V:1,kV:1000,KV:1000,MV:1e6,GV:1e9,TV:1000000000000}},A:{baseUnit:"A",variants:{"µA":0.000001,mA:0.001,ma:0.001,A:1,kA:1000,MA:1e6}},F:{baseUnit:"F",variants:{pF:0.000000000001,nF:0.000000001,"µF":0.000001,uF:0.000001,mF:0.001,F:1}},ml:{baseUnit:"ml",variants:{ml:1,mL:1,l:1000,L:1000}},deg:{baseUnit:"deg",variants:{rad:180/Math.PI}},ms:{baseUnit:"ms",variants:{fs:0.000000000001,ps:0.000000001,ns:0.000001,us:0.001,"µs":0.001,ms:1,s:1000}},mm:{baseUnit:"mm",variants:{nm:0.000001,"µm":0.001,um:0.001,mm:1,cm:10,dm:100,m:1000,km:1e6,in:25.4,ft:304.8,IN:25.4,FT:304.8,yd:914.4,mi:1609344,mil:0.0254}}},qje=new Set;for(let[e,t]of Object.entries(oWt)){qje.add(e);for(let n of Object.keys(t.variants))qje.add(n)}var AHt={tera:1000000000000,T:1000000000000,giga:1e9,G:1e9,mega:1e6,M:1e6,kilo:1000,k:1000,deci:0.1,d:0.1,centi:0.01,c:0.01,milli:0.001,m:0.001,micro:0.000001,u:0.000001,"µ":0.000001,nano:0.000000001,n:0.000000001,pico:0.000000000001,p:0.000000000001};function rv(e){if(e==null)return{parsedUnit:null,unitOfValue:null,value:null};if(typeof e=="string"&&e.match(/^-?[\d\.]+$/))return{value:Number.parseFloat(e),parsedUnit:null,unitOfValue:null};if(typeof e=="number")return{value:e,parsedUnit:null,unitOfValue:null};if(typeof e=="object"&&"x"in e&&"y"in e){let{parsedUnit:a,unitOfValue:c}=rv(e.x),l=rv(e.x),h=rv(e.y);return l.value===null||h.value===null?{parsedUnit:null,unitOfValue:null,value:null}:{parsedUnit:a,unitOfValue:c,value:{x:l.value,y:h.value}}}let t=e.toString().split("").reverse().join(""),n=t.match(/[^\d\s]+/)?.[0];if(!n)throw Error(`Could not determine unit: "${e}"`);let o=n.split("").reverse().join(""),r=e.slice(0,-o.length);if(o in AHt&&!qje.has(o)){let a=AHt[o];return{parsedUnit:null,unitOfValue:null,value:Number.parseFloat(r)*a}}let{baseUnit:i,conversionFactor:s}=function(a){for(let[c,l]of Object.entries(oWt))if(a in l.variants)return{baseUnit:l.baseUnit,conversionFactor:l.variants[a]};return{baseUnit:a,conversionFactor:1}}(o);return{parsedUnit:o,unitOfValue:i,value:s*Number.parseFloat(r)}}var xbe=E.string().or(E.number()).transform((e)=>rv(e).value),lqe=E.string().or(E.number()).transform((e)=>rv(e).value).transform((e)=>Number.parseFloat(e.toPrecision(12))),rWt=E.string().or(E.number()).transform((e)=>rv(e).value),gB=E.string().or(E.number()).transform((e)=>rv(e).value),dr=E.string().or(E.number()).transform((e)=>rv(e).value),nY=E.string().or(E.number()).transform((e)=>rv(e).value),qn=dr,sq=E.string().or(E.number()).transform((e)=>rv(e).value),Nle=E.string().or(E.number()).transform((e)=>rv(e).value),k_r=Nle,zV=Nle,iWt=E.string().datetime(),Ym=E.string().or(E.number()).transform((e)=>typeof e=="number"?e:e.endsWith("deg")?Number.parseFloat(e.split("deg")[0]):e.endsWith("rad")?180*Number.parseFloat(e.split("rad")[0])/Math.PI:Number.parseFloat(e)),sWt=E.number().or(E.string().endsWith("mAh")).transform((e)=>{if(typeof e=="string"){let t=e.replace("mAh",""),n=Number.parseFloat(t);if(Number.isNaN(n))throw Error("Invalid capacity");return n}return e}).describe("Battery capacity in mAh"),Jr=E.object({x:qn,y:qn}),L_r=Jr,rB=E.object({x:qn,y:qn,z:qn}),H_r=rB,hqe=E.object({width:E.number(),height:E.number()}),yo=(e)=>E.string().optional().default(()=>`${e}_${((t)=>Array.from({length:t},()=>"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[Math.floor(62*Math.random())]).join(""))(10)}`),vB=E.enum(["top_left","top_center","top_right","center_left","center","center_right","bottom_left","bottom_center","bottom_right"]),F_r=E.enum(["top_silkscreen","bottom_silkscreen","top_copper","bottom_copper","top_soldermask","bottom_soldermask","top_fabrication_note","bottom_fabrication_note","top_user_note","bottom_user_note","top_courtyard","bottom_courtyard","inner1_copper","inner2_copper","inner3_copper","inner4_copper","inner5_copper","inner6_copper","edge_cuts","drill"]),aWt=E.object({project_relative_path:E.string(),url:E.string(),mimetype:E.string()}),Cbe=Jr.extend({rotation:Ym.optional()}),dqe=E.object({size:Jr.optional(),thickness:qn.optional()}),cWt=E.object({font:dqe.optional()}),Jae=E.object({value:E.string(),at:Cbe.optional(),layer:E.string().optional(),uuid:E.string().optional(),hide:E.boolean().optional(),effects:cWt.optional()}),lWt=E.object({Reference:Jae.optional(),Value:Jae.optional(),Datasheet:Jae.optional(),Description:Jae.optional()}),hWt=E.object({through_hole:E.boolean().optional(),smd:E.boolean().optional(),exclude_from_pos_files:E.boolean().optional(),exclude_from_bom:E.boolean().optional()}),dWt=E.object({name:E.string(),type:E.string(),shape:E.string().optional(),at:Cbe.optional(),size:Jr.optional(),drill:qn.optional(),layers:E.array(E.string()).optional(),removeUnusedLayers:E.boolean().optional(),uuid:E.string().optional()}),uWt=E.object({path:E.string(),offset:rB.optional(),scale:rB.optional(),rotate:rB.optional()}),pWt=E.object({footprintName:E.string().optional(),version:E.union([E.number(),E.string()]).optional(),generator:E.string().optional(),generatorVersion:E.union([E.number(),E.string()]).optional(),layer:E.string().optional(),properties:lWt.optional(),attributes:hWt.optional(),pads:E.array(dWt).optional(),embeddedFonts:E.boolean().optional(),model:uWt.optional()}),mWt=E.object({hide:E.boolean().optional()}),_Wt=E.object({offset:qn.optional(),hide:E.boolean().optional()}),gWt=E.object({font:dqe.optional(),justify:E.union([E.string(),E.array(E.string())]).optional(),hide:E.boolean().optional()}),CQ=E.object({value:E.string(),id:E.union([E.number(),E.string()]).optional(),at:Cbe.optional(),effects:gWt.optional()}),AWt=E.object({Reference:CQ.optional(),Value:CQ.optional(),Footprint:CQ.optional(),Datasheet:CQ.optional(),Description:CQ.optional(),ki_keywords:CQ.optional(),ki_fp_filters:CQ.optional()}),fWt=E.object({symbolName:E.string().optional(),extends:E.string().optional(),pinNumbers:mWt.optional(),pinNames:_Wt.optional(),excludeFromSim:E.boolean().optional(),inBom:E.boolean().optional(),onBoard:E.boolean().optional(),properties:AWt.optional(),embeddedFonts:E.boolean().optional()}),yh=E.object({error_type:E.string(),message:E.string(),is_fatal:E.boolean().optional()}),uqe=E.enum(["jlcpcb","macrofab","pcbway","digikey","mouser","lcsc"]),ou=E.object({type:E.literal("source_component"),ftype:E.string().optional(),source_component_id:E.string(),name:E.string(),manufacturer_part_number:E.string().optional(),supplier_part_numbers:E.record(uqe,E.array(E.string())).optional(),display_value:E.string().optional(),display_name:E.string().optional(),are_pins_interchangeable:E.boolean().optional(),internally_connected_source_port_ids:E.array(E.array(E.string())).optional(),source_group_id:E.string().optional(),subcircuit_id:E.string().optional()}),pqe=ou.extend({ftype:E.literal("simple_capacitor"),capacitance:lqe,max_voltage_rating:gB.optional(),display_capacitance:E.string().optional(),max_decoupling_trace_length:qn.optional()}),mqe=ou.extend({ftype:E.literal("simple_resistor"),resistance:xbe,display_resistance:E.string().optional()}),bbe=ou.extend({ftype:E.literal("simple_diode")}),yWt=ou.extend({ftype:E.literal("simple_fiducial")}),_qe=bbe.extend({ftype:E.literal("simple_led"),color:E.string().optional(),wavelength:E.string().optional()}),xWt=ou.extend({ftype:E.literal("simple_ground")}),gqe=ou.extend({ftype:E.literal("simple_chip")}),Aqe=ou.extend({ftype:E.literal("simple_power_source"),voltage:gB}),CWt=ou.extend({ftype:E.literal("simple_current_source"),current:sq,frequency:nY.optional(),peak_to_peak_current:sq.optional(),wave_shape:E.enum(["sine","square","triangle","sawtooth","dc"]).optional().default("dc"),phase:E.number().optional(),duty_cycle:E.number().min(0).max(1).optional()}),bWt=E.object({must_be_connected:E.boolean().optional(),provides_power:E.boolean().optional(),requires_power:E.boolean().optional(),provides_ground:E.boolean().optional(),requires_ground:E.boolean().optional(),provides_voltage:E.union([E.string(),E.number()]).optional(),requires_voltage:E.union([E.string(),E.number()]).optional(),do_not_connect:E.boolean().optional(),include_in_board_pinout:E.boolean().optional(),can_use_internal_pullup:E.boolean().optional(),is_using_internal_pullup:E.boolean().optional(),needs_external_pullup:E.boolean().optional(),can_use_internal_pulldown:E.boolean().optional(),is_using_internal_pulldown:E.boolean().optional(),needs_external_pulldown:E.boolean().optional(),can_use_open_drain:E.boolean().optional(),is_using_open_drain:E.boolean().optional(),can_use_push_pull:E.boolean().optional(),is_using_push_pull:E.boolean().optional(),should_have_decoupling_capacitor:E.boolean().optional(),recommended_decoupling_capacitor_capacitance:E.union([E.string(),E.number()]).optional(),is_configured_for_i2c_sda:E.boolean().optional(),is_configured_for_i2c_scl:E.boolean().optional(),is_configured_for_spi_mosi:E.boolean().optional(),is_configured_for_spi_miso:E.boolean().optional(),is_configured_for_spi_sck:E.boolean().optional(),is_configured_for_spi_cs:E.boolean().optional(),is_configured_for_uart_tx:E.boolean().optional(),is_configured_for_uart_rx:E.boolean().optional(),supports_i2c_sda:E.boolean().optional(),supports_i2c_scl:E.boolean().optional(),supports_spi_mosi:E.boolean().optional(),supports_spi_miso:E.boolean().optional(),supports_spi_sck:E.boolean().optional(),supports_spi_cs:E.boolean().optional(),supports_uart_tx:E.boolean().optional(),supports_uart_rx:E.boolean().optional()}),z_r=ou.extend({ftype:E.literal("simple_fuse"),current_rating_amps:E.number().describe("Nominal current in amps the fuse is rated for"),voltage_rating_volts:E.number().describe("Voltage rating in volts, e.g. ±5V would be 5")}),fqe=ou.extend({ftype:E.literal("simple_battery"),capacity:sWt}),yqe=ou.extend({ftype:E.literal("simple_inductor"),inductance:rWt,display_inductance:E.string().optional(),max_current_rating:E.number().optional()}),xqe=ou.extend({ftype:E.literal("simple_push_button")}),Cqe=ou.extend({ftype:E.literal("simple_potentiometer"),max_resistance:xbe,display_max_resistance:E.string().optional()}),IWt=ou.extend({ftype:E.literal("simple_crystal"),frequency:E.number().describe("Frequency in Hz"),load_capacitance:E.number().optional().describe("Load capacitance in pF"),pin_variant:E.enum(["two_pin","four_pin"]).optional()}),bqe=ou.extend({ftype:E.literal("simple_pin_header"),pin_count:E.number(),gender:E.enum(["male","female"]).optional().default("male")}),vWt=ou.extend({ftype:E.literal("simple_connector"),standard:E.enum(["usb_c","m2"]).optional()}),Iqe=ou.extend({ftype:E.literal("simple_pinout")}),vqe=ou.extend({ftype:E.literal("simple_resonator"),load_capacitance:lqe,equivalent_series_resistance:xbe.optional(),frequency:nY}),Sqe=ou.extend({ftype:E.literal("simple_transistor"),transistor_type:E.enum(["npn","pnp"])}),Pqe=ou.extend({ftype:E.literal("simple_test_point"),footprint_variant:E.enum(["pad","through_hole"]).optional(),pad_shape:E.enum(["rect","circle"]).optional(),pad_diameter:E.union([E.number(),E.string()]).optional(),hole_diameter:E.union([E.number(),E.string()]).optional(),width:E.union([E.number(),E.string()]).optional(),height:E.union([E.number(),E.string()]).optional()}),Eqe=ou.extend({ftype:E.literal("simple_mosfet"),channel_type:E.enum(["n","p"]),mosfet_mode:E.enum(["enhancement","depletion"])}),Mqe=ou.extend({ftype:E.literal("simple_op_amp")}),wqe=ou.extend({ftype:E.literal("simple_switch")}),Bqe=E.object({type:E.literal("source_project_metadata"),name:E.string().optional(),software_used_string:E.string().optional(),project_url:E.string().optional(),created_at:iWt.optional()}),SWt=yh.extend({type:E.literal("source_missing_property_error"),source_missing_property_error_id:yo("source_missing_property_error"),source_component_id:E.string(),property_name:E.string(),subcircuit_id:E.string().optional(),error_type:E.literal("source_missing_property_error").default("source_missing_property_error")}).describe("The source code is missing a property"),PWt=yh.extend({type:E.literal("source_failed_to_create_component_error"),source_failed_to_create_component_error_id:yo("source_failed_to_create_component_error"),error_type:E.literal("source_failed_to_create_component_error").default("source_failed_to_create_component_error"),component_name:E.string().optional(),subcircuit_id:E.string().optional(),parent_source_component_id:E.string().optional(),pcb_center:E.object({x:E.number().optional(),y:E.number().optional()}).optional(),schematic_center:E.object({x:E.number().optional(),y:E.number().optional()}).optional()}).describe("Error emitted when a component fails to be constructed"),Tqe=yh.extend({type:E.literal("source_invalid_component_property_error"),source_invalid_component_property_error_id:yo("source_invalid_component_property_error"),source_component_id:E.string(),property_name:E.string(),property_value:E.unknown().optional(),expected_format:E.string().optional(),subcircuit_id:E.string().optional(),error_type:E.literal("source_invalid_component_property_error").default("source_invalid_component_property_error")}).describe("The source component property is invalid"),Dqe=yh.extend({type:E.literal("source_trace_not_connected_error"),source_trace_not_connected_error_id:yo("source_trace_not_connected_error"),error_type:E.literal("source_trace_not_connected_error").default("source_trace_not_connected_error"),subcircuit_id:E.string().optional(),source_group_id:E.string().optional(),source_trace_id:E.string().optional(),connected_source_port_ids:E.array(E.string()).optional(),selectors_not_found:E.array(E.string()).optional()}).describe("Occurs when a source trace selector does not match any ports"),EWt=E.object({type:E.literal("source_property_ignored_warning"),source_property_ignored_warning_id:yo("source_property_ignored_warning"),source_component_id:E.string(),property_name:E.string(),subcircuit_id:E.string().optional(),error_type:E.literal("source_property_ignored_warning").default("source_property_ignored_warning"),message:E.string()}).describe("The source property was ignored"),Nqe=E.object({type:E.literal("source_pin_missing_trace_warning"),source_pin_missing_trace_warning_id:yo("source_pin_missing_trace_warning"),warning_type:E.literal("source_pin_missing_trace_warning").default("source_pin_missing_trace_warning"),message:E.string(),source_component_id:E.string(),source_port_id:E.string(),subcircuit_id:E.string().optional()}).describe("Warning emitted when a source component pin is missing a trace connection"),Rqe=E.object({type:E.literal("source_missing_manufacturer_part_number_warning"),source_missing_manufacturer_part_number_warning_id:yo("source_missing_manufacturer_part_number_warning"),warning_type:E.literal("source_missing_manufacturer_part_number_warning").default("source_missing_manufacturer_part_number_warning"),message:E.string(),source_component_id:E.string(),standard:E.string(),subcircuit_id:E.string().optional()}).describe("Warning emitted when a standard connector is missing manufacturer part number"),MWt=ou.extend({ftype:E.literal("simple_voltage_probe")}),wWt=ou.extend({ftype:E.literal("interconnect")}),Qqe=yh.extend({type:E.literal("source_i2c_misconfigured_error"),source_i2c_misconfigured_error_id:yo("source_i2c_misconfigured_error"),error_type:E.literal("source_i2c_misconfigured_error").default("source_i2c_misconfigured_error"),source_port_ids:E.array(E.string())}).describe("Error emitted when incompatible I2C pins (e.g. SDA and SCL) are connected to the same net"),BWt=ou.extend({ftype:E.literal("simple_voltage_source"),voltage:gB,frequency:nY.optional(),peak_to_peak_voltage:gB.optional(),wave_shape:E.enum(["sinewave","square","triangle","sawtooth"]).optional(),phase:Ym.optional(),duty_cycle:E.number().optional().describe("Duty cycle as a fraction (0 to 1)")}),TWt=E.union([mqe,pqe,bbe,yWt,_qe,xWt,gqe,Aqe,CWt,fqe,yqe,xqe,Cqe,IWt,bqe,vWt,Iqe,vqe,wqe,Sqe,Pqe,Eqe,Mqe,z_r,MWt,wWt,BWt,Bqe,SWt,Tqe,PWt,Dqe,EWt,Nqe,Rqe,Qqe]),DWt=E.object({type:E.literal("source_port"),pin_number:E.number().optional(),port_hints:E.array(E.string()).optional(),name:E.string(),source_port_id:E.string(),source_component_id:E.string().optional(),source_group_id:E.string().optional(),most_frequently_referenced_by_name:E.string().optional(),subcircuit_id:E.string().optional(),subcircuit_connectivity_map_key:E.string().optional()}).merge(bWt),NWt=E.object({type:E.literal("source_component_internal_connection"),source_component_internal_connection_id:E.string(),source_component_id:E.string(),source_port_ids:E.array(E.string()),subcircuit_id:E.string().optional()}),RWt=E.object({type:E.literal("source_trace"),source_trace_id:E.string(),connected_source_port_ids:E.array(E.string()),connected_source_net_ids:E.array(E.string()),subcircuit_id:E.string().optional(),subcircuit_connectivity_map_key:E.string().optional(),max_length:E.number().optional(),min_trace_thickness:E.number().optional(),display_name:E.string().optional()}),QWt=E.object({type:E.literal("source_group"),source_group_id:E.string(),subcircuit_id:E.string().optional(),parent_subcircuit_id:E.string().optional(),parent_source_group_id:E.string().optional(),is_subcircuit:E.boolean().optional(),show_as_schematic_box:E.boolean().optional(),name:E.string().optional(),was_automatically_named:E.boolean().optional()}),kWt=E.object({type:E.literal("source_net"),source_net_id:E.string(),name:E.string(),member_source_group_ids:E.array(E.string()),is_power:E.boolean().optional(),is_ground:E.boolean().optional(),is_digital_signal:E.boolean().optional(),is_analog_signal:E.boolean().optional(),is_positive_voltage_source:E.boolean().optional(),trace_width:E.number().optional(),subcircuit_id:E.string().optional(),subcircuit_connectivity_map_key:E.string().optional()}),LWt=E.object({type:E.literal("source_board"),source_board_id:E.string(),source_group_id:E.string(),title:E.string().optional()}).describe("Defines a board in the source domain"),HWt=yh.extend({type:E.literal("source_ambiguous_port_reference"),source_ambiguous_port_reference_id:yo("source_ambiguous_port_reference"),error_type:E.literal("source_ambiguous_port_reference").default("source_ambiguous_port_reference"),source_port_id:E.string().optional(),source_component_id:E.string().optional()}).describe("Error emitted when a port hint matches multiple non-overlapping pads, making the port reference ambiguous"),FWt=E.object({type:E.literal("source_pcb_ground_plane"),source_pcb_ground_plane_id:E.string(),source_group_id:E.string(),source_net_id:E.string(),subcircuit_id:E.string().optional()}).describe("Defines a ground plane in the source domain"),zWt=["top","bottom","inner1","inner2","inner3","inner4","inner5","inner6"],Jje=E.enum(zWt),Tc=Jje.or(E.object({name:Jje})).transform((e)=>typeof e=="string"?e:e.name),d2=E.enum(["top","bottom"]),OWt=E.object({type:E.literal("source_manually_placed_via"),source_manually_placed_via_id:E.string(),source_group_id:E.string(),source_net_id:E.string(),subcircuit_id:E.string().optional(),source_trace_id:E.string().optional()}).describe("Defines a via that is manually placed in the source domain"),VWt=E.object({type:E.literal("source_no_power_pin_defined_warning"),source_no_power_pin_defined_warning_id:yo("source_no_power_pin_defined_warning"),warning_type:E.literal("source_no_power_pin_defined_warning").default("source_no_power_pin_defined_warning"),message:E.string(),source_component_id:E.string(),source_port_ids:E.array(E.string()),subcircuit_id:E.string().optional()}).describe("Warning emitted when a chip has no source ports with requires_power=true"),YWt=E.object({type:E.literal("source_no_ground_pin_defined_warning"),source_no_ground_pin_defined_warning_id:yo("source_no_ground_pin_defined_warning"),warning_type:E.literal("source_no_ground_pin_defined_warning").default("source_no_ground_pin_defined_warning"),message:E.string(),source_component_id:E.string(),source_port_ids:E.array(E.string()),subcircuit_id:E.string().optional()}).describe("Warning emitted when a chip has no source ports marked as ground pins"),GWt=E.object({type:E.literal("source_component_pins_underspecified_warning"),source_component_pins_underspecified_warning_id:yo("source_component_pins_underspecified_warning"),warning_type:E.literal("source_component_pins_underspecified_warning").default("source_component_pins_underspecified_warning"),message:E.string(),source_component_id:E.string(),source_port_ids:E.array(E.string()),subcircuit_id:E.string().optional()}).describe("Warning emitted when all ports on a source component are underspecified"),UWt=yh.extend({type:E.literal("source_pin_must_be_connected_error"),source_pin_must_be_connected_error_id:yo("source_pin_must_be_connected_error"),error_type:E.literal("source_pin_must_be_connected_error").default("source_pin_must_be_connected_error"),source_component_id:E.string(),source_port_id:E.string(),subcircuit_id:E.string().optional()}).describe("Error emitted when a pin with mustBeConnected attribute is not connected to any trace"),WWt=yh.extend({type:E.literal("unknown_error_finding_part"),unknown_error_finding_part_id:yo("unknown_error_finding_part"),error_type:E.literal("unknown_error_finding_part").default("unknown_error_finding_part"),source_component_id:E.string().optional(),subcircuit_id:E.string().optional()}).describe("Error emitted when an unexpected error occurs while finding a part"),XWt=E.object({type:E.literal("schematic_box"),schematic_component_id:E.string().optional(),schematic_symbol_id:E.string().optional(),width:qn,height:qn,is_dashed:E.boolean().default(!1),x:qn,y:qn,subcircuit_id:E.string().optional()}).describe("Draws a box on the schematic"),jWt=E.object({type:E.literal("schematic_path"),schematic_path_id:yo("schematic_path"),schematic_component_id:E.string().optional(),schematic_symbol_id:E.string().optional(),fill_color:E.string().optional(),is_filled:E.boolean().optional(),stroke_width:qn.nullable().optional(),stroke_color:E.string().optional(),points:E.array(Jr),subcircuit_id:E.string().optional()}),KWt=E.record(E.object({left_margin:dr.optional(),right_margin:dr.optional(),top_margin:dr.optional(),bottom_margin:dr.optional()})),$Wt=E.object({left_size:E.number(),right_size:E.number(),top_size:E.number().optional(),bottom_size:E.number().optional()}),qWt=E.object({left_side:E.object({pins:E.array(E.number()),direction:E.enum(["top-to-bottom","bottom-to-top"]).optional()}).optional(),right_side:E.object({pins:E.array(E.number()),direction:E.enum(["top-to-bottom","bottom-to-top"]).optional()}).optional(),top_side:E.object({pins:E.array(E.number()),direction:E.enum(["left-to-right","right-to-left"]).optional()}).optional(),bottom_side:E.object({pins:E.array(E.number()),direction:E.enum(["left-to-right","right-to-left"]).optional()}).optional()}),JWt=E.union([$Wt,qWt]),ZWt=E.object({type:E.literal("schematic_component"),size:hqe,center:Jr,source_component_id:E.string().optional(),schematic_component_id:E.string(),schematic_symbol_id:E.string().optional(),pin_spacing:dr.optional(),pin_styles:KWt.optional(),box_width:dr.optional(),symbol_name:E.string().optional(),port_arrangement:JWt.optional(),port_labels:E.record(E.string()).optional(),symbol_display_value:E.string().optional(),subcircuit_id:E.string().optional(),schematic_group_id:E.string().optional(),is_schematic_group:E.boolean().optional(),source_group_id:E.string().optional(),is_box_with_pins:E.boolean().optional().default(!0)}),O_r=E.object({kicad_symbol:fWt.optional()}).catchall(E.unknown()),eXt=E.object({type:E.literal("schematic_symbol"),schematic_symbol_id:E.string(),name:E.string().optional(),metadata:O_r.optional()}).describe("Defines a named schematic symbol that can be referenced by components."),tXt=E.object({type:E.literal("schematic_line"),schematic_line_id:yo("schematic_line"),schematic_component_id:E.string().optional(),schematic_symbol_id:E.string().optional(),x1:qn,y1:qn,x2:qn,y2:qn,stroke_width:qn.nullable().optional(),color:E.string().default("#000000"),is_dashed:E.boolean().default(!1),subcircuit_id:E.string().optional()}).describe("Draws a styled line on the schematic"),nXt=E.object({type:E.literal("schematic_rect"),schematic_rect_id:yo("schematic_rect"),schematic_component_id:E.string().optional(),schematic_symbol_id:E.string().optional(),center:Jr,width:qn,height:qn,rotation:Ym.default(0),stroke_width:qn.nullable().optional(),color:E.string().default("#000000"),is_filled:E.boolean().default(!1),fill_color:E.string().optional(),is_dashed:E.boolean().default(!1),subcircuit_id:E.string().optional()}).describe("Draws a styled rectangle on the schematic"),oXt=E.object({type:E.literal("schematic_circle"),schematic_circle_id:yo("schematic_circle"),schematic_component_id:E.string().optional(),schematic_symbol_id:E.string().optional(),center:Jr,radius:qn,stroke_width:qn.nullable().optional(),color:E.string().default("#000000"),is_filled:E.boolean().default(!1),fill_color:E.string().optional(),is_dashed:E.boolean().default(!1),subcircuit_id:E.string().optional()}).describe("Draws a styled circle on the schematic"),rXt=E.object({type:E.literal("schematic_arc"),schematic_arc_id:yo("schematic_arc"),schematic_component_id:E.string().optional(),schematic_symbol_id:E.string().optional(),center:Jr,radius:qn,start_angle_degrees:Ym,end_angle_degrees:Ym,direction:E.enum(["clockwise","counterclockwise"]).default("counterclockwise"),stroke_width:qn.nullable().optional(),color:E.string().default("#000000"),is_dashed:E.boolean().default(!1),subcircuit_id:E.string().optional()}).describe("Draws a styled arc on the schematic"),iXt=E.object({type:E.literal("schematic_trace"),schematic_trace_id:E.string(),source_trace_id:E.string().optional(),junctions:E.array(E.object({x:E.number(),y:E.number()})),edges:E.array(E.object({from:E.object({x:E.number(),y:E.number()}),to:E.object({x:E.number(),y:E.number()}),is_crossing:E.boolean().optional(),from_schematic_port_id:E.string().optional(),to_schematic_port_id:E.string().optional()})),subcircuit_id:E.string().optional(),subcircuit_connectivity_map_key:E.string().optional()}),V_r=E.enum(["center","left","right","top","bottom"]),sXt=E.object({type:E.literal("schematic_text"),schematic_component_id:E.string().optional(),schematic_symbol_id:E.string().optional(),schematic_text_id:E.string(),text:E.string(),font_size:E.number().default(0.18),position:E.object({x:qn,y:qn}),rotation:E.number().default(0),anchor:E.union([V_r.describe("legacy"),vB]).default("center"),color:E.string().default("#000000"),subcircuit_id:E.string().optional()}),aXt=E.object({type:E.literal("schematic_port"),schematic_port_id:E.string(),source_port_id:E.string(),schematic_component_id:E.string().optional(),center:Jr,facing_direction:E.enum(["up","down","left","right"]).optional(),distance_from_component_edge:E.number().optional(),side_of_component:E.enum(["top","bottom","left","right"]).optional(),true_ccw_index:E.number().optional(),pin_number:E.number().optional(),display_pin_label:E.string().optional(),subcircuit_id:E.string().optional(),is_connected:E.boolean().optional(),has_input_arrow:E.boolean().optional(),has_output_arrow:E.boolean().optional(),is_drawn_with_inversion_circle:E.boolean().optional()}).describe("Defines a port on a schematic component"),cXt=E.object({type:E.literal("schematic_net_label"),schematic_net_label_id:yo("schematic_net_label"),schematic_trace_id:E.string().optional(),source_trace_id:E.string().optional(),source_net_id:E.string(),center:Jr,anchor_position:Jr.optional(),anchor_side:E.enum(["top","bottom","left","right"]),text:E.string(),symbol_name:E.string().optional(),is_movable:E.boolean().optional(),subcircuit_id:E.string().optional()}),lXt=yh.extend({type:E.literal("schematic_error"),schematic_error_id:E.string(),error_type:E.literal("schematic_port_not_found").default("schematic_port_not_found"),subcircuit_id:E.string().optional()}).describe("Defines a schematic error on the schematic"),hXt=yh.extend({type:E.literal("schematic_layout_error"),schematic_layout_error_id:yo("schematic_layout_error"),error_type:E.literal("schematic_layout_error").default("schematic_layout_error"),source_group_id:E.string(),schematic_group_id:E.string(),subcircuit_id:E.string().optional()}).describe("Error emitted when schematic layout fails for a group"),Ibe=E.object({type:E.literal("schematic_debug_object"),label:E.string().optional(),subcircuit_id:E.string().optional()}),dXt=Ibe.extend({shape:E.literal("rect"),center:Jr,size:hqe}),uXt=Ibe.extend({shape:E.literal("line"),start:Jr,end:Jr}),pXt=Ibe.extend({shape:E.literal("point"),center:Jr}),mXt=E.discriminatedUnion("shape",[dXt,uXt,pXt]),_Xt=E.object({type:E.literal("schematic_voltage_probe"),schematic_voltage_probe_id:E.string(),source_component_id:E.string().optional(),name:E.string().optional(),position:Jr,schematic_trace_id:E.string(),voltage:gB.optional(),subcircuit_id:E.string().optional(),color:E.string().optional(),label_alignment:vB.optional()}).describe("Defines a voltage probe measurement point on a schematic trace"),gXt=E.object({type:E.literal("schematic_manual_edit_conflict_warning"),schematic_manual_edit_conflict_warning_id:yo("schematic_manual_edit_conflict_warning"),warning_type:E.literal("schematic_manual_edit_conflict_warning").default("schematic_manual_edit_conflict_warning"),message:E.string(),schematic_component_id:E.string(),schematic_group_id:E.string().optional(),subcircuit_id:E.string().optional(),source_component_id:E.string()}).describe("Warning emitted when a component has both manual placement and explicit schX/schY coordinates"),AXt=E.object({type:E.literal("schematic_group"),schematic_group_id:yo("schematic_group"),source_group_id:E.string(),is_subcircuit:E.boolean().optional(),subcircuit_id:E.string().optional(),width:dr,height:dr,center:Jr,schematic_component_ids:E.array(E.string()),show_as_schematic_box:E.boolean().optional(),name:E.string().optional(),description:E.string().optional()}).describe("Defines a group of components on the schematic"),fXt=E.object({type:E.literal("schematic_table"),schematic_table_id:yo("schematic_table"),anchor_position:Jr,column_widths:E.array(qn),row_heights:E.array(qn),cell_padding:qn.optional(),border_width:qn.optional(),subcircuit_id:E.string().optional(),schematic_component_id:E.string().optional(),anchor:vB.optional()}).describe("Defines a table on the schematic"),yXt=E.object({type:E.literal("schematic_table_cell"),schematic_table_cell_id:yo("schematic_table_cell"),schematic_table_id:E.string(),start_row_index:E.number(),end_row_index:E.number(),start_column_index:E.number(),end_column_index:E.number(),text:E.string().optional(),center:Jr,width:qn,height:qn,horizontal_align:E.enum(["left","center","right"]).optional(),vertical_align:E.enum(["top","middle","bottom"]).optional(),font_size:qn.optional(),subcircuit_id:E.string().optional()}).describe("Defines a cell within a schematic_table"),xXt=E.object({type:E.literal("schematic_sheet"),schematic_sheet_id:yo("schematic_sheet"),name:E.string().optional(),subcircuit_id:E.string().optional()}).describe("Defines a schematic sheet or page that components can be placed on"),CXt=E.object({x:qn,y:qn,bulge:E.number().optional()}),Zje=E.object({vertices:E.array(CXt)}),bXt=E.object({outer_ring:Zje,inner_rings:E.array(Zje).default([])}),IXt=E.object({x:qn,y:qn,via:E.boolean().optional(),via_to_layer:Tc.optional()}),Y_r=E.array(IXt),vXt=E.object({x:qn,y:qn,via:E.boolean().optional(),to_layer:Tc.optional(),trace_width:qn.optional()}),SXt=E.object({min_trace_width:dr.optional(),min_board_edge_clearance:dr.optional(),min_via_hole_edge_to_via_hole_edge_clearance:dr.optional(),min_plated_hole_drill_edge_to_drill_edge_clearance:dr.optional(),min_trace_to_pad_edge_clearance:dr.optional(),min_pad_edge_to_pad_edge_clearance:dr.optional(),min_same_net_trace_edge_to_trace_edge_clearance:dr.optional(),min_different_net_trace_edge_to_trace_edge_clearance:dr.optional(),min_via_hole_diameter:dr.optional(),min_via_pad_diameter:dr.optional()}),PXt=E.object({type:E.literal("pcb_component"),pcb_component_id:yo("pcb_component"),source_component_id:E.string(),center:Jr,layer:Tc,rotation:Ym,display_offset_x:E.string().optional().describe("How to display the x offset for this part, usually corresponding with how the user specified it"),display_offset_y:E.string().optional().describe("How to display the y offset for this part, usually corresponding with how the user specified it"),width:dr,height:dr,do_not_place:E.boolean().optional(),is_allowed_to_be_off_board:E.boolean().optional(),subcircuit_id:E.string().optional(),pcb_group_id:E.string().optional(),position_mode:E.enum(["packed","relative_to_group_anchor","relative_to_another_component","none"]).optional(),anchor_position:Jr.optional(),anchor_alignment:vB.optional(),positioned_relative_to_pcb_group_id:E.string().optional(),positioned_relative_to_pcb_board_id:E.string().optional(),cable_insertion_center:Jr.optional(),insertion_direction:E.enum(["from_above","from_left","from_right","from_front","from_back"]).optional(),metadata:E.object({kicad_footprint:pWt.optional()}).optional(),obstructs_within_bounds:E.boolean().default(!0).describe("Does this component take up all the space within its bounds on a layer. This is generally true except for when separated pin headers are being represented by a single component (in which case, chips can be placed between the pin headers) or for tall modules where chips fit underneath")}).describe("Defines a component on the PCB"),EXt=E.object({type:E.literal("pcb_hole"),pcb_hole_id:yo("pcb_hole"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),pcb_component_id:E.string().optional(),hole_shape:E.literal("circle"),hole_diameter:E.number(),x:qn,y:qn,is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional()}),G_r=EXt.describe("Defines a circular hole on the PCB"),MXt=E.object({type:E.literal("pcb_hole"),pcb_hole_id:yo("pcb_hole"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),pcb_component_id:E.string().optional(),hole_shape:E.literal("rect"),hole_width:E.number(),hole_height:E.number(),x:qn,y:qn,is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional()}),U_r=MXt.describe("Defines a rectangular (square-capable) hole on the PCB. Use equal width/height for square."),wXt=E.object({type:E.literal("pcb_hole"),pcb_hole_id:yo("pcb_hole"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),pcb_component_id:E.string().optional(),hole_shape:E.enum(["circle","square"]),hole_diameter:E.number(),x:qn,y:qn,is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional()}),W_r=wXt.describe("Defines a circular or square hole on the PCB"),BXt=E.object({type:E.literal("pcb_hole"),pcb_hole_id:yo("pcb_hole"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),pcb_component_id:E.string().optional(),hole_shape:E.literal("oval"),hole_width:E.number(),hole_height:E.number(),x:qn,y:qn,is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional()}),X_r=BXt.describe("Defines an oval hole on the PCB"),TXt=E.object({type:E.literal("pcb_hole"),pcb_hole_id:yo("pcb_hole"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),pcb_component_id:E.string().optional(),hole_shape:E.literal("pill"),hole_width:E.number(),hole_height:E.number(),x:qn,y:qn,is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional()}),j_r=TXt.describe("Defines a pill-shaped hole on the PCB"),DXt=E.object({type:E.literal("pcb_hole"),pcb_hole_id:yo("pcb_hole"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),pcb_component_id:E.string().optional(),hole_shape:E.literal("rotated_pill"),hole_width:E.number(),hole_height:E.number(),x:qn,y:qn,ccw_rotation:Ym,is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional()}),K_r=DXt.describe("Defines a rotated pill-shaped hole on the PCB"),NXt=wXt.or(BXt).or(TXt).or(DXt).or(EXt).or(MXt),$_r=E.object({type:E.literal("pcb_plated_hole"),shape:E.literal("circle"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),outer_diameter:E.number(),hole_diameter:E.number(),is_covered_with_solder_mask:E.boolean().optional(),x:qn,y:qn,layers:E.array(Tc),port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),pcb_plated_hole_id:yo("pcb_plated_hole"),soldermask_margin:E.number().optional()}),q_r=E.object({type:E.literal("pcb_plated_hole"),shape:E.enum(["oval","pill"]),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),outer_width:E.number(),outer_height:E.number(),hole_width:E.number(),hole_height:E.number(),is_covered_with_solder_mask:E.boolean().optional(),x:qn,y:qn,ccw_rotation:Ym,layers:E.array(Tc),port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),pcb_plated_hole_id:yo("pcb_plated_hole"),soldermask_margin:E.number().optional()}),J_r=E.object({type:E.literal("pcb_plated_hole"),shape:E.literal("circular_hole_with_rect_pad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),hole_shape:E.literal("circle"),pad_shape:E.literal("rect"),hole_diameter:E.number(),rect_pad_width:E.number(),rect_pad_height:E.number(),rect_border_radius:E.number().optional(),hole_offset_x:qn.default(0),hole_offset_y:qn.default(0),is_covered_with_solder_mask:E.boolean().optional(),x:qn,y:qn,layers:E.array(Tc),port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),pcb_plated_hole_id:yo("pcb_plated_hole"),soldermask_margin:E.number().optional(),rect_ccw_rotation:Ym.optional()}),Z_r=E.object({type:E.literal("pcb_plated_hole"),shape:E.literal("pill_hole_with_rect_pad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),hole_shape:E.literal("pill"),pad_shape:E.literal("rect"),hole_width:E.number(),hole_height:E.number(),rect_pad_width:E.number(),rect_pad_height:E.number(),rect_border_radius:E.number().optional(),hole_offset_x:qn.default(0),hole_offset_y:qn.default(0),is_covered_with_solder_mask:E.boolean().optional(),x:qn,y:qn,layers:E.array(Tc),port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),pcb_plated_hole_id:yo("pcb_plated_hole"),soldermask_margin:E.number().optional()}),egr=E.object({type:E.literal("pcb_plated_hole"),shape:E.literal("rotated_pill_hole_with_rect_pad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),hole_shape:E.literal("rotated_pill"),pad_shape:E.literal("rect"),hole_width:E.number(),hole_height:E.number(),hole_ccw_rotation:Ym,rect_pad_width:E.number(),rect_pad_height:E.number(),rect_border_radius:E.number().optional(),rect_ccw_rotation:Ym,hole_offset_x:qn.default(0),hole_offset_y:qn.default(0),is_covered_with_solder_mask:E.boolean().optional(),x:qn,y:qn,layers:E.array(Tc),port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),pcb_plated_hole_id:yo("pcb_plated_hole"),soldermask_margin:E.number().optional()}),tgr=E.object({type:E.literal("pcb_plated_hole"),shape:E.literal("hole_with_polygon_pad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),hole_shape:E.enum(["circle","oval","pill","rotated_pill"]),hole_diameter:E.number().optional(),hole_width:E.number().optional(),hole_height:E.number().optional(),pad_outline:E.array(E.object({x:qn,y:qn})).min(3),hole_offset_x:qn.default(0),hole_offset_y:qn.default(0),is_covered_with_solder_mask:E.boolean().optional(),x:qn,y:qn,layers:E.array(Tc),port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),pcb_plated_hole_id:yo("pcb_plated_hole"),soldermask_margin:E.number().optional(),ccw_rotation:Ym.optional()}),RXt=E.union([$_r,q_r,J_r,Z_r,egr,tgr]),QXt=E.object({type:E.literal("pcb_port"),pcb_port_id:yo("pcb_port"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),source_port_id:E.string(),pcb_component_id:E.string().optional(),x:qn,y:qn,layers:E.array(Tc),is_board_pinout:E.boolean().optional()}).describe("Defines a port on the PCB"),ngr=E.object({type:E.literal("pcb_smtpad"),shape:E.literal("circle"),pcb_smtpad_id:yo("pcb_smtpad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:qn,y:qn,radius:E.number(),layer:Tc,port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional()}),ogr=E.object({type:E.literal("pcb_smtpad"),shape:E.literal("rect"),pcb_smtpad_id:yo("pcb_smtpad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:qn,y:qn,width:E.number(),height:E.number(),rect_border_radius:E.number().optional(),corner_radius:E.number().optional(),layer:Tc,port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional(),soldermask_margin_left:E.number().optional(),soldermask_margin_top:E.number().optional(),soldermask_margin_right:E.number().optional(),soldermask_margin_bottom:E.number().optional()}),rgr=E.object({type:E.literal("pcb_smtpad"),shape:E.literal("rotated_rect"),pcb_smtpad_id:yo("pcb_smtpad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:qn,y:qn,width:E.number(),height:E.number(),rect_border_radius:E.number().optional(),corner_radius:E.number().optional(),ccw_rotation:Ym,layer:Tc,port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional(),soldermask_margin_left:E.number().optional(),soldermask_margin_top:E.number().optional(),soldermask_margin_right:E.number().optional(),soldermask_margin_bottom:E.number().optional()}),kXt=E.object({type:E.literal("pcb_smtpad"),shape:E.literal("pill"),pcb_smtpad_id:yo("pcb_smtpad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:qn,y:qn,width:E.number(),height:E.number(),radius:E.number(),layer:Tc,port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional()}),igr=E.object({type:E.literal("pcb_smtpad"),shape:E.literal("rotated_pill"),pcb_smtpad_id:yo("pcb_smtpad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:qn,y:qn,width:E.number(),height:E.number(),radius:E.number(),ccw_rotation:Ym,layer:Tc,port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional()}),sgr=E.object({type:E.literal("pcb_smtpad"),shape:E.literal("polygon"),pcb_smtpad_id:yo("pcb_smtpad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),points:E.array(Jr),layer:Tc,port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional()}),LXt=E.discriminatedUnion("shape",[ngr,ogr,rgr,igr,kXt,sgr]).describe("Defines an SMT pad on the PCB"),agr=E.object({type:E.literal("pcb_solder_paste"),shape:E.literal("circle"),pcb_solder_paste_id:yo("pcb_solder_paste"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:qn,y:qn,radius:E.number(),layer:Tc,pcb_component_id:E.string().optional(),pcb_smtpad_id:E.string().optional()}),cgr=E.object({type:E.literal("pcb_solder_paste"),shape:E.literal("rect"),pcb_solder_paste_id:yo("pcb_solder_paste"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:qn,y:qn,width:E.number(),height:E.number(),layer:Tc,pcb_component_id:E.string().optional(),pcb_smtpad_id:E.string().optional()}),lgr=E.object({type:E.literal("pcb_solder_paste"),shape:E.literal("pill"),pcb_solder_paste_id:yo("pcb_solder_paste"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:qn,y:qn,width:E.number(),height:E.number(),radius:E.number(),layer:Tc,pcb_component_id:E.string().optional(),pcb_smtpad_id:E.string().optional()}),hgr=E.object({type:E.literal("pcb_solder_paste"),shape:E.literal("rotated_rect"),pcb_solder_paste_id:yo("pcb_solder_paste"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:qn,y:qn,width:E.number(),height:E.number(),ccw_rotation:qn,layer:Tc,pcb_component_id:E.string().optional(),pcb_smtpad_id:E.string().optional()}),dgr=E.object({type:E.literal("pcb_solder_paste"),shape:E.literal("oval"),pcb_solder_paste_id:yo("pcb_solder_paste"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:qn,y:qn,width:E.number(),height:E.number(),layer:Tc,pcb_component_id:E.string().optional(),pcb_smtpad_id:E.string().optional()}),HXt=E.union([agr,cgr,lgr,hgr,dgr]).describe("Defines solderpaste on the PCB"),FXt=E.object({type:E.literal("pcb_text"),pcb_text_id:yo("pcb_text"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),text:E.string(),center:Jr,layer:Tc,width:dr,height:dr,lines:E.number(),align:E.enum(["bottom-left"])}).describe("Defines text on the PCB"),zXt=E.object({route_type:E.literal("wire"),x:qn,y:qn,width:qn,copper_pour_id:E.string().optional(),is_inside_copper_pour:E.boolean().optional(),start_pcb_port_id:E.string().optional(),end_pcb_port_id:E.string().optional(),layer:Tc}),OXt=E.object({route_type:E.literal("via"),x:qn,y:qn,copper_pour_id:E.string().optional(),is_inside_copper_pour:E.boolean().optional(),hole_diameter:qn.optional(),outer_diameter:qn.optional(),from_layer:Tc,to_layer:Tc}),VXt=E.union([zXt,OXt]),YXt=E.object({type:E.literal("pcb_trace"),source_trace_id:E.string().optional(),pcb_component_id:E.string().optional(),pcb_trace_id:yo("pcb_trace"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),route_thickness_mode:E.enum(["constant","interpolated"]).default("constant").optional(),route_order_index:E.number().optional(),should_round_corners:E.boolean().optional(),trace_length:E.number().optional(),highlight_color:E.string().optional(),route:E.array(VXt)}).describe("Defines a trace on the PCB"),GXt=E.object({type:E.literal("pcb_trace_warning"),pcb_trace_warning_id:yo("pcb_trace_warning"),warning_type:E.literal("pcb_trace_warning").default("pcb_trace_warning"),message:E.string(),center:Jr.optional(),pcb_trace_id:E.string(),source_trace_id:E.string(),pcb_component_ids:E.array(E.string()),pcb_port_ids:E.array(E.string()),subcircuit_id:E.string().optional()}).describe("Defines a trace warning on the PCB"),UXt=yh.extend({type:E.literal("pcb_trace_error"),pcb_trace_error_id:yo("pcb_trace_error"),error_type:E.literal("pcb_trace_error").default("pcb_trace_error"),center:Jr.optional(),pcb_trace_id:E.string(),source_trace_id:E.string(),pcb_component_ids:E.array(E.string()),pcb_port_ids:E.array(E.string()),subcircuit_id:E.string().optional()}).describe("Defines a trace error on the PCB"),WXt=yh.extend({type:E.literal("pcb_trace_missing_error"),pcb_trace_missing_error_id:yo("pcb_trace_missing_error"),error_type:E.literal("pcb_trace_missing_error").default("pcb_trace_missing_error"),center:Jr.optional(),source_trace_id:E.string(),pcb_component_ids:E.array(E.string()),pcb_port_ids:E.array(E.string()),subcircuit_id:E.string().optional()}).describe("Defines an error when a source trace has no corresponding PCB trace"),XXt=yh.extend({type:E.literal("pcb_port_not_matched_error"),pcb_error_id:yo("pcb_error"),error_type:E.literal("pcb_port_not_matched_error").default("pcb_port_not_matched_error"),pcb_component_ids:E.array(E.string()),subcircuit_id:E.string().optional()}).describe("Defines a trace error on the PCB where a port is not matched"),jXt=yh.extend({type:E.literal("pcb_port_not_connected_error"),pcb_port_not_connected_error_id:yo("pcb_port_not_connected_error"),error_type:E.literal("pcb_port_not_connected_error").default("pcb_port_not_connected_error"),pcb_port_ids:E.array(E.string()),pcb_component_ids:E.array(E.string()),subcircuit_id:E.string().optional()}).describe("Defines an error when a pcb port is not connected to any trace"),KXt=E.object({type:E.literal("pcb_net"),pcb_net_id:yo("pcb_net"),source_net_id:E.string().optional(),highlight_color:E.string().optional()}).describe("Defines a net on the PCB"),$Xt=E.object({type:E.literal("pcb_via"),pcb_via_id:yo("pcb_via"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),subcircuit_connectivity_map_key:E.string().optional(),x:qn,y:qn,outer_diameter:qn.default("0.6mm"),hole_diameter:qn.default("0.25mm"),from_layer:Tc.optional(),to_layer:Tc.optional(),layers:E.array(Tc),pcb_trace_id:E.string().optional(),net_is_assignable:E.boolean().optional(),net_assigned:E.boolean().optional(),is_tented:E.boolean().optional()}).describe("Defines a via on the PCB"),qXt=E.object({type:E.literal("pcb_board"),pcb_board_id:yo("pcb_board"),pcb_panel_id:E.string().optional(),carrier_pcb_board_id:E.string().optional(),is_subcircuit:E.boolean().optional(),subcircuit_id:E.string().optional(),is_mounted_to_carrier_board:E.boolean().optional(),width:dr.optional(),height:dr.optional(),center:Jr,display_offset_x:E.string().optional().describe("How to display the x offset for this board, usually corresponding with how the user specified it"),display_offset_y:E.string().optional().describe("How to display the y offset for this board, usually corresponding with how the user specified it"),thickness:dr.optional().default(1.4),num_layers:E.number().optional().default(4),outline:E.array(Jr).optional(),shape:E.enum(["rect","polygon"]).optional(),material:E.enum(["fr4","fr1"]).default("fr4"),anchor_position:Jr.optional(),anchor_alignment:vB.optional(),position_mode:E.enum(["relative_to_panel_anchor","none"]).optional()}).merge(SXt).describe("Defines the board outline of the PCB"),JXt=E.object({type:E.literal("pcb_panel"),pcb_panel_id:yo("pcb_panel"),width:dr,height:dr,center:Jr,thickness:dr.optional().default(1.4),covered_with_solder_mask:E.boolean().optional().default(!0)}).describe("Defines a PCB panel that can contain multiple boards"),ZXt=yh.extend({type:E.literal("pcb_placement_error"),pcb_placement_error_id:yo("pcb_placement_error"),error_type:E.literal("pcb_placement_error").default("pcb_placement_error"),subcircuit_id:E.string().optional()}).describe("Defines a placement error on the PCB"),ejt=yh.extend({type:E.literal("pcb_panelization_placement_error"),pcb_panelization_placement_error_id:yo("pcb_panelization_placement_error"),error_type:E.literal("pcb_panelization_placement_error").default("pcb_panelization_placement_error"),pcb_panel_id:E.string().optional(),pcb_board_id:E.string().optional(),subcircuit_id:E.string().optional()}).describe("Defines a panelization placement error on the PCB"),tjt=E.object({type:E.literal("pcb_trace_hint"),pcb_trace_hint_id:yo("pcb_trace_hint"),pcb_port_id:E.string(),pcb_component_id:E.string(),route:E.array(vXt),subcircuit_id:E.string().optional()}).describe("A hint that can be used during generation of a PCB trace"),njt=E.object({type:E.literal("pcb_silkscreen_line"),pcb_silkscreen_line_id:yo("pcb_silkscreen_line"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),stroke_width:qn.default("0.1mm"),x1:qn,y1:qn,x2:qn,y2:qn,layer:d2}).describe("Defines a silkscreen line on the PCB"),ojt=E.object({type:E.literal("pcb_silkscreen_path"),pcb_silkscreen_path_id:yo("pcb_silkscreen_path"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),layer:d2,route:E.array(Jr),stroke_width:dr}).describe("Defines a silkscreen path on the PCB"),rjt=E.object({type:E.literal("pcb_silkscreen_text"),pcb_silkscreen_text_id:yo("pcb_silkscreen_text"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),font:E.literal("tscircuit2024").default("tscircuit2024"),font_size:qn.default("0.2mm"),pcb_component_id:E.string(),text:E.string(),is_knockout:E.boolean().default(!1).optional(),knockout_padding:E.object({left:dr,top:dr,bottom:dr,right:dr}).default({left:"0.2mm",top:"0.2mm",bottom:"0.2mm",right:"0.2mm"}).optional(),ccw_rotation:E.number().optional(),layer:Tc,is_mirrored:E.boolean().default(!1).optional(),anchor_position:Jr.default({x:0,y:0}),anchor_alignment:vB.default("center")}).describe("Defines silkscreen text on the PCB"),ijt=E.object({type:E.literal("pcb_copper_text"),pcb_copper_text_id:yo("pcb_copper_text"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),font:E.literal("tscircuit2024").default("tscircuit2024"),font_size:qn.default("0.2mm"),pcb_component_id:E.string(),text:E.string(),is_knockout:E.boolean().default(!1).optional(),knockout_padding:E.object({left:dr,top:dr,bottom:dr,right:dr}).default({left:"0.2mm",top:"0.2mm",bottom:"0.2mm",right:"0.2mm"}).optional(),ccw_rotation:E.number().optional(),layer:Tc,is_mirrored:E.boolean().default(!1).optional(),anchor_position:Jr.default({x:0,y:0}),anchor_alignment:vB.default("center")}).describe("Defines copper text on the PCB"),sjt=E.object({type:E.literal("pcb_silkscreen_rect"),pcb_silkscreen_rect_id:yo("pcb_silkscreen_rect"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),center:Jr,width:dr,height:dr,layer:Tc,stroke_width:dr.default("1mm"),corner_radius:dr.optional(),is_filled:E.boolean().default(!0).optional(),has_stroke:E.boolean().optional(),is_stroke_dashed:E.boolean().optional(),ccw_rotation:E.number().optional()}).describe("Defines a silkscreen rect on the PCB"),ajt=E.object({type:E.literal("pcb_silkscreen_circle"),pcb_silkscreen_circle_id:yo("pcb_silkscreen_circle"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),center:Jr,radius:dr,layer:d2,stroke_width:dr.default("1mm"),is_filled:E.boolean().optional()}).describe("Defines a silkscreen circle on the PCB"),cjt=E.object({type:E.literal("pcb_silkscreen_oval"),pcb_silkscreen_oval_id:yo("pcb_silkscreen_oval"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),center:Jr,radius_x:qn,radius_y:qn,layer:d2,ccw_rotation:Ym.optional()}).describe("Defines a silkscreen oval on the PCB"),ljt=E.object({type:E.literal("pcb_silkscreen_pill"),pcb_silkscreen_pill_id:yo("pcb_silkscreen_pill"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),center:Jr,width:dr,height:dr,layer:Tc,ccw_rotation:E.number().optional()}).describe("Defines a silkscreen pill on the PCB"),hjt=E.object({type:E.literal("pcb_fabrication_note_text"),pcb_fabrication_note_text_id:yo("pcb_fabrication_note_text"),subcircuit_id:E.string().optional(),pcb_group_id:E.string().optional(),font:E.literal("tscircuit2024").default("tscircuit2024"),font_size:qn.default("1mm"),pcb_component_id:E.string(),text:E.string(),layer:d2,anchor_position:Jr.default({x:0,y:0}),anchor_alignment:E.enum(["center","top_left","top_right","bottom_left","bottom_right"]).default("center"),color:E.string().optional()}).describe("Defines a fabrication note in text on the PCB, useful for leaving notes for assemblers or fabricators"),djt=E.object({type:E.literal("pcb_fabrication_note_path"),pcb_fabrication_note_path_id:yo("pcb_fabrication_note_path"),pcb_component_id:E.string(),subcircuit_id:E.string().optional(),layer:Tc,route:E.array(Jr),stroke_width:dr,color:E.string().optional()}).describe("Defines a fabrication path on the PCB for fabricators or assemblers"),ujt=E.object({type:E.literal("pcb_fabrication_note_rect"),pcb_fabrication_note_rect_id:yo("pcb_fabrication_note_rect"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),center:Jr,width:dr,height:dr,layer:d2,stroke_width:dr.default("0.1mm"),corner_radius:dr.optional(),is_filled:E.boolean().optional(),has_stroke:E.boolean().optional(),is_stroke_dashed:E.boolean().optional(),color:E.string().optional()}).describe("Defines a fabrication note rectangle on the PCB"),pjt=E.object({type:E.literal("pcb_fabrication_note_dimension"),pcb_fabrication_note_dimension_id:yo("pcb_fabrication_note_dimension"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),layer:d2,from:Jr,to:Jr,text:E.string().optional(),text_ccw_rotation:E.number().optional(),offset:dr.optional(),offset_distance:dr.optional(),offset_direction:E.object({x:E.number(),y:E.number()}).optional(),font:E.literal("tscircuit2024").default("tscircuit2024"),font_size:dr.default("1mm"),color:E.string().optional(),arrow_size:dr.default("1mm")}).describe("Defines a measurement annotation within PCB fabrication notes"),mjt=E.object({type:E.literal("pcb_note_text"),pcb_note_text_id:yo("pcb_note_text"),pcb_component_id:E.string().optional(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),name:E.string().optional(),font:E.literal("tscircuit2024").default("tscircuit2024"),font_size:qn.default("1mm"),text:E.string().optional(),anchor_position:Jr.default({x:0,y:0}),anchor_alignment:E.enum(["center","top_left","top_right","bottom_left","bottom_right"]).default("center"),layer:d2.default("top"),is_mirrored_from_top_view:E.boolean().optional(),color:E.string().optional()}).describe("Defines a documentation note in text on the PCB"),_jt=E.object({type:E.literal("pcb_note_rect"),pcb_note_rect_id:yo("pcb_note_rect"),pcb_component_id:E.string().optional(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),name:E.string().optional(),text:E.string().optional(),center:Jr,width:dr,height:dr,layer:d2.default("top"),stroke_width:dr.default("0.1mm"),corner_radius:dr.optional(),is_filled:E.boolean().optional(),has_stroke:E.boolean().optional(),is_stroke_dashed:E.boolean().optional(),color:E.string().optional()}).describe("Defines a rectangular documentation note on the PCB"),gjt=E.object({type:E.literal("pcb_note_path"),pcb_note_path_id:yo("pcb_note_path"),pcb_component_id:E.string().optional(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),name:E.string().optional(),text:E.string().optional(),route:E.array(Jr),layer:d2.default("top"),stroke_width:dr.default("0.1mm"),color:E.string().optional()}).describe("Defines a polyline documentation note on the PCB"),Ajt=E.object({type:E.literal("pcb_note_line"),pcb_note_line_id:yo("pcb_note_line"),pcb_component_id:E.string().optional(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),name:E.string().optional(),text:E.string().optional(),x1:qn,y1:qn,x2:qn,y2:qn,layer:d2.default("top"),stroke_width:qn.default("0.1mm"),color:E.string().optional(),is_dashed:E.boolean().optional()}).describe("Defines a straight documentation note line on the PCB"),fjt=E.object({type:E.literal("pcb_note_dimension"),pcb_note_dimension_id:yo("pcb_note_dimension"),pcb_component_id:E.string().optional(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),name:E.string().optional(),from:Jr,to:Jr,text:E.string().optional(),text_ccw_rotation:E.number().optional(),offset_distance:dr.optional(),offset_direction:E.object({x:E.number(),y:E.number()}).optional(),font:E.literal("tscircuit2024").default("tscircuit2024"),font_size:dr.default("1mm"),layer:d2.default("top"),color:E.string().optional(),arrow_size:dr.default("1mm")}).describe("Defines a measurement annotation within PCB documentation notes"),yjt=yh.extend({type:E.literal("pcb_footprint_overlap_error"),pcb_error_id:yo("pcb_error"),error_type:E.literal("pcb_footprint_overlap_error").default("pcb_footprint_overlap_error"),pcb_smtpad_ids:E.array(E.string()).optional(),pcb_plated_hole_ids:E.array(E.string()).optional(),pcb_hole_ids:E.array(E.string()).optional(),pcb_keepout_ids:E.array(E.string()).optional()}).describe("Error emitted when a pcb footprint overlaps with another element"),xjt=yh.extend({type:E.literal("pcb_courtyard_overlap_error"),pcb_error_id:yo("pcb_error"),error_type:E.literal("pcb_courtyard_overlap_error").default("pcb_courtyard_overlap_error"),pcb_component_ids:E.tuple([E.string(),E.string()])}).describe("Error emitted when the courtyard (CrtYd) of one PCB component overlaps with the courtyard of another"),Cjt=E.object({type:E.literal("pcb_keepout"),shape:E.literal("rect"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),center:Jr,width:qn,height:qn,pcb_keepout_id:E.string(),layers:E.array(E.string()),description:E.string().optional()}).or(E.object({type:E.literal("pcb_keepout"),shape:E.literal("circle"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),center:Jr,radius:qn,pcb_keepout_id:E.string(),layers:E.array(E.string()),description:E.string().optional()})),vbe=E.object({type:E.literal("pcb_cutout"),pcb_cutout_id:yo("pcb_cutout"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),pcb_board_id:E.string().optional(),pcb_panel_id:E.string().optional()}),bjt=vbe.extend({shape:E.literal("rect"),center:Jr,width:dr,height:dr,rotation:Ym.optional(),corner_radius:dr.optional()}),Ijt=vbe.extend({shape:E.literal("circle"),center:Jr,radius:dr}),vjt=vbe.extend({shape:E.literal("polygon"),points:E.array(Jr)}),Sjt=vbe.extend({shape:E.literal("path"),route:E.array(Jr),slot_width:dr,slot_length:dr.optional(),space_between_slots:dr.optional(),slot_corner_radius:dr.optional()}),Pjt=E.discriminatedUnion("shape",[bjt,Ijt,vjt,Sjt]).describe("Defines a cutout on the PCB, removing board material."),Ejt=yh.extend({type:E.literal("pcb_missing_footprint_error"),pcb_missing_footprint_error_id:yo("pcb_missing_footprint_error"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),error_type:E.literal("pcb_missing_footprint_error").default("pcb_missing_footprint_error"),source_component_id:E.string()}).describe("Defines a missing footprint error on the PCB"),Mjt=yh.extend({type:E.literal("external_footprint_load_error"),external_footprint_load_error_id:yo("external_footprint_load_error"),pcb_component_id:E.string(),source_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),footprinter_string:E.string().optional(),error_type:E.literal("external_footprint_load_error").default("external_footprint_load_error")}).describe("Defines an error when an external footprint fails to load"),wjt=yh.extend({type:E.literal("circuit_json_footprint_load_error"),circuit_json_footprint_load_error_id:yo("circuit_json_footprint_load_error"),pcb_component_id:E.string(),source_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),error_type:E.literal("circuit_json_footprint_load_error").default("circuit_json_footprint_load_error"),circuit_json:E.array(E.any()).optional()}).describe("Defines an error when a circuit JSON footprint fails to load"),Bjt=E.object({type:E.literal("pcb_group"),pcb_group_id:yo("pcb_group"),source_group_id:E.string(),is_subcircuit:E.boolean().optional(),subcircuit_id:E.string().optional(),width:dr.optional(),height:dr.optional(),center:Jr,display_offset_x:E.string().optional().describe("How to display the x offset for this group, usually corresponding with how the user specified it"),display_offset_y:E.string().optional().describe("How to display the y offset for this group, usually corresponding with how the user specified it"),outline:E.array(Jr).optional(),anchor_position:Jr.optional(),anchor_alignment:vB.default("center"),position_mode:E.enum(["packed","relative_to_group_anchor","none"]).optional(),positioned_relative_to_pcb_group_id:E.string().optional(),positioned_relative_to_pcb_board_id:E.string().optional(),pcb_component_ids:E.array(E.string()),child_layout_mode:E.enum(["packed","none"]).optional(),name:E.string().optional(),description:E.string().optional(),layout_mode:E.string().optional(),autorouter_configuration:E.object({trace_clearance:dr}).optional(),autorouter_used_string:E.string().optional()}).describe("Defines a group of components on the PCB"),Tjt=yh.extend({type:E.literal("pcb_autorouting_error"),pcb_error_id:yo("pcb_autorouting_error"),error_type:E.literal("pcb_autorouting_error").default("pcb_autorouting_error"),subcircuit_id:E.string().optional()}).describe("The autorouting has failed to route a portion of the board"),Djt=E.object({type:E.literal("pcb_manual_edit_conflict_warning"),pcb_manual_edit_conflict_warning_id:yo("pcb_manual_edit_conflict_warning"),warning_type:E.literal("pcb_manual_edit_conflict_warning").default("pcb_manual_edit_conflict_warning"),message:E.string(),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),source_component_id:E.string()}).describe("Warning emitted when a component has both manual placement and explicit pcbX/pcbY coordinates"),fHt=E.enum(["x-","x+","y+","y-"]),Njt=E.object({type:E.literal("pcb_connector_not_in_accessible_orientation_warning"),pcb_connector_not_in_accessible_orientation_warning_id:yo("pcb_connector_not_in_accessible_orientation_warning"),warning_type:E.literal("pcb_connector_not_in_accessible_orientation_warning").default("pcb_connector_not_in_accessible_orientation_warning"),message:E.string(),pcb_component_id:E.string(),source_component_id:E.string().optional(),pcb_board_id:E.string().optional(),facing_direction:fHt,recommended_facing_direction:fHt,subcircuit_id:E.string().optional()}).describe("Warning emitted when a connector PCB component is facing inward toward the board and should be reoriented to an outward-facing direction"),Rjt=E.object({type:E.literal("supplier_footprint_mismatch_warning"),supplier_footprint_mismatch_warning_id:yo("supplier_footprint_mismatch_warning"),warning_type:E.literal("supplier_footprint_mismatch_warning").default("supplier_footprint_mismatch_warning"),message:E.string(),source_component_id:E.string(),pcb_component_id:E.string().optional(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),supplier_name:uqe.optional(),supplier_part_number:E.string().optional(),supplier_footprint_url:E.string().optional(),footprint_copper_intersection_over_union:E.number()}).describe("Warning emitted when a supplier part footprint does not match the expected footprint"),Qjt=E.object({type:E.literal("pcb_breakout_point"),pcb_breakout_point_id:yo("pcb_breakout_point"),pcb_group_id:E.string(),subcircuit_id:E.string().optional(),source_trace_id:E.string().optional(),source_port_id:E.string().optional(),source_net_id:E.string().optional(),x:qn,y:qn}).describe("Defines a routing target within a pcb_group for a source_trace or source_net"),kjt=E.object({type:E.literal("pcb_ground_plane"),pcb_ground_plane_id:yo("pcb_ground_plane"),source_pcb_ground_plane_id:E.string(),source_net_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional()}).describe("Defines a ground plane on the PCB"),Ljt=E.object({type:E.literal("pcb_ground_plane_region"),pcb_ground_plane_region_id:yo("pcb_ground_plane_region"),pcb_ground_plane_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),layer:Tc,points:E.array(Jr)}).describe("Defines a polygon region of a ground plane"),Hjt=E.object({type:E.literal("pcb_thermal_spoke"),pcb_thermal_spoke_id:yo("pcb_thermal_spoke"),pcb_ground_plane_id:E.string(),shape:E.string(),spoke_count:E.number(),spoke_thickness:qn,spoke_inner_diameter:qn,spoke_outer_diameter:qn,pcb_plated_hole_id:E.string().optional(),subcircuit_id:E.string().optional()}).describe("Pattern for connecting a ground plane to a plated hole"),kqe=E.object({type:E.literal("pcb_copper_pour"),pcb_copper_pour_id:yo("pcb_copper_pour"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),layer:Tc,source_net_id:E.string().optional(),covered_with_solder_mask:E.boolean().optional().default(!0)}),Fjt=kqe.extend({shape:E.literal("rect"),center:Jr,width:dr,height:dr,rotation:Ym.optional()}),zjt=kqe.extend({shape:E.literal("brep"),brep_shape:bXt}),Ojt=kqe.extend({shape:E.literal("polygon"),points:E.array(Jr)}),Vjt=E.discriminatedUnion("shape",[Fjt,zjt,Ojt]).describe("Defines a copper pour on the PCB."),Yjt=yh.extend({type:E.literal("pcb_component_outside_board_error"),pcb_component_outside_board_error_id:yo("pcb_component_outside_board_error"),error_type:E.literal("pcb_component_outside_board_error").default("pcb_component_outside_board_error"),pcb_component_id:E.string(),pcb_board_id:E.string(),component_center:Jr,component_bounds:E.object({min_x:E.number(),max_x:E.number(),min_y:E.number(),max_y:E.number()}),subcircuit_id:E.string().optional(),source_component_id:E.string().optional()}).describe("Error emitted when a PCB component is placed outside the board boundaries"),Gjt=yh.extend({type:E.literal("pcb_component_not_on_board_edge_error"),pcb_component_not_on_board_edge_error_id:yo("pcb_component_not_on_board_edge_error"),error_type:E.literal("pcb_component_not_on_board_edge_error").default("pcb_component_not_on_board_edge_error"),pcb_component_id:E.string(),pcb_board_id:E.string(),component_center:Jr,pad_to_nearest_board_edge_distance:E.number(),source_component_id:E.string().optional(),subcircuit_id:E.string().optional()}).describe("Error emitted when a component that must be placed on the board edge is centered away from the edge"),Ujt=yh.extend({type:E.literal("pcb_component_invalid_layer_error"),pcb_component_invalid_layer_error_id:yo("pcb_component_invalid_layer_error"),error_type:E.literal("pcb_component_invalid_layer_error").default("pcb_component_invalid_layer_error"),pcb_component_id:E.string().optional(),source_component_id:E.string(),layer:Tc,subcircuit_id:E.string().optional()}).describe("Error emitted when a component is placed on an invalid layer (components can only be on 'top' or 'bottom' layers)"),Wjt=yh.extend({type:E.literal("pcb_via_clearance_error"),pcb_error_id:yo("pcb_error"),error_type:E.literal("pcb_via_clearance_error").default("pcb_via_clearance_error"),pcb_via_ids:E.array(E.string()).min(2),minimum_clearance:qn.optional(),actual_clearance:qn.optional(),pcb_center:E.object({x:E.number().optional(),y:E.number().optional()}).optional(),subcircuit_id:E.string().optional()}).describe("Error emitted when vias are closer than the allowed clearance"),Xjt=yh.extend({type:E.literal("pcb_via_trace_clearance_error"),pcb_via_trace_clearance_error_id:yo("pcb_via_trace_clearance_error"),error_type:E.literal("pcb_via_trace_clearance_error").default("pcb_via_trace_clearance_error"),pcb_via_id:E.string(),pcb_trace_id:E.string(),minimum_clearance:qn.optional(),actual_clearance:qn.optional(),center:E.object({x:E.number().optional(),y:E.number().optional()}).optional(),subcircuit_id:E.string().optional()}).describe("Error emitted when a via and trace are closer than the allowed clearance"),jjt=yh.extend({type:E.literal("pcb_pad_pad_clearance_error"),pcb_pad_pad_clearance_error_id:yo("pcb_pad_pad_clearance_error"),error_type:E.literal("pcb_pad_pad_clearance_error").default("pcb_pad_pad_clearance_error"),pcb_pad_ids:E.array(E.string()).min(2),minimum_clearance:qn.optional(),actual_clearance:qn.optional(),center:E.object({x:E.number().optional(),y:E.number().optional()}).optional(),subcircuit_id:E.string().optional()}).describe("Error emitted when pads are closer than the allowed clearance"),Kjt=yh.extend({type:E.literal("pcb_pad_trace_clearance_error"),pcb_pad_trace_clearance_error_id:yo("pcb_pad_trace_clearance_error"),error_type:E.literal("pcb_pad_trace_clearance_error").default("pcb_pad_trace_clearance_error"),pcb_pad_id:E.string(),pcb_trace_id:E.string(),minimum_clearance:qn.optional(),actual_clearance:qn.optional(),center:E.object({x:E.number().optional(),y:E.number().optional()}).optional(),subcircuit_id:E.string().optional()}).describe("Error emitted when a pad and trace are closer than allowed clearance"),$jt=E.object({type:E.literal("pcb_courtyard_rect"),pcb_courtyard_rect_id:yo("pcb_courtyard_rect"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),center:Jr,width:dr,height:dr,layer:d2,ccw_rotation:Ym.optional(),color:E.string().optional()}).describe("Defines a courtyard rectangle on the PCB"),qjt=E.object({type:E.literal("pcb_courtyard_outline"),pcb_courtyard_outline_id:yo("pcb_courtyard_outline"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),layer:d2,outline:E.array(Jr).min(2)}).describe("Defines a courtyard outline on the PCB"),Jjt=E.object({type:E.literal("pcb_courtyard_polygon"),pcb_courtyard_polygon_id:yo("pcb_courtyard_polygon"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),layer:d2,points:E.array(Jr).min(3),color:E.string().optional()}).describe("Defines a courtyard polygon on the PCB"),Zjt=E.object({type:E.literal("pcb_courtyard_circle"),pcb_courtyard_circle_id:yo("pcb_courtyard_circle"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),center:Jr,radius:dr,layer:d2,color:E.string().optional()}).describe("Defines a courtyard circle on the PCB"),ugr=["obj","stl","3mf","gltf","glb","step","wrl"],eKt=["x+","x-","y+","y-","z+","z-"],pgr={obj:"z+",stl:"z+","3mf":"z+",gltf:"y+",glb:"y+",step:"z+",wrl:"y+"},tKt=E.object({type:E.literal("cad_component"),cad_component_id:E.string(),pcb_component_id:E.string(),source_component_id:E.string(),position:rB,rotation:rB.optional(),size:rB.optional(),layer:Tc.optional(),subcircuit_id:E.string().optional(),footprinter_string:E.string().optional(),model_obj_url:E.string().optional(),model_stl_url:E.string().optional(),model_3mf_url:E.string().optional(),model_gltf_url:E.string().optional(),model_glb_url:E.string().optional(),model_step_url:E.string().optional(),model_wrl_url:E.string().optional(),model_asset:aWt.optional(),model_unit_to_mm_scale_factor:E.number().optional(),model_board_normal_direction:E.enum(eKt).optional().describe(`The direction in the model's coordinate space that is considered "up" or "coming out of the board surface"`),model_origin_position:rB.optional(),model_origin_alignment:E.enum(["unknown","center","center_of_component_on_board_surface","bottom_center_of_component"]).optional(),model_object_fit:E.enum(["contain_within_bounds","fill_bounds"]).optional().default("contain_within_bounds"),model_jscad:E.any().optional(),show_as_translucent_model:E.boolean().optional(),anchor_alignment:E.enum(["center","center_of_component_on_board_surface"]).optional().default("center")}).describe("Defines a component on the PCB"),Lqe=E.enum(["sinewave","square","triangle","sawtooth"]),mgr=E.union([E.string(),E.number()]).transform((e)=>typeof e=="string"?e.endsWith("%")?parseFloat(e.slice(0,-1))/100:parseFloat(e):e).pipe(E.number().min(0,"Duty cycle must be non-negative").max(1,"Duty cycle cannot be greater than 100%")),nKt=E.object({type:E.literal("simulation_voltage_source"),simulation_voltage_source_id:yo("simulation_voltage_source"),is_dc_source:E.literal(!0).optional().default(!0),positive_source_port_id:E.string().optional(),negative_source_port_id:E.string().optional(),positive_source_net_id:E.string().optional(),negative_source_net_id:E.string().optional(),voltage:gB}).describe("Defines a DC voltage source for simulation"),oKt=E.object({type:E.literal("simulation_voltage_source"),simulation_voltage_source_id:yo("simulation_voltage_source"),is_dc_source:E.literal(!1),terminal1_source_port_id:E.string().optional(),terminal2_source_port_id:E.string().optional(),terminal1_source_net_id:E.string().optional(),terminal2_source_net_id:E.string().optional(),voltage:gB.optional(),frequency:nY.optional(),peak_to_peak_voltage:gB.optional(),wave_shape:Lqe.optional(),phase:Ym.optional(),duty_cycle:mgr.optional()}).describe("Defines an AC voltage source for simulation"),rKt=E.union([nKt,oKt]).describe("Defines a voltage source for simulation"),_gr=E.union([E.string(),E.number()]).transform((e)=>typeof e=="string"?e.endsWith("%")?parseFloat(e.slice(0,-1))/100:parseFloat(e):e).pipe(E.number().min(0,"Duty cycle must be non-negative").max(1,"Duty cycle cannot be greater than 100%")),iKt=E.object({type:E.literal("simulation_current_source"),simulation_current_source_id:yo("simulation_current_source"),is_dc_source:E.literal(!0).optional().default(!0),positive_source_port_id:E.string().optional(),negative_source_port_id:E.string().optional(),positive_source_net_id:E.string().optional(),negative_source_net_id:E.string().optional(),current:sq}).describe("Defines a DC current source for simulation"),sKt=E.object({type:E.literal("simulation_current_source"),simulation_current_source_id:yo("simulation_current_source"),is_dc_source:E.literal(!1),terminal1_source_port_id:E.string().optional(),terminal2_source_port_id:E.string().optional(),terminal1_source_net_id:E.string().optional(),terminal2_source_net_id:E.string().optional(),current:sq.optional(),frequency:nY.optional(),peak_to_peak_current:sq.optional(),wave_shape:Lqe.optional(),phase:Ym.optional(),duty_cycle:_gr.optional()}).describe("Defines an AC current source for simulation"),aKt=E.union([iKt,sKt]).describe("Defines a current source for simulation"),cKt=E.union([E.literal("spice_dc_sweep"),E.literal("spice_dc_operating_point"),E.literal("spice_transient_analysis"),E.literal("spice_ac_analysis")]),lKt=E.object({type:E.literal("simulation_experiment"),simulation_experiment_id:yo("simulation_experiment"),name:E.string(),experiment_type:cKt,time_per_step:Nle.optional(),start_time_ms:zV.optional(),end_time_ms:zV.optional()}).describe("Defines a simulation experiment configuration"),hKt=E.object({type:E.literal("simulation_transient_voltage_graph"),simulation_transient_voltage_graph_id:yo("simulation_transient_voltage_graph"),simulation_experiment_id:E.string(),timestamps_ms:E.array(E.number()).optional(),voltage_levels:E.array(E.number()),source_component_id:E.string().optional(),subcircuit_connectivity_map_key:E.string().optional(),time_per_step:Nle,start_time_ms:zV,end_time_ms:zV,name:E.string().optional(),color:E.string().optional()}).describe("Stores voltage measurements over time for a simulation"),dKt=E.object({type:E.literal("simulation_switch"),simulation_switch_id:yo("simulation_switch"),source_component_id:E.string().optional(),closes_at:zV.optional(),opens_at:zV.optional(),starts_closed:E.boolean().optional(),switching_frequency:nY.optional()}).describe("Defines a switch for simulation timing control"),uKt=E.object({type:E.literal("simulation_voltage_probe"),simulation_voltage_probe_id:yo("simulation_voltage_probe"),source_component_id:E.string().optional(),name:E.string().optional(),signal_input_source_port_id:E.string().optional(),signal_input_source_net_id:E.string().optional(),reference_input_source_port_id:E.string().optional(),reference_input_source_net_id:E.string().optional(),subcircuit_id:E.string().optional(),color:E.string().optional()}).describe("Defines a voltage probe for simulation. If a reference input is not provided, it measures against ground. If a reference input is provided, it measures the differential voltage between two points.").superRefine((e,t)=>{if(e.reference_input_source_port_id||e.reference_input_source_net_id){let n=!!e.signal_input_source_port_id||!!e.reference_input_source_port_id,o=!!e.signal_input_source_net_id||!!e.reference_input_source_net_id;n&&o?t.addIssue({code:E.ZodIssueCode.custom,message:"Cannot mix port and net connections in a differential probe."}):n?e.signal_input_source_port_id&&e.reference_input_source_port_id||t.addIssue({code:E.ZodIssueCode.custom,message:"Differential port probe requires both signal_input_source_port_id and reference_input_source_port_id."}):o&&(e.signal_input_source_net_id&&e.reference_input_source_net_id||t.addIssue({code:E.ZodIssueCode.custom,message:"Differential net probe requires both signal_input_source_net_id and reference_input_source_net_id."}))}else!!e.signal_input_source_port_id==!!e.signal_input_source_net_id&&t.addIssue({code:E.ZodIssueCode.custom,message:"A voltage probe must have exactly one of signal_input_source_port_id or signal_input_source_net_id."})}),pKt=yh.extend({type:E.literal("simulation_unknown_experiment_error"),simulation_unknown_experiment_error_id:yo("simulation_unknown_experiment_error"),error_type:E.literal("simulation_unknown_experiment_error").default("simulation_unknown_experiment_error"),simulation_experiment_id:E.string().optional(),subcircuit_id:E.string().optional()}).describe("An unknown error occurred during the simulation experiment."),mKt=E.object({type:E.literal("simulation_op_amp"),simulation_op_amp_id:yo("simulation_op_amp"),source_component_id:E.string().optional(),inverting_input_source_port_id:E.string(),non_inverting_input_source_port_id:E.string(),output_source_port_id:E.string(),positive_supply_source_port_id:E.string(),negative_supply_source_port_id:E.string()}).describe("Defines a simple ideal operational amplifier for simulation"),_Kt=E.union([RWt,DWt,NWt,TWt,kWt,QWt,gqe,pqe,bbe,_qe,mqe,Aqe,fqe,yqe,bqe,Iqe,vqe,wqe,Sqe,Pqe,Eqe,Mqe,Cqe,xqe,FWt,OWt,LWt,Bqe,Tqe,Dqe,Nqe,Rqe,VWt,YWt,GWt,UWt,WWt,Qqe,HWt,PXt,NXt,Ejt,Mjt,wjt,Djt,Njt,Rjt,RXt,Cjt,QXt,KXt,FXt,YXt,GXt,$Xt,LXt,HXt,qXt,JXt,Bjt,tjt,njt,ojt,rjt,ljt,ijt,sjt,ajt,cjt,UXt,WXt,ZXt,ejt,XXt,jXt,Wjt,Xjt,jjt,Kjt,djt,hjt,ujt,pjt,mjt,_jt,gjt,Ajt,fjt,Tjt,yjt,xjt,Qjt,Pjt,kjt,Ljt,Hjt,Vjt,Yjt,Gjt,Ujt,$jt,qjt,Jjt,Zjt,XWt,sXt,tXt,nXt,oXt,rXt,ZWt,eXt,aXt,iXt,jWt,lXt,hXt,cXt,mXt,_Xt,gXt,AXt,xXt,fXt,yXt,tKt,rKt,aKt,lKt,hKt,dKt,uKt,pKt,mKt]),gCe=_Kt;function yHt(e,t,n){if(!t||!n)return;let o=e.get(t);o||(o=new Set,e.set(t,o)),o.add(n);let r=e.get(n);r||(r=new Set,e.set(n,r)),r.add(t)}var eKe=(e,t={})=>{let n=e,o=n._internal_store;if(!o){o={counts:{},editCount:0},n._internal_store=o;for(let i of n){let s=i.type,a=i[`${s}_id`];if(!a)continue;let c=Number.parseInt(a.split("_").pop());Number.isNaN(c)||(o.counts[s]=Math.max(o.counts[s]??0,c))}}let r=new Proxy({},{get:(i,s)=>{if(s==="toArray")return()=>(n.editCount=o.editCount,n);if(s==="editCount")return o.editCount;if(s==="subtree")return(c)=>eKe(function(l,h){if(!h.subcircuit_id&&!h.source_group_id)return[...l];let d=h;if(h.subcircuit_id){let A=new Set([h.subcircuit_id]),g=new Map,f=new Map;for(let x of l)if(x.type==="source_group"){let{source_group_id:C,subcircuit_id:b}=x;b&&f.set(C,b);let I=x.parent_source_group_id;I&&(g.has(I)||g.set(I,[]),g.get(I).push(C))}let y;for(let[x,C]of f)if(C===h.subcircuit_id){y=x;break}if(y){let x=(C)=>{let b=g.get(C)||[];for(let I of b){let v=f.get(I);v&&A.add(v),x(I)}};x(y),d={...h,subcircuit_ids:Array.from(A)}}}let u=new Map;for(let A of l){let g=A[`${A.type}_id`];typeof g=="string"&&u.set(g,A)}let _=new Map;for(let A of l){let g=Object.entries(A);for(let[f,y]of g)if(f!=="parent_source_group_id"){if(f.endsWith("_id")&&typeof y=="string")yHt(_,A,u.get(y));else if(f.endsWith("_ids")&&Array.isArray(y))for(let x of y)typeof x=="string"&&yHt(_,A,u.get(x))}}let p=[],m=new Set;for(let A of l){let g=!1;(d.subcircuit_id&&("subcircuit_id"in A)&&A.subcircuit_id===d.subcircuit_id||d.subcircuit_ids&&("subcircuit_id"in A)&&A.subcircuit_id&&d.subcircuit_ids.includes(A.subcircuit_id)||d.source_group_id&&("source_group_id"in A)&&A.source_group_id===d.source_group_id||d.source_group_id&&("member_source_group_ids"in A)&&Array.isArray(A.member_source_group_ids)&&A.member_source_group_ids.includes(d.source_group_id))&&(g=!0),g&&(p.push(A),m.add(A))}for(;p.length>0;){let A=p.shift(),g=_.get(A);if(g)for(let f of g)m.has(f)||(m.add(f),p.push(f))}return l.filter((A)=>m.has(A))}(n,c),t);if(s==="insert")return(c)=>{let l=c.type;if(!l)throw Error("insert requires an element with a type");o.counts[l]??=-1,o.counts[l]++;let h=o.counts[l],d={...c,type:l,[`${l}_id`]:`${l}_${h}`};if(t.validateInserts)(aCe[l]??gCe).parse(d);return n.push(d),o.editCount++,d};if(s==="insertAll")return(c)=>c.map((l)=>r.insert(l));let a=s;return{get:(c)=>n.find((l)=>l.type===a&&l[`${a}_id`]===c),getUsing:(c)=>{let l=Object.keys(c);if(l.length!==1)throw Error("getUsing requires exactly one key, e.g. { pcb_component_id }");let h=l[0],d=h.replace("_id",""),u=n.find((_)=>_.type===d&&_[h]===c[h]);return u?n.find((_)=>_.type===a&&_[`${a}_id`]===u[`${a}_id`]):null},getWhere:(c)=>{let l=Object.keys(c);return n.find((h)=>h.type===a&&l.every((d)=>h[d]===c[d]))},list:(c)=>{let l=c?Object.keys(c):[];return n.filter((h)=>h.type===a&&l.every((d)=>h[d]===c[d]))},insert:(c)=>{o.counts[a]??=-1,o.counts[a]++;let l=o.counts[a],h={type:a,[`${a}_id`]:`${a}_${l}`,...c};if(t.validateInserts)(aCe[a]??gCe).parse(h);return n.push(h),o.editCount++,h},delete:(c)=>{let l=n.find((h)=>h[`${a}_id`]===c);l&&(n.splice(n.indexOf(l),1),o.editCount++)},update:(c,l)=>{let h=n.find((d)=>d.type===a&&d[`${a}_id`]===c);return h?(Object.assign(h,l),o.editCount++,h):null},select:(c)=>{if(a==="source_component")return n.find((l)=>l.type==="source_component"&&l.name===c.replace(/\./g,""));if(a==="pcb_port"||a==="source_port"||a==="schematic_port"){let[l,h]=c.replace(/\./g,"").split(/[\s\>]+/),d=n.find((_)=>_.type==="source_component"&&_.name===l);if(!d)return null;let u=n.find((_)=>_.type==="source_port"&&_.source_component_id===d.source_component_id&&(_.name===h||(_.port_hints??[]).includes(h)));if(!u)return null;if(a==="source_port")return u;if(a==="pcb_port")return n.find((_)=>_.type==="pcb_port"&&_.source_port_id===u.source_port_id);if(a==="schematic_port")return n.find((_)=>_.type==="schematic_port"&&_.source_port_id===u.source_port_id)}}}}});return r};function UWe(e){let t=e.type;return`${t}:${e[`${t}_id`]}`}eKe.unparsed=eKe;var xHt=(e,t={})=>{let n=e._internal_store_indexed;if(!n){n={counts:{},editCount:0,indexes:{}};for(let i of e){let s=i.type,a=i[`${s}_id`];if(!a)continue;let c=Number.parseInt(a.split("_").pop()||"");Number.isNaN(c)||(n.counts[s]=Math.max(n.counts[s]??0,c))}let o=t.indexConfig||{},r=n.indexes;if(o.byId&&(r.byId=new Map),o.byType&&(r.byType=new Map),o.byRelation&&(r.byRelation=new Map),o.bySubcircuit&&(r.bySubcircuit=new Map),o.byCustomField&&o.byCustomField.length>0){r.byCustomField=new Map;for(let i of o.byCustomField)r.byCustomField.set(i,new Map)}for(let i of e){if(o.byId){let s=UWe(i);r.byId.set(s,i)}if(o.byType){let s=r.byType.get(i.type)||[];s.push(i),r.byType.set(i.type,s)}if(o.byRelation){let s=Object.entries(i);for(let[a,c]of s)if(a.endsWith("_id")&&a!==`${i.type}_id`&&typeof c=="string"){let l=r.byRelation.get(a)||new Map,h=l.get(c)||[];h.push(i),l.set(c,h),r.byRelation.set(a,l)}}if(o.bySubcircuit&&"subcircuit_id"in i){let s=i.subcircuit_id;if(s&&typeof s=="string"){let a=r.bySubcircuit.get(s)||[];a.push(i),r.bySubcircuit.set(s,a)}}if(o.byCustomField&&r.byCustomField){for(let s of o.byCustomField)if(s in i){let a=i[s];if(a!==void 0&&(typeof a=="string"||typeof a=="number")){let c=String(a),l=r.byCustomField.get(s),h=l.get(c)||[];h.push(i),l.set(c,h)}}}}e._internal_store_indexed=n}return new Proxy({},{get:(o,r)=>{if(r==="toArray")return()=>(e.editCount=n.editCount,e);if(r==="editCount")return n.editCount;let i=r;return{get:(s)=>{let a=t.indexConfig||{};if(a.byId&&n.indexes.byId)return n.indexes.byId.get(`${i}:${s}`)||null;if(a.byType&&n.indexes.byType)return(n.indexes.byType.get(i)||[]).find((c)=>c[`${i}_id`]===s)||null;return e.find((c)=>c.type===i&&c[`${i}_id`]===s)||null},getUsing:(s)=>{let a=t.indexConfig||{},c=Object.keys(s);if(c.length!==1)throw Error("getUsing requires exactly one key, e.g. { pcb_component_id }");let l=c[0],h=l.replace("_id","");if(a.byRelation&&n.indexes.byRelation){let u=n.indexes.byRelation.get(l);if(u){let _=(u.get(s[l])||[]).find((m)=>m.type===h);if(!_)return null;let p=_[`${i}_id`];if(a.byId&&n.indexes.byId)return n.indexes.byId.get(`${i}:${p}`)||null;if(a.byType&&n.indexes.byType)return(n.indexes.byType.get(i)||[]).find((m)=>m[`${i}_id`]===p)||null;return e.find((m)=>m.type===i&&m[`${i}_id`]===p)||null}}let d=e.find((u)=>u.type===h&&u[l]===s[l]);return d&&e.find((u)=>u.type===i&&u[`${i}_id`]===d[`${i}_id`])||null},getWhere:(s)=>{let a=t.indexConfig||{},c=Object.keys(s);if(c.length===1&&a.byCustomField&&n.indexes.byCustomField){let l=c[0],h=n.indexes.byCustomField.get(l);if(h){let d=String(s[l]);return(h.get(d)||[]).find((u)=>u.type===i)||null}}if("subcircuit_id"in s&&a.bySubcircuit&&n.indexes.bySubcircuit){let l=s.subcircuit_id;return(n.indexes.bySubcircuit.get(l)||[]).find((h)=>h.type===i&&c.every((d)=>h[d]===s[d]))||null}if(a.byType&&n.indexes.byType)return(n.indexes.byType.get(i)||[]).find((l)=>c.every((h)=>l[h]===s[h]))||null;return e.find((l)=>l.type===i&&c.every((h)=>l[h]===s[h]))||null},list:(s)=>{let a=t.indexConfig||{},c=s?Object.keys(s):[];if(c.length===0&&a.byType&&n.indexes.byType)return n.indexes.byType.get(i)||[];if(c.length===1&&c[0]==="subcircuit_id"&&a.bySubcircuit&&n.indexes.bySubcircuit){let h=s.subcircuit_id;return(n.indexes.bySubcircuit.get(h)||[]).filter((d)=>d.type===i)}let l;return l=a.byType&&n.indexes.byType?n.indexes.byType.get(i)||[]:e.filter((h)=>h.type===i),c.length>0?l.filter((h)=>c.every((d)=>h[d]===s[d])):l},insert:(s)=>{n.counts[i]??=-1,n.counts[i]++;let a=n.counts[i],c={type:i,[`${i}_id`]:`${i}_${a}`,...s};if(t.validateInserts)(aCe[i]??gCe).parse(c);e.push(c),n.editCount++;let l=t.indexConfig||{};if(l.byId&&n.indexes.byId){let h=UWe(c);n.indexes.byId.set(h,c)}if(l.byType&&n.indexes.byType){let h=n.indexes.byType.get(i)||[];h.push(c),n.indexes.byType.set(i,h)}if(l.byRelation&&n.indexes.byRelation){let h=Object.entries(c);for(let[d,u]of h)if(d.endsWith("_id")&&d!==`${c.type}_id`&&typeof u=="string"){let _=n.indexes.byRelation.get(d)||new Map,p=_.get(u)||[];p.push(c),_.set(u,p),n.indexes.byRelation.set(d,_)}}if(l.bySubcircuit&&n.indexes.bySubcircuit&&"subcircuit_id"in c){let h=c.subcircuit_id;if(h&&typeof h=="string"){let d=n.indexes.bySubcircuit.get(h)||[];d.push(c),n.indexes.bySubcircuit.set(h,d)}}if(l.byCustomField&&n.indexes.byCustomField){for(let h of l.byCustomField)if(h in c){let d=c[h];if(d!==void 0&&(typeof d=="string"||typeof d=="number")){let u=String(d),_=n.indexes.byCustomField.get(h),p=_.get(u)||[];p.push(c),_.set(u,p)}}}return c},delete:(s)=>{let a=t.indexConfig||{},c;if(a.byId&&n.indexes.byId)c=n.indexes.byId.get(`${i}:${s}`);else if(a.byType&&n.indexes.byType)c=(n.indexes.byType.get(i)||[]).find((d)=>d[`${i}_id`]===s);else c=e.find((h)=>h[`${i}_id`]===s);if(!c)return;let l=e.indexOf(c);if(l>=0&&(e.splice(l,1),n.editCount++),a.byId&&n.indexes.byId){let h=UWe(c);n.indexes.byId.delete(h)}if(a.byType&&n.indexes.byType){let h=(n.indexes.byType.get(i)||[]).filter((d)=>d[`${i}_id`]!==s);n.indexes.byType.set(i,h)}if(a.byRelation&&n.indexes.byRelation)for(let[h,d]of n.indexes.byRelation.entries())for(let[u,_]of d.entries()){let p=_.filter((m)=>m!==c);p.length===0?d.delete(u):d.set(u,p)}if(a.bySubcircuit&&n.indexes.bySubcircuit&&"subcircuit_id"in c){let h=c.subcircuit_id;if(h){let d=(n.indexes.bySubcircuit.get(h)||[]).filter((u)=>u!==c);d.length===0?n.indexes.bySubcircuit.delete(h):n.indexes.bySubcircuit.set(h,d)}}if(a.byCustomField&&n.indexes.byCustomField)for(let h of n.indexes.byCustomField.values())for(let[d,u]of h.entries()){let _=u.filter((p)=>p!==c);_.length===0?h.delete(d):h.set(d,_)}},update:(s,a)=>{let c=t.indexConfig||{},l;if(c.byId&&n.indexes.byId)l=n.indexes.byId.get(`${i}:${s}`);else if(c.byType&&n.indexes.byType)l=(n.indexes.byType.get(i)||[]).find((d)=>d[`${i}_id`]===s);else l=e.find((h)=>h.type===i&&h[`${i}_id`]===s);if(!l)return null;if(c.byRelation&&n.indexes.byRelation){let h=Object.entries(l);for(let[d,u]of h)if(d.endsWith("_id")&&d!==`${l.type}_id`&&typeof u=="string"&&d in a&&a[d]!==u){let _=n.indexes.byRelation.get(d);if(_){let p=(_.get(u)||[]).filter((m)=>m!==l);p.length===0?_.delete(u):_.set(u,p)}}}if(c.bySubcircuit&&n.indexes.bySubcircuit&&"subcircuit_id"in l&&"subcircuit_id"in a){let h=l.subcircuit_id;if(h!==a.subcircuit_id){let d=(n.indexes.bySubcircuit.get(h)||[]).filter((u)=>u!==l);d.length===0?n.indexes.bySubcircuit.delete(h):n.indexes.bySubcircuit.set(h,d)}}if(c.byCustomField&&n.indexes.byCustomField){for(let h of c.byCustomField)if(h in l&&h in a&&l[h]!==a[h]){let d=n.indexes.byCustomField.get(h);if(d){let u=String(l[h]),_=(d.get(u)||[]).filter((p)=>p!==l);_.length===0?d.delete(u):d.set(u,_)}}}if(Object.assign(l,a),n.editCount++,c.byRelation&&n.indexes.byRelation){let h=Object.entries(l);for(let[d,u]of h)if(d.endsWith("_id")&&d!==`${l.type}_id`&&typeof u=="string"&&d in a){let _=n.indexes.byRelation.get(d)||new Map,p=_.get(u)||[];p.includes(l)||(p.push(l),_.set(u,p),n.indexes.byRelation.set(d,_))}}if(c.bySubcircuit&&n.indexes.bySubcircuit&&"subcircuit_id"in l&&"subcircuit_id"in a){let h=l.subcircuit_id;if(h&&typeof h=="string"){let d=n.indexes.bySubcircuit.get(h)||[];d.includes(l)||(d.push(l),n.indexes.bySubcircuit.set(h,d))}}if(c.byCustomField&&n.indexes.byCustomField){for(let h of c.byCustomField)if(h in l&&h in a){let d=l[h];if(d!==void 0&&(typeof d=="string"||typeof d=="number")){let u=String(d),_=n.indexes.byCustomField.get(h),p=_.get(u)||[];p.includes(l)||(p.push(l),_.set(u,p))}}}return l},select:(s)=>{if(i==="source_component")return e.find((a)=>a.type==="source_component"&&a.name===s.replace(/\./g,""))||null;if(i==="pcb_port"||i==="source_port"||i==="schematic_port"){let[a,c]=s.replace(/\./g,"").split(/[\s\>]+/),l=e.find((d)=>d.type==="source_component"&&d.name===a);if(!l)return null;let h=e.find((d)=>d.type==="source_port"&&d.source_component_id===l.source_component_id&&(d.name===c||(d.port_hints??[]).includes(c)));if(!h)return null;if(i==="source_port")return h;if(i==="pcb_port")return e.find((d)=>d.type==="pcb_port"&&d.source_port_id===h.source_port_id)||null;if(i==="schematic_port")return e.find((d)=>d.type==="schematic_port"&&d.source_port_id===h.source_port_id)||null}return null}}}})};xHt.unparsed=xHt;var gKt=!0,H$={CCW:-1,CW:1,NOT_ORIENTABLE:0},ggr=2*Math.PI,ACe=Object.freeze({__proto__:null,BOUNDARY:2,CCW:gKt,CONTAINS:3,CW:!1,END_VERTEX:2,INSIDE:1,INTERLACE:4,NOT_VERTEX:0,ORIENTATION:H$,OUTSIDE:0,OVERLAP_OPPOSITE:2,OVERLAP_SAME:1,PIx2:ggr,START_VERTEX:1}),JS=0.000001;function AKt(e){JS=e}function fKt(){return JS}function tKe(e){return e<JS&&e>-JS}function OV(e,t){return e-t<JS&&e-t>-JS}function yKt(e,t){return e-t>JS}function xKt(e,t){return e-t<-JS}var Ve={Utils:Object.freeze({__proto__:null,DECIMALS:3,EQ:OV,EQ_0:tKe,GE:function(e,t){return e-t>-JS},GT:yKt,LE:function(e,t){return e-t<JS},LT:xKt,getTolerance:fKt,setTolerance:AKt}),Errors:void 0,Matrix:void 0,Planar_set:void 0,Point:void 0,Vector:void 0,Line:void 0,Circle:void 0,Segment:void 0,Arc:void 0,Box:void 0,Edge:void 0,Face:void 0,Ray:void 0,Ray_shooting:void 0,Multiline:void 0,Polygon:void 0,Distance:void 0,Inversion:void 0};for(let e in ACe)Ve[e]=ACe[e];Object.defineProperty(Ve,"DP_TOL",{get:function(){return fKt()},set:function(e){AKt(e)}});var y0=class{static get ILLEGAL_PARAMETERS(){return ReferenceError("Illegal Parameters")}static get ZERO_DIVISION(){return Error("Zero division")}static get UNRESOLVED_BOUNDARY_CONFLICT(){return Error("Unresolved boundary conflict in boolean operation")}static get INFINITE_LOOP(){return Error("Infinite loop")}static get CANNOT_COMPLETE_BOOLEAN_OPERATION(){return Error("Cannot complete boolean operation")}static get CANNOT_INVOKE_ABSTRACT_METHOD(){return Error("Abstract method cannot be invoked")}static get OPERATION_IS_NOT_SUPPORTED(){return Error("Operation is not supported")}static get UNSUPPORTED_SHAPE_TYPE(){return Error("Unsupported shape type")}};Ve.Errors=y0;var Hqe=class{constructor(e,t){this.first=e,this.last=t||this.first}[Symbol.iterator](){let e;return{next:()=>(e=e?e.next:this.first,{value:e,done:e===void 0})}}get size(){let e=0;for(let t of this)e++;return e}toArray(e=void 0,t=void 0){let n=[],o=e||this.first,r=t||this.last,i=o;if(i===void 0)return n;do n.push(i),i=i.next;while(i!==r.next);return n}append(e){return this.isEmpty()?this.first=e:(e.prev=this.last,this.last.next=e),this.last=e,this.last.next=void 0,this.first.prev=void 0,this}insert(e,t){if(this.isEmpty())this.first=e,this.last=e;else if(t==null)e.next=this.first,this.first.prev=e,this.first=e;else{let n=t.next;t.next=e,n&&(n.prev=e),e.prev=t,e.next=n,this.last===t&&(this.last=e)}return this.last.next=void 0,this.first.prev=void 0,this}remove(e){return e===this.first&&e===this.last?(this.first=void 0,this.last=void 0):(e.prev&&(e.prev.next=e.next),e.next&&(e.next.prev=e.prev),e===this.first&&(this.first=e.next),e===this.last&&(this.last=e.prev)),this}isEmpty(){return this.first===void 0}static testInfiniteLoop(e){let t=e,n=e;do{if(t!=e&&t===n)throw y0.INFINITE_LOOP;t=t.next,n=n.next.next}while(t!=e)}},CHt={stroke:"black"},Agr=class{constructor(e=CHt){for(let t in e)this[t]=e[t];this.stroke=e.stroke??CHt.stroke}toAttributesString(){return Object.keys(this).reduce((e,t)=>e+(this[t]!==void 0?this.toAttrString(t,this[t]):""),"")}toAttrString(e,t){let n=e==="className"?"class":this.convertCamelToKebabCase(e);return t===null?`${n} `:`${n}="${t.toString()}" `}convertCamelToKebabCase(e){return e.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g).join("-").toLowerCase()}};function oY(e){return new Agr(e).toAttributesString()}function Lq(e,t){let n=[],[o,r,i]=e.standard,[s,a,c]=t.standard,l=o*a-r*s,h=i*a-r*c,d=o*c-i*s;if(!Ve.Utils.EQ_0(l)){let u,_;r===0?(u=i/o,_=d/l):a===0?(u=c/s,_=d/l):o===0?(u=h/l,_=i/r):s===0?(u=h/l,_=c/a):(u=h/l,_=d/l),n.push(new Ve.Point(u,_))}return n}function rY(e,t){let n=[],o=t.pc.projectionOn(e),r=t.pc.distanceTo(o)[0];if(Ve.Utils.EQ(r,t.r))n.push(o);else if(Ve.Utils.LT(r,t.r)){let i,s,a=Math.sqrt(t.r*t.r-r*r);i=e.norm.rotate90CCW().multiply(a),s=o.translate(i),n.push(s),i=e.norm.rotate90CW().multiply(a),s=o.translate(i),n.push(s)}return n}function aq(e,t){let n=[];for(let o of t.toSegments()){let r=Rle(o,e);for(let i of r)MKt(i,n)||n.push(i)}return n}function Sbe(e,t){let n=[];if(aq(e,t.box).length===0)return n;let o=rY(e,new Ve.Circle(t.pc,t.r));for(let r of o)r.on(t)&&n.push(r);return n}function Rle(e,t){let n=[];return e.ps.on(t)&&n.push(e.ps),e.pe.on(t)&&!e.isZeroLength()&&n.push(e.pe),n.length>0||e.isZeroLength()||e.ps.leftTo(t)&&e.pe.leftTo(t)||!e.ps.leftTo(t)&&!e.pe.leftTo(t)?n:Lq(new Ve.Line(e.ps,e.pe),t)}function fCe(e,t){let n=[];if(e.isZeroLength())return e.ps.on(t)&&n.push(e.ps),n;if(t.isZeroLength())return t.ps.on(e)&&n.push(t.ps),n;let o=new Ve.Line(e.ps,e.pe),r=new Ve.Line(t.ps,t.pe);if(o.incidentTo(r))e.ps.on(t)&&n.push(e.ps),e.pe.on(t)&&n.push(e.pe),!t.ps.on(e)||t.ps.equalTo(e.ps)||t.ps.equalTo(e.pe)||n.push(t.ps),!t.pe.on(e)||t.pe.equalTo(e.ps)||t.pe.equalTo(e.pe)||n.push(t.pe);else if(o.parallelTo(r)){let i=new Ve.Vector(e.ps,e.pe),s=new Ve.Vector(t.ps,t.pe),a=new Ve.Vector(e.ps,t.ps),c=i.cross(s);if(!Ve.Utils.EQ_0(c)){let l=a.cross(s)/c,h=a.cross(i)/c;Ve.Utils.GE(l,0)&&Ve.Utils.LE(l,1)&&Ve.Utils.GE(h,0)&&Ve.Utils.LE(h,1)&&n.push(bHt(e.ps.translate(i.multiply(l)),e,t))}}else{let i=Lq(o,r);i.length>0&&IHt(i[0],e)&&IHt(i[0],t)&&n.push(bHt(i[0],e,t))}return n}function bHt(e,t,n){for(let o of[t.ps,t.pe,n.ps,n.pe])if(e.equalTo(o))return o;return e}function IHt(e,t){let n=t.box;return Ve.Utils.LE(e.x,n.xmax)&&Ve.Utils.GE(e.x,n.xmin)&&Ve.Utils.LE(e.y,n.ymax)&&Ve.Utils.GE(e.y,n.ymin)}function yCe(e,t){let n=[];if(e.isZeroLength()){let[r,i]=e.ps.distanceTo(t.pc);return Ve.Utils.EQ(r,t.r)&&n.push(e.ps),n}let o=rY(new Ve.Line(e.ps,e.pe),t);for(let r of o)r.on(e)&&n.push(r);return n}function cq(e,t){let n=[];if(e.isZeroLength())return e.ps.on(t)&&n.push(e.ps),n;let o=rY(new Ve.Line(e.ps,e.pe),new Ve.Circle(t.pc,t.r));for(let r of o)r.on(e)&&r.on(t)&&n.push(r);return n}function CKt(e,t){let n=[],o=new Ve.Vector(e.pc,t.pc),r=e.r,i=t.r;if(Ve.Utils.EQ_0(r)||Ve.Utils.EQ_0(i))return n;if(Ve.Utils.EQ_0(o.x)&&Ve.Utils.EQ_0(o.y)&&Ve.Utils.EQ(r,i))return n.push(e.pc.translate(-r,0)),n;let s,a=e.pc.distanceTo(t.pc)[0];if(Ve.Utils.GT(a,r+i))return n;if(Ve.Utils.LT(a,Math.abs(r-i)))return n;if(o.x/=a,o.y/=a,Ve.Utils.EQ(a,r+i)||Ve.Utils.EQ(a,Math.abs(r-i)))return s=e.pc.translate(r*o.x,r*o.y),n.push(s),n;let c=r*r/(2*a)-i*i/(2*a)+a/2,l=e.pc.translate(c*o.x,c*o.y),h=Math.sqrt(r*r-c*c);return s=l.translate(o.rotate90CCW().multiply(h)),n.push(s),s=l.translate(o.rotate90CW().multiply(h)),n.push(s),n}function bKt(e,t){let n=[];if(e.pc.equalTo(t.pc)&&Ve.Utils.EQ(e.r,t.r)){let s;return s=e.start,s.on(t)&&n.push(s),s=e.end,s.on(t)&&n.push(s),s=t.start,s.on(e)&&n.push(s),s=t.end,s.on(e)&&n.push(s),n}let o=new Ve.Circle(e.pc,e.r),r=new Ve.Circle(t.pc,t.r),i=o.intersect(r);for(let s of i)s.on(e)&&s.on(t)&&n.push(s);return n}function Fqe(e,t){let n=[];if(t.pc.equalTo(e.pc)&&Ve.Utils.EQ(t.r,e.r))return n.push(e.start),n.push(e.end),n;let o=CKt(t,new Ve.Circle(e.pc,e.r));for(let r of o)r.on(e)&&n.push(r);return n}function IKt(e,t){return e.isSegment?fCe(e.shape,t):cq(t,e.shape)}function vKt(e,t){return e.isSegment?cq(e.shape,t):bKt(e.shape,t)}function SKt(e,t){return e.isSegment?Rle(e.shape,t):Sbe(t,e.shape)}function fgr(e,t){return e.isSegment?yCe(e.shape,t):Fqe(e.shape,t)}function zqe(e,t){let n=[];for(let o of t.edges)for(let r of IKt(o,e))n.push(r);return n}function Oqe(e,t){let n=[];for(let o of t.edges)for(let r of vKt(o,e))n.push(r);return n}function Qle(e,t){let n=[];if(t.isEmpty())return n;for(let o of t.edges)for(let r of SKt(o,e))MKt(r,n)||n.push(r);return e.sortPoints(n)}function PKt(e,t){let n=[];if(t.isEmpty())return n;for(let o of t.edges)for(let r of fgr(o,e))n.push(r);return n}function EKt(e,t){return e.isSegment?IKt(t,e.shape):e.isArc?vKt(t,e.shape):e.isLine?SKt(t,e.shape):e.isRay?(n=t,o=e.shape,n.isSegment?Vqe(o,n.shape):Yqe(o,n.shape)):[];var n,o}function vHt(e,t){let n=[];if(t.isEmpty()||e.shape.box.not_intersect(t.box))return n;let o=t.edges.search(e.shape.box);for(let r of o)n=[...n,...EKt(e,r)];return n}function MKt(e,t){return t.some((n)=>n.equalTo(e))}function LQ(e){return new Ve.Line(e.start,e.norm)}function Vqe(e,t){return Rle(t,LQ(e)).filter((n)=>e.contains(n))}function Yqe(e,t){return Sbe(LQ(e),t).filter((n)=>e.contains(n))}function wKt(e,t){return rY(LQ(e),t).filter((n)=>e.contains(n))}function BKt(e,t){return Lq(LQ(e),t).filter((n)=>e.contains(n))}function TKt(e,t){return Qle(LQ(e),t).filter((n)=>e.contains(n))}function DKt(e,t){if(e.intersect&&e.intersect instanceof Function)return e.intersect(t);throw y0.UNSUPPORTED_SHAPE_TYPE}function Hq(e,t){let n=[];for(let o of t)n=[...n,...DKt(e,o.shape)];return n}var PV=class e extends Hqe{constructor(...t){if(super(),this.isInfinite=!1,t.length===1&&t[0]instanceof Array&&t[0].length>0){let n=t[0],o=n.length,r=(s)=>s instanceof Ve.Segment||s instanceof Ve.Arc||s instanceof Ve.Ray,i=(s)=>s instanceof Ve.Segment||s instanceof Ve.Arc;if(!(o===1&&((s)=>s instanceof Ve.Segment||s instanceof Ve.Arc||s instanceof Ve.Ray||s instanceof Ve.Line)(n[0])||o>1&&r(n[0])&&r(n[o-1])&&n.slice(1,o-1).every(i)))throw Ve.Errors.ILLEGAL_PARAMETERS;this.isInfinite=n.some((s)=>s instanceof Ve.Ray||s instanceof Ve.Line);for(let s of n){let a=new Ve.Edge(s);this.append(a)}this.setArcLength()}}get edges(){return[...this]}get box(){return this.edges.reduce((t,n)=>t.merge(n.box),new Ve.Box)}get vertices(){let t=this.edges.map((n)=>n.start);return t.push(this.last.end),t}get length(){if(this.isEmpty())return 0;if(this.isInfinite)return Number.POSITIVE_INFINITY;let t=0;for(let n of this)t+=n.length;return t}clone(){return new e(this.toShapes())}setArcLength(){for(let t of this)this.setOneEdgeArcLength(t)}setOneEdgeArcLength(t){t===this.first?t.arc_length=0:t.arc_length=t.prev.arc_length+t.prev.length}pointAtLength(t){if(t>this.length||t<0)return null;if(this.isInfinite)return null;let n=null;for(let o of this)if(t>=o.arc_length&&(o===this.last||t<o.next.arc_length)){n=o.pointAtLength(t-o.arc_length);break}return n}addVertex(t,n){let o=n.shape.split(t);if(o[0]===null)return n.prev;if(o[1]===null)return n;let r=new Ve.Edge(o[0]),i=n.prev;return this.insert(r,i),n.shape=o[1],r}getChain(t,n){let o=[];for(let r=t;r!==n.next;r=r.next)o.push(r);return o}split(t){for(let n of t){let o=this.findEdgeByPoint(n);this.addVertex(n,o)}return this}findEdgeByPoint(t){let n;for(let o of this)if(o.shape.contains(t)){n=o;break}return n}distanceTo(t){if(t instanceof Ve.Point){let[n,o]=Ve.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof Ve.Line){let[n,o]=Ve.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof Ve.Circle){let[n,o]=Ve.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof Ve.Segment){let[n,o]=Ve.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof Ve.Arc){let[n,o]=Ve.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof Ve.Box){let[n,o]=Ve.Distance.shape2multiline(new Ve.Polygon(t),this);return[n,o.reverse()]}if(t instanceof Ve.Multiline)return Ve.Distance.multiline2multiline(this,t);throw Ve.Errors.UNSUPPORTED_SHAPE_TYPE}intersect(t){return t instanceof Ve.Multiline?function(n,o){let r=[];for(let i of n)for(let s of o)r=[...r,...DKt(i.shape,s.shape)];return r}(this,t):Hq(t,this)}contains(t){if(t instanceof Ve.Point)return this.edges.some((n)=>n.shape.contains(t));throw Ve.Errors.UNSUPPORTED_SHAPE_TYPE}translate(t){return new e(this.edges.map((n)=>n.shape.translate(t)))}rotate(t=0,n=new Ve.Point){return new e(this.edges.map((o)=>o.shape.rotate(t,n)))}transform(t=new Ve.Matrix){return new e(this.edges.map((n)=>n.shape.transform(t)))}toShapes(){return this.edges.map((t)=>t.shape.clone())}toJSON(){return this.edges.map((t)=>t.toJSON())}svgPoints(){return this.vertices.map((t)=>`${t.x},${t.y}`).join(" ")}dpath(){let t=`M${this.first.start.x},${this.first.start.y}`;for(let n of this)t+=n.svg();return t}svg(t={}){let n=`
<path ${oY({fill:"none",...t})} d="`;n+=`
M${this.first.start.x},${this.first.start.y}`;for(let o of this)n+=o.svg();return n+=`" >
</path>`,n}};Ve.Multiline=PV;function lq(e,t,n){let o=n.length,r=e.shape.split(t);if(r.length===0)return;let i=0;i=r[0]===null?0:r[1]===null?e.shape.length:r[0].length;let s,a=0;OV(i,0)&&(a|=1),OV(i,e.shape.length)&&(a|=2),s=i===1/0?r[0].coord(t):2&a&&e.next&&e.next.arc_length===0?0:e.arc_length+i,n.push({id:o,pt:t,arc_length:s,edge_before:e,edge_after:void 0,face:e.face,is_vertex:a})}function rle(e){e.int_points1_sorted=vQ(e.int_points1),e.int_points2_sorted=vQ(e.int_points2)}function vQ(e){let t=new Map,n=0;for(let o of e)t.has(o.face)||(t.set(o.face,n),n++);for(let o of e)o.faceId=t.get(o.face);return e.slice().sort(ygr)}function ygr(e,t){return e.faceId<t.faceId?-1:e.faceId>t.faceId?1:e.arc_length<t.arc_length?-1:e.arc_length>t.arc_length?1:0}function Gqe(e){if(e.int_points1.length<2)return;let t,n,o,r,i=!1;for(let s=0;s<e.int_points1_sorted.length;s++)if(e.int_points1_sorted[s].id!==-1){t=e.int_points1_sorted[s],n=e.int_points2[t.id];for(let a=s+1;a<e.int_points1_sorted.length&&(o=e.int_points1_sorted[a],OV(o.arc_length,t.arc_length));a++)o.id!==-1&&(r=e.int_points2[o.id],r.id!==-1&&o.edge_before===t.edge_before&&o.edge_after===t.edge_after&&r.edge_before===n.edge_before&&r.edge_after===n.edge_after&&(o.id=-1,r.id=-1,i=!0))}n=e.int_points2_sorted[0],t=e.int_points1[n.id];for(let s=1;s<e.int_points2_sorted.length;s++){let a=e.int_points2_sorted[s];if(a.id===-1)continue;if(n.id===-1||!OV(a.arc_length,n.arc_length)){n=a,t=e.int_points1[n.id];continue}let c=e.int_points1[a.id];c.edge_before===t.edge_before&&c.edge_after===t.edge_after&&a.edge_before===n.edge_before&&a.edge_after===n.edge_after&&(c.id=-1,a.id=-1,i=!0)}i&&(e.int_points1=e.int_points1.filter((s)=>s.id>=0),e.int_points2=e.int_points2.filter((s)=>s.id>=0),e.int_points1.forEach((s,a)=>s.id=a),e.int_points2.forEach((s,a)=>s.id=a))}function nKe(e){for(let t of e)t.edge_before&&(t.edge_before.bvStart=void 0,t.edge_before.bvEnd=void 0,t.edge_before.bv=void 0,t.edge_before.overlap=void 0),t.edge_after&&(t.edge_after.bvStart=void 0,t.edge_after.bvEnd=void 0,t.edge_after.bv=void 0,t.edge_after.overlap=void 0);for(let t of e)t.edge_before&&(t.edge_before.bvEnd=2),t.edge_after&&(t.edge_after.bvStart=2)}function oKe(e,t){for(let n of e)n.edge_before&&n.edge_before.setInclusion(t),n.edge_after&&n.edge_after.setInclusion(t)}function hq(e,t,n){let o,r,i=1;if(e.length===1)return 1;o=e[t];for(let s=t+1;s<e.length&&o.face===n&&(r=e[s],r.pt.equalTo(o.pt)&&r.edge_before===o.edge_before&&r.edge_after===o.edge_after);s++)i++;return i}function dq(e,t){if(t){for(let n of t){let o=n.edge_before;if(n.is_vertex=0,o.shape.start&&o.shape.start.equalTo(n.pt)&&(n.is_vertex|=1),o.shape.end&&o.shape.end.equalTo(n.pt)&&(n.is_vertex|=2),1&n.is_vertex){n.edge_before=o.prev,o.prev&&(n.is_vertex=2);continue}if(2&n.is_vertex)continue;let r=e.addVertex(n.pt,o);n.edge_before=r}for(let n of t)n.edge_before?n.edge_after=n.edge_before.next:e instanceof PV&&1&n.is_vertex&&(n.edge_after=e.first)}}function SHt(e,t,n){let o=e.edge_before,r=t.edge_after,i=n.length;o.next=n[0],n[0].prev=o,n[i-1].next=r,r.prev=n[i-1]}Ve.multiline=(...e)=>new Ve.Multiline(...e);var{INSIDE:kS,OUTSIDE:LS,BOUNDARY:KA,OVERLAP_SAME:xgr,OVERLAP_OPPOSITE:Cgr}=ACe,{NOT_VERTEX:oLs,START_VERTEX:PHt,END_VERTEX:EHt}=ACe;function rKe(e,t){let n=t.clone().reverse(),[o,r]=kle(e,n,3,!0);return o}function NKt(e,t){let[n,o]=kle(e,t,2,!0);return n}function RKt(e,t){let[n,o]=kle(e,t,2,!1),r=[];for(let s of n.faces)r=[...r,...[...s.edges].map((a)=>a.shape)];let i=[];for(let s of o.faces)i=[...i,...[...s.edges].map((a)=>a.shape)];return[r,i]}function iKe(e,t){let[n,o]=kle(e,t,3,!1),r=[];for(let i of n.faces)r=[...r,...[...i.edges].map((s)=>s.shape)];return r}function QKt(e,t){let n=e.clone(),o=t.clone(),r=kKt(n,o);return rle(r),dq(n,r.int_points1_sorted),dq(o,r.int_points2_sorted),Gqe(r),rle(r),[r.int_points1_sorted.map((i)=>i.pt),r.int_points2_sorted.map((i)=>i.pt)]}function bgr(e,t,n,o){let r=MHt(e,n.int_points1),i=MHt(t,n.int_points2);for(wHt(r,t),wHt(i,e),nKe(n.int_points1),nKe(n.int_points2),oKe(n.int_points1,t),oKe(n.int_points2,e);Igr(e,t,n.int_points1,n.int_points1_sorted,n.int_points2,n););(function(s){let a,c,l,h=s.int_points1.length;for(let d=0;d<h;d++){let u=s.int_points1_sorted[d];u.face!==a&&(c=d,a=u.face);let _,p=d,m=hq(s.int_points1_sorted,d,a);_=p+m<h&&s.int_points1_sorted[p+m].face===a?p+m:c;let A=hq(s.int_points1_sorted,_,a);l=null;for(let I=_;I<_+A;I++){let v=s.int_points1_sorted[I];if(v.face===a&&s.int_points2[v.id].face===s.int_points2[u.id].face){l=v;break}}if(l===null)continue;let g=u.edge_after,f=l.edge_before;if(g.bv!==2||f.bv!==2)continue;if(g!==f)continue;let y=s.int_points2[u.id],x=s.int_points2[l.id],C=y.edge_after,b=x.edge_before;C.bv===2&&b.bv===2&&C===b||(y=s.int_points2[l.id],x=s.int_points2[u.id],C=y.edge_after,b=x.edge_before),C.bv===2&&b.bv===2&&C===b&&g.setOverlap(C)}})(n),sKe(e,o,n.int_points1_sorted,!0),sKe(t,o,n.int_points2_sorted,!1),BHt(e,r,o,!0),BHt(t,i,o,!1)}function kle(e,t,n,o){let r=e.clone(),i=t.clone(),s=kKt(r,i);return rle(s),dq(r,s.int_points1_sorted),dq(i,s.int_points2_sorted),Gqe(s),rle(s),bgr(r,i,s,n),o&&function(a,c,l){(function(h,d,u,_){for(let p of d.faces){for(let m of p)h.edges.add(m);_.find((m)=>m.face===p)===void 0&&h.addFace(p.first,p.last)}})(a,c,0,l.int_points2),function(h,d,u){if(u.int_points1.length!==0)for(let _=0;_<u.int_points1.length;_++){let p=u.int_points1[_],m=u.int_points2[_];if(p.edge_before!==void 0&&p.edge_after===void 0&&m.edge_before===void 0&&m.edge_after!==void 0&&(p.edge_before.next=m.edge_after,m.edge_after.prev=p.edge_before,p.edge_after=m.edge_after,m.edge_before=p.edge_before),m.edge_before!==void 0&&m.edge_after===void 0&&p.edge_before===void 0&&p.edge_after!==void 0&&(m.edge_before.next=p.edge_after,p.edge_after.prev=m.edge_before,m.edge_after=p.edge_after,p.edge_before=m.edge_before),p.edge_before!==void 0&&p.edge_after===void 0)for(let A of u.int_points1_sorted)A!==p&&A.edge_before===void 0&&A.edge_after!==void 0&&A.pt.equalTo(p.pt)&&(p.edge_before.next=A.edge_after,A.edge_after.prev=p.edge_before,p.edge_after=A.edge_after,A.edge_before=p.edge_before);if(m.edge_before!==void 0&&m.edge_after===void 0)for(let A of u.int_points2_sorted)A!==m&&A.edge_before===void 0&&A.edge_after!==void 0&&A.pt.equalTo(m.pt)&&(m.edge_before.next=A.edge_after,A.edge_after.prev=m.edge_before,m.edge_after=A.edge_after,A.edge_before=m.edge_before)}}(0,0,l),aKe(a,l.int_points1),aKe(c,l.int_points2),cKe(a,l.int_points1,l.int_points2),cKe(a,l.int_points2,l.int_points1),THt(a),THt(c)}(r,i,s),[r,i]}function kKt(e,t){let n={int_points1:[],int_points2:[]};for(let o of e.edges){let r=t.edges.search(o.box);for(let i of r){let s=o.shape.intersect(i.shape);for(let a of s)lq(o,a,n.int_points1),lq(i,a,n.int_points2)}}return n}function MHt(e,t){let n=[];for(let o of e.faces)t.find((r)=>r.face===o)||n.push(o);return n}function wHt(e,t){for(let n of e)n.first.bv=n.first.bvStart=n.first.bvEnd=void 0,n.first.setInclusion(t)}function Igr(e,t,n,o,r,i){let s,a,c,l=o.length,h=!1;for(let d=0;d<l;d++){let u=o[d];u.face!==s&&(a=d,s=u.face);let _,p=d,m=hq(o,d,s);_=p+m<l&&o[p+m].face===s?p+m:a;let A=hq(o,_,s);c=null;for(let y=_;y<_+A;y++){let x=o[y];if(x.face===s&&r[x.id].face===r[u.id].face){c=x;break}}if(c===null)continue;let g=u.edge_after,f=c.edge_before;if(g.bv!==KA||f.bv==KA)if(g.bv==KA||f.bv!==KA){if(g.bv===KA&&f.bv===KA&&g!=f||g.bv===kS&&f.bv===LS||g.bv===LS&&f.bv===kS){let y=g.next;for(;y!=f;)y.bvStart=void 0,y.bvEnd=void 0,y.bv=void 0,y.setInclusion(t),y=y.next}if(g.bv===KA&&f.bv===KA&&g!=f){let y,x=g.next;for(;x!=f;){if(x.bv!=KA){if(y===void 0)y=x.bv;else if(x.bv!=y)throw y0.UNRESOLVED_BOUNDARY_CONFLICT}x=x.next}y!=null&&(g.bv=y,f.bv=y);continue}if(g.bv===kS&&f.bv===LS||g.bv===LS&&f.bv===kS){let y=g;for(;y!=f;){if(y.bvStart===g.bv&&y.bvEnd===f.bv){let[x,C]=y.shape.distanceTo(t);if(x<10*Ve.DP_TOL){lq(y,C.ps,n);let b=n[n.length-1];if(b.is_vertex&PHt)b.edge_after=y,b.edge_before=y.prev,y.bvStart=KA,y.bv=void 0,y.setInclusion(t);else if(b.is_vertex&EHt)b.edge_after=y.next,y.bvEnd=KA,y.bv=void 0,y.setInclusion(t);else{let P=t.addVertex(b.pt,y);b.edge_before=P,b.edge_after=P.next,P.setInclusion(t),P.next.bvStart=KA,P.next.bvEnd=void 0,P.next.bv=void 0,P.next.setInclusion(t)}let I=t.findEdgeByPoint(C.pe);lq(I,C.pe,r);let v=r[r.length-1];if(v.is_vertex&PHt)v.edge_after=I,v.edge_before=I.prev;else if(v.is_vertex&EHt)v.edge_after=I.next;else{let P=r.find((B)=>B.edge_after===I),M=t.addVertex(v.pt,I);v.edge_before=M,v.edge_after=M.next,P&&(P.edge_after=M),M.bvStart=void 0,M.bvEnd=KA,M.bv=void 0,M.setInclusion(e),M.next.bvStart=KA,M.next.bvEnd=void 0,M.next.bv=void 0,M.next.setInclusion(e)}rle(i),h=!0;break}}y=y.next}if(h)break;throw y0.UNRESOLVED_BOUNDARY_CONFLICT}}else f.bv=g.bv;else g.bv=f.bv}return h}function sKe(e,t,n,o){if(!n)return;let r,i,s,a;for(let c=0;c<n.length;c++){if(s=n[c],s.face!==r&&(i=c,r=s.face),r.isEmpty())continue;let l,h=c,d=hq(n,c,r);l=h+d<n.length&&n[h+d].face===s.face?h+d:i,a=n[l];let u=l,_=hq(n,u,r),p=s.edge_after,m=a.edge_before;if(p.bv===kS&&m.bv===kS&&t===1||p.bv===LS&&m.bv===LS&&t===2||(p.bv===LS||m.bv===LS)&&t===3&&!o||(p.bv===kS||m.bv===kS)&&t===3&&o||p.bv===KA&&m.bv===KA&&p.overlap&xgr&&o||p.bv===KA&&m.bv===KA&&p.overlap&Cgr){e.removeChain(r,p,m);for(let A=h;A<h+d;A++)n[A].edge_after=void 0;for(let A=u;A<u+_;A++)n[A].edge_before=void 0}c+=d-1}}function aKe(e,t){for(let n of t)e.faces.delete(n.face),n.face=void 0,n.edge_before&&(n.edge_before.face=void 0),n.edge_after&&(n.edge_after.face=void 0)}function cKe(e,t,n){for(let o of t){if(o.edge_before===void 0||o.edge_after===void 0)continue;if(o.face)continue;if(o.edge_after.face||o.edge_before.face)continue;let{edge_after:r,edge_before:i}=o;try{Hqe.testInfiniteLoop(r)}catch(a){throw y0.CANNOT_COMPLETE_BOOLEAN_OPERATION}let s=e.addFace(r,i);for(let a of t)a.edge_before&&a.edge_after&&a.edge_before.face===s&&a.edge_after.face===s&&(a.face=s);for(let a of n)a.edge_before&&a.edge_after&&a.edge_before.face===s&&a.edge_after.face===s&&(a.face=s)}}function BHt(e,t,n,o){for(let r of t){let i=r.first.bv;(n===1&&i===kS||n===3&&i===kS&&o||n===3&&i===LS&&!o||n===2&&i===LS)&&e.deleteFace(r)}}function THt(e){let t=[];for(let n of e.edges)n.face&&e.faces.has(n.face)||t.push(n);for(let n of t)e.edges.delete(n)}var lKe=Object.freeze({__proto__:null,BOOLEAN_INTERSECT:2,BOOLEAN_SUBTRACT:3,BOOLEAN_UNION:1,calculateIntersections:QKt,innerClip:RKt,intersect:NKt,outerClip:iKe,removeNotRelevantChains:sKe,removeOldFaces:aKe,restoreFaces:cKe,subtract:rKe,unify:function(e,t){let[n,o]=kle(e,t,1,!0);return n}}),vgr=RegExp("T.F..FFF.|T.F...F.."),Sgr=RegExp("T........|.T.......|...T.....|....T...."),Pgr=RegExp("FT.......|F..T.....|F...T...."),Egr=RegExp("T.F..F..."),Mgr=RegExp("T.F..F...|.TF..F...|..FT.F...|..F.TF..."),x$=class{constructor(){this.m=[,,,,,,,,,].fill(void 0)}get I2I(){return this.m[0]}set I2I(e){this.m[0]=e}get I2B(){return this.m[1]}set I2B(e){this.m[1]=e}get I2E(){return this.m[2]}set I2E(e){this.m[2]=e}get B2I(){return this.m[3]}set B2I(e){this.m[3]=e}get B2B(){return this.m[4]}set B2B(e){this.m[4]=e}get B2E(){return this.m[5]}set B2E(e){this.m[5]=e}get E2I(){return this.m[6]}set E2I(e){this.m[6]=e}get E2B(){return this.m[7]}set E2B(e){this.m[7]=e}get E2E(){return this.m[8]}set E2E(e){this.m[8]=e}toString(){return this.m.map((e)=>e instanceof Array&&e.length>0?"T":e instanceof Array&&e.length===0?"F":"*").join("")}equal(){return vgr.test(this.toString())}intersect(){return Sgr.test(this.toString())}touch(){return Pgr.test(this.toString())}inside(){return Egr.test(this.toString())}covered(){return Mgr.test(this.toString())}};function bce(e,t){let n,o=new Ve.Ray(t),r=new Ve.Line(o.pt,o.norm),i=new Ve.Box(o.box.xmin-Ve.DP_TOL,o.box.ymin-Ve.DP_TOL,o.box.xmax+Ve.DP_TOL,o.box.ymax+Ve.DP_TOL);if(e.box.not_intersect(i))return Ve.OUTSIDE;let s=e.edges.search(i);if(s.length===0)return Ve.OUTSIDE;for(let h of s)if(h.shape.contains(t))return Ve.BOUNDARY;let a=[...e.faces],c=[];for(let h of s)for(let d of o.intersect(h.shape)){if(d.equalTo(t))return Ve.BOUNDARY;c.push({pt:d,edge:h,face_index:a.indexOf(h.face)})}c.sort((h,d)=>xKt(h.pt.x,d.pt.x)?-1:yKt(h.pt.x,d.pt.x)?1:h.face_index<d.face_index?-1:h.face_index>d.face_index?1:h.edge.arc_length<d.edge.arc_length?-1:h.edge.arc_length>d.edge.arc_length?1:0);let l=0;for(let h=0;h<c.length;h++){let d=c[h];if(d.pt.equalTo(d.edge.shape.start)){if(h>0&&d.pt.equalTo(c[h-1].pt)&&d.face_index===c[h-1].face_index&&d.edge.prev===c[h-1].edge)continue;let u=d.edge.prev;for(;tKe(u.length);)u=u.prev;let _=u.shape.tangentInEnd(),p=d.pt.translate(_),m=d.edge.shape.tangentInStart(),A=d.pt.translate(m),g=p.leftTo(r),f=A.leftTo(r);(g&&!f||!g&&f)&&l++}else if(d.pt.equalTo(d.edge.shape.end)){if(h>0&&d.pt.equalTo(c[h-1].pt)&&d.face_index===c[h-1].face_index&&d.edge.next===c[h-1].edge)continue;let u=d.edge.next;for(;tKe(u.length);)u=u.next;let _=u.shape.tangentInStart(),p=d.pt.translate(_),m=d.edge.shape.tangentInEnd(),A=d.pt.translate(m),g=p.leftTo(r),f=A.leftTo(r);(g&&!f||!g&&f)&&l++}else if(d.edge.shape instanceof Ve.Segment)l++;else{let u=d.edge.shape.box;OV(d.pt.y,u.ymin)||OV(d.pt.y,u.ymax)||l++}}return n=l%2==1?1:0,n}function DHt(e,t){return F$(e,t).intersect()}function NHt(e,t){return F$(e,t).inside()}function LKt(e,t){return F$(e,t).covered()}function HKt(e,t){return LKt(t,e)}function F$(e,t){return e instanceof Ve.Line&&t instanceof Ve.Line?function(n,o){let r=new x$,i=Lq(n,o);return i.length===0?n.contains(o.pt)&&o.contains(n.pt)?(r.I2I=[n],r.I2E=[],r.E2I=[]):(r.I2I=[],r.I2E=[n],r.E2I=[o]):(r.I2I=i,r.I2E=n.split(i),r.E2I=o.split(i)),r}(e,t):e instanceof Ve.Line&&t instanceof Ve.Circle?function(n,o){let r=new x$,i=rY(n,o);if(i.length===0)r.I2I=[],r.I2B=[],r.I2E=[n],r.E2I=[o];else if(i.length===1)r.I2I=[],r.I2B=i,r.I2E=n.split(i),r.E2I=[o];else{let s=new PV([n]),a=n.sortPoints(i);s.split(a);let c=s.toShapes();r.I2I=[c[1]],r.I2B=a,r.I2E=[c[0],c[2]],r.E2I=new Ve.Polygon([o.toArc()]).cutWithLine(n)}return r}(e,t):e instanceof Ve.Line&&t instanceof Ve.Box?function(n,o){let r=new x$,i=aq(n,o);if(i.length===0)r.I2I=[],r.I2B=[],r.I2E=[n],r.E2I=[o];else if(i.length===1)r.I2I=[],r.I2B=i,r.I2E=n.split(i),r.E2I=[o];else{let s=new PV([n]),a=n.sortPoints(i);s.split(a);let c=s.toShapes();o.toSegments().some((l)=>l.contains(i[0])&&l.contains(i[1]))?(r.I2I=[],r.I2B=[c[1]],r.I2E=[c[0],c[2]],r.E2I=[o]):(r.I2I=[c[1]],r.I2B=a,r.I2E=[c[0],c[2]],r.E2I=new Ve.Polygon(o.toSegments()).cutWithLine(n))}return r}(e,t):e instanceof Ve.Line&&t instanceof Ve.Polygon?function(n,o){let r=new x$,i=Qle(n,o),s=new PV([n]),a=i.length>0?i.slice():n.sortPoints(i);return s.split(a),[...s].forEach((c)=>c.setInclusion(o)),r.I2I=[...s].filter((c)=>c.bv===Ve.INSIDE).map((c)=>c.shape),r.I2B=[...s].slice(1).map((c)=>c.bv===Ve.BOUNDARY?c.shape:c.shape.start),r.I2E=[...s].filter((c)=>c.bv===Ve.OUTSIDE).map((c)=>c.shape),r.E2I=o.cutWithLine(n),r}(e,t):(e instanceof Ve.Segment||e instanceof Ve.Arc)&&t instanceof Ve.Polygon?RHt(e,t):(e instanceof Ve.Segment||e instanceof Ve.Arc)&&(t instanceof Ve.Circle||t instanceof Ve.Box)?RHt(e,new Ve.Polygon(t)):e instanceof Ve.Polygon&&t instanceof Ve.Polygon?P4e(e,t):(e instanceof Ve.Circle||e instanceof Ve.Box)&&(t instanceof Ve.Circle||t instanceof Ve.Box)?P4e(new Ve.Polygon(e),new Ve.Polygon(t)):(e instanceof Ve.Circle||e instanceof Ve.Box)&&t instanceof Ve.Polygon?P4e(new Ve.Polygon(e),t):e instanceof Ve.Polygon&&(t instanceof Ve.Circle||t instanceof Ve.Box)?P4e(e,new Ve.Polygon(t)):void 0}function RHt(e,t){let n=new x$,o=function(s,a){return s instanceof Ve.Line?Qle(s,a):s instanceof Ve.Segment?zqe(s,a):s instanceof Ve.Arc?Oqe(s,a):[]}(e,t),r=o.length>0?o.slice():e.sortPoints(o),i=new PV([e]);i.split(r),[...i].forEach((s)=>s.setInclusion(t)),n.I2I=[...i].filter((s)=>s.bv===Ve.INSIDE).map((s)=>s.shape),n.I2B=[...i].slice(1).map((s)=>s.bv===Ve.BOUNDARY?s.shape:s.shape.start),n.I2E=[...i].filter((s)=>s.bv===Ve.OUTSIDE).map((s)=>s.shape),n.B2I=[],n.B2B=[],n.B2E=[];for(let s of[e.start,e.end])switch(bce(t,s)){case Ve.INSIDE:n.B2I.push(s);break;case Ve.BOUNDARY:n.B2B.push(s);break;case Ve.OUTSIDE:n.B2E.push(s)}return n}function P4e(e,t){let n=new x$,[o,r]=QKt(e,t),i=NKt(e,t),s=rKe(e,t),a=rKe(t,e),[c,l]=RKt(e,t),h=iKe(e,t),d=iKe(t,e);return n.I2I=i.isEmpty()?[]:[i],n.I2B=l,n.I2E=s.isEmpty()?[]:[s],n.B2I=c,n.B2B=o,n.B2E=h,n.E2I=a.isEmpty()?[]:[a],n.E2B=d,n}var wgr=Object.freeze({__proto__:null,contain:function(e,t){return NHt(t,e)},cover:HKt,covered:LKt,disjoint:function(e,t){return!DHt(e,t)},equal:function(e,t){return F$(e,t).equal()},inside:NHt,intersect:DHt,relate:F$,touch:function(e,t){return F$(e,t).touch()}}),HQ=class e{constructor(t=1,n=0,o=0,r=1,i=0,s=0){this.a=t,this.b=n,this.c=o,this.d=r,this.tx=i,this.ty=s}fromMatrix3x3(t){let[n,o,r]=t[0],[i,s,a]=t[1];return new e(n,i,o,s,r,a)}toMatrix3x3(){return[[this.a,this.c,this.tx],[this.b,this.d,this.ty],[0,0,1]]}clone(){return new e(this.a,this.b,this.c,this.d,this.tx,this.ty)}transform(t){return[t[0]*this.a+t[1]*this.c+this.tx,t[0]*this.b+t[1]*this.d+this.ty]}multiply(t){return new e(this.a*t.a+this.c*t.b,this.b*t.a+this.d*t.b,this.a*t.c+this.c*t.d,this.b*t.c+this.d*t.d,this.a*t.tx+this.c*t.ty+this.tx,this.b*t.tx+this.d*t.ty+this.ty)}translate(...t){let n,o;if(t.length!=1||isNaN(t[0].x)||isNaN(t[0].y)){if(t.length!==2||typeof t[0]!="number"||typeof t[1]!="number")throw y0.ILLEGAL_PARAMETERS;n=t[0],o=t[1]}else n=t[0].x,o=t[0].y;return this.multiply(new e(1,0,0,1,n,o))}rotate(t,n=0,o=0){let r=Math.cos(t),i=Math.sin(t);return this.translate(n,o).multiply(new e(r,i,-i,r,0,0)).translate(-n,-o)}scale(t,n){return this.multiply(new e(t,0,0,n,0,0))}equalTo(t){return!!Ve.Utils.EQ(this.tx,t.tx)&&(!!Ve.Utils.EQ(this.ty,t.ty)&&(!!Ve.Utils.EQ(this.a,t.a)&&(!!Ve.Utils.EQ(this.b,t.b)&&(!!Ve.Utils.EQ(this.c,t.c)&&!!Ve.Utils.EQ(this.d,t.d)))))}};Ve.Matrix=HQ;Ve.matrix=(...e)=>new Ve.Matrix(...e);var Bgr=class{constructor(e,t){this.low=e,this.high=t}get max(){return this.clone()}less_than(e){return this.low<e.low||this.low===e.low&&this.high<e.high}equal_to(e){return this.low===e.low&&this.high===e.high}intersect(e){return!this.not_intersect(e)}not_intersect(e){return this.high<e.low||e.high<this.low}merge(e){let t=this.low===void 0?e.low:this.low<e.low?this.low:e.low,n=this.high===void 0?e.high:this.high>e.high?this.high:e.high,o=this.clone();return o.low=t,o.high=n,o}output(){return[this.low,this.high]}comparable_less_than(e,t){return e<t}},Tgr=class e extends Bgr{clone(){return new e(this.low,this.high)}},dQ=class{constructor(e,t,n=null,o=null,r=null,i=0){if(this.left=n,this.right=o,this.parent=r,this.color=i,this.item={key:void 0,values:[]},t!==void 0&&this.item.values.push(t),e!==void 0)if(Array.isArray(e)){let[s,a]=e;if(!Number.isNaN(s)&&!Number.isNaN(a)){let c=s,l=a;c>l&&([c,l]=[l,c]),this.item.key=new Tgr(c,l)}}else this.item.key=e;this.max=this.item.key?this.item.key.max:void 0}isNil(){return this.item.key===void 0&&this.item.values.length===0&&this.left===null&&this.right===null&&this.color===0}requireKey(){if(!this.item.key)throw Error("Node key is undefined (nil/sentinel). Operation is not applicable.");return this.item.key}less_than(e){let t=this.requireKey(),n=e.requireKey();return t.less_than(n)}_value_equal(e){let t=this.item.values[0],n=e.item.values[0];return t&&n&&t.equal_to?t.equal_to(n):t===n}equal_to(e){let t=this.requireKey(),n=e.requireKey();return t.equal_to(n)}intersect(e){let t=this.requireKey(),n=e.requireKey();return t.intersect(n)}copy_data(e){this.item.key=e.item.key,this.item.values=e.item.values.slice()}update_max(){this.max=this.item.key?this.item.key.max:void 0,this.right&&this.right.max&&(this.max=this.max?this.max.merge(this.right.max):this.right.max),this.left&&this.left.max&&(this.max=this.max?this.max.merge(this.left.max):this.left.max)}not_intersect_left_subtree(e){if(!this.left)return!0;let t=this.left.max?this.left.max.high:this.left.item.key.high,n=this.requireKey(),o=e.requireKey();return n.comparable_less_than(t,o.low)}not_intersect_right_subtree(e){if(!this.right)return!0;let t=this.right.max?this.right.max.low:this.right.item.key.low,n=this.requireKey(),o=e.requireKey();return n.comparable_less_than(o.high,t)}},hKe=class e{constructor(){this.root=null,this.nil_node=new dQ}get size(){let t=0;return this.tree_walk(this.root,(n)=>t+=n.item.values.length),t}get keys(){let t=[];return this.tree_walk(this.root,(n)=>t.push(n.item.key.output())),t}get values(){let t=[];return this.tree_walk(this.root,(n)=>{for(let o of n.item.values)t.push(o)}),t}get items(){let t=[];return this.tree_walk(this.root,(n)=>{let o=n.item.key.output();for(let r of n.item.values)t.push({key:o,value:r})}),t}isEmpty(){return this.root==null||this.root===this.nil_node}clear(){this.root=null}insert(t,n=t){if(t===void 0)return;let o=this.tree_search(this.root,new dQ(t));if(o)return o.item.values.push(n),o;let r=new dQ(t,n,this.nil_node,this.nil_node,null,1);return this.tree_insert(r),this.recalc_max(r),r}exist(t,n=t){let o=this.tree_search(this.root,new dQ(t));return!!o&&(arguments.length<2||n===t||o.item.values.some((r)=>r&&r.equal_to?r.equal_to(n):r===n))}remove(t,n=t){let o=this.tree_search(this.root,new dQ(t));if(!o)return;if(arguments.length<2)return this.tree_delete(o),o;let r=o.item.values.findIndex((i)=>i&&i.equal_to?i.equal_to(n):i===n);return r>=0?(o.item.values.splice(r,1),o.item.values.length===0&&this.tree_delete(o),o):void 0}search(t,n=(o,r)=>o===r?r.output():o){let o=new dQ(t),r=[];this.tree_search_interval(this.root,o,r);let i=[];for(let s of r)for(let a of s.item.values)i.push(n(a,s.item.key));return i}intersect_any(t){let n=new dQ(t);return this.tree_find_any_interval(this.root,n)}forEach(t){this.tree_walk(this.root,(n)=>{for(let o of n.item.values)t(n.item.key,o)})}map(t){let n=new e;return this.tree_walk(this.root,(o)=>{for(let r of o.item.values)n.insert(o.item.key,t(r,o.item.key))}),n}*iterate(t,n=(o,r)=>o===r?r.output():o){let o=null;for(t?o=this.tree_search_nearest_forward(this.root,new dQ(t)):this.root&&(o=this.local_minimum(this.root));o;){for(let r of o.item.values)yield n(r,o.item.key);o=this.tree_successor(o)}}recalc_max(t){let n=t;for(;n.parent!=null;)n.parent.update_max(),n=n.parent}tree_insert(t){let n=this.root,o=null;if(this.root==null||this.root===this.nil_node)this.root=t;else{for(;n!==this.nil_node;)o=n,n=t.less_than(n)?n.left:n.right;t.parent=o,t.less_than(o)?o.left=t:o.right=t}this.insert_fixup(t)}insert_fixup(t){let n,o;for(n=t;n!==this.root&&n.parent.color===1;)n.parent===n.parent.parent.left?(o=n.parent.parent.right,o.color===1?(n.parent.color=0,o.color=0,n.parent.parent.color=1,n=n.parent.parent):(n===n.parent.right&&(n=n.parent,this.rotate_left(n)),n.parent.color=0,n.parent.parent.color=1,this.rotate_right(n.parent.parent))):(o=n.parent.parent.left,o.color===1?(n.parent.color=0,o.color=0,n.parent.parent.color=1,n=n.parent.parent):(n===n.parent.left&&(n=n.parent,this.rotate_right(n)),n.parent.color=0,n.parent.parent.color=1,this.rotate_left(n.parent.parent)));this.root.color=0}tree_delete(t){let n,o;n=t.left===this.nil_node||t.right===this.nil_node?t:this.tree_successor(t),o=n.left!==this.nil_node?n.left:n.right,o.parent=n.parent,n===this.root?this.root=o:(n===n.parent.left?n.parent.left=o:n.parent.right=o,n.parent.update_max()),this.recalc_max(o),n!==t&&(t.copy_data(n),t.update_max(),this.recalc_max(t)),n.color===0&&this.delete_fixup(o)}delete_fixup(t){let n,o=t;for(;o!==this.root&&o.parent!=null&&o.color===0;)o===o.parent.left?(n=o.parent.right,n.color===1&&(n.color=0,o.parent.color=1,this.rotate_left(o.parent),n=o.parent.right),n.left.color===0&&n.right.color===0?(n.color=1,o=o.parent):(n.right.color===0&&(n.color=1,n.left.color=0,this.rotate_right(n),n=o.parent.right),n.color=o.parent.color,o.parent.color=0,n.right.color=0,this.rotate_left(o.parent),o=this.root)):(n=o.parent.left,n.color===1&&(n.color=0,o.parent.color=1,this.rotate_right(o.parent),n=o.parent.left),n.left.color===0&&n.right.color===0?(n.color=1,o=o.parent):(n.left.color===0&&(n.color=1,n.right.color=0,this.rotate_left(n),n=o.parent.left),n.color=o.parent.color,o.parent.color=0,n.left.color=0,this.rotate_right(o.parent),o=this.root));o.color=0}tree_search(t,n){if(t!=null&&t!==this.nil_node)return n.equal_to(t)?t:n.less_than(t)?this.tree_search(t.left,n):this.tree_search(t.right,n)}tree_search_nearest_forward(t,n){let o=null,r=t;for(;r&&r!==this.nil_node;)r.less_than(n)?r.intersect(n)?(o=r,r=r.left):r=r.right:(o&&!r.less_than(o)||(o=r),r=r.left);return o||null}tree_search_interval(t,n,o){t!=null&&t!==this.nil_node&&(t.left===this.nil_node||t.not_intersect_left_subtree(n)||this.tree_search_interval(t.left,n,o),t.intersect(n)&&o.push(t),t.right===this.nil_node||t.not_intersect_right_subtree(n)||this.tree_search_interval(t.right,n,o))}tree_find_any_interval(t,n){let o=!1;return t!=null&&t!==this.nil_node&&(t.left===this.nil_node||t.not_intersect_left_subtree(n)||(o=this.tree_find_any_interval(t.left,n)),o||(o=t.intersect(n)),o||t.right===this.nil_node||t.not_intersect_right_subtree(n)||(o=this.tree_find_any_interval(t.right,n))),o}local_minimum(t){let n=t;for(;n.left!=null&&n.left!==this.nil_node;)n=n.left;return n}local_maximum(t){let n=t;for(;n.right!=null&&n.right!==this.nil_node;)n=n.right;return n}tree_successor(t){let n,o,r;if(t.right!==this.nil_node)n=this.local_minimum(t.right);else{for(o=t,r=t.parent;r!=null&&r.right===o;)o=r,r=r.parent;n=r}return n}rotate_left(t){let n=t.right;t.right=n.left,n.left!==this.nil_node&&(n.left.parent=t),n.parent=t.parent,t===this.root?this.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n.left=t,t.parent=n,t!==null&&t!==this.nil_node&&t.update_max(),n!=null&&n!==this.nil_node&&n.update_max()}rotate_right(t){let n=t.left;t.left=n.right,n.right!==this.nil_node&&(n.right.parent=t),n.parent=t.parent,t===this.root?this.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n.right=t,t.parent=n,t!==null&&t!==this.nil_node&&t.update_max(),n!=null&&n!==this.nil_node&&n.update_max()}tree_walk(t,n){t!=null&&t!==this.nil_node&&(this.tree_walk(t.left,n),n(t),this.tree_walk(t.right,n))}testRedBlackProperty(){let t=!0;return this.tree_walk(this.root,function(n){n.color===1&&(n.left.color===0&&n.right.color===0||(t=!1))}),t}testBlackHeightProperty(t){let n=0,o=0,r=0;if(t.color===0&&n++,o=t.left!==this.nil_node?this.testBlackHeightProperty(t.left):1,r=t.right!==this.nil_node?this.testBlackHeightProperty(t.right):1,o!==r)throw Error("Red-black height property violated");return n+=o,n}},Dgr=class extends Set{constructor(e){super(e),this.index=new hKe,this.forEach((t)=>this.index.insert(t))}add(e){let t=this.size,{key:n,value:o}=e,r=n||e.box,i=o||e;return super.add(i),this.size>t&&this.index.insert(r,i),this}delete(e){let{key:t,value:n}=e,o=t||e.box,r=n||e,i=super.delete(r);return i&&this.index.remove(o,r),i}clear(){super.clear(),this.index=new hKe}search(e){return this.index.search(e)}hit(e){let t=new Ve.Box(e.x-1,e.y-1,e.x+1,e.y+1);return this.index.search(t).filter((n)=>e.on(n))}svg(){return[...this].reduce((e,t)=>e+t.svg(),"")}};Ve.PlanarSet=Dgr;var rk=class{get name(){throw y0.CANNOT_INVOKE_ABSTRACT_METHOD}get box(){throw y0.CANNOT_INVOKE_ABSTRACT_METHOD}clone(){throw y0.CANNOT_INVOKE_ABSTRACT_METHOD}translate(...e){return this.transform(new HQ().translate(...e))}rotate(e,t=new Ve.Point){return this.transform(new HQ().rotate(e,t.x,t.y))}scale(e,t){return this.transform(new HQ().scale(e,t))}transform(...e){throw y0.CANNOT_INVOKE_ABSTRACT_METHOD}toJSON(){return Object.assign({},this,{name:this.name})}svg(e={}){throw y0.CANNOT_INVOKE_ABSTRACT_METHOD}},Ip=class e extends rk{constructor(...t){if(super(),this.x=0,this.y=0,t.length!==0){if(t.length===1&&t[0]instanceof Array&&t[0].length===2){let n=t[0];if(typeof n[0]=="number"&&typeof n[1]=="number")return this.x=n[0],void(this.y=n[1])}if(t.length===1&&t[0]instanceof Object&&t[0].name==="point"){let{x:n,y:o}=t[0];return this.x=n,void(this.y=o)}if(t.length===2&&typeof t[0]=="number"&&typeof t[1]=="number")return this.x=t[0],void(this.y=t[1]);throw y0.ILLEGAL_PARAMETERS}}get box(){return new Ve.Box(this.x,this.y,this.x,this.y)}clone(){return new Ve.Point(this.x,this.y)}get vertices(){return[this.clone()]}equalTo(t){return Ve.Utils.EQ(this.x,t.x)&&Ve.Utils.EQ(this.y,t.y)}lessThan(t){return!!Ve.Utils.LT(this.y,t.y)||!(!Ve.Utils.EQ(this.y,t.y)||!Ve.Utils.LT(this.x,t.x))}transform(t){return new Ve.Point(t.transform([this.x,this.y]))}projectionOn(t){if(this.equalTo(t.pt))return this.clone();let n=new Ve.Vector(this,t.pt);if(Ve.Utils.EQ_0(n.cross(t.norm)))return t.pt.clone();let o=n.dot(t.norm),r=t.norm.multiply(o);return this.translate(r)}leftTo(t){let n=new Ve.Vector(t.pt,this);return Ve.Utils.GT(n.dot(t.norm),0)}distanceTo(t){if(t instanceof e){let n=t.x-this.x,o=t.y-this.y;return[Math.sqrt(n*n+o*o),new Ve.Segment(this,t)]}return t instanceof Ve.Line?Ve.Distance.point2line(this,t):t instanceof Ve.Circle?Ve.Distance.point2circle(this,t):t instanceof Ve.Segment?Ve.Distance.point2segment(this,t):t instanceof Ve.Arc?Ve.Distance.point2arc(this,t):t instanceof Ve.Box?Ve.Distance.point2polygon(this,new Ve.Polygon(t)):t instanceof Ve.Polygon?Ve.Distance.point2polygon(this,t):t instanceof Ve.PlanarSet?Ve.Distance.shape2planarSet(this,t):t instanceof Ve.Multiline?Ve.Distance.shape2multiline(this,t):void 0}on(t){if(t instanceof Ve.Point)return this.equalTo(t);if(t.contains&&t.contains instanceof Function)return t.contains(this);throw Ve.Errors.UNSUPPORTED_SHAPE_TYPE}get name(){return"point"}svg(t={}){let n=t.r??3;return`
<circle cx="${this.x}" cy="${this.y}" r="${n}"
            ${oY({fill:"red",...t})} />`}};Ve.Point=Ip;var Ngr=(...e)=>new Ve.Point(...e);Ve.point=Ngr;var Pbe=class extends rk{constructor(...e){if(super(),this.x=0,this.y=0,e.length!==0){if(e.length===1&&e[0]instanceof Array&&e[0].length===2){let t=e[0];if(typeof t[0]=="number"&&typeof t[1]=="number")return this.x=t[0],void(this.y=t[1])}if(e.length===1&&e[0]instanceof Object&&e[0].name==="vector"){let{x:t,y:n}=e[0];return this.x=t,void(this.y=n)}if(e.length===1&&e[0]instanceof Object&&e[0].name==="segment"){let{start:t,end:n}=e[0];return this.x=n.x-t.x,void(this.y=n.y-t.y)}if(e.length===2){let t=e[0],n=e[1];if(typeof t=="number"&&typeof n=="number")return this.x=t,void(this.y=n);if(t instanceof Ve.Point&&n instanceof Ve.Point)return this.x=n.x-t.x,void(this.y=n.y-t.y)}throw y0.ILLEGAL_PARAMETERS}}clone(){return new Ve.Vector(this.x,this.y)}get slope(){let e=Math.atan2(this.y,this.x);return e<0&&(e=2*Math.PI+e),e}get length(){return Math.sqrt(this.dot(this))}isZeroLength(){return Ve.Utils.EQ_0(this.length)}equalTo(e){return Ve.Utils.EQ(this.x,e.x)&&Ve.Utils.EQ(this.y,e.y)}multiply(e){return new Ve.Vector(e*this.x,e*this.y)}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}normalize(){if(this.isZeroLength())throw y0.ZERO_DIVISION;return new Ve.Vector(this.x/this.length,this.y/this.length)}rotate(e,t=new Ve.Point){if(t.x===0&&t.y===0)return this.transform(new HQ().rotate(e));throw y0.OPERATION_IS_NOT_SUPPORTED}transform(e){return new Ve.Vector(e.transform([this.x,this.y]))}rotate90CCW(){return new Ve.Vector(-this.y,this.x)}rotate90CW(){return new Ve.Vector(this.y,-this.x)}invert(){return new Ve.Vector(-this.x,-this.y)}add(e){return new Ve.Vector(this.x+e.x,this.y+e.y)}subtract(e){return new Ve.Vector(this.x-e.x,this.y-e.y)}angleTo(e){let t=this.normalize(),n=e.normalize(),o=Math.atan2(t.cross(n),t.dot(n));return o<0&&(o+=2*Math.PI),o}projectionOn(e){let t=e.normalize(),n=this.dot(t);return t.multiply(n)}get name(){return"vector"}};Ve.Vector=Pbe;var FKt=(...e)=>new Ve.Vector(...e);Ve.vector=FKt;var ZS=class e extends rk{constructor(...t){if(super(),this.ps=new Ve.Point,this.pe=new Ve.Point,t.length!==0){if(t.length===1&&t[0]instanceof Array&&t[0].length===4){let n=t[0];return this.ps=new Ve.Point(n[0],n[1]),void(this.pe=new Ve.Point(n[2],n[3]))}if(t.length===1&&t[0]instanceof Object&&t[0].name==="segment"){let{ps:n,pe:o}=t[0];return this.ps=new Ve.Point(n.x,n.y),void(this.pe=new Ve.Point(o.x,o.y))}if(!(t.length===1&&t[0]instanceof Ve.Point)){if(t.length===2&&t[0]instanceof Ve.Point&&t[1]instanceof Ve.Point)return this.ps=t[0].clone(),void(this.pe=t[1].clone());if(t.length===4)return this.ps=new Ve.Point(t[0],t[1]),void(this.pe=new Ve.Point(t[2],t[3]));throw y0.ILLEGAL_PARAMETERS}this.ps=t[0].clone()}}clone(){return new Ve.Segment(this.start,this.end)}get start(){return this.ps}get end(){return this.pe}get vertices(){return[this.ps.clone(),this.pe.clone()]}get length(){return this.start.distanceTo(this.end)[0]}get slope(){return new Ve.Vector(this.start,this.end).slope}get box(){return new Ve.Box(Math.min(this.start.x,this.end.x),Math.min(this.start.y,this.end.y),Math.max(this.start.x,this.end.x),Math.max(this.start.y,this.end.y))}equalTo(t){return this.ps.equalTo(t.ps)&&this.pe.equalTo(t.pe)}contains(t){return Ve.Utils.EQ_0(this.distanceToPoint(t))}intersect(t){return t instanceof Ve.Point?this.contains(t)?[t]:[]:t instanceof Ve.Line?Rle(this,t):t instanceof Ve.Ray?Vqe(t,this):t instanceof Ve.Segment?fCe(this,t):t instanceof Ve.Circle?yCe(this,t):t instanceof Ve.Box?function(n,o){let r=[];for(let i of o.toSegments()){let s=fCe(i,n);for(let a of s)r.push(a)}return r}(this,t):t instanceof Ve.Arc?cq(this,t):t instanceof Ve.Polygon?zqe(this,t):t instanceof Ve.Multiline?Hq(this,t):void 0}distanceTo(t){if(t instanceof Ve.Point){let[n,o]=Ve.Distance.point2segment(t,this);return o=o.reverse(),[n,o]}if(t instanceof Ve.Circle){let[n,o]=Ve.Distance.segment2circle(this,t);return[n,o]}if(t instanceof Ve.Line){let[n,o]=Ve.Distance.segment2line(this,t);return[n,o]}if(t instanceof Ve.Segment){let[n,o]=Ve.Distance.segment2segment(this,t);return[n,o]}if(t instanceof Ve.Arc){let[n,o]=Ve.Distance.segment2arc(this,t);return[n,o]}if(t instanceof Ve.Box){let[n,o]=Ve.Distance.shape2polygon(this,new Ve.Polygon(t));return[n,o]}if(t instanceof Ve.Polygon){let[n,o]=Ve.Distance.shape2polygon(this,t);return[n,o]}if(t instanceof Ve.PlanarSet){let[n,o]=Ve.Distance.shape2planarSet(this,t);return[n,o]}if(t instanceof Ve.Multiline)return Ve.Distance.shape2multiline(this,t)}tangentInStart(){return new Ve.Vector(this.start,this.end).normalize()}tangentInEnd(){return new Ve.Vector(this.end,this.start).normalize()}reverse(){return new e(this.end,this.start)}split(t){return this.start.equalTo(t)?[null,this.clone()]:this.end.equalTo(t)?[this.clone(),null]:[new Ve.Segment(this.start,t),new Ve.Segment(t,this.end)]}middle(){return new Ve.Point((this.start.x+this.end.x)/2,(this.start.y+this.end.y)/2)}pointAtLength(t){if(t>this.length||t<0)return null;if(t==0)return this.start;if(t==this.length)return this.end;let n=t/this.length;return new Ve.Point((this.end.x-this.start.x)*n+this.start.x,(this.end.y-this.start.y)*n+this.start.y)}distanceToPoint(t){let[n,...o]=Ve.Distance.point2segment(t,this);return n}definiteIntegral(t=0){return(this.end.x-this.start.x)*(this.start.y-t+(this.end.y-t))/2}transform(t=new Ve.Matrix){return new e(this.ps.transform(t),this.pe.transform(t))}isZeroLength(){return this.ps.equalTo(this.pe)}sortPoints(t){return new Ve.Line(this.start,this.end).sortPoints(t)}get name(){return"segment"}svg(t={}){return`
<line x1="${this.start.x}" y1="${this.start.y}" x2="${this.end.x}" y2="${this.end.y}" ${oY(t)} />`}};Ve.Segment=ZS;var Rgr=(...e)=>new Ve.Segment(...e);Ve.segment=Rgr;var{vector:Sae}=Ve;Ve.Line=class e extends rk{constructor(...t){if(super(),this.pt=new Ve.Point,this.norm=new Ve.Vector(0,1),t.length!==0){if(t.length===1&&t[0]instanceof Object&&t[0].name==="line"){let{pt:n,norm:o}=t[0];return this.pt=new Ve.Point(n),void(this.norm=new Ve.Vector(o))}if(t.length===2){let n=t[0],o=t[1];if(n instanceof Ve.Point&&o instanceof Ve.Point)return this.pt=n,this.norm=e.points2norm(n,o),void(this.norm.dot(Sae(this.pt.x,this.pt.y))>=0&&this.norm.invert());if(n instanceof Ve.Point&&o instanceof Ve.Vector){if(Ve.Utils.EQ_0(o.x)&&Ve.Utils.EQ_0(o.y))throw y0.ILLEGAL_PARAMETERS;return this.pt=n.clone(),this.norm=o.clone(),this.norm=this.norm.normalize(),void(this.norm.dot(Sae(this.pt.x,this.pt.y))>=0&&this.norm.invert())}if(n instanceof Ve.Vector&&o instanceof Ve.Point){if(Ve.Utils.EQ_0(n.x)&&Ve.Utils.EQ_0(n.y))throw y0.ILLEGAL_PARAMETERS;return this.pt=o.clone(),this.norm=n.clone(),this.norm=this.norm.normalize(),void(this.norm.dot(Sae(this.pt.x,this.pt.y))>=0&&this.norm.invert())}}throw y0.ILLEGAL_PARAMETERS}}clone(){return new Ve.Line(this.pt,this.norm)}get start(){}get end(){}get length(){return Number.POSITIVE_INFINITY}get box(){return new Ve.Box(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY)}get middle(){}get slope(){return new Ve.Vector(this.norm.y,-this.norm.x).slope}get standard(){return[this.norm.x,this.norm.y,this.norm.dot(Sae(this.pt.x,this.pt.y))]}parallelTo(t){return Ve.Utils.EQ_0(this.norm.cross(t.norm))}incidentTo(t){return this.parallelTo(t)&&this.pt.on(t)}contains(t){if(this.pt.equalTo(t))return!0;let n=new Ve.Vector(this.pt,t);return Ve.Utils.EQ_0(this.norm.dot(n))}coord(t){return Sae(t.x,t.y).cross(this.norm)}intersect(t){return t instanceof Ve.Point?this.contains(t)?[t]:[]:t instanceof Ve.Line?Lq(this,t):t instanceof Ve.Ray?BKt(t,this):t instanceof Ve.Circle?rY(this,t):t instanceof Ve.Box?aq(this,t):t instanceof Ve.Segment?Rle(t,this):t instanceof Ve.Arc?Sbe(this,t):t instanceof Ve.Polygon?Qle(this,t):t instanceof Ve.Multiline?Hq(this,t):void 0}distanceTo(t){if(t instanceof Ve.Point){let[n,o]=Ve.Distance.point2line(t,this);return o=o.reverse(),[n,o]}if(t instanceof Ve.Circle){let[n,o]=Ve.Distance.circle2line(t,this);return o=o.reverse(),[n,o]}if(t instanceof Ve.Segment){let[n,o]=Ve.Distance.segment2line(t,this);return[n,o.reverse()]}if(t instanceof Ve.Arc){let[n,o]=Ve.Distance.arc2line(t,this);return[n,o.reverse()]}if(t instanceof Ve.Box){let[n,o]=Ve.Distance.shape2polygon(this,new Ve.Polygon(t));return[n,o]}if(t instanceof Ve.Polygon){let[n,o]=Ve.Distance.shape2polygon(this,t);return[n,o]}}split(t){if(t instanceof Ve.Point)return[new Ve.Ray(t,this.norm),new Ve.Ray(t,this.norm)];{let n=new Ve.Multiline([this]),o=this.sortPoints(t);return n.split(o),n.toShapes()}}rotate(t,n=new Ve.Point){return new Ve.Line(this.pt.rotate(t,n),this.norm.rotate(t))}transform(t){return new Ve.Line(this.pt.transform(t),this.norm.clone())}sortPoints(t){return t.slice().sort((n,o)=>this.coord(n)<this.coord(o)?-1:this.coord(n)>this.coord(o)?1:0)}get name(){return"line"}svg(t,n={}){let o=aq(this,t);if(o.length===0)return"";let r=o[0],i=o.length===2?o[1]:o.find((s)=>!s.equalTo(r));return i===void 0&&(i=r),new Ve.Segment(r,i).svg(n)}static points2norm(t,n){if(t.equalTo(n))throw y0.ILLEGAL_PARAMETERS;return new Ve.Vector(t,n).normalize().rotate90CCW()}};var Qgr=(...e)=>new Ve.Line(...e);Ve.line=Qgr;var Uqe=class extends rk{constructor(...e){if(super(),this.pc=new Ve.Point,this.r=1,e.length===1&&e[0]instanceof Object&&e[0].name==="circle"){let{pc:t,r:n}=e[0];this.pc=new Ve.Point(t),this.r=n}else{let[t,n]=[...e];t&&t instanceof Ve.Point&&(this.pc=t.clone()),n!==void 0&&(this.r=n)}}clone(){return new Ve.Circle(this.pc.clone(),this.r)}get center(){return this.pc}get box(){return new Ve.Box(this.pc.x-this.r,this.pc.y-this.r,this.pc.x+this.r,this.pc.y+this.r)}contains(e){return e instanceof Ve.Point?Ve.Utils.LE(e.distanceTo(this.center)[0],this.r):e instanceof Ve.Segment?Ve.Utils.LE(e.start.distanceTo(this.center)[0],this.r)&&Ve.Utils.LE(e.end.distanceTo(this.center)[0],this.r):e instanceof Ve.Arc?this.intersect(e).length===0&&Ve.Utils.LE(e.start.distanceTo(this.center)[0],this.r)&&Ve.Utils.LE(e.end.distanceTo(this.center)[0],this.r):e instanceof Ve.Circle?this.intersect(e).length===0&&Ve.Utils.LE(e.r,this.r)&&Ve.Utils.LE(e.center.distanceTo(this.center)[0],this.r):void 0}toArc(e=!0){return new Ve.Arc(this.center,this.r,Math.PI,-Math.PI,e)}scale(e,t){if(e!==t)throw y0.OPERATION_IS_NOT_SUPPORTED;if(this.pc.x!==0||this.pc.y!==0)throw y0.OPERATION_IS_NOT_SUPPORTED;return new Ve.Circle(this.pc,this.r*e)}transform(e=new Ve.Matrix){return new Ve.Circle(this.pc.transform(e),this.r)}intersect(e){return e instanceof Ve.Point?this.contains(e)?[e]:[]:e instanceof Ve.Line?rY(e,this):e instanceof Ve.Ray?wKt(e,this):e instanceof Ve.Segment?yCe(e,this):e instanceof Ve.Circle?CKt(e,this):e instanceof Ve.Box?function(t,n){let o=[];for(let r of n.toSegments()){let i=yCe(r,t);for(let s of i)o.push(s)}return o}(this,e):e instanceof Ve.Arc?Fqe(e,this):e instanceof Ve.Polygon?PKt(this,e):e instanceof Ve.Multiline?Hq(this,e):void 0}distanceTo(e){if(e instanceof Ve.Point){let[t,n]=Ve.Distance.point2circle(e,this);return n=n.reverse(),[t,n]}if(e instanceof Ve.Circle){let[t,n]=Ve.Distance.circle2circle(this,e);return[t,n]}if(e instanceof Ve.Line){let[t,n]=Ve.Distance.circle2line(this,e);return[t,n]}if(e instanceof Ve.Segment){let[t,n]=Ve.Distance.segment2circle(e,this);return n=n.reverse(),[t,n]}if(e instanceof Ve.Arc){let[t,n]=Ve.Distance.arc2circle(e,this);return n=n.reverse(),[t,n]}if(e instanceof Ve.Box){let[t,n]=Ve.Distance.shape2polygon(this,new Ve.Polygon(e));return[t,n]}if(e instanceof Ve.Polygon){let[t,n]=Ve.Distance.shape2polygon(this,e);return[t,n]}if(e instanceof Ve.PlanarSet){let[t,n]=Ve.Distance.shape2planarSet(this,e);return[t,n]}if(e instanceof Ve.Multiline){let[t,n]=Ve.Distance.shape2multiline(this,e);return[t,n]}}get name(){return"circle"}svg(e={}){return`
<circle cx="${this.pc.x}" cy="${this.pc.y}" r="${this.r}"
                ${oY({fill:"none",...e})} />`}};Ve.Circle=Uqe;Ve.circle=(...e)=>new Ve.Circle(...e);var t6=class extends rk{constructor(...e){if(super(),this.pc=new Ve.Point,this.r=1,this.startAngle=0,this.endAngle=2*Math.PI,this.counterClockwise=!0,e.length!==0)if(e.length===1&&e[0]instanceof Object&&e[0].name==="arc"){let{pc:t,r:n,startAngle:o,endAngle:r,counterClockwise:i}=e[0];this.pc=new Ve.Point(t.x,t.y),this.r=n,this.startAngle=o,this.endAngle=r,this.counterClockwise=i}else{let[t,n,o,r,i]=[...e];t&&t instanceof Ve.Point&&(this.pc=t.clone()),n!==void 0&&(this.r=n),o!==void 0&&(this.startAngle=o),r!==void 0&&(this.endAngle=r),i!==void 0&&(this.counterClockwise=i)}}clone(){return new Ve.Arc(this.pc.clone(),this.r,this.startAngle,this.endAngle,this.counterClockwise)}get sweep(){let e=this.startAngle,t=this.endAngle;if(Ve.Utils.EQ(Math.abs(e-t),Ve.PIx2))return Ve.PIx2;Math.abs(e)>Ve.PIx2&&(e-=Math.trunc(e/Ve.PIx2)*Ve.PIx2),e<0&&(e+=Ve.PIx2),Math.abs(t)>Ve.PIx2&&(t-=Math.trunc(t/Ve.PIx2)*Ve.PIx2),t<0&&(t+=Ve.PIx2);let n=this.counterClockwise?t-e:e-t;return n<0&&(n+=Ve.PIx2),n}get start(){return new Ve.Point(this.pc.x+this.r,this.pc.y).rotate(this.startAngle,this.pc)}get end(){return new Ve.Point(this.pc.x+this.r,this.pc.y).rotate(this.endAngle,this.pc)}get center(){return this.pc.clone()}get vertices(){return[this.start.clone(),this.end.clone()]}get length(){return Math.abs(this.sweep*this.r)}get box(){let e=this.breakToFunctional().reduce((t,n)=>t.merge(n.start.box),new Ve.Box);return e=e.merge(this.end.box),e}contains(e){if(!Ve.Utils.EQ(this.pc.distanceTo(e)[0],this.r))return!1;if(e.equalTo(this.start))return!0;let t=new Ve.Vector(this.pc,e).slope,n=new Ve.Arc(this.pc,this.r,this.startAngle,t,this.counterClockwise);return Ve.Utils.LE(n.length,this.length)}split(e){if(this.start.equalTo(e))return[null,this.clone()];if(this.end.equalTo(e))return[this.clone(),null];let t=new Ve.Vector(this.pc,e).slope;return[new Ve.Arc(this.pc,this.r,this.startAngle,t,this.counterClockwise),new Ve.Arc(this.pc,this.r,t,this.endAngle,this.counterClockwise)]}middle(){let e=this.counterClockwise?this.startAngle+this.sweep/2:this.startAngle-this.sweep/2;return new Ve.Arc(this.pc,this.r,this.startAngle,e,this.counterClockwise).end}pointAtLength(e){if(e>this.length||e<0)return null;if(e===0)return this.start;if(e===this.length)return this.end;let t=e/this.length,n=this.counterClockwise?this.startAngle+this.sweep*t:this.startAngle-this.sweep*t;return new Ve.Arc(this.pc,this.r,this.startAngle,n,this.counterClockwise).end}chordHeight(){return(1-Math.cos(Math.abs(this.sweep/2)))*this.r}intersect(e){return e instanceof Ve.Point?this.contains(e)?[e]:[]:e instanceof Ve.Line?Sbe(e,this):e instanceof Ve.Ray?Yqe(e,this):e instanceof Ve.Circle?Fqe(this,e):e instanceof Ve.Segment?cq(e,this):e instanceof Ve.Box?function(t,n){let o=[];for(let r of n.toSegments()){let i=cq(r,t);for(let s of i)o.push(s)}return o}(this,e):e instanceof Ve.Arc?bKt(this,e):e instanceof Ve.Polygon?Oqe(this,e):e instanceof Ve.Multiline?Hq(this,e):void 0}distanceTo(e){if(e instanceof Ve.Point){let[t,n]=Ve.Distance.point2arc(e,this);return n=n.reverse(),[t,n]}if(e instanceof Ve.Circle){let[t,n]=Ve.Distance.arc2circle(this,e);return[t,n]}if(e instanceof Ve.Line){let[t,n]=Ve.Distance.arc2line(this,e);return[t,n]}if(e instanceof Ve.Segment){let[t,n]=Ve.Distance.segment2arc(e,this);return n=n.reverse(),[t,n]}if(e instanceof Ve.Arc){let[t,n]=Ve.Distance.arc2arc(this,e);return[t,n]}if(e instanceof Ve.Box){let[t,n]=Ve.Distance.shape2polygon(this,new Ve.Polygon(e));return[t,n]}if(e instanceof Ve.Polygon){let[t,n]=Ve.Distance.shape2polygon(this,e);return[t,n]}if(e instanceof Ve.PlanarSet){let[t,n]=Ve.Distance.shape2planarSet(this,e);return[t,n]}if(e instanceof Ve.Multiline)return Ve.Distance.shape2multiline(this,e)}breakToFunctional(){let e=[],t=[0,Math.PI/2,Math.PI,3*Math.PI/2],n=this.startAngle,o=this.endAngle;Ve.Utils.EQ(Math.abs(n-o),Ve.PIx2)&&(o=n),Math.abs(n)>Ve.PIx2&&(n-=Math.trunc(n/Ve.PIx2)*Ve.PIx2),n<0&&(n+=Ve.PIx2),Math.abs(o)>Ve.PIx2&&(o-=Math.trunc(o/Ve.PIx2)*Ve.PIx2),o<0&&(o+=Ve.PIx2);let r,i,s,a=n;this.counterClockwise?(i=Math.ceil(n/(Math.PI/2))%4,s=1):(i=Math.floor(n/(Math.PI/2))%4,s=-1);for(let c=0,l=i;c<4;c++,l=(l+s+4)%4){if(r=t[l],r===a)continue;let h=this.counterClockwise?r-n:n-r;if(h<0&&(h+=Ve.PIx2),h>this.sweep)break;e.push(new Ve.Arc(this.pc,this.r,a,r,this.counterClockwise)),a=r}return e.length===0?(e.push(this),e):(r=o,a!==r&&e.push(new Ve.Arc(this.pc,this.r,a,r,this.counterClockwise)),e)}tangentInStart(){let e=new Ve.Vector(this.pc,this.start),t=this.counterClockwise?Math.PI/2:-Math.PI/2;return e.rotate(t).normalize()}tangentInEnd(){let e=new Ve.Vector(this.pc,this.end),t=this.counterClockwise?-Math.PI/2:Math.PI/2;return e.rotate(t).normalize()}reverse(){return new Ve.Arc(this.pc,this.r,this.endAngle,this.startAngle,!this.counterClockwise)}transform(e=new Ve.Matrix){let t=this.start.transform(e),n=this.end.transform(e),o=this.pc.transform(e),r=this.counterClockwise;return e.a*e.d<0&&(r=!r),Ve.Arc.arcSE(o,t,n,r)}static arcSE(e,t,n,o){let{vector:r}=Ve,i=r(e,t).slope,s=r(e,n).slope;Ve.Utils.EQ(i,s)&&(s+=2*Math.PI,o=!0);let a=r(e,t).length;return new Ve.Arc(e,a,i,s,o)}definiteIntegral(e=0){return this.breakToFunctional().reduce((t,n)=>t+n.circularSegmentDefiniteIntegral(e),0)}circularSegmentDefiniteIntegral(e){let t=new Ve.Segment(this.start,this.end).definiteIntegral(e),n=Ve.Utils.EQ(this.sweep,Ve.PIx2)?0:this.circularSegmentArea();return this.counterClockwise?t-n:t+n}circularSegmentArea(){return 0.5*this.r*this.r*(this.sweep-Math.sin(this.sweep))}sortPoints(e){let{vector:t}=Ve;return e.slice().sort((n,o)=>{let r=t(this.pc,n).slope,i=t(this.pc,o).slope;return r<i?-1:r>i?1:0})}get name(){return"arc"}svg(e={}){let t=this.sweep<=Math.PI?"0":"1",n=this.counterClockwise?"1":"0";if(Ve.Utils.EQ(this.sweep,2*Math.PI))return new Ve.Circle(this.pc,this.r).svg(e);return`
<path d="M${this.start.x},${this.start.y}
                             A${this.r},${this.r} 0 ${t},${n} ${this.end.x},${this.end.y}"
                    ${oY({fill:"none",...e})} />`}};Ve.Arc=t6;Ve.arc=(...e)=>new Ve.Arc(...e);var Wqe=class e extends rk{constructor(t=void 0,n=void 0,o=void 0,r=void 0){super(),this.xmin=t,this.ymin=n,this.xmax=o,this.ymax=r}clone(){return new e(this.xmin,this.ymin,this.xmax,this.ymax)}get low(){return new Ve.Point(this.xmin,this.ymin)}get high(){return new Ve.Point(this.xmax,this.ymax)}get max(){return this.clone()}get center(){return new Ve.Point((this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)}get width(){return Math.abs(this.xmax-this.xmin)}get height(){return Math.abs(this.ymax-this.ymin)}get box(){return this.clone()}not_intersect(t){return this.xmax<t.xmin||this.xmin>t.xmax||this.ymax<t.ymin||this.ymin>t.ymax}intersect(t){return!this.not_intersect(t)}merge(t){return new e(this.xmin===void 0?t.xmin:Math.min(this.xmin,t.xmin),this.ymin===void 0?t.ymin:Math.min(this.ymin,t.ymin),this.xmax===void 0?t.xmax:Math.max(this.xmax,t.xmax),this.ymax===void 0?t.ymax:Math.max(this.ymax,t.ymax))}less_than(t){return!!this.low.lessThan(t.low)||!(!this.low.equalTo(t.low)||!this.high.lessThan(t.high))}equal_to(t){return this.low.equalTo(t.low)&&this.high.equalTo(t.high)}output(){return this.clone()}comparable_less_than(t,n){return t.lessThan(n)}set(t,n,o,r){this.xmin=t,this.ymin=n,this.xmax=o,this.ymax=r}extend(t){return t<=0?this.clone():new e(this.xmin-t,this.ymin-t,this.xmax+t,this.ymax+t)}toPoints(){return[new Ve.Point(this.xmin,this.ymin),new Ve.Point(this.xmax,this.ymin),new Ve.Point(this.xmax,this.ymax),new Ve.Point(this.xmin,this.ymax)]}toSegments(){let t=this.toPoints();return[new Ve.Segment(t[0],t[1]),new Ve.Segment(t[1],t[2]),new Ve.Segment(t[2],t[3]),new Ve.Segment(t[3],t[0])]}rotate(t,n=new Ve.Point){throw y0.OPERATION_IS_NOT_SUPPORTED}transform(t=new Ve.Matrix){return this.toPoints().map((n)=>n.transform(t)).reduce((n,o)=>n.merge(o.box),new e)}contains(t){return t instanceof Ve.Point?t.x>=this.xmin&&t.x<=this.xmax&&t.y>=this.ymin&&t.y<=this.ymax:t instanceof Ve.Segment?t.vertices.every((n)=>this.contains(n)):t instanceof Ve.Box?t.toSegments().every((n)=>this.contains(n)):t instanceof Ve.Circle?this.contains(t.box):t instanceof Ve.Arc?t.vertices.every((n)=>this.contains(n))&&this.toSegments().every((n)=>cq(n,t).length===0):!(t instanceof Ve.Line||t instanceof Ve.Ray)&&(t instanceof Ve.Multiline?t.toShapes().every((n)=>this.contains(n)):t instanceof Ve.Polygon?this.contains(t.box):void 0)}distanceTo(t){let n=this.toSegments().map((r)=>r.distanceTo(t)),o=[Number.MAX_SAFE_INTEGER,null];return n.forEach((r)=>{r[0]<o[0]&&(o=r)}),o}get name(){return"box"}svg(t={}){let n=this.xmax-this.xmin,o=this.ymax-this.ymin;return`
<rect x="${this.xmin}" y="${this.ymin}" width="${n}" height="${o}"
                ${oY({fill:"none",...t})} />`}};Ve.Box=Wqe;Ve.box=(...e)=>new Ve.Box(...e);Ve.Edge=class{constructor(e){this.shape=e,this.next=void 0,this.prev=void 0,this.face=void 0,this.arc_length=0,this.bvStart=void 0,this.bvEnd=void 0,this.bv=void 0,this.overlap=void 0}get start(){return this.shape.start}get end(){return this.shape.end}get length(){return this.shape.length}get box(){return this.shape.box}get isSegment(){return this.shape instanceof Ve.Segment}get isArc(){return this.shape instanceof Ve.Arc}get isLine(){return this.shape instanceof Ve.Line}get isRay(){return this.shape instanceof Ve.Ray}middle(){return this.shape.middle()}pointAtLength(e){return this.shape.pointAtLength(e)}contains(e){return this.shape.contains(e)}setInclusion(e){if(this.bv!==void 0)return this.bv;if(this.shape instanceof Ve.Line||this.shape instanceof Ve.Ray)return this.bv=Ve.OUTSIDE,this.bv;if(this.bvStart===void 0&&(this.bvStart=bce(e,this.start)),this.bvEnd===void 0&&(this.bvEnd=bce(e,this.end)),this.bvStart===Ve.OUTSIDE||this.bvEnd==Ve.OUTSIDE)this.bv=Ve.OUTSIDE;else if(this.bvStart===Ve.INSIDE||this.bvEnd==Ve.INSIDE)this.bv=Ve.INSIDE;else{let t=bce(e,this.middle());this.bv=t}return this.bv}setOverlap(e){let t,n=this.shape,o=e.shape;n instanceof Ve.Segment&&o instanceof Ve.Segment?n.start.equalTo(o.start)&&n.end.equalTo(o.end)?t=Ve.OVERLAP_SAME:n.start.equalTo(o.end)&&n.end.equalTo(o.start)&&(t=Ve.OVERLAP_OPPOSITE):(n instanceof Ve.Arc&&o instanceof Ve.Arc||n instanceof Ve.Segment&&o instanceof Ve.Arc||n instanceof Ve.Arc&&o instanceof Ve.Segment)&&(n.start.equalTo(o.start)&&n.end.equalTo(o.end)&&n.middle().equalTo(o.middle())?t=Ve.OVERLAP_SAME:n.start.equalTo(o.end)&&n.end.equalTo(o.start)&&n.middle().equalTo(o.middle())&&(t=Ve.OVERLAP_OPPOSITE)),this.overlap===void 0&&(this.overlap=t),e.overlap===void 0&&(e.overlap=t)}svg(){if(this.shape instanceof Ve.Segment)return` L${this.shape.end.x},${this.shape.end.y}`;if(this.shape instanceof Ve.Arc){let e,t=this.shape,n=t.counterClockwise?"1":"0";if(Ve.Utils.EQ(t.sweep,2*Math.PI)){let o=t.counterClockwise?1:-1,r=new Ve.Arc(t.pc,t.r,t.startAngle,t.startAngle+o*Math.PI,t.counterClockwise),i=new Ve.Arc(t.pc,t.r,t.startAngle+o*Math.PI,t.endAngle,t.counterClockwise);return e="0",` A${r.r},${r.r} 0 ${e},${n} ${r.end.x},${r.end.y}
                    A${i.r},${i.r} 0 ${e},${n} ${i.end.x},${i.end.y}`}return e=t.sweep<=Math.PI?"0":"1",` A${t.r},${t.r} 0 ${e},${n} ${t.end.x},${t.end.y}`}}toJSON(){return this.shape.toJSON()}};var kgr=class extends Hqe{constructor(e,t){super(e,t),this.setCircularLinks()}setCircularLinks(){this.isEmpty()||(this.last.next=this.first,this.first.prev=this.last)}[Symbol.iterator](){let e;return{next:()=>{let t=e||this.first,n=!this.first||!!e&&e===this.first;return e=t?t.next:void 0,{value:t,done:n}}}}append(e){return super.append(e),this.setCircularLinks(),this}insert(e,t){return super.insert(e,t),this.setCircularLinks(),this}remove(e){return super.remove(e),this}};Ve.Face=class e extends kgr{constructor(t,...n){if(super(),this._box=void 0,this._orientation=void 0,n.length!==0){if(n.length===1){if(n[0]instanceof Array){let o=n[0];if(o.length===0)return;if(o.every((r)=>r instanceof Ve.Point)){let r=e.points2segments(o);this.shapes2face(t.edges,r)}else if(o.every((r)=>r instanceof Array&&r.length===2)){let r=o.map((s)=>new Ve.Point(s[0],s[1])),i=e.points2segments(r);this.shapes2face(t.edges,i)}else if(o.every((r)=>r instanceof Ve.Segment||r instanceof Ve.Arc))this.shapes2face(t.edges,o);else if(o.every((r)=>r.name==="segment"||r.name==="arc")){let r=[];for(let i of o){let s;s=i.name==="segment"?new Ve.Segment(i):new Ve.Arc(i),r.push(s)}this.shapes2face(t.edges,r)}}else if(n[0]instanceof e){let o=n[0];this.first=o.first,this.last=o.last;for(let r of o)t.edges.add(r)}else if(n[0]instanceof Ve.Circle)this.shapes2face(t.edges,[n[0].toArc(gKt)]);else if(n[0]instanceof Ve.Box){let o=n[0];this.shapes2face(t.edges,[new Ve.Segment(new Ve.Point(o.xmin,o.ymin),new Ve.Point(o.xmax,o.ymin)),new Ve.Segment(new Ve.Point(o.xmax,o.ymin),new Ve.Point(o.xmax,o.ymax)),new Ve.Segment(new Ve.Point(o.xmax,o.ymax),new Ve.Point(o.xmin,o.ymax)),new Ve.Segment(new Ve.Point(o.xmin,o.ymax),new Ve.Point(o.xmin,o.ymin))])}}n.length===2&&n[0]instanceof Ve.Edge&&n[1]instanceof Ve.Edge&&(this.first=n[0],this.last=n[1],this.last.next=this.first,this.first.prev=this.last,this.setArcLength())}}get edges(){return this.toArray()}get vertices(){return this.edges.map((t)=>t.shape.start.clone())}get shapes(){return this.edges.map((t)=>t.shape.clone())}get box(){if(this._box===void 0){let t=new Ve.Box;for(let n of this)t=t.merge(n.box);this._box=t}return this._box}get perimeter(){return this.last.arc_length+this.last.length}pointAtLength(t){if(t>this.perimeter||t<0)return null;let n=null;for(let o of this)if(t>=o.arc_length&&(o===this.last||t<o.next.arc_length)){n=o.pointAtLength(t-o.arc_length);break}return n}static points2segments(t){let n=[];for(let o=0;o<t.length;o++)t[o].equalTo(t[(o+1)%t.length])||n.push(new Ve.Segment(t[o],t[(o+1)%t.length]));return n}shapes2face(t,n){for(let o of n){let r=new Ve.Edge(o);this.append(r),t.add(r)}}append(t){return super.append(t),this.setOneEdgeArcLength(t),t.face=this,this}insert(t,n){return super.insert(t,n),this.setOneEdgeArcLength(t),t.face=this,this}remove(t){return super.remove(t),this.setArcLength(),this}merge_with_next_edge(t){return t.shape.end.x=t.next.shape.end.x,t.shape.end.y=t.next.shape.end.y,this.remove(t.next),this}reverse(){let t=[],n=this.last;do n.shape=n.shape.reverse(),t.push(n),n=n.prev;while(n!==this.last);this.first=void 0,this.last=void 0;for(let o of t)this.first===void 0?(o.prev=o,o.next=o,this.first=o,this.last=o):(o.prev=this.last,this.last.next=o,this.last=o,this.last.next=this.first,this.first.prev=this.last),this.setOneEdgeArcLength(o);this._orientation!==void 0&&(this._orientation=void 0,this._orientation=this.orientation())}setArcLength(){for(let t of this)this.setOneEdgeArcLength(t),t.face=this}setOneEdgeArcLength(t){t===this.first?t.arc_length=0:t.arc_length=t.prev.arc_length+t.prev.length}area(){return Math.abs(this.signedArea())}signedArea(){let t=0,n=this.box.ymin;for(let o of this)t+=o.shape.definiteIntegral(n);return t}orientation(){if(this._orientation===void 0){let t=this.signedArea();Ve.Utils.EQ_0(t)?this._orientation=H$.NOT_ORIENTABLE:Ve.Utils.LT(t,0)?this._orientation=H$.CCW:this._orientation=H$.CW}return this._orientation}isSimple(t){return e.getSelfIntersections(this,t,!0).length===0}static getSelfIntersections(t,n,o=!1){let r=[];for(let i of t){let s=n.search(i.box);for(let a of s){if(i===a)continue;if(a.face!==t)continue;if(i.shape instanceof Ve.Segment&&a.shape instanceof Ve.Segment&&(i.next===a||i.prev===a))continue;let c=i.shape.intersect(a.shape);for(let l of c)if((!l.equalTo(i.start)||!l.equalTo(a.end)||a!==i.prev)&&(!l.equalTo(i.end)||!l.equalTo(a.start)||a!==i.next)&&(r.push(l),o))break;if(r.length>0&&o)break}if(r.length>0&&o)break}return r}findEdgeByPoint(t){let n;for(let o of this)if(!t.equalTo(o.shape.start)&&(t.equalTo(o.shape.end)||o.shape.contains(t))){n=o;break}return n}toPolygon(){return new Ve.Polygon(this.shapes)}toJSON(){return this.edges.map((t)=>t.toJSON())}svg(){let t=`M${this.first.start.x},${this.first.start.y}`;for(let n of this)t+=n.svg();return t+=" z",t}};Ve.Ray=class e extends rk{constructor(...t){if(super(),this.pt=new Ve.Point,this.norm=new Ve.Vector(0,1),t.length!==0&&(t.length>=1&&t[0]instanceof Ve.Point&&(this.pt=t[0].clone()),t.length!==1)){if(!(t.length===2&&t[1]instanceof Ve.Vector))throw y0.ILLEGAL_PARAMETERS;this.norm=t[1].clone()}}clone(){return new e(this.pt,this.norm)}get slope(){return new Ve.Vector(this.norm.y,-this.norm.x).slope}get box(){let t=this.slope;return new Ve.Box(t>Math.PI/2&&t<3*Math.PI/2?Number.NEGATIVE_INFINITY:this.pt.x,t>=0&&t<=Math.PI?this.pt.y:Number.NEGATIVE_INFINITY,t>=Math.PI/2&&t<=3*Math.PI/2?this.pt.x:Number.POSITIVE_INFINITY,t>=Math.PI&&t<=2*Math.PI||t===0?this.pt.y:Number.POSITIVE_INFINITY)}get start(){return this.pt}get end(){}get length(){return Number.POSITIVE_INFINITY}contains(t){if(this.pt.equalTo(t))return!0;let n=new Ve.Vector(this.pt,t);return Ve.Utils.EQ_0(this.norm.dot(n))&&Ve.Utils.GE(n.cross(this.norm),0)}coord(t){return FKt(t.x,t.y).cross(this.norm)}split(t){return this.contains(t)?this.pt.equalTo(t)?[this]:[new Ve.Segment(this.pt,t),new Ve.Ray(t,this.norm)]:[]}intersect(t){return t instanceof Ve.Point?this.contains(t)?[t]:[]:t instanceof Ve.Segment?Vqe(this,t):t instanceof Ve.Arc?Yqe(this,t):t instanceof Ve.Line?BKt(this,t):t instanceof Ve.Ray?(o=t,Lq(LQ(n=this),LQ(o)).filter((s)=>n.contains(s)).filter((s)=>o.contains(s))):t instanceof Ve.Circle?wKt(this,t):t instanceof Ve.Box?(i=t,aq(LQ(r=this),i).filter((s)=>r.contains(s))):t instanceof Ve.Polygon?TKt(this,t):t instanceof Ve.Multiline?Hq(this,t):void 0;var n,o,r,i}rotate(t,n=new Ve.Point){return new Ve.Ray(this.pt.rotate(t,n),this.norm.rotate(t))}transform(t){return new Ve.Ray(this.pt.transform(t),this.norm.clone())}get name(){return"ray"}svg(t,n={}){let o=aq(new Ve.Line(this.pt,this.norm),t);return o=o.filter((r)=>this.contains(r)),o.length===0||o.length===2?"":new Ve.Segment(this.pt,o[0]).svg(n)}};Ve.ray=(...e)=>new Ve.Ray(...e);var l6=class e{constructor(){this.faces=new Ve.PlanarSet,this.edges=new Ve.PlanarSet;let t=[...arguments];if(t.length===1&&(t[0]instanceof Array&&t[0].length>0||t[0]instanceof Ve.Circle||t[0]instanceof Ve.Box)){let n=t[0];if(t[0]instanceof Array&&t[0].every((o)=>o instanceof Array))if(n.every((o)=>o instanceof Array&&o.length===2&&typeof o[0]=="number"&&typeof o[1]=="number"))this.faces.add(new Ve.Face(this,n));else for(let o of n)if(o instanceof Array&&o[0]instanceof Array&&o[0].every((r)=>r instanceof Array&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"))for(let r of o)this.faces.add(new Ve.Face(this,r));else this.faces.add(new Ve.Face(this,o));else this.faces.add(new Ve.Face(this,n))}}get box(){return[...this.faces].reduce((t,n)=>t.merge(n.box),new Ve.Box)}get vertices(){return[...this.faces].flatMap((t)=>t.vertices)}clone(){let t=new e;for(let n of this.faces)t.addFace(n.shapes);return t}createFromArray(t){let n=new e;return t.forEach((o)=>[...o.faces].forEach((r)=>n.addFace(r.shapes))),n}isEmpty(){return this.edges.size===0||this.faces.size===0}isValid(){let t=!0;for(let n of this.faces)if(!n.isSimple(this.edges)){t=!1;break}return t}area(){let t=[...this.faces].reduce((n,o)=>n+o.signedArea(),0);return Math.abs(t)}addFace(...t){let n=new Ve.Face(this,...t);return this.faces.add(n),n}deleteFace(t){for(let n of t)this.edges.delete(n);return this.faces.delete(t)}recreateFaces(){this.faces.clear();for(let o of this.edges)o.face=null;let t,n=!0;for(;n;){n=!1;for(let o of this.edges)if(o.face===null){t=o,n=!0;break}if(n){let o=t;do o=o.next;while(o.next!==t);this.addFace(t,o)}}}removeChain(t,n,o){if(o.next!==n){for(let r=n;r!==o.next;r=r.next)if(t.remove(r),this.edges.delete(r),t.isEmpty()){this.deleteFace(t);break}}else this.deleteFace(t)}addVertex(t,n){let o=n.shape.split(t);if(o[0]===null)return n.prev;if(o[1]===null)return n;let r=new Ve.Edge(o[0]),i=n.prev;return n.face.insert(r,i),this.edges.delete(n),this.edges.add(r),n.shape=o[1],this.edges.add(n),r}removeEndVertex(t){let n=t.next;n!==t&&(t.face.merge_with_next_edge(t),this.edges.delete(n))}cut(t){let n=this.splitToIslands().flatMap((o)=>o._cutSingleIsland(t)).filter((o)=>o.isValid()&&o.isEmpty()===!1);return this.createFromArray(n)}_cutSingleIsland(t){let n=this.clone(),o=t.clone(),r,i,s={int_points1:[],int_points2:[],int_points1_sorted:[],int_points2_sorted:[]};for(let a of o.edges)for(let c of n.edges){let l=EKt(a,c);for(let h of l)lq(a,h,s.int_points1),lq(c,h,s.int_points2)}if(s.int_points1.length===0)return n;s.int_points1_sorted=vQ(s.int_points1),s.int_points2_sorted=vQ(s.int_points2),dq(o,s.int_points1_sorted),dq(n,s.int_points2_sorted),Gqe(s),s.int_points1_sorted=vQ(s.int_points1),s.int_points2_sorted=vQ(s.int_points2),nKe(s.int_points1),oKe(s.int_points1,n);for(let a of s.int_points1_sorted)a.edge_before&&a.edge_after&&a.edge_before.bv===a.edge_after.bv&&(s.int_points2[a.id]=-1,a.id=-1);if(s.int_points1=s.int_points1.filter((a)=>a.id>=0),s.int_points2=s.int_points2.filter((a)=>a.id>=0),s.int_points1.forEach((a,c)=>{a.id=c}),s.int_points2.forEach((a,c)=>{a.id=c}),s.int_points1.length===0)return n;s.int_points1_sorted=vQ(s.int_points1),s.int_points2_sorted=vQ(s.int_points2);for(let a=1;a<s.int_points1_sorted.length;a++)if(i=s.int_points1_sorted[a],r=s.int_points1_sorted[a-1],i.edge_before&&i.edge_before.bv===1){let c=r.edge_after,l=i.edge_before,h=o.getChain(c,l);SHt(s.int_points2[r.id],s.int_points2[i.id],h),h.forEach((d)=>n.edges.add(d)),h=h.reverse().map((d)=>new Ve.Edge(d.shape.reverse()));for(let d=0;d<h.length-1;d++)h[d].next=h[d+1],h[d+1].prev=h[d];SHt(s.int_points2[i.id],s.int_points2[r.id],h),h.forEach((d)=>n.edges.add(d))}return n.recreateFaces(),n}cutWithLine(t){let n=new PV([t]);return this.cut(n)}findEdgeByPoint(t){let n;for(let o of this.faces)if(n=o.findEdgeByPoint(t),n!==void 0)break;return n}splitToIslands(){if(this.isEmpty())return[];let t=this.toArray();t.sort((r,i)=>i.area()-r.area());let n=[...t[0].faces][0].orientation(),o=t.filter((r)=>[...r.faces][0].orientation()===n);for(let r of t){let i=[...r.faces][0];if(i.orientation()!==n){for(let s of o)if(i.shapes.every((a)=>s.contains(a))){s.addFace(i.shapes);break}}}return o}rearrange(){if(this.faces.size<=1)return this.clone();let t=this.splitToIslands(),n=new e;return t.forEach((o)=>{o.faces.forEach((r)=>n.addFace(r.shapes))}),n}orientation(){return this.isEmpty()?H$.NOT_ORIENTABLE:[...this.faces][0].orientation()}isOuter(t){return t.orientation()===this.orientation()}isMultiPolygon(){let t=0;return this.faces.forEach((n)=>{this.isOuter(n)&&t++}),t>1}reverse(){for(let t of this.faces)t.reverse();return this}contains(t){if(t instanceof Ve.Point){let n=bce(this,t);return n===1||n===2}return HKt(this,t)}distanceTo(t){if(t instanceof Ve.Point){let[n,o]=Ve.Distance.point2polygon(t,this);return o=o.reverse(),[n,o]}if(t instanceof Ve.Circle||t instanceof Ve.Line||t instanceof Ve.Segment||t instanceof Ve.Arc){let[n,o]=Ve.Distance.shape2polygon(t,this);return o=o.reverse(),[n,o]}if(t instanceof Ve.Box)return this.distanceTo(new Ve.Polygon(t));if(t instanceof Ve.Polygon){let n,o,r=[Number.POSITIVE_INFINITY,new Ve.Segment];for(let i of this.edges){let s=r[0];[n,o]=Ve.Distance.shape2planarSet(i.shape,t.edges,s),Ve.Utils.LT(n,s)&&(r=[n,o])}return r}}intersect(t){return t instanceof Ve.Point?this.contains(t)?[t]:[]:t instanceof Ve.Line?Qle(t,this):t instanceof Ve.Ray?TKt(t,this):t instanceof Ve.Circle?PKt(t,this):t instanceof Ve.Segment?zqe(t,this):t instanceof Ve.Arc?Oqe(t,this):t instanceof Ve.Polygon?function(n,o){let r=[];if(n.isEmpty()||o.isEmpty())return r;if(n.box.not_intersect(o.box))return r;for(let i of n.edges)r=[...r,...vHt(i,o)];return r}(t,this):t instanceof Ve.Multiline?function(n,o){let r=[];if(o.isEmpty()||n.size===0)return r;for(let i of n)r=[...r,...vHt(i,o)];return r}(t,this):void 0}translate(t){let n=new e;for(let o of this.faces)n.addFace(o.shapes.map((r)=>r.translate(t)));return n}rotate(t=0,n=new Ve.Point){let o=new e;for(let r of this.faces)o.addFace(r.shapes.map((i)=>i.rotate(t,n)));return o}scale(t,n){let o=new e;for(let r of this.faces)o.addFace(r.shapes.map((i)=>i.scale(t,n)));return o}transform(t=new Ve.Matrix){let n=new e;for(let o of this.faces)n.addFace(o.shapes.map((r)=>r.transform(t)));return n}toJSON(){return[...this.faces].map((t)=>t.toJSON())}toArray(){return[...this.faces].map((t)=>t.toPolygon())}dpath(){return[...this.faces].reduce((t,n)=>t+n.svg(),"")}svg(t={}){let n=`
<path ${oY({fillRule:"evenodd",fill:"lightcyan",...t})} d="`;for(let o of this.faces)n+=`
${o.svg()}`;return n+=`" >
</path>`,n}};Ve.Polygon=l6;Ve.polygon=(...e)=>new Ve.Polygon(...e);var{Circle:WWe,Line:QHt,Point:kHt,Vector:E4e,Utils:XWe}=Ve;Ve.Inversion=class e{constructor(t){this.circle=t}get inversion_circle(){return this.circle}static inversePoint(t,n){let o=new E4e(t.pc,n),r=t.r*t.r,i=o.dot(o);return XWe.EQ_0(i)?new kHt(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY):t.pc.translate(o.multiply(r/i))}static inverseCircle(t,n){let o=t.pc.distanceTo(n.pc)[0];if(XWe.EQ(o,n.r)){let r=t.r*t.r/(2*n.r),i=new E4e(t.pc,n.pc);i=i.normalize();let s=t.pc.translate(i.multiply(r));return new QHt(s,i)}{let r=new E4e(t.pc,n.pc),i=t.r*t.r/(r.dot(r)-n.r*n.r),s=t.pc.translate(r.multiply(i)),a=Math.abs(i)*n.r;return new WWe(s,a)}}static inverseLine(t,n){let[o,r]=t.pc.distanceTo(n);if(XWe.EQ_0(o))return n.clone();{let i=t.r*t.r/(2*o),s=new E4e(t.pc,r.end);return s=s.multiply(i/o),new WWe(t.pc.translate(s),i)}}inverse(t){return t instanceof kHt?e.inversePoint(this.circle,t):t instanceof WWe?e.inverseCircle(this.circle,t):t instanceof QHt?e.inverseLine(this.circle,t):void 0}};Ve.inversion=(e)=>new Ve.Inversion(e);Ve.Distance=class e{static point2point(t,n){return t.distanceTo(n)}static point2line(t,n){let o=t.projectionOn(n);return[new Ve.Vector(t,o).length,new Ve.Segment(t,o)]}static point2circle(t,n){let[o,r]=t.distanceTo(n.center);if(Ve.Utils.EQ_0(o))return[n.r,new Ve.Segment(t,n.toArc().start)];{let i=Math.abs(o-n.r),s=new Ve.Vector(n.pc,t).normalize().multiply(n.r),a=n.pc.translate(s);return[i,new Ve.Segment(t,a)]}}static point2segment(t,n){if(n.start.equalTo(n.end))return e.point2point(t,n.start);let o,r,i=new Ve.Vector(n.start,n.end),s=new Ve.Vector(n.start,t),a=new Ve.Vector(n.end,t),c=i.dot(s),l=-i.dot(a);if(Ve.Utils.GE(c,0)&&Ve.Utils.GE(l,0)){let h=n.tangentInStart();return o=Math.abs(h.cross(s)),r=n.start.translate(h.multiply(h.dot(s))),[o,new Ve.Segment(t,r)]}return c<0?t.distanceTo(n.start):t.distanceTo(n.end)}static point2arc(t,n){let o,r,i=new Ve.Circle(n.pc,n.r),s=[];return[o,r]=e.point2circle(t,i),r.end.on(n)&&s.push(e.point2circle(t,i)),s.push(e.point2point(t,n.start)),s.push(e.point2point(t,n.end)),e.sort(s),s[0]}static point2edge(t,n){return n.shape instanceof Ve.Segment?e.point2segment(t,n.shape):e.point2arc(t,n.shape)}static segment2line(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Ve.Segment(o[0],o[0])];let r=[];return r.push(e.point2line(t.start,n)),r.push(e.point2line(t.end,n)),e.sort(r),r[0]}static segment2segment(t,n){let o=fCe(t,n);if(o.length>0)return[0,new Ve.Segment(o[0],o[0])];let r,i,s=[];return[r,i]=e.point2segment(n.start,t),s.push([r,i.reverse()]),[r,i]=e.point2segment(n.end,t),s.push([r,i.reverse()]),s.push(e.point2segment(t.start,n)),s.push(e.point2segment(t.end,n)),e.sort(s),s[0]}static segment2circle(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Ve.Segment(o[0],o[0])];let r=new Ve.Line(t.ps,t.pe),[i,s]=e.point2line(n.center,r);if(Ve.Utils.GE(i,n.r)&&s.end.on(t))return e.point2circle(s.end,n);{let[a,c]=e.point2circle(t.start,n),[l,h]=e.point2circle(t.end,n);return Ve.Utils.LT(a,l)?[a,c]:[l,h]}}static segment2arc(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Ve.Segment(o[0],o[0])];let r=new Ve.Line(t.ps,t.pe),i=new Ve.Circle(n.pc,n.r),[s,a]=e.point2line(i.center,r);if(Ve.Utils.GE(s,i.r)&&a.end.on(t)){let[d,u]=e.point2circle(a.end,i);if(u.end.on(n))return[d,u]}let c,l,h=[];return h.push(e.point2arc(t.start,n)),h.push(e.point2arc(t.end,n)),[c,l]=e.point2segment(n.start,t),h.push([c,l.reverse()]),[c,l]=e.point2segment(n.end,t),h.push([c,l.reverse()]),e.sort(h),h[0]}static circle2circle(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Ve.Segment(o[0],o[0])];if(t.center.equalTo(n.center)){let r=t.toArc(),i=n.toArc();return e.point2point(r.start,i.start)}{let r=new Ve.Line(t.center,n.center),i=r.intersect(t),s=r.intersect(n),a=[];return a.push(e.point2point(i[0],s[0])),a.push(e.point2point(i[0],s[1])),a.push(e.point2point(i[1],s[0])),a.push(e.point2point(i[1],s[1])),e.sort(a),a[0]}}static circle2line(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Ve.Segment(o[0],o[0])];let[r,i]=e.point2line(t.center,n),[s,a]=e.point2circle(i.end,t);return a=a.reverse(),[s,a]}static arc2line(t,n){let o=n.intersect(t);if(o.length>0)return[0,new Ve.Segment(o[0],o[0])];let r=new Ve.Circle(t.center,t.r),[i,s]=e.point2line(r.center,n);if(!Ve.Utils.GE(i,r.r)){let a=[];return a.push(e.point2line(t.start,n)),a.push(e.point2line(t.end,n)),e.sort(a),a[0]}{let[a,c]=e.point2circle(s.end,r);if(c.end.on(t))return[a,c]}}static arc2circle(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Ve.Segment(o[0],o[0])];let r=new Ve.Circle(t.center,t.r),[i,s]=e.circle2circle(r,n);if(s.start.on(t))return[i,s];{let a=[];return a.push(e.point2circle(t.start,n)),a.push(e.point2circle(t.end,n)),e.sort(a),a[0]}}static arc2arc(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Ve.Segment(o[0],o[0])];let r=new Ve.Circle(t.center,t.r),i=new Ve.Circle(n.center,n.r),[s,a]=e.circle2circle(r,i);if(a.start.on(t)&&a.end.on(n))return[s,a];{let c,l,h=[];return[c,l]=e.point2arc(t.start,n),l.end.on(n)&&h.push([c,l]),[c,l]=e.point2arc(t.end,n),l.end.on(n)&&h.push([c,l]),[c,l]=e.point2arc(n.start,t),l.end.on(t)&&h.push([c,l.reverse()]),[c,l]=e.point2arc(n.end,t),l.end.on(t)&&h.push([c,l.reverse()]),[c,l]=e.point2point(t.start,n.start),h.push([c,l]),[c,l]=e.point2point(t.start,n.end),h.push([c,l]),[c,l]=e.point2point(t.end,n.start),h.push([c,l]),[c,l]=e.point2point(t.end,n.end),h.push([c,l]),e.sort(h),h[0]}}static point2polygon(t,n){let o=[Number.POSITIVE_INFINITY,new Ve.Segment];for(let r of n.edges){let[i,s]=e.point2edge(t,r);Ve.Utils.LT(i,o[0])&&(o=[i,s])}return o}static shape2polygon(t,n){let o=[Number.POSITIVE_INFINITY,new Ve.Segment];for(let r of n.edges){let[i,s]=t.distanceTo(r.shape);Ve.Utils.LT(i,o[0])&&(o=[i,s])}return o}static polygon2polygon(t,n){let o=[Number.POSITIVE_INFINITY,new Ve.Segment];for(let r of t.edges)for(let i of n.edges){let[s,a]=r.shape.distanceTo(i.shape);Ve.Utils.LT(s,o[0])&&(o=[s,a])}return o}static box2box_minmax(t,n){let o=Math.max(Math.max(t.xmin-n.xmax,0),Math.max(n.xmin-t.xmax,0)),r=Math.max(Math.max(t.ymin-n.ymax,0),Math.max(n.ymin-t.ymax,0)),i=o*o+r*r,s=t.merge(n),a=s.xmax-s.xmin,c=s.ymax-s.ymin;return[i,a*a+c*c]}static minmax_tree_process_level(t,n,o,r){let i,s;for(let c of n){[i,s]=e.box2box_minmax(t.box,c.item.key);for(let l of c.item.values)l instanceof Ve.Edge?r.insert([i,s],l.shape):r.insert([i,s],l);Ve.Utils.LT(s,o)&&(o=s)}if(n.length===0)return o;let a=[...n.map((c)=>c.left.isNil()?void 0:c.left).filter((c)=>c!==void 0),...n.map((c)=>c.right.isNil()?void 0:c.right).filter((c)=>c!==void 0)].filter((c)=>{let[l,h]=e.box2box_minmax(t.box,c.max);return Ve.Utils.LE(l,o)});return o=e.minmax_tree_process_level(t,a,o,r)}static minmax_tree(t,n,o){let r=new hKe,i=[n.index.root],s=o<Number.POSITIVE_INFINITY?o*o:Number.POSITIVE_INFINITY;return s=e.minmax_tree_process_level(t,i,s,r),r}static minmax_tree_calc_distance(t,n,o){let r,i;if(n!=null&&!n.isNil()){if([r,i]=e.minmax_tree_calc_distance(t,n.left,o),i)return[r,i];if(Ve.Utils.LT(r[0],Math.sqrt(n.item.key.low)))return[r,!0];let[s,a]=e.distanceToArray(t,n.item.values);return Ve.Utils.LT(s,r[0])&&(r=[s,a]),[r,i]=e.minmax_tree_calc_distance(t,n.right,r),[r,i]}return[o,!1]}static shape2planarSet(t,n,o=Number.POSITIVE_INFINITY){let r=[o,new Ve.Segment],i=!1;if(n instanceof Ve.PlanarSet){let s=e.minmax_tree(t,n,o);[r,i]=e.minmax_tree_calc_distance(t,s.root,r)}return r}static sort(t){t.sort((n,o)=>Ve.Utils.LT(n[0],o[0])?-1:Ve.Utils.GT(n[0],o[0])?1:0)}static distance(t,n){return t.distanceTo(n)}static distanceToArray(t,n){let o=[Number.POSITIVE_INFINITY,new Ve.Segment];for(let r of n){let[i,s]=t.distanceTo(r);Ve.Utils.LT(i,o[0])&&(o=[i,s])}return o}static shape2multiline(t,n){let o=[Number.POSITIVE_INFINITY,new Ve.Segment];for(let r of n){let[i,s]=e.distance(t,r.shape);Ve.Utils.LT(i,o[0])&&(o=[i,s])}return o}static multiline2multiline(t,n){let o=[Number.POSITIVE_INFINITY,new Ve.Segment];for(let r of t)for(let i of n){let[s,a]=e.distance(r.shape,i.shape);Ve.Utils.LT(s,o[0])&&(o=[s,a])}return o}};var{Multiline:Lgr,Point:zKt,Segment:Hgr,Polygon:OKt}=Ve;function dKe(e){return new zKt(e.split(" ").map(Number))}function VKt(e){return e.split(", ").map(dKe)}function jWe(e){let t=VKt(e),n=[];for(let o=0;o<t.length-1;o++)n.push(new Hgr(t[o],t[o+1]));return new Lgr(n)}function LHt(e){let t=e.replace(/\(\(/,"").replace(/\)\)$/,"").split("), ("),n=new OKt,o;return t.forEach((r,i)=>{let s=r.split(", ").map((c)=>new zKt(c.split(" ").map(Number))),a=n.addFace(s);i===0?o=a.orientation():a.orientation()===o&&a.reverse()}),n}function Fgr(e){if(e.startsWith("POLYGON"))return LHt(e.replace(/^POLYGON /,""));return function(t){let n=t.split(/\)\), \(\(/).map((r)=>"(("+r+"))").map(LHt),o=new OKt;return n.reduce((r,i)=>[...r,...i?.faces],[]).forEach((r)=>o.addFace([...r?.shapes])),o}(e.replace(/^MULTIPOLYGON \(\(\((.*)\)\)\)$/,"$1"))}function HHt(e){return e.split(`
`)?.every((t)=>t.includes("POINT"))}function FHt(e){return e.split(`
`)?.every((t)=>t.includes("LINESTRING"))}Ve.isWktString=function(e){return e.startsWith("POINT")||HHt(e)||e.startsWith("LINESTRING")||FHt(e)||e.startsWith("MULTILINESTRING")||e.startsWith("POLYGON")||e.startsWith("MULTIPOINT")||e.startsWith("MULTIPOLYGON")||e.startsWith("GEOMETRYCOLLECTION")},Ve.parseWKT=function e(t){if(t.startsWith("POINT"))return dKe(t.replace(/^POINT \(/,"").replace(/\)$/,""));if(t.startsWith("MULTIPOINT"))return VKt(t.replace(/^MULTIPOINT \(/,"").replace(/\)$/,""));if(t.startsWith("LINESTRING"))return jWe(t.replace(/^LINESTRING \(/,"").replace(/\)$/,""));if(t.startsWith("MULTILINESTRING"))return function(n){return n.replace(/\(\(/,"").replace(/\)\)$/,"").split("), (").map(jWe)}(t.replace(/^MULTILINESTRING /,""));if(t.startsWith("POLYGON")||t.startsWith("MULTIPOLYGON"))return Fgr(t);if(t.startsWith("GEOMETRYCOLLECTION")){let n=/(?<type>POINT|LINESTRING|POLYGON|MULTIPOINT|MULTILINESTRING|MULTIPOLYGON) \((?:[^\(\)]|\([^\)]*\))*\)/g,o=t.match(n);return o[0].startsWith("GEOMETRYCOLLECTION")&&(o[0]=o[0].replace("GEOMETRYCOLLECTION (","")),o.map(e).map((r)=>r instanceof Array?r:[r]).reduce((r,i)=>[...r,...i],[])}return HHt(t)?function(n){return n.split(`
`).map((o)=>o.match(/\(([^)]+)\)/)[1]).map(dKe)}(t):FHt(t)?function(n){return n.split(`
`).map((o)=>o.match(/\(([^)]+)\)/)[1]).map(jWe).reduce((o,r)=>[...o,...r],[])}(t):[]},Ve.BooleanOperations=lKe,Ve.Relations=wgr;var zHt=[0,1,-1,2,-2,3,-3,4],rLs=(zHt.flatMap((e)=>zHt.map((t)=>[e,t])).sort(([e,t],[n,o])=>Math.abs(e)+Math.abs(t)-Math.abs(n)-Math.abs(o)).length,[0.2,0.4,0.8,1.2].flatMap((e)=>[0.2,0.3,0.45,0.6].flatMap((t)=>[-1,1].map((n)=>({halfSpan:e,offset:t,directionSign:n})))).flatMap((e)=>[0,1].map((t)=>({kind:"segment",routeSide:t,...e}))));[1,-1].flatMap((e)=>[1,-1].flatMap((t)=>[!1,!0].flatMap((n)=>[0,1].map((o)=>({routeSide:o,normalDirectionSign:e,tangentDirectionSign:t,reverseEndpointOffsets:n}))))),[0,1].map((e)=>({kind:"displacementChain",routeSide:e})),[-1,1].flatMap((e)=>[0,1].map((t)=>({kind:"segment",routeSide:t,halfSpan:0.4,offset:1.2,directionSign:e}))),[-1,1].flatMap((e)=>[0,1].map((t)=>({kind:"span",routeSide:t,spanExpansion:3,offset:1.8,directionSign:e}))),[{dx:-2.4,dy:-0.4},{dx:-2.4,dy:0.4},{dx:2.4,dy:-0.4},{dx:2.4,dy:0.4},{dx:-0.4,dy:-2.4},{dx:-0.4,dy:2.4},{dx:0.4,dy:-2.4},{dx:0.4,dy:2.4}].flatMap((e)=>[0,1].map((t)=>({kind:"waypoint",routeSide:t,spanExpansion:2,...e}))),[{dx:-0.17,dy:0},{dx:0.17,dy:0},{dx:0,dy:-0.17},{dx:0,dy:0.17}].flatMap((e)=>[0,1].map((t)=>({kind:"waypoint",routeSide:t,spanExpansion:0,...e})));function Ebe(e){if(e.isNonPlatedHole&&e.shape==="circle")return{type:"oval",a:{x:0,y:0},b:{x:0,y:0},radius:e.width/2};if(e.type==="rect")return{type:"rect",bounds:{minX:-e.width/2,maxX:e.width/2,minY:-e.height/2,maxY:e.height/2}};if(e.type!=="oval")throw Error("repair04 found an unsupported obstacle shape");let t=Math.abs(e.width-e.height)/2,n=e.width>=e.height?t:0,o=e.height>e.width?t:0;return{type:"oval",a:{x:-n,y:-o},b:{x:n,y:o},radius:Math.min(e.width,e.height)/2}}function uq(e,t,n){return n.type==="rect"?ZV(e,t,n.bounds):Math.max(0,Q_(e,t,n.a,n.b)-n.radius)}var Mbe=(e,t)=>{let n=new Map,o=(i)=>{let s=n.get(i);if(s===void 0)return n.set(i,i),i;if(s===i)return i;let a=o(s);return n.set(i,a),a},r=(i)=>{let s=i.filter((c)=>typeof c=="string"&&c.length>0);if(s.length===0)return;let a=o(s[0]);for(let c of s)n.set(o(c),a)};for(let i of e.connections){let s=i;r([s.name,s.rootConnectionName,s.netConnectionName,s.__netConnectionName,...s.mergedConnectionNames??[],...s.__rootConnectionNames??[],...s.pointsToConnect.flatMap((a)=>[a.pointId,a.pcb_port_id])])}for(let i of e.obstacles)r(i.connectedTo);for(let i of t)r([i.connectionName,i.rootConnectionName]);for(let i of n.keys())n.set(i,o(i));return n},zgr=(e,t)=>{let n=e.__zLayers;if(n)return new Set(n);if(e.zLayers)return new Set(e.zLayers);let o=new Set;for(let r of e.layers){let i=r==="top"?0:r==="bottom"?t-1:/^inner\d+$/.test(r)?Number(r.slice(5)):-1;if(i<0||i>=t)throw Error(`repair04 obstacle has an unknown layer: ${r}`);o.add(i)}return o},Ogr=({srj:e,routes:t,traceClearance:n=0.1,viaClearance:o=0.1})=>{let r,i=new Map,s=[],a=!1;return(c)=>{let l=r??=Mbe(e,t),h=new Map,d=a?s:function*(u){for(let _=0;_<e.obstacles.length;_++){if(i.has(_)){let L=i.get(_);L&&(yield L);continue}let p=e.obstacles[_],m=p.connectedTo.some((L)=>/^(pcb_smtpad_|pcb_plated_hole_|pcb_port_)/.test(L)),A=Math.abs((p.ccwRotationDegrees??0)%180)>0.00000001,g=p.type==="rect"&&p.layers.length>1&&Math.abs(p.width-p.height)<0.001;if(m&&!A&&!g){i.set(_,null);continue}if(![p.center.x,p.center.y,p.width,p.height,p.ccwRotationDegrees??0].every(Number.isFinite)||p.width<0||p.height<0)throw Error("repair04 fixed obstacle geometry must be finite and nonnegative");let f=zgr(p,e.layerCount),y=new Set(p.connectedTo.map((L)=>u.get(L)??L)),x=Ebe(p),C=(p.ccwRotationDegrees??0)*Math.PI/180,b=Math.cos(C),I=Math.sin(C),v=Math.hypot(p.width,p.height)/2,P=(L)=>{let H=L.x-p.center.x,V=L.y-p.center.y;return{x:H*b+V*I,y:-H*I+V*b}},M=(L,H,V)=>Math.max(L.x,H.x)+V<p.center.x-v||Math.min(L.x,H.x)-V>p.center.x+v||Math.max(L.y,H.y)+V<p.center.y-v||Math.min(L.y,H.y)-V>p.center.y+v,B=p.obstacleId?.startsWith("repair04_board_edge_")===!0,T=B?0:p.isNonPlatedHole&&e.minTraceToHoleEdgeClearance!==void 0?e.minTraceToHoleEdgeClearance:Math.max(n,e.defaultObstacleMargin??0,e.minTraceToPadEdgeClearance??0),N=B?0:Math.max(o,e.defaultObstacleMargin??0,e.minViaEdgeToPadEdgeClearance??0),D={obstacleIndex:_,obstacle:p,zLayers:f,obstacleNets:y,shape:x,toLocal:P,separated:M,wireGap:T,viaGap:N};i.set(_,D),s.push(D),yield D}a=!0}(l);for(let{obstacleIndex:u,obstacle:_,zLayers:p,obstacleNets:m,shape:A,toLocal:g,separated:f,wireGap:y,viaGap:x}of d)for(let C=0;C<c.length;C+=1){let b=c[C];if(!(b.route.length<2)&&![b.connectionName,b.rootConnectionName].some((I)=>I!==void 0&&m.has(l.get(I)??I)))for(let I=1;I<b.route.length;I+=1){let v=b.route[I-1],P=b.route[I];if(v.toNextSegmentType==="through_obstacle")continue;if(v.z!==P.z){let N=LV(e,v,P);if(!Array.from(p).some((O)=>O>=N.minZ&&O<=N.maxZ))continue;if(Math.abs(v.x-P.x)>0.00000001||Math.abs(v.y-P.y)>0.00000001)throw Error("repair04 found a non-colocated via transition");if(f(v,v,b.viaDiameter/2+x+0.00000001))continue;let D=g(v),L=uq(D,D,A),H=b.viaDiameter/2+x-L;if(H<=0.00000001)continue;let V=`fixed-obstacle:${C}:${u}:via`;(h.get(V)?.severity??-1/0)<H&&h.set(V,{key:V,center:{x:v.x,y:v.y},routeIndex:C,obstacleIndex:u,kind:"via",severity:H});continue}if(!p.has(v.z))continue;let M=Math.max(v.traceThickness??b.traceThickness,P.traceThickness??b.traceThickness)/2;if(f(v,P,M+y+0.00000001))continue;let B=M+y-uq(g(v),g(P),A);if(B<=0.00000001)continue;let T=`fixed-obstacle:${C}:${u}:wire`;(h.get(T)?.severity??-1/0)<B&&h.set(T,{key:T,center:Vm(_.center,v,P),routeIndex:C,obstacleIndex:u,kind:"wire",severity:B})}}return Array.from(h.values())}},VV=(e)=>Ogr(e)(e.routes),OHt=(e,t)=>{let n=[];for(let o=1;o<e.route.length;o++){let r=e.route[o-1],i=e.route[o];if(r.z===i.z||r.toNextSegmentType==="through_obstacle")continue;if(r.x!==i.x||r.y!==i.y||![r.x,r.y,r.z,i.z,e.viaDiameter].every(Number.isFinite)||!Number.isInteger(r.z)||!Number.isInteger(i.z)||Math.min(r.z,i.z)<0||Math.max(r.z,i.z)>=t||e.viaDiameter<=0)throw Error("repair04 new-via guard requires valid colocated vias");let s=o-1,a=[r.z,i.z],c=Math.min(r.z,i.z),l=Math.max(r.z,i.z);for(;o+1<e.route.length&&e.route[o].toNextSegmentType!=="through_obstacle";){let h=e.route[o+1];if(h.x!==i.x||h.y!==i.y)break;if(!Number.isInteger(h.z)||h.z<0||h.z>=t)throw Error("repair04 new-via guard found an invalid layer span");h.z!==a.at(-1)&&a.push(h.z),c=Math.min(c,h.z),l=Math.max(l,h.z),o++}n.push({pointIndices:Array.from({length:o-s+1},(h,d)=>s+d),layerSequence:a,x:i.x,y:i.y,minZ:c,maxZ:l,diameter:e.viaDiameter,identity:JSON.stringify([i.x,i.y,c,l,e.viaDiameter])})}return n},Xqe=(e)=>(({srj:t,viaClearance:n=0.1})=>{let o=new Map,r=new Map,i=[n,t.defaultObstacleMargin??0,t.minViaEdgeToPadEdgeClearance??0],s=Math.max(...i),a=sqe(t,n,!0),c,l=[],h=(d)=>{let u=r.get(d.identity);if(u)return u;let _=[],p=LV(t,{z:d.minZ},{z:d.maxZ});for(let m=0;m<t.obstacles.length;m++){let A=t.obstacles[m],g=o.get(m);if(!g){let P=A.__zLayers??A.zLayers??A.layers.map((M)=>M==="top"?0:M==="bottom"?t.layerCount-1:/^inner\d+$/.test(M)?Number(M.slice(5)):-1);if(P.some((M)=>!Number.isInteger(M)||M<0||M>=t.layerCount))throw Error("repair04 new-via guard found an unknown obstacle layer");g={zs:P},o.set(m,g)}if(!g.zs.some((P)=>P>=p.minZ&&P<=p.maxZ))continue;if(!g.geometry){if(![A.center.x,A.center.y,A.width,A.height,A.ccwRotationDegrees??0].every(Number.isFinite)||A.width<0||A.height<0)throw Error("repair04 new-via guard found invalid obstacle geometry");let P=(A.ccwRotationDegrees??0)*Math.PI/180;g.geometry={x:A.center.x,y:A.center.y,cosine:Math.cos(P),sine:Math.sin(P),extent:Math.hypot(A.width,A.height)/2,shape:Ebe(A)}}let f=g.geometry,y=f.extent+d.diameter/2+s+0.00000001;if(Math.abs(d.x-f.x)>y||Math.abs(d.y-f.y)>y)continue;let x=d.x-f.x,C=d.y-f.y,b={x:x*f.cosine+C*f.sine,y:-x*f.sine+C*f.cosine},I=uq(b,b,f.shape),v=d.diameter/2+s-I;v<=0.00000001||_.push({obstacleIndex:m,severity:v})}return r.set(d.identity,_),_};return({previousRoutes:d,routes:u,includeExistingVias:_=[]})=>{if(d.length!==u.length)throw Error("repair04 new-via guard requires matching route ordering");if(i.some((m)=>!Number.isFinite(m)||m<0))throw Error("repair04 new-via guard requires nonnegative finite margins");let p=[];c&&l.length===u.length&&!l.some((m,A)=>m.connectionName!==u[A].connectionName||m.rootConnectionName!==u[A].rootConnectionName)||(c=Mbe(t,u),l=u.map((m)=>({connectionName:m.connectionName,rootConnectionName:m.rootConnectionName})));for(let m=0;m<u.length;m++){let A=u[m],g=d[m],f=c.get(A.connectionName)??A.connectionName,y=(P)=>h(P).flatMap((M)=>{let B=t.obstacles[M.obstacleIndex].connectedTo.some((N)=>(c.get(N)??N)===f),T=M.severity-(B?s-a:0);return T>0.00000001?[{obstacleIndex:M.obstacleIndex,severity:T}]:[]}),x=OHt(g,t.layerCount),C=A.connectionName===g.connectionName&&A.rootConnectionName===g.rootConnectionName,b=new Set(C?x.map((P)=>P.identity):[]),I=OHt(A,t.layerCount),v=C&&A.route.length===g.route.length&&A.route.every((P,M)=>{let B=g.route[M];return(!(M===0||M===A.route.length-1||P.pcb_port_id||P.insideJumperPad||P.toNextSegmentType)||P.x===B.x&&P.y===B.y)&&P.z===B.z&&P.pcb_port_id===B.pcb_port_id&&P.toNextSegmentType===B.toNextSegmentType&&P.insideJumperPad===B.insideJumperPad})&&I.length===x.length&&new Set(I.map((P)=>P.identity)).size===I.length&&I.every((P,M)=>{let B=x[M];return P.diameter===B.diameter&&P.pointIndices.length===B.pointIndices.length&&P.pointIndices.every((T,N)=>T===B.pointIndices[N])&&P.layerSequence.length===B.layerSequence.length&&P.layerSequence.every((T,N)=>T===B.layerSequence[N])&&!x.some((T,N)=>N!==M&&T.identity===P.identity)});for(let P=0;P<I.length;P++){let M=I[P];if(b.has(M.identity)&&!_.some((T)=>T.routeIndex===m&&T.viaIndex===P))continue;let B=v&&!_.some((T)=>T.routeIndex===m&&T.viaIndex===P)?new Map(y(x[P]).map((T)=>[T.obstacleIndex,T.severity])):void 0;for(let T of y(M)){let N=B?.get(T.obstacleIndex);N!==void 0&&T.severity<=N+0.00000001||p.push({key:`new-via-pad:${m}:${T.obstacleIndex}:${P}`,routeIndex:m,obstacleIndex:T.obstacleIndex,center:{x:M.x,y:M.y},kind:"via",severity:T.severity})}}}return p}})(e)(e),VHt=(e,t,n)=>{if(n<=Ar)return structuredClone(e);if(n>=0.99999999)return structuredClone(t);let o={...structuredClone(e),x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n};return delete o.start_pcb_port_id,delete o.end_pcb_port_id,o},Vgr=(e,t)=>{let n=e.end.x-e.start.x,o=e.end.y-e.start.y,r=t.end.x-t.start.x,i=t.end.y-t.start.y,s=t.start.x-e.start.x,a=t.start.y-e.start.y,c=n*i-o*r,l=(u,_)=>({x:u.start.x+(u.end.x-u.start.x)*_,y:u.start.y+(u.end.y-u.start.y)*_}),h=(u,_)=>{let p=_.end.x-_.start.x,m=_.end.y-_.start.y,A=p*p+m*m,g=A>0.00000000000000010000000000000001?Math.max(0,Math.min(1,((u.x-_.start.x)*p+(u.y-_.start.y)*m)/A)):0;return l(_,g)};if(Math.abs(c)>Ar){let u=(s*i-a*r)/c,_=(s*o-a*n)/c;if(u>=0&&u<=1&&_>=0&&_<=1){let p=l(e,u);return[p,p]}}else{let u=n*n+o*o;if(u>0.00000000000000010000000000000001){let _=(s*n+a*o)/u,p=((t.end.x-e.start.x)*n+(t.end.y-e.start.y)*o)/u,m=Math.max(0,Math.min(_,p)),A=Math.min(1,Math.max(_,p));if(m<=A){let g=l(e,(m+A)/2);return[g,h(g,t)]}}}let d=[[e.start,h(e.start,t)],[e.end,h(e.end,t)],[h(t.start,e),t.start],[h(t.end,e),t.end]];return d.sort((u,_)=>Math.hypot(u[0].x-u[1].x,u[0].y-u[1].y)-Math.hypot(_[0].x-_[1].x,_[0].y-_[1].y)),d[0]},M4e=(e,t)=>{let n=e==="top"?0:e==="bottom"?t-1:/^inner\d+$/.test(e)?Number(e.slice(5)):-1;if(!Number.isInteger(n)||n<0||n>=t)throw Error(`repair04 preload has an unknown layer: ${e}`);return n},YKt=(e,t,n)=>{let o=((A,g)=>{let f=new Map,y=(C)=>{let b=f.get(C);if(b===void 0||b===C)return C;let I=y(b);return f.set(C,I),I},x=(C)=>{let b=C.filter((v)=>typeof v=="string"&&v.length>0);if(b.length===0)return;let I=y(b[0]);for(let v of b)f.set(y(v),I)};for(let C of A.connections){let b=C;x([b.name,b.rootConnectionName,b.netConnectionName,b.__netConnectionName,...b.mergedConnectionNames??[],...b.__rootConnectionNames??[]])}for(let C of g)x([C.connectionName,C.rootConnectionName]);for(let C of A.traces??[])x([C.connection_name,...C.connectsTo??[]]);return y})(e,t),r=t.map((A,g)=>g),i=(A)=>{let g=r[A];if(g===A)return A;let f=i(g);return r[A]=f,f},s=new Map,a=new Map;for(let A=0;A<e.obstacles.length;A+=1)for(let g of e.obstacles[A].connectedTo){let f=a.get(g)??[];f.push(A),a.set(g,f)}for(let A=0;A<t.length;A+=1){let g=t[A];for(let f of[g.route[0],g.route.at(-1)]){if(!f)continue;let y=o(g.connectionName),x=[JSON.stringify([y,"point",f.x,f.y,f.z])],C=f.pcb_port_id?a.get(f.pcb_port_id)??[]:[];for(let b of C){let I=e.obstacles[b];if(!(I.zLayers??I.layers.map((T)=>M4e(T,e.layerCount))).includes(f.z))continue;let v=(I.ccwRotationDegrees??0)*Math.PI/180,P=f.x-I.center.x,M=f.y-I.center.y,B={x:P*Math.cos(v)+M*Math.sin(v),y:-P*Math.sin(v)+M*Math.cos(v)};uq(B,B,Ebe(I))>Ar||x.push(JSON.stringify([y,"pad",b]))}for(let b of x){let I=s.get(b);I===void 0?s.set(b,A):r[i(A)]=i(I)}}}let c=(A,g)=>!(!A.startsWith("route:")||!g.startsWith("route:"))&&i(Number(A.slice(6)))===i(Number(g.slice(6))),l=[],h=[],d=[],u=t.map(()=>({segmentTimes:new Map,viaPositions:[]})),_=(A)=>{if(qy(A,n)){d.push(A);for(let g=A.minZ;g<=A.maxZ;g+=1)l.push({x:A.x,y:A.y,z:g,radius:A.radius,net:A.net,source:A.source,...A.routeIndex!==void 0?{viaOwner:A.routeIndex}:{}})}};for(let A=0;A<t.length;A+=1){let g=t[A],f=o(g.connectionName),y=`route:${A}`;for(let x=0;x<g.route.length;x+=1){let C=g.route[x];if((x===0||x===g.route.length-1||C.pcb_port_id)&&qy(C,n)&&l.push({x:C.x,y:C.y,z:C.z,radius:(C.traceThickness??g.traceThickness)/2,net:f,source:y}),x===0)continue;let b=g.route[x-1];b.toNextSegmentType!=="through_obstacle"&&(b.z===C.z?h.push({start:b,end:C,z:C.z,radius:Math.max(b.traceThickness??g.traceThickness,C.traceThickness??g.traceThickness)/2,net:f,source:y,routeIndex:A,segmentIndex:x-1}):_({x:C.x,y:C.y,minZ:Math.min(b.z,C.z),maxZ:Math.max(b.z,C.z),radius:g.viaDiameter/2,net:f,source:y,routeIndex:A}))}}for(let A=0;A<(e.traces??[]).length;A+=1){let g=iqe(e.traces[A],e.minTraceWidth),f=o(g.connection_name),y=`fixed:${A}`;for(let x=0;x<g.route.length;x+=1){let C=g.route[x],b=g.route[x-1];if(C.route_type==="wire"){let I=M4e(C.layer,e.layerCount);(x===0||x===g.route.length-1||C.start_pcb_port_id||C.end_pcb_port_id)&&qy(C,n)&&l.push({x:C.x,y:C.y,z:I,radius:C.width/2,net:f,source:y}),b?.route_type==="wire"&&b.layer===C.layer&&h.push({start:b,end:C,z:I,radius:Math.max(b.width,C.width)/2,net:f,source:y})}else if(C.route_type==="via"){let I=M4e(C.from_layer,e.layerCount),v=M4e(C.to_layer,e.layerCount);_({x:C.x,y:C.y,minZ:Math.min(I,v),maxZ:Math.max(I,v),radius:(C.via_diameter??e.minViaDiameter??0.3)/2,net:f,source:y})}}}let p=new Map;for(let A of l){let g=JSON.stringify([A.net,A.z]),f=p.get(g)??[];f.push(A),p.set(g,f)}let m=(A,g)=>{if(A===void 0)return;let f=u[A].viaPositions;f.some((y)=>Math.hypot(y.x-g.x,y.y-g.y)<=Ar)||f.push({x:g.x,y:g.y})};for(let A of h){if(!hB(A.start,A.end,n))continue;let g=A.end.x-A.start.x,f=A.end.y-A.start.y,y=g*g+f*f;if(!(y<=0.00000000000000010000000000000001))for(let x of p.get(JSON.stringify([A.net,A.z]))??[]){if(x.source===A.source||c(x.source,A.source))continue;let C=Math.max(0,Math.min(1,((x.x-A.start.x)*g+(x.y-A.start.y)*f)/y)),b={x:A.start.x+g*C,y:A.start.y+f*C};if(qy(b,n)&&!(Math.hypot(b.x-x.x,b.y-x.y)>A.radius+x.radius+Ar)){if(A.routeIndex!==void 0&&A.segmentIndex!==void 0){let I=u[A.routeIndex].segmentTimes.get(A.segmentIndex)??[];I.some((v)=>Math.abs(v-C)<=Ar)||I.push(C),u[A.routeIndex].segmentTimes.set(A.segmentIndex,I)}m(x.viaOwner,x)}}}for(let A of d)for(let g=A.minZ;g<=A.maxZ;g+=1)for(let f of p.get(JSON.stringify([A.net,g]))??[])f.source===A.source||c(f.source,A.source)||Math.hypot(A.x-f.x,A.y-f.y)>A.radius+f.radius+Ar||(m(A.routeIndex,A),m(f.viaOwner,f));return((A,g,f,y)=>{let x=new Map,C=new Set,b=[],I=(v,P)=>{if(v.routeIndex===void 0||v.segmentIndex===void 0)return;let M=v.end.x-v.start.x,B=v.end.y-v.start.y,T=M*M+B*B;if(T<=0.00000000000000010000000000000001)return;let N=Math.max(0,Math.min(1,((P.x-v.start.x)*M+(P.y-v.start.y)*B)/T)),D=f[v.routeIndex].segmentTimes.get(v.segmentIndex)??[];D.some((L)=>Math.abs(L-N)<=Ar)||D.push(N),f[v.routeIndex].segmentTimes.set(v.segmentIndex,D)};for(let v of A){let P=hB(v.start,v.end,g);if(!P||P[1]-P[0]<=Ar)continue;let M=(V)=>({x:v.start.x+(v.end.x-v.start.x)*V,y:v.start.y+(v.end.y-v.start.y)*V}),B={...v,start:M(P[0]),end:M(P[1])},T=b.length;b.push({original:v,clipped:B});let N=Math.floor((Math.min(B.start.x,B.end.x)-B.radius)/2),D=Math.floor((Math.max(B.start.x,B.end.x)+B.radius)/2),L=Math.floor((Math.min(B.start.y,B.end.y)-B.radius)/2),H=Math.floor((Math.max(B.start.y,B.end.y)+B.radius)/2);for(let V=N;V<=D;V+=1)for(let O=L;O<=H;O+=1){let U=JSON.stringify([B.net,B.z,V,O]),j=x.get(U)??[];for(let Y of j){let X=b[Y];if(X.original.source===v.source||y(X.original.source,v.source)||X.original.routeIndex===void 0&&v.routeIndex===void 0)continue;let K=`${Y}:${T}`;if(C.has(K))continue;C.add(K);let[J,ee]=Vgr(B,X.clipped);Math.hypot(J.x-ee.x,J.y-ee.y)>B.radius+X.clipped.radius+Ar||(I(v,J),I(X.original,ee))}j.push(T),x.set(U,j)}}})(h,n,u,c),u},YHt=(e,t)=>({minX:e.minX-t,maxX:e.maxX+t,minY:e.minY-t,maxY:e.maxY+t}),Ygr=(e,t,n,o)=>{let r=[],i,s=e.route,a=(l)=>l===0||l===s.length-1||s[l]?.pcb_port_id!==void 0,c=()=>{i!==void 0&&i.points.length>0&&(i.locks[0]=!0,i.locks[i.points.length-1]=!0,r.push(i)),i=void 0};if(s.length===1&&s[0]&&qy(s[0],t))return[{points:structuredClone(s),locks:[!0],start:{segmentIndex:0,t:0},end:{segmentIndex:0,t:0}}];for(let l=0;l<s.length-1;l+=1){let h=s[l],d=s[l+1];if(!h||!d)throw Error("repair04 found a missing route point");if(![h.x,h.y,h.z,d.x,d.y,d.z].every(Number.isFinite))throw Error("repair04 route coordinates must be finite");if(h.z!==d.z&&!Jb({x:h.x,y:h.y},{x:d.x,y:d.y})&&h.toNextSegmentType!=="through_obstacle")throw Error("repair04 requires colocated points at a via transition");let u=hB(h,d,t);if(!u){c();continue}let[_,p]=u;if(p-_<=Ar&&!Jb(h,d)){c();continue}let m=hB(h,d,n),A=[_,p],g=o.segmentTimes.get(l)??[];for(let x of g)x>=_-Ar&&x<=p+Ar&&A.push(Math.max(_,Math.min(p,x)));if(m&&h.z===d.z)for(let x of m)x>_+Ar&&x<p-Ar&&A.push(x);A.sort((x,C)=>x-C);let f=A.filter((x,C)=>C===0||Math.abs(x-A[C-1])>Ar),y=L$(h,d,_);i&&!Jb(i.points[i.points.length-1],y)&&c(),i||(i={points:[],locks:[],start:{segmentIndex:l,t:_},end:{segmentIndex:l,t:p}});for(let x of f){let C=L$(h,d,x),b=x<=Ar?l:x>=0.99999999?l+1:void 0,I=!qy(C,n,0.00000004)||g.some((P)=>Math.abs(P-x)<=Ar)||o.viaPositions.some((P)=>Math.hypot(P.x-C.x,P.y-C.y)<=Ar)||b!==void 0&&a(b)||h.toNextSegmentType==="through_obstacle"||C.toNextSegmentType==="through_obstacle"||h.insideJumperPad===!0||d.insideJumperPad===!0||(e.jumpers??[]).some((P)=>Jb(C,{...P.start,z:C.z})||Jb(C,{...P.end,z:C.z})),v=i.points[i.points.length-1];v&&v.x===C.x&&v.y===C.y&&v.z===C.z?i.locks[i.locks.length-1]=i.locks[i.locks.length-1]||I:(i.points.push(C),i.locks.push(I))}i.end={segmentIndex:l,t:p},p<0.99999999&&c()}c();for(let l of r)for(let h=1;h<l.points.length;h+=1){let d=l.points[h-1],u=l.points[h];if(d.z!==u.z&&(l.locks[h-1]||l.locks[h])){let _=h-1,p=h;for(;_>0&&Jb({x:l.points[_-1].x,y:l.points[_-1].y},{x:u.x,y:u.y});)_-=1;for(;p+1<l.points.length&&Jb({x:l.points[p+1].x,y:l.points[p+1].y},{x:u.x,y:u.y});)p+=1;for(let m=_;m<=p;m+=1)l.locks[m]=!0}}return r},Ggr=(e,t)=>{let n=e.bounds,o=e.outline&&e.outline.length>=3?e.outline:[{x:n.minX,y:n.minY},{x:n.maxX,y:n.minY},{x:n.maxX,y:n.maxY},{x:n.minX,y:n.maxY}],r=[];for(let i=0;i<o.length;i+=1){let s=o[i],a=o[(i+1)%o.length],c=hB(s,a,t);if(!c)continue;let l=a.x-s.x,h=a.y-s.y,d=Math.hypot(l,h);if(d<=Ar)continue;let u=(c[0]+c[1])/2;r.push({obstacleId:`repair04_board_edge_${i}`,type:"rect",center:{x:s.x+l*u,y:s.y+h*u},width:d*(c[1]-c[0]),height:Math.max(2*(e.minBoardEdgeClearance??0),Ar),ccwRotationDegrees:180*Math.atan2(h,l)/Math.PI,layers:Array.from({length:e.layerCount},(_,p)=>p===0?"top":p===e.layerCount-1?"bottom":`inner${p}`),zLayers:Array.from({length:e.layerCount},(_,p)=>p),connectedTo:[]})}return r},Ugr=({srj:e,routes:t,bounds:n,boundaryMargin:o=0.5,clearanceHalo:r})=>{if(((f)=>{if(!Object.values(f).every(Number.isFinite))throw Error("repair04 bounds must contain finite coordinates");if(f.maxX-f.minX<9.99999999||f.maxY-f.minY<9.99999999)throw Error("repair04 requires bounds at least 10 mm by 10 mm")})(n),!Number.isFinite(o)||o<0||r!==void 0&&(!Number.isFinite(r)||r<0))throw Error("repair04 collar and halo must be finite and nonnegative");let i=Math.max(e.defaultObstacleMargin??0.2,e.minTraceToPadEdgeClearance??0,e.minTraceToHoleEdgeClearance??0,e.minViaEdgeToPadEdgeClearance??0),s=Math.max(e.minTraceWidth,e.minViaDiameter??0);for(let f of t){s=Math.max(s,f.traceThickness,f.viaDiameter);for(let y of f.route)s=Math.max(s,y.traceThickness??0)}for(let f of e.traces??[])for(let y of f.route)y.route_type==="wire"&&(s=Math.max(s,y.width)),y.route_type==="via"&&(s=Math.max(s,y.via_diameter??e.minViaDiameter??0.3));if(!Number.isFinite(s)||s<=0)throw Error("repair04 requires finite positive copper widths");let a=Math.max(o,s+i);if(2*a>=Math.min(n.maxX-n.minX,n.maxY-n.minY))throw Error("repair04 bounds are too small for their required copper safety collar");let c=YHt(n,Math.max(r??a,i+s)),l=YHt(n,-a),h=YKt(e,t,c),d=((f,y,x)=>{let C=[];for(let b of f){let I=iqe(b,x),v=[],P=[],M=()=>{P.length>0&&v.push(P),P=[]},B=(T)=>{Ml(P[P.length-1])!==Ml(T)&&P.push(structuredClone(T))};for(let T=0;T<I.route.length;T+=1){let N=I.route[T],D=I.route[T-1];if(N.route_type==="wire"&&D?.route_type==="wire"&&N.layer===D.layer){let L=hB(D,N,y);if(!L){M();continue}let H=VHt(D,N,L[0]),V=VHt(D,N,L[1]),O=P[P.length-1];O?.route_type==="wire"&&(O.layer!==H.layer||Math.hypot(O.x-H.x,O.y-H.y)>Ar)&&M(),B(H),B(V),L[1]<0.99999999&&M()}else if(N.route_type==="via"){if(!qy(N,y)){M();continue}if(D?.route_type!=="wire")throw Error("repair04 normalized preload via has no incoming wire");B(D),B(N);let L=I.route[T+1];if(L?.route_type!=="wire")throw Error("repair04 normalized preload via has no outgoing wire");B(L)}else if(N.route_type==="wire")qy(N,y)&&B(N);else if("start"in N&&"end"in N){let L=hB(N.start,N.end,y);if(!L){M();continue}let H=(V)=>({x:N.start.x+(N.end.x-N.start.x)*V,y:N.start.y+(N.end.y-N.start.y)*V});B({...structuredClone(N),start:H(L[0]),end:H(L[1])}),L[1]<0.99999999&&M()}}M();for(let T=0;T<v.length;T+=1)C.push({...structuredClone(b),pcb_trace_id:v.length===1?b.pcb_trace_id:`${b.pcb_trace_id}__repair04_fixed_${T}`,route:v[T]})}return C})(e.traces??[],c,e.minTraceWidth),u=[],_=[],p=[];for(let f=0;f<t.length;f+=1){let y=t[f];for(let x of Ygr(y,c,l,h[f])){let C={...structuredClone(Object.fromEntries(Object.entries(y).filter(([b])=>b!=="route"&&b!=="vias"&&b!=="jumpers"))),connectionName:y.connectionName,traceThickness:y.traceThickness,viaDiameter:y.viaDiameter,route:x.points,vias:y.vias.filter((b)=>x.points.some((I)=>Math.abs(I.x-b.x)<=Ar&&Math.abs(I.y-b.y)<=Ar)).map((b)=>structuredClone(b)),...y.jumpers!==void 0?{jumpers:y.jumpers.filter((b)=>hB(b.start,b.end,c)!==void 0).map((b)=>structuredClone(b))}:{}};u.push(C),_.push(x.locks),p.push({sourceRouteIndex:f,start:x.start,end:x.end,sourceGeometryKey:GUt(y,x.start.segmentIndex+x.start.t,x.end.segmentIndex+x.end.t),originalFragment:structuredClone(C)})}}let m=new Set([...u.flatMap((f)=>[f.connectionName,...f.rootConnectionName?[f.rootConnectionName]:[]]),...d.map((f)=>f.connection_name)]),A=e.connections.filter((f)=>m.has(f.name)||f.pointsToConnect.some((y)=>qy(y,c))).map((f)=>({...structuredClone(Object.fromEntries(Object.entries(f).filter(([y])=>y!=="pointsToConnect"))),name:f.name,pointsToConnect:f.pointsToConnect.filter((y)=>qy(y,c)).map((y)=>structuredClone(y))}));for(let f=0;f<u.length;f+=1){let y=u[f],x=A.find((C)=>C.name===y.connectionName);x||(x={name:y.connectionName,...y.rootConnectionName?{rootConnectionName:y.rootConnectionName}:{},pointsToConnect:[]},A.push(x));for(let[C,b]of[["start",y.route[0]],["end",y.route[y.route.length-1]]]){if(!b)continue;let I=b.z===0?"top":b.z===e.layerCount-1?"bottom":`inner${b.z}`;x.pointsToConnect.some((v)=>Math.abs(v.x-b.x)<=Ar&&Math.abs(v.y-b.y)<=Ar&&("layer"in v?v.layer===I:v.layers.includes(I)))||x.pointsToConnect.push({x:b.x,y:b.y,layer:I,pointId:`repair04_${f}_${C}`,...b.pcb_port_id?{pcb_port_id:b.pcb_port_id}:{}})}}return{srj:{...Object.fromEntries(Object.entries(e).filter(([f,y])=>f!=="sourceCircuitJson"&&f!=="sourceKicadPcb"&&(typeof y=="number"||typeof y=="boolean"||typeof y=="string"))),layerCount:e.layerCount,minTraceWidth:e.minTraceWidth,bounds:structuredClone(c),obstacles:[...e.obstacles.filter((f)=>((y,x)=>{let C=(y.ccwRotationDegrees??0)*Math.PI/180,b=(Math.abs(y.width*Math.cos(C))+Math.abs(y.height*Math.sin(C)))/2,I=(Math.abs(y.width*Math.sin(C))+Math.abs(y.height*Math.cos(C)))/2;return y.center.x+b>=x.minX&&y.center.x-b<=x.maxX&&y.center.y+I>=x.minY&&y.center.y-I<=x.maxY})(f,c)).map((f)=>structuredClone(f)),...Ggr(e,c)],connections:A,...e.traces!==void 0?{traces:d}:{},...e.allowJumpers!==void 0?{allowJumpers:e.allowJumpers}:{},...e.availableJumperTypes?{availableJumperTypes:structuredClone(e.availableJumperTypes)}:{}},routes:u,bounds:structuredClone(n),contextBounds:c,mutableBounds:l,boundaryMargin:a,lockedPointIndices:_,routeMappings:p}},GHt=(e)=>Ml(Object.fromEntries(Object.entries(e).filter(([t])=>t!=="route"&&t!=="vias"))),UHt=(e,t)=>{let n=[];for(let o=1;o<e.route.length;o+=1){let r=e.route[o-1],i=e.route[o],s=hB(r,i,t),a=s?[...s[0]>Ar?[[0,s[0]]]:[],...s[1]<0.99999999?[[s[1],1]]:[]]:[[0,1]];s&&!qy(L$(r,i,0.5),t,0.00000004)&&a.length===0&&a.push([0,1]);for(let[c,l]of a)n.push(Ml([L$(r,i,c),L$(r,i,l)]))}return n},Wgr=(e,t,n,o,r,i)=>{if(GHt(e)!==GHt(t))throw Error("repair04 merge rejected changed net, width, jumper, or route metadata");if(n.length!==e.route.length)throw Error("repair04 merge received an invalid lock mask");if(t.route.length===0)throw Error("repair04 merge rejected an empty replacement route");if(Ml(e.route[0])!==Ml(t.route[0])||Ml(e.route[e.route.length-1])!==Ml(t.route[t.route.length-1]))throw Error("repair04 merge rejected a moved fragment endpoint");let s=0;for(let a=0;a<e.route.length;a+=1){if(!n[a])continue;let c=Ml(e.route[a]);for(;s<t.route.length&&Ml(t.route[s])!==c;)s+=1;if(s===t.route.length)throw Error("repair04 merge rejected a moved or removed locked point");s+=1}if(Ml(UHt(e,o))!==Ml(UHt(t,o)))throw Error("repair04 merge rejected modified geometry in the fixed boundary collar");for(let a=1;a<e.route.length;a+=1){let c=e.route[a-1],l=e.route[a];if(!(c.toNextSegmentType==="through_obstacle"||c.insideJumperPad===!0||l.insideJumperPad===!0||(e.jumpers??[]).some((d)=>Jb(c,{...d.start,z:c.z})&&Jb(l,{...d.end,z:l.z})||Jb(c,{...d.end,z:c.z})&&Jb(l,{...d.start,z:l.z}))))continue;let h=Ml([c,l]);if(!t.route.some((d,u)=>u+1<t.route.length&&Ml([d,t.route[u+1]])===h))throw Error("repair04 merge rejected a changed atomic jumper or through-obstacle span")}for(let a of t.route){if(![a.x,a.y,a.z].every(Number.isFinite)||!Number.isInteger(a.z)||a.z<0||a.z>=i||!qy(a,r))throw Error("repair04 merge rejected invalid or out-of-region geometry");if((a.pcb_port_id!==void 0||a.insideJumperPad===!0||a.toNextSegmentCircuitJsonMetadata!==void 0)&&!e.route.some((c)=>Ml(c)===Ml(a)))throw Error("repair04 merge rejected invented or moved terminal/circuit metadata");if(a.traceThickness!==void 0&&(!Number.isFinite(a.traceThickness)||a.traceThickness<=0||a.traceThickness>Math.max(e.traceThickness,...e.route.map((c)=>c.traceThickness??0))+Ar))throw Error("repair04 merge rejected increased per-point copper width")}for(let a=1;a<t.route.length;a+=1){let c=t.route[a-1],l=t.route[a];if(c.toNextSegmentType==="through_obstacle"&&!e.route.some((h,d)=>d+1<e.route.length&&Ml([h,e.route[d+1]])===Ml([c,l])))throw Error("repair04 merge rejected an invented through-obstacle span");if(c.z!==l.z&&c.toNextSegmentType!=="through_obstacle"&&(Math.abs(c.x-l.x)>Ar||Math.abs(c.y-l.y)>Ar||!t.vias.some((h)=>Math.abs(h.x-c.x)<=Ar&&Math.abs(h.y-c.y)<=Ar)))throw Error("repair04 merge rejected a disconnected or missing via")}for(let a of t.vias){if(!(Number.isFinite(a.x)&&Number.isFinite(a.y)&&qy(a,r)&&t.route.some((c)=>Math.abs(c.x-a.x)<=Ar&&Math.abs(c.y-a.y)<=Ar)))throw Error("repair04 merge rejected an invalid via position");if(!qy(a,o,0.00000004)&&!e.vias.some((c)=>Ml(c)===Ml(a)))throw Error("repair04 merge rejected a new via in the boundary collar")}for(let a of e.vias)if(!qy(a,o,0.00000004)&&!t.vias.some((c)=>Ml(c)===Ml(a)))throw Error("repair04 merge rejected a changed via in the boundary collar")},KWe=(e,t)=>{for(let n of t){let o=e[e.length-1];o&&Jb(o,n)&&Ml(o)===Ml(n)||e.push(structuredClone(n))}},Xgr=(e,t,n)=>{let o=new Set(t.route.map(Ml)),r=new Set(n.flatMap((s)=>s.originalFragment.route.map(Ml)).filter((s)=>!o.has(s))),i=[];for(let s of e)for(i.push(s);i.length>=3;){let a=i[i.length-3],c=i[i.length-2],l=i[i.length-1];if(!r.has(Ml(c)))break;if(a.z!==c.z||c.z!==l.z&&a.toNextSegmentType!=="through_obstacle")break;if(a.toNextSegmentType!==c.toNextSegmentType||a.insideJumperPad!==c.insideJumperPad||a.traceThickness!==c.traceThickness||Ml(a.toNextSegmentCircuitJsonMetadata)!==Ml(c.toNextSegmentCircuitJsonMetadata))break;let h=l.x-a.x,d=l.y-a.y,u=h*h+d*d;if(u<=0.00000000000000010000000000000001)break;let _=(c.x-a.x)*d-(c.y-a.y)*h,p=((c.x-a.x)*h+(c.y-a.y)*d)/u;if(Math.abs(_)>Ar*Math.sqrt(u)||p<0||p>1)break;i.splice(i.length-2,1)}return i},w4e=(e)=>{if(!Number.isInteger(e.segmentIndex)||e.segmentIndex<0||!Number.isFinite(e.t)||e.t<0||e.t>1)throw Error("repair04 merge received invalid fragment provenance");return e.segmentIndex+e.t},GKt=(e,t)=>{let n=Math.max(Math.abs(e),Math.abs(t));if(n===0||n===Number.POSITIVE_INFINITY)return n;let o=e/n,r=t/n;return n*Math.sqrt(o*o+r*r)};function WHt(e,t,n){return e.minX-n-Ar>t.maxX||e.maxX+n+Ar<t.minX||e.minY-n-Ar>t.maxY||e.maxY+n+Ar<t.minY}var jgr=class extends Da{input;stats;phase="initialize";cursor=0;barrierCount=0;output;prepareObstacle;prepareRoute;prepareTrace;indexBarrier;seedSearch;searchBatch;constructor(e){super(),this.input=e,this.stats=e.stats??{nodesPopped:0,completionReason:"no-path"},this.MAX_ITERATIONS=Math.ceil((e.maxNodes??30000)/128)+Math.ceil(e.srj.obstacles.length/128)+Math.ceil(e.routes.length/32)+Math.ceil((e.srj.traces?.length??0)/32)+e.srj.obstacles.length*e.srj.layerCount+e.routes.reduce((t,n)=>t+n.route.length,0)+(e.srj.traces??[]).reduce((t,n)=>t+n.route.length,0)+32}finish(e){this.output=e,this.phase="finished",this.solved=!0,this.progress=1,this.prepareObstacle=void 0,this.prepareRoute=void 0,this.prepareTrace=void 0,this.indexBarrier=void 0,this.seedSearch=void 0,this.searchBatch=void 0}_step(){if(this.phase==="initialize")return void this.initialize();if(this.phase==="seed")return void this.seedSearch();if(this.phase==="search")return this.searchBatch(),void(this.solved||(this.progress=Math.min(0.99,this.stats.nodesPopped/(this.input.maxNodes??30000))));let e=this.cursor;if(this.phase==="obstacles"){let t=this.input.srj.obstacles;for(;this.cursor<Math.min(e+128,t.length);this.cursor++)this.prepareObstacle(t[this.cursor]);return void(this.cursor===t.length&&(this.phase="routes",this.cursor=0))}if(this.phase!=="routes"){if(this.phase==="traces"){let t=this.input.srj.traces??[];for(;this.cursor<Math.min(e+32,t.length);this.cursor++)this.prepareTrace(t[this.cursor]);return void(this.cursor===t.length&&(this.phase="index",this.cursor=0))}if(this.phase!=="index")throw Error("repair04: clearance path stepped after completion");for(;this.cursor<Math.min(e+128,this.barrierCount);this.cursor++)this.indexBarrier(this.cursor);this.cursor===this.barrierCount&&(this.phase="seed")}else{for(;this.cursor<Math.min(e+32,this.input.routes.length);this.cursor++)this.prepareRoute(this.input.routes[this.cursor]);this.cursor===this.input.routes.length&&(this.phase="traces",this.cursor=0)}}initialize(){let e=this.input,{srj:t,routes:n,routeIndex:o,start:r,end:i,bounds:s,traceThickness:a}=e,c=e.heuristicWeight??1;if(!Number.isFinite(c)||c<1)throw Error("repair04: heuristic weight must be finite and at least one");let l=(N,D)=>{let L=e.getAdditionalEdgeCost?.(N,D)??0;if(Number.isNaN(L)||L<0)throw Error("repair04: additional edge costs must be nonnegative");return L};if(e.maxNodes!==void 0&&(!Number.isSafeInteger(e.maxNodes)||e.maxNodes<1))throw Error("repair04: maxNodes must be a positive safe integer");if(this.stats&&(this.stats.nodesPopped=0,this.stats.completionReason="no-path"),e.allowLayerChanges===!1&&r.z!==i.z)return void this.finish(null);let h=n[o],d=e.viaHoleDiameter??h.viaDiameter;if(!Number.isFinite(d)||d<=0||d>h.viaDiameter)throw Error("repair04: via hole diameter must be positive and fit the copper");let u=d+e.viaClearance,_=(N,D)=>{for(let L=D;L;L=L.previous)if((N.x!==L.x||N.y!==L.y)&&Math.hypot(N.x-L.x,N.y-L.y)+Ar<u)return!1;return!0},p=(N)=>{let D;for(let L=1;L<N.length;L++){let H=N[L-1],V=N[L];if(H.z!==V.z&&H.toNextSegmentType!=="through_obstacle"){if(!_(H,D))return!1;H.x===D?.x&&H.y===D?.y||(D={x:H.x,y:H.y,previous:D})}}return!0},m=new Map,A=(N)=>{let D=m.get(N);if(D===void 0||D===N)return N;let L=A(D);return m.set(N,L),L},g=(N)=>{let D=N.filter((H)=>Boolean(H));if(!D.length)return;let L=A(D[0]);for(let H of D)m.set(A(H),L)};for(let N of t.connections){let D=N;g([D.name,D.rootConnectionName,D.netConnectionName,D.__netConnectionName,...D.mergedConnectionNames??[],...D.__rootConnectionNames??[],...D.pointsToConnect.flatMap((L)=>[L.pcb_port_id,L.pointId])])}for(let N of t.obstacles)g(N.connectedTo);for(let N of n)g([N.connectionName,N.rootConnectionName]);let f=A(h.connectionName),y=(N)=>N==="top"?0:N==="bottom"?t.layerCount-1:Number(N.slice(5)),x=[s.minX,s.maxX,s.minY,s.maxY,r.x,r.y,i.x,i.y,a,h.viaDiameter,e.traceClearance,e.viaClearance,t.defaultObstacleMargin??0,t.minTraceToPadEdgeClearance??0,t.minTraceToHoleEdgeClearance??0,t.minViaEdgeToPadEdgeClearance??0].every((N)=>Number.isFinite(N)&&Math.abs(N)<=1e4),C=[],b=(N,D,L,H,V=!1,O=!1,U=!1)=>{let j=H?Math.hypot(H.width,H.height)/2:L,Y=H?Math.cos(H.rotation):1,X=H?Math.sin(H.rotation):0,K={minX:Math.min(N.x,D.x)-j,maxX:Math.max(N.x,D.x)+j,minY:Math.min(N.y,D.y)-j,maxY:Math.max(N.y,D.y)+j},J=H&&x?((ee,se,ne,re,Z,te)=>{if(ee.x!==se.x||ee.y!==se.y||!Number.isFinite(ne.rotation)||ne.width<=0||ne.height<=0||![ee.x,ee.y,ne.width,ne.height,te.minX,te.maxX,te.minY,te.maxY].every((xe)=>Number.isFinite(xe)&&Math.abs(xe)<=1e4))return te;let ie=re*re+Z*Z;if(!Number.isFinite(ie)||Math.abs(ie-1)>0.000000000001)return te;let le=ne.width/2,ue=ne.height/2,de=(Math.abs(re)*le+Math.abs(Z)*ue)/ie+0.00000001,me=(Math.abs(Z)*le+Math.abs(re)*ue)/ie+0.00000001,Ae={minX:ee.x-de,maxX:ee.x+de,minY:ee.y-me,maxY:ee.y+me};return Ae.minX<te.minX||Ae.maxX>te.maxX||Ae.minY<te.minY||Ae.maxY>te.maxY?te:Ae})(N,D,H,Y,X,K):K;C.push({a:N,b:D,radius:L,rect:H,viaOnly:V,pad:O,isNonPlatedHole:U,rectCos:Y,rectSin:X,rectBounds:H?{minX:-H.width/2,maxX:H.width/2,minY:-H.height/2,maxY:H.height/2}:void 0,visitedQuery:0,...J,...LV(t,N,D)})};this.prepareObstacle=(N)=>{let D=N.connectedTo.some((V)=>A(V)===f),L=N.__zLayers??N.zLayers??N.layers.map(y),H=N.isNonPlatedHole&&N.shape==="circle"||N.type==="oval"&&N.width===N.height&&N.ccwRotationDegrees===void 0&&L.length>1;for(let V of L){let O={...N.center,z:V};b(O,O,H?N.width/2:0,H?void 0:{width:N.width,height:N.height,rotation:(N.ccwRotationDegrees??0)*Math.PI/180},D,H,N.isNonPlatedHole)}this.barrierCount=C.length},this.prepareRoute=(N)=>{if(A(N.connectionName)!==f){for(let D=1;D<N.route.length;D++){let L=N.route[D-1],H=N.route[D];L.toNextSegmentType!=="through_obstacle"&&b(L,H,L.z!==H.z?N.viaDiameter/2:Math.max(L.traceThickness??N.traceThickness,H.traceThickness??N.traceThickness)/2)}this.barrierCount=C.length}},this.prepareTrace=(N)=>{if(A(N.connection_name)===f)return;let D=iqe(N,t.minTraceWidth);for(let L=1;L<D.route.length;L++){let H=D.route[L-1],V=D.route[L];H.route_type==="wire"&&V.route_type==="wire"&&H.layer===V.layer&&b({x:H.x,y:H.y,z:y(H.layer)},{x:V.x,y:V.y,z:y(V.layer)},Math.max(H.width,V.width)/2),V.route_type==="via"&&b({x:V.x,y:V.y,z:y(V.from_layer)},{x:V.x,y:V.y,z:y(V.to_layer)},(V.via_diameter??h.viaDiameter)/2)}this.barrierCount=C.length};let I=new Map,v=Math.max(h.viaDiameter,a)/2+Math.max(e.traceClearance,e.viaClearance,t.defaultObstacleMargin??0,t.minTraceToPadEdgeClearance??0,t.minTraceToHoleEdgeClearance??0,t.minViaEdgeToPadEdgeClearance??0)+0.00001;this.indexBarrier=(N)=>{let D=C[N];for(let L=Math.floor(Math.max(D.minX,s.minX-v));L<=Math.floor(Math.min(D.maxX,s.maxX+v));L++){let H=I.get(L);for(let V=Math.floor(Math.max(D.minY,s.minY-v));V<=Math.floor(Math.min(D.maxY,s.maxY+v));V++){H||(H=new Map,I.set(L,H));let O=H.get(V);O?O.push(D):H.set(V,[D])}}};let P=0,M={x:0,y:0},B={x:0,y:0},T=(N,D)=>{let L=N.z!==D.z,H=L?h.viaDiameter/2:a/2,V=Math.max(L?e.viaClearance:e.traceClearance,t.defaultObstacleMargin??0,L?t.minViaEdgeToPadEdgeClearance??0:t.minTraceToPadEdgeClearance??0),O=H+Math.max(V,t.minTraceToHoleEdgeClearance??0)+0.00001,U=++P,j=Math.min(N.x,D.x),Y=Math.max(N.x,D.x),X=Math.min(N.y,D.y),K=Math.max(N.y,D.y),{minZ:J,maxZ:ee}=LV(t,N,D);for(let se=Math.floor(j-O);se<=Math.floor(Y+O);se++){let ne=I.get(se);if(ne)for(let re=Math.floor(X-O);re<=Math.floor(K+O);re++){let Z=ne.get(re);if(Z)for(let te of Z){if(te.viaOnly&&!L)continue;if(te.visitedQuery===U)continue;if(te.visitedQuery=U,te.maxZ<J||te.minZ>ee)continue;let ie=H+(te.isNonPlatedHole&&!L&&t.minTraceToHoleEdgeClearance!==void 0?t.minTraceToHoleEdgeClearance:te.viaOnly?sqe(t,e.viaClearance,!0):te.rect||te.pad?V:L&&te.minZ!==te.maxZ?e.viaClearance:e.traceClearance);if(Y+ie<te.minX||j-ie>te.maxX||K+ie<te.minY||X-ie>te.maxY)continue;let le;if(te.rect?(M.x=(N.x-te.a.x)*te.rectCos+(N.y-te.a.y)*te.rectSin,M.y=-(N.x-te.a.x)*te.rectSin+(N.y-te.a.y)*te.rectCos,B.x=(D.x-te.a.x)*te.rectCos+(D.y-te.a.y)*te.rectSin,B.y=-(D.x-te.a.x)*te.rectSin+(D.y-te.a.y)*te.rectCos,le=ZV(M,B,te.rectBounds)):le=Q_(N,D,te.a,te.b)-te.radius,le+Ar<ie)return!1}}}return!0};this.seedSearch=()=>{if(!T(r,r)||!T(i,i))return void this.finish(null);if(e.existingPath){let Me=e.existingPath,Re=Me[0],we=Me.at(-1);if(!Re||!we||Re.x!==r.x||Re.y!==r.y||Re.z!==r.z||we.x!==i.x||we.y!==i.y||we.z!==i.z)throw Error("repair04: existing clearance path must match its anchors");if(Me.some((_e,ye)=>{let Se=Me[ye-1];return Boolean(Se&&Se.z!==_e.z&&(Se.x!==_e.x||Se.y!==_e.y))}))throw Error("repair04: existing clearance path has a non-colocated layer transition");if(p(Me)&&(e.allowLayerChanges!==!1||Me.every((_e)=>_e.z===r.z))&&Me.slice(1).every((_e,ye)=>T(Me[ye],_e)&&l(Me[ye],_e)===0))return this.stats&&(this.stats.completionReason="found"),void this.finish(Me.map((_e)=>({..._e})))}let N=e.gridSize??0.1;if(!Number.isFinite(N)||N<=0)throw Error("repair04: clearance grid size must be positive and finite");let D=Math.floor((s.maxX-s.minX)/N),L=Math.floor((s.maxY-s.minY)/N),H=(Me)=>({x:s.minX+(Me%D+0.5)*N,y:s.minY+(Math.floor(Me/D)%L+0.5)*N,z:Math.floor(Me/(D*L)),traceThickness:a}),V=(Me,Re,we)=>(we*L+Re)*D+Me,O=(Me)=>Math.hypot(Me.x-i.x,Me.y-i.y)+(Me.z===i.z?0:1),U=D*L*t.layerCount,j=D>0&&L>0&&Number.isSafeInteger(t.layerCount)&&Number.isSafeInteger(U)&&U>0&&U<=1e6&&Number.isInteger(r.z)&&r.z>=0&&r.z<t.layerCount,Y=new Mmr(j?U:void 0),X=j?new Float64Array(U).fill(1/0):void 0,K=j?new Int32Array(U):void 0,J=new Map,ee=new Map,se=new Map,ne=(te=r,V(Math.max(0,Math.min(D-1,Math.floor((te.x-s.minX)/N))),Math.max(0,Math.min(L-1,Math.floor((te.y-s.minY)/N))),te.z)),re=ne%D,Z=Math.floor(ne/D)%L;var te;for(let Me=-2;Me<=2;Me++)for(let Re=-2;Re<=2;Re++){let we=re+Me,_e=Z+Re;if(we<0||we>=D||_e<0||_e>=L)continue;let ye=V(we,_e,r.z),Se=H(ye);if(!T(r,Se))continue;let Ne=Math.hypot(Se.x-r.x,Se.y-r.y)+l(r,Se);Number.isFinite(Ne)&&(X?X[ye]=Ne:J.set(ye,Ne),K?K[ye]=-1:ee.set(ye,-1),Y.push({id:ye,cost:Ne,priority:Ne+c*O(Se)}))}let ie=D*L*t.layerCount,le=D>0&&L>0&&Number.isSafeInteger(t.layerCount)&&Number.isSafeInteger(ie)&&ie>0&&Number.isSafeInteger(ie*ie-1)&&Number.isInteger(r.z)&&r.z>=0&&r.z<t.layerCount,ue=j&&c>1?new Uint8Array(U):void 0,de=!j&&c>1?new Set:void 0,me=new Map,Ae=new Map,xe=0;this.searchBatch=()=>{let Me=Math.min(xe+128,e.maxNodes??30000);for(;Y.length&&xe<Me;){let Re=Y.pop();if(xe++,this.stats&&(this.stats.nodesPopped=xe),Re.cost!==(X?X[Re.id]:J.get(Re.id)))continue;ue?ue[Re.id]=1:de?.add(Re.id);let we=H(Re.id),_e=se.get(Re.id);if(we.z===i.z&&Math.hypot(we.x-i.x,we.y-i.y)<3*N&&T(we,i)&&Number.isFinite(l(we,i))){let ke=[i];for(let lt=Re.id;lt!==-1;lt=K?K[lt]:ee.get(lt))ke.push(H(lt));ke.push(r);let nt=ke.reverse(),dt=[r],rt=[0];for(let lt=1;e.getAdditionalEdgeCost&&lt<nt.length;lt++){let Ct=nt[lt-1],Nt=nt[lt];rt.push(rt[lt-1]+(Ct.z===Nt.z?Math.hypot(Ct.x-Nt.x,Ct.y-Nt.y):1)+l(Ct,Nt))}let mt=0;for(let lt=1;lt<nt.length;){let Ct=lt;if(nt[lt].z===dt.at(-1).z)for(let Nt=lt+1;Nt<nt.length&&nt[Nt].z===nt[lt].z;Nt++)T(dt.at(-1),nt[Nt])&&(!e.getAdditionalEdgeCost||Math.hypot(nt[Nt].x-nt[mt].x,nt[Nt].y-nt[mt].y)+l(nt[mt],nt[Nt])<=rt[Nt]-rt[mt]+Ar)&&(Ct=Nt);dt.push(nt[Ct]),mt=Ct,lt=Ct+1}if(!p(dt))throw Error("repair04: search generated conflicting drill sites");return this.stats&&(this.stats.completionReason="found"),void this.finish(dt)}let ye=Re.id%D,Se=Math.floor(Re.id/D)%L,Ne=[];for(let ke=-1;ke<=1;ke++)for(let nt=-1;nt<=1;nt++)ke===0&&nt===0||ye+ke<0||ye+ke>=D||Se+nt<0||Se+nt>=L||Ne.push(V(ye+ke,Se+nt,we.z));if(e.allowLayerChanges!==!1&&_(we,_e))for(let ke=0;ke<t.layerCount;ke++)ke!==we.z&&Ne.push(V(ye,Se,ke));for(let ke of Ne){if(ue?ue[ke]===1:de?.has(ke))continue;let nt=H(ke),dt=Re.cost+(we.z===nt.z?Math.hypot(we.x-nt.x,we.y-nt.y):1),rt=X?X[ke]:J.get(ke)??1/0;if(dt>=rt)continue;let mt=Math.min(Re.id,ke),lt=Math.max(Re.id,ke),Ct=le?mt*ie+lt:`${mt},${lt}`,Nt=le&&we.z!==nt.z&&t.allowBlindAndBuriedVias!==!0?Re.id%(D*L):void 0,Ht=Nt===void 0?me.get(Ct):Ae.get(Nt);if(Ht===void 0&&(Ht=T(we,nt),Nt===void 0?me.set(Ct,Ht):Ae.set(Nt,Ht)),!Ht)continue;let Tt=dt+l(we,nt);Tt>=rt||(we.z===nt.z||we.x===_e?.x&&we.y===_e?.y?_e?se.set(ke,_e):se.delete(ke):se.set(ke,{x:we.x,y:we.y,previous:_e}),X?X[ke]=Tt:J.set(ke,Tt),K?K[ke]=Re.id:ee.set(ke,Re.id),Y.push({id:ke,cost:Tt,priority:Tt+c*O(nt)}))}}Y.length&&xe<(e.maxNodes??30000)||(this.stats.completionReason=Y.length?"node-limit":"no-path",this.finish(null))},this.phase="search"},this.phase="obstacles"}getOutput(){if(!this.solved||this.failed||this.output===void 0)throw Error("repair04: clearance path output requested before completion");return this.output}getResult(){return this.getOutput()}};function $We(e,t){let n=[];for(let o=1;o<t.length;o++){let r=t[o-1],i=t[o];if(r.z!==i.z&&r.toNextSegmentType!=="through_obstacle"){if(r.x!==i.x||r.y!==i.y)throw Error("repair04: negotiated via endpoints must coincide");n.some((s)=>s.x===i.x&&s.y===i.y)||n.push({x:i.x,y:i.y})}}return{...e,route:t,vias:n}}var Kgr=class extends Da{input;phase="initialize";routeCursor=0;copperCursor=0;spanCount=0;output;pathSolver;prepareRoute;finishSetup;selectSpan;prepareCopper;startPath;applyPath;updateWorkStats;constructor(e){super(),this.input=e,this.stats={pathSearchNodes:0,pathSearchCalls:0,unresolvedSpanCount:0},this.MAX_ITERATIONS=Math.ceil(e.maxPathSearchNodes/128)+e.maxPathSearchCalls*(e.routes.reduce((t,n)=>t+n.route.length,0)+e.srj.obstacles.length*e.srj.layerCount+128)+e.routes.length+32}_step(){if(this.phase!=="initialize"){if(this.phase==="spans"){let e=Math.min(this.routeCursor+32,this.input.routes.length);for(;this.routeCursor<e;this.routeCursor++)this.prepareRoute(this.routeCursor);return void(this.routeCursor===this.input.routes.length&&(this.phase="setup"))}if(this.phase!=="setup"){if(this.phase==="select")return this.selectSpan(),void this.updateWorkStats();if(this.phase==="coppers"){let e=Math.min(this.copperCursor+32,this.spanCount);for(;this.copperCursor<e;this.copperCursor++)this.prepareCopper(this.copperCursor);return void(this.copperCursor===this.spanCount&&(this.phase="start-path"))}if(this.phase!=="start-path"){if(this.phase==="path"){let e=this.pathSolver;if(!e)throw Error("repair04: negotiated search child is missing");return e.step(),e.failed?(this.failed=!0,this.error=e.error):e.solved&&(this.activeSubSolver=null,this.phase="apply-path"),void this.updateWorkStats()}if(this.phase==="apply-path"){let e=this.pathSolver;if(!e)throw Error("repair04: completed negotiated search child is missing");return this.applyPath(e.getOutput()),this.applyPath=void 0,void this.updateWorkStats()}throw Error("repair04: negotiated clearance stepped after completion")}this.startPath()}else this.finishSetup()}else this.initialize()}initialize(){let e=this.input;for(let r of[e.maxPathSearchNodes,e.maxPathSearchCalls])if(!Number.isSafeInteger(r)||r<0)throw Error("repair04: negotiated work budgets must be nonnegative integers");if(e.maxPathSearchNodesPerCall!==void 0&&(!Number.isSafeInteger(e.maxPathSearchNodesPerCall)||e.maxPathSearchNodesPerCall<1))throw Error("repair04: per-path work budget must be a positive integer");if(e.pathHeuristicWeight!==void 0&&(!Number.isFinite(e.pathHeuristicWeight)||e.pathHeuristicWeight<1))throw Error("repair04: heuristic weight must be finite and at least one");if(e.pathGridSizeScale!==void 0&&(!Number.isFinite(e.pathGridSizeScale)||e.pathGridSizeScale<=0))throw Error("repair04: path grid scale must be positive and finite");if(e.viaHoleDiameter!==void 0&&(!Number.isFinite(e.viaHoleDiameter)||e.viaHoleDiameter<=0||e.routes.some((r)=>e.viaHoleDiameter>r.viaDiameter)))throw Error("repair04: via hole diameter must be positive and fit the copper");let t=(r)=>r.x>=e.bounds.minX-Ar&&r.x<=e.bounds.maxX+Ar&&r.y>=e.bounds.minY-Ar&&r.y<=e.bounds.maxY+Ar,n=[],o=e.routes.map(()=>[]);this.prepareRoute=(r)=>{let i=e.routes[r],s=i.route,a=s.flatMap((c,l)=>{let h=s[l-1],d=s[l+1],u=c.traceThickness??i.traceThickness,_=h&&(h.traceThickness??i.traceThickness)!==u||d&&(d.traceThickness??i.traceThickness)!==u,p=h&&h.z!==c.z&&(!e.allowLayerChanges||e.isLocked(r,l)||e.isLocked(r,l-1))||d&&d.z!==c.z&&(!e.allowLayerChanges||e.isLocked(r,l)||e.isLocked(r,l+1));return l===0||l===s.length-1||e.isLocked(r,l)||c.pcb_port_id||c.toNextSegmentType||c.insideJumperPad||_||p?[l]:[]});for(let c=1;c<a.length;c++){let l=s.slice(a[c-1],a[c]+1),h=l[0].traceThickness??i.traceThickness,d=l.slice(1).every((p,m)=>{let A=l[m],g=(A.x+p.x)/2,f=(A.y+p.y)/2;return g>e.bounds.minX+0.00000004&&g<e.bounds.maxX-0.00000004&&f>e.bounds.minY+0.00000004&&f<e.bounds.maxY-0.00000004}),u=l.slice(1).every((p,m)=>{let A=l[m],g=a[c-1]+m;return A.z===p.z||!e.isLocked(r,g)&&!e.isLocked(r,g+1)}),_=l.every(t)&&d&&u&&!i.jumpers?.length&&l.every((p)=>!p.toNextSegmentType&&!p.insideJumperPad&&(p.traceThickness??i.traceThickness)===h)&&(e.allowLayerChanges||l.every((p)=>p.z===l[0].z));o[r].push(n.length),n.push({routeIndex:r,mutable:Boolean(_),route:$We({...i,traceThickness:h},l)})}},this.finishSetup=()=>{let r=n.map((f)=>f.route),i=n.filter((f)=>!f.mutable).map((f)=>f.route),s=Mbe(e.srj,e.routes),a=(f)=>s.get(f.connectionName)??f.connectionName,c=new Set;for(let f of n)for(let y of[f.route.route[0],f.route.route.at(-1)]){let x=y.traceThickness??f.route.traceThickness,C=`${a(f.route)}|${y.x}|${y.y}|${y.z}|${x}`;if(c.has(C))continue;c.add(C);let b={x:y.x,y:y.y,z:y.z};i.push({...f.route,traceThickness:x,route:[b,b],vias:[]})}let l=n.map(({route:f})=>{let y=0;for(let x=1;x<f.route.length;x++){let C=f.route[x-1],b=f.route[x];y+=C.z===b.z?Math.hypot(C.x-b.x,C.y-b.y):1}return y}),h=new Set,d=new Set(e.dirtyRouteIndices),u=[],_=new Set,p=(f)=>{_.has(f)||h.has(f)||!n[f].mutable||(_.add(f),u.push(f))};n.forEach((f,y)=>{d.has(f.routeIndex)&&p(y)});let m=0,A=0,g=0;this.spanCount=n.length,this.updateWorkStats=()=>{this.stats={pathSearchNodes:m+(this.pathSolver?.stats.nodesPopped??0),pathSearchCalls:A,unresolvedSpanCount:_.size+h.size},this.progress=this.solved?1:Math.min(0.99,Math.max(this.stats.pathSearchNodes/Math.max(1,e.maxPathSearchNodes),A/Math.max(1,e.maxPathSearchCalls)))},this.selectSpan=()=>{if(!(g<u.length&&m<e.maxPathSearchNodes&&A<e.maxPathSearchCalls))return this.output={routes:e.routes.map((b,I)=>{if(!o[I].length)return b;return $We(b,o[I].flatMap((v,P)=>P===0?r[v].route:r[v].route.slice(1)))}),pathSearchNodes:m,pathSearchCalls:A,unresolvedSpanCount:_.size+h.size},this.solved=!0,void(this.phase="finished");let f=u[g++];_.delete(f);let y=r[f],x=a(y),C=[];this.copperCursor=0,this.prepareCopper=(b)=>{if(b===f)return;let I=r[b],v=a(I);for(let P=1;P<I.route.length;P++){let M=I.route[P-1],B=I.route[P];if(M.toNextSegmentType==="through_obstacle")continue;let T=!n[b].mutable||h.has(b);if(M.z===B.z&&(v===x||T))continue;let N=(M.z!==B.z?I.viaDiameter:Math.max(M.traceThickness??I.traceThickness,B.traceThickness??I.traceThickness))/2,D={a:M,b:B,radius:N,minX:Math.min(M.x,B.x),maxX:Math.max(M.x,B.x),minY:Math.min(M.y,B.y),maxY:Math.max(M.y,B.y),...LV(e.srj,M,B),spanIndex:b,owner:v,index:C.length,cellX:Math.floor(Math.min(M.x,B.x)-N),cellY:Math.floor(Math.min(M.y,B.y)-N),immutable:T};C.push(D)}},this.startPath=()=>{let b=(D)=>{if(!D.length)return;let L=new R_(D.length);for(let H of D)L.add(H.minX-H.radius-Ar,H.minY-H.radius-Ar,H.maxX+H.radius+Ar,H.maxY+H.radius+Ar);return L.finish(),{index:L,copper:D}},I=b(C),v=new Map;for(let D=0;D<e.srj.layerCount;D++)v.set(D,b(C.filter((L)=>L.minZ<=D&&L.maxZ>=D)));let P=(D,L)=>{let H=D.z!==L.z,V=Math.min(D.x,L.x),O=Math.max(D.x,L.x),U=Math.min(D.y,L.y),j=Math.max(D.y,L.y),Y=(H?y.viaDiameter:y.traceThickness)/2+Math.max(e.traceClearance,e.viaClearance),X=[],K=LV(e.srj,D,L),J=H?I:v.get(D.z),ee=J?.index.search(V-Y-Ar,U-Y-Ar,O+Y+Ar,j+Y+Ar)??[];for(let re of ee){let Z=J.copper[re],te=H&&Z.minZ!==Z.maxZ,ie=Z.minZ<=K.maxZ&&Z.maxZ>=K.minZ;if(!ie&&!te)continue;if(Z.immutable&&!te)continue;if(Z.owner===x&&(!te||D.x===Z.a.x&&D.y===Z.a.y))continue;let le=(H?y.viaDiameter:y.traceThickness)/2+(te?e.viaClearance:e.traceClearance)+Z.radius,ue=(e.viaHoleDiameter??y.viaDiameter)/2+(e.viaHoleDiameter??2*Z.radius)/2+e.viaClearance,de=te?ie&&Z.owner!==x?Math.max(le,ue):ue:le;if(V-de-Ar>Z.maxX||O+de+Ar<Z.minX||U-de-Ar>Z.maxY||j+de+Ar<Z.minY)continue;let me=Q_(D,L,Z.a,Z.b);me<de-Ar&&X.push({copper:Z,ratio:(de-me)/(de*de)})}let se=Math.floor(V-Y),ne=Math.floor(U-Y);return X.sort((re,Z)=>{let te=Math.max(se,re.copper.cellX)-Math.max(se,Z.copper.cellX);if(te!==0)return te;return Math.max(ne,re.copper.cellY)-Math.max(ne,Z.copper.cellY)||re.copper.index-Z.copper.index}),X},M=(D,L)=>{let H=(D.x+L.x)/2,V=(D.y+L.y)/2;if(H<=e.bounds.minX+0.00000004||H>=e.bounds.maxX-0.00000004||V<=e.bounds.minY+0.00000004||V>=e.bounds.maxY-0.00000004)return 1/0;let O=new Map;for(let{copper:j,ratio:Y}of P(D,L)){if(j.owner===x||j.immutable)return 1/0;O.set(j.owner,Math.max(O.get(j.owner)??0,Y*l[j.spanIndex]))}let U=0;for(let j of O.values())U+=j;return(D.z===L.z?Math.hypot(D.x-L.x,D.y-L.y):1)*U},B=new Map,T={nodesPopped:0,completionReason:"no-path"},N=new jgr({srj:e.srj,routes:[...i,y],routeIndex:i.length,start:y.route[0],end:y.route.at(-1),bounds:e.bounds,traceThickness:y.traceThickness,traceClearance:e.traceClearance,viaClearance:e.viaClearance,gridSize:Math.min(0.1,y.traceThickness*(e.pathGridSizeScale??1)/2),allowLayerChanges:e.allowLayerChanges,maxNodes:Math.min(e.maxPathSearchNodesPerCall??e.maxPathSearchNodes,e.maxPathSearchNodes-m),heuristicWeight:e.pathHeuristicWeight,stats:T,getAdditionalEdgeCost:(D,L)=>{if(D.z===L.z||e.srj.allowBlindAndBuriedVias===!0||D.x!==L.x||D.y!==L.y)return M(D,L);let H=B.get(D.x),V=H?.get(D.y);if(V!==void 0)return V;let O=M(D,L);return H||(H=new Map,B.set(D.x,H)),H.set(D.y,O),O},existingPath:y.route,viaHoleDiameter:e.viaHoleDiameter});this.pathSolver=N,this.activeSubSolver=N,this.MAX_ITERATIONS=Math.max(this.MAX_ITERATIONS,this.iterations+N.MAX_ITERATIONS+3),this.phase="path",this.applyPath=(D)=>{if(A++,m+=T.nodesPopped,e.onSearch?.(T),!D)return h.add(f),i.push(y),this.phase="select",void(this.pathSolver=void 0);r[f]=$We(y,D);let L=new Set;for(let H=1;H<D.length;H++)for(let{copper:V}of P(D[H-1],D[H]))L.add(V.spanIndex);for(let H of[...L].sort((V,O)=>V-O))l[H]++,p(H);L.size&&(l[f]++,p(f)),this.phase="select",this.pathSolver=void 0}},this.phase="coppers"},this.phase="select",this.updateWorkStats()},this.phase="spans"}getOutput(){if(!this.solved||this.failed||!this.output)throw Error("repair04: negotiated clearance output requested before completion");return this.output}getResult(){return this.getOutput()}},qWe=256,yS=0.25;function JWe(e,t,n,o){let r=t.x-e.x,i=t.y-e.y,s=o.x-n.x,a=o.y-n.y,c=e.x-n.x,l=e.y-n.y,h=r*r+i*i,d=r*s+i*a,u=s*s+a*a,_=r*c+i*l,p=s*c+a*l,m=h*u-d*d,A=m>0.000000000000001?Math.max(0,Math.min(1,(d*p-u*_)/m)):0;u<0.000000000000001&&(A=h>0.000000000000001?Math.max(0,Math.min(1,-_/h)):0);let g=u>0.000000000000001?(d*A+p)/u:0;g<0?(g=0,A=h>0.000000000000001?Math.max(0,Math.min(1,-_/h)):0):g>1&&(g=1,A=h>0.000000000000001?Math.max(0,Math.min(1,(d-_)/h)):0);let f=e.x+A*r-n.x-g*s,y=e.y+A*i-n.y-g*a;return{s:A,t:g,x:f,y,distance:GKt(f,y)}}function $gr(e,t){let n={x:0,y:0,depth:1/0};for(let o=0;o<t.length;o++){let r=t[o],i=t[(o+1)%t.length],s=i.x-r.x,a=i.y-r.y,c=GKt(s,a),l=a/c,h=-s/c,d=-((e.x-r.x)*l+(e.y-r.y)*h);if(d<0)return null;d<n.depth&&(n={x:l,y:h,depth:d})}return n}var qgr=class extends Da{input;phase="geometry";routes=[];nets=new Map;vertices=new Map;segments=[];pairs=[];padContacts=[];viaPadConstraints=new Map;traceClearance=0.1;viaClearance=0.1;pairOuterIndex=0;pairInnerIndex=1;obstacleIndex=0;sweepIndex=0;sweepPairIndex=0;sweepPadIndex=0;preparedPairCount=0;projectedConstraintCount=0;constructor(e){super(),this.input=e,this.MAX_ITERATIONS=1024}prepareGeometry(){let e=this.input,t=structuredClone(e.routes),n=Mbe(e.srj,t),o=e.traceClearance??0.1,r=e.viaClearance??0.1,i={minX:e.bounds.minX+e.boundaryMargin,maxX:e.bounds.maxX-e.boundaryMargin,minY:e.bounds.minY+e.boundaryMargin,maxY:e.bounds.maxY-e.boundaryMargin},s=YKt(e.srj,t,e.bounds),a=new Map,c=t.map((u,_)=>u.route.map((p,m)=>{let A=`${n.get(u.connectionName)}:${p.x}:${p.y}`,g=a.get(A);return g||(g={x:p.x,y:p.y,original:{x:p.x,y:p.y},locked:!1,radius:0,revision:0,bounds:i,points:[]},a.set(A,g)),g.points.push(p),g.locked||=Boolean(e.lockedPointIndices[_][m]||s[_].segmentTimes.has(m)||s[_].segmentTimes.has(m-1)||s[_].viaPositions.some((f)=>Math.hypot(f.x-p.x,f.y-p.y)<=Ar)||m===0||m===u.route.length-1||p.pcb_port_id||p.insideJumperPad||p.toNextSegmentType||p.x<=i.minX||p.x>=i.maxX||p.y<=i.minY||p.y>=i.maxY),g})),l=[];for(let u=0;u<t.length;u++){let _=t[u];for(let p=1;p<_.route.length;p++){let m=_.route[p-1],A=_.route[p];if(m.toNextSegmentType||m.insideJumperPad||A.insideJumperPad)continue;let g=c[u][p-1],f=c[u][p],y=m.z!==A.z;y&&e.allowViaMovement!==!0&&(g.locked=f.locked=!0),l.push({a:g,b:f,initialBounds:{minX:Math.min(g.x,f.x),maxX:Math.max(g.x,f.x),minY:Math.min(g.y,f.y),maxY:Math.max(g.y,f.y)},...LV(e.srj,m,A),radius:y?_.viaDiameter/2:Math.max(m.traceThickness??_.traceThickness,A.traceThickness??_.traceThickness)/2,net:n.get(_.connectionName),routeIndex:u,via:y})}}for(let u of l)u.a.radius=Math.max(u.a.radius,u.radius),u.b.radius=Math.max(u.b.radius,u.radius);if(e.boardEdgeClearance!==void 0){let u=e.srj.bounds;for(let _ of a.values()){let p=_.radius+e.boardEdgeClearance;_.bounds={minX:Math.max(i.minX,Math.min(_.original.x,u.minX+p)),maxX:Math.min(i.maxX,Math.max(_.original.x,u.maxX-p)),minY:Math.max(i.minY,Math.min(_.original.y,u.minY+p)),maxY:Math.min(i.maxY,Math.max(_.original.y,u.maxY-p))}}}this.routes=t,this.nets=n,this.vertices=a,this.segments=l,this.traceClearance=o,this.viaClearance=r;let h=l.length*(l.length-1)/2,d=l.length*e.srj.obstacles.length;this.MAX_ITERATIONS=this.iterations+Math.ceil(h/4096)+Math.ceil(e.srj.obstacles.length/16)+qWe*Math.max(1,Math.ceil((h+d)/4096))+4,this.phase="pairs"}preparePairs(){let e=0;for(;e<4096&&this.pairOuterIndex<this.segments.length;){if(this.pairInnerIndex>=this.segments.length){this.pairOuterIndex++,this.pairInnerIndex=this.pairOuterIndex+1;continue}let t=this.segments[this.pairOuterIndex],n=this.segments[this.pairInnerIndex++];if(e++,this.preparedPairCount++,t.net===n.net||t.maxZ<n.minZ||n.maxZ<t.minZ)continue;let o=t.radius+n.radius+Math.max(this.traceClearance,this.viaClearance)+2*Math.SQRT2*yS;WHt(t.initialBounds,n.initialBounds,o)||Q_(t.a,t.b,n.a,n.b)<=o&&this.pairs.push({a:t,b:n,revisions:[-1,-1,-1,-1],contact:null})}this.pairOuterIndex>=this.segments.length&&(this.phase="obstacles"),this.stats={...this.stats,preparedPairCount:this.preparedPairCount,pairCount:this.pairs.length,lastPreparedPairBatchCount:e}}prepareObstacles(){let{input:e,nets:t,segments:n,traceClearance:o,viaClearance:r,padContacts:i,viaPadConstraints:s}=this,a=0;for(;a<16&&this.obstacleIndex<e.srj.obstacles.length;){let c=e.srj.obstacles[this.obstacleIndex++];a++;let l=(c.ccwRotationDegrees??0)*Math.PI/180,h=Math.cos(l),d=Math.sin(l),u=new Set(c.connectedTo.map((A)=>t.get(A)??A)),_=c.__zLayers??c.zLayers??c.layers.map((A)=>A==="top"?0:A==="bottom"?e.srj.layerCount-1:Number(A.slice(5))),p=[[-1,-1],[1,-1],[1,1],[-1,1]].map(([A,g])=>({x:c.center.x+h*A*c.width/2-d*g*c.height/2,y:c.center.y+d*A*c.width/2+h*g*c.height/2})),m={minX:Math.min(...p.map((A)=>A.x)),maxX:Math.max(...p.map((A)=>A.x)),minY:Math.min(...p.map((A)=>A.y)),maxY:Math.max(...p.map((A)=>A.y))};for(let A of n){if(!A.via&&u.has(A.net)||!_.some((y)=>y>=A.minZ&&y<=A.maxZ))continue;let g=A.radius+Math.max(o,r,e.srj.defaultObstacleMargin??0,e.srj.minTraceToPadEdgeClearance??0,e.srj.minTraceToHoleEdgeClearance??0,e.srj.minViaEdgeToPadEdgeClearance??0)+Math.SQRT2*yS;if(WHt(A.initialBounds,m,g))continue;if(Math.min(...p.map((y,x)=>Q_(A.a,A.b,y,p[(x+1)%4])))>g)continue;let f=A.radius+(A.via?sqe(e.srj,r,u.has(A.net)):c.isNonPlatedHole&&e.srj.minTraceToHoleEdgeClearance!==void 0?e.srj.minTraceToHoleEdgeClearance:Math.max(o,e.srj.defaultObstacleMargin??0,e.srj.minTraceToPadEdgeClearance??0));if(i.push({segment:A,corners:p,required:f,revisions:[-1,-1],contact:null}),A.via){let y={center:c.center,cosine:h,sine:d,shape:Ebe(c),clearance:f},x=A.a.original.x-c.center.x,C=A.a.original.y-c.center.y,b={x:x*h+C*d,y:-x*d+C*h};y.clearance=Math.min(y.clearance,uq(b,b,y.shape));for(let I of new Set([A.a,A.b])){let v=s.get(I);v?v.push(y):s.set(I,[y])}}}}this.stats={...this.stats,preparedObstacleCount:this.obstacleIndex,padContactCount:this.padContacts.length,lastPreparedObstacleBatchCount:a},this.obstacleIndex===e.srj.obstacles.length&&(this.MAX_ITERATIONS=this.iterations+qWe*Math.max(1,Math.ceil((this.pairs.length+this.padContacts.length)/4096))+2,this.phase="sweeps")}project(e,t,n,o,r){let i=this.viaPadConstraints,s=new Map;for(let[l,h]of e)l.locked||s.set(l,(s.get(l)??0)+h);let a=[...s.values()].reduce((l,h)=>l+h*h,0);if(a<0.000000000000001)return;let c=Math.min(0.05,0.7*o)/a;for(let[l,h]of s){let d=Math.max(l.bounds.minX,l.original.x-yS,Math.min(l.bounds.maxX,l.original.x+yS,l.x+t*c*h)),u=Math.max(l.bounds.minY,l.original.y-yS,Math.min(l.bounds.maxY,l.original.y+yS,l.y+n*c*h)),_=i.get(l);if(_?.some((p)=>this.getViaPadDistance({x:d,y:u},p)<p.clearance)){if(!r)continue;let p=this.constrainViaDisplacement(l,{x:d,y:u},_);d=p.x,u=p.y}_?.some((p)=>this.getViaPadDistance({x:d,y:u},p)<p.clearance)||(l.x===d&&l.y===u||l.revision++,l.x=d,l.y=u)}}getViaPadDistance(e,t){let n=e.x-t.center.x,o=e.y-t.center.y,r={x:n*t.cosine+o*t.sine,y:-n*t.sine+o*t.cosine};return uq(r,r,t.shape)}constrainViaDisplacement(e,t,n){let o=t.x-e.x,r=t.y-e.y,i=[];for(let c of n){if(this.getViaPadDistance(t,c)>=c.clearance)continue;let l=e.x-c.center.x,h=e.y-c.center.y,d={x:l*c.cosine+h*c.sine,y:-l*c.sine+h*c.cosine},u;if(c.shape.type==="rect"){let A=c.shape.bounds;u={x:Math.max(A.minX,Math.min(A.maxX,d.x)),y:Math.max(A.minY,Math.min(A.maxY,d.y))}}else{let{a:A,b:g}=c.shape,f=g.x-A.x,y=g.y-A.y,x=f*f+y*y,C=x>0?Math.max(0,Math.min(1,((d.x-A.x)*f+(d.y-A.y)*y)/x)):0;u={x:A.x+C*f,y:A.y+C*y}}let _=d.x-u.x,p=d.y-u.y,m={x:_*c.cosine-p*c.sine,y:_*c.sine+p*c.cosine};m.x*m.x+m.y*m.y>0.00000000000000000001&&i.push(m)}let s={x:0,y:0},a=o*o+r*r;for(let c of i){let l=o*c.x+r*c.y,h=c.x*c.x+c.y*c.y,d=this.shortenDisplacement(e,{x:o-c.x*l/h,y:r-c.y*l/h});if(i.some((_)=>d.x*_.x+d.y*_.y<-0.000000000000001))continue;let u=(d.x-o)**2+(d.y-r)**2;u<a&&(s=d,a=u)}return this.compensateTangentRounding(e,s,n,i)}shortenDisplacement(e,t){let n=Math.max(e.bounds.minX,e.original.x-yS),o=Math.min(e.bounds.maxX,e.original.x+yS),r=Math.max(e.bounds.minY,e.original.y-yS),i=Math.min(e.bounds.maxY,e.original.y+yS),s=1;return t.x>0&&(s=Math.min(s,(o-e.x)/t.x)),t.x<0&&(s=Math.min(s,(n-e.x)/t.x)),t.y>0&&(s=Math.min(s,(i-e.y)/t.y)),t.y<0&&(s=Math.min(s,(r-e.y)/t.y)),{x:Math.max(n,Math.min(o,e.x+t.x*s))-e.x,y:Math.max(r,Math.min(i,e.y+t.y*s))-e.y}}compensateTangentRounding(e,t,n,o){let r={x:e.x+t.x,y:e.y+t.y},i=n.reduce((_,p)=>Math.max(_,Math.abs(p.center.x),Math.abs(p.center.y),p.clearance),Math.max(1,Math.abs(e.x),Math.abs(e.y),Math.abs(r.x),Math.abs(r.y))),s=32*Number.EPSILON*i,a=n.map((_)=>this.getViaPadDistance(r,_));if(a.every((_,p)=>_>=n[p].clearance)||a.some((_,p)=>_<n[p].clearance-s))return r;let c=o.map((_)=>{let p=Math.hypot(_.x,_.y);return{x:_.x/p,y:_.y/p}}),l={x:0,y:0};for(let _ of c)for(let p of[_,{x:-_.y,y:_.x},{x:_.y,y:-_.x}])c.some((m)=>p.x*m.x+p.y*m.y<-0.000000000000001)||(l.x+=p.x,l.y+=p.y);let h=Math.hypot(l.x,l.y);if(h<0.000000000000001)return r;let d=this.shortenDisplacement(e,{x:t.x+l.x*s/h,y:t.y+l.y*s/h}),u={x:e.x+d.x,y:e.y+d.y};return n.every((_)=>this.getViaPadDistance(u,_)>=_.clearance)?u:r}projectPair(e){let{a:t,b:n,revisions:o}=e;t.a.revision===o[0]&&t.b.revision===o[1]&&n.a.revision===o[2]&&n.b.revision===o[3]||(e.contact=JWe(t.a,t.b,n.a,n.b),o[0]=t.a.revision,o[1]=t.b.revision,o[2]=n.a.revision,o[3]=n.b.revision);let r=e.contact,i=t.radius+n.radius+(t.via&&n.via?this.viaClearance:this.traceClearance);r.distance>=i||r.distance<0.0000000001||this.project([[t.a,1-r.s],[t.b,r.s],[n.a,r.t-1],[n.b,-r.t]],r.x/r.distance,r.y/r.distance,i-r.distance,t.via&&n.via)}projectPad(e){let{segment:t,corners:n,required:o}=e,r=t.a===t.b?1:2;for(let s=0;s<r;s++){let a=s===0?t.a:t.b,c=$gr(a,n);c&&this.project([[a,1]],c.x,c.y,o+c.depth,!1)}if(t.a.revision!==e.revisions[0]||t.b.revision!==e.revisions[1]){let s=JWe(t.a,t.b,n[0],n[1]);for(let a=1;a<n.length;a++){let c=JWe(t.a,t.b,n[a],n[(a+1)%n.length]);s=s.distance<c.distance?s:c}e.contact=s,e.revisions[0]=t.a.revision,e.revisions[1]=t.b.revision}let i=e.contact;i.distance<0.0000000001||i.distance>=o||this.project([[t.a,1-i.s],[t.b,i.s]],i.x/i.distance,i.y/i.distance,o-i.distance,!1)}stepSweep(){let e=0;for(;e<4096&&this.sweepPairIndex<this.pairs.length;)this.projectPair(this.pairs[this.sweepPairIndex++]),e++;for(;e<4096&&this.sweepPairIndex===this.pairs.length&&this.sweepPadIndex<this.padContacts.length;)this.projectPad(this.padContacts[this.sweepPadIndex++]),e++;this.projectedConstraintCount+=e,this.sweepPairIndex===this.pairs.length&&this.sweepPadIndex===this.padContacts.length&&(this.sweepIndex++,this.sweepPairIndex=0,this.sweepPadIndex=0,this.sweepIndex===qWe&&(this.phase="finalize")),this.progress=this.sweepIndex/257,this.stats={...this.stats,sweepCount:this.sweepIndex,projectedConstraintCount:this.projectedConstraintCount,lastProjectedConstraintBatchCount:e}}finalizeRoutes(){let{vertices:e,routes:t}=this;for(let n of e.values())for(let o of n.points)o.x=n.x,o.y=n.y;for(let n of t){n.vias=[];for(let o=1;o<n.route.length;o++){let r=n.route[o-1],i=n.route[o];r.z===i.z||r.toNextSegmentType==="through_obstacle"||n.vias.some((s)=>s.x===i.x&&s.y===i.y)||n.vias.push({x:i.x,y:i.y})}}this.solved=!0,this.progress=1}_step(){switch(this.phase){case"geometry":return this.prepareGeometry();case"pairs":return this.preparePairs();case"obstacles":return this.prepareObstacles();case"sweeps":return this.stepSweep();case"finalize":return this.finalizeRoutes()}}getOutput(){if(!this.solved||this.failed)throw Error("Trace clearance projection is not complete");return this.routes}getResult(){return this.getOutput()}},xCe={};ube(xCe,{all_layers:()=>US,any_circuit_element:()=>xen,any_soup_element:()=>bCe,any_source_component:()=>S$t,asset:()=>Lle,base_circuit_json_error:()=>Nc,battery_capacity:()=>KKt,brep_shape:()=>SJe,cadModelDefaultDirectionMap:()=>kAr,cad_cable:()=>LZt,cad_collision_error:()=>kZt,cad_component:()=>QZt,cad_model_axis_directions:()=>RZt,cad_model_formats:()=>QAr,cad_reference_surface:()=>FZt,capacitance:()=>jqe,circle_shape:()=>Kqe,circuit_json_footprint_load_error:()=>iZt,current:()=>FQ,distance:()=>Dn,duration_ms:()=>Fq,experiment_type:()=>WZt,external_footprint_load_error:()=>rZt,frequency:()=>iY,getRotationBetweenPcbPin1Locations:()=>lAr,getSimulationReturnCurrentGridJsonSchema:()=>zAr,getZodPrefixedIdWithDefault:()=>Pn,inductance:()=>XKt,insertionDirectionToCanonical:()=>Eqt,insertionDirectionToVector:()=>aAr,insertion_direction:()=>Mqt,kicadAt:()=>Dbe,kicadEffects:()=>$Kt,kicadFont:()=>qqe,kicadFootprintAttributes:()=>JKt,kicadFootprintMetadata:()=>t$t,kicadFootprintModel:()=>e$t,kicadFootprintPad:()=>ZKt,kicadFootprintProperties:()=>qKt,kicadProperty:()=>Zae,kicadSymbolEffects:()=>r$t,kicadSymbolMetadata:()=>s$t,kicadSymbolPinNames:()=>o$t,kicadSymbolPinNumbers:()=>n$t,kicadSymbolProperties:()=>i$t,kicadSymbolProperty:()=>bQ,layer_ref:()=>Wi,layer_string:()=>mKe,length:()=>Ko,manufacturing_drc_properties:()=>Tqt,ms:()=>Wg,ninePointAnchor:()=>SB,parseAndConvertSiUnit:()=>r6,pcbRenderLayer:()=>rAr,pcb_autorouting_error:()=>aZt,pcb_bend:()=>AJt,pcb_board:()=>gJt,pcb_breakout_point:()=>mZt,pcb_bus_length_skew_error:()=>iJt,pcb_bus_routing_constraint_error:()=>cJt,pcb_bus_routing_constraint_warning:()=>lJt,pcb_component:()=>Dqt,pcb_component_invalid_layer_error:()=>vZt,pcb_component_missing_courtyard_warning:()=>dZt,pcb_component_not_on_board_edge_error:()=>IZt,pcb_component_outside_board_error:()=>bZt,pcb_connector_not_in_accessible_orientation_warning:()=>hZt,pcb_copper_pour:()=>CZt,pcb_copper_pour_brep:()=>yZt,pcb_copper_pour_polygon:()=>xZt,pcb_copper_pour_rect:()=>fZt,pcb_copper_text:()=>TJt,pcb_courtyard_circle:()=>DZt,pcb_courtyard_outline:()=>BZt,pcb_courtyard_overlap_error:()=>jJt,pcb_courtyard_pill:()=>NZt,pcb_courtyard_polygon:()=>TZt,pcb_courtyard_rect:()=>wZt,pcb_cutout:()=>nZt,pcb_cutout_circle:()=>ZJt,pcb_cutout_path:()=>tZt,pcb_cutout_polygon:()=>eZt,pcb_cutout_rect:()=>JJt,pcb_debug_line:()=>Rqt,pcb_debug_object:()=>kqt,pcb_debug_object_base:()=>Qbe,pcb_debug_point:()=>Qqt,pcb_debug_rect:()=>Nqt,pcb_fabrication_note_dimension:()=>OJt,pcb_fabrication_note_path:()=>FJt,pcb_fabrication_note_rect:()=>zJt,pcb_fabrication_note_text:()=>HJt,pcb_fabricator_extra_charge_warning:()=>pZt,pcb_footprint_overlap_error:()=>XJt,pcb_ground_plane:()=>_Zt,pcb_ground_plane_region:()=>gZt,pcb_group:()=>sZt,pcb_hole:()=>Yqt,pcb_hole_circle_or_square_shape:()=>pAr,pcb_hole_circle_shape:()=>dAr,pcb_hole_oval_shape:()=>mAr,pcb_hole_pill_shape:()=>_Ar,pcb_hole_rect_shape:()=>uAr,pcb_hole_rotated_pill_shape:()=>gAr,pcb_keepout:()=>$Jt,pcb_keepout_outline:()=>KJt,pcb_keepout_overlap_warning:()=>qJt,pcb_manual_edit_conflict_warning:()=>lZt,pcb_missing_footprint_error:()=>oZt,pcb_net:()=>mJt,pcb_note_dimension:()=>WJt,pcb_note_line:()=>UJt,pcb_note_path:()=>GJt,pcb_note_rect:()=>YJt,pcb_note_text:()=>VJt,pcb_packing_error:()=>SJt,pcb_pad_pad_clearance_error:()=>EZt,pcb_pad_trace_clearance_error:()=>MZt,pcb_panel:()=>IJt,pcb_panelization_placement_error:()=>PJt,pcb_pin1_location:()=>gKe,pcb_placement_error:()=>vJt,pcb_plated_hole:()=>Gqt,pcb_port:()=>Uqt,pcb_port_not_connected_error:()=>pJt,pcb_port_not_matched_error:()=>uJt,pcb_preflight_routing_error:()=>cZt,pcb_route_hint:()=>wqt,pcb_route_hints:()=>hAr,pcb_silkscreen_circle:()=>NJt,pcb_silkscreen_graphic:()=>kJt,pcb_silkscreen_graphic_brep:()=>QJt,pcb_silkscreen_line:()=>MJt,pcb_silkscreen_oval:()=>RJt,pcb_silkscreen_path:()=>wJt,pcb_silkscreen_pill:()=>LJt,pcb_silkscreen_rect:()=>DJt,pcb_silkscreen_text:()=>BJt,pcb_smtpad:()=>Xqt,pcb_smtpad_pill:()=>Wqt,pcb_solder_paste:()=>jqt,pcb_soldermask_opening:()=>Kqt,pcb_stiffener:()=>bJt,pcb_stiffener_polygon:()=>CJt,pcb_stiffener_rect:()=>xJt,pcb_text:()=>$qt,pcb_thermal_spoke:()=>AZt,pcb_trace:()=>tJt,pcb_trace_error:()=>hJt,pcb_trace_hint:()=>EJt,pcb_trace_missing_error:()=>dJt,pcb_trace_route_point:()=>eJt,pcb_trace_route_point_through_pad:()=>Zqt,pcb_trace_route_point_via:()=>Jqt,pcb_trace_route_point_wire:()=>qqt,pcb_trace_style_warning:()=>oJt,pcb_trace_too_long_error:()=>rJt,pcb_trace_too_long_warning:()=>sJt,pcb_trace_too_many_vias_warning:()=>aJt,pcb_trace_warning:()=>nJt,pcb_via:()=>_Jt,pcb_via_clearance_error:()=>SZt,pcb_via_trace_clearance_error:()=>PZt,point:()=>cr,point3:()=>n6,point_with_bulge:()=>Pqt,polygon_shape:()=>ile,port_arrangement:()=>$$t,position:()=>tAr,position3:()=>nAr,rect_shape:()=>Tbe,resistance:()=>wbe,ring:()=>_Ke,rotated_rect_shape:()=>$qe,rotation:()=>od,route_hint_point:()=>Bqt,schematic_arc:()=>nqt,schematic_box:()=>U$t,schematic_circle:()=>tqt,schematic_component:()=>q$t,schematic_component_overlap_warning:()=>_qt,schematic_component_port_arrangement_by_sides:()=>K$t,schematic_component_port_arrangement_by_size:()=>j$t,schematic_component_styling_warning:()=>gqt,schematic_debug_line:()=>hqt,schematic_debug_object:()=>uqt,schematic_debug_object_base:()=>Rbe,schematic_debug_point:()=>dqt,schematic_debug_rect:()=>lqt,schematic_element_outside_sheet_warning:()=>fqt,schematic_error:()=>aqt,schematic_graphic:()=>yqt,schematic_group:()=>xqt,schematic_layout_error:()=>cqt,schematic_line:()=>Z$t,schematic_manual_edit_conflict_warning:()=>mqt,schematic_missing_sheet_warning:()=>Sqt,schematic_net_label:()=>sqt,schematic_path:()=>W$t,schematic_pin_styles:()=>X$t,schematic_port:()=>iqt,schematic_rect:()=>eqt,schematic_sheet:()=>vqt,schematic_sheet_size:()=>Iqt,schematic_sheet_styling_warning:()=>Aqt,schematic_symbol:()=>J$t,schematic_table:()=>Cqt,schematic_table_cell:()=>bqt,schematic_text:()=>rqt,schematic_text_part:()=>vJe,schematic_trace:()=>oqt,schematic_voltage_probe:()=>pqt,simulation_ac_current_source:()=>GZt,simulation_ac_sweep_current_graph:()=>aen,simulation_ac_sweep_voltage_graph:()=>sen,simulation_ac_voltage_source:()=>OZt,simulation_complex_sample:()=>wJe,simulation_current_probe:()=>ZZt,simulation_current_source:()=>UZt,simulation_dc_current_source:()=>YZt,simulation_dc_operating_point_current:()=>oen,simulation_dc_operating_point_voltage:()=>nen,simulation_dc_sweep_current_graph:()=>ien,simulation_dc_sweep_unit:()=>Lbe,simulation_dc_sweep_voltage_graph:()=>ren,simulation_dc_voltage_source:()=>zZt,simulation_experiment:()=>jZt,simulation_op_amp:()=>cen,simulation_oscilloscope_trace:()=>hen,simulation_parameter_sweep:()=>ten,simulation_parameter_sweep_coordinate:()=>PB,simulation_parameter_type:()=>FAr,simulation_parameter_unit:()=>MJe,simulation_pcb_return_current_field:()=>gen,simulation_pcb_return_current_heatmap:()=>fen,simulation_pcb_return_current_marker:()=>yen,simulation_pcb_return_current_result:()=>uen,simulation_return_current_contact:()=>fKe,simulation_return_current_excitation:()=>den,simulation_return_current_field_asset:()=>men,simulation_return_current_grid_json:()=>Aen,simulation_return_current_image_asset:()=>_en,simulation_spice_subcircuit:()=>len,simulation_switch:()=>qZt,simulation_terminal_port:()=>yKe,simulation_transient_current_graph:()=>$Zt,simulation_transient_voltage_graph:()=>KZt,simulation_unknown_experiment_error:()=>een,simulation_voltage_probe:()=>JZt,simulation_voltage_source:()=>VZt,size:()=>Bbe,source_ambiguous_port_reference:()=>D$t,source_board:()=>T$t,source_bus:()=>Y$t,source_component_availability_warning:()=>CJe,source_component_base:()=>xh,source_component_internal_connection:()=>E$t,source_component_misconfigured_error:()=>IJe,source_component_pins_underspecified_warning:()=>H$t,source_confusing_net_name_warning:()=>V$t,source_failed_to_create_component_error:()=>x$t,source_group:()=>w$t,source_i2c_misconfigured_error:()=>bJe,source_interconnect:()=>I$t,source_invalid_component_property_error:()=>gJe,source_manually_placed_via:()=>R$t,source_missing_manufacturer_part_number_warning:()=>yJe,source_missing_property_error:()=>y$t,source_motor:()=>d$t,source_net:()=>B$t,source_no_ground_pin_defined_warning:()=>L$t,source_no_power_pin_defined_warning:()=>k$t,source_part_not_found_warning:()=>O$t,source_pcb_ground_plane:()=>N$t,source_pin_attributes:()=>_$t,source_pin_missing_trace_warning:()=>fJe,source_pin_must_be_connected_error:()=>F$t,source_port:()=>P$t,source_printed_part:()=>l$t,source_project_metadata:()=>_Je,source_property_ignored_warning:()=>C$t,source_refdes_convention_warning:()=>xJe,source_runtime_error:()=>G$t,source_simple_ammeter:()=>m$t,source_simple_battery:()=>oJe,source_simple_capacitor:()=>Jqe,source_simple_chip:()=>tJe,source_simple_connector:()=>f$t,source_simple_connector_standards:()=>A$t,source_simple_crystal:()=>g$t,source_simple_current_source:()=>u$t,source_simple_diode:()=>Nbe,source_simple_fiducial:()=>a$t,source_simple_fuse:()=>p$t,source_simple_ground:()=>c$t,source_simple_inductor:()=>rJe,source_simple_led:()=>eJe,source_simple_mosfet:()=>uJe,source_simple_op_amp:()=>pJe,source_simple_pin_header:()=>aJe,source_simple_pinout:()=>cJe,source_simple_potentiometer:()=>sJe,source_simple_power_source:()=>nJe,source_simple_push_button:()=>iJe,source_simple_resistor:()=>Zqe,source_simple_resonator:()=>lJe,source_simple_switch:()=>mJe,source_simple_test_point:()=>dJe,source_simple_transistor:()=>hJe,source_simple_voltage_probe:()=>b$t,source_simple_voltage_source:()=>v$t,source_subassembly:()=>h$t,source_trace:()=>M$t,source_trace_not_connected_error:()=>AJe,source_unnamed_trace_warning:()=>Q$t,spice_simulation_options:()=>XZt,standard_shape:()=>oAr,supplier_footprint_mismatch_warning:()=>uZt,supplier_name:()=>zq,time:()=>eAr,timestamp:()=>jKt,unknown_error_finding_part:()=>z$t,visible_layer:()=>k_,voltage:()=>i6,wave_shape:()=>EJe});var CCe=(e)=>{let t=Math.round(1000*e)/1000;return`${Number(t.toFixed(3))}mm`},UKt=new Map([["T",1000000000000],["G",1e9],["M",1e6],["K",1000],["k",1000],["",1],["m",0.001],["µ",0.000001],["μ",0.000001],["u",0.000001],["n",0.000000001],["p",0.000000000001],["f",0.000000000000001]]),Jgr=[...UKt.keys()];function XHt(e){return UKt.get(e)}var WKt={Hz:{baseUnit:"Hz",variants:{MHz:1e6,kHz:1000,Hz:1}},g:{baseUnit:"g",variants:{kg:1000,g:1}},"Ω":{baseUnit:"Ω",variants:{"mΩ":0.001,mohm:0.001,mOhm:0.001,milliohm:0.001,"Ω":1,ohm:1,Ohm:1,"kΩ":1000,"KΩ":1000,kohm:1000,kOhm:1000,KOhm:1000,Kohm:1000,"MΩ":1e6,Mohm:1e6,MOhm:1e6,megohm:1e6,Megohm:1e6,"GΩ":1e9,Gohm:1e9,GOhm:1e9,"TΩ":1000000000000,Tohm:1000000000000,TOhm:1000000000000}},V:{baseUnit:"V",variants:{mV:0.001,V:1,kV:1000,KV:1000,MV:1e6,GV:1e9,TV:1000000000000}},A:{baseUnit:"A",variants:{"µA":0.000001,"μA":0.000001,mA:0.001,ma:0.001,A:1,kA:1000,MA:1e6}},F:{baseUnit:"F",variants:{pF:0.000000000001,nF:0.000000001,"µF":0.000001,"μF":0.000001,uF:0.000001,mF:0.001,F:1,kF:1000,KF:1000,MF:1e6}},H:{baseUnit:"H",variants:{pH:0.000000000001,nH:0.000000001,"µH":0.000001,"μH":0.000001,uH:0.000001,mH:0.001,H:1,kH:1000,KH:1000,MH:1e6}},ml:{baseUnit:"ml",variants:{ml:1,mL:1,l:1000,L:1000}},deg:{baseUnit:"deg",variants:{rad:180/Math.PI}},ms:{baseUnit:"ms",variants:{fs:0.000000000001,ps:0.000000001,ns:0.000001,us:0.001,"µs":0.001,"μs":0.001,ms:1,s:1000}},mm:{baseUnit:"mm",variants:{nm:0.000001,"µm":0.001,"μm":0.001,um:0.001,mm:1,cm:10,dm:100,m:1000,km:1e6,in:25.4,ft:304.8,IN:25.4,FT:304.8,yd:914.4,mi:1609344,mil:0.0254}}},uKe=new Set;for(let[e,t]of Object.entries(WKt)){uKe.add(e);for(let n of Object.keys(t.variants))uKe.add(n)}function r6(e,t){if(e==null)return{parsedUnit:null,unitOfValue:null,value:null};if(typeof e=="string"&&e.match(/^-?[\d.]+$/))return{value:Number.parseFloat(e),parsedUnit:null,unitOfValue:null};if(typeof e=="number")return{value:e,parsedUnit:null,unitOfValue:null};if(typeof e=="object"&&"x"in e&&"y"in e){let l=r6(e.x,t),h=r6(e.x,t),d=r6(e.y,t);return h.value===null||d.value===null?{parsedUnit:null,unitOfValue:null,value:null}:{parsedUnit:l.parsedUnit,unitOfValue:l.unitOfValue,value:{x:h.value,y:d.value}}}let n=e.toString().split("").reverse().join(""),o=n.match(/[^\d\s]+/)?.[0];if(!o)throw Error(`Could not determine unit: "${e}"`);let r=o.split("").reverse().join(""),i=e.slice(0,-r.length),s=XHt(r);if(t&&s!=null)return{parsedUnit:null,unitOfValue:t,value:Number.parseFloat(i)*s};if(s!=null&&!uKe.has(r))return{parsedUnit:null,unitOfValue:null,value:Number.parseFloat(i)*s};let{baseUnit:a,conversionFactor:c}=function(l){for(let h of Object.values(WKt)){if(l in h.variants)return{baseUnit:h.baseUnit,conversionFactor:h.variants[l]};for(let[d,u]of Object.entries(h.variants)){if(!l.endsWith(d))continue;let _=XHt(l.slice(0,-d.length));if(_!=null)return{baseUnit:h.baseUnit,conversionFactor:_*u}}}return{baseUnit:l,conversionFactor:1}}(r);return{parsedUnit:r,unitOfValue:a,value:c*Number.parseFloat(i)}}var Zgr=Jgr.filter((e)=>e!=="").sort((e,t)=>t.length-e.length).map((e)=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),wbe=(new RegExp(`^([+-]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+-]?\\d+)?)(?:(${Zgr}))?$`),E.string().or(E.number()).transform((e)=>r6(e,"Ω").value)),jqe=E.string().or(E.number()).transform((e)=>r6(e,"F").value).transform((e)=>Number.parseFloat(e.toPrecision(12))),XKt=E.string().or(E.number()).transform((e)=>r6(e,"H").value),i6=E.string().or(E.number()).transform((e)=>r6(e,"V").value),Ko=E.string().or(E.number()).transform((e)=>r6(e).value),iY=E.string().or(E.number()).transform((e)=>r6(e,"Hz").value),Dn=Ko,FQ=E.string().or(E.number()).transform((e)=>r6(e,"A").value),Fq=E.string().or(E.number()).transform((e)=>r6(e).value),eAr=Fq,Wg=Fq,jKt=E.string().datetime(),od=E.string().or(E.number()).transform((e)=>typeof e=="number"?e:e.endsWith("deg")?Number.parseFloat(e.split("deg")[0]):e.endsWith("rad")?180*Number.parseFloat(e.split("rad")[0])/Math.PI:Number.parseFloat(e)),KKt=E.number().or(E.string().endsWith("mAh")).transform((e)=>{if(typeof e=="string"){let t=e.replace("mAh",""),n=Number.parseFloat(t);if(Number.isNaN(n))throw Error("Invalid capacity");return n}return e}).describe("Battery capacity in mAh"),cr=E.object({x:Dn,y:Dn}),tAr=cr,n6=E.object({x:Dn,y:Dn,z:Dn}),nAr=n6,Bbe=E.object({width:E.number(),height:E.number()}),pq=Dn.pipe(E.number().finite()),pKe=Dn.pipe(E.number().finite().positive()),Kqe=E.object({shape:E.literal("circle"),x:pq,y:pq,radius:pKe}).strict(),Tbe=E.object({shape:E.literal("rect"),x:pq,y:pq,width:pKe,height:pKe}).strict(),$qe=Tbe.extend({shape:E.literal("rotated_rect"),ccw_rotation:od.pipe(E.number().finite())}),ile=E.object({shape:E.literal("polygon"),points:E.array(cr.extend({x:pq,y:pq})).min(3).refine((e)=>{let t=e.reduce((n,o,r)=>{let i=e[(r+1)%e.length];return n+o.x*i.y-i.x*o.y},0);return Number.isFinite(t)&&t!==0},"Polygon boundary must enclose a nonzero area")}).strict(),oAr=E.discriminatedUnion("shape",[Kqe,Tbe,$qe,ile]),Pn=(e)=>E.string().optional().default(()=>`${e}_${((t)=>Array.from({length:t},()=>"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[Math.floor(62*Math.random())]).join(""))(10)}`),SB=E.enum(["top_left","top_center","top_right","center_left","center","center_right","bottom_left","bottom_center","bottom_right"]),rAr=E.enum(["top_silkscreen","bottom_silkscreen","top_copper","bottom_copper","top_soldermask","bottom_soldermask","top_fabrication_note","bottom_fabrication_note","top_user_note","bottom_user_note","top_courtyard","bottom_courtyard","inner1_copper","inner2_copper","inner3_copper","inner4_copper","inner5_copper","inner6_copper","inner7_copper","inner8_copper","edge_cuts","drill"]),Lle=E.object({project_relative_path:E.string(),url:E.string(),mimetype:E.string()}),Dbe=cr.extend({rotation:od.optional()}),qqe=E.object({size:cr.optional(),thickness:Dn.optional()}),$Kt=E.object({font:qqe.optional()}),Zae=E.object({value:E.string(),at:Dbe.optional(),layer:E.string().optional(),uuid:E.string().optional(),hide:E.boolean().optional(),effects:$Kt.optional()}),qKt=E.object({Reference:Zae.optional(),Value:Zae.optional(),Datasheet:Zae.optional(),Description:Zae.optional()}),JKt=E.object({through_hole:E.boolean().optional(),smd:E.boolean().optional(),exclude_from_pos_files:E.boolean().optional(),exclude_from_bom:E.boolean().optional()}),ZKt=E.object({name:E.string(),type:E.string(),shape:E.string().optional(),at:Dbe.optional(),size:cr.optional(),drill:Dn.optional(),layers:E.array(E.string()).optional(),removeUnusedLayers:E.boolean().optional(),uuid:E.string().optional()}),e$t=E.object({path:E.string(),offset:n6.optional(),scale:n6.optional(),rotate:n6.optional()}),t$t=E.object({footprintName:E.string().optional(),version:E.union([E.number(),E.string()]).optional(),generator:E.string().optional(),generatorVersion:E.union([E.number(),E.string()]).optional(),layer:E.string().optional(),properties:qKt.optional(),attributes:JKt.optional(),pads:E.array(ZKt).optional(),embeddedFonts:E.boolean().optional(),model:e$t.optional()}),n$t=E.object({hide:E.boolean().optional()}),o$t=E.object({offset:Dn.optional(),hide:E.boolean().optional()}),r$t=E.object({font:qqe.optional(),justify:E.union([E.string(),E.array(E.string())]).optional(),hide:E.boolean().optional()}),bQ=E.object({value:E.string(),id:E.union([E.number(),E.string()]).optional(),at:Dbe.optional(),effects:r$t.optional()}),i$t=E.object({Reference:bQ.optional(),Value:bQ.optional(),Footprint:bQ.optional(),Datasheet:bQ.optional(),Description:bQ.optional(),ki_keywords:bQ.optional(),ki_fp_filters:bQ.optional()}),s$t=E.object({symbolName:E.string().optional(),extends:E.string().optional(),pinNumbers:n$t.optional(),pinNames:o$t.optional(),excludeFromSim:E.boolean().optional(),inBom:E.boolean().optional(),onBoard:E.boolean().optional(),properties:i$t.optional(),embeddedFonts:E.boolean().optional()}),Nc=E.object({error_type:E.string(),message:E.string(),is_fatal:E.boolean().optional()}),zq=E.enum(["jlcpcb","macrofab","pcbway","digikey","mouser","lcsc"]),xh=E.object({type:E.literal("source_component"),ftype:E.string().optional(),source_component_id:E.string(),name:E.string(),manufacturer_part_number:E.string().optional(),supplier_part_numbers:E.record(zq,E.array(E.string())).optional(),display_value:E.string().optional(),display_name:E.string().optional(),are_pins_interchangeable:E.boolean().optional(),internally_connected_source_port_ids:E.array(E.array(E.string())).optional(),source_group_id:E.string().optional(),subcircuit_id:E.string().optional()}),Jqe=xh.extend({ftype:E.literal("simple_capacitor"),capacitance:jqe,max_voltage_rating:i6.optional(),display_capacitance:E.string().optional(),max_decoupling_trace_length:Dn.optional()}),Zqe=xh.extend({ftype:E.literal("simple_resistor"),resistance:wbe,display_resistance:E.string().optional()}),Nbe=xh.extend({ftype:E.literal("simple_diode")}),a$t=xh.extend({ftype:E.literal("simple_fiducial")}),eJe=Nbe.extend({ftype:E.literal("simple_led"),color:E.string().optional(),wavelength:E.string().optional()}),c$t=xh.extend({ftype:E.literal("simple_ground")}),tJe=xh.extend({ftype:E.literal("simple_chip")}),l$t=xh.extend({ftype:E.literal("printedpart"),material:E.enum(["pla","petg","nylon"]).optional(),color:E.string().trim().min(1).optional()}),h$t=xh.extend({ftype:E.literal("subassembly")}),d$t=xh.extend({ftype:E.literal("motor")}),nJe=xh.extend({ftype:E.literal("simple_power_source"),voltage:i6}),u$t=xh.extend({ftype:E.literal("simple_current_source"),current:FQ,frequency:iY.optional(),peak_to_peak_current:FQ.optional(),wave_shape:E.enum(["sine","square","triangle","sawtooth","dc"]).optional().default("dc"),phase:E.number().optional(),duty_cycle:E.number().min(0).max(1).optional()}),p$t=xh.extend({ftype:E.literal("simple_fuse"),current_rating_amps:E.number().describe("Nominal current in amps the fuse is rated for"),voltage_rating_volts:E.number().describe("Voltage rating in volts, e.g. ±5V would be 5")}),m$t=xh.extend({ftype:E.literal("simple_ammeter")}),jHt=E.union([E.number(),E.string().trim().regex(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?\s*(?:[fpnumkKMGTµμ]?V?|V)?$/,"Expected a scalar voltage, optionally with SI units")]).pipe(i6).pipe(E.number().finite()),_$t=E.object({is_input:E.boolean().optional(),is_output:E.boolean().optional(),is_bidirectional:E.boolean().optional(),is_passive:E.boolean().optional(),can_use_tri_state:E.boolean().optional(),is_using_tri_state:E.boolean().optional(),can_use_open_collector:E.boolean().optional(),is_using_open_collector:E.boolean().optional(),can_use_open_emitter:E.boolean().optional(),is_using_open_emitter:E.boolean().optional(),is_gpio:E.boolean().optional(),highlight_color:E.string().optional(),must_be_connected:E.boolean().optional(),provides_power:E.boolean().optional(),requires_power:E.boolean().optional(),provides_ground:E.boolean().optional(),requires_ground:E.boolean().optional(),provides_voltage:jHt.optional(),requires_voltage:jHt.optional(),required_voltage_tolerance:E.number().finite().min(0).max(1).optional(),do_not_connect:E.boolean().optional(),include_in_board_pinout:E.boolean().optional(),can_use_internal_pullup:E.boolean().optional(),is_using_internal_pullup:E.boolean().optional(),needs_external_pullup:E.boolean().optional(),can_use_internal_pulldown:E.boolean().optional(),is_using_internal_pulldown:E.boolean().optional(),needs_external_pulldown:E.boolean().optional(),can_use_open_drain:E.boolean().optional(),is_using_open_drain:E.boolean().optional(),can_use_push_pull:E.boolean().optional(),is_using_push_pull:E.boolean().optional(),should_have_decoupling_capacitor:E.boolean().optional(),recommended_decoupling_capacitor_capacitance:E.union([E.string(),E.number()]).optional(),is_configured_for_i2c_sda:E.boolean().optional(),is_configured_for_i2c_scl:E.boolean().optional(),is_configured_for_spi_mosi:E.boolean().optional(),is_configured_for_spi_miso:E.boolean().optional(),is_configured_for_spi_sck:E.boolean().optional(),is_configured_for_spi_cs:E.boolean().optional(),is_configured_for_uart_tx:E.boolean().optional(),is_configured_for_uart_rx:E.boolean().optional(),supports_i2c_sda:E.boolean().optional(),supports_i2c_scl:E.boolean().optional(),supports_spi_mosi:E.boolean().optional(),supports_spi_miso:E.boolean().optional(),supports_spi_sck:E.boolean().optional(),supports_spi_cs:E.boolean().optional(),supports_uart_tx:E.boolean().optional(),supports_uart_rx:E.boolean().optional()}),oJe=xh.extend({ftype:E.literal("simple_battery"),capacity:KKt}),rJe=xh.extend({ftype:E.literal("simple_inductor"),inductance:XKt,display_inductance:E.string().optional(),max_current_rating:E.number().optional()}),iJe=xh.extend({ftype:E.literal("simple_push_button")}),sJe=xh.extend({ftype:E.literal("simple_potentiometer"),max_resistance:wbe,display_max_resistance:E.string().optional()}),g$t=xh.extend({ftype:E.literal("simple_crystal"),frequency:E.number().describe("Frequency in Hz"),load_capacitance:E.number().optional().describe("Load capacitance in pF"),pin_variant:E.enum(["two_pin","four_pin"]).optional()}),aJe=xh.extend({ftype:E.literal("simple_pin_header"),pin_count:E.number(),gender:E.enum(["male","female"]).optional().default("male")}),A$t=["usb_c","m2","jst_sh","jst_gh","jst_zh","jst_ph","jst_xh","jst_vh"],f$t=xh.extend({ftype:E.literal("simple_connector"),standard:E.enum(A$t).optional(),pin_count:E.number().int().positive().optional()}),cJe=xh.extend({ftype:E.literal("simple_pinout")}),lJe=xh.extend({ftype:E.literal("simple_resonator"),load_capacitance:jqe,equivalent_series_resistance:wbe.optional(),frequency:iY}),hJe=xh.extend({ftype:E.literal("simple_transistor"),transistor_type:E.enum(["npn","pnp"])}),dJe=xh.extend({ftype:E.literal("simple_test_point"),footprint_variant:E.enum(["pad","through_hole"]).optional(),pad_shape:E.enum(["rect","circle"]).optional(),pad_diameter:E.union([E.number(),E.string()]).optional(),hole_diameter:E.union([E.number(),E.string()]).optional(),width:E.union([E.number(),E.string()]).optional(),height:E.union([E.number(),E.string()]).optional()}),uJe=xh.extend({ftype:E.literal("simple_mosfet"),channel_type:E.enum(["n","p"]),mosfet_mode:E.enum(["enhancement","depletion"])}),pJe=xh.extend({ftype:E.literal("simple_op_amp")}),mJe=xh.extend({ftype:E.literal("simple_switch")}),_Je=E.object({type:E.literal("source_project_metadata"),name:E.string().optional(),software_used_string:E.string().optional(),project_url:E.string().optional(),source_filesystem_md5_hash:E.string().optional(),created_at:jKt.optional()}),y$t=Nc.extend({type:E.literal("source_missing_property_error"),source_missing_property_error_id:Pn("source_missing_property_error"),source_component_id:E.string(),property_name:E.string(),subcircuit_id:E.string().optional(),error_type:E.literal("source_missing_property_error").default("source_missing_property_error")}).describe("The source code is missing a property"),x$t=Nc.extend({type:E.literal("source_failed_to_create_component_error"),source_failed_to_create_component_error_id:Pn("source_failed_to_create_component_error"),error_type:E.literal("source_failed_to_create_component_error").default("source_failed_to_create_component_error"),component_name:E.string().optional(),subcircuit_id:E.string().optional(),parent_source_component_id:E.string().optional(),pcb_center:E.object({x:E.number().optional(),y:E.number().optional()}).optional(),schematic_center:E.object({x:E.number().optional(),y:E.number().optional()}).optional()}).describe("Error emitted when a component fails to be constructed"),gJe=Nc.extend({type:E.literal("source_invalid_component_property_error"),source_invalid_component_property_error_id:Pn("source_invalid_component_property_error"),source_component_id:E.string(),property_name:E.string(),property_value:E.unknown().optional(),expected_format:E.string().optional(),subcircuit_id:E.string().optional(),error_type:E.literal("source_invalid_component_property_error").default("source_invalid_component_property_error")}).describe("The source component property is invalid"),AJe=Nc.extend({type:E.literal("source_trace_not_connected_error"),source_trace_not_connected_error_id:Pn("source_trace_not_connected_error"),error_type:E.literal("source_trace_not_connected_error").default("source_trace_not_connected_error"),subcircuit_id:E.string().optional(),source_group_id:E.string().optional(),source_trace_id:E.string().optional(),connected_source_port_ids:E.array(E.string()).optional(),selectors_not_found:E.array(E.string()).optional()}).describe("Occurs when a source trace selector does not match any ports"),C$t=E.object({type:E.literal("source_property_ignored_warning"),source_property_ignored_warning_id:Pn("source_property_ignored_warning"),source_component_id:E.string(),property_name:E.string(),subcircuit_id:E.string().optional(),error_type:E.literal("source_property_ignored_warning").default("source_property_ignored_warning"),message:E.string()}).describe("The source property was ignored"),fJe=E.object({type:E.literal("source_pin_missing_trace_warning"),source_pin_missing_trace_warning_id:Pn("source_pin_missing_trace_warning"),warning_type:E.literal("source_pin_missing_trace_warning").default("source_pin_missing_trace_warning"),message:E.string(),source_component_id:E.string(),source_port_id:E.string(),subcircuit_id:E.string().optional()}).describe("Warning emitted when a source component pin is missing a trace connection"),yJe=E.object({type:E.literal("source_missing_manufacturer_part_number_warning"),source_missing_manufacturer_part_number_warning_id:Pn("source_missing_manufacturer_part_number_warning"),warning_type:E.literal("source_missing_manufacturer_part_number_warning").default("source_missing_manufacturer_part_number_warning"),message:E.string(),source_component_id:E.string(),standard:E.string().optional(),subcircuit_id:E.string().optional()}).describe("Warning emitted when a source component is missing its manufacturer part number"),xJe=E.object({type:E.literal("source_refdes_convention_warning"),source_refdes_convention_warning_id:Pn("source_refdes_convention_warning"),warning_type:E.literal("source_refdes_convention_warning").default("source_refdes_convention_warning"),message:E.string(),source_component_id:E.string(),refdes:E.string(),source_component_ftype:E.string(),expected_prefixes:E.array(E.string()),actual_prefix:E.string().optional(),subcircuit_id:E.string().optional()}).describe("Warning emitted when a source component reference designator does not match the component type convention"),CJe=E.object({type:E.literal("source_component_availability_warning"),source_component_availability_warning_id:Pn("source_component_availability_warning"),warning_type:E.literal("source_component_availability_warning").default("source_component_availability_warning"),message:E.string(),source_component_id:E.string(),subcircuit_id:E.string().optional(),supplier_name:zq,supplier_part_numbers:E.array(E.string()).nonempty()}).describe("Warning emitted when no supplier alternative can be confirmed in stock. Availability may be unknown or change over time."),b$t=xh.extend({ftype:E.literal("simple_voltage_probe")}),I$t=xh.extend({ftype:E.literal("interconnect")}),bJe=Nc.extend({type:E.literal("source_i2c_misconfigured_error"),source_i2c_misconfigured_error_id:Pn("source_i2c_misconfigured_error"),error_type:E.literal("source_i2c_misconfigured_error").default("source_i2c_misconfigured_error"),source_port_ids:E.array(E.string())}).describe("Error emitted when incompatible I2C pins (e.g. SDA and SCL) are connected to the same net"),IJe=Nc.extend({type:E.literal("source_component_misconfigured_error"),source_component_misconfigured_error_id:Pn("source_component_misconfigured_error"),error_type:E.literal("source_component_misconfigured_error").default("source_component_misconfigured_error"),source_component_ids:E.array(E.string()),source_port_ids:E.array(E.string()).optional()}).describe("Error emitted when one or more source components have an invalid or conflicting configuration"),v$t=xh.extend({ftype:E.literal("simple_voltage_source"),voltage:i6,frequency:iY.optional(),peak_to_peak_voltage:i6.optional(),wave_shape:E.enum(["sinewave","square","triangle","sawtooth"]).optional(),phase:od.optional(),duty_cycle:E.number().optional().describe("Duty cycle as a fraction (0 to 1)"),pulse_delay:Wg.optional(),rise_time:Wg.optional(),fall_time:Wg.optional(),pulse_width:Wg.optional(),period:Wg.optional()}),S$t=E.union([Zqe,Jqe,Nbe,a$t,eJe,c$t,tJe,l$t,h$t,d$t,nJe,u$t,m$t,oJe,rJe,iJe,sJe,g$t,aJe,f$t,cJe,lJe,mJe,hJe,dJe,uJe,pJe,p$t,b$t,I$t,v$t,_Je,y$t,gJe,x$t,AJe,C$t,fJe,yJe,xJe,CJe,bJe,IJe]),P$t=E.object({type:E.literal("source_port"),pin_number:E.number().optional(),port_hints:E.array(E.string()).optional(),name:E.string(),source_port_id:E.string(),source_component_id:E.string().optional(),source_group_id:E.string().optional(),most_frequently_referenced_by_name:E.string().optional(),subcircuit_id:E.string().optional(),subcircuit_connectivity_map_key:E.string().optional()}).merge(_$t),E$t=E.object({type:E.literal("source_component_internal_connection"),source_component_internal_connection_id:E.string(),source_component_id:E.string(),source_port_ids:E.array(E.string()),subcircuit_id:E.string().optional()}),M$t=E.object({type:E.literal("source_trace"),source_trace_id:E.string(),connected_source_port_ids:E.array(E.string()),connected_source_net_ids:E.array(E.string()),subcircuit_id:E.string().optional(),subcircuit_connectivity_map_key:E.string().optional(),max_length:E.number().optional(),max_via_count:E.number().int().nonnegative().optional(),name:E.string().optional(),min_trace_thickness:E.number().optional(),display_name:E.string().optional()}),w$t=E.object({type:E.literal("source_group"),source_group_id:E.string(),subcircuit_id:E.string().optional(),parent_subcircuit_id:E.string().optional(),parent_source_group_id:E.string().optional(),is_subcircuit:E.boolean().optional(),show_as_schematic_box:E.boolean().optional(),name:E.string().optional(),was_automatically_named:E.boolean().optional()}),B$t=E.object({type:E.literal("source_net"),source_net_id:E.string(),name:E.string(),member_source_group_ids:E.array(E.string()),is_power:E.boolean().optional(),is_ground:E.boolean().optional(),is_digital_signal:E.boolean().optional(),is_analog_signal:E.boolean().optional(),is_positive_voltage_source:E.boolean().optional(),trace_width:E.number().optional(),subcircuit_id:E.string().optional(),subcircuit_connectivity_map_key:E.string().optional()}),T$t=E.object({type:E.literal("source_board"),source_board_id:E.string(),source_group_id:E.string(),title:E.string().optional()}).describe("Defines a board in the source domain"),D$t=Nc.extend({type:E.literal("source_ambiguous_port_reference"),source_ambiguous_port_reference_id:Pn("source_ambiguous_port_reference"),error_type:E.literal("source_ambiguous_port_reference").default("source_ambiguous_port_reference"),source_port_id:E.string().optional(),source_component_id:E.string().optional()}).describe("Error emitted when a port hint matches multiple non-overlapping pads, making the port reference ambiguous"),N$t=E.object({type:E.literal("source_pcb_ground_plane"),source_pcb_ground_plane_id:E.string(),source_group_id:E.string(),source_net_id:E.string(),subcircuit_id:E.string().optional()}).describe("Defines a ground plane in the source domain"),US=["top","bottom","inner1","inner2","inner3","inner4","inner5","inner6","inner7","inner8"],mKe=E.enum(US),Wi=mKe.or(E.object({name:mKe})).transform((e)=>typeof e=="string"?e:e.name),k_=E.enum(["top","bottom"]),R$t=E.object({type:E.literal("source_manually_placed_via"),source_manually_placed_via_id:E.string(),source_group_id:E.string(),source_net_id:E.string().min(1).optional(),subcircuit_id:E.string().optional(),source_trace_id:E.string().optional()}).describe("Defines a via that is manually placed in the source domain"),Q$t=E.object({type:E.literal("source_unnamed_trace_warning"),source_unnamed_trace_warning_id:Pn("source_unnamed_trace_warning"),warning_type:E.literal("source_unnamed_trace_warning").default("source_unnamed_trace_warning"),message:E.string(),source_trace_id:E.string(),subcircuit_id:E.string().optional()}).describe("Warning emitted when a source trace is missing a name"),k$t=E.object({type:E.literal("source_no_power_pin_defined_warning"),source_no_power_pin_defined_warning_id:Pn("source_no_power_pin_defined_warning"),warning_type:E.literal("source_no_power_pin_defined_warning").default("source_no_power_pin_defined_warning"),message:E.string(),source_component_id:E.string(),source_port_ids:E.array(E.string()),subcircuit_id:E.string().optional()}).describe("Warning emitted when a chip has no source ports with requires_power=true"),L$t=E.object({type:E.literal("source_no_ground_pin_defined_warning"),source_no_ground_pin_defined_warning_id:Pn("source_no_ground_pin_defined_warning"),warning_type:E.literal("source_no_ground_pin_defined_warning").default("source_no_ground_pin_defined_warning"),message:E.string(),source_component_id:E.string(),source_port_ids:E.array(E.string()),subcircuit_id:E.string().optional()}).describe("Warning emitted when a chip has no source ports marked as ground pins"),H$t=E.object({type:E.literal("source_component_pins_underspecified_warning"),source_component_pins_underspecified_warning_id:Pn("source_component_pins_underspecified_warning"),warning_type:E.literal("source_component_pins_underspecified_warning").default("source_component_pins_underspecified_warning"),message:E.string(),source_component_id:E.string(),source_port_ids:E.array(E.string()),subcircuit_id:E.string().optional()}).describe("Warning emitted when all ports on a source component are underspecified"),F$t=Nc.extend({type:E.literal("source_pin_must_be_connected_error"),source_pin_must_be_connected_error_id:Pn("source_pin_must_be_connected_error"),error_type:E.literal("source_pin_must_be_connected_error").default("source_pin_must_be_connected_error"),source_component_id:E.string(),source_port_id:E.string(),subcircuit_id:E.string().optional()}).describe("Error emitted when a pin with mustBeConnected attribute is not connected to any trace"),z$t=Nc.extend({type:E.literal("unknown_error_finding_part"),unknown_error_finding_part_id:Pn("unknown_error_finding_part"),error_type:E.literal("unknown_error_finding_part").default("unknown_error_finding_part"),source_component_id:E.string().optional(),subcircuit_id:E.string().optional()}).describe("Error emitted when an unexpected error occurs while finding a part"),O$t=E.object({type:E.literal("source_part_not_found_warning"),source_part_not_found_warning_id:Pn("source_part_not_found_warning"),warning_type:E.literal("source_part_not_found_warning").default("source_part_not_found_warning"),message:E.string(),source_component_id:E.string().optional(),subcircuit_id:E.string().optional(),supplier_name:zq.optional(),manufacturer_part_number:E.string().optional(),supplier_part_number:E.string().optional(),part_name:E.string().optional()}).describe("Warning emitted when a requested part can not be found"),V$t=E.object({type:E.literal("source_confusing_net_name_warning"),source_confusing_net_name_warning_id:Pn("source_confusing_net_name_warning"),warning_type:E.literal("source_confusing_net_name_warning").default("source_confusing_net_name_warning"),message:E.string(),source_net_ids:E.array(E.string()).min(2),net_name:E.string(),subcircuit_id:E.string().optional()}).describe("Warning emitted when electrically disconnected source nets share a name"),ZWe=E.union([E.number().nonnegative().finite(),E.object({reference:E.literal("longest_manhattan"),source_trace_ids:E.array(E.string()).min(1).optional(),offset:E.number().finite().optional()})]),KHt=E.union([E.number().positive().finite(),E.object({width_multiplier:E.number().positive().finite()})]),Y$t=E.object({type:E.literal("source_bus"),source_bus_id:E.string(),name:E.string().optional(),source_trace_ids:E.array(E.string()).min(1),max_length_skew:E.number().nonnegative().finite().optional(),target_impedance:E.number().positive().finite().optional(),target_differential_impedance:E.number().positive().finite().optional(),differential_pair:E.object({positive_source_trace_id:E.string(),negative_source_trace_id:E.string(),trace_gap:E.number().positive().finite().optional(),max_uncoupled_length:E.number().nonnegative().finite().optional()}).optional(),length_match_source_trace_ids:E.array(E.string()).min(1).optional(),min_length:ZWe.optional(),max_length:ZWe.optional(),target_length:ZWe.optional(),length_tolerance:E.number().nonnegative().finite().optional(),pcb_trace_spacing:KHt.optional(),pcb_spacing_to_other_signals:KHt.optional(),target_impedance_min:E.number().positive().finite().optional(),target_impedance_max:E.number().positive().finite().optional(),target_differential_impedance_min:E.number().positive().finite().optional(),target_differential_impedance_max:E.number().positive().finite().optional(),subcircuit_id:E.string().optional()}),G$t=Nc.pick({message:!0,error_type:!0}).extend({type:E.literal("source_runtime_error"),source_runtime_error_id:Pn("source_runtime_error"),error_type:E.literal("source_runtime_error").default("source_runtime_error"),phase_name:E.string().optional()}).describe("An unexpected runtime failure while generating or validating a circuit"),U$t=E.object({type:E.literal("schematic_box"),schematic_sheet_id:E.string().optional(),schematic_component_id:E.string().optional(),schematic_symbol_id:E.string().optional(),width:Dn,height:Dn,is_dashed:E.boolean().default(!1),x:Dn,y:Dn,subcircuit_id:E.string().optional()}).describe("Draws a box on the schematic"),W$t=E.object({type:E.literal("schematic_path"),schematic_path_id:Pn("schematic_path"),schematic_sheet_id:E.string().optional(),schematic_component_id:E.string().optional(),schematic_symbol_id:E.string().optional(),fill_color:E.string().optional(),is_filled:E.boolean().optional(),is_dashed:E.boolean().default(!1),stroke_width:Dn.nullable().optional(),stroke_color:E.string().optional(),dash_length:Dn.optional(),dash_gap:Dn.optional(),points:E.array(cr),subcircuit_id:E.string().optional()}),X$t=E.record(E.object({left_margin:Ko.optional(),right_margin:Ko.optional(),top_margin:Ko.optional(),bottom_margin:Ko.optional()})),j$t=E.object({left_size:E.number(),right_size:E.number(),top_size:E.number().optional(),bottom_size:E.number().optional()}),K$t=E.object({left_side:E.object({pins:E.array(E.number()),direction:E.enum(["top-to-bottom","bottom-to-top"]).optional()}).optional(),right_side:E.object({pins:E.array(E.number()),direction:E.enum(["top-to-bottom","bottom-to-top"]).optional()}).optional(),top_side:E.object({pins:E.array(E.number()),direction:E.enum(["left-to-right","right-to-left"]).optional()}).optional(),bottom_side:E.object({pins:E.array(E.number()),direction:E.enum(["left-to-right","right-to-left"]).optional()}).optional()}),$$t=E.union([j$t,K$t]),q$t=E.object({type:E.literal("schematic_component"),size:Bbe,center:cr,source_component_id:E.string().optional(),schematic_component_id:E.string(),schematic_sheet_id:E.string().optional(),schematic_symbol_id:E.string().optional(),pin_spacing:Ko.optional(),pin_styles:X$t.optional(),box_width:Ko.optional(),symbol_name:E.string().optional(),port_arrangement:$$t.optional(),port_labels:E.record(E.string()).optional(),symbol_display_value:E.string().optional(),subcircuit_id:E.string().optional(),schematic_group_id:E.string().optional(),is_schematic_group:E.boolean().optional(),source_group_id:E.string().optional(),is_box_with_pins:E.boolean().optional().default(!0)}),iAr=E.object({kicad_symbol:s$t.optional()}).catchall(E.unknown()),J$t=E.object({type:E.literal("schematic_symbol"),schematic_symbol_id:E.string(),name:E.string().optional(),metadata:iAr.optional()}).describe("Defines a named schematic symbol that can be referenced by components."),Z$t=E.object({type:E.literal("schematic_line"),schematic_line_id:Pn("schematic_line"),schematic_sheet_id:E.string().optional(),schematic_component_id:E.string().optional(),schematic_symbol_id:E.string().optional(),x1:Dn,y1:Dn,x2:Dn,y2:Dn,stroke_width:Dn.nullable().optional(),color:E.string().default("#000000"),is_dashed:E.boolean().default(!1),dash_length:Dn.optional(),dash_gap:Dn.optional(),subcircuit_id:E.string().optional()}).describe("Draws a styled line on the schematic"),eqt=E.object({type:E.literal("schematic_rect"),schematic_rect_id:Pn("schematic_rect"),schematic_sheet_id:E.string().optional(),schematic_component_id:E.string().optional(),schematic_symbol_id:E.string().optional(),center:cr,width:Dn,height:Dn,rotation:od.default(0),stroke_width:Dn.nullable().optional(),color:E.string().default("#000000"),is_filled:E.boolean().default(!1),fill_color:E.string().optional(),is_dashed:E.boolean().default(!1),subcircuit_id:E.string().optional()}).describe("Draws a styled rectangle on the schematic"),tqt=E.object({type:E.literal("schematic_circle"),schematic_circle_id:Pn("schematic_circle"),schematic_sheet_id:E.string().optional(),schematic_component_id:E.string().optional(),schematic_symbol_id:E.string().optional(),center:cr,radius:Dn,stroke_width:Dn.nullable().optional(),color:E.string().default("#000000"),is_filled:E.boolean().default(!1),fill_color:E.string().optional(),is_dashed:E.boolean().default(!1),subcircuit_id:E.string().optional()}).describe("Draws a styled circle on the schematic"),nqt=E.object({type:E.literal("schematic_arc"),schematic_arc_id:Pn("schematic_arc"),schematic_sheet_id:E.string().optional(),schematic_component_id:E.string().optional(),schematic_symbol_id:E.string().optional(),center:cr,radius:Dn,start_angle_degrees:od,end_angle_degrees:od,direction:E.enum(["clockwise","counterclockwise"]).default("counterclockwise"),stroke_width:Dn.nullable().optional(),color:E.string().default("#000000"),is_dashed:E.boolean().default(!1),subcircuit_id:E.string().optional()}).describe("Draws a styled arc on the schematic"),oqt=E.object({type:E.literal("schematic_trace"),schematic_trace_id:E.string(),schematic_sheet_id:E.string().optional(),source_trace_id:E.string().optional(),junctions:E.array(E.object({x:E.number(),y:E.number()})),edges:E.array(E.object({from:E.object({x:E.number(),y:E.number()}),to:E.object({x:E.number(),y:E.number()}),is_crossing:E.boolean().optional(),from_schematic_port_id:E.string().optional(),to_schematic_port_id:E.string().optional()})),subcircuit_id:E.string().optional(),subcircuit_connectivity_map_key:E.string().optional()}),sAr=E.enum(["center","left","right","top","bottom"]),vJe=E.object({text:E.string(),is_overlined:E.boolean().optional()}),rqt=E.object({type:E.literal("schematic_text"),schematic_sheet_id:E.string().optional(),schematic_component_id:E.string().optional(),schematic_symbol_id:E.string().optional(),schematic_text_id:E.string(),source_trace_id:E.string().optional(),text:E.string(),text_parts:E.array(vJe).min(1).optional(),display_superscript:E.string().optional(),font_size:E.number().default(0.18),position:E.object({x:Dn,y:Dn}),rotation:E.number().default(0),anchor:E.union([sAr.describe("legacy"),SB]).default("center"),color:E.string().default("#000000"),subcircuit_id:E.string().optional()}),iqt=E.object({type:E.literal("schematic_port"),schematic_port_id:E.string(),source_port_id:E.string(),schematic_sheet_id:E.string().optional(),schematic_component_id:E.string().optional(),center:cr,facing_direction:E.enum(["up","down","left","right"]).optional(),distance_from_component_edge:E.number().optional(),side_of_component:E.enum(["top","bottom","left","right"]).optional(),true_ccw_index:E.number().optional(),pin_number:E.number().optional(),display_pin_label:E.string().optional(),display_pin_label_text_parts:E.array(vJe).min(1).optional(),display_pin_label_font_size:E.number().positive().finite().optional(),subcircuit_id:E.string().optional(),is_connected:E.boolean().optional(),is_internal_circuit_port:E.boolean().optional(),is_overlapping_internal_circuit_port:E.boolean().optional(),has_input_arrow:E.boolean().optional(),has_output_arrow:E.boolean().optional(),is_drawn_with_inversion_circle:E.boolean().optional()}).describe("Defines a port on a schematic component"),sqt=E.object({type:E.literal("schematic_net_label"),schematic_net_label_id:Pn("schematic_net_label"),schematic_sheet_id:E.string().optional(),schematic_trace_id:E.string().optional(),source_trace_id:E.string().optional(),source_net_id:E.string(),center:cr,anchor_position:cr.optional(),anchor_side:E.enum(["top","bottom","left","right"]),text:E.string(),display_superscript:E.string().optional(),symbol_name:E.string().optional(),is_movable:E.boolean().optional(),subcircuit_id:E.string().optional()}),aqt=Nc.extend({type:E.literal("schematic_error"),schematic_error_id:E.string(),error_type:E.literal("schematic_port_not_found").default("schematic_port_not_found"),subcircuit_id:E.string().optional()}).describe("Defines a schematic error on the schematic"),cqt=Nc.extend({type:E.literal("schematic_layout_error"),schematic_layout_error_id:Pn("schematic_layout_error"),error_type:E.literal("schematic_layout_error").default("schematic_layout_error"),source_group_id:E.string(),schematic_group_id:E.string(),subcircuit_id:E.string().optional()}).describe("Error emitted when schematic layout fails for a group"),Rbe=E.object({type:E.literal("schematic_debug_object"),label:E.string().optional(),subcircuit_id:E.string().optional()}),lqt=Rbe.extend({shape:E.literal("rect"),center:cr,size:Bbe}),hqt=Rbe.extend({shape:E.literal("line"),start:cr,end:cr}),dqt=Rbe.extend({shape:E.literal("point"),center:cr}),uqt=E.discriminatedUnion("shape",[lqt,hqt,dqt]),pqt=E.object({type:E.literal("schematic_voltage_probe"),schematic_voltage_probe_id:E.string(),schematic_sheet_id:E.string().optional(),source_component_id:E.string().optional(),name:E.string().optional(),position:cr,schematic_trace_id:E.string(),voltage:i6.optional(),subcircuit_id:E.string().optional(),color:E.string().optional(),label_alignment:SB.optional()}).describe("Defines a voltage probe measurement point on a schematic trace"),mqt=E.object({type:E.literal("schematic_manual_edit_conflict_warning"),schematic_manual_edit_conflict_warning_id:Pn("schematic_manual_edit_conflict_warning"),warning_type:E.literal("schematic_manual_edit_conflict_warning").default("schematic_manual_edit_conflict_warning"),message:E.string(),schematic_component_id:E.string(),schematic_group_id:E.string().optional(),subcircuit_id:E.string().optional(),source_component_id:E.string()}).describe("Warning emitted when a component has both manual placement and explicit schX/schY coordinates"),_qt=E.object({type:E.literal("schematic_component_overlap_warning"),schematic_component_overlap_warning_id:Pn("schematic_component_overlap_warning"),warning_type:E.literal("schematic_component_overlap_warning").default("schematic_component_overlap_warning"),message:E.string(),schematic_component_ids:E.tuple([E.string(),E.string()]),schematic_sheet_id:E.string().optional()}).describe("Warning emitted when the rendered bounds of two schematic components overlap"),gqt=E.object({type:E.literal("schematic_component_styling_warning"),schematic_component_styling_warning_id:Pn("schematic_component_styling_warning"),warning_type:E.literal("schematic_component_styling_warning").default("schematic_component_styling_warning"),message:E.string(),schematic_component_id:E.string(),styling_issue_type:E.string(),schematic_port_ids:E.array(E.string()).optional(),source_component_id:E.string().optional(),schematic_sheet_id:E.string().optional(),subcircuit_id:E.string().optional()}).describe("Warning emitted when a schematic component has a visual styling issue"),Aqt=E.object({type:E.literal("schematic_sheet_styling_warning"),schematic_sheet_styling_warning_id:Pn("schematic_sheet_styling_warning"),warning_type:E.literal("schematic_sheet_styling_warning").default("schematic_sheet_styling_warning"),message:E.string(),schematic_sheet_id:E.string(),styling_issue_type:E.literal("non_default_sheet_size"),subcircuit_id:E.string().optional()}).describe("Style warning emitted when a schematic sheet uses a non-default size"),fqt=E.object({type:E.literal("schematic_element_outside_sheet_warning"),schematic_element_outside_sheet_warning_id:Pn("schematic_element_outside_sheet_warning"),warning_type:E.literal("schematic_element_outside_sheet_warning").default("schematic_element_outside_sheet_warning"),message:E.string(),schematic_sheet_id:E.string(),schematic_element_type:E.enum(["schematic_component","schematic_net_label","schematic_trace"]),schematic_element_id:E.string()}).describe("Warning emitted when a schematic component, net label, or trace extends outside its schematic sheet"),$Ht=Dn.pipe(E.number().positive().finite()),yqt=E.object({type:E.literal("schematic_graphic"),schematic_graphic_id:Pn("schematic_graphic"),schematic_sheet_id:E.string().optional(),asset:Lle.optional(),svg_content:E.string().optional(),width:$Ht.optional(),height:$Ht.optional()}).describe("References a graphic asset or inline SVG content with optional centered layout bounds on a schematic sheet").superRefine(({asset:e,svg_content:t},n)=>{e===void 0&&t===void 0&&n.addIssue({code:E.ZodIssueCode.custom,message:"At least one of asset or svg_content is required"})}),xqt=E.object({type:E.literal("schematic_group"),schematic_group_id:Pn("schematic_group"),schematic_sheet_id:E.string().optional(),source_group_id:E.string(),is_subcircuit:E.boolean().optional(),subcircuit_id:E.string().optional(),width:Ko,height:Ko,center:cr,schematic_component_ids:E.array(E.string()),show_as_schematic_box:E.boolean().optional(),name:E.string().optional(),description:E.string().optional()}).describe("Defines a group of components on the schematic"),Cqt=E.object({type:E.literal("schematic_table"),schematic_table_id:Pn("schematic_table"),schematic_sheet_id:E.string().optional(),anchor_position:cr,column_widths:E.array(Dn),row_heights:E.array(Dn),cell_padding:Dn.optional(),border_width:Dn.optional(),subcircuit_id:E.string().optional(),schematic_component_id:E.string().optional(),anchor:SB.optional()}).describe("Defines a table on the schematic"),bqt=E.object({type:E.literal("schematic_table_cell"),schematic_table_cell_id:Pn("schematic_table_cell"),schematic_sheet_id:E.string().optional(),schematic_table_id:E.string(),start_row_index:E.number(),end_row_index:E.number(),start_column_index:E.number(),end_column_index:E.number(),text:E.string().optional(),center:cr,width:Dn,height:Dn,horizontal_align:E.enum(["left","center","right"]).optional(),vertical_align:E.enum(["top","middle","bottom"]).optional(),font_size:Dn.optional(),subcircuit_id:E.string().optional()}).describe("Defines a cell within a schematic_table"),Iqt=E.enum(["a4","ansi_b"]),vqt=E.object({type:E.literal("schematic_sheet"),schematic_sheet_id:Pn("schematic_sheet"),name:E.string().optional(),sheet_index:E.number().optional(),sheet_size:Iqt.optional(),sheet_width:E.number().positive().optional(),sheet_height:E.number().positive().optional(),subcircuit_id:E.string().optional(),outline_color:E.string().optional()}).describe("Defines a schematic sheet or page that components can be placed on"),Sqt=E.object({type:E.literal("schematic_missing_sheet_warning"),schematic_missing_sheet_warning_id:Pn("schematic_missing_sheet_warning"),warning_type:E.literal("schematic_missing_sheet_warning").default("schematic_missing_sheet_warning"),message:E.string()}).describe("Circuit-wide warning emitted when a schematic has no schematic sheet. Display as a banner without attaching it to a component or drawing a target outline or leader line."),Pqt=E.object({x:Dn,y:Dn,bulge:E.number().optional()}),_Ke=E.object({vertices:E.array(Pqt)}),SJe=E.object({outer_ring:_Ke,inner_rings:E.array(_Ke).default([])}),Eqt={from_left:"from_left",from_right:"from_right",from_top:"from_top",from_bottom:"from_bottom",from_above:"from_above",from_below:"from_below",from_x_neg:"from_left",from_x_pos:"from_right",from_y_pos:"from_top",from_y_neg:"from_bottom",from_z_pos:"from_above",from_z_neg:"from_below",from_front:"from_top",from_back:"from_bottom"},aAr={from_left:{x:-1,y:0,z:0},from_right:{x:1,y:0,z:0},from_top:{x:0,y:1,z:0},from_bottom:{x:0,y:-1,z:0},from_above:{x:0,y:0,z:1},from_below:{x:0,y:0,z:-1}},Mqt=E.enum(["from_left","from_right","from_top","from_bottom","from_above","from_below","from_x_neg","from_x_pos","from_y_pos","from_y_neg","from_z_pos","from_z_neg","from_front","from_back"]).transform((e)=>Eqt[e]).describe('The side exposing the receptacle where the cable or mating part is attached, following the 2D PCB diagram convention, not a 3D viewport frame. In project coordinate space, "from_top" is +Y, "from_bottom" -Y, "from_left" -X, "from_right" +X, "from_above" +Z and "from_below" -Z. A receptacle on the +Y edge is "from_top" even though the plug moves in -Y as it seats. Cartesian spellings such as "from_y_pos" are accepted and normalized to the named values, as are the deprecated "from_front" (now "from_top") and "from_back" (now "from_bottom").'),gKe=E.enum(["leftside_top","leftside_bottom","rightside_top","rightside_bottom","topside_left","topside_right","bottomside_left","bottomside_right"]),cAr=[["leftside_top","bottomside_left","rightside_bottom","topside_right"],["leftside_bottom","bottomside_right","rightside_top","topside_left"]],lAr=(e,t)=>{for(let n of cAr){let o=n.indexOf(e),r=n.indexOf(t);if(o!==-1&&r!==-1)return(r-o+n.length)%n.length*90}return null},wqt=E.object({x:Dn,y:Dn,via:E.boolean().optional(),via_to_layer:Wi.optional()}),hAr=E.array(wqt),Bqt=E.object({x:Dn,y:Dn,via:E.boolean().optional(),to_layer:Wi.optional(),trace_width:Dn.optional()}),Tqt=E.object({min_trace_width:Ko.optional(),min_board_edge_clearance:Ko.optional(),min_via_hole_edge_to_via_hole_edge_clearance:Ko.optional(),min_plated_hole_drill_edge_to_drill_edge_clearance:Ko.optional(),min_trace_to_pad_edge_clearance:Ko.optional(),min_trace_to_hole_edge_clearance:Ko.optional().describe("Minimum distance from a trace copper edge to a non-plated hole edge, in mm. No default is applied when omitted."),min_pad_edge_to_pad_edge_clearance:Ko.optional(),min_same_net_trace_edge_to_trace_edge_clearance:Ko.optional(),min_different_net_trace_edge_to_trace_edge_clearance:Ko.optional(),min_via_edge_to_pad_edge_clearance:Ko.optional(),min_via_hole_diameter:Ko.optional(),min_via_pad_diameter:Ko.optional()}),Dqt=E.object({type:E.literal("pcb_component"),pcb_component_id:Pn("pcb_component"),source_component_id:E.string(),center:cr,layer:Wi,rotation:od,display_offset_x:E.string().optional().describe("How to display the x offset for this part, usually corresponding with how the user specified it"),display_offset_y:E.string().optional().describe("How to display the y offset for this part, usually corresponding with how the user specified it"),width:Ko,height:Ko,do_not_place:E.boolean().optional(),is_allowed_to_be_off_board:E.boolean().optional(),subcircuit_id:E.string().optional(),pcb_group_id:E.string().optional(),position_mode:E.enum(["packed","relative_to_group_anchor","relative_to_another_component","none"]).optional(),anchor_position:cr.optional(),anchor_alignment:SB.optional(),positioned_relative_to_pcb_group_id:E.string().optional(),positioned_relative_to_pcb_board_id:E.string().optional(),cable_insertion_center:cr.optional(),insertion_direction:Mqt.optional(),pin1_location:gKe.optional().describe("Location of pin 1 on the unrotated, top-view component footprint"),supplier_pin1_location_map:E.record(zq,gKe).optional().describe("Pin 1 location for each supplier's unrotated, top-view footprint"),metadata:E.object({kicad_footprint:t$t.optional()}).optional(),obstructs_within_bounds:E.boolean().default(!0).describe("Does this component take up all the space within its bounds on a layer. This is generally true except for when separated pin headers are being represented by a single component (in which case, chips can be placed between the pin headers) or for tall modules where chips fit underneath")}).describe("Defines a component on the PCB"),Qbe=E.object({type:E.literal("pcb_debug_object"),pcb_debug_object_id:Pn("pcb_debug_object"),label:E.string().optional(),subcircuit_id:E.string().optional()}),Nqt=Qbe.extend({shape:E.literal("rect"),center:cr,size:Bbe}),Rqt=Qbe.extend({shape:E.literal("line"),start:cr,end:cr}),Qqt=Qbe.extend({shape:E.literal("point"),center:cr}),kqt=E.discriminatedUnion("shape",[Nqt,Rqt,Qqt]),Lqt=E.object({type:E.literal("pcb_hole"),pcb_hole_id:Pn("pcb_hole"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),pcb_component_id:E.string().optional(),hole_shape:E.literal("circle"),hole_diameter:E.number(),x:Dn,y:Dn,is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional()}),dAr=Lqt.describe("Defines a circular hole on the PCB"),Hqt=E.object({type:E.literal("pcb_hole"),pcb_hole_id:Pn("pcb_hole"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),pcb_component_id:E.string().optional(),hole_shape:E.literal("rect"),hole_width:E.number(),hole_height:E.number(),x:Dn,y:Dn,is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional()}),uAr=Hqt.describe("Defines a rectangular (square-capable) hole on the PCB. Use equal width/height for square."),Fqt=E.object({type:E.literal("pcb_hole"),pcb_hole_id:Pn("pcb_hole"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),pcb_component_id:E.string().optional(),hole_shape:E.enum(["circle","square"]),hole_diameter:E.number(),x:Dn,y:Dn,is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional()}),pAr=Fqt.describe("Defines a circular or square hole on the PCB"),zqt=E.object({type:E.literal("pcb_hole"),pcb_hole_id:Pn("pcb_hole"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),pcb_component_id:E.string().optional(),hole_shape:E.literal("oval"),hole_width:E.number(),hole_height:E.number(),x:Dn,y:Dn,is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional()}),mAr=zqt.describe("Defines an oval hole on the PCB"),Oqt=E.object({type:E.literal("pcb_hole"),pcb_hole_id:Pn("pcb_hole"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),pcb_component_id:E.string().optional(),hole_shape:E.literal("pill"),hole_width:E.number(),hole_height:E.number(),x:Dn,y:Dn,is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional()}),_Ar=Oqt.describe("Defines a pill-shaped hole on the PCB"),Vqt=E.object({type:E.literal("pcb_hole"),pcb_hole_id:Pn("pcb_hole"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),pcb_component_id:E.string().optional(),hole_shape:E.literal("rotated_pill"),hole_width:E.number(),hole_height:E.number(),x:Dn,y:Dn,ccw_rotation:od,is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional()}),gAr=Vqt.describe("Defines a rotated pill-shaped hole on the PCB"),Yqt=Fqt.or(zqt).or(Oqt).or(Vqt).or(Lqt).or(Hqt),AAr=E.object({type:E.literal("pcb_plated_hole"),shape:E.literal("circle"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),outer_diameter:E.number(),hole_diameter:E.number(),is_covered_with_solder_mask:E.boolean().optional(),x:Dn,y:Dn,layers:E.array(Wi),port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),pcb_plated_hole_id:Pn("pcb_plated_hole"),soldermask_margin:E.number().optional()}),fAr=E.object({type:E.literal("pcb_plated_hole"),shape:E.enum(["oval","pill"]),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),outer_width:E.number(),outer_height:E.number(),hole_width:E.number(),hole_height:E.number(),is_covered_with_solder_mask:E.boolean().optional(),x:Dn,y:Dn,ccw_rotation:od,layers:E.array(Wi),port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),pcb_plated_hole_id:Pn("pcb_plated_hole"),soldermask_margin:E.number().optional()}),yAr=E.object({type:E.literal("pcb_plated_hole"),shape:E.literal("circular_hole_with_rect_pad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),hole_shape:E.literal("circle"),pad_shape:E.literal("rect"),hole_diameter:E.number(),rect_pad_width:E.number(),rect_pad_height:E.number(),rect_border_radius:E.number().optional(),hole_offset_x:Dn.default(0),hole_offset_y:Dn.default(0),is_covered_with_solder_mask:E.boolean().optional(),x:Dn,y:Dn,layers:E.array(Wi),port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),pcb_plated_hole_id:Pn("pcb_plated_hole"),soldermask_margin:E.number().optional(),rect_ccw_rotation:od.optional()}),xAr=E.object({type:E.literal("pcb_plated_hole"),shape:E.literal("pill_hole_with_rect_pad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),hole_shape:E.literal("pill"),pad_shape:E.literal("rect"),hole_width:E.number(),hole_height:E.number(),rect_pad_width:E.number(),rect_pad_height:E.number(),rect_border_radius:E.number().optional(),hole_offset_x:Dn.default(0),hole_offset_y:Dn.default(0),is_covered_with_solder_mask:E.boolean().optional(),x:Dn,y:Dn,layers:E.array(Wi),port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),pcb_plated_hole_id:Pn("pcb_plated_hole"),soldermask_margin:E.number().optional()}),CAr=E.object({type:E.literal("pcb_plated_hole"),shape:E.literal("rotated_pill_hole_with_rect_pad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),hole_shape:E.literal("rotated_pill"),pad_shape:E.literal("rect"),hole_width:E.number(),hole_height:E.number(),hole_ccw_rotation:od,rect_pad_width:E.number(),rect_pad_height:E.number(),rect_border_radius:E.number().optional(),rect_ccw_rotation:od,hole_offset_x:Dn.default(0),hole_offset_y:Dn.default(0),is_covered_with_solder_mask:E.boolean().optional(),x:Dn,y:Dn,layers:E.array(Wi),port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),pcb_plated_hole_id:Pn("pcb_plated_hole"),soldermask_margin:E.number().optional()}),bAr=E.object({type:E.literal("pcb_plated_hole"),shape:E.literal("hole_with_polygon_pad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),hole_shape:E.enum(["circle","oval","pill","rotated_pill"]),hole_diameter:E.number().optional(),hole_width:E.number().optional(),hole_height:E.number().optional(),pad_outline:E.array(E.object({x:Dn,y:Dn})).min(3),hole_offset_x:Dn.default(0),hole_offset_y:Dn.default(0),is_covered_with_solder_mask:E.boolean().optional(),x:Dn,y:Dn,layers:E.array(Wi),port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),pcb_plated_hole_id:Pn("pcb_plated_hole"),soldermask_margin:E.number().optional(),ccw_rotation:od.optional()}),Gqt=E.union([AAr,fAr,yAr,xAr,CAr,bAr]),Uqt=E.object({type:E.literal("pcb_port"),pcb_port_id:Pn("pcb_port"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),source_port_id:E.string(),pcb_component_id:E.string().optional(),x:Dn,y:Dn,layers:E.array(Wi),is_board_pinout:E.boolean().optional()}).describe("Defines a port on the PCB"),IAr=E.object({type:E.literal("pcb_smtpad"),shape:E.literal("circle"),pcb_smtpad_id:Pn("pcb_smtpad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:Dn,y:Dn,radius:E.number(),layer:Wi,port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional(),solderpaste_margin:E.number().optional()}),vAr=E.object({type:E.literal("pcb_smtpad"),shape:E.literal("rect"),pcb_smtpad_id:Pn("pcb_smtpad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:Dn,y:Dn,width:E.number(),height:E.number(),rect_border_radius:E.number().optional(),corner_radius:E.number().optional(),layer:Wi,port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional(),soldermask_margin_left:E.number().optional(),soldermask_margin_top:E.number().optional(),soldermask_margin_right:E.number().optional(),soldermask_margin_bottom:E.number().optional(),solderpaste_margin:E.number().optional()}),SAr=E.object({type:E.literal("pcb_smtpad"),shape:E.literal("rotated_rect"),pcb_smtpad_id:Pn("pcb_smtpad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:Dn,y:Dn,width:E.number(),height:E.number(),rect_border_radius:E.number().optional(),corner_radius:E.number().optional(),ccw_rotation:od,layer:Wi,port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional(),soldermask_margin_left:E.number().optional(),soldermask_margin_top:E.number().optional(),soldermask_margin_right:E.number().optional(),soldermask_margin_bottom:E.number().optional(),solderpaste_margin:E.number().optional()}),Wqt=E.object({type:E.literal("pcb_smtpad"),shape:E.literal("pill"),pcb_smtpad_id:Pn("pcb_smtpad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:Dn,y:Dn,width:E.number(),height:E.number(),radius:E.number(),layer:Wi,port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional(),solderpaste_margin:E.number().optional()}),PAr=E.object({type:E.literal("pcb_smtpad"),shape:E.literal("rotated_pill"),pcb_smtpad_id:Pn("pcb_smtpad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:Dn,y:Dn,width:E.number(),height:E.number(),radius:E.number(),ccw_rotation:od,layer:Wi,port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional(),solderpaste_margin:E.number().optional()}),EAr=E.object({type:E.literal("pcb_smtpad"),shape:E.literal("polygon"),pcb_smtpad_id:Pn("pcb_smtpad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),points:E.array(cr),layer:Wi,port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional(),solderpaste_margin:E.number().optional()}),Xqt=E.discriminatedUnion("shape",[IAr,vAr,SAr,PAr,Wqt,EAr]).describe("Defines an SMT pad on the PCB"),MAr=E.object({type:E.literal("pcb_solder_paste"),shape:E.literal("circle"),pcb_solder_paste_id:Pn("pcb_solder_paste"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:Dn,y:Dn,radius:E.number(),layer:Wi,pcb_component_id:E.string().optional(),pcb_smtpad_id:E.string().optional()}),wAr=E.object({type:E.literal("pcb_solder_paste"),shape:E.literal("rect"),pcb_solder_paste_id:Pn("pcb_solder_paste"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:Dn,y:Dn,width:E.number(),height:E.number(),layer:Wi,pcb_component_id:E.string().optional(),pcb_smtpad_id:E.string().optional()}),BAr=E.object({type:E.literal("pcb_solder_paste"),shape:E.literal("pill"),pcb_solder_paste_id:Pn("pcb_solder_paste"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:Dn,y:Dn,width:E.number(),height:E.number(),radius:E.number(),layer:Wi,pcb_component_id:E.string().optional(),pcb_smtpad_id:E.string().optional()}),TAr=E.object({type:E.literal("pcb_solder_paste"),shape:E.literal("rotated_rect"),pcb_solder_paste_id:Pn("pcb_solder_paste"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:Dn,y:Dn,width:E.number(),height:E.number(),ccw_rotation:Dn,layer:Wi,pcb_component_id:E.string().optional(),pcb_smtpad_id:E.string().optional()}),DAr=E.object({type:E.literal("pcb_solder_paste"),shape:E.literal("rotated_pill"),pcb_solder_paste_id:Pn("pcb_solder_paste"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:Dn,y:Dn,width:E.number(),height:E.number(),radius:E.number(),ccw_rotation:od,layer:Wi,pcb_component_id:E.string().optional(),pcb_smtpad_id:E.string().optional()}),NAr=E.object({type:E.literal("pcb_solder_paste"),shape:E.literal("oval"),pcb_solder_paste_id:Pn("pcb_solder_paste"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:Dn,y:Dn,width:E.number(),height:E.number(),layer:Wi,pcb_component_id:E.string().optional(),pcb_smtpad_id:E.string().optional()}),RAr=ile.extend({type:E.literal("pcb_solder_paste"),pcb_solder_paste_id:Pn("pcb_solder_paste"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),holes:E.array(ile.shape.points).optional(),layer:Wi,pcb_component_id:E.string().optional(),pcb_smtpad_id:E.string().optional()}),jqt=E.union([MAr,wAr,BAr,TAr,DAr,NAr,RAr]).describe("Defines solderpaste on the PCB"),B4e=E.object({type:E.literal("pcb_soldermask_opening"),pcb_soldermask_opening_id:Pn("pcb_soldermask_opening"),layer:Wi.pipe(k_),pcb_component_id:E.string().optional(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional()}),Kqt=E.discriminatedUnion("shape",[Kqe.extend(B4e.shape),Tbe.extend(B4e.shape),$qe.extend(B4e.shape),ile.extend(B4e.shape)]).describe("An explicit opening in top or bottom solder mask or flex coverlay, independent of pads. Removes mask without adding copper or solder paste."),$qt=E.object({type:E.literal("pcb_text"),pcb_text_id:Pn("pcb_text"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),text:E.string(),center:cr,layer:Wi,width:Ko,height:Ko,lines:E.number(),align:E.enum(["bottom-left"])}).describe("Defines text on the PCB"),qHt=Dn.pipe(E.number().finite().positive()),qqt=E.object({route_type:E.literal("wire"),x:Dn,y:Dn,width:Dn,start_width:qHt.optional(),end_width:qHt.optional(),width_interpolation_mode:E.enum(["linear","quadratic"]).optional(),copper_pour_id:E.string().optional(),is_inside_copper_pour:E.boolean().optional(),start_pcb_port_id:E.string().optional(),end_pcb_port_id:E.string().optional(),layer:Wi}).superRefine((e,t)=>{let n=[e.start_width,e.end_width,e.width_interpolation_mode].filter((o)=>o!==void 0).length;n!==0&&(n!==3&&t.addIssue({code:E.ZodIssueCode.custom,message:"Wire taper requires start_width, end_width and width_interpolation_mode together"}),e.width!==e.start_width&&t.addIssue({code:E.ZodIssueCode.custom,path:["start_width"],message:"start_width must equal width"}),Number.isFinite(e.x)&&Number.isFinite(e.y)||t.addIssue({code:E.ZodIssueCode.custom,message:"Tapered wire coordinates must be finite"}))}),Jqt=E.object({route_type:E.literal("via"),x:Dn,y:Dn,copper_pour_id:E.string().optional(),is_inside_copper_pour:E.boolean().optional(),hole_diameter:Dn.optional(),outer_diameter:Dn.optional(),tented_on_top:E.boolean().optional(),tented_on_bottom:E.boolean().optional(),from_layer:Wi,to_layer:Wi}),Zqt=E.object({route_type:E.literal("through_pad"),start:cr,end:cr,width:Dn,start_layer:Wi,end_layer:Wi,pcb_smtpad_id:E.string().optional(),pcb_plated_hole_id:E.string().optional()}),eJt=E.union([qqt,Jqt,Zqt]),tJt=E.object({type:E.literal("pcb_trace"),source_trace_id:E.string().optional(),pcb_component_id:E.string().optional(),pcb_trace_id:Pn("pcb_trace"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),route_thickness_mode:E.enum(["constant","interpolated"]).default("constant").optional(),route_order_index:E.number().optional(),should_round_corners:E.boolean().optional(),trace_length:E.number().optional(),is_antenna_trace:E.boolean().optional(),highlight_color:E.string().optional(),route:E.array(eJt).superRefine((e,t)=>{for(let[n,o]of e.entries()){if(o.route_type!=="wire"||o.width_interpolation_mode===void 0)continue;let r=e[n+1],i=r?.route_type==="through_pad"?r.start:r,s=r?.route_type==="wire"?r.layer:r?.route_type==="via"?r.from_layer:r?.start_layer,a=i?Math.hypot(i.x-o.x,i.y-o.y):NaN;(!Number.isFinite(a)||a<=0||s!==o.layer)&&t.addIssue({code:E.ZodIssueCode.custom,path:[n],message:"Tapered wire must lead to a distinct finite next point on the same layer"})}})}).describe("Defines a trace on the PCB"),nJt=E.object({type:E.literal("pcb_trace_warning"),pcb_trace_warning_id:Pn("pcb_trace_warning"),warning_type:E.literal("pcb_trace_warning").default("pcb_trace_warning"),message:E.string(),center:cr.optional(),pcb_trace_id:E.string(),source_trace_id:E.string(),pcb_component_ids:E.array(E.string()),pcb_port_ids:E.array(E.string()),subcircuit_id:E.string().optional()}).describe("Defines a trace warning on the PCB"),oJt=E.object({type:E.literal("pcb_trace_style_warning"),pcb_trace_style_warning_id:Pn("pcb_trace_style_warning"),warning_type:E.literal("pcb_trace_style_warning").default("pcb_trace_style_warning"),message:E.string(),styling_issue_type:E.literal("long_segment_at_odd_angle"),pcb_trace_id:E.string(),source_trace_id:E.string().optional(),subcircuit_id:E.string().optional(),layer:Wi,start_route_index:E.number().int().nonnegative(),end_route_index:E.number().int().nonnegative(),segment_start:cr,segment_end:cr,center:cr,segment_length:Dn,minimum_segment_length:Dn,angle_degrees:E.number().min(0).lt(360),nearest_allowed_angle_degrees:E.number().min(0).lt(360).multipleOf(45),angle_deviation_degrees:E.number().min(0).max(22.5),angle_tolerance_degrees:E.number().min(0).lt(22.5)}).describe("Warning for a long PCB trace segment whose direction deviates from a multiple of 45 degrees"),rJt=E.object({type:E.literal("pcb_trace_too_long_error"),pcb_trace_too_long_error_id:Pn("pcb_trace_too_long_error"),error_type:E.literal("pcb_trace_too_long_error").default("pcb_trace_too_long_error"),message:E.string(),pcb_trace_id:E.string(),source_net_id:E.string().optional(),source_trace_id:E.string().optional(),actual_trace_length:Dn,maximum_trace_length:Dn,subcircuit_id:E.string().optional()}).describe("Error emitted when a PCB trace is longer than its maximum allowed length"),iJt=Nc.extend({type:E.literal("pcb_bus_length_skew_error"),pcb_bus_length_skew_error_id:Pn("pcb_bus_length_skew_error"),error_type:E.literal("pcb_bus_length_skew_error").default("pcb_bus_length_skew_error"),source_bus_id:E.string(),source_trace_ids:E.array(E.string()),pcb_trace_ids:E.array(E.string()),actual_length_skew:E.number().nonnegative().finite(),maximum_length_skew:E.number().nonnegative().finite(),subcircuit_id:E.string().optional()}),sJt=E.object({type:E.literal("pcb_trace_too_long_warning"),pcb_trace_too_long_warning_id:Pn("pcb_trace_too_long_warning"),warning_type:E.literal("pcb_trace_too_long_warning").default("pcb_trace_too_long_warning"),message:E.string(),pcb_trace_id:E.string(),source_net_id:E.string().optional(),source_trace_id:E.string().optional(),actual_trace_length:Dn,maximum_trace_length:Dn,subcircuit_id:E.string().optional()}).describe("Warning emitted when a PCB trace is longer than its maximum allowed length"),aJt=E.object({type:E.literal("pcb_trace_too_many_vias_warning"),pcb_trace_too_many_vias_warning_id:Pn("pcb_trace_too_many_vias_warning"),warning_type:E.literal("pcb_trace_too_many_vias_warning").default("pcb_trace_too_many_vias_warning"),message:E.string(),pcb_trace_id:E.string(),source_net_id:E.string().optional(),source_trace_id:E.string().optional(),actual_via_count:E.number().int().nonnegative(),maximum_via_count:E.number().int().nonnegative(),subcircuit_id:E.string().optional()}).describe("Warning emitted when a PCB trace has more vias than its maximum allowed count"),jO=Nc.extend({type:E.literal("pcb_bus_routing_constraint_error"),pcb_bus_routing_constraint_error_id:Pn("pcb_bus_routing_constraint_error"),error_type:E.literal("pcb_bus_routing_constraint_error").default("pcb_bus_routing_constraint_error"),source_bus_id:E.string(),source_trace_ids:E.array(E.string()).min(1),pcb_trace_ids:E.array(E.string()),subcircuit_id:E.string().optional()}),cJt=E.discriminatedUnion("routing_rule",[jO.extend({routing_rule:E.literal("length_skew"),actual_length_skew:E.number().nonnegative().finite(),maximum_length_skew:E.number().nonnegative().finite()}),jO.extend({routing_rule:E.literal("min_length"),actual_trace_length:E.number().nonnegative().finite(),minimum_trace_length:E.number().finite()}),jO.extend({routing_rule:E.literal("max_length"),actual_trace_length:E.number().nonnegative().finite(),maximum_trace_length:E.number().finite()}),jO.extend({routing_rule:E.literal("target_length"),actual_trace_length:E.number().nonnegative().finite(),target_trace_length:E.number().finite(),length_tolerance:E.number().nonnegative().finite()}),jO.extend({routing_rule:E.literal("pcb_trace_spacing"),other_pcb_trace_id:E.string(),other_source_trace_id:E.string().optional(),actual_centerline_spacing:E.number().nonnegative().finite(),minimum_centerline_spacing:E.number().positive().finite()}),jO.extend({routing_rule:E.literal("pcb_spacing_to_other_signals"),other_pcb_trace_id:E.string(),other_source_trace_id:E.string().optional(),actual_centerline_spacing:E.number().nonnegative().finite(),minimum_centerline_spacing:E.number().positive().finite()}),jO.extend({routing_rule:E.literal("impedance_target"),target_impedance:E.number().positive().finite(),minimum_impedance:E.number().positive().finite().optional(),maximum_impedance:E.number().positive().finite().optional()})]).superRefine((e,t)=>{e.routing_rule==="impedance_target"&&(e.minimum_impedance===void 0&&e.maximum_impedance===void 0&&t.addIssue({code:E.ZodIssueCode.custom,path:["minimum_impedance"],message:"Provide an impedance bound"}),e.minimum_impedance!==void 0&&e.maximum_impedance!==void 0&&e.minimum_impedance>e.maximum_impedance&&t.addIssue({code:E.ZodIssueCode.custom,path:["maximum_impedance"],message:"Impedance bounds must be ordered"}))}).describe("A declared bus or differential-pair routing constraint is violated."),Pae=E.object({type:E.literal("pcb_bus_routing_constraint_warning"),pcb_bus_routing_constraint_warning_id:Pn("pcb_bus_routing_constraint_warning"),warning_type:E.literal("pcb_bus_routing_constraint_warning").default("pcb_bus_routing_constraint_warning"),source_bus_id:E.string(),source_trace_ids:E.array(E.string()).min(1),pcb_trace_ids:E.array(E.string()),message:E.string(),subcircuit_id:E.string().optional()}).describe("A declared bus or pair constraint could not be verified; this is not a pass."),lJt=E.discriminatedUnion("routing_rule",[Pae.extend({routing_rule:E.literal("route_geometry")}),Pae.extend({routing_rule:E.literal("reference_geometry")}),Pae.extend({routing_rule:E.literal("spacing_geometry")}),Pae.extend({routing_rule:E.literal("target_length")}),Pae.extend({routing_rule:E.literal("physical_impedance")})]),hJt=Nc.extend({type:E.literal("pcb_trace_error"),pcb_trace_error_id:Pn("pcb_trace_error"),error_type:E.literal("pcb_trace_error").default("pcb_trace_error"),center:cr.optional(),pcb_trace_id:E.string(),source_trace_id:E.string(),pcb_component_ids:E.array(E.string()),pcb_port_ids:E.array(E.string()),subcircuit_id:E.string().optional()}).describe("Defines a trace error on the PCB"),dJt=Nc.extend({type:E.literal("pcb_trace_missing_error"),pcb_trace_missing_error_id:Pn("pcb_trace_missing_error"),error_type:E.literal("pcb_trace_missing_error").default("pcb_trace_missing_error"),center:cr.optional(),source_trace_id:E.string(),pcb_component_ids:E.array(E.string()),pcb_port_ids:E.array(E.string()),subcircuit_id:E.string().optional()}).describe("Defines an error when a source trace has no corresponding PCB trace"),uJt=Nc.extend({type:E.literal("pcb_port_not_matched_error"),pcb_error_id:Pn("pcb_error"),error_type:E.literal("pcb_port_not_matched_error").default("pcb_port_not_matched_error"),pcb_component_ids:E.array(E.string()),subcircuit_id:E.string().optional()}).describe("Defines a trace error on the PCB where a port is not matched"),pJt=Nc.extend({type:E.literal("pcb_port_not_connected_error"),pcb_port_not_connected_error_id:Pn("pcb_port_not_connected_error"),error_type:E.literal("pcb_port_not_connected_error").default("pcb_port_not_connected_error"),pcb_port_ids:E.array(E.string()),pcb_component_ids:E.array(E.string()),subcircuit_id:E.string().optional()}).describe("Defines an error when a pcb port is not connected to any trace"),mJt=E.object({type:E.literal("pcb_net"),pcb_net_id:Pn("pcb_net"),source_net_id:E.string().optional(),highlight_color:E.string().optional()}).describe("Defines a net on the PCB"),_Jt=E.object({type:E.literal("pcb_via"),pcb_via_id:Pn("pcb_via"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),subcircuit_connectivity_map_key:E.string().optional(),x:Dn,y:Dn,outer_diameter:Dn.default("0.6mm"),hole_diameter:Dn.default("0.25mm"),topmost_drill_layer:Wi.optional(),bottommost_drill_layer:Wi.optional(),through_hole:E.boolean().optional(),from_layer:Wi.optional(),to_layer:Wi.optional(),layers:E.array(Wi),pcb_port_ids:E.array(E.string()).optional(),pcb_trace_id:E.string().optional(),source_trace_id:E.string().optional(),source_net_id:E.string().min(1).optional(),net_is_assignable:E.boolean().optional(),net_assigned:E.boolean().optional(),is_tented:E.boolean().optional(),tented_on_top:E.boolean().optional(),tented_on_bottom:E.boolean().optional()}).transform(({is_tented:e,...t})=>(e!==void 0&&(t.tented_on_top??=e,t.tented_on_bottom??=e),t)).describe("Defines a via on the PCB"),gJt=E.object({type:E.literal("pcb_board"),pcb_board_id:Pn("pcb_board"),pcb_panel_id:E.string().optional(),carrier_pcb_board_id:E.string().optional(),is_subcircuit:E.boolean().optional(),subcircuit_id:E.string().optional(),is_mounted_to_carrier_board:E.boolean().optional(),is_via_in_pad_allowed:E.boolean().optional(),default_via_tented_on_top:E.boolean().optional(),default_via_tented_on_bottom:E.boolean().optional(),default_via_plugged:E.boolean().optional(),width:Ko.optional(),height:Ko.optional(),center:cr,display_offset_x:E.string().optional().describe("How to display the x offset for this board, usually corresponding with how the user specified it"),display_offset_y:E.string().optional().describe("How to display the y offset for this board, usually corresponding with how the user specified it"),thickness:Ko.optional().default(1.4),num_layers:E.number().optional().default(4),allow_blind_and_buried_vias:E.boolean().optional().describe("Whether autorouters may generate blind and buried vias. False restricts newly generated vias to the full board stack."),outline:E.array(cr).optional(),shape:E.enum(["rect","polygon"]).optional(),material:E.enum(["fr4","fr1","flex"]).default("fr4"),solder_mask_color:E.string().optional(),silkscreen_color:E.string().optional(),anchor_position:cr.optional(),anchor_alignment:SB.optional(),position_mode:E.enum(["relative_to_panel_anchor","none"]).optional()}).merge(Tqt).describe("Defines the board outline of the PCB"),JHt=cr.extend({x:Ko.pipe(E.number().finite()),y:Ko.pipe(E.number().finite())}),AJt=E.object({type:E.literal("pcb_bend"),pcb_bend_id:Pn("pcb_bend"),pcb_board_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),name:E.string().optional(),start:JHt,end:JHt,bend_angle:od.pipe(E.number().finite()),bend_radius:Ko.pipe(E.number().finite().positive()),bend_side:E.enum(["left","right"])}).refine(({start:e,end:t})=>e.x!==t.x||e.y!==t.y,{message:"Bend centerline endpoints must be distinct",path:["end"]}).describe("Defines a finite-radius bend on a flat PCB for runtime CAD folding"),AKe=Ko.pipe(E.number().finite().positive()),fJt=cr.extend({x:Ko.pipe(E.number().finite()),y:Ko.pipe(E.number().finite())}),yJt=E.object({type:E.literal("pcb_stiffener"),pcb_stiffener_id:Pn("pcb_stiffener"),pcb_board_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),name:E.string().optional(),layer:E.enum(["top","bottom"]),material:E.enum(["fr4","polyimide","stainless_steel","aluminum"]),thickness:AKe,adhesive_thickness:Ko.pipe(E.number().finite().nonnegative()).optional()}),xJt=yJt.extend({shape:E.literal("rect"),center:fJt,rotation:od.pipe(E.number().finite()).optional(),width:AKe,height:AKe,outline:E.never().optional()}),CJt=yJt.extend({shape:E.literal("polygon"),outline:E.array(fJt).min(3).refine((e)=>{let t=e.reduce((n,o,r)=>{let i=e[(r+1)%e.length];return n+o.x*i.y-i.x*o.y},0);return Number.isFinite(t)&&t!==0},"Stiffener outline must enclose a nonzero area"),center:E.never().optional(),rotation:E.never().optional(),width:E.never().optional(),height:E.never().optional()}),bJt=E.discriminatedUnion("shape",[xJt,CJt]).describe("Defines bonded mechanical PCB reinforcement without adding copper layers"),IJt=E.object({type:E.literal("pcb_panel"),pcb_panel_id:Pn("pcb_panel"),width:Ko,height:Ko,center:cr,thickness:Ko.optional().default(1.4),covered_with_solder_mask:E.boolean().optional().default(!0)}).describe("Defines a PCB panel that can contain multiple boards"),vJt=Nc.extend({type:E.literal("pcb_placement_error"),pcb_placement_error_id:Pn("pcb_placement_error"),error_type:E.literal("pcb_placement_error").default("pcb_placement_error"),subcircuit_id:E.string().optional()}).describe("Defines a placement error on the PCB"),SJt=Nc.extend({type:E.literal("pcb_packing_error"),pcb_packing_error_id:Pn("pcb_packing_error"),error_type:E.literal("pcb_packing_error").default("pcb_packing_error"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional()}).describe("Defines a failure to pack PCB components within layout bounds"),PJt=Nc.extend({type:E.literal("pcb_panelization_placement_error"),pcb_panelization_placement_error_id:Pn("pcb_panelization_placement_error"),error_type:E.literal("pcb_panelization_placement_error").default("pcb_panelization_placement_error"),pcb_panel_id:E.string().optional(),pcb_board_id:E.string().optional(),subcircuit_id:E.string().optional()}).describe("Defines a panelization placement error on the PCB"),EJt=E.object({type:E.literal("pcb_trace_hint"),pcb_trace_hint_id:Pn("pcb_trace_hint"),pcb_port_id:E.string(),pcb_component_id:E.string(),route:E.array(Bqt),subcircuit_id:E.string().optional()}).describe("A hint that can be used during generation of a PCB trace"),MJt=E.object({type:E.literal("pcb_silkscreen_line"),pcb_silkscreen_line_id:Pn("pcb_silkscreen_line"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),stroke_width:Dn.default("0.1mm"),x1:Dn,y1:Dn,x2:Dn,y2:Dn,layer:k_}).describe("Defines a silkscreen line on the PCB"),wJt=E.object({type:E.literal("pcb_silkscreen_path"),pcb_silkscreen_path_id:Pn("pcb_silkscreen_path"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),layer:k_,route:E.array(cr),stroke_width:Ko}).describe("Defines a silkscreen path on the PCB"),BJt=E.object({type:E.literal("pcb_silkscreen_text"),pcb_silkscreen_text_id:Pn("pcb_silkscreen_text"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),font:E.literal("tscircuit2024").default("tscircuit2024"),font_size:Dn.default("0.2mm"),pcb_component_id:E.string(),text:E.string(),is_knockout:E.boolean().default(!1).optional(),knockout_padding:E.object({left:Ko,top:Ko,bottom:Ko,right:Ko}).default({left:"0.2mm",top:"0.2mm",bottom:"0.2mm",right:"0.2mm"}).optional(),ccw_rotation:E.number().optional(),layer:Wi,is_mirrored:E.boolean().default(!1).optional(),anchor_position:cr.default({x:0,y:0}),anchor_alignment:SB.default("center")}).describe("Defines silkscreen text on the PCB"),TJt=E.object({type:E.literal("pcb_copper_text"),pcb_copper_text_id:Pn("pcb_copper_text"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),font:E.literal("tscircuit2024").default("tscircuit2024"),font_size:Dn.default("0.2mm"),pcb_component_id:E.string(),text:E.string(),is_knockout:E.boolean().default(!1).optional(),knockout_padding:E.object({left:Ko,top:Ko,bottom:Ko,right:Ko}).default({left:"0.2mm",top:"0.2mm",bottom:"0.2mm",right:"0.2mm"}).optional(),ccw_rotation:E.number().optional(),layer:Wi,is_mirrored:E.boolean().default(!1).optional(),anchor_position:cr.default({x:0,y:0}),anchor_alignment:SB.default("center")}).describe("Defines copper text on the PCB"),DJt=E.object({type:E.literal("pcb_silkscreen_rect"),pcb_silkscreen_rect_id:Pn("pcb_silkscreen_rect"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),center:cr,width:Ko,height:Ko,layer:Wi,stroke_width:Ko.default("1mm"),corner_radius:Ko.optional(),is_filled:E.boolean().default(!0).optional(),has_stroke:E.boolean().optional(),is_stroke_dashed:E.boolean().optional(),ccw_rotation:E.number().optional()}).describe("Defines a silkscreen rect on the PCB"),NJt=E.object({type:E.literal("pcb_silkscreen_circle"),pcb_silkscreen_circle_id:Pn("pcb_silkscreen_circle"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),center:cr,radius:Ko,layer:k_,stroke_width:Ko.default("1mm"),is_filled:E.boolean().optional()}).describe("Defines a silkscreen circle on the PCB"),RJt=E.object({type:E.literal("pcb_silkscreen_oval"),pcb_silkscreen_oval_id:Pn("pcb_silkscreen_oval"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),center:cr,radius_x:Dn,radius_y:Dn,layer:k_,ccw_rotation:od.optional()}).describe("Defines a silkscreen oval on the PCB"),QJt=E.object({type:E.literal("pcb_silkscreen_graphic"),pcb_silkscreen_graphic_id:Pn("pcb_silkscreen_graphic"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),layer:k_,image_asset:Lle.optional()}).extend({shape:E.literal("brep"),brep_shape:SJe}).describe("Defines a BRep silkscreen graphic on the PCB"),kJt=E.discriminatedUnion("shape",[QJt]).describe("Defines a silkscreen graphic on the PCB"),LJt=E.object({type:E.literal("pcb_silkscreen_pill"),pcb_silkscreen_pill_id:Pn("pcb_silkscreen_pill"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),center:cr,width:Ko,height:Ko,layer:Wi,ccw_rotation:E.number().optional()}).describe("Defines a silkscreen pill on the PCB"),HJt=E.object({type:E.literal("pcb_fabrication_note_text"),pcb_fabrication_note_text_id:Pn("pcb_fabrication_note_text"),subcircuit_id:E.string().optional(),pcb_group_id:E.string().optional(),font:E.literal("tscircuit2024").default("tscircuit2024"),font_size:Dn.default("1mm"),pcb_component_id:E.string(),text:E.string(),ccw_rotation:E.number().optional(),layer:k_,anchor_position:cr.default({x:0,y:0}),anchor_alignment:E.enum(["center","top_left","top_right","bottom_left","bottom_right"]).default("center"),color:E.string().optional()}).describe("Defines a fabrication note in text on the PCB, useful for leaving notes for assemblers or fabricators"),FJt=E.object({type:E.literal("pcb_fabrication_note_path"),pcb_fabrication_note_path_id:Pn("pcb_fabrication_note_path"),pcb_component_id:E.string(),subcircuit_id:E.string().optional(),layer:Wi,route:E.array(cr),stroke_width:Ko,color:E.string().optional(),is_filled:E.boolean().optional(),has_stroke:E.boolean().optional()}).describe("Defines a fabrication path on the PCB for fabricators or assemblers"),zJt=E.object({type:E.literal("pcb_fabrication_note_rect"),pcb_fabrication_note_rect_id:Pn("pcb_fabrication_note_rect"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),center:cr,width:Ko,height:Ko,layer:k_,stroke_width:Ko.default("0.1mm"),corner_radius:Ko.optional(),is_filled:E.boolean().optional(),has_stroke:E.boolean().optional(),is_stroke_dashed:E.boolean().optional(),color:E.string().optional()}).describe("Defines a fabrication note rectangle on the PCB"),OJt=E.object({type:E.literal("pcb_fabrication_note_dimension"),pcb_fabrication_note_dimension_id:Pn("pcb_fabrication_note_dimension"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),layer:k_,from:cr,to:cr,text:E.string().optional(),text_ccw_rotation:E.number().optional(),offset:Ko.optional(),offset_distance:Ko.optional(),offset_direction:E.object({x:E.number(),y:E.number()}).optional(),font:E.literal("tscircuit2024").default("tscircuit2024"),font_size:Ko.default("1mm"),color:E.string().optional(),arrow_size:Ko.default("1mm")}).describe("Defines a measurement annotation within PCB fabrication notes"),VJt=E.object({type:E.literal("pcb_note_text"),pcb_note_text_id:Pn("pcb_note_text"),pcb_component_id:E.string().optional(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),name:E.string().optional(),font:E.literal("tscircuit2024").default("tscircuit2024"),font_size:Dn.default("1mm"),text:E.string().optional(),anchor_position:cr.default({x:0,y:0}),anchor_alignment:E.enum(["center","top_left","top_right","bottom_left","bottom_right"]).default("center"),layer:k_.default("top"),is_mirrored_from_top_view:E.boolean().optional(),color:E.string().optional()}).describe("Defines a documentation note in text on the PCB"),YJt=E.object({type:E.literal("pcb_note_rect"),pcb_note_rect_id:Pn("pcb_note_rect"),pcb_component_id:E.string().optional(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),name:E.string().optional(),text:E.string().optional(),center:cr,width:Ko,height:Ko,layer:k_.default("top"),stroke_width:Ko.default("0.1mm"),corner_radius:Ko.optional(),is_filled:E.boolean().optional(),has_stroke:E.boolean().optional(),is_stroke_dashed:E.boolean().optional(),color:E.string().optional()}).describe("Defines a rectangular documentation note on the PCB"),GJt=E.object({type:E.literal("pcb_note_path"),pcb_note_path_id:Pn("pcb_note_path"),pcb_component_id:E.string().optional(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),name:E.string().optional(),text:E.string().optional(),route:E.array(cr),layer:k_.default("top"),stroke_width:Ko.default("0.1mm"),color:E.string().optional()}).describe("Defines a polyline documentation note on the PCB"),UJt=E.object({type:E.literal("pcb_note_line"),pcb_note_line_id:Pn("pcb_note_line"),pcb_component_id:E.string().optional(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),name:E.string().optional(),text:E.string().optional(),x1:Dn,y1:Dn,x2:Dn,y2:Dn,layer:k_.default("top"),stroke_width:Dn.default("0.1mm"),color:E.string().optional(),is_dashed:E.boolean().optional()}).describe("Defines a straight documentation note line on the PCB"),WJt=E.object({type:E.literal("pcb_note_dimension"),pcb_note_dimension_id:Pn("pcb_note_dimension"),pcb_component_id:E.string().optional(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),name:E.string().optional(),from:cr,to:cr,text:E.string().optional(),text_ccw_rotation:E.number().optional(),offset_distance:Ko.optional(),offset_direction:E.object({x:E.number(),y:E.number()}).optional(),font:E.literal("tscircuit2024").default("tscircuit2024"),font_size:Ko.default("1mm"),layer:k_.default("top"),color:E.string().optional(),arrow_size:Ko.default("1mm")}).describe("Defines a measurement annotation within PCB documentation notes"),XJt=Nc.extend({type:E.literal("pcb_footprint_overlap_error"),pcb_error_id:Pn("pcb_error"),error_type:E.literal("pcb_footprint_overlap_error").default("pcb_footprint_overlap_error"),pcb_smtpad_ids:E.array(E.string()).optional(),pcb_plated_hole_ids:E.array(E.string()).optional(),pcb_hole_ids:E.array(E.string()).optional(),pcb_keepout_ids:E.array(E.string()).optional()}).describe("Error emitted when a pcb footprint overlaps with another element"),jJt=Nc.extend({type:E.literal("pcb_courtyard_overlap_error"),pcb_error_id:Pn("pcb_error"),error_type:E.literal("pcb_courtyard_overlap_error").default("pcb_courtyard_overlap_error"),pcb_component_ids:E.tuple([E.string(),E.string()])}).describe("Error emitted when the courtyard (CrtYd) of one PCB component overlaps with the courtyard of another"),KJt=E.object({type:E.literal("pcb_keepout"),shape:E.literal("outline"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),outline:E.array(cr).min(2),stroke_width:Ko,pcb_keepout_id:E.string(),layers:E.array(E.string()),description:E.string().optional(),excluded_pcb_component_ids:E.array(E.string()).optional(),warning_only:E.boolean().optional(),allow_traces:E.boolean().optional(),allow_placements:E.boolean().optional()}),$Jt=E.object({type:E.literal("pcb_keepout"),shape:E.literal("rect"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),center:cr,width:Dn,height:Dn,pcb_keepout_id:E.string(),layers:E.array(E.string()),description:E.string().optional(),excluded_pcb_component_ids:E.array(E.string()).optional(),warning_only:E.boolean().optional(),allow_traces:E.boolean().optional(),allow_placements:E.boolean().optional()}).or(E.object({type:E.literal("pcb_keepout"),shape:E.literal("circle"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),center:cr,radius:Dn,pcb_keepout_id:E.string(),layers:E.array(E.string()),description:E.string().optional(),excluded_pcb_component_ids:E.array(E.string()).optional(),warning_only:E.boolean().optional(),allow_traces:E.boolean().optional(),allow_placements:E.boolean().optional()})).or(KJt),qJt=E.object({type:E.literal("pcb_keepout_overlap_warning"),pcb_keepout_overlap_warning_id:Pn("pcb_keepout_overlap_warning"),warning_type:E.literal("pcb_keepout_overlap_warning").default("pcb_keepout_overlap_warning"),message:E.string(),pcb_keepout_id:E.string(),pcb_component_ids:E.array(E.string()).optional(),pcb_trace_ids:E.array(E.string()).optional(),pcb_smtpad_ids:E.array(E.string()).optional(),pcb_plated_hole_ids:E.array(E.string()).optional(),pcb_via_ids:E.array(E.string()).optional(),center:cr.optional(),subcircuit_id:E.string().optional()}).describe("Warning emitted when copper overlaps a PCB keepout with warning_only enabled"),kbe=E.object({type:E.literal("pcb_cutout"),pcb_cutout_id:Pn("pcb_cutout"),pcb_component_id:E.string().optional(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),pcb_board_id:E.string().optional(),pcb_panel_id:E.string().optional()}),JJt=kbe.extend({shape:E.literal("rect"),center:cr,width:Ko,height:Ko,rotation:od.optional(),corner_radius:Ko.optional()}),ZJt=kbe.extend({shape:E.literal("circle"),center:cr,radius:Ko}),eZt=kbe.extend({shape:E.literal("polygon"),points:E.array(cr)}),tZt=kbe.extend({shape:E.literal("path"),route:E.array(cr),slot_width:Ko,slot_length:Ko.optional(),space_between_slots:Ko.optional(),slot_corner_radius:Ko.optional()}),nZt=E.discriminatedUnion("shape",[JJt,ZJt,eZt,tZt]).describe("Defines a cutout on the PCB, removing board material."),oZt=Nc.extend({type:E.literal("pcb_missing_footprint_error"),pcb_missing_footprint_error_id:Pn("pcb_missing_footprint_error"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),error_type:E.literal("pcb_missing_footprint_error").default("pcb_missing_footprint_error"),source_component_id:E.string()}).describe("Defines a missing footprint error on the PCB"),rZt=Nc.extend({type:E.literal("external_footprint_load_error"),external_footprint_load_error_id:Pn("external_footprint_load_error"),pcb_component_id:E.string(),source_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),footprinter_string:E.string().optional(),error_type:E.literal("external_footprint_load_error").default("external_footprint_load_error")}).describe("Defines an error when an external footprint fails to load"),iZt=Nc.extend({type:E.literal("circuit_json_footprint_load_error"),circuit_json_footprint_load_error_id:Pn("circuit_json_footprint_load_error"),pcb_component_id:E.string(),source_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),error_type:E.literal("circuit_json_footprint_load_error").default("circuit_json_footprint_load_error"),circuit_json:E.array(E.any()).optional()}).describe("Defines an error when a circuit JSON footprint fails to load"),sZt=E.object({type:E.literal("pcb_group"),pcb_group_id:Pn("pcb_group"),source_group_id:E.string(),is_subcircuit:E.boolean().optional(),subcircuit_id:E.string().optional(),width:Ko.optional(),height:Ko.optional(),center:cr,display_offset_x:E.string().optional().describe("How to display the x offset for this group, usually corresponding with how the user specified it"),display_offset_y:E.string().optional().describe("How to display the y offset for this group, usually corresponding with how the user specified it"),outline:E.array(cr).optional(),anchor_position:cr.optional(),anchor_alignment:SB.default("center"),position_mode:E.enum(["packed","relative_to_group_anchor","none"]).optional(),positioned_relative_to_pcb_group_id:E.string().optional(),positioned_relative_to_pcb_board_id:E.string().optional(),pcb_component_ids:E.array(E.string()),child_layout_mode:E.enum(["packed","none"]).optional(),name:E.string().optional(),description:E.string().optional(),layout_mode:E.string().optional(),autorouter_configuration:E.object({trace_clearance:Ko}).optional(),autorouter_used_string:E.string().optional()}).describe("Defines a group of components on the PCB"),aZt=Nc.extend({type:E.literal("pcb_autorouting_error"),pcb_error_id:Pn("pcb_autorouting_error"),error_type:E.literal("pcb_autorouting_error").default("pcb_autorouting_error"),subcircuit_id:E.string().optional()}).describe("The autorouting has failed to route a portion of the board"),cZt=Nc.extend({type:E.literal("pcb_preflight_routing_error"),pcb_preflight_routing_error_id:Pn("pcb_preflight_routing_error"),error_type:E.literal("pcb_preflight_routing_error").default("pcb_preflight_routing_error"),error_code:E.string(),subcircuit_id:E.string().optional(),pcb_group_id:E.string().optional(),routing_phase_index:E.number().int().optional(),phase_name:E.string().optional(),source_trace_ids:E.array(E.string()).optional(),pcb_component_ids:E.array(E.string()).optional(),pcb_port_ids:E.array(E.string()).optional(),related_error_ids:E.array(E.string()).optional(),measurements:E.record(E.number().finite()).optional()}),lZt=E.object({type:E.literal("pcb_manual_edit_conflict_warning"),pcb_manual_edit_conflict_warning_id:Pn("pcb_manual_edit_conflict_warning"),warning_type:E.literal("pcb_manual_edit_conflict_warning").default("pcb_manual_edit_conflict_warning"),message:E.string(),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),source_component_id:E.string()}).describe("Warning emitted when a component has both manual placement and explicit pcbX/pcbY coordinates"),ZHt=E.enum(["x-","x+","y+","y-"]),hZt=E.object({type:E.literal("pcb_connector_not_in_accessible_orientation_warning"),pcb_connector_not_in_accessible_orientation_warning_id:Pn("pcb_connector_not_in_accessible_orientation_warning"),warning_type:E.literal("pcb_connector_not_in_accessible_orientation_warning").default("pcb_connector_not_in_accessible_orientation_warning"),message:E.string(),pcb_component_id:E.string(),source_component_id:E.string().optional(),pcb_board_id:E.string().optional(),facing_direction:ZHt,recommended_facing_direction:ZHt,subcircuit_id:E.string().optional()}).describe("Warning emitted when a connector PCB component is facing inward toward the board and should be reoriented to an outward-facing direction"),dZt=E.object({type:E.literal("pcb_component_missing_courtyard_warning"),pcb_component_missing_courtyard_warning_id:Pn("pcb_component_missing_courtyard_warning"),warning_type:E.literal("pcb_component_missing_courtyard_warning").default("pcb_component_missing_courtyard_warning"),message:E.string(),pcb_component_id:E.string(),source_component_id:E.string().optional(),subcircuit_id:E.string().optional()}).describe("Warning emitted when a PCB component has no courtyard geometry"),uZt=E.object({type:E.literal("supplier_footprint_mismatch_warning"),supplier_footprint_mismatch_warning_id:Pn("supplier_footprint_mismatch_warning"),warning_type:E.literal("supplier_footprint_mismatch_warning").default("supplier_footprint_mismatch_warning"),message:E.string(),source_component_id:E.string(),pcb_component_id:E.string().optional(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),supplier_name:zq.optional(),supplier_part_number:E.string().optional(),supplier_footprint_url:E.string().optional(),footprint_copper_intersection_over_union:E.number()}).describe("Warning emitted when a supplier part footprint does not match the expected footprint"),pZt=E.object({type:E.literal("pcb_fabricator_extra_charge_warning"),pcb_fabricator_extra_charge_warning_id:Pn("pcb_fabricator_extra_charge_warning"),warning_type:E.literal("pcb_fabricator_extra_charge_warning").default("pcb_fabricator_extra_charge_warning"),message:E.string(),fabricator_preset:E.string(),pcb_board_id:E.string().optional(),pcb_via_ids:E.array(E.string()).optional(),subcircuit_id:E.string().optional()}).describe("Warning that a design feature incurs an extra charge for the selected fabricator preset, such as via hole diameters below 0.3 mm with JLCPCB economy or standard presets."),mZt=E.object({type:E.literal("pcb_breakout_point"),pcb_breakout_point_id:Pn("pcb_breakout_point"),pcb_group_id:E.string(),subcircuit_id:E.string().optional(),source_trace_id:E.string().optional(),source_port_id:E.string().optional(),source_net_id:E.string().optional(),layer:Wi.optional(),x:Dn,y:Dn}).describe("Defines a routing target within a pcb_group for a source_trace or source_net"),_Zt=E.object({type:E.literal("pcb_ground_plane"),pcb_ground_plane_id:Pn("pcb_ground_plane"),source_pcb_ground_plane_id:E.string(),source_net_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional()}).describe("Defines a ground plane on the PCB"),gZt=E.object({type:E.literal("pcb_ground_plane_region"),pcb_ground_plane_region_id:Pn("pcb_ground_plane_region"),pcb_ground_plane_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),layer:Wi,points:E.array(cr)}).describe("Defines a polygon region of a ground plane"),AZt=E.object({type:E.literal("pcb_thermal_spoke"),pcb_thermal_spoke_id:Pn("pcb_thermal_spoke"),pcb_ground_plane_id:E.string(),shape:E.string(),spoke_count:E.number(),spoke_thickness:Dn,spoke_inner_diameter:Dn,spoke_outer_diameter:Dn,pcb_plated_hole_id:E.string().optional(),subcircuit_id:E.string().optional()}).describe("Pattern for connecting a ground plane to a plated hole"),PJe=E.object({type:E.literal("pcb_copper_pour"),pcb_copper_pour_id:Pn("pcb_copper_pour"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),layer:Wi,source_net_id:E.string().optional(),covered_with_solder_mask:E.boolean().optional().default(!0)}),fZt=PJe.extend({shape:E.literal("rect"),center:cr,width:Ko,height:Ko,rotation:od.optional()}),yZt=PJe.extend({shape:E.literal("brep"),brep_shape:SJe}),xZt=PJe.extend({shape:E.literal("polygon"),points:E.array(cr)}),CZt=E.discriminatedUnion("shape",[fZt,yZt,xZt]).describe("Defines a copper pour on the PCB."),bZt=Nc.extend({type:E.literal("pcb_component_outside_board_error"),pcb_component_outside_board_error_id:Pn("pcb_component_outside_board_error"),error_type:E.literal("pcb_component_outside_board_error").default("pcb_component_outside_board_error"),pcb_component_id:E.string(),pcb_board_id:E.string(),component_center:cr,component_bounds:E.object({min_x:E.number(),max_x:E.number(),min_y:E.number(),max_y:E.number()}),subcircuit_id:E.string().optional(),source_component_id:E.string().optional()}).describe("Error emitted when a PCB component is placed outside the board boundaries"),IZt=Nc.extend({type:E.literal("pcb_component_not_on_board_edge_error"),pcb_component_not_on_board_edge_error_id:Pn("pcb_component_not_on_board_edge_error"),error_type:E.literal("pcb_component_not_on_board_edge_error").default("pcb_component_not_on_board_edge_error"),pcb_component_id:E.string(),pcb_board_id:E.string(),component_center:cr,pad_to_nearest_board_edge_distance:E.number(),source_component_id:E.string().optional(),subcircuit_id:E.string().optional()}).describe("Error emitted when a component that must be placed on the board edge is centered away from the edge"),vZt=Nc.extend({type:E.literal("pcb_component_invalid_layer_error"),pcb_component_invalid_layer_error_id:Pn("pcb_component_invalid_layer_error"),error_type:E.literal("pcb_component_invalid_layer_error").default("pcb_component_invalid_layer_error"),pcb_component_id:E.string().optional(),source_component_id:E.string(),layer:Wi,subcircuit_id:E.string().optional()}).describe("Error emitted when a component is placed on an invalid layer (components can only be on 'top' or 'bottom' layers)"),SZt=Nc.extend({type:E.literal("pcb_via_clearance_error"),pcb_error_id:Pn("pcb_error"),error_type:E.literal("pcb_via_clearance_error").default("pcb_via_clearance_error"),pcb_via_ids:E.array(E.string()).min(2),minimum_clearance:Dn.optional(),actual_clearance:Dn.optional(),pcb_center:E.object({x:E.number().optional(),y:E.number().optional()}).optional(),subcircuit_id:E.string().optional()}).describe("Error emitted when vias are closer than the allowed clearance"),PZt=Nc.extend({type:E.literal("pcb_via_trace_clearance_error"),pcb_via_trace_clearance_error_id:Pn("pcb_via_trace_clearance_error"),error_type:E.literal("pcb_via_trace_clearance_error").default("pcb_via_trace_clearance_error"),pcb_via_id:E.string(),pcb_trace_id:E.string(),minimum_clearance:Dn.optional(),actual_clearance:Dn.optional(),center:E.object({x:E.number().optional(),y:E.number().optional()}).optional(),subcircuit_id:E.string().optional()}).describe("Error emitted when a via and trace are closer than the allowed clearance"),EZt=Nc.extend({type:E.literal("pcb_pad_pad_clearance_error"),pcb_pad_pad_clearance_error_id:Pn("pcb_pad_pad_clearance_error"),error_type:E.literal("pcb_pad_pad_clearance_error").default("pcb_pad_pad_clearance_error"),pcb_pad_ids:E.array(E.string()).min(2),minimum_clearance:Dn.optional(),actual_clearance:Dn.optional(),center:E.object({x:E.number().optional(),y:E.number().optional()}).optional(),subcircuit_id:E.string().optional()}).describe("Error emitted when pads are closer than the allowed clearance"),MZt=Nc.extend({type:E.literal("pcb_pad_trace_clearance_error"),pcb_pad_trace_clearance_error_id:Pn("pcb_pad_trace_clearance_error"),error_type:E.literal("pcb_pad_trace_clearance_error").default("pcb_pad_trace_clearance_error"),pcb_pad_id:E.string(),pcb_trace_id:E.string(),minimum_clearance:Dn.optional(),actual_clearance:Dn.optional(),center:E.object({x:E.number().optional(),y:E.number().optional()}).optional(),subcircuit_id:E.string().optional()}).describe("Error emitted when a pad and trace are closer than allowed clearance"),wZt=E.object({type:E.literal("pcb_courtyard_rect"),pcb_courtyard_rect_id:Pn("pcb_courtyard_rect"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),center:cr,width:Ko,height:Ko,layer:k_,ccw_rotation:od.optional(),color:E.string().optional()}).describe("Defines a courtyard rectangle on the PCB"),BZt=E.object({type:E.literal("pcb_courtyard_outline"),pcb_courtyard_outline_id:Pn("pcb_courtyard_outline"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),layer:k_,outline:E.array(cr).min(2)}).describe("Defines a courtyard outline on the PCB"),TZt=E.object({type:E.literal("pcb_courtyard_polygon"),pcb_courtyard_polygon_id:Pn("pcb_courtyard_polygon"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),layer:k_,points:E.array(cr).min(3),color:E.string().optional()}).describe("Defines a courtyard polygon on the PCB"),DZt=E.object({type:E.literal("pcb_courtyard_circle"),pcb_courtyard_circle_id:Pn("pcb_courtyard_circle"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),center:cr,radius:Ko,layer:k_,color:E.string().optional()}).describe("Defines a courtyard circle on the PCB"),NZt=E.object({type:E.literal("pcb_courtyard_pill"),pcb_courtyard_pill_id:Pn("pcb_courtyard_pill"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),center:cr,width:Ko,height:Ko,radius:Ko,layer:k_,color:E.string().optional()}).describe("Defines a courtyard pill on the PCB"),QAr=["obj","stl","3mf","gltf","glb","step","wrl"],RZt=["x+","x-","y+","y-","z+","z-"],kAr={obj:"z+",stl:"z+","3mf":"z+",gltf:"y+",glb:"y+",step:"z+",wrl:"y+"},QZt=E.object({type:E.literal("cad_component"),cad_component_id:E.string(),pcb_component_id:E.string().optional().describe("Optional PCB component reference; omit for CAD geometry without a PCB component"),source_component_id:E.string(),position:n6,rotation:n6.optional(),is_on_folded_board:E.boolean().optional().describe("True when position and rotation describe the assembled folded board pose. False or omitted means the flat board pose. PCB records remain flat; pcb_component_id identifies the flat mount and owning board for reversible transforms."),size:n6.optional(),layer:Wi.optional(),subcircuit_id:E.string().optional(),footprinter_string:E.string().optional(),model_obj_url:E.string().optional(),model_stl_url:E.string().optional(),model_3mf_url:E.string().optional(),model_gltf_url:E.string().optional(),model_glb_url:E.string().optional(),model_step_url:E.string().optional(),model_wrl_url:E.string().optional(),model_asset:Lle.optional(),model_unit_to_mm_scale_factor:E.number().optional(),model_board_normal_direction:E.enum(RZt).optional().describe(`The direction in the model's coordinate space that is considered "up" or "coming out of the board surface"`),model_origin_position:n6.optional(),model_origin_alignment:E.enum(["unknown","center","center_of_component_on_board_surface","bottom_center_of_component"]).optional(),model_object_fit:E.enum(["contain_within_bounds","fill_bounds"]).optional().default("contain_within_bounds"),model_jscad:E.any().optional(),color:E.string().trim().min(1).optional().describe("Explicit color override for CAD geometry, including authored JSCAD material colors. Omit to preserve model materials."),show_as_translucent_model:E.boolean().optional(),show_as_bounding_box:E.boolean().optional(),show_hidden_edges:E.boolean().optional(),anchor_alignment:E.enum(["center","center_of_component_on_board_surface"]).optional().default("center")}).describe("Defines CAD geometry, optionally associated with a PCB component"),kZt=Nc.extend({type:E.literal("cad_collision_error"),cad_collision_error_id:Pn("cad_collision_error"),error_type:E.literal("cad_collision_error").default("cad_collision_error"),cad_component_ids:E.array(E.string()).min(1),pcb_component_ids:E.array(E.string()).optional(),source_component_ids:E.array(E.string()).min(1),intersection_area_mm2:E.number().finite().nonnegative(),threshold_area_mm2:E.number().finite().nonnegative()}).describe("An aperture-bearing part intersects the finished enclosure. The intersection_area_mm2 is the union silhouette area of the solid intersection projected along the aperture face normal, in the right-handed Circuit JSON world frame (+X right, +Y top, +Z above). It is an area in square millimetres, not intersection volume or surface area. This indicates possible aperture misplacement, insufficient size/depth, or body clearance problems; it does not prove which cause applies."),eFt=n6.refine((e)=>[e.x,e.y,e.z].every(Number.isFinite),"Connector pin 1 positions must be finite").describe("Resolved pin 1 position at the connector mating face, in right-handed circuit world, millimeters: +X right, +Y top, +Z above. An absolute point, not a direction. Computed by the circuit producer from endpoint geometry. Together with the endpoint path tangent, fixes connector roll and identifies its pin 1 side; renderers must not infer it from footprints."),LZt=E.object({type:E.literal("cad_cable"),cad_cable_id:E.string(),name:E.string().min(1),from_source_component_id:E.string(),to_source_component_id:E.string(),from_connector_pin1_position:eFt.optional(),to_connector_pin1_position:eFt.optional(),cableprinter_string:E.string().min(1).describe('Physical cable definition, e.g. "usb_c" or "jst_ph_pins6". Independent of the route.'),path:E.array(n6).min(2).refine((e)=>e.every((t,n)=>[t.x,t.y,t.z].every(Number.isFinite)&&(n===0||Math.hypot(t.x-e[n-1].x,t.y-e[n-1].y,t.z-e[n-1].z)>0.00000001)),"Cable paths require finite, distinct consecutive points").describe("Resolved cable centerline points in right-handed circuit world, millimeters: +X right, +Y top, +Z above. First/last samples are connector wire exits; their tangents point into/out of the cable. Includes routing/slack; renderers must not recompute the path.")}).describe("A physical assembly cable with a resolved 3D route. Several cables are independent cad_cable records, each with its own endpoints, definition and path. Does not imply electrical pin mapping."),HZt=0.000001,tFt=E.object({x:E.number().finite(),y:E.number().finite(),z:E.number().finite()}).refine((e)=>Math.abs(Math.hypot(e.x,e.y,e.z)-1)<=HZt,"Reference surface directions must be unit vectors"),nFt=Dn.pipe(E.number().finite().positive()),FZt=E.object({type:E.literal("cad_reference_surface"),cad_reference_surface_id:E.string().min(1),source_component_id:E.string().min(1).describe("Owning assembly part's source component ID. The part may have no CAD geometry."),name:E.string().trim().min(1).describe("Reference name, unique within the owning part, e.g. shade in STEM.shade."),shape:E.literal("rect"),center:n6.refine((e)=>[e.x,e.y,e.z].every(Number.isFinite),"Reference surface centers must be finite").describe("Resolved surface center in right-handed circuit-world XYZ, millimeters: +X right, +Y top, +Z above. An absolute point after assembly placement."),normal:tFt.describe("Outward unit normal in circuit-world XYZ. Dimensionless direction; transform with the part's rotation, without translation."),x_axis:tFt.describe("In-plane unit X direction in circuit-world XYZ, perpendicular to normal. The second tangent is normal cross x_axis, giving a right-handed frame."),width:nFt.optional().describe("Rectangular extent along x_axis in millimeters. Supply together with height. Omission leaves the surface's display size unspecified."),height:nFt.optional().describe("Rectangular extent along normal cross x_axis in millimeters. Supply together with width."),subcircuit_id:E.string().optional()}).superRefine((e,t)=>{e.width===void 0!=(e.height===void 0)&&t.addIssue({code:E.ZodIssueCode.custom,path:["width"],message:"Provide width and height together"});let{normal:n,x_axis:o}=e;Math.abs(n.x*o.x+n.y*o.y+n.z*o.z)>HZt&&t.addIssue({code:E.ZodIssueCode.custom,path:["x_axis"],message:"x_axis must be perpendicular to normal"})}).describe("A named assembly mounting surface with a resolved world-space frame. Reference geometry for optional visualization; does not add solid material or electrical connectivity. The producer resolves part placement independently of CAD-model offsets; renderers consume the world frame without reapplying the owning model's transform."),EJe=E.enum(["sinewave","square","triangle","sawtooth"]),LAr=E.union([E.string(),E.number()]).transform((e)=>typeof e=="string"?e.endsWith("%")?parseFloat(e.slice(0,-1))/100:parseFloat(e):e).pipe(E.number().min(0,"Duty cycle must be non-negative").max(1,"Duty cycle cannot be greater than 100%")),zZt=E.object({type:E.literal("simulation_voltage_source"),simulation_voltage_source_id:Pn("simulation_voltage_source"),is_dc_source:E.literal(!0).optional().default(!0),positive_source_port_id:E.string().optional(),negative_source_port_id:E.string().optional(),positive_source_net_id:E.string().optional(),negative_source_net_id:E.string().optional(),voltage:i6,ac_magnitude:i6.optional(),ac_phase:od.optional()}).describe("Defines a DC voltage source for simulation"),OZt=E.object({type:E.literal("simulation_voltage_source"),simulation_voltage_source_id:Pn("simulation_voltage_source"),is_dc_source:E.literal(!1),terminal1_source_port_id:E.string().optional(),terminal2_source_port_id:E.string().optional(),terminal1_source_net_id:E.string().optional(),terminal2_source_net_id:E.string().optional(),voltage:i6.optional(),frequency:iY.optional(),peak_to_peak_voltage:i6.optional(),wave_shape:EJe.optional(),phase:od.optional(),duty_cycle:LAr.optional(),pulse_delay:Wg.optional(),rise_time:Wg.optional(),fall_time:Wg.optional(),pulse_width:Wg.optional(),period:Wg.optional(),ac_magnitude:i6.optional(),ac_phase:od.optional()}).describe("Defines an AC voltage source for simulation"),VZt=E.union([zZt,OZt]).describe("Defines a voltage source for simulation"),HAr=E.union([E.string(),E.number()]).transform((e)=>typeof e=="string"?e.endsWith("%")?parseFloat(e.slice(0,-1))/100:parseFloat(e):e).pipe(E.number().min(0,"Duty cycle must be non-negative").max(1,"Duty cycle cannot be greater than 100%")),YZt=E.object({type:E.literal("simulation_current_source"),simulation_current_source_id:Pn("simulation_current_source"),is_dc_source:E.literal(!0).optional().default(!0),positive_source_port_id:E.string().optional(),negative_source_port_id:E.string().optional(),positive_source_net_id:E.string().optional(),negative_source_net_id:E.string().optional(),current:FQ,ac_magnitude:FQ.optional(),ac_phase:od.optional()}).describe("Defines a DC current source for simulation"),GZt=E.object({type:E.literal("simulation_current_source"),simulation_current_source_id:Pn("simulation_current_source"),is_dc_source:E.literal(!1),terminal1_source_port_id:E.string().optional(),terminal2_source_port_id:E.string().optional(),terminal1_source_net_id:E.string().optional(),terminal2_source_net_id:E.string().optional(),current:FQ.optional(),frequency:iY.optional(),peak_to_peak_current:FQ.optional(),wave_shape:EJe.optional(),phase:od.optional(),duty_cycle:HAr.optional(),ac_magnitude:FQ.optional(),ac_phase:od.optional()}).describe("Defines an AC current source for simulation"),UZt=E.union([YZt,GZt]).describe("Defines a current source for simulation"),Lbe=E.custom((e)=>e==="V"||e==="A"),MJe=E.custom((e)=>e==="Ω"||e==="F"||e==="H"||e==="V"||e==="A"),WZt=E.union([E.literal("spice_dc_sweep"),E.literal("spice_dc_operating_point"),E.literal("spice_transient_analysis"),E.literal("spice_ac_analysis"),E.literal("pcb_return_current")]),XZt=E.object({method:E.enum(["trap","gear"]).optional(),reltol:E.union([E.number(),E.string()]).optional(),abstol:E.union([E.number(),E.string()]).optional(),vntol:E.union([E.number(),E.string()]).optional()}).describe("SPICE solver options for a simulation experiment"),jZt=E.object({type:E.literal("simulation_experiment"),simulation_experiment_id:Pn("simulation_experiment"),name:E.string(),experiment_type:WZt,time_per_step:Fq.optional(),start_time_ms:Wg.optional(),end_time_ms:Wg.optional(),spice_options:XZt.optional(),dc_sweep_voltage_source_id:E.string().optional(),dc_sweep_current_source_id:E.string().optional(),dc_sweep_start:E.number().optional(),dc_sweep_stop:E.number().optional(),dc_sweep_step:E.number().refine((e)=>e!==0).optional(),dc_sweep_unit:Lbe.optional(),ac_sweep_type:E.enum(["linear","decade","octave"]).optional(),ac_samples_per_interval:E.number().int().positive().optional(),ac_sample_count:E.number().int().positive().optional(),ac_start_frequency_hz:E.number().positive().optional(),ac_stop_frequency_hz:E.number().positive().optional()}).superRefine((e,t)=>{if(e.experiment_type==="spice_dc_sweep"){let n=["dc_sweep_start","dc_sweep_stop","dc_sweep_step","dc_sweep_unit"];for(let o of n)e[o]===void 0&&t.addIssue({code:E.ZodIssueCode.custom,path:[o],message:`${o} is required for a DC sweep`});e.dc_sweep_voltage_source_id!==void 0===(e.dc_sweep_current_source_id!==void 0)&&t.addIssue({code:E.ZodIssueCode.custom,path:["dc_sweep_voltage_source_id"],message:"Exactly one DC sweep voltage or current source ID is required"})}e.experiment_type==="spice_ac_analysis"&&(e.ac_sweep_type===void 0&&t.addIssue({code:E.ZodIssueCode.custom,path:["ac_sweep_type"],message:"ac_sweep_type is required for an AC analysis"}),e.ac_start_frequency_hz===void 0&&t.addIssue({code:E.ZodIssueCode.custom,path:["ac_start_frequency_hz"],message:"ac_start_frequency_hz is required for an AC analysis"}),e.ac_stop_frequency_hz===void 0&&t.addIssue({code:E.ZodIssueCode.custom,path:["ac_stop_frequency_hz"],message:"ac_stop_frequency_hz is required for an AC analysis"}),e.ac_sweep_type==="linear"&&e.ac_sample_count===void 0&&t.addIssue({code:E.ZodIssueCode.custom,path:["ac_sample_count"],message:"ac_sample_count is required for a linear AC analysis"}),e.ac_sweep_type!=="decade"&&e.ac_sweep_type!=="octave"||e.ac_samples_per_interval!==void 0||t.addIssue({code:E.ZodIssueCode.custom,path:["ac_samples_per_interval"],message:"ac_samples_per_interval is required for decade and octave AC analyses"}))}).describe("Defines a simulation experiment configuration"),PB=E.object({simulation_parameter_sweep_id:E.string(),sweep_index:E.number().int().nonnegative(),parameter_value:E.number(),parameter_unit:MJe}),KZt=E.object({type:E.literal("simulation_transient_voltage_graph"),simulation_transient_voltage_graph_id:Pn("simulation_transient_voltage_graph"),simulation_experiment_id:E.string(),simulation_parameter_sweep_coordinate:PB.optional(),timestamps_ms:E.array(E.number()).optional(),voltage_levels:E.array(E.number()),source_component_id:E.string().optional(),subcircuit_connectivity_map_key:E.string().optional(),time_per_step:Fq,start_time_ms:Wg,end_time_ms:Wg,name:E.string().optional(),color:E.string().optional()}).describe("Stores voltage measurements over time for a simulation"),$Zt=E.object({type:E.literal("simulation_transient_current_graph"),simulation_transient_current_graph_id:Pn("simulation_transient_current_graph"),simulation_experiment_id:E.string(),simulation_parameter_sweep_coordinate:PB.optional(),timestamps_ms:E.array(E.number()).optional(),current_levels:E.array(E.number()),source_component_id:E.string().optional(),subcircuit_connectivity_map_key:E.string().optional(),time_per_step:Fq,start_time_ms:Wg,end_time_ms:Wg,name:E.string().optional(),color:E.string().optional()}).describe("Stores current measurements over time for a simulation"),qZt=E.object({type:E.literal("simulation_switch"),simulation_switch_id:Pn("simulation_switch"),source_component_id:E.string().optional(),closes_at:Wg.optional(),opens_at:Wg.optional(),starts_closed:E.boolean().optional(),switching_frequency:iY.optional()}).describe("Defines a switch for simulation timing control"),JZt=E.object({type:E.literal("simulation_voltage_probe"),simulation_voltage_probe_id:Pn("simulation_voltage_probe"),source_component_id:E.string().optional(),name:E.string().optional(),signal_input_source_port_id:E.string().optional(),signal_input_source_net_id:E.string().optional(),reference_input_source_port_id:E.string().optional(),reference_input_source_net_id:E.string().optional(),subcircuit_id:E.string().optional(),color:E.string().optional()}).describe("Defines a voltage probe for simulation. If a reference input is not provided, it measures against ground. If a reference input is provided, it measures the differential voltage between two points.").superRefine((e,t)=>{if(e.reference_input_source_port_id||e.reference_input_source_net_id){let n=!!e.signal_input_source_port_id||!!e.reference_input_source_port_id,o=!!e.signal_input_source_net_id||!!e.reference_input_source_net_id;n&&o?t.addIssue({code:E.ZodIssueCode.custom,message:"Cannot mix port and net connections in a differential probe."}):n?e.signal_input_source_port_id&&e.reference_input_source_port_id||t.addIssue({code:E.ZodIssueCode.custom,message:"Differential port probe requires both signal_input_source_port_id and reference_input_source_port_id."}):o&&(e.signal_input_source_net_id&&e.reference_input_source_net_id||t.addIssue({code:E.ZodIssueCode.custom,message:"Differential net probe requires both signal_input_source_net_id and reference_input_source_net_id."}))}else!!e.signal_input_source_port_id==!!e.signal_input_source_net_id&&t.addIssue({code:E.ZodIssueCode.custom,message:"A voltage probe must have exactly one of signal_input_source_port_id or signal_input_source_net_id."})}),ZZt=E.object({type:E.literal("simulation_current_probe"),simulation_current_probe_id:Pn("simulation_current_probe"),source_component_id:E.string().optional(),name:E.string().optional(),positive_source_port_id:E.string().optional(),negative_source_port_id:E.string().optional(),positive_source_net_id:E.string().optional(),negative_source_net_id:E.string().optional(),subcircuit_id:E.string().optional(),color:E.string().optional()}).describe("Defines a current probe for simulation. It measures current flowing from the positive endpoint to the negative endpoint.").superRefine((e,t)=>{let n=!!e.positive_source_port_id,o=!!e.negative_source_port_id,r=!!e.positive_source_net_id,i=!!e.negative_source_net_id,s=n||o,a=r||i;s&&a?t.addIssue({code:E.ZodIssueCode.custom,message:"Cannot mix port and net connections in a current probe."}):s?n&&o||t.addIssue({code:E.ZodIssueCode.custom,message:"Current probe using source ports requires both positive_source_port_id and negative_source_port_id."}):a?r&&i||t.addIssue({code:E.ZodIssueCode.custom,message:"Current probe using source nets requires both positive_source_net_id and negative_source_net_id."}):t.addIssue({code:E.ZodIssueCode.custom,message:"A current probe must have either positive/negative source port ids or positive/negative source net ids."})}),een=Nc.extend({type:E.literal("simulation_unknown_experiment_error"),simulation_unknown_experiment_error_id:Pn("simulation_unknown_experiment_error"),error_type:E.literal("simulation_unknown_experiment_error").default("simulation_unknown_experiment_error"),simulation_experiment_id:E.string().optional(),subcircuit_id:E.string().optional()}).describe("An unknown error occurred during the simulation experiment."),FAr=E.enum(["resistance","capacitance","inductance","voltage","current"]),Eae=E.object({type:E.literal("simulation_parameter_sweep"),simulation_parameter_sweep_id:Pn("simulation_parameter_sweep"),simulation_experiment_id:E.string(),name:E.string().optional(),parameter_values:E.array(E.number()).min(1),parameter_unit:MJe}),ten=E.discriminatedUnion("parameter_type",[Eae.extend({parameter_type:E.literal("resistance"),resistor_source_component_id:E.string()}),Eae.extend({parameter_type:E.literal("capacitance"),capacitor_source_component_id:E.string()}),Eae.extend({parameter_type:E.literal("inductance"),inductor_source_component_id:E.string()}),Eae.extend({parameter_type:E.literal("voltage"),source_net_id:E.string()}),Eae.extend({parameter_type:E.literal("current"),current_source_component_id:E.string()})]).describe("Repeats a simulation experiment over component parameter values"),nen=E.object({type:E.literal("simulation_dc_operating_point_voltage"),simulation_dc_operating_point_voltage_id:Pn("simulation_dc_operating_point_voltage"),simulation_experiment_id:E.string(),simulation_parameter_sweep_coordinate:PB.optional(),simulation_voltage_probe_id:E.string(),voltage:E.number(),name:E.string().optional(),color:E.string().optional()}),oen=E.object({type:E.literal("simulation_dc_operating_point_current"),simulation_dc_operating_point_current_id:Pn("simulation_dc_operating_point_current"),simulation_experiment_id:E.string(),simulation_parameter_sweep_coordinate:PB.optional(),simulation_current_probe_id:E.string(),current:E.number(),name:E.string().optional(),color:E.string().optional()}),ren=E.object({type:E.literal("simulation_dc_sweep_voltage_graph"),simulation_dc_sweep_voltage_graph_id:Pn("simulation_dc_sweep_voltage_graph"),simulation_experiment_id:E.string(),simulation_parameter_sweep_coordinate:PB.optional(),simulation_voltage_probe_id:E.string(),sweep_values:E.array(E.number()),sweep_unit:Lbe,voltage_levels:E.array(E.number()),name:E.string().optional(),color:E.string().optional()}).refine((e)=>e.sweep_values.length===e.voltage_levels.length,{message:"sweep_values and voltage_levels must have the same length"}),ien=E.object({type:E.literal("simulation_dc_sweep_current_graph"),simulation_dc_sweep_current_graph_id:Pn("simulation_dc_sweep_current_graph"),simulation_experiment_id:E.string(),simulation_parameter_sweep_coordinate:PB.optional(),simulation_current_probe_id:E.string(),sweep_values:E.array(E.number()),sweep_unit:Lbe,current_levels:E.array(E.number()),name:E.string().optional(),color:E.string().optional()}).refine((e)=>e.sweep_values.length===e.current_levels.length,{message:"sweep_values and current_levels must have the same length"}),wJe=E.object({re:E.number(),im:E.number()}),sen=E.object({type:E.literal("simulation_ac_sweep_voltage_graph"),simulation_ac_sweep_voltage_graph_id:Pn("simulation_ac_sweep_voltage_graph"),simulation_experiment_id:E.string(),simulation_parameter_sweep_coordinate:PB.optional(),simulation_voltage_probe_id:E.string(),frequencies_hz:E.array(E.number()),complex_voltages:E.array(wJe),name:E.string().optional(),color:E.string().optional()}).refine((e)=>e.frequencies_hz.length===e.complex_voltages.length,{message:"frequencies_hz and complex_voltages must have the same length"}),aen=E.object({type:E.literal("simulation_ac_sweep_current_graph"),simulation_ac_sweep_current_graph_id:Pn("simulation_ac_sweep_current_graph"),simulation_experiment_id:E.string(),simulation_parameter_sweep_coordinate:PB.optional(),simulation_current_probe_id:E.string(),frequencies_hz:E.array(E.number()),complex_currents:E.array(wJe),name:E.string().optional(),color:E.string().optional()}).refine((e)=>e.frequencies_hz.length===e.complex_currents.length,{message:"frequencies_hz and complex_currents must have the same length"}),cen=E.object({type:E.literal("simulation_op_amp"),simulation_op_amp_id:Pn("simulation_op_amp"),source_component_id:E.string().optional(),inverting_input_source_port_id:E.string(),non_inverting_input_source_port_id:E.string(),output_source_port_id:E.string(),positive_supply_source_port_id:E.string(),negative_supply_source_port_id:E.string()}).describe("Defines a simple ideal operational amplifier for simulation"),len=E.object({type:E.literal("simulation_spice_subcircuit"),simulation_spice_subcircuit_id:Pn("simulation_spice_subcircuit"),source_component_id:E.string(),spice_pin_to_source_port_map:E.record(E.string(),E.string()),subcircuit_source:E.string()}).describe("Defines a custom SPICE subcircuit model for simulation"),oFt=(e)=>e!==void 0,hen=E.object({type:E.literal("simulation_oscilloscope_trace"),simulation_oscilloscope_trace_id:Pn("simulation_oscilloscope_trace"),simulation_transient_voltage_graph_id:E.string().optional(),simulation_transient_current_graph_id:E.string().optional(),simulation_voltage_probe_id:E.string().optional(),simulation_current_probe_id:E.string().optional(),display_name:E.string().optional(),color:E.string().optional(),display_center_value:E.number().optional(),display_center_offset_divs:E.number().optional(),volts_per_div:E.number().positive().optional(),amps_per_div:E.number().positive().optional()}).describe("Defines how a simulation measurement is rendered as an oscilloscope-style trace.").superRefine((e,t)=>{let n=[e.simulation_transient_voltage_graph_id,e.simulation_voltage_probe_id].filter(oFt).length,o=[e.simulation_transient_current_graph_id,e.simulation_current_probe_id].filter(oFt).length;n+o!==1&&t.addIssue({code:E.ZodIssueCode.custom,message:"An oscilloscope trace must reference exactly one voltage graph, current graph, voltage probe, or current probe."}),n>0&&e.amps_per_div!==void 0&&t.addIssue({code:E.ZodIssueCode.custom,message:"Voltage oscilloscope traces must use volts_per_div, not amps_per_div."}),o>0&&e.volts_per_div!==void 0&&t.addIssue({code:E.ZodIssueCode.custom,message:"Current oscilloscope traces must use amps_per_div, not volts_per_div."})}),eXe=E.object({x:E.number().finite(),y:E.number().finite(),layer:Wi}),fKe=E.discriminatedUnion("contact_type",[eXe.extend({contact_type:E.literal("pcb_port"),pcb_port_id:E.string().min(1)}),eXe.extend({contact_type:E.literal("pcb_via"),pcb_via_id:E.string().min(1)}),eXe.extend({contact_type:E.literal("pcb_copper_pour"),pcb_copper_pour_id:E.string().min(1)})]).describe("Identifies the reference conductor at a return-current contact"),yKe=E.object({signal_pcb_port_id:E.string().min(1),reference_pcb_port_id:E.string().min(1).optional(),reference_layer:Wi,resistance:E.number().finite().positive()}).describe("A two-terminal return-current excitation port with resistance in ohms"),den=E.object({type:E.literal("simulation_return_current_excitation"),simulation_return_current_excitation_id:Pn("simulation_return_current_excitation"),simulation_experiment_id:E.string().min(1),pcb_trace_id:E.string().min(1),ground_source_net_id:E.string().min(1),current:E.number().finite(),return_source:fKe,return_sink:fKe,source_port:yKe.optional(),load_port:yKe.optional()}).describe("Excites a signal trace with signed current in amperes, peak for AC; return_source is near the load and return_sink near the driver for positive current"),uen=E.object({type:E.literal("simulation_pcb_return_current_result"),simulation_pcb_return_current_result_id:Pn("simulation_pcb_return_current_result"),simulation_experiment_id:E.string().min(1),pcb_board_id:E.string().min(1),simulation_return_current_excitation_ids:E.array(E.string().min(1)).min(1).refine((e)=>new Set(e).size===e.length,"Excitation IDs must be unique"),frequency_hz:E.number().finite().positive().optional()}).describe("A PCB return-current result at one frequency, or a frequency-independent result when frequency_hz is absent");function pen(e){return Lle.extend({project_relative_path:E.string().min(1),url:E.string().url()}).superRefine((t,n)=>{if(e.includes(t.mimetype)||n.addIssue({code:E.ZodIssueCode.custom,path:["mimetype"],message:`Expected one of: ${e.join(", ")}`}),t.url.startsWith("data:"))/^data:([^;,]*)(?:;[^,]*)?,/i.exec(t.url)?.[1]?.toLowerCase()!==t.mimetype&&n.addIssue({code:E.ZodIssueCode.custom,path:["url"],message:"Data URL media type must match asset.mimetype"})})}var men=pen(["application/json","application/gzip"]),_en=pen(["image/png","image/webp"]),gen=E.object({type:E.literal("simulation_pcb_return_current_field"),simulation_pcb_return_current_field_id:Pn("simulation_pcb_return_current_field"),simulation_pcb_return_current_result_id:E.string().min(1),layer:Wi,source_net_id:E.string().min(1),field_type:E.enum(["real","complex_phasor"]),min_x:E.number().finite(),min_y:E.number().finite(),columns:E.number().int().positive().safe(),rows:E.number().int().positive().safe(),cell_width:E.number().finite().positive(),cell_height:E.number().finite().positive(),copper_thickness:E.number().finite().positive(),data_format:E.literal("simulation_return_current_grid_json_v1"),field_asset:men}).superRefine((e,t)=>{Number.isSafeInteger(e.columns*e.rows)||t.addIssue({code:E.ZodIssueCode.custom,path:["columns"],message:"The grid cell count must be a safe integer"})}).describe("A sampled sheet-current field in A/mm, using plain or gzipped JSON Asset URLs; dimensions are PCB millimeters"),WK=E.array(E.number().finite().nullable()).min(1),Aen=E.discriminatedUnion("field_type",[E.object({field_type:E.literal("real"),sheet_current_x:WK,sheet_current_y:WK}),E.object({field_type:E.literal("complex_phasor"),sheet_current_x_real:WK,sheet_current_x_imag:WK,sheet_current_y_real:WK,sheet_current_y_imag:WK})]).superRefine((e,t)=>{let n=e.field_type==="real"?[e.sheet_current_x,e.sheet_current_y]:[e.sheet_current_x_real,e.sheet_current_x_imag,e.sheet_current_y_real,e.sheet_current_y_imag],o=n[0];if(n.some((r)=>r.length!==o.length))t.addIssue({code:E.ZodIssueCode.custom,message:"Current channels must have equal lengths"});else for(let r=0;r<o.length;r++){let i=o[r]===null;if(n.some((s)=>s[r]===null!==i))return void t.addIssue({code:E.ZodIssueCode.custom,message:`Cell ${r} must be null in every channel or finite in every channel`})}}).describe("Decoded real or complex sheet-current arrays with a shared conductor mask");function zAr(e){let t=e.columns*e.rows;if(!Number.isSafeInteger(e.columns)||e.columns<=0||!Number.isSafeInteger(e.rows)||e.rows<=0||!Number.isSafeInteger(t))throw Error("Grid dimensions must be positive safe integers");return Aen.superRefine((n,o)=>{n.field_type!==e.field_type&&o.addIssue({code:E.ZodIssueCode.custom,path:["field_type"],message:"Decoded field_type must match the parent field"}),(n.field_type==="real"?n.sheet_current_x:n.sheet_current_x_real).length!==t&&o.addIssue({code:E.ZodIssueCode.custom,message:`Each current channel must have ${t} entries (columns * rows)`})})}var fen=E.object({type:E.literal("simulation_pcb_return_current_heatmap"),simulation_pcb_return_current_heatmap_id:Pn("simulation_pcb_return_current_heatmap"),simulation_pcb_return_current_result_id:E.string().min(1),layer:Wi,source_net_id:E.string().min(1),min_x:E.number().finite(),min_y:E.number().finite(),max_x:E.number().finite(),max_y:E.number().finite(),image_asset:_en}).superRefine((e,t)=>{for(let n of["x","y"])e[`max_${n}`]<=e[`min_${n}`]&&t.addIssue({code:E.ZodIssueCode.custom,path:[`max_${n}`],message:"Heatmap bounds must have positive width and height"})}).describe("A transparent PNG/WebP current-density overlay in A/mm²; the top-left pixel maps to (min_x, max_y)"),rFt=E.object({type:E.literal("simulation_pcb_return_current_marker"),simulation_pcb_return_current_marker_id:Pn("simulation_pcb_return_current_marker"),simulation_pcb_return_current_result_id:E.string().min(1),role:E.enum(["signal_source","signal_load","return_source","return_sink","signal_transition","return_transition"]),label:E.string().optional(),label_x:E.number().finite().optional(),label_y:E.number().finite().optional()}),yen=E.discriminatedUnion("target_type",[rFt.extend({target_type:E.literal("pcb_port"),pcb_port_id:E.string().min(1),layer:Wi}),rFt.extend({target_type:E.literal("pcb_via"),pcb_via_id:E.string().min(1),from_layer:Wi,to_layer:Wi})]).superRefine((e,t)=>{e.label_x===void 0!=(e.label_y===void 0)&&t.addIssue({code:E.ZodIssueCode.custom,path:["label_x"],message:"label_x and label_y must be provided together"}),e.target_type==="pcb_via"&&e.from_layer===e.to_layer&&t.addIssue({code:E.ZodIssueCode.custom,path:["to_layer"],message:"A via transition must connect distinct layers"})}).describe("A signal/return port or via highlight; markers do not assert measured via-transfer currents"),xen=E.union([G$t,M$t,Y$t,P$t,E$t,S$t,B$t,w$t,tJe,Jqe,Nbe,eJe,Zqe,nJe,oJe,rJe,aJe,cJe,lJe,mJe,hJe,dJe,uJe,pJe,sJe,iJe,N$t,R$t,T$t,_Je,gJe,AJe,fJe,Q$t,V$t,yJe,CJe,xJe,k$t,L$t,H$t,F$t,z$t,O$t,bJe,IJe,D$t,Dqt,kqt,Yqt,oZt,rZt,iZt,lZt,hZt,dZt,uZt,pZt,Gqt,$Jt,qJt,Uqt,mJt,$qt,tJt,nJt,oJt,sJt,rJt,iJt,aJt,_Jt,Xqt,jqt,Kqt,gJt,AJt,bJt,IJt,sZt,EJt,MJt,wJt,BJt,LJt,TJt,DJt,NJt,RJt,kJt,cJt,lJt,hJt,dJt,vJt,SJt,PJt,uJt,pJt,SZt,PZt,EZt,MZt,FJt,HJt,zJt,OJt,VJt,YJt,GJt,UJt,WJt,aZt,cZt,XJt,jJt,mZt,nZt,_Zt,gZt,AZt,CZt,bZt,IZt,vZt,wZt,BZt,TZt,DZt,NZt,U$t,rqt,Z$t,eqt,tqt,nqt,q$t,J$t,iqt,oqt,W$t,aqt,cqt,sqt,uqt,pqt,mqt,_qt,gqt,Aqt,Sqt,fqt,yqt,xqt,vqt,Cqt,bqt,QZt,LZt,FZt,kZt,VZt,UZt,jZt,den,uen,gen,fen,yen,KZt,$Zt,nen,oen,ren,ien,sen,aen,ten,qZt,JZt,ZZt,hen,een,cen,len]),bCe=xen;function iFt(e,t,n){if(!t||!n)return;let o=e.get(t);o||(o=new Set,e.set(t,o)),o.add(n);let r=e.get(n);r||(r=new Set,e.set(n,r)),r.add(t)}var C5=(e,t={})=>{let n=e,o=n._internal_store;if(!o){o={counts:{},editCount:0},n._internal_store=o;for(let i of n){let s=i.type,a=i[`${s}_id`];if(!a)continue;let c=Number.parseInt(a.split("_").pop());Number.isNaN(c)||(o.counts[s]=Math.max(o.counts[s]??0,c))}}let r=new Proxy({},{get:(i,s)=>{if(s==="toArray")return()=>(n.editCount=o.editCount,n);if(s==="editCount")return o.editCount;if(s==="subtree")return(c)=>C5(function(l,h){if(!h.subcircuit_id&&!h.source_group_id)return[...l];let d=h;if(h.subcircuit_id){let A=new Set([h.subcircuit_id]),g=new Map,f=new Map;for(let x of l)if(x.type==="source_group"){let{source_group_id:C,subcircuit_id:b}=x;b&&f.set(C,b);let I=x.parent_source_group_id;I&&(g.has(I)||g.set(I,[]),g.get(I).push(C))}let y;for(let[x,C]of f)if(C===h.subcircuit_id){y=x;break}if(y){let x=(C)=>{let b=g.get(C)||[];for(let I of b){let v=f.get(I);v&&A.add(v),x(I)}};x(y),d={...h,subcircuit_ids:Array.from(A)}}}let u=new Map;for(let A of l){let g=A[`${A.type}_id`];typeof g=="string"&&u.set(g,A)}let _=new Map;for(let A of l){let g=Object.entries(A);for(let[f,y]of g)if(f!=="parent_source_group_id"){if(f.endsWith("_id")&&typeof y=="string")iFt(_,A,u.get(y));else if(f.endsWith("_ids")&&Array.isArray(y))for(let x of y)typeof x=="string"&&iFt(_,A,u.get(x))}}let p=[],m=new Set;for(let A of l){let g=!1;(d.subcircuit_id&&("subcircuit_id"in A)&&A.subcircuit_id===d.subcircuit_id||d.subcircuit_ids&&("subcircuit_id"in A)&&A.subcircuit_id&&d.subcircuit_ids.includes(A.subcircuit_id)||d.source_group_id&&("source_group_id"in A)&&A.source_group_id===d.source_group_id||d.source_group_id&&("member_source_group_ids"in A)&&Array.isArray(A.member_source_group_ids)&&A.member_source_group_ids.includes(d.source_group_id))&&(g=!0),g&&(p.push(A),m.add(A))}for(;p.length>0;){let A=p.shift(),g=_.get(A);if(g)for(let f of g)m.has(f)||(m.add(f),p.push(f))}return l.filter((A)=>m.has(A))}(n,c),t);if(s==="insert")return(c)=>{let l=c.type;if(!l)throw Error("insert requires an element with a type");o.counts[l]??=-1,o.counts[l]++;let h=o.counts[l],d={...c,type:l,[`${l}_id`]:`${l}_${h}`};if(t.validateInserts)(xCe[l]??bCe).parse(d);return n.push(d),o.editCount++,d};if(s==="insertAll")return(c)=>c.map((l)=>r.insert(l));let a=s;return{get:(c)=>n.find((l)=>l.type===a&&l[`${a}_id`]===c),getUsing:(c)=>{let l=Object.keys(c);if(l.length!==1)throw Error("getUsing requires exactly one key, e.g. { pcb_component_id }");let h=l[0],d=h.replace("_id",""),u=n.find((_)=>_.type===d&&_[h]===c[h]);return u?n.find((_)=>_.type===a&&_[`${a}_id`]===u[`${a}_id`]):null},getWhere:(c)=>{let l=Object.keys(c);return n.find((h)=>h.type===a&&l.every((d)=>h[d]===c[d]))},list:(c)=>{let l=c?Object.keys(c):[];return n.filter((h)=>h.type===a&&l.every((d)=>h[d]===c[d]))},insert:(c)=>{o.counts[a]??=-1,o.counts[a]++;let l=o.counts[a],h={type:a,[`${a}_id`]:`${a}_${l}`,...c};if(t.validateInserts)(xCe[a]??bCe).parse(h);return n.push(h),o.editCount++,h},delete:(c)=>{let l=n.find((h)=>h[`${a}_id`]===c);l&&(n.splice(n.indexOf(l),1),o.editCount++)},update:(c,l)=>{let h=n.find((d)=>d.type===a&&d[`${a}_id`]===c);return h?(Object.assign(h,l),o.editCount++,h):null},select:(c)=>{if(a==="source_component")return n.find((l)=>l.type==="source_component"&&l.name===c.replace(/\./g,""));if(a==="pcb_port"||a==="source_port"||a==="schematic_port"){let[l,h]=c.replace(/\./g,"").split(/[\s\>]+/),d=n.find((_)=>_.type==="source_component"&&_.name===l);if(!d)return null;let u=n.find((_)=>_.type==="source_port"&&_.source_component_id===d.source_component_id&&(_.name===h||(_.port_hints??[]).includes(h)));if(!u)return null;if(a==="source_port")return u;if(a==="pcb_port")return n.find((_)=>_.type==="pcb_port"&&_.source_port_id===u.source_port_id);if(a==="schematic_port")return n.find((_)=>_.type==="schematic_port"&&_.source_port_id===u.source_port_id)}}}}});return r};C5.unparsed=C5;var Kb=C5;function tXe(e){let t=e.type;return`${t}:${e[`${t}_id`]}`}var sFt=(e,t={})=>{let n=e._internal_store_indexed;if(!n){n={counts:{},editCount:0,indexes:{}};for(let i of e){let s=i.type,a=i[`${s}_id`];if(!a)continue;let c=Number.parseInt(a.split("_").pop()||"");Number.isNaN(c)||(n.counts[s]=Math.max(n.counts[s]??0,c))}let o=t.indexConfig||{},r=n.indexes;if(o.byId&&(r.byId=new Map),o.byType&&(r.byType=new Map),o.byRelation&&(r.byRelation=new Map),o.bySubcircuit&&(r.bySubcircuit=new Map),o.byCustomField&&o.byCustomField.length>0){r.byCustomField=new Map;for(let i of o.byCustomField)r.byCustomField.set(i,new Map)}for(let i of e){if(o.byId){let s=tXe(i);r.byId.set(s,i)}if(o.byType){let s=r.byType.get(i.type)||[];s.push(i),r.byType.set(i.type,s)}if(o.byRelation){let s=Object.entries(i);for(let[a,c]of s)if(a.endsWith("_id")&&a!==`${i.type}_id`&&typeof c=="string"){let l=r.byRelation.get(a)||new Map,h=l.get(c)||[];h.push(i),l.set(c,h),r.byRelation.set(a,l)}}if(o.bySubcircuit&&"subcircuit_id"in i){let s=i.subcircuit_id;if(s&&typeof s=="string"){let a=r.bySubcircuit.get(s)||[];a.push(i),r.bySubcircuit.set(s,a)}}if(o.byCustomField&&r.byCustomField){for(let s of o.byCustomField)if(s in i){let a=i[s];if(a!==void 0&&(typeof a=="string"||typeof a=="number")){let c=String(a),l=r.byCustomField.get(s),h=l.get(c)||[];h.push(i),l.set(c,h)}}}}e._internal_store_indexed=n}return new Proxy({},{get:(o,r)=>{if(r==="toArray")return()=>(e.editCount=n.editCount,e);if(r==="editCount")return n.editCount;let i=r;return{get:(s)=>{let a=t.indexConfig||{};if(a.byId&&n.indexes.byId)return n.indexes.byId.get(`${i}:${s}`)||null;if(a.byType&&n.indexes.byType)return(n.indexes.byType.get(i)||[]).find((c)=>c[`${i}_id`]===s)||null;return e.find((c)=>c.type===i&&c[`${i}_id`]===s)||null},getUsing:(s)=>{let a=t.indexConfig||{},c=Object.keys(s);if(c.length!==1)throw Error("getUsing requires exactly one key, e.g. { pcb_component_id }");let l=c[0],h=l.replace("_id","");if(a.byRelation&&n.indexes.byRelation){let u=n.indexes.byRelation.get(l);if(u){let _=(u.get(s[l])||[]).find((m)=>m.type===h);if(!_)return null;let p=_[`${i}_id`];if(a.byId&&n.indexes.byId)return n.indexes.byId.get(`${i}:${p}`)||null;if(a.byType&&n.indexes.byType)return(n.indexes.byType.get(i)||[]).find((m)=>m[`${i}_id`]===p)||null;return e.find((m)=>m.type===i&&m[`${i}_id`]===p)||null}}let d=e.find((u)=>u.type===h&&u[l]===s[l]);return d&&e.find((u)=>u.type===i&&u[`${i}_id`]===d[`${i}_id`])||null},getWhere:(s)=>{let a=t.indexConfig||{},c=Object.keys(s);if(c.length===1&&a.byCustomField&&n.indexes.byCustomField){let l=c[0],h=n.indexes.byCustomField.get(l);if(h){let d=String(s[l]);return(h.get(d)||[]).find((u)=>u.type===i)||null}}if("subcircuit_id"in s&&a.bySubcircuit&&n.indexes.bySubcircuit){let l=s.subcircuit_id;return(n.indexes.bySubcircuit.get(l)||[]).find((h)=>h.type===i&&c.every((d)=>h[d]===s[d]))||null}if(a.byType&&n.indexes.byType)return(n.indexes.byType.get(i)||[]).find((l)=>c.every((h)=>l[h]===s[h]))||null;return e.find((l)=>l.type===i&&c.every((h)=>l[h]===s[h]))||null},list:(s)=>{let a=t.indexConfig||{},c=s?Object.keys(s):[];if(c.length===0&&a.byType&&n.indexes.byType)return n.indexes.byType.get(i)||[];if(c.length===1&&c[0]==="subcircuit_id"&&a.bySubcircuit&&n.indexes.bySubcircuit){let h=s.subcircuit_id;return(n.indexes.bySubcircuit.get(h)||[]).filter((d)=>d.type===i)}let l;return l=a.byType&&n.indexes.byType?n.indexes.byType.get(i)||[]:e.filter((h)=>h.type===i),c.length>0?l.filter((h)=>c.every((d)=>h[d]===s[d])):l},insert:(s)=>{n.counts[i]??=-1,n.counts[i]++;let a=n.counts[i],c={type:i,[`${i}_id`]:`${i}_${a}`,...s};if(t.validateInserts)(xCe[i]??bCe).parse(c);e.push(c),n.editCount++;let l=t.indexConfig||{};if(l.byId&&n.indexes.byId){let h=tXe(c);n.indexes.byId.set(h,c)}if(l.byType&&n.indexes.byType){let h=n.indexes.byType.get(i)||[];h.push(c),n.indexes.byType.set(i,h)}if(l.byRelation&&n.indexes.byRelation){let h=Object.entries(c);for(let[d,u]of h)if(d.endsWith("_id")&&d!==`${c.type}_id`&&typeof u=="string"){let _=n.indexes.byRelation.get(d)||new Map,p=_.get(u)||[];p.push(c),_.set(u,p),n.indexes.byRelation.set(d,_)}}if(l.bySubcircuit&&n.indexes.bySubcircuit&&"subcircuit_id"in c){let h=c.subcircuit_id;if(h&&typeof h=="string"){let d=n.indexes.bySubcircuit.get(h)||[];d.push(c),n.indexes.bySubcircuit.set(h,d)}}if(l.byCustomField&&n.indexes.byCustomField){for(let h of l.byCustomField)if(h in c){let d=c[h];if(d!==void 0&&(typeof d=="string"||typeof d=="number")){let u=String(d),_=n.indexes.byCustomField.get(h),p=_.get(u)||[];p.push(c),_.set(u,p)}}}return c},delete:(s)=>{let a=t.indexConfig||{},c;if(a.byId&&n.indexes.byId)c=n.indexes.byId.get(`${i}:${s}`);else if(a.byType&&n.indexes.byType)c=(n.indexes.byType.get(i)||[]).find((d)=>d[`${i}_id`]===s);else c=e.find((h)=>h[`${i}_id`]===s);if(!c)return;let l=e.indexOf(c);if(l>=0&&(e.splice(l,1),n.editCount++),a.byId&&n.indexes.byId){let h=tXe(c);n.indexes.byId.delete(h)}if(a.byType&&n.indexes.byType){let h=(n.indexes.byType.get(i)||[]).filter((d)=>d[`${i}_id`]!==s);n.indexes.byType.set(i,h)}if(a.byRelation&&n.indexes.byRelation)for(let[h,d]of n.indexes.byRelation.entries())for(let[u,_]of d.entries()){let p=_.filter((m)=>m!==c);p.length===0?d.delete(u):d.set(u,p)}if(a.bySubcircuit&&n.indexes.bySubcircuit&&"subcircuit_id"in c){let h=c.subcircuit_id;if(h){let d=(n.indexes.bySubcircuit.get(h)||[]).filter((u)=>u!==c);d.length===0?n.indexes.bySubcircuit.delete(h):n.indexes.bySubcircuit.set(h,d)}}if(a.byCustomField&&n.indexes.byCustomField)for(let h of n.indexes.byCustomField.values())for(let[d,u]of h.entries()){let _=u.filter((p)=>p!==c);_.length===0?h.delete(d):h.set(d,_)}},update:(s,a)=>{let c=t.indexConfig||{},l;if(c.byId&&n.indexes.byId)l=n.indexes.byId.get(`${i}:${s}`);else if(c.byType&&n.indexes.byType)l=(n.indexes.byType.get(i)||[]).find((d)=>d[`${i}_id`]===s);else l=e.find((h)=>h.type===i&&h[`${i}_id`]===s);if(!l)return null;if(c.byRelation&&n.indexes.byRelation){let h=Object.entries(l);for(let[d,u]of h)if(d.endsWith("_id")&&d!==`${l.type}_id`&&typeof u=="string"&&d in a&&a[d]!==u){let _=n.indexes.byRelation.get(d);if(_){let p=(_.get(u)||[]).filter((m)=>m!==l);p.length===0?_.delete(u):_.set(u,p)}}}if(c.bySubcircuit&&n.indexes.bySubcircuit&&"subcircuit_id"in l&&"subcircuit_id"in a){let h=l.subcircuit_id;if(h!==a.subcircuit_id){let d=(n.indexes.bySubcircuit.get(h)||[]).filter((u)=>u!==l);d.length===0?n.indexes.bySubcircuit.delete(h):n.indexes.bySubcircuit.set(h,d)}}if(c.byCustomField&&n.indexes.byCustomField){for(let h of c.byCustomField)if(h in l&&h in a&&l[h]!==a[h]){let d=n.indexes.byCustomField.get(h);if(d){let u=String(l[h]),_=(d.get(u)||[]).filter((p)=>p!==l);_.length===0?d.delete(u):d.set(u,_)}}}if(Object.assign(l,a),n.editCount++,c.byRelation&&n.indexes.byRelation){let h=Object.entries(l);for(let[d,u]of h)if(d.endsWith("_id")&&d!==`${l.type}_id`&&typeof u=="string"&&d in a){let _=n.indexes.byRelation.get(d)||new Map,p=_.get(u)||[];p.includes(l)||(p.push(l),_.set(u,p),n.indexes.byRelation.set(d,_))}}if(c.bySubcircuit&&n.indexes.bySubcircuit&&"subcircuit_id"in l&&"subcircuit_id"in a){let h=l.subcircuit_id;if(h&&typeof h=="string"){let d=n.indexes.bySubcircuit.get(h)||[];d.includes(l)||(d.push(l),n.indexes.bySubcircuit.set(h,d))}}if(c.byCustomField&&n.indexes.byCustomField){for(let h of c.byCustomField)if(h in l&&h in a){let d=l[h];if(d!==void 0&&(typeof d=="string"||typeof d=="number")){let u=String(d),_=n.indexes.byCustomField.get(h),p=_.get(u)||[];p.includes(l)||(p.push(l),_.set(u,p))}}}return l},select:(s)=>{if(i==="source_component")return e.find((a)=>a.type==="source_component"&&a.name===s.replace(/\./g,""))||null;if(i==="pcb_port"||i==="source_port"||i==="schematic_port"){let[a,c]=s.replace(/\./g,"").split(/[\s\>]+/),l=e.find((d)=>d.type==="source_component"&&d.name===a);if(!l)return null;let h=e.find((d)=>d.type==="source_port"&&d.source_component_id===l.source_component_id&&(d.name===c||(d.port_hints??[]).includes(c)));if(!h)return null;if(i==="source_port")return h;if(i==="pcb_port")return e.find((d)=>d.type==="pcb_port"&&d.source_port_id===h.source_port_id)||null;if(i==="schematic_port")return e.find((d)=>d.type==="schematic_port"&&d.source_port_id===h.source_port_id)||null}return null}}}})};sFt.unparsed=sFt;var aFt=(e)=>e[`${e.type}_id`],cFt=(e,t)=>{let n=C5(e).pcb_port.get(t);if(!n)return`pcb_port[#${t}]`;let o=n.pcb_component_id?C5(e).pcb_component.get(n.pcb_component_id):void 0;if(!o)return`pcb_port[#${t}]`;let r=C5(e).source_component.get(o.source_component_id);if(!r)return`pcb_port[#${t}]`;let i=C5(e).source_port.get(n.source_port_id);if(!i)return`pcb_port[#${t}]`;let s;return s=i?.port_hints&&i.port_hints.length>0||i.port_hints&&i.port_hints.length>0?i.port_hints[0]:t,`pcb_port[.${r.name} > .${s}]`};function OAr(e,t){let n=C5(e).pcb_trace.get(t);if(!n)return`trace[${t}]`;let o=n.route.flatMap((r)=>[r.start_pcb_port_id,r.end_pcb_port_id]).filter(Boolean);if(o.length===0)return`trace[${t}]`;return`trace[${o.map((r)=>{let i=function(s){let a=C5(e).pcb_port.get(s);if(!a)return null;let c=a.pcb_component_id?C5(e).pcb_component.get(a.pcb_component_id):void 0;if(!c)return null;let l=C5(e).source_component.get(c.source_component_id);if(!l)return null;let h=C5(e).source_port.get(a.source_port_id),d=h?.port_hints?h.port_hints[1]:"";return{componentName:l.name,portHint:d}}(r);return i?`.${i.componentName} > port.${i.portHint}`:`port[${r}]`}).join(", ")}]`}var Cen=(e,t)=>{if(typeof t=="string"){let n=((o,r)=>o.find((i)=>aFt(i)===r)??null)(e,t);return Cen(e,n)}switch(t.type){case"pcb_port":return cFt(e,t.pcb_port_id);case"pcb_smtpad":return function(n,o){let r=C5(n).pcb_smtpad.get(o);return r&&r.pcb_port_id?cFt(n,r.pcb_port_id):`smtpad[${o}]`}(e,t.pcb_smtpad_id);case"pcb_trace":return OAr(e,t.pcb_trace_id);case"source_component":return`source_component[${t.name}]`;default:return`${t.type}[#${aFt(t)}]`}},xKe=(e,t)=>({minX:Math.min(e.minX,t.minX),minY:Math.min(e.minY,t.minY),maxX:Math.max(e.maxX,t.maxX),maxY:Math.max(e.maxY,t.maxY)}),Mae=(e,t,n)=>{let o=n/2;return{minX:e-o,minY:t-o,maxX:e+o,maxY:t+o}},lFt=(e,t,n,o,r)=>{let i=n/2,s=o/2,a=r*Math.PI/180,c=Math.cos(a),l=Math.sin(a),h=[{x:-i,y:-s},{x:i,y:-s},{x:i,y:s},{x:-i,y:s}].map((d)=>({x:e+d.x*c-d.y*l,y:t+d.x*l+d.y*c}));return{minX:Math.min(...h.map((d)=>d.x)),minY:Math.min(...h.map((d)=>d.y)),maxX:Math.max(...h.map((d)=>d.x)),maxY:Math.max(...h.map((d)=>d.y))}},VAr=(e,t,n,o,r)=>{let i=n/2,s=o/2,a=r*Math.PI/180,c=Math.cos(a),l=Math.sin(a),h=Math.hypot(i*c,s*l),d=Math.hypot(i*l,s*c);return{minX:e-h,minY:t-d,maxX:e+h,maxY:t+d}},YAr=(e,t,n,o,r)=>{let i=Math.min(n,o)/2,s=Math.max(n,o)/2-i,a=r*Math.PI/180,c=n>=o?{x:s,y:0}:{x:0,y:s},l={x:c.x*Math.cos(a)-c.y*Math.sin(a),y:c.x*Math.sin(a)+c.y*Math.cos(a)},h=Math.abs(l.x)+i,d=Math.abs(l.y)+i;return{minX:e-h,minY:t-d,maxX:e+h,maxY:t+d}},T4e=(e)=>e.length===0?null:{minX:Math.min(...e.map((t)=>t.x)),minY:Math.min(...e.map((t)=>t.y)),maxX:Math.max(...e.map((t)=>t.x)),maxY:Math.max(...e.map((t)=>t.y))},nXe=(e)=>Array.isArray(e)?e.flatMap((t)=>{if(!t||typeof t!="object")return[];if("x"in t&&"y"in t&&typeof t.x=="number"&&typeof t.y=="number")return[{x:t.x,y:t.y}];if("start"in t&&"end"in t)return[t.start,t.end].filter((n)=>Boolean(n&&typeof n=="object"&&"x"in n&&"y"in n&&typeof n.x=="number"&&typeof n.y=="number"));return[]}):[],GAr=(e)=>{if(!e.type.startsWith("pcb_"))return null;if(e.type==="pcb_smtpad"&&e.shape==="polygon"&&Array.isArray(e.points))return T4e(e.points);if(e.type==="pcb_hole"&&e.hole_shape==="circle")return Mae(e.x,e.y,e.hole_diameter);if(e.type==="pcb_plated_hole"){let d;if("outer_diameter"in e&&typeof e.outer_diameter=="number"?d=Mae(e.x,e.y,e.outer_diameter):("hole_diameter"in e)&&typeof e.hole_diameter=="number"&&(d=Mae(e.x,e.y,e.hole_diameter)),(e.shape==="oval"||e.shape==="pill")&&typeof e.outer_width=="number"&&typeof e.outer_height=="number")d=(e.shape==="pill"?YAr:VAr)(e.x,e.y,e.outer_width,e.outer_height,e.ccw_rotation??0);if("rect_pad_width"in e&&typeof e.rect_pad_width=="number"&&"rect_pad_height"in e&&typeof e.rect_pad_height=="number"){let u=lFt(e.x,e.y,e.rect_pad_width,e.rect_pad_height,"rect_ccw_rotation"in e?e.rect_ccw_rotation??0:0);d=d?xKe(d,u):u}if("hole_diameter"in e&&typeof e.hole_diameter=="number"){let u=Mae(e.x+("hole_offset_x"in e?e.hole_offset_x??0:0),e.y+("hole_offset_y"in e?e.hole_offset_y??0:0),e.hole_diameter);d=d?xKe(d,u):u}if(d)return d}let t=e,n=T4e(nXe(t.route));if(n)return n;let o=T4e(nXe(t.outline));if(o)return o;let r=T4e(nXe(t.points));if(r)return r;let i,s,a,c;"x"in e&&"y"in e&&(i=Number(e.x),s=Number(e.y)),"outer_diameter"in e&&(a=Number(e.outer_diameter),c=Number(e.outer_diameter)),"width"in e&&(a=Number(e.width)),"height"in e&&(c=Number(e.height)),"center"in e&&e.center&&typeof e.center=="object"&&"x"in e.center&&"y"in e.center&&(i=Number(e.center.x),s=Number(e.center.y));let l=0;if("rotation"in e&&typeof e.rotation=="number"&&(l=e.rotation),"ccw_rotation"in e&&typeof e.ccw_rotation=="number"&&(l=e.ccw_rotation),i!==void 0&&s!==void 0)return a!==void 0&&c!==void 0?l?lFt(i,s,a,c,l):{minX:i-a/2,minY:s-c/2,maxX:i+a/2,maxY:s+c/2}:("radius"in e)&&typeof e.radius=="number"?Mae(i,s,2*e.radius):{minX:i,minY:s,maxX:i,maxY:s};let h=[t.anchor_position,t.position].filter((d)=>Boolean(d&&typeof d=="object"&&"x"in d&&"y"in d&&typeof d.x=="number"&&typeof d.y=="number")).at(0);return h?{minX:h.x,minY:h.y,maxX:h.x,maxY:h.y}:null},ben=(e)=>{let t={minX:Number.POSITIVE_INFINITY,minY:Number.POSITIVE_INFINITY,maxX:Number.NEGATIVE_INFINITY,maxY:Number.NEGATIVE_INFINITY};for(let n of e){let o=GAr(n);o&&(t=xKe(t,o))}return t},mq=(e)=>e[`${e.type}_id`],DS=0.000000001,ece=(e,t,n)=>{let o=n.x-t.x,r=n.y-t.y,i=o*o+r*r;if(i<=DS)return((h,d)=>Math.hypot(h.x-d.x,h.y-d.y))(e,t);let s=(a=((e.x-t.x)*o+(e.y-t.y)*r)/i,c=0,l=1,Math.max(c,Math.min(l,a)));var a,c,l;return Math.hypot(e.x-(t.x+s*o),e.y-(t.y+s*r))},tce=(e,t,n)=>(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x),nce=(e,t,n)=>!(Math.abs(tce(t,n,e))>DS)&&(e.x>=Math.min(t.x,n.x)-DS&&e.x<=Math.max(t.x,n.x)+DS&&e.y>=Math.min(t.y,n.y)-DS&&e.y<=Math.max(t.y,n.y)+DS),UAr=(e,t,n,o)=>{let r=tce(e,t,n),i=tce(e,t,o),s=tce(n,o,e),a=tce(n,o,t);return(r>DS&&i<-0.000000001||r<-0.000000001&&i>DS)&&(s>DS&&a<-0.000000001||s<-0.000000001&&a>DS)||(nce(n,e,t)||nce(o,e,t)||nce(e,n,o)||nce(t,n,o))},C$=(e)=>{let t=[];if(e.points.length<2)return t;for(let n=0;n<e.points.length;n+=1){let o=e.points[n],r=e.points[(n+1)%e.points.length];o&&r&&t.push([o,r])}return t},CKe=(e,t)=>{for(let[o,r]of C$(t))if(nce(e,o,r))return!0;let n=!1;for(let o=0,r=t.points.length-1;o<t.points.length;r=o++){let i=t.points[o],s=t.points[r];if(!i||!s)continue;i.y>e.y!=s.y>e.y&&e.x<(s.x-i.x)*(e.y-i.y)/(s.y-i.y)+i.x&&(n=!n)}return n},hFt=(e,t)=>{if(t.points.length<3)return Number.POSITIVE_INFINITY;if(CKe({x:e.x,y:e.y},t))return 0;let n=Number.POSITIVE_INFINITY;for(let[o,r]of C$(t))n=Math.min(n,ece({x:e.x,y:e.y},o,r));return Math.max(0,n-e.radius)},bKe=(Object.keys({leftside_top:{side:"leftside",alignment:"top"},leftside_bottom:{side:"leftside",alignment:"bottom"},rightside_top:{side:"rightside",alignment:"top"},rightside_bottom:{side:"rightside",alignment:"bottom"},topside_left:{side:"topside",alignment:"left"},topside_right:{side:"topside",alignment:"right"},bottomside_left:{side:"bottomside",alignment:"left"},bottomside_right:{side:"bottomside",alignment:"right"}}),(e,t,n=0)=>{let{a:o,b:r,c:i,d:s,e:a,f:c}=W$e(DV(t.x,t.y),uUt(n*Math.PI/180));return e.transform(new HQ(o,r,i,s,a,c))}),YV=(e)=>e.orientation()===H$.CCW?e:e.reverse(),z$=(e,t)=>YV(new l6(new Uqe(new Ip(e.x,e.y),t))),oce=(e,t,n,o=0,r=0)=>{let i=t/2,s=n/2,a=Math.max(0,Math.min(o,i,s));if(a===0)return bKe(YV(new l6(new Wqe(-i,-s,i,s))),e,r);let c=[new t6(new Ip(i-a,-s+a),a,-Math.PI/2,0,!0),new t6(new Ip(i-a,s-a),a,0,Math.PI/2,!0),new t6(new Ip(-i+a,s-a),a,Math.PI/2,Math.PI,!0),new t6(new Ip(-i+a,-s+a),a,Math.PI,1.5*Math.PI,!0)],l=[];for(let h=0;h<c.length;h++){let d=c[h],u=c[(h+1)%c.length];l.push(d),d.end.distanceTo(u.start)[0]>0.000000000001&&l.push(new ZS(d.end,u.start))}return bKe(YV(new l6(l)),e,r)},dFt=(e)=>{let t=[];for(let n=0;n<e.vertices.length;n++){let o=e.vertices[n],r=e.vertices[(n+1)%e.vertices.length],i=r.x-o.x,s=r.y-o.y;if(i===0&&s===0)continue;let a=o.bulge??0;if(a===0)t.push(new ZS(new Ip(o.x,o.y),new Ip(r.x,r.y)));else{let c=(1-a*a)/(4*a),l=new Ip((o.x+r.x)/2-s*c,(o.y+r.y)/2+i*c);t.push(new t6(l,Math.hypot(i,s)*(1+a*a)/(4*Math.abs(a)),Math.atan2(o.y-l.y,o.x-l.x),Math.atan2(r.y-l.y,r.x-l.x),a>0))}}return YV(new l6(t))},rce=(e,t)=>{for(let n of t.reverse().faces)e.addFace(n.shapes);return e},WAr=(e)=>{if(e.shape==="rect")return oce(e.center,e.width,e.height,0,e.rotation);if(e.shape==="polygon")return YV(new l6(e.points.map((n)=>new Ip(n.x,n.y))));let t=dFt(e.brep_shape.outer_ring);for(let n of e.brep_shape.inner_rings)rce(t,dFt(n));return t},XAr=(e,t=0)=>{if(e.shape==="circle")return((r,i,s)=>rce(z$(r,i/2),z$(r,s/2)))(e,e.outer_diameter,e.hole_diameter);if("outer_width"in e)return rce(oce(e,e.outer_width,e.outer_height,Math.min(e.outer_width,e.outer_height)/2,e.ccw_rotation),oce(e,e.hole_width,e.hole_height,Math.min(e.hole_width,e.hole_height)/2,e.ccw_rotation));let n={x:e.x+e.hole_offset_x,y:e.y+e.hole_offset_y},o=e.shape==="hole_with_polygon_pad"?bKe(YV(new l6(e.pad_outline.map((r)=>new Ip(r.x,r.y)))),e,e.ccw_rotation??t):oce(e,e.rect_pad_width,e.rect_pad_height,e.rect_border_radius,"rect_ccw_rotation"in e?e.rect_ccw_rotation:0);if(e.shape==="circular_hole_with_rect_pad"||e.shape==="hole_with_polygon_pad"&&e.hole_shape==="circle"){if(e.hole_diameter===void 0)throw Error("Circular plated hole requires hole_diameter");return rce(o,z$(n,e.hole_diameter/2))}if(!("hole_width"in e)||e.hole_width===void 0||e.hole_height===void 0)throw Error("Slotted plated hole requires hole_width and hole_height");return rce(o,oce(n,e.hole_width,e.hole_height,Math.min(e.hole_width,e.hole_height)/2,"hole_ccw_rotation"in e?e.hole_ccw_rotation:e.shape==="hole_with_polygon_pad"?e.ccw_rotation??t:0))},uFt=(e,t,n,o=n)=>{let r=Math.hypot(t.x-e.x,t.y-e.y),i=n/2,s=o/2;if(r<=Math.abs(s-i))return z$(i>=s?e:t,Math.max(i,s));let a=Math.atan2(t.y-e.y,t.x-e.x),c=Math.acos((i-s)/r),l=new t6(new Ip(e.x,e.y),i,a+c,a-c,!0),h=new t6(new Ip(t.x,t.y),s,a-c,a+c,!0);return YV(new l6([l,new ZS(l.end,h.start),h,new ZS(h.end,l.start)]))},jAr=/\b(?:pcb|source|schematic|subcircuit)_[a-z0-9_]+\b/i,ICe=(e,t,n)=>!e||e===t||t.length>0&&e.includes(t)||jAr.test(e)?n:e,vCe=(e,t)=>{for(let n of e){let o=ICe(n,t,"");if(o)return o}return""},sle=(e,t)=>{let n=e.find((o)=>o.type==="pcb_port"&&o.pcb_port_id===t);if(n?.type==="pcb_port"){let o=e.find((a)=>a.type==="source_port"&&a.source_port_id===n.source_port_id),r=o?.type==="source_port"?e.find((a)=>a.type==="source_component"&&a.source_component_id===o.source_component_id):null,i=vCe([r?.type==="source_component"?r.name:null],r?.type==="source_component"?r.source_component_id:""),s=vCe([o?.type==="source_port"?o.name:null,o?.type==="source_port"?o.pin_number?.toString():null,o?.type==="source_port"?o.port_hints?.[0]:null],o?.type==="source_port"?o.source_port_id:"");if(i&&s)return`${i}.${s}`;if(s)return s}return"unnamed port"},av=(e,t)=>{let n=e.find((s)=>mq(s)===t);if(!n)return"unnamed element";if(n.type==="pcb_component"||n.type==="schematic_component"){let s=e.find((a)=>a.type==="source_component"&&a.source_component_id===n.source_component_id);if(s?.type==="source_component")return ICe(s.name,s.source_component_id,"unnamed component")}if((n.type==="pcb_smtpad"||n.type==="pcb_plated_hole")&&n.pcb_port_id){let s=sle(e,n.pcb_port_id);if(s!=="unnamed port")return s}if(n.type==="pcb_trace")return cV(e,t);let o={pcb_smtpad:"SMD pad",pcb_plated_hole:"through-hole pad",pcb_via:"via",pcb_hole:"hole",pcb_bend:"bend",pcb_stiffener:"stiffener",pcb_keepout:"keepout",pcb_cutout:"cutout",pcb_copper_pour:"copper pour"}[n.type]??n.type.replace(/^(pcb|source|schematic)_/,"").replaceAll("_"," "),r="name"in n?n.name:void 0,i="description"in n?n.description:void 0;return vCe([r,i,Cen(e,t)],t)||`unnamed ${o}`},cV=(e,t)=>{let n=e.find((r)=>r.type==="pcb_trace"&&r.pcb_trace_id===t);if(n?.type==="pcb_trace"&&n.source_trace_id){let r=e.find((i)=>i.type==="source_trace"&&i.source_trace_id===n.source_trace_id);if(r?.type==="source_trace")return((i,s)=>{let a=ICe(s.display_name,s.source_trace_id,"");if(a)return a;let c=[];for(let l of s.connected_source_port_ids??[]){let h=i.find((d)=>d.type==="pcb_port"&&d.source_port_id===l);if(h?.type==="pcb_port"){let d=sle(i,h.pcb_port_id);d!=="unnamed port"&&c.push(d)}else{let d=i.find((m)=>m.type==="source_port"&&m.source_port_id===l);if(d?.type!=="source_port")continue;let u=i.find((m)=>m.type==="source_component"&&m.source_component_id===d.source_component_id),_=u?.type==="source_component"?ICe(u.name,u.source_component_id,""):"",p=vCe([d.name,d.pin_number?.toString(),d.port_hints?.[0]],d.source_port_id);_&&p?c.push(`${_}.${p}`):p&&c.push(p)}if(c.length===2)return`${c[0]} to ${c[1]}`}return c.length===1?`trace connected to ${c[0]}`:"unnamed trace"})(e,r)}if(n?.type!=="pcb_trace")return"unnamed trace";let o=[...new Set(n.route.flatMap((r)=>r.route_type==="wire"?[r.start_pcb_port_id,r.end_pcb_port_id]:[]).filter((r)=>Boolean(r)))].map((r)=>sle(e,r)).filter((r)=>r!=="unnamed port");return o.length>=2?`${o[0]} to ${o[1]}`:o.length===1?`trace connected to ${o[0]}`:"unnamed trace"},Ien=(e,t)=>{let n=t*Math.PI/180;return{x:e.x*Math.cos(n)-e.y*Math.sin(n),y:e.x*Math.sin(n)+e.y*Math.cos(n)}},pFt=({x:e,y:t,width:n,height:o,ccwRotation:r})=>{let i=n/2,s=o/2;return[{x:-i,y:-s},{x:i,y:-s},{x:i,y:s},{x:-i,y:s}].map((a)=>{let c=Ien(a,r);return{x:e+c.x,y:t+c.y}})},eB=(e)=>{let t,n,o,r=0;e.type==="pcb_hole"?(t=e.hole_width,n=e.hole_height,o=Math.min(t,n)/2,e.hole_shape==="rotated_pill"&&(r=e.ccw_rotation)):e.type==="pcb_plated_hole"?(t=e.outer_width,n=e.outer_height,o=Math.min(t,n)/2,r=e.ccw_rotation):(t=e.width,n=e.height,o=e.radius,e.shape==="rotated_pill"&&(r=e.ccw_rotation));let i=Math.max(Math.max(t,n)/2-o,0),s=Ien(t>=n?{x:i,y:0}:{x:0,y:i},r);return{start:{x:e.x-s.x,y:e.y-s.y},end:{x:e.x+s.x,y:e.y+s.y},radius:o}},ale=(e)=>{if(e.type==="pcb_smtpad"){if(e.shape==="polygon")return e.points;if(e.shape==="rotated_rect")return pFt({x:e.x,y:e.y,width:e.width,height:e.height,ccwRotation:e.ccw_rotation})}if(e.type==="pcb_plated_hole"&&"rect_pad_width"in e&&"rect_pad_height"in e)return pFt({x:e.x,y:e.y,width:e.rect_pad_width,height:e.rect_pad_height,ccwRotation:"rect_ccw_rotation"in e&&typeof e.rect_ccw_rotation=="number"?e.rect_ccw_rotation:0});throw Error(`Expected polygonal pad geometry, got ${e.type} with shape "${e.shape}"`)},mFt=(e)=>e.map((t,n)=>[t,e[(n+1)%e.length]]),IKe=(e,t,n,o)=>{let r=pB(e,t,n,o);if(r)return{distance:0,pointOnA:r,pointOnB:r,center:r};let i=[{pointOnA:e,pointOnB:Vm(e,n,o)},{pointOnA:t,pointOnB:Vm(t,n,o)},{pointOnA:Vm(n,e,t),pointOnB:n},{pointOnA:Vm(o,e,t),pointOnB:o}],s=i[0],a=BS(s.pointOnA,s.pointOnB);for(let c of i.slice(1)){let l=BS(c.pointOnA,c.pointOnB);l<a&&(s=c,a=l)}return{distance:Q_(e,t,n,o),pointOnA:s.pointOnA,pointOnB:s.pointOnB,center:{x:(s.pointOnA.x+s.pointOnB.x)/2,y:(s.pointOnA.y+s.pointOnB.y)/2}}},vKe=(e,t,n)=>{if(n.length<3)return{distance:Number.POSITIVE_INFINITY,center:e,tracePoint:e,obstaclePoint:e};let o=mFt(n).map(([i,s])=>pB(e,t,i,s)).filter((i)=>i!==null);if(o.length>0){let i=t.x-e.x,s=t.y-e.y,a=i*i+s*s;return o.sort((c,l)=>((c.x-e.x)*i+(c.y-e.y)*s)/a-((l.x-e.x)*i+(l.y-e.y)*s)/a),{distance:0,center:o[0],tracePoint:o[0],obstaclePoint:o[0]}}if(Fce(e,n)||Fce(t,n)){let i={x:(e.x+t.x)/2,y:(e.y+t.y)/2};return{distance:0,center:i,tracePoint:i,obstaclePoint:i}}let r=IKe(e,t,n[0],n[1]);for(let[i,s]of mFt(n).slice(1)){let a=IKe(e,t,i,s);a.distance<r.distance&&(r=a)}return{distance:r.distance,center:r.center,tracePoint:r.pointOnA,obstaclePoint:r.pointOnB}};function _Ft(e,t){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}var gFt=0.000000001,xS=0.000000001;function KAr(e,t){let n=(e.y-t.start.y)*(t.end.x-t.start.x)-(e.x-t.start.x)*(t.end.y-t.start.y);if(Math.abs(n)>gFt)return!1;let o=(e.x-t.start.x)*(t.end.x-t.start.x)+(e.y-t.start.y)*(t.end.y-t.start.y);if(o<-0.000000001)return!1;return o<=(t.end.x-t.start.x)**2+(t.end.y-t.start.y)**2+gFt}function oXe(e,t){let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o],s=t[r];if(KAr(e,{start:i,end:s}))return!0;i.y>e.y!=s.y>e.y&&e.x<(s.x-i.x)*(e.y-i.y)/(s.y-i.y)+i.x&&(n=!n)}return n}function Hbe(e,t){if(t.type==="pcb_smtpad"){if(t.shape==="circle")return _Ft(e,t)<=t.radius+xS;if(t.shape==="rect"){let n=t.width/2,o=t.height/2;return Math.abs(e.x-t.x)<=n+xS&&Math.abs(e.y-t.y)<=o+xS}if(t.shape==="rotated_rect")return oXe(e,ale(t));if(t.shape==="pill"||t.shape==="rotated_pill"){if(t.shape==="rotated_pill"){let c=eB(t);return xc(e,c.start,c.end)<=c.radius+xS}let n=t.width/2,o=t.height/2,r=t.radius;if(Math.abs(e.x-t.x)<=n-r+xS&&Math.abs(e.y-t.y)<=o+xS)return!0;let i=Math.max(Math.abs(e.x-t.x)-(n-r),0),s=Math.max(Math.abs(e.y-t.y)-(o-r),0),a=r+xS;return i*i+s*s<=a*a}if(t.shape==="polygon")return oXe(e,t.points)}if(t.type==="pcb_plated_hole"){if(t.shape==="circle")return _Ft(e,t)<=t.outer_diameter/2+xS;if("rect_pad_width"in t&&"rect_pad_height"in t)return oXe(e,ale(t));if(t.shape==="oval"||t.shape==="pill")return Math.abs(e.x-t.x)<=t.outer_width/2+xS&&Math.abs(e.y-t.y)<=t.outer_height/2+xS}return!1}function $Q(e){return e.type==="pcb_trace_segment"||e.type==="pcb_smtpad"?[e.layer]:e.type==="pcb_plated_hole"?Array.isArray(e.layers)?e.layers:[...US]:e.type==="pcb_hole"?[...US]:e.type==="pcb_via"?Array.isArray(e.layers)?e.layers:[...US]:e.type==="pcb_keepout"&&Array.isArray(e.layers)?e.layers:[]}var ven=0.1,$Ar=0.2,Sen=0.1,qAr=0.1,JAr=0.2,SKe=0.1,AB=0.005,sY=(e)=>e.find((t)=>t.type==="pcb_board"),qQ=(e,t)=>e?.[t],Fbe=(e)=>e.type==="pcb_keepout"?e.shape==="outline"?{minX:Math.min(...e.outline.map((t)=>t.x)),minY:Math.min(...e.outline.map((t)=>t.y)),maxX:Math.max(...e.outline.map((t)=>t.x)),maxY:Math.max(...e.outline.map((t)=>t.y))}:e.shape==="circle"?{minX:e.center.x-e.radius,minY:e.center.y-e.radius,maxX:e.center.x+e.radius,maxY:e.center.y+e.radius}:{minX:e.center.x-e.width/2,minY:e.center.y-e.height/2,maxX:e.center.x+e.width/2,maxY:e.center.y+e.height/2}:ben([e]),ZAr=(e)=>{if(e.type==="pcb_keepout"&&e.shape==="circle")return e.radius;let t=Fbe(e);return Math.min(t.maxX-t.minX,t.maxY-t.minY)/2},eV=(e)=>e.type==="pcb_via"||e.shape==="circle",tV=(e)=>e.type==="pcb_smtpad"&&(e.shape==="pill"||e.shape==="rotated_pill")||e.type==="pcb_plated_hole"&&(e.shape==="oval"||e.shape==="pill"),nV=(e)=>{let t=((n)=>{if(n.type==="pcb_keepout"&&n.shape!=="outline")return n.center;let o=Fbe(n);return RV({x:o.minX,y:o.minY},{x:o.maxX,y:o.maxY})})(e);return{kind:"circle",x:t.x,y:t.y,radius:ZAr(e)}},oV=(e)=>{if(e.type==="pcb_keepout"){if(e.shape==="outline")return{kind:"polygon",points:e.outline};if(e.shape!=="rect")throw Error(`Expected rectangular keepout, got ${e.shape}`);return{kind:"polygon",points:[{x:e.center.x-e.width/2,y:e.center.y-e.height/2},{x:e.center.x+e.width/2,y:e.center.y-e.height/2},{x:e.center.x+e.width/2,y:e.center.y+e.height/2},{x:e.center.x-e.width/2,y:e.center.y+e.height/2}]}}if(e.type==="pcb_smtpad"&&(e.shape==="polygon"||e.shape==="rotated_rect"))return{kind:"polygon",points:ale(e)};if(e.type==="pcb_plated_hole"&&"rect_pad_width"in e&&"rect_pad_height"in e)return{kind:"polygon",points:ale(e)};let t=Fbe(e);return{kind:"polygon",points:[{x:t.minX,y:t.minY},{x:t.maxX,y:t.minY},{x:t.maxX,y:t.maxY},{x:t.minX,y:t.maxY}]}},PKe=(e)=>{if(e.type!=="pcb_smtpad"||e.shape!=="rect"&&e.shape!=="rotated_rect"||!e.corner_radius||e.corner_radius<=0)return null;let t=Math.min(e.corner_radius,e.width/2,e.height/2);if(t===Math.min(e.width,e.height)/2)return{core:{...e,shape:"rotated_pill",radius:t,ccw_rotation:e.shape==="rotated_rect"?e.ccw_rotation:0},radius:0};return{core:{...e,width:e.width-2*t,height:e.height-2*t,corner_radius:0},radius:t}},BJe=(e,t)=>{let n=PKe(e),o=PKe(t);if(n||o)return BJe(n?.core??e,o?.core??t)-(n?.radius??0)-(o?.radius??0);if(tV(e)&&tV(t)){let s=eB(e),a=eB(t);return Q_(s.start,s.end,a.start,a.end)-s.radius-a.radius}if(tV(e)&&eV(t)){let s=eB(e);return XQ(s.start,s.end,nV(t))-s.radius}if(eV(e)&&tV(t)){let s=eB(t);return XQ(s.start,s.end,nV(e))-s.radius}if(tV(e)){let s=eB(e);return vKe(s.start,s.end,oV(t).points).distance-s.radius}if(tV(t)){let s=eB(t);return vKe(s.start,s.end,oV(e).points).distance-s.radius}return eV(e)&&eV(t)?(r=nV(e),i=nV(t),Math.max(0,Math.hypot(r.x-i.x,r.y-i.y)-r.radius-i.radius)):eV(e)?hFt(nV(e),oV(t)):eV(t)?hFt(nV(t),oV(e)):((s,a)=>{if(s.points.length<3||a.points.length<3)return Number.POSITIVE_INFINITY;for(let[d,u]of C$(s))for(let[_,p]of C$(a))if(UAr(d,u,_,p))return 0;let c=s.points[0],l=a.points[0];if(c&&CKe(c,a)||l&&CKe(l,s))return 0;let h=Number.POSITIVE_INFINITY;for(let[d,u]of C$(s))for(let[_,p]of C$(a))h=Math.min(h,ece(d,_,p),ece(u,_,p),ece(_,d,u),ece(p,d,u));return h})(oV(e),oV(t));var r,i},Pen=(e)=>[...Kb(e).pcb_smtpad.list(),...Kb(e).pcb_plated_hole.list()],Een=(e)=>Kb(e).pcb_trace.list().flatMap((t)=>{let n=[];for(let o=0;o<t.route.length-1;o++){let r=t.route[o],i=t.route[o+1];r.route_type==="wire"&&(i.route_type==="wire"&&r.layer===i.layer&&n.push({type:"pcb_trace_segment",pcb_trace_id:t.pcb_trace_id,_pcbTrace:t,thickness:"width"in r?r.width:("width"in i)?i.width:SKe,layer:r.layer,x1:r.x,y1:r.y,x2:i.x,y2:i.y}))}return n}),rXe=({tracePoint:e,obstaclePoint:t,traceRadius:n,obstacleRadius:o})=>{let r=t.x-e.x,i=t.y-e.y,s=Math.hypot(r,i);if(s===0)return RV(e,t);let a=r/s,c=i/s;if(s<=n+o){let l=(Math.max(-n,s-o)+Math.min(n,s+o))/2;return{x:e.x+a*l,y:e.y+c*l}}return RV({x:e.x+a*n,y:e.y+c*n},{x:t.x-a*o,y:t.y-c*o})},TJe=(e,t)=>{let n=PKe(t);n&&(t=n.core);let o=n?.radius??0,r={x:e.x1,y:e.y1},i={x:e.x2,y:e.y2},s=e.thickness/2;if(t.type==="pcb_via"||eV(t)){let c=t.type==="pcb_via"?{x:t.x,y:t.y,radius:t.outer_diameter/2}:nV(t),l=Vm(c,r,i);return{gap:XQ(r,i,c)-s,center:rXe({tracePoint:l,obstaclePoint:c,traceRadius:s,obstacleRadius:c.radius})}}if(tV(t)){let c=((l,h)=>{let d=eB(h),u=IKe({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},d.start,d.end);return{distance:u.distance,center:u.center,radius:d.radius,tracePoint:u.pointOnA,obstaclePoint:u.pointOnB}})(e,t);return{gap:c.distance-s-c.radius,center:rXe({tracePoint:c.tracePoint,obstaclePoint:c.obstaclePoint,traceRadius:s,obstacleRadius:c.radius})}}let a=vKe(r,i,oV(t).points);return{gap:a.distance-s-o,center:rXe({tracePoint:a.tracePoint,obstaclePoint:a.obstaclePoint,traceRadius:s,obstacleRadius:o})}},O$=(e)=>e<=0,iXe=(e,t)=>{let n={x:e.x1,y:e.y1},o={x:e.x2,y:e.y2},r={x:t.x1,y:t.y1},i={x:t.x2,y:t.y2},s={x:o.x-n.x,y:o.y-n.y},a={x:i.x-r.x,y:i.y-r.y},c=s.x*s.x+s.y*s.y,l=a.x*a.x+a.y*a.y;if(c===0||l===0){if(c===0&&l===0)return{x:(n.x+r.x)/2,y:(n.y+r.y)/2};if(c===0){let T=MS(((n.x-r.x)*a.x+(n.y-r.y)*a.y)/l,0,1),N={x:r.x+T*a.x,y:r.y+T*a.y};return{x:(n.x+N.x)/2,y:(n.y+N.y)/2}}let M=MS(((r.x-n.x)*s.x+(r.y-n.y)*s.y)/c,0,1),B={x:n.x+M*s.x,y:n.y+M*s.y};return{x:(B.x+r.x)/2,y:(B.y+r.y)/2}}let h=n.x-r.x,d=n.y-r.y,u=s.x*s.x+s.y*s.y,_=s.x*a.x+s.y*a.y,p=s.x*h+s.y*d,m=a.x*a.x+a.y*a.y,A=a.x*h+a.y*d,g=u*m-_*_;if(g<0.0000000001)return efr(n,o,r,i,s,a,c,l);let f=(_*A-m*p)/g,y=(u*A-_*p)/g;f=MS(f,0,1),y=MS(y,0,1),y=(f*_+A)/m,y=MS(y,0,1),f=(y*_-p)/u,f=MS(f,0,1);let x=n.x+f*s.x,C=n.y+f*s.y,b=r.x+y*a.x,I=r.y+y*a.y,v=x-b,P=C-I;return Math.sqrt(v*v+P*P),{x:(x+b)/2,y:(C+I)/2}},efr=(e,t,n,o,r,i,s,a)=>{let c=((n.x-e.x)*r.x+(n.y-e.y)*r.y)/s;c=MS(c,0,1);let l={x:e.x+c*r.x,y:e.y+c*r.y},h=((o.x-e.x)*r.x+(o.y-e.y)*r.y)/s;h=MS(h,0,1);let d={x:e.x+h*r.x,y:e.y+h*r.y},u=((e.x-n.x)*i.x+(e.y-n.y)*i.y)/a;u=MS(u,0,1);let _={x:n.x+u*i.x,y:n.y+u*i.y},p=((t.x-n.x)*i.x+(t.y-n.y)*i.y)/a;p=MS(p,0,1);let m={x:n.x+p*i.x,y:n.y+p*i.y},A=[{pointA:l,pointB:n,distance:Math.sqrt((l.x-n.x)**2+(l.y-n.y)**2)},{pointA:d,pointB:o,distance:Math.sqrt((d.x-o.x)**2+(d.y-o.y)**2)},{pointA:e,pointB:_,distance:Math.sqrt((e.x-_.x)**2+(e.y-_.y)**2)},{pointA:t,pointB:m,distance:Math.sqrt((t.x-m.x)**2+(t.y-m.y)**2)}].reduce((g,f)=>f.distance<g.distance?f:g);return{x:(A.pointA.x+A.pointB.x)/2,y:(A.pointA.y+A.pointB.y)/2}},MS=(e,t,n)=>Math.max(t,Math.min(n,e));function EKe(e){return e.route_type!=="wire"?[]:[e.start_pcb_port_id,e.end_pcb_port_id].filter((t)=>Boolean(t))}function tfr(e){let t=new Set;for(let n of e.route)for(let o of EKe(n))t.add(o);return Array.from(t)}function wae(e){let t=new Set;for(let n of e)for(let o of tfr(n))t.add(o);return Array.from(t)}var TQ=0.000000001,Z9=(e)=>new Ip(e.x,e.y);function uB(e,t){if(!Number.isFinite(e)||e<=0)throw Error(`${t} must be finite and positive`);return e}function Jy(e,t){return uB(t,"radius"),new l6(new Uqe(Z9(e),t))}function N3(e){let t=e.filter((r,i)=>i===0||Z9(r).distanceTo(Z9(e[i-1]))[0]>TQ);if(t.length>1&&Z9(t[0]).distanceTo(Z9(t.at(-1)))[0]<=TQ&&t.pop(),t.length<2)throw Error("A ring needs at least two distinct vertices");let n=t.map((r,i)=>{let s=t[(i+1)%t.length];if(![r.x,r.y,r.bulge??0].every(Number.isFinite))throw Error("Non-finite ring vertex");let a=r.bulge??0;if(Math.abs(a)<=TQ)return new ZS(Z9(r),Z9(s));let c=s.x-r.x,l=s.y-r.y,h=Math.hypot(c,l),d=h*(1-a*a)/(4*a),u=new Ip((r.x+s.x)/2-l/h*d,(r.y+s.y)/2+c/h*d);return new t6(u,h*(1+a*a)/(4*Math.abs(a)),Math.atan2(r.y-u.y,r.x-u.x),Math.atan2(s.y-u.y,s.x-u.x),a>0)}),o=new l6;if(o.addFace(n),o.area()<=TQ)throw Error("A ring must enclose a non-zero area");return o}function x1(e,t,n,o=0,r=0){if(uB(t,"width"),uB(n,"height"),!Number.isFinite(o)||!Number.isFinite(r)||r<0)throw Error("Invalid rectangle rotation or corner radius");let i=Math.min(r,t/2,n/2),s=t/2,a=n/2,c;if(i<=TQ)c=N3([{x:-s,y:-a},{x:s,y:-a},{x:s,y:a},{x:-s,y:a}]);else{let l=[new Ip(s-i,-a+i),new Ip(s-i,a-i),new Ip(-s+i,a-i),new Ip(-s+i,-a+i)],h=[];for(let d=0;d<4;d++){let u=-Math.PI/2+d*Math.PI/2,_=new t6(l[d],i,u,u+Math.PI/2,!0),p=l[(d+1)%4],m=new Ip(p.x+i*Math.cos(u+Math.PI/2),p.y+i*Math.sin(u+Math.PI/2));h.push(_),_.end.distanceTo(m)[0]>TQ&&h.push(new ZS(_.end,m))}c=new l6,c.addFace(h)}return c.rotate(o*Math.PI/180).translate(new Pbe(e.x,e.y))}function MKe(e,t,n,o=n){let r=uB(n,"trace width")/2,i=uB(o,"trace width")/2,s=Z9(e).distanceTo(Z9(t))[0];if(s<=Math.abs(r-i)+TQ)return Jy(r>=i?e:t,Math.max(r,i));let a=Math.atan2(t.y-e.y,t.x-e.x),c=Math.acos((r-i)/s),l=a-c,h=a+c,d=(_,p,m)=>new Ip(_.x+p*Math.cos(m),_.y+p*Math.sin(m)),u=new l6;return u.addFace([new ZS(d(e,r,l),d(t,i,l)),new t6(Z9(t),i,l,h,!0),new ZS(d(t,i,h),d(e,r,h)),new t6(Z9(e),r,h,l,!0)]),u}function SCe(e,t){let n=e.clone(),o=[...n.faces][0].orientation();for(let r of t){let i=r.clone();[...i.faces][0].orientation()===o&&i.reverse();for(let s of i.faces)n.addFace(s.shapes)}return n}function O3e(e,t,n,o=0,r=0.001){if(uB(t,"ellipse width"),uB(n,"ellipse height"),uB(r,"curveTolerance"),Math.abs(t-n)<TQ)return Jy(e,t/2);let i=Math.max(t,n)/2,s=Math.max(16,Math.ceil(Math.PI/Math.acos(Math.max(-1,1-r/i))));if(s>1e5)throw Error("curveTolerance requires more than 100000 ellipse segments");return N3(Array.from({length:s},(a,c)=>({x:t/2*Math.cos(2*c*Math.PI/s),y:n/2*Math.sin(2*c*Math.PI/s)}))).rotate(o*Math.PI/180).translate(new Pbe(e.x,e.y))}function Ice(e,t){if(!e.length)return[];let n=e.map((o)=>t.indexOf(o));if(n.some((o)=>o<0))throw Error(`Layer is missing from copperLayers: ${e.join(", ")}`);return t.slice(Math.min(...n),Math.max(...n)+1)}function nfr(e){switch(e.shape){case"circle":return Jy(e,e.radius);case"polygon":return N3(e.points);case"rect":case"rotated_rect":return x1(e,e.width,e.height,"ccw_rotation"in e?e.ccw_rotation:0,e.rect_border_radius??e.corner_radius??0);case"pill":case"rotated_pill":return x1(e,e.width,e.height,"ccw_rotation"in e?e.ccw_rotation:0,e.radius)}}function ofr(e,t){switch(e.hole_shape){case"circle":return Jy(e,e.hole_diameter/2);case"square":return x1(e,e.hole_diameter,e.hole_diameter);case"rect":return x1(e,e.hole_width,e.hole_height);case"oval":return O3e(e,e.hole_width,e.hole_height,0,t);case"pill":case"rotated_pill":return x1(e,e.hole_width,e.hole_height,"ccw_rotation"in e?e.ccw_rotation:0,Math.min(e.hole_width,e.hole_height)/2)}}function rfr(e,t,n,o){let r,i,s={x:e.x+("hole_offset_x"in e?e.hole_offset_x??0:0),y:e.y+("hole_offset_y"in e?e.hole_offset_y??0:0)};switch(e.shape){case"circle":r=Jy(e,e.outer_diameter/2),i=Jy(e,e.hole_diameter/2);break;case"oval":r=O3e(e,e.outer_width,e.outer_height,e.ccw_rotation,o),i=O3e(e,e.hole_width,e.hole_height,e.ccw_rotation,o);break;case"pill":r=x1(e,e.outer_width,e.outer_height,e.ccw_rotation,Math.min(e.outer_width,e.outer_height)/2),i=x1(e,e.hole_width,e.hole_height,e.ccw_rotation,Math.min(e.hole_width,e.hole_height)/2);break;case"circular_hole_with_rect_pad":case"pill_hole_with_rect_pad":case"rotated_pill_hole_with_rect_pad":r=x1(e,e.rect_pad_width,e.rect_pad_height,"rect_ccw_rotation"in e?e.rect_ccw_rotation:0,e.rect_border_radius??0),i=e.shape==="circular_hole_with_rect_pad"?Jy(s,e.hole_diameter/2):x1(s,e.hole_width,e.hole_height,"hole_ccw_rotation"in e?e.hole_ccw_rotation:0,Math.min(e.hole_width,e.hole_height)/2);break;case"hole_with_polygon_pad":{let a=e.ccw_rotation??t;r=N3(e.pad_outline).rotate(a*Math.PI/180).translate(new Pbe(e.x,e.y)),i=e.hole_shape==="circle"?Jy(s,e.hole_diameter/2):e.hole_shape==="oval"?O3e(s,e.hole_width,e.hole_height,a,o):x1(s,e.hole_width,e.hole_height,a,Math.min(e.hole_width,e.hole_height)/2);break}}return n?SCe(r,[i]):r}var sXe=(e,t)=>e.x===t.x&&e.y===t.y,AFt=(e,t)=>{let n=Math.hypot(e,t);return n?{x:e/n,y:t/n}:{x:1,y:0}};function ifr(e,t){try{return lKe.subtract(e,t)}catch(n){if(!(n instanceof Error)||n.message!=="Unresolved boundary conflict in boolean operation")throw n;let o=new HQ(1000,0,0,1000,0,0),r=new HQ(0.001,0,0,0.001,0,0);return lKe.subtract(e.transform(o),t.transform(o)).transform(r)}}function sfr(e,t,n){let o=new Map,r=new Map,i=[],s=(a,c)=>o.set(a,[...o.get(a)??[],c]);for(let a of e.route){if(a.route_type==="via"){let c=a,l=a.outer_diameter??c.via_diameter;if(l===void 0)continue;let h=a.hole_diameter??c.via_hole_diameter,d=Jy(a,l/2),u=n&&h?Jy(a,h/2):void 0;for(let _ of Ice([a.from_layer,a.to_layer],t))s(_,u?SCe(d,[u]):d),u&&r.set(_,[...r.get(_)??[],u])}if(a.route_type==="through_pad")for(let c of new Set([a.start_layer,a.end_layer]))s(c,MKe(a.start,a.end,a.width))}for(let a=0;a<e.route.length-1;a++){let c=e.route[a],l=e.route[a+1],h=c.route_type==="through_pad"?c.end:c,d=l.route_type==="through_pad"?l.start:l;if(sXe(h,d))continue;let u=c.route_type==="wire"?[c.layer]:c.route_type==="via"?Ice([c.from_layer,c.to_layer],t):[c.end_layer],_=l.route_type==="wire"?[l.layer]:l.route_type==="via"?Ice([l.from_layer,l.to_layer],t):[l.start_layer],p=u.filter((g)=>_.includes(g));if(p.length!==1)throw Error(`Cannot determine one wire layer between route points ${a} and ${a+1}`);let m=p[0],A="width"in c?c.width:("width"in l)?l.width:void 0;A===void 0||sXe(h,d)||i.push({start:h,end:d,layer:m,startWidth:A,endWidth:"width"in l?l.width:A})}if(e.route_thickness_mode==="interpolated"){let a=[],c=()=>{a.length&&(s(a[0].layer,function(l){let h=[{...l[0].start,width:l[0].startWidth},...l.map((p)=>({...p.end,width:p.endWidth}))],d=l.map((p)=>AFt(p.end.x-p.start.x,p.end.y-p.start.y)),u=[],_=[];for(let p=0;p<h.length;p++){let m=h[p];uB(m.width,"interpolated trace width");let A=d[Math.max(0,p-1)],g=d[Math.min(p,d.length-1)],f=AFt(A.x+g.x,A.y+g.y),y=-f.y*m.width/2,x=f.x*m.width/2;u.push({x:m.x+y,y:m.y+x}),_.push({x:m.x-y,y:m.y-x})}return N3([...u,..._.reverse()])}(a)),a=[])};for(let l of i){let h=a.at(-1);!h||h.layer===l.layer&&sXe(h.end,l.start)&&h.endWidth===l.startWidth||c(),a.push(l)}c()}else for(let a of i)s(a.layer,MKe(a.start,a.end,a.startWidth));for(let[a,c]of r)o.set(a,o.get(a).map((l)=>c.reduce((h,d)=>ifr(h,d),l)).filter((l)=>l.faces.size>0));return o}var afr=["pcb_board","pcb_smtpad","pcb_plated_hole","pcb_hole","pcb_via","pcb_trace","pcb_copper_pour","pcb_cutout","pcb_keepout","pcb_courtyard_rect","pcb_courtyard_circle","pcb_courtyard_pill","pcb_courtyard_polygon","pcb_courtyard_outline"];function cfr(e){switch(e.shape){case"circle":return[Jy(e.center,e.radius)];case"rect":return[x1(e.center,e.width,e.height,e.rotation,e.corner_radius)];case"polygon":return[N3(e.points)];case"path":if(e.slot_length!==void 0||e.space_between_slots!==void 0||e.slot_corner_radius!==void 0)throw Error("Patterned/custom-corner path cutouts are not supported; use explicit rect/polygon cutouts");return e.route.slice(1).map((t,n)=>MKe(e.route[n],t,e.slot_width))}}function lfr(e,t={}){if(t.layer&&t.layers)throw Error("Specify layer or layers, not both");let n=t.layer?[t.layer]:t.layers,o=function(c,l){if(l.copperLayers){if(!l.copperLayers.length||new Set(l.copperLayers).size!==l.copperLayers.length)throw Error("copperLayers must be a non-empty list without duplicates");return[...l.copperLayers]}let d=c.find((u)=>u.type==="pcb_board")?.num_layers??2;for(let u of c){let _="layers"in u?u.layers:("layer"in u)?[u.layer]:[];if(Array.isArray(_))for(let p of _){let m=typeof p=="string"&&/^inner(\d+)$/.exec(p);m&&(d=Math.max(d,Number(m[1])+2))}if(u.type==="pcb_trace")for(let p of u.route)for(let m of p.route_type==="wire"?[p.layer]:p.route_type==="via"?[p.from_layer,p.to_layer]:[p.start_layer,p.end_layer]){let A=/^inner(\d+)$/.exec(m);A&&(d=Math.max(d,Number(A[1])+2))}}if(!Number.isInteger(d)||d<1||d>10)throw Error("Supported copper layer count is 1–10");return d===1?["top"]:["top",...Array.from({length:d-2},(u,_)=>`inner${_+1}`),"bottom"]}(e,t),r={elements:[],warnings:[],bounds:void 0,copperLayers:o},i=new Map(e.filter((c)=>c.type==="pcb_component").map((c)=>[c.pcb_component_id,c.rotation])),s=t.curveTolerance??0.001;if(!Number.isFinite(s)||s<=0)throw Error("curveTolerance must be finite and positive");let a=t.includeDrillHoles!==!1;for(let c of e){if(!afr.includes(c.type))continue;let l=c[`${c.type}_id`];if(t.elementTypes&&!t.elementTypes.includes(c.type))continue;if(t.elementIds&&!t.elementIds.includes(l))continue;let h,d="copper",u=[null],_=[];try{switch(c.type){case"pcb_smtpad":u=[c.layer],_=[nfr(c)];break;case"pcb_plated_hole":u=Ice(c.layers,o),_=[rfr(c,i.get(c.pcb_component_id??"")??0,a,s)];break;case"pcb_via":{u=Ice(c.layers,o);let m=Jy(c,c.outer_diameter/2);_=[a?SCe(m,[Jy(c,c.hole_diameter/2)]):m];break}case"pcb_trace":h=sfr(c,o,a),u=[...h.keys()];break;case"pcb_copper_pour":u=[c.layer],_=[c.shape==="rect"?x1(c.center,c.width,c.height,c.rotation):c.shape==="polygon"?N3(c.points):SCe(N3(c.brep_shape.outer_ring.vertices),c.brep_shape.inner_rings.map((m)=>N3(m.vertices)))];break;case"pcb_board":d="board",_=[c.outline?.length?N3(c.outline):x1(c.center,c.width,c.height)];break;case"pcb_hole":d="drill",_=[ofr(c,s)];break;case"pcb_cutout":d="cutout",_=cfr(c);break;case"pcb_keepout":d="keepout",u=c.layers,_=[c.shape==="circle"?Jy(c.center,c.radius):c.shape==="rect"?x1(c.center,c.width,c.height):N3(c.outline)];break;case"pcb_courtyard_rect":d="courtyard",u=[c.layer],_=[x1(c.center,c.width,c.height,c.ccw_rotation)];break;case"pcb_courtyard_circle":d="courtyard",u=[c.layer],_=[Jy(c.center,c.radius)];break;case"pcb_courtyard_pill":d="courtyard",u=[c.layer],_=[x1(c.center,c.width,c.height,0,c.radius)];break;case"pcb_courtyard_polygon":d="courtyard",u=[c.layer],_=[N3(c.points)];break;case"pcb_courtyard_outline":d="courtyard",u=[c.layer],_=[N3(c.outline)]}if(t.roles&&!t.roles.includes(d))continue;let p=[];for(let m of new Set(u)){if(m===null?t.includeLayerless===!1:n&&!n.includes(m))continue;let A=h?.get(m)??_;if(!A.length)continue;let g=A.reduce((y,x)=>y.merge(x.box),A[0].box);if(![g.xmin,g.ymin,g.xmax,g.ymax].every(Number.isFinite))throw Error("Non-finite geometry bounds");let f={elementId:l,elementType:c.type,sourceElement:c,role:d,layer:m,shapes:A,bounds:g};p.push(f)}for(let m of p)r.elements.push(m),r.bounds=r.bounds?r.bounds.merge(m.bounds):m.bounds}catch(p){let m=p instanceof Error?p.message:String(p);if(t.strict)throw Error(`${l}: ${m}`);r.warnings.push({elementId:l,elementType:c.type,message:m})}}return r}var D4e=0.000000001;function fFt(e){let t=new Map(e.filter((a)=>a.type==="pcb_port").map((a)=>[a.pcb_port_id,a])),n=e.filter((a)=>a.type==="pcb_smtpad"||a.type==="pcb_plated_hole"),o=new Map;for(let a of n){if(!a.pcb_port_id)continue;let c=o.get(a.pcb_port_id)??[];c.push(a),o.set(a.pcb_port_id,c)}let r=e.filter((a)=>a.type==="pcb_via"),i,s=(a)=>{let c=o.get(a.pcb_port_id);return c?.length?[...new Set(c.flatMap($Q))]:a.layers};return{ports:t,layersForPort:s,canConnect:(a,c)=>{let l=t.get(c);if(!l)return!0;let h=s(l);if(h.includes(a.layer))return!0;let d=o.get(c)??[];return(()=>{if(i)return i;i=r.map((p)=>({...p,diameter:p.outer_diameter}));let u=e.find((p)=>p.type==="pcb_board"),_=["top",...US.filter((p)=>p.startsWith("inner")).slice(0,u?Math.max(0,u.num_layers-2):void 0),...u?.num_layers===1?[]:["bottom"]];for(let p of e)if(p.type==="pcb_trace")for(let m of p.route){if(m.route_type!=="via")continue;if(r.some((f)=>Math.hypot(f.x-m.x,f.y-m.y)<=D4e))continue;let A=_.indexOf(m.from_layer),g=_.indexOf(m.to_layer);A<0||g<0||i.push({...m,layers:_.slice(Math.min(A,g),Math.max(A,g)+1),diameter:m.outer_diameter})}return i})().some((u)=>{if(!u.layers.includes(a.layer)||!h.some((p)=>u.layers.includes(p)))return!1;if(u.diameter!==void 0&&(!Number.isFinite(u.diameter)||u.diameter<=0))return!1;let _=u.diameter===void 0?0:u.diameter/2+a.width/2;return!(Math.hypot(a.x-u.x,a.y-u.y)>_+D4e)&&(d.length===0?Math.hypot(l.x-u.x,l.y-u.y)<=D4e:d.some((p)=>!!$Q(p).some((m)=>u.layers.includes(m))&&(u.diameter===void 0?Hbe(u,p):BJe({type:"pcb_via",pcb_via_id:"layer-contact",x:u.x,y:u.y,outer_diameter:u.diameter,hole_diameter:0,layers:u.layers},p)<=D4e)))})}}}function hfr(e){if(!e.some((p)=>p.type==="pcb_via"||p.type==="pcb_plated_hole"||p.type==="pcb_copper_pour"||p.type==="pcb_trace"&&p.route.some((m)=>m.route_type==="via")))return[];let t=[],n=[],o=1e6,r=0.0000001*o,i=function(p){let m=new WeakMap,A=(g)=>{let f=m.get(g);return f||(f={box:g.box,facePoints:[...g.faces].map((y)=>y.first.start),edges:[...g.edges].map((y)=>y.shape),edgeIndex:g.edges},m.set(g,f)),f};return(g,f)=>{if(g.isEmpty()||f.isEmpty())return!1;let y=A(g),x=A(f);if(y.box.xmin>x.box.xmax+p||y.box.xmax<x.box.xmin-p||y.box.ymin>x.box.ymax+p||y.box.ymax<x.box.ymin-p)return!1;if(y.facePoints.some((I)=>x.box.contains(I)&&f.contains(I))||x.facePoints.some((I)=>y.box.contains(I)&&g.contains(I)))return!0;let[C,b]=y.edges.length<=x.edges.length?[y,x]:[x,y];for(let I of C.edges){let v=I.box,P=new Wqe(v.xmin-p,v.ymin-p,v.xmax+p,v.ymax+p),M=b.edgeIndex.search(P);for(let B of M)if(I.distanceTo(B.shape)[0]<=p)return!0}return!1}}(r),s=(p,m,A,g=!1,f=!1)=>{if(!A.isEmpty()){let y=A.scale(o,o);t.push({id:p,layers:m,geometry:{polygon:y},box:y.box,bridges:g,platedPort:f})}},a=new Map,c=(p)=>{if("polygon"in p.geometry)return p.geometry.polygon;let m=a.get(p);if(!m){let{start:A,end:g}=p.geometry;m=uFt(A,g,A.width).scale(o,o),a.set(p,m)}return m},l=e.filter((p)=>p.type==="pcb_via"),h=new Map(e.filter((p)=>p.type==="pcb_component").map((p)=>[p.pcb_component_id,p])),d=e.find((p)=>p.type==="pcb_board"),u=["top",...US.filter((p)=>p.startsWith("inner")).slice(0,d?Math.max(0,d.num_layers-2):void 0),...d?.num_layers===1?[]:["bottom"]];for(let p of e)if(p.type==="pcb_via")s(p.pcb_via_id,p.layers,z$(p,p.outer_diameter/2),!0),p.pcb_trace_id&&n.push([p.pcb_via_id,p.pcb_trace_id]);else if(p.type==="pcb_plated_hole"){if(!p.pcb_port_id)continue;let m={...p,hole_offset_x:"hole_offset_x"in p?p.hole_offset_x??0:0,hole_offset_y:"hole_offset_y"in p?p.hole_offset_y??0:0};s(p.pcb_port_id,p.layers,XAr(m,p.pcb_component_id?h.get(p.pcb_component_id)?.rotation:0),!0,!0)}else if(p.type==="pcb_copper_pour")s(p.pcb_copper_pour_id,[p.layer],WAr(p),!0);else if(p.type==="pcb_trace"){if(p.route_thickness_mode==="interpolated")continue;for(let m=0;m<p.route.length;m++){let A=p.route[m],g=p.route[m+1];if(A.route_type!=="wire"||g?.route_type!=="wire"||A.layer!==g.layer||A.x===g.x&&A.y===g.y){if(A.route_type==="via"){if(l.some((C)=>C.pcb_trace_id===p.pcb_trace_id&&Math.hypot(C.x-A.x,C.y-A.y)<0.000000001))continue;let f=u.indexOf(A.from_layer),y=u.indexOf(A.to_layer);if(f<0||y<0||!A.outer_diameter)continue;let x={type:"pcb_via",pcb_via_id:`${p.pcb_trace_id}_via_${m}`,x:A.x,y:A.y,outer_diameter:A.outer_diameter,hole_diameter:0,layers:u.slice(Math.min(f,y),Math.max(f,y)+1)};s(p.pcb_trace_id,x.layers,z$(x,x.outer_diameter/2),!0)}}else if(A.width>0){let f=A.width/2;t.push({id:p.pcb_trace_id,layers:[A.layer],geometry:{start:A,end:g},box:{xmin:(Math.min(A.x,g.x)-f)*o,ymin:(Math.min(A.y,g.y)-f)*o,xmax:(Math.max(A.x,g.x)+f)*o,ymax:(Math.max(A.y,g.y)+f)*o},bridges:!1,platedPort:!1})}else s(p.pcb_trace_id,[A.layer],uFt(A,g,A.width))}}if(!t.length)return n;let _=new R_(t.length);for(let{box:p}of t)_.add(p.xmin,p.ymin,p.xmax,p.ymax);_.finish();for(let[p,m]of t.entries()){if(!m.bridges)continue;let A=m.box;for(let g of _.search(A.xmin-r,A.ymin-r,A.xmax+r,A.ymax+r)){let f=t[g];m.platedPort&&f.bridges||f.platedPort&&m.bridges||p===g||m.id===f.id||f.bridges&&g<p||!m.layers.some((y)=>f.layers.includes(y))||i(c(m),c(f))&&n.push([m.id,f.id])}}return n}function yFt(e,t,n,o){return Math.sqrt((n-e)**2+(o-t)**2)}var Men=(e)=>lfr(e.filter((t)=>t.type==="pcb_hole"),{elementTypes:["pcb_hole"],strict:!0,curveTolerance:0.000001}).elements,wen=(e,t)=>{let n=t.sourceElement;if(n.type!=="pcb_hole")throw Error("Expected hole geometry");let o=new Ip(e.x1,e.y1),r=new Ip(e.x2,e.y2),i=1/0,s=Vm(n,o,r);if(n.hole_shape==="circle")i=xc(n,o,r)-n.hole_diameter/2;else{let a=new ZS(o,r);for(let c of t.shapes){let[l,h]=c.distanceTo(a),d=c.contains(o)||c.contains(r)?0:l;d<i&&(i=d,s=h.end)}}return{gap:i-e.thickness/2,center:s}},DJe=class{buckets;objectsById;getBounds;getId;CELL_SIZE=0.4;constructor({objects:e,getBounds:t,getId:n,CELL_SIZE:o}){this.buckets=new Map,this.objectsById=new Map,this.getBounds=t,this.getId=n??(()=>this._getNextId()),this.CELL_SIZE=o??this.CELL_SIZE;for(let r of e)this.addObject(r)}_idCounter=0;_getNextId(){return""+this._idCounter++}addObject(e){let t=this.getBounds(e),n=this.getId(e),o={...e,spatialIndexId:n};this.objectsById.set(n,o);let r=Math.floor(t.minX/this.CELL_SIZE),i=Math.floor(t.minY/this.CELL_SIZE),s=Math.floor(t.maxX/this.CELL_SIZE),a=Math.floor(t.maxY/this.CELL_SIZE);for(let c=r;c<=s;c++)for(let l=i;l<=a;l++){let h=`${c}x${l}`,d=this.buckets.get(h);d?d.push(o):this.buckets.set(h,[o])}}removeObject(e){let t=this.objectsById.get(e);if(!t)return!1;this.objectsById.delete(e);let n=this.getBounds(t),o=Math.floor(n.minX/this.CELL_SIZE),r=Math.floor(n.minY/this.CELL_SIZE),i=Math.floor(n.maxX/this.CELL_SIZE),s=Math.floor(n.maxY/this.CELL_SIZE);for(let a=o;a<=i;a++)for(let c=r;c<=s;c++){let l=`${a}x${c}`,h=this.buckets.get(l);if(h){let d=h.findIndex((u)=>u.spatialIndexId===e);d!==-1&&(h.splice(d,1),h.length===0&&this.buckets.delete(l))}}return!0}getBucketKey(e,t){return`${Math.floor(e/this.CELL_SIZE)}x${Math.floor(t/this.CELL_SIZE)}`}getObjectsInBounds(e,t=0){let n=[],o=new Set,r=Math.floor((e.minX-t)/this.CELL_SIZE),i=Math.floor((e.minY-t)/this.CELL_SIZE),s=Math.floor((e.maxX+t)/this.CELL_SIZE),a=Math.floor((e.maxY+t)/this.CELL_SIZE);for(let c=r;c<=s;c++)for(let l=i;l<=a;l++){let h=`${c}x${l}`,d=this.buckets.get(h)||[];for(let u of d){let _=u.spatialIndexId;o.has(_)||(o.add(_),n.push(u))}}return n}},xFt=(e,t)=>{let n={x:e.x1,y:e.y1},o={x:e.x2,y:e.y2},{minX:r,minY:i,maxX:s,maxY:a}=t;if(n.x===o.x&&n.y===o.y){let v=Math.max(r,Math.min(s,n.x)),P=Math.max(i,Math.min(a,n.y));return v===n.x&&P===n.y?{x:n.x,y:n.y}:{x:v,y:P}}let c=o.x-n.x,l=o.y-n.y,h=c!==0?(r-n.x)/c:Number.NEGATIVE_INFINITY,d=c!==0?(s-n.x)/c:Number.POSITIVE_INFINITY,u=l!==0?(i-n.y)/l:Number.NEGATIVE_INFINITY,_=l!==0?(a-n.y)/l:Number.POSITIVE_INFINITY,p=Math.max(Math.min(h,d),Math.min(u,_)),m=Math.min(Math.max(h,d),Math.max(u,_));if(p<=m&&m>=0&&p<=1){let v=Math.max(0,Math.min(1,p));return{x:n.x+v*c,y:n.y+v*l}}let A={x:Math.max(r,Math.min(s,n.x)),y:Math.max(i,Math.min(a,n.y))},g={x:Math.max(r,Math.min(s,o.x)),y:Math.max(i,Math.min(a,o.y))},f=(A.x-n.x)**2+(A.y-n.y)**2,y=(g.x-o.x)**2+(g.y-o.y)**2,x=[{start:{x:r,y:i},end:{x:s,y:i}},{start:{x:s,y:i},end:{x:s,y:a}},{start:{x:s,y:a},end:{x:r,y:a}},{start:{x:r,y:a},end:{x:r,y:i}}],C=Math.min(f,y),b=f<=y?A:g,I=(v,P,M)=>Math.max(P,Math.min(M,v));for(let v of x){let P={x:o.x-n.x,y:o.y-n.y},M={x:v.end.x-v.start.x,y:v.end.y-v.start.y},B={x:n.x-v.start.x,y:n.y-v.start.y},T=P.x*P.x+P.y*P.y,N=P.x*M.x+P.y*M.y,D=P.x*B.x+P.y*B.y,L=M.x*M.x+M.y*M.y,H=M.x*B.x+M.y*B.y,V=T*L-N*N;if(Math.abs(V)<0.0000000001)continue;let O=(N*H-L*D)/V,U=(T*H-N*D)/V;O=I(O,0,1),U=I(U,0,1);let j={x:n.x+O*P.x,y:n.y+O*P.y},Y={x:v.start.x+U*M.x,y:v.start.y+U*M.y},X=j.x-Y.x,K=j.y-Y.y,J=X*X+K*K;J<C&&(C=J,b={x:(j.x+Y.x)/2,y:(j.y+Y.y)/2})}return b},l$=(e)=>{if(e.type==="pcb_hole"&&(e.hole_shape==="pill"||e.hole_shape==="rotated_pill")||e.type==="pcb_smtpad"&&e.shape==="rotated_pill"){let t=eB(e);return{minX:Math.min(t.start.x,t.end.x)-t.radius,minY:Math.min(t.start.y,t.end.y)-t.radius,maxX:Math.max(t.start.x,t.end.x)+t.radius,maxY:Math.max(t.start.y,t.end.y)+t.radius}}if(e.type==="pcb_trace_segment")return{minX:Math.min(e.x1,e.x2),minY:Math.min(e.y1,e.y2),maxX:Math.max(e.x1,e.x2),maxY:Math.max(e.y1,e.y2)};if(e.type==="pcb_smtpad"||e.type==="pcb_plated_hole"){if(e.type==="pcb_smtpad"&&(e.shape==="rotated_rect"||e.shape==="polygon")||e.type==="pcb_plated_hole"&&"rect_pad_width"in e&&"rect_pad_height"in e){let t=ale(e);return{minX:Math.min(...t.map((n)=>n.x)),minY:Math.min(...t.map((n)=>n.y)),maxX:Math.max(...t.map((n)=>n.x)),maxY:Math.max(...t.map((n)=>n.y))}}}return ben([e])},dfr=(e)=>e.type==="pcb_port"?e.pcb_port_id:e.type==="pcb_smtpad"?e.pcb_smtpad_id:e.pcb_plated_hole_id;function ufr(e,{connMap:t,minClearance:n}={}){let o=function(x){let C=new Set(x.flatMap((v)=>v.type==="source_bus"&&v.max_length_skew!==void 0?v.source_trace_ids:[])),b=Kb(x),I=[];for(let v of x){if(v.type!=="pcb_trace")continue;if(!v.source_trace_id||!C.has(v.source_trace_id))continue;let P=[],M=[],B,T=0,N=0;for(let D=0;D<v.route.length-1;D++){M[D]=T;let L=v.route[D],H=v.route[D+1];if(L.route_type!=="wire"||H.route_type!=="wire"||L.layer!==H.layer){N++;continue}let V=Math.hypot(H.x-L.x,H.y-L.y);V!==0&&(P.push({type:"pcb_trace_segment",_pcbTrace:v,pcb_trace_id:v.pcb_trace_id,thickness:L.width,layer:L.layer,x1:L.x,y1:L.y,x2:H.x,y2:H.y,run:N,startDistance:T,endDistance:T+V}),T+=V)}M[v.route.length-1]=T;e:for(let D=0;D<P.length;D++){let L=P[D];for(let H=D+1;H<P.length;H++){let V=P[H];if(L.layer!==V.layer)continue;let O=(L.thickness+V.thickness)/2,U=(L.x2-L.x1)*(V.x2-V.x1)+(L.y2-L.y1)*(V.y2-V.y1),j=(L.x2-L.x1)*(V.y2-V.y1)-(L.y2-L.y1)*(V.x2-V.x1),Y=U>=Math.hypot(L.x2-L.x1,L.y2-L.y1)*Math.hypot(V.x2-V.x1,V.y2-V.y1)*-0.000000001,X=L.run===V.run&&V.startDistance===L.endDistance;if((!X||U<0&&Math.abs(j)<0.000000001)&&!(!X&&L.run===V.run&&V.startDistance-L.endDistance<=Math.SQRT2*O&&Y||Q_({x:L.x1,y:L.y1},{x:L.x2,y:L.y2},{x:V.x1,y:V.y1},{x:V.x2,y:V.y2})-O>0.000000001)){B=iXe(L,V);break e}}}if(!B){let D=x.find((H)=>H.type==="pcb_board"),L=["top",...US.filter((H)=>H.startsWith("inner")).slice(0,D?Math.max(0,D.num_layers-2):void 0),...D?.num_layers===1?[]:["bottom"]];e:for(let H=0;H<v.route.length;H++){let V=v.route[H];if(V.route_type!=="via")continue;let O=b.pcb_via.list().find((K)=>(K.pcb_trace_id===v.pcb_trace_id||!K.pcb_trace_id&&K.source_trace_id===v.source_trace_id)&&Math.hypot(K.x-V.x,K.y-V.y)<=0.000000001),U=O?.outer_diameter??V.outer_diameter;if(U===void 0||!Number.isFinite(U)||U<=0)continue;let j=L.indexOf(V.from_layer),Y=L.indexOf(V.to_layer),X=O?.layers??(j>=0&&Y>=0?L.slice(Math.min(j,Y),Math.max(j,Y)+1):[]);for(let K of P){if(!X.includes(K.layer))continue;let J=(U+K.thickness)/2;if(Math.max(K.startDistance-M[H],M[H]-K.endDistance,0)<=J+0.000000001)continue;let ee={...K,x1:V.x,y1:V.y,x2:V.x,y2:V.y};if(!(Q_(V,V,{x:K.x1,y:K.y1},{x:K.x2,y:K.y2})-J>0.000000001)){B=iXe(K,ee);break e}}}}if(B){let D=b.source_trace.get(v.source_trace_id),L=(D?.connected_source_port_ids??[]).map((V)=>{let O=b.source_port.get(V),U=O?.source_component_id?b.source_component.get(O.source_component_id):void 0;return U?.name&&O?.name?`${U.name}.${O.name}`:void 0}).filter((V)=>Boolean(V)),H=D?.name||D?.display_name||L.join(" → ")||"unnamed";I.push({type:"pcb_trace_error",error_type:"pcb_trace_error",pcb_trace_error_id:`self_short_${v.pcb_trace_id}`,pcb_trace_id:v.pcb_trace_id,source_trace_id:v.source_trace_id,message:`PCB trace "${H}" shorts to itself, bypassing part of its length-matched route`,center:B,pcb_component_ids:[],pcb_port_ids:wae([v]),subcircuit_id:v.subcircuit_id})}}return I}(e);((x)=>{let C=x.filter((P)=>P.type==="pcb_port"),b=x.filter((P)=>P.type==="pcb_smtpad"),I=x.filter((P)=>P.type==="pcb_trace");function v(P,M={}){let B=M.traceWidth||0,T=C.find((N)=>N.layers.includes(P.layer)&&yFt(N.x,N.y,P.x,P.y)<0.01);if(T)return T.pcb_port_id;if(M.isFirstOrLastPoint){let N=b.find((D)=>D.layer===P.layer&&(D.shape==="rect"?Math.abs(P.x-D.x)<D.width/2+B/2&&Math.abs(P.y-D.y)<D.height/2+B/2:D.shape==="circle"?yFt(P.x,P.y,D.x,D.y)<D.radius:D.shape==="pill"||D.shape==="rotated_pill"?Hbe(P,D):void 0));if(N)return N.pcb_port_id??null}return null}for(let P of I)for(let M=0;M<P.route.length;M++){let B=P.route[M],T=M===0||M===P.route.length-1;if(B.route_type==="wire"){if(!B.start_pcb_port_id&&M===0){let N=v(B,{isFirstOrLastPoint:T,traceWidth:B.width});N&&(B.start_pcb_port_id=N)}if(!B.end_pcb_port_id&&M===P.route.length-1){let N=v(B,{isFirstOrLastPoint:T,traceWidth:B.width});N&&(B.end_pcb_port_id=N)}}}})(e),t??=eY(e);let r=sY(e);n??=qQ(r,"min_trace_to_pad_edge_clearance")??0.1;let i=Kb(e).pcb_trace.list().flatMap((x)=>{let C=[];for(let b=0;b<x.route.length-1;b++){let I=x.route[b],v=x.route[b+1];if(I.route_type!=="wire"&&I.route_type!=="via"||v.route_type!=="wire"&&v.route_type!=="via")continue;let P=I.route_type==="wire"?I:v;P.route_type==="wire"&&(I.route_type==="wire"&&v.route_type==="wire"&&I.layer!==v.layer||C.push({type:"pcb_trace_segment",pcb_trace_id:x.pcb_trace_id,_pcbTrace:x,thickness:Math.max(I.route_type==="wire"?I.width??SKe:0,v.route_type==="wire"?v.width??SKe:0),layer:P.layer,x1:I.x,y1:I.y,x2:v.x,y2:v.y}))}return C}),s=Kb(e).pcb_smtpad.list(),a=Kb(e).pcb_plated_hole.list(),c=Kb(e).pcb_port.list(),l=Kb(e).pcb_hole.list(),h=new Map(Men(e).map((x)=>[x.elementId,x])),d=Kb(e).pcb_via.list(),u=Kb(e).pcb_keepout.list().filter((x)=>!x.allow_traces),_=[...c,...s,...a],p=new Map;for(let x of u){let C=new Set(x.excluded_pcb_component_ids??[]);C.size!==0&&p.set(x.pcb_keepout_id,_.filter((b)=>b.pcb_component_id&&C.has(b.pcb_component_id)).map(dfr))}let m=[...i,...s,...a,...l,...d,...u],A=new DJe({objects:m,getBounds:l$}),g=(x)=>av(e,x),f=(x,C,b)=>O$(b)?`PCB trace ${x} overlaps with ${C} (accidental contact)`:`PCB trace ${x} is too close to ${C} (gap: ${b.toFixed(3)}mm)`,y=new Set;for(let x of i){let C=n,b=l$(x),I=A.getObjectsInBounds(b,C+x.thickness/2);if(x.x1!==x.x2||x.y1!==x.y2)for(let v of I){if(!$Q(v).includes(x.layer))continue;if(v.type==="pcb_keepout"&&(p.get(v.pcb_keepout_id)??[]).some((B)=>t.areIdsConnected(x.pcb_trace_id,B)))continue;if(v.type==="pcb_trace_segment"){let B=v;if(x.layer!==B.layer)continue;if(t.areIdsConnected(x.pcb_trace_id,B.pcb_trace_id))continue;let T=Q_({x:x.x1,y:x.y1},{x:x.x2,y:x.y2},{x:B.x1,y:B.y1},{x:B.x2,y:B.y2})-x.thickness/2-B.thickness/2;if(T>n-AB)continue;let N=`overlap_${x.pcb_trace_id}_${B.pcb_trace_id}`,D=`overlap_${B.pcb_trace_id}_${x.pcb_trace_id}`;if(y.has(N))continue;if(y.has(D))continue;y.add(N),o.push({type:"pcb_trace_error",error_type:"pcb_trace_error",message:f(g(x.pcb_trace_id),g(B.pcb_trace_id),T),pcb_trace_id:x.pcb_trace_id,source_trace_id:"",pcb_trace_error_id:N,pcb_component_ids:[],center:iXe(x,B),pcb_port_ids:wae([x._pcbTrace,B._pcbTrace])});continue}let P=mq(v);if(t.areIdsConnected(x.pcb_trace_id,"pcb_trace_id"in v?v.pcb_trace_id:P))continue;if(v.type==="pcb_smtpad"||v.type==="pcb_plated_hole"||v.type==="pcb_via"){let{gap:B,center:T}=TJe(x,v);if(!O$(B))continue;let N=`overlap_${x.pcb_trace_id}_${P}`;if(y.has(N))continue;y.add(N),o.push({type:"pcb_trace_error",error_type:"pcb_trace_error",message:f(g(x.pcb_trace_id),`${v.type} "${g(P)}"`,B),pcb_trace_id:x.pcb_trace_id,center:T,source_trace_id:"",pcb_trace_error_id:N,pcb_component_ids:["pcb_component_id"in v?v.pcb_component_id:void 0].filter(Boolean),pcb_port_ids:[...wae([x._pcbTrace]),"pcb_port_id"in v?v.pcb_port_id:void 0].filter(Boolean)});continue}if(v.type==="pcb_hole"){let{gap:B,center:T}=wen(x,h.get(v.pcb_hole_id));if(!O$(B))continue;let N=`overlap_${x.pcb_trace_id}_${P}`;if(y.has(N))continue;y.add(N),o.push({type:"pcb_trace_error",error_type:"pcb_trace_error",message:f(g(x.pcb_trace_id),`${v.type} "${g(P)}"`,B),pcb_trace_id:x.pcb_trace_id,source_trace_id:x._pcbTrace.source_trace_id??"",pcb_trace_error_id:N,pcb_component_ids:v.pcb_component_id?[v.pcb_component_id]:[],pcb_port_ids:wae([x._pcbTrace]),center:T});continue}let M=ZV({x:x.x1,y:x.y1},{x:x.x2,y:x.y2},l$(v))-x.thickness/2;if(M+AB<C){let B=`overlap_${x.pcb_trace_id}_${P}`;if(y.has(B))continue;if(y.add(B),v.type==="pcb_keepout"&&v.warning_only){o.push({type:"pcb_keepout_overlap_warning",warning_type:"pcb_keepout_overlap_warning",pcb_keepout_overlap_warning_id:`pcb_keepout_overlap_warning_${B}`,pcb_keepout_id:v.pcb_keepout_id,pcb_trace_ids:[x.pcb_trace_id],message:`PCB trace ${g(x.pcb_trace_id)} violates advisory PCB keepout "${av(e,v.pcb_keepout_id)}"`,center:xFt(x,l$(v)),subcircuit_id:x._pcbTrace.subcircuit_id??v.subcircuit_id});continue}o.push({type:"pcb_trace_error",error_type:"pcb_trace_error",message:f(g(x.pcb_trace_id),`${v.type} "${g(mq(v))}"`,M),pcb_trace_id:x.pcb_trace_id,source_trace_id:"",pcb_trace_error_id:B,pcb_component_ids:["pcb_component_id"in v?v.pcb_component_id:void 0].filter(Boolean),center:xFt(x,l$(v)),pcb_port_ids:[...wae([x._pcbTrace]),"pcb_port_id"in v?v.pcb_port_id:void 0].filter(Boolean)})}}}return o}function cle(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function pfr(e,t){return cle(e,t)<=AB}function mfr(e,{connMap:t,minClearance:n}={}){let o=e.filter((a)=>a.type==="pcb_via");if(o.length<2)return[];let r=sY(e);n??=qQ(r,"min_via_hole_edge_to_via_hole_edge_clearance")??ven,t??=eY(e);let i=[],s=new Set;for(let a=0;a<o.length;a++)for(let c=a+1;c<o.length;c++){let l=o[a],h=o[c];if(pfr(l,h))continue;if(!t.areIdsConnected(l.pcb_via_id,h.pcb_via_id))continue;let d=cle(l,h)-l.hole_diameter/2-h.hole_diameter/2;if(d+AB>=n)continue;let u=[l.pcb_via_id,h.pcb_via_id].sort().join("_");s.has(u)||(s.add(u),i.push({type:"pcb_via_clearance_error",pcb_error_id:`same_net_vias_close_${u}`,message:`Vias ${av(e,l.pcb_via_id)} and ${av(e,h.pcb_via_id)} are too close together (gap: ${d.toFixed(3)}mm)`,error_type:"pcb_via_clearance_error",pcb_via_ids:[l.pcb_via_id,h.pcb_via_id],minimum_clearance:n,actual_clearance:d,pcb_center:{x:(l.x+h.x)/2,y:(l.y+h.y)/2}}))}return i}function _fr(e,{connMap:t,minClearance:n}={}){let o=e.filter((c)=>c.type==="pcb_via");if(o.length<2)return[];let r=sY(e);n??=qQ(r,"min_via_hole_edge_to_via_hole_edge_clearance")??ven;let i=qQ(r,"min_pad_edge_to_pad_edge_clearance")??qAr;t??=eY(e);let s=[],a=new Set;for(let c=0;c<o.length;c++)for(let l=c+1;l<o.length;l++){let h=o[c],d=o[l];if(t.areIdsConnected(h.pcb_via_id,d.pcb_via_id))continue;let u=cle(h,d),_=u-h.hole_diameter/2-d.hole_diameter/2,p=n;if(_+AB>=p){if(!h.layers.some((A)=>d.layers.includes(A)))continue;if(_=u-h.outer_diameter/2-d.outer_diameter/2,p=i,_>=0&&_+AB>=p)continue}let m=[h.pcb_via_id,d.pcb_via_id].sort().join("_");a.has(m)||(a.add(m),s.push({type:"pcb_via_clearance_error",pcb_error_id:`different_net_vias_close_${m}`,message:`Vias ${av(e,h.pcb_via_id)} and ${av(e,d.pcb_via_id)} from different nets are too close together (gap: ${_.toFixed(3)}mm)`,error_type:"pcb_via_clearance_error",pcb_via_ids:[h.pcb_via_id,d.pcb_via_id],minimum_clearance:p,actual_clearance:_,pcb_center:{x:(h.x+d.x)/2,y:(h.y+d.y)/2}}))}return s}var ice=0.000000001;function CFt({point:e,width:t,ownerTrace:n,index:o,connectivity:r}){if(e.route_type!=="wire"||!Number.isFinite(t)||t<=0)return!1;let i=r.getNetConnectedToId(n.pcb_trace_id);return!!i&&(o.get(i)?.get(e.layer)??[]).some((s)=>{if(s.ownerTraceId===n.pcb_trace_id)return!1;if(!s.touchesPad&&![...s.touchingTraceIds].some((c)=>c!==n.pcb_trace_id))return!1;let a=s.radius===void 0?0:s.radius+t/2;return Math.hypot(e.x-s.x,e.y-s.y)<=a+ice})}var XK=0.01;function gfr({via:e,incoming:t,outgoing:n,traceId:o,context:{stack:r,ownedViasByTrace:i}}){let s=r.indexOf(e.from_layer),a=r.indexOf(e.to_layer);if(s<0||a<0)return!1;let c=i.get(o)?.filter((u)=>Math.abs(u.x-e.x)<XK&&Math.abs(u.y-e.y)<XK)??[],l=c.length>0?c.map((u)=>u.layers):[r.slice(Math.min(s,a),Math.max(s,a)+1)],h=Math.abs(t.x-e.x)<XK&&Math.abs(t.y-e.y)<XK,d=Math.abs(n.x-e.x)<XK&&Math.abs(n.y-e.y)<XK;return r.includes(t.layer)&&r.includes(n.layer)&&l.some((u)=>u.includes(t.layer)&&u.includes(n.layer))&&(h||t.layer===e.from_layer)&&(d||n.layer===e.to_layer)}function h$(e,t){return e.route_type==="wire"&&$Q(t).includes(e.layer)&&Hbe(e,t)}function bFt(e,t){if(e.route_thickness_mode==="interpolated")return;let n=t==="start"?0:e.route.length-2,o=t==="start"?1:-1;for(;n>=0&&n<e.route.length-1;){let r=e.route[n],i=e.route[n+1];if(r?.route_type!=="wire"||i?.route_type!=="wire"||r.layer!==i.layer)return;if(Math.hypot(r.x-i.x,r.y-i.y)>0.000000001)return r.width;n+=o}}function IFt({point:e,endpointTraceCopperWidth:t,ownerTrace:n,traceWireSegmentsByNetAndLayer:o,fullConnectivityMap:r}){if(e.route_type!=="wire")return!1;let i=r.getNetConnectedToId(n.pcb_trace_id);if(!i)return!1;let s=o.get(i)?.get(e.layer)??[];for(let a of s){if(a.trace.pcb_trace_id===n.pcb_trace_id)continue;let c=t/2+a.start.width/2+0.000000001;if(xc(e,a.start,a.end)<=c)return!0}return!1}function vFt(e){return e.route_type==="through_pad"?{x:(e.start.x+e.end.x)/2,y:(e.start.y+e.end.y)/2}:{x:e.x,y:e.y}}function SFt(e,t,n,o){return t.some((r)=>{if(!r.pcb_port_id||r.pcb_port_id===n)return!1;return o.get(r.pcb_port_id)?.some((s)=>h$(e,s))??!1})}function Afr({firstPoint:e,lastPoint:t,port:n,expectedPorts:o,padMap:r}){let i,s=e.route_type==="wire"?e:void 0,a=t.route_type==="wire"?t:void 0,c=EKe(e).includes(n.pcb_port_id),l=EKe(t).includes(n.pcb_port_id);c&&s?i=s:l&&a||SFt(e,o,n.pcb_port_id,r)&&a?i=a:SFt(t,o,n.pcb_port_id,r)&&s?i=s:s&&a?i=cle(s,n)<=cle(a,n)?s:a:s?i=s:a&&(i=a);let h=vFt(e),d=vFt(t);return i?{x:i.x,y:i.y}:{x:(h.x+d.x)/2,y:(h.y+d.y)/2}}function ffr(e,{connMap:t,pcbConnectivityMap:n}={}){let o=function(b){let I=b.find((M)=>M.type==="pcb_board"),v=["top",...US.filter((M)=>M.startsWith("inner")).slice(0,I?Math.max(0,I.num_layers-2):void 0),...I?.num_layers===1?[]:["bottom"]],P=new Map;for(let M of b){if(M.type!=="pcb_via"||!M.pcb_trace_id)continue;let B=P.get(M.pcb_trace_id);B?B.push(M):P.set(M.pcb_trace_id,[M])}return{stack:v,ownedViasByTrace:P}}(e),r=function(b){let I=fFt(b);return b.flatMap((v)=>v.type!=="pcb_trace"?[]:v.route.flatMap((P,M)=>P.route_type!=="wire"?[]:[...new Set([P.start_pcb_port_id,P.end_pcb_port_id])].flatMap((B)=>{if(!B||I.canConnect(P,B))return[];let T=I.ports.get(B);return[{trace:v,point:P,index:M,port:T,padLayers:I.layersForPort(T)}]})))}(e).map(({trace:b,point:I,index:v,port:P,padLayers:M})=>({type:"pcb_trace_error",error_type:"pcb_trace_error",pcb_trace_error_id:`missing_layer_connection_${b.pcb_trace_id}_${v}_${P.pcb_port_id}`,pcb_trace_id:b.pcb_trace_id,source_trace_id:b.source_trace_id??`!${b.pcb_trace_id}`,pcb_port_ids:[P.pcb_port_id],pcb_component_ids:P.pcb_component_id?[P.pcb_component_id]:[],center:{x:I.x,y:I.y},message:`Trace [${cV(e,b.pcb_trace_id)}] on ${I.layer} is missing a via connection to port [${sle(e,P.pcb_port_id)}] on ${M.join(", ")}.`})),i=e.filter((b)=>b.type==="pcb_port"),s=e.filter((b)=>b.type==="pcb_trace"),a=e.filter((b)=>b.type==="source_trace"),c=e.filter((b)=>b.type==="pcb_smtpad"),l=e.filter((b)=>b.type==="pcb_plated_hole"),h=new Map,d,u=t,_=()=>(u??=eY(e),u),p=()=>(d??=function(b,I){let v=new Map;for(let P of b){if(P.route_thickness_mode==="interpolated")continue;let M=I.getNetConnectedToId(P.pcb_trace_id);if(M)for(let B=0;B<P.route.length-1;B++){let T=P.route[B],N=P.route[B+1];if(T.route_type!=="wire"||N.route_type!=="wire")continue;if(T.layer!==N.layer)continue;if(Math.hypot(T.x-N.x,T.y-N.y)<=0.000000001)continue;let D=v.get(M)??new Map,L=D.get(T.layer)??[];L.push({trace:P,start:T,end:N}),D.set(T.layer,L),v.set(M,D)}}return v}(s,_()),d),m,A=()=>(m??=function(b,I){let v=new Map,P=Pen(b),M=b.filter((H)=>H.type==="pcb_trace"),B=b.filter((H)=>H.type==="pcb_via"),T=b.find((H)=>H.type==="pcb_board"),N=T?.num_layers,D=["top",...US.filter((H)=>H.startsWith("inner")).slice(0,N===void 0?void 0:Math.max(0,N-2)),...N===1?[]:["bottom"]],L=(H,V,O)=>{if(![O.x,O.y].every(Number.isFinite))return;let U=I.getNetConnectedToId(H);if(!U)return;let j=P.some((J)=>{if(I.getNetConnectedToId(mq(J))!==U||!$Q(J).some((se)=>V.includes(se)))return!1;if(O.radius===void 0)return Hbe(O,J);let ee={type:"pcb_via",pcb_via_id:H,x:O.x,y:O.y,outer_diameter:2*O.radius,hole_diameter:0,layers:V};return BJe(ee,J)<=ice}),Y=new Set;for(let J of M)if(J.route_thickness_mode!=="interpolated"&&I.getNetConnectedToId(J.pcb_trace_id)===U)for(let ee=1;ee<J.route.length;ee++){let se=J.route[ee-1],ne=J.route[ee];if(se.route_type!=="wire"||ne.route_type!=="wire"||se.layer!==ne.layer||!V.includes(se.layer)||!Number.isFinite(se.width)||se.width<=0||Math.hypot(se.x-ne.x,se.y-ne.y)<=ice)continue;let re=O.radius===void 0?0:O.radius+se.width/2;if(xc(O,se,ne)<=re+ice){Y.add(J.pcb_trace_id);break}}let X={...O,touchesPad:j,touchingTraceIds:Y},K=v.get(U)??new Map;for(let J of V){let ee=K.get(J)??[];ee.push(X),K.set(J,ee)}v.set(U,K)};for(let H of B)!Number.isFinite(H.outer_diameter)||H.outer_diameter<=0||L(H.pcb_via_id,$Q(H),{x:H.x,y:H.y,ownerTraceId:H.pcb_trace_id,radius:H.outer_diameter/2});for(let H of b)if(H.type==="pcb_trace")for(let V of H.route){if(V.route_type!=="via")continue;if(B.some((Y)=>Math.hypot(Y.x-V.x,Y.y-V.y)<=ice&&(Y.pcb_trace_id===H.pcb_trace_id||!Y.pcb_trace_id&&I.areIdsConnected(Y.pcb_via_id,H.pcb_trace_id))))continue;let O=D.indexOf(V.from_layer),U=D.indexOf(V.to_layer);if(O<0||U<0)continue;let j=V.outer_diameter;j!==void 0&&(!Number.isFinite(j)||j<=0)||L(H.pcb_trace_id,D.slice(Math.min(O,U),Math.max(O,U)+1),{x:V.x,y:V.y,ownerTraceId:H.pcb_trace_id,radius:j===void 0?void 0:j/2})}return v}(e,_()),m),g=new Set;for(let b of c)b.pcb_port_id&&h.set(b.pcb_port_id,[...h.get(b.pcb_port_id)??[],b]);for(let b of l)b.pcb_port_id&&h.set(b.pcb_port_id,[...h.get(b.pcb_port_id)??[],b]);let f=new Map,y=new Map;for(let b of s){let I=new Set,v=b.route[0],P=b.route.at(-1);for(let M of[v,P])if(M)for(let[B,T]of h)T.some((N)=>h$(M,N))&&I.add(B);f.set(b.pcb_trace_id,I);for(let M of I){let B=y.get(M)??new Set;B.add(b.pcb_trace_id),y.set(M,B)}}let x=new Map,C=(b)=>{let I=x.get(b.pcb_trace_id);if(I)return I;n??=function(B){let T=new Bpr;T.circuitJson=B;for(let U of B)U.type==="pcb_trace"?T.traceIdToElm.set(U.pcb_trace_id,U):U.type==="pcb_port"&&T.portIdToElm.set(U.pcb_port_id,U);let N=[...T.traceIdToElm.values()],D=new Map;for(let[U,j]of N.entries())for(let Y=0;Y<j.route.length-1;Y++){let X=j.route[Y],K=j.route[Y+1];if(X.route_type!=="wire"||K.route_type!=="wire"||X.layer!==K.layer)continue;let J=X.width/2+0.000000001,ee=D.get(X.layer)??[];ee.push({traceIndex:U,segmentTrace:{...j,route:[X,K]},minX:Math.min(X.x,K.x)-J,minY:Math.min(X.y,K.y)-J,maxX:Math.max(X.x,K.x)+J,maxY:Math.max(X.y,K.y)+J}),D.set(X.layer,ee)}let L=N.map(()=>new Set);for(let U of D.values()){let j=new R_(U.length);for(let Y of U)j.add(Y.minX,Y.minY,Y.maxX,Y.maxY);j.finish();for(let Y of U)for(let X of j.search(Y.minX,Y.minY,Y.maxX,Y.maxY)){let K=U[X],J=K.traceIndex,ee=L[Y.traceIndex];J>Y.traceIndex&&!ee.has(J)&&T._arePcbTracesConnected(Y.segmentTrace,K.segmentTrace)&&ee.add(J)}}let H=[];for(let[U,j]of L.entries())for(let Y of[...j].sort((X,K)=>X-K))H.push([N[U].pcb_trace_id,N[Y].pcb_trace_id]);let V=fFt(B),O=new Map;for(let U of N)for(let j of U.route)if(j.route_type==="wire")for(let Y of new Set([j.start_pcb_port_id,j.end_pcb_port_id])){if(!Y||!T.portIdToElm.has(Y))continue;if(!V.canConnect(j,Y))continue;let X=O.get(Y)??[];X.push(j.start_pcb_port_id===Y?[Y,U.pcb_trace_id]:[U.pcb_trace_id,Y]),O.set(Y,X)}for(let U of T.portIdToElm.keys())for(let j of O.get(U)??[])H.push(j);return H.push(...hfr(B)),T.connMap=new kV(Z$e(H)),T}(e);let v=new Set,P=[b.pcb_trace_id];for(;P.length>0;){let B=P.pop();if(!v.has(B)){v.add(B);for(let T of n.getAllTracesConnectedToTrace(B))v.has(T.pcb_trace_id)||P.push(T.pcb_trace_id);for(let T of f.get(B)??[])for(let N of y.get(T)??[])v.has(N)||P.push(N)}}let M=s.filter((B)=>v.has(B.pcb_trace_id));for(let B of M)x.set(B.pcb_trace_id,M);return M};for(let b of s){if(b.route.length===0)continue;let I=b.route[0],v=b.route[b.route.length-1],P=a.find((T)=>T.source_trace_id===b.source_trace_id),M=P?i.filter((T)=>P.connected_source_port_ids?.includes(T.source_port_id)):[],B;for(let T=1;T<b.route.length-1;T++){let N=b.route[T-1],D=b.route[T],L=b.route[T+1];if(D.route_type==="via"){let H=N.route_type==="wire",V=L.route_type==="wire";H&&V&&(gfr({via:D,incoming:N,outgoing:L,traceId:b.pcb_trace_id,context:o})||(B??=cV(e,b.pcb_trace_id),r.push({type:"pcb_trace_error",message:`Via in trace [${B}] does not connect its adjacent wire layers at position {x: ${D.x}, y: ${D.y}}.`,source_trace_id:P?.source_trace_id||b.source_trace_id||`!${b.pcb_trace_id}`,error_type:"pcb_trace_error",pcb_trace_id:b.pcb_trace_id,pcb_trace_error_id:`misaligned_via_${b.pcb_trace_id}_${T}`,pcb_component_ids:[],pcb_port_ids:[]})))}}if(P&&M.length>0){if(g.has(P.source_trace_id))continue;g.add(P.source_trace_id)}for(let T of M){if(!T.pcb_port_id)continue;let N=h.get(T.pcb_port_id);if(!N?.length)continue;let D=N.some((H)=>h$(I,H)),L=N.some((H)=>h$(v,H));if(D||L)continue;if(!C(b).some((H)=>f.get(H.pcb_trace_id)?.has(T.pcb_port_id))&&(!D&&!L)){B??=cV(e,b.pcb_trace_id);let H=sle(e,T.pcb_port_id),V=N[0].type==="pcb_smtpad"?"SMD pad":"through-hole pad",O=Afr({firstPoint:I,lastPoint:v,port:T,expectedPorts:M,padMap:h});r.push({type:"pcb_trace_error",message:`Trace [${B}] is missing a connection to ${V} ${H}`,source_trace_id:P?.source_trace_id||b.source_trace_id||`!${b.pcb_trace_id}`,error_type:"pcb_trace_error",pcb_trace_id:b.pcb_trace_id,pcb_trace_error_id:`missing_connection_${b.pcb_trace_id}_${T.pcb_port_id}`,center:O,pcb_component_ids:[],pcb_port_ids:[T.pcb_port_id]})}}if(M.length===0){let T=!1,N=!1;for(let Y of h.values())Y.some((X)=>h$(I,X))&&(T=!0),Y.some((X)=>h$(v,X))&&(N=!0);let D=T?void 0:bFt(b,"start"),L=N?void 0:bFt(b,"end"),H=D!==void 0&&IFt({point:I,endpointTraceCopperWidth:D,ownerTrace:b,traceWireSegmentsByNetAndLayer:p(),fullConnectivityMap:_()}),V=L!==void 0&&IFt({point:v,endpointTraceCopperWidth:L,ownerTrace:b,traceWireSegmentsByNetAndLayer:p(),fullConnectivityMap:_()}),O=T||H||D!==void 0&&CFt({point:I,width:D,ownerTrace:b,index:A(),connectivity:_()}),U=N||V||L!==void 0&&CFt({point:v,width:L,ownerTrace:b,index:A(),connectivity:_()}),j=I.route_type==="wire"&&v.route_type==="wire"&&I.layer===v.layer&&Math.hypot(I.x-v.x,I.y-v.y)<=0.000000001;O||I.route_type!=="wire"||(B??=cV(e,b.pcb_trace_id),r.push({type:"pcb_trace_error",message:`Trace [${B}] has disconnected endpoint at (${I.x.toFixed(2)}, ${I.y.toFixed(2)})`,source_trace_id:P?.source_trace_id||b.source_trace_id||`!${b.pcb_trace_id}`,error_type:"pcb_trace_error",pcb_trace_id:b.pcb_trace_id,pcb_trace_error_id:`disconnected_endpoint_${b.pcb_trace_id}_start`,center:{x:I.x,y:I.y},pcb_component_ids:[],pcb_port_ids:[]})),U||v.route_type!=="wire"||j&&!O||(B??=cV(e,b.pcb_trace_id),r.push({type:"pcb_trace_error",message:`Trace [${B}] has disconnected endpoint at (${v.x.toFixed(2)}, ${v.y.toFixed(2)})`,source_trace_id:P?.source_trace_id||b.source_trace_id||`!${b.pcb_trace_id}`,error_type:"pcb_trace_error",pcb_trace_id:b.pcb_trace_id,pcb_trace_error_id:`disconnected_endpoint_${b.pcb_trace_id}_end`,center:{x:v.x,y:v.y},pcb_component_ids:[],pcb_port_ids:[]}))}}return r}function yfr(e,t={}){let n=[],o=sY(e);if(!o)return n;let r=t.margin??qQ(o,"min_board_edge_clearance")??JAr,i=function(a){if(a.outline&&a.outline.length>0)return a.outline.map((c)=>({x:c.x,y:c.y}));if(a.center&&typeof a.width=="number"&&typeof a.height=="number"){let c=a.center.x,l=a.center.y,h=a.width/2,d=a.height/2;return[{x:c-h,y:l-d},{x:c+h,y:l-d},{x:c+h,y:l+d},{x:c-h,y:l+d}]}return null}(o);if(!i)return n;let s=Kb(e).pcb_trace.list();for(let a of s)if(!(a.route.length<2))for(let c=0;c<a.route.length-1;c++){let l=a.route[c],h=a.route[c+1];if(l.route_type!=="wire"||h.route_type!=="wire")continue;let d="width"in l?l.width:("width"in h)?h.width:0.1,u={x:l.x,y:l.y},_={x:h.x,y:h.y},p=Number.POSITIVE_INFINITY;for(let A=0;A<i.length;A++){let g=Q_(u,_,i[A],i[(A+1)%i.length]);g<p&&(p=g)}let m=d/2+r;if(p<m){let A={type:"pcb_trace_error",error_type:"pcb_trace_error",pcb_trace_error_id:`trace_too_close_to_board_${a.pcb_trace_id}_segment_${c}`,message:`Trace too close to board edge (${p.toFixed(3)}mm < ${m.toFixed(3)}mm required, margin: ${r}mm)`,pcb_trace_id:a.pcb_trace_id,source_trace_id:a.source_trace_id||"",center:{x:(u.x+_.x)/2,y:(u.y+_.y)/2},pcb_component_ids:[],pcb_port_ids:[]};n.push(A)}}return n}function Ben(e,{connMap:t,minClearance:n}={}){let o=Pen(e),r=Een(e);if(o.length===0||r.length===0)return[];let i=sY(e);n??=qQ(i,"min_trace_to_pad_edge_clearance")??Sen,t??=eY(e);let s=new DJe({objects:o,getBounds:Fbe,getId:(l)=>mq(l)}),a=new Map,c=new Set;for(let l of r){let h=s.getObjectsInBounds(l$(l),n+l.thickness/2);for(let d of h){let u=mq(d);if(!$Q(d).includes(l.layer))continue;if(t.areIdsConnected(l.pcb_trace_id,u))continue;let _=`${u}_${l.pcb_trace_id}`,{gap:p,center:m}=TJe(l,d);if(O$(p)){a.delete(_),c.add(_);continue}if(c.has(_))continue;if(p+AB>=n)continue;let A={type:"pcb_pad_trace_clearance_error",pcb_pad_trace_clearance_error_id:`pad_trace_clearance_${_}`,error_type:"pcb_pad_trace_clearance_error",message:`Pad ${av(e,u)} and trace ${av(e,l.pcb_trace_id)} are too close (clearance: ${CCe(p)}, minimum: ${CCe(n)})`,pcb_pad_id:u,pcb_trace_id:l.pcb_trace_id,minimum_clearance:n,actual_clearance:p,center:m},g=a.get(_);(!g||p<g.gap)&&a.set(_,{error:A,gap:p})}}return Array.from(a.values()).map(({error:l})=>l)}function Ten(e,{connMap:t,minClearance:n}={}){let o=e.filter((c)=>c.type==="pcb_via"),r=Een(e).map((c)=>({...c,minX:Math.min(c.x1,c.x2),maxX:Math.max(c.x1,c.x2),minY:Math.min(c.y1,c.y2),maxY:Math.max(c.y1,c.y2),radius:Math.max(0,c.thickness/2),finiteBounds:Number.isFinite(c.x1)&&Number.isFinite(c.x2)&&Number.isFinite(c.y1)&&Number.isFinite(c.y2)&&Number.isFinite(c.thickness)}));if(o.length===0||r.length===0)return[];let i=sY(e);n??=qQ(i,"min_trace_to_pad_edge_clearance")??Sen,t??=eY(e);let s=new Map,a=new Set;for(let c of o){let l=$Q(c),h=Number.isFinite(c.x)&&Number.isFinite(c.y)&&Number.isFinite(c.outer_diameter)&&Number.isFinite(n),d=Math.max(0,c.outer_diameter/2)+Math.max(0,n)+AB;for(let u of r){let _=d+u.radius;if(h&&u.finiteBounds&&(c.x<u.minX-_||c.x>u.maxX+_||c.y<u.minY-_||c.y>u.maxY+_))continue;if(!l.includes(u.layer))continue;if(t.areIdsConnected(u.pcb_trace_id,c.pcb_via_id))continue;let p=`${c.pcb_via_id}_${u.pcb_trace_id}`,{gap:m,center:A}=TJe(u,c);if(O$(m)){s.delete(p),a.add(p);continue}if(a.has(p))continue;if(m+AB>=n)continue;let g={type:"pcb_via_trace_clearance_error",pcb_via_trace_clearance_error_id:`via_trace_clearance_${p}`,error_type:"pcb_via_trace_clearance_error",message:`Via ${av(e,c.pcb_via_id)} and trace ${av(e,u.pcb_trace_id)} are too close (clearance: ${CCe(m)}, minimum: ${CCe(n)})`,pcb_via_id:c.pcb_via_id,pcb_trace_id:u.pcb_trace_id,minimum_clearance:n,actual_clearance:m,center:A},f=s.get(p);(!f||m<f.gap)&&s.set(p,{error:g,gap:m})}}return Array.from(s.values()).map(({error:c})=>c)}var xfr,Cfr,bfr=Object.create,{getPrototypeOf:Ifr,defineProperty:PFt,getOwnPropertyNames:vfr}=Object,EFt=Object.prototype.hasOwnProperty;function Sfr(e){return this[e]}var MFt,N4e,Pfr=(MFt=function(e,t){var n,o;n=e,o=function(){var r=function(L){return L!=null&&(i(L)||function(H){return typeof H.readFloatLE=="function"&&typeof H.slice=="function"&&i(H.slice(0,0))}(L)||!!L._isBuffer)};function i(L){return!!L.constructor&&typeof L.constructor.isBuffer=="function"&&L.constructor.isBuffer(L)}var s=Object.prototype.toString,a=function(L){if(typeof L>"u")return"undefined";if(L===null)return"null";if(L===!0||L===!1||L instanceof Boolean)return"boolean";if(typeof L=="string"||L instanceof String)return"string";if(typeof L=="number"||L instanceof Number)return"number";if(typeof L=="function"||L instanceof Function)return"function";if(typeof Array.isArray<"u"&&Array.isArray(L))return"array";if(L instanceof RegExp)return"regexp";if(L instanceof Date)return"date";var H=s.call(L);return H==="[object RegExp]"?"regexp":H==="[object Date]"?"date":H==="[object Arguments]"?"arguments":H==="[object Error]"?"error":r(L)?"buffer":H==="[object Set]"?"set":H==="[object WeakSet]"?"weakset":H==="[object Map]"?"map":H==="[object WeakMap]"?"weakmap":H==="[object Symbol]"?"symbol":H==="[object Int8Array]"?"int8array":H==="[object Uint8Array]"?"uint8array":H==="[object Uint8ClampedArray]"?"uint8clampedarray":H==="[object Int16Array]"?"int16array":H==="[object Uint16Array]"?"uint16array":H==="[object Int32Array]"?"int32array":H==="[object Uint32Array]"?"uint32array":H==="[object Float32Array]"?"float32array":H==="[object Float64Array]"?"float64array":"object"};function c(L,H){return L(H={exports:{}},H.exports),H.exports}var l=c(function(L){(function(){function H(V,O){if(typeof O!="function")return V;var U={};for(var j in V)Object.prototype.hasOwnProperty.call(V,j)&&(U[O(j,V[j])||j]=V[j]);return U}L.exports?L.exports=H:window.rename=H})()}),h=function L(H,V){var O=a(H);if(O!=="object"&&O!=="array")throw Error("expected an object");var U=[];for(var j in O==="object"&&(H=l(H,V),U={}),H)if(H.hasOwnProperty(j)){var Y=H[j];a(Y)==="object"||a(Y)==="array"?U[j]=L(Y,V):U[j]=Y}return U},d=c(function(L){var H=Object.prototype.hasOwnProperty,V="~";function O(){}function U(Y,X,K){this.fn=Y,this.context=X,this.once=K||!1}function j(){this._events=new O,this._eventsCount=0}Object.create&&(O.prototype=Object.create(null),new O().__proto__||(V=!1)),j.prototype.eventNames=function(){var Y,X,K=[];if(this._eventsCount===0)return K;for(X in Y=this._events)H.call(Y,X)&&K.push(V?X.slice(1):X);return Object.getOwnPropertySymbols?K.concat(Object.getOwnPropertySymbols(Y)):K},j.prototype.listeners=function(Y,X){var K=V?V+Y:Y,J=this._events[K];if(X)return!!J;if(!J)return[];if(J.fn)return[J.fn];for(var ee=0,se=J.length,ne=Array(se);ee<se;ee++)ne[ee]=J[ee].fn;return ne},j.prototype.emit=function(Y,X,K,J,ee,se){var ne=V?V+Y:Y;if(!this._events[ne])return!1;var re,Z,te=this._events[ne],ie=arguments.length;if(te.fn){switch(te.once&&this.removeListener(Y,te.fn,void 0,!0),ie){case 1:return te.fn.call(te.context),!0;case 2:return te.fn.call(te.context,X),!0;case 3:return te.fn.call(te.context,X,K),!0;case 4:return te.fn.call(te.context,X,K,J),!0;case 5:return te.fn.call(te.context,X,K,J,ee),!0;case 6:return te.fn.call(te.context,X,K,J,ee,se),!0}for(Z=1,re=Array(ie-1);Z<ie;Z++)re[Z-1]=arguments[Z];te.fn.apply(te.context,re)}else{var le,ue=te.length;for(Z=0;Z<ue;Z++)switch(te[Z].once&&this.removeListener(Y,te[Z].fn,void 0,!0),ie){case 1:te[Z].fn.call(te[Z].context);break;case 2:te[Z].fn.call(te[Z].context,X);break;case 3:te[Z].fn.call(te[Z].context,X,K);break;case 4:te[Z].fn.call(te[Z].context,X,K,J);break;default:if(!re)for(le=1,re=Array(ie-1);le<ie;le++)re[le-1]=arguments[le];te[Z].fn.apply(te[Z].context,re)}}return!0},j.prototype.on=function(Y,X,K){var J=new U(X,K||this),ee=V?V+Y:Y;return this._events[ee]?this._events[ee].fn?this._events[ee]=[this._events[ee],J]:this._events[ee].push(J):(this._events[ee]=J,this._eventsCount++),this},j.prototype.once=function(Y,X,K){var J=new U(X,K||this,!0),ee=V?V+Y:Y;return this._events[ee]?this._events[ee].fn?this._events[ee]=[this._events[ee],J]:this._events[ee].push(J):(this._events[ee]=J,this._eventsCount++),this},j.prototype.removeListener=function(Y,X,K,J){var ee=V?V+Y:Y;if(!this._events[ee])return this;if(!X)return--this._eventsCount===0?this._events=new O:delete this._events[ee],this;var se=this._events[ee];if(se.fn)se.fn!==X||J&&!se.once||K&&se.context!==K||(--this._eventsCount===0?this._events=new O:delete this._events[ee]);else{for(var ne=0,re=[],Z=se.length;ne<Z;ne++)(se[ne].fn!==X||J&&!se[ne].once||K&&se[ne].context!==K)&&re.push(se[ne]);re.length?this._events[ee]=re.length===1?re[0]:re:--this._eventsCount===0?this._events=new O:delete this._events[ee]}return this},j.prototype.removeAllListeners=function(Y){var X;return Y?(X=V?V+Y:Y,this._events[X]&&(--this._eventsCount===0?this._events=new O:delete this._events[X])):(this._events=new O,this._eventsCount=0),this},j.prototype.off=j.prototype.removeListener,j.prototype.addListener=j.prototype.on,j.prototype.setMaxListeners=function(){return this},j.prefixed=V,j.EventEmitter=j,L.exports=j});function u(L,H,V){return H in L?Object.defineProperty(L,H,{value:V,enumerable:!0,configurable:!0,writable:!0}):L[H]=V,L}var _=function(){},p={data:"state-data",cdata:"state-cdata",tagBegin:"state-tag-begin",tagName:"state-tag-name",tagEnd:"state-tag-end",attributeNameStart:"state-attribute-name-start",attributeName:"state-attribute-name",attributeNameEnd:"state-attribute-name-end",attributeValueBegin:"state-attribute-value-begin",attributeValue:"state-attribute-value"},m={lt:"action-lt",gt:"action-gt",space:"action-space",equal:"action-equal",quote:"action-quote",slash:"action-slash",char:"action-char",error:"action-error"},A={text:"text",openTag:"open-tag",closeTag:"close-tag",attributeName:"attribute-name",attributeValue:"attribute-value"},g={" ":m.space,"\t":m.space,"\n":m.space,"\r":m.space,"<":m.lt,">":m.gt,'"':m.quote,"'":m.quote,"=":m.equal,"/":m.slash},f=function(L){var H,V,O,U,j,Y,X,K,J,ee;L=Object.assign({debug:!1},L);var se=new d,ne=p.data,re="",Z="",te="",ie="",le="",ue="",de=function(Ae,xe){if(Z[0]!=="?"&&Z[0]!=="!"){var Me={type:Ae,value:xe};L.debug&&console.log("emit:",Me),se.emit("data",Me)}};se.stateMachine=(u(ee={},p.data,(u(H={},m.lt,function(){re.trim()&&de(A.text,re),Z="",le=!1,ne=p.tagBegin}),u(H,m.char,function(Ae){re+=Ae}),H)),u(ee,p.cdata,u({},m.char,function(Ae){(re+=Ae).substr(-3)==="]]>"&&(de(A.text,re.slice(0,-3)),re="",ne=p.data)})),u(ee,p.tagBegin,(u(V={},m.space,_),u(V,m.char,function(Ae){Z=Ae,ne=p.tagName}),u(V,m.slash,function(){Z="",le=!0}),V)),u(ee,p.tagName,(u(O={},m.space,function(){le?ne=p.tagEnd:(ne=p.attributeNameStart,de(A.openTag,Z))}),u(O,m.gt,function(){de(le?A.closeTag:A.openTag,Z),re="",ne=p.data}),u(O,m.slash,function(){ne=p.tagEnd,de(A.openTag,Z)}),u(O,m.char,function(Ae){(Z+=Ae)==="![CDATA["&&(ne=p.cdata,re="",Z="")}),O)),u(ee,p.tagEnd,(u(U={},m.gt,function(){de(A.closeTag,Z),re="",ne=p.data}),u(U,m.char,_),U)),u(ee,p.attributeNameStart,(u(j={},m.char,function(Ae){te=Ae,ne=p.attributeName}),u(j,m.gt,function(){re="",ne=p.data}),u(j,m.space,_),u(j,m.slash,function(){le=!0,ne=p.tagEnd}),j)),u(ee,p.attributeName,(u(Y={},m.space,function(){ne=p.attributeNameEnd}),u(Y,m.equal,function(){de(A.attributeName,te),ne=p.attributeValueBegin}),u(Y,m.gt,function(){ie="",de(A.attributeName,te),de(A.attributeValue,ie),re="",ne=p.data}),u(Y,m.slash,function(){le=!0,ie="",de(A.attributeName,te),de(A.attributeValue,ie),ne=p.tagEnd}),u(Y,m.char,function(Ae){te+=Ae}),Y)),u(ee,p.attributeNameEnd,(u(X={},m.space,_),u(X,m.equal,function(){de(A.attributeName,te),ne=p.attributeValueBegin}),u(X,m.gt,function(){ie="",de(A.attributeName,te),de(A.attributeValue,ie),re="",ne=p.data}),u(X,m.char,function(Ae){ie="",de(A.attributeName,te),de(A.attributeValue,ie),te=Ae,ne=p.attributeName}),X)),u(ee,p.attributeValueBegin,(u(K={},m.space,_),u(K,m.quote,function(Ae){ue=Ae,ie="",ne=p.attributeValue}),u(K,m.gt,function(){de(A.attributeValue,ie=""),re="",ne=p.data}),u(K,m.char,function(Ae){ue="",ie=Ae,ne=p.attributeValue}),K)),u(ee,p.attributeValue,(u(J={},m.space,function(Ae){ue?ie+=Ae:(de(A.attributeValue,ie),ne=p.attributeNameStart)}),u(J,m.quote,function(Ae){ue===Ae?(de(A.attributeValue,ie),ne=p.attributeNameStart):ie+=Ae}),u(J,m.gt,function(Ae){ue?ie+=Ae:(de(A.attributeValue,ie),re="",ne=p.data)}),u(J,m.slash,function(Ae){ue?ie+=Ae:(de(A.attributeValue,ie),le=!0,ne=p.tagEnd)}),u(J,m.char,function(Ae){ie+=Ae}),J)),ee);var me=function(Ae){L.debug&&console.log(ne,Ae);var xe=se.stateMachine[ne],Me=xe[function(Re){return g[Re]||m.char}(Ae)]||xe[m.error]||xe[m.char];Me(Ae)};return se.write=function(Ae){for(var xe=Ae.length,Me=0;Me<xe;Me++)me(Ae[Me])},se},y=A,x={element:"element",text:"text"},C=function(L){return Object.assign({name:"",type:x.element,value:"",parent:null,attributes:{},children:[]},L)},b=function(L){L=Object.assign({stream:!1,parentNodes:!0,doneEvent:"done",tagPrefix:"tag:",emitTopLevelOnly:!1,debug:!1},L);var H=void 0,V=void 0,O=void 0,U=void 0,j=new d,Y=function(X){switch(X.type){case y.openTag:if(O===null)(O=V).name=X.value;else{var K=C({name:X.value,parent:O});O.children.push(K),O=K}break;case y.closeTag:var J=O.parent;if(L.parentNodes||(O.parent=null),O.name!==X.value)break;L.stream&&J===V&&(V.children=[],O.parent=null),L.emitTopLevelOnly&&J!==V||(j.emit(L.tagPrefix+O.name,O),j.emit("tag",O.name,O)),O===V&&(H.removeAllListeners("data"),j.emit(L.doneEvent,O),V=null),O=J;break;case y.text:O&&O.children.push(C({type:x.text,value:X.value,parent:L.parentNodes?O:null}));break;case y.attributeName:U=X.value,O.attributes[U]="";break;case y.attributeValue:O.attributes[U]=X.value}};return j.reset=function(){(H=f({debug:L.debug})).on("data",Y),V=C(),O=null,U="",j.parse=H.write},j.reset(),j},I=function(L,H){H=Object.assign({},H,{stream:!1,tagPrefix:":"});var V=b(H),O=void 0;return V.on("done",function(U){O=U}),V.parse(L),O},v=I,P=function(L){return h(L,function(H){return B(H)?H:M(H)})},M=function(L){return L.replace(/[-|:]([a-z])/gi,function(H,V){return V.toUpperCase()})},B=function(L){return/^(data|aria)(-\w+)/.test(L)},T=function(L){return String(L).replace(/&/g,"&amp;").replace(/'/g,"&apos;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},N=function(L){var H,V,O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},U=O.transformNode,j=U===void 0?function(K){return K}:U,Y=O.camelcase,X=Y!==void 0&&Y;return H=function(K){var J=v("<root>".concat(K,"</root>"),{parentNodes:!1});if(J.children&&J.children.length>0&&J.children.every(function(ee){return ee.name==="svg"}))return J.children.length===1?J.children[0]:J.children;throw Error("nothing to parse")}(L),V=j(H),X&&(V=P(V)),V},D=Object.assign({},{parse:function(){for(var L=arguments.length,H=Array(L),V=0;V<L;V++)H[V]=arguments[V];return new Promise(function(O,U){try{O(N.apply(void 0,H))}catch(j){U(j)}})},parseSync:N,stringify:function L(H){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},O=V.transformAttr,U=O===void 0?function(re,Z,te){return"".concat(re,'="').concat(te(Z),'"')}:O,j=V.transformNode,Y=j===void 0?function(re){return re}:j,X=V.selfClose,K=X===void 0||X;if(Array.isArray(H))return H.map(function(re){return L(re,{transformAttr:U,selfClose:K,transformNode:Y})}).join("");var J=Y(H);if(J.type==="text")return function(re){if(re){var Z=String(re);return/[&<>]/.test(Z)?"<![CDATA[".concat(Z.replace(/]]>/,"]]]]><![CDATA[>"),"]]>"):Z}return""}(J.value);var ee="";for(var se in J.attributes){var ne=U(se,J.attributes[se],T,J.name);ee+=ne?" ".concat(ne):""}return J.children&&J.children.length>0||!K?"<".concat(J.name).concat(ee,">").concat(L(J.children,{transformAttr:U,transformNode:Y,selfClose:K}),"</").concat(J.name,">"):"<".concat(J.name).concat(ee,"/>")}});return D},typeof e=="object"&&typeof t<"u"?t.exports=o():typeof define=="function"&&define.amd?define(o):(n=typeof globalThis<"u"?globalThis:n||self).svgson=o()},()=>(N4e||MFt((N4e={exports:{}}).exports,N4e),N4e.exports)),wFt={0:"M0.301025 0.257813 L0.206593 0.283385 L0.122042 0.361307 L0.075923 0.474441 L0.064942 0.642221 L0.091296 0.78289 L0.159376 0.899463 L0.257104 0.961214 L0.344948 0.961214 L0.442678 0.899463 L0.510757 0.78289 L0.537111 0.642221 L0.526131 0.474441 L0.480012 0.361307 L0.39546 0.283385 L0.301025 0.257813",1:"M0.220426 0.40845 L0.381626 0.270996 L0.381626 0.948966",2:"M0.110409 0.39212 L0.125621 0.342293 L0.170571 0.295823 L0.244237 0.26431 L0.291518 0.257813 L0.373319 0.263799 L0.434683 0.290705 L0.468239 0.331966 L0.480292 0.379913 L0.479492 0.411806 L0.465088 0.465192 L0.402571 0.568988 L0.245134 0.766438 L0.07959 0.948045 L0.522462 0.948045",3:"M0.081606 0.345073 L0.119154 0.315633 L0.178996 0.284091 L0.255265 0.257813 L0.349133 0.263062 L0.43127 0.289348 L0.48994 0.336662 L0.525141 0.394491 L0.513407 0.457577 L0.466472 0.504892 L0.384334 0.541692 L0.290464 0.56272 L0.20833 0.573235 L0.290464 0.583749 L0.384334 0.610035 L0.466472 0.652092 L0.519274 0.709922 L0.531007 0.773007 L0.50754 0.841351 L0.454738 0.899179 L0.3726 0.946494 L0.310412 0.961214 L0.209503 0.959111 L0.127367 0.946494 L0.071046 0.929671",4:"M0.418494 0.270996 L0.048828 0.724199 L0.553224 0.724199 M0.414181 0.578167 L0.414181 0.94897",5:"M0.074951 0.270996 L0.074951 0.614701 L0.267655 0.5695 L0.405247 0.586502 L0.460002 0.617189 L0.498028 0.660731 L0.527101 0.779401 L0.513352 0.841049 L0.477274 0.889568 L0.406378 0.93463 L0.324445 0.958337 L0.247399 0.962139 L0.182516 0.949767 L0.130068 0.925508 L0.074951 0.875607 M0.074951 0.270996 L0.527101 0.270996",6:"M0.428549 0.257813 L0.341433 0.285053 L0.26073 0.312099 L0.192188 0.360182 L0.138902 0.410969 L0.098219 0.500422 L0.070249 0.584267 L0.067264 0.670716 L0.065164 0.756863 L0.087163 0.820973 L0.108168 0.861042 L0.157916 0.913131 L0.210981 0.948192 L0.29279 0.961214 L0.384548 0.956206 L0.456409 0.924151 L0.507262 0.881077 L0.5349 0.821975 L0.537111 0.771889 L0.521634 0.718798 L0.498418 0.67372 L0.463042 0.636657 L0.414398 0.613617 L0.34696 0.598591 L0.28284 0.595587 L0.215403 0.605604 L0.145756 0.641665 L0.109274 0.678729 L0.064942 0.724006",7:"M0.071534 0.270996 L0.530519 0.270996 L0.495935 0.291702 L0.477752 0.305407 L0.435186 0.346112 L0.412067 0.374136 L0.388565 0.40796 L0.365315 0.448098 L0.342943 0.495062 L0.322081 0.549366 L0.303364 0.611524 L0.287416 0.68205 L0.270077 0.80465 L0.26253 0.94897",8:"M0.286761 0.257813 L0.210684 0.27162 L0.1414 0.305622 L0.092494 0.382125 L0.111513 0.450128 L0.16857 0.502193 L0.228345 0.539382 L0.377781 0.594635 L0.470161 0.645637 L0.52586 0.706203 L0.538087 0.792269 L0.506841 0.87621 L0.438915 0.927212 L0.339743 0.961214 L0.263666 0.959089 L0.174004 0.929337 L0.102003 0.881523 L0.063965 0.811395 L0.066682 0.741266 L0.102003 0.671139 L0.180797 0.608448 L0.259591 0.580822 L0.358762 0.548945 L0.456576 0.49688 L0.486463 0.446941 L0.487822 0.362999 L0.453859 0.302434 L0.384574 0.265245 L0.286761 0.257813",9:"M0.511026 0.437812 L0.491026 0.347812 L0.451026 0.297812 L0.391026 0.267812 L0.311026 0.257813 L0.231026 0.267812 L0.161026 0.297812 L0.111026 0.347812 L0.091026 0.417812 L0.111026 0.487812 L0.161026 0.537812 L0.231026 0.567812 L0.311026 0.577812 L0.391026 0.557812 L0.451026 0.517812 L0.491026 0.477812 L0.511026 0.437812 M0.510026 0.438812 L0.434026 0.636812 L0.381026 0.777812 L0.337026 0.879812 L0.301026 0.957812","!":"M0.301026 0.270996 L0.301026 0.749566 M0.251466 0.94897 L0.350587 0.94897",'"':"M0.16504 0.270996 L0.16504 0.523022 M0.437013 0.270996 L0.437013 0.523022","#":"M0.20958 0.282227 L0.146515 0.949754 M0.461844 0.282227 L0.398779 0.949754 M0.032999 0.526969 L0.600587 0.452796 M0.001465 0.82366 L0.569055 0.749486",$:"M0.307121 0.240234 L0.307121 1.083502 M0.490031 0.415915 L0.404676 0.328075 L0.23396 0.310507 L0.136407 0.398347 L0.099828 0.521324 L0.124213 0.591596 L0.197379 0.644299 L0.429061 0.697003 L0.502224 0.749708 L0.526613 0.837547 L0.477836 0.960526 L0.355897 1.013228 L0.197379 0.99566 L0.112021 0.942957 L0.07544 0.837547","'":"M0.301026 0.270996 L0.301026 0.523022","(":"M0.413087 0.241211 L0.372337 0.28347 L0.331589 0.334184 L0.290838 0.393349 L0.25009 0.460965 L0.219528 0.528584 L0.199153 0.5962 L0.188966 0.655364 L0.199153 0.714529 L0.219528 0.782146 L0.25009 0.849764 L0.290838 0.91738 L0.331589 0.976544 L0.372337 1.027258 L0.413087 1.069491",")":"M0.188966 0.241211 L0.229716 0.28347 L0.270466 0.334184 L0.311213 0.393349 L0.351964 0.460965 L0.382526 0.528584 L0.4029 0.5962 L0.413087 0.655364 L0.4029 0.714529 L0.382526 0.782146 L0.351964 0.849764 L0.311213 0.91738 L0.270466 0.976544 L0.229716 1.027258 L0.188966 1.069491","*":"M0.301026 0.458702 L0.301026 0.681942 M0.301026 0.458702 L0.520997 0.536834 M0.301026 0.458702 L0.439954 0.257813 M0.301026 0.458702 L0.162098 0.257813 M0.301026 0.458702 L0.081055 0.536834","+":"M0.042969 0.66845 L0.559083 0.66845 M0.301023 0.428223 L0.301023 0.908661",",":"M0.38672 0.852051 L0.215333 1.030661 L0.301025 1.119971","-":"M0.173829 0.686035 L0.428224 0.686035",".":"M0.362549 0.851074 L0.239503 0.851074","/":"M0.062501 1.035249 L0.539551 0.270996","<":"M0.559083 0.441895 L0.042969 0.66939 L0.042969 0.66939 L0.559083 0.896902","=":"M0.042969 0.545898 L0.559083 0.545898 M0.042969 0.80837 L0.559083 0.80837",">":"M0.042969 0.441895 L0.559083 0.66939 L0.559083 0.66939 L0.042969 0.896902",A:"M0.018067 0.94897 L0.290179 0.270996 L0.583986 0.94897 M0.155303 0.684521 L0.433548 0.684521",B:"M0.063965 0.94897 L0.063965 0.278953 L0.209356 0.270996 L0.342486 0.294394 L0.432179 0.37292 L0.418224 0.48773 L0.312686 0.549166 L0.084728 0.575531 L0.306377 0.589434 L0.468877 0.647456 L0.538087 0.736658 L0.5324 0.85202 L0.501247 0.902983 L0.42355 0.944398 L0.063965 0.94897",C:"M0.529054 0.419847 L0.498425 0.345196 L0.442238 0.292341 L0.33583 0.257813 L0.257199 0.268357 L0.187906 0.303748 L0.120243 0.385432 L0.072998 0.599844 L0.110073 0.815385 L0.165381 0.902183 L0.222883 0.942801 L0.334904 0.961214 L0.43253 0.937679 L0.504816 0.868999 L0.529054 0.772065",D:"M0.064454 0.94897 L0.071838 0.285078 L0.171217 0.270996 L0.247348 0.272633 L0.37101 0.306078 L0.462461 0.378304 L0.514748 0.475555 L0.535591 0.576392 L0.537599 0.652313 L0.528065 0.717381 L0.508562 0.772419 L0.445948 0.855695 L0.362356 0.90871 L0.225203 0.945862 L0.064454 0.94897",E:"M0.080078 0.270996 L0.080078 0.94897 M0.080078 0.270996 L0.521974 0.270996 M0.080078 0.609981 L0.389405 0.609981 M0.080078 0.94897 L0.521974 0.94897",F:"M0.086426 0.270996 L0.086426 0.94897 M0.091304 0.275607 L0.515626 0.275607 M0.091304 0.607677 L0.447344 0.607677",G:"M0.498034 0.284943 L0.374621 0.257813 L0.244219 0.268648 L0.160577 0.311997 L0.094556 0.398116 L0.056397 0.58404 L0.076752 0.785532 L0.120865 0.858197 L0.188947 0.916734 L0.271008 0.953591 L0.357069 0.961214 L0.43715 0.932047 L0.501262 0.858539 L0.545656 0.648611 L0.329595 0.648131",H:"M0.066895 0.270996 L0.066895 0.94897 M0.066895 0.595658 L0.530009 0.595658 M0.535157 0.270996 L0.535157 0.94897",I:"M0.301026 0.270996 L0.301026 0.94897",J:"M0.506839 0.270996 L0.507814 0.782193 L0.498468 0.846168 L0.480733 0.880789 L0.455864 0.90832 L0.426095 0.929408 L0.360746 0.954812 L0.302508 0.962139 L0.223573 0.953638 L0.16538 0.930312 L0.137072 0.907715 L0.116428 0.880312 L0.102822 0.848819 L0.095633 0.813947 L0.094239 0.776413",K:"M0.035401 0.270996 L0.035401 0.94897 M0.502258 0.316194 L0.035401 0.687823 M0.212484 0.582361 L0.566652 0.933903",L:"M0.07544 0.270996 L0.07544 0.94897 L0.526613 0.94897",M:"M0.042481 0.94897 L0.042481 0.270996 L0.301027 0.712492 L0.559571 0.270996 L0.559571 0.94897",N:"M0.067871 0.94897 L0.067871 0.270996 L0.534181 0.94897 L0.525031 0.270996",O:"M0.287293 0.961214 L0.19843 0.933567 L0.1172 0.849451 L0.057129 0.563945 L0.114348 0.350255 L0.18455 0.289392 L0.306101 0.257813 L0.42054 0.29572 L0.487543 0.365003 L0.544923 0.625294 L0.516366 0.789624 L0.465476 0.884596 L0.375084 0.949287 L0.287293 0.961214",P:"M0.070557 0.94897 L0.070557 0.28379 L0.20704 0.270996 L0.329134 0.278993 L0.408525 0.300514 L0.444022 0.317908 L0.500637 0.368929 L0.525796 0.423728 L0.531496 0.50384 L0.508934 0.554205 L0.473724 0.582043 L0.417577 0.604365 L0.336375 0.620372 L0.226014 0.629268 L0.082368 0.630258",Q:"M0.282435 1.050813 L0.195447 1.019646 L0.115933 0.924817 L0.057129 0.602943 L0.113139 0.362034 L0.18186 0.293418 L0.300844 0.257813 L0.412868 0.300553 L0.478457 0.37866 L0.534625 0.672103 L0.506671 0.857367 L0.456855 0.964437 L0.368371 1.037368 L0.282435 1.050813 M0.341225 0.815559 L0.544923 1.070653",R:"M0.034912 0.944112 L0.034912 0.288556 L0.227127 0.270996 L0.362038 0.276867 L0.443423 0.294907 L0.477644 0.309614 L0.505809 0.328757 L0.526616 0.352817 L0.544963 0.418061 L0.543241 0.475921 L0.524463 0.517817 L0.49076 0.546518 L0.444265 0.564799 L0.355195 0.578739 L0.047653 0.589627 M0.303054 0.617306 L0.56714 0.94897",S:"M0.483037 0.364333 L0.407613 0.267477 L0.22883 0.257813 L0.128623 0.327565 L0.087712 0.455539 L0.104656 0.518727 L0.168054 0.573307 L0.41928 0.617318 L0.503796 0.669342 L0.535157 0.759324 L0.493846 0.900055 L0.367668 0.961214 L0.205436 0.956661 L0.116711 0.907038 L0.066895 0.790334",T:"M0.022949 0.270996 L0.579103 0.270996 M0.309284 0.270996 L0.309284 0.94897",U:"M0.072022 0.270996 L0.07308 0.648875 L0.080372 0.75167 L0.099024 0.827813 L0.134786 0.885729 L0.181571 0.924023 L0.251464 0.95168 L0.339655 0.962139 L0.401553 0.951668 L0.45232 0.924086 L0.482701 0.891771 L0.495745 0.870529 L0.515699 0.81637 L0.525014 0.744626 L0.530031 0.272017",V:"M0.027832 0.270996 L0.320083 0.94897 L0.57422 0.270996",W:"M0 0.270996 L0.079799 0.940377 L0.285198 0.472884 L0.505255 0.94897 L0.602052 0.270996",X:"M0.009034 0.270996 L0.586805 0.94897 M0.593019 0.270996 L0.015246 0.94897",Y:"M0.018067 0.270996 L0.293132 0.574135 M0.583986 0.271959 L0.294954 0.57606 L0.305277 0.94897",Z:"M0.053711 0.270996 L0.548341 0.270996 L0.053711 0.94897 L0.548341 0.94897","[":"M0.404542 0.240234 L0.197511 0.240234 L0.197511 1.069424 L0.404542 1.069424","\\":"M0.062501 0.270996 L0.539551 1.035249","]":"M0.19751 0.240234 L0.404542 0.240234 L0.404542 1.069424 L0.19751 1.069424","^":"M0.035156 0.523931 L0.301024 0.270996 L0.566896 0.523931",_:"M0 1.160601 L0.602052 1.160601",a:"M0.527101 0.439941 L0.527101 0.973965 M0.527101 0.553824 L0.451366 0.477535 L0.376759 0.439941 L0.263722 0.439941 L0.187989 0.477535 L0.112255 0.553824 L0.074951 0.66881 L0.074951 0.745099 L0.112255 0.85898 L0.187989 0.93527 L0.263722 0.973965 L0.376759 0.973965 L0.451366 0.93527 L0.527101 0.85898",b:"M0.07666 0.240234 L0.07666 0.959985 M0.07666 0.582737 L0.151822 0.514237 L0.225865 0.480483 L0.338045 0.480483 L0.413211 0.514237 L0.488374 0.582737 L0.525392 0.685983 L0.525392 0.754485 L0.488374 0.856739 L0.413211 0.92524 L0.338045 0.959985 L0.225865 0.959985 L0.151822 0.92524 L0.07666 0.856739",c:"M0.512452 0.553823 L0.441624 0.477535 L0.371854 0.439941 L0.26614 0.439941 L0.195312 0.477535 L0.124486 0.553823 L0.0896 0.668808 L0.0896 0.745099 L0.124486 0.858979 L0.195312 0.93527 L0.26614 0.973965 L0.371854 0.973965 L0.441624 0.93527 L0.512452 0.858979",d:"M0.525392 0.240234 L0.525392 0.959985 M0.525392 0.582737 L0.450232 0.514237 L0.376189 0.480483 L0.264006 0.480483 L0.188844 0.514237 L0.11368 0.582737 L0.076661 0.685983 L0.076661 0.754485 L0.11368 0.856739 L0.188844 0.92524 L0.264006 0.959985 L0.376189 0.959985 L0.450232 0.92524 L0.525392 0.856739",e:"M0.059571 0.668808 L0.542482 0.668808 M0.542482 0.592521 L0.502641 0.516231 L0.461594 0.477535 L0.381914 0.439941 L0.261186 0.439941 L0.180299 0.477535 L0.099412 0.553823 L0.059571 0.668808 L0.059571 0.745099 L0.099412 0.858979 L0.180299 0.93527 L0.261186 0.973965 L0.381914 0.973965 L0.461594 0.93527 L0.542482 0.858979",f:"M0.512941 0.240234 L0.406984 0.240234 L0.301026 0.274346 L0.248047 0.374731 L0.248047 0.946817 M0.089112 0.476088 L0.459965 0.476088",g:"M0.525392 0.439941 L0.525392 0.989395 L0.488373 1.091918 L0.45023 1.126757 L0.376189 1.160601 L0.264004 1.160601 L0.188844 1.126757 L0.113681 1.058075 L0.076661 0.954555 M0.525392 0.542467 L0.45023 0.473786 L0.376189 0.439941 L0.264004 0.439941 L0.188844 0.473786 L0.113681 0.542467 L0.076661 0.645988 L0.076661 0.714669 L0.113681 0.817193 L0.188844 0.885875 L0.264004 0.920713 L0.376189 0.920713 L0.45023 0.885875 L0.525392 0.817193",h:"M0.092041 0.240234 L0.092041 0.946817 M0.092041 0.61058 L0.205937 0.509225 L0.282214 0.476086 L0.396109 0.476086 L0.47187 0.509225 L0.510011 0.61058 L0.510011 0.946817",i:"M0.261026 0.240234 L0.341026 0.240234 M0.300978 0.476089 L0.300978 0.946817",j:"M0.3853 0.240234 L0.447023 0.240234 M0.416159 0.465708 L0.416159 1.011689 L0.383887 1.108586 L0.252832 1.140264 L0.15503 1.108586",k:"M0.065186 0.240234 L0.065186 0.946817 M0.493824 0.476086 L0.065186 0.812323 M0.236758 0.677829 L0.536867 0.946817",l:"M0.301026 0.234863 L0.301026 0.946441",m:"M0.050538 0.439941 L0.050538 0.960796 M0.050538 0.588758 L0.114405 0.476607 L0.157178 0.439941 L0.236864 0.439941 L0.279637 0.476607 L0.32241 0.588758 L0.32241 0.960796 M0.32241 0.588758 L0.386281 0.476607 L0.428467 0.439941 L0.50874 0.439941 L0.551515 0.476607 L0.551515 0.960796",n:"M0.092041 0.439941 L0.092041 0.960796 M0.092041 0.588758 L0.205936 0.476607 L0.282216 0.439941 L0.396113 0.439941 L0.471871 0.476607 L0.510011 0.588758 L0.510011 0.960796",o:"M0.247175 0.439941 L0.175178 0.477535 L0.103186 0.553823 L0.066895 0.668808 L0.066895 0.745099 L0.103186 0.858979 L0.175178 0.93527 L0.247175 0.973965 L0.354874 0.973965 L0.426872 0.93527 L0.498866 0.858979 L0.535157 0.745099 L0.535157 0.668808 L0.498866 0.553823 L0.426872 0.477535 L0.354874 0.439941 L0.247175 0.439941",p:"M0.076904 0.439941 L0.076904 1.154244 M0.076904 0.541563 L0.151986 0.473487 L0.225944 0.439941 L0.338005 0.439941 L0.413087 0.473487 L0.488166 0.541563 L0.525148 0.644169 L0.525148 0.712246 L0.488166 0.813866 L0.413087 0.881942 L0.338005 0.916471 L0.225944 0.916471 L0.151986 0.881942 L0.076904 0.813866",q:"M0.525148 0.441895 L0.525148 1.156195 M0.525148 0.5435 L0.450067 0.47544 L0.376106 0.441895 L0.264042 0.441895 L0.188966 0.47544 L0.113885 0.5435 L0.076905 0.646108 L0.076905 0.714187 L0.113885 0.815809 L0.188966 0.883886 L0.264042 0.918418 L0.376106 0.918418 L0.450067 0.883886 L0.525148 0.815809",r:"M0.107422 0.439941 L0.107422 0.960796 M0.107422 0.663164 L0.155824 0.551014 L0.252626 0.476607 L0.349428 0.439941 L0.49463 0.439941",s:"M0.475556 0.477535 L0.400757 0.439941 L0.276092 0.439941 L0.176361 0.477535 L0.101563 0.553823 L0.101563 0.630112 L0.176361 0.668808 L0.301024 0.668808 L0.425688 0.745099 L0.50049 0.821387 L0.50049 0.897677 L0.425688 0.93527 L0.325956 0.973965 L0.201295 0.973965 L0.126496 0.93527 L0.101563 0.858979",t:"M0.246032 0.297852 L0.246032 0.826549 L0.301023 0.919323 L0.411011 0.950848 L0.520997 0.950848 M0.081055 0.515799 L0.466004 0.515799",u:"M0.092041 0.454102 L0.092041 0.826134 L0.13018 0.937211 L0.205936 0.974954 L0.319832 0.974954 L0.396113 0.937211 L0.510011 0.826134 M0.510011 0.454102 L0.510011 0.974954",v:"M0.048828 0.453125 L0.301026 0.961719 M0.553224 0.453125 L0.301026 0.961719",w:"M0 0.453125 L0.150512 0.961719 M0.301024 0.453125 L0.150512 0.961719 M0.301024 0.453125 L0.451539 0.961719 M0.602052 0.453125 L0.451539 0.961719",x:"M0.03711 0.453125 L0.564943 0.961719 M0.564943 0.453125 L0.03711 0.961719",y:"M0.084618 0.453125 L0.320232 0.921476 M0.55713 0.453125 L0.320232 0.921476 L0.242119 1.055289 L0.163369 1.122196 L0.084618 1.155166 L0.044922 1.155166",z:"M0.505373 0.452148 L0.09668 0.961651 M0.09668 0.452148 L0.505373 0.452148 M0.09668 0.961651 L0.505373 0.961651"},BFt={};for(let e in wFt){BFt[e]=[];let t=wFt[e].split("M").slice(1).map((n)=>n.split("L").map((o)=>o.trim().split(" ").map(parseFloat)));for(let n of t)for(let o=0;o<n.length-1;o++)BFt[e].push({x1:n[o][0],y1:1-n[o][1],x2:n[o+1][0],y2:1-n[o+1][1]})}(()=>{let e=new Uint8Array(4);new Uint32Array(e.buffer)[0]=1,e[0]})(),globalThis.Int8Array,globalThis.Uint8Array,globalThis.Int16Array,globalThis.Uint16Array,globalThis.Int32Array,globalThis.Uint32Array,globalThis.BigUint64Array,globalThis.BigInt64Array,globalThis.Float32Array,globalThis.Float64Array;var Efr=[];for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)1&t?t=3988292384^t>>>1:t>>>=1;Efr[e]=t}var Mfr=new Uint16Array([255]),wfr=(new Uint8Array(Mfr.buffer)[0],new Uint16Array([255])),{cos:iLs,sin:sLs,PI:aLs}=(new Uint8Array(wfr.buffer)[0],new Uint8Array(0),Uint8Array.of(137,80,78,71,13,10,26,10),new TextDecoder("latin1"),Math),{tan:cLs}=Math;((e,t,n)=>{var o=e!=null&&typeof e=="object";if(o){var r=t?xfr??=new WeakMap:Cfr??=new WeakMap,i=r.get(e);if(i)return i}n=e!=null?bfr(Ifr(e)):{};let s=!t&&e&&e.__esModule&&EFt.call(e,"default")?n:PFt(n,"default",{value:e,enumerable:!0});if(e&&typeof e=="object"||typeof e=="function")for(let a of vfr(e))EFt.call(s,a)||PFt(s,a,{get:Sfr.bind(e,a),enumerable:!0});o&&r.set(e,s)})(Pfr(),1);var Den=(e,t={})=>{let n=((m)=>{let A=eY(m),g=m.filter((f)=>f.type==="pcb_via"&&typeof f.pcb_trace_id=="string").map((f)=>[f.pcb_via_id,f.pcb_trace_id]);return A.addConnections(g),A})(e),o=Math.max(t.viaClearance??0.1,0.1),r=ufr(e,{connMap:n,minClearance:t.traceClearance}).filter((m)=>m.type!=="pcb_keepout_overlap_warning"),i=t.includeTypedTraceClearance!==!1,s=i?Ten(e,{connMap:n,minClearance:t.traceClearance}):[],a=i?Ben(e,{connMap:n,minClearance:t.traceClearance}):[],c=function(m,{minClearance:A}={}){let g=A??qQ(sY(m),"min_trace_to_hole_edge_clearance")??$Ar;if(!Number.isFinite(g)||g<0)throw Error("Trace-to-hole clearance must be finite and non-negative");let f=Men(m);if(f.length===0)return[];let y=new DJe({objects:f,getId:(b)=>b.elementId,getBounds:(b)=>({minX:b.bounds.xmin,minY:b.bounds.ymin,maxX:b.bounds.xmax,maxY:b.bounds.ymax})}),x=new Map,C=new Set;for(let b of m)if(b.type==="pcb_trace")for(let I=1;I<b.route.length;I++){let v=b.route[I-1],P=b.route[I];if(v.route_type!=="wire"&&v.route_type!=="via"||P.route_type!=="wire"&&P.route_type!=="via")continue;if(v.route_type!=="wire"&&P.route_type!=="wire")continue;if(v.route_type==="wire"&&P.route_type==="wire"&&v.layer!==P.layer)continue;let M=Math.max(v.route_type==="wire"?v.width:0,P.route_type==="wire"?P.width:0)/2,B=y.getObjectsInBounds({minX:Math.min(v.x,P.x),minY:Math.min(v.y,P.y),maxX:Math.max(v.x,P.x),maxY:Math.max(v.y,P.y)},g+M);for(let T of B){let N=T.sourceElement;if(N.type!=="pcb_hole")continue;let{gap:D,center:L}=wen({x1:v.x,y1:v.y,x2:P.x,y2:P.y,thickness:2*M},T),H=`${b.pcb_trace_id}_${N.pcb_hole_id}`;O$(D)?(x.delete(H),C.add(H)):C.has(H)||D+0.000001>=g||(x.get(H)?.gap??1/0)<=D||x.set(H,{gap:D,error:{type:"pcb_trace_error",error_type:"pcb_trace_error",pcb_trace_error_id:`overlap_${H}`,pcb_trace_id:b.pcb_trace_id,source_trace_id:b.source_trace_id??"",pcb_component_ids:N.pcb_component_id?[N.pcb_component_id]:[],pcb_port_ids:[],center:L,message:`Trace ${cV(m,b.pcb_trace_id)} is too close to non-plated hole ${av(m,N.pcb_hole_id)} (gap: ${D.toFixed(6)}mm, required: ${g}mm)`}})}}return Array.from(x.values(),({error:b})=>b)}(e,{minClearance:t.holeClearance}),l=[...mfr(e,{connMap:n,minClearance:o}),..._fr(e,{connMap:n,minClearance:o})],h=[...r,...yfr(e),...t.includeTraceContinuity===!1?[]:ffr(e),...s,...a,...c,...l],d=e.filter((m)=>m.type==="pcb_via"),u=new Map(d.map((m)=>[m.pcb_via_id,m])),_=h.map((m)=>{if(m.type==="pcb_via_trace_clearance_error"&&typeof m.pcb_via_id=="string"){let A=u.get(m.pcb_via_id);if(A)return{...m,center:{x:A.x,y:A.y}}}if("center"in m&&m.center)return m;if("pcb_center"in m&&m.pcb_center)return{...m,center:m.pcb_center};if("pcb_via_ids"in m&&Array.isArray(m.pcb_via_ids)){let[A,g]=m.pcb_via_ids,f=u.get(A),y=u.get(g);if(f&&y)return{...m,center:{x:(f.x+y.x)/2,y:(f.y+y.y)/2}}}if("pcb_error_id"in m&&typeof m.pcb_error_id=="string"&&(m.pcb_error_id.startsWith("same_net_vias_close_")||m.pcb_error_id.startsWith("different_net_vias_close_"))){let A=m.pcb_error_id.replace("same_net_vias_close_","").replace("different_net_vias_close_","").split("_").filter(Boolean);if(A.length===2){let g=u.get(A[0]),f=u.get(A[1]);if(g&&f)return{...m,center:{x:(g.x+f.x)/2,y:(g.y+f.y)/2}}}}return m}),p=_.filter((m)=>Boolean(m.center));return{errors:h,errorsWithCenters:_,locationAwareErrors:p}},$y=(e,t)=>e===0?"top":e===t-1?"bottom":`inner${e}`,Nen=(e,t)=>{if(e.layers!==void 0)return e.layers;if(!Number.isInteger(t)||t<1)throw Error(`Invalid board layer count: ${t}`);let n=Array.from({length:t},(i,s)=>$y(s,t)),o=n.findIndex((i)=>i===e.from_layer),r=n.findIndex((i)=>i===e.to_layer);if(o<0||r<0)throw Error(`Via span ${e.from_layer} -> ${e.to_layer} is outside the board`);return n.slice(Math.min(o,r),Math.max(o,r)+1)},wKe=(e,t,n=!1)=>{let o=n?e:{from_layer:"top",to_layer:$y(t-1,t)};return Nen(o,t)},Bae=0.005,aXe=0.000001,V3e=(e,t)=>({minX:e.minX-t,minY:e.minY-t,maxX:e.maxX+t,maxY:e.maxY+t}),TFt=(e)=>V3e({minX:Math.min(e.start.x,e.end.x),minY:Math.min(e.start.y,e.end.y),maxX:Math.max(e.start.x,e.end.x),maxY:Math.max(e.start.y,e.end.y)},e.width/2),R4e=(e)=>{let t=e.diameter/2;return{minX:e.x-t,minY:e.y-t,maxX:e.x+t,maxY:e.y+t}},Bfr=(e)=>j$e(hUt(e.localToWorld,[{x:-e.width/2,y:-e.height/2},{x:e.width/2,y:-e.height/2},{x:e.width/2,y:e.height/2},{x:-e.width/2,y:e.height/2}])),DFt=(e)=>({minX:-e.width/2,minY:-e.height/2,maxX:e.width/2,maxY:e.height/2}),cXe=class{constructor(e){this.cellSize=e}cellSize;cells=new Map;itemIds=new Map;rowItems=[];visitedGenerations=new Uint32Array(0);queryGeneration=0;registerItem(e){let t=this.itemIds.get(e);if(t!==void 0)return t;let n=this.rowItems.length;if(n>=this.visitedGenerations.length){let o=new Uint32Array(this.visitedGenerations.length===0?16:2*this.visitedGenerations.length);o.set(this.visitedGenerations),this.visitedGenerations=o}return this.itemIds.set(e,n),this.rowItems.push(e===0?0:e),n}insert(e,t){let n=Math.floor(t.minX/this.cellSize),o=Math.floor(t.maxX/this.cellSize),r=Math.floor(t.minY/this.cellSize),i=Math.floor(t.maxY/this.cellSize),s;for(let a=n;a<=o;a+=1){let c=this.cells.get(a);!c&&r<=i&&(c=new Map,this.cells.set(a,c));for(let l=r;l<=i;l+=1){let h=c.get(l);s===void 0&&(s=this.registerItem(e)),h?h.push(s):c.set(l,[s])}}}query(e){let t=Math.floor(e.minX/this.cellSize),n=Math.floor(e.maxX/this.cellSize),o=Math.floor(e.minY/this.cellSize),r=Math.floor(e.maxY/this.cellSize),i=this.queryGeneration+1;i>4294967295&&(this.visitedGenerations.fill(0),i=1),this.queryGeneration=i;let s=[];for(let a=t;a<=n;a+=1){let c=this.cells.get(a);if(!(!c&&o>=-9007199254740991&&r<=9007199254740991))for(let l=o;l<=r;l+=1){let h=c?.get(l);if(h)for(let d of h)this.visitedGenerations[d]!==i&&(this.visitedGenerations[d]=i,s.push(this.rowItems[d]))}}return s}},Tfr=(e,t)=>{let n=pB(e.start,e.end,t.start,t.end);if(n)return n;let o=[{left:e.start,right:Vm(e.start,t.start,t.end)},{left:e.end,right:Vm(e.end,t.start,t.end)},{left:Vm(t.start,e.start,e.end),right:t.start},{left:Vm(t.end,e.start,e.end),right:t.end}],r={left:e.start,right:t.start},i=Number.POSITIVE_INFINITY;for(let s of o){let a=Math.hypot(s.left.x-s.right.x,s.left.y-s.right.y);a<i&&(r=s,i=a)}return{x:(r.left.x+r.right.x)/2,y:(r.left.y+r.right.y)/2}},NFt=(e,t)=>{let n=Vm(t,e.start,e.end);return{x:(n.x+t.x)/2,y:(n.y+t.y)/2}},Dfr=(e,t)=>{let n=Vm({x:(t.minX+t.maxX)/2,y:(t.minY+t.maxY)/2},e.start,e.end),o=Math.max(t.minX,Math.min(t.maxX,n.x)),r=Math.max(t.minY,Math.min(t.maxY,n.y));return{x:(n.x+o)/2,y:(n.y+r)/2}},Nfr=(e)=>{let t=new Set;for(let n of e.route)n.route_type==="wire"&&(n.start_pcb_port_id&&t.add(n.start_pcb_port_id),n.end_pcb_port_id&&t.add(n.end_pcb_port_id));return[...t]},lXe=(e,t,n)=>n<0?`PCB trace ${e} overlaps with ${t} (accidental contact)`:`PCB trace ${e} is too close to ${t} (gap: ${n.toFixed(3)}mm)`,Hle=class{constructor(e,t={}){this.srj=e;let n=t.queryResultCacheBudget??8000000;if(!Number.isSafeInteger(n)||n<0)throw Error("queryResultCacheBudget must be a nonnegative safe integer");if(this.primitiveKeyBudget=Math.floor(n/4),this.queryResultBudget=n-this.primitiveKeyBudget,this.traceClearance=t.traceClearance??0.1,this.viaClearance=Math.max(t.viaClearance??0.1,0.1),this.viaToPadClearance=t.viaToPadClearance??this.srj.minViaEdgeToPadEdgeClearance??0.1,this.connMap=t.connMap,this.includeTraceViaOwnerMetadata=t.includeTraceViaOwnerMetadata??!1,this.cellSize=t.spatialCellSize??this.getDefaultSpatialCellSize(),!Number.isFinite(this.traceClearance)||this.traceClearance<0)throw Error("traceClearance must be a non-negative finite number");if(!Number.isFinite(this.viaClearance))throw Error("viaClearance must be a finite number");if(!Number.isFinite(this.viaToPadClearance)||this.viaToPadClearance<0)throw Error("viaToPadClearance must be a non-negative finite number");if(!Number.isFinite(this.cellSize)||this.cellSize<=0)throw Error("spatialCellSize must be a positive finite number");this.compileConnectionAliases(),this.obstacles=this.compileStaticObstacles(),this.obstacles.forEach((o,r)=>this.staticObstacleIds.set(o,r)),this.indexStaticObstacles()}srj;traceClearance;viaClearance;viaToPadClearance;cellSize;connMap;includeTraceViaOwnerMetadata;canonicalNetByAlias=new Map;connMapNetByCanonicalNet=new Map;obstacles;queryResultBudget;primitiveKeyBudget;primitiveIdsByKey=new Map;primitiveKeyUnits=0;nextPrimitiveId=0;staticObstacleIds=new WeakMap;queryResultCache=new Map;queryResultUnits=0;cachedConnectivityKey;obstacleIndexesByLayer=new Map;lastRunStats={traceCount:0,segmentCount:0,viaCount:0,obstacleCount:0,broadPhaseCandidateCount:0,exactCheckCount:0};getDefaultSpatialCellSize(){let e=Math.max(0,this.srj.bounds.maxX-this.srj.bounds.minX),t=Math.max(0,this.srj.bounds.maxY-this.srj.bounds.minY);return Math.max(0.25,Math.max(e,t)/64,(this.srj.minViaDiameter??0.3)+Math.max(this.traceClearance,this.viaToPadClearance))}compileConnectionAliases(){let e=new Map;for(let t of this.srj.connections){let n=t.netConnectionName??t.rootConnectionName??t.name,o=[t.name,t.rootConnectionName,t.netConnectionName,...t.mergedConnectionNames??[],...t.pointsToConnect.flatMap((r)=>[r.pointId,r.pcb_port_id])];for(let r of o){if(!r)continue;this.canonicalNetByAlias.set(r,n);let i=this.connMap?.getNetConnectedToId(r);if(!i)continue;let s=e.get(n);s||(s=new Set,e.set(n,s)),s.add(i)}this.canonicalNetByAlias.set(n,n)}for(let[t,n]of e)n.size===1&&this.connMapNetByCanonicalNet.set(t,n.values().next().value)}resolveNetId(e){let t=this.connMap?.getNetConnectedToId(e);if(t)return t;let n=this.canonicalNetByAlias.get(e);return n?this.connMapNetByCanonicalNet.get(n)??n:e}areConnected(e,t){return e===t||(!!this.connMap?.areIdsConnected(e,t)||this.resolveNetId(e)===this.resolveNetId(t))}compileStaticObstacles(){let e=[],t=new Set,n=new Set;for(let o of this.srj.obstacles){if(o.layers.length===0)continue;let r=o.connectedTo.find((p)=>p.startsWith("pcb_smtpad_")),i=o.connectedTo.find((p)=>p.startsWith("pcb_plated_hole_")),s=o.connectedTo.find((p)=>p.startsWith("pcb_port_"));if(!r&&!i&&!s)continue;let a=o.layers.length>1,c=a?"pcb_plated_hole":"pcb_smtpad",l=a?i??`pcb_plated_hole_${o.center.x.toFixed(3)}_${o.center.y.toFixed(3)}`:r??`pcb_smtpad_${o.center.x.toFixed(3)}_${o.center.y.toFixed(3)}`,h=a?n:t;if(h.has(l))continue;h.add(l);let d=typeof o.ccwRotationDegrees=="number"&&Number.isFinite(o.ccwRotationDegrees),u=W$e(DV(o.center.x,o.center.y),pUt(d?o.ccwRotationDegrees:0)),_=!d&&a&&Math.abs(o.width-o.height)<0.001;e.push({kind:"obstacle",obstacleType:c,obstacleId:l,connectedTo:o.connectedTo,x:o.center.x,y:o.center.y,width:o.width,height:o.height,localToWorld:u,worldToLocal:dUt(u),..._?{radius:Math.max(o.width,o.height)/2}:{},layers:o.layers,...s?{pcbPortId:s}:{}})}return e}indexStaticObstacles(){for(let e of this.obstacles){let t=V3e(Bfr(e),Math.max(this.traceClearance,this.viaToPadClearance));for(let n of e.layers){let o=this.obstacleIndexesByLayer.get(n);o||(o=new cXe(this.cellSize),this.obstacleIndexesByLayer.set(n,o)),o.insert(e,t)}}}collectDynamicGeometry(e){let t=[],n=[],o=new Set;for(let r of e){let i=this.resolveNetId(r.connection_name),s=Nfr(r),a=this.queryResultBudget?JSON.stringify([r.pcb_trace_id,i,s]):void 0;for(let c=0;c<r.route.length-1;c+=1){let l=r.route[c],h=r.route[c+1];l?.route_type==="wire"&&h?.route_type==="wire"&&l.layer===h.layer&&(Math.abs(l.x-h.x)<=aXe&&Math.abs(l.y-h.y)<=aXe||t.push({kind:"trace_segment",order:t.length,traceId:r.pcb_trace_id,netId:i,start:{x:l.x,y:l.y},end:{x:h.x,y:h.y},width:RFt(l,h),layer:l.layer,pcbPortIds:s,primitiveId:a===void 0?void 0:this.getPrimitiveId(["trace",a,l.x,l.y,h.x,h.y,RFt(l,h),l.layer])}))}for(let c of r.route){if(c.route_type!=="via")continue;let l=`${c.x},${c.y},${c.from_layer},${c.to_layer}`;if(o.has(l))continue;o.add(l);let h=`via_${n.length}`,d=c.via_diameter??this.srj.minViaDiameter??0.3,u=wKe(c,this.srj.layerCount,this.srj.allowBlindAndBuriedVias);n.push({kind:"via",order:n.length,viaId:h,traceId:r.pcb_trace_id,netId:i,x:c.x,y:c.y,diameter:d,layers:u,primitiveId:this.queryResultBudget?this.getPrimitiveId(["via",h,r.pcb_trace_id,i,c.x,c.y,d,u]):void 0})}}return{segments:t,vias:n}}buildDynamicIndexes(e,t){let n=new Map,o=(r,i,s)=>{let a=n.get(r);a||(a=new cXe(this.cellSize),n.set(r,a)),a.insert(i,V3e(s,this.traceClearance))};for(let r of e)o(r.layer,r,TFt(r));for(let r of t)for(let i of r.layers)o(i,r,R4e(r));return n}obstacleSharesNet(e,t){return t.connectedTo.some((n)=>this.areConnected(e,n))}getPrimitiveId(e){if(!this.primitiveKeyBudget)return;let t=JSON.stringify(e.map((i)=>typeof i!="number"?i:Object.is(i,-0)?"-0":Number.isNaN(i)?"NaN":i===1/0?"+Infinity":i===-1/0?"-Infinity":i)),n=this.primitiveIdsByKey.get(t);if(n)return n.id;let o=t.length+64;if(o>this.primitiveKeyBudget||this.nextPrimitiveId>=Number.MAX_SAFE_INTEGER)return;for(;this.primitiveKeyUnits+o>this.primitiveKeyBudget;){let i=this.primitiveIdsByKey.keys().next().value;this.primitiveKeyUnits-=this.primitiveIdsByKey.get(i).units,this.primitiveIdsByKey.delete(i)}let r=this.nextPrimitiveId++;return this.primitiveIdsByKey.set(t,{id:r,units:o}),this.primitiveKeyUnits+=o,r}getQueryCacheKey(e,t){if(this.queryResultBudget&&!t.some((n)=>n===void 0))return`${e}:${t.join(",")}`}runCachedQuery(e,t){let n=e===void 0?void 0:this.queryResultCache.get(e);if(n)return this.lastRunStats.exactCheckCount+=n.exactCheckCount,this.lastRunStats.broadPhaseCandidateCount+=n.broadPhaseCandidateCount,n.errors.length?structuredClone(n.errors):[];let o=this.lastRunStats.exactCheckCount,r=this.lastRunStats.broadPhaseCandidateCount,i=t();if(e===void 0)return i;let s=e.length+(i.length?JSON.stringify(i).length:0)+64*i.length+64;if(s>this.queryResultBudget)return i;for(;this.queryResultUnits+s>this.queryResultBudget;){let a=this.queryResultCache.keys().next().value;this.queryResultUnits-=this.queryResultCache.get(a).units,this.queryResultCache.delete(a)}return this.queryResultCache.set(e,{errors:i.length?structuredClone(i):[],exactCheckCount:this.lastRunStats.exactCheckCount-o,broadPhaseCandidateCount:this.lastRunStats.broadPhaseCandidateCount-r,units:s}),this.queryResultUnits+=s,i}checkTraceQuery(e,t,n){let o;if(this.lastRunStats.broadPhaseCandidateCount+=t.length+n.length,this.queryResultBudget){let r=[e.primitiveId];for(let i of t)i.kind==="trace_segment"&&i.order<=e.order||r.push(i.primitiveId);r.push(-1);for(let i of n)r.push(this.staticObstacleIds.get(i));o=this.getQueryCacheKey("trace",r)}return this.runCachedQuery(o,()=>{let r=[];for(let i of t){if(i.kind==="trace_segment"&&i.order<=e.order)continue;let s=i.kind==="trace_segment"?this.checkTracePair(e,i):this.checkTraceVia(e,i);s&&r.push(s)}for(let i of n){let s=this.checkTraceObstacle(e,i);s&&r.push(s)}return r})}checkTracePair(e,t){if(this.areConnected(e.netId,t.netId))return;this.lastRunStats.exactCheckCount+=1;let n=Q_(e.start,e.end,t.start,t.end)-e.width/2-t.width/2;if(n>this.traceClearance-Bae)return;let o=`overlap_${e.traceId}_${t.traceId}`;return{type:"pcb_trace_error",error_type:"pcb_trace_error",message:lXe(e.traceId,`PCB trace ${t.traceId}`,n),pcb_trace_id:e.traceId,source_trace_id:"",pcb_trace_error_id:o,minimum_clearance:this.traceClearance,actual_clearance:n,pcb_component_ids:[],pcb_port_ids:[...new Set([...e.pcbPortIds,...t.pcbPortIds])],center:Tfr(e,t)}}checkTraceVia(e,t){if(this.areConnected(e.netId,t.netId))return;this.lastRunStats.exactCheckCount+=1;let n=XQ(e.start,e.end,{x:t.x,y:t.y,radius:t.diameter/2})-e.width/2;if(n>this.traceClearance-Bae)return;let o=`overlap_${e.traceId}_${t.viaId}`;return{type:"pcb_trace_error",error_type:"pcb_trace_error",message:lXe(e.traceId,`pcb_via "${t.viaId}"`,n),pcb_trace_id:e.traceId,...this.includeTraceViaOwnerMetadata?{pcb_trace_ids:[e.traceId,t.traceId],pcb_via_id:t.viaId,pcb_via_ids:[t.viaId]}:{},source_trace_id:"",pcb_trace_error_id:o,minimum_clearance:this.traceClearance,actual_clearance:n,pcb_component_ids:[],pcb_port_ids:e.pcbPortIds,center:NFt(e,t)}}checkTraceObstacle(e,t){if(this.obstacleSharesNet(e.netId,t))return;this.lastRunStats.exactCheckCount+=1;let n=DFt(t),o={...e,start:oB(t.worldToLocal,e.start),end:oB(t.worldToLocal,e.end)},r=(t.radius===void 0?ZV(o.start,o.end,n):XQ(e.start,e.end,{x:t.x,y:t.y,radius:t.radius}))-e.width/2;if(r+Bae>=this.traceClearance)return;let i=`overlap_${e.traceId}_${t.obstacleId}`;return{type:"pcb_trace_error",error_type:"pcb_trace_error",message:lXe(e.traceId,`${t.obstacleType} "${t.obstacleId}"`,r),pcb_trace_id:e.traceId,source_trace_id:"",pcb_trace_error_id:i,minimum_clearance:this.traceClearance,actual_clearance:r,pcb_component_ids:[],pcb_port_ids:[...new Set([...e.pcbPortIds,...t.pcbPortId?[t.pcbPortId]:[]])],center:t.radius===void 0?oB(t.localToWorld,Dfr(o,n)):NFt(e,t)}}checkViaObstacle(e,t){if(this.obstacleSharesNet(e.netId,t))return;this.lastRunStats.exactCheckCount+=1;let n=DFt(t),o=oB(t.worldToLocal,e),r=(t.radius===void 0?Math.hypot(Math.max(n.minX-o.x,0,o.x-n.maxX),Math.max(n.minY-o.y,0,o.y-n.maxY)):Math.hypot(e.x-t.x,e.y-t.y)-t.radius)-e.diameter/2;if(r+Bae>=this.viaToPadClearance)return;let i=`via_pad_clearance_${e.viaId}_${t.obstacleId}`,s={x:(e.x+t.x)/2,y:(e.y+t.y)/2};return{type:"pcb_pad_pad_clearance_error",error_type:"pcb_pad_pad_clearance_error",pcb_pad_pad_clearance_error_id:i,message:`pcb_via "${e.viaId}" and ${t.obstacleType} "${t.obstacleId}" are too close (gap: ${r.toFixed(3)}mm)`,pcb_trace_id:e.traceId,pcb_pad_ids:[e.viaId,t.obstacleId],pcb_via_ids:[e.viaId],minimum_clearance:this.viaToPadClearance,actual_clearance:r,center:s}}checkViaPairs(e){let t=this.queryResultBudget?this.getQueryCacheKey("via-pairs",e.map((n)=>n.primitiveId)):void 0;return this.runCachedQuery(t,()=>this.computeViaPairs(e))}computeViaPairs(e){if(e.length<2)return[];let t=[],n=new cXe(this.cellSize);for(let o of e)n.insert(o,V3e(R4e(o),this.viaClearance));for(let o of e)for(let r of n.query(R4e(o))){if(this.lastRunStats.broadPhaseCandidateCount+=1,r.order<=o.order)continue;this.lastRunStats.exactCheckCount+=1;let i=Math.hypot(o.x-r.x,o.y-r.y);if(i<=aXe)continue;let s=i-o.diameter/2-r.diameter/2;if(s+Bae>=this.viaClearance)continue;let a=this.areConnected(o.netId,r.netId),c=[o.viaId,r.viaId].sort().join("_"),l={x:(o.x+r.x)/2,y:(o.y+r.y)/2};t.push({type:"pcb_via_clearance_error",error_type:"pcb_via_clearance_error",pcb_error_id:`${a?"same_net":"different_net"}_vias_close_${c}`,message:`Vias ${o.viaId} and ${r.viaId}${a?"":" from different nets"} are too close together (gap: ${s.toFixed(3)}mm)`,pcb_via_ids:[o.viaId,r.viaId],...this.includeTraceViaOwnerMetadata?{pcb_trace_ids:[o.traceId,r.traceId]}:{},pcb_via_pair_net_relation:a?"same_net":"different_net",minimum_clearance:this.viaClearance,actual_clearance:s,pcb_center:l,center:l})}return t}checkViaPadQuery(e){let t=this.getQueryCacheKey("via-pad",[e.primitiveId]);return this.runCachedQuery(t,()=>{let n=[],o=new Set;for(let r of e.layers){let i=this.obstacleIndexesByLayer.get(r)?.query(R4e(e))??[];for(let s of i){if(o.has(s))continue;o.add(s),this.lastRunStats.broadPhaseCandidateCount+=1;let a=this.checkViaObstacle(e,s);a&&n.push(a)}}return n})}evaluate(e){return this.evaluateInternal(e,!0)}evaluateLegacy(e){return this.evaluateInternal(e,!1)}evaluateInternal(e,t){if(this.queryResultBudget){let d=JSON.stringify([this.connMap?.idToNetMap,this.obstacles.map((u)=>u.connectedTo)]);d!==this.cachedConnectivityKey&&(this.queryResultCache.clear(),this.queryResultUnits=0,this.cachedConnectivityKey=d)}let{segments:n,vias:o}=this.collectDynamicGeometry(e),r=this.buildDynamicIndexes(n,o),i=[],s=[];this.lastRunStats={traceCount:e.length,segmentCount:n.length,viaCount:o.length,obstacleCount:this.obstacles.length,broadPhaseCandidateCount:0,exactCheckCount:0};for(let d of n){let u=TFt(d),_=r.get(d.layer)?.query(u)??[],p=this.obstacleIndexesByLayer.get(d.layer)?.query(u)??[];i.push(...this.checkTraceQuery(d,_,p))}let a=this.checkViaPairs(o);if(t)for(let d of o)s.push(...this.checkViaPadQuery(d));let c=new Map;for(let d of i){let u=String(d.pcb_trace_error_id),_=c.get(u),p=Number(d.actual_clearance);if(!_){c.set(u,{...d,first_contact_center:d.center,first_contact_message:d.message,first_actual_clearance:p,worst_contact_center:d.center,worst_contact_message:d.message,worst_actual_clearance:p});continue}let m=Number(_.worst_actual_clearance);(p<m||!Number.isFinite(m))&&(_.worst_contact_center=d.center,_.worst_contact_message=d.message,_.worst_actual_clearance=p)}let l=[...c.values()].map((d)=>({...d,center:typeof d.worst_contact_center=="object"?d.worst_contact_center:d.center,message:typeof d.worst_contact_message=="string"?d.worst_contact_message:d.message,actual_clearance:typeof d.worst_actual_clearance=="number"?d.worst_actual_clearance:d.actual_clearance}));l.push(...s),l.push(...a);let h=l.filter((d)=>d.center);return{errors:l,errorsWithCenters:h,locationAwareErrors:h}}},RFt=(e,t)=>e.width??t.width??0.1,Rfr=[1,1.75,-1],Qfr=[1,1.75,-1],kfr=2.6666666666666665,kr=0.000001,Ua=0.001,zQ=0.14,b$=0.035,C1=0.015,NJe=(e)=>e.minTraceToPadEdgeClearance??0.16,zbe=(e)=>e.minViaEdgeToPadEdgeClearance??0.1,QFt=(e)=>Math.max(48,Math.round(48*Math.max(1,e))),Lfr=(e)=>e>=2?Rfr:Qfr,Hfr=class{netMap;idToNetMap;constructor(e){this.netMap=e,this.idToNetMap={};for(let[t,n]of Object.entries(e))for(let o of n)this.idToNetMap[o]=t}addConnections(e){for(let t of e){let n=new Set;for(let r of t){let i=this.idToNetMap[r];i&&n.add(i)}let o;if(n.size===0)o=`connectivity_net${Object.keys(this.netMap).length}`,this.netMap[o]=[];else if(n.size===1)o=n.values().next().value??`connectivity_net${Object.keys(this.netMap).length}`;else{o=n.values().next().value??`connectivity_net${Object.keys(this.netMap).length}`;for(let r of n)if(r!==o){this.netMap[o].push(...this.netMap[r]),this.netMap[r]=this.netMap[o];for(let i of this.netMap[o])this.idToNetMap[i]=o}}for(let r of t)this.netMap[o].includes(r)||this.netMap[o].push(r),this.idToNetMap[r]=o}}getIdsConnectedToNet(e){return this.netMap[e]||[]}getNetConnectedToId(e){return this.idToNetMap[e]}areIdsConnected(e,t){if(e===t)return!0;let n=this.getNetConnectedToId(e);if(!n)return!1;let o=this.getNetConnectedToId(t);return!!o&&(n===o||o===e||o===e)}areAllIdsConnected(e){let t=this.getNetConnectedToId(e[0]);for(let n of e){let o=this.getNetConnectedToId(n);if(o===void 0)return!1;if(o!==t)return!1}return!0}},RJe=(e)=>{let t=[];for(let o of e)if(o.type==="source_trace")t.push([o.source_trace_id,...o.connected_source_port_ids??[],...o.connected_source_net_ids??[]].filter(Boolean));else if(o.type==="pcb_port"){let{pcb_port_id:r,source_port_id:i}=o;i&&r&&t.push([i,r])}else if(o.type==="pcb_smtpad"){let{pcb_smtpad_id:r,pcb_port_id:i}=o;i&&r&&t.push([r,i])}else if(o.type==="pcb_plated_hole"){let{pcb_plated_hole_id:r,pcb_port_id:i}=o;i&&r&&t.push([r,i])}else if(o.type==="pcb_trace"){let{pcb_trace_id:r,source_trace_id:i}=o,s=Array.isArray(o.route)?o.route.filter((a)=>a&&a.route_type==="wire"):[];if(i&&r&&t.push([r,i]),Array.isArray(s)){let a=s.find((l)=>l?.start_pcb_port_id)?.start_pcb_port_id,c=s.find((l)=>l?.end_pcb_port_id)?.end_pcb_port_id;a&&r&&c&&t.push([a,r,c])}}else if(o.type==="pcb_via"){let{pcb_via_id:r,pcb_trace_id:i}=o;i&&r&&t.push([r,i])}else if(o.type==="source_component"&&o.internally_connected_source_port_ids)for(let r of o.internally_connected_source_port_ids)t.push(r);let n=function(o){let r=new Map,i=0;function s(a){for(let[,l]of r)if(l.has(a))return l;let c=new Set;return r.set("connectivity_net"+i++,c),c}for(let a of o){let c=null;for(let l of a){if(c){if(!c.has(l)){let h=s(l);if(h!==c){for(let d of h)c.add(d);r.delete(Array.from(r.entries()).find(([,d])=>d===h)[0])}}}else c=s(l);c.add(l)}}return Object.fromEntries(Array.from(r.entries()).map(([a,c])=>[a,Array.from(c)]))}(t);return new Hfr(n)},PCe={};ube(PCe,{all_layers:()=>vce,any_circuit_element:()=>Uon,any_soup_element:()=>ECe,any_source_component:()=>ctn,asset:()=>Hen,base_circuit_json_error:()=>Ch,battery_capacity:()=>Len,brep_shape:()=>Jtn,cadModelDefaultDirectionMap:()=>g2r,cad_component:()=>Ton,cad_model_axis_directions:()=>Bon,cad_model_formats:()=>_2r,capacitance:()=>QJe,circuit_json_footprint_load_error:()=>ion,current:()=>_q,distance:()=>Jn,duration_ms:()=>Fle,experiment_type:()=>Hon,external_footprint_load_error:()=>ron,frequency:()=>aY,getZodPrefixedIdWithDefault:()=>xo,inductance:()=>Qen,kicadAt:()=>Vbe,kicadEffects:()=>Fen,kicadFont:()=>LJe,kicadFootprintAttributes:()=>Oen,kicadFootprintMetadata:()=>Gen,kicadFootprintModel:()=>Yen,kicadFootprintPad:()=>Ven,kicadFootprintProperties:()=>zen,kicadProperty:()=>sce,kicadSymbolEffects:()=>Xen,kicadSymbolMetadata:()=>Ken,kicadSymbolPinNames:()=>Wen,kicadSymbolPinNumbers:()=>Uen,kicadSymbolProperties:()=>jen,kicadSymbolProperty:()=>IQ,layer_ref:()=>Dc,layer_string:()=>TKe,length:()=>ur,manufacturing_drc_properties:()=>tnn,ms:()=>GV,ninePointAnchor:()=>EB,pcbRenderLayer:()=>Vfr,pcb_autorouting_error:()=>aon,pcb_board:()=>Enn,pcb_breakout_point:()=>don,pcb_component:()=>nnn,pcb_component_invalid_layer_error:()=>Con,pcb_component_not_on_board_edge_error:()=>xon,pcb_component_outside_board_error:()=>yon,pcb_connector_not_in_accessible_orientation_warning:()=>lon,pcb_copper_pour:()=>fon,pcb_copper_pour_brep:()=>gon,pcb_copper_pour_polygon:()=>Aon,pcb_copper_pour_rect:()=>_on,pcb_copper_text:()=>Qnn,pcb_courtyard_circle:()=>won,pcb_courtyard_outline:()=>Eon,pcb_courtyard_overlap_error:()=>$nn,pcb_courtyard_polygon:()=>Mon,pcb_courtyard_rect:()=>Pon,pcb_cutout:()=>non,pcb_cutout_circle:()=>Znn,pcb_cutout_path:()=>ton,pcb_cutout_polygon:()=>eon,pcb_cutout_rect:()=>Jnn,pcb_fabrication_note_dimension:()=>Ynn,pcb_fabrication_note_path:()=>Onn,pcb_fabrication_note_rect:()=>Vnn,pcb_fabrication_note_text:()=>znn,pcb_footprint_overlap_error:()=>Knn,pcb_ground_plane:()=>uon,pcb_ground_plane_region:()=>pon,pcb_group:()=>son,pcb_hole:()=>lnn,pcb_hole_circle_or_square_shape:()=>Kfr,pcb_hole_circle_shape:()=>Xfr,pcb_hole_oval_shape:()=>$fr,pcb_hole_pill_shape:()=>qfr,pcb_hole_rect_shape:()=>jfr,pcb_hole_rotated_pill_shape:()=>Jfr,pcb_keepout:()=>qnn,pcb_manual_edit_conflict_warning:()=>con,pcb_missing_footprint_error:()=>oon,pcb_net:()=>Snn,pcb_note_dimension:()=>jnn,pcb_note_line:()=>Xnn,pcb_note_path:()=>Wnn,pcb_note_rect:()=>Unn,pcb_note_text:()=>Gnn,pcb_pad_pad_clearance_error:()=>von,pcb_pad_trace_clearance_error:()=>Son,pcb_panel:()=>Mnn,pcb_panelization_placement_error:()=>Bnn,pcb_placement_error:()=>wnn,pcb_plated_hole:()=>hnn,pcb_port:()=>dnn,pcb_port_not_connected_error:()=>vnn,pcb_port_not_matched_error:()=>Inn,pcb_route_hint:()=>Ztn,pcb_route_hints:()=>Wfr,pcb_silkscreen_circle:()=>Lnn,pcb_silkscreen_line:()=>Dnn,pcb_silkscreen_oval:()=>Hnn,pcb_silkscreen_path:()=>Nnn,pcb_silkscreen_pill:()=>Fnn,pcb_silkscreen_rect:()=>knn,pcb_silkscreen_text:()=>Rnn,pcb_smtpad:()=>pnn,pcb_smtpad_pill:()=>unn,pcb_solder_paste:()=>mnn,pcb_text:()=>_nn,pcb_thermal_spoke:()=>mon,pcb_trace:()=>ynn,pcb_trace_error:()=>Cnn,pcb_trace_hint:()=>Tnn,pcb_trace_missing_error:()=>bnn,pcb_trace_route_point:()=>fnn,pcb_trace_route_point_via:()=>Ann,pcb_trace_route_point_wire:()=>gnn,pcb_trace_warning:()=>xnn,pcb_via:()=>Pnn,pcb_via_clearance_error:()=>bon,pcb_via_trace_clearance_error:()=>Ion,point:()=>Zr,point3:()=>iB,point_with_bulge:()=>qtn,port_arrangement:()=>Mtn,position:()=>zfr,position3:()=>Ofr,resistance:()=>Obe,ring:()=>DKe,rotation:()=>Gm,route_hint_point:()=>enn,schematic_arc:()=>Rtn,schematic_box:()=>Itn,schematic_circle:()=>Ntn,schematic_component:()=>wtn,schematic_component_port_arrangement_by_sides:()=>Etn,schematic_component_port_arrangement_by_size:()=>Ptn,schematic_debug_line:()=>Vtn,schematic_debug_object:()=>Gtn,schematic_debug_object_base:()=>Gbe,schematic_debug_point:()=>Ytn,schematic_debug_rect:()=>Otn,schematic_error:()=>Ftn,schematic_group:()=>Xtn,schematic_layout_error:()=>ztn,schematic_line:()=>Ttn,schematic_manual_edit_conflict_warning:()=>Wtn,schematic_net_label:()=>Htn,schematic_path:()=>vtn,schematic_pin_styles:()=>Stn,schematic_port:()=>Ltn,schematic_rect:()=>Dtn,schematic_sheet:()=>$tn,schematic_symbol:()=>Btn,schematic_table:()=>jtn,schematic_table_cell:()=>Ktn,schematic_text:()=>ktn,schematic_trace:()=>Qtn,schematic_voltage_probe:()=>Utn,simulation_ac_current_source:()=>kon,simulation_ac_voltage_source:()=>Non,simulation_current_source:()=>Lon,simulation_dc_current_source:()=>Qon,simulation_dc_voltage_source:()=>Don,simulation_experiment:()=>Fon,simulation_op_amp:()=>Gon,simulation_switch:()=>Oon,simulation_transient_voltage_graph:()=>zon,simulation_unknown_experiment_error:()=>Yon,simulation_voltage_probe:()=>Von,simulation_voltage_source:()=>Ron,size:()=>kJe,source_ambiguous_port_reference:()=>_tn,source_board:()=>mtn,source_component_base:()=>ru,source_component_internal_connection:()=>htn,source_component_pins_underspecified_warning:()=>xtn,source_failed_to_create_component_error:()=>otn,source_group:()=>utn,source_i2c_misconfigured_error:()=>aZe,source_interconnect:()=>stn,source_invalid_component_property_error:()=>oZe,source_manually_placed_via:()=>Atn,source_missing_manufacturer_part_number_warning:()=>sZe,source_missing_property_error:()=>ntn,source_net:()=>ptn,source_no_ground_pin_defined_warning:()=>ytn,source_no_power_pin_defined_warning:()=>ftn,source_pcb_ground_plane:()=>gtn,source_pin_attributes:()=>Zen,source_pin_missing_trace_warning:()=>iZe,source_pin_must_be_connected_error:()=>Ctn,source_port:()=>ltn,source_project_metadata:()=>nZe,source_property_ignored_warning:()=>rtn,source_simple_battery:()=>GJe,source_simple_capacitor:()=>FJe,source_simple_chip:()=>VJe,source_simple_connector:()=>ttn,source_simple_crystal:()=>etn,source_simple_current_source:()=>Jen,source_simple_diode:()=>Ybe,source_simple_fiducial:()=>$en,source_simple_ground:()=>qen,source_simple_inductor:()=>UJe,source_simple_led:()=>OJe,source_simple_mosfet:()=>ZJe,source_simple_op_amp:()=>eZe,source_simple_pin_header:()=>jJe,source_simple_pinout:()=>KJe,source_simple_potentiometer:()=>XJe,source_simple_power_source:()=>YJe,source_simple_push_button:()=>WJe,source_simple_resistor:()=>zJe,source_simple_resonator:()=>$Je,source_simple_switch:()=>tZe,source_simple_test_point:()=>JJe,source_simple_transistor:()=>qJe,source_simple_voltage_probe:()=>itn,source_simple_voltage_source:()=>atn,source_trace:()=>dtn,source_trace_not_connected_error:()=>rZe,supplier_footprint_mismatch_warning:()=>hon,supplier_name:()=>HJe,time:()=>Ffr,timestamp:()=>ken,unknown_error_finding_part:()=>btn,visible_layer:()=>u2,voltage:()=>fB,wave_shape:()=>lZe});var Ren={Hz:{baseUnit:"Hz",variants:{MHz:1e6,kHz:1000,Hz:1}},g:{baseUnit:"g",variants:{kg:1000,g:1}},"Ω":{baseUnit:"Ω",variants:{"mΩ":0.001,"Ω":1,"kΩ":1000,"KΩ":1000,kohm:1000,"MΩ":1e6,"GΩ":1e9,"TΩ":1000000000000}},V:{baseUnit:"V",variants:{mV:0.001,V:1,kV:1000,KV:1000,MV:1e6,GV:1e9,TV:1000000000000}},A:{baseUnit:"A",variants:{"µA":0.000001,mA:0.001,ma:0.001,A:1,kA:1000,MA:1e6}},F:{baseUnit:"F",variants:{pF:0.000000000001,nF:0.000000001,"µF":0.000001,uF:0.000001,mF:0.001,F:1}},ml:{baseUnit:"ml",variants:{ml:1,mL:1,l:1000,L:1000}},deg:{baseUnit:"deg",variants:{rad:180/Math.PI}},ms:{baseUnit:"ms",variants:{fs:0.000000000001,ps:0.000000001,ns:0.000001,us:0.001,"µs":0.001,ms:1,s:1000}},mm:{baseUnit:"mm",variants:{nm:0.000001,"µm":0.001,um:0.001,mm:1,cm:10,dm:100,m:1000,km:1e6,in:25.4,ft:304.8,IN:25.4,FT:304.8,yd:914.4,mi:1609344,mil:0.0254}}},BKe=new Set;for(let[e,t]of Object.entries(Ren)){BKe.add(e);for(let n of Object.keys(t.variants))BKe.add(n)}var kFt={tera:1000000000000,T:1000000000000,giga:1e9,G:1e9,mega:1e6,M:1e6,kilo:1000,k:1000,deci:0.1,d:0.1,centi:0.01,c:0.01,milli:0.001,m:0.001,micro:0.000001,u:0.000001,"µ":0.000001,nano:0.000000001,n:0.000000001,pico:0.000000000001,p:0.000000000001};function iv(e){if(e==null)return{parsedUnit:null,unitOfValue:null,value:null};if(typeof e=="string"&&e.match(/^-?[\d\.]+$/))return{value:Number.parseFloat(e),parsedUnit:null,unitOfValue:null};if(typeof e=="number")return{value:e,parsedUnit:null,unitOfValue:null};if(typeof e=="object"&&"x"in e&&"y"in e){let{parsedUnit:a,unitOfValue:c}=iv(e.x),l=iv(e.x),h=iv(e.y);return l.value===null||h.value===null?{parsedUnit:null,unitOfValue:null,value:null}:{parsedUnit:a,unitOfValue:c,value:{x:l.value,y:h.value}}}let t=e.toString().split("").reverse().join(""),n=t.match(/[^\d\s]+/)?.[0];if(!n)throw Error(`Could not determine unit: "${e}"`);let o=n.split("").reverse().join(""),r=e.slice(0,-o.length);if(o in kFt&&!BKe.has(o)){let a=kFt[o];return{parsedUnit:null,unitOfValue:null,value:Number.parseFloat(r)*a}}let{baseUnit:i,conversionFactor:s}=function(a){for(let[c,l]of Object.entries(Ren))if(a in l.variants)return{baseUnit:l.baseUnit,conversionFactor:l.variants[a]};return{baseUnit:a,conversionFactor:1}}(o);return{parsedUnit:o,unitOfValue:i,value:s*Number.parseFloat(r)}}var Obe=E.string().or(E.number()).transform((e)=>iv(e).value),QJe=E.string().or(E.number()).transform((e)=>iv(e).value).transform((e)=>Number.parseFloat(e.toPrecision(12))),Qen=E.string().or(E.number()).transform((e)=>iv(e).value),fB=E.string().or(E.number()).transform((e)=>iv(e).value),ur=E.string().or(E.number()).transform((e)=>iv(e).value),aY=E.string().or(E.number()).transform((e)=>iv(e).value),Jn=ur,_q=E.string().or(E.number()).transform((e)=>iv(e).value),Fle=E.string().or(E.number()).transform((e)=>iv(e).value),Ffr=Fle,GV=Fle,ken=E.string().datetime(),Gm=E.string().or(E.number()).transform((e)=>typeof e=="number"?e:e.endsWith("deg")?Number.parseFloat(e.split("deg")[0]):e.endsWith("rad")?180*Number.parseFloat(e.split("rad")[0])/Math.PI:Number.parseFloat(e)),Len=E.number().or(E.string().endsWith("mAh")).transform((e)=>{if(typeof e=="string"){let t=e.replace("mAh",""),n=Number.parseFloat(t);if(Number.isNaN(n))throw Error("Invalid capacity");return n}return e}).describe("Battery capacity in mAh"),Zr=E.object({x:Jn,y:Jn}),zfr=Zr,iB=E.object({x:Jn,y:Jn,z:Jn}),Ofr=iB,kJe=E.object({width:E.number(),height:E.number()}),xo=(e)=>E.string().optional().default(()=>`${e}_${((t)=>Array.from({length:t},()=>"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[Math.floor(62*Math.random())]).join(""))(10)}`),EB=E.enum(["top_left","top_center","top_right","center_left","center","center_right","bottom_left","bottom_center","bottom_right"]),Vfr=E.enum(["top_silkscreen","bottom_silkscreen","top_copper","bottom_copper","top_soldermask","bottom_soldermask","top_fabrication_note","bottom_fabrication_note","top_user_note","bottom_user_note","top_courtyard","bottom_courtyard","inner1_copper","inner2_copper","inner3_copper","inner4_copper","inner5_copper","inner6_copper","edge_cuts","drill"]),Hen=E.object({project_relative_path:E.string(),url:E.string(),mimetype:E.string()}),Vbe=Zr.extend({rotation:Gm.optional()}),LJe=E.object({size:Zr.optional(),thickness:Jn.optional()}),Fen=E.object({font:LJe.optional()}),sce=E.object({value:E.string(),at:Vbe.optional(),layer:E.string().optional(),uuid:E.string().optional(),hide:E.boolean().optional(),effects:Fen.optional()}),zen=E.object({Reference:sce.optional(),Value:sce.optional(),Datasheet:sce.optional(),Description:sce.optional()}),Oen=E.object({through_hole:E.boolean().optional(),smd:E.boolean().optional(),exclude_from_pos_files:E.boolean().optional(),exclude_from_bom:E.boolean().optional()}),Ven=E.object({name:E.string(),type:E.string(),shape:E.string().optional(),at:Vbe.optional(),size:Zr.optional(),drill:Jn.optional(),layers:E.array(E.string()).optional(),removeUnusedLayers:E.boolean().optional(),uuid:E.string().optional()}),Yen=E.object({path:E.string(),offset:iB.optional(),scale:iB.optional(),rotate:iB.optional()}),Gen=E.object({footprintName:E.string().optional(),version:E.union([E.number(),E.string()]).optional(),generator:E.string().optional(),generatorVersion:E.union([E.number(),E.string()]).optional(),layer:E.string().optional(),properties:zen.optional(),attributes:Oen.optional(),pads:E.array(Ven).optional(),embeddedFonts:E.boolean().optional(),model:Yen.optional()}),Uen=E.object({hide:E.boolean().optional()}),Wen=E.object({offset:Jn.optional(),hide:E.boolean().optional()}),Xen=E.object({font:LJe.optional(),justify:E.union([E.string(),E.array(E.string())]).optional(),hide:E.boolean().optional()}),IQ=E.object({value:E.string(),id:E.union([E.number(),E.string()]).optional(),at:Vbe.optional(),effects:Xen.optional()}),jen=E.object({Reference:IQ.optional(),Value:IQ.optional(),Footprint:IQ.optional(),Datasheet:IQ.optional(),Description:IQ.optional(),ki_keywords:IQ.optional(),ki_fp_filters:IQ.optional()}),Ken=E.object({symbolName:E.string().optional(),extends:E.string().optional(),pinNumbers:Uen.optional(),pinNames:Wen.optional(),excludeFromSim:E.boolean().optional(),inBom:E.boolean().optional(),onBoard:E.boolean().optional(),properties:jen.optional(),embeddedFonts:E.boolean().optional()}),Ch=E.object({error_type:E.string(),message:E.string(),is_fatal:E.boolean().optional()}),HJe=E.enum(["jlcpcb","macrofab","pcbway","digikey","mouser","lcsc"]),ru=E.object({type:E.literal("source_component"),ftype:E.string().optional(),source_component_id:E.string(),name:E.string(),manufacturer_part_number:E.string().optional(),supplier_part_numbers:E.record(HJe,E.array(E.string())).optional(),display_value:E.string().optional(),display_name:E.string().optional(),are_pins_interchangeable:E.boolean().optional(),internally_connected_source_port_ids:E.array(E.array(E.string())).optional(),source_group_id:E.string().optional(),subcircuit_id:E.string().optional()}),FJe=ru.extend({ftype:E.literal("simple_capacitor"),capacitance:QJe,max_voltage_rating:fB.optional(),display_capacitance:E.string().optional(),max_decoupling_trace_length:Jn.optional()}),zJe=ru.extend({ftype:E.literal("simple_resistor"),resistance:Obe,display_resistance:E.string().optional()}),Ybe=ru.extend({ftype:E.literal("simple_diode")}),$en=ru.extend({ftype:E.literal("simple_fiducial")}),OJe=Ybe.extend({ftype:E.literal("simple_led"),color:E.string().optional(),wavelength:E.string().optional()}),qen=ru.extend({ftype:E.literal("simple_ground")}),VJe=ru.extend({ftype:E.literal("simple_chip")}),YJe=ru.extend({ftype:E.literal("simple_power_source"),voltage:fB}),Jen=ru.extend({ftype:E.literal("simple_current_source"),current:_q,frequency:aY.optional(),peak_to_peak_current:_q.optional(),wave_shape:E.enum(["sine","square","triangle","sawtooth","dc"]).optional().default("dc"),phase:E.number().optional(),duty_cycle:E.number().min(0).max(1).optional()}),Zen=E.object({must_be_connected:E.boolean().optional(),provides_power:E.boolean().optional(),requires_power:E.boolean().optional(),provides_ground:E.boolean().optional(),requires_ground:E.boolean().optional(),provides_voltage:E.union([E.string(),E.number()]).optional(),requires_voltage:E.union([E.string(),E.number()]).optional(),do_not_connect:E.boolean().optional(),include_in_board_pinout:E.boolean().optional(),can_use_internal_pullup:E.boolean().optional(),is_using_internal_pullup:E.boolean().optional(),needs_external_pullup:E.boolean().optional(),can_use_internal_pulldown:E.boolean().optional(),is_using_internal_pulldown:E.boolean().optional(),needs_external_pulldown:E.boolean().optional(),can_use_open_drain:E.boolean().optional(),is_using_open_drain:E.boolean().optional(),can_use_push_pull:E.boolean().optional(),is_using_push_pull:E.boolean().optional(),should_have_decoupling_capacitor:E.boolean().optional(),recommended_decoupling_capacitor_capacitance:E.union([E.string(),E.number()]).optional(),is_configured_for_i2c_sda:E.boolean().optional(),is_configured_for_i2c_scl:E.boolean().optional(),is_configured_for_spi_mosi:E.boolean().optional(),is_configured_for_spi_miso:E.boolean().optional(),is_configured_for_spi_sck:E.boolean().optional(),is_configured_for_spi_cs:E.boolean().optional(),is_configured_for_uart_tx:E.boolean().optional(),is_configured_for_uart_rx:E.boolean().optional(),supports_i2c_sda:E.boolean().optional(),supports_i2c_scl:E.boolean().optional(),supports_spi_mosi:E.boolean().optional(),supports_spi_miso:E.boolean().optional(),supports_spi_sck:E.boolean().optional(),supports_spi_cs:E.boolean().optional(),supports_uart_tx:E.boolean().optional(),supports_uart_rx:E.boolean().optional()}),Yfr=ru.extend({ftype:E.literal("simple_fuse"),current_rating_amps:E.number().describe("Nominal current in amps the fuse is rated for"),voltage_rating_volts:E.number().describe("Voltage rating in volts, e.g. ±5V would be 5")}),GJe=ru.extend({ftype:E.literal("simple_battery"),capacity:Len}),UJe=ru.extend({ftype:E.literal("simple_inductor"),inductance:Qen,display_inductance:E.string().optional(),max_current_rating:E.number().optional()}),WJe=ru.extend({ftype:E.literal("simple_push_button")}),XJe=ru.extend({ftype:E.literal("simple_potentiometer"),max_resistance:Obe,display_max_resistance:E.string().optional()}),etn=ru.extend({ftype:E.literal("simple_crystal"),frequency:E.number().describe("Frequency in Hz"),load_capacitance:E.number().optional().describe("Load capacitance in pF"),pin_variant:E.enum(["two_pin","four_pin"]).optional()}),jJe=ru.extend({ftype:E.literal("simple_pin_header"),pin_count:E.number(),gender:E.enum(["male","female"]).optional().default("male")}),ttn=ru.extend({ftype:E.literal("simple_connector"),standard:E.enum(["usb_c","m2"]).optional()}),KJe=ru.extend({ftype:E.literal("simple_pinout")}),$Je=ru.extend({ftype:E.literal("simple_resonator"),load_capacitance:QJe,equivalent_series_resistance:Obe.optional(),frequency:aY}),qJe=ru.extend({ftype:E.literal("simple_transistor"),transistor_type:E.enum(["npn","pnp"])}),JJe=ru.extend({ftype:E.literal("simple_test_point"),footprint_variant:E.enum(["pad","through_hole"]).optional(),pad_shape:E.enum(["rect","circle"]).optional(),pad_diameter:E.union([E.number(),E.string()]).optional(),hole_diameter:E.union([E.number(),E.string()]).optional(),width:E.union([E.number(),E.string()]).optional(),height:E.union([E.number(),E.string()]).optional()}),ZJe=ru.extend({ftype:E.literal("simple_mosfet"),channel_type:E.enum(["n","p"]),mosfet_mode:E.enum(["enhancement","depletion"])}),eZe=ru.extend({ftype:E.literal("simple_op_amp")}),tZe=ru.extend({ftype:E.literal("simple_switch")}),nZe=E.object({type:E.literal("source_project_metadata"),name:E.string().optional(),software_used_string:E.string().optional(),project_url:E.string().optional(),created_at:ken.optional()}),ntn=Ch.extend({type:E.literal("source_missing_property_error"),source_missing_property_error_id:xo("source_missing_property_error"),source_component_id:E.string(),property_name:E.string(),subcircuit_id:E.string().optional(),error_type:E.literal("source_missing_property_error").default("source_missing_property_error")}).describe("The source code is missing a property"),otn=Ch.extend({type:E.literal("source_failed_to_create_component_error"),source_failed_to_create_component_error_id:xo("source_failed_to_create_component_error"),error_type:E.literal("source_failed_to_create_component_error").default("source_failed_to_create_component_error"),component_name:E.string().optional(),subcircuit_id:E.string().optional(),parent_source_component_id:E.string().optional(),pcb_center:E.object({x:E.number().optional(),y:E.number().optional()}).optional(),schematic_center:E.object({x:E.number().optional(),y:E.number().optional()}).optional()}).describe("Error emitted when a component fails to be constructed"),oZe=Ch.extend({type:E.literal("source_invalid_component_property_error"),source_invalid_component_property_error_id:xo("source_invalid_component_property_error"),source_component_id:E.string(),property_name:E.string(),property_value:E.unknown().optional(),expected_format:E.string().optional(),subcircuit_id:E.string().optional(),error_type:E.literal("source_invalid_component_property_error").default("source_invalid_component_property_error")}).describe("The source component property is invalid"),rZe=Ch.extend({type:E.literal("source_trace_not_connected_error"),source_trace_not_connected_error_id:xo("source_trace_not_connected_error"),error_type:E.literal("source_trace_not_connected_error").default("source_trace_not_connected_error"),subcircuit_id:E.string().optional(),source_group_id:E.string().optional(),source_trace_id:E.string().optional(),connected_source_port_ids:E.array(E.string()).optional(),selectors_not_found:E.array(E.string()).optional()}).describe("Occurs when a source trace selector does not match any ports"),rtn=E.object({type:E.literal("source_property_ignored_warning"),source_property_ignored_warning_id:xo("source_property_ignored_warning"),source_component_id:E.string(),property_name:E.string(),subcircuit_id:E.string().optional(),error_type:E.literal("source_property_ignored_warning").default("source_property_ignored_warning"),message:E.string()}).describe("The source property was ignored"),iZe=E.object({type:E.literal("source_pin_missing_trace_warning"),source_pin_missing_trace_warning_id:xo("source_pin_missing_trace_warning"),warning_type:E.literal("source_pin_missing_trace_warning").default("source_pin_missing_trace_warning"),message:E.string(),source_component_id:E.string(),source_port_id:E.string(),subcircuit_id:E.string().optional()}).describe("Warning emitted when a source component pin is missing a trace connection"),sZe=E.object({type:E.literal("source_missing_manufacturer_part_number_warning"),source_missing_manufacturer_part_number_warning_id:xo("source_missing_manufacturer_part_number_warning"),warning_type:E.literal("source_missing_manufacturer_part_number_warning").default("source_missing_manufacturer_part_number_warning"),message:E.string(),source_component_id:E.string(),standard:E.string(),subcircuit_id:E.string().optional()}).describe("Warning emitted when a standard connector is missing manufacturer part number"),itn=ru.extend({ftype:E.literal("simple_voltage_probe")}),stn=ru.extend({ftype:E.literal("interconnect")}),aZe=Ch.extend({type:E.literal("source_i2c_misconfigured_error"),source_i2c_misconfigured_error_id:xo("source_i2c_misconfigured_error"),error_type:E.literal("source_i2c_misconfigured_error").default("source_i2c_misconfigured_error"),source_port_ids:E.array(E.string())}).describe("Error emitted when incompatible I2C pins (e.g. SDA and SCL) are connected to the same net"),atn=ru.extend({ftype:E.literal("simple_voltage_source"),voltage:fB,frequency:aY.optional(),peak_to_peak_voltage:fB.optional(),wave_shape:E.enum(["sinewave","square","triangle","sawtooth"]).optional(),phase:Gm.optional(),duty_cycle:E.number().optional().describe("Duty cycle as a fraction (0 to 1)")}),ctn=E.union([zJe,FJe,Ybe,$en,OJe,qen,VJe,YJe,Jen,GJe,UJe,WJe,XJe,etn,jJe,ttn,KJe,$Je,tZe,qJe,JJe,ZJe,eZe,Yfr,itn,stn,atn,nZe,ntn,oZe,otn,rZe,rtn,iZe,sZe,aZe]),ltn=E.object({type:E.literal("source_port"),pin_number:E.number().optional(),port_hints:E.array(E.string()).optional(),name:E.string(),source_port_id:E.string(),source_component_id:E.string().optional(),source_group_id:E.string().optional(),most_frequently_referenced_by_name:E.string().optional(),subcircuit_id:E.string().optional(),subcircuit_connectivity_map_key:E.string().optional()}).merge(Zen),htn=E.object({type:E.literal("source_component_internal_connection"),source_component_internal_connection_id:E.string(),source_component_id:E.string(),source_port_ids:E.array(E.string()),subcircuit_id:E.string().optional()}),dtn=E.object({type:E.literal("source_trace"),source_trace_id:E.string(),connected_source_port_ids:E.array(E.string()),connected_source_net_ids:E.array(E.string()),subcircuit_id:E.string().optional(),subcircuit_connectivity_map_key:E.string().optional(),max_length:E.number().optional(),min_trace_thickness:E.number().optional(),display_name:E.string().optional()}),utn=E.object({type:E.literal("source_group"),source_group_id:E.string(),subcircuit_id:E.string().optional(),parent_subcircuit_id:E.string().optional(),parent_source_group_id:E.string().optional(),is_subcircuit:E.boolean().optional(),show_as_schematic_box:E.boolean().optional(),name:E.string().optional(),was_automatically_named:E.boolean().optional()}),ptn=E.object({type:E.literal("source_net"),source_net_id:E.string(),name:E.string(),member_source_group_ids:E.array(E.string()),is_power:E.boolean().optional(),is_ground:E.boolean().optional(),is_digital_signal:E.boolean().optional(),is_analog_signal:E.boolean().optional(),is_positive_voltage_source:E.boolean().optional(),trace_width:E.number().optional(),subcircuit_id:E.string().optional(),subcircuit_connectivity_map_key:E.string().optional()}),mtn=E.object({type:E.literal("source_board"),source_board_id:E.string(),source_group_id:E.string(),title:E.string().optional()}).describe("Defines a board in the source domain"),_tn=Ch.extend({type:E.literal("source_ambiguous_port_reference"),source_ambiguous_port_reference_id:xo("source_ambiguous_port_reference"),error_type:E.literal("source_ambiguous_port_reference").default("source_ambiguous_port_reference"),source_port_id:E.string().optional(),source_component_id:E.string().optional()}).describe("Error emitted when a port hint matches multiple non-overlapping pads, making the port reference ambiguous"),gtn=E.object({type:E.literal("source_pcb_ground_plane"),source_pcb_ground_plane_id:E.string(),source_group_id:E.string(),source_net_id:E.string(),subcircuit_id:E.string().optional()}).describe("Defines a ground plane in the source domain"),vce=["top","bottom","inner1","inner2","inner3","inner4","inner5","inner6"],TKe=E.enum(vce),Dc=TKe.or(E.object({name:TKe})).transform((e)=>typeof e=="string"?e:e.name),u2=E.enum(["top","bottom"]),Atn=E.object({type:E.literal("source_manually_placed_via"),source_manually_placed_via_id:E.string(),source_group_id:E.string(),source_net_id:E.string(),subcircuit_id:E.string().optional(),source_trace_id:E.string().optional()}).describe("Defines a via that is manually placed in the source domain"),ftn=E.object({type:E.literal("source_no_power_pin_defined_warning"),source_no_power_pin_defined_warning_id:xo("source_no_power_pin_defined_warning"),warning_type:E.literal("source_no_power_pin_defined_warning").default("source_no_power_pin_defined_warning"),message:E.string(),source_component_id:E.string(),source_port_ids:E.array(E.string()),subcircuit_id:E.string().optional()}).describe("Warning emitted when a chip has no source ports with requires_power=true"),ytn=E.object({type:E.literal("source_no_ground_pin_defined_warning"),source_no_ground_pin_defined_warning_id:xo("source_no_ground_pin_defined_warning"),warning_type:E.literal("source_no_ground_pin_defined_warning").default("source_no_ground_pin_defined_warning"),message:E.string(),source_component_id:E.string(),source_port_ids:E.array(E.string()),subcircuit_id:E.string().optional()}).describe("Warning emitted when a chip has no source ports marked as ground pins"),xtn=E.object({type:E.literal("source_component_pins_underspecified_warning"),source_component_pins_underspecified_warning_id:xo("source_component_pins_underspecified_warning"),warning_type:E.literal("source_component_pins_underspecified_warning").default("source_component_pins_underspecified_warning"),message:E.string(),source_component_id:E.string(),source_port_ids:E.array(E.string()),subcircuit_id:E.string().optional()}).describe("Warning emitted when all ports on a source component are underspecified"),Ctn=Ch.extend({type:E.literal("source_pin_must_be_connected_error"),source_pin_must_be_connected_error_id:xo("source_pin_must_be_connected_error"),error_type:E.literal("source_pin_must_be_connected_error").default("source_pin_must_be_connected_error"),source_component_id:E.string(),source_port_id:E.string(),subcircuit_id:E.string().optional()}).describe("Error emitted when a pin with mustBeConnected attribute is not connected to any trace"),btn=Ch.extend({type:E.literal("unknown_error_finding_part"),unknown_error_finding_part_id:xo("unknown_error_finding_part"),error_type:E.literal("unknown_error_finding_part").default("unknown_error_finding_part"),source_component_id:E.string().optional(),subcircuit_id:E.string().optional()}).describe("Error emitted when an unexpected error occurs while finding a part"),Itn=E.object({type:E.literal("schematic_box"),schematic_component_id:E.string().optional(),schematic_symbol_id:E.string().optional(),width:Jn,height:Jn,is_dashed:E.boolean().default(!1),x:Jn,y:Jn,subcircuit_id:E.string().optional()}).describe("Draws a box on the schematic"),vtn=E.object({type:E.literal("schematic_path"),schematic_path_id:xo("schematic_path"),schematic_component_id:E.string().optional(),schematic_symbol_id:E.string().optional(),fill_color:E.string().optional(),is_filled:E.boolean().optional(),stroke_width:Jn.nullable().optional(),stroke_color:E.string().optional(),points:E.array(Zr),subcircuit_id:E.string().optional()}),Stn=E.record(E.object({left_margin:ur.optional(),right_margin:ur.optional(),top_margin:ur.optional(),bottom_margin:ur.optional()})),Ptn=E.object({left_size:E.number(),right_size:E.number(),top_size:E.number().optional(),bottom_size:E.number().optional()}),Etn=E.object({left_side:E.object({pins:E.array(E.number()),direction:E.enum(["top-to-bottom","bottom-to-top"]).optional()}).optional(),right_side:E.object({pins:E.array(E.number()),direction:E.enum(["top-to-bottom","bottom-to-top"]).optional()}).optional(),top_side:E.object({pins:E.array(E.number()),direction:E.enum(["left-to-right","right-to-left"]).optional()}).optional(),bottom_side:E.object({pins:E.array(E.number()),direction:E.enum(["left-to-right","right-to-left"]).optional()}).optional()}),Mtn=E.union([Ptn,Etn]),wtn=E.object({type:E.literal("schematic_component"),size:kJe,center:Zr,source_component_id:E.string().optional(),schematic_component_id:E.string(),schematic_symbol_id:E.string().optional(),pin_spacing:ur.optional(),pin_styles:Stn.optional(),box_width:ur.optional(),symbol_name:E.string().optional(),port_arrangement:Mtn.optional(),port_labels:E.record(E.string()).optional(),symbol_display_value:E.string().optional(),subcircuit_id:E.string().optional(),schematic_group_id:E.string().optional(),is_schematic_group:E.boolean().optional(),source_group_id:E.string().optional(),is_box_with_pins:E.boolean().optional().default(!0)}),Gfr=E.object({kicad_symbol:Ken.optional()}).catchall(E.unknown()),Btn=E.object({type:E.literal("schematic_symbol"),schematic_symbol_id:E.string(),name:E.string().optional(),metadata:Gfr.optional()}).describe("Defines a named schematic symbol that can be referenced by components."),Ttn=E.object({type:E.literal("schematic_line"),schematic_line_id:xo("schematic_line"),schematic_component_id:E.string().optional(),schematic_symbol_id:E.string().optional(),x1:Jn,y1:Jn,x2:Jn,y2:Jn,stroke_width:Jn.nullable().optional(),color:E.string().default("#000000"),is_dashed:E.boolean().default(!1),subcircuit_id:E.string().optional()}).describe("Draws a styled line on the schematic"),Dtn=E.object({type:E.literal("schematic_rect"),schematic_rect_id:xo("schematic_rect"),schematic_component_id:E.string().optional(),schematic_symbol_id:E.string().optional(),center:Zr,width:Jn,height:Jn,rotation:Gm.default(0),stroke_width:Jn.nullable().optional(),color:E.string().default("#000000"),is_filled:E.boolean().default(!1),fill_color:E.string().optional(),is_dashed:E.boolean().default(!1),subcircuit_id:E.string().optional()}).describe("Draws a styled rectangle on the schematic"),Ntn=E.object({type:E.literal("schematic_circle"),schematic_circle_id:xo("schematic_circle"),schematic_component_id:E.string().optional(),schematic_symbol_id:E.string().optional(),center:Zr,radius:Jn,stroke_width:Jn.nullable().optional(),color:E.string().default("#000000"),is_filled:E.boolean().default(!1),fill_color:E.string().optional(),is_dashed:E.boolean().default(!1),subcircuit_id:E.string().optional()}).describe("Draws a styled circle on the schematic"),Rtn=E.object({type:E.literal("schematic_arc"),schematic_arc_id:xo("schematic_arc"),schematic_component_id:E.string().optional(),schematic_symbol_id:E.string().optional(),center:Zr,radius:Jn,start_angle_degrees:Gm,end_angle_degrees:Gm,direction:E.enum(["clockwise","counterclockwise"]).default("counterclockwise"),stroke_width:Jn.nullable().optional(),color:E.string().default("#000000"),is_dashed:E.boolean().default(!1),subcircuit_id:E.string().optional()}).describe("Draws a styled arc on the schematic"),Qtn=E.object({type:E.literal("schematic_trace"),schematic_trace_id:E.string(),source_trace_id:E.string().optional(),junctions:E.array(E.object({x:E.number(),y:E.number()})),edges:E.array(E.object({from:E.object({x:E.number(),y:E.number()}),to:E.object({x:E.number(),y:E.number()}),is_crossing:E.boolean().optional(),from_schematic_port_id:E.string().optional(),to_schematic_port_id:E.string().optional()})),subcircuit_id:E.string().optional(),subcircuit_connectivity_map_key:E.string().optional()}),Ufr=E.enum(["center","left","right","top","bottom"]),ktn=E.object({type:E.literal("schematic_text"),schematic_component_id:E.string().optional(),schematic_symbol_id:E.string().optional(),schematic_text_id:E.string(),text:E.string(),font_size:E.number().default(0.18),position:E.object({x:Jn,y:Jn}),rotation:E.number().default(0),anchor:E.union([Ufr.describe("legacy"),EB]).default("center"),color:E.string().default("#000000"),subcircuit_id:E.string().optional()}),Ltn=E.object({type:E.literal("schematic_port"),schematic_port_id:E.string(),source_port_id:E.string(),schematic_component_id:E.string().optional(),center:Zr,facing_direction:E.enum(["up","down","left","right"]).optional(),distance_from_component_edge:E.number().optional(),side_of_component:E.enum(["top","bottom","left","right"]).optional(),true_ccw_index:E.number().optional(),pin_number:E.number().optional(),display_pin_label:E.string().optional(),subcircuit_id:E.string().optional(),is_connected:E.boolean().optional(),has_input_arrow:E.boolean().optional(),has_output_arrow:E.boolean().optional(),is_drawn_with_inversion_circle:E.boolean().optional()}).describe("Defines a port on a schematic component"),Htn=E.object({type:E.literal("schematic_net_label"),schematic_net_label_id:xo("schematic_net_label"),schematic_trace_id:E.string().optional(),source_trace_id:E.string().optional(),source_net_id:E.string(),center:Zr,anchor_position:Zr.optional(),anchor_side:E.enum(["top","bottom","left","right"]),text:E.string(),symbol_name:E.string().optional(),is_movable:E.boolean().optional(),subcircuit_id:E.string().optional()}),Ftn=Ch.extend({type:E.literal("schematic_error"),schematic_error_id:E.string(),error_type:E.literal("schematic_port_not_found").default("schematic_port_not_found"),subcircuit_id:E.string().optional()}).describe("Defines a schematic error on the schematic"),ztn=Ch.extend({type:E.literal("schematic_layout_error"),schematic_layout_error_id:xo("schematic_layout_error"),error_type:E.literal("schematic_layout_error").default("schematic_layout_error"),source_group_id:E.string(),schematic_group_id:E.string(),subcircuit_id:E.string().optional()}).describe("Error emitted when schematic layout fails for a group"),Gbe=E.object({type:E.literal("schematic_debug_object"),label:E.string().optional(),subcircuit_id:E.string().optional()}),Otn=Gbe.extend({shape:E.literal("rect"),center:Zr,size:kJe}),Vtn=Gbe.extend({shape:E.literal("line"),start:Zr,end:Zr}),Ytn=Gbe.extend({shape:E.literal("point"),center:Zr}),Gtn=E.discriminatedUnion("shape",[Otn,Vtn,Ytn]),Utn=E.object({type:E.literal("schematic_voltage_probe"),schematic_voltage_probe_id:E.string(),source_component_id:E.string().optional(),name:E.string().optional(),position:Zr,schematic_trace_id:E.string(),voltage:fB.optional(),subcircuit_id:E.string().optional(),color:E.string().optional(),label_alignment:EB.optional()}).describe("Defines a voltage probe measurement point on a schematic trace"),Wtn=E.object({type:E.literal("schematic_manual_edit_conflict_warning"),schematic_manual_edit_conflict_warning_id:xo("schematic_manual_edit_conflict_warning"),warning_type:E.literal("schematic_manual_edit_conflict_warning").default("schematic_manual_edit_conflict_warning"),message:E.string(),schematic_component_id:E.string(),schematic_group_id:E.string().optional(),subcircuit_id:E.string().optional(),source_component_id:E.string()}).describe("Warning emitted when a component has both manual placement and explicit schX/schY coordinates"),Xtn=E.object({type:E.literal("schematic_group"),schematic_group_id:xo("schematic_group"),source_group_id:E.string(),is_subcircuit:E.boolean().optional(),subcircuit_id:E.string().optional(),width:ur,height:ur,center:Zr,schematic_component_ids:E.array(E.string()),show_as_schematic_box:E.boolean().optional(),name:E.string().optional(),description:E.string().optional()}).describe("Defines a group of components on the schematic"),jtn=E.object({type:E.literal("schematic_table"),schematic_table_id:xo("schematic_table"),anchor_position:Zr,column_widths:E.array(Jn),row_heights:E.array(Jn),cell_padding:Jn.optional(),border_width:Jn.optional(),subcircuit_id:E.string().optional(),schematic_component_id:E.string().optional(),anchor:EB.optional()}).describe("Defines a table on the schematic"),Ktn=E.object({type:E.literal("schematic_table_cell"),schematic_table_cell_id:xo("schematic_table_cell"),schematic_table_id:E.string(),start_row_index:E.number(),end_row_index:E.number(),start_column_index:E.number(),end_column_index:E.number(),text:E.string().optional(),center:Zr,width:Jn,height:Jn,horizontal_align:E.enum(["left","center","right"]).optional(),vertical_align:E.enum(["top","middle","bottom"]).optional(),font_size:Jn.optional(),subcircuit_id:E.string().optional()}).describe("Defines a cell within a schematic_table"),$tn=E.object({type:E.literal("schematic_sheet"),schematic_sheet_id:xo("schematic_sheet"),name:E.string().optional(),subcircuit_id:E.string().optional()}).describe("Defines a schematic sheet or page that components can be placed on"),qtn=E.object({x:Jn,y:Jn,bulge:E.number().optional()}),DKe=E.object({vertices:E.array(qtn)}),Jtn=E.object({outer_ring:DKe,inner_rings:E.array(DKe).default([])}),Ztn=E.object({x:Jn,y:Jn,via:E.boolean().optional(),via_to_layer:Dc.optional()}),Wfr=E.array(Ztn),enn=E.object({x:Jn,y:Jn,via:E.boolean().optional(),to_layer:Dc.optional(),trace_width:Jn.optional()}),tnn=E.object({min_trace_width:ur.optional(),min_board_edge_clearance:ur.optional(),min_via_hole_edge_to_via_hole_edge_clearance:ur.optional(),min_plated_hole_drill_edge_to_drill_edge_clearance:ur.optional(),min_trace_to_pad_edge_clearance:ur.optional(),min_pad_edge_to_pad_edge_clearance:ur.optional(),min_same_net_trace_edge_to_trace_edge_clearance:ur.optional(),min_different_net_trace_edge_to_trace_edge_clearance:ur.optional(),min_via_hole_diameter:ur.optional(),min_via_pad_diameter:ur.optional()}),nnn=E.object({type:E.literal("pcb_component"),pcb_component_id:xo("pcb_component"),source_component_id:E.string(),center:Zr,layer:Dc,rotation:Gm,display_offset_x:E.string().optional().describe("How to display the x offset for this part, usually corresponding with how the user specified it"),display_offset_y:E.string().optional().describe("How to display the y offset for this part, usually corresponding with how the user specified it"),width:ur,height:ur,do_not_place:E.boolean().optional(),is_allowed_to_be_off_board:E.boolean().optional(),subcircuit_id:E.string().optional(),pcb_group_id:E.string().optional(),position_mode:E.enum(["packed","relative_to_group_anchor","relative_to_another_component","none"]).optional(),anchor_position:Zr.optional(),anchor_alignment:EB.optional(),positioned_relative_to_pcb_group_id:E.string().optional(),positioned_relative_to_pcb_board_id:E.string().optional(),cable_insertion_center:Zr.optional(),insertion_direction:E.enum(["from_above","from_left","from_right","from_front","from_back"]).optional(),metadata:E.object({kicad_footprint:Gen.optional()}).optional(),obstructs_within_bounds:E.boolean().default(!0).describe("Does this component take up all the space within its bounds on a layer. This is generally true except for when separated pin headers are being represented by a single component (in which case, chips can be placed between the pin headers) or for tall modules where chips fit underneath")}).describe("Defines a component on the PCB"),onn=E.object({type:E.literal("pcb_hole"),pcb_hole_id:xo("pcb_hole"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),pcb_component_id:E.string().optional(),hole_shape:E.literal("circle"),hole_diameter:E.number(),x:Jn,y:Jn,is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional()}),Xfr=onn.describe("Defines a circular hole on the PCB"),rnn=E.object({type:E.literal("pcb_hole"),pcb_hole_id:xo("pcb_hole"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),pcb_component_id:E.string().optional(),hole_shape:E.literal("rect"),hole_width:E.number(),hole_height:E.number(),x:Jn,y:Jn,is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional()}),jfr=rnn.describe("Defines a rectangular (square-capable) hole on the PCB. Use equal width/height for square."),inn=E.object({type:E.literal("pcb_hole"),pcb_hole_id:xo("pcb_hole"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),pcb_component_id:E.string().optional(),hole_shape:E.enum(["circle","square"]),hole_diameter:E.number(),x:Jn,y:Jn,is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional()}),Kfr=inn.describe("Defines a circular or square hole on the PCB"),snn=E.object({type:E.literal("pcb_hole"),pcb_hole_id:xo("pcb_hole"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),pcb_component_id:E.string().optional(),hole_shape:E.literal("oval"),hole_width:E.number(),hole_height:E.number(),x:Jn,y:Jn,is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional()}),$fr=snn.describe("Defines an oval hole on the PCB"),ann=E.object({type:E.literal("pcb_hole"),pcb_hole_id:xo("pcb_hole"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),pcb_component_id:E.string().optional(),hole_shape:E.literal("pill"),hole_width:E.number(),hole_height:E.number(),x:Jn,y:Jn,is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional()}),qfr=ann.describe("Defines a pill-shaped hole on the PCB"),cnn=E.object({type:E.literal("pcb_hole"),pcb_hole_id:xo("pcb_hole"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),pcb_component_id:E.string().optional(),hole_shape:E.literal("rotated_pill"),hole_width:E.number(),hole_height:E.number(),x:Jn,y:Jn,ccw_rotation:Gm,is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional()}),Jfr=cnn.describe("Defines a rotated pill-shaped hole on the PCB"),lnn=inn.or(snn).or(ann).or(cnn).or(onn).or(rnn),Zfr=E.object({type:E.literal("pcb_plated_hole"),shape:E.literal("circle"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),outer_diameter:E.number(),hole_diameter:E.number(),is_covered_with_solder_mask:E.boolean().optional(),x:Jn,y:Jn,layers:E.array(Dc),port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),pcb_plated_hole_id:xo("pcb_plated_hole"),soldermask_margin:E.number().optional()}),e2r=E.object({type:E.literal("pcb_plated_hole"),shape:E.enum(["oval","pill"]),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),outer_width:E.number(),outer_height:E.number(),hole_width:E.number(),hole_height:E.number(),is_covered_with_solder_mask:E.boolean().optional(),x:Jn,y:Jn,ccw_rotation:Gm,layers:E.array(Dc),port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),pcb_plated_hole_id:xo("pcb_plated_hole"),soldermask_margin:E.number().optional()}),t2r=E.object({type:E.literal("pcb_plated_hole"),shape:E.literal("circular_hole_with_rect_pad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),hole_shape:E.literal("circle"),pad_shape:E.literal("rect"),hole_diameter:E.number(),rect_pad_width:E.number(),rect_pad_height:E.number(),rect_border_radius:E.number().optional(),hole_offset_x:Jn.default(0),hole_offset_y:Jn.default(0),is_covered_with_solder_mask:E.boolean().optional(),x:Jn,y:Jn,layers:E.array(Dc),port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),pcb_plated_hole_id:xo("pcb_plated_hole"),soldermask_margin:E.number().optional(),rect_ccw_rotation:Gm.optional()}),n2r=E.object({type:E.literal("pcb_plated_hole"),shape:E.literal("pill_hole_with_rect_pad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),hole_shape:E.literal("pill"),pad_shape:E.literal("rect"),hole_width:E.number(),hole_height:E.number(),rect_pad_width:E.number(),rect_pad_height:E.number(),rect_border_radius:E.number().optional(),hole_offset_x:Jn.default(0),hole_offset_y:Jn.default(0),is_covered_with_solder_mask:E.boolean().optional(),x:Jn,y:Jn,layers:E.array(Dc),port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),pcb_plated_hole_id:xo("pcb_plated_hole"),soldermask_margin:E.number().optional()}),o2r=E.object({type:E.literal("pcb_plated_hole"),shape:E.literal("rotated_pill_hole_with_rect_pad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),hole_shape:E.literal("rotated_pill"),pad_shape:E.literal("rect"),hole_width:E.number(),hole_height:E.number(),hole_ccw_rotation:Gm,rect_pad_width:E.number(),rect_pad_height:E.number(),rect_border_radius:E.number().optional(),rect_ccw_rotation:Gm,hole_offset_x:Jn.default(0),hole_offset_y:Jn.default(0),is_covered_with_solder_mask:E.boolean().optional(),x:Jn,y:Jn,layers:E.array(Dc),port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),pcb_plated_hole_id:xo("pcb_plated_hole"),soldermask_margin:E.number().optional()}),r2r=E.object({type:E.literal("pcb_plated_hole"),shape:E.literal("hole_with_polygon_pad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),hole_shape:E.enum(["circle","oval","pill","rotated_pill"]),hole_diameter:E.number().optional(),hole_width:E.number().optional(),hole_height:E.number().optional(),pad_outline:E.array(E.object({x:Jn,y:Jn})).min(3),hole_offset_x:Jn.default(0),hole_offset_y:Jn.default(0),is_covered_with_solder_mask:E.boolean().optional(),x:Jn,y:Jn,layers:E.array(Dc),port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),pcb_plated_hole_id:xo("pcb_plated_hole"),soldermask_margin:E.number().optional(),ccw_rotation:Gm.optional()}),hnn=E.union([Zfr,e2r,t2r,n2r,o2r,r2r]),dnn=E.object({type:E.literal("pcb_port"),pcb_port_id:xo("pcb_port"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),source_port_id:E.string(),pcb_component_id:E.string().optional(),x:Jn,y:Jn,layers:E.array(Dc),is_board_pinout:E.boolean().optional()}).describe("Defines a port on the PCB"),i2r=E.object({type:E.literal("pcb_smtpad"),shape:E.literal("circle"),pcb_smtpad_id:xo("pcb_smtpad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:Jn,y:Jn,radius:E.number(),layer:Dc,port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional()}),s2r=E.object({type:E.literal("pcb_smtpad"),shape:E.literal("rect"),pcb_smtpad_id:xo("pcb_smtpad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:Jn,y:Jn,width:E.number(),height:E.number(),rect_border_radius:E.number().optional(),corner_radius:E.number().optional(),layer:Dc,port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional(),soldermask_margin_left:E.number().optional(),soldermask_margin_top:E.number().optional(),soldermask_margin_right:E.number().optional(),soldermask_margin_bottom:E.number().optional()}),a2r=E.object({type:E.literal("pcb_smtpad"),shape:E.literal("rotated_rect"),pcb_smtpad_id:xo("pcb_smtpad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:Jn,y:Jn,width:E.number(),height:E.number(),rect_border_radius:E.number().optional(),corner_radius:E.number().optional(),ccw_rotation:Gm,layer:Dc,port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional(),soldermask_margin_left:E.number().optional(),soldermask_margin_top:E.number().optional(),soldermask_margin_right:E.number().optional(),soldermask_margin_bottom:E.number().optional()}),unn=E.object({type:E.literal("pcb_smtpad"),shape:E.literal("pill"),pcb_smtpad_id:xo("pcb_smtpad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:Jn,y:Jn,width:E.number(),height:E.number(),radius:E.number(),layer:Dc,port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional()}),c2r=E.object({type:E.literal("pcb_smtpad"),shape:E.literal("rotated_pill"),pcb_smtpad_id:xo("pcb_smtpad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:Jn,y:Jn,width:E.number(),height:E.number(),radius:E.number(),ccw_rotation:Gm,layer:Dc,port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional()}),l2r=E.object({type:E.literal("pcb_smtpad"),shape:E.literal("polygon"),pcb_smtpad_id:xo("pcb_smtpad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),points:E.array(Zr),layer:Dc,port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional()}),pnn=E.discriminatedUnion("shape",[i2r,s2r,a2r,c2r,unn,l2r]).describe("Defines an SMT pad on the PCB"),h2r=E.object({type:E.literal("pcb_solder_paste"),shape:E.literal("circle"),pcb_solder_paste_id:xo("pcb_solder_paste"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:Jn,y:Jn,radius:E.number(),layer:Dc,pcb_component_id:E.string().optional(),pcb_smtpad_id:E.string().optional()}),d2r=E.object({type:E.literal("pcb_solder_paste"),shape:E.literal("rect"),pcb_solder_paste_id:xo("pcb_solder_paste"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:Jn,y:Jn,width:E.number(),height:E.number(),layer:Dc,pcb_component_id:E.string().optional(),pcb_smtpad_id:E.string().optional()}),u2r=E.object({type:E.literal("pcb_solder_paste"),shape:E.literal("pill"),pcb_solder_paste_id:xo("pcb_solder_paste"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:Jn,y:Jn,width:E.number(),height:E.number(),radius:E.number(),layer:Dc,pcb_component_id:E.string().optional(),pcb_smtpad_id:E.string().optional()}),p2r=E.object({type:E.literal("pcb_solder_paste"),shape:E.literal("rotated_rect"),pcb_solder_paste_id:xo("pcb_solder_paste"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:Jn,y:Jn,width:E.number(),height:E.number(),ccw_rotation:Jn,layer:Dc,pcb_component_id:E.string().optional(),pcb_smtpad_id:E.string().optional()}),m2r=E.object({type:E.literal("pcb_solder_paste"),shape:E.literal("oval"),pcb_solder_paste_id:xo("pcb_solder_paste"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:Jn,y:Jn,width:E.number(),height:E.number(),layer:Dc,pcb_component_id:E.string().optional(),pcb_smtpad_id:E.string().optional()}),mnn=E.union([h2r,d2r,u2r,p2r,m2r]).describe("Defines solderpaste on the PCB"),_nn=E.object({type:E.literal("pcb_text"),pcb_text_id:xo("pcb_text"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),text:E.string(),center:Zr,layer:Dc,width:ur,height:ur,lines:E.number(),align:E.enum(["bottom-left"])}).describe("Defines text on the PCB"),gnn=E.object({route_type:E.literal("wire"),x:Jn,y:Jn,width:Jn,copper_pour_id:E.string().optional(),is_inside_copper_pour:E.boolean().optional(),start_pcb_port_id:E.string().optional(),end_pcb_port_id:E.string().optional(),layer:Dc}),Ann=E.object({route_type:E.literal("via"),x:Jn,y:Jn,copper_pour_id:E.string().optional(),is_inside_copper_pour:E.boolean().optional(),hole_diameter:Jn.optional(),outer_diameter:Jn.optional(),from_layer:Dc,to_layer:Dc}),fnn=E.union([gnn,Ann]),ynn=E.object({type:E.literal("pcb_trace"),source_trace_id:E.string().optional(),pcb_component_id:E.string().optional(),pcb_trace_id:xo("pcb_trace"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),route_thickness_mode:E.enum(["constant","interpolated"]).default("constant").optional(),route_order_index:E.number().optional(),should_round_corners:E.boolean().optional(),trace_length:E.number().optional(),highlight_color:E.string().optional(),route:E.array(fnn)}).describe("Defines a trace on the PCB"),xnn=E.object({type:E.literal("pcb_trace_warning"),pcb_trace_warning_id:xo("pcb_trace_warning"),warning_type:E.literal("pcb_trace_warning").default("pcb_trace_warning"),message:E.string(),center:Zr.optional(),pcb_trace_id:E.string(),source_trace_id:E.string(),pcb_component_ids:E.array(E.string()),pcb_port_ids:E.array(E.string()),subcircuit_id:E.string().optional()}).describe("Defines a trace warning on the PCB"),Cnn=Ch.extend({type:E.literal("pcb_trace_error"),pcb_trace_error_id:xo("pcb_trace_error"),error_type:E.literal("pcb_trace_error").default("pcb_trace_error"),center:Zr.optional(),pcb_trace_id:E.string(),source_trace_id:E.string(),pcb_component_ids:E.array(E.string()),pcb_port_ids:E.array(E.string()),subcircuit_id:E.string().optional()}).describe("Defines a trace error on the PCB"),bnn=Ch.extend({type:E.literal("pcb_trace_missing_error"),pcb_trace_missing_error_id:xo("pcb_trace_missing_error"),error_type:E.literal("pcb_trace_missing_error").default("pcb_trace_missing_error"),center:Zr.optional(),source_trace_id:E.string(),pcb_component_ids:E.array(E.string()),pcb_port_ids:E.array(E.string()),subcircuit_id:E.string().optional()}).describe("Defines an error when a source trace has no corresponding PCB trace"),Inn=Ch.extend({type:E.literal("pcb_port_not_matched_error"),pcb_error_id:xo("pcb_error"),error_type:E.literal("pcb_port_not_matched_error").default("pcb_port_not_matched_error"),pcb_component_ids:E.array(E.string()),subcircuit_id:E.string().optional()}).describe("Defines a trace error on the PCB where a port is not matched"),vnn=Ch.extend({type:E.literal("pcb_port_not_connected_error"),pcb_port_not_connected_error_id:xo("pcb_port_not_connected_error"),error_type:E.literal("pcb_port_not_connected_error").default("pcb_port_not_connected_error"),pcb_port_ids:E.array(E.string()),pcb_component_ids:E.array(E.string()),subcircuit_id:E.string().optional()}).describe("Defines an error when a pcb port is not connected to any trace"),Snn=E.object({type:E.literal("pcb_net"),pcb_net_id:xo("pcb_net"),source_net_id:E.string().optional(),highlight_color:E.string().optional()}).describe("Defines a net on the PCB"),Pnn=E.object({type:E.literal("pcb_via"),pcb_via_id:xo("pcb_via"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),subcircuit_connectivity_map_key:E.string().optional(),x:Jn,y:Jn,outer_diameter:Jn.default("0.6mm"),hole_diameter:Jn.default("0.25mm"),from_layer:Dc.optional(),to_layer:Dc.optional(),layers:E.array(Dc),pcb_trace_id:E.string().optional(),net_is_assignable:E.boolean().optional(),net_assigned:E.boolean().optional(),is_tented:E.boolean().optional()}).describe("Defines a via on the PCB"),Enn=E.object({type:E.literal("pcb_board"),pcb_board_id:xo("pcb_board"),pcb_panel_id:E.string().optional(),carrier_pcb_board_id:E.string().optional(),is_subcircuit:E.boolean().optional(),subcircuit_id:E.string().optional(),is_mounted_to_carrier_board:E.boolean().optional(),width:ur.optional(),height:ur.optional(),center:Zr,display_offset_x:E.string().optional().describe("How to display the x offset for this board, usually corresponding with how the user specified it"),display_offset_y:E.string().optional().describe("How to display the y offset for this board, usually corresponding with how the user specified it"),thickness:ur.optional().default(1.4),num_layers:E.number().optional().default(4),outline:E.array(Zr).optional(),shape:E.enum(["rect","polygon"]).optional(),material:E.enum(["fr4","fr1"]).default("fr4"),anchor_position:Zr.optional(),anchor_alignment:EB.optional(),position_mode:E.enum(["relative_to_panel_anchor","none"]).optional()}).merge(tnn).describe("Defines the board outline of the PCB"),Mnn=E.object({type:E.literal("pcb_panel"),pcb_panel_id:xo("pcb_panel"),width:ur,height:ur,center:Zr,thickness:ur.optional().default(1.4),covered_with_solder_mask:E.boolean().optional().default(!0)}).describe("Defines a PCB panel that can contain multiple boards"),wnn=Ch.extend({type:E.literal("pcb_placement_error"),pcb_placement_error_id:xo("pcb_placement_error"),error_type:E.literal("pcb_placement_error").default("pcb_placement_error"),subcircuit_id:E.string().optional()}).describe("Defines a placement error on the PCB"),Bnn=Ch.extend({type:E.literal("pcb_panelization_placement_error"),pcb_panelization_placement_error_id:xo("pcb_panelization_placement_error"),error_type:E.literal("pcb_panelization_placement_error").default("pcb_panelization_placement_error"),pcb_panel_id:E.string().optional(),pcb_board_id:E.string().optional(),subcircuit_id:E.string().optional()}).describe("Defines a panelization placement error on the PCB"),Tnn=E.object({type:E.literal("pcb_trace_hint"),pcb_trace_hint_id:xo("pcb_trace_hint"),pcb_port_id:E.string(),pcb_component_id:E.string(),route:E.array(enn),subcircuit_id:E.string().optional()}).describe("A hint that can be used during generation of a PCB trace"),Dnn=E.object({type:E.literal("pcb_silkscreen_line"),pcb_silkscreen_line_id:xo("pcb_silkscreen_line"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),stroke_width:Jn.default("0.1mm"),x1:Jn,y1:Jn,x2:Jn,y2:Jn,layer:u2}).describe("Defines a silkscreen line on the PCB"),Nnn=E.object({type:E.literal("pcb_silkscreen_path"),pcb_silkscreen_path_id:xo("pcb_silkscreen_path"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),layer:u2,route:E.array(Zr),stroke_width:ur}).describe("Defines a silkscreen path on the PCB"),Rnn=E.object({type:E.literal("pcb_silkscreen_text"),pcb_silkscreen_text_id:xo("pcb_silkscreen_text"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),font:E.literal("tscircuit2024").default("tscircuit2024"),font_size:Jn.default("0.2mm"),pcb_component_id:E.string(),text:E.string(),is_knockout:E.boolean().default(!1).optional(),knockout_padding:E.object({left:ur,top:ur,bottom:ur,right:ur}).default({left:"0.2mm",top:"0.2mm",bottom:"0.2mm",right:"0.2mm"}).optional(),ccw_rotation:E.number().optional(),layer:Dc,is_mirrored:E.boolean().default(!1).optional(),anchor_position:Zr.default({x:0,y:0}),anchor_alignment:EB.default("center")}).describe("Defines silkscreen text on the PCB"),Qnn=E.object({type:E.literal("pcb_copper_text"),pcb_copper_text_id:xo("pcb_copper_text"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),font:E.literal("tscircuit2024").default("tscircuit2024"),font_size:Jn.default("0.2mm"),pcb_component_id:E.string(),text:E.string(),is_knockout:E.boolean().default(!1).optional(),knockout_padding:E.object({left:ur,top:ur,bottom:ur,right:ur}).default({left:"0.2mm",top:"0.2mm",bottom:"0.2mm",right:"0.2mm"}).optional(),ccw_rotation:E.number().optional(),layer:Dc,is_mirrored:E.boolean().default(!1).optional(),anchor_position:Zr.default({x:0,y:0}),anchor_alignment:EB.default("center")}).describe("Defines copper text on the PCB"),knn=E.object({type:E.literal("pcb_silkscreen_rect"),pcb_silkscreen_rect_id:xo("pcb_silkscreen_rect"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),center:Zr,width:ur,height:ur,layer:Dc,stroke_width:ur.default("1mm"),corner_radius:ur.optional(),is_filled:E.boolean().default(!0).optional(),has_stroke:E.boolean().optional(),is_stroke_dashed:E.boolean().optional(),ccw_rotation:E.number().optional()}).describe("Defines a silkscreen rect on the PCB"),Lnn=E.object({type:E.literal("pcb_silkscreen_circle"),pcb_silkscreen_circle_id:xo("pcb_silkscreen_circle"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),center:Zr,radius:ur,layer:u2,stroke_width:ur.default("1mm"),is_filled:E.boolean().optional()}).describe("Defines a silkscreen circle on the PCB"),Hnn=E.object({type:E.literal("pcb_silkscreen_oval"),pcb_silkscreen_oval_id:xo("pcb_silkscreen_oval"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),center:Zr,radius_x:Jn,radius_y:Jn,layer:u2,ccw_rotation:Gm.optional()}).describe("Defines a silkscreen oval on the PCB"),Fnn=E.object({type:E.literal("pcb_silkscreen_pill"),pcb_silkscreen_pill_id:xo("pcb_silkscreen_pill"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),center:Zr,width:ur,height:ur,layer:Dc,ccw_rotation:E.number().optional()}).describe("Defines a silkscreen pill on the PCB"),znn=E.object({type:E.literal("pcb_fabrication_note_text"),pcb_fabrication_note_text_id:xo("pcb_fabrication_note_text"),subcircuit_id:E.string().optional(),pcb_group_id:E.string().optional(),font:E.literal("tscircuit2024").default("tscircuit2024"),font_size:Jn.default("1mm"),pcb_component_id:E.string(),text:E.string(),layer:u2,anchor_position:Zr.default({x:0,y:0}),anchor_alignment:E.enum(["center","top_left","top_right","bottom_left","bottom_right"]).default("center"),color:E.string().optional()}).describe("Defines a fabrication note in text on the PCB, useful for leaving notes for assemblers or fabricators"),Onn=E.object({type:E.literal("pcb_fabrication_note_path"),pcb_fabrication_note_path_id:xo("pcb_fabrication_note_path"),pcb_component_id:E.string(),subcircuit_id:E.string().optional(),layer:Dc,route:E.array(Zr),stroke_width:ur,color:E.string().optional()}).describe("Defines a fabrication path on the PCB for fabricators or assemblers"),Vnn=E.object({type:E.literal("pcb_fabrication_note_rect"),pcb_fabrication_note_rect_id:xo("pcb_fabrication_note_rect"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),center:Zr,width:ur,height:ur,layer:u2,stroke_width:ur.default("0.1mm"),corner_radius:ur.optional(),is_filled:E.boolean().optional(),has_stroke:E.boolean().optional(),is_stroke_dashed:E.boolean().optional(),color:E.string().optional()}).describe("Defines a fabrication note rectangle on the PCB"),Ynn=E.object({type:E.literal("pcb_fabrication_note_dimension"),pcb_fabrication_note_dimension_id:xo("pcb_fabrication_note_dimension"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),layer:u2,from:Zr,to:Zr,text:E.string().optional(),text_ccw_rotation:E.number().optional(),offset:ur.optional(),offset_distance:ur.optional(),offset_direction:E.object({x:E.number(),y:E.number()}).optional(),font:E.literal("tscircuit2024").default("tscircuit2024"),font_size:ur.default("1mm"),color:E.string().optional(),arrow_size:ur.default("1mm")}).describe("Defines a measurement annotation within PCB fabrication notes"),Gnn=E.object({type:E.literal("pcb_note_text"),pcb_note_text_id:xo("pcb_note_text"),pcb_component_id:E.string().optional(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),name:E.string().optional(),font:E.literal("tscircuit2024").default("tscircuit2024"),font_size:Jn.default("1mm"),text:E.string().optional(),anchor_position:Zr.default({x:0,y:0}),anchor_alignment:E.enum(["center","top_left","top_right","bottom_left","bottom_right"]).default("center"),layer:u2.default("top"),is_mirrored_from_top_view:E.boolean().optional(),color:E.string().optional()}).describe("Defines a documentation note in text on the PCB"),Unn=E.object({type:E.literal("pcb_note_rect"),pcb_note_rect_id:xo("pcb_note_rect"),pcb_component_id:E.string().optional(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),name:E.string().optional(),text:E.string().optional(),center:Zr,width:ur,height:ur,layer:u2.default("top"),stroke_width:ur.default("0.1mm"),corner_radius:ur.optional(),is_filled:E.boolean().optional(),has_stroke:E.boolean().optional(),is_stroke_dashed:E.boolean().optional(),color:E.string().optional()}).describe("Defines a rectangular documentation note on the PCB"),Wnn=E.object({type:E.literal("pcb_note_path"),pcb_note_path_id:xo("pcb_note_path"),pcb_component_id:E.string().optional(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),name:E.string().optional(),text:E.string().optional(),route:E.array(Zr),layer:u2.default("top"),stroke_width:ur.default("0.1mm"),color:E.string().optional()}).describe("Defines a polyline documentation note on the PCB"),Xnn=E.object({type:E.literal("pcb_note_line"),pcb_note_line_id:xo("pcb_note_line"),pcb_component_id:E.string().optional(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),name:E.string().optional(),text:E.string().optional(),x1:Jn,y1:Jn,x2:Jn,y2:Jn,layer:u2.default("top"),stroke_width:Jn.default("0.1mm"),color:E.string().optional(),is_dashed:E.boolean().optional()}).describe("Defines a straight documentation note line on the PCB"),jnn=E.object({type:E.literal("pcb_note_dimension"),pcb_note_dimension_id:xo("pcb_note_dimension"),pcb_component_id:E.string().optional(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),name:E.string().optional(),from:Zr,to:Zr,text:E.string().optional(),text_ccw_rotation:E.number().optional(),offset_distance:ur.optional(),offset_direction:E.object({x:E.number(),y:E.number()}).optional(),font:E.literal("tscircuit2024").default("tscircuit2024"),font_size:ur.default("1mm"),layer:u2.default("top"),color:E.string().optional(),arrow_size:ur.default("1mm")}).describe("Defines a measurement annotation within PCB documentation notes"),Knn=Ch.extend({type:E.literal("pcb_footprint_overlap_error"),pcb_error_id:xo("pcb_error"),error_type:E.literal("pcb_footprint_overlap_error").default("pcb_footprint_overlap_error"),pcb_smtpad_ids:E.array(E.string()).optional(),pcb_plated_hole_ids:E.array(E.string()).optional(),pcb_hole_ids:E.array(E.string()).optional(),pcb_keepout_ids:E.array(E.string()).optional()}).describe("Error emitted when a pcb footprint overlaps with another element"),$nn=Ch.extend({type:E.literal("pcb_courtyard_overlap_error"),pcb_error_id:xo("pcb_error"),error_type:E.literal("pcb_courtyard_overlap_error").default("pcb_courtyard_overlap_error"),pcb_component_ids:E.tuple([E.string(),E.string()])}).describe("Error emitted when the courtyard (CrtYd) of one PCB component overlaps with the courtyard of another"),qnn=E.object({type:E.literal("pcb_keepout"),shape:E.literal("rect"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),center:Zr,width:Jn,height:Jn,pcb_keepout_id:E.string(),layers:E.array(E.string()),description:E.string().optional()}).or(E.object({type:E.literal("pcb_keepout"),shape:E.literal("circle"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),center:Zr,radius:Jn,pcb_keepout_id:E.string(),layers:E.array(E.string()),description:E.string().optional()})),Ube=E.object({type:E.literal("pcb_cutout"),pcb_cutout_id:xo("pcb_cutout"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),pcb_board_id:E.string().optional(),pcb_panel_id:E.string().optional()}),Jnn=Ube.extend({shape:E.literal("rect"),center:Zr,width:ur,height:ur,rotation:Gm.optional(),corner_radius:ur.optional()}),Znn=Ube.extend({shape:E.literal("circle"),center:Zr,radius:ur}),eon=Ube.extend({shape:E.literal("polygon"),points:E.array(Zr)}),ton=Ube.extend({shape:E.literal("path"),route:E.array(Zr),slot_width:ur,slot_length:ur.optional(),space_between_slots:ur.optional(),slot_corner_radius:ur.optional()}),non=E.discriminatedUnion("shape",[Jnn,Znn,eon,ton]).describe("Defines a cutout on the PCB, removing board material."),oon=Ch.extend({type:E.literal("pcb_missing_footprint_error"),pcb_missing_footprint_error_id:xo("pcb_missing_footprint_error"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),error_type:E.literal("pcb_missing_footprint_error").default("pcb_missing_footprint_error"),source_component_id:E.string()}).describe("Defines a missing footprint error on the PCB"),ron=Ch.extend({type:E.literal("external_footprint_load_error"),external_footprint_load_error_id:xo("external_footprint_load_error"),pcb_component_id:E.string(),source_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),footprinter_string:E.string().optional(),error_type:E.literal("external_footprint_load_error").default("external_footprint_load_error")}).describe("Defines an error when an external footprint fails to load"),ion=Ch.extend({type:E.literal("circuit_json_footprint_load_error"),circuit_json_footprint_load_error_id:xo("circuit_json_footprint_load_error"),pcb_component_id:E.string(),source_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),error_type:E.literal("circuit_json_footprint_load_error").default("circuit_json_footprint_load_error"),circuit_json:E.array(E.any()).optional()}).describe("Defines an error when a circuit JSON footprint fails to load"),son=E.object({type:E.literal("pcb_group"),pcb_group_id:xo("pcb_group"),source_group_id:E.string(),is_subcircuit:E.boolean().optional(),subcircuit_id:E.string().optional(),width:ur.optional(),height:ur.optional(),center:Zr,display_offset_x:E.string().optional().describe("How to display the x offset for this group, usually corresponding with how the user specified it"),display_offset_y:E.string().optional().describe("How to display the y offset for this group, usually corresponding with how the user specified it"),outline:E.array(Zr).optional(),anchor_position:Zr.optional(),anchor_alignment:EB.default("center"),position_mode:E.enum(["packed","relative_to_group_anchor","none"]).optional(),positioned_relative_to_pcb_group_id:E.string().optional(),positioned_relative_to_pcb_board_id:E.string().optional(),pcb_component_ids:E.array(E.string()),child_layout_mode:E.enum(["packed","none"]).optional(),name:E.string().optional(),description:E.string().optional(),layout_mode:E.string().optional(),autorouter_configuration:E.object({trace_clearance:ur}).optional(),autorouter_used_string:E.string().optional()}).describe("Defines a group of components on the PCB"),aon=Ch.extend({type:E.literal("pcb_autorouting_error"),pcb_error_id:xo("pcb_autorouting_error"),error_type:E.literal("pcb_autorouting_error").default("pcb_autorouting_error"),subcircuit_id:E.string().optional()}).describe("The autorouting has failed to route a portion of the board"),con=E.object({type:E.literal("pcb_manual_edit_conflict_warning"),pcb_manual_edit_conflict_warning_id:xo("pcb_manual_edit_conflict_warning"),warning_type:E.literal("pcb_manual_edit_conflict_warning").default("pcb_manual_edit_conflict_warning"),message:E.string(),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),source_component_id:E.string()}).describe("Warning emitted when a component has both manual placement and explicit pcbX/pcbY coordinates"),LFt=E.enum(["x-","x+","y+","y-"]),lon=E.object({type:E.literal("pcb_connector_not_in_accessible_orientation_warning"),pcb_connector_not_in_accessible_orientation_warning_id:xo("pcb_connector_not_in_accessible_orientation_warning"),warning_type:E.literal("pcb_connector_not_in_accessible_orientation_warning").default("pcb_connector_not_in_accessible_orientation_warning"),message:E.string(),pcb_component_id:E.string(),source_component_id:E.string().optional(),pcb_board_id:E.string().optional(),facing_direction:LFt,recommended_facing_direction:LFt,subcircuit_id:E.string().optional()}).describe("Warning emitted when a connector PCB component is facing inward toward the board and should be reoriented to an outward-facing direction"),hon=E.object({type:E.literal("supplier_footprint_mismatch_warning"),supplier_footprint_mismatch_warning_id:xo("supplier_footprint_mismatch_warning"),warning_type:E.literal("supplier_footprint_mismatch_warning").default("supplier_footprint_mismatch_warning"),message:E.string(),source_component_id:E.string(),pcb_component_id:E.string().optional(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),supplier_name:HJe.optional(),supplier_part_number:E.string().optional(),supplier_footprint_url:E.string().optional(),footprint_copper_intersection_over_union:E.number()}).describe("Warning emitted when a supplier part footprint does not match the expected footprint"),don=E.object({type:E.literal("pcb_breakout_point"),pcb_breakout_point_id:xo("pcb_breakout_point"),pcb_group_id:E.string(),subcircuit_id:E.string().optional(),source_trace_id:E.string().optional(),source_port_id:E.string().optional(),source_net_id:E.string().optional(),x:Jn,y:Jn}).describe("Defines a routing target within a pcb_group for a source_trace or source_net"),uon=E.object({type:E.literal("pcb_ground_plane"),pcb_ground_plane_id:xo("pcb_ground_plane"),source_pcb_ground_plane_id:E.string(),source_net_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional()}).describe("Defines a ground plane on the PCB"),pon=E.object({type:E.literal("pcb_ground_plane_region"),pcb_ground_plane_region_id:xo("pcb_ground_plane_region"),pcb_ground_plane_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),layer:Dc,points:E.array(Zr)}).describe("Defines a polygon region of a ground plane"),mon=E.object({type:E.literal("pcb_thermal_spoke"),pcb_thermal_spoke_id:xo("pcb_thermal_spoke"),pcb_ground_plane_id:E.string(),shape:E.string(),spoke_count:E.number(),spoke_thickness:Jn,spoke_inner_diameter:Jn,spoke_outer_diameter:Jn,pcb_plated_hole_id:E.string().optional(),subcircuit_id:E.string().optional()}).describe("Pattern for connecting a ground plane to a plated hole"),cZe=E.object({type:E.literal("pcb_copper_pour"),pcb_copper_pour_id:xo("pcb_copper_pour"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),layer:Dc,source_net_id:E.string().optional(),covered_with_solder_mask:E.boolean().optional().default(!0)}),_on=cZe.extend({shape:E.literal("rect"),center:Zr,width:ur,height:ur,rotation:Gm.optional()}),gon=cZe.extend({shape:E.literal("brep"),brep_shape:Jtn}),Aon=cZe.extend({shape:E.literal("polygon"),points:E.array(Zr)}),fon=E.discriminatedUnion("shape",[_on,gon,Aon]).describe("Defines a copper pour on the PCB."),yon=Ch.extend({type:E.literal("pcb_component_outside_board_error"),pcb_component_outside_board_error_id:xo("pcb_component_outside_board_error"),error_type:E.literal("pcb_component_outside_board_error").default("pcb_component_outside_board_error"),pcb_component_id:E.string(),pcb_board_id:E.string(),component_center:Zr,component_bounds:E.object({min_x:E.number(),max_x:E.number(),min_y:E.number(),max_y:E.number()}),subcircuit_id:E.string().optional(),source_component_id:E.string().optional()}).describe("Error emitted when a PCB component is placed outside the board boundaries"),xon=Ch.extend({type:E.literal("pcb_component_not_on_board_edge_error"),pcb_component_not_on_board_edge_error_id:xo("pcb_component_not_on_board_edge_error"),error_type:E.literal("pcb_component_not_on_board_edge_error").default("pcb_component_not_on_board_edge_error"),pcb_component_id:E.string(),pcb_board_id:E.string(),component_center:Zr,pad_to_nearest_board_edge_distance:E.number(),source_component_id:E.string().optional(),subcircuit_id:E.string().optional()}).describe("Error emitted when a component that must be placed on the board edge is centered away from the edge"),Con=Ch.extend({type:E.literal("pcb_component_invalid_layer_error"),pcb_component_invalid_layer_error_id:xo("pcb_component_invalid_layer_error"),error_type:E.literal("pcb_component_invalid_layer_error").default("pcb_component_invalid_layer_error"),pcb_component_id:E.string().optional(),source_component_id:E.string(),layer:Dc,subcircuit_id:E.string().optional()}).describe("Error emitted when a component is placed on an invalid layer (components can only be on 'top' or 'bottom' layers)"),bon=Ch.extend({type:E.literal("pcb_via_clearance_error"),pcb_error_id:xo("pcb_error"),error_type:E.literal("pcb_via_clearance_error").default("pcb_via_clearance_error"),pcb_via_ids:E.array(E.string()).min(2),minimum_clearance:Jn.optional(),actual_clearance:Jn.optional(),pcb_center:E.object({x:E.number().optional(),y:E.number().optional()}).optional(),subcircuit_id:E.string().optional()}).describe("Error emitted when vias are closer than the allowed clearance"),Ion=Ch.extend({type:E.literal("pcb_via_trace_clearance_error"),pcb_via_trace_clearance_error_id:xo("pcb_via_trace_clearance_error"),error_type:E.literal("pcb_via_trace_clearance_error").default("pcb_via_trace_clearance_error"),pcb_via_id:E.string(),pcb_trace_id:E.string(),minimum_clearance:Jn.optional(),actual_clearance:Jn.optional(),center:E.object({x:E.number().optional(),y:E.number().optional()}).optional(),subcircuit_id:E.string().optional()}).describe("Error emitted when a via and trace are closer than the allowed clearance"),von=Ch.extend({type:E.literal("pcb_pad_pad_clearance_error"),pcb_pad_pad_clearance_error_id:xo("pcb_pad_pad_clearance_error"),error_type:E.literal("pcb_pad_pad_clearance_error").default("pcb_pad_pad_clearance_error"),pcb_pad_ids:E.array(E.string()).min(2),minimum_clearance:Jn.optional(),actual_clearance:Jn.optional(),center:E.object({x:E.number().optional(),y:E.number().optional()}).optional(),subcircuit_id:E.string().optional()}).describe("Error emitted when pads are closer than the allowed clearance"),Son=Ch.extend({type:E.literal("pcb_pad_trace_clearance_error"),pcb_pad_trace_clearance_error_id:xo("pcb_pad_trace_clearance_error"),error_type:E.literal("pcb_pad_trace_clearance_error").default("pcb_pad_trace_clearance_error"),pcb_pad_id:E.string(),pcb_trace_id:E.string(),minimum_clearance:Jn.optional(),actual_clearance:Jn.optional(),center:E.object({x:E.number().optional(),y:E.number().optional()}).optional(),subcircuit_id:E.string().optional()}).describe("Error emitted when a pad and trace are closer than allowed clearance"),Pon=E.object({type:E.literal("pcb_courtyard_rect"),pcb_courtyard_rect_id:xo("pcb_courtyard_rect"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),center:Zr,width:ur,height:ur,layer:u2,ccw_rotation:Gm.optional(),color:E.string().optional()}).describe("Defines a courtyard rectangle on the PCB"),Eon=E.object({type:E.literal("pcb_courtyard_outline"),pcb_courtyard_outline_id:xo("pcb_courtyard_outline"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),layer:u2,outline:E.array(Zr).min(2)}).describe("Defines a courtyard outline on the PCB"),Mon=E.object({type:E.literal("pcb_courtyard_polygon"),pcb_courtyard_polygon_id:xo("pcb_courtyard_polygon"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),layer:u2,points:E.array(Zr).min(3),color:E.string().optional()}).describe("Defines a courtyard polygon on the PCB"),won=E.object({type:E.literal("pcb_courtyard_circle"),pcb_courtyard_circle_id:xo("pcb_courtyard_circle"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),center:Zr,radius:ur,layer:u2,color:E.string().optional()}).describe("Defines a courtyard circle on the PCB"),_2r=["obj","stl","3mf","gltf","glb","step","wrl"],Bon=["x+","x-","y+","y-","z+","z-"],g2r={obj:"z+",stl:"z+","3mf":"z+",gltf:"y+",glb:"y+",step:"z+",wrl:"y+"},Ton=E.object({type:E.literal("cad_component"),cad_component_id:E.string(),pcb_component_id:E.string(),source_component_id:E.string(),position:iB,rotation:iB.optional(),size:iB.optional(),layer:Dc.optional(),subcircuit_id:E.string().optional(),footprinter_string:E.string().optional(),model_obj_url:E.string().optional(),model_stl_url:E.string().optional(),model_3mf_url:E.string().optional(),model_gltf_url:E.string().optional(),model_glb_url:E.string().optional(),model_step_url:E.string().optional(),model_wrl_url:E.string().optional(),model_asset:Hen.optional(),model_unit_to_mm_scale_factor:E.number().optional(),model_board_normal_direction:E.enum(Bon).optional().describe(`The direction in the model's coordinate space that is considered "up" or "coming out of the board surface"`),model_origin_position:iB.optional(),model_origin_alignment:E.enum(["unknown","center","center_of_component_on_board_surface","bottom_center_of_component"]).optional(),model_object_fit:E.enum(["contain_within_bounds","fill_bounds"]).optional().default("contain_within_bounds"),model_jscad:E.any().optional(),show_as_translucent_model:E.boolean().optional(),anchor_alignment:E.enum(["center","center_of_component_on_board_surface"]).optional().default("center")}).describe("Defines a component on the PCB"),lZe=E.enum(["sinewave","square","triangle","sawtooth"]),A2r=E.union([E.string(),E.number()]).transform((e)=>typeof e=="string"?e.endsWith("%")?parseFloat(e.slice(0,-1))/100:parseFloat(e):e).pipe(E.number().min(0,"Duty cycle must be non-negative").max(1,"Duty cycle cannot be greater than 100%")),Don=E.object({type:E.literal("simulation_voltage_source"),simulation_voltage_source_id:xo("simulation_voltage_source"),is_dc_source:E.literal(!0).optional().default(!0),positive_source_port_id:E.string().optional(),negative_source_port_id:E.string().optional(),positive_source_net_id:E.string().optional(),negative_source_net_id:E.string().optional(),voltage:fB}).describe("Defines a DC voltage source for simulation"),Non=E.object({type:E.literal("simulation_voltage_source"),simulation_voltage_source_id:xo("simulation_voltage_source"),is_dc_source:E.literal(!1),terminal1_source_port_id:E.string().optional(),terminal2_source_port_id:E.string().optional(),terminal1_source_net_id:E.string().optional(),terminal2_source_net_id:E.string().optional(),voltage:fB.optional(),frequency:aY.optional(),peak_to_peak_voltage:fB.optional(),wave_shape:lZe.optional(),phase:Gm.optional(),duty_cycle:A2r.optional()}).describe("Defines an AC voltage source for simulation"),Ron=E.union([Don,Non]).describe("Defines a voltage source for simulation"),f2r=E.union([E.string(),E.number()]).transform((e)=>typeof e=="string"?e.endsWith("%")?parseFloat(e.slice(0,-1))/100:parseFloat(e):e).pipe(E.number().min(0,"Duty cycle must be non-negative").max(1,"Duty cycle cannot be greater than 100%")),Qon=E.object({type:E.literal("simulation_current_source"),simulation_current_source_id:xo("simulation_current_source"),is_dc_source:E.literal(!0).optional().default(!0),positive_source_port_id:E.string().optional(),negative_source_port_id:E.string().optional(),positive_source_net_id:E.string().optional(),negative_source_net_id:E.string().optional(),current:_q}).describe("Defines a DC current source for simulation"),kon=E.object({type:E.literal("simulation_current_source"),simulation_current_source_id:xo("simulation_current_source"),is_dc_source:E.literal(!1),terminal1_source_port_id:E.string().optional(),terminal2_source_port_id:E.string().optional(),terminal1_source_net_id:E.string().optional(),terminal2_source_net_id:E.string().optional(),current:_q.optional(),frequency:aY.optional(),peak_to_peak_current:_q.optional(),wave_shape:lZe.optional(),phase:Gm.optional(),duty_cycle:f2r.optional()}).describe("Defines an AC current source for simulation"),Lon=E.union([Qon,kon]).describe("Defines a current source for simulation"),Hon=E.union([E.literal("spice_dc_sweep"),E.literal("spice_dc_operating_point"),E.literal("spice_transient_analysis"),E.literal("spice_ac_analysis")]),Fon=E.object({type:E.literal("simulation_experiment"),simulation_experiment_id:xo("simulation_experiment"),name:E.string(),experiment_type:Hon,time_per_step:Fle.optional(),start_time_ms:GV.optional(),end_time_ms:GV.optional()}).describe("Defines a simulation experiment configuration"),zon=E.object({type:E.literal("simulation_transient_voltage_graph"),simulation_transient_voltage_graph_id:xo("simulation_transient_voltage_graph"),simulation_experiment_id:E.string(),timestamps_ms:E.array(E.number()).optional(),voltage_levels:E.array(E.number()),source_component_id:E.string().optional(),subcircuit_connectivity_map_key:E.string().optional(),time_per_step:Fle,start_time_ms:GV,end_time_ms:GV,name:E.string().optional(),color:E.string().optional()}).describe("Stores voltage measurements over time for a simulation"),Oon=E.object({type:E.literal("simulation_switch"),simulation_switch_id:xo("simulation_switch"),source_component_id:E.string().optional(),closes_at:GV.optional(),opens_at:GV.optional(),starts_closed:E.boolean().optional(),switching_frequency:aY.optional()}).describe("Defines a switch for simulation timing control"),Von=E.object({type:E.literal("simulation_voltage_probe"),simulation_voltage_probe_id:xo("simulation_voltage_probe"),source_component_id:E.string().optional(),name:E.string().optional(),signal_input_source_port_id:E.string().optional(),signal_input_source_net_id:E.string().optional(),reference_input_source_port_id:E.string().optional(),reference_input_source_net_id:E.string().optional(),subcircuit_id:E.string().optional(),color:E.string().optional()}).describe("Defines a voltage probe for simulation. If a reference input is not provided, it measures against ground. If a reference input is provided, it measures the differential voltage between two points.").superRefine((e,t)=>{if(e.reference_input_source_port_id||e.reference_input_source_net_id){let n=!!e.signal_input_source_port_id||!!e.reference_input_source_port_id,o=!!e.signal_input_source_net_id||!!e.reference_input_source_net_id;n&&o?t.addIssue({code:E.ZodIssueCode.custom,message:"Cannot mix port and net connections in a differential probe."}):n?e.signal_input_source_port_id&&e.reference_input_source_port_id||t.addIssue({code:E.ZodIssueCode.custom,message:"Differential port probe requires both signal_input_source_port_id and reference_input_source_port_id."}):o&&(e.signal_input_source_net_id&&e.reference_input_source_net_id||t.addIssue({code:E.ZodIssueCode.custom,message:"Differential net probe requires both signal_input_source_net_id and reference_input_source_net_id."}))}else!!e.signal_input_source_port_id==!!e.signal_input_source_net_id&&t.addIssue({code:E.ZodIssueCode.custom,message:"A voltage probe must have exactly one of signal_input_source_port_id or signal_input_source_net_id."})}),Yon=Ch.extend({type:E.literal("simulation_unknown_experiment_error"),simulation_unknown_experiment_error_id:xo("simulation_unknown_experiment_error"),error_type:E.literal("simulation_unknown_experiment_error").default("simulation_unknown_experiment_error"),simulation_experiment_id:E.string().optional(),subcircuit_id:E.string().optional()}).describe("An unknown error occurred during the simulation experiment."),Gon=E.object({type:E.literal("simulation_op_amp"),simulation_op_amp_id:xo("simulation_op_amp"),source_component_id:E.string().optional(),inverting_input_source_port_id:E.string(),non_inverting_input_source_port_id:E.string(),output_source_port_id:E.string(),positive_supply_source_port_id:E.string(),negative_supply_source_port_id:E.string()}).describe("Defines a simple ideal operational amplifier for simulation"),Uon=E.union([dtn,ltn,htn,ctn,ptn,utn,VJe,FJe,Ybe,OJe,zJe,YJe,GJe,UJe,jJe,KJe,$Je,tZe,qJe,JJe,ZJe,eZe,XJe,WJe,gtn,Atn,mtn,nZe,oZe,rZe,iZe,sZe,ftn,ytn,xtn,Ctn,btn,aZe,_tn,nnn,lnn,oon,ron,ion,con,lon,hon,hnn,qnn,dnn,Snn,_nn,ynn,xnn,Pnn,pnn,mnn,Enn,Mnn,son,Tnn,Dnn,Nnn,Rnn,Fnn,Qnn,knn,Lnn,Hnn,Cnn,bnn,wnn,Bnn,Inn,vnn,bon,Ion,von,Son,Onn,znn,Vnn,Ynn,Gnn,Unn,Wnn,Xnn,jnn,aon,Knn,$nn,don,non,uon,pon,mon,fon,yon,xon,Con,Pon,Eon,Mon,won,Itn,ktn,Ttn,Dtn,Ntn,Rtn,wtn,Btn,Ltn,Qtn,vtn,Ftn,ztn,Htn,Gtn,Utn,Wtn,Xtn,$tn,jtn,Ktn,Ton,Ron,Lon,Fon,zon,Oon,Von,Yon,Gon]),ECe=Uon;function HFt(e,t,n){if(!t||!n)return;let o=e.get(t);o||(o=new Set,e.set(t,o)),o.add(n);let r=e.get(n);r||(r=new Set,e.set(n,r)),r.add(t)}var b5=(e,t={})=>{let n=e,o=n._internal_store;if(!o){o={counts:{},editCount:0},n._internal_store=o;for(let i of n){let s=i.type,a=i[`${s}_id`];if(!a)continue;let c=Number.parseInt(a.split("_").pop());Number.isNaN(c)||(o.counts[s]=Math.max(o.counts[s]??0,c))}}let r=new Proxy({},{get:(i,s)=>{if(s==="toArray")return()=>(n.editCount=o.editCount,n);if(s==="editCount")return o.editCount;if(s==="subtree")return(c)=>b5(function(l,h){if(!h.subcircuit_id&&!h.source_group_id)return[...l];let d=h;if(h.subcircuit_id){let A=new Set([h.subcircuit_id]),g=new Map,f=new Map;for(let x of l)if(x.type==="source_group"){let{source_group_id:C,subcircuit_id:b}=x;b&&f.set(C,b);let I=x.parent_source_group_id;I&&(g.has(I)||g.set(I,[]),g.get(I).push(C))}let y;for(let[x,C]of f)if(C===h.subcircuit_id){y=x;break}if(y){let x=(C)=>{let b=g.get(C)||[];for(let I of b){let v=f.get(I);v&&A.add(v),x(I)}};x(y),d={...h,subcircuit_ids:Array.from(A)}}}let u=new Map;for(let A of l){let g=A[`${A.type}_id`];typeof g=="string"&&u.set(g,A)}let _=new Map;for(let A of l){let g=Object.entries(A);for(let[f,y]of g)if(f!=="parent_source_group_id"){if(f.endsWith("_id")&&typeof y=="string")HFt(_,A,u.get(y));else if(f.endsWith("_ids")&&Array.isArray(y))for(let x of y)typeof x=="string"&&HFt(_,A,u.get(x))}}let p=[],m=new Set;for(let A of l){let g=!1;(d.subcircuit_id&&("subcircuit_id"in A)&&A.subcircuit_id===d.subcircuit_id||d.subcircuit_ids&&("subcircuit_id"in A)&&A.subcircuit_id&&d.subcircuit_ids.includes(A.subcircuit_id)||d.source_group_id&&("source_group_id"in A)&&A.source_group_id===d.source_group_id||d.source_group_id&&("member_source_group_ids"in A)&&Array.isArray(A.member_source_group_ids)&&A.member_source_group_ids.includes(d.source_group_id))&&(g=!0),g&&(p.push(A),m.add(A))}for(;p.length>0;){let A=p.shift(),g=_.get(A);if(g)for(let f of g)m.has(f)||(m.add(f),p.push(f))}return l.filter((A)=>m.has(A))}(n,c),t);if(s==="insert")return(c)=>{let l=c.type;if(!l)throw Error("insert requires an element with a type");o.counts[l]??=-1,o.counts[l]++;let h=o.counts[l],d={...c,type:l,[`${l}_id`]:`${l}_${h}`};if(t.validateInserts)(PCe[l]??ECe).parse(d);return n.push(d),o.editCount++,d};if(s==="insertAll")return(c)=>c.map((l)=>r.insert(l));let a=s;return{get:(c)=>n.find((l)=>l.type===a&&l[`${a}_id`]===c),getUsing:(c)=>{let l=Object.keys(c);if(l.length!==1)throw Error("getUsing requires exactly one key, e.g. { pcb_component_id }");let h=l[0],d=h.replace("_id",""),u=n.find((_)=>_.type===d&&_[h]===c[h]);return u?n.find((_)=>_.type===a&&_[`${a}_id`]===u[`${a}_id`]):null},getWhere:(c)=>{let l=Object.keys(c);return n.find((h)=>h.type===a&&l.every((d)=>h[d]===c[d]))},list:(c)=>{let l=c?Object.keys(c):[];return n.filter((h)=>h.type===a&&l.every((d)=>h[d]===c[d]))},insert:(c)=>{o.counts[a]??=-1,o.counts[a]++;let l=o.counts[a],h={type:a,[`${a}_id`]:`${a}_${l}`,...c};if(t.validateInserts)(PCe[a]??ECe).parse(h);return n.push(h),o.editCount++,h},delete:(c)=>{let l=n.find((h)=>h[`${a}_id`]===c);l&&(n.splice(n.indexOf(l),1),o.editCount++)},update:(c,l)=>{let h=n.find((d)=>d.type===a&&d[`${a}_id`]===c);return h?(Object.assign(h,l),o.editCount++,h):null},select:(c)=>{if(a==="source_component")return n.find((l)=>l.type==="source_component"&&l.name===c.replace(/\./g,""));if(a==="pcb_port"||a==="source_port"||a==="schematic_port"){let[l,h]=c.replace(/\./g,"").split(/[\s\>]+/),d=n.find((_)=>_.type==="source_component"&&_.name===l);if(!d)return null;let u=n.find((_)=>_.type==="source_port"&&_.source_component_id===d.source_component_id&&(_.name===h||(_.port_hints??[]).includes(h)));if(!u)return null;if(a==="source_port")return u;if(a==="pcb_port")return n.find((_)=>_.type==="pcb_port"&&_.source_port_id===u.source_port_id);if(a==="schematic_port")return n.find((_)=>_.type==="schematic_port"&&_.source_port_id===u.source_port_id)}}}}});return r};b5.unparsed=b5;var jK=b5;function hXe(e){let t=e.type;return`${t}:${e[`${t}_id`]}`}var FFt=(e,t={})=>{let n=e._internal_store_indexed;if(!n){n={counts:{},editCount:0,indexes:{}};for(let s of e){let a=s.type,c=s[`${a}_id`];if(!c)continue;let l=Number.parseInt(c.split("_").pop()||"");Number.isNaN(l)||(n.counts[a]=Math.max(n.counts[a]??0,l))}let r=t.indexConfig||{},i=n.indexes;if(r.byId&&(i.byId=new Map),r.byType&&(i.byType=new Map),r.byRelation&&(i.byRelation=new Map),r.bySubcircuit&&(i.bySubcircuit=new Map),r.byCustomField&&r.byCustomField.length>0){i.byCustomField=new Map;for(let s of r.byCustomField)i.byCustomField.set(s,new Map)}for(let s of e){if(r.byId){let a=hXe(s);i.byId.set(a,s)}if(r.byType){let a=i.byType.get(s.type)||[];a.push(s),i.byType.set(s.type,a)}if(r.byRelation){let a=Object.entries(s);for(let[c,l]of a)if(c.endsWith("_id")&&c!==`${s.type}_id`&&typeof l=="string"){let h=i.byRelation.get(c)||new Map,d=h.get(l)||[];d.push(s),h.set(l,d),i.byRelation.set(c,h)}}if(r.bySubcircuit&&"subcircuit_id"in s){let a=s.subcircuit_id;if(a&&typeof a=="string"){let c=i.bySubcircuit.get(a)||[];c.push(s),i.bySubcircuit.set(a,c)}}if(r.byCustomField&&i.byCustomField){for(let a of r.byCustomField)if(a in s){let c=s[a];if(c!==void 0&&(typeof c=="string"||typeof c=="number")){let l=String(c),h=i.byCustomField.get(a),d=h.get(l)||[];d.push(s),h.set(l,d)}}}}e._internal_store_indexed=n}return new Proxy({},{get:(r,i)=>{if(i==="toArray")return()=>(e.editCount=n.editCount,e);if(i==="editCount")return n.editCount;let s=i;return{get:(a)=>{let c=t.indexConfig||{};if(c.byId&&n.indexes.byId)return n.indexes.byId.get(`${s}:${a}`)||null;if(c.byType&&n.indexes.byType)return(n.indexes.byType.get(s)||[]).find((l)=>l[`${s}_id`]===a)||null;return e.find((l)=>l.type===s&&l[`${s}_id`]===a)||null},getUsing:(a)=>{let c=t.indexConfig||{},l=Object.keys(a);if(l.length!==1)throw Error("getUsing requires exactly one key, e.g. { pcb_component_id }");let h=l[0],d=h.replace("_id","");if(c.byRelation&&n.indexes.byRelation){let _=n.indexes.byRelation.get(h);if(_){let p=(_.get(a[h])||[]).find((A)=>A.type===d);if(!p)return null;let m=p[`${s}_id`];if(c.byId&&n.indexes.byId)return n.indexes.byId.get(`${s}:${m}`)||null;if(c.byType&&n.indexes.byType)return(n.indexes.byType.get(s)||[]).find((A)=>A[`${s}_id`]===m)||null;return e.find((A)=>A.type===s&&A[`${s}_id`]===m)||null}}let u=e.find((_)=>_.type===d&&_[h]===a[h]);return u&&e.find((_)=>_.type===s&&_[`${s}_id`]===u[`${s}_id`])||null},getWhere:(a)=>{let c=t.indexConfig||{},l=Object.keys(a);if(l.length===1&&c.byCustomField&&n.indexes.byCustomField){let h=l[0],d=n.indexes.byCustomField.get(h);if(d){let u=String(a[h]);return(d.get(u)||[]).find((_)=>_.type===s)||null}}if("subcircuit_id"in a&&c.bySubcircuit&&n.indexes.bySubcircuit){let h=a.subcircuit_id;return(n.indexes.bySubcircuit.get(h)||[]).find((d)=>d.type===s&&l.every((u)=>d[u]===a[u]))||null}if(c.byType&&n.indexes.byType)return(n.indexes.byType.get(s)||[]).find((h)=>l.every((d)=>h[d]===a[d]))||null;return e.find((h)=>h.type===s&&l.every((d)=>h[d]===a[d]))||null},list:(a)=>{let c=t.indexConfig||{},l=a?Object.keys(a):[];if(l.length===0&&c.byType&&n.indexes.byType)return n.indexes.byType.get(s)||[];if(l.length===1&&l[0]==="subcircuit_id"&&c.bySubcircuit&&n.indexes.bySubcircuit){let d=a.subcircuit_id;return(n.indexes.bySubcircuit.get(d)||[]).filter((u)=>u.type===s)}let h;return h=c.byType&&n.indexes.byType?n.indexes.byType.get(s)||[]:e.filter((d)=>d.type===s),l.length>0?h.filter((d)=>l.every((u)=>d[u]===a[u])):h},insert:(a)=>{n.counts[s]??=-1,n.counts[s]++;let c=n.counts[s],l={type:s,[`${s}_id`]:`${s}_${c}`,...a};if(t.validateInserts)(PCe[s]??ECe).parse(l);e.push(l),n.editCount++;let h=t.indexConfig||{};if(h.byId&&n.indexes.byId){let d=hXe(l);n.indexes.byId.set(d,l)}if(h.byType&&n.indexes.byType){let d=n.indexes.byType.get(s)||[];d.push(l),n.indexes.byType.set(s,d)}if(h.byRelation&&n.indexes.byRelation){let d=Object.entries(l);for(let[u,_]of d)if(u.endsWith("_id")&&u!==`${l.type}_id`&&typeof _=="string"){let p=n.indexes.byRelation.get(u)||new Map,m=p.get(_)||[];m.push(l),p.set(_,m),n.indexes.byRelation.set(u,p)}}if(h.bySubcircuit&&n.indexes.bySubcircuit&&"subcircuit_id"in l){let d=l.subcircuit_id;if(d&&typeof d=="string"){let u=n.indexes.bySubcircuit.get(d)||[];u.push(l),n.indexes.bySubcircuit.set(d,u)}}if(h.byCustomField&&n.indexes.byCustomField){for(let d of h.byCustomField)if(d in l){let u=l[d];if(u!==void 0&&(typeof u=="string"||typeof u=="number")){let _=String(u),p=n.indexes.byCustomField.get(d),m=p.get(_)||[];m.push(l),p.set(_,m)}}}return l},delete:(a)=>{let c=t.indexConfig||{},l;if(c.byId&&n.indexes.byId)l=n.indexes.byId.get(`${s}:${a}`);else if(c.byType&&n.indexes.byType)l=(n.indexes.byType.get(s)||[]).find((u)=>u[`${s}_id`]===a);else l=e.find((d)=>d[`${s}_id`]===a);if(!l)return;let h=e.indexOf(l);if(h>=0&&(e.splice(h,1),n.editCount++),c.byId&&n.indexes.byId){let d=hXe(l);n.indexes.byId.delete(d)}if(c.byType&&n.indexes.byType){let d=(n.indexes.byType.get(s)||[]).filter((u)=>u[`${s}_id`]!==a);n.indexes.byType.set(s,d)}if(c.byRelation&&n.indexes.byRelation)for(let[d,u]of n.indexes.byRelation.entries())for(let[_,p]of u.entries()){let m=p.filter((A)=>A!==l);m.length===0?u.delete(_):u.set(_,m)}if(c.bySubcircuit&&n.indexes.bySubcircuit&&"subcircuit_id"in l){let d=l.subcircuit_id;if(d){let u=(n.indexes.bySubcircuit.get(d)||[]).filter((_)=>_!==l);u.length===0?n.indexes.bySubcircuit.delete(d):n.indexes.bySubcircuit.set(d,u)}}if(c.byCustomField&&n.indexes.byCustomField)for(let d of n.indexes.byCustomField.values())for(let[u,_]of d.entries()){let p=_.filter((m)=>m!==l);p.length===0?d.delete(u):d.set(u,p)}},update:(a,c)=>{let l=t.indexConfig||{},h;if(l.byId&&n.indexes.byId)h=n.indexes.byId.get(`${s}:${a}`);else if(l.byType&&n.indexes.byType)h=(n.indexes.byType.get(s)||[]).find((u)=>u[`${s}_id`]===a);else h=e.find((d)=>d.type===s&&d[`${s}_id`]===a);if(!h)return null;if(l.byRelation&&n.indexes.byRelation){let d=Object.entries(h);for(let[u,_]of d)if(u.endsWith("_id")&&u!==`${h.type}_id`&&typeof _=="string"&&u in c&&c[u]!==_){let p=n.indexes.byRelation.get(u);if(p){let m=(p.get(_)||[]).filter((A)=>A!==h);m.length===0?p.delete(_):p.set(_,m)}}}if(l.bySubcircuit&&n.indexes.bySubcircuit&&"subcircuit_id"in h&&"subcircuit_id"in c){let d=h.subcircuit_id;if(d!==c.subcircuit_id){let u=(n.indexes.bySubcircuit.get(d)||[]).filter((_)=>_!==h);u.length===0?n.indexes.bySubcircuit.delete(d):n.indexes.bySubcircuit.set(d,u)}}if(l.byCustomField&&n.indexes.byCustomField){for(let d of l.byCustomField)if(d in h&&d in c&&h[d]!==c[d]){let u=n.indexes.byCustomField.get(d);if(u){let _=String(h[d]),p=(u.get(_)||[]).filter((m)=>m!==h);p.length===0?u.delete(_):u.set(_,p)}}}if(Object.assign(h,c),n.editCount++,l.byRelation&&n.indexes.byRelation){let d=Object.entries(h);for(let[u,_]of d)if(u.endsWith("_id")&&u!==`${h.type}_id`&&typeof _=="string"&&u in c){let p=n.indexes.byRelation.get(u)||new Map,m=p.get(_)||[];m.includes(h)||(m.push(h),p.set(_,m),n.indexes.byRelation.set(u,p))}}if(l.bySubcircuit&&n.indexes.bySubcircuit&&"subcircuit_id"in h&&"subcircuit_id"in c){let d=h.subcircuit_id;if(d&&typeof d=="string"){let u=n.indexes.bySubcircuit.get(d)||[];u.includes(h)||(u.push(h),n.indexes.bySubcircuit.set(d,u))}}if(l.byCustomField&&n.indexes.byCustomField){for(let d of l.byCustomField)if(d in h&&d in c){let u=h[d];if(u!==void 0&&(typeof u=="string"||typeof u=="number")){let _=String(u),p=n.indexes.byCustomField.get(d),m=p.get(_)||[];m.includes(h)||(m.push(h),p.set(_,m))}}}return h},select:(a)=>{if(s==="source_component")return e.find((c)=>c.type==="source_component"&&c.name===a.replace(/\./g,""))||null;if(s==="pcb_port"||s==="source_port"||s==="schematic_port"){let[c,l]=a.replace(/\./g,"").split(/[\s\>]+/),h=e.find((u)=>u.type==="source_component"&&u.name===c);if(!h)return null;let d=e.find((u)=>u.type==="source_port"&&u.source_component_id===h.source_component_id&&(u.name===l||(u.port_hints??[]).includes(l)));if(!d)return null;if(s==="source_port")return d;if(s==="pcb_port")return e.find((u)=>u.type==="pcb_port"&&u.source_port_id===d.source_port_id)||null;if(s==="schematic_port")return e.find((u)=>u.type==="schematic_port"&&u.source_port_id===d.source_port_id)||null}return null}}}})};FFt.unparsed=FFt;var zFt=(e)=>e[`${e.type}_id`];function y2r(e,t){let n=b5(e).pcb_trace.get(t);if(!n)return`trace[${t}]`;let o=n.route.flatMap((r)=>[r.start_pcb_port_id,r.end_pcb_port_id]).filter(Boolean);if(o.length===0)return`trace[${t}]`;return`trace[${o.map((r)=>{let i=function(s){let a=b5(e).pcb_port.get(s);if(!a)return null;let c=a.pcb_component_id?b5(e).pcb_component.get(a.pcb_component_id):void 0;if(!c)return null;let l=b5(e).source_component.get(c.source_component_id);if(!l)return null;let h=b5(e).source_port.get(a.source_port_id),d=h?.port_hints?h.port_hints[1]:"";return{componentName:l.name,portHint:d}}(r);return i?`.${i.componentName} > port.${i.portHint}`:`port[${r}]`}).join(", ")}]`}var OFt=(e,t)=>{let n=b5(e).pcb_port.get(t);if(!n)return`pcb_port[#${t}]`;let o=n.pcb_component_id?b5(e).pcb_component.get(n.pcb_component_id):void 0;if(!o)return`pcb_port[#${t}]`;let r=b5(e).source_component.get(o.source_component_id);if(!r)return`pcb_port[#${t}]`;let i=b5(e).source_port.get(n.source_port_id);if(!i)return`pcb_port[#${t}]`;let s;return s=i?.port_hints&&i.port_hints.length>0||i.port_hints&&i.port_hints.length>0?i.port_hints[0]:t,`pcb_port[.${r.name} > .${s}]`},gq=(e,t)=>{if(typeof t=="string"){let n=((o,r)=>o.find((i)=>zFt(i)===r)??null)(e,t);return gq(e,n)}switch(t.type){case"pcb_port":return OFt(e,t.pcb_port_id);case"pcb_smtpad":return function(n,o){let r=b5(n).pcb_smtpad.get(o);return r&&r.pcb_port_id?OFt(n,r.pcb_port_id):`smtpad[${o}]`}(e,t.pcb_smtpad_id);case"pcb_trace":return y2r(e,t.pcb_trace_id);case"source_component":return`source_component[${t.name}]`;default:return`${t.type}[#${zFt(t)}]`}},VFt=(e,t)=>({minX:Math.min(e.minX,t.minX),minY:Math.min(e.minY,t.minY),maxX:Math.max(e.maxX,t.maxX),maxY:Math.max(e.maxY,t.maxY)}),Q4e=(e,t,n)=>{let o=n/2;return{minX:e-o,minY:t-o,maxX:e+o,maxY:t+o}},x2r=(e,t,n,o,r)=>{let i=n/2,s=o/2,a=r*Math.PI/180,c=Math.cos(a),l=Math.sin(a),h=[{x:-i,y:-s},{x:i,y:-s},{x:i,y:s},{x:-i,y:s}].map((d)=>({x:e+d.x*c-d.y*l,y:t+d.x*l+d.y*c}));return{minX:Math.min(...h.map((d)=>d.x)),minY:Math.min(...h.map((d)=>d.y)),maxX:Math.max(...h.map((d)=>d.x)),maxY:Math.max(...h.map((d)=>d.y))}},dXe=(e)=>e[`${e.type}_id`];function YFt(e,t,n,o){return Math.sqrt((n-e)**2+(o-t)**2)}var C2r=class{buckets;objectsById;getBounds;getId;CELL_SIZE=0.4;constructor({objects:e,getBounds:t,getId:n,CELL_SIZE:o}){this.buckets=new Map,this.objectsById=new Map,this.getBounds=t,this.getId=n??(()=>this._getNextId()),this.CELL_SIZE=o??this.CELL_SIZE;for(let r of e)this.addObject(r)}_idCounter=0;_getNextId(){return""+this._idCounter++}addObject(e){let t=this.getBounds(e),n=this.getId(e),o={...e,spatialIndexId:n};this.objectsById.set(n,o);let r=Math.floor(t.minX/this.CELL_SIZE),i=Math.floor(t.minY/this.CELL_SIZE),s=Math.floor(t.maxX/this.CELL_SIZE),a=Math.floor(t.maxY/this.CELL_SIZE);for(let c=r;c<=s;c++)for(let l=i;l<=a;l++){let h=`${c}x${l}`,d=this.buckets.get(h);d?d.push(o):this.buckets.set(h,[o])}}removeObject(e){let t=this.objectsById.get(e);if(!t)return!1;this.objectsById.delete(e);let n=this.getBounds(t),o=Math.floor(n.minX/this.CELL_SIZE),r=Math.floor(n.minY/this.CELL_SIZE),i=Math.floor(n.maxX/this.CELL_SIZE),s=Math.floor(n.maxY/this.CELL_SIZE);for(let a=o;a<=i;a++)for(let c=r;c<=s;c++){let l=`${a}x${c}`,h=this.buckets.get(l);if(h){let d=h.findIndex((u)=>u.spatialIndexId===e);d!==-1&&(h.splice(d,1),h.length===0&&this.buckets.delete(l))}}return!0}getBucketKey(e,t){return`${Math.floor(e/this.CELL_SIZE)}x${Math.floor(t/this.CELL_SIZE)}`}getObjectsInBounds(e,t=0){let n=[],o=new Set,r=Math.floor((e.minX-t)/this.CELL_SIZE),i=Math.floor((e.minY-t)/this.CELL_SIZE),s=Math.floor((e.maxX+t)/this.CELL_SIZE),a=Math.floor((e.maxY+t)/this.CELL_SIZE);for(let c=r;c<=s;c++)for(let l=i;l<=a;l++){let h=`${c}x${l}`,d=this.buckets.get(h)||[];for(let u of d){let _=u.spatialIndexId;o.has(_)||(o.add(_),n.push(u))}}return n}},Won=0.1,b2r=0.1,I2r=Won,v2r=Won,V$=0.005;function S2r(e){return e.type==="pcb_trace_segment"||e.type==="pcb_smtpad"?[e.layer]:e.type==="pcb_plated_hole"?Array.isArray(e.layers)?e.layers:[...vce]:e.type==="pcb_hole"?[...vce]:e.type==="pcb_via"?Array.isArray(e.layers)?e.layers:[...vce]:e.type==="pcb_keepout"&&Array.isArray(e.layers)?e.layers:[]}var GFt=(e,t)=>{let n={x:e.x1,y:e.y1},o={x:e.x2,y:e.y2},{minX:r,minY:i,maxX:s,maxY:a}=t;if(n.x===o.x&&n.y===o.y){let v=Math.max(r,Math.min(s,n.x)),P=Math.max(i,Math.min(a,n.y));return v===n.x&&P===n.y?{x:n.x,y:n.y}:{x:v,y:P}}let c=o.x-n.x,l=o.y-n.y,h=c!==0?(r-n.x)/c:Number.NEGATIVE_INFINITY,d=c!==0?(s-n.x)/c:Number.POSITIVE_INFINITY,u=l!==0?(i-n.y)/l:Number.NEGATIVE_INFINITY,_=l!==0?(a-n.y)/l:Number.POSITIVE_INFINITY,p=Math.max(Math.min(h,d),Math.min(u,_)),m=Math.min(Math.max(h,d),Math.max(u,_));if(p<=m&&m>=0&&p<=1){let v=Math.max(0,Math.min(1,p));return{x:n.x+v*c,y:n.y+v*l}}let A={x:Math.max(r,Math.min(s,n.x)),y:Math.max(i,Math.min(a,n.y))},g={x:Math.max(r,Math.min(s,o.x)),y:Math.max(i,Math.min(a,o.y))},f=(A.x-n.x)**2+(A.y-n.y)**2,y=(g.x-o.x)**2+(g.y-o.y)**2,x=[{start:{x:r,y:i},end:{x:s,y:i}},{start:{x:s,y:i},end:{x:s,y:a}},{start:{x:s,y:a},end:{x:r,y:a}},{start:{x:r,y:a},end:{x:r,y:i}}],C=Math.min(f,y),b=f<=y?A:g,I=(v,P,M)=>Math.max(P,Math.min(M,v));for(let v of x){let P={x:o.x-n.x,y:o.y-n.y},M={x:v.end.x-v.start.x,y:v.end.y-v.start.y},B={x:n.x-v.start.x,y:n.y-v.start.y},T=P.x*P.x+P.y*P.y,N=P.x*M.x+P.y*M.y,D=P.x*B.x+P.y*B.y,L=M.x*M.x+M.y*M.y,H=M.x*B.x+M.y*B.y,V=T*L-N*N;if(Math.abs(V)<0.0000000001)continue;let O=(N*H-L*D)/V,U=(T*H-N*D)/V;O=I(O,0,1),U=I(U,0,1);let j={x:n.x+O*P.x,y:n.y+O*P.y},Y={x:v.start.x+U*M.x,y:v.start.y+U*M.y},X=j.x-Y.x,K=j.y-Y.y,J=X*X+K*K;J<C&&(C=J,b={x:(j.x+Y.x)/2,y:(j.y+Y.y)/2})}return b},P2r=(e,t)=>{let n={x:e.x1,y:e.y1},o={x:e.x2,y:e.y2},r={x:t.x1,y:t.y1},i={x:t.x2,y:t.y2},s={x:o.x-n.x,y:o.y-n.y},a={x:i.x-r.x,y:i.y-r.y},c=s.x*s.x+s.y*s.y,l=a.x*a.x+a.y*a.y;if(c===0||l===0){if(c===0&&l===0)return{x:(n.x+r.x)/2,y:(n.y+r.y)/2};if(c===0){let T=wS(((n.x-r.x)*a.x+(n.y-r.y)*a.y)/l,0,1),N={x:r.x+T*a.x,y:r.y+T*a.y};return{x:(n.x+N.x)/2,y:(n.y+N.y)/2}}let M=wS(((r.x-n.x)*s.x+(r.y-n.y)*s.y)/c,0,1),B={x:n.x+M*s.x,y:n.y+M*s.y};return{x:(B.x+r.x)/2,y:(B.y+r.y)/2}}let h=n.x-r.x,d=n.y-r.y,u=s.x*s.x+s.y*s.y,_=s.x*a.x+s.y*a.y,p=s.x*h+s.y*d,m=a.x*a.x+a.y*a.y,A=a.x*h+a.y*d,g=u*m-_*_;if(g<0.0000000001)return E2r(n,o,r,i,s,a,c,l);let f=(_*A-m*p)/g,y=(u*A-_*p)/g;f=wS(f,0,1),y=wS(y,0,1),y=(f*_+A)/m,y=wS(y,0,1),f=(y*_-p)/u,f=wS(f,0,1);let x=n.x+f*s.x,C=n.y+f*s.y,b=r.x+y*a.x,I=r.y+y*a.y,v=x-b,P=C-I;return Math.sqrt(v*v+P*P),{x:(x+b)/2,y:(C+I)/2}},E2r=(e,t,n,o,r,i,s,a)=>{let c=((n.x-e.x)*r.x+(n.y-e.y)*r.y)/s;c=wS(c,0,1);let l={x:e.x+c*r.x,y:e.y+c*r.y},h=((o.x-e.x)*r.x+(o.y-e.y)*r.y)/s;h=wS(h,0,1);let d={x:e.x+h*r.x,y:e.y+h*r.y},u=((e.x-n.x)*i.x+(e.y-n.y)*i.y)/a;u=wS(u,0,1);let _={x:n.x+u*i.x,y:n.y+u*i.y},p=((t.x-n.x)*i.x+(t.y-n.y)*i.y)/a;p=wS(p,0,1);let m={x:n.x+p*i.x,y:n.y+p*i.y},A=[{pointA:l,pointB:n,distance:Math.sqrt((l.x-n.x)**2+(l.y-n.y)**2)},{pointA:d,pointB:o,distance:Math.sqrt((d.x-o.x)**2+(d.y-o.y)**2)},{pointA:e,pointB:_,distance:Math.sqrt((e.x-_.x)**2+(e.y-_.y)**2)},{pointA:t,pointB:m,distance:Math.sqrt((t.x-m.x)**2+(t.y-m.y)**2)}].reduce((g,f)=>f.distance<g.distance?f:g);return{x:(A.pointA.x+A.pointB.x)/2,y:(A.pointA.y+A.pointB.y)/2}},wS=(e,t,n)=>Math.max(t,Math.min(n,e)),Tae=(e)=>e.type==="pcb_trace_segment"?{minX:Math.min(e.x1,e.x2),minY:Math.min(e.y1,e.y2),maxX:Math.max(e.x1,e.x2),maxY:Math.max(e.y1,e.y2)}:((t)=>{let{POSITIVE_INFINITY:n,POSITIVE_INFINITY:o,NEGATIVE_INFINITY:r,NEGATIVE_INFINITY:i}=Number;for(let s of t){if(!s.type.startsWith("pcb_"))continue;if(s.type==="pcb_smtpad"&&s.shape==="polygon"&&Array.isArray(s.points)){for(let d of s.points)n=Math.min(n,d.x),o=Math.min(o,d.y),r=Math.max(r,d.x),i=Math.max(i,d.y);continue}if(s.type==="pcb_hole"&&s.hole_shape==="circle"){let d=Q4e(s.x,s.y,s.hole_diameter);n=Math.min(n,d.minX),o=Math.min(o,d.minY),r=Math.max(r,d.maxX),i=Math.max(i,d.maxY);continue}if(s.type==="pcb_plated_hole"){let d;if("outer_diameter"in s&&typeof s.outer_diameter=="number"?d=Q4e(s.x,s.y,s.outer_diameter):("hole_diameter"in s)&&typeof s.hole_diameter=="number"&&(d=Q4e(s.x,s.y,s.hole_diameter)),"rect_pad_width"in s&&typeof s.rect_pad_width=="number"&&"rect_pad_height"in s&&typeof s.rect_pad_height=="number"){let u=x2r(s.x,s.y,s.rect_pad_width,s.rect_pad_height,"rect_ccw_rotation"in s?s.rect_ccw_rotation??0:0);d=d?VFt(d,u):u}if("hole_diameter"in s&&typeof s.hole_diameter=="number"){let u=Q4e(s.x+("hole_offset_x"in s?s.hole_offset_x??0:0),s.y+("hole_offset_y"in s?s.hole_offset_y??0:0),s.hole_diameter);d=d?VFt(d,u):u}if(d){n=Math.min(n,d.minX),o=Math.min(o,d.minY),r=Math.max(r,d.maxX),i=Math.max(i,d.maxY);continue}}let a,c,l,h;if("x"in s&&"y"in s&&(a=Number(s.x),c=Number(s.y)),"outer_diameter"in s&&(l=Number(s.outer_diameter),h=Number(s.outer_diameter)),"width"in s&&(l=Number(s.width)),"height"in s&&(h=Number(s.height)),"center"in s&&(a=s.center.x,c=s.center.y),a!==void 0&&c!==void 0)n=Math.min(n,a),o=Math.min(o,c),r=Math.max(r,a),i=Math.max(i,c),l!==void 0&&h!==void 0&&(n=Math.min(n,a-l/2),o=Math.min(o,c-h/2),r=Math.max(r,a+l/2),i=Math.max(i,c+h/2)),"radius"in s&&(n=Math.min(n,a-s.radius),o=Math.min(o,c-s.radius),r=Math.max(r,a+s.radius),i=Math.max(i,c+s.radius));else if(s.type==="pcb_trace")for(let d of s.route)n=Math.min(n,d.x),o=Math.min(o,d.y),r=Math.max(r,d.x),i=Math.max(i,d.y);else if(s.type==="pcb_courtyard_outline")for(let d of s.outline)n=Math.min(n,d.x),o=Math.min(o,d.y),r=Math.max(r,d.x),i=Math.max(i,d.y);else if(s.type==="pcb_courtyard_polygon")for(let d of s.points)n=Math.min(n,d.x),o=Math.min(o,d.y),r=Math.max(r,d.x),i=Math.max(i,d.y)}return{minX:n,minY:o,maxX:r,maxY:i}})([e]);function M2r(e){let t=new Set;for(let n of e.route)n.route_type==="wire"&&(n.start_pcb_port_id&&t.add(n.start_pcb_port_id),n.end_pcb_port_id&&t.add(n.end_pcb_port_id));return Array.from(t)}function uXe(e){let t=new Set;for(let n of e)for(let o of M2r(n))t.add(o);return Array.from(t)}var w2r=(e)=>{if(e.type==="pcb_via")return e.outer_diameter/2;if(e.type==="pcb_plated_hole"&&e.shape==="circle")return e.outer_diameter/2;if(e.type==="pcb_hole"&&e.hole_shape==="circle")return e.hole_diameter/2;if(e.type==="pcb_smtpad"&&e.shape==="circle")return e.radius;throw Error(`Could not determine radius of element: ${JSON.stringify(e)}`)};function B2r(e,{connMap:t,minClearance:n=0.1}={}){let o=[];((m)=>{let A=m.filter((x)=>x.type==="pcb_port"),g=m.filter((x)=>x.type==="pcb_smtpad"),f=m.filter((x)=>x.type==="pcb_trace");function y(x,C={}){let b=C.traceWidth||0,I=A.find((v)=>YFt(v.x,v.y,x.x,x.y)<0.01);if(I)return I.pcb_port_id;if(C.isFirstOrLastPoint){let v=g.find((P)=>P.shape==="rect"?Math.abs(x.x-P.x)<P.width/2+b/2&&Math.abs(x.y-P.y)<P.height/2+b/2:P.shape==="circle"?YFt(x.x,x.y,P.x,P.y)<P.radius:void 0);if(v)return v.pcb_port_id??null}return null}for(let x of f)for(let C=0;C<x.route.length;C++){let b=x.route[C],I=C===0||C===x.route.length-1;if(b.route_type==="wire"){if(!b.start_pcb_port_id&&C===0){let v=y(b,{isFirstOrLastPoint:I,traceWidth:b.width});v&&(b.start_pcb_port_id=v)}if(!b.end_pcb_port_id&&C===x.route.length-1){let v=y(b,{isFirstOrLastPoint:I,traceWidth:b.width});v&&(b.end_pcb_port_id=v)}}}})(e),t??=RJe(e);let r=jK(e).pcb_trace.list().flatMap((m)=>{let A=[];for(let g=0;g<m.route.length-1;g++){let f=m.route[g],y=m.route[g+1];f.route_type==="wire"&&(y.route_type==="wire"&&f.layer===y.layer&&A.push({type:"pcb_trace_segment",pcb_trace_id:m.pcb_trace_id,_pcbTrace:m,thickness:"width"in f?f.width:("width"in y)?y.width:b2r,layer:f.layer,x1:f.x,y1:f.y,x2:y.x,y2:y.y}))}return A}),i=jK(e).pcb_smtpad.list(),s=jK(e).pcb_plated_hole.list(),a=jK(e).pcb_hole.list(),c=jK(e).pcb_via.list(),l=jK(e).pcb_keepout.list(),h=[...r,...i,...s,...a,...c,...l],d=new C2r({objects:h,getBounds:Tae}),u=(m)=>gq(e,m),_=(m,A,g)=>g<0?`PCB trace ${m} overlaps with ${A} (accidental contact)`:`PCB trace ${m} is too close to ${A} (gap: ${g.toFixed(3)}mm)`,p=new Set;for(let m of r){let A=n,g=Tae(m),f=d.getObjectsInBounds(g,A+m.thickness/2);if(m.x1!==m.x2||m.y1!==m.y2)for(let y of f){if(!S2r(y).includes(m.layer))continue;if(y.type==="pcb_trace_segment"){let b=y;if(m.layer!==b.layer)continue;if(t.areIdsConnected(m.pcb_trace_id,b.pcb_trace_id))continue;let I=Q_({x:m.x1,y:m.y1},{x:m.x2,y:m.y2},{x:b.x1,y:b.y1},{x:b.x2,y:b.y2})-m.thickness/2-b.thickness/2;if(I>n-V$)continue;let v=`overlap_${m.pcb_trace_id}_${b.pcb_trace_id}`,P=`overlap_${b.pcb_trace_id}_${m.pcb_trace_id}`;if(p.has(v))continue;if(p.has(P))continue;p.add(v),o.push({type:"pcb_trace_error",error_type:"pcb_trace_error",message:_(u(m.pcb_trace_id),u(b.pcb_trace_id),I),pcb_trace_id:m.pcb_trace_id,source_trace_id:"",pcb_trace_error_id:v,pcb_component_ids:[],center:P2r(m,b),pcb_port_ids:uXe([m._pcbTrace,b._pcbTrace])});continue}let x=dXe(y);if(t.areIdsConnected(m.pcb_trace_id,"pcb_trace_id"in y?y.pcb_trace_id:x))continue;if(y.type==="pcb_via"||y.type==="pcb_plated_hole"&&y.shape==="circle"||y.type==="pcb_hole"||y.type==="pcb_smtpad"&&y.shape==="circle"){let b=w2r(y),I=XQ({x:m.x1,y:m.y1},{x:m.x2,y:m.y2},{x:y.x,y:y.y,radius:b})-m.thickness/2;if(I>n-V$)continue;let v=`overlap_${m.pcb_trace_id}_${x}`;if(p.has(v))continue;p.add(v),o.push({type:"pcb_trace_error",error_type:"pcb_trace_error",message:_(u(m.pcb_trace_id),`${y.type} "${u(dXe(y))}"`,I),pcb_trace_id:m.pcb_trace_id,center:GFt(m,Tae(y)),source_trace_id:"",pcb_trace_error_id:v,pcb_component_ids:["pcb_component_id"in y?y.pcb_component_id:void 0].filter(Boolean),pcb_port_ids:[...uXe([m._pcbTrace]),"pcb_port_id"in y?y.pcb_port_id:void 0].filter(Boolean)})}let C=ZV({x:m.x1,y:m.y1},{x:m.x2,y:m.y2},Tae(y))-m.thickness/2;if(C+V$<A){let b=`overlap_${m.pcb_trace_id}_${x}`;if(p.has(b))continue;p.add(b),o.push({type:"pcb_trace_error",error_type:"pcb_trace_error",message:_(u(m.pcb_trace_id),`${y.type} "${u(dXe(y))}"`,C),pcb_trace_id:m.pcb_trace_id,source_trace_id:"",pcb_trace_error_id:b,pcb_component_ids:["pcb_component_id"in y?y.pcb_component_id:void 0].filter(Boolean),center:GFt(m,Tae(y)),pcb_port_ids:[...uXe([m._pcbTrace]),"pcb_port_id"in y?y.pcb_port_id:void 0].filter(Boolean)})}}}return o}function hZe(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function Xon(e,t){return hZe(e,t)<=V$}function T2r(e,{connMap:t,minClearance:n=I2r}={}){let o=e.filter((s)=>s.type==="pcb_via");if(o.length<2)return[];t??=RJe(e);let r=[],i=new Set;for(let s=0;s<o.length;s++)for(let a=s+1;a<o.length;a++){let c=o[s],l=o[a];if(Xon(c,l))continue;if(!t.areIdsConnected(c.pcb_via_id,l.pcb_via_id))continue;let h=hZe(c,l)-c.outer_diameter/2-l.outer_diameter/2;if(h+V$>=n)continue;let d=[c.pcb_via_id,l.pcb_via_id].sort().join("_");i.has(d)||(i.add(d),r.push({type:"pcb_via_clearance_error",pcb_error_id:`same_net_vias_close_${d}`,message:`Vias ${gq(e,c.pcb_via_id)} and ${gq(e,l.pcb_via_id)} are too close together (gap: ${h.toFixed(3)}mm)`,error_type:"pcb_via_clearance_error",pcb_via_ids:[c.pcb_via_id,l.pcb_via_id],minimum_clearance:n,actual_clearance:h,pcb_center:{x:(c.x+l.x)/2,y:(c.y+l.y)/2}}))}return r}function D2r(e,{connMap:t,minClearance:n=v2r}={}){let o=e.filter((s)=>s.type==="pcb_via");if(o.length<2)return[];t??=RJe(e);let r=[],i=new Set;for(let s=0;s<o.length;s++)for(let a=s+1;a<o.length;a++){let c=o[s],l=o[a];if(Xon(c,l))continue;if(t.areIdsConnected(c.pcb_via_id,l.pcb_via_id))continue;let h=hZe(c,l)-c.outer_diameter/2-l.outer_diameter/2;if(h+V$>=n)continue;let d=[c.pcb_via_id,l.pcb_via_id].sort().join("_");i.has(d)||(i.add(d),r.push({type:"pcb_via_clearance_error",pcb_error_id:`different_net_vias_close_${d}`,message:`Vias ${gq(e,c.pcb_via_id)} and ${gq(e,l.pcb_via_id)} from different nets are too close together (gap: ${h.toFixed(3)}mm)`,error_type:"pcb_via_clearance_error",pcb_via_ids:[c.pcb_via_id,l.pcb_via_id],minimum_clearance:n,actual_clearance:h,pcb_center:{x:(c.x+l.x)/2,y:(c.y+l.y)/2}}))}return r}var pXe=(e)=>({minSpacing:e,minClearance:e}),ox={traceClearance:0.1,viaClearance:0.1},jon=(e)=>((t)=>("layer"in t))(e)?[e.layer]:e.layers;function N2r(e,t,n){let o,r=Number.POSITIVE_INFINITY;for(let i of t){let s=n.get(i);if(!s)continue;let a=Math.hypot(s.x-e.x,s.y-e.y);a<r&&(r=a,o=i)}return o??t[0]}function R2r(e){let t=[],n=new Set,o=new Set,r=function(i){let s=new Map;for(let a of i.connections)for(let c of a.pointsToConnect)c.pcb_port_id&&s.set(c.pcb_port_id,{x:c.x,y:c.y});return s}(e);for(let i of e.obstacles){let s=i.connectedTo,a=s.find((y)=>y.startsWith("pcb_smtpad_")),c=s.find((y)=>y.startsWith("pcb_plated_hole_")),l=s.filter((y)=>y.startsWith("pcb_port_")),h=N2r(i.center,l,r);if(!a&&!c&&!h)continue;let d=i.layers;if(d.length===0)continue;let{width:u,height:_}=i,p=i.center.x,m=i.center.y,A=i.ccwRotationDegrees,g=typeof A=="number"&&Number.isFinite(A);if(d.length>1){let y=c??`pcb_plated_hole_${p.toFixed(3)}_${m.toFixed(3)}`;if(o.has(y))continue;if(o.add(y),g){let x=Math.max(0.5*Math.min(u,_),0.1);t.push({type:"pcb_plated_hole",pcb_plated_hole_id:y,shape:"rotated_pill_hole_with_rect_pad",hole_shape:"rotated_pill",pad_shape:"rect",hole_width:x,hole_height:x,hole_ccw_rotation:A,rect_pad_width:u,rect_pad_height:_,rect_ccw_rotation:A,hole_offset_x:0,hole_offset_y:0,x:p,y:m,layers:d,...h?{pcb_port_id:h}:{}});continue}if(Math.abs(u-_)<0.001){t.push({type:"pcb_plated_hole",pcb_plated_hole_id:y,shape:"circle",outer_diameter:Math.max(u,_),hole_diameter:Math.max(0.5*Math.min(u,_),0.1),x:p,y:m,layers:d,...h?{pcb_port_id:h}:{}});continue}t.push({type:"pcb_plated_hole",pcb_plated_hole_id:y,shape:"circular_hole_with_rect_pad",hole_shape:"circle",hole_diameter:Math.max(0.5*Math.min(u,_),0.1),rect_pad_width:u,rect_pad_height:_,hole_offset_x:0,hole_offset_y:0,x:p,y:m,layers:d,...h?{pcb_port_id:h}:{}});continue}let f=a??`pcb_smtpad_${p.toFixed(3)}_${m.toFixed(3)}`;n.has(f)||(n.add(f),g?t.push({type:"pcb_smtpad",pcb_smtpad_id:f,layer:d[0],shape:"rotated_rect",x:p,y:m,width:u,height:_,ccw_rotation:A,...h?{pcb_port_id:h}:{}}):t.push({type:"pcb_smtpad",pcb_smtpad_id:f,layer:d[0],shape:"rect",width:u,height:_,x:p,y:m,...h?{pcb_port_id:h}:{}}))}return t}function Q2r(e,t,n=0.1,o=e.minViaDiameter??0.3){let r=[];r.push(...function(s,a){let c=[];return s.connections.forEach((l)=>{let h=l.pointsToConnect.filter((m)=>m.pcb_port_id).map((m)=>m.pcb_port_id).filter(Boolean),d=l.netConnectionName||l.rootConnectionName||l.name,u=[],_=a.find((m)=>(m.connection_name??m.connectionName)===l.name);if(_){let m=(g)=>("route_type"in g)&&g.route_type==="jumper"?g.start:("x"in g)&&("y"in g)?{x:g.x,y:g.y}:{x:0,y:0},A=[m(_.route[0]),m(_.route[_.route.length-1])];for(let g of A)for(let f of s.obstacles)iP(g,f)<=0&&u.push(f)}let p=c.find((m)=>m.type==="source_trace"&&m.source_trace_id===d);if(p){let m=p;m.connected_source_port_ids=[...new Set([...m.connected_source_port_ids,...h])]}else c.push({type:"source_trace",source_trace_id:d,connected_source_port_ids:h.concat(u.flatMap((m)=>[`obstacle_${m.center.x.toFixed(3)}_${m.center.y.toFixed(3)}_${m.layers.join(".")}`,...m.connectedTo])),connected_source_net_ids:[]})}),c}(e,t)),r.push(...function(s){let a=new Map;return s.connections.forEach((c)=>{c.pointsToConnect.forEach((l)=>{l.pcb_port_id&&a.set(l.pcb_port_id,{type:"pcb_port",pcb_port_id:l.pcb_port_id,source_port_id:l.pcb_port_id,x:l.x,y:l.y,layers:jon(l)})})}),Array.from(a.values())}(e)),r.push(...R2r(e)),r.push(...function(s,a,c=0.3,l=!1){let h=[],d=new Set;return s.length>0&&("type"in s[0]&&s[0].type==="pcb_trace"?s.forEach((u)=>{u.route.forEach((_)=>{if(_.route_type==="via"){let p=_.via_diameter??c,m=`${_.x},${_.y},${_.from_layer},${_.to_layer}`;d.has(m)||(h.push({type:"pcb_via",pcb_via_id:`via_${h.length}`,pcb_trace_id:u.pcb_trace_id,x:_.x,y:_.y,outer_diameter:p,hole_diameter:0.5*p,layers:wKe(_,a,l)}),d.add(m))}})}):s.forEach((u,_)=>{let p=`trace_${_}`,m=u.viaDiameter??c;for(let A=1;A<u.route.length;A++){let g=u.route[A-1],f=u.route[A];if(g.z!==f.z&&Math.abs(g.x-f.x)<0.01&&Math.abs(g.y-f.y)<0.01){let y=$y(g.z,a),x=$y(f.z,a),C=`${f.x},${f.y},${y},${x}`;d.has(C)||(h.push({type:"pcb_via",pcb_via_id:`via_${h.length}`,pcb_trace_id:p,x:f.x,y:f.y,outer_diameter:m,hole_diameter:0.5*m,layers:wKe({from_layer:y,to_layer:x},a,l)}),d.add(C))}}})),h}(t,e.layerCount,o,e.allowBlindAndBuriedVias));let i=new Map;return e.connections.forEach((s)=>{i.set(s.name,s.netConnectionName||s.rootConnectionName||s.name)}),t.length>0&&("type"in t[0]&&t[0].type==="pcb_trace"?t.forEach((s)=>{let a=s.connection_name;r.push(function(c,l){return{type:"pcb_trace",pcb_trace_id:c.pcb_trace_id,source_trace_id:l,route:c.route.map((h)=>h.route_type==="wire"?{route_type:"wire",x:h.x,y:h.y,width:h.width,layer:h.layer,start_pcb_port_id:h.start_pcb_port_id,end_pcb_port_id:h.end_pcb_port_id}:h.route_type==="via"?{route_type:"via",x:h.x,y:h.y,from_layer:h.from_layer,to_layer:h.to_layer}:null).filter((h)=>h!==null)}}(s,i.get(a)||a))}):t.forEach((s,a)=>{let c=s.connectionName,l=function(h,d,u,_=0.1,p){let m=[];if(!h.jumpers||h.jumpers.length===0)return[{type:"pcb_trace",pcb_trace_id:d,source_trace_id:u,route:h.route.map((y,x)=>{let C=x===0,b=x===h.route.length-1;return{route_type:"wire",x:y.x,y:y.y,width:_,layer:$y(y.z,p),...C&&y.pcb_port_id?{start_pcb_port_id:y.pcb_port_id}:{},...b&&y.pcb_port_id?{end_pcb_port_id:y.pcb_port_id}:{}}})}];let A=[];for(let y of h.jumpers){let x=-1,C=-1;for(let b=0;b<h.route.length;b++){let I=h.route[b];Math.abs(I.x-y.start.x)<0.01&&Math.abs(I.y-y.start.y)<0.01&&(x=b),Math.abs(I.x-y.end.x)<0.01&&Math.abs(I.y-y.end.y)<0.01&&(C=b)}x!==-1&&C!==-1&&(x>C&&([x,C]=[C,x]),A.push({startIdx:x,endIdx:C}))}A.sort((y,x)=>y.startIdx-x.startIdx);let g=0,f=0;for(let{startIdx:y,endIdx:x}of A){if(y>=g){let C=h.route.slice(g,y+1);C.length>0&&(m.push({type:"pcb_trace",pcb_trace_id:`${d}_${f}`,source_trace_id:u,route:C.map((b,I)=>{let v=I===0&&g===0;return{route_type:"wire",x:b.x,y:b.y,width:_,layer:$y(b.z,p),...v&&b.pcb_port_id?{start_pcb_port_id:b.pcb_port_id}:{}}})}),f++)}g=x}if(g<h.route.length){let y=h.route.slice(g);if(y.length>0)m.push({type:"pcb_trace",pcb_trace_id:`${d}_${f}`,source_trace_id:u,route:y.map((C,b)=>{let I=b===y.length-1;return{route_type:"wire",x:C.x,y:C.y,width:_,layer:$y(C.z,p),...I&&C.pcb_port_id?{end_pcb_port_id:C.pcb_port_id}:{}}})})}return m}(s,`trace_${a}`,i.get(c)||c,n,e.layerCount);r.push(...l)})),r}var Q3=(e)=>e.rootConnectionName??e.connectionName,mXe=(e,t)=>{if(e&&t)return e.getNetConnectedToId(t)},UFt=(e,t)=>t?{...e,connections:e.connections.map((n)=>{let o=mXe(t,n.name)??mXe(t,n.rootConnectionName)??n.netConnectionName;return o?{...n,netConnectionName:o}:n}),obstacles:e.obstacles.map((n)=>{let o=new Set(n.connectedTo);for(let r of n.connectedTo){let i=mXe(t,r);i&&o.add(i)}return{...n,connectedTo:[...o]}})}:e,v5=(e,t,n)=>{if(!t)return!1;if(e===t)return!0;let o=n?.getNetConnectedToId(e),r=n?.getNetConnectedToId(t);return!(!o||!(o===r||e&&o===t))||!(!r||r!==e)},ZA=(e,t,n)=>t.connectedTo?.some((o)=>v5(e,o,n))??!1,eP=(e,t,n)=>Math.max(t,Math.min(e,n)),UV=(e,t)=>{e.x=eP(e.x,t.minX,t.maxX),e.y=eP(e.y,t.minY,t.maxY)},lV=(e,t)=>({minX:e.minX-t,minY:e.minY-t,maxX:e.maxX+t,maxY:e.maxY+t}),Kon=(e,t)=>({minCellX:Math.floor(e.minX/t),maxCellX:Math.floor(e.maxX/t),minCellY:Math.floor(e.minY/t),maxCellY:Math.floor(e.maxY/t)}),$on=(e,t)=>`${e}:${t}`,NKe=new WeakMap,RKe=(e,t,n)=>{let o=new Map,r=Math.ceil(e.length/32);NKe.set(o,{bits:new Uint32Array(r),wordGenerations:new Uint32Array(r),generation:0});for(let i=0;i<e.length;i+=1){let s=e[i];if(!s)continue;let a=Kon(t(s),n);for(let c=a.minCellX;c<=a.maxCellX;c+=1)for(let l=a.minCellY;l<=a.maxCellY;l+=1){let h=$on(c,l),d=o.get(h);d?d.push(i):o.set(h,[i])}}return o},d$=(e,t,n)=>{let o=NKe.get(e);o||(o={bits:new Uint32Array(0),wordGenerations:new Uint32Array(0),generation:0},NKe.set(e,o)),o.generation+=1,o.generation>4294967295&&(o.wordGenerations.fill(0),o.generation=1);let r=o.generation,i=Kon(t,n),s=1/0,a=-1;for(let l=i.minCellX;l<=i.maxCellX;l+=1)for(let h=i.minCellY;h<=i.maxCellY;h+=1){let d=e.get($on(l,h));if(d)for(let u of d){let _=u>>>5;if(_>=o.bits.length){let p=Math.max(_+1,2*o.bits.length),m=new Uint32Array(p);m.set(o.bits);let A=new Uint32Array(p);A.set(o.wordGenerations),o.bits=m,o.wordGenerations=A}o.wordGenerations[_]!==r&&(o.wordGenerations[_]=r,o.bits[_]=0),o.bits[_]=o.bits[_]|1<<(31&u),_<s&&(s=_),_>a&&(a=_)}}let c=[];for(let l=s;l<=a;l+=1){if(o.wordGenerations[l]!==r)continue;let h=o.bits[l];for(;h!==0;){let d=31-Math.clz32(h&-h);c.push(32*l+d),h&=h-1}}return c},WFt=0.000001,k2r=(e,t,n)=>{if(e.length===0)return[];let o=n?.traceThickness??0.1,r=e[0],i=e.at(-1),s=(h)=>{if(h.pcb_port_id)return h.pcb_port_id;let d=$y(h.z,t);return n?.connectionPoints?.find((u)=>{return u.pcb_port_id&&(_=u,p=h,Math.abs(_.x-p.x)<=WFt&&Math.abs(_.y-p.y)<=WFt)&&jon(u).includes(d);var _,p})?.pcb_port_id},a=s(r),c=s(i),l=[{route_type:"wire",x:r.x,y:r.y,width:o,layer:$y(r.z,t),...a?{start_pcb_port_id:a}:{},...e.length===1&&c?{end_pcb_port_id:c}:{}}];for(let h=1;h<e.length;h+=1){let d=e[h-1],u=e[h];d&&u&&(d.z!==u.z&&d.x===u.x&&d.y===u.y&&l.push({route_type:"via",x:u.x,y:u.y,from_layer:$y(d.z,t),to_layer:$y(u.z,t),...n?.viaDiameter?{via_diameter:n.viaDiameter}:{}}),l.push({route_type:"wire",x:u.x,y:u.y,width:o,layer:$y(u.z,t),...h===e.length-1&&c?{end_pcb_port_id:c}:{}}))}return l},_Xe=(e,t)=>({x:h2(e.x,t.minX,t.maxX),y:h2(e.y,t.minY,t.maxY)}),XFt=(e,t)=>{let n=e.x-t.center.x,o=e.y-t.center.y;return t.circular?Math.max(0,Math.hypot(n,o)-t.halfWidth):IUt(oB(t.worldToLocal,e),{minX:-t.halfWidth,maxX:t.halfWidth,minY:-t.halfHeight,maxY:t.halfHeight})},HS=(e,t)=>({kind:"line",start:e,end:t,bounds:j$e([e,t])}),hV=(e,t)=>({kind:"circle",center:e,radius:t,bounds:tu({center:e,width:2*t,height:2*t})}),L2r=(e)=>{let t=e.clearance+kr;if(e.circular)return[hV(e.center,e.halfWidth+t)];let n=(i,s)=>oB(e.localToWorld,{x:i,y:s}),{halfWidth:o,halfHeight:r}=e;return[HS(n(-o,-r-t),n(o,-r-t)),HS(n(o+t,-r),n(o+t,r)),HS(n(o,r+t),n(-o,r+t)),HS(n(-o-t,r),n(-o-t,-r)),hV(n(-o,-r),t),hV(n(o,-r),t),hV(n(o,r),t),hV(n(-o,r),t)]},qon=(e,t)=>{if(t.kind==="circle"){let n=e.x-t.center.x,o=e.y-t.center.y,r=Math.hypot(n,o);return r===0?[{x:t.center.x+t.radius,y:t.center.y},{x:t.center.x-t.radius,y:t.center.y},{x:t.center.x,y:t.center.y+t.radius},{x:t.center.x,y:t.center.y-t.radius}]:[{x:t.center.x+n*t.radius/r,y:t.center.y+o*t.radius/r}]}return[t.start,t.end,Vm(e,t.start,t.end)]},jFt=(e,t)=>{let n=e.end.x-e.start.x,o=e.end.y-e.start.y,r=e.start.x-t.center.x,i=e.start.y-t.center.y,s=n*n+o*o;if(s===0)return[];let a=2*(r*n+i*o),c=a*a-4*s*(r*r+i*i-t.radius*t.radius);if(c<0)return[];let l=Math.sqrt(c);return[(-a-l)/(2*s),(-a+l)/(2*s)].filter((h)=>h>=0&&h<=1).map((h)=>({x:e.start.x+n*h,y:e.start.y+o*h}))},Jon=(e,t)=>{if(e.kind==="line"&&t.kind==="circle")return jFt(e,t);if(e.kind==="circle"&&t.kind==="line")return jFt(t,e);if(e.kind==="line"&&t.kind==="line"){let l=pB(e.start,e.end,t.start,t.end);return l?[l]:[]}if(e.kind!=="circle"||t.kind!=="circle")return[];let n=t.center.x-e.center.x,o=t.center.y-e.center.y,r=Math.hypot(n,o);if(r===0||r>e.radius+t.radius||r<Math.abs(e.radius-t.radius))return[];let i=(e.radius**2-t.radius**2+r**2)/(2*r),s=Math.sqrt(Math.max(0,e.radius**2-i**2)),a=e.center.x+n*i/r,c=e.center.y+o*i/r;return[{x:a-o*s/r,y:c+n*s/r},{x:a+o*s/r,y:c-n*s/r}]},H2r=(e,t,n,o,r)=>{let i=new Set(function(s,a,c=1){if(c===0)throw Error("step cannot be 0");let l,h;a===void 0?(l=0,h=s):(l=s,h=a);let d=[];if(c>0)for(let u=l;u<h;u+=c)d.push(u);else for(let u=l;u>h;u+=c)d.push(u);return d}(e.allowBlindAndBuriedVias?Math.min(...o):0,e.allowBlindAndBuriedVias?Math.max(...o)+1:e.layerCount).map((s)=>$y(s,e.layerCount)));return e.obstacles.filter((s)=>!s.isCopperPour&&s.layers.some((a)=>i.has(a))).map((s)=>{let a=typeof s.ccwRotationDegrees=="number"&&Number.isFinite(s.ccwRotationDegrees),c=!a&&s.layers.length>1&&Math.abs(s.width-s.height)<0.001,l=W$e(DV(s.center.x,s.center.y),pUt(a?s.ccwRotationDegrees:0)),h=c?Math.max(s.width,s.height)/2:s.width/2,d=c?h:s.height/2,u=ZA(Q3(t),s,r)||ZA(t.connectionName,s,r),_=n+(u?0:zbe(e)),p=j$e(hUt(l,[{x:-h,y:-d},{x:h,y:-d},{x:h,y:d},{x:-h,y:d}])),m=_+kr;return{center:s.center,halfWidth:h,halfHeight:d,localToWorld:l,worldToLocal:dUt(l),circular:c,clearance:_,bounds:{minX:p.minX-m,maxX:p.maxX+m,minY:p.minY-m,maxY:p.maxY+m}}})},F2r=(e,t,n,o)=>{let r=Math.min(...e.zLayers),i=Math.max(...e.zLayers),s=t.filter((h)=>h.z>=r&&h.z<=i&&!v5(e.rootConnectionName,h.rootConnectionName,o)).map((h)=>({segment:h,required:e.radius+h.radius+n})).filter(({segment:h,required:d})=>xc(e,h.start,h.end)<=d+zQ),a=s.flatMap(({segment:h,required:d})=>{let{start:u,end:_}=h,p=Math.sqrt(BS(u,_));if(p<=kr)return[];let m=d+kr,A=(_.y-u.y)/p*m,g=(u.x-_.x)/p*m;return[HS({x:u.x+A,y:u.y+g},{x:_.x+A,y:_.y+g}),HS({x:u.x-A,y:u.y-g},{x:_.x-A,y:_.y-g}),hV(u,m),hV(_,m)]}).filter((h)=>IUt(e,h.bounds)<=zQ),c=[],l=(h)=>{BS(h,e)>zQ**2||c.some((d)=>BS(d,h)<0.000000000001)||s.some(({segment:d,required:u})=>xc(h,d.start,d.end)<u)||c.push(h)};l(e);for(let h=0;h<a.length;h+=1){let d=a[h];for(let u of qon(e,d))l(u);for(let u=h+1;u<a.length;u+=1){let _=a[u];if(mB(d.bounds,_.bounds))for(let p of Jon(d,_))l(p)}}return c.sort((h,d)=>BS(h,e)-BS(d,e))},KFt=1048576,Zon=(e)=>({...e,route:e.route.map((t)=>({...t})),vias:e.vias.map((t)=>({...t}))}),jb=(e)=>e.map(Zon),KK=(e,t)=>{let n=new Set(t);return e.map((o,r)=>n.has(r)?Zon(o):o)},N_=(e,t)=>Math.abs(e.x-t.x)<=Ua&&Math.abs(e.y-t.y)<=Ua,z2r=["pcb_smtpad","pcb_plated_hole","pcb_hole","pcb_keepout"],Zy=(e)=>typeof e.type=="string"?e.type:typeof e.error_type=="string"?e.error_type:void 0,dZe=(e)=>{if(Zy(e)==="pcb_pad_trace_clearance_error")return!0;let t=typeof e.message=="string"?e.message.toLowerCase():"";return(t.includes("pcb_trace")||t.includes("pcb trace"))&&z2r.some((n)=>t.includes(n))},$Ft=(e,t,n=!0)=>{let o=[],r=new Map,i=new Map;for(let s=0;s<t.length;s+=1){let a=t[s];if(!a)continue;let c=i.get(a.connectionName);c?c.push({route:a,routeIndex:s}):i.set(a.connectionName,[{route:a,routeIndex:s}])}for(let s of e.connections){let a=i.get(s.name)??[];for(let c=0;c<a.length;c+=1){let l=a[c];if(!l)continue;let h=`${s.name}_${c}`;n&&o.push({type:"pcb_trace",pcb_trace_id:h,connection_name:s.netConnectionName??s.rootConnectionName??s.name,route:k2r(l.route.route,e.layerCount,{traceThickness:l.route.traceThickness??s.nominalTraceWidth??e.nominalTraceWidth??e.minTraceWidth,viaDiameter:l.route.viaDiameter??e.minViaDiameter,connectionPoints:s.pointsToConnect})}),r.set(h,l.routeIndex)}}return{traces:o,traceRouteIndexById:r}},uZe=(e)=>{let t=typeof e.message=="string"?e.message:"",n=t.match(/gap: (-?\d+(?:\.\d+)?)mm/),o=t.match(/required: (-?\d+(?:\.\d+)?)mm/);if(n&&o){let r=Number.parseFloat(n[1]),i=Number.parseFloat(o[1]);if(Number.isFinite(r)&&Number.isFinite(i))return Math.max(0,i-r)}if(n){let r=Number.parseFloat(n[1]),i=ox.traceClearance??0.1;if(Number.isFinite(r))return Math.max(0,i-r)}return 1},ern={projectEngineError:(e)=>({...e,center:typeof e.first_contact_center=="object"?e.first_contact_center:e.center,message:typeof e.first_contact_message=="string"?e.first_contact_message:e.message,actual_clearance:typeof e.first_actual_clearance=="number"?e.first_actual_clearance:e.actual_clearance}),getErrorSeverity:uZe},O2r={projectEngineError:(e)=>e,getErrorSeverity:(e)=>{let t=Number(e.minimum_clearance),n=Number(e.worst_actual_clearance);return Number.isFinite(t)&&Number.isFinite(n)?Math.max(0,t-n):uZe(e)}},I$=(e,t=uZe)=>e.reduce((n,o)=>n+t(o),0),trn=(e,t,n,o,r,i=ern)=>{let s=n?.inputMode==="routes-only",a=r&&!n||s?e:UFt(e,o),{traces:c,traceRouteIndexById:l}=$Ft(a,t,!s),h=n?.({srj:a,routes:t,traces:c});if(h){let p=Array.isArray(h)?h:h.errors,m=Array.isArray(h)?h:h.errorsWithCenters??h.errors;return{errors:m,count:p.length,issueScore:I$(m,i.getErrorSeverity),legacyIssueScore:I$(m.filter((A)=>!S5(A)),i.getErrorSeverity),traceRouteIndexById:l}}if(s){a=UFt(e,o);let p=$Ft(a,t);c=p.traces,l=p.traceRouteIndexById}let d=r?.evaluate(c)??((p,m={})=>{let A=Math.max(m.viaClearance??0.1,0.1),g=[...B2r(p,pXe(m.traceClearance)),...T2r(p,pXe(A)),...D2r(p,pXe(A))],f=p.filter((b)=>b.type==="pcb_via"),y=new Map(f.map((b)=>[b.pcb_via_id,b])),x=g.map((b)=>{if("center"in b&&b.center)return b;if("pcb_center"in b&&b.pcb_center)return{...b,center:b.pcb_center};if("pcb_via_ids"in b&&Array.isArray(b.pcb_via_ids)){let[I,v]=b.pcb_via_ids;if(typeof I!="string"||typeof v!="string")return b;let P=y.get(I),M=y.get(v);if(P&&M)return{...b,center:{x:(P.x+M.x)/2,y:(P.y+M.y)/2}}}if("pcb_error_id"in b&&typeof b.pcb_error_id=="string"&&(b.pcb_error_id.startsWith("same_net_vias_close_")||b.pcb_error_id.startsWith("different_net_vias_close_"))){let I=b.pcb_error_id.replace("same_net_vias_close_","").replace("different_net_vias_close_","").split("_").filter(Boolean);if(I.length===2){let v=I[0],P=I[1];if(!v||!P)return b;let M=y.get(v),B=y.get(P);if(M&&B)return{...b,center:{x:(M.x+B.x)/2,y:(M.y+B.y)/2}}}}return b}),C=x.filter((b)=>Boolean(b.center));return{errors:g,errorsWithCenters:x,locationAwareErrors:C}})(Q2r(a,c,a.minTraceWidth,a.minViaDiameter),{...ox,traceClearance:a.minTraceToPadEdgeClearance??ox.traceClearance,viaClearance:a.minTraceToPadEdgeClearance??ox.viaClearance}),u=d.errors,_=(d.errorsWithCenters.length>0?d.errorsWithCenters:d.errors).map((p)=>i.projectEngineError(p));return{errors:_,count:u.length,issueScore:I$(_,i.getErrorSeverity),legacyIssueScore:I$(_.filter((p)=>!S5(p)),i.getErrorSeverity),traceRouteIndexById:l}},PS=(e,t,n,o,r)=>trn(e,t,n,o,r,ern),V2r=(e,t,n,o,r)=>trn(e,t,n,o,r,O2r),cv=(e,t)=>{let n=[];for(let o=0;o<e.length;o+=1){let r=e[o];if(!r)continue;let i;for(let s=0;s<r.route.length-1;s+=1){let a=r.route[s],c=r.route[s+1];if(!a||!c)continue;if(a.z===c.z||!N_(a,c))continue;let l=i??=new Set,h=[s,s+1];for(let A=s-1;A>=0;A-=1){let g=r.route[A];if(!g||!N_(g,a))break;h.push(A)}for(let A=s+2;A<r.route.length;A+=1){let g=r.route[A];if(!g||!N_(g,a))break;h.push(A)}let d=h;if(d.some((A)=>l.has(A)))continue;for(let A of d)l.add(A);let u=d.filter((A)=>A===0||A===r.route.length-1),_=u.some((A)=>Boolean(r.route[A]?.pcb_port_id)),p=0,m=t.layerCount-1;if(t.allowBlindAndBuriedVias){let A=d.map((g)=>r.route[g].z);p=Math.min(...A),m=Math.max(...A)}n.push({routeIndex:o,rootConnectionName:Q3(r),pointIndexes:d,zLayers:Array.from({length:m-p+1},(A,g)=>p+g),x:a.x,y:a.y,radius:(r.viaDiameter??t.minViaDiameter??0.3)/2,movable:u.length===0,canCanonicalize:u.length===0||!_})}}return n},lle=(e,t)=>{let n=[];for(let o=0;o<e.route.length-1;o+=1){let r=e.route[o],i=e.route[o+1];r&&i&&(r.z!==i.z||N_(r,i)||n.push({routeIndex:t,rootConnectionName:Q3(e),startIndex:o,endIndex:o+1,start:r,end:i,z:r.z,radius:(e.traceThickness??0.1)/2}))}return n},zle=(e)=>e.flatMap((t,n)=>lle(t,n)),Y3e=(e)=>({minX:e.x,minY:e.y,maxX:e.x,maxY:e.y}),gV=(e)=>({minX:Math.min(e.start.x,e.end.x),minY:Math.min(e.start.y,e.end.y),maxX:Math.max(e.start.x,e.end.x),maxY:Math.max(e.start.y,e.end.y)}),nrn=(e)=>({minX:e.center.x-e.width/2,minY:e.center.y-e.height/2,maxX:e.center.x+e.width/2,maxY:e.center.y+e.height/2}),Oq=(e,t)=>{if(e.zLayers&&e.zLayers.length>0)return e.zLayers;let n=Array.from({length:t},(o,r)=>r).filter((o)=>e.layers.includes($y(o,t)));return n.length>0?n:Array.from({length:t},(o,r)=>r)},orn=(e,t,n)=>{let o=t.reduce((s,a)=>Math.max(s,a.radius),(e.minViaDiameter??0.3)/2),r=n.reduce((s,a)=>Math.max(s,a.radius),e.minTraceWidth/2),i=(ox.traceClearance??0.1)+C1;return Math.max(2*o+0.2+C1,o+r+i,2*r+i,r+NJe(e)+C1,o+zbe(e)+C1)},rrn=(e,t,n)=>{let o=n.x-t.x,r=n.y-t.y,i=o*o+r*r;if(i<=kr)return{x:t.x,y:t.y,t:0};let s=eP(((e.x-t.x)*o+(e.y-t.y)*r)/i,0,1);return{x:t.x+o*s,y:t.y+r*s,t:s}},o6=(e,t)=>rrn(e,t.start,t.end),OQ=(e,t)=>{let n=t.width/2,o=t.height/2,r=Math.max(Math.abs(e.x-t.center.x)-n,0),i=Math.max(Math.abs(e.y-t.center.y)-o,0);return Math.hypot(r,i)},Wbe=(e,t)=>e.x>=t.center.x-t.width/2-Ua&&e.x<=t.center.x+t.width/2+Ua&&e.y>=t.center.y-t.height/2-Ua&&e.y<=t.center.y+t.height/2+Ua,pZe=(e,t,n,o)=>e.obstacles.find((r)=>ZA(Q3(t),r,o)&&Oq(r,e.layerCount).includes(n.z)&&Wbe(n,r)),MCe=(e,t,n=0.6,o)=>{let r;for(let i of e.obstacles){let s=OQ(t,i);s>n||(o&&!o(i)||(!r||s<r.distance)&&(r={obstacle:i,distance:s}))}return r?.obstacle},Xbe=(e,t,n)=>{let o=t.width/2,r=t.height/2,i=eP(e.x,t.center.x-o,t.center.x+o),s=eP(e.y,t.center.y-r,t.center.y+r),a=e.x-i,c=e.y-s,l=Math.hypot(a,c);if(l<=kr)o-Math.abs(e.x-t.center.x)<r-Math.abs(e.y-t.center.y)?(a=e.x>=t.center.x?1:-1,c=0,l=0):(a=0,c=e.y>=t.center.y?1:-1,l=0);let h=n-l;if(h<=0)return;let d=Math.hypot(a,c);return{direction:{x:d>kr?a/d:1,y:d>kr?c/d:0},penetration:h}},qFt=(e,t,n,o)=>{let r=t.message;if(typeof r!="string"||!r.includes("pcb_"))return n;let i=Array.isArray(t.pcb_pad_ids)?t.pcb_pad_ids.filter((a)=>typeof a=="string"):[],s=e.obstacles.find((a)=>i.some((c)=>a.connectedTo.includes(c))&&(o?.(a)??!0));return s?s.center:MCe(e,n,0.6,o)?.center??n},irn=(e,t)=>{let n=e.route[t];if(!n)return[];let o=[t];for(let r=t-1;r>=0;r-=1){let i=e.route[r];if(!i||!N_(i,n))break;o.push(r)}for(let r=t+1;r<e.route.length;r+=1){let i=e.route[r];if(!i||!N_(i,n))break;o.push(r)}return[...new Set(o)]},mZe=(e,t)=>{if(t<=0||t>=e.route.length-1)return;let n=irn(e,t);return n.includes(0)||n.includes(e.route.length-1)?void 0:n},Aq=(e,t)=>e.x>=t.minX-Ua&&e.x<=t.maxX+Ua&&e.y>=t.minY-Ua&&e.y<=t.maxY+Ua,QKe=(e,t)=>Math.min(e.x-t.minX,t.maxX-e.x,e.y-t.minY,t.maxY-e.y),kKe=(e,t,n)=>{let o=n.x-t.x,r=n.y-t.y,i=e.x-t.x,s=o*(e.y-t.y)-r*i;if(Math.abs(s)>Ua)return!1;let a=Math.min(t.x,n.x)-Ua,c=Math.max(t.x,n.x)+Ua,l=Math.min(t.y,n.y)-Ua,h=Math.max(t.y,n.y)+Ua;return e.x>=a&&e.x<=c&&e.y>=l&&e.y<=h},hle=(e,t)=>{if(t.length<3)return!0;for(let o=0;o<t.length;o+=1){let r=t[o],i=t[(o+1)%t.length];if(r&&i&&kKe(e,r,i))return!0}let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o,o+=1){let i=t[o],s=t[r];if(!i||!s)continue;i.y>e.y!=s.y>e.y&&e.x<(s.x-i.x)*(e.y-i.y)/(s.y-i.y)+i.x&&(n=!n)}return n},JFt=(e,t)=>{let n=Math.hypot(e,t);if(!(n<=kr))return{x:e/n,y:t/n}},srn=(e,t)=>e.outline&&e.outline.length>=3?((n,o)=>{let r=hle(n,o),i;for(let d=0;d<o.length;d+=1){let u=o[d],_=o[(d+1)%o.length];if(!u||!_)continue;let p=rrn(n,u,_),m=Math.hypot(n.x-p.x,n.y-p.y);(!i||m<i.distance)&&(i={projection:p,start:u,end:_,distance:m})}if(!i)return;let s=JFt(r?n.x-i.projection.x:i.projection.x-n.x,r?n.y-i.projection.y:i.projection.y-n.y);if(s)return s;let a=i.end.x-i.start.x,c=i.end.y-i.start.y,l=Math.hypot(a,c);if(l<=kr)return;let h=((d)=>{let u=0;for(let _=0;_<d.length;_+=1){let p=d[_],m=d[(_+1)%d.length];p&&m&&(u+=p.x*m.y-m.x*p.y)}return u/2})(o)>=0;return{x:h?-c/l:c/l,y:h?a/l:-a/l}})(t,e.outline):((n,o)=>{let r=n.x-o.minX,i=o.maxX-n.x,s=n.y-o.minY,a=o.maxY-n.y,c=Math.min(r,i,s,a),l=0,h=0;return r<=c+Ua&&(l+=1),i<=c+Ua&&(l-=1),s<=c+Ua&&(h+=1),a<=c+Ua&&(h-=1),JFt(l,h)})(t,e.bounds),arn=(e,t)=>e.outline&&e.outline.length>=3?hle(t,e.outline):Aq(t,e.bounds),f1=(e,t)=>{if(e.outline&&e.outline.length>=3){let n=((o,r)=>{let i=Number.POSITIVE_INFINITY;for(let s=0;s<r.length;s+=1){let a=r[s],c=r[(s+1)%r.length];a&&c&&(i=Math.min(i,xc(o,a,c)))}return i})(t,e.outline);return hle(t,e.outline)?n:-n}return QKe(t,e.bounds)},FS=(e,t,n)=>{if(Math.abs(t.x-n.x)<=Ua&&Math.abs(t.y-n.y)<=Ua)return Math.min(f1(e,t),f1(e,n));if(e.outline&&e.outline.length>=3){if(!hle(t,e.outline)||!hle(n,e.outline))return Math.min(f1(e,t),f1(e,n));let o=Number.POSITIVE_INFINITY;for(let r=0;r<e.outline.length;r+=1){let i=e.outline[r],s=e.outline[(r+1)%e.outline.length];i&&s&&(o=Math.min(o,Q_(t,n,i,s)))}return o}return Aq(t,e.bounds)&&Aq(n,e.bounds)?Math.min(QKe(t,e.bounds),QKe(n,e.bounds)):Math.min(f1(e,t),f1(e,n))},fq=(e,t)=>t+Math.max(0.16,e.defaultObstacleMargin??0,ox.traceClearance??0.1),jbe=(e,t,n)=>t<e-Ua&&Math.min(e,t)<=n+Ua,crn=(e,t,n,o,r)=>{let i=e*n.x+t*n.y,s=-Math.max(0,o-r);if(i>=s-Ua)return{x:e,y:t};let a=s-i;return{x:e+n.x*a,y:t+n.y*a}},_Ze=(e,t,n,o,r)=>{let i=srn(e,t);return i?crn(n,o,i,f1(e,t),fq(e,r)):{x:n,y:o}},ZFt=(e,t,n,o)=>{let r=[...new Set(n)].sort((c,l)=>c-l);if(r.length===0)return Number.POSITIVE_INFINITY;let i=new Set(r),s=(c)=>o?.get(c)??t.route[c],a=Number.POSITIVE_INFINITY;for(let c of r){let l=s(c);l&&(a=Math.min(a,f1(e,l)))}for(let c=0;c<t.route.length-1;c+=1){if(!i.has(c)&&!i.has(c+1))continue;let l=s(c),h=s(c+1);l&&h&&(a=Math.min(a,FS(e,l,h)))}return a},Kbe=(e,t,n,o,r,i)=>{let s=[...new Set(n)].sort((u,_)=>u-_);if(s.length===0)return;let a=((u,_,p,m,A,g)=>{let f=[...new Set(p)].sort((C,b)=>C-b),y={x:m,y:A},x=fq(u,g);for(let C=0;C<Math.max(1,f.length);C+=1){let b=!1;for(let I of f){let v=_.route[I];if(!v)continue;let P=srn(u,v);if(!P)continue;let M=crn(y.x,y.y,P,f1(u,v),x);(Math.abs(M.x-y.x)>kr||Math.abs(M.y-y.y)>kr)&&(y=M,b=!0)}if(!b)break}return y})(e,t,s,o,r,i);if(Math.abs(a.x)<=kr&&Math.abs(a.y)<=kr)return;let c=new Map;for(let u of s){let _=t.route[u];if(!_)continue;let p={x:_.x+a.x,y:_.y+a.y};c.set(u,p)}let l=ZFt(e,t,s),h=ZFt(e,t,s,c);if(h<i-Ua)return;let d=fq(e,i);return jbe(l,h,d)?void 0:a},wCe=(e,t,n,o,r,i,s)=>{let a=e[t];if(!a)return!1;let c=mZe(a,n);if(!c)return!1;let l=Kbe(i,a,c,o,r,s);if(!l)return!1;let h=!1;for(let d of c){let u=a.route[d];u&&(u.x+=l.x,u.y+=l.y,UV(u,i.bounds),h=!0)}return h},ezt=(e,t,n,o,r,i)=>mZe(t,n)??((s,a,c,l,h,d)=>{let u=a.route[c];if(!u||u.pcb_port_id||c!==0&&c!==a.route.length-1)return;let _=pZe(s,a,u,d);if(!_)return;let p={...u,x:u.x+l,y:u.y+h};return arn(s,p)&&Wbe(p,_)?irn(a,c):void 0})(e,t,n,o,r,i),lrn=(e,t,n,o,r,i)=>{let s=Kbe(r,e,t,n,o,i);if(!s)return!1;let a=!1;for(let c of t){let l=e.route[c];l&&(l.x+=s.x,l.y+=s.y,UV(l,r.bounds),a=!0)}return a},tzt=(e,t,n,o,r,i)=>{let s=t.route[n];if(!s)return!1;if(s.pcb_port_id)return!1;let a=pZe(e,t,s,i);return!!a&&Wbe({...s,x:s.x+o,y:s.y+r},a)},Y2r=(e,t,n,o)=>{let r=t.route[n];if(r&&!r.pcb_port_id)return pZe(e,t,r,o)},nzt=(e,t,n,o,r,i,s)=>{let a=e[t];if(!a||a.route.length===0)return!1;let c=((_,p,m,A,g)=>{let{NEGATIVE_INFINITY:f,POSITIVE_INFINITY:y,NEGATIVE_INFINITY:x,POSITIVE_INFINITY:C}=Number;for(let b of[0,p.route.length-1]){let I=p.route[b],v=Y2r(_,p,b,g);if(!I||!v)return;f=Math.max(f,v.center.x-v.width/2-I.x),y=Math.min(y,v.center.x+v.width/2-I.x),x=Math.max(x,v.center.y-v.height/2-I.y),C=Math.min(C,v.center.y+v.height/2-I.y)}if(!(f>y||x>C))return{x:eP(m,f,y),y:eP(A,x,C)}})(r,a,n,o,s);if(!c)return!1;let l=a.route.map((_,p)=>p),h=Kbe(r,a,l,c.x,c.y,i);if(!h)return!1;let d=a.route.length-1;if(!tzt(r,a,0,h.x,h.y,s)||!tzt(r,a,d,h.x,h.y,s))return!1;let u=!1;for(let _ of a.route)_.x+=h.x,_.y+=h.y,UV(_,r.bounds),u=!0;return u},ozt=(e,t,n)=>{let o=t.x-e.x,r=t.y-e.y,i=n.x-t.x,s=n.y-t.y;return Math.abs(o*s-r*i)<=Ua},rzt=(e,t)=>{if(e.z!==t.z)return!1;let n=t.end.x-t.start.x,o=t.end.y-t.start.y,r=e.x-t.start.x,i=e.y-t.start.y;return Math.abs(n*i-o*r)<=Ua},G2r=(e,t)=>{let n=((r,i)=>{let s=i.end.x-i.start.x,a=i.end.y-i.start.y,c=Math.max(Ua,0.12*(r.traceThickness??0.1)),l=Math.abs(a)<=c,h=Math.abs(s)<=c,{startIndex:d,endIndex:u}=i;if(l||h){let _=l?(i.start.y+i.end.y)/2:(i.start.x+i.end.x)/2;for(;d>0;){let p=r.route[d-1];if(!p||p.z!==i.z||Math.abs((l?p.y:p.x)-_)>c)break;d-=1}for(;u<r.route.length-1;){let p=r.route[u+1];if(!p||p.z!==i.z||Math.abs((l?p.y:p.x)-_)>c)break;u+=1}return Array.from({length:u-d+1},(p,m)=>d+m)}for(;d>0;){let _=r.route[d-1],p=r.route[d],m=r.route[d+1];if(!(_&&p&&m&&_.z===i.z&&rzt(_,i)&&ozt(_,p,m)))break;d-=1}for(;u<r.route.length-1;){let _=r.route[u-1],p=r.route[u],m=r.route[u+1];if(!(_&&p&&m&&m.z===i.z&&rzt(m,i)&&ozt(_,p,m)))break;u+=1}return Array.from({length:u-d+1},(_,p)=>d+p)})(e,t);if(n.length<=2)return;let o=[];for(let r of n){let i=mZe(e,r);if(!i)return;o.push(...i)}return[...new Set(o)]},LKe=(e,t)=>t>0&&t<e.route.length-1&&!((n,o)=>{let r=n.route[o];if(!r)return!1;let i=n.route[o-1],s=n.route[o+1];return i&&i.z!==r.z&&N_(i,r)||s&&s.z!==r.z&&N_(s,r)})(e,t),izt=(e,t,n)=>{let o=e.route[t.startIndex],r=e.route[t.endIndex];return!(!o||!r)&&(o.z===t.z&&r.z===t.z&&(!!((i,s)=>gV(i).maxX>=s.minX-Ua&&gV(i).minX<=s.maxX+Ua&&gV(i).maxY>=s.minY-Ua&&gV(i).minY<=s.maxY+Ua)(t,n)&&(LKe(e,t.startIndex)||LKe(e,t.endIndex))))},U2r=(e,t,n,o,r,i,s)=>{let a=e[t.routeIndex];if(!a)return!1;let c=((l,h,d,u)=>{let _=lV(nrn(d),u),{startIndex:p,startIndex:m}=h;for(;p>0;){let g={...h,startIndex:p-1,endIndex:p,start:l.route[p-1],end:l.route[p]};if(!l.route[p-1]||!izt(l,g,_))break;p-=1}for(;m<l.route.length-2;){let g={...h,startIndex:m+1,endIndex:m+2,start:l.route[m+1],end:l.route[m+2]};if(!l.route[m+2]||!izt(l,g,_))break;m+=1}let A=[];for(let g=p;g<=m+1;g+=1)LKe(l,g)&&A.push(g);return[...new Set(A)]})(a,t,n,o);return!(c.length<=2)&&lrn(a,c,r,i,s,t.radius)},szt=(e,t)=>{let n=o6(t,e),o=n.x-t.x,r=n.y-t.y,i=Math.hypot(o,r),s=e.end.x-e.start.x,a=e.end.y-e.start.y,c=Math.hypot(s,a),l=e.routeIndex%2==0?1:-1;return{projection:n,direction:i>kr?{x:o/i,y:r/i}:c>kr?{x:-a/c*l,y:s/c*l}:{x:1,y:0}}},gZe=(e,t,n,o,r)=>{let i=e[t.routeIndex];if(!i)return!1;let s=_Ze(r,t,n,o,t.radius);if(Math.abs(s.x)<=kr&&Math.abs(s.y)<=kr)return!1;let a={x:t.x+s.x,y:t.y+s.y},c=f1(r,t),l=f1(r,a);if(l<t.radius-Ua)return!1;let h=fq(r,t.radius);if(jbe(c,l,h))return!1;t.x+=s.x,t.y+=s.y,UV(t,r.bounds);for(let d of t.pointIndexes){let u=i.route[d];u&&(u.x=t.x,u.y=t.y)}return!0},hrn=(e,t,n)=>{if(!Number.isInteger(t.routeIndex))return[];let o=e[t.routeIndex];if(!o||t.routeIndex<0||t.routeIndex>=e.length)return[];let r=cv([o],n),i=r.find((a)=>a.pointIndexes.some((c)=>t.pointIndexes.includes(c)));if(!i)return[];let s=[];for(let a=0;a<e.length;a+=1){let c=e[a];if(!c||Q3(c)!==i.rootConnectionName)continue;let l=a===t.routeIndex?r:cv([c],n);for(let h of l)h.routeIndex=a,h.rootConnectionName===i.rootConnectionName&&Math.hypot(h.x-i.x,h.y-i.y)<=Ua&&s.push(h)}return s},yq=(e,t,n,o,r)=>t.movable&&hrn(e,t,r).length<=1&&gZe(e,t,n,o,r),W2r=(e,t,n,o,r=1)=>{let{projection:i,direction:s}=szt(t,n),a=zQ*r,c=1-i.t,l=i.t,h=wCe(e,t.routeIndex,t.startIndex,s.x*a*c,s.y*a*c,o,t.radius),d=wCe(e,t.routeIndex,t.endIndex,s.x*a*l,s.y*a*l,o,t.radius);return!(!h&&!d)||((u,_,p,m,A)=>{let g=u[_.routeIndex];if(!g)return!1;let{projection:f,direction:y}=szt(_,p),x=_Ze(m,f,y.x*zQ*A,y.y*zQ*A,_.radius);if(Math.abs(x.x)<=kr&&Math.abs(x.y)<=kr)return!1;let C={...g.route[_.startIndex],x:f.x+x.x,y:f.y+x.y};if(UV(C,m.bounds),xc(C,_.start,_.end)<=Ua)return!1;let b=g.route[_.startIndex],I=g.route[_.endIndex];if(!b||!I)return!1;let v=FS(m,b,I),P=Math.min(f1(m,C),FS(m,b,C),FS(m,C,I));if(P<_.radius-Ua)return!1;let M=fq(m,_.radius);return!jbe(v,P,M)&&(g.route.splice(_.endIndex,0,C),!0)})(e,t,n,o,r)},X2r=(e,t,n,o,r,i=1)=>{let s=t.radius+NJe(o)+C1,a=_rn(t,n,s);if(!a)return!1;let c=Math.min(0.3*Math.abs(i),a.penetration+C1),l=a.direction.x*c,h=a.direction.y*c,d=e[t.routeIndex];if(!d)return!1;let u=!((P)=>{for(let M=0;M<P.route.length-1;M+=1){let B=P.route[M],T=P.route[M+1];if(B&&T&&B.z!==T.z&&N_(B,T))return!0}return!1})(d);if(u&&nzt(e,t.routeIndex,l,h,o,t.radius,r))return!0;if(U2r(e,t,n,s,l,h,o)||((P,M,B,T,N)=>{let D=P[M.routeIndex];if(!D)return!1;let L=G2r(D,M);return!!L&&lrn(D,L,B,T,N,M.radius)})(e,t,l,h,o)||((P,M,B,T,N,D)=>{let L=P[M.routeIndex];if(!L)return!1;let H=ezt(N,L,M.startIndex,B,T,D),V=ezt(N,L,M.endIndex,B,T,D);if(!H||!V)return!1;let O=[...new Set([...H,...V])],U=Kbe(N,L,O,B,T,M.radius);if(!U)return!1;let j=!1;for(let Y of O){let X=L.route[Y];X&&(X.x+=U.x,X.y+=U.y,UV(X,N.bounds),j=!0)}return j})(e,t,l,h,o,r))return!0;if(!u&&nzt(e,t.routeIndex,l,h,o,t.radius,r))return!0;let p=n.width/2,m=n.height/2,A=(Math.abs(a.direction.y)>=Math.abs(a.direction.x)?[{...d.route[t.startIndex],x:n.center.x-p-s,y:n.center.y+a.direction.y*(m+s)},{...d.route[t.startIndex],x:n.center.x+p+s,y:n.center.y+a.direction.y*(m+s)}]:[{...d.route[t.startIndex],x:n.center.x+a.direction.x*(p+s),y:n.center.y-m-s},{...d.route[t.startIndex],x:n.center.x+a.direction.x*(p+s),y:n.center.y+m+s}]).map((P)=>{let{t:M}=o6(P,t),B={x:t.start.x+(t.end.x-t.start.x)*M,y:t.start.y+(t.end.y-t.start.y)*M},T=_Ze(o,B,P.x-B.x,P.y-B.y,t.radius);return P.x=B.x+T.x,P.y=B.y+T.y,UV(P,o.bounds),{point:P,t:M,moved:Math.abs(T.x)>kr||Math.abs(T.y)>kr,awayFromObstacleMotion:T.x*a.direction.x+T.y*a.direction.y}}).sort((P,M)=>P.t-M.t);if(!A.some(({moved:P})=>P))return!1;if(!A.some(({awayFromObstacleMotion:P})=>P>Ua))return!1;let g=A.map(({point:P})=>P);if(g.every((P)=>xc(P,t.start,t.end)<=Ua))return!1;if(g.some((P)=>!arn(o,P)))return!1;let f=d.route[t.startIndex],y=d.route[t.endIndex],x=g[0],C=g[1];if(!(f&&y&&x&&C))return!1;let b=FS(o,f,y),I=Math.min(f1(o,x),f1(o,C),FS(o,f,x),FS(o,x,C),FS(o,C,y));if(I<t.radius-Ua)return!1;let v=fq(o,t.radius);return!jbe(b,I,v)&&(d.route.splice(t.endIndex,0,...g),!0)},WS=(e,t,n)=>{let o;for(let r of e){if(n!==void 0&&r.routeIndex!==n)continue;let i=o6(t,r),s=Math.hypot(i.x-t.x,i.y-t.y);(!o||s<o.distance)&&(o={segment:r,distance:s})}return o?.segment},ace=(e,t,n)=>{let o;for(let r of e){if(n!==void 0&&r.routeIndex!==n)continue;let i=Math.hypot(r.x-t.x,r.y-t.y);(!o||i<o.distance)&&(o={via:r,distance:i})}return o?.via},j2r=(e,t)=>{let n=e.map((o)=>({via:o,distance:Math.hypot(o.x-t.x,o.y-t.y)})).sort((o,r)=>o.distance-r.distance).slice(0,2).map(({via:o})=>o);return n.length===2?n:void 0},gXe=(e,t,n,o)=>{let r=t.x-n.x,i=t.y-n.y,s=Math.hypot(r,i);return yq(e,t,(s>kr?r/s:1)*zQ,(s>kr?i/s:0)*zQ,o)},drn=(e,t)=>{let n=o6(e.start,t),o=o6(e.end,t),r=o6(t.start,e),i=o6(t.end,e),s=[{leftT:0,rightT:n.t,leftPoint:e.start,rightPoint:n},{leftT:1,rightT:o.t,leftPoint:e.end,rightPoint:o},{leftT:r.t,rightT:0,leftPoint:r,rightPoint:t.start},{leftT:i.t,rightT:1,leftPoint:i,rightPoint:t.end}],a=s[0],c=Math.hypot(a.leftPoint.x-a.rightPoint.x,a.leftPoint.y-a.rightPoint.y);for(let l=1;l<s.length;l+=1){let h=s[l],d=Math.hypot(h.leftPoint.x-h.rightPoint.x,h.leftPoint.y-h.rightPoint.y);d<c&&(a=h,c=d)}return a},dle=(e,t,n,o,r,i)=>{let s=eP(i,0,1),a=1-s,c=s,l=wCe(e,t.routeIndex,t.startIndex,n*a,o*a,r,t.radius),h=wCe(e,t.routeIndex,t.endIndex,n*c,o*c,r,t.radius);return l||h},urn=(e,t,n,o,r,i=0.035,s=!1,a)=>{if(!s&&(a?a.routesShareNet(t,n):v5(t.rootConnectionName,n.rootConnectionName,r)))return!1;let c=t.radius+n.radius+0.2+C1,l=t.x-n.x,h=t.y-n.y,d=Math.hypot(l,h),u=c-d;if(u<=0)return!1;let _=1.618*(97*t.routeIndex+13*n.routeIndex),p=d>kr?l/d:Math.cos(_),m=d>kr?h/d:Math.sin(_),A=Number(t.movable)+Number(n.movable);if(A===0)return!1;let g=Math.min(i,u/A),f=yq(e,t,p*g,m*g,o),y=yq(e,n,-p*g,-m*g,o);return f||y},K2r=(e,t,n,o,r)=>{if(!v5(t.rootConnectionName,n.rootConnectionName,r))return!1;let[i,s]=t.canCanonicalize?n.canCanonicalize&&t.routeIndex<=n.routeIndex?[t,n]:[n,t]:[t,n];return((a,c,l,h)=>{if(!l.canCanonicalize)return!1;let d=c.x-l.x,u=c.y-l.y;if(!l.movable&&Math.hypot(d,u)>l.radius+Ua)return!1;let _=a[l.routeIndex];if(!_)return!1;let p={x:l.x,y:l.y},m=l.pointIndexes.map((A)=>{let g=_.route[A];return g?{pointIndex:A,x:g.x,y:g.y}:void 0});if(gZe(a,l,d,u,h)&&N_(l,c))return!0;l.x=p.x,l.y=p.y;for(let A of m){if(!A)continue;let g=_.route[A.pointIndex];g&&(g.x=A.x,g.y=A.y)}return!1})(e,i,s,o)},AZe=(e,t,n,o,r,i=0.035,s=2,a=!1,c)=>{if(c?c.routesShareNet(t,n):v5(t.rootConnectionName,n.rootConnectionName,r))return!1;let l=o6(t,n),h=t.x-l.x,d=t.y-l.y,u=Math.hypot(h,d),_=t.radius+n.radius+(ox.traceClearance??0.1)+C1-u;if(_<=0)return!1;let p=n.end.x-n.start.x,m=n.end.y-n.start.y,A=Math.hypot(p,m),g=t.routeIndex%2==0?1:-1,f=u>kr?h/u:A>kr?-m/A*g:1,y=u>kr?d/u:A>kr?p/A*g:0,x=Math.min(i,_/s),C=a?((I,v,P,M,B)=>{let T=hrn(I,v,B);if(T.length===0||T.some((D)=>!D.movable||I[D.routeIndex]===void 0))return!1;let N=T.reduce((D,L)=>L.radius>D.radius?L:D);if(!gZe(I,N,P,M,B))return!1;for(let D of T){if(D===N)continue;D.x=N.x,D.y=N.y;let L=I[D.routeIndex];for(let H of D.pointIndexes){let V=L.route[H];V&&(V.x=N.x,V.y=N.y)}}return!0})(e,t,f*x,y*x,o):yq(e,t,f*x,y*x,o),b=dle(e,n,-f*x,-y*x,o,l.t);return C||b},prn=(e,t,n,o,r,i)=>{if(t.z!==n.z||(i?i.routesShareNet(t,n):v5(t.rootConnectionName,n.rootConnectionName,r)))return!1;let s=drn(t,n),a=s.leftPoint.x-s.rightPoint.x,c=s.leftPoint.y-s.rightPoint.y,l=Math.hypot(a,c),h=t.radius+n.radius+(ox.traceClearance??0.1)+C1-l;if(h<=0)return!1;let d=t.end.x-t.start.x,u=t.end.y-t.start.y,_=Math.hypot(d,u),p=(t.routeIndex+n.routeIndex)%2==0?1:-1,m=l>kr?a/l:_>kr?-u/_*p:1,A=l>kr?c/l:_>kr?d/_*p:0,g=Math.min(b$,h/2),f=dle(e,t,m*g,A*g,o,s.leftT),y=dle(e,n,-m*g,-A*g,o,s.rightT);return f||y},Sce=(e,t,n)=>Oq(e,n).includes(t.z),mrn=(e,t,n,o,r)=>{let i=t[n];if(!i)return;let s=lle(i,n);if(s.length===0)return;let a=Q3(i),c=WS(s,o);if(!c)return;let l=MCe(e,o,0.6,(u)=>!ZA(a,u,r)&&Sce(u,c,e.layerCount));if(l)return{obstacle:l,segment:c};let h=MCe(e,o,0.6,(u)=>!ZA(a,u,r)&&s.some((_)=>Sce(u,_,e.layerCount)));if(!h)return;let d=WS(s.filter((u)=>Sce(h,u,e.layerCount)),o);return d?{obstacle:h,segment:d}:void 0},_rn=(e,t,n)=>{let o=t.width/2,r=t.height/2,i=[{x:t.center.x-o,y:t.center.y-r},{x:t.center.x+o,y:t.center.y-r},{x:t.center.x+o,y:t.center.y+r},{x:t.center.x-o,y:t.center.y+r}],s=[t.center,...i].map((h)=>o6(h,e)),a=[{point:e.start,t:0},{point:e.end,t:1},{point:{x:(e.start.x+e.end.x)/2,y:(e.start.y+e.end.y)/2},t:0.5},...s.map((h)=>({point:{x:h.x,y:h.y},t:h.t}))],c,l=Math.hypot(e.end.x-e.start.x,e.end.y-e.start.y);for(let h of a){let d=Xbe(h.point,t,n);if(!d)continue;let u=l>kr?Math.abs(((e.end.x-e.start.x)*d.direction.y-(e.end.y-e.start.y)*d.direction.x)/l):0;(!c||d.penetration>c.penetration+kr||Math.abs(d.penetration-c.penetration)<=kr&&u>c.normality)&&(c={...d,normality:u,t:h.t})}return c},$2r=(e,t,n,o=!1,r)=>{let i=!1,s=cv(t,e),a=zle(t),c=orn(e,s,a),l=Math.max(1,2*c),h=RKe(s,Y3e,l),d=RKe(a,gV,l);for(let u=0;u<s.length;u+=1){let _=s[u];if(!_)continue;let p=d$(h,lV(Y3e(_),c),l);for(let m of p){if(m<=u)continue;let A=s[m];A&&(i=urn(t,_,A,e,n,b$,o,r)||i)}}for(let u=0;u<s.length;u+=1){let _=s[u];if(!_)continue;let p=d$(d,lV(Y3e(_),c),l);for(let m of p){let A=a[m];A&&(i=AZe(t,_,A,e,n,b$,2,!1,r)||i)}}for(let u=0;u<a.length;u+=1){let _=a[u];if(!_)continue;let p=d$(d,lV(gV(_),c),l);for(let m of p){if(m<=u)continue;let A=a[m];A&&(i=prn(t,_,A,e,n,r)||i)}}return((u,_,p,m,A,g,f,y,x)=>{let C=!1,b=NJe(u),I=m.reduce((M,B)=>Math.max(M,B.radius),0)+b+C1,v=zbe(u),P=p.reduce((M,B)=>Math.max(M,B.radius),0)+v+C1;for(let M of u.obstacles){if(M.isCopperPour)continue;let B=nrn(M),T=x?.forObstacle(M),N=d$(A,lV(B,P),f);for(let L of N){let H=p[L];if(!H)continue;if(T?T(H):ZA(H.rootConnectionName,M,y))continue;let V=Xbe(H,M,H.radius+v+C1);if(!V)continue;let O=Math.min(b$,V.penetration);C=yq(_,H,V.direction.x*O,V.direction.y*O,u)||C}let D=d$(g,lV(B,I),f);for(let L of D){let H=m[L];if(!H)continue;if((T?T(H):ZA(H.rootConnectionName,M,y))||!Sce(M,H,u.layerCount))continue;let V=_rn(H,M,H.radius+b+C1);if(!V)continue;let O=Math.min(b$,V.penetration);C=dle(_,H,V.direction.x*O,V.direction.y*O,u,V.t)||C}}return C})(e,t,s,a,h,d,l,n,r)||i},fZe=(e,t,n,o=1,r,i=!1,s=!0)=>{let a=jb(t),c=((d,u,_)=>{let p=d*d<=KFt?new Uint8Array(d*d):void 0,m=d*u<=KFt,A=new WeakMap;return{routesShareNet:(g,f)=>{let y=g.routeIndex*d+f.routeIndex,x=p?.[y];if(x)return x===2;let C=v5(g.rootConnectionName,f.rootConnectionName,_);return p&&(p[y]=C?2:1),C},forObstacle:(g)=>{let f=A.get(g);if(f)return f;let y=m?new Uint8Array(d):void 0;return f=(x)=>{let C=y?.[x.routeIndex];if(C)return C===2;let b=ZA(x.rootConnectionName,g,_);return y&&(y[x.routeIndex]=b?2:1),b},A.set(g,f),f}}})(a.length,e.obstacles.length,r),l=Math.max(2,Math.round(12*Math.max(1,n)*o)),h=!1;for(let d=0;d<l;d+=1){if(!$2r(e,a,r,i,c))break;h=!0}return h&&s&&((d,u,_,p)=>{let m=!1,A=cv(u,d),g=zle(u),f=orn(d,A,g),y=Math.max(1,2*f),x=RKe(g,gV,y);for(let C of A){let b=d$(x,lV(Y3e(C),f),y);for(let I of b){let v=g[I];v&&(m=AZe(u,C,v,d,_,b$,1.75,!1,p)||m)}}})(e,a,r,c),h?q9(a):t},q2r=(e)=>{let t=[];for(let n=0;n<e.route.length-1;n+=1){let o=e.route[n],r=e.route[n+1];if(!o||!r)continue;if(o.toNextSegmentType==="through_obstacle")continue;if(o.z===r.z||!N_(o,r))continue;let i={x:o.x,y:o.y},s=t.at(-1);s&&N_(s,i)||t.push(i)}return t},grn=(e)=>({...e,vias:q2r(e)}),q9=(e)=>e.map(grn),$K=(e,t)=>{let n=new Set(t);return e.map((o,r)=>n.has(r)?grn(o):o)},azt=(e)=>{let t=e.pcb_trace_id;if(typeof t!="string")return;let n=t.match(/^trace_(\d+)/);return n?Number.parseInt(n[1],10):void 0},Ole=(e)=>{let t=e.center??e.pcb_center;if(!t||typeof t!="object")return;let n=t;return typeof n.x=="number"&&typeof n.y=="number"?{x:n.x,y:n.y}:void 0},HKe=(e,t=!0)=>e.errors.filter((n)=>((o)=>Zy(o)==="pcb_via_clearance_error"||Array.isArray(o.pcb_via_ids))(n)&&(t||!S5(n))).length,S5=(e)=>Zy(e)==="pcb_pad_pad_clearance_error"&&Array.isArray(e.pcb_via_ids)&&e.pcb_via_ids.length===1,czt=(e)=>{let t=Object.entries(e).filter(([o,r])=>o!=="source_trace_id"&&(o.endsWith("_id")||o.endsWith("_ids"))&&r!==void 0&&r!=="").sort(([o],[r])=>o.localeCompare(r)),n=typeof e.message=="string"?e.message.replace(/-?\d+\.\d+/g,"#"):"";return JSON.stringify([Zy(e),t,n])},x5=(e)=>Math.max(e.errors.filter((t)=>!S5(t)).length,e.count-e.errors.filter(S5).length),G3e=(e)=>{let t=x5(e);return t>0?t:e.count},Arn=(e)=>{if(x5(e)===0)return e.issueScore;let t=e.errors.filter((n)=>!S5(n));return e.errors.some(S5)?I$(t):e.legacyIssueScore??I$(t)},AV=(e,t)=>{let n=x5(e),o=x5(t);return n!==o?n<o:!(n>0)&&e.count<t.count},lzt=(e)=>{let t=e.filter((n)=>!S5(n));return t.length>0?t:e},WV=(e,t)=>{let n=e.pcb_trace_id;return typeof n=="string"?t.get(n)??azt(e):azt(e)},xq=(e,t,n,o,r)=>{let i=n.pcb_port_id;if(!i)return!1;let s=(r??t.viaDiameter)/2;return e.obstacles.some((a)=>{let c=Oq(a,e.layerCount);return!(c.length!==1||c[0]!==n.z||!a.connectedTo.includes(i)||n.x-s<a.center.x-a.width/2-kr||n.x+s>a.center.x+a.width/2+kr||n.y-s<a.center.y-a.height/2-kr||n.y+s>a.center.y+a.height/2+kr)&&(ZA(Q3(t),a,o)||ZA(t.connectionName,a,o))})},hzt=[0,1,-1,2,-2,3,-3,4],frn=hzt.flatMap((e)=>hzt.map((t)=>[e,t])).sort(([e,t],[n,o])=>Math.abs(e)+Math.abs(t)-Math.abs(n)-Math.abs(o)),yrn=frn.length,xrn=(e,t,n)=>e.x-t>=n.minX-kr&&e.x+t<=n.maxX+kr&&e.y-t>=n.minY-kr&&e.y+t<=n.maxY+kr,Gb=(e,t)=>{let n=e.at(-1);n&&N_(n,t)&&n.z===t.z&&n.pcb_port_id===t.pcb_port_id||e.push(t)},J2r=(e,t,n,o,r,i,s,a=0,c=!1)=>{let l=Zy(n);if(l!=="pcb_pad_trace_clearance_error"&&l!=="pcb_trace_error")return!1;if(r<0||r>=e.layerCount)return!1;let h=t[o];if(!h||h.route.length<2)return!1;let d=h.route.map((X)=>({...X})),u=d[0],_=d.at(-1);if(!u||!_)return!1;let p=Ole(n);if(!p)return!1;let m=dZe(n),A=m?mrn(e,t,o,p,s):void 0,g=m?A?.segment:WS(lle(h,o),p);if(!g||g.z===r)return!1;let{startIndex:f,endIndex:y}=g,x=i==="full"?d.length:i;for(let X=0;X<x;X+=1){let K=!1;if(d[f-1]?.z===g.z&&(f-=1,K=!0),d[y+1]?.z===g.z&&(y+=1,K=!0),!K)break}let C=f===0&&u.pcb_port_id,b=y===d.length-1&&_.pcb_port_id,I=h.viaDiameter/2,v=frn[a%yrn],P=!1,M=(X)=>{let K=X==="start"?u:_,J=((re,Z,te,ie)=>{let le=te.pcb_port_id;if(le)return re.obstacles.find((ue)=>{let de=Oq(ue,re.layerCount);return!(de.length!==1||de[0]!==te.z||!ue.connectedTo.includes(le)||!Wbe(te,ue))&&(ZA(Q3(Z),ue,ie)||ZA(Z.connectionName,ue,ie))})})(e,h,K,s),ee=((re,Z)=>{let te=Z==="start"?re[0]:re.at(-1);if(!te)return;let ie=Z==="start"?Array.from({length:re.length-1},(le,ue)=>ue+1):Array.from({length:re.length-1},(le,ue)=>re.length-ue-2);for(let le of ie){let ue=re[le];if(!ue)continue;let de=ue.x-te.x,me=ue.y-te.y,Ae=Math.hypot(de,me);if(!(Ae<=kr))return{x:de/Ae,y:me/Ae}}})(d,X);if(!J||!ee)return;let se=((re,Z,te,ie)=>{let le=0,ue=Math.hypot(Z.width,Z.height)+2*ie,de=ie+kr,me=(Ae)=>({x:re.x+te.x*Ae,y:re.y+te.y*Ae});if(!(OQ(me(ue),Z)<de)){for(;ue-le>kr;){let Ae=(le+ue)/2;OQ(me(Ae),Z)>=de?ue=Ae:le=Ae}return me(ue)}})(K,J,((re,Z)=>{let te=Z*Math.PI/4,ie=Math.cos(te),le=Math.sin(te);return{x:re.x*ie-re.y*le,y:re.x*le+re.y*ie}})(ee,X==="start"?v[0]:v[1]),I);if(!se||!xrn(se,I,e.bounds)||OQ(se,J)+kr<I)return;if(!c)return se;let ne=((re,Z,te,ie,le,ue)=>{let de=ie+(re.minBoardEdgeClearance??0),me={minX:re.bounds.minX+de,maxX:re.bounds.maxX-de,minY:re.bounds.minY+de,maxY:re.bounds.maxY-de};if(me.minX>me.maxX||me.minY>me.maxY)return;let Ae=H2r(re,Z,ie,le,ue),xe=(mt)=>tCe(mt,me)&&Ae.every((lt)=>XFt(mt,lt)>=lt.clearance),Me=_Xe(te,me);if(xe(Me))return tCe(te,me)?te:Me;let Re=Ae.filter((mt)=>XFt(Me,mt)<mt.clearance),we=new Set(Re);for(let mt=0;mt<Re.length;mt+=1)for(let lt of Ae)!we.has(lt)&&mB(Re[mt].bounds,lt.bounds)&&(we.add(lt),Re.push(lt));let _e=Re.flatMap(L2r),ye={x:me.minX,y:me.minY},Se={x:me.maxX,y:me.minY},Ne={x:me.maxX,y:me.maxY},ke={x:me.minX,y:me.maxY},nt;_e.push(HS(ye,Se),HS(Se,Ne),HS(Ne,ke),HS(ke,ye));let dt=Number.POSITIVE_INFINITY,rt=(mt)=>{let lt=BS(mt,te);lt<dt&&xe(mt)&&(nt=mt,dt=lt)};for(let mt of _e)for(let lt of qon(te,mt))rt(lt);for(let mt=0;mt<_e.length;mt+=1){let lt=_e[mt];if(!(BS(te,_Xe(te,lt.bounds))>dt))for(let Ct=mt+1;Ct<_e.length;Ct+=1){let Nt=_e[Ct];if(mB(lt.bounds,Nt.bounds)&&!(BS(te,_Xe(te,Nt.bounds))>dt))for(let Ht of Jon(lt,Nt))rt(Ht)}}return nt})(e,h,se,I,[g.z,r],s);return P||=ne!==void 0&&ne!==se,ne},B=C?M("start"):void 0,T=b?M("end"):void 0;if(C&&!B||b&&!T||c&&!P)return!1;let N=[];for(let X=0;X<f;X+=1)Gb(N,d[X]);let D=d[f],L=f>0&&N_(d[f-1],D),H=d[y],V=y<d.length-1&&N_(d[y+1],H);C?(Gb(N,u),Gb(N,{...u,...B,pcb_port_id:void 0}),Gb(N,{...u,...B,z:r,pcb_port_id:void 0})):(L||Gb(N,{...D,pcb_port_id:void 0}),Gb(N,{...D,z:r,pcb_port_id:void 0}));let O=b?y-1:y;for(let X=f+1;X<=O;X+=1)Gb(N,{...d[X],z:r,pcb_port_id:void 0});b?(Gb(N,{..._,...T,z:r,pcb_port_id:void 0}),Gb(N,{..._,...T,pcb_port_id:void 0}),Gb(N,_)):V||Gb(N,{...H,pcb_port_id:void 0});for(let X=y+1;X<d.length;X+=1)Gb(N,d[X]);for(let X=1;X<N.length-1;X+=1)N[X].pcb_port_id=void 0;let U=e.minBoardEdgeClearance??0.2,j=lle(h,o),Y=cv([h],e);for(let X=1;X<N.length;X+=1){let K=N[X-1],J=N[X];if(K.z===J.z&&!j.some((ee)=>kKe(K,ee.start,ee.end)&&kKe(J,ee.start,ee.end))&&FS(e,K,J)<h.traceThickness/2+U)return!1;if(K.z!==J.z&&K.toNextSegmentType!=="through_obstacle"&&!Y.some((ee)=>N_(ee,J)&&ee.radius>=I)&&f1(e,J)<I+U)return!1}return h.route=N,!0},Z2r=(e,t,n,o,r,i,s)=>{let a=Zy(n);if(a!=="pcb_pad_trace_clearance_error"&&a!=="pcb_trace_error")return!1;if(r<0||r>=e.layerCount)return!1;let c=WV(n,o);if(c===void 0)return!1;let l=t[c];if(!l||l.route.length<2)return!1;let h=l.route[0],d=l.route.at(-1);if(!h||!d||h.z!==d.z||r===h.z)return!1;if(l.route.some((_)=>_.z!==h.z))return!1;if(!h.pcb_port_id||!d.pcb_port_id)return!1;if(!xq(e,l,h,i,s)||!xq(e,l,d,i,s))return!1;let u=l.route.map((_)=>({..._}));return l.route=[u[0],{...u[0],z:r,pcb_port_id:void 0},...u.slice(1,-1).map((_)=>({..._,z:r})),{...u.at(-1),z:r,pcb_port_id:void 0},u.at(-1)],!0},e1r=(e,t,n,o,r,i,s)=>{if(Zy(n)!=="pcb_pad_trace_clearance_error")return!1;let a=WV(n,o);if(a===void 0)return!1;let c=t[a];if(!c||c.route.length<4)return!1;let l=c.route.map((A)=>({...A}));if(r==="start"){let A=l[0];if(!xq(e,c,A,i,s))return!1;let g=-1;for(let b=1;b<l.length;b+=1)if(l[b].z!==A.z){g=b;break}if(g<=0)return!1;let f=g-1;if(!N_(l[f],l[g]))return!1;let y=g;for(;y+1<l.length&&N_(l[g],l[y+1]);)y+=1;let x=l[y].z,C=l.slice(f,y+1).map((b)=>b.z);return c.route=[A,...C.slice(1).map((b)=>({...A,z:b,pcb_port_id:void 0})),...l.slice(1,f+1).map((b)=>({...b,z:x})),...l.slice(y+1)],!0}let h=l.at(-1);if(!xq(e,c,h,i,s))return!1;let d=-1;for(let A=l.length-2;A>=0;A-=1)if(l[A].z!==h.z){d=A;break}if(d<0||d>=l.length-1)return!1;let u=d+1;if(!N_(l[d],l[u]))return!1;let _=d;for(;_-1>=0&&N_(l[d],l[_-1]);)_-=1;let p=l[_].z,m=l.slice(_,u+1).map((A)=>A.z);return c.route=[...l.slice(0,_+1),...l.slice(u+1,-1).map((A)=>({...A,z:p})),{...h,z:p,pcb_port_id:void 0},...m.slice(1,-1).map((A)=>({...h,z:A,pcb_port_id:void 0})),h],!0},Vle=(e,t)=>{let n=e.pcb_trace_id;if(typeof n!="string")return;if(Array.isArray(e.pcb_via_ids)&&e.pcb_via_ids.length>0)return;let o=Array.isArray(e.pcb_trace_ids)?e.pcb_trace_ids.filter((l)=>typeof l=="string"):[],r=e.pcb_trace_error_id,i=`overlap_${n}_`,s=typeof r=="string"&&r.startsWith(i)?r.slice(i.length):void 0,a=[n,...o,...s?[s]:[]],c=[...new Set(a.map((l)=>t.get(l)).filter((l)=>l!==void 0))];return c.length>=2?[c[0],c[1]]:void 0},t1r=(e,t,n,o,r)=>{if(Zy(n)!=="pcb_trace_error")return;let i=Vle(n,o);if(!i)return;let s=n.worst_contact_center??n.center;if(!s||typeof s!="object")return;let a=s;if(typeof a.x!="number"||typeof a.y!="number")return;let c={x:a.x,y:a.y},l=zle(t),h=WS(l,c,i[0]),d=WS(l,c,i[1]);if(!h||!d||h.z!==d.z)return;let u=drn(h,d),_=u.leftPoint.x-u.rightPoint.x,p=u.leftPoint.y-u.rightPoint.y,m=Math.hypot(_,p),A=Number(n.minimum_clearance),g=Number.isFinite(A)?A:ox.traceClearance??0.1,f=h.radius+d.radius+g-m;if(f<=kr)return;let y=r===0?h:d,x=r===0?u.leftT:u.rightT,C=(1-x)**2+x**2;if(C<=kr)return;let b=f/C,I=r===0?u.leftPoint:u.rightPoint,v=r===0?u.rightPoint:u.leftPoint,P=r===0?1:-1,M=y.end.x-y.start.x,B=y.end.y-y.start.y,T=Math.hypot(M,B),N=(y.routeIndex+(r===0?d.routeIndex:h.routeIndex))%2==0?1:-1,D=m>kr?(I.x-v.x)/m:T>kr?-B/T*N*P:P,L=m>kr?(I.y-v.y)/m:T>kr?M/T*N*P:0;return dle(t,y,D*b,L*b,e,x)?{movedRouteIndex:y.routeIndex}:void 0},n1r=(e)=>{let{srj:t,via:n,segment:o,segments:r,initialTarget:i,requiredTraceDistance:s,requiredObstacleDistance:a,connMap:c}=e,l=Math.min(...n.zLayers),h=Math.max(...n.zLayers),d=t.obstacles.filter((p)=>!p.isCopperPour&&!ZA(n.rootConnectionName,p,c)&&Oq(p,t.layerCount).some((m)=>m>=l&&m<=h)),u=d.filter((p)=>Boolean(Xbe(i,p,a)));return[i,...F2r(n,r,s-n.radius-o.radius,c),...u.flatMap((p)=>((m)=>{let{point:A,obstacle:g,requiredDistance:f}=m,y=g.center.x-g.width/2,x=g.center.x+g.width/2,C=g.center.y-g.height/2,b=g.center.y+g.height/2,I=Math.max(y-A.x,A.x-x,0),v=Math.max(C-A.y,A.y-b,0),P=[];if(I<f){let M=Math.sqrt(f*f-I*I);P.push({x:A.x,y:C-M-kr},{x:A.x,y:b+M+kr})}if(v<f){let M=Math.sqrt(f*f-v*v);P.push({x:y-M-kr,y:A.y},{x:x+M+kr,y:A.y})}return P})({point:i,obstacle:p,requiredDistance:a}))].filter((p)=>{if(!xrn(p,n.radius,t.bounds))return!1;let m=o6(p,o);return!(Math.hypot(p.x-m.x,p.y-m.y)<s-kr)&&(!r.some((A)=>A.z>=l&&A.z<=h&&!v5(n.rootConnectionName,A.rootConnectionName,c)&&xc(p,A.start,A.end)<s+A.radius-o.radius-kr)&&d.every((A)=>OQ(p,A)>=a-kr))}).sort((p,m)=>Math.hypot(p.x-n.x,p.y-n.y)-Math.hypot(m.x-n.x,m.y-n.y))[0]},dzt=(e,t,n,o,r,i)=>{if(Zy(n)!=="pcb_trace_error")return!1;let s=typeof n.pcb_trace_error_id=="string"?n.pcb_trace_error_id.toLowerCase():"",a=typeof n.message=="string"?n.message.toLowerCase():"";if(!(typeof n.pcb_via_id=="string"||Array.isArray(n.pcb_via_ids)||s.includes("_via_")||a.includes("via")))return!1;if(WV(n,o)!==r)return!1;if(Vle(n,o))return!1;let c=n.worst_contact_center??n.center;if(!c||typeof c!="object")return!1;let l=c;if(typeof l.x!="number"||typeof l.y!="number")return!1;let h={x:l.x,y:l.y},d=zle(t),u=WS(d,h,r),_=Array.isArray(n.pcb_trace_ids)?n.pcb_trace_ids.filter((O)=>typeof O=="string"&&O!==n.pcb_trace_id):[],p=_.map((O)=>o.get(O)).filter((O)=>O!==void 0),m=cv(t,e),A=ace(_.length>0?m.filter((O)=>p.includes(O.routeIndex)):m,h);if(!u||!A||!A.movable||v5(A.rootConnectionName,u.rootConnectionName,i))return!1;let g=o6(A,u),f=A.x-g.x,y=A.y-g.y,x=Math.hypot(f,y),C=Number(n.minimum_clearance),b=Number.isFinite(C)?C:ox.traceClearance??0.1,I=A.radius+u.radius+b-x;if(I<=kr)return!1;let v=u.end.x-u.start.x,P=u.end.y-u.start.y,M=Math.hypot(v,P),B=A.routeIndex%2==0?1:-1,T=x>kr?f/x:M>kr?-P/M*B:1,N=x>kr?y/x:M>kr?v/M*B:0,D=A.radius+u.radius+b,L=A.radius+zbe(e)+C1,H={x:A.x+T*(I+C1),y:A.y+N*(I+C1)},V=n1r({srj:e,via:A,segment:u,segments:d,initialTarget:H,requiredTraceDistance:D,requiredObstacleDistance:L,connMap:i});return!!V&&yq(t,A,V.x-A.x,V.y-A.y,e)},yZe=(e,t,n)=>{if(Zy(t)!=="pcb_trace_error")return;let o=Ole(t),r=e[n];if(!o||!r)return;let i=WS(lle(r,n),o);return i?{center:o,route:r,segment:i}:void 0},Crn=(e,t,n,o)=>{let r=yZe(e,t,n);if(!r)return;let{route:i,segment:s}=r,a=Math.max(0,s.startIndex-o),c=Math.min(i.route.length-1,s.endIndex+o),l=i.route.slice(a,c+1),h=l[0],d=l.at(-1);return h&&d&&!l.some((u)=>u.z!==h.z)&&h.z===d.z?{route:i,spanStartIndex:a,spanEndIndex:c,start:h,end:d}:void 0},o1r=(e,t,n,o,r,i,s=0,a,c)=>{if(i<0||i>=e.layerCount)return!1;let l=Vle(n,o);if(!l)return!1;let h=l[r],d=yZe(t,n,h);if(!d||d.segment.z===i)return!1;let{route:u,segment:_}=d,{startIndex:p,endIndex:m}=_;for(let y=0;y<s;y+=1)u.route[p-1]?.z===_.z&&(p-=1),u.route[m+1]?.z===_.z&&(m+=1);if(p===0&&u.route[0]?.pcb_port_id&&!xq(e,u,u.route[0],a,c)||m===u.route.length-1&&u.route.at(-1)?.pcb_port_id&&!xq(e,u,u.route.at(-1),a,c))return!1;let A=u.route[p],g=u.route[m];if(!A||!g||A.z!==g.z)return!1;let f=u.route.slice(p,m+1).map((y)=>({...y,z:i,pcb_port_id:void 0}));return u.route.splice(p,m-p+1,{...A},...f,{...g}),!0},r1r=(e,t,n,o,r,i)=>{if(o<=0||r<=0)return!1;let s=yZe(e,t,n);if(!s)return!1;let{center:a,route:c,segment:l}=s,h=l.end.x-l.start.x,d=l.end.y-l.start.y,u=Math.hypot(h,d);if(u<=kr)return!1;let _=o6(a,l),p=eP(_.t-o/u,0.02,0.98),m=eP(_.t+o/u,0.02,0.98);if(p>=m)return!1;let A=(I)=>({x:l.start.x+h*I,y:l.start.y+d*I,z:l.z}),g=A(p),f=A(m),y=-d/u*i,x=h/u*i,C=c.route[l.startIndex],b=c.route[l.endIndex];return c.route.splice(l.startIndex,2,{...C},g,{...g,x:g.x+y*r,y:g.y+x*r},{...f,x:f.x+y*r,y:f.y+x*r},f,{...b}),!0},i1r=(e,t,n,o,r,i,s,a=!1)=>{if(!Number.isInteger(r)||r<0||r>=e.layerCount)return!1;let c=Ole(n),l=t[o],h=l?.route[0],d=l?.route.at(-1);if(!l||!c||!h||!d||h.z!==d.z||h.z===r||l.jumpers?.length||l.route.some((O)=>O.z!==h.z||O.toNextSegmentType==="through_obstacle"))return!1;let u=d.x-h.x,_=d.y-h.y,p=Math.hypot(u,_);if(p<=kr||p>8)return!1;let m=u/p,A=_/p,g=A*i,f=-m*i,y=(O)=>(O.x-c.x)*m+(O.y-c.y)*A,x=(O,U,j)=>({x:c.x+m*O+g*U,y:c.y+A*O+f*U,z:j}),C=(l.viaDiameter??e.minViaDiameter??0.3)+(e.minTraceToPadEdgeClearance??ox.traceClearance??0.1),b=(a?1.25:-0.75)*C,I=(a?-0.75:1.25)*C,v=y(h)+0.5*C*s,P=y(d)+C*s,M=x(v,b,h.z),B=x(P,I,h.z),T=x(v,2*C,r),N=x(P,2*C,r),D=[{...h},M,{...M,z:r},T,N,{...B,z:r},B,{...d}],L=e.minBoardEdgeClearance??0,H=(l.viaDiameter??e.minViaDiameter??0.3)/2,V=l.traceThickness/2;if([M,B].some((O)=>f1(e,O)+Ua<H+L))return!1;for(let O=0;O<D.length-1;O+=1){let U=D[O],j=D[O+1];if(U.z===j.z&&FS(e,U,j)+Ua<V+L)return!1}return l.route.splice(0,l.route.length,...D),!0},s1r=(e,t,n,o,r,i,s)=>{if(!Number.isInteger(r)||r<1||i<=0)return!1;let a=Crn(t,n,o,r);if(!a)return!1;let{route:c,spanStartIndex:l,spanEndIndex:h,start:d,end:u}=a,_=u.x-d.x,p=u.y-d.y,m=Math.hypot(_,p);if(m<=kr)return!1;let A=-p/m*s*i,g=_/m*s*i,f={...d,x:d.x+A,y:d.y+g,pcb_port_id:void 0},y={...u,x:u.x+A,y:u.y+g,pcb_port_id:void 0};return!(!Aq(f,e.bounds)||!Aq(y,e.bounds))&&(c.route.splice(l,h-l+1,{...d},f,y,{...u}),!0)},a1r=(e,t,n,o,r,i)=>{if(!Number.isInteger(r)||r<0)return!1;let s=Crn(t,n,o,r);if(!s)return!1;let{route:a,spanStartIndex:c,spanEndIndex:l,start:h,end:d}=s;return!(Math.hypot(i.x-h.x,i.y-h.y)<=kr||Math.hypot(i.x-d.x,i.y-d.y)<=kr||!Aq(i,e.bounds))&&(a.route.splice(c,l-c+1,{...h},{x:i.x,y:i.y,z:h.z},{...d}),!0)},vS=(e,t,n,o,r,i)=>{if(i){let c=x5(e),l=x5(i);if(c!==l)return c<l}let s=G3e(e),a=Arn(e);return s<n||s===n&&a<o||s===n&&t<r},FKe=(e,t,n,o,r,i,s=!0,a=!1,c=!0,l=!1)=>{let h=!1;for(let d of n){let u=cv(t,e),_=zle(t),p=Ole(d);if(!p)continue;let m=p,A=d.pcb_via_ids,g=Zy(d)==="pcb_via_clearance_error",f=S5(d),y=Array.isArray(A)&&A.length>0,x=!g&&!f&&y&&(typeof d.pcb_trace_id=="string"||Array.isArray(d.pcb_trace_ids)),C=l&&x;if(y&&!x){m=qFt(e,d,p);let D=WV(d,o),L=A.length>1?j2r(u,p):void 0;if(L){let H=a&&Zy(d)==="pcb_via_clearance_error"&&d.pcb_via_pair_net_relation==="same_net",V=s&&Zy(d)==="pcb_via_clearance_error";h=(H?K2r(t,L[0],L[1],e,i):urn(t,L[0],L[1],e,i,0.16*Math.abs(r),V))||h}else{let H=ace(u,p,D);H&&(h=gXe(t,H,m,e)||h)}continue}let b=d.pcb_trace_id,I=WV(d,o);if(C&&I===void 0)continue;let v=Array.isArray(d.pcb_trace_ids)?d.pcb_trace_ids.filter((D)=>typeof D=="string"):[];if(C&&typeof b=="string"&&I!==void 0&&v.includes(b)&&v.some((D)=>D!==b&&!o.has(D))){let D=ace(u,p,I);if(D){h=gXe(t,D,p,e)||h;continue}}let P=s&&!x?Vle(d,o):void 0;if(P){let D=WS(_,p,P[0]),L=WS(_,p,P[1]);if(D&&L&&prn(t,D,L,e,i)){h=!0;continue}}let M=dZe(d),B=M&&I!==void 0?mrn(e,t,I,p,i):void 0,T=M?B?.segment:WS(_,p,I);if(T){let D=M?B?.obstacle:MCe(e,p);if(M&&!D)continue;m=M?D?.center??p:qFt(e,d,p);let L=C?void 0:ace(u,p),H=Zy(d)==="pcb_via_trace_clearance_error",V=typeof d.pcb_trace_error_id=="string"?d.pcb_trace_error_id.toLowerCase():"",O=typeof d.message=="string"?d.message.toLowerCase():"",U=H||typeof d.pcb_via_id=="string"||Array.isArray(d.pcb_via_ids)||V.includes("_via_")||O.includes("via"),j=Array.isArray(d.pcb_port_ids)&&d.pcb_port_ids.length>0;if(L&&!v5(L.rootConnectionName,T.rootConnectionName,i)&&(H||Math.hypot(L.x-p.x,L.y-p.y)<0.45)){if(AZe(t,L,T,e,i,0.3*Math.abs(r),1,c)&&(h=!0,U&&!j))continue}h=(D!==void 0&&(M||!ZA(T.rootConnectionName,D,i)&&Sce(D,T,e.layerCount))?X2r(t,T,D,e,i,r):W2r(t,T,m,e,r))||h}let N=C?void 0:ace(cv(t,e),p);N&&Math.hypot(N.x-p.x,N.y-p.y)<0.35&&(h=gXe(t,N,m,e)||h)}return h},Xg=0.000001,ule=0.006,c1r=[1,0.5,0.25,0.1,0.05,0.025],Y$=(e,t)=>(t.traceThickness??e.minTraceWidth)/2,BCe=(e)=>e.minTraceToPadEdgeClearance??0.1,brn=(e,t)=>t.viaDiameter??e.minViaDiameter??0.3,JQ=(e,t)=>kn(e,t)<Xg,Irn=(e)=>{let t=[],n=(o)=>{t.some((r)=>JQ(r,o))||t.push({x:o.x,y:o.y})};for(let o of e.vias)n(o);for(let o=0;o<e.route.length-1;o+=1){let r=e.route[o],i=e.route[o+1];r&&i&&r.z!==i.z&&(JQ(r,i)&&n(r))}return t},TCe=(e)=>kn({x:0,y:0},e)<Xg?{x:0,y:0}:kje({x:0,y:0},e),vrn=(e,t)=>{if(e.zLayers&&e.zLayers.length>0)return e.zLayers;let n=Array.from({length:t},(o,r)=>r).filter((o)=>e.layers.includes($y(o,t)));return n.length>0?n:Array.from({length:t},(o,r)=>r)},xZe=(e,t,n)=>v5(Q3(e),Q3(t),n)||v5(Q3(e),t.connectionName,n)||v5(e.connectionName,Q3(t),n)||v5(e.connectionName,t.connectionName,n),Srn=(e,t,n)=>ZA(Q3(e),t,n)||ZA(e.connectionName,t,n),l1r=(e,t,n,o)=>!n.pcb_port_id&&e.obstacles.some((r)=>Srn(t,r,o)&&vrn(r,e.layerCount).includes(n.z)&&((i,s)=>i.x>=s.center.x-s.width/2-Xg&&i.x<=s.center.x+s.width/2+Xg&&i.y>=s.center.y-s.height/2-Xg&&i.y<=s.center.y+s.height/2+Xg)(n,r)),Prn=(e,t,n,o,r)=>{if(!((s,a)=>s.zLayers.includes(a))(r,n.z))return Number.POSITIVE_INFINITY;let i=Y$(e,t);return r.kind==="pad"?KS(n,o,r.obstacle)-(BCe(e)+i+ule):xc(r.center,n,o)-(BCe(e)+i+r.diameter/2+ule)},h1r=(e,t,n)=>{let o=n.kind==="pad"?n.obstacle.center:n.center,r=Vm(o,e,t),i=TCe({x:r.x-o.x,y:r.y-o.y});if(Math.abs(i.x)<Xg&&Math.abs(i.y)<Xg){let s=t.x-e.x,a=t.y-e.y,c=RV(e,t),l=TCe({x:-a,y:s}),h={x:-l.x,y:-l.y};i=kn({x:c.x+l.x,y:c.y+l.y},o)>=kn({x:c.x+h.x,y:c.y+h.y},o)?l:h}return i},cce=(e,t,n,o)=>{if(n<=0||n>=t.route.length-1){let a=t.route[n];return!a||!l1r(e,t,a,o)}let r=t.route[n];if(!r||r.insideJumperPad)return!0;let i=t.route[n-1],s=t.route[n+1];return!(!i||i.z===r.z)||(!(!s||s.z===r.z)||t.vias.some((a)=>JQ(a,r)))},uzt=(e,t,n)=>{let o=0;for(let r=0;r<t.route.length-1;r+=1){let i=t.route[r],s=t.route[r+1];if(i&&s&&i.z===s.z&&!JQ(i,s))for(let a of n){let c=Prn(e,t,i,s,a);if(!(c>=0)&&(o+=c*c,a.kind==="pad")){if(KS(i,s,a.obstacle)<Xg)o+=0.01/(xc(a.obstacle.center,i,s)+0.01)}}}return o},pzt=(e,t,n,o)=>{let r=0;for(let i=0;i<t.route.length-1;i+=1){let s=t.route[i],a=t.route[i+1];if(s&&a&&s.z===a.z&&!JQ(s,a)){for(let c of n)if(!xZe(t,c,o)){for(let l=0;l<c.route.length-1;l+=1){let h=c.route[l],d=c.route[l+1];if(!h||!d||h.z!==s.z||d.z!==s.z||JQ(h,d))continue;let u=Q_(s,a,h,d)-Y$(e,t)-Y$(e,c),_=BCe(e)+ule-u;_>0&&(r+=_*_)}for(let l of Irn(c)){let h=xc(l,s,a)-Y$(e,t)-brn(e,c)/2,d=BCe(e)+ule-h;d>0&&(r+=d*d)}}}}return r},d1r=(e,t,n,o,r)=>{let i=t.route.map(()=>({x:0,y:0}));for(let s=0;s<t.route.length-1;s+=1){let a=t.route[s],c=t.route[s+1];if(a&&c&&a.z===c.z&&!JQ(a,c)){for(let l of n){let h=Prn(e,t,a,c,l);if(h>=0)continue;let d=h1r(a,c,l);if(Math.abs(d.x)<Xg&&Math.abs(d.y)<Xg)continue;let u=!cce(e,t,s,r),_=!cce(e,t,s+1,r);if(!u&&!_)continue;let p=-h,m=u&&_?0.5:u?1:0,A=u&&_?0.5:_?1:0;i[s].x+=d.x*p*m,i[s].y+=d.y*p*m,i[s+1].x+=d.x*p*A,i[s+1].y+=d.y*p*A}for(let l of o)if(!xZe(t,l,r))for(let h=0;h<l.route.length-1;h+=1){let d=l.route[h],u=l.route[h+1];if(!d||!u||d.z!==a.z||u.z!==a.z||JQ(d,u))continue;let _=Q_(a,c,d,u)-Y$(e,t)-Y$(e,l),p=e.minTraceToPadEdgeClearance+ule-_;if(p<=0)continue;let m=RV(a,c),A=Vm(m,d,u),g=TCe({x:m.x-A.x,y:m.y-A.y});if(Math.abs(g.x)<Xg&&Math.abs(g.y)<Xg){let b=c.x-a.x,I=c.y-a.y;g=TCe({x:-I,y:b})}let f=!cce(e,t,s,r),y=!cce(e,t,s+1,r);if(!f&&!y)continue;let x=f&&y?0.5:f?1:0,C=f&&y?0.5:y?1:0;i[s].x+=g.x*p*x,i[s].y+=g.y*p*x,i[s+1].x+=g.x*p*C,i[s+1].y+=g.y*p*C}}}return i},u1r=(e,t,n,o,r)=>({...t,route:t.route.map((i,s)=>{if(cce(e,t,s,r))return{...i};let a=((c,l)=>{let h=kn({x:0,y:0},c);if(h<=l||h<Xg)return c;let d=l/h;return{x:c.x*d,y:c.y*d}})(n[s]??{x:0,y:0},0.5);return{...i,x:i.x+a.x*o,y:i.y+a.y*o}}),vias:t.vias.map((i)=>({...i})),jumpers:t.jumpers?[...t.jumpers]:void 0}),p1r=(e,t)=>t.route.every((n)=>n.x>=e.bounds.minX-Xg&&n.x<=e.bounds.maxX+Xg&&n.y>=e.bounds.minY-Xg&&n.y<=e.bounds.maxY+Xg),m1r=(e,t,n,o,r)=>{let i=((l,h,d,u)=>{let _=[];for(let m of l.obstacles)m.isCopperPour||Srn(d,m,u)||_.push({kind:"pad",obstacle:m,zLayers:vrn(m,l.layerCount)});let p=Array.from({length:l.layerCount},(m,A)=>A);for(let m of h)if(m!==d&&!xZe(d,m,u))for(let A of Irn(m))_.push({kind:"via",center:{x:A.x,y:A.y},diameter:brn(l,m),zLayers:p,connectionName:m.connectionName,rootConnectionName:m.rootConnectionName});return _})(e,t,n,r),s=t.filter((l,h)=>h!==o&&l!==n),a=n,c=uzt(e,a,i)+pzt(e,a,s,r);for(let l=0;l<160&&!(c<=Xg);l+=1){let h=d1r(e,a,i,s,r);if(h.every((_)=>kn(_,{x:0,y:0})<0.000000001))break;let d=null,u=c;for(let _ of c1r){let p=u1r(e,a,h,_,r),m=uzt(e,p,i)+pzt(e,p,s,r);if(m<c-0.000001&&p1r(e,p)){d=p,u=m;break}}if(!d)break;a=d,c=u}return a},DQ=0.000001,_1r=[1,0.5,0.25,0.1,0.05,0.025],g1r=(e,t)=>e.some((n)=>t.includes(n)),A1r=(e,t,n,o)=>(ZA(e.rootConnectionName,n,o)||ZA(t.connectionName,n,o))&&OQ(e,n)<=DQ,Ern=(e,t,n,o)=>{let r=[],i=t[n.routeIndex];if(!i)return r;for(let s of e.obstacles){if(s.isCopperPour||A1r(n,i,s,o))continue;let a=Oq(s,e.layerCount);g1r(n.zLayers,a)&&r.push({obstacle:s})}return r},f1r=(e,t,n)=>OQ(t,n.obstacle)-(t.radius+e.minViaEdgeToPadEdgeClearance+0.006),mzt=(e,t,n,o)=>cv(t,e).filter((r)=>r.routeIndex===n).reduce((r,i)=>r+((s,a,c,l)=>{let h=0;for(let d of Ern(s,a,c,l)){let u=f1r(s,c,d);!(u>=0)&&(h+=u*u,OQ(c,d.obstacle)<DQ)&&(h+=0.01/(kn(c,d.obstacle.center)+0.01))}return h})(e,t,i,o),0),y1r=(e,t,n,o)=>{let r=t[n];if(!r)return[];let i=r.route.map(()=>({x:0,y:0})),s=cv(t,e).filter((a)=>a.routeIndex===n);for(let a of s)if(a.movable)for(let c of Ern(e,t,a,o)){let l=a.radius+e.minViaEdgeToPadEdgeClearance+0.006,h=Xbe(a,c.obstacle,l);if(h)for(let d of a.pointIndexes)i[d].x+=h.direction.x*h.penetration,i[d].y+=h.direction.y*h.penetration}return i},x1r=(e,t,n,o)=>{let r=new Set(cv([t],e).flatMap((i)=>i.movable?i.pointIndexes:[]));return{...t,route:t.route.map((i,s)=>{if(!r.has(s))return{...i};let a=((c,l)=>{let h=kn({x:0,y:0},c);if(h<=l||h<DQ)return c;let d=l/h;return{x:c.x*d,y:c.y*d}})(n[s]??{x:0,y:0},0.5);return{...i,x:i.x+a.x*o,y:i.y+a.y*o}}),vias:t.vias.map((i)=>({...i})),jumpers:t.jumpers?[...t.jumpers]:void 0}},C1r=(e,t)=>t.route.every((n)=>n.x>=e.bounds.minX-DQ&&n.x<=e.bounds.maxX+DQ&&n.y>=e.bounds.minY-DQ&&n.y<=e.bounds.maxY+DQ),b1r=(e,t,n,o,r)=>{let i=n,s=mzt(e,t,o,r);for(let a=0;a<160&&!(s<=DQ);a+=1){let c=y1r(e,t,o,r);if(c.every((d)=>kn(d,{x:0,y:0})<0.000000001))break;let l=null,h=s;for(let d of _1r){let u=x1r(e,i,c,d),_=[...t];_[o]=u;let p=mzt(e,_,o,r);if(p<s-0.000001&&C1r(e,u)){l=u,h=p;break}}if(!l)break;t[o]=l,i=l,s=h}return i},Mrn=[0.2,0.4,0.8,1.2].flatMap((e)=>[0.2,0.3,0.45,0.6].flatMap((t)=>[-1,1].map((n)=>({halfSpan:e,offset:t,directionSign:n})))).flatMap((e)=>[0,1].map((t)=>({kind:"segment",routeSide:t,...e}))),AXe=[1,-1].flatMap((e)=>[1,-1].flatMap((t)=>[!1,!0].flatMap((n)=>[0,1].map((o)=>({routeSide:o,normalDirectionSign:e,tangentDirectionSign:t,reverseEndpointOffsets:n}))))),zKe=[0,1].map((e)=>({kind:"displacementChain",routeSide:e})),I1r=[...zKe,...[-1,1].flatMap((e)=>[0,1].map((t)=>({kind:"segment",routeSide:t,halfSpan:0.4,offset:1.2,directionSign:e}))),...[-1,1].flatMap((e)=>[0,1].map((t)=>({kind:"span",routeSide:t,spanExpansion:3,offset:1.8,directionSign:e}))),...[{dx:-2.4,dy:-0.4},{dx:-2.4,dy:0.4},{dx:2.4,dy:-0.4},{dx:2.4,dy:0.4},{dx:-0.4,dy:-2.4},{dx:-0.4,dy:2.4},{dx:0.4,dy:-2.4},{dx:0.4,dy:2.4}].flatMap((e)=>[0,1].map((t)=>({kind:"waypoint",routeSide:t,spanExpansion:2,...e}))),...[{dx:-0.17,dy:0},{dx:0.17,dy:0},{dx:0,dy:-0.17},{dx:0,dy:0.17}].flatMap((e)=>[0,1].map((t)=>({kind:"waypoint",routeSide:t,spanExpansion:0,...e}))),...Mrn],fXe=[0,1,2],NS=class extends Da{srj;inputHdRoutes;guardedInputHdRoutes;connMap;effort;drcEvaluator;referenceDrcEvaluator;autoroutingDrcEngine;viaHoleDiameter;configuredMaxIterations;enableBroadFallback;enableLargeBoardBroadFallback;enableTargetedErrorSweep;enablePostSolveClearanceRelaxation;enableSafeTraceLayerMoves;enableViaInPadLayerMoves;enableTraceViaOwnerTargeting;outputHdRoutes;initialDrcIssueCount;initialRepairDrcIssueCount;initialLowCountErrorsHaveMovableTraces=!1;broadForceAccepted=!1;targetedForceAccepted=!1;candidateAttempts=0;viaInPadCandidateAttempts=0;viaInPadCandidatesAccepted=0;padTopologyErrorCursor=0;safeTraceLayerCursorByErrorId=new Map;traceLayerCorridorCursorByErrorId=new Map;tracePairDetourCursorByErrorId=new Map;errorCursor=0;stalledIterations=0;bestDrcIssueCountSeen;bestDrcIssueScoreSeen;lastDrcCountImprovementCheckIteration=0;drcCountPlateauChecks=0;largeBoardBroadFallbackMisses=0;outputSnapshot;legacyCleanCheckpoint;viaPadRepairRolledBack=!1;referenceInputDrcIssueCount;referenceCandidateDrcIssueCount;referenceCandidateRolledBack=!1;referenceInputSnapshot;inputSnapshot;constructor(e){if(super(),this.srj=e.srj,this.inputHdRoutes=e.hdRoutes,this.guardedInputHdRoutes=q9(jb(e.hdRoutes)),this.connMap=e.connMap,this.effort=e.effort??1,this.drcEvaluator=e.drcEvaluator,this.referenceDrcEvaluator=e.referenceDrcEvaluator,this.autoroutingDrcEngine=e.autoroutingDrcEngine??(e.drcEvaluator?void 0:new Hle(e.srj,{connMap:e.connMap,traceClearance:e.srj.minTraceToPadEdgeClearance??ox.traceClearance,viaClearance:e.srj.minTraceToPadEdgeClearance??ox.viaClearance,includeTraceViaOwnerMetadata:e.enableTraceViaOwnerTargeting??!1})),e.viaHoleDiameter!==void 0&&(!Number.isFinite(e.viaHoleDiameter)||e.viaHoleDiameter<=0))throw Error("viaHoleDiameter must be a positive finite number");this.viaHoleDiameter=e.viaHoleDiameter,this.configuredMaxIterations=e.maxIterations,this.enableBroadFallback=e.enableBroadFallback??!0,this.enableLargeBoardBroadFallback=e.enableLargeBoardBroadFallback??!0,this.enableTargetedErrorSweep=e.enableTargetedErrorSweep??!1,this.enablePostSolveClearanceRelaxation=e.enablePostSolveClearanceRelaxation??!0,this.enableSafeTraceLayerMoves=e.enableSafeTraceLayerMoves??!1,this.enableViaInPadLayerMoves=e.enableViaInPadLayerMoves??!1,this.enableTraceViaOwnerTargeting=e.enableTraceViaOwnerTargeting??!1,this.outputHdRoutes=e.hdRoutes,this.referenceDrcEvaluator&&(this.referenceInputSnapshot=this.getReferenceDrcSnapshot(this.inputHdRoutes)),this.MAX_ITERATIONS=this.configuredMaxIterations??QFt(this.effort)}getConstructorParams(){return[{srj:this.srj,hdRoutes:this.inputHdRoutes,connMap:this.connMap,effort:this.effort,drcEvaluator:this.drcEvaluator,referenceDrcEvaluator:this.referenceDrcEvaluator,autoroutingDrcEngine:this.autoroutingDrcEngine,viaHoleDiameter:this.viaHoleDiameter,maxIterations:this.configuredMaxIterations,enableBroadFallback:this.enableBroadFallback,enableLargeBoardBroadFallback:this.enableLargeBoardBroadFallback,enableTargetedErrorSweep:this.enableTargetedErrorSweep,enablePostSolveClearanceRelaxation:this.enablePostSolveClearanceRelaxation,enableSafeTraceLayerMoves:this.enableSafeTraceLayerMoves,enableViaInPadLayerMoves:this.enableViaInPadLayerMoves,enableTraceViaOwnerTargeting:this.enableTraceViaOwnerTargeting}]}updateStats(e){this.stats={initialDrcIssueCount:this.initialDrcIssueCount??e.count,finalDrcIssueCount:e.count,globalDrcForceImproveMaxIterations:this.MAX_ITERATIONS,globalDrcForceImproveBroadForceAccepted:this.broadForceAccepted,globalDrcForceImproveTargetedForceAccepted:this.targetedForceAccepted,globalDrcForceImproveCandidateAttempts:this.candidateAttempts,globalDrcForceImproveViaInPadCandidateAttempts:this.viaInPadCandidateAttempts,globalDrcForceImproveViaInPadCandidatesAccepted:this.viaInPadCandidatesAccepted,globalDrcForceImproveStalledIterations:this.stalledIterations,globalDrcForceImproveBestDrcIssueCountSeen:this.bestDrcIssueCountSeen??e.count,globalDrcForceImproveBestDrcIssueScoreSeen:this.bestDrcIssueScoreSeen??e.issueScore,globalDrcForceImproveDrcCountPlateauChecks:this.drcCountPlateauChecks,globalDrcForceImproveLargeBoardBroadFallbackMisses:this.largeBoardBroadFallbackMisses,globalDrcForceImproveViaPadRepairRolledBack:this.viaPadRepairRolledBack,globalDrcForceImproveReferenceInputDrcIssueCount:this.referenceInputDrcIssueCount,globalDrcForceImproveReferenceCandidateDrcIssueCount:this.referenceCandidateDrcIssueCount,globalDrcForceImproveReferenceCandidateRolledBack:this.referenceCandidateRolledBack}}finishAtLegacyCleanCheckpoint(){let e=this.legacyCleanCheckpoint;return!!e&&(this.outputHdRoutes=e.routes,this.outputSnapshot=e.snapshot,this.viaPadRepairRolledBack=!0,this.updateStats(e.snapshot),this.solved=!0,!0)}increaseMaxIterationsForDrcIssueCount(e){this.configuredMaxIterations===void 0?this.MAX_ITERATIONS=Math.max(this.MAX_ITERATIONS,((t,n)=>Math.max(QFt(n),Math.ceil(t*kfr*Math.max(1,n))))(e,this.effort),((t,n)=>t>120&&n>0?192:48)(this.inputHdRoutes.length,e)):this.MAX_ITERATIONS=this.configuredMaxIterations}getSnapshot(e){return(this.initialLowCountErrorsHaveMovableTraces?V2r:PS)(this.srj,e,this.drcEvaluator,this.connMap,this.autoroutingDrcEngine)}getReferenceDrcSnapshot(e){let t={traces:[],srj:this.srj,routes:e,hdRoutes:e},n=this.referenceDrcEvaluator?.getCachedResult?.(t);if(n){let o=Array.isArray(n)?n:n.errors;return{errors:o,count:o.length}}return PS(this.srj,e,this.referenceDrcEvaluator,this.connMap,this.autoroutingDrcEngine)}getViaIssueCount(e){return HKe(e)}getRepairIssueCount(e){return G3e(e)}getRepairIssueScore(e){return Arn(e)}acceptSolvedRoutes(e,t){let n=this.enablePostSolveClearanceRelaxation?((l,h,d)=>{if(l.minTraceToPadEdgeClearance===void 0||l.minTraceToPadEdgeClearance<=0)return h;let u=!1,_=jb(h);for(let p=0;p<4;p+=1)for(let m=0;m<_.length;m+=1){let A=_[m];if(!A)continue;let g=m1r(l,_,A,m,d);g!==A&&(_[m]=g,u=!0)}return u?_:h})(this.srj,e,this.connMap):e,o=this.enablePostSolveClearanceRelaxation?((l,h,d)=>{if(l.minViaEdgeToPadEdgeClearance===void 0||l.minViaEdgeToPadEdgeClearance<=0)return h;let u=!1,_=jb(h);for(let p=0;p<4;p+=1)for(let m=0;m<_.length;m+=1){let A=_[m];if(!A)continue;let g=b1r(l,_,A,m,d);g!==A&&(_[m]=g,u=!0)}return u?q9(_):h})(this.srj,n,this.connMap):e,r=o===e?t:this.getSnapshot(o),i=r.count<t.count||r.count===t.count&&r.issueScore<=t.issueScore,s=i?o:e,a=i?r:t,c=this.inputSnapshot??this.getSnapshot(this.guardedInputHdRoutes);if(this.referenceDrcEvaluator){let l=this.referenceInputSnapshot,h=this.getReferenceDrcSnapshot(s);this.referenceInputDrcIssueCount=l.count,this.referenceCandidateDrcIssueCount=h.count,h.count>l.count&&(s=this.guardedInputHdRoutes,a=c,this.referenceCandidateRolledBack=!0)}this.outputHdRoutes=s,this.outputSnapshot=a,this.stalledIterations=0,this.updateStats(a),this.solved=!0}updateDrcCountPlateauState(e){let t=this.getRepairIssueCount(e),n=this.getRepairIssueScore(e);this.bestDrcIssueCountSeen??=t,this.bestDrcIssueScoreSeen??=n;let o=this.initialRepairDrcIssueCount??t,r=this.inputHdRoutes.length>120&&o>0;if((o>=20||r)&&this.iterations<192)return(t<this.bestDrcIssueCountSeen||t===this.bestDrcIssueCountSeen&&n<this.bestDrcIssueScoreSeen)&&(this.bestDrcIssueCountSeen=t,this.bestDrcIssueScoreSeen=n),void(r&&this.largeBoardBroadFallbackMisses>=2&&(this.solved=!0));let i=((s)=>s>=20?8:s<=2?1:2)(o);if(!(this.iterations-this.lastDrcCountImprovementCheckIteration<i)){if(this.lastDrcCountImprovementCheckIteration=this.iterations,t<this.bestDrcIssueCountSeen||t===this.bestDrcIssueCountSeen&&n<this.bestDrcIssueScoreSeen)return this.bestDrcIssueCountSeen=t,this.bestDrcIssueScoreSeen=n,void(this.drcCountPlateauChecks=0);this.drcCountPlateauChecks+=1,this.drcCountPlateauChecks>=2&&(this.solved=!0)}}_step(){let e=this.outputHdRoutes,t=this.outputSnapshot??this.getSnapshot(e),n=x5(t);if(this.legacyCleanCheckpoint&&n>0)return void this.finishAtLegacyCleanCheckpoint();if(!this.legacyCleanCheckpoint&&n===0&&t.errors.some(S5)&&(this.legacyCleanCheckpoint={routes:q9(jb(e)),snapshot:t}),this.initialDrcIssueCount===void 0){this.inputSnapshot=t,this.initialDrcIssueCount=t.count,this.initialRepairDrcIssueCount=this.getRepairIssueCount(t);let D=lzt(t.errors);this.initialLowCountErrorsHaveMovableTraces=this.initialRepairDrcIssueCount>0&&this.initialRepairDrcIssueCount<=3&&D.every((L)=>WV(L,t.traceRouteIndexById)!==void 0),this.initialLowCountErrorsHaveMovableTraces&&(t=this.getSnapshot(e)),this.bestDrcIssueCountSeen=this.getRepairIssueCount(t),this.bestDrcIssueScoreSeen=this.getRepairIssueScore(t),this.increaseMaxIterationsForDrcIssueCount(this.getRepairIssueCount(t))}if(t.count===0)return void this.acceptSolvedRoutes(e,t);let o=this.getRepairIssueCount(t),r=this.getRepairIssueScore(t),i=this.getViaIssueCount(t),s=t.errors.filter((D)=>Boolean(Ole(D)));if(s.length===0)return void this.acceptSolvedRoutes(e,t);let a=(c=this.effort,Math.max(1,Math.round(3*Math.max(1,c))));var c;let l=0,h=0,d=!1,u=!1,_=!1,p=lzt(s),m=this.enableTargetedErrorSweep?p.find((D)=>D.type==="pcb_via_clearance_error"&&D.pcb_via_pair_net_relation==="same_net"):void 0,A=this.enableTargetedErrorSweep&&(this.iterations-1)%8==0,g=m??(A?p.find((D)=>D.type==="pcb_via_clearance_error"):void 0),f=g?[g,...p.filter((D)=>D!==g)]:p,y=Math.min(f.length,Math.max(1,Math.ceil(this.effort))),x=g?0:this.errorCursor%f.length,C=this.enableTargetedErrorSweep?((D,L)=>{let H=Math.max(2,Math.round(12*Math.max(1,L)));return D.filter((V)=>Zy(V)==="pcb_trace_error").slice(0,H)})(s,this.effort):[],b=o<=1||this.initialLowCountErrorsHaveMovableTraces,I=!this.initialLowCountErrorsHaveMovableTraces&&o<=8&&this.srj.layerCount>1,v=g?[]:s.filter((D)=>D.type==="pcb_pad_trace_clearance_error"||(this.enableSafeTraceLayerMoves||b||I)&&D.type==="pcb_trace_error"),P=v.map((D,L)=>v[(this.padTopologyErrorCursor+L)%v.length]);for(let D of this.enableSafeTraceLayerMoves||this.enableViaInPadLayerMoves?P:[]){let L=!this.enableSafeTraceLayerMoves||h>=a,H=!this.enableViaInPadLayerMoves||l>=a;if(u||L&&H)break;let V;this.padTopologyErrorCursor=(v.indexOf(D)+1)%v.length;let O=typeof D.pcb_trace_error_id=="string"?D.pcb_trace_error_id:typeof D.pcb_trace_id=="string"?D.pcb_trace_id:void 0,U=WV(D,t.traceRouteIndexById),j=Vle(D,t.traceRouteIndexById);if(this.enableTraceViaOwnerTargeting&&U!==void 0&&Array.isArray(D.pcb_via_ids)&&D.pcb_via_ids.length===1&&l<a){let X=jb(e);if(dzt(this.srj,X,D,t.traceRouteIndexById,U,this.connMap)){let K=q9(X),J=this.getSnapshot(K),ee=this.getViaIssueCount(J);l+=1,this.candidateAttempts+=1,ee<=i&&AV(J,t)&&(V={routes:K,snapshot:J,viaIssueCount:ee,usesViaInPad:!1})}}if(this.enableSafeTraceLayerMoves&&U!==void 0){let X=j??[U],K=X.length*this.srj.layerCount*fXe.length,J=X.length*this.srj.layerCount*yrn,ee=K+J,se=dZe(D),ne=se?0:K,re=se?J:0,Z=O?this.safeTraceLayerCursorByErrorId.get(O)??0:0,te=0;for(;h<a&&te<ee;){let ie=Z;Z=(Z+1)%ee,te+=1;let le=ie>=ne&&ie<ne+J,ue=ie-(le?ne:re),de=ue%X.length,me=Math.floor(ue/X.length),Ae=me%this.srj.layerCount,xe=le?"full":fXe[Math.floor(me/this.srj.layerCount)%fXe.length],Me=le?Math.floor(me/this.srj.layerCount):0,Re=X[de],we=!1;for(let _e of[!1,!0]){let ye=KK(e,[Re]);if(!J2r(this.srj,ye,D,Re,Ae,xe,this.connMap,Me,_e))continue;let Se=$K(ye,[Re]);we=!0,this.candidateAttempts+=1;let Ne=this.getSnapshot(Se),ke=this.getViaIssueCount(Ne),nt=V?.snapshot??t;ke<=(V?.viaIssueCount??i)&&(AV(Ne,nt)||V!==void 0&&G3e(Ne)===G3e(nt)&&Ne.count<nt.count)&&(V={routes:Se,snapshot:Ne,viaIssueCount:ke,usesViaInPad:!1})}we&&(h+=1)}O&&this.safeTraceLayerCursorByErrorId.set(O,Z)}if(this.enableSafeTraceLayerMoves&&I&&O&&j){let X=this.traceLayerCorridorCursorByErrorId.get(O)??0,K=0;for(;l<a&&K<AXe.length;){let J=AXe[X%AXe.length];X+=1,K+=1;let ee=j[J.routeSide],se=e[ee]?.route[0]?.z;if(se===void 0)continue;let ne=(se+1)%this.srj.layerCount,re=KK(e,[ee]);if(!i1r(this.srj,re,D,ee,ne,J.normalDirectionSign,J.tangentDirectionSign,J.reverseEndpointOffsets))continue;let Z=$K(re,[ee]);l+=1,this.candidateAttempts+=1;let te=this.getSnapshot(Z),ie=this.getViaIssueCount(te),le=V?.snapshot??t;ie<=(V?.viaIssueCount??i)&&AV(te,le)&&(V={routes:Z,snapshot:te,viaIssueCount:ie,usesViaInPad:!1})}this.traceLayerCorridorCursorByErrorId.set(O,X)}if(this.enableSafeTraceLayerMoves&&O&&(this.initialLowCountErrorsHaveMovableTraces&&(j||U!==void 0)||!this.initialLowCountErrorsHaveMovableTraces&&j)){let X=this.initialLowCountErrorsHaveMovableTraces?I1r:b?[...zKe,...Mrn]:zKe,K=j??[U],J=this.tracePairDetourCursorByErrorId.get(O)??0,ee=0;for(;l<a&&ee<X.length;){let se=X[J%X.length];J+=1,ee+=1;let ne=K[se.routeSide];if(ne===void 0)continue;let re=this.initialLowCountErrorsHaveMovableTraces&&D.worst_contact_center?{...D,center:D.worst_contact_center,message:D.worst_contact_message??D.message,actual_clearance:D.worst_actual_clearance??D.actual_clearance}:D;if(se.kind==="displacementChain"){let Ae=jb(e),xe=t1r(this.srj,Ae,re,t.traceRouteIndexById,se.routeSide);if(!xe)continue;d=!0,l+=1,this.candidateAttempts+=1;let Me=q9(Ae),Re=this.getSnapshot(Me),we=this.getViaIssueCount(Re),_e=this.getRepairIssueCount(Re);if(_e>0&&l<a){let ke=jb(Me),nt=!1;for(let dt of Re.errors)nt=dzt(this.srj,ke,dt,Re.traceRouteIndexById,xe.movedRouteIndex,this.connMap)||nt;if(nt){l+=1,this.candidateAttempts+=1;let dt=q9(ke),rt=this.getSnapshot(dt),mt=this.getViaIssueCount(rt);vS(rt,mt,_e,this.getRepairIssueScore(Re),we,Re)&&(Me=dt,Re=rt,we=mt,_e=this.getRepairIssueCount(Re))}}let ye=V?this.getRepairIssueCount(V.snapshot):o,Se=V?this.getRepairIssueScore(V.snapshot):r,Ne=V?.viaIssueCount??i;if(we<=Ne&&vS(Re,we,ye,Se,Ne,V?.snapshot??t)&&(V={routes:Me,snapshot:Re,viaIssueCount:we,usesViaInPad:!1}),_e===0)break;continue}let Z=KK(e,[ne]);if(!(se.kind==="segment"?r1r(Z,re,ne,se.halfSpan,se.offset,se.directionSign):se.kind==="span"?s1r(this.srj,Z,re,ne,se.spanExpansion,se.offset,se.directionSign):a1r(this.srj,Z,re,ne,se.spanExpansion,{x:re.center.x+se.dx,y:re.center.y+se.dy})))continue;let te=$K(Z,[ne]);d=!0,l+=1,this.candidateAttempts+=1;let ie=this.getSnapshot(te),le=this.getViaIssueCount(ie),ue=V?this.getRepairIssueCount(V.snapshot):o,de=V?this.getRepairIssueScore(V.snapshot):r,me=V?.viaIssueCount??i;(this.initialLowCountErrorsHaveMovableTraces?vS(ie,le,ue,de,me,V?.snapshot??t):le<=me&&AV(ie,V?.snapshot??t))&&(V={routes:te,snapshot:ie,viaIssueCount:le,usesViaInPad:!1})}this.tracePairDetourCursorByErrorId.set(O,J)}for(let X of this.enableViaInPadLayerMoves?["start","end"]:[]){if(l>=a)break;if(U===void 0)break;let K=KK(e,[U]);if(!e1r(this.srj,K,D,t.traceRouteIndexById,X,this.connMap,this.viaHoleDiameter))continue;let J=$K(K,[U]);this.viaInPadCandidateAttempts+=1,l+=1,this.candidateAttempts+=1;let ee=this.getSnapshot(J),se=this.getViaIssueCount(ee),ne=V?this.getRepairIssueCount(V.snapshot):o,re=V?this.getRepairIssueScore(V.snapshot):r;vS(ee,se,ne,re,V?.viaIssueCount??i,V?.snapshot??t)&&(V={routes:J,snapshot:ee,viaIssueCount:se,usesViaInPad:!0})}let Y=this.enableViaInPadLayerMoves?this.srj.layerCount:0;for(let X=0;X<Y&&!(l>=a)&&U!==void 0;X+=1){let K=KK(e,[U]);if(!Z2r(this.srj,K,D,t.traceRouteIndexById,X,this.connMap,this.viaHoleDiameter))continue;let J=$K(K,[U]);this.viaInPadCandidateAttempts+=1,l+=1,this.candidateAttempts+=1;let ee=this.getSnapshot(J),se=this.getViaIssueCount(ee),ne=V?this.getRepairIssueCount(V.snapshot):o,re=V?this.getRepairIssueScore(V.snapshot):r;vS(ee,se,ne,re,V?.viaIssueCount??i,V?.snapshot??t)&&(V={routes:J,snapshot:ee,viaIssueCount:se,usesViaInPad:!0})}if(this.enableViaInPadLayerMoves&&b&&j){let X=this.iterations%2==0?[0,1]:[1,0],K=this.iterations%3;for(let J of X)for(let ee=0;ee<this.srj.layerCount&&!(l>=a);ee+=1){let se=j[J],ne=KK(e,[se]);if(!o1r(this.srj,ne,D,t.traceRouteIndexById,J,ee,K,this.connMap,this.viaHoleDiameter))continue;let re=$K(ne,[se]);this.viaInPadCandidateAttempts+=1,l+=1,this.candidateAttempts+=1;let Z=this.getSnapshot(re),te=this.getViaIssueCount(Z),ie=V?this.getRepairIssueCount(V.snapshot):o,le=V?this.getRepairIssueScore(V.snapshot):r;vS(Z,te,ie,le,V?.viaIssueCount??i,V?.snapshot??t)&&(V={routes:re,snapshot:Z,viaIssueCount:te,usesViaInPad:!0})}}V&&(e=V.routes,t=V.snapshot,o=this.getRepairIssueCount(t),r=this.getRepairIssueScore(t),i=V.viaIssueCount,this.targetedForceAccepted=!0,V.usesViaInPad&&(this.viaInPadCandidatesAccepted+=1),u=!0)}if(!u&&C.length>=2){let D=jb(e),L=!1;for(let H of C)L=FKe(this.srj,D,[H],t.traceRouteIndexById,1,this.connMap,!0,this.enableTargetedErrorSweep,!1,this.enableTraceViaOwnerTargeting)||L;if(L){let H=q9(D);l+=1,this.candidateAttempts+=1;let V=this.getSnapshot(H),O=this.getViaIssueCount(V);if(vS(V,O,o,r,i,t)&&(e=H,t=V,o=this.getRepairIssueCount(V),r=this.getRepairIssueScore(V),i=O,this.targetedForceAccepted=!0,u=!0,V.count===0))return void this.acceptSolvedRoutes(e,t)}}for(let D=0;D<y&&l<a&&!u;D+=1){let L=(x+D)%f.length,H=f[L];if(!H)continue;this.errorCursor=(L+1)%f.length;let V=o===1;for(let O of Lfr(this.effort)){if(l>=a)break;let U=jb(e);if(!FKe(this.srj,U,[H],t.traceRouteIndexById,O,this.connMap,!0,this.enableTargetedErrorSweep,V,this.enableTraceViaOwnerTargeting))continue;let j=q9(U);l+=1,this.candidateAttempts+=1;let Y=this.getSnapshot(j),X=this.getViaIssueCount(Y);if(vS(Y,X,o,r,i,t)){if(e=j,t=Y,o=this.getRepairIssueCount(Y),r=this.getRepairIssueScore(Y),i=X,this.targetedForceAccepted=!0,u=!0,Y.count===0)return void this.acceptSolvedRoutes(e,t);break}}if(u)break}let M=e.length<=120,B=(T=s.length,Math.max(16,Math.min(64,2*T)));var T;let N=this.enableLargeBoardBroadFallback&&this.MAX_ITERATIONS>=192&&!M&&this.stalledIterations>0&&this.stalledIterations%B===0;if(this.enableBroadFallback&&!u&&(M||this.effort>=2&&this.stalledIterations>=2||N)){_=N;for(let D of[1,2]){let L=fZe(this.srj,e,this.effort,D,this.connMap,this.drcEvaluator===void 0,!1);if(L===e)continue;let H=this.getSnapshot(L),V=this.getViaIssueCount(H);if(vS(H,V,o,r,i,t)&&(e=L,t=H,o=this.getRepairIssueCount(H),r=this.getRepairIssueScore(H),i=V,this.broadForceAccepted=!0,u=!0,H.count===0))return void this.acceptSolvedRoutes(e,t)}}u?this.largeBoardBroadFallbackMisses=0:_&&(this.largeBoardBroadFallbackMisses+=1),this.outputHdRoutes=e,this.outputSnapshot=t,this.stalledIterations=u?0:this.stalledIterations+1,d||this.updateDrcCountPlateauState(t),this.updateStats(t),(this.solved||o===0)&&this.acceptSolvedRoutes(e,t)}tryFinalAcceptance(){let e=this.outputSnapshot??this.getSnapshot(this.outputHdRoutes);this.legacyCleanCheckpoint&&x5(e)>0&&this.finishAtLegacyCleanCheckpoint()||this.acceptSolvedRoutes(this.outputHdRoutes,e)}getOutput(){return this.outputHdRoutes}visualize(){return super.visualize()}preview(){return this.visualize()}},wrn=class extends Da{params;inputHdRoutes;guardedInputHdRoutes;broadMaxIterations;broadPassMultiplier;autoroutingDrcEngine;legacyDrcEvaluator;outputHdRoutes;phase="start";inputSnapshot;baselineSolver;baselineSnapshot;broadInputSnapshot;broadSnapshot;broadSolver;preBroadCandidate;safeTraceLayerInputRoutes;safeTraceLayerInputSnapshot;safeTraceLayerSolver;safeTraceLayerPhaseAccepted=!1;mixedSafeTraceLayerSolver;mixedSafeTraceLayerPhaseAccepted=!1;legacySafeTraceLayerRoutes;legacySafeTraceLayerSnapshot;legacySafeTraceLayerSelectedSolver;viaInPadSolver;portfolioSelectedSolver;selectedSolver;referenceInputDrcIssueCount;referenceCandidateDrcIssueCount;referenceCandidateRolledBack=!1;mixedReferenceInputDrcIssueCount;mixedReferenceCandidateDrcIssueCount;referenceInputSnapshot;constructor(e){if(super(),!Number.isFinite(e.broadPassMultiplier))throw Error("broadPassMultiplier must be a finite number");if(e.broadPassMultiplier<=0)throw Error("broadPassMultiplier must be greater than zero");if(!Number.isInteger(e.broadMaxIterations))throw Error("broadMaxIterations must be an integer");if(e.broadMaxIterations<=0)throw Error("broadMaxIterations must be greater than zero");if(e.viaInPadMaxIterations!==void 0&&!Number.isInteger(e.viaInPadMaxIterations))throw Error("viaInPadMaxIterations must be an integer");if(e.viaInPadMaxIterations!==void 0&&e.viaInPadMaxIterations<=0)throw Error("viaInPadMaxIterations must be greater than zero");this.autoroutingDrcEngine=e.autoroutingDrcEngine??(e.drcEvaluator?void 0:new Hle(e.srj,{connMap:e.connMap,traceClearance:e.srj.minTraceToPadEdgeClearance??ox.traceClearance,viaClearance:e.srj.minTraceToPadEdgeClearance??ox.viaClearance,includeTraceViaOwnerMetadata:e.enableTraceViaOwnerTargeting??!1})),this.legacyDrcEvaluator=(t)=>{let n=e.drcEvaluator?.evaluateLegacy??e.drcEvaluator,o=n?n(t):this.autoroutingDrcEngine.evaluateLegacy(t.traces),r=Array.isArray(o)?o:o.errors,i=Array.isArray(o)?o:o.errorsWithCenters??o.errors;return{errors:r.filter((s)=>!S5(s)),errorsWithCenters:i.filter((s)=>!S5(s))}},Object.defineProperty(this.legacyDrcEvaluator,"inputMode",{get:()=>(e.drcEvaluator?.evaluateLegacy??e.drcEvaluator)?.inputMode}),this.params={...e,autoroutingDrcEngine:this.autoroutingDrcEngine},this.inputHdRoutes=e.hdRoutes,this.guardedInputHdRoutes=q9(jb(e.hdRoutes)),this.broadMaxIterations=e.broadMaxIterations,this.broadPassMultiplier=e.broadPassMultiplier,this.outputHdRoutes=e.hdRoutes,this.params.referenceDrcEvaluator&&(this.referenceInputSnapshot=this.getReferenceDrcSnapshot(this.inputHdRoutes))}getConstructorParams(){return[{...this.params,hdRoutes:this.inputHdRoutes}]}stepBranch(e,t){if(this.activeSubSolver=e,e.step(),e.failed)throw Error(`${t} DRC repair branch failed: ${e.error}`)}getReferenceDrcSnapshot(e){let t={traces:[],srj:this.params.srj,routes:e,hdRoutes:e},n=this.params.referenceDrcEvaluator?.getCachedResult?.(t);if(n){let o=Array.isArray(n)?n:n.errors;return{errors:o,count:o.length}}return PS(this.params.srj,e,this.params.referenceDrcEvaluator,this.params.connMap,this.autoroutingDrcEngine)}finishWithOutput(e,t,n){let o=e,r=t;if(this.params.referenceDrcEvaluator){let i=this.referenceInputSnapshot,s=this.getReferenceDrcSnapshot(o);this.referenceInputDrcIssueCount=i.count,this.referenceCandidateDrcIssueCount=s.count,(s.count>i.count||s.count===i.count&&((a,c)=>{let l=new Set(c.map(czt));return a.some((h)=>!l.has(czt(h)))})(s.errors,i.errors))&&(o=this.guardedInputHdRoutes,r=this.inputSnapshot,this.referenceCandidateRolledBack=!0)}this.outputHdRoutes=o,this.selectedSolver=n,this.activeSubSolver=null,this.phase="done",this.progress=1,this.stats={...this.portfolioSelectedSolver?.stats??{},...n?.stats??{},finalDrcIssueCount:r.count,drcBranchPortfolioInitialDrcIssueCount:this.inputSnapshot?.count??t.count,drcBranchPortfolioBaselineDrcIssueCount:this.baselineSnapshot?.count??t.count,drcBranchPortfolioBroadInitialDrcIssueCount:this.broadInputSnapshot?.count,drcBranchPortfolioBroadFinalDrcIssueCount:this.broadSnapshot?.count,drcBranchPortfolioBroadMaxIterations:this.broadMaxIterations,drcBranchPortfolioBroadBranchAttempted:Boolean(this.broadSolver),drcBranchPortfolioBroadBranchAccepted:this.portfolioSelectedSolver!==void 0&&this.portfolioSelectedSolver===this.broadSolver,drcBranchPortfolioSafeTraceLayerPhaseAttempted:Boolean(this.safeTraceLayerSolver),drcBranchPortfolioSafeTraceLayerPhaseAccepted:this.safeTraceLayerPhaseAccepted,drcBranchPortfolioMixedSafeTraceLayerPhaseAttempted:Boolean(this.mixedSafeTraceLayerSolver),drcBranchPortfolioMixedSafeTraceLayerPhaseAccepted:this.mixedSafeTraceLayerPhaseAccepted,drcBranchPortfolioViaInPadPhaseAttempted:Boolean(this.viaInPadSolver),drcBranchPortfolioViaInPadMaxIterations:this.params.viaInPadMaxIterations,drcBranchPortfolioFinalNonViaPadDrcIssueCount:x5(r),drcBranchPortfolioReferenceInputDrcIssueCount:this.referenceInputDrcIssueCount,drcBranchPortfolioReferenceCandidateDrcIssueCount:this.referenceCandidateDrcIssueCount,drcBranchPortfolioReferenceCandidateRolledBack:this.referenceCandidateRolledBack,drcBranchPortfolioMixedReferenceInputDrcIssueCount:this.mixedReferenceInputDrcIssueCount,drcBranchPortfolioMixedReferenceCandidateDrcIssueCount:this.mixedReferenceCandidateDrcIssueCount},this.solved=!0}startBaselineBranch(){this.baselineSolver=new NS({...this.params,hdRoutes:this.inputHdRoutes,drcEvaluator:this.legacyDrcEvaluator,referenceDrcEvaluator:void 0,enableSafeTraceLayerMoves:!1,enableViaInPadLayerMoves:!1}),this.activeSubSolver=this.baselineSolver,this.phase="baseline"}startSafeTraceLayerPhase(e,t,n){this.portfolioSelectedSolver=n,this.params.enableSafeTraceLayerMoves?(this.safeTraceLayerInputRoutes=e,this.safeTraceLayerInputSnapshot=t,this.safeTraceLayerSolver=new NS({...this.params,hdRoutes:e,drcEvaluator:this.legacyDrcEvaluator,referenceDrcEvaluator:void 0,maxIterations:this.params.viaInPadMaxIterations??this.params.maxIterations,enableLargeBoardBroadFallback:!1,enableTargetedErrorSweep:!1,enablePostSolveClearanceRelaxation:!1,enableSafeTraceLayerMoves:!0,enableViaInPadLayerMoves:!1}),this.activeSubSolver=this.safeTraceLayerSolver,this.phase="safeTraceLayer"):this.startViaInPadPhase(e,t,n)}startViaInPadPhase(e,t,n){this.portfolioSelectedSolver=n;let o=this.params.enableViaInPadLayerMoves&&this.params.viaInPadDrcEvaluator!==void 0;t.errors.some(S5)||o?(this.viaInPadSolver=new NS({...this.params,hdRoutes:e,drcEvaluator:this.params.viaInPadDrcEvaluator??this.params.drcEvaluator,maxIterations:this.params.viaInPadMaxIterations??this.params.maxIterations,enableLargeBoardBroadFallback:!1,enableTargetedErrorSweep:!1,enablePostSolveClearanceRelaxation:!1,enableSafeTraceLayerMoves:!1,enableViaInPadLayerMoves:this.params.enableViaInPadLayerMoves}),this.activeSubSolver=this.viaInPadSolver,this.phase="viaInPad"):this.finishWithOutput(e,t,n)}startMixedSafeTraceLayerPhase(e,t,n){this.legacySafeTraceLayerRoutes=e,this.legacySafeTraceLayerSnapshot=t,this.legacySafeTraceLayerSelectedSolver=n,this.mixedSafeTraceLayerSolver=new NS({...this.params,hdRoutes:this.safeTraceLayerInputRoutes,drcEvaluator:this.params.drcEvaluator,referenceDrcEvaluator:void 0,maxIterations:this.params.viaInPadMaxIterations??this.params.maxIterations,enableLargeBoardBroadFallback:!1,enableTargetedErrorSweep:!1,enablePostSolveClearanceRelaxation:!1,enableSafeTraceLayerMoves:!0,enableViaInPadLayerMoves:!1}),this.activeSubSolver=this.mixedSafeTraceLayerSolver,this.phase="mixedSafeTraceLayer"}startBroadBranch(){let e=fZe(this.params.srj,this.inputHdRoutes,this.params.effort??1,this.broadPassMultiplier,this.params.connMap);this.broadInputSnapshot=PS(this.params.srj,e,this.params.drcEvaluator,this.params.connMap,this.autoroutingDrcEngine),AV(this.broadInputSnapshot,this.baselineSnapshot)?(this.broadSolver=new NS({...this.params,hdRoutes:e,drcEvaluator:this.legacyDrcEvaluator,referenceDrcEvaluator:void 0,maxIterations:this.broadMaxIterations,enableSafeTraceLayerMoves:!1,enableViaInPadLayerMoves:!1}),this.activeSubSolver=this.broadSolver,this.phase="broad"):this.startSafeTraceLayerPhase(this.baselineSolver.getOutput(),this.baselineSnapshot,this.baselineSolver)}_step(){if(this.phase==="start")return this.inputSnapshot=PS(this.params.srj,this.inputHdRoutes,this.params.drcEvaluator,this.params.connMap,this.autoroutingDrcEngine),x5(this.inputSnapshot)===0?void this.startViaInPadPhase(this.inputHdRoutes,this.inputSnapshot):void this.startBaselineBranch();if(this.phase==="baseline"){if(this.stepBranch(this.baselineSolver,"baseline"),!this.baselineSolver.solved)return;let e=this.baselineSolver.getOutput();return this.baselineSnapshot=PS(this.params.srj,e,this.params.drcEvaluator,this.params.connMap,this.autoroutingDrcEngine),x5(this.baselineSnapshot)===0?void this.startViaInPadPhase(e,this.baselineSnapshot,this.baselineSolver):void(this.params.enableSafeTraceLayerMoves&&this.baselineSnapshot.count<=3?this.startSafeTraceLayerPhase(e,this.baselineSnapshot,this.baselineSolver):this.startBroadBranch())}if(this.phase==="broad"){if(this.stepBranch(this.broadSolver,"broad"),!this.broadSolver.solved)return;let e=this.broadSolver.getOutput();return this.broadSnapshot=PS(this.params.srj,e,this.params.drcEvaluator,this.params.connMap,this.autoroutingDrcEngine),AV(this.broadSnapshot,this.baselineSnapshot)?void this.startSafeTraceLayerPhase(e,this.broadSnapshot,this.broadSolver):void this.startSafeTraceLayerPhase(this.baselineSolver.getOutput(),this.baselineSnapshot,this.baselineSolver)}if(this.phase==="safeTraceLayer"){if(this.stepBranch(this.safeTraceLayerSolver,"safe trace-layer"),!this.safeTraceLayerSolver.solved)return;let e=this.safeTraceLayerSolver.getOutput(),t=PS(this.params.srj,e,this.params.drcEvaluator,this.params.connMap,this.autoroutingDrcEngine),n=HKe(this.safeTraceLayerInputSnapshot,!1),o=HKe(t,!1);this.safeTraceLayerPhaseAccepted=o<=n&&vS(t,o,this.safeTraceLayerInputSnapshot.count,this.safeTraceLayerInputSnapshot.issueScore,n,this.safeTraceLayerInputSnapshot);let r=this.safeTraceLayerPhaseAccepted?e:this.safeTraceLayerInputRoutes,i=this.safeTraceLayerPhaseAccepted?t:this.safeTraceLayerInputSnapshot,s=this.safeTraceLayerPhaseAccepted?this.safeTraceLayerSolver:this.portfolioSelectedSolver;return this.preBroadCandidate&&!AV(i,this.preBroadCandidate.snapshot)&&(r=this.preBroadCandidate.routes,i=this.preBroadCandidate.snapshot,s=this.preBroadCandidate.solver,this.safeTraceLayerPhaseAccepted=this.preBroadCandidate.safeTraceLayerPhaseAccepted),i.count>0&&!this.broadInputSnapshot?(this.preBroadCandidate={routes:r,snapshot:i,solver:s,safeTraceLayerPhaseAccepted:this.safeTraceLayerPhaseAccepted},void this.startBroadBranch()):x5(i)>0&&this.safeTraceLayerInputSnapshot.errors.some(S5)?void this.startMixedSafeTraceLayerPhase(r,i,s):void this.startViaInPadPhase(r,i,s)}if(this.phase==="mixedSafeTraceLayer"){if(this.stepBranch(this.mixedSafeTraceLayerSolver,"mixed safe trace-layer"),!this.mixedSafeTraceLayerSolver.solved)return;let e=this.mixedSafeTraceLayerSolver.getOutput(),t=PS(this.params.srj,e,this.params.drcEvaluator,this.params.connMap,this.autoroutingDrcEngine),n=x5(t)<=x5(this.legacySafeTraceLayerSnapshot),o=!0;if(this.params.referenceDrcEvaluator){let r=this.getReferenceDrcSnapshot(this.legacySafeTraceLayerRoutes),i=this.getReferenceDrcSnapshot(e);this.mixedReferenceInputDrcIssueCount=r.count,this.mixedReferenceCandidateDrcIssueCount=i.count,o=i.count<=r.count}return this.mixedSafeTraceLayerPhaseAccepted=n&&o,void this.startViaInPadPhase(this.mixedSafeTraceLayerPhaseAccepted?e:this.legacySafeTraceLayerRoutes,this.mixedSafeTraceLayerPhaseAccepted?t:this.legacySafeTraceLayerSnapshot,this.mixedSafeTraceLayerPhaseAccepted?this.mixedSafeTraceLayerSolver:this.legacySafeTraceLayerSelectedSolver)}if(this.phase==="viaInPad"){if(this.stepBranch(this.viaInPadSolver,"via-in-pad"),!this.viaInPadSolver.solved)return;let e=this.viaInPadSolver.getOutput(),t=PS(this.params.srj,e,this.params.viaInPadDrcEvaluator??this.params.drcEvaluator,this.params.connMap,this.autoroutingDrcEngine);this.finishWithOutput(e,t,this.viaInPadSolver)}}getOutput(){return this.outputHdRoutes}visualize(){return(this.activeSubSolver??this.selectedSolver)?.visualize()??super.visualize()}preview(){return(this.activeSubSolver??this.selectedSolver)?.preview()??this.visualize()}},Brn=(e)=>e.circuitJsonMetadata??{},Trn=({connections:e,obstacles:t})=>new Set([...e.flatMap((n)=>n.pointsToConnect.flatMap((o)=>o.pcb_port_id?[o.pcb_port_id]:[])),...t.flatMap((n)=>{let o=Brn(n).pcb_port_id;return o?[o]:[]})]),OKe=(e)=>e.__netConnectionName??e.__rootConnectionNames?.[0]??e.name,CZe=(e)=>Array.from(new Set([e.name,e.__netConnectionName,...e.__rootConnectionNames??[],...e.pointsToConnect.flatMap((t)=>[t.pointId,t.pcb_port_id])])).filter((t)=>Boolean(t)),Drn=(e,t)=>{let n=new Map,o=new Set,r=new Map;for(let i of e){let s=OKe(i);for(let h of CZe(i)){let d=n.get(h);d&&d!==s?(n.delete(h),o.add(h)):o.has(h)||n.set(h,s)}let a=t.getNetConnectedToId(i.name);if(!a)continue;let c=a,l=r.get(c)??new Set;l.add(s),r.set(c,l)}return{connMap:t,circuitJsonSourceTraceIdBySrjDeclaredConnectionReference:n,circuitJsonSourceTraceIdsByConnectivityNetId:r}},G$=(e,t)=>{let n=e.circuitJsonSourceTraceIdBySrjDeclaredConnectionReference.get(t);if(n)return n;let o=e.connMap.getNetConnectedToId(t);if(!o)return;let r=e.circuitJsonSourceTraceIdsByConnectivityNetId.get(o);return r?.size===1?r.values().next().value:void 0};function v1r(e,t,n=e,o){let r=[],i=n===e?e.connections:[...e.connections,...n.connections],s=n===e?e.obstacles:n.obstacles,a=Drn(i,o??im(n===e?e:{...n,connections:i})),c=Trn({connections:i,obstacles:s});if(i.forEach((l)=>{let h=l.pointsToConnect.map((f)=>f.pcb_port_id).filter((f)=>Boolean(f)),d=new Set(h),u=(f)=>((y)=>Array.from(new Set(y.flatMap((x)=>x.connectedTo))))(f).filter((y)=>!d.has(y)),_=l.pointsToConnect.map((f)=>f.pointId).filter((f)=>Boolean(f)),p=G$(a,l.name)??OKe(l),m=[],A=t.find((f)=>(f.connection_name??f.connectionName)===l.name);if(A){let f=(x)=>("route_type"in x)&&x.route_type==="jumper"?x.start:("x"in x)&&("y"in x)?{x:x.x,y:x.y}:{x:0,y:0},y=[f(A.route[0]),f(A.route[A.route.length-1])];for(let x of y)for(let C of s)iP(x,C)<=0&&m.push(C)}let g=r.find((f)=>f.type==="source_trace"&&f.source_trace_id===p);if(g){let f=g;f.connected_source_port_ids=[...new Set([...f.connected_source_port_ids,...h])],f.connected_source_net_ids=[...new Set([...f.connected_source_net_ids??[],..._,...u(m)])]}else r.push({type:"source_trace",source_trace_id:p,connected_source_port_ids:h,connected_source_net_ids:u(m).concat(_)})}),t[0]&&"type"in t[0]){let l=new Map(i.map((h)=>[h.name,h]));for(let h of t){let d=[...new Set((h.connectsTo??[]).filter((g)=>c.has(g)))],u=new Set(d),_=[...new Set((h.connectsTo??[]).filter((g)=>!u.has(g)))];if(d.length===0&&_.length===0)continue;let p=l.get(h.connection_name),m=G$(a,h.connection_name)??h.connectsTo?.map((g)=>G$(a,g)).find((g)=>g!==void 0)??(p?OKe(p):h.connection_name),A=r.find((g)=>g.type==="source_trace"&&g.source_trace_id===m);A?.type!=="source_trace"?r.push({type:"source_trace",source_trace_id:m,connected_source_port_ids:d,connected_source_net_ids:_}):(A.connected_source_port_ids=[...new Set([...A.connected_source_port_ids,...d])],A.connected_source_net_ids=[...new Set([...A.connected_source_net_ids??[],..._])])}}return r}function S1r(e,t,n){let o,r=Number.POSITIVE_INFINITY;for(let i of t){let s=n.get(i);if(!s)continue;let a=Math.hypot(s.x-e.x,s.y-e.y);a<r&&(r=a,o=i)}return o??t[0]}var P1r=new Set(["top","bottom","inner1","inner2","inner3","inner4","inner5","inner6","inner7","inner8"]),u$=(e)=>P1r.has(e);function _zt(e,t,n,o){let r=JSON.stringify([t.center.x,t.center.y,t.width,t.height,t.ccwRotationDegrees??0,[...t.layers].sort()]),i=o.get(e)??new Set;if(i.has(r))return;let s=i.size===0?e:`${e}_fragment_${n}`;return i.add(r),o.set(e,i),s}function E1r(e){let t=[],n=new Map,o=new Map,r=function(s){let a=new Map;for(let c of s.connections)for(let l of c.pointsToConnect)l.pcb_port_id&&a.set(l.pcb_port_id,{x:l.x,y:l.y});return a}(e),i=Trn(e);for(let[s,a]of e.obstacles.entries()){if(a.isNonPlatedHole){let C={type:"pcb_hole",pcb_hole_id:a.obstacleId??`pcb_hole_${s}`,x:a.center.x,y:a.center.y};if(a.shape==="circle")t.push({...C,hole_shape:"circle",hole_diameter:a.width});else{let b=a.ccwRotationDegrees??0;if(b%90!=0)throw Error(`Cannot represent rotated rectangular hole ${C.pcb_hole_id} in Circuit JSON`);let I=b%180!=0;t.push({...C,hole_shape:"rect",hole_width:I?a.height:a.width,hole_height:I?a.width:a.height})}continue}let c=a.connectedTo,l=Brn(a);if(l.pcb_via_id)continue;let{pcb_smtpad_id:h,pcb_plated_hole_id:d}=l,u=[...new Set([...l.pcb_port_id?[l.pcb_port_id]:[],...c.filter((C)=>i.has(C))])];if(u.length===0){for(let C of e.connections)if(a.netIsAssignable||CZe(C).some((b)=>c.includes(b)))for(let b of C.pointsToConnect)b.pcb_port_id&&Math.hypot(b.x-a.center.x,b.y-a.center.y)<0.000001&&u.push(b.pcb_port_id)}let _=l.pcb_port_id&&r.has(l.pcb_port_id)?l.pcb_port_id:S1r(a.center,u,r);if(!h&&!d&&!_)continue;let p=a.layers.filter(u$);if(p.length===0)continue;let{width:m,height:A}=a,g=a.center.x,f=a.center.y,y=a.ccwRotationDegrees;if(Boolean(d)||p.length>1){let C=_zt(d??`pcb_plated_hole_${g.toFixed(3)}_${f.toFixed(3)}`,a,s,o);if(C===void 0)continue;if(typeof y=="number"&&Number.isFinite(y)){let b=Math.max(0.5*Math.min(m,A),0.1);t.push({type:"pcb_plated_hole",pcb_plated_hole_id:C,shape:"rotated_pill_hole_with_rect_pad",hole_shape:"rotated_pill",pad_shape:"rect",hole_width:b,hole_height:b,hole_ccw_rotation:y,rect_pad_width:m,rect_pad_height:A,rect_ccw_rotation:y,hole_offset_x:0,hole_offset_y:0,x:g,y:f,layers:p,..._?{pcb_port_id:_}:{}});continue}if(Math.abs(m-A)<0.001){t.push({type:"pcb_plated_hole",pcb_plated_hole_id:C,shape:"circle",outer_diameter:Math.max(m,A),hole_diameter:Math.max(0.5*Math.min(m,A),0.1),x:g,y:f,layers:p,..._?{pcb_port_id:_}:{}});continue}t.push({type:"pcb_plated_hole",pcb_plated_hole_id:C,shape:"circular_hole_with_rect_pad",hole_shape:"circle",hole_diameter:Math.max(0.5*Math.min(m,A),0.1),rect_pad_width:m,rect_pad_height:A,hole_offset_x:0,hole_offset_y:0,x:g,y:f,layers:p,..._?{pcb_port_id:_}:{}});continue}let x=_zt(h??`pcb_smtpad_${g.toFixed(3)}_${f.toFixed(3)}`,a,s,n);x!==void 0&&(typeof y=="number"&&Number.isFinite(y)?t.push({type:"pcb_smtpad",pcb_smtpad_id:x,layer:p[0],shape:"rotated_rect",x:g,y:f,width:m,height:A,ccw_rotation:y,..._?{pcb_port_id:_}:{}}):t.push({type:"pcb_smtpad",pcb_smtpad_id:x,layer:p[0],shape:"rect",width:m,height:A,x:g,y:f,..._?{pcb_port_id:_}:{}}))}return t}function gzt(e,t,n){if(n&&e.layers!==void 0)return e.layers;let o=n?e:{from_layer:"top",to_layer:nd(t-1,t)};return Nen(o,t)}function Nrn(e){let{minX:t,maxX:n,minY:o,maxY:r}=e.bounds;return{type:"pcb_board",pcb_board_id:"__autorouting_board__",thickness:1.6,num_layers:e.layerCount,center:{x:(t+n)/2,y:(o+r)/2},width:n-t,height:r-o,...e.outline?{outline:e.outline,shape:"polygon"}:{shape:"rect"},material:"fr4",min_trace_to_hole_edge_clearance:e.minTraceToHoleEdgeClearance,min_pad_edge_to_pad_edge_clearance:e.minPadEdgeToPadEdgeClearance,...e.minBoardEdgeClearance!==void 0?{min_board_edge_clearance:e.minBoardEdgeClearance}:{}}}function bZe(e,t,n={}){let{minTraceWidth:o=0.1,minViaDiameter:r,minViaHoleDiameter:i,originalSrj:s,includeOriginalConnections:a=!1}=n,c=rm(e),l=r??c.padDiameter,h=e.min_via_hole_diameter??e.minViaHoleDiameter,d=i??h??(r!==void 0?0.5*l:c.holeDiameter),u=[];u.push(...v1r(e,t,a&&s?s:e,n.connectivityMaps?.source)),u.push(...function(m){let A=new Map;return m.connections.forEach((g)=>{g.pointsToConnect.forEach((f)=>{f.pcb_port_id&&A.set(f.pcb_port_id,{type:"pcb_port",pcb_port_id:f.pcb_port_id,source_port_id:f.pcb_port_id,x:f.x,y:f.y,layers:E5(f)})})}),Array.from(A.values())}(a&&s?s:e)),u.push(...E1r(s??e)),u.push(...function(m,A,g=0.3,f=0.5*g,y=!1){let x=[],C=new Set;return m.length>0&&("type"in m[0]&&m[0].type==="pcb_trace"?m.forEach((b)=>{b.route.forEach((I)=>{if(I.route_type==="via"){if(!u$(I.from_layer)||!u$(I.to_layer))return;let v=I.via_diameter??g,P=I.via_hole_diameter??f,M=`${I.x},${I.y},${I.from_layer},${I.to_layer}`;C.has(M)||(x.push({type:"pcb_via",pcb_via_id:`via_${x.length}`,pcb_trace_id:b.pcb_trace_id,x:I.x,y:I.y,outer_diameter:v,hole_diameter:P,layers:gzt(I,A,y)}),C.add(M))}})}):m.forEach((b,I)=>{let v=`trace_${I}`,P=b.viaDiameter??g,M=f;for(let B=1;B<b.route.length;B++){let T=b.route[B-1],N=b.route[B];if(T.z!==N.z&&Math.abs(T.x-N.x)<0.01&&Math.abs(T.y-N.y)<0.01){let D=nd(T.z,A),L=nd(N.z,A),H=`${N.x},${N.y},${D},${L}`;C.has(H)||(x.push({type:"pcb_via",pcb_via_id:`via_${x.length}`,pcb_trace_id:v,x:N.x,y:N.y,outer_diameter:P,hole_diameter:M,layers:gzt({from_layer:D,to_layer:L},A,y)}),C.add(H))}}})),x}(t,e.layerCount,l,d,(s??e).allowBlindAndBuriedVias===!0));let _=new Set(e.connections.flatMap(CZe)),p=Drn(a&&s?[...e.connections,...s.connections.filter((m)=>!_.has(m.name))]:e.connections,n.connectivityMaps?.route??im(e));return t.length>0&&("type"in t[0]&&t[0].type==="pcb_trace"?t.forEach((m)=>{let A=G$(p,m.connection_name)??m.connectsTo?.map((g)=>G$(p,g)).find((g)=>Boolean(g))??m.connection_name;u.push(function(g,f){return{type:"pcb_trace",pcb_trace_id:g.pcb_trace_id,source_trace_id:f,route:g.route.map((y)=>{if(y.route_type==="wire"){if(!u$(y.layer))return null;let x="start_pcb_port_id"in y&&typeof y.start_pcb_port_id=="string"?y.start_pcb_port_id:void 0,C="end_pcb_port_id"in y&&typeof y.end_pcb_port_id=="string"?y.end_pcb_port_id:void 0;return{route_type:"wire",x:y.x,y:y.y,width:y.width,layer:y.layer,...x?{start_pcb_port_id:x}:{},...C?{end_pcb_port_id:C}:{}}}return y.route_type==="via"&&u$(y.from_layer)&&u$(y.to_layer)?{route_type:"via",x:y.x,y:y.y,from_layer:y.from_layer,to_layer:y.to_layer}:null}).filter((y)=>y!==null)}}(m,A))}):t.forEach((m,A)=>{let g=function(f,y,x,C,b=0.1){let I=[];if(!f.jumpers||f.jumpers.length===0)return[{type:"pcb_trace",pcb_trace_id:y,source_trace_id:x,route:f.route.map((B,T)=>{let N=T===0,D=T===f.route.length-1;return{route_type:"wire",x:B.x,y:B.y,width:B.traceThickness??b,layer:nd(B.z,C),...N&&B.pcb_port_id?{start_pcb_port_id:B.pcb_port_id}:{},...D&&B.pcb_port_id?{end_pcb_port_id:B.pcb_port_id}:{}}})}];let v=[];for(let B of f.jumpers){let T=-1,N=-1;for(let D=0;D<f.route.length;D++){let L=f.route[D];Math.abs(L.x-B.start.x)<0.01&&Math.abs(L.y-B.start.y)<0.01&&(T=D),Math.abs(L.x-B.end.x)<0.01&&Math.abs(L.y-B.end.y)<0.01&&(N=D)}T!==-1&&N!==-1&&(T>N&&([T,N]=[N,T]),v.push({startIdx:T,endIdx:N}))}v.sort((B,T)=>B.startIdx-T.startIdx);let P=0,M=0;for(let{startIdx:B,endIdx:T}of v){if(B>=P){let N=f.route.slice(P,B+1);N.length>0&&(I.push({type:"pcb_trace",pcb_trace_id:`${y}_${M}`,source_trace_id:x,route:N.map((D,L)=>{let H=L===0&&P===0;return{route_type:"wire",x:D.x,y:D.y,width:D.traceThickness??b,layer:nd(D.z,C),...H&&D.pcb_port_id?{start_pcb_port_id:D.pcb_port_id}:{}}})}),M++)}P=T}if(P<f.route.length){let B=f.route.slice(P);if(B.length>0)I.push({type:"pcb_trace",pcb_trace_id:`${y}_${M}`,source_trace_id:x,route:B.map((N,D)=>{let L=D===B.length-1;return{route_type:"wire",x:N.x,y:N.y,width:N.traceThickness??b,layer:nd(N.z,C),...L&&N.pcb_port_id?{end_pcb_port_id:N.pcb_port_id}:{}}})})}return I}(m,`trace_${A}`,G$(p,m.connectionName)??m.connectionName,e.layerCount,o);u.push(...g)})),u}var qK=Symbol("originalPortPoint"),M1r=class extends IS{constructor(e){let t=e.nodeWithPortPoints,n=(e.traceThickness??0.1)/2+(e.traceMargin??0.1),o=t.width>2*n&&t.height>2*n,r=t.center.x-t.width/2+n,i=t.center.x+t.width/2-n,s=t.center.y-t.height/2+n,a=t.center.y+t.height/2-n,c=t.portPoints.map((d)=>({...d,x:Math.max(r,Math.min(i,d.x)),y:Math.max(s,Math.min(a,d.y)),[qK]:d})),l=new Map,h=!1;for(let d of c){let u=`${d.x},${d.y},${d.z}`,_=l.get(u),p=d[qK];!_||_.x===p.x&&_.y===p.y||(h=!0),l.set(u,p)}super({...e,nodeWithPortPoints:o?{...t,width:t.width-2*n,height:t.height-2*n,portPoints:c}:t}),h&&(this.failed=!0,this.error="Boundary clearance collapses distinct terminals"),o||(this.failed=!0,this.error="Node has no interior after copper boundary clearance")}getOutput(){return super.getOutput().map((e)=>{let t=e.route[0],n=e.route[e.route.length-1];if(!t[qK]||!n[qK])throw Error("A13 route lost its original terminal metadata");return{...e,route:[{...t[qK]},...e.route,{...n[qK]}]}})}},w1r=class extends M1r{constructor(e){super(e),this.validationParams=e}validationParams;_step(){if(super._step(),!this.solved)return;let e=this.getOutput(),{connMap:t,layerCount:n}=this.validationParams,o=this.nodeWithPortPoints,r=e.flatMap((g)=>g.route),i=Math.max(this.traceThickness,this.viaDiameter)/2+Math.max(this.traceMargin,0.1)+0.000001,s=Math.min(...r.map((g)=>g.x))-i,a=Math.max(...r.map((g)=>g.x))+i,c=Math.min(...r.map((g)=>g.y))-i,l=Math.max(...r.map((g)=>g.y))+i,h=this.validationParams.obstacles.filter((g)=>{let f=Math.hypot(g.width,g.height)/2;return g.center.x+f>=s&&g.center.x-f<=a&&g.center.y+f>=c&&g.center.y-f<=l});this.stats.boardObstaclesChecked=h.length;let{connectedRouteNamesByObstacle:d,connectedObstaclesByRoute:u}=(({obstacles:g,routes:f,connMap:y})=>{let x=g.map(()=>[]),C=f.map(()=>[]);for(let b=0;b<g.length;b++){let I=g[b],v={...I,connectedTo:[...new Set(I.connectedTo)]};for(let P=0;P<f.length;P++){let M=f[P];_B(v,M,y)&&(x[b].push(M.connectionName),C[P].push(I))}}return{connectedRouteNamesByObstacle:x,connectedObstaclesByRoute:C}})({obstacles:h,routes:e,connMap:t}),_={layerCount:n,minTraceWidth:this.traceThickness,minViaDiameter:this.viaDiameter,bounds:{minX:o.center.x-o.width/2,maxX:o.center.x+o.width/2,minY:o.center.y-o.height/2,maxY:o.center.y+o.height/2},...this.validationParams.boardGeometry,obstacles:h.map((g,f)=>({...g,connectedTo:[...g.connectedTo,...d[f]]})),connections:e.map((g,f)=>({name:g.connectionName,rootConnectionName:g.rootConnectionName,__netConnectionName:g.rootConnectionName??g.connectionName,pointsToConnect:[...[g.route[0],g.route.at(-1)].map((y)=>({x:y.x,y:y.y,layer:nd(y.z,n)})),...u[f].flatMap((y)=>{let x=y.circuitJsonMetadata?.pcb_port_id;return x?[{...y.center,layer:nd(0,n),pcb_port_id:x}]:[]})]}))},p=bZe(_,e.map((g,f)=>({type:"pcb_trace",pcb_trace_id:`${g.connectionName}_${f}`,connection_name:g.connectionName,route:k3(g,n)})));this.validationParams.boardGeometry&&p.push(Nrn(_));let{errors:m}=Den(p,{traceClearance:this.traceMargin,viaClearance:this.traceMargin,includeTraceContinuity:!1}),A=VV({srj:{..._,traces:void 0},routes:e});this.stats.boardDrcIssueCount=m.length+A.length,(m.length>0||A.length>0)&&(this.solved=!1,this.failed=!0,this.error=`A13 candidate fails board copper validation: ${m[0]?.message??"fixed obstacle clearance violation"}`)}},R3=(e)=>`${e.x.toFixed(6)},${e.y.toFixed(6)},${e.z}`,B1r=(e)=>[e.route[0],e.route[e.route.length-1]],DCe=(e,t,n)=>{let o=new Map,r=(a,c)=>{o.has(a)||o.set(a,new Set),o.has(c)||o.set(c,new Set),o.get(a).add(c),o.get(c).add(a)};for(let a of e)if(a.connectionName===t&&a.route.length!==0){if(a.route.length===1){let c=R3(a.route[0]);o.has(c)||o.set(c,new Set);continue}for(let c=0;c<a.route.length-1;c++)r(R3(a.route[c]),R3(a.route[c+1]))}let i=new Set([n]),s=[n];for(;s.length>0;){let a=s.pop();for(let c of o.get(a)??[])i.has(c)||(i.add(c),s.push(c))}return i},yXe=Array.from({length:6},(e,t)=>t),XV=class extends ybe{getSolverName(){return"PortfolioSingleIntraNodeSolver"}constructorParams;solvedRoutes=[];nodeWithPortPoints;connMap;effort;adaptiveSearchExpanded=!1;negotiatedSearchStarted=!1;enableNegotiatedSearch;gridSearchSegmentWork;gridSearchWorkScale;rejectOverlappingTerminals;precomputedIntraNodeRouteParams;nodeSegmentCount;totalCandidateWork=0;dynamicExpansionWorkBudget=1;candidateWorkBySolver=new WeakMap;getSolvedSegmentCount(e){let t=e.solvedConnectionsMap;if(!(t instanceof Map))return null;let n=0;for(let o of t.values())Array.isArray(o)&&(n+=o.length);return n}getNodeSegmentCount(){return this.nodeSegmentCount??=Math.max(1,this.nodeWithPortPoints.portPointsInPairs?.length??new Set(this.nodeWithPortPoints.portPoints.map((e)=>e.connectionName)).size),this.nodeSegmentCount}getCandidateProgress(e){if(e instanceof IS){if(e.solved)return 1;let n=e.connections.length;if(n===0)return 0;let o=e.routedCount/n,r=Math.max(0,(e.routedCount-e.conflictCount)/n);return Math.min(0.99,(o+r)/2)}let t=this.getSolvedSegmentCount(e);return t!==null?Math.min(1,t/this.getNodeSegmentCount()):Math.max(0,Math.min(1,e.progress||0))}constructor(e){if(super(),this.nodeWithPortPoints=e.nodeWithPortPoints,this.connMap=e.connMap,this.constructorParams=e,this.effort=e.effort??1,this.gridSearchSegmentWork=e.gridSearchSegmentWork??1e4,this.gridSearchWorkScale=e.gridSearchWorkScale??1,this.rejectOverlappingTerminals=e.rejectOverlappingTerminals??!1,this.enableNegotiatedSearch=e.enableNegotiatedSearch??!1,this.MAX_ITERATIONS=20000000*this.effort,this.GREEDY_MULTIPLIER=5,this.MIN_SUBSTEPS=100,this.rejectOverlappingTerminals){let t=this.nodeWithPortPoints.portPoints,n=e.traceWidth??0.15;for(let o=0;o<t.length;o++)for(let r=o+1;r<t.length;r++){let i=t[o],s=t[r];if(i.z===s.z&&(i.rootConnectionName??i.connectionName)!==(s.rootConnectionName??s.connectionName)&&!this.connMap?.areIdsConnected(i.connectionName,s.connectionName)&&Math.hypot(i.x-s.x,i.y-s.y)<n-0.000001)return this.failed=!0,void(this.error="Unrelated route terminals overlap at the requested trace width")}}}getGridSearchIterationBudget(){let e=this.nodeWithPortPoints,t=e.availableZ?.length??new Set(e.portPoints.map((r)=>r.z)).size,n=Math.floor(e.width/0.1)*Math.floor(e.height/0.1)*t,o=t>2?this.gridSearchWorkScale:1;return Math.round(o*Math.max(150000,(t<=2?1e4:this.gridSearchSegmentWork)*this.getNodeSegmentCount()**2,Math.round(n*(8+1.2*Math.sqrt(this.getNodeSegmentCount()))*this.effort)))}getCombinationDefs(){return[["throughObstacle"],["singleLayerNoDifferentRootIntersections"],["multiHeadPolyLine"],["majorCombinations","orderings6","cellSizeFactor"],["noVias"],["orderings50"],["flipTraceAlignmentDirection","orderings6"],["closedFormSingleTrace"],["highDensityA01"],["highDensityA03"],...this.enableNegotiatedSearch?[["highDensityA13"]]:[]]}getHyperParameterDefs(){return[{name:"singleLayerNoDifferentRootIntersections",possibleValues:[{SINGLE_LAYER_NO_DIFFERENT_ROOT_INTERSECTIONS:!0}]},{name:"majorCombinations",possibleValues:[{FUTURE_CONNECTION_PROX_TRACE_PENALTY_FACTOR:2,FUTURE_CONNECTION_PROX_VIA_PENALTY_FACTOR:1,FUTURE_CONNECTION_PROXIMITY_VD:10,MISALIGNED_DIST_PENALTY_FACTOR:5},{FUTURE_CONNECTION_PROX_TRACE_PENALTY_FACTOR:1,FUTURE_CONNECTION_PROX_VIA_PENALTY_FACTOR:0.5,FUTURE_CONNECTION_PROXIMITY_VD:5,MISALIGNED_DIST_PENALTY_FACTOR:2},{FUTURE_CONNECTION_PROX_TRACE_PENALTY_FACTOR:10,FUTURE_CONNECTION_PROX_VIA_PENALTY_FACTOR:1,FUTURE_CONNECTION_PROXIMITY_VD:5,MISALIGNED_DIST_PENALTY_FACTOR:10,VIA_PENALTY_FACTOR_2:1}]},{name:"orderings6",possibleValues:yXe.map((e)=>({SHUFFLE_SEED:e}))},{name:"cellSizeFactor",possibleValues:[{CELL_SIZE_FACTOR:0.5},{CELL_SIZE_FACTOR:1}]},{name:"flipTraceAlignmentDirection",possibleValues:[{FLIP_TRACE_ALIGNMENT_DIRECTION:!0}]},{name:"noVias",possibleValues:[{CELL_SIZE_FACTOR:2,VIA_PENALTY_FACTOR_2:10}]},{name:"orderings50",possibleValues:Array.from({length:20},(e,t)=>({SHUFFLE_SEED:100+t}))},{name:"throughObstacle",possibleValues:[{THROUGH_OBSTACLE:!0}]},{name:"closedFormSingleTrace",possibleValues:[{CLOSED_FORM_SINGLE_TRANSITION:!0}]},{name:"multiHeadPolyLine",possibleValues:[{MULTI_HEAD_POLYLINE_SOLVER:!0,SEGMENTS_PER_POLYLINE:6,BOUNDARY_PADDING:0.05},{MULTI_HEAD_POLYLINE_SOLVER:!0,SEGMENTS_PER_POLYLINE:6,BOUNDARY_PADDING:-0.05,ITERATION_PENALTY:1e4,MINIMUM_FINAL_ACCEPTANCE_GAP:0.001}]},{name:"highDensityA01",possibleValues:[{HIGH_DENSITY_A01:!0,SHUFFLE_SEED:yXe[0]}]},{name:"highDensityA03",possibleValues:[{HIGH_DENSITY_A03:!0}]},{name:"highDensityA13",possibleValues:[{HIGH_DENSITY_A13:!0,SHUFFLE_SEED:0}]}]}initializeCandidateBudget(e){if(e instanceof IS)return;let t=e.setup;typeof t=="function"&&t.call(e),(e instanceof y4e||e instanceof C4e)&&(e.MAX_ITERATIONS=Math.min(e.MAX_ITERATIONS,this.getGridSearchIterationBudget()))}refreshDynamicIterationLimit(){this.totalCandidateWork=0,this.dynamicExpansionWorkBudget=1;let e=(this.supervisedSolvers??[]).reduce((t,{solver:n})=>{if(n instanceof IS||(this.totalCandidateWork+=n.iterations,this.dynamicExpansionWorkBudget=Math.max(this.dynamicExpansionWorkBudget,n.MAX_ITERATIONS),this.candidateWorkBySolver.set(n,{iterations:n.iterations,maxIterations:n.MAX_ITERATIONS})),n.solved||n.failed)return t;let o=Math.max(0,n.MAX_ITERATIONS-n.iterations+1);return t+Math.ceil(o/this.MIN_SUBSTEPS)},0);this.MAX_ITERATIONS=Math.max(this.iterations+1,this.iterations+e),this.stats.dynamicSupervisorIterationLimit=this.MAX_ITERATIONS}initializeSolvers(){super.initializeSolvers();for(let{solver:e}of this.supervisedSolvers??[])this.initializeCandidateBudget(e);this.refreshDynamicIterationLimit(),this.stats.dynamicExpansionWorkBudget=this.dynamicExpansionWorkBudget}addSupervisedCandidate(e){let t=this.generateSolver(e);this.initializeCandidateBudget(t);let n=this.computeG(t);this.supervisedSolvers.push({hyperParameters:e,solver:t,h:0,g:n,f:n})}expandAdaptiveSearch(){if(!this.adaptiveSearchExpanded){this.adaptiveSearchExpanded=!0;for(let e of yXe.slice(1))this.addSupervisedCandidate({HIGH_DENSITY_A01:!0,SHUFFLE_SEED:e});this.refreshDynamicIterationLimit(),this.stats.adaptiveSearchExpanded=!0,this.stats.adaptiveSearchExpandedAtIteration=this.iterations,this.stats.candidateWorkAtExpansion=this.totalCandidateWork,this.stats.bestProgressAtExpansion=Math.max(0,...(this.supervisedSolvers??[]).map(({solver:e})=>this.getCandidateProgress(e)))}}shouldExpandPortfolio(){if(this.adaptiveSearchExpanded)return!1;let e=this.dynamicExpansionWorkBudget;return this.stats.dynamicExpansionWorkBudget=e,this.totalCandidateWork>=e}_step(){this.supervisedSolvers||this.initializeSolvers(),this.adaptiveSearchExpanded||this.getSupervisedSolverWithBestFitness()||this.expandAdaptiveSearch(),super._step(),!this.negotiatedSearchStarted&&this.activeSubSolver instanceof IS&&(this.negotiatedSearchStarted=!0,this.stats.negotiatedSearchStartedAtIteration=this.iterations),this.solved||this.failed||!this.shouldExpandPortfolio()||this.expandAdaptiveSearch()}computeG(e){if(e instanceof IS)return e.routingIterations/1e6;let t=this.candidateWorkBySolver.get(e);if(t&&(this.totalCandidateWork+=e.iterations-t.iterations,t.iterations=e.iterations,t.maxIterations!==e.MAX_ITERATIONS)){t.maxIterations=e.MAX_ITERATIONS,this.dynamicExpansionWorkBudget=1;for(let{solver:n}of this.supervisedSolvers??[])n instanceof IS||(this.dynamicExpansionWorkBudget=Math.max(this.dynamicExpansionWorkBudget,n.MAX_ITERATIONS))}return e instanceof y4e||e instanceof C4e||e instanceof IS?e.iterations/1e6:e?.hyperParameters?.MULTI_HEAD_POLYLINE_SOLVER?1000+((e.hyperParameters?.ITERATION_PENALTY??0)+e.iterations)/1e4+1e4*(e.hyperParameters.SEGMENTS_PER_POLYLINE-3):e.iterations/1e4}computeH(e){return e instanceof IS||this.adaptiveSearchExpanded?1-this.getCandidateProgress(e):1-(e.progress||0)}generateSolver(e){if(this.precomputedIntraNodeRouteParams??=kUt(this.nodeWithPortPoints),e.SINGLE_LAYER_NO_DIFFERENT_ROOT_INTERSECTIONS){if(!sHt.isApplicable(this.nodeWithPortPoints)){let t=new fbe({nodeWithPortPoints:this.nodeWithPortPoints,connMap:this.connMap,traceWidth:this.constructorParams.traceWidth,viaDiameter:this.constructorParams.viaDiameter,obstacleMargin:this.constructorParams.obstacleMargin,precomputedIntraNodeRouteParams:this.precomputedIntraNodeRouteParams});return t.failed=!0,t.error="Single-layer no-different-root-intersection solver not applicable",t}return new sHt({nodeWithPortPoints:this.nodeWithPortPoints,traceWidth:this.constructorParams.traceWidth,viaDiameter:this.constructorParams.viaDiameter})}if(e.HIGH_DENSITY_A13){let t=Math.max(1,Math.round(50000000*this.effort)),n=new w1r({obstacles:this.constructorParams.obstacles??[],boardGeometry:this.constructorParams.boardGeometry,connMap:this.connMap,layerCount:this.constructorParams.layerCount??2,nodeWithPortPoints:this.nodeWithPortPoints,cellSizeMm:0.1,viaDiameter:this.constructorParams.viaDiameter??0.3,viaMinDistFromBorder:(this.constructorParams.viaDiameter??0.3)/2,traceThickness:this.constructorParams.traceWidth??0.15,traceMargin:0.1,stepMultiplier:1000,maxSearchIterations:t,maxRounds:Math.max(1,Math.round(200*this.effort)),hyperParameters:{shuffleSeed:e.SHUFFLE_SEED??0}});return n.MAX_ITERATIONS=2*t,n}if(e.HIGH_DENSITY_A01)return new y4e({nodeWithPortPoints:this.nodeWithPortPoints,cellSizeMm:0.1,viaDiameter:this.constructorParams.viaDiameter??0.3,viaMinDistFromBorder:(this.constructorParams.viaDiameter??0.3)/2,traceMargin:0.1,traceThickness:this.constructorParams.traceWidth??0.15,effort:this.effort,hyperParameters:{shuffleSeed:e.SHUFFLE_SEED??0}});if(e.HIGH_DENSITY_A03)return new C4e({nodeWithPortPoints:this.nodeWithPortPoints,highResolutionCellSize:0.1,highResolutionCellThickness:8,lowResolutionCellSize:0.4,viaDiameter:this.constructorParams.viaDiameter??0.3,viaMinDistFromBorder:(this.constructorParams.viaDiameter??0.3)/2,traceMargin:0.1,traceThickness:0.1,effort:this.effort,hyperParameters:e});return e.CLOSED_FORM_TWO_TRACE_SAME_LAYER?new Emr({nodeWithPortPoints:this.nodeWithPortPoints,viaDiameter:this.constructorParams.viaDiameter}):e.CLOSED_FORM_TWO_TRACE_TRANSITION_CROSSING?new Smr({nodeWithPortPoints:this.nodeWithPortPoints,viaDiameter:this.constructorParams.viaDiameter}):e.CLOSED_FORM_SINGLE_TRANSITION?new Cmr({nodeWithPortPoints:this.nodeWithPortPoints,viaDiameter:this.constructorParams.viaDiameter}):e.THROUGH_OBSTACLE?new bmr({nodeWithPortPoints:this.nodeWithPortPoints,obstacles:this.constructorParams.obstacles,connMap:this.connMap,layerCount:this.constructorParams.layerCount,viaDiameter:this.constructorParams.viaDiameter,traceThickness:this.constructorParams.traceWidth}):e.MULTI_HEAD_POLYLINE_SOLVER?new OUt({nodeWithPortPoints:this.nodeWithPortPoints,connMap:this.connMap,hyperParameters:e,viaDiameter:this.constructorParams.viaDiameter}):new oqe({...this.constructorParams,hyperParameters:e,precomputedIntraNodeRouteParams:this.precomputedIntraNodeRouteParams})}onSolve(e){let t;t=e.solver instanceof y4e||e.solver instanceof C4e||e.solver instanceof IS?e.solver.getOutput():e.solver.solvedRoutes;let n=t.map((o)=>{let r=this.nodeWithPortPoints.portPoints.find((i)=>i.connectionName===o.connectionName);return r?.rootConnectionName?{...o,rootConnectionName:r.rootConnectionName}:o});this.solvedRoutes=((o,r)=>{let i=[...o],s=new Map;for(let a of r.portPoints){let c=s.get(a.connectionName)??[];c.push(a),s.set(a.connectionName,c)}for(let[a,c]of s){if(c.length<=1)continue;let l=c[0]?.rootConnectionName??a,h=new Set(c.map(R3)),d=DCe(i,a,R3(c[0]));for(let u of c.slice(1)){let _=R3(u);if(d.has(_))continue;let p=i.find((m)=>{if((m.rootConnectionName??m.connectionName)!==l)return!1;if(m.connectionName===a)return!1;let[A,g]=B1r(m);if(!A||!g)return!1;let f=R3(A),y=R3(g);return d.has(f)&&y===_||d.has(y)&&f===_||h.has(f)&&h.has(y)&&(f===_||y===_)});p&&(i.push({...p,connectionName:a,rootConnectionName:l,route:p.route.map((m)=>({...m,connectionName:a,rootConnectionName:l})),vias:p.vias.map((m)=>({...m})),jumpers:p.jumpers?.map((m)=>({...m,start:{...m.start},end:{...m.end}}))}),d=DCe(i,a,R3(c[0])))}}return i})(n,this.nodeWithPortPoints)}};function Azt(e,t,n,o,r){let i=n-t,s=r-o;if(Math.abs(e.y-r)<0.000001)return e.x-t;if(Math.abs(e.x-n)<0.000001)return i+(r-e.y);if(Math.abs(e.y-o)<0.000001)return i+s+(n-e.x);if(Math.abs(e.x-t)<0.000001)return 2*i+s+(e.y-o);let c=Math.abs(e.y-r),l=Math.abs(e.x-n),h=Math.abs(e.y-o),d=Math.abs(e.x-t),u=Math.min(c,l,h,d);return u===c?Math.max(0,Math.min(i,e.x-t)):u===l?i+Math.max(0,Math.min(s,r-e.y)):u===h?i+s+Math.max(0,Math.min(i,n-e.x)):2*i+s+Math.max(0,Math.min(s,e.y-o))}function k4e(e,t,n=0.000001){return Math.abs(e-t)<n}function fzt(e){if(e.length<2)return 0;let t=e.map(([o,r])=>o<r?[o,r]:[r,o]),n=0;for(let o=0;o<t.length;o++){let[r,i]=t[o];for(let s=o+1;s<t.length;s++){let[a,c]=t[s];k4e(r,a)||k4e(r,c)||k4e(i,a)||k4e(i,c)||(r<a&&a<i&&i<c||a<r&&r<c&&c<i)&&n++}}return n}var D_=(e)=>{let t=e.center.x-e.width/2,n=e.center.x+e.width/2,o=e.center.y-e.height/2,r=e.center.y+e.height/2,i=new Map;for(let h of e.portPoints){let d=i.get(h.connectionName)??[];d.some((u)=>u.x===h.x&&u.y===h.y&&u.z===h.z)||d.push({x:h.x,y:h.y,z:h.z}),i.set(h.connectionName,d)}let s=new Map,a=[],c=0;for(let[h,d]of i){if(d.length<2)continue;let u=d[0],_=d[1],p=Azt(u,t,n,o,r),m=Azt(_,t,n,o,r);if(u.z===_.z){let A=u.z,g=s.get(A)??[];g.push([p,m]),s.set(A,g)}else c++,a.push([p,m])}let l=0;for(let[h,d]of s)l+=fzt(d);return{numSameLayerCrossings:l,numEntryExitLayerChanges:c,numTransitionPairCrossings:fzt(a)}},Rrn=(e)=>e.availableZ?.length?[...new Set(e.availableZ)].sort((t,n)=>t-n):[...new Set(e.portPoints.map((t)=>t.z??0))].sort((t,n)=>t-n),Qrn=(e)=>Rrn(e).length===1&&D_(e).numSameLayerCrossings>0,krn=(e,t,n)=>{let o=new Map,[r]=Rrn(e);for(let i of e.portPoints)o.set(i.connectionName,[...o.get(i.connectionName)??[],i]);return Array.from(o.entries()).flatMap(([i,s])=>{if(s.length<2)return[];let a=s[0],c=s[s.length-1];return[{connectionName:i,rootConnectionName:a.rootConnectionName,regionId:e.capacityMeshNodeId,traceThickness:t,viaDiameter:n,route:[{x:a.x,y:a.y,z:r??a.z??0},{x:c.x,y:c.y,z:r??c.z??0}],vias:[]}]})},T1r=krn,lce=(e,t,n)=>({...e,x:t.x+(e.x-t.x)*n,y:t.y+(e.y-t.y)*n}),xXe=(e,t,n)=>lce(e,t,n),L4e=["#dc2626","#2563eb","#16a34a","#ca8a04","#9333ea","#0891b2"],yzt=(e,t,n=[])=>[e,t?`rootConnectionName: ${t}`:void 0,...n].filter(Boolean).join(`
`),CXe=class extends ei{getSolverName(){return"GrowShrinkHighDensityIntraNodeSolver"}constructorParams;nodeWithPortPoints;solvedRoutes=[];failedSolvers=[];activeSubSolver=null;winningSolver;scaleFactor=1;growthAttempts=0;maxGrowthAttempts;minimumGrowthAttempts;constructor(e){super(),this.constructorParams=e,this.nodeWithPortPoints=e.nodeWithPortPoints;let t=Math.min(this.nodeWithPortPoints.width,this.nodeWithPortPoints.height),n=t>0?Math.max(0,Math.ceil(Math.log2((e.viaDiameter??0.3)/t))):0,o=Number.POSITIVE_INFINITY,r=this.nodeWithPortPoints.portPoints;for(let a=0;a<r.length;a++)for(let c=a+1;c<r.length;c++){let l=r[a],h=r[c];if(l.z!==h.z||(l.rootConnectionName??l.connectionName)===(h.rootConnectionName??h.connectionName))continue;let d=Math.hypot(l.x-h.x,l.y-h.y);d>0.000000001&&(o=Math.min(o,d))}let i=Math.max(0,Math.ceil(Math.log2((e.traceWidth??0.15)/o))),s=Math.max(n,i);if(this.maxGrowthAttempts=e.maxGrowthAttempts??3+s,this.minimumGrowthAttempts=Math.min(e.maxGrowthAttempts??3+n,Math.max(n,0,i-1)),this.MAX_ITERATIONS=20000000*(e.effort??1)*(this.maxGrowthAttempts+1),Qrn(this.nodeWithPortPoints)){if(!e.fallbackToInvalidGeometryOnFailure)return this.failed=!0,this.progress=1,void(this.error="GrowShrinkHighDensityIntraNodeSolver cannot route an impossible single-layer crossing");this.solvedRoutes=T1r(this.nodeWithPortPoints,e.traceWidth??0.15,e.viaDiameter??0.3),this.solved=!0,this.progress=1,this.stats={invalidGeometryFallback:!0,reason:"single-layer node has same-layer crossings"}}}getConstructorParams(){return this.constructorParams}createActiveSubSolver(){let{growShrinkSolutionValidator:e,...t}=this.constructorParams;var n,o;this.activeSubSolver=new XV({...t,enableNegotiatedSearch:this.scaleFactor===1&&(t.enableNegotiatedSearch??!0),nodeWithPortPoints:(n=this.nodeWithPortPoints,o=this.scaleFactor,{...n,width:n.width*o,height:n.height*o,portPoints:n.portPoints.map((r)=>xXe(r,n.center,o)),portPointsInPairs:n.portPointsInPairs?.map(([r,i])=>[xXe(r,n.center,o),xXe(i,n.center,o)])})}),this.constructorParams.maxInnerIterationsPerGrowthAttempt&&(this.activeSubSolver.MAX_ITERATIONS=this.constructorParams.maxInnerIterationsPerGrowthAttempt)}acceptSolution(e){let t=this.scaleFactor===1?e.solvedRoutes:e.solvedRoutes.map((n)=>((o,r,i)=>({...o,route:o.route.map((s)=>lce(s,r,i)),vias:o.vias.map((s)=>lce(s,r,i)),jumpers:o.jumpers?.map((s)=>({...s,start:lce(s.start,r,i),end:lce(s.end,r,i)}))}))(n,this.nodeWithPortPoints.center,1/this.scaleFactor));return this.constructorParams.growShrinkSolutionValidator&&!this.constructorParams.growShrinkSolutionValidator(t)?(e.solved=!1,e.failed=!0,e.error="High-density scale solution rejected by validator",!1):(this.winningSolver=e,this.error=null,this.solvedRoutes=t,this.solved=!0,this.failed=!1,!0)}computeProgress(){return Math.min(0.99,(this.growthAttempts+(this.activeSubSolver?.progress??0))/(this.maxGrowthAttempts+1))}_step(){if(this.activeSubSolver||this.createActiveSubSolver(),this.activeSubSolver.step(),this.activeSubSolver.solved&&this.acceptSolution(this.activeSubSolver))this.activeSubSolver=null;else if(this.activeSubSolver.failed){if(this.failedSolvers.push(this.activeSubSolver),this.error=this.activeSubSolver.error,this.activeSubSolver=null,this.growthAttempts>=this.maxGrowthAttempts)return this.constructorParams.fallbackToInvalidGeometryOnFailure?(this.solvedRoutes=krn(this.nodeWithPortPoints,this.constructorParams.traceWidth??0.15,this.constructorParams.viaDiameter??0.3),this.solved=!0,this.failed=!1,this.progress=1,this.stats={...this.stats,invalidGeometryFallback:!0,reason:"growth attempts exhausted",lastError:this.error},void(this.error=null)):(this.failed=!0,void(this.error=`GrowShrinkHighDensityIntraNodeSolver failed after resizing to ${this.scaleFactor}x. Last error: ${this.error}`));this.growthAttempts=Math.max(this.growthAttempts+1,this.minimumGrowthAttempts),this.scaleFactor=2**this.growthAttempts}}visualize(){let e=this.activeSubSolver?.visualize()??this.winningSolver?.visualize();return e||(this.solvedRoutes.length>0?{title:this.stats.invalidGeometryFallback?"Invalid same-layer crossing geometry":"Grow/shrink high density routes",lines:this.solvedRoutes.flatMap((t,n)=>t.route.slice(0,-1).map((o,r)=>({points:[o,t.route[r+1]],strokeColor:L4e[n%L4e.length],strokeWidth:t.traceThickness,layer:`z${o.z}`,label:yzt(t.connectionName,t.rootConnectionName,[`z${o.z}`,this.stats.invalidGeometryFallback?"invalid fallback route":void 0].filter(Boolean))}))),points:this.nodeWithPortPoints.portPoints.map((t)=>({x:t.x,y:t.y,color:L4e[Math.max(0,this.solvedRoutes.findIndex((n)=>n.connectionName===t.connectionName))%L4e.length],label:yzt(t.connectionName,t.rootConnectionName,[`z${t.z}`])})),rects:[{center:this.nodeWithPortPoints.center,width:this.nodeWithPortPoints.width,height:this.nodeWithPortPoints.height,fill:this.stats.invalidGeometryFallback?"rgba(245, 158, 11, 0.12)":"rgba(14, 165, 233, 0.08)",stroke:this.stats.invalidGeometryFallback?"rgba(217, 119, 6, 0.8)":"rgba(14, 165, 233, 0.55)",label:[this.nodeWithPortPoints.capacityMeshNodeId,this.stats.reason].filter(Boolean).join(`
`)}],circles:[]}:e??{lines:[],points:[],rects:[],circles:[]})}},xzt=(e,t,n=[])=>[e,t?`rootConnectionName: ${t}`:void 0,...n].filter(Boolean).join(`
`),cY=class extends ei{getSolverName(){return"HighDensitySolver"}unsolvedNodePortPoints;routes;colorMap;defaultViaDiameter=0.3;defaultTraceThickness=0.15;viaDiameter;traceWidth;obstacleMargin;effort;obstacles;layerCount;useGrowShrinkHighDensityIntraNodeSolver;enableNegotiatedSearch;gridSearchSegmentWork;gridSearchWorkScale;rejectOverlappingTerminals;boardGeometry;preserveTerminalPcbPortIds;growShrinkMaxInnerIterationsPerGrowthAttempt;growShrinkFallbackToInvalidGeometryOnFailure;growShrinkSolutionValidator;captureSearchDebug;failedSolvers;activeSubSolver=null;connMap;nodePfById;nodeSolveMetadataById;constructor({nodePortPoints:e,colorMap:t,connMap:n,viaDiameter:o,traceWidth:r,obstacleMargin:i,effort:s,nodePfById:a,obstacles:c,layerCount:l,useGrowShrinkHighDensityIntraNodeSolver:h,enableNegotiatedSearch:d=!1,gridSearchSegmentWork:u=1e4,gridSearchWorkScale:_=1,rejectOverlappingTerminals:p=!1,boardGeometry:m,preserveTerminalPcbPortIds:A,growShrinkMaxInnerIterationsPerGrowthAttempt:g,growShrinkFallbackToInvalidGeometryOnFailure:f,growShrinkSolutionValidator:y,captureSearchDebug:x}){super(),this.unsolvedNodePortPoints=e,this.colorMap=t??{},this.connMap=n,this.routes=[],this.failedSolvers=[],this.effort=s??1,this.viaDiameter=o??this.defaultViaDiameter,this.traceWidth=r??this.defaultTraceThickness,this.obstacleMargin=i??0.15,this.obstacles=c??[],this.layerCount=l??2,this.enableNegotiatedSearch=d,this.gridSearchSegmentWork=u,this.gridSearchWorkScale=_,this.rejectOverlappingTerminals=p,this.boardGeometry=m,this.useGrowShrinkHighDensityIntraNodeSolver=h??!1,this.preserveTerminalPcbPortIds=A??!1,this.growShrinkMaxInnerIterationsPerGrowthAttempt=g,this.growShrinkFallbackToInvalidGeometryOnFailure=f??!1,this.growShrinkSolutionValidator=y,this.captureSearchDebug=x??!0,this.MAX_ITERATIONS=1e7*this.effort*(this.useGrowShrinkHighDensityIntraNodeSolver?4:1),this.nodePfById=a instanceof Map?new Map(a):new Map(Object.entries(a??{})),this.nodeSolveMetadataById=new Map,this.stats={solverNodeCount:{},difficultNodePfs:{},highDensityResizeCount:0}}getSolvedNodeSolverType(e){return e instanceof CXe&&e.winningSolver?this.getSolvedNodeSolverType(e.winningSolver):e instanceof XV&&e.winningSolver?this.getConcreteSolverTypeName(e.winningSolver):this.getConcreteSolverTypeName(e)}recordNodeSolveMetadata(e,t){let n=e.nodeWithPortPoints,o=this.nodePfById.get(n.capacityMeshNodeId)??null;this.nodeSolveMetadataById.set(n.capacityMeshNodeId,{node:n,status:t,solverType:this.getSolvedNodeSolverType(e),iterations:e.iterations,routeCount:e.solvedRoutes.length,nodePf:o,error:e.error??void 0})}createNodeMarkerLabel(e,t){return["hd_node_marker",`node: ${e}`,`status: ${t.status}`,`solver: ${t.solverType}`,`iterations: ${t.iterations}`,`routes: ${t.routeCount}`,`nodePf: ${t.nodePf??"n/a"}`,`portPoints: ${t.node.portPoints.length}`,...t.error?[`error: ${t.error}`]:[]].join(`
`)}getConcreteSolverTypeName(e){if(e instanceof oqe){let t=this.getIntraNodeStrategyName(e.hyperParameters);return e.cacheHit?`${t} [cached]`:t}return e instanceof fbe?this.getIntraNodeStrategyName(e.hyperParameters):e.getSolverName()}getIntraNodeStrategyName(e){return e?.MULTI_HEAD_POLYLINE_SOLVER?"MultiHeadPolyLineIntraNodeSolver3":e?.SINGLE_LAYER_NO_DIFFERENT_ROOT_INTERSECTIONS?"SingleLayerNoDifferentRootIntersectionsIntraNodeSolver":e?.CLOSED_FORM_SINGLE_TRANSITION?"SingleTransitionIntraNodeSolver":e?.CLOSED_FORM_TWO_TRACE_SAME_LAYER?"TwoCrossingRoutesHighDensitySolver":e?.CLOSED_FORM_TWO_TRACE_TRANSITION_CROSSING?"SingleTransitionCrossingRouteSolver":e?.HIGH_DENSITY_A01?"HighDensitySolverA01":e?.HIGH_DENSITY_A03?"HighDensitySolverA03":"SingleHighDensityRouteSolver6_VertHorzLayer_FutureCost"}recordSolvedNodeStats(e,t){let n=this.getSolvedNodeSolverType(e),o=this.stats.solverNodeCount,r=this.stats.difficultNodePfs;o[n]=(o[n]??0)+1;let i=this.nodePfById.get(t.capacityMeshNodeId)??null;i!==null&&i>0.05&&(r[n]||(r[n]=[]),r[n].push(i))}recordResizeStats(e){e instanceof CXe&&(this.stats.highDensityResizeCount=(this.stats.highDensityResizeCount??0)+e.growthAttempts)}getSolvedRoutesWithTerminalPcbPortIds(e){let t=e.nodeWithPortPoints.portPoints.filter((o)=>o.pcb_port_id!==void 0);if(t.length===0)return e.solvedRoutes;let n=(o,r)=>{let i=t.filter((a)=>a.connectionName===o.connectionName&&a.x===r.x&&a.y===r.y&&a.z===r.z);if(i.length>1)throw Error(`HighDensitySolver found multiple PCB terminals at an endpoint of "${o.connectionName}"`);let s=i[0];if(s?.pcb_port_id)return s.pcb_port_id};return e.solvedRoutes.map((o)=>({...o,startPcbPortId:o.route[0]?n(o,o.route[0]):void 0,endPcbPortId:o.route.length>1?n(o,o.route[o.route.length-1]):void 0}))}_step(){if(this.updateCacheStats(),this.activeSubSolver)return this.activeSubSolver.step(),this.activeSubSolver.solved?(this.routes.push(...this.preserveTerminalPcbPortIds?this.getSolvedRoutesWithTerminalPcbPortIds(this.activeSubSolver):this.activeSubSolver.solvedRoutes),this.recordNodeSolveMetadata(this.activeSubSolver,"solved"),this.recordSolvedNodeStats(this.activeSubSolver,this.activeSubSolver.nodeWithPortPoints),this.recordResizeStats(this.activeSubSolver),this.activeSubSolver=null):this.activeSubSolver.failed&&(this.recordNodeSolveMetadata(this.activeSubSolver,"failed"),this.recordResizeStats(this.activeSubSolver),this.failedSolvers.push(this.activeSubSolver),this.activeSubSolver=null),void this.updateCacheStats();if(this.unsolvedNodePortPoints.length===0)return this.failedSolvers.length>0?(this.solved=!1,this.failed=!0,this.error=`Failed to solve ${this.failedSolvers.length} nodes, ${this.failedSolvers.slice(0,5).map((t)=>t.nodeWithPortPoints.capacityMeshNodeId)}. err0: ${this.failedSolvers[0].error}.`,void this.updateCacheStats()):(this.solved=!0,void this.updateCacheStats());let e={nodeWithPortPoints:this.unsolvedNodePortPoints.pop(),enableNegotiatedSearch:this.enableNegotiatedSearch,gridSearchSegmentWork:this.gridSearchSegmentWork,gridSearchWorkScale:this.gridSearchWorkScale,rejectOverlappingTerminals:this.rejectOverlappingTerminals,boardGeometry:this.boardGeometry,colorMap:this.colorMap,connMap:this.connMap,viaDiameter:this.viaDiameter,traceWidth:this.traceWidth,obstacleMargin:this.obstacleMargin,effort:this.effort,obstacles:this.obstacles,layerCount:this.layerCount,maxInnerIterationsPerGrowthAttempt:this.growShrinkMaxInnerIterationsPerGrowthAttempt,fallbackToInvalidGeometryOnFailure:this.growShrinkFallbackToInvalidGeometryOnFailure,growShrinkSolutionValidator:this.growShrinkSolutionValidator,captureSearchDebug:this.captureSearchDebug};this.activeSubSolver=this.useGrowShrinkHighDensityIntraNodeSolver?new CXe(e):new XV(e),this.updateCacheStats()}updateCacheStats(){let e=hv();this.stats.intraNodeCacheHits=e.cacheHits,this.stats.intraNodeCacheMisses=e.cacheMisses}visualize(){let e={lines:[],points:[],rects:[],circles:[]};for(let t of this.routes){let n=Abe(t.route,t.connectionName,this.colorMap[t.connectionName]);for(let o of n)e.lines.push({points:o.points,label:xzt(t.connectionName,t.rootConnectionName),strokeColor:o.z===0?o.color:zi(o.color,0.5),layer:`z${o.z}`,strokeWidth:t.traceThickness,strokeDash:o.z!==0?[0.1,0.3]:void 0});for(let o of t.vias)e.circles.push({center:o,layer:"z0,1",radius:t.viaDiameter/2,fill:this.colorMap[t.connectionName],label:xzt(t.connectionName,t.rootConnectionName,["via"])})}if(this.solved||this.failed)for(let[t,n]of this.nodeSolveMetadataById){let o=n.node.center.x-n.node.width/2,r=n.node.center.x+n.node.width/2,i=n.node.center.y-n.node.height/2,s=n.node.center.y+n.node.height/2,a=this.createNodeMarkerLabel(t,n),c=n.status==="solved"?"blue":"red";if(e.lines.push({points:[{x:o,y:i},{x:r,y:i}],layer:"hd_node_boundaries",strokeColor:c,strokeDash:"6, 4",strokeWidth:0.03,label:a},{points:[{x:r,y:i},{x:r,y:s}],layer:"hd_node_boundaries",strokeColor:c,strokeDash:"6, 4",strokeWidth:0.03,label:a},{points:[{x:r,y:s},{x:o,y:s}],layer:"hd_node_boundaries",strokeColor:c,strokeDash:"6, 4",strokeWidth:0.03,label:a},{points:[{x:o,y:s},{x:o,y:i}],layer:"hd_node_boundaries",strokeColor:c,strokeDash:"6, 4",strokeWidth:0.03,label:a}),n.status==="solved")e.points.push({x:n.node.center.x,y:n.node.center.y,color:c,layer:"hd_node_markers",label:a});else{e.lines.push({points:[{x:0,y:0},{x:n.node.center.x,y:n.node.center.y}],layer:"hd_failed_node_guides",strokeColor:"red",strokeDash:"8, 6",strokeWidth:0.05,label:a});let l=Math.max(0.1*n.node.width,0.12),h=Math.max(0.1*n.node.height,0.12);e.rects.push({center:n.node.center,layer:"hd_node_markers",width:l,height:h,fill:"red",label:a})}}return this.activeSubSolver&&(e=Bl(e,this.activeSubSolver.visualize())),e}};function Lrn(e,t){let n=[],o=t.filter((i)=>i._containsTarget),r=new Map;for(let i of e.connections){let s=[];for(let a of i.pointsToConnect){let c=t[0],l=Number.MAX_VALUE;for(let h of o){let d=Math.sqrt((h.center.x-a.x)**2+(h.center.y-a.y)**2);d<l&&(l=d,c=h)}s.push(c)}if(s.length<2)throw Error(`Not enough nodes for connection "${i.name}", only ${s.length} found`);r.set(i.name,s.map((a)=>a.capacityMeshNodeId)),n.push({connection:i,nodeIds:[s[0].capacityMeshNodeId,s[s.length-1].capacityMeshNodeId],straightLineDistance:kn(s[0].center,s[s.length-1].center)})}return{unshuffledConnectionsWithResults:n,connectionNameToGoalNodeIds:r}}function Hrn(e,t){let n=new Map(t.map((d)=>[d.capacityMeshNodeId,d])),o=t.map((d)=>(d.width+d.height)/2).filter((d)=>Number.isFinite(d)&&d>0),r=o.length>0?o.reduce((d,u)=>d+u,0)/o.length:1,i=t.filter((d)=>d._offBoardConnectionId),s=new Map,a=new Map,c=new Map;for(let d of t)a.set(d.capacityMeshNodeId,[]),c.set(d.capacityMeshNodeId,[]);for(let d of t)for(let u of d.portPoints){s.set(u.portPointId,u);for(let _ of u.connectionNodeIds){let p=a.get(_);p&&!p.some((m)=>m.portPointId===u.portPointId)&&p.push(u)}}let{unshuffledConnectionsWithResults:l,connectionNameToGoalNodeIds:h}=Lrn(e,t);return{nodeMap:n,avgNodePitch:r,offBoardNodes:i,portPointMap:s,nodePortPointsMap:a,nodeAssignedPortPoints:c,unshuffledConnectionsWithResults:l,connectionNameToGoalNodeIds:h}}var tP=(e,t=1,n={})=>{let o=n.viaDiameter??0.3,r="width"in e?e.width:e,i=n.obstacleMargin??0.2,s="height"in e&&typeof e.height=="number"?e.height:r;if(!Number.isFinite(r)||!Number.isFinite(s))return 0;if(r<=0||s<=0)return 0;let a=Math.min(r,s)/(o+i),c=(Math.sqrt(r*s)*Math.min(1.2,Math.max(0.85,a**0.05))/(o/2+i)/2)**1.1*t;return Number.isFinite(c)?e.availableZ?.length===1&&c>1?1:c:0},ik=(e,t=0.5,n=16)=>{let o=0,r=e;for(;o<n;){if(tP({width:r})<=t)break;r/=2,o++}return Math.max(1,o)},ex=(e,t,n,o)=>{if(e?._containsTarget)return 0;if((e.availableZ?.length??2)===1&&(t>0||n>0||o>0))return 1;let r=((0.82*t+0.41*n+0.2*o)/2)**1.1;if(!Number.isFinite(r))return 1;let i=tP(e);if(!Number.isFinite(i)||i<=0)return r>0?1:0;let s=r/i;if(Number.isNaN(s))throw Error("calculateNodeProbabilityOfFailure returned NaN");return Number.isFinite(s)?s:r>0?1:0};function Frn(e,t,n){let o=0,r=n?.NODE_MAX_PF??0.99999;for(let i of e){let s=t.get(i.capacityMeshNodeId);if(!s)continue;if(s._containsTarget)continue;let a=D_(i),c=Math.min(ex(s,a.numSameLayerCrossings,a.numEntryExitLayerChanges,a.numTransitionPairCrossings),r);o+=Math.log(1-c)}return o}function Czt(e,t){if(t._containsTarget)return 0;let n=D_(e);return ex(t,n.numSameLayerCrossings,n.numEntryExitLayerChanges,n.numTransitionPairCrossings)}function bzt(e,t,n,o,r){let i=n-t,s=r-o;if(Math.abs(e.y-r)<0.000001)return e.x-t;if(Math.abs(e.x-n)<0.000001)return i+(r-e.y);if(Math.abs(e.y-o)<0.000001)return i+s+(n-e.x);if(Math.abs(e.x-t)<0.000001)return 2*i+s+(e.y-o);let c=Math.abs(e.y-r),l=Math.abs(e.x-n),h=Math.abs(e.y-o),d=Math.abs(e.x-t),u=Math.min(c,l,h,d);return u===c?Math.max(0,Math.min(i,e.x-t)):u===l?i+Math.max(0,Math.min(s,r-e.y)):u===h?i+s+Math.max(0,Math.min(i,n-e.x)):2*i+s+Math.max(0,Math.min(s,e.y-o))}var D1r=5.120000000000001,ple=(e,t)=>{let n=Math.ceil(t/2),o=Math.min(e.width,e.height),r=Math.max(e.width,e.height),i=(Math.floor(o/1.6)+0.1)*(Math.floor(r/3.2)+0.1)/D1r;return Math.min(1,n/i)};function VKe(e,t,n,o){let r=t.x-n/2,i=t.x+n/2,s=t.y-o/2,a=t.y+o/2,c=Math.abs(e.y-a),l=Math.abs(e.x-i),h=Math.abs(e.y-s),d=Math.abs(e.x-r),u=Math.min(c,l,h,d);return u>0.001?"interior":u===c?"top":u===l?"right":u===h?"bottom":"left"}function Izt(e,t,n,o,r){let i=VKe(e,n,o,r),s=VKe(t,n,o,r);return i!=="interior"&&i===s}function vzt(e,t,n,o,r){let i=VKe(e,n,o,r),s;if(i==="top"||i==="bottom"){let l=o;s=Math.abs(t.x-e.x)/l}else{let l=r;s=Math.abs(t.y-e.y)/l}s=Math.min(1,Math.max(0,s));let a=(e.x+t.x)/2,c=(e.y+t.y)/2;return{x:a+(n.x-a)*s,y:c+(n.y-c)*s}}function H4e(e){return"computeNodePf"in e&&typeof e.computeNodePf=="function"}function YKe(e){let t={lines:[],points:[],rects:[],circles:[]};for(let o of e.inputNodes){let r=0,i=0,s={numSameLayerCrossings:0,numEntryExitLayerChanges:0,numTransitionPairCrossings:0},a=0;if(H4e(e)){r=e.computeNodePf(o),i=e.nodeMemoryPfMap.get(o.capacityMeshNodeId)??0;let d=e.buildNodeWithPortPointsForCrossing(o);s=D_(d);let u=new Set,_=e.nodeAssignedPortPoints.get(o.capacityMeshNodeId)??[];for(let p of _)p.connectionName&&u.add(p.connectionName);a=u.size}else{r=e.nodePfMap.get(o.capacityMeshNodeId)??0;let d=e.nodeAssignedPortPoints.get(o.capacityMeshNodeId)??[],u={capacityMeshNodeId:o.capacityMeshNodeId,center:o.center,width:o.width,height:o.height,portPoints:d,availableZ:o.availableZ};s=D_(u);let _=new Set;for(let p of d)p.connectionName&&_.add(p.connectionName);a=_.size}let c=Math.min(255,Math.floor(512*r)),l=Math.max(0,255-Math.floor(512*r)),h=`rgba(${c}, ${l}, ${l}, ${r<0.001?"0.1":"0.3"})`;o._containsObstacle&&(h="rgba(255, 0, 0, 0.3)"),o._offBoardConnectedCapacityMeshNodeIds?.length&&(h="rgba(255, 165, 0, 0.3)"),t.rects.push({center:o.center,width:o.width-0.2,height:o.height-0.2,layer:`z${o.availableZ.join(",")}`,fill:h,label:`${o.capacityMeshNodeId}
pf: ${r.toFixed(3)}, memPf: ${i.toFixed(3)}
C#: ${a}
xSame: ${s.numSameLayerCrossings}, xLC: ${s.numEntryExitLayerChanges}, xTransition: ${s.numTransitionPairCrossings}
obCmid: ${o._offBoardConnectedCapacityMeshNodeIds?.join(",")}
obs: ${o._containsObstacle?"yes":"no"}`})}if(H4e(e))for(let[o,r]of e.portPointMap){let i=e.assignedPortPoints.get(o),s=i?e.colorMap[i.connectionName]??"blue":"rgba(150, 150, 150, 0.5)";t.circles.push({center:{x:r.x,y:r.y},radius:0.05,fill:s,layer:`z${r.z}`,label:[o,`conn: ${i?.connectionName}`,`cd: ${r.distToCentermostPortOnZ}`,`connects: ${r.connectionNodeIds.join(",")}`,`rootConn: ${i?.rootConnectionName}`].filter(Boolean).join(`
`)})}let n=H4e(e)?e.connectionsWithResults:e.connectionResults;for(let o of n){if(!o.path)continue;let r=o.connection,i=e.colorMap[r.name]??"blue",s=[];for(let a of o.path)s.push({x:a.point.x,y:a.point.y,z:a.z,nodeId:a.currentNodeId});for(let a=0;a<s.length-1;a++){let c=s[a],l=s[a+1],h=c.z===l.z,d=c.z,u;u=h?d===0?void 0:"10 5":"3 3 10";let _=c.nodeId?e.nodeMap.get(c.nodeId):null;if(_&&Izt(c,l,_.center,_.width,_.height)){let p=vzt(c,l,_.center,_.width,_.height);t.lines.push({points:[{x:c.x,y:c.y},{x:p.x,y:p.y}],strokeColor:i,strokeDash:u}),t.lines.push({points:[{x:p.x,y:p.y},{x:l.x,y:l.y}],strokeColor:i,strokeDash:u})}else t.lines.push({points:[{x:c.x,y:c.y},{x:l.x,y:l.y}],strokeColor:i,strokeDash:u})}}if(H4e(e)&&!e.solved&&e.candidates&&e.candidates.length>0){let o=e.currentConnection,r=o?e.colorMap[o.connection.name]??"blue":"blue";if(o){let[s,a]=o.nodeIds,c=e.nodeMap.get(s),l=e.nodeMap.get(a),h=o.connection.pointsToConnect[0],d=o.connection.pointsToConnect[o.connection.pointsToConnect.length-1];if(c&&l){let u=h?{x:h.x,y:h.y}:c.center,_=d?{x:d.x,y:d.y}:l.center;t.lines.push({points:[u,_],strokeColor:zi(r,0.5),strokeDash:"5 5"}),t.points.push({x:u.x,y:u.y,color:r,label:[`Start: ${o.connection.name}`,`${o.connection.__rootConnectionNames?.[0]}`].join(`
`)}),t.points.push({x:_.x,y:_.y,color:r,label:[`End: ${o.connection.name}`,`${o.connection.__rootConnectionNames?.[0]}`].join(`
`)}),t.circles.push({center:_,radius:0.08,stroke:r,label:`Goal: ${o.connection.name}`})}}let i=[...e.candidates].sort((s,a)=>s.f-a.f).slice(0,1);for(let s of i){let a=[],c=s;for(;c;)a.unshift({x:c.point.x,y:c.point.y,z:c.z,lastMoveWasOffBoard:c.lastMoveWasOffBoard,nodeId:c.currentNodeId}),c=c.prevCandidate;for(let l=0;l<a.length-1;l++){let h=a[l],d=a[l+1],u=h.z===d.z,_=h.z,p;p=d.lastMoveWasOffBoard?"2 2":u?_===0?void 0:"10 5":"3 3 10";let m=h.nodeId?e.nodeMap.get(h.nodeId):null,A=0.02*h.z;if(m&&Izt(h,d,m.center,m.width,m.height)){let g=vzt(h,d,m.center,m.width,m.height);t.lines.push({points:[{x:h.x+A,y:h.y+A},{x:g.x+A,y:g.y+A}],strokeColor:zi(r,0.25),strokeDash:p}),t.lines.push({points:[{x:g.x+A,y:g.y+A},{x:d.x+A,y:d.y+A}],strokeColor:zi(r,0.25),strokeDash:p})}else t.lines.push({points:[{x:h.x+A,y:h.y+A},{x:d.x+A,y:d.y+A}],strokeColor:zi(r,0.25),strokeDash:p})}if(a.length>=1){let l=a[a.length-1],h=0,d=0,u=0,_=0,p=0,m=0,A=e.nodeMap.get(s.prevCandidate?.currentNodeId);if(A&&s.prevCandidate&&s.portPoint&&o){let P=o.connection.name,M={x:s.prevCandidate.point.x,y:s.prevCandidate.point.y,z:s.prevCandidate.z,connectionName:P},B={x:s.portPoint.x,y:s.portPoint.y,z:s.portPoint.z,connectionName:P},T=e.buildNodeWithPortPointsForCrossing(A,[M,B]),N=HUt(T);u=N.numSameLayerCrossings,_=N.numTransitionPairCrossings,p=N.numEntryExitLayerChanges;let D=e.capacityMeshNodeMap.get(A.capacityMeshNodeId);D&&(d=e.JUMPER_PF_FN_ENABLED&&A.availableZ.length===1?ple(D,u):ex(D,u,p,_),h=d**2*e.NODE_PF_FACTOR),m=s.prevCandidate.g>0?s.g-s.prevCandidate.g:s.g}if(!o)continue;let[g,f]=o.nodeIds,y=e.nodeMap.get(f),x=y?Math.sqrt((l.x-y.center.x)**2+(l.y-y.center.y)**2):0,C=e.avgNodePitch>0?x/e.avgNodePitch:0,b=C*e.BASE_CANDIDATE_COST,I=e.nodeMemoryPfMap.get(s.currentNodeId)??0,v=-Math.log(1-I)*e.MEMORY_PF_FACTOR;t.circles.push({center:l,radius:0.03,fill:zi(r,0.25),layer:`z${s.z}`,label:[`f: ${s.f.toFixed(2)}`,`g: ${s.g.toFixed(2)} (nodeDelta: ${m.toFixed(2)})`,`h: ${s.h.toFixed(2)}`,`  dist: ${x.toFixed(2)}`,`  estHops: ${C.toFixed(1)}`,`  estStepCost: ${b.toFixed(2)}`,`  memRiskCost: ${v.toFixed(2)}`,`z: ${s.z}`,`node: ${s.currentNodeId}`,`Cost(Pf): ${h.toFixed(3)}`,`Pf: ${d.toFixed(3)}`,`xSame: ${u}, xTrans: ${_}, xLC: ${p}`,`routeOffBoard=${e.currentConnectionShouldRouteOffBoard}`,`offBoardTouched=${s.hasTouchedOffBoardNode??!1}`,`lastMoveWasOffBoard=${s.lastMoveWasOffBoard??!1}`].join(`
`)})}}}return t}function zrn(e,t,n){let o=0,r=n?.NODE_MAX_PF??0.99999;for(let i of e){let s=t.get(i.capacityMeshNodeId);if(!s)continue;if(s._containsTarget)continue;let a=D_(i),c=Math.min(ple(s,a.numSameLayerCrossings),r);o+=Math.log(1-c)}return o}var N1r=class extends ei{constructor(e){super(),this.input=e;let{simpleRouteJson:t,capacityMeshNodes:n,inputNodes:o,colorMap:r,nodeMemoryPfMap:i,hyperParameters:s,precomputedInitialParams:a,fixedRoutes:c}=e;if(this.input=structuredClone(e),this.MAX_ITERATIONS=1e8,this.simpleRouteJson=t,this.inputNodes=o,this.colorMap=r??{},this.capacityMeshNodeMap=new Map(n.map((l)=>[l.capacityMeshNodeId,l])),this.nodeMemoryPfMap=i??new Map,this.hyperParameters=s??{},a){this.nodeMap=a.nodeMap,this.avgNodePitch=a.avgNodePitch,this.offBoardNodes=a.offBoardNodes,this.portPointMap=a.portPointMap,this.nodePortPointsMap=a.nodePortPointsMap,this.connectionNameToGoalNodeIds=a.connectionNameToGoalNodeIds;let{nodeAssignedPortPoints:l}=function(h){let d=new Map;for(let[u,_]of h.nodeAssignedPortPoints)d.set(u,[..._]);return{nodeAssignedPortPoints:d}}(a);this.nodeAssignedPortPoints=l,this.connectionsWithResults=e6(structuredClone(a.unshuffledConnectionsWithResults),this.hyperParameters.SHUFFLE_SEED??0)}else{this.nodeMap=new Map(o.map((u)=>[u.capacityMeshNodeId,u]));let l=o.map((u)=>(u.width+u.height)/2).filter((u)=>Number.isFinite(u)&&u>0);this.avgNodePitch=l.length>0?l.reduce((u,_)=>u+_,0)/l.length:1,this.offBoardNodes=o.filter((u)=>u._offBoardConnectionId),this.portPointMap=new Map,this.nodePortPointsMap=new Map;for(let u of o)this.nodePortPointsMap.set(u.capacityMeshNodeId,[]),this.nodeAssignedPortPoints.set(u.capacityMeshNodeId,[]);for(let u of o)for(let _ of u.portPoints){this.portPointMap.set(_.portPointId,_);for(let p of _.connectionNodeIds){let m=this.nodePortPointsMap.get(p);m&&!m.some((A)=>A.portPointId===_.portPointId)&&m.push(_)}}let{connectionsWithResults:h,connectionNameToGoalNodeIds:d}=this.getConnectionsWithNodes();this.connectionsWithResults=h,this.connectionNameToGoalNodeIds=d}if(c&&c.length>0){for(let l of c)if(this.connectionsWithResults.push(l),l.portPoints)for(let h of l.portPoints)h.portPointId&&this.assignedPortPoints.set(h.portPointId,{connectionName:h.connectionName,rootConnectionName:h.rootConnectionName})}for(let l of this.connectionsWithResults)l.path?this.processedConnectionQueue.push(l):this.unprocessedConnectionQueue.push(l);this.totalConnectionCount=this.connectionsWithResults.length}input;getSolverName(){return"PortPointPathingSolver"}hyperParameters;simpleRouteJson;inputNodes;nodeMap;nodePortPointsMap;portPointMap;connectionsWithResults=[];failedConnection=null;assignedPortPoints=new Map;nodeAssignedPortPoints=new Map;PORT_POINT_REUSE_FACTOR=1000;BASE_COST_FOR_NOT_GOING_OFF_BOARD=100;get NODE_PF_FACTOR(){return this.hyperParameters.NODE_PF_FACTOR??50}get RANDOM_WALK_DISTANCE(){return this.hyperParameters.RANDOM_WALK_DISTANCE??0}get MEMORY_PF_FACTOR(){return this.hyperParameters.MEMORY_PF_FACTOR??0}get CENTER_OFFSET_FOCUS_SHIFT(){return this.hyperParameters.CENTER_OFFSET_FOCUS_SHIFT??0}get RANDOM_COST_MAGNITUDE(){return this.hyperParameters.RANDOM_COST_MAGNITUDE??0}get BASE_CANDIDATE_COST(){return this.hyperParameters.BASE_CANDIDATE_COST??0}get NODE_PF_MAX_PENALTY(){return this.hyperParameters.NODE_PF_MAX_PENALTY??1e4}get FORCE_CENTER_FIRST(){return this.hyperParameters.FORCE_CENTER_FIRST??!0}get FORCE_OFF_BOARD_FREQUENCY(){return this.offBoardNodes.length===0?0:this.hyperParameters.FORCE_OFF_BOARD_FREQUENCY??0}get FORCE_OFF_BOARD_SEED(){return this.hyperParameters.FORCE_OFF_BOARD_SEED??0}get NODE_MAX_PF(){return Math.min(0.99999,1-Math.exp(-this.NODE_PF_MAX_PENALTY))}get CENTER_OFFSET_DIST_PENALTY_FACTOR(){return this.hyperParameters.CENTER_OFFSET_DIST_PENALTY_FACTOR??0}get STRAIGHT_LINE_DEVIATION_PENALTY_FACTOR(){return this.hyperParameters.STRAIGHT_LINE_DEVIATION_PENALTY_FACTOR??0}colorMap;get GREEDY_MULTIPLIER(){return this.hyperParameters.GREEDY_MULTIPLIER??1.3}MAX_CANDIDATES_IN_MEMORY=5000;get MAX_ITERATIONS_PER_PATH(){return this.hyperParameters.MAX_ITERATIONS_PER_PATH??1e4}ITERATIONS_PER_MM_FOR_PATH=30;BASE_ITERATIONS_PER_PATH=1e4;get RIPPING_ENABLED(){return this.hyperParameters.RIPPING_ENABLED??!1}get RIPPING_PF_THRESHOLD(){let e=this.hyperParameters.START_RIPPING_PF_THRESHOLD,t=this.hyperParameters.END_RIPPING_PF_THRESHOLD;if(e!==void 0&&t!==void 0){let n=this.MAX_RIPS;return e+(n>0?this.totalRipCount/n:0)*(t-e)}return this.hyperParameters.RIPPING_PF_THRESHOLD??0.3}get MAX_RIPS(){return this.hyperParameters.MAX_RIPS??100}get RANDOM_RIP_FRACTION(){return this.hyperParameters.RANDOM_RIP_FRACTION??0}get JUMPER_PF_FN_ENABLED(){return this.hyperParameters.JUMPER_PF_FN_ENABLED??!1}jumpersPerMmSquared=0.1;testedRipConnections=new Map;totalRipCount=0;get MIN_ALLOWED_BOARD_SCORE(){return this.hyperParameters.MIN_ALLOWED_BOARD_SCORE??-1e4}nodeMemoryPfMap;unprocessedConnectionQueue=[];processedConnectionQueue=[];currentConnection=null;totalConnectionCount=0;currentPathIterations=0;candidates;visitedPortPoints;connectionNameToGoalNodeIds;capacityMeshNodeMap;avgNodePitch;currentConnectionShouldRouteOffBoard=!1;activeCandidateStraightLineDistance;offBoardNodes=[];baseNodeCostCache=new Map;getConstructorParams(){return this.input}clearCostCaches(){this.baseNodeCostCache.clear()}clampPf(e){return Number.isFinite(e)?Math.min(Math.max(e,0),0.999999):0.999999}pfToFailureCost(e){let t=this.clampPf(e);return t>=this.NODE_MAX_PF?this.NODE_PF_MAX_PENALTY:-Math.log(1-t)}getBaseNodeFailureCost(e){let t=this.baseNodeCostCache.get(e);if(t!=null)return t;let n=this.nodeMap.get(e);if(!n)return 0;let o=this.computeNodePf(n),r=this.pfToFailureCost(o);return this.baseNodeCostCache.set(e,r),r}computeBoardScore(){let e=this.getNodesWithPortPoints();return this.JUMPER_PF_FN_ENABLED?zrn(e,this.capacityMeshNodeMap):Frn(e,this.capacityMeshNodeMap)}getMaxIterationsForCurrentPath(){let e=this.activeCandidateStraightLineDistance??0;return Math.min(this.BASE_ITERATIONS_PER_PATH+this.ITERATIONS_PER_MM_FOR_PATH*e,this.MAX_ITERATIONS_PER_PATH)}getNodeDeltaFailureCostForSegment(e,t,n){let o=this.nodeMap.get(e);if(!o)return 0;let r=this.getBaseNodeFailureCost(e),i=this.computeNodePf(o,[t,n]),s=this.pfToFailureCost(i),a=Math.max(0,s-r);return i>=this.NODE_MAX_PF?this.NODE_PF_MAX_PENALTY:a*this.NODE_PF_FACTOR}getConnectionsWithNodes(){let{unshuffledConnectionsWithResults:e,connectionNameToGoalNodeIds:t}=Lrn(this.simpleRouteJson,this.inputNodes);return{connectionsWithResults:e6(e,this.hyperParameters.SHUFFLE_SEED??0),connectionNameToGoalNodeIds:t}}buildNodeWithPortPointsForCrossing(e,t){let n=this.nodeAssignedPortPoints.get(e.capacityMeshNodeId)??[],o=t?[...n,...t]:n;return{capacityMeshNodeId:e.capacityMeshNodeId,center:e.center,width:e.width,height:e.height,portPoints:o,availableZ:e.availableZ}}computeNodePf(e,t){if(e._containsTarget)return 0;let n=this.buildNodeWithPortPointsForCrossing(e,t),o=D_(n);return this.JUMPER_PF_FN_ENABLED&&e.availableZ.length===1?ple(this.capacityMeshNodeMap.get(e.capacityMeshNodeId),o.numSameLayerCrossings):ex(this.capacityMeshNodeMap.get(e.capacityMeshNodeId),o.numSameLayerCrossings,o.numEntryExitLayerChanges,o.numTransitionPairCrossings)}getPortPointReusePenalty(e,t){let n=this.assignedPortPoints.get(e);return n?t===n.rootConnectionName?0:this.PORT_POINT_REUSE_FACTOR:0}getOtherNodeId(e,t){let[n,o]=e.connectionNodeIds;return n===t?o:o===t?n:null}computeG(e,t,n,o,r){let{currentNodeId:i,point:s}=e,a={x:s.x,y:s.y,z:e.z,connectionName:o,rootConnectionName:r},c={x:t.x,y:t.y,z:t.z,connectionName:o,rootConnectionName:r},l=this.getNodeDeltaFailureCostForSegment(i,a,c);return e.g+l}computeGToEndTarget(e,t,n,o){let r=e.currentNodeId,i={x:e.point.x,y:e.point.y,z:e.z,connectionName:n,rootConnectionName:o},s={x:t.x,y:t.y,z:e.z,connectionName:n,rootConnectionName:o},a=this.getNodeDeltaFailureCostForSegment(r,i,s);return e.g+a}computeDistanceToNearestOffBoardNode(e){if(this.offBoardNodes.length===0)return 1/0;let t=1/0;for(let n of this.offBoardNodes){let o=kn(e,n.center);o<t&&(t=o)}return t}computeH(e,t,n,o,r,i){if(this.RANDOM_WALK_DISTANCE>0&&r<this.RANDOM_WALK_DISTANCE)return 0;if(this.currentConnectionShouldRouteOffBoard&&!i)return this.BASE_COST_FOR_NOT_GOING_OFF_BOARD+this.computeDistanceToNearestOffBoardNode(e);let s=this.nodeMap.get(n);if(!s)return 0;let a=kn(e,s.center),c=this.avgNodePitch>0?a/this.avgNodePitch:0,l=this.clampPf(this.nodeMemoryPfMap.get(t)??0),h=this.pfToFailureCost(l)*this.MEMORY_PF_FACTOR,d=c*this.BASE_CANDIDATE_COST,u=this.CENTER_OFFSET_DIST_PENALTY_FACTOR*e.distToCentermostPortOnZ**2,_=0;if(this.STRAIGHT_LINE_DEVIATION_PENALTY_FACTOR>0&&this.currentConnection){let p=xc(e,this.currentConnection.connection.pointsToConnect[0],this.currentConnection.connection.pointsToConnect[1]);_=this.STRAIGHT_LINE_DEVIATION_PENALTY_FACTOR*p}return a+d+h+u+_}getVisitedPortPointKey(e,t){return this.currentConnectionShouldRouteOffBoard&&t?`${e}:touched_off_board`:e}getAvailableExitPortPoints(e,t){let n=this.currentConnection?.connection.__rootConnectionNames?.[0],o=this.nodePortPointsMap.get(e)??[],r=[];for(let i of o){let s=this.getVisitedPortPointKey(i.portPointId,t);if(this.visitedPortPoints?.has(s))continue;let a=this.assignedPortPoints.get(i.portPointId);a&&a?.rootConnectionName!==n||r.push(i)}return r}getAvailableExitPortPointsWithOmissions(e,t,n){let o=this.nodePortPointsMap.get(e)??[],r=this.currentConnection?.connection.__rootConnectionNames?.[0],i=new Map;for(let a of o){let c=this.getVisitedPortPointKey(a.portPointId,n);if(this.visitedPortPoints?.has(c))continue;let l=this.getOtherNodeId(a,e);if(!l)continue;this.nodeMap.get(l);let h=`${l}|${a.z}`,d=i.get(h)??[];d.push(a),i.set(h,d)}let s=[];for(let[,a]of i){a.sort((p,m)=>p.distToCentermostPortOnZ-m.distToCentermostPortOnZ);let c=a[0];if(!c)continue;let l=this.assignedPortPoints.get(c.portPointId),h=l&&l.rootConnectionName===r;if(!l||h){s.push(c);continue}let d=[...a].sort((p,m)=>p.x!==m.x?p.x-m.x:p.y-m.y),u=[],_=[];for(let p of d){let m=this.assignedPortPoints.get(p.portPointId);!m||m.rootConnectionName===r?_.push(p):_.length>0&&(u.push(_),_=[])}_.length>0&&u.push(_);for(let p of u){let m=Math.floor(p.length/2);s.push(p[m])}}return s}getAvailableExitPortPointsForOffboardConnection(e,t){let n=this.nodeMap.get(e);if(!n)return[];let o=this.currentConnection?.connection.__rootConnectionNames?.[0],r=[];for(let i of n?._offBoardConnectedCapacityMeshNodeIds??[]){if(i===e)continue;if(!this.nodeMap.get(i))continue;let s=this.nodePortPointsMap.get(i)??[];for(let a of s){let c=this.getVisitedPortPointKey(a.portPointId,t);if(this.visitedPortPoints?.has(c))continue;let l=this.assignedPortPoints.get(a.portPointId);l&&l.rootConnectionName!==o||r.push({...a,throughNodeId:i})}}return r}canTravelThroughObstacle(e,t,n){return this.connectionNameToGoalNodeIds.get(t)?.includes(e.capacityMeshNodeId)||Boolean(e._offBoardConnectionId)}isAtEndGoal(e,t){return e===t}getBacktrackedPath(e){let t=[],n=e;for(;n;){if(n.lastMoveWasOffBoard&&n.throughNodeId){let o=this.nodeMap.get(n.throughNodeId),r=n.prevCandidate?this.nodeMap.get(n.prevCandidate.currentNodeId):null;t.push(n),o&&t.push({prevCandidate:null,portPoint:null,currentNodeId:n.throughNodeId,point:o.center,z:n.z,f:0,g:0,h:0,distanceTraveled:0}),r&&r._offBoardConnectionId&&t.push({prevCandidate:null,portPoint:null,currentNodeId:n.prevCandidate.currentNodeId,point:r.center,z:n.z,f:0,g:0,h:0,distanceTraveled:0})}else t.push(n);n=n.prevCandidate}return t.reverse()}assignPortPointsForPath(e,t,n){let o=[];for(let a=0;a<e.length;a++){let c=e[a];if(!c.portPoint){let d=a===0,u=a===e.length-1;if(!d&&!u){let _={x:c.point.x,y:c.point.y,z:c.z,connectionName:t,rootConnectionName:n};o.push(_);let p=this.nodeAssignedPortPoints.get(c.currentNodeId)??[];p.push(_),this.nodeAssignedPortPoints.set(c.currentNodeId,p)}continue}let l=c.portPoint;this.assignedPortPoints.set(l.portPointId,{connectionName:t,rootConnectionName:n});let h={portPointId:l.portPointId,x:l.x,y:l.y,z:l.z,connectionName:t,rootConnectionName:n,prevPortPointId:l.prevPortPointId,nextPortPointId:l.nextPortPointId};o.push(h);for(let d of l.connectionNodeIds){let u=this.nodeAssignedPortPoints.get(d)??[];u.push(h),this.nodeAssignedPortPoints.set(d,u)}}let r=o.map((a)=>a.portPointId).filter((a)=>Boolean(a)),i=0;for(let a of o)a.portPointId&&(a.prevPortPointId=r[i-1],a.nextPortPointId=r[i+1],i+=1);let s=Array.from(new Set(e.map((a)=>a.currentNodeId)));for(let a of s){let c=this.nodeMap.get(a);if(c&&c._offBoardConnectionId)for(let l of c?._offBoardConnectedCapacityMeshNodeIds??[]){let h=this.nodePortPointsMap.get(l)??[];for(let d of h)this.assignedPortPoints.set(d.portPointId,{connectionName:t,rootConnectionName:n})}}return o}addTargetPointsToNodes(e,t){let n=e[0],o=e[e.length-1],r=t.pointsToConnect[0],i=t.pointsToConnect[t.pointsToConnect.length-1];if(n&&r){let s=this.nodeAssignedPortPoints.get(n.currentNodeId)??[];s.push({x:r.x,y:r.y,z:n.z,connectionName:t.name,rootConnectionName:t.__rootConnectionNames?.[0]}),this.nodeAssignedPortPoints.set(n.currentNodeId,s)}if(o&&i){let s=this.nodeAssignedPortPoints.get(o.currentNodeId)??[];s.push({x:i.x,y:i.y,z:o.z,connectionName:t.name,rootConnectionName:t.__rootConnectionNames?.[0]}),this.nodeAssignedPortPoints.set(o.currentNodeId,s)}}isPortPointInPathChain(e,t){let n=e;for(;n;){if(n.portPoint?.portPointId===t)return!0;n=n.prevCandidate}return!1}isNodeInPathChain(e,t){let n=e;for(;n;){if(n.currentNodeId===t)return!0;n=n.prevCandidate}return!1}_step(){if(this.currentConnection||(this.currentConnection=this.unprocessedConnectionQueue.shift()??null),!this.currentConnection){let u=this.computeBoardScore();return this.stats={boardScore:u,totalRipCount:this.totalRipCount},u<this.MIN_ALLOWED_BOARD_SCORE?(this.failedConnection=null,this.failed=!0,void(this.error=`Board score ${u.toFixed(2)} is less than MIN_ALLOWED_BOARD_SCORE ${this.MIN_ALLOWED_BOARD_SCORE.toFixed(2)}`)):void(this.solved=!0)}let e=this.currentConnection;this.activeCandidateStraightLineDistance=e.straightLineDistance,this.currentPathIterations++;let t=this.getMaxIterationsForCurrentPath();if(this.currentPathIterations>t)return this.failedConnection=e,this.processedConnectionQueue.push(e),this.currentConnection=null,this.candidates=null,this.visitedPortPoints=null,this.currentPathIterations=0,this.failed=!0,void(this.error=`Exceeded max iterations for path (${t}) on connection ${e.connection.name}`);let[n,o]=e.nodeIds,r=this.nodeMap.get(n),i=this.nodeMap.get(o);if(!r||!i)return this.processedConnectionQueue.push(e),this.currentConnection=null,void(this.currentPathIterations=0);let s=e.connection.name,a=e.connection.__rootConnectionNames?.[0],c=e.connection.pointsToConnect[0];if(!this.candidates){if(this.clearCostCaches(),this.FORCE_OFF_BOARD_FREQUENCY>0){let u=nqe(17*(this.hyperParameters.SHUFFLE_SEED??0)+this.FORCE_OFF_BOARD_SEED+this.processedConnectionQueue.length);this.currentConnectionShouldRouteOffBoard=u()<this.FORCE_OFF_BOARD_FREQUENCY}else this.currentConnectionShouldRouteOffBoard=!1;this.candidates=[],this.visitedPortPoints=new Set;for(let u of r.availableZ){let _=c?{x:c.x,y:c.y}:r.center,p={portPointId:`start:${n}:${u}`,x:_.x,y:_.y,z:u,connectionNodeIds:[n,n],distToCentermostPortOnZ:0},m=this.computeH(p,n,o,u,0,!1),A=0+m*this.GREEDY_MULTIPLIER;this.candidates.push({prevCandidate:null,portPoint:null,currentNodeId:n,point:_,z:u,f:A,g:0,h:m,distanceTraveled:0,hasTouchedOffBoardNode:!1})}}this.candidates.sort((u,_)=>u.f-_.f);let l,h=this.candidates.shift();for(;h?.portPoint&&this.visitedPortPoints;){let u=this.getVisitedPortPointKey(h.portPoint.portPointId,h.hasTouchedOffBoardNode);if(!this.visitedPortPoints.has(u))break;h=this.candidates.shift()}if(this.candidates.length>this.MAX_CANDIDATES_IN_MEMORY&&this.candidates.splice(this.MAX_CANDIDATES_IN_MEMORY,this.candidates.length-this.MAX_CANDIDATES_IN_MEMORY),!h)return this.error=`Ran out of candidates on connection ${s}`,this.failedConnection=e,this.processedConnectionQueue.push(e),this.currentConnection=null,this.candidates=null,this.visitedPortPoints=null,this.currentPathIterations=0,void(this.failed=!0);if(h.portPoint&&this.visitedPortPoints){let u=this.getVisitedPortPointKey(h.portPoint.portPointId,h.hasTouchedOffBoardNode);this.visitedPortPoints.add(u)}if(this.isAtEndGoal(h.currentNodeId,o)){let u=e.connection.pointsToConnect[e.connection.pointsToConnect.length-1],_=u?{x:u.x,y:u.y}:i.center,p=this.computeGToEndTarget(h,_,s,a),m={prevCandidate:h,portPoint:null,currentNodeId:o,point:_,z:h.z,g:p,h:0,f:p,distanceTraveled:h.distanceTraveled+kn(h.point,_)},A=this.getBacktrackedPath(m);return e.path=A,e.portPoints=this.assignPortPointsForPath(A,s,a),this.addTargetPointsToNodes(A,e.connection),this.clearCostCaches(),this.RIPPING_ENABLED&&this.processRippingForPath(A,s),this.processedConnectionQueue.push(e),this.currentConnection=null,this.progress=this.processedConnectionQueue.length/this.totalConnectionCount,this.candidates=null,this.visitedPortPoints=null,void(this.currentPathIterations=0)}let d=this.nodeMap.get(h.currentNodeId);l=d?._offBoardConnectionId?this.getAvailableExitPortPointsForOffboardConnection(h.currentNodeId,h.hasTouchedOffBoardNode):this.FORCE_CENTER_FIRST?this.getAvailableExitPortPointsWithOmissions(h.currentNodeId,o,h.hasTouchedOffBoardNode):this.getAvailableExitPortPoints(h.currentNodeId,h.hasTouchedOffBoardNode);for(let u of l){if(this.isPortPointInPathChain(h,u.portPointId))continue;if(this.visitedPortPoints?.has(u.portPointId))continue;let _=this.getOtherNodeId(u,u.throughNodeId??h.currentNodeId);if(!_)continue;if(this.isNodeInPathChain(h,_))continue;let p="throughNodeId"in u?u.throughNodeId:void 0,m=p?this.nodeMap.get(p):null,A=this.nodeMap.get(_);if(!A)continue;if(A._containsObstacle&&!this.canTravelThroughObstacle(A,s,a))continue;let g=this.computeG(h,u,_,s,a);if(!this.RIPPING_ENABLED&&g>-this.MIN_ALLOWED_BOARD_SCORE)continue;let f=h.distanceTraveled+kn(h.point,u),y=h.hasTouchedOffBoardNode||Boolean(A._offBoardConnectionId),x=this.computeH(u,_,o,u.z,f,y),C=g+x*this.GREEDY_MULTIPLIER,b=Boolean(d?._offBoardConnectionId)&&Boolean(m?._offBoardConnectionId);this.candidates.push({prevCandidate:h,portPoint:u,currentNodeId:_,point:{x:u.x,y:u.y},z:u.z,f:C,g,h:x,distanceTraveled:f,lastMoveWasOffBoard:b,throughNodeId:b?p:void 0,hasTouchedOffBoardNode:y||Boolean(A._offBoardConnectionId)||Boolean(d?._offBoardConnectionId)})}}getNodesWithPortPoints(){let e=[];for(let t of this.inputNodes){let n=this.nodeAssignedPortPoints.get(t.capacityMeshNodeId)??[];n.length>0&&e.push({capacityMeshNodeId:t.capacityMeshNodeId,center:t.center,width:t.width,height:t.height,portPoints:n,availableZ:t.availableZ})}return e}getConnectionsInNode(e,t){let n=[],o=new Set;for(let r of this.connectionsWithResults)if(r.path&&r.connection.name!==t&&!o.has(r.connection.name)){for(let i of r.path)if(i.currentNodeId===e){n.push(r),o.add(r.connection.name);break}}return n}computeNodePfWithoutConnection(e,t){if(e._containsTarget)return{pf:0,totalCrossings:0};let n=(this.nodeAssignedPortPoints.get(e.capacityMeshNodeId)??[]).filter((s)=>s.connectionName!==t),o={capacityMeshNodeId:e.capacityMeshNodeId,center:e.center,width:e.width,height:e.height,portPoints:n,availableZ:e.availableZ},r=D_(o),i=r.numSameLayerCrossings+r.numEntryExitLayerChanges+r.numTransitionPairCrossings;return{pf:ex(this.capacityMeshNodeMap.get(e.capacityMeshNodeId),r.numSameLayerCrossings,r.numEntryExitLayerChanges,r.numTransitionPairCrossings),totalCrossings:i}}computeNodeCrossings(e){if(e._containsTarget)return 0;let t=this.buildNodeWithPortPointsForCrossing(e),n=D_(t);return n.numSameLayerCrossings+n.numEntryExitLayerChanges+n.numTransitionPairCrossings}ripConnection(e){let t=e.connection.name;for(let[n,o]of this.assignedPortPoints.entries())o.connectionName===t&&this.assignedPortPoints.delete(n);for(let[n,o]of this.nodeAssignedPortPoints.entries()){let r=o.filter((i)=>i.connectionName!==t);this.nodeAssignedPortPoints.set(n,r)}e.path=void 0,e.portPoints=void 0}requeueConnection(e){this.totalRipCount++;let t=this.processedConnectionQueue.indexOf(e);if(t!==-1)return this.processedConnectionQueue.splice(t,1),this.unprocessedConnectionQueue.push(e),!0;let n=this.unprocessedConnectionQueue.indexOf(e);return n!==-1&&(this.unprocessedConnectionQueue.splice(n,1),this.unprocessedConnectionQueue.unshift(e)),!0}processRippingForPath(e,t){let n=Array.from(new Set(e.map((r)=>r.currentNodeId))),o=!1;for(let r of n){if(this.totalRipCount>this.MAX_RIPS)break;let i=this.nodeMap.get(r);if(!i)continue;let s=this.computeNodePf(i);if(s<=this.RIPPING_PF_THRESHOLD)continue;this.testedRipConnections.has(r)||this.testedRipConnections.set(r,new Set);let a=this.testedRipConnections.get(r),c=e6(this.getConnectionsInNode(r,t),(this.hyperParameters.SHUFFLE_SEED??0)+this.processedConnectionQueue.length);for(let l of c){if(s<=this.RIPPING_PF_THRESHOLD)break;let h=l.connection.name;a.add(h);let{pf:d}=this.computeNodePfWithoutConnection(i,h);if(this.ripConnection(l),!this.requeueConnection(l))return;s=d,o=!0,this.clearCostCaches()}}o&&this.RANDOM_RIP_FRACTION>0&&this.processRandomRipping(t)}processRandomRipping(e){let t=this.processedConnectionQueue.filter((r)=>r.path!==void 0&&r.connection.name!==e);if(t.length===0)return;let n=Math.max(1,Math.floor(this.RANDOM_RIP_FRACTION*t.length)),o=e6(t,(this.hyperParameters.SHUFFLE_SEED??0)+this.totalRipCount+this.processedConnectionQueue.length);for(let r=0;r<n&&r<o.length&&!(this.totalRipCount>this.MAX_RIPS);r++){let i=o[r];if(this.ripConnection(i),!this.requeueConnection(i))return;this.clearCostCaches()}}visualize(){let e={};if(this.failed){let t=this.failedConnection?.connection.pointsToConnect[0],n=this.failedConnection?.connection.pointsToConnect[1];t&&n&&(e={lines:[{points:[t,n],label:`Failed Connection ${this.failedConnection?.connection.name}`,strokeWidth:1,strokeColor:"red",strokeDash:[2,2]}]})}return pV(YKe(this),e)}},IZe=class extends ybe{getSolverName(){return"HyperPortPointPathingSolver"}params;precomputedInitialParams;constructor(e){super(),this.params=e,this.MAX_ITERATIONS=1e8,this.GREEDY_MULTIPLIER=1.2,this.MIN_SUBSTEPS=50,this.precomputedInitialParams=e.precomputedInitialParams??Hrn(e.simpleRouteJson,e.inputNodes)}getHyperParameterDefs(){let e=this.params.numShuffleSeeds??50;return[{name:"SHUFFLE_SEED",possibleValues:Array.from({length:e},(t,n)=>({SHUFFLE_SEED:n+1700*(this.params.hyperParameters?.SHUFFLE_SEED??0)}))}]}getCombinationDefs(){return[["SHUFFLE_SEED"]]}generateSolver(e){return new N1r({simpleRouteJson:this.params.simpleRouteJson,capacityMeshNodes:this.params.capacityMeshNodes,inputNodes:this.params.inputNodes,colorMap:this.params.colorMap,nodeMemoryPfMap:this.params.nodeMemoryPfMap,hyperParameters:{...this.params.hyperParameters,...e,MIN_ALLOWED_BOARD_SCORE:this.params.minAllowedBoardScore??e.MIN_ALLOWED_BOARD_SCORE??this.params.hyperParameters?.MIN_ALLOWED_BOARD_SCORE},precomputedInitialParams:this.precomputedInitialParams,fixedRoutes:this.params.fixedRoutes})}computeG(e){return-e.computeBoardScore()}computeH(e){let t=e.progress||0;if(t<0.1)return 0;return-(e.computeBoardScore()/t)*(1-t)}getNodesWithPortPoints(){if(this.winningSolver)return this.winningSolver.getNodesWithPortPoints();let e=this.getSupervisedSolverWithBestFitness();return e?e.solver.getNodesWithPortPoints():[]}get connectionsWithResults(){if(this.winningSolver)return this.winningSolver.connectionsWithResults;let e=this.getSupervisedSolverWithBestFitness();return e?e.solver.connectionsWithResults:[]}get inputNodes(){if(this.winningSolver)return this.winningSolver.inputNodes;let e=this.getSupervisedSolverWithBestFitness();return e?e.solver.inputNodes:this.params.inputNodes}get nodeMap(){if(this.winningSolver)return this.winningSolver.nodeMap;let e=this.getSupervisedSolverWithBestFitness();return e?e.solver.nodeMap:new Map(this.params.inputNodes.map((t)=>[t.capacityMeshNodeId,t]))}get assignedPortPoints(){if(this.winningSolver)return this.winningSolver.assignedPortPoints;let e=this.getSupervisedSolverWithBestFitness();return e?e.solver.assignedPortPoints:new Map}get nodeAssignedPortPoints(){if(this.winningSolver)return this.winningSolver.nodeAssignedPortPoints;let e=this.getSupervisedSolverWithBestFitness();return e?e.solver.nodeAssignedPortPoints:new Map}computeNodePf(e){if(this.winningSolver)return this.winningSolver.computeNodePf(e);let t=this.getSupervisedSolverWithBestFitness();return t?t.solver.computeNodePf(e):null}computeBoardScore(){if(this.winningSolver)return this.winningSolver.computeBoardScore();let e=this.getSupervisedSolverWithBestFitness();return e?e.solver.computeBoardScore():0}onSolve(e){this.stats={...e.solver.stats,winningHyperParameters:this.winningSolver?.hyperParameters}}visualize(){return this.winningSolver?this.winningSolver.visualize():super.visualize()}};function Szt(e){let t=e;return()=>{t+=1831565813;let n=t;return n=Math.imul(n^n>>>15,1|n),n^=n+Math.imul(n^n>>>7,61|n),((n^n>>>14)>>>0)/4294967296}}var R1r=[{SHUFFLE_SEED:100,NODE_PF_FACTOR:100,NODE_PF_MAX_PENALTY:100,MEMORY_PF_FACTOR:0,EXPANSION_DEGREES:10,FORCE_CENTER_FIRST:!0,FORCE_OFF_BOARD_FREQUENCY:0,CENTER_OFFSET_DIST_PENALTY_FACTOR:0}],Q1r=class extends ei{getSolverName(){return"MultiSectionPortPointOptimizer"}simpleRouteJson;inputNodes;capacityMeshNodes;capacityMeshEdges;colorMap;nodeMap;capacityMeshNodeMap;connectionResults;assignedPortPoints;nodeAssignedPortPoints;sections=[];activeSubSolver=null;currentSection=null;sectionScoreBeforeOptimization=0;currentSectionCenterNodeId=null;currentScheduleIndex=0;nodePfMap=new Map;attemptsToFixNode=new Map;sectionAttempts=0;MAX_ATTEMPTS_PER_NODE=100;MAX_SECTION_ATTEMPTS=15;ACCEPTABLE_PF=0.05;FRACTION_TO_REPLACE=0.2;JUMPER_PF_FN_ENABLED=!1;SHUFFLE_SEEDS_PER_SECTION=null;ALWAYS_RIP_INTERSECTIONS=!0;effort=1;HYPERPARAMETER_SCHEDULE=R1r;constructor(e){super(),this.MAX_ITERATIONS=1e6,this.simpleRouteJson=e.simpleRouteJson,this.inputNodes=e.inputNodes,this.capacityMeshNodes=e.capacityMeshNodes,this.capacityMeshEdges=e.capacityMeshEdges,this.colorMap=e.colorMap??{},this.effort=e.effort??1,e.FRACTION_TO_REPLACE!==void 0&&(this.FRACTION_TO_REPLACE=e.FRACTION_TO_REPLACE),e.ALWAYS_RIP_INTERSECTIONS!==void 0&&(this.ALWAYS_RIP_INTERSECTIONS=e.ALWAYS_RIP_INTERSECTIONS),e.MAX_ATTEMPTS_PER_NODE!==void 0&&(this.MAX_ATTEMPTS_PER_NODE=e.MAX_ATTEMPTS_PER_NODE),e.MAX_SECTION_ATTEMPTS!==void 0&&(this.MAX_SECTION_ATTEMPTS=e.MAX_SECTION_ATTEMPTS),e.HYPERPARAMETER_SCHEDULE!==void 0&&(this.HYPERPARAMETER_SCHEDULE=e.HYPERPARAMETER_SCHEDULE),this.JUMPER_PF_FN_ENABLED=e.JUMPER_PF_FN_ENABLED??this.JUMPER_PF_FN_ENABLED,this.SHUFFLE_SEEDS_PER_SECTION=e.SHUFFLE_SEEDS_PER_SECTION,this.nodeMap=new Map(e.inputNodes.map((n)=>[n.capacityMeshNodeId,n])),this.capacityMeshNodeMap=new Map(e.capacityMeshNodes.map((n)=>[n.capacityMeshNodeId,n])),this.connectionResults=[...e.initialConnectionResults],this.assignedPortPoints=new Map(e.initialAssignedPortPoints),this.nodeAssignedPortPoints=new Map(e.initialNodeAssignedPortPoints),this.nodePfMap=this.computeInitialPfMap();let t=this.computeBoardScore();this.stats.successfulOptimizations=0,this.stats.failedOptimizations=0,this.stats.nodesExamined=0,this.stats.sectionAttempts=0,this.stats.sectionScores={},this.stats.initialBoardScore=t,this.stats.currentBoardScore=t,this.stats.errors=0}computeInitialPfMap(){let e=new Map;for(let t of this.capacityMeshNodes){let n=this.nodeAssignedPortPoints.get(t.capacityMeshNodeId)??[];if(n.length===0)continue;let o={capacityMeshNodeId:t.capacityMeshNodeId,center:t.center,width:t.width,height:t.height,portPoints:n,availableZ:t.availableZ},r=this.JUMPER_PF_FN_ENABLED&&t.availableZ.length===1?ple(t,D_(o).numSameLayerCrossings):Czt(o,t);e.set(t.capacityMeshNodeId,r)}return e}computeBoardScore(){let e=this.getNodesWithPortPoints();return this.computeScoreForNodes(e)}computeScoreForNodes(e){return this.JUMPER_PF_FN_ENABLED?zrn(e,this.capacityMeshNodeMap):Frn(e,this.capacityMeshNodeMap)}recomputePfForNodes(e){for(let t of e){let n=this.capacityMeshNodeMap.get(t);if(!n)continue;let o=this.nodeAssignedPortPoints.get(t)??[];if(o.length===0){this.nodePfMap.set(t,0);continue}let r={capacityMeshNodeId:t,center:n.center,width:n.width,height:n.height,portPoints:o,availableZ:n.availableZ},i=this.JUMPER_PF_FN_ENABLED&&n.availableZ.length===1?ple(n,D_(r).numSameLayerCrossings):Czt(r,n);this.nodePfMap.set(t,i)}}getCreatePortPointSectionInput(){return{inputNodes:this.inputNodes,capacityMeshNodes:this.capacityMeshNodes,capacityMeshEdges:this.capacityMeshEdges,nodeMap:this.nodeMap,connectionResults:this.connectionResults}}createSection(e){return function(t,n){let{inputNodes:o,capacityMeshNodes:r,capacityMeshEdges:i,connectionResults:s}=t,{centerOfSectionCapacityNodeId:a,expansionDegrees:c}=n,l=new Map;for(let y of i){let[x,C]=y.nodeIds;l.has(x)||l.set(x,new Set),l.has(C)||l.set(C,new Set),l.get(x).add(C),l.get(C).add(x)}let h=new Set,d=new Set,u=[];for(u.push({nodeId:a,depth:0}),d.add(a);u.length>0;){let{nodeId:y,depth:x}=u.shift();if(h.add(y),x<c){let C=l.get(y)??new Set;for(let b of C)d.has(b)||(d.add(b),u.push({nodeId:b,depth:x+1}))}}let _=o.filter((y)=>h.has(y.capacityMeshNodeId)),p=r.filter((y)=>h.has(y.capacityMeshNodeId)),m=[],A=[];for(let y of i){let[x,C]=y.nodeIds,b=h.has(x),I=h.has(C);b&&I?m.push(y):(b||I)&&A.push(y)}let g=_.map((y)=>{let x=y.portPoints.filter((C)=>{let[b,I]=C.connectionNodeIds,v=h.has(b),P=h.has(I);return v||P});return{...y,portPoints:x}}),f=function(y,x){let C=[];for(let b of y){if(!b.path||b.path.length===0)continue;let I=b.connection.name,v=b.connection.__rootConnectionNames?.[0],P=[];for(let V=0;V<b.path.length;V++){let O=b.path[V];x.has(O.currentNodeId)&&P.push(V)}if(P.length===0)continue;let M=P[0],B=P[P.length-1],T=M,N=B;if(M>0){let V=b.path[0].currentNodeId;(b.nodeIds[0]===V||b.nodeIds[1]===V)&&(T=0)}if(B<b.path.length-1){let V=b.path.length-1,O=b.path[V].currentNodeId;(b.nodeIds[0]===O||b.nodeIds[1]===O)&&(N=V)}let D=b.path.slice(T,N+1),L=T>0,H=N<b.path.length-1;C.push({connectionName:I,rootConnectionName:v,points:D.map((V)=>({x:V.point.x,y:V.point.y,z:V.z,nodeId:V.currentNodeId,portPointId:V.portPoint?.portPointId})),originalStartIndex:T,originalEndIndex:N,hasEntryFromOutside:L,hasExitToOutside:H})}return C}(s??[],h);return{centerNodeId:a,expansionDegrees:c,nodeIds:h,inputNodes:g,capacityMeshNodes:p,internalEdges:m,boundaryEdges:A,sectionPaths:f}}(this.getCreatePortPointSectionInput(),e)}getSectionNodesWithPortPoints(e){let t=[];for(let n of e.nodeIds){let o=this.nodeMap.get(n),r=this.capacityMeshNodeMap.get(n);if(!o||!r)continue;let i=this.nodeAssignedPortPoints.get(n)??[];i.length>0&&t.push({capacityMeshNodeId:n,center:o.center,width:o.width,height:o.height,portPoints:i,availableZ:o.availableZ})}return t}getNodesWithPortPoints(){let e=[];for(let t of this.inputNodes){let n=this.nodeAssignedPortPoints.get(t.capacityMeshNodeId)??[];n.length>0&&e.push({capacityMeshNodeId:t.capacityMeshNodeId,center:t.center,width:t.width,height:t.height,portPoints:n,availableZ:t.availableZ})}return e}findHighestPfNode(){let e=null,t=0;for(let[n,o]of this.nodePfMap.entries())o*(1-(this.attemptsToFixNode.get(n)??0)/this.MAX_ATTEMPTS_PER_NODE)**2>t&&(t=o,e=n);return!e||t<this.ACCEPTABLE_PF?null:e}currentSectionCutPathInfo=new Map;currentSectionKeptPortPoints=new Map;currentSectionFixedRoutes=[];determineConnectionsToRip(e,t){let n=31337*this.sectionAttempts,o=Szt(n);if(this.FRACTION_TO_REPLACE>=1)return new Set(t);let r=function(a,c){let l=Szt(c),h=[...a];for(let d=h.length-1;d>0;d--){let u=Math.floor(l()*(d+1));[h[d],h[u]]=[h[u],h[d]]}return h}(t,n),i=Math.max(1,Math.ceil(r.length*this.FRACTION_TO_REPLACE)),s=new Set(r.slice(0,i));if(this.ALWAYS_RIP_INTERSECTIONS){let a=function(c){let{section:l,nodePfMap:h,capacityMeshNodeMap:d,nodeAssignedPortPoints:u,acceptablePf:_}=c,p=[];for(let m of l.nodeIds){if((h.get(m)??0)<=_)continue;let A=d.get(m);if(!A)continue;let g=u.get(m)??[];if(g.length<2)continue;let f=A.center.x-A.width/2,y=A.center.x+A.width/2,x=A.center.y-A.height/2,C=A.center.y+A.height/2,b=new Map;for(let P of g){let M=b.get(P.connectionName)??[];M.some((B)=>B.x===P.x&&B.y===P.y&&B.z===P.z)||M.push({x:P.x,y:P.y,z:P.z}),b.set(P.connectionName,M)}let I=new Map;for(let[P,M]of b){if(M.length<2)continue;let B=M[0],T=M[1];if(B.z!==T.z)continue;let N=bzt(B,f,y,x,C),D=bzt(T,f,y,x,C),L=B.z,H=I.get(L)??[];H.push({connectionName:P,t1:N,t2:D}),I.set(L,H)}let v=0.000001;for(let[,P]of I){let M=P.map((B)=>({connectionName:B.connectionName,a:Math.min(B.t1,B.t2),b:Math.max(B.t1,B.t2)}));for(let B=0;B<M.length;B++){let{connectionName:T,a:N,b:D}=M[B];for(let L=B+1;L<M.length;L++){let{connectionName:H,a:V,b:O}=M[L];Math.abs(N-V)<v||Math.abs(N-O)<v||Math.abs(D-V)<v||Math.abs(D-O)<v||(N<V&&V<D&&D<O||V<N&&N<O&&O<D)&&p.push([T,H])}}}}return p}({section:e,nodePfMap:this.nodePfMap,capacityMeshNodeMap:this.capacityMeshNodeMap,nodeAssignedPortPoints:this.nodeAssignedPortPoints,acceptablePf:this.ACCEPTABLE_PF});for(let[c,l]of a){if(s.has(c)||s.has(l))continue;let h=t.includes(c),d=t.includes(l);if(h&&d){let u=o()<0.5;s.add(u?c:l)}else h?s.add(c):d&&s.add(l)}}return this.stats.lastRipCount=s.size,s}createSectionSimpleRouteJson(e){let t=[];this.currentSectionCutPathInfo.clear(),this.currentSectionKeptPortPoints.clear(),this.currentSectionFixedRoutes=[];let n=[],o=[];for(let a of this.connectionResults){if(!a.path||a.path.length===0)continue;let[c,l]=a.nodeIds,h=e.nodeIds.has(c),d=e.nodeIds.has(l);h&&d&&(o.push(a),n.push(a.connection.name))}let r=[];for(let a of e.sectionPaths){if(!a.hasEntryFromOutside&&!a.hasExitToOutside)continue;if(a.points.length<2)continue;let c=this.connectionResults.find((l)=>l.connection.name===a.connectionName);c&&(r.push({sectionPath:a,originalResult:c}),n.includes(a.connectionName)||n.push(a.connectionName))}let i=this.determineConnectionsToRip(e,n);for(let a of o)i.has(a.connection.name)&&t.push(a.connection);for(let{sectionPath:a,originalResult:c}of r){if(!i.has(a.connectionName))continue;let l=`__cut__${a.connectionName}__${a.originalStartIndex}`;this.colorMap[l]=this.colorMap[a.connectionName];let h=a.points[0],d=a.points[a.points.length-1],u={name:l,__rootConnectionNames:[a.rootConnectionName??a.connectionName],pointsToConnect:[{x:h.x,y:h.y,layers:[`layer${h.z+1}`]},{x:d.x,y:d.y,layers:[`layer${d.z+1}`]}]};t.push(u),this.currentSectionCutPathInfo.set(l,{sectionPath:a,originalConnectionResult:c})}let s=new Set(n.filter((a)=>!i.has(a)));if(s.size>0){for(let a of e.nodeIds){let c=(this.nodeAssignedPortPoints.get(a)??[]).filter((l)=>s.has(l.connectionName));c.length>0&&this.currentSectionKeptPortPoints.set(a,c)}for(let a of o)s.has(a.connection.name)&&this.currentSectionFixedRoutes.push(a);for(let{sectionPath:a,originalResult:c}of r)if(s.has(a.connectionName)){let l={connection:{name:a.connectionName,__rootConnectionNames:a.rootConnectionName?[a.rootConnectionName]:void 0,pointsToConnect:c.connection.pointsToConnect},path:a.points.map((h)=>({prevCandidate:null,portPoint:null,currentNodeId:h.nodeId,point:{x:h.x,y:h.y},z:h.z,f:0,g:0,h:0,distanceTraveled:0})),portPoints:a.points.map((h)=>({portPointId:h.portPointId,x:h.x,y:h.y,z:h.z,connectionName:a.connectionName,rootConnectionName:a.rootConnectionName})),nodeIds:c.nodeIds,straightLineDistance:c.straightLineDistance};this.currentSectionFixedRoutes.push(l)}}return{...this.simpleRouteJson,connections:t}}prepareSectionInputNodesForCutPaths(e){let t=new Set;for(let[,n]of this.currentSectionCutPathInfo.entries()){let{sectionPath:o}=n;if(o.points.length===0)continue;let r=o.points[0].nodeId;t.add(r);let i=o.points[o.points.length-1].nodeId;t.add(i)}return e.inputNodes.map((n)=>t.has(n.capacityMeshNodeId)?{...n,_containsTarget:!0}:n)}getHyperParametersForScheduleIndex(e,t){let n=this.HYPERPARAMETER_SCHEDULE[e];return{...n,SHUFFLE_SEED:(n.SHUFFLE_SEED??0)+17*t}}createSectionSolver(e){let t=this.createSectionSimpleRouteJson(e),n=this.prepareSectionInputNodesForCutPaths(e),o=Hrn(t,n);for(let[r,i]of this.currentSectionKeptPortPoints){let s=o.nodeAssignedPortPoints.get(r)??[];o.nodeAssignedPortPoints.set(r,[...s,...i])}return new IZe({simpleRouteJson:t,inputNodes:n,capacityMeshNodes:e.capacityMeshNodes,colorMap:this.colorMap,nodeMemoryPfMap:this.nodePfMap,numShuffleSeeds:this.SHUFFLE_SEEDS_PER_SECTION??2*t.connections.length*this.effort,hyperParameters:{...this.getHyperParametersForScheduleIndex(this.currentScheduleIndex,this.sectionAttempts)},precomputedInitialParams:o,fixedRoutes:this.currentSectionFixedRoutes})}reattachSection(e,t,n,o){let r=[],i=[];for(let a of t)a.connection.name.startsWith("__cut__")?i.push(a):r.push(a);let s=new Set(r.map((a)=>a.connection.name));this.connectionResults=this.connectionResults.filter((a)=>!s.has(a.connection.name)),this.connectionResults.push(...r);for(let[a,c]of this.nodeAssignedPortPoints.entries()){if(!e.nodeIds.has(a))continue;let l=c.filter((h)=>!s.has(h.connectionName));this.nodeAssignedPortPoints.set(a,l)}for(let[a,c]of this.assignedPortPoints.entries())s.has(c.connectionName)&&this.assignedPortPoints.delete(a);for(let a of i){let c=this.currentSectionCutPathInfo.get(a.connection.name);if(!c||!a.path)continue;let{sectionPath:l,originalConnectionResult:h}=c,d=h.path;if(!d)continue;let u=l.connectionName;for(let[g,f]of this.nodeAssignedPortPoints.entries()){let y=f.filter((x)=>x.connectionName!==u||!e.nodeIds.has(g));this.nodeAssignedPortPoints.set(g,y)}let _=d.slice(0,l.originalStartIndex),p=d.slice(l.originalEndIndex+1),m=[],A=_.length>0?_[_.length-1]:null;for(let g of a.path){let f={...g,prevCandidate:A};m.push(f),A=f}if(p.length>0&&m.length>0&&(p[0]={...p[0],prevCandidate:m[m.length-1]}),h.path=[..._,...m,...p],a.portPoints)for(let g of a.portPoints){let f={...g,connectionName:u,rootConnectionName:l.rootConnectionName??u};for(let y of e.inputNodes)for(let x of y.portPoints)if(Math.abs(x.x-g.x)<0.001&&Math.abs(x.y-g.y)<0.001&&x.z===g.z){for(let C of x.connectionNodeIds){let b=this.nodeAssignedPortPoints.get(C)??[];b.push(f),this.nodeAssignedPortPoints.set(C,b)}break}}}for(let[a,c]of n.entries())c.connectionName.startsWith("__cut__")||this.assignedPortPoints.set(a,c);for(let[a,c]of o.entries()){let l=c.filter((h)=>!h.connectionName.startsWith("__cut__"));if(l.length>0){let h=this.nodeAssignedPortPoints.get(a)??[];this.nodeAssignedPortPoints.set(a,[...h,...l])}}}_step(){if(this.activeSubSolver){if(this.activeSubSolver.step(),this.activeSubSolver.solved||this.activeSubSolver.failed){if(this.activeSubSolver.failed){if(this.currentScheduleIndex++,this.activeSubSolver.error&&this.stats.errors++,this.currentScheduleIndex<this.HYPERPARAMETER_SCHEDULE.length&&this.currentSectionCenterNodeId){let l=this.HYPERPARAMETER_SCHEDULE[this.currentScheduleIndex];this.currentSection=this.createSection({centerOfSectionCapacityNodeId:this.currentSectionCenterNodeId,expansionDegrees:l.EXPANSION_DEGREES}),this.activeSubSolver=this.createSectionSolver(this.currentSection)}else this.stats.failedOptimizations++,this.activeSubSolver=null,this.currentSection=null,this.currentSectionCenterNodeId=null,this.currentScheduleIndex=0;return}let o=this.activeSubSolver.getNodesWithPortPoints().map((l)=>({...l,portPoints:l.portPoints.map((h)=>{if(h.connectionName.startsWith("__cut__")){let d=h.connectionName.slice(7),u=d.lastIndexOf("__"),_=u>=0?d.slice(0,u):d;return{...h,connectionName:_}}return h})})),r=new Set;for(let l of o)for(let h of l.portPoints)r.add(h.connectionName);let i=this.getSectionNodesWithPortPoints(this.currentSection).map((l)=>({...l,portPoints:l.portPoints.filter((h)=>r.has(h.connectionName))})).filter((l)=>l.portPoints.length>0),s=this.computeScoreForNodes(i),a=this.computeScoreForNodes(o),c=`attempt${this.sectionAttempts}`;if(this.stats.lastSectionScore=a,a>s){let l=this.stats.currentBoardScore;this.stats.lastBoardScore=l;let h=[...this.connectionResults],d=new Map(this.assignedPortPoints),u=new Map(Array.from(this.nodeAssignedPortPoints.entries()).map(([p,m])=>[p,[...m]]));this.reattachSection(this.currentSection,this.activeSubSolver.connectionsWithResults,this.activeSubSolver.assignedPortPoints,this.activeSubSolver.nodeAssignedPortPoints),this.recomputePfForNodes(this.currentSection.nodeIds);let _=this.computeBoardScore();this.stats.sectionScores[c]=_,_>l?(this.stats.successfulOptimizations++,this.stats.currentBoardScore=_):(this.connectionResults=h,this.assignedPortPoints=d,this.nodeAssignedPortPoints=u,this.recomputePfForNodes(this.currentSection.nodeIds),this.stats.failedOptimizations++),this.activeSubSolver=null,this.currentSection=null,this.currentSectionCenterNodeId=null,this.currentScheduleIndex=0}else if(this.currentScheduleIndex++,this.currentScheduleIndex<this.HYPERPARAMETER_SCHEDULE.length&&this.currentSectionCenterNodeId){let l=this.HYPERPARAMETER_SCHEDULE[this.currentScheduleIndex];this.currentSection=this.createSection({centerOfSectionCapacityNodeId:this.currentSectionCenterNodeId,expansionDegrees:l.EXPANSION_DEGREES}),this.activeSubSolver=this.createSectionSolver(this.currentSection)}else this.stats.failedOptimizations++,this.activeSubSolver=null,this.currentSection=null,this.currentSectionCenterNodeId=null,this.currentScheduleIndex=0}return}if(this.sectionAttempts>=this.MAX_SECTION_ATTEMPTS)return void(this.solved=!0);let e=this.findHighestPfNode();if(!e)return void(this.solved=!0);this.sectionAttempts++,this.stats.sectionAttempts=this.sectionAttempts,this.stats.nodesExamined++,this.attemptsToFixNode.set(e,(this.attemptsToFixNode.get(e)??0)+1),this.currentSectionCenterNodeId=e,this.currentScheduleIndex=0;let t=this.HYPERPARAMETER_SCHEDULE[this.currentScheduleIndex];this.currentSection=this.createSection({centerOfSectionCapacityNodeId:e,expansionDegrees:t.EXPANSION_DEGREES});let n=this.getSectionNodesWithPortPoints(this.currentSection);if(this.sectionScoreBeforeOptimization=this.computeScoreForNodes(n),this.createSectionSimpleRouteJson(this.currentSection).connections.length===0)return this.currentSection=null,void(this.currentSectionCenterNodeId=null);this.activeSubSolver=this.createSectionSolver(this.currentSection)}computeProgress(){return this.sectionAttempts/this.MAX_SECTION_ATTEMPTS}visualize(){return this.solved?YKe(this):this.activeSubSolver?this.activeSubSolver.visualize():this.currentSection?function(e,t){let n={lines:[],points:[],rects:[],circles:[]};for(let o of e.inputNodes){let r=o.capacityMeshNodeId===e.centerNodeId,i=r?"rgba(0, 200, 0, 0.3)":"rgba(200, 200, 200, 0.3)";n.rects.push({center:o.center,width:0.9*o.width,height:0.9*o.height,layer:`z${o.availableZ.join(",")}`,fill:i,label:`${o.capacityMeshNodeId}${r?" (CENTER)":""}`})}for(let o of e.inputNodes)for(let r of o.portPoints)n.circles.push({center:{x:r.x,y:r.y},radius:0.05,fill:"rgba(150, 150, 150, 0.5)",layer:`z${r.z}`,label:[r.portPointId,`cd: ${r.distToCentermostPortOnZ}`,`connects: ${r.connectionNodeIds.join(",")}`].filter(Boolean).join(`
`)});for(let o of e.sectionPaths){let r=t?.[o.connectionName]??"blue";for(let i=0;i<o.points.length-1;i++){let s=o.points[i],a=o.points[i+1],c=s.z===a.z,l=s.z,h;h=c?l===0?"5 5":"10 5":"3 3 10",n.lines.push({points:[{x:s.x,y:s.y},{x:a.x,y:a.y}],strokeColor:r,strokeDash:h})}}return n}(this.currentSection,this.colorMap):YKe(this)}},Orn=class{parent={};constructor(e){for(let t of e)this.parent[t]=t}find(e){return this.parent[e]===e?e:this.parent[e]=this.find(this.parent[e])}union(e,t){let n=this.find(e),o=this.find(t);n!==o&&(this.parent[o]=n)}getGroup(e){let t=this.find(e),n=[];for(let o in this.parent)this.find(o)===t&&n.push(o);return n}},k1r=class{point;left=null;right=null;constructor(e){this.point=e}},L1r=class{root=null;constructor(e){e.length>0&&(this.root=this.buildTree(e,0))}buildTree(e,t){let n=t%2==0?"x":"y";e.sort((i,s)=>i[n]-s[n]);let o=Math.floor(e.length/2),r=new k1r(e[o]);return o>0&&(r.left=this.buildTree(e.slice(0,o),t+1)),o<e.length-1&&(r.right=this.buildTree(e.slice(o+1),t+1)),r}findNearestNeighbor(e){if(!this.root)throw Error("Tree is empty");let t=this.root.point,n=this.distance(e,t);return this.nearestNeighborSearch(this.root,e,0,t,n),t}nearestNeighborSearch(e,t,n,o,r){if(!e)return o;let i=n%2?"x":"y",s=this.distance(t,e.point);s<r&&(o=e.point,r=s);let a=t[i]-e.point[i],c=a<=0?e.left:e.right,l=a<=0?e.right:e.left;return o=this.nearestNeighborSearch(c,t,n+1,o,r),r=this.distance(t,o),Math.abs(a)<r&&(o=this.nearestNeighborSearch(l,t,n+1,o,r)),o}findKNearestNeighbors(e,t){if(!this.root)return[];let n=[];return this.kNearestNeighborSearch(this.root,e,0,n,t),n.sort((o,r)=>o.distance-r.distance).slice(0,t).map((o)=>o.point)}kNearestNeighborSearch(e,t,n,o,r){if(!e)return;let i=n%2?"x":"y",s=this.distance(t,e.point);o.push({point:e.point,distance:s});let a=t[i]-e.point[i],c=a<=0?e.left:e.right,l=a<=0?e.right:e.left;this.kNearestNeighborSearch(c,t,n+1,o,r);let h=1/0;o.length>=r&&(o.sort((d,u)=>d.distance-u.distance),h=o[r-1]?.distance||1/0),(Math.abs(a)<h||o.length<r)&&this.kNearestNeighborSearch(l,t,n+1,o,r)}distance(e,t){return Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2)}},H1r=class{parent=new Map;rank=new Map;constructor(e){for(let t of e){let n=this.pointToKey(t);this.parent.set(n,n),this.rank.set(n,0)}}pointToKey(e){return`${e.x},${e.y}`}find(e){let t=this.pointToKey(e);if(!this.parent.has(t))throw Error(`Point ${t} not found in DisjointSet`);let n=t;for(;n!==this.parent.get(n);)n=this.parent.get(n);let o=t;for(;o!==n;){let r=this.parent.get(o);this.parent.set(o,n),o=r}return n}union(e,t){let n=this.find(e),o=this.find(t);if(n===o)return!1;let r=this.rank.get(n)||0,i=this.rank.get(o)||0;return r<i?this.parent.set(n,o):r>i?this.parent.set(o,n):(this.parent.set(o,n),this.rank.set(n,r+1)),!0}};function Vrn(e,t={}){if(e.length<=1)return[];let n=[...e],o=new L1r(n),r=[],i=Math.min(10,e.length-1);for(let c of n){let l=o.findKNearestNeighbors(c,i+1);for(let h of l){if(c.x===h.x&&c.y===h.y)continue;let d=Math.sqrt((c.x-h.x)**2+(c.y-h.y)**2);r.push({from:c,to:h,weight:d})}}t.extraEdges&&r.push(...t.extraEdges),r.sort((c,l)=>c.weight-l.weight);let s=new H1r(n),a=[];for(let c of r)if(s.union(c.from,c.to)&&(a.push(c),a.length===n.length-1))break;return a}var F1r=(e,t)=>{let n=new Map;for(let r of e.pointsToConnect){if(!r.pointId)continue;let i=t.getNetConnectedToId(r.pointId);if(!i)continue;let s=n.get(i)??[];s.push(r),n.set(i,s)}let o=[];for(let r of n.values()){let i=r[0];if(i)for(let s of r.slice(1))o.push({from:i,to:s,weight:0})}return o},Yrn=(e,t)=>({zeroWeightEdges:F1r(e,t),arePointsConnected:(n,o)=>Boolean(n.pointId&&o.pointId&&((r,i,s)=>{let a=r.getNetConnectedToId(i);return!!a&&a===r.getNetConnectedToId(s)})(t,n.pointId,o.pointId))});function NCe(e){if(e.pointId)return e.pointId;let t=[...E5(e)].sort().join("-");return`${e.x.toFixed(4)},${e.y.toFixed(4)},${t}`}function Grn(e){if(e.length===0)return[];let t=e.map((s,a)=>`conn_${a}`),n=new Orn(t),o=new Map;e.forEach((s,a)=>{let c=`conn_${a}`;s.pointsToConnect.forEach((l)=>{let h=NCe(l);o.has(h)||o.set(h,[]),o.get(h).push(c)})});for(let s of o.values())if(s.length>1){let a=s[0];for(let c=1;c<s.length;c++)n.union(a,s[c])}let r=new Map;e.forEach((s,a)=>{let c=`conn_${a}`,l=n.find(c);r.has(l)||r.set(l,[]),r.get(l).push(s)});let i=[];for(let s of r.values()){if(s.length===1){i.push(s[0]);continue}let a=new Map,c=new Set,l=!1,h=[],d=new Set,u;s.forEach((p)=>{p.pointsToConnect.forEach((A)=>a.set(NCe(A),A));let m=p.__rootConnectionNames;if(m&&m.length>0)for(let A of m)c.add(A);else c.add(p.name);p.isOffBoard&&(l=!0),p.externallyConnectedPointIds&&h.push(...p.externallyConnectedPointIds),p.__netConnectionName&&d.add(p.__netConnectionName),u===void 0&&p.nominalTraceWidth!==void 0&&(u=p.nominalTraceWidth)});let _={name:s.map((p)=>p.name).join("__"),pointsToConnect:Array.from(a.values()),isOffBoard:l,externallyConnectedPointIds:h.length>0?h:void 0,__netConnectionName:d.size>0?Array.from(d).join("__"):void 0,__rootConnectionNames:Array.from(c),nominalTraceWidth:u};i.push(_)}return i}var vZe=class extends ei{constructor(e,t={},n){super(),this.ogSrj=e,this.colorMap=t;let o=new Map;for(let i of e.buses??[])if(i.traceWidth!==void 0)for(let s of i.connectionNames)o.set(s,Math.max(o.get(s)??0,i.traceWidth));let r=e.connections.map((i)=>{let s=o.get(i.name);return s===void 0?i:{...i,nominalTraceWidth:Math.max(i.nominalTraceWidth??0,s)}});this.unprocessedConnections=Grn(r),this.newConnections=[],this.initiallyConnectedMap=n}ogSrj;colorMap;getSolverName(){return"NetToPointPairsSolver"}unprocessedConnections;newConnections;initiallyConnectedMap;_step(){if(this.unprocessedConnections.length===0)return void(this.solved=!0);let e=this.unprocessedConnections.pop(),{zeroWeightEdges:t,arePointsConnected:n}=Yrn(e,this.initiallyConnectedMap);if(e.pointsToConnect.length===2){let[i,s]=e.pointsToConnect;if(i&&s&&n(i,s))return;return void this.newConnections.push({...e,__rootConnectionNames:e.__rootConnectionNames??[e.name]})}let o=Vrn(e.pointsToConnect,{extraEdges:t}),r=0;for(let i of o)n(i.from,i.to)||this.newConnections.push({...e,pointsToConnect:[i.from,i.to],name:`${e.name}_mst${r++}`,__rootConnectionNames:e.__rootConnectionNames??[e.name],__netConnectionName:e.__netConnectionName})}getNewSimpleRouteJson(){return{...structuredClone(this.ogSrj),connections:structuredClone(this.newConnections)}}visualize(){let e={lines:[],points:[],rects:[],circles:[],coordinateSystem:"cartesian",title:"Net To Point Pairs Visualization"};return this.unprocessedConnections.forEach((t)=>{t.pointsToConnect.forEach((i)=>{e.points.push({x:i.x,y:i.y,color:"red",label:i.pcb_port_id??i.pointId})});let n=t.pointsToConnect.length**2,o=nqe(0),r=new Set;for(let i=0;i<Math.max(n,2*t.pointsToConnect.length);i++){let s=Math.floor(o()*t.pointsToConnect.length),a=Math.floor(o()*t.pointsToConnect.length);r.has(`${s}-${a}`)||(r.add(`${s}-${a}`),e.lines.push({points:[t.pointsToConnect[s],t.pointsToConnect[a]],strokeColor:"rgba(255,0,0,0.25)",label:t.name}))}}),this.newConnections.forEach((t)=>{let n=this.colorMap?.[t.name]||"blue";t.pointsToConnect.forEach((o)=>{e.points.push({x:o.x,y:o.y,color:n,label:o.pcb_port_id??o.pointId})});for(let o=0;o<t.pointsToConnect.length-1;o++)for(let r=o+1;r<t.pointsToConnect.length;r++)e.lines.push({points:[t.pointsToConnect[o],t.pointsToConnect[r]],strokeColor:n,label:t.name})}),e}},Vq=class extends vZe{constructor(e,t={},n){let o=e.connections.flatMap((c)=>c.pointsToConnect),r=new Map;for(let c of o)c.pointId&&r.set(c.pointId,c);let i=o.map((c)=>c.pointId).filter((c)=>!!c),s=new Orn(i),a=[];for(let c of e.connections)c.isOffBoard?c.pointsToConnect.length>=2&&c.pointsToConnect[0].pointId&&c.pointsToConnect[1].pointId&&s.union(c.pointsToConnect[0].pointId,c.pointsToConnect[1].pointId):a.push(c);super({...e,connections:a},t,n),this.ogSrj=e,this.colorMap=t,this.connectionPointDsu=s,this.connectionPointMap=r,this.ogSrj=e}ogSrj;colorMap;getSolverName(){return"NetToPointPairsSolver2_OffBoardConnection"}connectionPointDsu;connectionPointMap;_findBestConnectionPointsFromDisjointSets(e,t){if(!e.pointId||!t.pointId)return{pointsToConnect:[e,t]};let n=this.connectionPointDsu.getGroup(e.pointId).map((a)=>this.connectionPointMap.get(a)),o=this.connectionPointDsu.getGroup(t.pointId).map((a)=>this.connectionPointMap.get(a)),r=e,i=t,s=1/0;for(let a of n)for(let c of o){let l=Math.sqrt(Math.pow(a.x-c.x,2)+Math.pow(a.y-c.y,2));l<s&&(s=l,r=a,i=c)}return{pointsToConnect:[r,i]}}_step(){if(this.unprocessedConnections.length===0)return void(this.solved=!0);let e=this.unprocessedConnections.pop(),{zeroWeightEdges:t,arePointsConnected:n}=Yrn(e,this.initiallyConnectedMap);if(e.pointsToConnect.length===2){let[i,s]=e.pointsToConnect;if(i&&s&&n(i,s))return;let a=this._findBestConnectionPointsFromDisjointSets(e.pointsToConnect[0],e.pointsToConnect[1]);return void this.newConnections.push({...e,pointsToConnect:a.pointsToConnect,__rootConnectionNames:e.__rootConnectionNames??[e.name]})}let o=Vrn(e.pointsToConnect,{extraEdges:t}),r=0;for(let i of o){if(n(i.from,i.to))continue;let s=this._findBestConnectionPointsFromDisjointSets(i.from,i.to);this.newConnections.push({...e,pointsToConnect:s.pointsToConnect,name:`${e.name}_mst${r++}`,__rootConnectionNames:e.__rootConnectionNames??[e.name],__netConnectionName:e.__netConnectionName})}}},SZe=class{netMap;idToNetMap;constructor(e){this.netMap=e,this.idToNetMap={};for(let[t,n]of Object.entries(e))for(let o of n)this.idToNetMap[o]=t}addConnections(e){for(let t of e){let n=new Set;for(let r of t){let i=this.idToNetMap[r];i&&n.add(i)}let o;if(n.size===0)o=`connectivity_net${Object.keys(this.netMap).length}`,this.netMap[o]=[];else if(n.size===1)o=n.values().next().value??`connectivity_net${Object.keys(this.netMap).length}`;else{o=n.values().next().value??`connectivity_net${Object.keys(this.netMap).length}`;for(let r of n)if(r!==o){let i=this.netMap[o],s=this.netMap[r];if(i&&s){i.push(...s),this.netMap[r]=i;for(let a of i)this.idToNetMap[a]=o}}}for(let r of t){let i=this.netMap[o];i&&!i.includes(r)&&i.push(r),this.idToNetMap[r]=o}}}getIdsConnectedToNet(e){return this.netMap[e]||[]}getNetConnectedToId(e){return this.idToNetMap[e]}areIdsConnected(e,t){if(e===t)return!0;let n=this.getNetConnectedToId(e);if(!n)return!1;let o=this.getNetConnectedToId(t);return!!o&&(n===o||o===e||o===e)}areAllIdsConnected(e){if(e.length===0)return!0;let t=this.getNetConnectedToId(e[0]);if(!t)return!1;for(let n of e){let o=this.getNetConnectedToId(n);if(o===void 0)return!1;if(o!==t)return!1}return!0}};function z1r(e,t={}){let n=[],o=[],r=t.color??"gray",i=t.label,s=QV[e.footprint]??QV["0603"],a=e.end.x-e.start.x,c=e.end.y-e.start.y,l=Math.abs(a)>Math.abs(c),h=l?s.padLength:s.padWidth,d=l?s.padWidth:s.padLength;return n.push({center:e.start,width:h,height:d,fill:zi(r,0.5),stroke:"rgba(0, 0, 0, 0.5)",layer:"jumper",label:i?`${i} (start)`:void 0}),n.push({center:e.end,width:h,height:d,fill:zi(r,0.5),stroke:"rgba(0, 0, 0, 0.5)",layer:"jumper",label:i?`${i} (end)`:void 0}),o.push({points:[e.start,e.end],strokeColor:"rgba(100, 100, 100, 0.8)",strokeWidth:0.3*s.padWidth,layer:"jumper-body"}),{rects:n,lines:o}}function lv(e,t={}){let n={rects:[],lines:[]};for(let o of e){let{rects:r,lines:i}=z1r(o,t);n.rects.push(...r),n.lines.push(...i)}return n}var F4e=1e5,Dae=0.001,Pzt=class extends ei{getSolverName(){return"SingleHighDensityRouteStitchSolver"}mergedHdRoute;remainingHdRoutes;start;end;colorMap;constructor(e){if(super(),this.remainingHdRoutes=[...e.hdRoutes],this.colorMap=e.colorMap??{},e.hdRoutes.length===0){this.start=e.start,this.end=e.end;let a=[{x:e.start.x,y:e.start.y,z:e.start.z}],c=[];return e.start.z!==e.end.z&&(a.push({x:e.start.x,y:e.start.y,z:e.end.z}),c.push({x:e.start.x,y:e.start.y})),a.push({x:e.end.x,y:e.end.y,z:e.end.z}),this.mergedHdRoute={connectionName:e.connectionName,rootConnectionName:e.hdRoutes[0]?.rootConnectionName,route:a,vias:c,jumpers:[],viaDiameter:e.defaultViaDiameter??0.3,traceThickness:e.defaultTraceThickness??0.15},void(this.solved=!0)}let t=1/0,n=e.hdRoutes[0],o="start-to-end";for(let a of e.hdRoutes){let c=a.route[0],l=a.route[a.route.length-1],h=kn(e.start,c),d=kn(e.start,l),u=kn(e.end,c),_=kn(e.end,l),p=Math.min(h,d,u,_);p<t&&(t=p,n=a,o=Math.min(u,_)<Math.min(h,d)?"end-to-start":"start-to-end")}o==="start-to-end"?(this.start=e.start,this.end=e.end):(this.start=e.end,this.end=e.start);let r=n.route[0],i=n.route[n.route.length-1],s=kn(this.start,r)<=kn(this.start,i)?r:i;this.mergedHdRoute={connectionName:e.connectionName,rootConnectionName:n.rootConnectionName,route:[{x:this.start.x,y:this.start.y,z:s.z}],vias:[],jumpers:[],viaDiameter:n.viaDiameter,traceThickness:n.traceThickness}}getDisjointedRoute(){for(let e of this.remainingHdRoutes)if([e.route[0],e.route[e.route.length-1]].some((t)=>!this.remainingHdRoutes.some((n)=>{if(n===e)return!1;return[n.route[0],n.route[n.route.length-1]].some((o)=>o.z===t.z&&kn(t,o)<0.001)})))return{firstRoute:e};return{firstRoute:this.remainingHdRoutes[0]}}_step(){if(this.remainingHdRoutes.length===0){let s=this.mergedHdRoute.route[this.mergedHdRoute.route.length-1];return this.mergedHdRoute.route.push({x:this.end.x,y:this.end.y,z:s.z}),void(this.solved=!0)}let e=this.mergedHdRoute.route[this.mergedHdRoute.route.length-1],t=-1,n="first",o=1/0;for(let s=0;s<this.remainingHdRoutes.length;s++){let a=this.remainingHdRoutes[s],c=a.route[0],l=a.route[a.route.length-1],h=kn(e,c),d=kn(e,l),u=1/0;u=e.z===c.z?h<Dae?h:F4e+h:h<Dae?1000+h:F4e+h,u<o&&(o=u,t=s,n="first");let _=1/0;_=e.z===l.z?d<Dae?d:F4e+d:d<Dae?1000+d:F4e+d,_<o&&(o=_,t=s,n="last")}if(t===-1)return void(this.remainingHdRoutes=[]);let r=this.remainingHdRoutes[t],i;this.remainingHdRoutes.splice(t,1),i=n==="first"?r.route:[...r.route].reverse(),kn(e,i[0])<Dae&&e.z===i[0].z?this.mergedHdRoute.route.push(...i.slice(1)):this.mergedHdRoute.route.push(...i),this.mergedHdRoute.vias.push(...r.vias),r.jumpers&&this.mergedHdRoute.jumpers.push(...r.jumpers)}visualize(){let e={points:[],lines:[],circles:[],rects:[],title:"Single High Density Route Stitch Solver"};if(e.points?.push({x:this.start.x,y:this.start.y,color:"green",label:"Start"},{x:this.end.x,y:this.end.y,color:"red",label:"End"}),this.mergedHdRoute&&this.mergedHdRoute.route.length>1){e.lines?.push({points:this.mergedHdRoute.route.map((t)=>({x:t.x,y:t.y})),strokeColor:"green"});for(let t of this.mergedHdRoute.route)e.points?.push({x:t.x,y:t.y,color:"green"});for(let t of this.mergedHdRoute.vias)e.circles?.push({center:{x:t.x,y:t.y},radius:this.mergedHdRoute.viaDiameter/2,fill:"green"});if(this.mergedHdRoute.jumpers&&this.mergedHdRoute.jumpers.length>0){let t=lv(this.mergedHdRoute.jumpers,{color:"green",label:this.mergedHdRoute.connectionName});e.rects.push(...t.rects??[]),e.lines.push(...t.lines??[])}}for(let[t,n]of this.remainingHdRoutes.entries()){let o=this.colorMap[n.connectionName]??"gray";e.lines?.push({points:n.route.map((r)=>({x:r.x,y:r.y})),strokeColor:o});for(let r=0;r<n.route.length;r++){let i=n.route[r];e.points?.push({x:i.x+(t%2-0.5)/500+(r%8-4)/1000,y:i.y+(t%2-0.5)/500+(r%8-4)/1000,color:o,label:`Route ${n.connectionName} ${i===n.route[0]?"First":i===n.route[n.route.length-1]?"Last":""}`})}for(let r of n.vias)e.circles?.push({center:{x:r.x,y:r.y},radius:n.viaDiameter/2,fill:o});if(n.jumpers&&n.jumpers.length>0){let r=lv(n.jumpers,{color:o,label:n.connectionName});e.rects.push(...r.rects??[]),e.lines.push(...r.lines??[])}}return e}},v$=(e)=>`${Math.round(100*e.x)},${Math.round(100*e.y)},${Math.round(100*e.z)}`,O1r=(e)=>({startHash:v$(e.route[0]),endHash:v$(e.route[e.route.length-1])}),PZe=class extends ei{getSolverName(){return"MultipleHighDensityRouteStitchSolver"}unsolvedRoutes;activeSolver=null;mergedHdRoutes=[];colorMap={};defaultTraceThickness;defaultViaDiameter;getClosestEndpointHash(e,t){let n=null,o=1/0;for(let r of e){let i=[r.route[0],r.route[r.route.length-1]];for(let s of i){let a=kn(t,s);a<o&&(o=a,n=v$(s))}}return n}selectRoutesAlongEndpointPath(e,t,n){if(e.length<=2)return e;let o=this.getClosestEndpointHash(e,t),r=this.getClosestEndpointHash(e,n);if(!o||!r||o===r)return e;let i=new Map;for(let d=0;d<e.length;d++){let{startHash:u,endHash:_}=O1r(e[d]),p=i.get(u)??[];p.push({nextHash:_,routeIndex:d}),i.set(u,p);let m=i.get(_)??[];m.push({nextHash:u,routeIndex:d}),i.set(_,m)}let s=[o],a=new Set([o]),c=new Map;for(;s.length>0;){let d=s.shift();if(d===r)break;for(let u of i.get(d)??[])a.has(u.nextHash)||(a.add(u.nextHash),c.set(u.nextHash,{prevHash:d,routeIndex:u.routeIndex}),s.push(u.nextHash))}if(!a.has(r))return e;let l=new Set,h=r;for(;h!==o;){let d=c.get(h);if(!d)return e;l.add(d.routeIndex),h=d.prevHash}if(l.size===0)return e;return e.filter((d,u)=>l.has(u))}constructor(e){super(),this.colorMap=e.colorMap??{};let t=e.hdRoutes[0];this.defaultTraceThickness=t?.traceThickness??0.15,this.defaultViaDiameter=t?.viaDiameter??e.defaultViaDiameter??0.3;let n=new SZe({}),o=[],r=new Map;for(let a=0;a<e.hdRoutes.length;a++){let c=e.hdRoutes[a],l=c.route[0],h=c.route[c.route.length-1];o.push([`route_island_${a}`,`${c.connectionName}:${v$(l)}`,`${c.connectionName}:${v$(h)}`])}n.addConnections(o);for(let a of o)for(let c of a.slice(1))r.set(c,(r.get(c)??0)+1);this.unsolvedRoutes=[];let i=Array.from(new Set(Object.values(n.idToNetMap)));for(let a of i){let c=n.getIdsConnectedToNet(a),l=e.hdRoutes.filter((A,g)=>c.includes(`route_island_${g}`));if(l.length===0)continue;let h=e.connections.find((A)=>A.name===l[0].connectionName),d=l.flatMap((A)=>[A.route[0],A.route[A.route.length-1]]),u=[];for(let A of d){let g=`${l[0].connectionName}:${v$(A)}`;r.get(g)===1&&u.push(A)}if(u.length===0){console.log("no possible endpoints, can't stitch");continue}let _,p;u.length!==2?(_={...h.pointsToConnect[0],z:si(l2(h.pointsToConnect[0]),e.layerCount)},p={...h.pointsToConnect[1],z:si(l2(h.pointsToConnect[1]),e.layerCount)}):(_=u[0],p=u[1],kn(_,h.pointsToConnect[1])<kn(p,h.pointsToConnect[0])&&([_,p]=[p,_]));let m=this.selectRoutesAlongEndpointPath(l,_,p);this.unsolvedRoutes.push({connectionName:l[0].connectionName,hdRoutes:m,start:_,end:p})}let s=new Map;for(let a of this.unsolvedRoutes){let c=s.get(a.connectionName);c?c.push(a):s.set(a.connectionName,[a])}this.unsolvedRoutes=Array.from(s.entries()).flatMap(([a,c])=>{if(!c.some((_)=>_.hdRoutes.some((p)=>p.route.length<2)))return c;let l=e.connections.find((_)=>_.name===a);if(!l)return c;let h={...l.pointsToConnect[0],z:si(l2(l.pointsToConnect[0]),e.layerCount)},d={...l.pointsToConnect[1],z:si(l2(l.pointsToConnect[1]),e.layerCount)},u=c.flatMap((_)=>_.hdRoutes);return[{connectionName:a,hdRoutes:this.selectRoutesAlongEndpointPath(u,h,d),start:h,end:d}]}),this.MAX_ITERATIONS=1e5}_step(){if(this.activeSolver)return this.activeSolver.step(),void(this.activeSolver.solved?(this.activeSolver instanceof Pzt&&this.mergedHdRoutes.push(this.activeSolver.mergedHdRoute),this.activeSolver=null):this.activeSolver.failed&&(this.failed=!0,this.error=this.activeSolver.error));let e=this.unsolvedRoutes.pop();e?this.activeSolver=new Pzt({connectionName:e.connectionName,hdRoutes:e.hdRoutes,start:e.start,end:e.end,colorMap:this.colorMap,defaultTraceThickness:this.defaultTraceThickness,defaultViaDiameter:this.defaultViaDiameter}):this.solved=!0}visualize(){let e={points:[],lines:[],circles:[],rects:[],title:"Multiple High Density Route Stitch Solver"};if(this.activeSolver){let t=this.activeSolver.visualize();t.points?.length&&e.points?.push(...t.points),t.lines?.length&&e.lines?.push(...t.lines),t.circles?.length&&e.circles?.push(...t.circles),t.rects?.length&&(e.rects||(e.rects=[]),e.rects.push(...t.rects))}for(let[t,n]of this.mergedHdRoutes.entries()){let o=this.colorMap[n.connectionName]??`hsl(120, 100%, ${40+10*t%40}%)`;for(let r=0;r<n.route.length-1;r++){let i=n.route[r],s=n.route[r+1],a=i.z!==0?zi(o,0.5):o;e.lines?.push({points:[{x:i.x,y:i.y},{x:s.x,y:s.y}],strokeColor:a,strokeWidth:n.traceThickness})}for(let r of n.route){let i=r.z!==0?zi(o,0.5):o;e.points?.push({x:r.x,y:r.y,color:i})}for(let r of n.vias)e.circles?.push({center:{x:r.x,y:r.y},radius:n.viaDiameter/2,fill:o});if(n.jumpers&&n.jumpers.length>0){let r=lv(n.jumpers,{color:o,label:n.connectionName});e.rects.push(...r.rects??[]),e.lines.push(...r.lines??[])}}for(let t of this.unsolvedRoutes){let n=this.colorMap[t.connectionName]??"gray";e.points?.push({x:t.start.x,y:t.start.y,color:n,label:`${t.connectionName} Start (z=${t.start.z})`},{x:t.end.x,y:t.end.y,color:n,label:`${t.connectionName} End (z=${t.end.z})`}),e.lines?.push({points:[{x:t.start.x,y:t.start.y},{x:t.end.x,y:t.end.y}],strokeColor:n,strokeDash:"2 2"});for(let o of t.hdRoutes){o.route.length>1&&e.lines?.push({points:o.route.map((r)=>({x:r.x,y:r.y})),strokeColor:zi(n,0.5),strokeDash:"10 5"});for(let r of o.vias)e.circles?.push({center:{x:r.x,y:r.y},radius:o.viaDiameter/2,fill:n});if(o.jumpers&&o.jumpers.length>0){let r=lv(o.jumpers,{color:n,label:o.connectionName});e.rects.push(...r.rects??[]),e.lines.push(...r.lines??[])}}}return e}},lY=class{MAX_ITERATIONS=1000;solved=!1;failed=!1;iterations=0;progress=0;error=null;activeSubSolver;failedSubSolvers;timeToSolve;stats={};pendingEffects;cacheHit;cacheKey;cacheToSolveSpaceTransform;getSolverName(){return this.constructor.name}step(){if(!this.solved&&!this.failed){this.iterations++;try{this._step()}catch(e){throw this.error=`${this.getSolverName()} error: ${e}`,console.error(this.error),this.failed=!0,e}!this.solved&&this.iterations>this.MAX_ITERATIONS&&this.tryFinalAcceptance(),!this.solved&&this.iterations>this.MAX_ITERATIONS&&(this.error=`${this.getSolverName()} ran out of iterations (MAX_ITERATIONS=${this.MAX_ITERATIONS})`,this.failed=!0),"computeProgress"in this&&(this.progress=this.computeProgress())}}_step(){}getConstructorParams(){throw Error("getConstructorParams not implemented")}solve(){let e=Date.now();for(;!this.solved&&!this.failed;)this.step();let t=Date.now();this.timeToSolve=t-e}visualize(){return{lines:[],points:[],rects:[],circles:[]}}tryFinalAcceptance(){}preview(){return{lines:[],points:[],rects:[],circles:[]}}},Ezt=class{tree;constructor(e=9){this.tree=new JV(e)}insert(e,t,n,o,r){this.tree.insert({minX:t,minY:n,maxX:o,maxY:r,data:e})}bulkLoad(e){let t=e.map(({item:n,minX:o,minY:r,maxX:i,maxY:s})=>({minX:o,minY:r,maxX:i,maxY:s,data:n}));this.tree.load(t)}search(e,t,n,o){return this.tree.search({minX:e,minY:t,maxX:n,maxY:o}).map((r)=>r.data)}clear(){this.tree.clear()}},Urn=class{index;items=[];currentIndex=0;capacity;constructor(e){this.capacity=Math.max(1,e),this.index=new R_(this.capacity)}insert(e,t,n,o,r){if(this.currentIndex>=this.index.numItems)throw Error("Exceeded initial capacity");this.items[this.currentIndex]=e,this.index.add(t,n,o,r),this.currentIndex++}finish(){this.index.finish()}search(e,t,n,o){return this.index.search(e,t,n,o).map((r)=>this.items[r]||null).filter(Boolean)}clear(){this.items=[],this.currentIndex=0,this.index=new R_(this.capacity)}},EZe=class{idx;storage=[];constructor(e="native",t=[]){e==="flatbush"?t.length===0?(this.idx=new Ezt,e="rbush"):this.idx=new Urn(t.length):this.idx=e==="rbush"?new Ezt:new class{shi=new V1r(t);insert(n){}search(n,o,r,i){let s=(n+r)/2,a=(o+i)/2,c=r-n,l=i-o;return this.shi.getNodesInArea(s,a,c,l)}clear(){}},t.forEach((n)=>this.insert(n)),e==="flatbush"&&t.length>0&&this.idx.finish?.()}insert(e){this.storage.push(e),this.idx.insert(e,e.center.x-e.width/2,e.center.y-e.height/2,e.center.x+e.width/2,e.center.y+e.height/2)}search(e){return this.idx.search(e.minX,e.minY,e.maxX,e.maxY)}searchArea(e,t,n,o){return this.search({minX:e-n/2,minY:t-o/2,maxX:e+n/2,maxY:t+o/2})}},V1r=class{constructor(e){this.obstacles=e,this.buckets=new Map;for(let t=0;t<e.length;t++){let n=e[t],o=n.center.x-n.width/2,r=n.center.y-n.height/2,i=n.center.x+n.width/2,s=n.center.y+n.height/2;for(let a=o;a<=i;a+=this.CELL_SIZE)for(let c=r;c<=s;c+=this.CELL_SIZE){let l=this.getBucketKey(a,c),h=this.buckets.get(l);h?h.push([n,t]):this.buckets.set(l,[[n,t]])}}}obstacles;buckets;CELL_SIZE=0.4;getBucketKey(e,t){return`${Math.floor(e/this.CELL_SIZE)}x${Math.floor(t/this.CELL_SIZE)}`}getNodesInArea(e,t,n,o){let r=[],i=new Set,s=t-o/2,a=e+n/2,c=t+o/2;for(let l=e-n/2;l<=a;l+=this.CELL_SIZE)for(let h=s;h<=c;h+=this.CELL_SIZE){let d=this.getBucketKey(l,h),u=this.buckets.get(d)||[];for(let _ of u)i.has(_[1])||(i.add(_[1]),r.push(_[0]))}return r}},z4e=(e)=>({minX:Math.min(e[0].x,e[1].x),maxX:Math.max(e[0].x,e[1].x),minY:Math.min(e[0].y,e[1].y),maxY:Math.max(e[0].y,e[1].y)});function U3e(e,t){let n=e.x-t.x,o=e.y-t.y;return n*n+o*o}function fV(e,t,n){let o=U3e(t,n);if(o===0)return U3e(e,t);let r=((e.x-t.x)*(n.x-t.x)+(e.y-t.y)*(n.y-t.y))/o;return r=Math.max(0,Math.min(1,r)),U3e(e,{x:t.x+r*(n.x-t.x),y:t.y+r*(n.y-t.y)})}function Mzt(e,t,n,o){if(Ru(e,t,n,o))return 0;let r={x:e.x,y:e.y},i={x:t.x,y:t.y},s={x:n.x,y:n.y},a={x:o.x,y:o.y};return Math.min(fV(r,s,a),fV(i,s,a),fV(s,r,i),fV(a,r,i))}var yV=class{segmentBuckets;viaBuckets;CELL_SIZE;maximumCopperRadius=0;constructor(e,t=1){this.segmentBuckets=new Map,this.viaBuckets=new Map,this.CELL_SIZE=t;for(let n of e)if(n&&n.connectionName){if(this.maximumCopperRadius=Math.max(this.maximumCopperRadius,n.traceThickness/2,n.viaDiameter/2),n.route&&n.route.length>=2)for(let o=0;o<n.route.length-1;o++){let r=n.route[o],i=n.route[o+1];if(r.x===i.x&&r.y===i.y)continue;if(r.insideJumperPad&&i.insideJumperPad)continue;let s=[r,i],a=z4e(s),c={segmentId:`${n.connectionName}-seg-${o}`,segment:s,parentRoute:n},l=Math.floor(a.minX/this.CELL_SIZE),h=Math.floor((a.maxX+0.000000001)/this.CELL_SIZE),d=Math.floor(a.minY/this.CELL_SIZE),u=Math.floor((a.maxY+0.000000001)/this.CELL_SIZE);for(let _=l;_<=h;_++)for(let p=d;p<=u;p++){let m=`${_}x${p}`,A=this.segmentBuckets.get(m);A||(A=[],this.segmentBuckets.set(m,A)),A.push(c)}}if(n.vias&&n.vias.length>0)for(let o=0;o<n.vias.length;o++){let r=n.vias[o];if(r==null)continue;let i={viaId:`${n.connectionName}-via-${o}`,x:r.x,y:r.y,parentRoute:n},s=`${Math.floor(r.x/this.CELL_SIZE)}x${Math.floor(r.y/this.CELL_SIZE)}`,a=this.viaBuckets.get(s);a||(a=[],this.viaBuckets.set(s,a)),a.push(i)}}else console.warn("Skipping route with missing data:",n)}hasConflictingRoutesForSegment(e,t,n,o,r){let i=z4e([e,t]),s=n+this.maximumCopperRadius,a=Math.floor((i.minX-s)/this.CELL_SIZE),c=Math.floor((i.maxX+s+0.000000001)/this.CELL_SIZE),l=Math.floor((i.minY-s)/this.CELL_SIZE),h=Math.floor((i.maxY+s+0.000000001)/this.CELL_SIZE),d=new Set,u=new Set;for(let _=a;_<=c;_++)for(let p=l;p<=h;p++){let m=`${_}x${p}`,A=this.segmentBuckets.get(m);if(A)for(let f of A){let y=f.parentRoute,[x,C]=f.segment;if(e.z!==t.z||x.z!==C.z||x.z!==e.z||o(y)||d.has(f.segmentId))continue;d.add(f.segmentId);let b=n+y.traceThickness/2,I=Mzt(e,t,x,C);if(I<b*b&&(!r||Math.sqrt(I)<r(y)))return!0}let g=this.viaBuckets.get(m);if(g)for(let f of g){let y=f.parentRoute;if(o(y)||u.has(f.viaId))continue;u.add(f.viaId);let x=n+y.viaDiameter/2,C=fV(f,e,t);if(C<x*x&&(!r||Math.sqrt(C)<r(y)))return!0}}return!1}getConflictingRoutesForSegment(e,t,n,o){let r=z4e([e,t]),i=n+this.maximumCopperRadius,s=r.minX-i,a=r.minY-i,c=r.maxX+i,l=r.maxY+i,h=Math.floor(s/this.CELL_SIZE),d=Math.floor((c+0.000000001)/this.CELL_SIZE),u=Math.floor(a/this.CELL_SIZE),_=Math.floor((l+0.000000001)/this.CELL_SIZE),p=new Map,m=new Set,A=new Set,g={x:e.x,y:e.y},f={x:t.x,y:t.y};for(let x=h;x<=d;x++)for(let C=u;C<=_;C++){let b=`${x}x${C}`,I=this.segmentBuckets.get(b);if(I)for(let P of I){if(m.has(P.segmentId))continue;m.add(P.segmentId);let M=P.parentRoute,[B,T]=P.segment;if(e.z!==t.z||B.z!==T.z||B.z!==e.z)continue;if(o?.(M))continue;let N=n+M.traceThickness/2,D=N*N,L=Mzt(e,t,B,T);if(L<D){let H=M.connectionName,V=p.get(H);(!V||L<V.minDistSq)&&p.set(H,{route:M,minDistSq:L})}}let v=this.viaBuckets.get(b);if(v)for(let P of v){if(A.has(P.viaId))continue;A.add(P.viaId);let M=P.parentRoute;if(o?.(M))continue;let B={x:P.x,y:P.y},T=n+M.viaDiameter/2,N=T*T,D=fV(B,g,f);if(D<N){let L=M.connectionName,H=p.get(L);(!H||D<H.minDistSq)&&p.set(L,{route:M,minDistSq:D})}}}let y=[];for(let x of p.values())y.push({conflictingRoute:x.route,distance:Math.sqrt(x.minDistSq)});return y}removeRoute(e){for(let[t,n]of this.segmentBuckets){let o=n.filter((r)=>r.parentRoute.connectionName!==e);o.length===0?this.segmentBuckets.delete(t):o.length!==n.length&&this.segmentBuckets.set(t,o)}for(let[t,n]of this.viaBuckets){let o=n.filter((r)=>r.parentRoute.connectionName!==e);o.length===0?this.viaBuckets.delete(t):o.length!==n.length&&this.viaBuckets.set(t,o)}}addRoute(e){if(!e||!e.connectionName)return void console.warn("Skipping route with missing data:",e);if(this.maximumCopperRadius=Math.max(this.maximumCopperRadius,e.traceThickness/2,e.viaDiameter/2),e.route&&e.route.length>=2)for(let t=0;t<e.route.length-1;t++){let n=e.route[t],o=e.route[t+1];if(n.x===o.x&&n.y===o.y)continue;if(n.insideJumperPad&&o.insideJumperPad)continue;let r=[n,o],i=z4e(r),s={segmentId:`${e.connectionName}-seg-${t}`,segment:r,parentRoute:e},a=Math.floor(i.minX/this.CELL_SIZE),c=Math.floor((i.maxX+0.000000001)/this.CELL_SIZE),l=Math.floor(i.minY/this.CELL_SIZE),h=Math.floor((i.maxY+0.000000001)/this.CELL_SIZE);for(let d=a;d<=c;d++)for(let u=l;u<=h;u++){let _=`${d}x${u}`,p=this.segmentBuckets.get(_);p||(p=[],this.segmentBuckets.set(_,p)),p.push(s)}}if(e.vias&&e.vias.length>0)for(let t=0;t<e.vias.length;t++){let n=e.vias[t];if(n==null)continue;let o={viaId:`${e.connectionName}-via-${t}`,x:n.x,y:n.y,parentRoute:e},r=`${Math.floor(n.x/this.CELL_SIZE)}x${Math.floor(n.y/this.CELL_SIZE)}`,i=this.viaBuckets.get(r);i||(i=[],this.viaBuckets.set(r,i)),i.push(o)}}getConflictingRoutesNearPoint(e,t,n){let o=t+this.maximumCopperRadius,r=e.x-o,i=e.y-o,s=e.x+o,a=e.y+o,c=Math.floor(r/this.CELL_SIZE),l=Math.floor((s+0.000000001)/this.CELL_SIZE),h=Math.floor(i/this.CELL_SIZE),d=Math.floor((a+0.000000001)/this.CELL_SIZE),u=new Map,_=new Set,p=new Set;for(let A=c;A<=l;A++)for(let g=h;g<=d;g++){let f=`${A}x${g}`,y=this.segmentBuckets.get(f);if(y)for(let C of y){if(_.has(C.segmentId))continue;_.add(C.segmentId);let b=C.segment[0],I=C.segment[1];if(b.z!==I.z||b.z!==e.z)continue;let v=C.parentRoute,P={x:C.segment[0].x,y:C.segment[0].y},M={x:C.segment[1].x,y:C.segment[1].y},B=t+v.traceThickness/2,T=B*B,N=fV(e,P,M);if(N<T){let D=v.connectionName,L=u.get(D);(!L||N<L.minDistSq)&&u.set(D,{route:v,minDistSq:N})}}let x=this.viaBuckets.get(f);if(x)for(let C of x){if(p.has(C.viaId))continue;p.add(C.viaId);let b=C.parentRoute,I={x:C.x,y:C.y},v=t+b.viaDiameter/2,P=v*v,M=U3e(e,I);if(M<P){let B=b.connectionName,T=u.get(B);(!T||M<T.minDistSq)&&u.set(B,{route:b,minDistSq:M})}}}let m=[];for(let A of u.values())m.push({conflictingRoute:A.route,distance:Math.sqrt(A.minDistSq)});return m}},Pce=(e,t)=>{let n=[],o=Math.abs(t.x-e.x),r=Math.abs(t.y-e.y),i=t.x>e.x?1:-1,s=t.y>e.y?1:-1,a={x:t.x-i*Math.abs(t.y-e.y),y:e.y};(a.x-e.x)*i>=0&&(a.x-t.x)*i<=0&&n.push([e,a,t]);let c={x:e.x,y:t.y-s*Math.abs(t.x-e.x)};(c.y-e.y)*s>=0&&(c.y-t.y)*s<=0&&n.push([e,c,t]);let l=Math.min(o,r),h={x:e.x+i*l,y:e.y+s*l};return(h.x-e.x)*i>=0&&(h.x-t.x)*i<=0&&(h.y-e.y)*s>=0&&(h.y-t.y)*s<=0&&n.push([e,h,t]),n},wzt=(e,t)=>{let n=Math.max(Math.abs(e),Math.abs(t));if(n===0||n===Number.POSITIVE_INFINITY)return n;let o=e/n,r=t/n;return n*Math.sqrt(o*o+r*r)};function Wrn(e,t,n,o){if(Ru(e,t,n,o))return 0;let r=O4e(e,n,o),i=O4e(t,n,o),s=O4e(n,e,t),a=O4e(o,e,t);return Math.min(r,i,s,a)}function O4e(e,t,n){let o={x:n.x-t.x,y:n.y-t.y},r=Bzt({x:e.x-t.x,y:e.y-t.y},o);if(r<=0)return bXe(e,t);let i=Bzt(o,o);if(i<=r)return bXe(e,n);let s=r/i;return bXe(e,{x:t.x+s*o.x,y:t.y+s*o.y})}function Bzt(e,t){return e.x*t.x+e.y*t.y}function bXe(e,t){let n=t.x-e.x,o=t.y-e.y;return Math.sqrt(n*n+o*o)}var RCe=0.000001,GKe=(e,t,n)=>xc(e,t,n)<=RCe,V4e=(e,t)=>Math.abs(e.x-t.x)<=RCe&&Math.abs(e.y-t.y)<=RCe,Tzt=(e,t)=>{if(!t||t.length<3)return!1;for(let o=0;o<t.length;o++){let r=t[o],i=t[(o+1)%t.length];if(GKe(e,r,i))return!0}let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o],s=t[r];i.y>e.y!=s.y>e.y&&e.x<(s.x-i.x)*(e.y-i.y)/(s.y-i.y)+i.x&&(n=!n)}return n},QCe=({start:e,end:t,polygon:n,margin:o=0.2})=>{if(!n||n.length<3)return!1;let r=Tzt(e,n),i=Tzt(t,n);if(!r||!i)return!0;for(let s=0;s<n.length;s++){let a=n[s],c=n[(s+1)%n.length],l=GKe(e,a,c),h=GKe(t,a,c);if(l&&h)continue;if(!Ru(e,t,a,c)){if(!l&&!h){if(Wrn(e,t,a,c)<o-RCe)return!0}continue}let d=pB(e,t,a,c);if((!d||!(l&&V4e(d,e)||h&&V4e(d,t)))&&(!d||!V4e(d,e)&&!V4e(d,t)))return!0}return!1},hce=(e)=>{let t=[],n=e.route;if(n.length===0)return[];let o={startIndex:0,endIndex:-1,z:n[0].z,points:[n[0]]};for(let r=1;r<n.length;r++)n[r].z===o.z?o.points.push(n[r]):(o.endIndex=r-1,t.push(o),o={startIndex:r,endIndex:-1,z:n[r].z,points:[n[r]]});return o.endIndex=n.length-1,t.push(o),t},Dzt=({endpointX:e,endpointY:t,targetZ:n,endpointPcbPortId:o,terminalLayerIndicesByPcbPortId:r,obstacleSHI:i,route:s,connMap:a})=>{let c=o?r?.get(o):void 0;if(c&&!c.has(n))return!1;let l=[s.connectionName,s.rootConnectionName].filter((d)=>d!==void 0),h=i.searchArea(e,t,2,2).filter((d)=>{if(!l.some((A)=>d.connectedTo.some((g)=>g===A||a.areIdsConnected(A,g))))return!1;let u=d.width/2+0.05,_=d.height/2+0.05,p=Math.abs(e-d.center.x)<=u,m=Math.abs(t-d.center.y)<=_;return p&&m});return h.length>0&&h.some((d)=>d.__zLayers?.includes(n))},S$=({currentSection:e,targetZ:t,route:n,hdRouteSHI:o,obstacleSHI:r,connMap:i,defaultTraceThickness:s,obstacleMargin:a,traceMargin:c,shouldCheckStaticGeometryForSegment:l})=>{let h=n.traceThickness??s,d=c??0,u=[n.connectionName,n.rootConnectionName].filter((_)=>_!==void 0);for(let _=0;_<e.points.length-1;_++){let p={...e.points[_],z:t},m={...e.points[_+1],z:t},A=o.getConflictingRoutesForSegment(p,m,h/2+d);for(let{conflictingRoute:x,distance:C}of A){let b=[x.connectionName,x.rootConnectionName].filter((v)=>v!==void 0);if(u.some((v)=>b.some((P)=>P===v||i.areIdsConnected(P,v))))continue;let I=x.traceThickness??s;if(C<h/2+(d>0?Math.max(I/2,x.viaDiameter/2):I/2)+d)return!1}if(l?.(p,m)===!1)continue;let g={centerX:(p.x+m.x)/2,centerY:(p.y+m.y)/2,width:Math.abs(p.x-m.x),height:Math.abs(p.y-m.y)},f=h/2+a,y=r.searchArea(g.centerX,g.centerY,g.width+2*f,g.height+2*f);for(let x of y){if(u.some((C)=>x.connectedTo.some((b)=>b===C||i.areIdsConnected(b,C))))continue;if(x.__zLayers?.includes(t)){if(Math.abs(p.x-x.center.x)<0.01&&Math.abs(p.y-x.center.y)<0.01||Math.abs(m.x-x.center.x)<0.01&&Math.abs(m.y-x.center.y)<0.01)continue}if(KS(p,m,x)<f)return!1}}return!0},IXe=({targetZ:e,route:t,hdRouteSHI:n,obstacleSHI:o,connMap:r,defaultTraceThickness:i,obstacleMargin:s,traceMargin:a,useNumericSegmentKeys:c})=>{let l=t.traceThickness??i,h=l/2+a,d=l/2+s,{connectionName:u,rootConnectionName:_}=t,p=new Map,m=new WeakMap,A=new WeakMap,g=c?new Map:void 0,f=0,y=(v)=>{let P=g.get(v.x);P||(P=new Map,g.set(v.x,P));let M=P.get(v.y);return M===void 0&&(M=f++,P.set(v.y,M)),M},x=(v,P)=>{if(c){let M=y(v),B=y(P),T=Math.max(M,B);return T*(T+1)/2+Math.min(M,B)}return v.x<P.x||v.x===P.x&&v.y<=P.y?`${v.x}:${v.y}|${P.x}:${P.y}`:`${P.x}:${P.y}|${v.x}:${v.y}`},C=(v)=>v===u||r.areIdsConnected(v,u)||_!==void 0&&(v===_||r.areIdsConnected(v,_)),b=(v)=>{let P=A.get(v);return P===void 0&&(P=C(v.connectionName)||v.rootConnectionName!==void 0&&C(v.rootConnectionName),A.set(v,P)),P},I=(v)=>l/2+Math.max((v.traceThickness??i)/2,v.viaDiameter/2)+a;return(v,P)=>{let M=v.length-1;for(let B=0;B<M;B++){let T=B-1,N=P===0?B:B===0?P:T>=P?T+1:T,D=v[N],L=v[N+1],H=x(D,L),V=p.get(H);if(V!==void 0){if(!V)return!1;continue}let O=D.z===e?D:{...D,z:e},U=L.z===e?L:{...L,z:e},j={centerX:(O.x+U.x)/2,centerY:(O.y+U.y)/2,width:Math.abs(O.x-U.x),height:Math.abs(O.y-U.y)},Y=o.searchArea(j.centerX,j.centerY,j.width+2*d,j.height+2*d);for(let X of Y){let K=m.get(X);if(K===void 0&&(K=X.connectedTo.some(C),m.set(X,K)),K)continue;if(X.__zLayers?.includes(e)){if(Math.abs(O.x-X.center.x)<0.01&&Math.abs(O.y-X.center.y)<0.01||Math.abs(U.x-X.center.x)<0.01&&Math.abs(U.y-X.center.y)<0.01)continue}if(KS(O,U,X)<d)return p.set(H,!1),!1}if(n.hasConflictingRoutesForSegment(O,U,h,b,I))return p.set(H,!1),!1;p.set(H,!0)}return!0}},Y1r=class extends lY{getSolverName(){return"SingleRouteUselessViaRemovalSolver"}obstacleSHI;hdRouteSHI;unsimplifiedRoute;connMap;outline;terminalLayerIndicesByPcbPortId;routeSections;currentSectionIndex;sameNetRouteCache=new WeakMap;detourContexts=new WeakMap;TRACE_THICKNESS=0.15;OBSTACLE_MARGIN=0.1;GEOMETRY_SHORTCUT_TRACE_MARGIN=0.1;GEOMETRY_SHORTCUT_OBSTACLE_MARGIN=0.15;MAX_GEOMETRY_SHORTCUT_ADDED_LENGTH=4;ENABLE_GEOMETRY_SHORTCUTS=!0;ENABLE_OBSTACLE_DETOUR_SHORTCUTS=!1;ENABLE_ROUTED_TRACE_DETOURS=!1;PRESERVE_ROUTE_ENDPOINTS=!1;geometryShortcutsApplied=0;multilayerSectionsCollapsed=0;obstacleDetourCandidatesValidated=0;constructor(e){super(),this.currentSectionIndex=0,this.obstacleSHI=e.obstacleSHI,this.hdRouteSHI=e.hdRouteSHI,this.unsimplifiedRoute=e.unsimplifiedRoute,this.connMap=e.connMap,this.outline=e.outline,this.terminalLayerIndicesByPcbPortId=e.terminalLayerIndicesByPcbPortId,this.GEOMETRY_SHORTCUT_TRACE_MARGIN=e.geometryShortcutTraceMargin??this.GEOMETRY_SHORTCUT_TRACE_MARGIN,this.GEOMETRY_SHORTCUT_OBSTACLE_MARGIN=e.geometryShortcutObstacleMargin??this.GEOMETRY_SHORTCUT_OBSTACLE_MARGIN,this.ENABLE_GEOMETRY_SHORTCUTS=e.enableGeometryShortcuts??!0,this.ENABLE_OBSTACLE_DETOUR_SHORTCUTS=e.enableObstacleDetourShortcuts??!1,this.ENABLE_ROUTED_TRACE_DETOURS=e.enableRoutedTraceDetours??!1,this.PRESERVE_ROUTE_ENDPOINTS=e.preserveRouteEndpoints??!1,this.routeSections=hce(this.unsimplifiedRoute)}getPathLength(e){let t=0;for(let n=1;n<e.length;n++)t+=wzt(e[n].x-e[n-1].x,e[n].y-e[n-1].y);return t}normalizeShortcutPath(e,t,n){let o=e.filter((r,i)=>{let s=e[i-1];return!s||r.x!==s.x||r.y!==s.y});return o.map((r,i)=>i===0?{...t}:i===o.length-1?{...n}:{x:r.x,y:r.y,z:t.z})}shortcutCrossesOutline(e){if(!this.outline||this.outline.length<3)return!1;for(let t=1;t<e.length;t++)if(QCe({start:e[t-1],end:e[t],polygon:this.outline}))return!0;return!1}isRouteOnSameNet(e){let t=this.sameNetRouteCache.get(e);if(t!==void 0)return t;let n=[this.unsimplifiedRoute.connectionName,this.unsimplifiedRoute.rootConnectionName].filter((i)=>i!==void 0),o=[e.connectionName,e.rootConnectionName].filter((i)=>i!==void 0),r=n.some((i)=>o.some((s)=>i===s||this.connMap.areIdsConnected(i,s)));return this.sameNetRouteCache.set(e,r),r}getObstacleDetourContext(e,t,n){let o=this.ENABLE_ROUTED_TRACE_DETOURS?this.detourContexts.get(e)?.get(t):void 0;if(o?.targetZ===n)return o;let r=this.unsimplifiedRoute.traceThickness??this.TRACE_THICKNESS,i=r/2+this.GEOMETRY_SHORTCUT_OBSTACLE_MARGIN+0.000001,s=this.MAX_GEOMETRY_SHORTCUT_ADDED_LENGTH/2+i,a=Math.min(e.x,t.x)-s,c=Math.max(e.x,t.x)+s,l=Math.min(e.y,t.y)-s,h=Math.max(e.y,t.y)+s,d=this.obstacleSHI.search({minX:a,minY:l,maxX:c,maxY:h}).filter((g)=>g.__zLayers?.includes(n)),u=this.ENABLE_ROUTED_TRACE_DETOURS?this.hdRouteSHI.getConflictingRoutesForSegment({...e,z:n},{...t,z:n},r/2+this.GEOMETRY_SHORTCUT_TRACE_MARGIN,(g)=>this.isRouteOnSameNet(g)):[],_=[],p=new Set,m=new Set;for(let g of d)p.add(g.center.x-g.width/2-i),p.add(g.center.x+g.width/2+i),m.add(g.center.y-g.height/2-i),m.add(g.center.y+g.height/2+i);for(let{conflictingRoute:g}of u){let f=g.route.filter((x)=>x.z===n&&x.x>=a&&x.x<=c&&x.y>=l&&x.y<=h);if(f.length===0)continue;let y=r/2+Math.max(g.traceThickness/2,g.viaDiameter/2)+this.GEOMETRY_SHORTCUT_TRACE_MARGIN+0.000001;p.add(Math.min(...f.map((x)=>x.x))-y),p.add(Math.max(...f.map((x)=>x.x))+y),m.add(Math.min(...f.map((x)=>x.y))-y),m.add(Math.max(...f.map((x)=>x.y))+y);{let x=Math.min(...f.map((v)=>v.x))-y,C=Math.max(...f.map((v)=>v.x))+y,b=Math.min(...f.map((v)=>v.y))-y,I=Math.max(...f.map((v)=>v.y))+y;_.push({x,y:b},{x,y:I},{x:C,y:b},{x:C,y:I})}}let A={targetZ:n,traceCorners:_,corridorXs:p,corridorYs:m};if(this.ENABLE_ROUTED_TRACE_DETOURS){let g=this.detourContexts.get(e)??new WeakMap;g.set(t,A),this.detourContexts.set(e,g)}return A}getObstacleDetourPaths(e,t,n,o,r=!1,i){let{traceCorners:s,corridorXs:a,corridorYs:c}=this.getObstacleDetourContext(e,t,n),l=[],h=new Set,d=(u)=>{let _=0;for(let f=1;f<u.length;f++)_+=wzt(u[f].x-u[f-1].x,u[f].y-u[f-1].y);if(_>o)return;if(i){let f=0,y=-1;for(let x=0;x<u.length-1;x++){let C=u[x+1].x-u[x].x,b=u[x+1].y-u[x].y,I=C*C+b*b;I>y&&(f=x,y=I)}if(!i([{...u[f],z:e.z},{...u[f+1],z:e.z}],0))return}let p=this.normalizeShortcutPath(u,e,t),m=0,A=-1;for(let f=0;f<p.length-1;f++){let y=p[f+1].x-p[f].x,x=p[f+1].y-p[f].y,C=y*y+x*x;C>A&&(m=f,A=C)}let g=p.map((f)=>`${f.x}:${f.y}`).join("|");h.has(g)||(h.add(g),l.push({path:p,length:_,longestSegmentIndex:m}))};if(r){for(let u of s)for(let _ of Pce(e,u))for(let p of Pce(u,t))d([..._,...p.slice(1)]);return l}for(let u of c)d([e,{x:e.x,y:u},{x:t.x,y:u},t]);for(let u of a)d([e,{x:u,y:e.y},{x:u,y:t.y},t]);return l}getDirectGeometryShortcut(e,t,n){let o=null,r=IXe({targetZ:e.z,route:this.unsimplifiedRoute,hdRouteSHI:this.hdRouteSHI,obstacleSHI:this.obstacleSHI,connMap:this.connMap,defaultTraceThickness:this.TRACE_THICKNESS,obstacleMargin:this.GEOMETRY_SHORTCUT_OBSTACLE_MARGIN,traceMargin:this.GEOMETRY_SHORTCUT_TRACE_MARGIN,useNumericSegmentKeys:!0});for(let i=0;i<e.points.length;i++){let s=e.points[i];for(let a=0;a<n.points.length;a++){let c=n.points[a],l=[...e.points.slice(i),...t.points,...n.points.slice(0,a+1)];if(!l.some((h)=>h.insideJumperPad||h.toNextSegmentType))for(let h of Pce(s,c)){let d=this.normalizeShortcutPath(h,s,c),u=this.getPathLength(l)-this.getPathLength(d);if(u<-0.000001)continue;r(d,0)&&!this.shortcutCrossesOutline(d)&&((!o||u>o.savedLength)&&(o={path:d,previousPointIndex:i,nextPointIndex:a,savedLength:u}))}}}return o}getObstacleDetourShortcut(e,t,n,o=!1){let r=e.points.length-1,i=[];for(let d=0;d<=r;d++)i.push([d,0]);for(let d=1;d<n.points.length;d++)i.push([r,d]);let s=this.ENABLE_ROUTED_TRACE_DETOURS?IXe({targetZ:e.z,route:this.unsimplifiedRoute,hdRouteSHI:this.hdRouteSHI,obstacleSHI:this.obstacleSHI,connMap:this.connMap,defaultTraceThickness:this.TRACE_THICKNESS,obstacleMargin:this.GEOMETRY_SHORTCUT_OBSTACLE_MARGIN,traceMargin:this.GEOMETRY_SHORTCUT_TRACE_MARGIN,useNumericSegmentKeys:!0}):void 0,a=[];for(let[d,u]of i){let _=e.points[d],p=n.points[u],m=[...e.points.slice(d),...t.points,...n.points.slice(0,u+1)];if(m.some((g)=>g.insideJumperPad||g.toNextSegmentType))continue;let A=this.getPathLength(m);for(let{path:g,length:f,longestSegmentIndex:y}of this.getObstacleDetourPaths(_,p,e.z,A+this.MAX_GEOMETRY_SHORTCUT_ADDED_LENGTH+0.000001,o,s)){let x=A-f;x<-this.MAX_GEOMETRY_SHORTCUT_ADDED_LENGTH-0.000001||a.push({path:g,previousPointIndex:d,nextPointIndex:u,savedLength:x,validationFirstSegmentIndex:y})}}a.sort((d,u)=>u.savedLength-d.savedLength);let c=0,l=a.length>=256,h=s??IXe({targetZ:e.z,route:this.unsimplifiedRoute,hdRouteSHI:this.hdRouteSHI,obstacleSHI:this.obstacleSHI,connMap:this.connMap,defaultTraceThickness:this.TRACE_THICKNESS,obstacleMargin:this.GEOMETRY_SHORTCUT_OBSTACLE_MARGIN,traceMargin:this.GEOMETRY_SHORTCUT_TRACE_MARGIN,useNumericSegmentKeys:l});for(let d of a){c++;let{path:u}=d;if(h(u,d.validationFirstSegmentIndex??0)&&!this.shortcutCrossesOutline(u))return this.obstacleDetourCandidatesValidated+=c,this.stats.obstacleDetourCandidatesValidated=this.obstacleDetourCandidatesValidated,d}return this.obstacleDetourCandidatesValidated+=c,this.stats.obstacleDetourCandidatesValidated=this.obstacleDetourCandidatesValidated,null}findGeometryShortcut(e,t,n){if(this.detourContexts=new WeakMap,this.unsimplifiedRoute.jumpers?.length)return null;if(this.ENABLE_GEOMETRY_SHORTCUTS){let r=this.getDirectGeometryShortcut(e,t,n);if(r)return r}if(!this.ENABLE_OBSTACLE_DETOUR_SHORTCUTS)return null;let o=this.getObstacleDetourShortcut(e,t,n);return o||!this.ENABLE_ROUTED_TRACE_DETOURS?o:this.getObstacleDetourShortcut(e,t,n,!0)}applyGeometryShortcut(e){let t=this.routeSections[this.currentSectionIndex-1],n=this.routeSections[this.currentSectionIndex+1],o=[...t.points.slice(0,e.previousPointIndex),...e.path,...n.points.slice(e.nextPointIndex+1)].filter((r,i,s)=>{let a=s[i-1];return!a||r.x!==a.x||r.y!==a.y||r.z!==a.z});this.routeSections.splice(this.currentSectionIndex-1,3,{startIndex:t.startIndex,endIndex:n.endIndex,z:t.z,points:o}),this.geometryShortcutsApplied++,this.stats.geometryShortcutsApplied=this.geometryShortcutsApplied,this.stats.viasRemovedByGeometryShortcuts=2*this.geometryShortcutsApplied,this.currentSectionIndex=Math.max(0,this.currentSectionIndex-1)}findMultilayerSectionCollapse(e,t,n){if(e.z===n.z||this.unsimplifiedRoute.jumpers?.length)return null;let o=e.points[e.points.length-1];if(o?.insideJumperPad||o?.toNextSegmentType||t.points.some((i)=>i.insideJumperPad||i.toNextSegmentType))return null;let r=[{targetZ:e.z,mergeWith:"previous"},{targetZ:n.z,mergeWith:"next"}];for(let i of r)if(i.targetZ!==t.z&&S$({currentSection:t,targetZ:i.targetZ,route:this.unsimplifiedRoute,hdRouteSHI:this.hdRouteSHI,obstacleSHI:this.obstacleSHI,connMap:this.connMap,defaultTraceThickness:this.TRACE_THICKNESS,obstacleMargin:this.GEOMETRY_SHORTCUT_OBSTACLE_MARGIN,traceMargin:this.GEOMETRY_SHORTCUT_TRACE_MARGIN}))return i;return null}applyMultilayerSectionCollapse(e){let t=this.routeSections[this.currentSectionIndex-1],n=this.routeSections[this.currentSectionIndex],o=this.routeSections[this.currentSectionIndex+1],r=n.points.map((s)=>({...s,z:e.targetZ})),i=(s)=>s.filter((a,c)=>{let l=s[c-1];return!l||a.x!==l.x||a.y!==l.y||a.z!==l.z});e.mergeWith==="previous"?this.routeSections.splice(this.currentSectionIndex-1,2,{startIndex:t.startIndex,endIndex:n.endIndex,z:e.targetZ,points:i([...t.points,...r])}):this.routeSections.splice(this.currentSectionIndex,2,{startIndex:n.startIndex,endIndex:o.endIndex,z:e.targetZ,points:i([...r,...o.points])}),this.multilayerSectionsCollapsed++,this.stats.multilayerSectionsCollapsed=this.multilayerSectionsCollapsed,this.stats.viasRemovedByMultilayerSectionCollapses=this.multilayerSectionsCollapsed,this.currentSectionIndex=Math.max(0,this.currentSectionIndex-1)}_step(){if(this.currentSectionIndex>=this.routeSections.length)return void(this.solved=!0);if(this.currentSectionIndex===0&&this.routeSections.length>1){let i=this.routeSections[0],s=this.routeSections[1];if(!this.PRESERVE_ROUTE_ENDPOINTS&&i.z!==s.z){let a=s.z,c=i.points[0];if(Dzt({endpointX:c.x,endpointY:c.y,targetZ:a,endpointPcbPortId:this.unsimplifiedRoute.startPcbPortId,terminalLayerIndicesByPcbPortId:this.terminalLayerIndicesByPcbPortId,obstacleSHI:this.obstacleSHI,route:this.unsimplifiedRoute,connMap:this.connMap})&&S$({currentSection:i,targetZ:a,route:this.unsimplifiedRoute,hdRouteSHI:this.hdRouteSHI,obstacleSHI:this.obstacleSHI,connMap:this.connMap,defaultTraceThickness:this.TRACE_THICKNESS,obstacleMargin:this.OBSTACLE_MARGIN}))return i.z=a,i.points=i.points.map((l)=>({...l,z:a})),void(this.currentSectionIndex=2)}return void this.currentSectionIndex++}if(this.currentSectionIndex===this.routeSections.length-1){if(!this.PRESERVE_ROUTE_ENDPOINTS&&this.routeSections.length>=2){let i=this.routeSections[this.routeSections.length-1],s=this.routeSections[this.routeSections.length-2];if(i.z!==s.z){let a=s.z,c=i.points[i.points.length-1];Dzt({endpointX:c.x,endpointY:c.y,targetZ:a,endpointPcbPortId:this.unsimplifiedRoute.endPcbPortId,terminalLayerIndicesByPcbPortId:this.terminalLayerIndicesByPcbPortId,obstacleSHI:this.obstacleSHI,route:this.unsimplifiedRoute,connMap:this.connMap})&&S$({currentSection:i,targetZ:a,route:this.unsimplifiedRoute,hdRouteSHI:this.hdRouteSHI,obstacleSHI:this.obstacleSHI,connMap:this.connMap,defaultTraceThickness:this.TRACE_THICKNESS,obstacleMargin:this.OBSTACLE_MARGIN})&&(i.z=a,i.points=i.points.map((l)=>({...l,z:a})))}}return void(this.solved=!0)}let e=this.routeSections[this.currentSectionIndex-1],t=this.routeSections[this.currentSectionIndex],n=this.routeSections[this.currentSectionIndex+1];if(e.z!==n.z){let i=this.findMultilayerSectionCollapse(e,t,n);return i?void this.applyMultilayerSectionCollapse(i):void this.currentSectionIndex++}let o=e.z;if(S$({currentSection:t,targetZ:o,route:this.unsimplifiedRoute,hdRouteSHI:this.hdRouteSHI,obstacleSHI:this.obstacleSHI,connMap:this.connMap,defaultTraceThickness:this.TRACE_THICKNESS,obstacleMargin:this.OBSTACLE_MARGIN}))return t.z=o,t.points=t.points.map((i)=>({...i,z:o})),void(this.currentSectionIndex+=2);let r=this.findGeometryShortcut(e,t,n);r?this.applyGeometryShortcut(r):this.currentSectionIndex++}getConstructorParams(){return{obstacleSHI:this.obstacleSHI,hdRouteSHI:this.hdRouteSHI,unsimplifiedRoute:this.unsimplifiedRoute,connMap:this.connMap,outline:this.outline,geometryShortcutTraceMargin:this.GEOMETRY_SHORTCUT_TRACE_MARGIN,geometryShortcutObstacleMargin:this.GEOMETRY_SHORTCUT_OBSTACLE_MARGIN,enableGeometryShortcuts:this.ENABLE_GEOMETRY_SHORTCUTS,enableObstacleDetourShortcuts:this.ENABLE_OBSTACLE_DETOUR_SHORTCUTS,enableRoutedTraceDetours:this.ENABLE_ROUTED_TRACE_DETOURS,preserveRouteEndpoints:this.PRESERVE_ROUTE_ENDPOINTS,terminalLayerIndicesByPcbPortId:this.terminalLayerIndicesByPcbPortId}}getOptimizedHdRoute(){let e=this.routeSections.flatMap((n)=>n.points),t=[];for(let n=0;n<e.length-1;n++)e[n].z!==e[n+1].z&&t.push({x:e[n].x,y:e[n].y});return{connectionName:this.unsimplifiedRoute.connectionName,rootConnectionName:this.unsimplifiedRoute.rootConnectionName,startPcbPortId:this.unsimplifiedRoute.startPcbPortId,endPcbPortId:this.unsimplifiedRoute.endPcbPortId,route:e,traceThickness:this.unsimplifiedRoute.traceThickness,vias:t,viaDiameter:this.unsimplifiedRoute.viaDiameter,jumpers:this.unsimplifiedRoute.jumpers}}visualize(){let e={circles:[],lines:[],points:[],rects:[],coordinateSystem:"cartesian",title:"Single Route Useless Via Removal Solver"};for(let t=0;t<this.routeSections.length;t++){let n=this.routeSections[t];e.lines.push({points:n.points,strokeWidth:this.TRACE_THICKNESS,strokeColor:t===this.currentSectionIndex?"orange":n.z===0?"red":"blue"})}return e}},Nzt=(e,t)=>{try{return A$(t,e)}catch(n){return console.error(n),e}},Cq={"0603":{length:1.65,width:0.95,padLength:0.8,padWidth:0.95},1206:{length:3.2,width:1.6,padLength:0.6,padWidth:1.6},"1206x4_pair":{length:2.7,width:0.5,padLength:0.8,padWidth:0.5}};function G1r(e,t={}){let n=[],o=[],r=t.color??"gray",i=t.label,s=Cq[e.footprint]??Cq["0603"],a=e.end.x-e.start.x,c=e.end.y-e.start.y,l=Math.abs(a)>Math.abs(c),h=l?s.padLength:s.padWidth,d=l?s.padWidth:s.padLength;return n.push({center:e.start,width:h,height:d,fill:Nzt(r,0.5),stroke:"rgba(0, 0, 0, 0.5)",layer:"jumper",label:i?`${i} (start)`:void 0}),n.push({center:e.end,width:h,height:d,fill:Nzt(r,0.5),stroke:"rgba(0, 0, 0, 0.5)",layer:"jumper",label:i?`${i} (end)`:void 0}),o.push({points:[e.start,e.end],strokeColor:"rgba(100, 100, 100, 0.8)",strokeWidth:0.3*s.padWidth,layer:"jumper-body"}),{rects:n,lines:o}}function MZe(e,t={}){let n={rects:[],lines:[]};for(let o of e){let{rects:r,lines:i}=G1r(o,t);n.rects.push(...r),n.lines.push(...i)}return n}function Xrn(e,t){return[...new Set(e)].filter((n)=>Number.isInteger(n)&&n>=0&&n<t).sort((n,o)=>n-o)}function U1r(e,t){return Xrn(e.map((n)=>((o,r)=>o==="top"?0:o==="bottom"?r-1:parseInt(o.slice(5)))(n,t)),t)}var Yle=(e,t=2)=>{let n=Array.from({length:t},(o,r)=>r);return e.map((o)=>{let r=Xrn(o.__zLayers??(o.layers?U1r(o.layers,t):void 0)??n,t);return{...o,__zLayers:r.length>0?r:n}})},jrn=class extends lY{constructor(e){super(),this.input=e,this.input={...e,obstacles:Yle(e.obstacles,e.layerCount)},this.MAX_ITERATIONS=1e6,this.unsimplifiedHdRoutes=e.unsimplifiedHdRoutes,this.optimizedHdRoutes=[],this.unprocessedRoutes=[...e.unsimplifiedHdRoutes],this.obstacleSHI=new EZe("flatbush",this.input.obstacles),this.hdRouteSHI=new yV([...this.unsimplifiedHdRoutes,...e.otherHdRoutes??[]])}input;getSolverName(){return"UselessViaRemovalSolver"}unsimplifiedHdRoutes;optimizedHdRoutes;unprocessedRoutes;activeSubSolver=null;obstacleSHI=null;hdRouteSHI=null;_step(){if(this.activeSubSolver){if(this.activeSubSolver.step(),this.activeSubSolver.solved){let t=this.activeSubSolver.getOptimizedHdRoute();this.hdRouteSHI.removeRoute(t.connectionName),this.hdRouteSHI.addRoute(t),this.optimizedHdRoutes.push(t),this.activeSubSolver=null}else(this.activeSubSolver.failed||this.activeSubSolver.error)&&(this.error=this.activeSubSolver.error,this.failed=!0);return}let e=this.unprocessedRoutes.shift();e?this.activeSubSolver=new Y1r({hdRouteSHI:this.hdRouteSHI,obstacleSHI:this.obstacleSHI,unsimplifiedRoute:e,connMap:this.input.connMap,outline:this.input.outline,geometryShortcutTraceMargin:this.input.geometryShortcutTraceMargin,geometryShortcutObstacleMargin:this.input.geometryShortcutObstacleMargin,enableGeometryShortcuts:this.input.enableGeometryShortcuts,enableObstacleDetourShortcuts:this.input.enableObstacleDetourShortcuts,enableRoutedTraceDetours:this.input.enableRoutedTraceDetours,preserveRouteEndpoints:this.input.preserveRouteEndpoints,terminalLayerIndicesByPcbPortId:this.input.terminalLayerIndicesByPcbPortId}):this.solved=!0}getOptimizedHdRoutes(){return this.optimizedHdRoutes}visualize(){let e={lines:[],points:[],rects:[],circles:[],coordinateSystem:"cartesian",title:"Useless Via Removal Solver"};for(let t of this.input.obstacles){let n="rgba(128, 128, 128, 0.2)",o=t.__zLayers?.includes(0),r=t.__zLayers?.includes(1);o&&r?n="rgba(128, 0, 128, 0.2)":o?n="rgba(255, 0, 0, 0.2)":r&&(n="rgba(0, 0, 255, 0.2)"),e.rects.push({center:t.center,width:t.width,height:t.height,fill:n,label:`Obstacle (Z: ${t.__zLayers?.join(", ")})`})}for(let t of this.optimizedHdRoutes){if(t.route.length===0)continue;let n=this.input.colorMap[t.connectionName]||"#888888";for(let o=0;o<t.route.length-1;o++){let r=t.route[o],i=t.route[o+1];r.z===i.z&&e.lines.push({points:[{x:r.x,y:r.y},{x:i.x,y:i.y}],strokeColor:r.z===0?"red":"blue",strokeWidth:t.traceThickness,label:`${t.connectionName} (z=${r.z})`})}for(let o of t.vias)e.circles.push({center:{x:o.x,y:o.y},radius:t.viaDiameter/2,fill:"rgba(255, 0, 255, 0.5)",label:`${t.connectionName} via`});if(t.jumpers&&t.jumpers.length>0){let o=MZe(t.jumpers,{color:n,label:t.connectionName});e.rects.push(...o.rects??[]),e.lines.push(...o.lines??[])}}return this.activeSubSolver&&e.lines.push(...this.activeSubSolver.visualize().lines??[]),e}},W1r=class{netMap;idToNetMap;constructor(e){this.netMap=e,this.idToNetMap={};for(let[t,n]of Object.entries(e))for(let o of n)this.idToNetMap[o]=t}addConnections(e){for(let t of e){let n=new Set;for(let r of t){let i=this.idToNetMap[r];i&&n.add(i)}let o;if(n.size===0)o=`connectivity_net${Object.keys(this.netMap).length}`,this.netMap[o]=[];else if(n.size===1)o=n.values().next().value??`connectivity_net${Object.keys(this.netMap).length}`;else{o=n.values().next().value??`connectivity_net${Object.keys(this.netMap).length}`;for(let r of n)if(r!==o){this.netMap[o].push(...this.netMap[r]),this.netMap[r]=this.netMap[o];for(let i of this.netMap[o])this.idToNetMap[i]=o}}for(let r of t)this.netMap[o].includes(r)||this.netMap[o].push(r),this.idToNetMap[r]=o}}getIdsConnectedToNet(e){return this.netMap[e]||[]}getNetConnectedToId(e){return this.idToNetMap[e]}areIdsConnected(e,t){if(e===t)return!0;let n=this.getNetConnectedToId(e);if(!n)return!1;let o=this.getNetConnectedToId(t);return!!o&&(n===o||o===e||o===e)}areAllIdsConnected(e){let t=this.getNetConnectedToId(e[0]);for(let n of e){let o=this.getNetConnectedToId(n);if(o===void 0)return!1;if(o!==t)return!1}return!0}},X1r=class extends lY{getSolverName(){return"SingleSimplifiedPathSolver"}newRoute;newVias;headIndex=0;tailIndex=0;inputRoute;otherHdRoutes;obstacles;connMap;colorMap;outline;minBoardEdgeClearance;constructor(e){super(),this.inputRoute=e.inputRoute,this.otherHdRoutes=e.otherHdRoutes,this.obstacles=e.obstacles,this.connMap=e.connMap,this.colorMap=e.colorMap,this.outline=e.outline,this.minBoardEdgeClearance=e.minBoardEdgeClearance??0.2,this.newRoute=[this.inputRoute.route[0]],this.newVias=[]}getConstructorParams(){return{inputRoute:this.inputRoute,otherHdRoutes:this.otherHdRoutes,obstacles:this.obstacles,connMap:this.connMap.netMap,colorMap:this.colorMap,outline:this.outline,minBoardEdgeClearance:this.minBoardEdgeClearance}}get simplifiedRoute(){return{connectionName:this.inputRoute.connectionName,rootConnectionName:this.inputRoute.rootConnectionName,startPcbPortId:this.inputRoute.startPcbPortId,endPcbPortId:this.inputRoute.endPcbPortId,traceThickness:this.inputRoute.traceThickness,viaDiameter:this.inputRoute.viaDiameter,route:this.newRoute,vias:this.newVias,jumpers:this.inputRoute.jumpers}}isValidPath(e){throw Error("Not implemented")}_step(){throw Error("Not implemented")}getVisualsForNewRouteAndObstacles(){let e={lines:[],points:[],circles:[],rects:[],coordinateSystem:"cartesian",title:"Simplified Path Solver"};for(let t=0;t<this.inputRoute.route.length-1;t++)e.lines.push({points:[{x:this.inputRoute.route[t].x,y:this.inputRoute.route[t].y},{x:this.inputRoute.route[t+1].x,y:this.inputRoute.route[t+1].y}],strokeColor:"rgba(255, 0, 0, 0.8)",strokeDash:this.inputRoute.route[t].z===1?"5, 5":void 0,layer:`z${this.inputRoute.route[t].z.toString()}`});for(let t=0;t<this.newRoute.length;t++)t<this.newRoute.length-1&&e.lines.push({points:[{x:this.newRoute[t].x,y:this.newRoute[t].y},{x:this.newRoute[t+1].x,y:this.newRoute[t+1].y}],strokeWidth:0.15,strokeColor:"rgba(0, 255, 0, 0.8)",strokeDash:this.newRoute[t].z===1?[0.4,0.4]:void 0,layer:`z${this.newRoute[t].z.toString()}`}),e.points.push({x:this.newRoute[t].x,y:this.newRoute[t].y,color:"rgba(0, 255, 0, 0.8)",label:`z: ${this.newRoute[t].z}`,layer:`z${this.newRoute[t].z.toString()}`});for(let t of this.newVias)e.circles.push({center:t,radius:this.inputRoute.viaDiameter/2,fill:"rgba(0, 0, 255, 0.5)"});for(let t of this.obstacles)e.rects.push({center:t.center,width:t.width,height:t.height,fill:t.layers?.includes("top")?"rgba(255, 0, 0, 0.3)":t.layers?.includes("bottom")?"rgba(0, 0, 255, 0.3)":"rgba(128, 128, 128, 0.3)"});for(let t of this.otherHdRoutes)for(let n=0;n<t.route.length-1;n++)e.lines.push({points:[{x:t.route[n].x,y:t.route[n].y},{x:t.route[n+1].x,y:t.route[n+1].y}],strokeWidth:0.15,strokeColor:t.route[n].z===0?"rgba(255, 0, 255, 0.5)":t.route[n].z===1?"rgba(128, 0, 128, 0.5)":"rgba(0, 0, 255, 0.5)",layer:`z${t.route[n].z.toString()}`});if("filteredObstaclePathSegments"in this){let t=this.filteredObstaclePathSegments;for(let[n,o]of t)e.lines.push({points:[n,o]})}return e}},j1r=(e)=>({minX:Math.min(e[0].x,e[1].x),maxX:Math.max(e[0].x,e[1].x),minY:Math.min(e[0].y,e[1].y),maxY:Math.max(e[0].y,e[1].y)}),Rzt=class{constructor(e,t=0.4){this.segments=e,this.buckets=new Map,this.SEGMENT_MARGIN=t;let n=new Map;for(let o of e){let r=this.getSegmentKey(o);if(n.has(r))continue;n.set(r,o);let i=j1r(o),s=Math.floor(i.minX/this.CELL_SIZE),a=Math.floor(i.maxX/this.CELL_SIZE),c=Math.floor(i.minY/this.CELL_SIZE),l=Math.floor(i.maxY/this.CELL_SIZE);for(let h=s;h<=a;h++)for(let d=c;d<=l;d++){let u=`${h}x${d}`,_=this.buckets.get(u),p=[o[0],o[1],r];_?_.push(p):this.buckets.set(u,[p])}}}segments;buckets;CELL_SIZE=0.4;SEGMENT_MARGIN;getBucketKey(e,t){return`${Math.floor(e/this.CELL_SIZE)}x${Math.floor(t/this.CELL_SIZE)}`}getSegmentKey(e){return`${e[0].x}-${e[0].y}-${e[0].z}-${e[1].x}-${e[1].y}-${e[1].z}`}getSegmentsThatCouldIntersect(e,t){let n=[],o=new Set,r=Math.min(e.x,t.x)-this.SEGMENT_MARGIN,i=Math.min(e.y,t.y)-this.SEGMENT_MARGIN,s=Math.max(e.x,t.x)+this.SEGMENT_MARGIN,a=Math.max(e.y,t.y)+this.SEGMENT_MARGIN,c=Math.floor(r/this.CELL_SIZE),l=Math.floor(s/this.CELL_SIZE),h=Math.floor(i/this.CELL_SIZE),d=Math.floor(a/this.CELL_SIZE);for(let u=c;u<=l;u++)for(let _=h;_<=d;_++){let p=`${u}x${_}`,m=this.buckets.get(p);if(m)for(let A of m){let g=A[2];o.has(g)||(o.add(g),n.push(A))}}return n}},Krn=class extends X1r{pathSegments=[];totalPathLength=0;headDistanceAlongPath=0;tailDistanceAlongPath=0;minStepSize=0.25;lastValidPath=null;lastValidPathHeadDistance=0;STEP_SIZE_REDUCTION_FACTOR=0.25;maxStepSize=4;currentStepSize=this.maxStepSize;lastHeadMoveDistance=0;cachedValidPathSegments;filteredObstacles=[];filteredObstaclePathSegments=[];traceThicknessByObstacleSegmentId=new Map;filteredVias=[];filteredJumperPads=[];jumperPadPointIndices=new Set;segmentTree;OBSTACLE_MARGIN=0.1;TRACE_THICKNESS=0.15;useTraceWidthAwareClearance=!1;clearanceTraceThickness=this.TRACE_THICKNESS;TAIL_JUMP_RATIO=0.8;isSameNetRoute(e){let t=[this.inputRoute.connectionName,this.inputRoute.rootConnectionName].filter((o)=>o!==void 0),n=[e.connectionName,e.rootConnectionName].filter((o)=>o!==void 0);return t.some((o)=>n.some((r)=>o===r||this.connMap.areIdsConnected(o,r)))}constructor(e){if(super(e),this.cachedValidPathSegments=new Set,this.useTraceWidthAwareClearance=e.useTraceWidthAwareClearance??!1,this.clearanceTraceThickness=this.useTraceWidthAwareClearance?this.inputRoute.traceThickness:this.TRACE_THICKNESS,this.inputRoute.route.length<=1)return this.newRoute=[...this.inputRoute.route],void(this.solved=!0);let t=this.inputRoute.route.reduce((l,h)=>(l.minX=Math.min(l.minX,h.x),l.maxX=Math.max(l.maxX,h.x),l.minY=Math.min(l.minY,h.y),l.maxY=Math.max(l.maxY,h.y),l),{minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0}),n=this.useTraceWidthAwareClearance?Math.max(0,...this.otherHdRoutes.flatMap((l)=>[l.traceThickness,...l.route.map((h)=>h.traceThickness??l.traceThickness)])):this.TRACE_THICKNESS,o=this.useTraceWidthAwareClearance?this.OBSTACLE_MARGIN+this.clearanceTraceThickness/2+n/2:this.OBSTACLE_MARGIN+this.TRACE_THICKNESS,r={center:{x:(t.minX+t.maxX)/2,y:(t.minY+t.maxY)/2},width:t.maxX-t.minX,height:t.maxY-t.minY},i=this.OBSTACLE_MARGIN+this.clearanceTraceThickness/2,s=e.geometryQuery?e.geometryQuery.index.getCandidateObstacles({minX:r.center.x-r.width/2,minY:r.center.y-r.height/2,maxX:r.center.x+r.width/2,maxY:r.center.y+r.height/2},i):this.obstacles,a=e.geometryQuery?e.geometryQuery.index.getCandidateRoutes(t,Math.max(o,i),e.geometryQuery.routeIndex):this.otherHdRoutes;this.filteredObstacles=s.filter((l)=>!l.connectedTo.some((h)=>this.connMap.areIdsConnected(this.inputRoute.connectionName,h))).filter((l)=>{if(l.connectedTo.some((h)=>this.connMap.areIdsConnected(this.inputRoute.connectionName,h)))return!1;return function(h,d){let u=Bi(h),_=Bi(d),p=Math.max(u.minX-_.maxX,_.minX-u.maxX,0),m=Math.max(u.minY-_.maxY,_.minY-u.maxY,0);return Math.hypot(p,m)}(r,l)<this.OBSTACLE_MARGIN+this.clearanceTraceThickness/2}),this.filteredObstaclePathSegments=a.flatMap((l)=>{if(this.isSameNetRoute(l))return[];let h=l.route,d=[];for(let u=0;u<h.length-1;u++){let _=h[u],p=h[u+1];if(ZV(_,p,t)<=o){d.push([_,p]);let m=`${_.x}-${_.y}-${_.z}-${p.x}-${p.y}-${p.z}`;if(this.useTraceWidthAwareClearance){let A=Math.max(_.traceThickness??l.traceThickness,p.traceThickness??l.traceThickness);this.traceThicknessByObstacleSegmentId.set(m,Math.max(this.traceThicknessByObstacleSegmentId.get(m)??0,A))}}}return d}),this.segmentTree=this.useTraceWidthAwareClearance?new Rzt(this.filteredObstaclePathSegments,o):new Rzt(this.filteredObstaclePathSegments),this.filteredVias=a.flatMap((l)=>{if(this.isSameNetRoute(l))return[];let h=l.vias,d=[];for(let u of h){let _=this.OBSTACLE_MARGIN+this.clearanceTraceThickness/2+l.viaDiameter/2,p=u.x-_,m=u.x+_,A=u.y-_,g=u.y+_;p<=t.maxX&&m>=t.minX&&A<=t.maxY&&g>=t.minY&&d.push({...u,diameter:l.viaDiameter})}return d});let c=(l,h)=>{let d=[];for(let u of l){let _=Cq[u.footprint]??Cq["0603"],p=u.end.x-u.start.x,m=u.end.y-u.start.y,A=Math.abs(p)>Math.abs(m),g=A?_.padLength:_.padWidth,f=A?_.padWidth:_.padLength,y=this.OBSTACLE_MARGIN+this.clearanceTraceThickness/2;u.start.x-g/2-y<=t.maxX&&u.start.x+g/2+y>=t.minX&&u.start.y-f/2-y<=t.maxY&&u.start.y+f/2+y>=t.minY&&d.push({center:u.start,width:g,height:f,connectionName:h}),u.end.x-g/2-y<=t.maxX&&u.end.x+g/2+y>=t.minX&&u.end.y-f/2-y<=t.maxY&&u.end.y+f/2+y>=t.minY&&d.push({center:u.end,width:g,height:f,connectionName:h})}return d};if(this.filteredJumperPads=a.flatMap((l)=>this.isSameNetRoute(l)?[]:c(l.jumpers??[],l.connectionName)),this.inputRoute.jumpers&&this.inputRoute.jumpers.length>0){this.filteredJumperPads.push(...c(this.inputRoute.jumpers,this.inputRoute.connectionName));for(let l of this.inputRoute.jumpers)for(let h=0;h<this.inputRoute.route.length;h++){let d=this.inputRoute.route[h];(Math.abs(d.x-l.start.x)<0.01&&Math.abs(d.y-l.start.y)<0.01||Math.abs(d.x-l.end.x)<0.01&&Math.abs(d.y-l.end.y)<0.01)&&this.jumperPadPointIndices.add(h)}}this.computePathSegments()}computePathSegments(){let e=0;for(let t=0;t<this.inputRoute.route.length-1;t++){let n=this.inputRoute.route[t],o=this.inputRoute.route[t+1],r=Math.sqrt((o.x-n.x)**2+(o.y-n.y)**2)+t/1e4;this.pathSegments.push({start:n,end:o,length:r,startDistance:e,endDistance:e+r}),e+=r}this.totalPathLength=e}arePointsEqual(e,t){return e.x===t.x&&e.y===t.y&&e.z===t.z}getPointAtDistance(e){e=Math.max(0,Math.min(e,this.totalPathLength));let t=this.pathSegments.find((o)=>e>=o.startDistance&&e<=o.endDistance);if(!t)return this.inputRoute.route[this.inputRoute.route.length-1];let n=(e-t.startDistance)/t.length;return{x:t.start.x+n*(t.end.x-t.start.x),y:t.start.y+n*(t.end.y-t.start.y),z:n<0.5?t.start.z:t.end.z}}getNearestIndexForDistance(e){if(e<=0)return 0;if(e>=this.totalPathLength)return this.inputRoute.route.length-1;let t=this.pathSegments.findIndex((r)=>e>=r.startDistance&&e<=r.endDistance);if(t===-1)return 0;let n=this.pathSegments[t],o=(n.startDistance+n.endDistance)/2;return e>o?t+1:t}isValidPathSegment(e,t){for(let o of this.filteredObstacles){if(!o.__zLayers?.includes(e.z))continue;if(KS(e,t,o)<this.OBSTACLE_MARGIN+this.clearanceTraceThickness/2)return!1}let n=this.segmentTree.getSegmentsThatCouldIntersect(e,t);for(let[o,r,i]of n)if(o.z===e.z&&r.z===e.z){let s=Wrn({x:e.x,y:e.y},{x:t.x,y:t.y},{x:o.x,y:o.y},{x:r.x,y:r.y});if(!this.useTraceWidthAwareClearance){if(s<this.OBSTACLE_MARGIN+this.TRACE_THICKNESS)return!1;continue}let a=this.traceThicknessByObstacleSegmentId.get(i);if(a===void 0)throw Error(`Missing trace thickness for segment "${i}"`);if(s<this.OBSTACLE_MARGIN+this.clearanceTraceThickness/2+a/2)return!1}for(let o of this.filteredVias)if(xc(o,e,t)<this.OBSTACLE_MARGIN+o.diameter/2+this.clearanceTraceThickness/2)return!1;for(let o of this.filteredJumperPads)if(KS(e,t,o)<this.OBSTACLE_MARGIN+this.clearanceTraceThickness/2)return!1;if(this.outline&&this.outline.length>=3){if(QCe({start:{x:e.x,y:e.y},end:{x:t.x,y:t.y},polygon:this.outline,margin:this.minBoardEdgeClearance+this.inputRoute.traceThickness/2}))return!1}return!0}isValidPath(e){if(e.length<2)return!0;for(let t=0;t<e.length-1;t++)if(e[t].z!==e[t+1].z)return!1;for(let t=0;t<e.length-1;t++)if(!this.isValidPathSegment(e[t],e[t+1]))return!1;return!0}find45DegreePath(e,t){if(this.arePointsEqual(e,t))return[e];if(e.z!==t.z)return null;let n=Pce({x:e.x,y:e.y},{x:t.x,y:t.y});for(let o of n){let r=o.map((i)=>({x:i.x,y:i.y,z:e.z}));if(this.isValidPath(r))return r}return null}addPathToResult(e){if(e.length!==0){for(let t=0;t<e.length;t++)t===0&&this.newRoute.length>0&&this.arePointsEqual(this.newRoute[this.newRoute.length-1],e[t])||this.newRoute.push(e[t]);this.currentStepSize=this.maxStepSize}}appendOriginalRouteSlice(e,t){let n=this.pathSegments.findIndex((o)=>e>=o.startDistance&&e<=o.endDistance);if(n===-1)throw Error(`Could not find path segment containing distance ${e}`);for(let o=n+1;o<=t&&o<this.inputRoute.route.length;o++){let r=this.inputRoute.route[o],i=this.newRoute[this.newRoute.length-1];i&&this.arePointsEqual(i,r)||this.newRoute.push({...r})}}moveHead(e){this.lastHeadMoveDistance=e,this.headDistanceAlongPath=Math.min(this.headDistanceAlongPath+e,this.totalPathLength)}stepBackAndReduceStepSize(){this.headDistanceAlongPath=Math.max(this.tailDistanceAlongPath,this.headDistanceAlongPath-this.lastHeadMoveDistance),this.currentStepSize=Math.max(this.minStepSize,this.currentStepSize*this.STEP_SIZE_REDUCTION_FACTOR)}_step(){let e=this.tailDistanceAlongPath>=this.totalPathLength,t=this.headDistanceAlongPath>=this.totalPathLength;if(e){let u=this.inputRoute.route[this.inputRoute.route.length-1];return this.newRoute.length!==0&&this.arePointsEqual(this.newRoute[this.newRoute.length-1],u)||this.newRoute.push(u),void(this.solved=!0)}if(t){let u=this.getPointAtDistance(this.tailDistanceAlongPath),_=this.inputRoute.route[this.inputRoute.route.length-1],p=this.find45DegreePath(u,_);if(p)return this.addPathToResult(p),void(this.solved=!0);let m=this.lastValidPath?this.lastValidPathHeadDistance:this.tailDistanceAlongPath;return this.lastValidPath&&(this.addPathToResult(this.lastValidPath),this.lastValidPath=null),this.getNearestIndexForDistance(m),this.appendOriginalRouteSlice(m,this.inputRoute.route.length-1),this.tailDistanceAlongPath=this.totalPathLength,this.headDistanceAlongPath=this.totalPathLength,void(this.solved=!0)}this.moveHead(this.currentStepSize);let n=this.getPointAtDistance(this.tailDistanceAlongPath),o=this.getPointAtDistance(this.headDistanceAlongPath),r=this.getNearestIndexForDistance(this.tailDistanceAlongPath),i=this.getNearestIndexForDistance(this.headDistanceAlongPath),s=!1,a=-1;for(let u=r;u<i;u++)if(u+1<this.inputRoute.route.length&&this.inputRoute.route[u].z!==this.inputRoute.route[u+1].z){s=!0;let _=u;a=this.pathSegments[_].startDistance;break}if(s&&this.lastHeadMoveDistance>this.minStepSize)return void this.stepBackAndReduceStepSize();let c=!1,l=-1,h=-1;for(let u=r+1;u<=i;u++)if(this.jumperPadPointIndices.has(u)){c=!0,l=u,h=u>0&&u-1<this.pathSegments.length?this.pathSegments[u-1].endDistance:this.pathSegments[0]?.startDistance??0;break}if(c&&this.lastHeadMoveDistance>this.minStepSize)return void this.stepBackAndReduceStepSize();if(c&&l>=0){let u=this.inputRoute.route[l];this.lastValidPath&&(this.addPathToResult(this.lastValidPath),this.lastValidPath=null);let _=this.newRoute[this.newRoute.length-1];return _&&_.x===u.x&&_.y===u.y||this.newRoute.push({x:u.x,y:u.y,z:u.z}),this.currentStepSize=this.maxStepSize,this.tailDistanceAlongPath=h,this.headDistanceAlongPath=this.tailDistanceAlongPath,this.lastValidPath=null,void(this.lastValidPathHeadDistance=this.tailDistanceAlongPath)}if(s&&a>0){let u=this.lastValidPath?this.lastValidPathHeadDistance:this.tailDistanceAlongPath,_=this.getNearestIndexForDistance(a)+1,p=this.inputRoute.route[_],m={x:p.x,y:p.y};this.lastValidPath&&(this.addPathToResult(this.lastValidPath),this.lastValidPath=null);let A=this.newRoute[this.newRoute.length-1],g={x:m.x,y:m.y,z:A.z};if(!this.arePointsEqual(A,g)){let y=this.find45DegreePath(A,g);y?this.addPathToResult(y):this.appendOriginalRouteSlice(u,_-1)}this.newVias.push(m),this.newRoute.push({x:m.x,y:m.y,z:p.z}),this.currentStepSize=this.maxStepSize;let f=this.pathSegments.findIndex((y)=>y.start===p);if(f!==-1)this.tailDistanceAlongPath=this.pathSegments[f].startDistance,this.headDistanceAlongPath=this.tailDistanceAlongPath,this.lastValidPath=null,this.lastValidPathHeadDistance=this.tailDistanceAlongPath;else if(_<this.inputRoute.route.length){if(_===this.inputRoute.route.length-1)return void(this.solved=!0);console.warn("Fallback used for tailDistanceAlongPath after layer change");let y=this.pathSegments.find((x)=>x.start===this.inputRoute.route[_]);y?(this.tailDistanceAlongPath=y.startDistance,this.headDistanceAlongPath=this.tailDistanceAlongPath,this.lastValidPath=null,this.lastValidPathHeadDistance=this.tailDistanceAlongPath):(console.error(`[${this.inputRoute.connectionName}] Could not find segment start after layer change. Path might be incomplete.
            Index sought: ${_}, Point: (${this.inputRoute.route[_].x.toFixed(3)}, ${this.inputRoute.route[_].y.toFixed(3)}, z=${this.inputRoute.route[_].z})
            Route Length: ${this.inputRoute.route.length}, Path Segments: ${this.pathSegments.length}`),this.solved=!0)}else console.warn("Layer change occurred at the end of the path."),this.solved=!0;return}let d=this.find45DegreePath(n,o);if(!d&&this.lastHeadMoveDistance>this.minStepSize)this.stepBackAndReduceStepSize();else{if(!d&&!this.lastValidPath){let u=this.getPointAtDistance(this.tailDistanceAlongPath);this.tailDistanceAlongPath+=this.minStepSize,this.moveHead(this.minStepSize);let _=this.getNearestIndexForDistance(this.tailDistanceAlongPath);for(let A=r;A<_;A++)if(this.inputRoute.route[A].z!==this.inputRoute.route[A+1].z){_=A;break}let p=this.inputRoute.route[_],m=this.inputRoute.route[this.inputRoute.route.length-1];return void(this.arePointsEqual(u,p)||this.arePointsEqual(p,m)||(this.newRoute.push(p),this.tailDistanceAlongPath=_===0?0:this.pathSegments[_-1].endDistance))}if(d)return this.lastValidPath=d,void(this.lastValidPathHeadDistance=this.headDistanceAlongPath);this.lastValidPath&&(this.addPathToResult(this.lastValidPath),this.lastValidPath=null,this.tailDistanceAlongPath=this.lastValidPathHeadDistance,this.moveHead(this.minStepSize))}}visualize(){let e=this.getVisualsForNewRouteAndObstacles(),t=this.getPointAtDistance(this.tailDistanceAlongPath),n=this.getPointAtDistance(this.headDistanceAlongPath);e.points.push({x:t.x,y:t.y,color:"yellow",label:["Tail",`z: ${t.z}`].join(`
`)}),e.points.push({x:n.x,y:n.y,color:"orange",label:["Head",`z: ${n.z}`].join(`
`)});let o=this.getPointAtDistance(this.headDistanceAlongPath+this.currentStepSize);e.points.push({x:o.x,y:o.y,color:"red",label:["Tentative Head",`z: ${o.z}`].join(`
`)});let r=0;for(;r<this.totalPathLength;){let i=this.getPointAtDistance(r);e.circles.push({center:{x:i.x,y:i.y},radius:0.05,fill:"rgba(100, 100, 100, 0.5)"}),r+=this.totalPathLength/20}if(this.lastValidPath&&this.lastValidPath.length>1)for(let i=0;i<this.lastValidPath.length-1;i++)e.lines.push({points:[{x:this.lastValidPath[i].x,y:this.lastValidPath[i].y},{x:this.lastValidPath[i+1].x,y:this.lastValidPath[i+1].y}],strokeColor:"rgba(0, 255, 255, 0.9)",strokeDash:"3, 3"});return e}},Qzt=class extends Krn{vertexIndex=0;constructor(e){super(e),this.newRoute=this.inputRoute.route.slice(0,1).map((t)=>({...t})),this.newVias=this.inputRoute.vias.map((t)=>({...t}))}getSolverName(){return"VertexShortcutPathSolver"}_step(){let e=this.inputRoute.route,t=e[this.vertexIndex];if(this.vertexIndex>=e.length-1)return void(this.solved=!0);let n=this.vertexIndex+1,o=[0];for(let r=this.vertexIndex;r<e.length-1;r++){let i=e[r],s=e[r+1];if(i.z!==s.z||i.toNextSegmentType||i.traceThickness!==s.traceThickness||i.traceThickness!==void 0&&i.traceThickness!==this.inputRoute.traceThickness||i.insideJumperPad||s.insideJumperPad)break;if(o.push(o.at(-1)+Math.hypot(s.x-i.x,s.y-i.y)),n=r+1,s.pcb_port_id||this.jumperPadPointIndices.has(n))break}for(let r=n;r>this.vertexIndex+1;r--){let i=e[r],s=o[r-this.vertexIndex];for(let a of Pce(t,i)){let c=a.filter((h,d)=>d===0||h.x!==a[d-1].x||h.y!==a[d-1].y).map((h)=>({...h,z:t.z,traceThickness:t.traceThickness})),l=c.reduce((h,d,u)=>u===0?h:h+Math.hypot(d.x-c[u-1].x,d.y-c[u-1].y),0);if(!(c.length<2||l>s+0.000000001||l>=s-0.000000001&&c.length>=r-this.vertexIndex+1)&&this.isValidPath(c))return c[c.length-1]={...i},this.newRoute.push(...c.slice(1)),void(this.vertexIndex=r)}}this.vertexIndex++,this.newRoute.push({...e[this.vertexIndex]})}},UKe=new Float64Array(1),K1r=new BigUint64Array(UKe.buffer);function CS(e,t){return Number.isFinite(e)?e===0?t?Number.MIN_VALUE:-Number.MIN_VALUE:(UKe[0]=e,K1r[0]+=e>0===t?1n:-1n,UKe[0]):e}function Ece(e,t,n=t){let o=CS(t,!0),r=CS(n,!0);return{minX:CS(CS(e.minX,!1)-o,!1),minY:CS(CS(e.minY,!1)-r,!1),maxX:CS(CS(e.maxX,!0)+o,!0),maxY:CS(CS(e.maxY,!0)+r,!0)}}function vXe(e,t,n){let o={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};for(let r of e.route)o.minX=Math.min(o.minX,r.x),o.minY=Math.min(o.minY,r.y),o.maxX=Math.max(o.maxX,r.x),o.maxY=Math.max(o.maxY,r.y);for(let r of e.vias){let i=Ece({minX:r.x,minY:r.y,maxX:r.x,maxY:r.y},Math.abs(e.viaDiameter/2));o.minX=Math.min(o.minX,i.minX),o.minY=Math.min(o.minY,i.minY),o.maxX=Math.max(o.maxX,i.maxX),o.maxY=Math.max(o.maxY,i.maxY)}for(let r of e.jumpers??[]){let i=Cq[r.footprint]??Cq["0603"],s=Math.abs(r.end.x-r.start.x)>Math.abs(r.end.y-r.start.y),a=(s?i.padLength:i.padWidth)/2,c=(s?i.padWidth:i.padLength)/2;for(let l of[r.start,r.end]){let h=Ece({minX:l.x,minY:l.y,maxX:l.x,maxY:l.y},a,c);o.minX=Math.min(o.minX,h.minX),o.minY=Math.min(o.minY,h.minY),o.maxX=Math.max(o.maxX,h.maxX),o.maxY=Math.max(o.maxY,h.maxY)}}if(e.route.length!==0||e.vias.length!==0||e.jumpers?.length)return[o.minX,o.minY,o.maxX,o.maxY].every(Number.isFinite)?{...Ece(o,0),route:e,routeIndex:t,immutable:n}:{minX:-1/0,minY:-1/0,maxX:1/0,maxY:1/0,route:e,routeIndex:t,immutable:n}}var $1r=class{constructor(e,t,n){this.obstacles=n,this.mutableRoutes=e.map((i,s)=>vXe(i,s,!1));let o=t.map((i,s)=>vXe(i,s,!0)).concat(this.mutableRoutes).filter((i)=>i!==void 0);this.routeIndex.load(o);let r=n.map((i,s)=>{let a={minX:i.center.x-i.width/2,minY:i.center.y-i.height/2,maxX:i.center.x+i.width/2,maxY:i.center.y+i.height/2};return Object.values(a).every(Number.isFinite)?this.indexedObstacleIds.push(s):this.unindexedObstacleIds.push(s),a});if(this.indexedObstacleIds.length>0){this.obstacleIndex=new R_(this.indexedObstacleIds.length);for(let i of this.indexedObstacleIds){let s=r[i];this.obstacleIndex.add(s.minX,s.minY,s.maxX,s.maxY)}this.obstacleIndex.finish()}}obstacles;routeIndex=new JV;mutableRoutes;obstacleIndex;indexedObstacleIds=[];unindexedObstacleIds=[];getCandidateObstacles(e,t){if(!Number.isFinite(t)||!Object.values(e).every(Number.isFinite))return[...this.obstacles];let n=Ece(e,Math.max(0,t));return(this.obstacleIndex?this.obstacleIndex.search(n.minX,n.minY,n.maxX,n.maxY).map((o)=>this.indexedObstacleIds[o]):[]).concat(this.unindexedObstacleIds).sort((o,r)=>o-r).map((o)=>this.obstacles[o])}getCandidateRoutes(e,t,n){return(Number.isFinite(t)&&Object.values(e).every(Number.isFinite)?this.routeIndex.search(Ece(e,Math.max(0,t))):this.routeIndex.all()).filter((o)=>o.immutable||o.routeIndex!==n).sort((o,r)=>(o.immutable?0:o.routeIndex>n?1:2)-(r.immutable?0:r.routeIndex>n?1:2)||o.routeIndex-r.routeIndex).map((o)=>o.route)}replaceRoute(e,t){if(!Number.isInteger(e)||e<0||e>=this.mutableRoutes.length)throw Error(`Cannot replace path simplification route ${e}`);let n=this.mutableRoutes[e];n&&this.routeIndex.remove(n);let o=vXe(t,e,!1);this.mutableRoutes[e]=o,o&&this.routeIndex.insert(o)}},q1r=class extends lY{getSolverName(){return"MultiSimplifiedPathSolver"}simplifiedHdRoutes;currentUnsimplifiedHdRouteIndex=0;activeSubSolver=null;unsimplifiedHdRoutes;otherHdRoutes;obstacles;connMap;colorMap;outline;minBoardEdgeClearance;defaultViaDiameter;useTraceWidthAwareClearance;enableVertexShortcuts;geometryIndex;constructor(e){super(),this.MAX_ITERATIONS=1e8,this.unsimplifiedHdRoutes=e.unsimplifiedHdRoutes,this.otherHdRoutes=e.otherHdRoutes??[];let t=Math.max(2,...[...e.unsimplifiedHdRoutes,...this.otherHdRoutes].flatMap((n)=>n.route.map((o)=>o.z+1)))||2;this.obstacles=Yle(e.obstacles,t),this.connMap=e.connMap||new W1r({}),this.colorMap=e.colorMap||{},this.outline=e.outline,this.minBoardEdgeClearance=e.minBoardEdgeClearance??0.2,this.defaultViaDiameter=e.defaultViaDiameter??0.3,this.useTraceWidthAwareClearance=e.useTraceWidthAwareClearance??!1,this.enableVertexShortcuts=e.enableVertexShortcuts??!1,this.geometryIndex=new $1r(this.unsimplifiedHdRoutes,this.otherHdRoutes,this.obstacles),this.simplifiedHdRoutes=[]}_step(){let e=this.unsimplifiedHdRoutes[this.currentUnsimplifiedHdRouteIndex];if(!this.activeSubSolver)return e?(this.activeSubSolver=new Krn({inputRoute:e,otherHdRoutes:this.otherHdRoutes.concat(this.unsimplifiedHdRoutes.slice(this.currentUnsimplifiedHdRouteIndex+1).concat(this.simplifiedHdRoutes)),obstacles:this.obstacles,connMap:this.connMap,colorMap:this.colorMap,outline:this.outline,minBoardEdgeClearance:this.minBoardEdgeClearance,useTraceWidthAwareClearance:this.useTraceWidthAwareClearance,geometryQuery:{index:this.geometryIndex,routeIndex:this.currentUnsimplifiedHdRouteIndex}}),void this.currentUnsimplifiedHdRouteIndex++):void(this.solved=!0);if(this.activeSubSolver.step(),this.activeSubSolver.solved){if(this.enableVertexShortcuts&&!(this.activeSubSolver instanceof Qzt))return void(this.activeSubSolver=new Qzt({inputRoute:this.activeSubSolver.simplifiedRoute,otherHdRoutes:this.activeSubSolver.otherHdRoutes,obstacles:this.obstacles,connMap:this.connMap,colorMap:this.colorMap,outline:this.outline,minBoardEdgeClearance:this.minBoardEdgeClearance,useTraceWidthAwareClearance:this.useTraceWidthAwareClearance,geometryQuery:{index:this.geometryIndex,routeIndex:this.currentUnsimplifiedHdRouteIndex-1}}));let t=this.activeSubSolver.simplifiedRoute;this.geometryIndex.replaceRoute(this.currentUnsimplifiedHdRouteIndex-1,t),this.simplifiedHdRoutes.push(t),this.activeSubSolver=null}}visualize(){if(this.activeSubSolver)return this.activeSubSolver.visualize();let e={lines:[],points:[],circles:[],rects:[],coordinateSystem:"cartesian",title:"Multi Simplified Path Solver"};for(let t of this.unsimplifiedHdRoutes)if(!this.simplifiedHdRoutes.some((n)=>n.connectionName===t.connectionName)){for(let n=0;n<t.route.length-1;n++)e.lines.push({points:[{x:t.route[n].x,y:t.route[n].y},{x:t.route[n+1].x,y:t.route[n+1].y}],strokeColor:t.route[n].z===1?"rgba(0, 0, 255, 0.4)":"rgba(255, 0, 0, 0.4)",strokeWidth:0.15,strokeDash:t.route[n].z===1?[0.5,0.5]:void 0});for(let n of t.vias||[])e.circles.push({center:n,radius:(t.viaDiameter??this.defaultViaDiameter)/2,fill:"rgba(0, 0, 255, 0.4)"})}for(let t of this.simplifiedHdRoutes){let n=this.colorMap?.[t.connectionName]||"rgba(128, 128, 128, 0.8)";for(let o=0;o<t.route.length-1;o++)e.lines.push({points:[{x:t.route[o].x,y:t.route[o].y},{x:t.route[o+1].x,y:t.route[o+1].y}],strokeWidth:0.15,strokeColor:n,strokeDash:t.route[o].z===1?[0.5,0.5]:void 0,step:1});for(let o of t.vias||[])e.circles.push({center:o,radius:t.viaDiameter/2,fill:"rgba(0, 0, 255, 0.5)",step:1})}for(let t of this.unsimplifiedHdRoutes){for(let n=0;n<t.route.length-1;n++)e.lines.push({points:[{x:t.route[n].x,y:t.route[n].y},{x:t.route[n+1].x,y:t.route[n+1].y}],strokeWidth:0.15,strokeColor:"rgba(255, 0, 0, 0.2)",strokeDash:[0.5,0.5],step:0,layer:`z${t.route[n].z.toString()}`});for(let n of t.vias)e.circles.push({center:{x:n.x,y:n.y},radius:t.viaDiameter/2,fill:"rgba(255, 0, 0, 0.2)",step:0})}for(let t of this.obstacles)e.rects.push({center:t.center,width:t.width,height:t.height,fill:t.layers?.includes("top")?"rgba(255, 0, 0, 0.3)":t.layers?.includes("bottom")?"rgba(0, 0, 255, 0.3)":"rgba(128, 128, 128, 0.3)"});if(this.currentUnsimplifiedHdRouteIndex<this.unsimplifiedHdRoutes.length){let t=this.unsimplifiedHdRoutes[this.currentUnsimplifiedHdRouteIndex];t.route.length>0&&e.circles.push({center:{x:t.route[0].x,y:t.route[0].y},radius:0.2,fill:"yellow",label:"Current"})}return e}},J1r=(e,t)=>{for(let n=0;n<e.route.length-1;n++){let o=e.route[n],r=e.route[n+1];if(o.z===r.z||o.x!==t.x||o.y!==t.y||r.x!==t.x||r.y!==t.y)continue;let i=n;for(;i>0&&e.route[i-1].x===t.x&&e.route[i-1].y===t.y;)i--;let s=n+1;for(;s<e.route.length-1&&e.route[s+1].x===t.x&&e.route[s+1].y===t.y;)s++;if(i===0||s===e.route.length-1)return!0}return!1},WKe=(e,t,n)=>n?.get(t.connectionName)??e.idToNetMap[t.connectionName]??(t.rootConnectionName?e.idToNetMap[t.rootConnectionName]:void 0),Z1r=(e,t,n)=>{for(let o of t.connectedTo){if(o===n.net)return!0;if(e.idToNetMap[o]===n.net)return!0;if(e.areIdsConnected(o,n.net))return!0}return!1},eyr=(e,t,n)=>{let o=n.mergedViaHdRoutes[e.routeIndex];if(!o)throw Error(`SameNetViaMergerSolver could not find route for via at index ${e.routeIndex}`);let r=new Set;for(let i=1;i<o.route.length;i++){let s=o.route[i-1],a=o.route[i];s.z!==a.z&&(s.x===e.x&&s.y===e.y&&a.x===e.x&&a.y===e.y&&(r.add(s.z),r.add(a.z)))}if(r.size===0)throw Error(`SameNetViaMergerSolver could not find transition layers for via at (${e.x}, ${e.y})`);for(let i of r){let s=o.traceThickness,a={x:e.x,y:e.y,z:i},c={x:t.x,y:t.y,z:i};if(a.x===c.x&&a.y===c.y)continue;let l=n.hdRouteSHI.getConflictingRoutesForSegment(a,c,s/2);for(let{conflictingRoute:_,distance:p}of l){if(_.connectionName===o.connectionName)continue;if(WKe(n.connMap,_,n.netByConnectionName)===e.net)continue;if(p<s/2+_.traceThickness/2)return!1}let h={centerX:(a.x+c.x)/2,centerY:(a.y+c.y)/2,width:Math.abs(a.x-c.x),height:Math.abs(a.y-c.y)},d=s/2+0.1,u=n.obstacleSHI.searchArea(h.centerX,h.centerY,h.width+2*d,h.height+2*d);for(let _ of u){if(!_.__zLayers)throw Error(`SameNetViaMergerSolver found obstacle without zLayers near via at (${e.x}, ${e.y})`);if(_.__zLayers.includes(i)&&(!Z1r(n.connMap,_,e)&&KS(a,c,_)<d))return!1}}return!0},wZe=class extends lY{constructor(e){if(super(),this.input=e,!e.connMap)throw Error("SameNetViaMergerSolver requires connMap");this.input={...e,obstacles:Yle(e.obstacles,e.layerCount)},this.MAX_ITERATIONS=1e6,this.inputHdRoutes=this.input.inputHdRoutes,this.mergedViaHdRoutes=structuredClone(this.inputHdRoutes);for(let t of this.mergedViaHdRoutes)this.dedupeRouteVias(t);this.unprocessedRoutes=[...this.input.inputHdRoutes],this.colorMap=this.input.colorMap,this.outline=this.input.outline,this.obstacles=this.input.obstacles,this.obstacleSHI=new EZe("flatbush",this.input.obstacles),this.hdRouteSHI=this.createHdRouteSpatialIndex(),this.vias=[],this.offendingVias=[],this.connMap=e.connMap,this.netByConnectionName=e.netByConnectionName,this.viasByNet=new Map,this.rebuildVias()}input;getSolverName(){return"SameNetViaMergerSolver"}inputHdRoutes;mergedViaHdRoutes;unprocessedRoutes;vias;offendingVias;currentViaRoutes=[];connMap;colorMap;outline;obstacles;viasByNet;netByConnectionName;obstacleSHI;hdRouteSHI;createHdRouteSpatialIndex(){return new yV([...this.mergedViaHdRoutes,...this.input.otherHdRoutes??[]])}rebuildVias(){this.vias=[],this.viasByNet=new Map;let e=(t,n,o)=>{if(t.vias.length===0)return;let r=o?((i,s,a)=>{let c=WKe(i,s,a);if(!c)throw Error(`SameNetViaMergerSolver could not find net for route "${s.connectionName}"`);return c})(this.connMap,t,this.netByConnectionName):WKe(this.connMap,t,this.netByConnectionName);if(r)for(let i=0;i<t.vias.length;i++){let s=t.vias[i],a=[...new Set(t.route.map((h)=>h.z))];if(a.length===0)throw Error(`SameNetViaMergerSolver found via on route "${t.connectionName}" with no route points`);let c={x:s.x,y:s.y,diameter:t.viaDiameter,net:r,layers:a,routeIndex:n,mutable:o&&!(this.input.preserveRouteEndpoints&&J1r(t,s))};this.vias.push(c);let l=this.viasByNet.get(c.net);l?l.push(c):this.viasByNet.set(c.net,[c])}};for(let t=0;t<this.mergedViaHdRoutes.length;t++)e(this.mergedViaHdRoutes[t],t,!0);for(let t=0;t<(this.input.otherHdRoutes?.length??0);t++)e(this.input.otherHdRoutes[t],this.mergedViaHdRoutes.length+t,!1)}getViaLocationKey(e){return[e.net,e.x,e.y].join(":")}dedupeRouteVias(e){let t=new Set;e.vias=e.vias.filter((n)=>{let o=`${n.x}:${n.y}`;return!t.has(o)&&(t.add(o),!0)})}getOffendingViaGroupsBatch(){let e=[],t=new Set,n=[];for(let o of this.viasByNet.values()){if(o.length<2)continue;let r=Math.max(0.000001,...o.map((a)=>a.diameter)),i=new Map,s=new Map;for(let a=0;a<o.length;a++){let c=o[a],l=this.getViaLocationKey(c),h=s.get(l);h?h.push(c):s.set(l,[c]);let d=`${Math.floor(c.x/r)}:${Math.floor(c.y/r)}`,u=i.get(d);u?u.push(a):i.set(d,[a])}for(let a=0;a<o.length;a++){let c=o[a],l=Math.floor(c.x/r),h=Math.floor(c.y/r),d=Math.ceil(2.5),u=[];for(let m=-d;m<=d;m++)for(let A=-d;A<=d;A++){let g=i.get(`${l+m}:${h+A}`);if(g)for(let f of g){if(f===a)continue;let y=o[f];if(!y.mutable)continue;let x=c.x-y.x,C=c.y-y.y,b=x*x+C*C,I=c.diameter/2+y.diameter/2,v=2.5*I;b!==0&&((b<=I*I||b<=v*v&&eyr(y,c,{connMap:this.connMap,mergedViaHdRoutes:this.mergedViaHdRoutes,hdRouteSHI:this.hdRouteSHI,obstacleSHI:this.obstacleSHI,netByConnectionName:this.netByConnectionName}))&&u.push(y))}}let _=new Set(u),p=u.filter((m)=>m.x===c.x&&m.y===c.y||s.get(this.getViaLocationKey(m)).every((A)=>A.mutable&&_.has(A)));p.length>0&&n.push({keep:c,remove:p})}}n.sort((o,r)=>r.remove.length!==o.remove.length?r.remove.length-o.remove.length:o.keep.mutable!==r.keep.mutable?o.keep.mutable?1:-1:r.keep.layers.length!==o.keep.layers.length?r.keep.layers.length-o.keep.layers.length:o.keep.routeIndex-r.keep.routeIndex);for(let o of n){let r=this.getViaLocationKey(o.keep);if(t.has(r))continue;let i=o.remove.filter((s)=>!t.has(this.getViaLocationKey(s)));if(i.length!==0){e.push({keep:o.keep,remove:i}),t.add(r);for(let s of i)t.add(this.getViaLocationKey(s))}}return e}moveViaTo(e,t,n=!0){if(!e.mutable)throw Error("SameNetViaMergerSolver cannot mutate an immutable via anchor");let o=this.mergedViaHdRoutes[e.routeIndex];if(!o)throw Error(`SameNetViaMergerSolver could not find route for via at index ${e.routeIndex}`);let r=o.route,i=new Set,s=!1;for(let a=r.length-1;a>=1;a--){let c=r[a-1],l=r[a];if(c.z===l.z)continue;if(c.x!==e.x||c.y!==e.y)continue;if(l.x!==e.x||l.y!==e.y)continue;let h=a-1;for(;h>0&&r[h-1].x===e.x&&r[h-1].y===e.y;)h--;let d=a;for(;d<r.length-1&&r[d+1].x===e.x&&r[d+1].y===e.y;)d++;for(let u=h;u<=d;u++)i.add(u)}if(i.size===0)throw Error(`SameNetViaMergerSolver could not find route transition for via at (${e.x}, ${e.y}) on route "${o.connectionName}"`);for(let a of i){let c=r[a];r[a]={...c,x:t.x,y:t.y}}if(o.vias=o.vias.map((a)=>a.x!==e.x||a.y!==e.y?a:(s=!0,{x:t.x,y:t.y})),!s)throw Error(`SameNetViaMergerSolver could not find via at (${e.x}, ${e.y}) on route "${o.connectionName}"`);this.dedupeRouteVias(o),n&&this.rebuildVias()}_step(){let e=this.getOffendingViaGroupsBatch();if(e.length===0)return void(this.solved=!0);let t=0;for(let n of e)for(let o of n.remove)this.moveViaTo(o,n.keep,!1),t++;this.rebuildVias(),this.hdRouteSHI=this.createHdRouteSpatialIndex(),this.stats.mergedViaGroups=e.length,this.stats.mergedViaCount=t}getMergedViaHdRoutes(){return this.mergedViaHdRoutes}visualize(){let e={lines:[],points:[],rects:[],circles:[],coordinateSystem:"cartesian",title:"Same Net Via Merger Solver"};for(let t of this.input.obstacles){if(!t.__zLayers)throw Error("SameNetViaMergerSolver found obstacle without zLayers while visualizing");let n="rgba(128, 128, 128, 0.2)",o=t.__zLayers.includes(0),r=t.__zLayers.includes(1);o&&r?n="rgba(128, 0, 128, 0.2)":o?n="rgba(255, 0, 0, 0.2)":r&&(n="rgba(0, 0, 255, 0.2)"),e.rects.push({center:t.center,width:t.width,height:t.height,fill:n,label:`Obstacle (Z: ${t.__zLayers?.join(", ")})`})}for(let t of this.mergedViaHdRoutes){if(t.route.length===0)continue;let n=this.input.colorMap[t.connectionName];if(!n)throw Error(`SameNetViaMergerSolver could not find color for route "${t.connectionName}"`);for(let o=0;o<t.route.length-1;o++){let r=t.route[o],i=t.route[o+1];r.z===i.z&&e.lines.push({points:[{x:r.x,y:r.y},{x:i.x,y:i.y}],strokeColor:r.z===0?"rgba(255, 0, 0, 0.5)":"rgba(0, 0, 255, 0.5)",strokeWidth:t.traceThickness,label:`${t.connectionName} (z=${r.z})`})}for(let o of t.vias)e.circles.push({center:{x:o.x,y:o.y},radius:t.viaDiameter/2,fill:"rgba(255, 0, 255, 0.5)",label:`${t.connectionName} via`});if(t.jumpers&&t.jumpers.length>0){let o=MZe(t.jumpers,{color:n,label:t.connectionName});if(!o.rects||!o.lines)throw Error(`SameNetViaMergerSolver expected jumper graphics for route "${t.connectionName}"`);e.rects.push(...o.rects),e.lines.push(...o.lines)}}return e}},tyr={getConflictingRoutesForSegment:()=>[],getConflictingRoutesNearPoint:()=>[]},jy=0.000001,Mce=(e,t)=>{let n=`${e.x}:${e.y}:${e.z}`,o=`${t.x}:${t.y}:${t.z}`;return n<o?`${n}|${o}`:`${o}|${n}`},kzt=(e)=>{let t=new Set;for(let n=1;n<e.route.length;n++){let o=e.route[n-1],r=e.route[n];o.z===r.z&&t.add(Mce(o,r))}return t},SXe=(e)=>e.filter((t,n)=>{let o=e[n-1];return!o||t.x!==o.x||t.y!==o.y||t.z!==o.z}),PXe=(e)=>{let t=[],n=new Set;for(let o=1;o<e.length;o++){let r=e[o-1],i=e[o];if(r.z===i.z)continue;if(r.toNextSegmentType==="through_obstacle")continue;if(r.x!==i.x||r.y!==i.y)throw Error(`CrossingViaReductionSolver found a layer transition without a via at route point ${o}`);let s=`${i.x}:${i.y}`;n.has(s)||(n.add(s),t.push({x:i.x,y:i.y}))}return t},XKe=(e)=>{let t=[e.connectionName];return e.rootConnectionName&&t.push(e.rootConnectionName),t},EXe=(e,t,n)=>{let o=XKe(e),r=XKe(t);return o.some((i)=>r.some((s)=>i===s||n.areIdsConnected(i,s)))},nyr=(e,t,n)=>{let o=XKe(t);return e.connectedTo.some((r)=>o.some((i)=>r===i||n.areIdsConnected(r,i)))},$rn=(e)=>{let t=0;for(let n=1;n<e.length;n++)t+=Math.hypot(e[n].x-e[n-1].x,e[n].y-e[n-1].y);return t},Lzt=(e,t)=>{let n=$rn(e);if(t<=jy||t>=n-jy)return null;let o=0;for(let r=1;r<e.length;r++){let i=e[r-1],s=e[r],a=Math.hypot(s.x-i.x,s.y-i.y);if(o+a<t-jy){o+=a;continue}let c=t-o;if(c<=jy)return{prefix:e.slice(0,r).map((d)=>({...d})),suffix:e.slice(r-1).map((d)=>({...d})),point:{...i}};if(a-c<=jy)return{prefix:e.slice(0,r+1).map((d)=>({...d})),suffix:e.slice(r).map((d)=>({...d})),point:{...s}};let l=c/a,h={x:i.x+(s.x-i.x)*l,y:i.y+(s.y-i.y)*l,z:i.z};return{prefix:[...e.slice(0,r),h].map((d)=>({...d})),suffix:[h,...e.slice(r)].map((d)=>({...d})),point:h}}return null},oyr=(e,t,n,o)=>{let r=pB(e,t,n,o);if(!r)return null;let i=Math.hypot(r.x-e.x,r.y-e.y),s=Math.hypot(r.x-t.x,r.y-t.y),a=Math.hypot(r.x-n.x,r.y-n.y),c=Math.hypot(r.x-o.x,r.y-o.y);return Math.min(i,s,a,c)<=jy?null:i},Hzt=(e)=>e.points.some((t)=>t.insideJumperPad||t.toNextSegmentType),qrn=({sections:e,sectionIndex:t,side:n})=>{let o=e[t],r=n==="start"?e[t-1]:e[t+1];if(!r)return null;let i=n==="start"?o.points[0]:o.points.at(-1),s=n==="start"?r.points.at(-1):r.points[0];return i.x!==s.x||i.y!==s.y?null:r.z},Fzt=({sections:e,sectionIndex:t,targetZ:n,side:o})=>qrn({sections:e,sectionIndex:t,side:o})===n,zzt=({baseIndexes:e,otherCandidateRoutes:t,ignoredConnectionNames:n,originalRouteSegmentKeys:o})=>{let r=new yV([...t]);return{getConflictingRoutesForSegment:(i,s,a)=>{let c=o.has(Mce(i,s));return[...c?[]:e.mutableRoutes.getConflictingRoutesForSegment(i,s,a).filter(({conflictingRoute:l})=>!n.has(l.connectionName)),...c?[]:e.immutableRoutes?.getConflictingRoutesForSegment(i,s,a)??[],...r.getConflictingRoutesForSegment(i,s,a)]},getConflictingRoutesNearPoint:(i,s)=>[...e.mutableRoutes.getConflictingRoutesNearPoint(i,s).filter(({conflictingRoute:a})=>!n.has(a.connectionName)),...e.immutableRoutes?.getConflictingRoutesNearPoint(i,s)??[],...r.getConflictingRoutesNearPoint(i,s)]}},ryr=class extends lY{input;obstacleSHI;traceMargin;obstacleMargin;reducedHdRoutes;getSolverName(){return"CrossingViaReductionSolver"}constructor(e){super(),this.input={...e,obstacles:Yle(e.obstacles,e.layerCount)},this.traceMargin=e.traceMargin??0.1,this.obstacleMargin=e.obstacleMargin??0.15,this.reducedHdRoutes=structuredClone([...e.inputHdRoutes]),this.obstacleSHI=new EZe("flatbush",[...this.input.obstacles]),this.MAX_ITERATIONS=1e6}collapseDetourSection({route:e,section:t,targetZ:n}){let o=t.points.map((i)=>({...i,z:n})),r=SXe([...e.route.slice(0,t.startIndex).map((i)=>({...i})),...o,...e.route.slice(t.endIndex+1).map((i)=>({...i}))]);return{...e,route:r,vias:PXe(r)}}relocateTransitionVia({route:e,section:t,targetZ:n,side:o,newViaDistance:r}){let i=Lzt(t.points,r);if(!i)return null;let s=o==="start"?n:t.z,a=o==="start"?t.z:n,c=[...i.prefix.map((h)=>({...h,z:s})),...i.suffix.map((h)=>({...h,z:a}))],l=SXe([...e.route.slice(0,t.startIndex).map((h)=>({...h})),...c,...e.route.slice(t.endIndex+1).map((h)=>({...h}))]);return{route:{...e,route:l,vias:PXe(l)},relocatedVia:{x:i.point.x,y:i.point.y}}}relocateTransitionVias({route:e,sections:t,crossingGroups:n,detourZ:o,detourTraceThickness:r}){let i=new Map;for(let h of n){let d=i.get(h.transitionSectionIndex)??[];d.push(h),i.set(h.transitionSectionIndex,d)}let s=[],a=[],c=e.viaDiameter/2+r/2+this.traceMargin+jy;for(let[h,d]of i){if(d.length!==1)return null;let u=t[h],_=d[0];if(!Fzt({sections:t,sectionIndex:h,targetZ:o,side:_.side}))return null;let p=_.side==="start"?Math.max(..._.crossingDistances)+c:Math.min(..._.crossingDistances)-c,m=Lzt(u.points,p);if(!m)return null;let A=_.side==="start"?o:u.z,g=_.side==="start"?u.z:o;s.push({section:u,points:[...m.prefix.map((f)=>({...f,z:A})),...m.suffix.map((f)=>({...f,z:g}))]}),a.push({x:m.point.x,y:m.point.y})}let l=e.route.map((h)=>({...h}));for(let h of s.sort((d,u)=>u.section.startIndex-d.section.startIndex))l=[...l.slice(0,h.section.startIndex),...h.points,...l.slice(h.section.endIndex+1)];return l=SXe(l),{route:{...e,route:l,vias:PXe(l)},relocatedVias:a}}routeIsClear(e,t,n){for(let o of hce(e)){for(let r=1;r<o.points.length;r++){let i=o.points[r-1],s=o.points[r];if(!n.has(Mce(i,s))&&this.input.outline&&QCe({start:i,end:s,polygon:[...this.input.outline],margin:e.traceThickness/2}))return!1}if(!S$({currentSection:o,targetZ:o.z,route:e,hdRouteSHI:t,obstacleSHI:this.obstacleSHI,connMap:this.input.connMap,defaultTraceThickness:e.traceThickness,obstacleMargin:this.obstacleMargin,traceMargin:this.traceMargin,shouldCheckStaticGeometryForSegment:(r,i)=>!n.has(Mce(r,i))}))return!1}return!0}relocatedViaIsClear(e,t,n){let o=e.viaDiameter/2;for(let s=0;s<this.input.layerCount;s++)if(n.getConflictingRoutesNearPoint({...t,z:s},o+this.traceMargin).some(({conflictingRoute:a})=>!EXe(e,a,this.input.connMap)))return!1;let r=o+this.obstacleMargin,i=this.obstacleSHI.searchArea(t.x,t.y,2*r,2*r);for(let s of i)if(!nyr(s,e,this.input.connMap)&&KS(t,t,s)<r)return!1;if(this.input.outline){for(let s=0;s<this.input.outline.length;s++)if(xc(t,this.input.outline[s],this.input.outline[(s+1)%this.input.outline.length])<o+this.traceMargin)return!1}return!0}changedSectionsAreStaticallyClear(e,t){for(let n of hce(e))if(n.points.some((o,r)=>{let i=n.points[r-1];return i!==void 0&&!t.has(Mce(i,o))})){if(this.input.outline){for(let o=1;o<n.points.length;o++)if(QCe({start:n.points[o-1],end:n.points[o],polygon:[...this.input.outline],margin:e.traceThickness/2}))return!1}if(!S$({currentSection:n,targetZ:n.z,route:e,hdRouteSHI:tyr,obstacleSHI:this.obstacleSHI,connMap:this.input.connMap,defaultTraceThickness:e.traceThickness,obstacleMargin:Math.min(this.obstacleMargin,0.1),traceMargin:this.traceMargin}))return!1}return!0}candidateIsClear(e,t){let n=[{routeIndex:e.detourRouteIndex,route:e.detourRoute},...e.transitionUpdates],o=new Set(n.map(({routeIndex:s})=>this.reducedHdRoutes[s].connectionName)),r=kzt(this.reducedHdRoutes[e.detourRouteIndex]),i=zzt({baseIndexes:t,otherCandidateRoutes:e.transitionUpdates.map(({route:s})=>s),ignoredConnectionNames:o,originalRouteSegmentKeys:r});if(this.stats.candidateClearanceChecks=(this.stats.candidateClearanceChecks??0)+1,!this.routeIsClear(e.detourRoute,i,r))return!1;for(let s of e.transitionUpdates){let a=kzt(this.reducedHdRoutes[s.routeIndex]),c=zzt({baseIndexes:t,otherCandidateRoutes:n.filter(({routeIndex:l})=>l!==s.routeIndex).map(({route:l})=>l),ignoredConnectionNames:o,originalRouteSegmentKeys:a});if(!this.routeIsClear(s.route,c,a)||s.relocatedVias.some((l)=>!this.relocatedViaIsClear(s.route,l,c)))return!1}return this.changedSectionsAreStaticallyClear(e.detourRoute,r)}candidateRoutesHaveNoExternalCopperConflicts(e,t){let n=[e.detourRoute,...e.transitionUpdates.map(({route:i})=>i)],o=new Set(n.map(({connectionName:i})=>i)),r=[t.mutableRoutes,...t.immutableRoutes?[t.immutableRoutes]:[]];for(let i of n)for(let s of hce(i))for(let a=1;a<s.points.length;a++){let c=s.points[a-1],l=s.points[a];for(let h of r)if(h.getConflictingRoutesForSegment(c,l,i.traceThickness/2+this.traceMargin).some(({conflictingRoute:d})=>!o.has(d.connectionName)&&!EXe(i,d,this.input.connMap)))return!1}return!0}buildTransitionSegmentIndex(e,t){let n=[];for(let r=0;r<this.reducedHdRoutes.length;r++){if(this.reducedHdRoutes[r].jumpers?.length)continue;let i=e[r];for(let s=0;s<i.length;s++){let a=i[s];if(!Hzt(a))for(let c of["start","end"]){let l=qrn({sections:i,sectionIndex:s,side:c});if(l===null||l===a.z)continue;if(!t.has(`${a.z}:${l}`))continue;let h=0;for(let d=1;d<a.points.length;d++){let u=a.points[d-1],_=a.points[d],p=Math.hypot(_.x-u.x,_.y-u.y);p>jy&&n.push({routeIndex:r,sectionIndex:s,side:c,adjacentZ:l,start:u,end:_,distanceFromSectionStart:h}),h+=p}}}}if(this.stats.transitionSegmentsIndexed=(this.stats.transitionSegmentsIndexed??0)+n.length,n.length===0)return null;let o=new Urn(n.length);for(let r of n)o.insert(r,Math.min(r.start.x,r.end.x),Math.min(r.start.y,r.end.y),Math.max(r.start.x,r.end.x),Math.max(r.start.y,r.end.y));return o.finish(),o}getIndexedCrossingGroups({detourRouteIndex:e,detourSection:t,targetZ:n,transitionSegmentIndex:o}){let r=new Map;for(let i=1;i<t.points.length;i++){let s=t.points[i-1],a=t.points[i];if(Math.hypot(a.x-s.x,a.y-s.y)<=jy)continue;this.stats.indexedDetourSegmentQueries=(this.stats.indexedDetourSegmentQueries??0)+1;let c=o.search(Math.min(s.x,a.x)-jy,Math.min(s.y,a.y)-jy,Math.max(s.x,a.x)+jy,Math.max(s.y,a.y)+jy);for(let l of c){if(l.routeIndex===e||l.start.z!==n||l.adjacentZ!==t.z)continue;this.stats.exactSegmentIntersectionChecks=(this.stats.exactSegmentIntersectionChecks??0)+1;let h=oyr(l.start,l.end,s,a);if(h===null)continue;let d=`${l.routeIndex}:${l.sectionIndex}:${l.side}`,u=r.get(d);u||(u={transitionRouteIndex:l.routeIndex,transitionSectionIndex:l.sectionIndex,side:l.side,crossingDistances:[]},r.set(d,u)),u.crossingDistances.push(l.distanceFromSectionStart+h)}}return[...r.values()].sort((i,s)=>i.transitionRouteIndex!==s.transitionRouteIndex?i.transitionRouteIndex-s.transitionRouteIndex:i.transitionSectionIndex!==s.transitionSectionIndex?i.transitionSectionIndex-s.transitionSectionIndex:i.side===s.side?0:i.side==="start"?-1:1)}tryCreateCandidate({detourRouteIndex:e,detourSection:t,targetZ:n,transitionRouteIndex:o,transitionSection:r,transitionSections:i,transitionSectionIndex:s,side:a,crossingDistances:c,baseClearanceIndexes:l}){if(!Fzt({sections:i,sectionIndex:s,targetZ:t.z,side:a}))return null;let h=this.reducedHdRoutes[e],d=this.reducedHdRoutes[o];if(c.length===0)return null;let u=d.viaDiameter/2+h.traceThickness/2+this.traceMargin+jy,_=a==="start"?Math.max(...c)+u:Math.min(...c)-u,p=this.relocateTransitionVia({route:d,section:r,targetZ:t.z,side:a,newViaDistance:_});if(!p)return null;let m=this.collapseDetourSection({route:h,section:t,targetZ:n});if(h.vias.length+d.vias.length-m.vias.length-p.route.vias.length!==2)return null;let A={detourRouteIndex:e,detourRoute:m,transitionUpdates:[{routeIndex:o,route:p.route,relocatedVias:[p.relocatedVia]}]};return this.candidateIsClear(A,l)?A:null}tryCreateMultiCrossingCandidate({detourRouteIndex:e,detourSection:t,targetZ:n,crossingGroups:o,sectionsByRoute:r,baseClearanceIndexes:i}){if(o.length<2)return null;let s=this.reducedHdRoutes[e],a=[],c=new Map;for(let d of o){let u=c.get(d.transitionRouteIndex)??[];u.push(d),c.set(d.transitionRouteIndex,u)}for(let[d,u]of c){let _=this.reducedHdRoutes[d],p=this.relocateTransitionVias({route:_,sections:r[d],crossingGroups:u,detourZ:t.z,detourTraceThickness:s.traceThickness});if(!p)return null;a.push({routeIndex:d,route:p.route,relocatedVias:p.relocatedVias})}let l=this.collapseDetourSection({route:s,section:t,targetZ:n});if(s.vias.length+[...c.keys()].reduce((d,u)=>d+this.reducedHdRoutes[u].vias.length,0)-(l.vias.length+a.reduce((d,{route:u})=>d+u.vias.length,0))!==2)return null;this.stats.multiCrossingCandidates=(this.stats.multiCrossingCandidates??0)+1;let h={detourRouteIndex:e,detourRoute:l,transitionUpdates:a};return this.candidateIsClear(h,i)?this.candidateRoutesHaveNoExternalCopperConflicts(h,i)?(this.stats.multiCrossingReductions=(this.stats.multiCrossingReductions??0)+1,this.stats.transitionRoutesMovedByMultiCrossingReductions=(this.stats.transitionRoutesMovedByMultiCrossingReductions??0)+a.length,h):(this.stats.multiCrossingPreexistingConflictRejections=(this.stats.multiCrossingPreexistingConflictRejections??0)+1,null):null}findCrossingReduction(){let e=this.reducedHdRoutes.map((i)=>hce(i)),t=[],n=new Set;for(let i=0;i<this.reducedHdRoutes.length;i++){if(this.reducedHdRoutes[i].jumpers?.length)continue;let s=e[i];for(let a=1;a<s.length-1;a++){let c=s[a-1],l=s[a],h=s[a+1];c.z!==h.z||c.z===l.z||Hzt(l)||(t.push({routeIndex:i,section:l,targetZ:c.z}),n.add(`${c.z}:${l.z}`))}}if(t.length===0)return null;let o=this.buildTransitionSegmentIndex(e,n);if(!o)return null;let r=null;for(let i of t){let{routeIndex:s,section:a}=i,c=this.reducedHdRoutes[s],l=this.getIndexedCrossingGroups({detourRouteIndex:s,detourSection:a,targetZ:i.targetZ,transitionSegmentIndex:o}).filter(({transitionRouteIndex:u})=>{let _=this.reducedHdRoutes[u];return!_.jumpers?.length&&!EXe(c,_,this.input.connMap)}),h=new Map;for(let u of l){let _=`${u.transitionRouteIndex}:${u.transitionSectionIndex}`,p=h.get(_)??[];p.push(u),h.set(_,p)}if(h.size>1){r??={mutableRoutes:new yV(this.reducedHdRoutes),immutableRoutes:this.input.otherHdRoutes?.length?new yV([...this.input.otherHdRoutes]):null};let u=[{groups:[],movement:0}],_=(p)=>{let m=this.reducedHdRoutes[p.transitionRouteIndex],A=e[p.transitionRouteIndex][p.transitionSectionIndex],g=m.viaDiameter/2+c.traceThickness/2+this.traceMargin+jy,f=p.side==="start"?Math.max(...p.crossingDistances)+g:Math.min(...p.crossingDistances)-g;return p.side==="start"?f:$rn(A.points)-f};for(let p of h.values()){let m=p.map((A)=>({group:A,movement:_(A)})).sort((A,g)=>A.movement-g.movement);u=u.flatMap((A)=>m.map((g)=>({groups:[...A.groups,g.group],movement:A.movement+g.movement}))).sort((A,g)=>A.movement-g.movement).slice(0,4)}for(let p of u){let m=this.tryCreateMultiCrossingCandidate({detourRouteIndex:s,detourSection:a,targetZ:i.targetZ,crossingGroups:p.groups,sectionsByRoute:e,baseClearanceIndexes:r});if(m)return m}continue}let d=h.values().next().value??[];for(let u of d){let _=u.transitionRouteIndex,p=e[_],m=p[u.transitionSectionIndex];r??={mutableRoutes:new yV(this.reducedHdRoutes),immutableRoutes:this.input.otherHdRoutes?.length?new yV([...this.input.otherHdRoutes]):null};let A=this.tryCreateCandidate({detourRouteIndex:s,detourSection:a,targetZ:i.targetZ,transitionRouteIndex:_,transitionSection:m,transitionSections:p,transitionSectionIndex:u.transitionSectionIndex,side:u.side,crossingDistances:u.crossingDistances,baseClearanceIndexes:r});if(A)return A}}return null}_step(){let e=this.findCrossingReduction();if(e){this.reducedHdRoutes[e.detourRouteIndex]=e.detourRoute;for(let t of e.transitionUpdates)this.reducedHdRoutes[t.routeIndex]=t.route;this.stats.crossingViaReductions=(this.stats.crossingViaReductions??0)+1,this.stats.viasRemovedByCrossingReductions=(this.stats.viasRemovedByCrossingReductions??0)+2}else this.solved=!0}getReducedHdRoutes(){return this.reducedHdRoutes}visualize(){let e={lines:[],circles:[],rects:[],coordinateSystem:"cartesian",title:"Crossing Via Reduction Solver"};for(let t of this.input.obstacles)e.rects.push({center:t.center,width:t.width,height:t.height,fill:"rgba(128, 128, 128, 0.2)"});for(let t of this.reducedHdRoutes){for(let n=1;n<t.route.length;n++){let o=t.route[n-1],r=t.route[n];o.z===r.z&&e.lines.push({points:[o,r],strokeColor:o.z===0?"#d32f2f":"#3367a8",strokeWidth:t.traceThickness,label:`${t.connectionName} (z=${o.z})`})}for(let n of t.vias)e.circles.push({center:n,radius:t.viaDiameter/2,fill:"#ff20d6",label:`${t.connectionName} via`})}return e}},kCe=0.000001,MXe=(e,t)=>Math.abs(e.x-t.center.x)<=t.width/2+kCe&&Math.abs(e.y-t.center.y)<=t.height/2+kCe,Ozt=(e)=>(e.__zLayers?.length??e.layers?.length??0)>1,s6=class extends lY{constructor(e){if(super(),this.simplificationConfig=e,this.simplificationConfig={...e,obstacles:Yle(e.obstacles,e.layerCount)},this.hdRoutes=this.markThroughObstacleSegments(e.hdRoutes),e.preserveRouteEndpoints){let t=new Map;for(let n of e.hdRoutes){let o=n.route[0],r=n.route.at(-1);if(!o||!r)throw Error(`TraceSimplificationSolver cannot preserve endpoints for empty route "${n.connectionName}"`);if(t.has(n.connectionName))throw Error(`TraceSimplificationSolver cannot preserve endpoints for duplicate route "${n.connectionName}"`);t.set(n.connectionName,{start:{...o},end:{...r}})}this.preservedRouteEndpoints=t}this.MAX_ITERATIONS=1e8}simplificationConfig;getSolverName(){return"TraceSimplificationSolver"}hdRoutes=[];preservedRouteEndpoints;simplificationPipelineLoops=0;MAX_SIMPLIFICATION_PIPELINE_LOOPS=2;PHASE_ORDER=["via_removal","crossing_via_reduction","via_merging","path_simplification"];currentPhase="via_removal";extractResult=null;get simplifiedHdRoutes(){return this.hdRoutes}validatePreservedRouteEndpoints(e){if(!this.preservedRouteEndpoints)return;if(e.length!==this.preservedRouteEndpoints.size)throw Error(`TraceSimplificationSolver changed the preserved route set (expected ${this.preservedRouteEndpoints.size}, got ${e.length})`);let t=new Set,n=(o,r)=>Math.abs(o.x-r.x)<=kCe&&Math.abs(o.y-r.y)<=kCe&&o.z===r.z;for(let o of e){if(t.has(o.connectionName))throw Error(`TraceSimplificationSolver produced duplicate preserved route "${o.connectionName}"`);t.add(o.connectionName);let r=this.preservedRouteEndpoints.get(o.connectionName),i=o.route[0],s=o.route.at(-1);if(!(r&&i&&s&&n(i,r.start)&&n(s,r.end)))throw Error(`TraceSimplificationSolver changed a preserved endpoint for route "${o.connectionName}"`)}}isSameNetObstacle(e,t){return t.connectedTo.some((n)=>n===e.connectionName||n===e.rootConnectionName||this.simplificationConfig.connMap.areIdsConnected(e.connectionName,n)||e.rootConnectionName!==void 0&&this.simplificationConfig.connMap.areIdsConnected(e.rootConnectionName,n))}getSameNetObstacleForSegment(e,t,n){return this.simplificationConfig.obstacles.find((o)=>Ozt(o)&&this.isSameNetObstacle(e,o)&&MXe(t,o)&&MXe(n,o))}isViaInsideSameNetObstacle(e,t){return this.simplificationConfig.obstacles.some((n)=>Ozt(n)&&this.isSameNetObstacle(e,n)&&MXe(t,n))}markThroughObstacleSegments(e){return e.map((t)=>({...t,route:t.route.map((n,o,r)=>{let i=r[o+1],s=i&&n.z!==i.z&&this.getSameNetObstacleForSegment(t,n,i);if(s)return{...n,toNextSegmentType:"through_obstacle",...s.circuitJsonMetadata?{toNextSegmentCircuitJsonMetadata:s.circuitJsonMetadata}:{}};let a={...n};return delete a.toNextSegmentType,delete a.toNextSegmentCircuitJsonMetadata,a}),vias:t.vias.filter((n)=>!this.isViaInsideSameNetObstacle(t,n))}))}_step(){if(this.simplificationPipelineLoops>=this.MAX_SIMPLIFICATION_PIPELINE_LOOPS)this.solved=!0;else{if(this.activeSubSolver){if(this.activeSubSolver.step(),!this.activeSubSolver.failed&&!this.activeSubSolver.solved)return;if(this.activeSubSolver.solved){if(this.extractResult){let e=this.extractResult(this.activeSubSolver);this.validatePreservedRouteEndpoints(e),this.hdRoutes=this.markThroughObstacleSegments(e)}if(this.activeSubSolver=null,this.extractResult=null,this.currentPhase==="via_removal"?this.currentPhase=this.simplificationConfig.enableCrossingViaReduction?"crossing_via_reduction":"via_merging":this.currentPhase==="crossing_via_reduction"?this.currentPhase="via_merging":this.currentPhase==="via_merging"?this.currentPhase="path_simplification":(this.currentPhase="via_removal",this.simplificationPipelineLoops++),this.simplificationPipelineLoops>=this.MAX_SIMPLIFICATION_PIPELINE_LOOPS)return void(this.solved=!0)}else if(this.activeSubSolver.failed)return this.failed=!0,void(this.error=this.activeSubSolver.error??"Sub-solver failed without error message")}if(!this.activeSubSolver&&!this.solved)switch(this.currentPhase){case"via_removal":this.activeSubSolver=new jrn({enableRoutedTraceDetours:this.simplificationConfig.enableRoutedTraceDetours,unsimplifiedHdRoutes:this.hdRoutes,otherHdRoutes:[...this.simplificationConfig.otherHdRoutes??[]],obstacles:[...this.simplificationConfig.obstacles],colorMap:{...this.simplificationConfig.colorMap},layerCount:this.simplificationConfig.layerCount,connMap:this.simplificationConfig.connMap,outline:this.simplificationConfig.outline?[...this.simplificationConfig.outline]:void 0,geometryShortcutTraceMargin:0.1,geometryShortcutObstacleMargin:this.simplificationConfig.minTraceToPadEdgeClearance??0.15,enableGeometryShortcuts:this.simplificationPipelineLoops>0,enableObstacleDetourShortcuts:this.simplificationConfig.enableCrossingViaReduction===!0&&this.simplificationPipelineLoops>0,preserveRouteEndpoints:this.simplificationConfig.preserveRouteEndpoints,terminalLayerIndicesByPcbPortId:this.simplificationConfig.terminalLayerIndicesByPcbPortId}),this.extractResult=(e)=>e.getOptimizedHdRoutes()??[];break;case"crossing_via_reduction":this.activeSubSolver=new ryr({inputHdRoutes:this.hdRoutes,otherHdRoutes:[...this.simplificationConfig.otherHdRoutes??[]],obstacles:[...this.simplificationConfig.obstacles],connMap:this.simplificationConfig.connMap,layerCount:this.simplificationConfig.layerCount,outline:this.simplificationConfig.outline?[...this.simplificationConfig.outline]:void 0,traceMargin:0.1,obstacleMargin:this.simplificationConfig.minTraceToPadEdgeClearance??0.15}),this.extractResult=(e)=>e.getReducedHdRoutes();break;case"via_merging":this.activeSubSolver=new wZe({inputHdRoutes:this.hdRoutes,otherHdRoutes:[...this.simplificationConfig.otherHdRoutes??[]],netByConnectionName:this.simplificationConfig.netByConnectionName,obstacles:[...this.simplificationConfig.obstacles],colorMap:{...this.simplificationConfig.colorMap},layerCount:this.simplificationConfig.layerCount,connMap:this.simplificationConfig.connMap,outline:this.simplificationConfig.outline?[...this.simplificationConfig.outline]:void 0,preserveRouteEndpoints:this.simplificationConfig.preserveRouteEndpoints}),this.extractResult=(e)=>e.getMergedViaHdRoutes()??[];break;case"path_simplification":this.activeSubSolver=new q1r({unsimplifiedHdRoutes:this.hdRoutes,otherHdRoutes:[...this.simplificationConfig.otherHdRoutes??[]],obstacles:[...this.simplificationConfig.obstacles],connMap:this.simplificationConfig.connMap,colorMap:{...this.simplificationConfig.colorMap},outline:this.simplificationConfig.outline?[...this.simplificationConfig.outline]:void 0,minBoardEdgeClearance:this.simplificationConfig.minBoardEdgeClearance,defaultViaDiameter:this.simplificationConfig.defaultViaDiameter,useTraceWidthAwareClearance:this.simplificationConfig.useTraceWidthAwareClearance,enableVertexShortcuts:this.simplificationConfig.enableVertexShortcuts}),this.extractResult=(e)=>e.simplifiedHdRoutes;break;default:this.failed=!0,this.error=`Unknown phase: ${this.currentPhase}`}}}visualize(){if(this.activeSubSolver)return this.activeSubSolver.visualize();let e={lines:[],points:[],rects:[],circles:[],coordinateSystem:"cartesian",title:"Trace Simplification Solver"};for(let t of this.simplificationConfig.obstacles){let n="rgba(128, 128, 128, 0.2)",o=t.__zLayers?.includes(0),r=t.__zLayers?.includes(1);o&&r?n="rgba(128, 0, 128, 0.2)":o?n="rgba(255, 0, 0, 0.2)":r&&(n="rgba(0, 0, 255, 0.2)"),e.rects.push({center:t.center,width:t.width,height:t.height,fill:n,label:`Obstacle (Z: ${t.__zLayers?.join(", ")})`})}for(let t of this.simplificationConfig.otherHdRoutes??[]){for(let n=0;n<t.route.length-1;n++){let o=t.route[n],r=t.route[n+1];o.z===r.z&&e.lines.push({points:[{x:o.x,y:o.y},{x:r.x,y:r.y}],strokeColor:o.z===0?"rgba(160, 32, 32, 0.55)":"rgba(32, 32, 160, 0.55)",strokeWidth:t.traceThickness,strokeDash:[0.08,0.08],label:`${t.connectionName} immutable (z=${o.z})`})}for(let n of t.vias)e.circles.push({center:{x:n.x,y:n.y},radius:t.viaDiameter/2,fill:"rgba(96, 96, 96, 0.45)",label:`${t.connectionName} immutable via`})}for(let t of this.hdRoutes)if(t.route.length!==0){for(let n=0;n<t.route.length-1;n++){let o=t.route[n],r=t.route[n+1];o.z===r.z&&e.lines.push({points:[{x:o.x,y:o.y},{x:r.x,y:r.y}],strokeColor:o.z===0?"red":"blue",strokeWidth:t.traceThickness,label:`${t.connectionName} (z=${o.z})`})}for(let n of t.vias)e.circles.push({center:{x:n.x,y:n.y},radius:t.viaDiameter/2,fill:"rgba(255, 0, 255, 0.5)",label:`${t.connectionName} via`});if(t.jumpers&&t.jumpers.length>0){let n=MZe(t.jumpers,{color:"orange",label:t.connectionName});e.rects.push(...n.rects??[]),e.lines.push(...n.lines??[])}}return e}},wce=class{tree;constructor(e=9){this.tree=new JV(e)}insert(e,t,n,o,r){this.tree.insert({minX:t,minY:n,maxX:o,maxY:r,data:e})}bulkLoad(e){let t=e.map(({item:n,minX:o,minY:r,maxX:i,maxY:s})=>({minX:o,minY:r,maxX:i,maxY:s,data:n}));this.tree.load(t)}search(e,t,n,o){return this.tree.search({minX:e,minY:t,maxX:n,maxY:o}).map((r)=>r.data)}clear(){this.tree.clear()}},Jrn=class{index;items=[];currentIndex=0;capacity;constructor(e){this.capacity=Math.max(1,e),this.index=new R_(this.capacity)}insert(e,t,n,o,r){if(this.currentIndex>=this.index.numItems)throw Error("Exceeded initial capacity");this.items[this.currentIndex]=e,this.index.add(t,n,o,r),this.currentIndex++}finish(){this.index.finish()}search(e,t,n,o){return this.index.search(e,t,n,o).map((r)=>this.items[r]||null).filter(Boolean)}clear(){this.items=[],this.currentIndex=0,this.index=new R_(this.capacity)}},$be=class{idx;storage=[];constructor(e="native",t=[]){e==="flatbush"?t.length===0?(this.idx=new wce,e="rbush"):this.idx=new Jrn(t.length):this.idx=e==="rbush"?new wce:new class{shi=new iyr(t);insert(n){}search(n,o,r,i){let s=(n+r)/2,a=(o+i)/2,c=r-n,l=i-o;return this.shi.getNodesInArea(s,a,c,l)}clear(){}},t.forEach((n)=>this.insert(n)),e==="flatbush"&&t.length>0&&this.idx.finish?.()}insert(e){this.storage.push(e),this.idx.insert(e,e.center.x-e.width/2,e.center.y-e.height/2,e.center.x+e.width/2,e.center.y+e.height/2)}search(e){return this.idx.search(e.minX,e.minY,e.maxX,e.maxY)}searchArea(e,t,n,o){return this.search({minX:e-n/2,minY:t-o/2,maxX:e+n/2,maxY:t+o/2})}},iyr=class{constructor(e){this.obstacles=e,this.buckets=new Map;for(let t=0;t<e.length;t++){let n=e[t],o=n.center.x-n.width/2,r=n.center.y-n.height/2,i=n.center.x+n.width/2,s=n.center.y+n.height/2;for(let a=o;a<=i;a+=this.CELL_SIZE)for(let c=r;c<=s;c+=this.CELL_SIZE){let l=this.getBucketKey(a,c),h=this.buckets.get(l);h?h.push([n,t]):this.buckets.set(l,[[n,t]])}}}obstacles;buckets;CELL_SIZE=0.4;getBucketKey(e,t){return`${Math.floor(e/this.CELL_SIZE)}x${Math.floor(t/this.CELL_SIZE)}`}getNodesInArea(e,t,n,o){let r=[],i=new Set,s=t-o/2,a=e+n/2,c=t+o/2;for(let l=e-n/2;l<=a;l+=this.CELL_SIZE)for(let h=s;h<=c;h+=this.CELL_SIZE){let d=this.getBucketKey(l,h),u=this.buckets.get(d)||[];for(let _ of u)i.has(_[1])||(i.add(_[1]),r.push(_[0]))}return r}},E3=0.000000001,Yq=class extends ei{getSolverName(){return"TraceWidthSolver"}hdRoutes;hdRoutesWithWidths=[];nominalTraceWidth;minTraceWidth;obstacleMargin;minTraceToHoleEdgeClearance;TRACE_WIDTH_SCHEDULE;connectionNominalTraceWidthMap;unprocessedRoutes=[];processedRoutes=[];currentTrace=null;cursorPosition=null;currentTraceSegmentIndex=0;currentTraceSegmentT=0;currentScheduleIndex=0;currentTargetWidth=0;hasInsufficientClearance=!1;lastCollidingObstacles=[];lastCollidingRoutes=[];lastClearance=1/0;obstacles=[];obstacleSHI;hdRouteSHI;connMap;colorMap;constructor(e){super(),this.MAX_ITERATIONS=1e6,this.hdRoutes=[...e.hdRoutes],this.minTraceWidth=e.minTraceWidth,this.obstacleMargin=e.obstacleMargin??0.15,this.minTraceToHoleEdgeClearance=e.minTraceToHoleEdgeClearance,this.nominalTraceWidth=0,this.TRACE_WIDTH_SCHEDULE=[],this.unprocessedRoutes=[...this.hdRoutes],this.connMap=e.connMap,this.colorMap=e.colorMap;let t=e.layerCount;this.obstacles=kq(e.obstacles??[],t),this.connectionNominalTraceWidthMap=new Map;for(let n of e.connection)n.nominalTraceWidth!==void 0&&this.connectionNominalTraceWidthMap.set(n.name,n.nominalTraceWidth);this.obstacles.length>0&&(this.obstacleSHI=new $be("flatbush",this.obstacles)),this.hdRouteSHI=new rCe(this.hdRoutes)}getNominalTraceWidthForRoute(e){let t=this.connectionNominalTraceWidthMap.get(e.connectionName);return t!==void 0?t:e.rootConnectionName?this.connectionNominalTraceWidthMap.get(e.rootConnectionName):void 0}_step(){if(!this.currentTrace){let t=this.unprocessedRoutes.shift();if(!t)return this.hdRoutesWithWidths=this.processedRoutes,void(this.solved=!0);let n=this.getNominalTraceWidthForRoute(t);if(n===void 0){let r=t.traceThickness??this.minTraceWidth;return this.processedRoutes.push(this.createRouteWithWidth(t,r)),void(this.currentTrace=null)}this.currentTrace=t,this.nominalTraceWidth=n;let o=(this.nominalTraceWidth+this.minTraceWidth)/2;return this.TRACE_WIDTH_SCHEDULE=[this.nominalTraceWidth,o],this.currentTrace.route.length<2?(this.processedRoutes.push(this.createRouteWithWidth(this.currentTrace,this.minTraceWidth)),void(this.currentTrace=null)):(this.currentScheduleIndex=0,this.currentTargetWidth=this.TRACE_WIDTH_SCHEDULE[0],void this.initializeCursor())}let e=this.stepCursorForward();(e?this.getClearanceForSegment(this.cursorPosition,this.cursorPosition):this.getMinimumRouteClearance())<this.currentTargetWidth/2+this.obstacleMargin?(this.hasInsufficientClearance=!0,this.currentScheduleIndex++,this.currentScheduleIndex<this.TRACE_WIDTH_SCHEDULE.length?(this.currentTargetWidth=this.TRACE_WIDTH_SCHEDULE[this.currentScheduleIndex],this.initializeCursor()):this.finalizeCurrentTrace(this.minTraceWidth)):e||this.finalizeCurrentTrace(this.currentTargetWidth)}initializeCursor(){if(!this.currentTrace)return;let e=this.currentTrace.route[0];this.cursorPosition={...e},this.currentTraceSegmentIndex=0,this.currentTraceSegmentT=0,this.hasInsufficientClearance=!1}stepCursorForward(){if(!this.currentTrace||!this.cursorPosition)return!1;let e=this.currentTrace.route,t=0.1;for(;t>0;){if(this.currentTraceSegmentIndex>=e.length-1)return!1;let n=e[this.currentTraceSegmentIndex],o=e[this.currentTraceSegmentIndex+1];if(n.insideJumperPad&&o.insideJumperPad){this.currentTraceSegmentIndex++,this.currentTraceSegmentT=0;continue}let r=o.x-n.x,i=o.y-n.y,s=Math.sqrt(r*r+i*i);if(s===0){this.currentTraceSegmentIndex++,this.currentTraceSegmentT=0;continue}let a=this.currentTraceSegmentT*s,c=s-a;if(t<=c){let l=a+t;return this.currentTraceSegmentT=l/s,this.cursorPosition={x:n.x+r*this.currentTraceSegmentT,y:n.y+i*this.currentTraceSegmentT,z:n.z},!0}if(t-=c,this.currentTraceSegmentIndex++,this.currentTraceSegmentT=0,this.currentTraceSegmentIndex>=e.length-1){let l=e[e.length-1];return this.cursorPosition={...l},!1}}return!0}isObstacleOwnJumperPad(e){if(!this.currentTrace?.jumpers)return!1;for(let t of this.currentTrace.jumpers){let n=Math.sqrt((e.center.x-t.start.x)**2+(e.center.y-t.start.y)**2),o=Math.sqrt((e.center.x-t.end.x)**2+(e.center.y-t.end.y)**2),r=Math.max(e.width,e.height)/2+0.01;if(n<r||o<r)return!0}return!1}getMinimumRouteClearance(){if(!this.currentTrace)return 1/0;let e=1/0,t=this.currentTrace.route;for(let n=0;n<t.length-1;n++){let o=t[n],r=t[n+1];o.z===r.z&&(o.insideJumperPad&&r.insideJumperPad||o.toNextSegmentType!=="through_obstacle"&&(e=Math.min(e,this.getClearanceForSegment(o,r))))}return e}getClearanceForSegment(e,t){if(!this.currentTrace)return 1/0;let n=this.currentTrace.rootConnectionName??this.currentTrace.connectionName,o=this.currentTargetWidth/2+this.obstacleMargin,r=1/0;this.lastCollidingObstacles=[],this.lastCollidingRoutes=[];let i=this.currentTargetWidth/2+Math.max(this.obstacleMargin,this.minTraceToHoleEdgeClearance??0),s=new Set(this.obstacleSHI?.search({minX:Math.min(e.x,t.x)-i,minY:Math.min(e.y,t.y)-i,maxX:Math.max(e.x,t.x)+i,maxY:Math.max(e.y,t.y)+i}));for(let c of this.obstacles)c.ccwRotationDegrees&&s.add(c);for(let c of s){if(!this.isObstacleOnPointLayer(c,e))continue;if(_B(c,this.currentTrace,this.connMap))continue;if(c.obstacleId&&this.connMap?.areIdsConnected(n,c.obstacleId))continue;if(this.isObstacleOwnJumperPad(c))continue;let l=-(c.ccwRotationDegrees??0)*Math.PI/180,h=Math.cos(l),d=Math.sin(l),u={x:(e.x-c.center.x)*h-(e.y-c.center.y)*d,y:(e.x-c.center.x)*d+(e.y-c.center.y)*h},_={x:(t.x-c.center.x)*h-(t.y-c.center.y)*d,y:(t.x-c.center.x)*d+(t.y-c.center.y)*h},p=(c.isNonPlatedHole&&c.shape==="circle"?XQ(e,t,{...c.center,radius:c.width/2}):KS(u,_,{center:{x:0,y:0},width:c.width,height:c.height}))-((c.isNonPlatedHole?this.minTraceToHoleEdgeClearance??this.obstacleMargin:this.obstacleMargin)-this.obstacleMargin);r=Math.min(r,p),p<o&&this.lastCollidingObstacles.push(c)}let a=this.hdRouteSHI.getConflictingRoutesForSegment(e,t,o);for(let{conflictingRoute:c}of a){let l=c,h=l.rootConnectionName??l.connectionName;if(h===n)continue;if(this.connMap?.areIdsConnected(n,h))continue;let d=1/0;for(let u=0;u<l.route.length-1;u++){let _=l.route[u],p=l.route[u+1];_.z===p.z&&_.z===e.z&&(_.insideJumperPad&&p.insideJumperPad||_.toNextSegmentType!=="through_obstacle"&&(d=Math.min(d,Q_(e,t,_,p)-(_.traceThickness??l.traceThickness)/2)))}for(let u of l.vias)d=Math.min(d,XQ(e,t,{...u,radius:l.viaDiameter/2}));r=Math.min(r,d),d<o&&this.lastCollidingRoutes.push(l)}return this.lastClearance=r,r}isObstacleOnPointLayer(e,t){return!e.__zLayers||e.__zLayers.includes(t.z)}getAdjacentNonCoincidentRoutePoint(e,t){let n=e.route[t];if(!n)return;let o=t===0?1:-1;for(let r=t+o;r>=0&&r<e.route.length;r+=o){let i=e.route[r];if(kn(i,n)>E3)return i}}getObstacleWidthAlongVector(e,t){let n=(e.ccwRotationDegrees??0)*Math.PI/180,o=Math.cos(n),r=Math.sin(n),i=o,s=r,a=-r,c=o;return Math.abs(t.x*i+t.y*s)*e.width+Math.abs(t.x*a+t.y*c)*e.height}getTerminalPadWidthLimit(e,t,n){let o=e.route[t];if(!o)return;let r=this.getAdjacentNonCoincidentRoutePoint(e,t);if(!r)return;let i=t===0?kje(o,r):kje(r,o);if(kn(i,{x:0,y:0})<=E3)return;let s={x:-i.y,y:i.x},a;for(let c of this.obstacles){if(!this.isObstacleOnPointLayer(c,o))continue;if(iP(o,c)>E3)continue;if(!_B(c,e,this.connMap))continue;let l=this.getObstacleWidthAlongVector(c,s);if(l<=E3)continue;let h=this.getObstacleWidthAlongVector(c,i)/2;(!a||l<a.width||Math.abs(l-a.width)<=E3&&h>a.neckDistance)&&(a={width:l,neckDistance:h})}return!a||a.width>=n-E3?void 0:a}getRouteDistanceInfo(e){let t=[0],n=0;for(let o=1;o<e.length;o++){let r=e[o-1];n+=kn(e[o],r),t.push(n)}return{distances:t,totalDistance:n}}interpolateRoutePointAtDistance(e,t,n){for(let o=1;o<e.length;o++){let r=t[o-1],i=t[o],s=i-r;if(n>i+E3)continue;let a=e[o-1],c=e[o];if(s<=E3)return{...c};let l=Math.max(0,Math.min(1,(n-r)/s));return{x:a.x+(c.x-a.x)*l,y:a.y+(c.y-a.y)*l,z:a.z}}return{...e[e.length-1]}}getTaperWidthAtDistance({distanceFromStart:e,totalDistance:t,startLimit:n,endLimit:o,taperDistance:r,traceWidth:i}){let s=i;if(n!==void 0&&e<=r){let a=Math.min(n.neckDistance,r);if(e<=a)s=Math.min(s,n.width);else{let c=(e-a)/Math.max(r-a,E3);s=Math.min(s,n.width+(i-n.width)*c)}}if(o!==void 0){let a=t-e;if(a<=r){let c=Math.min(o.neckDistance,r);if(a<=c)s=Math.min(s,o.width);else{let l=(a-c)/Math.max(r-c,E3);s=Math.min(s,o.width+(i-o.width)*l)}}}return s}createTerminalTaperedRoute(e,t){if(e.route.length<2)return e.route.map((l)=>({...l,traceThickness:l.traceThickness??t}));let n=this.getTerminalPadWidthLimit(e,0,t),o=this.getTerminalPadWidthLimit(e,e.route.length-1,t),{distances:r,totalDistance:i}=this.getRouteDistanceInfo(e.route);if(i<=E3){let l=Math.min(n?.width??t,o?.width??t);return e.route.map((h)=>({...h,traceThickness:l}))}let s=Math.min(Math.max(2*t,0.75),i/2),a=r.map((l,h)=>({distanceFromStart:l,originalPointIndex:h})),c=[];if(n!==void 0){c.push(n.neckDistance);for(let l=0;l<=8;l++)c.push(s*l/8)}if(o!==void 0){c.push(i-o.neckDistance);for(let l=0;l<=8;l++)c.push(i-s+s*l/8)}for(let l of c){let h=Math.max(0,Math.min(i,l));a.some((d)=>Math.abs(d.distanceFromStart-h)<=E3)||a.push({distanceFromStart:h})}return a.sort((l,h)=>{let d=l.distanceFromStart-h.distanceFromStart;return Math.abs(d)>E3?d:(l.originalPointIndex??1/0)-(h.originalPointIndex??1/0)}),a.map((l)=>{let{distanceFromStart:h}=l,d=l.originalPointIndex!==void 0?{...e.route[l.originalPointIndex]}:this.interpolateRoutePointAtDistance(e.route,r,h);return d.traceThickness=this.getTaperWidthAtDistance({distanceFromStart:h,totalDistance:i,startLimit:n,endLimit:o,taperDistance:s,traceWidth:t}),d})}createRouteWithWidth(e,t){return{connectionName:e.connectionName,rootConnectionName:e.rootConnectionName,startPcbPortId:e.startPcbPortId,endPcbPortId:e.endPcbPortId,traceThickness:t,viaDiameter:e.viaDiameter,route:this.createTerminalTaperedRoute(e,t),vias:[...e.vias],jumpers:e.jumpers}}finalizeCurrentTrace(e){if(!this.currentTrace)return;let t=this.createRouteWithWidth(this.currentTrace,e);this.processedRoutes.push(t),this.hdRouteSHI.removeRoute(t.connectionName),this.hdRouteSHI.addRoute(t),this.currentTrace=null,this.cursorPosition=null,this.hasInsufficientClearance=!1}visualize(){let e={lines:[],points:[],circles:[],rects:[],coordinateSystem:"cartesian",title:`Trace Width Solver (schedule: [${this.TRACE_WIDTH_SCHEDULE.map((o)=>o.toFixed(2)).join(", ")}]mm, fallback: ${this.minTraceWidth.toFixed(2)}mm, margin: ${this.obstacleMargin.toFixed(2)}mm)`},t=new Set(this.lastCollidingObstacles.map((o)=>o.obstacleId)),n=new Set(this.lastCollidingRoutes.map((o)=>o.connectionName));for(let o of this.obstacles){let r=t.has(o.obstacleId),i=o.__zLayers?.includes(0),s=o.__zLayers?.includes(1),a;a=r?"rgba(255, 0, 0, 0.6)":i&&s?"rgba(128, 0, 128, 0.15)":i?"rgba(255, 0, 0, 0.15)":s?"rgba(0, 0, 255, 0.15)":"rgba(128, 128, 128, 0.15)",e.rects.push({center:o.center,width:o.width,height:o.height,fill:a,stroke:r?"red":void 0,label:r?`COLLIDING: ${o.obstacleId??"obstacle"}`:`${o.obstacleId??"obstacle"} (Z: ${o.__zLayers?.join(", ")})`})}for(let o of this.processedRoutes){if(o.route.length===0)continue;let r=o.traceThickness===this.nominalTraceWidth,i=o.traceThickness===this.TRACE_WIDTH_SCHEDULE[1],s=r?"green":i?"yellow":"orange";for(let a=0;a<o.route.length-1;a++){let c=o.route[a],l=o.route[a+1];c.insideJumperPad&&l.insideJumperPad||c.z===l.z&&e.lines.push({points:[{x:c.x,y:c.y},{x:l.x,y:l.y}],strokeColor:s,strokeWidth:c.traceThickness??o.traceThickness,label:`${o.connectionName} (w=${(c.traceThickness??o.traceThickness).toFixed(2)})`})}for(let a of o.vias)e.circles.push({center:{x:a.x,y:a.y},radius:o.viaDiameter/2,fill:"rgba(255, 0, 255, 0.5)",label:`${o.connectionName} via`});if(o.jumpers&&o.jumpers.length>0){let a=lv(o.jumpers,{color:s,label:o.connectionName});e.rects.push(...a.rects??[]),e.lines.push(...a.lines??[])}}if(this.currentTrace){for(let o=0;o<this.currentTrace.route.length-1;o++){let r=this.currentTrace.route[o],i=this.currentTrace.route[o+1];r.insideJumperPad&&i.insideJumperPad||r.z===i.z&&e.lines.push({points:[{x:r.x,y:r.y},{x:i.x,y:i.y}],strokeColor:"cyan",strokeWidth:this.currentTrace.traceThickness??this.minTraceWidth,label:`Processing: ${this.currentTrace.connectionName}`})}this.cursorPosition&&(e.circles.push({center:{x:this.cursorPosition.x,y:this.cursorPosition.y},radius:this.currentTargetWidth/2,stroke:this.hasInsufficientClearance?"red":"green",fill:"none",label:`Testing width: ${this.currentTargetWidth.toFixed(2)}mm (clearance: ${this.lastClearance.toFixed(2)}mm)`}),e.points.push({x:this.cursorPosition.x,y:this.cursorPosition.y,color:"orange",label:"Cursor"}))}for(let o of this.unprocessedRoutes){if(o.route.length===0)continue;let r=n.has(o.connectionName);for(let i=0;i<o.route.length-1;i++){let s=o.route[i],a=o.route[i+1];s.z===a.z&&e.lines.push({points:[{x:s.x,y:s.y},{x:a.x,y:a.y}],strokeColor:r?"rgba(255, 0, 0, 0.8)":"rgba(128, 128, 128, 0.3)",strokeWidth:o.traceThickness??this.minTraceWidth,label:r?`COLLIDING: ${o.connectionName}`:o.connectionName})}}return e}getHdRoutesWithWidths(){return this.hdRoutesWithWidths}};var syr=class extends ei{getSolverName(){return"CapacityEdgeToPortSegmentSolver"}nodes;edges;capacityPaths;nodeMap;nodeEdgeMap;unprocessedNodeIds;nodePortSegments;colorMap;constructor({nodes:e,edges:t,capacityPaths:n,colorMap:o}){super(),this.nodes=e,this.edges=t,this.nodeMap=new Map(e.map((r)=>[r.capacityMeshNodeId,r])),this.nodeEdgeMap=eq(t),this.capacityPaths=n,this.colorMap=o??{},this.unprocessedNodeIds=[...new Set(n.flatMap((r)=>r.nodeIds))],this.nodePortSegments=new Map}step(){let e=this.unprocessedNodeIds.pop();if(!e)return void(this.solved=!0);let t=[];for(let i of this.capacityPaths){let s=i.nodeIds.indexOf(e);s!==-1&&t.push({path:i,indexOfNodeInPath:s})}let n=this.nodeMap.get(e),o=[];for(let{path:i,indexOfNodeInPath:s}of t){let a=i.nodeIds[s-1],c=i.nodeIds[s+1];for(let l of[a,c]){let h=this.nodeMap.get(l);if(!h)continue;let d=ayr(n,h),u=h.availableZ.filter((p)=>n.availableZ.includes(p));if(u.length===0)continue;let _={capacityMeshNodeId:e,start:d.start,end:d.end,connectionNames:[i.connectionName],rootConnectionNames:i.rootConnectionName?[i.rootConnectionName]:void 0,availableZ:u};o.push(_)}}let r=function(i){let s=[],a=i.map((c)=>({...c,connectionNames:[...c.connectionNames],rootConnectionNames:c.rootConnectionNames?[...c.rootConnectionNames]:[],availableZ:[...c.availableZ].sort((l,h)=>l-h)}));for(;a.length>0;){let c=a.pop(),l=!1;for(let h=0;h<s.length;h++){let d=s[h],u=Y4e(d.start,c.start)&&Y4e(d.end,c.end)||Y4e(d.start,c.end)&&Y4e(d.end,c.start),_=cyr(d.availableZ,c.availableZ);if(u&&_){let p=new Set(d.connectionNames);c.connectionNames.forEach((A)=>p.add(A)),d.connectionNames=Array.from(p);let m=new Set(d.rootConnectionNames||[]);c.rootConnectionNames?.forEach((A)=>m.add(A)),d.rootConnectionNames=Array.from(m),l=!0;break}}l||s.push(c)}return s}(o);this.nodePortSegments.set(e,r)}visualize(){let e={lines:[],points:[],rects:[],circles:[]};return this.nodePortSegments.forEach((t,n)=>{this.nodeMap.get(n),t.forEach((o)=>{o.start.x,o.end.x;for(let r=0;r<o.connectionNames.length;r++){let i={x:0.05*Math.max(...o.availableZ),y:0.05*Math.max(...o.availableZ)},s={x:(o.start.x+o.end.x)/2,y:(o.start.y+o.end.y)/2},a={x:s.x+i.x,y:s.y+i.y};i.x>0&&e.lines.push({points:[s,a],strokeColor:"rgba(0, 0, 0, 0.25)",strokeDash:"5 5"}),e.points.push({x:a.x,y:a.y,label:`${n}: ${o.connectionNames.join(", ")}
availableZ: ${o.availableZ.join(",")}
nodePortSegmentId: ${o.nodePortSegmentId}`}),e.lines.push({points:[o.start,o.end],strokeColor:zi(this.colorMap[o.connectionNames[r]],0.6)})}})}),e}};function ayr(e,t){let n={start:Math.max(e.center.x-e.width/2,t.center.x-t.width/2),end:Math.min(e.center.x+e.width/2,t.center.x+t.width/2)},o={start:Math.max(e.center.y-e.height/2,t.center.y-t.height/2),end:Math.min(e.center.y+e.height/2,t.center.y+t.height/2)};if(n.end-n.start<o.end-o.start){let r=(n.start+n.end)/2;return{start:{x:r,y:o.start},end:{x:r,y:o.end}}}{let r=(o.start+o.end)/2;return{start:{x:n.start,y:r},end:{x:n.end,y:r}}}}var Vzt=0.000000001;function Y4e(e,t){return Math.abs(e.x-t.x)<Vzt&&Math.abs(e.y-t.y)<Vzt}function cyr(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}var lyr=class{constructor(e){this.targets=e,this.buckets=new Map;for(let t=0;t<e.length;t++){let n=e[t],o=Math.floor(n.bounds.minX/this.CELL_SIZE)*this.CELL_SIZE,r=Math.floor(n.bounds.minY/this.CELL_SIZE)*this.CELL_SIZE,i=n.bounds.maxX,s=n.bounds.maxY;for(let a=o;a<=i;a+=this.CELL_SIZE)for(let c=r;c<=s;c+=this.CELL_SIZE){let l=this.getBucketKey(a,c),h=this.buckets.get(l);h?h.push([n,t]):this.buckets.set(l,[[n,t]])}}}targets;buckets;CELL_SIZE=5;getBucketKey(e,t){return`${Math.floor(e/this.CELL_SIZE)}x${Math.floor(t/this.CELL_SIZE)}`}getTargetsInArea(e,t,n,o){let r=[],i=new Set,s=Math.floor((e-n/2)/this.CELL_SIZE)*this.CELL_SIZE,a=Math.floor((t-o/2)/this.CELL_SIZE)*this.CELL_SIZE,c=e+n/2,l=t+o/2;for(let h=s;h<=c;h+=this.CELL_SIZE)for(let d=a;d<=l;d+=this.CELL_SIZE){let u=this.getBucketKey(h,d),_=this.buckets.get(u)||[];for(let p of _)i.has(p[1])||(i.add(p[1]),r.push(p[0]))}return r}},hyr=class extends ei{constructor(e,t={}){super(),this.srj=e,this.opts=t,this.MAX_DEPTH=t?.capacityDepth??this.MAX_DEPTH,this.MAX_ITERATIONS=1e5,this.layerCount=e.layerCount??2,this.outlinePolygon=e.outline&&e.outline.length>=3?e.outline:void 0;let n={x:(e.bounds.minX+e.bounds.maxX)/2,y:(e.bounds.minY+e.bounds.maxY)/2},o={width:e.bounds.maxX-e.bounds.minX,height:e.bounds.maxY-e.bounds.minY},r=Math.max(o.width,o.height);this.unfinishedNodes=[{capacityMeshNodeId:this.getNextNodeId(),center:n,width:r,height:r,layer:"top",availableZ:Array.from({length:this.layerCount},(s,a)=>a),_depth:0,_containsTarget:!0,_containsObstacle:!0,_completelyInsideObstacle:!1}],this.finishedNodes=[],this.nodeToXYOverlappingObstaclesMap=new Map,this.obstacleZLayersByObstacle=new WeakMap;let i=kq(this.srj.obstacles,this.layerCount);for(let[s,a]of this.srj.obstacles.entries())this.obstacleZLayersByObstacle.set(a,i[s].__zLayers);this.obstacleTree=new $be("flatbush",this.srj.obstacles),this.targets=this.computeTargets(),this.targetTree=new lyr(this.targets)}srj;opts;getSolverName(){return"CapacityMeshNodeSolver"}unfinishedNodes;finishedNodes;nodeToXYOverlappingObstaclesMap;layerCount;outlinePolygon;MAX_DEPTH=4;targets;targetTree;obstacleTree;obstacleZLayersByObstacle;computeTargets(){let e=[];for(let t of this.srj.connections)for(let n of t.pointsToConnect){let o=E5(n),r=this.obstacleTree.searchArea(n.x,n.y,0.01,0.01).filter((a)=>{let c=this.getObstacleZLayers(a);return!(!c||c.length===0)&&c.some((l)=>o.some((h)=>l===si(h,this.layerCount)))}),i={minX:n.x-0.005,minY:n.y-0.005,maxX:n.x+0.005,maxY:n.y+0.005};r.length>0&&(i={minX:Math.min(...r.map((a)=>a.center.x-a.width/2)),minY:Math.min(...r.map((a)=>a.center.y-a.height/2)),maxX:Math.max(...r.map((a)=>a.center.x+a.width/2)),maxY:Math.max(...r.map((a)=>a.center.y+a.height/2))});let s={...n,connectionName:t.name,availableZ:o.map((a)=>si(a,this.layerCount)),bounds:i};e.push(s)}return e}getNodeBounds(e){let t=e.width/2,n=e.height/2;return{minX:e.center.x-t,maxX:e.center.x+t,minY:e.center.y-n,maxY:e.center.y+n}}getNodeRect(e){return{center:{x:e.center.x,y:e.center.y},width:e.width,height:e.height}}_nextNodeCounter=0;getNextNodeId(){return"cn"+this._nextNodeCounter++}getCapacityFromDepth(e){return(this.MAX_DEPTH-e+1)**2}getTargetIfNodeContainsTarget(e){let t=e.width>4*this.targetTree.CELL_SIZE?this.targets:this.targetTree.getTargetsInArea(e.center.x,e.center.y,e.width,e.height);for(let n of t)if(n.bounds.minX<=e.center.x+e.width/2&&n.bounds.maxX>=e.center.x-e.width/2&&n.bounds.minY<=e.center.y+e.height/2&&n.bounds.maxY>=e.center.y-e.height/2&&n.availableZ.some((o)=>e.availableZ.includes(o)))return n;return null}getXYOverlappingObstacles(e){let t=this.nodeToXYOverlappingObstaclesMap.get(e.capacityMeshNodeId);if(t)return t;let n=[],o=this.getNodeBounds(e),{minX:r,maxX:i,minY:s,maxY:a}=o,c=e._parent?this.getXYOverlappingObstacles(e._parent):this.srj.obstacles;for(let l of c){let h=l.center.x-l.width/2,d=l.center.x+l.width/2,u=l.center.y-l.height/2,_=l.center.y+l.height/2;i>=h&&r<=d&&a>=u&&s<=_?n.push(l):(r>=h&&i<=d&&s>=u&&a<=_||h>=r&&d<=i&&u>=s&&_<=a)&&n.push(l)}return this.nodeToXYOverlappingObstaclesMap.set(e.capacityMeshNodeId,n),n}getXYZOverlappingObstacles(e){let t=this.getXYOverlappingObstacles(e),n=[];for(let o of t)e.availableZ.some((r)=>this.getObstacleZLayers(o).includes(r))&&n.push(o);return n}doesNodeOverlapObstacle(e){if(this.getXYZOverlappingObstacles(e).length>0)return!0;let t=this.getNodeBounds(e);if(this.outlinePolygon){let n=this.getNodeRect(e);if(!bUt(n,this.outlinePolygon))return!0}return t.minX<this.srj.bounds.minX||t.maxX>this.srj.bounds.maxX||t.minY<this.srj.bounds.minY||t.maxY>this.srj.bounds.maxY}isNodeCompletelyInsideObstacle(e){let t=this.getXYZOverlappingObstacles(e),n=this.getNodeBounds(e);if(this.outlinePolygon){let o=this.getNodeRect(e);if(!nCe(o,this.outlinePolygon))return!0}for(let o of t){let r=o.center.x-o.width/2,i=o.center.x+o.width/2,s=o.center.y-o.height/2,a=o.center.y+o.height/2;if(n.minX>=r&&n.maxX<=i&&n.minY>=s&&n.maxY<=a)return!0}return!1}getChildNodes(e){if(e._depth===this.MAX_DEPTH)return[];let t=[],n={width:e.width/2,height:e.height/2},o=[{x:e.center.x-n.width/2,y:e.center.y-n.height/2},{x:e.center.x+n.width/2,y:e.center.y-n.height/2},{x:e.center.x-n.width/2,y:e.center.y+n.height/2},{x:e.center.x+n.width/2,y:e.center.y+n.height/2}];for(let r of o){let i={capacityMeshNodeId:this.getNextNodeId(),center:r,width:n.width,height:n.height,layer:e.layer,availableZ:e.availableZ,_depth:(e._depth??0)+1,_parent:e};i._containsObstacle=this.doesNodeOverlapObstacle(i);let s=this.getTargetIfNodeContainsTarget(i);s&&(i._targetConnectionName=s.connectionName,i.availableZ=s.availableZ,i._containsTarget=!0),i._containsObstacle&&(i._completelyInsideObstacle=this.isNodeCompletelyInsideObstacle(i)),i._completelyInsideObstacle&&!i._containsTarget||t.push(i)}return t}shouldNodeBeXYSubdivided(e){return!(e._depth>=this.MAX_DEPTH)&&(!!e._containsTarget||!(!e._containsObstacle||e._completelyInsideObstacle))}_step(){let e=this.unfinishedNodes.pop();if(!e)return void(this.solved=!0);let t=this.getChildNodes(e),n=[],o=[];for(let r of t){let i=this.shouldNodeBeXYSubdivided(r);i?o.push(r):i||r._containsObstacle?!i&&r._containsTarget&&n.push(r):n.push(r)}this.unfinishedNodes.push(...o),this.finishedNodes.push(...n)}visualize(){let e={lines:[],points:[],rects:[],circles:[],coordinateSystem:"cartesian",title:"Capacity Mesh Visualization"};if(this.outlinePolygon&&this.outlinePolygon.length>=2){let n=this.outlinePolygon.map((o)=>({x:o.x,y:o.y}));n.push({...n[0]}),e.lines.push({points:n,strokeColor:"rgba(0, 136, 255, 0.95)",label:"outline"});for(let o of this.outlinePolygon)e.points.push({x:o.x,y:o.y,color:"rgba(0, 136, 255, 0.95)"})}for(let n of this.srj.obstacles){if(n.isCopperPour)continue;let o=this.getObstacleZLayers(n);e.rects.push({center:n.center,width:n.width,height:n.height,fill:o.length===1&&o.includes(1)?"rgba(0,0,255,0.3)":"rgba(255,0,0,0.3)",stroke:"red",label:["obstacle",`z: ${o.join(",")}`].join(`
`)})}let t=[...this.finishedNodes,...this.unfinishedNodes];for(let n of t){let o=Math.min(...n.availableZ),r=this.unfinishedNodes.length>0&&n===this.unfinishedNodes[this.unfinishedNodes.length-1];e.rects.push({center:{x:n.center.x+o*n.width*0.05,y:n.center.y-o*n.width*0.05},width:Math.max(n.width-2,0.8*n.width),height:Math.max(n.height-2,0.8*n.height),fill:n._containsObstacle?"rgba(255,0,0,0.1)":{"0,1":"rgba(0,0,0,0.1)",0:"rgba(0,200,200, 0.1)",1:"rgba(0,0,200, 0.1)"}[n.availableZ.join(",")]??"rgba(0,200,200,0.1)",stroke:r?"rgba(255,165,0,0.5)":void 0,label:[n.capacityMeshNodeId,`availableZ: ${n.availableZ.join(",")}`,`target? ${n._containsTarget??!1}`,`obs? ${n._containsObstacle??!1}`,`${n.width.toFixed(2)}x${n.height.toFixed(2)}`,`capacity: ${tP(n).toFixed(2)}`].join(`
`)})}return e.rects.sort((n,o)=>n.center.y-o.center.y),this.srj.connections.forEach((n,o)=>{let r=LLt[o%LLt.length];for(let i of n.pointsToConnect){let s=E5(i);e.points.push({x:i.x,y:i.y,label:`conn-${o} (${s.join(",")})`,color:r})}}),e}getObstacleZLayers(e){return this.obstacleZLayersByObstacle.get(e)??[]}},dyr=class extends hyr{constructor(e,t={}){super(e,t),this.srj=e,this.opts=t,this.VIA_DIAMETER=rm(e).padDiameter}srj;opts;getSolverName(){return"CapacityMeshNodeSolver2_NodeUnderObstacle"}VIA_DIAMETER=0.6;OBSTACLE_MARGIN=0.1;OVERLAP_THRESHOLD_FOR_SINGLE_LAYER_NODES=0.2;isNodeCompletelyOutsideBounds(e){if(this.outlinePolygon){let t=this.getNodeRect(e);if(!nCe(t,this.outlinePolygon))return!0}return e.center.x+e.width/2<this.srj.bounds.minX||e.center.x-e.width/2>this.srj.bounds.maxX||e.center.y+e.height/2<this.srj.bounds.minY||e.center.y-e.height/2>this.srj.bounds.maxY}isNodePartiallyOutsideBounds(e){if(this.outlinePolygon){let t=this.getNodeRect(e);return!!nCe(t,this.outlinePolygon)&&!bUt(t,this.outlinePolygon)}return e.center.x-e.width/2<this.srj.bounds.minX||e.center.x+e.width/2>this.srj.bounds.maxX||e.center.y-e.height/2<this.srj.bounds.minY||e.center.y+e.height/2>this.srj.bounds.maxY}getObstacleCoveragePercentage(e){let t=this.getXYZOverlappingObstacles(e);if(t.length===0)return 0;let n=e.center.x-e.width/2,o=e.center.x+e.width/2,r=e.center.y-e.height/2,i=e.center.y+e.height/2,s=e.width*e.height,a=0;for(let c of t){let l=Math.max(n,c.center.x-c.width/2),h=Math.min(o,c.center.x+c.width/2),d=Math.max(r,c.center.y-c.height/2),u=Math.min(i,c.center.y+c.height/2);if(l<h&&d<u)a+=(h-l)*(u-d)}return a/s}shouldFilterSingleLayerNodeForObstacle(e){if(e.availableZ.length!==1)return!1;if(!e._containsObstacle)return!1;return this.getObstacleCoveragePercentage(e)>this.OVERLAP_THRESHOLD_FOR_SINGLE_LAYER_NODES}shouldFilterNodeForObstacle(e){return!!e._containsObstacle&&(e.availableZ.length!==1||this.shouldFilterSingleLayerNodeForObstacle(e))}createChildNodeAtPosition(e,t){let n={capacityMeshNodeId:this.getNextNodeId(),center:t.center,width:t.width,height:t.height,layer:e.layer,availableZ:t.availableZ,_depth:t._depth??(e._depth??0)+1,_parent:e},o=this.getXYZOverlappingObstacles(n);n._containsObstacle=o.length>0||this.isNodePartiallyOutsideBounds(n);let r=this.getTargetIfNodeContainsTarget(n);return r&&(n._targetConnectionName=r.connectionName,n._containsTarget=!0),n._containsObstacle&&(n._completelyInsideObstacle=this.isNodeCompletelyInsideObstacle(n)),n}getZSubdivisionChildNodes(e){if(e.availableZ.length===1)return[];let t=[],n=e.availableZ.map((o)=>[o]);for(let o of n){let r=this.createChildNodeAtPosition(e,{center:{...e.center},width:e.width,height:e.height,availableZ:o,_depth:e._depth});this.isNodeCompletelyOutsideBounds(r)||t.push(r)}return t}getChildNodes(e){if(e._depth>=this.MAX_DEPTH)return[];let t=[],n={width:e.width/2,height:e.height/2},o=[{x:e.center.x-n.width/2,y:e.center.y-n.height/2},{x:e.center.x+n.width/2,y:e.center.y-n.height/2},{x:e.center.x-n.width/2,y:e.center.y+n.height/2},{x:e.center.x+n.width/2,y:e.center.y+n.height/2}];for(let r of o){let i=this.createChildNodeAtPosition(e,{center:r,width:n.width,height:n.height,availableZ:e.availableZ});this.isNodeCompletelyOutsideBounds(i)||t.push(i)}return t}shouldNodeBeXYSubdivided(e){return!(e._depth>=this.MAX_DEPTH)&&(!!e._containsTarget||(e.availableZ.length===1&&e._depth<=this.MAX_DEPTH||!(!e._containsObstacle||e._completelyInsideObstacle)))}_step(){let e=this.unfinishedNodes.pop();if(!e)return void(this.solved=!0);let t=this.getChildNodes(e),n=[],o=[];for(let r of t){let i=this.shouldNodeBeXYSubdivided(r),s=r.availableZ.length>1&&!i&&(r._containsObstacle||r.width<this.VIA_DIAMETER+this.OBSTACLE_MARGIN);if(i)o.push(r);else if(i||this.shouldFilterNodeForObstacle(r)||s)if(!i&&r._containsTarget)if(s){let a=this.getZSubdivisionChildNodes(r);n.push(...a.filter((c)=>c._containsTarget||!this.shouldFilterNodeForObstacle(c)))}else n.push(r);else s&&n.push(...this.getZSubdivisionChildNodes(r).filter((a)=>!this.shouldFilterNodeForObstacle(a)));else n.push(r)}this.unfinishedNodes.push(...o),this.finishedNodes.push(...n)}},uyr=class extends ei{getSolverName(){return"CapacitySegmentToPointSolver"}unsolvedSegments;solvedSegments;nodeMap;colorMap;constructor({segments:e,colorMap:t,nodes:n}){super(),this.MAX_ITERATIONS=1e5,this.unsolvedSegments=e,this.solvedSegments=[],this.colorMap=t??{},this.nodeMap=Object.fromEntries(n.map((o)=>[o.capacityMeshNodeId,o]))}_step(){let e=!1,t=[...this.unsolvedSegments];for(let n of t){let o=n.connectionNames.length;if((!("assignedPoints"in n)||n.assignedPoints?.length!==o)&&o===1){let r={x:(n.start.x+n.end.x)/2,y:(n.start.y+n.end.y)/2,z:n.availableZ[0]};n.assignedPoints=[{connectionName:n.connectionNames[0],rootConnectionName:n.rootConnectionNames?.[0],point:r}],this.unsolvedSegments.splice(this.unsolvedSegments.indexOf(n),1),this.solvedSegments.push(n),e=!0}}if(!e&&t.length>0){let n=t[0];for(let c of t)c.connectionNames.length<n.connectionNames.length&&(n=c);let o=[...n.connectionNames].sort(),r=n.end.x-n.start.x,i=n.end.y-n.start.y,s=o.length,a=[];for(let c=1;c<=s;c++){let l=c/(s+1);a.push({x:n.start.x+r*l,y:n.start.y+i*l,z:n.availableZ[0]})}n.assignedPoints=o.map((c,l)=>({connectionName:c,rootConnectionName:n.rootConnectionNames?.[n.connectionNames.indexOf(c)],point:a[l]})),this.unsolvedSegments.splice(this.unsolvedSegments.indexOf(n),1),this.solvedSegments.push(n),e=!0}this.unsolvedSegments.length===0&&(this.solved=!0)}getNodesWithPortPoints(){if(!this.solved)throw Error("CapacitySegmentToPointSolver not solved, can't give port points yet");let e=new Map;for(let t of this.solvedSegments){let n=t.capacityMeshNodeId,o=this.nodeMap[n];e.has(n)||e.set(n,{capacityMeshNodeId:n,portPoints:[],center:o.center,width:o.width,height:o.height}),e.get(n).portPoints.push(...t.assignedPoints.map((r)=>({...r.point,connectionName:r.connectionName})))}return Array.from(e.values())}visualize(){let e={points:[],lines:this.solvedSegments.map((o)=>({points:[o.start,o.end],step:4})),rects:[],circles:[],coordinateSystem:"cartesian",title:"Capacity Segment to Point Solver"};for(let o=0;o<this.solvedSegments.length;o++){let r=this.solvedSegments[o];for(let i=0;i<r.assignedPoints.length;i++){let s=r.assignedPoints[i],a={x:s.point.x,y:s.point.y},c={x:s.point.x+0.05*s.point.z,y:s.point.y+0.05*s.point.z};s.point.z!==0&&e.lines.push({points:[a,c],strokeColor:"rgba(0, 0, 0, 0.25)",strokeDash:"5 5",step:4}),e.points.push({x:c.x,y:c.y,label:[`${r.capacityMeshNodeId}-${s.connectionName}`,`z: ${r.availableZ.join(",")}`,`nodePortSegmentId: ${r.nodePortSegmentId}`].join(`
`),color:this.colorMap[s.connectionName],step:4})}}let t=[],n={};for(let o of this.solvedSegments){let r=o.capacityMeshNodeId;n[r]||(n[r]={});for(let i of o.assignedPoints)n[r][i.connectionName]||(n[r][i.connectionName]=[]),n[r][i.connectionName].push({x:i.point.x,y:i.point.y})}for(let o in n)for(let r in n[o]){let i=n[o][r];i.length>1&&t.push({points:i,step:4,strokeDash:"5 5",strokeColor:this.colorMap[r]||"#000"})}return e.lines.push(...t),e}},qA=(e,t={})=>{let n=Math.min(...e.availableZ);return{center:!t.rectMargin||t.zOffset?{x:e.center.x+n*e.width*(t.zOffset??0.05),y:e.center.y-n*e.width*(t.zOffset??0.05)}:e.center,width:t.rectMargin?e.width-2*t.rectMargin:Math.max(e.width-0.5,0.8*e.width),height:t.rectMargin?e.height-2*t.rectMargin:Math.max(e.height-0.5,0.8*e.height),fill:e._containsObstacle?"rgba(255,0,0,0.1)":{"0,1":"rgba(0,0,0,0.1)",0:"rgba(0,200,200, 0.1)",1:"rgba(0,0,200, 0.1)"}[e.availableZ.join(",")]??"rgba(0,200,200,0.1)",layer:`z${e.availableZ.join(",")}`,label:[e.capacityMeshNodeId,`availableZ: ${e.availableZ.join(",")}`,e._containsTarget?"containsTarget":"",e._containsObstacle?"containsObstacle":""].filter(Boolean).join(`
`)}},pyr=class extends ei{getSolverName(){return"CapacityPathingSolver"}connectionsWithNodes;usedNodeCapacityMap;simpleRouteJson;nodes;edges;GREEDY_MULTIPLIER=1.1;MAX_CANDIDATES_IN_MEMORY=1e5;nodeMap;nodeEdgeMap;connectionNameToGoalNodeIds;colorMap;maxDepthOfNodes;activeCandidateStraightLineDistance;debug_lastNodeCostMap;hyperParameters;constructor({simpleRouteJson:e,nodes:t,edges:n,colorMap:o,MAX_ITERATIONS:r=1e6,hyperParameters:i={}}){super(),this.MAX_ITERATIONS=r,this.simpleRouteJson=e,this.nodes=t,this.edges=n,this.colorMap=o??{};let{connectionsWithNodes:s,connectionNameToGoalNodeIds:a}=this.getConnectionsWithNodes();this.connectionsWithNodes=s,this.connectionNameToGoalNodeIds=a,this.hyperParameters=i,this.usedNodeCapacityMap=new Map(this.nodes.map((c)=>[c.capacityMeshNodeId,0])),this.nodeMap=new Map(this.nodes.map((c)=>[c.capacityMeshNodeId,c])),this.nodeEdgeMap=eq(this.edges),this.maxDepthOfNodes=Math.max(...this.nodes.map((c)=>c._depth??0)),this.debug_lastNodeCostMap=new Map}getTotalCapacity(e){let t=e._depth??0;return(this.maxDepthOfNodes-t+1)**2}getConnectionsWithNodes(){let e=[],t=this.nodes.filter((o)=>o._containsTarget),n=new Map;for(let o of this.simpleRouteJson.connections){let r=[];for(let i of o.pointsToConnect){let s=this.nodes[0],a=Number.MAX_VALUE;for(let c of t){let l=Math.sqrt((c.center.x-i.x)**2+(c.center.y-i.y)**2);l<a&&(a=l,s=c)}r.push(s)}if(r.length<2)throw Error(`Not enough nodes for connection "${o.name}", only ${r.length} found`);n.set(o.name,r.map((i)=>i.capacityMeshNodeId)),e.push({connection:o,nodes:r,pathFound:!1,straightLineDistance:kn(r[0].center,r[r.length-1].center)})}return e.sort((o,r)=>o.straightLineDistance-r.straightLineDistance),{connectionsWithNodes:e,connectionNameToGoalNodeIds:n}}currentConnectionIndex=0;candidates;visitedNodes;computeG(e,t,n){return e.g+this.getDistanceBetweenNodes(e.node,t)}computeH(e,t,n){return this.getDistanceBetweenNodes(t,n)}getBacktrackedPath(e){let t=[],n=e;for(;n;)t.push(n.node),n=n.prevCandidate;return t}getNeighboringNodes(e){return this.nodeEdgeMap.get(e.capacityMeshNodeId).flatMap((t)=>t.nodeIds.filter((n)=>n!==e.capacityMeshNodeId)).map((t)=>this.nodeMap.get(t))}getCapacityPaths(){let e=[];for(let t of this.connectionsWithNodes){let n=t.path;n&&e.push({capacityPathId:t.connection.name,connectionName:t.connection.name,rootConnectionName:t.connection.__rootConnectionNames?.[0],nodeIds:n.map((o)=>o.capacityMeshNodeId)})}return e}doesNodeHaveCapacityForTrace(e,t){let n=this.usedNodeCapacityMap.get(e.capacityMeshNodeId)??0,o=this.getTotalCapacity(e);if(e.availableZ.length===1&&!e._containsTarget&&n>0)return!1;let r=0;return e.availableZ.length>1&&t.availableZ.length===1&&(r+=0.5),n+r<o}canTravelThroughObstacle(e,t){return this.connectionNameToGoalNodeIds.get(t)?.includes(e.capacityMeshNodeId)??!1}getDistanceBetweenNodes(e,t){return Math.sqrt((e.center.x-t.center.x)**2+(e.center.y-t.center.y)**2)}reduceCapacityAlongPath(e){for(let t of e.path??[])this.usedNodeCapacityMap.set(t.capacityMeshNodeId,this.usedNodeCapacityMap.get(t.capacityMeshNodeId)+1)}isConnectedToEndGoal(e,t){return this.nodeEdgeMap.get(e.capacityMeshNodeId).some((n)=>n.nodeIds.includes(t.capacityMeshNodeId))}_step(){let e=this.connectionsWithNodes[this.currentConnectionIndex];if(!e)return void(this.solved=!0);let[t,n]=e.nodes;this.candidates||(this.candidates=[{prevCandidate:null,node:t,f:0,g:0,h:0}],this.debug_lastNodeCostMap=new Map,this.visitedNodes=new Set([t.capacityMeshNodeId]),this.activeCandidateStraightLineDistance=kn(t.center,n.center)),this.candidates.sort((i,s)=>i.f-s.f);let o=this.candidates.shift();if(this.candidates.length>this.MAX_CANDIDATES_IN_MEMORY&&this.candidates.splice(this.MAX_CANDIDATES_IN_MEMORY,this.candidates.length-this.MAX_CANDIDATES_IN_MEMORY),!o)return console.error(`Ran out of candidates on connection ${e.connection.name}`),this.currentConnectionIndex++,this.candidates=null,this.visitedNodes=null,void(this.failed=!0);if(this.isConnectedToEndGoal(o.node,n))return e.path=this.getBacktrackedPath({prevCandidate:o,node:n,f:0,g:0,h:0}),this.reduceCapacityAlongPath(e),this.currentConnectionIndex++,this.candidates=null,void(this.visitedNodes=null);let r=this.getNeighboringNodes(o.node);for(let i of r){if(this.visitedNodes?.has(i.capacityMeshNodeId))continue;if(!this.doesNodeHaveCapacityForTrace(i,o.node))continue;let s=this.connectionsWithNodes[this.currentConnectionIndex].connection.name;if(i._containsObstacle&&!this.canTravelThroughObstacle(i,s))continue;let a=this.computeG(o,i,n),c=this.computeH(o,i,n),l=a+c*this.GREEDY_MULTIPLIER;this.debug_lastNodeCostMap.set(i.capacityMeshNodeId,{f:l,g:a,h:c});let h={prevCandidate:o,node:i,f:l,g:a,h:c};this.candidates.push(h)}this.visitedNodes.add(o.node.capacityMeshNodeId)}visualize(){let e={lines:[],points:[],rects:[],circles:[]};if(this.connectionsWithNodes)for(let n=0;n<this.connectionsWithNodes.length;n++){let o=this.connectionsWithNodes[n];if(o.path&&o.path.length>0){let r=o.path.map(({center:{x:i,y:s},width:a,availableZ:c})=>({x:i+0.005*a*(n%10+n%19),y:s+0.005*a*(n%10+n%19),availableZ:c}));e.lines.push({points:r,strokeColor:this.colorMap[o.connection.name]});for(let i=0;i<r.length;i++){let s=r[i];e.points.push({x:s.x,y:s.y,label:[`conn: ${o.connection.name}`,`node: ${o.path[i].capacityMeshNodeId}`,`z: ${s.availableZ.join(",")}`].join(`
`)})}}}for(let n of this.nodes){let o=this.usedNodeCapacityMap.get(n.capacityMeshNodeId)??0,r=this.getTotalCapacity(n),i=this.debug_lastNodeCostMap.get(n.capacityMeshNodeId);e.rects.push({...qA(n,{rectMargin:0.025,zOffset:0.01}),label:[`${n.capacityMeshNodeId}`,`${o}/${r}`,`${n.width.toFixed(2)}x${n.height.toFixed(2)}`,`g: ${i?.g!==void 0?i.g.toFixed(2):"?"}`,`h: ${i?.h!==void 0?i.h.toFixed(2):"?"}`,`f: ${i?.f!==void 0?i.f.toFixed(2):"?"}`,`z: ${n.availableZ.join(", ")}`].join(`
`),stroke:o>r+0.5?"red":void 0})}if(this.connectionsWithNodes){for(let n of this.connectionsWithNodes)if(n.connection?.pointsToConnect)for(let o of n.connection.pointsToConnect)e.points.push({x:o.x,y:o.y,label:[`pointsToConnect ${n.connection.name}`].join(`
`)})}let t=this.connectionsWithNodes[this.currentConnectionIndex];if(!this.candidates&&this.currentConnectionIndex>0&&!this.connectionsWithNodes[this.currentConnectionIndex-1].path&&(t=this.connectionsWithNodes[this.currentConnectionIndex-1]),t){let[n,o]=t.connection.pointsToConnect;e.lines.push({points:[{x:n.x,y:n.y},{x:o.x,y:o.y}],strokeColor:"red",strokeDash:"10 5"})}if(this.candidates){let n=this.candidates.slice(0,5),o=this.connectionsWithNodes[this.currentConnectionIndex].connection.name;n.forEach((r,i)=>{let s=0.5*(1-i/5),a=this.getBacktrackedPath(r);e.lines.push({points:a.map(({center:{x:c,y:l}})=>({x:c,y:l})),strokeColor:zi(this.colorMap[o]??"red",1-s)})})}return e}},myr=class extends pyr{getSolverName(){return"CapacityPathingSolver5"}NEGATIVE_CAPACITY_PENALTY_FACTOR=1;REDUCED_CAPACITY_PENALTY_FACTOR=1;constructor(...e){super(...e),this.GREEDY_MULTIPLIER=2.5}get maxCapacityFactor(){return this.hyperParameters.MAX_CAPACITY_FACTOR??1}getTotalCapacity(e){return tP(e,this.maxCapacityFactor)}getNodeCapacityPenalty(e){let t=e.width+e.height,o=this.getTotalCapacity(e)-(this.usedNodeCapacityMap.get(e.capacityMeshNodeId)??0);if(o>2)return 0.05;return(t-0.05)*Math.max(1,(2-o)/(t-0.05))+0.05}getDistanceBetweenNodes(e,t){let n=e.center.x-t.center.x,o=e.center.y-t.center.y;return Math.sqrt(n**2+o**2)}computeG(e,t,n){return e.g+this.getDistanceBetweenNodes(e.node,t)+this.getNodeCapacityPenalty(t)}computeH(e,t,n){return this.getDistanceBetweenNodes(t,n)+this.getNodeCapacityPenalty(t)}},Zrn=class extends myr{getSolverName(){return"CapacityPathingGreedySolver"}doesNodeHaveCapacityForTrace(e,t){return!0}getNodeCapacityPenalty(e){let t=this.getTotalCapacity(e)-(this.usedNodeCapacityMap.get(e.capacityMeshNodeId)??0)-1;if(t>0)return 0;let n=1;return e.availableZ.length===1&&(n=10),(0.05+2*Math.abs(t))*n}};function Yzt(e,t,n){let o=t.x-e.x,r=t.y-e.y;if(Math.abs(o)<0.000000001&&Math.abs(r)<0.000000001)return e;let i=n.width/2,s=n.height/2,a=n.center.x-i,c=n.center.x+i,l=n.center.y-s,h=n.center.y+s,d=0,u=1/0;if(Math.abs(o)>0.000000001){let _=(a-e.x)/o,p=(c-e.x)/o;d=Math.max(d,Math.min(_,p)),u=Math.min(u,Math.max(_,p))}else if(e.x<a||e.x>c)return e;if(Math.abs(r)>0.000000001){let _=(l-e.y)/r,p=(h-e.y)/r;d=Math.max(d,Math.min(_,p)),u=Math.min(u,Math.max(_,p))}else if(e.y<l||e.y>h)return e;if(u<d||d===1/0||d<-1e9)return e;return{x:e.x+o*d,y:e.y+r*d}}function _yr(e,t){let n=e.center,o=t.center,r=Yzt(n,o,e),i=Yzt(o,n,t),s=o.x-n.x,a=o.y-n.y,c=Math.sqrt(s*s+a*a),l=r,h=i;if(c>0.000000001){let d={x:s/c,y:a/c},u=0.3*e.width,_=0.3*t.width;u+_<Math.sqrt((i.x-r.x)**2+(i.y-r.y)**2)?(l={x:r.x+d.x*u,y:r.y+d.y*u},h={x:i.x-d.x*_,y:i.y-d.y*_}):(l=r,h=i)}return{lineStart:l,lineEnd:h}}var LCe=(e)=>{let{usedCapacity:t,totalCapacity:n,layerCount:o}=e;if(t<n)return 0;if(n<1&&t<=1)return 0;if(o===1&&t>1)return 1-0.01**t;let r=t/n-1;return 1-Math.exp(-2*r)},jKe=(e,t,n)=>{if(n._containsTarget)return 0;if(e<=t)return 0;let o=1-LCe({usedCapacity:e,totalCapacity:t,layerCount:n.availableZ.length});return o<=0?-1e9:Math.log(o)},dce=({totalNodeCapacityMap:e,usedNodeCapacityMap:t,nodeMap:n,sectionNodeIds:o})=>{let r=0,i=o??new Set(t.keys());for(let s of i){if(!e.has(s))continue;let a=n.get(s);if(!a)continue;let c=e.get(s),l=t.get(s)??0;r+=jKe(l,c,a)}return r};function BZe({sectionNodes:e,sectionEdges:t,sectionConnectionTerminals:n,completedPaths:o,nodeMap:r,colorMap:i,centerNodeId:s,title:a,nodeOpacity:c=0.1,usedNodeCapacityMap:l,totalCapacityMap:h}){let d={points:[],lines:[],rects:[],circles:[],title:a},u=new Set(e.map((_)=>_.capacityMeshNodeId));for(let _ of e){let p=`rgba(128, 128, 128, ${c})`,m=`rgba(128, 128, 128, ${c})`,A=_.availableZ??[],g=A.includes(0),f=A.includes(1);g&&f?(p=`rgba(128, 0, 128, ${c})`,m=`rgba(128, 0, 128, ${c})`):g?(p=`rgba(0, 0, 255, ${c})`,m=`rgba(0, 0, 255, ${c})`):f&&(p=`rgba(255, 0, 0, ${c})`,m=`rgba(255, 0, 0, ${c})`),s&&_.capacityMeshNodeId===s&&(p=`rgba(0, 255, 0, ${c})`,m=`rgba(0, 128, 0, ${c})`),d.rects.push({...qA(_),fill:p,stroke:m,label:`${_.capacityMeshNodeId}
(Section Node)
Z: ${A.join(",")}`});let y=d.rects.length-1;if(l&&h){let x=l.get(_.capacityMeshNodeId)??0,C=h.get(_.capacityMeshNodeId)??0,b=C>0?(x/C*100).toFixed(1):"N/A",I=LCe({usedCapacity:x,totalCapacity:C,layerCount:_.availableZ.length});d.rects[y].label+=`
${x.toFixed(1)} / ${C.toFixed(1)}
${b}% (Pf: ${(100*I).toFixed(1)}%)`,I>0.2&&(d.rects[y].stroke=zi("red",0.7*(0.8+c)))}}for(let _ of t){let[p,m]=_.nodeIds,A=r.get(p),g=r.get(m);if(A&&g){let{lineStart:f,lineEnd:y}=_yr(A,g);d.lines.push({points:[f,y],strokeColor:`rgba(0, 0, 0, ${0.2*Math.min(1,c/0.1)})`})}}return n.forEach((_,p)=>{let m=r.get(_.startNodeId),A=r.get(_.endNodeId),g=i[_.connectionName]??"black",f=m&&u.has(m.capacityMeshNodeId),y=A&&u.has(A.capacityMeshNodeId),x=(p+p/50)%5,C=0,b=0,I=0,v=0;if(f&&m){let P=0.02*Math.min(m.width,m.height);C=P*x,b=P*x,d.points.push({x:m.center.x+C,y:m.center.y+b,color:g,label:`Start: ${_.connectionName}
(${_.startNodeId})`}),d.lines.push({points:[{x:m.center.x,y:m.center.y},{x:m.center.x+C,y:m.center.y+b}],strokeColor:"gray",strokeDash:"2 2"})}if(y&&A){let P=0.02*Math.min(A.width,A.height);I=P*x,v=P*x,d.points.push({x:A.center.x+I,y:A.center.y+v,color:g,label:`End: ${_.connectionName}
(${_.endNodeId})`}),d.lines.push({points:[{x:A.center.x,y:A.center.y},{x:A.center.x+I,y:A.center.y+v}],strokeColor:"gray",strokeDash:"2 2"})}f&&y&&m&&A&&d.lines.push({points:[{x:m.center.x+C,y:m.center.y+b},{x:A.center.x+I,y:A.center.y+v}],strokeColor:g,strokeDash:"5 5"})}),o&&o.forEach((_,p)=>{if(_.path&&_.path.length>0){let m=i[_.connectionName]??"gray",A={x:(p+p/50)%5*0.03,y:(p+p/50)%5*0.03};d.lines.push({points:_.path.map(({center:{x:g,y:f}})=>({x:g+A.x,y:f+A.y})),strokeColor:zi(m,0.2)})}}),d}var gyr=class extends ei{getSolverName(){return"CapacityPathingSingleSectionSolver"}GREEDY_MULTIPLIER=1.5;sectionNodes;sectionEdges;sectionConnectionTerminals;nodeMap;nodeEdgeMap;colorMap;usedNodeCapacityMap;totalNodeCapacityMap;centerNodeId;currentSectionScore=0;MAX_CANDIDATES_IN_MEMORY=1e4;currentConnectionIndex=0;candidates=null;visitedNodes=null;queuedNodes=null;activeCandidateStraightLineDistance;debug_lastNodeCostMap=new Map;maxCapacityFactor=1;constructor(e){super(),this.MAX_ITERATIONS=1e4,this.centerNodeId=e.centerNodeId,this.sectionNodes=e.sectionNodes,this.sectionEdges=e.sectionEdges,this.sectionConnectionTerminals=e.sectionConnectionTerminals.map((n)=>({...n,path:void 0})),this.nodeMap=e.nodeMap??new Map(this.sectionNodes.map((n)=>[n.capacityMeshNodeId,n])),this.nodeEdgeMap=e.nodeEdgeMap??eq(this.sectionEdges),this.colorMap=e.colorMap??{},this.usedNodeCapacityMap=new Map(this.sectionNodes.map((n)=>[n.capacityMeshNodeId,0])),this.totalNodeCapacityMap=new Map(this.sectionNodes.map((n)=>[n.capacityMeshNodeId,this.getTotalCapacity(n)]));let t=new Set(this.sectionNodes.map((n)=>n.capacityMeshNodeId));this.currentSectionScore=dce({totalNodeCapacityMap:this.totalNodeCapacityMap,usedNodeCapacityMap:this.usedNodeCapacityMap,nodeMap:this.nodeMap,sectionNodeIds:t}),e.hyperParameters?.SHUFFLE_SEED&&(this.sectionConnectionTerminals=e6(this.sectionConnectionTerminals,e.hyperParameters?.SHUFFLE_SEED))}getTotalCapacity(e){return tP(e,this.maxCapacityFactor)}getNodeCapacityPenalty(e){if(!this.nodeMap.has(e.capacityMeshNodeId))return 1/0;let t=this.getTotalCapacity(e)-(this.usedNodeCapacityMap.get(e.capacityMeshNodeId)??0)-1;if(t>0)return 0;let n=1;return e.availableZ.length===1&&(n=10),(0.05+t**2*4)*n}getDistanceBetweenNodes(e,t){let n=e.center.x-t.center.x,o=e.center.y-t.center.y;return Math.sqrt(n**2+o**2)}computeG(e,t,n){return e.g+this.getDistanceBetweenNodes(e.node,t)+this.getNodeCapacityPenalty(t)}computeH(e,t,n){return this.getDistanceBetweenNodes(t,n)+this.getNodeCapacityPenalty(t)}getBacktrackedPath(e){let t=[],n=e;for(;n;){if(t.push(n.node),!this.nodeMap.has(n.node.capacityMeshNodeId)){console.warn("Backtracked path went outside section bounds");break}n=n.prevCandidate}return t.reverse()}getNeighboringNodes(e){return this.nodeMap.has(e.capacityMeshNodeId)?this.nodeEdgeMap.get(e.capacityMeshNodeId)?.flatMap((t)=>t.nodeIds.filter((n)=>n!==e.capacityMeshNodeId)).map((t)=>this.nodeMap.get(t)).filter(Boolean)??[]:[]}isConnectedToEndGoal(e,t){return!(!this.nodeMap.has(e.capacityMeshNodeId)||!this.nodeMap.has(t.capacityMeshNodeId))&&(this.nodeEdgeMap.get(e.capacityMeshNodeId)??[]).some((n)=>n.nodeIds.includes(t.capacityMeshNodeId))}doesNodeHaveCapacityForTrace(e,t){return!0}reduceCapacityAlongPath(e){for(let t of e)if(this.usedNodeCapacityMap.has(t.capacityMeshNodeId)){let n=t.capacityMeshNodeId,o=this.nodeMap.get(n);if(!o){console.warn(`Node ${n} from path not found in section's nodeMap during score update.`);continue}let r=this.totalNodeCapacityMap.get(n),i=this.usedNodeCapacityMap.get(n)??0,s=jKe(i,r,o);this.currentSectionScore-=s;let a=i+1;this.usedNodeCapacityMap.set(n,a);let c=jKe(a,r,o);this.currentSectionScore+=c}}getSolvedSectionScore(){return this.currentSectionScore}_step(){let e=this.sectionConnectionTerminals[this.currentConnectionIndex];if(!e)return void(this.solved=!0);let t=this.nodeMap.get(e.startNodeId),n=this.nodeMap.get(e.endNodeId);if(!t||!n)return console.error(`Start or end node not found in section for connection ${e.connectionName}`),this.currentConnectionIndex++,this.candidates=null,void(this.visitedNodes=null);this.candidates||this._setupAStar(t,n);let o=this.candidates;if(o.length===0)return void this._handleCandidatesExhausted(e);o.sort((s,a)=>s.f-a.f);let r=o.shift();if(o.length>this.MAX_CANDIDATES_IN_MEMORY&&o.splice(this.MAX_CANDIDATES_IN_MEMORY,o.length-this.MAX_CANDIDATES_IN_MEMORY),this.visitedNodes.add(r.node.capacityMeshNodeId),r.node.capacityMeshNodeId===n.capacityMeshNodeId)return void this._handleGoalReached(r,e,n);let i=this.getNeighboringNodes(r.node);for(let s of i){if(this.queuedNodes?.has(s.capacityMeshNodeId))continue;if(!this.doesNodeHaveCapacityForTrace(s,r.node))continue;if(s._containsObstacle){let d=s.capacityMeshNodeId===e.startNodeId,u=s.capacityMeshNodeId===e.endNodeId;if(!d&&!u)continue}let a=this.computeG(r,s,n),c=this.computeH(r,s,n),l=a+c*this.GREEDY_MULTIPLIER;this.debug_lastNodeCostMap.set(s.capacityMeshNodeId,{f:l,g:a,h:c});let h={prevCandidate:r,node:s,f:l,g:a,h:c};this.queuedNodes?.add(s.capacityMeshNodeId),o.push(h)}}computeProgress(){let e=this.sectionConnectionTerminals.length;if(e===0)return 1;let t=this.currentConnectionIndex/e;if(this.currentConnectionIndex<e&&this.candidates&&this.candidates.length>0&&this.activeCandidateStraightLineDistance&&this.activeCandidateStraightLineDistance>0){let n=this.candidates.reduce((o,r)=>r.f<o.f?r:o);t+=Math.max(0,Math.min(1,1-n.h/this.activeCandidateStraightLineDistance))/e}else this.solved&&(t=1);return Math.min(1,t)}_setupAStar(e,t){this.candidates=[{prevCandidate:null,node:e,f:0,g:0,h:0}],this.visitedNodes=new Set([e.capacityMeshNodeId]),this.debug_lastNodeCostMap=new Map,this.activeCandidateStraightLineDistance=kn(e.center,t.center);let n=this.computeH(null,e,t);this.candidates[0].h=n,this.candidates[0].f=n*this.GREEDY_MULTIPLIER,this.debug_lastNodeCostMap.set(e.capacityMeshNodeId,{f:this.candidates[0].f,g:0,h:n}),this.queuedNodes=new Set([e.capacityMeshNodeId])}_handleCandidatesExhausted(e){console.error(`Ran out of candidates for section connection ${e.connectionName}`),this.currentConnectionIndex++,this.candidates=null,this.visitedNodes=null,this.queuedNodes=null}_handleGoalReached(e,t,n){let o=this.getBacktrackedPath(e);t.path=o,this.reduceCapacityAlongPath(o),this.currentConnectionIndex++,this.candidates=null,this.visitedNodes=null,this.queuedNodes=null}visualize(){let e=this.sectionConnectionTerminals.filter((n)=>n.path&&n.path.length>0).map((n)=>({connectionName:n.connectionName,path:n.path})),t=BZe({sectionNodes:this.sectionNodes,sectionEdges:this.sectionEdges,sectionConnectionTerminals:this.sectionConnectionTerminals,completedPaths:e,nodeMap:this.nodeMap,colorMap:this.colorMap,centerNodeId:null,title:`Section Pathing: Conn ${this.currentConnectionIndex+1}/${this.sectionConnectionTerminals.length} (${this.sectionNodes.length} nodes)`,nodeOpacity:0.1});for(let n of this.sectionNodes){let o=t.rects.findIndex((r)=>r.label?.includes(n.capacityMeshNodeId));if(o!==-1){let r=this.debug_lastNodeCostMap.get(n.capacityMeshNodeId),i=this.usedNodeCapacityMap.get(n.capacityMeshNodeId)??0,s=this.getTotalCapacity(n),a=`${i.toFixed(1)}/${s.toFixed(1)}`,c=r?`f:${r.f.toFixed(1)} g:${r.g.toFixed(1)} h:${r.h.toFixed(1)}`:"cost:?";t.rects[o].label=[n.capacityMeshNodeId,`Cap: ${a}`,c,`Z: ${n.availableZ.join(",")}`].join(`
`),i>s&&(t.rects[o].stroke=zi("red",0.7))}}if(this.candidates&&this.candidates.length>0){let n=this.candidates.slice().sort((s,a)=>s.f-a.f).slice(0,5),o=this.sectionConnectionTerminals[this.currentConnectionIndex],r=o?.connectionName??"unknown",i=this.colorMap[r]??"purple";n.forEach((s,a)=>{let c=0.8*(1-a/5),l=this.getBacktrackedPath(s);l.length>0&&t.lines.push({points:l.map(({center:{x:h,y:d}})=>({x:h,y:d})),strokeColor:zi(i,1-c),strokeWidth:0.05})})}return t}},G4e=(e)=>Array.from({length:e},(t,n)=>n),Ayr=class extends ybe{getSolverName(){return"HyperCapacityPathingSingleSectionSolver"}constructorParams;constructor(e){super(),this.MAX_ITERATIONS=1e5,this.constructorParams=e}computeG(e){return-e.getSolvedSectionScore()}computeH(e){return 0}getCombinationDefs(){let e=this.constructorParams.sectionConnectionTerminals.length;return e===2?[["orderings2_for2"]]:e===3?[["orderings6_for3"]]:e===4?[["orderings24_for4"]]:[["orderings30"]]}getFailureMessage(){return`All CapacityPathingSingleSection solvers failed for "${this.centerNodeId}"`}getHyperParameterDefs(){return[{name:"orderings2_for2",possibleValues:G4e(2).map((e)=>({SHUFFLE_SEED:e}))},{name:"orderings6_for3",possibleValues:G4e(6).map((e)=>({SHUFFLE_SEED:e}))},{name:"orderings24_for4",possibleValues:G4e(24).map((e)=>({SHUFFLE_SEED:e}))},{name:"orderings30",possibleValues:G4e(30).map((e)=>({SHUFFLE_SEED:e}))}]}generateSolver(e){return new gyr({...this.constructorParams,hyperParameters:{...this.constructorParams.hyperParameters,...e}})}onSolve({solver:e}){this.winningSolver=e}get centerNodeId(){return this.constructorParams.centerNodeId}get sectionNodes(){return this.constructorParams.sectionNodes}get sectionConnectionTerminals(){return this.winningSolver?.sectionConnectionTerminals}},fyr=(e)=>Math.floor(10*e)/10,yyr=class extends Ayr{cacheHit=!1;cacheProvider;hasAttemptedToUseCache=!1;sectionNodeIdSet;cachedSectionConnectionTerminals=null;sectionScore=0;constructor(e){e.nodeMap=e.nodeMap??new Map(e.sectionNodes.map((t)=>[t.capacityMeshNodeId,t])),super(e),this.sectionNodeIdSet=new Set(e.sectionNodes.map((t)=>t.capacityMeshNodeId)),this.cacheProvider=e.cacheProvider===void 0?hv():e.cacheProvider}_step(){!this.hasAttemptedToUseCache&&this.cacheProvider&&this.attemptToUseCacheSync()||(super._step(),(this.solved||this.failed)&&this.cacheProvider&&this.saveToCacheSync())}_computeBfsOrderingOfNodesInSection(){let e=new Set(this.constructorParams.centerNodeId),t=[],n=[{ancestorCapacitySum:0,capacity:0,g:0,capacityMeshNodeId:this.constructorParams.centerNodeId}];for(;n.length>0;){n.sort((i,s)=>s.g-i.g);let o=n.pop();if(!o)break;t.push(o.capacityMeshNodeId);let r=this.constructorParams.nodeEdgeMap.get(o.capacityMeshNodeId).flatMap((i)=>i.nodeIds).filter((i)=>!e.has(i)).filter((i)=>this.sectionNodeIdSet.has(i));for(let i of r){e.add(i);let s=this.constructorParams.nodeMap.get(i),a=tP(s);n.push({ancestorCapacitySum:o.g,capacity:a,g:o.g+a,capacityMeshNodeId:i})}}return t}computeCacheKeyAndTransform(){let e=this._computeBfsOrderingOfNodesInSection(),t=new Map,n=new Map;e.forEach((d,u)=>{let _=`node${u}`;t.set(d,_),n.set(_,d)});let o={};for(let d of e){let u=t.get(d),_=this.constructorParams.nodeMap.get(d),p=tP(_);o[u]=fyr(p).toFixed(1)}let r=new Set,i=[];for(let d of e){let u=t.get(d),_=this.constructorParams.nodeEdgeMap.get(d)??[];for(let p of _){let m=p.nodeIds.find((A)=>A!==d);if(this.sectionNodeIdSet.has(m)){let A=[u,t.get(m)].sort(),g=`${A[0]}-${A[1]}`;r.has(g)||(i.push(A),r.add(g))}}}i.sort((d,u)=>d[0]!==u[0]?d[0].localeCompare(u[0]):d[1].localeCompare(u[1]));let s={},a=new Map,c=new Map;for(let d of this.constructorParams.sectionConnectionTerminals){let u=t.get(d.startNodeId),_=t.get(d.endNodeId),[p,m]=[u,_].sort(),A=`${p}->${m}`,g=c.get(A)??0;c.set(A,g+1);let f=`${p}->${m}::${g}`;s[f]={start:p,end:m},a.set(f,d.connectionName)}let l=`capacitypathing:${ein.default({node_capacity_map:o,node_edge_map:i,terminals:s})}`,h={cacheSpaceToRealConnectionId:a,cacheSpaceToRealNodeId:n};return this.cacheKey=l,this.cacheToSolveSpaceTransform=h,{cacheKey:l,cacheToSolveSpaceTransform:h}}applyCachedSolution(e){if(!this.cacheToSolveSpaceTransform)return console.error("Cache transform not available, cannot apply cached solution."),void(this.failed=!0);if(!e.success)return this.failed=!0,void(this.cacheHit=!0);this.cachedSectionConnectionTerminals=[];let{cacheSpaceToRealNodeId:t,cacheSpaceToRealConnectionId:n}=this.cacheToSolveSpaceTransform;for(let[o,r]of Object.entries(e.solutionPaths)){let i=n.get(o);if(!i){console.warn(`Could not find real connection name for ${o}`);continue}let s=this.constructorParams.sectionConnectionTerminals.find((c)=>c.connectionName===i);if(!s){console.warn(`Could not find original terminal for connection name ${i}`);continue}let a=r.map((c)=>{let l=t.get(c);if(!l)throw Error(`Could not map cache node ID ${c} to real node ID for connection ${i}`);let h=this.constructorParams.nodeMap.get(l);if(!h)throw Error(`Could not find node with ID ${l} in nodeMap for connection ${i}`);return h});this.cachedSectionConnectionTerminals.push({...s,path:a})}this.sectionScore=e.sectionScore,this.solved=!0,this.cacheHit=!0}attemptToUseCacheSync(){if(this.hasAttemptedToUseCache=!0,!this.cacheProvider?.isSyncCache)return console.log("Cache provider is not synchronous, skipping sync cache check."),!1;if(this.cacheKey||this.computeCacheKeyAndTransform(),!this.cacheKey)return console.error("Failed to compute cache key."),!1;try{let e=this.cacheProvider.getCachedSolutionSync(this.cacheKey);if(e)return this.applyCachedSolution(e),!0}catch(e){console.error("Error attempting to use cache:",e)}return!1}saveToCacheSync(){if(!this.cacheKey)return void console.error("Cannot save to cache without cache key.");if(!this.cacheToSolveSpaceTransform)return void console.error("Cache transform not available, cannot save solution to cache.");let e;if(this.failed)e={success:!1};else{if(!this.solved)return;{let t={},{cacheSpaceToRealNodeId:n,cacheSpaceToRealConnectionId:o}=this.cacheToSolveSpaceTransform,r=new Map;for(let[a,c]of n)r.set(c,a);let i=new Map;for(let[a,c]of o)i.set(c,a);let s=[];if(super.sectionConnectionTerminals){for(let a of super.sectionConnectionTerminals)if(a.path&&a.path.length>0){let c=a.path.map((l)=>l.capacityMeshNodeId);s.push([a.connectionName,c])}}for(let[a,c]of s){let l=i.get(a);if(!l){console.warn(`Could not find cache space connection ID for ${a} when saving to cache.`);continue}let h=c.map((d)=>{let u=r.get(d);if(!u)throw Error(`Could not map real node ID ${d} to cache node ID for connection ${a} when saving to cache.`);return u});t[l]=h}e={success:!0,sectionScore:this.sectionScore,solutionPaths:t}}}try{this.cacheProvider?.setCachedSolutionSync(this.cacheKey,e)}catch(t){console.error("Error saving solution to cache:",t)}}get sectionConnectionTerminals(){return this.cacheHit&&this.solved&&this.cachedSectionConnectionTerminals?(console.log("returning the cached section connection terminals"),this.cachedSectionConnectionTerminals):super.sectionConnectionTerminals}visualize(){if(!this.cacheHit)return super.visualize();return BZe({sectionNodes:this.constructorParams.sectionNodes,sectionEdges:this.constructorParams.sectionEdges,sectionConnectionTerminals:this.cachedSectionConnectionTerminals,completedPaths:this.cachedSectionConnectionTerminals.map((t)=>({connectionName:t.connectionName,path:t.path})),nodeMap:this.constructorParams.nodeMap,colorMap:this.constructorParams.colorMap,title:"CachedHyperCapacityPathingSingleSectionSolver"})}},xyr=class extends ei{getSolverName(){return"CapacityPathingMultiSectionSolver"}simpleRouteJson;nodes;edges;nodeEdgeMap;connectionsWithNodes=[];colorMap;initialSolver;cacheProvider;stage="initialization";nodeMap=new Map;allNodeIdsSet;usedNodeCapacityMap=new Map;totalNodeCapacityMap=new Map;nodeCapacityPercentMap=new Map;nodeOptimizationAttemptCountMap=new Map;currentSection=null;sectionSolver=null;currentScheduleIndex=0;stats;OPTIMIZATION_SCHEDULE=[{MAX_ATTEMPTS_PER_NODE:1,MAX_EXPANSION_DEGREES:3,MINIMUM_PROBABILITY_OF_FAILURE_TO_OPTIMIZE:0.05},{MAX_ATTEMPTS_PER_NODE:2,MAX_EXPANSION_DEGREES:5,MINIMUM_PROBABILITY_OF_FAILURE_TO_OPTIMIZE:0.2},{MAX_ATTEMPTS_PER_NODE:3,MAX_EXPANSION_DEGREES:7,MINIMUM_PROBABILITY_OF_FAILURE_TO_OPTIMIZE:0.9}];get currentSchedule(){return this.OPTIMIZATION_SCHEDULE[this.currentScheduleIndex]??null}constructor(e){super(),this.stats={successfulOptimizations:0,failedOptimizations:0,failedSectionSolvers:0,startingScore:0,scheduleScores:this.OPTIMIZATION_SCHEDULE.map(({MAX_EXPANSION_DEGREES:t})=>({maxExpansionDegrees:t,endingScore:0,endingHighestNodePf:0,sectionAttempts:0})),cacheHits:0,cacheMisses:0},this.MAX_ITERATIONS=e.MAX_ITERATIONS??1e7,this.cacheProvider=e.cacheProvider,this.simpleRouteJson=e.simpleRouteJson,this.nodes=e.nodes,this.edges=e.edges,this.nodeEdgeMap=eq(this.edges),this.colorMap=e.colorMap??{},this.nodeMap=new Map(this.nodes.map((t)=>[t.capacityMeshNodeId,t])),this.nodeEdgeMap=eq(this.edges),this.initialSolver=e.initialPathingSolver||new Zrn({simpleRouteJson:this.simpleRouteJson,nodes:this.nodes,edges:this.edges,colorMap:this.colorMap}),this.activeSubSolver=this.initialSolver;for(let t of this.nodes){let n=this.initialSolver.getTotalCapacity(t);this.totalNodeCapacityMap.set(t.capacityMeshNodeId,n)}this.allNodeIdsSet=new Set(this.nodes.map((t)=>t.capacityMeshNodeId))}_stepInitialization(){if(this.initialSolver?.step(),this.initialSolver?.failed)return this.failed=!0,void(this.error=this.initialSolver.error);if(this.initialSolver?.solved){this.usedNodeCapacityMap=new Map(this.initialSolver.usedNodeCapacityMap);for(let e of this.nodes){let t=this.totalNodeCapacityMap.get(e.capacityMeshNodeId)??0,n=this.usedNodeCapacityMap.get(e.capacityMeshNodeId)??0,o=t>0?n/t:0;this.nodeCapacityPercentMap.set(e.capacityMeshNodeId,o),this.nodeOptimizationAttemptCountMap.set(e.capacityMeshNodeId,0)}this.connectionsWithNodes=this.initialSolver.connectionsWithNodes,this.stats.startingScore=dce({totalNodeCapacityMap:this.totalNodeCapacityMap,usedNodeCapacityMap:this.usedNodeCapacityMap,nodeMap:this.nodeMap,sectionNodeIds:this.allNodeIdsSet}),this.stage="section-optimization"}}_getNextNodeToOptimize(){let e=0,t=0,n=null;for(let o of this.nodes){if(o._containsTarget)continue;let r=this.nodeOptimizationAttemptCountMap.get(o.capacityMeshNodeId),i=this.totalNodeCapacityMap.get(o.capacityMeshNodeId),s=LCe({usedCapacity:this.usedNodeCapacityMap.get(o.capacityMeshNodeId)??0,totalCapacity:i,layerCount:o.availableZ.length}),a=s/(r+1);r<this.currentSchedule.MAX_ATTEMPTS_PER_NODE&&a>e&&s>this.currentSchedule.MINIMUM_PROBABILITY_OF_FAILURE_TO_OPTIMIZE&&(e=a,t=s,n=o.capacityMeshNodeId)}return n}getOverallScore(){let e=0;for(let t of this.nodes){if(t._containsTarget)continue;let n=this.totalNodeCapacityMap.get(t.capacityMeshNodeId),o=LCe({usedCapacity:this.usedNodeCapacityMap.get(t.capacityMeshNodeId)??0,totalCapacity:n,layerCount:t.availableZ.length});o>e&&(e=o)}return{highestNodePf:e,score:dce({totalNodeCapacityMap:this.totalNodeCapacityMap,usedNodeCapacityMap:this.usedNodeCapacityMap,nodeMap:this.nodeMap,sectionNodeIds:this.allNodeIdsSet})}}_stepSectionOptimization(){if(!this.sectionSolver){let e=this._getNextNodeToOptimize();if(!e){let{highestNodePf:n,score:o}=this.getOverallScore();return this.stats.scheduleScores[this.currentScheduleIndex].endingHighestNodePf=n,this.stats.scheduleScores[this.currentScheduleIndex].endingScore=o,this.currentScheduleIndex++,void(this.currentSchedule||(this.solved=!0))}let t=((n)=>{let{centerNodeId:o,connectionsWithNodes:r,nodeMap:i,edges:s,nodeEdgeMap:a,expansionDegrees:c}=n,l=new Set,h=[{nodeId:o,depth:0}];l.add(o);let d=0;for(;d<h.length;){let{nodeId:m,depth:A}=h[d++];if(A>=c)continue;let g=a.get(m)?.flatMap((f)=>f.nodeIds.filter((y)=>y!==m))??[];for(let f of g)l.has(f)||(l.add(f),h.push({nodeId:f,depth:A+1}))}let u=Array.from(l).map((m)=>i.get(m)),_=s.filter((m)=>{let[A,g]=m.nodeIds;return l.has(A)&&l.has(g)}),p=[];for(let m of r){if(!m.path)continue;let A=null,g=null;for(let f of m.path)if(l.has(f.capacityMeshNodeId)){A=f.capacityMeshNodeId;break}for(let f=m.path.length-1;f>=0;f--){let y=m.path[f];if(l.has(y.capacityMeshNodeId)){g=y.capacityMeshNodeId;break}}A&&g&&p.push({connectionName:m.connection.name,startNodeId:A,endNodeId:g})}return{sectionConnectionTerminals:p,sectionNodes:u,sectionEdges:_,centerNodeId:o}})({centerNodeId:e,connectionsWithNodes:this.connectionsWithNodes,nodeMap:this.nodeMap,edges:this.edges,expansionDegrees:this.currentSchedule.MAX_EXPANSION_DEGREES,nodeEdgeMap:this.nodeEdgeMap});this.stats.scheduleScores[this.currentScheduleIndex].sectionAttempts++,this.currentSection=t,this.sectionSolver=new yyr({sectionNodes:this.currentSection.sectionNodes,sectionEdges:this.currentSection.sectionEdges,sectionConnectionTerminals:this.currentSection.sectionConnectionTerminals,colorMap:this.colorMap,centerNodeId:this.currentSection.centerNodeId,nodeEdgeMap:this.nodeEdgeMap,hyperParameters:{EXPANSION_DEGREES:this.currentSchedule.MAX_EXPANSION_DEGREES},cacheProvider:this.cacheProvider}),this.activeSubSolver=this.sectionSolver,this.nodeOptimizationAttemptCountMap.set(e,(this.nodeOptimizationAttemptCountMap.get(e)??0)+1)}if(this.sectionSolver.step(),(this.sectionSolver.failed||this.sectionSolver.solved)&&(this.sectionSolver.cacheHit?this.stats.cacheHits++:this.stats.cacheMisses++),this.sectionSolver.failed)return console.warn(`Section solver failed for node ${this.currentSection.centerNodeId}. Error: ${this.sectionSolver.error}`),this.stats.failedSectionSolvers++,this.stats.failedOptimizations++,this.sectionSolver=null,void(this.activeSubSolver=null);if(this.sectionSolver.solved){let e=this.sectionSolver.sectionConnectionTerminals,t=this.sectionSolver.sectionNodes,n=this.sectionSolver.centerNodeId;if(this.sectionSolver=null,this.activeSubSolver=null,!e)return void console.warn(`Pathing sub-solver for section ${this.currentSection.centerNodeId} did not complete successfully. Discarding results.`);let o=new Set(t.map((a)=>a.capacityMeshNodeId)),r=dce({totalNodeCapacityMap:this.totalNodeCapacityMap,usedNodeCapacityMap:this.usedNodeCapacityMap,nodeMap:this.nodeMap,sectionNodeIds:o}),i=new Map(this.usedNodeCapacityMap),s=e;for(let a of s){let c=this.connectionsWithNodes.find((l)=>l.connection.name===a.connectionName);if(c?.path){for(let l of c.path)if(o.has(l.capacityMeshNodeId)){let h=i.get(l.capacityMeshNodeId)??0;i.set(l.capacityMeshNodeId,Math.max(0,h-1))}}}for(let a of s)if(a.path)for(let c of a.path)o.has(c.capacityMeshNodeId)&&i.set(c.capacityMeshNodeId,(i.get(c.capacityMeshNodeId)??0)+1);dce({totalNodeCapacityMap:this.totalNodeCapacityMap,usedNodeCapacityMap:i,nodeMap:this.nodeMap,sectionNodeIds:o})>r?(this.stats.successfulOptimizations++,this._mergeSolvedSectionPaths({centerNodeId:n,sectionConnectionTerminals:e}),this._recalculateNodeCapacityUsage()):this.stats.failedOptimizations++}}_mergeSolvedSectionPaths({centerNodeId:e,sectionConnectionTerminals:t}){for(let n of t){if(!n.path){console.warn(`No path found for connection ${n.connectionName} in section ${e}`);continue}let o=this.connectionsWithNodes.find((_)=>_.connection.name===n.connectionName);if(!o||!o.path){console.warn(`Original connection or path not found for ${n.connectionName} while merging section ${e}`);continue}let r=o.path,i=n.path,s=r.findIndex((_)=>_.capacityMeshNodeId===n.startNodeId),a=r.findIndex((_)=>_.capacityMeshNodeId===n.endNodeId);if(s===-1||a===-1){console.warn(`Could not find start/end nodes (${n.startNodeId}/${n.endNodeId}) in original path for ${n.connectionName}`);continue}let[c,l]=s<=a?[s,a]:[a,s],h=r.slice(0,c),d=r.slice(l+1),u=i;if(i.length>0&&r[c]&&i[0].capacityMeshNodeId!==r[c].capacityMeshNodeId){if(i[i.length-1].capacityMeshNodeId!==r[c].capacityMeshNodeId){console.warn(`New section path for ${n.connectionName} doesn't align with original path boundaries. Skipping merge for this connection.`);continue}u=[...i].reverse()}o.path=[...h,...u,...d]}}_recalculateNodeCapacityUsage(){this.usedNodeCapacityMap.clear();for(let e of this.connectionsWithNodes)if(e.path)for(let t of e.path)this.usedNodeCapacityMap.set(t.capacityMeshNodeId,(this.usedNodeCapacityMap.get(t.capacityMeshNodeId)??0)+1);for(let e of this.nodes){let t=this.totalNodeCapacityMap.get(e.capacityMeshNodeId)??0,n=this.usedNodeCapacityMap.get(e.capacityMeshNodeId)??0,o=t>0?n/t:0;this.nodeCapacityPercentMap.set(e.capacityMeshNodeId,o)}}getCapacityPaths(){let e=[];for(let t of this.connectionsWithNodes){let n=t.path;n&&e.push({capacityPathId:t.connection.name,connectionName:t.connection.name,nodeIds:n.map((o)=>o.capacityMeshNodeId)})}return e}_step(){this.iterations>=this.MAX_ITERATIONS-1?this.solved=!0:this.stage==="initialization"?this._stepInitialization():this.stage==="section-optimization"&&this._stepSectionOptimization()}visualize(){let e=this.connectionsWithNodes.filter((t)=>t.path&&t.path.length>0).map((t)=>({connectionName:t.connection.name,path:t.path}));return BZe({nodeMap:this.nodeMap,sectionConnectionTerminals:this.connectionsWithNodes.map((t)=>({connectionName:t.connection.name,startNodeId:t.path?.[0]?.capacityMeshNodeId,endNodeId:t.path?.[t.path.length-1]?.capacityMeshNodeId})),completedPaths:e,sectionNodes:this.nodes,sectionEdges:this.edges,colorMap:this.colorMap,totalCapacityMap:this.totalNodeCapacityMap,usedNodeCapacityMap:this.usedNodeCapacityMap,nodeOpacity:0.05,title:"Capacity Pathing Multi-Section Solver (Solved)"})}},Cyr=class extends ei{getSolverName(){return"DeadEndSolver"}removedNodeIds;targetNodeIds;leaves;leavesIndex;adjacencyList;nodeMap;nodes;edges;constructor({nodes:e,edges:t}){super(),this.MAX_ITERATIONS=e.length,this.nodes=e,this.edges=t,this.removedNodeIds=new Set,this.targetNodeIds=new Set(e.filter((n)=>n._containsTarget).map((n)=>n.capacityMeshNodeId)),this.adjacencyList=new Map(e.map(({capacityMeshNodeId:n})=>[n,new Set]));for(let{nodeIds:[n,o]}of t)this.adjacencyList.get(n).add(o),this.adjacencyList.get(o).add(n);this.leavesIndex=0,this.leaves=[...this.adjacencyList.entries()].filter(([n,o])=>o.size===1).filter(([n,o])=>!this.targetNodeIds.has(n)).map(([n,o])=>n)}_step(){if(this.leavesIndex===this.leaves.length)return void(this.solved=!0);let e=this.leaves[this.leavesIndex],t=this.adjacencyList.get(e);if(!t||t.size===0)return this.removedNodeIds.add(e),this.adjacencyList.delete(e),this.leavesIndex+=1,void(this.leavesIndex===this.leaves.length&&(this.solved=!0));let[n]=t,o=n?this.adjacencyList.get(n):void 0;if(!n||!o)return this.removedNodeIds.add(e),this.adjacencyList.delete(e),this.leavesIndex+=1,void(this.leavesIndex===this.leaves.length&&(this.solved=!0));o.delete(e),this.removedNodeIds.add(e),this.adjacencyList.delete(e),o.size!==1||this.targetNodeIds.has(n)||this.leaves.push(n),this.leavesIndex+=1,this.leavesIndex===this.leaves.length&&(this.solved=!0)}visualize(){if(!this.nodeMap){this.nodeMap=new Map;for(let n of this.nodes)this.nodeMap.set(n.capacityMeshNodeId,n)}let e=new Map;for(let n of this.edges)for(let o of n.nodeIds)e.set(o,1+(e.get(o)??0));let t={lines:[],points:[],rects:this.nodes.map((n)=>{let o=Math.min(...n.availableZ);return{width:Math.max(n.width-2,0.8*n.width),height:Math.max(n.height-2,0.8*n.height),center:{x:n.center.x+o*n.width*0.05,y:n.center.y-o*n.width*0.05},fill:n._containsObstacle?"rgba(255,0,0,0.1)":{"0,1":"rgba(0,0,0,0.1)",0:"rgba(0,200,200, 0.1)",1:"rgba(0,0,200, 0.1)"}[n.availableZ.join(",")]??"rgba(0,200,200,0.1)",label:[n.capacityMeshNodeId,`availableZ: ${n.availableZ.join(",")}`,`target? ${n._containsTarget??!1}`,`obs? ${n._containsObstacle??!1}`,`conn: ${e.get(n.capacityMeshNodeId)??0}`].join(`
`),layer:`z${n.availableZ.join(",")}`}}),circles:[]};for(let n of this.edges){let o=this.nodeMap.get(n.nodeIds[0]),r=this.nodeMap.get(n.nodeIds[1]);if(o?.center&&r?.center){let i=Math.min(...o.availableZ),s=Math.min(...r.availableZ),a={x:o.center.x+i*o.width*0.05,y:o.center.y-i*o.width*0.05},c={x:r.center.x+s*r.width*0.05,y:r.center.y-s*r.width*0.05},l=Array.from(new Set([...o.availableZ,...r.availableZ])).sort();t.lines.push({layer:`z${l.join(",")}`,points:[a,c],strokeDash:o.availableZ.join(",")===r.availableZ.join(",")?void 0:"10 5",strokeColor:n.nodeIds.some((h)=>this.removedNodeIds.has(h))?zi("black",0.9):void 0})}}return t}},byr=class extends PZe{getSolverName(){return"NoOffBoardMultipleHighDensityRouteStitchSolver"}constructor(e){super(e),this.unsolvedRoutes=[];let t=new Map;for(let n of e.hdRoutes){let o=t.get(n.connectionName)||[];o.push(n),t.set(n.connectionName,o)}for(let[n,o]of t.entries()){let r=e.connections.find((a)=>a.name===n);if(!r)continue;let i={...r.pointsToConnect[0],z:si(l2(r.pointsToConnect[0]),e.layerCount)},s={...r.pointsToConnect[1],z:si(l2(r.pointsToConnect[1]),e.layerCount)};this.unsolvedRoutes.push({connectionName:n,hdRoutes:o,start:i,end:s})}for(let n of e.connections)t.has(n.name)||this.unsolvedRoutes.push({connectionName:n.name,hdRoutes:[],start:{...n.pointsToConnect[0],z:si(l2(n.pointsToConnect[0]),e.layerCount)},end:{...n.pointsToConnect[1],z:si(l2(n.pointsToConnect[1]),e.layerCount)}})}},U4e=0.005,Iyr=class extends ei{getSolverName(){return"SingleLayerNodeMergerSolver"}nodeMap;currentBatchNodeIds;absorbedNodeIds;nextBatchNodeIds;batchHadModifications;hasComputedAdjacentNodeIds=!1;newNodes;constructor(e){super(),this.nodeMap=new Map,this.MAX_ITERATIONS=1e5;for(let n of e)this.nodeMap.set(n.capacityMeshNodeId,n);this.newNodes=[],this.absorbedNodeIds=new Set;let t=[];for(let n of e)n.availableZ.length>1?(this.newNodes.push(n),this.absorbedNodeIds.add(n.capacityMeshNodeId)):t.push([n,n.width*n.height]);t.sort((n,o)=>n[1]-o[1]);for(let[n,o]of t){let r={...n,center:{...n.center}};this.nodeMap.set(n.capacityMeshNodeId,r)}this.currentBatchNodeIds=t.map(([n])=>n.capacityMeshNodeId),this.nextBatchNodeIds=[],this.batchHadModifications=!1}computeAdjacentNodeIdsForFirstBatch(e){let t=Math.max(...e.map((o)=>Math.max(...o.availableZ))),n=[];for(let o=0;o<=t;o++)n.push(new eqe(e.filter((r)=>r.availableZ[0]===o)));for(let o of e){let r=[],i=n[o.availableZ[0]].getNodesInArea(o.center.x,o.center.y,4*o.width,4*o.height);for(let s of i)s._containsTarget&&s._targetConnectionName!==o._targetConnectionName||o._containsTarget&&(!s._containsTarget||s._targetConnectionName!==o._targetConnectionName)||s.capacityMeshNodeId!==o.capacityMeshNodeId&&gbe(o,s)&&r.push(s);o._adjacentNodeIds=r.map((s)=>s.capacityMeshNodeId)}}getAdjacentSameLayerUnprocessedNodes(e){return this.getAdjacentSameLayerUnprocessedNodes2(e)}getAdjacentSameLayerUnprocessedNodes2(e){let t=[],n=Array.from(new Set((e._adjacentNodeIds??[]).map((o)=>this.nodeMap.get(o)))).filter((o)=>o&&o.capacityMeshNodeId!==e.capacityMeshNodeId);n.sort((o,r)=>o.width*o.height-r.width*r.height);for(let o of n)this.absorbedNodeIds.has(o.capacityMeshNodeId)||t.push(o);return t}_step(){this.hasComputedAdjacentNodeIds||(this.computeAdjacentNodeIdsForFirstBatch(this.currentBatchNodeIds.map((l)=>this.nodeMap.get(l))),this.hasComputedAdjacentNodeIds=!0);let e=this.currentBatchNodeIds.pop();for(;e&&this.absorbedNodeIds.has(e);)e=this.currentBatchNodeIds.pop();if(!e)return this.batchHadModifications?(this.currentBatchNodeIds=this.nextBatchNodeIds.sort((l,h)=>{let d=this.nodeMap.get(l),u=this.nodeMap.get(h);return d.width*d.height-u.width*u.height}),this.nextBatchNodeIds=[],void(this.batchHadModifications=!1)):(this.solved=!0,void this.newNodes.push(...this.nextBatchNodeIds.map((l)=>this.nodeMap.get(l))));let t=this.nodeMap.get(e),n=!1,o=this.getAdjacentSameLayerUnprocessedNodes(t);if(o.length===0)return void this.nextBatchNodeIds.push(e);let r=(l)=>{for(let h of l)this.absorbedNodeIds.add(h.capacityMeshNodeId);t._adjacentNodeIds=Array.from(new Set([...t._adjacentNodeIds??[],...l.flatMap((h)=>h._adjacentNodeIds??[])].filter((h)=>h!==t.capacityMeshNodeId&&!this.absorbedNodeIds.has(h))))},i=o.filter((l)=>l.center.x<t.center.x&&Math.abs(l.center.y-t.center.y)<t.height/2);if(i.length>0){let{width:l,height:h}=i[0],d=i.every((u)=>u.width===l&&u.height===h);Math.abs(i.reduce((u,_)=>u+_.height,0)-t.height)<U4e&&d&&(t.width+=l,t.center.x=t.center.x-l/2,r(i),n=!0)}let s=o.filter((l)=>l.center.x>t.center.x&&Math.abs(l.center.y-t.center.y)<t.height/2);if(s.length>0&&!n){let{width:l,height:h}=s[0],d=s.every((u)=>u.width===l&&u.height===h);Math.abs(s.reduce((u,_)=>u+_.height,0)-t.height)<U4e&&d&&(t.width+=l,t.center.x=t.center.x+l/2,r(s),n=!0)}let a=o.filter((l)=>l.center.y>t.center.y&&Math.abs(l.center.x-t.center.x)<t.width/2);if(a.length>0&&!n){let{width:l,height:h}=a[0],d=a.every((u)=>u.width===l&&u.height===h);Math.abs(a.reduce((u,_)=>u+_.width,0)-t.width)<U4e&&d&&(t.height+=h,t.center.y=t.center.y+h/2,r(a),n=!0)}let c=o.filter((l)=>l.center.y<t.center.y&&Math.abs(l.center.x-t.center.x)<t.width/2);if(c.length>0&&!n){let{width:l,height:h}=c[0],d=c.every((u)=>u.width===l&&u.height===h);Math.abs(c.reduce((u,_)=>u+_.width,0)-t.width)<U4e&&d&&(t.height+=h,t.center.y=t.center.y-h/2,r(c),n=!0)}n?(this.batchHadModifications=!0,this.currentBatchNodeIds.push(e)):this.nextBatchNodeIds.unshift(e)}visualize(){let e={circles:[],lines:[],points:[],rects:[],coordinateSystem:"cartesian",title:"Same Layer Node Merger"};for(let o of this.newNodes)e.rects.push(qA(o));let t=this.currentBatchNodeIds[this.currentBatchNodeIds.length-1],n;t&&(n=this.getAdjacentSameLayerUnprocessedNodes(this.nodeMap.get(t)));for(let o of this.currentBatchNodeIds){let r=this.nodeMap.get(o);if(!this.absorbedNodeIds.has(o)&&r){let i=qA(r,{rectMargin:0.01});o===t?i.stroke="rgba(0, 255, 0, 0.8)":n?.some((s)=>s.capacityMeshNodeId===o)?i.stroke="rgba(128, 0, 128, 0.8)":i.stroke="rgba(255, 165, 0, 0.8)",i.layer=`z${r.availableZ.join(",")}`,i.label=`${i.label}
(unprocessed)`,e.rects.push(i)}}for(let o of this.nextBatchNodeIds){let r=this.nodeMap.get(o);if(!this.absorbedNodeIds.has(o)&&r){let i=qA(r,{rectMargin:0.01});i.layer=`z${r.availableZ.join(",")}`,i.stroke="rgba(0, 217, 255, 0.8)",i.label=`${i.label}
x: ${r.center.x}, y: ${r.center.y}
${r.width}x${r.height}
(next batch)`,e.rects.push(i)}}return e}},vyr=class extends ei{getSolverName(){return"StrawSolver"}multiLayerNodes;strawNodes;skippedNodes;unprocessedNodes;strawSize;nodeIdCounter;constructor(e){super(),this.MAX_ITERATIONS=1e5,this.strawSize=e.strawSize??0.5,this.multiLayerNodes=[],this.strawNodes=[],this.skippedNodes=[],this.nodeIdCounter=0,this.unprocessedNodes=[];for(let t of e.nodes)t.availableZ.length===1?this.unprocessedNodes.push(t):this.multiLayerNodes.push(t)}getCapacityOfMultiLayerNodesWithinBounds(e){let t=0;for(let n of this.multiLayerNodes){let o=n.center.x-n.width/2,r=n.center.x+n.width/2,i=n.center.y-n.height/2,s=n.center.y+n.height/2,a=Math.max(e.minX,o),c=Math.min(e.maxX,r),l=Math.max(e.minY,i),h=Math.min(e.maxY,s);if(a<c&&l<h){let d=(c-a)*(h-l)/(n.width*n.height);t+=tP(n)*d}}return t}getSurroundingCapacities(e){let t=Math.min(e.width,e.height);return{leftSurroundingCapacity:this.getCapacityOfMultiLayerNodesWithinBounds({minX:e.center.x-e.width/2-t,maxX:e.center.x-e.width/2,minY:e.center.y-e.height/2,maxY:e.center.y+e.height/2}),rightSurroundingCapacity:this.getCapacityOfMultiLayerNodesWithinBounds({minX:e.center.x+e.width/2,maxX:e.center.x+e.width/2+t,minY:e.center.y-e.height/2,maxY:e.center.y+e.height/2}),topSurroundingCapacity:this.getCapacityOfMultiLayerNodesWithinBounds({minX:e.center.x-e.width/2,maxX:e.center.x+e.width/2,minY:e.center.y-e.height/2-t,maxY:e.center.y-e.height/2}),bottomSurroundingCapacity:this.getCapacityOfMultiLayerNodesWithinBounds({minX:e.center.x-e.width/2,maxX:e.center.x+e.width/2,minY:e.center.y+e.height/2,maxY:e.center.y+e.height/2+t})}}createStrawsForNode(e){let t=[],{leftSurroundingCapacity:n,rightSurroundingCapacity:o,topSurroundingCapacity:r,bottomSurroundingCapacity:i}=this.getSurroundingCapacities(e);if(1*(n+o)>r+i){let s=Math.floor(e.height/this.strawSize),a=e.height/s;for(let c=0;c<s;c++){let l=e.center.y-e.height/2+c*a+a/2;t.push({capacityMeshNodeId:`${e.capacityMeshNodeId}_straw${c}`,center:{x:e.center.x,y:l},width:e.width,height:a,layer:e.layer,availableZ:[...e.availableZ],_depth:e._depth,_strawNode:!0,_strawParentCapacityMeshNodeId:e.capacityMeshNodeId})}}else{let s=Math.floor(e.width/this.strawSize),a=e.width/s;for(let c=0;c<s;c++){let l=e.center.x-e.width/2+c*a+a/2;t.push({capacityMeshNodeId:`${e.capacityMeshNodeId}_straw${c}`,center:{x:l,y:e.center.y},width:a,height:e.height,layer:e.layer,availableZ:[...e.availableZ],_depth:e._depth,_strawNode:!0,_strawParentCapacityMeshNodeId:e.capacityMeshNodeId})}}return t}getResultNodes(){return[...this.multiLayerNodes,...this.strawNodes,...this.skippedNodes]}_step(){let e=this.unprocessedNodes.pop();if(!e)return void(this.solved=!0);if(e.width<this.strawSize&&e.height<this.strawSize)return void this.skippedNodes.push(e);if(e._containsTarget)return void this.skippedNodes.push(e);let t=this.createStrawsForNode(e);this.strawNodes.push(...t),t.length===0&&this.strawNodes.push(e)}visualize(){let e={rects:[],lines:[],points:[],circles:[],title:"Straw Solver"};for(let t of this.unprocessedNodes)e.rects.push({center:t.center,width:t.width,height:t.height,fill:"rgba(200, 200, 200, 0.5)",stroke:"rgba(0, 0, 0, 0.5)",label:`${t.capacityMeshNodeId}
Unprocessed
${t.width}x${t.height}`});for(let t of this.strawNodes){let n=t.availableZ[0]===0?"rgba(0, 150, 255, 0.5)":"rgba(255, 100, 0, 0.5)";e.rects.push({center:t.center,width:t.width,height:t.height,fill:n,stroke:"rgba(0, 0, 0, 0.5)",label:`${t.capacityMeshNodeId}
Layer: ${t.availableZ[0]}
${t.width}x${t.height}`,layer:`z${t.availableZ.join(",")}`})}for(let t of this.multiLayerNodes)e.rects.push({center:t.center,width:0.9*t.width,height:0.9*t.height,fill:"rgba(100, 255, 100, 0.5)",stroke:"rgba(0, 0, 0, 0.5)",layer:`z${t.availableZ.join(",")}`,label:`${t.capacityMeshNodeId}
Layers: ${t.availableZ.join(",")}
${t.width}x${t.height}`});return e}};function Gzt(e){let{nodeId:t,nodeIdToSegmentIds:n,segmentIdToNodeIds:o,hops:r}=e;if(r===0)return[t];let i=new Set([t]),s=[{nodeId:t,remainingHops:r}];for(;s.length>0;){let{nodeId:a,remainingHops:c}=s.shift();if(c===0)continue;let l=n.get(a)||[];for(let h of l){let d=o.get(h)||[];for(let u of d)i.has(u)||(i.add(u),s.push({nodeId:u,remainingHops:c-1}))}}return Array.from(i)}var KKe=(e)=>Array.from(e.entries()).map(([t,{x:n,y:o,z:r}])=>`${t}(${n?.toFixed(3)??""},${o?.toFixed(3)??""},${r??""})`).sort().join("&"),Syr=(e,t,n,o)=>{let r=Math.min(e,t),i=Math.max(e,t),s=Math.min(n,o);return r<=Math.max(n,o)&&i>=s},W3e=(e,t,n,o)=>{let r=[],i=new Map(e.originalPointMap);for(let[s,a]of n.entries()){let c=i.get(s);i.set(s,{x:a.x??c.x,y:a.y??c.y,z:a.z??c.z})}for(let s of e.allNodeIds){if(!t.get(s))continue;let a=e.segmentPairsInNode.get(s);for(let c of a){let l=i.get(c[0]),h=i.get(c[1]);l.z!==h.z&&r.push({type:"transition_via",segmentPoints:c,capacityMeshNodeId:s,probabilityOfFailure:0})}for(let c=0;c<a.length;c++)for(let l=c+1;l<a.length;l++){if(o?.areIdsConnected(a[c][0],a[c][1]))continue;let h=a[c],d=a[l],u=i.get(h[0]),_=i.get(h[1]),p=i.get(d[0]),m=i.get(d[1]);if(!Syr(u.z,_.z,p.z,m.z))continue;let A=Ru(u,_,p,m),g=u.z===_.z&&p.z===m.z&&u.z===p.z;A&&(g?r.push({type:"same_layer_crossing",segmentPoints:[h,d],capacityMeshNodeId:s,crossingLine1:h,crossingLine2:d,probabilityOfFailure:0}):u.z===_.z&&p.z!==m.z?r.push({type:"single_transition_crossing",segmentPoints:[h,d],capacityMeshNodeId:s,sameLayerCrossingLine:h,transitionCrossingLine:d,probabilityOfFailure:0}):u.z!==_.z&&p.z===m.z?r.push({type:"single_transition_crossing",segmentPoints:[h,d],capacityMeshNodeId:s,sameLayerCrossingLine:d,transitionCrossingLine:h,probabilityOfFailure:0}):u.z!==_.z&&p.z!==m.z&&r.push({type:"double_transition_crossing",segmentPoints:[h,d],capacityMeshNodeId:s,crossingLine1:h,crossingLine2:d,probabilityOfFailure:0}))}}return r},tin=(e,t,n)=>{if(t.type==="change_layer")for(let o of t.segmentPointIds){let r=e.get(o)||{};e.set(o,{...r,z:t.newZ})}else if(t.type==="swap_position_on_segment"){let[o,r]=t.segmentPointIds,i=n(o),s=n(r),a=e.get(o)||{},c=e.get(r)||{};e.set(o,{...a,x:s.x,y:s.y}),e.set(r,{...c,x:i.x,y:i.y})}else if(t.type==="combined")for(let o of t.operations)tin(e,o,n)},nin=(e,t)=>{let n=new Map,o=new Map,r=new Map,i=[],s=0;for(let a of e)for(let c of a.assignedPoints){let l={segmentPointId:"SP"+s++,segmentId:a.nodePortSegmentId,capacityMeshNodeIds:t.get(a.nodePortSegmentId),connectionName:c.connectionName,rootConnectionName:c.rootConnectionName,x:c.point.x,y:c.point.y,z:c.point.z,directlyConnectedSegmentPointIds:[]};n.set(l.segmentPointId,l);for(let h of l.capacityMeshNodeIds)o.set(h,[...o.get(h)??[],l.segmentPointId]);r.set(a.nodePortSegmentId,[...r.get(a.nodePortSegmentId)??[],l.segmentPointId]),i.push(l)}return{segmentPointMap:n,nodeToSegmentPointMap:o,segmentToSegmentPointMap:r}},Pyr=class extends ei{getSolverName(){return"UnravelSectionSolver"}nodeMap;dedupedSegments;dedupedSegmentMap;MUTABLE_HOPS=1;unravelSection;candidates=[];lastProcessedCandidate=null;bestCandidate=null;originalCandidate;rootNodeId;nodeIdToSegmentIds;segmentIdToNodeIds;colorMap;tunedNodeCapacityMap;MAX_CANDIDATES=500;iterationsSinceImprovement=0;hyperParameters;selectedCandidateIndex=null;queuedOrExploredCandidatePointModificationHashes=new Set;constructorParams;constructor(e){if(super(),this.constructorParams=e,this.MUTABLE_HOPS=e.MUTABLE_HOPS??this.MUTABLE_HOPS,this.MAX_ITERATIONS=50000,this.hyperParameters={...e.hyperParameters,MAX_ITERATIONS_WITHOUT_IMPROVEMENT:200},this.nodeMap=e.nodeMap,this.dedupedSegments=e.dedupedSegments,e.dedupedSegmentMap)this.dedupedSegmentMap=e.dedupedSegmentMap;else{this.dedupedSegmentMap=new Map;for(let t of this.dedupedSegments)this.dedupedSegmentMap.set(t.nodePortSegmentId,t)}this.nodeIdToSegmentIds=e.nodeIdToSegmentIds,this.segmentIdToNodeIds=e.segmentIdToNodeIds,this.rootNodeId=e.rootNodeId,this.colorMap=e.colorMap??{},this.unravelSection=this.createUnravelSection({segmentPointMap:e.segmentPointMap,nodeToSegmentPointMap:e.nodeToSegmentPointMap,segmentToSegmentPointMap:e.segmentToSegmentPointMap}),this.tunedNodeCapacityMap=new Map;for(let t of this.unravelSection.allNodeIds)this.tunedNodeCapacityMap.set(t,tP(this.nodeMap.get(t)));this.originalCandidate=this.createInitialCandidate(),this.candidates=[this.originalCandidate]}getConstructorParams(){return{...this.constructorParams,segmentPointMap:this.unravelSection.segmentPointMap,nodeToSegmentPointMap:this.unravelSection.segmentPointsInNode,segmentToSegmentPointMap:this.unravelSection.segmentPointsInSegment}}createUnravelSection(e){let t=Gzt({nodeId:this.rootNodeId,nodeIdToSegmentIds:this.nodeIdToSegmentIds,segmentIdToNodeIds:this.segmentIdToNodeIds,hops:this.MUTABLE_HOPS}),n=Gzt({nodeId:this.rootNodeId,nodeIdToSegmentIds:this.nodeIdToSegmentIds,segmentIdToNodeIds:this.segmentIdToNodeIds,hops:this.MUTABLE_HOPS+1}),o=Array.from(new Set(n).difference(new Set(t)));e?.segmentPointMap||(e=nin(this.dedupedSegments,this.segmentIdToNodeIds));let r=new Map;for(let u of n)r.set(u,e.nodeToSegmentPointMap.get(u));let i=new Map;for(let u of n)for(let _ of r.get(u)){let p=e.segmentPointMap.get(_);i.set(_,p)}let s=Array.from(i.values()),a=new Map;for(let u of s)a.set(u.segmentId,[...a.get(u.segmentId)??[],u.segmentPointId]);for(let[u,_]of r.entries())for(let p=0;p<_.length;p++){let m=e.segmentPointMap.get(_[p]);for(let A=p+1;A<_.length;A++){let g=e.segmentPointMap.get(_[A]);g.segmentPointId!==m.segmentPointId&&(g.segmentId!==m.segmentId&&g.connectionName===m.connectionName&&(g.directlyConnectedSegmentPointIds.includes(m.segmentPointId)||(m.directlyConnectedSegmentPointIds.push(g.segmentPointId),g.directlyConnectedSegmentPointIds.push(m.segmentPointId))))}}let c=new Map;for(let u of n)c.set(u,[]);for(let u of s)for(let _ of u.capacityMeshNodeIds){let p=c.get(_);if(p)for(let m of u.directlyConnectedSegmentPointIds){let A=e.segmentPointMap.get(m);A.segmentPointId!==u.segmentPointId&&(A.capacityMeshNodeIds.some((g)=>g===_)&&(p.some(([g,f])=>g===u.segmentPointId&&f===A.segmentPointId||g===A.segmentPointId&&f===u.segmentPointId)||p.push([u.segmentPointId,A.segmentPointId])))}}let l=new Set;for(let u of t)for(let _ of this.nodeIdToSegmentIds.get(u))this.segmentIdToNodeIds.get(_).every((p)=>!this.nodeMap.get(p)._containsTarget)&&l.add(_);let h=new Set;for(let u of s){let _=u.capacityMeshNodeIds.some((A)=>t.includes(A)),p=this.dedupedSegmentMap.get(u.segmentId),m=p&&p.availableZ.length>1;(_||m)&&h.add(u.segmentPointId)}let d=new Set;for(let u of s)if(u.capacityMeshNodeIds.some((_)=>this.nodeMap.get(_)?._containsTarget)){let _=this.dedupedSegmentMap.get(u.segmentId);_&&_.availableZ.length===1&&d.add(u.segmentPointId)}return{allNodeIds:n,mutableNodeIds:t,immutableNodeIds:o,mutableSegmentIds:l,segmentPairsInNode:c,segmentPointMap:i,segmentPointsInNode:r,segmentPointsInSegment:a,originalPointMap:i,mutableSegmentPointIds:h,zLockedSegmentPointIds:d}}createInitialCandidate(){let e=new Map,t=W3e(this.unravelSection,this.nodeMap,e),n=this.computeG({issues:t,originalCandidate:{},operationsPerformed:0,operation:{}});return{pointModifications:e,g:n,h:0,f:n,operationsPerformed:0,candidateHash:KKe(e),issues:W3e(this.unravelSection,this.nodeMap,e)}}get nextCandidate(){return this.candidates[0]??null}getPointInCandidate(e,t){let n=this.unravelSection.segmentPointMap.get(t),o=e.pointModifications.get(t);return{x:o?.x??n.x,y:o?.y??n.y,z:o?.z??n.z,segmentId:n.segmentId}}getConnectionSegmentPointIds(e){let t=[];for(let[n,o]of this.unravelSection.segmentPointMap.entries())o.connectionName===e&&t.push(n);return t}canConnectionUseLayer(e,t){for(let n of e){let o=this.unravelSection.segmentPointMap.get(n),r=this.dedupedSegmentMap.get(o.segmentId);if(!r||!r.availableZ.includes(t))return!1}return!0}getOperationsForIssue(e,t){let n=[];if(t.type==="transition_via"){let[o,r]=t.segmentPoints,i=this.getPointInCandidate(e,o),s=this.getPointInCandidate(e,r),a=this.unravelSection.segmentPointMap.get(o),c=(this.unravelSection.segmentPointMap.get(r),this.dedupedSegmentMap.get(i.segmentId).availableZ),l=this.dedupedSegmentMap.get(s.segmentId).availableZ,h=this.unravelSection.zLockedSegmentPointIds.has(o),d=this.unravelSection.zLockedSegmentPointIds.has(r),u=this.getConnectionSegmentPointIds(a.connectionName);if(this.canConnectionUseLayer(u,s.z)){let _=u.filter((p)=>this.unravelSection.mutableSegmentPointIds.has(p)&&!this.unravelSection.zLockedSegmentPointIds.has(p));_.length>0&&n.push({type:"change_layer",newZ:s.z,segmentPointIds:_})}if(this.canConnectionUseLayer(u,i.z)){let _=u.filter((p)=>this.unravelSection.mutableSegmentPointIds.has(p)&&!this.unravelSection.zLockedSegmentPointIds.has(p));_.length>0&&n.push({type:"change_layer",newZ:i.z,segmentPointIds:_})}this.unravelSection.mutableSegmentPointIds.has(o)&&!h&&c.includes(s.z)&&n.push({type:"change_layer",newZ:s.z,segmentPointIds:[o]}),this.unravelSection.mutableSegmentPointIds.has(r)&&!d&&l.includes(i.z)&&n.push({type:"change_layer",newZ:i.z,segmentPointIds:[r]})}if(t.type==="same_layer_crossing"){let[o,r]=t.crossingLine1,[i,s]=t.crossingLine2,a=[],c=this.unravelSection.segmentPointMap.get(o),l=this.unravelSection.segmentPointMap.get(r),h=this.unravelSection.segmentPointMap.get(i),d=this.unravelSection.segmentPointMap.get(s),u=this.unravelSection.mutableSegmentPointIds.has(o),_=this.unravelSection.mutableSegmentPointIds.has(r),p=this.unravelSection.mutableSegmentPointIds.has(i),m=this.unravelSection.mutableSegmentPointIds.has(s),A=this.unravelSection.zLockedSegmentPointIds.has(o),g=this.unravelSection.zLockedSegmentPointIds.has(r),f=this.unravelSection.zLockedSegmentPointIds.has(i),y=this.unravelSection.zLockedSegmentPointIds.has(s);u&&p&&c.segmentId===h.segmentId&&a.push([o,i]),u&&m&&c.segmentId===d.segmentId&&a.push([o,s]),_&&p&&l.segmentId===h.segmentId&&a.push([r,i]),_&&m&&l.segmentId===d.segmentId&&a.push([r,s]);for(let[T,N]of a)n.push({type:"swap_position_on_segment",segmentPointIds:[T,N]});let x=this.getConnectionSegmentPointIds(c.connectionName),C=this.getConnectionSegmentPointIds(h.connectionName),b=new Set;for(let T of this.unravelSection.segmentPointMap.values()){let N=this.dedupedSegmentMap.get(T.segmentId);if(N)for(let D of N.availableZ)b.add(D)}for(let T of b)if(T!==c.z&&this.canConnectionUseLayer(x,T)){let N=x.filter((D)=>this.unravelSection.mutableSegmentPointIds.has(D)&&!this.unravelSection.zLockedSegmentPointIds.has(D));N.length>0&&n.push({type:"change_layer",newZ:T,segmentPointIds:N})}for(let T of b)if(T!==h.z&&this.canConnectionUseLayer(C,T)){let N=C.filter((D)=>this.unravelSection.mutableSegmentPointIds.has(D)&&!this.unravelSection.zLockedSegmentPointIds.has(D));N.length>0&&n.push({type:"change_layer",newZ:T,segmentPointIds:N})}let I=this.dedupedSegmentMap.get(c.segmentId),v=this.dedupedSegmentMap.get(l.segmentId),P=this.dedupedSegmentMap.get(h.segmentId),M=this.dedupedSegmentMap.get(d.segmentId),B=(T,N)=>T.every((D)=>D.availableZ.includes(N));if(u&&_&&!A&&!g){let T=c.z===0?1:0;B([I,v],T)&&n.push({type:"change_layer",newZ:T,segmentPointIds:[o,r]})}if(p&&m&&!f&&!y){let T=h.z===0?1:0;B([P,M],T)&&n.push({type:"change_layer",newZ:T,segmentPointIds:[i,s]})}if(u&&!A){let T=c.z===0?1:0;I.availableZ.includes(T)&&n.push({type:"change_layer",newZ:T,segmentPointIds:[o]})}if(_&&!g){let T=l.z===0?1:0;v.availableZ.includes(T)&&n.push({type:"change_layer",newZ:T,segmentPointIds:[r]})}if(p&&!f){let T=h.z===0?1:0;P.availableZ.includes(T)&&n.push({type:"change_layer",newZ:T,segmentPointIds:[i]})}if(m&&!y){let T=d.z===0?1:0;M.availableZ.includes(T)&&n.push({type:"change_layer",newZ:T,segmentPointIds:[s]})}}return n}computeG(e){let{issues:t,originalCandidate:n,operationsPerformed:o,operation:r}=e,i=new Map;for(let c of t){i.has(c.capacityMeshNodeId)||i.set(c.capacityMeshNodeId,{numTransitionCrossings:0,numSameLayerCrossings:0,numEntryExitLayerChanges:0});let l=i.get(c.capacityMeshNodeId);c.type==="transition_via"?l.numTransitionCrossings++:c.type==="same_layer_crossing"?l.numSameLayerCrossings++:c.type==="double_transition_crossing"||c.type==="single_transition_crossing"?l.numEntryExitLayerChanges++:c.type}let s=0;for(let[c,{numEntryExitLayerChanges:l,numSameLayerCrossings:h,numTransitionCrossings:d}]of i){let u=this.nodeMap.get(c),_=Math.min(ex(u,h,l,d),0.999999);s+=Math.log(1-_)}var a;return(a=s)<-Math.LN2?Math.log(1-Math.exp(a)):Math.log(-Math.expm1(a))}getUnexploredNeighborByApplyingOperation(e,t){let n=new Map(e.pointModifications);tin(n,t,(a)=>this.getPointInCandidate(e,a));let o=KKe(n);if(this.queuedOrExploredCandidatePointModificationHashes.has(o))return null;let r=W3e(this.unravelSection,this.nodeMap,n),i=e.operationsPerformed+1,s=this.computeG({issues:r,originalCandidate:e,operationsPerformed:i,operation:t});return{issues:r,g:s,h:0,f:s,pointModifications:n,candidateHash:o,operationsPerformed:i}}getNeighborOperationsForCandidate(e){return e.issues.flatMap((t)=>this.getOperationsForIssue(e,t))}getNeighbors(e){let t=[],n=this.getNeighborOperationsForCandidate(e);for(let o of n){let r=this.getUnexploredNeighborByApplyingOperation(e,o);r&&t.push(r)}return t}_step(){let e=this.candidates.shift();this.iterationsSinceImprovement++,this.iterationsSinceImprovement>this.hyperParameters.MAX_ITERATIONS_WITHOUT_IMPROVEMENT?this.solved=!0:e?(this.lastProcessedCandidate=e,e.f<(this.bestCandidate?.f??1/0)&&(this.bestCandidate=e,this.iterationsSinceImprovement=0),this.getNeighbors(e).forEach((t)=>{this.queuedOrExploredCandidatePointModificationHashes.has(t.candidateHash)||(this.queuedOrExploredCandidatePointModificationHashes.add(t.candidateHash),this.candidates.push(t))}),this.candidates.sort((t,n)=>t.f-n.f),this.candidates.length=Math.min(this.candidates.length,this.MAX_CANDIDATES)):this.solved=!0}visualize(){let e={points:[],lines:[],rects:[],circles:[],coordinateSystem:"cartesian",title:"Unravel Section Solver"},t=null;if(t=this.selectedCandidateIndex!==null?this.selectedCandidateIndex==="best"?this.bestCandidate:this.selectedCandidateIndex==="original"?this.originalCandidate:this.candidates[this.selectedCandidateIndex]:this.solved?this.bestCandidate:this.lastProcessedCandidate||this.candidates[0],!t)return e;let n=new Map;for(let[r,i]of this.unravelSection.segmentPointMap){let s={...i},a=t.pointModifications.get(r);a&&(a.x!==void 0&&(s.x=a.x),a.y!==void 0&&(s.y=a.y),a.z!==void 0&&(s.z=a.z)),n.set(r,s)}for(let[r,i]of n)e.points.push({x:i.x,y:i.y,label:`${r}
Segment: ${i.segmentId} ${this.unravelSection.mutableSegmentIds.has(i.segmentId)?"MUTABLE":"IMMUTABLE"}
Layer: ${i.z}`,color:this.colorMap[i.connectionName]||"#000"});let o=new Map;for(let r of this.unravelSection.allNodeIds)o.set(r,{numTransitionCrossings:0,numSameLayerCrossings:0,numEntryExitLayerChanges:0,estPf:0});for(let r of t.issues){let i=o.get(r.capacityMeshNodeId);r.type==="transition_via"?i.numTransitionCrossings++:r.type==="same_layer_crossing"?i.numSameLayerCrossings++:r.type!=="double_transition_crossing"&&r.type!=="single_transition_crossing"||i.numEntryExitLayerChanges++}for(let[r,i]of o.entries()){let s=this.nodeMap.get(r);i.estPf=ex(s,i.numSameLayerCrossings,i.numEntryExitLayerChanges,i.numTransitionCrossings)}for(let r of this.unravelSection.allNodeIds){let i=this.nodeMap.get(r),s=this.unravelSection.mutableNodeIds.includes(r),a=o.get(r),c=[`${r} (${s?"MUT":"IMM"})`,`${i.width.toFixed(2)}x${i.height.toFixed(2)}`,`Pf: ${a.estPf.toFixed(3)}`,`TC: ${a.numTransitionCrossings}`,`SLC: ${a.numSameLayerCrossings}`,`EELC: ${a.numEntryExitLayerChanges}`].join(`
`);e.rects.push({center:i.center,label:c,color:s?"green":"red",width:i.width/8,height:i.height/8})}for(let[r,i]of this.unravelSection.segmentPointsInSegment){if(i.length<=1)continue;let s=i.map((a)=>n.get(a));for(let a=0;a<s.length-1;a++)e.lines.push({points:[{x:s[a].x,y:s[a].y},{x:s[a+1].x,y:s[a+1].y}],strokeColor:this.colorMap[r]||"#000"})}for(let[r,i]of n)for(let s of i.directlyConnectedSegmentPointIds)if(r<s){let a=n.get(s);if(!a)continue;let c=i.z===a.z,l=i.z,h;h=c?l===0?void 0:"10 5":"3 3 10",e.lines.push({points:[{x:i.x,y:i.y},{x:a.x,y:a.y}],strokeDash:h,strokeColor:this.colorMap[i.connectionName]||"#000"})}for(let r of t.issues){let i=this.nodeMap.get(r.capacityMeshNodeId);if(r.type==="transition_via")for(let s of r.segmentPoints){let a=n.get(s);e.circles.push({center:{x:a.x,y:a.y},radius:i.width/16,stroke:"#ff0000",fill:"rgba(255, 0, 0, 0.2)",label:`Via Issue
${s}
Layer: ${a.z}`})}else if(r.type==="same_layer_crossing")for(let[s,a]of[r.crossingLine1,r.crossingLine2]){let c=n.get(s),l=n.get(a);e.lines.push({points:[{x:c.x,y:c.y},{x:l.x,y:l.y}],strokeColor:"rgba(255,0,0,0.2)",strokeWidth:i.width/32})}}for(let[r,i]of t.pointModifications){let s=n.get(r),a=this.unravelSection.segmentPointMap.get(r);e.circles.push({center:{x:s.x,y:s.y},radius:0.05,stroke:"#0000ff",fill:"rgba(0, 0, 255, 0.2)",label:`${r}
Original: (${a.x.toFixed(2)}, ${a.y.toFixed(2)}, ${a.z})
New: (${s.x.toFixed(2)}, ${s.y.toFixed(2)}, ${s.z})`})}return e}},W4e=(e)=>(Math.round(20*e)/20).toFixed(2),Uzt=(e)=>(Math.round(1000*e)/1000).toFixed(3);_be();var Eyr=class extends Pyr{cacheHit=!1;cacheProvider;hasAttemptedToUseCache=!1;constructor(e){super(e),this.cacheProvider=e.cacheProvider===void 0?vpr():e.cacheProvider}_step(){!this.hasAttemptedToUseCache&&this.cacheProvider&&this.attemptToUseCacheSync()||(super._step(),(this.solved||this.failed)&&this.cacheProvider&&this.saveToCacheSync())}computeCacheKeyAndTransform(){let e=this.nodeMap.get(this.rootNodeId),t=DV(-e.center.x,-e.center.y),n=new Map,o=new Map,r=new Map,i=new Map,s=new Map,a=new Map,c=0,l=0,h=0,d=[...this.unravelSection.allNodeIds].sort((f,y)=>{let x=this.nodeMap.get(f),C=this.nodeMap.get(y);return x.center.x!==C.center.x?x.center.x-C.center.x:x.center.y-C.center.y});for(let f of d){let y="node_"+c++;n.set(f,y),o.set(y,f)}let u=[...Array.from(this.unravelSection.segmentPointMap.entries()).sort(([,f],[,y])=>f.x!==y.x?f.x-y.x:f.y-y.y).map(([f])=>f)].sort();for(let f of u){let y="sp_"+h++;s.set(f,y),a.set(y,f);let x=this.unravelSection.segmentPointMap.get(f).segmentId;if(!r.has(x)){let C="seg_"+l++;r.set(x,C),i.set(C,x)}}let _={};for(let[f,y]of n.entries()){let x=this.nodeMap.get(f),C=oB(t,x.center);_[y]={width:x.width,height:x.height,availableZ:x.availableZ,center:{x:W4e(C.x),y:W4e(C.y)}}}let p={};for(let[f,y]of s.entries()){let x=this.unravelSection.segmentPointMap.get(f),C=oB(t,{x:x.x,y:x.y});p[y]={x:W4e(C.x),y:W4e(C.y),z:x.z}}let m={hyperParameters:this.hyperParameters,normalizedNodes:_,normalizedSegmentPoints:p,mutableHops:this.MUTABLE_HOPS},A=`unravelsec:${oin.default(m)}`,g={realToCacheTransform:t,nodeIdMap:n,segmentIdMap:r,segmentPointIdMap:s,reverseNodeIdMap:o,reverseSegmentIdMap:i,reverseSegmentPointIdMap:a};return this.cacheKey=A,this.cacheToSolveSpaceTransform=g,{cacheKey:A,cacheToSolveSpaceTransform:g}}applyCachedSolution(e){if(e.success===!1)return void(this.failed=!0);if(!this.cacheToSolveSpaceTransform)return void console.error("Cache transform not available to apply cached solution.");let{reverseSegmentPointIdMap:t,reverseNodeIdMap:n}=this.cacheToSolveSpaceTransform,o=new Map;for(let[i,s]of e.bestCandidatePointModificationsDelta){let a=t.get(i);if(!a){console.warn(`Could not find original ID for normalized SP ID: ${i} when applying cache.`);continue}let c=this.unravelSection.segmentPointMap.get(a);if(!c){console.warn(`Could not find original segment point for ID: ${a} when applying cache.`);continue}let l={};if(s.dx!==void 0){let h=parseFloat(s.dx);Number.isNaN(h)?console.warn(`Failed to parse cached dx coordinate: ${s.dx}`):l.x=c.x+h}if(s.dy!==void 0){let h=parseFloat(s.dy);Number.isNaN(h)?console.warn(`Failed to parse cached dy coordinate: ${s.dy}`):l.y=c.y+h}s.dz!==void 0&&(l.z=c.z+s.dz),Object.keys(l).length>0&&o.set(a,l)}let r=W3e(this.unravelSection,this.nodeMap,o);this.bestCandidate={pointModifications:o,issues:r,f:e.bestCandidateF,g:e.bestCandidateF,h:0,operationsPerformed:-1,candidateHash:KKe(o)},this.cacheHit=!0,this.solved=!0}attemptToUseCacheSync(){if(this.hasAttemptedToUseCache=!0,!this.cacheProvider?.isSyncCache)return console.log("Cache provider is not synchronous, skipping sync cache check."),!1;if(this.cacheKey||this.computeCacheKeyAndTransform(),!this.cacheKey)return console.error("Failed to compute cache key."),!1;try{let e=this.cacheProvider.getCachedSolutionSync(this.cacheKey);if(e)return this.applyCachedSolution(e),!0}catch(e){console.error("Error attempting to use cache:",e)}return!1}saveToCacheSync(){if(this.failed)return void this.cacheProvider?.setCachedSolutionSync(this.cacheKey,{success:!1});if(!this.bestCandidate)return;let{segmentPointIdMap:e}=this.cacheToSolveSpaceTransform,t=[];for(let[o,r]of this.bestCandidate.pointModifications.entries()){let i=e.get(o);if(!i){console.warn(`Could not find normalized ID for original SP ID: ${o} when saving to cache.`);continue}let s=this.unravelSection.segmentPointMap.get(o);if(!s){console.warn(`Could not find original segment point for ID: ${o} when saving cache.`);continue}let a={},c=!1;if(r.x!==void 0){let l=r.x-s.x,h=Uzt(l);parseFloat(h)!==0&&(a.dx=h,c=!0)}if(r.y!==void 0){let l=r.y-s.y,h=Uzt(l);parseFloat(h)!==0&&(a.dy=h,c=!0)}if(r.z!==void 0){let l=r.z-s.z;l!==0&&(a.dz=l,c=!0)}c&&t.push([i,a])}let n={success:!0,bestCandidatePointModificationsDelta:t,bestCandidateF:this.bestCandidate.f};this.cacheProvider?.setCachedSolutionSync(this.cacheKey,n)}},Myr=class extends ei{getSolverName(){return"UnravelMultiSectionSolver"}nodeMap;dedupedSegmentMap;dedupedSegments;nodeIdToSegmentIds;segmentIdToNodeIds;nodeToSegmentPointMap;segmentToSegmentPointMap;colorMap;tunedNodeCapacityMap;MAX_NODE_ATTEMPTS=2;MUTABLE_HOPS=1;ACCEPTABLE_PF=0.05;MAX_ITERATIONS_WITHOUT_IMPROVEMENT=200;nodePfMap;attemptsToFixNode;activeSubSolver=null;segmentPointMap;cacheProvider=null;constructor({assignedSegments:e,colorMap:t,nodes:n,cacheProvider:o}){super(),this.stats.successfulOptimizations=0,this.stats.failedOptimizations=0,this.stats.cacheHits=0,this.stats.cacheMisses=0,this.cacheProvider=o??null,this.MAX_ITERATIONS=1e6,this.dedupedSegments=((a)=>{let c=[],l=new Map,h=-1;for(let d of a){let u=`${d.start.x}-${d.start.y}-${d.end.x}-${d.end.y}-${d.availableZ.join(",")}`,_=l.get(u);_?d.nodePortSegmentId=_.nodePortSegmentId:(h++,d.nodePortSegmentId=`SEG${h}`,l.set(u,d),c.push(d))}return c})(e),this.dedupedSegmentMap=new Map;for(let a of this.dedupedSegments)this.dedupedSegmentMap.set(a.nodePortSegmentId,a);this.nodeMap=new Map;for(let a of n)this.nodeMap.set(a.capacityMeshNodeId,a);this.nodeIdToSegmentIds=new Map,this.segmentIdToNodeIds=new Map,this.attemptsToFixNode=new Map;for(let a of e)this.segmentIdToNodeIds.set(a.nodePortSegmentId,[...this.segmentIdToNodeIds.get(a.nodePortSegmentId)??[],a.capacityMeshNodeId]),this.nodeIdToSegmentIds.set(a.capacityMeshNodeId,[...this.nodeIdToSegmentIds.get(a.capacityMeshNodeId)??[],a.nodePortSegmentId]);this.colorMap=t??{},this.tunedNodeCapacityMap=new Map;for(let[a,c]of this.nodeMap)this.tunedNodeCapacityMap.set(a,tP(c));let{segmentPointMap:r,nodeToSegmentPointMap:i,segmentToSegmentPointMap:s}=nin(this.dedupedSegments,this.segmentIdToNodeIds);this.segmentPointMap=r,this.nodeToSegmentPointMap=i,this.segmentToSegmentPointMap=s,this.nodePfMap=this.computeInitialPfMap()}computeInitialPfMap(){let e=new Map;for(let[t,n]of this.nodeMap.entries())e.set(t,this.computeNodePf(n));return e}computeNodePf(e){let{numSameLayerCrossings:t,numEntryExitLayerChanges:n,numTransitionCrossings:o}=((r)=>{let i=0,s=0,a=0,c=new Map;for(let d of r)c.has(d.connectionName)||c.set(d.connectionName,[]),c.get(d.connectionName).push(d);let l=[],h=[];for(let[d,u]of c.entries()){if(u.length<2)continue;let _=u[0];for(let p=1;p<u.length;p++){let m=u[p],A={connectionName:d,z:_.z,points:[_,m]};_.z!==m.z?(s++,h.push({connectionName:d,points:[_,m]})):l.push(A)}}for(let d=0;d<l.length;d++)for(let u=d+1;u<l.length;u++){let _=l[d],p=l[u];_.z===p.z&&Ru(_.points[0],_.points[1],p.points[0],p.points[1])&&i++}for(let d=0;d<h.length;d++)for(let u=d+1;u<h.length;u++){let _=h[d],p=h[u];Ru(_.points[0],_.points[1],p.points[0],p.points[1])&&a++}for(let d=0;d<h.length;d++)for(let u=0;u<l.length;u++){let _=h[d],p=l[u];Ru(_.points[0],_.points[1],p.points[0],p.points[1])&&a++}return{numSameLayerCrossings:i,numEntryExitLayerChanges:s,numTransitionCrossings:a}})((this.nodeToSegmentPointMap.get(e.capacityMeshNodeId)??[]).map((r)=>this.segmentPointMap.get(r)));return ex(e,t,n,o)}_step(){if(this.iterations>=this.MAX_ITERATIONS-1)return void(this.solved=!0);if(!this.activeSubSolver){let o=null,r=0;for(let[i,s]of this.nodePfMap.entries())s*(1-(this.attemptsToFixNode.get(i)??0)/this.MAX_NODE_ATTEMPTS)>r&&(r=s,o=i);if(!o||r<this.ACCEPTABLE_PF)return void(this.solved=!0);this.attemptsToFixNode.set(o,(this.attemptsToFixNode.get(o)??0)+1),this.activeSubSolver=new Eyr({dedupedSegments:this.dedupedSegments,dedupedSegmentMap:this.dedupedSegmentMap,nodeMap:this.nodeMap,nodeIdToSegmentIds:this.nodeIdToSegmentIds,segmentIdToNodeIds:this.segmentIdToNodeIds,colorMap:this.colorMap,rootNodeId:o,MUTABLE_HOPS:this.MUTABLE_HOPS,segmentPointMap:this.segmentPointMap,nodeToSegmentPointMap:this.nodeToSegmentPointMap,segmentToSegmentPointMap:this.segmentToSegmentPointMap,cacheProvider:this.cacheProvider})}this.activeSubSolver.step();let{bestCandidate:e,originalCandidate:t,lastProcessedCandidate:n}=this.activeSubSolver;if(this.activeSubSolver.failed)return this.stats.failedOptimizations+=1,void(this.activeSubSolver=null);if(this.activeSubSolver.solved){if(this.activeSubSolver.cacheHit?this.stats.cacheHits+=1:this.stats.cacheMisses+=1,e&&e.g<t.g){this.stats.successfulOptimizations+=1;for(let[o,r]of e.pointModifications.entries()){let i=this.segmentPointMap.get(o);i.x=r.x??i.x,i.y=r.y??i.y,i.z=r.z??i.z}for(let o of this.activeSubSolver.unravelSection.allNodeIds)this.nodePfMap.set(o,this.computeNodePf(this.nodeMap.get(o)))}else this.stats.failedOptimizations+=1;this.activeSubSolver=null}}visualize(){if(this.activeSubSolver)return this.activeSubSolver.visualize();let e={lines:[],points:[],rects:[],circles:[],coordinateSystem:"cartesian",title:"Unravel Multi Section Solver"};for(let[r,i]of this.nodeMap.entries()){let s=this.nodePfMap.get(r)||0,a=Math.min(s,1),c=`rgb(${Math.floor(255*a)}, ${Math.floor(255*(1-a))}, 0)`;(this.attemptsToFixNode.get(r)??0)===0&&a===0||e.rects.push({center:i.center,label:[r,`${i.width.toFixed(2)}x${i.height.toFixed(2)}`,`Pf: ${s.toFixed(3)}`].join(`
`),color:c,width:i.width/8,height:i.height/8})}for(let r of this.segmentPointMap.values()){let i=this.dedupedSegmentMap.get(r.segmentId);e.points.push({x:r.x,y:r.y,label:[r.segmentPointId,r.segmentId,`z: ${r.z}`,`segment.availableZ: ${i?.availableZ.join(",")}`].join(`
`),color:this.colorMap[r.connectionName]||"#000"})}let t=new Map;for(let r of this.segmentPointMap.values())t.has(r.segmentId)||t.set(r.segmentId,[]),t.get(r.segmentId).push(r);for(let[r,i]of t.entries()){if(i.length<2)continue;let s=[...i].sort((a,c)=>a.x!==c.x?a.x-c.x:a.y-c.y);for(let a=0;a<s.length-1;a++)e.lines.push({points:[{x:s[a].x,y:s[a].y},{x:s[a+1].x,y:s[a+1].y}],strokeColor:this.colorMap[r]||"#000"})}let n=new Set,o=Array.from(this.segmentPointMap.values());for(let r=0;r<o.length;r++){let i=o[r];for(let s=r+1;s<o.length;s++){let a=o[s];if(i.connectionName!==a.connectionName||i.segmentId===a.segmentId)continue;if(i.capacityMeshNodeIds.some((c)=>a.capacityMeshNodeIds.includes(c))){let c=`${i.segmentPointId}-${a.segmentPointId}`;if(n.has(c))continue;n.add(c);let l=i.z===a.z,h=i.z,d;d=l?h===0?void 0:"10 5":"3 3 10",e.lines.push({points:[{x:i.x,y:i.y},{x:a.x,y:a.y}],strokeDash:d,strokeColor:this.colorMap[i.connectionName]||"#666"})}}}return e}getNodesWithPortPoints(){if(!this.solved)throw Error("CapacitySegmentToPointSolver not solved, can't give port points yet");let e=new Map;for(let t of this.dedupedSegments){let n=t.nodePortSegmentId;for(let o of this.segmentIdToNodeIds.get(n)){let r=this.nodeMap.get(o);e.has(o)||e.set(o,{capacityMeshNodeId:o,portPoints:[],center:r.center,width:r.width,height:r.height})}}for(let t of this.segmentPointMap.values())for(let n of t.capacityMeshNodeIds){let o=e.get(n);o&&o.portPoints.push({x:t.x,y:t.y,z:t.z,connectionName:t.connectionName,rootConnectionName:t.rootConnectionName})}return Array.from(e.values())}};function f5(e,t,n,o={}){return{solverName:e,solverClass:t,getConstructorParams:n,onSolved:o.onSolved}}var rin=class extends ei{constructor(e,t={}){super(),this.srj=e,this.opts=t,this.srj=e,this.opts={...t},this.MAX_ITERATIONS=1e8,this.viaDiameter=rm(e).padDiameter,this.minTraceWidth=e.minTraceWidth;let n=this.opts;if(n.capacityDepth===void 0){let o=e.bounds.maxX-e.bounds.minX,r=e.bounds.maxY-e.bounds.minY,i=Math.max(o,r),s=n.targetMinCapacity??0.5;n.capacityDepth=ik(i,s)}this.connMap=im(e),this.colorMap=JA(e,this.connMap),this.cacheProvider=n.cacheProvider===void 0?hv():n.cacheProvider===null?null:n.cacheProvider,this.startTimeOfPhase={},this.endTimeOfPhase={},this.timeSpentOnPhase={}}srj;opts;getSolverName(){return"AutoroutingPipeline1_OriginalUnravel"}netToPointPairsSolver;nodeSolver;nodeTargetMerger;edgeSolver;initialPathingSolver;pathingOptimizer;edgeToPortSegmentSolver;colorMap;segmentToPointSolver;unravelMultiSectionSolver;segmentToPointOptimizer;highDensityRouteSolver;highDensityStitchSolver;singleLayerNodeMerger;strawSolver;deadEndSolver;traceSimplificationSolver;viaDiameter;minTraceWidth;startTimeOfPhase;endTimeOfPhase;timeSpentOnPhase;activeSubSolver=null;connMap;srjWithPointPairs;capacityNodes=null;capacityEdges=null;cacheProvider=null;pipelineDef=[f5("netToPointPairsSolver",Vq,(e)=>[e.srj,e.colorMap,nk(e.srj)],{onSolved:(e)=>{e.srjWithPointPairs=e.netToPointPairsSolver?.getNewSimpleRouteJson(),e.colorMap=JA(e.srjWithPointPairs,this.connMap),e.connMap=im(e.srjWithPointPairs)}}),f5("nodeSolver",dyr,(e)=>[e.netToPointPairsSolver?.getNewSimpleRouteJson()||e.srj,e.opts],{onSolved:(e)=>{e.capacityNodes=e.nodeSolver?.finishedNodes}}),f5("singleLayerNodeMerger",Iyr,(e)=>[e.nodeSolver?.finishedNodes],{onSolved:(e)=>{e.capacityNodes=e.singleLayerNodeMerger?.newNodes}}),f5("strawSolver",vyr,(e)=>[{nodes:e.singleLayerNodeMerger?.newNodes}],{onSolved:(e)=>{e.capacityNodes=e.strawSolver?.getResultNodes()}}),f5("edgeSolver",ok,(e)=>[e.capacityNodes],{onSolved:(e)=>{e.capacityEdges=e.edgeSolver?.edges}}),f5("deadEndSolver",Cyr,(e)=>[{nodes:e.capacityNodes,edges:e.capacityEdges}],{onSolved:(e)=>{let t=e.deadEndSolver?.removedNodeIds;e.capacityNodes=e.capacityNodes.filter((n)=>!t.has(n.capacityMeshNodeId)),e.capacityEdges=e.capacityEdges.filter((n)=>n.nodeIds.every((o)=>!t.has(o)))}}),f5("initialPathingSolver",Zrn,(e)=>[{simpleRouteJson:e.srjWithPointPairs,nodes:e.capacityNodes,edges:e.capacityEdges||[],colorMap:e.colorMap,hyperParameters:{MAX_CAPACITY_FACTOR:1}}]),f5("pathingOptimizer",xyr,(e)=>[{initialPathingSolver:e.initialPathingSolver,simpleRouteJson:e.srjWithPointPairs,nodes:e.capacityNodes,edges:e.capacityEdges||[],colorMap:e.colorMap,cacheProvider:e.cacheProvider,hyperParameters:{MAX_CAPACITY_FACTOR:1}}]),f5("edgeToPortSegmentSolver",syr,(e)=>[{nodes:e.capacityNodes,edges:e.capacityEdges||[],capacityPaths:e.pathingOptimizer?.getCapacityPaths()||[],colorMap:e.colorMap}]),f5("segmentToPointSolver",uyr,(e)=>{let t=[];return e.edgeToPortSegmentSolver?.nodePortSegments&&e.edgeToPortSegmentSolver.nodePortSegments.forEach((n)=>{t.push(...n)}),[{segments:t,colorMap:e.colorMap,nodes:e.capacityNodes}]}),f5("unravelMultiSectionSolver",Myr,(e)=>[{assignedSegments:e.segmentToPointSolver?.solvedSegments||[],colorMap:e.colorMap,nodes:e.capacityNodes,cacheProvider:this.cacheProvider}]),f5("highDensityRouteSolver",cY,(e)=>[{nodePortPoints:e.unravelMultiSectionSolver?.getNodesWithPortPoints()??e.segmentToPointOptimizer?.getNodesWithPortPoints()??[],colorMap:e.colorMap,connMap:e.connMap,viaDiameter:e.viaDiameter,traceWidth:e.minTraceWidth}]),f5("highDensityStitchSolver",byr,(e)=>[{connections:e.srjWithPointPairs.connections,hdRoutes:e.highDensityRouteSolver.routes,colorMap:e.colorMap,layerCount:e.srj.layerCount,defaultViaDiameter:e.viaDiameter}]),f5("traceSimplificationSolver",s6,(e)=>[{hdRoutes:e.highDensityStitchSolver.mergedHdRoutes,obstacles:e.srj.obstacles,connMap:e.connMap,colorMap:e.colorMap,outline:e.srj.outline,defaultViaDiameter:e.viaDiameter,layerCount:e.srj.layerCount}])];getConstructorParams(){return[this.srj,this.opts]}currentPipelineStepIndex=0;_step(){let e=this.pipelineDef[this.currentPipelineStepIndex];if(!e)return void(this.solved=!0);if(this.activeSubSolver)return this.activeSubSolver.step(),void(this.activeSubSolver.solved?(this.endTimeOfPhase[e.solverName]=performance.now(),this.timeSpentOnPhase[e.solverName]=this.endTimeOfPhase[e.solverName]-this.startTimeOfPhase[e.solverName],e.onSolved?.(this),this.activeSubSolver=null,this.currentPipelineStepIndex++):this.activeSubSolver.failed&&(this.error=this.activeSubSolver?.error,this.failed=!0,this.activeSubSolver=null));let t=e.getConstructorParams(this);this.activeSubSolver=new e.solverClass(...t),this[e.solverName]=this.activeSubSolver,this.timeSpentOnPhase[e.solverName]=0,this.startTimeOfPhase[e.solverName]=performance.now()}solveUntilPhase(e){for(;this.getCurrentPhase()!==e;)this.step()}getCurrentPhase(){return this.pipelineDef[this.currentPipelineStepIndex]?.solverName??"none"}visualize(){if(!this.solved&&this.activeSubSolver)return this.activeSubSolver.visualize();let e=this.netToPointPairsSolver?.visualize(),t=this.nodeSolver?.visualize(),n=this.nodeTargetMerger?.visualize(),o=this.singleLayerNodeMerger?.visualize(),r=this.strawSolver?.visualize(),i=this.edgeSolver?.visualize(),s=this.deadEndSolver?.visualize(),a=this.initialPathingSolver?.visualize(),c=this.pathingOptimizer?.visualize(),l=this.edgeToPortSegmentSolver?.visualize(),h=this.segmentToPointSolver?.visualize(),d=this.unravelMultiSectionSolver?.visualize()??this.segmentToPointOptimizer?.visualize(),u=this.highDensityRouteSolver?.visualize(),_=this.highDensityStitchSolver?.visualize(),p=this.traceSimplificationSolver?.visualize(),m=this.srj.outline,A=[];if(A.push({points:[{x:this.srj.bounds?.minX??-50,y:this.srj.bounds?.minY??-50},{x:this.srj.bounds?.maxX??50,y:this.srj.bounds?.minY??-50},{x:this.srj.bounds?.maxX??50,y:this.srj.bounds?.maxY??50},{x:this.srj.bounds?.minX??-50,y:this.srj.bounds?.maxY??50},{x:this.srj.bounds?.minX??-50,y:this.srj.bounds?.minY??-50}],strokeColor:"rgba(255,0,0,0.25)"}),m&&m.length>=2){let x=m.map((C)=>({x:C.x,y:C.y}));x.push({...x[0]}),A.push({points:x,strokeColor:"rgba(0, 136, 255, 0.95)"})}let g=bB(this.srj),f={points:[...this.srj.connections.flatMap((x)=>x.pointsToConnect.map((C)=>({...C,layer:IB(C,this.srj.layerCount),label:`${x.name} ${C.pcb_port_id??""}`})))],rects:[...(this.srj.obstacles??[]).filter((x)=>!x.isCopperPour).map((x)=>({...x,fill:x.layers?.includes("top")?"rgba(255,0,0,0.25)":x.layers?.includes("bottom")?"rgba(0,0,255,0.25)":"rgba(255,0,0,0.25)",layer:$S(x,this.srj.layerCount),label:g(x)}))],lines:A},y=[f,e,t,n,o,r,i,s,a,c,l,h,d,u?Bl(f,u):null,_,p,this.solved?Bl({lines:A},rx(this.getOutputSimpleRouteJson())):null].filter(Boolean);return Bl(...y)}preview(){if(this.highDensityRouteSolver){let e=[];for(let t=this.highDensityRouteSolver.routes.length-1;t>=0;t--){let n=this.highDensityRouteSolver.routes[t];if(e.push({points:n.route.map((o)=>({x:o.x,y:o.y})),strokeColor:this.colorMap[n.connectionName]}),e.length>200)break}return{lines:e}}if(this.pathingOptimizer){let e=[];for(let t of this.pathingOptimizer.connectionsWithNodes)t.path&&e.push({points:t.path.map((n)=>({x:n.center.x,y:n.center.y})),strokeColor:this.colorMap[t.connection.name]});return{lines:e}}return this.netToPointPairsSolver?this.netToPointPairsSolver?.visualize():{}}_getOutputHdRoutes(){return this.traceSimplificationSolver?.simplifiedHdRoutes??this.highDensityStitchSolver.mergedHdRoutes}getOutputSimplifiedPcbTraces(){if(!this.solved||!this.highDensityRouteSolver)throw Error("Cannot get output before solving is complete");let e=[],t=this._getOutputHdRoutes();for(let n of this.netToPointPairsSolver?.newConnections??[]){let o=n.__netConnectionName??this.srj.connections.find((i)=>i.name===n.name)?.__netConnectionName,r=t.filter((i)=>i.connectionName===n.name);for(let i=0;i<r.length;i++){let s=r[i],a={type:"pcb_trace",pcb_trace_id:`${n.name}_${i}`,connection_name:o??n.__rootConnectionNames?.[0]??n.name,route:k3(s,this.srj.layerCount)};e.push(a)}}return e}getOutputSimpleRouteJson(){return{...this.srj,traces:this.getOutputSimplifiedPcbTraces()}}};function X4e(e){let{pos:t,segments:n,dir:o,keepoutRadius:r}=e,i=1/0,s=r/4,a={x:t.x-o.x*s,y:t.y-o.y*s},c={x:t.x+o.x*s,y:t.y+o.y*s};for(let l of n){let h=Q_(a,c,l.start,l.end);i=Math.min(i,h)}return i}function wyr(e,t,n,o){let r=j4e(n,o,e),i=j4e(n,o,t),s=j4e(e,t,n),a=j4e(e,t,o);if((r>0&&i<0||r<0&&i>0)&&(s>0&&a<0||s<0&&a>0))return!0;let c=0.0001;return!!(Math.abs(r)<c&&K4e(n,o,e))||(!!(Math.abs(i)<c&&K4e(n,o,t))||(!!(Math.abs(s)<c&&K4e(e,t,n))||!!(Math.abs(a)<c&&K4e(e,t,o))))}function j4e(e,t,n){return(n.x-e.x)*(t.y-e.y)-(t.x-e.x)*(n.y-e.y)}function K4e(e,t,n){return n.x>=Math.min(e.x,t.x)-0.0001&&n.x<=Math.max(e.x,t.x)+0.0001&&n.y>=Math.min(e.y,t.y)-0.0001&&n.y<=Math.max(e.y,t.y)+0.0001}function wXe(e,t,n){for(let o of n)if(wyr(e,t,o.start,o.end))return!1;return!0}var uQ=0.0001;function $Ke(e){let t=e.width/2,n=e.height/2,o=e.center.x,r=e.center.y,i={x:o-t,y:r+n},s={x:o+t,y:r+n},a={x:o-t,y:r-n},c={x:o+t,y:r-n};return[{start:i,end:s},{start:s,end:c},{start:c,end:a},{start:a,end:i}]}function Byr(e,t,n=0.1){let o=t.x-e.x,r=t.y-e.y,i=Math.sqrt(o*o+r*r);if(i===0)return[];let s=-(r/i),a=o/i,c=n/2;return[{start:{x:e.x+s*c,y:e.y+a*c},end:{x:t.x+s*c,y:t.y+a*c}},{start:{x:e.x-s*c,y:e.y-a*c},end:{x:t.x-s*c,y:t.y-a*c}}]}function Tyr(e,t,n){let o=Math.hypot(e.start.x-t.x,e.start.y-t.y),r=Math.hypot(e.end.x-t.x,e.end.y-t.y);if(o<=n||r<=n)return!0;let i=e.end.x-e.start.x,s=e.end.y-e.start.y,a=i*i+s*s;if(a===0)return!1;let c=Math.max(0,Math.min(1,((t.x-e.start.x)*i+(t.y-e.start.y)*s)/a)),l=e.start.x+c*i,h=e.start.y+c*s;return Math.hypot(l-t.x,h-t.y)<=n}function Dyr(e,t,n){if(!n||n.length===0)return!1;for(let o of n){let r=Math.abs(e.x-o.start.x)<uQ&&Math.abs(e.y-o.start.y)<uQ&&Math.abs(t.x-o.end.x)<uQ&&Math.abs(t.y-o.end.y)<uQ,i=Math.abs(e.x-o.end.x)<uQ&&Math.abs(e.y-o.end.y)<uQ&&Math.abs(t.x-o.start.x)<uQ&&Math.abs(t.y-o.start.y)<uQ;if(r||i)return!0}return!1}function Nyr(e,t,n,o,r){let i=[];for(let s=0;s<e.length-1;s++){let a=e[s],c=e[s+1];Dyr(a,c,r)||Tyr({start:a,end:c},n,o+t)&&i.push(...Byr(a,c,t))}return i}var $4e=0.0001;function Ryr(e,t,n,o){let r=t.x-e.x,i=t.y-e.y,s=o.x-n.x,a=o.y-n.y,c=r*a-i*s;if(Math.abs(c)<0.0000000001)return null;let l=n.x-e.x,h=n.y-e.y,d=(l*a-h*s)/c,u=(l*i-h*r)/c,_=0.000001;return d>_&&d<0.999999&&u>_&&u<0.999999?{x:e.x+d*r,y:e.y+d*i}:null}function Qyr(e,t){if(!t||t.length===0)return!1;for(let n of t)if(Math.abs(e.x-n.start.x)<$4e&&Math.abs(e.y-n.start.y)<$4e||Math.abs(e.x-n.end.x)<$4e&&Math.abs(e.y-n.end.y)<$4e)return!0;return!1}function kyr(e,t,n,o){if(!o||o.length===0)return!1;for(let r=t;r<=n;r++)if(r>=0&&r<e.length&&Qyr(e[r],o))return!0;return!1}var M3=0.0001,iin=class extends ei{constructor(e){super(),this.input=e;let t=e.srj?.layerCount??2;this.input={...e,obstacles:kq(e.obstacles,t)},this.MAX_ITERATIONS=1e6,this.originalHdRoutes=[...this.input.hdRoutes],this.hdRoutes=this.input.hdRoutes,this.KEEPOUT_RADIUS_SCHEDULE=e.keepoutRadiusSchedule??[0.3,0.5,0.5],this.currentKeepoutRadius=this.KEEPOUT_RADIUS_SCHEDULE[0]??0.15,this.unprocessedRoutes=[...this.hdRoutes],this.smoothedCursorRoutes=[...this.unprocessedRoutes];let n=[...this.input.obstacles,...this.getJumperPadObstacles()];this.obstacleSHI=new $be("flatbush",n),this.boardOutlineRoutes=this.createBoardOutlineRoutes(),this.hdRouteSHI=new rCe([...this.hdRoutes,...this.boardOutlineRoutes]);for(let[o,r,i]of this.hdRoutes.flatMap((s)=>[[s.route[0],s.connectionName,s.rootConnectionName],[s.route[s.route.length-1],s.connectionName,s.rootConnectionName]])){let s=this.obstacleSHI.searchArea(o.x,o.y,0.01,0.01).filter((c)=>c.__zLayers?.includes(o.z));if(s.length===0)continue;let a=s[0];this.input.connMap.addConnections([[r,i,...a.offBoardConnectsTo??[],a.obstacleId,...a.connectedTo].filter(Boolean)])}}input;getSolverName(){return"TraceKeepoutSolver"}originalHdRoutes;hdRoutes;redrawnHdRoutes=[];KEEPOUT_RADIUS_SCHEDULE;currentScheduleIndex=0;currentKeepoutRadius;unprocessedRoutes=[];smoothedCursorRoutes=[];processedRoutes=[];currentTrace=null;cursorPosition=null;lastCursorPosition=null;drawPosition=null;currentTraceSegmentIndex=0;currentTraceSegmentT=0;recordedDrawPositions=[];lastCollidingSegments=[];currentTraceJumperSegments=new Map;obstacleSHI;hdRouteSHI;boardOutlineRoutes=[];getSmoothDistance(){return this.currentKeepoutRadius}getJumperPadObstacles(){let e=[];if(!this.input.jumpers)return e;for(let t of this.input.jumpers)for(let n of t.pads)e.push({...n,__zLayers:[0]});return e}buildJumperSegmentMap(e){let t=new Map;if(!e.jumpers||e.jumpers.length===0)return t;let n=e.route;for(let o of e.jumpers){let r=-1,i=1/0;for(let s=0;s<n.length-1;s++){let a=n[s],c=n[s+1],l=Math.sqrt((a.x-o.start.x)**2+(a.y-o.start.y)**2),h=Math.sqrt((c.x-o.end.x)**2+(c.y-o.end.y)**2),d=l+h,u=Math.sqrt((a.x-o.end.x)**2+(a.y-o.end.y)**2),_=Math.sqrt((c.x-o.start.x)**2+(c.y-o.start.y)**2),p=u+_,m=Math.min(d,p);(d<=p?l:u)<1&&(d<=p?h:_)<1&&m<i&&(i=m,r=s)}r>=0&&t.set(r,o)}return t}_step(){if(!this.currentTrace){let r=this.unprocessedRoutes.shift();if(!r)return this.currentScheduleIndex++,this.currentScheduleIndex<this.KEEPOUT_RADIUS_SCHEDULE.length?(this.currentKeepoutRadius=this.KEEPOUT_RADIUS_SCHEDULE[this.currentScheduleIndex],this.unprocessedRoutes=e6([...this.processedRoutes],this.currentScheduleIndex),this.smoothedCursorRoutes=[...this.unprocessedRoutes],this.processedRoutes=[],void(this.hdRouteSHI=new rCe([...this.unprocessedRoutes,...this.boardOutlineRoutes]))):(this.redrawnHdRoutes=this.processedRoutes,void(this.solved=!0));if(this.currentTrace=r,this.currentTrace.route.length<2)return this.processedRoutes.push(this.currentTrace),void(this.currentTrace=null);this.currentTraceJumperSegments=this.buildJumperSegmentMap(this.currentTrace);let i=this.currentTrace.route[0];return this.cursorPosition={...i},this.lastCursorPosition={...i},this.drawPosition={x:i.x,y:i.y},this.currentTraceSegmentIndex=0,this.currentTraceSegmentT=0,void(this.recordedDrawPositions=[{...i}])}this.lastCursorPosition={...this.cursorPosition};let e=this.stepCursorForward();if(e==="end")return void this.finalizeCurrentTrace();if(e==="jumper")return void(this.drawPosition={x:this.cursorPosition.x,y:this.cursorPosition.y});let t=this.getCollidingSegments(this.cursorPosition);this.lastCollidingSegments=t;let n=function(r){let{cursorPosition:i,lastCursorPosition:s,collidingSegments:a,keepoutRadius:c}=r;if(a.length===0)return null;let l=0.0001,h=i.x-s.x,d=i.y-s.y,u=Math.sqrt(h*h+d*d),_=u>l?{x:h/u,y:d/u}:{x:1,y:0},p=-_.y,m=_.x,A=X4e({pos:i,segments:a,dir:_,keepoutRadius:c});if(A>=c)return null;for(let D=1;D<=20;D++){let L=D/20*c,H={x:i.x+p*L,y:i.y+m*L},V=X4e({pos:H,segments:a,dir:_,keepoutRadius:c}),O={x:i.x-p*L,y:i.y-m*L},U=X4e({pos:O,segments:a,dir:_,keepoutRadius:c}),j=V>=c&&wXe(i,H,a),Y=U>=c&&wXe(i,O,a);if(j&&Y)return V>=U?H:O;if(j)return H;if(Y)return O}let g=c,f=[];for(let D=-60;D<=60;D++){let L=D/60*g,H={x:i.x+p*L,y:i.y+m*L},V=X4e({pos:H,segments:a,dir:_,keepoutRadius:c}),O=wXe(i,H,a);f.push({pos:H,clearance:V,dist:Math.abs(L),pathClear:O,index:D})}let y=f.filter((D)=>D.pathClear),x=f.findIndex((D)=>D.index===0),C=x>=0?x:Math.floor(f.length/2),b=null;for(let D=C+1;D<f.length-1;D++){let L=f[D-1],H=f[D],V=f[D+1];if(H.clearance>=L.clearance&&H.clearance>=V.clearance){b=H;break}}let I=null;for(let D=C-1;D>0;D--){let L=f[D-1],H=f[D],V=f[D+1];if(H.clearance>=L.clearance&&H.clearance>=V.clearance){I=H;break}}let v=null,P=null;if(y.length>0){let D=y.findIndex((H)=>H.index===0),L=D>=0?D:Math.floor(y.length/2);for(let H=L+1;H<y.length-1;H++){let V=y[H-1],O=y[H],U=y[H+1];if(O.clearance>=V.clearance&&O.clearance>=U.clearance){v=O;break}}for(let H=L-1;H>0;H--){let V=y[H-1],O=y[H],U=y[H+1];if(O.clearance>=V.clearance&&O.clearance>=U.clearance){P=O;break}}}let M=[b,I,v,P,f.find((D)=>D.index===0)].filter((D)=>D!=null),B=new Set,T=M.filter((D)=>{let L=`${D.pos.x.toFixed(6)},${D.pos.y.toFixed(6)}`;return!B.has(L)&&(B.add(L),!0)});if(T.length===0){let D=f[0];if(!D)return null;for(let L of f)L.clearance>D.clearance&&(D=L);return Math.sqrt((D.pos.x-i.x)**2+(D.pos.y-i.y)**2)>l?D.pos:null}let N;if(A<0.15*c){N=T[0];for(let D of T)D.clearance>N.clearance&&(N=D)}else{let D=T.filter((H)=>H.pathClear),L=D.length>0?D:T;N=L[0];for(let H of L)H.clearance>N.clearance&&(N=H)}return Math.sqrt((N.pos.x-i.x)**2+(N.pos.y-i.y)**2)>l?N.pos:null}({cursorPosition:this.cursorPosition,lastCursorPosition:this.lastCursorPosition,collidingSegments:t,keepoutRadius:this.currentKeepoutRadius});this.drawPosition=n??{...this.cursorPosition};let o=this.recordedDrawPositions[this.recordedDrawPositions.length-1];if(o&&this.drawPosition){let r={x:o.x,y:o.y,z:o.z},i={x:this.drawPosition.x,y:this.drawPosition.y,z:this.cursorPosition.z};this.segmentIntersectsOtherRoutes(r,i)&&(this.drawPosition={...this.cursorPosition})}this.recordedDrawPositions.push({x:this.drawPosition.x,y:this.drawPosition.y,z:this.cursorPosition.z})}getStepDistance(){return this.currentKeepoutRadius/2}getJumperAtCurrentSegmentStart(){return this.currentTraceSegmentT>M3?null:this.currentTraceJumperSegments.get(this.currentTraceSegmentIndex)??null}stepCursorForward(){if(!this.currentTrace||!this.cursorPosition)return"end";let e=this.currentTrace.route,t=this.getStepDistance();for(;t>0;){if(this.currentTraceSegmentIndex>=e.length-1)return"end";let n=this.getJumperAtCurrentSegmentStart();if(n){let h=e[this.currentTraceSegmentIndex],d=e[this.currentTraceSegmentIndex+1],u=Math.sqrt((h.x-n.start.x)**2+(h.y-n.start.y)**2),_=Math.sqrt((h.x-n.end.x)**2+(h.y-n.end.y)**2),p=u<=_?n.start:n.end,m=u<=_?n.end:n.start;return this.recordedDrawPositions.push({x:p.x,y:p.y,z:h.z,insideJumperPad:!0}),this.recordedDrawPositions.push({x:m.x,y:m.y,z:d.z,insideJumperPad:!0}),this.cursorPosition={x:m.x,y:m.y,z:d.z},this.currentTraceSegmentIndex++,this.currentTraceSegmentT=0,"jumper"}let o=e[this.currentTraceSegmentIndex],r=e[this.currentTraceSegmentIndex+1],i=r.x-o.x,s=r.y-o.y,a=Math.sqrt(i*i+s*s);if(a===0){this.currentTraceSegmentIndex++,this.currentTraceSegmentT=0;continue}let c=this.currentTraceSegmentT*a,l=a-c;if(t<=l){let h=c+t;return this.currentTraceSegmentT=h/a,this.cursorPosition={x:o.x+i*this.currentTraceSegmentT,y:o.y+s*this.currentTraceSegmentT,z:o.z},"stepped"}if(t-=l,this.currentTraceSegmentIndex++,this.currentTraceSegmentT=0,this.currentTraceSegmentIndex>=e.length-1){let h=e[e.length-1];return this.cursorPosition={...h},"end"}}return"stepped"}getCollidingSegments(e){if(!this.currentTrace)return[];let t=this.currentTrace.rootConnectionName??this.currentTrace.connectionName,n=2*this.currentKeepoutRadius,o=[],r=this.obstacleSHI.searchArea(e.x,e.y,n,n).filter((s)=>s.__zLayers?.includes(e.z));for(let s of r){if(s.__zLayers&&!s.__zLayers.includes(e.z))continue;if(s.connectedTo.includes(t))continue;if(s.obstacleId&&this.input.connMap.areIdsConnected(t,s.obstacleId))continue;let a=!1;for(let c of s.connectedTo)if(this.input.connMap.areIdsConnected(t,c)){a=!0;break}a||o.push(...$Ke(s))}let i=this.hdRouteSHI.getConflictingRoutesNearPoint({x:e.x,y:e.y,z:e.z},n);for(let{conflictingRoute:s}of i){let a=s.rootConnectionName??s.connectionName;if(a===t)continue;if(this.input.connMap.areIdsConnected(t,a))continue;let c=s.traceThickness??0.15;o.push(...Nyr(s.route,c,{x:e.x,y:e.y},n,s.jumpers))}return o}positionHasCollision(e,t=0){let n=this.getCollidingSegments(e);for(let o of n)if(xc(e,o.start,o.end)<=this.currentKeepoutRadius+t)return!0;return!1}segmentIntersectsOtherRoutes(e,t){if(!this.currentTrace)return!1;let n=this.currentTrace.rootConnectionName??this.currentTrace.connectionName,o=[...this.unprocessedRoutes,...this.smoothedCursorRoutes,...this.processedRoutes];for(let r of o)if((r.rootConnectionName??r.connectionName)!==n)for(let i=0;i<r.route.length-1;i++){let s=r.route[i],a=r.route[i+1];if((s.z===e.z||a.z===e.z)&&((!s.insideJumperPad||!a.insideJumperPad)&&Ru({x:e.x,y:e.y},{x:t.x,y:t.y},{x:s.x,y:s.y},{x:a.x,y:a.y})))return!0}return!1}finalizeCurrentTrace(){if(!this.currentTrace)return;let e=this.currentTrace.route[this.currentTrace.route.length-1],t=this.recordedDrawPositions[this.recordedDrawPositions.length-1];t&&t.x===e.x&&t.y===e.y||this.recordedDrawPositions.push({...e});let n=function(r,i){if(r.length<4)return r;let s=[...r],a=!0;for(;a;){a=!1;for(let c=0;c<s.length-1&&!a;c++){let l=s[c],h=s[c+1];if(l.z===h.z)for(let d=c+2;d<s.length-1&&!a;d++){if(d===c+1)continue;let u=s[d],_=s[d+1];if(u.z!==_.z||l.z!==u.z)continue;let p=Ryr(l,h,u,_);if(p){if(kyr(s,c+1,d,i))continue;let m=[];for(let A=0;A<=c;A++)m.push(s[A]);m.push({x:p.x,y:p.y,z:l.z});for(let A=d+1;A<s.length;A++)m.push(s[A]);s=m,a=!0}}}}return s}(this.simplifyRoute(this.recordedDrawPositions,this.currentTrace.jumpers),this.currentTrace.jumpers),o={connectionName:this.currentTrace.connectionName,rootConnectionName:this.currentTrace.rootConnectionName,traceThickness:this.currentTrace.traceThickness,viaDiameter:this.currentTrace.viaDiameter,route:n,vias:[...this.currentTrace.vias],jumpers:this.currentTrace.jumpers};this.processedRoutes.push(o),this.hdRouteSHI.removeRoute(this.currentTrace.connectionName),this.hdRouteSHI.addRoute(o),this.currentTrace=null,this.cursorPosition=null,this.lastCursorPosition=null,this.drawPosition=null,this.recordedDrawPositions=[]}isJumperEndpoint(e,t){if(!t||t.length===0)return!1;for(let n of t)if(Math.abs(e.x-n.start.x)<M3&&Math.abs(e.y-n.start.y)<M3||Math.abs(e.x-n.end.x)<M3&&Math.abs(e.y-n.end.y)<M3)return!0;return!1}simplifyRoute(e,t){if(e.length<=2)return e;let n=[e[0]];for(let o=1;o<e.length-1;o++){let r=n[n.length-1],i=e[o],s=e[o+1];if(this.isJumperEndpoint(i,t)){n.push(i);continue}if(i.z!==r.z||i.z!==s.z){n.push(i);continue}let a=i.x-r.x,c=i.y-r.y,l=s.x-i.x,h=a*(s.y-i.y)-c*l,d=0.000001;Math.abs(h)>d&&n.push(i)}return n.push(e[e.length-1]),n}createBoardOutlineRoutes(){let e=[];if(!this.input.srj)return e;let{outline:t,bounds:n}=this.input.srj,o;o=t&&t.length>=3?t:[{x:n.minX,y:n.minY},{x:n.maxX,y:n.minY},{x:n.maxX,y:n.maxY},{x:n.minX,y:n.maxY}];let r=this.input.srj.layerCount??2;for(let i=0;i<o.length;i++){let s=o[i],a=o[(i+1)%o.length];for(let c=0;c<r;c++)e.push({connectionName:`__board_outline___${i}_z${c}`,traceThickness:0.01,viaDiameter:0,route:[{x:s.x,y:s.y,z:c},{x:a.x,y:a.y,z:c}],vias:[]})}return e}visualize(){let e={lines:[],points:[],rects:[],circles:[],coordinateSystem:"cartesian",title:`Trace Keepout Solver (radius: ${this.currentKeepoutRadius.toFixed(2)})`};for(let t of this.originalHdRoutes)if(t.route.length!==0)for(let n=0;n<t.route.length-1;n++){let o=t.route[n],r=t.route[n+1];o.z===r.z&&e.lines.push({points:[{x:o.x,y:o.y},{x:r.x,y:r.y}],strokeColor:"rgba(0,0,0,0.25)",strokeWidth:1.5*(t.traceThickness??0.15)})}if(this.input.jumpers)for(let t of this.input.jumpers){for(let n of t.pads){let o=n.connectedTo.length>0?n.connectedTo.join(", "):"unused",r=n.connectedTo.length>0?this.input.colorMap[n.connectedTo[0]]||"#888888":"rgba(128, 128, 128, 0.5)";e.rects.push({center:n.center,width:n.width,height:n.height,fill:r,stroke:"rgba(0, 0, 0, 0.5)",label:`Jumper pad (${o})`})}t.pads.length>=2&&e.lines.push({points:[t.pads[0].center,t.pads[1].center],strokeColor:"rgba(100, 100, 100, 0.8)",strokeWidth:0.2,label:"Jumper body"})}for(let t of this.input.obstacles){let n="rgba(128, 128, 128, 0.2)",o=t.__zLayers?.includes(0),r=t.__zLayers?.includes(1);o&&r?n="rgba(128, 0, 128, 0.2)":o?n="rgba(255, 0, 0, 0.2)":r&&(n="rgba(0, 0, 255, 0.2)"),e.rects.push({center:t.center,width:t.width,height:t.height,fill:n,label:`Obstacle (Z: ${t.__zLayers?.join(", ")})`})}if(this.input.srj){let{outline:t,bounds:n}=this.input.srj,o;o=t&&t.length>=3?t:[{x:n.minX,y:n.minY},{x:n.maxX,y:n.minY},{x:n.maxX,y:n.maxY},{x:n.minX,y:n.maxY}];for(let r=0;r<o.length;r++){let i=o[r],s=o[(r+1)%o.length];e.lines.push({points:[{x:i.x,y:i.y},{x:s.x,y:s.y}],strokeColor:"rgba(0, 128, 0, 0.6)",strokeWidth:0.1,label:"Board outline"})}}for(let t of this.processedRoutes){if(t.route.length===0)continue;let n=this.input.colorMap[t.connectionName]||"#888888",o=new Set;if(t.jumpers&&t.jumpers.length>0)for(let r of t.jumpers)for(let i=0;i<t.route.length-1;i++){let s=t.route[i],a=t.route[i+1],c=Math.abs(s.x-r.start.x)<M3&&Math.abs(s.y-r.start.y)<M3&&Math.abs(a.x-r.end.x)<M3&&Math.abs(a.y-r.end.y)<M3,l=Math.abs(s.x-r.end.x)<M3&&Math.abs(s.y-r.end.y)<M3&&Math.abs(a.x-r.start.x)<M3&&Math.abs(a.y-r.start.y)<M3;if(c||l){o.add(i);break}}for(let r=0;r<t.route.length-1;r++){let i=t.route[r],s=t.route[r+1];o.has(r)?e.lines.push({points:[{x:i.x,y:i.y},{x:s.x,y:s.y}],strokeColor:"rgba(128, 128, 128, 0.6)",strokeDash:"2 2",label:`${t.connectionName} (jumper segment - fixed)`}):i.z===s.z&&e.lines.push({points:[{x:i.x,y:i.y},{x:s.x,y:s.y}],strokeColor:i.z===0?"red":"blue",strokeWidth:t.traceThickness,label:`${t.connectionName} (z=${i.z})`})}for(let r of t.vias)e.circles.push({center:{x:r.x,y:r.y},radius:t.viaDiameter/2,fill:"rgba(255, 0, 255, 0.5)",label:`${t.connectionName} via`});if(t.jumpers&&t.jumpers.length>0){let r=lv(t.jumpers,{color:n,label:t.connectionName});e.rects.push(...r.rects??[]),e.lines.push(...r.lines??[])}}if(this.currentTrace&&this.recordedDrawPositions.length>0){this.input.colorMap[this.currentTrace.connectionName];for(let t=0;t<this.recordedDrawPositions.length-1;t++){let n=this.recordedDrawPositions[t],o=this.recordedDrawPositions[t+1];e.lines.push({points:[{x:n.x,y:n.y},{x:o.x,y:o.y}],strokeColor:"green",strokeWidth:this.currentTrace.traceThickness})}if(this.cursorPosition&&(e.circles.push({center:{x:this.cursorPosition.x,y:this.cursorPosition.y},radius:this.currentKeepoutRadius,stroke:"orange",fill:"none"}),e.points.push({x:this.cursorPosition.x,y:this.cursorPosition.y,color:"orange",label:"Cursor"}),this.lastCursorPosition)){let t=this.cursorPosition.x-this.lastCursorPosition.x,n=this.cursorPosition.y-this.lastCursorPosition.y,o=Math.sqrt(t*t+n*n),r=o>0.0001?{x:t/o,y:n/o}:{x:1,y:0},i=this.currentKeepoutRadius/4,s={x:this.cursorPosition.x-r.x*i,y:this.cursorPosition.y-r.y*i},a={x:this.cursorPosition.x+r.x*i,y:this.cursorPosition.y+r.y*i};e.lines.push({points:[s,a],strokeColor:"cyan",strokeWidth:0.05,label:"Projected segment"})}this.drawPosition&&e.points.push({x:this.drawPosition.x,y:this.drawPosition.y,color:"lime",label:"Draw"});for(let t of this.lastCollidingSegments)e.lines.push({points:[{x:t.start.x,y:t.start.y},{x:t.end.x,y:t.end.y}],strokeColor:"rgba(255, 0, 255, 0.8)",strokeWidth:0.02,label:"Colliding segment"})}if(!this.solved){for(let t of this.smoothedCursorRoutes)if(t.route.length!==0)for(let n=0;n<t.route.length-1;n++){let o=t.route[n],r=t.route[n+1];o.z===r.z&&e.lines.push({points:[{x:o.x,y:o.y},{x:r.x,y:r.y}],strokeColor:"gray"})}}return e}getRedrawnHdRoutes(){return this.redrawnHdRoutes}},sin=class extends ei{constructor(e){super(),this.input=e,this.unprocessedObstacles=kq(this.input.srj.obstacles,this.input.srj.layerCount).filter((t)=>t.offBoardConnectsTo&&t.offBoardConnectsTo.length>0),this.unprocessedObstacles.forEach((t,n)=>{t.obstacleId=t.obstacleId??`__obs${n}`}),this.offBoardConnMap=new SZe({}),this.offBoardConnMap.addConnections(this.unprocessedObstacles.filter((t)=>t.offBoardConnectsTo?.length).map((t)=>[t.obstacleId,...t.offBoardConnectsTo??[]])),this.nodeTree=new eqe(this.input.capacityMeshNodes)}input;getSolverName(){return"RelateNodesToOffBoardConnectionsSolver"}unprocessedObstacles;nodeTree;offBoardConnMap;nodesInNet=new Map;lastProcessedObstacle;_step(){let e=this.unprocessedObstacles.pop();if(this.lastProcessedObstacle=e,!e)return void(this.solved=!0);let t=this.offBoardConnMap.getNetConnectedToId(e.obstacleId),n=this.nodeTree.getNodesInArea(e.center.x,e.center.y,0.01,0.01).filter((s)=>s.availableZ.some((a)=>e.__zLayers?.includes(a))).filter((s)=>Math.abs(s.center.x-e.center.x)<0.01&&Math.abs(s.center.y-e.center.y)<0.01),o=n.map((s)=>s.capacityMeshNodeId),r=this.nodesInNet.get(t)??[],i=[...r.map((s)=>s.capacityMeshNodeId),...o];for(let s of r)s._offBoardConnectedCapacityMeshNodeIds=i;for(let s of n)s._offBoardConnectedCapacityMeshNodeIds=i,s._offBoardConnectionId=t;this.nodesInNet.set(t,[...r,...n])}getOutput(){return{capacityNodes:this.input.capacityMeshNodes}}visualize(){let e={rects:[],lines:[],points:[],circles:[]},t=new Set;for(let[n,o]of this.nodesInNet)for(let r of o)t.add(r.capacityMeshNodeId);for(let n of this.input.capacityMeshNodes)t.has(n.capacityMeshNodeId)||e.rects.push({center:n.center,width:n.width-0.1,height:n.height-0.1,fill:"rgba(0, 0, 0, 0.2)"});this.lastProcessedObstacle&&e.rects.push({center:this.lastProcessedObstacle.center,width:this.lastProcessedObstacle.width,height:this.lastProcessedObstacle.height,fill:"rgba(255, 0, 0, 0.5)"});for(let[n,o]of this.nodesInNet.entries()){for(let r of o)e.rects.push({center:r.center,width:r.width,height:r.height,fill:Oce(n,0.2),label:`OffBoardConn: ${n}`});for(let r of o)for(let i of o)r.capacityMeshNodeId!==i.capacityMeshNodeId&&e.lines.push({points:[r.center,i.center],strokeColor:Oce(n,1)})}return e}},q4e=0.1,J4e=0.1;function Z4e(e,t,n,o,r,i){return(r-e)*(o-t)-(i-t)*(n-e)}function e3e(e,t,n,o,r,i){return Math.min(e,n)<=r&&r<=Math.max(e,n)&&Math.min(t,o)<=i&&i<=Math.max(t,o)}function Lyr(e,t,n,o,r,i,s,a){let c=Z4e(r,i,s,a,e,t),l=Z4e(r,i,s,a,n,o),h=Z4e(e,t,n,o,r,i),d=Z4e(e,t,n,o,s,a);return(c>0&&l<0||c<0&&l>0)&&(h>0&&d<0||h<0&&d>0)||(!(c!==0||!e3e(r,i,s,a,e,t))||(!(l!==0||!e3e(r,i,s,a,n,o))||(!(h!==0||!e3e(e,t,n,o,r,i))||!(d!==0||!e3e(e,t,n,o,s,a)))))}function Hyr(e,t,n,o,r,i){let s=r-n,a=i-o,c=e-n,l=t-o,h=s*s+a*a;if(h===0)return{x:n,y:o,distSq:c*c+l*l};let d=(c*s+l*a)/h;d=Math.max(0,Math.min(1,d));let u=n+d*s,_=o+d*a,p=e-u,m=t-_;return{x:u,y:_,distSq:p*p+m*m}}var Fyr=class extends ei{getSolverName(){return"SimpleHighDensitySolver"}unsolvedNodes;allNodes;routes;colorMap;traceWidth;viaDiameter;numMovablePoints;currentNode=null;lastNode=null;currentNodeStep=0;routesInProgress=[];pushMargin;currentNodeBounds=null;constructor({nodePortPoints:e,colorMap:t,traceWidth:n=0.1,viaDiameter:o=0.3,pushMargin:r=0.3,numMovablePoints:i=2}){if(super(),i<1||i>3)throw Error(`numMovablePoints must be 1, 2, or 3, got ${i}`);this.allNodes=[...e],this.unsolvedNodes=[...e],this.colorMap=t??{},this.routes=[],this.traceWidth=n,this.viaDiameter=o,this.numMovablePoints=i,this.pushMargin=r,this.MAX_ITERATIONS=10*e.length+1}_step(){if(this.currentNode===null){if(this.unsolvedNodes.length===0)return void(this.solved=!0);this.lastNode=this.currentNode,this.currentNode=this.unsolvedNodes.pop(),this.currentNodeStep=0,this.routesInProgress=[],this._initializeRoutesForCurrentNode()}this.currentNodeStep>0&&this._runForceDirectedStep(),this.currentNodeStep++,this.currentNodeStep>=10&&(this._finalizeRoutesForCurrentNode(),this.lastNode=this.currentNode,this.currentNode=null)}_initializeRoutesForCurrentNode(){let e=this.currentNode,t=e.center.x-e.width/2,n=e.center.x+e.width/2,o=e.center.y-e.height/2,r=e.center.y+e.height/2;this.currentNodeBounds={minX:t,maxX:n,minY:o,maxY:r};let i=new Map;for(let s of e.portPoints)i.has(s.connectionName)||i.set(s.connectionName,[]),i.get(s.connectionName).push({x:s.x,y:s.y,z:s.z,rootConnectionName:s.rootConnectionName});for(let[s,a]of i){if(a.length<2)continue;let c=a[0],l=a[a.length-1],h=c.z,d=l.x-c.x,u=l.y-c.y,_=Math.sqrt(d*d+u*u),p=_>0?d/_:0,m=_>0?u/_:0,A=[];this.numMovablePoints>=1&&A.push({x:c.x+p*J4e,y:c.y+m*J4e,z:h,rootConnectionName:c.rootConnectionName,connectionName:s}),this.numMovablePoints>=2&&A.push({x:l.x-p*J4e,y:l.y-m*J4e,z:h,rootConnectionName:c.rootConnectionName,connectionName:s}),this.numMovablePoints>=3&&A.push({x:c.x+d/2,y:c.y+u/2,z:h,rootConnectionName:c.rootConnectionName,connectionName:s}),this.routesInProgress.push({connectionName:s,rootConnectionName:c.rootConnectionName,startPoint:{x:c.x,y:c.y,z:h},endPoint:{x:l.x,y:l.y,z:h},movablePoints:A})}}_runForceDirectedStep(){let e=this.currentNodeBounds,t=[];for(let a of this.routesInProgress)t.push(...a.movablePoints);let n=new Map;for(let a of t)n.set(a,{fx:0,fy:0});let o=0.3+this.pushMargin,r=new Map;for(let a of this.routesInProgress){let c=[{x:a.startPoint.x,y:a.startPoint.y,movablePoint:null}];a.movablePoints.length===1?c.push({x:a.movablePoints[0].x,y:a.movablePoints[0].y,movablePoint:a.movablePoints[0]}):a.movablePoints.length===2?(c.push({x:a.movablePoints[0].x,y:a.movablePoints[0].y,movablePoint:a.movablePoints[0]}),c.push({x:a.movablePoints[1].x,y:a.movablePoints[1].y,movablePoint:a.movablePoints[1]})):a.movablePoints.length===3&&(c.push({x:a.movablePoints[0].x,y:a.movablePoints[0].y,movablePoint:a.movablePoints[0]}),c.push({x:a.movablePoints[2].x,y:a.movablePoints[2].y,movablePoint:a.movablePoints[2]}),c.push({x:a.movablePoints[1].x,y:a.movablePoints[1].y,movablePoint:a.movablePoints[1]})),c.push({x:a.endPoint.x,y:a.endPoint.y,movablePoint:null}),r.set(a,c)}for(let a of t){let c=n.get(a),l=a.x-e.minX,h=e.maxX-a.x,d=e.maxY-a.y,u=a.y-e.minY;l<o&&(c.fx+=q4e*(o-l)),h<o&&(c.fx-=q4e*(o-h)),u<o&&(c.fy+=q4e*(o-u)),d<o&&(c.fy-=q4e*(o-d));for(let _ of this.routesInProgress){if(_.rootConnectionName===a.rootConnectionName)continue;let p=r.get(_);for(let m=0;m<p.length-1;m++){let A=p[m],g=p[m+1],f=Hyr(a.x,a.y,A.x,A.y,g.x,g.y),y=Math.sqrt(f.distSq);if(y>0&&y<2*o){let x=a.x-f.x,C=a.y-f.y,b=0.002/f.distSq,I=b*x,v=b*C;c.fx+=I,c.fy+=v;let P=A.movablePoint,M=g.movablePoint;if(P&&M){let B=n.get(P),T=n.get(M);B.fx-=I/2,B.fy-=v/2,T.fx-=I/2,T.fy-=v/2}else if(P){let B=n.get(P);B.fx-=I,B.fy-=v}else if(M){let B=n.get(M);B.fx-=I,B.fy-=v}}}}}let i=(a)=>a.movablePoint?{x:a.movablePoint.x,y:a.movablePoint.y}:{x:a.x,y:a.y},s=(a)=>{let c=null;for(let u of this.routesInProgress)if(u.movablePoints.includes(a)){c=u;break}if(!c)return!1;let l=r.get(c),h=-1;for(let u=0;u<l.length;u++)if(l[u].movablePoint===a){h=u;break}if(h===-1)return!1;let d=[];if(h>0){let u=i(l[h-1]);d.push({ax:u.x,ay:u.y,bx:a.x,by:a.y})}if(h<l.length-1){let u=i(l[h+1]);d.push({ax:a.x,ay:a.y,bx:u.x,by:u.y})}for(let u of this.routesInProgress){if(u.rootConnectionName===c.rootConnectionName)continue;let _=r.get(u);for(let p=0;p<_.length-1;p++){let m=i(_[p]),A=i(_[p+1]);for(let g of d)if(Lyr(g.ax,g.ay,g.bx,g.by,m.x,m.y,A.x,A.y))return!0}}return!1};for(let a of t){let c=n.get(a);a.forceX=c.fx,a.forceY=c.fy;let{x:l,y:h}=a;a.x+=c.fx,a.y+=c.fy,a.x=Math.max(e.minX,Math.min(e.maxX,a.x)),a.y=Math.max(e.minY,Math.min(e.maxY,a.y)),s(a)&&(a.x=l,a.y=h)}}_finalizeRoutesForCurrentNode(){for(let e of this.routesInProgress){let{connectionName:t,rootConnectionName:n,startPoint:o,endPoint:r,movablePoints:i}=e,s=[{x:o.x,y:o.y,z:o.z}];i.length===1?s.push({x:i[0].x,y:i[0].y,z:i[0].z}):i.length===2?(s.push({x:i[0].x,y:i[0].y,z:i[0].z}),s.push({x:i[1].x,y:i[1].y,z:i[1].z})):i.length===3&&(s.push({x:i[0].x,y:i[0].y,z:i[0].z}),s.push({x:i[2].x,y:i[2].y,z:i[2].z}),s.push({x:i[1].x,y:i[1].y,z:i[1].z})),s.push({x:r.x,y:r.y,z:r.z});let a={connectionName:t,rootConnectionName:n,traceThickness:this.traceWidth,viaDiameter:this.viaDiameter,route:s,vias:[]};this.routes.push(a)}this.routesInProgress=[]}_getNodeBounds(e){return{minX:e.center.x-e.width/2,maxX:e.center.x+e.width/2,minY:e.center.y-e.height/2,maxY:e.center.y+e.height/2}}visualize(){let e={lines:[],points:[],rects:[],circles:[]};for(let t of this.unsolvedNodes){if(t===this.currentNode)continue;let n=this._getNodeBounds(t);e.rects.push({center:{x:(n.minX+n.maxX)/2,y:(n.minY+n.maxY)/2},width:n.maxX-n.minX,height:n.maxY-n.minY,fill:"rgba(0, 0, 0, 0.08)",stroke:"rgba(0, 0, 0, 0.2)",label:t.capacityMeshNodeId})}if(this.lastNode){let t=this._getNodeBounds(this.lastNode);e.rects.push({center:{x:(t.minX+t.maxX)/2,y:(t.minY+t.maxY)/2},width:t.maxX-t.minX,height:t.maxY-t.minY,fill:"rgba(0, 200, 0, 0.15)",stroke:"rgba(0, 0, 255, 0.6)"})}if(this.currentNode){let t=this._getNodeBounds(this.currentNode);e.rects.push({center:{x:(t.minX+t.maxX)/2,y:(t.minY+t.maxY)/2},width:t.maxX-t.minX,height:t.maxY-t.minY,fill:"rgba(0, 200, 0, 0.15)",stroke:"rgba(0, 200, 0, 0.6)"})}for(let t of this.unsolvedNodes){let n=new Map;for(let o of t.portPoints)n.has(o.connectionName)||n.set(o.connectionName,[]),n.get(o.connectionName).push({x:o.x,y:o.y});for(let[o,r]of n)r.length<2||e.lines.push({points:r.map((i)=>({x:i.x,y:i.y})),label:o,strokeColor:"gray",strokeWidth:this.traceWidth})}for(let t of this.routes){let n=Abe(t.route,t.connectionName,this.colorMap[t.connectionName]);for(let r of n)e.lines.push({points:r.points,label:r.connectionName,strokeColor:r.z===0?r.color:zi(r.color,0.75),layer:`z${r.z}`,strokeWidth:t.traceThickness,strokeDash:r.z!==0?"10, 5":void 0});let o=t.route;for(let r=0;r<o.length;r++){let i=o[r],s=r===0,a=r===o.length-1,c=!s&&!a,l;l=s?"start":a?"end":`M${r}`,e.points.push({x:i.x,y:i.y,label:l,color:c?"orange":"blue"})}}for(let t of this.routesInProgress){let{startPoint:n,endPoint:o,movablePoints:r,connectionName:i}=t,s=this.colorMap[i]??"gray",a=[{x:n.x,y:n.y}];r.length===1?a.push({x:r[0].x,y:r[0].y}):r.length===2?(a.push({x:r[0].x,y:r[0].y}),a.push({x:r[1].x,y:r[1].y})):r.length===3&&(a.push({x:r[0].x,y:r[0].y}),a.push({x:r[2].x,y:r[2].y}),a.push({x:r[1].x,y:r[1].y})),a.push({x:o.x,y:o.y}),e.lines.push({points:a,label:i,strokeColor:s,strokeWidth:this.traceWidth}),e.points.push({x:n.x,y:n.y,label:"start",color:"blue"});for(let c=0;c<r.length;c++){let l=r[c];if(e.points.push({x:l.x,y:l.y,label:`M${c+1}`,color:"orange"}),l.forceX!==void 0&&l.forceY!==void 0){if(Math.sqrt(l.forceX*l.forceX+l.forceY*l.forceY)>0.001){e.lines.push({points:[{x:l.x,y:l.y},{x:l.x+l.forceX*5,y:l.y+l.forceY*5}],strokeColor:"red",strokeWidth:0.02,label:`F${c+1}`});let d=0.05,u=l.x+l.forceX*5,_=l.y+l.forceY*5,p=Math.atan2(l.forceY,l.forceX);e.lines.push({points:[{x:u,y:_},{x:u-d*Math.cos(p-Math.PI/6),y:_-d*Math.sin(p-Math.PI/6)}],strokeColor:"red",strokeWidth:0.02}),e.lines.push({points:[{x:u,y:_},{x:u-d*Math.cos(p+Math.PI/6),y:_-d*Math.sin(p+Math.PI/6)}],strokeColor:"purple",strokeWidth:0.02})}}}e.points.push({x:o.x,y:o.y,label:"end",color:"blue"})}return e}},ain=({connMap:e,connectionsWithResults:t,inputNodes:n,obstacles:o})=>{let r=o.filter((a)=>a.offBoardConnectsTo?.length);if(r.length===0)return;let i=new kV({});i.addConnections(r.map((a,c)=>[a.obstacleId??`__obs${c}`,...a.offBoardConnectsTo??[]]));let s=new Map(n.map((a)=>[a.capacityMeshNodeId,a]));for(let a of t){if(!a.path)continue;let c=a.connection.rootConnectionName??a.connection.name,l=new Set;for(let h of a.path){let d=s.get(h.currentNodeId);if(d?._offBoardConnectionId&&l.add(d._offBoardConnectionId),h.throughNodeId){let u=s.get(h.throughNodeId);u?._offBoardConnectionId&&l.add(u._offBoardConnectionId)}}for(let h of l){let d=i.getIdsConnectedToNet(h);d?.length&&e.addConnections([[c,...d]])}}};function Ub(e,t,n,o={}){return{solverName:e,solverClass:t,getConstructorParams:n,onSolved:o.onSolved}}var cin=class extends ei{constructor(e,t={}){super(),this.srj=e,this.opts=t,this.srj=e,this.opts={...t},this.viaDiameter=rm(e).padDiameter,this.minTraceWidth=e.minTraceWidth;let n=this.opts;if(this.effort=n.effort??1,this.MAX_ITERATIONS=1e8*this.effort,n.capacityDepth===void 0){let o=e.bounds.maxX-e.bounds.minX,r=e.bounds.maxY-e.bounds.minY,i=Math.max(o,r),s=n.targetMinCapacity??0.5;n.capacityDepth=ik(i,s)}this.connMap=im(e),this.colorMap=JA(e,this.connMap),this.cacheProvider=n.cacheProvider===void 0?hv():n.cacheProvider===null?null:n.cacheProvider,this.startTimeOfPhase={},this.endTimeOfPhase={},this.timeSpentOnPhase={}}srj;opts;getSolverName(){return"AssignableAutoroutingPipeline2"}netToPointPairsSolver;nodeSolver;nodeTargetMerger;edgeSolver;relateNodesToOffBoardConnections;colorMap;highDensityRouteSolver;simpleHighDensityRouteSolver;highDensitySolver;highDensityStitchSolver;singleLayerNodeMerger;offboardPathFragmentSolver;strawSolver;deadEndSolver;traceSimplificationSolver;traceKeepoutSolver;traceWidthSolver;availableSegmentPointSolver;portPointPathingSolver;multiSectionPortPointOptimizer;viaDiameter;minTraceWidth;effort;startTimeOfPhase;endTimeOfPhase;timeSpentOnPhase;activeSubSolver=null;connMap;srjWithPointPairs;capacityNodes=null;capacityEdges=null;cacheProvider=null;pipelineDef=[Ub("netToPointPairsSolver",vZe,(e)=>[e.srj,e.colorMap,nk(e.srj)],{onSolved:(e)=>{e.srjWithPointPairs=e.netToPointPairsSolver?.getNewSimpleRouteJson(),e.colorMap=JA(e.srjWithPointPairs,this.connMap),e.connMap=im(e.srjWithPointPairs)}}),Ub("nodeSolver",Qq,(e)=>[{simpleRouteJson:e.srjWithPointPairs,maxGapFillPasses:4}],{onSolved:(e)=>{e.capacityNodes=e.nodeSolver?.getOutput().meshNodes??[]}}),Ub("relateNodesToOffBoardConnections",sin,(e)=>[{capacityMeshNodes:e.capacityNodes,srj:e.srj}],{onSolved:(e)=>{e.capacityNodes=e.relateNodesToOffBoardConnections?.getOutput().capacityNodes}}),Ub("edgeSolver",ok,(e)=>[e.capacityNodes],{onSolved:(e)=>{e.capacityEdges=e.edgeSolver?.edges}}),Ub("availableSegmentPointSolver",tY,(e)=>[{nodes:e.capacityNodes,edges:e.capacityEdges||[],traceWidth:e.minTraceWidth,colorMap:e.colorMap,shouldReturnCrampedPortPoints:!1}]),Ub("portPointPathingSolver",IZe,(e)=>{let t=e.capacityNodes.map((r)=>({capacityMeshNodeId:r.capacityMeshNodeId,center:r.center,width:r.width,height:r.height,portPoints:[],availableZ:r.availableZ,_containsTarget:r._containsTarget,_containsObstacle:r._containsObstacle,_offBoardConnectionId:r._offBoardConnectionId,_offBoardConnectedCapacityMeshNodeIds:r._offBoardConnectedCapacityMeshNodeIds})),n=new Map(t.map((r)=>[r.capacityMeshNodeId,r])),o=e.availableSegmentPointSolver;for(let r of o.sharedEdgeSegments)for(let i of r.portPoints){let[s,a]=i.nodeIds,c={portPointId:i.segmentPortPointId,x:i.x,y:i.y,z:i.availableZ[0]??0,connectionNodeIds:[s,a],distToCentermostPortOnZ:i.distToCentermostPortOnZ,connectsToOffBoardNode:r.nodeIds.some((h)=>n.get(h)?._offBoardConnectionId)},l=n.get(s);l&&l.portPoints.push(c)}return[{simpleRouteJson:e.srjWithPointPairs,inputNodes:t,capacityMeshNodes:e.capacityNodes,colorMap:e.colorMap,numShuffleSeeds:100*Math.min(1,e.effort),hyperParameters:{JUMPER_PF_FN_ENABLED:!1,NODE_PF_FACTOR:100,NODE_PF_MAX_PENALTY:100,CENTER_OFFSET_DIST_PENALTY_FACTOR:0,FORCE_CENTER_FIRST:!0}}]},{onSolved:(e)=>{let t=e.portPointPathingSolver;t&&ain({connMap:e.connMap,connectionsWithResults:t.connectionsWithResults,inputNodes:t.inputNodes,obstacles:e.srj.obstacles})}}),Ub("multiSectionPortPointOptimizer",Q1r,(e)=>{let t=e.portPointPathingSolver;return[{simpleRouteJson:e.srjWithPointPairs,inputNodes:t.inputNodes,capacityMeshNodes:e.capacityNodes,capacityMeshEdges:e.capacityEdges,colorMap:e.colorMap,initialConnectionResults:t.connectionsWithResults,initialAssignedPortPoints:t.assignedPortPoints,initialNodeAssignedPortPoints:t.nodeAssignedPortPoints}]}),Ub("highDensitySolver",Fyr,(e)=>[{nodePortPoints:e.multiSectionPortPointOptimizer?.getNodesWithPortPoints()??e.portPointPathingSolver?.getNodesWithPortPoints()??[],colorMap:e.colorMap,viaDiameter:e.viaDiameter,traceWidth:e.minTraceWidth,connMap:e.connMap}]),Ub("highDensityStitchSolver",PZe,(e)=>[{connections:e.srjWithPointPairs.connections,hdRoutes:e.highDensitySolver.routes,colorMap:e.colorMap,layerCount:e.srj.layerCount,defaultViaDiameter:e.viaDiameter}]),Ub("traceSimplificationSolver",s6,(e)=>[{hdRoutes:e.highDensityStitchSolver?.mergedHdRoutes??e.highDensitySolver?.routes??e.highDensityRouteSolver?.routes,obstacles:e.srj.obstacles,connMap:e.connMap,colorMap:e.colorMap,outline:e.srj.outline,defaultViaDiameter:e.viaDiameter,layerCount:e.srj.layerCount,iterations:2}]),Ub("traceKeepoutSolver",iin,(e)=>[{hdRoutes:e.traceSimplificationSolver?.simplifiedHdRoutes??[],obstacles:e.srj.obstacles,connMap:e.connMap,colorMap:e.colorMap,srj:e.srj}]),Ub("traceWidthSolver",Yq,(e)=>[{hdRoutes:e.traceKeepoutSolver?.redrawnHdRoutes??[],connection:e.srj.connections,obstacles:e.srj.obstacles,connMap:e.connMap,colorMap:e.colorMap,minTraceWidth:e.minTraceWidth,obstacleMargin:e.srj.defaultObstacleMargin??0.15,layerCount:e.srj.layerCount}])];getConstructorParams(){return[this.srj,this.opts]}currentPipelineStepIndex=0;_step(){let e=this.pipelineDef[this.currentPipelineStepIndex];if(!e)return void(this.solved=!0);if(this.activeSubSolver)return this.activeSubSolver.step(),void(this.activeSubSolver.solved?(this.endTimeOfPhase[e.solverName]=performance.now(),this.timeSpentOnPhase[e.solverName]=this.endTimeOfPhase[e.solverName]-this.startTimeOfPhase[e.solverName],e.onSolved?.(this),this.activeSubSolver=null,this.currentPipelineStepIndex++):this.activeSubSolver.failed&&(this.error=this.activeSubSolver?.error,this.failed=!0,this.activeSubSolver=null));let t=e.getConstructorParams(this);this.activeSubSolver=new e.solverClass(...t),this[e.solverName]=this.activeSubSolver,this.timeSpentOnPhase[e.solverName]=0,this.startTimeOfPhase[e.solverName]=performance.now()}solveUntilPhase(e){for(;this.getCurrentPhase()!==e;)this.step()}getCurrentPhase(){return this.pipelineDef[this.currentPipelineStepIndex]?.solverName??"none"}visualize(){if(!this.solved&&this.activeSubSolver)return this.activeSubSolver.visualize();let e=this.netToPointPairsSolver?.visualize(),t=this.nodeSolver?.visualize(),n=this.nodeTargetMerger?.visualize(),o=this.singleLayerNodeMerger?.visualize(),r=this.strawSolver?.visualize(),i=this.edgeSolver?.visualize(),s=this.deadEndSolver?.visualize(),a=this.availableSegmentPointSolver?.visualize(),c=this.offboardPathFragmentSolver?.visualize(),l=this.portPointPathingSolver?.visualize(),h=this.multiSectionPortPointOptimizer?.visualize(),d=this.highDensityRouteSolver?.visualize(),u=this.highDensitySolver?.visualize(),_=this.simpleHighDensityRouteSolver?.visualize(),p=this.highDensityStitchSolver?.visualize(),m=this.traceSimplificationSolver?.visualize(),A=this.traceKeepoutSolver?.visualize(),g=this.traceWidthSolver?.visualize(),f=this.srj.outline,y=[];if(y.push({points:[{x:this.srj.bounds?.minX??-50,y:this.srj.bounds?.minY??-50},{x:this.srj.bounds?.maxX??50,y:this.srj.bounds?.minY??-50},{x:this.srj.bounds?.maxX??50,y:this.srj.bounds?.maxY??50},{x:this.srj.bounds?.minX??-50,y:this.srj.bounds?.maxY??50},{x:this.srj.bounds?.minX??-50,y:this.srj.bounds?.minY??-50}],strokeColor:"rgba(255,0,0,0.25)"}),f&&f.length>=2){let I=f.map((v)=>({x:v.x,y:v.y}));I.push({...I[0]}),y.push({points:I,strokeColor:"rgba(0, 136, 255, 0.95)"})}let x=bB(this.srj),C={points:[...this.srj.connections.flatMap((I)=>I.pointsToConnect.map((v)=>({...v,layer:IB(v,this.srj.layerCount),label:`${I.name} ${v.pcb_port_id??""}`})))],rects:[...(this.srj.obstacles??[]).filter((I)=>!I.isCopperPour).map((I)=>({...I,fill:I.layers?.includes("top")?"rgba(255,0,0,0.25)":I.layers?.includes("bottom")?"rgba(0,0,255,0.25)":"rgba(255,0,0,0.25)",layer:$S(I,this.srj.layerCount),label:x(I)}))],lines:y},b=[C,e,t,n,o,r,i,s,a,c,l,h,d?Bl(C,d):null,u?Bl(C,u):null,_?Bl(C,_):null,p,m,A,g,this.solved?Bl({lines:y},rx(this.getOutputSimpleRouteJson())):null].filter(Boolean);return Bl(...b)}preview(){let e=this.highDensitySolver?.routes??this.simpleHighDensityRouteSolver?.routes??this.highDensityRouteSolver?.routes;if(e){let t=[];for(let n=e.length-1;n>=0;n--){let o=e[n];if(t.push({points:o.route.map((r)=>({x:r.x,y:r.y})),strokeColor:this.colorMap[o.connectionName]}),t.length>200)break}return{lines:t}}if(this.portPointPathingSolver){let t=[];for(let n of this.portPointPathingSolver.connectionsWithResults)n.path&&t.push({points:n.path.map((o)=>({x:o.point.x,y:o.point.y})),strokeColor:this.colorMap[n.connection.name]});return{lines:t}}return this.netToPointPairsSolver?this.netToPointPairsSolver?.visualize():{}}_getOutputHdRoutes(){return this.traceWidthSolver?.hdRoutesWithWidths??this.traceKeepoutSolver?.redrawnHdRoutes??this.traceSimplificationSolver?.simplifiedHdRoutes??this.highDensityStitchSolver?.mergedHdRoutes??this.highDensitySolver?.routes??this.simpleHighDensityRouteSolver?.routes??this.highDensityRouteSolver?.routes}getConnectedOffboardObstacles(){let e={},t=new Set(this.srj.connections.flatMap((n)=>n.__rootConnectionNames??[n.name]));for(let[n,o]of this.srj.obstacles.entries()){if(!o.offBoardConnectsTo?.length)continue;let r=o.obstacleId??`__obs${n}`,i=this.connMap.getNetConnectedToId(r);if(!i)continue;let s=this.connMap.getIdsConnectedToNet(i).find((a)=>t.has(a));s&&(e[r]=s)}return e}getOutputSimplifiedPcbTraces(){if(!this.solved||!this.highDensityRouteSolver&&!this.simpleHighDensityRouteSolver&&!this.highDensitySolver)throw Error("Cannot get output before solving is complete");let e=[],t=this._getOutputHdRoutes();for(let n of this.netToPointPairsSolver?.newConnections??[]){let o=n.__netConnectionName??this.srj.connections.find((i)=>i.name===n.name)?.__netConnectionName,r=t.filter((i)=>i.connectionName===n.name);for(let i=0;i<r.length;i++){let s=r[i],a={type:"pcb_trace",pcb_trace_id:`${n.name}_${i}`,connection_name:o??n.__rootConnectionNames?.[0]??n.name,route:k3(s,this.srj.layerCount)};e.push(a)}}return e}getOutputSimpleRouteJson(){return{...this.srj,traces:this.getOutputSimplifiedPcbTraces()}}},zyr=class extends ei{getSolverName(){return"MultipleHighDensityRouteStitchSolver2"}unsolvedRoutes;mergedHdRoutes=[];colorMap={};defaultTraceThickness;defaultViaDiameter;constructor(e){super(),this.colorMap=e.colorMap??{};let t=e.hdRoutes[0];this.defaultTraceThickness=t?.traceThickness??0.15,this.defaultViaDiameter=t?.viaDiameter??e.defaultViaDiameter??0.3;let n=new Map;for(let r of e.connectionPathResults)n.set(r.connection.name,r);let o=new Map;for(let r of e.hdRoutes){let i=o.get(r.connectionName);i?i.push(r):o.set(r.connectionName,[r])}this.unsolvedRoutes=[];for(let[r,i]of o.entries()){let s=e.connections.find((d)=>d.name===r);if(!s)continue;let a=n.get(r),c=[];a?.path&&(c=a.path.map((d)=>d.currentNodeId));let l={...s.pointsToConnect[0],z:si(l2(s.pointsToConnect[0]),e.layerCount)},h={...s.pointsToConnect[1],z:si(l2(s.pointsToConnect[1]),e.layerCount)};this.unsolvedRoutes.push({connectionName:r,hdRoutes:i,nodeOrder:c,start:l,end:h})}this.MAX_ITERATIONS=1e5}_step(){let e=this.unsolvedRoutes.pop();if(!e)return void(this.solved=!0);let t=this.stitchOrderedRoutes(e);this.mergedHdRoutes.push(t)}stitchOrderedRoutes(e){let{connectionName:t,hdRoutes:n,nodeOrder:o,start:r,end:i}=e;if(n.length===0)return{connectionName:t,traceThickness:this.defaultTraceThickness,viaDiameter:this.defaultViaDiameter,route:[r,i],vias:[],jumpers:[]};let s;s=o.length>0?this.orderRoutesByNodePath(n,o,r,t):this.orderRoutesByProximity(n,r);let a=[],c=[],l=[];a.push({x:r.x,y:r.y,z:r.z});for(let d=0;d<s.length;d++){let u=s[d],_=a[a.length-1],p=u.route[0],m=u.route[u.route.length-1],A=kn(_,p),g=kn(_,m),f=Math.min(A,g);if(d>0&&f>1)continue;let y;y=A<=g?[...u.route]:[...u.route].reverse();let x=0.001;y.length>0&&kn(_,y[0])<x&&(y=y.slice(1)),a.push(...y),c.push(...u.vias),u.jumpers&&l.push(...u.jumpers)}let h=kn(a[a.length-1],i);return h>0.001&&h<1&&a.push({x:i.x,y:i.y,z:i.z}),{connectionName:t,rootConnectionName:n[0]?.rootConnectionName,traceThickness:n[0]?.traceThickness??this.defaultTraceThickness,viaDiameter:n[0]?.viaDiameter??this.defaultViaDiameter,route:a,vias:c,jumpers:l}}orderRoutesByNodePath(e,t,n,o){if(e.length===0)return[];let r=new Set(e),i=null,s=1/0;for(let A of r){let g=A.route[0],f=A.route[A.route.length-1],y=Math.min(kn(n,g),kn(n,f));y<s&&(s=y,i=A)}if(!i)return[];r.delete(i);let a=i.route[0],c=i.route[i.route.length-1],l,h;kn(n,a)<=kn(n,c)?(l=a,h=c):(l=c,h=a);let d=(A,g)=>{let f=0;for(let y of r){if(y===g)continue;let x=y.route[0],C=y.route[y.route.length-1];(kn(A,x)<10||kn(A,C)<10)&&f++}return f},u=[i],_=h;for(;r.size>0;){let A=null,g=1/0,f=-1;for(let y of r){let x=y.route[0],C=y.route[y.route.length-1],b=kn(_,x),I=kn(_,C),v=Math.min(b,I);if(v>=10)continue;let P=d(b<=I?C:x,y),M=P===0,B=f===0,T=v-g,N=!1;N=A===null||(!!(!M&&B&&T<5)||!(M&&!B&&T>-5)&&v<g),N&&(g=v,A=y,f=P)}if(!A)break;{u.push(A),r.delete(A);let y=A.route[0],x=A.route[A.route.length-1];_=kn(_,y)<=kn(_,x)?x:y}}let p=[];for(_=l;r.size>0;){let A=null,g=1/0,f=-1,y=kn(_,n);for(let x of r){let C=x.route[0],b=x.route[x.route.length-1],I=kn(_,C),v=kn(_,b),P=Math.min(I,v);if(P>=10)continue;let M=I<=v?b:C;if(kn(M,n)>y+2)continue;let B=d(M,x),T=B===0,N=f===0,D=P-g,L=!1;L=A===null||(!!(!T&&N&&D<5)||!(T&&!N&&D>-5)&&P<g),L&&(g=P,A=x,f=B)}if(!A)break;{p.unshift(A),r.delete(A);let x=A.route[0],C=A.route[A.route.length-1];_=kn(_,x)<=kn(_,C)?C:x}}let m=[...p,...u];if(r.size>0){let A=[...r].map((g)=>{let f=g.route[0],y=g.route[g.route.length-1];return`start=(${f.x.toFixed(2)},${f.y.toFixed(2)}) end=(${y.x.toFixed(2)},${y.y.toFixed(2)})`});console.warn(`[StitchSolver] Skipped ${r.size} routes for connection ${e[0]?.connectionName??"?"}, skipped routes: ${A.join("; ")}`)}return m}orderRoutesByProximity(e,t){let n=new Set(e),o=[],r=t;for(;n.size>0;){let i=null,s=1/0,a=!1;for(let c of n){let l=c.route[0],h=c.route[c.route.length-1],d=kn(r,l),u=kn(r,h);d<s&&(s=d,i=c,a=!1),u<s&&(s=u,i=c,a=!0)}if(!i)break;{o.push(i),n.delete(i);let c=i.route[0],l=i.route[i.route.length-1];r=a?c:l}}return o}visualize(){let e={points:[],lines:[],circles:[],rects:[],title:"Multiple High Density Route Stitch Solver 2"};for(let[t,n]of this.mergedHdRoutes.entries()){let o=this.colorMap[n.connectionName]??`hsl(120, 100%, ${40+10*t%40}%)`;for(let r=0;r<n.route.length-1;r++){let i=n.route[r],s=n.route[r+1],a=i.z!==0?zi(o,0.5):o;e.lines?.push({points:[{x:i.x,y:i.y},{x:s.x,y:s.y}],strokeColor:a,strokeWidth:n.traceThickness})}for(let r of n.route){let i=r.z!==0?zi(o,0.5):o;e.points?.push({x:r.x,y:r.y,color:i})}for(let r of n.vias)e.circles?.push({center:{x:r.x,y:r.y},radius:n.viaDiameter/2,fill:o});if(n.jumpers&&n.jumpers.length>0){let r=lv(n.jumpers,{color:o,label:n.connectionName});e.rects.push(...r.rects??[]),e.lines.push(...r.lines??[])}}for(let t of this.unsolvedRoutes){let n=this.colorMap[t.connectionName]??"gray";e.points?.push({x:t.start.x,y:t.start.y,color:n,label:`${t.connectionName} Start`},{x:t.end.x,y:t.end.y,color:n,label:`${t.connectionName} End`});for(let o=0;o<t.hdRoutes.length;o++){let r=t.hdRoutes[o];if(r.route.length>1&&e.lines?.push({points:r.route.map((i)=>({x:i.x,y:i.y})),strokeColor:zi(n,0.5),strokeDash:"10 5",label:`segment ${o}`}),r.jumpers&&r.jumpers.length>0){let i=lv(r.jumpers,{color:n,label:r.connectionName});e.rects.push(...i.rects??[]),e.lines.push(...i.lines??[])}}}return e}},{create:Oyr,defineProperty:Wzt,getOwnPropertyDescriptor:Vyr,getOwnPropertyNames:lin,getPrototypeOf:Yyr}=Object,Gyr=Object.prototype.hasOwnProperty,hY=(e,t)=>function(){return t||(0,e[lin(e)[0]])((t={exports:{}}).exports,t),t.exports},Xzt=(e,t,n)=>(n=e!=null?Oyr(Yyr(e)):{},((o,r,i,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of lin(r))Gyr.call(o,a)||a===i||Wzt(o,a,{get:()=>r[a],enumerable:!(s=Vyr(r,a))||s.enumerable});return o})(!t&&e&&e.__esModule?n:Wzt(n,"default",{value:e,enumerable:!0}),e)),Uyr=hY({"node_modules/is-buffer/index.js"(e,t){function n(o){return!!o.constructor&&typeof o.constructor.isBuffer=="function"&&o.constructor.isBuffer(o)}t.exports=function(o){return o!=null&&(n(o)||function(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&n(r.slice(0,0))}(o)||!!o._isBuffer)}}}),Wyr=hY({"node_modules/kind-of/index.js"(e,t){var n=Uyr(),o=Object.prototype.toString;t.exports=function(r){if(r===void 0)return"undefined";if(r===null)return"null";if(r===!0||r===!1||r instanceof Boolean)return"boolean";if(typeof r=="string"||r instanceof String)return"string";if(typeof r=="number"||r instanceof Number)return"number";if(typeof r=="function"||r instanceof Function)return"function";if(Array.isArray!==void 0&&Array.isArray(r))return"array";if(r instanceof RegExp)return"regexp";if(r instanceof Date)return"date";var i=o.call(r);return i==="[object RegExp]"?"regexp":i==="[object Date]"?"date":i==="[object Arguments]"?"arguments":i==="[object Error]"?"error":n(r)?"buffer":i==="[object Set]"?"set":i==="[object WeakSet]"?"weakset":i==="[object Map]"?"map":i==="[object WeakMap]"?"weakmap":i==="[object Symbol]"?"symbol":i==="[object Int8Array]"?"int8array":i==="[object Uint8Array]"?"uint8array":i==="[object Uint8ClampedArray]"?"uint8clampedarray":i==="[object Int16Array]"?"int16array":i==="[object Uint16Array]"?"uint16array":i==="[object Int32Array]"?"int32array":i==="[object Uint32Array]"?"uint32array":i==="[object Float32Array]"?"float32array":i==="[object Float64Array]"?"float64array":"object"}}}),Xyr=hY({"node_modules/rename-keys/index.js"(e,t){(function(){function n(o,r){if(typeof r!="function")return o;var i={};for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(i[r(s,o[s])||s]=o[s]);return i}t!==void 0&&t.exports?t.exports=n:typeof define=="function"&&define.amd?define([],function(){return n}):window.rename=n})()}}),jyr=hY({"node_modules/deep-rename-keys/index.js"(e,t){var n=Wyr(),o=Xyr();t.exports=function r(i,s){var a=n(i);if(a!=="object"&&a!=="array")throw Error("expected an object");var c=[];for(var l in a==="object"&&(i=o(i,s),c={}),i)if(i.hasOwnProperty(l)){var h=i[l];n(h)==="object"||n(h)==="array"?c[l]=r(h,s):c[l]=h}return c}}}),hin=hY({"node_modules/eventemitter3/index.js"(e,t){var n=Object.prototype.hasOwnProperty,o="~";function r(){}function i(a,c,l){this.fn=a,this.context=c,this.once=l||!1}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(o=!1)),s.prototype.eventNames=function(){var a,c,l=[];if(this._eventsCount===0)return l;for(c in a=this._events)n.call(a,c)&&l.push(o?c.slice(1):c);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(a)):l},s.prototype.listeners=function(a,c){var l=o?o+a:a,h=this._events[l];if(c)return!!h;if(!h)return[];if(h.fn)return[h.fn];for(var d=0,u=h.length,_=Array(u);d<u;d++)_[d]=h[d].fn;return _},s.prototype.emit=function(a,c,l,h,d,u){var _=o?o+a:a;if(!this._events[_])return!1;var p,m,A=this._events[_],g=arguments.length;if(A.fn){switch(A.once&&this.removeListener(a,A.fn,void 0,!0),g){case 1:return A.fn.call(A.context),!0;case 2:return A.fn.call(A.context,c),!0;case 3:return A.fn.call(A.context,c,l),!0;case 4:return A.fn.call(A.context,c,l,h),!0;case 5:return A.fn.call(A.context,c,l,h,d),!0;case 6:return A.fn.call(A.context,c,l,h,d,u),!0}for(m=1,p=Array(g-1);m<g;m++)p[m-1]=arguments[m];A.fn.apply(A.context,p)}else{var f,y=A.length;for(m=0;m<y;m++)switch(A[m].once&&this.removeListener(a,A[m].fn,void 0,!0),g){case 1:A[m].fn.call(A[m].context);break;case 2:A[m].fn.call(A[m].context,c);break;case 3:A[m].fn.call(A[m].context,c,l);break;case 4:A[m].fn.call(A[m].context,c,l,h);break;default:if(!p)for(f=1,p=Array(g-1);f<g;f++)p[f-1]=arguments[f];A[m].fn.apply(A[m].context,p)}}return!0},s.prototype.on=function(a,c,l){var h=new i(c,l||this),d=o?o+a:a;return this._events[d]?this._events[d].fn?this._events[d]=[this._events[d],h]:this._events[d].push(h):(this._events[d]=h,this._eventsCount++),this},s.prototype.once=function(a,c,l){var h=new i(c,l||this,!0),d=o?o+a:a;return this._events[d]?this._events[d].fn?this._events[d]=[this._events[d],h]:this._events[d].push(h):(this._events[d]=h,this._eventsCount++),this},s.prototype.removeListener=function(a,c,l,h){var d=o?o+a:a;if(!this._events[d])return this;if(!c)return--this._eventsCount===0?this._events=new r:delete this._events[d],this;var u=this._events[d];if(u.fn)u.fn!==c||h&&!u.once||l&&u.context!==l||(--this._eventsCount===0?this._events=new r:delete this._events[d]);else{for(var _=0,p=[],m=u.length;_<m;_++)(u[_].fn!==c||h&&!u[_].once||l&&u[_].context!==l)&&p.push(u[_]);p.length?this._events[d]=p.length===1?p[0]:p:--this._eventsCount===0?this._events=new r:delete this._events[d]}return this},s.prototype.removeAllListeners=function(a){var c;return a?(c=o?o+a:a,this._events[c]&&(--this._eventsCount===0?this._events=new r:delete this._events[c])):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prototype.setMaxListeners=function(){return this},s.prefixed=o,s.EventEmitter=s,t!==void 0&&(t.exports=s)}}),Kyr=hY({"node_modules/xml-lexer/dist/lexer.js"(e,t){function n(l,h,d){return h in l?Object.defineProperty(l,h,{value:d,enumerable:!0,configurable:!0,writable:!0}):l[h]=d,l}var o=hin(),r=function(){},i={data:"state-data",cdata:"state-cdata",tagBegin:"state-tag-begin",tagName:"state-tag-name",tagEnd:"state-tag-end",attributeNameStart:"state-attribute-name-start",attributeName:"state-attribute-name",attributeNameEnd:"state-attribute-name-end",attributeValueBegin:"state-attribute-value-begin",attributeValue:"state-attribute-value"},s={lt:"action-lt",gt:"action-gt",space:"action-space",equal:"action-equal",quote:"action-quote",slash:"action-slash",char:"action-char",error:"action-error"},a={text:"text",openTag:"open-tag",closeTag:"close-tag",attributeName:"attribute-name",attributeValue:"attribute-value"},c={" ":s.space,"\t":s.space,"\n":s.space,"\r":s.space,"<":s.lt,">":s.gt,'"':s.quote,"'":s.quote,"=":s.equal,"/":s.slash};t.exports={State:i,Action:s,Type:a,create:function(l){var h,d,u,_,p,m,A,g,f,y;l=Object.assign({debug:!1},l);var x=new o,C=i.data,b="",I="",v="",P="",M="",B="",T=function(D,L){if(I[0]!=="?"&&I[0]!=="!"){var H={type:D,value:L};l.debug&&console.log("emit:",H),x.emit("data",H)}};x.stateMachine=(n(y={},i.data,(n(h={},s.lt,function(){b.trim()&&T(a.text,b),I="",M=!1,C=i.tagBegin}),n(h,s.char,function(D){b+=D}),h)),n(y,i.cdata,n({},s.char,function(D){(b+=D).substr(-3)==="]]>"&&(T(a.text,b.slice(0,-3)),b="",C=i.data)})),n(y,i.tagBegin,(n(d={},s.space,r),n(d,s.char,function(D){I=D,C=i.tagName}),n(d,s.slash,function(){I="",M=!0}),d)),n(y,i.tagName,(n(u={},s.space,function(){M?C=i.tagEnd:(C=i.attributeNameStart,T(a.openTag,I))}),n(u,s.gt,function(){T(M?a.closeTag:a.openTag,I),b="",C=i.data}),n(u,s.slash,function(){C=i.tagEnd,T(a.openTag,I)}),n(u,s.char,function(D){(I+=D)==="![CDATA["&&(C=i.cdata,b="",I="")}),u)),n(y,i.tagEnd,(n(_={},s.gt,function(){T(a.closeTag,I),b="",C=i.data}),n(_,s.char,r),_)),n(y,i.attributeNameStart,(n(p={},s.char,function(D){v=D,C=i.attributeName}),n(p,s.gt,function(){b="",C=i.data}),n(p,s.space,r),n(p,s.slash,function(){M=!0,C=i.tagEnd}),p)),n(y,i.attributeName,(n(m={},s.space,function(){C=i.attributeNameEnd}),n(m,s.equal,function(){T(a.attributeName,v),C=i.attributeValueBegin}),n(m,s.gt,function(){P="",T(a.attributeName,v),T(a.attributeValue,P),b="",C=i.data}),n(m,s.slash,function(){M=!0,P="",T(a.attributeName,v),T(a.attributeValue,P),C=i.tagEnd}),n(m,s.char,function(D){v+=D}),m)),n(y,i.attributeNameEnd,(n(A={},s.space,r),n(A,s.equal,function(){T(a.attributeName,v),C=i.attributeValueBegin}),n(A,s.gt,function(){P="",T(a.attributeName,v),T(a.attributeValue,P),b="",C=i.data}),n(A,s.char,function(D){P="",T(a.attributeName,v),T(a.attributeValue,P),v=D,C=i.attributeName}),A)),n(y,i.attributeValueBegin,(n(g={},s.space,r),n(g,s.quote,function(D){B=D,P="",C=i.attributeValue}),n(g,s.gt,function(){T(a.attributeValue,P=""),b="",C=i.data}),n(g,s.char,function(D){B="",P=D,C=i.attributeValue}),g)),n(y,i.attributeValue,(n(f={},s.space,function(D){B?P+=D:(T(a.attributeValue,P),C=i.attributeNameStart)}),n(f,s.quote,function(D){B===D?(T(a.attributeValue,P),C=i.attributeNameStart):P+=D}),n(f,s.gt,function(D){B?P+=D:(T(a.attributeValue,P),b="",C=i.data)}),n(f,s.slash,function(D){B?P+=D:(T(a.attributeValue,P),M=!0,C=i.tagEnd)}),n(f,s.char,function(D){P+=D}),f)),y);var N=function(D){l.debug&&console.log(C,D);var L=x.stateMachine[C],H=L[function(V){return c[V]||s.char}(D)]||L[s.error]||L[s.char];H(D)};return x.write=function(D){for(var L=D.length,H=0;H<L;H++)N(D[H])},x}}}}),$yr=hY({"node_modules/xml-reader/dist/reader.js"(e,t){var n=hin(),o=Kyr(),r=o.Type,i={element:"element",text:"text"},s=function(c){return Object.assign({name:"",type:i.element,value:"",parent:null,attributes:{},children:[]},c)},a=function(c){c=Object.assign({stream:!1,parentNodes:!0,doneEvent:"done",tagPrefix:"tag:",emitTopLevelOnly:!1,debug:!1},c);var l=void 0,h=void 0,d=void 0,u=void 0,_=new n,p=function(m){switch(m.type){case r.openTag:if(d===null)(d=h).name=m.value;else{var A=s({name:m.value,parent:d});d.children.push(A),d=A}break;case r.closeTag:var g=d.parent;if(c.parentNodes||(d.parent=null),d.name!==m.value)break;c.stream&&g===h&&(h.children=[],d.parent=null),c.emitTopLevelOnly&&g!==h||(_.emit(c.tagPrefix+d.name,d),_.emit("tag",d.name,d)),d===h&&(l.removeAllListeners("data"),_.emit(c.doneEvent,d),h=null),d=g;break;case r.text:d&&d.children.push(s({type:i.text,value:m.value,parent:c.parentNodes?d:null}));break;case r.attributeName:u=m.value,d.attributes[u]="";break;case r.attributeValue:d.attributes[u]=m.value}};return _.reset=function(){(l=o.create({debug:c.debug})).on("data",p),h=s(),d=null,u="",_.parse=l.write},_.reset(),_};t.exports={parseSync:function(c,l){l=Object.assign({},l,{stream:!1,tagPrefix:":"});var h=a(l),d=void 0;return h.on("done",function(u){d=u}),h.parse(c),d},create:a,NodeType:i}}}),{cos:lLs,sin:hLs,PI:dLs}=Math,{tan:uLs}=Math,qyr=(Xzt(jyr()),Xzt($yr()),class{MAX_ITERATIONS=1e5;solved=!1;failed=!1;iterations=0;progress=0;error=null;activeSubSolver;failedSubSolvers;timeToSolve;stats={};_setupDone=!1;setup(){this._setupDone||(this._setup(),this._setupDone=!0)}_setup(){}step(){if(this._setupDone||this.setup(),!this.solved&&!this.failed){this.iterations++;try{this._step()}catch(e){throw this.error=`${this.constructor.name} error: ${e}`,this.failed=!0,e}!this.solved&&this.iterations>=this.MAX_ITERATIONS&&this.tryFinalAcceptance(),!this.solved&&this.iterations>=this.MAX_ITERATIONS&&(this.error=`${this.constructor.name} ran out of iterations`,this.failed=!0),"computeProgress"in this&&(this.progress=this.computeProgress())}}_step(){}getConstructorParams(){throw Error("getConstructorParams not implemented")}getOutput(){return null}solve(){let e=Date.now();for(;!this.solved&&!this.failed;)this.step();let t=Date.now();this.timeToSolve=t-e}visualize(){return{lines:[],points:[],rects:[],circles:[]}}tryFinalAcceptance(){}preview(){return{lines:[],points:[],rects:[],circles:[]}}}),BXe=(e)=>e?`hsl(${((t)=>{let n=0;for(let o=0;o<t.length;o++)n=779*t.charCodeAt(o)+((n<<5)-n);return n})(e)%360}, 100%, 50%)`:"rgba(0, 0, 0, 0.5)",Jyr=(e)=>[[{x:e.minX,y:e.minY},{x:e.maxX,y:e.minY}],[{x:e.maxX,y:e.minY},{x:e.maxX,y:e.maxY}],[{x:e.maxX,y:e.maxY},{x:e.minX,y:e.maxY}],[{x:e.minX,y:e.maxY},{x:e.minX,y:e.minY}]];function jzt(e,t){let{minX:n,maxX:o,minY:r,maxY:i}=t,s=o-n,a=i-r;return Math.abs(e.y-i)<0.000001?e.x-n:Math.abs(e.x-o)<0.000001?s+(i-e.y):Math.abs(e.y-r)<0.000001?s+a+(o-e.x):Math.abs(e.x-n)<0.000001?2*s+a+(e.y-r):0}function Kzt(e,t){let{minX:n,maxX:o,minY:r,maxY:i}=t,a=Math.abs(e.y-i)<0.000001,c=Math.abs(e.y-r)<0.000001,l=Math.abs(e.x-o)<0.000001,h=Math.abs(e.x-n)<0.000001;if(a&&l)return{x:-Math.SQRT1_2,y:-Math.SQRT1_2};if(a&&h)return{x:Math.SQRT1_2,y:-Math.SQRT1_2};if(c&&l)return{x:-Math.SQRT1_2,y:Math.SQRT1_2};if(c&&h)return{x:Math.SQRT1_2,y:Math.SQRT1_2};if(a)return{x:0,y:-1};if(c)return{x:0,y:1};if(l)return{x:-1,y:0};if(h)return{x:1,y:0};let d=(r+i)/2,u=(n+o)/2-e.x,_=d-e.y,p=Math.hypot(u,_);return p>0?{x:u/p,y:_/p}:{x:0,y:-1}}function t3e(e,t,n,o,r,i,s,a,c,l){for(let h=0;h<=l;h++){let d=h/l,u=1-d,_=u*u,p=_*u,m=d*d,A=m*d,g=2*h;c[g]=p*e+3*_*d*n+3*u*m*r+A*s,c[g+1]=p*t+3*_*d*o+3*u*m*i+A*a}}function Zyr(e,t,n,o,r){let i=[];for(let s=0;s<=r;s++){let a=s/r,c=1-a,l=c*c,h=l*c,d=a*a,u=d*a;i.push({x:h*e.x+3*l*a*t.x+3*c*d*n.x+u*o.x,y:h*e.y+3*l*a*t.y+3*c*d*n.y+u*o.y})}return i}function n3e(e,t,n,o,r,i){let s=r-n,a=i-o,c=s*s+a*a;if(c===0){let u=e-n,_=t-o;return u*u+_*_}let l=Math.max(0,Math.min(1,((e-n)*s+(t-o)*a)/c)),h=e-(n+l*s),d=t-(o+l*a);return h*h+d*d}function o3e(e,t,n,o,r,i,s,a){let c=(s-r)*(t-i)-(a-i)*(e-r),l=(s-r)*(o-i)-(a-i)*(n-r),h=(n-e)*(i-t)-(o-t)*(r-e),d=(n-e)*(a-t)-(o-t)*(s-e);return(c>0&&l<0||c<0&&l>0)&&(h>0&&d<0||h<0&&d>0)?0:Math.min(n3e(e,t,r,i,s,a),n3e(n,o,r,i,s,a),n3e(r,i,e,t,n,o),n3e(s,a,e,t,n,o))}function exr(e,t,n,o,r,i,s,a){let c=(s-r)*(t-i)-(a-i)*(e-r),l=(s-r)*(o-i)-(a-i)*(n-r),h=(n-e)*(i-t)-(o-t)*(r-e),d=(n-e)*(a-t)-(o-t)*(s-e);return(c>0&&l<0||c<0&&l>0)&&(h>0&&d<0||h<0&&d>0)}function txr(e,t,n,o,r){let i=(u)=>(u%r+r)%r,s=i(e),a=i(t),c=i(n),l=i(o),[h,d]=s<a?[s,a]:[a,s];return c>h&&c<d&&l>h&&l<d}function $zt(e,t){let n=1/0,o=-1/0,r=1/0,i=-1/0;for(let s=0;s<t;s++){let a=e[2*s],c=e[2*s+1];a<n&&(n=a),a>o&&(o=a),c<r&&(r=c),c>i&&(i=c)}return{minX:n,maxX:o,minY:r,maxY:i}}var din=class extends qyr{constructor(e){super(),this.problem=e;for(let t of this.problem.obstacles)t.outerSegments=Jyr(t);this.precomputeObstacles()}outputTraces=[];traces=[];optimizationStep=0;maxOptimizationSteps=100;sampledPoints=[];traceBounds=[];obstacleSegments=new Float64Array(0);obstacleNetworkIds=[];numObstacleSegments=0;collisionPairs=[];lastCost=1/0;stagnantSteps=0;effectiveTraceToTraceSpacing=0;getConstructorParams(){return this.problem}precomputeObstacles(){let{obstacles:e}=this.problem,t=0;for(let o of e)o.outerSegments&&(t+=o.outerSegments.length);this.obstacleSegments=new Float64Array(4*t),this.obstacleNetworkIds=[],this.numObstacleSegments=t;let n=0;for(let o of e)if(o.outerSegments)for(let r of o.outerSegments)this.obstacleSegments[n++]=r[0].x,this.obstacleSegments[n++]=r[0].y,this.obstacleSegments[n++]=r[1].x,this.obstacleSegments[n++]=r[1].y,this.obstacleNetworkIds.push(o.networkId)}initializeTraces(){let{bounds:e,waypointPairs:t}=this.problem,{minX:n,maxX:o,minY:r,maxY:i}=e,s=o-n,a=i-r,c=2*s+2*a,l=function(m){return{x:(m.minX+m.maxX)/2,y:(m.minY+m.maxY)/2}}(e),h=t.map((m,A)=>({pair:m,t1:jzt(m.start,e),t2:jzt(m.end,e),idx:A})),d=h.map(()=>[]),u=h.map(()=>[]);for(let m of h)for(let A of h)if(m.idx!==A.idx){if(m.pair.networkId&&A.pair.networkId&&m.pair.networkId===A.pair.networkId)continue;txr(A.t1,A.t2,m.t1,m.t2,c)&&(d[m.idx].push(A.idx),u[A.idx].push(m.idx))}let _=d.map((m)=>m.length),p=Math.max(..._,1);this.traces=h.map(({pair:m,t1:A,t2:g,idx:f})=>{let y=Kzt(m.start,e),x=Kzt(m.end,e),C=Math.hypot(m.end.x-m.start.x,m.end.y-m.start.y),b=_[f]/p,I=(m.start.x+m.end.x)/2,v=(m.start.y+m.end.y)/2,P=C*(0.25+0.15*(1-Math.hypot(I-l.x,v-l.y)/Math.hypot(s/2,a/2)))*(1-0.3*b),M=0.05*Math.min(s,a),B=Math.max(M,P),T=Math.max(M,P);return{waypointPair:m,ctrl1:{x:m.start.x+B*y.x,y:m.start.y+B*y.y},ctrl2:{x:m.end.x+T*x.x,y:m.end.y+T*x.y},networkId:m.networkId,t1:A,t2:g,perpDir1:y,perpDir2:x,d1:B,d2:T,containedBy:d[f],contains:u[f]}}),this.sampledPoints=this.traces.map(()=>new Float64Array(12)),this.traceBounds=this.traces.map(()=>({minX:0,maxX:0,minY:0,maxY:0})),this.updateSampledTraces(),this.updateCollisionPairs()}updateSampledTraces(){for(let e=0;e<this.traces.length;e++){let t=this.traces[e];t3e(t.waypointPair.start.x,t.waypointPair.start.y,t.ctrl1.x,t.ctrl1.y,t.ctrl2.x,t.ctrl2.y,t.waypointPair.end.x,t.waypointPair.end.y,this.sampledPoints[e],5),this.traceBounds[e]=$zt(this.sampledPoints[e],6)}}updateSingleTraceSample(e){let t=this.traces[e];t3e(t.waypointPair.start.x,t.waypointPair.start.y,t.ctrl1.x,t.ctrl1.y,t.ctrl2.x,t.ctrl2.y,t.waypointPair.end.x,t.waypointPair.end.y,this.sampledPoints[e],5),this.traceBounds[e]=$zt(this.sampledPoints[e],6)}updateControlPointsFromDistances(e){let t=this.traces[e],{minX:n,maxX:o,minY:r,maxY:i}=this.problem.bounds,a=t.waypointPair.start.x+t.d1*t.perpDir1.x,c=t.waypointPair.start.y+t.d1*t.perpDir1.y,l=t.waypointPair.end.x+t.d2*t.perpDir2.x,h=t.waypointPair.end.y+t.d2*t.perpDir2.y,d=t.waypointPair.start;Math.abs(d.x-n)<0.000001&&(a=Math.max(a,n)),Math.abs(d.x-o)<0.000001&&(a=Math.min(a,o)),Math.abs(d.y-r)<0.000001&&(c=Math.max(c,r)),Math.abs(d.y-i)<0.000001&&(c=Math.min(c,i));let u=t.waypointPair.end;Math.abs(u.x-n)<0.000001&&(l=Math.max(l,n)),Math.abs(u.x-o)<0.000001&&(l=Math.min(l,o)),Math.abs(u.y-r)<0.000001&&(h=Math.max(h,r)),Math.abs(u.y-i)<0.000001&&(h=Math.min(h,i)),a=Math.max(n,Math.min(o,a)),c=Math.max(r,Math.min(i,c)),l=Math.max(n,Math.min(o,l)),h=Math.max(r,Math.min(i,h)),t.ctrl1.x=a,t.ctrl1.y=c,t.ctrl2.x=l,t.ctrl2.y=h}updateCollisionPairs(){let e=this.effectiveTraceToTraceSpacing;this.collisionPairs=[];for(let t=0;t<this.traces.length;t++)for(let n=t+1;n<this.traces.length;n++){let o=this.traces[t],r=this.traces[n];if(o.networkId&&r.networkId&&o.networkId===r.networkId)continue;let i=this.traceBounds[t],s=this.traceBounds[n];i.maxX+e>=s.minX&&s.maxX+e>=i.minX&&i.maxY+e>=s.minY&&s.maxY+e>=i.minY&&this.collisionPairs.push([t,n])}}computeTotalCost(){let{preferredObstacleToTraceSpacing:e}=this.problem,t=this.effectiveTraceToTraceSpacing,n=t**2,o=e**2,r=0;for(let[i,s]of this.collisionPairs){let a=this.sampledPoints[i],c=this.sampledPoints[s];for(let l=0;l<5;l++){let h=a[2*l],d=a[2*l+1],u=a[2*(l+1)],_=a[2*(l+1)+1];for(let p=0;p<5;p++){let m=o3e(h,d,u,_,c[2*p],c[2*p+1],c[2*(p+1)],c[2*(p+1)+1]);if(m<n)r+=(t-Math.sqrt(m))**2,m<0.000000000000000001&&(r+=20*n)}}}for(let i=0;i<this.traces.length;i++){let s=this.traces[i],a=this.sampledPoints[i],c=this.traceBounds[i];for(let l=0;l<this.numObstacleSegments;l++){if(s.networkId&&this.obstacleNetworkIds[l]&&s.networkId===this.obstacleNetworkIds[l])continue;let h=4*l,d=this.obstacleSegments[h],u=this.obstacleSegments[h+1],_=this.obstacleSegments[h+2],p=this.obstacleSegments[h+3],m=Math.min(d,_),A=Math.max(d,_),g=Math.min(u,p),f=Math.max(u,p);if(!(c.maxX+e<m||A+e<c.minX||c.maxY+e<g||f+e<c.minY))for(let y=0;y<5;y++){let x=o3e(a[2*y],a[2*y+1],a[2*(y+1)],a[2*(y+1)+1],d,u,_,p);if(x<o)r+=(e-Math.sqrt(x))**2,x<0.000000000000000001&&(r+=20*o)}}}return r}computeCostForTrace(e){let{preferredObstacleToTraceSpacing:t}=this.problem,n=this.effectiveTraceToTraceSpacing,o=n**2,r=t**2,i=this.traces[e],s=this.sampledPoints[e],a=this.traceBounds[e],c=0;for(let l=0;l<this.traces.length;l++){if(l===e)continue;let h=this.traces[l];if(i.networkId&&h.networkId&&i.networkId===h.networkId)continue;let d=this.traceBounds[l];if(a.maxX+n<d.minX||d.maxX+n<a.minX||a.maxY+n<d.minY||d.maxY+n<a.minY)continue;let u=this.sampledPoints[l];for(let _=0;_<5;_++){let p=s[2*_],m=s[2*_+1],A=s[2*(_+1)],g=s[2*(_+1)+1];for(let f=0;f<5;f++){let y=o3e(p,m,A,g,u[2*f],u[2*f+1],u[2*(f+1)],u[2*(f+1)+1]);if(y<o)c+=(n-Math.sqrt(y))**2,y<0.000000000000000001&&(c+=20*o)}}}for(let l=0;l<this.numObstacleSegments;l++){if(i.networkId&&this.obstacleNetworkIds[l]&&i.networkId===this.obstacleNetworkIds[l])continue;let h=4*l,d=this.obstacleSegments[h],u=this.obstacleSegments[h+1],_=this.obstacleSegments[h+2],p=this.obstacleSegments[h+3],m=Math.min(d,_),A=Math.max(d,_),g=Math.min(u,p),f=Math.max(u,p);if(!(a.maxX+t<m||A+t<a.minX||a.maxY+t<g||f+t<a.minY))for(let y=0;y<5;y++){let x=o3e(s[2*y],s[2*y+1],s[2*(y+1)],s[2*(y+1)+1],d,u,_,p);if(x<r)c+=(t-Math.sqrt(x))**2,x<0.000000000000000001&&(c+=20*r)}}return c}tracesIntersect(e,t){let n=this.traces[e],o=this.traces[t],i=new Float64Array(32),s=new Float64Array(32);t3e(n.waypointPair.start.x,n.waypointPair.start.y,n.ctrl1.x,n.ctrl1.y,n.ctrl2.x,n.ctrl2.y,n.waypointPair.end.x,n.waypointPair.end.y,i,15),t3e(o.waypointPair.start.x,o.waypointPair.start.y,o.ctrl1.x,o.ctrl1.y,o.ctrl2.x,o.ctrl2.y,o.waypointPair.end.x,o.waypointPair.end.y,s,15);for(let a=0;a<15;a++){let c=i[2*a],l=i[2*a+1],h=i[2*(a+1)],d=i[2*(a+1)+1];for(let u=0;u<15;u++)if(exr(c,l,h,d,s[2*u],s[2*u+1],s[2*(u+1)],s[2*(u+1)+1]))return!0}return!1}findIntersectingPairs(){let e=[];for(let t=0;t<this.traces.length;t++)for(let n=t+1;n<this.traces.length;n++){let o=this.traces[t],r=this.traces[n];if(o.networkId&&r.networkId&&o.networkId===r.networkId)continue;let i=this.traceBounds[t],s=this.traceBounds[n];i.maxX<s.minX||s.maxX<i.minX||i.maxY<s.minY||s.maxY<i.minY||this.tracesIntersect(t,n)&&e.push([t,n])}return e}resolveIntersections(){let{bounds:e,preferredTraceToTraceSpacing:t}=this.problem,{minX:n,maxX:o,minY:r,maxY:i}=e,s=Math.min(o-n,i-r),a=0.02*s,c=1.5*s,l=this.findIntersectingPairs();if(l.length===0)return 0;let h=0;for(let[d,u]of l){let _=this.traces[d],p=this.traces[u];if(!this.tracesIntersect(d,u))continue;let m,A;if(_.containedBy.includes(u))m=u,A=d;else if(p.containedBy.includes(d))m=d,A=u;else(_.d1+_.d2)/2<(p.d1+p.d2)/2?(m=d,A=u):(m=u,A=d);let g=this.traces[m],f=this.traces[A],{d1:y,d2:x}=g,{d1:C,d2:b}=f,I=2*t,v=[{innerMult:1,outerMult:0},{innerMult:0,outerMult:1},{innerMult:0.5,outerMult:0.5},{innerMult:2,outerMult:0},{innerMult:1,outerMult:1},{innerMult:3,outerMult:0},{innerMult:2,outerMult:1},{innerMult:4,outerMult:0}],P=this.computeTotalCost(),M=null;for(let B of v)if(g.d1=y,g.d2=x,f.d1=C,f.d2=b,f.d1=Math.min(c,C+I*B.innerMult),f.d2=Math.min(c,b+I*B.innerMult),g.d1=Math.max(a,y-I*B.outerMult),g.d2=Math.max(a,x-I*B.outerMult),this.updateControlPointsFromDistances(A),this.updateControlPointsFromDistances(m),this.updateSingleTraceSample(A),this.updateSingleTraceSample(m),!this.tracesIntersect(m,A)){let T=this.computeTotalCost();(M===null||T<P)&&(P=T,M=B)}M?(f.d1=Math.min(c,C+I*M.innerMult),f.d2=Math.min(c,b+I*M.innerMult),g.d1=Math.max(a,y-I*M.outerMult),g.d2=Math.max(a,x-I*M.outerMult),this.updateControlPointsFromDistances(A),this.updateControlPointsFromDistances(m),this.updateSingleTraceSample(A),this.updateSingleTraceSample(m),h++):(g.d1=y,g.d2=x,f.d1=C,f.d2=b,this.updateControlPointsFromDistances(m),this.updateControlPointsFromDistances(A),this.updateSingleTraceSample(m),this.updateSingleTraceSample(A))}return h}optimizeStep(){let{bounds:e}=this.problem,{minX:t,maxX:n,minY:o,maxY:r}=e,i=Math.min(n-t,r-o),s=this.effectiveTraceToTraceSpacing,a=4*(1-this.optimizationStep/this.maxOptimizationSteps)+0.5,c=0.02*i,l=1.5*i,h=[];for(let d=0;d<this.traces.length;d++)h.push({idx:d,cost:this.computeCostForTrace(d)});h.sort((d,u)=>u.cost-d.cost);for(let{idx:d,cost:u}of h){if(u===0)continue;let _=this.traces[d],p=u>100?2:1,m=[a*p,1.5*a*p,0.5*a];for(let A of m){let g=u>100?[A,-A,2*A,2*-A,3*A,3*-A,2*s,2*-s]:[A,-A,2*A,2*-A],f=this.computeCostForTrace(d),{d1:y,d2:x,d1:C,d2:b}=_;for(let I of g){_.d1=Math.max(c,Math.min(l,C+I)),this.updateControlPointsFromDistances(d),this.updateSingleTraceSample(d);let v=this.computeCostForTrace(d);v<f&&(f=v,y=_.d1,x=b),_.d1=C,this.updateControlPointsFromDistances(d),_.d2=Math.max(c,Math.min(l,b+I)),this.updateControlPointsFromDistances(d),this.updateSingleTraceSample(d);let P=this.computeCostForTrace(d);P<f&&(f=P,y=C,x=_.d2),_.d2=b,this.updateControlPointsFromDistances(d),_.d1=Math.max(c,Math.min(l,C+I)),_.d2=Math.max(c,Math.min(l,b+I)),this.updateControlPointsFromDistances(d),this.updateSingleTraceSample(d);let M=this.computeCostForTrace(d);M<f&&(f=M,y=_.d1,x=_.d2),_.d1=C,_.d2=b,this.updateControlPointsFromDistances(d),_.d1=Math.max(c,Math.min(l,C+I)),_.d2=Math.max(c,Math.min(l,b-I)),this.updateControlPointsFromDistances(d),this.updateSingleTraceSample(d);let B=this.computeCostForTrace(d);B<f&&(f=B,y=_.d1,x=_.d2),_.d1=C,_.d2=b,this.updateControlPointsFromDistances(d)}if(_.d1=y,_.d2=x,this.updateControlPointsFromDistances(d),this.updateSingleTraceSample(d),f<0.9*u)break}}this.optimizationStep%10==0&&this.updateCollisionPairs()}buildOutputTraces(){this.outputTraces=this.traces.map((e)=>({waypointPair:e.waypointPair,points:Zyr(e.waypointPair.start,e.ctrl1,e.ctrl2,e.waypointPair.end,20),networkId:e.networkId}))}_step(){if(this.traces.length===0&&(this.effectiveTraceToTraceSpacing=3*this.problem.preferredTraceToTraceSpacing,this.initializeTraces(),this.lastCost=this.computeTotalCost(),this.stagnantSteps=0),this.optimizationStep<this.maxOptimizationSteps){let t=3+-2*(this.optimizationStep/this.maxOptimizationSteps);if(this.effectiveTraceToTraceSpacing=this.problem.preferredTraceToTraceSpacing*t,this.optimizeStep(),this.optimizationStep++,this.optimizationStep%10==0)this.resolveIntersections()>0&&this.updateCollisionPairs();let n=this.computeTotalCost();if(n===0)this.optimizationStep=this.maxOptimizationSteps;else if(n>=0.99*this.lastCost){if(this.stagnantSteps++,this.stagnantSteps>10)this.resolveIntersections()>0?(this.updateCollisionPairs(),this.stagnantSteps=0):this.stagnantSteps>15&&(this.optimizationStep=this.maxOptimizationSteps)}else this.stagnantSteps=0;this.lastCost=n}this.optimizationStep>=this.maxOptimizationSteps&&(this.resolveIntersections(),this.buildOutputTraces(),this.solved=!0)}visualize(){return this.traces.length>0&&this.buildOutputTraces(),((e,t=[])=>{let n={arrows:[],circles:[],lines:[],rects:[],coordinateSystem:"cartesian",points:[],texts:[],title:"Curvy Trace Problem"};n.lines.push({points:[{x:e.bounds.minX,y:e.bounds.minY},{x:e.bounds.maxX,y:e.bounds.minY},{x:e.bounds.maxX,y:e.bounds.maxY},{x:e.bounds.minX,y:e.bounds.maxY},{x:e.bounds.minX,y:e.bounds.minY}],strokeColor:"rgba(0, 0, 0, 0.1)"});for(let o of e.waypointPairs)n.points.push({...o.start,label:`start ${o.networkId??""}`,color:BXe(o.networkId)}),n.points.push({...o.end,label:`end ${o.networkId??""}`,color:BXe(o.networkId)});for(let o of e.obstacles)n.rects.push({center:o.center,width:o.maxX-o.minX,height:o.maxY-o.minY,fill:"rgba(128, 128, 128, 0.3)",stroke:"rgba(128, 128, 128, 0.8)",label:`netId: ${o.networkId}`});for(let o of t)n.lines.push({points:o.points,strokeColor:BXe(o.networkId)});return n})(this.problem,this.outputTraces)}},qzt=class extends ei{getSolverName(){return"CurvyIntraNodeSolver"}nodeWithPortPoints;colorMap;traceWidth;viaDiameter;adjacentObstacles;routes=[];curvyTraceSolver;phase="initializing";constructor(e){super(),this.nodeWithPortPoints=e.nodeWithPortPoints,this.colorMap=e.colorMap??{},this.traceWidth=e.traceWidth??0.15,this.viaDiameter=e.viaDiameter??0.3,this.adjacentObstacles=e.adjacentObstacles??[],this.MAX_ITERATIONS=1000}_step(){switch(this.phase){case"initializing":this._initializeCurvySolver();break;case"solving":this._stepCurvySolver();break;case"done":this.solved=!0}}_initializeCurvySolver(){let e=this.nodeWithPortPoints,t={minX:e.center.x-e.width/2,minY:e.center.y-e.height/2,maxX:e.center.x+e.width/2,maxY:e.center.y+e.height/2},n=new Map;for(let i of e.portPoints)n.has(i.connectionName)||n.set(i.connectionName,[]),n.get(i.connectionName).push(i);let o=[];for(let[i,s]of n){if(s.length<2)continue;let a=s[0],c=s[s.length-1];o.push({start:{x:a.x,y:a.y},end:{x:c.x,y:c.y},networkId:i})}if(o.length===0)return void(this.phase="done");let r={bounds:t,waypointPairs:o,obstacles:this.adjacentObstacles.map((i)=>({minX:i.minX,minY:i.minY,maxX:i.maxX,maxY:i.maxY,center:{x:(i.minX+i.maxX)/2,y:(i.minY+i.maxY)/2},networkId:i.networkId})),preferredTraceToTraceSpacing:2*this.traceWidth,preferredObstacleToTraceSpacing:2*this.traceWidth};this.curvyTraceSolver=new din(r),this.phase="solving"}_stepCurvySolver(){this.curvyTraceSolver?(this.activeSubSolver=this.curvyTraceSolver,this.curvyTraceSolver.step(),this.curvyTraceSolver.solved?(this._convertOutputTraces(),this.phase="done"):this.curvyTraceSolver.failed&&(this.error=this.curvyTraceSolver.error,this.failed=!0)):this.phase="done"}_convertOutputTraces(){if(!this.curvyTraceSolver)return;let e=this.nodeWithPortPoints,t=new Map;for(let n of e.portPoints){let o=n.connectionName;t.has(o)||t.set(o,{connectionName:n.connectionName,rootConnectionName:n.rootConnectionName,z:n.z})}for(let n of this.curvyTraceSolver.outputTraces){let o=n.networkId??"",r=t.get(o);if(!r)continue;let i={connectionName:r.connectionName,rootConnectionName:r.rootConnectionName,traceThickness:this.traceWidth,viaDiameter:this.viaDiameter,route:n.points.map((s)=>({x:s.x,y:s.y,z:r.z})),vias:[]};this.routes.push(i)}}getConstructorParams(){return{nodeWithPortPoints:this.nodeWithPortPoints,colorMap:this.colorMap,traceWidth:this.traceWidth,viaDiameter:this.viaDiameter,adjacentObstacles:this.adjacentObstacles}}visualize(){let e={lines:[],points:[],rects:[],circles:[]},t=this.nodeWithPortPoints;e.rects.push({center:t.center,width:t.width,height:t.height,fill:"rgba(0, 200, 0, 0.1)",stroke:"rgba(0, 200, 0, 0.5)",label:t.capacityMeshNodeId});for(let n of this.adjacentObstacles)e.rects.push({center:{x:(n.minX+n.maxX)/2,y:(n.minY+n.maxY)/2},width:n.maxX-n.minX,height:n.maxY-n.minY,fill:"rgba(255, 0, 0, 0.1)",stroke:"rgba(255, 0, 0, 0.3)",label:`obstacle: ${n.networkId??""}`});if(this.curvyTraceSolver){let n=this.curvyTraceSolver.visualize();n.lines&&e.lines.push(...n.lines),n.points&&e.points.push(...n.points),n.rects&&e.rects.push(...n.rects),n.circles&&e.circles.push(...n.circles)}for(let n of this.routes){let o=this.colorMap[n.connectionName]??"gray";e.lines.push({points:n.route.map((r)=>({x:r.x,y:r.y})),strokeColor:o,strokeWidth:this.traceWidth,label:n.connectionName})}for(let n of t.portPoints){let o=this.colorMap[n.connectionName]??"gray";e.points.push({x:n.x,y:n.y,color:o,label:n.connectionName})}return e}},{create:nxr,defineProperty:Jzt,getOwnPropertyDescriptor:oxr,getOwnPropertyNames:uin,getPrototypeOf:rxr}=Object,ixr=Object.prototype.hasOwnProperty,H3=(e,t)=>function(){return t||(0,e[uin(e)[0]])((t={exports:{}}).exports,t),t.exports},qbe=H3({"node_modules/binary-search-bounds/search-bounds.js"(e,t){function n(c,l,h,d,u){for(var _=u+1;d<=u;){var p=d+u>>>1,m=c[p];(h!==void 0?h(m,l):m-l)>=0?(_=p,u=p-1):d=p+1}return _}function o(c,l,h,d,u){for(var _=u+1;d<=u;){var p=d+u>>>1,m=c[p];(h!==void 0?h(m,l):m-l)>0?(_=p,u=p-1):d=p+1}return _}function r(c,l,h,d,u){for(var _=d-1;d<=u;){var p=d+u>>>1,m=c[p];(h!==void 0?h(m,l):m-l)<0?(_=p,d=p+1):u=p-1}return _}function i(c,l,h,d,u){for(var _=d-1;d<=u;){var p=d+u>>>1,m=c[p];(h!==void 0?h(m,l):m-l)<=0?(_=p,d=p+1):u=p-1}return _}function s(c,l,h,d,u){for(;d<=u;){var _=d+u>>>1,p=c[_],m=h!==void 0?h(p,l):p-l;if(m===0)return _;m<=0?d=_+1:u=_-1}return-1}function a(c,l,h,d,u,_){return typeof h=="function"?_(c,l,h,d===void 0?0:0|d,u===void 0?c.length-1:0|u):_(c,l,void 0,h===void 0?0:0|h,d===void 0?c.length-1:0|d)}t.exports={ge:function(c,l,h,d,u){return a(c,l,h,d,u,n)},gt:function(c,l,h,d,u){return a(c,l,h,d,u,o)},lt:function(c,l,h,d,u){return a(c,l,h,d,u,r)},le:function(c,l,h,d,u){return a(c,l,h,d,u,i)},eq:function(c,l,h,d,u){return a(c,l,h,d,u,s)}}}}),TZe=H3({"node_modules/two-product/two-product.js"(e,t){t.exports=function(o,r,i){var s=o*r,a=n*o,c=a-(a-o),l=o-c,h=n*r,d=h-(h-r),u=r-d,_=l*u-(s-c*d-l*d-c*u);if(i)return i[0]=_,i[1]=s,i;return[_,s]};var n=+(Math.pow(2,27)+1)}}),pin=H3({"node_modules/robust-sum/robust-sum.js"(e,t){t.exports=function(n,o){var r=0|n.length,i=0|o.length;if(r===1&&i===1)return function(v,P){var M=v+P,B=M-v,T=M-B,N=P-B,D=v-T,L=D+N;if(L)return[L,M];return[M]}(n[0],o[0]);var s,a,c=Array(r+i),l=0,h=0,d=0,u=Math.abs,_=n[h],p=u(_),m=o[d],A=u(m);p<A?(a=_,(h+=1)<r&&(p=u(_=n[h]))):(a=m,(d+=1)<i&&(A=u(m=o[d]))),h<r&&p<A||d>=i?(s=_,(h+=1)<r&&(p=u(_=n[h]))):(s=m,(d+=1)<i&&(A=u(m=o[d])));var g,f,y=s+a,x=y-s,C=a-x,b=C,I=y;for(;h<r&&d<i;)p<A?(s=_,(h+=1)<r&&(p=u(_=n[h]))):(s=m,(d+=1)<i&&(A=u(m=o[d]))),(C=(a=b)-(x=(y=s+a)-s))&&(c[l++]=C),b=I-((g=I+y)-(f=g-I))+(y-f),I=g;for(;h<r;)(C=(a=b)-(x=(y=(s=_)+a)-s))&&(c[l++]=C),b=I-((g=I+y)-(f=g-I))+(y-f),I=g,(h+=1)<r&&(_=n[h]);for(;d<i;)(C=(a=b)-(x=(y=(s=m)+a)-s))&&(c[l++]=C),b=I-((g=I+y)-(f=g-I))+(y-f),I=g,(d+=1)<i&&(m=o[d]);return b&&(c[l++]=b),I&&(c[l++]=I),l||(c[l++]=0),c.length=l,c}}}),sxr=H3({"node_modules/two-sum/two-sum.js"(e,t){t.exports=function(n,o,r){var i=n+o,s=i-n,a=o-s,c=n-(i-s);if(r)return r[0]=c+a,r[1]=i,r;return[c+a,i]}}}),min=H3({"node_modules/robust-scale/robust-scale.js"(e,t){var n=TZe(),o=sxr();t.exports=function(r,i){var s=r.length;if(s===1){var a=n(r[0],i);return a[0]?a:[a[1]]}var c=Array(2*s),l=[0.1,0.1],h=[0.1,0.1],d=0;n(r[0],i,l),l[0]&&(c[d++]=l[0]);for(var u=1;u<s;++u){n(r[u],i,h);var _=l[1];o(_,h[0],l),l[0]&&(c[d++]=l[0]);var p=h[1],m=l[1],A=p+m,g=m-(A-p);l[1]=A,g&&(c[d++]=g)}return l[1]&&(c[d++]=l[1]),d===0&&(c[d++]=0),c.length=d,c}}}),_in=H3({"node_modules/robust-subtract/robust-diff.js"(e,t){t.exports=function(n,o){var r=0|n.length,i=0|o.length;if(r===1&&i===1)return function(v,P){var M=v+P,B=M-v,T=M-B,N=P-B,D=v-T,L=D+N;if(L)return[L,M];return[M]}(n[0],-o[0]);var s,a,c=Array(r+i),l=0,h=0,d=0,u=Math.abs,_=n[h],p=u(_),m=-o[d],A=u(m);p<A?(a=_,(h+=1)<r&&(p=u(_=n[h]))):(a=m,(d+=1)<i&&(A=u(m=-o[d]))),h<r&&p<A||d>=i?(s=_,(h+=1)<r&&(p=u(_=n[h]))):(s=m,(d+=1)<i&&(A=u(m=-o[d])));var g,f,y=s+a,x=y-s,C=a-x,b=C,I=y;for(;h<r&&d<i;)p<A?(s=_,(h+=1)<r&&(p=u(_=n[h]))):(s=m,(d+=1)<i&&(A=u(m=-o[d]))),(C=(a=b)-(x=(y=s+a)-s))&&(c[l++]=C),b=I-((g=I+y)-(f=g-I))+(y-f),I=g;for(;h<r;)(C=(a=b)-(x=(y=(s=_)+a)-s))&&(c[l++]=C),b=I-((g=I+y)-(f=g-I))+(y-f),I=g,(h+=1)<r&&(_=n[h]);for(;d<i;)(C=(a=b)-(x=(y=(s=m)+a)-s))&&(c[l++]=C),b=I-((g=I+y)-(f=g-I))+(y-f),I=g,(d+=1)<i&&(m=-o[d]);return b&&(c[l++]=b),I&&(c[l++]=I),l||(c[l++]=0),c.length=l,c}}}),axr=H3({"node_modules/robust-orientation/orientation.js"(e,t){var n=TZe(),o=pin(),r=min(),i=_in();function s(m,A,g,f){return function(y,x,C){var b=m(m(A(x[1],C[0]),A(-C[1],x[0])),m(A(y[1],x[0]),A(-x[1],y[0]))),I=m(A(y[1],C[0]),A(-C[1],y[0])),v=f(b,I);return v[v.length-1]}}function a(m,A,g,f){return function(y,x,C,b){var I=m(m(g(m(A(C[1],b[0]),A(-b[1],C[0])),x[2]),m(g(m(A(x[1],b[0]),A(-b[1],x[0])),-C[2]),g(m(A(x[1],C[0]),A(-C[1],x[0])),b[2]))),m(g(m(A(x[1],b[0]),A(-b[1],x[0])),y[2]),m(g(m(A(y[1],b[0]),A(-b[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),b[2])))),v=m(m(g(m(A(C[1],b[0]),A(-b[1],C[0])),y[2]),m(g(m(A(y[1],b[0]),A(-b[1],y[0])),-C[2]),g(m(A(y[1],C[0]),A(-C[1],y[0])),b[2]))),m(g(m(A(x[1],C[0]),A(-C[1],x[0])),y[2]),m(g(m(A(y[1],C[0]),A(-C[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),C[2])))),P=f(I,v);return P[P.length-1]}}function c(m,A,g,f){return function(y,x,C,b,I){var v=m(m(m(g(m(g(m(A(b[1],I[0]),A(-I[1],b[0])),C[2]),m(g(m(A(C[1],I[0]),A(-I[1],C[0])),-b[2]),g(m(A(C[1],b[0]),A(-b[1],C[0])),I[2]))),x[3]),m(g(m(g(m(A(b[1],I[0]),A(-I[1],b[0])),x[2]),m(g(m(A(x[1],I[0]),A(-I[1],x[0])),-b[2]),g(m(A(x[1],b[0]),A(-b[1],x[0])),I[2]))),-C[3]),g(m(g(m(A(C[1],I[0]),A(-I[1],C[0])),x[2]),m(g(m(A(x[1],I[0]),A(-I[1],x[0])),-C[2]),g(m(A(x[1],C[0]),A(-C[1],x[0])),I[2]))),b[3]))),m(g(m(g(m(A(C[1],b[0]),A(-b[1],C[0])),x[2]),m(g(m(A(x[1],b[0]),A(-b[1],x[0])),-C[2]),g(m(A(x[1],C[0]),A(-C[1],x[0])),b[2]))),-I[3]),m(g(m(g(m(A(b[1],I[0]),A(-I[1],b[0])),x[2]),m(g(m(A(x[1],I[0]),A(-I[1],x[0])),-b[2]),g(m(A(x[1],b[0]),A(-b[1],x[0])),I[2]))),y[3]),g(m(g(m(A(b[1],I[0]),A(-I[1],b[0])),y[2]),m(g(m(A(y[1],I[0]),A(-I[1],y[0])),-b[2]),g(m(A(y[1],b[0]),A(-b[1],y[0])),I[2]))),-x[3])))),m(m(g(m(g(m(A(x[1],I[0]),A(-I[1],x[0])),y[2]),m(g(m(A(y[1],I[0]),A(-I[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),I[2]))),b[3]),m(g(m(g(m(A(x[1],b[0]),A(-b[1],x[0])),y[2]),m(g(m(A(y[1],b[0]),A(-b[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),b[2]))),-I[3]),g(m(g(m(A(C[1],b[0]),A(-b[1],C[0])),x[2]),m(g(m(A(x[1],b[0]),A(-b[1],x[0])),-C[2]),g(m(A(x[1],C[0]),A(-C[1],x[0])),b[2]))),y[3]))),m(g(m(g(m(A(C[1],b[0]),A(-b[1],C[0])),y[2]),m(g(m(A(y[1],b[0]),A(-b[1],y[0])),-C[2]),g(m(A(y[1],C[0]),A(-C[1],y[0])),b[2]))),-x[3]),m(g(m(g(m(A(x[1],b[0]),A(-b[1],x[0])),y[2]),m(g(m(A(y[1],b[0]),A(-b[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),b[2]))),C[3]),g(m(g(m(A(x[1],C[0]),A(-C[1],x[0])),y[2]),m(g(m(A(y[1],C[0]),A(-C[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),C[2]))),-b[3]))))),P=m(m(m(g(m(g(m(A(b[1],I[0]),A(-I[1],b[0])),C[2]),m(g(m(A(C[1],I[0]),A(-I[1],C[0])),-b[2]),g(m(A(C[1],b[0]),A(-b[1],C[0])),I[2]))),y[3]),g(m(g(m(A(b[1],I[0]),A(-I[1],b[0])),y[2]),m(g(m(A(y[1],I[0]),A(-I[1],y[0])),-b[2]),g(m(A(y[1],b[0]),A(-b[1],y[0])),I[2]))),-C[3])),m(g(m(g(m(A(C[1],I[0]),A(-I[1],C[0])),y[2]),m(g(m(A(y[1],I[0]),A(-I[1],y[0])),-C[2]),g(m(A(y[1],C[0]),A(-C[1],y[0])),I[2]))),b[3]),g(m(g(m(A(C[1],b[0]),A(-b[1],C[0])),y[2]),m(g(m(A(y[1],b[0]),A(-b[1],y[0])),-C[2]),g(m(A(y[1],C[0]),A(-C[1],y[0])),b[2]))),-I[3]))),m(m(g(m(g(m(A(C[1],I[0]),A(-I[1],C[0])),x[2]),m(g(m(A(x[1],I[0]),A(-I[1],x[0])),-C[2]),g(m(A(x[1],C[0]),A(-C[1],x[0])),I[2]))),y[3]),g(m(g(m(A(C[1],I[0]),A(-I[1],C[0])),y[2]),m(g(m(A(y[1],I[0]),A(-I[1],y[0])),-C[2]),g(m(A(y[1],C[0]),A(-C[1],y[0])),I[2]))),-x[3])),m(g(m(g(m(A(x[1],I[0]),A(-I[1],x[0])),y[2]),m(g(m(A(y[1],I[0]),A(-I[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),I[2]))),C[3]),g(m(g(m(A(x[1],C[0]),A(-C[1],x[0])),y[2]),m(g(m(A(y[1],C[0]),A(-C[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),C[2]))),-I[3])))),M=f(v,P);return M[M.length-1]}}function l(m){return(m===3?s:m===4?a:c)(o,n,r,i)}var h=l(3),d=l(4),u=[function(){return 0},function(){return 0},function(m,A){return A[0]-m[0]},function(m,A,g){var f,y=(m[1]-g[1])*(A[0]-g[0]),x=(m[0]-g[0])*(A[1]-g[1]),C=y-x;if(y>0){if(x<=0)return C;f=y+x}else{if(!(y<0))return C;if(x>=0)return C;f=-(y+x)}var b=0.00000000000000033306690738754716*f;return C>=b||C<=-b?C:h(m,A,g)},function(m,A,g,f){var y=m[0]-f[0],x=A[0]-f[0],C=g[0]-f[0],b=m[1]-f[1],I=A[1]-f[1],v=g[1]-f[1],P=m[2]-f[2],M=A[2]-f[2],B=g[2]-f[2],T=x*v,N=C*I,D=C*b,L=y*v,H=y*I,V=x*b,O=P*(T-N)+M*(D-L)+B*(H-V),U=0.0000000000000007771561172376103*((Math.abs(T)+Math.abs(N))*Math.abs(P)+(Math.abs(D)+Math.abs(L))*Math.abs(M)+(Math.abs(H)+Math.abs(V))*Math.abs(B));return O>U||-O>U?O:d(m,A,g,f)}];function _(m){var A=u[m.length];return A||(A=u[m.length]=l(m.length)),A.apply(void 0,m)}function p(m,A,g,f,y,x,C){return function(b,I,v,P,M){switch(arguments.length){case 0:case 1:return 0;case 2:return f(b,I);case 3:return y(b,I,v);case 4:return x(b,I,v,P);case 5:return C(b,I,v,P,M)}for(var B=Array(arguments.length),T=0;T<arguments.length;++T)B[T]=arguments[T];return m(B)}}(function(){for(;u.length<=5;)u.push(l(u.length));t.exports=p.apply(void 0,[_].concat(u));for(var m=0;m<=5;++m)t.exports[m]=u[m]})()}}),cxr=H3({"node_modules/cdt2d/lib/monotone.js"(e,t){var n=qbe(),o=axr()[3];function r(u,_,p,m,A){this.a=u,this.b=_,this.idx=p,this.lowerIds=m,this.upperIds=A}function i(u,_,p,m){this.a=u,this.b=_,this.type=p,this.idx=m}function s(u,_){var p=u.a[0]-_.a[0]||u.a[1]-_.a[1]||u.type-_.type;return p||(u.type!==0&&(p=o(u.a,u.b,_.b))?p:u.idx-_.idx)}function a(u,_){return o(u.a,u.b,_)}function c(u,_,p,m,A){for(var g=n.lt(_,m,a),f=n.gt(_,m,a),y=g;y<f;++y){for(var x=_[y],C=x.lowerIds,b=C.length;b>1&&o(p[C[b-2]],p[C[b-1]],m)>0;)u.push([C[b-1],C[b-2],A]),b-=1;C.length=b,C.push(A);var I=x.upperIds;for(b=I.length;b>1&&o(p[I[b-2]],p[I[b-1]],m)<0;)u.push([I[b-2],I[b-1],A]),b-=1;I.length=b,I.push(A)}}function l(u,_){var p;return(p=u.a[0]<_.a[0]?o(u.a,u.b,_.a):o(_.b,_.a,u.a))?p:(p=_.b[0]<u.b[0]?o(u.a,u.b,_.b):o(_.b,_.a,u.b))||u.idx-_.idx}function h(u,_,p){var m=n.le(u,p,l),A=u[m],g=A.upperIds,f=g[g.length-1];A.upperIds=[f],u.splice(m+1,0,new r(p.a,p.b,p.idx,[f],g))}function d(u,_,p){var m=p.a;p.a=p.b,p.b=m;var A=n.eq(u,p,l),g=u[A];u[A-1].upperIds=g.upperIds,u.splice(A,1)}t.exports=function(u,_){for(var p=u.length,m=_.length,A=[],g=0;g<p;++g)A.push(new i(u[g],null,0,g));for(g=0;g<m;++g){var f=_[g],y=u[f[0]],x=u[f[1]];y[0]<x[0]?A.push(new i(y,x,2,g),new i(x,y,1,g)):y[0]>x[0]&&A.push(new i(x,y,2,g),new i(y,x,1,g))}A.sort(s);for(var C=A[0].a[0]-(1+Math.abs(A[0].a[0]))*Math.pow(2,-52),b=[new r([C,1],[C,0],-1,[],[],[],[])],I=[],v=(g=0,A.length);g<v;++g){var P=A[g],M=P.type;M===0?c(I,b,u,P.a,P.idx):M===2?h(b,u,P):d(b,u,P)}return I}}}),lxr=H3({"node_modules/cdt2d/lib/triangulation.js"(e,t){var n=qbe();function o(s,a){this.stars=s,this.edges=a}t.exports=function(s,a){for(var c=Array(s),l=0;l<s;++l)c[l]=[];return new o(c,a)};var r=o.prototype;function i(s,a,c){for(var l=1,h=s.length;l<h;l+=2)if(s[l-1]===a&&s[l]===c)return s[l-1]=s[h-2],s[l]=s[h-1],void(s.length=h-2)}r.isConstraint=function(){var s=[0,0];function a(c,l){return c[0]-l[0]||c[1]-l[1]}return function(c,l){return s[0]=Math.min(c,l),s[1]=Math.max(c,l),n.eq(this.edges,s,a)>=0}}(),r.removeTriangle=function(s,a,c){var l=this.stars;i(l[s],a,c),i(l[a],c,s),i(l[c],s,a)},r.addTriangle=function(s,a,c){var l=this.stars;l[s].push(a,c),l[a].push(c,s),l[c].push(s,a)},r.opposite=function(s,a){for(var c=this.stars[a],l=1,h=c.length;l<h;l+=2)if(c[l]===s)return c[l-1];return-1},r.flip=function(s,a){var c=this.opposite(s,a),l=this.opposite(a,s);this.removeTriangle(s,a,c),this.removeTriangle(a,s,l),this.addTriangle(s,l,c),this.addTriangle(a,c,l)},r.edges=function(){for(var s=this.stars,a=[],c=0,l=s.length;c<l;++c)for(var h=s[c],d=0,u=h.length;d<u;d+=2)a.push([h[d],h[d+1]]);return a},r.cells=function(){for(var s=this.stars,a=[],c=0,l=s.length;c<l;++c)for(var h=s[c],d=0,u=h.length;d<u;d+=2){var _=h[d],p=h[d+1];c<Math.min(_,p)&&a.push([c,_,p])}return a}}}),hxr=H3({"node_modules/robust-in-sphere/in-sphere.js"(e,t){var n=TZe(),o=pin(),r=_in(),i=min();function s(p){return(p===3?a:p===4?c:p===5?l:h)(o,r,n,i)}function a(p,m,A,g){return function(f,y,x){var C=A(f[0],f[0]),b=g(C,y[0]),I=g(C,x[0]),v=A(y[0],y[0]),P=g(v,f[0]),M=g(v,x[0]),B=A(x[0],x[0]),T=g(B,f[0]),N=g(B,y[0]),D=p(m(N,M),m(P,b)),L=m(T,I),H=m(D,L);return H[H.length-1]}}function c(p,m,A,g){return function(f,y,x,C){var b=p(A(f[0],f[0]),A(f[1],f[1])),I=g(b,y[0]),v=g(b,x[0]),P=g(b,C[0]),M=p(A(y[0],y[0]),A(y[1],y[1])),B=g(M,f[0]),T=g(M,x[0]),N=g(M,C[0]),D=p(A(x[0],x[0]),A(x[1],x[1])),L=g(D,f[0]),H=g(D,y[0]),V=g(D,C[0]),O=p(A(C[0],C[0]),A(C[1],C[1])),U=g(O,f[0]),j=g(O,y[0]),Y=g(O,x[0]),X=p(p(g(m(Y,V),y[1]),p(g(m(j,N),-x[1]),g(m(H,T),C[1]))),p(g(m(j,N),f[1]),p(g(m(U,P),-y[1]),g(m(B,I),C[1])))),K=p(p(g(m(Y,V),f[1]),p(g(m(U,P),-x[1]),g(m(L,v),C[1]))),p(g(m(H,T),f[1]),p(g(m(L,v),-y[1]),g(m(B,I),x[1])))),J=m(X,K);return J[J.length-1]}}function l(p,m,A,g){return function(f,y,x,C,b){var I=p(A(f[0],f[0]),p(A(f[1],f[1]),A(f[2],f[2]))),v=g(I,y[0]),P=g(I,x[0]),M=g(I,C[0]),B=g(I,b[0]),T=p(A(y[0],y[0]),p(A(y[1],y[1]),A(y[2],y[2]))),N=g(T,f[0]),D=g(T,x[0]),L=g(T,C[0]),H=g(T,b[0]),V=p(A(x[0],x[0]),p(A(x[1],x[1]),A(x[2],x[2]))),O=g(V,f[0]),U=g(V,y[0]),j=g(V,C[0]),Y=g(V,b[0]),X=p(A(C[0],C[0]),p(A(C[1],C[1]),A(C[2],C[2]))),K=g(X,f[0]),J=g(X,y[0]),ee=g(X,x[0]),se=g(X,b[0]),ne=p(A(b[0],b[0]),p(A(b[1],b[1]),A(b[2],b[2]))),re=g(ne,f[0]),Z=g(ne,y[0]),te=g(ne,x[0]),ie=g(ne,C[0]),le=p(p(p(g(p(g(m(ie,se),x[1]),p(g(m(te,Y),-C[1]),g(m(ee,j),b[1]))),y[2]),p(g(p(g(m(ie,se),y[1]),p(g(m(Z,H),-C[1]),g(m(J,L),b[1]))),-x[2]),g(p(g(m(te,Y),y[1]),p(g(m(Z,H),-x[1]),g(m(U,D),b[1]))),C[2]))),p(g(p(g(m(ee,j),y[1]),p(g(m(J,L),-x[1]),g(m(U,D),C[1]))),-b[2]),p(g(p(g(m(ie,se),y[1]),p(g(m(Z,H),-C[1]),g(m(J,L),b[1]))),f[2]),g(p(g(m(ie,se),f[1]),p(g(m(re,B),-C[1]),g(m(K,M),b[1]))),-y[2])))),p(p(g(p(g(m(Z,H),f[1]),p(g(m(re,B),-y[1]),g(m(N,v),b[1]))),C[2]),p(g(p(g(m(J,L),f[1]),p(g(m(K,M),-y[1]),g(m(N,v),C[1]))),-b[2]),g(p(g(m(ee,j),y[1]),p(g(m(J,L),-x[1]),g(m(U,D),C[1]))),f[2]))),p(g(p(g(m(ee,j),f[1]),p(g(m(K,M),-x[1]),g(m(O,P),C[1]))),-y[2]),p(g(p(g(m(J,L),f[1]),p(g(m(K,M),-y[1]),g(m(N,v),C[1]))),x[2]),g(p(g(m(U,D),f[1]),p(g(m(O,P),-y[1]),g(m(N,v),x[1]))),-C[2]))))),ue=p(p(p(g(p(g(m(ie,se),x[1]),p(g(m(te,Y),-C[1]),g(m(ee,j),b[1]))),f[2]),g(p(g(m(ie,se),f[1]),p(g(m(re,B),-C[1]),g(m(K,M),b[1]))),-x[2])),p(g(p(g(m(te,Y),f[1]),p(g(m(re,B),-x[1]),g(m(O,P),b[1]))),C[2]),g(p(g(m(ee,j),f[1]),p(g(m(K,M),-x[1]),g(m(O,P),C[1]))),-b[2]))),p(p(g(p(g(m(te,Y),y[1]),p(g(m(Z,H),-x[1]),g(m(U,D),b[1]))),f[2]),g(p(g(m(te,Y),f[1]),p(g(m(re,B),-x[1]),g(m(O,P),b[1]))),-y[2])),p(g(p(g(m(Z,H),f[1]),p(g(m(re,B),-y[1]),g(m(N,v),b[1]))),x[2]),g(p(g(m(U,D),f[1]),p(g(m(O,P),-y[1]),g(m(N,v),x[1]))),-b[2])))),de=m(le,ue);return de[de.length-1]}}function h(p,m,A,g){return function(f,y,x,C,b,I){var v=p(p(A(f[0],f[0]),A(f[1],f[1])),p(A(f[2],f[2]),A(f[3],f[3]))),P=g(v,y[0]),M=g(v,x[0]),B=g(v,C[0]),T=g(v,b[0]),N=g(v,I[0]),D=p(p(A(y[0],y[0]),A(y[1],y[1])),p(A(y[2],y[2]),A(y[3],y[3]))),L=g(D,f[0]),H=g(D,x[0]),V=g(D,C[0]),O=g(D,b[0]),U=g(D,I[0]),j=p(p(A(x[0],x[0]),A(x[1],x[1])),p(A(x[2],x[2]),A(x[3],x[3]))),Y=g(j,f[0]),X=g(j,y[0]),K=g(j,C[0]),J=g(j,b[0]),ee=g(j,I[0]),se=p(p(A(C[0],C[0]),A(C[1],C[1])),p(A(C[2],C[2]),A(C[3],C[3]))),ne=g(se,f[0]),re=g(se,y[0]),Z=g(se,x[0]),te=g(se,b[0]),ie=g(se,I[0]),le=p(p(A(b[0],b[0]),A(b[1],b[1])),p(A(b[2],b[2]),A(b[3],b[3]))),ue=g(le,f[0]),de=g(le,y[0]),me=g(le,x[0]),Ae=g(le,C[0]),xe=g(le,I[0]),Me=p(p(A(I[0],I[0]),A(I[1],I[1])),p(A(I[2],I[2]),A(I[3],I[3]))),Re=g(Me,f[0]),we=g(Me,y[0]),_e=g(Me,x[0]),ye=g(Me,C[0]),Se=g(Me,b[0]),Ne=p(p(p(g(p(p(g(p(g(m(Se,xe),C[1]),p(g(m(ye,ie),-b[1]),g(m(Ae,te),I[1]))),x[2]),g(p(g(m(Se,xe),x[1]),p(g(m(_e,ee),-b[1]),g(m(me,J),I[1]))),-C[2])),p(g(p(g(m(ye,ie),x[1]),p(g(m(_e,ee),-C[1]),g(m(Z,K),I[1]))),b[2]),g(p(g(m(Ae,te),x[1]),p(g(m(me,J),-C[1]),g(m(Z,K),b[1]))),-I[2]))),y[3]),p(g(p(p(g(p(g(m(Se,xe),C[1]),p(g(m(ye,ie),-b[1]),g(m(Ae,te),I[1]))),y[2]),g(p(g(m(Se,xe),y[1]),p(g(m(we,U),-b[1]),g(m(de,O),I[1]))),-C[2])),p(g(p(g(m(ye,ie),y[1]),p(g(m(we,U),-C[1]),g(m(re,V),I[1]))),b[2]),g(p(g(m(Ae,te),y[1]),p(g(m(de,O),-C[1]),g(m(re,V),b[1]))),-I[2]))),-x[3]),g(p(p(g(p(g(m(Se,xe),x[1]),p(g(m(_e,ee),-b[1]),g(m(me,J),I[1]))),y[2]),g(p(g(m(Se,xe),y[1]),p(g(m(we,U),-b[1]),g(m(de,O),I[1]))),-x[2])),p(g(p(g(m(_e,ee),y[1]),p(g(m(we,U),-x[1]),g(m(X,H),I[1]))),b[2]),g(p(g(m(me,J),y[1]),p(g(m(de,O),-x[1]),g(m(X,H),b[1]))),-I[2]))),C[3]))),p(p(g(p(p(g(p(g(m(ye,ie),x[1]),p(g(m(_e,ee),-C[1]),g(m(Z,K),I[1]))),y[2]),g(p(g(m(ye,ie),y[1]),p(g(m(we,U),-C[1]),g(m(re,V),I[1]))),-x[2])),p(g(p(g(m(_e,ee),y[1]),p(g(m(we,U),-x[1]),g(m(X,H),I[1]))),C[2]),g(p(g(m(Z,K),y[1]),p(g(m(re,V),-x[1]),g(m(X,H),C[1]))),-I[2]))),-b[3]),g(p(p(g(p(g(m(Ae,te),x[1]),p(g(m(me,J),-C[1]),g(m(Z,K),b[1]))),y[2]),g(p(g(m(Ae,te),y[1]),p(g(m(de,O),-C[1]),g(m(re,V),b[1]))),-x[2])),p(g(p(g(m(me,J),y[1]),p(g(m(de,O),-x[1]),g(m(X,H),b[1]))),C[2]),g(p(g(m(Z,K),y[1]),p(g(m(re,V),-x[1]),g(m(X,H),C[1]))),-b[2]))),I[3])),p(g(p(p(g(p(g(m(Se,xe),C[1]),p(g(m(ye,ie),-b[1]),g(m(Ae,te),I[1]))),y[2]),g(p(g(m(Se,xe),y[1]),p(g(m(we,U),-b[1]),g(m(de,O),I[1]))),-C[2])),p(g(p(g(m(ye,ie),y[1]),p(g(m(we,U),-C[1]),g(m(re,V),I[1]))),b[2]),g(p(g(m(Ae,te),y[1]),p(g(m(de,O),-C[1]),g(m(re,V),b[1]))),-I[2]))),f[3]),g(p(p(g(p(g(m(Se,xe),C[1]),p(g(m(ye,ie),-b[1]),g(m(Ae,te),I[1]))),f[2]),g(p(g(m(Se,xe),f[1]),p(g(m(Re,N),-b[1]),g(m(ue,T),I[1]))),-C[2])),p(g(p(g(m(ye,ie),f[1]),p(g(m(Re,N),-C[1]),g(m(ne,B),I[1]))),b[2]),g(p(g(m(Ae,te),f[1]),p(g(m(ue,T),-C[1]),g(m(ne,B),b[1]))),-I[2]))),-y[3])))),p(p(p(g(p(p(g(p(g(m(Se,xe),y[1]),p(g(m(we,U),-b[1]),g(m(de,O),I[1]))),f[2]),g(p(g(m(Se,xe),f[1]),p(g(m(Re,N),-b[1]),g(m(ue,T),I[1]))),-y[2])),p(g(p(g(m(we,U),f[1]),p(g(m(Re,N),-y[1]),g(m(L,P),I[1]))),b[2]),g(p(g(m(de,O),f[1]),p(g(m(ue,T),-y[1]),g(m(L,P),b[1]))),-I[2]))),C[3]),g(p(p(g(p(g(m(ye,ie),y[1]),p(g(m(we,U),-C[1]),g(m(re,V),I[1]))),f[2]),g(p(g(m(ye,ie),f[1]),p(g(m(Re,N),-C[1]),g(m(ne,B),I[1]))),-y[2])),p(g(p(g(m(we,U),f[1]),p(g(m(Re,N),-y[1]),g(m(L,P),I[1]))),C[2]),g(p(g(m(re,V),f[1]),p(g(m(ne,B),-y[1]),g(m(L,P),C[1]))),-I[2]))),-b[3])),p(g(p(p(g(p(g(m(Ae,te),y[1]),p(g(m(de,O),-C[1]),g(m(re,V),b[1]))),f[2]),g(p(g(m(Ae,te),f[1]),p(g(m(ue,T),-C[1]),g(m(ne,B),b[1]))),-y[2])),p(g(p(g(m(de,O),f[1]),p(g(m(ue,T),-y[1]),g(m(L,P),b[1]))),C[2]),g(p(g(m(re,V),f[1]),p(g(m(ne,B),-y[1]),g(m(L,P),C[1]))),-b[2]))),I[3]),g(p(p(g(p(g(m(ye,ie),x[1]),p(g(m(_e,ee),-C[1]),g(m(Z,K),I[1]))),y[2]),g(p(g(m(ye,ie),y[1]),p(g(m(we,U),-C[1]),g(m(re,V),I[1]))),-x[2])),p(g(p(g(m(_e,ee),y[1]),p(g(m(we,U),-x[1]),g(m(X,H),I[1]))),C[2]),g(p(g(m(Z,K),y[1]),p(g(m(re,V),-x[1]),g(m(X,H),C[1]))),-I[2]))),f[3]))),p(p(g(p(p(g(p(g(m(ye,ie),x[1]),p(g(m(_e,ee),-C[1]),g(m(Z,K),I[1]))),f[2]),g(p(g(m(ye,ie),f[1]),p(g(m(Re,N),-C[1]),g(m(ne,B),I[1]))),-x[2])),p(g(p(g(m(_e,ee),f[1]),p(g(m(Re,N),-x[1]),g(m(Y,M),I[1]))),C[2]),g(p(g(m(Z,K),f[1]),p(g(m(ne,B),-x[1]),g(m(Y,M),C[1]))),-I[2]))),-y[3]),g(p(p(g(p(g(m(ye,ie),y[1]),p(g(m(we,U),-C[1]),g(m(re,V),I[1]))),f[2]),g(p(g(m(ye,ie),f[1]),p(g(m(Re,N),-C[1]),g(m(ne,B),I[1]))),-y[2])),p(g(p(g(m(we,U),f[1]),p(g(m(Re,N),-y[1]),g(m(L,P),I[1]))),C[2]),g(p(g(m(re,V),f[1]),p(g(m(ne,B),-y[1]),g(m(L,P),C[1]))),-I[2]))),x[3])),p(g(p(p(g(p(g(m(_e,ee),y[1]),p(g(m(we,U),-x[1]),g(m(X,H),I[1]))),f[2]),g(p(g(m(_e,ee),f[1]),p(g(m(Re,N),-x[1]),g(m(Y,M),I[1]))),-y[2])),p(g(p(g(m(we,U),f[1]),p(g(m(Re,N),-y[1]),g(m(L,P),I[1]))),x[2]),g(p(g(m(X,H),f[1]),p(g(m(Y,M),-y[1]),g(m(L,P),x[1]))),-I[2]))),-C[3]),g(p(p(g(p(g(m(Z,K),y[1]),p(g(m(re,V),-x[1]),g(m(X,H),C[1]))),f[2]),g(p(g(m(Z,K),f[1]),p(g(m(ne,B),-x[1]),g(m(Y,M),C[1]))),-y[2])),p(g(p(g(m(re,V),f[1]),p(g(m(ne,B),-y[1]),g(m(L,P),C[1]))),x[2]),g(p(g(m(X,H),f[1]),p(g(m(Y,M),-y[1]),g(m(L,P),x[1]))),-C[2]))),I[3]))))),ke=p(p(p(g(p(p(g(p(g(m(Se,xe),C[1]),p(g(m(ye,ie),-b[1]),g(m(Ae,te),I[1]))),x[2]),g(p(g(m(Se,xe),x[1]),p(g(m(_e,ee),-b[1]),g(m(me,J),I[1]))),-C[2])),p(g(p(g(m(ye,ie),x[1]),p(g(m(_e,ee),-C[1]),g(m(Z,K),I[1]))),b[2]),g(p(g(m(Ae,te),x[1]),p(g(m(me,J),-C[1]),g(m(Z,K),b[1]))),-I[2]))),f[3]),p(g(p(p(g(p(g(m(Se,xe),C[1]),p(g(m(ye,ie),-b[1]),g(m(Ae,te),I[1]))),f[2]),g(p(g(m(Se,xe),f[1]),p(g(m(Re,N),-b[1]),g(m(ue,T),I[1]))),-C[2])),p(g(p(g(m(ye,ie),f[1]),p(g(m(Re,N),-C[1]),g(m(ne,B),I[1]))),b[2]),g(p(g(m(Ae,te),f[1]),p(g(m(ue,T),-C[1]),g(m(ne,B),b[1]))),-I[2]))),-x[3]),g(p(p(g(p(g(m(Se,xe),x[1]),p(g(m(_e,ee),-b[1]),g(m(me,J),I[1]))),f[2]),g(p(g(m(Se,xe),f[1]),p(g(m(Re,N),-b[1]),g(m(ue,T),I[1]))),-x[2])),p(g(p(g(m(_e,ee),f[1]),p(g(m(Re,N),-x[1]),g(m(Y,M),I[1]))),b[2]),g(p(g(m(me,J),f[1]),p(g(m(ue,T),-x[1]),g(m(Y,M),b[1]))),-I[2]))),C[3]))),p(p(g(p(p(g(p(g(m(ye,ie),x[1]),p(g(m(_e,ee),-C[1]),g(m(Z,K),I[1]))),f[2]),g(p(g(m(ye,ie),f[1]),p(g(m(Re,N),-C[1]),g(m(ne,B),I[1]))),-x[2])),p(g(p(g(m(_e,ee),f[1]),p(g(m(Re,N),-x[1]),g(m(Y,M),I[1]))),C[2]),g(p(g(m(Z,K),f[1]),p(g(m(ne,B),-x[1]),g(m(Y,M),C[1]))),-I[2]))),-b[3]),g(p(p(g(p(g(m(Ae,te),x[1]),p(g(m(me,J),-C[1]),g(m(Z,K),b[1]))),f[2]),g(p(g(m(Ae,te),f[1]),p(g(m(ue,T),-C[1]),g(m(ne,B),b[1]))),-x[2])),p(g(p(g(m(me,J),f[1]),p(g(m(ue,T),-x[1]),g(m(Y,M),b[1]))),C[2]),g(p(g(m(Z,K),f[1]),p(g(m(ne,B),-x[1]),g(m(Y,M),C[1]))),-b[2]))),I[3])),p(g(p(p(g(p(g(m(Se,xe),x[1]),p(g(m(_e,ee),-b[1]),g(m(me,J),I[1]))),y[2]),g(p(g(m(Se,xe),y[1]),p(g(m(we,U),-b[1]),g(m(de,O),I[1]))),-x[2])),p(g(p(g(m(_e,ee),y[1]),p(g(m(we,U),-x[1]),g(m(X,H),I[1]))),b[2]),g(p(g(m(me,J),y[1]),p(g(m(de,O),-x[1]),g(m(X,H),b[1]))),-I[2]))),f[3]),g(p(p(g(p(g(m(Se,xe),x[1]),p(g(m(_e,ee),-b[1]),g(m(me,J),I[1]))),f[2]),g(p(g(m(Se,xe),f[1]),p(g(m(Re,N),-b[1]),g(m(ue,T),I[1]))),-x[2])),p(g(p(g(m(_e,ee),f[1]),p(g(m(Re,N),-x[1]),g(m(Y,M),I[1]))),b[2]),g(p(g(m(me,J),f[1]),p(g(m(ue,T),-x[1]),g(m(Y,M),b[1]))),-I[2]))),-y[3])))),p(p(p(g(p(p(g(p(g(m(Se,xe),y[1]),p(g(m(we,U),-b[1]),g(m(de,O),I[1]))),f[2]),g(p(g(m(Se,xe),f[1]),p(g(m(Re,N),-b[1]),g(m(ue,T),I[1]))),-y[2])),p(g(p(g(m(we,U),f[1]),p(g(m(Re,N),-y[1]),g(m(L,P),I[1]))),b[2]),g(p(g(m(de,O),f[1]),p(g(m(ue,T),-y[1]),g(m(L,P),b[1]))),-I[2]))),x[3]),g(p(p(g(p(g(m(_e,ee),y[1]),p(g(m(we,U),-x[1]),g(m(X,H),I[1]))),f[2]),g(p(g(m(_e,ee),f[1]),p(g(m(Re,N),-x[1]),g(m(Y,M),I[1]))),-y[2])),p(g(p(g(m(we,U),f[1]),p(g(m(Re,N),-y[1]),g(m(L,P),I[1]))),x[2]),g(p(g(m(X,H),f[1]),p(g(m(Y,M),-y[1]),g(m(L,P),x[1]))),-I[2]))),-b[3])),p(g(p(p(g(p(g(m(me,J),y[1]),p(g(m(de,O),-x[1]),g(m(X,H),b[1]))),f[2]),g(p(g(m(me,J),f[1]),p(g(m(ue,T),-x[1]),g(m(Y,M),b[1]))),-y[2])),p(g(p(g(m(de,O),f[1]),p(g(m(ue,T),-y[1]),g(m(L,P),b[1]))),x[2]),g(p(g(m(X,H),f[1]),p(g(m(Y,M),-y[1]),g(m(L,P),x[1]))),-b[2]))),I[3]),g(p(p(g(p(g(m(Ae,te),x[1]),p(g(m(me,J),-C[1]),g(m(Z,K),b[1]))),y[2]),g(p(g(m(Ae,te),y[1]),p(g(m(de,O),-C[1]),g(m(re,V),b[1]))),-x[2])),p(g(p(g(m(me,J),y[1]),p(g(m(de,O),-x[1]),g(m(X,H),b[1]))),C[2]),g(p(g(m(Z,K),y[1]),p(g(m(re,V),-x[1]),g(m(X,H),C[1]))),-b[2]))),f[3]))),p(p(g(p(p(g(p(g(m(Ae,te),x[1]),p(g(m(me,J),-C[1]),g(m(Z,K),b[1]))),f[2]),g(p(g(m(Ae,te),f[1]),p(g(m(ue,T),-C[1]),g(m(ne,B),b[1]))),-x[2])),p(g(p(g(m(me,J),f[1]),p(g(m(ue,T),-x[1]),g(m(Y,M),b[1]))),C[2]),g(p(g(m(Z,K),f[1]),p(g(m(ne,B),-x[1]),g(m(Y,M),C[1]))),-b[2]))),-y[3]),g(p(p(g(p(g(m(Ae,te),y[1]),p(g(m(de,O),-C[1]),g(m(re,V),b[1]))),f[2]),g(p(g(m(Ae,te),f[1]),p(g(m(ue,T),-C[1]),g(m(ne,B),b[1]))),-y[2])),p(g(p(g(m(de,O),f[1]),p(g(m(ue,T),-y[1]),g(m(L,P),b[1]))),C[2]),g(p(g(m(re,V),f[1]),p(g(m(ne,B),-y[1]),g(m(L,P),C[1]))),-b[2]))),x[3])),p(g(p(p(g(p(g(m(me,J),y[1]),p(g(m(de,O),-x[1]),g(m(X,H),b[1]))),f[2]),g(p(g(m(me,J),f[1]),p(g(m(ue,T),-x[1]),g(m(Y,M),b[1]))),-y[2])),p(g(p(g(m(de,O),f[1]),p(g(m(ue,T),-y[1]),g(m(L,P),b[1]))),x[2]),g(p(g(m(X,H),f[1]),p(g(m(Y,M),-y[1]),g(m(L,P),x[1]))),-b[2]))),-C[3]),g(p(p(g(p(g(m(Z,K),y[1]),p(g(m(re,V),-x[1]),g(m(X,H),C[1]))),f[2]),g(p(g(m(Z,K),f[1]),p(g(m(ne,B),-x[1]),g(m(Y,M),C[1]))),-y[2])),p(g(p(g(m(re,V),f[1]),p(g(m(ne,B),-y[1]),g(m(L,P),C[1]))),x[2]),g(p(g(m(X,H),f[1]),p(g(m(Y,M),-y[1]),g(m(L,P),x[1]))),-C[2]))),b[3]))))),nt=m(Ne,ke);return nt[nt.length-1]}}var d=[function(){return 0},function(){return 0},function(){return 0}];function u(p){var m=d[p.length];return m||(m=d[p.length]=s(p.length)),m.apply(void 0,p)}function _(p,m,A,g,f,y,x,C){return function(b,I,v,P,M,B){switch(arguments.length){case 0:case 1:return 0;case 2:return g(b,I);case 3:return f(b,I,v);case 4:return y(b,I,v,P);case 5:return x(b,I,v,P,M);case 6:return C(b,I,v,P,M,B)}for(var T=Array(arguments.length),N=0;N<arguments.length;++N)T[N]=arguments[N];return p(T)}}(function(){for(;d.length<=6;)d.push(s(d.length));t.exports=_.apply(void 0,[u].concat(d));for(var p=0;p<=6;++p)t.exports[p]=d[p]})()}}),dxr=H3({"node_modules/cdt2d/lib/delaunay.js"(e,t){var n=hxr()[4];qbe();function o(r,i,s,a,c,l){var h=i.opposite(a,c);if(!(h<0)){if(c<a){var d=a;a=c,c=d,d=l,l=h,h=d}i.isConstraint(a,c)||n(r[a],r[c],r[l],r[h])<0&&s.push(a,c)}}t.exports=function(r,i){for(var s=[],a=r.length,c=i.stars,l=0;l<a;++l)for(var h=c[l],d=1;d<h.length;d+=2)if(!((m=h[d])<l)&&!i.isConstraint(l,m)){for(var u=h[d-1],_=-1,p=1;p<h.length;p+=2)if(h[p-1]===m){_=h[p];break}_<0||n(r[l],r[m],r[u],r[_])<0&&s.push(l,m)}for(;s.length>0;){for(var m=s.pop(),A=(u=-1,_=-1,h=c[l=s.pop()],1);A<h.length;A+=2){var g=h[A-1],f=h[A];g===m?_=f:f===m&&(u=g)}u<0||_<0||(n(r[l],r[m],r[u],r[_])>=0||(i.flip(l,m),o(r,i,s,u,l,_),o(r,i,s,l,_,u),o(r,i,s,_,m,u),o(r,i,s,m,u,_)))}}}}),uxr=H3({"node_modules/cdt2d/lib/filter.js"(e,t){var n=qbe();function o(i,s,a,c,l,h,d){this.cells=i,this.neighbor=s,this.flags=c,this.constraint=a,this.active=l,this.next=h,this.boundary=d}function r(i,s){return i[0]-s[0]||i[1]-s[1]||i[2]-s[2]}t.exports=function(i,s,a){var c=function(C,b){for(var I=C.cells(),v=I.length,P=0;P<v;++P){var M=(j=I[P])[0],B=j[1],T=j[2];B<T?B<M&&(j[0]=B,j[1]=T,j[2]=M):T<M&&(j[0]=T,j[1]=M,j[2]=B)}I.sort(r);var N=Array(v);for(P=0;P<N.length;++P)N[P]=0;var D=[],L=[],H=Array(3*v),V=Array(3*v),O=null;b&&(O=[]);var U=new o(I,H,V,N,D,L,O);for(P=0;P<v;++P)for(var j=I[P],Y=0;Y<3;++Y){M=j[Y],B=j[(Y+1)%3];var X=H[3*P+Y]=U.locate(B,M,C.opposite(B,M)),K=V[3*P+Y]=C.isConstraint(M,B);X<0&&(K?L.push(P):(D.push(P),N[P]=1),b&&O.push([B,M,-1]))}return U}(i,a);if(s===0)return a?c.cells.concat(c.boundary):c.cells;var l=1,{active:h,next:d,flags:u,cells:_,constraint:p,neighbor:m}=c;for(;h.length>0||d.length>0;){for(;h.length>0;){var A=h.pop();if(u[A]!==-l){u[A]=l,_[A];for(var g=0;g<3;++g){var f=m[3*A+g];f>=0&&u[f]===0&&(p[3*A+g]?d.push(f):(h.push(f),u[f]=l))}}}var y=d;d=h,h=y,d.length=0,l=-l}var x=function(C,b,I){for(var v=0,P=0;P<C.length;++P)b[P]===I&&(C[v++]=C[P]);return C.length=v,C}(_,u,s);if(a)return x.concat(c.boundary);return x},o.prototype.locate=function(){var i=[0,0,0];return function(s,a,c){var l=s,h=a,d=c;return a<c?a<s&&(l=a,h=c,d=s):c<s&&(l=c,h=s,d=a),l<0?-1:(i[0]=l,i[1]=h,i[2]=d,n.eq(this.cells,i,r))}}()}}),pxr=H3({"node_modules/cdt2d/cdt2d.js"(e,t){var n=cxr(),o=lxr(),r=dxr(),i=uxr();function s(l){return[Math.min(l[0],l[1]),Math.max(l[0],l[1])]}function a(l,h){return l[0]-h[0]||l[1]-h[1]}function c(l,h,d){return h in l?l[h]:d}t.exports=function(l,h,d){Array.isArray(h)?(d=d||{},h=h||[]):(d=h||{},h=[]);var u=!!c(d,"delaunay",!0),_=!!c(d,"interior",!0),p=!!c(d,"exterior",!0),m=!!c(d,"infinity",!1);if(!_&&!p||l.length===0)return[];var A=n(l,h);if(u||_!==p||m){for(var g=o(l.length,function(x){return x.map(s).sort(a)}(h)),f=0;f<A.length;++f){var y=A[f];g.addTriangle(y[0],y[1],y[2])}return u&&r(l,g),p?_?m?i(g,0,m):g.cells():i(g,1,m):i(g,-1)}return A}}}),gin=(e)=>e.map((t)=>({connectionId:t.connectionId,startRegionId:t.startRegion.regionId,endRegionId:t.endRegion.regionId,mutuallyConnectedNetworkId:t.mutuallyConnectedNetworkId})),Ain=(e)=>({ports:e.ports.map((t)=>({portId:t.portId,region1Id:t.region1.regionId,region2Id:t.region2.regionId,d:t.d})),regions:e.regions.map((t)=>({regionId:t.regionId,pointIds:t.ports.map((n)=>n.portId),d:t.d}))}),TXe=({port:e,boundaryRegionMap:t})=>{let n=t.get(e.portId);if(!n){let o=typeof e.d?.x=="number"?e.d.x:0,r=typeof e.d?.y=="number"?e.d.y:0;n={regionId:`__section_boundary__${e.portId}`,ports:[],d:{isBoundaryRegion:!0,boundaryPortId:e.portId,...e.d,center:{x:o,y:r},bounds:{minX:o-0.05,maxX:o+0.05,minY:r-0.05,maxY:r+0.05}},assignments:[]},t.set(e.portId,n)}return n},mxr=(e)=>{let{sectionRoute:t,graph:n}=e,o=new Set(n.ports.map((a)=>a.portId)),r=t.globalRoute.path.slice(t.sectionStartIndex,t.sectionEndIndex+1).filter((a)=>o.has(a.port.portId)),i=[],s=t.sectionConnection.startRegion;for(let a=0;a<r.length;a++){let c=r[a],l=n.ports.find((d)=>d.portId===c.port.portId),h=l.region1===s?l.region2:l.region1;i.push({port:l,g:0,h:0,f:0,hops:a,ripRequired:c.ripRequired,parent:a>0?i[a-1]:void 0,lastPort:a>0?i[a-1].port:void 0,lastRegion:a>0?s:void 0,nextRegion:h}),s=h}return{connection:t.sectionConnection,path:i,requiredRip:t.globalRoute.requiredRip}},_xr=(e,t)=>{let n=-1,o=-1;for(let r=0;r<e.path.length;r++){let i=e.path[r];(i.lastRegion&&t.has(i.lastRegion.regionId)||i.nextRegion&&t.has(i.nextRegion.regionId))&&(n===-1&&(n=r),o=r)}return n===-1?null:{startIndex:n,endIndex:o}},gxr=(e)=>{let{graph:t,solvedRoutes:n,centralRegion:o,expansionHopsFromCentralRegion:r}=e,i=(({centralRegion:p,expansionHopsFromCentralRegion:m})=>{let A=new Set([p.regionId]),g=[{region:p,hops:0}];for(;g.length>0;){let{region:f,hops:y}=g.shift();if(!(y>=m+1))for(let x of f.ports){let C=x.region1===f?x.region2:x.region1;A.has(C.regionId)||(A.add(C.regionId),g.push({region:C,hops:y+1}))}}return A})({graph:t,centralRegion:o,expansionHopsFromCentralRegion:r}),s=new Map,a=new Map,c=[];for(let p of t.regions)i.has(p.regionId)&&s.set(p.regionId,{regionId:p.regionId,ports:[],d:p.d?structuredClone(p.d):p.d,assignments:[]});for(let p of t.ports){let m=i.has(p.region1.regionId),A=i.has(p.region2.regionId);if(!m&&!A)continue;if(m&&A){let x={portId:p.portId,region1:s.get(p.region1.regionId),region2:s.get(p.region2.regionId),d:p.d};x.region1.ports.push(x),x.region2.ports.push(x),c.push(x);continue}let g=m?p.region1:p.region2,f=TXe({port:p,boundaryRegionMap:a}),y={portId:p.portId,region1:s.get(g.regionId),region2:f,d:p.d};y.region1.ports.push(y),y.region2.ports.push(y),c.push(y)}let l={regions:[...s.values(),...a.values()],ports:c},h=[],d=[],u=[];for(let p of n){let m=_xr(p,i);if(!m)continue;let A=p.path[m.startIndex],g=p.path[m.endIndex];u.push({solvedRoute:p,solvedPathStartIndex:m.startIndex,solvedPathEndIndex:m.endIndex,startCandidate:A,endCandidate:g})}let _=new Map(l.regions.map((p)=>[p.regionId,p]));for(let{solvedRoute:p,solvedPathStartIndex:m,solvedPathEndIndex:A,startCandidate:g,endCandidate:f}of u){let y,x,C,b;if(i.has(p.connection.startRegion.regionId))y=p.connection.startRegion.regionId,x=_.get(y);else{let M=TXe({port:g.port,boundaryRegionMap:a});y=M.regionId,x=M,_.has(y)||_.set(y,M)}if(i.has(p.connection.endRegion.regionId))C=p.connection.endRegion.regionId,b=_.get(C);else{let M=TXe({port:f.port,boundaryRegionMap:a});C=M.regionId,b=M,_.has(C)||_.set(C,M)}if(!x)throw console.error("[getSectionOfHyperGraphAsHyperGraph] CRITICAL ERROR: startRegion not found!"),console.error(`  Looking for: ${y}`),console.error(`  Route connection: ${p.connection.connectionId}`),console.error(`  Original startRegion: ${p.connection.startRegion.regionId}`),console.error(`  startCandidate port: ${g.port.portId}`),console.error("  Available regions in sectionRegionMap:",Array.from(_.keys())),Error(`startRegion ${y} not found in sectionRegionMap`);if(!b)throw console.error("[getSectionOfHyperGraphAsHyperGraph] CRITICAL ERROR: endRegion not found!"),console.error(`  Looking for: ${C}`),console.error(`  Route connection: ${p.connection.connectionId}`),console.error(`  Original endRegion: ${p.connection.endRegion.regionId}`),console.error(`  endCandidate port: ${f.port.portId}`),console.error("  Available regions in sectionRegionMap:",Array.from(_.keys())),Error(`endRegion ${C} not found in sectionRegionMap`);let I={connectionId:p.connection.connectionId,mutuallyConnectedNetworkId:p.connection.mutuallyConnectedNetworkId,startRegion:x,endRegion:b},v=p.path.slice(m,A+1),P={globalRoute:p,globalConnection:p.connection,sectionConnection:I,sectionStartIndex:m,sectionEndIndex:A};h.push({...P,canRemainFixedInSectionSolve:v.every((M)=>l.ports.some((B)=>B.portId===M.port.portId)),sectionRoute:mxr({sectionRoute:P,graph:l})}),d.push(I)}return{centralRegionId:o.regionId,sectionRegionIds:i,graph:l,connections:d,sectionRoutes:h}},Zzt=class{heap=[];maxSize;constructor(e=[],t=1e4){if(this.maxSize=t,e.length>0){this.heap=[...e].sort((n,o)=>n.f-o.f).slice(0,this.maxSize);for(let n=Math.floor(this.heap.length/2)-1;n>=0;n--)this._siftDown(n)}}get size(){return this.heap.length}isEmpty(){return this.heap.length===0}peek(){return this.isEmpty()?null:this.heap[0]??null}peekMany(e){return[...this.heap].sort((t,n)=>t.f-n.f).slice(0,e)}dequeue(){if(this.isEmpty())return null;let e=this.heap[0],t=this.heap.pop();return this.heap.length===0&&t!==void 0||t!==void 0&&(this.heap[0]=t,this._siftDown(0)),e}enqueue(e){this.heap.length>=this.maxSize||(this.heap.push(e),this._siftUp(this.heap.length-1))}_siftUp(e){let t=e;for(;t>0;){let n=this._parentIndex(t);if(this.heap[n].f<=this.heap[t].f)break;this._swap(t,n),t=n}}_siftDown(e){let t=e,n=this.heap.length;for(;;){let o=this._leftChildIndex(t),r=this._rightChildIndex(t),i=t;if(o<n&&this.heap[o].f<this.heap[i].f&&(i=o),r<n&&this.heap[r].f<this.heap[i].f&&(i=r),i===t)break;this._swap(t,i),t=i}}_swap(e,t){[this.heap[e],this.heap[t]]=[this.heap[t],this.heap[e]]}_parentIndex(e){return Math.floor((e-1)/2)}_leftChildIndex(e){return 2*e+1}_rightChildIndex(e){return 2*e+2}},fin=(e)=>{for(let t of e.regions)t.assignments=[];for(let t of e.ports)t.assignment=void 0},qKe=({graph:e,connections:t,solvedRoutes:n})=>{let o=new Map(e.ports.map((a)=>[a.portId,a])),r=new Map(e.regions.map((a)=>[a.regionId,a])),i=new Map(t.map((a)=>[a.connectionId,a])),s=n.map((a)=>{let c=[];for(let l of a.path){let h={port:o.get(l.port.portId),g:l.g,h:l.h,f:l.f,hops:l.hops,ripRequired:l.ripRequired};l.lastPort&&(h.lastPort=o.get(l.lastPort.portId)),l.lastRegion&&(h.lastRegion=r.get(l.lastRegion.regionId)),l.nextRegion&&(h.nextRegion=r.get(l.nextRegion.regionId));let d=c[c.length-1];d&&(h.parent=d),c.push(h)}return{path:c,connection:i.get(a.connection.connectionId),requiredRip:a.requiredRip}});fin(e),e.solvedRoutes=s;for(let a of s)for(let c of a.path){if(c.port.assignment={solvedRoute:a,connection:a.connection},!c.lastPort||!c.lastRegion)continue;let l={regionPort1:c.lastPort,regionPort2:c.port,region:c.lastRegion,connection:a.connection,solvedRoute:a};c.lastRegion.assignments??=[],c.lastRegion.assignments.push(l)}return s},yin=class extends Da{constructor(e){super(),this.input=e,this.graph=((n)=>{if(n.ports.length>0&&"region1"in n.ports[0]&&typeof n.ports[0].region1=="object")return n;let o=new Map,r=new Map;for(let i of n.regions){let{assignments:s,...a}=i;r.set(i.regionId,{...a,d:a.d?structuredClone(a.d):a.d,ports:[],assignments:void 0})}for(let i of n.ports){let s=r.get(i.region1Id??i.region1?.regionId),a=r.get(i.region2Id??i.region2?.regionId),c={portId:i.portId,region1:s,region2:a,d:i.d};o.set(i.portId,c),s.ports.push(c),a.ports.push(c)}return{ports:Array.from(o.values()),regions:Array.from(r.values())}})(e.inputGraph),fin(this.graph),this.connections=((n,o)=>{let r=[];for(let i of n)"startRegionId"in i?r.push({connectionId:i.connectionId,mutuallyConnectedNetworkId:i.mutuallyConnectedNetworkId??i.connectionId,startRegion:o.regions.find((s)=>s.regionId===i.startRegionId),endRegion:o.regions.find((s)=>s.regionId===i.endRegionId)}):r.push(i);return r})(e.inputConnections,this.graph),e.inputSolvedRoutes?this.solvedRoutes=qKe({graph:this.graph,connections:this.connections,solvedRoutes:e.inputSolvedRoutes}):this.graph.solvedRoutes=this.solvedRoutes,e.greedyMultiplier!==void 0&&(this.greedyMultiplier=e.greedyMultiplier),e.rippingEnabled!==void 0&&(this.rippingEnabled=e.rippingEnabled),e.ripCost!==void 0&&(this.ripCost=e.ripCost);let t=new Set(this.solvedRoutes.map((n)=>n.connection.connectionId));this.unprocessedConnections=this.connections.filter((n)=>!t.has(n.connectionId)),this.candidateQueue=new Zzt,this.unprocessedConnections.length===0?this.solved=!0:this.beginNewConnection()}getSolverName(){return"HyperGraphSolver"}graph;connections;candidateQueue;unprocessedConnections;solvedRoutes=[];currentConnection=null;currentEndRegion=null;greedyMultiplier=1;rippingEnabled=!1;ripCost=0;lastCandidate=null;visitedPointsForCurrentConnection=new Map;getConstructorParams(){return{inputGraph:Ain(this.graph),inputConnections:gin(this.connections),greedyMultiplier:this.greedyMultiplier,rippingEnabled:this.rippingEnabled,ripCost:this.ripCost,inputSolvedRoutes:this.solvedRoutes}}computeH(e){return this.estimateCostToEnd(e.port)}estimateCostToEnd(e){return 0}getPortUsagePenalty(e){return 0}computeIncreasedRegionCostIfPortsAreUsed(e,t,n){return 0}getRipsRequiredForPortUsage(e,t,n){return[]}isRipRequiredForPortUsage(e,t,n){return!1}isTransitionAllowed(e,t,n){return!0}computeG(e){return e.parent.g+this.computeIncreasedRegionCostIfPortsAreUsed(e.lastRegion,e.lastPort,e.port)+(e.ripRequired?this.ripCost:0)+this.getPortUsagePenalty(e.port)}selectCandidatesForEnteringRegion(e){return e}computeRoutesToRip(e){let t=this.computeCrossingRoutes(e),n=this.computePortOverlapRoutes(e);return new Set([...t,...n])}computePortOverlapRoutes(e){let t=new Set;for(let n of e.path)n.port.assignment&&n.port.assignment.connection.mutuallyConnectedNetworkId!==e.connection.mutuallyConnectedNetworkId&&t.add(n.port.assignment.solvedRoute);return t}computeCrossingRoutes(e){let t=new Set;for(let n of e.path){if(!n.lastPort||!n.lastRegion)continue;let o=this.getRipsRequiredForPortUsage(n.lastRegion,n.lastPort,n.port);for(let r of o)t.add(r.solvedRoute)}return t}getNextCandidates(e){let{nextRegion:t,port:n}=e,o={};for(let i of t.ports){if(i===e.port)continue;if(!this.isTransitionAllowed(t,n,i))continue;let s=i.assignment&&i.assignment.connection.mutuallyConnectedNetworkId!==this.currentConnection.mutuallyConnectedNetworkId||this.isRipRequiredForPortUsage(t,n,i),a={port:i,hops:e.hops+1,parent:e,lastRegion:t,nextRegion:i.region1===t?i.region2:i.region1,lastPort:n,ripRequired:s};!this.rippingEnabled&&a.ripRequired||(o[a.nextRegion.regionId]??=[],o[a.nextRegion.regionId].push(a))}let r=[];for(let i in o){let s=o[i];r.push(...this.selectCandidatesForEnteringRegion(s))}for(let i of r)i.g=this.computeG(i),i.h=this.computeH(i),i.f=i.g+i.h*this.greedyMultiplier;return r}processSolvedRoute(e){let t={path:[],connection:this.currentConnection,requiredRip:!1},n=e,o=!1;for(;n;)o||=!!n.ripRequired,t.path.unshift(n),n=n.parent;o&&(t.requiredRip=!0);let r=this.computeRoutesToRip(t);if(r.size>0){t.requiredRip=!0;for(let i of r)this.ripSolvedRoute(i)}for(let i of t.path){if(i.port.assignment={solvedRoute:t,connection:this.currentConnection},!i.lastPort)continue;let s={regionPort1:i.lastPort,regionPort2:i.port,region:i.lastRegion,connection:this.currentConnection,solvedRoute:t};i.lastRegion.assignments?.push(s)}this.solvedRoutes.push(t),this.routeSolvedHook(t)}routeSolvedHook(e){}routeStartedHook(e){}ripSolvedRoute(e){for(let t of e.path.map((n)=>n.port))t.ripCount=(t.ripCount??0)+1,t.region1.assignments=t.region1.assignments?.filter((n)=>n.regionPort1!==t&&n.regionPort2!==t),t.region2.assignments=t.region2.assignments?.filter((n)=>n.regionPort1!==t&&n.regionPort2!==t),t.assignment=void 0;this.solvedRoutes=this.solvedRoutes.filter((t)=>t!==e),this.unprocessedConnections.push(e.connection)}beginNewConnection(){this.currentConnection=this.unprocessedConnections.shift(),this.currentEndRegion=this.currentConnection.endRegion,this.candidateQueue=new Zzt,this.visitedPointsForCurrentConnection.clear(),this.routeStartedHook(this.currentConnection);for(let e of this.currentConnection.startRegion.ports)this.candidateQueue.enqueue({port:e,g:0,h:0,f:0,hops:0,ripRequired:!1,nextRegion:e.region1===this.currentConnection.startRegion?e.region2:e.region1})}_step(){let e=this.candidateQueue.dequeue();if(!e)return this.failed=!0,void(this.error="Ran out of candidates");let t=this.visitedPointsForCurrentConnection.get(e.port.portId);for(;e&&t!==void 0&&!(e.g<t)&&(e=this.candidateQueue.dequeue(),e);)t=this.visitedPointsForCurrentConnection.get(e.port.portId);if(!e)return this.failed=!0,void(this.error="Ran out of candidates");if(this.lastCandidate=e,this.visitedPointsForCurrentConnection.set(e.port.portId,e.g),e.nextRegion===this.currentEndRegion)return this.processSolvedRoute(e),this.unprocessedConnections.length===0?void(this.solved=!0):void this.beginNewConnection();let n=this.getNextCandidates(e);for(let o of n)this.candidateQueue.enqueue(o)}};function Axr(e,t){let n=e.x-t.x,o=e.y-t.y;return n*n+o*o}function JKe(e,t,n,o,r){let i=n-t,s=r-o;if(Math.abs(e.y-r)<0.000001)return e.x-t;if(Math.abs(e.x-n)<0.000001)return i+(r-e.y);if(Math.abs(e.y-o)<0.000001)return i+s+(n-e.x);if(Math.abs(e.x-t)<0.000001)return 2*i+s+(e.y-o);let c=Math.abs(e.y-r),l=Math.abs(e.x-n),h=Math.abs(e.y-o),d=Math.abs(e.x-t),u=Math.min(c,l,h,d);return u===c?Math.max(0,Math.min(i,e.x-t)):u===l?i+Math.max(0,Math.min(s,r-e.y)):u===h?i+s+Math.max(0,Math.min(i,n-e.x)):2*i+s+Math.max(0,Math.min(s,e.y-o))}function fxr(e,t,n){let o=n.x-t.x,r=n.y-t.y,i=e.x-t.x,s=e.y-t.y,a=o*o+r*r,c=a>0?(l=(i*o+s*r)/a,h=0,d=1,Math.max(h,Math.min(d,l))):0;var l,h,d;return{u:c,d2:Axr(e,{x:t.x+c*o,y:t.y+c*r})}}function xin(e){let t=e.d.polygon;if(!t||t.length<3)return null;let n=e.d.polygonPerimeterCache;if(n)return n;let o=function(r){let i=r.length,s=Array(i),a=Array(i+1);a[0]=0;for(let c=0;c<i;c++){let l=r[c],h=r[(c+1)%i],d=Math.hypot(h.x-l.x,h.y-l.y);s[c]=d,a[c+1]=a[c]+d}return{edgeLengths:s,cumulative:a,perimeter:a[i]}}(t);return e.d.polygonPerimeterCache=o,o}function eOt(e){let t=xin(e);if(t)return t.perimeter;let{minX:n,maxX:o,minY:r,maxY:i}=e.d.bounds;return 2*(o-n)+2*(i-r)}function pQ(e,t){if(e.region1===t){if(typeof e.region1T=="number")return e.region1T;let n=DXe(e.d,t);return e.region1T=n,n}if(e.region2===t){if(typeof e.region2T=="number")return e.region2T;let n=DXe(e.d,t);return e.region2T=n,n}return DXe(e.d,t)}function DXe(e,t){let n=t.d.polygon;if(n&&n.length>=3){let a=xin(t);if(a)return function(c,l,h,d=0.000001){let u=0,_=0,p=Number.POSITIVE_INFINITY,m=d*d;for(let A=0;A<l.length;A++){let g=fxr(c,l[A],l[(A+1)%l.length]);if(g.d2<=m){u=A,_=g.u,p=g.d2;break}g.d2<p&&(u=A,_=g.u,p=g.d2)}return h.cumulative[u]+_*h.edgeLengths[u]}(e,n,a)}let{minX:o,maxX:r,minY:i,maxY:s}=t.d.bounds;return JKe(e,o,r,i,s)}function r3e(e,t,n=0.000001){return Math.abs(e-t)<n}function NQ(e,t){return(e%t+t)%t}function i3e(e,t,n,o){let r=Math.abs(NQ(e-t,n));return r<o||n-r<o}function tOt(e,t,n,o,r){let i=NQ(e,o),s=NQ(t,o),a=NQ(n,o);return!(Math.abs(s-a)<r)&&(s<a?s<i&&i<a:i>s||i<a)}function NXe(e,t,n){if(typeof n=="number"&&n>0){let[a,c]=e,[l,h]=t;if(a=NQ(a,n),c=NQ(c,n),l=NQ(l,n),h=NQ(h,n),i3e(a,l,n,0.000001)||i3e(a,h,n,0.000001)||i3e(c,l,n,0.000001)||i3e(c,h,n,0.000001))return!1;return tOt(l,a,c,n,0.000000000001)!==tOt(h,a,c,n,0.000000000001)}let[o,r]=e[0]<e[1]?e:[e[1],e[0]],[i,s]=t[0]<t[1]?t:[t[1],t[0]];return!(r3e(o,i)||r3e(o,s)||r3e(r,i)||r3e(r,s))&&(o<i&&i<r&&r<s||i<o&&o<s&&s<r)}var Cin=(e)=>{let{POSITIVE_INFINITY:t,NEGATIVE_INFINITY:n,POSITIVE_INFINITY:o,NEGATIVE_INFINITY:r}=Number;for(let i of e){let{bounds:s}=i.d;t=Math.min(t,s.minX),n=Math.max(n,s.maxX),o=Math.min(o,s.minY),r=Math.max(r,s.maxY)}return{minX:t,maxX:n,minY:o,maxY:r}},nOt=(e,t,n,o)=>{let r={portId:e,region1:t,region2:n,d:{x:o.x,y:o.y}};return t.ports.push(r),n.ports.push(r),r},oOt=(e,t,n)=>({regionId:e,ports:[],d:{bounds:{minX:t-0.2,maxX:t+0.2,minY:n-0.2,maxY:n+0.2},center:{x:t,y:n},isPad:!1,isConnectionRegion:!0}}),RQ=0.01,qw=(e,t,n)=>Math.max(t,Math.min(n,e)),rOt=(e,t,n)=>t==="left"?Math.abs(e.x-n.minX)<RQ:t==="right"?Math.abs(e.x-n.maxX)<RQ:t==="top"?Math.abs(e.y-n.maxY)<RQ:Math.abs(e.y-n.minY)<RQ,yxr=(e,t,n,o)=>{let r=o.x-n.x,i=o.y-n.y,s=e-n.x,a=t-n.y,c=r*r+i*i,l=c>0?qw((s*r+a*i)/c,0,1):0,h=n.x+l*r,d=n.y+l*i,u=e-h,_=t-d;return{x:h,y:d,d2:u*u+_*_}},xxr=(e,t,n,o,r)=>{let i=n.d.polygon;if(i&&i.length>=3){let l=new Set(r),h=null;for(let d=0;d<i.length;d++){let u=i[d],_=i[(d+1)%i.length];if(r.length>0){if(!r.some((m)=>rOt(u,m,o)&&rOt(_,m,o)&&l.has(m)))continue}let p=yxr(e,t,u,_);(!h||p.d2<h.d2)&&(h=p)}if(h)return h}let s=n.d.bounds,a=[];if(r.length>0)for(let l of r)l==="left"?a.push({side:l,x:s.minX,y:qw(t,s.minY,s.maxY)}):l==="right"?a.push({side:l,x:s.maxX,y:qw(t,s.minY,s.maxY)}):l==="top"?a.push({side:l,x:qw(e,s.minX,s.maxX),y:s.maxY}):a.push({side:l,x:qw(e,s.minX,s.maxX),y:s.minY});a.length===0&&a.push({side:"left",x:s.minX,y:qw(t,s.minY,s.maxY)},{side:"right",x:s.maxX,y:qw(t,s.minY,s.maxY)},{side:"top",x:qw(e,s.minX,s.maxX),y:s.maxY},{side:"bottom",x:qw(e,s.minX,s.maxX),y:s.minY});let c=null;for(let l of a){if(r.length>0&&!r.includes(l.side))continue;let h=e-l.x,d=t-l.y,u=h*h+d*d;(!c||u<c.d2)&&(c={x:l.x,y:l.y,d2:u})}return c},iOt=(e,t,n,o)=>{let r=((c,l,h)=>{let d=[];return Math.abs(c-h.minX)<RQ&&d.push("left"),Math.abs(c-h.maxX)<RQ&&d.push("right"),Math.abs(l-h.maxY)<RQ&&d.push("top"),Math.abs(l-h.minY)<RQ&&d.push("bottom"),d})(e,t,o),i=null,s=Number.POSITIVE_INFINITY,a={x:e,y:t};for(let c of n){if(c.d.isPad||c.d.isThroughJumper)continue;let l=c.d.bounds;if(!(Math.abs(l.minX-o.minX)<0.01||Math.abs(l.maxX-o.maxX)<0.01||Math.abs(l.minY-o.minY)<0.01||Math.abs(l.maxY-o.maxY)<0.01))continue;let h=xxr(e,t,c,o,r);if(!h)continue;let d=Math.sqrt(h.d2);d<s&&(s=d,i=c,a={x:h.x,y:h.y})}return i?{region:i,portPosition:a}:null},Cxr=class extends Da{constructor(e){super(),this.input=e,this.graph=e.hyperGraphSolver.graph;let t=e.inputSolvedRoutes,n=e.hyperGraphSolver.connections;this.connections=n,this.solvedRoutes=qKe({graph:this.graph,connections:this.connections,solvedRoutes:t}),this.maxAttemptsPerRegion=e.MAX_ATTEMPTS_PER_REGION,this.maxSectionAttempts=e.MAX_ATTEMPTS_PER_SECTION??500,this.iterations+=this.iterations*(e.effort??1),this.fractionToReplace=e.FRACTION_TO_REPLACE??0.2,this.alwaysRipConflicts=e.alwaysRipConflicts??!0}graph;connections;solvedRoutes;activeSection=null;baselineSectionCost=1/0;baselineGlobalCost=1/0;regionAttemptCounts=new Map;sectionAttempts=0;maxAttemptsPerRegion;maxSectionAttempts;fractionToReplace;alwaysRipConflicts;random=((e)=>{let t=e;return()=>(t=1664525*t+1013904223>>>0,t/4294967295)})(31337);getSolverName(){return"HyperGraphSectionOptimizer"}getConstructorParams(){return{inputGraph:Ain(this.graph),inputConnections:gin(this.connections),inputSolvedRoutes:this.solvedRoutes,expansionHopsFromCentralRegion:this.input.expansionHopsFromCentralRegion,maxAttemptsPerRegion:this.maxAttemptsPerRegion,maxSectionAttempts:this.maxSectionAttempts,effort:this.input.effort,fractionToReplace:this.fractionToReplace,alwaysRipConflicts:this.alwaysRipConflicts,ACCEPTABLE_COST:this.input.ACCEPTABLE_REGION_COST}}getOutput(){return this.solvedRoutes}_setup(){this.beginSectionSolve()}visualize(){return this.activeSubSolver?this.activeSubSolver.visualize():{title:"HyperGraphSectionOptimizer",points:[],lines:[],rects:[],circles:[],texts:[],polygons:[],arrows:[]}}getCostOfRegionWithAttempts(e){let t=this.regionAttemptCounts.get(e.regionId)??0;return this.input.regionCost(e)+1e4*t}computeCostOfSection({section:e,solvedRoutes:t}){if(this.input.computeSolvedGraphCost)return this.input.computeSolvedGraphCost(t);let n=this.input.createHyperGraphSolver({inputGraph:e.graph,inputConnections:e.connections,inputSolvedRoutes:t}),o=0;for(let r of n.graph.regions)o+=this.input.regionCost(r);return o}computeSolvedGraphCost(e){if(this.input.computeSolvedGraphCost)return this.input.computeSolvedGraphCost(e);let t=this.input.createHyperGraphSolver({inputGraph:this.graph,inputConnections:this.connections,inputSolvedRoutes:e}),n=0;for(let o of t.graph.regions)n+=this.input.regionCost(o);return n}determineConnectionsToRip(e,t){let n=e.sectionRoutes.map((a)=>a.globalConnection.connectionId);if(this.fractionToReplace>=1)return new Set(n);let o=[...n];for(let a=o.length-1;a>0;a--){let c=Math.floor(this.random()*(a+1));[o[a],o[c]]=[o[c],o[a]]}let r=Math.max(1,Math.ceil(o.length*this.fractionToReplace)),i=new Set(o.slice(0,r));if(!this.alwaysRipConflicts)return i;let s=new Map(e.graph.regions.map((a)=>[a.regionId,a]));for(let a of e.sectionRoutes)for(let c of a.sectionRoute.path){if(!c.lastPort||!c.lastRegion)continue;let l=s.get(c.lastRegion.regionId);if(!l)continue;t.currentConnection=a.globalConnection;let h=t.getRipsRequiredForPortUsage(l,c.lastPort,c.port);for(let d of h){let u=a.globalConnection.connectionId,_=d.connection.connectionId;i.has(u)||i.has(_)||i.add(this.random()<0.5?u:_)}}return i}getNextCentralRegion(){let e=null,t=1/0;for(let n of this.graph.regions){if((n.assignments?.length??0)===0)continue;if((this.regionAttemptCounts.get(n.regionId)??0)>=this.maxAttemptsPerRegion)continue;if(this.input.regionCost(n)<this.input.ACCEPTABLE_REGION_COST)continue;let o=this.getCostOfRegionWithAttempts(n);o>=t||(t=o,e=n)}return e}beginSectionSolve(){if(this.sectionAttempts>=this.maxSectionAttempts)return console.log(`Reached max section attempts (${this.maxSectionAttempts}), stopping optimization`),void(this.solved=!0);let e=this.getNextCentralRegion();if(!e)return void(this.solved=!0);if(this.sectionAttempts++,this.activeSection=gxr({graph:this.graph,solvedRoutes:this.solvedRoutes,centralRegion:e,expansionHopsFromCentralRegion:this.input.expansionHopsFromCentralRegion}),!this.activeSection)return;if(this.activeSection.connections.length===0)return this.regionAttemptCounts.set(e.regionId,(this.regionAttemptCounts.get(e.regionId)??0)+1),void(this.activeSection=null);let t=this.activeSection.sectionRoutes.filter((s)=>s.canRemainFixedInSectionSolve),n=this.input.createHyperGraphSolver({inputGraph:this.activeSection.graph,inputConnections:this.activeSection.connections,inputSolvedRoutes:t.map((s)=>s.sectionRoute)}),o=this.determineConnectionsToRip(this.activeSection,n);for(let s of this.activeSection.sectionRoutes)s.canRemainFixedInSectionSolve||o.add(s.globalConnection.connectionId);let r=this.activeSection.sectionRoutes.filter((s)=>s.canRemainFixedInSectionSolve&&!o.has(s.globalConnection.connectionId)).map((s)=>s.sectionRoute),i=[...r,...this.activeSection.sectionRoutes.filter((s)=>o.has(s.globalConnection.connectionId)).map((s)=>s.sectionRoute)];this.baselineSectionCost=this.computeCostOfSection({section:this.activeSection,solvedRoutes:i}),this.baselineGlobalCost=this.computeSolvedGraphCost(this.solvedRoutes),this.activeSubSolver=this.input.createHyperGraphSolver({inputGraph:this.activeSection.graph,inputConnections:this.activeSection.connections,inputSolvedRoutes:r});for(let s of this.activeSubSolver.connections)s.startRegion&&s.endRegion||console.error({startRegion:s.startRegion?.regionId,endRegion:s.endRegion?.regionId})}_step(){if(!this.activeSubSolver)return void this.beginSectionSolve();if(this.activeSubSolver.step(),!this.activeSection)return;if(this.activeSubSolver.failed){this.failedSubSolvers??=[],this.failedSubSolvers.push(this.activeSubSolver);let s=this.regionAttemptCounts.get(this.activeSection.centralRegionId)??0;return this.regionAttemptCounts.set(this.activeSection.centralRegionId,s+1),this.activeSubSolver=null,this.activeSection=null,this.baselineSectionCost=1/0,void(this.baselineGlobalCost=1/0)}if(!this.activeSubSolver.solved)return;let e=this.activeSubSolver.solvedRoutes,t=this.computeCostOfSection({section:this.activeSection,solvedRoutes:e}),n=((s)=>{let{solvedRoutes:a,section:c,replacementSolvedRoutes:l}=s,h=new Map(l.map((d)=>[d.connection.connectionId,d]));return a.map((d)=>{let u=c.sectionRoutes.find((m)=>m.globalConnection.connectionId===d.connection.connectionId);if(!u)return d;let _=h.get(d.connection.connectionId);if(!_)return d;let p=[...d.path.slice(0,u.sectionStartIndex),..._.path,...d.path.slice(u.sectionEndIndex+1)].map((m)=>({port:m.port,g:m.g,h:m.h,f:m.f,hops:m.hops,ripRequired:m.ripRequired,lastPort:m.lastPort,lastRegion:m.lastRegion,nextRegion:m.nextRegion}));for(let m=0;m<p.length;m++)p[m].parent=m>0?p[m-1]:void 0;return{connection:d.connection,path:p,requiredRip:d.requiredRip||_.requiredRip}})})({solvedRoutes:this.solvedRoutes,section:this.activeSection,replacementSolvedRoutes:e}),o=this.computeSolvedGraphCost(n),r=t<=this.baselineSectionCost,i=o<this.baselineGlobalCost;if(r&&i){this.solvedRoutes=n;let s=this.input.hyperGraphSolver;if(!s)return;s.solvedRoutes=qKe({graph:s.graph,connections:s.connections,solvedRoutes:this.solvedRoutes});for(let a of this.activeSection.sectionRegionIds)this.regionAttemptCounts.set(a,0);this.baselineSectionCost=t,this.baselineGlobalCost=o}else{let s=this.regionAttemptCounts.get(this.activeSection.centralRegionId)??0;this.regionAttemptCounts.set(this.activeSection.centralRegionId,s+1)}this.activeSubSolver=null,this.activeSection=null,this.baselineSectionCost=1/0,this.baselineGlobalCost=1/0}};function JK(e,t){return Array.isArray(t)?[e.a*t[0]+e.c*t[1]+e.e,e.b*t[0]+e.d*t[1]+e.f]:{x:e.a*t.x+e.c*t.y+e.e,y:e.b*t.x+e.d*t.y+e.f}}function sOt(e){return e===void 0}function s3e(e,t=0){return{a:1,c:0,e,b:0,d:1,f:t}}function ZKe(...e){let t=(n,o)=>({a:n.a*o.a+n.c*o.b,c:n.a*o.c+n.c*o.d,e:n.a*o.e+n.c*o.f+n.e,b:n.b*o.a+n.d*o.b,d:n.b*o.c+n.d*o.d,f:n.b*o.e+n.d*o.f+n.f});switch((e=Array.isArray(e[0])?e[0]:e).length){case 0:throw Error("no matrices provided");case 1:return e[0];case 2:return t(e[0],e[1]);default:{let[n,o,...r]=e;return ZKe(t(n,o),...r)}}}var{cos:bxr,sin:Ixr,PI:pLs}=Math,{tan:mLs}=Math,RXe=(e)=>({x:(e.minX+e.maxX)/2,y:(e.minY+e.maxY)/2}),bin=(e,t)=>{let n=e.regions.map((s)=>{let{bounds:a,center:c,...l}=s.d,h=[{x:a.minX,y:a.minY},{x:a.maxX,y:a.minY},{x:a.minX,y:a.maxY},{x:a.maxX,y:a.maxY}].map((_)=>JK(t,_)),d={minX:Math.min(...h.map((_)=>_.x)),maxX:Math.max(...h.map((_)=>_.x)),minY:Math.min(...h.map((_)=>_.y)),maxY:Math.max(...h.map((_)=>_.y))},u=JK(t,c);return{...s,ports:[],d:{...l,bounds:d,center:u}}}),o=new Map;for(let s=0;s<e.regions.length;s++)o.set(e.regions[s],n[s]);let r=e.ports.map((s)=>{let a=JK(t,s.d),c=o.get(s.region1),l=o.get(s.region2),h={...s,region1:c,region2:l,d:a};return c.ports.push(h),l.ports.push(h),h}),i=e.jumperLocations?.map((s)=>{let a=JK(t,s.center),c=s.padRegions.map((_)=>o.get(_)),l=JK(t,{x:1,y:0}),h=JK(t,{x:0,y:0}),d=l.x-h.x,u=l.y-h.y;return{center:a,orientation:Math.abs(u)>Math.abs(d)?s.orientation==="horizontal"?"vertical":"horizontal":s.orientation,padRegions:c}});return{regions:n,ports:r,...i&&{jumperLocations:i}}},QXe=(e,t=0.8)=>{let n=0;for(let o=0;o<e.length;o++)n=17777*e.charCodeAt(o)+((n<<5)-n);return`hsla(${Math.abs(n)%360}, 70%, 50%, ${t})`},vxr=(e)=>{let t=((r)=>{let i=((s,a)=>{let c={arrows:[],circles:[],title:"Jumper Graph",lines:[],points:[],rects:[],texts:[],polygons:[],coordinateSystem:"cartesian"};for(let l of s.regions){let{bounds:h,isPad:d,isThroughJumper:u,isConnectionRegion:_,polygon:p}=l.d,m=(h.minX+h.maxX)/2,A=(h.minY+h.maxY)/2,g=h.maxX-h.minX,f=h.maxY-h.minY,y;if(y=_?"rgba(255, 100, 255, 0.6)":u?"rgba(100, 200, 100, 0.5)":d?"rgba(255, 200, 100, 0.5)":"rgba(200, 200, 255, 0.1)",p&&p.length>=3){let x=p;c.polygons.push({points:x,fill:y})}else c.rects.push({center:{x:m,y:A},width:g-0.1,height:f-0.1,fill:y})}if(!a?.hidePortPoints)for(let l of s.ports){let h=l.region1.regionId.split(":").pop()??l.region1.regionId,d=l.region2.regionId.split(":").pop()??l.region2.regionId;c.circles.push({center:{x:l.d.x,y:l.d.y},radius:0.05,fill:"rgba(128, 128, 128, 0.5)",label:`${h}-${d}`})}if(!a?.hideRegionPortLines)for(let l of s.ports){let h={x:(l.region1.d.bounds.minX+l.region1.d.bounds.maxX)/2,y:(l.region1.d.bounds.minY+l.region1.d.bounds.maxY)/2},d={x:(l.region2.d.bounds.minX+l.region2.d.bounds.maxX)/2,y:(l.region2.d.bounds.minY+l.region2.d.bounds.maxY)/2};c.lines.push({points:[h,{x:l.d.x,y:l.d.y},d],strokeColor:"rgba(100, 100, 100, 0.3)"})}if(a?.connections&&!a?.hideConnectionLines)for(let l of a.connections){let{startRegion:h,endRegion:d}=l,u={x:(h.d.bounds.minX+h.d.bounds.maxX)/2,y:(h.d.bounds.minY+h.d.bounds.maxY)/2},_={x:(d.d.bounds.minX+d.d.bounds.maxX)/2,y:(d.d.bounds.minY+d.d.bounds.maxY)/2},p=(u.x+_.x)/2,m=(u.y+_.y)/2;c.lines.push({points:[u,_],strokeColor:"rgba(255, 50, 150, 0.8)",strokeDash:"3 3"}),c.points.push({x:p,y:m,color:"rgba(200, 0, 100, 1)",label:l.connectionId})}return c})(r.graph,{connections:r.connections,...r.hideInitialGeometry?{hideRegionPortLines:!0,hideConnectionLines:!0,hidePortPoints:!0}:{}});if(!r.hideInitialGeometry)for(let s of i.polygons)s.stroke="rgba(128, 128, 128, 0.5)",s.strokeWidth=0.03;r.title&&(i.title=r.title);for(let s of r.priorSolvedRoutes??[]){let a=s.path.map((c)=>{let l=c.port;return{x:l.d.x,y:l.d.y}});a.length!==0&&i.lines.push({points:a,strokeColor:"rgba(80, 80, 80, 0.45)",strokeDash:"4 4"})}for(let s of r.solvedRoutes){let a=QXe(s.connection.connectionId),c=[];for(let l of s.path){let h=l.port;c.push({x:h.d.x,y:h.d.y})}c.length>0&&i.lines.push({points:c,strokeColor:a})}return i})({graph:{regions:e.graph.regions,ports:e.graph.ports},connections:e.connections,solvedRoutes:e.solvedRoutes,hideInitialGeometry:e.iterations>0});if(e.currentConnection&&!e.solved){let r=QXe(e.currentConnection.connectionId),i=e.currentConnection.startRegion,s=e.currentConnection.endRegion;if(!i?.d||!s?.d)return t;let a={x:(i.d.bounds.minX+i.d.bounds.maxX)/2,y:(i.d.bounds.minY+i.d.bounds.maxY)/2},c={x:(s.d.bounds.minX+s.d.bounds.maxX)/2,y:(s.d.bounds.minY+s.d.bounds.maxY)/2};t.lines.push({points:[a,c],strokeColor:r,strokeDash:"10 5"}),t.points.push({x:a.x-0.1,y:a.y+0.1,color:r,label:[e.currentConnection.connectionId,"start"].join(`
`)}),t.points.push({x:c.x-0.1,y:c.y+0.1,color:r,label:[e.currentConnection.connectionId,"end"].join(`
`)})}let n=e.candidateQueue.peekMany(10);for(let r=0;r<n.length;r++){let i=n[r],s=i.port,a=r===0;t.points.push({x:s.d.x,y:s.d.y,color:a?"green":"rgba(128, 128, 128, 0.25)",label:[i.port.portId,`g: ${i.g.toFixed(2)}`,`h: ${i.h.toFixed(2)}`,`f: ${i.f.toFixed(2)}`].join(`
`)})}let o=n[0];if(!e.solved&&o&&e.currentConnection){let r=QXe(e.currentConnection.connectionId),i=[],s=o;for(;s;){let a=s.port;i.unshift({x:a.d.x,y:a.d.y}),s=s.parent}i.length>1&&t.lines.push({points:i,strokeColor:r})}return t},Sxr=0.034685181009478865,Pxr=0,Exr=4.072520483177124,Mxr=0,wxr=35.38577539020022,Bxr=0.5518001238069296,Txr=class extends yin{getSolverName(){return"JumperGraphSolver"}UNIT_OF_COST="hops";portUsagePenalty=Sxr;portUsagePenaltySq=Pxr;crossingPenalty=Exr;crossingPenaltySq=Mxr;ripCost=wxr;baseMaxIterations=4000;additionalMaxIterationsPerConnection=2000;additionalMaxIterationsPerCrossing=2000;constructor(e){super({greedyMultiplier:Bxr,rippingEnabled:!0,...e}),this.ripCost=e.ripCost??this.ripCost,this.portUsagePenalty=e.portUsagePenalty??this.portUsagePenalty,this.crossingPenalty=e.crossingPenalty??this.crossingPenalty,this.baseMaxIterations=e.baseMaxIterations??this.baseMaxIterations,this.additionalMaxIterationsPerConnection=e.additionalMaxIterationsPerConnection??this.additionalMaxIterationsPerConnection;let t=function(n,o){if(o.length<2)return 0;let r=1/0,i=-1/0,s=1/0,a=-1/0;for(let u of n.regions){let _=u;_.d?.bounds?(r=Math.min(r,_.d.bounds.minX),i=Math.max(i,_.d.bounds.maxX),s=Math.min(s,_.d.bounds.minY),a=Math.max(a,_.d.bounds.maxY)):_.d?.center&&(r=Math.min(r,_.d.center.x),i=Math.max(i,_.d.center.x),s=Math.min(s,_.d.center.y),a=Math.max(a,_.d.center.y))}let c=new Map;for(let u of n.regions){let _=u;_.d?.center&&c.set(u.regionId,_.d.center)}let l=[],h=2*(i-r)+2*(a-s);for(let u of o){let _,p;if("startRegion"in u&&u.startRegion){let{startRegion:g,endRegion:f}=u;_=g.d?.center,p=f.d?.center}else"startRegionId"in u&&(_=c.get(u.startRegionId),p=c.get(u.endRegionId));if(!_||!p)continue;let m=JKe(_,r,i,s,a),A=JKe(p,r,i,s,a);l.push([m,A])}let d=0;for(let u=0;u<l.length;u++)for(let _=u+1;_<l.length;_++)NXe(l[u],l[_],h)&&d++;return d}(this.graph,e.inputConnections);this.MAX_ITERATIONS=this.baseMaxIterations+e.inputConnections.length*this.additionalMaxIterationsPerConnection+t*this.additionalMaxIterationsPerCrossing,this.populateDistanceToEndMaps()}populateDistanceToEndMaps(){let e=new Set(this.connections.map((t)=>t.endRegion));for(let t of e){let n=new Map,o=[];for(n.set(t.regionId,0),o.push({region:t,distance:0});o.length>0;){let{region:r,distance:i}=o.shift();for(let s of r.ports){let a=s.region1===r?s.region2:s.region1;n.has(a.regionId)||(n.set(a.regionId,i+1),o.push({region:a,distance:i+1}))}}for(let r of this.graph.ports){r.distanceToEndMap||(r.distanceToEndMap={});let i=n.get(r.region1.regionId)??1/0,s=n.get(r.region2.regionId)??1/0;r.distanceToEndMap[t.regionId]=Math.min(i,s)}}}estimateCostToEnd(e){let t=this.currentEndRegion.regionId;return e.distanceToEndMap[t]}getPortUsagePenalty(e){let t=e.ripCount??0;return t*this.portUsagePenalty+t*this.portUsagePenaltySq}isTransitionAllowed(e,t,n){if(!e.d.isPad)return!0;let o=(r)=>{let i=r.region1===e?r.region2:r.region1;return Boolean(i.d.isThroughJumper)};return o(t)||o(n)}computeIncreasedRegionCostIfPortsAreUsed(e,t,n){if(e.d.isPad){let r=(e.assignments??[]).filter((i)=>i.connection.mutuallyConnectedNetworkId!==this.currentConnection.mutuallyConnectedNetworkId).length;return r>0?r*this.crossingPenalty+r*this.crossingPenaltySq:0}let o=function(r,i,s){let a=eOt(r),c=[pQ(i,r),pQ(s,r)],l=0,h=r.assignments??[];for(let d of h)NXe(c,[pQ(d.regionPort1,r),pQ(d.regionPort2,r)],a)&&l++;return l}(e,t,n);return o*this.crossingPenalty+o*this.crossingPenaltySq}getRipsRequiredForPortUsage(e,t,n){if(e.d.isPad)return(e.assignments??[]).filter((i)=>i.connection.mutuallyConnectedNetworkId!==this.currentConnection.mutuallyConnectedNetworkId);let o=function(i,s,a){let c=eOt(i),l=[pQ(s,i),pQ(a,i)],h=[],d=i.assignments??[];for(let u of d)NXe(l,[pQ(u.regionPort1,i),pQ(u.regionPort2,i)],c)&&h.push(u);return h}(e,t,n),r=o.filter((i)=>i.connection.mutuallyConnectedNetworkId!==this.currentConnection.mutuallyConnectedNetworkId);if(!e.d.isThroughJumper)return r;for(let i of e.assignments??[])i.connection.mutuallyConnectedNetworkId!==this.currentConnection.mutuallyConnectedNetworkId&&r.push(i);return r}isRipRequiredForPortUsage(e,t,n){if(!e.d.isThroughJumper&&!e.d.isPad)return!1;for(let o of e.assignments??[])if(o.connection.mutuallyConnectedNetworkId!==this.currentConnection.mutuallyConnectedNetworkId)return!0;return!1}routeSolvedHook(e){}routeStartedHook(e){}visualize(){return vxr(this)}},Dxr={padWidth:0.8,outerPadHeight:0.5,innerPadHeight:0.4,leftPadCenterX:-0.9,rightPadCenterX:0.9,row1CenterY:-1.2,row2CenterY:-0.4,row3CenterY:0.4,row4CenterY:1.2},Nxr=({cols:e,rows:t,marginX:n,marginY:o,innerColChannelPointCount:r=1,innerRowChannelPointCount:i=1,regionsBetweenPads:s=!1,outerPaddingX:a=0.5,outerPaddingY:c=0.5,outerChannelXPointCount:l,outerChannelYPointCount:h,orientation:d="vertical",center:u,bounds:_,parallelTracesUnderJumperCount:p=2})=>{let m=[],A=[],{padWidth:g,outerPadHeight:f,innerPadHeight:y,leftPadCenterX:x,rightPadCenterX:C,row1CenterY:b,row2CenterY:I,row3CenterY:v,row4CenterY:P}=Dxr,M=g/2,B=f/2,T=y/2,N=C-x+g,D=N+n,L=P-b+f,H=L+o,V=a,O=c;if(_){let re=e*N+(e-1)*n,Z=t*L+(t-1)*o;V=((d==="horizontal"?_.maxY-_.minY:_.maxX-_.minX)-re)/2,O=((d==="horizontal"?_.maxX-_.minX:_.maxY-_.minY)-Z)/2}let U=l??Math.max(1,Math.floor(V/0.4)),j=h??Math.max(1,Math.floor(O/0.4)),Y=[],X=[],K=(re,Z,te,ie)=>({regionId:re,ports:[],d:{bounds:Z,center:RXe(Z),isPad:te,isThroughJumper:ie}}),J=(re,Z,te)=>{let ie=Z.d.bounds,le=te.d.bounds,ue,de;Math.abs(ie.maxX-le.minX)<0.001?(ue=ie.maxX,de=(Math.max(ie.minY,le.minY)+Math.min(ie.maxY,le.maxY))/2):Math.abs(ie.minX-le.maxX)<0.001?(ue=ie.minX,de=(Math.max(ie.minY,le.minY)+Math.min(ie.maxY,le.maxY))/2):Math.abs(ie.maxY-le.minY)<0.001?(ue=(Math.max(ie.minX,le.minX)+Math.min(ie.maxX,le.maxX))/2,de=ie.maxY):(ue=(Math.max(ie.minX,le.minX)+Math.min(ie.maxX,le.maxX))/2,de=ie.minY);let me={portId:re,region1:Z,region2:te,d:{x:ue,y:de}};return Z.ports.push(me),te.ports.push(me),me},ee=(re,Z,te,ie)=>{if(ie<=0)return[];if(ie===1)return[J(re,Z,te)];let le=Z.d.bounds,ue=te.d.bounds,de=[],me,Ae,xe,Me;Math.abs(le.maxX-ue.minX)<0.001?(me=!0,Ae=le.maxX,xe=Math.max(le.minY,ue.minY),Me=Math.min(le.maxY,ue.maxY)):Math.abs(le.minX-ue.maxX)<0.001?(me=!0,Ae=le.minX,xe=Math.max(le.minY,ue.minY),Me=Math.min(le.maxY,ue.maxY)):Math.abs(le.maxY-ue.minY)<0.001?(me=!1,Ae=le.maxY,xe=Math.max(le.minX,ue.minX),Me=Math.min(le.maxX,ue.maxX)):(me=!1,Ae=le.minY,xe=Math.max(le.minX,ue.minX),Me=Math.min(le.maxX,ue.maxX));for(let Re=0;Re<ie;Re++){let we=xe+(Re+0.5)/ie*(Me-xe),_e={portId:`${re}:${Re}`,region1:Z,region2:te,d:{x:me?Ae:we,y:me?we:Ae}};Z.ports.push(_e),te.ports.push(_e),de.push(_e)}return de};for(let re=0;re<t;re++){Y[re]=[];for(let Z=0;Z<e;Z++){let te=`cell_${re}_${Z}`,ie=Z*D,le=-re*H,ue=ie+x,de=le+b,me=ie+x,Ae=le+I,xe=ie+x,Me=le+v,Re=ie+x,we=le+P,_e=ie+C,ye=le+P,Se=ie+C,Ne=le+v,ke=ie+C,nt=le+I,dt=ie+C,rt=le+b,mt=(Oo,$i,Ei)=>({minX:Oo-M,maxX:Oo+M,minY:$i-Ei,maxY:$i+Ei}),lt=mt(ue,de,B),Ct=mt(me,Ae,T),Nt=mt(xe,Me,T),Ht=mt(Re,we,B),Tt=mt(_e,ye,B),et=mt(Se,Ne,T),vt=mt(ke,nt,T),ht=mt(dt,rt,B),We={minX:lt.maxX,maxX:ht.minX,minY:lt.minY,maxY:Ht.maxY},Ze={minX:ue,maxX:dt,minY:de-0.15,maxY:de+0.15},$e={minX:me,maxX:ke,minY:Ae-0.15,maxY:Ae+0.15},qe={minX:xe,maxX:Se,minY:Me-0.15,maxY:Me+0.15},ft={minX:Re,maxX:_e,minY:we-0.15,maxY:we+0.15},It=lt.minX,ze=ht.maxX,Xe=lt.minY,it=Ht.maxY,St=K(`${te}:pad1`,lt,!0),kt=K(`${te}:pad2`,Ct,!0),Lt=K(`${te}:pad3`,Nt,!0),Wt=K(`${te}:pad4`,Ht,!0),bn=K(`${te}:pad5`,Tt,!0),pn=K(`${te}:pad6`,et,!0),wn=K(`${te}:pad7`,vt,!0),Fn=K(`${te}:pad8`,ht,!0),mn=K(`${te}:underjumper`,We,!1),_n=K(`${te}:throughjumper1`,Ze,!1,!0),no=K(`${te}:throughjumper2`,$e,!1,!0),To=K(`${te}:throughjumper3`,qe,!1,!0),ir=K(`${te}:throughjumper4`,ft,!1,!0);m.push(St,kt,Lt,Wt,bn,pn,wn,Fn,mn,_n,no,To,ir);let xt=(ue+dt)/2,gt=(de+we)/2;X.push({center:{x:xt,y:gt},orientation:"vertical",padRegions:[St,kt,Lt,Wt,bn,pn,wn,Fn]});let Ot=null,Zt=null,je=null,Mt=null,Kt=null,nn=null;s&&(Ot=K(`${te}:L-BP12`,{minX:lt.minX,maxX:lt.maxX,minY:lt.maxY,maxY:Ct.minY},!1),Zt=K(`${te}:L-BP23`,{minX:Ct.minX,maxX:Ct.maxX,minY:Ct.maxY,maxY:Nt.minY},!1),je=K(`${te}:L-BP34`,{minX:Nt.minX,maxX:Nt.maxX,minY:Nt.maxY,maxY:Ht.minY},!1),Mt=K(`${te}:R-BP87`,{minX:ht.minX,maxX:ht.maxX,minY:ht.maxY,maxY:vt.minY},!1),Kt=K(`${te}:R-BP76`,{minX:vt.minX,maxX:vt.maxX,minY:vt.maxY,maxY:et.minY},!1),nn=K(`${te}:R-BP65`,{minX:et.minX,maxX:et.maxX,minY:et.maxY,maxY:Tt.minY},!1),m.push(Ot,Zt,je,Mt,Kt,nn));let Zn=Z===0,Vn=re===t-1,Rn=Z===e-1,Bn;if(Rn)Bn=ze+V;else Bn=(Z+1)*D+x-M;let ho=null;re===0&&(ho=K(`${te}:T`,{minX:Zn?It-V:It,maxX:Bn,minY:it,maxY:it+O},!1),m.push(ho));let Qo=null;Qo=K(`${te}:B`,{minX:Zn?It-V:It,maxX:Bn,minY:Xe-(Vn?O:o),maxY:Xe},!1),m.push(Qo);let Nn=null;Zn&&(Nn=K(`${te}:L`,{minX:It-V,maxX:It,minY:Xe,maxY:it},!1),m.push(Nn));let mo=K(`${te}:R`,{minX:ze,maxX:Bn,minY:Xe,maxY:it},!1);if(m.push(mo),Y[re][Z]={pad1:St,pad2:kt,pad3:Lt,pad4:Wt,pad5:bn,pad6:pn,pad7:wn,pad8:Fn,underjumper:mn,throughjumper1:_n,throughjumper2:no,throughjumper3:To,throughjumper4:ir,top:ho,bottom:Qo,left:Nn,right:mo,leftBP12:Ot,leftBP23:Zt,leftBP34:je,rightBP87:Mt,rightBP76:Kt,rightBP65:nn},ho)if(Nn&&A.push(...ee(`${te}:T-L`,ho,Nn,U)),A.push(...ee(`${te}:T-R`,ho,mo,Rn?U:r)),A.push(J(`${te}:T-P4`,ho,Wt)),A.push(J(`${te}:T-P5`,ho,bn)),s){let Oo=mn.d.bounds,$i=(Oo.maxX-Oo.minX)/(p+1);for(let Ei=1;Ei<=p;Ei++){let hs={portId:`${te}:T-UJ${Ei}`,region1:ho,region2:mn,d:{x:Oo.minX+$i*Ei,y:Oo.maxY}};ho.ports.push(hs),mn.ports.push(hs),A.push(hs)}}else A.push(J(`${te}:T-UJ`,ho,mn));if(Qo)if(Nn&&A.push(...ee(`${te}:B-L`,Qo,Nn,U)),A.push(...ee(`${te}:B-R`,Qo,mo,Rn?U:r)),A.push(J(`${te}:B-P1`,Qo,St)),A.push(J(`${te}:B-P8`,Qo,Fn)),s){let Oo=mn.d.bounds,$i=(Oo.maxX-Oo.minX)/(p+1);for(let Ei=1;Ei<=p;Ei++){let hs={portId:`${te}:B-UJ${Ei}`,region1:Qo,region2:mn,d:{x:Oo.minX+$i*Ei,y:Oo.minY}};Qo.ports.push(hs),mn.ports.push(hs),A.push(hs)}}else A.push(J(`${te}:B-UJ`,Qo,mn));Nn&&(A.push(J(`${te}:L-P1`,Nn,St)),A.push(J(`${te}:L-P2`,Nn,kt)),A.push(J(`${te}:L-P3`,Nn,Lt)),A.push(J(`${te}:L-P4`,Nn,Wt))),A.push(J(`${te}:R-P5`,mo,bn)),A.push(J(`${te}:R-P6`,mo,pn)),A.push(J(`${te}:R-P7`,mo,wn)),A.push(J(`${te}:R-P8`,mo,Fn)),s&&(Nn&&(A.push(J(`${te}:L-BP12`,Nn,Ot)),A.push(J(`${te}:L-BP23`,Nn,Zt)),A.push(J(`${te}:L-BP34`,Nn,je))),A.push(J(`${te}:UJ-LBP12`,Ot,mn)),A.push(J(`${te}:UJ-LBP23`,Zt,mn)),A.push(J(`${te}:UJ-LBP34`,je,mn)),A.push(J(`${te}:R-BP87`,mo,Mt)),A.push(J(`${te}:R-BP76`,mo,Kt)),A.push(J(`${te}:R-BP65`,mo,nn)),A.push(J(`${te}:UJ-RBP87`,Mt,mn)),A.push(J(`${te}:UJ-RBP76`,Kt,mn)),A.push(J(`${te}:UJ-RBP65`,nn,mn)));let Io={portId:`${te}:TJ1-P1`,region1:_n,region2:St,d:{x:ue,y:de}};_n.ports.push(Io),St.ports.push(Io),A.push(Io);let io={portId:`${te}:TJ1-P8`,region1:_n,region2:Fn,d:{x:dt,y:rt}};_n.ports.push(io),Fn.ports.push(io),A.push(io);let Wo={portId:`${te}:TJ2-P2`,region1:no,region2:kt,d:{x:me,y:Ae}};no.ports.push(Wo),kt.ports.push(Wo),A.push(Wo);let rr={portId:`${te}:TJ2-P7`,region1:no,region2:wn,d:{x:ke,y:nt}};no.ports.push(rr),wn.ports.push(rr),A.push(rr);let xr={portId:`${te}:TJ3-P3`,region1:To,region2:Lt,d:{x:xe,y:Me}};To.ports.push(xr),Lt.ports.push(xr),A.push(xr);let Ci={portId:`${te}:TJ3-P6`,region1:To,region2:pn,d:{x:Se,y:Ne}};To.ports.push(Ci),pn.ports.push(Ci),A.push(Ci);let ea={portId:`${te}:TJ4-P4`,region1:ir,region2:Wt,d:{x:Re,y:we}};ir.ports.push(ea),Wt.ports.push(ea),A.push(ea);let ya={portId:`${te}:TJ4-P5`,region1:ir,region2:bn,d:{x:_e,y:ye}};if(ir.ports.push(ya),bn.ports.push(ya),A.push(ya),Z>0){let Oo=Y[re][Z-1];A.push(J(`cell_${re}_${Z-1}->cell_${re}_${Z}:R-P1`,Oo.right,St)),A.push(J(`cell_${re}_${Z-1}->cell_${re}_${Z}:R-P2`,Oo.right,kt)),A.push(J(`cell_${re}_${Z-1}->cell_${re}_${Z}:R-P3`,Oo.right,Lt)),A.push(J(`cell_${re}_${Z-1}->cell_${re}_${Z}:R-P4`,Oo.right,Wt)),s&&(A.push(J(`cell_${re}_${Z-1}->cell_${re}_${Z}:R-LBP12`,Oo.right,Ot)),A.push(J(`cell_${re}_${Z-1}->cell_${re}_${Z}:R-LBP23`,Oo.right,Zt)),A.push(J(`cell_${re}_${Z-1}->cell_${re}_${Z}:R-LBP34`,Oo.right,je))),ho&&Oo.top&&A.push(...ee(`cell_${re}_${Z-1}->cell_${re}_${Z}:T-T`,Oo.top,ho,j)),Qo&&Oo.bottom&&A.push(...ee(`cell_${re}_${Z-1}->cell_${re}_${Z}:B-B`,Oo.bottom,Qo,Vn?j:i))}if(re>0){let Oo=Y[re-1][Z];if(Nn&&A.push(...ee(`cell_${re-1}_${Z}->cell_${re}_${Z}:B-L`,Oo.bottom,Nn,U)),A.push(J(`cell_${re-1}_${Z}->cell_${re}_${Z}:B-P4`,Oo.bottom,Wt)),s){let $i=mn.d.bounds,Ei=($i.maxX-$i.minX)/(p+1);for(let hs=1;hs<=p;hs++){let il=$i.minX+Ei*hs,kl={portId:`cell_${re-1}_${Z}->cell_${re}_${Z}:B-UJ${hs}`,region1:Oo.bottom,region2:mn,d:{x:il,y:$i.maxY}};Oo.bottom.ports.push(kl),mn.ports.push(kl),A.push(kl)}}else A.push(J(`cell_${re-1}_${Z}->cell_${re}_${Z}:B-UJ`,Oo.bottom,mn));A.push(J(`cell_${re-1}_${Z}->cell_${re}_${Z}:B-P5`,Oo.bottom,bn)),A.push(...ee(`cell_${re-1}_${Z}->cell_${re}_${Z}:B-R`,Oo.bottom,mo,Rn?U:r))}}}let se={regions:m,ports:A,jumperLocations:X},ne=d==="horizontal";if(ne||u!==void 0||_!==void 0){let re=Cin(se.regions),Z=RXe(re),te=[],ie;ie=u||(_?RXe(_):Z),te.push(s3e(ie.x,ie.y)),ne&&te.push(function(ue,de,me){let Ae=bxr(ue),xe=Ixr(ue),Me={a:Ae,c:-xe,e:0,b:xe,d:Ae,f:0};return sOt(de)||sOt(me)?Me:ZKe([s3e(de,me),Me,s3e(-de,-me)])}(-Math.PI/2)),te.push(s3e(-Z.x,-Z.y));let le=function(...ue){return ZKe(...ue)}(...te);se=bin(se,le)}return se},Iin=!0,Bce={CCW:-1,CW:1,NOT_ORIENTABLE:0},Rxr=2*Math.PI,HCe=Object.freeze({__proto__:null,BOUNDARY:2,CCW:Iin,CONTAINS:3,CW:!1,END_VERTEX:2,INSIDE:1,INTERLACE:4,NOT_VERTEX:0,ORIENTATION:Bce,OUTSIDE:0,OVERLAP_OPPOSITE:2,OVERLAP_SAME:1,PIx2:Rxr,START_VERTEX:1}),nP=0.000001;function vin(e){nP=e}function Sin(){return nP}function e$e(e){return e<nP&&e>-nP}function jV(e,t){return e-t<nP&&e-t>-nP}function Pin(e,t){return e-t>nP}function Ein(e,t){return e-t<-nP}var Ge={Utils:Object.freeze({__proto__:null,DECIMALS:3,EQ:jV,EQ_0:e$e,GE:function(e,t){return e-t>-nP},GT:Pin,LE:function(e,t){return e-t<nP},LT:Ein,getTolerance:Sin,setTolerance:vin}),Errors:void 0,Matrix:void 0,Planar_set:void 0,Point:void 0,Vector:void 0,Line:void 0,Circle:void 0,Segment:void 0,Arc:void 0,Box:void 0,Edge:void 0,Face:void 0,Ray:void 0,Ray_shooting:void 0,Multiline:void 0,Polygon:void 0,Distance:void 0,Inversion:void 0};for(let e in HCe)Ge[e]=HCe[e];Object.defineProperty(Ge,"DP_TOL",{get:function(){return Sin()},set:function(e){vin(e)}});var x0=class{static get ILLEGAL_PARAMETERS(){return ReferenceError("Illegal Parameters")}static get ZERO_DIVISION(){return Error("Zero division")}static get UNRESOLVED_BOUNDARY_CONFLICT(){return Error("Unresolved boundary conflict in boolean operation")}static get INFINITE_LOOP(){return Error("Infinite loop")}static get CANNOT_COMPLETE_BOOLEAN_OPERATION(){return Error("Cannot complete boolean operation")}static get CANNOT_INVOKE_ABSTRACT_METHOD(){return Error("Abstract method cannot be invoked")}static get OPERATION_IS_NOT_SUPPORTED(){return Error("Operation is not supported")}static get UNSUPPORTED_SHAPE_TYPE(){return Error("Unsupported shape type")}};Ge.Errors=x0;var DZe=class{constructor(e,t){this.first=e,this.last=t||this.first}[Symbol.iterator](){let e;return{next:()=>(e=e?e.next:this.first,{value:e,done:e===void 0})}}get size(){let e=0;for(let t of this)e++;return e}toArray(e=void 0,t=void 0){let n=[],o=e||this.first,r=t||this.last,i=o;if(i===void 0)return n;do n.push(i),i=i.next;while(i!==r.next);return n}append(e){return this.isEmpty()?this.first=e:(e.prev=this.last,this.last.next=e),this.last=e,this.last.next=void 0,this.first.prev=void 0,this}insert(e,t){if(this.isEmpty())this.first=e,this.last=e;else if(t==null)e.next=this.first,this.first.prev=e,this.first=e;else{let n=t.next;t.next=e,n&&(n.prev=e),e.prev=t,e.next=n,this.last===t&&(this.last=e)}return this.last.next=void 0,this.first.prev=void 0,this}remove(e){return e===this.first&&e===this.last?(this.first=void 0,this.last=void 0):(e.prev&&(e.prev.next=e.next),e.next&&(e.next.prev=e.prev),e===this.first&&(this.first=e.next),e===this.last&&(this.last=e.prev)),this}isEmpty(){return this.first===void 0}static testInfiniteLoop(e){let t=e,n=e;do{if(t!=e&&t===n)throw x0.INFINITE_LOOP;t=t.next,n=n.next.next}while(t!=e)}},aOt={stroke:"black"},Qxr=class{constructor(e=aOt){for(let t in e)this[t]=e[t];this.stroke=e.stroke??aOt.stroke}toAttributesString(){return Object.keys(this).reduce((e,t)=>e+(this[t]!==void 0?this.toAttrString(t,this[t]):""),"")}toAttrString(e,t){let n=e==="className"?"class":this.convertCamelToKebabCase(e);return t===null?`${n} `:`${n}="${t.toString()}" `}convertCamelToKebabCase(e){return e.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g).join("-").toLowerCase()}};function dY(e){return new Qxr(e).toAttributesString()}function Gq(e,t){let n=[],[o,r,i]=e.standard,[s,a,c]=t.standard,l=o*a-r*s,h=i*a-r*c,d=o*c-i*s;if(!Ge.Utils.EQ_0(l)){let u,_;r===0?(u=i/o,_=d/l):a===0?(u=c/s,_=d/l):o===0?(u=h/l,_=i/r):s===0?(u=h/l,_=c/a):(u=h/l,_=d/l),n.push(new Ge.Point(u,_))}return n}function uY(e,t){let n=[],o=t.pc.projectionOn(e),r=t.pc.distanceTo(o)[0];if(Ge.Utils.EQ(r,t.r))n.push(o);else if(Ge.Utils.LT(r,t.r)){let i,s,a=Math.sqrt(t.r*t.r-r*r);i=e.norm.rotate90CCW().multiply(a),s=o.translate(i),n.push(s),i=e.norm.rotate90CW().multiply(a),s=o.translate(i),n.push(s)}return n}function bq(e,t){let n=[];for(let o of t.toSegments()){let r=Gle(o,e);for(let i of r)Qin(i,n)||n.push(i)}return n}function Jbe(e,t){let n=[];if(bq(e,t.box).length===0)return n;let o=uY(e,new Ge.Circle(t.pc,t.r));for(let r of o)r.on(t)&&n.push(r);return n}function Gle(e,t){let n=[];return e.ps.on(t)&&n.push(e.ps),e.pe.on(t)&&!e.isZeroLength()&&n.push(e.pe),n.length>0||e.isZeroLength()||e.ps.leftTo(t)&&e.pe.leftTo(t)||!e.ps.leftTo(t)&&!e.pe.leftTo(t)?n:Gq(new Ge.Line(e.ps,e.pe),t)}function FCe(e,t){let n=[];if(e.isZeroLength())return e.ps.on(t)&&n.push(e.ps),n;if(t.isZeroLength())return t.ps.on(e)&&n.push(t.ps),n;let o=new Ge.Line(e.ps,e.pe),r=new Ge.Line(t.ps,t.pe);if(o.incidentTo(r))e.ps.on(t)&&n.push(e.ps),e.pe.on(t)&&n.push(e.pe),!t.ps.on(e)||t.ps.equalTo(e.ps)||t.ps.equalTo(e.pe)||n.push(t.ps),!t.pe.on(e)||t.pe.equalTo(e.ps)||t.pe.equalTo(e.pe)||n.push(t.pe);else{let i=Gq(o,r);i.length>0&&cOt(i[0],e)&&cOt(i[0],t)&&n.push(i[0])}return n}function cOt(e,t){let n=t.box;return Ge.Utils.LE(e.x,n.xmax)&&Ge.Utils.GE(e.x,n.xmin)&&Ge.Utils.LE(e.y,n.ymax)&&Ge.Utils.GE(e.y,n.ymin)}function zCe(e,t){let n=[];if(e.isZeroLength()){let[r,i]=e.ps.distanceTo(t.pc);return Ge.Utils.EQ(r,t.r)&&n.push(e.ps),n}let o=uY(new Ge.Line(e.ps,e.pe),t);for(let r of o)r.on(e)&&n.push(r);return n}function Iq(e,t){let n=[];if(e.isZeroLength())return e.ps.on(t)&&n.push(e.ps),n;let o=uY(new Ge.Line(e.ps,e.pe),new Ge.Circle(t.pc,t.r));for(let r of o)r.on(e)&&r.on(t)&&n.push(r);return n}function Min(e,t){let n=[],o=new Ge.Vector(e.pc,t.pc),r=e.r,i=t.r;if(Ge.Utils.EQ_0(r)||Ge.Utils.EQ_0(i))return n;if(Ge.Utils.EQ_0(o.x)&&Ge.Utils.EQ_0(o.y)&&Ge.Utils.EQ(r,i))return n.push(e.pc.translate(-r,0)),n;let s,a=e.pc.distanceTo(t.pc)[0];if(Ge.Utils.GT(a,r+i))return n;if(Ge.Utils.LT(a,Math.abs(r-i)))return n;if(o.x/=a,o.y/=a,Ge.Utils.EQ(a,r+i)||Ge.Utils.EQ(a,Math.abs(r-i)))return s=e.pc.translate(r*o.x,r*o.y),n.push(s),n;let c=r*r/(2*a)-i*i/(2*a)+a/2,l=e.pc.translate(c*o.x,c*o.y),h=Math.sqrt(r*r-c*c);return s=l.translate(o.rotate90CCW().multiply(h)),n.push(s),s=l.translate(o.rotate90CW().multiply(h)),n.push(s),n}function win(e,t){let n=[];if(e.pc.equalTo(t.pc)&&Ge.Utils.EQ(e.r,t.r)){let s;return s=e.start,s.on(t)&&n.push(s),s=e.end,s.on(t)&&n.push(s),s=t.start,s.on(e)&&n.push(s),s=t.end,s.on(e)&&n.push(s),n}let o=new Ge.Circle(e.pc,e.r),r=new Ge.Circle(t.pc,t.r),i=o.intersect(r);for(let s of i)s.on(e)&&s.on(t)&&n.push(s);return n}function NZe(e,t){let n=[];if(t.pc.equalTo(e.pc)&&Ge.Utils.EQ(t.r,e.r))return n.push(e.start),n.push(e.end),n;let o=Min(t,new Ge.Circle(e.pc,e.r));for(let r of o)r.on(e)&&n.push(r);return n}function Bin(e,t){return e.isSegment?FCe(e.shape,t):Iq(t,e.shape)}function Tin(e,t){return e.isSegment?Iq(e.shape,t):win(e.shape,t)}function Din(e,t){return e.isSegment?Gle(e.shape,t):Jbe(t,e.shape)}function kxr(e,t){return e.isSegment?zCe(e.shape,t):NZe(e.shape,t)}function RZe(e,t){let n=[];for(let o of t.edges)for(let r of Bin(o,e))n.push(r);return n}function QZe(e,t){let n=[];for(let o of t.edges)for(let r of Tin(o,e))n.push(r);return n}function Ule(e,t){let n=[];if(t.isEmpty())return n;for(let o of t.edges)for(let r of Din(o,e))Qin(r,n)||n.push(r);return e.sortPoints(n)}function Nin(e,t){let n=[];if(t.isEmpty())return n;for(let o of t.edges)for(let r of kxr(o,e))n.push(r);return n}function Rin(e,t){return e.isSegment?Bin(t,e.shape):e.isArc?Tin(t,e.shape):e.isLine?Din(t,e.shape):e.isRay?(n=t,o=e.shape,n.isSegment?kZe(o,n.shape):LZe(o,n.shape)):[];var n,o}function lOt(e,t){let n=[];if(t.isEmpty()||e.shape.box.not_intersect(t.box))return n;let o=t.edges.search(e.shape.box);for(let r of o)n=[...n,...Rin(e,r)];return n}function Qin(e,t){return t.some((n)=>n.equalTo(e))}function VQ(e){return new Ge.Line(e.start,e.norm)}function kZe(e,t){return Gle(t,VQ(e)).filter((n)=>e.contains(n))}function LZe(e,t){return Jbe(VQ(e),t).filter((n)=>e.contains(n))}function kin(e,t){return uY(VQ(e),t).filter((n)=>e.contains(n))}function Lin(e,t){return Gq(VQ(e),t).filter((n)=>e.contains(n))}function Hin(e,t){return Ule(VQ(e),t).filter((n)=>e.contains(n))}function Fin(e,t){if(e.intersect&&e.intersect instanceof Function)return e.intersect(t);throw x0.UNSUPPORTED_SHAPE_TYPE}function Uq(e,t){let n=[];for(let o of t)n=[...n,...Fin(e,o.shape)];return n}var EV=class e extends DZe{constructor(...t){if(super(),this.isInfinite=!1,t.length===1&&t[0]instanceof Array&&t[0].length>0){let n=t[0],o=n.length,r=(s)=>s instanceof Ge.Segment||s instanceof Ge.Arc||s instanceof Ge.Ray,i=(s)=>s instanceof Ge.Segment||s instanceof Ge.Arc;if(!(o===1&&((s)=>s instanceof Ge.Segment||s instanceof Ge.Arc||s instanceof Ge.Ray||s instanceof Ge.Line)(n[0])||o>1&&r(n[0])&&r(n[o-1])&&n.slice(1,o-1).every(i)))throw Ge.Errors.ILLEGAL_PARAMETERS;this.isInfinite=n.some((s)=>s instanceof Ge.Ray||s instanceof Ge.Line);for(let s of n){let a=new Ge.Edge(s);this.append(a)}this.setArcLength()}}get edges(){return[...this]}get box(){return this.edges.reduce((t,n)=>t.merge(n.box),new Ge.Box)}get vertices(){let t=this.edges.map((n)=>n.start);return t.push(this.last.end),t}get length(){if(this.isEmpty())return 0;if(this.isInfinite)return Number.POSITIVE_INFINITY;let t=0;for(let n of this)t+=n.length;return t}clone(){return new e(this.toShapes())}setArcLength(){for(let t of this)this.setOneEdgeArcLength(t)}setOneEdgeArcLength(t){t===this.first?t.arc_length=0:t.arc_length=t.prev.arc_length+t.prev.length}pointAtLength(t){if(t>this.length||t<0)return null;if(this.isInfinite)return null;let n=null;for(let o of this)if(t>=o.arc_length&&(o===this.last||t<o.next.arc_length)){n=o.pointAtLength(t-o.arc_length);break}return n}addVertex(t,n){let o=n.shape.split(t);if(o[0]===null)return n.prev;if(o[1]===null)return n;let r=new Ge.Edge(o[0]),i=n.prev;return this.insert(r,i),n.shape=o[1],r}getChain(t,n){let o=[];for(let r=t;r!==n.next;r=r.next)o.push(r);return o}split(t){for(let n of t){let o=this.findEdgeByPoint(n);this.addVertex(n,o)}return this}findEdgeByPoint(t){let n;for(let o of this)if(o.shape.contains(t)){n=o;break}return n}distanceTo(t){if(t instanceof Point){let[n,o]=Ge.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof Ge.Line){let[n,o]=Ge.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof Ge.Circle){let[n,o]=Ge.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof Ge.Segment){let[n,o]=Ge.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof Ge.Arc){let[n,o]=Ge.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof Ge.Multiline)return Ge.Distance.multiline2multiline(this,t);throw Ge.Errors.UNSUPPORTED_SHAPE_TYPE}intersect(t){return t instanceof Ge.Multiline?function(n,o){let r=[];for(let i of n)for(let s of o)r=[...r,...Fin(i.shape,s.shape)];return r}(this,t):Uq(t,this)}contains(t){if(t instanceof Ge.Point)return this.edges.some((n)=>n.shape.contains(t));throw Ge.Errors.UNSUPPORTED_SHAPE_TYPE}translate(t){return new e(this.edges.map((n)=>n.shape.translate(t)))}rotate(t=0,n=new Ge.Point){return new e(this.edges.map((o)=>o.shape.rotate(t,n)))}transform(t=new Ge.Matrix){return new e(this.edges.map((n)=>n.shape.transform(t)))}toShapes(){return this.edges.map((t)=>t.shape.clone())}toJSON(){return this.edges.map((t)=>t.toJSON())}svgPoints(){return this.vertices.map((t)=>`${t.x},${t.y}`).join(" ")}dpath(){let t=`M${this.first.start.x},${this.first.start.y}`;for(let n of this)t+=n.svg();return t}svg(t={}){let n=`
<path ${dY({fill:"none",...t})} d="`;n+=`
M${this.first.start.x},${this.first.start.y}`;for(let o of this)n+=o.svg();return n+=`" >
</path>`,n}};Ge.Multiline=EV;function vq(e,t,n){let o=n.length,r=e.shape.split(t);if(r.length===0)return;let i=0;i=r[0]===null?0:r[1]===null?e.shape.length:r[0].length;let s,a=0;jV(i,0)&&(a|=1),jV(i,e.shape.length)&&(a|=2),s=i===1/0?r[0].coord(t):2&a&&e.next&&e.next.arc_length===0?0:e.arc_length+i,n.push({id:o,pt:t,arc_length:s,edge_before:e,edge_after:void 0,face:e.face,is_vertex:a})}function mle(e){e.int_points1_sorted=SQ(e.int_points1),e.int_points2_sorted=SQ(e.int_points2)}function SQ(e){let t=new Map,n=0;for(let o of e)t.has(o.face)||(t.set(o.face,n),n++);for(let o of e)o.faceId=t.get(o.face);return e.slice().sort(Lxr)}function Lxr(e,t){return e.faceId<t.faceId?-1:e.faceId>t.faceId?1:e.arc_length<t.arc_length?-1:e.arc_length>t.arc_length?1:0}function HZe(e){if(e.int_points1.length<2)return;let t,n,o,r,i=!1;for(let s=0;s<e.int_points1_sorted.length;s++)if(e.int_points1_sorted[s].id!==-1){t=e.int_points1_sorted[s],n=e.int_points2[t.id];for(let a=s+1;a<e.int_points1_sorted.length&&(o=e.int_points1_sorted[a],jV(o.arc_length,t.arc_length));a++)o.id!==-1&&(r=e.int_points2[o.id],r.id!==-1&&o.edge_before===t.edge_before&&o.edge_after===t.edge_after&&r.edge_before===n.edge_before&&r.edge_after===n.edge_after&&(o.id=-1,r.id=-1,i=!0))}n=e.int_points2_sorted[0],t=e.int_points1[n.id];for(let s=1;s<e.int_points2_sorted.length;s++){let a=e.int_points2_sorted[s];if(a.id===-1)continue;if(n.id===-1||!jV(a.arc_length,n.arc_length)){n=a,t=e.int_points1[n.id];continue}let c=e.int_points1[a.id];c.edge_before===t.edge_before&&c.edge_after===t.edge_after&&a.edge_before===n.edge_before&&a.edge_after===n.edge_after&&(c.id=-1,a.id=-1,i=!0)}i&&(e.int_points1=e.int_points1.filter((s)=>s.id>=0),e.int_points2=e.int_points2.filter((s)=>s.id>=0),e.int_points1.forEach((s,a)=>s.id=a),e.int_points2.forEach((s,a)=>s.id=a))}function t$e(e){for(let t of e)t.edge_before&&(t.edge_before.bvStart=void 0,t.edge_before.bvEnd=void 0,t.edge_before.bv=void 0,t.edge_before.overlap=void 0),t.edge_after&&(t.edge_after.bvStart=void 0,t.edge_after.bvEnd=void 0,t.edge_after.bv=void 0,t.edge_after.overlap=void 0);for(let t of e)t.edge_before&&(t.edge_before.bvEnd=2),t.edge_after&&(t.edge_after.bvStart=2)}function n$e(e,t){for(let n of e)n.edge_before&&n.edge_before.setInclusion(t),n.edge_after&&n.edge_after.setInclusion(t)}function Sq(e,t,n){let o,r,i=1;if(e.length===1)return 1;o=e[t];for(let s=t+1;s<e.length&&o.face===n&&(r=e[s],r.pt.equalTo(o.pt)&&r.edge_before===o.edge_before&&r.edge_after===o.edge_after);s++)i++;return i}function Pq(e,t){if(t){for(let n of t){let o=n.edge_before;if(n.is_vertex=0,o.shape.start&&o.shape.start.equalTo(n.pt)&&(n.is_vertex|=1),o.shape.end&&o.shape.end.equalTo(n.pt)&&(n.is_vertex|=2),1&n.is_vertex){n.edge_before=o.prev,o.prev&&(n.is_vertex=2);continue}if(2&n.is_vertex)continue;let r=e.addVertex(n.pt,o);n.edge_before=r}for(let n of t)n.edge_before?n.edge_after=n.edge_before.next:e instanceof EV&&1&n.is_vertex&&(n.edge_after=e.first)}}function hOt(e,t,n){let o=e.edge_before,r=t.edge_after,i=n.length;o.next=n[0],n[0].prev=o,n[i-1].next=r,r.prev=n[i-1]}Ge.multiline=(...e)=>new Ge.Multiline(...e);var{INSIDE:zS,OUTSIDE:OS,BOUNDARY:$A,OVERLAP_SAME:Hxr,OVERLAP_OPPOSITE:Fxr}=HCe,{NOT_VERTEX:_Ls,START_VERTEX:dOt,END_VERTEX:uOt}=HCe;function o$e(e,t){let n=t.clone().reverse(),[o,r]=Wle(e,n,3,!0);return o}function zin(e,t){let[n,o]=Wle(e,t,2,!0);return n}function Oin(e,t){let[n,o]=Wle(e,t,2,!1),r=[];for(let s of n.faces)r=[...r,...[...s.edges].map((a)=>a.shape)];let i=[];for(let s of o.faces)i=[...i,...[...s.edges].map((a)=>a.shape)];return[r,i]}function r$e(e,t){let[n,o]=Wle(e,t,3,!1),r=[];for(let i of n.faces)r=[...r,...[...i.edges].map((s)=>s.shape)];return r}function Vin(e,t){let n=e.clone(),o=t.clone(),r=Yin(n,o);return mle(r),Pq(n,r.int_points1_sorted),Pq(o,r.int_points2_sorted),HZe(r),mle(r),[r.int_points1_sorted.map((i)=>i.pt),r.int_points2_sorted.map((i)=>i.pt)]}function zxr(e,t,n,o){let r=pOt(e,n.int_points1),i=pOt(t,n.int_points2);for(mOt(r,t),mOt(i,e),t$e(n.int_points1),t$e(n.int_points2),n$e(n.int_points1,t),n$e(n.int_points2,e);Oxr(e,t,n.int_points1,n.int_points1_sorted,n.int_points2,n););(function(s){let a,c,l,h=s.int_points1.length;for(let d=0;d<h;d++){let u=s.int_points1_sorted[d];u.face!==a&&(c=d,a=u.face);let _,p=d,m=Sq(s.int_points1_sorted,d,a);_=p+m<h&&s.int_points1_sorted[p+m].face===a?p+m:c;let A=Sq(s.int_points1_sorted,_,a);l=null;for(let I=_;I<_+A;I++){let v=s.int_points1_sorted[I];if(v.face===a&&s.int_points2[v.id].face===s.int_points2[u.id].face){l=v;break}}if(l===null)continue;let g=u.edge_after,f=l.edge_before;if(g.bv!==2||f.bv!==2)continue;if(g!==f)continue;let y=s.int_points2[u.id],x=s.int_points2[l.id],C=y.edge_after,b=x.edge_before;C.bv===2&&b.bv===2&&C===b||(y=s.int_points2[l.id],x=s.int_points2[u.id],C=y.edge_after,b=x.edge_before),C.bv===2&&b.bv===2&&C===b&&g.setOverlap(C)}})(n),i$e(e,o,n.int_points1_sorted,!0),i$e(t,o,n.int_points2_sorted,!1),_Ot(e,r,o,!0),_Ot(t,i,o,!1)}function Wle(e,t,n,o){let r=e.clone(),i=t.clone(),s=Yin(r,i);return mle(s),Pq(r,s.int_points1_sorted),Pq(i,s.int_points2_sorted),HZe(s),mle(s),zxr(r,i,s,n),o&&function(a,c,l){(function(h,d,u,_){for(let p of d.faces){for(let m of p)h.edges.add(m);_.find((m)=>m.face===p)===void 0&&h.addFace(p.first,p.last)}})(a,c,0,l.int_points2),function(h,d,u){if(u.int_points1.length!==0)for(let _=0;_<u.int_points1.length;_++){let p=u.int_points1[_],m=u.int_points2[_];if(p.edge_before!==void 0&&p.edge_after===void 0&&m.edge_before===void 0&&m.edge_after!==void 0&&(p.edge_before.next=m.edge_after,m.edge_after.prev=p.edge_before,p.edge_after=m.edge_after,m.edge_before=p.edge_before),m.edge_before!==void 0&&m.edge_after===void 0&&p.edge_before===void 0&&p.edge_after!==void 0&&(m.edge_before.next=p.edge_after,p.edge_after.prev=m.edge_before,m.edge_after=p.edge_after,p.edge_before=m.edge_before),p.edge_before!==void 0&&p.edge_after===void 0)for(let A of u.int_points1_sorted)A!==p&&A.edge_before===void 0&&A.edge_after!==void 0&&A.pt.equalTo(p.pt)&&(p.edge_before.next=A.edge_after,A.edge_after.prev=p.edge_before,p.edge_after=A.edge_after,A.edge_before=p.edge_before);if(m.edge_before!==void 0&&m.edge_after===void 0)for(let A of u.int_points2_sorted)A!==m&&A.edge_before===void 0&&A.edge_after!==void 0&&A.pt.equalTo(m.pt)&&(m.edge_before.next=A.edge_after,A.edge_after.prev=m.edge_before,m.edge_after=A.edge_after,A.edge_before=m.edge_before)}}(0,0,l),s$e(a,l.int_points1),s$e(c,l.int_points2),a$e(a,l.int_points1,l.int_points2),a$e(a,l.int_points2,l.int_points1)}(r,i,s),[r,i]}function Yin(e,t){let n={int_points1:[],int_points2:[]};for(let o of e.edges){let r=t.edges.search(o.box);for(let i of r){let s=o.shape.intersect(i.shape);for(let a of s)vq(o,a,n.int_points1),vq(i,a,n.int_points2)}}return n}function pOt(e,t){let n=[];for(let o of e.faces)t.find((r)=>r.face===o)||n.push(o);return n}function mOt(e,t){for(let n of e)n.first.bv=n.first.bvStart=n.first.bvEnd=void 0,n.first.setInclusion(t)}function Oxr(e,t,n,o,r,i){let s,a,c,l=o.length,h=!1;for(let d=0;d<l;d++){let u=o[d];u.face!==s&&(a=d,s=u.face);let _,p=d,m=Sq(o,d,s);_=p+m<l&&o[p+m].face===s?p+m:a;let A=Sq(o,_,s);c=null;for(let y=_;y<_+A;y++){let x=o[y];if(x.face===s&&r[x.id].face===r[u.id].face){c=x;break}}if(c===null)continue;let g=u.edge_after,f=c.edge_before;if(g.bv!==$A||f.bv==$A)if(g.bv==$A||f.bv!==$A){if(g.bv===$A&&f.bv===$A&&g!=f||g.bv===zS&&f.bv===OS||g.bv===OS&&f.bv===zS){let y=g.next;for(;y!=f;)y.bvStart=void 0,y.bvEnd=void 0,y.bv=void 0,y.setInclusion(t),y=y.next}if(g.bv===$A&&f.bv===$A&&g!=f){let y,x=g.next;for(;x!=f;){if(x.bv!=$A){if(y===void 0)y=x.bv;else if(x.bv!=y)throw x0.UNRESOLVED_BOUNDARY_CONFLICT}x=x.next}y!=null&&(g.bv=y,f.bv=y);continue}if(g.bv===zS&&f.bv===OS||g.bv===OS&&f.bv===zS){let y=g;for(;y!=f;){if(y.bvStart===g.bv&&y.bvEnd===f.bv){let[x,C]=y.shape.distanceTo(t);if(x<10*Ge.DP_TOL){vq(y,C.ps,n);let b=n[n.length-1];if(b.is_vertex&dOt)b.edge_after=y,b.edge_before=y.prev,y.bvStart=$A,y.bv=void 0,y.setInclusion(t);else if(b.is_vertex&uOt)b.edge_after=y.next,y.bvEnd=$A,y.bv=void 0,y.setInclusion(t);else{let P=t.addVertex(b.pt,y);b.edge_before=P,b.edge_after=P.next,P.setInclusion(t),P.next.bvStart=$A,P.next.bvEnd=void 0,P.next.bv=void 0,P.next.setInclusion(t)}let I=t.findEdgeByPoint(C.pe);vq(I,C.pe,r);let v=r[r.length-1];if(v.is_vertex&dOt)v.edge_after=I,v.edge_before=I.prev;else if(v.is_vertex&uOt)v.edge_after=I.next;else{let P=r.find((B)=>B.edge_after===I),M=t.addVertex(v.pt,I);v.edge_before=M,v.edge_after=M.next,P&&(P.edge_after=M),M.bvStart=void 0,M.bvEnd=$A,M.bv=void 0,M.setInclusion(e),M.next.bvStart=$A,M.next.bvEnd=void 0,M.next.bv=void 0,M.next.setInclusion(e)}mle(i),h=!0;break}}y=y.next}if(h)break;throw x0.UNRESOLVED_BOUNDARY_CONFLICT}}else f.bv=g.bv;else g.bv=f.bv}return h}function i$e(e,t,n,o){if(!n)return;let r,i,s,a;for(let c=0;c<n.length;c++){if(s=n[c],s.face!==r&&(i=c,r=s.face),r.isEmpty())continue;let l,h=c,d=Sq(n,c,r);l=h+d<n.length&&n[h+d].face===s.face?h+d:i,a=n[l];let u=l,_=Sq(n,u,r),p=s.edge_after,m=a.edge_before;if(p.bv===zS&&m.bv===zS&&t===1||p.bv===OS&&m.bv===OS&&t===2||(p.bv===OS||m.bv===OS)&&t===3&&!o||(p.bv===zS||m.bv===zS)&&t===3&&o||p.bv===$A&&m.bv===$A&&p.overlap&Hxr&&o||p.bv===$A&&m.bv===$A&&p.overlap&Fxr){e.removeChain(r,p,m);for(let A=h;A<h+d;A++)n[A].edge_after=void 0;for(let A=u;A<u+_;A++)n[A].edge_before=void 0}c+=d-1}}function s$e(e,t){for(let n of t)e.faces.delete(n.face),n.face=void 0,n.edge_before&&(n.edge_before.face=void 0),n.edge_after&&(n.edge_after.face=void 0)}function a$e(e,t,n){for(let o of t){if(o.edge_before===void 0||o.edge_after===void 0)continue;if(o.face)continue;if(o.edge_after.face||o.edge_before.face)continue;let{edge_after:r,edge_before:i}=o;try{DZe.testInfiniteLoop(r)}catch(a){throw x0.CANNOT_COMPLETE_BOOLEAN_OPERATION}let s=e.addFace(r,i);for(let a of t)a.edge_before&&a.edge_after&&a.edge_before.face===s&&a.edge_after.face===s&&(a.face=s);for(let a of n)a.edge_before&&a.edge_after&&a.edge_before.face===s&&a.edge_after.face===s&&(a.face=s)}}function _Ot(e,t,n,o){for(let r of t){let i=r.first.bv;(n===1&&i===zS||n===3&&i===zS&&o||n===3&&i===OS&&!o||n===2&&i===OS)&&e.deleteFace(r)}}var Vxr=Object.freeze({__proto__:null,BOOLEAN_INTERSECT:2,BOOLEAN_SUBTRACT:3,BOOLEAN_UNION:1,calculateIntersections:Vin,innerClip:Oin,intersect:zin,outerClip:r$e,removeNotRelevantChains:i$e,removeOldFaces:s$e,restoreFaces:a$e,subtract:o$e,unify:function(e,t){let[n,o]=Wle(e,t,1,!0);return n}}),Yxr=RegExp("T.F..FFF.|T.F...F.."),Gxr=RegExp("T........|.T.......|...T.....|....T...."),Uxr=RegExp("FT.......|F..T.....|F...T...."),Wxr=RegExp("T.F..F..."),Xxr=RegExp("T.F..F...|.TF..F...|..FT.F...|..F.TF..."),P$=class{constructor(){this.m=[,,,,,,,,,].fill(void 0)}get I2I(){return this.m[0]}set I2I(e){this.m[0]=e}get I2B(){return this.m[1]}set I2B(e){this.m[1]=e}get I2E(){return this.m[2]}set I2E(e){this.m[2]=e}get B2I(){return this.m[3]}set B2I(e){this.m[3]=e}get B2B(){return this.m[4]}set B2B(e){this.m[4]=e}get B2E(){return this.m[5]}set B2E(e){this.m[5]=e}get E2I(){return this.m[6]}set E2I(e){this.m[6]=e}get E2B(){return this.m[7]}set E2B(e){this.m[7]=e}get E2E(){return this.m[8]}set E2E(e){this.m[8]=e}toString(){return this.m.map((e)=>e instanceof Array&&e.length>0?"T":e instanceof Array&&e.length===0?"F":"*").join("")}equal(){return Yxr.test(this.toString())}intersect(){return Gxr.test(this.toString())}touch(){return Uxr.test(this.toString())}inside(){return Wxr.test(this.toString())}covered(){return Xxr.test(this.toString())}};function Tce(e,t){let n,o=new Ge.Ray(t),r=new Ge.Line(o.pt,o.norm),i=new Ge.Box(o.box.xmin-Ge.DP_TOL,o.box.ymin-Ge.DP_TOL,o.box.xmax+Ge.DP_TOL,o.box.ymax+Ge.DP_TOL);if(e.box.not_intersect(i))return Ge.OUTSIDE;let s=e.edges.search(i);if(s.length===0)return Ge.OUTSIDE;for(let h of s)if(h.shape.contains(t))return Ge.BOUNDARY;let a=[...e.faces],c=[];for(let h of s)for(let d of o.intersect(h.shape)){if(d.equalTo(t))return Ge.BOUNDARY;c.push({pt:d,edge:h,face_index:a.indexOf(h.face)})}c.sort((h,d)=>Ein(h.pt.x,d.pt.x)?-1:Pin(h.pt.x,d.pt.x)?1:h.face_index<d.face_index?-1:h.face_index>d.face_index?1:h.edge.arc_length<d.edge.arc_length?-1:h.edge.arc_length>d.edge.arc_length?1:0);let l=0;for(let h=0;h<c.length;h++){let d=c[h];if(d.pt.equalTo(d.edge.shape.start)){if(h>0&&d.pt.equalTo(c[h-1].pt)&&d.face_index===c[h-1].face_index&&d.edge.prev===c[h-1].edge)continue;let u=d.edge.prev;for(;e$e(u.length);)u=u.prev;let _=u.shape.tangentInEnd(),p=d.pt.translate(_),m=d.edge.shape.tangentInStart(),A=d.pt.translate(m),g=p.leftTo(r),f=A.leftTo(r);(g&&!f||!g&&f)&&l++}else if(d.pt.equalTo(d.edge.shape.end)){if(h>0&&d.pt.equalTo(c[h-1].pt)&&d.face_index===c[h-1].face_index&&d.edge.next===c[h-1].edge)continue;let u=d.edge.next;for(;e$e(u.length);)u=u.next;let _=u.shape.tangentInStart(),p=d.pt.translate(_),m=d.edge.shape.tangentInEnd(),A=d.pt.translate(m),g=p.leftTo(r),f=A.leftTo(r);(g&&!f||!g&&f)&&l++}else if(d.edge.shape instanceof Ge.Segment)l++;else{let u=d.edge.shape.box;jV(d.pt.y,u.ymin)||jV(d.pt.y,u.ymax)||l++}}return n=l%2==1?1:0,n}function gOt(e,t){return U$(e,t).intersect()}function AOt(e,t){return U$(e,t).inside()}function Gin(e,t){return U$(e,t).covered()}function Uin(e,t){return Gin(t,e)}function U$(e,t){return e instanceof Ge.Line&&t instanceof Ge.Line?function(n,o){let r=new P$,i=Gq(n,o);return i.length===0?n.contains(o.pt)&&o.contains(n.pt)?(r.I2I=[n],r.I2E=[],r.E2I=[]):(r.I2I=[],r.I2E=[n],r.E2I=[o]):(r.I2I=i,r.I2E=n.split(i),r.E2I=o.split(i)),r}(e,t):e instanceof Ge.Line&&t instanceof Ge.Circle?function(n,o){let r=new P$,i=uY(n,o);if(i.length===0)r.I2I=[],r.I2B=[],r.I2E=[n],r.E2I=[o];else if(i.length===1)r.I2I=[],r.I2B=i,r.I2E=n.split(i),r.E2I=[o];else{let s=new EV([n]),a=n.sortPoints(i);s.split(a);let c=s.toShapes();r.I2I=[c[1]],r.I2B=a,r.I2E=[c[0],c[2]],r.E2I=new Ge.Polygon([o.toArc()]).cutWithLine(n)}return r}(e,t):e instanceof Ge.Line&&t instanceof Ge.Box?function(n,o){let r=new P$,i=bq(n,o);if(i.length===0)r.I2I=[],r.I2B=[],r.I2E=[n],r.E2I=[o];else if(i.length===1)r.I2I=[],r.I2B=i,r.I2E=n.split(i),r.E2I=[o];else{let s=new EV([n]),a=n.sortPoints(i);s.split(a);let c=s.toShapes();o.toSegments().some((l)=>l.contains(i[0])&&l.contains(i[1]))?(r.I2I=[],r.I2B=[c[1]],r.I2E=[c[0],c[2]],r.E2I=[o]):(r.I2I=[c[1]],r.I2B=a,r.I2E=[c[0],c[2]],r.E2I=new Ge.Polygon(o.toSegments()).cutWithLine(n))}return r}(e,t):e instanceof Ge.Line&&t instanceof Ge.Polygon?function(n,o){let r=new P$,i=Ule(n,o),s=new EV([n]),a=i.length>0?i.slice():n.sortPoints(i);return s.split(a),[...s].forEach((c)=>c.setInclusion(o)),r.I2I=[...s].filter((c)=>c.bv===Ge.INSIDE).map((c)=>c.shape),r.I2B=[...s].slice(1).map((c)=>c.bv===Ge.BOUNDARY?c.shape:c.shape.start),r.I2E=[...s].filter((c)=>c.bv===Ge.OUTSIDE).map((c)=>c.shape),r.E2I=o.cutWithLine(n),r}(e,t):(e instanceof Ge.Segment||e instanceof Ge.Arc)&&t instanceof Ge.Polygon?fOt(e,t):(e instanceof Ge.Segment||e instanceof Ge.Arc)&&(t instanceof Ge.Circle||t instanceof Ge.Box)?fOt(e,new Ge.Polygon(t)):e instanceof Ge.Polygon&&t instanceof Ge.Polygon?a3e(e,t):(e instanceof Ge.Circle||e instanceof Ge.Box)&&(t instanceof Ge.Circle||t instanceof Ge.Box)?a3e(new Ge.Polygon(e),new Ge.Polygon(t)):(e instanceof Ge.Circle||e instanceof Ge.Box)&&t instanceof Ge.Polygon?a3e(new Ge.Polygon(e),t):e instanceof Ge.Polygon&&(t instanceof Ge.Circle||t instanceof Ge.Box)?a3e(e,new Ge.Polygon(t)):void 0}function fOt(e,t){let n=new P$,o=function(s,a){return s instanceof Ge.Line?Ule(s,a):s instanceof Ge.Segment?RZe(s,a):s instanceof Ge.Arc?QZe(s,a):[]}(e,t),r=o.length>0?o.slice():e.sortPoints(o),i=new EV([e]);i.split(r),[...i].forEach((s)=>s.setInclusion(t)),n.I2I=[...i].filter((s)=>s.bv===Ge.INSIDE).map((s)=>s.shape),n.I2B=[...i].slice(1).map((s)=>s.bv===Ge.BOUNDARY?s.shape:s.shape.start),n.I2E=[...i].filter((s)=>s.bv===Ge.OUTSIDE).map((s)=>s.shape),n.B2I=[],n.B2B=[],n.B2E=[];for(let s of[e.start,e.end])switch(Tce(t,s)){case Ge.INSIDE:n.B2I.push(s);break;case Ge.BOUNDARY:n.B2B.push(s);break;case Ge.OUTSIDE:n.B2E.push(s)}return n}function a3e(e,t){let n=new P$,[o,r]=Vin(e,t),i=zin(e,t),s=o$e(e,t),a=o$e(t,e),[c,l]=Oin(e,t),h=r$e(e,t),d=r$e(t,e);return n.I2I=i.isEmpty()?[]:[i],n.I2B=l,n.I2E=s.isEmpty()?[]:[s],n.B2I=c,n.B2B=o,n.B2E=h,n.E2I=a.isEmpty()?[]:[a],n.E2B=d,n}var jxr=Object.freeze({__proto__:null,contain:function(e,t){return AOt(t,e)},cover:Uin,covered:Gin,disjoint:function(e,t){return!gOt(e,t)},equal:function(e,t){return U$(e,t).equal()},inside:AOt,intersect:gOt,relate:U$,touch:function(e,t){return U$(e,t).touch()}}),Dce=class e{constructor(t=1,n=0,o=0,r=1,i=0,s=0){this.a=t,this.b=n,this.c=o,this.d=r,this.tx=i,this.ty=s}fromMatrix3x3(t){let[n,o,r]=t[0],[i,s,a]=t[1];return new e(n,i,o,s,r,a)}toMatrix3x3(){return[[this.a,this.c,this.tx],[this.b,this.d,this.ty],[0,0,1]]}clone(){return new e(this.a,this.b,this.c,this.d,this.tx,this.ty)}transform(t){return[t[0]*this.a+t[1]*this.c+this.tx,t[0]*this.b+t[1]*this.d+this.ty]}multiply(t){return new e(this.a*t.a+this.c*t.b,this.b*t.a+this.d*t.b,this.a*t.c+this.c*t.d,this.b*t.c+this.d*t.d,this.a*t.tx+this.c*t.ty+this.tx,this.b*t.tx+this.d*t.ty+this.ty)}translate(...t){let n,o;if(t.length!=1||isNaN(t[0].x)||isNaN(t[0].y)){if(t.length!==2||typeof t[0]!="number"||typeof t[1]!="number")throw x0.ILLEGAL_PARAMETERS;n=t[0],o=t[1]}else n=t[0].x,o=t[0].y;return this.multiply(new e(1,0,0,1,n,o))}rotate(t,n=0,o=0){let r=Math.cos(t),i=Math.sin(t);return this.translate(n,o).multiply(new e(r,i,-i,r,0,0)).translate(-n,-o)}scale(t,n){return this.multiply(new e(t,0,0,n,0,0))}equalTo(t){return!!Ge.Utils.EQ(this.tx,t.tx)&&(!!Ge.Utils.EQ(this.ty,t.ty)&&(!!Ge.Utils.EQ(this.a,t.a)&&(!!Ge.Utils.EQ(this.b,t.b)&&(!!Ge.Utils.EQ(this.c,t.c)&&!!Ge.Utils.EQ(this.d,t.d)))))}};Ge.Matrix=Dce;Ge.matrix=(...e)=>new Ge.Matrix(...e);var Kxr=class{constructor(e,t){this.low=e,this.high=t}get max(){return this.clone()}less_than(e){return this.low<e.low||this.low===e.low&&this.high<e.high}equal_to(e){return this.low===e.low&&this.high===e.high}intersect(e){return!this.not_intersect(e)}not_intersect(e){return this.high<e.low||e.high<this.low}merge(e){let t=this.low===void 0?e.low:this.low<e.low?this.low:e.low,n=this.high===void 0?e.high:this.high>e.high?this.high:e.high,o=this.clone();return o.low=t,o.high=n,o}output(){return[this.low,this.high]}comparable_less_than(e,t){return e<t}},$xr=class e extends Kxr{clone(){return new e(this.low,this.high)}},mQ=class{constructor(e,t,n=null,o=null,r=null,i=0){if(this.left=n,this.right=o,this.parent=r,this.color=i,this.item={key:void 0,values:[]},t!==void 0&&this.item.values.push(t),e!==void 0)if(Array.isArray(e)){let[s,a]=e;if(!Number.isNaN(s)&&!Number.isNaN(a)){let c=s,l=a;c>l&&([c,l]=[l,c]),this.item.key=new $xr(c,l)}}else this.item.key=e;this.max=this.item.key?this.item.key.max:void 0}isNil(){return this.item.key===void 0&&this.item.values.length===0&&this.left===null&&this.right===null&&this.color===0}requireKey(){if(!this.item.key)throw Error("Node key is undefined (nil/sentinel). Operation is not applicable.");return this.item.key}less_than(e){let t=this.requireKey(),n=e.requireKey();return t.less_than(n)}_value_equal(e){let t=this.item.values[0],n=e.item.values[0];return t&&n&&t.equal_to?t.equal_to(n):t===n}equal_to(e){let t=this.requireKey(),n=e.requireKey();return t.equal_to(n)}intersect(e){let t=this.requireKey(),n=e.requireKey();return t.intersect(n)}copy_data(e){this.item.key=e.item.key,this.item.values=e.item.values.slice()}update_max(){this.max=this.item.key?this.item.key.max:void 0,this.right&&this.right.max&&(this.max=this.max?this.max.merge(this.right.max):this.right.max),this.left&&this.left.max&&(this.max=this.max?this.max.merge(this.left.max):this.left.max)}not_intersect_left_subtree(e){if(!this.left)return!0;let t=this.left.max?this.left.max.high:this.left.item.key.high,n=this.requireKey(),o=e.requireKey();return n.comparable_less_than(t,o.low)}not_intersect_right_subtree(e){if(!this.right)return!0;let t=this.right.max?this.right.max.low:this.right.item.key.low,n=this.requireKey(),o=e.requireKey();return n.comparable_less_than(o.high,t)}},c$e=class e{constructor(){this.root=null,this.nil_node=new mQ}get size(){let t=0;return this.tree_walk(this.root,(n)=>t+=n.item.values.length),t}get keys(){let t=[];return this.tree_walk(this.root,(n)=>t.push(n.item.key.output())),t}get values(){let t=[];return this.tree_walk(this.root,(n)=>{for(let o of n.item.values)t.push(o)}),t}get items(){let t=[];return this.tree_walk(this.root,(n)=>{let o=n.item.key.output();for(let r of n.item.values)t.push({key:o,value:r})}),t}isEmpty(){return this.root==null||this.root===this.nil_node}clear(){this.root=null}insert(t,n=t){if(t===void 0)return;let o=this.tree_search(this.root,new mQ(t));if(o)return o.item.values.push(n),o;let r=new mQ(t,n,this.nil_node,this.nil_node,null,1);return this.tree_insert(r),this.recalc_max(r),r}exist(t,n=t){let o=this.tree_search(this.root,new mQ(t));return!!o&&(arguments.length<2||n===t||o.item.values.some((r)=>r&&r.equal_to?r.equal_to(n):r===n))}remove(t,n=t){let o=this.tree_search(this.root,new mQ(t));if(!o)return;if(arguments.length<2)return this.tree_delete(o),o;let r=o.item.values.findIndex((i)=>i&&i.equal_to?i.equal_to(n):i===n);return r>=0?(o.item.values.splice(r,1),o.item.values.length===0&&this.tree_delete(o),o):void 0}search(t,n=(o,r)=>o===r?r.output():o){let o=new mQ(t),r=[];this.tree_search_interval(this.root,o,r);let i=[];for(let s of r)for(let a of s.item.values)i.push(n(a,s.item.key));return i}intersect_any(t){let n=new mQ(t);return this.tree_find_any_interval(this.root,n)}forEach(t){this.tree_walk(this.root,(n)=>{for(let o of n.item.values)t(n.item.key,o)})}map(t){let n=new e;return this.tree_walk(this.root,(o)=>{for(let r of o.item.values)n.insert(o.item.key,t(r,o.item.key))}),n}*iterate(t,n=(o,r)=>o===r?r.output():o){let o=null;for(t?o=this.tree_search_nearest_forward(this.root,new mQ(t)):this.root&&(o=this.local_minimum(this.root));o;){for(let r of o.item.values)yield n(r,o.item.key);o=this.tree_successor(o)}}recalc_max(t){let n=t;for(;n.parent!=null;)n.parent.update_max(),n=n.parent}tree_insert(t){let n=this.root,o=null;if(this.root==null||this.root===this.nil_node)this.root=t;else{for(;n!==this.nil_node;)o=n,n=t.less_than(n)?n.left:n.right;t.parent=o,t.less_than(o)?o.left=t:o.right=t}this.insert_fixup(t)}insert_fixup(t){let n,o;for(n=t;n!==this.root&&n.parent.color===1;)n.parent===n.parent.parent.left?(o=n.parent.parent.right,o.color===1?(n.parent.color=0,o.color=0,n.parent.parent.color=1,n=n.parent.parent):(n===n.parent.right&&(n=n.parent,this.rotate_left(n)),n.parent.color=0,n.parent.parent.color=1,this.rotate_right(n.parent.parent))):(o=n.parent.parent.left,o.color===1?(n.parent.color=0,o.color=0,n.parent.parent.color=1,n=n.parent.parent):(n===n.parent.left&&(n=n.parent,this.rotate_right(n)),n.parent.color=0,n.parent.parent.color=1,this.rotate_left(n.parent.parent)));this.root.color=0}tree_delete(t){let n,o;n=t.left===this.nil_node||t.right===this.nil_node?t:this.tree_successor(t),o=n.left!==this.nil_node?n.left:n.right,o.parent=n.parent,n===this.root?this.root=o:(n===n.parent.left?n.parent.left=o:n.parent.right=o,n.parent.update_max()),this.recalc_max(o),n!==t&&(t.copy_data(n),t.update_max(),this.recalc_max(t)),n.color===0&&this.delete_fixup(o)}delete_fixup(t){let n,o=t;for(;o!==this.root&&o.parent!=null&&o.color===0;)o===o.parent.left?(n=o.parent.right,n.color===1&&(n.color=0,o.parent.color=1,this.rotate_left(o.parent),n=o.parent.right),n.left.color===0&&n.right.color===0?(n.color=1,o=o.parent):(n.right.color===0&&(n.color=1,n.left.color=0,this.rotate_right(n),n=o.parent.right),n.color=o.parent.color,o.parent.color=0,n.right.color=0,this.rotate_left(o.parent),o=this.root)):(n=o.parent.left,n.color===1&&(n.color=0,o.parent.color=1,this.rotate_right(o.parent),n=o.parent.left),n.left.color===0&&n.right.color===0?(n.color=1,o=o.parent):(n.left.color===0&&(n.color=1,n.right.color=0,this.rotate_left(n),n=o.parent.left),n.color=o.parent.color,o.parent.color=0,n.left.color=0,this.rotate_right(o.parent),o=this.root));o.color=0}tree_search(t,n){if(t!=null&&t!==this.nil_node)return n.equal_to(t)?t:n.less_than(t)?this.tree_search(t.left,n):this.tree_search(t.right,n)}tree_search_nearest_forward(t,n){let o=null,r=t;for(;r&&r!==this.nil_node;)r.less_than(n)?r.intersect(n)?(o=r,r=r.left):r=r.right:(o&&!r.less_than(o)||(o=r),r=r.left);return o||null}tree_search_interval(t,n,o){t!=null&&t!==this.nil_node&&(t.left===this.nil_node||t.not_intersect_left_subtree(n)||this.tree_search_interval(t.left,n,o),t.intersect(n)&&o.push(t),t.right===this.nil_node||t.not_intersect_right_subtree(n)||this.tree_search_interval(t.right,n,o))}tree_find_any_interval(t,n){let o=!1;return t!=null&&t!==this.nil_node&&(t.left===this.nil_node||t.not_intersect_left_subtree(n)||(o=this.tree_find_any_interval(t.left,n)),o||(o=t.intersect(n)),o||t.right===this.nil_node||t.not_intersect_right_subtree(n)||(o=this.tree_find_any_interval(t.right,n))),o}local_minimum(t){let n=t;for(;n.left!=null&&n.left!==this.nil_node;)n=n.left;return n}local_maximum(t){let n=t;for(;n.right!=null&&n.right!==this.nil_node;)n=n.right;return n}tree_successor(t){let n,o,r;if(t.right!==this.nil_node)n=this.local_minimum(t.right);else{for(o=t,r=t.parent;r!=null&&r.right===o;)o=r,r=r.parent;n=r}return n}rotate_left(t){let n=t.right;t.right=n.left,n.left!==this.nil_node&&(n.left.parent=t),n.parent=t.parent,t===this.root?this.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n.left=t,t.parent=n,t!==null&&t!==this.nil_node&&t.update_max(),n!=null&&n!==this.nil_node&&n.update_max()}rotate_right(t){let n=t.left;t.left=n.right,n.right!==this.nil_node&&(n.right.parent=t),n.parent=t.parent,t===this.root?this.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n.right=t,t.parent=n,t!==null&&t!==this.nil_node&&t.update_max(),n!=null&&n!==this.nil_node&&n.update_max()}tree_walk(t,n){t!=null&&t!==this.nil_node&&(this.tree_walk(t.left,n),n(t),this.tree_walk(t.right,n))}testRedBlackProperty(){let t=!0;return this.tree_walk(this.root,function(n){n.color===1&&(n.left.color===0&&n.right.color===0||(t=!1))}),t}testBlackHeightProperty(t){let n=0,o=0,r=0;if(t.color===0&&n++,o=t.left!==this.nil_node?this.testBlackHeightProperty(t.left):1,r=t.right!==this.nil_node?this.testBlackHeightProperty(t.right):1,o!==r)throw Error("Red-black height property violated");return n+=o,n}},qxr=class extends Set{constructor(e){super(e),this.index=new c$e,this.forEach((t)=>this.index.insert(t))}add(e){let t=this.size,{key:n,value:o}=e,r=n||e.box,i=o||e;return super.add(i),this.size>t&&this.index.insert(r,i),this}delete(e){let{key:t,value:n}=e,o=t||e.box,r=n||e,i=super.delete(r);return i&&this.index.remove(o,r),i}clear(){super.clear(),this.index=new c$e}search(e){return this.index.search(e)}hit(e){let t=new Ge.Box(e.x-1,e.y-1,e.x+1,e.y+1);return this.index.search(t).filter((n)=>e.on(n))}svg(){return[...this].reduce((e,t)=>e+t.svg(),"")}};Ge.PlanarSet=qxr;var sk=class{get name(){throw x0.CANNOT_INVOKE_ABSTRACT_METHOD}get box(){throw x0.CANNOT_INVOKE_ABSTRACT_METHOD}clone(){throw x0.CANNOT_INVOKE_ABSTRACT_METHOD}translate(...e){return this.transform(new Dce().translate(...e))}rotate(e,t=new Ge.Point){return this.transform(new Dce().rotate(e,t.x,t.y))}scale(e,t){return this.transform(new Dce().scale(e,t))}transform(...e){throw x0.CANNOT_INVOKE_ABSTRACT_METHOD}toJSON(){return Object.assign({},this,{name:this.name})}svg(e={}){throw x0.CANNOT_INVOKE_ABSTRACT_METHOD}};Ge.Point=class e extends sk{constructor(...t){if(super(),this.x=0,this.y=0,t.length!==0){if(t.length===1&&t[0]instanceof Array&&t[0].length===2){let n=t[0];if(typeof n[0]=="number"&&typeof n[1]=="number")return this.x=n[0],void(this.y=n[1])}if(t.length===1&&t[0]instanceof Object&&t[0].name==="point"){let{x:n,y:o}=t[0];return this.x=n,void(this.y=o)}if(t.length===2&&typeof t[0]=="number"&&typeof t[1]=="number")return this.x=t[0],void(this.y=t[1]);throw x0.ILLEGAL_PARAMETERS}}get box(){return new Ge.Box(this.x,this.y,this.x,this.y)}clone(){return new Ge.Point(this.x,this.y)}get vertices(){return[this.clone()]}equalTo(t){return Ge.Utils.EQ(this.x,t.x)&&Ge.Utils.EQ(this.y,t.y)}lessThan(t){return!!Ge.Utils.LT(this.y,t.y)||!(!Ge.Utils.EQ(this.y,t.y)||!Ge.Utils.LT(this.x,t.x))}transform(t){return new Ge.Point(t.transform([this.x,this.y]))}projectionOn(t){if(this.equalTo(t.pt))return this.clone();let n=new Ge.Vector(this,t.pt);if(Ge.Utils.EQ_0(n.cross(t.norm)))return t.pt.clone();let o=n.dot(t.norm),r=t.norm.multiply(o);return this.translate(r)}leftTo(t){let n=new Ge.Vector(t.pt,this);return Ge.Utils.GT(n.dot(t.norm),0)}distanceTo(t){if(t instanceof e){let n=t.x-this.x,o=t.y-this.y;return[Math.sqrt(n*n+o*o),new Ge.Segment(this,t)]}return t instanceof Ge.Line?Ge.Distance.point2line(this,t):t instanceof Ge.Circle?Ge.Distance.point2circle(this,t):t instanceof Ge.Segment?Ge.Distance.point2segment(this,t):t instanceof Ge.Arc?Ge.Distance.point2arc(this,t):t instanceof Ge.Polygon?Ge.Distance.point2polygon(this,t):t instanceof Ge.PlanarSet?Ge.Distance.shape2planarSet(this,t):t instanceof Ge.Multiline?Ge.Distance.shape2multiline(this,t):void 0}on(t){if(t instanceof Ge.Point)return this.equalTo(t);if(t.contains&&t.contains instanceof Function)return t.contains(this);throw Ge.Errors.UNSUPPORTED_SHAPE_TYPE}get name(){return"point"}svg(t={}){let n=t.r??3;return`
<circle cx="${this.x}" cy="${this.y}" r="${n}"
            ${dY({fill:"red",...t})} />`}};Ge.point=(...e)=>new Ge.Point(...e);Ge.Vector=class extends sk{constructor(...e){if(super(),this.x=0,this.y=0,e.length!==0){if(e.length===1&&e[0]instanceof Array&&e[0].length===2){let t=e[0];if(typeof t[0]=="number"&&typeof t[1]=="number")return this.x=t[0],void(this.y=t[1])}if(e.length===1&&e[0]instanceof Object&&e[0].name==="vector"){let{x:t,y:n}=e[0];return this.x=t,void(this.y=n)}if(e.length===1&&e[0]instanceof Object&&e[0].name==="segment"){let{start:t,end:n}=e[0];return this.x=n.x-t.x,void(this.y=n.y-t.y)}if(e.length===2){let t=e[0],n=e[1];if(typeof t=="number"&&typeof n=="number")return this.x=t,void(this.y=n);if(t instanceof Ge.Point&&n instanceof Ge.Point)return this.x=n.x-t.x,void(this.y=n.y-t.y)}throw x0.ILLEGAL_PARAMETERS}}clone(){return new Ge.Vector(this.x,this.y)}get slope(){let e=Math.atan2(this.y,this.x);return e<0&&(e=2*Math.PI+e),e}get length(){return Math.sqrt(this.dot(this))}isZeroLength(){return Ge.Utils.EQ_0(this.length)}equalTo(e){return Ge.Utils.EQ(this.x,e.x)&&Ge.Utils.EQ(this.y,e.y)}multiply(e){return new Ge.Vector(e*this.x,e*this.y)}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}normalize(){if(this.isZeroLength())throw x0.ZERO_DIVISION;return new Ge.Vector(this.x/this.length,this.y/this.length)}rotate(e,t=new Ge.Point){if(t.x===0&&t.y===0)return this.transform(new Dce().rotate(e));throw x0.OPERATION_IS_NOT_SUPPORTED}transform(e){return new Ge.Vector(e.transform([this.x,this.y]))}rotate90CCW(){return new Ge.Vector(-this.y,this.x)}rotate90CW(){return new Ge.Vector(this.y,-this.x)}invert(){return new Ge.Vector(-this.x,-this.y)}add(e){return new Ge.Vector(this.x+e.x,this.y+e.y)}subtract(e){return new Ge.Vector(this.x-e.x,this.y-e.y)}angleTo(e){let t=this.normalize(),n=e.normalize(),o=Math.atan2(t.cross(n),t.dot(n));return o<0&&(o+=2*Math.PI),o}projectionOn(e){let t=e.normalize(),n=this.dot(t);return t.multiply(n)}get name(){return"vector"}};var Win=(...e)=>new Ge.Vector(...e);Ge.vector=Win;Ge.Segment=class e extends sk{constructor(...t){if(super(),this.ps=new Ge.Point,this.pe=new Ge.Point,t.length!==0){if(t.length===1&&t[0]instanceof Array&&t[0].length===4){let n=t[0];return this.ps=new Ge.Point(n[0],n[1]),void(this.pe=new Ge.Point(n[2],n[3]))}if(t.length===1&&t[0]instanceof Object&&t[0].name==="segment"){let{ps:n,pe:o}=t[0];return this.ps=new Ge.Point(n.x,n.y),void(this.pe=new Ge.Point(o.x,o.y))}if(!(t.length===1&&t[0]instanceof Ge.Point)){if(t.length===2&&t[0]instanceof Ge.Point&&t[1]instanceof Ge.Point)return this.ps=t[0].clone(),void(this.pe=t[1].clone());if(t.length===4)return this.ps=new Ge.Point(t[0],t[1]),void(this.pe=new Ge.Point(t[2],t[3]));throw x0.ILLEGAL_PARAMETERS}this.ps=t[0].clone()}}clone(){return new Ge.Segment(this.start,this.end)}get start(){return this.ps}get end(){return this.pe}get vertices(){return[this.ps.clone(),this.pe.clone()]}get length(){return this.start.distanceTo(this.end)[0]}get slope(){return new Ge.Vector(this.start,this.end).slope}get box(){return new Ge.Box(Math.min(this.start.x,this.end.x),Math.min(this.start.y,this.end.y),Math.max(this.start.x,this.end.x),Math.max(this.start.y,this.end.y))}equalTo(t){return this.ps.equalTo(t.ps)&&this.pe.equalTo(t.pe)}contains(t){return Ge.Utils.EQ_0(this.distanceToPoint(t))}intersect(t){return t instanceof Ge.Point?this.contains(t)?[t]:[]:t instanceof Ge.Line?Gle(this,t):t instanceof Ge.Ray?kZe(t,this):t instanceof Ge.Segment?FCe(this,t):t instanceof Ge.Circle?zCe(this,t):t instanceof Ge.Box?function(n,o){let r=[];for(let i of o.toSegments()){let s=FCe(i,n);for(let a of s)r.push(a)}return r}(this,t):t instanceof Ge.Arc?Iq(this,t):t instanceof Ge.Polygon?RZe(this,t):t instanceof Ge.Multiline?Uq(this,t):void 0}distanceTo(t){if(t instanceof Ge.Point){let[n,o]=Ge.Distance.point2segment(t,this);return o=o.reverse(),[n,o]}if(t instanceof Ge.Circle){let[n,o]=Ge.Distance.segment2circle(this,t);return[n,o]}if(t instanceof Ge.Line){let[n,o]=Ge.Distance.segment2line(this,t);return[n,o]}if(t instanceof Ge.Segment){let[n,o]=Ge.Distance.segment2segment(this,t);return[n,o]}if(t instanceof Ge.Arc){let[n,o]=Ge.Distance.segment2arc(this,t);return[n,o]}if(t instanceof Ge.Polygon){let[n,o]=Ge.Distance.shape2polygon(this,t);return[n,o]}if(t instanceof Ge.PlanarSet){let[n,o]=Ge.Distance.shape2planarSet(this,t);return[n,o]}if(t instanceof Ge.Multiline)return Ge.Distance.shape2multiline(this,t)}tangentInStart(){return new Ge.Vector(this.start,this.end).normalize()}tangentInEnd(){return new Ge.Vector(this.end,this.start).normalize()}reverse(){return new e(this.end,this.start)}split(t){return this.start.equalTo(t)?[null,this.clone()]:this.end.equalTo(t)?[this.clone(),null]:[new Ge.Segment(this.start,t),new Ge.Segment(t,this.end)]}middle(){return new Ge.Point((this.start.x+this.end.x)/2,(this.start.y+this.end.y)/2)}pointAtLength(t){if(t>this.length||t<0)return null;if(t==0)return this.start;if(t==this.length)return this.end;let n=t/this.length;return new Ge.Point((this.end.x-this.start.x)*n+this.start.x,(this.end.y-this.start.y)*n+this.start.y)}distanceToPoint(t){let[n,...o]=Ge.Distance.point2segment(t,this);return n}definiteIntegral(t=0){return(this.end.x-this.start.x)*(this.start.y-t+(this.end.y-t))/2}transform(t=new Ge.Matrix){return new e(this.ps.transform(t),this.pe.transform(t))}isZeroLength(){return this.ps.equalTo(this.pe)}sortPoints(t){return new Ge.Line(this.start,this.end).sortPoints(t)}get name(){return"segment"}svg(t={}){return`
<line x1="${this.start.x}" y1="${this.start.y}" x2="${this.end.x}" y2="${this.end.y}" ${dY(t)} />`}};Ge.segment=(...e)=>new Ge.Segment(...e);var{vector:Nae}=Ge;Ge.Line=class e extends sk{constructor(...t){if(super(),this.pt=new Ge.Point,this.norm=new Ge.Vector(0,1),t.length!==0){if(t.length===1&&t[0]instanceof Object&&t[0].name==="line"){let{pt:n,norm:o}=t[0];return this.pt=new Ge.Point(n),void(this.norm=new Ge.Vector(o))}if(t.length===2){let n=t[0],o=t[1];if(n instanceof Ge.Point&&o instanceof Ge.Point)return this.pt=n,this.norm=e.points2norm(n,o),void(this.norm.dot(Nae(this.pt.x,this.pt.y))>=0&&this.norm.invert());if(n instanceof Ge.Point&&o instanceof Ge.Vector){if(Ge.Utils.EQ_0(o.x)&&Ge.Utils.EQ_0(o.y))throw x0.ILLEGAL_PARAMETERS;return this.pt=n.clone(),this.norm=o.clone(),this.norm=this.norm.normalize(),void(this.norm.dot(Nae(this.pt.x,this.pt.y))>=0&&this.norm.invert())}if(n instanceof Ge.Vector&&o instanceof Ge.Point){if(Ge.Utils.EQ_0(n.x)&&Ge.Utils.EQ_0(n.y))throw x0.ILLEGAL_PARAMETERS;return this.pt=o.clone(),this.norm=n.clone(),this.norm=this.norm.normalize(),void(this.norm.dot(Nae(this.pt.x,this.pt.y))>=0&&this.norm.invert())}}throw x0.ILLEGAL_PARAMETERS}}clone(){return new Ge.Line(this.pt,this.norm)}get start(){}get end(){}get length(){return Number.POSITIVE_INFINITY}get box(){return new Ge.Box(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY)}get middle(){}get slope(){return new Ge.Vector(this.norm.y,-this.norm.x).slope}get standard(){return[this.norm.x,this.norm.y,this.norm.dot(Nae(this.pt.x,this.pt.y))]}parallelTo(t){return Ge.Utils.EQ_0(this.norm.cross(t.norm))}incidentTo(t){return this.parallelTo(t)&&this.pt.on(t)}contains(t){if(this.pt.equalTo(t))return!0;let n=new Ge.Vector(this.pt,t);return Ge.Utils.EQ_0(this.norm.dot(n))}coord(t){return Nae(t.x,t.y).cross(this.norm)}intersect(t){return t instanceof Ge.Point?this.contains(t)?[t]:[]:t instanceof Ge.Line?Gq(this,t):t instanceof Ge.Ray?Lin(t,this):t instanceof Ge.Circle?uY(this,t):t instanceof Ge.Box?bq(this,t):t instanceof Ge.Segment?Gle(t,this):t instanceof Ge.Arc?Jbe(this,t):t instanceof Ge.Polygon?Ule(this,t):t instanceof Ge.Multiline?Uq(this,t):void 0}distanceTo(t){if(t instanceof Ge.Point){let[n,o]=Ge.Distance.point2line(t,this);return o=o.reverse(),[n,o]}if(t instanceof Ge.Circle){let[n,o]=Ge.Distance.circle2line(t,this);return o=o.reverse(),[n,o]}if(t instanceof Ge.Segment){let[n,o]=Ge.Distance.segment2line(t,this);return[n,o.reverse()]}if(t instanceof Ge.Arc){let[n,o]=Ge.Distance.arc2line(t,this);return[n,o.reverse()]}if(t instanceof Ge.Polygon){let[n,o]=Ge.Distance.shape2polygon(this,t);return[n,o]}}split(t){if(t instanceof Ge.Point)return[new Ge.Ray(t,this.norm),new Ge.Ray(t,this.norm)];{let n=new Ge.Multiline([this]),o=this.sortPoints(t);return n.split(o),n.toShapes()}}rotate(t,n=new Ge.Point){return new Ge.Line(this.pt.rotate(t,n),this.norm.rotate(t))}transform(t){return new Ge.Line(this.pt.transform(t),this.norm.clone())}sortPoints(t){return t.slice().sort((n,o)=>this.coord(n)<this.coord(o)?-1:this.coord(n)>this.coord(o)?1:0)}get name(){return"line"}svg(t,n={}){let o=bq(this,t);if(o.length===0)return"";let r=o[0],i=o.length===2?o[1]:o.find((s)=>!s.equalTo(r));return i===void 0&&(i=r),new Ge.Segment(r,i).svg(n)}static points2norm(t,n){if(t.equalTo(n))throw x0.ILLEGAL_PARAMETERS;return new Ge.Vector(t,n).normalize().rotate90CCW()}};Ge.line=(...e)=>new Ge.Line(...e);Ge.Circle=class extends sk{constructor(...e){if(super(),this.pc=new Ge.Point,this.r=1,e.length===1&&e[0]instanceof Object&&e[0].name==="circle"){let{pc:t,r:n}=e[0];this.pc=new Ge.Point(t),this.r=n}else{let[t,n]=[...e];t&&t instanceof Ge.Point&&(this.pc=t.clone()),n!==void 0&&(this.r=n)}}clone(){return new Ge.Circle(this.pc.clone(),this.r)}get center(){return this.pc}get box(){return new Ge.Box(this.pc.x-this.r,this.pc.y-this.r,this.pc.x+this.r,this.pc.y+this.r)}contains(e){return e instanceof Ge.Point?Ge.Utils.LE(e.distanceTo(this.center)[0],this.r):e instanceof Ge.Segment?Ge.Utils.LE(e.start.distanceTo(this.center)[0],this.r)&&Ge.Utils.LE(e.end.distanceTo(this.center)[0],this.r):e instanceof Ge.Arc?this.intersect(e).length===0&&Ge.Utils.LE(e.start.distanceTo(this.center)[0],this.r)&&Ge.Utils.LE(e.end.distanceTo(this.center)[0],this.r):e instanceof Ge.Circle?this.intersect(e).length===0&&Ge.Utils.LE(e.r,this.r)&&Ge.Utils.LE(e.center.distanceTo(this.center)[0],this.r):void 0}toArc(e=!0){return new Ge.Arc(this.center,this.r,Math.PI,-Math.PI,e)}scale(e,t){if(e!==t)throw x0.OPERATION_IS_NOT_SUPPORTED;if(this.pc.x!==0||this.pc.y!==0)throw x0.OPERATION_IS_NOT_SUPPORTED;return new Ge.Circle(this.pc,this.r*e)}transform(e=new Ge.Matrix){return new Ge.Circle(this.pc.transform(e),this.r)}intersect(e){return e instanceof Ge.Point?this.contains(e)?[e]:[]:e instanceof Ge.Line?uY(e,this):e instanceof Ge.Ray?kin(e,this):e instanceof Ge.Segment?zCe(e,this):e instanceof Ge.Circle?Min(e,this):e instanceof Ge.Box?function(t,n){let o=[];for(let r of n.toSegments()){let i=zCe(r,t);for(let s of i)o.push(s)}return o}(this,e):e instanceof Ge.Arc?NZe(e,this):e instanceof Ge.Polygon?Nin(this,e):e instanceof Ge.Multiline?Uq(this,e):void 0}distanceTo(e){if(e instanceof Ge.Point){let[t,n]=Ge.Distance.point2circle(e,this);return n=n.reverse(),[t,n]}if(e instanceof Ge.Circle){let[t,n]=Ge.Distance.circle2circle(this,e);return[t,n]}if(e instanceof Ge.Line){let[t,n]=Ge.Distance.circle2line(this,e);return[t,n]}if(e instanceof Ge.Segment){let[t,n]=Ge.Distance.segment2circle(e,this);return n=n.reverse(),[t,n]}if(e instanceof Ge.Arc){let[t,n]=Ge.Distance.arc2circle(e,this);return n=n.reverse(),[t,n]}if(e instanceof Ge.Polygon){let[t,n]=Ge.Distance.shape2polygon(this,e);return[t,n]}if(e instanceof Ge.PlanarSet){let[t,n]=Ge.Distance.shape2planarSet(this,e);return[t,n]}if(e instanceof Ge.Multiline){let[t,n]=Ge.Distance.shape2multiline(this,e);return[t,n]}}get name(){return"circle"}svg(e={}){return`
<circle cx="${this.pc.x}" cy="${this.pc.y}" r="${this.r}"
                ${dY({fill:"none",...e})} />`}};Ge.circle=(...e)=>new Ge.Circle(...e);Ge.Arc=class extends sk{constructor(...e){if(super(),this.pc=new Ge.Point,this.r=1,this.startAngle=0,this.endAngle=2*Math.PI,this.counterClockwise=!0,e.length!==0)if(e.length===1&&e[0]instanceof Object&&e[0].name==="arc"){let{pc:t,r:n,startAngle:o,endAngle:r,counterClockwise:i}=e[0];this.pc=new Ge.Point(t.x,t.y),this.r=n,this.startAngle=o,this.endAngle=r,this.counterClockwise=i}else{let[t,n,o,r,i]=[...e];t&&t instanceof Ge.Point&&(this.pc=t.clone()),n!==void 0&&(this.r=n),o!==void 0&&(this.startAngle=o),r!==void 0&&(this.endAngle=r),i!==void 0&&(this.counterClockwise=i)}}clone(){return new Ge.Arc(this.pc.clone(),this.r,this.startAngle,this.endAngle,this.counterClockwise)}get sweep(){let e=this.startAngle,t=this.endAngle;if(Ge.Utils.EQ(Math.abs(e-t),Ge.PIx2))return Ge.PIx2;Math.abs(e)>Ge.PIx2&&(e-=Math.trunc(e/Ge.PIx2)*Ge.PIx2),e<0&&(e+=Ge.PIx2),Math.abs(t)>Ge.PIx2&&(t-=Math.trunc(t/Ge.PIx2)*Ge.PIx2),t<0&&(t+=Ge.PIx2);let n=this.counterClockwise?t-e:e-t;return n<0&&(n+=Ge.PIx2),n}get start(){return new Ge.Point(this.pc.x+this.r,this.pc.y).rotate(this.startAngle,this.pc)}get end(){return new Ge.Point(this.pc.x+this.r,this.pc.y).rotate(this.endAngle,this.pc)}get center(){return this.pc.clone()}get vertices(){return[this.start.clone(),this.end.clone()]}get length(){return Math.abs(this.sweep*this.r)}get box(){let e=this.breakToFunctional().reduce((t,n)=>t.merge(n.start.box),new Ge.Box);return e=e.merge(this.end.box),e}contains(e){if(!Ge.Utils.EQ(this.pc.distanceTo(e)[0],this.r))return!1;if(e.equalTo(this.start))return!0;let t=new Ge.Vector(this.pc,e).slope,n=new Ge.Arc(this.pc,this.r,this.startAngle,t,this.counterClockwise);return Ge.Utils.LE(n.length,this.length)}split(e){if(this.start.equalTo(e))return[null,this.clone()];if(this.end.equalTo(e))return[this.clone(),null];let t=new Ge.Vector(this.pc,e).slope;return[new Ge.Arc(this.pc,this.r,this.startAngle,t,this.counterClockwise),new Ge.Arc(this.pc,this.r,t,this.endAngle,this.counterClockwise)]}middle(){let e=this.counterClockwise?this.startAngle+this.sweep/2:this.startAngle-this.sweep/2;return new Ge.Arc(this.pc,this.r,this.startAngle,e,this.counterClockwise).end}pointAtLength(e){if(e>this.length||e<0)return null;if(e===0)return this.start;if(e===this.length)return this.end;let t=e/this.length,n=this.counterClockwise?this.startAngle+this.sweep*t:this.startAngle-this.sweep*t;return new Ge.Arc(this.pc,this.r,this.startAngle,n,this.counterClockwise).end}chordHeight(){return(1-Math.cos(Math.abs(this.sweep/2)))*this.r}intersect(e){return e instanceof Ge.Point?this.contains(e)?[e]:[]:e instanceof Ge.Line?Jbe(e,this):e instanceof Ge.Ray?LZe(e,this):e instanceof Ge.Circle?NZe(this,e):e instanceof Ge.Segment?Iq(e,this):e instanceof Ge.Box?function(t,n){let o=[];for(let r of n.toSegments()){let i=Iq(r,t);for(let s of i)o.push(s)}return o}(this,e):e instanceof Ge.Arc?win(this,e):e instanceof Ge.Polygon?QZe(this,e):e instanceof Ge.Multiline?Uq(this,e):void 0}distanceTo(e){if(e instanceof Ge.Point){let[t,n]=Ge.Distance.point2arc(e,this);return n=n.reverse(),[t,n]}if(e instanceof Ge.Circle){let[t,n]=Ge.Distance.arc2circle(this,e);return[t,n]}if(e instanceof Ge.Line){let[t,n]=Ge.Distance.arc2line(this,e);return[t,n]}if(e instanceof Ge.Segment){let[t,n]=Ge.Distance.segment2arc(e,this);return n=n.reverse(),[t,n]}if(e instanceof Ge.Arc){let[t,n]=Ge.Distance.arc2arc(this,e);return[t,n]}if(e instanceof Ge.Polygon){let[t,n]=Ge.Distance.shape2polygon(this,e);return[t,n]}if(e instanceof Ge.PlanarSet){let[t,n]=Ge.Distance.shape2planarSet(this,e);return[t,n]}if(e instanceof Ge.Multiline)return Ge.Distance.shape2multiline(this,e)}breakToFunctional(){let e=[],t=[0,Math.PI/2,Math.PI,3*Math.PI/2],n=this.startAngle,o=this.endAngle;Ge.Utils.EQ(Math.abs(n-o),Ge.PIx2)&&(o=n),Math.abs(n)>Ge.PIx2&&(n-=Math.trunc(n/Ge.PIx2)*Ge.PIx2),n<0&&(n+=Ge.PIx2),Math.abs(o)>Ge.PIx2&&(o-=Math.trunc(o/Ge.PIx2)*Ge.PIx2),o<0&&(o+=Ge.PIx2);let r,i,s,a=n;this.counterClockwise?(i=Math.ceil(n/(Math.PI/2))%4,s=1):(i=Math.floor(n/(Math.PI/2))%4,s=-1);for(let c=0,l=i;c<4;c++,l=(l+s+4)%4){if(r=t[l],r===a)continue;let h=this.counterClockwise?r-n:n-r;if(h<0&&(h+=Ge.PIx2),h>this.sweep)break;e.push(new Ge.Arc(this.pc,this.r,a,r,this.counterClockwise)),a=r}return e.length===0?(e.push(this),e):(r=o,a!==r&&e.push(new Ge.Arc(this.pc,this.r,a,r,this.counterClockwise)),e)}tangentInStart(){let e=new Ge.Vector(this.pc,this.start),t=this.counterClockwise?Math.PI/2:-Math.PI/2;return e.rotate(t).normalize()}tangentInEnd(){let e=new Ge.Vector(this.pc,this.end),t=this.counterClockwise?-Math.PI/2:Math.PI/2;return e.rotate(t).normalize()}reverse(){return new Ge.Arc(this.pc,this.r,this.endAngle,this.startAngle,!this.counterClockwise)}transform(e=new Ge.Matrix){let t=this.start.transform(e),n=this.end.transform(e),o=this.pc.transform(e),r=this.counterClockwise;return e.a*e.d<0&&(r=!r),Ge.Arc.arcSE(o,t,n,r)}static arcSE(e,t,n,o){let{vector:r}=Ge,i=r(e,t).slope,s=r(e,n).slope;Ge.Utils.EQ(i,s)&&(s+=2*Math.PI,o=!0);let a=r(e,t).length;return new Ge.Arc(e,a,i,s,o)}definiteIntegral(e=0){return this.breakToFunctional().reduce((t,n)=>t+n.circularSegmentDefiniteIntegral(e),0)}circularSegmentDefiniteIntegral(e){let t=new Ge.Segment(this.start,this.end).definiteIntegral(e),n=Ge.Utils.EQ(this.sweep,Ge.PIx2)?0:this.circularSegmentArea();return this.counterClockwise?t-n:t+n}circularSegmentArea(){return 0.5*this.r*this.r*(this.sweep-Math.sin(this.sweep))}sortPoints(e){let{vector:t}=Ge;return e.slice().sort((n,o)=>{let r=t(this.pc,n).slope,i=t(this.pc,o).slope;return r<i?-1:r>i?1:0})}get name(){return"arc"}svg(e={}){let t=this.sweep<=Math.PI?"0":"1",n=this.counterClockwise?"1":"0";if(Ge.Utils.EQ(this.sweep,2*Math.PI))return new Ge.Circle(this.pc,this.r).svg(e);return`
<path d="M${this.start.x},${this.start.y}
                             A${this.r},${this.r} 0 ${t},${n} ${this.end.x},${this.end.y}"
                    ${dY({fill:"none",...e})} />`}};Ge.arc=(...e)=>new Ge.Arc(...e);Ge.Box=class e extends sk{constructor(t=void 0,n=void 0,o=void 0,r=void 0){super(),this.xmin=t,this.ymin=n,this.xmax=o,this.ymax=r}clone(){return new e(this.xmin,this.ymin,this.xmax,this.ymax)}get low(){return new Ge.Point(this.xmin,this.ymin)}get high(){return new Ge.Point(this.xmax,this.ymax)}get max(){return this.clone()}get center(){return new Ge.Point((this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)}get width(){return Math.abs(this.xmax-this.xmin)}get height(){return Math.abs(this.ymax-this.ymin)}get box(){return this.clone()}not_intersect(t){return this.xmax<t.xmin||this.xmin>t.xmax||this.ymax<t.ymin||this.ymin>t.ymax}intersect(t){return!this.not_intersect(t)}merge(t){return new e(this.xmin===void 0?t.xmin:Math.min(this.xmin,t.xmin),this.ymin===void 0?t.ymin:Math.min(this.ymin,t.ymin),this.xmax===void 0?t.xmax:Math.max(this.xmax,t.xmax),this.ymax===void 0?t.ymax:Math.max(this.ymax,t.ymax))}less_than(t){return!!this.low.lessThan(t.low)||!(!this.low.equalTo(t.low)||!this.high.lessThan(t.high))}equal_to(t){return this.low.equalTo(t.low)&&this.high.equalTo(t.high)}output(){return this.clone()}comparable_less_than(t,n){return t.lessThan(n)}set(t,n,o,r){this.xmin=t,this.ymin=n,this.xmax=o,this.ymax=r}extend(t){return t<=0?this.clone():new e(this.xmin-t,this.ymin-t,this.xmax+t,this.ymax+t)}toPoints(){return[new Ge.Point(this.xmin,this.ymin),new Ge.Point(this.xmax,this.ymin),new Ge.Point(this.xmax,this.ymax),new Ge.Point(this.xmin,this.ymax)]}toSegments(){let t=this.toPoints();return[new Ge.Segment(t[0],t[1]),new Ge.Segment(t[1],t[2]),new Ge.Segment(t[2],t[3]),new Ge.Segment(t[3],t[0])]}rotate(t,n=new Ge.Point){throw x0.OPERATION_IS_NOT_SUPPORTED}transform(t=new Ge.Matrix){return this.toPoints().map((n)=>n.transform(t)).reduce((n,o)=>n.merge(o.box),new e)}contains(t){return t instanceof Ge.Point?t.x>=this.xmin&&t.x<=this.xmax&&t.y>=this.ymin&&t.y<=this.ymax:t instanceof Ge.Segment?t.vertices.every((n)=>this.contains(n)):t instanceof Ge.Box?t.toSegments().every((n)=>this.contains(n)):t instanceof Ge.Circle?this.contains(t.box):t instanceof Ge.Arc?t.vertices.every((n)=>this.contains(n))&&this.toSegments().every((n)=>Iq(n,t).length===0):!(t instanceof Ge.Line||t instanceof Ge.Ray)&&(t instanceof Ge.Multiline?t.toShapes().every((n)=>this.contains(n)):t instanceof Ge.Polygon?this.contains(t.box):void 0)}distanceTo(t){let n=this.toSegments().map((r)=>r.distanceTo(t)),o=[Number.MAX_SAFE_INTEGER,null];return n.forEach((r)=>{r[0]<o[0]&&(o=r)}),o}get name(){return"box"}svg(t={}){let n=this.xmax-this.xmin,o=this.ymax-this.ymin;return`
<rect x="${this.xmin}" y="${this.ymin}" width="${n}" height="${o}"
                ${dY({fill:"none",...t})} />`}};Ge.box=(...e)=>new Ge.Box(...e);Ge.Edge=class{constructor(e){this.shape=e,this.next=void 0,this.prev=void 0,this.face=void 0,this.arc_length=0,this.bvStart=void 0,this.bvEnd=void 0,this.bv=void 0,this.overlap=void 0}get start(){return this.shape.start}get end(){return this.shape.end}get length(){return this.shape.length}get box(){return this.shape.box}get isSegment(){return this.shape instanceof Ge.Segment}get isArc(){return this.shape instanceof Ge.Arc}get isLine(){return this.shape instanceof Ge.Line}get isRay(){return this.shape instanceof Ge.Ray}middle(){return this.shape.middle()}pointAtLength(e){return this.shape.pointAtLength(e)}contains(e){return this.shape.contains(e)}setInclusion(e){if(this.bv!==void 0)return this.bv;if(this.shape instanceof Ge.Line||this.shape instanceof Ge.Ray)return this.bv=Ge.OUTSIDE,this.bv;if(this.bvStart===void 0&&(this.bvStart=Tce(e,this.start)),this.bvEnd===void 0&&(this.bvEnd=Tce(e,this.end)),this.bvStart===Ge.OUTSIDE||this.bvEnd==Ge.OUTSIDE)this.bv=Ge.OUTSIDE;else if(this.bvStart===Ge.INSIDE||this.bvEnd==Ge.INSIDE)this.bv=Ge.INSIDE;else{let t=Tce(e,this.middle());this.bv=t}return this.bv}setOverlap(e){let t,n=this.shape,o=e.shape;n instanceof Ge.Segment&&o instanceof Ge.Segment?n.start.equalTo(o.start)&&n.end.equalTo(o.end)?t=Ge.OVERLAP_SAME:n.start.equalTo(o.end)&&n.end.equalTo(o.start)&&(t=Ge.OVERLAP_OPPOSITE):(n instanceof Ge.Arc&&o instanceof Ge.Arc||n instanceof Ge.Segment&&o instanceof Ge.Arc||n instanceof Ge.Arc&&o instanceof Ge.Segment)&&(n.start.equalTo(o.start)&&n.end.equalTo(o.end)&&n.middle().equalTo(o.middle())?t=Ge.OVERLAP_SAME:n.start.equalTo(o.end)&&n.end.equalTo(o.start)&&n.middle().equalTo(o.middle())&&(t=Ge.OVERLAP_OPPOSITE)),this.overlap===void 0&&(this.overlap=t),e.overlap===void 0&&(e.overlap=t)}svg(){if(this.shape instanceof Ge.Segment)return` L${this.shape.end.x},${this.shape.end.y}`;if(this.shape instanceof Ge.Arc){let e,t=this.shape,n=t.counterClockwise?"1":"0";if(Ge.Utils.EQ(t.sweep,2*Math.PI)){let o=t.counterClockwise?1:-1,r=new Ge.Arc(t.pc,t.r,t.startAngle,t.startAngle+o*Math.PI,t.counterClockwise),i=new Ge.Arc(t.pc,t.r,t.startAngle+o*Math.PI,t.endAngle,t.counterClockwise);return e="0",` A${r.r},${r.r} 0 ${e},${n} ${r.end.x},${r.end.y}
                    A${i.r},${i.r} 0 ${e},${n} ${i.end.x},${i.end.y}`}return e=t.sweep<=Math.PI?"0":"1",` A${t.r},${t.r} 0 ${e},${n} ${t.end.x},${t.end.y}`}}toJSON(){return this.shape.toJSON()}};var Jxr=class extends DZe{constructor(e,t){super(e,t),this.setCircularLinks()}setCircularLinks(){this.isEmpty()||(this.last.next=this.first,this.first.prev=this.last)}[Symbol.iterator](){let e;return{next:()=>{let t=e||this.first,n=!this.first||!!e&&e===this.first;return e=t?t.next:void 0,{value:t,done:n}}}}append(e){return super.append(e),this.setCircularLinks(),this}insert(e,t){return super.insert(e,t),this.setCircularLinks(),this}remove(e){return super.remove(e),this}};Ge.Face=class e extends Jxr{constructor(t,...n){if(super(),this._box=void 0,this._orientation=void 0,n.length!==0){if(n.length===1){if(n[0]instanceof Array){let o=n[0];if(o.length===0)return;if(o.every((r)=>r instanceof Ge.Point)){let r=e.points2segments(o);this.shapes2face(t.edges,r)}else if(o.every((r)=>r instanceof Array&&r.length===2)){let r=o.map((s)=>new Ge.Point(s[0],s[1])),i=e.points2segments(r);this.shapes2face(t.edges,i)}else if(o.every((r)=>r instanceof Ge.Segment||r instanceof Ge.Arc))this.shapes2face(t.edges,o);else if(o.every((r)=>r.name==="segment"||r.name==="arc")){let r=[];for(let i of o){let s;s=i.name==="segment"?new Ge.Segment(i):new Ge.Arc(i),r.push(s)}this.shapes2face(t.edges,r)}}else if(n[0]instanceof e){let o=n[0];this.first=o.first,this.last=o.last;for(let r of o)t.edges.add(r)}else if(n[0]instanceof Ge.Circle)this.shapes2face(t.edges,[n[0].toArc(Iin)]);else if(n[0]instanceof Ge.Box){let o=n[0];this.shapes2face(t.edges,[new Ge.Segment(new Ge.Point(o.xmin,o.ymin),new Ge.Point(o.xmax,o.ymin)),new Ge.Segment(new Ge.Point(o.xmax,o.ymin),new Ge.Point(o.xmax,o.ymax)),new Ge.Segment(new Ge.Point(o.xmax,o.ymax),new Ge.Point(o.xmin,o.ymax)),new Ge.Segment(new Ge.Point(o.xmin,o.ymax),new Ge.Point(o.xmin,o.ymin))])}}n.length===2&&n[0]instanceof Ge.Edge&&n[1]instanceof Ge.Edge&&(this.first=n[0],this.last=n[1],this.last.next=this.first,this.first.prev=this.last,this.setArcLength())}}get edges(){return this.toArray()}get vertices(){return this.edges.map((t)=>t.shape.start.clone())}get shapes(){return this.edges.map((t)=>t.shape.clone())}get box(){if(this._box===void 0){let t=new Ge.Box;for(let n of this)t=t.merge(n.box);this._box=t}return this._box}get perimeter(){return this.last.arc_length+this.last.length}pointAtLength(t){if(t>this.perimeter||t<0)return null;let n=null;for(let o of this)if(t>=o.arc_length&&(o===this.last||t<o.next.arc_length)){n=o.pointAtLength(t-o.arc_length);break}return n}static points2segments(t){let n=[];for(let o=0;o<t.length;o++)t[o].equalTo(t[(o+1)%t.length])||n.push(new Ge.Segment(t[o],t[(o+1)%t.length]));return n}shapes2face(t,n){for(let o of n){let r=new Ge.Edge(o);this.append(r),t.add(r)}}append(t){return super.append(t),this.setOneEdgeArcLength(t),t.face=this,this}insert(t,n){return super.insert(t,n),this.setOneEdgeArcLength(t),t.face=this,this}remove(t){return super.remove(t),this.setArcLength(),this}merge_with_next_edge(t){return t.shape.end.x=t.next.shape.end.x,t.shape.end.y=t.next.shape.end.y,this.remove(t.next),this}reverse(){let t=[],n=this.last;do n.shape=n.shape.reverse(),t.push(n),n=n.prev;while(n!==this.last);this.first=void 0,this.last=void 0;for(let o of t)this.first===void 0?(o.prev=o,o.next=o,this.first=o,this.last=o):(o.prev=this.last,this.last.next=o,this.last=o,this.last.next=this.first,this.first.prev=this.last),this.setOneEdgeArcLength(o);this._orientation!==void 0&&(this._orientation=void 0,this._orientation=this.orientation())}setArcLength(){for(let t of this)this.setOneEdgeArcLength(t),t.face=this}setOneEdgeArcLength(t){t===this.first?t.arc_length=0:t.arc_length=t.prev.arc_length+t.prev.length}area(){return Math.abs(this.signedArea())}signedArea(){let t=0,n=this.box.ymin;for(let o of this)t+=o.shape.definiteIntegral(n);return t}orientation(){if(this._orientation===void 0){let t=this.signedArea();Ge.Utils.EQ_0(t)?this._orientation=Bce.NOT_ORIENTABLE:Ge.Utils.LT(t,0)?this._orientation=Bce.CCW:this._orientation=Bce.CW}return this._orientation}isSimple(t){return e.getSelfIntersections(this,t,!0).length===0}static getSelfIntersections(t,n,o=!1){let r=[];for(let i of t){let s=n.search(i.box);for(let a of s){if(i===a)continue;if(a.face!==t)continue;if(i.shape instanceof Ge.Segment&&a.shape instanceof Ge.Segment&&(i.next===a||i.prev===a))continue;let c=i.shape.intersect(a.shape);for(let l of c)if((!l.equalTo(i.start)||!l.equalTo(a.end)||a!==i.prev)&&(!l.equalTo(i.end)||!l.equalTo(a.start)||a!==i.next)&&(r.push(l),o))break;if(r.length>0&&o)break}if(r.length>0&&o)break}return r}findEdgeByPoint(t){let n;for(let o of this)if(!t.equalTo(o.shape.start)&&(t.equalTo(o.shape.end)||o.shape.contains(t))){n=o;break}return n}toPolygon(){return new Ge.Polygon(this.shapes)}toJSON(){return this.edges.map((t)=>t.toJSON())}svg(){let t=`M${this.first.start.x},${this.first.start.y}`;for(let n of this)t+=n.svg();return t+=" z",t}};Ge.Ray=class e extends sk{constructor(...t){if(super(),this.pt=new Ge.Point,this.norm=new Ge.Vector(0,1),t.length!==0&&(t.length>=1&&t[0]instanceof Ge.Point&&(this.pt=t[0].clone()),t.length!==1)){if(!(t.length===2&&t[1]instanceof Ge.Vector))throw x0.ILLEGAL_PARAMETERS;this.norm=t[1].clone()}}clone(){return new e(this.pt,this.norm)}get slope(){return new Ge.Vector(this.norm.y,-this.norm.x).slope}get box(){let t=this.slope;return new Ge.Box(t>Math.PI/2&&t<3*Math.PI/2?Number.NEGATIVE_INFINITY:this.pt.x,t>=0&&t<=Math.PI?this.pt.y:Number.NEGATIVE_INFINITY,t>=Math.PI/2&&t<=3*Math.PI/2?this.pt.x:Number.POSITIVE_INFINITY,t>=Math.PI&&t<=2*Math.PI||t===0?this.pt.y:Number.POSITIVE_INFINITY)}get start(){return this.pt}get end(){}get length(){return Number.POSITIVE_INFINITY}contains(t){if(this.pt.equalTo(t))return!0;let n=new Ge.Vector(this.pt,t);return Ge.Utils.EQ_0(this.norm.dot(n))&&Ge.Utils.GE(n.cross(this.norm),0)}coord(t){return Win(t.x,t.y).cross(this.norm)}split(t){return this.contains(t)?this.pt.equalTo(t)?[this]:[new Ge.Segment(this.pt,t),new Ge.Ray(t,this.norm)]:[]}intersect(t){return t instanceof Ge.Point?this.contains(t)?[t]:[]:t instanceof Ge.Segment?kZe(this,t):t instanceof Ge.Arc?LZe(this,t):t instanceof Ge.Line?Lin(this,t):t instanceof Ge.Ray?(o=t,Gq(VQ(n=this),VQ(o)).filter((r)=>n.contains(r)).filter((r)=>o.contains(r))):t instanceof Ge.Circle?kin(this,t):t instanceof Ge.Box?function(r,i){return bq(VQ(r),i).filter((s)=>r.contains(s))}(this,t):t instanceof Ge.Polygon?Hin(this,t):t instanceof Ge.Multiline?Uq(this,t):void 0;var n,o}rotate(t,n=new Ge.Point){return new Ge.Ray(this.pt.rotate(t,n),this.norm.rotate(t))}transform(t){return new Ge.Ray(this.pt.transform(t),this.norm.clone())}get name(){return"ray"}svg(t,n={}){let o=bq(new Ge.Line(this.pt,this.norm),t);return o=o.filter((r)=>this.contains(r)),o.length===0||o.length===2?"":new Ge.Segment(this.pt,o[0]).svg(n)}};Ge.ray=(...e)=>new Ge.Ray(...e);Ge.Polygon=class e{constructor(){this.faces=new Ge.PlanarSet,this.edges=new Ge.PlanarSet;let t=[...arguments];if(t.length===1&&(t[0]instanceof Array&&t[0].length>0||t[0]instanceof Ge.Circle||t[0]instanceof Ge.Box)){let n=t[0];if(t[0]instanceof Array&&t[0].every((o)=>o instanceof Array))if(n.every((o)=>o instanceof Array&&o.length===2&&typeof o[0]=="number"&&typeof o[1]=="number"))this.faces.add(new Ge.Face(this,n));else for(let o of n)if(o instanceof Array&&o[0]instanceof Array&&o[0].every((r)=>r instanceof Array&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"))for(let r of o)this.faces.add(new Ge.Face(this,r));else this.faces.add(new Ge.Face(this,o));else this.faces.add(new Ge.Face(this,n))}}get box(){return[...this.faces].reduce((t,n)=>t.merge(n.box),new Ge.Box)}get vertices(){return[...this.faces].flatMap((t)=>t.vertices)}clone(){let t=new e;for(let n of this.faces)t.addFace(n.shapes);return t}createFromArray(t){let n=new e;return t.forEach((o)=>[...o.faces].forEach((r)=>n.addFace(r.shapes))),n}isEmpty(){return this.edges.size===0||this.faces.size===0}isValid(){let t=!0;for(let n of this.faces)if(!n.isSimple(this.edges)){t=!1;break}return t}area(){let t=[...this.faces].reduce((n,o)=>n+o.signedArea(),0);return Math.abs(t)}addFace(...t){let n=new Ge.Face(this,...t);return this.faces.add(n),n}deleteFace(t){for(let n of t)this.edges.delete(n);return this.faces.delete(t)}recreateFaces(){this.faces.clear();for(let o of this.edges)o.face=null;let t,n=!0;for(;n;){n=!1;for(let o of this.edges)if(o.face===null){t=o,n=!0;break}if(n){let o=t;do o=o.next;while(o.next!==t);this.addFace(t,o)}}}removeChain(t,n,o){if(o.next!==n){for(let r=n;r!==o.next;r=r.next)if(t.remove(r),this.edges.delete(r),t.isEmpty()){this.deleteFace(t);break}}else this.deleteFace(t)}addVertex(t,n){let o=n.shape.split(t);if(o[0]===null)return n.prev;if(o[1]===null)return n;let r=new Ge.Edge(o[0]),i=n.prev;return n.face.insert(r,i),this.edges.delete(n),this.edges.add(r),n.shape=o[1],this.edges.add(n),r}removeEndVertex(t){let n=t.next;n!==t&&(t.face.merge_with_next_edge(t),this.edges.delete(n))}cut(t){let n=this.splitToIslands().flatMap((o)=>o._cutSingleIsland(t)).filter((o)=>o.isValid()&&o.isEmpty()===!1);return this.createFromArray(n)}_cutSingleIsland(t){let n=this.clone(),o=t.clone(),r,i,s={int_points1:[],int_points2:[],int_points1_sorted:[],int_points2_sorted:[]};for(let a of o.edges)for(let c of n.edges){let l=Rin(a,c);for(let h of l)vq(a,h,s.int_points1),vq(c,h,s.int_points2)}if(s.int_points1.length===0)return n;s.int_points1_sorted=SQ(s.int_points1),s.int_points2_sorted=SQ(s.int_points2),Pq(o,s.int_points1_sorted),Pq(n,s.int_points2_sorted),HZe(s),s.int_points1_sorted=SQ(s.int_points1),s.int_points2_sorted=SQ(s.int_points2),t$e(s.int_points1),n$e(s.int_points1,n);for(let a of s.int_points1_sorted)a.edge_before&&a.edge_after&&a.edge_before.bv===a.edge_after.bv&&(s.int_points2[a.id]=-1,a.id=-1);if(s.int_points1=s.int_points1.filter((a)=>a.id>=0),s.int_points2=s.int_points2.filter((a)=>a.id>=0),s.int_points1.forEach((a,c)=>{a.id=c}),s.int_points2.forEach((a,c)=>{a.id=c}),s.int_points1.length===0)return n;s.int_points1_sorted=SQ(s.int_points1),s.int_points2_sorted=SQ(s.int_points2);for(let a=1;a<s.int_points1_sorted.length;a++)if(i=s.int_points1_sorted[a],r=s.int_points1_sorted[a-1],i.edge_before&&i.edge_before.bv===1){let c=r.edge_after,l=i.edge_before,h=o.getChain(c,l);hOt(s.int_points2[r.id],s.int_points2[i.id],h),h.forEach((d)=>n.edges.add(d)),h=h.reverse().map((d)=>new Ge.Edge(d.shape.reverse()));for(let d=0;d<h.length-1;d++)h[d].next=h[d+1],h[d+1].prev=h[d];hOt(s.int_points2[i.id],s.int_points2[r.id],h),h.forEach((d)=>n.edges.add(d))}return n.recreateFaces(),n}cutWithLine(t){let n=new EV([t]);return this.cut(n)}findEdgeByPoint(t){let n;for(let o of this.faces)if(n=o.findEdgeByPoint(t),n!==void 0)break;return n}splitToIslands(){if(this.isEmpty())return[];let t=this.toArray();t.sort((r,i)=>i.area()-r.area());let n=[...t[0].faces][0].orientation(),o=t.filter((r)=>[...r.faces][0].orientation()===n);for(let r of t){let i=[...r.faces][0];if(i.orientation()!==n){for(let s of o)if(i.shapes.every((a)=>s.contains(a))){s.addFace(i.shapes);break}}}return o}rearrange(){if(this.faces.size<=1)return this.clone();let t=this.splitToIslands(),n=new e;return t.forEach((o)=>{o.faces.forEach((r)=>n.addFace(r.shapes))}),n}orientation(){return this.isEmpty()?Bce.NOT_ORIENTABLE:[...this.faces][0].orientation()}isOuter(t){return t.orientation()===this.orientation()}isMultiPolygon(){let t=0;return this.faces.forEach((n)=>{this.isOuter(n)&&t++}),t>1}reverse(){for(let t of this.faces)t.reverse();return this}contains(t){if(t instanceof Ge.Point){let n=Tce(this,t);return n===1||n===2}return Uin(this,t)}distanceTo(t){if(t instanceof Ge.Point){let[n,o]=Ge.Distance.point2polygon(t,this);return o=o.reverse(),[n,o]}if(t instanceof Ge.Circle||t instanceof Ge.Line||t instanceof Ge.Segment||t instanceof Ge.Arc){let[n,o]=Ge.Distance.shape2polygon(t,this);return o=o.reverse(),[n,o]}if(t instanceof Ge.Polygon){let n,o,r=[Number.POSITIVE_INFINITY,new Ge.Segment];for(let i of this.edges){let s=r[0];[n,o]=Ge.Distance.shape2planarSet(i.shape,t.edges,s),Ge.Utils.LT(n,s)&&(r=[n,o])}return r}}intersect(t){return t instanceof Ge.Point?this.contains(t)?[t]:[]:t instanceof Ge.Line?Ule(t,this):t instanceof Ge.Ray?Hin(t,this):t instanceof Ge.Circle?Nin(t,this):t instanceof Ge.Segment?RZe(t,this):t instanceof Ge.Arc?QZe(t,this):t instanceof Ge.Polygon?function(n,o){let r=[];if(n.isEmpty()||o.isEmpty())return r;if(n.box.not_intersect(o.box))return r;for(let i of n.edges)r=[...r,...lOt(i,o)];return r}(t,this):t instanceof Ge.Multiline?function(n,o){let r=[];if(o.isEmpty()||n.size===0)return r;for(let i of n)r=[...r,...lOt(i,o)];return r}(t,this):void 0}translate(t){let n=new e;for(let o of this.faces)n.addFace(o.shapes.map((r)=>r.translate(t)));return n}rotate(t=0,n=new Ge.Point){let o=new e;for(let r of this.faces)o.addFace(r.shapes.map((i)=>i.rotate(t,n)));return o}scale(t,n){let o=new e;for(let r of this.faces)o.addFace(r.shapes.map((i)=>i.scale(t,n)));return o}transform(t=new Ge.Matrix){let n=new e;for(let o of this.faces)n.addFace(o.shapes.map((r)=>r.transform(t)));return n}toJSON(){return[...this.faces].map((t)=>t.toJSON())}toArray(){return[...this.faces].map((t)=>t.toPolygon())}dpath(){return[...this.faces].reduce((t,n)=>t+n.svg(),"")}svg(t={}){let n=`
<path ${dY({fillRule:"evenodd",fill:"lightcyan",...t})} d="`;for(let o of this.faces)n+=`
${o.svg()}`;return n+=`" >
</path>`,n}};Ge.polygon=(...e)=>new Ge.Polygon(...e);var{Circle:kXe,Line:yOt,Point:xOt,Vector:c3e,Utils:LXe}=Ge;Ge.Inversion=class e{constructor(t){this.circle=t}get inversion_circle(){return this.circle}static inversePoint(t,n){let o=new c3e(t.pc,n),r=t.r*t.r,i=o.dot(o);return LXe.EQ_0(i)?new xOt(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY):t.pc.translate(o.multiply(r/i))}static inverseCircle(t,n){let o=t.pc.distanceTo(n.pc)[0];if(LXe.EQ(o,n.r)){let r=t.r*t.r/(2*n.r),i=new c3e(t.pc,n.pc);i=i.normalize();let s=t.pc.translate(i.multiply(r));return new yOt(s,i)}{let r=new c3e(t.pc,n.pc),i=t.r*t.r/(r.dot(r)-n.r*n.r),s=t.pc.translate(r.multiply(i)),a=Math.abs(i)*n.r;return new kXe(s,a)}}static inverseLine(t,n){let[o,r]=t.pc.distanceTo(n);if(LXe.EQ_0(o))return n.clone();{let i=t.r*t.r/(2*o),s=new c3e(t.pc,r.end);return s=s.multiply(i/o),new kXe(t.pc.translate(s),i)}}inverse(t){return t instanceof xOt?e.inversePoint(this.circle,t):t instanceof kXe?e.inverseCircle(this.circle,t):t instanceof yOt?e.inverseLine(this.circle,t):void 0}};Ge.inversion=(e)=>new Ge.Inversion(e);Ge.Distance=class e{static point2point(t,n){return t.distanceTo(n)}static point2line(t,n){let o=t.projectionOn(n);return[new Ge.Vector(t,o).length,new Ge.Segment(t,o)]}static point2circle(t,n){let[o,r]=t.distanceTo(n.center);if(Ge.Utils.EQ_0(o))return[n.r,new Ge.Segment(t,n.toArc().start)];{let i=Math.abs(o-n.r),s=new Ge.Vector(n.pc,t).normalize().multiply(n.r),a=n.pc.translate(s);return[i,new Ge.Segment(t,a)]}}static point2segment(t,n){if(n.start.equalTo(n.end))return e.point2point(t,n.start);let o,r,i=new Ge.Vector(n.start,n.end),s=new Ge.Vector(n.start,t),a=new Ge.Vector(n.end,t),c=i.dot(s),l=-i.dot(a);if(Ge.Utils.GE(c,0)&&Ge.Utils.GE(l,0)){let h=n.tangentInStart();return o=Math.abs(h.cross(s)),r=n.start.translate(h.multiply(h.dot(s))),[o,new Ge.Segment(t,r)]}return c<0?t.distanceTo(n.start):t.distanceTo(n.end)}static point2arc(t,n){let o,r,i=new Ge.Circle(n.pc,n.r),s=[];return[o,r]=e.point2circle(t,i),r.end.on(n)&&s.push(e.point2circle(t,i)),s.push(e.point2point(t,n.start)),s.push(e.point2point(t,n.end)),e.sort(s),s[0]}static point2edge(t,n){return n.shape instanceof Ge.Segment?e.point2segment(t,n.shape):e.point2arc(t,n.shape)}static segment2line(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Ge.Segment(o[0],o[0])];let r=[];return r.push(e.point2line(t.start,n)),r.push(e.point2line(t.end,n)),e.sort(r),r[0]}static segment2segment(t,n){let o=FCe(t,n);if(o.length>0)return[0,new Ge.Segment(o[0],o[0])];let r,i,s=[];return[r,i]=e.point2segment(n.start,t),s.push([r,i.reverse()]),[r,i]=e.point2segment(n.end,t),s.push([r,i.reverse()]),s.push(e.point2segment(t.start,n)),s.push(e.point2segment(t.end,n)),e.sort(s),s[0]}static segment2circle(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Ge.Segment(o[0],o[0])];let r=new Ge.Line(t.ps,t.pe),[i,s]=e.point2line(n.center,r);if(Ge.Utils.GE(i,n.r)&&s.end.on(t))return e.point2circle(s.end,n);{let[a,c]=e.point2circle(t.start,n),[l,h]=e.point2circle(t.end,n);return Ge.Utils.LT(a,l)?[a,c]:[l,h]}}static segment2arc(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Ge.Segment(o[0],o[0])];let r=new Ge.Line(t.ps,t.pe),i=new Ge.Circle(n.pc,n.r),[s,a]=e.point2line(i.center,r);if(Ge.Utils.GE(s,i.r)&&a.end.on(t)){let[d,u]=e.point2circle(a.end,i);if(u.end.on(n))return[d,u]}let c,l,h=[];return h.push(e.point2arc(t.start,n)),h.push(e.point2arc(t.end,n)),[c,l]=e.point2segment(n.start,t),h.push([c,l.reverse()]),[c,l]=e.point2segment(n.end,t),h.push([c,l.reverse()]),e.sort(h),h[0]}static circle2circle(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Ge.Segment(o[0],o[0])];if(t.center.equalTo(n.center)){let r=t.toArc(),i=n.toArc();return e.point2point(r.start,i.start)}{let r=new Ge.Line(t.center,n.center),i=r.intersect(t),s=r.intersect(n),a=[];return a.push(e.point2point(i[0],s[0])),a.push(e.point2point(i[0],s[1])),a.push(e.point2point(i[1],s[0])),a.push(e.point2point(i[1],s[1])),e.sort(a),a[0]}}static circle2line(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Ge.Segment(o[0],o[0])];let[r,i]=e.point2line(t.center,n),[s,a]=e.point2circle(i.end,t);return a=a.reverse(),[s,a]}static arc2line(t,n){let o=n.intersect(t);if(o.length>0)return[0,new Ge.Segment(o[0],o[0])];let r=new Ge.Circle(t.center,t.r),[i,s]=e.point2line(r.center,n);if(!Ge.Utils.GE(i,r.r)){let a=[];return a.push(e.point2line(t.start,n)),a.push(e.point2line(t.end,n)),e.sort(a),a[0]}{let[a,c]=e.point2circle(s.end,r);if(c.end.on(t))return[a,c]}}static arc2circle(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Ge.Segment(o[0],o[0])];let r=new Ge.Circle(t.center,t.r),[i,s]=e.circle2circle(r,n);if(s.start.on(t))return[i,s];{let a=[];return a.push(e.point2circle(t.start,n)),a.push(e.point2circle(t.end,n)),e.sort(a),a[0]}}static arc2arc(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Ge.Segment(o[0],o[0])];let r=new Ge.Circle(t.center,t.r),i=new Ge.Circle(n.center,n.r),[s,a]=e.circle2circle(r,i);if(a.start.on(t)&&a.end.on(n))return[s,a];{let c,l,h=[];return[c,l]=e.point2arc(t.start,n),l.end.on(n)&&h.push([c,l]),[c,l]=e.point2arc(t.end,n),l.end.on(n)&&h.push([c,l]),[c,l]=e.point2arc(n.start,t),l.end.on(t)&&h.push([c,l.reverse()]),[c,l]=e.point2arc(n.end,t),l.end.on(t)&&h.push([c,l.reverse()]),[c,l]=e.point2point(t.start,n.start),h.push([c,l]),[c,l]=e.point2point(t.start,n.end),h.push([c,l]),[c,l]=e.point2point(t.end,n.start),h.push([c,l]),[c,l]=e.point2point(t.end,n.end),h.push([c,l]),e.sort(h),h[0]}}static point2polygon(t,n){let o=[Number.POSITIVE_INFINITY,new Ge.Segment];for(let r of n.edges){let[i,s]=e.point2edge(t,r);Ge.Utils.LT(i,o[0])&&(o=[i,s])}return o}static shape2polygon(t,n){let o=[Number.POSITIVE_INFINITY,new Ge.Segment];for(let r of n.edges){let[i,s]=t.distanceTo(r.shape);Ge.Utils.LT(i,o[0])&&(o=[i,s])}return o}static polygon2polygon(t,n){let o=[Number.POSITIVE_INFINITY,new Ge.Segment];for(let r of t.edges)for(let i of n.edges){let[s,a]=r.shape.distanceTo(i.shape);Ge.Utils.LT(s,o[0])&&(o=[s,a])}return o}static box2box_minmax(t,n){let o=Math.max(Math.max(t.xmin-n.xmax,0),Math.max(n.xmin-t.xmax,0)),r=Math.max(Math.max(t.ymin-n.ymax,0),Math.max(n.ymin-t.ymax,0)),i=o*o+r*r,s=t.merge(n),a=s.xmax-s.xmin,c=s.ymax-s.ymin;return[i,a*a+c*c]}static minmax_tree_process_level(t,n,o,r){let i,s;for(let c of n){[i,s]=e.box2box_minmax(t.box,c.item.key);for(let l of c.item.values)l instanceof Ge.Edge?r.insert([i,s],l.shape):r.insert([i,s],l);Ge.Utils.LT(s,o)&&(o=s)}if(n.length===0)return o;let a=[...n.map((c)=>c.left.isNil()?void 0:c.left).filter((c)=>c!==void 0),...n.map((c)=>c.right.isNil()?void 0:c.right).filter((c)=>c!==void 0)].filter((c)=>{let[l,h]=e.box2box_minmax(t.box,c.max);return Ge.Utils.LE(l,o)});return o=e.minmax_tree_process_level(t,a,o,r)}static minmax_tree(t,n,o){let r=new c$e,i=[n.index.root],s=o<Number.POSITIVE_INFINITY?o*o:Number.POSITIVE_INFINITY;return s=e.minmax_tree_process_level(t,i,s,r),r}static minmax_tree_calc_distance(t,n,o){let r,i;if(n!=null&&!n.isNil()){if([r,i]=e.minmax_tree_calc_distance(t,n.left,o),i)return[r,i];if(Ge.Utils.LT(r[0],Math.sqrt(n.item.key.low)))return[r,!0];let[s,a]=e.distanceToArray(t,n.item.values);return Ge.Utils.LT(s,r[0])&&(r=[s,a]),[r,i]=e.minmax_tree_calc_distance(t,n.right,r),[r,i]}return[o,!1]}static shape2planarSet(t,n,o=Number.POSITIVE_INFINITY){let r=[o,new Ge.Segment],i=!1;if(n instanceof Ge.PlanarSet){let s=e.minmax_tree(t,n,o);[r,i]=e.minmax_tree_calc_distance(t,s.root,r)}return r}static sort(t){t.sort((n,o)=>Ge.Utils.LT(n[0],o[0])?-1:Ge.Utils.GT(n[0],o[0])?1:0)}static distance(t,n){return t.distanceTo(n)}static distanceToArray(t,n){let o=[Number.POSITIVE_INFINITY,new Ge.Segment];for(let r of n){let[i,s]=t.distanceTo(r);Ge.Utils.LT(i,o[0])&&(o=[i,s])}return o}static shape2multiline(t,n){let o=[Number.POSITIVE_INFINITY,new Ge.Segment];for(let r of n){let[i,s]=e.distance(t,r.shape);Ge.Utils.LT(i,o[0])&&(o=[i,s])}return o}static multiline2multiline(t,n){let o=[Number.POSITIVE_INFINITY,new Ge.Segment];for(let r of t)for(let i of n){let[s,a]=e.distance(r.shape,i.shape);Ge.Utils.LT(s,o[0])&&(o=[s,a])}return o}};var{Multiline:Zxr,Point:Xin,Segment:e5r,Polygon:jin}=Ge;function l$e(e){return new Xin(e.split(" ").map(Number))}function Kin(e){return e.split(", ").map(l$e)}function HXe(e){let t=Kin(e),n=[];for(let o=0;o<t.length-1;o++)n.push(new e5r(t[o],t[o+1]));return new Zxr(n)}function COt(e){let t=e.replace(/\(\(/,"").replace(/\)\)$/,"").split("), ("),n=new jin,o;return t.forEach((r,i)=>{let s=r.split(", ").map((c)=>new Xin(c.split(" ").map(Number))),a=n.addFace(s);i===0?o=a.orientation():a.orientation()===o&&a.reverse()}),n}function t5r(e){if(e.startsWith("POLYGON"))return COt(e.replace(/^POLYGON /,""));return function(t){let n=t.split(/\)\), \(\(/).map((r)=>"(("+r+"))").map(COt),o=new jin;return n.reduce((r,i)=>[...r,...i?.faces],[]).forEach((r)=>o.addFace([...r?.shapes])),o}(e.replace(/^MULTIPOLYGON \(\(\((.*)\)\)\)$/,"$1"))}function bOt(e){return e.split(`
`)?.every((t)=>t.includes("POINT"))}function IOt(e){return e.split(`
`)?.every((t)=>t.includes("LINESTRING"))}Ge.isWktString=function(e){return e.startsWith("POINT")||bOt(e)||e.startsWith("LINESTRING")||IOt(e)||e.startsWith("MULTILINESTRING")||e.startsWith("POLYGON")||e.startsWith("MULTIPOINT")||e.startsWith("MULTIPOLYGON")||e.startsWith("GEOMETRYCOLLECTION")},Ge.parseWKT=function e(t){if(t.startsWith("POINT"))return l$e(t.replace(/^POINT \(/,"").replace(/\)$/,""));if(t.startsWith("MULTIPOINT"))return Kin(t.replace(/^MULTIPOINT \(/,"").replace(/\)$/,""));if(t.startsWith("LINESTRING"))return HXe(t.replace(/^LINESTRING \(/,"").replace(/\)$/,""));if(t.startsWith("MULTILINESTRING"))return function(n){return n.replace(/\(\(/,"").replace(/\)\)$/,"").split("), (").map(HXe)}(t.replace(/^MULTILINESTRING /,""));if(t.startsWith("POLYGON")||t.startsWith("MULTIPOLYGON"))return t5r(t);if(t.startsWith("GEOMETRYCOLLECTION")){let n=/(?<type>POINT|LINESTRING|POLYGON|MULTIPOINT|MULTILINESTRING|MULTIPOLYGON) \((?:[^\(\)]|\([^\)]*\))*\)/g,o=t.match(n);return o[0].startsWith("GEOMETRYCOLLECTION")&&(o[0]=o[0].replace("GEOMETRYCOLLECTION (","")),o.map(e).map((r)=>r instanceof Array?r:[r]).reduce((r,i)=>[...r,...i],[])}return bOt(t)?function(n){return n.split(`
`).map((o)=>o.match(/\(([^)]+)\)/)[1]).map(l$e)}(t):IOt(t)?function(n){return n.split(`
`).map((o)=>o.match(/\(([^)]+)\)/)[1]).map(HXe).reduce((o,r)=>[...o,...r],[])}(t):[]},Ge.BooleanOperations=Vxr,Ge.Relations=jxr;KO=pxr(),vOt=1,FXe=KO!=null?nxr(rxr(KO)):{},((e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of uin(t))ixr.call(e,r)||r===n||Jzt(e,r,{get:()=>t[r],enumerable:!(o=oxr(t,r))||o.enumerable})})(!vOt&&KO&&KO.__esModule?FXe:Jzt(FXe,"default",{value:KO,enumerable:!0}),KO);var KO,vOt,FXe,{create:n5r,defineProperty:SOt,getOwnPropertyDescriptor:o5r,getOwnPropertyNames:$in,getPrototypeOf:r5r}=Object,i5r=Object.prototype.hasOwnProperty,pY=(e,t)=>function(){return t||(0,e[$in(e)[0]])((t={exports:{}}).exports,t),t.exports},POt=(e,t,n)=>(n=e!=null?n5r(r5r(e)):{},((o,r,i,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of $in(r))i5r.call(o,a)||a===i||SOt(o,a,{get:()=>r[a],enumerable:!(s=o5r(r,a))||s.enumerable});return o})(!t&&e&&e.__esModule?n:SOt(n,"default",{value:e,enumerable:!0}),e)),s5r=pY({"node_modules/is-buffer/index.js"(e,t){function n(o){return!!o.constructor&&typeof o.constructor.isBuffer=="function"&&o.constructor.isBuffer(o)}t.exports=function(o){return o!=null&&(n(o)||function(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&n(r.slice(0,0))}(o)||!!o._isBuffer)}}}),a5r=pY({"node_modules/kind-of/index.js"(e,t){var n=s5r(),o=Object.prototype.toString;t.exports=function(r){if(r===void 0)return"undefined";if(r===null)return"null";if(r===!0||r===!1||r instanceof Boolean)return"boolean";if(typeof r=="string"||r instanceof String)return"string";if(typeof r=="number"||r instanceof Number)return"number";if(typeof r=="function"||r instanceof Function)return"function";if(Array.isArray!==void 0&&Array.isArray(r))return"array";if(r instanceof RegExp)return"regexp";if(r instanceof Date)return"date";var i=o.call(r);return i==="[object RegExp]"?"regexp":i==="[object Date]"?"date":i==="[object Arguments]"?"arguments":i==="[object Error]"?"error":n(r)?"buffer":i==="[object Set]"?"set":i==="[object WeakSet]"?"weakset":i==="[object Map]"?"map":i==="[object WeakMap]"?"weakmap":i==="[object Symbol]"?"symbol":i==="[object Int8Array]"?"int8array":i==="[object Uint8Array]"?"uint8array":i==="[object Uint8ClampedArray]"?"uint8clampedarray":i==="[object Int16Array]"?"int16array":i==="[object Uint16Array]"?"uint16array":i==="[object Int32Array]"?"int32array":i==="[object Uint32Array]"?"uint32array":i==="[object Float32Array]"?"float32array":i==="[object Float64Array]"?"float64array":"object"}}}),c5r=pY({"node_modules/rename-keys/index.js"(e,t){(function(){function n(o,r){if(typeof r!="function")return o;var i={};for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(i[r(s,o[s])||s]=o[s]);return i}t!==void 0&&t.exports?t.exports=n:typeof define=="function"&&define.amd?define([],function(){return n}):window.rename=n})()}}),l5r=pY({"node_modules/deep-rename-keys/index.js"(e,t){var n=a5r(),o=c5r();t.exports=function r(i,s){var a=n(i);if(a!=="object"&&a!=="array")throw Error("expected an object");var c=[];for(var l in a==="object"&&(i=o(i,s),c={}),i)if(i.hasOwnProperty(l)){var h=i[l];n(h)==="object"||n(h)==="array"?c[l]=r(h,s):c[l]=h}return c}}}),qin=pY({"node_modules/eventemitter3/index.js"(e,t){var n=Object.prototype.hasOwnProperty,o="~";function r(){}function i(a,c,l){this.fn=a,this.context=c,this.once=l||!1}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(o=!1)),s.prototype.eventNames=function(){var a,c,l=[];if(this._eventsCount===0)return l;for(c in a=this._events)n.call(a,c)&&l.push(o?c.slice(1):c);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(a)):l},s.prototype.listeners=function(a,c){var l=o?o+a:a,h=this._events[l];if(c)return!!h;if(!h)return[];if(h.fn)return[h.fn];for(var d=0,u=h.length,_=Array(u);d<u;d++)_[d]=h[d].fn;return _},s.prototype.emit=function(a,c,l,h,d,u){var _=o?o+a:a;if(!this._events[_])return!1;var p,m,A=this._events[_],g=arguments.length;if(A.fn){switch(A.once&&this.removeListener(a,A.fn,void 0,!0),g){case 1:return A.fn.call(A.context),!0;case 2:return A.fn.call(A.context,c),!0;case 3:return A.fn.call(A.context,c,l),!0;case 4:return A.fn.call(A.context,c,l,h),!0;case 5:return A.fn.call(A.context,c,l,h,d),!0;case 6:return A.fn.call(A.context,c,l,h,d,u),!0}for(m=1,p=Array(g-1);m<g;m++)p[m-1]=arguments[m];A.fn.apply(A.context,p)}else{var f,y=A.length;for(m=0;m<y;m++)switch(A[m].once&&this.removeListener(a,A[m].fn,void 0,!0),g){case 1:A[m].fn.call(A[m].context);break;case 2:A[m].fn.call(A[m].context,c);break;case 3:A[m].fn.call(A[m].context,c,l);break;case 4:A[m].fn.call(A[m].context,c,l,h);break;default:if(!p)for(f=1,p=Array(g-1);f<g;f++)p[f-1]=arguments[f];A[m].fn.apply(A[m].context,p)}}return!0},s.prototype.on=function(a,c,l){var h=new i(c,l||this),d=o?o+a:a;return this._events[d]?this._events[d].fn?this._events[d]=[this._events[d],h]:this._events[d].push(h):(this._events[d]=h,this._eventsCount++),this},s.prototype.once=function(a,c,l){var h=new i(c,l||this,!0),d=o?o+a:a;return this._events[d]?this._events[d].fn?this._events[d]=[this._events[d],h]:this._events[d].push(h):(this._events[d]=h,this._eventsCount++),this},s.prototype.removeListener=function(a,c,l,h){var d=o?o+a:a;if(!this._events[d])return this;if(!c)return--this._eventsCount===0?this._events=new r:delete this._events[d],this;var u=this._events[d];if(u.fn)u.fn!==c||h&&!u.once||l&&u.context!==l||(--this._eventsCount===0?this._events=new r:delete this._events[d]);else{for(var _=0,p=[],m=u.length;_<m;_++)(u[_].fn!==c||h&&!u[_].once||l&&u[_].context!==l)&&p.push(u[_]);p.length?this._events[d]=p.length===1?p[0]:p:--this._eventsCount===0?this._events=new r:delete this._events[d]}return this},s.prototype.removeAllListeners=function(a){var c;return a?(c=o?o+a:a,this._events[c]&&(--this._eventsCount===0?this._events=new r:delete this._events[c])):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prototype.setMaxListeners=function(){return this},s.prefixed=o,s.EventEmitter=s,t!==void 0&&(t.exports=s)}}),h5r=pY({"node_modules/xml-lexer/dist/lexer.js"(e,t){function n(l,h,d){return h in l?Object.defineProperty(l,h,{value:d,enumerable:!0,configurable:!0,writable:!0}):l[h]=d,l}var o=qin(),r=function(){},i={data:"state-data",cdata:"state-cdata",tagBegin:"state-tag-begin",tagName:"state-tag-name",tagEnd:"state-tag-end",attributeNameStart:"state-attribute-name-start",attributeName:"state-attribute-name",attributeNameEnd:"state-attribute-name-end",attributeValueBegin:"state-attribute-value-begin",attributeValue:"state-attribute-value"},s={lt:"action-lt",gt:"action-gt",space:"action-space",equal:"action-equal",quote:"action-quote",slash:"action-slash",char:"action-char",error:"action-error"},a={text:"text",openTag:"open-tag",closeTag:"close-tag",attributeName:"attribute-name",attributeValue:"attribute-value"},c={" ":s.space,"\t":s.space,"\n":s.space,"\r":s.space,"<":s.lt,">":s.gt,'"':s.quote,"'":s.quote,"=":s.equal,"/":s.slash};t.exports={State:i,Action:s,Type:a,create:function(l){var h,d,u,_,p,m,A,g,f,y;l=Object.assign({debug:!1},l);var x=new o,C=i.data,b="",I="",v="",P="",M="",B="",T=function(D,L){if(I[0]!=="?"&&I[0]!=="!"){var H={type:D,value:L};l.debug&&console.log("emit:",H),x.emit("data",H)}};x.stateMachine=(n(y={},i.data,(n(h={},s.lt,function(){b.trim()&&T(a.text,b),I="",M=!1,C=i.tagBegin}),n(h,s.char,function(D){b+=D}),h)),n(y,i.cdata,n({},s.char,function(D){(b+=D).substr(-3)==="]]>"&&(T(a.text,b.slice(0,-3)),b="",C=i.data)})),n(y,i.tagBegin,(n(d={},s.space,r),n(d,s.char,function(D){I=D,C=i.tagName}),n(d,s.slash,function(){I="",M=!0}),d)),n(y,i.tagName,(n(u={},s.space,function(){M?C=i.tagEnd:(C=i.attributeNameStart,T(a.openTag,I))}),n(u,s.gt,function(){T(M?a.closeTag:a.openTag,I),b="",C=i.data}),n(u,s.slash,function(){C=i.tagEnd,T(a.openTag,I)}),n(u,s.char,function(D){(I+=D)==="![CDATA["&&(C=i.cdata,b="",I="")}),u)),n(y,i.tagEnd,(n(_={},s.gt,function(){T(a.closeTag,I),b="",C=i.data}),n(_,s.char,r),_)),n(y,i.attributeNameStart,(n(p={},s.char,function(D){v=D,C=i.attributeName}),n(p,s.gt,function(){b="",C=i.data}),n(p,s.space,r),n(p,s.slash,function(){M=!0,C=i.tagEnd}),p)),n(y,i.attributeName,(n(m={},s.space,function(){C=i.attributeNameEnd}),n(m,s.equal,function(){T(a.attributeName,v),C=i.attributeValueBegin}),n(m,s.gt,function(){P="",T(a.attributeName,v),T(a.attributeValue,P),b="",C=i.data}),n(m,s.slash,function(){M=!0,P="",T(a.attributeName,v),T(a.attributeValue,P),C=i.tagEnd}),n(m,s.char,function(D){v+=D}),m)),n(y,i.attributeNameEnd,(n(A={},s.space,r),n(A,s.equal,function(){T(a.attributeName,v),C=i.attributeValueBegin}),n(A,s.gt,function(){P="",T(a.attributeName,v),T(a.attributeValue,P),b="",C=i.data}),n(A,s.char,function(D){P="",T(a.attributeName,v),T(a.attributeValue,P),v=D,C=i.attributeName}),A)),n(y,i.attributeValueBegin,(n(g={},s.space,r),n(g,s.quote,function(D){B=D,P="",C=i.attributeValue}),n(g,s.gt,function(){T(a.attributeValue,P=""),b="",C=i.data}),n(g,s.char,function(D){B="",P=D,C=i.attributeValue}),g)),n(y,i.attributeValue,(n(f={},s.space,function(D){B?P+=D:(T(a.attributeValue,P),C=i.attributeNameStart)}),n(f,s.quote,function(D){B===D?(T(a.attributeValue,P),C=i.attributeNameStart):P+=D}),n(f,s.gt,function(D){B?P+=D:(T(a.attributeValue,P),b="",C=i.data)}),n(f,s.slash,function(D){B?P+=D:(T(a.attributeValue,P),M=!0,C=i.tagEnd)}),n(f,s.char,function(D){P+=D}),f)),y);var N=function(D){l.debug&&console.log(C,D);var L=x.stateMachine[C],H=L[function(V){return c[V]||s.char}(D)]||L[s.error]||L[s.char];H(D)};return x.write=function(D){for(var L=D.length,H=0;H<L;H++)N(D[H])},x}}}}),d5r=pY({"node_modules/xml-reader/dist/reader.js"(e,t){var n=qin(),o=h5r(),r=o.Type,i={element:"element",text:"text"},s=function(c){return Object.assign({name:"",type:i.element,value:"",parent:null,attributes:{},children:[]},c)},a=function(c){c=Object.assign({stream:!1,parentNodes:!0,doneEvent:"done",tagPrefix:"tag:",emitTopLevelOnly:!1,debug:!1},c);var l=void 0,h=void 0,d=void 0,u=void 0,_=new n,p=function(m){switch(m.type){case r.openTag:if(d===null)(d=h).name=m.value;else{var A=s({name:m.value,parent:d});d.children.push(A),d=A}break;case r.closeTag:var g=d.parent;if(c.parentNodes||(d.parent=null),d.name!==m.value)break;c.stream&&g===h&&(h.children=[],d.parent=null),c.emitTopLevelOnly&&g!==h||(_.emit(c.tagPrefix+d.name,d),_.emit("tag",d.name,d)),d===h&&(l.removeAllListeners("data"),_.emit(c.doneEvent,d),h=null),d=g;break;case r.text:d&&d.children.push(s({type:i.text,value:m.value,parent:c.parentNodes?d:null}));break;case r.attributeName:u=m.value,d.attributes[u]="";break;case r.attributeValue:d.attributes[u]=m.value}};return _.reset=function(){(l=o.create({debug:c.debug})).on("data",p),h=s(),d=null,u="",_.parse=l.write},_.reset(),_};t.exports={parseSync:function(c,l){l=Object.assign({},l,{stream:!1,tagPrefix:":"});var h=a(l),d=void 0;return h.on("done",function(u){d=u}),h.parse(c),d},create:a,NodeType:i}}}),{cos:gLs,sin:ALs,PI:fLs}=Math,{tan:yLs}=Math,u5r=(POt(l5r()),POt(d5r()),Object.create),{defineProperty:EOt,getOwnPropertyDescriptor:p5r,getOwnPropertyNames:Jin,getPrototypeOf:m5r}=Object,_5r=Object.prototype.hasOwnProperty,mY=(e,t)=>function(){return t||(0,e[Jin(e)[0]])((t={exports:{}}).exports,t),t.exports},MOt=(e,t,n)=>(n=e!=null?u5r(m5r(e)):{},((o,r,i,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of Jin(r))_5r.call(o,a)||a===i||EOt(o,a,{get:()=>r[a],enumerable:!(s=p5r(r,a))||s.enumerable});return o})(!t&&e&&e.__esModule?n:EOt(n,"default",{value:e,enumerable:!0}),e)),g5r=mY({"node_modules/is-buffer/index.js"(e,t){function n(o){return!!o.constructor&&typeof o.constructor.isBuffer=="function"&&o.constructor.isBuffer(o)}t.exports=function(o){return o!=null&&(n(o)||function(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&n(r.slice(0,0))}(o)||!!o._isBuffer)}}}),A5r=mY({"node_modules/kind-of/index.js"(e,t){var n=g5r(),o=Object.prototype.toString;t.exports=function(r){if(r===void 0)return"undefined";if(r===null)return"null";if(r===!0||r===!1||r instanceof Boolean)return"boolean";if(typeof r=="string"||r instanceof String)return"string";if(typeof r=="number"||r instanceof Number)return"number";if(typeof r=="function"||r instanceof Function)return"function";if(Array.isArray!==void 0&&Array.isArray(r))return"array";if(r instanceof RegExp)return"regexp";if(r instanceof Date)return"date";var i=o.call(r);return i==="[object RegExp]"?"regexp":i==="[object Date]"?"date":i==="[object Arguments]"?"arguments":i==="[object Error]"?"error":n(r)?"buffer":i==="[object Set]"?"set":i==="[object WeakSet]"?"weakset":i==="[object Map]"?"map":i==="[object WeakMap]"?"weakmap":i==="[object Symbol]"?"symbol":i==="[object Int8Array]"?"int8array":i==="[object Uint8Array]"?"uint8array":i==="[object Uint8ClampedArray]"?"uint8clampedarray":i==="[object Int16Array]"?"int16array":i==="[object Uint16Array]"?"uint16array":i==="[object Int32Array]"?"int32array":i==="[object Uint32Array]"?"uint32array":i==="[object Float32Array]"?"float32array":i==="[object Float64Array]"?"float64array":"object"}}}),f5r=mY({"node_modules/rename-keys/index.js"(e,t){(function(){function n(o,r){if(typeof r!="function")return o;var i={};for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(i[r(s,o[s])||s]=o[s]);return i}t!==void 0&&t.exports?t.exports=n:typeof define=="function"&&define.amd?define([],function(){return n}):window.rename=n})()}}),y5r=mY({"node_modules/deep-rename-keys/index.js"(e,t){var n=A5r(),o=f5r();t.exports=function r(i,s){var a=n(i);if(a!=="object"&&a!=="array")throw Error("expected an object");var c=[];for(var l in a==="object"&&(i=o(i,s),c={}),i)if(i.hasOwnProperty(l)){var h=i[l];n(h)==="object"||n(h)==="array"?c[l]=r(h,s):c[l]=h}return c}}}),Zin=mY({"node_modules/eventemitter3/index.js"(e,t){var n=Object.prototype.hasOwnProperty,o="~";function r(){}function i(a,c,l){this.fn=a,this.context=c,this.once=l||!1}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(o=!1)),s.prototype.eventNames=function(){var a,c,l=[];if(this._eventsCount===0)return l;for(c in a=this._events)n.call(a,c)&&l.push(o?c.slice(1):c);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(a)):l},s.prototype.listeners=function(a,c){var l=o?o+a:a,h=this._events[l];if(c)return!!h;if(!h)return[];if(h.fn)return[h.fn];for(var d=0,u=h.length,_=Array(u);d<u;d++)_[d]=h[d].fn;return _},s.prototype.emit=function(a,c,l,h,d,u){var _=o?o+a:a;if(!this._events[_])return!1;var p,m,A=this._events[_],g=arguments.length;if(A.fn){switch(A.once&&this.removeListener(a,A.fn,void 0,!0),g){case 1:return A.fn.call(A.context),!0;case 2:return A.fn.call(A.context,c),!0;case 3:return A.fn.call(A.context,c,l),!0;case 4:return A.fn.call(A.context,c,l,h),!0;case 5:return A.fn.call(A.context,c,l,h,d),!0;case 6:return A.fn.call(A.context,c,l,h,d,u),!0}for(m=1,p=Array(g-1);m<g;m++)p[m-1]=arguments[m];A.fn.apply(A.context,p)}else{var f,y=A.length;for(m=0;m<y;m++)switch(A[m].once&&this.removeListener(a,A[m].fn,void 0,!0),g){case 1:A[m].fn.call(A[m].context);break;case 2:A[m].fn.call(A[m].context,c);break;case 3:A[m].fn.call(A[m].context,c,l);break;case 4:A[m].fn.call(A[m].context,c,l,h);break;default:if(!p)for(f=1,p=Array(g-1);f<g;f++)p[f-1]=arguments[f];A[m].fn.apply(A[m].context,p)}}return!0},s.prototype.on=function(a,c,l){var h=new i(c,l||this),d=o?o+a:a;return this._events[d]?this._events[d].fn?this._events[d]=[this._events[d],h]:this._events[d].push(h):(this._events[d]=h,this._eventsCount++),this},s.prototype.once=function(a,c,l){var h=new i(c,l||this,!0),d=o?o+a:a;return this._events[d]?this._events[d].fn?this._events[d]=[this._events[d],h]:this._events[d].push(h):(this._events[d]=h,this._eventsCount++),this},s.prototype.removeListener=function(a,c,l,h){var d=o?o+a:a;if(!this._events[d])return this;if(!c)return--this._eventsCount===0?this._events=new r:delete this._events[d],this;var u=this._events[d];if(u.fn)u.fn!==c||h&&!u.once||l&&u.context!==l||(--this._eventsCount===0?this._events=new r:delete this._events[d]);else{for(var _=0,p=[],m=u.length;_<m;_++)(u[_].fn!==c||h&&!u[_].once||l&&u[_].context!==l)&&p.push(u[_]);p.length?this._events[d]=p.length===1?p[0]:p:--this._eventsCount===0?this._events=new r:delete this._events[d]}return this},s.prototype.removeAllListeners=function(a){var c;return a?(c=o?o+a:a,this._events[c]&&(--this._eventsCount===0?this._events=new r:delete this._events[c])):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prototype.setMaxListeners=function(){return this},s.prefixed=o,s.EventEmitter=s,t!==void 0&&(t.exports=s)}}),x5r=mY({"node_modules/xml-lexer/dist/lexer.js"(e,t){function n(l,h,d){return h in l?Object.defineProperty(l,h,{value:d,enumerable:!0,configurable:!0,writable:!0}):l[h]=d,l}var o=Zin(),r=function(){},i={data:"state-data",cdata:"state-cdata",tagBegin:"state-tag-begin",tagName:"state-tag-name",tagEnd:"state-tag-end",attributeNameStart:"state-attribute-name-start",attributeName:"state-attribute-name",attributeNameEnd:"state-attribute-name-end",attributeValueBegin:"state-attribute-value-begin",attributeValue:"state-attribute-value"},s={lt:"action-lt",gt:"action-gt",space:"action-space",equal:"action-equal",quote:"action-quote",slash:"action-slash",char:"action-char",error:"action-error"},a={text:"text",openTag:"open-tag",closeTag:"close-tag",attributeName:"attribute-name",attributeValue:"attribute-value"},c={" ":s.space,"\t":s.space,"\n":s.space,"\r":s.space,"<":s.lt,">":s.gt,'"':s.quote,"'":s.quote,"=":s.equal,"/":s.slash};t.exports={State:i,Action:s,Type:a,create:function(l){var h,d,u,_,p,m,A,g,f,y;l=Object.assign({debug:!1},l);var x=new o,C=i.data,b="",I="",v="",P="",M="",B="",T=function(D,L){if(I[0]!=="?"&&I[0]!=="!"){var H={type:D,value:L};l.debug&&console.log("emit:",H),x.emit("data",H)}};x.stateMachine=(n(y={},i.data,(n(h={},s.lt,function(){b.trim()&&T(a.text,b),I="",M=!1,C=i.tagBegin}),n(h,s.char,function(D){b+=D}),h)),n(y,i.cdata,n({},s.char,function(D){(b+=D).substr(-3)==="]]>"&&(T(a.text,b.slice(0,-3)),b="",C=i.data)})),n(y,i.tagBegin,(n(d={},s.space,r),n(d,s.char,function(D){I=D,C=i.tagName}),n(d,s.slash,function(){I="",M=!0}),d)),n(y,i.tagName,(n(u={},s.space,function(){M?C=i.tagEnd:(C=i.attributeNameStart,T(a.openTag,I))}),n(u,s.gt,function(){T(M?a.closeTag:a.openTag,I),b="",C=i.data}),n(u,s.slash,function(){C=i.tagEnd,T(a.openTag,I)}),n(u,s.char,function(D){(I+=D)==="![CDATA["&&(C=i.cdata,b="",I="")}),u)),n(y,i.tagEnd,(n(_={},s.gt,function(){T(a.closeTag,I),b="",C=i.data}),n(_,s.char,r),_)),n(y,i.attributeNameStart,(n(p={},s.char,function(D){v=D,C=i.attributeName}),n(p,s.gt,function(){b="",C=i.data}),n(p,s.space,r),n(p,s.slash,function(){M=!0,C=i.tagEnd}),p)),n(y,i.attributeName,(n(m={},s.space,function(){C=i.attributeNameEnd}),n(m,s.equal,function(){T(a.attributeName,v),C=i.attributeValueBegin}),n(m,s.gt,function(){P="",T(a.attributeName,v),T(a.attributeValue,P),b="",C=i.data}),n(m,s.slash,function(){M=!0,P="",T(a.attributeName,v),T(a.attributeValue,P),C=i.tagEnd}),n(m,s.char,function(D){v+=D}),m)),n(y,i.attributeNameEnd,(n(A={},s.space,r),n(A,s.equal,function(){T(a.attributeName,v),C=i.attributeValueBegin}),n(A,s.gt,function(){P="",T(a.attributeName,v),T(a.attributeValue,P),b="",C=i.data}),n(A,s.char,function(D){P="",T(a.attributeName,v),T(a.attributeValue,P),v=D,C=i.attributeName}),A)),n(y,i.attributeValueBegin,(n(g={},s.space,r),n(g,s.quote,function(D){B=D,P="",C=i.attributeValue}),n(g,s.gt,function(){T(a.attributeValue,P=""),b="",C=i.data}),n(g,s.char,function(D){B="",P=D,C=i.attributeValue}),g)),n(y,i.attributeValue,(n(f={},s.space,function(D){B?P+=D:(T(a.attributeValue,P),C=i.attributeNameStart)}),n(f,s.quote,function(D){B===D?(T(a.attributeValue,P),C=i.attributeNameStart):P+=D}),n(f,s.gt,function(D){B?P+=D:(T(a.attributeValue,P),b="",C=i.data)}),n(f,s.slash,function(D){B?P+=D:(T(a.attributeValue,P),M=!0,C=i.tagEnd)}),n(f,s.char,function(D){P+=D}),f)),y);var N=function(D){l.debug&&console.log(C,D);var L=x.stateMachine[C],H=L[function(V){return c[V]||s.char}(D)]||L[s.error]||L[s.char];H(D)};return x.write=function(D){for(var L=D.length,H=0;H<L;H++)N(D[H])},x}}}}),C5r=mY({"node_modules/xml-reader/dist/reader.js"(e,t){var n=Zin(),o=x5r(),r=o.Type,i={element:"element",text:"text"},s=function(c){return Object.assign({name:"",type:i.element,value:"",parent:null,attributes:{},children:[]},c)},a=function(c){c=Object.assign({stream:!1,parentNodes:!0,doneEvent:"done",tagPrefix:"tag:",emitTopLevelOnly:!1,debug:!1},c);var l=void 0,h=void 0,d=void 0,u=void 0,_=new n,p=function(m){switch(m.type){case r.openTag:if(d===null)(d=h).name=m.value;else{var A=s({name:m.value,parent:d});d.children.push(A),d=A}break;case r.closeTag:var g=d.parent;if(c.parentNodes||(d.parent=null),d.name!==m.value)break;c.stream&&g===h&&(h.children=[],d.parent=null),c.emitTopLevelOnly&&g!==h||(_.emit(c.tagPrefix+d.name,d),_.emit("tag",d.name,d)),d===h&&(l.removeAllListeners("data"),_.emit(c.doneEvent,d),h=null),d=g;break;case r.text:d&&d.children.push(s({type:i.text,value:m.value,parent:c.parentNodes?d:null}));break;case r.attributeName:u=m.value,d.attributes[u]="";break;case r.attributeValue:d.attributes[u]=m.value}};return _.reset=function(){(l=o.create({debug:c.debug})).on("data",p),h=s(),d=null,u="",_.parse=l.write},_.reset(),_};t.exports={parseSync:function(c,l){l=Object.assign({},l,{stream:!1,tagPrefix:":"});var h=a(l),d=void 0;return h.on("done",function(u){d=u}),h.parse(c),d},create:a,NodeType:i}}}),{cos:xLs,sin:CLs,PI:bLs}=Math,{tan:ILs}=Math;MOt(y5r()),MOt(C5r());function zXe(e,t){if(e.points)for(let n of e.points)n.step=t;if(e.lines)for(let n of e.lines)n.step=t;if(e.infiniteLines)for(let n of e.infiniteLines)n.step=t;if(e.polygons)for(let n of e.polygons)n.step=t;if(e.rects)for(let n of e.rects)n.step=t;if(e.circles)for(let n of e.circles)n.step=t;if(e.texts)for(let n of e.texts)n.step=t;return e}var Xle=class{MAX_ITERATIONS=1e5;solved=!1;failed=!1;iterations=0;progress=0;error=null;activeSubSolver;failedSubSolvers;timeToSolve;stats={};_setupDone=!1;getSolverName(){return this.constructor.name}setup(){this._setupDone||(this._setup(),this._setupDone=!0)}_setup(){}step(){if(this._setupDone||this.setup(),!this.solved&&!this.failed){this.iterations++;try{this._step()}catch(e){throw this.error=`${this.getSolverName()} error: ${e}`,this.failed=!0,e}!this.solved&&this.iterations>=this.MAX_ITERATIONS&&this.tryFinalAcceptance(),!this.solved&&this.iterations>=this.MAX_ITERATIONS&&(this.error=`${this.getSolverName()} ran out of iterations`,this.failed=!0),"computeProgress"in this&&(this.progress=this.computeProgress())}}_step(){}getConstructorParams(){throw Error("getConstructorParams not implemented")}getOutput(){return null}solve(){let e=Date.now();for(;!this.solved&&!this.failed;)this.step();let t=Date.now();this.timeToSolve=t-e}visualize(){return{lines:[],points:[],rects:[],circles:[]}}tryFinalAcceptance(){}preview(){return{lines:[],points:[],rects:[],circles:[]}}};function l3e(e,t,n,o={}){return{solverName:e,solverClass:t,getConstructorParams:n,onSolved:o.onSolved}}var b5r=class extends Xle{startTimeOfStage={};endTimeOfStage={};timeSpentOnStage={};firstIterationOfStage={};currentPipelineStageIndex=0;inputProblem;pipelineOutputs={};constructor(e){super(),this.inputProblem=e,this.MAX_ITERATIONS=1e6}_step(){let e=this.pipelineDef[this.currentPipelineStageIndex];if(!e)return void(this.solved=!0);if(this.activeSubSolver){if(this.activeSubSolver.step(),this.activeSubSolver.solved){this.endTimeOfStage[e.solverName]=performance.now(),this.timeSpentOnStage[e.solverName]=this.endTimeOfStage[e.solverName]-this.startTimeOfStage[e.solverName];let n=this.activeSubSolver.getOutput();n!==null&&(this.pipelineOutputs[e.solverName]=n),e.onSolved?.(this),this.activeSubSolver=null,this.currentPipelineStageIndex++}else this.activeSubSolver.failed&&(this.error=this.activeSubSolver?.error,this.failed=!0,this.activeSubSolver=null);return}let t=e.getConstructorParams(this);this.activeSubSolver=new e.solverClass(...t),this[e.solverName]=this.activeSubSolver,this.timeSpentOnStage[e.solverName]=0,this.startTimeOfStage[e.solverName]=performance.now(),this.firstIterationOfStage[e.solverName]=this.iterations}solveUntilStage(e){for(;this.getCurrentStageName().toLowerCase()!==e.toLowerCase()&&(this.step(),!this.failed&&!this.solved););}getCurrentStageName(){return this.pipelineDef[this.currentPipelineStageIndex]?.solverName??"none"}getStageProgress(){let e=this.pipelineDef.length;if(e===0)return 1;let t=this.activeSubSolver?.progress??0;return(this.currentPipelineStageIndex+t)/e}getStageStats(){let e={};for(let t of this.pipelineDef){let n=this.timeSpentOnStage[t.solverName]||0,o=this.firstIterationOfStage[t.solverName]||0,r=this.iterations,i=t.solverName===this.getCurrentStageName()?r-o:0,s=this.currentPipelineStageIndex>this.pipelineDef.findIndex((a)=>a.solverName===t.solverName);e[t.solverName]={timeSpent:n,iterations:i,completed:s}}return e}initialVisualize(){return null}finalVisualize(){return null}visualize(){if(!this.solved&&this.activeSubSolver)return this.activeSubSolver.visualize();let e=0,t=this.initialVisualize();t&&(zXe(t,0),e=1);let n=null;this.solved&&(n=this.finalVisualize());let o=[t].filter(Boolean).concat(this.pipelineDef.map((r,i)=>{let s=this[r.solverName],a=s?.visualize();return a?(zXe(a,i+e),a):null}).filter(Boolean));return o.length===0?{points:[],rects:[],lines:[],circles:[],texts:[]}:(this.solved&&n&&(zXe(n,o.length+e+1),o.push(n)),o.length===1?o[0]:{points:o.flatMap((r)=>r.points||[]),rects:o.flatMap((r)=>r.rects||[]),lines:o.flatMap((r)=>r.lines||[]),circles:o.flatMap((r)=>r.circles||[]),texts:o.flatMap((r)=>r.texts||[])})}preview(){return this.activeSubSolver?this.activeSubSolver.preview():super.preview()}computeProgress(){return this.getStageProgress()}getStageOutput(e){return this.pipelineOutputs[e]}getAllOutputs(){return{...this.pipelineOutputs}}hasStageOutput(e){return e in this.pipelineOutputs}getSolver(e){return this[e]}},h$e=(e,t,n)=>(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x),esn=(e,t)=>{let n=[...new Set(e)].map((i)=>{let s=t[i];return s?{i,x:s.x,y:s.y}:null}).filter((i)=>i!==null);if(n.sort((i,s)=>i.x-s.x||i.y-s.y),n.length<=2)return n.map((i)=>i.i);let o=[],r=[];for(let i of n){for(;o.length>=2;){let s=o[o.length-2],a=o[o.length-1];if(!s||!a||h$e(s,a,i)>0.0000000001)break;o.pop()}o.push(i)}for(let i=n.length-1;i>=0;i--){let s=n[i];if(s){for(;r.length>=2;){let a=r[r.length-2],c=r[r.length-1];if(!a||!c||h$e(a,c,s)>0.0000000001)break;r.pop()}r.push(s)}}return o.pop(),r.pop(),o.concat(r).map((i)=>i.i)},wOt=(e)=>e!==void 0,I5r=class extends Xle{input;output=null;constructor(e){super(),this.input=e}_step(){let{regions:e,hulls:t}={regions:(n=this.input).cells.map((o)=>o.map((r)=>n.pts[r]).filter(wOt)),hulls:n.cells.map((o)=>esn(o,n.pts).map((r)=>n.pts[r]).filter(wOt))};var n;this.output={pts:this.input.pts,validTris:this.input.validTris,regions:e,hulls:t,depths:this.input.depths},this.stats={regions:e.length},this.solved=!0}getConstructorParams(){return[this.input]}getOutput(){return this.output}visualize(){let e=this.output;return e?{points:e.pts.map((t)=>({x:t.x,y:t.y,color:"#3b82f6"})),lines:e.regions.flatMap((t)=>t.flatMap((n,o)=>{let r=t[(o+1)%t.length];return r?[{points:[n,r],strokeColor:"#0f766e"}]:[]})),rects:[],circles:[],texts:[{x:4,y:12,text:`regions: ${e.regions.length}`,color:"#1f2937"}]}:{points:[],lines:[],rects:[],circles:[],texts:[]}}},h3e=(e,t,n)=>{let o=Math.cos(n.ccwRotation),r=Math.sin(n.ccwRotation);return{x:n.center.x+e*o-t*r,y:n.center.y+e*r+t*o}},v5r=(e,t=[],n,o=[])=>{let r=[],{minX:i,maxX:s,minY:a,maxY:c}=e;r.push({x:i,y:a},{x:s,y:a},{x:s,y:c},{x:i,y:c});for(let l=1;l<10;l++){let h=l/10;r.push({x:i+h*(s-i),y:a}),r.push({x:s,y:a+h*(c-a)}),r.push({x:s-h*(s-i),y:c}),r.push({x:i,y:c-h*(c-a)})}for(let l of t){let h=l.diameter/2+n;for(let d=0;d<24;d++){let u=2*Math.PI*d/24;r.push({x:l.center.x+h*Math.cos(u),y:l.center.y+h*Math.sin(u)})}}for(let l of o){let h=l.width/2+n,d=l.height/2+n,u=Math.max(2,Math.ceil(Math.max(2*h,2*d)/20));for(let _=0;_<u;_++){let p=_/u;r.push(h3e(2*p*h-h,-d,l)),r.push(h3e(h,2*p*d-d,l)),r.push(h3e(h-2*p*h,d,l)),r.push(h3e(-h,d-2*p*d,l))}}return r.map((l,h)=>({x:l.x+0.000001*(h%7-3),y:l.y+0.000001*(h%5-2)}))},S5r=class extends Xle{input;output=null;constructor(e){super(),this.input=e}_step(){let e=this.input.vias??[],t=this.input.rects??[];this.output={pts:v5r(this.input.bounds,e,this.input.clearance,t)},this.stats={points:this.output.pts.length},this.solved=!0}getConstructorParams(){return[this.input]}getOutput(){return this.output}visualize(){let e=(this.output?.pts??[]).map((t)=>({x:t.x,y:t.y,color:"#2563eb"}));return{points:e,lines:[],rects:[],circles:(this.input.vias??[]).map((t)=>({center:{x:t.center.x,y:t.center.y},radius:t.diameter/2+this.input.clearance,stroke:"#ef4444"})),texts:[{x:this.input.bounds.minX+6,y:this.input.bounds.minY+12,text:`sample points: ${e.length}`,color:"#1f2937"}]}}},P5r=(e,t,n)=>{let o=n.x-t.x,r=n.y-t.y,i=o*o+r*r;if(i<0.0000000001)return Math.hypot(e.x-t.x,e.y-t.y);let s=((e.x-t.x)*o+(e.y-t.y)*r)/i;return s=Math.max(0,Math.min(1,s)),Math.hypot(e.x-t.x-s*o,e.y-t.y-s*r)},BOt=(e,t)=>{if(e.length<=3)return 0;let n=esn(e,t),o=new Set(n),r=n.map((s)=>t[s]).filter((s)=>Boolean(s)),i=0;for(let s of e){if(o.has(s))continue;let a=t[s];if(!a)continue;let c=Number.POSITIVE_INFINITY;for(let l=0;l<r.length;l++){let h=r[l],d=r[(l+1)%r.length];h&&d&&(c=Math.min(c,P5r(a,h,d)))}i=Math.max(i,c)}return i},OXe=(e,t)=>e<t?1e5*e+t:1e5*t+e,E5r=(e,t)=>{let n=e.map((d,u)=>[d,e[(u+1)%e.length]]),o=t.map((d,u)=>[d,t[(u+1)%t.length]]),r=new Set;for(let[d,u]of n)if(u!==void 0)for(let[_,p]of o)p!==void 0&&d===p&&u===_&&r.add(OXe(d,u));if(r.size===0)return null;let i=[];for(let[d,u]of n)u!==void 0&&(r.has(OXe(d,u))||i.push([d,u]));for(let[d,u]of o)u!==void 0&&(r.has(OXe(d,u))||i.push([d,u]));if(i.length===0)return null;let s=new Map;for(let[d,u]of i)s.set(d,u);let a=i[0]?.[0];if(a===void 0)return null;let c=[a],l=s.get(a),h=0;for(;l!==void 0&&l!==a&&h++<i.length+5;)c.push(l),l=s.get(l);return l!==a||c.length!==i.length?null:c},M5r=(e,t)=>e<t?1e5*e+t:1e5*t+e,w5r=class extends Xle{input;output=null;constructor(e){super(),this.input=e}_step(){let e=((t,n,o)=>{if(!t.length)return{cells:[],depths:[]};let r=t.map(([c,l,h])=>{let d=n[c],u=n[l],_=n[h];return d&&u&&_&&h$e(d,u,_)<0?[c,h,l]:[c,l,h]}),i=!0,s=0;for(;i&&s++<800;){i=!1;let c=new Map,l=r.map(()=>new Set);for(let p=0;p<r.length;p++){let m=r[p];if(m)for(let A=0;A<m.length;A++){let g=m[A],f=m[(A+1)%m.length];if(g===void 0||f===void 0)continue;let y=M5r(g,f);if(c.has(y)){let x=c.get(y);x!==void 0&&(l[p]?.add(x),l[x]?.add(p))}else c.set(y,p)}}let h=-1,d=-1,u=null,_=Number.POSITIVE_INFINITY;for(let p=0;p<r.length;p++){let m=l[p];if(m)for(let A of m){if(A<=p)continue;let g=E5r(r[p]??[],r[A]??[]);if(!g)continue;let f=BOt(g,n);f<=o+0.000001&&f<_&&(_=f,h=p,d=A,u=g)}}if(h<0||d<0||!u)break;r[h]=u,r.splice(d,1),i=!0}let a=r.map((c)=>BOt(c,n));return{cells:r,depths:a}})(this.input.validTris,this.input.pts,this.input.concavityTolerance);this.output={pts:this.input.pts,validTris:this.input.validTris,cells:e.cells,depths:e.depths},this.stats={mergedCells:e.cells.length,maxDepth:e.depths.length?Math.max(...e.depths):0},this.solved=!0}getConstructorParams(){return[this.input]}getOutput(){return this.output}visualize(){let e=this.output?.cells??[];return{points:this.input.pts.map((t)=>({x:t.x,y:t.y,color:"#3b82f6"})),lines:e.flatMap((t)=>t.flatMap((n,o)=>{let r=this.input.pts[n],i=t[(o+1)%t.length],s=i===void 0?void 0:this.input.pts[i];return r&&s?[{points:[r,s],strokeColor:"#10b981"}]:[]})),rects:[],circles:[],texts:[{x:4,y:12,text:`merged cells: ${e.length}`,color:"#1f2937"}]}}},TOt=(e,t,n)=>{let o=2*(e.x*(t.y-n.y)+t.x*(n.y-e.y)+n.x*(e.y-t.y));if(Math.abs(o)<0.0000000001)return{x:0,y:0,r2:1000000000000000000};let r=e.x*e.x+e.y*e.y,i=t.x*t.x+t.y*t.y,s=n.x*n.x+n.y*n.y,a=(r*(t.y-n.y)+i*(n.y-e.y)+s*(e.y-t.y))/o,c=(r*(n.x-t.x)+i*(e.x-n.x)+s*(t.x-e.x))/o;return{x:a,y:c,r2:(e.x-a)**2+(e.y-c)**2}},B5r=(e,t,n)=>[e.a,e.b,e.c].includes(t)&&[e.a,e.b,e.c].includes(n),T5r=(e,t,n,o=[],r,i=[])=>e.filter(([s,a,c])=>{let l=t[s],h=t[a],d=t[c];if(!l||!h||!d)return!1;return((u,_,p,m=[],A,g=[])=>{let{minX:f,maxX:y,minY:x,maxY:C}=p;if(u<f-0.1||u>y+0.1||_<x-0.1||_>C+0.1)return!1;for(let b of m){let I=b.diameter/2+A;if((u-b.center.x)**2+(_-b.center.y)**2<I*I-0.1)return!1}for(let b of g){let I=b.width/2+A,v=b.height/2+A,P=u-b.center.x,M=_-b.center.y,B=Math.cos(b.ccwRotation),T=Math.sin(b.ccwRotation),N=P*B+M*T,D=-P*T+M*B;if(Math.abs(N)<I-0.1&&Math.abs(D)<v-0.1)return!1}return!0})((l.x+h.x+d.x)/3,(l.y+h.y+d.y)/3,n,o,r,i)}),D5r=class extends Xle{input;output=null;constructor(e){super(),this.input=e}_step(){let e=this.input.vias??[],t=this.input.rects??[],n=((r)=>{let i=r.map((g,f)=>({...g,i:f}));if(i.length<3)return[];let{POSITIVE_INFINITY:s,POSITIVE_INFINITY:a,NEGATIVE_INFINITY:c,NEGATIVE_INFINITY:l}=Number;for(let g of i)s=Math.min(s,g.x),a=Math.min(a,g.y),c=Math.max(c,g.x),l=Math.max(l,g.y);let h=Math.max(c-s,l-a)||1,d=(s+c)/2,u=(a+l)/2,_={x:d-30*h,y:u-h,i:-1},p={x:d,y:u+30*h,i:-2},m={x:d+30*h,y:u-h,i:-3},A=[{a:_,b:p,c:m,cc:TOt(_,p,m)}];for(let g of i){let f=A.filter((C)=>{let b=g.x-C.cc.x,I=g.y-C.cc.y;return b*b+I*I<C.cc.r2+0.000001}),y=new Set(f),x=[];for(let C of f){let b=[[C.a,C.b],[C.b,C.c],[C.c,C.a]];for(let[I,v]of b){let P=!1;for(let M of f)if(M!==C&&B5r(M,I,v)){P=!0;break}P||x.push([I,v])}}A=A.filter((C)=>!y.has(C));for(let[C,b]of x)A.push({a:C,b,c:g,cc:TOt(C,b,g)})}return A.filter((g)=>g.a.i>=0&&g.b.i>=0&&g.c.i>=0).map((g)=>[g.a.i,g.b.i,g.c.i])})(this.input.pts),o=T5r(n,this.input.pts,this.input.bounds,e,this.input.clearance,t);this.output={pts:this.input.pts,validTris:o},this.stats={candidateTriangles:n.length,validTriangles:o.length},this.solved=!0}getConstructorParams(){return[this.input]}getOutput(){return this.output}visualize(){let e=this.output?.validTris??[];return{points:this.input.pts.map((t)=>({x:t.x,y:t.y,color:"#2563eb"})),lines:e.flatMap(([t,n,o])=>{let r=this.input.pts[t],i=this.input.pts[n],s=this.input.pts[o];return r&&i&&s?[{points:[r,i],strokeColor:"#64748b"},{points:[i,s],strokeColor:"#64748b"},{points:[s,r],strokeColor:"#64748b"}]:[]}),rects:[],circles:[],texts:[{x:this.input.bounds.minX+6,y:this.input.bounds.minY+12,text:`valid triangles: ${e.length}`,color:"#1f2937"}]}}},N5r=class extends b5r{pipelineDef=[l3e("generatePoints",S5r,(e)=>[e.inputProblem]),l3e("triangulate",D5r,(e)=>{let t=e.getStageOutput("generatePoints");if(!t)throw Error("generatePoints output missing");return[{pts:t.pts,bounds:e.inputProblem.bounds,vias:e.inputProblem.vias,rects:e.inputProblem.rects,clearance:e.inputProblem.clearance}]}),l3e("mergeCells",w5r,(e)=>{let t=e.getStageOutput("triangulate");if(!t)throw Error("triangulate output missing");return[{pts:t.pts,validTris:t.validTris,concavityTolerance:e.inputProblem.concavityTolerance}]}),l3e("buildRegions",I5r,(e)=>{let t=e.getStageOutput("mergeCells");if(!t)throw Error("mergeCells output missing");return[t]})];getConstructorParams(){return[this.inputProblem]}getOutput(){return this.getStageOutput("buildRegions")??null}visualize(){let e=this.getOutput();return e?{points:e.pts.map((t)=>({x:t.x,y:t.y,color:"#38b6ff"})),lines:e.regions.flatMap((t)=>t.map((n,o)=>{let r=t[(o+1)%t.length]??n;return{points:[{x:n.x,y:n.y},{x:r.x,y:r.y}],strokeColor:"#4ecb82"}})),rects:[],circles:(this.inputProblem.vias??[]).map((t)=>({center:{x:t.center.x,y:t.center.y},radius:t.diameter/2,stroke:"#ff6b6b"})),texts:[{x:this.inputProblem.bounds.minX+8,y:this.inputProblem.bounds.minY+16,text:`regions=${e.regions.length}`,color:"#ffffff"}]}:{points:[],lines:[],rects:[],circles:[],texts:[]}}},d$e=0.000000001,R5r=(e,t)=>{let n=[nsn(e)],o=[],r=t.maxSplitsPerRegion??32;for(;n.length>0;){let i=n.pop();if(!i)continue;if(i.length<4){o.push(i);continue}let s=Q5r(i,t);if(!s||r<=0){o.push(i);continue}let[a,c]=L5r(i,s.i,s.j);r-=1,n.push(a,c)}return o},Q5r=(e,t)=>{let n=H5r(e);if(!n)return null;let{triangles:o}=n,r=V5r(e);if(r<=d$e)return null;let i=Math.sqrt(r),s=o.map((c)=>Y5r(e[c[0]],e[c[1]],e[c[2]])),a=null;for(let c of n.internalEdges){let{i:l,j:h,triA:d,triB:u}=c,_=G5r(e[l],e[h])/i;if(_>t.maxNeckRatio)continue;let p=k5r(d,u,o.length,n.triangleAdjacency,s),m=r-p,A=Math.min(p,m)/r;if(A<t.minSplitBalanceRatio)continue;let g=_/Math.max(A,d$e);(!a||g<a.score)&&(a={i:l,j:h,score:g})}return a?{i:a.i,j:a.j}:null},k5r=(e,t,n,o,r)=>{let i=Array(n).fill(!1),s=[e];i[t]=!0;let a=0;for(;s.length>0;){let c=s.pop();if(c===void 0||i[c])continue;i[c]=!0,a+=r[c]??0;let l=o[c]??[];for(let h of l)i[h]||s.push(h)}return a},L5r=(e,t,n)=>[DOt(e,t,n),DOt(e,n,t)],DOt=(e,t,n)=>{let o=[],r=e.length,i=t;for(o.push(e[i]);i!==n;)i=(i+1)%r,o.push(e[i]);return nsn(o)},H5r=(e)=>{let t=e.length;if(t<3)return null;let n=new Set;for(let a=0;a<t;a++){let c=(a+1)%t;n.add(NOt(a,c))}let o=F5r(e);if(!o||o.length===0)return null;let r=new Map;o.forEach((a,c)=>{for(let l=0;l<3;l++){let h=a[l],d=a[(l+1)%3],u=NOt(h,d),_=r.get(u);_?_.push(c):r.set(u,[c])}});let i=Array.from({length:o.length},()=>[]),s=[];for(let[a,c]of r.entries()){if(n.has(a))continue;if(c.length!==2)continue;let[l,h]=a.split("_"),d=Number(l),u=Number(h),_=c[0],p=c[1];s.push({i:d,j:u,triA:_,triB:p});let m=i[_],A=i[p];m&&m.push(p),A&&A.push(_)}return{triangles:o,internalEdges:s,triangleAdjacency:i}},F5r=(e)=>{let t=e.length;if(t<3)return null;let n=Math.sign(tsn(e));if(n===0)return null;let o=[...Array(t).keys()];n<0&&o.reverse();let r=[],i=0;for(;o.length>3&&i<t*t;){let s=!1;for(let a=0;a<o.length;a++){let c=o[(a-1+o.length)%o.length],l=o[a],h=o[(a+1)%o.length];if(c===void 0||l===void 0||h===void 0)continue;let d=e[c],u=e[l],_=e[h];if(!d||!u||!_)continue;if(!z5r(d,u,_))continue;let p=!1;for(let m of o){if(m===c||m===l||m===h)continue;let A=e[m];if(A&&O5r(A,d,u,_)){p=!0;break}}if(!p){r.push([c,l,h]),o.splice(a,1),s=!0;break}}if(!s)return null;i+=1}if(o.length===3){let[s,a,c]=o;s!==void 0&&a!==void 0&&c!==void 0&&r.push([s,a,c])}return r},z5r=(e,t,n)=>Nce(e,t,n)>d$e,O5r=(e,t,n,o)=>{let r=Nce(t,n,e),i=Nce(n,o,e),s=Nce(o,t,e);return r>=-0.000000001&&i>=-0.000000001&&s>=-0.000000001},Nce=(e,t,n)=>(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x),tsn=(e)=>{let t=0;for(let n=0;n<e.length;n++){let o=e[n],r=e[(n+1)%e.length];o&&r&&(t+=o.x*r.y-r.x*o.y)}return t/2},V5r=(e)=>Math.abs(tsn(e)),Y5r=(e,t,n)=>Math.abs(Nce(e,t,n))/2,G5r=(e,t)=>Math.hypot(e.x-t.x,e.y-t.y),NOt=(e,t)=>e<t?`${e}_${t}`:`${t}_${e}`,nsn=(e)=>{if(e.length<2)return e;let t=e[0],n=e[e.length-1];return t&&n&&t.x===n.x&&t.y===n.y?e.slice(0,-1):e},w3={pattern:"grid",pitchX:2.2,pitchY:1.8,staggerAxis:"x",staggerOffset:1.1,staggerOffsetX:1.1,padWidth:0.9,padHeight:1,padGap:0.35,viaDiameter:0.3,clearance:0.2,concavityTolerance:0.3,boundsPadding:1.2,orientation:"horizontal",portSpacing:0.25,maxNeckRatio:0,minSplitBalanceRatio:0.2},U5r=(e,t)=>{let{POSITIVE_INFINITY:n,POSITIVE_INFINITY:o,NEGATIVE_INFINITY:r,NEGATIVE_INFINITY:i}=Number;for(let s of e)for(let a of s.padCenters){let c=t.orientation==="horizontal"?t.padWidth/2:t.padHeight/2,l=t.orientation==="horizontal"?t.padHeight/2:t.padWidth/2;a.x-c<n&&(n=a.x-c),a.y-l<o&&(o=a.y-l),a.x+c>r&&(r=a.x+c),a.y+l>i&&(i=a.y+l)}return{minX:n-t.boundsPadding,minY:o-t.boundsPadding,maxX:r+t.boundsPadding,maxY:i+t.boundsPadding}},W5r=(e)=>e.pattern==="staggered"?((t)=>{let n=[],o=[],r=t.padGap/2+t.padWidth/2,i=-(t.cols-1)*t.pitchX/2,s=-(t.rows-1)*t.pitchY/2;for(let a=0;a<t.rows;a++){let c=t.staggerAxis==="x"&&a%2==1?t.staggerOffset:0;for(let l=0;l<t.cols;l++){let h=t.staggerAxis==="y"&&l%2==1?t.staggerOffset:0,d={x:i+l*t.pitchX+c,y:s+a*t.pitchY+h},u=t.orientation==="horizontal"?{x:d.x-r,y:d.y}:{x:d.x,y:d.y-r},_=t.orientation==="horizontal"?{x:d.x+r,y:d.y}:{x:d.x,y:d.y+r};n.push({jumperId:`jumper_r${a}_c${l}`,center:d,orientation:t.orientation,padCenters:[u,_]}),o.push({center:u,diameter:t.viaDiameter},{center:_,diameter:t.viaDiameter})}}return{jumpers:n,vias:o,bounds:U5r(n,t)}})(e):((t)=>{let n=[],o=[],r=t.padGap/2+t.padWidth/2,i=-(t.cols-1)*t.pitchX/2,s=-(t.rows-1)*t.pitchY/2;for(let a=0;a<t.rows;a++)for(let c=0;c<t.cols;c++){let l={x:i+c*t.pitchX,y:s+a*t.pitchY},h=t.orientation==="horizontal"?{x:l.x-r,y:l.y}:{x:l.x,y:l.y-r},d=t.orientation==="horizontal"?{x:l.x+r,y:l.y}:{x:l.x,y:l.y+r},u=`jumper_r${a}_c${c}`;n.push({jumperId:u,center:l,orientation:t.orientation,padCenters:[h,d]}),o.push({center:h,diameter:t.viaDiameter},{center:d,diameter:t.viaDiameter})}return{jumpers:n,vias:o,bounds:{minX:i-r-t.padWidth/2-t.boundsPadding,maxX:i+(t.cols-1)*t.pitchX+r+t.padWidth/2+t.boundsPadding,minY:s-r-t.padHeight/2-t.boundsPadding,maxY:s+(t.rows-1)*t.pitchY+r+t.padHeight/2+t.boundsPadding}}})(e),osn=(e)=>({x:(e.minX+e.maxX)/2,y:(e.minY+e.maxY)/2}),VXe=(e)=>[{x:e.minX,y:e.minY},{x:e.maxX,y:e.minY},{x:e.maxX,y:e.maxY},{x:e.minX,y:e.maxY}],YQ=(e,t,n)=>Math.abs(e-t)<=n,d3e=(e,t,n)=>YQ(e.x,t.x,n)&&YQ(e.y,t.y,n),X5r=(e)=>e.map((t,n)=>{let o=((r)=>{let{POSITIVE_INFINITY:i,POSITIVE_INFINITY:s,NEGATIVE_INFINITY:a,NEGATIVE_INFINITY:c}=Number;for(let l of r)l.x<i&&(i=l.x),l.y<s&&(s=l.y),l.x>a&&(a=l.x),l.y>c&&(c=l.y);return{minX:i,minY:s,maxX:a,maxY:c}})(t);return{regionId:`top_${n}`,ports:[],d:{bounds:o,center:osn(o),polygon:t,isPad:!1}}}),j5r=(e)=>{let t=e.end.x-e.start.x,n=e.end.y-e.start.y;return Math.hypot(t,n)},Eq=(e,t)=>({x:e.start.x+(e.end.x-e.start.x)*t,y:e.start.y+(e.end.y-e.start.y)*t}),ROt=(e,t,n)=>{let o=[];if(!e.d.polygon||!t.d.polygon)return o;for(let r=0;r<e.d.polygon.length;r++){let i=e.d.polygon[r],s=e.d.polygon[(r+1)%e.d.polygon.length];if(i&&s)for(let a=0;a<t.d.polygon.length;a++){let c=t.d.polygon[a],l=t.d.polygon[(a+1)%t.d.polygon.length];if(!c||!l)continue;let h=J5r({start:i,end:s},{start:c,end:l},n);if(!h)continue;o.some((d)=>q5r(d,h,n))||o.push(h)}}return o},K5r=(e,t)=>{let n=[];for(let o of e){let r=o,i=!0;for(;i;){i=!1;for(let s=0;s<n.length;s++){let a=n[s];if(!a)continue;let c=$5r(r,a,t);if(c){r=c,n.splice(s,1),i=!0;break}}}n.push(r)}return n},$5r=(e,t,n)=>{let o=e.end.x-e.start.x,r=e.end.y-e.start.y,i=t.end.x-t.start.x,s=t.end.y-t.start.y,a=o**2+r**2;if(a<=n**2)return null;if(!YQ(o*s-r*i,0,n))return null;let c=t.start.x-e.start.x,l=t.start.y-e.start.y,h=t.end.x-e.start.x,d=t.end.y-e.start.y,u=o*d-r*h;if(!YQ(o*l-r*c,0,n)||!YQ(u,0,n))return null;let _=(c*o+l*r)/a,p=(h*o+d*r)/a,m=Math.min(_,p),A=Math.max(_,p),g=n/Math.sqrt(a);if(m>1+g||A<0-g)return null;let f=Math.min(0,m),y=Math.max(1,A);return{start:Eq(e,f),end:Eq(e,y)}},q5r=(e,t,n)=>d3e(e.start,t.start,n)&&d3e(e.end,t.end,n)||d3e(e.start,t.end,n)&&d3e(e.end,t.start,n),J5r=(e,t,n)=>{let o=e.end.x-e.start.x,r=e.end.y-e.start.y,i=t.end.x-t.start.x,s=t.end.y-t.start.y,a=o**2+r**2;if(a<=n**2)return null;if(!YQ(o*s-r*i,0,n))return null;let c=t.start.x-e.start.x,l=t.start.y-e.start.y,h=t.end.x-e.start.x,d=t.end.y-e.start.y,u=o*d-r*h;if(!YQ(o*l-r*c,0,n)||!YQ(u,0,n))return null;let _=(c*o+l*r)/a,p=(h*o+d*r)/a,m=Math.max(0,Math.min(_,p)),A=Math.min(1,Math.max(_,p));return A-m<=n/Math.sqrt(a)?null:{start:Eq(e,m),end:Eq(e,A)}},Z5r=(e,t,n)=>{let o=Math.max(e.minX,t.minX),r=Math.min(e.maxX,t.maxX),i=Math.max(e.minY,t.minY),s=Math.min(e.maxY,t.maxY);return r<o-n||s<i-n?null:{minX:o,maxX:r,minY:i,maxY:s}},e4r=(e)=>{let t=((p)=>{let m=p.orientation??w3.orientation,A=p.staggerAxis??w3.staggerAxis,g=p.padWidth??w3.padWidth,f=p.padHeight??w3.padHeight,y=p.padGap??w3.padGap,x=p.clearance??w3.clearance,C=p.colSpacing??p.pitchX??w3.pitchX,b=p.rowSpacing??p.pitchY??w3.pitchY,I=(v=g,P=f,M=y,m==="horizontal"?{x:M+2*v,y:P}:{x:P,y:M+2*v});var v,P,M;let B=x,T=((L,H,V,O,U)=>L==="horizontal"?H==="x"?U+2*V:O:H==="x"?O:U+2*V)(m,A,g,f,y)/2,N=p.staggerOffset??p.staggerOffsetX??T,D={...w3,...p,orientation:m,staggerAxis:A,pitchX:Math.max(C,I.x+B),pitchY:Math.max(b,I.y+B),padWidth:g,padHeight:f,padGap:y,staggerOffset:N,staggerOffsetX:N,concavityTolerance:p.concavityTolerance??w3.concavityTolerance,clearance:x,portSpacing:p.portSpacing??w3.portSpacing,maxNeckRatio:p.maxNeckRatio??w3.maxNeckRatio,minSplitBalanceRatio:p.minSplitBalanceRatio??w3.minSplitBalanceRatio};if(D.cols<=0||D.rows<=0)throw Error("rows and cols must be > 0");if(!Number.isFinite(D.portSpacing)||D.portSpacing<=0)throw Error("portSpacing must be > 0");if(!Number.isFinite(D.maxNeckRatio)||D.maxNeckRatio<0)throw Error("maxNeckRatio must be >= 0");if(!Number.isFinite(D.minSplitBalanceRatio)||D.minSplitBalanceRatio<0||D.minSplitBalanceRatio>0.5)throw Error("minSplitBalanceRatio must be between 0 and 0.5");return D})(e),n=W5r(t),o=t.orientation==="horizontal"?t.padWidth:t.padHeight,r=t.orientation==="horizontal"?t.padHeight:t.padWidth,i=n.jumpers.flatMap((p)=>p.padCenters.map((m)=>({center:m,width:o,height:r,ccwRotation:0}))),s=new N5r({bounds:n.bounds,rects:i,clearance:0,concavityTolerance:t.concavityTolerance});s.solve();let a=s.getOutput();if(!a)throw Error(s.error??"ConvexRegionsSolver failed");let c=((p,m)=>{if(m.maxNeckRatio<=0)return p;let A=[];for(let g of p)A.push(...R5r(g,m));return A})(a.regions,{maxNeckRatio:t.maxNeckRatio,minSplitBalanceRatio:t.minSplitBalanceRatio}),l=X5r(c),h=((p,m)=>p.flatMap((A)=>{let[g,f]=A.padCenters,y=m.orientation==="horizontal"?m.padWidth/2:m.padHeight/2,x=m.orientation==="horizontal"?m.padHeight/2:m.padWidth/2,C={minX:g.x-y,maxX:g.x+y,minY:g.y-x,maxY:g.y+x},b={minX:f.x-y,maxX:f.x+y,minY:f.y-x,maxY:f.y+x},I=y/2,v=x/2,P=m.orientation==="horizontal"?{minX:Math.min(g.x,f.x),maxX:Math.max(g.x,f.x),minY:A.center.y-v,maxY:A.center.y+v}:{minX:A.center.x-I,maxX:A.center.x+I,minY:Math.min(g.y,f.y),maxY:Math.max(g.y,f.y)};return[{regionId:`${A.jumperId}_pad1`,ports:[],d:{bounds:C,center:g,polygon:VXe(C),isPad:!0,isThroughJumper:!1}},{regionId:`${A.jumperId}_bridge`,ports:[],d:{bounds:P,center:A.center,polygon:VXe(P),isPad:!1,isThroughJumper:!0}},{regionId:`${A.jumperId}_pad2`,ports:[],d:{bounds:b,center:f,polygon:VXe(b),isPad:!0,isThroughJumper:!1}}]}))(n.jumpers,{orientation:t.orientation,padWidth:t.padWidth,padHeight:t.padHeight}),d=((p,m,A=0.00001)=>{let g=[],f=0;for(let y=0;y<p.length;y++){let x=p[y];if(x?.d.polygon)for(let C=y+1;C<p.length;C++){let b=p[C];if(!b?.d.polygon)continue;let I=ROt(x,b,A);for(let v of I){let P=j5r(v),M=Math.floor(P/m),B=Math.max(1,M-1);for(let T=0;T<B;T++){let N=Eq(v,(T+1)/(B+1));g.push({portId:"tp_"+f++,region1:x,region2:b,d:{x:N.x,y:N.y}})}}}}return g})(l,t.portSpacing),u=((p,m,A=0.00001)=>{let g=[],f=0,y=0,x=p.filter((b)=>b.d.isPad),C=p.filter((b)=>b.d.isThroughJumper&&!b.d.isPad);for(let b of x)for(let I of m){let v=ROt(b,I,A),P=K5r(v,A);for(let M of P){let B=Eq(M,0.5);g.push({portId:"jp_"+f++,region1:b,region2:I,d:{x:B.x,y:B.y}})}}for(let b of C)for(let I of x){let v=Z5r(b.d.bounds,I.d.bounds,A);if(!v)continue;let P=osn(v);g.push({portId:"jip_"+y++,region1:I,region2:b,d:{x:P.x,y:P.y}})}return g})(h,l),_=[...d,...u];return((p)=>{for(let m of p)m.region1.ports.push(m),m.region2.ports.push(m)})(_),{regions:[...l,...h],ports:_,jumperLocations:n.jumpers.map((p,m)=>({center:p.center,orientation:p.orientation,padRegions:[h[3*m],h[3*m+2]].filter((A)=>Boolean(A))})),topLayerRegions:l,jumperRegions:h,jumpers:n.jumpers,vias:n.vias,bounds:n.bounds}},t4r=class extends ei{getSolverName(){return"JumperPrepatternSolver2_HyperGraph"}constructorParams;nodeWithPortPoints;colorMap;traceWidth;obstacleMargin;hyperParameters;jumperGraphSolver=null;xyConnections=[];graphBounds=null;jumperLocations=[];solvedRoutes=[];jumpers=[];phase="jumperGraph";curvySolvers=[];currentCurvySolverIndex=0;routeInfos=[];regionCurvedPaths=new Map;constructor(e){super(),this.constructorParams=e,this.nodeWithPortPoints=e.nodeWithPortPoints,this.colorMap=e.colorMap??{},this.traceWidth=e.traceWidth??0.15,this.obstacleMargin=e.obstacleMargin??0.15,this.hyperParameters=e.hyperParameters??{},this.MAX_ITERATIONS=1e6,Object.keys(this.colorMap).length===0&&(this.colorMap=this._buildColorMap())}getConstructorParams(){return this.constructorParams}_buildColorMap(){let e=["#e6194b","#3cb44b","#ffe119","#4363d8","#f58231","#911eb4","#46f0f0","#f032e6","#bcf60c","#fabebe"],t={},n=new Set;for(let r of this.nodeWithPortPoints.portPoints)n.add(r.connectionName);let o=0;for(let r of Array.from(n))t[r]=e[o%e.length],o++;return t}_normalizeRegionPolygonsToBounds(e){for(let t of e.regions){let n=t.d,o=n?.polygon,r=n?.bounds;if(!o||o.length===0||!r)continue;let i=1/0,s=1/0;for(let l of o)i=Math.min(i,l.x),s=Math.min(s,l.y);let a=r.minX-i,c=r.minY-s;(Math.abs(a)>0.000000000001||Math.abs(c)>0.000000000001)&&(n.polygon=o.map((l)=>({x:l.x+a,y:l.y+c}))),n.polygonPerimeterCache&&(n.polygonPerimeterCache=void 0)}return e}_getPatternConfig(){return{cols:this.hyperParameters.COLS??1,rows:this.hyperParameters.ROWS??1}}_generate0603Grid(e,t,n,o){let r=t==="horizontal"?e.rows:e.cols,i=t==="horizontal"?e.cols:e.rows,s=o.maxX-o.minX,a=o.maxY-o.minY,l=this.hyperParameters.TRACE_CHANNELS_BETWEEN_JUMPERS??1,h=this.traceWidth*l+2*this.obstacleMargin,d=t==="horizontal"?2.15:1,u=t==="horizontal"?1:2.15,_=t==="horizontal"?"x":"y",p=n==="staggered",m=p&&_==="x"?d/2:p?u/2:0,A=Math.max(0,s-1),g=Math.max(0,a-1),f=Math.max(0,A-(p&&_==="x"?m:0)),y=Math.max(0,g-(p&&_==="y"?m:0)),x=r>1?Math.max(d+h,(f-d)/(r-1)):d,C=i>1?Math.max(u+h,(y-u)/(i-1)):u,b=e4r({cols:r,rows:i,orientation:t,pattern:n,staggerAxis:_,colSpacing:x,rowSpacing:C,padWidth:0.9,padHeight:1,padGap:0.35,clearance:h,boundsPadding:0,maxNeckRatio:0.4,minSplitBalanceRatio:0.2}),I=b.bounds,v=(I.minX+I.maxX)/2,P=(I.minY+I.maxY)/2,M=DV((o.minX+o.maxX)/2-v,(o.minY+o.maxY)/2-P);return this._normalizeRegionPolygonsToBounds(bin(b,M))}_initializeGraph(){let e=this.nodeWithPortPoints,t=this._getPatternConfig(),n=this.hyperParameters.ORIENTATION??"vertical",o=this.hyperParameters.JUMPER_TYPE??"1206x4",r=this.hyperParameters.PATTERN??"grid",i={minX:e.center.x-e.width/2,maxX:e.center.x+e.width/2,minY:e.center.y-e.height/2,maxY:e.center.y+e.height/2},s;if(this.graphBounds=i,o==="0603"){let l=this._generate0603Grid(t,n,r,i);if(!l)return this.error=`0603 grid (${t.cols}x${t.rows}) is too large to fit in node bounds`,this.failed=!0,!1;s=l}else s=Nxr({cols:t.cols,rows:t.rows,marginX:Math.max(1.2,0.3*t.cols),marginY:Math.max(1.2,0.3*t.rows),outerPaddingX:0.4,outerPaddingY:0.4,parallelTracesUnderJumperCount:2,innerColChannelPointCount:3,innerRowChannelPointCount:3,outerChannelXPointCount:3,outerChannelYPointCount:3,regionsBetweenPads:!0,orientation:n,bounds:i});if(s.regions.length>0){let l=1/0,h=-1/0,d=1/0,u=-1/0;for(let p of s.regions){if(!p.d?.isPad)continue;let m=p.d?.bounds;m&&(l=Math.min(l,m.minX),h=Math.max(h,m.maxX),d=Math.min(d,m.minY),u=Math.max(u,m.maxY))}let _=o==="0603"?0.5:1;if(l-_<i.minX||h+_>i.maxX||d-_<i.minY||u+_>i.maxY)return this.error=`baseGraph bounds (${l.toFixed(2)}, ${d.toFixed(2)}, ${h.toFixed(2)}, ${u.toFixed(2)}) exceed node bounds (${i.minX.toFixed(2)}, ${i.minY.toFixed(2)}, ${i.maxX.toFixed(2)}, ${i.maxY.toFixed(2)})`,this.failed=!0,!1}this.jumperLocations=s.jumperLocations?.map((l)=>({center:l.center,orientation:l.orientation,padRegions:l.padRegions}))??[];let a=new Map;for(let l of e.portPoints){let h=a.get(l.connectionName);h?h.points.push(l):a.set(l.connectionName,{points:[l],rootConnectionName:l.rootConnectionName})}this.xyConnections=[];for(let[l,h]of Array.from(a.entries()))h.points.length<2||this.xyConnections.push({start:{x:h.points[0].x,y:h.points[0].y},end:{x:h.points[1].x,y:h.points[1].y},connectionId:l});if(this.xyConnections.length===0)return this.solved=!0,!0;let c=((l,h)=>{let d=[...l.regions],u=[...l.ports],_=[],p=Cin(l.regions);for(let m of h){let{start:A,end:g,connectionId:f}=m,y=oOt(`conn:${f}:start`,A.x,A.y);d.push(y);let x=oOt(`conn:${f}:end`,g.x,g.y);d.push(x);let C=iOt(A.x,A.y,l.regions,p);if(C){let v=nOt(`conn:${f}:start-port`,y,C.region,C.portPosition);u.push(v)}let b=iOt(g.x,g.y,l.regions,p);if(b){let v=nOt(`conn:${f}:end-port`,x,b.region,b.portPosition);u.push(v)}let I={connectionId:f,mutuallyConnectedNetworkId:f,startRegion:y,endRegion:x};_.push(I)}return{regions:d,ports:u,connections:_}})(s,this.xyConnections);return this.jumperGraphSolver=new Txr({inputGraph:{regions:c.regions,ports:c.ports},inputConnections:c.connections}),this.jumperGraphSolver.MAX_ITERATIONS*=3,!0}_step(){switch(this.phase){case"jumperGraph":this._stepJumperGraph();break;case"curvyTrace":this._stepCurvyTrace();break;case"done":this.solved=!0}}_stepJumperGraph(){if(!this.jumperGraphSolver){if(this._initializeGraph(),this.solved)return;if(!this.jumperGraphSolver)return void(this.failed=!0)}this.activeSubSolver=this.jumperGraphSolver,this.jumperGraphSolver.step(),this.jumperGraphSolver.solved?(this._initializeCurvyTraceSolvers(),this.curvySolvers.length>0?this.phase="curvyTrace":(this._finalizeCurvyTraceResults(),this.phase="done",this.solved=!0)):this.jumperGraphSolver.failed&&(this.error=this.jumperGraphSolver.error,this.failed=!0)}_stepCurvyTrace(){if(this.currentCurvySolverIndex>=this.curvySolvers.length)return this._finalizeCurvyTraceResults(),this.phase="done",void(this.solved=!0);let e=this.curvySolvers[this.currentCurvySolverIndex],t=e.solver;if(this.activeSubSolver=t,t.step(),t.solved){let n=e.regionId;this.regionCurvedPaths.has(n)||this.regionCurvedPaths.set(n,new Map);for(let o of t.outputTraces){let r=o.networkId??"",i=o.points.map((a)=>({x:a.x,y:a.y})),s={path:i,start:i[0]??{x:0,y:0},end:i[i.length-1]??{x:0,y:0}};this.regionCurvedPaths.get(n).has(r)||this.regionCurvedPaths.get(n).set(r,[]),this.regionCurvedPaths.get(n).get(r).push(s)}this.currentCurvySolverIndex++}else t.failed&&this.currentCurvySolverIndex++}_initializeCurvyTraceSolvers(){if(!this.jumperGraphSolver)return;let e=new Set,t=[];for(let o of this.jumperLocations)for(let r of o.padRegions){let i=r.d.bounds,s=r.d.center;t.push({minX:i.minX,minY:i.minY,maxX:i.maxX,maxY:i.maxY,center:{x:s.x,y:s.y},networkIds:[]})}let n=new Map;for(let o=0;o<this.jumperGraphSolver.solvedRoutes.length;o++){let r=this.jumperGraphSolver.solvedRoutes[o],i=r.connection.connectionId,s=this.nodeWithPortPoints.portPoints.find((d)=>d.connectionName===i)?.rootConnectionName,a=[],c=[],l=null,h=null;for(let d=0;d<r.path.length;d++){let u=r.path[d],{port:_,lastRegion:p}=u,{region1:m,region2:A}=_,g;if(p)m&&m.regionId!==p.regionId?g=m:A&&A.regionId!==p.regionId&&(g=A);else{let f=r.path[d+1],y=f?.lastRegion;if(y&&(m&&m.regionId===y.regionId?g=m:A&&A.regionId===y.regionId&&(g=A)),!g){let x=(C)=>C?.regionId?.startsWith("conn:");g=!m||x(m)||m.d?.isPad||m.d?.isThroughJumper?!A||x(A)||A.d?.isPad||A.d?.isThroughJumper?!m||m.d?.isPad||m.d?.isThroughJumper?(!A||A.d?.isPad||A.d?.isThroughJumper)&&m||A:m:A:m}}if(g&&(!l||g.regionId!==l.regionId)){if(l&&h){c.push({regionId:l.regionId,region:l,entryPort:h,exitPort:_});let f=l.regionId;n.has(f)||n.set(f,[]),n.get(f).push({regionId:l.regionId,region:l,routeIndex:o,connectionName:i,rootConnectionName:s,entryPort:h,exitPort:_})}l=g,h=_}if(p?.d?.isThroughJumper&&!e.has(p.regionId)){e.add(p.regionId);let f=p.d.bounds,y=p.d.center,x=f.maxX-f.minX>f.maxY-f.minY,C=(this.hyperParameters.JUMPER_TYPE??"1206x4")==="0603"?"0603":"1206x4_pair";x?a.push({route_type:"jumper",start:{x:f.minX,y:y.y},end:{x:f.maxX,y:y.y},footprint:C}):a.push({route_type:"jumper",start:{x:y.x,y:f.minY},end:{x:y.x,y:f.maxY},footprint:C})}}if(l&&h){let d=r.path[r.path.length-1];c.push({regionId:l.regionId,region:l,entryPort:h,exitPort:d?.port||null})}this.routeInfos.push({connectionId:i,rootConnectionName:s,jumpers:a,traversals:c})}for(let o=0;o<this.routeInfos.length;o++){let r=this.routeInfos[o],i=r.rootConnectionName??r.connectionId;for(let s of r.jumpers){let a=[s.start,s.end];for(let c of a)for(let l of t){let h=Math.abs(l.center.x-c.x),d=Math.abs(l.center.y-c.y);h<0.1&&d<0.1&&(l.networkIds.includes(i)||l.networkIds.push(i))}}}for(let[o,r]of n){if(r.length===0)continue;let i=r[0].region;if(i.d.isPad||i.d.isThroughJumper)continue;let s=i.d.bounds,a=[];for(let u of r)a.push({start:{x:u.entryPort.d.x,y:u.entryPort.d.y},end:{x:u.exitPort.d.x,y:u.exitPort.d.y},networkId:u.rootConnectionName??u.connectionName});let c=0.01,l=t.filter((u)=>u.minX<=s.maxX+c&&u.maxX>=s.minX-c&&u.minY<=s.maxY+c&&u.maxY>=s.minY-c).map((u)=>{let _=r.map((m)=>m.rootConnectionName??m.connectionName),p=u.networkIds.find((m)=>_.includes(m));return{minX:u.minX,minY:u.minY,maxX:u.maxX,maxY:u.maxY,center:u.center,networkId:p}}),h={bounds:s,waypointPairs:a,obstacles:l,preferredTraceToTraceSpacing:2*this.traceWidth,preferredObstacleToTraceSpacing:2*this.traceWidth},d=new din(h);this.curvySolvers.push({solver:d,regionId:o,traversals:r.map((u)=>({routeIndex:u.routeIndex,connectionName:u.connectionName,rootConnectionName:u.rootConnectionName}))})}}_finalizeCurvyTraceResults(){let e=(t,n)=>Math.sqrt((t.x-n.x)**2+(t.y-n.y)**2);for(let t=0;t<this.routeInfos.length;t++){let n=this.routeInfos[t],o=[];for(let r of n.traversals){let i=r.regionId,s=n.rootConnectionName??n.connectionId,a=this.regionCurvedPaths.get(i)?.get(s),c=null;if(a&&a.length>0){let l={x:r.entryPort.d.x,y:r.entryPort.d.y},h=r.exitPort?{x:r.exitPort.d.x,y:r.exitPort.d.y}:null,d=null,u=1/0;for(let _ of a){let p=e(_.start,l)+(h?e(_.end,h):0);p<u&&(u=p,d=_)}d&&u<0.5&&(c=d.path)}if(c&&c.length>0)for(let l=o.length>0?1:0;l<c.length;l++)o.push({x:c[l].x,y:c[l].y,z:0});else o.length===0&&o.push({x:r.entryPort.d.x,y:r.entryPort.d.y,z:0}),r.exitPort&&o.push({x:r.exitPort.d.x,y:r.exitPort.d.y,z:0})}this.solvedRoutes.push({connectionName:n.connectionId,rootConnectionName:n.rootConnectionName,traceThickness:this.traceWidth,route:o,jumpers:n.jumpers})}}getOutput(){return this.solvedRoutes}getOutputJumpers(){if(this.jumpers.length>0)return this.jumpers;let e=new Map;for(let o of this.solvedRoutes)for(let r of o.jumpers){let i=[r.start,r.end];for(let s of i){let a=`${s.x.toFixed(3)},${s.y.toFixed(3)}`,c=e.get(a)??[];o.rootConnectionName&&!c.includes(o.rootConnectionName)&&c.push(o.rootConnectionName),c.includes(o.connectionName)||c.push(o.connectionName),e.set(a,c)}}let t=this.hyperParameters.JUMPER_TYPE??"1206x4",n=QV[t==="0603"?"0603":"1206x4_pair"];for(let o of this.jumperLocations){let r=o.orientation==="horizontal",i=o.padRegions.map((a)=>{let c=a.d.bounds,l=a.d.center,h=c.maxX-c.minX,d=c.maxY-c.minY,u=`${l.x.toFixed(3)},${l.y.toFixed(3)}`;return{type:"rect",center:l,width:h,height:d,layers:["top"],connectedTo:[...e.get(u)??[]]}}),s={jumper_footprint:t,center:o.center,orientation:o.orientation,width:r?n.length:n.width,height:r?n.width:n.length,pads:i};this.jumpers.push(s)}return this.jumpers=this.jumpers.filter((o)=>o.pads.some((r)=>r.connectedTo.length>0)),this.jumpers}visualize(){if(this.jumperGraphSolver&&!this.solved)return this.jumperGraphSolver.visualize();let e={lines:[],points:[],rects:[],circles:[]},t=this.nodeWithPortPoints,n={minX:t.center.x-t.width/2,maxX:t.center.x+t.width/2,minY:t.center.y-t.height/2,maxY:t.center.y+t.height/2};e.lines.push({points:[{x:n.minX,y:n.minY},{x:n.maxX,y:n.minY},{x:n.maxX,y:n.maxY},{x:n.minX,y:n.maxY},{x:n.minX,y:n.minY}],strokeColor:"rgba(255, 0, 0, 0.25)",strokeDash:"4 4",layer:"border"});for(let o of t.portPoints)e.points.push({x:o.x,y:o.y,label:o.connectionName,color:this.colorMap[o.connectionName]??"blue"});for(let o of this.solvedRoutes){let r=this.colorMap[o.connectionName]??"blue";for(let i=0;i<o.route.length-1;i++){let s=o.route[i],a=o.route[i+1];e.lines.push({points:[s,a],strokeColor:zi(r,0.2),strokeWidth:o.traceThickness,layer:"route-layer-0"})}for(let i of o.jumpers)this._drawJumperPads(e,i,zi(r,0.5))}return e}_drawJumperPads(e,t,n){let o=QV[t.footprint],r=t.end.x-t.start.x,i=t.end.y-t.start.y,s=Math.abs(r)>Math.abs(i),a=s?o.padLength:o.padWidth,c=s?o.padWidth:o.padLength;e.rects.push({center:{x:t.start.x,y:t.start.y},width:a,height:c,fill:n,stroke:"rgba(0, 0, 0, 0.5)",layer:"jumper"}),e.rects.push({center:{x:t.end.x,y:t.end.y},width:a,height:c,fill:n,stroke:"rgba(0, 0, 0, 0.5)",layer:"jumper"}),e.lines.push({points:[t.start,t.end],strokeColor:"rgba(100, 100, 100, 0.8)",strokeWidth:0.3*o.padWidth,layer:"jumper-body"})}},n4r=class extends ybe{constructorParams;nodeWithPortPoints;colorMap;traceWidth;obstacleMargin;connMap;baseHyperParameters;availableJumperTypes;solvedRoutes=[];jumpers=[];constructor(e){super(),this.constructorParams=e,this.nodeWithPortPoints=e.nodeWithPortPoints,this.colorMap=e.colorMap??{},this.traceWidth=e.traceWidth??0.15,this.obstacleMargin=e.obstacleMargin??0.15,this.connMap=e.connMap,this.baseHyperParameters=e.hyperParameters??{},this.availableJumperTypes=e.availableJumperTypes??["0603"],this.MAX_ITERATIONS=1e6,this.GREEDY_MULTIPLIER=1,this.MIN_SUBSTEPS=1000}getConstructorParams(){return this.constructorParams}getHyperParameterDefs(){let e=[],t=this.nodeWithPortPoints,n=this.calculateMax0603ConfigWithTraceChannels(t.width,t.height,"vertical",1);e.push({name:"0603_max_rows_and_cols_vert_1trace_grid",possibleValues:[{JUMPER_TYPE:"0603",COLS:n.cols,ROWS:n.rows,ORIENTATION:"vertical",PATTERN:"grid",TRACE_CHANNELS_BETWEEN_JUMPERS:1}]});let o=this.calculateMax0603ConfigWithTraceChannels(t.width,t.height,"vertical",1,"staggered");e.push({name:"0603_max_rows_and_cols_vert_1trace_staggered",possibleValues:[{JUMPER_TYPE:"0603",COLS:o.cols,ROWS:o.rows,ORIENTATION:"vertical",PATTERN:"staggered",TRACE_CHANNELS_BETWEEN_JUMPERS:1}]});let r=this.calculateMax0603ConfigWithTraceChannels(t.width,t.height,"vertical",2);e.push({name:"0603_max_rows_and_cols_vert_2trace_grid",possibleValues:[{JUMPER_TYPE:"0603",COLS:r.cols,ROWS:r.rows,ORIENTATION:"vertical",PATTERN:"grid",TRACE_CHANNELS_BETWEEN_JUMPERS:2}]});let i=this.calculateMax0603ConfigWithTraceChannels(t.width,t.height,"vertical",2,"staggered");e.push({name:"0603_max_rows_and_cols_vert_2trace_staggered",possibleValues:[{JUMPER_TYPE:"0603",COLS:i.cols,ROWS:i.rows,ORIENTATION:"vertical",PATTERN:"staggered",TRACE_CHANNELS_BETWEEN_JUMPERS:2}]});let s=this.calculateMax0603ConfigWithTraceChannels(t.width,t.height,"horizontal",1);e.push({name:"0603_max_rows_and_cols_horz_1trace_grid",possibleValues:[{JUMPER_TYPE:"0603",COLS:s.cols,ROWS:s.rows,ORIENTATION:"horizontal",PATTERN:"grid",TRACE_CHANNELS_BETWEEN_JUMPERS:1}]});let a=this.calculateMax0603ConfigWithTraceChannels(t.width,t.height,"horizontal",1,"staggered");e.push({name:"0603_max_rows_and_cols_horz_1trace_staggered",possibleValues:[{JUMPER_TYPE:"0603",COLS:a.cols,ROWS:a.rows,ORIENTATION:"horizontal",PATTERN:"staggered",TRACE_CHANNELS_BETWEEN_JUMPERS:1}]});let c=this.calculateMax0603ConfigWithTraceChannels(t.width,t.height,"horizontal",2);e.push({name:"0603_max_rows_and_cols_horz_2trace_grid",possibleValues:[{JUMPER_TYPE:"0603",COLS:c.cols,ROWS:c.rows,ORIENTATION:"horizontal",PATTERN:"grid",TRACE_CHANNELS_BETWEEN_JUMPERS:2}]});let l=this.calculateMax0603ConfigWithTraceChannels(t.width,t.height,"horizontal",2,"staggered");return e.push({name:"0603_max_rows_and_cols_horz_2trace_staggered",possibleValues:[{JUMPER_TYPE:"0603",COLS:l.cols,ROWS:l.rows,ORIENTATION:"horizontal",PATTERN:"staggered",TRACE_CHANNELS_BETWEEN_JUMPERS:2}]}),e.push({name:"1206x4",possibleValues:[{JUMPER_TYPE:"1206x4"}]}),e.push({name:"1206x4_cols",possibleValues:[1,2,3,4,6,8,10].map((h)=>({COLS:h}))}),e.push({name:"1206x4_rows",possibleValues:[1,2,3,4,8].map((h)=>({ROWS:h}))}),e.push({name:"orientation",possibleValues:[{ORIENTATION:"vertical"},{ORIENTATION:"horizontal"}]}),e}isValidCombination(e){let{JUMPER_TYPE:t,COLS:n,ROWS:o}=e,r=[1,2,4,6,8],i=[1,2,3,4,6,8,10],s=[1,2,3,4,8];return t==="0603"?r.includes(n)&&r.includes(o):t==="1206x4"&&(i.includes(n)&&s.includes(o))}getCombinationDefs(){return[["0603_max_rows_and_cols_vert_1trace_grid"],["0603_max_rows_and_cols_vert_1trace_staggered"],["0603_max_rows_and_cols_horz_1trace_grid"],["0603_max_rows_and_cols_horz_1trace_staggered"],["0603_max_rows_and_cols_vert_2trace_grid"],["0603_max_rows_and_cols_vert_2trace_staggered"],["0603_max_rows_and_cols_horz_2trace_grid"],["0603_max_rows_and_cols_horz_2trace_staggered"],["1206x4","1206x4_cols","1206x4_rows","orientation"]]}calculateMax0603ConfigWithTraceChannels(e,t,n,o,r="grid"){let i=this.traceWidth*o+2*this.obstacleMargin,s=n==="horizontal"?2.15:1,a=n==="horizontal"?1:2.15,c=n==="horizontal"?"x":"y",l=r==="staggered"&&c==="x"?s/2:r==="staggered"?a/2:0,h=Math.max(0,e-1),d=Math.max(0,t-1),u=Math.max(0,h-(r==="staggered"&&c==="x"?l:0)),_=Math.max(0,d-(r==="staggered"&&c==="y"?l:0)),p=s+i,m=a+i,A=Math.max(1,Math.floor(1+(u-s)/p)),g=Math.max(1,Math.floor(1+(_-a)/m));return n==="vertical"?{cols:A,rows:g}:{cols:g,rows:A}}initializeSolvers(){let e=this.getHyperParameterDefs(),t=this.getCombinationDefs();this.supervisedSolvers=[];for(let n of t){let o=n.some((s)=>s.startsWith("0603_max_rows_and_cols_")),r=n.includes("1206x4");if(o&&!this.availableJumperTypes.includes("0603"))continue;if(r&&!this.availableJumperTypes.includes("1206x4"))continue;let i=this.getHyperParameterCombinations(e.filter((s)=>n.includes(s.name)));for(let s of i){let a=this.generateSolver(s),c=this.computeG(a);this.supervisedSolvers.push({hyperParameters:s,solver:a,h:0,g:c,f:c})}}}generateSolver(e){return new t4r({nodeWithPortPoints:this.nodeWithPortPoints,colorMap:this.colorMap,traceWidth:this.traceWidth,hyperParameters:{COLS:e.COLS,ROWS:e.ROWS,ORIENTATION:e.ORIENTATION,JUMPER_TYPE:e.JUMPER_TYPE,PATTERN:e.PATTERN,TRACE_CHANNELS_BETWEEN_JUMPERS:e.TRACE_CHANNELS_BETWEEN_JUMPERS},obstacleMargin:this.obstacleMargin})}computeG(e){let t=e.hyperParameters.COLS*e.hyperParameters.ROWS;return e.iterations/1e4+0.25*t}computeH(e){return 1-(e.progress||0)}onSolve(e){this.solvedRoutes=e.solver.solvedRoutes,this.jumpers=e.solver.getOutputJumpers()}getOutput(){return this.solvedRoutes}getOutputJumpers(){return this.jumpers}visualize(){return this.winningSolver?this.winningSolver.visualize():super.visualize()}};function o4r(e){return{connectionName:e.connectionName,rootConnectionName:e.rootConnectionName,regionId:e.regionId,traceThickness:e.traceThickness,viaDiameter:0,route:e.route,vias:[],jumpers:e.jumpers}}var r4r=class extends ei{getSolverName(){return"JumperHighDensitySolver"}allNodes;nodeAnalyses;routes;colorMap;traceWidth;obstacleMargin;viaDiameter;connMap;hyperParameters;availableJumperTypes;capacityMeshNodes;capacityMeshEdges;capacityMeshNodeMap;nodeAdjacencyMap;nodesWithoutCrossings;nodesWithCrossings;curvyIntraNodeSolvers;currentCurvySolverIndex;jumperSolvers;currentJumperSolverIndex;phase;jumpers=[];constructor({nodePortPoints:e,colorMap:t,traceWidth:n=0.15,obstacleMargin:o=0.15,viaDiameter:r=0.3,connMap:i,hyperParameters:s,capacityMeshNodes:a=[],capacityMeshEdges:c=[],availableJumperTypes:l}){super(),this.allNodes=[...e],this.colorMap=t??{},this.routes=[],this.traceWidth=n,this.obstacleMargin=o,this.viaDiameter=r,this.connMap=i,this.hyperParameters=s,this.capacityMeshNodes=a,this.capacityMeshEdges=c,this.availableJumperTypes=l??["0603"],this.capacityMeshNodeMap=new Map(a.map((u)=>[u.capacityMeshNodeId,u])),this.nodeAdjacencyMap=this._buildNodeAdjacencyMap(),this.nodesWithoutCrossings=[],this.nodesWithCrossings=[],this.nodeAnalyses=[],this.curvyIntraNodeSolvers=[],this.currentCurvySolverIndex=0,this.jumperSolvers=[],this.currentJumperSolverIndex=0,this.phase="analyzing",this._analyzeNodes();let h=1000*this.nodesWithoutCrossings.length,d=1e5*this.nodesWithCrossings.length;this.MAX_ITERATIONS=h+d+100}_buildNodeAdjacencyMap(){let e=new Map;for(let t of this.capacityMeshEdges){let[n,o]=t.nodeIds;e.has(n)||e.set(n,new Set),e.has(o)||e.set(o,new Set),e.get(n).add(o),e.get(o).add(n)}return e}_analyzeNodes(){for(let e of this.allNodes){let t=D_(e),n={node:e,hasCrossings:t.numSameLayerCrossings>0,numSameLayerCrossings:t.numSameLayerCrossings};this.nodeAnalyses.push(n),t.numSameLayerCrossings>0?this.nodesWithCrossings.push(e):this.nodesWithoutCrossings.push(e)}this.nodesWithoutCrossings.length>0?(this.phase="curvy",this._initializeCurvySolvers()):this.nodesWithCrossings.length>0?(this.phase="jumpers",this._initializeJumperSolvers()):this.phase="done"}_step(){switch(this.phase){case"analyzing":this.nodesWithoutCrossings.length>0?(this.phase="curvy",this._initializeCurvySolvers()):this.nodesWithCrossings.length>0?(this.phase="jumpers",this._initializeJumperSolvers()):this.phase="done";break;case"curvy":this._stepCurvySolvers();break;case"jumpers":this._stepJumperSolvers();break;case"done":this.solved=!0}}_getAdjacentObstacles(e){let t=[],n=this.nodeAdjacencyMap.get(e.capacityMeshNodeId);if(!n||n.size===0)return t;let o=new Map(this.allNodes.map((r)=>[r.capacityMeshNodeId,r]));for(let r of n){let i=this.capacityMeshNodeMap.get(r);if(!i)continue;if(!i._containsObstacle&&!i._containsTarget)continue;let s=i.center.x-i.width/2,a=i.center.y-i.height/2,c=i.center.x+i.width/2,l=i.center.y+i.height/2,h;if(i._containsTarget)if(i._targetConnectionName)h=i._targetConnectionName;else{let d=o.get(r);d&&d.portPoints.length>0&&(h=d.portPoints[0].rootConnectionName??d.portPoints[0].connectionName)}t.push({minX:s,minY:a,maxX:c,maxY:l,networkId:h})}return t}_initializeCurvySolvers(){for(let e of this.nodesWithoutCrossings){let t=this._getAdjacentObstacles(e),n=new qzt({nodeWithPortPoints:e,colorMap:this.colorMap,traceWidth:this.traceWidth,viaDiameter:this.viaDiameter,adjacentObstacles:t});this.curvyIntraNodeSolvers.push(n)}}_stepCurvySolvers(){if(this.curvyIntraNodeSolvers.length===0)return this.phase=this.nodesWithCrossings.length>0?"jumpers":"done",void(this.phase==="jumpers"&&this._initializeJumperSolvers());let e=this.curvyIntraNodeSolvers[this.currentCurvySolverIndex];if(this.activeSubSolver=e,!e)return this.phase=this.nodesWithCrossings.length>0?"jumpers":"done",void(this.phase==="jumpers"&&this._initializeJumperSolvers());if(e.step(),e.solved){this.routes.push(...e.routes),this.currentCurvySolverIndex++;for(let t=this.currentCurvySolverIndex;t<this.curvyIntraNodeSolvers.length;t++){this.curvyIntraNodeSolvers[t];let n=this.nodesWithoutCrossings[t],o=this._getAdjacentObstacles(n),r=new qzt({nodeWithPortPoints:n,colorMap:this.colorMap,traceWidth:this.traceWidth,viaDiameter:this.viaDiameter,adjacentObstacles:o});this.curvyIntraNodeSolvers[t]=r}this.currentCurvySolverIndex>=this.curvyIntraNodeSolvers.length&&(this.phase=this.nodesWithCrossings.length>0?"jumpers":"done",this.phase==="jumpers"&&this._initializeJumperSolvers())}else e.failed&&(this.error=`CurvyIntraNodeSolver failed for node: ${e.nodeWithPortPoints.capacityMeshNodeId}: ${e.error}`,this.failed=!0)}_initializeJumperSolvers(){for(let e of this.nodesWithCrossings){let t=new n4r({nodeWithPortPoints:e,colorMap:this.colorMap,traceWidth:this.traceWidth,obstacleMargin:this.obstacleMargin,connMap:this.connMap,availableJumperTypes:this.availableJumperTypes});this.jumperSolvers.push(t)}}_stepJumperSolvers(){if(this.jumperSolvers.length===0)return this.phase="done",void(this.solved=!0);let e=this.jumperSolvers[this.currentJumperSolverIndex];if(this.activeSubSolver=e,!e)return this.phase="done",void(this.solved=!0);if(e.step(),e.solved){for(let t of e.solvedRoutes)this.routes.push(o4r(t));this.jumpers.push(...e.getOutputJumpers()),this.currentJumperSolverIndex++,this.currentJumperSolverIndex>=this.jumperSolvers.length&&(this.phase="done",this.solved=!0)}else e.failed&&(this.error=`HyperJumperPrepatternSolver2 failed for node: ${e.nodeWithPortPoints.capacityMeshNodeId}: ${e.error}`,this.failed=!0)}computeProgress(){let e=this.allNodes.length;if(e===0)return 1;let t=0;t+=this.currentCurvySolverIndex;let n=this.curvyIntraNodeSolvers[this.currentCurvySolverIndex];n&&(t+=n.progress),t+=this.currentJumperSolverIndex;let o=this.jumperSolvers[this.currentJumperSolverIndex];return o&&(t+=o.progress),t/e}getConstructorParams(){return{nodePortPoints:this.allNodes,colorMap:this.colorMap,traceWidth:this.traceWidth,obstacleMargin:this.obstacleMargin,viaDiameter:this.viaDiameter,connMap:this.connMap,hyperParameters:this.hyperParameters,capacityMeshNodes:this.capacityMeshNodes,capacityMeshEdges:this.capacityMeshEdges,availableJumperTypes:this.availableJumperTypes}}getOutputJumpers(){return this.jumpers}visualize(){let e={lines:[],points:[],rects:[],circles:[]};if(this.failed&&this.activeSubSolver)return this.activeSubSolver.visualize();if(this.phase==="curvy"&&this.curvyIntraNodeSolvers[this.currentCurvySolverIndex])return this.curvyIntraNodeSolvers[this.currentCurvySolverIndex].visualize();if(this.phase==="jumpers"&&this.jumperSolvers[this.currentJumperSolverIndex])return this.jumperSolvers[this.currentJumperSolverIndex].visualize();for(let t of this.routes){let n=t.rootConnectionName??t.connectionName,o=Abe(t.route,t.connectionName,this.colorMap[n]);for(let r of o)e.lines.push({points:r.points,label:r.connectionName,strokeColor:r.z===0?r.color:zi(r.color??"gray",0.75),layer:`z${r.z}`,strokeWidth:t.traceThickness,strokeDash:r.z!==0?"10, 5":void 0});for(let r of t.vias)e.circles.push({center:r,radius:t.viaDiameter/2,fill:zi(this.colorMap[n]??"gray",0.5),layer:"via"});if("jumpers"in t&&t.jumpers)for(let r of t.jumpers){let i=this.colorMap[n]??"gray",s=r.footprint??"1206",a=QV[s],c=r.end.x-r.start.x,l=r.end.y-r.start.y,h=Math.abs(c)>Math.abs(l),d=h?a.padLength:a.padWidth,u=h?a.padWidth:a.padLength;e.rects.push({center:r.start,width:d,height:u,fill:zi(i,0.5),stroke:"rgba(0, 0, 0, 0.5)",layer:"jumper"}),e.rects.push({center:r.end,width:d,height:u,fill:zi(i,0.5),stroke:"rgba(0, 0, 0, 0.5)",layer:"jumper"}),e.lines.push({points:[r.start,r.end],strokeColor:"rgba(100, 100, 100, 0.8)",strokeWidth:0.3*a.padWidth,layer:"jumper-body"})}}for(let t of this.nodeAnalyses){let n=t.node;n.center.x,n.width,n.center.x,n.width,n.center.y,n.height,n.center.y,n.height,e.rects.push({center:n.center,width:n.width,height:n.height,fill:t.hasCrossings?"rgba(255, 200, 0, 0.1)":"rgba(0, 200, 0, 0.1)",stroke:t.hasCrossings?"rgba(255, 150, 0, 0.5)":"rgba(0, 150, 0, 0.5)",label:[n.capacityMeshNodeId,t.hasCrossings?`crossings: ${t.numSameLayerCrossings}`:"no crossings"].join(`
`)})}return e}};function $w(e,t,n,o={}){return{solverName:e,solverClass:t,getConstructorParams:n,onSolved:o.onSolved}}var rsn=class extends ei{constructor(e,t={}){super(),this.srj=e,this.opts=t,this.srj=e,this.opts={...t},this.viaDiameter=rm(e).padDiameter,this.minTraceWidth=e.minTraceWidth;let n=this.opts;if(this.effort=n.effort??1,this.MAX_ITERATIONS=1e8*this.effort,n.capacityDepth===void 0){let o=e.bounds.maxX-e.bounds.minX,r=e.bounds.maxY-e.bounds.minY,i=Math.max(o,r),s=n.targetMinCapacity??0.5;n.capacityDepth=ik(i,s)}this.connMap=im(e),this.colorMap=JA(e,this.connMap),this.cacheProvider=n.cacheProvider===void 0?hv():n.cacheProvider===null?null:n.cacheProvider,this.startTimeOfPhase={},this.endTimeOfPhase={},this.timeSpentOnPhase={}}srj;opts;getSolverName(){return"AssignableAutoroutingPipeline3"}netToPointPairsSolver;traceKeepoutSolver;nodeSolver;nodeTargetMerger;edgeSolver;relateNodesToOffBoardConnections;colorMap;highDensityRouteSolver;simpleHighDensityRouteSolver;highDensitySolver;highDensityStitchSolver;singleLayerNodeMerger;offboardPathFragmentSolver;strawSolver;deadEndSolver;traceSimplificationSolver;traceWidthSolver;availableSegmentPointSolver;portPointPathingSolver;multiSectionPortPointOptimizer;viaDiameter;minTraceWidth;effort;startTimeOfPhase;endTimeOfPhase;timeSpentOnPhase;activeSubSolver=null;connMap;srjWithPointPairs;capacityNodes=null;capacityEdges=null;cacheProvider=null;pipelineDef=[$w("netToPointPairsSolver",vZe,(e)=>[e.srj,e.colorMap,nk(e.srj)],{onSolved:(e)=>{e.srjWithPointPairs=e.netToPointPairsSolver?.getNewSimpleRouteJson(),e.colorMap=JA(e.srjWithPointPairs,this.connMap),e.connMap=im(e.srjWithPointPairs)}}),$w("nodeSolver",Qq,(e)=>[{simpleRouteJson:e.srjWithPointPairs,maxGapFillPasses:4}],{onSolved:(e)=>{e.capacityNodes=e.nodeSolver?.getOutput().meshNodes??[]}}),$w("relateNodesToOffBoardConnections",sin,(e)=>[{capacityMeshNodes:e.capacityNodes,srj:e.srj}],{onSolved:(e)=>{e.capacityNodes=e.relateNodesToOffBoardConnections?.getOutput().capacityNodes}}),$w("edgeSolver",ok,(e)=>[e.capacityNodes],{onSolved:(e)=>{e.capacityEdges=e.edgeSolver?.edges}}),$w("availableSegmentPointSolver",tY,(e)=>[{nodes:e.capacityNodes,edges:e.capacityEdges||[],traceWidth:e.minTraceWidth,colorMap:e.colorMap,shouldReturnCrampedPortPoints:!1}]),$w("portPointPathingSolver",IZe,(e)=>{let t=e.capacityNodes.map((r)=>({capacityMeshNodeId:r.capacityMeshNodeId,center:r.center,width:r.width,height:r.height,portPoints:[],availableZ:r.availableZ,_containsTarget:r._containsTarget,_containsObstacle:r._containsObstacle,_offBoardConnectionId:r._offBoardConnectionId,_offBoardConnectedCapacityMeshNodeIds:r._offBoardConnectedCapacityMeshNodeIds})),n=new Map(t.map((r)=>[r.capacityMeshNodeId,r])),o=e.availableSegmentPointSolver;for(let r of o.sharedEdgeSegments)for(let i of r.portPoints){let[s,a]=i.nodeIds,c={portPointId:i.segmentPortPointId,x:i.x,y:i.y,z:i.availableZ[0]??0,connectionNodeIds:[s,a],distToCentermostPortOnZ:i.distToCentermostPortOnZ,connectsToOffBoardNode:r.nodeIds.some((h)=>n.get(h)?._offBoardConnectionId)},l=n.get(s);l&&l.portPoints.push(c)}return[{simpleRouteJson:e.srjWithPointPairs,inputNodes:t,capacityMeshNodes:e.capacityNodes,colorMap:e.colorMap,numShuffleSeeds:10*Math.min(1,e.effort),hyperParameters:{JUMPER_PF_FN_ENABLED:!0,NODE_PF_FACTOR:100,MAX_RIPS:100*Math.min(1,e.effort),RIPPING_ENABLED:!0,MAX_RIPPING_PF_THRESHOLD:0.9,MIN_RIPPING_PF_THRESHOLD:0.1,RANDOM_RIP_FRACTION:0.05,NODE_PF_MAX_PENALTY:1000,STRAIGHT_LINE_DEVIATION_PENALTY_FACTOR:0,CENTER_OFFSET_DIST_PENALTY_FACTOR:0,FORCE_CENTER_FIRST:!0}}]},{onSolved:(e)=>{let t=e.portPointPathingSolver;t&&ain({connMap:e.connMap,connectionsWithResults:t.connectionsWithResults,inputNodes:t.inputNodes,obstacles:e.srj.obstacles})}}),$w("highDensitySolver",r4r,(e)=>[{nodePortPoints:e.multiSectionPortPointOptimizer?.getNodesWithPortPoints()??e.portPointPathingSolver?.getNodesWithPortPoints()??[],colorMap:e.colorMap,viaDiameter:e.viaDiameter,traceWidth:e.minTraceWidth,obstacleMargin:e.srj.defaultObstacleMargin??0.15,connMap:e.connMap,capacityMeshNodes:e.capacityNodes??[],capacityMeshEdges:e.capacityEdges??[],availableJumperTypes:e.srj.availableJumperTypes}]),$w("highDensityStitchSolver",zyr,(e)=>[{connections:e.srjWithPointPairs.connections,hdRoutes:e.highDensitySolver.routes,connectionPathResults:e.multiSectionPortPointOptimizer?.connectionResults??e.portPointPathingSolver?.connectionsWithResults??[],colorMap:e.colorMap,layerCount:e.srj.layerCount,defaultViaDiameter:e.viaDiameter}]),$w("traceKeepoutSolver",iin,(e)=>[{hdRoutes:e.traceSimplificationSolver?.simplifiedHdRoutes??e.highDensityStitchSolver?.mergedHdRoutes??[],obstacles:e.srj.obstacles,jumpers:e.highDensitySolver?.getOutputJumpers()??[],connMap:e.connMap,colorMap:e.colorMap,srj:e.srj}])];getConstructorParams(){return[this.srj,this.opts]}currentPipelineStepIndex=0;_step(){let e=this.pipelineDef[this.currentPipelineStepIndex];if(!e)return void(this.solved=!0);if(this.activeSubSolver)return this.activeSubSolver.step(),void(this.activeSubSolver.solved?(this.endTimeOfPhase[e.solverName]=performance.now(),this.timeSpentOnPhase[e.solverName]=this.endTimeOfPhase[e.solverName]-this.startTimeOfPhase[e.solverName],e.onSolved?.(this),this.activeSubSolver=null,this.currentPipelineStepIndex++):this.activeSubSolver.failed&&(this.error=this.activeSubSolver?.error,this.failed=!0,this.activeSubSolver=null));let t=e.getConstructorParams(this);this.activeSubSolver=new e.solverClass(...t),this[e.solverName]=this.activeSubSolver,this.timeSpentOnPhase[e.solverName]=0,this.startTimeOfPhase[e.solverName]=performance.now()}solveUntilPhase(e){for(;this.getCurrentPhase()!==e;)this.step()}getCurrentPhase(){return this.pipelineDef[this.currentPipelineStepIndex]?.solverName??"none"}visualize(){if(!this.solved&&this.activeSubSolver)return this.activeSubSolver.visualize();let e=this.netToPointPairsSolver?.visualize(),t=this.nodeSolver?.visualize(),n=this.nodeTargetMerger?.visualize(),o=this.singleLayerNodeMerger?.visualize(),r=this.strawSolver?.visualize(),i=this.edgeSolver?.visualize(),s=this.traceKeepoutSolver?.visualize(),a=this.deadEndSolver?.visualize(),c=this.availableSegmentPointSolver?.visualize(),l=this.offboardPathFragmentSolver?.visualize(),h=this.portPointPathingSolver?.visualize(),d=this.multiSectionPortPointOptimizer?.visualize(),u=this.highDensityRouteSolver?.visualize(),_=this.highDensitySolver?.visualize(),p=this.simpleHighDensityRouteSolver?.visualize(),m=this.highDensityStitchSolver?.visualize(),A=this.traceSimplificationSolver?.visualize(),g=this.traceWidthSolver?.visualize(),f=this.srj.outline,y=[];if(y.push({points:[{x:this.srj.bounds?.minX??-50,y:this.srj.bounds?.minY??-50},{x:this.srj.bounds?.maxX??50,y:this.srj.bounds?.minY??-50},{x:this.srj.bounds?.maxX??50,y:this.srj.bounds?.maxY??50},{x:this.srj.bounds?.minX??-50,y:this.srj.bounds?.maxY??50},{x:this.srj.bounds?.minX??-50,y:this.srj.bounds?.minY??-50}],strokeColor:"rgba(255,0,0,0.25)"}),f&&f.length>=2){let I=f.map((v)=>({x:v.x,y:v.y}));I.push({...I[0]}),y.push({points:I,strokeColor:"rgba(0, 136, 255, 0.95)"})}let x=bB(this.srj),C={points:[...this.srj.connections.flatMap((I)=>I.pointsToConnect.map((v)=>({...v,layer:IB(v,this.srj.layerCount),label:`${I.name} ${v.pcb_port_id??""}`})))],rects:[...(this.srj.obstacles??[]).filter((I)=>!I.isCopperPour).map((I)=>({...I,fill:I.layers?.includes("top")?"rgba(255,0,0,0.25)":I.layers?.includes("bottom")?"rgba(0,0,255,0.25)":"rgba(255,0,0,0.25)",layer:$S(I,this.srj.layerCount),label:x(I)}))],lines:y},b=[C,e,t,n,o,r,i,a,c,l,h,d,u?Bl(C,u):null,_?Bl(C,_):null,p?Bl(C,p):null,m,A,s,g,this.solved?Bl({lines:y},rx(this.getOutputSimpleRouteJson())):null].filter(Boolean);return Bl(...b)}preview(){let e=this.highDensitySolver?.routes??this.simpleHighDensityRouteSolver?.routes??this.highDensityRouteSolver?.routes;if(e){let t=[];for(let n=e.length-1;n>=0;n--){let o=e[n];if(t.push({points:o.route.map((r)=>({x:r.x,y:r.y})),strokeColor:this.colorMap[o.connectionName]}),t.length>200)break}return{lines:t}}if(this.portPointPathingSolver){let t=[];for(let n of this.portPointPathingSolver.connectionsWithResults)n.path&&t.push({points:n.path.map((o)=>({x:o.point.x,y:o.point.y})),strokeColor:this.colorMap[n.connection.name]});return{lines:t}}return this.netToPointPairsSolver?this.netToPointPairsSolver?.visualize():{}}_getOutputHdRoutes(){return this.traceWidthSolver?.hdRoutesWithWidths??this.traceKeepoutSolver?.redrawnHdRoutes??this.traceSimplificationSolver?.simplifiedHdRoutes??this.highDensityStitchSolver?.mergedHdRoutes??this.highDensitySolver?.routes??this.simpleHighDensityRouteSolver?.routes??this.highDensityRouteSolver?.routes}getConnectedOffboardObstacles(){let e={},t=new Set(this.srj.connections.flatMap((n)=>n.__rootConnectionNames??[n.name]));for(let[n,o]of this.srj.obstacles.entries()){if(!o.offBoardConnectsTo?.length)continue;let r=o.obstacleId??`__obs${n}`;o.obstacleId=r;let i=this.connMap.getNetConnectedToId(r);if(!i)continue;let s=this.connMap.getIdsConnectedToNet(i).find((a)=>t.has(a));s&&(e[r]=s)}return e}getOutputSimplifiedPcbTraces(){if(!this.solved||!this.highDensityRouteSolver&&!this.simpleHighDensityRouteSolver&&!this.highDensitySolver)throw Error("Cannot get output before solving is complete");let e=[],t=this._getOutputHdRoutes();for(let n of this.netToPointPairsSolver?.newConnections??[]){let o=n.__netConnectionName??this.srj.connections.find((i)=>i.name===n.name)?.__netConnectionName,r=t.filter((i)=>i.connectionName===n.name);for(let i=0;i<r.length;i++){let s=r[i],a={type:"pcb_trace",pcb_trace_id:`${n.name}_${i}`,connection_name:o??n.__rootConnectionNames?.[0]??n.name,route:k3(s,this.srj.layerCount)};e.push(a)}}return e}getOutputJumpers(){return this.highDensitySolver?this.highDensitySolver.getOutputJumpers():[]}getOutputSimpleRouteJson(){let e=this.getOutputJumpers();return{...this.srj,traces:this.getOutputSimplifiedPcbTraces(),jumpers:e.length>0?e:void 0}}},QOt=(e)=>{let{candidates:t,mapOfCapacityMeshNodeIdToRef:n}=e,o=!0;for(let r of t){let i=!1;r.port.nodeIds.forEach((s)=>{let a=n.get(s);if(!a)throw Error(`Could not find capacity mesh node for id ${s}`);a._containsObstacle&&(i=!0)}),i||(o=!1)}return o},kOt=(e)=>e.depth+1000*e.countOfCrampedPortPointsInPath,LOt=class extends Da{constructor(e){if(super(),this.input=e,this.input.depthLimit<1)throw Error("Depth limit must be at least 1");this._setup()}input;queue=[];resultExploredPortPoints=[];currentExploredPortPoints=null;visitedExploredPortPoints=new Map;getSolverName(){return"singleTargetNecessaryCrampedPortPointSolver"}_setup(){let e=this.input.mapOfCapacityMeshNodeIdToSegmentPortPoints.get(this.input.target.capacityMeshNodeId)??[];for(let t of e){if(this.input.shouldIgnoreCrampedPortPoints&&t.cramped)continue;let n={port:t,depth:1,parent:null,countOfCrampedPortPointsInPath:t.cramped?1:0},o=this.visitedExploredPortPoints.get(t);(!o||this.getCandidateCost(n)<this.getCandidateCost(o))&&(this.visitedExploredPortPoints.set(t,n),this.queue.push(n))}}_step(){if(this.queue.length===0)return this.currentExploredPortPoints=null,void(this.solved=!0);for(;this.queue.length>0;){if(this.currentExploredPortPoints=this.queue.shift(),this.visitedExploredPortPoints.get(this.currentExploredPortPoints.port)!==this.currentExploredPortPoints)continue;if(this.currentExploredPortPoints.depth===this.input.depthLimit){this.resultExploredPortPoints.push(this.currentExploredPortPoints);continue}let e=this.currentExploredPortPoints.port.nodeIds.map((t)=>{let n=this.input.mapOfCapacityMeshNodeIdToRef.get(t);if(!n)throw Error(`Could not find capacity mesh node for id ${t}`);return n}).flatMap((t)=>this.input.mapOfCapacityMeshNodeIdToSegmentPortPoints.get(t.capacityMeshNodeId)??[]);for(let t of e){if(this.input.shouldIgnoreCrampedPortPoints&&t.cramped)continue;let n={port:t,depth:this.currentExploredPortPoints.depth+1,parent:this.currentExploredPortPoints,countOfCrampedPortPointsInPath:this.currentExploredPortPoints.countOfCrampedPortPointsInPath+(t.cramped?1:0)},o=this.visitedExploredPortPoints.get(t);o&&this.getCandidateCost(o)<=this.getCandidateCost(n)||(this.visitedExploredPortPoints.set(t,n),this.queue.push(n))}}this.solved=!0}getCandidateCost(e){return e.depth+1000*e.countOfCrampedPortPointsInPath}getOutput(){return this.resultExploredPortPoints}visualize(){let e={points:[],rects:[]};for(let t of this.visitedExploredPortPoints.keys())e.points.push({...t,color:t.cramped?"blue":"green"});return e}},jle=class extends Da{constructor(e){super(),this.input=e,this._setup()}input;unprocessedTargets=[];targetNode=[];currentTarget;crampedPortPointsToKeep=new Set;candidatesAtDepth=[];isRunningCrampedPass=!1;filteredOutput;activeSubSolver=null;nodeMap=new Map;mapOfCapacityMeshNodeIdToSegmentPortPoints=new Map;getSolverName(){return"multiTargetNecessaryCrampedPortPointSolver"}_setup(){this.targetNode=this.input.capacityMeshNodes.filter((e)=>e._containsObstacle),this.targetNode=this.targetNode.filter((e)=>{for(let t of this.input.simpleRouteJson.connections)for(let n of t.pointsToConnect)if(iP(n,e)<=0)return!0;return!1}),this.unprocessedTargets=[...this.targetNode],this.unprocessedTargets.sort((e,t)=>e.center.x-t.center.x);for(let e of this.input.capacityMeshNodes)this.nodeMap.set(e.capacityMeshNodeId,e);for(let e of this.input.sharedEdgeSegments)for(let t of e.portPoints){let n=t.nodeIds;for(let o of n){if(!this.nodeMap.get(o))throw Error(`Could not find capacity mesh node for id ${o}`);let r=this.mapOfCapacityMeshNodeIdToSegmentPortPoints.get(o)||[];this.mapOfCapacityMeshNodeIdToSegmentPortPoints.set(o,[...r,t])}}}_step(){if(this.activeSubSolver){if(this.activeSubSolver._step(),!this.activeSubSolver.solved)return;if(this.activeSubSolver.failed)return this.failed=!0,void(this.error=this.activeSubSolver.error);if(this.candidatesAtDepth=this.activeSubSolver.getOutput(),this.activeSubSolver=null,!this.currentTarget)return this.failed=!0,void(this.error="Missing current capacity mesh node while finishing BFS");if(!this.isRunningCrampedPass)return QOt({candidates:this.candidatesAtDepth,mapOfCapacityMeshNodeIdToRef:this.nodeMap})||this.candidatesAtDepth.length===0?(this.isRunningCrampedPass=!0,void(this.activeSubSolver=new LOt({target:this.currentTarget,depthLimit:3,shouldIgnoreCrampedPortPoints:!1,mapOfCapacityMeshNodeIdToSegmentPortPoints:this.mapOfCapacityMeshNodeIdToSegmentPortPoints,mapOfCapacityMeshNodeIdToRef:this.nodeMap}))):void(this.currentTarget=void 0);let e=this.candidatesAtDepth.filter((t)=>{let n=t.port;return n.nodeIds.map((o)=>{let r=this.nodeMap.get(o);if(!r)throw this.failed=!0,this.error=`Could not find capacity mesh node for id ${o}`,Error(`Could not find capacity mesh node for id ${o}`);return r}).every((o)=>!o._containsObstacle)&&n.cramped});if(QOt({candidates:e,mapOfCapacityMeshNodeIdToRef:this.nodeMap})&&(this.error=`All candidates are blocked by obstacles even after including cramped port points for capacity mesh node ${this.currentTarget.capacityMeshNodeId}`),this.candidatesAtDepth=[...e].sort((t,n)=>{let o=kOt(t)-kOt(n);return o!==0?o:this.getCandidateExitCapacity(n)-this.getCandidateExitCapacity(t)}),this.candidatesAtDepth.length===0)this.error=`No candidates found for capacity mesh node ${this.currentTarget.capacityMeshNodeId} even after including cramped port points`;else{let t=new Map;for(let o of this.candidatesAtDepth){if(!o.parent)throw Error(`Missing parent for cramped escape candidate ${o.port.segmentPortPointId}`);let r=`${o.parent.port.segmentPortPointId}->${o.port.segmentPortPointId}`;if(!t.has(r)&&(t.set(r,o),t.size===5))break}let n=[...t.values()];for(let o of n)this.keepCandidatePath(o)}return this.isRunningCrampedPass=!1,void(this.currentTarget=void 0)}if(!this.currentTarget)return this.currentTarget=this.unprocessedTargets.shift(),this.currentTarget?(this.isRunningCrampedPass=!1,this.candidatesAtDepth=[],void(this.activeSubSolver=new LOt({target:this.currentTarget,depthLimit:2,shouldIgnoreCrampedPortPoints:!0,mapOfCapacityMeshNodeIdToSegmentPortPoints:this.mapOfCapacityMeshNodeIdToSegmentPortPoints,mapOfCapacityMeshNodeIdToRef:this.nodeMap}))):void(this.solved=!0)}getOutput(){return this.filteredOutput||(this.filteredOutput=this.input.sharedEdgeSegments.map((e)=>({...e,portPoints:e.portPoints.flatMap((t)=>!t.cramped||this.crampedPortPointsToKeep.has(t)?[t]:this.isMultilayerEscapePort(t)?[{...t,tinyHypergraphPortPenalty:1000}]:[])}))),this.filteredOutput}getCandidateExitCapacity(e){if(!e.parent)throw Error(`Missing parent for cramped escape candidate ${e.port.segmentPortPointId}`);let t=new Set(e.parent.port.nodeIds),n=e.port.nodeIds.filter((o)=>!t.has(o)).map((o)=>{let r=this.nodeMap.get(o);if(!r)throw Error(`Could not find capacity mesh node for id ${o}`);return r});if(n.length===0)throw Error(`Could not find exit node for cramped escape candidate ${e.port.segmentPortPointId}`);return Math.max(0,...n.map((o)=>o.width*o.height*o.availableZ.length))}keepCandidatePath(e){this.crampedPortPointsToKeep.add(e.port);let t=e.parent;for(;t;)this.crampedPortPointsToKeep.add(t.port),t=t.parent}isMultilayerEscapePort(e){return e.nodeIds.some((t)=>(this.nodeMap.get(t)?.availableZ.length??0)>1)}visualize(){let e={rects:[],points:[]};for(let t of this.targetNode)e.rects.push({...t,fill:this.currentTarget?.capacityMeshNodeId===t.capacityMeshNodeId?"rgba(255, 0, 0, 0.5)":"rgba(255, 0, 0, 0.2)"});for(let t of this.candidatesAtDepth)e.points.push({...t.port,color:t.port.cramped?"blue":"green"});for(let t of this.crampedPortPointsToKeep)e.points.push({...t,color:"blue"});return this.activeSubSolver?pV(e,this.activeSubSolver.visualize()):e}},E$=(e)=>`${e.x.toFixed(4)},${e.y.toFixed(4)}`,isn=(e)=>e.netIsAssignable===!0&&(e.layers?.length??0)>1,i4r=(e,t)=>e.connectedTo?.find((n)=>n.startsWith("pcb_via"))??e.obstacleId??`assignable_via_${t}`,s4r=(e)=>[...new Set(e.obstacle.layers.map((t)=>si(t,e.layerCount)))].sort((t,n)=>t-n),a4r=(e)=>E$(e.center),HOt=(e)=>new Set(e.filter(isn).map(a4r));function $b(e,t){if(e==null)throw Error(t)}function FZe({point:e,layerCount:t}){let n=E5(e).map((o)=>si(o,t));return[...new Set(n)]}function ssn(e){if(iP(e.point,e.region.d)<=0.001)return(e.pointZLayers??FZe(e)).some((t)=>e.region.d.availableZ.includes(t));return!1}function c4r({region:e,pointZLayers:t}){return e.ports.some((n)=>t.includes(n.d.z)&&t.some((o)=>n.region1.d.availableZ.includes(o))&&t.some((o)=>n.region2.d.availableZ.includes(o)))}function FOt({graph:e,point:t,layerCount:n}){let o=FZe({point:t,layerCount:n}),r;for(let i of e.regions)if(ssn({point:t,region:i,layerCount:n,pointZLayers:o})&&(r??=i,c4r({region:i,pointZLayers:o})))return i;return r}var zOt=(e,t)=>{let n=e.getNetConnectedToId(t);if(!n)throw Error(`Could not resolve net ID for connection "${t}"`);return n},l4r=(e)=>{let t=e.graph.regions.filter((r)=>r.d.availableZ.includes(e.z)&&!r.d._assignableVia).map((r)=>({region:r,distance:iP(e.point,r.d)})).sort((r,i)=>r.distance-i.distance||r.region.d.width*r.region.d.height-i.region.d.width*i.region.d.height),n=t[0]?.distance;if(n===void 0)return[];let o=Math.max(n+0.000001,e.viaRadius+0.15);return t.filter((r)=>r.distance<=o).slice(0,4).map((r)=>r.region)};function Kle(e){let t={ports:[],regions:[]},n=[],o=new Map;for(let r of e.capacityMeshNodes){let i=r._connectedTo?.map((a)=>zOt(e.connectivityMap,a)),s={regionId:r.capacityMeshNodeId,d:i?{...r,_connectedTo:[...new Set(i)]}:r,ports:[]};t.regions.push(s),o.has(s.regionId)||o.set(s.regionId,s)}for(let r of e.segmentPortPoints){let[i,s]=r.nodeIds,a=o.get(i),c=o.get(s);$b(a,`Could not find region with id ${i} for segment port point ${r.segmentPortPointId}`),$b(c,`Could not find region with id ${s} for segment port point ${r.segmentPortPointId}`);for(let l of r.availableZ){let h=r._preloadedTracePortAssignments?.filter((_)=>_.z===l),d={portId:`${r.segmentPortPointId}::${l}`,x:r.x,y:r.y,z:l,distToCentermostPortOnZ:r.distToCentermostPortOnZ,cramped:r.cramped,regions:[a,c],tinyHypergraphPortPenalty:r.tinyHypergraphPortPenalty,_preloadedFixedNetIds:h&&h.length>0?[...new Set(h.map((_)=>_.fixedNetId))].sort():void 0,_preloadedTracePortAssignments:h},u={portId:r.segmentPortPointId,d,region1:a,region2:c};t.ports.push(u),a.ports.push(u),c.ports.push(u)}}((r)=>{for(let[i,s]of r.assignableViaObstacles.entries()){if(!isn(s))continue;let a=s4r({obstacle:s,layerCount:r.layerCount});if(a.length<2)continue;let c=`assignable-via:${i4r(s,i)}`,l=Math.min(s.width,s.height)/2,h={regionId:c,d:{capacityMeshNodeId:c,center:{...s.center},width:s.width,height:s.height,layer:`z${a.join(",")}`,availableZ:a,_containsObstacle:!1,_completelyInsideObstacle:!1,_containsTarget:!1,_assignableVia:!0,_assignedViaObstacle:s},ports:[]},d=[];for(let u of a)for(let _ of l4r({graph:r.graph,point:s.center,z:u,viaRadius:l})){let p={portId:`${c}:port:${_.regionId}:z${u}`,x:s.center.x,y:s.center.y,z:u,distToCentermostPortOnZ:0,cramped:!1,regions:[_,h]},m={portId:p.portId,d:p,region1:_,region2:h};d.push(m),_.ports.push(m)}if(new Set(d.map((u)=>u.d.z)).size<2)for(let u of d)u.region1.ports=u.region1.ports.filter((_)=>_!==u);else h.ports.push(...d),r.graph.regions.push(h),r.graph.ports.push(...d)}})({graph:t,assignableViaObstacles:e.assignableViaObstacles??[],layerCount:e.layerCount});for(let r of e.simpleRouteJsonConnections){let[i,s]=r.pointsToConnect,a=FOt({graph:t,point:i,layerCount:e.layerCount}),c=FOt({graph:t,point:s,layerCount:e.layerCount});$b(a,`Could not find start region for connection "${r.name}"`),$b(c,`Could not find end region for connection "${r.name}"`),n.push({connectionId:r.name,mutuallyConnectedNetworkId:zOt(e.connectivityMap,r.name),startRegion:a,endRegion:c,simpleRouteConnection:r})}return{graph:t,connections:n}}function h4r(e,t){let n={lines:[],points:[]};if(!e)return n;let o=e.shift();if(!o)return n;let r=[];n.points.push({...o.port.d,color:"rgb(255, 50, 50)",label:`g: ${o.g}
h: ${o.h}
f: ${o.f}
ripRequired: ${o.ripRequired}`});do r.push({x:o.port.d.x,y:o.port.d.y,z:o.port.d.z}),o=o.parent;while(o);r.reverse();let i=r[0]?.z??0;r.unshift({x:t.x,y:t.y,z:i});for(let s=0;s<r.length-1;s++){let a=r[s],c=r[s+1],l;l=a.z===c.z?a.z===0?void 0:"10 5":"3 3 10",n.lines.push({points:[{x:a.x,y:a.y},{x:c.x,y:c.y}],strokeColor:"rgba(255, 250, 50, 1)",strokeWidth:0.01,strokeDash:l})}for(let s of e)n.points.push({...s.port.d,color:"rgb(0, 64, 255)",label:`${s.port.portId}
g: ${s.g}
h: ${s.h}
f: ${s.f}
ripRequired: ${s.ripRequired}`});return n}function d4r(e,t){let n={lines:[],points:[]};for(let o of e){let r=t[o.connection.connectionId]??"rgba(255, 50, 50, 1)",i=[{x:o.connection.startRegion.d.center.x,y:o.connection.startRegion.d.center.y,z:o.connection.startRegion.d?.availableZ?.[0]??0}];for(let s of o.path)i.push({x:s.port.d.x,y:s.port.d.y,z:s.port.d.z});i.push({x:o.connection.endRegion.d.center.x,y:o.connection.endRegion.d.center.y,z:o.connection.endRegion.d?.availableZ?.[0]??0});for(let s=0;s<i.length-1;s++){let a=i[s],c=i[s+1],l;l=a.z===c.z?a.z===0?void 0:"10 5":"3 3 10";let h={points:[{x:a.x,y:a.y},{x:c.x,y:c.y}],strokeColor:r,strokeWidth:0.01,strokeDash:l};n.lines.push(h)}}return n}function u4r(e,t){let n={lines:[],points:[]};for(let o of e){let r=o.startRegion.d.center,i=o.endRegion.d.center,s=(r.x+i.x)/2,a=(r.y+i.y)/2,c=t[o.connectionId]??"rgba(255, 50, 150, 0.8)";n.points.push({x:s,y:a,color:c,label:o.connectionId}),n.lines.push({points:[r,i],strokeColor:c,strokeWidth:0.1,strokeDash:(o.startRegion.d?.availableZ?.[0]??0)===0?void 0:"10 5"})}return n}function p4r(e){let t={rects:[],points:[]};for(let n of e.regions)t.rects.push({center:n.d.center,width:n.d.width,height:n.d.height,fill:"rgba(200, 200, 200, 0.5)",label:n.regionId});for(let n of e.ports)t.points.push({x:n.d.x,y:n.d.y,color:"rgba(4, 90, 20, 0.3)",label:n.portId});return t}var OOt=class extends yin{constructor(e){super({inputConnections:e.connections,inputGraph:e.graph,inputSolvedRoutes:e.inputSolvedRoutes,greedyMultiplier:e.weights.GREEDY_MULTIPLIER,ripCost:e.weights.RIPPING_PF_COST,rippingEnabled:e.flags.RIPPING_ENABLED}),this.params=e,this.regionMemoryPfMap=e.opts?.regionMemoryPfMap??new Map,this.baseRegionFailureCostMap=new Map,this.regionRipCountMap=new Map,this.totalRipCount=0,e.weights.MAX_ITERATIONS_PER_PATH>0&&(this.MAX_ITERATIONS=e.weights.MAX_ITERATIONS_PER_PATH*e.effort)}params;regionMemoryPfMap;baseRegionFailureCostMap;regionRipCountMap;totalRipCount;estimateCostToEnd(e){let t=this.currentEndRegion;return $b(t,"Current end region is undefined"),kn(e.d,t.d.center)}computeH(e){let t=e,n=this.computeDistanceTraveled(t);if(this.params.weights.RANDOM_WALK_DISTANCE>0&&n<this.params.weights.RANDOM_WALK_DISTANCE)return 0;let o=this.estimateCostToEnd(e.port),r=(e.port.d.distToCentermostPortOnZ-this.params.weights.CENTER_OFFSET_FOCUS_SHIFT)*this.params.weights.CENTER_OFFSET_DIST_PENALTY_FACTOR,i=e.nextRegion?.regionId??e.lastRegion?.regionId,s=i?this.regionMemoryPfMap.get(i)??0:0;return o+r+this.computeMemoryPfPenalty(s)+this.computeDeviation(e)*this.params.weights.STRAIGHT_LINE_DEVIATION_PENALTY_FACTOR}computeIncreasedRegionCostIfPortsAreUsed(e,t,n){let o=this.currentConnection;$b(o,"Current connection is undefined");let r=this.getBaseRegionFailureCost(e),i=this.computeRegionPfWithAdditionalSegment(e,t,n,o.connectionId,o.mutuallyConnectedNetworkId);if(i>=this.NODE_MAX_PF)return this.params.weights.NODE_PF_MAX_PENALTY;let s=this.pfToFailureCost(i),a=Math.max(0,s-r);return Math.min(this.params.weights.NODE_PF_MAX_PENALTY,a*this.params.weights.NODE_PF_FACTOR)}computeG(e){let t=e,n=super.computeG(e);return t.lastPort&&t.lastPort.d.z!==t.port.d.z&&(n+=this.params.weights.LAYER_CHANGE_COST),t.nextRegion!==this.currentEndRegion?n:n+this.computeEndRegionCloseCost(t)}getPortUsagePenalty(e){let t=e.assignment;if(!t)return 0;let n=this.currentConnection?.mutuallyConnectedNetworkId;return t.connection.mutuallyConnectedNetworkId===n?0:0.5*Math.max(1,this.params.weights.NODE_PF_FACTOR)+this.params.weights.BASE_CANDIDATE_COST}getRipsRequiredForPortUsage(e,t,n){let o=e.assignments??[];if(o.length===0)return[];return o.filter((r)=>r.connection.mutuallyConnectedNetworkId!==this.currentConnection?.mutuallyConnectedNetworkId&&(r.regionPort1!==t&&r.regionPort2!==t&&(r.regionPort1!==n&&r.regionPort2!==n&&Ru(r.regionPort1.d,r.regionPort2.d,t.d,n.d))))}selectCandidatesForEnteringRegion(e){let t=this.currentConnection?.startRegion,n=this.currentConnection?.endRegion;$b(t,"Current connection or start region is undefined"),$b(n,"Current connection or end region is undefined");let o=e.filter((s)=>{let a=s.nextRegion;return!a?.d._containsObstacle||(a===t||a===n)}),r=this.params.flags.FORCE_CENTER_FIRST?this.getCenterFirstEnteringRegionCandidates(o):o,i=-this.params.weights.MIN_ALLOWED_BOARD_SCORE;if(i>0){let s=r.filter((a)=>a.g+a.h<=i);s.length>0&&(r=s)}return r}routeSolvedHook(e){this.baseRegionFailureCostMap.clear();let t=new Set;for(let r of e.path){let i=r.lastRegion;i&&t.add(i)}for(let r of t){let i=this.computeRegionPfFromAssignments(r);this.regionMemoryPfMap.set(r.regionId,i)}if(!e.requiredRip)return;if(this.unprocessedConnections.length<2)return;let[n,...o]=this.unprocessedConnections;this.unprocessedConnections=[...o,n]}computeRoutesToRip(e){let t=super.computePortOverlapRoutes(e),n=new Set(t),o=new Map;e.path.map((c)=>{if(!c.lastPort||!c.lastRegion)return;let l=this.getRipsRequiredForPortUsage(c.lastRegion,c.lastPort,c.port);if(l.length===0)return null;let h=o.get(c.lastRegion)??new Set;for(let d of l)h.add(d.solvedRoute);o.set(c.lastRegion,h)});let r=e.path.flatMap((c)=>c.lastRegion?[c.lastRegion]:[]),i=Array.from(new Set([...o.keys(),...r])),s=this.params.weights.SHUFFLE_SEED+this.iterations+this.solvedRoutes.length+this.totalRipCount,a=e6(i,s);for(let c of a){if(this.totalRipCount>=this.params.weights.MAX_RIPS)break;let l=this.getRegionRippingPfThreshold(c.regionId),h=this.computeRegionPf({region:c,newlySolvedRoute:e,routesToRip:n});if(this.regionMemoryPfMap.set(c.regionId,h),h<=l)continue;let d=new Set,u=0;for(;h>l&&!(this.totalRipCount>=this.params.weights.MAX_RIPS);){if(!c.assignments||c.assignments.length===0)throw Error("We are trying to rip a region with no assignments, this should not happen");let _=c.assignments.map((m)=>{let A=m.solvedRoute;return m.connection.connectionId===e.connection.connectionId?null:n.has(A)?void 0:A}).filter((m)=>!!m);if(_.length===0)break;let p=e6(_,s+u+d.size)[0];if(!p)break;d.add(p.connection),n.add(p),this.totalRipCount++,u++,this.regionRipCountMap.set(c.regionId,(this.regionRipCountMap.get(c.regionId)??0)+1),h=this.computeRegionPf({region:c,newlySolvedRoute:e,routesToRip:n}),this.regionMemoryPfMap.set(c.regionId,h)}}if(n.size>t.size){if(this.totalRipCount>=this.params.weights.MAX_RIPS)return n;let c=this.solvedRoutes.filter((u)=>!n.has(u)&&u.connection.connectionId!==e.connection.connectionId);if(c.length===0)return n;let l=Math.max(1,Math.floor(this.params.weights.RANDOM_RIP_FRACTION*c.length)),h=e6(c,s),d=0;for(let u of h){if(d>=l)break;if(this.totalRipCount>=this.params.weights.MAX_RIPS)break;n.has(u)||(n.add(u),d++,this.totalRipCount++)}}return n}computeDeviation(e){let t=this.currentConnection?.startRegion.d.center,n=this.currentConnection?.endRegion.d.center;return $b(t,"Current connection or start region is undefined"),$b(n,"Current connection or end region is undefined"),xc(e.port.d,t,n)}computeDistanceTraveled(e){let t=0,n=e;for(;n?.parent;)t+=kn(n.parent.port.d,n.port.d),n=n.parent;return t}computeMemoryPfPenalty(e){let t=Math.min(Math.max(e,0),0.999999),n=Math.min(this.params.weights.NODE_PF_MAX_PENALTY,-Math.log(1-t));return n*this.params.weights.MEMORY_PF_FACTOR+n*this.params.weights.NODE_PF_FACTOR*0.01}computeEndRegionCloseCost(e){let t=this.currentConnection,n=this.currentEndRegion;$b(t,"Current connection is undefined"),$b(n,"Current end region is undefined");let o=t.endRegion.d.center,r={portId:`end-target:${t.connectionId}`,region1:n,region2:n,d:{portId:`end-target:${t.connectionId}`,x:o.x,y:o.y,z:e.port.d.z,distToCentermostPortOnZ:0,regions:[n,n]}};return this.computeIncreasedRegionCostIfPortsAreUsed(n,e.port,r)}getCenterFirstEnteringRegionCandidates(e){let t=new Map;for(let o of e){let r=o.port.d.z,i=t.get(r)??[];i.push(o),t.set(r,i)}let n=[];for(let o of t.values()){let r=o.sort((c,l)=>c.port.d.distToCentermostPortOnZ-l.port.d.distToCentermostPortOnZ)[0];if(!r)continue;if(this.isPortAvailableForCurrentNet(r.port)){n.push(r);continue}let i=o.sort((c,l)=>c.port.d.x!==l.port.d.x?c.port.d.x-l.port.d.x:c.port.d.y-l.port.d.y),s=[],a=[];for(let c of i)this.isPortAvailableForCurrentNet(c.port)?a.push(c):a.length>0&&(s.push(a),a=[]);a.length>0&&s.push(a);for(let c of s)n.push(c[Math.floor(c.length/2)])}return n}isPortAvailableForCurrentNet(e){let t=e.assignment;if(!t)return!0;let n=this.currentConnection?.mutuallyConnectedNetworkId;return t.connection.mutuallyConnectedNetworkId===n}computeRegionPfFromAssignments(e){let t=this.getRegionAssignedPortPoints(e),n={...e.d,portPoints:t},o=D_(n),r=e.d;return ex(r,o.numSameLayerCrossings,o.numEntryExitLayerChanges,o.numTransitionPairCrossings)}clampPf(e){return Math.min(Math.max(e,0),0.999999)}get NODE_MAX_PF(){return Math.min(0.99999,1-Math.exp(-this.params.weights.NODE_PF_MAX_PENALTY))}pfToFailureCost(e){let t=this.clampPf(e);return t>=this.NODE_MAX_PF?this.params.weights.NODE_PF_MAX_PENALTY:-Math.log(1-t)}getBaseRegionFailureCost(e){let t=this.baseRegionFailureCostMap.get(e.regionId);if(t!=null)return t;let n=this.computeRegionPfFromAssignments(e),o=this.pfToFailureCost(n);return this.baseRegionFailureCostMap.set(e.regionId,o),o}getRegionAssignedPortPoints(e){return(e.assignments??[]).flatMap((t)=>{let n=t.regionPort1.d,o=t.regionPort2.d,r=t.connection.connectionId,i=t.connection.simpleRouteConnection?.__rootConnectionNames?.[0];return[{x:n.x,y:n.y,z:n.z,connectionName:r,rootConnectionName:i},{x:o.x,y:o.y,z:o.z,connectionName:r,rootConnectionName:i}]})}computeRegionPfWithAdditionalSegment(e,t,n,o,r){let i=this.getRegionAssignedPortPoints(e),s=[{x:t.d.x,y:t.d.y,z:t.d.z,connectionName:o,rootConnectionName:r},{x:n.d.x,y:n.d.y,z:n.d.z,connectionName:o,rootConnectionName:r}],a={...e.d,portPoints:[...i,...s]},c=D_(a);return ex(e.d,c.numSameLayerCrossings,c.numEntryExitLayerChanges,c.numTransitionPairCrossings)}getRegionRippingPfThreshold(e){let t=this.regionRipCountMap.get(e)??0,n=Math.max(1,Math.floor(this.params.weights.MAX_RIPS/10)),o=Math.min(1,t/n);return(this.params.weights.START_RIPPING_PF_THRESHOLD||0.3)*(1-o)+(this.params.weights.END_RIPPING_PF_THRESHOLD||1)*o}computeRegionPf({region:e,newlySolvedRoute:t,routesToRip:n}){let o=[...(e.assignments??[]).filter((a)=>!n.has(a.solvedRoute)).flatMap((a)=>{let{regionPort1:c,regionPort2:l}=a,h=a.connection.connectionId,d=a.connection.simpleRouteConnection?.__rootConnectionNames?.[0];return[{x:c.d.x,y:c.d.y,z:c.d.z,connectionName:h,rootConnectionName:d},{x:l.d.x,y:l.d.y,z:l.d.z,connectionName:h,rootConnectionName:d}]}),...t.path.flatMap((a)=>{if(!a.lastPort||a.lastRegion!==e)return[];let{lastPort:c,port:l}=a;return[{x:c.d.x,y:c.d.y,z:c.d.z,connectionName:t.connection.connectionId,rootConnectionName:t.connection.simpleRouteConnection?.__rootConnectionNames?.[0]},{x:l.d.x,y:l.d.y,z:l.d.z,connectionName:t.connection.connectionId,rootConnectionName:t.connection.simpleRouteConnection?.__rootConnectionNames?.[0]}]})],r={capacityMeshNodeId:e.d.capacityMeshNodeId,center:e.d.center,width:e.d.width,height:e.d.height,portPoints:o,availableZ:e.d.availableZ},i=D_(r),s=e.d;return ex(s,i.numSameLayerCrossings,i.numEntryExitLayerChanges,i.numTransitionPairCrossings)}computeNodePf(e){let t=this.getOutput().nodesWithPortPoints.find((r)=>r.capacityMeshNodeId===e.capacityMeshNodeId),n=this.params.graph.regions.find((r)=>r.d.capacityMeshNodeId===e.capacityMeshNodeId);if(!t||!n)return null;let o=D_(t);return ex(n.d,o.numSameLayerCrossings,o.numEntryExitLayerChanges,o.numTransitionPairCrossings)}getOutput(){new Map(this.params.graph.regions.map((r)=>[r.regionId,r]));let e=new Set;for(let r of this.params.connections)e.add(r.startRegion.regionId),e.add(r.endRegion.regionId);let t=new Map;for(let r of this.solvedRoutes){let i=r.path;if(i.length===0)continue;let s=i[0]?.port,a=i[i.length-1]?.port;if(!s||!a)continue;let c=r.connection.connectionId,l=r.connection,h=l.simpleRouteConnection?.__rootConnectionNames?.[0],d=r.connection.startRegion.regionId,u=r.connection.endRegion.regionId,_=t.get(d)??[];_.push({portPointId:s.d.portId,x:s.d.x,y:s.d.y,z:s.d.z,connectionName:c,rootConnectionName:h}),t.set(d,_);let p=t.get(u)??[];p.push({portPointId:a.d.portId,x:a.d.x,y:a.d.y,z:a.d.z,connectionName:c,rootConnectionName:h}),t.set(u,p)}let n=[],o=[];for(let r of this.params.graph.regions){let i=(r.assignments??[]).flatMap((l)=>{let h=l.connection.connectionId,d=l.connection.simpleRouteConnection?.__rootConnectionNames?.[0];return[{portPointId:l.regionPort1.d.portId,x:l.regionPort1.d.x,y:l.regionPort1.d.y,z:l.regionPort1.d.z,connectionName:h,rootConnectionName:d,nextPortPointId:l.regionPort2.d.portId},{portPointId:l.regionPort2.d.portId,x:l.regionPort2.d.x,y:l.regionPort2.d.y,z:l.regionPort2.d.z,connectionName:h,rootConnectionName:d,prevPortPointId:l.regionPort1.d.portId}]}),s=[];if(r.d._containsObstacle&&e.has(r.regionId)){let l=t.get(r.regionId)??[],h=[];for(let u of l)i.some((_)=>_.connectionName===u.connectionName&&_.rootConnectionName===u.rootConnectionName&&_.portPointId===u.portPointId)||h.push(u);i.push(...h);let d=new Map;for(let u of i){let _=`${u.connectionName}::${u.rootConnectionName??""}`,p=d.get(_)??[];p.push(u),d.set(_,p)}for(let[u,_]of d.entries()){let[p,m=""]=u.split("::"),A=_[0];if(!A)continue;let g={portPointId:`center:${r.regionId}:${p}:${m}`,x:r.d.center.x,y:r.d.center.y,z:A.z,connectionName:p,rootConnectionName:m||void 0};if(_.length>=2){let f=_[_.length-1];A.portPointId&&(A.nextPortPointId=g.portPointId,g.prevPortPointId=A.portPointId),f.portPointId&&(f.prevPortPointId=g.portPointId,g.nextPortPointId=f.portPointId)}s.push(g)}}let a=[...i,...s];a.length>0&&n.push({capacityMeshNodeId:r.d.capacityMeshNodeId,center:r.d.center,width:r.d.width,height:r.d.height,portPoints:a,availableZ:r.d.availableZ});let c=r.ports.map((l)=>{let h=l.d,d=l.d.regions.some((u)=>Boolean(u.d._offBoardConnectionId));return{portPointId:l.d.portId,x:l.d.x,y:l.d.y,z:l.d.z,prevPortPointId:h.prevPortPointId,nextPortPointId:h.nextPortPointId,connectionNodeIds:l.d.regions.map((u)=>u.regionId),distToCentermostPortOnZ:l.d.distToCentermostPortOnZ,connectsToOffBoardNode:d}});o.push({capacityMeshNodeId:r.d.capacityMeshNodeId,center:r.d.center,width:r.d.width,height:r.d.height,portPoints:c,availableZ:r.d.availableZ,_containsObstacle:r.d._containsObstacle,_containsTarget:r.d._containsTarget,_offBoardConnectionId:r.d._offBoardConnectionId,_offBoardConnectedCapacityMeshNodeIds:r.d._offBoardConnectedCapacityMeshNodeIds})}return{nodesWithPortPoints:n,inputNodeWithPortPoints:o}}visualize(){return function(e){let t={};return t=e.reduce((n,o)=>n&&o?pV(n,o):{},t),t||{}}([p4r(this.params.graph),this.visualizePfOverlay(),u4r(this.params.connections,this.params.colorMap??{}),h4r(this.candidateQueue.peekMany(100),this.currentConnection?.startRegion.d.center),d4r(this.solvedRoutes,this.params.colorMap??{})])}visualizePfOverlay(){let e=this.getOutput(),t=e?.inputNodeWithPortPoints??[],n=new Map((e?.nodesWithPortPoints??[]).map((r)=>[r.capacityMeshNodeId,r])),o={rects:[]};for(let r of t){let i=this.computeNodePf(r),s=i??0,a=n.get(r.capacityMeshNodeId),c=a?D_(a):{numSameLayerCrossings:0,numEntryExitLayerChanges:0,numTransitionPairCrossings:0},l=Math.min(255,Math.floor(512*s)),h=Math.max(0,255-Math.floor(512*s)),d=`rgba(${l}, ${h}, ${h}, ${s<0.001?"0.1":"0.3"})`;r._containsObstacle&&(d="rgba(255, 0, 0, 0.3)"),r._offBoardConnectedCapacityMeshNodeIds?.length&&(d="rgba(255, 165, 0, 0.3)"),o.rects.push({center:r.center,width:r.width-0.2,height:r.height-0.2,layer:`z${r?.availableZ?.join(",")}`,fill:d,label:`${r.capacityMeshNodeId}
pf: ${i===null?"n/a":i.toFixed(3)}
xSame: ${c.numSameLayerCrossings}, xLC: ${c.numEntryExitLayerChanges}, xTransition: ${c.numTransitionPairCrossings}`})}return o}},m4r=(e)=>{if(!e.assignments||e.assignments.length===0)return e.d?.assignment?0:1;let t=e.assignments.flatMap((r)=>{let i=r.regionPort1.d,s=r.regionPort2.d,a=r.connection.connectionId,c=r.connection,l=c.simpleRouteConnection?.__rootConnectionNames?.[0];return[{x:i.x,y:i.y,z:i.z,connectionName:a,rootConnectionName:l},{x:s.x,y:s.y,z:s.z,connectionName:a,rootConnectionName:l}]}),n={...e.d,portPoints:t},o=D_(n);return ex(e.d,o.numSameLayerCrossings,o.numEntryExitLayerChanges,o.numTransitionPairCrossings)};function Wb(e,t,n,o={}){return{solverName:e,solverClass:t,getConstructorParams:n,onSolved:o.onSolved}}var asn=class extends ei{constructor(e,t={}){super(),this.srj=e,this.opts=t,this.srj=e,this.opts={...t},this.viaDiameter=rm(e).padDiameter,this.minTraceWidth=e.minTraceWidth;let n=this.opts;if(this.effort=n.effort??1,this.MAX_ITERATIONS=1e8*this.effort,n.capacityDepth===void 0){let o=e.bounds.maxX-e.bounds.minX,r=e.bounds.maxY-e.bounds.minY,i=Math.max(o,r),s=n.targetMinCapacity??0.5;n.capacityDepth=ik(i,s)}this.connMap=im(e),this.colorMap=JA(e,this.connMap),this.cacheProvider=n.cacheProvider===void 0?hv():n.cacheProvider===null?null:n.cacheProvider,this.startTimeOfPhase={},this.endTimeOfPhase={},this.timeSpentOnPhase={}}srj;opts;netToPointPairsSolver;nodeSolver;nodeTargetMerger;edgeSolver;colorMap;highDensityRouteSolver;highDensityStitchSolver;singleLayerNodeMerger;strawSolver;deadEndSolver;traceSimplificationSolver;availableSegmentPointSolver;portPointPathingSolver;multiSectionPortPointOptimizer;uniformPortDistributionSolver;traceWidthSolver;necessaryCrampedPortPointSolver;hyperGraphSectionOptimizer;viaDiameter;minTraceWidth;effort;startTimeOfPhase;endTimeOfPhase;timeSpentOnPhase;activeSubSolver=null;connMap;srjWithPointPairs;capacityNodes=null;capacityEdges=null;cacheProvider=null;pipelineDef=[Wb("netToPointPairsSolver",Vq,(e)=>[e.srj,e.colorMap,nk(e.srj)],{onSolved:(e)=>{e.srjWithPointPairs=e.netToPointPairsSolver?.getNewSimpleRouteJson(),e.colorMap=JA(e.srjWithPointPairs,this.connMap),e.connMap=im(e.srjWithPointPairs)}}),Wb("nodeSolver",Qq,(e)=>[{simpleRouteJson:e.srjWithPointPairs,maxGapFillPasses:4}],{onSolved:(e)=>{e.capacityNodes=e.nodeSolver?.getOutput().meshNodes??[]}}),Wb("edgeSolver",ok,(e)=>[e.capacityNodes],{onSolved:(e)=>{e.capacityEdges=e.edgeSolver?.edges}}),Wb("availableSegmentPointSolver",tY,(e)=>[{nodes:e.capacityNodes,edges:e.capacityEdges||[],traceWidth:e.minTraceWidth,colorMap:e.colorMap,shouldReturnCrampedPortPoints:!0}]),Wb("necessaryCrampedPortPointSolver",jle,(e)=>[{capacityMeshNodes:e.capacityNodes,sharedEdgeSegments:e.availableSegmentPointSolver.getOutput(),simpleRouteJson:e.srjWithPointPairs}]),Wb("portPointPathingSolver",OOt,(e)=>{let t=e.necessaryCrampedPortPointSolver?.getOutput()??e.availableSegmentPointSolver.getOutput(),{graph:n,connections:o}=Kle({capacityMeshNodes:e.capacityNodes,layerCount:e.srj.layerCount,connectivityMap:e.connMap,segmentPortPoints:t.flatMap((r)=>r.portPoints),simpleRouteJsonConnections:e.srjWithPointPairs.connections});return[{graph:n,connections:o,layerCount:e.srj.layerCount,effort:Math.min(1,e.effort),flags:{FORCE_CENTER_FIRST:!0,RIPPING_ENABLED:!0},weights:{SHUFFLE_SEED:0,MEMORY_PF_FACTOR:4,CENTER_OFFSET_DIST_PENALTY_FACTOR:0,CENTER_OFFSET_FOCUS_SHIFT:0,NODE_PF_FACTOR:0,LAYER_CHANGE_COST:0,RIPPING_PF_COST:0,NODE_PF_MAX_PENALTY:100,BASE_CANDIDATE_COST:0.6,MAX_ITERATIONS_PER_PATH:0,RANDOM_WALK_DISTANCE:0,START_RIPPING_PF_THRESHOLD:0.3,END_RIPPING_PF_THRESHOLD:1,MAX_RIPS:1000,RANDOM_RIP_FRACTION:0.3,STRAIGHT_LINE_DEVIATION_PENALTY_FACTOR:4,GREEDY_MULTIPLIER:0.7,MIN_ALLOWED_BOARD_SCORE:-1e4}}]}),Wb("hyperGraphSectionOptimizer",Cxr,(e)=>{let t=e.portPointPathingSolver;return[{hyperGraphSolver:t,inputSolvedRoutes:t.solvedRoutes,expansionHopsFromCentralRegion:1,createHyperGraphSolver:(n)=>new OOt({graph:n.inputGraph,connections:n.inputConnections,inputSolvedRoutes:n.inputSolvedRoutes,layerCount:e.srj.layerCount,effort:Math.min(1,e.effort),flags:{FORCE_CENTER_FIRST:!0,RIPPING_ENABLED:!0},weights:{SHUFFLE_SEED:0,MEMORY_PF_FACTOR:4,CENTER_OFFSET_DIST_PENALTY_FACTOR:0,CENTER_OFFSET_FOCUS_SHIFT:0,NODE_PF_FACTOR:0,LAYER_CHANGE_COST:0,RIPPING_PF_COST:0,NODE_PF_MAX_PENALTY:100,BASE_CANDIDATE_COST:0.6,MAX_ITERATIONS_PER_PATH:0,RANDOM_WALK_DISTANCE:0,START_RIPPING_PF_THRESHOLD:0.3,END_RIPPING_PF_THRESHOLD:1,MAX_RIPS:1000,RANDOM_RIP_FRACTION:0.3,STRAIGHT_LINE_DEVIATION_PENALTY_FACTOR:4,GREEDY_MULTIPLIER:0.7,MIN_ALLOWED_BOARD_SCORE:-1e4}}),regionCost:m4r,effort:Math.min(1,e.effort),ACCEPTABLE_REGION_COST:0.1,MAX_ATTEMPTS_PER_REGION:Math.max(3,3*Math.min(1,e.effort)),MAX_ATTEMPTS_PER_SECTION:Math.max(50,50*Math.min(1,e.effort)),FRACTION_TO_REPLACE:1,alwaysRipConflicts:!0}]}),Wb("uniformPortDistributionSolver",Tle,(e)=>[{nodeWithPortPoints:e.portPointPathingSolver?.getOutput().nodesWithPortPoints??[],inputNodesWithPortPoints:e.portPointPathingSolver?.getOutput().inputNodeWithPortPoints??[],minTraceWidth:e.minTraceWidth,obstacles:e.srj.obstacles,layerCount:e.srj.layerCount}]),Wb("highDensityRouteSolver",cY,(e)=>[{nodePortPoints:e.uniformPortDistributionSolver?.getOutput()??[],nodePfById:new Map((e.portPointPathingSolver?.getOutput().inputNodeWithPortPoints??[]).map((t)=>[t.capacityMeshNodeId,e.portPointPathingSolver?.computeNodePf(t)??null])),colorMap:e.colorMap,connMap:e.connMap,viaDiameter:e.viaDiameter,traceWidth:e.minTraceWidth}]),Wb("highDensityStitchSolver",PZe,(e)=>[{connections:e.srjWithPointPairs.connections,hdRoutes:e.highDensityRouteSolver.routes,colorMap:e.colorMap,layerCount:e.srj.layerCount,defaultViaDiameter:e.viaDiameter}]),Wb("traceSimplificationSolver",s6,(e)=>[{hdRoutes:e.highDensityStitchSolver.mergedHdRoutes,obstacles:e.srj.obstacles,connMap:e.connMap,colorMap:e.colorMap,outline:e.srj.outline,defaultViaDiameter:e.viaDiameter,layerCount:e.srj.layerCount,iterations:2}]),Wb("traceWidthSolver",Yq,(e)=>[{hdRoutes:e.traceSimplificationSolver.simplifiedHdRoutes,obstacles:e.srj.obstacles,connMap:e.connMap,colorMap:e.colorMap,minTraceWidth:e.minTraceWidth,connection:e.srj.connections,layerCount:e.srj.layerCount}])];getConstructorParams(){return[this.srj,this.opts]}currentPipelineStepIndex=0;_step(){let e=this.pipelineDef[this.currentPipelineStepIndex];if(!e)return void(this.solved=!0);if(this.activeSubSolver)return this.activeSubSolver.step(),void(this.activeSubSolver.solved?(this.endTimeOfPhase[e.solverName]=performance.now(),this.timeSpentOnPhase[e.solverName]=this.endTimeOfPhase[e.solverName]-this.startTimeOfPhase[e.solverName],e.onSolved?.(this),this.activeSubSolver=null,this.currentPipelineStepIndex++):this.activeSubSolver.failed&&(this.error=this.activeSubSolver?.error,this.failed=!0,this.activeSubSolver=null));let t=e.getConstructorParams(this);this.activeSubSolver=new e.solverClass(...t),this[e.solverName]=this.activeSubSolver,this.timeSpentOnPhase[e.solverName]=0,this.startTimeOfPhase[e.solverName]=performance.now()}solveUntilPhase(e){for(;this.getCurrentPhase()!==e;)this.step()}getCurrentPhase(){return this.pipelineDef[this.currentPipelineStepIndex]?.solverName??"none"}visualize(){if(!this.solved&&this.activeSubSolver)return this.activeSubSolver.visualize();let e=this.netToPointPairsSolver?.visualize(),t=this.nodeSolver?.visualize(),n=this.nodeTargetMerger?.visualize(),o=this.singleLayerNodeMerger?.visualize(),r=this.strawSolver?.visualize(),i=this.edgeSolver?.visualize(),s=this.deadEndSolver?.visualize(),a=this.availableSegmentPointSolver?.visualize(),c=this.portPointPathingSolver?.visualize(),l=this.multiSectionPortPointOptimizer?.visualize(),h=this.uniformPortDistributionSolver?.visualize(),d=this.highDensityRouteSolver?.visualize(),u=this.highDensityStitchSolver?.visualize(),_=this.traceSimplificationSolver?.visualize(),p=this.necessaryCrampedPortPointSolver?.visualize(),m=this.highDensityRouteSolver?.visualize(),A=this.srj.outline,g=[];if(g.push({points:[{x:this.srj.bounds?.minX??-50,y:this.srj.bounds?.minY??-50},{x:this.srj.bounds?.maxX??50,y:this.srj.bounds?.minY??-50},{x:this.srj.bounds?.maxX??50,y:this.srj.bounds?.maxY??50},{x:this.srj.bounds?.minX??-50,y:this.srj.bounds?.maxY??50},{x:this.srj.bounds?.minX??-50,y:this.srj.bounds?.minY??-50}],strokeColor:"rgba(255,0,0,0.25)"}),A&&A.length>=2){let C=A.map((b)=>({x:b.x,y:b.y}));C.push({...C[0]}),g.push({points:C,strokeColor:"rgba(0, 136, 255, 0.95)"})}let f=bB(this.srj),y={points:[...this.srj.connections.flatMap((C)=>C.pointsToConnect.map((b)=>({...b,layer:IB(b,this.srj.layerCount),label:`${C.name} ${b.pcb_port_id??""}`})))],rects:[...(this.srj.obstacles??[]).filter((C)=>!C.isCopperPour).map((C)=>({...C,fill:C.layers?.includes("top")?"rgba(255,0,0,0.25)":C.layers?.includes("bottom")?"rgba(0,0,255,0.25)":"rgba(255,0,0,0.25)",layer:$S(C,this.srj.layerCount),label:f(C)}))],lines:g},x=[y,e,t,n,o,r,i,s,a,p,c,m,l,h,d?Bl(y,d):null,u,_,this.solved?Bl({lines:g},rx(this.getOutputSimpleRouteJson())):null].filter(Boolean);return Bl(...x)}preview(){if(this.highDensityRouteSolver){let e=[];for(let t=this.highDensityRouteSolver.routes.length-1;t>=0;t--){let n=this.highDensityRouteSolver.routes[t];if(e.push({points:n.route.map((o)=>({x:o.x,y:o.y})),strokeColor:this.colorMap[n.connectionName]}),e.length>200)break}return{lines:e}}return this.netToPointPairsSolver?this.netToPointPairsSolver.visualize():{}}_getOutputHdRoutes(){return this.traceWidthSolver?.getHdRoutesWithWidths()??this.traceSimplificationSolver?.simplifiedHdRoutes??this.highDensityStitchSolver.mergedHdRoutes}getOutputSimplifiedPcbTraces(){if(!this.solved||!this.highDensityRouteSolver)throw Error("Cannot get output before solving is complete");let e=[],t=this._getOutputHdRoutes();for(let n of this.netToPointPairsSolver?.newConnections??[]){let o=n.__netConnectionName??this.srj.connections.find((i)=>i.name===n.name)?.__netConnectionName,r=t.filter((i)=>i.connectionName===n.name);for(let i=0;i<r.length;i++){let s=r[i],a={type:"pcb_trace",pcb_trace_id:`${n.name}_${i}`,connection_name:o??n.__rootConnectionNames?.[0]??n.name,route:k3(s,this.srj.layerCount)};e.push(a)}}return e}getOutputSimpleRouteJson(){return{...this.srj,traces:this.getOutputSimplifiedPcbTraces()}}},_4r=class{MAX_ITERATIONS=1000;solved=!1;failed=!1;iterations=0;progress=0;error=null;activeSubSolver;failedSubSolvers;timeToSolve;stats={};pendingEffects;cacheHit;cacheKey;cacheToSolveSpaceTransform;getSolverName(){return this.constructor.name}step(){if(!this.solved&&!this.failed){this.iterations++;try{this._step()}catch(e){throw this.error=`${this.getSolverName()} error: ${e}`,console.error(this.error),this.failed=!0,e}!this.solved&&this.iterations>this.MAX_ITERATIONS&&this.tryFinalAcceptance(),!this.solved&&this.iterations>this.MAX_ITERATIONS&&(this.error=`${this.getSolverName()} ran out of iterations (MAX_ITERATIONS=${this.MAX_ITERATIONS})`,this.failed=!0),"computeProgress"in this&&(this.progress=this.computeProgress())}}_step(){}getConstructorParams(){throw Error("getConstructorParams not implemented")}solve(){let e=Date.now();for(;!this.solved&&!this.failed;)this.step();let t=Date.now();this.timeToSolve=t-e}visualize(){return{lines:[],points:[],rects:[],circles:[]}}tryFinalAcceptance(){}preview(){return{lines:[],points:[],rects:[],circles:[]}}},g4r=(e,t)=>{let n=(h)=>h===" "||h===`
`||h==="\r"||h==="\t",o=(h)=>{let d=0,u=h.length;for(;d<u&&n(h[d]);)d+=1;for(;u>d&&n(h[u-1]);)u-=1;return h.slice(d,u)},r=(h)=>{let d=[],u=0,_=0;for(let p=0;p<h.length;p+=1){let m=h[p];m!=="("?m!==")"?m===","&&_===0&&(d.push(o(h.slice(u,p))),u=p+1):_>0&&(_-=1):_+=1}return d.push(o(h.slice(u))),d},i=(h)=>{return`${d=h,Math.min(1,Math.max(0,d))}`;var d},s=((h)=>{let d=o(h);if(!d.startsWith("#"))return null;let u=d.slice(1);if(u.length!==3&&u.length!==6)return null;for(let _ of u){let p=_.toLowerCase();if(!(p>="0"&&p<="9")&&!(p>="a"&&p<="f"))return null}if(u.length===3){let[_,p,m]=u;return{r:Number.parseInt(_+_,16),g:Number.parseInt(p+p,16),b:Number.parseInt(m+m,16)}}return{r:Number.parseInt(u.slice(0,2),16),g:Number.parseInt(u.slice(2,4),16),b:Number.parseInt(u.slice(4,6),16)}})(t);if(s)return`rgba(${s.r}, ${s.g}, ${s.b}, ${i(1-e)})`;let a=((h)=>{let d=o(h),u=d.indexOf("(");return u<=0||d[d.length-1]!==")"?null:{name:o(d.slice(0,u)).toLowerCase(),args:r(d.slice(u+1,-1))}})(t);if(!a)return t;let{name:c,args:l}=a;if(c==="hsl"||c==="rgb")return l.length!==3?t:`${c}a(${l[0]}, ${l[1]}, ${l[2]}, ${i(1-e)})`;if(c==="hsla"||c==="rgba"){if(l.length!==4)return t;let h=((d)=>{let u=o(d);if(!u)return null;let _=Number.parseFloat(u);return Number.isFinite(_)?_:null})(l[3]);return h===null?t:`${c}(${l[0]}, ${l[1]}, ${l[2]}, ${i(h-e)})`}return t},A4r=(e,t)=>{try{return g4r(t,e)}catch(n){return console.error(n),e}},csn=(e)=>e.rootConnectionName??e.connectionName,_le=(e)=>{let t=[];for(let n=0;n<e.route.length-1;n+=1){let o=e.route[n],r=e.route[n+1];if(!o||!r||o.z===r.z)continue;if(Math.abs(o.x-r.x)>0.000001||Math.abs(o.y-r.y)>0.000001)continue;let i={x:Math.round(1000*o.x)/1000,y:Math.round(1000*o.y)/1000},s=t.at(-1);s&&s.x===i.x&&s.y===i.y||t.push(i)}return t},W$=(e,t,n=0.001)=>Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n,zZe=(e,t)=>({minX:e.center.x-e.width/2+t,maxX:e.center.x+e.width/2-t,minY:e.center.y-e.height/2+t,maxY:e.center.y+e.height/2-t}),om=(e,t)=>{let n=Math.max(Math.abs(e),Math.abs(t));if(n===0||n===Number.POSITIVE_INFINITY)return n;let o=e/n,r=t/n;return n*Math.sqrt(o*o+r*r)},YXe=(e,t)=>({x:e.x-t.x,y:e.y-t.y}),Rae=(e,t)=>e.x*t.x+e.y*t.y,VOt=(e,t,n)=>({x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}),sB=(e)=>{let t=[];for(let n=0;n<e.length;n+=1){let o=e[n];if(o)for(let r=0;r<o.route.length-1;r+=1){let i=o.route[r],s=o.route[r+1];i&&s&&(i.z!==s.z||W$(i,s)||t.push({routeIndex:n,rootConnectionName:csn(o),startIndex:r,endIndex:r+1,start:i,end:s,z:i.z,traceRadius:(o.traceThickness??0.1)/2}))}}return t},uce=(e,t,n=0.000001)=>{let o=t.end.x-t.start.x,r=t.end.y-t.start.y,i=o*o+r*r;if(i<=n)return{x:t.start.x,y:t.start.y,t:0};let s=((e.x-t.start.x)*o+(e.y-t.start.y)*r)/i,a=(c=s,Math.max(0,Math.min(c,1)));var c;return{x:t.start.x+o*a,y:t.start.y+r*a,t:a}},GQ=(e,t,n=0.000001)=>{let o=YXe(e.end,e.start),r=YXe(t.end,t.start),i=YXe(e.start,t.start),s=Rae(o,o),a=Rae(o,r),c=Rae(r,r),l=Rae(o,i),h=Rae(r,i),d=s*c-a*a,u=n,_,p,m=d,A=d;d<=u?(_=0,m=1,p=h,A=c):(_=a*h-c*l,p=s*h-a*l,_<0?(_=0,p=h,A=c):_>m&&(_=m,p=h+a,A=c)),p<0?(p=0,-l<0?_=0:-l>s?_=m:(_=-l,m=s)):p>A&&(p=A,-l+a<0?_=0:-l+a>s?_=m:(_=-l+a,m=s));let g=Math.abs(_)<=u?0:_/m,f=Math.abs(p)<=u?0:p/A,y=VOt(e.start,e.end,g),x=VOt(t.start,t.end,f),C=uce(e.start,t,n),b=uce(e.end,t,n),I=uce(t.start,e,n),v=uce(t.end,e,n);return[{leftT:g,rightT:f,leftPoint:y,rightPoint:x},{leftT:0,rightT:C.t,leftPoint:e.start,rightPoint:C},{leftT:1,rightT:b.t,leftPoint:e.end,rightPoint:b},{leftT:I.t,rightT:0,leftPoint:I,rightPoint:t.start},{leftT:v.t,rightT:1,leftPoint:v,rightPoint:t.end}].sort((P,M)=>om(P.leftPoint.x-P.rightPoint.x,P.leftPoint.y-P.rightPoint.y)-om(M.leftPoint.x-M.rightPoint.x,M.leftPoint.y-M.rightPoint.y))},RS=0.000001,pce=(e)=>{let t=[];for(let n of e){let o=t[n.routeIndex]??[];o[n.startIndex]=n,t[n.routeIndex]=o}return t},lsn=(e,t)=>e<t?[e,t]:[t,e],X3e=(e,t)=>e.some(([n,o])=>n===t[0]&&o===t[1]),YOt=(e,t,n)=>{let o,r=Number.POSITIVE_INFINITY;for(let i of e){if(i.routeIndex!==t.routeIndex||i.z!==t.z||i.endIndex!==t.startIndex&&i.startIndex!==t.endIndex)continue;let[s]=GQ(i,n);if(!s)continue;let a=om(s.leftPoint.x-s.rightPoint.x,s.leftPoint.y-s.rightPoint.y);a>=r||(r=a,o=i)}return o},GOt=(e,t)=>{let n=sB(t),o=sB(e),r=pce(o),i=[];for(let s=0;s<n.length;s+=1){let a=n[s];if(a)for(let c=s+1;c<n.length;c+=1){let l=n[c];if(!l||a.z!==l.z||a.rootConnectionName===l.rootConnectionName||Math.max(a.start.x,a.end.x)<Math.min(l.start.x,l.end.x)||Math.max(l.start.x,l.end.x)<Math.min(a.start.x,a.end.x)||Math.max(a.start.y,a.end.y)<Math.min(l.start.y,l.end.y)||Math.max(l.start.y,l.end.y)<Math.min(a.start.y,a.end.y))continue;let[h]=GQ(a,l);if(!h||om(h.leftPoint.x-h.rightPoint.x,h.leftPoint.y-h.rightPoint.y)>RS||h.leftT<=RS||h.leftT>=0.999999||h.rightT<=RS||h.rightT>=0.999999)continue;let d=r[a.routeIndex]?.[a.startIndex],u=r[l.routeIndex]?.[l.startIndex];if(!d||!u)continue;let[_]=GQ(d,u);if(!_||om(_.leftPoint.x-_.rightPoint.x,_.leftPoint.y-_.rightPoint.y)<=RS)continue;let p=YOt(o,d,u),m=YOt(o,u,d),A=p?[d,p]:[d],g=m?[u,m]:[u];for(let f of A)for(let y of g){let x={leftRouteIndex:a.routeIndex,leftStartPointIndex:f.startIndex,rightRouteIndex:l.routeIndex,rightStartPointIndex:y.startIndex};i.some((C)=>C.leftRouteIndex===x.leftRouteIndex&&C.leftStartPointIndex===x.leftStartPointIndex&&C.rightRouteIndex===x.rightRouteIndex&&C.rightStartPointIndex===x.rightStartPointIndex)||i.push(x)}}}return i},GXe=(e)=>{let t=sB(e),n=[];for(let o=0;o<t.length;o+=1){let r=t[o];if(r)for(let i=o+1;i<t.length;i+=1){let s=t[i];if(!s||r.z!==s.z||r.rootConnectionName===s.rootConnectionName)continue;let[a]=GQ(r,s);if(!a)continue;if(om(a.leftPoint.x-a.rightPoint.x,a.leftPoint.y-a.rightPoint.y)+RS<r.traceRadius+s.traceRadius){let c=lsn(r.routeIndex,s.routeIndex);X3e(n,c)||n.push(c)}}}return n},u$e=(e,t)=>t<=1||t>=e-2,hsn=(e,t)=>t.some((n)=>u$e(e,n)),j3e=0.2,p$e=0.4,f4r=0.7000000000000001,u3e=0.03,UOt=1000,nu=0.000001,OZe=0.015,WOt=(e)=>Math.round(e*UOt)/UOt,UXe=(e,t)=>({x:e.x-t.x,y:e.y-t.y}),dsn=(e,t)=>({x:e.x*t,y:e.y*t}),XOt=(e,t)=>e.x*t.x+e.y*t.y,y4r=(e,t,n)=>({x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}),KV=(e)=>Math.max(0,Math.min(e,1)),Mq=(e,t,n)=>Math.max(t,Math.min(e,n)),usn=(e,t)=>{let n=((o)=>om(o.x,o.y))(e);return n<=t||n<=nu?e:dsn(e,t/n)},psn=(e,t=0)=>({minX:e.center.x-e.width/2-t,maxX:e.center.x+e.width/2+t,minY:e.center.y-e.height/2-t,maxY:e.center.y+e.height/2+t}),x4r=(e,t,n=0)=>{let o=psn(t,n);return e.x>=o.minX&&e.x<=o.maxX&&e.y>=o.minY&&e.y<=o.maxY},C4r=(e,t,n)=>{if(e.regionId){let s=t.findIndex((a)=>a.capacityMeshNodeId===e.regionId);if(s!==-1)return s}let o=[...e.route.map(({x:s,y:a})=>({x:s,y:a})),...e.vias.map(({x:s,y:a})=>({x:s,y:a}))],r=-1,i=Number.POSITIVE_INFINITY;for(let s=0;s<t.length;s++){let a=t[s];if(!a||!o.every((l)=>x4r(l,a,n)))continue;let c=a.width*a.height;c<i&&(i=c,r=s)}return r},jOt=(e,t,n,o)=>{let r=((i,s,a)=>{let c=Math.min(Math.abs(i.originalX-a.minX),Math.abs(a.maxX-i.originalX)),l=Math.min(Math.abs(i.originalY-a.minY),Math.abs(a.maxY-i.originalY));if(Math.abs(c-l)<=nu)return Math.abs(s.x-i.x)>=Math.abs(s.y-i.y)?"y":"x";return c<l?"y":"x"})(e,t,n);return usn(r==="x"?{x:1.1*(e.x-t.x)*o,y:0}:{x:0,y:1.1*(e.y-t.y)*o},0.06*o)},M$=(e,t,n,o,r=3.5,i=0.2,s=0.4)=>{let a=Math.max(e,0);if(a>=s)return 0;let c=a/i;if(c<1){let d=1-c;return t*d**3*(1+d*r)}let l=(a-i)/Math.max(s-i,nu),h=t*n*Math.exp(-l*o);return h<0.00001?0:h},b4r=(e,t)=>{let n=e.boundaryPadding>0?0.001:0,o=t.minX+e.boundaryPadding+n,r=t.maxX-e.boundaryPadding-n,i=t.minY+e.boundaryPadding+n,s=t.maxY-e.boundaryPadding-n;e.x=Mq(e.x,o,r),e.y=Mq(e.y,i,s)},m$e=(e,t)=>{for(let n of e)for(let o of n.nodes)b4r(o,t)},msn=(e)=>e.kind==="via"?0.4:0.25,I4r=(e)=>(e.kind,0.5),_sn=(e)=>e.kind==="via"?12:3.5,v4r=(e)=>e.kind==="via"?0.18:0.06,S4r=(e)=>e.kind==="via"?1.35:1.05,P4r=(e,t)=>e.kind==="via"?3*t:t,_$e=(e,t,n,o)=>{let r=2*t;e[r]=(e[r]??0)+n,e[r+1]=(e[r+1]??0)+o},xV=(e,t,n,o,r,i)=>{if(e.fixed||_$e(o,e.node.forceIndex,t,n),!e.fixed&&r&&i!==void 0){let s=2*i;r[s]=(r[s]??0)+t,r[s+1]=(r[s+1]??0)+n}},gsn=(e,t,n,o,r=0.5)=>{let{startNode:i,endNode:s}=e,a=1-KV(r),c=KV(r),l=i.fixed?0:a,h=s.fixed?0:c,d=l+h;if(!(d<=nu)){if(!i.fixed&&l>0){let u=l/d;_$e(o,i.forceIndex,t*u,n*u)}if(!s.fixed&&h>0){let u=h/d;_$e(o,s.forceIndex,t*u,n*u)}}},E4r=(e,t,n,o,r)=>{if(t.fixed)return{x:0,y:0};let{minX:i,maxX:s,minY:a,maxY:c}=e,l=((p)=>p.kind==="via"?0.65:j3e)(t),h=((p)=>p.kind==="via"?f4r:p$e)(t),d=((p)=>p.kind==="via"?0.015:0.08)(t),u=((p)=>p.kind==="via"?80:20)(t),_=_sn(t);return{x:M$(n-i,u3e,d,u,_,l,h)*r-M$(s-n,u3e,d,u,_,l,h)*r,y:M$(o-a,u3e,d,u,_,l,h)*r-M$(c-o,u3e,d,u,_,l,h)*r}},M4r=(e)=>{if(e.length===0)return null;let t=new R_(e.length);for(let n of e){let{startNode:o,endNode:r}=n;t.add(Math.min(o.x,r.x),Math.min(o.y,r.y),Math.max(o.x,r.x),Math.max(o.y,r.y))}return t.finish(),{index:t,segments:e}},Asn=(e)=>{let t=new Map,n=new Map;for(let o of e){let r=n.get(o.z)??[];r.push(o),n.set(o.z,r)}for(let[o,r]of n){let i=M4r(r);i&&t.set(o,i)}return{byLayer:t}},fsn=(e,t,n,o,r)=>{let i=(a)=>({candidateIndexes:a.index.search(n-r,o-r,n+r,o+r),segments:a.segments});if(t.kind==="point"){let a=e.byLayer.get(t.z);return a?[i(a)]:[]}let s=[];for(let a of e.byLayer.values())s.push(i(a));return s},w4r=(e)=>{let t=[];for(let n=0;n<e.length;n+=1){let o=e[n];if(!o)continue;let r=new Set;for(let i=0;i<o.route.length-1;i+=1){let s=o.route[i],a=o.route[i+1];if(!s||!a)continue;if(s.z===a.z||!W$(s,a))continue;let c=[i,i+1];for(let d=i-1;d>=0;d-=1){let u=o.route[d];if(!u||!W$(u,s))break;c.push(d)}for(let d=i+2;d<o.route.length;d+=1){let u=o.route[d];if(!u||!W$(u,s))break;c.push(d)}let l=[...new Set(c)].sort((d,u)=>d-u),h=!1;for(let d of l)if(r.has(d)){h=!0;break}if(!h){for(let d of l)r.add(d);t.push({routeIndex:n,rootConnectionName:csn(o),pointIndexes:l,x:s.x,y:s.y,radius:(o.viaDiameter??0.3)/2,movable:!hsn(o.route.length,l)})}}}return t},g$e=(e)=>{let{routes:t,via:n,dx:o,dy:r,node:i}=e;if(!n.movable)return!1;n.x+=o,n.y+=r,((a,c)=>{let l=zZe(c,a.radius+nu);a.x=Mq(a.x,l.minX,l.maxX),a.y=Mq(a.y,l.minY,l.maxY)})(n,i);let s=t[n.routeIndex];if(!s)return!1;for(let a of n.pointIndexes){let c=s.route[a];c&&(c.x=n.x,c.y=n.y)}return!0},B4r=(e)=>{let{routes:t,node:n,vias:o}=e,r=!1;for(let i=0;i<o.length;i+=1){let s=o[i];if(s)for(let a=i+1;a<o.length;a+=1){let c=o[a];if(!c)continue;let l=s.radius+c.radius+0.1+OZe,h=s.x-c.x,d=s.y-c.y,u=om(h,d),_=l-u;if(_<=0)continue;let p=1.61803398875*(97*i+13*a),m=u>nu?h/u:Math.cos(p),A=u>nu?d/u:Math.sin(p),g=Number(s.movable)+Number(c.movable);if(g===0)continue;let f=Math.min(0.04,_/g);r=g$e({routes:t,via:s,dx:m*f,dy:A*f,node:n})||r,r=g$e({routes:t,via:c,dx:-m*f,dy:-A*f,node:n})||r}}return r},T4r=(e)=>{let{routes:t,node:n,vias:o,segments:r}=e,i=!1;for(let s=0;s<o.length;s+=1){let a=o[s];if(a?.movable)for(let c of r){if(a.rootConnectionName===c.rootConnectionName)continue;let l=uce(a,c),h=a.x-l.x,d=a.y-l.y,u=om(h,d),_=a.radius+c.traceRadius+0.1+OZe-u;if(_<=0)continue;let p=c.end.x-c.start.x,m=c.end.y-c.start.y,A=om(p,m),g=s%2==0?1:-1,f=u>nu?h/u:A>nu?-m/A*g:1,y=u>nu?d/u:A>nu?p/A*g:0,x=Math.min(0.04,_);i=g$e({routes:t,via:a,dx:f*x,dy:y*x,node:n})||i}}return i},KOt=(e)=>{let{routes:t,routeIndex:n,pointIndex:o,dx:r,dy:i,node:s}=e,a=t[n];if(!a||o<=0||o>=a.route.length-1)return!1;let c=((d,u,_=0.001)=>{let p=d[u];if(!p)return[];let m=[u];for(let A=u-1;A>=0;A-=1){let g=d[A];if(!g||!W$(g,p,_))break;m.push(A)}for(let A=u+1;A<d.length;A+=1){let g=d[A];if(!g||!W$(g,p,_))break;m.push(A)}return[...new Set(m)]})(a.route,o);if(hsn(a.route.length,c))return!1;let l=zZe(s,nu),h=!1;for(let d of c){let u=a.route[d];u&&(u.x=Mq(u.x+r,l.minX,l.maxX),u.y=Mq(u.y+i,l.minY,l.maxY),h=!0)}return h},A$e=(e)=>{let{routes:t,segment:n,dx:o,dy:r,node:i,t:s}=e,a=1-KV(s),c=KV(s),l=KOt({routes:t,routeIndex:n.routeIndex,pointIndex:n.startIndex,dx:o*a,dy:r*a,node:i}),h=KOt({routes:t,routeIndex:n.routeIndex,pointIndex:n.endIndex,dx:o*c,dy:r*c,node:i});return l||h},ysn=(e)=>{let{routes:t,node:n,segments:o,movableRouteIndexes:r}=e,i=!1;for(let s=0;s<o.length;s+=1){let a=o[s];if(a)for(let c=s+1;c<o.length;c+=1){let l=o[c];if(!l||a.z!==l.z||a.rootConnectionName===l.rootConnectionName)continue;let h=a.traceRadius+l.traceRadius+0.1+OZe;if(Math.max(a.start.x,a.end.x)+h<=Math.min(l.start.x,l.end.x)||Math.max(l.start.x,l.end.x)+h<=Math.min(a.start.x,a.end.x)||Math.max(a.start.y,a.end.y)+h<=Math.min(l.start.y,l.end.y)||Math.max(l.start.y,l.end.y)+h<=Math.min(a.start.y,a.end.y))continue;let[d]=GQ(a,l);if(!d)continue;let u=d.leftPoint.x-d.rightPoint.x,_=d.leftPoint.y-d.rightPoint.y,p=om(u,_),m=h-p;if(m<=0)continue;let A=!r||r.has(a.routeIndex),g=!r||r.has(l.routeIndex),f=Number(A)+Number(g);if(f===0)continue;let y=a.end.x-a.start.x,x=a.end.y-a.start.y,C=om(y,x),b=(s+c)%2==0?1:-1,I=p>nu?u/p:C>nu?-x/C*b:1,v=p>nu?_/p:C>nu?y/C*b:0,P=Math.min(0.025,m/f);A&&(i=A$e({routes:t,segment:a,dx:I*P,dy:v*P,node:n,t:d.leftT})||i),g&&(i=A$e({routes:t,segment:l,dx:-I*P,dy:-v*P,node:n,t:d.rightT})||i)}}return i},$Ot=(e,t)=>{for(let n=0;n<10;n+=1){let o=w4r(t),r=sB(t),i=B4r({routes:t,node:e,vias:o}),s=T4r({routes:t,node:e,vias:o,segments:r}),a=ysn({routes:t,node:e,segments:r});if(!i&&!s&&!a)break}for(let n of t)n.vias=_le(n);return t},D4r=(e,t,n)=>{for(let o=0;o<10;o+=1)if(!ysn({routes:t,node:e,segments:sB(t),movableRouteIndexes:n}))break;for(let o of n){let r=t[o];r&&(r.vias=_le(r))}return t},qOt=(e,t,n,o,r,i=3,s=0.02)=>{for(let a=0;a<i;a+=1){r.fill(0);let c=Asn(o);for(let l=0;l<n.length;l+=1){let h=n[l];if(!h||h.kind!=="via")continue;let d=h.node;for(let u=l+1;u<n.length;u+=1){let _=n[u];if(!_||_.kind!=="via")continue;if(h.rootConnectionName===_.rootConnectionName)continue;let p=_.node,m=d.x-p.x,A=d.y-p.y;if(Math.abs(m)>=j3e||Math.abs(A)>=j3e)continue;let g=om(m,A),f=j3e-g;if(f<=0)continue;let y=0,x=0;if(g>nu){let v=1/g;y=m*v,x=A*v}else{let v=1.61803398875*(1009*a+97*l+13*u);y=Math.cos(v),x=Math.sin(v)}let C=Math.min(s,0.9*f),b=y*C,I=x*C;xV(h,b,I,r),xV(_,-b,-I,r)}}for(let l=0;l<n.length;l+=1){let h=n[l];if(!h)continue;let d=h.node,u=msn(h),_=fsn(c,h,d.x,d.y,u);for(let p of _)for(let m of p.candidateIndexes){let A=p.segments[m];if(!A)continue;if(h.rootConnectionName===A.rootConnectionName)continue;let{startNode:g,endNode:f}=A,y=f.x-g.x,x=f.y-g.y,C=y*y+x*x;if(C<=nu)continue;let b=d.x-g.x,I=d.y-g.y,v=KV((b*y+I*x)/C),P=g.x+y*v,M=g.y+x*v,B=d.x-P,T=d.y-M,N=om(B,T),D=u-N;if(D<=0)continue;let L=1009*a+97*l+13*A.obstacleIndex,H=0,V=0;if(N>nu){let Y=1/N;H=B*Y,V=T*Y}else{let Y=-x,X=y,K=om(Y,X);if(K>nu){let J=(L%2==0?1:-1)/K;H=Y*J,V=X*J}else{let J=1.61803398875*L;H=Math.cos(J),V=Math.sin(J)}}let O=Math.min(P4r(h,s),D*S4r(h)),U=H*O,j=V*O;xV(h,U,j,r),gsn(A,-U,-j,r,v)}}for(let l=0;l<t.length;l+=1){let h=t[l];if(h)for(let d=0;d<h.nodes.length;d+=1){let u=h.nodes[d];if(!u||u.fixed)continue;let _=2*u.forceIndex,p=r[_]??0,m=r[_+1]??0,A=om(p,m);if(A>s&&A>nu){let g=s/A;p*=g,m*=g}u.x+=p,u.y+=m}}m$e(t,e)}},JOt=(e,t,n,o)=>{let{mutableRoutes:r,totalNodeCount:i}=((_)=>{let p=0;return{mutableRoutes:_.map((m)=>{let A=[],g=new Int32Array(m.route.length);g.fill(-1);for(let f=0;f<m.route.length;f+=1){let y=m.route[f];if(!y)continue;let x=m.route[f-1],C=A.at(-1),b=A.length-1;C&&x&&x.x===y.x&&x.y===y.y?(x.z!==y.z&&(C.boundaryPadding=Math.max(C.boundaryPadding,m.viaDiameter/2)),C.pointIndexes.push(f),C.fixed||=u$e(m.route.length,f),g[f]=b):(A.push({x:y.x,y:y.y,originalX:y.x,originalY:y.y,boundaryPadding:0,pointIndexes:[f],fixed:u$e(m.route.length,f),forceIndex:p}),g[f]=A.length-1,p+=1)}return{route:m,rootConnectionName:m.rootConnectionName??m.connectionName,nodes:A,pointNodeIndexes:g}}),totalNodeCount:p}})(t),s=((_)=>{let p=[];for(let m=0;m<_.length;m+=1){let A=_[m];if(A)for(let g=0;g<A.nodes.length;g+=1){let f=A.nodes[g],y=f?.pointIndexes[0],x=y===void 0?void 0:A.route.route[y];f&&x&&(f.pointIndexes.length>1?p.push({kind:"via",routeIndex:m,rootConnectionName:A.rootConnectionName,node:f,fixed:f.fixed}):p.push({kind:"point",routeIndex:m,rootConnectionName:A.rootConnectionName,node:f,z:x.z,fixed:f.fixed}))}}return p})(r),a=((_)=>{let p=[];for(let m=0;m<_.length;m+=1){let A=_[m];if(A)for(let g=0;g<A.nodes.length-1;g+=1){let f=A.nodes[g],y=A.nodes[g+1],x=f?.pointIndexes[0],C=x===void 0?void 0:A.route.route[x];f&&y&&C&&p.push({obstacleIndex:p.length,rootConnectionName:A.rootConnectionName,z:C.z,startNode:f,endNode:y})}}return p})(r),c=new Float64Array(2*i),l=new Float64Array(2*i),h=o?.includeForceVectors??!0;m$e(r,e);let d=[];for(let _=0;_<n;_+=1){let p=n<=1?0:_/Math.max(n-1,1),m=0.25+0.75*(1-p),A=1-p,g=h&&_===n-1,f=g?new Float64Array(2*s.length):void 0;c.fill(0);for(let x=0;x<s.length;x+=1){let C=s[x];if(!C||C.kind!=="via")continue;let b=C.node;for(let I=x+1;I<s.length;I+=1){let v=s[I];if(!v||v.kind!=="via")continue;if(C.rootConnectionName===v.rootConnectionName)continue;let P=v.node,M=b.x-P.x,B=b.y-P.y;if(Math.abs(M)>=p$e||Math.abs(B)>=p$e)continue;let T=om(M,B),N=0,D=0;if(T>nu){let O=1/T;N=M*O,D=B*O}else{let O=1.61803398875*(97*x+13*I);N=Math.cos(O),D=Math.sin(O)}let L=M$(T,0.034,0.08,18)*m;if(L<=0)continue;let H=N*L,V=D*L;xV(C,H,V,c,f,x),xV(v,-H,-V,c,f,I)}}let y=Asn(a);for(let x=0;x<s.length;x+=1){let C=s[x];if(!C)continue;let b=C.node,I=I4r(C),v=fsn(y,C,b.x,b.y,I);for(let P of v)for(let M of P.candidateIndexes){let B=P.segments[M];if(!B)continue;if(C.rootConnectionName===B.rootConnectionName)continue;let{startNode:T,endNode:N}=B,D=N.x-T.x,L=N.y-T.y,H=D*D+L*L;if(H<=nu)continue;let V=b.x-T.x,O=b.y-T.y,U=KV((V*D+O*L)/H),j=T.x+D*U,Y=T.y+L*U,X=b.x-j,K=b.y-Y,J=om(X,K),ee=97*x+13*B.obstacleIndex,se=0,ne=0;if(J>nu){let ie=1/J;se=X*ie,ne=K*ie}else{let ie=-L,le=D,ue=om(ie,le);if(ue>nu){let de=(ee%2==0?1:-1)/ue;se=ie*de,ne=le*de}else{let de=1.61803398875*ee;se=Math.cos(de),ne=Math.sin(de)}}let re=M$(J,v4r(C),0.08,18,_sn(C),msn(C),I)*m;if(re<=0)continue;let Z=se*re,te=ne*re;xV(C,Z,te,c,f,x),gsn(B,-Z,-te,c,U)}}g&&(d=Array(s.length));for(let x=0;x<s.length;x+=1){let C=s[x];if(!C)continue;let b=C.node,I=E4r(e,C,b.x,b.y,m);if(xV(C,I.x,I.y,c,f,x),g&&f){let v=2*x;d[x]={kind:C.kind,routeIndex:C.routeIndex,rootConnectionName:C.rootConnectionName,x:b.x,y:b.y,dx:f[v]??0,dy:f[v+1]??0}}}for(let x=0;x<r.length;x+=1){let C=r[x];if(!C)continue;let b=C.nodes.length-2;for(let I=0;I<C.nodes.length;I+=1){let v=C.nodes[I];if(!v||v.fixed)continue;let P=2*v.forceIndex,M=(c[P]??0)+0.14*(v.originalX-v.x),B=(c[P+1]??0)+0.14*(v.originalY-v.y),T=0,N=0,D=0,L=0,H=C.nodes[I-1],V=C.nodes[I+1];if(H||V){let X=0,K=0,J=0;if(H&&(X+=H.x,K+=H.y,J+=1),V&&(X+=V.x,K+=V.y,J+=1),J>0){let ee=1/J;M+=0.22*(X*ee-v.x),B+=0.22*(K*ee-v.y)}}if(H&&V&&A>0){let X=UXe(V,H),K=XOt(X,X);if(K>nu){let J=KV(XOt(UXe(v,H),X)/K),ee=y4r(H,V,J),se=usn(dsn(UXe(ee,v),0.55*A),0.02*A);T=se.x,N=se.y}}if(A>0){if(I===1&&H?.fixed){let X=jOt(H,v,e,A);D+=X.x,L+=X.y}if(I===b&&V?.fixed){let X=jOt(V,v,e,A);D+=X.x,L+=X.y}}let O=0.85*M*m,U=0.85*B*m,j=om(O,U),Y=0.012*m;if(j>Y&&j>nu){let X=Y/j;O*=X,U*=X}v.x+=O+T+D,v.y+=U+N+L}}m$e(r,e),qOt(e,r,s,a,l,3,0.02)}return qOt(e,r,s,a,l,8,0.03),{routes:((_)=>_.map(({route:p,nodes:m,pointNodeIndexes:A})=>{let g=p.route.map((y,x)=>{let C=A[x]??-1,b=C>=0?m[C]:void 0;return b?{...y,x:WOt(b.x),y:WOt(b.y)}:y}),f={...p,route:g,vias:[]};return f.vias=_le(f),f}))(r),forceVectors:d,stepsCompleted:n}},$le=class extends _4r{sampleEntries;originalHdRoutes;originalNodeWithPortPoints;colorMap;totalStepsPerNode;nodeAssignmentMargin;improvedRoutesByIndex=new Map;activeSampleIndex=0;latestVisualization={};constructor(e){super(),this.originalHdRoutes=e.hdRoutes,this.originalNodeWithPortPoints=e.nodeWithPortPoints,this.colorMap=e.colorMap??{},this.totalStepsPerNode=e.totalStepsPerNode??60,this.nodeAssignmentMargin=e.nodeAssignmentMargin??0.2;let t=new Map;for(let n=0;n<e.hdRoutes.length;n++){let o=C4r(e.hdRoutes[n],e.nodeWithPortPoints,this.nodeAssignmentMargin);if(o===-1)continue;let r=t.get(o)??[];r.push(n),t.set(o,r)}this.sampleEntries=Array.from(t.entries()).map(([n,o])=>({node:e.nodeWithPortPoints[n],routeIndexes:o})),this.MAX_ITERATIONS=Math.max(10*this.sampleEntries.length,1000),this.stats={nodeAssignmentMargin:this.nodeAssignmentMargin,sampleCount:this.sampleEntries.length,improvedNodeCount:0,improvedRouteCount:0,totalStepsPerNode:this.totalStepsPerNode}}getSolverName(){return"HighDensityForceImproveSolver"}getConstructorParams(){return[{nodeWithPortPoints:this.originalNodeWithPortPoints,hdRoutes:this.originalHdRoutes,totalStepsPerNode:this.totalStepsPerNode,nodeAssignmentMargin:this.nodeAssignmentMargin,colorMap:this.colorMap}]}_step(){let e=this.sampleEntries[this.activeSampleIndex];if(!e)return void(this.solved=!0);let t=psn(e.node),n=e.routeIndexes.map((s)=>this.originalHdRoutes[s]),o=JOt(t,n,this.totalStepsPerNode,{includeForceVectors:!0});$Ot(e.node,o.routes);let r=GOt(n,o.routes),i=r.length===0?o:JOt(t,((s,a)=>{let{routes:c,node:l,selectors:h}=s,d=structuredClone(c),u=sB(c),_=pce(u),p=h.flatMap((m)=>{let A=_[m.leftRouteIndex]?.[m.leftStartPointIndex],g=_[m.rightRouteIndex]?.[m.rightStartPointIndex];if(!A||!g)return[];let[f]=GQ(A,g);if(!f)return[];let y=f.leftPoint.x-f.rightPoint.x,x=f.leftPoint.y-f.rightPoint.y,C=om(y,x);return C<=RS?[]:[{selector:m,directionX:y/C,directionY:x/C,requiredDistance:A.traceRadius+g.traceRadius+0.015}]});for(let m=0;m<3;m+=1){let A=sB(d),g=pce(A);for(let f of p){let y=g[f.selector.leftRouteIndex]?.[f.selector.leftStartPointIndex],x=g[f.selector.rightRouteIndex]?.[f.selector.rightStartPointIndex];if(!y||!x)continue;let[C]=GQ(y,x);if(!C)continue;let b=(C.leftPoint.x-C.rightPoint.x)*f.directionX+(C.leftPoint.y-C.rightPoint.y)*f.directionY,I=f.requiredDistance-b;if(I<=0)continue;let v=Math.min(0.025,I/2);a({routes:d,segment:y,dx:f.directionX*v,dy:f.directionY*v,node:l,t:C.leftT}),a({routes:d,segment:x,dx:-f.directionX*v,dy:-f.directionY*v,node:l,t:C.rightT})}}for(let m of d)m.vias=_le(m);return d})({routes:n,node:e.node,selectors:r},A$e),this.totalStepsPerNode,{includeForceVectors:!0});if(i!==o){$Ot(e.node,i.routes);let s=GOt(n,i.routes);if(s.length>0){let a=((c,l)=>{let{originalRoutes:h,guardedRoutes:d,node:u,crossingSelectors:_,protectedSelectors:p}=c,m=pce(sB(h)),A=pce(sB(d)),g=GXe(d),f=p.map(({leftRouteIndex:x,rightRouteIndex:C})=>lsn(x,C)),y=zZe(u,RS);for(let x of _){let C=A[x.leftRouteIndex]?.[x.leftStartPointIndex],b=A[x.rightRouteIndex]?.[x.rightStartPointIndex];if(!C||!b)continue;let[I]=GQ(C,b);if(!(!I||om(I.leftPoint.x-I.rightPoint.x,I.leftPoint.y-I.rightPoint.y)>RS||I.leftT<=RS||I.leftT>=0.999999||I.rightT<=RS||I.rightT>=0.999999))for(let v of["right","left"]){let P=v==="left"?x.leftRouteIndex:x.rightRouteIndex,M=v==="left"?x.leftStartPointIndex:x.rightStartPointIndex,B=v==="left"?x.rightRouteIndex:x.leftRouteIndex,T=v==="left"?x.rightStartPointIndex:x.leftStartPointIndex,N=h[P],D=d[P],L=m[B]?.[T],H=A[B]?.[T];if(!(N&&D&&L&&H))continue;let V=N.route[M]?.z,O=[];for(let U=M-2;U<=M+3;U+=1){let j=N.route[U];!j||U<=0||U>=N.route.length-1||j.z!==V||[N.route[U-1],N.route[U+1]].some((Y)=>Y&&Y.z!==j.z)||O.push(U)}if(O.length!==0)for(let[U,j]of[[L.start,H.start],[L.end,H.end]])for(let Y of[1.51,1.25,1.75,2]){let X=[...d],K=structuredClone(D);X[P]=K;let J=!0;for(let re of O){let Z=N.route[re],te=K.route[re];if(!Z||!te)continue;let ie=j.x+(Z.x-U.x)*Y,le=j.y+(Z.y-U.y)*Y;if(ie<=y.minX||ie>=y.maxX||le<=y.minY||le>=y.maxY){J=!1;break}te.x=ie,te.y=le}if(!J)continue;K.vias=_le(K);let ee=X,se=GXe(ee),ne=new Set;for(let[re,Z]of se)X3e(g,[re,Z])||(re===P&&Z!==P?ne.add(Z):Z===P&&re!==P&&ne.add(re));if(ne.size>0){let re=l(u,structuredClone(X),ne),Z=GXe(re);f.every((te)=>!X3e(Z,te))&&Z.length<se.length&&(ee=re,se=Z)}if(f.every((re)=>!X3e(se,re))&&se.length<g.length)return ee}}}})({originalRoutes:n,guardedRoutes:i.routes,node:e.node,crossingSelectors:s,protectedSelectors:[...r,...s]},D4r);a&&(i={...i,routes:a})}}for(let s=0;s<e.routeIndexes.length;s++)this.improvedRoutesByIndex.set(e.routeIndexes[s],i.routes[s]);this.latestVisualization=ZOt({node:e.node,routes:i.routes,forceVectors:i.forceVectors,colorMap:this.colorMap}),this.activeSampleIndex+=1,this.stats={nodeAssignmentMargin:this.nodeAssignmentMargin,sampleCount:this.sampleEntries.length,improvedNodeCount:this.activeSampleIndex,improvedRouteCount:this.improvedRoutesByIndex.size,totalStepsPerNode:this.totalStepsPerNode},this.activeSampleIndex>=this.sampleEntries.length&&(this.solved=!0)}getOutput(){return this.originalHdRoutes.map((e,t)=>this.improvedRoutesByIndex.get(t)??e)}visualize(){return this.solved?ZOt({routes:this.getOutput(),colorMap:this.colorMap}):this.latestVisualization}},ZOt=(e)=>{let t=[],n=[],o=[];e.node&&o.push({center:e.node.center,width:e.node.width,height:e.node.height,stroke:"rgba(14,165,233,0.7)",fill:"rgba(14,165,233,0.04)",label:e.node.capacityMeshNodeId});for(let r of e.routes){let i=e.colorMap?.[r.connectionName]??"#0ea5e9";for(let s=0;s<r.route.length-1;s++){let a=r.route[s],c=r.route[s+1];a.z===c.z&&t.push({points:[{x:a.x,y:a.y},{x:c.x,y:c.y}],strokeColor:a.z===0?i:A4r(i,0.5),strokeWidth:r.traceThickness,layer:`z${a.z}`,strokeDash:a.z!==0?[0.1,0.3]:void 0})}for(let s of r.vias)n.push({center:{x:s.x,y:s.y},radius:r.viaDiameter/2,stroke:i,fill:"rgba(14,165,233,0.12)"})}for(let r of e.forceVectors??[])t.push({points:[{x:r.x,y:r.y},{x:r.x+5*r.dx,y:r.y+5*r.dy}],strokeColor:"rgba(244,63,94,0.85)",strokeWidth:0.06,strokeDash:[0.08,0.08]});return{lines:t,circles:n,rects:o}},Zbe=class extends ei{constructor(e,t,n=Number.POSITIVE_INFINITY,o=0.010000000000000002){super(),this.nodes=e,this.maxNodeDimension=t,this.maxNodeRatio=n,this.minNodeArea=o,this.outputNodes=[]}nodes;maxNodeDimension;maxNodeRatio;minNodeArea;outputNodes;getSolverName(){return"NodeDimensionSubdivisionSolver"}getSubdivisionGrid(e){let t=Number.isFinite(this.maxNodeDimension)&&this.maxNodeDimension>0,n=Number.isFinite(this.maxNodeRatio)&&this.maxNodeRatio>0,o=t?Math.max(1,Math.ceil(e.width/this.maxNodeDimension)):1,r=t?Math.max(1,Math.ceil(e.height/this.maxNodeDimension)):1;if(n&&e.width>0&&e.height>0)for(;;){let i=e.width/o,s=e.height/r;if((i>=s?i/s:s/i)<=this.maxNodeRatio)break;i>=s?o++:r++}return{cols:o,rows:r}}shouldRemoveNode(e){let t=Number.isFinite(this.minNodeArea)&&this.minNodeArea>0;if(!Number.isFinite(e.width)||!Number.isFinite(e.height))return!0;if(!t||e.width*e.height>=this.minNodeArea)return!1;if(Math.min(e.width,e.height)<0.002)return!0;if(e._containsTarget)return!1;let n=0;for(let o of this.nodes)if(o.capacityMeshNodeId!==e.capacityMeshNodeId&&e.availableZ.some((r)=>o.availableZ.includes(r))&&gbe(e,o)){if(o._containsTarget)return!1;if(n++,n>=2)return!1}return!0}subdivideNode(e){if(this.shouldRemoveNode(e))return[];let{cols:t,rows:n}=this.getSubdivisionGrid(e);if(t===1&&n===1)return[e];let o=e.width/t,r=e.height/n,i=e.center.x-e.width/2,s=e.center.y-e.height/2,a=[];for(let c=0;c<n;c++)for(let l=0;l<t;l++)a.push({...e,capacityMeshNodeId:`${e.capacityMeshNodeId}__sub_${c}_${l}`,center:{x:i+o*(l+0.5),y:s+r*(c+0.5)},width:o,height:r,availableZ:[...e.availableZ]});return a}_step(){let e=this.nodes.length,t=0,n=0,o=0;for(let r of this.nodes){let i=!Number.isFinite(r.width)||!Number.isFinite(r.height),s=this.subdivideNode(r);s.length!==0?(s.length>1&&t++,this.outputNodes.push(...s)):i?o++:n++}this.stats={inputNodeCount:e,outputNodeCount:this.outputNodes.length,subdividedNodeCount:t,removedSmallNodeCount:n,removedInvalidNodeCount:o,maxNodeDimension:this.maxNodeDimension,maxNodeRatio:this.maxNodeRatio,minNodeArea:this.minNodeArea},this.solved=!0}visualize(){return{rects:this.outputNodes.map((e)=>({center:e.center,width:e.width,height:e.height,label:`${e.capacityMeshNodeId}
${e.width.toFixed(2)}x${e.height.toFixed(2)}`,layer:`z${e.availableZ.join(",")}`,fill:"rgba(0, 200, 255, 0.08)",stroke:"rgba(0, 120, 180, 0.5)"}))}}},sv=(e)=>{let t=[...new Set(e.filter((n)=>typeof n=="number"&&Number.isInteger(n)&&n>=0))].sort((n,o)=>n-o);if(t.length!==0)return`z${t.join(",")}`},VZe=(e)=>{let t=[];for(let n=0;n<31;n++)e&1<<n&&t.push(n);return t},UQ=(e)=>typeof e=="object"&&e!==null,xsn=(e)=>UQ(e)?{...e}:e===void 0?{}:{value:e},CV=(e,t)=>{let n=e.topology.regionMetadata?.[t];if(UQ(n)){if(typeof n.serializedRegionId=="string")return n.serializedRegionId;if(typeof n.regionId=="string")return n.regionId;if(typeof n.capacityMeshNodeId=="string")return n.capacityMeshNodeId}return`region-${t}`},w$=(e,t)=>{let n=e.topology.portMetadata?.[t];if(UQ(n)){if(typeof n.serializedPortId=="string")return n.serializedPortId;if(typeof n.portId=="string")return(o=n.portId).includes("::")?o.slice(0,o.indexOf("::")):o}var o;return`port-${t}`},Csn=(e,t)=>{let n=e.problem.routeMetadata?.[t];return UQ(n)&&typeof n.connectionId=="string"?n.connectionId:`route-${t}`},N4r=(e,t)=>{let n=xsn(e.topology.regionMetadata?.[t]);if(UQ(n.center)||(n.center={x:e.topology.regionCenterX[t],y:e.topology.regionCenterY[t]}),typeof n.width!="number"&&(n.width=e.topology.regionWidth[t]),typeof n.height!="number"&&(n.height=e.topology.regionHeight[t]),!Array.isArray(n.availableZ)){let o=e.topology.regionAvailableZMask?.[t]??0;o!==0&&(n.availableZ=VZe(o))}return n.layer=sv(Array.isArray(n.availableZ)?n.availableZ:[])??sv((e.topology.regionIncidentPorts[t]??[]).map((o)=>e.topology.portZ[o]))??"z0",n},R4r=(e,t)=>{let n=xsn(e.topology.portMetadata?.[t]);return typeof n.x!="number"&&(n.x=e.topology.portX[t]),typeof n.y!="number"&&(n.y=e.topology.portY[t]),typeof n.z!="number"&&(n.z=e.topology.portZ[t]),n.layer=sv([e.topology.portZ[t]])??"z0",n},eVt=(e,t,n)=>{let o=(e.topology.incidentPortRegion[t]??[]).find((r)=>r!==n);if(o===void 0)throw Error(`Port ${t} is not incident to a region outside route region ${n}`);return o},Q4r=(e,t,n)=>{let{orderedPortIds:o,orderedRegionIds:r}=((d,u,_)=>{if(_.length===0)throw Error(`Route ${u} has no solved segments`);let p=d.problem.routeStartPort[u],m=d.problem.routeEndPort[u],A=p===m,g=new Map;_.forEach((C,b)=>{let I={...C,segmentIndex:b},v=g.get(C.fromPortId)??[];v.push(I),g.set(C.fromPortId,v);let P=g.get(C.toPortId)??[];P.push(I),g.set(C.toPortId,P)});let f=[p],y=[],x=(C,b,I)=>{if(C===m&&(!A||b.size===_.length))return!0;for(let v of g.get(C)??[]){if(b.has(v.segmentIndex))continue;let P=v.fromPortId===C?v.toPortId:v.fromPortId,M=A&&P===m&&b.size+1===_.length;if(I.has(P)&&!M)continue;b.add(v.segmentIndex);let B=!I.has(P);if(B&&I.add(P),y.push(v.regionId),f.push(P),x(P,b,I))return!0;f.pop(),y.pop(),B&&I.delete(P),b.delete(v.segmentIndex)}return!1};if(!x(p,new Set,new Set([p])))throw Error(`Route ${u} is not a single ordered path from ${p} to ${m}`);return{orderedPortIds:f,orderedRegionIds:y}})(e,t,n),i=r[0],s=r[r.length-1];if(i===void 0||s===void 0)throw Error(`Route ${t} could not determine endpoint regions`);let a=CV(e,eVt(e,o[0],i)),c=CV(e,eVt(e,o[o.length-1],s)),l=((d,u,_,p)=>{let m=d.problem.routeMetadata?.[u];return{connectionId:Csn(d,u),startRegionId:(UQ(m)&&typeof m.startRegionId=="string"?m.startRegionId:void 0)??_,endRegionId:(UQ(m)&&typeof m.endRegionId=="string"?m.endRegionId:void 0)??p,mutuallyConnectedNetworkId:(UQ(m)&&typeof m.mutuallyConnectedNetworkId=="string"?m.mutuallyConnectedNetworkId:void 0)??`net-${d.problem.routeNet[u]}`}})(e,t,a,c),h=o.map((d,u)=>{let _={portId:w$(e,d),g:u,h:0,f:u,hops:u,ripRequired:!1,nextRegionId:u<r.length?CV(e,r[u]):l.endRegionId};return u>0&&(_.lastPortId=w$(e,o[u-1]),_.lastRegionId=CV(e,r[u-1])),_});return{connection:l,solvedRoute:{connection:l,path:h,requiredRip:!1}}},k4r=(e)=>{if(!e.solved||e.failed)throw Error("convertToSerializedHyperGraph requires a solved, non-failed solver");let{topology:t}=e,n=((s)=>{let a=Array.from({length:s.problem.routeCount},()=>[]);return s.state.regionSegments.forEach((c,l)=>{for(let[h,d,u]of c)a[h].push({regionId:l,fromPortId:d,toPortId:u})}),a})(e),o=Array.from({length:t.regionCount},(s,a)=>{let c=e.state.regionSegments[a].map(([l,h,d])=>({regionPort1Id:w$(e,h),regionPort2Id:w$(e,d),connectionId:Csn(e,l)}));return{regionId:CV(e,a),pointIds:t.regionIncidentPorts[a].map((l)=>w$(e,l)),d:N4r(e,a),...c.length>0&&{assignments:c}}}),r=Array.from({length:t.portCount},(s,a)=>{let[c,l]=t.incidentPortRegion[a]??[];if(c===void 0||l===void 0)throw Error(`Port ${a} is missing incident regions`);return{portId:w$(e,a),region1Id:CV(e,c),region2Id:CV(e,l),d:R4r(e,a)}}),i=n.map((s,a)=>Q4r(e,a,s));return{regions:o,ports:r,connections:i.map(({connection:s})=>s),solvedRoutes:i.map(({solvedRoute:s})=>s)}},bsn=0.3,Isn=(e)=>e>0&&!(e&e-1),L4r=(e,t,n,o,r,i=0,s=0.3,a=0)=>(2*t+1*n+1*o)*(s+0.15)**2*(1+r/5)/e+(Isn(i)?10*t:0)+a*(r/H4r(i))**2*0.010000000000000002/e,H4r=(e)=>{if(e===0)return 2;let t=e>>>0,n=0;for(;t!==0;)n+=1&t,t>>>=1;return n},tVt=(e,t)=>{let{netIds:n,lesserAngles:o,greaterAngles:r,layerMasks:i}=e,{netId:s,lesserAngle:a,greaterAngle:c,layerMask:l}=t,h=0,d=0;for(let u=0;u<n.length;u++){if(s===n[u])continue;(a<o[u]&&o[u]<c)!==(a<r[u]&&r[u]<c)&&((l&i[u])!==0?h++:d++)}t.sameLayerIntersectionCount=h,t.crossingLayerIntersectionCount=d},F4r=(e,t,n)=>{let o=e.routeStartPort[t],r=e.routeEndPort[t],i=new Map;for(let{fromPortId:c,toPortId:l}of n){let h=i.get(c)??new Set;h.add(l),i.set(c,h);let d=i.get(l)??new Set;d.add(c),i.set(l,d)}let s=new Set,a=[o];for(;a.length>0;){let c=a.pop();if(!s.has(c)){s.add(c);for(let l of i.get(c)??[])a.push(l)}}if(!s.has(r))throw Error(`Initial assignments for route ${t} do not connect ${o} to ${r}`);if(n.some(({fromPortId:c,toPortId:l})=>!s.has(c)||!s.has(l)))throw Error(`Initial assignments for route ${t} contain disconnected segments`)},f$e=({topology:e,problem:t,state:n,routeSuccessCountByRouteId:o,appendSegmentToRegionCache:r})=>{let i=t.initialAssignments??[];if(i.length===0)return;let s=new Map;for(let c of i){let{routeId:l,regionId:h,fromPortId:d,toPortId:u}=c;if(!Number.isInteger(l)||l<0||l>=t.routeCount)throw Error(`Initial assignment references invalid route ${l}`);if(!Number.isInteger(h)||h<0||h>=e.regionCount)throw Error(`Initial assignment references invalid region ${h}`);for(let p of[d,u]){if(!Number.isInteger(p)||p<0||p>=e.portCount)throw Error(`Initial assignment references invalid port ${p}`);if(!e.incidentPortRegion[p]?.includes(h))throw Error(`Initial assignment port ${p} is not incident to region ${h}`)}let _=s.get(l)??[];_.push(c),s.set(l,_)}for(let[c,l]of s)F4r(t,c,l);let a=new Set(s.keys());for(let{routeId:c,regionId:l,fromPortId:h,toPortId:d}of i){let u=t.routeNet[c];for(let _ of[h,d]){let p=n.portAssignment[_];if(p!==-1&&p!==u)throw Error(`Initial assignment port ${_} is assigned to multiple nets`);n.portAssignment[_]=u}n.currentRouteNetId=u,n.regionSegments[l].push([c,h,d]),r(l,h,d)}n.currentRouteNetId=void 0,n.unroutedRoutes=n.unroutedRoutes.filter((c)=>!a.has(c));for(let c of a)o[c]=1;return{initialAssignmentCount:i.length,initiallyRoutedRouteCount:a.size}},vsn=class{constructor(e,t){this.items=e,this.compare=t}items;compare;get length(){return this.items.length}toArray(){return[...this.items]}clear(){this.items.length=0}queue(e){this.items.push(e),this.siftUp(this.items.length-1)}dequeue(){let e=this.items[0];if(e===void 0)return;let t=this.items.pop();return this.items.length>0&&(this.items[0]=t,this.siftDown(0)),e}siftUp(e){let t=e;for(;t>0;){let n=t-1>>1,o=this.items[n],r=this.items[t];if(this.compare(o,r)<=0)return;this.items[n]=r,this.items[t]=o,t=n}}siftDown(e){let t=e,n=this.items.length;for(;;){let o=2*t+1;if(o>=n)return;let r=o+1,i=o;r<n&&this.compare(this.items[r],this.items[o])<0&&(i=r);let s=this.items[t],a=this.items[i];if(this.compare(s,a)<=0)return;this.items[t]=a,this.items[i]=s,t=i}}},Ssn=class{constructor(e,t){this.regionCount=e,this.compactHopIndex=t,t&&(this.hopStateGeneration=new Uint32Array(t.hopCapacity),this.hopIndexOrClosed=new Int32Array(t.hopCapacity))}regionCount;compactHopIndex;items=[];indexByHopId=new Map;closedHopIds=new Set;hopStateGeneration;hopIndexOrClosed;currentHopStateGeneration=1;closureEpochToken={};get closureEpoch(){return this.closureEpochToken}get length(){return this.items.length}toArray(){return[...this.items]}clear(){this.closureEpochToken={},this.items.length=0,this.indexByHopId.clear(),this.closedHopIds.clear(),this.hopStateGeneration&&(this.currentHopStateGeneration===4294967295?(this.hopStateGeneration.fill(0),this.currentHopStateGeneration=1):this.currentHopStateGeneration+=1)}isClosedHop(e,t){return this.isClosedHopId(this.getHopIdFromValues(e,t))}isClosedHopId(e){return this.isHopClosed(e)}queue(e){let t=this.getHopId(e);if(this.isHopClosed(t))return;let n=this.getQueuedHopIndex(t);if(n!==void 0){let r=this.items[n];if(e.g>=r.g)return;return this.items[n]=e,void(e.f<=r.f?this.siftUp(n):this.siftDown(n))}let o=this.items.length;this.items.push(e),this.siftUp(o)}dequeue(){let e=this.items[0];if(!e)return;let t=this.getHopId(e);this.closeHop(t);let n=this.items.pop();return this.items.length>0&&(this.items[0]=n,this.siftDown(0)),e}getHopId(e){if(e.hopId!==void 0)return e.hopId;let t=this.getHopIdFromValues(e.portId,e.nextRegionId);return e.hopId=t,t}getHopIdFromValues(e,t){let n=this.compactHopIndex;if(!n)return e*this.regionCount+t;let o=e*n.hopSlotStride;if(n.firstRegionByPortId[e]===t)return o;if(n.secondRegionByPortId[e]===t)return o+1;let r=n.incidentPortRegion[e];for(let i=2;i<(r?.length??0);i++)if(r[i]===t)return o+i;return-(e*this.regionCount+t)-1}getQueuedHopIndex(e){if(e>=0&&this.hopStateGeneration){if(this.hopStateGeneration[e]!==this.currentHopStateGeneration)return;let t=this.hopIndexOrClosed[e];return t>=0?t:void 0}return this.indexByHopId.get(e)}isHopClosed(e){return e>=0&&this.hopStateGeneration?this.hopStateGeneration[e]===this.currentHopStateGeneration&&this.hopIndexOrClosed[e]===-1:this.closedHopIds.has(e)}setQueuedHopIndex(e,t){if(e>=0&&this.hopStateGeneration)return this.hopStateGeneration[e]=this.currentHopStateGeneration,void(this.hopIndexOrClosed[e]=t);this.indexByHopId.set(e,t)}closeHop(e){if(e>=0&&this.hopStateGeneration)return this.hopStateGeneration[e]=this.currentHopStateGeneration,void(this.hopIndexOrClosed[e]=-1);this.indexByHopId.delete(e),this.closedHopIds.add(e)}siftUp(e){let t=this.items[e],n=e;for(;n>0;){let o=n-1>>1,r=this.items[o];if(r.f<=t.f)break;this.items[n]=r,this.setQueuedHopIndex(this.getHopId(r),n),n=o}this.items[n]=t,this.setQueuedHopIndex(this.getHopId(t),n)}siftDown(e){let t=this.items[e],n=e;for(;;){let o=2*n+1;if(o>=this.items.length)break;let r=o+1,i=r<this.items.length&&this.items[r].f<this.items[o].f?r:o,s=this.items[i];if(t.f<=s.f)break;this.items[n]=s,this.setQueuedHopIndex(this.getHopId(s),n),n=i}this.items[n]=t,this.setQueuedHopIndex(this.getHopId(t),n)}},OCe=(e,t)=>{let n=[...e],o=((r)=>{let i=r>>>0;return()=>{i+=1831565813;let s=i;return s=Math.imul(s^s>>>15,1|s),s^=s+Math.imul(s^s>>>7,61|s),((s^s>>>14)>>>0)/4294967296}})(t);for(let r=n.length-1;r>0;r--){let i=Math.floor(o()*(r+1));[n[r],n[i]]=[n[i],n[r]]}return n},Psn=(e,t)=>e.routeMetadata?.[t],z4r=(e)=>e?.simpleRouteConnection?.pointsToConnect?.map(({pointId:t})=>typeof t=="string"?t:null).filter((t)=>t!==null)??[],O4r=(e,t)=>{let n=Psn(e,t)?.connectionId;return typeof n=="string"?n:`route-${t}`},V4r=(e,t,n)=>{let o=e.portEndpointNetIds[n];if(!o)return!1;for(let r of o)if(r!==t)return!0;return!1},nVt=(e,t,n)=>{let o=e.regionNetId[n];return o!==-1&&o!==t},Y4r=(e)=>[...new Set(e.routeIds)].filter((t)=>!((n,o)=>{let{topology:r,problem:i,problemSetup:s,portAssignment:a,maxPrecheckHops:c}=n,l=i.routeNet[o],h=i.routeStartPort[o],d=i.routeEndPort[o];if(h===d)return!0;let u=n.getStartingNextRegionId(o,h);if(u===void 0)return!1;let _=[{portId:h,nextRegionId:u}],p=new Set([h*r.regionCount+u]);for(let m=0;m<_.length;m++){let A=_[m];if(!nVt(i,l,A.nextRegionId))for(let g of r.regionIncidentPorts[A.nextRegionId]??[]){let f=a[g];if(V4r(s,l,g))continue;if(g===d){if(f!==-1&&f!==l)continue;return!0}if(g===A.portId)continue;if(f!==-1&&f!==l)continue;if(i.portSectionMask[g]===0)continue;let y=r.incidentPortRegion[g]??[],x=y[0]===A.nextRegionId?y[1]:y[0];if(x===void 0||nVt(i,l,x))continue;let C=g*r.regionCount+x;if(!p.has(C)){if(p.size>=c)return!0;p.add(C),_.push({portId:g,nextRegionId:x})}}}return!1})(e,t)).map((t)=>e.getRouteSummary(t)),WXe=(e)=>{let t=Array(e);for(let n=0;n<e;n++)t[n]=n;return t},XXe="rgba(220, 38, 38, 0.98)",oVt="rgba(220, 38, 38, 0.18)",jXe=(...e)=>e.filter((t)=>Boolean(t)).join(`
`),rVt=(e,t)=>{let n=0.005*e.topology.portZ[t];return{x:e.topology.portX[t]+n,y:e.topology.portY[t]+n}},iVt=(e,t)=>sv([e.topology.portZ[t]])??"z0",sVt=(e,t)=>{let n=e.topology.portMetadata?.[t];return`port: ${n?.serializedPortId??n?.portId??`port-${t}`}`},aVt=(e,t)=>`z: ${e.topology.portZ[t]}`,G4r=(e,t)=>((n,o,r)=>{let i=n.topology.portZ[o],s=n.topology.portZ[r];return i===s?`z: ${i}`:`z: ${i} -> ${s}`})(e,e.problem.routeStartPort[t],e.problem.routeEndPort[t]),U4r=(e,t)=>`net: ${e.problem.routeNet[t]}`,VCe=0.05,W4r={r:255,g:64,b:64,a:0.72},p3e="rgba(220, 38, 38, 0.98)",cVt="rgba(220, 38, 38, 0.12)",lVt="10 6",Ug=(...e)=>e.filter((t)=>Boolean(t)).join(`
`),Esn=(e)=>Math.min(1,Math.max(0,e)),KXe=(e,t,n)=>Math.round(e+(t-e)*n),Msn=({r:e,g:t,b:n,a:o})=>`rgba(${e}, ${t}, ${n}, ${o})`,bV=(e,t)=>{let n=e.problem.routeMetadata?.[t];return n?.connectionId??n?.mutuallyConnectedNetworkId??`route-${t}`},y$e=(e)=>typeof e.centerRouteId=="number",x$e=(e,t)=>y$e(e)?t===e.centerRouteId?1:0.5:1,hVt=(e,t)=>{let n=e.match(/^(rgba|hsla)\((.*),\s*([0-9]*\.?[0-9]+)\)$/);if(!n)return e;let[,o,r,i]=n,s=Esn(Number(i)*t);return`${o}(${r}, ${Number(s.toFixed(3))})`},dV=(e,t,n=0.8)=>((o,r,i=0.8)=>{let s=`${o.problem.routeNet[r]}:${bV(o,r)}`,a=0;for(let c=0;c<s.length;c++)a=17777*s.charCodeAt(c)+((a<<5)-a);return`hsla(${Math.abs(a)%360}, 70%, 50%, ${i})`})(e,t,n*x$e(e,t)),dVt=(e,t)=>`net: ${e.problem.routeNet[t]}`,wsn=(e,t)=>{let n=e.topology.regionMetadata?.[t],o=n?.polygon;if(Array.isArray(o)&&o.length>=3){let l=o.map((d)=>d.x),h=o.map((d)=>d.y);return{minX:Math.min(...l),maxX:Math.max(...l),minY:Math.min(...h),maxY:Math.max(...h)}}let r=n?.bounds;if(r&&typeof r.minX=="number"&&typeof r.maxX=="number"&&typeof r.minY=="number"&&typeof r.maxY=="number")return r;let i=e.topology.regionWidth[t],s=e.topology.regionHeight[t],a=e.topology.regionCenterX[t],c=e.topology.regionCenterY[t];return{minX:a-i/2,maxX:a+i/2,minY:c-s/2,maxY:c+s/2}},Bsn=(e,t)=>({x:e.topology.regionCenterX[t],y:e.topology.regionCenterY[t]}),Tsn=(e,t)=>{let n=e.topology.regionMetadata?.[t],o=Array.isArray(n?.availableZ)?n.availableZ.filter((s)=>typeof s=="number"&&Number.isInteger(s)&&s>=0):[];if(o.length>0)return sv(o)??"z0";let r=VZe(e.topology.regionAvailableZMask?.[t]??0);if(r.length>0)return sv(r)??"z0";let i=[...new Set((e.topology.regionIncidentPorts[t]??[]).map((s)=>e.topology.portZ[s]))].sort((s,a)=>s-a);return sv(i)??"z0"},Dsn=(e,t)=>{let n=e.state.regionIntersectionCaches[t],o=n?.existingRegionCost??0,r=e.state.regionCongestionCost[t]??0,i=e.problem.regionNetId[t];return Ug(`region: region-${t}`,`net: ${i===-1?"free":`${i}`}`,e.getAdditionalRegionLabel(t),`cost: ${o.toFixed(3)}`,`congestion: ${r.toFixed(3)}`,`same layer X: ${n?.existingSameLayerIntersections??0}`,`trans X: ${n?.existingCrossingLayerIntersections??0}`,`entry exit X: ${n?.existingEntryExitLayerChanges??0}`)},Nsn=(e,t)=>{let n=e.topology.regionMetadata?.[t];return n?.isConnectionRegion?{r:255,g:100,b:255,a:0.6}:n?.isThroughJumper?{r:100,g:200,b:100,a:0.5}:n?.isPad?{r:255,g:200,b:100,a:0.5}:n?.layer==="bottom"?{r:52,g:152,b:219,a:0.08}:{r:200,g:200,b:255,a:0.1}},X4r=(e,t)=>{let n=Nsn(e,t),o=Esn(e.state.regionIntersectionCaches[t]?.existingRegionCost??0);return Msn((i=W4r,s=o**0.8,{r:KXe((r=n).r,i.r,s),g:KXe(r.g,i.g,s),b:KXe(r.b,i.b,s),a:Number((r.a+(i.a-r.a)*s).toFixed(3))}));var r,i,s},qb=(e,t)=>{let n=((r,i)=>({x:r.topology.portX[i],y:r.topology.portY[i]}))(e,t),o=0.005*e.topology.portZ[t];return{x:n.x+o,y:n.y+o}},mce=qb,y5=(e,t)=>sv([e.topology.portZ[t]])??"z0",B$=(e,t)=>{let n=e.topology.portMetadata?.[t];return`port: ${n?.serializedPortId??n?.portId??`port-${t}`}`},Rsn=(e,t,n)=>{if(n!==void 0)return`net: ${e.problem.routeNet[n]}`;let o=e.state.portAssignment[t];if(o>=0)return`net: ${o}`;let r=new Set;for(let i=0;i<e.problem.routeCount;i++)e.problem.routeStartPort[i]!==t&&e.problem.routeEndPort[i]!==t||r.add(e.problem.routeNet[i]);return r.size!==0?`net: ${Array.from(r).sort((i,s)=>i-s).join(", ")}`:void 0},Jw=(e,t)=>`z: ${e.topology.portZ[t]}`,Qsn=(e,t,n)=>{let o=e.topology.portZ[t],r=e.topology.portZ[n];return o===r?`z: ${o}`:`z: ${o} -> ${r}`},$Xe=(e,t)=>Qsn(e,e.problem.routeStartPort[t],e.problem.routeEndPort[t]),K3e=(e,t,n)=>Ug(B$(e,t),((o,r)=>{let i=o.topology.incidentPortRegion[r]?.[0],s=o.topology.incidentPortRegion[r]?.[1];return`connects: region-${i??"?"} <-> region-${s??"?"}`})(e,t),Rsn(e,t,n)),j4r=(e,t,n,o)=>{let r=e.topology.portZ[n];return r!==e.topology.portZ[o]?{strokeColor:hVt("rgba(22, 160, 133, 0.95)",x$e(e,t)),strokeDash:"2 4 2"}:r>0?{strokeColor:hVt("rgba(52, 152, 219, 0.95)",x$e(e,t)),strokeDash:"3 2"}:{strokeColor:dV(e,t)}},uVt=(e,t)=>{for(let n=0;n<e.state.regionSegments.length;n++){let o=e.state.regionSegments[n]??[];for(let[r,i,s]of o)t.lines.push({points:[qb(e,i),qb(e,s)],label:Ug(`route: ${bV(e,r)}`,`region: region-${n}`,Qsn(e,i,s)),layer:y5(e,i),...j4r(e,r,i,s)})}},pVt=(e,t)=>{let n=new Set;for(let o=0;o<e.state.regionSegments.length;o++){let r=e.state.regionSegments[o]??[];for(let[i,s,a]of r)for(let c of[s,a]){let l=`${i}:${c}`;if(n.has(l))continue;n.add(l);let h=qb(e,c);t.points.push({x:h.x,y:h.y,color:dV(e,i,1),layer:y5(e,c),label:Ug(`route: ${bV(e,i)}`,B$(e,c),Rsn(e,c,i),Jw(e,c))})}}},K4r=(e,t)=>{for(let n=0;n<e.problem.routeCount;n++)if(e.problem.routeStartPort[n]===t||e.problem.routeEndPort[n]===t)return!0;return!1},$4r=(e,t,n)=>{let o=((s,a)=>{let c=new Set;for(let l=0;l<a.length;l++)if(a[l]===1)for(let h of s.topology.incidentPortRegion[l]??[])c.add(h);return c})(e,n);for(let s of o){let a=e.topology.regionMetadata?.[s],c=a?.polygon,l=wsn(e,s),h=Bsn(e,s),d=l.maxX-l.minX,u=l.maxY-l.minY,_=Tsn(e,s),p=Ug("section region",Dsn(e,s));Array.isArray(c)&&c.length>=3?t.polygons.push({points:c,fill:"rgba(245, 158, 11, 0.08)",stroke:"rgba(245, 158, 11, 0.95)",strokeWidth:2,layer:_,label:p}):t.rects.push({center:h,width:Math.max(d-VCe,0.05),height:Math.max(u-VCe,0.05),fill:"rgba(245, 158, 11, 0.08)",stroke:"rgba(245, 158, 11, 0.95)",layer:_,label:p})}for(let s=0;s<n.length;s++)n[s]===1&&t.circles.push({center:mce(e,s),radius:0.07,fill:"rgba(251, 191, 36, 0.18)",stroke:"rgba(245, 158, 11, 0.95)",layer:y5(e,s),label:Ug(K3e(e,s),Jw(e,s),"section port")})},YCe=(e,t={})=>{let n={arrows:[],circles:[],infiniteLines:[],lines:[],points:[],polygons:[],rects:[],texts:[],title:"Tiny HyperGraph",coordinateSystem:"cartesian"},o=((a,c)=>{if(!c?.highlightSectionMask)return;let l=c.sectionPortMask??a.problem.portSectionMask;if(l.length!==a.topology.portCount)return;let h=0,d=0;for(let u=0;u<l.length;u++)l[u]===1?h+=1:d+=1;return h!==0&&d!==0?l:void 0})(e,t),r=((a)=>{let c=a.getStaticallyUnroutableRoutes();if(c.length!==0)return new Set(c.map((l)=>l.routeId))})(e);for(let a=0;a<e.topology.regionCount;a++){let c=e.topology.regionMetadata?.[a],l=c?.polygon,h=wsn(e,a),d=Bsn(e,a),u=h.maxX-h.minX,_=h.maxY-h.minY,p=Tsn(e,a),m=Msn(Nsn(e,a));Array.isArray(l)&&l.length>=3?n.polygons.push({points:l,fill:m,layer:p}):n.rects.push({center:d,width:Math.max(u-VCe,0.05),height:Math.max(_-VCe,0.05),fill:X4r(e,a),layer:p,label:Dsn(e,a)})}if(((a,c,l)=>{for(let h=0;h<a.problem.routeCount;h++){if(l&&!l.has(h))continue;let d=a.problem.routeStartPort[h],u=a.problem.routeEndPort[h],_=qb(a,d),p=qb(a,u),m=dV(a,h),A=bV(a,h),g=dVt(a,h);c.points.push({x:_.x,y:_.y,color:m,layer:y5(a,d),label:Ug(`route: ${A}`,g,"endpoint: start",B$(a,d),Jw(a,d))}),c.points.push({x:p.x,y:p.y,color:m,layer:y5(a,u),label:Ug(`route: ${A}`,g,"endpoint: end",B$(a,u),Jw(a,u))})}})(e,n,r),e.iterations===0){for(let a of n.polygons)a.stroke="rgba(128, 128, 128, 0.5)";for(let a of n.rects)a.stroke="rgba(128, 128, 128, 0.5)"}if(e.iterations===0){for(let a=0;a<e.topology.portCount;a++){let c=o?.[a]===1;t.showOnlySectionPortsOnIdle&&!c||n.circles.push({center:mce(e,a),radius:0.05,fill:e.topology.portZ[a]>0?"rgba(52, 152, 219, 0.55)":"rgba(128, 128, 128, 0.5)",layer:y5(e,a),label:Ug(K3e(e,a),Jw(e,a))})}if(r)((a,c)=>{for(let l of a.getStaticallyUnroutableRoutes()){let{routeId:h,connectionId:d,startPortId:u,endPortId:_}=l,p=rVt(a,u),m=rVt(a,_),A=jXe(`static reachability failed: ${d}`,U4r(a,h),l.startRegionId?`startRegionId: ${l.startRegionId}`:void 0,l.endRegionId?`endRegionId: ${l.endRegionId}`:void 0,l.pointIds.length>=2?`points: ${l.pointIds.join(" -> ")}`:void 0,G4r(a,h));c.lines.push({points:[p,m],strokeColor:XXe,strokeDash:"8 4",label:A}),c.circles.push({center:p,radius:0.12,fill:oVt,stroke:XXe,layer:iVt(a,u),label:jXe(A,"endpoint: start",sVt(a,u),aVt(a,u))}),c.circles.push({center:m,radius:0.12,fill:oVt,stroke:XXe,layer:iVt(a,_),label:jXe(A,"endpoint: end",sVt(a,_),aVt(a,_))})}})(e,n);else{let a=new Set;for(let c of e.state.regionSegments)for(let[l]of c)a.add(l);if(a.size>0&&(uVt(e,n),pVt(e,n)),t.showInitialRouteHints!==!1){let c=new Set(e.state.unroutedRoutes);e.state.currentRouteId!==void 0&&c.add(e.state.currentRouteId),((l,h,d)=>{for(let u=0;u<l.problem.routeCount;u++){if(d&&!d.has(u))continue;let _=l.problem.routeStartPort[u],p=l.problem.routeEndPort[u],m=qb(l,_),A=qb(l,p),g={x:(m.x+A.x)/2,y:(m.y+A.y)/2};h.lines.push({points:[m,A],strokeColor:dV(l,u),strokeDash:"3 3",layer:y5(l,_),label:Ug(bV(l,u),$Xe(l,u))}),h.points.push({x:g.x,y:g.y,color:dV(l,u,1),layer:y5(l,_),label:Ug(bV(l,u),$Xe(l,u))})}})(e,n,c)}}}else uVt(e,n),pVt(e,n),((a)=>y$e(a)&&a.showUnassignedPortsInVisualization===!0)(e)&&((a,c)=>{for(let l=0;l<a.topology.portCount;l++)a.state.portAssignment[l]>=0||K4r(a,l)||c.circles.push({center:mce(a,l),radius:0.04,fill:a.topology.portZ[l]>0?"rgba(52, 152, 219, 0.2)":"rgba(128, 128, 128, 0.2)",stroke:a.topology.portZ[l]>0?"rgba(52, 152, 219, 0.6)":"rgba(128, 128, 128, 0.6)",layer:y5(a,l),label:Ug(K3e(a,l),Jw(a,l),"state: unassigned")})})(e,n),y$e(e)||(((a,c)=>{let l=a.state.currentRouteId;if(l===void 0||a.solved)return;let h=a.problem.routeStartPort[l],d=a.problem.routeEndPort[l],u=qb(a,h),_=qb(a,d),p=dV(a,l),m=bV(a,l);c.lines.push({points:[u,_],strokeColor:p,strokeDash:"10 5",label:Ug(m,$Xe(a,l))})})(e,n),((a,c)=>{if(a.solved)return;let l=a.state.currentRouteId,h=a.state.candidateQueue.toArray().sort((p,m)=>p.f-m.f).slice(0,10);for(let p=0;p<h.length;p++){let m=h[p],A=qb(a,m.portId),g=p===0;c.points.push({x:A.x,y:A.y,color:g?"green":"rgba(128, 128, 128, 0.25)",layer:y5(a,m.portId),label:Ug(K3e(a,m.portId,l),Jw(a,m.portId),`g: ${m.g.toFixed(2)}`,`h: ${m.h.toFixed(2)}`,`f: ${m.f.toFixed(2)}`)})}let d=h[0];if(!d)return;let u=[],_=d;for(;_;)u.unshift(qb(a,_.portId)),_=_.prevCandidate;u.length>1&&c.lines.push({points:u,strokeColor:l!==void 0?dV(a,l):"rgba(0, 160, 120, 0.9)"})})(e,n));o&&$4r(e,n,o),((a,c)=>{if(a.failed)for(let l of a.getNeverSuccessfullyRoutedRoutes()){let{routeId:h,connectionId:d,attempts:u,startPortId:_,endPortId:p}=l,m=dVt(a,h),A=mce(a,_),g=mce(a,p),f=Ug(`never routed: ${d}`,`attempts: ${u}`,m,l.startRegionId?`startRegionId: ${l.startRegionId}`:void 0,l.endRegionId?`endRegionId: ${l.endRegionId}`:void 0);c.lines.push({points:[{x:0,y:0},{x:A.x,y:A.y}],strokeColor:p3e,strokeDash:lVt,layer:y5(a,_),label:Ug(f,"origin guide","endpoint: start")}),c.circles.push({center:A,radius:1,fill:cVt,stroke:p3e,layer:y5(a,_),label:Ug(f,"endpoint: start",B$(a,_),Jw(a,_))}),c.lines.push({points:[{x:0,y:0},{x:g.x,y:g.y}],strokeColor:p3e,strokeDash:lVt,layer:y5(a,p),label:Ug(f,"origin guide","endpoint: end")}),c.circles.push({center:g,radius:1,fill:cVt,stroke:p3e,layer:y5(a,p),label:Ug(f,"endpoint: end",B$(a,p),Jw(a,p))})}})(e,n);let i=e.state.unroutedRoutes.length+(e.state.currentRouteId===void 0?0:1),s=o?o.reduce((a,c)=>a+Number(c===1),0):0;return n.title=["Tiny HyperGraph",`iter=${e.iterations}`,`pending=${i}`,o?`sectionPorts=${s}`:void 0,r?`staticReachabilityFailed=${r.size}`:void 0,e.failed?"failed":e.solved?"solved":"running"].filter(Boolean).join(" | "),n},X$=()=>({netIds:new Int32Array(0),lesserAngles:new Int32Array(0),greaterAngles:new Int32Array(0),layerMasks:new Int32Array(0),existingCrossingLayerIntersections:0,existingSameLayerIntersections:0,existingEntryExitLayerChanges:0,existingRegionCost:0,existingSegmentCount:0}),q4r=(e)=>({netIds:new Int32Array(e.netIds),lesserAngles:new Int32Array(e.lesserAngles),greaterAngles:new Int32Array(e.greaterAngles),layerMasks:new Int32Array(e.layerMasks),existingCrossingLayerIntersections:e.existingCrossingLayerIntersections,existingSameLayerIntersections:e.existingSameLayerIntersections,existingEntryExitLayerChanges:e.existingEntryExitLayerChanges,existingRegionCost:e.existingRegionCost,existingSegmentCount:e.existingSegmentCount}),Qae=(e)=>{return{portAssignment:new Int32Array(e.portAssignment),regionSegments:(t=e.regionSegments,t.map((n)=>n.map(([o,r,i])=>[o,r,i]))),regionIntersectionCaches:e.regionIntersectionCaches.map(q4r),regionCongestionCost:new Float64Array(e.regionCongestionCost),ripCount:e.ripCount};var t},ksn=(e,t)=>{t&&(t.minViaPadDiameter!==void 0&&(e.minViaPadDiameter=t.minViaPadDiameter),t.DISTANCE_TO_COST!==void 0&&(e.DISTANCE_TO_COST=t.DISTANCE_TO_COST),t.RIP_THRESHOLD_START!==void 0&&(e.RIP_THRESHOLD_START=t.RIP_THRESHOLD_START),t.RIP_THRESHOLD_END!==void 0&&(e.RIP_THRESHOLD_END=t.RIP_THRESHOLD_END),t.RIP_THRESHOLD_RAMP_ATTEMPTS!==void 0&&(e.RIP_THRESHOLD_RAMP_ATTEMPTS=t.RIP_THRESHOLD_RAMP_ATTEMPTS),t.RIP_CONGESTION_REGION_COST_FACTOR!==void 0&&(e.RIP_CONGESTION_REGION_COST_FACTOR=t.RIP_CONGESTION_REGION_COST_FACTOR),t.TRACE_DENSITY_COST_FACTOR!==void 0&&(e.TRACE_DENSITY_COST_FACTOR=Math.max(0,t.TRACE_DENSITY_COST_FACTOR)),t.USE_LAZY_ROUTE_HEURISTIC!==void 0&&(e.USE_LAZY_ROUTE_HEURISTIC=t.USE_LAZY_ROUTE_HEURISTIC),t.USE_SPARSE_CANDIDATE_STORAGE!==void 0&&(e.USE_SPARSE_CANDIDATE_STORAGE=t.USE_SPARSE_CANDIDATE_STORAGE),t.OWNED_REGIONAL_HOP_FRONTIER!==void 0&&(e.OWNED_REGIONAL_HOP_FRONTIER=t.OWNED_REGIONAL_HOP_FRONTIER),t.MAX_ITERATIONS!==void 0&&(e.MAX_ITERATIONS=t.MAX_ITERATIONS),t.VERBOSE!==void 0&&(e.VERBOSE=t.VERBOSE),t.STATIC_REACHABILITY_PRECHECK!==void 0&&(e.STATIC_REACHABILITY_PRECHECK=t.STATIC_REACHABILITY_PRECHECK),t.STATIC_REACHABILITY_PRECHECK_MAX_HOPS!==void 0&&(e.STATIC_REACHABILITY_PRECHECK_MAX_HOPS=t.STATIC_REACHABILITY_PRECHECK_MAX_HOPS),t.ACCEPT_BEST_SOLUTION_ON_TIMEOUT!==void 0&&(e.ACCEPT_BEST_SOLUTION_ON_TIMEOUT=t.ACCEPT_BEST_SOLUTION_ON_TIMEOUT),t.GREEDY_FINAL_ROUTE_ITERS!==void 0&&(e.GREEDY_FINAL_ROUTE_ITERS=t.GREEDY_FINAL_ROUTE_ITERS),t.PARTIAL_RIP_ENABLED!==void 0&&(e.PARTIAL_RIP_ENABLED=t.PARTIAL_RIP_ENABLED),t.PARTIAL_RIP_MIN_ROUTE_COUNT!==void 0&&(e.PARTIAL_RIP_MIN_ROUTE_COUNT=t.PARTIAL_RIP_MIN_ROUTE_COUNT),t.PARTIAL_RIP_MAX_ROUTE_COUNT!==void 0&&(e.PARTIAL_RIP_MAX_ROUTE_COUNT=t.PARTIAL_RIP_MAX_ROUTE_COUNT),t.PARTIAL_RIP_MAX_DISTANCE!==void 0&&(e.PARTIAL_RIP_MAX_DISTANCE=t.PARTIAL_RIP_MAX_DISTANCE),t.PARTIAL_RIP_QUALITY_MAX_DISTANCE!==void 0&&(e.PARTIAL_RIP_QUALITY_MAX_DISTANCE=t.PARTIAL_RIP_QUALITY_MAX_DISTANCE),t.PARTIAL_RIP_MAX_ATTEMPTS!==void 0&&(e.PARTIAL_RIP_MAX_ATTEMPTS=t.PARTIAL_RIP_MAX_ATTEMPTS),t.PARTIAL_RIP_WARMUP_FULL_RIP_ATTEMPTS!==void 0&&(e.PARTIAL_RIP_WARMUP_FULL_RIP_ATTEMPTS=t.PARTIAL_RIP_WARMUP_FULL_RIP_ATTEMPTS),t.PARTIAL_RIP_COMPLEXITY_SELECTION_MIN_ROUTE_COUNT!==void 0&&(e.PARTIAL_RIP_COMPLEXITY_SELECTION_MIN_ROUTE_COUNT=t.PARTIAL_RIP_COMPLEXITY_SELECTION_MIN_ROUTE_COUNT),t.PARTIAL_RIP_TARGET_MAX_COST_IMPROVEMENT_RATIO!==void 0&&(e.PARTIAL_RIP_TARGET_MAX_COST_IMPROVEMENT_RATIO=t.PARTIAL_RIP_TARGET_MAX_COST_IMPROVEMENT_RATIO),t.PARTIAL_RIP_MAX_REGION_COST_GROWTH_RATIO!==void 0&&(e.PARTIAL_RIP_MAX_REGION_COST_GROWTH_RATIO=t.PARTIAL_RIP_MAX_REGION_COST_GROWTH_RATIO),t.PARTIAL_RIP_MAX_TOTAL_COST_GROWTH_RATIO!==void 0&&(e.PARTIAL_RIP_MAX_TOTAL_COST_GROWTH_RATIO=t.PARTIAL_RIP_MAX_TOTAL_COST_GROWTH_RATIO),t.OUTSIDE_IN_ROUTING!==void 0&&(e.OUTSIDE_IN_ROUTING=t.OUTSIDE_IN_ROUTING),t.OUTSIDE_IN_MAX_DISTANCE!==void 0&&(e.OUTSIDE_IN_MAX_DISTANCE=t.OUTSIDE_IN_MAX_DISTANCE))},$3e=(e)=>({minViaPadDiameter:e.minViaPadDiameter,DISTANCE_TO_COST:e.DISTANCE_TO_COST,RIP_THRESHOLD_START:e.RIP_THRESHOLD_START,RIP_THRESHOLD_END:e.RIP_THRESHOLD_END,RIP_THRESHOLD_RAMP_ATTEMPTS:e.RIP_THRESHOLD_RAMP_ATTEMPTS,RIP_CONGESTION_REGION_COST_FACTOR:e.RIP_CONGESTION_REGION_COST_FACTOR,TRACE_DENSITY_COST_FACTOR:e.TRACE_DENSITY_COST_FACTOR,USE_LAZY_ROUTE_HEURISTIC:e.USE_LAZY_ROUTE_HEURISTIC,USE_SPARSE_CANDIDATE_STORAGE:e.USE_SPARSE_CANDIDATE_STORAGE,OWNED_REGIONAL_HOP_FRONTIER:e.OWNED_REGIONAL_HOP_FRONTIER,MAX_ITERATIONS:e.MAX_ITERATIONS,VERBOSE:e.VERBOSE,STATIC_REACHABILITY_PRECHECK:e.STATIC_REACHABILITY_PRECHECK,STATIC_REACHABILITY_PRECHECK_MAX_HOPS:e.STATIC_REACHABILITY_PRECHECK_MAX_HOPS,ACCEPT_BEST_SOLUTION_ON_TIMEOUT:e.ACCEPT_BEST_SOLUTION_ON_TIMEOUT,GREEDY_FINAL_ROUTE_ITERS:e.GREEDY_FINAL_ROUTE_ITERS,PARTIAL_RIP_ENABLED:e.PARTIAL_RIP_ENABLED,PARTIAL_RIP_MIN_ROUTE_COUNT:e.PARTIAL_RIP_MIN_ROUTE_COUNT,PARTIAL_RIP_MAX_ROUTE_COUNT:e.PARTIAL_RIP_MAX_ROUTE_COUNT,PARTIAL_RIP_MAX_DISTANCE:e.PARTIAL_RIP_MAX_DISTANCE,PARTIAL_RIP_QUALITY_MAX_DISTANCE:e.PARTIAL_RIP_QUALITY_MAX_DISTANCE,PARTIAL_RIP_MAX_ATTEMPTS:e.PARTIAL_RIP_MAX_ATTEMPTS,PARTIAL_RIP_WARMUP_FULL_RIP_ATTEMPTS:e.PARTIAL_RIP_WARMUP_FULL_RIP_ATTEMPTS,PARTIAL_RIP_COMPLEXITY_SELECTION_MIN_ROUTE_COUNT:e.PARTIAL_RIP_COMPLEXITY_SELECTION_MIN_ROUTE_COUNT,PARTIAL_RIP_TARGET_MAX_COST_IMPROVEMENT_RATIO:e.PARTIAL_RIP_TARGET_MAX_COST_IMPROVEMENT_RATIO,PARTIAL_RIP_MAX_REGION_COST_GROWTH_RATIO:e.PARTIAL_RIP_MAX_REGION_COST_GROWTH_RATIO,PARTIAL_RIP_MAX_TOTAL_COST_GROWTH_RATIO:e.PARTIAL_RIP_MAX_TOTAL_COST_GROWTH_RATIO,OUTSIDE_IN_ROUTING:e.OUTSIDE_IN_ROUTING,OUTSIDE_IN_MAX_DISTANCE:e.OUTSIDE_IN_MAX_DISTANCE}),J4r=(e,t)=>e.f-t.f,ZQ=class e extends Da{constructor(t,n,o){super(),this.topology=t,this.problem=n,ksn(this,o);let r=1,i=new Int32Array(t.portCount).fill(-1),s=new Int32Array(t.portCount).fill(-1);for(let l=0;l<t.portCount;l++){let h=t.incidentPortRegion[l]??[];h.length>r&&(r=h.length),i[l]=h[0]??-1,s[l]=h[1]??-1}this.candidateHopSlotStride=r,this.candidateFirstRegionByPortId=i,this.candidateSecondRegionByPortId=s,this.hCostByPortId=new Float64Array(t.portCount),this.hCostRouteIdByPortId=new Int32Array(t.portCount).fill(-1);let a=t.portCount*r;this.candidateHopCapacity=a,this.state={portAssignment:new Int32Array(t.portCount).fill(-1),regionSegments:Array.from({length:t.regionCount},()=>[]),regionIntersectionCaches:Array.from({length:t.regionCount},()=>X$()),currentRouteId:void 0,currentRouteNetId:void 0,unroutedRoutes:WXe(n.routeCount),candidateQueue:new vsn([],J4r),candidateBestCostByHopId:this.USE_SPARSE_CANDIDATE_STORAGE?new Map:new Float64Array(a),candidateBestCostGenerationByHopId:this.USE_SPARSE_CANDIDATE_STORAGE?new Map:new Uint32Array(a),candidateBestCostGeneration:1,goalPortId:-1,ripCount:0,regionCongestionCost:new Float64Array(t.regionCount).fill(0)},this.routeAttemptCountByRouteId=new Uint32Array(n.routeCount),this.routeSuccessCountByRouteId=new Uint32Array(n.routeCount);let c=f$e({topology:t,problem:n,state:this.state,routeSuccessCountByRouteId:this.routeSuccessCountByRouteId,appendSegmentToRegionCache:(l,h,d)=>this.appendSegmentToRegionCache(l,h,d)});c&&(this.stats={...this.stats,...c})}topology;problem;state;candidateHopSlotStride;candidateHopCapacity;candidateFirstRegionByPortId;candidateSecondRegionByPortId;candidateOverflowBestCost;regionalHopFrontierQueue;regionalHopFrontierEpoch;regionalHopFrontierGoalPortId;regionalHopFrontierRouteId;regionalHopFrontierNetId;regionalHopFrontiers=new Map;_problemSetup;hCostByPortId;hCostRouteIdByPortId;hCostEndRouteId;hCostEndX=0;hCostEndY=0;routeAttemptCountByRouteId;routeSuccessCountByRouteId;bestSolvedStateSnapshot;bestSolvedStateSummary;hasLoggedNeverSuccessfullyRoutedRoutes=!1;staticallyUnroutableRoutes=[];segmentGeometryScratch={netId:0,lesserAngle:0,greaterAngle:0,layerMask:0,entryExitLayerChanges:0,sameLayerIntersectionCount:0,crossingLayerIntersectionCount:0};ADD_SEGMENT_DISTANCE_TO_G=!1;costAwareFinalReripBudget=0;DISTANCE_TO_COST=0.05;minViaPadDiameter=bsn;RIP_THRESHOLD_START=0.05;RIP_THRESHOLD_END=0.8;RIP_THRESHOLD_RAMP_ATTEMPTS=50;RIP_CONGESTION_REGION_COST_FACTOR=0.1;TRACE_DENSITY_COST_FACTOR=0;USE_LAZY_ROUTE_HEURISTIC=!0;USE_SPARSE_CANDIDATE_STORAGE=!1;OWNED_REGIONAL_HOP_FRONTIER=!1;MAX_ITERATIONS=1e6;VERBOSE=!1;STATIC_REACHABILITY_PRECHECK=!0;STATIC_REACHABILITY_PRECHECK_MAX_HOPS=16;ACCEPT_BEST_SOLUTION_ON_TIMEOUT=!0;GREEDY_FINAL_ROUTE_ITERS=4;PARTIAL_RIP_ENABLED=!1;PARTIAL_RIP_MIN_ROUTE_COUNT=0;PARTIAL_RIP_MAX_ROUTE_COUNT=Number.POSITIVE_INFINITY;PARTIAL_RIP_MAX_DISTANCE=12;PARTIAL_RIP_QUALITY_MAX_DISTANCE;PARTIAL_RIP_MAX_ATTEMPTS=Number.POSITIVE_INFINITY;PARTIAL_RIP_WARMUP_FULL_RIP_ATTEMPTS=0;PARTIAL_RIP_COMPLEXITY_SELECTION_MIN_ROUTE_COUNT=Number.POSITIVE_INFINITY;PARTIAL_RIP_TARGET_MAX_COST_IMPROVEMENT_RATIO=0;PARTIAL_RIP_MAX_REGION_COST_GROWTH_RATIO=0.2;PARTIAL_RIP_MAX_TOTAL_COST_GROWTH_RATIO=0.1;OUTSIDE_IN_ROUTING=!1;OUTSIDE_IN_MAX_DISTANCE=24;resetForProblem(t){if(this.constructor!==e)throw Error("TinyHyperGraphSolver.resetForProblem cannot reset subclass routing state");this.problem=t,this._problemSetup=void 0,this.hCostEndRouteId=void 0,this.hCostRouteIdByPortId.fill(-1),this.state.portAssignment.fill(-1);for(let o of this.state.regionSegments)o.length=0;this.state.regionIntersectionCaches.fill(X$()),this.state.currentRouteId=void 0,this.state.currentRouteNetId=void 0,this.state.unroutedRoutes=WXe(t.routeCount),this.state.candidateQueue.clear(),this.state.candidateBestCostGeneration=1,this.state.candidateBestCostByHopId instanceof Map?this.state.candidateBestCostByHopId.clear():this.state.candidateBestCostByHopId.fill(0),this.state.candidateBestCostGenerationByHopId instanceof Map?this.state.candidateBestCostGenerationByHopId.clear():this.state.candidateBestCostGenerationByHopId.fill(0),this.state.goalPortId=-1,this.state.ripCount=0,this.state.regionCongestionCost.fill(0),this.routeAttemptCountByRouteId=new Uint32Array(t.routeCount),this.routeSuccessCountByRouteId=new Uint32Array(t.routeCount),this.bestSolvedStateSnapshot=void 0,this.bestSolvedStateSummary=void 0,this.hasLoggedNeverSuccessfullyRoutedRoutes=!1,this.staticallyUnroutableRoutes=[],this.candidateOverflowBestCost?.clear(),this.solved=!1,this.failed=!1,this.iterations=0,this.progress=0,this.error=null,this.activeSubSolver=void 0,this.failedSubSolvers=void 0,this.timeToSolve=void 0,this.stats={},this._setupDone=!1;let n=f$e({topology:this.topology,problem:t,state:this.state,routeSuccessCountByRouteId:this.routeSuccessCountByRouteId,appendSegmentToRegionCache:(o,r,i)=>this.appendSegmentToRegionCache(o,r,i)});n&&(this.stats={...this.stats,...n})}get problemSetup(){return this._problemSetup||(this._problemSetup=this.computeProblemSetup()),this._problemSetup}computeProblemSetup(){let{topology:t,problem:n}=this,o=this.USE_LAZY_ROUTE_HEURISTIC?void 0:new Float64Array(t.portCount*n.routeCount),{portX:r,portY:i}=t,s=[],a=new Int32Array(t.portCount).fill(-1),c=(l,h)=>{let d=s[l]??new Set;d.add(h),s[l]=d;let u=a[l];u===-1?a[l]=h:u!==h&&(a[l]=-2)};for(let l=0;l<n.routeCount;l++){let h=n.routeNet[l];if(c(n.routeStartPort[l],h),c(n.routeEndPort[l],h),o){let d=n.routeEndPort[l],u=r[d],_=i[d];for(let p=0;p<t.portCount;p++){let m=r[p]-u,A=i[p]-_;o[p*n.routeCount+l]=Math.sqrt(m*m+A*A)*this.DISTANCE_TO_COST}}}return{...o?{portHCostToEndOfRoute:o}:{},portEndpointNetIds:s,portEndpointReservationNetId:a}}_setup(){if(this.problemSetup,this.STATIC_REACHABILITY_PRECHECK){let t=Y4r({topology:this.topology,problem:this.problem,problemSetup:this.problemSetup,portAssignment:this.state.portAssignment,routeIds:this.state.unroutedRoutes,maxPrecheckHops:Math.max(0,this.STATIC_REACHABILITY_PRECHECK_MAX_HOPS),getStartingNextRegionId:(n,o)=>this.getStartingNextRegionId(n,o),getRouteSummary:(n)=>this.getRouteSummary(n)});this.staticallyUnroutableRoutes=t,t.length>0&&(this.failed=!0,this.error=((n)=>{let o=n.slice(0,5).map((i)=>{let s=i.pointIds.length>=2?`${i.pointIds[0]}->${i.pointIds[1]}`:`${i.startPortId}->${i.endPortId}`;return`${i.connectionId} (${s})`}).join(", "),r=n.length-5;return["Static reachability precheck failed:",`${n.length} route(s) have no legal path under the current reservation and start-region rules`,r>0?`${o}, +${r} more`:o].join(" ")})(t),this.stats={...this.stats,staticallyUnroutableRouteCount:t.length})}}_step(){let{problem:t,topology:n,state:o}=this;if(o.currentRouteId===void 0){if(o.unroutedRoutes.length===0)return void this.onAllRoutesRouted();o.currentRouteId=o.unroutedRoutes.shift(),o.currentRouteNetId=t.routeNet[o.currentRouteId],this.routeAttemptCountByRouteId[o.currentRouteId]+=1,this.resetCandidateBestCosts();let a=this.getRouteStartPortId(o.currentRouteId);o.candidateQueue.clear();let c=this.getStartingNextRegionId(o.currentRouteId,a);if(c===void 0)return this.failed=!0,void(this.error=`Start port ${a} has no incident regions`);let l=this.getHopId(a,c);this.setCandidateBestCost(l,0),o.candidateQueue.queue({hopId:l,nextRegionId:c,portId:a,f:0,g:0,h:0}),o.goalPortId=this.getRouteEndPortId(o.currentRouteId)}let r=o.candidateQueue.dequeue();if(!r)return void this.onOutOfCandidates();let i=r.hopId??this.getHopId(r.portId,r.nextRegionId);if(r.g>this.getCandidateBestCost(i))return;if(this.isRegionReservedForDifferentNet(r.nextRegionId))return;let s=n.regionIncidentPorts[r.nextRegionId];if(this.OWNED_REGIONAL_HOP_FRONTIER){let a=this.getRegionalHopFrontier(r.nextRegionId,s);if(a)return void this.expandRegionalHopFrontier(r,a)}for(let a of s){if(a===o.goalPortId){let g=o.portAssignment[a];if(this.isPortReservedForDifferentNet(a))continue;if(g!==-1&&g!==o.currentRouteNetId)continue;return void this.onPathFound(r)}if(a===r.portId)continue;if(t.portSectionMask[a]===0)continue;let c=n.incidentPortRegion[a][0]===r.nextRegionId?n.incidentPortRegion[a][1]:n.incidentPortRegion[a][0];if(c===void 0)continue;let l=this.getHopId(a,c);if((o.candidateQueue.isClosedHopId?o.candidateQueue.isClosedHopId(l):o.candidateQueue.isClosedHop?.(a,c))===!0)continue;let h=o.portAssignment[a];if(this.isPortReservedForDifferentNet(a))continue;if(h!==-1&&h!==o.currentRouteNetId)continue;if(this.isRegionReservedForDifferentNet(c))continue;let d=this.getCandidateBestCost(l);if(r.g>=d)continue;let u,_=r.g+o.regionCongestionCost[r.nextRegionId]+(t.portPenalty?.[a]??0);if(this.ADD_SEGMENT_DISTANCE_TO_G){let g=n.portX[r.portId]-n.portX[a],f=n.portY[r.portId]-n.portY[a];u=Math.sqrt(g*g+f*f),_+=u*this.DISTANCE_TO_COST}if(_>=d)continue;let p=this.computeG(r,a,d,u);if(!Number.isFinite(p)||p>=d)continue;let m=this.computeH(a),A={hopId:l,prevRegionId:r.nextRegionId,nextRegionId:c,portId:a,g:p,h:m,f:p+m,prevCandidate:r};if(a===o.goalPortId)return void this.onPathFound(A);this.setCandidateBestCost(l,p),o.candidateQueue.queue(A)}}getRegionalHopFrontier(t,n){let{state:o}=this,r=o.candidateQueue;if(!(r instanceof Ssn))return this.regionalHopFrontierQueue=void 0,this.regionalHopFrontierEpoch=void 0,void this.regionalHopFrontiers.clear();let i=r.closureEpoch;if(r===this.regionalHopFrontierQueue&&i===this.regionalHopFrontierEpoch&&o.goalPortId===this.regionalHopFrontierGoalPortId&&o.currentRouteId===this.regionalHopFrontierRouteId&&o.currentRouteNetId===this.regionalHopFrontierNetId||(this.regionalHopFrontierQueue=r,this.regionalHopFrontierEpoch=i,this.regionalHopFrontierGoalPortId=o.goalPortId,this.regionalHopFrontierRouteId=o.currentRouteId,this.regionalHopFrontierNetId=o.currentRouteNetId,this.regionalHopFrontiers.clear()),!Array.isArray(n)||n.length>2147483647)return;let s=this.regionalHopFrontiers.get(t);if(!s||s.neighbors!==n){let a=new Int32Array(n.length);for(let c=0;c<n.length;c++)a[c]=c+1<n.length?c+1:-1;s={neighbors:n,next:a,head:n.length>0?0:-1},this.regionalHopFrontiers.set(t,s)}return s}expandRegionalHopFrontier(t,n){let{problem:o,topology:r,state:i}=this,{neighbors:s,next:a}=n,c=n.head,l=-1;for(;c!==-1;){let h=c;c=a[h];let d=l;l=h;let u=s[h];if(u===i.goalPortId){let b=i.portAssignment[u];if(this.isPortReservedForDifferentNet(u))continue;if(b!==-1&&b!==i.currentRouteNetId)continue;return void this.onPathFound(t)}if(u===t.portId)continue;if(o.portSectionMask[u]===0)continue;let _=r.incidentPortRegion[u][0]===t.nextRegionId?r.incidentPortRegion[u][1]:r.incidentPortRegion[u][0];if(_===void 0)continue;let p=this.getHopId(u,_);if((i.candidateQueue.isClosedHopId?i.candidateQueue.isClosedHopId(p):i.candidateQueue.isClosedHop?.(u,_))===!0){d===-1?n.head=c:a[d]=c,l=d;continue}let m=i.portAssignment[u];if(this.isPortReservedForDifferentNet(u))continue;if(m!==-1&&m!==i.currentRouteNetId)continue;if(this.isRegionReservedForDifferentNet(_))continue;let A=this.getCandidateBestCost(p);if(t.g>=A)continue;let g,f=t.g+i.regionCongestionCost[t.nextRegionId]+(o.portPenalty?.[u]??0);if(this.ADD_SEGMENT_DISTANCE_TO_G){let b=r.portX[t.portId]-r.portX[u],I=r.portY[t.portId]-r.portY[u];g=Math.sqrt(b*b+I*I),f+=g*this.DISTANCE_TO_COST}if(f>=A)continue;let y=this.computeG(t,u,A,g);if(!Number.isFinite(y)||y>=A)continue;let x=this.computeH(u),C={hopId:p,prevRegionId:t.nextRegionId,nextRegionId:_,portId:u,g:y,h:x,f:y+x,prevCandidate:t};if(u===i.goalPortId)return void this.onPathFound(C);this.setCandidateBestCost(p,y),i.candidateQueue.queue(C)}}resetCandidateBestCosts(){let{state:t}=this;if(this.candidateOverflowBestCost?.clear(),t.candidateBestCostGeneration===4294967295)return t.candidateBestCostByHopId instanceof Map&&t.candidateBestCostByHopId.clear(),t.candidateBestCostGenerationByHopId instanceof Map?t.candidateBestCostGenerationByHopId.clear():t.candidateBestCostGenerationByHopId.fill(0),void(t.candidateBestCostGeneration=1);t.candidateBestCostGeneration+=1}getCandidateBestCost(t){if(t<0)return this.candidateOverflowBestCost?.get(t)??Number.POSITIVE_INFINITY;let{state:n}=this,o=n.candidateBestCostGenerationByHopId;return(o instanceof Map?o.get(t):o[t])===n.candidateBestCostGeneration?n.candidateBestCostByHopId instanceof Map?n.candidateBestCostByHopId.get(t):n.candidateBestCostByHopId[t]:Number.POSITIVE_INFINITY}setCandidateBestCost(t,n){if(t<0)return this.candidateOverflowBestCost||(this.candidateOverflowBestCost=new Map),void this.candidateOverflowBestCost.set(t,n);let{state:o}=this;o.candidateBestCostGenerationByHopId instanceof Map?o.candidateBestCostGenerationByHopId.set(t,o.candidateBestCostGeneration):o.candidateBestCostGenerationByHopId[t]=o.candidateBestCostGeneration,o.candidateBestCostByHopId instanceof Map?o.candidateBestCostByHopId.set(t,n):o.candidateBestCostByHopId[t]=n}getHopId(t,n){let o=t*this.candidateHopSlotStride;if(this.candidateFirstRegionByPortId[t]===n)return o;if(this.candidateSecondRegionByPortId[t]===n)return o+1;let r=this.topology.incidentPortRegion[t];for(let i=2;i<(r?.length??0);i++)if(r[i]===n)return o+i;return-(t*this.topology.regionCount+n)-1}getStartingNextRegionId(t,n){let o=this.topology.incidentPortRegion[n]??[],r=this.problem.routeNet[t];return o.find((i)=>this.problem.regionNetId[i]===-1)??o.find((i)=>this.problem.regionNetId[i]===r)??o[0]}getRouteStartPortId(t){return this.problem.routeStartPort[t]}getRouteEndPortId(t){return this.problem.routeEndPort[t]}isPortReservedForDifferentNet(t){let n=this.problemSetup.portEndpointReservationNetId[t]??-1;return n===-2||n!==-1&&n!==this.state.currentRouteNetId}isRegionReservedForDifferentNet(t){let n=this.problem.regionNetId[t];return n!==-1&&n!==this.state.currentRouteNetId}isKnownSingleLayerRegion(t){let n=this.topology.regionAvailableZMask?.[t]??0;return Isn(n)}computeRegionCostForRegion(t,n,o,r,i){return((s,a,c,l,h,d,u=0,_=0.3,p=0)=>L4r(s*a,c,l,h,d,u,_,p))(this.topology.regionWidth[t],this.topology.regionHeight[t],n,o,r,i,this.topology.regionAvailableZMask?.[t]??0,this.minViaPadDiameter,this.TRACE_DENSITY_COST_FACTOR)}populateSegmentGeometryScratch(t,n,o){return this.populateBaseSegmentGeometryScratch(t,n,o)}populateBaseSegmentGeometryScratch(t,n,o){let{state:r,topology:i}=this,s=this.segmentGeometryScratch,a=this.candidateFirstRegionByPortId[n]===t||this.candidateSecondRegionByPortId[n]!==t?i.portAngleForRegion1[n]:i.portAngleForRegion2?.[n]??i.portAngleForRegion1[n],c=this.candidateFirstRegionByPortId[o]===t||this.candidateSecondRegionByPortId[o]!==t?i.portAngleForRegion1[o]:i.portAngleForRegion2?.[o]??i.portAngleForRegion1[o],l=i.portZ[n],h=i.portZ[o];return s.lesserAngle=a<c?a:c,s.greaterAngle=a<c?c:a,s.layerMask=1<<l|1<<h,s.entryExitLayerChanges=l!==h?1:0,s.netId=r.currentRouteNetId,s}appendSegmentToRegionCache(t,n,o){let{state:r}=this,i=r.regionIntersectionCaches[t],s=this.populateSegmentGeometryScratch(t,n,o);tVt(i,s);let{sameLayerIntersectionCount:a,crossingLayerIntersectionCount:c,entryExitLayerChanges:l}=s,h=i.netIds.length+1,d=new Int32Array(h);d.set(i.netIds),d[h-1]=r.currentRouteNetId;let u=new Int32Array(h);u.set(i.lesserAngles),u[h-1]=s.lesserAngle;let _=new Int32Array(h);_.set(i.greaterAngles),_[h-1]=s.greaterAngle;let p=new Int32Array(h);p.set(i.layerMasks),p[h-1]=s.layerMask;let m=i.existingSameLayerIntersections+a,A=i.existingCrossingLayerIntersections+c,g=i.existingEntryExitLayerChanges+l,f=u.length;r.regionIntersectionCaches[t]={netIds:d,lesserAngles:u,greaterAngles:_,layerMasks:p,existingSameLayerIntersections:m,existingCrossingLayerIntersections:A,existingEntryExitLayerChanges:g,existingSegmentCount:f,existingRegionCost:this.computeRegionCostForRegion(t,m,A,g,f)}}getSolvedPathSegments(t){let{state:n}=this,o=[],r=t;for(;r;)o.unshift(r),r=r.prevCandidate;let i=[];for(let a=1;a<o.length;a++)i.push({regionId:o[a-1].nextRegionId,fromPortId:o[a-1].portId,toPortId:o[a].portId});let s=o[o.length-1];return s&&s.portId!==n.goalPortId&&i.push({regionId:s.nextRegionId,fromPortId:s.portId,toPortId:n.goalPortId}),i}resetRoutingStateForRerip(){let{topology:t,problem:n,state:o}=this;o.portAssignment.fill(-1),o.regionSegments=Array.from({length:t.regionCount},()=>[]),o.regionIntersectionCaches=Array.from({length:t.regionCount},()=>X$()),o.currentRouteNetId=void 0,o.currentRouteId=void 0,o.unroutedRoutes=OCe(WXe(n.routeCount),o.ripCount),o.candidateQueue.clear(),this.resetCandidateBestCosts(),o.goalPortId=-1}getMaxRegionCost(){let{topology:t,state:n}=this,o=0;for(let r=0;r<t.regionCount;r++){let i=n.regionIntersectionCaches[r]?.existingRegionCost??0;o=Math.max(o,i)}return o}getRouteMetadata(t){return this.problem.routeMetadata?.[t]}getRouteConnectionId(t){let n=this.getRouteMetadata(t)?.connectionId;return typeof n=="string"?n:`route-${t}`}getRouteSummary(t){return(({problem:n,routeId:o,getRouteMetadata:r,getRouteConnectionId:i})=>{let s=r?.(o)??Psn(n,o);return{routeId:o,connectionId:i?.(o)??O4r(n,o),startPortId:n.routeStartPort[o],endPortId:n.routeEndPort[o],startRegionId:typeof s?.startRegionId=="string"?s.startRegionId:void 0,endRegionId:typeof s?.endRegionId=="string"?s.endRegionId:void 0,pointIds:z4r(s)}})({problem:this.problem,routeId:t,getRouteMetadata:(n)=>this.getRouteMetadata(n),getRouteConnectionId:(n)=>this.getRouteConnectionId(n)})}getAdditionalRegionLabel(t){}getNeverSuccessfullyRoutedRoutes(){let t=[];for(let n=0;n<this.problem.routeCount;n++){let o=this.routeAttemptCountByRouteId[n];o===0||this.routeSuccessCountByRouteId[n]>0||t.push({...this.getRouteSummary(n),attempts:o})}return t}getStaticallyUnroutableRoutes(){return this.staticallyUnroutableRoutes}logNeverSuccessfullyRoutedRoutes(){if(!this.VERBOSE||this.hasLoggedNeverSuccessfullyRoutedRoutes)return;let t=this.getNeverSuccessfullyRoutedRoutes();if(this.hasLoggedNeverSuccessfullyRoutedRoutes=!0,t.length!==0){console.log(["[TinyHyperGraphSolver:never-routed-summary]",`count=${t.length}`].join(" "));for(let n of t){let o=n.pointIds.length>=2?`${n.pointIds[0]}->${n.pointIds[1]}`:"unknown";console.log(["[TinyHyperGraphSolver:never-routed]",`routeId=${n.routeId}`,`connectionId=${n.connectionId}`,`attempts=${n.attempts}`,`pointPath=${o}`,`startRegionId=${n.startRegionId??"unknown"}`,`endRegionId=${n.endRegionId??"unknown"}`].join(" "))}}}logRipEvent(t,n,o={}){this.VERBOSE&&console.log(["[TinyHyperGraphSolver:rip]",`ripCount=${this.state.ripCount}`,`maxRegionCostBeforeRip=${n.toFixed(3)}`,`reason=${t}`,...Object.entries(o).map(([r,i])=>`${r}=${typeof i=="number"?Number.isInteger(i)?String(i):i.toFixed(3):i}`)].join(" "))}compareRegionCostSummaries(t,n){return t.maxRegionCost!==n.maxRegionCost?t.maxRegionCost-n.maxRegionCost:t.totalRegionCost-n.totalRegionCost}captureBestSolvedState(t){this.bestSolvedStateSummary&&this.compareRegionCostSummaries(t,this.bestSolvedStateSummary)>=0||this.replaceBestSolvedState(t)}replaceBestSolvedState(t){this.bestSolvedStateSummary=t,this.bestSolvedStateSnapshot=Qae({portAssignment:this.state.portAssignment,regionSegments:this.state.regionSegments,regionIntersectionCaches:this.state.regionIntersectionCaches,regionCongestionCost:this.state.regionCongestionCost,ripCount:this.state.ripCount})}restoreBestSolvedState(){if(!this.bestSolvedStateSnapshot)return;let t=Qae(this.bestSolvedStateSnapshot);this.state.portAssignment=t.portAssignment,this.state.regionSegments=t.regionSegments,this.state.regionIntersectionCaches=t.regionIntersectionCaches,this.state.regionCongestionCost=t.regionCongestionCost,this.state.ripCount=t.ripCount,this.state.currentRouteId=void 0,this.state.currentRouteNetId=void 0,this.state.unroutedRoutes=[],this.state.candidateQueue.clear(),this.resetCandidateBestCosts(),this.state.goalPortId=-1}getRemainingRouteIdsForGreedyFinalRoute(){let t=new Set(this.state.unroutedRoutes);return this.state.currentRouteId!==void 0&&t.add(this.state.currentRouteId),[...t]}applySnapshotToGreedyFinalRouteSolver(t,n,o){let r=Qae(n);t.state.portAssignment=r.portAssignment,t.state.regionSegments=r.regionSegments,t.state.regionIntersectionCaches=r.regionIntersectionCaches,t.state.regionCongestionCost=r.regionCongestionCost,t.state.ripCount=0,t.state.currentRouteId=void 0,t.state.currentRouteNetId=void 0,t.state.unroutedRoutes=[...o],t.state.candidateQueue.clear(),t.resetCandidateBestCosts(),t.state.goalPortId=-1}summarizeSolvedState(t){let n=0,o=0;for(let r of t.state.regionIntersectionCaches){let i=r.existingRegionCost;n=Math.max(n,i),o+=i}return{maxRegionCost:n,totalRegionCost:o}}createGreedyFinalRouteSolver(t,n){return new Z4r(this.topology,this.problem,t)}tryGreedyFinalRouteAcceptance(){let t=Math.max(0,Math.floor(this.GREEDY_FINAL_ROUTE_ITERS));if(t===0)return!1;let n=this.getRemainingRouteIdsForGreedyFinalRoute();if(n.length===0)return!1;let o=Qae({portAssignment:this.state.portAssignment,regionSegments:this.state.regionSegments,regionIntersectionCaches:this.state.regionIntersectionCaches,regionCongestionCost:this.state.regionCongestionCost,ripCount:this.state.ripCount}),r=50000;for(let i=this.state.ripCount<this.costAwareFinalReripBudget?-1:0;i<t;i++){let s=i<=0?n:OCe(n,this.state.ripCount+i),a=this.createGreedyFinalRouteSolver({...$3e(this),ACCEPT_BEST_SOLUTION_ON_TIMEOUT:!1,GREEDY_FINAL_ROUTE_ITERS:0,MAX_ITERATIONS:50000,RIP_THRESHOLD_RAMP_ATTEMPTS:0,STATIC_REACHABILITY_PRECHECK:!1,OUTSIDE_IN_ROUTING:!1,PARTIAL_RIP_ENABLED:!1},i);if(r=a.MAX_ITERATIONS,this.applySnapshotToGreedyFinalRouteSolver(a,o,s),a.solve(),a.solved&&!a.failed)return this.bestSolvedStateSnapshot=Qae({portAssignment:a.state.portAssignment,regionSegments:a.state.regionSegments,regionIntersectionCaches:a.state.regionIntersectionCaches,regionCongestionCost:a.state.regionCongestionCost,ripCount:a.state.ripCount}),this.bestSolvedStateSummary=this.summarizeSolvedState(a),this.restoreBestSolvedState(),this.stats={...this.stats,acceptedGreedyFinalRouteOnTimeout:!0,greedyFinalRouteIter:Math.max(0,i),finalRoutingStrategy:i<0?"congestion-aware":"greedy",greedyFinalRouteRemainingRouteCount:n.length,greedyFinalRouteMaxIterations:r,neverSuccessfullyRoutedRouteCount:0,maxRegionCost:this.bestSolvedStateSummary.maxRegionCost,totalRegionCost:this.bestSolvedStateSummary.totalRegionCost,bestMaxRegionCost:this.bestSolvedStateSummary.maxRegionCost,bestTotalRegionCost:this.bestSolvedStateSummary.totalRegionCost},this.solved=!0,this.failed=!1,this.error=null,!0}return this.stats={...this.stats,greedyFinalRouteAttemptCount:t,greedyFinalRouteRemainingRouteCount:n.length,greedyFinalRouteMaxIterations:r},!1}onAllRoutesRouted(){let{topology:t,state:n}=this,o=this.RIP_THRESHOLD_RAMP_ATTEMPTS<=0?1:Math.min(1,n.ripCount/this.RIP_THRESHOLD_RAMP_ATTEMPTS),r=this.RIP_THRESHOLD_START+(this.RIP_THRESHOLD_END-this.RIP_THRESHOLD_START)*o,i=[],s=new Float64Array(t.regionCount),a=0,c=0;for(let d=0;d<t.regionCount;d++){let u=n.regionIntersectionCaches[d]?.existingRegionCost??0;s[d]=u,a=Math.max(a,u),c+=u,u>r&&i.push(d)}let l={maxRegionCost:a,totalRegionCost:c},h=i.length===0||n.ripCount>=this.RIP_THRESHOLD_RAMP_ATTEMPTS;if(h?(!this.bestSolvedStateSummary||this.compareRegionCostSummaries(l,this.bestSolvedStateSummary)<0)&&(this.bestSolvedStateSummary=l):this.captureBestSolvedState(l),this.stats={...this.stats,currentRipThreshold:r,hotRegionCount:i.length,maxRegionCost:a,totalRegionCost:c,bestMaxRegionCost:this.bestSolvedStateSummary?.maxRegionCost,bestTotalRegionCost:this.bestSolvedStateSummary?.totalRegionCost,ripCount:n.ripCount},h)this.solved=!0;else{for(let d=0;d<t.regionCount;d++)n.regionCongestionCost[d]+=s[d]*this.RIP_CONGESTION_REGION_COST_FACTOR;n.ripCount+=1,this.resetRoutingStateForRerip(),this.stats={...this.stats,ripCount:n.ripCount,maxRegionCostBeforeRip:a,reripRegionCount:i.length},this.logRipEvent("hot_regions",a,{hotRegionCount:i.length,currentRipThreshold:r})}}onOutOfCandidates(){let{topology:t,state:n}=this,o=n.currentRouteId,r=this.getMaxRegionCost();for(let i=0;i<t.regionCount;i++){let s=n.regionIntersectionCaches[i]?.existingRegionCost??0;n.regionCongestionCost[i]+=s*this.RIP_CONGESTION_REGION_COST_FACTOR}n.ripCount+=1,this.resetRoutingStateForRerip(),this.stats={...this.stats,ripCount:n.ripCount,maxRegionCost:r,maxRegionCostBeforeRip:r,reripReason:"out_of_candidates"},this.logRipEvent("out_of_candidates",r,{...o===void 0?{}:{routeId:o,connectionId:this.getRouteConnectionId(o)}})}onPathFound(t){let{state:n}=this,o=n.currentRouteId;if(o===void 0)return;this.routeSuccessCountByRouteId[o]+=1;let r=this.getSolvedPathSegments(t);for(let{regionId:i,fromPortId:s,toPortId:a}of r)n.regionSegments[i].push([o,s,a]),n.portAssignment[s]=n.currentRouteNetId,n.portAssignment[a]=n.currentRouteNetId,this.appendSegmentToRegionCache(i,s,a);n.candidateQueue.clear(),n.currentRouteNetId=void 0,n.currentRouteId=void 0}computeG(t,n,o=Number.POSITIVE_INFINITY,r){let{state:i,topology:s}=this,a=t.nextRegionId,c=i.regionIntersectionCaches[a],l=i.regionCongestionCost[a],h=this.problem.portPenalty?.[n]??0,d=0;if(this.ADD_SEGMENT_DISTANCE_TO_G){let A=r;if(A===void 0){let g=s.portX[t.portId]-s.portX[n],f=s.portY[t.portId]-s.portY[n];A=Math.sqrt(g*g+f*f)}d=A*this.DISTANCE_TO_COST}if(t.g+l+h+d>o+0.000000001)return Number.POSITIVE_INFINITY;let u=0,_=0,p=s.portZ[t.portId]!==s.portZ[n]?1:0;if(c.existingSegmentCount>0){let A=this.populateBaseSegmentGeometryScratch(a,t.portId,n);tVt(c,A),u=A.sameLayerIntersectionCount,_=A.crossingLayerIntersectionCount,p=A.entryExitLayerChanges}if(u>0&&this.isKnownSingleLayerRegion(a))return Number.POSITIVE_INFINITY;let m=this.computeRegionCostForRegion(a,c.existingSameLayerIntersections+u,c.existingCrossingLayerIntersections+_,c.existingEntryExitLayerChanges+p,c.existingSegmentCount+1)-c.existingRegionCost;return t.g+m+l+h+d}tryFinalAcceptance(){let t=this.getNeverSuccessfullyRoutedRoutes();if(this.stats={...this.stats,neverSuccessfullyRoutedRouteCount:t.length},this.ACCEPT_BEST_SOLUTION_ON_TIMEOUT&&this.bestSolvedStateSnapshot&&this.bestSolvedStateSummary)return this.restoreBestSolvedState(),this.stats={...this.stats,acceptedBestSolutionOnTimeout:!0,maxRegionCost:this.bestSolvedStateSummary.maxRegionCost,totalRegionCost:this.bestSolvedStateSummary.totalRegionCost,bestMaxRegionCost:this.bestSolvedStateSummary.maxRegionCost,bestTotalRegionCost:this.bestSolvedStateSummary.totalRegionCost},this.solved=!0,this.failed=!1,void(this.error=null);this.ACCEPT_BEST_SOLUTION_ON_TIMEOUT&&this.tryGreedyFinalRouteAcceptance()||this.logNeverSuccessfullyRoutedRoutes()}getRouteHeuristic(t,n){let o=this.problemSetup.portHCostToEndOfRoute;if(o)return o[n*this.problem.routeCount+t];if(this.hCostEndRouteId!==t){this.hCostEndRouteId=t;let r=this.getRouteEndPortId(t);this.hCostEndX=this.topology.portX[r],this.hCostEndY=this.topology.portY[r]}if(this.hCostRouteIdByPortId[n]!==t){let r=this.topology.portX[n]-this.hCostEndX,i=this.topology.portY[n]-this.hCostEndY;this.hCostByPortId[n]=Math.sqrt(r*r+i*i)*this.DISTANCE_TO_COST,this.hCostRouteIdByPortId[n]=t}return this.hCostByPortId[n]}computeH(t){return this.getRouteHeuristic(this.state.currentRouteId,t)}visualize(){return YCe(this)}getOutput(){return k4r(this)}},Z4r=class extends ZQ{computeG(e,t){return e.g}},e3r=class extends ZQ{constructor(e,t,n){super(e,t,n),this.ADD_SEGMENT_DISTANCE_TO_G=!0}_setup(){super._setup(),this.state.candidateQueue=new Ssn(this.topology.regionCount,{hopCapacity:this.candidateHopCapacity,hopSlotStride:this.candidateHopSlotStride,firstRegionByPortId:this.candidateFirstRegionByPortId,secondRegionByPortId:this.candidateSecondRegionByPortId,incidentPortRegion:this.topology.incidentPortRegion})}onPathFound(e){let t=this.state.goalPortId;if(e.portId===t)return void super.onPathFound(e);let n=this.computeG(e,t);if(!Number.isFinite(n))return;let o=this.getHopId(t,e.nextRegionId);n>=this.getCandidateBestCost(o)||(this.setCandidateBestCost(o,n),this.state.candidateQueue.queue({hopId:o,prevRegionId:e.nextRegionId,nextRegionId:e.nextRegionId,portId:t,g:n,h:0,f:n,prevCandidate:e}))}},t3r=new Set,n3r=class extends e3r{partialRipRoutePlans=new Map;outsideInRouteSearch;oneSidedFallbackRouteId;partialRipWindowDistance;partialRipCount=0;partiallyRippedRouteCount=0;partiallyRippedSegmentCount=0;retainedPartialRipSegmentCount=0;outsideInRouteCount=0;outsideInCompletedRouteCount=0;outsideInFallbackRouteCount=0;outsideInForwardExpansionCount=0;outsideInReverseExpansionCount=0;outsideInDistancePruneCount=0;completedRoundSummaries=[];firstCompletedRoundSummary;partialRipQualityBaselineSummary;bestSolvedRoundSummary;partialRipTargetReached=!1;useComplexityAwareSelection=!1;constructor(e,t,n){super(e,t,n),n?.PARTIAL_RIP_ENABLED===void 0&&(this.PARTIAL_RIP_ENABLED=!0),n?.OUTSIDE_IN_ROUTING===void 0&&(this.OUTSIDE_IN_ROUTING=!0),this.PARTIAL_RIP_ENABLED&&n?.PARTIAL_RIP_MAX_ATTEMPTS===void 0&&(this.PARTIAL_RIP_MAX_ATTEMPTS=10),(t.routeCount<Math.max(0,this.PARTIAL_RIP_MIN_ROUTE_COUNT)||t.routeCount>Math.max(0,this.PARTIAL_RIP_MAX_ROUTE_COUNT))&&(this.PARTIAL_RIP_ENABLED=!1,this.OUTSIDE_IN_ROUTING=!1),this.useComplexityAwareSelection=t.routeCount>=Math.max(0,this.PARTIAL_RIP_COMPLEXITY_SELECTION_MIN_ROUTE_COUNT)}getRouteStartPortId(e){return this.PARTIAL_RIP_ENABLED?this.partialRipRoutePlans.get(e)?.activeStartPortId??super.getRouteStartPortId(e):super.getRouteStartPortId(e)}getRouteEndPortId(e){return this.PARTIAL_RIP_ENABLED?this.partialRipRoutePlans.get(e)?.activeEndPortId??super.getRouteEndPortId(e):super.getRouteEndPortId(e)}getStartingNextRegionId(e,t){if(!this.PARTIAL_RIP_ENABLED)return super.getStartingNextRegionId(e,t);let n=this.partialRipRoutePlans.get(e);return n&&n.activeStartPortId===t?n.forcedStartRegionId:super.getStartingNextRegionId(e,t)}getEndingNextRegionId(e,t){let n=this.partialRipRoutePlans.get(e);return n&&n.activeEndPortId===t?n.forcedEndRegionId:super.getStartingNextRegionId(e,t)}computeH(e){if(!this.PARTIAL_RIP_ENABLED)return super.computeH(e);let t=this.state.currentRouteId;if(t===void 0||!this.partialRipRoutePlans.has(t))return super.computeH(e);let n=this.getRouteEndPortId(t),o=this.topology.portX[e]-this.topology.portX[n],r=this.topology.portY[e]-this.topology.portY[n];return Math.sqrt(o*o+r*r)*this.DISTANCE_TO_COST}onPathFound(e){if(!this.PARTIAL_RIP_ENABLED&&!this.OUTSIDE_IN_ROUTING)return void super.onPathFound(e);let t=this.state.currentRouteId,n=t!==void 0&&this.outsideInRouteSearch?.routeId===t;super.onPathFound(e),t!==void 0&&this.state.currentRouteId===void 0&&(this.partialRipRoutePlans.delete(t),n&&(this.outsideInCompletedRouteCount+=1),this.oneSidedFallbackRouteId===t&&(this.oneSidedFallbackRouteId=void 0)),this.outsideInRouteSearch=void 0,this.publishOutsideInStats()}resetRoutingStateForRerip(){this.PARTIAL_RIP_ENABLED||this.OUTSIDE_IN_ROUTING?(this.partialRipRoutePlans.clear(),this.outsideInRouteSearch=void 0,this.oneSidedFallbackRouteId=void 0,super.resetRoutingStateForRerip()):super.resetRoutingStateForRerip()}clearPartialRipPlans(e){for(let t of e)this.partialRipRoutePlans.delete(t)}getRouteIdsPreferredForPreservation(){return t3r}getCommittedRouteSegments(e){let t=[];for(let c=0;c<this.state.regionSegments.length;c++)for(let[l,h,d]of this.state.regionSegments[c]??[])l===e&&t.push({segmentIndex:t.length,regionId:c,fromPortId:h,toPortId:d});if(t.length===0)return;let n=new Map;for(let c of t)for(let l of[c.fromPortId,c.toPortId]){let h=n.get(l)??[];h.push(c.segmentIndex),n.set(l,h)}let o=this.problem.routeEndPort[e],r=[],i=new Set,s=new Set([this.problem.routeStartPort[e]]),a=(c)=>{if(c===o)return!0;for(let l of n.get(c)??[]){if(i.has(l))continue;let h=t[l],d=h.fromPortId===c?h.toPortId:h.fromPortId;if(!s.has(d)){if(i.add(l),s.add(d),r.push({regionId:h.regionId,fromPortId:c,toPortId:d}),a(d))return!0;r.pop(),s.delete(d),i.delete(l)}}return!1};return a(this.problem.routeStartPort[e])&&i.size===t.length?r:void 0}getSegmentDistance(e){let t=this.topology.portX[e.fromPortId]-this.topology.portX[e.toPortId],n=this.topology.portY[e.fromPortId]-this.topology.portY[e.toPortId];return Math.sqrt(t*t+n*n)}getPartialRipWindow(e,t,n){let o,r=Number.NEGATIVE_INFINITY;for(let h=0;h<e.length;h++){let d=e[h];if(!t.has(d.regionId))continue;let u=n[d.regionId]??0;u>r&&(r=u,o=h)}if(o===void 0)return;let i=Math.max(0,this.partialRipWindowDistance??this.PARTIAL_RIP_MAX_DISTANCE),s=o,a=o,c=this.getSegmentDistance(e[o])/2,l=c;for(;s>0;){let h=this.getSegmentDistance(e[s-1]);if(c+h>i)break;s-=1,c+=h}for(;a+1<e.length;){let h=this.getSegmentDistance(e[a+1]);if(l+h>i)break;a+=1,l+=h}return{startIndex:s,endIndex:a}}appendRetainedSegment(e,t,n){e[n.regionId].push([t,n.fromPortId,n.toPortId])}preparePartialRip(e,t){if(!this.PARTIAL_RIP_ENABLED||e.length===0)return!1;let n=new Set(e);if(this.partialRipWindowDistance===void 0){let h=0;for(let _ of e)h=Math.max(h,t[_]??0);let d=Math.max(0,this.PARTIAL_RIP_MAX_DISTANCE),u=Math.max(d,this.PARTIAL_RIP_QUALITY_MAX_DISTANCE??2*d);this.partialRipWindowDistance=h<=1.5*this.RIP_THRESHOLD_END?u:d}let o=new Set;for(let h of e)for(let[d]of this.state.regionSegments[h]??[])o.add(d);if(o.size===0)return!1;let r=this.getRouteIdsPreferredForPreservation(),i=[...o].some((h)=>!r.has(h)),s=Array.from({length:this.topology.regionCount},()=>[]),a=new Map,c=0,l=0;for(let h=0;h<this.problem.routeCount;h++){let d=this.getCommittedRouteSegments(h);if(!d)return!1;if(!o.has(h)||i&&r.has(h)){for(let m of d)this.appendRetainedSegment(s,h,m),l+=1;continue}let u=this.getPartialRipWindow(d,n,t);if(!u)return!1;for(let m=0;m<d.length;m++){let A=d[m];m>=u.startIndex&&m<=u.endIndex?c+=1:(this.appendRetainedSegment(s,h,A),l+=1)}let _=d[u.startIndex],p=d[u.endIndex];a.set(h,{routeId:h,activeStartPortId:_.fromPortId,activeEndPortId:p.toPortId,forcedStartRegionId:_.regionId,forcedEndRegionId:p.regionId,rippedSegmentCount:u.endIndex-u.startIndex+1,retainedSegmentCount:d.length-(u.endIndex-u.startIndex+1)})}return a.size!==0&&c!==0&&(this.partialRipRoutePlans=a,this.rebuildRetainedRoutingState(s,[...a.keys()]),this.partialRipCount+=1,this.partiallyRippedRouteCount+=a.size,this.partiallyRippedSegmentCount+=c,this.retainedPartialRipSegmentCount+=l,this.publishPartialRipStats(),!0)}rebuildRetainedRoutingState(e,t){this.state.portAssignment.fill(-1),this.state.regionSegments=Array.from({length:this.topology.regionCount},()=>[]),this.state.regionIntersectionCaches=Array.from({length:this.topology.regionCount},()=>X$()),this.state.currentRouteId=void 0,this.state.currentRouteNetId=void 0,this.state.unroutedRoutes=t,this.state.candidateQueue.clear(),this.resetCandidateBestCosts(),this.state.goalPortId=-1,this.outsideInRouteSearch=void 0,this.oneSidedFallbackRouteId=void 0;for(let n=0;n<e.length;n++)for(let[o,r,i]of e[n]??[]){let s=this.problem.routeNet[o];this.state.currentRouteNetId=s;for(let a of[r,i]){let c=this.state.portAssignment[a];if(c!==-1&&c!==s)throw Error(`OutsideInPartialRipTinyHyperGraphSolver: retained port ${a} belongs to multiple nets`);this.state.portAssignment[a]=s}this.state.regionSegments[n].push([o,r,i]),this.appendSegmentToRegionCache(n,r,i)}this.state.currentRouteNetId=void 0}publishPartialRipStats(){this.stats={...this.stats,partialRipCount:this.partialRipCount,partiallyRippedRouteCount:this.partiallyRippedRouteCount,partiallyRippedSegmentCount:this.partiallyRippedSegmentCount,retainedPartialRipSegmentCount:this.retainedPartialRipSegmentCount,partialRipMaxDistance:this.partialRipWindowDistance??this.PARTIAL_RIP_MAX_DISTANCE,partialRipBaseMaxDistance:this.PARTIAL_RIP_MAX_DISTANCE,partialRipQualityMaxDistance:this.PARTIAL_RIP_QUALITY_MAX_DISTANCE??2*this.PARTIAL_RIP_MAX_DISTANCE,partialRipMaxAttempts:this.PARTIAL_RIP_MAX_ATTEMPTS}}publishOutsideInStats(){this.stats={...this.stats,outsideInRouteCount:this.outsideInRouteCount,outsideInCompletedRouteCount:this.outsideInCompletedRouteCount,outsideInFallbackRouteCount:this.outsideInFallbackRouteCount,outsideInForwardExpansionCount:this.outsideInForwardExpansionCount,outsideInReverseExpansionCount:this.outsideInReverseExpansionCount,outsideInDistancePruneCount:this.outsideInDistancePruneCount,outsideInMaxDistance:this.OUTSIDE_IN_MAX_DISTANCE}}createOutsideInFrontier(e,t,n){let o=new vsn([],(c,l)=>c.f===l.f?c.g-l.g:c.f-l.f),r=this.topology.portX[e]-this.topology.portX[n],i=this.topology.portY[e]-this.topology.portY[n],s=Math.sqrt(r*r+i*i)*this.DISTANCE_TO_COST,a={portId:e,nextRegionId:t,f:s,g:0,h:s,travelDistance:0};return o.queue(a),{queue:o,bestCostByHopId:new Map([[this.getHopId(e,t),0]]),settledByPortId:new Map,settledByRegionId:new Map,targetPortId:n}}startOutsideInRouteSearch(e){let t=this.getRouteStartPortId(e),n=this.getRouteEndPortId(e),o=this.getStartingNextRegionId(e,t),r=this.getEndingNextRegionId(e,n);return o!==void 0&&r!==void 0&&(this.state.goalPortId=n,this.state.candidateQueue.clear(),this.resetCandidateBestCosts(),this.outsideInRouteSearch={routeId:e,forward:this.createOutsideInFrontier(t,o,n),reverse:this.createOutsideInFrontier(n,r,t),expandForwardNext:!0,distanceLimitHit:!1,bestJoinedCost:Number.POSITIVE_INFINITY},this.outsideInRouteCount+=1,this.publishOutsideInStats(),!0)}dequeueFreshCandidate(e){for(;e.queue.length>0;){let t=e.queue.dequeue(),n=this.getHopId(t.portId,t.nextRegionId);if(t.g<=(e.bestCostByHopId.get(n)??1/0))return t}}recordSettledCandidate(e,t){let n=e.settledByPortId.get(t.portId);(!n||t.g<n.g)&&e.settledByPortId.set(t.portId,t);let o=e.settledByRegionId.get(t.nextRegionId)??[];o.push(t),o.sort((r,i)=>r.g-i.g),o.length>16&&(o.length=16),e.settledByRegionId.set(t.nextRegionId,o)}getCandidatePath(e){let t=[],n=e;for(;n;)t.push(n),n=n.prevCandidate;return t.reverse(),t}buildJoinedCandidate(e,t){let n=this.getCandidatePath(e),o=this.getCandidatePath(t),r=n.map(({portId:c})=>c),i=n.slice(0,-1).map(({nextRegionId:c})=>c);if(e.portId!==t.portId){if(e.nextRegionId!==t.nextRegionId)return;let c=this.topology.portX[e.portId]-this.topology.portX[t.portId],l=this.topology.portY[e.portId]-this.topology.portY[t.portId],h=Math.sqrt(c*c+l*l);if(e.travelDistance+t.travelDistance+h>2*this.OUTSIDE_IN_MAX_DISTANCE)return;let d=this.computeG(e,t.portId);if(!Number.isFinite(d))return;i.push(e.nextRegionId),r.push(t.portId)}for(let c=o.length-2;c>=0;c--){let l=o[c];i.push(l.nextRegionId),r.push(l.portId)}if(new Set(r).size!==r.length||i.length+1!==r.length)return;let s={portId:r[0],nextRegionId:i[0],f:0,g:0,h:0};for(let c=1;c<r.length;c++)s={portId:r[c],prevRegionId:i[c-1],nextRegionId:i[c]??i[c-1],prevCandidate:s,f:0,g:0,h:0};let a=e.portId===t.portId?0:this.computeG(e,t.portId)-e.g;return{candidate:s,cost:e.g+t.g+a}}considerOutsideInJoins(e,t){let n=this.outsideInRouteSearch,o=t?n.reverse:n.forward,r=(s)=>{!s||s.cost>=n.bestJoinedCost||(n.bestJoinedCandidate=s.candidate,n.bestJoinedCost=s.cost,n.remainingPostMeetingExpansions=24)},i=o.settledByPortId.get(e.portId);i&&r(t?this.buildJoinedCandidate(e,i):this.buildJoinedCandidate(i,e));for(let s of o.settledByRegionId.get(e.nextRegionId)??[])r(t?this.buildJoinedCandidate(e,s):this.buildJoinedCandidate(s,e))}commitBestOutsideInJoin(){let e=this.outsideInRouteSearch?.bestJoinedCandidate;return!!e&&(this.onPathFound(e),!0)}expandOutsideInFrontier(e){let t=this.outsideInRouteSearch,n=e?t.forward:t.reverse,o=this.dequeueFreshCandidate(n);if(!o)return!1;if(e?this.outsideInForwardExpansionCount+=1:this.outsideInReverseExpansionCount+=1,this.isRegionReservedForDifferentNet(o.nextRegionId))return!0;this.recordSettledCandidate(n,o),this.considerOutsideInJoins(o,e);for(let r of this.topology.regionIncidentPorts[o.nextRegionId]??[]){if(r===o.portId)continue;if(this.isPortReservedForDifferentNet(r))continue;let i=this.state.portAssignment[r];if(i!==-1&&i!==this.state.currentRouteNetId)continue;if(r!==n.targetPortId&&this.problem.portSectionMask[r]===0)continue;let s=this.topology.portX[o.portId]-this.topology.portX[r],a=this.topology.portY[o.portId]-this.topology.portY[r],c=Math.sqrt(s*s+a*a),l=o.travelDistance+c;if(l>this.OUTSIDE_IN_MAX_DISTANCE){t.distanceLimitHit=!0,this.outsideInDistancePruneCount+=1;continue}let h=this.topology.incidentPortRegion[r]?.[0]===o.nextRegionId?this.topology.incidentPortRegion[r]?.[1]:this.topology.incidentPortRegion[r]?.[0];if(h===void 0||this.isRegionReservedForDifferentNet(h))continue;let d=this.getHopId(r,h),u=n.bestCostByHopId.get(d)??1/0;if(o.g>=u)continue;let _=this.computeG(o,r,u,c);if(!Number.isFinite(_)||_>=u)continue;n.bestCostByHopId.set(d,_);let p=this.topology.portX[r]-this.topology.portX[n.targetPortId],m=this.topology.portY[r]-this.topology.portY[n.targetPortId],A=Math.sqrt(p*p+m*m)*this.DISTANCE_TO_COST;n.queue.queue({portId:r,prevRegionId:o.nextRegionId,nextRegionId:h,prevCandidate:o,f:_+A,g:_,h:A,travelDistance:l})}return!0}fallBackToOneSidedRouteSearch(){let e=this.state.currentRouteId;e!==void 0&&(this.outsideInRouteSearch=void 0,this.outsideInFallbackRouteCount+=1,this.oneSidedFallbackRouteId=e,this.state.currentRouteId=void 0,this.state.currentRouteNetId=void 0,this.state.goalPortId=-1,this.state.candidateQueue.clear(),this.resetCandidateBestCosts(),this.state.unroutedRoutes.unshift(e),this.publishOutsideInStats())}_step(){if(!this.OUTSIDE_IN_ROUTING)return void super._step();let e=this.state.currentRouteId??this.state.unroutedRoutes[0];if(e!==void 0&&!this.partialRipRoutePlans.has(e))return void super._step();if(this.oneSidedFallbackRouteId!==void 0)return void super._step();if(this.state.currentRouteId===void 0){if(this.state.unroutedRoutes.length===0)return void this.onAllRoutesRouted();let o=this.state.unroutedRoutes.shift();if(this.state.currentRouteId=o,this.state.currentRouteNetId=this.problem.routeNet[o],this.routeAttemptCountByRouteId[o]+=1,!this.startOutsideInRouteSearch(o))return this.failed=!0,void(this.error=`Route ${o} has an endpoint without an incident region`)}let t=this.outsideInRouteSearch;if(!t)return;let n=this.expandOutsideInFrontier(t.expandForwardNext);if(this.state.currentRouteId!==void 0&&(n||(n=this.expandOutsideInFrontier(!t.expandForwardNext),this.state.currentRouteId!==void 0)))if(t.expandForwardNext=!t.expandForwardNext,t.bestJoinedCandidate&&(t.remainingPostMeetingExpansions=(t.remainingPostMeetingExpansions??1)-1,(t.remainingPostMeetingExpansions??0)<=0))this.commitBestOutsideInJoin();else{if(!n&&t.forward.queue.length===0&&t.reverse.queue.length===0){if(this.commitBestOutsideInJoin())return;this.outsideInRouteSearch=void 0,t.distanceLimitHit?this.fallBackToOneSidedRouteSearch():this.onOutOfCandidates()}this.publishOutsideInStats()}}shouldReplaceBestSolvedState(e){let t=this.bestSolvedRoundSummary;if(!t)return!0;if(!this.useComplexityAwareSelection)return this.compareRegionCostSummaries(e,t)<0;let n=this.partialRipQualityBaselineSummary;if(!n)return this.compareRegionCostSummaries(e,t)<0;let o=this.firstCompletedRoundSummary??n,r=o.maxRegionCost*(1+Math.max(0,this.PARTIAL_RIP_MAX_REGION_COST_GROWTH_RATIO)),i=o.totalRegionCost*(1+Math.max(0,this.PARTIAL_RIP_MAX_TOTAL_COST_GROWTH_RATIO)),s=e.maxRegionCost<=r&&e.totalRegionCost<=i;return s!==(t.maxRegionCost<=r&&t.totalRegionCost<=i)?s:s&&e.segmentCount!==t.segmentCount?e.segmentCount<t.segmentCount:this.compareRegionCostSummaries(e,t)<0}onAllRoutesRouted(){if(!this.PARTIAL_RIP_ENABLED)return void super.onAllRoutesRouted();let{state:e,topology:t}=this,n=Math.min(this.RIP_THRESHOLD_RAMP_ATTEMPTS,this.PARTIAL_RIP_MAX_ATTEMPTS),o=Math.max(0,this.RIP_THRESHOLD_RAMP_ATTEMPTS),r=o<=0?1:Math.min(1,e.ripCount/o),i=this.RIP_THRESHOLD_START+(this.RIP_THRESHOLD_END-this.RIP_THRESHOLD_START)*r,s=new Float64Array(t.regionCount),a=[],c=0,l=0,h=0,d=0,u=0;for(let P=0;P<t.regionCount;P++){let M=e.regionIntersectionCaches[P]?.existingRegionCost??0;s[P]=M,c=Math.max(c,M),l+=M;let B=e.regionSegments[P]?.length??0;h+=B,d=Math.max(d,B),u+=B*B,M>i&&a.push(P)}let _={maxRegionCost:c,totalRegionCost:l},p={..._,ripCount:e.ripCount,segmentCount:h,maxRegionSegmentCount:d,squaredRegionSegmentCount:u};this.completedRoundSummaries.push(p),this.firstCompletedRoundSummary??=p,this.partialRipQualityBaselineSummary===void 0&&e.ripCount>=Math.max(0,this.PARTIAL_RIP_WARMUP_FULL_RIP_ATTEMPTS)&&(this.partialRipQualityBaselineSummary=p),this.shouldReplaceBestSolvedState(p)&&(this.replaceBestSolvedState(_),this.bestSolvedRoundSummary=p);let m=this.firstCompletedRoundSummary,A=this.partialRipQualityBaselineSummary??m,g=Math.max(0,this.PARTIAL_RIP_TARGET_MAX_COST_IMPROVEMENT_RATIO),f=Math.max(0,this.PARTIAL_RIP_MAX_TOTAL_COST_GROWTH_RATIO),y=A.maxRegionCost*(1-g),x=A.totalRegionCost*(1+f),C=this.useComplexityAwareSelection&&e.ripCount>A.ripCount&&g>0&&c<=y&&l<=x&&h<=A.segmentCount;if(C&&(this.partialRipTargetReached=!0),this.stats={...this.stats,currentRipThreshold:i,hotRegionCount:a.length,maxRegionCost:c,totalRegionCost:l,bestMaxRegionCost:this.bestSolvedStateSummary?.maxRegionCost,bestTotalRegionCost:this.bestSolvedStateSummary?.totalRegionCost,ripCount:e.ripCount,completedRoundSummaries:this.completedRoundSummaries.map((P)=>({...P})),firstMaxRegionCost:m.maxRegionCost,firstTotalRegionCost:m.totalRegionCost,firstSegmentCount:m.segmentCount,firstMaxRegionSegmentCount:m.maxRegionSegmentCount,firstSquaredRegionSegmentCount:m.squaredRegionSegmentCount,partialRipQualityBaselineRipCount:A.ripCount,partialRipQualityBaselineMaxRegionCost:A.maxRegionCost,partialRipQualityBaselineTotalRegionCost:A.totalRegionCost,partialRipQualityBaselineSegmentCount:A.segmentCount,partialRipQualityBaselineMaxRegionSegmentCount:A.maxRegionSegmentCount,partialRipQualityBaselineSquaredRegionSegmentCount:A.squaredRegionSegmentCount,bestSolvedSegmentCount:this.bestSolvedRoundSummary?.segmentCount,bestSolvedMaxRegionSegmentCount:this.bestSolvedRoundSummary?.maxRegionSegmentCount,bestSolvedSquaredRegionSegmentCount:this.bestSolvedRoundSummary?.squaredRegionSegmentCount,partialRipTargetMaxRegionCost:y,partialRipMaxTargetTotalRegionCost:x,partialRipComplexityAwareSelection:this.useComplexityAwareSelection,partialRipComplexitySelectionMinRouteCount:this.PARTIAL_RIP_COMPLEXITY_SELECTION_MIN_ROUTE_COUNT,partialRipMaxRegionCostGrowthRatio:this.PARTIAL_RIP_MAX_REGION_COST_GROWTH_RATIO,partialRipTargetReached:this.partialRipTargetReached},this.publishPartialRipStats(),a.length===0||C||e.ripCount>=n)return this.restoreBestSolvedState(),void(this.solved=!0);for(let P=0;P<t.regionCount;P++)e.regionCongestionCost[P]+=s[P]*this.RIP_CONGESTION_REGION_COST_FACTOR;let b=e.ripCount<Math.max(0,this.PARTIAL_RIP_WARMUP_FULL_RIP_ATTEMPTS);e.ripCount+=1;let I=!b&&this.preparePartialRip(a,s);I||this.resetRoutingStateForRerip();let v=b?"warmup_full":I?"partial":"full_fallback";this.stats={...this.stats,ripCount:e.ripCount,maxRegionCostBeforeRip:c,reripRegionCount:a.length,reripMode:v,partialRipWarmupFullRipAttempts:this.PARTIAL_RIP_WARMUP_FULL_RIP_ATTEMPTS},this.logRipEvent("hot_regions",c,{hotRegionCount:a.length,currentRipThreshold:i,reripMode:v,partialRouteCount:I?this.partialRipRoutePlans.size:0})}},Lsn=(e)=>{let t=typeof e.d?.netId=="number"?e.d.netId:typeof e.d?.NetId=="number"?e.d.NetId:void 0;return Number.isFinite(t)?t:void 0},o3r=(e)=>{let t=new Set;for(let i of e.connections??[])t.add(i.startRegionId),t.add(i.endRegionId);let n=new Set(e.regions.filter((i)=>((s)=>{if(s.d?._containsObstacle!==!0)return!1;let a=Lsn(s);return a===void 0||a===-1})(i)&&!t.has(i.regionId)).map((i)=>i.regionId));if(n.size===0)return e;let o=e.ports.filter((i)=>!n.has(i.region1Id)&&!n.has(i.region2Id)),r=(e.connections??[]).find((i)=>n.has(i.startRegionId)||n.has(i.endRegionId));if(r)throw Error(`Connection "${r.connectionId}" references full-obstacle region`);return{...e,regions:e.regions.filter((i)=>!n.has(i.regionId)),ports:o}},Hsn=(e)=>{let t=e.d?.bounds;if(t)return t;let n=e.d?.center,o=e.d?.width,r=e.d?.height;return n&&typeof n.x=="number"&&typeof n.y=="number"&&typeof o=="number"&&typeof r=="number"?{minX:n.x-o/2,maxX:n.x+o/2,minY:n.y-r/2,maxY:n.y+r/2}:{minX:0,maxX:0,minY:0,maxY:0}},Fsn=(e)=>Number(e.d?.x??0),zsn=(e)=>Number(e.d?.y??0),mVt=(e,t)=>{if(!t)return 0;let n=Hsn(t),o=Fsn(e),r=zsn(e),i=n.minX<=o&&o<=n.maxX,s=n.minY<=r&&r<=n.maxY;if(s&&o>=n.maxX){let m=Math.max(n.maxY-n.minY,0.000000001),A=(r-n.minY)/m;return Math.round(9000*A)}if(i&&r>=n.maxY){let m=Math.max(n.maxX-n.minX,0.000000001),A=(n.maxX-o)/m;return 9000+Math.round(9000*A)}if(s&&o<=n.minX){let m=Math.max(n.maxY-n.minY,0.000000001),A=(n.maxY-r)/m;return 18000+Math.round(9000*A)}if(i&&r<=n.minY){let m=Math.max(n.maxX-n.minX,0.000000001),A=(o-n.minX)/m;return 27000+Math.round(9000*A)}let a=Math.abs(o-n.minX),c=Math.abs(o-n.maxX),l=Math.abs(r-n.minY),h=Math.abs(r-n.maxY),d=Math.min(a,c,l,h),u=Math.max(n.maxX-n.minX,0.000000001),_=Math.max(n.maxY-n.minY,0.000000001);if(d===c){let m=(r-n.minY)/_;return Math.round(9000*m)}if(d===h){let m=(n.maxX-o)/u;return 9000+Math.round(9000*m)}if(d===a){let m=(n.maxY-r)/_;return 18000+Math.round(9000*m)}let p=(o-n.minX)/u;return 27000+Math.round(9000*p)},_Vt=(e,t)=>{if(!e)return;return[...e.pointIds].sort((n,o)=>{let r=t.get(n),i=t.get(o),s=Number(r?.d?.distToCentermostPortOnZ??Number.POSITIVE_INFINITY),a=Number(i?.d?.distToCentermostPortOnZ??Number.POSITIVE_INFINITY);if(s!==a)return s-a;let c=Number(r?.d?.z??0),l=Number(i?.d?.z??0);return c!==l?c-l:n.localeCompare(o)})[0]},YZe=(e)=>{let t=o3r(e),n=new Map,o=new Map,r=new Map,i=new Map((t.solvedRoutes??[]).map((re)=>[re.connection.connectionId,re]));t.regions.forEach((re,Z)=>{n.set(re.regionId,Z)}),t.ports.forEach((re,Z)=>{o.set(re.portId,Z),r.set(re.portId,re)});let s=t.regions.length,a=t.ports.length,c=t.regions.map((re)=>re.pointIds.map((Z)=>o.get(Z)).filter((Z)=>Z!==void 0)),l=Array.from({length:a},()=>[]),h=new Float64Array(s),d=new Float64Array(s),u=new Float64Array(s),_=new Float64Array(s),p=new Int32Array(s),m=new Int32Array(s).fill(-1),A=new Int8Array(s);t.regions.forEach((re,Z)=>{let te=((le)=>{let ue=Hsn(le),de=typeof le.d?.width=="number"?le.d.width:ue.maxX-ue.minX,me=typeof le.d?.height=="number"?le.d.height:ue.maxY-ue.minY;return{centerX:typeof le.d?.center?.x=="number"?le.d.center.x:(ue.minX+ue.maxX)/2,centerY:typeof le.d?.center?.y=="number"?le.d.center.y:(ue.minY+ue.maxY)/2,width:de,height:me}})(re);h[Z]=te.width,d[Z]=te.height,u[Z]=te.centerX,_[Z]=te.centerY,p[Z]=((le)=>{let ue=le.d?.availableZ;if(!Array.isArray(ue))return 0;let de=0;for(let me of ue)!Number.isInteger(me)||me<0||me>=31||(de|=1<<me);return de})(re);let ie=Lsn(re);ie!==void 0&&(m[Z]=ie,A[Z]=1)});let g=new Int32Array(a),f=new Int32Array(a),y=new Float64Array(a),x=new Float64Array(a),C=new Int32Array(a);t.ports.forEach((re,Z)=>{let te=n.get(re.region1Id),ie=n.get(re.region2Id);if(te===void 0||ie===void 0)throw Error(`Port "${re.portId}" references missing regions "${re.region1Id}" or "${re.region2Id}"`);l[Z]=[te,ie],y[Z]=Fsn(re),x[Z]=zsn(re),C[Z]=((le)=>{let ue=Number(le.d?.z??0);return Number.isFinite(ue)?ue:0})(re),g[Z]=mVt(re,t.regions[te]),f[Z]=mVt(re,t.regions[ie])});let b=t.regions.map((re,Z)=>((te,ie)=>{let le=te.d&&typeof te.d=="object"&&!Array.isArray(te.d)?{...te.d}:{value:te.d};return le.layer=ie,Object.defineProperty(le,"serializedRegionId",{value:te.regionId,enumerable:!1,configurable:!0,writable:!0}),le})(re,((te)=>sv(VZe(p[te]))??sv((c[te]??[]).map((ie)=>C[ie]))??"z0")(Z))),I=t.ports.map((re,Z)=>((te,ie)=>{let le=te.d&&typeof te.d=="object"&&!Array.isArray(te.d)?{...te.d}:{value:te.d};return le.layer=ie,Object.defineProperty(le,"serializedPortId",{value:te.portId,enumerable:!1,configurable:!0,writable:!0}),le})(re,sv([C[Z]])??"z0")),v=t.connections??[],P=new Map,M=0,B=(re)=>{let Z=re.mutuallyConnectedNetworkId??re.connectionId,te=P.get(Z);return te===void 0&&(te=M++,P.set(Z,te)),te},T=Array.from({length:s},()=>new Set),N=(re,Z)=>{let te=n.get(re);if(te===void 0)throw Error(`Connection references missing region "${re}"`);T[te].add(Z)};v.forEach((re)=>{let Z=B(re);N(re.startRegionId,Z),N(re.endRegionId,Z)}),T.forEach((re,Z)=>{A[Z]!==1&&re.size===1&&(m[Z]=[...re][0])});let D=v.map((re)=>{let Z=i.get(re.connectionId),te=((ie,le)=>ie.ports.filter((ue)=>ue.region1Id===le.startRegionId&&ue.region2Id===le.endRegionId||ue.region2Id===le.startRegionId&&ue.region1Id===le.endRegionId).map((ue)=>ue.portId))(t,re);return{connection:re,solvedRoute:Z,sharedPortIds:te}}).filter(({solvedRoute:re,sharedPortIds:Z})=>Z.length===0||(re?.path.length??0)>1),L=D.length,H=new Map(D.map(({connection:re},Z)=>[re.connectionId,Z])),V=new Int8Array(a).fill(1),O=new Int32Array(L),U=new Int32Array(L),j=new Int32Array(L);D.forEach(({connection:re,solvedRoute:Z},te)=>{let ie=_Vt(t.regions.find((xe)=>xe.regionId===re.startRegionId),r),le=_Vt(t.regions.find((xe)=>xe.regionId===re.endRegionId),r),ue=Z?.path[0]?.portId??ie,de=Z?.path[Z.path.length-1]?.portId??le,me=ue!==void 0?o.get(ue):void 0,Ae=de!==void 0?o.get(de):void 0;if(me===void 0||Ae===void 0)throw Error(`Connection "${re.connectionId}" could not be mapped to route endpoints`);O[te]=me,U[te]=Ae,j[te]=B(re)});let Y={portCount:a,regionCount:s,regionIncidentPorts:c,incidentPortRegion:l,regionWidth:h,regionHeight:d,regionCenterX:u,regionCenterY:_,regionAvailableZMask:p,regionMetadata:b,portAngleForRegion1:g,portAngleForRegion2:f,portX:y,portY:x,portZ:C,portMetadata:I},X=t.regions.flatMap((re,Z)=>(re.assignments??[]).map((te)=>{let ie=H.get(te.connectionId);if(ie===void 0)throw Error(`Region "${re.regionId}" assignment references unknown routable connection "${te.connectionId}"`);let le=o.get(te.regionPort1Id),ue=o.get(te.regionPort2Id);if(le===void 0||ue===void 0)throw Error(`Region "${re.regionId}" assignment references missing port "${le===void 0?te.regionPort1Id:te.regionPort2Id}"`);if(!c[Z]?.includes(le)||!c[Z]?.includes(ue))throw Error(`Region "${re.regionId}" assignment ports must both belong to the region`);return{routeId:ie,regionId:Z,fromPortId:le,toPortId:ue}})),K=Float64Array.from(t.ports,(re)=>{let Z=Number(re.d?.tinyHypergraphPortPenalty??0);return Number.isFinite(Z)&&Z>0?Z:0}),J=K.some((re)=>re>0),ee={routeCount:L,portSectionMask:V,routeMetadata:D.map(({connection:re})=>re),routeStartPort:O,routeEndPort:U,routeNet:j,regionNetId:m,...X.length>0&&{initialAssignments:X},...J&&{portPenalty:K}},se=[],ne=[];for(let{solvedRoute:re}of D){if(!re){se.push([]),ne.push([]);continue}let Z=[],te=[];for(let ie=1;ie<re.path.length;ie++){let le=re.path[ie-1],ue=re.path[ie],de=le?.portId,me=ue?.portId,Ae=de!==void 0?o.get(de):void 0,xe=me!==void 0?o.get(me):void 0;if(Ae===void 0||xe===void 0)continue;let Me=typeof le?.nextRegionId=="string"?le.nextRegionId:typeof ue?.lastRegionId=="string"?ue.lastRegionId:void 0;Z.push([Ae,xe]),te.push(Me!==void 0?n.get(Me):void 0)}se.push(Z),ne.push(te)}return{topology:Y,problem:ee,solution:{solvedRoutePathSegments:se,solvedRoutePathRegionIds:ne}}},j$=(e)=>typeof e=="object"&&e!==null,T$=(e)=>Array.isArray(e)?e.map((t)=>T$(t)):j$(e)?Object.fromEntries(Object.entries(e).map(([t,n])=>[t,T$(n)])):e,r3r=(e)=>j$(e)?{...e}:e===void 0?{}:{value:e},PQ=(e,t=0)=>typeof e=="number"&&Number.isFinite(e)?e:t,gle=(e)=>({x:PQ(e.d?.x),y:PQ(e.d?.y)}),gVt=(e)=>[e.region1Id,e.region2Id].sort().join("\x00"),i3r=(e,t)=>Math.hypot(e.x-t.x,e.y-t.y),AVt=(e)=>{let t=Math.hypot(e.x,e.y);if(!(t<=0.000000001))return{x:e.x/t,y:e.y/t}},fVt=(e)=>{let t=e?.d?.center;if(j$(t))return{x:PQ(t.x),y:PQ(t.y)};let n=((o)=>{let r=o?.d?.bounds;if(j$(r)&&typeof r.minX=="number"&&typeof r.maxX=="number"&&typeof r.minY=="number"&&typeof r.maxY=="number")return{minX:r.minX,maxX:r.maxX,minY:r.minY,maxY:r.maxY};let i=o?.d?.center,s=PQ(o?.d?.width),a=PQ(o?.d?.height);if(j$(i)){let c=PQ(i.x),l=PQ(i.y);return{minX:c-s/2,maxX:c+s/2,minY:l-a/2,maxY:l+a/2}}return{minX:0,maxX:0,minY:0,maxY:0}})(e);return{x:(n.minX+n.maxX)/2,y:(n.minY+n.maxY)/2}},s3r=(e,t)=>{let n=gle(e),o,r=Number.POSITIVE_INFINITY;for(let i of t){if(i.portId===e.portId)continue;let s=i3r(n,gle(i));s<=0.000000001||s>=r||(o=i,r=s)}return o},a3r=(e,t,n)=>{let o=gle(e);if(t){let r=gle(t),i=AVt({x:o.x-r.x,y:o.y-r.y});if(i)return i}return((r,i)=>{let s=fVt(i.get(r.region1Id)),a=fVt(i.get(r.region2Id));return AVt({x:-(a.y-s.y),y:a.x-s.x})??{x:1,y:0}})(e,n)},c3r=(e,t,n)=>{let o=`${e}::dup${t}`;if(!n.has(o))return n.add(o),o;for(let r=2;;r++){let i=`${o}-${r}`;if(!n.has(i))return n.add(i),i}},l3r=(e,t,n)=>{let o=e.indexOf(t);o!==-1?e.splice(o+1,0,...n):e.push(...n)},h3r=(e,t)=>{let n=e.portMetadata?.[t];if(j$(n)){if(typeof n.serializedPortId=="string")return n.serializedPortId;if(typeof n.portId=="string")return n.portId}return`port-${t}`},d3r=(e,t)=>({routeCount:1,portSectionMask:e.portSectionMask,routeMetadata:e.routeMetadata===void 0?void 0:[e.routeMetadata[t]],routeStartPort:Int32Array.from([e.routeStartPort[t]]),routeEndPort:Int32Array.from([e.routeEndPort[t]]),routeNet:Int32Array.from([e.routeNet[t]]),regionNetId:e.regionNetId,portPenalty:e.portPenalty}),u3r=(e)=>{let t=new Set;for(let n of e.state.regionSegments)for(let[,o,r]of n)t.add(o),t.add(r);return t.size===0&&e.problem.routeCount===1&&(t.add(e.problem.routeStartPort[0]),t.add(e.problem.routeEndPort[0])),t},p3r=class extends Da{constructor(e,t={}){super(),this.serializedHyperGraph=e,this.options=t}serializedHyperGraph;options;revisedSerializedHyperGraph;report={portUseCounts:{},duplicatedPorts:[]};getDuplicatePortProximity(){return this.options.duplicatePortProximity??0.05}getIndividualRouteSolveOptions(){return{RIP_THRESHOLD_RAMP_ATTEMPTS:0,STATIC_REACHABILITY_PRECHECK:!1,...this.options.routeSolveOptions}}getPortUseCounts(){let{topology:e,problem:t}=YZe(this.serializedHyperGraph);this.options.useSerializedPortPenalties===!1&&(t.portPenalty=void 0);let n=new Map,o;for(let r=0;r<t.routeCount;r++){let i=d3r(t,r);if(o?o.resetForProblem(i):o=new ZQ(e,i,this.getIndividualRouteSolveOptions()),o.solve(),!o.solved||o.failed)throw Error(`Route ${r} could not be solved independently: ${o.error??"unknown error"}`);for(let s of u3r(o)){let a=h3r(e,s);n.set(a,(n.get(a)??0)+1)}}return n}duplicateCongestedPorts(e){let t=this.getDuplicatePortProximity();if(!(t>0))throw Error("duplicatePortProximity must be greater than zero");let{solvedRoutes:n,...o}=this.serializedHyperGraph,r=this.serializedHyperGraph.regions.map((d)=>({...d,pointIds:[...d.pointIds],d:T$(d.d)})),i=this.serializedHyperGraph.ports.map((d)=>({...d,d:T$(d.d)})),s=new Map(r.map((d)=>[d.regionId,d])),a=new Map(i.map((d)=>[d.portId,d])),c=((d)=>{let u=new Map;for(let _ of d){let p=gVt(_),m=u.get(p);m?m.push(_):u.set(p,[_])}return u})(this.serializedHyperGraph.ports),l=new Set(i.map((d)=>d.portId)),h=[];for(let[d,u]of[...e.entries()].sort(([_],[p])=>_.localeCompare(p))){if(u<=1)continue;let _=a.get(d);if(!_)continue;let p=u-1,m=c.get(gVt(_));if(!m)throw Error(`No boundary ports found for "${d}"`);let A=s3r(_,m),g=a3r(_,A,s),f=gle(_),y=[];for(let x=1;x<=p;x++){let C=c3r(d,x,l),b=t*x/(p+1),I=r3r(T$(_.d));I.x=f.x+g.x*b,I.y=f.y+g.y*b,I.duplicatedFromPortId=d,I.duplicateIndex=x,I.duplicatePortUseCount=u,I.duplicatePortProximity=t,I.repairReason="congested-port",i.push({..._,portId:C,d:I}),y.push(C)}for(let x of[_.region1Id,_.region2Id]){let C=s.get(x);C&&l3r(C.pointIds,d,y)}h.push({sourcePortId:d,duplicatePortIds:y,useCount:u})}return this.report={portUseCounts:Object.fromEntries([...e.entries()].sort()),duplicatedPorts:h},{...o,regions:r,ports:i,connections:this.serializedHyperGraph.connections===void 0?void 0:T$(this.serializedHyperGraph.connections)}}_setup(){try{let e=this.getPortUseCounts();this.revisedSerializedHyperGraph=this.duplicateCongestedPorts(e),this.stats={...this.stats,duplicateSourcePortCount:this.report.duplicatedPorts.length,duplicatedPortCount:this.report.duplicatedPorts.reduce((t,n)=>t+n.duplicatePortIds.length,0)},this.solved=!0}catch(e){this.failed=!0,this.error=e instanceof Error?e.message:String(e)}}_step(){this.failed||(this.solved=!0)}getOutput(){if(!this.revisedSerializedHyperGraph||this.failed)throw Error("DuplicateCongestedPortSolver does not have a repaired topology output");return this.revisedSerializedHyperGraph}},qXe=(e,t)=>{let n=e.owners.size-t.owners.size;if(n!==0)return n;let o=e.distance-t.distance;return o!==0?o:e.queueOrder-t.queueOrder},m3r=class{heap=[];push(e){this.heap.push(e);let t=this.heap.length-1;for(;t>0;){let n=Math.floor((t-1)/2);if(qXe(this.heap[n],this.heap[t])<=0)break;[this.heap[n],this.heap[t]]=[this.heap[t],this.heap[n]],t=n}}pop(){let e=this.heap[0],t=this.heap.pop();if(!e||!t)return null;if(this.heap.length===0)return e;this.heap[0]=t;let n=0;for(;;){let o=2*n+1,r=o+1,i=n;if(o<this.heap.length&&qXe(this.heap[o],this.heap[i])<0&&(i=o),r<this.heap.length&&qXe(this.heap[r],this.heap[i])<0&&(i=r),i===n)break;[this.heap[n],this.heap[i]]=[this.heap[i],this.heap[n]],n=i}return e}},_3r=(e,t,n)=>{if(e===t)return!0;if(e.size>t.size+n.length)return!1;for(let o of e)if(!t.has(o)&&!n.includes(o))return!1;return!0},g3r=(e,t)=>!(e.distance>t.distance)&&((n,o)=>{if(n.size>o.size)return!1;for(let r of n)if(!o.has(r))return!1;return!0})(e.owners,t.owners),A3r=(e,t)=>{let n=[],o=[],r=e;for(;r!==null;)n.push(r.state),r.incomingHop!==null&&o.push(r.incomingHop),r=r.parent;return n.reverse(),o.reverse(),{found:!0,states:n,hops:o,owners:new Set(e.owners),distance:e.distance,expandedLabelCount:t}},f3r=(e)=>{for(;;){let t=e.pop();if(t===null)return null;if(t.active)return t}},y3r=(e)=>{let t=e.maxExpandedLabels??Number.POSITIVE_INFINITY;if(t!==Number.POSITIVE_INFINITY&&(!Number.isInteger(t)||t<0))throw Error("maxExpandedLabels must be a non-negative integer");if(e.checkReachability){let a=((c,l)=>{let h=[c.start],d=new Set([c.getStateKey(c.start)]),u=0,_=0;for(let p=0;p<h.length;p++){let m=h[p];if(c.isGoal(m))return;if(u>=l)return;u++;for(let A of c.getHops(m)){if(_+=A.distance,A.distance<0||!Number.isFinite(_))return;let g=c.getStateKey(A.state);d.has(g)||(d.add(g),h.push(A.state))}}return{found:!1,reason:"no_path",expandedLabelCount:u}})(e,t);if(a)return a}let n=new Map,o=new m3r,r=0,i=0,s={state:e.start,stateKey:e.getStateKey(e.start),owners:new Set,distance:0,parent:null,incomingHop:null,queueOrder:r++,active:!0};for(n.set(s.stateKey,[s]),o.push(s);;){let a=f3r(o);if(a===null)return{found:!1,reason:"no_path",expandedLabelCount:i};if(e.isGoal(a.state))return A3r(a,i);if(i>=t)return{found:!1,reason:"expansion_limit",expandedLabelCount:i};i++;for(let c of e.getHops(a.state)){if(!Number.isFinite(c.distance)||c.distance<0)throw Error("Distinct-owner blocker hops require finite distances >= 0");let l=a.distance+c.distance;if(!Number.isFinite(l))throw Error("Distinct-owner blocker path distance overflowed");let h=e.getStateKey(c.state),d=r++,u=n.get(h)??[],_=c.owners??[],p=!1;for(let f of u)if(f.distance<=l&&_3r(f.owners,a.owners,_)){p=!0;break}if(p)continue;let m=a.owners;for(let f of _)m.has(f)||(m===a.owners&&(m=new Set(a.owners)),m.add(f));let A={state:c.state,stateKey:h,owners:m,distance:l,parent:a,incomingHop:c,queueOrder:d,active:!0},g=[];for(let f of u)g3r(A,f)?f.active=!1:g.push(f);g.push(A),n.set(A.stateKey,g),o.push(A)}}},Osn=(e,t)=>{ksn(e,t),t&&(t.MAX_RIPS!==void 0&&(e.MAX_RIPS=t.MAX_RIPS),t.MAX_RIPS_WITHOUT_MAX_REGION_COST_IMPROVEMENT!==void 0&&(e.MAX_RIPS_WITHOUT_MAX_REGION_COST_IMPROVEMENT=t.MAX_RIPS_WITHOUT_MAX_REGION_COST_IMPROVEMENT),t.EXTRA_RIPS_AFTER_BEATING_BASELINE_MAX_REGION_COST!==void 0&&(e.EXTRA_RIPS_AFTER_BEATING_BASELINE_MAX_REGION_COST=t.EXTRA_RIPS_AFTER_BEATING_BASELINE_MAX_REGION_COST))},Vsn=(e)=>e.map((t)=>t.map(([n,o,r])=>[n,o,r])),x3r=(e)=>({netIds:new Int32Array(e.netIds),lesserAngles:new Int32Array(e.lesserAngles),greaterAngles:new Int32Array(e.greaterAngles),layerMasks:new Int32Array(e.layerMasks),existingCrossingLayerIntersections:e.existingCrossingLayerIntersections,existingSameLayerIntersections:e.existingSameLayerIntersections,existingEntryExitLayerChanges:e.existingEntryExitLayerChanges,existingRegionCost:e.existingRegionCost,existingSegmentCount:e.existingSegmentCount}),C$e=(e)=>({portAssignment:new Int32Array(e.portAssignment),regionSegments:Vsn(e.regionSegments),regionIntersectionCaches:e.regionIntersectionCaches.map(x3r)}),JXe=(e,t)=>{let n=C$e(t);e.state.portAssignment=n.portAssignment,e.state.regionSegments=n.regionSegments,e.state.regionIntersectionCaches=n.regionIntersectionCaches},yVt=(e)=>{let t=0,n=0;for(let o=0;o<e.length;o++){let r=e[o]?.existingRegionCost??0;t=Math.max(t,r),n+=r}return{maxRegionCost:t,totalRegionCost:n}},Ysn=(e,t)=>e.maxRegionCost!==t.maxRegionCost?e.maxRegionCost-t.maxRegionCost:e.totalRegionCost-t.totalRegionCost,C3r=(e,t,n)=>{let o=e.incidentPortRegion[t]??[],r=e.incidentPortRegion[n]??[],i=o.find((s)=>r.includes(s));if(i===void 0)throw Error(`Ports ${t} and ${n} do not share a region`);return i},Gsn=(e,t,n,o)=>{let r=n.solvedRoutePathSegments[o]??[],i=n.solvedRoutePathRegionIds?.[o]??[],s=t.routeStartPort[o],a=t.routeEndPort[o];if(r.length===0){if(s===a)return{orderedPortIds:[s],orderedRegionIds:[]};throw Error(`Route ${o} does not have an existing solved path`)}let c=new Map;r.forEach(([p,m],A)=>{let g={segmentIndex:A,fromPortId:p,toPortId:m,regionId:i[A]},f=c.get(p)??[];f.push(g),c.set(p,f);let y=c.get(m)??[];y.push(g),c.set(m,y)});let l=[s],h=[],d=new Set,u,_=s;for(;_!==a||d.size<r.length;){let p=(c.get(_)??[]).filter(({segmentIndex:g,fromPortId:f,toPortId:y})=>{if(d.has(g))return!1;let x=f===_?y:f,C=x===a&&d.size+1===r.length;return x!==u||C}),m=_===a&&d.size===0&&p.length===2||p.length===1?p[0]:void 0;if(!m)throw Error(`Route ${o} is not a single ordered path from ${s} to ${a}`);let A=m.fromPortId===_?m.toPortId:m.fromPortId;d.add(m.segmentIndex),h.push(m.regionId??C3r(e,m.fromPortId,m.toPortId)),l.push(A),u=_,_=A}if(d.size!==r.length)throw Error(`Route ${o} contains disconnected solved segments`);return{orderedPortIds:l,orderedRegionIds:h}},xVt=(e,t,n,o)=>{let r=new ZQ(e,t,o);return((i,s)=>{i.state.portAssignment.fill(-1),i.state.regionSegments=Array.from({length:i.topology.regionCount},()=>[]),i.state.regionIntersectionCaches=Array.from({length:i.topology.regionCount},()=>X$()),i.state.currentRouteId=void 0,i.state.currentRouteNetId=void 0,i.state.unroutedRoutes=[],i.state.candidateQueue.clear(),i.resetCandidateBestCosts(),i.state.goalPortId=-1,i.state.ripCount=0,i.state.regionCongestionCost.fill(0);for(let a=0;a<s.length;a++)for(let[c,l,h]of s[a]??[])i.state.currentRouteNetId=i.problem.routeNet[c],i.state.regionSegments[a].push([c,l,h]),i.state.portAssignment[l]=i.state.currentRouteNetId,i.state.portAssignment[h]=i.state.currentRouteNetId,i.appendSegmentToRegionCache(a,l,h);i.state.currentRouteId=void 0,i.state.currentRouteNetId=void 0,i.solved=!0,i.failed=!1,i.error=null})(r,n),r},Usn=(e,t,n)=>{let o=new Int32Array(t.routeStartPort),r=new Int32Array(t.routeEndPort),i=Array.from({length:t.routeCount},(a,c)=>({routeId:c,fixedSegments:[]})),s=[];for(let a=0;a<t.routeCount;a++){let c=i[a],{orderedPortIds:l,orderedRegionIds:h}=Gsn(e,t,n,a),d=[],u;for(let A=0;A<l.length;A++){let g=l[A],f=t.portSectionMask[g]===1;f&&u===void 0?u=A:f||u===void 0||(d.push({startIndex:u,endIndex:A-1}),u=void 0)}if(u!==void 0&&d.push({startIndex:u,endIndex:l.length-1}),d.length===0){for(let A=1;A<l.length;A++)c.fixedSegments.push({regionId:h[A-1],fromPortId:l[A-1],toPortId:l[A]});continue}if(d.length>1)throw Error(`Route ${a} enters the section multiple times; only one contiguous section span is currently supported`);let _=d[0],p=Math.max(0,_.startIndex-1),m=Math.min(l.length-1,_.endIndex+1);if(m<=p)throw Error(`Route ${a} does not have a valid section span`);for(let A=1;A<=p;A++)c.fixedSegments.push({regionId:h[A-1],fromPortId:l[A-1],toPortId:l[A]});for(let A=m+1;A<l.length;A++)c.fixedSegments.push({regionId:h[A-1],fromPortId:l[A-1],toPortId:l[A]});c.activeStartPortId=l[p],c.activeEndPortId=l[m],c.forcedStartRegionId=h[p],o[a]=c.activeStartPortId,r[a]=c.activeEndPortId,s.push(a)}return{sectionProblem:{routeCount:t.routeCount,portSectionMask:new Int8Array(t.portSectionMask),routeMetadata:t.routeMetadata,routeStartPort:o,routeEndPort:r,routeNet:new Int32Array(t.routeNet),regionNetId:new Int32Array(t.regionNetId),portPenalty:t.portPenalty===void 0?void 0:new Float64Array(t.portPenalty)},routePlans:i,activeRouteIds:s}},b3r=(e,t,n)=>Usn(e,t,n).activeRouteIds,I3r=class extends ZQ{constructor(e,t,n,o,r,i,s,a){super(e,t,a),this.routePlans=n,this.activeRouteIds=o,this.mutableRegionIds=r,this.immutableRegionSummary=i,this.baselineSummary=s,Osn(this,a),this.state.unroutedRoutes=[...o],this.applyFixedSegments(),this.fixedSnapshot=C$e({portAssignment:this.state.portAssignment,regionSegments:this.state.regionSegments,regionIntersectionCaches:this.state.regionIntersectionCaches})}routePlans;activeRouteIds;mutableRegionIds;immutableRegionSummary;baselineSummary;bestSnapshot;fixedSnapshot;bestSummary;baselineBeatRipCount;previousBestMaxRegionCost=Number.POSITIVE_INFINITY;ripsSinceBestMaxRegionCostImprovement=0;MAX_RIPS=Number.POSITIVE_INFINITY;MAX_RIPS_WITHOUT_MAX_REGION_COST_IMPROVEMENT=Number.POSITIVE_INFINITY;EXTRA_RIPS_AFTER_BEATING_BASELINE_MAX_REGION_COST=Number.POSITIVE_INFINITY;applyFixedSegments(){for(let e of this.routePlans)for(let{regionId:t,fromPortId:n,toPortId:o}of e.fixedSegments)this.state.currentRouteNetId=this.problem.routeNet[e.routeId],this.state.regionSegments[t].push([e.routeId,n,o]),this.state.portAssignment[n]=this.state.currentRouteNetId,this.state.portAssignment[o]=this.state.currentRouteNetId,this.appendSegmentToRegionCache(t,n,o);this.state.currentRouteId=void 0,this.state.currentRouteNetId=void 0}captureBestState(e){this.bestSummary&&Ysn(e,this.bestSummary)>=0||(this.bestSummary=e,this.bestSnapshot=C$e({portAssignment:this.state.portAssignment,regionSegments:this.state.regionSegments,regionIntersectionCaches:this.state.regionIntersectionCaches}))}restoreBestState(){this.bestSnapshot&&(JXe(this,this.bestSnapshot),this.state.currentRouteId=void 0,this.state.currentRouteNetId=void 0,this.state.unroutedRoutes=[],this.state.candidateQueue.clear(),this.resetCandidateBestCosts(),this.state.goalPortId=-1)}getStartingNextRegionId(e,t){let n=this.routePlans[e]?.forcedStartRegionId;return n!==void 0?n:super.getStartingNextRegionId(e,t)}resetRoutingStateForRerip(){if(!this.fixedSnapshot)return super.resetRoutingStateForRerip(),this.state.unroutedRoutes=OCe([...this.activeRouteIds],this.state.ripCount),void this.applyFixedSegments();JXe(this,this.fixedSnapshot),this.state.currentRouteId=void 0,this.state.currentRouteNetId=void 0,this.state.unroutedRoutes=OCe([...this.activeRouteIds],this.state.ripCount),this.state.candidateQueue.clear(),this.resetCandidateBestCosts(),this.state.goalPortId=-1}onAllRoutesRouted(){let{state:e}=this,t=Math.min(this.MAX_RIPS,this.RIP_THRESHOLD_RAMP_ATTEMPTS),n=t<=0?1:Math.min(1,e.ripCount/t),o=this.RIP_THRESHOLD_START+(this.RIP_THRESHOLD_END-this.RIP_THRESHOLD_START)*n,r=[],i=new Float64Array(this.mutableRegionIds.length),s=0,a=0;for(let d=0;d<this.mutableRegionIds.length;d++){let u=this.mutableRegionIds[d],_=e.regionIntersectionCaches[u]?.existingRegionCost??0;i[d]=_,s=Math.max(s,_),a+=_,_>o&&r.push(u)}let c=Math.max(this.immutableRegionSummary.maxRegionCost,s),l=this.immutableRegionSummary.totalRegionCost+a;this.captureBestState({maxRegionCost:c,totalRegionCost:l});let h=this.bestSummary??{maxRegionCost:c,totalRegionCost:l};if(h.maxRegionCost<this.previousBestMaxRegionCost-Number.EPSILON?(this.previousBestMaxRegionCost=h.maxRegionCost,this.ripsSinceBestMaxRegionCostImprovement=0):this.ripsSinceBestMaxRegionCostImprovement+=1,this.baselineBeatRipCount===void 0&&h.maxRegionCost<this.baselineSummary.maxRegionCost-Number.EPSILON&&(this.baselineBeatRipCount=e.ripCount),this.stats={...this.stats,activeRouteCount:this.activeRouteIds.length,currentRipThreshold:o,hotRegionCount:r.length,maxRegionCost:c,totalRegionCost:l,bestMaxRegionCost:h.maxRegionCost,bestTotalRegionCost:h.totalRegionCost,ripCount:e.ripCount},r.length===0||e.ripCount>=t||this.ripsSinceBestMaxRegionCostImprovement>=this.MAX_RIPS_WITHOUT_MAX_REGION_COST_IMPROVEMENT||this.baselineBeatRipCount!==void 0&&e.ripCount-this.baselineBeatRipCount>=this.EXTRA_RIPS_AFTER_BEATING_BASELINE_MAX_REGION_COST)return this.restoreBestState(),void(this.solved=!0);for(let d=0;d<this.mutableRegionIds.length;d++){let u=this.mutableRegionIds[d];e.regionCongestionCost[u]+=i[d]*this.RIP_CONGESTION_REGION_COST_FACTOR}e.ripCount+=1,this.resetRoutingStateForRerip(),this.stats={...this.stats,ripCount:e.ripCount,reripRegionCount:r.length}}onOutOfCandidates(){let{state:e}=this;for(let t of this.mutableRegionIds){let n=e.regionIntersectionCaches[t]?.existingRegionCost??0;e.regionCongestionCost[t]+=n*this.RIP_CONGESTION_REGION_COST_FACTOR}e.ripCount+=1,this.resetRoutingStateForRerip(),this.stats={...this.stats,ripCount:e.ripCount,reripReason:"out_of_candidates"}}tryFinalAcceptance(){if(this.bestSnapshot)return this.restoreBestState(),void(this.solved=!0);this.fixedSnapshot&&JXe(this,this.fixedSnapshot),this.state.currentRouteId=void 0,this.state.currentRouteNetId=void 0,this.state.unroutedRoutes=[...this.activeRouteIds],this.state.candidateQueue.clear(),this.resetCandidateBestCosts(),this.state.goalPortId=-1,this.stats={...this.stats,acceptedFixedSectionStateOnTimeout:!0},this.solved=!0}visualize(){return YCe(this,{highlightSectionMask:!0,showInitialRouteHints:!1,showOnlySectionPortsOnIdle:!0})}},Ale=class extends Da{constructor(e,t,n,o){super(),this.topology=e,this.problem=t,this.initialSolution=n,Osn(this,o),this.baselineSolver=((r,i,s,a)=>{let c=Array.from({length:r.regionCount},()=>[]);for(let l=0;l<i.routeCount;l++){let{orderedPortIds:h,orderedRegionIds:d}=Gsn(r,i,s,l);for(let u=1;u<h.length;u++){let _=h[u-1],p=h[u];c[d[u-1]].push([l,_,p])}}return xVt(r,i,c,a)})(e,t,n,$3e(this)),this.baselineSummary=yVt(this.baselineSolver.state.regionIntersectionCaches),this.sectionRegionIds=((r,i)=>{let s=new Set;for(let a=0;a<i.portSectionMask.length;a++)if(i.portSectionMask[a]===1)for(let c of r.incidentPortRegion[a]??[])s.add(c);return[...s]})(e,t),this.sectionBaselineSummary=((r,i)=>{let s=0,a=0;for(let c of i){let l=r[c]?.existingRegionCost??0;s=Math.max(s,l),a+=l}return{maxRegionCost:s,totalRegionCost:a}})(this.baselineSolver.state.regionIntersectionCaches,this.sectionRegionIds),this.outsideSectionBaselineSummary=((r,i)=>{let s=new Set(i),a=0,c=0;for(let l=0;l<r.length;l++){if(s.has(l))continue;let h=r[l]?.existingRegionCost??0;a=Math.max(a,h),c+=h}return{maxRegionCost:a,totalRegionCost:c}})(this.baselineSolver.state.regionIntersectionCaches,this.sectionRegionIds),this.applySectionRipPolicy()}topology;problem;initialSolution;baselineSolver;baselineSummary;sectionBaselineSummary;outsideSectionBaselineSummary;sectionRegionIds;optimizedSolver;sectionSolver;activeRouteIds=[];DISTANCE_TO_COST=0.05;minViaPadDiameter=bsn;VERBOSE=!1;RIP_THRESHOLD_START=0.05;RIP_THRESHOLD_END=0.8;RIP_THRESHOLD_RAMP_ATTEMPTS=50;MAX_RIPS=Number.POSITIVE_INFINITY;MAX_RIPS_WITHOUT_MAX_REGION_COST_IMPROVEMENT=10;EXTRA_RIPS_AFTER_BEATING_BASELINE_MAX_REGION_COST=10;RIP_CONGESTION_REGION_COST_FACTOR=0.1;MAX_ITERATIONS=1e6;STATIC_REACHABILITY_PRECHECK=!1;STATIC_REACHABILITY_PRECHECK_MAX_HOPS=16;ACCEPT_BEST_SOLUTION_ON_TIMEOUT=!0;GREEDY_FINAL_ROUTE_ITERS=4;applySectionRipPolicy(){this.RIP_THRESHOLD_START=0.05,this.RIP_THRESHOLD_END=Math.max(this.RIP_THRESHOLD_START,this.sectionBaselineSummary.maxRegionCost),this.MAX_RIPS=Math.min(this.MAX_RIPS,20)}_setup(){this.applySectionRipPolicy();let{sectionProblem:e,routePlans:t,activeRouteIds:n}=Usn(this.topology,this.problem,this.initialSolution);if(this.activeRouteIds=n,n.length===0)return this.optimizedSolver=this.baselineSolver,this.stats={...this.stats,activeRouteCount:0,initialMaxRegionCost:this.baselineSummary.maxRegionCost,finalMaxRegionCost:this.baselineSummary.maxRegionCost,optimized:!1},void(this.solved=!0);var o;this.sectionSolver=new I3r(this.topology,e,t,n,this.sectionRegionIds,this.outsideSectionBaselineSummary,this.baselineSummary,{...$3e(o=this),MAX_RIPS:o.MAX_RIPS,MAX_RIPS_WITHOUT_MAX_REGION_COST_IMPROVEMENT:o.MAX_RIPS_WITHOUT_MAX_REGION_COST_IMPROVEMENT,EXTRA_RIPS_AFTER_BEATING_BASELINE_MAX_REGION_COST:o.EXTRA_RIPS_AFTER_BEATING_BASELINE_MAX_REGION_COST}),this.activeSubSolver=this.sectionSolver,this.stats={...this.stats,sectionBaselineMaxRegionCost:this.sectionBaselineSummary.maxRegionCost,sectionBaselineTotalRegionCost:this.sectionBaselineSummary.totalRegionCost,effectiveRipThresholdStart:this.RIP_THRESHOLD_START,effectiveRipThresholdEnd:this.RIP_THRESHOLD_END,effectiveMaxRips:this.MAX_RIPS}}_step(){if(!this.sectionSolver)return void(this.solved=!0);if(this.sectionSolver.step(),this.stats={...this.stats,...this.sectionSolver.stats,activeRouteCount:this.activeRouteIds.length},this.sectionSolver.failed)return this.optimizedSolver=this.baselineSolver,this.stats={...this.stats,initialMaxRegionCost:this.baselineSummary.maxRegionCost,initialTotalRegionCost:this.baselineSummary.totalRegionCost,finalMaxRegionCost:this.baselineSummary.maxRegionCost,finalTotalRegionCost:this.baselineSummary.totalRegionCost,optimized:!1,sectionSearchFailedFallbackToBaseline:!0,sectionSearchError:this.sectionSolver.error},void(this.solved=!0);if(!this.sectionSolver.solved)return;let e=xVt(this.topology,this.problem,Vsn(this.sectionSolver.state.regionSegments),$3e(this)),t=yVt(e.state.regionIntersectionCaches),n=Ysn(t,this.baselineSummary)<0;this.optimizedSolver=n?e:this.baselineSolver;let o=n?t:this.baselineSummary;this.stats={...this.stats,initialMaxRegionCost:this.baselineSummary.maxRegionCost,initialTotalRegionCost:this.baselineSummary.totalRegionCost,candidateMaxRegionCost:t.maxRegionCost,candidateTotalRegionCost:t.totalRegionCost,finalMaxRegionCost:o.maxRegionCost,finalTotalRegionCost:o.totalRegionCost,optimized:n},this.solved=!0}tryFinalAcceptance(){this.optimizedSolver=this.baselineSolver,this.stats={...this.stats,initialMaxRegionCost:this.baselineSummary.maxRegionCost,initialTotalRegionCost:this.baselineSummary.totalRegionCost,finalMaxRegionCost:this.baselineSummary.maxRegionCost,finalTotalRegionCost:this.baselineSummary.totalRegionCost,optimized:!1,sectionSolverTimeoutFallbackToBaseline:!0},this.solved=!0,this.failed=!1,this.error=null}getSolvedSolver(){if(!this.solved||this.failed||!this.optimizedSolver)throw Error("TinyHyperGraphSectionSolver does not have a solved output yet");return this.optimizedSolver}visualize(){return this.optimizedSolver?YCe(this.optimizedSolver,{highlightSectionMask:!0}):this.sectionSolver?this.sectionSolver.visualize():YCe(this.baselineSolver,{highlightSectionMask:!0,showInitialRouteHints:!1,showOnlySectionPortsOnIdle:!0})}getOutput(){return this.getSolvedSolver().getOutput()}},v3r=["self-touch","onehop-all","onehop-touch","twohop-all","twohop-touch"],S3r={"self-all":0,"self-touch":0,"onehop-all":1,"onehop-touch":1,"twohop-all":2,"twohop-touch":2,"threehop-all":3,"threehop-touch":3,"fourhop-all":4,"fourhop-touch":4},P3r=(e,t)=>{let n=new Set(t);for(let o of t)for(let r of e.regionIncidentPorts[o]??[])for(let i of e.incidentPortRegion[r]??[])n.add(i);return[...n]},E3r=(e,t,n)=>{let o=[...new Set(t)];for(let r=0;r<n;r+=1)o=P3r(e,o);return o},M3r=(e,t,n)=>t.flatMap((o)=>n.map((r)=>((i,s,a)=>({label:`hot-${s}-${a}`,family:a,regionIds:E3r(i,[s],S3r[a]),portSelectionRule:a.endsWith("-all")?"all-incident-regions-selected":"touches-selected-region"}))(e,o,r))),w3r={RIP_THRESHOLD_RAMP_ATTEMPTS:5},B3r={DISTANCE_TO_COST:0.05,RIP_THRESHOLD_RAMP_ATTEMPTS:16,RIP_CONGESTION_REGION_COST_FACTOR:0.1,MAX_ITERATIONS:50000,MAX_RIPS_WITHOUT_MAX_REGION_COST_IMPROVEMENT:6,EXTRA_RIPS_AFTER_BEATING_BASELINE_MAX_REGION_COST:Number.POSITIVE_INFINITY},b$e=(e)=>e.state.regionIntersectionCaches.reduce((t,n)=>Math.max(t,n.existingRegionCost),0),T3r=(e,t)=>{let n=YZe(e),o=new Ale(n.topology,n.problem,n.solution,t);return b$e(o.baselineSolver)},D3r=(e,t,n)=>{let o=new Set(t);return Int8Array.from({length:e.portCount},(r,i)=>{let s=e.incidentPortRegion[i]??[];return n==="touches-selected-region"?s.some((a)=>o.has(a))?1:0:s.length>0&&s.every((a)=>o.has(a))?1:0})},N3r=(e,t)=>({routeCount:e.routeCount,portSectionMask:t,routeMetadata:e.routeMetadata,routeStartPort:new Int32Array(e.routeStartPort),routeEndPort:new Int32Array(e.routeEndPort),routeNet:new Int32Array(e.routeNet),regionNetId:new Int32Array(e.regionNetId),portPenalty:e.portPenalty===void 0?void 0:new Float64Array(e.portPenalty)}),R3r=(e,t,n,o,r,i)=>{let s=performance.now(),a=performance.now(),c=new Ale(t,n,o,i),l=b$e(c.baselineSolver),h=performance.now()-a,d,u,_=l,p=new Int8Array(t.portCount),m=0,A=0,g=0,f=0,y=0,x=0,C=0,b=new Set,I=r?.maxHotRegions??i.MAX_HOT_REGIONS??2;for(let v of((P,M,B,T)=>{let N=P.state.regionIntersectionCaches.map((D,L)=>({regionId:L,regionCost:D.existingRegionCost})).filter(({regionCost:D})=>D>0).sort((D,L)=>L.regionCost-D.regionCost).slice(0,B).map(({regionId:D})=>D);return M3r(M,N,T)})(e,t,I,r?.candidateFamilies??[...v3r])){let P=N3r(n,D3r(t,v.regionIds,v.portSelectionRule));m+=1;let M=P.portSectionMask.join(",");if(b.has(M))g+=1;else{b.add(M);try{let B=performance.now(),T=b3r(t,P,o);if(f+=performance.now()-B,T.length===0)continue;A+=1;let N=performance.now(),D=new Ale(t,P,o,i);y+=performance.now()-N;let L=performance.now();if(D.solve(),x+=performance.now()-L,D.failed||!D.solved)continue;if(Number(D.stats.finalMaxRegionCost??b$e(D.getSolvedSolver()))<_-0.000000001){let H=performance.now(),V=T3r(D.getOutput(),i);C+=performance.now()-H,V<_-0.000000001&&(_=V,p=new Int8Array(P.portSectionMask),d=v.label,u=v.family)}}catch{}}}return{portSectionMask:p,baselineMaxRegionCost:l,finalMaxRegionCost:_,generatedCandidateCount:m,candidateCount:A,duplicateCandidateCount:g,totalMs:performance.now()-s,baselineEvaluationMs:h,candidateEligibilityMs:f,candidateInitMs:y,candidateSolveMs:x,candidateReplayScoreMs:C,winningCandidateLabel:d,winningCandidateFamily:u}},Q3r=class extends rP{initialVisualizationSolver;selectedSectionMask;selectedSectionCandidateLabel;selectedSectionCandidateFamily;constructor(e){super(e),this.MAX_ITERATIONS=200000}loadHyperGraph(e){return YZe(e)}getSolveGraphOptions(){return{...w3r,...this.inputProblem.minViaPadDiameter===void 0?{}:{minViaPadDiameter:this.inputProblem.minViaPadDiameter},...this.inputProblem.solveGraphOptions}}getSectionSolverOptions(){return{...B3r,...this.inputProblem.minViaPadDiameter===void 0?{}:{minViaPadDiameter:this.inputProblem.minViaPadDiameter},...this.inputProblem.sectionSolverOptions}}pipelineDef=[{solverName:"solveGraph",solverClass:ZQ,getConstructorParams:(e)=>{let{topology:t,problem:n}=e.loadHyperGraph(e.inputProblem.serializedHyperGraph);return[t,n,e.getSolveGraphOptions()]}},{solverName:"optimizeSection",solverClass:Ale,getConstructorParams:(e)=>e.getSectionStageParams()}];getSectionStageParams(){let e=this.getStageOutput("solveGraph");if(!e)throw Error("solveGraph did not produce a solved serialized hypergraph");let t=this.getSolver("solveGraph");if(!t)throw Error("solveGraph solver is unavailable");let n=this.getSectionSolverOptions(),{topology:o,problem:r,solution:i}=this.loadHyperGraph(e),s=this.inputProblem.createSectionMask?this.inputProblem.createSectionMask({serializedHyperGraph:this.inputProblem.serializedHyperGraph,solvedSerializedHyperGraph:e,solvedSolver:t,topology:o,problem:r,solution:i}):(()=>{let a=R3r(t,o,r,i,this.inputProblem.sectionSearchConfig,n);return this.selectedSectionCandidateLabel=a.winningCandidateLabel,this.selectedSectionCandidateFamily=a.winningCandidateFamily,this.stats={...this.stats,sectionSearchGeneratedCandidateCount:a.generatedCandidateCount,sectionSearchCandidateCount:a.candidateCount,sectionSearchDuplicateCandidateCount:a.duplicateCandidateCount,sectionSearchBaselineMaxRegionCost:a.baselineMaxRegionCost,sectionSearchFinalMaxRegionCost:a.finalMaxRegionCost,sectionSearchDelta:a.baselineMaxRegionCost-a.finalMaxRegionCost,selectedSectionCandidateLabel:a.winningCandidateLabel??null,selectedSectionCandidateFamily:a.winningCandidateFamily??null,sectionSearchMs:a.totalMs,sectionSearchBaselineEvaluationMs:a.baselineEvaluationMs,sectionSearchCandidateEligibilityMs:a.candidateEligibilityMs,sectionSearchCandidateInitMs:a.candidateInitMs,sectionSearchCandidateSolveMs:a.candidateSolveMs,sectionSearchCandidateReplayScoreMs:a.candidateReplayScoreMs},a.portSectionMask})();return this.selectedSectionMask=new Int8Array(s),r.portSectionMask=new Int8Array(s),this.stats={...this.stats,sectionMaskPortCount:[...s].filter((a)=>a===1).length},[o,r,i,n]}getInitialVisualizationSolver(){if(!this.initialVisualizationSolver){let{topology:e,problem:t}=this.loadHyperGraph(this.inputProblem.serializedHyperGraph);this.initialVisualizationSolver=new ZQ(e,t,this.getSolveGraphOptions())}return this.initialVisualizationSolver}initialVisualize(){return this.getInitialVisualizationSolver().visualize()}visualize(){return this.iterations===0?this.initialVisualize()??super.visualize():super.visualize()}getOutput(){return this.getStageOutput("optimizeSection")??this.getStageOutput("solveGraph")??null}tryFinalAcceptance(){this.getStageOutput("solveGraph")&&(this.stats={...this.stats,acceptedSolveGraphOutputOnSectionPipelineTimeout:!0},this.activeSubSolver=void 0,this.solved=!0,this.failed=!1,this.error=null)}};var Wsn=class extends n3r{costAwareFinalReripBudget=8;failedOwnerPairCounts=new Map;selectiveReripStats={selectiveRipCount:0,selectivelyRippedRouteCount:0,globalReripCount:0,alternateBlockerSearchCount:0,alternateOwnerCount:0,failedOwnerPairCount:0,maxFailedOwnerPairCount:0,failedOwnerPairs:[],lastDirectOwnerRouteIds:[],lastRepeatedOwnerRouteIds:[],lastAlternateOwnerRouteIds:[],lastRippedRouteIds:[],lastRelaxedSearchExpandedLabelCount:0,lastAlternateSearchExpandedLabelCount:0};selectiveReripCongestionUpdateCount=0;constructor(e,t,n){super(e,t,n)}getSelectiveReripStats(){return{...this.selectiveReripStats,failedOwnerPairs:this.selectiveReripStats.failedOwnerPairs.map((e)=>({...e})),lastDirectOwnerRouteIds:[...this.selectiveReripStats.lastDirectOwnerRouteIds],lastRepeatedOwnerRouteIds:[...this.selectiveReripStats.lastRepeatedOwnerRouteIds],lastAlternateOwnerRouteIds:[...this.selectiveReripStats.lastAlternateOwnerRouteIds],lastRippedRouteIds:[...this.selectiveReripStats.lastRippedRouteIds]}}createGreedyFinalRouteSolver(e,t){if(t>=0)return super.createGreedyFinalRouteSolver(e,t);let n=new k3r(this.topology,this.problem,{...e,MAX_ITERATIONS:Math.max(e.MAX_ITERATIONS??50000,2*this.MAX_ITERATIONS)});return n.remainingReripBudget=this.costAwareFinalReripBudget-this.state.ripCount,n}onOutOfCandidates(){let e=this.state.currentRouteId;if(e===void 0)throw Error("SelectiveReripTinyHyperGraphSolver: candidate search exhausted without a current route");let t=this.findRelaxedBlockerPathPreferringPreservedRoutes();if(!t.found||t.owners.size===0)return this.selectiveReripStats.globalReripCount+=1,this.selectiveReripStats.globalReripReason=t.found?"no_blocker_path":t.reason,this.selectiveReripStats.lastFailedRouteId=e,this.selectiveReripStats.lastDirectOwnerRouteIds=[],this.selectiveReripStats.lastRepeatedOwnerRouteIds=[],this.selectiveReripStats.lastAlternateOwnerRouteIds=[],this.selectiveReripStats.lastRippedRouteIds=[],this.selectiveReripStats.lastRelaxedSearchExpandedLabelCount=t.expandedLabelCount,this.selectiveReripStats.lastAlternateSearchExpandedLabelCount=0,super.onOutOfCandidates(),void this.publishSelectiveReripStats();let n=[...t.owners],o=[];for(let c of n)this.incrementFailedOwnerPair(e,c)>=2&&o.push(c);if(n.some((c)=>this.hasFailedOwnerPath(c,e)))return this.selectiveReripStats.globalReripCount+=1,this.selectiveReripStats.globalReripReason="failed_owner_cycle",this.selectiveReripStats.lastFailedRouteId=e,this.selectiveReripStats.lastDirectOwnerRouteIds=n,this.selectiveReripStats.lastRepeatedOwnerRouteIds=o,this.selectiveReripStats.lastAlternateOwnerRouteIds=[],this.selectiveReripStats.lastRippedRouteIds=[],this.selectiveReripStats.lastRelaxedSearchExpandedLabelCount=t.expandedLabelCount,this.selectiveReripStats.lastAlternateSearchExpandedLabelCount=0,this.failedOwnerPairCounts.clear(),super.onOutOfCandidates(),void this.publishSelectiveReripStats();let r;if(o.length>0&&(this.selectiveReripStats.alternateBlockerSearchCount+=1,r=this.findRelaxedBlockerPathPreferringPreservedRoutes(new Set(o)),!r.found))return this.selectiveReripStats.globalReripCount+=1,this.selectiveReripStats.globalReripReason=r.reason,this.selectiveReripStats.lastFailedRouteId=e,this.selectiveReripStats.lastDirectOwnerRouteIds=n,this.selectiveReripStats.lastRepeatedOwnerRouteIds=o,this.selectiveReripStats.lastAlternateOwnerRouteIds=[],this.selectiveReripStats.lastRippedRouteIds=[],this.selectiveReripStats.lastRelaxedSearchExpandedLabelCount=t.expandedLabelCount,this.selectiveReripStats.lastAlternateSearchExpandedLabelCount=r.expandedLabelCount,super.onOutOfCandidates(),void this.publishSelectiveReripStats();let i=r?.found?[...r.owners]:void 0,s=function(c){let l=new Set(c.alternateOwnerRouteIds??c.directOwnerRouteIds);if(l.delete(c.failedRouteId),l.size===0)throw Error(`SelectiveReripTinyHyperGraphSolver: route ${c.failedRouteId} has blocker resources but no distinct committed owner can be reripped`);return l}({failedRouteId:e,directOwnerRouteIds:n,alternateOwnerRouteIds:i});this.clearPartialRipPlans(s);let a=(i??[]).filter((c)=>!t.owners.has(c));this.selectiveReripCongestionUpdateCount<1&&(this.addCongestionCostForSelectiveRerip(),this.selectiveReripCongestionUpdateCount+=1),this.rebuildCommittedState(s),this.state.ripCount+=1,this.state.currentRouteId=void 0,this.state.currentRouteNetId=void 0,this.state.unroutedRoutes=function(c){let l=c.pendingRouteIds.filter((d)=>d!==c.failedRouteId&&!c.rippedRouteIds.has(d)),h=[...c.rippedRouteIds].filter((d)=>d!==c.failedRouteId);return[c.failedRouteId,...l,...h]}({failedRouteId:e,pendingRouteIds:this.state.unroutedRoutes,rippedRouteIds:s}),this.state.candidateQueue.clear(),this.resetCandidateBestCosts(),this.state.goalPortId=-1,this.selectiveReripStats.selectiveRipCount+=1,this.selectiveReripStats.selectivelyRippedRouteCount+=s.size,this.selectiveReripStats.alternateOwnerCount+=a.length,this.selectiveReripStats.lastFailedRouteId=e,this.selectiveReripStats.lastDirectOwnerRouteIds=n,this.selectiveReripStats.lastRepeatedOwnerRouteIds=o,this.selectiveReripStats.lastAlternateOwnerRouteIds=a,this.selectiveReripStats.lastRippedRouteIds=[...s],this.selectiveReripStats.lastRelaxedSearchExpandedLabelCount=t.expandedLabelCount,this.selectiveReripStats.lastAlternateSearchExpandedLabelCount=r?.expandedLabelCount??0,this.publishSelectiveReripStats()}addCongestionCostForSelectiveRerip(){for(let e=0;e<this.topology.regionCount;e++){let t=this.state.regionIntersectionCaches[e]?.existingRegionCost??0;this.state.regionCongestionCost[e]+=t*this.RIP_CONGESTION_REGION_COST_FACTOR}}findRelaxedBlockerPath(e=new Set){let t=this.state.currentRouteId,n=this.state.currentRouteNetId;if(t===void 0||n===void 0)throw Error("SelectiveReripTinyHyperGraphSolver: blocker search requires a current route and net");let o=this.getRouteStartPortId(t),r=this.getRouteEndPortId(t),i=this.getStartingNextRegionId(t,o);if(i===void 0)throw Error(`SelectiveReripTinyHyperGraphSolver: route ${this.describeRoute(t)} has no starting region for blocker search`);let s=this.getPortOwners(),a=new Map,c=new Map,l=new Map;return y3r({start:{portId:o,nextRegionId:i},getStateKey:({portId:h,nextRegionId:d})=>this.getHopId(h,d),isGoal:({portId:h})=>h===r,getHops:(h)=>{let d=this.getHopId(h.portId,h.nextRegionId),u=l.get(d);if(u)return u;let _=this.getRelaxedSearchHops({state:h,goalPortId:r,routeNetId:n,portOwners:s,portResources:a,hopTemplatesByRegion:c,forbiddenOwnerRouteIds:e});return l.set(d,_),_},maxExpandedLabels:this.getRelaxedSearchExpansionLimit(),checkReachability:!0})}findRelaxedBlockerPathPreferringPreservedRoutes(e=new Set){let t=this.getRouteIdsPreferredForPreservation();if(t.size===0)return this.findRelaxedBlockerPath(e);let n=new Set(e);for(let r of t)n.add(r);let o=this.findRelaxedBlockerPath(n);return o.found&&o.owners.size>0?o:this.findRelaxedBlockerPath(e)}getRelaxedSearchExpansionLimit(){let e=0;for(let n of this.topology.incidentPortRegion)e+=n.length;let t=Math.max(4,Math.ceil(Math.log2(this.problem.routeCount+1)));return Math.max(4096,e*t*4)}getRelaxedSearchHops(e){let{state:t,goalPortId:n,routeNetId:o}=e;if(this.isRegionReservedForDifferentNet(t.nextRegionId))return[];if(!e.buildRegionTemplates&&!this.isKnownSingleLayerRegion(t.nextRegionId)){let i=e.hopTemplatesByRegion.get(t.nextRegionId);i||(i=this.getRelaxedSearchHops({...e,buildRegionTemplates:!0}),e.hopTemplatesByRegion.set(t.nextRegionId,i));let s=[];for(let a of i)a.state.portId!==t.portId&&s.push({state:a.state,owners:a.owners,data:a.data,distance:Math.hypot(this.topology.portX[t.portId]-this.topology.portX[a.state.portId],this.topology.portY[t.portId]-this.topology.portY[a.state.portId])});return s}let r=[];for(let i of this.topology.regionIncidentPorts[t.nextRegionId]??[]){if(i===t.portId&&!e.buildRegionTemplates)continue;if(this.isPortReservedForDifferentNet(i))continue;if(i!==n&&this.problem.portSectionMask[i]===0)continue;let s=this.getHopBlockerResources({regionId:t.nextRegionId,fromPortId:t.portId,toPortId:i,routeNetId:o,portOwners:e.portOwners,portResources:e.portResources}),a=[];for(let l of s)for(let h of l.owners)a.includes(h)||a.push(h);if(a.some((l)=>e.forbiddenOwnerRouteIds.has(l)))continue;let c=t.nextRegionId;if(i!==n){let[l,h]=this.topology.incidentPortRegion[i]??[];if(c=l===t.nextRegionId?h:l,c===void 0||this.isRegionReservedForDifferentNet(c))continue}r.push({state:{portId:i,nextRegionId:c},distance:Math.hypot(this.topology.portX[t.portId]-this.topology.portX[i],this.topology.portY[t.portId]-this.topology.portY[i]),owners:a,data:{resources:s}})}return r}getHopBlockerResources(e){let t=[],n=this.state.portAssignment[e.toPortId];if(n!==-1&&n!==e.routeNetId){let r=e.portResources.get(e.toPortId);if(!r){let i=[...e.portOwners.get(e.toPortId)??new Set].filter((s)=>this.problem.routeNet[s]!==e.routeNetId);if(i.length===0)throw Error(`SelectiveReripTinyHyperGraphSolver: port ${e.toPortId} is assigned to foreign net ${n} without a committed route owner`);r={kind:"port",portId:e.toPortId,owners:i},e.portResources.set(e.toPortId,r)}t.push(r)}let o=this.getHardBlockedCrossingOwners(e.regionId,e.fromPortId,e.toPortId);return o.length>0&&t.push({kind:"same_layer_intersection",regionId:e.regionId,fromPortId:e.fromPortId,toPortId:e.toPortId,owners:o}),t}getPortOwners(){let e=new Map;for(let t of this.state.regionSegments)for(let[n,o,r]of t)for(let i of[o,r]){let s=e.get(i)??new Set;s.add(n),e.set(i,s)}return e}getHardBlockedCrossingOwners(e,t,n){if(!this.isKnownSingleLayerRegion(e))return[];let o=this.state.currentRouteNetId;if(o===void 0)throw Error("SelectiveReripTinyHyperGraphSolver: crossing ownership requires a current route net");let r=new Set;for(let[i,s,a]of this.state.regionSegments[e]??[])this.problem.routeNet[i]!==o&&this.segmentsCrossOnSameLayer(e,t,n,s,a)&&r.add(i);return[...r]}segmentsCrossOnSameLayer(e,t,n,o,r){let i=this.populateSegmentGeometryScratch(e,t,n),{lesserAngle:s,greaterAngle:a,layerMask:c}=i,l=this.populateSegmentGeometryScratch(e,o,r);if((c&l.layerMask)===0)return!1;if(s===l.lesserAngle||s===l.greaterAngle||a===l.lesserAngle||a===l.greaterAngle)return!1;return(s<l.lesserAngle&&l.lesserAngle<a)!==(s<l.greaterAngle&&l.greaterAngle<a)}rebuildCommittedState(e){this.state.regionSegments=this.state.regionSegments.map((t)=>t.filter(([n])=>!e.has(n))),this.state.portAssignment.fill(-1),this.state.regionIntersectionCaches=Array.from({length:this.topology.regionCount},()=>X$());for(let t=0;t<this.state.regionSegments.length;t++)for(let[n,o,r]of this.state.regionSegments[t]){let i=this.problem.routeNet[n];this.state.currentRouteNetId=i;for(let s of[o,r]){let a=this.state.portAssignment[s];if(a!==-1&&a!==i)throw Error(`SelectiveReripTinyHyperGraphSolver: rebuilding committed routes found cross-net ownership at port ${s} between net ${a} and net ${i}`);this.state.portAssignment[s]=i}this.appendSegmentToRegionCache(t,o,r)}this.state.currentRouteNetId=void 0}incrementFailedOwnerPair(e,t){let n=this.failedOwnerPairCounts.get(e)??new Map,o=(n.get(t)??0)+1;return n.set(t,o),this.failedOwnerPairCounts.set(e,n),o}hasFailedOwnerPath(e,t){let n=[e],o=new Set;for(;n.length>0;){let r=n.pop();if(r===t)return!0;o.has(r)||(o.add(r),n.push(...this.failedOwnerPairCounts.get(r)?.keys()??[]))}return!1}publishSelectiveReripStats(){let e=[];for(let[t,n]of this.failedOwnerPairCounts)for(let[o,r]of n)e.push({failedRouteId:t,ownerRouteId:o,count:r});e.sort((t,n)=>t.failedRouteId-n.failedRouteId||t.ownerRouteId-n.ownerRouteId),this.selectiveReripStats.failedOwnerPairs=e,this.selectiveReripStats.failedOwnerPairCount=e.length,this.selectiveReripStats.maxFailedOwnerPairCount=Math.max(0,...e.map(({count:t})=>t)),this.stats={...this.stats,...this.getSelectiveReripStats()}}describeRoute(e){let t=this.problem.routeMetadata?.[e]?.connectionId;return t===void 0?String(e):`${e} (${String(t)})`}},k3r=class extends Wsn{remainingReripBudget=0;onOutOfCandidates(){super.onOutOfCandidates(),this.state.ripCount>=this.remainingReripBudget&&(this.failed=!0,this.error="Congestion-aware final routing exhausted its rerip budget")}};new Int32Array(0);var CVt=class extends Wsn{initialAssignmentRouteIds;getRouteIdsPreferredForPreservation(){return this.initialAssignmentRouteIds||(this.initialAssignmentRouteIds=new Set((this.problem.initialAssignments??[]).map((e)=>e.routeId))),this.initialAssignmentRouteIds}resetRoutingStateForRerip(){super.resetRoutingStateForRerip(),this.problem.initialAssignments?.length&&f$e({topology:this.topology,problem:this.problem,state:this.state,routeSuccessCountByRouteId:this.routeSuccessCountByRouteId,appendSegmentToRegionCache:(e,t,n)=>this.appendSegmentToRegionCache(e,t,n)})}},QQ=(e)=>{if(typeof e!="object"||e===null)return!1;let t=e,n=t.preloadedTraceSection;return typeof t.connectionId=="string"&&typeof n?.traceId=="string"&&typeof n.startRoutePosition=="number"&&typeof n.endRoutePosition=="number"&&typeof n.startPoint?.x=="number"&&typeof n.startPoint.y=="number"&&typeof n.startPoint.z=="number"&&typeof n.endPoint?.x=="number"&&typeof n.endPoint.y=="number"&&typeof n.endPoint.z=="number"},L3r=(e,t)=>`__tscircuit_preloaded_trace__:${JSON.stringify([e,t])}`,I$e=(e)=>[e.region1Id,e.region2Id],bVt=(e,t)=>{let n=new Set(I$e(t));return I$e(e).filter((o)=>n.has(o))},H3r=(e,t,n)=>{let o=e[t],r=e[t+1],i=bVt(o.port,r.port);if(i.length===0)return;if(i.length===1)return i[0];let s=e[t+2];if(s){let a=new Set(bVt(r.port,s.port)),c=i.find((l)=>a.has(l));if(c)return c}return n&&i.includes(n)?n:[...i].sort()[0]},IVt=(e,t)=>I$e(e).find((n)=>n!==t)??t,Xsn=(e)=>{let t=new Set((e.connections??[]).filter(QQ).map((r)=>r.connectionId)),n=e.ports.filter((r)=>(r.d?._preloadedTracePortAssignments?.length??0)>0).length,o=e.regions.reduce((r,i)=>r+(i.assignments??[]).filter((s)=>t.has(s.connectionId)).length,0);return{preloadedTraceCount:t.size,preloadedPortCount:n,preloadedAssignmentCount:o}},vVt=(e)=>typeof e=="object"&&e!==null?e:{},ZXe=(e)=>typeof e=="object"&&e!==null?e:{},m3e=0.000001,v$e={DISTANCE_TO_COST:0.05,RIP_THRESHOLD_START:0.05,RIP_THRESHOLD_END:0.8,RIP_CONGESTION_REGION_COST_FACTOR:0.1,ACCEPT_BEST_SOLUTION_ON_TIMEOUT:!0,GREEDY_FINAL_ROUTE_ITERS:4,PARTIAL_RIP_MIN_ROUTE_COUNT:100,PARTIAL_RIP_MAX_ROUTE_COUNT:350,PARTIAL_RIP_MAX_ATTEMPTS:7,PARTIAL_RIP_WARMUP_FULL_RIP_ATTEMPTS:1,PARTIAL_RIP_COMPLEXITY_SELECTION_MIN_ROUTE_COUNT:100,PARTIAL_RIP_TARGET_MAX_COST_IMPROVEMENT_RATIO:0.02,PARTIAL_RIP_MAX_REGION_COST_GROWTH_RATIO:0.05,PARTIAL_RIP_MAX_TOTAL_COST_GROWTH_RATIO:0.1},F3r={DISTANCE_TO_COST:0.05,RIP_THRESHOLD_START:0.05,RIP_THRESHOLD_END:0.8,RIP_CONGESTION_REGION_COST_FACTOR:0.1,ACCEPT_BEST_SOLUTION_ON_TIMEOUT:!0,GREEDY_FINAL_ROUTE_ITERS:4,MAX_RIPS_WITHOUT_MAX_REGION_COST_IMPROVEMENT:6,EXTRA_RIPS_AFTER_BEATING_BASELINE_MAX_REGION_COST:Number.POSITIVE_INFINITY},GZe=(e)=>Math.max(e,0.01),UZe=(e)=>Number.isFinite(e)?{minViaPadDiameter:e}:{},z3r=(e,t)=>{let n=GZe(e);return{...v$e,...UZe(t),OWNED_REGIONAL_HOP_FRONTIER:!0,USE_SPARSE_CANDIDATE_STORAGE:!1,RIP_THRESHOLD_RAMP_ATTEMPTS:Math.ceil(10*n),MAX_ITERATIONS:Math.ceil(2000000*n)}},O3r=(e,t)=>{let n=GZe(e);return{...F3r,...UZe(t),USE_SPARSE_CANDIDATE_STORAGE:!1,RIP_THRESHOLD_RAMP_ATTEMPTS:Math.ceil(16*n),MAX_ITERATIONS:Math.ceil(1e6*n)}},jsn=(e)=>(e.solveGraphOptions?.MAX_ITERATIONS??1e6)+(e.sectionSolverOptions?.MAX_ITERATIONS??1e6)+1e6,V3r=(e)=>e.mutuallyConnectedNetworkId,S$e=(e,t)=>e.simpleRouteConnection?.pointsToConnect[t],SVt=(e)=>{let t=S$e(e.routeMetadata,e.endpointIndex);if(!t)return e.fallbackZ;let n=E5(t).map((o)=>si(o,e.layerCount));return e.regionAvailableZ.find((o)=>n.includes(o))??e.fallbackZ},Y3r=(e,t)=>{let n=e.d,o=n.bounds;return{capacityMeshNodeId:e.d.capacityMeshNodeId,center:{x:e.d.center.x,y:e.d.center.y},width:e.d.width,height:e.d.height,availableZ:[...e.d.availableZ],...o?{bounds:{minX:o.minX,maxX:o.maxX,minY:o.minY,maxY:o.maxY}}:{},_containsObstacle:e.d._containsObstacle,_containsTarget:e.d._containsTarget,_offBoardConnectionId:e.d._offBoardConnectionId,_offBoardConnectedCapacityMeshNodeIds:e.d._offBoardConnectedCapacityMeshNodeIds===void 0?void 0:[...e.d._offBoardConnectedCapacityMeshNodeIds],_qfpRegionType:n._qfpRegionType,_isNarrowQfpPadGap:n._isNarrowQfpPadGap,...t!==void 0?{netId:t}:{}}},G3r=(e)=>{let t=e.d;return{portId:e.d.portId,x:e.d.x,y:e.d.y,z:e.d.z,prevPortPointId:t.prevPortPointId,nextPortPointId:t.nextPortPointId,distToCentermostPortOnZ:e.d.distToCentermostPortOnZ,tinyHypergraphPortPenalty:e.d.tinyHypergraphPortPenalty,cramped:e.d.cramped,_preloadedFixedNetIds:e.d._preloadedFixedNetIds,_preloadedTracePortAssignments:e.d._preloadedTracePortAssignments}},U3r=(e)=>{let t=function(){let l=new Map;return(h)=>{let d=h.mutuallyConnectedNetworkId,u=l.get(d);return u===void 0&&(u=l.size,l.set(d,u)),u}}(),n=function(l){let h=new Map,d=new Set,u=new Map;for(let p of l.params.connections){let m=p.mutuallyConnectedNetworkId,A=l.getNetIndex({connectionId:p.connectionId,mutuallyConnectedNetworkId:m});for(let g of[p.connectionId,m])u.set(g,A);for(let g of p.simpleRouteConnection.pointsToConnect){let f=FZe({point:g,layerCount:l.params.layerCount});for(let y of l.params.graph.regions){if(!ssn({point:g,region:y,layerCount:l.params.layerCount,pointZLayers:f}))continue;if(g.pcb_port_id===void 0&&y.d._containsTarget!==!0){d.add(y.regionId);continue}let x=h.get(y.regionId);x||(x=new Set,h.set(y.regionId,x)),x.add(A)}}}for(let p of l.params.graph.regions)for(let m of p.d._connectedTo??[]){let A=u.get(m);if(A===void 0)continue;let g=h.get(p.regionId);g||(g=new Set,h.set(p.regionId,g)),g.add(A)}let _=new Map;for(let p of d)_.set(p,-1);for(let[p,m]of h)m.size===1&&_.set(p,[...m][0]);return _}({params:e,getNetIndex:t}),o=e.graph.regions.map((l)=>({regionId:l.regionId,pointIds:l.ports.map((h)=>h.d.portId),d:Y3r(l,n.get(l.regionId))})),r=new Map;for(let l of o)r.has(l.regionId)||r.set(l.regionId,l);let i=e.graph.ports.map((l)=>({portId:l.d.portId,region1Id:l.region1.regionId,region2Id:l.region2.regionId,d:G3r(l)})),s=e.connections.map((l)=>({connectionId:l.connectionId,mutuallyConnectedNetworkId:l.mutuallyConnectedNetworkId,startRegionId:l.startRegion.regionId,endRegionId:l.endRegion.regionId,simpleRouteConnection:l.simpleRouteConnection})),a=[];for(let l of e.connections){let h={connectionId:l.connectionId,mutuallyConnectedNetworkId:l.mutuallyConnectedNetworkId,simpleRouteConnection:l.simpleRouteConnection},d=t(h),u=S$e(h,0),_=S$e(h,1),p=l.startRegion.d.availableZ[0]??0,m=l.endRegion.d.availableZ[0]??0,A=SVt({routeMetadata:h,endpointIndex:0,fallbackZ:p,regionAvailableZ:l.startRegion.d.availableZ,layerCount:e.layerCount}),g=SVt({routeMetadata:h,endpointIndex:1,fallbackZ:m,regionAvailableZ:l.endRegion.d.availableZ,layerCount:e.layerCount}),f=`tiny-terminal:start-region:${l.connectionId}`,y=`tiny-terminal:end-region:${l.connectionId}`,x=`tiny-terminal:start-port:${l.connectionId}`,C=`tiny-terminal:end-port:${l.connectionId}`;o.push({regionId:f,pointIds:[x],d:{capacityMeshNodeId:f,center:{x:u?.x??l.startRegion.d.center.x,y:u?.y??l.startRegion.d.center.y},width:m3e,height:m3e,availableZ:[A],_containsTarget:!0,_tinyTerminal:!0,_tinyTerminalNetId:l.mutuallyConnectedNetworkId,netId:d}}),o.push({regionId:y,pointIds:[C],d:{capacityMeshNodeId:y,center:{x:_?.x??l.endRegion.d.center.x,y:_?.y??l.endRegion.d.center.y},width:m3e,height:m3e,availableZ:[g],_containsTarget:!0,_tinyTerminal:!0,_tinyTerminalNetId:l.mutuallyConnectedNetworkId,netId:d}}),i.push({portId:x,region1Id:l.startRegion.regionId,region2Id:f,d:{portId:x,x:u?.x??l.startRegion.d.center.x,y:u?.y??l.startRegion.d.center.y,z:A,distToCentermostPortOnZ:0,_tinyTerminal:!0,...e.preserveTerminalPcbPortIds&&u?.pcb_port_id?{pcb_port_id:u.pcb_port_id}:{}}}),i.push({portId:C,region1Id:l.endRegion.regionId,region2Id:y,d:{portId:C,x:_?.x??l.endRegion.d.center.x,y:_?.y??l.endRegion.d.center.y,z:g,distToCentermostPortOnZ:0,_tinyTerminal:!0,...e.preserveTerminalPcbPortIds&&_?.pcb_port_id?{pcb_port_id:_.pcb_port_id}:{}}});let b=r.get(l.startRegion.regionId),I=r.get(l.endRegion.regionId);b?.pointIds.push(x),I?.pointIds.push(C),a.push({connection:{connectionId:l.connectionId},path:[{portId:x},{portId:C}]})}let c={regions:o,ports:i,connections:s,solvedRoutes:a};return((l)=>{let h=new Map,d=new Map,u=new Set((l.connections??[]).flatMap((x)=>[x.startRegionId,x.endRegionId])),_=new Set(l.regions.filter((x)=>{let C=typeof x.d?.netId=="number"?x.d.netId:typeof x.d?.NetId=="number"?x.d.NetId:void 0;return x.d?._containsObstacle===!0&&(C===void 0||C===-1)&&!u.has(x.regionId)}).map((x)=>x.regionId)),p=0;for(let x of l.ports){let C=x.d,b=C?._preloadedTracePortAssignments??[];if(b.length>0&&p++,!_.has(x.region1Id)&&!_.has(x.region2Id))for(let I of b){let v=d.get(I.traceId);if(v!==void 0&&v!==I.fixedNetId)throw Error(`Preloaded trace "${I.traceId}" maps to multiple canonical nets`);d.set(I.traceId,I.fixedNetId);let P=h.get(I.traceId)??[];P.push({port:x,assignment:I}),h.set(I.traceId,P)}}let m=new Map(l.regions.map((x)=>[x.regionId,x])),A=l.connections??=[],g=l.solvedRoutes??=[],f=0,y=0;for(let[x,C]of h){C.sort((M,B)=>M.assignment.routePosition-B.assignment.routePosition||M.assignment.z-B.assignment.z||M.port.portId.localeCompare(B.port.portId));let b=C.filter(({port:M},B)=>B===0||M.portId!==C[B-1].port.portId);if(b.length<2)continue;let I=[],v;for(let M=0;M<b.length-1;M++){let B=b[M],T=b[M+1];if(B.assignment.z===T.assignment.z&&Math.abs(B.assignment.routePosition-T.assignment.routePosition)<=0.000001){v=void 0;continue}let N=H3r(b,M,v);N?(I.push({regionId:N,from:B,to:T}),v=N):v=void 0}let P=[];for(let M of I){let B=P.at(-1);B&&B.at(-1).to.port.portId===M.from.port.portId?B.push(M):P.push([M])}for(let[M,B]of P.entries()){let T=L3r(x,M);for(let O of B){let U=m.get(O.regionId);if(!U)throw Error(`Preloaded trace "${x}" references missing region "${O.regionId}"`);U.assignments=[...U.assignments??[],{regionPort1Id:O.from.port.portId,regionPort2Id:O.to.port.portId,connectionId:T}],y++}let N=B[0],D=B.at(-1),L=N.from.port,H=D.to.port,V={connectionId:T,mutuallyConnectedNetworkId:d.get(x)??x,startRegionId:IVt(L,N.regionId),endRegionId:IVt(H,D.regionId),preloadedTraceSection:{traceId:x,startRoutePosition:N.from.assignment.routePosition,endRoutePosition:D.to.assignment.routePosition,startPoint:{x:N.from.assignment.tracePoint.x,y:N.from.assignment.tracePoint.y,z:N.from.assignment.z},endPoint:{x:D.to.assignment.tracePoint.x,y:D.to.assignment.tracePoint.y,z:D.to.assignment.z}}};A.push(V),g.push({requiredRip:!1,connection:V,path:[L,H].map((O)=>({portId:O.portId,g:0,h:0,f:0,hops:0,ripRequired:!1}))})}P.length>0&&f++}})(c),c},PVt=(e)=>{let t=new Map;for(let n=0;n<e.problem.routeNet.length;n++){let o=e.problem.routeMetadata?.[n],r=o?.mutuallyConnectedNetworkId;if(typeof r!="string"||r.length===0)throw Error(`Tiny hypergraph route ${n} is missing a net ID`);t.set(r,e.problem.routeNet[n])}for(let n=0;n<e.problem.regionNetId.length;n++){let o=e.topology.regionMetadata?.[n]?._tinyTerminalNetId;if(typeof o!="string")continue;let r=t.get(o);r!==void 0&&(e.problem.regionNetId[n]=r)}},EVt=(e)=>{let t=new Map;e.topology.regionMetadata?.forEach((o,r)=>{typeof o.serializedRegionId=="string"&&t.set(o.serializedRegionId,r)});let n=new Set;for(let o of e.problem.routeMetadata??[])QQ(o)||(typeof o.startRegionId=="string"&&n.add(o.startRegionId),typeof o.endRegionId=="string"&&n.add(o.endRegionId));for(let o of e.problem.routeMetadata??[])if(QQ(o))for(let r of[o.startRegionId,o.endRegionId]){if(typeof r!="string"||n.has(r))continue;let i=t.get(r);if(i===void 0)continue;let s=e.topology.regionMetadata?.[i];typeof s?.netId=="number"||typeof s?.NetId=="number"||(e.problem.regionNetId[i]=-1)}},MVt=(e)=>{if(e.problem.metadataPortPenaltiesApplied)return 0;let t=0,n=e.problem.portPenalty!==void 0;for(let r=0;r<e.topology.portCount;r++){let i=Number(e.topology.portMetadata?.[r]?.tinyHypergraphPortPenalty),s=Number.isFinite(i)&&i>0?i:0;s>0&&t++,e.problem.portPenalty?.[r]!==s&&(n=!1)}if(n)return e.problem.metadataPortPenaltiesApplied=!0,t;t=0;let o=e.problem.portPenalty?new Float64Array(e.problem.portPenalty):new Float64Array(e.topology.portCount);for(let r=0;r<e.topology.portCount;r++){let i=Number(e.topology.portMetadata?.[r]?.tinyHypergraphPortPenalty);!Number.isFinite(i)||i<=0||(o[r]+=i,t++)}return t>0&&(e.problem.portPenalty=o),e.problem.metadataPortPenaltiesApplied=!0,t},wVt=class extends Q3r{configuredSolvers=new WeakSet;duplicatePortPenaltyCount=0;metadataPortPenaltyCount=0;crampedPortPenaltyCount=0;preloadedPortCount=0;preloadedFixedSegmentCount=0;crampedPortTraversalPenalty;useSelectiveReripRouting;constructor(e,t){super(e),this.useSelectiveReripRouting=t,this.crampedPortTraversalPenalty=150;let n=Xsn(e.serializedHyperGraph);if(this.preloadedPortCount=n.preloadedPortCount,this.preloadedFixedSegmentCount=n.preloadedAssignmentCount,t){let o=this.pipelineDef.find((r)=>r.solverName==="solveGraph");if(!o)throw Error("Tiny hypergraph pipeline is missing the solveGraph stage");o.solverClass=CVt}this.MAX_ITERATIONS=jsn(e)}loadHyperGraph(e){let t=super.loadHyperGraph(e);((i,s)=>{let a=new Map;for(let c of s.connections??[])QQ(c)&&a.set(c.connectionId,c.preloadedTraceSection);for(let c of i.problem.routeMetadata??[]){let l=a.get(c.connectionId);l&&(c.preloadedTraceSection=l)}})(t,this.inputProblem.serializedHyperGraph);let n=MVt(t),{duplicatePortPenaltyCount:o,crampedPortPenaltyCount:r}=((i,s)=>{let a=0,c=0,l=i.problem.portPenalty?new Float64Array(i.problem.portPenalty):new Float64Array(i.topology.portCount);for(let h=0;h<i.topology.portCount;h++){let d=i.topology.portMetadata?.[h];typeof d?.duplicatedFromPortId=="string"&&(l[h]+=150,a++),d?.cramped&&s>0&&(l[h]+=s,c++)}return(a>0||c>0)&&(i.problem.portPenalty=l),{duplicatePortPenaltyCount:a,crampedPortPenaltyCount:c}})(t,this.crampedPortTraversalPenalty);return PVt(t),EVt(t),this.metadataPortPenaltyCount=Math.max(this.metadataPortPenaltyCount,n),this.duplicatePortPenaltyCount=Math.max(this.duplicatePortPenaltyCount,o),this.crampedPortPenaltyCount=Math.max(this.crampedPortPenaltyCount,r),t}_step(){super._step(),this.configureSolver(this.activeSubSolver)}getInitialVisualizationSolver(){if(this.useSelectiveReripRouting&&!this.initialVisualizationSolver){let{topology:t,problem:n}=this.loadHyperGraph(this.inputProblem.serializedHyperGraph);this.initialVisualizationSolver=new CVt(t,n,this.getSolveGraphOptions())}let e=super.getInitialVisualizationSolver();return this.configureSolver(e),e}getSolvedTinySolver(){let e=this.getSolver("optimizeSection");if(e?.solved&&!e.failed)return e.getSolvedSolver();let t=this.getSolver("solveGraph");if(t?.solved&&!t.failed)return t;throw Error("TinyHyperGraph section pipeline does not have a solved graph")}configureSolver(e){if(e&&!this.configuredSolvers.has(e)){if(e instanceof Ale||e instanceof ZQ){let t=e;MVt(t),PVt(t),EVt(t)}this.configuredSolvers.add(e)}}},e6e=class extends ei{constructor(e){super(),this.params=e;let t=((d)=>d.map((u)=>{let _=u.simpleRouteConnection;if(!_)throw Error(`TinyHypergraphPortPointPathingSolver requires a SimpleRouteConnection for "${u.connectionId}"`);let p=u.mutuallyConnectedNetworkId;if(!p)throw Error(`TinyHypergraphPortPointPathingSolver requires a net ID for "${u.connectionId}"`);return{...u,mutuallyConnectedNetworkId:p,simpleRouteConnection:_}}))(e.connections),n=e.flags.USE_SELECTIVE_RERIP_ROUTING?function(d,u){let _=new Map;for(let p of d){let m=u(p);_.set(m,(_.get(m)??0)+1)}return d.map((p,m)=>({connection:p,index:m})).sort((p,m)=>(_.get(u(m.connection))??0)-(_.get(u(p.connection))??0)||p.index-m.index).map(({connection:p})=>p)}(t,V3r):t;this.rootConnectionNameByConnectionId=new Map(n.map((d)=>[d.connectionId,d.simpleRouteConnection.__rootConnectionNames?.[0]]));let o=U3r({...e,connections:n});this.originalPreloadedSegmentKeysByConnectionId=((d)=>{let u=new Map;for(let _ of d.connections??[])QQ(_)&&u.set(_.connectionId,new Set);for(let _ of d.regions)for(let p of _.assignments??[]){let m=u.get(p.connectionId);if(!m)continue;let[A,g]=[p.regionPort1Id,p.regionPort2Id].sort();m.add(JSON.stringify([_.regionId,A,g]))}return u})(o);let r=Xsn(o),i=r.preloadedPortCount>0,s=i&&e.flags.USE_PARTIAL_RIP_ROUTING_WITH_PRELOADED_TRACES===!0,a=s?Math.max(o.connections?.length??0,r.preloadedAssignmentCount):void 0,c=o,l=new p3r(o,{duplicatePortProximity:0.05,useSerializedPortPenalties:!1,routeSolveOptions:{...UZe(e.minViaPadDiameter),USE_SPARSE_CANDIDATE_STORAGE:!1,ACCEPT_BEST_SOLUTION_ON_TIMEOUT:!0,GREEDY_FINAL_ROUTE_ITERS:4,MAX_ITERATIONS:Math.ceil(2000000*GZe(e.effort)),RIP_THRESHOLD_RAMP_ATTEMPTS:0,STATIC_REACHABILITY_PRECHECK:!0}});if(l.solve(),l.failed)this.duplicateCongestedPortError=l.error??"unknown error";else{this.duplicateCongestedPortReport=l.report,c=l.getOutput();for(let d of c.ports){let u=ZXe(d.d);typeof u.duplicatedFromPortId=="string"&&(delete u._preloadedFixedNetIds,delete u._preloadedTracePortAssignments)}}this.duplicatedPortCount=this.duplicateCongestedPortReport?.duplicatedPorts.reduce((d,u)=>d+u.duplicatePortIds.length,0)??0;let h=((d,u,_,p=!0,m)=>{let A=d.connections?.length??0,g=m??A,f=v$e.PARTIAL_RIP_MIN_ROUTE_COUNT??0,y=v$e.PARTIAL_RIP_MAX_ROUTE_COUNT??Number.POSITIVE_INFINITY,x=p&&g>=f&&g<=y;return{serializedHyperGraph:d,createSectionMask:({topology:C})=>new Int8Array(C.portCount),solveGraphOptions:{...z3r(u,_),...x?{PARTIAL_RIP_MIN_ROUTE_COUNT:0,PARTIAL_RIP_MAX_ROUTE_COUNT:Number.POSITIVE_INFINITY,PARTIAL_RIP_COMPLEXITY_SELECTION_MIN_ROUTE_COUNT:0}:{PARTIAL_RIP_ENABLED:!1,OUTSIDE_IN_ROUTING:!1}},sectionSolverOptions:O3r(u,_)}})({...c,solvedRoutes:o.solvedRoutes},e.effort,e.minViaPadDiameter,!i||s,a);this.tinyPipelineSolver=new wVt(h,e.flags.USE_SELECTIVE_RERIP_ROUTING===!0),this.primaryTinyPipelineSolver=this.tinyPipelineSolver,n.length>=30&&n.length<=99&&(this.alternativeTinyPipelineInput={...h,solveGraphOptions:{...h.solveGraphOptions,TRACE_DENSITY_COST_FACTOR:1}}),this.MAX_ITERATIONS=jsn(h)*(this.alternativeTinyPipelineInput?2:1),this.originalRegionById=new Map(e.graph.regions.map((d)=>[d.regionId,d])),this.originalRegionIds=new Set(this.originalRegionById.keys()),this.inputNodeWithPortPoints=((d,u)=>{let _=new Map(u.regions.map((m)=>[m.regionId,m])),p=new Map(u.ports.map((m)=>[m.portId,m]));return d.graph.regions.map((m)=>{let A=_.get(m.regionId),g=(A?.pointIds??m.ports.map((f)=>f.d.portId)).map((f)=>p.get(f)).filter((f)=>f&&!ZXe(f.d)._tinyTerminal).map((f)=>{let y=f,x=ZXe(y.d),C=_.get(y.region1Id),b=_.get(y.region2Id),I=Boolean(vVt(C?.d)._offBoardConnectionId??vVt(b?.d)._offBoardConnectionId);return{portPointId:y.portId,x:Number(x.x??0),y:Number(x.y??0),z:Number(x.z??0),prevPortPointId:typeof x.prevPortPointId=="string"?x.prevPortPointId:void 0,nextPortPointId:typeof x.nextPortPointId=="string"?x.nextPortPointId:void 0,connectionNodeIds:[y.region1Id,y.region2Id],distToCentermostPortOnZ:Number(x.distToCentermostPortOnZ??0),cramped:Boolean(x.cramped),connectsToOffBoardNode:I}});return{capacityMeshNodeId:m.d.capacityMeshNodeId,center:m.d.center,width:m.d.width,height:m.d.height,portPoints:g,availableZ:m.d.availableZ,_containsObstacle:m.d._containsObstacle,_containsTarget:m.d._containsTarget,_offBoardConnectionId:m.d._offBoardConnectionId,_offBoardConnectedCapacityMeshNodeIds:m.d._offBoardConnectedCapacityMeshNodeIds,_qfpRegionType:m.d._qfpRegionType,_isNarrowQfpPadGap:m.d._isNarrowQfpPadGap}})})(e,c),Object.defineProperty(this,"stats",{configurable:!0,enumerable:!0,get:()=>this.getStatsSnapshot(),set:(d)=>{this.statsSnapshot=d,this.statsSnapshotDirty=!1}})}params;tinyPipelineSolver;primaryTinyPipelineSolver;alternativeTinyPipelineSolver;alternativeTinyPipelineInput;candidatePortfolioPhase="primary";primaryCandidateSummary;alternativeCandidateSummary;alternativeCandidateEvaluated=!1;selectedCandidate="primary";duplicateCongestedPortReport;duplicateCongestedPortError;duplicatedPortCount=0;inputNodeWithPortPoints;originalRegionById;originalRegionIds;rootConnectionNameByConnectionId;originalPreloadedSegmentKeysByConnectionId;statsSnapshot={};statsSnapshotDirty=!1;getSolverName(){return"TinyHypergraphPortPointPathingSolver"}getChangedPreloadedRouteIds(e){let t=new Map,n=new Map;for(let r=0;r<e.problem.routeCount;r++){let i=this.getRouteMetadata(e,r);QQ(i)&&(t.set(i.connectionId,r),n.set(r,new Set))}for(let r=0;r<e.state.regionSegments.length;r++){let i=e.topology.regionMetadata?.[r]?.serializedRegionId;for(let[s,a,c]of e.state.regionSegments[r]??[]){let l=n.get(s);if(!l)continue;let h=e.topology.portMetadata?.[a]?.serializedPortId,d=e.topology.portMetadata?.[c]?.serializedPortId;if(typeof i!="string"||typeof h!="string"||typeof d!="string")throw Error(`Tiny hypergraph preloaded route ${s} has a segment without serialized topology IDs`);let[u,_]=[h,d].sort();l.add(JSON.stringify([i,u,_]))}}let o=new Set;for(let[r,i]of this.originalPreloadedSegmentKeysByConnectionId){let s=t.get(r);if(s===void 0)throw Error(`Tiny hypergraph lost preloaded trace section "${r}"`);let a=n.get(s);if(i.size>0&&a.size===0)throw Error(`Tiny hypergraph lost preloaded trace section "${r}"`);(i.size!==a.size||[...i].some((c)=>!a.has(c)))&&o.add(s)}return o}summarizePipelineCandidate(e){let t=e.getSolvedTinySolver(),n=0,o=0,r=0,i=0,s=0,a=0,c=t.topology.regionMetadata??[];for(let l=0;l<t.state.regionSegments.length;l++){let h=t.state.regionSegments[l];s+=h.length;for(let[,g,f]of h)t.topology.portZ[g]!==t.topology.portZ[f]&&(a+=1);let d=c[l]?.capacityMeshNodeId;if(!d||!this.originalRegionIds.has(d))continue;let u=this.originalRegionById.get(d);if(!u||h.length===0)continue;let _=h.map(([g,f,y])=>[this.createAssignedPortPoint(t,g,f),this.createAssignedPortPoint(t,g,y)]),p={capacityMeshNodeId:u.d.capacityMeshNodeId,center:u.d.center,width:u.d.width,height:u.d.height,portPoints:_.flat(),portPointsInPairs:_,availableZ:u.d.availableZ},m=D_(p),A=ex(u.d,m.numSameLayerCrossings,m.numEntryExitLayerChanges,m.numTransitionPairCrossings);n+=A,o+=A*A,r=Math.max(r,A),i+=p.portPoints.length**2}return{nodePfSum:n,nodePfSquaredSum:o,nodePfMax:r,squaredNodePortPointCount:i,segmentCount:s,layerChangeCount:a,changedPreloadedTraceSectionCount:this.getChangedPreloadedRouteIds(t).size}}shouldEvaluateAlternative(e){let t=this.primaryTinyPipelineSolver.getSolvedTinySolver().problem.routeCount;return this.alternativeTinyPipelineInput!==void 0&&((n,o)=>n.nodePfSum>4&&n.nodePfMax>1&&n.squaredNodePortPointCount/Math.max(1,o)>=125)(e,t)}shouldSelectAlternative(e,t){return((n,o,r)=>{if(o.changedPreloadedTraceSectionCount>n.changedPreloadedTraceSectionCount)return!1;let i=r>40?0.92:0.95,s=o.nodePfSum<=0.9*n.nodePfSum&&o.nodePfSquaredSum<=0.85*n.nodePfSquaredSum&&o.nodePfMax<=0.85*n.nodePfMax&&o.squaredNodePortPointCount<0.98*n.squaredNodePortPointCount&&o.segmentCount<=0.97*n.segmentCount;return o.nodePfSum<=1.03*n.nodePfSum&&o.nodePfSquaredSum<=1.06*n.nodePfSquaredSum&&(o.squaredNodePortPointCount<n.squaredNodePortPointCount*i||s)})(e,t,this.primaryTinyPipelineSolver.getSolvedTinySolver().problem.routeCount)}finishCandidatePortfolio(){this.candidatePortfolioPhase="complete",this.solved=this.tinyPipelineSolver.solved,this.failed=this.tinyPipelineSolver.failed,this.error=this.tinyPipelineSolver.error??null}getSolveGraphBenchmarkMetrics(){let e=this.tinyPipelineSolver.getSolver("solveGraph");if(!e)return;let t=e.state.regionSegments.map((i)=>i.length),n=this.selectedCandidate==="alternative"?this.alternativeCandidateSummary:this.primaryCandidateSummary,o=e.stats,r=this.tinyPipelineSolver.getStageStats().solveGraph;return{routeCount:e.problem.routeCount,traceDensityCandidateEvaluated:this.alternativeCandidateEvaluated,traceDensityCandidateSelected:this.selectedCandidate==="alternative",downstreamNodePfSum:n?.nodePfSum,downstreamNodePfSquaredSum:n?.nodePfSquaredSum,downstreamNodePfMax:n?.nodePfMax,downstreamSquaredNodePortPointCount:n?.squaredNodePortPointCount,changedPreloadedTraceSectionCount:n?.changedPreloadedTraceSectionCount,iterations:e.iterations,timeMs:r?.timeSpent,ripCount:o.ripCount,partialRipCount:o.partialRipCount,partiallyRippedRouteCount:o.partiallyRippedRouteCount,partiallyRippedSegmentCount:o.partiallyRippedSegmentCount,retainedPartialRipSegmentCount:o.retainedPartialRipSegmentCount,firstMaxRegionCost:o.firstMaxRegionCost,bestMaxRegionCost:o.bestMaxRegionCost,firstTotalRegionCost:o.firstTotalRegionCost,bestTotalRegionCost:o.bestTotalRegionCost,firstSegmentCount:o.firstSegmentCount,bestSolvedSegmentCount:o.bestSolvedSegmentCount,bestSolvedMaxRegionSegmentCount:o.bestSolvedMaxRegionSegmentCount,bestSolvedSquaredRegionSegmentCount:o.bestSolvedSquaredRegionSegmentCount,finalMaxRegionSegmentCount:Math.max(0,...t),finalSquaredRegionSegmentCount:t.reduce((i,s)=>i+s*s,0),finalSegmentCount:n?.segmentCount,finalLayerChangeCount:n?.layerChangeCount,warmupFullRipAttempts:o.partialRipWarmupFullRipAttempts,complexityAwareSelection:o.partialRipComplexityAwareSelection,targetReached:o.partialRipTargetReached,outsideInCompletedRouteCount:o.outsideInCompletedRouteCount,outsideInFallbackRouteCount:o.outsideInFallbackRouteCount,outsideInForwardExpansionCount:o.outsideInForwardExpansionCount,outsideInReverseExpansionCount:o.outsideInReverseExpansionCount}}_step(){this.tinyPipelineSolver.step(),this.candidatePortfolioPhase==="primary"&&this.primaryTinyPipelineSolver.failed?(this.alternativeTinyPipelineInput=void 0,this.finishCandidatePortfolio()):this.candidatePortfolioPhase==="primary"&&this.primaryTinyPipelineSolver.solved?(this.primaryCandidateSummary=this.summarizePipelineCandidate(this.primaryTinyPipelineSolver),this.shouldEvaluateAlternative(this.primaryCandidateSummary)?(this.alternativeCandidateEvaluated=!0,this.alternativeTinyPipelineSolver=new wVt(this.alternativeTinyPipelineInput,this.params.flags.USE_SELECTIVE_RERIP_ROUTING===!0),this.tinyPipelineSolver=this.alternativeTinyPipelineSolver,this.candidatePortfolioPhase="alternative"):(this.alternativeTinyPipelineInput=void 0,this.finishCandidatePortfolio())):this.candidatePortfolioPhase==="alternative"&&(this.tinyPipelineSolver.solved||this.tinyPipelineSolver.failed)&&(this.tinyPipelineSolver.solved&&!this.tinyPipelineSolver.failed&&(this.alternativeCandidateSummary=this.summarizePipelineCandidate(this.tinyPipelineSolver)),this.alternativeCandidateSummary&&this.primaryCandidateSummary&&this.shouldSelectAlternative(this.primaryCandidateSummary,this.alternativeCandidateSummary)?(this.selectedCandidate="alternative",this.primaryTinyPipelineSolver=void 0,this.alternativeTinyPipelineSolver=void 0):(this.tinyPipelineSolver=this.primaryTinyPipelineSolver,this.alternativeTinyPipelineSolver=void 0),this.alternativeTinyPipelineInput=void 0,this.finishCandidatePortfolio()),this.solved=this.candidatePortfolioPhase==="complete"&&this.tinyPipelineSolver.solved,this.failed=this.candidatePortfolioPhase==="complete"&&this.tinyPipelineSolver.failed,this.error=this.failed?this.tinyPipelineSolver.error??null:null,this.progress=this.candidatePortfolioPhase==="complete"?1:this.candidatePortfolioPhase==="alternative"?0.5+0.5*this.tinyPipelineSolver.progress:this.alternativeTinyPipelineInput?0.5*this.tinyPipelineSolver.progress:this.tinyPipelineSolver.progress,this.statsSnapshotDirty=!0,this.activeSubSolver=this.tinyPipelineSolver.activeSubSolver??null}getStatsSnapshot(){if(!this.statsSnapshotDirty)return this.statsSnapshot;let e=this.tinyPipelineSolver.getSolver("optimizeSection"),t=this.getCurrentTinySolver();return this.statsSnapshot={duplicateCongestedPortSourceCount:this.duplicateCongestedPortReport?.duplicatedPorts.length??0,duplicateCongestedPortCount:this.duplicatedPortCount,duplicateCongestedPortFallbackToOriginal:Boolean(this.duplicateCongestedPortError),duplicateCongestedPortPenalty:this.duplicatedPortCount>0?150:0,duplicateCongestedPortPenaltyCount:this.tinyPipelineSolver.duplicatePortPenaltyCount,metadataPortPenaltyCount:this.tinyPipelineSolver.metadataPortPenaltyCount,crampedPortPenalty:this.tinyPipelineSolver.crampedPortTraversalPenalty,crampedPortPenaltyCount:this.tinyPipelineSolver.crampedPortPenaltyCount,preloadedPortCount:this.tinyPipelineSolver.preloadedPortCount,preloadedFixedSegmentCount:this.tinyPipelineSolver.preloadedFixedSegmentCount,duplicateCongestedPortError:this.duplicateCongestedPortError,candidatePortfolioPhase:this.candidatePortfolioPhase,candidatePortfolioSelectedCandidate:this.selectedCandidate,candidatePortfolioPrimarySummary:this.primaryCandidateSummary,candidatePortfolioAlternativeSummary:this.alternativeCandidateSummary,...this.tinyPipelineSolver.stats??{},...t?.stats??{},...e?.stats??{},currentStage:this.tinyPipelineSolver.getCurrentStageName(),stageStats:this.tinyPipelineSolver.getStageStats()},this.statsSnapshotDirty=!1,this.statsSnapshot}preview(){return this.visualize()}getCurrentTinySolver(){let e=this.tinyPipelineSolver.getSolver("optimizeSection");if(e?.solved&&!e.failed)return e.getSolvedSolver();return this.tinyPipelineSolver.getSolver("solveGraph")||void 0}getSolvedTinySolver(){return this.tinyPipelineSolver.getSolvedTinySolver()}getRouteMetadata(e,t){return e.problem.routeMetadata?.[t]}createAssignedPortPoint(e,t,n){let o=this.getRouteMetadata(e,t),r=o?((a)=>a.simpleRouteConnection?.name??a.connectionId)(o):`route-${t}`,i=o?this.rootConnectionNameByConnectionId.get(o.connectionId)??o.mutuallyConnectedNetworkId:void 0,s=e.topology.portMetadata?.[n];return{portPointId:String(s?.serializedPortId??s?.portId??`tiny-port-${n}`),x:e.topology.portX[n],y:e.topology.portY[n],z:e.topology.portZ[n],connectionName:r,rootConnectionName:i,...this.params.preserveTerminalPcbPortIds&&typeof s?.pcb_port_id=="string"?{pcb_port_id:s.pcb_port_id}:{},prevPortPointId:typeof s?.prevPortPointId=="string"?s.prevPortPointId:void 0,nextPortPointId:typeof s?.nextPortPointId=="string"?s.nextPortPointId:void 0}}getOutput(){let e=this.getSolvedTinySolver(),t=[],n=e.state.regionSegments,o=e.topology.regionMetadata??[],r=this.getChangedPreloadedRouteIds(e);for(let s=0;s<n.length;s++){let a=o[s]?.capacityMeshNodeId;if(!a||!this.originalRegionIds.has(a))continue;let c=this.originalRegionById.get(a);if(!c)continue;let l=n[s].filter(([d])=>{let u=this.getRouteMetadata(e,d);return!QQ(u)||r.has(d)}).map(([d,u,_])=>{let p=this.createAssignedPortPoint(e,d,u),m=this.createAssignedPortPoint(e,d,_);return p.portPointId&&m.portPointId&&(p.nextPortPointId=m.portPointId,m.prevPortPointId=p.portPointId),[p,m]}),h=l.flat();h.length!==0&&t.push({capacityMeshNodeId:c.d.capacityMeshNodeId,center:c.d.center,width:c.d.width,height:c.d.height,portPoints:h,portPointsInPairs:l,availableZ:c.d.availableZ})}let i=[...r].map((s)=>{let a=this.getRouteMetadata(e,s);if(!QQ(a))throw Error(`Changed preloaded hypergraph route ${s} is missing section metadata`);let c=a.preloadedTraceSection;return{connectionName:a.connectionId,traceId:c.traceId,startRoutePosition:c.startRoutePosition,endRoutePosition:c.endRoutePosition,connection:{name:a.connectionId,__rootConnectionNames:[a.mutuallyConnectedNetworkId],pointsToConnect:[{x:c.startPoint.x,y:c.startPoint.y,layer:nd(c.startPoint.z,this.params.layerCount)},{x:c.endPoint.x,y:c.endPoint.y,layer:nd(c.endPoint.z,this.params.layerCount)}]}}});return this.stats.changedPreloadedTraceSectionCount=i.length,{nodesWithPortPoints:t,inputNodeWithPortPoints:this.inputNodeWithPortPoints,changedPreloadedTraceSections:i}}computeNodePf(e){let t=this.getOutput().nodesWithPortPoints.find((n)=>n.capacityMeshNodeId===e.capacityMeshNodeId);return this.computeSolvedNodePf(e.capacityMeshNodeId,t)}computeNodePfMap(){let e=new Map(this.getOutput().nodesWithPortPoints.map((t)=>[t.capacityMeshNodeId,t]));return new Map(this.inputNodeWithPortPoints.map((t)=>[t.capacityMeshNodeId,this.computeSolvedNodePf(t.capacityMeshNodeId,e.get(t.capacityMeshNodeId))]))}computeSolvedNodePf(e,t){let n=this.originalRegionById.get(e);if(!t||!n)return null;let o=D_(t);return ex(n.d,o.numSameLayerCrossings,o.numEntryExitLayerChanges,o.numTransitionPairCrossings)}tryFinalAcceptance(){}getConstructorParams(){return[this.params]}visualize(){return this.tinyPipelineSolver.visualize()}},kae=(e,t)=>{if(!e||e==="none")return e;try{let n=NV(e);return`rgba(${n.red},${n.green},${n.blue},${t})`}catch{return zi(e,1-t)}},yB=({srj:e,opacity:t=0.25,visualizationOptions:n={}})=>{let o=rx({...e,obstacles:[]},n);return{...o,points:[],lines:o.lines?.map((r)=>({...r,strokeColor:kae(r.strokeColor,t)})),rects:o.rects?.map((r)=>({...r,fill:kae(r.fill,t),stroke:kae(r.stroke,t)})),circles:o.circles?.map((r)=>({...r,fill:kae(r.fill,t),stroke:kae(r.stroke,t)}))}};function MV(e,t,n,o){if(Ru(e,t,n,o))return 0;let r=_3e(e,n,o),i=_3e(t,n,o),s=_3e(n,e,t),a=_3e(o,e,t);return Math.min(r,i,s,a)}function _3e(e,t,n){let o={x:n.x-t.x,y:n.y-t.y},r=BVt({x:e.x-t.x,y:e.y-t.y},o);if(r<=0)return eje(e,t);let i=BVt(o,o);if(i<=r)return eje(e,n);let s=r/i;return eje(e,{x:t.x+s*o.x,y:t.y+s*o.y})}function BVt(e,t){return e.x*t.x+e.y*t.y}function eje(e,t){let n=t.x-e.x,o=t.y-e.y;return Math.sqrt(n*n+o*o)}function tje(e,t){return e.x>=t.center.x-t.width/2&&e.x<=t.center.x+t.width/2&&e.y>=t.center.y-t.height/2&&e.y<=t.center.y+t.height/2}var GCe=0.000001,P$e=(e,t,n)=>xc(e,t,n)<=GCe,g3e=(e,t)=>Math.abs(e.x-t.x)<=GCe&&Math.abs(e.y-t.y)<=GCe,nje=(e,t)=>{if(!t||t.length<3)return!1;for(let o=0;o<t.length;o++){let r=t[o],i=t[(o+1)%t.length];if(P$e(e,r,i))return!0}let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o],s=t[r];i.y>e.y!=s.y>e.y&&e.x<(s.x-i.x)*(e.y-i.y)/(s.y-i.y)+i.x&&(n=!n)}return n},oje="escape-via:",B3=0.0001,W3r=(e)=>e.obstacleId??[e.layers.join("."),e.center.x.toFixed(4),e.center.y.toFixed(4),e.width.toFixed(4),e.height.toFixed(4)].join(":"),TVt=(e,t,n=0.0001)=>kn(e,t)<=n,t6e=class extends ei{constructor(e,t={}){super(),this.ogSrj=e,this.viaDiameter=t.viaDiameter??rm(e).padDiameter,this.viaRadius=this.viaDiameter/2,this.minTraceWidth=t.minTraceWidth??e.minTraceWidth,this.obstacleMargin=t.obstacleMargin??e.defaultObstacleMargin??0.15,this.requiredViaToPadClearance=Math.max(this.obstacleMargin,e.minViaEdgeToPadEdgeClearance??0),this.escapeOffset=this.viaRadius+Math.max(this.minTraceWidth/2,this.requiredViaToPadClearance),this.requiredTraceClearance=this.minTraceWidth/2+this.obstacleMargin/2,this.requiredViaToViaClearance=this.viaDiameter+this.obstacleMargin,this.outputSrj=e,this.escapeViaMetadataByPointId=new Map,this.createdEscapeVias=[]}ogSrj;getSolverName(){return"EscapeViaLocationSolver"}viaDiameter;viaRadius;minTraceWidth;obstacleMargin;escapeOffset;requiredTraceClearance;requiredViaToPadClearance;requiredViaToViaClearance;outputSrj;escapeViaMetadataByPointId;createdEscapeVias;nextEscapeViaIndex=0;getConnectionNetIds(e){return new Set([e.name,...e.__rootConnectionNames??[],e.__netConnectionName].filter((t)=>Boolean(t)))}obstacleMatchesConnectionNet(e,t){return e.connectedTo.some((n)=>t.has(n))}getObstacleZs(e){return e.__zLayers&&e.__zLayers.length>0?e.__zLayers:e.layers.map((t)=>si(t,this.ogSrj.layerCount))}getViaSpanLayers(e,t){let n=si(e,this.ogSrj.layerCount),o=si(t,this.ogSrj.layerCount),r=Math.min(n,o),i=Math.max(n,o),s=Array.from({length:i-r+1},(a,c)=>r+c);return{__zLayers:s,layers:s.map((a)=>nd(a,this.ogSrj.layerCount))}}createEscapeViaObstacle(e){let{escapeVia:t,connectionNetIds:n}=e,{layers:o,__zLayers:r}=this.getViaSpanLayers(t.sourceLayer,t.targetLayer);return{obstacleId:`escape-via-obstacle:${t.pointId}`,type:"rect",layers:o,__zLayers:r,center:{x:t.x,y:t.y},width:this.viaDiameter,height:this.viaDiameter,connectedTo:Array.from(n)}}selectSourceObstacle(e){let{point:t,sourceLayer:n,connectionNetIds:o}=e;return this.ogSrj.obstacles.filter((r)=>!r.isCopperPour&&r.layers.includes(n)&&tje(t,r)).sort((r,i)=>{let s=r.connectedTo.includes(t.pointId??"")||r.connectedTo.includes(t.pcb_port_id??"")||this.obstacleMatchesConnectionNet(r,o);return s!==(i.connectedTo.includes(t.pointId??"")||i.connectedTo.includes(t.pcb_port_id??"")||this.obstacleMatchesConnectionNet(i,o))?s?-1:1:r.width*r.height-i.width*i.height})[0]}getCandidatePositions(e,t){if(!t)return this.dedupeCandidatePositions([{x:e.x+this.escapeOffset,y:e.y},{x:e.x-this.escapeOffset,y:e.y},{x:e.x,y:e.y+this.escapeOffset},{x:e.x,y:e.y-this.escapeOffset},{x:e.x+this.escapeOffset,y:e.y+this.escapeOffset},{x:e.x+this.escapeOffset,y:e.y-this.escapeOffset},{x:e.x-this.escapeOffset,y:e.y+this.escapeOffset},{x:e.x-this.escapeOffset,y:e.y-this.escapeOffset}]);let n=t.center.x-t.width/2,o=t.center.x+t.width/2,r=t.center.y-t.height/2,i=t.center.y+t.height/2,s=n-this.escapeOffset,a=o+this.escapeOffset,c=r-this.escapeOffset,l=i+this.escapeOffset,h=this.getEdgeSamples(r,i,e.y),d=this.getEdgeSamples(n,o,e.x),u=[];for(let _ of h)u.push({x:s,y:_},{x:a,y:_});for(let _ of d)u.push({x:_,y:c},{x:_,y:l});return this.dedupeCandidatePositions(u)}dedupeCandidatePositions(e){let t=[];for(let n of e)t.some((o)=>TVt(o,n))||t.push(n);return t}pushEdgeSample(e,t,n,o){let r=Math.max(n,Math.min(o,t));e.some((i)=>Math.abs(i-r)<=B3)||e.push(r)}getEdgeSamples(e,t,n){let o=[],r=t-e;if(this.pushEdgeSample(o,n,e,t),r<=B3)return o;this.pushEdgeSample(o,e,e,t),this.pushEdgeSample(o,t,e,t),this.pushEdgeSample(o,(e+t)/2,e,t);let i=Math.max(e,Math.min(t,n)),s=Math.max(this.requiredViaToViaClearance,B3),a=Math.ceil(r/s);for(let c=1;c<=a;c++){let l=c*s;this.pushEdgeSample(o,i+l,e,t),this.pushEdgeSample(o,i-l,e,t)}return o}isInsideBoard(e){return e.x>=this.ogSrj.bounds.minX+this.viaRadius&&e.x<=this.ogSrj.bounds.maxX-this.viaRadius&&e.y>=this.ogSrj.bounds.minY+this.viaRadius&&e.y<=this.ogSrj.bounds.maxY-this.viaRadius&&(!(this.ogSrj.outline&&this.ogSrj.outline.length>=3)||nje(e,this.ogSrj.outline))}hasClearEscapePath(e){let{sourcePoint:t,candidate:n,sourceLayer:o,sourceObstacle:r}=e;if(this.ogSrj.outline&&this.ogSrj.outline.length>=3){if((({start:i,end:s,polygon:a,margin:c=0.2})=>{if(!a||a.length<3)return!1;let l=nje(i,a),h=nje(s,a);if(!l||!h)return!0;for(let d=0;d<a.length;d++){let u=a[d],_=a[(d+1)%a.length],p=P$e(i,u,_),m=P$e(s,u,_);if(p&&m)continue;if(!Ru(i,s,u,_)){if(!p&&!m&&MV(i,s,u,_)<c-GCe)return!0;continue}let A=pB(i,s,u,_);if(!(A&&(p&&g3e(A,i)||m&&g3e(A,s))||A&&(g3e(A,i)||g3e(A,s))))return!0}return!1})({start:t,end:n,polygon:this.ogSrj.outline,margin:this.requiredTraceClearance}))return!1}for(let i of this.ogSrj.obstacles){if(i===r)continue;if(!i.layers.includes(o))continue;if(tje(n,i))return!1;let s=$Ke(i);if(Math.min(...s.map((a)=>MV(t,n,a.start,a.end)))+B3<this.requiredTraceClearance)return!1}return!0}getBoardBoundarySegments(){if(this.ogSrj.outline&&this.ogSrj.outline.length>=3)return this.ogSrj.outline.map((r,i)=>({start:r,end:this.ogSrj.outline[(i+1)%this.ogSrj.outline.length]}));let{minX:e,maxX:t,minY:n,maxY:o}=this.ogSrj.bounds;return[{start:{x:e,y:n},end:{x:t,y:n}},{start:{x:t,y:n},end:{x:t,y:o}},{start:{x:t,y:o},end:{x:e,y:o}},{start:{x:e,y:o},end:{x:e,y:n}}]}getRayProbeDistance(){let{minX:e,maxX:t,minY:n,maxY:o}=this.ogSrj.bounds;return 2*Math.hypot(t-e,o-n)+this.viaDiameter}getRayIntersectionDistance(e){let{rayStart:t,rayEnd:n,segmentStart:o,segmentEnd:r}=e;if(!Ru(t,n,o,r))return null;let i=pB(t,n,o,r);if(!i)return null;let s=kn(t,i);return s<=B3?null:s}getProjectedFreeSpace(e){let{sourcePoint:t,candidate:n}=e,o=n.x-t.x,r=n.y-t.y;return Math.abs(o)<=B3||Math.abs(r)<=B3?this.getProjectedFreeSpaceAlongDirection({...e,direction:{x:o,y:r},travelDistance:kn(t,n)}):Math.min(this.getProjectedFreeSpaceAlongDirection({...e,direction:{x:0,y:Math.sign(r)},travelDistance:Math.abs(r)}),this.getProjectedFreeSpaceAlongDirection({...e,direction:{x:Math.sign(o),y:Math.sign(r)},travelDistance:kn(t,n)}),this.getProjectedFreeSpaceAlongDirection({...e,direction:{x:Math.sign(o),y:0},travelDistance:Math.abs(o)}))}getProjectedFreeSpaceAlongDirection(e){let{sourcePoint:t,sourceLayer:n,sourceObstacle:o,direction:r,travelDistance:i}=e,s=Math.hypot(r.x,r.y);if(s<=B3||i<=B3)return 0;let a=this.getRayProbeDistance(),c=r.x/s,l=r.y/s,h={x:t.x+c*a,y:t.y+l*a},d=Number.POSITIVE_INFINITY;for(let u of this.ogSrj.obstacles)if(u!==o&&u.layers.includes(n))for(let _ of $Ke(u)){let p=this.getRayIntersectionDistance({rayStart:t,rayEnd:h,segmentStart:_.start,segmentEnd:_.end});p!==null&&(d=Math.min(d,p))}for(let u of this.getBoardBoundarySegments()){let _=this.getRayIntersectionDistance({rayStart:t,rayEnd:h,segmentStart:u.start,segmentEnd:u.end});_!==null&&(d=Math.min(d,_))}return Number.isFinite(d)?Math.max(0,d-i):0}getMinBlockingClearance(e){let{candidate:t,connectionNetIds:n,sourceZ:o,targetZ:r}=e,i=Math.min(o,r),s=Math.max(o,r),a=Number.POSITIVE_INFINITY;for(let c of this.ogSrj.obstacles){let l=this.getObstacleZs(c);if(!l.some((d)=>d>=i&&d<=s))continue;if(c.isCopperPour&&!l.includes(o))continue;let h=iP(t,c)-this.viaRadius;if(a=Math.min(a,h),a+B3<this.requiredViaToPadClearance)return a}return a}getMinPlacedEscapeViaClearance(e){let t=Number.POSITIVE_INFINITY;for(let n of this.createdEscapeVias){let o=kn(e,n)-this.viaDiameter;if(t=Math.min(t,o),t+B3<this.obstacleMargin)return t}return t}selectPointOwner(e){let{point:t,groupConnections:n,matchingCopperPours:o}=e,r=NCe(t),i=n.map((s)=>({connection:s,pointIndex:s.pointsToConnect.findIndex((a)=>NCe(a)===r)})).filter((s)=>s.pointIndex!==-1);return i.length===0?null:(i.sort((s,a)=>{let c=o.some((l)=>this.obstacleMatchesConnectionNet(l,this.getConnectionNetIds(s.connection)));return c!==o.some((l)=>this.obstacleMatchesConnectionNet(l,this.getConnectionNetIds(a.connection)))?c?-1:1:s.pointIndex-a.pointIndex}),i[0])}findBestEscapeViaCandidate(e){let{connection:t,point:n,pointIndex:o,matchingCopperPours:r,connectionNetIds:i,sourceObstacle:s}=e;if(!mV(n))return null;let a=n.layer,c=si(a,this.ogSrj.layerCount),l=s??this.selectSourceObstacle({point:n,sourceLayer:a,connectionNetIds:i}),h=this.getCandidatePositions(n,l),d=null;for(let u of r){let _=u.layers[0];if(!_||_===a)continue;let p=si(_,this.ogSrj.layerCount),m=W3r(u);for(let A of h){if(!this.isInsideBoard(A))continue;if(!tje(A,u))continue;if(!this.hasClearEscapePath({sourcePoint:n,candidate:A,sourceLayer:a,sourceObstacle:l}))continue;let g=this.getMinBlockingClearance({candidate:A,connectionNetIds:i,sourceZ:c,targetZ:p});if(g+B3<this.requiredViaToPadClearance)continue;let f=this.getMinPlacedEscapeViaClearance(A);if(f+B3<this.obstacleMargin)continue;let y=this.getProjectedFreeSpace({sourcePoint:n,candidate:A,sourceLayer:a,sourceObstacle:l}),x=Math.min(y,3),C=100*g-kn(n,A)-0.5*Math.abs(p-c)+2*x+(Number.isFinite(f)?10*Math.min(f,this.requiredViaToViaClearance):0);(!d||C>d.score)&&(d={pointId:`${oje}${t.name}:${n.pointId??`p${o}`}:${_}:${this.nextEscapeViaIndex++}`,x:A.x,y:A.y,connectionName:t.name,rootConnectionName:t.__rootConnectionNames?.[0]??t.name,sourcePointIndex:o,sourcePointId:n.pointId,sourceLayer:a,targetLayer:_,targetPourKey:m,score:C})}}return d}buildPointPlacementPlans(e){let{mergedConnection:t,groupConnections:n,matchingCopperPours:o,connectionNetIds:r}=e,i=[];for(let s of t.pointsToConnect){let a=this.selectPointOwner({point:s,groupConnections:n,matchingCopperPours:o});if(!a)continue;let c=mV(s)?this.selectSourceObstacle({point:s,sourceLayer:s.layer,connectionNetIds:r}):void 0,l=mV(s)?this.getCandidatePositions(s,c).length:0;i.push({point:s,pointOwner:a,sourceObstacle:c,candidateCount:l})}return i.sort((s,a)=>{if(s.candidateCount!==a.candidateCount)return s.candidateCount-a.candidateCount;let c=(s.sourceObstacle?.width??0)*(s.sourceObstacle?.height??0),l=(a.sourceObstacle?.width??0)*(a.sourceObstacle?.height??0);return c!==l?c-l:s.pointOwner.pointIndex-a.pointOwner.pointIndex})}_step(){let e=this.ogSrj.obstacles.filter((s)=>s.isCopperPour),t=this.ogSrj.connections,n=t.map((s)=>structuredClone(s)),o=new Map(n.map((s)=>[s.name,s])),r=structuredClone(this.ogSrj.obstacles),i=Grn([...t]);for(let s of i){let a=new Set(s.__rootConnectionNames??[s.name]),c=t.filter((p)=>(p.__rootConnectionNames??[p.name]).some((m)=>a.has(m)));if(c.length===0)continue;let l=new Set;for(let p of c)for(let m of this.getConnectionNetIds(p))l.add(m);let h=e.filter((p)=>this.obstacleMatchesConnectionNet(p,l));if(h.length===0)continue;let d=new Map,u=new Map,_=this.buildPointPlacementPlans({mergedConnection:s,groupConnections:c,matchingCopperPours:h,connectionNetIds:l});for(let{point:p,pointOwner:m,sourceObstacle:A}of _){let g=this.findBestEscapeViaCandidate({connection:m.connection,point:p,pointIndex:m.pointIndex,matchingCopperPours:h,connectionNetIds:l,sourceObstacle:A});if(!g)continue;let f=o.get(m.connection.name);if(!f)continue;if(f.pointsToConnect.some((x)=>mV(x)&&x.layer===g.sourceLayer&&TVt(x,g)))continue;f.pointsToConnect.push({x:g.x,y:g.y,layer:g.sourceLayer,pointId:g.pointId,terminalVia:{toLayer:g.targetLayer,viaDiameter:this.viaDiameter}}),this.escapeViaMetadataByPointId.set(g.pointId,g),this.createdEscapeVias.push(g),r.push(this.createEscapeViaObstacle({escapeVia:g,connectionNetIds:this.getConnectionNetIds(m.connection)}));let y=d.get(g.targetPourKey);y?y.push(g.pointId):d.set(g.targetPourKey,[g.pointId]),u.has(g.targetPourKey)||u.set(g.targetPourKey,m.connection.name)}for(let[p,m]of d.entries()){if(m.length<=1)continue;let A=u.get(p);if(!A)continue;let g=o.get(A);g&&(g.externallyConnectedPointIds=[...g.externallyConnectedPointIds??[],m])}}this.outputSrj={...structuredClone(this.ogSrj),connections:n,obstacles:r},this.solved=!0}getOutputSimpleRouteJson(){return structuredClone(this.outputSrj)}getEscapeViaMetadataByPointId(){return new Map(this.escapeViaMetadataByPointId)}visualize(){return{title:"Escape Via Location Solver",points:this.outputSrj.connections.flatMap((e)=>e.pointsToConnect.map((t)=>({x:t.x,y:t.y,color:t.pointId?.startsWith(oje)===!0?"#0f766e":"#dc2626",label:t.pointId?.startsWith(oje)===!0?`${e.name}
escape via`:e.name}))),lines:this.createdEscapeVias.map((e)=>{let t=this.outputSrj.connections.find((n)=>n.name===e.connectionName)?.pointsToConnect[e.sourcePointIndex]??null;return{points:t?[{x:t.x,y:t.y},{x:e.x,y:e.y}]:[{x:e.x,y:e.y}],strokeColor:"#0f766e"}}),circles:this.createdEscapeVias.map((e)=>({center:{x:e.x,y:e.y},radius:this.viaRadius,strokeColor:"#0f766e",label:`${e.connectionName}
${e.targetLayer}`})),rects:this.outputSrj.obstacles.filter((e)=>!e.isCopperPour).map((e)=>({...e,fill:"rgba(220,38,38,0.12)"}))}}},X3r=(e)=>({...e}),VS=(e)=>({...e,route:e.route?.map(X3r),vias:e.vias?.map((t)=>({...t}))}),J9=(e)=>e.map(VS),Ksn="#0000FF",fle=0.15,fr=0.000001,wq=0.1,Bq=["top","bottom","left","right"],rje=(e)=>e.x*e.x+e.y*e.y,A3e=(e,t)=>({x:e.x-t.x,y:e.y-t.y}),kQ=(e,t,n)=>{let o=A3e(n,t),r=rje(o);if(r<=fr)return Math.sqrt(rje(A3e(e,t)));let i=(a=A3e(e,t),c=o,s=(a.x*c.x+a.y*c.y)/r,Math.max(0,Math.min(1,s)));var s,a,c;let l={x:t.x+o.x*i,y:t.y+o.y*i};return Math.sqrt(rje(A3e(e,l)))},nB=(e)=>e?.z===1?"bottom":"top",j3r=(e,t,n)=>(e.z??0)===(t.z??0)&&((t.z??0)===(n.z??0)&&(e.x===t.x&&t.x===n.x||e.y===t.y&&t.y===n.y)),UCe=(e,t,n)=>{let o=n?.get(e);if(o)return o;let r=e.route??[],i=e.traceThickness??fle,{POSITIVE_INFINITY:s,POSITIVE_INFINITY:a,NEGATIVE_INFINITY:c,NEGATIVE_INFINITY:l}=Number,h=!1,d=(_,p,m)=>{s=Math.min(s,_-m),a=Math.min(a,p-m),c=Math.max(c,_+m),l=Math.max(l,p+m),h=!0},u={segments:[],segmentsByLayer:{top:[],bottom:[]},vias:(e.vias??[]).map((_)=>{let p=(_.diameter??e.viaDiameter??0.3)/2;return d(_.x,_.y,p),{center:{x:_.x,y:_.y},radius:p,routeIndex:t}}),bounds:{minX:0,minY:0,maxX:0,maxY:0}};for(let _=0;_<r.length-1;){let p=r[_],m=_+1,A=r[m],g=i/2;for(p&&d(p.x,p.y,g),A&&d(A.x,A.y,g);m<r.length-1;){let x=r[m],C=r[m+1];if(!p||!x||!C)break;if(nB(p)!==nB(x))break;if(nB(x)!==nB(C))break;if(!j3r(p,x,C))break;m+=1,A=C,d(C.x,C.y,g)}if(!p||!A){_+=1;continue}let f=nB(p),y={start:p,end:A,routeIndex:t,pointIndex:_,endPointIndex:m,thickness:i,halfThickness:g,layer:f,minX:Math.min(p.x,A.x)-g,maxX:Math.max(p.x,A.x)+g,minY:Math.min(p.y,A.y)-g,maxY:Math.max(p.y,A.y)+g};u.segments.push(y),u.segmentsByLayer[f].push(y),_=m}if(!h)for(let _ of r)d(_.x,_.y,i/2);return u.bounds=h?{minX:s,minY:a,maxX:c,maxY:l}:{minX:0,minY:0,maxX:0,maxY:0},n?.set(e,u),u},f3e=(e,t,n)=>t.x<=Math.max(e.x,n.x)+fr&&t.x>=Math.min(e.x,n.x)-fr&&t.y<=Math.max(e.y,n.y)+fr&&t.y>=Math.min(e.y,n.y)-fr,y3e=(e,t,n)=>(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y),Wq=(e,t,n,o)=>((r,i,s,a)=>{let c=y3e(r,i,s),l=y3e(r,i,a),h=y3e(s,a,r),d=y3e(s,a,i);return!!(Math.abs(c)<=fr&&f3e(r,s,i))||!!(Math.abs(l)<=fr&&f3e(r,a,i))||!!(Math.abs(h)<=fr&&f3e(s,r,a))||!!(Math.abs(d)<=fr&&f3e(s,i,a))||c>0!=l>0&&h>0!=d>0})(e,t,n,o)?0:Math.min(kQ(e,n,o),kQ(t,n,o),kQ(n,e,t),kQ(o,e,t)),YS=(e,t)=>Math.abs(e.x-t.x)<=fr&&Math.abs(e.y-t.y)<=fr,$sn=(e,t)=>YS(e.start,t.start)||YS(e.start,t.end)||YS(e.end,t.start)||YS(e.end,t.end),DVt=(e)=>{if(!e)return[];let t=[e.connectionName,e.rootConnectionName].filter((n)=>Boolean(n));return Array.from(new Set(t))},K3r=(e,t)=>{let n=DVt(e),o=DVt(t);return n.length!==0&&o.length!==0&&n.some((r)=>o.includes(r))},$3r=(e,t,n)=>e.minX-n<=t.maxX&&e.maxX+n>=t.minX&&e.minY-n<=t.maxY&&e.maxY+n>=t.minY,q3r=(e,t,n)=>{let o=n+e.halfThickness+t.halfThickness-fr;return e.minX-n<=t.maxX&&e.maxX+n>=t.minX&&e.minY-n<=t.maxY&&e.maxY+n>=t.minY&&o>0},NVt=(e,t,n,o)=>{let r=o+n.halfThickness+t-fr,i=e.x-r,s=e.x+r,a=e.y-r,c=e.y+r;return i<=n.maxX&&s>=n.minX&&a<=n.maxY&&c>=n.minY},J3r=(e,t)=>{let n=new WeakMap,o=e.map((a,c)=>UCe(a,c,n)),r=[],i=new Set,s=(a)=>{i.has(a.label)||(i.add(a.label),r.push(a))};for(let a=0;a<o.length;a+=1){let c=o[a];if(c)for(let l=a+1;l<o.length;l+=1){let h=o[l];if(h&&(!K3r(e[a],e[l])&&$3r(c.bounds,h.bounds,t))){for(let d of["top","bottom"]){let u=c.segmentsByLayer[d],_=h.segmentsByLayer[d];for(let p of u)for(let m of _){if($sn(p,m))continue;if(!q3r(p,m,t))continue;let A=t+(p.thickness+m.thickness)/2-fr;if(Wq(p.start,p.end,m.start,m.end)>=A)continue;s({center:{x:(Math.max(p.minX-t,m.minX-t)+Math.min(p.maxX+t,m.maxX+t))/2,y:(Math.max(p.minY-t,m.minY-t)+Math.min(p.maxY+t,m.maxY+t))/2},label:`trace-violation:${a}:s${p.pointIndex}:${l}:s${m.pointIndex}:${d}`})}}for(let d of c.segments)for(let[u,_]of h.vias.entries()){if(!NVt(_.center,_.radius,d,t))continue;let p=t+d.halfThickness+_.radius-fr;kQ(_.center,d.start,d.end)>=p||s({center:_.center,label:`trace-violation:${a}:s${d.pointIndex}:${l}:v${u}`})}for(let d of h.segments)for(let[u,_]of c.vias.entries()){if(!NVt(_.center,_.radius,d,t))continue;let p=t+d.halfThickness+_.radius-fr;kQ(_.center,d.start,d.end)>=p||s({center:_.center,label:`trace-violation:${a}:v${u}:${l}:s${d.pointIndex}`})}}}}return((a)=>{let c=[];for(let l of a){let h=c.find((d)=>{return u=d.center,_=l.center,Math.hypot(u.x-_.x,u.y-_.y)<=0.28;var u,_});h?(h.center={x:(h.center.x*h.count+l.center.x)/(h.count+1),y:(h.center.y*h.count+l.center.y)/(h.count+1)},h.labels.push(l.label),h.count+=1):c.push({center:l.center,labels:[l.label],count:1})}return c.map((l,h)=>({center:l.center,radius:Math.min(0.3,0.2+0.035*Math.sqrt(l.count-1)),stroke:"#f59e0b",fill:"rgba(245, 158, 11, 0.46)",label:l.count===1?l.labels[0]:`trace-violations:${h}:count-${l.count}`}))})(r)},RVt=new WeakMap,QVt=new WeakMap,kVt=new WeakMap,D$=(e)=>{let t=RVt.get(e);return t===void 0&&(t=e.length>2&&e[e.length-1]-e[0]===e.length-1?`${e[0]}..${e[e.length-1]}`:e.join(","),RVt.set(e,t)),t},EQ=({routeIndexes:e,layers:t,routePointIndexes:n})=>`${e[0]}:${t[0]}:${D$(n[0])}:${e[1]}:${t[1]}:${D$(n[1])}`,x3e=(e,t,n,o,r,i,s)=>{let a=((c,l,h,d,u,_)=>c<h?`${c}:${l}:${D$(u)}:${h}:${d}:${D$(_)}`:`${h}:${d}:${D$(_)}:${c}:${l}:${D$(u)}`)(t,n,o,r,i,s);e.has(a)||(t<o?e.set(a,{routeIndexes:[t,o],layers:[n,r],routePointIndexes:[i,s]}):e.set(a,{routeIndexes:[o,t],layers:[r,n],routePointIndexes:[s,i]}))},C3e=(e)=>{let t=QVt.get(e);if(t)return t;let n=[];for(let o=e.pointIndex;o<=e.endPointIndex;o+=1)n.push(o);return QVt.set(e,n),n},_Q=(e,t)=>!t||e.some((n)=>t.has(n)),b3e=(e,t)=>{let n=kVt.get(t);if(n)return n;let o=e.route??[],r=[];for(let i=0;i<o.length;i+=1){let s=o[i];s&&(Math.abs(s.x-t.center.x)<=fr&&Math.abs(s.y-t.center.y)<=fr&&r.push(i))}return kVt.set(t,r),r},Z3r=(e,t,n)=>e.minX-n<=t.maxX&&e.maxX+n>=t.minX&&e.minY-n<=t.maxY&&e.maxY+n>=t.minY,eCr=(e,t,n)=>{let o=n+e.halfThickness+t.halfThickness-fr;return e.minX-n<=t.maxX&&e.maxX+n>=t.minX&&e.minY-n<=t.maxY&&e.maxY+n>=t.minY&&o>0},LVt=(e,t,n,o)=>{let r=o+n.halfThickness+t-fr,i=e.x-r,s=e.x+r,a=e.y-r,c=e.y+r;return i<=n.maxX&&s>=n.minX&&a<=n.maxY&&c>=n.minY},tCr=(e,t,n)=>{let o=n+e.radius+t.radius-fr;return Math.abs(e.center.x-t.center.x)<=o&&Math.abs(e.center.y-t.center.y)<=o},Ky=(e,t,n,o,r)=>{let i=e.map((h,d)=>UCe(h,d,o)),s=new Map;if(t.size===0)return[];let a=Array.from(t),c=new Map,l=(h)=>{let d=c.get(h);if(d)return d;let u=i[h];if(!u)return[];let _=[];for(let p=0;p<i.length;p+=1){if(p===h)continue;let m=i[p];m&&(Z3r(u.bounds,m.bounds,n)&&_.push(p))}return c.set(h,_),_};for(let h of a){let d=i[h];if(!d)continue;let u=l(h),_=r?.get(h);for(let p of d.segments){let m=C3e(p);if(_Q(m,_))for(let A of u){if(h>A&&t.has(A))continue;let g=i[A];if(!g)continue;let f=r?.get(A),y=g.segmentsByLayer[p.layer];for(let x of y){let C=C3e(x);if(!_Q(C,f))continue;if($sn(p,x))continue;if(!eCr(p,x,n))continue;let b=n+(p.thickness+x.thickness)/2-fr;Wq(p.start,p.end,x.start,x.end)<b&&x3e(s,p.routeIndex,p.layer,x.routeIndex,x.layer,m,C)}}}}for(let h of a){let d=i[h];if(!d)continue;let u=l(h),_=r?.get(h);for(let p of d.vias){let m=b3e(e[p.routeIndex],p);if(_Q(m,_))for(let A of u){if(h>A&&t.has(A))continue;let g=i[A];if(!g)continue;let f=r?.get(A);for(let y of g.segments){let x=C3e(y);if(!_Q(x,f))continue;if(!LVt(p.center,p.radius,y,n))continue;let C=n+y.thickness/2+p.radius-fr;kQ(p.center,y.start,y.end)<C&&x3e(s,y.routeIndex,y.layer,p.routeIndex,"via",x,m)}}}}for(let h of a){let d=i[h];if(!d)continue;let u=l(h),_=r?.get(h);for(let p of d.segments){let m=C3e(p);if(_Q(m,_))for(let A of u){let g=i[A];if(!g)continue;let f=r?.get(A);for(let y of g.vias){let x=b3e(e[y.routeIndex],y);if(!_Q(x,f))continue;if(!LVt(y.center,y.radius,p,n))continue;let C=n+p.thickness/2+y.radius-fr;kQ(y.center,p.start,p.end)<C&&x3e(s,p.routeIndex,p.layer,y.routeIndex,"via",m,x)}}}}for(let h of a){let d=i[h];if(!d)continue;let u=l(h),_=r?.get(h);for(let p of d.vias){let m=b3e(e[p.routeIndex],p);if(_Q(m,_))for(let A of u){if(h>A&&t.has(A))continue;let g=i[A];if(!g)continue;let f=r?.get(A);for(let y of g.vias){let x=b3e(e[y.routeIndex],y);if(!_Q(x,f))continue;if(!tCr(p,y,n))continue;let C=n+p.radius+y.radius-fr;Math.hypot(p.center.x-y.center.x,p.center.y-y.center.y)<C&&x3e(s,p.routeIndex,"via",y.routeIndex,"via",m,x)}}}}return Array.from(s.values())},HVt=(e,t)=>e.x>=t.minX-fr&&e.x<=t.maxX+fr&&e.y>=t.minY-fr&&e.y<=t.maxY+fr,nCr=(e,t,n)=>{switch(t){case"left":return{minX:e.minX,maxX:e.minX+n,minY:e.minY,maxY:e.maxY};case"right":return{minX:e.maxX-n,maxX:e.maxX,minY:e.minY,maxY:e.maxY};case"top":return{minX:e.minX,maxX:e.maxX,minY:e.maxY-n,maxY:e.maxY};case"bottom":return{minX:e.minX,maxX:e.maxX,minY:e.minY,maxY:e.minY+n}}},oCr=(e,t,n)=>{let o=t.x-e.x,r=t.y-e.y,i=0,s=1,a=(l,h)=>{if(Math.abs(l)<=fr)return h>=-0.000001;let d=h/l;return l<0?!(d>s)&&(d>i&&(i=d),!0):!(d<i)&&(d<s&&(s=d),!0)};if(!(a(-o,e.x-n.minX)&&a(o,n.maxX-e.x)&&a(-r,e.y-n.minY)&&a(r,n.maxY-e.y)))return 0;let c=Math.hypot(o,r);return Math.max(0,s-i)*c},FVt=(e,t)=>Bq.filter((n)=>{switch(n){case"left":return Math.abs(e.x-t.minX)<=fr;case"right":return Math.abs(e.x-t.maxX)<=fr;case"top":return Math.abs(e.y-t.maxY)<=fr;case"bottom":return Math.abs(e.y-t.minY)<=fr}return!1}),zVt=(e,t)=>{let n=[];return e.x<t.minX-fr&&n.push("left"),e.x>t.maxX+fr&&n.push("right"),e.y>t.maxY+fr&&n.push("top"),e.y<t.minY-fr&&n.push("bottom"),n},rCr=(e,t,n)=>{let o=t.x-e.x,r=t.y-e.y;switch(n){case"left":case"right":return Math.abs(o)<=fr&&Math.abs(r)>fr;case"top":case"bottom":return Math.abs(r)<=fr&&Math.abs(o)>fr}},K$=(e,t,n)=>{let o=[],r=Math.max(n,fr),i=Math.min(0.1,r/4);for(let s=0;s<e.length;s+=1){let a=e[s],c=a?.route??[];for(let l=0;l<c.length-1;l+=1){let h=c[l],d=c[l+1];if(!h||!d)continue;let u=zVt(h,t),_=zVt(d,t),p=FVt(h,t),m=FVt(d,t),A=Bq.filter((y)=>{if(a.connectedPadSides?.includes(y))return!1;return!(oCr(h,d,nCr(t,y,r))<=i)&&!!rCr(h,d,y)}),g=!HVt(h,t)||!HVt(d,t),f=Array.from(new Set([...A,...u,..._]));(g||f.length!==0)&&o.push({routeIndex:s,connectionName:a.connectionName??a.rootConnectionName??`route-${s}`,segmentIndex:l,touchedSides:f,startSides:p,endSides:m,start:h,end:d})}}return o},E$e=(e)=>e?.center&&e.width&&e.height?{minX:e.center.x-e.width/2,maxX:e.center.x+e.width/2,minY:e.center.y-e.height/2,maxY:e.center.y+e.height/2,width:e.width,height:e.height,center:e.center}:null,OVt=(e)=>e==="bottom"?Ksn:"#FF0000",M$e=(e)=>{let t=e.route??[],n=[];if(t.length<2)return n;let o=nB(t[0]),r=[t[0]];for(let i=1;i<t.length;i+=1){let s=t[i],a=nB(s);a===o?r.push(s):(r.length>=2&&n.push({points:r,strokeColor:OVt(o),strokeWidth:e.traceThickness??fle,label:e.connectionName??"route"}),o=a,r=[t[i-1],s])}return r.length>=2&&n.push({points:r,strokeColor:OVt(o),strokeWidth:e.traceThickness??fle,label:e.connectionName??"route"}),n},iCr=(e)=>{let t=VS(e),n=t.route??[],o=t.vias??[];for(let r=1;r<n.length;r++){let i=n[r-1],s=n[r];if((i.z??0)===(s.z??0))continue;if(i.x!==s.x||i.y!==s.y)throw Error("Node repair requires coincident via transition endpoints");let a=-1,c=0.001;for(let l=0;l<o.length;l++){let h=o[l],d=Math.hypot(h.x-i.x,h.y-i.y);d<=c&&(a=l,c=d)}a===-1?o.push({x:i.x,y:i.y,diameter:t.viaDiameter}):o[a]={...o[a],x:i.x,y:i.y}}return(o.length||t.vias)&&(t.vias=o),t},qsn=class{scenes=new WeakMap;retainedBytes=0;maximumBytes=33554432;getCandidatePairs(e,t,n,o,r){if(!Number.isFinite(r)||r<0)return;let i=o[n];for(let l of i)if(!Number.isFinite(l.start.x)||!Number.isFinite(l.start.y)||!Number.isFinite(l.end.x)||!Number.isFinite(l.end.y)||!Number.isFinite(l.radius)||l.radius<0)return;let s=this.scenes.get(e),a=s?.get(n);if(a?.fixedRoutes!==t&&(a=void 0),!a){let l=0,h=1;for(let A=0;A<o.length;A++)if(A!==n)for(let g=0;g<o[A].length;g++){let f=o[A][g];if(!Number.isFinite(f.start.x)||!Number.isFinite(f.start.y)||!Number.isFinite(f.end.x)||!Number.isFinite(f.end.y)||!Number.isFinite(f.radius)||f.radius<0)return;h=Math.max(h,Math.abs(f.start.x),Math.abs(f.start.y),Math.abs(f.end.x),Math.abs(f.end.y),f.radius),l++}if(l<32)return;let d=new R_(l),u=new Uint32Array(l),_=new Uint32Array(l),p=0;for(let A=0;A<o.length;A++)if(A!==n)for(let g=0;g<o[A].length;g++){let f=o[A][g],y=Math.min(f.start.x,f.end.x)-f.radius,x=Math.min(f.start.y,f.end.y)-f.radius,C=Math.max(f.start.x,f.end.x)+f.radius,b=Math.max(f.start.y,f.end.y)+f.radius;if(!(Number.isFinite(y)&&Number.isFinite(x)&&Number.isFinite(C)&&Number.isFinite(b)))return;d.add(y,x,C,b),u[p]=A,_[p]=g,p++}d.finish(),a={index:d,routeIndexes:u,copperIndexes:_,maxMagnitude:h,fixedRoutes:t,queries:[],queryHitCount:0};let m=d.data.byteLength+u.byteLength+_.byteLength;this.retainedBytes+m>this.maximumBytes&&(this.scenes=new WeakMap,this.retainedBytes=0,s=void 0),m<=this.maximumBytes&&(s||(s=new Map,this.scenes.set(e,s)),s.set(n,a),this.retainedBytes+=m)}let c=new Map;for(let l=0;l<i.length;l++){let h=i[l],d=r+h.radius,u=8*Number.EPSILON*(a.maxMagnitude+Math.abs(h.start.x)+Math.abs(h.start.y)+Math.abs(h.end.x)+Math.abs(h.end.y)+d+1);if(!Number.isFinite(u+d))return;let _=Math.min(h.start.x,h.end.x)-d-u,p=Math.min(h.start.y,h.end.y)-d-u,m=Math.max(h.start.x,h.end.x)+d+u,A=Math.max(h.start.y,h.end.y)+d+u,g=a.queries[l],f;if(g&&g.minX===_&&g.minY===p&&g.maxX===m&&g.maxY===A)f=g.hits;else{f=a.index.search(_,p,m,A).sort((x,C)=>x-C);let y=a.queryHitCount-(g?.hits.length??0)+f.length;y<=65536&&(a.queries[l]={minX:_,minY:p,maxX:m,maxY:A,hits:f},a.queryHitCount=y)}for(let y of f){let x=a.routeIndexes[y],C=a.copperIndexes[y],b=c.get(x);b||(b=[],c.set(x,b));let I=x<n?C:l,v=x<n?l:C;(b[I]??=[]).push(v)}}return c}},Jsn=(e)=>{let t=e.route??[],n=[];for(let o=1;o<t.length;o++){let r=t[o-1],i=t[o];(r.z??0)===(i.z??0)&&n.push({start:r,end:i,minX:Math.min(r.x,i.x),minY:Math.min(r.y,i.y),maxX:Math.max(r.x,i.x),maxY:Math.max(r.y,i.y),magnitude:1+Math.abs(r.x)+Math.abs(r.y)+Math.abs(i.x)+Math.abs(i.y),radius:(e.traceThickness??fle)/2,minZ:r.z??0,maxZ:r.z??0,indexes:[o-1,o],via:!1})}for(let[o,r]of(e.vias??[]).entries()){let i=t.flatMap((a,c)=>a.x===r.x&&a.y===r.y?[c]:[]),s=i.map((a)=>t[a].z??0);n.push({start:r,end:r,minX:r.x,minY:r.y,maxX:r.x,maxY:r.y,magnitude:1+2*(Math.abs(r.x)+Math.abs(r.y)),radius:(r.diameter??e.viaDiameter??0.3)/2,minZ:s.length?Math.min(...s):0,maxZ:s.length?Math.max(...s):1,indexes:i,via:!0,viaIndex:o})}return n},WCe=(e,t,n,o=[],r,i=new WeakMap,s=new qsn,a=new WeakMap,c=new WeakMap)=>{let l=[...e,...o],h=l.map((p)=>{let m=i.get(p);return m||(m=Jsn(p),i.set(p,m)),m}),d=r?s.getCandidatePairs(r.routes,o,r.changedRoute,h,t):void 0,u=r?r.evaluation.conflicts.filter((p)=>p.firstRoute!==r.changedRoute&&p.secondRoute!==r.changedRoute):[],_=u.reduce((p,m)=>p+m.penetration**2,0);for(let p=0;p<e.length&&!(r&&p>r.changedRoute);p++){let m=e[p],A=c.get(m);if(A||(A=new Set([m.connectionName,m.rootConnectionName].filter(Boolean)),c.set(m,A)),!r||p===r.changedRoute){let x=h[p].filter((C)=>C.via);for(let C=0;C<x.length;C++){let b=x[C];for(let I=C+1;I<x.length;I++){let v=x[I];if(b.maxZ<v.minZ||v.maxZ<b.minZ)continue;let P=Math.hypot(b.start.x-v.start.x,b.start.y-v.start.y);if(P===0)continue;let M=t+b.radius+v.radius-P;M<=fr||(u.push({key:`${p}:vias:${C}:${I}`,firstRoute:p,secondRoute:p,first:b,second:v,penetration:M}),_+=M**2)}}for(let[C,b]of n.entries()){if(b.connectedTo?.some((P)=>A.has(P)))continue;let I,v=a.get(b);!v&&b.center&&b.width!==void 0&&b.height!==void 0&&b.width>=0&&b.height>=0&&(v={minX:b.center.x-b.width/2,minY:b.center.y-b.height/2,maxX:b.center.x+b.width/2,maxY:b.center.y+b.height/2,magnitude:Math.abs(b.center.x)+Math.abs(b.center.y)+Math.abs(b.width)+Math.abs(b.height)},a.set(b,v));for(let P of h[p]){if(b.zLayers&&!b.zLayers.some((B)=>B>=P.minZ&&B<=P.maxZ))continue;if(v&&t+P.radius>=0){let B=t+P.radius,T=32*Number.EPSILON*(P.magnitude+v.magnitude+Math.abs(B));if(P.minX>v.maxX+B+T||P.maxX<v.minX-B-T||P.minY>v.maxY+B+T||P.maxY<v.minY-B-T)continue}let M=t-XCe(P,b);M<=fr||M<=(I?.penetration??0)||(I={key:`${p}:pad:${C}`,firstRoute:p,secondRoute:-1,first:P,second:P,penetration:M})}I&&(u.push(I),_+=I.penetration**2)}}let g=r&&p!==r.changedRoute,f=g?r.changedRoute:p+1,y=g?r.changedRoute+1:l.length;for(let x=f;x<y;x++){let C=l[x],b=A.has(C.connectionName)||A.has(C.rootConnectionName),I=new Map,v=d?.get(p===r?.changedRoute?x:p);if(d&&!v)continue;let P=h[p],M=h[x];for(let B=0;B<P.length;B++){let T=P[B],N=v?.[B];if(d&&!N)continue;let D=N?N.length:M.length;for(let L=0;L<D;L++){let H=M[N?N[L]:L];if(b&&(!T.via||!H.via))continue;if(T.maxZ<H.minZ||H.maxZ<T.minZ)continue;if(b&&T.start.x===H.start.x&&T.start.y===H.start.y)continue;let V=t+T.radius+H.radius;if(Math.min(T.start.x,T.end.x)>Math.max(H.start.x,H.end.x)+V||Math.min(H.start.x,H.end.x)>Math.max(T.start.x,T.end.x)+V||Math.min(T.start.y,T.end.y)>Math.max(H.start.y,H.end.y)+V||Math.min(H.start.y,H.end.y)>Math.max(T.start.y,T.end.y)+V)continue;let O=V-Wq(T.start,T.end,H.start,H.end);if(O<=fr)continue;let U=`${T.via?`via:${T.viaIndex}`:`trace:${T.minZ}`}:${H.via?`via:${H.viaIndex}`:`trace:${H.minZ}`}`;O<=(I.get(U)?.penetration??0)||I.set(U,{key:`${p}:${x}:${U}`,firstRoute:p,secondRoute:x,first:T,second:H,penetration:O})}}for(let B of I.values())u.push(B),_+=B.penetration**2}}return u.sort((p,m)=>m.penetration-p.penetration),{conflicts:u,score:_}},XCe=(e,t)=>{if(!t.center||t.width===void 0||t.height===void 0)return 1/0;let n=t.center.x-t.width/2,o=t.center.x+t.width/2,r=t.center.y-t.height/2,i=t.center.y+t.height/2,s=0;for(let c of[e.start,e.end])c.x>=n&&c.x<=o&&c.y>=r&&c.y<=i&&(s=Math.max(s,e.radius+Math.min(c.x-n,o-c.x,c.y-r,i-c.y)));if(s>0)return-s;let a=[{x:n,y:r},{x:o,y:r},{x:o,y:i},{x:n,y:i}];return Math.min(...a.map((c,l)=>Wq(e.start,e.end,c,a[(l+1)%4])))-e.radius},VVt=(e,t)=>{let n=Jsn(e).filter((o)=>!t.zLayers||t.zLayers.some((r)=>r>=o.minZ&&r<=o.maxZ));return Math.min(...n.map((o)=>XCe(o,t)))},sCr=(e,t,n,o,r)=>{let i=VS(e),s=i.route??[],a=e.route??[],c=(h)=>h===0||h===s.length-1,l=new Set;for(let h of t.indexes){if(c(h))continue;let d=a[h];a.forEach((u,_)=>{u.x===d.x&&u.y===d.y&&l.add(_)})}if(!([...l].some(c)||t.via&&t.indexes.some(c))){if(l.size===0){if(t.via||t.indexes.length!==2)return;let[h,d]=t.indexes,u=s[h],_=s[d],p=[0.25,0.75].map((m)=>({...u,x:u.x+(_.x-u.x)*m+n,y:u.y+(_.y-u.y)*m+o}));s.splice(d,0,...p)}else{for(let h of l)s[h].x+=n,s[h].y+=o;for(let h of i.vias??[])[...l].some((d)=>a[d].x===h.x&&a[d].y===h.y)&&(h.x+=n,h.y+=o)}if(!s.some((h,d)=>d>0&&d<s.length-1&&(h.x<r.minX||h.x>r.maxX||h.y<r.minY||h.y>r.maxY)))return i}},ije=(e)=>{let t=[],n=e.route??[];for(let o=1;o<n.length;o++){let r=n[o-1],i=n[o];(r.z??0)===(i.z??0)&&t.push({start:r,end:i,radius:(e.traceThickness??fle)/2,minZ:r.z??0,maxZ:r.z??0})}for(let o of e.vias??[]){let r=1/0,i=-1/0;for(let s=1;s<n.length;s++){let a=n[s-1],c=n[s];Math.hypot(a.x-o.x,a.y-o.y)>0.001||Math.hypot(c.x-o.x,c.y-o.y)>0.001||a.z===c.z||(r=Math.min(r,a.z??0,c.z??0),i=Math.max(i,a.z??0,c.z??0))}t.push({start:o,end:o,radius:(o.diameter??e.viaDiameter??0.3)/2,minZ:r===1/0?0:r,maxZ:i===-1/0?1:i})}return t},YVt=(e,t)=>{let n=1/0;for(let o of e)o.maxZ<t.minZ||t.maxZ<o.minZ||(n=Math.min(n,Wq(o.start,o.end,t.start,t.end)-o.radius-t.radius));return n},aCr=class{constructor(e,t,n=[]){this.minimumClearance=t,this.obstacles=n,this.fixedCopper=e.map((o)=>({route:o,copper:ije(o)}))}minimumClearance;obstacles;fixedCopper;cache=new WeakMap;allows(e,t,n,o=!0){if(o&&((r,i,s)=>{let a=new Map(WCe(r,s,[]).conflicts.map((c)=>[c.key,c.penetration]));return WCe(i,s,[]).conflicts.some((c)=>c.penetration>(a.get(c.key)??0)+fr)})(e,t,this.minimumClearance))return!1;if(this.fixedCopper.length===0&&this.obstacles.length===0)return!0;for(let r of n){let i=e[r],s=t[r];if(i===s)continue;let a=this.cache.get(i)??ije(i),c=this.cache.get(s)??ije(s);this.cache.set(i,a),this.cache.set(s,c);let l=new Set([i.connectionName,i.rootConnectionName].filter(Boolean));for(let h of this.obstacles){if(h.connectedTo?.some((_)=>l.has(_)))continue;let d=VVt(s,h);if(d>=this.minimumClearance-fr)continue;let u=VVt(i,h);if(d<Math.min(u,this.minimumClearance)-fr)return!1}for(let h of this.fixedCopper)if(!l.has(h.route.connectionName)&&!l.has(h.route.rootConnectionName))for(let d of h.copper){let u=YVt(c,d);if(u>=this.minimumClearance-fr)continue;let _=YVt(a,d);if(u<Math.min(_,this.minimumClearance)-fr)return!1}}return!0}},cCr=(e,t)=>({title:`HighDensityRepair02 Initial State (margin=${t})`,routes:e}),jCe=(e)=>{let t=[];for(let n of e){let o=t[t.length-1];o&&o.z===n.z&&YS(o,n)||t.push(n)}return t},lCr=(e,t,n)=>{let o=Math.max(0,e.minX-t.maxX,t.minX-e.maxX),r=Math.max(0,e.minY-t.maxY,t.minY-e.maxY);return Math.hypot(o,r)<=n+fr},GVt=(e,t)=>{let n=Number.POSITIVE_INFINITY;for(let o of e.segments)for(let r of t.segments){if(o.layer!==r.layer)continue;let i=Wq(o.start,o.end,r.start,r.end)-(o.thickness+r.thickness)/2;n=Math.min(n,i)}return n},w$e=({currentRoutes:e,candidateRoutes:t,candidateRouteIndexes:n,maximumAllowedClearance:o})=>{let r=new WeakMap,i=new WeakMap,s=[],a=Array.from(n).sort((d,u)=>d-u),c=e.map((d,u)=>UCe(d,u,r)),l=t.map((d,u)=>UCe(d,u,i)),h=new Set;for(let d of a)for(let u=0;u<t.length;u+=1){if(u===d)continue;let _=Math.min(d,u),p=Math.max(d,u),m=`${_}:${p}`;if(h.has(m))continue;h.add(m);let A=l[_],g=l[p];if(!A||!g||!lCr(A.bounds,g.bounds,o))continue;let f=GVt(A,g);if(!Number.isFinite(f)||f>o+fr||!c[_]||!c[p])continue;let y=GVt(c[_],c[p]);!Number.isFinite(y)||f>=y-fr||s.push({routeIndexes:[_,p],previousClearance:y,nextClearance:f})}return s},I3e=0.001,hCr=(e,t)=>e.map((n)=>{let o=n.route??[];return o.length===0?n:{...n,route:o.map((r,i)=>i===0||i===o.length-1?((s,a)=>{let c={...s};return Math.abs(c.x-a.minX)<=I3e?c.x=a.minX:Math.abs(c.x-a.maxX)<=I3e&&(c.x=a.maxX),Math.abs(c.y-a.minY)<=I3e?c.y=a.minY:Math.abs(c.y-a.maxY)<=I3e&&(c.y=a.maxY),c})(r,t):r)}}),dCr=(e,t)=>Array.from(t).flatMap((n)=>M$e(e[n]).map((o)=>({...o,strokeColor:"#000000",strokeWidth:o.strokeWidth,label:`candidate:${o.label}`}))),Zsn=(e,t,n,o,r)=>{switch(t){case"left":return{center:{x:e.minX+n/2,y:e.center.y},width:n,height:e.height,stroke:"rgba(0, 0, 0, 0)",fill:o,label:r};case"right":return{center:{x:e.maxX-n/2,y:e.center.y},width:n,height:e.height,stroke:"rgba(0, 0, 0, 0)",fill:o,label:r};case"top":return{center:{x:e.center.x,y:e.maxY-n/2},width:e.width,height:n,stroke:"rgba(0, 0, 0, 0)",fill:o,label:r};case"bottom":return{center:{x:e.center.x,y:e.minY+n/2},width:e.width,height:n,stroke:"rgba(0, 0, 0, 0)",fill:o,label:r}}},uCr=({routes:e,candidateRoutes:t,candidateRouteIndexes:n,originalRoutes:o,boundary:r,side:i,margin:s,rejected:a,rejectionReason:c})=>{let l=Array.from(n).map((h)=>t[h].connectionName??`route-${h}`);return{title:a?`${i} move rejected (${c})`:`${i} move accepted`,routes:a?e:t,originalRoutes:o,activeSide:i,candidateRouteNames:l,overlayLines:a?dCr(t,n):[],overlayRects:[Zsn(r,i,s,a?"rgba(220, 38, 38, 0.14)":"rgba(16, 185, 129, 0.14)",a?`rejected:${i}`:`accepted:${i}`)]}},pCr=(e,t,n,o)=>{let r=(e?.adjacentObstacles??[]).some((i)=>((s,a,c,l)=>{let h=((d)=>d.center&&d.width&&d.height?{minX:d.center.x-d.width/2,maxX:d.center.x+d.width/2,minY:d.center.y-d.height/2,maxY:d.center.y+d.height/2}:null)(s);if(!h)return!1;switch(c){case"left":return h.maxX>=a.minX-fr&&h.minX<=a.minX+l+fr;case"right":return h.minX<=a.maxX+fr&&h.maxX>=a.maxX-l-fr;case"top":return h.minY<=a.maxY+fr&&h.maxY>=a.maxY-l-fr;case"bottom":return h.maxY>=a.minY-fr&&h.minY<=a.minY+l+fr}})(i,t,n,o));return{hasObstacle:r,moveAmount:r?o:o/2}},mCr=({start:e,end:t,side:n,boundary:o,amount:r,targetAxisValue:i})=>{let s=(({side:a,boundary:c,amount:l,targetAxisValue:h})=>{let d=h??(()=>{switch(a){case"left":return c.minX+l;case"right":return c.maxX-l;case"top":return c.maxY-l;case"bottom":return c.minY+l}})();switch(a){case"left":case"right":return Math.min(Math.max(d,c.minX),c.maxX);case"top":case"bottom":return Math.min(Math.max(d,c.minY),c.maxY)}})({side:n,boundary:o,amount:r,targetAxisValue:i});switch(n){case"left":case"right":return jCe([e,{x:s,y:e.y,z:e.z},{x:s,y:t.y,z:t.z},t]);case"top":case"bottom":return jCe([e,{x:e.x,y:s,z:e.z},{x:t.x,y:s,z:t.z},t])}},_Cr=(e,t,n,o,r,i,s,a=!1)=>{let c=e.route??[];if(c.length<2||t.length===0)return VS(e);let l=a?r:Math.max(r,i),h=((u,_)=>{switch(u){case"left":return{x:_,y:0};case"right":return{x:-_,y:0};case"top":return{x:0,y:-_};case"bottom":return{x:0,y:_}}})(o,l);if(a||(e.vias?.length??0)>0||c.length>2){let u=VS(e),_=u.route??[];for(let p of t){let m=_[p];m&&(_[p]={...m,x:m.x+h.x,y:m.y+h.y})}for(let p of u.vias??[])t.some((m)=>{let A=e.route?.[m];return!!A&&YS(A,p)})&&(p.x+=h.x,p.y+=h.y);return u}let d=VS(e);if(c.length===2&&t.length===2&&t[0]===0&&t[1]===1){let u=c[0],_=c[1];return VS({...e,route:mCr({start:u,end:_,side:o,boundary:n,amount:l,targetAxisValue:s})})}return d},n6e=(e,t,n)=>{switch(n){case"left":return e.x-t.minX;case"right":return t.maxX-e.x;case"top":return t.maxY-e.y;case"bottom":return e.y-t.minY}},UVt=(e,t,n)=>{let o=((r)=>{let i=r.route??[];if(i.length===0)return[];let s=[];for(let a=0;a<i.length;a+=1){let c=i[a];if(!c)continue;a===0||a===i.length-1||s.push(c);let l=i[a+1];l&&s.push({x:(c.x+l.x)/2,y:(c.y+l.y)/2})}return s})(e);return o.length===0?Number.POSITIVE_INFINITY:o.reduce((r,i)=>Math.min(r,n6e(i,t,n)),Number.POSITIVE_INFINITY)},B$e=(e,t,n=[])=>{let o=e.route??[],r=[],i=new Set,s=t.length===0||t.includes("via");if(o.length===2)return[0,1];let a=(c)=>{if(c<=0||c>=o.length-1)return;if(i.has(c))return;let l=o[c];l&&(s||t.includes(nB(l)))&&(i.add(c),r.push(c))};if(n.length>0)for(let c of n)a(c);else for(let c=1;c<o.length-1;c+=1)a(c);for(let c=0;c<r.length;c+=1){let l=r[c],h=o[l];if(h)for(let d=1;d<o.length-1;d+=1){if(i.has(d))continue;let u=o[d];u&&(u.z!==h.z&&YS(u,h)&&(i.add(d),r.push(d)))}}return r.sort((c,l)=>c-l),r},WVt=(e,t)=>Math.max(0,...(e.route??[]).map((n)=>Math.max(t.minX-n.x,n.x-t.maxX,t.minY-n.y,n.y-t.maxY,0))),$$=(e,t,n,o)=>n6e(e,t,n)<=o+fr,XVt=(e,t,n,o)=>{let r=e.route??[],i=[],s=new Set,a=1,c=r.length-2;for(;a<r.length-1&&YS(r[a],r[0]);)a+=1;for(;c>0&&YS(r[c],r[r.length-1]);)c-=1;for(let l=a;l<=c;l+=1)$$(r[l],t,n,o)&&(s.add(l),i.push(l));for(let l=0;l<i.length;l+=1){let h=r[i[l]];if(h)for(let d=a;d<=c;d+=1){if(s.has(d))continue;let u=r[d];u&&(u.z!==h.z&&YS(u,h)&&(s.add(d),i.push(d)))}}return i.length===0&&r.length===2&&r.some((l)=>$$(l,t,n,o))?[0,1]:(i.sort((l,h)=>l-h),i)},gCr=(e,t,n)=>{let o=e.route??[],r=n===0?o[0]:o[o.length-1];return r?Bq.filter((i)=>n6e(r,t,i)<=fr):[]},ACr=(e,t,n)=>{let o=e.route??[],r=t.route??[];if(o.length===0||r.length===0)return!0;for(let i of[0,-1]){let s=gCr(e,n,i);if(s.length===0)continue;let a=i===0?r[0]:r[r.length-1];if(!a)return!1;for(let c of s)if(n6e(a,n,c)>fr)return!1}return!0},fCr=(e,t)=>Math.hypot(t.x-e.x,t.y-e.y),jVt=(e,t,n,o)=>{let r=e.route??[];if(r.length===0)return"none";let i=!1;for(let s=0;s<r.length;s+=1){let a=r[s];if(a&&$$(a,t,n,o)){if(s!==0&&s!==r.length-1)return"interior";i=!0}}for(let s=0;s<r.length-1;s+=1){let a=r[s],c=r[s+1];if(a&&c&&($$(a,t,n,o)&&$$(c,t,n,o)&&!(fCr(a,c)<=fr)))return"interior"}return i?"endpoint":"none"},KVt=({currentRoutes:e,routeIndex:t,side:n,moveSide:o=n,boundary:r,margin:i,moveAmount:s,geometryCache:a,fixedCopperGuard:c})=>{let l=e[t],h=(l.route?.length??0)===2,d=XVt(l,r,n,i);if(d.length===0)return null;let u=new Set,_=new Map,p=new Set,m=e.slice(),A=!1,g="overlap",f=new Set([t]),y=new Map([[t,new Set]]),x=new Map([[t,new Set]]),C=[t],b=0,I=null,v=null,P=null,M=null,B=(L)=>new Set(L.map((H)=>EQ(H))),T=()=>I||(I=Ky(e,u,i,a,_),I),N=()=>P||(P=Ky(e,u,0,a,_),P),D=()=>M||(M=Ky(m,u,0,a,_),M);for(;b<C.length&&!A;){let L=C[b];if(b+=1,f.delete(L),u.has(L))continue;let H=m[L],V=Array.from(y.get(L)??[]),O=Array.from(x.get(L)??[]);y.delete(L),x.delete(L);let U=L===t?XVt(H,r,n,i):B$e(H,V,O);if(U.length===0){if(L===t)return null;A=!0,g="eventual-overlap";break}let j=H.route??[],Y=L===t?void 0:o==="left"||o==="right"?(j[U[0]]?.x??0)+(o==="left"?s:-s):(j[U[0]]?.y??0)+(o==="top"?-s:s);m[L]=_Cr(H,U,r,o,s,i,Y,L!==t),u.add(L),_.set(L,new Set(U)),I=null,v=null,P=null,M=null,(H.route?.length??0)===2&&p.add(L);let X=WVt(e[L],r);if(WVt(m[L],r)>X+0.000001){A=!0,g="boundary";break}if(!ACr(e[L],m[L],r)){A=!0,g="endpoint-boundary";break}let K=Ky(m,new Set([L]),i,a,new Map([[L,new Set(U)]]));for(let J of K){if(B(T()).has(EQ(J)))continue;let[ee,se]=J.routeIndexes,ne=u.has(ee),re=u.has(se);if(ne&&re)continue;let Z=ne?se:ee,te=ne?J.layers[1]:J.layers[0],ie=ne?J.routePointIndexes[1]:J.routePointIndexes[0];if(u.has(Z)||f.has(Z)){if(f.has(Z)){let le=y.get(Z)??new Set;le.add(te),y.set(Z,le);let ue=x.get(Z)??new Set;for(let de of ie)ue.add(de);x.set(Z,ue)}}else f.add(Z),C.push(Z),y.set(Z,new Set([te])),x.set(Z,new Set(ie))}}if(!A&&u.size>1){let L=B(T()),H=B(v||(v=Ky(m,u,i,a,_),v));for(let V of H)if(!L.has(V)){A=!0,g="eventual-overlap";break}}if(!A&&u.size>1){let L=B(N()),H=B(D());for(let V of H)if(!L.has(V)){A=!0,g="eventual-overlap";break}}if(!A){let L=new Set(Ky(e,u,0,a).map((V)=>EQ(V))),H=Ky(m,u,0,a);for(let V of H){let O=EQ(V);if(!L.has(O)){A=!0,g="eventual-overlap";break}}}if(!A)(({currentRoutes:H,candidateRoutes:V,candidateRouteIndexes:O,boundary:U,activeSide:j})=>{let Y=Bq.filter((K)=>K!==j),X=[];for(let K of O){let J=H[K],ee=V[K];if(J&&ee)for(let se of Y){let ne=UVt(J,U,se),re=UVt(ee,U,se);ne>fr&&re<=fr&&X.push({routeIndex:K,side:se,previousClearance:ne,nextClearance:re})}}return X})({currentRoutes:e,candidateRoutes:m,candidateRouteIndexes:u,boundary:r,activeSide:n}).length>0&&(A=!0,g="boundary-touch");if(!A)(({currentRoutes:H,candidateRoutes:V,candidateRouteIndexes:O,geometryCache:U,currentConflicts:j,candidateConflicts:Y})=>{let X=j??Ky(H,O,0,U),K=Y??Ky(V,O,0,U),J=new Set(X.map((ee)=>EQ(ee)));return K.filter((ee)=>{let se=EQ(ee);if(J.has(se))return!1;let[ne,re]=ee.routeIndexes,[Z,te]=ee.layers,ie=O.has(ne),le=O.has(re);if(ie&&le)return!1;let ue=ie?te:Z,de=V[ie?re:ne];return!!de&&B$e(de,[ue]).length===0})})({currentRoutes:e,candidateRoutes:m,candidateRouteIndexes:u,geometryCache:a,currentConflicts:N(),candidateConflicts:D()}).length>0&&(A=!0,g="fixed-trace-touch");if(!A)w$e({currentRoutes:e,candidateRoutes:m,candidateRouteIndexes:u,maximumAllowedClearance:Math.min(i/2,wq)}).length>0&&(A=!0,g="trace-clearance");return!A&&((L,H,V,O,U,j)=>Array.from(V).some((Y)=>{let X=L[Y],K=H[Y];return Bq.filter((J)=>J!==U).some((J)=>{let ee=jVt(X,O,J,j),se=jVt(K,O,J,j);return ee==="none"&&se!=="none"})}))(e,m,u,r,n,i)&&(A=!0,g="side-regression"),A||!c||c.allows(e,m,u)||(A=!0,g="fixed-copper-clearance"),{isTwoPointRoute:h,movableIndexes:d,candidateRouteIndexes:u,movedTwoPointRouteIndexes:p,candidateRoutes:m,rejected:A,rejectionReason:g}},yCr=(e,t,n,o,r)=>{let i=e.route??[];if(t.length===0)return null;if(o==="top"||o==="bottom"){let a=t.reduce((c,l)=>c+(i[l]?.x??n.center.x),0)/t.length;return a<n.center.x-r/2?"right":a>n.center.x+r/2?"left":null}let s=t.reduce((a,c)=>a+(i[c]?.y??n.center.y),0)/t.length;return s>n.center.y+r/2?"bottom":s<n.center.y-r/2?"top":null},xCr=({side:e,sample:t,boundary:n,margin:o,repairedRoutes:r,frames:i,captureProgressFrames:s,lockedTwoPointRoutes:a,geometryCache:c,fixedCopperGuard:l,allowTwoPointWithoutObstacle:h=!1})=>{let{hasObstacle:d,moveAmount:u}=pCr(t,n,e,o);s&&i.push(((m,A,g,f,y,x)=>({title:`${g} boundary analysis: move=${y.toFixed(3)} (${x?"obstacle-side":"clear-side"})`,routes:m,activeSide:g,overlayRects:[Zsn(A,g,f,"rgba(245, 158, 11, 0.16)",`strip:${g}`)]}))(J9(r),n,e,o,u,d));let _=new Set,p=0;for(let m=0;m<r.length;m+=1){if(_.has(m))continue;if(a.has(m))continue;let A=r[m];if(A.connectedPadSides?.includes(e))continue;if((A.route?.length??0)===2&&!d&&!h)continue;let g=KVt({currentRoutes:r,routeIndex:m,side:e,boundary:n,margin:o,moveAmount:u,geometryCache:c,fixedCopperGuard:l});if(g){if(g.rejected){let f=yCr(A,g.movableIndexes,n,e,o);if(f){let y=KVt({currentRoutes:r,routeIndex:m,side:e,moveSide:f,boundary:n,margin:o,moveAmount:u,geometryCache:c,fixedCopperGuard:l});y&&!y.rejected&&(g=y)}}if(s&&i.push(uCr({routes:J9(r),candidateRoutes:g.candidateRoutes,candidateRouteIndexes:g.candidateRouteIndexes,originalRoutes:g.rejected?void 0:Array.from(g.candidateRouteIndexes).map((f)=>VS(r[f])),boundary:n,side:e,margin:o,rejected:g.rejected,rejectionReason:g.rejectionReason})),!g.rejected){r.splice(0,r.length,...g.candidateRoutes);for(let f of g.movedTwoPointRouteIndexes)a.add(f);p+=1}_.add(m)}}return{movesAccepted:p}},Lae=(e,t,n,o)=>$$(e,t,n,o),Hae=(e,t,n,o)=>{switch(n){case"left":return{...e,x:Math.min(t.minX+o,t.maxX)};case"right":return{...e,x:Math.max(t.maxX-o,t.minX)};case"top":return{...e,y:Math.max(t.maxY-o,t.minY)};case"bottom":return{...e,y:Math.min(t.minY+o,t.maxY)}}},$Vt=(e)=>`${e.routeIndexes[0]}:${e.layers[0]}:${e.routeIndexes[1]}:${e.layers[1]}`,qVt=(e)=>{if(!e)return[];let t=[e.connectionName,e.rootConnectionName].filter((n)=>Boolean(n));return Array.from(new Set(t))},JVt=(e,t)=>{let n=qVt(e),o=qVt(t);return n.length!==0&&o.length!==0&&n.some((r)=>o.includes(r))},ZK=(e,t,n)=>e?K$([e],t,n).length:0,ZVt=(e,t,n,o)=>{let r=new Set(Ky(e,new Set([n]),o).map(EQ));return Ky(t,new Set([n]),o).some((i)=>!r.has(EQ(i)))},eYt=(e,t,n)=>K$(e,t,n).length,tYt=(e)=>{if(!e)return[];let t=[e.connectionName,e.rootConnectionName].filter((n)=>Boolean(n));return Array.from(new Set(t))},nYt=(e,t)=>Ky(e,new Set(e.map((n,o)=>o)),wq,t).filter((n)=>!(n.layers[0]==="via"&&n.layers[1]==="via"||((o,r)=>{let i=tYt(o),s=tYt(r);return i.length!==0&&s.length!==0&&i.some((a)=>s.includes(a))})(e[n.routeIndexes[0]],e[n.routeIndexes[1]]))).length,CCr=(e)=>{let t=Bq;return[...t.slice(e%t.length),...t.slice(0,e%t.length)]},bCr=(e,t,n=!1,o=!0)=>{let r=E$e(e?.nodeWithPortPoints),i=(e?.nodeHdRoutes??[]).map(iCr),s=Math.max(t??0.4,0.05),a=new aCr(e?.fixedHdRoutes??[],Math.min(s/2,wq),e?.clearanceObstacles??e?.adjacentObstacles),c=r&&o?((_,p)=>_.map((m)=>{let A=m.route??[],g=!1,f=A.map((y)=>{let{x,y:C}=y;return x<p.minX?x=p.minX:x>p.maxX&&(x=p.maxX),C<p.minY?C=p.minY:C>p.maxY&&(C=p.maxY),x===y.x&&C===y.y?y:(g=!0,{...y,x,y:C})});return g?{...m,route:f}:m}))(hCr(J9(i),r),r):J9(i),l=o&&a.allows(i,c,i.keys())?c:i,h=J9(l);if(!r)return{boundary:null,baseRoutes:l,repairedRoutes:h,margin:s,frames:[{title:"HighDensityRepair02 Missing Boundary",routes:h}]};let d=n?[cCr(J9(h),s)]:[];if(o){let _=new WeakMap,p=eYt(h,r,s);for(let g=0;g<1;g+=1){let f=new Set,y=0;for(let C of CCr(g)){let{movesAccepted:b}=xCr({side:C,sample:e,boundary:r,frames:d,margin:s,repairedRoutes:h,captureProgressFrames:n,lockedTwoPointRoutes:f,geometryCache:_,fixedCopperGuard:a,allowTwoPointWithoutObstacle:g>=1});y+=b}let x=eYt(h,r,s);if(y===0)break;if(x===0)break;if(x>=p)break;p=x}let m=J9(h),A=nYt(h,_);(({routes:g,boundary:f,margin:y,geometryCache:x,fixedCopperGuard:C})=>{let b=K$(g,f,y);if(b.length===0)return{movesAccepted:0};let I=new Map;for(let D of b){let L=I.get(D.routeIndex)??new Set;for(let H of D.touchedSides)L.add(H);I.set(D.routeIndex,L)}let v=[0.000008,0.01,y/4,y/2,y+0.000008],P=0,M=(D,L,H)=>{let V=L.route??[];if(V.length<2)return!1;let O={...L,route:jCe(V)};if((O.route?.length??0)<2)return!1;let U=g.slice();if(U[D]=O,C&&!C.allows(g,U,[D]))return!1;if(ZK(U[D],f,y)>=H)return!1;let j=(X)=>JVt(g[X.routeIndexes[0]],g[X.routeIndexes[1]]),Y=new Set(Ky(g,new Set([D]),0,x).filter((X)=>!j(X)).map($Vt));return!Ky(U,new Set([D]),0,x).filter((X)=>!j(X)).some((X)=>!Y.has($Vt(X)))&&!(w$e({currentRoutes:g,candidateRoutes:U,candidateRouteIndexes:new Set([D]),maximumAllowedClearance:Math.min(y/2,wq)}).filter((X)=>!JVt(g[X.routeIndexes[0]],g[X.routeIndexes[1]])).length>0||(g[D]=O,0))},B=(D,L,H,V)=>{if(L.length===0)return!1;for(let O of v){let U=g[D],j=VS(U),Y=j.route??[],X=!1;for(let K of B$e(U,[],L)){let J=Y[K];J&&(Y[K]=Hae(J,f,H,O),X=!0)}if(!X)return!1;if(M(D,j,V))return!0}return!1},T=(D,L)=>{let H=[];return L==="top"||L==="bottom"?(Math.abs(D.x-f.minX)<=fr&&H.push("left"),Math.abs(D.x-f.maxX)<=fr&&H.push("right")):(Math.abs(D.y-f.minY)<=fr&&H.push("bottom"),Math.abs(D.y-f.maxY)<=fr&&H.push("top")),H},N=(D,L,H)=>{let V=g[D],O=V.route??[];if(O.length!==2)return!1;let[U,j]=O;if(!Lae(U,f,L,y))return!1;if(!Lae(j,f,L,y))return!1;let Y=T(U,L),X=T(j,L);for(let K of v){let J=Hae(U,f,L,K),ee=Hae(j,f,L,K);for(let ne of Y)J=Hae(J,f,ne,K);for(let ne of X)ee=Hae(ee,f,ne,K);let se={...V,route:[U,J,ee,j]};if(M(D,se,H))return!0}return!1};for(let[D,L]of I)if(g[D])for(let H of L){let V=!0;for(;V;){V=!1;let O=g[D].route??[];if(O.length===2){let J=ZK(g[D],f,y);J>0&&N(D,H,J)&&(P+=1);break}if(O.length<3)break;let U=ZK(g[D],f,y);if(U===0)break;let j=[];for(let J=1;J<O.length-1;J+=1){let ee=O[J];ee&&Lae(ee,f,H,y)&&j.push(J)}if(j.length===0)break;if(B(D,j,H,U)){P+=1,V=!0;continue}let Y=!1,X=U,K=0;for(;K<j.length;){let J=K;for(;J+1<j.length&&j[J+1]===j[J]+1;)J+=1;B(D,j.slice(K,J+1),H,X)&&(P+=1,Y=!0,X=ZK(g[D],f,y)),K=J+1}if(!Y){let J=g[D].route??[],ee=U;for(let se=1;se<J.length-1;se+=1){let ne=J[se];ne&&Lae(ne,f,H,y)&&B(D,[se],H,ee)&&(P+=1,Y=!0,ee=ZK(g[D],f,y))}}Y&&(V=!0)}}for(let[D,L]of I){let H=g[D];if(!H)continue;let V=H.route??[];if(V.length<=2)continue;let O=ZK(g[D],f,y);if(O!==0)for(let U of L){if(!V.every((K)=>Lae(K,f,U,y)))continue;let j=V[0]?.z;if(!V.every((K)=>K.z===j))continue;let Y={...H,route:[V[0],V[V.length-1]]},X=g[D];g[D]=Y,N(D,U,O)?P+=1:g[D]=X;break}}})({routes:m,boundary:r,margin:s,geometryCache:_,fixedCopperGuard:a}),nYt(m,_)<=A&&h.splice(0,h.length,...m),(({routes:g,boundary:f,clearanceMargin:y,fixedCopperGuard:x})=>{for(let C=0;C<g.length;C+=1){let b=g[C];if((b.route??[]).length<=2)continue;let I=y,v=Math.max(f.width/2-fr,0),P=Math.max(f.height/2-fr,0),M=Math.min(I,v),B=Math.min(I,P),T=b.connectedPadSides??[],N=f.minX+(T.includes("left")?0:M),D=f.maxX-(T.includes("right")?0:M),L=f.minY+(T.includes("bottom")?0:B),H=f.maxY-(T.includes("top")?0:B),V=VS(b),O=V.route??[],U=!1;for(let J=1;J<O.length-1;J+=1){let ee=O[J];if(!ee)continue;let se=Math.min(Math.max(ee.x,N),D),ne=Math.min(Math.max(ee.y,L),H);(Math.abs(se-ee.x)>fr||Math.abs(ne-ee.y)>fr)&&(ee.x=se,ee.y=ne,U=!0)}if(!U)continue;if(V.route=jCe(O),(V.route?.length??0)<2)continue;let j=J9(g);j[C]=V;let Y=ZVt(g,j,C,0),X=ZVt(g,j,C,y),K=w$e({currentRoutes:g,candidateRoutes:j,candidateRouteIndexes:new Set([C]),maximumAllowedClearance:y}).length>0;Y||X||K||!x.allows(g,j,[C])||(g[C]=V)}})({routes:h,boundary:r,clearanceMargin:s,fixedCopperGuard:a})}let u=(({routes:_,fixedRoutes:p=[],boundary:m,fixedCopperGuard:A,adjacentObstacles:g=[],clearanceObstacles:f=g,clearance:y=0.1,boundaryMargin:x=0.2,maxCandidates:C})=>{let b=_,I=new WeakMap,v=new qsn,P=new WeakMap,M=new WeakMap,B=new WeakMap,T=new WeakMap,N=WCe(b,y,f,p,void 0,I,v,M,T),D=C??Math.max(256,96*N.conflicts.length),L={routes:_,initialConflictCount:N.conflicts.length,finalConflictCount:N.conflicts.length,candidateCount:0};for(;N.conflicts.length&&L.candidateCount<D;){let H=!1,V=new Map(N.conflicts.map((O)=>[O.key,O.penetration]));for(let O of N.conflicts){for(let[U,j]of[[O.firstRoute,O.first],[O.secondRoute,O.second]]){if(U<0||U>=b.length)continue;let Y=b[U],X=new Set([Y.connectionName,Y.rootConnectionName].filter(Boolean)),K=f.filter((re)=>!re.connectedTo?.some((Z)=>X.has(Z))),J=I.get(Y),ee=B.get(Y);ee===void 0&&(ee=K$([Y],m,x).length,B.set(Y,ee));let se=P.get(Y);se||(se=new Map,P.set(Y,se));let ne=K.map((re)=>{let Z=se.get(re);if(Z!==void 0)return Z;let te=Math.min(...J.filter((ie)=>!re.zLayers||re.zLayers.some((le)=>le>=ie.minZ&&le<=ie.maxZ)).map((ie)=>XCe(ie,re)));return se.set(re,te),te});for(let re of[1.01,2,4]){let Z=Math.max(0.01,O.penetration*re);for(let[te,ie]of[[1,0],[-1,0],[0,1],[0,-1],[Math.SQRT1_2,Math.SQRT1_2],[-Math.SQRT1_2,Math.SQRT1_2],[Math.SQRT1_2,-Math.SQRT1_2],[-Math.SQRT1_2,-Math.SQRT1_2]]){if(L.candidateCount>=D)break;L.candidateCount++;let le=sCr(Y,j,te*Z,ie*Z,m);if(!le)continue;if(K$([le],m,x).length>ee)continue;let ue=[...b];ue[U]=le;let de=WCe(ue,y,f,p,{evaluation:N,changedRoute:U,routes:b},I,v,M,T);if(de.conflicts.length>N.conflicts.length||de.score>=N.score-0.000000000001)continue;if(de.conflicts.some((Ae)=>Ae.penetration>(V.get(Ae.key)??0)+fr))continue;if(!A.allows(b,ue,[U],!1))continue;let me=I.get(le);if(!K.some((Ae,xe)=>Math.min(...me.filter((Me)=>!Ae.zLayers||Ae.zLayers.some((Re)=>Re>=Me.minZ&&Re<=Me.maxZ)).map((Me)=>XCe(Me,Ae)))<Math.min(y,ne[xe])-fr)){b=ue,N=de,H=!0;break}}if(H||L.candidateCount>=D)break}if(H||L.candidateCount>=D)break}if(H||L.candidateCount>=D)break}if(!H)break}return{...L,routes:b,finalConflictCount:N.conflicts.length}})({fixedRoutes:e?.fixedHdRoutes,routes:h,boundary:r,fixedCopperGuard:a,adjacentObstacles:e?.adjacentObstacles,clearanceObstacles:e?.clearanceObstacles,boundaryMargin:s});return h.splice(0,h.length,...u.routes),d.push(((_,p,m)=>({title:`HighDensityRepair02 Final State (margin=${m})`,routes:_,originalRoutes:p}))(J9(h),J9(l),s)),{boundary:r,baseRoutes:l,repairedRoutes:h,frames:d,margin:s,clearanceRepairStats:{nodeClearanceInitialConflictCount:u.initialConflictCount,nodeClearanceFinalConflictCount:u.finalConflictCount,nodeClearanceCandidateCount:u.candidateCount}}},ICr=class extends Da{constructor(e={}){super(),this.params=e,this.showBoundryViolationMarkers=e.showBoundryViolationMarkers??!1}params;frames=[];traceViolationCounts=new WeakMap;clearanceRepairStats={};currentFrameIndex=0;showBoundryViolationMarkers;repairedRoutes=[];_setup(){this.buildFrames();let e=this.getCurrentBoundryViolationCount(),t=this.getCurrentTraceViolationCount();this.stats={...this.clearanceRepairStats,boundryViolationCount:e,traceViolationCount:t,margin:this.params.margin??0.4,frames:this.frames.length,currentFrame:this.currentFrameIndex}}_step(){if(this.frames.length<=1){let n=this.getCurrentBoundryViolationCount(),o=this.getCurrentTraceViolationCount();return this.showBoundryViolationMarkers=!0,this.stats={...this.stats,boundryViolationCount:n,traceViolationCount:o},void(this.solved=!0)}this.currentFrameIndex<this.frames.length-1&&(this.currentFrameIndex+=1);let e=this.getCurrentBoundryViolationCount(),t=this.getCurrentTraceViolationCount();this.stats={...this.clearanceRepairStats,boundryViolationCount:e,traceViolationCount:t,margin:this.params.margin??0.4,frames:this.frames.length,currentFrame:this.currentFrameIndex,title:this.frames[this.currentFrameIndex]?.title},this.currentFrameIndex>=this.frames.length-1&&(this.showBoundryViolationMarkers=!0,this.solved=!0)}getConstructorParams(){return[this.params]}getOutput(){let e=this.getCurrentTraceViolationCount();return{...this.clearanceRepairStats,margin:this.params.margin??0.4,repairedRoutes:this.repairedRoutes,frameCount:this.frames.length,traceViolationCount:e}}setShowBoundryViolationMarkers(e){this.showBoundryViolationMarkers=e}buildFrames(){let e=bCr(this.params.sample,this.params.margin,this.params.captureProgressFrames??!1,this.params.repairBoundaryDiagonals??!0);this.clearanceRepairStats=e.clearanceRepairStats??{},this.frames=e.frames,this.repairedRoutes=e.repairedRoutes}getCurrentFrame(){let e=this.params.sample;return this.frames[this.currentFrameIndex]??{title:"HighDensityRepair02",routes:J9(e?.nodeHdRoutes??[])}}getBoundryViolationsForFrame(e){let t=E$e(this.params.sample?.nodeWithPortPoints);return t?K$(e.routes,t,this.params.margin??0.4):[]}getCurrentBoundryViolationCount(){return this.getBoundryViolationsForFrame(this.getCurrentFrame()).length}getRouteNetNames(e){if(!e)return[];let t=[e.connectionName,e.rootConnectionName].filter((n)=>Boolean(n));return Array.from(new Set(t))}areRoutesSameNet(e,t){let n=this.getRouteNetNames(e),o=this.getRouteNetNames(t);return n.length!==0&&o.length!==0&&n.some((r)=>o.includes(r))}getCurrentTraceViolationCount(){let e=this.getCurrentFrame(),t=this.traceViolationCounts.get(e);if(t!==void 0)return t;let n=e.routes,o=new Set(n.map((i,s)=>s)),r=Ky(n,o,wq).filter((i)=>!(i.layers[0]==="via"&&i.layers[1]==="via"||this.areRoutesSameNet(n[i.routeIndexes[0]],n[i.routeIndexes[1]]))).length;return this.traceViolationCounts.set(e,r),r}visualize(){let e=this.params.sample,t=e?.nodeWithPortPoints,n=e?.adjacentObstacles??[],o=this.getCurrentFrame(),r=E$e(t),i=r&&t?.capacityMeshNodeId?[{center:r.center,width:r.width,height:r.height,stroke:"#1d4ed8",fill:"rgba(29, 78, 216, 0.08)",label:t.capacityMeshNodeId}]:r?[{center:r.center,width:r.width,height:r.height,stroke:"#1d4ed8",fill:"rgba(29, 78, 216, 0.08)",label:"capacity-node"}]:[],s=n.filter((u)=>u.center&&u.width&&u.height).map((u,_)=>({center:u.center,width:u.width,height:u.height,stroke:u.type==="oval"?"#a855f7":"#dc2626",fill:u.type==="oval"?"rgba(168, 85, 247, 0.12)":"rgba(220, 38, 38, 0.08)",label:u.type?`obstacle:${u.type}:${_}`:`obstacle:${_}`})),a=this.showBoundryViolationMarkers&&r?this.getBoundryViolationsForFrame(o).map((u)=>{let _=u.end.x-u.start.x,p=u.end.y-u.start.y,m=Math.max(Math.hypot(_,p),0.2),A=Math.abs(_)>=Math.abs(p);return{center:{x:(u.start.x+u.end.x)/2,y:(u.start.y+u.end.y)/2},width:A?m:0.18,height:A?0.18:m,stroke:"#b45309",fill:"rgba(250, 204, 21, 0.45)",label:`boundry-violation:${u.routeIndex}:${u.segmentIndex}`}}):[],c=this.showBoundryViolationMarkers?J3r(o.routes,wq):[],l=[...(t?.portPoints??[]).map((u)=>({x:u.x,y:u.y,color:"#0f766e",label:u.connectionName??u.portPointId??"port-point"})),...o.routes.flatMap((u)=>u.route??[]).map((u)=>({x:u.x,y:u.y,color:nB(u)==="bottom"?Ksn:"#0ea5e9",label:""})),...o.overlayPoints??[]],h=[...(o.originalRoutes??[]).flatMap((u)=>M$e(u).map((_)=>({..._,strokeColor:"#111111",strokeWidth:Math.max(0.6*_.strokeWidth,0.05),label:`original:${_.label}`}))),...o.routes.filter((u)=>(u.route?.length??0)>=2).flatMap((u)=>M$e(u)),...o.overlayLines??[]],d=o.routes.flatMap((u)=>(u.vias??[]).map((_)=>({center:{x:_.x,y:_.y},radius:(_.diameter??u.viaDiameter??0.3)/2,stroke:"#7c3aed",fill:"rgba(124, 58, 237, 0.2)",label:u.connectionName?`via:${u.connectionName}`:"via"})));return d.push(...c),{coordinateSystem:"cartesian",title:o.title,rects:[...i,...s,...o.overlayRects??[],...a],points:l,lines:h,circles:d,arrows:o.overlayArrows}}},vCr=(e,t,n,o)=>{let i=new Set;for(let s of[t.route[0],t.route.at(-1)]){if(!s)continue;n.some((a)=>a.__zLayers.includes(s.z)&&Math.abs(s.x-a.center.x)<=a.width/2+0.001&&Math.abs(s.y-a.center.y)<=a.height/2+0.001&&_B(a,t,o))&&(Math.abs(s.x-(e.center.x-e.width/2))<=0.001&&i.add("left"),Math.abs(s.x-(e.center.x+e.width/2))<=0.001&&i.add("right"),Math.abs(s.y-(e.center.y-e.height/2))<=0.001&&i.add("bottom"),Math.abs(s.y-(e.center.y+e.height/2))<=0.001&&i.add("top"))}return[...i]},ean=(e,t)=>e.minX<=t.maxX&&e.maxX>=t.minX&&e.minY<=t.maxY&&e.maxY>=t.minY,WZe=(e,t=0)=>({minX:e.center.x-e.width/2-t,maxX:e.center.x+e.width/2+t,minY:e.center.y-e.height/2-t,maxY:e.center.y+e.height/2+t}),tan=(e)=>({minX:e.center.x-e.width/2,maxX:e.center.x+e.width/2,minY:e.center.y-e.height/2,maxY:e.center.y+e.height/2}),SCr=(e,t,n=0)=>{let o=WZe(t,n);return e.x>=o.minX&&e.x<=o.maxX&&e.y>=o.minY&&e.y<=o.maxY},PCr=(e,t,n)=>e.route.length>0&&t.some((o)=>((r)=>(r.__zLayers?.length??r.layers?.length??0)>1)(o)&&_B(o,e,n)&&e.route.every((r)=>((i,s)=>{let a=s.width/2,c=s.height/2;return Math.abs(i.x-s.center.x)<=a+0.001&&Math.abs(i.y-s.center.y)<=c+0.001})(r,o))),ECr=(e,t,n)=>{if(e.regionId){let r=t.findIndex((i)=>i.capacityMeshNodeId===e.regionId);if(r!==-1)return r}let o=[...e.route.map(({x:r,y:i})=>({x:r,y:i})),...e.vias.map(({x:r,y:i})=>({x:r,y:i}))];for(let r=0;r<t.length;r++){let i=t[r];if(o.every((s)=>SCr(s,i,n)))return r}return-1},MCr=(e,t)=>({connectionName:e.connectionName??t.connectionName,rootConnectionName:t.rootConnectionName,...t.startPcbPortId?{startPcbPortId:t.startPcbPortId}:{},...t.endPcbPortId?{endPcbPortId:t.endPcbPortId}:{},regionId:e.capacityMeshNodeId??t.regionId,traceThickness:t.traceThickness,viaDiameter:e.viaDiameter??t.viaDiameter,route:e.route?.map((n)=>({x:n.x,y:n.y,z:n.z??0}))??t.route,vias:e.vias?.map((n)=>({x:n.x,y:n.y}))??t.vias,jumpers:t.jumpers}),wCr=(e,t,n,o,r)=>{let i=WZe(e,n);return t.search(i).filter((s)=>ean(i,tan(s))).filter((s)=>!r||!o.some((a)=>_B(s,a,r))).map((s)=>({type:s.type,center:s.center,width:s.width,height:s.height}))},qle=class extends ei{repairMargin;minimumTraceWidth;sampleEntries;originalHdRoutes;originalNodeWithPortPoints;originalObstacles;obstacleSHI;colorMap;connMap;repairedRoutesByIndex=new Map;activeSampleIndex=0;activeSubSolver=null;latestVisualization={};constructor(e){super(),this.repairMargin=e.repairMargin??0.2,this.minimumTraceWidth=e.minimumTraceWidth,this.originalHdRoutes=e.hdRoutes,this.originalNodeWithPortPoints=e.nodeWithPortPoints,this.originalObstacles=e.obstacles,this.obstacleSHI=new $be("flatbush",this.originalObstacles),this.colorMap=e.colorMap??{},this.connMap=e.connMap;let t=new Map;for(let s=0;s<e.hdRoutes.length;s++){if(PCr(e.hdRoutes[s],e.obstacles,e.connMap))continue;let a=ECr(e.hdRoutes[s],e.nodeWithPortPoints,this.repairMargin);if(a===-1)continue;let c=t.get(a)??[];c.push(s),t.set(a,c)}let n=kq(e.obstacles,Math.max(2,...e.nodeWithPortPoints.flatMap((s)=>s.availableZ?.map((a)=>a+1)??[]))),o=e.hdRoutes.map((s)=>((a,c,l)=>({capacityMeshNodeId:a.regionId,connectionName:a.connectionName,rootConnectionName:c?.getNetConnectedToId(a.connectionName)??a.rootConnectionName,route:a.route.map((h)=>({x:h.x,y:h.y,z:h.z})),traceThickness:Math.max(a.traceThickness,l??a.traceThickness),vias:a.vias.map((h)=>({x:h.x,y:h.y,diameter:a.viaDiameter})),viaDiameter:a.viaDiameter}))(s,e.connMap,e.minimumTraceWidth)),r=new Jrn(e.hdRoutes.length);for(let[s,a]of e.hdRoutes.entries()){let c=[...a.route,...a.vias];if(c.length===0)throw Error(`High density repair route "${a.connectionName}" has no points`);let l=Math.max(o[s].traceThickness,a.viaDiameter)/2;r.insert({routeIndex:s},Math.min(...c.map((h)=>h.x))-l,Math.min(...c.map((h)=>h.y))-l,Math.max(...c.map((h)=>h.x))+l,Math.max(...c.map((h)=>h.y))+l)}e.hdRoutes.length>0&&r.finish();let i=Array.from(t.entries()).map(([s,a])=>{let c=e.nodeWithPortPoints[s],l=Math.max(...a.map((u)=>Math.max(o[u].traceThickness,e.hdRoutes[u].viaDiameter)/2)),h=WZe(c,Math.max(this.repairMargin,l+0.1)),d=new Set(a);return{node:c,routeIndexes:a,sample:{nodeWithPortPoints:{capacityMeshNodeId:c.capacityMeshNodeId,center:c.center,width:c.width,height:c.height,portPoints:c.portPoints.map((u)=>({x:u.x,y:u.y,z:u.z,connectionName:u.connectionName,portPointId:u.portPointId,prevPortPointId:u.prevPortPointId,nextPortPointId:u.nextPortPointId}))},nodeHdRoutes:a.map((u)=>({...o[u],...e.connMap?{connectedPadSides:vCr(c,e.hdRoutes[u],n,e.connMap)}:{}})),fixedHdRoutes:r.search(h.minX,h.minY,h.maxX,h.maxY).filter(({routeIndex:u})=>!d.has(u)).map(({routeIndex:u})=>o[u]),clearanceObstacles:n.filter((u)=>ean(h,tan(u))).map((u)=>({type:u.type,center:u.center,width:u.width,height:u.height,zLayers:u.__zLayers,connectedTo:[...new Set(u.connectedTo.flatMap((_)=>{let p=e.connMap?.getNetConnectedToId(_);return p?[_,p]:[_]}))]})),adjacentObstacles:wCr(c,this.obstacleSHI,this.repairMargin,a.map((u)=>e.hdRoutes[u]),e.connMap)}}});this.sampleEntries=i,this.MAX_ITERATIONS=Math.max(1000*this.sampleEntries.length,1e5),this.stats={sampleCount:this.sampleEntries.length,repairedNodeCount:0,repairedRouteCount:0}}getSolverName(){return"Pipeline4HighDensityRepairSolver"}getConstructorParams(){return[{nodeWithPortPoints:this.sampleEntries.map((e)=>e.node),hdRoutes:this.originalHdRoutes,obstacles:this.originalObstacles,repairMargin:this.repairMargin,minimumTraceWidth:this.minimumTraceWidth,colorMap:this.colorMap,connMap:this.connMap}]}_step(){let e=this.sampleEntries[this.activeSampleIndex];if(e){if(this.activeSubSolver){if(this.activeSubSolver.step(),this.latestVisualization=this.activeSubSolver.visualize(),this.activeSubSolver.failed)return this.failed=!0,this.error=this.activeSubSolver.error??`High density repair failed for node ${e.node.capacityMeshNodeId}`,void(this.activeSubSolver=null);if(!this.activeSubSolver.solved)return;let t=this.activeSubSolver.getOutput().repairedRoutes,n={nodeClearanceInitialConflictCount:Number(this.stats.nodeClearanceInitialConflictCount??0)+Number(this.activeSubSolver.stats.nodeClearanceInitialConflictCount??0),nodeClearanceFinalConflictCount:Number(this.stats.nodeClearanceFinalConflictCount??0)+Number(this.activeSubSolver.stats.nodeClearanceFinalConflictCount??0),nodeClearanceCandidateCount:Number(this.stats.nodeClearanceCandidateCount??0)+Number(this.activeSubSolver.stats.nodeClearanceCandidateCount??0)};for(let o=0;o<e.routeIndexes.length;o++){let r=e.routeIndexes[o],i=this.originalHdRoutes[r],s=t[o];this.repairedRoutesByIndex.set(r,s?MCr(s,i):i)}return this.activeSubSolver=null,this.activeSampleIndex+=1,this.stats={...n,sampleCount:this.sampleEntries.length,repairedNodeCount:this.activeSampleIndex,repairedRouteCount:this.repairedRoutesByIndex.size},void(this.activeSampleIndex>=this.sampleEntries.length&&(this.solved=!0))}this.activeSubSolver=new ICr({repairBoundaryDiagonals:!1,sample:e.sample,margin:this.repairMargin}),this.latestVisualization=this.activeSubSolver.visualize()}else this.solved=!0}getOutput(){return this.originalHdRoutes.map((e,t)=>this.repairedRoutesByIndex.get(t)??e)}visualize(){if(this.activeSubSolver)return this.activeSubSolver.visualize();if(!this.solved)return this.latestVisualization;let e=[],t=[];for(let n of this.getOutput()){let o=this.colorMap[n.connectionName]??"#0ea5e9";for(let r=0;r<n.route.length-1;r++){let i=n.route[r],s=n.route[r+1];i.z===s.z&&e.push({points:[{x:i.x,y:i.y},{x:s.x,y:s.y}],strokeColor:i.z===0?o:zi(o,0.5),strokeWidth:n.traceThickness,layer:`z${i.z}`,strokeDash:i.z!==0?[0.1,0.3]:void 0})}for(let r of n.vias)t.push({center:{x:r.x,y:r.y},radius:n.viaDiameter/2,stroke:o,fill:"rgba(14,165,233,0.12)"})}return{title:"Pipeline4 High Density Repair",lines:e,circles:t}}},Fae=0.000001,oYt=({startGap:e,endGap:t,segmentGap:n,requiredGap:o})=>{let r=e<o&&t>=o-Fae&&n>=e-Fae,i=t<o&&e>=o-Fae&&n>=t-Fae,s=e<o&&t<o&&n>=Math.min(e,t)-Fae;return r||i||s},BCr=class{minClearance;rootsByConnection=new Map;sameNetCache=new Map;segments=[];vias=[];segmentIndexesByLayer;viaIndex;constructor({hdRoutes:e,minClearance:t=0.1}){this.minClearance=t;for(let n of e)this.addRoute(n);this.buildSpatialIndexes()}addRoute(e){let t=this.rootsByConnection.get(e.connectionName)??new Set;t.add(e.rootConnectionName??e.connectionName),this.rootsByConnection.set(e.connectionName,t),this.sameNetCache.clear();for(let n=0;n<e.route.length-1;n+=1){let o=e.route[n],r=e.route[n+1];if(o.z!==r.z)continue;if(o.insideJumperPad&&r.insideJumperPad)continue;let i={connectionName:e.connectionName,start:o,end:r,traceThickness:e.traceThickness};this.segments.push(i),this.insertSegmentIntoSpatialIndex(i)}for(let n of e.vias){let o={connectionName:e.connectionName,x:n.x,y:n.y,diameter:e.viaDiameter};this.vias.push(o),this.insertViaIntoSpatialIndex(o)}}insertSegmentIntoSpatialIndex(e){if(!this.segmentIndexesByLayer)return;let t=this.segmentIndexesByLayer.get(e.start.z);t||(t=new wce,this.segmentIndexesByLayer.set(e.start.z,t));let n=e.traceThickness/2;t.insert(e,Math.min(e.start.x,e.end.x)-n,Math.min(e.start.y,e.end.y)-n,Math.max(e.start.x,e.end.x)+n,Math.max(e.start.y,e.end.y)+n)}insertViaIntoSpatialIndex(e){if(!this.viaIndex)return;let t=e.diameter/2;this.viaIndex.insert(e,e.x-t,e.y-t,e.x+t,e.y+t)}buildSpatialIndexes(){this.segmentIndexesByLayer=new Map;let e=new Map;for(let t of this.segments){let n=e.get(t.start.z);n?n.push(t):e.set(t.start.z,[t])}for(let[t,n]of e){let o=new wce;o.bulkLoad(n.map((r)=>{let i=r.traceThickness/2;return{item:r,minX:Math.min(r.start.x,r.end.x)-i,minY:Math.min(r.start.y,r.end.y)-i,maxX:Math.max(r.start.x,r.end.x)+i,maxY:Math.max(r.start.y,r.end.y)+i}})),this.segmentIndexesByLayer.set(t,o)}this.viaIndex=new wce,this.viaIndex.bulkLoad(this.vias.map((t)=>{let n=t.diameter/2;return{item:t,minX:t.x-n,minY:t.y-n,maxX:t.x+n,maxY:t.y+n}}))}areSameNet(e,t){if(e===t)return!0;let n=this.sameNetCache.get(e)?.get(t);if(n!==void 0)return n;let o=this.rootsByConnection.get(e),r=this.rootsByConnection.get(t),i=!1;if(o&&r){for(let a of o)if(r.has(a)){i=!0;break}}let s=this.sameNetCache.get(e);return s||(s=new Map,this.sameNetCache.set(e,s)),s.set(t,i),i}isSegmentClear({connectionName:e,start:t,end:n,traceThickness:o}){let r=o/2,i=this.minClearance+r,s=Math.min(t.x,n.x)-i,a=Math.min(t.y,n.y)-i,c=Math.max(t.x,n.x)+i,l=Math.max(t.y,n.y)+i,h=this.segmentIndexesByLayer?.get(t.z)?.search(s,a,c,l)??[];for(let u of h){if(this.areSameNet(e,u.connectionName))continue;let _=this.minClearance+r+u.traceThickness/2,p=MV(t,n,u.start,u.end);if(p<_&&!oYt({startGap:xc(t,u.start,u.end),endGap:xc(n,u.start,u.end),segmentGap:p,requiredGap:_}))return!1}let d=this.viaIndex?.search(s,a,c,l)??[];for(let u of d){if(this.areSameNet(e,u.connectionName))continue;let _=this.minClearance+r+u.diameter/2,p=xc(u,t,n);if(p<_&&!oYt({startGap:Math.hypot(t.x-u.x,t.y-u.y),endGap:Math.hypot(n.x-u.x,n.y-u.y),segmentGap:p,requiredGap:_}))return!1}return!0}},y1=0.000000001,XZe=1.25,wQ=(e,t)=>e<t?-1:e>t?1:0,XS=(e,t)=>wQ(e.z,t.z)||wQ(e.x,t.x)||wQ(e.y,t.y),rYt=(e)=>`${e.z.toFixed(6)}:${e.x.toFixed(6)}:${e.y.toFixed(6)}`,iYt=(e)=>{let t=e.route.map(rYt).join("|"),n=[...e.route].reverse().map(rYt).join("|");return t<=n?t:n},yle=(e,t)=>{let n=e.connectionName.localeCompare(t.connectionName);if(n!==0)return n;let o=(e.rootConnectionName??"").localeCompare(t.rootConnectionName??"");if(o!==0)return o;let r=iYt(e).localeCompare(iYt(t));return r!==0?r:wQ(e.traceThickness,t.traceThickness)||wQ(e.viaDiameter,t.viaDiameter)||wQ(e.route.length,t.route.length)||wQ(e.vias.length,t.vias.length)||wQ(e.jumpers?.length??0,t.jumpers?.length??0)},sYt=1e5,gQ=0.001,aYt=1.000000001,sje=class extends ei{getSolverName(){return"SingleHighDensityRouteStitchSolver3"}mergedHdRoute;remainingHdRoutes;start;end;colorMap;allowedLayerTransitionPointKeys;isStitchSegmentClear;stitchClearanceMode;isPlanarStitchClear(e,t){return this.isStitchSegmentClear({connectionName:this.mergedHdRoute.connectionName,start:e,end:t,traceThickness:this.mergedHdRoute.traceThickness})}constructor(e){super();let t=[...e.hdRoutes].sort(yle);if(this.remainingHdRoutes=t,this.colorMap=e.colorMap??{},this.allowedLayerTransitionPointKeys=e.allowedLayerTransitionPointKeys,this.isStitchSegmentClear=e.isStitchSegmentClear,this.stitchClearanceMode=e.stitchClearanceMode,t.length===0){this.start=e.start,this.end=e.end;let _=e.defaultTraceThickness??0.15,p=[{x:e.start.x,y:e.start.y,z:e.start.z}],m=[];if(e.start.z!==e.end.z){if(e.allowedLayerTransitionPointKeys&&!e.allowedLayerTransitionPointKeys.has(E$(e.start)))return this.failed=!0,void(this.error=`Layer transition at ${E$(e.start)} is not allowed`);p.push({x:e.start.x,y:e.start.y,z:e.end.z}),m.push({x:e.start.x,y:e.start.y})}let A=p[p.length-1],g={x:e.end.x,y:e.end.y,z:e.end.z},f={connectionName:e.connectionName,start:A,end:g,traceThickness:_};return kn(A,g)>gQ&&!this.isStitchSegmentClear(f)&&this.stitchClearanceMode==="require_clear"?(this.failed=!0,void(this.error=`Terminal stitch for "${e.connectionName}" violates copper clearance`)):(p.push(g),this.mergedHdRoute={connectionName:e.connectionName,...e.preserveTerminalPcbPortIds&&e.start.pcb_port_id?{startPcbPortId:e.start.pcb_port_id}:{},...e.preserveTerminalPcbPortIds&&e.end.pcb_port_id?{endPcbPortId:e.end.pcb_port_id}:{},rootConnectionName:t[0]?.rootConnectionName,route:p,vias:m,jumpers:[],viaDiameter:e.defaultViaDiameter??0.3,traceThickness:_},void(this.solved=!0))}let n=new Set((e.preserveTerminalPcbPortIds?[e.start.pcb_port_id,e.end.pcb_port_id]:[]).filter((_)=>_!==void 0));if(e.preserveTerminalPcbPortIds&&e.start.pcb_port_id&&e.start.pcb_port_id===e.end.pcb_port_id)throw Error(`SingleHighDensityRouteStitchSolver3 received duplicate PCB terminal "${e.start.pcb_port_id}" for "${e.connectionName}"`);let o=t.flatMap((_)=>[_.startPcbPortId,_.endPcbPortId]).filter((_)=>_!==void 0);if(n.size>0){for(let _ of o)if(!n.has(_))throw Error(`SingleHighDensityRouteStitchSolver3 found unknown PCB terminal "${_}" on "${e.connectionName}"`)}let r=1/0,i=t[0],s="start-to-end";for(let _ of t){let p=_.route[0],m=_.route[_.route.length-1],A=kn(e.start,p),g=kn(e.start,m),f=kn(e.end,p),y=kn(e.end,m),x=Math.min(A,g,f,y);(x<r-y1||Math.abs(x-r)<=y1&&yle(_,i)<0)&&(r=x,i=_,s=Math.min(f,y)<Math.min(A,g)-y1||Math.abs(Math.min(f,y)-Math.min(A,g))<=y1&&XS(e.end,e.start)<0?"end-to-start":"start-to-end")}s==="start-to-end"?(this.start=e.start,this.end=e.end):(this.start=e.end,this.end=e.start);let a=i.route[0],c=i.route[i.route.length-1],l=kn(this.start,a),h=kn(this.start,c),d=l<h-y1||Math.abs(l-h)<=y1&&XS(a,c)<=0?a:c,u=d===a?i.startPcbPortId:i.endPcbPortId;if(u&&this.start.pcb_port_id&&u!==this.start.pcb_port_id)throw Error(`SingleHighDensityRouteStitchSolver3 terminal identity disagrees with route orientation for "${e.connectionName}"`);this.mergedHdRoute={connectionName:e.connectionName,...e.preserveTerminalPcbPortIds&&this.start.pcb_port_id?{startPcbPortId:this.start.pcb_port_id}:{},...e.preserveTerminalPcbPortIds&&this.end.pcb_port_id?{endPcbPortId:this.end.pcb_port_id}:{},rootConnectionName:i.rootConnectionName,route:[{x:this.start.x,y:this.start.y,z:d.z}],vias:[],jumpers:[],viaDiameter:i.viaDiameter,traceThickness:i.traceThickness}}getDisjointedRoute(){for(let e of this.remainingHdRoutes)if([e.route[0],e.route[e.route.length-1]].some((t)=>!this.remainingHdRoutes.some((n)=>{if(n===e)return!1;return[n.route[0],n.route[n.route.length-1]].some((o)=>o.z===t.z&&kn(t,o)<0.001)})))return{firstRoute:e};return{firstRoute:this.remainingHdRoutes[0]}}_step(){let e=this.mergedHdRoute.route.at(-1),t=this.mergedHdRoute.endPcbPortId!==void 0&&e.z===this.end.z&&kn(e,this.end)<gQ;if(this.remainingHdRoutes.length===0||t){let l=this.mergedHdRoute.route[this.mergedHdRoute.route.length-1],h={...this.end,z:l.z},d=kn(l,h);if(d>gQ&&d<=XZe){if(!this.isPlanarStitchClear(l,h)&&this.stitchClearanceMode==="require_clear")return this.failed=!0,void(this.error=`Terminal stitch for "${this.mergedHdRoute.connectionName}" violates copper clearance`);this.mergedHdRoute.route.push({x:this.end.x,y:this.end.y,z:l.z})}return void(this.solved=!0)}let n=this.mergedHdRoute.route[this.mergedHdRoute.route.length-1],o=-1,r="first",i=1/0,s=!1;for(let l=0;l<this.remainingHdRoutes.length;l++){let h=this.remainingHdRoutes[l],d=h.route[0],u=h.route[h.route.length-1],_=kn(n,d),p=kn(n,u),m=1/0;if(n.z===d.z){if(_<gQ)m=_;else if(_<=1){let g=this.isPlanarStitchClear(n,d);if(g||this.stitchClearanceMode==="prefer_clear")m=sYt+(g?0:aYt)+_;else s=!0}}else _<gQ&&(!this.allowedLayerTransitionPointKeys||this.allowedLayerTransitionPointKeys.has(E$(d)))&&(m=1000+_);m<i&&(i=m,o=l,r="first");let A=1/0;if(n.z===u.z){if(p<gQ)A=p;else if(p<=1){let g=this.isPlanarStitchClear(n,u);if(g||this.stitchClearanceMode==="prefer_clear")A=sYt+(g?0:aYt)+p;else s=!0}}else p<gQ&&(!this.allowedLayerTransitionPointKeys||this.allowedLayerTransitionPointKeys.has(E$(u)))&&(A=1000+p);A<i&&(i=A,o=l,r="last")}if(o===-1)return s?(this.failed=!0,void(this.error=`Route stitch for "${this.mergedHdRoute.connectionName}" violates copper clearance`)):void(this.remainingHdRoutes=[]);let a=this.remainingHdRoutes[o],c;this.remainingHdRoutes.splice(o,1),c=r==="first"?a.route:((l)=>{let h=[...l].reverse().map((d)=>{let{toNextSegmentType:u,..._}=d;return _});for(let d=0;d<l.length-1;d++){let u=l[d]?.toNextSegmentType;if(!u)continue;let _=l.length-d-2;h[_]={...h[_],toNextSegmentType:u}}return h})(a.route),c.length>0&&kn(n,c[0])<gQ&&n.z===c[0].z?(c[0].toNextSegmentType&&(n.toNextSegmentType=c[0].toNextSegmentType),this.mergedHdRoute.route.push(...c.slice(1))):this.mergedHdRoute.route.push(...c),this.mergedHdRoute.vias.push(...a.vias),a.jumpers&&this.mergedHdRoute.jumpers.push(...a.jumpers)}visualize(){let e={points:[],lines:[],circles:[],rects:[],title:"Single High Density Route Stitch Solver 3"};if(e.points?.push({x:this.start.x,y:this.start.y,color:"green",label:"Start"},{x:this.end.x,y:this.end.y,color:"red",label:"End"}),this.mergedHdRoute&&this.mergedHdRoute.route.length>1){e.lines?.push({points:this.mergedHdRoute.route.map((t)=>({x:t.x,y:t.y})),strokeColor:"green"});for(let t of this.mergedHdRoute.route)e.points?.push({x:t.x,y:t.y,color:"green"});for(let t of this.mergedHdRoute.vias)e.circles?.push({center:{x:t.x,y:t.y},radius:this.mergedHdRoute.viaDiameter/2,fill:"green"});if(this.mergedHdRoute.jumpers&&this.mergedHdRoute.jumpers.length>0){let t=lv(this.mergedHdRoute.jumpers,{color:"green",label:this.mergedHdRoute.connectionName});e.rects.push(...t.rects??[]),e.lines.push(...t.lines??[])}}for(let t of this.remainingHdRoutes){e.lines?.push({points:t.route.map((n)=>({x:n.x,y:n.y})),strokeColor:"orange"});for(let n of t.route)e.points?.push({x:n.x,y:n.y,color:"orange"});for(let n of t.vias)e.circles?.push({center:{x:n.x,y:n.y},radius:t.viaDiameter/2,fill:"orange"});if(t.jumpers&&t.jumpers.length>0){let n=lv(t.jumpers,{color:"orange",label:t.connectionName});e.rects.push(...n.rects??[]),e.lines.push(...n.lines??[])}}return e}},TCr=class{constructor(e=!1){this.preferSameLayerTerminalEndpoints=e}preferSameLayerTerminalEndpoints;endpointClusters=new Map;getEndpointKey(e,t){let n=this.endpointClusters.get(e)??[],o,r=1/0;for(let s of n){if(s.point.z!==t.z)continue;let a=kn(s.point,t);a<=0.1&&(a<r-y1||Math.abs(a-r)<=y1&&(!o||XS(s.point,o.point)<0))&&(o=s,r=a)}if(o)return o.key;let i=`${e}:endpoint_${n.length}`;return n.push({key:i,point:{x:t.x,y:t.y,z:t.z}}),this.endpointClusters.set(e,n),i}getClusters(e){return this.endpointClusters.get(e)??[]}getClosestEndpointKey(e,t,n){let o=t.flatMap((l)=>[l.route[0],l.route[l.route.length-1]]),r=o.filter((l)=>l.z===n.z),i=this.preferSameLayerTerminalEndpoints&&r.length>0?r:o,s=null,a=null,c=1/0;for(let l of i){let h=kn(n,l),d=this.getEndpointKey(e,l);(h<c-y1||Math.abs(h-c)<=y1&&(s===null||d.localeCompare(s)<0||d===s&&a!==null&&XS(l,a)<0))&&(c=h,s=d,a=l)}return s}},v3e=(e,t,n)=>{let o=e.get(t)??[];o.some((r)=>r.nextHash===n.nextHash&&r.routeIndex===n.routeIndex)||(o.push(n),e.set(t,o))},DCr=(e)=>{let t=[...e.possibleEndpoints].sort(XS),n=t.reduce((i,s)=>{let a=kn(s,e.globalStart),c=kn(i,e.globalStart);return a<c-y1||Math.abs(a-c)<=y1&&XS(s,i)<0?s:i}),o=t.filter((i)=>i!==n),r=(o.length>0?o:e.possibleEndpoints).reduce((i,s)=>{let a=kn(s,e.globalEnd),c=kn(i,e.globalEnd);return a<c-y1||Math.abs(a-c)<=y1&&XS(s,i)<0?s:i});return{start:n,end:r}},cYt=(e)=>{let t=[...e.terminals].sort(XS),n=t[0],o=kn(e.islandEndpoint,n);for(let r of t.slice(1)){let i=kn(e.islandEndpoint,r);(i<o-y1||Math.abs(i-o)<=y1&&XS(r,n)<0)&&(n=r,o=i)}return o<=XZe?n:e.islandEndpoint},aje=(e)=>{if(e.hdRoutes.length<=2)return e.hdRoutes;let t=[...e.hdRoutes].sort(yle),n=e.endpointIndex.getClosestEndpointKey(e.connectionName,t,e.start),o=e.endpointIndex.getClosestEndpointKey(e.connectionName,t,e.end);if(!n||!o||n===o)return t;let r=new Map;for(let u=0;u<t.length;u++){let _=t[u],p=e.endpointIndex.getEndpointKey(e.connectionName,_.route[0]),m=e.endpointIndex.getEndpointKey(e.connectionName,_.route[_.route.length-1]);v3e(r,p,{nextHash:m,routeIndex:u}),v3e(r,m,{nextHash:p,routeIndex:u})}let i=[...e.endpointIndex.getClusters(e.connectionName)].sort((u,_)=>XS(u.point,_.point));for(let u=0;u<i.length;u++){let _=i[u];for(let p=u+1;p<i.length;p++){let m=i[p];_.point.z===m.point.z&&(kn(_.point,m.point)>1||(v3e(r,_.key,{nextHash:m.key,routeIndex:null}),v3e(r,m.key,{nextHash:_.key,routeIndex:null})))}}for(let[u,_]of r.entries())r.set(u,[..._].sort((p,m)=>{if(p.routeIndex===null&&m.routeIndex!==null)return 1;if(p.routeIndex!==null&&m.routeIndex===null)return-1;if(p.routeIndex!==null&&m.routeIndex!==null){let A=yle(t[p.routeIndex],t[m.routeIndex]);if(A!==0)return A}return p.nextHash.localeCompare(m.nextHash)}));let s=[n],a=new Set([n]),c=new Map;for(;s.length>0;){let u=s.shift();if(u===o)break;for(let _ of r.get(u)??[])a.has(_.nextHash)||(a.add(_.nextHash),c.set(_.nextHash,{prevHash:u,routeIndex:_.routeIndex}),s.push(_.nextHash))}if(!a.has(o))return t;let l=[],h=o;for(;h!==n;){let u=c.get(h);if(!u)return t;u.routeIndex!==null&&l.push(u.routeIndex),h=u.prevHash}if(l.length===0)return e.hdRoutes;let d=l.reverse().map((u)=>t[u]);return d.length>0&&!e.canStitchBetweenTerminals({connectionName:e.connectionName,hdRoutes:d,start:e.start,end:e.end})?t:d},o6e=class extends ei{getSolverName(){return"MultipleHighDensityRouteStitchSolver3"}unsolvedRoutes;activeSolver=null;mergedHdRoutes=[];colorMap={};defaultTraceThickness;defaultViaDiameter;allowedLayerTransitionPointKeys;preserveTerminalPcbPortIds;endpointIndex;clearanceValidator;canStitchBetweenTerminals(e){let t=new sje({connectionName:e.connectionName,hdRoutes:e.hdRoutes,start:e.start,end:e.end,colorMap:this.colorMap,defaultTraceThickness:this.defaultTraceThickness,defaultViaDiameter:this.defaultViaDiameter,allowedLayerTransitionPointKeys:this.allowedLayerTransitionPointKeys,preserveTerminalPcbPortIds:this.preserveTerminalPcbPortIds,isStitchSegmentClear:(r)=>this.clearanceValidator.isSegmentClear(r),stitchClearanceMode:"require_clear"});for(;!t.solved&&!t.failed&&t.iterations<t.MAX_ITERATIONS;)t.step();if(t.failed)return!1;let n=t.mergedHdRoute.route[0],o=t.mergedHdRoute.route[t.mergedHdRoute.route.length-1];return n.z===t.start.z&&o.z===t.end.z&&kn(n,t.start)+kn(o,t.end)<=XZe}getSharedRootPathRoutes(e){let t=e.rootConnectionName;if(!t)return null;let n=new Set(e.hdRoutes),o=e.allHdRoutes.filter((i)=>(i.rootConnectionName??i.connectionName)===t);if(o.every((i)=>n.has(i)))return null;let r=aje({connectionName:e.connectionName,hdRoutes:o,start:e.start,end:e.end,endpointIndex:this.endpointIndex,canStitchBetweenTerminals:(i)=>this.canStitchBetweenTerminals(i)});return!r.some((i)=>!n.has(i))||r.length>=o.length?null:r}constructor(e){super(),this.endpointIndex=new TCr(e.preferSameLayerTerminalEndpoints),this.colorMap=e.colorMap??{},this.allowedLayerTransitionPointKeys=e.allowedLayerTransitionPointKeys,this.preserveTerminalPcbPortIds=e.preserveTerminalPcbPortIds??!1;let t=[...e.hdRoutes].sort(yle);this.clearanceValidator=new BCr({hdRoutes:t});let n=t[0];this.defaultTraceThickness=n?.traceThickness??0.15,this.defaultViaDiameter=n?.viaDiameter??e.defaultViaDiameter??0.3;let o=new SZe({}),r=[],i=new Map;for(let c=0;c<t.length;c++){let l=t[c],h=l.route[0],d=l.route[l.route.length-1];r.push([`route_island_${c}`,this.endpointIndex.getEndpointKey(l.connectionName,h),this.endpointIndex.getEndpointKey(l.connectionName,d)])}o.addConnections(r);for(let c of r)for(let l of c.slice(1))i.set(l,(i.get(l)??0)+1);this.unsolvedRoutes=[];let s=Array.from(new Set(Object.values(o.idToNetMap)));for(let c of s){let l=o.getIdsConnectedToNet(c),h=t.filter((y,x)=>l.includes(`route_island_${x}`));if(h.length===0)continue;let d=e.connections.find((y)=>y.name===h[0].connectionName),u=h.flatMap((y)=>[y.route[0],y.route[y.route.length-1]]),_=new Map,p=[];for(let y of u){let x=this.endpointIndex.getEndpointKey(h[0].connectionName,y);_.has(x)||_.set(x,y),i.get(x)===1&&p.push(y)}let m=p.length>0?p:[..._.values()];if(m.length===0)continue;let A,g;if(m.length>=2){let y={...d.pointsToConnect[0],z:si(l2(d.pointsToConnect[0]),e.layerCount)},x={...d.pointsToConnect[1],z:si(l2(d.pointsToConnect[1]),e.layerCount)};({start:A,end:g}=DCr({possibleEndpoints:m,globalStart:y,globalEnd:x})),kn(A,d.pointsToConnect[1])<kn(g,d.pointsToConnect[0])&&([A,g]=[g,A]),A=cYt({islandEndpoint:A,terminals:[y,x]}),g=cYt({islandEndpoint:g,terminals:[y,x]})}else A={...d.pointsToConnect[0],z:si(l2(d.pointsToConnect[0]),e.layerCount)},g={...d.pointsToConnect[1],z:si(l2(d.pointsToConnect[1]),e.layerCount)};let f=aje({connectionName:h[0].connectionName,hdRoutes:h,start:A,end:g,endpointIndex:this.endpointIndex,canStitchBetweenTerminals:(y)=>this.canStitchBetweenTerminals(y)});this.unsolvedRoutes.push({connectionName:h[0].connectionName,hdRoutes:f,start:A,end:g})}let a=new Map;for(let c of this.unsolvedRoutes){let l=a.get(c.connectionName);l?l.push(c):a.set(c.connectionName,[c])}this.unsolvedRoutes=Array.from(a.entries()).flatMap(([c,l])=>{let h=e.connections.find((g)=>g.name===c),d=l.some((g)=>g.hdRoutes.some((f)=>f.route.length<2)),u=l.length>1&&((g)=>{for(let f=0;f<g.length;f++)for(let y=f+1;y<g.length;y++){let x=[g[f].start,g[f].end],C=[g[y].start,g[y].end];for(let b of x)for(let I of C)if(b.z===I.z&&kn(b,I)<=1)return!0}return!1})(l);if(!h)return l;let _={...h.pointsToConnect[0],z:si(l2(h.pointsToConnect[0]),e.layerCount)},p={...h.pointsToConnect[1],z:si(l2(h.pointsToConnect[1]),e.layerCount)},m=l.flatMap((g)=>g.hdRoutes),A=l.length>1?this.getSharedRootPathRoutes({connectionName:c,rootConnectionName:h.__rootConnectionNames?.[0]??m[0]?.rootConnectionName,hdRoutes:m,allHdRoutes:t,start:_,end:p}):null;return d||u||A?[{connectionName:c,hdRoutes:A??aje({connectionName:c,hdRoutes:m,start:_,end:p,endpointIndex:this.endpointIndex,canStitchBetweenTerminals:(g)=>this.canStitchBetweenTerminals(g)}),start:_,end:p}]:l}),this.MAX_ITERATIONS=1e5}_step(){if(this.activeSolver)return this.activeSolver.step(),void(this.activeSolver.solved?(this.activeSolver instanceof sje&&(this.clearanceValidator.addRoute(this.activeSolver.mergedHdRoute),this.mergedHdRoutes.push(this.activeSolver.mergedHdRoute)),this.activeSolver=null):this.activeSolver.failed&&(this.failed=!0,this.error=this.activeSolver.error));let e=this.unsolvedRoutes.pop();if(!e){let t=new Set;for(let n of this.mergedHdRoutes)n.startPcbPortId&&n.endPcbPortId&&t.add(n.connectionName);return this.mergedHdRoutes=this.mergedHdRoutes.filter((n)=>!t.has(n.connectionName)||Boolean(n.startPcbPortId&&n.endPcbPortId)),void(this.solved=!0)}this.activeSolver=new sje({connectionName:e.connectionName,hdRoutes:e.hdRoutes,start:e.start,end:e.end,colorMap:this.colorMap,defaultTraceThickness:this.defaultTraceThickness,defaultViaDiameter:this.defaultViaDiameter,allowedLayerTransitionPointKeys:this.allowedLayerTransitionPointKeys,preserveTerminalPcbPortIds:this.preserveTerminalPcbPortIds,isStitchSegmentClear:(t)=>this.clearanceValidator.isSegmentClear(t),stitchClearanceMode:"prefer_clear"})}visualize(){let e={points:[],lines:[],circles:[],rects:[],title:"Multiple High Density Route Stitch Solver 3"};if(this.activeSolver){let t=this.activeSolver.visualize();t.points?.length&&e.points?.push(...t.points),t.lines?.length&&e.lines?.push(...t.lines),t.circles?.length&&e.circles?.push(...t.circles),t.rects?.length&&(e.rects||(e.rects=[]),e.rects.push(...t.rects))}for(let[t,n]of this.mergedHdRoutes.entries()){let o=this.colorMap[n.connectionName]??`hsl(120, 100%, ${40+10*t%40}%)`;for(let r=0;r<n.route.length-1;r++){let i=n.route[r],s=n.route[r+1],a=i.z!==0?zi(o,0.5):o;e.lines?.push({points:[{x:i.x,y:i.y},{x:s.x,y:s.y}],strokeColor:a,strokeWidth:n.traceThickness})}for(let r of n.route){let i=r.z!==0?zi(o,0.5):o;e.points?.push({x:r.x,y:r.y,color:i})}for(let r of n.vias)e.circles?.push({center:{x:r.x,y:r.y},radius:n.viaDiameter/2,fill:o});if(n.jumpers&&n.jumpers.length>0){let r=lv(n.jumpers,{color:o,label:n.connectionName});e.rects.push(...r.rects??[]),e.lines.push(...r.lines??[])}}return e}},nan=(e)=>(e%360+360)%360,NCr=(e,t)=>{let{ccwRotationDegrees:n,...o}=e,r=((i)=>{let s=nan(i),a=[0,90,180,270];for(let c of a)if(Math.min(Math.abs(s-c),360-Math.abs(s-c))<=0.01)return c;return null})(t);return r===90||r===270?{...o,width:e.height,height:e.width}:o},lYt=(e,t)=>!(E5(e).length>0&&!E5(e).some((n)=>t.layers.includes(n)))&&tCe(e,tu(t)),hYt=(e,t)=>{let{minX:n,maxX:o,minY:r,maxY:i}=tu(t);return{x:Math.max(n,Math.min(o,e.x)),y:Math.max(r,Math.min(i,e.y))}},RCr=(e,t)=>e.obstacleId??`${e.componentId??"obstacle"}_${t}`;function oan(e,t=2){let{center:n,width:o,height:r,rotation:i}=e,s=[],a=Math.max(1,Math.ceil(t)),c=i*Math.PI/180,l=Math.cos(c),h=Math.sin(c);if(o>=r){let d=o/a;for(let u=0;u<a;u++){let _=(u-a/2+0.5)*d,p=_*l,m=_*h,A=Math.abs(d*l)+Math.abs(r*h),g=Math.abs(d*h)+Math.abs(r*l);s.push({center:{x:n.x+p,y:n.y+m},width:A,height:g})}}else{let d=r/a;for(let u=0;u<a;u++){let _=(u-a/2+0.5)*d,p=-_*h,m=_*l,A=Math.abs(o*l)+Math.abs(d*h),g=Math.abs(o*h)+Math.abs(d*l);s.push({center:{x:n.x+p,y:n.y+m},width:A,height:g})}}return s}var ran=(e)=>{if(e.type==="oval")return ran({...e,type:"rect"});let t=e.ccwRotationDegrees;if(typeof t!="number"||!Number.isFinite(t))return[e];if(((l)=>{let h=nan(l);return[0,90,180,270].some((d)=>Math.min(Math.abs(h-d),360-Math.abs(h-d))<=0.01)})(t))return[NCr(e,t)];let{ccwRotationDegrees:n,...o}=e,r={center:e.center,width:e.width,height:e.height,rotation:t},i=((l)=>{let h=Math.max(l.width,l.height),d=Math.min(l.width,l.height);return l.obstacleId?.startsWith("trace_obstacle_")?Math.max(2,Math.ceil(h/0.75)):d<=0?2:h/d<2||d>=0.9?null:Math.max(2,Math.ceil(h/0.75))})(e),s=e.connectedTo.length>0&&!e.obstacleId?.startsWith("trace_obstacle_"),a=e.isNonPlatedHole||s?((l)=>{let h=l.rotation*Math.PI/180,d=Math.cos(h),u=Math.sin(h),_=[-1,1].flatMap((M)=>[-1,1].map((B)=>{let T=M*(l.width/2),N=B*(l.height/2);return{x:l.center.x+T*d-N*u,y:l.center.y+T*u+N*d}})),p=[_[0],_[2],_[3],_[1]],m=Math.min(...p.map((M)=>M.x)),A=Math.max(...p.map((M)=>M.x)),g=Math.min(...p.map((M)=>M.y)),f=Math.max(...p.map((M)=>M.y)),y=A-m<=f-g?"x":"y",x=y==="x"?m:g,C=y==="x"?A:f,b=Math.max(1,Math.ceil((C-x)/0.4)),I=(C-x)/b,v=(M,B,T)=>{let N=[],D=(L)=>L[y];for(let L=0;L<M.length;L++){let H=M[L],V=M[(L+1)%M.length],O=D(H),U=D(V),j=T?O>=B:O<=B,Y=T?U>=B:U<=B;if(j&&N.push(H),j===Y)continue;let X=(B-O)/(U-O);N.push({x:H.x+(V.x-H.x)*X,y:H.y+(V.y-H.y)*X})}return N},P=[];for(let M=0;M<b;M++){let B=x+M*I,T=M===b-1?C:B+I,N=v(v(p,B,!0),T,!1);if(N.length===0)continue;let D=Math.min(...N.map((O)=>O.x)),L=Math.max(...N.map((O)=>O.x)),H=Math.min(...N.map((O)=>O.y)),V=Math.max(...N.map((O)=>O.y));P.push({center:{x:(D+L)/2,y:(H+V)/2},width:L-D,height:V-H})}return P})(r):i===null?((l,h)=>{let{center:d,width:u,height:_,rotation:p}=l,m=Math.max(1,Math.ceil(u/h)),A=Math.max(1,Math.ceil(_/h)),g=u/m,f=_/A,y=p*Math.PI/180,x=Math.cos(y),C=Math.sin(y),b=[];for(let I=0;I<m;I++){let v=(I-m/2+0.5)*g;for(let P=0;P<A;P++){let M=(P-A/2+0.5)*f;b.push({center:{x:d.x+v*x-M*C,y:d.y+v*C+M*x},width:Math.abs(g*x)+Math.abs(f*C),height:Math.abs(g*C)+Math.abs(f*x)})}}return b})(r,((l)=>l.obstacleId?.startsWith("trace_obstacle_")?0.75:0.4)(e)):oan(r,i),c=e.connectedTo.length>0?a.reduce((l,h,d)=>{let u=a[l],_=(u.center.x-e.center.x)**2+(u.center.y-e.center.y)**2;return(h.center.x-e.center.x)**2+(h.center.y-e.center.y)**2<_?d:l},0):-1;return a.map((l,h)=>({...o,obstacleId:h===c?o.obstacleId:o.obstacleId?`${o.obstacleId}_approx_${h}`:void 0,connectedTo:o.connectedTo,center:l.center,width:l.width,height:l.height}))},ian=(e)=>{let t=new Map,n=new Map,o=new Map;for(let[i,s]of e.obstacles.entries()){let a=ran(s),c=RCr(s,i);n.set(c,a),o.set(c,s);for(let l of a){let h=[l.center.x.toFixed(6),l.center.y.toFixed(6),l.width.toFixed(6),l.height.toFixed(6),l.layers.join(","),l.isNonPlatedHole?"hole":""].join(":"),d=t.get(h);d?d.connectedTo=[...new Set([...d.connectedTo,...l.connectedTo])]:t.set(h,l)}}let r=e.connections.map((i)=>({...i,pointsToConnect:i.pointsToConnect.map((s)=>{let a=((c)=>[c.pointId,c.pcb_port_id].filter((l)=>Boolean(l)))(s);if(a.length===0)return s;for(let[c,l]of o){if(!a.some((_)=>l.connectedTo.includes(_)))continue;if(!lYt(s,l))continue;let h=n.get(c)??[];if(h.length===0)continue;if(h.some((_)=>lYt(s,_)))return s;let d=h[0],u=Number.POSITIVE_INFINITY;for(let _ of h){let p=kn(hYt(s,_),s);p<u&&(u=p,d=_)}return{...s,...hYt(s,d)}}return s})}));return{...e,connections:r,obstacles:[...t.values()]}},KCe=0.001,dYt=(e)=>e.route_type==="wire",QCr=(e)=>e.route_type==="via",kCr=(e)=>e.route_type==="through_obstacle",uYt=(e,t,n)=>{let o=si(e,n),r=si(t,n),i=Math.min(o,r),s=Math.max(o,r);return Array.from({length:s-i+1},(a,c)=>nd(i+c,n))},pYt=({obstacleId:e,start:t,end:n,width:o,layer:r,connectedTo:i})=>{let s=n.x-t.x,a=n.y-t.y,c=Math.hypot(s,a);return c<=KCe?null:{obstacleId:e,type:"rect",layers:[r],center:{x:(t.x+n.x)/2,y:(t.y+n.y)/2},width:c,height:Math.max(o,KCe),ccwRotationDegrees:180*Math.atan2(a,s)/Math.PI,connectedTo:i}};function LCr(e){if(!e)return e;let t=((n)=>{if(!n)return[];let o=[],r=rm(n);for(let[i,s]of(n.traces??[]).entries()){let a=s.connectsTo??[];for(let c=0;c<s.route.length;c++){let l=s.route[c];if(QCr(l)){let h=l.via_diameter??r.padDiameter;o.push({obstacleId:`trace_obstacle_${s.pcb_trace_id}_${i}_${c}_via`,type:"rect",layers:uYt(l.from_layer,l.to_layer,n.layerCount),center:{x:l.x,y:l.y},width:Math.max(h,KCe),height:Math.max(h,KCe),connectedTo:a});continue}if(kCr(l)){let h=pYt({obstacleId:`trace_obstacle_${s.pcb_trace_id}_${i}_${c}_through`,start:l.start,end:l.end,width:l.width,layer:l.from_layer,connectedTo:a});h&&(h.layers=uYt(l.from_layer,l.to_layer,n.layerCount),o.push(h))}}for(let c=0;c<s.route.length-1;c++){let l=s.route[c],h=s.route[c+1];if(!dYt(l)||!dYt(h)||l.layer!==h.layer)continue;let d=pYt({obstacleId:`trace_obstacle_${s.pcb_trace_id}_${i}_${c}_wire`,start:l,end:h,width:l.width,layer:l.layer,connectedTo:a});d&&o.push(d)}}return o})(e);return t.length===0?e:{...e,obstacles:[...e.obstacles??[],...t]}}function mYt(e,t){let n=function(o,r){let i=wle(o.__zLayers??o.zLayers??[],r);if(i.length>0)return i;let s=Ble(o.layers,r);if(s.length>0)return s;throw Error(`Obstacle "${o.obstacleId??"unknown"}" has no layers on this ${r}-layer board`)}(e,t);return{...e,layers:n.map((o)=>nd(o,t)),zLayers:n,__zLayers:n}}function oP(e){return{...e,obstacles:e.obstacles.map((t)=>mYt(t,e.layerCount)),jumpers:e.jumpers?.map((t)=>({...t,pads:t.pads.map((n)=>mYt(n,e.layerCount))}))}}var san=(e)=>{let t=e.obstacles.filter((r)=>!((i,s)=>!((a)=>(a.connectedTo?.length??0)>0||(a.offBoardConnectsTo?.length??0)>0||a.netIsAssignable===!0)(i)&&(s.outline&&s.outline.length>=3?!nCe(i,s.outline):!mB({minX:i.center.x-i.width/2,maxX:i.center.x+i.width/2,minY:i.center.y-i.height/2,maxY:i.center.y+i.height/2},s.bounds)))(r,e)),n=t.length!==e.obstacles.length,o=n&&e.outline&&e.outline.length>=3?((r)=>{if(r.width&&r.height&&r.center){let d=r.width/2,u=r.height/2;return{minX:r.center.x-d,minY:r.center.y-u,maxX:r.center.x+d,maxY:r.center.y+u,width:r.width,height:r.height,center:{x:r.center.x,y:r.center.y}}}if(!r.outline||r.outline.length===0)throw Error("Unable to compute board bounds. pcb_board must include width/height/center or a non-empty outline.");let{POSITIVE_INFINITY:i,POSITIVE_INFINITY:s,NEGATIVE_INFINITY:a,NEGATIVE_INFINITY:c}=Number;for(let d of r.outline)i=Math.min(i,d.x),s=Math.min(s,d.y),a=Math.max(a,d.x),c=Math.max(c,d.y);let l=a-i,h=c-s;return{minX:i,minY:s,maxX:a,maxY:c,width:l,height:h,center:{x:i+l/2,y:s+h/2}}})({type:"pcb_board",pcb_board_id:"__autorouting_board_outline__",center:{x:0,y:0},thickness:1,num_layers:e.layerCount,material:"fr4",outline:e.outline}):e.bounds;return n?{...e,obstacles:t,bounds:o}:e};function T$e(e){let{minX:t,maxX:n,minY:o,maxY:r}=e.bounds;for(let i of e.connections)if(!i.isOffBoard){for(let[s,a]of i.pointsToConnect.entries())if(!(a.x>=t&&a.x<=n&&a.y>=o&&a.y<=r))return`Connection "${i.name}" point "${a.pointId??s}" at (${a.x}, ${a.y}) is outside routing bounds: x [${t}, ${n}], y [${o}, ${r}]`}return null}var r6e=class extends ei{constructor(e,t={}){super(),this.inputSrj=e,this.visualizationOptions=t,this.MAX_ITERATIONS=1}inputSrj;visualizationOptions;outputSrj;_step(){if(this.error=T$e(this.inputSrj),this.error)return void(this.failed=!0);let e=oP(this.inputSrj),t=LCr(e)??e,n=ian(san(t));this.outputSrj=oP(n),this.solved=!0}getOutputSimpleRouteJson(){if(!this.outputSrj)throw Error("PreprocessSimpleRouteJsonSolver has not solved yet");return this.outputSrj}getConstructorParams(){return[this.inputSrj,this.visualizationOptions]}visualize(){return this.outputSrj?Bl(rx({...this.outputSrj,traces:[]},this.visualizationOptions),yB({srj:this.outputSrj,visualizationOptions:this.visualizationOptions})):{lines:[],points:[],rects:[],circles:[]}}};function c2(e,t,n,o={}){return{solverName:e,solverClass:t,getConstructorParams:n,onSolved:o.onSolved}}var jZe=class extends ei{constructor(e,t={}){super(),this.srj=e,this.opts=t,this.originalSrj=e,this.opts={...t};let n=this.opts;if(this.effort=n.effort??1,this.MAX_ITERATIONS=1e8*this.effort,this.maxNodeDimension=n.maxNodeDimension??16,this.maxNodeRatio=n.maxNodeRatio??6,this.minNodeArea=n.minNodeArea??0.010000000000000002,this.setSimpleRouteJson(e),n.capacityDepth===void 0){let o=this.srj.bounds.maxX-this.srj.bounds.minX,r=this.srj.bounds.maxY-this.srj.bounds.minY,i=Math.max(o,r),s=n.targetMinCapacity??0.5;n.capacityDepth=ik(i,s)}this.cacheProvider=n.cacheProvider===void 0?hv():n.cacheProvider===null?null:n.cacheProvider,this.startTimeOfPhase={},this.endTimeOfPhase={},this.timeSpentOnPhase={}}srj;opts;preprocessSimpleRouteJsonSolver;escapeViaLocationSolver;netToPointPairsSolver;nodeSolver;nodeDimensionSubdivisionSolver;nodeTargetMerger;edgeSolver;colorMap;highDensityRouteSolver;highDensityForceImproveSolver;highDensityRepairSolver;highDensityStitchSolver;globalDrcForceImproveSolver;singleLayerNodeMerger;strawSolver;deadEndSolver;traceSimplificationSolver;availableSegmentPointSolver;portPointPathingSolver;multiSectionPortPointOptimizer;uniformPortDistributionSolver;traceWidthSolver;necessaryCrampedPortPointSolver;viaDiameter;viaHoleDiameter;minTraceWidth;effort;maxNodeDimension;maxNodeRatio;minNodeArea;startTimeOfPhase;endTimeOfPhase;timeSpentOnPhase;activeSubSolver=null;connMap;srjWithEscapeViaLocations;srjWithPointPairs;originalSrj;capacityNodes=null;capacityEdges=null;highDensityNodePortPoints;cacheProvider=null;pipelineDef=[c2("preprocessSimpleRouteJsonSolver",r6e,(e)=>[e.originalSrj],{onSolved:(e)=>{e.setSimpleRouteJson(e.preprocessSimpleRouteJsonSolver.getOutputSimpleRouteJson())}}),c2("escapeViaLocationSolver",t6e,(e)=>[e.srj,{viaDiameter:e.viaDiameter,minTraceWidth:e.minTraceWidth,obstacleMargin:e.srj.defaultObstacleMargin??0.15}],{onSolved:(e)=>{e.srjWithEscapeViaLocations=e.escapeViaLocationSolver?.getOutputSimpleRouteJson()}}),c2("netToPointPairsSolver",Vq,(e)=>{let t=e.srjWithEscapeViaLocations??e.srj;return[t,e.colorMap,nk(t)]},{onSolved:(e)=>{e.srjWithPointPairs=e.netToPointPairsSolver?.getNewSimpleRouteJson(),e.colorMap=JA(e.srjWithPointPairs,e.connMap),e.connMap=im(e.srjWithPointPairs)}}),c2("nodeSolver",Qq,(e)=>[{simpleRouteJson:e.srjWithPointPairs,maxGapFillPasses:4}],{onSolved:(e)=>{e.capacityNodes=e.nodeSolver?.getOutput().meshNodes??[]}}),c2("nodeDimensionSubdivisionSolver",Zbe,(e)=>[e.capacityNodes,e.maxNodeDimension,e.maxNodeRatio,e.minNodeArea],{onSolved:(e)=>{e.capacityNodes=e.nodeDimensionSubdivisionSolver?.outputNodes??[]}}),c2("edgeSolver",ok,(e)=>[e.capacityNodes],{onSolved:(e)=>{e.capacityEdges=e.edgeSolver?.edges}}),c2("availableSegmentPointSolver",tY,(e)=>[{nodes:e.capacityNodes,edges:e.capacityEdges||[],traceWidth:e.minTraceWidth,colorMap:e.colorMap,shouldReturnCrampedPortPoints:!0}]),c2("necessaryCrampedPortPointSolver",jle,(e)=>[{capacityMeshNodes:e.capacityNodes,sharedEdgeSegments:e.availableSegmentPointSolver.getOutput(),simpleRouteJson:e.srjWithPointPairs}]),c2("portPointPathingSolver",e6e,(e)=>{let t=e.necessaryCrampedPortPointSolver?.getOutput()??e.availableSegmentPointSolver.getOutput(),{graph:n,connections:o}=Kle({capacityMeshNodes:e.capacityNodes,layerCount:e.srj.layerCount,connectivityMap:e.connMap,segmentPortPoints:t.flatMap((r)=>r.portPoints),simpleRouteJsonConnections:e.srjWithPointPairs.connections});return[{graph:n,connections:o,layerCount:e.srj.layerCount,effort:Math.min(1,e.effort),minViaPadDiameter:e.viaDiameter,flags:{FORCE_CENTER_FIRST:!0,RIPPING_ENABLED:!0},weights:{SHUFFLE_SEED:0,MEMORY_PF_FACTOR:4,CENTER_OFFSET_DIST_PENALTY_FACTOR:0,CENTER_OFFSET_FOCUS_SHIFT:0,NODE_PF_FACTOR:0,LAYER_CHANGE_COST:0,RIPPING_PF_COST:0,NODE_PF_MAX_PENALTY:100,BASE_CANDIDATE_COST:0.6,MAX_ITERATIONS_PER_PATH:0,RANDOM_WALK_DISTANCE:0,START_RIPPING_PF_THRESHOLD:0.3,END_RIPPING_PF_THRESHOLD:1,MAX_RIPS:1000,RANDOM_RIP_FRACTION:0.3,STRAIGHT_LINE_DEVIATION_PENALTY_FACTOR:4,GREEDY_MULTIPLIER:0.7,MIN_ALLOWED_BOARD_SCORE:-1e4}}]}),c2("uniformPortDistributionSolver",Tle,(e)=>[{nodeWithPortPoints:e.portPointPathingSolver?.getOutput().nodesWithPortPoints??[],inputNodesWithPortPoints:e.portPointPathingSolver?.getOutput().inputNodeWithPortPoints??[],minTraceWidth:e.minTraceWidth,obstacles:e.srj.obstacles,layerCount:e.srj.layerCount}]),c2("highDensityRouteSolver",cY,(e)=>{let t=e.uniformPortDistributionSolver?.getOutput()??[],n=e.portPointPathingSolver?.getOutput().nodesWithPortPoints??[],o=(t.length>0?t:n).map((r)=>Qrn(r)?{...r,availableZ:Array.from({length:e.srj.layerCount},(i,s)=>s)}:r);return e.highDensityNodePortPoints=structuredClone(o),[{nodePortPoints:o,nodePfById:new Map((e.portPointPathingSolver?.getOutput().inputNodeWithPortPoints??[]).map((r)=>[r.capacityMeshNodeId,e.portPointPathingSolver?.computeNodePf(r)??null])),colorMap:e.colorMap,connMap:e.connMap,viaDiameter:e.viaDiameter,traceWidth:e.minTraceWidth,obstacleMargin:e.srj.defaultObstacleMargin??0.15,obstacles:e.srj.obstacles,layerCount:e.srj.layerCount,useGrowShrinkHighDensityIntraNodeSolver:!0}]}),c2("highDensityForceImproveSolver",$le,(e)=>[{nodeWithPortPoints:e.highDensityNodePortPoints??[],hdRoutes:e.highDensityRouteSolver.routes,colorMap:e.colorMap,totalStepsPerNode:Math.max(20,Math.round(60*Math.min(1,e.effort))),nodeAssignmentMargin:e.srj.defaultObstacleMargin??0.2}]),c2("highDensityRepairSolver",qle,(e)=>[{nodeWithPortPoints:e.highDensityNodePortPoints??[],hdRoutes:e.highDensityForceImproveSolver?.getOutput()??e.highDensityRouteSolver.routes,obstacles:e.srj.obstacles,colorMap:e.colorMap,repairMargin:e.srj.defaultObstacleMargin??0.2,minimumTraceWidth:e.srj.minTraceWidth,connMap:e.connMap}]),c2("highDensityStitchSolver",o6e,(e)=>[{connections:e.srjWithPointPairs.connections,hdRoutes:e.highDensityRepairSolver?.getOutput()??e.highDensityForceImproveSolver?.getOutput()??e.highDensityRouteSolver.routes,colorMap:e.colorMap,layerCount:e.srj.layerCount,defaultViaDiameter:e.viaDiameter}]),c2("traceSimplificationSolver",s6,(e)=>[{hdRoutes:e.highDensityStitchSolver.mergedHdRoutes,obstacles:e.srj.obstacles,connMap:e.connMap,colorMap:e.colorMap,outline:e.srj.outline,defaultViaDiameter:e.viaDiameter,layerCount:e.srj.layerCount,minTraceToPadEdgeClearance:e.srj.minTraceToPadEdgeClearance,iterations:2}]),c2("traceWidthSolver",Yq,(e)=>[{hdRoutes:e.traceSimplificationSolver.simplifiedHdRoutes,obstacles:e.srj.obstacles,connMap:e.connMap,colorMap:e.colorMap,minTraceWidth:e.minTraceWidth,connection:e.srj.connections,obstacleMargin:e.srj.minTraceToPadEdgeClearance??0.15,layerCount:e.srj.layerCount}]),c2("globalDrcForceImproveSolver",NS,(e)=>[{srj:e.srjWithPointPairs,hdRoutes:e.traceWidthSolver.getHdRoutesWithWidths(),effort:Math.min(1,e.effort)}])];setSimpleRouteJson(e){this.srj=e;let t=rm(this.srj);this.viaDiameter=t.padDiameter,this.viaHoleDiameter=t.holeDiameter,this.minTraceWidth=this.srj.minTraceWidth,this.connMap=im(this.srj),this.colorMap=JA(this.srj,this.connMap)}getConstructorParams(){return[this.srj,this.opts]}currentPipelineStepIndex=0;_step(){let e=this.pipelineDef[this.currentPipelineStepIndex];if(!e)return void(this.solved=!0);if(this.activeSubSolver)return this.activeSubSolver.step(),void(this.activeSubSolver.solved?(this.endTimeOfPhase[e.solverName]=performance.now(),this.timeSpentOnPhase[e.solverName]=this.endTimeOfPhase[e.solverName]-this.startTimeOfPhase[e.solverName],e.onSolved?.(this),this.activeSubSolver=null,this.currentPipelineStepIndex++):this.activeSubSolver.failed&&(this.error=this.activeSubSolver?.error,this.failed=!0,this.activeSubSolver=null));let t=e.getConstructorParams(this);this.activeSubSolver=new e.solverClass(...t),this[e.solverName]=this.activeSubSolver,this.timeSpentOnPhase[e.solverName]=0,this.startTimeOfPhase[e.solverName]=performance.now()}solveUntilPhase(e){for(;this.getCurrentPhase()!==e;)this.step()}getCurrentPhase(){return this.pipelineDef[this.currentPipelineStepIndex]?.solverName??"none"}visualize(){if(!this.solved&&this.activeSubSolver)return this.activeSubSolver.visualize();let e=this.escapeViaLocationSolver?.visualize(),t=this.netToPointPairsSolver?.visualize(),n=this.nodeSolver?.visualize(),o=this.nodeDimensionSubdivisionSolver?.visualize(),r=this.nodeTargetMerger?.visualize(),i=this.singleLayerNodeMerger?.visualize(),s=this.strawSolver?.visualize(),a=this.edgeSolver?.visualize(),c=this.deadEndSolver?.visualize(),l=this.availableSegmentPointSolver?.visualize(),h=this.portPointPathingSolver?.visualize(),d=this.multiSectionPortPointOptimizer?.visualize(),u=this.uniformPortDistributionSolver?.visualize(),_=this.highDensityRouteSolver?.visualize(),p=this.highDensityForceImproveSolver?.visualize(),m=this.highDensityRepairSolver?.visualize(),A=this.highDensityStitchSolver?.visualize(),g=this.traceSimplificationSolver?.visualize(),f=this.necessaryCrampedPortPointSolver?.visualize(),y=(this.highDensityRouteSolver?.visualize(),this.originalSrj),x=y.outline,C=[];if(C.push({points:[{x:y.bounds?.minX??-50,y:y.bounds?.minY??-50},{x:y.bounds?.maxX??50,y:y.bounds?.minY??-50},{x:y.bounds?.maxX??50,y:y.bounds?.maxY??50},{x:y.bounds?.minX??-50,y:y.bounds?.maxY??50},{x:y.bounds?.minX??-50,y:y.bounds?.minY??-50}],strokeColor:"rgba(255,0,0,0.25)"}),x&&x.length>=2){let M=x.map((B)=>({x:B.x,y:B.y}));M.push({...M[0]}),C.push({points:M,strokeColor:"rgba(0, 136, 255, 0.95)"})}let b=bB(y),I={points:[...y.connections.flatMap((M)=>M.pointsToConnect.map((B)=>({...B,layer:IB(B,y.layerCount),label:`${M.name} ${B.pcb_port_id??""}`})))],rects:[...(y.obstacles??[]).filter((M)=>!M.isCopperPour).map((M)=>({...M,fill:M.layers?.includes("top")?"rgba(255,0,0,0.25)":M.layers?.includes("bottom")?"rgba(0,0,255,0.25)":"rgba(255,0,0,0.25)",layer:$S(M,y.layerCount),label:b(M)}))],lines:C},v=yB({srj:y}),P=[Bl(I,v),e,t,n,o,r,i,s,a,c,l,f,h,d,u,_?Bl(I,_):null,p,m,A,g,this.solved?Bl({lines:C},yB({srj:this.originalSrj}),rx(this.getOutputSimpleRouteJson())):null].filter(Boolean);return Bl(...P)}preview(){if(this.highDensityRouteSolver){let e=[];for(let t=this.highDensityRouteSolver.routes.length-1;t>=0;t--){let n=this.highDensityRouteSolver.routes[t];if(e.push({points:n.route.map((o)=>({x:o.x,y:o.y})),strokeColor:this.colorMap[n.connectionName]}),e.length>200)break}return{lines:e}}return this.portPointPathingSolver?this.portPointPathingSolver.preview():this.netToPointPairsSolver?this.netToPointPairsSolver.visualize():this.escapeViaLocationSolver?this.escapeViaLocationSolver.visualize():this.preprocessSimpleRouteJsonSolver?this.preprocessSimpleRouteJsonSolver.visualize():{}}_getOutputHdRoutes(){return this.globalDrcForceImproveSolver?.getOutput()??this.traceWidthSolver?.getHdRoutesWithWidths()??this.traceSimplificationSolver?.simplifiedHdRoutes??this.highDensityStitchSolver.mergedHdRoutes}getOutputSimplifiedPcbTraces(){if(!this.solved||!this.highDensityRouteSolver)throw Error("Cannot get output before solving is complete");let e=[],t=this._getOutputHdRoutes();for(let n of this.netToPointPairsSolver?.newConnections??[]){let o=n.__netConnectionName??this.originalSrj.connections.find((i)=>i.name===n.name)?.__netConnectionName,r=t.filter((i)=>i.connectionName===n.name);for(let i=0;i<r.length;i++){let s=r[i],a={type:"pcb_trace",pcb_trace_id:`${n.name}_${i}`,connection_name:o??n.__rootConnectionNames?.[0]??n.name,route:k3(s,this.srj.layerCount,{connectionPoints:n.pointsToConnect,defaultViaHoleDiameter:this.viaHoleDiameter,obstacles:this.srj.obstacles,connMap:this.connMap})};e.push(a)}}return e}getOutputSimpleRouteJson(){return{...this.originalSrj,traces:this.getOutputSimplifiedPcbTraces()}}},aan=(e)=>{let t=[],n=e;for(;n;)t.push(n),n=n.activeSubSolver;for(let o=t.length-1;o>=0;o--){let r=t[o]?.pendingEffects?.filter(Boolean)??[];if(r.length>0)return r}return[]},S3e=(e)=>/\/solve\/?$/.test(e)?e.replace(/\/+$/,""):`${e.replace(/\/+$/,"")}/solve`,HCr=(e,t,n)=>{let o=((r)=>{let i=new Map;for(let s of r.portPoints)s.rootConnectionName&&!i.has(s.connectionName)&&i.set(s.connectionName,s.rootConnectionName);return i})(e);return t.map((r)=>({connectionName:r.connectionName,rootConnectionName:r.rootConnectionName??o.get(r.connectionName)??void 0,traceThickness:r.traceThickness??n.traceWidth,viaDiameter:r.viaDiameter??n.viaDiameter,route:(r.route??[]).map((i)=>({x:i.x,y:i.y,z:i.z,...i.insideJumperPad?{insideJumperPad:!0}:{}})),vias:(r.vias??[]).map((i)=>({x:i.x,y:i.y})),...r.jumpers?{jumpers:r.jumpers}:{}}))},cje=(e,t)=>{if(e.length===0)return null;let n=Math.min(Math.max(t,0),1),o=(e.length-1)*n,r=Math.floor(o),i=Math.ceil(o),s=e[r],a=e[i];return r===i?s:s+(a-s)*(o-r)},p$=(e)=>new Set(e.portPoints.map((t)=>t.connectionName)).size,_Yt=(e)=>!(p$(e)<3)&&(e.availableZ?.length??0)!==1,gYt=(e)=>e?.MULTI_HEAD_POLYLINE_SOLVER?"MultiHeadPolyLineIntraNodeSolver3":e?.CLOSED_FORM_SINGLE_TRANSITION?"SingleTransitionIntraNodeSolver":e?.CLOSED_FORM_TWO_TRACE_SAME_LAYER?"TwoCrossingRoutesHighDensitySolver":e?.CLOSED_FORM_TWO_TRACE_TRANSITION_CROSSING?"SingleTransitionCrossingRouteSolver":e?.HIGH_DENSITY_A01?"HighDensitySolverA01":e?.HIGH_DENSITY_A03?"HighDensitySolverA03":"SingleHighDensityRouteSolver6_VertHorzLayer_FutureCost",AYt=(e)=>{if(e instanceof oqe){let n=gYt(e.hyperParameters);return e.cacheHit?`${n} [cached]`:n}if(e instanceof fbe)return gYt(e.hyperParameters);if(e&&typeof e=="object"&&"getSolverName"in e&&typeof e.getSolverName=="function")return e.getSolverName();let t=e?.constructor;return typeof t?.name=="string"?t.name:"unknown"},fYt=(e)=>e.winningSolver?AYt(e.winningSolver):AYt(e),FCr=class extends ei{getSolverName(){return"Pipeline5HdCacheHighDensitySolver"}unsolvedNodePortPoints;colorMap;connMap;viaDiameter;traceWidth;obstacleMargin;obstacles;layerCount;hdCacheBaseUrl;fetchImpl;nodePfById;routes=[];nodeSolveMetadataById=new Map;launchedRemoteSolves=!1;solvedRoutesByNodeIndex=new Map;failedNodeResults=[];remoteResponseMeasurements=[];constructor({nodePortPoints:e,colorMap:t,connMap:n,viaDiameter:o,traceWidth:r,obstacleMargin:i,obstacles:s,layerCount:a,nodePfById:c,hdCacheBaseUrl:l,fetchImpl:h}){super(),this.unsolvedNodePortPoints=e,this.colorMap=t??{},this.connMap=n,this.viaDiameter=o??0.3,this.traceWidth=r??0.15,this.obstacleMargin=i??0.15,this.obstacles=s??[],this.layerCount=a??2,this.hdCacheBaseUrl=l??"https://hd-cache.tscircuit.com",this.fetchImpl=(h??globalThis.fetch).bind(globalThis),this.nodePfById=c instanceof Map?new Map(c):new Map(Object.entries(c??{})),this.pendingEffects=[],this.stats={localDirectNodeCount:0,localSolvedNodeCount:0,localFallbackNodeCount:0,remoteFallbackNodeCount:0,remoteRequestsStarted:0,remoteRequestsCompleted:0,remoteResponseSampleCount:0,remoteKOrderSampleCount:0,slowestRemoteResponseMs:null,slowestRemoteResponseNodeId:null,p50RemoteResponseMs:null,p50RemoteKOrder:null,p95RemoteKOrder:null,remoteSources:{}}}computeProgress(){return this.unsolvedNodePortPoints.length===0?1:this.nodeSolveMetadataById.size/this.unsolvedNodePortPoints.length}solveNodeLocally(e,t,n={}){let o=new XV({nodeWithPortPoints:e,colorMap:this.colorMap,connMap:this.connMap,viaDiameter:this.viaDiameter,traceWidth:this.traceWidth,obstacleMargin:this.obstacleMargin,obstacles:this.obstacles,layerCount:this.layerCount});if(o.solve(),o.failed){let i=o.error??`Local intra-node solver failed for ${e.capacityMeshNodeId}`,s=p$(e);return this.failedNodeResults.push({node:e,error:n.remoteFailure&&n.resolution==="local-fallback"?`Remote solve failed (${n.remoteFailure}); local fallback failed (${i})`:i}),void this.recordNodeSolveMetadata(e,{status:"failed",resolution:"failed",solverType:fYt(o),supervisorType:o.getSolverName(),iterations:o.iterations,pairCount:s,routeCount:0,remoteAttempt:n.resolution==="local-fallback"?{attempted:!0,endpoint:S3e(this.hdCacheBaseUrl),source:"error",durationMs:n.remoteDurationMs,error:n.remoteFailure??i}:{attempted:!1},error:i})}this.solvedRoutesByNodeIndex.set(t,o.solvedRoutes);let r=p$(e);this.recordNodeSolveMetadata(e,{status:"solved",resolution:n.resolution??"local",solverType:fYt(o),supervisorType:o.getSolverName(),iterations:o.iterations,pairCount:r,routeCount:o.solvedRoutes.length,remoteAttempt:n.resolution==="local-fallback"?{attempted:!0,endpoint:S3e(this.hdCacheBaseUrl),source:"error",durationMs:n.remoteDurationMs,error:n.remoteFailure}:{attempted:!1}}),n.resolution==="local-fallback"?(this.stats.localFallbackNodeCount+=1,this.stats.remoteFallbackNodeCount+=1):this.stats.localDirectNodeCount+=1,this.stats.localSolvedNodeCount+=1}async solveNodeViaHdCache(e,t){let n=S3e(this.hdCacheBaseUrl),o={"content-type":"application/json"},r={nodeWithPortPoints:e},i=JSON.stringify(r),s=Date.now(),a,c,l,h=null,d=null;try{let _=await this.fetchImpl(n,{method:"POST",headers:o,body:i});if(a=_.status,c=_.ok,l=await _.text(),h=Date.now()-s,d=l?JSON.parse(l):null,!_.ok)throw Error(d?.message??l??`hd-cache request failed with status ${_.status}`);if(!d?.ok||d.routes===null)throw Error(d?.message??`hd-cache returned no routes for ${e.capacityMeshNodeId}`);let p=HCr(e,d.routes,{traceWidth:this.traceWidth,viaDiameter:this.viaDiameter});this.solvedRoutesByNodeIndex.set(t,p),this.recordNodeSolveMetadata(e,{status:"solved",resolution:"remote",solverType:`hd-cache.tscircuit.com [${d.source}]`,iterations:null,pairCount:p$(e),routeCount:p.length,remoteAttempt:{attempted:!0,endpoint:S3e(this.hdCacheBaseUrl),source:d.source,durationMs:h}}),this.recordRemoteSource(d.source)}catch(_){h??=Date.now()-s;let p=((m)=>m instanceof Error?m.message:String(m))(_);this.recordFailedHdCacheRequest({nodeId:e.capacityMeshNodeId,pairCount:p$(e),failedAt:new Date().toISOString(),durationMs:h,error:p,url:n,request:{method:"POST",headers:o,body:i,bodyJson:r},response:a!==void 0||c!==void 0||l!==void 0||d!==null?{status:a,ok:c,text:l,body:d}:void 0}),this.recordRemoteSource("error"),this.solveNodeLocally(e,t,{resolution:"local-fallback",remoteFailure:p,remoteDurationMs:h})}finally{this.recordRemoteResponseMetrics(e.capacityMeshNodeId,h??Date.now()-s,(u=d?.kOrder,typeof u=="number"&&Number.isFinite(u)?d.kOrder:null)),this.stats.remoteRequestsCompleted+=1}var u}launchRemoteSolves(){let e=[];this.unsolvedNodePortPoints.forEach((t,n)=>{if(!_Yt(t))return void this.solveNodeLocally(t,n);let o={name:`hd-cache:${t.capacityMeshNodeId}`,promise:Promise.resolve()};o.promise=this.solveNodeViaHdCache(t,n).finally(()=>{this.pendingEffects=this.pendingEffects?.filter((r)=>r!==o)}),e.push(o)}),this.pendingEffects=e,this.stats.remoteRequestsStarted=e.length}recordRemoteSource(e){this.stats.remoteSources[e]=(this.stats.remoteSources[e]??0)+1}recordRemoteResponseMetrics(e,t,n){this.remoteResponseMeasurements.push({nodeId:e,durationMs:t,kOrder:n}),this.stats.remoteResponseSampleCount=this.remoteResponseMeasurements.length,this.stats.remoteKOrderSampleCount=this.remoteResponseMeasurements.filter((s)=>s.kOrder!==null).length;let o=null;for(let s of this.remoteResponseMeasurements)(!o||s.durationMs>o.durationMs)&&(o=s);this.stats.slowestRemoteResponseMs=o?.durationMs??null,this.stats.slowestRemoteResponseNodeId=o?.nodeId??null;let r=this.remoteResponseMeasurements.map((s)=>s.durationMs).sort((s,a)=>s-a);this.stats.p50RemoteResponseMs=cje(r,0.5);let i=this.remoteResponseMeasurements.map((s)=>s.kOrder).filter((s)=>s!==null).sort((s,a)=>s-a);this.stats.p50RemoteKOrder=cje(i,0.5),this.stats.p95RemoteKOrder=cje(i,0.95)}recordFailedHdCacheRequest(e){let t=(()=>{if(typeof window>"u")return null;let n=window;return Array.isArray(n.__FAILED_HD_CACHE_REQUESTS)||(n.__FAILED_HD_CACHE_REQUESTS=[]),n.__FAILED_HD_CACHE_REQUESTS})();t&&t.push(e)}recordNodeSolveMetadata(e,t){this.nodeSolveMetadataById.set(e.capacityMeshNodeId,{...t,node:e,nodePf:this.nodePfById.get(e.capacityMeshNodeId)??null})}ensureFailedNodeMetadata(){for(let e of this.failedNodeResults)this.nodeSolveMetadataById.has(e.node.capacityMeshNodeId)||this.recordNodeSolveMetadata(e.node,{status:"failed",resolution:"failed",solverType:"unknown",iterations:null,pairCount:p$(e.node),routeCount:0,remoteAttempt:{attempted:_Yt(e.node),source:"error",error:e.error},error:e.error})}getVisibleRoutes(){if(this.solved)return this.routes;let e=[];for(let t=0;t<this.unsolvedNodePortPoints.length;t++)e.push(...this.solvedRoutesByNodeIndex.get(t)??[]);return e}createNodeMarkerLabel(e,t){return["hd_node_marker",`node: ${e}`,`status: ${t.status}`,`resolution: ${t.resolution}`,`solver: ${t.solverType}`,...t.supervisorType?[`supervisor: ${t.supervisorType}`]:[],...t.iterations!==null?[`iterations: ${t.iterations}`]:[],`pairCount: ${t.pairCount}`,`routes: ${t.routeCount}`,`nodePf: ${t.nodePf??"n/a"}`,"remoteAttempted: "+(t.remoteAttempt.attempted?"yes":"no"),...t.remoteAttempt.source?[`remoteSource: ${t.remoteAttempt.source}`]:[],...t.remoteAttempt.durationMs!==void 0?[`remoteDurationMs: ${t.remoteAttempt.durationMs}`]:[],...t.remoteAttempt.error?[`remoteError: ${t.remoteAttempt.error}`]:[],`portPoints: ${t.node.portPoints.length}`,...t.error?[`error: ${t.error}`]:[]].join(`
`)}_step(){if(!this.launchedRemoteSolves)return this.launchedRemoteSolves=!0,void this.launchRemoteSolves();if(!((this.pendingEffects?.length??0)>0)){if(this.failedNodeResults.length>0){this.ensureFailedNodeMetadata();let e=this.failedNodeResults[0];return this.failed=!0,void(this.error=`Failed to solve ${this.failedNodeResults.length} nodes via hd-cache. First failure: ${e?.node.capacityMeshNodeId} (${e?.error})`)}this.routes=[];for(let e=0;e<this.unsolvedNodePortPoints.length;e++)this.routes.push(...this.solvedRoutesByNodeIndex.get(e)??[]);this.solved=!0}}visualize(){let e={lines:[],points:[],rects:[],circles:[]};for(let t of this.getVisibleRoutes()){let n=Abe(t.route,t.connectionName,this.colorMap[t.connectionName]);for(let o of n)e.lines.push({points:o.points,label:o.connectionName,strokeColor:o.z===0?o.color:zi(o.color,0.75),layer:`z${o.z}`,strokeWidth:t.traceThickness,strokeDash:o.z!==0?"10, 5":void 0});for(let o of t.vias)e.circles.push({center:o,layer:"z0,1",radius:t.viaDiameter/2,fill:this.colorMap[t.connectionName],label:`${t.connectionName} via`})}for(let[t,n]of this.nodeSolveMetadataById){let o=n.node.center.x-n.node.width/2,r=n.node.center.x+n.node.width/2,i=n.node.center.y-n.node.height/2,s=n.node.center.y+n.node.height/2,a=this.createNodeMarkerLabel(t,n),c=n.status==="solved"?"blue":"red",l=n.status==="solved"?0.03:0.08;if(e.lines.push({points:[{x:o,y:i},{x:r,y:i}],layer:"hd_node_boundaries",strokeColor:c,strokeDash:"6, 4",strokeWidth:l,label:a},{points:[{x:r,y:i},{x:r,y:s}],layer:"hd_node_boundaries",strokeColor:c,strokeDash:"6, 4",strokeWidth:l,label:a},{points:[{x:r,y:s},{x:o,y:s}],layer:"hd_node_boundaries",strokeColor:c,strokeDash:"6, 4",strokeWidth:l,label:a},{points:[{x:o,y:s},{x:o,y:i}],layer:"hd_node_boundaries",strokeColor:c,strokeDash:"6, 4",strokeWidth:l,label:a}),n.status==="solved")e.points.push({x:n.node.center.x,y:n.node.center.y,color:c,layer:"hd_node_markers",label:a});else{e.lines.push({points:[{x:0,y:0},{x:n.node.center.x,y:n.node.center.y}],layer:"hd_failed_node_guides",strokeColor:c,strokeDash:"8, 6",strokeWidth:0.05,label:a});let h=Math.max(n.node.width,1.2),d=Math.max(n.node.height,1.2),u=h/2,_=d/2;e.rects.push({center:n.node.center,layer:"hd_node_markers",width:h,height:d,fill:"rgba(255, 0, 0, 0.3)",stroke:c,label:a}),e.circles.push({center:n.node.center,radius:Math.max(0.6*Math.max(h,d),1.1),layer:"hd_node_markers",fill:"rgba(255, 0, 0, 0.08)",stroke:c,label:a}),e.lines.push({points:[{x:n.node.center.x-u,y:n.node.center.y-_},{x:n.node.center.x+u,y:n.node.center.y+_}],layer:"hd_node_markers",strokeColor:c,strokeWidth:0.16,label:a},{points:[{x:n.node.center.x-u,y:n.node.center.y+_},{x:n.node.center.x+u,y:n.node.center.y-_}],layer:"hd_node_markers",strokeColor:c,strokeWidth:0.16,label:a})}}return e}},can=class extends jZe{hdCacheBaseUrl;hdCacheFetch;constructor(e,t={}){super(e,{...t,maxNodeDimension:t.maxNodeDimension??7,maxNodeRatio:t.maxNodeRatio??4}),this.hdCacheBaseUrl=t.hdCacheBaseUrl??"https://hd-cache.tscircuit.com",this.hdCacheFetch=t.hdCacheFetch,this.replaceHighDensityPipelineStep()}replaceHighDensityPipelineStep(){let e=this.pipelineDef.findIndex((t)=>t.solverName==="highDensityRouteSolver");if(e===-1)throw Error("Pipeline4 highDensityRouteSolver step is missing");this.pipelineDef[e]={...this.pipelineDef[e],solverClass:FCr,getConstructorParams:(t)=>{let n=t.uniformPortDistributionSolver?.getOutput()??[],o=t.portPointPathingSolver?.getOutput().nodesWithPortPoints??[],r=n.length>0?n:o;return t.highDensityNodePortPoints=structuredClone(r),[{nodePortPoints:r,nodePfById:new Map((t.portPointPathingSolver?.getOutput().inputNodeWithPortPoints??[]).map((i)=>[i.capacityMeshNodeId,t.portPointPathingSolver?.computeNodePf(i)??null])),colorMap:t.colorMap,connMap:t.connMap,viaDiameter:t.viaDiameter,traceWidth:t.minTraceWidth,obstacleMargin:t.srj.defaultObstacleMargin??0.15,obstacles:t.srj.obstacles,layerCount:t.srj.layerCount,hdCacheBaseUrl:t.hdCacheBaseUrl,fetchImpl:t.hdCacheFetch}]}}}async stepAsync(){if(this.solved||this.failed)return;this.step();let e=aan(this);e.length!==0&&(await Promise.race(e.map((t)=>t.promise.then(()=>t.name,()=>t.name))),this.solved||this.failed||this.step())}async solveAsync(){let e=Date.now();for(;!this.solved&&!this.failed;)await this.stepAsync();this.timeToSolve=Date.now()-e}solve(){throw Error("AutoroutingPipelineSolver5_HdCache requires async execution. Use solveAsync() or stepAsync().")}};var vLs=Math.PI/2;var zCr=0.1,OCr=0.15,VCr=zCr+OCr,SLs=3*VCr/4;var PLs=Dje(x0r(),1);var ELs=(Number.POSITIVE_INFINITY,0.000000001);var MLs=(new Int32Array(0),(e)=>(e.ccwRotationDegrees??0)*Math.PI/180);var vp=(e,t)=>{if(e==="top")return 0;if(e==="bottom")return t-1;let n=/^inner(\d+)$/.exec(e);if(!n)return-1;let o=Number(n[1]);return o>0&&o<t-1?o:-1},ev=(e,t)=>e===0?"top":e===t-1?"bottom":`inner${e}`,Tq=(e,t,n)=>{let o=vp(e,n),r=vp(t,n);if(o<0||r<0)return[];let i=Math.min(o,r),s=Math.max(o,r);return Array.from({length:s-i+1},(a,c)=>ev(i+c,n))},Jle=(e,t)=>{let n=[],o=[],r=e.route.find((c)=>c.route_type==="wire"),i=r?.route_type==="wire"?r.width:null,s={"0603":0.95,1206:1.8,"1206x4_pair":1.8},a=null;for(let c=0;c<e.route.length;c++){let l=e.route[c];if(l.route_type==="wire"){if(!Number.isFinite(l.x)||!Number.isFinite(l.y)||!Number.isFinite(l.width)||l.width<=0||vp(l.layer,t)<0)throw Error(`PostProcessingSolver: immutable trace "${e.connection_name}" has an invalid wire`);if(a&&a.layer!==l.layer)throw Error(`PostProcessingSolver: immutable trace "${e.connection_name}" changes layer without a transition`);a&&n.push({start:a,end:l,layer:l.layer,width:Math.max(a.width,l.width),connectionName:e.connection_name,terminal:null}),a=l;continue}if(l.route_type==="via"){let _=Tq(l.from_layer,l.to_layer,t),p=a,m=l.via_diameter??p?.width??i;if(!Number.isFinite(l.x)||!Number.isFinite(l.y)||_.length<2||m===null||!Number.isFinite(m)||m<=0||l.via_hole_diameter!==void 0&&(!Number.isFinite(l.via_hole_diameter)||l.via_hole_diameter<=0||m!==null&&l.via_hole_diameter>=m))throw Error(`PostProcessingSolver: immutable trace "${e.connection_name}" has an invalid via`);p&&Math.hypot(p.x-l.x,p.y-l.y)>0.00000001&&n.push({start:p,end:l,layer:p.layer,width:p.width,connectionName:e.connection_name,terminal:null}),o.push({x:l.x,y:l.y,layers:_,diameter:m,connectionName:e.connection_name,terminal:c===0?"start":c===e.route.length-1?"end":null});let A=e.route.slice(c+1).find((f)=>f.route_type==="wire"),g=p?.layer===l.from_layer?l.to_layer:p?.layer===l.to_layer?l.from_layer:A?.route_type!=="wire"||A.layer!==l.from_layer&&A.layer!==l.to_layer?null:A.layer;if(!g)throw Error(`PostProcessingSolver: immutable trace "${e.connection_name}" has a discontinuous via`);a={x:l.x,y:l.y,layer:g,width:p?.width??i??m};continue}if(l.route_type==="jumper"){let _=s[l.footprint];if(!Number.isFinite(l.start.x)||!Number.isFinite(l.start.y)||!Number.isFinite(l.end.x)||!Number.isFinite(l.end.y)||vp(l.layer,t)<0)throw Error(`PostProcessingSolver: immutable trace "${e.connection_name}" has an invalid jumper`);if(a&&(a.layer!==l.layer||Math.hypot(a.x-l.start.x,a.y-l.start.y)>0.00000001))throw Error(`PostProcessingSolver: immutable trace "${e.connection_name}" has a discontinuous jumper`);n.push({start:l.start,end:l.end,layer:l.layer,width:_,connectionName:e.connection_name,terminal:null}),a={...l.end,layer:l.layer,width:_};continue}let h=Tq(l.from_layer,l.to_layer,t);if(!Number.isFinite(l.start.x)||!Number.isFinite(l.start.y)||!Number.isFinite(l.end.x)||!Number.isFinite(l.end.y)||!Number.isFinite(l.width)||l.width<=0||h.length<2)throw Error(`PostProcessingSolver: immutable trace "${e.connection_name}" has invalid through-obstacle copper`);if(a&&(a.layer!==l.from_layer&&a.layer!==l.to_layer||Math.hypot(a.x-l.start.x,a.y-l.start.y)>0.00000001))throw Error(`PostProcessingSolver: immutable trace "${e.connection_name}" has discontinuous through-obstacle copper`);for(let _ of h)n.push({start:l.start,end:l.end,layer:_,width:l.width,connectionName:e.connection_name,terminal:null});let d=a,u=d?.layer===l.to_layer?l.from_layer:l.to_layer;a={...l.end,layer:u,width:l.width}}return{segments:n,vias:o}},$V=(e)=>e.rootConnectionName??e.connectionName,e$=(e,t)=>e.flatMap((n,o)=>$V(n)===t?[o]:[]),a6=(e,t,n,o)=>{let r=(u,_,p)=>{let m=p.x-_.x,A=p.y-_.y,g=u.x-_.x,f=u.y-_.y,y=m**2+A**2,x=y===0?0:Math.max(0,Math.min(1,(g*m+f*A)/y));return Math.hypot(u.x-(_.x+x*m),u.y-(_.y+x*A))},i={x:t.x-e.x,y:t.y-e.y},s={x:o.x-n.x,y:o.y-n.y},a={x:n.x-e.x,y:n.y-e.y},c=(u,_)=>u.x*_.y-u.y*_.x,l=c(i,s),h=Math.hypot(i.x,i.y),d=0.000000000001*(h*Math.hypot(s.x,s.y)+1);if(Math.abs(l)>d){let u=c(a,s)/l,_=c(a,i)/l;if(u>=-0.000000000001&&u<=1.000000000001&&_>=-0.000000000001&&_<=1.000000000001)return 0}else if(h>0.000000000001&&Math.abs(c(a,i))<=d){let u=Math.abs(i.x)>=Math.abs(i.y),_=Math.min(u?e.x:e.y,u?t.x:t.y),p=Math.max(u?e.x:e.y,u?t.x:t.y),m=Math.min(u?n.x:n.y,u?o.x:o.y),A=Math.max(u?n.x:n.y,u?o.x:o.y);if(Math.max(_,m)<=Math.min(p,A)+0.000000000001)return 0}return Math.min(r(e,n,o),r(t,n,o),r(n,e,t),r(o,e,t))},KZe=(e,t)=>Math.hypot(t.x-e.x,t.y-e.y),tB=(e)=>{let t=0;for(let n=0;n<e.route.length-1;n++)t+=KZe(e.route[n],e.route[n+1]);return t},t$=(e,t)=>t.reduce((n,o)=>n+tB(e[o]),0),Xq=(e,t)=>{let{__zLayers:n,zLayers:o}=e,r=n!==void 0?n:o;if(r!==void 0){if(!Array.isArray(r)||r.length===0||r.some((i)=>!Number.isInteger(i)||i<0||i>=t))throw Error("Obstacle has invalid z-layer indexes");return r}if(e.layers.length===0)throw Error("Obstacle has no declared layers");return e.layers.map((i)=>{if(i==="top")return 0;if(i==="bottom")return t-1;let s=/^inner(\d+)$/.exec(i),a=s?Number(s[1]):-1;if(a<=0||a>=t-1)throw Error(`Obstacle has invalid layer name "${i}"`);return a})},m$=(e)=>{let t=(a,c,l,h)=>{let d=l.center.x-l.width/2-h,u=l.center.x+l.width/2+h,_=l.center.y-l.height/2-h,p=l.center.y+l.height/2+h;if(a.x>=d&&a.x<=u&&a.y>=_&&a.y<=p||c.x>=d&&c.x<=u&&c.y>=_&&c.y<=p)return!0;let m=[{x:d,y:_},{x:u,y:_},{x:u,y:p},{x:d,y:p}];return m.some((A,g)=>a6(a,c,A,m[(g+1)%m.length])===0)};if(e.bounds&&e.meanderPoints.some((a)=>a.x<e.bounds.minX||a.x>e.bounds.maxX||a.y<e.bounds.minY||a.y>e.bounds.maxY))return!1;let n=(a,c,l)=>{let h=l.x-c.x,d=l.y-c.y,u=h*h+d*d,_=u===0?0:Math.max(0,Math.min(1,((a.x-c.x)*h+(a.y-c.y)*d)/u));return Math.hypot(a.x-(c.x+_*h),a.y-(c.y+_*d))},o=e.meanderPoints.some((a)=>!e.route.route.slice(1).some((c,l)=>{let h=e.route.route[l];return h.z===a.z&&c.z===a.z&&n(a,h,c)<=0.000000001})),r=(e.traces??[]).map((a)=>Jle(a,e.layerCount)),i=$V(e.route),s=e.route.traceThickness/2+e.obstacleMargin;for(let a=0;a<e.meanderPoints.length-1;a++){let c=e.meanderPoints[a],l=e.meanderPoints[a+1],h=e.route.route.slice(1).some((u,_)=>{let p=e.route.route[_];return c.z===l.z&&p.z===c.z&&u.z===l.z&&n(c,p,u)<=0.000000001&&n(l,p,u)<=0.000000001});if(o&&h)continue;for(let u of e.obstacles){if(!Xq(u,e.layerCount).includes(c.z))continue;let _=a===0||a===e.meanderPoints.length-2;if((!u.connectedTo.includes(i)||!_)&&t(c,l,u,s))return!1}let d=ev(c.z,e.layerCount);for(let{segments:u,vias:_}of r){for(let p of u)if(p.layer===d&&a6(c,l,p.start,p.end)<s+p.width/2)return!1;for(let p of _)if(p.layers.includes(d)&&n(p,c,l)<s+p.diameter/2)return!1}for(let u of e.routedRoutes){let _=$V(u)===i;for(let p of u.vias){if(p.zLayers&&!p.zLayers.includes(c.z))continue;let m=Math.hypot(p.x-c.x,p.y-c.y)<=0.00000001||Math.hypot(p.x-l.x,p.y-l.y)<=0.00000001,A=e.route.traceThickness/2+u.viaDiameter/2+e.obstacleMargin;if((!_||!m)&&n(p,c,l)<A)return!1}if(!_)for(let p=0;p<u.route.length-1;p++){let m=u.route[p],A=u.route[p+1];if(c.z!==m.z||c.z!==A.z)continue;let g=e.route.traceThickness/2+u.traceThickness/2+e.obstacleMargin;if(a6(c,l,m,A)<g)return!1}}}return!0},yYt=(e)=>{let t=[];for(let o of e.routeIndexes){let r=e.routes[o],i=e.minMeanderGap??Math.max(0.3,2*r.traceThickness),s=r.traceThickness+i,a=Math.max(e.minimumToothPitch??0,2*s),c=e.minMeanderHeight??s;for(let l=0;l<r.route.length-1;l++){let h=r.route[l],d=r.route[l+1],u=KZe(h,d);if(u<=0||h.z!==d.z)continue;let _=Math.min(Math.max(0,Math.floor(u/a)-1),e.maxToothCount);for(let p=1;p<=_;p++){let m=u/(p+1),A=[m,Math.sqrt(a*m),a].filter((f,y,x)=>x.findIndex((C)=>Math.abs(C-f)<0.000000001)===y),g=p%2==0?["balanced","negative","positive"]:["negative","positive"];for(let f of A)for(let y of g)t.push({routeIndex:o,segmentIndex:l,segmentLength:u,toothCount:p,maximumDepth:e.maximumDepth,minimumHeight:c,toothPitch:f,placement:y,heightProfile:p>1?"tapered":"uniform"})}}}let n={balanced:0,negative:1,positive:2};return t.sort((o,r)=>o.toothCount-r.toothCount||n[o.placement]-n[r.placement]||r.toothPitch-o.toothPitch||r.segmentLength-o.segmentLength)},YCr=(e)=>{if(e.centerlineDistanceCost===null)return 0;let t=e.predictedToothDepths.flatMap((g,f)=>g>0?[f]:[]);if(t.length===0)return 0;let n=t.map((g)=>e.predictedToothDepths[g]),o=Math.max(...n),r=n.reduce((g,f)=>g+f,0)/n.length,i=Math.sqrt(n.reduce((g,f)=>g+(f-r)**2,0)/n.length),s=t[0],a=(t.at(-1)-s+1)*e.toothPitch,c=o/(e.toothPitch/2),l=e.addedLength/a,h=c/(1+c)*40,d=l/(1+l)*30,u=e.predictedToothDepths.map((g,f)=>Math.sin(Math.PI*(f+1)/(e.predictedToothDepths.length+1))),_=Math.max(...u),p=Math.sqrt(e.predictedToothDepths.reduce((g,f,y)=>g+(f-o*u[y]/_)**2,0)/e.predictedToothDepths.length),m=100-h-d-Math.min(10,(e.heightProfile==="tapered"?p:i)/r*10)-2*(n.length-1)-7*Math.min(1,e.addedLength/e.segmentLength)-100*e.centerlineDistanceCost,A=e.centerlineDistanceCost>0?m:Math.max(0,m);return Math.round(1e6*A)/1e6},N$=(e)=>{if(e.toothDepths.length!==e.toothCount)throw Error(`LengthMatchingSolver: expected ${e.toothCount} tooth depths, received ${e.toothDepths.length}`);if(e.toothDepths.some((c)=>!Number.isFinite(c)||c<0))throw Error("LengthMatchingSolver: every meander tooth depth must be a non-negative finite number");let t=e.route.route[e.segmentIndex],n=e.route.route[e.segmentIndex+1],o=KZe(t,n),r=(n.x-t.x)/o,i=(n.y-t.y)/o,s=(o-(e.toothCount-0.5)*e.toothPitch)/2,a=[{...t}];for(let c=0;c<e.toothCount;c++){let l=e.toothDepths[c];if(l===0)continue;let h=e.placement==="balanced"?c%2==0?-1:1:e.placement==="negative"?-1:1,d={x:-i*h,y:r*h},u=s+c*e.toothPitch,_=u+e.toothPitch/2,p={...t,x:t.x+r*u,y:t.y+i*u};a.push(p,{...p,x:p.x+d.x*l,y:p.y+d.y*l},{...t,x:t.x+r*_+d.x*l,y:t.y+i*_+d.y*l},{...t,x:t.x+r*_,y:t.y+i*_})}return a.push({...n}),((c)=>{if(c.length<3)return c;let l=[{...c[0]}];for(let h=1;h<c.length-1;h++){let d=c[h-1],u=c[h],_=c[h+1],p=Math.hypot(u.x-d.x,u.y-d.y),m=Math.hypot(_.x-u.x,_.y-u.y);if(p===0||m===0)throw Error("LengthMatchingSolver: meander contains a zero-length segment");let A={x:(u.x-d.x)/p,y:(u.y-d.y)/p},g={x:(_.x-u.x)/m,y:(_.y-u.y)/m};if(Math.abs(A.x*g.y-A.y*g.x)<0.000000001){l.push({...u});continue}let f=Math.min(p,m)/2,y={...u,x:u.x-A.x*f,y:u.y-A.y*f},x={...u,x:u.x+g.x*f,y:u.y+g.y*f},C=l.at(-1);y.x===C.x&&y.y===C.y||l.push(y);for(let b=1;b<6;b++){let I=b/6,v=1-I;l.push({...u,x:v**2*y.x+2*v*I*u.x+I**2*x.x,y:v**2*y.y+2*v*I*u.y+I**2*x.y})}l.push(x)}return l.push({...c[c.length-1]}),l})(a)},_$=(e)=>[...e.route.route.slice(0,e.segmentIndex),...N$(e),...e.route.route.slice(e.segmentIndex+2)],Rce=(e)=>{let t=tB(e.route),n=(()=>{let H=[];for(let V=0;V<e.candidate.toothCount;V++){let O=Array(e.candidate.toothCount).fill(0);O[V]=e.candidate.maximumDepth;let U=N$({...e.candidate,route:e.route,toothDepths:O});if(e.isGeometryValid(U)){H.push(e.candidate.maximumDepth);continue}let j=0,Y=e.candidate.maximumDepth;for(let X=0;X<32;X++){let K=(j+Y)/2,J=Array(e.candidate.toothCount).fill(0);J[V]=K;let ee=N$({...e.candidate,route:e.route,toothDepths:J});e.isGeometryValid(ee)?j=K:Y=K}H.push(j)}return H})(),o=((H)=>{if(H.heightProfile!=="tapered")return Array(H.toothCount).fill(1);let V=Array.from({length:H.toothCount},(U,j)=>Math.sin(Math.PI*(j+1)/(H.toothCount+1))),O=Math.max(...V);return V.map((U)=>U/O)})(e.candidate),r=e.candidate.maximumDepth,i=n.map((H,V)=>Math.min(H,r*o[V])),s=[0.25,0.75],a=i.map((H)=>H*s[0]),c=i.map((H)=>H*s[1]),l=_$({...e.candidate,route:e.route,toothDepths:a}),h=_$({...e.candidate,route:e.route,toothDepths:c}),d=[tB({...e.route,route:l})-t,tB({...e.route,route:h})-t],u=_$({...e.candidate,route:e.route,toothDepths:i}),_=tB({...e.route,route:u})-t,p=(d[1]-d[0])/(s[1]-s[0]),m=d[0]-p*s[0],A=p>0&&Number.isFinite(p)?(e.targetAddedLength-m)/p:0,g=Math.min(e.targetAddedLength,_),f=e.targetAddedLength>0&&g>0?((H)=>{let V=0,O=e.candidate.maximumDepth;for(let j=0;j<32;j++){let Y=(V+O)/2,X=H.maximumToothDepths.map((se,ne)=>Math.min(se,Y*H.toothHeightWeights[ne])),K=_$({...e.candidate,route:e.route,toothDepths:X}),J=tB({...e.route,route:K})-H.originalLength,ee=N$({...e.candidate,route:e.route,toothDepths:X});e.isGeometryValid(ee)?J<H.targetAddedLength?V=Y:O=Y:O=Y}let U=(V+O)/2;return{depthLevel:U,toothDepths:H.maximumToothDepths.map((j,Y)=>Math.min(j,U*H.toothHeightWeights[Y]))}})({maximumToothDepths:n,toothHeightWeights:o,originalLength:t,targetAddedLength:g}):{depthLevel:A*r,toothDepths:i.map((H)=>Math.max(0,H*A))},y=f.depthLevel/r,x=f.toothDepths,C=_$({...e.candidate,route:e.route,toothDepths:x}),b=tB({...e.route,route:C})-t,I=Math.abs(g-b),v=N$({...e.candidate,route:e.route,toothDepths:x}),P=0;if(e.getCenterlineDistanceCost&&(P=e.getCenterlineDistanceCost(v)),P!==null&&(!Number.isFinite(P)||P<0))throw Error("LengthMatchingSolver: meander centerline distance cost must be a non-negative finite number");let M=Number.isFinite(y)&&y>0&&y<=1,B=x.every((H)=>H===0||H>=e.candidate.minimumHeight),T=e.isGeometryValid(v),N,D=null;P===null?D="no-paired-same-layer-geometry":M?I>e.lengthTolerance?D="target-error":T?B||(D="below-minimum-height"):D="invalid-geometry":D="invalid-scale",N=D?{valid:!1,invalidReason:D}:{valid:!0,invalidReason:null};let L={...e.candidate,connectionName:e.connectionName,maximumToothDepths:n,sampleScaleFactors:s,sampleAddedLengths:d,slope:p,intercept:m,predictedScaleFactor:y,predictedToothDepths:x,predictedRoute:C,addedLength:b,maximumAddedLength:_,resultingError:I,testedSegment:[{...e.route.route[e.candidate.segmentIndex]},{...e.route.route[e.candidate.segmentIndex+1]}],meanderPoints:v,centerlineDistanceCost:P,qualityScore:0,...N};return{...L,qualityScore:YCr(L)}},GCr=(e)=>{let t=((l)=>{if(l.heightProfile!=="tapered")return Array(l.toothCount).fill(1);let h=Array.from({length:l.toothCount},(u,_)=>Math.sin(Math.PI*(_+1)/(l.toothCount+1))),d=Math.max(...h);return h.map((u)=>u/d)})(e.candidate),n=Math.max(...t.map((l)=>e.candidate.minimumHeight/l)),o=e.candidate.maximumDepth/1073741824,r=t.map((l)=>l*(n+o));if(r.some((l)=>l>e.candidate.maximumDepth))return null;let i=N$({...e.candidate,route:e.route,toothDepths:r});if(!e.isGeometryValid(i))return null;let s=_$({...e.candidate,route:e.route,toothDepths:r}),a=tB({...e.route,route:s})-tB(e.route),c=Rce({...e,targetAddedLength:a});return c.valid?c:null},xYt=(e)=>{let t=(c,l)=>{let h=c[l.routeIndex];if(!h)throw Error(`LengthMatchingSolver: dual meander references missing route ${l.routeIndex}`);let d=[...c];return d[l.routeIndex]={...h,route:l.predictedRoute},d},n=(()=>{if(e.targetAddedLength+e.config.lengthTolerance<e.plan.minimumAddedLength||e.targetAddedLength-e.config.lengthTolerance>e.plan.maximumAddedLength)return null;let c=e.plan.attemptOptions.map((d)=>Math.min(...d.map((u)=>u.attempt.addedLength))),l=Math.max(0,e.targetAddedLength-e.plan.minimumAddedLength),h=c.map((d,u)=>u);for(;l>0.000000001&&h.length>0;){let d=l/h.length,u=0,_=[];for(let p of h){let m=Math.max(...e.plan.attemptOptions[p].map((g)=>g.attempt.maximumAddedLength))-c[p],A=Math.min(m,d);c[p]+=A,u+=A,m-A>0.000000001&&_.push(p)}if(u<=0.000000001)break;l-=u,h=_}return l<=e.config.lengthTolerance?c:null})();if(!n)return null;let o=e.plan.attemptOptions.map((c,l)=>({attemptOptions:c,targetAddedLength:n[l]})).sort((c,l)=>l.attemptOptions[0].candidate.routeIndex-c.attemptOptions[0].candidate.routeIndex||l.attemptOptions[0].candidate.segmentIndex-c.attemptOptions[0].candidate.segmentIndex),r=[...e.routes],i=[];for(let c of o){let l=c.attemptOptions[0]?.candidate;if(!l)throw Error("LengthMatchingSolver: empty dual-meander segment options");let h=r[l.routeIndex];if(!h)throw Error(`LengthMatchingSolver: missing planned dual-meander route ${l.routeIndex}`);let d=null;for(let u of c.attemptOptions){if(u.attempt.addedLength-e.config.lengthTolerance>c.targetAddedLength||u.attempt.maximumAddedLength+e.config.lengthTolerance<c.targetAddedLength)continue;let _=Rce({candidate:u.candidate,route:h,connectionName:e.connectionName,targetAddedLength:c.targetAddedLength,lengthTolerance:e.config.lengthTolerance,isGeometryValid:(p)=>m$({route:h,meanderPoints:p,routedRoutes:e.excludedConnectionName?r.filter((m)=>$V(m)!==e.excludedConnectionName):r,...e.config})});_.valid&&(!d||_.qualityScore>d.qualityScore)&&(d=_)}if(!d)return null;r=t(r,d),i.push(d)}let s=i.reduce((c,l)=>c+l.addedLength,0);if(Math.abs(s-e.targetAddedLength)>e.config.lengthTolerance)return null;let a=i[0];if(!a)throw Error("LengthMatchingSolver: fitted an empty dual-meander plan");return{attempts:[a,...i.slice(1)],routes:r,addedLength:s}},q3e=(e)=>{if(e.length===0)throw Error("LengthMatchingSolver: cannot score an empty meander plan");return e.reduce((t,n)=>t+n.qualityScore,0)/e.length-3*(e.length-1)},CYt=(e)=>{let t=(r)=>[r.candidate.toothCount,r.candidate.placement,r.candidate.heightProfile].join(":"),n=new Map;for(let r of e){let i=t(r),s=`${r.candidate.routeIndex}:${r.candidate.segmentIndex}`,a=n.get(i);if(!a){n.set(i,new Map([[s,[r]]]));continue}let c=a.get(s);c?c.push(r):a.set(s,[r])}let o=[];for(let r of n.values()){let i=[...r.values()].map((s)=>({attempts:s,maximumAddedLength:Math.max(...s.map((a)=>a.attempt.maximumAddedLength)),minimumAddedLength:Math.min(...s.map((a)=>a.attempt.addedLength)),rankingAttempt:s.reduce((a,c)=>c.attempt.qualityScore>a.attempt.qualityScore?c:a)})).sort((s,a)=>a.maximumAddedLength-s.maximumAddedLength);for(let s of i)o.push({attempts:[s.rankingAttempt],attemptOptions:[s.attempts],minimumAddedLength:s.minimumAddedLength,maximumAddedLength:s.maximumAddedLength,rankingQualityScore:s.rankingAttempt.attempt.qualityScore});for(let s=2;s<=i.length;s++){let a=i.slice(0,s),c=a.map((l)=>l.rankingAttempt);o.push({attempts:c,attemptOptions:a.map((l)=>l.attempts),minimumAddedLength:a.reduce((l,h)=>l+h.minimumAddedLength,0),maximumAddedLength:a.reduce((l,h)=>l+h.maximumAddedLength,0),rankingQualityScore:q3e(c.map((l)=>l.attempt))})}}return o},J3e=class extends Error{connectionName;reason;constructor(e){super(e.message),this.name="LengthMatchingNoSolutionError",this.connectionName=e.connectionName,this.reason=e.reason}},rV=(e)=>[e.routeIndex,e.segmentIndex,e.toothCount,e.placement,e.toothPitch,e.heightProfile,e.maximumDepth,e.minimumHeight].join(":"),bYt=(e)=>{let t=new Map,n=[...e.attempts].sort((r,i)=>r.addedLength-i.addedLength),o=e.targetAddedLength;for(let r=0;r<n.length;r++){let i=n[r],s=Math.min(i.addedLength,o/(n.length-r));t.set(rV(i),{routeIndex:i.routeIndex,segmentIndex:i.segmentIndex,targetAddedLength:s}),o-=s}return t},UCr=(e,t)=>`z${Xq(e,t).join(",")}`,iV=(e)=>`z${e}`,WCr=(e)=>{if(!e.showAttempt)return;if(!e.attempt)return void((i)=>{let s=i.activePair?.candidates[i.activePair.candidateIndex];if(!s)return;let a=i.routes[s.routeIndex];if(!a)return;let c=a.route[s.segmentIndex],l=a.route[s.segmentIndex+1];c&&l&&i.graphics.lines.push({points:[c,l],strokeColor:"rgba(234, 179, 8, 0.6)",strokeWidth:2*a.traceThickness,strokeDash:[0.1,0.1],layer:iV(c.z)})})(e);let t=e.routes[e.attempt.routeIndex],[n,o]=e.attempt.testedSegment,r=e.theme.getConnectionColor(e.attempt.connectionName);e.graphics.lines.push({points:[n,o],strokeColor:e.theme.getTestedSegmentColor(r),strokeWidth:t.traceThickness,strokeDash:[0.15,0.15],layer:iV(n.z)}),e.attempt.valid?e.graphics.lines.push({points:e.attempt.meanderPoints.map(({x:i,y:s})=>({x:i,y:s})),strokeColor:"rgba(234, 179, 8, 0.6)",strokeWidth:2*t.traceThickness,strokeDash:[0.1,0.1],layer:iV(n.z)}):e.graphics.lines.push({points:e.attempt.meanderPoints.map(({x:i,y:s})=>({x:i,y:s})),strokeColor:e.theme.getRejectedCandidateColor(r),strokeWidth:t.traceThickness,strokeDash:[0.1,0.1],layer:iV(n.z)}),e.graphics.points.push({x:n.x,y:n.y,color:r,layer:iV(n.z)},{x:o.x,y:o.y,color:r,layer:iV(o.z)})},XCr=(e)=>{let t={lines:[],points:[],rects:[],circles:[]},n=((o)=>{for(let r of Object.values(o))A$(0,r);return{getConnectionColor:(r,i)=>o[r]??(i?o[i]:void 0)??((s)=>s?`hsl(${300*s.split("").reduce((a,c)=>a+c.charCodeAt(0),0)/s.length%360}, 100%, 50%)`:"rgba(0, 0, 0, 0.5)")(r),getInnerLayerConnectionColor:(r)=>A$(0.5,r),getTestedSegmentColor:(r)=>A$(0.55,r),getRejectedCandidateColor:(r)=>A$(0.45,r),boardBounds:{fill:"rgba(30,41,59,0.03)",stroke:"rgba(30,41,59,0.55)"},obstacle:{fill:"rgba(255,0,0,0.25)",stroke:"rgba(255,0,0,0.5)"},via:{fill:"blue",stroke:"none"}}})(e.colorMap);return((o)=>{for(let r of o.routes){let i=$V(r),s=o.theme.getConnectionColor(i,r.connectionName);for(let c=0;c<r.route.length-1;c++){let l=r.route[c],h=r.route[c+1];l.z===h.z&&o.graphics.lines.push({points:[l,h],strokeColor:l.z===0?s:o.theme.getInnerLayerConnectionColor(s),strokeWidth:r.traceThickness,...l.z===0?{}:{strokeDash:[0.2,0.2]},layer:iV(l.z)})}let a=[...new Set(r.route.map((c)=>c.z))];for(let c of r.vias)o.graphics.circles.push({center:c,radius:r.viaDiameter/2,fill:o.theme.via.fill,stroke:o.theme.via.stroke,layer:`z${(c.zLayers??a).join(",")}`})}})({routes:e.routes,theme:n,graphics:t}),((o)=>{if(o.bounds){let{minX:r,maxX:i,minY:s,maxY:a}=o.bounds;o.graphics.rects.push({center:{x:(r+i)/2,y:(s+a)/2},width:i-r,height:a-s,fill:o.theme.boardBounds.fill,stroke:o.theme.boardBounds.stroke,layer:`z${Array.from({length:o.layerCount},(c,l)=>l).join(",")}`})}for(let r of o.obstacles)o.graphics.rects.push({center:r.center,width:r.width,height:r.height,ccwRotationDegrees:r.ccwRotationDegrees,fill:o.theme.obstacle.fill,stroke:o.theme.obstacle.stroke,layer:UCr(r,o.layerCount)})})({obstacles:e.obstacles,bounds:e.bounds,layerCount:e.layerCount,theme:n,graphics:t}),WCr({routes:e.routes,attempt:e.currentAttempt,activePair:e.activePair,showAttempt:!e.solved,theme:n,graphics:t}),{...t}},lan=class extends Da{constructor(e){super(),this.params=e,this.MAX_ITERATIONS=1e5,this.matchedHdRoutes=e.hdRoutes.map((t)=>({...t,route:t.route.map((n)=>({...n}))})),this.pairs=e.differentialPairs??[]}params;matchedHdRoutes;pairs;nextPairIndex=0;activePair=null;currentAttempt=null;config=null;candidatesTried=0;getSolverName(){return"LengthMatchingSolver"}startNextPair(){let e=this.pairs[this.nextPairIndex++];if(!e)return void(this.solved=!0);((h,d)=>{if(h.connectionNames[0]===h.connectionNames[1])throw Error("LengthMatchingSolver: a differential pair must reference two distinct connections");if(!Number.isFinite(h.lengthTolerance)||h.lengthTolerance<0)throw Error("LengthMatchingSolver: differential pair lengthTolerance must be a non-negative finite number");for(let _ of[h.minimumCenterlineDistance,h.maximumCenterlineDistance])if(_!==void 0&&(!Number.isFinite(_)||_<=0))throw Error("LengthMatchingSolver: differential pair centerline distances must be positive finite numbers");if(h.minimumCenterlineDistance!==void 0&&h.maximumCenterlineDistance!==void 0&&h.minimumCenterlineDistance>h.maximumCenterlineDistance)throw Error("LengthMatchingSolver: differential pair minimumCenterlineDistance cannot exceed maximumCenterlineDistance");let u=new Map(d.map((_)=>[_.name,_]));for(let _ of h.connectionNames){let p=u.get(_);if(!p)throw Error(`LengthMatchingSolver: differential pair references unknown connection "${_}"`);if(p.pointsToConnect.length!==2)throw Error(`LengthMatchingSolver: differential pair connection "${_}" must have exactly two points before MST splitting`)}})(e,this.params.originalConnections);let t=e$(this.matchedHdRoutes,e.connectionNames[0]),n=e$(this.matchedHdRoutes,e.connectionNames[1]);if(t.length===0&&n.length===0)return;if(t.length===0||n.length===0)throw Error(`LengthMatchingSolver: differential pair ${e.connectionNames.join("/")} has routed geometry for only one connection`);let o=t$(this.matchedHdRoutes,t),r=t$(this.matchedHdRoutes,n),i=Math.abs(o-r);if(i<=e.lengthTolerance)return;let s=o<r,a=e.connectionNames[s?0:1],c=e.connectionNames[s?1:0],l=yYt({routes:this.matchedHdRoutes,routeIndexes:s?t:n,maximumDepth:this.getConfig().maximumMeanderDepth,minimumToothPitch:this.getConfig().minimumToothPitch,minMeanderGap:this.getConfig().minMeanderGap,minMeanderHeight:this.getConfig().minMeanderHeight,maxToothCount:this.getConfig().maxToothCount});if(l.length===0)throw new J3e({message:`LengthMatchingSolver: no same-layer straight segment can tune connection "${a}"`,connectionName:a,reason:"no-meander-candidate"});this.activePair={pair:e,longerConnectionName:c,longerRouteIndexes:s?n:t,shorterConnectionName:a,targetAddedLength:i,remainingAddedLength:i,candidates:l,candidateIndex:0,lastMatchedSegmentIndexByRoute:new Map,partialAttempts:[],fullAttempts:[],plannedAttemptTargets:null,hasMinimumHeightBlockedAttempt:!1}}acceptAttempt(e,t){let n=this.matchedHdRoutes[t.routeIndex];this.matchedHdRoutes[t.routeIndex]={...n,route:t.predictedRoute},e.remainingAddedLength-=t.addedLength,e.lastMatchedSegmentIndexByRoute.set(t.routeIndex,t.segmentIndex),e.candidateIndex=0,e.partialAttempts=[],e.fullAttempts=[],e.plannedAttemptTargets?.delete(rV(t)),e.plannedAttemptTargets?.size===0&&(e.plannedAttemptTargets=null),e.remainingAddedLength<=e.pair.lengthTolerance&&(this.activePair=null)}tryCandidate(e){let t;for(;!t;){let i=e.candidates[e.candidateIndex++];if(!i)break;let s=e.lastMatchedSegmentIndexByRoute.get(i.routeIndex);(s===void 0||i.segmentIndex<s)&&(!e.plannedAttemptTargets||e.plannedAttemptTargets.has(rV(i))&&![...e.plannedAttemptTargets.values()].some((a)=>a.routeIndex===i.routeIndex&&a.segmentIndex>i.segmentIndex))&&(t=i)}if(!t){let i=e.fullAttempts.reduce((a,c)=>!a||c.qualityScore>a.qualityScore?c:a,null),s=((a)=>{let c=(d)=>[d.toothCount,d.placement,d.heightProfile].join(":"),l=new Map;for(let d of a.attempts){let u=`${d.routeIndex}:${d.segmentIndex}`,_=c(d),p=l.get(_);if(!p){l.set(_,new Map([[u,[d]]]));continue}let m=p.get(u);m?m.push(d):p.set(u,[d])}let h=null;for(let d of l.values()){let u=[...d.values()].map((p)=>({attempts:p,maximumCapacityAttempt:p.reduce((m,A)=>A.addedLength>m.addedLength?A:m)})).sort((p,m)=>m.maximumCapacityAttempt.addedLength-p.maximumCapacityAttempt.addedLength),_=0;for(let p=0;p<u.length;p++){if(_+=u[p].maximumCapacityAttempt.addedLength,_+a.lengthTolerance<a.targetAddedLength)continue;let m=u.slice(0,p+1),A=m.map((C)=>C.maximumCapacityAttempt),g=bYt({attempts:A,targetAddedLength:a.targetAddedLength}),f=m.map((C)=>{let b=g.get(rV(C.maximumCapacityAttempt));if(!b)throw Error(`LengthMatchingSolver: missing capacity target for ${rV(C.maximumCapacityAttempt)}`);let I=C.attempts.filter((v)=>v.addedLength+a.lengthTolerance>=b.targetAddedLength);if(I.length===0)throw Error(`LengthMatchingSolver: no pitch can supply planned target for route ${C.maximumCapacityAttempt.routeIndex} segment ${C.maximumCapacityAttempt.segmentIndex}`);return I.reduce((v,P)=>P.qualityScore>v.qualityScore||P.qualityScore===v.qualityScore&&P.toothPitch>v.toothPitch?P:v)}),y=q3e(f);if(!h){h={attempts:f};break}let x=q3e(h.attempts);(f.length<h.attempts.length||f.length===h.attempts.length&&y>x)&&(h={attempts:f});break}}return h})({attempts:e.partialAttempts,targetAddedLength:e.remainingAddedLength,lengthTolerance:e.pair.lengthTolerance});if(i&&(!s||i.qualityScore>=q3e(s.attempts)))return void this.acceptAttempt(e,i);if(!s){if(!(e.hasMinimumHeightBlockedAttempt&&e.plannedAttemptTargets===null&&e.lastMatchedSegmentIndexByRoute.size===0))throw new J3e({message:`LengthMatchingSolver: linear regression exhausted all segment/tooth combinations for "${e.shorterConnectionName}"; required ${e.targetAddedLength.toFixed(4)}mm`,connectionName:e.shorterConnectionName,reason:"meander-search-exhausted"});return this.tryDualMeanderPlan(e)}return e.plannedAttemptTargets=bYt({attempts:s.attempts,targetAddedLength:e.remainingAddedLength}),e.candidateIndex=0,e.partialAttempts=[],void(e.fullAttempts=[])}let n=this.matchedHdRoutes[t.routeIndex],o=this.getConfig(),r=e.plannedAttemptTargets?.get(rV(t));if(e.plannedAttemptTargets!==null&&r===void 0)throw Error(`LengthMatchingSolver: missing planned target for ${rV(t)}`);this.currentAttempt=Rce({candidate:t,route:n,connectionName:e.shorterConnectionName,targetAddedLength:r===void 0?e.remainingAddedLength:r.targetAddedLength,lengthTolerance:e.pair.lengthTolerance,isGeometryValid:(i)=>m$({route:n,meanderPoints:i,routedRoutes:this.matchedHdRoutes,traces:o.traces,obstacles:o.obstacles,bounds:o.bounds,layerCount:o.layerCount,obstacleMargin:o.obstacleMargin}),getCenterlineDistanceCost:e.pair.minimumCenterlineDistance===void 0&&e.pair.maximumCenterlineDistance===void 0?void 0:(i)=>((s)=>{let a=0,c=0;for(let l=0;l<s.meanderPoints.length-1;l++){let h=s.meanderPoints[l],d=s.meanderPoints[l+1],u=Math.hypot(d.x-h.x,d.y-h.y);if(u!==0){for(let _=0;_<4;_++){let p=(_+0.5)/4,m={x:h.x+(d.x-h.x)*p,y:h.y+(d.y-h.y)*p},A=[];for(let f of s.pairedRoutes)for(let y=0;y<f.route.length-1;y++){let x=f.route[y],C=f.route[y+1];h.z===x.z&&h.z===C.z&&A.push(a6(m,m,x,C))}if(A.length===0)return null;let g=Math.min(...A);c+=u*Math.max(0,(s.minimumCenterlineDistance??Number.NEGATIVE_INFINITY)-g,g-(s.maximumCenterlineDistance??Number.POSITIVE_INFINITY))/4}a+=u}}if(a===0)throw Error("LengthMatchingSolver: cannot measure a zero-length meander centerline");return c/a})({meanderPoints:i,pairedRoutes:e.longerRouteIndexes.map((s)=>this.matchedHdRoutes[s]),minimumCenterlineDistance:e.pair.minimumCenterlineDistance,maximumCenterlineDistance:e.pair.maximumCenterlineDistance})}),this.candidatesTried++,this.currentAttempt.invalidReason==="below-minimum-height"&&(e.hasMinimumHeightBlockedAttempt=!0),this.stats={pair:`${e.pair.connectionNames[0]}/${e.pair.connectionNames[1]}`,candidatesTried:this.candidatesTried,segmentIndex:t.segmentIndex,toothCount:t.toothCount,toothPitch:t.toothPitch,placement:t.placement,predictedScaleFactor:this.currentAttempt.predictedScaleFactor,predictedToothDepths:this.currentAttempt.predictedToothDepths,resultingError:this.currentAttempt.resultingError,qualityScore:this.currentAttempt.qualityScore,accepted:this.currentAttempt.valid},this.currentAttempt.valid&&(e.plannedAttemptTargets===null?e.remainingAddedLength-this.currentAttempt.addedLength<=e.pair.lengthTolerance?e.fullAttempts.push(this.currentAttempt):e.partialAttempts.push(this.currentAttempt):this.acceptAttempt(e,this.currentAttempt))}tryDualMeanderPlan(e){if(e.remainingAddedLength!==e.targetAddedLength)throw Error(`LengthMatchingSolver: cannot start a dual-meander plan after partially tuning "${e.shorterConnectionName}"`);let t=this.getConfig(),n=yYt({routes:this.matchedHdRoutes,routeIndexes:e.longerRouteIndexes,maximumDepth:t.maximumMeanderDepth,minimumToothPitch:t.minimumToothPitch,minMeanderGap:t.minMeanderGap,minMeanderHeight:t.minMeanderHeight,maxToothCount:t.maxToothCount}),o=((a)=>{let c=(x,C)=>x.rankingQualityScore!==C.rankingQualityScore?x.rankingQualityScore>C.rankingQualityScore:x.leftIndex!==C.leftIndex?x.leftIndex<C.leftIndex:x.rightIndex<C.rightIndex,l=(x,C)=>{x.push(C);let b=x.length-1;for(;b>0;){let I=Math.floor((b-1)/2),v=x[I];if(c(v,C))break;x[b]=v,b=I}x[b]=C},h=(x)=>{let C=x[0],b=x.pop();if(!C||!b||x.length===0)return C;let I=0;for(;;){let v=2*I+1,P=v+1;if(v>=x.length)break;let M=P<x.length&&c(x[P],x[v])?P:v,B=x[M];if(c(b,B))break;x[I]=B,I=M}return x[I]=b,C},d=function*(x){let C=[...x.leftOptions].sort((v,P)=>x.getLeftQualityScore(P)-x.getLeftQualityScore(v)),b=[...x.rightOptions].sort((v,P)=>x.getRightQualityScore(P)-x.getRightQualityScore(v)),I=[];for(let v=0;v<C.length;v++){let P=b[0];if(!P)break;l(I,{leftIndex:v,rightIndex:0,rankingQualityScore:(x.getLeftQualityScore(C[v])+x.getRightQualityScore(P))/2})}for(;I.length>0;){let v=h(I);yield[C[v.leftIndex],b[v.rightIndex]];let P=v.rightIndex+1,M=b[P];M&&l(I,{leftIndex:v.leftIndex,rightIndex:P,rankingQualityScore:(x.getLeftQualityScore(C[v.leftIndex])+x.getRightQualityScore(M))/2})}},u=(x,C)=>{let b=x[C.routeIndex];if(!b)throw Error(`LengthMatchingSolver: dual meander references missing route ${C.routeIndex}`);let I=[...x];return I[C.routeIndex]={...b,route:C.predictedRoute},I},_=(x)=>{let C=x.routes[x.attempt.routeIndex];if(!C)throw Error(`LengthMatchingSolver: cannot validate missing dual-meander route ${x.attempt.routeIndex}`);return m$({route:C,meanderPoints:x.attempt.meanderPoints,routedRoutes:x.routes,...x.config})},p=(x)=>{let C=x.routes.filter((I)=>$V(I)!==x.counterpartConnectionName),b=[];for(let I of x.candidates){let v=x.routes[I.routeIndex];if(!v)throw Error(`LengthMatchingSolver: dual-meander candidate references missing route ${I.routeIndex}`);let P=GCr({candidate:I,route:v,connectionName:x.connectionName,lengthTolerance:x.config.lengthTolerance,isGeometryValid:(M)=>m$({route:v,meanderPoints:M,routedRoutes:C,...x.config})});P&&b.push({candidate:I,attempt:P})}return b},m={traces:a.traces,obstacles:a.obstacles,bounds:a.bounds,layerCount:a.layerCount,obstacleMargin:a.obstacleMargin},A=p({candidates:a.shorterCandidates,routes:a.routes,connectionName:a.shorterConnectionName,counterpartConnectionName:a.longerConnectionName,config:{...m,lengthTolerance:a.lengthTolerance}});if(A.length===0)return null;let g=p({candidates:a.longerCandidates,routes:a.routes,connectionName:a.longerConnectionName,counterpartConnectionName:a.shorterConnectionName,config:{...m,lengthTolerance:a.lengthTolerance}}),f=d({leftOptions:g,rightOptions:A,getLeftQualityScore:(x)=>x.attempt.qualityScore,getRightQualityScore:(x)=>x.attempt.qualityScore});for(let[x,C]of f){let b=Math.max(x.attempt.addedLength,C.attempt.addedLength-a.originalLengthDifference),I=b+a.originalLengthDifference;if(b-a.lengthTolerance>x.attempt.maximumAddedLength||I-a.lengthTolerance>C.attempt.maximumAddedLength)continue;let v=a.routes[x.candidate.routeIndex];if(!v)throw Error(`LengthMatchingSolver: missing longer route ${x.candidate.routeIndex}`);let P=a.routes[C.candidate.routeIndex];if(!P)throw Error(`LengthMatchingSolver: missing shorter route ${C.candidate.routeIndex}`);let M=a.routes.filter((O)=>$V(O)!==a.shorterConnectionName),B=Rce({candidate:x.candidate,route:v,connectionName:a.longerConnectionName,targetAddedLength:b,lengthTolerance:a.lengthTolerance,isGeometryValid:(O)=>m$({route:v,meanderPoints:O,routedRoutes:M,...m})});if(!B.valid||Math.abs(B.addedLength-b)>a.lengthTolerance)continue;let T=u(a.routes,B),N=B.addedLength+a.originalLengthDifference,D=Rce({candidate:C.candidate,route:P,connectionName:a.shorterConnectionName,targetAddedLength:N,lengthTolerance:a.lengthTolerance,isGeometryValid:(O)=>m$({route:P,meanderPoints:O,routedRoutes:T,...m})});if(!D.valid)continue;let L=u(T,D),H=e$(L,a.longerConnectionName),V=e$(L,a.shorterConnectionName);if(!(Math.abs(t$(L,V)-t$(L,H))>a.lengthTolerance)&&_({attempt:B,routes:L,config:m})&&_({attempt:D,routes:L,config:m}))return{longerAttempts:[B],shorterAttempts:[D]}}let y=d({leftOptions:CYt(g),rightOptions:CYt(A),getLeftQualityScore:(x)=>x.rankingQualityScore,getRightQualityScore:(x)=>x.rankingQualityScore});for(let[x,C]of y){if(x.attempts.length===1&&C.attempts.length===1)continue;let b=Math.max(x.minimumAddedLength,C.minimumAddedLength-a.originalLengthDifference),I=b+a.originalLengthDifference;if(b-a.lengthTolerance>x.maximumAddedLength||I-a.lengthTolerance>C.maximumAddedLength)continue;let v=xYt({plan:x,targetAddedLength:b,routes:a.routes,connectionName:a.longerConnectionName,excludedConnectionName:a.shorterConnectionName,config:{...m,lengthTolerance:a.lengthTolerance}});if(!v)continue;let P=xYt({plan:C,targetAddedLength:v.addedLength+a.originalLengthDifference,routes:v.routes,connectionName:a.shorterConnectionName,config:{...m,lengthTolerance:a.lengthTolerance}});if(!P)continue;let M=e$(P.routes,a.longerConnectionName),B=e$(P.routes,a.shorterConnectionName),T=Math.abs(t$(P.routes,B)-t$(P.routes,M)),N=[...v.attempts,...P.attempts];if(!(T>a.lengthTolerance||N.some((D)=>!_({attempt:D,routes:P.routes,config:m}))))return{longerAttempts:v.attempts,shorterAttempts:P.attempts}}return null})({routes:this.matchedHdRoutes,longerConnectionName:e.longerConnectionName,shorterConnectionName:e.shorterConnectionName,originalLengthDifference:e.targetAddedLength,lengthTolerance:e.pair.lengthTolerance,longerCandidates:n,shorterCandidates:e.candidates,traces:t.traces,obstacles:t.obstacles,bounds:t.bounds,layerCount:t.layerCount,obstacleMargin:t.obstacleMargin});if(!o)throw new J3e({message:`LengthMatchingSolver: linear regression exhausted all segment/tooth combinations for "${e.shorterConnectionName}"; required ${e.targetAddedLength.toFixed(4)}mm`,connectionName:e.shorterConnectionName,reason:"meander-search-exhausted"});let r=[...this.matchedHdRoutes];for(let a of[...o.longerAttempts,...o.shorterAttempts]){let c=this.matchedHdRoutes[a.routeIndex];if(!c)throw Error(`LengthMatchingSolver: cannot commit dual meander to missing route ${a.routeIndex}`);r[a.routeIndex]={...c,route:a.predictedRoute}}this.matchedHdRoutes=r,this.currentAttempt=o.shorterAttempts[0];let i=o.longerAttempts.reduce((a,c)=>a+c.addedLength,0),s=o.shorterAttempts.reduce((a,c)=>a+c.addedLength,0);this.stats={pair:`${e.pair.connectionNames[0]}/${e.pair.connectionNames[1]}`,mode:"dual-meander",longerAddedLength:i,shorterAddedLength:s,resultingError:Math.abs(s-i-e.targetAddedLength)},this.activePair=null}getConfig(){return this.config||(this.config=((e)=>{let t=e.maximumMeanderDepth??5,n=e.maxToothCount??12;if(!Number.isFinite(t)||t<=0)throw Error("LengthMatchingSolver: maximumMeanderDepth must be a positive finite number");if(e.minimumToothPitch!==void 0&&(!Number.isFinite(e.minimumToothPitch)||e.minimumToothPitch<=0))throw Error("LengthMatchingSolver: minimumToothPitch must be a positive finite number");if(e.minMeanderGap!==void 0&&(!Number.isFinite(e.minMeanderGap)||e.minMeanderGap<=0))throw Error("LengthMatchingSolver: minMeanderGap must be a positive finite number");if(e.minMeanderHeight!==void 0&&(!Number.isFinite(e.minMeanderHeight)||e.minMeanderHeight<=0))throw Error("LengthMatchingSolver: minMeanderHeight must be a positive finite number");if(e.minMeanderHeight!==void 0&&e.minMeanderHeight>t)throw Error("LengthMatchingSolver: minMeanderHeight cannot exceed maximumMeanderDepth");if(!Number.isFinite(n)||!Number.isInteger(n)||n<=0)throw Error("LengthMatchingSolver: maxToothCount must be a positive finite integer");for(let o of e.traces??[])Jle(o,e.layerCount??2);return{maximumMeanderDepth:t,minimumToothPitch:e.minimumToothPitch,minMeanderGap:e.minMeanderGap,minMeanderHeight:e.minMeanderHeight,maxToothCount:n,traces:e.traces??[],obstacles:e.obstacles??[],bounds:e.bounds,obstacleMargin:e.obstacleMargin??0.15,layerCount:e.layerCount??2,colorMap:e.colorMap??{}}})(this.params)),this.config}_step(){this.getConfig(),this.activePair?this.tryCandidate(this.activePair):this.startNextPair()}getConstructorParams(){return[this.params]}getOutput(){if(!this.solved)throw Error("LengthMatchingSolver: getOutput() called before the solver completed");return{matchedHdRoutes:this.matchedHdRoutes}}getBestEffortOutput(){let e=structuredClone(this.matchedHdRoutes),t=this.activePair?.fullAttempts??[],n=null;for(let o of t)(!n||o.qualityScore>n.qualityScore)&&(n=o);if(!n)for(let o of this.activePair?.partialAttempts??[])(!n||o.addedLength>n.addedLength||o.addedLength===n.addedLength&&o.qualityScore>n.qualityScore)&&(n=o);if(n){let o=e[n.routeIndex];o&&(e[n.routeIndex]={...o,route:structuredClone(n.predictedRoute)})}return{matchedHdRoutes:e}}computeProgress(){if(this.solved)return 1;if(this.pairs.length===0)return this.config?1:0;let e=Math.max(0,this.nextPairIndex-1),t=this.activePair?this.activePair.candidateIndex/this.activePair.candidates.length:0;return Math.min(0.99,(e+t)/this.pairs.length)}visualize(){let e=this.getConfig();return XCr({routes:this.matchedHdRoutes,obstacles:e.obstacles,bounds:e.bounds,layerCount:e.layerCount,colorMap:e.colorMap,activePair:this.activePair,currentAttempt:this.currentAttempt,solved:this.solved})}},lje=0.00000001,B_=(e,t)=>{if(e.route.length===0)throw Error(`trace "${e.connection_name}" has an empty route`);if(e.route.some((u)=>u.route_type!=="wire"&&u.route_type!=="via"))throw Error(`trace "${e.connection_name}" contains unsupported jumper or through-obstacle geometry`);let n=e.route.findIndex((u)=>u.route_type==="wire"),o=e.route[n],r=e.route.findLast((u)=>u.route_type==="wire");if(o?.route_type!=="wire"||!r)throw Error(`trace "${e.connection_name}" must contain a wire point`);let i=[],s=[],a=[],c=[],l=null,h=o.width;if(n>0){let u=o.layer;for(let p=n-1;p>=0;p--){let m=e.route[p];if(m?.route_type!=="via")throw Error(`trace "${e.connection_name}" has unsupported geometry before its first wire`);if(u===m.to_layer)u=m.from_layer;else{if(u!==m.from_layer)throw Error(`trace "${e.connection_name}" has discontinuous leading vias`);u=m.to_layer}}let _=e.route[0];if(_.route_type!=="via")throw Error(`trace "${e.connection_name}" has an invalid leading entry`);l={x:_.x,y:_.y,layer:u,width:o.width},i.push(l)}for(let u of e.route){if(u.route_type==="wire"){if(!Number.isFinite(u.x)||!Number.isFinite(u.y)||!Number.isFinite(u.width)||u.width<=0||vp(u.layer,t)<0)throw Error(`trace "${e.connection_name}" has an invalid wire point`);h=Math.max(h,u.width);let f={x:u.x,y:u.y,layer:u.layer,width:u.width};if(l){if(l.layer!==f.layer)throw Error(`trace "${e.connection_name}" changes layers without a via`);Math.hypot(l.x-f.x,l.y-f.y)>lje&&s.push({start:l,end:f,layer:f.layer,width:Math.max(l.width,f.width),connectionName:e.connection_name,terminal:null})}i.push(f),l=f;continue}if(u.route_type!=="via")throw Error(`trace "${e.connection_name}" contains unsupported route geometry`);if(!l)throw Error(`trace "${e.connection_name}" has a leading via`);let _=vp(u.from_layer,t),p=vp(u.to_layer,t),m=u.via_diameter??l.width;if(!Number.isFinite(u.x)||!Number.isFinite(u.y)||_<0||p<0||_===p||u.via_diameter!==void 0&&(!Number.isFinite(u.via_diameter)||u.via_diameter<=0)||u.via_hole_diameter!==void 0&&(!Number.isFinite(u.via_hole_diameter)||u.via_hole_diameter<=0||u.via_hole_diameter>=m))throw Error(`trace "${e.connection_name}" has an invalid via`);let A=l.layer===u.from_layer?u.from_layer:l.layer===u.to_layer?u.to_layer:null;if(!A)throw Error(`trace "${e.connection_name}" has a discontinuous via transition`);Math.hypot(l.x-u.x,l.y-u.y)>lje&&s.push({start:l,end:u,layer:l.layer,width:l.width,connectionName:e.connection_name,terminal:null});let g=A===u.from_layer?u.to_layer:u.from_layer;c.push({...u,from_layer:A,to_layer:g}),a.push({x:u.x,y:u.y,layers:Tq(A,g,t),diameter:m,connectionName:e.connection_name,terminal:i.length===1?"start":null}),l={x:u.x,y:u.y,layer:g,width:l.width},i.push(l)}if(i.length<2||s.length===0)throw Error(`trace "${e.connection_name}" does not contain a routable path`);s[0].terminal=s.length===1?"both":"start",s[s.length-1].terminal=s.length===1?"both":"end";let d=a.at(-1);return d&&Math.hypot(d.x-r.x,d.y-r.y)<=lje&&(d.terminal="end"),{source:e,points:i,segments:s,vias:a,transitions:c,width:h,viaDiameter:e.__postProcessingViaDiameter??h,...o.start_pcb_port_id?{startPortId:o.start_pcb_port_id}:{},...r.end_pcb_port_id?{endPortId:r.end_pcb_port_id}:{}}},aB=(e)=>e.segments.reduce((t,n)=>t+Math.hypot(n.end.x-n.start.x,n.end.y-n.start.y),0),IYt=(e)=>{let{simpleRouteJson:t}=e.params,n=((h)=>{let d=new Set(h.reroutedPairs.map((u)=>u.connectionNames.join("\x00")));return h.declaredPairs.filter((u)=>{let _=u.connectionNames.map((A)=>h.traces.filter((g)=>g.connection_name===A));if(_.some((A)=>A.length!==1))return!1;if(d.has(u.connectionNames.join("\x00")))return!0;let p=_.map((A)=>A[0]);if(p.some((A)=>A.route.length<2||A.route[0]?.route_type!=="wire"||!A.route.every((g)=>g.route_type==="wire"||g.route_type==="via")))return!1;let m=p.map((A)=>aB(B_(A,h.layerCount)));return Math.abs(m[0]-m[1])>u.lengthTolerance+0.0000001}).map((u)=>structuredClone(u))})({traces:e.result.traces,declaredPairs:t.differentialPairs,reroutedPairs:e.result.reroutedPairs,layerCount:t.layerCount}),o=new Set(n.flatMap((h)=>h.connectionNames)),r=[],i=[],s=[],a=new Set;for(let h=0;h<e.result.traces.length;h++){let d=e.result.traces[h];if(!o.has(d.connection_name))continue;let u=d.route.every((M)=>M.route_type==="wire"||M.route_type==="via"),_=d.route[0]?.route_type==="wire";if(!u||!_)throw Error(`PostProcessingSolver: rerouted connection "${d.connection_name}" cannot be bound to LengthMatchingSolver`);let p=B_(d,t.layerCount),m=d.route[0];if(m.route_type!=="wire")throw Error(`PostProcessingSolver: trace "${d.connection_name}" lost its first wire during binding`);let A=[{x:m.x,y:m.y,z:vp(m.layer,t.layerCount),traceThickness:m.width}],g=[],f=[],{layer:y,width:x}=m;for(let M of d.route.slice(1)){if(M.route_type==="wire"){if(M.layer!==y)throw Error(`PostProcessingSolver: trace "${d.connection_name}" changes layers without a via while binding`);A.push({x:M.x,y:M.y,z:vp(M.layer,t.layerCount),traceThickness:M.width}),x=M.width;continue}if(M.route_type!=="via")throw Error(`PostProcessingSolver: trace "${d.connection_name}" contains unsupported bound geometry`);let B=y===M.from_layer?M.to_layer:y===M.to_layer?M.from_layer:null;if(!B)throw Error(`PostProcessingSolver: trace "${d.connection_name}" has a discontinuous bound via`);let T=A.at(-1);Math.hypot(T.x-M.x,T.y-M.y)>0.00000001&&A.push({x:M.x,y:M.y,z:vp(y,t.layerCount),traceThickness:x}),A.push({x:M.x,y:M.y,z:vp(B,t.layerCount),traceThickness:x}),g.push({x:M.x,y:M.y,zLayers:Tq(M.from_layer,M.to_layer,t.layerCount).map((N)=>vp(N,t.layerCount))}),f.push({...M}),y=B}if(A.length<2)throw Error(`PostProcessingSolver: trace "${d.connection_name}" has no bound copper segments`);let C=Math.max(...A.map((M)=>M.traceThickness??p.width)),b=p.viaDiameter,I=r.length;r.push({connectionName:d.connection_name,traceThickness:C,viaDiameter:b,route:A,vias:g});let v=A[0],P=A.at(-1);i.push({name:d.connection_name,pointsToConnect:[{x:v.x,y:v.y,layer:m.layer,...p.startPortId?{pcb_port_id:p.startPortId}:{}},{x:P.x,y:P.y,layer:p.points.at(-1).layer,...p.endPortId?{pcb_port_id:p.endPortId}:{}}]}),s.push({traceIndex:h,matchedRouteIndex:I,viaTemplates:f,startEndpoint:{...v},endEndpoint:{...P},...p.startPortId?{startPortId:p.startPortId}:{},...p.endPortId?{endPortId:p.endPortId}:{}}),a.add(d.connection_name)}for(let h of o)if(!a.has(h))throw Error(`PostProcessingSolver: missing LengthMatchingSolver binding for rerouted connection "${h}"`);let c=e.result.traces.filter((h)=>!o.has(h.connection_name)),l=t.minTraceToPadEdgeClearance??Math.max(0,...r.filter((h)=>h.route.length>=2).map((h)=>h.traceThickness),...c.flatMap((h)=>Jle(h,t.layerCount).segments.map((d)=>d.width)));return{solverParams:{hdRoutes:r,traces:c,originalConnections:i,differentialPairs:n,obstacles:t.obstacles,bounds:t.bounds,layerCount:t.layerCount,obstacleMargin:l},traceBindings:s,baseTraces:structuredClone(e.result.traces)}},vYt=(e)=>{let t=new Map;for(let a of e.differentialPairs)for(let c of a.connectionNames){let l=e.hdRoutes.map((h,d)=>({route:h,hdRouteIndex:d})).filter(({route:h})=>h.connectionName===c);l.length===1&&t.set(l[0].hdRouteIndex,c)}let n=e.hdRoutes.map((a,c)=>{let l=[],h=new Map;for(let d=0;d<(a.jumpers?.length??0);d++){let u=a.jumpers[d],_=a.route.map((g,f)=>({point:g,index:f})).filter(({point:g})=>Math.hypot(g.x-u.start.x,g.y-u.start.y)<=0.00000001).map(({index:g})=>g),p=a.route.map((g,f)=>({point:g,index:f})).filter(({point:g})=>Math.hypot(g.x-u.end.x,g.y-u.end.y)<=0.00000001).map(({index:g})=>g),m=[..._.flatMap((g)=>p.filter((f)=>f>g).map((f)=>({startIndex:g,endIndex:f}))),...p.flatMap((g)=>_.filter((f)=>f>g).map((f)=>({startIndex:g,endIndex:f})))];if(m.length!==1)throw Error(`PostProcessingSolver: immutable HD route "${a.connectionName}" has an ambiguous jumper traversal`);let A=m[0];if(h.has(A.startIndex)||[...h.values()].some(({endIndex:g})=>A.startIndex<g||A.endIndex<=g))throw Error(`PostProcessingSolver: immutable HD route "${a.connectionName}" has overlapping or unordered jumpers`);h.set(A.startIndex,{endIndex:A.endIndex,jumperIndex:d})}if(a.route.length>0){let d=a.route[0];l.push({route_type:"wire",x:d.x,y:d.y,width:d.traceThickness??a.traceThickness,layer:ev(d.z,e.layerCount)});for(let m=0;m<a.route.length-1;m++){let A=a.route[m],g=h.get(m);if(g){let C=a.route[g.endIndex],b=a.jumpers[g.jumperIndex];if(A.z!==C.z)throw Error(`PostProcessingSolver: immutable HD route "${a.connectionName}" changes layers through a jumper`);l.push({route_type:"jumper",start:{x:A.x,y:A.y},end:{x:C.x,y:C.y},footprint:b.footprint,layer:ev(A.z,e.layerCount)}),l.push({route_type:"wire",x:C.x,y:C.y,width:C.traceThickness??a.traceThickness,layer:ev(C.z,e.layerCount)}),m=g.endIndex-1;continue}let f=a.route[m+1],y=ev(A.z,e.layerCount),x=ev(f.z,e.layerCount);A.z!==f.z&&(A.toNextSegmentType==="through_obstacle"?l.push({route_type:"through_obstacle",start:{x:A.x,y:A.y},end:{x:f.x,y:f.y},from_layer:y,to_layer:x,width:A.traceThickness??a.traceThickness}):l.push({route_type:"via",x:f.x,y:f.y,from_layer:y,to_layer:x,via_diameter:a.viaDiameter})),l.push({route_type:"wire",x:f.x,y:f.y,width:f.traceThickness??a.traceThickness,layer:x})}let u=l.filter((m)=>m.route_type==="wire"),_=a.startPcbPortId??a.route[0]?.pcb_port_id,p=a.endPcbPortId??a.route.at(-1)?.pcb_port_id;_&&u[0]&&(u[0].start_pcb_port_id=_),p&&u.at(-1)&&(u.at(-1).end_pcb_port_id=p)}return{type:"pcb_trace",pcb_trace_id:`post_processing_hd_route_${c}`,connection_name:a.connectionName,__postProcessingViaDiameter:a.viaDiameter,route:l}}),o=new Set(n.map((a)=>a.connection_name));for(let[a,c]of(e.traces??[]).entries()){let l=`post_processing_fixed_trace_${a}`;for(;o.has(l);)l+="_";o.add(l),n.push({...structuredClone(c),connection_name:l})}let r=structuredClone(e.obstacles),i=new Map,s=new Map;for(let a of r)for(let c of a.connectedTo){let l=i.get(c);l||(l=new Set,i.set(c,l)),l.add(a)}for(let a=0;a<e.hdRoutes.length;a++){let c=e.hdRoutes[a],l=new Set([c.connectionName,c.rootConnectionName,c.startPcbPortId,c.endPcbPortId,c.route[0]?.pcb_port_id,c.route.at(-1)?.pcb_port_id,t.get(a)].filter((d)=>d!==void 0)),h=new Set;for(let d of l){let u=i.get(d);if(u)for(let _ of u)h.add(_)}for(let d of h){let u=s.get(d);u||(u=new Set(d.connectedTo),s.set(d,u),d.connectedTo=[...u]);for(let _ of l){if(u.has(_))continue;u.add(_),d.connectedTo.push(_);let p=i.get(_);p||(p=new Set,i.set(_,p)),p.add(d)}}}return{params:{simpleRouteJson:{traces:n,differentialPairs:structuredClone(e.differentialPairs),obstacles:r,bounds:structuredClone(e.bounds),layerCount:e.layerCount,minTraceToPadEdgeClearance:e.minTraceToPadEdgeClearance},...e.routingGrid?{routingGrid:structuredClone(e.routingGrid)}:{}},routeBindings:[...t.entries()].map(([a,c])=>({hdRouteIndex:a,traceIndex:a,internalConnectionName:c})),sourceHdRoutes:structuredClone(e.hdRoutes)}};function han(e){let t=structuredClone(e.model.sourceHdRoutes);for(let n of e.model.routeBindings){let o=e.binding.traceBindings.find((c)=>c.traceIndex===n.traceIndex);if(!o)continue;let r=e.result.matchedHdRoutes[o.matchedRouteIndex],i=t[n.hdRouteIndex];if(!r||!i)throw Error(`PostProcessingSolver: missing matched or source HD route for "${n.internalConnectionName}"`);if(r.connectionName!==n.internalConnectionName)throw Error(`PostProcessingSolver: matched HD binding changed "${n.internalConnectionName}" to "${r.connectionName}"`);let s=r.route.map((c)=>({...c})),a=(c,l)=>{if(c&&l&&(l.pcb_port_id&&(c.pcb_port_id=l.pcb_port_id),l.insideJumperPad&&e.rejectInsideJumperPad))throw Error(`PostProcessingSolver: cannot restore jumper-pad metadata on rerouted connection "${n.internalConnectionName}"`)};a(s[0],i.route[0]),a(s.at(-1),i.route.at(-1)),t[n.hdRouteIndex]={...i,route:s,vias:structuredClone(r.vias)}}return{hdRoutes:t,postProcessingErrors:[]}}var MQ=class extends Error{connectionNames;reason;constructor(e){super(`PostProcessingSolver: differential pair ${e.connectionNames.join("/")} ${e.message}`),this.name="DifferentialPairRoutingError",this.connectionNames=[e.connectionNames[0],e.connectionNames[1]],this.reason=e.reason}},D$e=class extends Error{connectionNames;reason;constructor(e){super(e.message),this.name="PostProcessingConstraintError",this.connectionNames=[...e.connectionNames],this.reason=e.reason}},dan=class extends Error{reason="grid-capacity-exhausted";constructor(e){super(e),this.name="PostProcessingGridCapacityError"}},uan=(e)=>{let t=75000*e.simpleRouteJson.differentialPairs.length;if(!Number.isSafeInteger(t))throw Error("PostProcessingSolver: derived rerouting iteration bound exceeds the safe integer range");let n=Math.min(t,80000);return Math.max(1,n)},$Ce=(e)=>structuredClone(e),pan=(e,t,n)=>{let o=(l)=>{let h=-(t.ccwRotationDegrees??0)*Math.PI/180,d=l.x-t.center.x,u=l.y-t.center.y;return{x:d*Math.cos(h)-u*Math.sin(h),y:d*Math.sin(h)+u*Math.cos(h)}},r=o(e.start),i=o(e.end),s=t.width/2+n,a=t.height/2+n;if(Math.abs(r.x)<=s&&Math.abs(r.y)<=a||Math.abs(i.x)<=s&&Math.abs(i.y)<=a)return!0;let c=[{x:-s,y:-a},{x:s,y:-a},{x:s,y:a},{x:-s,y:a}];return c.some((l,h)=>a6(r,i,l,c[(h+1)%c.length])<=0.0000001)},jCr=(e)=>{let t=[],n=[];for(let d of e.immutableTraces){let u=Jle(d,e.layerCount);t.push(...u.segments),n.push(...u.vias)}let o=Array.from({length:e.layerCount},()=>[]);for(let d of t){let u=vp(d.layer,e.layerCount);o[u].push(d)}let r=(d,u)=>Math.hypot(d.x-u.x,d.y-u.y)<=0.00000001,i=(d,u,_)=>{let p=_.x-u.x,m=_.y-u.y,A=p*p+m*m,g=A===0?0:Math.max(0,Math.min(1,((d.x-u.x)*p+(d.y-u.y)*m)/A));return Math.hypot(d.x-u.x-p*g,d.y-u.y-m*g)},s=(d,u,_)=>{let p=-(u.ccwRotationDegrees??0)*Math.PI/180,m=d.x-u.center.x,A=d.y-u.center.y,g=m*Math.cos(p)-A*Math.sin(p),f=m*Math.sin(p)+A*Math.cos(p);return Math.abs(g)<=u.width/2+_&&Math.abs(f)<=u.height/2+_},a=(d,u)=>{let _=vp(u,e.layerCount);return Xq(d,e.layerCount).includes(_)},c=(d,u,_)=>{let p=((A,g,f)=>{let y=Math.hypot(g.x,g.y);if(y<=0.0000000001)throw Error("PostProcessingSolver: cannot orient terminal fanout on a zero-length spine");let x=-g.y/y*e.side*e.centerlineSpacing/2,C=g.x/y*e.side*e.centerlineSpacing/2,b=f==="start"?[e.firstStartTerminal,e.secondStartTerminal]:[e.firstEndTerminal,e.secondEndTerminal],I=[e.firstWidth,e.secondWidth],v=[e.firstConnectionName,e.secondConnectionName];return b.map((P,M)=>{let B=M===0?1:-1,T={x:A.x+x*B,y:A.y+C*B};return{start:f==="start"?P:T,end:f==="start"?T:P,layer:A.layer,width:I[M],connectionName:v[M],terminal:f}})})(d,u,_),m=p.map((A)=>_==="start"?A.end:A.start);return p.every(l)&&m.every((A,g)=>e.obstacles.every((f)=>!a(f,d.layer)||!s(A,f,1.5*p[g].width+(e.terminalMiterMargin??0))))&&a6(p[0].start,p[0].end,p[1].start,p[1].end)>=p[0].width/2+p[1].width/2-0.0000001},l=(d)=>{let u=d.width/2,_=u+(e.minTraceToPadEdgeClearance??d.width),p=vp(d.layer,e.layerCount),m=Math.min(d.start.x,d.end.x),A=Math.max(d.start.x,d.end.x),g=Math.min(d.start.y,d.end.y),f=Math.max(d.start.y,d.end.y);for(let y of[d.start,d.end])if(y.x-u<e.bounds.minX||y.x+u>e.bounds.maxX||y.y-u<e.bounds.minY||y.y+u>e.bounds.maxY)return!1;for(let y of e.obstacles){if(!a(y,d.layer))continue;let x=Math.hypot(y.width/2+_,y.height/2+_);if(A<y.center.x-x||m>y.center.x+x||f<y.center.y-x||g>y.center.y+x)continue;let[C,b]=d.connectionName===e.firstConnectionName?[e.firstStartTerminal,e.firstEndTerminal]:[e.secondStartTerminal,e.secondEndTerminal],I=s(C,y,0)&&(s(d.start,y,_)||s(d.end,y,_))&&Math.hypot(d.end.x-C.x,d.end.y-C.y)>=Math.hypot(d.start.x-C.x,d.start.y-C.y),v=s(b,y,0)&&(s(d.start,y,_)||s(d.end,y,_))&&Math.hypot(d.end.x-b.x,d.end.y-b.y)<=Math.hypot(d.start.x-b.x,d.start.y-b.y);if(!(y.connectedTo.includes(d.connectionName)&&(I||v))&&pan(d,y,_))return!1}for(let y of o[p]){let x=d.width/2+y.width/2+Math.max(d.width,y.width);if(!(A+x<Math.min(y.start.x,y.end.x)||m-x>Math.max(y.start.x,y.end.x)||f+x<Math.min(y.start.y,y.end.y)||g-x>Math.max(y.start.y,y.end.y))&&a6(d.start,d.end,y.start,y.end)<x)return!1}for(let y of n)if(y.layers.includes(d.layer)&&i(y,d.start,d.end)<d.width/2+y.diameter/2+d.width)return!1;return!0},h=(d)=>{let u=d.diameter/2;if(d.x-u<e.bounds.minX||d.x+u>e.bounds.maxX||d.y-u<e.bounds.minY||d.y+u>e.bounds.maxY)return!1;for(let _ of e.obstacles){if(!d.layers.some((p)=>a(_,p)))continue;if(!(d.terminal!==null&&_.connectedTo.includes(d.connectionName)&&s(d,_,0))&&s(d,_,u+d.diameter))return!1}for(let _ of t){if(!d.layers.includes(_.layer))continue;let p=u+_.width/2+Math.max(d.diameter,_.width);if(i(d,_.start,_.end)<p)return!1}for(let _ of n){if(!_.layers.some((m)=>d.layers.includes(m)))continue;let p=u+_.diameter/2+Math.max(d.diameter,_.diameter);if(Math.hypot(d.x-_.x,d.y-_.y)<p)return!1}return!0};return{isEdgeValid:(d,u)=>{if(d.layer!==u.layer||!((p,m)=>{let A=Math.hypot(m.x-p.x,m.y-p.y);if(A===0)return[];let g=-(m.y-p.y)/A*e.side*e.centerlineSpacing/2,f=(m.x-p.x)/A*e.side*e.centerlineSpacing/2,y=r(p,e.start),x=r(m,e.end),C=e.terminalFanout?y&&x?"both":y?"start":x?"end":null:null,b=y&&e.terminalFanout?e.firstStartTerminal:{x:p.x+g,y:p.y+f},I=x&&e.terminalFanout?e.firstEndTerminal:{x:m.x+g,y:m.y+f},v=y&&e.terminalFanout?e.secondStartTerminal:{x:p.x-g,y:p.y-f},P=x&&e.terminalFanout?e.secondEndTerminal:{x:m.x-g,y:m.y-f};return[{start:b,end:I,layer:p.layer,width:e.firstWidth,connectionName:e.firstConnectionName,terminal:C},{start:v,end:P,layer:p.layer,width:e.secondWidth,connectionName:e.secondConnectionName,terminal:C}]})(d,u).every(l))return!1;if(e.terminalFanout||e.terminalMiterMargin===void 0)return!0;let _={x:u.x-d.x,y:u.y-d.y};return!(r(d,e.start)&&!c(d,_,"start"))&&!(r(u,e.end)&&!c(u,_,"end"))},isTerminalFanoutValid:c,isViaValid:(d,u,_)=>{let p=Math.hypot(_.x,_.y);if(p<=0.0000000001)throw Error("PostProcessingSolver: cannot orient a coupled via on a zero-length spine");let m=Tq(d.layer,u,e.layerCount),A=-_.y/p*e.side*e.centerlineSpacing/2,g=_.x/p*e.side*e.centerlineSpacing/2,f=r(d,e.start)?"start":r(d,e.end)?"end":null;return[{x:d.x+A,y:d.y+g,layers:m,diameter:e.firstViaDiameter,connectionName:e.firstConnectionName,terminal:f},{x:d.x-A,y:d.y-g,layers:m,diameter:e.secondViaDiameter,connectionName:e.secondConnectionName,terminal:f}].every(h)}}},qCe=(e,t,n)=>{let r=(d,u)=>{let _=-(u.ccwRotationDegrees??0)*Math.PI/180,p=d.x-u.center.x,m=d.y-u.center.y;return{x:p*Math.cos(_)-m*Math.sin(_),y:p*Math.sin(_)+m*Math.cos(_)}},i=(d,u,_)=>{let p=_.x-u.x,m=_.y-u.y,A=p*p+m*m,g=A===0?0:Math.max(0,Math.min(1,((d.x-u.x)*p+(d.y-u.y)*m)/A));return Math.hypot(d.x-(u.x+g*p),d.y-(u.y+g*m))},s=(d,u,_)=>{let p=vp(u,_);return Xq(d,_).includes(p)},a=(d,u,_)=>{let p=d.width/2;if(d.start.x-p<u.bounds.minX-0.0000001||d.start.x+p>u.bounds.maxX+0.0000001||d.start.y-p<u.bounds.minY-0.0000001||d.start.y+p>u.bounds.maxY+0.0000001||d.end.x-p<u.bounds.minX-0.0000001||d.end.x+p>u.bounds.maxX+0.0000001||d.end.y-p<u.bounds.minY-0.0000001||d.end.y+p>u.bounds.maxY+0.0000001)return!1;for(let m of u.obstacles){if(!s(m,d.layer,u.layerCount))continue;let A=d.terminal==="both"?[d.start,d.end]:d.terminal==="start"?[d.start]:d.terminal==="end"?[d.end]:[];if(!(m.connectedTo.includes(d.connectionName)&&A.some((g)=>{let f=r(g,m);return Math.abs(f.x)<=m.width/2+0.0000001&&Math.abs(f.y)<=m.height/2+0.0000001}))&&pan(d,m,p+(u.minTraceToPadEdgeClearance??d.width)))return!1}for(let m of _.segments){if(m.layer!==d.layer)continue;let A=d.width/2+m.width/2+Math.max(d.width,m.width);if(a6(d.start,d.end,m.start,m.end)<A-0.0000001)return!1}for(let m of _.vias){if(!m.layers.includes(d.layer))continue;let A=d.width/2+m.diameter/2+d.width;if(i(m,d.start,d.end)<A-0.0000001)return!1}return!0},c=(d,u,_)=>{let p=d.diameter/2;if(d.x-p<u.bounds.minX-0.0000001||d.x+p>u.bounds.maxX+0.0000001||d.y-p<u.bounds.minY-0.0000001||d.y+p>u.bounds.maxY+0.0000001)return!1;for(let m of u.obstacles){if(!d.layers.some((g)=>s(m,g,u.layerCount)))continue;let A=r(d,m);if(!(d.terminal!==null&&m.connectedTo.includes(d.connectionName)&&Math.abs(A.x)<=m.width/2+0.0000001&&Math.abs(A.y)<=m.height/2+0.0000001)&&Math.abs(A.x)<=m.width/2+p+d.diameter&&Math.abs(A.y)<=m.height/2+p+d.diameter)return!1}for(let m of _.segments){if(!d.layers.includes(m.layer))continue;let A=p+m.width/2+Math.max(d.diameter,m.width);if(i(d,m.start,m.end)<A-0.0000001)return!1}for(let m of _.vias){if(!m.layers.some((g)=>d.layers.includes(g)))continue;let A=p+m.diameter/2+Math.max(d.diameter,m.diameter);if(Math.hypot(d.x-m.x,d.y-m.y)<A-0.0000001)return!1}return!0},l=(d)=>{for(let u=0;u<d.segments.length;u++){let _=d.segments[u];for(let p=u+2;p<d.segments.length;p++){let m=d.segments[p];if(_.layer!==m.layer)continue;if(!(d.segments.slice(u+1,p).reduce((A,g)=>A+Math.hypot(g.end.x-g.start.x,g.end.y-g.start.y),0)<=_.width+m.width+0.0000001)&&a6(_.start,_.end,m.start,m.end)<_.width/2+m.width/2-0.0000001)return!0}}for(let u of d.vias)for(let _ of d.segments){if(!u.layers.includes(_.layer))continue;if(!(Math.hypot(u.x-_.start.x,u.y-_.start.y)<=0.0000001||Math.hypot(u.x-_.end.x,u.y-_.end.y)<=0.0000001)&&i(u,_.start,_.end)<u.diameter/2+_.width/2-0.0000001)return!0}return!1},h=((d,u)=>{let _=[],p=[];for(let m of d){let A=Jle(m,u);_.push(...A.segments),p.push(...A.vias)}return{segments:_,vias:p}})(n.immutableTraces,n.layerCount);if(!((d,u)=>{for(let _ of d.segments)for(let p of u.segments){if(_.layer!==p.layer)continue;let m=_.width/2+p.width/2;if(a6(_.start,_.end,p.start,p.end)<m-0.0000001)return!1}for(let[_,p]of[[d.vias,u.segments],[u.vias,d.segments]])for(let m of _)for(let A of p)if(m.layers.includes(A.layer)&&i(m,A.start,A.end)<m.diameter/2+A.width/2-0.0000001)return!1;for(let _ of d.vias)for(let p of u.vias)if(_.layers.some((m)=>p.layers.includes(m))&&Math.hypot(_.x-p.x,_.y-p.y)<_.diameter/2+p.diameter/2-0.0000001)return!1;return!0})(e,t)||l(e)||l(t))return!1;for(let d of[e,t])if(d.segments.some((u)=>!a(u,n,h))||d.vias.some((u)=>!c(u,n,h)))return!1;return!0},SYt=[{x:1,y:0},{x:1,y:1},{x:0,y:1},{x:-1,y:1},{x:-1,y:0},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1}],KCr=class{constructor(e){this.input=e;let{bounds:t,grid:n}=e,o={minX:t.minX+n.outerPerimeterWidth,maxX:t.maxX-n.outerPerimeterWidth,minY:t.minY+n.outerPerimeterWidth,maxY:t.maxY-n.outerPerimeterWidth},r=this.createAxis(t.minX,t.maxX,n.outerGridStep,[o.minX,o.maxX]),i=this.createAxis(t.minY,t.maxY,n.outerGridStep,[o.minY,o.maxY]),s=this.createAxis(o.minX,o.maxX,n.innerGridStep,[],e.start.x),a=this.createAxis(o.minY,o.maxY,n.innerGridStep,[],e.start.y),c=this.createGrid(r,i,(d)=>d.x<=o.minX||d.x>=o.maxX||d.y<=o.minY||d.y>=o.maxY),l=this.createGrid(s,a,()=>!0);this.connectLocalNeighbors(c),this.connectLocalNeighbors(l);for(let d of["left","right","bottom","top"])this.connectBoundaries(d,c,l,o);let h=this.nodes.map((d,u)=>u);this.connectEndpoint(e.start,h),this.connectEndpoint(e.end,h)}input;nodes=[];nodeIdByPoint=new Map;endpointNodeIdByPoint=new Map;getPlanarNeighbors(e){let t=this.endpointNodeIdByPoint.get(this.exactKeyFor(e))??this.nodeIdByPoint.get(this.keyFor(e));if(t===void 0)throw Error(`PostProcessingSolver: coupled path point (${e.x}, ${e.y}) is not on the composite grid`);return[...this.nodes[t].neighborIds].map((n)=>({...this.nodes[n].point,layer:e.layer}))}getNodeCount(){return this.nodes.length}getSearchStateCountUpperBound(e){let t=this.nodes.reduce((n,o)=>n+o.neighborIds.size,0)*e+1;if(!Number.isSafeInteger(t))throw Error("PostProcessingSolver: composite-grid search-state bound exceeds the safe integer range");return t}createAxis(e,t,n,o,r=e){let i=[e,t,...o].map((a)=>({value:a,fixed:!0}));for(let a=Math.ceil((e-r)/n);r+a*n<t-0.00000001;a++)i.push({value:r+a*n,fixed:!1});i.sort((a,c)=>a.value-c.value||Number(c.fixed)-Number(a.fixed));let s=[];for(let a of i){let c=s.at(-1);!c||Math.abs(a.value-c.value)>0.00000001?s.push(a):a.fixed&&!c.fixed&&(s[s.length-1]=a)}return s.map((a)=>a.value)}createGrid(e,t,n){return t.map((o)=>e.map((r)=>{let i={x:r,y:o};return n(i)?this.addNode(i):null}))}connectLocalNeighbors(e){for(let t=0;t<e.length;t++)for(let n=0;n<(e[t]?.length??0);n++){let o=e[t][n];if(o!==null)for(let r of SYt){let i=e[t+r.y]?.[n+r.x];i!=null&&this.connect(o,i)}}}connectBoundaries(e,t,n,o){let r=e==="left"?o.minX:e==="right"?o.maxX:e==="bottom"?o.minY:o.maxY,i=e==="left"||e==="right",s=(h)=>Math.abs((i?h.x:h.y)-r)<=0.00000001,a=(h)=>{let d=new Set;for(let u of h)for(let _ of u)_!==null&&s(this.nodes[_].point)&&d.add(_);return[...d].sort((u,_)=>{let p=this.nodes[u].point,m=this.nodes[_].point;return(i?p.y-m.y:p.x-m.x)||u-_})},c=a(t),l=a(n);if(c.length===0||l.length===0)throw Error(`PostProcessingSolver: composite grid has no ${e} boundary bridge candidates`);for(let h of c)this.connect(h,this.findNearestAlongBoundary(h,l,i));for(let h of l)this.connect(h,this.findNearestAlongBoundary(h,c,i))}findNearestAlongBoundary(e,t,n){let o=this.nodes[e].point,r=t[0],i=Number.POSITIVE_INFINITY;for(let s of t){let a=this.nodes[s].point,c=Math.abs(n?o.y-a.y:o.x-a.x);(c<i-0.00000001||Math.abs(c-i)<=0.00000001&&s<r)&&(i=c,r=s)}return r}connectEndpoint(e,t){let n=this.nodeIdByPoint.get(this.keyFor(e)),o=n===void 0?null:this.nodes[n].point,r=o?.x===e.x&&o.y===e.y?n:this.nodes.push({point:{x:e.x,y:e.y},neighborIds:new Set})-1;this.endpointNodeIdByPoint.set(this.exactKeyFor(e),r);let i=(s,a)=>{let c=this.nodes[s].point,l=t.filter((h)=>h!==s).map((h)=>({nodeId:h,distance:Math.hypot(this.nodes[h].point.x-c.x,this.nodes[h].point.y-c.y)})).filter(({distance:h})=>h>0.0000000001).sort((h,d)=>h.distance-d.distance||h.nodeId-d.nodeId).slice(0,a);if(l.length===0)throw Error("PostProcessingSolver: composite grid has no endpoint connection candidates");for(let{nodeId:h}of l)this.connect(s,h)};i(r,8);for(let s of SYt){let a={x:e.x+s.x*this.input.grid.innerGridStep,y:e.y+s.y*this.input.grid.innerGridStep};if(a.x<this.input.bounds.minX||a.x>this.input.bounds.maxX||a.y<this.input.bounds.minY||a.y>this.input.bounds.maxY)continue;let c=this.addNode(a);this.connect(r,c),i(c,4)}}addNode(e){let t=this.keyFor(e),n=this.nodeIdByPoint.get(t);if(n!==void 0)return n;let o=this.nodes.length;return this.nodes.push({point:{x:e.x,y:e.y},neighborIds:new Set}),this.nodeIdByPoint.set(t,o),o}connect(e,t){if(e===t)return;let n=this.nodes[e],o=this.nodes[t];n.neighborIds.add(t),o.neighborIds.add(e)}keyFor(e){let t=Object.is(e.x,-0)?0:e.x,n=Object.is(e.y,-0)?0:e.y;return`${t.toFixed(12)}:${n.toFixed(12)}`}exactKeyFor(e){return`${Object.is(e.x,-0)?0:e.x}:${Object.is(e.y,-0)?0:e.y}`}},$Cr=class{constructor(e){if(this.input=e,this.startLayer=vp(e.start.layer,e.layerCount),this.endLayer=vp(e.end.layer,e.layerCount),this.grid=new KCr(e),this.maxSearchStates=this.grid.getSearchStateCountUpperBound(e.layerCount),this.exploredStateLimit=Math.min(this.maxSearchStates,20000),this.startLayer<0||this.endLayer<0)return this.queue=[],void(this.status="exhausted");let t={point:e.start,direction:null,cost:0,estimate:this.estimate(e.start),parent:null,sequence:0};this.queue=[t],this.bestCosts.set(this.keyFor(e.start,null),0)}input;queue;bestCosts=new Map;startLayer;endLayer;grid;maxSearchStates;exploredStateLimit;current=null;result=null;status="searching";explored=0;nextSequence=1;isComplete(){return this.status!=="searching"}getPath(){return this.result}getPreviewPath(){return this.current?this.createPath(this.current):[this.input.start]}getExploredCount(){return this.explored}getProgress(){return this.status!=="searching"?1:Math.min(0.99,this.explored/this.exploredStateLimit)}getGridNodeCount(){return this.grid.getNodeCount()}step(){if(this.status!=="searching")return;let e=this.popQueue();if(!e)return void(this.status="exhausted");let t=this.bestCosts.get(this.keyFor(e.point,e.direction));if(t===void 0)throw Error("PostProcessingSolver: coupled path queue contains an untracked state");if(e.cost>t+0.0000000001)this.queue.length===0&&(this.status="exhausted");else{if(this.current=e,this.explored++,this.explored>this.maxSearchStates)throw Error(`PostProcessingSolver: coupled path search exceeded its ${this.maxSearchStates}-state graph invariant limit`);if(this.isEnd(e.point)){let n=this.createPath(e);return n[n.length-1]=this.input.end,this.result=this.simplifyPath(n),void(this.status="found")}this.explored>=this.exploredStateLimit?this.status="exhausted":(this.enqueuePlanarNeighbors(e),this.enqueueViaNeighbors(e),this.queue.length===0&&(this.status="exhausted"))}}isEnd(e){return e.layer===this.input.end.layer&&e.x===this.input.end.x&&e.y===this.input.end.y}estimate(e){return Math.hypot(e.x-this.input.end.x,e.y-this.input.end.y)+3*Math.abs(vp(e.layer,this.input.layerCount)-this.endLayer)}keyFor(e,t){return`${Object.is(e.x,-0)?0:e.x}:${Object.is(e.y,-0)?0:e.y}:${e.layer}:${t?.key??"start"}`}createDirection(e,t){let n=t.x-e.x,o=t.y-e.y,r=Math.hypot(n,o);if(r<=0.0000000001)throw Error("PostProcessingSolver: composite grid produced a zero-length planar edge");let i=n/r,s=o/r;return{x:i,y:s,key:`${i.toFixed(6)}:${s.toFixed(6)}`}}createPath(e){let t=[],n=e;for(;n;)t.push(n.point),n=n.parent;return t.reverse()}simplifyPath(e){return e.filter((t,n)=>{if(n===0||n===e.length-1)return!0;let o=e[n-1],r=e[n+1],i={x:t.x-o.x,y:t.y-o.y},s={x:r.x-t.x,y:r.y-t.y},a=i.x*s.y-i.y*s.x,c=Math.hypot(i.x,i.y)*Math.hypot(s.x,s.y);return Math.abs(a)>0.0000000001*c||t.layer!==o.layer||t.layer!==r.layer})}hasHigherQueuePriority(e,t){return e.estimate!==t.estimate?e.estimate<t.estimate:e.cost!==t.cost?e.cost<t.cost:e.point.x!==t.point.x?e.point.x<t.point.x:e.point.y!==t.point.y?e.point.y<t.point.y:e.point.layer!==t.point.layer?e.point.layer<t.point.layer:e.sequence<t.sequence}pushQueue(e){this.queue.push(e);let t=this.queue.length-1;for(;t>0;){let n=Math.floor((t-1)/2),o=this.queue[n];if(!this.hasHigherQueuePriority(e,o))break;this.queue[t]=o,t=n}this.queue[t]=e}popQueue(){let e=this.queue[0],t=this.queue.pop();if(!e||!t||this.queue.length===0)return e;let n=0;for(;;){let o=2*n+1;if(o>=this.queue.length)break;let r=o+1,i=o;r<this.queue.length&&this.hasHigherQueuePriority(this.queue[r],this.queue[o])&&(i=r);let s=this.queue[i];if(!this.hasHigherQueuePriority(s,t))break;this.queue[n]=s,n=i}return this.queue[n]=t,e}enqueuePlanarNeighbors(e){for(let t of this.grid.getPlanarNeighbors(e.point)){if(!this.input.isEdgeValid(e.point,t))continue;let n=this.createDirection(e.point,t),o=e.direction===null||e.direction.key===n.key?0:0.18,r=e.cost+Math.hypot(t.x-e.point.x,t.y-e.point.y)+o,i=this.keyFor(t,n);(this.bestCosts.get(i)??Number.POSITIVE_INFINITY)<=r||(this.bestCosts.set(i,r),this.pushQueue({point:t,direction:n,cost:r,estimate:r+this.estimate(t),parent:e,sequence:this.nextSequence++}))}}enqueueViaNeighbors(e){if(!e.direction)return;let t=vp(e.point.layer,this.input.layerCount);for(let n of[t-1,t+1]){if(n<0||n>=this.input.layerCount)continue;let o=ev(n,this.input.layerCount);if(!this.input.isViaValid(e.point,o,e.direction))continue;let r={...e.point,layer:o},i=e.cost+4,s=this.keyFor(r,e.direction);(this.bestCosts.get(s)??Number.POSITIVE_INFINITY)<=i||(this.bestCosts.set(s,i),this.pushQueue({point:r,direction:e.direction,cost:i,estimate:i+this.estimate(r),parent:e,sequence:this.nextSequence++}))}}},man=(e)=>{let t=Math.min(e.bounds.maxX-e.bounds.minX,e.bounds.maxY-e.bounds.minY),n=e.config?.innerGridStep??e.defaultInnerGridStep,o=e.config?.outerGridStep??4*n,r=e.config?.outerPerimeterWidth??Math.min(o,t/4);if(!Number.isFinite(n)||n<0.0001)throw Error("PostProcessingSolver: routingGrid.innerGridStep must be finite and at least 0.0001");if(!Number.isFinite(o)||o<=n)throw Error("PostProcessingSolver: routingGrid.outerGridStep must be finite and greater than innerGridStep");if(!Number.isFinite(r)||r<=0||2*r>=t)throw Error("PostProcessingSolver: routingGrid.outerPerimeterWidth must be finite, positive, and less than half the smaller board extent");let i=e.bounds.maxX-e.bounds.minX,s=e.bounds.maxY-e.bounds.minY;if((Math.ceil(i/o)+4)*(Math.ceil(s/o)+4)+(Math.ceil((i-2*r)/n)+2)*(Math.ceil((s-2*r)/n)+2)+18>250000)throw new dan("PostProcessingSolver: valid input exceeds the 250000-node optimization grid capacity");return{innerGridStep:n,outerGridStep:o,outerPerimeterWidth:r}},PYt=(e)=>{let t=-e.pathDirection.y,n=e.pathDirection.x,o=Math.tan(e.maximumTurnDegrees*Math.PI/180),r=Math.max(0,...e.lanes.map(({point:c,polarity:l})=>{let h=c.x-e.anchor.x,d=c.y-e.anchor.y,u=h*e.escapeDirection.x+d*e.escapeDirection.y,_=h*t+d*n,p=l*e.side*e.centerlineSpacing/2;return u+Math.abs(_-p)/o})),i=e.maxUncoupledLength??r;if(r>i+0.00000001)return null;let s=Math.max(0.05,Math.min(0.25,e.searchStep/2)),a=Math.max(1,Math.ceil((i-r)/s)+1);for(let c=0;c<a;c++){let l=Math.min(i,r+c*s),h={x:e.anchor.x+e.escapeDirection.x*l,y:e.anchor.y+e.escapeDirection.y*l,layer:e.anchor.layer};if(e.lanes.every(({point:d,polarity:u})=>{let _=u*e.side*e.centerlineSpacing/2,p=h.x+t*_,m=h.y+n*_;return e.maxUncoupledLength===void 0||Math.hypot(p-d.x,m-d.y)<=e.maxUncoupledLength+0.00000001})&&e.isValid(h))return h}return null},qCr=[0.75,0.5,1,0.25,1.25],P3e=100,JCr=class{constructor(e){this.input=e,this.pairName=e.pair.connectionNames.join("/"),this.prepared=this.prepare()}input;pairName;prepared;candidates=[];result=null;search=null;nextAttempt=0;exploredNodeCount=0;isComplete(){return this.result!==null}getResult(){if(!this.result)throw Error(`PostProcessingSolver: differential pair ${this.pairName} is not complete`);return this.result}getPreviewPath(){return this.search?.getPreviewPath()??null}getProgress(){if(this.result)return 1;let e=this.prepared.attempts.length,t=this.search?.getProgress()??0;return Math.min(0.99,(this.nextAttempt+t)/e)}getStats(){return{phase:this.search?"searching":"candidate-selection",pair:this.pairName,attemptIndex:this.nextAttempt,attemptCount:this.prepared.attempts.length,exploredNodeCount:this.exploredNodeCount+(this.search?.getExploredCount()??0),gridNodeCount:this.search?.getGridNodeCount()??0,acceptedCandidateCount:this.candidates.length}}step(){if(this.result)return;let e=this.prepared;if(!this.search){let r=e.attempts[this.nextAttempt];return r?void(this.search=new $Cr(r.input)):void this.complete()}if(this.search.step(),!this.search.isComplete())return;let t=this.search.getPath();this.exploredNodeCount+=this.search.getExploredCount();let n=e.attempts[this.nextAttempt];if(!n)throw Error(`PostProcessingSolver: differential pair ${this.pairName} lost its active attempt`);if(this.search=null,this.nextAttempt++,!t)return;let o=((r)=>{let i=(P,M)=>Math.hypot(P.x-M.x,P.y-M.y)<=0.00000001;if(r.path.length<2)throw Error("PostProcessingSolver: coupled path has fewer than two stations");let s=(P,M)=>{for(let B=P+M;B>=0&&B<r.path.length;B+=M){let T=r.path[B];if(!i(T,r.path[P]))return T}return null},a=(P)=>{let M=r.path[P],B=s(P,-1),T=s(P,1),N=(X,K)=>{let J=K.x-X.x,ee=K.y-X.y,se=Math.hypot(J,ee);if(se<=0.0000000001)throw Error("PostProcessingSolver: cannot offset a zero-length spine");return{x:-ee/se,y:J/se}},D=r.side*r.centerlineSpacing/2;if(!B||!T){let X=N(B??M,T??M);return{x:X.x*D,y:X.y*D}}if(r.terminalFanout&&P===1)return N(B,M);if(r.terminalFanout&&P===r.path.length-2)return N(M,T);if(r.terminalFanout&&r.path[P+1]?.layer!==M.layer)return N(B,M);let L=N(B,M),H=N(M,T),V={x:L.x+H.x,y:L.y+H.y},O=Math.hypot(V.x,V.y);if(O<=0.0000000001)return null;let U=V.x/O,j=V.y/O,Y=D/(U*L.x+j*L.y);return{x:U*Y,y:j*Y}},c=r.first.points[0],l=r.first.points.at(-1),h=r.reverseSecond?r.second.points.at(-1):r.second.points[0],d=r.reverseSecond?r.second.points[0]:r.second.points.at(-1),u=[[{route_type:"wire",x:c.x,y:c.y,width:c.width,layer:c.layer}],[{route_type:"wire",x:h.x,y:h.y,width:h.width,layer:h.layer}]],_=[r.first.transitions[0],r.second.transitions[0]],p=0,m=r.terminalFanout?1:0,A=r.path.length-2,g=r.path[A],f=r.path[A-1],y=r.terminalFanout&&g?.layer===l.layer&&f?.layer===g.layer,x=r.terminalFanout?y?A-1:r.path.length-1:r.path.length;for(let P=m;P<x;P++){let M=r.path[P],B=a(P);if(!B)return null;for(let T of[0,1]){let N=T===0?1:-1,D={x:M.x+B.x*N,y:M.y+B.y*N},L=u[T],H=r.path[P-1];if(H&&H.layer!==M.layer){if(!i(H,M))throw Error("PostProcessingSolver: a coupled layer transition moved in the plane");let V=[...L].reverse().find((U)=>U.route_type==="wire");if(!V)throw Error("PostProcessingSolver: generated via has no preceding wire");let O=_[T];L.push({route_type:"via",x:V.x,y:V.y,from_layer:H.layer,to_layer:M.layer,via_diameter:O?.via_diameter??(T===0?r.first.viaDiameter:r.second.viaDiameter),...O?.via_hole_diameter!==void 0?{via_hole_diameter:O.via_hole_diameter}:{}}),L.push({route_type:"wire",x:V.x,y:V.y,width:T===0?r.first.width:r.second.width,layer:M.layer})}else{let V=L.at(-1);V?.route_type==="wire"&&i(V,D)&&V.layer===M.layer||L.push({route_type:"wire",...D,width:T===0?r.first.width:r.second.width,layer:M.layer})}}r.path[P-1]?.layer!==M.layer&&P>0&&p++}let C=(P,M)=>{let B=P.at(-1);if(!B||B.route_type!=="wire")throw Error("PostProcessingSolver: terminal fanout has no preceding wire");let T=P.at(-2),N=!1;if(T?.route_type==="wire"&&T.layer===B.layer&&B.layer===M.layer){let D={x:B.x-T.x,y:B.y-T.y},L={x:M.x-B.x,y:M.y-B.y},H=Math.hypot(D.x,D.y),V=Math.hypot(L.x,L.y);if(H>0.00000001&&V>0.00000001&&Math.abs(D.x*L.x+D.y*L.y)<=0.00000001){let O={x:B.x-D.x/H*V,y:B.y-D.y/H*V};(O.x-T.x)*(D.x/H)+(O.y-T.y)*(D.y/H)>0.00000001&&(B.x=O.x,B.y=O.y,N=!0)}}r.terminalFanout&&!N&&B.x!==M.x&&B.y!==M.y&&P.push({route_type:"wire",x:M.x,y:B.y,width:M.width,layer:M.layer}),P.push({route_type:"wire",x:M.x,y:M.y,width:M.width,layer:M.layer})};C(u[0],l),C(u[1],d),r.reverseSecond&&(u[1]=u[1].reverse().map((P)=>P.route_type==="via"?{...P,from_layer:P.to_layer,to_layer:P.from_layer}:P));let b=(P,M)=>{let B=P.filter((T)=>T.route_type==="wire");for(let T of B)delete T.start_pcb_port_id,delete T.end_pcb_port_id;M.startPortId&&(B[0].start_pcb_port_id=M.startPortId),M.endPortId&&(B.at(-1).end_pcb_port_id=M.endPortId)};b(u[0],r.first),b(u[1],r.second);let I={...r.first.source,route:u[0]},v={...r.second.source,route:u[1]};return{first:I,second:v,firstParsed:B_(I,r.layerCount),secondParsed:B_(v,r.layerCount),edgeGap:r.edgeGap,centerlineDistance:r.centerlineSpacing,bendCount:Math.max(0,r.path.length-p-2),viaPairCount:p}})({first:e.first,second:e.second,reverseSecond:e.reverseSecond,path:t,centerlineSpacing:n.edgeGap+e.first.width/2+e.second.width/2,edgeGap:n.edgeGap,side:n.side,layerCount:this.input.layerCount,terminalFanout:e.terminalFanout});o&&qCe(o.firstParsed,o.secondParsed,e.context)&&this.candidates.push(o)}prepare(){let e=this.input.traces.map((I,v)=>({trace:I,index:v})).filter(({trace:I})=>I.connection_name===this.input.pair.connectionNames[0]),t=this.input.traces.map((I,v)=>({trace:I,index:v})).filter(({trace:I})=>I.connection_name===this.input.pair.connectionNames[1]);if(e.length!==1||t.length!==1)throw new MQ({connectionNames:this.input.pair.connectionNames,reason:"trace-resolution-failure",message:"must resolve each connection_name to exactly one non-branching trace"});if(e[0].index===t[0].index)throw new MQ({connectionNames:this.input.pair.connectionNames,reason:"trace-resolution-failure",message:"resolved both members to one trace"});let n,o;try{n=B_(e[0].trace,this.input.layerCount),o=B_(t[0].trace,this.input.layerCount)}catch(I){throw new MQ({connectionNames:this.input.pair.connectionNames,reason:"invalid-routed-geometry",message:`has unsupported or invalid routed geometry: ${I instanceof Error?I.message:String(I)}`})}let r=n.points[0],i=n.points.at(-1),s=Math.hypot(r.x-o.points[0].x,r.y-o.points[0].y)+Math.hypot(i.x-o.points.at(-1).x,i.y-o.points.at(-1).y),a=Math.hypot(r.x-o.points.at(-1).x,r.y-o.points.at(-1).y)+Math.hypot(i.x-o.points[0].x,i.y-o.points[0].y)+0.00000001<s,c=a?o.points.at(-1):o.points[0],l=a?o.points[0]:o.points.at(-1);if(r.layer!==c.layer||i.layer!==l.layer)throw new MQ({connectionNames:this.input.pair.connectionNames,reason:"terminal-layer-mismatch",message:"does not have common paired layers at both terminal stations"});let h={x:(r.x+c.x)/2,y:(r.y+c.y)/2,layer:r.layer},d={x:(i.x+l.x)/2,y:(i.y+l.y)/2,layer:i.layer},u=Math.hypot(d.x-h.x,d.y-h.y);if(u<0.000001)throw new MQ({connectionNames:this.input.pair.connectionNames,reason:"coincident-terminal-midpoints",message:"has coincident terminal-pair midpoints"});let _={x:-(d.y-h.y)/u,y:(d.x-h.x)/u},p=r.x-c.x,m=r.y-c.y,A=p*_.x+m*_.y>=0?1:-1,g=(I,v)=>{let P=I.x-v.x,M=I.y-v.y,B=Math.hypot(P,M);return B>0.00000001&&Math.abs(P*_.x+M*_.y)/B<0.5},f=g(r,c)&&g(i,l),y={x:_.y,y:-_.x},x=[r,c].some((I)=>(I.x-h.x)*y.x+(I.y-h.y)*y.y>0.00000001),C={immutableTraces:this.input.traces.filter((I,v)=>v!==e[0].index&&v!==t[0].index),obstacles:this.input.obstacles,bounds:this.input.bounds,layerCount:this.input.layerCount,minTraceToPadEdgeClearance:this.input.minTraceToPadEdgeClearance},b=((I)=>{let{minimumCenterlineDistance:v,maximumCenterlineDistance:P}=I;if(v===void 0&&P===void 0)return I.legacyCenterlineDistances;let M=[...v!==void 0&&P!==void 0?[(v+P)/2,v,P,v-0.25,P+0.25]:v!==void 0?[v,v+0.25,v+0.5,v-0.25,v+1]:[P,P-0.25,P-0.5,P+0.25,P-1],...I.legacyCenterlineDistances];return M.filter((B,T)=>B>I.minimumPhysicalDistance&&M.findIndex((N)=>Math.abs(N-B)<0.00000001)===T)})({minimumCenterlineDistance:this.input.pair.minimumCenterlineDistance,maximumCenterlineDistance:this.input.pair.maximumCenterlineDistance,minimumPhysicalDistance:n.width/2+o.width/2,legacyCenterlineDistances:qCr.map((I)=>I+n.width/2+o.width/2)}).flatMap((I)=>{let v=I-n.width/2-o.width/2;return[A,A===1?-1:1].flatMap((P)=>{let M=man({config:this.input.routingGrid,bounds:this.input.bounds,defaultInnerGridStep:Math.max(0.25,Math.min(0.5,I/2))}),B=(L,H)=>jCr({...C,start:L,end:H,firstConnectionName:n.source.connection_name,secondConnectionName:o.source.connection_name,firstStartTerminal:r,firstEndTerminal:i,secondStartTerminal:c,secondEndTerminal:l,firstWidth:n.width,secondWidth:o.width,firstViaDiameter:n.transitions[0]?.via_diameter??n.viaDiameter,secondViaDiameter:o.transitions[0]?.via_diameter??o.viaDiameter,centerlineSpacing:I,side:P,terminalFanout:f,terminalMiterMargin:this.input.pair.maxUncoupledLength===void 0?void 0:I/2}),T=this.input.pair.maxUncoupledLength===void 0?((L,H)=>{if(!x||f)return h;let V=[{terminal:r,offset:H*L/2},{terminal:c,offset:-H*L/2}],O=Math.tan(55*Math.PI/180),U=Math.max(...V.map(({terminal:j,offset:Y})=>{let X=(j.x-h.x)*y.x+(j.y-h.y)*y.y,K=(j.x-h.x)*_.x+(j.y-h.y)*_.y;return X+Math.abs(K-Y)/O}));return{x:h.x+y.x*U,y:h.y+y.y*U,layer:h.layer}})(I,P):h,N=d;if(!f&&this.input.pair.maxUncoupledLength!==void 0){let L=B(h,d),H=PYt({anchor:h,escapeDirection:y,pathDirection:y,centerlineSpacing:I,side:P,lanes:[{point:r,polarity:1},{point:c,polarity:-1}],maxUncoupledLength:this.input.pair.maxUncoupledLength,maximumTurnDegrees:55,searchStep:M.innerGridStep,isValid:(O)=>L.isTerminalFanoutValid(O,y,"start")}),V=PYt({anchor:d,escapeDirection:{x:-y.x,y:-y.y},pathDirection:y,centerlineSpacing:I,side:P,lanes:[{point:i,polarity:1},{point:l,polarity:-1}],maxUncoupledLength:this.input.pair.maxUncoupledLength,maximumTurnDegrees:45,searchStep:M.innerGridStep,isValid:(O)=>L.isTerminalFanoutValid(O,y,"end")});if(!H||!V)return[];if(T=H,N=V,(N.x-T.x)*y.x+(N.y-T.y)*y.y<=M.innerGridStep)return[]}let D=B(T,N);return[{edgeGap:v,side:P,input:{start:T,end:N,bounds:this.input.bounds,layerCount:this.input.layerCount,grid:M,...D}}]})});return{first:n,second:o,reverseSecond:a,terminalFanout:f,context:C,attempts:b}}complete(){if(this.candidates.length===0)throw new MQ({connectionNames:this.input.pair.connectionNames,reason:"no-valid-candidate",message:"could not be improved without violating bounds, copper clearance, or coupled-via constraints"});this.candidates.sort((e,t)=>this.score(e)-this.score(t)||e.edgeGap-t.edgeGap),this.result={status:"accepted",candidate:this.candidates[0]}}score(e){return(this.input.pair.minimumCenterlineDistance!==void 0||this.input.pair.maximumCenterlineDistance!==void 0?Math.max(0,(this.input.pair.minimumCenterlineDistance??Number.NEGATIVE_INFINITY)-e.centerlineDistance)*P3e+Math.max(0,e.centerlineDistance-(this.input.pair.maximumCenterlineDistance??Number.POSITIVE_INFINITY))*P3e:e.edgeGap<0.5?(0.5-e.edgeGap)*P3e:e.edgeGap>1?(e.edgeGap-1)*P3e:0)+aB(e.firstParsed)+aB(e.secondParsed)+0.15*e.bendCount+8*e.viaPairCount}},xle=(e)=>{let t={lines:[],points:[],rects:[],circles:[]};t.rects.push({center:{x:(e.bounds.minX+e.bounds.maxX)/2,y:(e.bounds.minY+e.bounds.maxY)/2},width:e.bounds.maxX-e.bounds.minX,height:e.bounds.maxY-e.bounds.minY,fill:"rgba(30, 70, 120, 0.04)",stroke:"rgba(30, 70, 120, 0.55)",layer:`z${Array.from({length:e.layerCount},(n,o)=>o).join(",")}`});for(let n of e.obstacles){let o=Xq(n,e.layerCount);t.rects.push({center:n.center,width:n.width,height:n.height,ccwRotationDegrees:n.ccwRotationDegrees,fill:"rgba(220, 60, 60, 0.16)",stroke:"rgba(190, 40, 40, 0.75)",layer:`z${o.join(",")}`})}for(let n=0;n<(e.previewPath?.length??0)-1;n++){let o=e.previewPath[n],r=e.previewPath[n+1];if(o.layer!==r.layer)continue;let i=vp(o.layer,e.layerCount);t.lines.push({points:[o,r],strokeColor:"#16a34a",strokeWidth:0.08,strokeDash:[0.18,0.12],layer:`z${i}`})}for(let n of e.traces){if(e.activeConnectionNames?.includes(n.connection_name))continue;let o="#2563eb",r=null;for(let i of n.route)if(i.route_type==="wire"){if(r&&r.layer===i.layer){let s=vp(i.layer,e.layerCount);t.lines.push({points:[r,i],strokeColor:o,strokeWidth:Math.max(r.width,i.width),...s===0?{}:{strokeDash:[0.2,0.16]},layer:`z${s}`})}r=i}else if(i.route_type==="via"){let s=Tq(i.from_layer,i.to_layer,e.layerCount).map((a)=>vp(a,e.layerCount));if(t.circles.push({center:i,radius:(i.via_diameter??r?.width??0.2)/2,fill:"rgba(37, 99, 235, 0.45)",stroke:o,layer:`z${s.join(",")}`}),r){let a=r.width;r={x:i.x,y:i.y,layer:i.to_layer,width:a}}}}return t},ZCr=class extends Da{constructor(e){super(),this.params=e,this.outputTraces=$Ce(e.simpleRouteJson.traces),this.MAX_ITERATIONS=uan(e)}params;outputTraces;reroutedPairs=[];failures=[];nextPairIndex=0;activeConnectionNames=null;activeSession=null;getSolverName(){return"DifferentialPairReroutingSolver"}_step(){let e=this.params.simpleRouteJson.differentialPairs[this.nextPairIndex];if(!e)return void this.finish();this.activeConnectionNames=e.connectionNames;try{if(!this.activeSession)return this.activeSession=new JCr({pair:e,traces:this.outputTraces,obstacles:this.params.simpleRouteJson.obstacles,bounds:this.params.simpleRouteJson.bounds,layerCount:this.params.simpleRouteJson.layerCount,minTraceToPadEdgeClearance:this.params.simpleRouteJson.minTraceToPadEdgeClearance,routingGrid:this.params.routingGrid}),void(this.stats=this.activeSession.getStats());this.activeSession.step()}catch(n){if(!(n instanceof MQ))throw n;return void this.skipFailedPair(e,n)}if(this.stats=this.activeSession.getStats(),!this.activeSession.isComplete())return;let t=this.activeSession.getResult();this.activeSession=null;for(let n of[t.candidate.first,t.candidate.second]){let o=this.outputTraces.findIndex((r)=>r.connection_name===n.connection_name);if(o<0)throw Error(`DifferentialPairReroutingSolver: accepted replacement for unknown connection "${n.connection_name}"`);this.outputTraces[o]=n}this.reroutedPairs.push(e),this.nextPairIndex++,this.nextPairIndex!==this.params.simpleRouteJson.differentialPairs.length?this.stats={phase:"accepted",pair:e.connectionNames.join("/"),pairIndex:this.nextPairIndex-1,pairCount:this.params.simpleRouteJson.differentialPairs.length}:this.finish()}finish(){this.activeConnectionNames=null,this.solved=!0,this.stats={phase:"complete",acceptedPairCount:this.reroutedPairs.length,skippedPairCount:this.failures.length}}skipFailedPair(e,t){this.failures.push({connectionNames:[...e.connectionNames],reason:t.reason,message:t.message}),this.activeSession=null,this.nextPairIndex++,this.nextPairIndex!==this.params.simpleRouteJson.differentialPairs.length?this.stats={phase:"skipped",pair:e.connectionNames.join("/"),pairIndex:this.nextPairIndex-1,pairCount:this.params.simpleRouteJson.differentialPairs.length,skippedPairCount:this.failures.length}:this.finish()}getConstructorParams(){return[this.params]}getOutput(){if(!this.solved)throw Error("DifferentialPairReroutingSolver: getOutput() called before completion");return this.getBestEffortOutput()}getBestEffortOutput(){return{traces:$Ce(this.outputTraces),reroutedPairs:this.reroutedPairs.map((e)=>({...e,connectionNames:[...e.connectionNames]})),failures:this.failures.map((e)=>({...e,connectionNames:[...e.connectionNames]}))}}computeProgress(){return this.solved?1:this.params.simpleRouteJson.differentialPairs.length===0?0:(this.nextPairIndex+(this.activeSession?.getProgress()??0))/this.params.simpleRouteJson.differentialPairs.length}visualize(){return xle({traces:this.outputTraces,obstacles:this.params.simpleRouteJson.obstacles,bounds:this.params.simpleRouteJson.bounds,layerCount:this.params.simpleRouteJson.layerCount,activeConnectionNames:this.activeConnectionNames,previewPath:this.activeSession?.getPreviewPath()??null})}},Xb=0.00000001,ebr=class extends Da{constructor(e){super(),this.input=e,this.traces=$Ce(e.traces),this.MAX_ITERATIONS=Math.max(1,e.reroutedPairs.length+1)}input;traces;nextPairIndex=0;getSolverName(){return"FortyFiveDegreeSimplificationSolver"}_step(){let e=this.input.reroutedPairs[this.nextPairIndex];if(!e)return this.solved=!0,void(this.stats={phase:"complete",simplifiedPairCount:this.nextPairIndex});this.traces=((t)=>{let n=t.pair.connectionNames.join("/"),o=t.pair.connectionNames.map((v)=>t.traces.map((P,M)=>({trace:P,index:M})).filter(({trace:P})=>P.connection_name===v));if(o[0].length!==1||o[1].length!==1)throw Error(`FortyFiveDegreeSimplificationSolver: pair ${n} must resolve to exactly two traces`);let r=o[0][0].index,i=o[1][0].index;if(r===i)throw Error(`FortyFiveDegreeSimplificationSolver: pair ${n} resolved both members to one trace`);let s=structuredClone(t.traces),a={immutableTraces:s.filter((v,P)=>P!==r&&P!==i),obstacles:t.obstacles,bounds:t.bounds,layerCount:t.layerCount,minTraceToPadEdgeClearance:t.minTraceToPadEdgeClearance},c=(v)=>{let P=B_(v[r],t.layerCount),M=B_(v[i],t.layerCount),B=0;for(let[T,N]of[[P.segments,M.segments],[M.segments,P.segments]])for(let D of T){if(D.terminal!==null)continue;let L=N.filter((H)=>H.layer===D.layer);if(L.length===0)throw Error(`FortyFiveDegreeSimplificationSolver: pair ${n} lost common-layer interior copper`);B=Math.max(B,Math.min(...L.map((H)=>a6(D.start,D.end,H.start,H.end))))}return B},l=(v)=>{let P=B_(v[r],t.layerCount),M=B_(v[i],t.layerCount),B=Number.POSITIVE_INFINITY;for(let[T,N]of[[P.segments,M.segments],[M.segments,P.segments]])for(let D of T)if(D.terminal===null)for(let L of N)L.layer===D.layer&&(B=Math.min(B,a6(D.start,D.end,L.start,L.end)-D.width/2-L.width/2));return Number.isFinite(B)?B:null},h=(v)=>{let P=B_(v[r],t.layerCount),M=B_(v[i],t.layerCount);return qCe(P,M,a)};if(!h(s))throw Error(`FortyFiveDegreeSimplificationSolver: rerouted pair ${n} has invalid complete copper before simplification`);if(t.pair.maxUncoupledLength!==void 0&&t.pair.minimumCenterlineDistance!==void 0&&t.pair.maximumCenterlineDistance!==void 0&&Math.abs(t.pair.minimumCenterlineDistance-t.pair.maximumCenterlineDistance)<=Xb)return s;let d=B_(s[r],t.layerCount),u=B_(s[i],t.layerCount),_=Math.abs(aB(d)-aB(u)),p=l(s),m=t.pair.maximumCenterlineDistance??1+d.width/2+u.width/2,A=Math.min(c(s),m),g=(v)=>{if(!h(v))return!1;if(c(v)>A+Xb)return!1;let P=l(v);return p===null||P===null||P>=p-Xb},f=(v,P)=>{let M=Math.abs(P.x-v.x),B=Math.abs(P.y-v.y),T=P.x>=v.x?1:-1,N=P.y>=v.y?1:-1,D=[],L={x:P.x-T*B,y:v.y};(L.x-v.x)*T>=-0.00000001&&(L.x-P.x)*T<=Xb&&D.push([v,L,P]);let H={x:v.x,y:P.y-N*M};(H.y-v.y)*N>=-0.00000001&&(H.y-P.y)*N<=Xb&&D.push([v,H,P]);let V={x:v.x+T*Math.min(M,B),y:v.y+N*Math.min(M,B)};return D.push([v,V,P]),D.map((O,U)=>{let j=O.filter((X,K)=>K===0||Math.hypot(X.x-O[K-1].x,X.y-O[K-1].y)>Xb),Y=j.slice(0,-1).map((X,K)=>{let J=j[K+1],ee=Math.abs(J.x-X.x),se=Math.abs(J.y-X.y);return{length:Math.hypot(ee,se),straight:ee<=Xb||se<=Xb?Math.hypot(ee,se):0}});return{points:j,usableStraightLength:Math.max(0,...Y.map((X)=>X.straight)),bendCount:Math.max(0,j.length-2),priority:U}}).filter((O,U,j)=>j.findIndex((Y)=>JSON.stringify(Y.points)===JSON.stringify(O.points))===U).sort((O,U)=>U.usableStraightLength-O.usableStraightLength||O.bendCount-U.bendCount||O.priority-U.priority)},y=(v)=>{let P=[];for(let M=0;M<v.route.length-1;M++){let B=v.route[M];if(B?.route_type==="wire")for(let T=v.route.length-1;T>=M+1;T--){if(M===0||T===v.route.length-1)continue;let N=v.route[T];N?.route_type==="wire"&&N.layer===B.layer&&(v.route.slice(M+1,T).some((D)=>D.route_type!=="wire"||D.layer!==B.layer)||P.push({startIndex:M,endIndex:T,skippedPointCount:T-M-1}))}}return P.sort((M,B)=>B.skippedPointCount-M.skippedPointCount||M.startIndex-B.startIndex||B.endIndex-M.endIndex)},x=(v,P,M)=>{let B=v.route[P.startIndex],T=v.route[P.endIndex],N=Math.max(B.width,T.width),D=M.points.slice(1,-1).map((L)=>({route_type:"wire",...L,width:N,layer:B.layer}));return{...v,route:[...v.route.slice(0,P.startIndex+1),...D,...v.route.slice(P.endIndex)]}};for(let v of[r,i]){let P=!0;for(;P;){P=!1;let M=s[v];for(let B of y(M)){let T=M.route[B.startIndex],N=M.route[B.endIndex],D=M.route.slice(B.startIndex,B.endIndex+1),L=D.slice(0,-1).every((H,V)=>{let O=D[V+1],U=Math.abs(O.x-H.x),j=Math.abs(O.y-H.y);return U<=Xb||j<=Xb||Math.abs(U-j)<=Xb});for(let H of f(T,N)){if(H.points.length>=D.length&&L)continue;let V=x(M,B,H),O=[...s];if(O[v]=V,JSON.stringify(V.route)===JSON.stringify(M.route))continue;if(g(O)){s[v]=V,P=!0;break}let U=v===r?i:r,j=s[U],Y=y(j).find((J)=>J.startIndex===B.startIndex&&J.endIndex===B.endIndex);if(!Y)continue;let X=j.route[Y.startIndex],K=j.route[Y.endIndex];for(let J of f(X,K)){let ee=x(j,Y,J),se=[...O];if(se[U]=ee,g(se)){s[v]=V,s[U]=ee,P=!0;break}}if(P)break}if(P)break}}}if(!g(s))throw Error(`FortyFiveDegreeSimplificationSolver: pair ${n} produced invalid complete copper`);let C=B_(s[r],t.layerCount),b=B_(s[i],t.layerCount),I=Math.abs(aB(C)-aB(b));return Math.abs(I-_)>t.pair.lengthTolerance+Xb?structuredClone(t.traces):s})({traces:this.traces,pair:e,obstacles:this.input.obstacles,bounds:this.input.bounds,layerCount:this.input.layerCount,minTraceToPadEdgeClearance:this.input.minTraceToPadEdgeClearance}),this.nextPairIndex++,this.stats={phase:"simplifying",pair:e.connectionNames.join("/"),pairIndex:this.nextPairIndex-1,pairCount:this.input.reroutedPairs.length}}getConstructorParams(){return[this.input]}getOutput(){if(!this.solved)throw Error("FortyFiveDegreeSimplificationSolver: getOutput() called before completion");return this.getBestEffortOutput()}getBestEffortOutput(){return{traces:$Ce(this.traces),reroutedPairs:this.input.reroutedPairs.map((e)=>({...e,connectionNames:[...e.connectionNames]}))}}computeProgress(){return this.solved?1:this.input.reroutedPairs.length===0?0:this.nextPairIndex/this.input.reroutedPairs.length}visualize(){return xle({traces:this.traces,obstacles:this.input.obstacles,bounds:this.input.bounds,layerCount:this.input.layerCount,activeConnectionNames:this.input.reroutedPairs[this.nextPairIndex]?.connectionNames??null,previewPath:null})}},JCe=(e,t)=>Math.abs(e-t)<=0.0000001,hje=(e,t)=>JCe(e.x,t.x)&&JCe(e.y,t.y),tbr=(e)=>{let t=e.candidatePair.map((n,o)=>{let r=e.originalPair[o];return{...n,segments:n.segments.filter((i)=>!r.segments.some((s)=>{return c=i,(a=s).layer===c.layer&&!!JCe(a.width,c.width)&&!!hje(a.start,c.start)&&!!hje(a.end,c.end);var a,c})),vias:n.vias.filter((i)=>!r.vias.some((s)=>{return!!hje(a=s,c=i)&&!!JCe(a.diameter,c.diameter)&&a.layers.length===c.layers.length&&!!a.layers.every((l)=>c.layers.includes(l));var a,c}))}});return[t[0],t[1]]},nbr=class extends Da{constructor(e){super(),this.input=e}input;output=null;visualizationTraces=null;getSolverName(){return"HdRouteReconstructionSolver"}_step(){this.visualizationTraces=((e)=>{let{simpleRouteJson:t}=e.params;if(e.result.matchedHdRoutes.length!==e.binding.solverParams.hdRoutes.length)throw Error("PostProcessingSolver: LengthMatchingSolver changed the search route count");let n=structuredClone(e.binding.baseTraces);for(let o of e.binding.traceBindings){let r=e.result.matchedHdRoutes[o.matchedRouteIndex];if(!r)throw Error(`PostProcessingSolver: missing matched route at index ${o.matchedRouteIndex}`);let i=n[o.traceIndex];if(!i)throw Error(`PostProcessingSolver: missing simplified trace binding at index ${o.traceIndex}`);if(i.connection_name!==r.connectionName)throw Error(`PostProcessingSolver: route binding changed connection "${i.connection_name}" to "${r.connectionName}"`);if(r.route.length<2)throw Error(`PostProcessingSolver: matched connection "${r.connectionName}" has incomplete geometry`);let s=r.route[0],a=r.route.at(-1);if(Math.hypot(s.x-o.startEndpoint.x,s.y-o.startEndpoint.y)>0.00000001||s.z!==o.startEndpoint.z||Math.hypot(a.x-o.endEndpoint.x,a.y-o.endEndpoint.y)>0.00000001||a.z!==o.endEndpoint.z)throw Error(`PostProcessingSolver: matched connection "${r.connectionName}" moved a preserved endpoint`);let c=[],l=0,h=(u)=>({route_type:"wire",x:u.x,y:u.y,width:u.traceThickness??r.traceThickness,layer:ev(u.z,t.layerCount)});c.push(h(r.route[0]));for(let u=1;u<r.route.length;u++){let _=r.route[u-1],p=r.route[u];if(_.z===p.z){c.push(h(p));continue}if(Math.hypot(_.x-p.x,_.y-p.y)>0.00000001)throw Error(`PostProcessingSolver: matched connection "${r.connectionName}" moves while changing layers`);let m=o.viaTemplates[l++];if(!m)throw Error(`PostProcessingSolver: matched connection "${r.connectionName}" added an unbound via`);if(Math.hypot(m.x-p.x,m.y-p.y)>0.00000001)throw Error(`PostProcessingSolver: matched connection "${r.connectionName}" moved a preserved via`);let A=ev(_.z,t.layerCount),g=ev(p.z,t.layerCount),f=new Set([m.from_layer,m.to_layer]);if(!f.has(A)||!f.has(g))throw Error(`PostProcessingSolver: matched connection "${r.connectionName}" changed a preserved via span`);c.push({...m}),c.push(h(p))}if(l!==o.viaTemplates.length)throw Error(`PostProcessingSolver: matched connection "${r.connectionName}" removed a preserved via`);let d=c.filter((u)=>u.route_type==="wire");for(let u of d)delete u.start_pcb_port_id,delete u.end_pcb_port_id;o.startPortId&&(d[0].start_pcb_port_id=o.startPortId),o.endPortId&&(d.at(-1).end_pcb_port_id=o.endPortId),n[o.traceIndex]={...i,route:c}}for(let o of e.binding.solverParams.differentialPairs){let r=o.connectionNames.join("/"),i=o.connectionNames.map((f)=>n.map((y,x)=>({trace:y,index:x})).filter(({trace:y})=>y.connection_name===f));if(i[0].length!==1||i[1].length!==1)throw Error(`PostProcessingSolver: reconstructed pair ${r} does not resolve to complete copper`);let s=i[0][0],a=i[1][0],c=o.connectionNames.map((f)=>{let y=e.binding.baseTraces.filter((x)=>x.connection_name===f);if(y.length!==1)throw Error(`PostProcessingSolver: original pair ${r} does not resolve to complete copper`);return y[0]}),l=B_(s.trace,t.layerCount),h=B_(a.trace,t.layerCount),d=B_(c[0],t.layerCount),u=B_(c[1],t.layerCount),_=Math.abs(aB(l)-aB(h));if(_>o.lengthTolerance+0.0000001)throw new D$e({message:`PostProcessingSolver: reconstructed pair ${r} exceeds length tolerance ${o.lengthTolerance} with error ${_}`,connectionNames:[...o.connectionNames],reason:"length-tolerance-unsatisfied"});let p={immutableTraces:n.filter((f,y)=>y!==s.index&&y!==a.index),obstacles:t.obstacles,bounds:t.bounds,layerCount:t.layerCount,minTraceToPadEdgeClearance:t.minTraceToPadEdgeClearance},m=qCe(l,h,{...p,obstacles:[]}),A=tbr({candidatePair:[l,h],originalPair:[d,u]}),g=qCe(A[0],A[1],{...p,immutableTraces:[]});if(!m||!g)throw new D$e({message:`PostProcessingSolver: length matching produced invalid complete copper for pair ${r}`,connectionNames:[...o.connectionNames],reason:"invalid-final-copper"})}return n})(this.input),this.output=han({...this.input,rejectInsideJumperPad:!0}),this.stats={phase:"complete",routeCount:this.output.hdRoutes.length},this.solved=!0}getConstructorParams(){return[this.input]}getOutput(){if(!this.output||!this.solved)throw Error("HdRouteReconstructionSolver: getOutput() called before completion");return structuredClone(this.output)}visualize(){let e=this.visualizationTraces??this.input.simplified.traces,{obstacles:t,bounds:n,layerCount:o}=this.input.params.simpleRouteJson;return xle({traces:e,obstacles:t,bounds:n,layerCount:o,activeConnectionNames:null,previewPath:null})}},_an=class extends rP{differentialPairReroutingSolver;fortyFiveDegreeSimplificationSolver;lengthMatchingSolver;hdRouteReconstructionSolver;lengthMatchingBinding=null;model;fallbackOutput=null;postProcessingErrors=[];pipelineDef=[Z0("differentialPairReroutingSolver",ZCr,(e)=>[e.model.params]),Z0("fortyFiveDegreeSimplificationSolver",ebr,(e)=>{let t=e.getStageOutput("differentialPairReroutingSolver");if(!t)throw Error("PostProcessingSolver: rerouting stage completed without output");let{obstacles:n,bounds:o,layerCount:r,minTraceToPadEdgeClearance:i}=e.model.params.simpleRouteJson;return[{...t,obstacles:n,bounds:o,layerCount:r,minTraceToPadEdgeClearance:i}]}),Z0("lengthMatchingSolver",lan,(e)=>{let t=e.getStageOutput("fortyFiveDegreeSimplificationSolver");if(!t)throw Error("PostProcessingSolver: 45-degree simplification stage completed without output");return e.lengthMatchingBinding=IYt({result:t,params:e.model.params}),[e.lengthMatchingBinding.solverParams]}),Z0("hdRouteReconstructionSolver",nbr,(e)=>{let t=e.getStageOutput("fortyFiveDegreeSimplificationSolver"),n=e.getStageOutput("lengthMatchingSolver");if(!t||!n||!e.lengthMatchingBinding)throw Error("PostProcessingSolver: reconstruction stage is missing a required binding or output");return[{binding:e.lengthMatchingBinding,result:n,simplified:t,params:e.model.params,model:e.model}]},{onSolved:(e)=>{let t=e.getStageOutput("differentialPairReroutingSolver");if(!t)throw Error("PostProcessingSolver: cannot summarize missing rerouting output");e.stats={phase:"complete",acceptedPairCount:t.reroutedPairs.length},t.failures.length>0&&(e.stats.skippedPairCount=t.failures.length,e.stats.postProcessingErrorCount=t.failures.length)}})];constructor(e){super(structuredClone(e));let t=null;try{(function(o){if(!o||typeof o!="object")throw Error("PostProcessingSolver: params must be an object");if(!Array.isArray(o.hdRoutes))throw Error("PostProcessingSolver: hdRoutes must be an array");if(!Array.isArray(o.differentialPairs))throw Error("PostProcessingSolver: differentialPairs must be an array");if(!Array.isArray(o.obstacles))throw Error("PostProcessingSolver: obstacles must be an array");if(o.minTraceToPadEdgeClearance!==void 0&&(!Number.isFinite(o.minTraceToPadEdgeClearance)||o.minTraceToPadEdgeClearance<0))throw Error("PostProcessingSolver: minTraceToPadEdgeClearance must be finite and nonnegative");if(!Number.isInteger(o.layerCount)||o.layerCount<1)throw Error("PostProcessingSolver: layerCount must be a positive integer");for(let h of o.obstacles){if(!h||typeof h!="object"||h.type!=="rect"||!h.center||!Number.isFinite(h.center.x)||!Number.isFinite(h.center.y)||!Number.isFinite(h.width)||h.width<=0||!Number.isFinite(h.height)||h.height<=0||!Array.isArray(h.layers)||h.layers.some((d)=>typeof d!="string")||!Array.isArray(h.connectedTo)||h.connectedTo.some((d)=>typeof d!="string"||d.length===0)||h.ccwRotationDegrees!==void 0&&!Number.isFinite(h.ccwRotationDegrees))throw Error("PostProcessingSolver: obstacle declaration is invalid");Xq(h,o.layerCount)}let{minX:r,maxX:i,minY:s,maxY:a}=o.bounds??{};if(![r,i,s,a].every(Number.isFinite)||r>=i||s>=a)throw Error("PostProcessingSolver: bounds must have finite positive extents");let c=new Set(o.differentialPairs.flatMap((h)=>h.connectionNames));for(let h of o.hdRoutes){if(!h||typeof h!="object"||typeof h.connectionName!="string"||h.connectionName.length===0||h.rootConnectionName!==void 0&&(typeof h.rootConnectionName!="string"||h.rootConnectionName.length===0)||!Number.isFinite(h.traceThickness)||h.traceThickness<=0||!Number.isFinite(h.viaDiameter)||h.viaDiameter<0||h.viaDiameter===0&&c.has(h.connectionName)||!Array.isArray(h.route)||!Array.isArray(h.vias)||h.jumpers!==void 0&&!Array.isArray(h.jumpers))throw Error("PostProcessingSolver: HD route declaration is invalid");if(h.startPcbPortId!==void 0&&(typeof h.startPcbPortId!="string"||h.startPcbPortId.length===0)||h.endPcbPortId!==void 0&&(typeof h.endPcbPortId!="string"||h.endPcbPortId.length===0))throw Error(`PostProcessingSolver: HD route "${h.connectionName}" has invalid terminal metadata`);for(let d of h.route)if(!d||typeof d!="object"||!Number.isFinite(d.x)||!Number.isFinite(d.y)||!Number.isInteger(d.z)||d.z<0||d.z>=o.layerCount||d.traceThickness!==void 0&&(!Number.isFinite(d.traceThickness)||d.traceThickness<=0))throw Error(`PostProcessingSolver: HD route "${h.connectionName}" has an invalid route point`);for(let d of h.vias)if(!d||typeof d!="object"||!Number.isFinite(d.x)||!Number.isFinite(d.y)||d.zLayers!==void 0&&(!Array.isArray(d.zLayers)||d.zLayers.some((u)=>!Number.isInteger(u)||u<0||u>=o.layerCount)))throw Error(`PostProcessingSolver: HD route "${h.connectionName}" has an invalid via`);if(h.vias.length>0&&h.viaDiameter<=0)throw Error(`PostProcessingSolver: HD route "${h.connectionName}" has a non-positive via diameter`);for(let d of h.jumpers??[])if(!(d&&typeof d=="object"&&d.route_type==="jumper"&&Number.isFinite(d.start?.x)&&Number.isFinite(d.start?.y)&&Number.isFinite(d.end?.x)&&Number.isFinite(d.end?.y)&&["0603","1206","1206x4_pair"].includes(d.footprint)))throw Error(`PostProcessingSolver: HD route "${h.connectionName}" has an invalid jumper`)}let l=new Set;for(let h of o.differentialPairs){if(!h||typeof h!="object"||!Array.isArray(h.connectionNames)||h.connectionNames.length!==2||h.connectionNames[0]===h.connectionNames[1]||!h.connectionNames.every((d)=>typeof d=="string"&&d.length>0)||!Number.isFinite(h.lengthTolerance)||h.lengthTolerance<0)throw Error("PostProcessingSolver: differential pair declaration is invalid");for(let d of[h.minimumCenterlineDistance,h.maximumCenterlineDistance])if(d!==void 0&&(!Number.isFinite(d)||d<=0))throw Error("PostProcessingSolver: differential pair centerline distances must be positive finite numbers");if(h.maxUncoupledLength!==void 0&&(!Number.isFinite(h.maxUncoupledLength)||h.maxUncoupledLength<0))throw Error("PostProcessingSolver: differential pair maxUncoupledLength must be a non-negative finite number");if(h.minimumCenterlineDistance!==void 0&&h.maximumCenterlineDistance!==void 0&&h.minimumCenterlineDistance>h.maximumCenterlineDistance)throw Error("PostProcessingSolver: differential pair minimumCenterlineDistance cannot exceed maximumCenterlineDistance");for(let d of h.connectionNames){if(l.has(d))throw Error(`PostProcessingSolver: connection "${d}" belongs to multiple differential pairs`);l.add(d)}}for(let h of[0.25,0.5])man({config:o.routingGrid,bounds:o.bounds,defaultInnerGridStep:h})})(e)}catch(o){if(!(o instanceof dan))throw o;t=o}if(this.model=vYt(e),t)return void this.finishWithBestEffortOutput({stage:"differentialPairReroutingSolver",message:t.message,reason:t.reason});let n=uan(this.model.params)+Math.max(1,e.differentialPairs.length+1)+1e5+10;if(!Number.isSafeInteger(n))throw Error("PostProcessingSolver: derived pipeline iteration bound exceeds the safe integer range");this.MAX_ITERATIONS=n}getSolverName(){return"PostProcessingSolver"}getConstructorParams(){return[structuredClone(this.inputProblem)]}_step(){let e=this.getCurrentStageName();try{super._step()}catch(n){let o=this.classifyOptimizationFailure(n,e);if(!o)throw n;return void this.finishWithBestEffortOutput(o)}if(!this.failed)return;let t=this.classifyIterationFailure(this.error,e);if(!t)throw Error(this.error??"PostProcessingSolver failed without an error message");this.finishWithBestEffortOutput(t)}tryFinalAcceptance(){let e=this.getCurrentStageName();e!=="differentialPairReroutingSolver"&&e!=="lengthMatchingSolver"||this.finishWithBestEffortOutput({stage:e,message:"PostProcessingSolver reached its iteration limit",reason:"iteration-limit-exhausted"})}classifyOptimizationFailure(e,t){return t==="lengthMatchingSolver"&&e instanceof J3e?{stage:t,message:e.message,connectionName:e.connectionName,reason:e.reason}:t==="hdRouteReconstructionSolver"&&e instanceof D$e||t==="differentialPairReroutingSolver"&&e instanceof MQ&&e.reason==="no-valid-candidate"?{stage:t,message:e.message,connectionNames:[...e.connectionNames],reason:e.reason}:null}classifyIterationFailure(e,t){return t!=="differentialPairReroutingSolver"&&t!=="lengthMatchingSolver"?null:e&&e.endsWith("ran out of iterations")?{stage:t,message:e,reason:"iteration-limit-exhausted"}:null}createBestEffortOutput(e){let t=this.lengthMatchingBinding;if(!t){let o=this.getStageOutput("fortyFiveDegreeSimplificationSolver")??this.fortyFiveDegreeSimplificationSolver?.getBestEffortOutput(),r=this.getStageOutput("differentialPairReroutingSolver")??this.differentialPairReroutingSolver?.getBestEffortOutput(),i=o??r;i&&(t=IYt({result:i,params:this.model.params}))}if(!t)return{output:{hdRoutes:structuredClone(this.inputProblem.hdRoutes),postProcessingErrors:[]},source:"input-hd-routes"};let n=this.getStageOutput("lengthMatchingSolver");return n||(n=this.lengthMatchingSolver?.getBestEffortOutput()),n&&e.reason!=="invalid-final-copper"||(n={matchedHdRoutes:t.solverParams.hdRoutes}),{output:han({binding:t,result:n,model:this.model}),source:"best-effort-hd-routes"}}finishWithBestEffortOutput(e){let t=this.createBestEffortOutput(e),n={type:"post_processing_error",...e,returnedRouteSource:t.source};this.postProcessingErrors.push(n),this.fallbackOutput=t.output,this.activeSubSolver=null,this.error=null,this.failed=!1,this.solved=!0,this.progress=1,this.stats={phase:"complete",postProcessingErrorCount:this.postProcessingErrors.length}}getOutput(){if(!this.solved)throw Error("PostProcessingSolver: getOutput() called before the solver completed");let e=this.fallbackOutput??this.getStageOutput("hdRouteReconstructionSolver");if(!e)throw Error("PostProcessingSolver: completed pipeline is missing reconstruction output");let t=this.getStageOutput("differentialPairReroutingSolver")??this.differentialPairReroutingSolver?.getBestEffortOutput(),n=t?.failures??[],o="input-hd-routes";(t?.reroutedPairs.length??0)>0&&(o="best-effort-hd-routes");let r=[...n.map((s)=>({type:"post_processing_error",stage:"differentialPairReroutingSolver",message:s.message,connectionNames:[...s.connectionNames],reason:s.reason,returnedRouteSource:o})),...this.postProcessingErrors],i=structuredClone(e);return i.postProcessingErrors=structuredClone(r),i}initialVisualize(){if(this.fallbackOutput)return{lines:this.fallbackOutput.hdRoutes.map((r)=>({points:r.route.map(({x:i,y:s})=>({x:i,y:s})),strokeWidth:r.traceThickness}))};let{traces:e,obstacles:t,bounds:n,layerCount:o}=this.model.params.simpleRouteJson;return xle({traces:structuredClone(e),obstacles:t,bounds:n,layerCount:o,activeConnectionNames:null,previewPath:null})}finalVisualize(){if(this.fallbackOutput)return this.initialVisualize();let e=vYt({...this.inputProblem,hdRoutes:this.getOutput().hdRoutes}),{traces:t,obstacles:n,bounds:o,layerCount:r}=e.params.simpleRouteJson;return xle({traces:t,obstacles:n,bounds:o,layerCount:r,activeConnectionNames:null,previewPath:null})}},Zle=class e{static generators=new Map;static register(t){e.generators.set(t.componentKind,t)}static create(t){let n=t.detectedComponent.componentKind,o=e.generators.get(n);if(!o)throw Error(`No topology generator registered for component kind "${n}"`);return new o(t)}},Cle=(e)=>[e.obstacle.obstacleId??e.obstacle.componentId??"obstacle",e.start.x.toFixed(4),e.start.y.toFixed(4),e.end.x.toFixed(4),e.end.y.toFixed(4),e.expansionDirection.x,e.expansionDirection.y].join(":"),gan=(e)=>{let t=0;for(let n of e)t=31*t+n.charCodeAt(0)>>>0;return t},T_=(e,t)=>`hsla(${gan(Cle(e))%360},72%,36%,${t})`,ble=(e)=>{let t=e.expansionDirection;return t.x<0?"left":t.x>0?"right":t.y<0?"bottom":"top"},jS=(e)=>({x:(e.start.x+e.end.x)/2,y:(e.start.y+e.end.y)/2}),N$e=(e)=>{let t=/^bga-gapfill-(\d+)-/.exec(e.capacityMeshNodeId);return t?Number.parseInt(t[1],10):null},EYt=(e,t)=>{let n=jS(e),o=jS(t),r=n.y-o.y;if(Math.abs(r)>0.000001)return r;let i=n.x-o.x;return Math.abs(i)>0.000001?i:Cle(e).localeCompare(Cle(t))},ZCe=(e)=>{let t=[...e].sort(EYt),n=[],o=t.shift();for(;o&&(n.push(o),t.length!==0);){let r=jS(o),i=0,s=Number.POSITIVE_INFINITY;for(let a=0;a<t.length;a++){let c=t[a],l=jS(c),h=(l.x-r.x)**2+(l.y-r.y)**2;h<s-0.000000001?(s=h,i=a):Math.abs(h-s)<=0.000000001&&EYt(c,t[i])<0&&(i=a)}o=t.splice(i,1)[0]}return n},nv=(e,t)=>{let n=Cle(e),o=t.findIndex((r)=>Cle(r)===n);return o>=0?`E${o+1}`:`E${gan(n).toString(36).slice(0,4)}`},R$e=(e)=>e.flatMap((t)=>{let n=tu(t);return[{obstacle:t,start:{x:n.minX,y:n.minY},end:{x:n.minX,y:n.maxY},expansionDirection:{x:-1,y:0}},{obstacle:t,start:{x:n.maxX,y:n.minY},end:{x:n.maxX,y:n.maxY},expansionDirection:{x:1,y:0}},{obstacle:t,start:{x:n.minX,y:n.minY},end:{x:n.maxX,y:n.minY},expansionDirection:{x:0,y:-1}},{obstacle:t,start:{x:n.minX,y:n.maxY},end:{x:n.maxX,y:n.maxY},expansionDirection:{x:0,y:1}}]}),$O=0.001,E3e=0.001,obr=class extends Da{constructor(e){super(),this.inputProblem=e}inputProblem;meshIndex;allEdges=[];queueEdges=[];disconnectedEdges=[];currentEdge=null;lastSearchBounds=null;lastCandidateMeshNodes=[];lastMatchedMeshNode=null;_setup(){let e=Math.max(this.inputProblem.meshNodes.length,1);this.meshIndex=new R_(e);for(let n of this.inputProblem.meshNodes){let o=tu(n);this.meshIndex.add(o.minX,o.minY,o.maxX,o.maxY)}this.meshIndex.finish();let t=R$e(this.inputProblem.unmarkedComponentObstacles);this.queueEdges=t,this.allEdges=ZCe(t),this.currentEdge=null,this.lastSearchBounds=null,this.lastCandidateMeshNodes=[],this.lastMatchedMeshNode=null}_step(){let e=this.queueEdges.shift();if(!e)return this.currentEdge=null,this.lastSearchBounds=null,this.lastCandidateMeshNodes=[],this.lastMatchedMeshNode=null,void(this.solved=!0);this.currentEdge=e,this.lastMatchedMeshNode=null;let t=Math.abs(e.start.x-e.end.x)<=$O,n=t?{minX:e.start.x-E3e,maxX:e.start.x+E3e,minY:Math.min(e.start.y,e.end.y),maxY:Math.max(e.start.y,e.end.y)}:{minX:Math.min(e.start.x,e.end.x),maxX:Math.max(e.start.x,e.end.x),minY:e.start.y-E3e,maxY:e.start.y+E3e};this.lastSearchBounds=n;let o=this.meshIndex.search(n.minX,n.minY,n.maxX,n.maxY);this.lastCandidateMeshNodes=o.map((i)=>this.inputProblem.meshNodes[i]);let r=!1;for(let i of o){let s=this.inputProblem.meshNodes[i],a=tu(s);if(t){if(!(Math.min(a.maxY,Math.max(e.start.y,e.end.y))-Math.max(a.minY,Math.min(e.start.y,e.end.y))>$O))continue;if(e.expansionDirection.x===-1&&Math.abs(a.maxX-e.start.x)<=$O){r=!0,this.lastMatchedMeshNode=s;break}if(e.expansionDirection.x===1&&Math.abs(a.minX-e.start.x)<=$O){r=!0,this.lastMatchedMeshNode=s;break}continue}if(Math.min(a.maxX,Math.max(e.start.x,e.end.x))-Math.max(a.minX,Math.min(e.start.x,e.end.x))>$O){if(e.expansionDirection.y===-1&&Math.abs(a.maxY-e.start.y)<=$O){r=!0,this.lastMatchedMeshNode=s;break}if(e.expansionDirection.y===1&&Math.abs(a.minY-e.start.y)<=$O){r=!0,this.lastMatchedMeshNode=s;break}}}r||this.disconnectedEdges.push(e)}getOutput(){return this.disconnectedEdges}visualize(){let e=this.disconnectedEdges,t=this.allEdges.length>0?this.allEdges:[...e,...this.currentEdge?[this.currentEdge]:[]],n=this.currentEdge?T_(this.currentEdge,0.88):"rgba(40,40,40,0.4)",o=this.inputProblem.meshNodes.map((d)=>({...qA(d,{rectMargin:0.01}),fill:d._containsObstacle?"rgba(120,120,120,0.18)":"rgba(120,120,120,0.08)",stroke:d._containsObstacle?"rgba(120,120,120,0.42)":"rgba(120,120,120,0.24)"})),r=this.lastSearchBounds&&this.currentEdge?[{center:(i=this.lastSearchBounds,{x:(i.minX+i.maxX)/2,y:(i.minY+i.maxY)/2}),width:this.lastSearchBounds.maxX-this.lastSearchBounds.minX,height:this.lastSearchBounds.maxY-this.lastSearchBounds.minY,fill:T_(this.currentEdge,0.1),stroke:T_(this.currentEdge,0.36),label:[nv(this.currentEdge,t),"search band"].join(" ")}]:[];var i;let s=this.lastCandidateMeshNodes.map((d)=>({...qA(d,{rectMargin:0.018}),fill:d===this.lastMatchedMeshNode?"rgba(0,180,90,0.24)":this.currentEdge?T_(this.currentEdge,0.16):"rgba(80,120,160,0.16)",stroke:d===this.lastMatchedMeshNode?"rgba(0,150,80,0.88)":n,label:[d===this.lastMatchedMeshNode?"matched":"candidate",d.capacityMeshNodeId,`z:${d.availableZ.join(",")}`].join(`
`)})),a=this.inputProblem.unmarkedComponentObstacles.map((d)=>({center:d.center,width:d.width,height:d.height,fill:"rgba(160,160,160,0.10)",stroke:"rgba(160,160,160,0.40)",label:d.obstacleId??d.componentId??"obstacle"})),c=e.map((d)=>({points:[d.start,d.end],strokeColor:T_(d,0.14),strokeWidth:0.01,strokeDash:"5 4",label:[nv(d,t),ble(d),"disconnected"].join(" ")})),l=[],h=[];if(this.currentEdge){let d=jS(this.currentEdge);l.push({points:[this.currentEdge.start,this.currentEdge.end],strokeColor:T_(this.currentEdge,1),strokeWidth:0.06,label:[nv(this.currentEdge,t),ble(this.currentEdge),"checking"].join(" ")},{points:[d,{x:d.x+0.16*this.currentEdge.expansionDirection.x,y:d.y+0.16*this.currentEdge.expansionDirection.y}],strokeColor:T_(this.currentEdge,0.82),strokeWidth:0.02,strokeDash:"3 3"}),h.push({...d,color:T_(this.currentEdge,1),label:nv(this.currentEdge,t)})}return{rects:[...o,...r,...s,...a],lines:[...c,...l],points:h}}},AQ=0.001,fQ=0.001,M3e=0.000001,rbr=class extends Da{constructor(e){super(),this.inputProblem=e}inputProblem;meshIndex;meshBounds;expandedNodes=[];_setup(){let e=Math.max(this.inputProblem.meshNodes.length,1);this.meshIndex=new R_(e);let{POSITIVE_INFINITY:t,NEGATIVE_INFINITY:n,POSITIVE_INFINITY:o,NEGATIVE_INFINITY:r}=Number;for(let i of this.inputProblem.meshNodes){let s=tu(i);this.meshIndex.add(s.minX,s.minY,s.maxX,s.maxY),t=Math.min(t,s.minX),n=Math.max(n,s.maxX),o=Math.min(o,s.minY),r=Math.max(r,s.maxY)}this.meshIndex.finish(),this.meshBounds=this.inputProblem.meshNodes.length?{minX:t,maxX:n,minY:o,maxY:r}:{minX:0,maxX:0,minY:0,maxY:0}}getObstacleAvailableZ(e){return e.__zLayers??e.layers.map((t)=>si(t,this.inputProblem.layerCount))}getSharedOverlapArea(e,t){if(!e.availableZ.some((s)=>t.availableZ.includes(s)))return 0;let n=tu(e),o=tu(t),r=Math.min(n.maxX,o.maxX)-Math.max(n.minX,o.minX),i=Math.min(n.maxY,o.maxY)-Math.max(n.minY,o.minY);return r<=M3e||i<=M3e?0:r*i}getNodeObstacleOverlapArea(e,t){let n=this.getObstacleAvailableZ(t);if(!e.availableZ.some((a)=>n.includes(a)))return 0;let o=tu(e),r=tu(t),i=Math.min(o.maxX,r.maxX)-Math.max(o.minX,r.minX),s=Math.min(o.maxY,r.maxY)-Math.max(o.minY,r.minY);return i<=M3e||s<=M3e?0:i*s}getClosestMeshNode(e,t){let n=Math.abs(e.start.x-e.end.x)<=AQ,o=this.getObstacleAvailableZ(e.obstacle),r=n?e.expansionDirection.x<0?{minX:this.meshBounds.minX,maxX:e.start.x,minY:Math.min(e.start.y,e.end.y)-fQ,maxY:Math.max(e.start.y,e.end.y)+fQ}:{minX:e.start.x,maxX:this.meshBounds.maxX,minY:Math.min(e.start.y,e.end.y)-fQ,maxY:Math.max(e.start.y,e.end.y)+fQ}:e.expansionDirection.y<0?{minX:Math.min(e.start.x,e.end.x)-fQ,maxX:Math.max(e.start.x,e.end.x)+fQ,minY:this.meshBounds.minY,maxY:e.start.y}:{minX:Math.min(e.start.x,e.end.x)-fQ,maxX:Math.max(e.start.x,e.end.x)+fQ,minY:e.start.y,maxY:this.meshBounds.maxY},i=this.meshIndex.search(r.minX,r.minY,r.maxX,r.maxY),s=null,a=Number.POSITIVE_INFINITY,c=[...i.map((l)=>this.inputProblem.meshNodes[l]),...t];for(let l of c){if(l._containsObstacle)continue;if(!l.availableZ.some((u)=>o.includes(u)))continue;let h=tu(l);if((n?Math.min(Math.max(e.start.y,e.end.y),h.maxY)-Math.max(Math.min(e.start.y,e.end.y),h.minY):Math.min(Math.max(e.start.x,e.end.x),h.maxX)-Math.max(Math.min(e.start.x,e.end.x),h.minX))<=AQ)continue;let d=n?e.expansionDirection.x<0?e.start.x-h.maxX:h.minX-e.start.x:e.expansionDirection.y<0?e.start.y-h.maxY:h.minY-e.start.y;d<AQ||(d>=a||(a=d,s=l))}return s}createExpandedNode(e,t,n){let o=tu(t),r=this.getObstacleAvailableZ(e.obstacle);if(Math.abs(e.start.x-e.end.x)<=AQ){let l=Math.max(Math.min(e.start.y,e.end.y),o.minY),h=Math.min(Math.max(e.start.y,e.end.y),o.maxY),d=e.expansionDirection.x<0?o.maxX:e.start.x,u=e.expansionDirection.x<0?e.start.x:o.minX;return u-d<=AQ||h-l<=AQ?null:{capacityMeshNodeId:`bga-gapfill-${n}-${e.obstacle.obstacleId??"no-obstacle"}-${t.capacityMeshNodeId}`,center:{x:(d+u)/2,y:(l+h)/2},width:u-d,height:h-l,layer:`z${r.join(",")}`,availableZ:r}}let i=Math.max(Math.min(e.start.x,e.end.x),o.minX),s=Math.min(Math.max(e.start.x,e.end.x),o.maxX),a=e.expansionDirection.y<0?o.maxY:e.start.y,c=e.expansionDirection.y<0?e.start.y:o.minY;return s-i<=AQ||c-a<=AQ?null:{capacityMeshNodeId:`bga-gapfill-${n}-${e.obstacle.obstacleId??"no-obstacle"}-${t.capacityMeshNodeId}`,center:{x:(i+s)/2,y:(a+c)/2},width:s-i,height:c-a,layer:`z${r.join(",")}`,availableZ:r}}overlapsExistingGeometry(e,t){for(let n of this.inputProblem.meshNodes)if(this.getSharedOverlapArea(e,n)>0)return!0;for(let n of t)if(this.getSharedOverlapArea(e,n)>0)return!0;for(let n of this.inputProblem.edgesWithObstacle)if(this.getNodeObstacleOverlapArea(e,n.obstacle)>0)return!0;return!1}_step(){let e=[];for(let[t,n]of this.inputProblem.edgesWithObstacle.entries()){let o=this.getClosestMeshNode(n,e);if(!o)continue;let r=this.createExpandedNode(n,o,t);r&&(this.overlapsExistingGeometry(r,e)||e.push(r))}this.expandedNodes=e,this.solved=!0}getOutput(){return this.expandedNodes}visualize(){let e=this.inputProblem.edgesWithObstacle,t=ZCe(e);return{rects:[...this.inputProblem.meshNodes.map((n)=>({...qA(n,{rectMargin:0.01}),fill:n._containsObstacle?"rgba(255,0,0,0.16)":"rgba(0,120,255,0.08)",stroke:n._containsObstacle?"rgba(255,0,0,0.35)":"rgba(0,120,255,0.28)"})),...this.expandedNodes.map((n)=>{let o=N$e(n),r=o===null?null:e[o]??null;return{...qA(n,{rectMargin:0.012,zOffset:0.01}),fill:r?T_(r,0.24):"rgba(0,160,100,0.24)",stroke:r?T_(r,0.72):"rgba(0,160,100,0.68)",label:[r?nv(r,t):"E?","expanded",n.capacityMeshNodeId,`z:${n.availableZ.join(",")}`].join(`
`)}})],lines:[...this.inputProblem.edgesWithObstacle.map((n)=>({points:[n.start,n.end],strokeColor:T_(n,0.9),strokeWidth:0.034,label:[nv(n,t),ble(n)].join(" ")})),...this.inputProblem.edgesWithObstacle.map((n)=>{let o=jS(n);return{points:[o,{x:o.x+0.16*n.expansionDirection.x,y:o.y+0.16*n.expansionDirection.y}],strokeColor:T_(n,0.7),strokeWidth:0.016,strokeDash:"3 3"}})],points:this.inputProblem.edgesWithObstacle.map((n)=>({...jS(n),color:T_(n,0.95),label:nv(n,t)}))}}},qO=0.001,ibr=class extends rP{constructor(e){super(e),this.inputProblem=e}inputProblem;detectEdgesNotConnectedToMesh;expandUnconnectedEdgesToMesh;pipelineDef=[Z0("detectEdgesNotConnectedToMesh",obr,(e)=>[e.inputProblem]),Z0("expandUnconnectedEdgesToMesh",rbr,(e)=>[{meshNodes:e.inputProblem.meshNodes,edgesWithObstacle:e.detectEdgesNotConnectedToMesh.getOutput(),layerCount:e.inputProblem.layerCount}])];getOutput(){return[...this.inputProblem.meshNodes,...this.expandUnconnectedEdgesToMesh.getOutput()]}getExpandedNodes(){return this.expandUnconnectedEdgesToMesh.getOutput()}getObstacleLayer(e){return`z${(e.obstacle.__zLayers??e.obstacle.layers.map((t)=>si(t,this.inputProblem.layerCount))).join(",")}`}getObstacleRects(){return this.inputProblem.unmarkedComponentObstacles.map((e)=>{let t=e.__zLayers??e.layers.map((n)=>si(n,this.inputProblem.layerCount));return{center:e.center,width:e.width,height:e.height,fill:"rgba(150,150,150,0.08)",stroke:"rgba(90,90,90,0.42)",label:e.obstacleId??e.componentId??"bga obstacle",layer:`z${t.join(",")}`}})}getBaseMeshRects(){return this.inputProblem.meshNodes.map((e)=>({...qA(e,{rectMargin:0.025,zOffset:0.01}),fill:e._containsObstacle?"rgba(210,60,60,0.14)":"rgba(80,120,160,0.08)",stroke:e._containsObstacle?"rgba(190,40,40,0.42)":"rgba(80,120,160,0.28)",label:`mesh ${e.capacityMeshNodeId}
z:${e.availableZ.join(",")}`}))}initialVisualize(){let e=R$e(this.inputProblem.unmarkedComponentObstacles),t=ZCe(e),n=[...e.map((o)=>({points:[o.start,o.end],strokeColor:T_(o,0.72),strokeWidth:0.018,strokeDash:"0.05 0.035",layer:this.getObstacleLayer(o),label:[nv(o,t),ble(o)].join(" ")})),...e.map((o)=>{let r=jS(o);return{points:[r,{x:r.x+0.18*o.expansionDirection.x,y:r.y+0.18*o.expansionDirection.y}],strokeColor:T_(o,0.64),strokeWidth:0.012,strokeDash:"0.035 0.025",layer:this.getObstacleLayer(o)}})];return{title:"BGA GapFill: candidate obstacle edges",rects:[...this.getBaseMeshRects(),...this.getObstacleRects()],lines:n}}finalVisualize(){let e=this.getStageOutput("detectEdgesNotConnectedToMesh")??[],t=this.getStageOutput("expandUnconnectedEdgesToMesh")??[],n=ZCe(R$e(this.inputProblem.unmarkedComponentObstacles)),o=new Map;for(let c of t){let l=N$e(c);l!==null&&o.set(l,c)}let r=t.map((c)=>{let l=N$e(c),h=l===null?null:e[l]??null,d=h?(({expandedNode:p,edge:m,meshNodes:A})=>{let g=tu(p),f=Math.abs(m.start.x-m.end.x)<=qO;return A.filter((y)=>{if(y._containsObstacle)return!1;if(!p.availableZ.some((C)=>y.availableZ.includes(C)))return!1;let x=tu(y);return f?!(Math.min(g.maxY,x.maxY)-Math.max(g.minY,x.minY)<=qO)&&(m.expansionDirection.x<0?Math.abs(x.maxX-g.minX)<=qO:Math.abs(x.minX-g.maxX)<=qO):!(Math.min(g.maxX,x.maxX)-Math.max(g.minX,x.minX)<=qO)&&(m.expansionDirection.y<0?Math.abs(x.maxY-g.minY)<=qO:Math.abs(x.minY-g.maxY)<=qO)}).map((y)=>y.capacityMeshNodeId)})({expandedNode:c,edge:h,meshNodes:this.inputProblem.meshNodes}):[],u=h?nv(h,n):"E?",_=h===null?"rgba(0,160,100,0.72)":T_(h,0.72);return{...qA(c,{rectMargin:0.012,zOffset:0.01}),fill:h===null?"rgba(0,160,100,0.24)":T_(h,0.16),stroke:_,label:[`${u} gap fill`,d.length>0?`to ${d.join(",")}`:"target mesh not adjacent",`z:${c.availableZ.join(",")}`].join(`
`)}}),i=e.map((c,l)=>{let h=o.get(l);return{points:[c.start,c.end],strokeColor:h?T_(c,0.68):"rgba(80,80,80,0.14)",strokeWidth:h?0.026:0.008,...h?{}:{strokeDash:"5 4"},layer:this.getObstacleLayer(c),label:[[nv(c,n),ble(c)].join(" "),h?"filled":"no fill created"].join(`
`)}}),s=e.flatMap((c,l)=>{let h=jS(c),d=o.get(l);return d?[{points:[h,d.center],strokeColor:T_(c,0.42),strokeWidth:0.012,strokeDash:"0.035 0.025",layer:this.getObstacleLayer(c)}]:[]}),a=e.flatMap((c,l)=>o.has(l)?[{...jS(c),color:T_(c,0.82),label:nv(c,n),layer:this.getObstacleLayer(c)}]:[]);return{title:"BGA GapFill: disconnected edges and created mesh",rects:[...this.getBaseMeshRects(),...this.getObstacleRects(),...r],lines:[...i,...s],points:a}}};function MYt(e,t){let n=[];for(let o=0;o<e.length;o++){let r=e[o];n.push(r);let i=e[o+1];if(i===void 0)continue;let s=Math.round((i-r)/t);if(!(s<=1))for(let a=1;a<s;a++){let c=a/s;n.push(Number((r+(i-r)*c).toFixed(6)))}}return n}var g$=0.001;function wYt(e){let t=[];for(let i=1;i<e.length;i++){let s=e[i]-e[i-1];s>g$&&t.push(s)}if(t.length===0)return null;let n=Math.min(...t),o=t.filter((i)=>i<=1.5*n).sort((i,s)=>i-s),r=Math.floor(o.length/2);return o.length%2==0?(o[r-1]+o[r])/2:o[r]}function BYt(e){return[...new Set(e)].sort((t,n)=>t-n)}function w3e(e){return Number(e.toFixed(6))}var sbr=class e{static fromObstacles(t){if(t.length===0)return null;let n=BYt(t.map((s)=>s.center.x)),o=BYt(t.map((s)=>s.center.y)),r=wYt(n),i=wYt(o);return r===null||i===null?null:new e({obstacles:t,xCoordinates:MYt(n,r),yCoordinates:MYt(o,i),pitchX:r,pitchY:i})}xCoordinates;yCoordinates;pitchX;pitchY;originX;originY;rowCount;colCount;padWidth;padHeight;slots=new Map;constructor(t){this.xCoordinates=t.xCoordinates,this.yCoordinates=t.yCoordinates,this.pitchX=t.pitchX,this.pitchY=t.pitchY,this.originX=this.xCoordinates[0],this.originY=this.yCoordinates[0],this.colCount=this.xCoordinates.length,this.rowCount=this.yCoordinates.length,this.padWidth=t.obstacles[0].width,this.padHeight=t.obstacles[0].height;for(let n of t.obstacles){let o=this.getSlotForObstacle(n);o&&this.slots.set(this.getSlotKey(o.row,o.col),{...o,obstacle:n})}}getSlotKey(t,n){return`${t}:${n}`}getAxisIndex(t,n){let o=-1,r=Number.POSITIVE_INFINITY;for(let i=0;i<t.length;i++){let s=Math.abs(t[i]-n);s<r&&(r=s,o=i)}return r<=g$?o:null}getAxisCoordinate(t,n){return t[n]}hasPadAt(t,n){return this.slots.has(this.getSlotKey(t,n))}getSlotForObstacle(t){let n=this.getAxisIndex(this.yCoordinates,t.center.y),o=this.getAxisIndex(this.xCoordinates,t.center.x);return n===null||o===null||n<0||n>=this.rowCount||o<0||o>=this.colCount?null:{row:n,col:o}}getSlotCenter(t,n){return{x:this.getAxisCoordinate(this.xCoordinates,n),y:this.getAxisCoordinate(this.yCoordinates,t)}}getHorizontalGap(t,n){let o=this.getSlotCenter(t,n),r=this.getSlotCenter(t,n+1),i=Math.abs(r.x-o.x);return{orientation:"horizontal",row:t,col:n,center:{x:w3e((o.x+r.x)/2),y:o.y},width:i-this.padWidth,height:this.padHeight,isBetweenTwoPads:this.hasPadAt(t,n)&&this.hasPadAt(t,n+1)}}getVerticalGap(t,n){let o=this.getSlotCenter(t,n),r=this.getSlotCenter(t+1,n),i=Math.abs(r.y-o.y);return{orientation:"vertical",row:t,col:n,center:{x:o.x,y:w3e((o.y+r.y)/2)},width:this.padWidth,height:i-this.padHeight,isBetweenTwoPads:this.hasPadAt(t,n)&&this.hasPadAt(t+1,n)}}getDiagonalGap(t,n){let o=this.getSlotCenter(t,n),r=this.getSlotCenter(t+1,n+1),i=Math.abs(r.x-o.x),s=Math.abs(r.y-o.y);return{orientation:"diagonal",row:t,col:n,center:{x:w3e((o.x+r.x)/2),y:w3e((o.y+r.y)/2)},width:i-this.padWidth,height:s-this.padHeight,isBetweenTwoPads:this.hasPadAt(t,n)&&this.hasPadAt(t+1,n+1)}}getDiagonalGaps(){let t=[];for(let n=0;n<this.rowCount-1;n++)for(let o=0;o<this.colCount-1;o++)t.push(this.getDiagonalGap(n,o));return t.filter((n)=>n.width>g$&&n.height>g$)}getAxisGaps(){let t=[];for(let n=0;n<this.rowCount;n++)for(let o=0;o<this.colCount-1;o++)t.push(this.getHorizontalGap(n,o));for(let n=0;n<this.rowCount-1;n++)for(let o=0;o<this.colCount;o++)t.push(this.getVerticalGap(n,o));return t.filter((n)=>n.width>g$&&n.height>g$)}getMissingSlots(){let t=[];for(let n=0;n<this.rowCount;n++)for(let o=0;o<this.colCount;o++)this.hasPadAt(n,o)||t.push({row:n,col:o,center:this.getSlotCenter(n,o),width:this.padWidth,height:this.padHeight});return t}};function abr(e){if([e.point.pointId,e.point.pcb_port_id].filter((o)=>typeof o=="string").some((o)=>e.obstacle.connectedTo.includes(o)))return!0;if(e.obstacle.connectedTo.length===0)return!1;if(iP(e.point,e.obstacle)>0.001)return!1;let t=E5(e.point).map((o)=>si(o,e.layerCount)),n=e.obstacle.layers.map((o)=>si(o,e.layerCount));return t.some((o)=>n.includes(o))}function Aan(e){return e.obstacleId??[e.componentId??"no-component",e.center.x,e.center.y,e.width,e.height,e.layers.join(",")].join(":")}function fan({componentId:e,orientationKey:t,row:n,col:o,center:r,width:i,height:s}){return["cmn",t,e,n,o,r.x,r.y,i,s].join("_")}function TYt(e){let{componentId:t,bgaGap:n,freeLayers:o,multiLayerThreshold:r}=e,i=n.width>r&&n.height>r,s="d";n.orientation==="horizontal"&&(s="h"),n.orientation==="vertical"&&(s="v");let a=fan({componentId:t,orientationKey:s,row:n.row,col:n.col,center:n.center,width:n.width,height:n.height});return n.orientation==="diagonal"&&i||!n.isBetweenTwoPads&&i?[{center:n.center,width:n.width,height:n.height,availableZ:[...o],capacityMeshNodeId:`${a}_all`,layer:""}]:o.map((c)=>({center:n.center,width:n.width,height:n.height,availableZ:[c],capacityMeshNodeId:`${a}_${c}`,layer:""}))}function cbr(e){let{componentId:t,obstacle:n,freeLayers:o,layerCount:r}=e,i=n.layers.map((c)=>si(c,r)),s=o.filter((c)=>!i.includes(c)),a=Aan(n);return s.map((c)=>({capacityMeshNodeId:`free-${t}-${a}-${c}`,center:n.center,width:n.width,height:n.height,layer:`z${c}`,availableZ:[c]}))}function DYt(e,t,n){let o=t.layers.map((s)=>si(s,n.layerCount)),r=Aan(t),i=function(s){for(let a of s.srj.connections)for(let c of a.pointsToConnect)if(abr({point:c,obstacle:s.obstacle,layerCount:s.srj.layerCount}))return a.__rootConnectionNames?.[0]??a.name}({obstacle:t,srj:n});return{capacityMeshNodeId:`obstacle-${e}-${r}-${o.join(",")}-${t.center.x}-${t.center.y}`,_containsObstacle:!0,...i?{_containsTarget:!0,_targetConnectionName:i}:{},center:t.center,width:t.width,height:t.height,layer:`z${o.join(",")}`,availableZ:o}}var lbr=class extends Da{constructor(e){super(),this.inputProblem=e}inputProblem;componentObstacles=[];meshNodes=[];getConstructorParams(){return[this.inputProblem]}_step(){let{srj:e,componentBounds:t,componentId:n,markedComponentObstacles:o,unmarkedComponentObstacles:r}=this.inputProblem,i=e.obstacles.filter((u)=>u.isCopperPour===!0).filter((u)=>mB(tu(u),t)).flatMap((u)=>u.layers.map((_)=>si(_,e.layerCount))),s=Array.from({length:e.layerCount},(u,_)=>_).filter((u)=>!i.includes(u));if(this.componentObstacles=o,o.length===0||s.length===0)return void(this.solved=!0);let a=sbr.fromObstacles(o);if(!a)return void(this.solved=!0);let c=a.getAxisGaps(),l=a.getDiagonalGaps(),h=a.getMissingSlots(),d=1.2*(this.inputProblem.viaDiameter??rm(e).padDiameter);this.meshNodes=[...c.flatMap((u)=>TYt({componentId:n,bgaGap:u,freeLayers:s,multiLayerThreshold:d})),...l.flatMap((u)=>TYt({componentId:n,bgaGap:u,freeLayers:s,multiLayerThreshold:d})),...h.flatMap((u)=>function(_){let{componentId:p,missingBgaSlot:m,freeLayers:A,multiLayerThreshold:g}=_,f=fan({componentId:p,orientationKey:"missing",row:m.row,col:m.col,center:m.center,width:m.width,height:m.height});return m.width>g&&m.height>g?[{center:m.center,width:m.width,height:m.height,availableZ:[...A],capacityMeshNodeId:`${f}_all`,layer:""}]:A.map((y)=>({center:m.center,width:m.width,height:m.height,availableZ:[y],capacityMeshNodeId:`${f}_${y}`,layer:""}))}({componentId:n,missingBgaSlot:u,freeLayers:s,multiLayerThreshold:d})),...o.flatMap((u)=>[...cbr({componentId:n,obstacle:u,freeLayers:s,layerCount:e.layerCount}),DYt(n,u,e)]),...r.flatMap((u)=>[DYt(n,u,e)])],this.meshNodes=function(u){let _=new Map;return u.map((p)=>{let m=_.get(p.capacityMeshNodeId)??0;return _.set(p.capacityMeshNodeId,m+1),m===0?p:{...p,capacityMeshNodeId:`${p.capacityMeshNodeId}__dup${m}`}})}(this.meshNodes),this.solved=!0}getOutput(){return this.meshNodes}visualize(){return{rects:[{center:{x:(this.inputProblem.componentBounds.minX+this.inputProblem.componentBounds.maxX)/2,y:(this.inputProblem.componentBounds.minY+this.inputProblem.componentBounds.maxY)/2},width:this.inputProblem.componentBounds.maxX-this.inputProblem.componentBounds.minX,height:this.inputProblem.componentBounds.maxY-this.inputProblem.componentBounds.minY,fill:"rgba(0,0,0,0)",stroke:"rgba(30,30,30,0.65)",label:`component ${this.inputProblem.componentId}`},...this.inputProblem.markedComponentObstacles.map((e)=>({center:e.center,width:e.width,height:e.height,fill:"rgba(255,0,0,0.18)",stroke:"rgba(255,0,0,0.52)",label:`pad ${e.obstacleId??"obstacle"}`})),...this.inputProblem.unmarkedComponentObstacles.map((e)=>({center:e.center,width:e.width,height:e.height,fill:"rgba(255,140,0,0.14)",stroke:"rgba(255,140,0,0.42)",label:`foreign ${e.obstacleId??"obstacle"}`})),...this.meshNodes.map((e)=>({...qA(e,{rectMargin:0.01}),fill:e._containsObstacle?"rgba(255,0,0,0.14)":e.capacityMeshNodeId.includes("missing")?"rgba(0,200,120,0.18)":"rgba(0,120,255,0.12)",stroke:e._containsObstacle?"rgba(255,0,0,0.36)":e.capacityMeshNodeId.includes("missing")?"rgba(0,200,120,0.52)":"rgba(0,120,255,0.38)"}))]}}};function dje(e){return e.capacityMeshNodeId.startsWith("bga-gapfill-")}function hbr(e){return JSON.stringify({availableZ:[...e.availableZ].sort((t,n)=>t-n),_containsTarget:e._containsTarget??!1,_targetConnectionName:e._targetConnectionName??null,_depth:e._depth??null,_strawNode:e._strawNode??!1,_strawParentCapacityMeshNodeId:e._strawParentCapacityMeshNodeId??null,_qfpRegionType:e._qfpRegionType??null,_isNarrowQfpPadGap:e._isNarrowQfpPadGap??!1,_soicRegionType:e._soicRegionType??null,_offBoardConnectionId:e._offBoardConnectionId??null,_offboardNetName:e._offboardNetName??null,_isVirtualOffboard:e._isVirtualOffboard??!1,_containsObstacle:e._containsObstacle??!1})}function dbr(e,t){let n=tu(e);for(let o of t){if(!e.availableZ.some((i)=>o.availableZ.includes(i)))continue;let r=tu(o);if(mB(n,r))return!0}return!1}function ubr(e){let t=e[0];if(!t)throw Error("createMergedNode requires at least one source node");let{POSITIVE_INFINITY:n,NEGATIVE_INFINITY:o,POSITIVE_INFINITY:r,NEGATIVE_INFINITY:i}=Number;for(let s of e){let a=tu(s);n=Math.min(n,a.minX),o=Math.max(o,a.maxX),r=Math.min(r,a.minY),i=Math.max(i,a.maxY)}return{...t,capacityMeshNodeId:`merge:${e.map((s)=>s.capacityMeshNodeId).join(":")}`,center:{x:(n+o)/2,y:(r+i)/2},width:o-n,height:i-r}}function zae(e,t,n){return{center:e.center,width:e.width,height:e.height,fill:t,stroke:t,label:n}}var pbr=class extends Da{constructor(e){super(),this.inputProblem=e}inputProblem;obstacleNodes=[];passthroughNodes=[];mergedNodes=[];pendingGroups=[];totalGroupCount=0;processedGroupCount=0;debugFilteredNodes=[];debugMergeEvents=[];currentGroupKey=null;currentRootNodeId=null;lastMergedNodeId=null;_setup(){this.obstacleNodes=this.inputProblem.meshNodes.filter((t)=>t._containsObstacle===!0),this.passthroughNodes=[],this.mergedNodes=[],this.pendingGroups=[],this.totalGroupCount=0,this.processedGroupCount=0,this.debugFilteredNodes=[],this.debugMergeEvents=[],this.currentGroupKey=null,this.currentRootNodeId=null,this.lastMergedNodeId=null;let e=new Map;for(let t of this.inputProblem.meshNodes){if(t._containsObstacle===!0){this.passthroughNodes.push(t),this.debugFilteredNodes.push({type:"preserved-obstacle",node:t,reason:"contains-obstacle"});continue}if(dje(t)){this.passthroughNodes.push(t);continue}if(t.availableZ.length!==this.inputProblem.layerCount){this.passthroughNodes.push(t);continue}let n=!1;for(let i=0;i<this.inputProblem.layerCount;i+=1)if(!t.availableZ.includes(i)){n=!0;break}if(n){this.passthroughNodes.push(t);continue}if(dbr(t,this.obstacleNodes)){this.passthroughNodes.push(t),this.debugFilteredNodes.push({type:"preserved-overlap",node:t,reason:"overlaps-obstacle"});continue}let o=hbr(t),r=e.get(o);r?r.push(t):e.set(o,[t])}for(let[t,n]of e.entries())n.length<=1?this.passthroughNodes.push(...n):this.pendingGroups.push({groupKey:t,nodes:n});this.pendingGroups.sort((t,n)=>n.nodes.length-t.nodes.length),this.totalGroupCount=this.pendingGroups.length,this.updateStats("setup")}_step(){let e=this.pendingGroups.shift();if(!e)return this.currentGroupKey=null,this.currentRootNodeId=null,this.solved=!0,void this.updateStats("done");let t=e.nodes[0];this.currentGroupKey=e.groupKey,this.currentRootNodeId=t?t.capacityMeshNodeId:null;let n=function(r){if(!r.nodes[0])return{outputNodes:[],mergeEvents:[]};let{POSITIVE_INFINITY:i,POSITIVE_INFINITY:s,POSITIVE_INFINITY:a,POSITIVE_INFINITY:c}=Number;for(let p of r.nodes){i=Math.min(i,p.width),s=Math.min(s,p.height);let m=tu(p);a=Math.min(a,m.minX),c=Math.min(c,m.minY)}let l=new Map,h=[];for(let p of r.nodes){let m=tu(p),A=Math.round((m.minX-a)/i),g=Math.round((m.minY-c)/s),f=Math.max(1,Math.round(p.width/i)),y=Math.max(1,Math.round(p.height/s));for(let x=0;x<y;x+=1)for(let C=0;C<f;C+=1)l.set(`${A+C},${g+x}`,p);h.push({col:A,row:g})}h.sort((p,m)=>p.row-m.row||p.col-m.col);let d=new Set,u=[],_=[];for(let p of h){let m=`${p.col},${p.row}`;if(d.has(m))continue;let A=0;for(;;){let v=`${p.col+A},${p.row}`;if(!l.has(v))break;if(d.has(v))break;A+=1}let g=A,f=1,y=1,x=1;for(let v=1;;v+=1){let P=p.row+v-1,M=0;for(;M<g;){let B=`${p.col+M},${P}`;if(!l.has(B))break;if(d.has(B))break;M+=1}if(M===0)break;g=Math.min(g,M);for(let B=g;B>=1;B-=1){let T=B*i,N=v*s,D=Math.min(T,N);if((D<=0.000001?Number.POSITIVE_INFINITY:Math.max(T,N)/D)>4)continue;let L=B*v;L>x&&(x=L,f=B,y=v);break}}let C=new Map;for(let v=0;v<y;v+=1)for(let P=0;P<f;P+=1){let M=`${p.col+P},${p.row+v}`,B=l.get(M);B&&(d.add(M),C.set(B.capacityMeshNodeId,B))}let b=[...C.values()];if(b.length<=1){let v=b[0];v&&u.push(v);continue}let I=ubr(b);u.push(I),_.push({type:"merge",groupKey:r.groupKey,sourceNodes:b,mergedNode:I})}return{outputNodes:u,mergeEvents:_}}(e);this.mergedNodes.push(...n.outputNodes),this.processedGroupCount+=1,this.debugMergeEvents.push(...n.mergeEvents);let o=n.mergeEvents[n.mergeEvents.length-1];o&&(this.lastMergedNodeId=o.mergedNode.capacityMeshNodeId),this.updateStats(n.mergeEvents.length>0?"merged-group":"passthrough-group")}computeProgress(){return this.totalGroupCount===0?1:this.processedGroupCount/this.totalGroupCount}updateStats(e){let t=new Set(this.debugMergeEvents.map((o)=>o.groupKey)),n={lastAction:e,totalGroupCount:this.totalGroupCount,processedGroupCount:this.processedGroupCount,pendingGroupCount:this.pendingGroups.length,mergedNodeCount:this.mergedNodes.length,passthroughNodeCount:this.passthroughNodes.length,gapFillNodeCount:this.passthroughNodes.filter(dje).length,preservedObstacleNodeCount:this.debugFilteredNodes.filter((o)=>o.type==="preserved-obstacle").length,preservedOverlapNodeCount:this.debugFilteredNodes.filter((o)=>o.type==="preserved-overlap").length,mergeCount:this.debugMergeEvents.length,mergedGroupCount:t.size,currentGroupKey:this.currentGroupKey,currentRootNodeId:this.currentRootNodeId,lastMergedNodeId:this.lastMergedNodeId};this.stats=n}getConstructorParams(){return[this.inputProblem]}getOutput(){return[...this.mergedNodes,...this.passthroughNodes]}visualize(){let e=this.getOutput(),t=this.currentRootNodeId?e.find((o)=>o.capacityMeshNodeId===this.currentRootNodeId)??null:null,n=this.lastMergedNodeId?e.find((o)=>o.capacityMeshNodeId===this.lastMergedNodeId)??null:null;return{rects:[...this.debugFilteredNodes.map((o)=>zae(o.node,o.type==="preserved-obstacle"?"rgba(255,64,64,0.35)":"rgba(255,160,64,0.35)",o.reason)),...this.passthroughNodes.map((o)=>zae(o,o._containsObstacle?"rgba(255,0,0,0.35)":dje(o)?"rgba(0,120,255,0.18)":"rgba(160,160,160,0.12)")),...this.mergedNodes.map((o)=>zae(o,"rgba(120,120,120,0.14)")),...t?[zae(t,"rgba(255,215,0,0.35)","active-group")]:[],...n?[zae(n,"rgba(0,200,120,0.28)","merged")]:[]]}}},mbr=class extends Da{constructor(e){super(),this.inputProblem=e}inputProblem;obstacleQueue=[];obstacleQueueIndex=0;meshNodes=[];_setup(){this.obstacleQueue=this.inputProblem.obstacles,this.obstacleQueueIndex=0,this.meshNodes=[...this.inputProblem.meshNodes]}_step(){if(this.obstacleQueueIndex>=this.obstacleQueue.length)return void(this.solved=!0);let e=this.obstacleQueue[this.obstacleQueueIndex],t=e.layers.map((o)=>si(o,this.inputProblem.layerCount)),n=[];for(let o of this.meshNodes){if(o._containsObstacle){n.push(o);continue}if(!t.some((i)=>o.availableZ.includes(i))){n.push(o);continue}if(!mB(tu(o),tu(e))){n.push(o);continue}if(o.availableZ.length===1)continue;let r=o.availableZ.filter((i)=>!t.includes(i));for(let i of r){let s={...o,capacityMeshNodeId:`${o.capacityMeshNodeId}:z${i}`,availableZ:[i],layer:`z${i}`};n.push(s)}}this.meshNodes=n,this.obstacleQueueIndex+=1,this.stats={obstaclesProcessed:this.obstacleQueueIndex,obstacleCount:this.obstacleQueue.length,meshNodeCount:this.meshNodes.length}}computeProgress(){return this.obstacleQueue.length===0?1:this.obstacleQueueIndex/this.obstacleQueue.length}getConstructorParams(){return[this.inputProblem]}getOutput(){return this.meshNodes}visualize(){let e=this.obstacleQueueIndex<this.obstacleQueue.length?this.obstacleQueue[this.obstacleQueueIndex]??null:null,t=this.obstacleQueue.slice(0,this.obstacleQueueIndex),n=e?this.obstacleQueue.slice(this.obstacleQueueIndex+1):[];return{rects:[...t.map((o)=>({center:o.center,width:o.width,height:o.height,fill:"rgba(160,160,160,0.10)",stroke:"rgba(160,160,160,0.35)",label:`processed ${o.obstacleId??"obstacle"}`})),...e?[{center:e.center,width:e.width,height:e.height,fill:"rgba(255,140,0,0.22)",stroke:"rgba(255,140,0,0.75)",label:`active ${e.obstacleId??"obstacle"}`}]:[],...n.map((o)=>({center:o.center,width:o.width,height:o.height,fill:"rgba(255,0,0,0.05)",stroke:"rgba(255,0,0,0.22)",label:`pending ${o.obstacleId??"obstacle"}`})),...this.meshNodes.map((o)=>({...qA(o,{rectMargin:0.01}),fill:o._containsObstacle?"rgba(255,0,0,0.18)":"rgba(0,120,255,0.12)",stroke:o._containsObstacle?"rgba(255,0,0,0.45)":"rgba(0,120,255,0.45)"}))]}}};Zle.register(class extends rP{constructor(e){super(e),this.inputProblem=e}inputProblem;static componentKind="bga";initialTopologySolver;removeMeshNodeOverlappingWithUnmarkedObstacle;gapfillDueToNodeRemoval;mergeMeshNodes;markedComponentObstacles=[];unmarkedComponentObstacles=[];pipelineDef=[Z0("initialTopologySolver",lbr,(e)=>[{srj:e.inputProblem.inputSrj,componentBounds:e.inputProblem.detectedComponent.bounds,componentId:e.inputProblem.detectedComponent.componentId,markedComponentObstacles:e.markedComponentObstacles,unmarkedComponentObstacles:e.unmarkedComponentObstacles,viaDiameter:e.inputProblem.viaDiameter}]),Z0("removeMeshNodeOverlappingWithUnmarkedObstacle",mbr,(e)=>[{meshNodes:e.initialTopologySolver.getOutput(),obstacles:e.unmarkedComponentObstacles,layerCount:e.inputProblem.inputSrj.layerCount}]),Z0("gapfillDueToNodeRemoval",ibr,(e)=>[{meshNodes:e.removeMeshNodeOverlappingWithUnmarkedObstacle.getOutput(),unmarkedComponentObstacles:e.unmarkedComponentObstacles,layerCount:e.inputProblem.inputSrj.layerCount}]),Z0("mergeMeshNodes",pbr,(e)=>[{meshNodes:e.gapfillDueToNodeRemoval.getOutput(),layerCount:e.inputProblem.inputSrj.layerCount}])];_setup(){let e=this.inputProblem.detectedComponent.bounds,t=this.inputProblem.detectedComponent.componentId,n=[],o=[];for(let r of this.inputProblem.inputSrj.obstacles){let i=tu(r);mB(e,i)&&(r.componentId!==t?o.push(r):n.push(r))}this.markedComponentObstacles=n,this.unmarkedComponentObstacles=o}getConstructorParams(){return[this.inputProblem]}getOutput(){return{routingRegions:this.mergeMeshNodes?.getOutput()??this.gapfillDueToNodeRemoval?.getOutput()??this.removeMeshNodeOverlappingWithUnmarkedObstacle?.getOutput()??[]}}initialVisualize(){return{rects:[{center:{x:(this.inputProblem.detectedComponent.bounds.minX+this.inputProblem.detectedComponent.bounds.maxX)/2,y:(this.inputProblem.detectedComponent.bounds.minY+this.inputProblem.detectedComponent.bounds.maxY)/2},width:this.inputProblem.detectedComponent.bounds.maxX-this.inputProblem.detectedComponent.bounds.minX,height:this.inputProblem.detectedComponent.bounds.maxY-this.inputProblem.detectedComponent.bounds.minY,fill:"rgba(0,0,0,0)",stroke:"rgba(30,30,30,0.65)",label:`bga ${this.inputProblem.detectedComponent.componentId}`},...this.markedComponentObstacles.map((e)=>({center:e.center,width:e.width,height:e.height,fill:"rgba(255,0,0,0.18)",stroke:"rgba(255,0,0,0.52)",label:`pad ${e.obstacleId??"obstacle"}`})),...this.unmarkedComponentObstacles.map((e)=>({center:e.center,width:e.width,height:e.height,fill:"rgba(255,140,0,0.14)",stroke:"rgba(255,140,0,0.42)",label:`foreign ${e.obstacleId??"obstacle"}`}))]}}finalVisualize(){return{rects:this.getOutput().routingRegions.map((e)=>({...qA(e,{rectMargin:0.01}),fill:e._containsObstacle?"rgba(255,0,0,0.16)":"rgba(0,120,255,0.12)",stroke:e._containsObstacle?"rgba(255,0,0,0.36)":"rgba(0,120,255,0.42)"}))}}});var NYt=0.000001;function i6e(e,t){return e.__zLayers&&e.__zLayers.length>0?wle(e.__zLayers,t):Ble(e.layers,t)}function B3e(e){let t=[...e].sort((i,s)=>i-s),n=[];for(let i=1;i<t.length;i++){let s=t[i]-t[i-1];s>NYt&&n.push(s)}let o=n.length>0?Math.max(NYt,Math.min(...n)/4):0.001,r=[];for(let i of t){let s=r[r.length-1];(s===void 0||Math.abs(i-s)>o)&&r.push(i)}return r}function $Ze(e){return Array.from({length:Math.max(0,e)},(t,n)=>n)}var RYt=0.000001;function yan(e){return e.maxX-e.minX>RYt&&e.maxY-e.minY>RYt}function QYt(e){return function(t){let n=Math.min(t.width,t.height),o=Math.max(t.width,t.height);return n<=0?0:o/n}(e)>=1.5}function _br(e,t){let n=[{side:"top",distance:Math.abs(e.center.y-t.minY)},{side:"right",distance:Math.abs(t.maxX-e.center.x)},{side:"bottom",distance:Math.abs(t.maxY-e.center.y)},{side:"left",distance:Math.abs(e.center.x-t.minX)}];return n.sort((o,r)=>o.distance-r.distance),n[0].side}function gbr(e,t){return e.map((n,o)=>({key:`pad:${n.obstacleId??o}`,bounds:Bi(n),regionType:"pad",obstacleZ:i6e(n,t),connectedTo:[...n.connectedTo]}))}function Abr(e,t){return e.map((n,o)=>({key:`thermal-pad:${n.obstacleId??o}`,bounds:Bi(n),regionType:"pad",obstacleZ:i6e(n,t),connectedTo:[...n.connectedTo]}))}function xan(e,t){return!!yan(e)&&Math.min(e.maxX-e.minX,e.maxY-e.minY)<=t}function T3e({side:e,sideObstacles:t,bounds:n,innerBounds:o,narrowThreshold:r}){let i=[];for(let s=0;s<t.length-1;s++){let a=Bi(t[s]),c=Bi(t[s+1]),l;l=e==="top"?{minX:a.maxX,maxX:c.minX,minY:n.minY,maxY:o.minY}:e==="right"?{minX:o.maxX,maxX:n.maxX,minY:a.maxY,maxY:c.minY}:e==="bottom"?{minX:a.maxX,maxX:c.minX,minY:o.maxY,maxY:n.maxY}:{minX:n.minX,maxX:o.minX,minY:a.maxY,maxY:c.minY},i.push({key:`${e}-gap-${s}`,bounds:l,regionType:"pad-gap",isNarrowPadGap:xan(l,r)})}return i}function D3e({side:e,sideObstacles:t,thermalPadBounds:n,narrowThreshold:o}){let r=[];for(let i=0;i<t.length;i++){let s=Bi(t[i]),a=t[i-1]?Bi(t[i-1]):null,c=t[i+1]?Bi(t[i+1]):null,l;l=e==="top"?{minX:a?(a.maxX+s.minX)/2:s.minX,maxX:c?(s.maxX+c.minX)/2:s.maxX,minY:s.maxY,maxY:n.minY}:e==="right"?{minX:n.maxX,maxX:s.minX,minY:a?(a.maxY+s.minY)/2:s.minY,maxY:c?(s.maxY+c.minY)/2:s.maxY}:e==="bottom"?{minX:a?(a.maxX+s.minX)/2:s.minX,maxX:c?(s.maxX+c.minX)/2:s.maxX,minY:n.maxY,maxY:s.minY}:{minX:s.maxX,maxX:n.minX,minY:a?(a.maxY+s.minY)/2:s.minY,maxY:c?(s.maxY+c.minY)/2:s.maxY},r.push({key:`inner-${e}-pad-${i}`,bounds:l,regionType:"pad-gap",isNarrowPadGap:xan(l,o)})}return r}function fbr({bounds:e,innerBounds:t,sideGroups:n}){let o=n.top[0]?Bi(n.top[0]):null,r=n.top.at(-1)?Bi(n.top.at(-1)):null,i=n.right[0]?Bi(n.right[0]):null,s=n.right.at(-1)?Bi(n.right.at(-1)):null,a=n.bottom[0]?Bi(n.bottom[0]):null,c=n.bottom.at(-1)?Bi(n.bottom.at(-1)):null,l=n.left[0]?Bi(n.left[0]):null,h=n.left.at(-1)?Bi(n.left.at(-1)):null;return[{key:"corner-nw-outer",regionType:"corner",bounds:{minX:e.minX,maxX:t.minX,minY:e.minY,maxY:t.minY}},{key:"corner-nw-top",regionType:"corner",bounds:{minX:t.minX,maxX:o?.minX??t.minX,minY:e.minY,maxY:t.minY}},{key:"corner-nw-left",regionType:"corner",bounds:{minX:e.minX,maxX:t.minX,minY:t.minY,maxY:l?.minY??t.minY}},{key:"corner-ne-outer",regionType:"corner",bounds:{minX:t.maxX,maxX:e.maxX,minY:e.minY,maxY:t.minY}},{key:"corner-ne-top",regionType:"corner",bounds:{minX:r?.maxX??t.maxX,maxX:t.maxX,minY:e.minY,maxY:t.minY}},{key:"corner-ne-right",regionType:"corner",bounds:{minX:t.maxX,maxX:e.maxX,minY:t.minY,maxY:i?.minY??t.minY}},{key:"corner-se-outer",regionType:"corner",bounds:{minX:t.maxX,maxX:e.maxX,minY:t.maxY,maxY:e.maxY}},{key:"corner-se-right",regionType:"corner",bounds:{minX:t.maxX,maxX:e.maxX,minY:s?.maxY??t.maxY,maxY:t.maxY}},{key:"corner-se-bottom",regionType:"corner",bounds:{minX:c?.maxX??t.maxX,maxX:t.maxX,minY:t.maxY,maxY:e.maxY}},{key:"corner-sw-outer",regionType:"corner",bounds:{minX:e.minX,maxX:t.minX,minY:t.maxY,maxY:e.maxY}},{key:"corner-sw-bottom",regionType:"corner",bounds:{minX:t.minX,maxX:a?.minX??t.minX,minY:t.maxY,maxY:e.maxY}},{key:"corner-sw-left",regionType:"corner",bounds:{minX:e.minX,maxX:t.minX,minY:h?.maxY??t.maxY,maxY:t.maxY}}]}function ybr({innerBounds:e,thermalPadBounds:t,sideGroups:n}){let o=n.top[0]?Bi(n.top[0]):null,r=n.top.at(-1)?Bi(n.top.at(-1)):null,i=n.right[0]?Bi(n.right[0]):null,s=n.right.at(-1)?Bi(n.right.at(-1)):null,a=n.bottom[0]?Bi(n.bottom[0]):null,c=n.bottom.at(-1)?Bi(n.bottom.at(-1)):null,l=n.left[0]?Bi(n.left[0]):null,h=n.left.at(-1)?Bi(n.left.at(-1)):null;return[{key:"inner-corner-nw-core",regionType:"corner",bounds:{minX:e.minX,maxX:t.minX,minY:e.minY,maxY:t.minY}},{key:"inner-corner-nw-top",regionType:"corner",bounds:{minX:t.minX,maxX:o?.minX??t.minX,minY:e.minY,maxY:t.minY}},{key:"inner-corner-nw-left",regionType:"corner",bounds:{minX:e.minX,maxX:t.minX,minY:t.minY,maxY:l?.minY??t.minY}},{key:"inner-corner-ne-core",regionType:"corner",bounds:{minX:t.maxX,maxX:e.maxX,minY:e.minY,maxY:t.minY}},{key:"inner-corner-ne-top",regionType:"corner",bounds:{minX:r?.maxX??t.maxX,maxX:t.maxX,minY:e.minY,maxY:t.minY}},{key:"inner-corner-ne-right",regionType:"corner",bounds:{minX:t.maxX,maxX:e.maxX,minY:t.minY,maxY:i?.minY??t.minY}},{key:"inner-corner-se-core",regionType:"corner",bounds:{minX:t.maxX,maxX:e.maxX,minY:t.maxY,maxY:e.maxY}},{key:"inner-corner-se-right",regionType:"corner",bounds:{minX:t.maxX,maxX:e.maxX,minY:s?.maxY??t.maxY,maxY:t.maxY}},{key:"inner-corner-se-bottom",regionType:"corner",bounds:{minX:c?.maxX??t.maxX,maxX:t.maxX,minY:t.maxY,maxY:e.maxY}},{key:"inner-corner-sw-core",regionType:"corner",bounds:{minX:e.minX,maxX:t.minX,minY:t.maxY,maxY:e.maxY}},{key:"inner-corner-sw-bottom",regionType:"corner",bounds:{minX:t.minX,maxX:a?.minX??t.minX,minY:t.maxY,maxY:e.maxY}},{key:"inner-corner-sw-left",regionType:"corner",bounds:{minX:e.minX,maxX:t.minX,minY:h?.maxY??t.maxY,maxY:t.maxY}}]}Zle.register(class extends Da{constructor(e){super(),this.inputProblem=e}inputProblem;static componentKind="qfp_thermalpad";output=null;getConstructorParams(){return[this.inputProblem]}_step(){if(this.output)return void(this.solved=!0);let{layerCount:e,obstacles:t}=this.inputProblem.inputSrj,{bounds:n,componentId:o}=this.inputProblem.detectedComponent,r=$Ze(e),i=t.filter((f)=>f.componentId===o),s=i.length>0?i:t,{padRingObstacles:a,thermalPadObstacles:c}=function(f){return{padRingObstacles:f.filter(QYt),thermalPadObstacles:f.filter((y)=>!QYt(y))}}(s),l=function(f,y){let x={top:[],right:[],bottom:[],left:[]};for(let C of f)x[_br(C,y)].push(C);return x.top.sort((C,b)=>C.center.x-b.center.x),x.bottom.sort((C,b)=>C.center.x-b.center.x),x.left.sort((C,b)=>C.center.y-b.center.y),x.right.sort((C,b)=>C.center.y-b.center.y),x}(a,n),h=function({bounds:f,sideGroups:y}){return{minX:y.left.length>0?Math.max(...y.left.map((x)=>Bi(x).maxX)):f.minX,maxX:y.right.length>0?Math.min(...y.right.map((x)=>Bi(x).minX)):f.maxX,minY:y.top.length>0?Math.max(...y.top.map((x)=>Bi(x).maxY)):f.minY,maxY:y.bottom.length>0?Math.min(...y.bottom.map((x)=>Bi(x).minY)):f.maxY}}({bounds:n,sideGroups:l}),d=function(f){return f.length===0?null:f.reduce((y,x)=>{let C=Bi(x);return{minX:Math.min(y.minX,C.minX),maxX:Math.max(y.maxX,C.maxX),minY:Math.min(y.minY,C.minY),maxY:Math.max(y.maxY,C.maxY)}},Bi(f[0]))}(c);if(!d)return this.failed=!0,void(this.error="QfpThermalPadTopologyGeneratorSolver requires a thermal pad");let u=o,_=this.inputProblem.viaDiameter??rm(this.inputProblem.inputSrj).padDiameter,p=this.inputProblem.obstacleMargin??this.inputProblem.inputSrj.defaultObstacleMargin??0.15,m=_+2*p,A=this.inputProblem.inputSrj.minTraceWidth+2*p,g=[...gbr(a,e),...Abr(c,e),...T3e({side:"top",sideObstacles:l.top,bounds:n,innerBounds:h,narrowThreshold:A}),...T3e({side:"right",sideObstacles:l.right,bounds:n,innerBounds:h,narrowThreshold:A}),...T3e({side:"bottom",sideObstacles:l.bottom,bounds:n,innerBounds:h,narrowThreshold:A}),...T3e({side:"left",sideObstacles:l.left,bounds:n,innerBounds:h,narrowThreshold:A}),...D3e({side:"top",sideObstacles:l.top,thermalPadBounds:d,narrowThreshold:A}),...D3e({side:"right",sideObstacles:l.right,thermalPadBounds:d,narrowThreshold:A}),...D3e({side:"bottom",sideObstacles:l.bottom,thermalPadBounds:d,narrowThreshold:A}),...D3e({side:"left",sideObstacles:l.left,thermalPadBounds:d,narrowThreshold:A}),...ybr({innerBounds:h,thermalPadBounds:d,sideGroups:l}),...fbr({bounds:n,innerBounds:h,sideGroups:l})].flatMap((f)=>function({nodeId:y,bounds:x,availableZ:C,multiLayerThreshold:b,regionType:I,isNarrowPadGap:v=!1,obstacleZ:P=[],connectedTo:M}){if(!yan(x))return[];let B=function(D){return{center:{x:(D.minX+D.maxX)/2,y:(D.minY+D.maxY)/2},width:D.maxX-D.minX,height:D.maxY-D.minY}}(x),T=Math.min(B.width,B.height)>b,N=T?[{availableZ:C.filter((D)=>!P.includes(D)),containsObstacle:!1},{availableZ:C.filter((D)=>P.includes(D)),containsObstacle:!0}].filter((D)=>D.availableZ.length>0):C.map((D)=>({availableZ:[D],containsObstacle:P.includes(D)}));return N.map((D)=>({capacityMeshNodeId:N.length===1?y:T?`${y}:${D.containsObstacle?"obstacle":"free"}`:`${y}:z${D.availableZ[0]}`,center:B.center,width:B.width,height:B.height,layer:`z${D.availableZ.join(",")}`,availableZ:D.availableZ,_qfpRegionType:I,_isNarrowQfpPadGap:v,_containsObstacle:D.containsObstacle,_connectedTo:D.containsObstacle?M:void 0}))}({nodeId:`qfp_thermalpad:${u}:${f.key}`,bounds:f.bounds,availableZ:r,multiLayerThreshold:m,regionType:f.regionType,isNarrowPadGap:f.isNarrowPadGap,obstacleZ:f.obstacleZ,connectedTo:f.connectedTo}));this.output={routingRegions:g},this.stats={componentId:o,layerCount:e,viaDiameter:_,obstacleMargin:p,multiLayerThreshold:m,narrowPadGapThreshold:A,thermalPadCount:c.length,perimeterPadCount:a.length,innerCornerRectCount:g.filter((f)=>f.capacityMeshNodeId.includes(":inner-corner-")).length,narrowPadGapNodeCount:g.filter((f)=>f._isNarrowQfpPadGap).length,topPadCount:l.top.length,rightPadCount:l.right.length,bottomPadCount:l.bottom.length,leftPadCount:l.left.length,multiLayerNodeCount:g.filter((f)=>f.availableZ.length>1).length,totalMeshNodeCount:g.length},this.solved=!0}getOutput(){if(!this.output)throw Error("QfpThermalPadTopologyGeneratorSolver has not solved yet");return this.output}});var kYt=0.000001;function Can(e){return e.maxX-e.minX>kYt&&e.maxY-e.minY>kYt}function xbr(e,t){let n=[{side:"top",distance:Math.abs(e.center.y-t.minY)},{side:"right",distance:Math.abs(t.maxX-e.center.x)},{side:"bottom",distance:Math.abs(t.maxY-e.center.y)},{side:"left",distance:Math.abs(e.center.x-t.minX)}];return n.sort((o,r)=>o.distance-r.distance),n[0].side}function Cbr(e,t){return e.map((n,o)=>({key:`pad:${n.obstacleId??o}`,bounds:Bi(n),regionType:"pad",obstacleZ:i6e(n,t),connectedTo:[...n.connectedTo]}))}function bbr(e,t){return!!Can(e)&&Math.min(e.maxX-e.minX,e.maxY-e.minY)<=t}function N3e({side:e,sideObstacles:t,bounds:n,centralBounds:o,narrowThreshold:r}){let i=[];for(let s=0;s<t.length-1;s++){let a=Bi(t[s]),c=Bi(t[s+1]),l;l=e==="top"?{minX:a.maxX,maxX:c.minX,minY:n.minY,maxY:o.minY}:e==="right"?{minX:o.maxX,maxX:n.maxX,minY:a.maxY,maxY:c.minY}:e==="bottom"?{minX:a.maxX,maxX:c.minX,minY:o.maxY,maxY:n.maxY}:{minX:n.minX,maxX:o.minX,minY:a.maxY,maxY:c.minY},i.push({key:`${e}-gap-${s}`,bounds:l,regionType:"pad-gap",isNarrowPadGap:bbr(l,r)})}return i}function Ibr({bounds:e,centralBounds:t,sideGroups:n}){let o=n.top[0]?Bi(n.top[0]):null,r=n.top.at(-1)?Bi(n.top.at(-1)):null,i=n.right[0]?Bi(n.right[0]):null,s=n.right.at(-1)?Bi(n.right.at(-1)):null,a=n.bottom[0]?Bi(n.bottom[0]):null,c=n.bottom.at(-1)?Bi(n.bottom.at(-1)):null,l=n.left[0]?Bi(n.left[0]):null,h=n.left.at(-1)?Bi(n.left.at(-1)):null;return[{key:"corner-nw-outer",regionType:"corner",bounds:{minX:e.minX,maxX:t.minX,minY:e.minY,maxY:t.minY}},{key:"corner-nw-top",regionType:"corner",bounds:{minX:t.minX,maxX:o?.minX??t.minX,minY:e.minY,maxY:t.minY}},{key:"corner-nw-left",regionType:"corner",bounds:{minX:e.minX,maxX:t.minX,minY:t.minY,maxY:l?.minY??t.minY}},{key:"corner-ne-outer",regionType:"corner",bounds:{minX:t.maxX,maxX:e.maxX,minY:e.minY,maxY:t.minY}},{key:"corner-ne-top",regionType:"corner",bounds:{minX:r?.maxX??t.maxX,maxX:t.maxX,minY:e.minY,maxY:t.minY}},{key:"corner-ne-right",regionType:"corner",bounds:{minX:t.maxX,maxX:e.maxX,minY:t.minY,maxY:i?.minY??t.minY}},{key:"corner-se-outer",regionType:"corner",bounds:{minX:t.maxX,maxX:e.maxX,minY:t.maxY,maxY:e.maxY}},{key:"corner-se-right",regionType:"corner",bounds:{minX:t.maxX,maxX:e.maxX,minY:s?.maxY??t.maxY,maxY:t.maxY}},{key:"corner-se-bottom",regionType:"corner",bounds:{minX:c?.maxX??t.maxX,maxX:t.maxX,minY:t.maxY,maxY:e.maxY}},{key:"corner-sw-outer",regionType:"corner",bounds:{minX:e.minX,maxX:t.minX,minY:t.maxY,maxY:e.maxY}},{key:"corner-sw-bottom",regionType:"corner",bounds:{minX:t.minX,maxX:a?.minX??t.minX,minY:t.maxY,maxY:e.maxY}},{key:"corner-sw-left",regionType:"corner",bounds:{minX:e.minX,maxX:t.minX,minY:h?.maxY??t.maxY,maxY:t.maxY}}]}Zle.register(class extends Da{constructor(e){super(),this.inputProblem=e}inputProblem;static componentKind="qfp";output=null;getConstructorParams(){return[this.inputProblem]}_step(){if(this.output)return void(this.solved=!0);let{layerCount:e,obstacles:t}=this.inputProblem.inputSrj,{bounds:n,componentId:o}=this.inputProblem.detectedComponent,r=$Ze(e),i=t.filter((m)=>m.componentId===o),s=i.length>0?i:t,a=function(m,A){let g={top:[],right:[],bottom:[],left:[]};for(let f of m)g[xbr(f,A)].push(f);return g.top.sort((f,y)=>f.center.x-y.center.x),g.bottom.sort((f,y)=>f.center.x-y.center.x),g.left.sort((f,y)=>f.center.y-y.center.y),g.right.sort((f,y)=>f.center.y-y.center.y),g}(s,n),c=function({bounds:m,sideGroups:A}){return{minX:A.left.length>0?Math.max(...A.left.map((g)=>Bi(g).maxX)):m.minX,maxX:A.right.length>0?Math.min(...A.right.map((g)=>Bi(g).minX)):m.maxX,minY:A.top.length>0?Math.max(...A.top.map((g)=>Bi(g).maxY)):m.minY,maxY:A.bottom.length>0?Math.min(...A.bottom.map((g)=>Bi(g).minY)):m.maxY}}({bounds:n,sideGroups:a}),l=o,h=this.inputProblem.viaDiameter??rm(this.inputProblem.inputSrj).padDiameter,d=this.inputProblem.obstacleMargin??this.inputProblem.inputSrj.defaultObstacleMargin??0.15,u=h+2*d,_=this.inputProblem.inputSrj.minTraceWidth+2*d,p=[{key:"center",bounds:c,regionType:"center"},...Cbr(s,e),...N3e({side:"top",sideObstacles:a.top,bounds:n,centralBounds:c,narrowThreshold:_}),...N3e({side:"right",sideObstacles:a.right,bounds:n,centralBounds:c,narrowThreshold:_}),...N3e({side:"bottom",sideObstacles:a.bottom,bounds:n,centralBounds:c,narrowThreshold:_}),...N3e({side:"left",sideObstacles:a.left,bounds:n,centralBounds:c,narrowThreshold:_}),...Ibr({bounds:n,centralBounds:c,sideGroups:a})].flatMap((m)=>function({nodeId:A,bounds:g,availableZ:f,multiLayerThreshold:y,regionType:x,isNarrowPadGap:C=!1,obstacleZ:b=[],connectedTo:I}){if(!Can(g))return[];let v=function(B){return{center:{x:(B.minX+B.maxX)/2,y:(B.minY+B.maxY)/2},width:B.maxX-B.minX,height:B.maxY-B.minY}}(g),P=Math.min(v.width,v.height)>y,M=P?[{availableZ:f.filter((B)=>!b.includes(B)),containsObstacle:!1},{availableZ:f.filter((B)=>b.includes(B)),containsObstacle:!0}].filter((B)=>B.availableZ.length>0):f.map((B)=>({availableZ:[B],containsObstacle:b.includes(B)}));return M.map((B)=>({capacityMeshNodeId:M.length===1?A:P?`${A}:${B.containsObstacle?"obstacle":"free"}`:`${A}:z${B.availableZ[0]}`,center:v.center,width:v.width,height:v.height,layer:`z${B.availableZ.join(",")}`,availableZ:B.availableZ,_qfpRegionType:x,_isNarrowQfpPadGap:C,_containsObstacle:B.containsObstacle,_connectedTo:B.containsObstacle?I:void 0}))}({nodeId:`qfp:${l}:${m.key}`,bounds:m.bounds,availableZ:r,multiLayerThreshold:u,regionType:m.regionType,isNarrowPadGap:m.isNarrowPadGap,obstacleZ:m.obstacleZ,connectedTo:m.connectedTo}));this.output={routingRegions:p},this.stats={componentId:o,layerCount:e,viaDiameter:h,obstacleMargin:d,multiLayerThreshold:u,narrowPadGapThreshold:_,narrowPadGapNodeCount:p.filter((m)=>m._isNarrowQfpPadGap).length,topPadCount:a.top.length,rightPadCount:a.right.length,bottomPadCount:a.bottom.length,leftPadCount:a.left.length,multiLayerNodeCount:p.filter((m)=>m.availableZ.length>1).length,totalMeshNodeCount:p.length},this.solved=!0}getOutput(){if(!this.output)throw Error("QfpTopologyGeneratorSolver has not solved yet");return this.output}});var LYt=0.000001;function vbr({nodeId:e,bounds:t,availableZ:n,multiLayerThreshold:o,regionType:r,obstacleZ:i=[],connectedTo:s}){if(!function(h){return h.maxX-h.minX>LYt&&h.maxY-h.minY>LYt}(t))return[];let a=function(h){return{center:{x:(h.minX+h.maxX)/2,y:(h.minY+h.maxY)/2},width:h.maxX-h.minX,height:h.maxY-h.minY}}(t),c=Math.min(a.width,a.height)>o,l=c?[{availableZ:n.filter((h)=>!i.includes(h)),containsObstacle:!1},{availableZ:n.filter((h)=>i.includes(h)),containsObstacle:!0}].filter((h)=>h.availableZ.length>0):n.map((h)=>({availableZ:[h],containsObstacle:i.includes(h)}));return l.map((h)=>({capacityMeshNodeId:l.length===1?e:c?`${e}:${h.containsObstacle?"obstacle":"free"}`:`${e}:z${h.availableZ[0]}`,center:a.center,width:a.width,height:a.height,layer:`z${h.availableZ.join(",")}`,availableZ:h.availableZ,_soicRegionType:r,_containsObstacle:h.containsObstacle,_connectedTo:h.containsObstacle?s:void 0}))}function HYt(e,t){let n=0,o=Number.POSITIVE_INFINITY;for(let r=0;r<t.length;r++){let i=Math.abs(e-t[r]);i<o&&(n=r,o=i)}return n}function Sbr(e,t){return e.map((n,o)=>({key:`pad:${n.obstacleId??o}`,bounds:Bi(n),regionType:"pad",obstacleZ:i6e(n,t),connectedTo:[...n.connectedTo]}))}function Q$e(e,t){if(e.componentId!==t.componentId)return!1;let{bounds:n}=t;return e.center.x>=n.minX&&e.center.x<=n.maxX&&e.center.y>=n.minY&&e.center.y<=n.maxY}function FYt({detectedComponent:e,inputSrj:t}){let n=t.obstacles.filter((a)=>Q$e(a,e)),o=Array.from({length:t.layerCount},(a,c)=>c),r=o.map((a)=>nd(a,t.layerCount)),i=Array.from(new Set(n.flatMap((a)=>a.connectedTo))),{bounds:s}=e;return{obstacleId:`${e.componentId}_component_bounds`,componentId:e.componentId,type:"rect",layers:r,__zLayers:o,center:{x:(s.minX+s.maxX)/2,y:(s.minY+s.maxY)/2},width:s.maxX-s.minX,height:s.maxY-s.minY,connectedTo:i}}function s6e(e){if(e.length===0)return{minX:0,maxX:0,minY:0,maxY:0};let{POSITIVE_INFINITY:t,NEGATIVE_INFINITY:n,POSITIVE_INFINITY:o,NEGATIVE_INFINITY:r}=Number;for(let i of e){let s=Bi(i);t=Math.min(t,s.minX),n=Math.max(n,s.maxX),o=Math.min(o,s.minY),r=Math.max(r,s.maxY)}return{minX:t,maxX:n,minY:o,maxY:r}}function Pbr(e){let t=e.componentDetectionOutput??[],n=function({detectedComponents:i,inputSrj:s}){return i.map((a)=>{let c=s.obstacles.filter((l)=>Q$e(l,a));return{componentId:a.componentId,componentKind:a.componentKind,memberObstacleIds:c.map((l,h)=>l.obstacleId??`${a.componentId}:member:${h}`),memberObstacles:c,replacementObstacle:FYt({detectedComponent:a,inputSrj:s})}})}({detectedComponents:t,inputSrj:e.inputSrj}),o=e.globalNoConnectionSrj??(t.length>0?function({detectedComponents:i,inputSrj:s}){return{...structuredClone(s),obstacles:[...s.obstacles.filter((a)=>!i.some((c)=>Q$e(a,c))),...i.map((a)=>FYt({detectedComponent:a,inputSrj:s}))]}}({detectedComponents:t,inputSrj:e.inputSrj}):e.inputSrj)??e.brokenSrj?.componentsAsObstaclesSrj,r=e.components??n??e.brokenSrj?.components??[];if(!o)throw Error("MultiGraphTopologyPlannerSolver requires globalNoConnectionSrj or detected components");return{globalNoConnectionSrj:o,components:r}}function Ebr({rects:e,components:t}){return e&&t.length!==0?e.filter((n)=>!function(o){return typeof o.label=="string"&&o.label.startsWith("node ")}(n)||!t.some((o)=>function({rect:r,obstacle:i}){if(!r.center||r.width===void 0||r.height===void 0)return!1;let s=0.000000001,a=tu({center:r.center,width:r.width,height:r.height}),c=tu({center:i.center,width:i.width,height:i.height});return ban({bounds:a,outerBounds:c,epsilon:s})}({rect:n,obstacle:o.replacementObstacle}))):e}function ban({bounds:e,outerBounds:t,epsilon:n}){return e.minX>=t.minX-n&&e.maxX<=t.maxX+n&&e.minY>=t.minY-n&&e.maxY<=t.maxY+n}Zle.register(class extends Da{constructor(e){super(),this.inputProblem=e}inputProblem;static componentKind="soic";output=null;getConstructorParams(){return[this.inputProblem]}_step(){if(this.output)return void(this.solved=!0);let{layerCount:e,obstacles:t}=this.inputProblem.inputSrj,{bounds:n,componentId:o}=this.inputProblem.detectedComponent,r=$Ze(e),i=t.filter((g)=>g.componentId===o),s=i.length>0?i:t,a=function(g){let f=B3e(g.map((y)=>y.center.y)).length;return B3e(g.map((y)=>y.center.x)).length===2&&f!==2?"vertical-columns":"horizontal-rows"}(s),c=function({obstacles:g,orientation:f}){let y={left:[],right:[],top:[],bottom:[]};if(f==="vertical-columns"){let C=B3e(g.map((b)=>b.center.x));for(let b of g)y[HYt(b.center.x,C)===0?"left":"right"].push(b);return y.left.sort((b,I)=>b.center.y-I.center.y),y.right.sort((b,I)=>b.center.y-I.center.y),y}let x=B3e(g.map((C)=>C.center.y));for(let C of g)y[HYt(C.center.y,x)===0?"top":"bottom"].push(C);return y.top.sort((C,b)=>C.center.x-b.center.x),y.bottom.sort((C,b)=>C.center.x-b.center.x),y}({obstacles:s,orientation:a}),l=function({bounds:g,orientation:f,sideGroups:y}){return f==="vertical-columns"?{minX:Math.max(...y.left.map((x)=>Bi(x).maxX)),maxX:Math.min(...y.right.map((x)=>Bi(x).minX)),minY:g.minY,maxY:g.maxY}:{minX:g.minX,maxX:g.maxX,minY:Math.max(...y.top.map((x)=>Bi(x).maxY)),maxY:Math.min(...y.bottom.map((x)=>Bi(x).minY))}}({bounds:n,orientation:a,sideGroups:c}),h=o,d=this.inputProblem.viaDiameter??rm(this.inputProblem.inputSrj).padDiameter,u=this.inputProblem.obstacleMargin??this.inputProblem.inputSrj.defaultObstacleMargin??0.15,_=2*(d+u),p=a==="vertical-columns"?["left","right"]:["top","bottom"],m=[{key:"center",bounds:l,regionType:"center"},...Sbr(s,e),...p.flatMap((g)=>function({side:f,sideObstacles:y,bounds:x,centralBounds:C}){let b=[];for(let I=0;I<y.length-1;I++){let v=Bi(y[I]),P=Bi(y[I+1]),M;M=f==="left"?{minX:x.minX,maxX:C.minX,minY:v.maxY,maxY:P.minY}:f==="right"?{minX:C.maxX,maxX:x.maxX,minY:v.maxY,maxY:P.minY}:f==="top"?{minX:v.maxX,maxX:P.minX,minY:x.minY,maxY:C.minY}:{minX:v.maxX,maxX:P.minX,minY:C.maxY,maxY:x.maxY},b.push({key:`${f}-gap-${I}`,bounds:M,regionType:"pad-gap"})}return b}({side:g,sideObstacles:c[g],bounds:n,centralBounds:l}))],A=m.flatMap((g)=>vbr({nodeId:`soic:${h}:${g.key}`,bounds:g.bounds,availableZ:r,multiLayerThreshold:_,regionType:g.regionType,obstacleZ:g.obstacleZ,connectedTo:g.connectedTo}));this.output={routingRegions:A},this.stats={componentId:o,layerCount:e,orientation:a,viaDiameter:d,obstacleMargin:u,multiLayerThreshold:_,firstSidePadCount:c[p[0]].length,secondSidePadCount:c[p[1]].length,multiLayerNodeCount:A.filter((g)=>g.availableZ.length>1).length,totalMeshNodeCount:A.length},this.solved=!0}getOutput(){if(!this.output)throw Error("SoicTopologyGeneratorSolver has not solved yet");return this.output}});var Mbr=class extends Da{constructor(e){super(),this.inputProblem=e}inputProblem;activeSubSolver=null;currentIndex=0;componentMeshNodes=[];getConstructorParams(){return[this.inputProblem]}_step(){if(this.activeSubSolver){if(this.activeSubSolver.step(),this.activeSubSolver.failed)return this.error=this.activeSubSolver.error,this.failed=!0,void(this.activeSubSolver=null);if(!this.activeSubSolver.solved)return;return this.componentMeshNodes.push(this.activeSubSolver.getOutput().routingRegions),this.currentIndex+=1,void(this.activeSubSolver=null)}if(this.currentIndex>=this.inputProblem.componentSrjs.length)return void(this.solved=!0);let e=this.inputProblem.componentKinds[this.currentIndex],t=this.inputProblem.componentSrjs[this.currentIndex],n={inputSrj:t,detectedComponent:{componentId:this.inputProblem.componentIds[this.currentIndex],componentKind:e,bounds:{__type:"rect",...t.bounds}},viaDiameter:this.inputProblem.viaDiameter,obstacleMargin:this.inputProblem.obstacleMargin};this.activeSubSolver=Zle.create(n)}getOutput(){return{componentMeshNodes:this.componentMeshNodes}}visualize(){if(this.activeSubSolver)return this.activeSubSolver.visualize();let e=this.inputProblem.componentSrjs[this.currentIndex]??null,t=this.componentMeshNodes.flatMap((n)=>n);return{rects:[...e?[{center:{x:(e.bounds.minX+e.bounds.maxX)/2,y:(e.bounds.minY+e.bounds.maxY)/2},width:e.bounds.maxX-e.bounds.minX,height:e.bounds.maxY-e.bounds.minY,fill:"rgba(0,0,0,0)",stroke:"rgba(255,140,0,0.72)",label:`active component ${this.inputProblem.componentIds[this.currentIndex]??this.currentIndex}`},...e.obstacles.map((n)=>({center:n.center,width:n.width,height:n.height,fill:"rgba(255,140,0,0.10)",stroke:"rgba(255,140,0,0.30)",label:n.obstacleId??n.componentId??"obstacle"}))]:[],...t.map((n)=>({...qA(n,{rectMargin:0.01}),fill:n._containsObstacle?"rgba(255,0,0,0.14)":"rgba(0,120,255,0.12)",stroke:n._containsObstacle?"rgba(255,0,0,0.34)":"rgba(0,120,255,0.38)"}))]}}},qV=0.001;function ebe(e){let t=[...e].sort((o,r)=>o-r),n=[];for(let o of t){let r=n[n.length-1];(r===void 0||Math.abs(o-r)>qV)&&n.push(o)}return n}function zYt(e){let t=Math.min(...e),n=Math.max(...e);return!(t<=0)&&n/t<=1.01}function wbr(e){if(!function(s){return zYt(s.map((a)=>a.width))&&zYt(s.map((a)=>a.height))}(e))return!1;if(!function(s){return s.every((a)=>{let c=Math.min(a.width,a.height),l=Math.max(a.width,a.height);return!(c<=0)&&l/c<=1.5})}(e))return!1;let t=ebe(e.map((s)=>s.center.y)),n=ebe(e.map((s)=>s.center.x)),o=t.length,r=n.length;if(o<3||r<3)return!1;let i=o*r;return!((i>0?e.length/i:0)<0.5)&&!!function(s,a,c){if(a.length<3)return!1;if(c.length<3)return!1;let l=new Set(a.slice(1,-1)),h=new Set(c.slice(1,-1)),d=0;for(let u of s)l.has(u.center.y)&&h.has(u.center.x)&&(d+=1);return d>=1}(e,t,n)}function Bbr(e){return[Math.round(e.width/qV),Math.round(e.height/qV),e.layers.join(",")].join(":")}function OYt(e){if(e.length<3)return!1;let t=[...e].sort((o,r)=>o-r),n=t[1]-t[0];return!(n<=qV)&&t.every((o,r)=>r===0||Math.abs(o-t[r-1]-n)<=qV)}function Tbr(e){let t=function(o){let r=new Map;for(let i of o){let s=Math.round(i.center.y/qV),a=Math.round(i.center.x/qV),c=r.get(s)??{y:i.center.y,obstaclesByX:new Map};c.obstaclesByX.set(a,i),r.set(s,c)}return[...r.values()]}(e),n=[];for(let o of t){let r=[...o.obstaclesByX.keys()];if(!OYt([...o.obstaclesByX.values()].map((a)=>a.center.x)))continue;let i=t.filter((a)=>r.every((c)=>a.obstaclesByX.has(c)));if(!OYt(i.map((a)=>a.y)))continue;let s=i.flatMap((a)=>r.map((c)=>a.obstaclesByX.get(c)));s.length>n.length&&(n=s)}return n}function Ian(e){if(wbr(e))return e;let t=Map.groupBy(e,Bbr),n=[];for(let o of t.values()){let r=Tbr(o);r.length>n.length&&(n=r)}return n.length>0?n:null}function VYt(e){let t=Math.min(e.width,e.height),n=Math.max(e.width,e.height);return t>0&&n/t>=1.5}function YYt({perimeterPadObstacles:e,thermalPadObstacles:t}){if(t.length===0)return!0;if(t.length>4)return!1;let n=s6e(e),o=n.maxX-n.minX,r=n.maxY-n.minY,i=n.minX+0.2*o,s=n.maxX-0.2*o,a=n.minY+0.2*r,c=n.maxY-0.2*r,l=Math.min(...e.map((h)=>Math.min(h.width,h.height)));return t.every((h)=>{let d=Math.min(h.width,h.height);return h.center.x>=i&&h.center.x<=s&&h.center.y>=a&&h.center.y<=c&&d>l})}function GYt(e){if(e.length<12)return!1;if(e.length>32)return!1;let{counts:t,maxNearestSideRatio:n}=function(o){let r=s6e(o),i=r.maxX-r.minX,s=r.maxY-r.minY,a={top:0,right:0,bottom:0,left:0};if(i<=0||s<=0)return{counts:a,maxNearestSideRatio:1};let c=0;for(let l of o){let h=l.width>l.height,d=[{side:"top",distance:Math.abs(l.center.y-r.minY),axisSpan:s,orientationMatches:!h},{side:"right",distance:Math.abs(r.maxX-l.center.x),axisSpan:i,orientationMatches:h},{side:"bottom",distance:Math.abs(r.maxY-l.center.y),axisSpan:s,orientationMatches:!h},{side:"left",distance:Math.abs(l.center.x-r.minX),axisSpan:i,orientationMatches:h}].filter((u)=>u.orientationMatches).sort((u,_)=>u.distance-_.distance)[0];a[d.side]+=1,c=Math.max(c,d.distance/d.axisSpan)}return{counts:a,maxNearestSideRatio:c}}(e);return t.top>=3&&t.right>=3&&t.bottom>=3&&t.left>=3&&n<=0.25}function UYt(e){return{perimeterPadObstacles:function(n){return n.filter(VYt)}(e),thermalPadObstacles:e.filter((n)=>!VYt(n))}}function WYt(e){let t=Math.min(...e),n=Math.max(...e);return!(t<=0)&&n/t<=1.01}function XYt(e,t){let n=0,o=Number.POSITIVE_INFINITY;for(let r=0;r<t.length;r++){let i=Math.abs(e-t[r]);i<o&&(n=r,o=i)}return n}function Dbr({memberObstacles:e,inputSrj:t}){if(!function(i){return WYt(i.map((s)=>s.width))&&WYt(i.map((s)=>s.height))}(e))return!1;let n=ebe(e.map((i)=>i.center.y)),o=ebe(e.map((i)=>i.center.x));if(!(n.length===2&&o.length>=4||o.length===2&&n.length>=4))return!1;let r=function({memberObstacles:i,rowAxisValues:s,columnAxisValues:a}){if(s.length===2&&a.length>=4){let c=[[],[]];for(let l of i)c[XYt(l.center.y,s)].push(l);return Math.min(...c[1].map((l)=>l.center.y-l.height/2))-Math.max(...c[0].map((l)=>l.center.y+l.height/2))}if(a.length===2&&s.length>=4){let c=[[],[]];for(let l of i)c[XYt(l.center.x,a)].push(l);return Math.min(...c[1].map((l)=>l.center.x-l.width/2))-Math.max(...c[0].map((l)=>l.center.x+l.width/2))}return null}({memberObstacles:e,rowAxisValues:n,columnAxisValues:o});if(r===null)return!1;return r>2*(rm(t).padDiameter+(t.defaultObstacleMargin??0.15))}var Nbr=[class e{constructor(t){this.params=t}params;static componentKind="qfp_thermalpad";componentKind=e.componentKind;static isMatch({memberObstacles:t}){return function(n){let{perimeterPadObstacles:o,thermalPadObstacles:r}=UYt(n);return r.length!==0&&!!GYt(o)&&YYt({perimeterPadObstacles:o,thermalPadObstacles:r})}(t)}},class e{constructor(t){this.params=t}params;static componentKind="qfp";componentKind=e.componentKind;static isMatch({memberObstacles:t}){return function(n){let{perimeterPadObstacles:o,thermalPadObstacles:r}=UYt(n);return!(r.length>0)&&!!YYt({perimeterPadObstacles:o,thermalPadObstacles:r})&&GYt(o)}(t)}},class e{constructor(t){this.params=t}params;static componentKind="soic";componentKind=e.componentKind;static isMatch(t){return Dbr(t)}},class e{constructor(t){this.params=t}params;static componentKind="bga";componentKind=e.componentKind;static isMatch({memberObstacles:t}){return function(n){return Ian(n)!==null}(t)}}];function Rbr(e){return function(t){for(let n of Nbr)if(n.isMatch(t))return new n(t);return null}(e)?.componentKind??null}var Qbr=class extends Da{inputSrj;initialized=!1;groupedComponentObstacles={};groupedComponentKinds={};unprocessedComponentIds=[];detectedComponents=[];currentComponentId=null;currentMemberObstacles=[];output=null;constructor({inputSrj:e}){super(),this.inputSrj=e}getConstructorParams(){return[{inputSrj:this.inputSrj}]}_step(){this.initialized?this.output?this.solved=!0:this.currentComponentId!==null||this.unprocessedComponentIds.length>0?this.processNextComponent():(this.finalizeOutput(),this.solved=!0):this.initializeDetectionState()}getOutput(){if(!this.output)throw Error("ComponentDetectionSolver has not solved yet");return this.output}visualize(){let e=[];e.push(...this.inputSrj.obstacles.filter((n)=>!n.componentId).map((n)=>({center:n.center,width:n.width,height:n.height,fill:"rgba(120, 120, 120, 0.10)",stroke:"rgba(120, 120, 120, 0.40)",label:n.obstacleId,layer:n.layers.join(","),step:0})));let t=new Set(this.detectedComponents.map((n)=>n.componentId));for(let n of this.inputSrj.obstacles){if(!n.componentId)continue;if(t.has(n.componentId))continue;let o=n.componentId===this.currentComponentId,r=Oce(n.componentId),i=this.groupedComponentKinds[n.componentId];e.push({center:n.center,width:n.width,height:n.height,fill:zi(r,o?0.55:0.82),stroke:zi(r,o?0.1:0.45),label:i?`${n.componentId} ${i.toUpperCase()}`:n.componentId,layer:n.layers.join(","),step:o?1:0})}for(let n of this.detectedComponents){let o=Oce(n.componentId);e.push({center:{x:(n.bounds.minX+n.bounds.maxX)/2,y:(n.bounds.minY+n.bounds.maxY)/2},width:n.bounds.maxX-n.bounds.minX,height:n.bounds.maxY-n.bounds.minY,fill:zi(o,0.88),stroke:zi(o,0.1),label:`${n.componentId} ${n.componentKind.toUpperCase()} region`,step:2})}return{title:this.getVisualizationTitle(),rects:e,lines:[],points:[],circles:[]}}preview(){return this.visualize()}initializeDetectionState(){this.initialized=!0,this.groupedComponentKinds={},this.groupedComponentObstacles=this.groupObstaclesByComponentId({obstacles:this.inputSrj.obstacles}),this.unprocessedComponentIds=Object.keys(this.groupedComponentObstacles).sort(),this.detectedComponents=[],this.currentComponentId=null,this.currentMemberObstacles=[],this.output=null}processNextComponent(){if(!this.currentComponentId){let e=this.unprocessedComponentIds.shift();return e?(this.currentComponentId=e,void(this.currentMemberObstacles=this.groupedComponentObstacles[e]??[])):(this.currentComponentId=null,void(this.currentMemberObstacles=[]))}if(this.currentMemberObstacles.length===0)return this.currentComponentId=null,void(this.currentMemberObstacles=[]);this.detectedComponents.push(this.createDetectedComponent({componentId:this.currentComponentId,componentKind:this.groupedComponentKinds[this.currentComponentId],memberObstacles:this.currentMemberObstacles})),this.currentComponentId=null,this.currentMemberObstacles=[]}finalizeOutput(){this.output=this.detectedComponents.map((e)=>({...e,bounds:{...e.bounds}})),this.stats={initialized:this.initialized,totalComponentCount:Object.keys(this.groupedComponentObstacles).length,detectedComponentCount:this.detectedComponents.length,detectedBgaComponentCount:this.detectedComponents.filter((e)=>e.componentKind==="bga").length,detectedQfpComponentCount:this.detectedComponents.filter((e)=>e.componentKind==="qfp").length,detectedQfpComponentIds:this.detectedComponents.filter((e)=>e.componentKind==="qfp").map((e)=>e.componentId),detectedQfpThermalPadComponentCount:this.detectedComponents.filter((e)=>e.componentKind==="qfp_thermalpad").length,detectedQfpThermalPadComponentIds:this.detectedComponents.filter((e)=>e.componentKind==="qfp_thermalpad").map((e)=>e.componentId),detectedSoicComponentCount:this.detectedComponents.filter((e)=>e.componentKind==="soic").length,detectedSoicComponentIds:this.detectedComponents.filter((e)=>e.componentKind==="soic").map((e)=>e.componentId),remainingComponentCount:this.unprocessedComponentIds.length,hasActiveComponent:this.currentComponentId!==null}}groupObstaclesByComponentId({obstacles:e}){let t={},n={};for(let r of e)r.componentId&&(t[r.componentId]??=[],t[r.componentId].push(r));let o=Object.entries(t).flatMap(([r,i])=>{let s=this.inputSrj.bounds;if(i.some((c)=>!ban({bounds:Bi(c),outerBounds:s,epsilon:0})))return[];let a=Rbr({memberObstacles:i,inputSrj:this.inputSrj});if(!a)return[];return n[r]=a,[[r,a==="bga"?Ian(i):i]]});return this.groupedComponentKinds=n,Object.fromEntries(o)}createDetectedComponent({componentId:e,componentKind:t,memberObstacles:n}){return{componentId:e,componentKind:t,bounds:{__type:"rect",...s6e(n)}}}getVisualizationTitle(){let e=Object.keys(this.groupedComponentObstacles).length||new Set(this.inputSrj.obstacles.map((n)=>n.componentId).filter((n)=>Boolean(n))).size,t=this.detectedComponents.length;return this.initialized?this.output||this.solved?`Component Detection: done ${t}/${e}`:this.currentComponentId!==null||this.unprocessedComponentIds.length>0?`Component Detection: ${t}/${e} processed`:`Component Detection: finalizing ${t}/${e}`:"Component Detection: setup"}},kbr=(e)=>e.componentId&&e.obstacleId?`${e.componentId}
${e.obstacleId}`:e.componentId??e.obstacleId??"obstacle",van=class extends rP{rectBoundsComponentDetection;pipelineDef=[Z0("rectBoundsComponentDetection",Qbr,(e)=>[{inputSrj:e.inputProblem.inputSrj}])];getConstructorParams(){return[this.inputProblem]}getOutput(){let e=this.getStageOutput("rectBoundsComponentDetection");if(!e)throw Error("ComponentDetectionSolver has not solved yet");return e}initialVisualize(){let{bounds:e}=this.inputProblem.inputSrj;return{title:"Component Detection: board and grouped component pads",rects:[{center:{x:(e.minX+e.maxX)/2,y:(e.minY+e.maxY)/2},width:e.maxX-e.minX,height:e.maxY-e.minY,fill:"rgba(0, 0, 0, 0)",stroke:"rgba(40, 40, 40, 0.7)",label:"Board bounds",step:0},...this.inputProblem.inputSrj.obstacles.map((t)=>{let n=t.componentId?Oce(t.componentId):null;return{center:t.center,width:t.width,height:t.height,fill:n?zi(n,0.72):"rgba(120, 120, 120, 0.10)",stroke:n?zi(n,0.28):"rgba(120, 120, 120, 0.40)",label:kbr(t),layer:t.layers.join(","),step:t.componentId?1:0}})],lines:[],points:[],circles:[]}}},ES=0.000000001;function wV(e){return tu({center:e.center,width:e.width,height:e.height})}function San(e,t){let n={minX:Math.max(e.minX,t.minX),maxX:Math.min(e.maxX,t.maxX),minY:Math.max(e.minY,t.minY),maxY:Math.min(e.maxY,t.maxY)};return qZe(n)?n:null}function qZe(e){let t=e.maxX-e.minX,n=e.maxY-e.minY,o=Number.isFinite(t)&&t>ES,r=Number.isFinite(n)&&n>ES;return o&&r}function Lbr(e){(function(o){if(!Number.isInteger(o.layerCount))throw Error("TopologyMergingSolver: layerCount must be an integer");if(o.layerCount<=0)throw Error("TopologyMergingSolver: layerCount must be positive");if(o.nodeGroups.length===0)throw Error("TopologyMergingSolver: at least one node group is required");let r=new Set,i=0;for(let s of o.nodeGroups){if(r.has(s.groupId))throw Error(`TopologyMergingSolver: duplicate topology group id "${s.groupId}"`);if(r.add(s.groupId),i+=s.nodes.length,s.nodes.length===0)throw Error(`TopologyMergingSolver: topology group "${s.groupId}" is empty`);let a=new Set;for(let c of s.nodes){if(a.has(c.capacityMeshNodeId))throw Error(`TopologyMergingSolver: duplicate node id "${c.capacityMeshNodeId}" in group "${s.groupId}"`);a.add(c.capacityMeshNodeId),Hbr({node:c,groupId:s.groupId,layerCount:o.layerCount})}}if(i===0)throw Error("TopologyMergingSolver: topology node groups are empty")})(e);let t=[],n=new Map;for(let o=0;o<e.nodeGroups.length;o++){let r=e.nodeGroups[o];for(let i of r.nodes){let s={sourceKey:`${r.groupId}:${i.capacityMeshNodeId}`,groupIndex:o,node:i,bounds:wV(i)};t.push(s),n.set(s.sourceKey,s)}}return{preparedNodes:t,preparedNodeBySourceKey:n}}function Hbr({node:e,groupId:t,layerCount:n}){if(!qZe(wV(e)))throw Error(`TopologyMergingSolver: node "${e.capacityMeshNodeId}" in group "${t}" has invalid bounds`);if(e.availableZ.length===0)throw Error(`TopologyMergingSolver: node "${e.capacityMeshNodeId}" in group "${t}" has no available layers`);let o=[...new Set(e.availableZ)].sort((s,a)=>s-a),r=o.some((s)=>!Number.isInteger(s)||s<0||s>=n),i=o.length===e.availableZ.length&&o.every((s,a)=>s===e.availableZ[a]);if(r||!i)throw Error(`TopologyMergingSolver: node "${e.capacityMeshNodeId}" in group "${t}" has invalid or unsorted availableZ`)}var tx=0.00001,R$=0.00004;function jYt({regions:e,preparedNodeBySourceKey:t,nodeGroups:n,provenance:o,preserveSourceIds:r=!0}){r&&(o.groupIndexesByNodeId.clear(),o.sourceKeysByNodeId.clear());let i=[...e].sort((a,c)=>a.bounds.minX-c.bounds.minX||a.bounds.minY-c.bounds.minY||a.bounds.maxX-c.bounds.maxX||a.bounds.maxY-c.bounds.maxY||a.availableZ[0]-c.availableZ[0]),s=new Set;return i.map((a,c)=>{let l=a.sourceKeys.map((m)=>{let A=t.get(m);if(!A)throw Error(`TopologyMergingSolver: missing source node for "${m}"`);return A}),h=l.map(({node:m})=>m),d=function({sourceNodes:m,isComponentTopologyNode:A}){if(m.length===1)return{_isComponentTopologyNode:!!A||m[0]._isComponentTopologyNode};let g=m.map((I)=>I.capacityMeshNodeId),f=uje(m.map((I)=>I._targetConnectionName),"target connection",g),y=uje(m.map((I)=>I._offBoardConnectionId),"off-board connection",g),x=uje(m.map((I)=>I._offboardNetName),"off-board net",g),C=Array.from(new Set(m.flatMap((I)=>I._offBoardConnectedCapacityMeshNodeIds??[]))),b=Array.from(new Set(m.flatMap((I)=>I._connectedTo??[])));return{_containsObstacle:m.some((I)=>I._containsObstacle)||void 0,_completelyInsideObstacle:m.some((I)=>I._completelyInsideObstacle)||void 0,_containsTarget:m.some((I)=>I._containsTarget)||void 0,_targetConnectionName:f,_isVirtualOffboard:m.some((I)=>I._isVirtualOffboard)||void 0,_offboardNetName:x,_offBoardConnectionId:y,_offBoardConnectedCapacityMeshNodeIds:C.length>0?C:void 0,_qfpRegionType:KYt(m.map((I)=>I._qfpRegionType)),_isNarrowQfpPadGap:m.some((I)=>I._isNarrowQfpPadGap)||void 0,_soicRegionType:KYt(m.map((I)=>I._soicRegionType)),_isComponentTopologyNode:A||void 0,_connectedTo:b.length>0?b:void 0}}({sourceNodes:h,isComponentTopologyNode:l.some(({groupIndex:m})=>n[m].isComponent)}),u=r&&l.length===1?l[0].node:null,p=Boolean(u&&function({region:m,sourceNode:A,usedNodeIds:g}){let f=wV(A),y=Math.abs(m.bounds.minX-f.minX)<=tx&&Math.abs(m.bounds.maxX-f.maxX)<=tx&&Math.abs(m.bounds.minY-f.minY)<=tx&&Math.abs(m.bounds.maxY-f.maxY)<=tx,x=m.availableZ.length===A.availableZ.length&&m.availableZ.every((C,b)=>C===A.availableZ[b]);return y&&x&&!g.has(A.capacityMeshNodeId)}({region:a,sourceNode:u,usedNodeIds:s}))?u.capacityMeshNodeId:`topology_merge_${c}`;for(;s.has(p);)p=`${p}_next`;return s.add(p),r&&(o.groupIndexesByNodeId.set(p,[...new Set(l.map(({groupIndex:m})=>m))]),o.sourceKeysByNodeId.set(p,[...a.sourceKeys])),{...u??h[0],...d,capacityMeshNodeId:p,center:{x:(a.bounds.minX+a.bounds.maxX)/2,y:(a.bounds.minY+a.bounds.maxY)/2},width:a.bounds.maxX-a.bounds.minX,height:a.bounds.maxY-a.bounds.minY,layer:`z${a.availableZ.join(",")}`,availableZ:[...a.availableZ],_adjacentNodeIds:void 0,_parent:void 0,_strawNode:void 0,_strawParentCapacityMeshNodeId:void 0}})}function uje(e,t,n){let o=Array.from(new Set(e.filter((r)=>r!==void 0)));if(o.length>1)throw Error(`TopologyMergingSolver: conflicting ${t} values for overlapping source nodes ${n.join(", ")}`);return o[0]}function KYt(e){let t=Array.from(new Set(e.filter((n)=>n!==void 0)));return t.length===1?t[0]:void 0}function Fbr({node:e,sourceKey:t,preparedNodeBySourceKey:n}){let o=n.get(t);if(!o)throw Error(`TopologyMergingSolver: missing source node for output "${e.capacityMeshNodeId}"`);let r=wV(e),i=r.minX>=o.bounds.minX-R$&&r.maxX<=o.bounds.maxX+R$&&r.minY>=o.bounds.minY-R$&&r.maxY<=o.bounds.maxY+R$,s=e.availableZ.every((a)=>o.node.availableZ.includes(a));if(!i||!s)throw Error(`TopologyMergingSolver: output node "${e.capacityMeshNodeId}" escapes its source geometry or layers`)}function zbr({groupIndexesA:e,groupIndexesB:t,sourceKeysA:n,sourceKeysB:o,sharedLayers:r,preparedNodeBySourceKey:i}){if(e.length!==1||t.length!==1||e[0]!==t[0]||n.length!==1||o.length!==1||n[0]===o[0])return!1;let s=i.get(n[0]),a=i.get(o[0]);if(!s||!a||r.length===0)return!1;return r.some((c)=>s.node.availableZ.includes(c)&&a.node.availableZ.includes(c))&&San(s.bounds,a.bounds)!==null}function $Yt(e){let t=[...e].sort((o,r)=>o-r),n=[];for(let o of t){let r=n[n.length-1];(r===void 0||Math.abs(o-r)>tx)&&n.push(o)}return n}function Obr(e,t){return t.x>=e.minX-tx&&t.x<=e.maxX+tx&&t.y>=e.minY-tx&&t.y<=e.maxY+tx}function Vbr({coveringNodes:e,nodeGroups:t,layerCount:n}){let o=new Map;for(let r=0;r<n;r++){let i=e.filter(({node:u})=>u.availableZ.includes(r)).sort((u,_)=>u.sourceKey.localeCompare(_.sourceKey));if(i.length===0)continue;let s=new Set(i.map(({groupIndex:u})=>u)),a=i.filter(({node:u})=>u._containsObstacle&&u._containsTarget),c=a.filter(({groupIndex:u})=>!t[u].isComponent),l=new Set(a.map(({groupIndex:u})=>u)),h=a.length>0?c.length>0||l.size===1?"target-passthrough":"target-merged":s.size===1?"passthrough":"merged",d=Ubr({topologyMode:h,nodesOnLayer:i,targetObstacleNodes:a,globalTargetObstacleNodes:c});for(let u of d){let _=JSON.stringify({mode:h,sourceKeys:u}),p=o.get(_);p?p.availableZ.push(r):o.set(_,{availableZ:[r],sourceKeys:u,topologyMode:h,topologySignature:_})}}return[...o.values()]}function Pan(e){return JSON.stringify({availableZ:e.availableZ,topologySignature:e.topologySignature})}function Ybr(e){return JSON.stringify({mergeKey:Pan(e),minY:e.bounds.minY.toPrecision(15),maxY:e.bounds.maxY.toPrecision(15)})}function Gbr(e){return JSON.stringify({mergeKey:Pan(e),minX:e.bounds.minX.toPrecision(15),maxX:e.bounds.maxX.toPrecision(15)})}function qYt(e,t){let n=new Map;for(let o of e){let r=t==="horizontal"?Ybr(o):Gbr(o),i=n.get(r)??[];i.push(o),n.set(r,i)}return[...n.values()].flatMap((o)=>function(r,i){let s=[...r].sort((c,l)=>i==="horizontal"?c.bounds.minX-l.bounds.minX:c.bounds.minY-l.bounds.minY),a=[];for(let c of s){let l=a[a.length-1],h=l!==void 0&&(i==="horizontal"?Math.abs(l.bounds.maxX-c.bounds.minX)<=tx:Math.abs(l.bounds.maxY-c.bounds.minY)<=tx);l&&h?i==="horizontal"?l.bounds.maxX=c.bounds.maxX:l.bounds.maxY=c.bounds.maxY:a.push({...c,bounds:{...c.bounds},availableZ:[...c.availableZ],sourceKeys:[...c.sourceKeys]})}return a}(o,t))}function Ubr({topologyMode:e,nodesOnLayer:t,targetObstacleNodes:n,globalTargetObstacleNodes:o}){if(e==="target-passthrough")return(o.length>0?o:n).map(({sourceKey:r})=>[r]);return e==="target-merged"?[n.map(({sourceKey:r})=>r).sort()]:e==="passthrough"?t.map(({sourceKey:r})=>[r]):[t.map(({sourceKey:r})=>r).sort()]}var Ean=class extends Da{constructor(e){super(),this.inputProblem=e,this.MAX_ITERATIONS=1e5;let{preparedNodes:t,preparedNodeBySourceKey:n}=Lbr(e);this.preparedNodes=t,this.preparedNodeBySourceKey=n,this.xCoordinates=$Yt(this.preparedNodes.flatMap(({bounds:o})=>[o.minX,o.maxX])),this.stats={inputNodeCount:this.preparedNodes.length,xSlabCount:Math.max(0,this.xCoordinates.length-1),processedXSlabCount:0,atomicRegionCount:0,outputNodeCount:0}}inputProblem;preparedNodes;preparedNodeBySourceKey;outputProvenance={groupIndexesByNodeId:new Map,sourceKeysByNodeId:new Map};xCoordinates;atomicRegions=[];outputNodes=[];currentXIndex=0;getConstructorParams(){return[this.inputProblem]}_step(){if(this.inputProblem.nodeGroups.length===1)return void this.completePassthroughTopology();if(this.currentXIndex<this.xCoordinates.length-1)return this.processCurrentXSlab(),this.currentXIndex+=1,this.stats.processedXSlabCount=this.currentXIndex,void(this.stats.atomicRegionCount=this.atomicRegions.length);let e=function(t){let n=t;for(;;){let o=qYt(n,"horizontal"),r=qYt(o,"vertical");if(r.length===n.length)return r;n=r}}(function({regions:t,preparedNodeBySourceKey:n}){let o=new Map;for(let i of t)for(let s of i.sourceKeys){let a=o.get(s)??new Set;a.add(i.topologyMode),o.set(s,a)}let r=new Set([...o.entries()].filter(([,i])=>i.size===1&&i.has("target-passthrough")).map(([i])=>i));return r.size===0?t:[...t.filter((i)=>i.topologyMode!=="target-passthrough"||!r.has(i.sourceKeys[0])),...[...r].map((i)=>{let s=n.get(i);if(!s)throw Error(`TopologyMergingSolver: missing authoritative target source "${i}"`);return{bounds:{...s.bounds},availableZ:[...s.node.availableZ],sourceKeys:[i],topologyMode:"target-passthrough",topologySignature:JSON.stringify({mode:"target-passthrough",sourceKeys:[i]})}})]}({regions:this.atomicRegions,preparedNodeBySourceKey:this.preparedNodeBySourceKey}));this.outputNodes=jYt({regions:e,preparedNodeBySourceKey:this.preparedNodeBySourceKey,nodeGroups:this.inputProblem.nodeGroups,provenance:this.outputProvenance}),function({nodes:t,preparedNodeBySourceKey:n,provenance:o}){let r=new Set;for(let i of t){if(r.has(i.capacityMeshNodeId))throw Error(`TopologyMergingSolver: duplicate output node id "${i.capacityMeshNodeId}"`);if(r.add(i.capacityMeshNodeId),!qZe(wV(i)))throw Error(`TopologyMergingSolver: output node "${i.capacityMeshNodeId}" has invalid bounds`);if(i.availableZ.length===0)throw Error(`TopologyMergingSolver: output node "${i.capacityMeshNodeId}" has no available layers`);let s=o.sourceKeysByNodeId.get(i.capacityMeshNodeId);if(!s)throw Error(`TopologyMergingSolver: missing output provenance for node "${i.capacityMeshNodeId}"`);s.length===1&&Fbr({node:i,sourceKey:s[0],preparedNodeBySourceKey:n})}for(let i=0;i<t.length;i++){let s=t[i],a=wV(s);for(let c=i+1;c<t.length;c++){let l=t[c];if(l.center.x-l.width/2>a.maxX||l.center.x+l.width/2<a.minX||l.center.y-l.height/2>a.maxY||l.center.y+l.height/2<a.minY)continue;let h=s.availableZ.filter((f)=>l.availableZ.includes(f));if(h.length===0)continue;let d=San(a,wV(l));if(!d)continue;let u=d.maxX-d.minX,_=d.maxY-d.minY;if(u<=R$||_<=R$)continue;let p=o.groupIndexesByNodeId.get(s.capacityMeshNodeId),m=o.groupIndexesByNodeId.get(l.capacityMeshNodeId);if(!p||!m)throw Error(`TopologyMergingSolver: missing output provenance for overlapping nodes "${s.capacityMeshNodeId}" and "${l.capacityMeshNodeId}"`);let A=o.sourceKeysByNodeId.get(s.capacityMeshNodeId),g=o.sourceKeysByNodeId.get(l.capacityMeshNodeId);if(!A||!g)throw Error(`TopologyMergingSolver: missing source provenance for overlapping nodes "${s.capacityMeshNodeId}" and "${l.capacityMeshNodeId}"`);if(!zbr({groupIndexesA:p,groupIndexesB:m,sourceKeysA:A,sourceKeysB:g,sharedLayers:h,preparedNodeBySourceKey:n}))throw Error(`TopologyMergingSolver: output nodes "${s.capacityMeshNodeId}" and "${l.capacityMeshNodeId}" have an unresolved inter-group overlap on a shared layer`)}}}({nodes:this.outputNodes,preparedNodeBySourceKey:this.preparedNodeBySourceKey,provenance:this.outputProvenance}),this.stats.outputNodeCount=this.outputNodes.length,this.stats.compactedRegionCount=e.length,this.solved=!0}getOutput(){if(!this.solved)throw Error("TopologyMergingSolver: getOutput() called before the solver completed");return this.outputNodes}computeProgress(){let e=Math.max(1,this.xCoordinates.length-1);return this.solved?1:Math.min(0.99,this.currentXIndex/e)}visualize(){let e=this.solved?this.outputNodes:jYt({regions:this.atomicRegions,preparedNodeBySourceKey:this.preparedNodeBySourceKey,nodeGroups:this.inputProblem.nodeGroups,provenance:this.outputProvenance,preserveSourceIds:!1});return{title:`Topology Merging: ${e.length} refined regions`,coordinateSystem:"cartesian",rects:e.map((t)=>({...qA(t,{rectMargin:0.01,zOffset:0.02}),label:`${t.capacityMeshNodeId}
availableZ: ${t.availableZ.join(",")}
component: ${t._isComponentTopologyNode?"yes":"no"}`})),lines:[],points:[],circles:[],texts:[]}}completePassthroughTopology(){let e=this.inputProblem.nodeGroups[0];this.outputNodes=e.nodes;for(let t of this.outputNodes)this.outputProvenance.groupIndexesByNodeId.set(t.capacityMeshNodeId,[0]),this.outputProvenance.sourceKeysByNodeId.set(t.capacityMeshNodeId,[`${e.groupId}:${t.capacityMeshNodeId}`]);this.stats.processedXSlabCount=this.stats.xSlabCount,this.stats.atomicRegionCount=0,this.stats.compactedRegionCount=0,this.stats.outputNodeCount=this.outputNodes.length,this.stats.passthroughNodeCount=this.outputNodes.length,this.solved=!0}processCurrentXSlab(){let e=this.xCoordinates[this.currentXIndex],t=this.xCoordinates[this.currentXIndex+1];if(t-e<=tx)return;let n=(e+t)/2,o=this.preparedNodes.filter(({bounds:i})=>n>=i.minX-tx&&n<=i.maxX+tx),r=$Yt(o.flatMap(({bounds:i})=>[i.minY,i.maxY]));for(let i=0;i<r.length-1;i++){let s=r[i],a=r[i+1];if(a-s<=tx)continue;let c={x:n,y:(s+a)/2},l=o.filter(({bounds:d})=>Obr(d,c));if(l.length===0)continue;let h=Vbr({coveringNodes:l,nodeGroups:this.inputProblem.nodeGroups,layerCount:this.inputProblem.layerCount});for(let d of h)this.atomicRegions.push({bounds:{minX:e,maxX:t,minY:s,maxY:a},availableZ:d.availableZ,sourceKeys:d.sourceKeys,topologyMode:d.topologyMode,topologySignature:d.topologySignature})}}};function Wbr({meshNodes:e,components:t}){return t.length===0?e:e.map((n)=>t.some((r)=>function({node:i,component:s}){let{replacementObstacle:a}=s,c=Math.abs(i.center.x-a.center.x)<=ES&&Math.abs(i.center.y-a.center.y)<=ES&&Math.abs(i.width-a.width)<=ES&&Math.abs(i.height-a.height)<=ES;if(s.componentKind!=="qfp"&&s.componentKind!=="qfp_thermalpad"&&s.componentKind!=="soic")return c;let l=a.center.x-a.width/2,h=a.center.x+a.width/2,d=a.center.y-a.height/2,u=a.center.y+a.height/2,_=i.center.x>=l-ES&&i.center.x<=h+ES&&i.center.y>=d-ES&&i.center.y<=u+ES,p=i.width*i.height,m=a.width*a.height,A=_&&p>=0.2*m;return c||A}({node:n,component:r}))?{...n,_containsObstacle:void 0,_completelyInsideObstacle:void 0,_containsTarget:void 0,_targetConnectionName:void 0,_connectedTo:void 0}:n)}var Man=class extends rP{globalTopologySolver;componentTopologyBatchSolver;normalizedInput;pipelineDef=[Z0("globalTopologySolver",Qq,(e)=>[e.getGlobalTopologySolverInput()]),Z0("componentTopologyBatchSolver",Mbr,(e)=>[{componentSrjs:e.getComponentNoConnectionSrjs(),componentIds:e.normalizedInput.components.map((t)=>t.componentId),componentKinds:e.normalizedInput.components.map((t)=>t.componentKind),viaDiameter:e.inputProblem.viaDiameter,obstacleMargin:e.inputProblem.obstacleMargin}])];constructor(e){super(e),this.normalizedInput=Pbr(e)}getConstructorParams(){return[this.inputProblem]}getOutput(){let e=Wbr({meshNodes:this.getStageOutput("globalTopologySolver")?.meshNodes??[],components:this.normalizedInput.components}),t=this.getStageOutput("componentTopologyBatchSolver")?.componentMeshNodes??[],n=this.getComponentNoConnectionSrjs();return{globalNoConnectionSrj:this.normalizedInput.globalNoConnectionSrj,componentNoConnectionSrjs:n,globalMeshNodes:e,componentMeshNodes:t}}finalVisualize(){let e=this.getOutput();return{title:"Topology Planning: generated topology groups",rects:[...e.componentNoConnectionSrjs.flatMap((t,n)=>{let o=this.normalizedInput.components[n]??null;return t.obstacles.map((r)=>({center:r.center,width:r.width,height:r.height,fill:"rgba(120, 120, 120, 0.06)",stroke:"rgba(120, 120, 120, 0.35)",label:r.obstacleId??o?.componentId??"component-pad",layer:r.layers.join(",")}))}),...[...e.globalMeshNodes,...e.componentMeshNodes.flat()].map((t)=>{let n=this.normalizedInput.components.find((o)=>t.capacityMeshNodeId.includes(o.componentId));return{...qA(t,{rectMargin:0.01}),fill:t._containsObstacle?zi("red",0.82):"rgba(0, 120, 255, 0.12)",stroke:t._containsObstacle?zi("red",0.3):"rgba(0, 120, 255, 0.55)",label:n?`${n.componentKind.toUpperCase()} ${t.capacityMeshNodeId}`:t.capacityMeshNodeId}})],lines:[],points:[],circles:[],texts:[]}}visualize(){return this.filterGlobalRectDiffNodesFromVisualization({visualization:super.visualize()})}preview(){return this.filterGlobalRectDiffNodesFromVisualization({visualization:super.preview()})}getComponentNoConnectionSrjs(){return this.normalizedInput.components.map((e)=>function({inputSrj:t,component:n}){let o=s6e(n.memberObstacles),r=Math.max(t.minViaPadDiameter??t.min_via_pad_diameter??t.minViaDiameter??0.3,t.defaultObstacleMargin??0.15,2*t.minTraceWidth),i=new Set(n.memberObstacles.flatMap((c)=>c.connectedTo)),s=t.connections.flatMap((c)=>c.pointsToConnect.filter((l)=>{let h=[l.pointId,l.pcb_port_id].filter((u)=>typeof u=="string").some((u)=>i.has(u)),d=l.x>=o.minX-r&&l.x<=o.maxX+r&&l.y>=o.minY-r&&l.y<=o.maxY+r;return h&&d})).reduce((c,l)=>({minX:Math.min(c.minX,l.x),maxX:Math.max(c.maxX,l.x),minY:Math.min(c.minY,l.y),maxY:Math.max(c.maxY,l.y)}),o),a=t.obstacles.filter((c)=>mB(Bi(c),s)).map((c)=>({...c}));return{...structuredClone(t),bounds:s,obstacles:a}}({inputSrj:this.inputProblem.inputSrj,component:e}))}getGlobalTopologySolverInput(){return{simpleRouteJson:this.normalizedInput.globalNoConnectionSrj,maxGapFillPasses:4}}filterGlobalRectDiffNodesFromVisualization({visualization:e}){return{...e,rects:Ebr({rects:e.rects,components:this.normalizedInput.components})}}},pje=(e,t)=>{if(e)return Object.entries(t).sort(([n],[o])=>o.length-n.length).find(([n])=>e.includes(n))?.[1]},tbe=(e,t)=>({...e,points:e.points?.map((n)=>({...n,color:pje(n.label,t)??n.color})),lines:e.lines?.map((n)=>({...n,strokeColor:pje(n.label,t)??n.strokeColor})),circles:e.circles?.map((n)=>{let o=pje(n.label,t);return o?{...n,fill:o,stroke:o}:n})}),wan=class extends ei{constructor(e){super(),this.topologyPlanningSolver=e,this.solved=e.solved,this.failed=e.failed,this.error=e.error,this.stats=e.stats}topologyPlanningSolver;getOutput(){return this.topologyPlanningSolver.getOutput().componentMeshNodes.flat()}visualize(){return this.topologyPlanningSolver.finalVisualize()??this.topologyPlanningSolver.visualize()}preview(){return this.visualize()}},_Y=class{MAX_ITERATIONS=1e5;solved=!1;failed=!1;iterations=0;progress=0;error=null;activeSubSolver;failedSubSolvers;timeToSolve;stats={};_setupDone=!1;getSolverName(){return this.constructor.name}setup(){this._setupDone||(this._setup(),this._setupDone=!0)}_setup(){}step(){if(this._setupDone||this.setup(),!this.solved&&!this.failed){this.iterations++;try{this._step()}catch(e){throw this.error=`${this.getSolverName()} error: ${e}`,this.failed=!0,e}!this.solved&&this.iterations>=this.MAX_ITERATIONS&&this.tryFinalAcceptance(),!this.solved&&this.iterations>=this.MAX_ITERATIONS&&(this.error=`${this.getSolverName()} ran out of iterations`,this.failed=!0),"computeProgress"in this&&(this.progress=this.computeProgress())}}_step(){}getConstructorParams(){throw Error("getConstructorParams not implemented")}getOutput(){return null}solve(){let e=Date.now();for(;!this.solved&&!this.failed;)this.step();let t=Date.now();this.timeToSolve=t-e}visualize(){return{lines:[],points:[],rects:[],circles:[]}}tryFinalAcceptance(){}preview(){return{lines:[],points:[],rects:[],circles:[]}}},mje=(e)=>e.filter((t)=>Boolean(t)),JYt=(e,t,n)=>{let o=`${Math.round(100*e.x)},${Math.round(100*e.y)}`,r=t.map((i)=>((s,a)=>s==="top"?0:s==="bottom"?a-1:Number.parseInt(s.slice(5),10))(i,n)).sort().join("-");return`${o}:${r}`},xB=class{parent=new Map;cachedObstacles;canonicalSetsByAliases=new Map;constructor(e,t=e.traces??[],n={}){for(let o of e.connections)this.unionAll(mje([o.name,o.source_trace_id,o.rootConnectionName,o.netConnectionName,...o.mergedConnectionNames??[],...o.pointsToConnect.flatMap((r)=>[r.pointId,r.pcb_port_id,...n.includePhysicalPositionAliases?[JYt(r,r.layers??[r.layer],e.layerCount)]:[]])]));for(let o of[...t,...e.fixedTraces??[]])this.unionAll(mje([o.pcb_trace_id,o.connection_name,o.source_trace_id,o.rootConnectionName,...o.mergedConnectionNames??[],...o.connectsTo??[]]));for(let o of e.obstacles)this.unionAll(n.includePhysicalPositionAliases?mje([o.obstacleId,...o.connectedTo,...o.offBoardConnectsTo??[],JYt(o.center,o.layers,e.layerCount)]):o.connectedTo);this.setCacheableObstacles(e.obstacles)}setCacheableObstacles(e){if(this.cachedObstacles!==e){this.cachedObstacles=e,this.canonicalSetsByAliases.clear();for(let t of e)this.canonicalSetsByAliases.set(t.connectedTo,null)}}canonicalize(e){return[...new Set(e.map((t)=>this.find(t)))]}canonicalizeToSet(e){let t=this.canonicalSetsByAliases.get(e);if(t&&e.length===t.aliases.length&&e.every((o,r)=>o===t.aliases[r]))return t.canonicalNames;let n=new Set(this.canonicalize(e));return this.canonicalSetsByAliases.has(e)&&this.canonicalSetsByAliases.set(e,{aliases:[...e],canonicalNames:n}),n}unionAll(e){let t=e[0];if(t){this.add(t);for(let n=1;n<e.length;n++)this.union(t,e[n])}}add(e){this.parent.has(e)||this.parent.set(e,e)}find(e){this.add(e);let t=this.parent.get(e);if(t===e)return e;let n=this.find(t);return this.parent.set(e,n),n}union(e,t){let n=this.find(e),o=this.find(t);n!==o&&this.parent.set(o,n)}},_r=0.000001,Ms=(e,t)=>Math.hypot(t.x-e.x,t.y-e.y),IV=(e,t,n)=>{let o=n.x-t.x,r=n.y-t.y,i=o*o+r*r;if(i<=0.000000000001)return Ms(e,t);let s=J0(((e.x-t.x)*o+(e.y-t.y)*r)/i,0,1);return Math.hypot(e.x-(t.x+o*s),e.y-(t.y+r*s))},BV=(e,t,n=0.000001)=>Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n,J0=(e,t,n)=>Math.max(t,Math.min(n,e)),_ce=(e,t,n)=>(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x),gce=(e,t,n)=>Math.abs(_ce(t,n,e))<=0.000000001&&e.x>=Math.min(t.x,n.x)-0.000000001&&e.x<=Math.max(t.x,n.x)+0.000000001&&e.y>=Math.min(t.y,n.y)-0.000000001&&e.y<=Math.max(t.y,n.y)+0.000000001,k$e=(e,t,n,o)=>((r,i,s,a)=>{let c=_ce(r,i,s),l=_ce(r,i,a),h=_ce(s,a,r),d=_ce(s,a,i);return c*l<0&&h*d<0||Math.abs(c)<=0.000000001&&gce(s,r,i)||Math.abs(l)<=0.000000001&&gce(a,r,i)||Math.abs(h)<=0.000000001&&gce(r,s,a)||Math.abs(d)<=0.000000001&&gce(i,s,a)})(e,t,n,o)?0:Math.min(IV(e,n,o),IV(t,n,o),IV(n,e,t),IV(o,e,t)),ZYt=(e,t)=>{let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o],s=t[r];if(gce(e,s,i))return!0;i.y>e.y!=s.y>e.y&&e.x<(s.x-i.x)*(e.y-i.y)/(s.y-i.y)+i.x&&(n=!n)}return n},_je=(e,t,n)=>{if(ZYt(e,n)||ZYt(t,n))return 0;let o=Number.POSITIVE_INFINITY;for(let r=0;r<n.length;r++){let i=n[r],s=n[(r+1)%n.length];o=Math.min(o,k$e(e,t,i,s))}return o};function eGt(e,t,n){let o=0,r=1,i=t.x-e.x,s=t.y-e.y,a=[[-i,e.x-n.minX],[i,n.maxX-e.x],[-s,e.y-n.minY],[s,n.maxY-e.y]];for(let[c,l]of a){if(Math.abs(c)<0.000000000001){if(l<0)return!1;continue}let h=l/c;if(c<0?o=Math.max(o,h):r=Math.min(r,h),o>r)return!1}return!0}function Ban({start:e,end:t,width:n,base:o}){let r=Ms(e,t),i=((l)=>J0(1.25*l,0.25,0.75))(n),s=Math.max(1,Math.ceil(r/i)),a=n/2,c=[];for(let l=0;l<s;l++){let h=l/s,d=(l+1)/s,u=e.x+(t.x-e.x)*h,_=e.y+(t.y-e.y)*h,p=e.x+(t.x-e.x)*d,m=e.y+(t.y-e.y)*d;c.push({...o,minX:Math.min(u,p)-a,minY:Math.min(_,m)-a,maxX:Math.max(u,p)+a,maxY:Math.max(_,m)+a,exactShape:{type:"segment",start:{x:u,y:_},end:{x:p,y:m},width:n}})}return c}var Xbr=(e,t,n)=>{let o=Math.cos(n),r=Math.sin(n),i=e.x-t.x,s=e.y-t.y;return{x:t.x+i*o-s*r,y:t.y+i*r+s*o}},jbr=class{nodeIndices=[];priorities=[];get size(){return this.nodeIndices.length}push(e,t){let n=this.nodeIndices.length;for(this.nodeIndices.push(e),this.priorities.push(t);n>0;){let o=n-1>>1;if(this.priorities[o]<=t)break;this.swap(n,o),n=o}}pop(){let e=this.nodeIndices[0],t=this.nodeIndices.pop(),n=this.priorities.pop();if(this.nodeIndices.length===0)return e;this.nodeIndices[0]=t,this.priorities[0]=n;let o=0;for(;;){let r=2*o+1,i=r+1;if(r>=this.nodeIndices.length)break;let s=r;if(i<this.nodeIndices.length&&this.priorities[i]<this.priorities[r]&&(s=i),this.priorities[o]<=this.priorities[s])break;this.swap(o,s),o=s}return e}swap(e,t){[this.nodeIndices[e],this.nodeIndices[t]]=[this.nodeIndices[t],this.nodeIndices[e]],[this.priorities[e],this.priorities[t]]=[this.priorities[t],this.priorities[e]]}},Kbr=[[-1,-1],[-1,0],[-1,1],[0,-1],[0,1],[1,-1],[1,0],[1,1]],R3e=["#d53535","#3478c8","#8e44ad","#15956f"],tGt=class extends _Y{problem;searchBounds;rows;columns;origin;nodes=[];open=new jbr;bestCost=new Map;closed=new Set;baseStateCount;stateSpaceUpperBound;endLayerIndices;targetCell;segmentWidthCache=new Map;closedStateCount=0;output=null;constructor(e){super(),this.problem=e;let t=Math.max(e.traceWidth,e.viaDiameter)/2+e.obstacleIndex.clearance,n=J0(Math.min(e.start.x,e.end.x)-e.searchPadding,e.bounds.minX+t,e.bounds.maxX-t),o=J0(Math.max(e.start.x,e.end.x)+e.searchPadding,e.bounds.minX+t,e.bounds.maxX-t),r=J0(Math.min(e.start.y,e.end.y)-e.searchPadding,e.bounds.minY+t,e.bounds.maxY-t),i=J0(Math.max(e.start.y,e.end.y)+e.searchPadding,e.bounds.minY+t,e.bounds.maxY-t),s=Math.floor((n-e.gridOffset.x)/e.gridSize)*e.gridSize+e.gridOffset.x,a=Math.floor((r-e.gridOffset.y)/e.gridSize)*e.gridSize+e.gridOffset.y;this.origin={x:s,y:a},this.columns=Math.max(2,Math.floor((o-s)/e.gridSize)+1),this.rows=Math.max(2,Math.floor((i-a)/e.gridSize)+1),this.searchBounds={minX:s,minY:a,maxX:s+(this.columns-1)*e.gridSize,maxY:a+(this.rows-1)*e.gridSize};let c=this.rows*this.columns*e.layers.length*(e.maxViaCount+1);this.baseStateCount=c,this.stateSpaceUpperBound=c*(this.rows*this.columns+1),this.targetCell=this.pointToCell(e.end),this.endLayerIndices=new Set(e.endLayers.map((h)=>e.layers.indexOf(h)).filter((h)=>h>=0));let l=this.pointToCell(e.start);for(let h of e.startLayers){let d=e.layers.indexOf(h);if(d<0||this.endpointCollides(e.start,d))continue;let u={...l,...e.start,layerIndex:d,viaCount:0,viaPoints:[],g:0,f:this.heuristic(e.start),parentIndex:-1},_=this.nodes.length;this.nodes.push(u),this.open.push(_,u.f),this.bestCost.set(this.toStateIndex(u),0)}this.open.size!==0&&this.endLayerIndices.size!==0||(this.failed=!0,this.error="No collision-free multilayer route endpoint"),this.MAX_ITERATIONS=Math.min(15000,Math.max(2000,2*c)),this.stats=this.createStats()}getSolverName(){return`LayerAwareGridRouteSolver(${this.problem.gridSize.toFixed(3)}mm)`}_step(){if(this.open.size===0)return this.failed=!0,void(this.error="No collision-free multilayer grid route found");let e=this.open.pop(),t=this.nodes[e],n=this.toStateIndex(t);if(!this.closed.has(n)){if(this.closed.add(n),this.closedStateCount++,t.row===this.targetCell.row&&t.column===this.targetCell.column&&this.endLayerIndices.has(t.layerIndex)&&t.viaCount>=this.problem.minViaCount&&!this.segmentCollides(t,this.problem.end))return this.output=this.reconstructRoute(e),this.solved=!0,void(this.stats=this.createStats());this.expandPlanarMoves(e,t),this.expandViaMoves(e,t),this.stats=this.createStats()}}expandPlanarMoves(e,t){for(let[n,o]of Kbr){let r=t.row+n,i=t.column+o;if(r<0||r>=this.rows||i<0||i>=this.columns)continue;let s=this.cellToPoint(r,i),a=this.getSafeSegmentWidth(t,s);if(a<=0)continue;let c=this.problem.gridSize*(n!==0&&o!==0?Math.SQRT2:1)*Math.max(1,(this.problem.traceWidth/a)**this.problem.neckPenaltyExponent);this.enqueueNode({row:r,column:i,...s,layerIndex:t.layerIndex,viaCount:t.viaCount,viaPoints:t.viaPoints,g:t.g+c,parentIndex:e})}}expandViaMoves(e,t){if(t.viaCount>=this.problem.maxViaCount)return;let n=0.5*this.problem.gridSize;if(Ms(t,this.problem.start)<n-0.000000001||Ms(t,this.problem.end)<n-0.000000001)return;let o=t.parentIndex>=0?this.nodes[t.parentIndex]:void 0;if(!o||o.layerIndex===t.layerIndex||!BV(o,t))for(let r=0;r<this.problem.layers.length;r++)r!==t.layerIndex&&(this.problem.obstacleIndex.collidesVia({point:t,layers:this.problem.layers,padDiameter:this.problem.viaDiameter,holeDiameter:this.problem.viaHoleDiameter,connectionNames:this.problem.connectionNames,ignoreTraceIndex:this.problem.ignoreTraceIndex,ignoreTraceIndices:this.problem.softTraceIndices,ignoreRouteRange:this.problem.ignoreRouteRange,obstacleClearance:this.problem.obstacleClearance,blockSameNetObstacles:!0,sameNetObstacleClearance:0,otherNewViaPoints:t.viaPoints,fixedVias:this.problem.fixedVias})||this.enqueueNode({row:t.row,column:t.column,x:t.x,y:t.y,layerIndex:r,viaCount:t.viaCount+1,viaPoints:[...t.viaPoints,{x:t.x,y:t.y}],g:t.g+this.problem.viaCost,parentIndex:e}))}enqueueNode(e){let t=this.toStateIndex(e);if(this.closed.has(t)||e.g>=(this.bestCost.get(t)??Number.POSITIVE_INFINITY))return;this.bestCost.set(t,e.g);let n=e.g+this.heuristic(e),o=this.nodes.length;this.nodes.push({...e,f:n}),this.open.push(o,n)}endpointCollides(e,t){return this.getSafeSegmentWidth({...e,layerIndex:t,viaCount:0},e)<=0}segmentCollides(e,t){return this.getSafeSegmentWidth(e,t)<=0}getSafeSegmentWidth(e,t){let n=this.problem.layers[e.layerIndex],o=this.problem.startLayers.length===1&&e.viaCount===0&&n===this.problem.originalStartLayer&&Ms(this.problem.start,e)<=this.problem.maxStartNeckLength+0.000000001&&Ms(this.problem.start,t)<=this.problem.maxStartNeckLength+0.000000001,r=this.problem.endLayers.length===1&&n===this.problem.originalEndLayer&&Ms(this.problem.end,e)<=this.problem.maxEndNeckLength+0.000000001&&Ms(this.problem.end,t)<=this.problem.maxEndNeckLength+0.000000001,i=Math.max(o?this.problem.startNeckWidth:0,r?this.problem.endNeckWidth:0),s=[e.x,e.y,t.x,t.y,e.layerIndex,e.viaCount,i].join(":"),a=this.segmentWidthCache.get(s);if(a!==void 0)return a;let c=(h)=>!this.problem.obstacleIndex.collides({start:e,end:t,layer:n,width:h,connectionNames:this.problem.connectionNames,ignoreTraceIndex:this.problem.ignoreTraceIndex,ignoreTraceIndices:this.problem.softTraceIndices,ignoreRouteRange:this.problem.ignoreRouteRange,obstacleClearance:this.problem.obstacleClearance}),l=0;if(o||r){let d=Math.ceil((i-0.000000001)/0.025),u=Math.floor((this.problem.traceWidth+0.000000001)/0.025);for(;d<=u;){let _=Math.floor((d+u)/2),p=Number((_*0.025).toFixed(6));c(p)?(l=p,d=_+1):u=_-1}l<i-0.000000001&&c(i)&&(l=i)}else l=c(this.problem.traceWidth)?this.problem.traceWidth:0;return this.segmentWidthCache.set(s,l),l}reconstructRoute(e){let t=[],n=e;for(;n>=0;){let a=this.nodes[n];t.push(a),n=a.parentIndex}t.reverse();let o=t[t.length-1];BV(o,this.problem.end)||t.push({...o,...this.problem.end,row:this.targetCell.row,column:this.targetCell.column,parentIndex:-1});let r=[],i=[t[0]];for(let a=1;a<t.length;a++){let c=t[a-1],l=t[a];l.layerIndex!==c.layerIndex?(r.push(i),i=[l]):i.push(l)}r.push(i);let s=[];for(let a=0;a<r.length;a++){let c=this.simplifySection(r[a]),l=c.slice(0,-1).map((u,_)=>this.getSafeSegmentWidth(u,c[_+1])),h=c.map((u,_)=>({route_type:"wire",x:u.x,y:u.y,layer:this.problem.layers[u.layerIndex],width:l.length===0?Math.min(this.problem.startNeckWidth,this.problem.endNeckWidth):_===0?l[0]:_===c.length-1?l[l.length-1]:Math.min(l[_-1],l[_])}));s.push(...h);let d=r[a+1];if(d){let u=this.problem.layers[c.at(-1).layerIndex],_=this.problem.layers[d[0].layerIndex],p=c.at(-1);s.push({route_type:"via",x:p.x,y:p.y,from_layer:u,to_layer:_,via_diameter:this.problem.viaDiameter,via_hole_diameter:this.problem.viaHoleDiameter})}}return{route:s,traceWidth:this.problem.traceWidth,startNeckWidth:this.problem.startNeckWidth,endNeckWidth:this.problem.endNeckWidth,gridSize:this.problem.gridSize,gridOffset:this.problem.gridOffset,viaCount:r.length-1}}simplifySection(e){return e.length<=2?e:this.problem.neckPenaltyExponent>1?this.simplifyStrictSection(e):this.simplifyWidthPreservingSection(e)}simplifyStrictSection(e){let t=e.slice(0,-1).map((i,s)=>this.getSafeSegmentWidth(i,e[s+1])),n=[0];for(let i=0;i<t.length;i++)n.push(n[i]+this.getWidthPenalizedCost(e[i],e[i+1],t[i]));let o=[e[0]],r=0;for(;r<e.length-1;){let i=e.length-1;for(;i>r+1&&!this.shortcutPreservesRouteQuality(e,t,n,r,i);)i--;o.push(e[i]),r=i}return this.removeRedundantCollinearPoints(o)}shortcutPreservesRouteQuality(e,t,n,o,r){let i=this.getSafeSegmentWidth(e[o],e[r]);if(i<=0)return!1;let s=Number.POSITIVE_INFINITY;for(let c=o;c<r;c++)s=Math.min(s,t[c]);let a=n[r]-n[o];return i>=s-0.000000001&&this.getWidthPenalizedCost(e[o],e[r],i)<=a+0.000000001}getWidthPenalizedCost(e,t,n){return Ms(e,t)*Math.max(1,(this.problem.traceWidth/n)**this.problem.neckPenaltyExponent)}simplifyWidthPreservingSection(e){let t=e.slice(0,-1).map((c,l)=>this.getSafeSegmentWidth(c,e[l+1])),n=[0];for(let c=0;c<t.length;c++)n.push(n[c]+Ms(e[c],e[c+1])*Math.max(1,(this.problem.traceWidth/t[c])**this.problem.neckPenaltyExponent));let o=new Float64Array(e.length).fill(Number.POSITIVE_INFINITY),r=new Float64Array(e.length).fill(Number.POSITIVE_INFINITY),i=new Int32Array(e.length).fill(-1);o[0]=0,r[0]=0;for(let c=1;c<e.length;c++){let l=Number.POSITIVE_INFINITY;for(let h=c-1;h>=0;h--){if(l=Math.min(l,t[h]),!Number.isFinite(o[h]))continue;let d=this.getSafeSegmentWidth(e[h],e[c]);if(d<l-0.000000001)continue;let u=Ms(e[h],e[c]);if(u*Math.max(1,(this.problem.traceWidth/d)**this.problem.neckPenaltyExponent)>n[c]-n[h]+0.000000001)continue;let _=o[h]+u*Math.max(0,this.problem.traceWidth-d),p=r[h]+u;(_<o[c]-0.000000001||Math.abs(_-o[c])<=0.000000001&&p<r[c]-0.000000001)&&(o[c]=_,r[c]=p,i[c]=h)}}let s=[],a=e.length-1;for(;a>=0&&(s.push(e[a]),a!==0);)if(a=i[a],a<0)return e;return s.reverse(),this.removeRedundantCollinearPoints(s)}removeRedundantCollinearPoints(e){return e.filter((t,n,o)=>{if(n===0||n===o.length-1)return!0;let r=o[n-1],i=o[n+1],s=(t.x-r.x)*(i.y-t.y)-(t.y-r.y)*(i.x-t.x),a=Math.abs(this.getSafeSegmentWidth(r,t)-this.getSafeSegmentWidth(t,i))<0.000000001;return Math.abs(s)>0.00000001||!a})}pointToCell(e){return{column:J0(Math.round((e.x-this.origin.x)/this.problem.gridSize),0,this.columns-1),row:J0(Math.round((e.y-this.origin.y)/this.problem.gridSize),0,this.rows-1)}}cellToPoint(e,t){return{x:this.origin.x+t*this.problem.gridSize,y:this.origin.y+e*this.problem.gridSize}}toStateIndex(e){let t=((e.viaCount*this.problem.layers.length+e.layerIndex)*this.rows+e.row)*this.columns+e.column;if(e.viaCount!==1||e.viaPoints.length===0||Ms(e,e.viaPoints[0])>=this.problem.viaHoleDiameter+this.problem.obstacleIndex.minViaHoleEdgeToViaHoleEdgeClearance-0.000000001)return t;let n=this.pointToCell(e.viaPoints[0]);return t+(1+n.row*this.columns+n.column)*this.baseStateCount}heuristic(e){return Ms(e,this.problem.end)}createStats(){return{phase:"layer-aware-grid-search",gridSize:this.problem.gridSize,traceWidth:this.problem.traceWidth,startNeckWidth:this.problem.startNeckWidth,endNeckWidth:this.problem.endNeckWidth,maxViaCount:this.problem.maxViaCount,minViaCount:this.problem.minViaCount,openStates:this.open.size,closedStates:this.closedStateCount,trackedStates:this.bestCost.size,stateSpaceUpperBound:this.stateSpaceUpperBound}}computeProgress(){return Math.min(0.99,this.iterations/this.MAX_ITERATIONS)}getOutput(){return this.output}getConstructorParams(){let{obstacleIndex:e,...t}=this.problem;return[t]}visualize(){let e=this.nodes.filter((r)=>this.closed.has(this.toStateIndex(r))).slice(-2000).map((r)=>({x:r.x,y:r.y,color:`${R3e[r.layerIndex%R3e.length]}55`})),t=[],n=[],o=this.output?.route??[];for(let r=0;r<o.length-1;r++){let i=o[r],s=o[r+1];if(i?.route_type==="wire"&&s?.route_type==="wire"&&i.layer===s.layer){let a=this.problem.layers.indexOf(i.layer);t.push({points:[i,s],strokeColor:R3e[a%R3e.length]??"#333",strokeWidth:i.width})}i?.route_type==="via"&&n.push({center:i,radius:(i.via_diameter??this.problem.viaDiameter)/2,fill:"#d4a017"})}return{coordinateSystem:"cartesian",title:this.getSolverName(),rects:[{center:{x:(this.searchBounds.minX+this.searchBounds.maxX)/2,y:(this.searchBounds.minY+this.searchBounds.maxY)/2},width:this.searchBounds.maxX-this.searchBounds.minX,height:this.searchBounds.maxY-this.searchBounds.minY,stroke:"#777"}],points:[...e,{...this.problem.start,color:"green",label:"reroute start"},{...this.problem.end,color:"purple",label:"reroute target"}],lines:t,circles:n,texts:[]}}},Q3e=[{direction:1,strength:0.7},{direction:-1,strength:0.7},{direction:1,strength:1},{direction:-1,strength:1}],$br=(e,t,n)=>{let o=n.x-t.x,r=n.y-t.y,i=o*o+r*r;if(i<=0.000000000001)return{...t};let s=J0(((e.x-t.x)*o+(e.y-t.y)*r)/i,0,1);return{x:t.x+o*s,y:t.y+r*s}},gje=class extends _Y{problem;phase="prepare-candidate";variantCursor=0;relaxationIteration=0;candidatePoints=[];sampledPoints;output=null;constructor(e){super(),this.problem=e,this.sampledPoints=this.sampleRoute(),this.MAX_ITERATIONS=100,this.stats=this.createStats()}getSolverName(){return"ElasticTracePushSolver"}_step(){switch(this.phase){case"prepare-candidate":if(this.variantCursor>=Q3e.length)return this.failed=!0,void(this.error="No collision-free elastic displacement found");this.candidatePoints=this.sampledPoints.map((e)=>({...e})),this.relaxationIteration=0,this.phase="relax-candidate";break;case"relax-candidate":this.relaxCandidate(),this.relaxationIteration++,this.relaxationIteration>=10&&(this.phase="validate-candidate");break;case"validate-candidate":{let e=this.simplifyCandidate(this.candidatePoints);this.pathCollides(e)?(this.variantCursor++,this.phase="prepare-candidate"):(this.output={points:e,traceWidth:this.problem.traceWidth},this.phase="complete");break}case"complete":this.solved=!0}this.stats=this.createStats()}sampleRoute(){let e=[],t=J0(2*this.problem.traceWidth,0.2,0.45),n=this.problem.trace.route;for(let o=this.problem.range.startIndex;o<this.problem.range.endIndex;o++){let r=n[o],i=n[o+1];if(r?.route_type!=="wire"||i?.route_type!=="wire"||r.layer!==i.layer)continue;e.length===0&&e.push({x:r.x,y:r.y});let s=Ms(r,i),a=Math.max(1,Math.ceil(s/t));for(let c=1;c<=a;c++){let l=c/a;e.push({x:r.x+(i.x-r.x)*l,y:r.y+(i.y-r.y)*l})}}return e}relaxCandidate(){let e=Q3e[this.variantCursor],t=this.candidatePoints.map((o)=>({...o})),n=new Uint8Array(this.candidatePoints.length);for(let o=1;o<this.candidatePoints.length-1;o++){let r=this.candidatePoints[o],i=this.findNearestCorridorSegment(r);if(!i)continue;let s=Ms(i.segment.start,i.segment.end);if(s<=0.000000001)continue;let a=i.segment.width/2+this.problem.traceWidth/2+this.problem.obstacleIndex.clearance+0.025;if(i.distance>a+0.35)continue;let c={x:(i.segment.start.y-i.segment.end.y)/s*e.direction,y:(i.segment.end.x-i.segment.start.x)/s*e.direction},l=a-((r.x-i.closest.x)*c.x+(r.y-i.closest.y)*c.y);if(l<=0)continue;let h=Math.min(0.35,l*e.strength);t[o]={x:r.x+c.x*h,y:r.y+c.y*h},n[o]=1}for(let o=1;o<t.length-1;o++){if(!n[o])continue;let r=t[o-1],i=t[o],s=t[o+1];t[o]={x:0.85*i.x+(r.x+s.x)/2*0.15,y:0.85*i.y+(r.y+s.y)/2*0.15}}this.candidatePoints=t}findNearestCorridorSegment(e){let t;for(let n of this.problem.corridor){if(n.layer!==this.problem.layer)continue;let o=$br(e,n.start,n.end),r=Ms(e,o);(!t||r<t.distance)&&(t={segment:n,closest:o,distance:r})}return t}simplifyCandidate(e){if(e.length<=2)return e;let t=[e[0]],n=0;for(;n<e.length-1;){let o=e.length-1;for(;o>n+1&&this.segmentCollides(e[n],e[o]);)o--;t.push(e[o]),n=o}return t.filter((o,r,i)=>r===0||!BV(o,i[r-1]))}pathCollides(e){if(e.length<2)return!0;for(let t=0;t<e.length-1;t++)if(this.segmentCollides(e[t],e[t+1]))return!0;return!1}segmentCollides(e,t){return this.problem.obstacleIndex.collides({start:e,end:t,layer:this.problem.layer,width:this.problem.traceWidth,connectionNames:this.problem.connectionNames,ignoreTraceIndex:-1})}createStats(){let e=Q3e[this.variantCursor];return{phase:this.phase,direction:e?.direction,strength:e?.strength,variantCursor:this.variantCursor,relaxationIteration:this.relaxationIteration,sampledPointCount:this.sampledPoints.length}}computeProgress(){return Math.min(0.99,(this.variantCursor+this.relaxationIteration/12)/Q3e.length)}getOutput(){return this.output}getConstructorParams(){return[this.problem]}visualize(){return{coordinateSystem:"cartesian",title:`Elastic trace push: ${this.phase}`,lines:[...this.problem.corridor.map((e)=>({points:[e.start,e.end],strokeColor:"rgba(255, 128, 0, 0.6)",strokeWidth:e.width})),...this.candidatePoints.length>1?[{points:this.candidatePoints,strokeColor:"#1769d2",strokeWidth:this.problem.traceWidth}]:[]],points:[],rects:[],circles:[],texts:[]}}},nbe=(e,t)=>{let n=Math.abs(t.x-e.x),o=Math.abs(t.y-e.y);return n<=_r||o<=_r||Math.abs(n-o)<=_r},Aje=(e)=>{let t=0;for(let n=0;n<e.length-1;n++)nbe(e[n],e[n+1])||t++;return t},Ile=(e)=>{let t=0;for(let n=0;n<e.length-1;n++)t+=Ms(e[n],e[n+1]);return t},qbr=(e)=>e.filter((t,n)=>n===0||!BV(t,e[n-1])),Tan=(e,t)=>{let n=t.x-e.x,o=t.y-e.y,r=Math.abs(n),i=Math.abs(o),s=Math.sign(n),a=Math.sign(o),c=[];nbe(e,t)&&c.push([e,t]),c.push([e,{x:t.x,y:e.y},t],[e,{x:e.x,y:t.y},t]),r>=i?c.push([e,{x:t.x-s*i,y:e.y},t],[e,{x:e.x+s*i,y:t.y},t]):c.push([e,{x:e.x,y:t.y-a*r},t],[e,{x:t.x,y:e.y+a*r},t]);let l=new Map;for(let h of c){let d=qbr(h);if(d.length<2||d.some((_,p)=>p<d.length-1&&!nbe(_,d[p+1])))continue;let u=d.map((_)=>`${_.x.toFixed(6)},${_.y.toFixed(6)}`).join(";");l.set(u,d)}return[...l.values()].sort((h,d)=>Ile(h)-Ile(d)||h.length-d.length)},Jbr=class{nodeIndices=[];priorities=[];get size(){return this.nodeIndices.length}push(e,t){let n=this.nodeIndices.length;for(this.nodeIndices.push(e),this.priorities.push(t);n>0;){let o=n-1>>1;if(this.priorities[o]<=t)break;this.swap(n,o),n=o}}pop(){let e=this.nodeIndices[0],t=this.nodeIndices.pop(),n=this.priorities.pop();if(this.nodeIndices.length===0)return e;this.nodeIndices[0]=t,this.priorities[0]=n;let o=0;for(;;){let r=2*o+1,i=r+1;if(r>=this.nodeIndices.length)break;let s=r;if(i<this.nodeIndices.length&&this.priorities[i]<this.priorities[r]&&(s=i),this.priorities[o]<=this.priorities[s])break;this.swap(o,s),o=s}return e}swap(e,t){[this.nodeIndices[e],this.nodeIndices[t]]=[this.nodeIndices[t],this.nodeIndices[e]],[this.priorities[e],this.priorities[t]]=[this.priorities[t],this.priorities[e]]}},Zbr=[[-1,-1],[-1,0],[-1,1],[0,-1],[0,1],[1,-1],[1,0],[1,1]],obe=class extends _Y{problem;searchBounds;rows;columns;origin;nodes=[];open=new Jbr;bestCost;closed;closedCellCount=0;targetCell;output=null;constructor(e){super(),this.problem=e;let t=e.traceWidth/2+e.obstacleIndex.clearance,n=J0(Math.min(e.start.x,e.end.x)-e.searchPadding,e.bounds.minX+t,e.bounds.maxX-t),o=J0(Math.max(e.start.x,e.end.x)+e.searchPadding,e.bounds.minX+t,e.bounds.maxX-t),r=J0(Math.min(e.start.y,e.end.y)-e.searchPadding,e.bounds.minY+t,e.bounds.maxY-t),i=J0(Math.max(e.start.y,e.end.y)+e.searchPadding,e.bounds.minY+t,e.bounds.maxY-t),s=Math.floor((n-e.gridOffset.x)/e.gridSize)*e.gridSize+e.gridOffset.x,a=Math.floor((r-e.gridOffset.y)/e.gridSize)*e.gridSize+e.gridOffset.y;if(this.origin={x:s,y:a},this.columns=Math.max(2,Math.floor((o-s)/e.gridSize)+1),this.rows=Math.max(2,Math.floor((i-a)/e.gridSize)+1),this.searchBounds={minX:s,minY:a,maxX:s+(this.columns-1)*e.gridSize,maxY:a+(this.rows-1)*e.gridSize},this.bestCost=new Float64Array(this.rows*this.columns).fill(Number.POSITIVE_INFINITY),this.closed=new Uint8Array(this.rows*this.columns),this.endpointCollides(e.start)||this.endpointCollides(e.end))return this.failed=!0,this.error="Grid-route endpoint violates obstacle clearance",this.targetCell={row:0,column:0},this.MAX_ITERATIONS=1,void(this.stats=this.createStats());let c=this.pointToCell(e.start);this.targetCell=this.pointToCell(e.end);let l={...c,x:e.start.x,y:e.start.y,g:0,f:this.heuristic(e.start),parentIndex:-1};this.nodes.push(l),this.open.push(0,l.f),this.bestCost[this.toFlatIndex(c.row,c.column)]=0,this.MAX_ITERATIONS=Math.min(5000,Math.max(1000,this.rows*this.columns*2)),this.stats=this.createStats()}endpointCollides(e){return this.problem.obstacleIndex.collides({start:e,end:e,layer:this.problem.layer,width:this.problem.traceWidth,connectionNames:this.problem.connectionNames,ignoreTraceIndex:this.problem.ignoreTraceIndex,ignoreRouteRange:this.problem.ignoreRouteRange,obstacleClearance:this.problem.obstacleClearance})}getSolverName(){return`ObstacleAwareGridRouteSolver(${this.problem.gridSize.toFixed(3)}mm)`}_step(){if(this.open.size===0)return this.failed=!0,void(this.error="No collision-free grid route found");let e=this.open.pop(),t=this.nodes[e],n=this.toFlatIndex(t.row,t.column);if(!this.closed[n]){if(this.closed[n]=1,this.closedCellCount++,t.row===this.targetCell.row&&t.column===this.targetCell.column&&this.getAllowedConnector(t,this.problem.end)!==null)return this.output={points:this.reconstructPath(e),traceWidth:this.problem.traceWidth,gridSize:this.problem.gridSize,gridOffset:this.problem.gridOffset},this.solved=!0,void(this.stats=this.createStats());for(let[o,r]of Zbr){let i=t.row+o,s=t.column+r;if(i<0||i>=this.rows||s<0||s>=this.columns)continue;let a=this.toFlatIndex(i,s);if(this.closed[a])continue;let c=t.parentIndex===-1&&this.problem.requireOctilinear,l=this.problem.gridSize*(o!==0&&r!==0?Math.SQRT2:1);if(!c&&t.g+l>=this.bestCost[a])continue;let h=this.cellToPoint(i,s),d=this.getAllowedConnector(t,h);if(d===null)continue;c&&(l=Ile(d));let u=t.g+l;if(u>=this.bestCost[a])continue;this.bestCost[a]=u;let _=u+this.heuristic(h),p=this.nodes.length;this.nodes.push({row:i,column:s,...h,g:u,f:_,parentIndex:e}),this.open.push(p,_)}this.stats=this.createStats()}}segmentCollides(e,t){return this.problem.obstacleIndex.collides({start:e,end:t,layer:this.problem.layer,width:this.problem.traceWidth,connectionNames:this.problem.connectionNames,ignoreTraceIndex:this.problem.ignoreTraceIndex,ignoreRouteRange:this.problem.ignoreRouteRange,obstacleClearance:this.problem.obstacleClearance})}getAllowedConnector(e,t){return this.problem.requireOctilinear&&(("parentIndex"in e)&&e.parentIndex===-1||BV(t,this.problem.end))?Tan(e,t).find((n)=>n.slice(0,-1).every((o,r)=>!this.segmentCollides(o,n[r+1])))??null:this.segmentCollides(e,t)?null:[e,t]}pointToCell(e){return{column:J0(Math.round((e.x-this.origin.x)/this.problem.gridSize),0,this.columns-1),row:J0(Math.round((e.y-this.origin.y)/this.problem.gridSize),0,this.rows-1)}}cellToPoint(e,t){return{x:this.origin.x+t*this.problem.gridSize,y:this.origin.y+e*this.problem.gridSize}}toFlatIndex(e,t){return e*this.columns+t}heuristic(e){return Math.hypot(this.problem.end.x-e.x,this.problem.end.y-e.y)}reconstructPath(e){let t=[],n=e;for(;n>=0;){let i=this.nodes[n];t.push({x:i.x,y:i.y}),n=i.parentIndex}if(t.reverse(),BV(t[0],this.problem.start)||t.unshift({...this.problem.start}),BV(t[t.length-1],this.problem.end)||t.push({...this.problem.end}),this.problem.requireOctilinear){let i=[t[0]];for(let s=0;s<t.length-1;s++){let a=t[s],c=t[s+1],l=s===0||s===t.length-2?this.getAllowedConnector(s===0?{...a,parentIndex:-1}:a,c):[a,c];if(!l)return t;i.push(...l.slice(1))}return i.filter((s,a,c)=>{if(a===0||a===c.length-1)return!0;let l=c[a-1],h=c[a+1],d=(s.x-l.x)*(h.y-s.y)-(s.y-l.y)*(h.x-s.x);return Math.abs(d)>0.00000001||!nbe(l,h)})}let o=[t[0]],r=0;for(;r<t.length-1;){let i=t.length-1;for(;i>r+1&&this.segmentCollides(t[r],t[i]);)i--;o.push(t[i]),r=i}return o.filter((i,s,a)=>{if(s===0||s===a.length-1)return!0;let c=a[s-1],l=a[s+1],h=(i.x-c.x)*(l.y-i.y)-(i.y-c.y)*(l.x-i.x);return Math.abs(h)>0.00000001})}createStats(){return{phase:"obstacle-aware-grid-search",gridSize:this.problem.gridSize,traceWidth:this.problem.traceWidth,gridOffset:this.problem.gridOffset,openCells:this.open.size,closedCells:this.closedCellCount,gridCells:this.rows*this.columns}}computeProgress(){return Math.min(0.99,this.iterations/this.MAX_ITERATIONS)}getOutput(){return this.output}getConstructorParams(){let{obstacleIndex:e,...t}=this.problem;return[t]}visualize(){let e=this.nodes.filter((n)=>this.closed[this.toFlatIndex(n.row,n.column)]).slice(-2000).map((n)=>({x:n.x,y:n.y,color:"rgba(0,90,255,0.22)"})),t=this.output?.points??[];return{coordinateSystem:"cartesian",title:this.getSolverName(),rects:[{center:{x:(this.searchBounds.minX+this.searchBounds.maxX)/2,y:(this.searchBounds.minY+this.searchBounds.maxY)/2},width:this.searchBounds.maxX-this.searchBounds.minX,height:this.searchBounds.maxY-this.searchBounds.minY,stroke:"#777"}],points:[...e,{...this.problem.start,color:"green",label:"reroute start"},{...this.problem.end,color:"purple",label:"reroute target"}],lines:t.length>1?[{points:t,strokeColor:"#00a050",strokeWidth:this.problem.traceWidth}]:[],circles:[],texts:[]}}},c6=class{items;clearance;minPadEdgeToPadEdgeClearance;holeClearance;boardEdgeClearance;boardLayers;minViaHoleEdgeToViaHoleEdgeClearance;defaultViaHoleDiameter;bounds;maxIndexedViaHoleDiameter;index;connectionNameSets;copperObjectIds;connectionNameResolver;connectedPads;dynamicTraceIndex;constructor(e,t,n,o=[],r=new xB(e,t)){var i;this.bounds=e.bounds,this.boardLayers=(i=e.layerCount,["top",...Array.from({length:Math.max(0,i-2)},(a,c)=>`inner${c+1}`),...i>1?["bottom"]:[]]),this.dynamicTraceIndex=n,this.clearance=Math.max(e.defaultObstacleMargin??0,e.minTraceToPadEdgeClearance??0,0.1),this.holeClearance=e.minTraceToHoleEdgeClearance??this.clearance,this.minPadEdgeToPadEdgeClearance=e.minPadEdgeToPadEdgeClearance??this.clearance,this.boardEdgeClearance=e.minBoardEdgeClearance??this.clearance,this.minViaHoleEdgeToViaHoleEdgeClearance=Math.max(e.minViaHoleEdgeToViaHoleEdgeClearance??0,0.1),this.defaultViaHoleDiameter=e.min_via_hole_diameter??e.minViaHoleDiameter??0.3,this.items=[...e.obstacles.flatMap((a,c)=>function(l,h=0.6){if(l.isNonPlatedHole&&l.shape==="circle"){let g=l.width/2;return[{minX:l.center.x-g,minY:l.center.y-g,maxX:l.center.x+g,maxY:l.center.y+g,layers:l.layers,kind:"obstacle",obstacleKind:"hole",connectionNames:l.connectedTo,exactShape:{type:"circle",center:l.center,radius:g}}]}let d=(l.ccwRotationDegrees??0)*Math.PI/180,u=Math.max(1,Math.ceil(l.width/h)),_=Math.max(1,Math.ceil(l.height/h)),p=l.width/u,m=l.height/_,A=[];for(let g=0;g<_;g++)for(let f=0;f<u;f++){let y={x:l.center.x-l.width/2+(f+0.5)*p,y:l.center.y-l.height/2+(g+0.5)*m},x=p/2,C=m/2,b=[{x:y.x-x,y:y.y-C},{x:y.x+x,y:y.y-C},{x:y.x+x,y:y.y+C},{x:y.x-x,y:y.y+C}].map((I)=>Xbr(I,l.center,d));A.push({minX:Math.min(...b.map((I)=>I.x)),minY:Math.min(...b.map((I)=>I.y)),maxX:Math.max(...b.map((I)=>I.x)),maxY:Math.max(...b.map((I)=>I.y)),layers:l.layers,kind:"obstacle",obstacleKind:l.isNonPlatedHole?"hole":l.connectedTo[0]?.startsWith("pcb_via_")?"via":l.connectedTo[0]?.startsWith("pcb_smtpad_")||l.connectedTo[0]?.startsWith("pcb_plated_hole_")?"pad":"other",connectionNames:l.connectedTo,exactShape:{type:"polygon",points:b}})}return A}(a).map((l)=>({...l,copperObjectId:`obstacle:${c}`}))),...this.createTraceItems(e.fixedTraces??[],!0),...this.createTraceItems(t),...o],this.maxIndexedViaHoleDiameter=this.items.reduce((a,c)=>c.kind==="via"?Math.max(a,c.viaHoleDiameter??this.defaultViaHoleDiameter):a,this.defaultViaHoleDiameter),this.connectionNameResolver=r,r.setCacheableObstacles(e.obstacles);let s=new Map;this.connectionNameSets=this.items.map((a)=>{let c=s.get(a.connectionNames);return c||(c=r.canonicalizeToSet(a.connectionNames),s.set(a.connectionNames,c)),c}),this.copperObjectIds=this.items.map((a,c)=>a.copperObjectId??`indexed-item:${c}`),this.connectedPads=e.obstacles.flatMap((a)=>a.connectedTo.some((c)=>c.startsWith("pcb_smtpad_")||c.startsWith("pcb_plated_hole_"))?[{obstacle:a,canonicalConnectionNames:r.canonicalizeToSet(a.connectedTo)}]:[]),this.index=this.items.length>0?new R_(this.items.length):null;for(let a of this.items)this.index.add(a.minX,a.minY,a.maxX,a.maxY);this.index?.finish()}createTraceItems(e,t=!1){let n=[];for(let o=0;o<e.length;o++){let r=e[o],i=t?void 0:o,s=`${t?"fixed-trace":"trace"}:${o}`,a=!t&&o===this.dynamicTraceIndex,c=[r.connection_name,r.source_trace_id,r.rootConnectionName,...r.mergedConnectionNames??[],...r.connectsTo??[]].filter((l)=>Boolean(l));for(let l=0;l<r.route.length;l++){let h=r.route[l];if(h.route_type==="via"){let u=h.via_diameter??0.6;n.push({minX:h.x-u/2,minY:h.y-u/2,maxX:h.x+u/2,maxY:h.y+u/2,layers:this.boardLayers,kind:"via",connectionNames:c,copperObjectId:s,traceIndex:i,routeStartIndex:l,routeEndIndex:l,viaHoleDiameter:h.via_hole_diameter??this.defaultViaHoleDiameter,exactShape:{type:"circle",center:{x:h.x,y:h.y},radius:u/2}});continue}if(a)continue;let d=r.route[l+1];h.route_type==="wire"&&d?.route_type==="wire"&&h.layer===d.layer&&n.push(...Ban({start:h,end:d,width:h.width,base:{layers:[h.layer],kind:"trace",connectionNames:c,copperObjectId:s,traceIndex:i,routeStartIndex:l,routeEndIndex:l+1}}))}}return n}collides(e){if(this.isOutsideBounds(e))return!0;let{radius:t,candidates:n,canonicalConnectionNames:o}=this.getCollisionCandidates(e);for(let r of n)if(this.itemCollides(r,e,t,o))return!0;return!1}findCollisions(e){let{radius:t,candidates:n,canonicalConnectionNames:o}=this.getCollisionCandidates(e),r=[];for(let i of n)this.itemCollides(i,e,t,o)&&r.push(this.items[i]);return r}getSameNetCopperContactIds(e){let t=e.width/2,n=this.index?.search(Math.min(e.start.x,e.end.x)-t,Math.min(e.start.y,e.end.y)-t,Math.max(e.start.x,e.end.x)+t,Math.max(e.start.y,e.end.y)+t)??[],o=new Set(this.connectionNameResolver.canonicalize(e.connectionNames)),r=new Set;for(let i of n){let s=this.items[i];s.layers.includes(e.layer)&&(s.traceIndex===e.ignoreTraceIndex||e.ignoreTraceIndices?.includes(s.traceIndex??-1)||[...this.connectionNameSets[i]].some((a)=>o.has(a))&&this.itemCopperTouches(s,e,t)&&r.add(this.copperObjectIds[i]))}return r}getConnectedPadWidthLimit(e){if(Math.hypot(e.end.x-e.start.x,e.end.y-e.start.y)<=0.00001)return null;let t=this.getConnectedPadWidthLimitAtPoint(e,e.start),n=this.getConnectedPadWidthLimitAtPoint(e,e.end);return t===null?n:n===null?t:Math.min(t,n)}getConnectedPadWidthLimitAtPoint(e,t){let n=this.getConnectedPadsAtPoint(e,t);return n.length===0?null:Math.max(...n.map(({obstacle:o})=>this.getPadWidthNormalToQuery(o,e)))}getConnectedPadEndpointWidthLimitAtPoint(e,t){let n=this.getConnectedPadsAtPoint(e,t);return n.length===0?null:Math.max(...n.map(({obstacle:o})=>{let r=this.getObstacleLocalPoint(t,o);return Math.max(0,2*Math.min(o.width/2-Math.abs(r.x),o.height/2-Math.abs(r.y)))}))}getConnectedPadBoundaryPoint(e,t){let n=t==="start"?e.start:e.end,o=t==="start"?e.end:e.start,r=this.getConnectedPadsAtPoint(e,n).sort((i,s)=>this.getPadWidthNormalToQuery(s.obstacle,e)-this.getPadWidthNormalToQuery(i.obstacle,e))[0];return!r||this.pointIsInsideObstacle(o,r.obstacle)?null:this.getObstacleBoundaryPoint(n,o,r.obstacle)}getConnectedPadsAtPoint(e,t){let n=new Set(this.connectionNameResolver.canonicalize(e.connectionNames));return this.connectedPads.filter(({obstacle:o,canonicalConnectionNames:r})=>o.layers.includes(e.layer)&&[...r].some((i)=>n.has(i))&&this.pointIsInsideObstacle(t,o))}pointIsInsideObstacle(e,t){let{x:n,y:o}=this.getObstacleLocalPoint(e,t);return Math.abs(n)<=t.width/2+0.000000001&&Math.abs(o)<=t.height/2+0.000000001}getObstacleLocalPoint(e,t){let n=-(t.ccwRotationDegrees??0)*Math.PI/180,o=Math.cos(n),r=Math.sin(n),i=e.x-t.center.x,s=e.y-t.center.y;return{x:i*o-s*r,y:i*r+s*o}}getPadWidthNormalToQuery(e,t){let n=t.end.x-t.start.x,o=t.end.y-t.start.y,r=Math.hypot(n,o);if(r<=0.000000001)return Math.min(e.width,e.height);let i=-o/r,s=n/r,a=-(e.ccwRotationDegrees??0)*Math.PI/180,c=Math.cos(a),l=Math.sin(a),h=i*c-s*l,d=i*l+s*c;return Math.abs(h)*e.width+Math.abs(d)*e.height}getObstacleBoundaryPoint(e,t,n){let o=-(n.ccwRotationDegrees??0)*Math.PI/180,r=Math.cos(o),i=Math.sin(o),s=(u)=>{let _=u.x-n.center.x,p=u.y-n.center.y;return{x:_*r-p*i,y:_*i+p*r}},a=s(e),c=s(t),l={x:c.x-a.x,y:c.y-a.y},h=[];if(Math.abs(l.x)>0.000000000001){let u=l.x>0?n.width/2:-n.width/2;h.push((u-a.x)/l.x)}if(Math.abs(l.y)>0.000000000001){let u=l.y>0?n.height/2:-n.height/2;h.push((u-a.y)/l.y)}let d=Math.min(...h.filter((u)=>u>=0&&u<=1));return Number.isFinite(d)?{x:e.x+(t.x-e.x)*d,y:e.y+(t.y-e.y)*d}:null}getConnectedLayersAtPoint(e,t){let n=new Set(this.connectionNameResolver.canonicalize(t)),o=new Set,r=this.index?.search(e.x,e.y,e.x,e.y)??[];for(let i of r){let s=this.items[i];if(s.kind!=="obstacle")continue;if(![...this.connectionNameSets[i]].some((a)=>n.has(a)))continue;if(s.exactShape?.type==="polygon"?_je(e,e,s.exactShape.points)<=0.000000001:s.exactShape?.type==="circle"?Math.hypot(s.exactShape.center.x-e.x,s.exactShape.center.y-e.y)<=s.exactShape.radius+0.000000001:e.x>=s.minX-0.000000001&&e.x<=s.maxX+0.000000001&&e.y>=s.minY-0.000000001&&e.y<=s.maxY+0.000000001)for(let a of s.layers)o.add(a)}return[...o]}collidesVia(e){return this.getViaViolationSignatures(e).size>0}getViaViolationSignatures(e){let t=new Set;for(let a of e.layers){let c={isVia:!0,start:e.point,end:e.point,layer:a,width:e.padDiameter,connectionNames:e.connectionNames,ignoreTraceIndex:e.ignoreTraceIndex,ignoreTraceIndices:e.ignoreTraceIndices,ignoreRouteRange:e.ignoreRouteRange,obstacleClearance:e.obstacleClearance,blockSameNetObstacles:e.blockSameNetObstacles,sameNetObstacleClearance:e.sameNetObstacleClearance};this.isOutsideBounds(c)&&t.add(`board-edge:${a}`);let{radius:l,candidates:h,canonicalConnectionNames:d}=this.getCollisionCandidates(c);for(let u of h)this.itemCollides(u,c,l,d)&&t.add(`copper:${a}:${this.getViolationObjectId(u)}`)}let n=e.holeDiameter+this.minViaHoleEdgeToViaHoleEdgeClearance;for(let a of e.otherNewViaPoints??[])Math.hypot(a.x-e.point.x,a.y-e.point.y)<n-0.000000001&&t.add(`new-via-drill:${a.x},${a.y}:${e.holeDiameter}`);let o=e.fixedVias??[];for(let a=0;a<o.length;a++){let c=o[a],l=e.holeDiameter/2+c.holeDiameter/2+this.minViaHoleEdgeToViaHoleEdgeClearance;Math.hypot(c.point.x-e.point.x,c.point.y-e.point.y)<l-0.000000001&&t.add(`fixed-via-drill:${a}:${c.point.x},${c.point.y}:${c.holeDiameter}`)}let r=e.holeDiameter/2+this.maxIndexedViaHoleDiameter/2+this.minViaHoleEdgeToViaHoleEdgeClearance,i=this.index?.search(e.point.x-r,e.point.y-r,e.point.x+r,e.point.y+r)??[],s=new Set;for(let a of i){let c=this.items[a];if(c.kind!=="via"||c.exactShape?.type!=="circle")continue;if(c.traceIndex===e.ignoreTraceIndex&&e.ignoreRouteRange&&(c.routeEndIndex??-1)>=e.ignoreRouteRange.start&&(c.routeStartIndex??Number.POSITIVE_INFINITY)<=e.ignoreRouteRange.end)continue;if(e.ignoreTraceIndices?.includes(c.traceIndex??-1))continue;let l=`${this.copperObjectIds[a]??"unknown"}:${c.routeStartIndex??-1}`;if(s.has(l))continue;s.add(l);let h=c.viaHoleDiameter??this.defaultViaHoleDiameter,d=e.holeDiameter/2+h/2+this.minViaHoleEdgeToViaHoleEdgeClearance;Math.hypot(c.exactShape.center.x-e.point.x,c.exactShape.center.y-e.point.y)<d-0.000000001&&t.add(`indexed-via-drill:${this.getViolationObjectId(a)}`)}return t}getViolationObjectId(e){let t=this.items[e],n=this.copperObjectIds[e],o=`${t.routeStartIndex??""}-${t.routeEndIndex??""}`;if(t.kind==="obstacle")return n;if(t.exactShape?.type==="segment"){let{start:r,end:i,width:s}=t.exactShape;return`${n}:${t.kind}:${o}:${r.x},${r.y}:${i.x},${i.y}:${s}`}if(t.exactShape?.type==="circle"){let{center:r,radius:i}=t.exactShape;return`${n}:${t.kind}:${o}:${r.x},${r.y}:${i}`}return t.exactShape?.type==="polygon"?`${n}:${t.kind}:${o}:${t.exactShape.points.map((r)=>`${r.x},${r.y}`).join(";")}`:`${n}:${t.kind}:${o}:${t.minX},${t.minY},${t.maxX},${t.maxY}`}getCollisionCandidates(e){let t=Math.max(this.clearance,this.holeClearance,e.isVia?this.minPadEdgeToPadEdgeClearance:0,e.obstacleClearance??this.clearance,e.sameNetObstacleClearance??0),n=e.width/2+t,o={minX:Math.min(e.start.x,e.end.x)-n,minY:Math.min(e.start.y,e.end.y)-n,maxX:Math.max(e.start.x,e.end.x)+n,maxY:Math.max(e.start.y,e.end.y)+n};return{radius:n,candidates:this.index?.search(o.minX,o.minY,o.maxX,o.maxY)??[],canonicalConnectionNames:this.connectionNameResolver.canonicalize(e.connectionNames)}}itemCollides(e,t,n,o){let r=this.items[e];if(!r.layers.includes(t.layer))return!1;let i=this.connectionNameSets[e],s=o.some((l)=>i.has(l));if(s&&(!t.blockSameNetObstacles||r.kind!=="obstacle"||r.obstacleKind==="via"))return!1;if(r.kind==="trace"&&t.ignoreTraceIndices?.includes(r.traceIndex??-1))return!1;if(r.kind==="trace"&&r.traceIndex===t.ignoreTraceIndex&&t.ignoreRouteRange&&(r.routeEndIndex??-1)>=t.ignoreRouteRange.start&&(r.routeStartIndex??Number.POSITIVE_INFINITY)<=t.ignoreRouteRange.end)return!1;let a=t.isVia&&(r.kind==="via"||r.kind==="obstacle"&&r.obstacleKind==="via")?this.minPadEdgeToPadEdgeClearance:r.kind!=="obstacle"||r.obstacleKind!=="hole"||t.isVia?r.kind==="obstacle"&&r.obstacleKind==="pad"?s&&t.blockSameNetObstacles?t.sameNetObstacleClearance??t.obstacleClearance??this.clearance:t.obstacleClearance??this.clearance:this.clearance:this.holeClearance,c=t.width/2+a;return r.exactShape?.type==="segment"?k$e(t.start,t.end,r.exactShape.start,r.exactShape.end)<=c+r.exactShape.width/2+0.000000001:r.exactShape?.type==="polygon"?_je(t.start,t.end,r.exactShape.points)<=c+0.000000001:r.exactShape?.type==="circle"?IV(r.exactShape.center,t.start,t.end)<=c+r.exactShape.radius+0.000000001:eGt(t.start,t.end,{minX:r.minX-c,minY:r.minY-c,maxX:r.maxX+c,maxY:r.maxY+c})}itemCopperTouches(e,t,n){return e.exactShape?.type==="segment"?k$e(t.start,t.end,e.exactShape.start,e.exactShape.end)<=n+e.exactShape.width/2+0.000000001:e.exactShape?.type==="polygon"?_je(t.start,t.end,e.exactShape.points)<=n+0.000000001:e.exactShape?.type==="circle"?IV(e.exactShape.center,t.start,t.end)<=n+e.exactShape.radius+0.000000001:eGt(t.start,t.end,{minX:e.minX-n,minY:e.minY-n,maxX:e.maxX+n,maxY:e.maxY+n})}isOutsideBounds(e){let t=e.width/2+this.boardEdgeClearance;return Math.min(e.start.x,e.end.x)-t<this.bounds.minX||Math.max(e.start.x,e.end.x)+t>this.bounds.maxX||Math.min(e.start.y,e.end.y)-t<this.bounds.minY||Math.max(e.start.y,e.end.y)+t>this.bounds.maxY}},nGt=[{x:0,y:0},{x:0.5,y:0},{x:0,y:0.5},{x:0.5,y:0.5}],K9=(e)=>e?.route_type==="wire",q$=class extends _Y{inputProblem;traces;corridor;phase="scan-corridor";corridorCursor=0;blockerCursor=0;offsetCursor=0;resolutionCursor=0;attemptedGridCount=0;blockerIndex;connectionNameResolver;connectionByTraceId=new Map;mutableTraceIndices;blockersByTrace=new Map;blockers=[];currentBlocker=null;currentRange=null;currentTraceWidth=0;gridResolutions=[];currentObstacleIndex=null;output=null;constructor(e,t=new xB(e.simpleRouteJson,e.traces)){super(),this.inputProblem=structuredClone(e),this.traces=structuredClone(e.traces),this.corridor=structuredClone(e.corridor),this.mutableTraceIndices=e.mutableTraceIndices?new Set(e.mutableTraceIndices):null,this.connectionNameResolver=t,this.blockerIndex=new c6(this.inputProblem.simpleRouteJson,this.traces,e.powerTraceIndex,[],this.connectionNameResolver),this.activeSubSolver=null,this.MAX_ITERATIONS=25000,this.stats=this.createStats()}getSolverName(){return"LocalTraceInflationSolver"}_step(){if(this.activeSubSolver)return this.stepActiveSubSolver(),void(this.stats=this.createStats());switch(this.phase){case"scan-corridor":this.scanNextCorridorSegment();break;case"select-blocker":this.selectNextBlocker();break;case"try-elastic-push":break;case"try-grid-candidate":this.startNextGridCandidate();break;case"complete":this.output?this.solved=!0:(this.failed=!0,this.error="No locally reroutable trace blocks the power corridor")}this.stats=this.createStats()}scanNextCorridorSegment(){let e=this.corridor[this.corridorCursor];if(!e)return this.blockers=[...this.blockersByTrace.values()].sort((o,r)=>o.traceIndex-r.traceIndex),void(this.phase="select-blocker");let t=this.traces[this.inputProblem.powerTraceIndex],n=this.blockerIndex.findCollisions({start:e.start,end:e.end,layer:e.layer,width:e.width,connectionNames:t?this.getTraceConnectionNames(t):[]});for(let o of n)this.recordBlockingTrace(o);this.corridorCursor++}recordBlockingTrace(e){if(e.kind!=="trace"||e.traceIndex===void 0||e.routeStartIndex===void 0||e.routeEndIndex===void 0||e.traceIndex===this.inputProblem.powerTraceIndex||this.mutableTraceIndices!==null&&!this.mutableTraceIndices.has(e.traceIndex))return;let t=this.traces[e.traceIndex];if(!t)return;let n=this.findConnectionForTrace(t);if((n?this.resolveNominalTraceWidth(n):this.getTraceNominalWidth(t))>=(this.inputProblem.pushOnlyNominalWidthsBelow??this.inputProblem.nominalPowerWidth)-_r)return;let o=this.blockersByTrace.get(e.traceIndex);if(o)return o.firstRouteIndex=Math.min(o.firstRouteIndex,e.routeStartIndex),void(o.lastRouteIndex=Math.max(o.lastRouteIndex,e.routeEndIndex));this.blockersByTrace.set(e.traceIndex,{traceIndex:e.traceIndex,firstRouteIndex:e.routeStartIndex,lastRouteIndex:e.routeEndIndex})}selectNextBlocker(){if(this.currentBlocker=this.blockers[this.blockerCursor]??null,!this.currentBlocker)return void(this.phase="complete");let e=this.findStableAnchorRange(this.currentBlocker);if(!e)return void this.blockerCursor++;let t=this.traces[this.currentBlocker.traceIndex];this.currentRange=e,this.currentTraceWidth=this.getRangeWidth(t,e),this.gridResolutions=this.getGridResolutions(this.currentTraceWidth),this.resolutionCursor=0,this.offsetCursor=0,this.currentObstacleIndex=new c6(this.inputProblem.simpleRouteJson,this.traces,this.currentBlocker.traceIndex,this.createInflatedCorridorItems(),this.connectionNameResolver),this.activeSubSolver=new gje({trace:t,range:e,layer:t.route[e.startIndex].layer,traceWidth:this.currentTraceWidth,corridor:this.corridor,obstacleIndex:this.currentObstacleIndex,connectionNames:this.getTraceConnectionNames(t)}),this.phase="try-elastic-push"}findStableAnchorRange(e){let t=this.traces[e.traceIndex];if(!t)return null;let{firstRouteIndex:n,lastRouteIndex:o}=e;for(;n>0;){let c=t.route[n];if(K9(c)&&this.pointClearsCorridor(c))break;n--}for(;o<t.route.length-1;){let c=t.route[o];if(K9(c)&&this.pointClearsCorridor(c))break;o++}let r=t.route[n],i=t.route[o];if(!K9(r)||!K9(i)||r.layer!==i.layer||!this.pointClearsCorridor(r)||!this.pointClearsCorridor(i)||n>=o)return null;let s={startIndex:n,endIndex:o},a=this.getRangeLength(t,s);return!Number.isFinite(a)||a>(this.inputProblem.maxRerouteLength??10)+_r?null:s}pointClearsCorridor(e){return this.corridor.every((t)=>{if(t.layer!==e.layer)return!0;let n=t.width/2+e.width/2+this.blockerIndex.clearance;return IV(e,t.start,t.end)>=n-_r})}startNextGridCandidate(){if(!this.currentBlocker||!this.currentRange)return void(this.phase="select-blocker");if(this.resolutionCursor>=this.gridResolutions.length)return this.blockerCursor++,void(this.phase="select-blocker");if(this.offsetCursor>=nGt.length)return this.resolutionCursor++,void(this.offsetCursor=0);let e=this.traces[this.currentBlocker.traceIndex],t=e.route[this.currentRange.startIndex],n=e.route[this.currentRange.endIndex];if(!K9(t)||!K9(n))return this.blockerCursor++,void(this.phase="select-blocker");let o=this.gridResolutions[this.resolutionCursor],r=nGt[this.offsetCursor],i=this.currentObstacleIndex;if(!i)return this.blockerCursor++,void(this.phase="select-blocker");this.attemptedGridCount++,this.activeSubSolver=new obe({start:t,end:n,layer:t.layer,traceWidth:this.currentTraceWidth,gridSize:o,gridOffset:{x:r.x*o,y:r.y*o},connectionNames:this.getTraceConnectionNames(e),obstacleIndex:i,ignoreTraceIndex:this.currentBlocker.traceIndex,ignoreRouteRange:{start:this.currentRange.startIndex,end:this.currentRange.endIndex},bounds:this.inputProblem.simpleRouteJson.bounds,searchPadding:J0(2.5*this.inputProblem.nominalPowerWidth,1.5,4)})}stepActiveSubSolver(){let e=this.activeSubSolver;if(e.step(),e.solved||e.failed){if(e.solved){let t=e.getOutput();if(t)return this.applyRoute(t,e instanceof gje?"elastic":"grid"),this.activeSubSolver=null,void(this.phase="complete")}this.failedSubSolvers??=[],this.failedSubSolvers.push(e),this.activeSubSolver=null,e instanceof gje?this.phase="try-grid-candidate":this.offsetCursor++}}applyRoute(e,t){let n=this.currentBlocker,o=this.currentRange,r=this.traces[n.traceIndex],i=r.route[o.startIndex],s=r.route[o.endIndex],a=e.points.map((c)=>({route_type:"wire",x:c.x,y:c.y,width:this.currentTraceWidth,layer:i.layer}));a[0].width=Math.max(a[0].width,i.width),a[a.length-1].width=Math.max(a[a.length-1].width,s.width),r.route.splice(o.startIndex,o.endIndex-o.startIndex+1,...a),this.output={traces:this.traces,pushedTraceIndex:n.traceIndex,replacedRange:o,strategy:t}}createInflatedCorridorItems(){return this.corridor.flatMap((e)=>Ban({start:e.start,end:e.end,width:e.width,base:{layers:[e.layer],kind:"obstacle",connectionNames:[]}}))}getGridResolutions(e){return[J0(1.5*e,0.1,0.3),J0(0.75*e,0.08,0.18)].filter((t,n,o)=>o.findIndex((r)=>Math.abs(r-t)<_r)===n)}getRangeWidth(e,t){let n=this.inputProblem.simpleRouteJson.minTraceWidth;for(let o=t.startIndex;o<=t.endIndex;o++){let r=e.route[o];K9(r)&&(n=Math.max(n,r.width))}return n}getRangeLength(e,t){let n=0;for(let o=t.startIndex;o<t.endIndex;o++){let r=e.route[o],i=e.route[o+1];if(!K9(r)||!K9(i)||r.layer!==i.layer)return Number.POSITIVE_INFINITY;n+=Ms(r,i)}return n}resolveNominalTraceWidth(e){return Math.max(e.nominalTraceWidth??e.width??this.inputProblem.simpleRouteJson.nominalTraceWidth??this.inputProblem.simpleRouteJson.minTraceWidth,this.inputProblem.simpleRouteJson.minTraceWidth)}getTraceNominalWidth(e){return e.route.reduce((t,n)=>n.route_type==="wire"?Math.max(t,n.width):t,this.inputProblem.simpleRouteJson.minTraceWidth)}findConnectionForTrace(e){let t=this.connectionByTraceId.get(e.pcb_trace_id);if(t!==void 0)return t??void 0;let n=this.getTraceConnectionNames(e),o=this.inputProblem.simpleRouteJson.connections.find((r)=>[r.name,r.source_trace_id,r.rootConnectionName,r.netConnectionName,...r.mergedConnectionNames??[]].filter((i)=>Boolean(i)).some((i)=>n.includes(i)))??null;return this.connectionByTraceId.set(e.pcb_trace_id,o),o??void 0}getTraceConnectionNames(e){return[e.connection_name,e.source_trace_id,e.rootConnectionName,...e.mergedConnectionNames??[]].filter((t)=>Boolean(t))}createStats(){return{phase:this.phase,corridorSegment:this.corridorCursor,corridorSegmentCount:this.corridor.length,blockingTraceCount:this.blockersByTrace.size,blockerCursor:this.blockerCursor,pushedTraceIndex:this.currentBlocker?.traceIndex,anchorRange:this.currentRange,traceWidth:this.currentTraceWidth,gridSize:this.gridResolutions[this.resolutionCursor],gridOffsetVariant:this.offsetCursor,attemptedGridCount:this.attemptedGridCount}}computeProgress(){return this.phase==="scan-corridor"?this.corridor.length===0?0.25:this.corridorCursor/this.corridor.length*0.25:this.blockers.length===0?0.5:Math.min(0.99,0.25+this.blockerCursor/this.blockers.length)}getOutput(){return this.output}getConstructorParams(){return[this.inputProblem]}visualize(){let e=[];for(let t=0;t<this.traces.length;t++){let n=this.traces[t];for(let o=0;o<n.route.length-1;o++){let r=n.route[o],i=n.route[o+1];K9(r)&&K9(i)&&r.layer===i.layer&&e.push({points:[r,i],strokeColor:t===this.currentBlocker?.traceIndex?"#1769d2":"#777",strokeWidth:Math.max(r.width,i.width)})}}for(let t of this.corridor)e.push({points:[t.start,t.end],strokeColor:"rgba(255, 128, 0, 0.55)",strokeWidth:t.width});return{coordinateSystem:"cartesian",title:this.getSolverName(),lines:e,points:[],rects:[],circles:[],texts:[]}}},q0=0.000001,TV=(e,t)=>Math.hypot(e.x-t.x,e.y-t.y),cB=(e,t,n)=>{let o=n.x-t.x,r=n.y-t.y,i=o*o+r*r,s=i<=0.000000000001?0:Math.max(0,Math.min(1,((e.x-t.x)*o+(e.y-t.y)*r)/i));return Math.hypot(e.x-(t.x+s*o),e.y-(t.y+s*r))},k3e=(e,t,n)=>(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x),L$e=(e,t,n,o)=>((r,i,s,a)=>{let c=k3e(s,a,r),l=k3e(s,a,i),h=k3e(r,i,s),d=k3e(r,i,a);return(c>0&&l<0||c<0&&l>0)&&(h>0&&d<0||h<0&&d>0)})(e,t,n,o)?0:Math.min(cB(e,n,o),cB(t,n,o),cB(n,e,t),cB(o,e,t)),vle=(e)=>{let t=(e.ccwRotationDegrees??0)*Math.PI/180,n=Math.cos(t),o=Math.sin(t);return[{x:-e.width/2,y:-e.height/2},{x:e.width/2,y:-e.height/2},{x:e.width/2,y:e.height/2},{x:-e.width/2,y:e.height/2}].map((r)=>({x:e.center.x+r.x*n-r.y*o,y:e.center.y+r.x*o+r.y*n}))},J$=(e)=>{if(!(e.type==="oval"||e.shape==="circle"))return!1;if(Math.abs(e.width-e.height)>q0)throw Error(`Physical connectivity does not yet support non-circular oval obstacle ${e.obstacleId??"<unknown>"}`);return!0},Sle=(e,t)=>{for(let o=0;o<t.length;o++)if(cB(e,t[o],t[(o+1)%t.length])<=q0)return!0;let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o],s=t[r];i.y>e.y!=s.y>e.y&&e.x<(s.x-i.x)*(e.y-i.y)/(s.y-i.y)+i.x&&(n=!n)}return n},Ple=(e,t)=>{if(J$(t))return Math.max(0,TV(e,t.center)-t.width/2);let n=vle(t);return Sle(e,n)?0:Math.min(...n.map((o,r)=>cB(e,o,n[(r+1)%n.length])))},Dan=(e,t)=>{if(J$(e))return J$(t)?Math.max(0,TV(e.center,t.center)-e.width/2-t.width/2):Math.max(0,Ple(e.center,t)-e.width/2);if(J$(t))return Dan(t,e);let n=vle(e),o=vle(t);if(Sle(n[0],o)||Sle(o[0],n))return 0;let r=Number.POSITIVE_INFINITY;for(let i=0;i<n.length;i++)for(let s=0;s<o.length;s++)r=Math.min(r,L$e(n[i],n[(i+1)%n.length],o[s],o[(s+1)%o.length]));return r},rbe=(e,t)=>({minX:e.minX-t,minY:e.minY-t,maxX:e.maxX+t,maxY:e.maxY+t}),a6e=(e)=>({minX:e.x,minY:e.y,maxX:e.x,maxY:e.y}),Nan=(e)=>{if(J$(e))return rbe(a6e(e.center),e.width/2);let t=vle(e);return{minX:Math.min(...t.map((n)=>n.x)),minY:Math.min(...t.map((n)=>n.y)),maxX:Math.max(...t.map((n)=>n.x)),maxY:Math.max(...t.map((n)=>n.y))}},sV=(e,t)=>{if(!((n,o)=>n.layers.some((r)=>o.layers.includes(r)))(e,t)||!((n,o)=>n.maxX+q0>=o.minX&&o.maxX+q0>=n.minX&&n.maxY+q0>=o.minY&&o.maxY+q0>=n.minY)(e.bounds,t.bounds))return!1;if(e.kind==="bridge-pad"){let n={kind:"obstacle",obstacle:e.obstacle,layers:e.layers,bounds:e.bounds};return t.kind==="bridge-pad"?sV(n,{kind:"obstacle",obstacle:t.obstacle,layers:t.layers,bounds:t.bounds}):sV(n,t)}return t.kind==="bridge-pad"?sV(t,e):e.kind==="endpoint"?t.kind==="endpoint"?TV(e.point,t.point)<=q0:t.kind==="obstacle"?Ple(e.point,t.obstacle)<=q0:t.kind==="segment"?cB(e.point,t.start,t.end)<=t.width/2+q0:TV(e.point,t.center)<=t.diameter/2+q0:t.kind==="endpoint"?sV(t,e):e.kind==="obstacle"?t.kind==="obstacle"?Dan(e.obstacle,t.obstacle)<=q0:t.kind==="segment"?((n,o,r)=>{if(J$(r))return Math.max(0,cB(r.center,n,o)-r.width/2);let i=vle(r);return Sle(n,i)||Sle(o,i)?0:Math.min(...i.map((s,a)=>L$e(n,o,s,i[(a+1)%i.length])))})(t.start,t.end,e.obstacle)<=t.width/2+q0:Ple(t.center,e.obstacle)<=t.diameter/2+q0:t.kind==="obstacle"?sV(t,e):e.kind==="segment"?t.kind==="segment"?L$e(e.start,e.end,t.start,t.end)<=(e.width+t.width)/2+q0:cB(t.center,e.start,e.end)<=e.width/2+t.diameter/2+q0:t.kind==="segment"?sV(t,e):TV(e.center,t.center)<=(e.diameter+t.diameter)/2+q0},e6r=class{parent;constructor(e){this.parent=Array.from({length:e},(t,n)=>n)}find(e){let t=this.parent[e];if(t===e)return e;let n=this.find(t);return this.parent[e]=n,n}union(e,t){let n=this.find(e),o=this.find(t);n!==o&&(this.parent[o]=n)}},t6r=(e,t)=>{let n=t.indexOf(e.from_layer),o=t.indexOf(e.to_layer);return n<0||o<0?[...new Set([e.from_layer,e.to_layer])]:t.slice(Math.min(n,o),Math.max(n,o)+1)},n6r=(e)=>[e.pcb_trace_id,e.connection_name,e.source_trace_id,e.rootConnectionName,...e.mergedConnectionNames??[],...e.connectsTo??[]].filter((t)=>Boolean(t)),o6r=(e)=>[e.name,e.source_trace_id,e.rootConnectionName,...e.mergedConnectionNames??[],e.netConnectionName,...e.pointsToConnect.flatMap((t)=>[t.pointId,t.pcb_port_id])].filter((t)=>Boolean(t)),r6r=(e)=>[e.obstacleId,...e.connectedTo,...e.offBoardConnectsTo??[]].filter((t)=>Boolean(t)),oGt=(e,t,n,o)=>({kind:"bridge-contact",center:{x:e.x,y:e.y},diameter:t,layers:n,bridgeId:o,bounds:rbe(a6e(e),t/2)}),Qce=0.01,i6r={"0603":{horizontalWidth:0.8,horizontalHeight:0.95,centerSpacings:[1.65,1.8]},1206:{horizontalWidth:0.6,horizontalHeight:1.6,centerSpacings:[3.2]},"1206x4_pair":{horizontalWidth:0.8,horizontalHeight:0.5,centerSpacings:[2.7]}},rGt=(e,t,n)=>{if(!e.layer)throw Error(`Jumper ${n} is missing its layer`);let o=i6r[e.footprint];if(!o)throw Error(`Unsupported jumper footprint ${String(e.footprint)} on ${n}`);let r=Math.abs(e.end.x-e.start.x),i=Math.abs(e.end.y-e.start.y),s=(h)=>o.centerSpacings.some((d)=>Math.abs(h-d)<Qce),a=i<Qce&&s(r),c=r<Qce&&s(i);if(!a&&!c)throw Error(`Jumper ${n} does not match ${e.footprint} pad spacing`);let l={type:"rect",center:{...t},width:a?o.horizontalWidth:o.horizontalHeight,height:a?o.horizontalHeight:o.horizontalWidth,layers:[e.layer],connectedTo:[]};return{kind:"bridge-pad",obstacle:l,layers:l.layers,bridgeId:n,bounds:Nan(l)}},s6r=(e,t,n)=>{if(e.layer!==n.layer||t.layer!==n.layer)return!1;let o=(s,a)=>Math.abs(s.x-a.x)<Qce&&Math.abs(s.y-a.y)<Qce,r=o(e,n.start)&&o(t,n.end),i=o(e,n.end)&&o(t,n.start);return r||i},a6r=(e,t,n,o)=>{let r=[],i=e.route.flatMap((c,l)=>c.route_type==="jumper"?[{routePoint:c,routePointIndex:l}]:[]),s=new Map;for(let c of i){let l=[];for(let d=1;d<e.route.length;d++){let u=e.route[d-1],_=e.route[d];u?.route_type==="wire"&&_?.route_type==="wire"&&s6r(u,_,c.routePoint)&&l.push(d)}if(l.length!==1)throw Error(`Jumper ${e.pcb_trace_id}:${c.routePointIndex} matched ${l.length} placeholder wire segments`);let h=l[0];if(s.has(h))throw Error(`Multiple jumpers matched placeholder segment ${h} on ${e.pcb_trace_id}`);s.set(h,c)}let a;for(let c=0;c<e.route.length;c++){let l=e.route[c];if(l.route_type==="wire"){if(a&&a.layer===l.layer&&TV(a,l)>q0){let d=a;if(s.get(c));else{let u=d.width/2;r.push({kind:"segment",start:{x:d.x,y:d.y},end:{x:l.x,y:l.y},width:d.width,layers:[d.layer],bounds:rbe({minX:Math.min(d.x,l.x),minY:Math.min(d.y,l.y),maxX:Math.max(d.x,l.x),maxY:Math.max(d.y,l.y)},u)})}}a=l;continue}if(a=void 0,l.route_type==="via"){let d=e.route[c-1],u=e.route[c+1];for(let p of[d,u])if(p?.route_type==="wire"&&TV(p,l)>q0)throw Error(`Via ${e.pcb_trace_id}:${c} is adjacent to a non-colocated wire endpoint`);let _=l.via_diameter??n;r.push({kind:"via",center:{x:l.x,y:l.y},diameter:_,layers:t6r(l,t),bounds:rbe(a6e(l),_/2)});continue}let h=`${e.pcb_trace_id}:${c}:${l.route_type}`;if(l.route_type==="jumper"){r.push(rGt(l,l.start,h),rGt(l,l.end,h));continue}if(l.route_type==="through_obstacle"){if(!o.find((d)=>d.layers.includes(l.from_layer)&&d.layers.includes(l.to_layer)&&Ple(l.start,d)<=q0&&Ple(l.end,d)<=q0))throw Error(`Through-obstacle marker ${h} has no same-net multilayer obstacle witness`);r.push(oGt(l.start,0,[l.from_layer],h),oGt(l.end,0,[l.to_layer],h));continue}throw Error(`Unsupported route primitive: ${String(l.route_type)}`)}return r},Ran=(e,t,n)=>{let o=e.pointsToConnect[n];return o.pointId??o.pcb_port_id??`${e.name}[${t}:${n}]`},iGt=(e)=>{let t={},n={},o=[];for(let r=0;r<e.connections.length;r++){let i=e.connections[r];for(let s=0;s<i.pointsToConnect.length;s++){let a=`${r}:${s}`;t[a]=Ran(i,r,s),n[a]=a,o.push([a])}}return{endpointCount:Object.keys(t).length,endpointLabels:t,componentByEndpointKey:n,endpointComponents:o}},ibe=(e)=>{if(e===null||typeof e!="object")return JSON.stringify(e)??String(e);if(Array.isArray(e))return`[${e.map((n)=>ibe(n)).join(",")}]`;let t=e;return`{${Object.keys(t).sort().map((n)=>`${JSON.stringify(n)}:${ibe(t[n])}`).join(",")}}`},sGt=(e,t)=>{let n=new xB(e,t,{includePhysicalPositionAliases:!0}),o=(r=e.layerCount)<=1?["top"]:r===2?["top","bottom"]:["top",...Array.from({length:r-2},(u,_)=>`inner${_+1}`),"bottom"];var r;let i=((u)=>{let _=u.min_via_hole_diameter??u.minViaHoleDiameter??0;return Math.max(_,u.min_via_pad_diameter??u.minViaPadDiameter??u.minViaDiameter??0.6)})(e),s=new Map,a=new Map,c={},l=(u,_)=>{let p=s.get(u)??[];p.push(_),s.set(u,p)};for(let u=0;u<e.connections.length;u++){let _=e.connections[u],p=n.canonicalize(o6r(_));if(p.length!==1)throw Error(`Connection ${_.name} resolved to ${p.length} canonical nets`);for(let m=0;m<_.pointsToConnect.length;m++){let A=_.pointsToConnect[m],g=`${u}:${m}`,f=Ran(_,u,m);c[g]=f;let y={kind:"endpoint",endpointKey:g,endpointLabel:f,point:{x:A.x,y:A.y},layers:A.layers??[A.layer],bounds:a6e(A)};for(let x of p)l(x,y)}}for(let u of e.obstacles){let _={kind:"obstacle",obstacle:u,layers:u.layers,bounds:Nan(u)};for(let p of n.canonicalize(r6r(u))){let m=a.get(p)??[];m.push(u),a.set(p,m),s.has(p)&&l(p,_)}}for(let u of[...t,...e.fixedTraces??[]]){let _=n.canonicalize(n6r(u));if(_.length!==1)throw Error(`Trace ${u.pcb_trace_id} resolved to ${_.length} canonical nets`);let p=a.get(_[0])??[],m=a6r(u,o,i,p);for(let A of _)if(s.has(A))for(let g of m)l(A,g)}let h={},d=[];for(let u of s.values()){let _=new e6r(u.length),p=new Map;for(let g=0;g<u.length;g++){let f=u[g];if(f.kind!=="bridge-contact"&&f.kind!=="bridge-pad")continue;let y=p.get(f.bridgeId);y===void 0?p.set(f.bridgeId,g):_.union(y,g)}let m=u.length>0?new R_(u.length):null;if(m){for(let g of u)m.add(g.bounds.minX,g.bounds.minY,g.bounds.maxX,g.bounds.maxY);m.finish()}for(let g=0;g<u.length;g++){let f=u[g],y=m?.search(f.bounds.minX-q0,f.bounds.minY-q0,f.bounds.maxX+q0,f.bounds.maxY+q0)??[];for(let x of y)x<=g||sV(f,u[x])&&_.union(g,x)}let A=new Map;for(let g=0;g<u.length;g++){let f=u[g];if(f.kind!=="endpoint")continue;let y=_.find(g),x=A.get(y)??[];x.push(f.endpointKey),A.set(y,x)}for(let g of A.values()){g.sort();let f=g[0];d.push(g);for(let y of g){if(h[y]!==void 0)throw Error(`Endpoint ${y} was assigned to multiple canonical nets`);h[y]=f}}}return d.sort(([u=""],[_=""])=>u.localeCompare(_)),{endpointCount:Object.keys(c).length,endpointLabels:c,componentByEndpointKey:h,endpointComponents:d}},sbe=class{baseline;inputProblem;baselineCaptureError;baselineTraceSignature;constructor(e,t){this.inputProblem=e,this.baselineTraceSignature=ibe(t);try{this.baseline=sGt(e,t),this.baselineCaptureError=null}catch(n){this.baseline=iGt(e),this.baselineCaptureError=n instanceof Error?n.message:String(n)}}validate(e){if(this.baselineCaptureError){let o=ibe(e)===this.baselineTraceSignature;return{safe:o,candidate:this.baseline,regressions:[],validationError:o?`Connectivity validation is limited to exact trace preservation: ${this.baselineCaptureError}`:`Connectivity validation failed closed: ${this.baselineCaptureError}`}}let t;try{t=sGt(this.inputProblem,e)}catch(o){return{safe:!1,candidate:iGt(this.inputProblem),regressions:[],validationError:`Connectivity validation failed closed: ${o instanceof Error?o.message:String(o)}`}}let n=[];for(let o of this.baseline.endpointComponents){if(o.length<2)continue;let r=new Map;for(let i of o){let s=t.componentByEndpointKey[i]??`missing:${i}`,a=r.get(s)??[];a.push(i),r.set(s,a)}r.size<=1||n.push({baselineEndpointKeys:[...o],baselineEndpointLabels:o.map((i)=>this.baseline.endpointLabels[i]),candidateComponents:[...r.values()]})}return{safe:n.length===0,candidate:t,regressions:n}}},aGt=[{x:0,y:0},{x:0.5,y:0.5}],c6r=[0.15,0.2,0.25,0.3,0.4,0.5],lc=(e)=>e?.route_type==="wire",fje=(e)=>e?.route_type==="via",l6r=Array.from({length:24},(e,t)=>{let n=t*Math.PI/12;return{x:Math.cos(n),y:Math.sin(n)}}),n$=(e)=>[...new Set(e.map((t)=>Number(t.toFixed(6))))].sort((t,n)=>n-t),yje=class extends _Y{inputProblem;traces;obstacleIndex;phase="repair-vias";traceCursor=0;routeCursor=0;candidateCursor=0;clearanceTierCursor=0;attemptedCandidateCount=0;attemptedClearanceShoveCount=0;attemptedViaGridCount=0;committedClearanceShoveCount=0;viaPairCountRemoved=0;viaCountRemoved=0;simplifiedPathCount=0;normalizedSegmentCount=0;achievedExtraClearanceCount=0;relocatedViaCount=0;unresolvedViaCount=0;attemptedPushedViaRepairCount=0;committedPushedViaRepairCount=0;padClearanceRerouteCount=0;unresolvedPadClearanceCount=0;initialPadClearanceViolationCount=0;remainingPadClearanceViolationCount=0;initialPadClearanceViolationCountByClearance={};remainingPadClearanceViolationCountByClearance={};budgetLimited=!1;connectivityValidationCount=0;connectivityRollbackCount=0;connectivityRegressionEndpointIds=[];connectivityValidationError=null;connectivityRollbackMutationStats=null;connectionNameResolver;connectionByTraceId=new Map;connectivityInvariant;initialConnectivitySafeTraces;mutableTraceIndices;mutableTraceIndexSet;viaRepairTraceIndices;traceIndices;maxRerouteLength;clearancePaddingTiers;desiredPadClearance;initialTraceLengths=new Map;candidates=[];candidateShoveCount=0;rollbackTraces=null;baseCandidateValidated=!1;activeShovePadding=0;viaGridAttempt=null;candidateSetMayUseGridFallback=!1;pendingPushedViaRepair=null;alternatePushedViaRepairs=[];pushedViaRepairRollbackTraces=null;connectivityFinalized=!1;finalizedMutatedTraceIndices=[];resumePhase="scan-via-pairs";constructor(e){super(),this.inputProblem=structuredClone(e),this.traces=structuredClone(e.traces),this.initialConnectivitySafeTraces=structuredClone(e.traces),this.connectivityInvariant=new sbe(this.inputProblem.simpleRouteJson,this.initialConnectivitySafeTraces),this.connectionNameResolver=new xB(e.simpleRouteJson,this.traces),this.maxRerouteLength=e.maxRerouteLength??10,this.desiredPadClearance=e.desiredPadClearance,this.clearancePaddingTiers=n$([...e.clearancePaddingTiers??[0.1,0.05,0],0]).filter((r)=>r>=0);let t=this.traces.map((r,i)=>i),n=(r,i,s)=>{let a=[...new Set(r??s)];for(let c of a)if(!Number.isInteger(c)||c<0||c>=this.traces.length)throw RangeError(`Invalid cleanup ${i} index: ${c}`);return a},o=n(e.traceIndices,"trace",t);this.viaRepairTraceIndices=n(e.viaRepairTraceIndices,"via repair trace",o),this.mutableTraceIndices=n(e.mutableTraceIndices,"mutable trace",o),this.mutableTraceIndexSet=new Set(this.mutableTraceIndices),this.traceIndices=o.filter((r)=>this.resolveNominalTraceWidth(this.traces[r])>=0.499999);for(let r of this.traceIndices)this.initialTraceLengths.set(r,this.measureTraceLength(this.traces[r]));this.obstacleIndex=this.createObstacleIndex(),this.initialPadClearanceViolationCount=this.countPadClearanceViolations(),this.remainingPadClearanceViolationCount=this.initialPadClearanceViolationCount,this.initialPadClearanceViolationCountByClearance=this.countPadClearanceViolationsByTier(),this.remainingPadClearanceViolationCountByClearance={...this.initialPadClearanceViolationCountByClearance},this.activeSubSolver=null,this.MAX_ITERATIONS=1e6,this.stats=this.createStats()}getSolverName(){return"PowerTraceCleanupSolver"}_step(){if(this.activeSubSolver)return this.stepActiveShoveSolver(),void(this.stats=this.createStats());switch(this.phase){case"repair-vias":this.repairNextVia();break;case"scan-via-pairs":this.scanNextViaPair();break;case"scan-pad-clearance":this.scanNextPadClearance();break;case"scan-simplification":this.scanNextSimplification();break;case"evaluate-candidate":this.evaluateCurrentCandidate();break;case"shove-clearance":break;case"route-via-pair":this.startNextViaGridCandidate();break;case"complete":this.ensureConnectivitySafeOutput(),this.solved=!0}this.stats=this.createStats()}repairNextVia(){let e=this.viaRepairTraceIndices[this.traceCursor],t=e===void 0?void 0:this.traces[e];if(!t)return this.traceCursor=0,this.routeCursor=0,this.phase="scan-via-pairs",void this.rebuildObstacleIndex();let n=t.route.findIndex((l,h)=>h>=this.routeCursor&&fje(l));if(n===-1)return this.traceCursor++,void(this.routeCursor=0);this.routeCursor=n+1;let o=t.route[n],r=t.route[n-1],i=t.route[n+1];if(!fje(o)||!lc(r)||!lc(i))return;let s=this.getTraceConnectionNames(t),a=this.getBaseObstacleClearance();if(!this.obstacleIndex.collidesVia({point:o,layers:this.obstacleIndex.boardLayers,padDiameter:o.via_diameter??0.6,holeDiameter:o.via_hole_diameter??this.obstacleIndex.defaultViaHoleDiameter,connectionNames:s,ignoreTraceIndex:e,ignoreRouteRange:{start:n,end:n},obstacleClearance:a,blockSameNetObstacles:!0,sameNetObstacleClearance:0}))return;let c=this.findViaRepair(t,n,a);if(!c){let l=this.findPushableViaRepairs(t,n,a),h=l.shift();return h?(this.alternatePushedViaRepairs=l,void this.startPushedViaRepair(h)):void this.unresolvedViaCount++}t.route.splice(c.startIndex,c.endIndex-c.startIndex+1,...c.route),this.relocatedViaCount++,this.routeCursor=c.startIndex+c.route.length,this.rebuildObstacleIndex()}findViaRepair(e,t,n){let o=this.createViaRepairContext(e,t);if(!o)return null;let r=o.candidates.map((i)=>({point:i,movedLength:Ms(o.leftAnchor,i)+Ms(i,o.rightAnchor)})).filter(({movedLength:i})=>i<=o.originalLength+Math.min(6,this.maxRerouteLength)+_r);r.sort((i,s)=>i.movedLength-s.movedLength||Ms(i.point,o.via)-Ms(s.point,o.via));for(let i of r)if(this.isViaRepairPointSafe(o,i.point,n))return this.createViaRepairReplacement(o,i.point);return null}findPushableViaRepairs(e,t,n){let o=this.viaRepairTraceIndices[this.traceCursor];if(o===void 0)return[];let r=this.createViaRepairContext(e,t);if(!r)return[];let i=r.candidates.flatMap((s)=>{let a=Ms(r.leftAnchor,s)+Ms(s,r.rightAnchor);if(a>r.originalLength+Math.min(6,this.maxRerouteLength)+_r)return[];let c=new Set,l=this.getViaRepairCollisionQueries(r,s,n);for(let d of l)for(let u of this.obstacleIndex.findCollisions(d)){if(u.kind!=="trace"||u.traceIndex===void 0||u.traceIndex===o||!this.mutableTraceIndexSet.has(u.traceIndex))return[];c.add(u.traceIndex)}if(c.size===0||c.size>2)return[];let h=[...c];return this.isViaRepairPointSafe(r,s,n,h)?[{point:s,movedLength:a,blockerCount:c.size,blockerKey:[...c].sort((d,u)=>d-u).join(",")}]:[]});return i.sort((s,a)=>s.blockerCount-a.blockerCount||s.movedLength-a.movedLength||Ms(s.point,r.via)-Ms(a.point,r.via)),[...new Map([...i].reverse().map((s)=>[s.blockerKey,s])).values(),...i].filter((s,a,c)=>c.findIndex((l)=>l.point.x===s.point.x&&l.point.y===s.point.y)===a).slice(0,12).map((s)=>({traceIndex:o,viaIndex:t,point:s.point,padClearance:n,corridor:[{start:r.leftAnchor,end:s.point,layer:r.leftWire.layer,width:r.leftWire.width},{start:s.point,end:r.rightAnchor,layer:r.rightWire.layer,width:r.rightWire.width},...this.obstacleIndex.boardLayers.map((a)=>({start:s.point,end:s.point,layer:a,width:r.viaDiameter}))]}))}createViaRepairContext(e,t){let n=e.route[t],o=e.route[t-1],r=e.route[t+1];if(!fje(n)||!lc(o)||!lc(r))return null;let i=t-1==0||!lc(e.route[t-2]),s=t+1===e.route.length-1||!lc(e.route[t+2]),a=i?o:e.route[t-2],c=s?r:e.route[t+2],l=Ms(a,n)+Ms(n,c),h=this.getTraceConnectionNames(e),d=n.via_diameter??0.6,u=n.via_hole_diameter??this.obstacleIndex.defaultViaHoleDiameter,_=Math.max(0.3,u+this.obstacleIndex.minViaHoleEdgeToViaHoleEdgeClearance+0.05),p=[_,_+0.15,_+0.3,_+0.5,_+0.75,_+1,_+1.5,_+2].flatMap((A)=>l6r.map((g)=>({x:0.025*Math.round((n.x+g.x*A)/0.025),y:0.025*Math.round((n.y+g.y*A)/0.025)}))),m=[...p,...p.flatMap((A)=>[{x:A.x,y:Math.floor(10*n.y)/10},{x:A.x,y:Math.ceil(10*n.y)/10},{x:Math.floor(10*n.x)/10,y:A.y},{x:Math.ceil(10*n.x)/10,y:A.y}])].filter((A,g,f)=>f.findIndex((y)=>y.x===A.x&&y.y===A.y)===g);return{trace:e,viaIndex:t,via:n,leftWire:o,rightWire:r,leftIsEndpoint:i,rightIsEndpoint:s,leftAnchor:a,rightAnchor:c,originalLength:l,connectionNames:h,viaDiameter:d,holeDiameter:u,ignoreRouteRange:{start:Math.max(0,t-2),end:Math.min(e.route.length-1,t+2)},candidates:m}}getViaRepairCollisionQueries(e,t,n,o){let r=this.viaRepairTraceIndices[this.traceCursor],i={connectionNames:e.connectionNames,ignoreTraceIndex:r,ignoreTraceIndices:o,ignoreRouteRange:e.ignoreRouteRange,obstacleClearance:n};return[...this.obstacleIndex.boardLayers.map((s)=>({...i,start:t,end:t,layer:s,width:e.viaDiameter,blockSameNetObstacles:!0,sameNetObstacleClearance:0})),{...i,start:e.leftAnchor,end:t,layer:e.leftWire.layer,width:e.leftWire.width},{...i,start:t,end:e.rightAnchor,layer:e.rightWire.layer,width:e.rightWire.width}]}isViaRepairPointSafe(e,t,n,o){let r=this.viaRepairTraceIndices[this.traceCursor];return!this.obstacleIndex.collidesVia({point:t,layers:this.obstacleIndex.boardLayers,padDiameter:e.viaDiameter,holeDiameter:e.holeDiameter,connectionNames:e.connectionNames,ignoreTraceIndex:r,ignoreTraceIndices:o,ignoreRouteRange:{start:e.viaIndex,end:e.viaIndex},obstacleClearance:n,blockSameNetObstacles:!0,sameNetObstacleClearance:0})&&!this.getViaRepairCollisionQueries(e,t,n,o).slice(this.obstacleIndex.boardLayers.length).some((i)=>this.obstacleIndex.collides(i))}createViaRepairReplacement(e,t){let n={...e.leftWire,...t},o={...e.via,...t},r={...e.rightWire,...t};return{startIndex:e.viaIndex-1,endIndex:e.viaIndex+1,route:[...e.leftIsEndpoint?[e.leftWire]:[],n,o,r,...e.rightIsEndpoint?[e.rightWire]:[]]}}startPushedViaRepair(e){this.pendingPushedViaRepair=e,this.pushedViaRepairRollbackTraces=structuredClone(this.traces),this.attemptedPushedViaRepairCount++,this.activeSubSolver=new q$({simpleRouteJson:this.inputProblem.simpleRouteJson,traces:this.traces,powerTraceIndex:e.traceIndex,nominalPowerWidth:Math.max(...e.corridor.map((t)=>t.width)),pushOnlyNominalWidthsBelow:Number.POSITIVE_INFINITY,mutableTraceIndices:this.mutableTraceIndices,corridor:e.corridor,maxRerouteLength:this.maxRerouteLength},this.connectionNameResolver)}finishPushedViaRepairSolver(e){let t=this.pendingPushedViaRepair;if(this.activeSubSolver=null,!t)return;if(e.solved){let o=e.getOutput();if(o){this.traces=o.traces,this.rebuildObstacleIndex();let r=this.traces[t.traceIndex],i=r?this.createViaRepairContext(r,t.viaIndex):null;if(i&&this.isViaRepairPointSafe(i,t.point,t.padClearance)){let s=this.createViaRepairReplacement(i,t.point);return r.route.splice(s.startIndex,s.endIndex-s.startIndex+1,...s.route),this.relocatedViaCount++,this.committedPushedViaRepairCount++,this.routeCursor=s.startIndex+s.route.length,this.pendingPushedViaRepair=null,this.alternatePushedViaRepairs=[],this.pushedViaRepairRollbackTraces=null,void this.rebuildObstacleIndex()}}}this.pushedViaRepairRollbackTraces&&(this.traces=this.pushedViaRepairRollbackTraces),this.pendingPushedViaRepair=null,this.pushedViaRepairRollbackTraces=null;let n=this.alternatePushedViaRepairs.shift();if(n)return this.rebuildObstacleIndex(),void this.startPushedViaRepair(n);this.alternatePushedViaRepairs=[],this.unresolvedViaCount++,this.rebuildObstacleIndex()}scanNextViaPair(){let e=this.traceIndices[this.traceCursor];if(e===void 0)return this.traceCursor=0,this.routeCursor=0,void(this.phase="scan-pad-clearance");let t=this.traces[e],n=t.route.findIndex((g,f)=>f>=this.routeCursor&&g.route_type==="via");if(n===-1)return void this.advanceTrace();let o=t.route.slice(n+1).findIndex((g)=>g.route_type==="via");if(o===-1)return void this.advanceTrace();let r=n-1,i=n+1+o+1,s=t.route[r],a=t.route[i];if(this.routeCursor=n+1,!lc(s)||!lc(a)||s.layer!==a.layer||Ms(s,a)>this.maxRerouteLength+_r)return;let c=this.createCandidates({kind:"via-pair",traceIndex:e,startIndex:r,endIndex:i}),l=c[0]?.width??Math.max(s.width,a.width),h=c[0]?.padClearance??this.getCandidatePadClearance("via-pair",e,r,i),d=(g)=>{let f=t.route[g];return!!lc(f)&&this.obstacleIndex.findCollisions({start:f,end:f,layer:f.layer,width:l,connectionNames:this.getTraceConnectionNames(t),ignoreTraceIndex:e,ignoreRouteRange:{start:Math.max(0,r-1),end:Math.min(t.route.length-1,i+1)},obstacleClearance:h}).some((y)=>y.kind==="obstacle"&&y.obstacleKind==="pad")},u=t.route[r-1],_=t.route[i+1],p=c.length>0&&d(r)&&lc(u)&&u.layer===s.layer?r-1:r,m=c.length>0&&d(i)&&lc(_)&&_.layer===a.layer?i+1:i,A=[{startIndex:r,endIndex:i},{startIndex:p,endIndex:i},{startIndex:r,endIndex:m},{startIndex:p,endIndex:m}].filter((g,f,y)=>y.findIndex((x)=>x.startIndex===g.startIndex&&x.endIndex===g.endIndex)===f).flatMap((g)=>g.startIndex===r&&g.endIndex===i?c:this.createCandidates({kind:"via-pair",traceIndex:e,startIndex:g.startIndex,endIndex:g.endIndex}));A.length!==0&&this.beginCandidates(A,"scan-via-pairs",!0)}scanNextPadClearance(){let e=this.traceIndices[this.traceCursor];if(e===void 0)return this.traceCursor=0,this.routeCursor=0,void(this.phase="scan-simplification");let t=this.traces[e];if(this.resolveNominalTraceWidth(t)<0.499999)return void this.advanceTrace();let n=this.routeCursor,o=t.route[n],r=t.route[n+1];if(!lc(o)||!lc(r)||o.layer!==r.layer)return void(n>=t.route.length-1?this.advanceTrace():this.routeCursor++);if(this.routeCursor++,!this.segmentHasPadClearanceViolation(e,n))return;let i=this.getPadClearanceIntervals(t,n).flatMap((s)=>this.getImprovedPadClearanceTiers(e,s.startIndex,s.endIndex).flatMap((a)=>this.createCandidates({kind:"pad-clearance",traceIndex:e,startIndex:s.startIndex,endIndex:s.endIndex,padClearance:a}).slice(0,8)));i.length!==0?this.beginCandidates(i.slice(0,72),"scan-pad-clearance",!0):this.unresolvedPadClearanceCount++}segmentHasPadClearanceViolation(e,t){let n=this.traces[e],o=n.route[t],r=n.route[t+1];return!(!lc(o)||!lc(r)||o.layer!==r.layer)&&this.obstacleIndex.findCollisions({start:o,end:r,layer:o.layer,width:Math.max(o.width,r.width),connectionNames:this.getTraceConnectionNames(n),ignoreTraceIndex:e,ignoreRouteRange:{start:Math.max(0,t-1),end:Math.min(n.route.length-1,t+2)},obstacleClearance:this.getPadClearanceForTrace(n)}).some((i)=>i.kind==="obstacle"&&i.obstacleKind==="pad")}getPadClearanceIntervals(e,t){let n=e.route[t];if(!lc(n))return[];let o=[t],r=0;for(let s=t-1;s>=0;s--){let a=e.route[s],c=e.route[s+1];if(!lc(a)||!lc(c)||a.layer!==n.layer||c.layer!==n.layer)break;if(r+=Ms(a,c),r>this.maxRerouteLength/2+_r)break;o.push(s)}let i=[t+1];r=0;for(let s=t+1;s<e.route.length-1;s++){let a=e.route[s],c=e.route[s+1];if(!lc(a)||!lc(c)||a.layer!==n.layer||c.layer!==n.layer)break;if(r+=Ms(a,c),r>this.maxRerouteLength/2+_r)break;i.push(s+1)}return o.flatMap((s)=>i.map((a)=>({startIndex:s,endIndex:a,length:this.measureRouteRange(e,s,a).length}))).filter((s)=>s.length<=this.maxRerouteLength+_r&&s.startIndex<s.endIndex).sort((s,a)=>a.length-s.length).slice(0,8)}scanNextSimplification(){let e=this.traceIndices[this.traceCursor];if(e===void 0)return this.remainingPadClearanceViolationCount=this.countPadClearanceViolations(),this.remainingPadClearanceViolationCountByClearance=this.countPadClearanceViolationsByTier(),void(this.phase="complete");let t=this.traces[e],n=this.routeCursor,o=t.route[n];if(!lc(o)||n>=t.route.length-1)return void(n>=t.route.length-1?this.advanceTrace():this.routeCursor++);let r=0,i=[];for(let a=n+1;a<t.route.length;a++){let c=t.route[a-1],l=t.route[a];if(!lc(c)||!lc(l)||c.layer!==o.layer||l.layer!==o.layer)break;if(r+=Ms(c,l),r>this.maxRerouteLength+_r)break;let h=this.measureRouteRange(t,n,a);(h.nonOctilinearSegmentCount>0||h.pointCount>3)&&i.push(a)}let s=i.slice(-6).reverse().flatMap((a)=>this.createCandidates({kind:"simplification",traceIndex:e,startIndex:n,endIndex:a}));s.length!==0?this.beginCandidates(s,"scan-simplification"):this.routeCursor++}createCandidates({kind:e,traceIndex:t,startIndex:n,endIndex:o,padClearance:r}){let i=this.traces[t],s=i.route[n],a=i.route[o];if(!lc(s)||!lc(a)||s.layer!==a.layer)return[];let c=this.resolveNominalTraceWidth(i),l=this.measureRouteRange(i,n,o),h=r??this.getCandidatePadClearance(e,t,n,o),d=[],u=Tan(s,a);if(e==="pad-clearance"&&Aje([s,a])===0){let p=Ms(s,a);if(p>_r){let m={x:-(a.y-s.y)/p,y:(a.x-s.x)/p};for(let A of[0.25,0.5,0.75,1,1.5,2])for(let g of[-1,1])u.push([s,{x:s.x+m.x*A*g,y:s.y+m.y*A*g},{x:a.x+m.x*A*g,y:a.y+m.y*A*g},a])}}let _=new Map(u.map((p)=>[p.map((m)=>`${m.x.toFixed(6)},${m.y.toFixed(6)}`).join(";"),p]));for(let p of _.values()){let m=Ile(p);if(m>this.maxRerouteLength+_r||e==="pad-clearance"&&m>1.35*l.length+0.5||e==="simplification"&&(m>1.1*l.length+_r||this.measureTraceLength(i)-l.length+m>1.01*(this.initialTraceLengths.get(t)??this.measureTraceLength(i))+_r))continue;let A=m<=_r?c:c-l.deficitArea/m;if(A>c+_r)continue;let g=0.05*Math.ceil(Math.max(this.inputProblem.simpleRouteJson.minTraceWidth,A)/0.05-_r),f=n$([c,Math.min(c,g),Math.min(c,Math.max(this.inputProblem.simpleRouteJson.minTraceWidth,A))].map((y)=>Math.max(y,s.width)));for(let y of f){let x=this.measureCandidate(p,y,c,a.width,s.width);x.deficitArea>l.deficitArea+_r||x.conservativeDeficitArea>l.conservativeDeficitArea+_r||!this.preservesCoverage(x,l)||(e!=="simplification"||l.nonOctilinearSegmentCount!==0||x.pointCount<l.pointCount&&x.length<l.length-_r)&&d.push({kind:e,traceIndex:t,startIndex:n,endIndex:o,layer:s.layer,points:p,width:y,padClearance:h,originalQuality:l})}}return d.slice(0,18)}beginCandidates(e,t,n=!1){this.candidates=e,this.candidateCursor=0,this.clearanceTierCursor=0,this.candidateShoveCount=0,this.rollbackTraces=null,this.baseCandidateValidated=!1,this.resumePhase=t,this.candidateSetMayUseGridFallback=n,this.phase="evaluate-candidate"}evaluateCurrentCandidate(){let e=this.candidates[this.candidateCursor];if(!e)return void this.finishCandidateSet(!1);if(!this.baseCandidateValidated){if(!this.candidateCollides(e,0))return this.candidateShoveCount>0?void this.applyCandidate(e,0):(this.baseCandidateValidated=!0,void(this.clearanceTierCursor=0));return this.getPushableTraceIndices(e,0)&&this.candidateShoveCount<2&&this.attemptedClearanceShoveCount<48?void this.startClearanceShove(e,0):void this.advanceCandidate()}let t=this.clearancePaddingTiers[this.clearanceTierCursor];if(t===void 0||t<=_r)return void this.applyCandidate(e,0);if(this.attemptedCandidateCount++,!this.candidateCollides(e,t))return void this.applyCandidate(e,t);this.getPushableTraceIndices(e,t)&&this.candidateShoveCount<2&&this.attemptedClearanceShoveCount<48?this.startClearanceShove(e,t):(this.rollbackCandidateShoves(),this.clearanceTierCursor++,this.candidateShoveCount=0)}advanceCandidate(){this.rollbackCandidateShoves(),this.candidateCursor++,this.clearanceTierCursor=0,this.candidateShoveCount=0,this.baseCandidateValidated=!1}candidateCollides(e,t){let n=this.traces[e.traceIndex],o=this.getTraceConnectionNames(n);for(let r=0;r<e.points.length-1;r++){let i=this.getCandidateSegmentWidth(e,r);if(this.obstacleIndex.collides({start:e.points[r],end:e.points[r+1],layer:e.layer,width:i+2*t,connectionNames:o,ignoreTraceIndex:e.traceIndex,ignoreRouteRange:{start:Math.max(0,e.startIndex-1),end:Math.min(n.route.length-1,e.endIndex+1)},obstacleClearance:e.padClearance}))return!0}return!1}getPushableTraceIndices(e,t){let n=this.traces[e.traceIndex],o=this.getTraceConnectionNames(n),r=new Set;for(let i=0;i<e.points.length-1;i++){let s=this.getCandidateSegmentWidth(e,i),a={start:e.points[i],end:e.points[i+1],layer:e.layer,width:s+2*t,connectionNames:o,ignoreTraceIndex:e.traceIndex,ignoreRouteRange:{start:Math.max(0,e.startIndex-1),end:Math.min(n.route.length-1,e.endIndex+1)},obstacleClearance:e.padClearance};if(!this.obstacleIndex.collides(a))continue;let c=this.obstacleIndex.findCollisions(a);if(c.length===0)return null;for(let l of c){if(l.kind!=="trace"||l.traceIndex===void 0||l.traceIndex===e.traceIndex||!this.mutableTraceIndexSet.has(l.traceIndex))return null;let h=this.traces[l.traceIndex];if(!h||this.resolveNominalTraceWidth(h)>=e.width-_r)return null;r.add(l.traceIndex)}}return r.size>0&&r.size<=2?[...r]:null}startClearanceShove(e,t){this.rollbackTraces??=structuredClone(this.traces),this.activeShovePadding=t;let n=e.width+2*t,o=e.points.slice(0,-1).map((r,i)=>({start:r,end:e.points[i+1],layer:e.layer,width:this.getCandidateSegmentWidth(e,i)+2*t}));this.attemptedClearanceShoveCount++,this.activeSubSolver=new q$({simpleRouteJson:this.inputProblem.simpleRouteJson,traces:this.traces,powerTraceIndex:e.traceIndex,nominalPowerWidth:n,pushOnlyNominalWidthsBelow:e.width,mutableTraceIndices:this.mutableTraceIndices,corridor:o,maxRerouteLength:this.maxRerouteLength},this.connectionNameResolver),this.phase="shove-clearance"}getCandidateSegmentWidth(e,t){let n=this.traces[e.traceIndex],o=n.route[e.startIndex],r=n.route[e.endIndex],i=t===0&&lc(o)?o.width:e.width,s=t===e.points.length-2&&lc(r)?r.width:e.width;return Math.max(i,s)}stepActiveShoveSolver(){let e=this.activeSubSolver;if(e.step(),e.solved||e.failed)if(this.pendingPushedViaRepair&&e instanceof q$)this.finishPushedViaRepairSolver(e);else if(e instanceof obe)this.finishViaGridSolver(e);else{if(this.activeSubSolver=null,this.phase="evaluate-candidate",e.solved){let t=e.getOutput();if(t)return this.traces=t.traces,this.candidateShoveCount++,void this.rebuildObstacleIndex()}this.failedSubSolvers??=[],this.failedSubSolvers.push(e),this.rollbackCandidateShoves(),this.activeShovePadding<=_r?this.advanceCandidate():this.clearanceTierCursor++,this.candidateShoveCount=0}}rollbackCandidateShoves(){this.rollbackTraces&&(this.traces=this.rollbackTraces,this.rollbackTraces=null,this.rebuildObstacleIndex())}applyCandidate(e,t){let n=this.traces[e.traceIndex],o=n.route[e.startIndex],r=n.route[e.endIndex],i=e.points.map((c,l)=>({...l===0?o:l===e.points.length-1?r:{route_type:"wire",layer:e.layer,width:e.width},x:c.x,y:c.y,layer:e.layer,width:l===0?o.width:l===e.points.length-1?r.width:e.width})),s=n.route.slice(e.startIndex,e.endIndex+1),a=e.originalQuality.nonOctilinearSegmentCount;if(n.route.splice(e.startIndex,e.endIndex-e.startIndex+1,...i),e.kind==="via-pair"){let c=s.filter((l)=>l.route_type==="via").length;this.viaPairCountRemoved++,this.viaCountRemoved+=c,this.routeCursor=Math.max(0,e.startIndex-1)}else e.kind==="pad-clearance"?(this.padClearanceRerouteCount++,this.routeCursor=e.startIndex+Math.max(1,i.length-1)):(this.simplifiedPathCount++,this.normalizedSegmentCount+=a,this.routeCursor=e.startIndex+Math.max(1,i.length-1));this.committedClearanceShoveCount+=this.candidateShoveCount,t>_r&&this.achievedExtraClearanceCount++,this.rollbackTraces=null,this.candidateShoveCount=0,this.rebuildObstacleIndex(),this.finishCandidateSet(!0)}finishCandidateSet(e){let t=this.candidates[0],n=n$(this.candidates.filter((r)=>r.kind===t?.kind).map((r)=>r.width)),o=n$(this.candidates.filter((r)=>r.kind===t?.kind&&r.traceIndex===t.traceIndex&&r.startIndex===t.startIndex&&r.endIndex===t.endIndex).map((r)=>r.padClearance));if(this.rollbackCandidateShoves(),this.candidates=[],this.candidateCursor=0,this.clearanceTierCursor=0,this.candidateShoveCount=0,this.baseCandidateValidated=!1,!e&&this.candidateSetMayUseGridFallback&&t)return this.candidateSetMayUseGridFallback=!1,void this.beginViaGridAttempt(t,n,o);this.candidateSetMayUseGridFallback=!1,e||this.routeCursor++,this.phase=this.resumePhase}beginViaGridAttempt(e,t,n=[e.padClearance]){this.viaGridAttempt={kind:e.kind,traceIndex:e.traceIndex,startIndex:e.startIndex,endIndex:e.endIndex,layer:e.layer,padClearances:n,padClearanceCursor:0,originalQuality:e.originalQuality,widths:t,widthCursor:0,gridSizes:[],gridSizeCursor:0,offsetCursor:0},this.phase="route-via-pair"}startNextViaGridCandidate(){let e=this.viaGridAttempt;if(!e)return void(this.phase=this.resumePhase);if(e.padClearanceCursor>=e.padClearances.length)return e.kind==="pad-clearance"&&this.unresolvedPadClearanceCount++,this.viaGridAttempt=null,this.routeCursor++,void(this.phase=this.resumePhase);if(e.widthCursor>=e.widths.length)return e.padClearanceCursor++,e.widthCursor=0,e.gridSizes=[],e.gridSizeCursor=0,void(e.offsetCursor=0);let t=e.widths[e.widthCursor],n=e.padClearances[e.padClearanceCursor];if(e.gridSizes.length===0&&(e.gridSizes=n$([J0(t/2,0.2,0.4),J0(t/3,0.15,0.25)])),e.gridSizeCursor>=e.gridSizes.length)return e.widthCursor++,e.gridSizes=[],e.gridSizeCursor=0,void(e.offsetCursor=0);if(e.offsetCursor>=aGt.length)return e.gridSizeCursor++,void(e.offsetCursor=0);let o=this.traces[e.traceIndex],r=o.route[e.startIndex],i=o.route[e.endIndex];if(!lc(r)||!lc(i))return this.viaGridAttempt=null,this.routeCursor++,void(this.phase=this.resumePhase);let s=e.gridSizes[e.gridSizeCursor],a=aGt[e.offsetCursor];this.attemptedViaGridCount++,this.activeSubSolver=new obe({start:r,end:i,layer:e.layer,traceWidth:t,gridSize:s,gridOffset:{x:a.x*s,y:a.y*s},connectionNames:this.getTraceConnectionNames(o),obstacleIndex:this.obstacleIndex,ignoreTraceIndex:e.traceIndex,ignoreRouteRange:{start:Math.max(0,e.startIndex-1),end:Math.min(o.route.length-1,e.endIndex+1)},bounds:this.inputProblem.simpleRouteJson.bounds,obstacleClearance:n,searchPadding:Math.min(4,Math.max(2,Ms(r,i)/2,3*t)),requireOctilinear:!0})}finishViaGridSolver(e){let t=this.viaGridAttempt;if(this.activeSubSolver=null,e.solved&&t){let n=e.getOutput(),o=this.traces[t.traceIndex];if(n&&o){let r=this.resolveNominalTraceWidth(o),i=this.measureCandidate(n.points,n.traceWidth,r,o.route[t.endIndex].width,o.route[t.startIndex].width);if(i.nonOctilinearSegmentCount===0&&i.length<=this.maxRerouteLength+_r&&i.deficitArea<=t.originalQuality.deficitArea+_r&&i.conservativeDeficitArea<=t.originalQuality.conservativeDeficitArea+_r&&this.preservesCoverage(i,t.originalQuality)){let s={kind:t.kind,traceIndex:t.traceIndex,startIndex:t.startIndex,endIndex:t.endIndex,layer:t.layer,points:n.points,width:n.traceWidth,padClearance:t.padClearances[t.padClearanceCursor],originalQuality:t.originalQuality};return this.viaGridAttempt=null,void this.beginCandidates([s],this.resumePhase,!1)}}}e.failed&&(this.failedSubSolvers??=[],this.failedSubSolvers.push(e)),t&&t.offsetCursor++,this.phase="route-via-pair"}measureRouteRange(e,t,n){let o=this.resolveNominalTraceWidth(e),r=0,i=0,s=0,a=0,c=0,l=0,h=0;for(let d=t;d<=n;d++){if(lc(e.route[d])&&h++,d>=n)continue;let u=e.route[d],_=e.route[d+1];if(!lc(u)||!lc(_)||u.layer!==_.layer)continue;let p=Ms(u,_);r+=p,i+=p*Math.max(0,o-u.width),u.width>=o-_r&&(a+=p),s+=p*Math.max(0,o-Math.min(u.width,_.width)),Math.min(u.width,_.width)>=o-_r&&(c+=p),l+=Aje([u,_])}return{length:r,deficitArea:i,conservativeDeficitArea:s,nominalLength:a,conservativeNominalLength:c,nonOctilinearSegmentCount:l,pointCount:h}}measureTraceLength(e){let t=0;for(let n=0;n<e.route.length-1;n++){let o=e.route[n],r=e.route[n+1];lc(o)&&lc(r)&&o.layer===r.layer&&(t+=Ms(o,r))}return t}measureCandidate(e,t,n,o=t,r=t){let i=Ile(e),s=0,a=0,c=0,l=0;for(let h=0;h<e.length-1;h++){let d=Ms(e[h],e[h+1]),u=h===0?r:t,_=h===e.length-2?o:t,p=Math.min(u,_);s+=d*Math.max(0,n-u),a+=d*Math.max(0,n-p),u>=n-_r&&(c+=d),p>=n-_r&&(l+=d)}return{length:i,deficitArea:s,conservativeDeficitArea:a,nominalLength:c,conservativeNominalLength:l,nonOctilinearSegmentCount:Aje(e),pointCount:e.length}}preservesCoverage(e,t){let n=t.length<=_r?1:t.nominalLength/t.length,o=e.length<=_r?1:e.nominalLength/e.length,r=t.length<=_r?1:t.conservativeNominalLength/t.length,i=e.length<=_r?1:e.conservativeNominalLength/e.length;return!(o+_r<n||i+_r<r)&&!(e.length>t.length+_r&&o<0.999999)}advanceTrace(){this.traceCursor++,this.routeCursor=0,this.rebuildObstacleIndex()}createObstacleIndex(){return new c6(this.inputProblem.simpleRouteJson,this.traces,this.phase==="repair-vias"?void 0:this.traceIndices?.[this.traceCursor],[],this.connectionNameResolver)}rebuildObstacleIndex(){this.obstacleIndex=this.createObstacleIndex()}resolveNominalTraceWidth(e){let t=this.findConnectionForTrace(e);return Math.max(t?.nominalTraceWidth??t?.width??this.inputProblem.simpleRouteJson.nominalTraceWidth??this.inputProblem.simpleRouteJson.minTraceWidth,this.inputProblem.simpleRouteJson.minTraceWidth)}getPadClearanceForTrace(e){let t=this.getBaseObstacleClearance();return this.resolveNominalTraceWidth(e)>=0.499999?Math.max(t,this.desiredPadClearance??this.resolveNominalTraceWidth(e)/2):t}getBaseObstacleClearance(){return Math.max(this.inputProblem.simpleRouteJson.defaultObstacleMargin??0,this.inputProblem.simpleRouteJson.minTraceToPadEdgeClearance??0,0.1)}getCandidatePadClearance(e,t,n,o){let r=this.traces[t],i=this.getBaseObstacleClearance(),s=this.getPadClearanceForTrace(r);if(e==="pad-clearance")return s;let a=e==="via-pair"?Math.min(s,Math.max(i,0.15)):s;return this.findExistingPadClearance(t,n,o,i,a)}getImprovedPadClearanceTiers(e,t,n){let o=this.traces[e],r=this.getBaseObstacleClearance(),i=this.getPadClearanceForTrace(o),s=this.findExistingPadClearance(e,t,n,r,i),a=Math.max(0.025,Math.min(0.05,i/10)),c=[i];for(let l=i-a;l>s+a/2;l-=a)c.push(l);return n$(c).filter((l)=>l>s+_r)}findExistingPadClearance(e,t,n,o,r){if(this.routeRangeHasPadClearanceViolation(e,t,n,o))return o;if(!this.routeRangeHasPadClearanceViolation(e,t,n,r))return r;let i=o,s=r;for(let a=0;a<7;a++){let c=(i+s)/2;this.routeRangeHasPadClearanceViolation(e,t,n,c)?s=c:i=c}return Math.max(o,Number((i-0.001).toFixed(6)))}routeRangeHasPadClearanceViolation(e,t,n,o){let r=this.traces[e],i=this.getTraceConnectionNames(r);for(let s=t;s<n;s++){let a=r.route[s],c=r.route[s+1];if(!lc(a)||!lc(c)||a.layer!==c.layer)continue;if(this.obstacleIndex.findCollisions({start:a,end:c,layer:a.layer,width:Math.max(a.width,c.width),connectionNames:i,ignoreTraceIndex:e,ignoreRouteRange:{start:Math.max(0,t-1),end:Math.min(r.route.length-1,n+1)},obstacleClearance:o}).some((l)=>l.kind==="obstacle"&&l.obstacleKind==="pad"))return!0}return!1}countPadClearanceViolations(e){let t=0;for(let n of this.traceIndices){let o=this.traces[n];if(!o)continue;let r=this.getTraceConnectionNames(o);for(let i=0;i<o.route.length-1;i++){let s=o.route[i],a=o.route[i+1];if(!lc(s)||!lc(a)||s.layer!==a.layer)continue;this.obstacleIndex.findCollisions({start:s,end:a,layer:s.layer,width:Math.max(s.width,a.width),connectionNames:r,ignoreTraceIndex:n,ignoreRouteRange:{start:Math.max(0,i-1),end:Math.min(o.route.length-1,i+2)},obstacleClearance:e??this.getPadClearanceForTrace(o)}).some((c)=>c.kind==="obstacle"&&c.obstacleKind==="pad")&&t++}}return t}countPadClearanceViolationsByTier(){return Object.fromEntries(c6r.map((e)=>[e.toFixed(2),this.countPadClearanceViolations(e)]))}findConnectionForTrace(e){let t=this.connectionByTraceId.get(e.pcb_trace_id);if(t!==void 0)return t??void 0;let n=new Set(this.connectionNameResolver.canonicalize(this.getTraceConnectionNames(e))),o=this.inputProblem.simpleRouteJson.connections.find((r)=>this.connectionNameResolver.canonicalize(this.getConnectionNames(r)).some((i)=>n.has(i)))??null;return this.connectionByTraceId.set(e.pcb_trace_id,o),o??void 0}getConnectionNames(e){return[e.name,e.source_trace_id,e.rootConnectionName,e.netConnectionName,...e.mergedConnectionNames??[]].filter((t)=>Boolean(t))}getTraceConnectionNames(e){return[e.pcb_trace_id,e.connection_name,e.source_trace_id,e.rootConnectionName,...e.mergedConnectionNames??[],...e.connectsTo??[]].filter((t)=>Boolean(t))}ensureConnectivitySafeOutput(){if(!this.connectivityFinalized){this.connectivityFinalized=!0,this.connectivityValidationCount++;try{let e=this.connectivityInvariant.validate(this.traces);if(this.connectivityValidationError??=e.validationError??null,e.safe)return void(this.finalizedMutatedTraceIndices=this.getMutatedTraceIndices());this.connectivityRegressionEndpointIds=[...new Set(e.regressions.flatMap((t)=>t.baselineEndpointLabels))]}catch(e){this.connectivityValidationError=e instanceof Error?e.message:String(e)}this.connectivityRollbackCount++,this.connectivityRollbackMutationStats={committedClearanceShoveCount:this.committedClearanceShoveCount,viaPairCountRemoved:this.viaPairCountRemoved,viaCountRemoved:this.viaCountRemoved,simplifiedPathCount:this.simplifiedPathCount,normalizedSegmentCount:this.normalizedSegmentCount,achievedExtraClearanceCount:this.achievedExtraClearanceCount,relocatedViaCount:this.relocatedViaCount,committedPushedViaRepairCount:this.committedPushedViaRepairCount,padClearanceRerouteCount:this.padClearanceRerouteCount},this.committedClearanceShoveCount=0,this.viaPairCountRemoved=0,this.viaCountRemoved=0,this.simplifiedPathCount=0,this.normalizedSegmentCount=0,this.achievedExtraClearanceCount=0,this.relocatedViaCount=0,this.committedPushedViaRepairCount=0,this.padClearanceRerouteCount=0,this.traces=structuredClone(this.initialConnectivitySafeTraces),this.obstacleIndex=new c6(this.inputProblem.simpleRouteJson,this.traces,void 0,[],this.connectionNameResolver),this.remainingPadClearanceViolationCount=this.countPadClearanceViolations(),this.remainingPadClearanceViolationCountByClearance=this.countPadClearanceViolationsByTier(),this.finalizedMutatedTraceIndices=this.getMutatedTraceIndices()}}getMutatedTraceIndices(){let e=Math.max(this.initialConnectivitySafeTraces.length,this.traces.length);return Array.from({length:e},(t,n)=>n).filter((t)=>JSON.stringify(this.initialConnectivitySafeTraces[t])!==JSON.stringify(this.traces[t]))}createStats(){let e=this.candidates[this.candidateCursor],t=this.phase==="repair-vias"?this.viaRepairTraceIndices:this.traceIndices;return{phase:this.phase,budgetLimited:this.budgetLimited,completionReason:this.phase==="complete"||this.solved?this.connectivityRollbackCount>0?"connectivity_rollback":this.budgetLimited?"iteration_budget":this.connectivityValidationError?"connectivity_validation_unavailable":"completed":null,resultStatus:this.connectivityRollbackCount>0||this.budgetLimited||this.connectivityValidationError!==null?"best_effort":"complete",traceCursor:this.traceCursor,traceCount:t.length,traceIndex:t[this.traceCursor],routeCursor:this.routeCursor,candidateCursor:this.candidateCursor,candidateCount:this.candidates.length,candidateKind:e?.kind,candidateWidth:e?.width,candidatePointCount:e?.points.length,clearancePadding:this.clearancePaddingTiers[this.clearanceTierCursor],candidateShoveCount:this.candidateShoveCount,attemptedCandidateCount:this.attemptedCandidateCount,attemptedClearanceShoveCount:this.attemptedClearanceShoveCount,attemptedViaGridCount:this.attemptedViaGridCount,committedClearanceShoveCount:this.committedClearanceShoveCount,viaPairCountRemoved:this.viaPairCountRemoved,viaCountRemoved:this.viaCountRemoved,simplifiedPathCount:this.simplifiedPathCount,normalizedSegmentCount:this.normalizedSegmentCount,achievedExtraClearanceCount:this.achievedExtraClearanceCount,relocatedViaCount:this.relocatedViaCount,unresolvedViaCount:this.unresolvedViaCount,attemptedPushedViaRepairCount:this.attemptedPushedViaRepairCount,committedPushedViaRepairCount:this.committedPushedViaRepairCount,padClearanceRerouteCount:this.padClearanceRerouteCount,unresolvedPadClearanceCount:this.unresolvedPadClearanceCount,initialPadClearanceViolationCount:this.initialPadClearanceViolationCount,remainingPadClearanceViolationCount:this.remainingPadClearanceViolationCount,initialPadClearanceViolationCountByClearance:{...this.initialPadClearanceViolationCountByClearance},remainingPadClearanceViolationCountByClearance:{...this.remainingPadClearanceViolationCountByClearance},connectivityValidationCount:this.connectivityValidationCount,connectivityRollbackCount:this.connectivityRollbackCount,connectivityRegressionEndpointIds:[...this.connectivityRegressionEndpointIds],connectivityValidationError:this.connectivityValidationError,connectivityRollbackMutationStats:this.connectivityRollbackMutationStats===null?null:{...this.connectivityRollbackMutationStats},mutatedTraceIndices:[...this.finalizedMutatedTraceIndices],spatialIndexRectCount:this.obstacleIndex.items.length}}computeProgress(){if(this.solved||this.phase==="complete")return 1;let e=this.phase==="repair-vias"?this.viaRepairTraceIndices:this.traceIndices;if(e.length===0)return 1;let t=this.resumePhase==="scan-via-pairs"?0:0.5;return Math.min(0.99,t+this.traceCursor/e.length*0.5)}getConstructorParams(){return[this.inputProblem]}tryFinalAcceptance(){let e=this.pushedViaRepairRollbackTraces??this.rollbackTraces;e&&(this.traces=e),this.activeSubSolver=null,this.rollbackTraces=null,this.pushedViaRepairRollbackTraces=null,this.pendingPushedViaRepair=null,this.alternatePushedViaRepairs=[],this.viaGridAttempt=null,this.candidates=[],this.candidateCursor=0,this.clearanceTierCursor=0,this.candidateShoveCount=0,this.baseCandidateValidated=!1,this.candidateSetMayUseGridFallback=!1,this.ensureConnectivitySafeOutput(),this.obstacleIndex=new c6(this.inputProblem.simpleRouteJson,this.traces,void 0,[],this.connectionNameResolver),this.remainingPadClearanceViolationCount=this.countPadClearanceViolations(),this.remainingPadClearanceViolationCountByClearance=this.countPadClearanceViolationsByTier(),this.budgetLimited=!0,this.phase="complete",this.solved=!0,this.progress=1,this.stats=this.createStats()}getOutput(){return structuredClone(this.solved?this.traces:this.initialConnectivitySafeTraces)}visualize(){let e=[],t=[],n=this.candidates[this.candidateCursor];for(let o=0;o<this.traces.length;o++){let r=this.traces[o];for(let i of r.route)i.route_type==="via"&&t.push({center:i,radius:(i.via_diameter??0.6)/2,fill:"#d4a017",stroke:"#7a5700"});for(let i=0;i<r.route.length-1;i++){let s=r.route[i],a=r.route[i+1];lc(s)&&lc(a)&&s.layer===a.layer&&e.push({points:[s,a],strokeColor:s.layer==="bottom"?"#376fc4":"#777",strokeWidth:s.width})}}if(n)for(let o=0;o<n.points.length-1;o++)e.push({points:[n.points[o],n.points[o+1]],strokeColor:"#ff7400",strokeWidth:n.width+2*(this.clearancePaddingTiers[this.clearanceTierCursor]??0)});return{coordinateSystem:"cartesian",title:`Power trace cleanup: ${this.phase}`,lines:e,points:[],circles:t,rects:[],texts:[]}}},$9=(e)=>e?.route_type==="wire",xje=class extends _Y{inputProblem;traces;obstacleIndex;traceCursor=0;routeCursor=0;repairedSegmentCount=0;repairedPadNeckSegmentCount=0;unresolvedSegmentCount=0;totalWidthReduction=0;budgetLimited=!1;connectivityValidationCount=0;connectivityRollbackCount=0;connectivityRegressionEndpointIds=[];connectivityValidationError=null;connectivityRollbackMutationStats=null;connectionNameResolver;nominalWidthByTraceId=new Map;connectivityInvariant;initialConnectivitySafeTraces;minimumTraceWidth;traceIndices;connectivityFinalized=!1;constructor(e){super(),this.inputProblem=structuredClone(e),this.traces=structuredClone(e.traces),this.initialConnectivitySafeTraces=structuredClone(e.traces),this.connectivityInvariant=new sbe(this.inputProblem.simpleRouteJson,this.initialConnectivitySafeTraces),this.connectionNameResolver=new xB(e.simpleRouteJson,this.traces),this.minimumTraceWidth=e.simpleRouteJson.minTraceWidth;let t=e.traceIndices?[...new Set(e.traceIndices)]:this.traces.map((o,r)=>r);for(let o of t)if(!Number.isInteger(o)||o<0||o>=this.traces.length)throw RangeError(`Invalid clearance-repair trace index: ${o}`);this.traceIndices=t,this.obstacleIndex=this.createConservativeObstacleIndex();let n=this.traceIndices.reduce((o,r)=>o+Math.max(0,this.traces[r].route.length-1),0);this.MAX_ITERATIONS=Math.max(10,8*n+2*this.traceIndices.length),this.stats=this.createStats()}getSolverName(){return"PowerTraceClearanceRepairSolver"}_step(){let e=this.traceIndices[this.traceCursor],t=e===void 0?void 0:this.traces[e];if(!t)return this.ensureConnectivitySafeOutput(),this.solved=!0,void(this.stats=this.createStats());if(this.routeCursor>=t.route.length-1)return this.traceCursor++,this.routeCursor=0,void(this.stats=this.createStats());let n=this.routeCursor++,o=t.route[n],r=t.route[n+1];if(!$9(o)||!$9(r)||o.layer!==r.layer)return void(this.stats=this.createStats());let i=Math.max(o.width,r.width),s={start:o,end:r,layer:o.layer,width:i,connectionNames:this.getTraceConnectionNames(t),ignoreTraceIndex:e,ignoreRouteRange:{start:n,end:n+1}};if(this.repairConnectedPadNeck(t,n,s))return void(this.stats=this.createStats());if(!this.segmentHasForeignTraceCollision(n,i))return void(this.stats=this.createStats());if(this.segmentHasForeignTraceCollision(n,this.minimumTraceWidth))return this.unresolvedSegmentCount++,void(this.stats=this.createStats());let a=this.minimumTraceWidth,c=i;for(let m=0;m<10;m++){let A=(a+c)/2;this.segmentHasForeignTraceCollision(n,A)?c=A:a=A}let l=i>=0.5?0.025:0.0125,h=Math.max(this.minimumTraceWidth,Math.floor((a+_r)/l)*l),d=this.segmentHasForeignTraceCollision(n,h)?a:h,u=o.width,_=r.width;o.width=Math.min(o.width,d),r.width=Math.min(r.width,d);let p=u-o.width+(_-r.width);if(p<=_r)return this.unresolvedSegmentCount++,void(this.stats=this.createStats());this.repairedSegmentCount++,this.totalWidthReduction+=p,this.obstacleIndex=this.createConservativeObstacleIndex(),this.routeCursor=Math.max(0,n-1),this.stats=this.createStats()}repairConnectedPadNeck(e,t,n){let o=e.route[t],r=e.route[t+1];if(!$9(o)||!$9(r))return!1;let i=this.obstacleIndex.getConnectedPadWidthLimitAtPoint(n,o),s=this.obstacleIndex.getConnectedPadWidthLimitAtPoint(n,r);t===0&&(i=this.getSmallerLimit(i,this.obstacleIndex.getConnectedPadEndpointWidthLimitAtPoint(n,o))),t+1===e.route.length-1&&(s=this.getSmallerLimit(s,this.obstacleIndex.getConnectedPadEndpointWidthLimitAtPoint(n,r)));let a=i,c=s;if((a===null||o.width<=a+_r)&&(c===null||r.width<=c+_r))return!1;let l=o.width,h=r.width;if(a!==null&&(o.width=Math.min(o.width,a)),c!==null&&(r.width=Math.min(r.width,c)),a!==null&&c===null)this.insertPadBoundaryTransition(e,t,n,"start",o.width,h);else if(a===null&&c!==null)this.insertPadBoundaryTransition(e,t,n,"end",r.width,l);else if(a!==null&&c!==null){let d=this.obstacleIndex.getConnectedPadBoundaryPoint(n,"start"),u=this.obstacleIndex.getConnectedPadBoundaryPoint(n,"end");d&&u&&(this.insertPadBoundaryTransition(e,t,n,"start",o.width,h),this.insertPadBoundaryTransition(e,t+2,n,"end",r.width,l))}return this.totalWidthReduction+=l-o.width+(h-r.width),this.repairedPadNeckSegmentCount++,this.obstacleIndex=this.createConservativeObstacleIndex(),this.routeCursor=Math.max(0,t-1),!0}getSmallerLimit(e,t){return e===null?t:t===null?e:Math.min(e,t)}insertPadBoundaryTransition(e,t,n,o,r,i){let s=this.obstacleIndex.getConnectedPadBoundaryPoint(n,o);if(!s)return;let a=o==="start"?n.start:n.end,c=o==="start"?n.end:n.start,l=Math.hypot(c.x-a.x,c.y-a.y);if(l<=0.000000001)return;let h=Math.min(0.000001,l/4),d=(c.x-a.x)/l,u=(c.y-a.y)/l,_={route_type:"wire",x:s.x-d*h,y:s.y-u*h,width:r,layer:n.layer},p={..._,x:s.x+d*h,y:s.y+u*h,width:i},m=o==="start"?e.route[t+1]:e.route[t],A=o==="start"?e.route[t+2]:e.route[t-1];if($9(m)&&A?.route_type==="via"){let g=this.resolveNominalTraceWidth(e);this.obstacleIndex.collides({...n,start:m,end:p,width:g})||(m.width=Math.max(m.width,g),p.width=m.width)}e.route.splice(t+1,0,...o==="start"?[_,p]:[p,_])}resolveNominalTraceWidth(e){let t=this.nominalWidthByTraceId.get(e.pcb_trace_id);if(t!==void 0)return t;let n=new Set(this.connectionNameResolver.canonicalize(this.getTraceConnectionNames(e))),o=this.inputProblem.simpleRouteJson.connections.find((i)=>this.connectionNameResolver.canonicalize([i.name,i.source_trace_id,i.rootConnectionName,i.netConnectionName,...i.mergedConnectionNames??[]].filter((s)=>Boolean(s))).some((s)=>n.has(s))),r=Math.max(o?.nominalTraceWidth??o?.width??this.inputProblem.simpleRouteJson.nominalTraceWidth??this.minimumTraceWidth,this.minimumTraceWidth);return this.nominalWidthByTraceId.set(e.pcb_trace_id,r),r}segmentHasForeignTraceCollision(e,t){let n=this.traceIndices[this.traceCursor],o=n===void 0?void 0:this.traces[n],r=o?.route[e],i=o?.route[e+1];return!!(o&&$9(r)&&$9(i)&&r.layer===i.layer)&&this.obstacleIndex.findCollisions({start:r,end:i,layer:r.layer,width:t,connectionNames:this.getTraceConnectionNames(o),ignoreTraceIndex:n,ignoreRouteRange:{start:e,end:e+1}}).some((s)=>s.kind==="trace"&&s.traceIndex!==void 0&&s.traceIndex!==n)}createConservativeObstacleIndex(){let e=structuredClone(this.traces);for(let t of e)for(let n=0;n<t.route.length-1;n++){let o=t.route[n],r=t.route[n+1];$9(o)&&$9(r)&&o.layer===r.layer&&(o.width=Math.max(o.width,r.width))}return new c6(this.inputProblem.simpleRouteJson,e,void 0,[],this.connectionNameResolver)}getTraceConnectionNames(e){return[e.pcb_trace_id,e.connection_name,e.source_trace_id,e.rootConnectionName,...e.mergedConnectionNames??[],...e.connectsTo??[]].filter((t)=>Boolean(t))}ensureConnectivitySafeOutput(){if(!this.connectivityFinalized){this.connectivityFinalized=!0,this.connectivityValidationCount++;try{let e=this.connectivityInvariant.validate(this.traces);if(this.connectivityValidationError??=e.validationError??null,e.safe)return;this.connectivityRegressionEndpointIds=[...new Set(e.regressions.flatMap((t)=>t.baselineEndpointLabels))]}catch(e){this.connectivityValidationError=e instanceof Error?e.message:String(e)}this.connectivityRollbackCount++,this.connectivityRollbackMutationStats={repairedSegmentCount:this.repairedSegmentCount,repairedPadNeckSegmentCount:this.repairedPadNeckSegmentCount,totalWidthReduction:this.totalWidthReduction},this.repairedSegmentCount=0,this.repairedPadNeckSegmentCount=0,this.totalWidthReduction=0,this.traces=structuredClone(this.initialConnectivitySafeTraces),this.obstacleIndex=this.createConservativeObstacleIndex()}}createStats(){return{phase:this.solved?"complete":"repair-trace-clearance",budgetLimited:this.budgetLimited,completionReason:this.solved?this.connectivityRollbackCount>0?"connectivity_rollback":this.budgetLimited?"iteration_budget":this.connectivityValidationError?"connectivity_validation_unavailable":"completed":null,resultStatus:this.connectivityRollbackCount>0||this.budgetLimited||this.connectivityValidationError!==null?"best_effort":"complete",traceCursor:this.traceCursor,traceCount:this.traceIndices.length,traceIndex:this.traceIndices[this.traceCursor],routeCursor:this.routeCursor,repairedSegmentCount:this.repairedSegmentCount,repairedPadNeckSegmentCount:this.repairedPadNeckSegmentCount,unresolvedSegmentCount:this.unresolvedSegmentCount,totalWidthReduction:this.totalWidthReduction,connectivityValidationCount:this.connectivityValidationCount,connectivityRollbackCount:this.connectivityRollbackCount,connectivityRegressionEndpointIds:[...this.connectivityRegressionEndpointIds],connectivityValidationError:this.connectivityValidationError,connectivityRollbackMutationStats:this.connectivityRollbackMutationStats===null?null:{...this.connectivityRollbackMutationStats},spatialIndexRectCount:this.obstacleIndex.items.length}}computeProgress(){return this.solved||this.traceIndices.length===0?1:Math.min(0.99,this.traceCursor/this.traceIndices.length)}tryFinalAcceptance(){this.ensureConnectivitySafeOutput(),this.budgetLimited=!0,this.solved=!0,this.progress=1,this.stats=this.createStats()}getConstructorParams(){return[this.inputProblem]}getOutput(){return structuredClone(this.solved?this.traces:this.initialConnectivitySafeTraces)}visualize(){let e=[];for(let t=0;t<this.traces.length;t++){let n=this.traces[t];for(let o=0;o<n.route.length-1;o++){let r=n.route[o],i=n.route[o+1];$9(r)&&$9(i)&&r.layer===i.layer&&e.push({points:[r,i],strokeColor:t===this.traceIndices[this.traceCursor]&&o===this.routeCursor?"#ff7400":r.layer==="bottom"?"#376fc4":"#777",strokeWidth:Math.max(r.width,i.width)})}}return{coordinateSystem:"cartesian",title:"Power trace direction-independent clearance repair",lines:e,points:[],circles:[],rects:[],texts:[]}}},cGt=[{x:0,y:0},{x:0.5,y:0},{x:0,y:0.5},{x:0.5,y:0.5}],lGt=[{offset:{x:0,y:0},strictNecking:!0},{offset:{x:0.5,y:0.5},strictNecking:!0},{offset:{x:0,y:0},strictNecking:!1},{offset:{x:0.5,y:0.5},strictNecking:!1}],hGt=(e)=>[...new Set(e.map((t)=>Number(t.toFixed(6))))].sort((t,n)=>n-t),Os=(e)=>e?.route_type==="wire",h6r=class extends _Y{inputProblem;options;traces;obstacleIndex;connectionNameResolver;connectionByTraceId=new Map;connectivityInvariant;lastConnectivitySafeTraces;traceOrder;selectedOwnedTraceIndices;selectedCleanupTraceIndices;selectedViaRepairTraceIndices;mutableBlockerTraceIndices;immutableTraceIndices;initialImmutableTraceSignatures=new Map;traceOrderCursor=-1;maxPassCount=4;previousWidthDeficit=0;passIndex=0;completedPassCount=0;lastNormalizedWidthDeficitGain=0;normalizedWidthDeficitGainByPass=[];plateauReached=!1;phase="scan-trace";traceIndex=-1;routeSegmentIndex=0;nominalTraceWidth=0;currentIntervals=[];intervalCursor=0;candidateWidths=[];widthCursor=0;gridResolutions=[];resolutionCursor=0;offsetCursor=0;keptTraceCount=0;recreatedTraceCount=0;expandedSegmentCount=0;intermediateExpandedSegmentCount=0;pathWidthUpgradeCount=0;inPlaceWidthProbeCount=0;reroutedSegmentCount=0;unresolvedSegmentCount=0;attemptedGridCount=0;attemptedLayerGridCount=0;attemptedInflationCount=0;pushedTraceCount=0;elasticPushedTraceCount=0;layerReroutedTraceCount=0;insertedViaCount=0;neckedLayerSegmentCount=0;removedViaPairCount=0;removedViaCount=0;simplifiedPathCount=0;normalizedSegmentCount=0;cleanupClearanceShoveCount=0;relocatedViaCount=0;unresolvedViaCount=0;initialImmutableViaViolationCount=0;remainingImmutableViaViolationCount=0;initialImmutableViaViolationPairCount=0;remainingImmutableViaViolationPairCount=0;immutableTraceMutationIds=[];lastSafeImmutableViaViolationSignatures=new Set;immutableViaViolationRollbackCount=0;attemptedImmutableViaViolationCount=null;attemptedImmutableViaViolationPairCount=null;immutableViaViolationRegressionIds=[];padClearanceRerouteCount=0;unresolvedPadClearanceCount=0;repairedTraceClearanceSegmentCount=0;repairedPadNeckSegmentCount=0;unresolvedTraceClearanceSegmentCount=0;sameNetContactRejectionCount=0;connectivityValidationCount=0;connectivityRollbackCount=0;connectivityRollbackPhases=[];immutableSafetyRollbackCount=0;immutableSafetyRollbackPhases=[];connectivityRegressionEndpointIds=[];connectivityValidationError=null;connectivityRollbackMutationStats=null;immutableSafetyRollbackMutationStats=null;discardedExpansionMutationStats=null;initialPadClearanceViolationCount=0;remainingPadClearanceViolationCount=0;initialPadClearanceViolationCountByClearance={};remainingPadClearanceViolationCountByClearance={};budgetLimitedExpansion=!1;finalAcceptanceUsed=!1;cleanupCompleted=!1;clearanceRepairCompleted=!1;cleanupBestEffortAccepted=!1;clearanceRepairBestEffortAccepted=!1;cleanupIterationBudget=0;clearanceRepairIterationBudget=0;expansionPushedTraceIndices=new Set;cleanupMutatedTraceIndices=[];failedSubSolverCount=0;inflationAttemptsBySegment=new Map;layerAttemptCountByTrace=new Map;layerRerouteCountByTrace=new Map;activeInflationKey=null;activeInflationWidth=null;layerAttempt=null;pendingLayerOutput=null;pendingLayerPushCount=0;constructor(e,t={}){super(),this.inputProblem=structuredClone(e),this.options=structuredClone(t),this.traces=structuredClone(e.traces??[]),this.connectionNameResolver=new xB(this.inputProblem,this.traces),this.lastConnectivitySafeTraces=structuredClone(this.traces),this.connectivityInvariant=new sbe(this.inputProblem,this.lastConnectivitySafeTraces);let n=t.onlyConnectionNames?new Set(this.connectionNameResolver.canonicalize([...t.onlyConnectionNames])):null,o=this.traces.flatMap((s,a)=>{if(!n)return[a];return this.connectionNameResolver.canonicalize(this.getTraceConnectionNames(s)).some((c)=>n.has(c))?[a]:[]}),r=new Map(o.map((s)=>[s,this.getInitialTracePriority(this.traces[s])]));this.traceOrder=o.sort((s,a)=>r.get(a)-r.get(s)||s-a),this.selectedOwnedTraceIndices=this.traceOrder.filter((s)=>this.findConnectionForTrace(this.traces[s])),this.selectedCleanupTraceIndices=[...this.selectedOwnedTraceIndices],this.selectedViaRepairTraceIndices=[...this.selectedOwnedTraceIndices],this.mutableBlockerTraceIndices=this.traces.flatMap((s,a)=>this.findConnectionForTrace(s)?[a]:[]);let i=new Set(this.mutableBlockerTraceIndices);this.immutableTraceIndices=this.traces.flatMap((s,a)=>i.has(a)?[]:(this.initialImmutableTraceSignatures.set(a,JSON.stringify(s)),[a])),this.previousWidthDeficit=this.calculateWidthDeficit().deficit,this.obstacleIndex=new c6(this.inputProblem,this.traces,this.traceIndex>=0?this.traceIndex:void 0,[],this.connectionNameResolver),this.lastSafeImmutableViaViolationSignatures=this.getImmutableViaViolationSignatures(this.traces),this.initialImmutableViaViolationCount=this.countViolatingImmutableVias(this.lastSafeImmutableViaViolationSignatures),this.remainingImmutableViaViolationCount=this.initialImmutableViaViolationCount,this.initialImmutableViaViolationPairCount=this.lastSafeImmutableViaViolationSignatures.size,this.remainingImmutableViaViolationPairCount=this.initialImmutableViaViolationPairCount,this.activeSubSolver=null,this.MAX_ITERATIONS=8000000,this.stats=this.createStats()}getSolverName(){return"PowerTraceExpanderSolver"}_step(){if(this.shouldStartBudgetFinalization())return this.startBudgetFinalization(),void(this.stats=this.createStats());if(this.activeSubSolver)return this.stepActiveGridSolver(),void(this.stats=this.createStats());switch(this.phase){case"scan-trace":this.scanNextTrace();break;case"evaluate-segment":this.evaluateNextSegment();break;case"try-trace-inflation":case"cleanup":case"repair-trace-clearance":break;case"try-layer-candidate":this.startNextLayerCandidate();break;case"try-grid-candidate":this.startNextGridCandidate();break;case"complete":this.acceptConnectivityCheckpoint(this.traces,"final"),this.solved=!0}this.stats=this.createStats()}scanNextTrace(){if(this.traceOrderCursor++,this.routeSegmentIndex=0,this.traceOrderCursor>=this.traceOrder.length)return void this.finishOrStartNextPass();this.traceIndex=this.traceOrder[this.traceOrderCursor];let e=this.traces[this.traceIndex];this.findConnectionForTrace(e)?(this.nominalTraceWidth=this.resolveNominalTraceWidth(e),this.traceMeetsNominalWidth(e,this.nominalTraceWidth)?this.keptTraceCount++:(this.rebuildObstacleIndex(),e.route=function(t,n){if(t.length<2)return t.map((r)=>({...r}));let o=[];for(let r=0;r<t.length-1;r++){let i=t[r],s=t[r+1];if(o.push({...i}),i.route_type!=="wire"||s.route_type!=="wire"||i.layer!==s.layer||i.width>=n-_r)continue;let a=Ms(i,s),c=Math.max(1,Math.ceil(a/n));for(let l=1;l<c;l++){let h=l/c;o.push({route_type:"wire",x:i.x+(s.x-i.x)*h,y:i.y+(s.y-i.y)*h,width:i.width,layer:i.layer})}}return o.push({...t[t.length-1]}),o}(e.route,this.nominalTraceWidth),this.recreatedTraceCount++,this.phase="evaluate-segment")):this.keptTraceCount++}finishOrStartNextPass(){let{deficit:e,nominalArea:t}=this.calculateWidthDeficit(),n=this.previousWidthDeficit-e;if(this.lastNormalizedWidthDeficitGain=t<=_r?0:n/t,this.normalizedWidthDeficitGainByPass.push(this.lastNormalizedWidthDeficitGain),this.plateauReached=this.lastNormalizedWidthDeficitGain<0.001,this.completedPassCount=this.passIndex+1,this.passIndex+1<this.maxPassCount&&this.lastNormalizedWidthDeficitGain>=0.001)return this.previousWidthDeficit=e,this.passIndex++,this.traceOrderCursor=-1,this.traceIndex=-1,this.routeSegmentIndex=0,this.inflationAttemptsBySegment.clear(),void(this.phase="scan-trace");this.startCleanup()}startCleanup(){this.acceptConnectivityCheckpoint(this.traces,"expansion"),this.traceIndex=this.traces.length,this.phase="cleanup";let e=new yje({simpleRouteJson:this.inputProblem,traces:this.traces,traceIndices:this.selectedCleanupTraceIndices,viaRepairTraceIndices:this.selectedViaRepairTraceIndices,mutableTraceIndices:this.mutableBlockerTraceIndices,maxRerouteLength:10,desiredPadClearance:this.options.powerTraceToPadClearance}),t=this.getRemainingParentIterationsAfterCurrentStep(),n=t===0?0:Math.max(1,Math.floor(0.75*t));e.MAX_ITERATIONS=Math.min(e.MAX_ITERATIONS,n),this.cleanupIterationBudget=e.MAX_ITERATIONS,this.activeSubSolver=e}shouldStartBudgetFinalization(){return!this.budgetLimitedExpansion&&(this.phase!=="cleanup"&&this.phase!=="repair-trace-clearance"&&this.phase!=="complete"&&this.iterations>=this.getExpansionIterationBudget())}getFinalizationIterationReserve(){return Math.min(Math.max(0,this.MAX_ITERATIONS-1),Math.max(1,Math.floor(0.125*this.MAX_ITERATIONS)))}getExpansionIterationBudget(){return Math.max(1,this.MAX_ITERATIONS-this.getFinalizationIterationReserve())}startBudgetFinalization(){this.budgetLimitedExpansion=!0,this.activeSubSolver=null,this.pendingLayerOutput=null,this.pendingLayerPushCount=0,this.activeInflationKey=null,this.activeInflationWidth=null,this.layerAttempt=null,this.discardInFlightExpansion(),this.startCleanup()}discardInFlightExpansion(){this.discardedExpansionMutationStats=this.captureAndResetExpansionMutationStats(),this.restoreLastConnectivitySafeTraces()}rollbackConnectivityRegressedExpansion(){this.connectivityRollbackMutationStats=this.captureAndResetExpansionMutationStats(),this.restoreLastConnectivitySafeTraces()}rollbackImmutableUnsafeExpansion(){this.immutableSafetyRollbackMutationStats=this.captureAndResetExpansionMutationStats(),this.restoreLastConnectivitySafeTraces()}captureAndResetExpansionMutationStats(){let e={recreatedTraceCount:this.recreatedTraceCount,expandedSegmentCount:this.expandedSegmentCount,intermediateExpandedSegmentCount:this.intermediateExpandedSegmentCount,pathWidthUpgradeCount:this.pathWidthUpgradeCount,reroutedSegmentCount:this.reroutedSegmentCount,pushedTraceCount:this.pushedTraceCount,elasticPushedTraceCount:this.elasticPushedTraceCount,layerReroutedTraceCount:this.layerReroutedTraceCount,insertedViaCount:this.insertedViaCount,neckedLayerSegmentCount:this.neckedLayerSegmentCount};return this.recreatedTraceCount=0,this.expandedSegmentCount=0,this.intermediateExpandedSegmentCount=0,this.pathWidthUpgradeCount=0,this.reroutedSegmentCount=0,this.pushedTraceCount=0,this.elasticPushedTraceCount=0,this.layerReroutedTraceCount=0,this.insertedViaCount=0,this.neckedLayerSegmentCount=0,this.expansionPushedTraceIndices.clear(),e}restoreLastConnectivitySafeTraces(){this.traces=structuredClone(this.lastConnectivitySafeTraces),this.rebuildObstacleIndex()}getRemainingParentIterationsAfterCurrentStep(){return Math.max(0,this.MAX_ITERATIONS-this.iterations-1)}calculateWidthDeficit(){let e=0,t=0;for(let n of this.traceOrder){let o=this.traces[n];if(!this.findConnectionForTrace(o))continue;let r=this.resolveNominalTraceWidth(o);for(let i=0;i<o.route.length-1;i++){let s=o.route[i],a=o.route[i+1];if(!Os(s)||!Os(a)||s.layer!==a.layer)continue;let c=Ms(s,a),l=s.width;t+=c*r,e+=c*Math.max(0,r-l)}}return{deficit:e,nominalArea:t}}getInitialTracePriority(e){let t=this.resolveNominalTraceWidth(e),n=0;for(let o=0;o<e.route.length-1;o++){let r=e.route[o],i=e.route[o+1];Os(r)&&Os(i)&&r.layer===i.layer&&(n+=Ms(r,i)*Math.max(0,t-Math.min(r.width,i.width)))}return t*n}evaluateNextSegment(){let e=this.traces[this.traceIndex];if(!e)return void(this.phase="scan-trace");let t=this.findNextUnderWidthSegment(e,this.routeSegmentIndex,this.nominalTraceWidth);if(t===-1)return void(this.phase="scan-trace");this.routeSegmentIndex=t;let n=e.route[t],o=e.route[t+1];if(!Os(n)||!Os(o))return void this.routeSegmentIndex++;let r=this.getTraceConnectionNames(e),i=Math.min(n.width,o.width),s=this.findMaximumSafeInPlaceWidth(e,t,r);if(s>i+_r){if(n.width=Math.max(n.width,s),o.width=Math.max(o.width,s),s>=this.nominalTraceWidth-_r)return this.expandedSegmentCount++,void this.routeSegmentIndex++;this.intermediateExpandedSegmentCount++}this.startTraceInflation(e,t)||this.prepareLayerRouteAttempt(e,t)||this.prepareRegularGridCandidates(e,t)}prepareRegularGridCandidates(e,t){if(this.currentIntervals=this.getExponentialIntervalCandidates(e,t,this.nominalTraceWidth),this.intervalCursor=0,this.candidateWidths=this.getCandidateWidths(this.nominalTraceWidth),this.widthCursor=0,this.gridResolutions=[],this.resolutionCursor=0,this.offsetCursor=0,this.currentIntervals.length===0)return this.unresolvedSegmentCount++,void this.routeSegmentIndex++;this.phase="try-grid-candidate"}prepareLayerRouteAttempt(e,t){if(this.nominalTraceWidth<0.499999)return!1;let n=this.options.allowNewVias!==!1&&this.inputProblem.layerCount>=2,o=n?2:this.maxPassCount,r=this.layerAttemptCountByTrace.get(this.traceIndex)??0,i=this.layerRerouteCountByTrace.get(this.traceIndex)??0;if(i>=o||r>=o||r>this.passIndex||r>0&&i===0)return!1;let s=e.route[t],a=e.route[t+1];if(!Os(s)||!Os(a)||Math.min(s.width,a.width)>=0.5*this.nominalTraceWidth-_r)return!1;let c=this.getExponentialIntervalCandidates(e,t,this.nominalTraceWidth).filter((f)=>this.intervalSupportsLayerRouting(e,f)).sort((f,y)=>y.endIndex-f.endIndex||f.startIndex-y.startIndex||this.getRouteIntervalLength(e,y.startIndex,y.endIndex)-this.getRouteIntervalLength(e,f.startIndex,f.endIndex))[0];if(!c)return!1;let l=this.getRouteQuality(e.route.slice(c.startIndex,c.endIndex+1));if(l.deficitArea<this.nominalTraceWidth)return!1;if(r>0&&l.deficitArea/Math.max(l.length,_r)<0.25)return!1;let h=e.route[c.startIndex],d=e.route[c.endIndex],u=this.getTraceConnectionNames(e),_=n?this.getEndpointLayers(h,u):[h.layer],p=n?this.getEndpointLayers(d,u):[d.layer],m=Math.min(this.nominalTraceWidth,Math.max(h.width,this.findMaximumSafeInPlaceWidth(e,c.startIndex,u))),A=Math.min(this.nominalTraceWidth,Math.max(d.width,this.findMaximumSafeInPlaceWidth(e,c.endIndex-1,u))),g=this.getSoftTraceIndices(this.nominalTraceWidth);return this.layerAttemptCountByTrace.set(this.traceIndex,r+1),this.layerAttempt={interval:c,minViaCount:n?1:0,maxViaCount:n?2:0,candidateWidths:[this.nominalTraceWidth],widthCursor:0,gridResolutions:[J0(this.nominalTraceWidth/4,0.2,0.3)],resolutionCursor:0,offsetCursor:0,startLayers:_,endLayers:p,startNeckWidth:m,endNeckWidth:A,softTraceIndices:g},this.phase="try-layer-candidate",!0}intervalSupportsLayerRouting(e,t){if(t.startIndex>=t.endIndex)return!1;for(let r=t.startIndex;r<=t.endIndex;r++){let i=e.route[r];if(!Os(i))return!1}let n=e.route[t.startIndex],o=e.route[t.endIndex];return n.layer===o.layer}getEndpointLayers(e,t){return[...new Set([e.layer,...this.obstacleIndex.getConnectedLayersAtPoint({x:e.x,y:e.y},t)])].filter((n)=>this.obstacleIndex.boardLayers.includes(n))}getSoftTraceIndices(e){let t=[];for(let n=0;n<this.traces.length;n++){if(n===this.traceIndex)continue;let o=this.traces[n],r=this.findConnectionForTrace(o);if(!r)continue;Math.max(r.nominalTraceWidth??r.width??this.inputProblem.nominalTraceWidth??this.inputProblem.minTraceWidth,this.inputProblem.minTraceWidth)<e-_r&&t.push(n)}return t}startNextLayerCandidate(){let e=this.layerAttempt,t=this.traces[this.traceIndex];if(!e||!t)return this.layerAttempt=null,void(this.phase="evaluate-segment");if(e.widthCursor>=e.candidateWidths.length){let p=this.routeSegmentIndex;return this.layerAttempt=null,void this.prepareRegularGridCandidates(t,p)}let n=e.candidateWidths[e.widthCursor];if(e.gridResolutions.length===0&&(e.gridResolutions=this.getGridResolutions(n)),e.resolutionCursor>=e.gridResolutions.length)return e.widthCursor++,e.gridResolutions=[],e.resolutionCursor=0,void(e.offsetCursor=0);if(e.offsetCursor>=lGt.length)return e.resolutionCursor++,void(e.offsetCursor=0);let o=t.route[e.interval.startIndex],r=t.route[e.interval.endIndex];if(!Os(o)||!Os(r))return this.layerAttempt=null,void this.prepareRegularGridCandidates(t,this.routeSegmentIndex);let i=e.gridResolutions[e.resolutionCursor],s=lGt[e.offsetCursor],a=s.offset,c=Math.min(e.startNeckWidth,e.endNeckWidth),l=this.inputProblem.min_via_hole_diameter??this.inputProblem.minViaHoleDiameter??0.3,h=Math.max(l,this.inputProblem.min_via_pad_diameter??this.inputProblem.minViaPadDiameter??this.inputProblem.minViaDiameter??0.6),d=Math.max(this.inputProblem.minTraceWidth,Math.min(s.strictNecking?e.startNeckWidth:c,n)),u=Math.max(this.inputProblem.minTraceWidth,Math.min(s.strictNecking?e.endNeckWidth:c,n)),_=J0(3*this.nominalTraceWidth,1.5,3);e.maxViaCount>0?this.attemptedLayerGridCount++:this.attemptedGridCount++,this.activeSubSolver=new tGt({start:o,end:r,originalStartLayer:o.layer,originalEndLayer:r.layer,startLayers:e.startLayers,endLayers:e.endLayers,layers:this.obstacleIndex.boardLayers,traceWidth:n,startNeckWidth:d,endNeckWidth:u,maxStartNeckLength:_,maxEndNeckLength:_,neckPenaltyExponent:s.strictNecking?2:1,viaDiameter:h,viaHoleDiameter:l,minViaCount:e.minViaCount,maxViaCount:e.maxViaCount,viaCost:Math.max(1,2*this.nominalTraceWidth),gridSize:i,gridOffset:{x:a.x*i,y:a.y*i},connectionNames:this.getTraceConnectionNames(t),obstacleIndex:this.obstacleIndex,ignoreTraceIndex:this.traceIndex,ignoreRouteRange:{start:Math.max(0,e.interval.startIndex-1),end:Math.min(t.route.length-1,e.interval.endIndex+1)},softTraceIndices:e.softTraceIndices,fixedVias:this.getFixedViasOutsideInterval(t,e.interval),bounds:this.inputProblem.bounds,obstacleClearance:this.getDesiredPadClearance(n),searchPadding:Math.min(5,Math.max(2.5,Ms(o,r)/2,4*n))})}startNextGridCandidate(){let e=this.traces[this.traceIndex];if(!e)return void(this.phase="scan-trace");if(this.widthCursor>=this.candidateWidths.length)return this.unresolvedSegmentCount++,this.routeSegmentIndex++,void(this.phase="evaluate-segment");if(this.intervalCursor>=this.currentIntervals.length)return this.widthCursor++,this.intervalCursor=0,this.gridResolutions=[],this.resolutionCursor=0,void(this.offsetCursor=0);let t=this.candidateWidths[this.widthCursor],n=e.route[this.routeSegmentIndex],o=e.route[this.routeSegmentIndex+1];if(Os(n)&&Os(o)&&t<=Math.min(n.width,o.width)+_r)return void(this.widthCursor=this.candidateWidths.length);if(this.gridResolutions.length===0&&(this.gridResolutions=this.getGridResolutions(t)),this.resolutionCursor>=this.gridResolutions.length)return this.intervalCursor++,this.resolutionCursor=0,void(this.offsetCursor=0);if(this.offsetCursor>=cGt.length)return this.resolutionCursor++,void(this.offsetCursor=0);let r=this.currentIntervals[this.intervalCursor],i=e.route[r.startIndex],s=e.route[r.endIndex];if(!Os(i)||!Os(s)||i.layer!==s.layer)return this.intervalCursor++,this.resolutionCursor=0,void(this.offsetCursor=0);if(this.endpointCollides(e,r,i,t)||this.endpointCollides(e,r,s,t))return this.intervalCursor++,this.resolutionCursor=0,void(this.offsetCursor=0);let a=this.gridResolutions[this.resolutionCursor],c=cGt[this.offsetCursor],l={x:c.x*a,y:c.y*a};this.attemptedGridCount++,this.activeSubSolver=new obe({start:i,end:s,layer:i.layer,traceWidth:t,gridSize:a,gridOffset:l,connectionNames:this.getTraceConnectionNames(e),obstacleIndex:this.obstacleIndex,ignoreTraceIndex:this.traceIndex,ignoreRouteRange:{start:Math.max(0,r.startIndex-1),end:Math.min(e.route.length-1,r.endIndex+1)},bounds:this.inputProblem.bounds,obstacleClearance:this.getDesiredPadClearance(t),searchPadding:Math.min(5,Math.max(1.5,Ms(i,s)/2,3*t))})}endpointCollides(e,t,n,o){return this.obstacleIndex.collides({start:n,end:n,layer:n.layer,width:o,connectionNames:this.getTraceConnectionNames(e),ignoreTraceIndex:this.traceIndex,ignoreRouteRange:{start:Math.max(0,t.startIndex-1),end:Math.min(e.route.length-1,t.endIndex+1)},obstacleClearance:this.getDesiredPadClearance(o)})}stepActiveGridSolver(){if(this.activeSubSolver instanceof xje)return void this.stepActiveTraceClearanceRepairSolver();if(this.activeSubSolver instanceof yje)return void this.stepActiveCleanupSolver();if(this.activeSubSolver instanceof q$)return void this.stepActiveInflationSolver();if(this.activeSubSolver instanceof tGt)return void this.stepActiveLayerSolver();let e=this.activeSubSolver;if(e.step(),e.solved||e.failed){if(e.solved){let t=e.getOutput();if(t){let n=this.gridRouteReplacementCollides(t)||this.gridRouteBoundaryCollides(t);if(!n&&this.gridRoutePreservesSameNetContacts(t))return this.applyGridRoute(this.maximizeGridRouteWidth(t)),void(this.activeSubSolver=null);n||this.sameNetContactRejectionCount++}}this.retainFailedSubSolver(e),this.activeSubSolver=null,this.offsetCursor++}}stepActiveCleanupSolver(){let e=this.activeSubSolver;if(e.step(),e.solved||e.failed){if(e.solved)return this.adoptCleanupOutput(e),this.activeSubSolver=null,void this.startTraceClearanceRepair();this.retainFailedSubSolver(e),this.activeSubSolver=null,this.startTraceClearanceRepair()}}adoptCleanupOutput(e){let t=this.acceptConnectivityCheckpoint(e.getOutput(),"cleanup");this.cleanupCompleted=!e.budgetLimited;let n=e.stats;this.connectivityValidationError??=n.connectivityValidationError??null,this.connectivityValidationCount+=Number(n.connectivityValidationCount??0);let o=Number(n.connectivityRollbackCount??0);o>0&&(this.connectivityRollbackCount+=o,this.connectivityRollbackPhases.includes("cleanup")||this.connectivityRollbackPhases.push("cleanup"),this.connectivityRegressionEndpointIds=[...new Set([...this.connectivityRegressionEndpointIds,...n.connectivityRegressionEndpointIds??[]])]);let r=t&&o===0;this.cleanupBestEffortAccepted=e.budgetLimited&&r,this.cleanupMutatedTraceIndices=r?[...n.mutatedTraceIndices??[]]:[],this.removedViaPairCount=r?Number(n.viaPairCountRemoved??0):0,this.removedViaCount=r?Number(n.viaCountRemoved??0):0,this.simplifiedPathCount=r?Number(n.simplifiedPathCount??0):0,this.normalizedSegmentCount=r?Number(n.normalizedSegmentCount??0):0,this.cleanupClearanceShoveCount=r?Number(n.committedClearanceShoveCount??0):0,this.relocatedViaCount=r?Number(n.relocatedViaCount??0):0,this.unresolvedViaCount=Number(n.unresolvedViaCount??0),this.padClearanceRerouteCount=r?Number(n.padClearanceRerouteCount??0):0,this.unresolvedPadClearanceCount=Number(n.unresolvedPadClearanceCount??0),this.initialPadClearanceViolationCount=Number(n.initialPadClearanceViolationCount??0),this.remainingPadClearanceViolationCount=Number(n.remainingPadClearanceViolationCount??0),this.initialPadClearanceViolationCountByClearance={...n.initialPadClearanceViolationCountByClearance??{}},this.remainingPadClearanceViolationCountByClearance={...n.remainingPadClearanceViolationCountByClearance??{}},this.rebuildObstacleIndex()}startTraceClearanceRepair(){this.phase="repair-trace-clearance";let e=[...new Set([...this.getOwnedTraceIndices(),...this.expansionPushedTraceIndices,...this.cleanupMutatedTraceIndices])],t=new xje({simpleRouteJson:this.inputProblem,traces:this.traces,traceIndices:e});t.MAX_ITERATIONS=Math.min(t.MAX_ITERATIONS,this.getRemainingParentIterationsAfterCurrentStep()),this.clearanceRepairIterationBudget=t.MAX_ITERATIONS,this.activeSubSolver=t}stepActiveTraceClearanceRepairSolver(){let e=this.activeSubSolver;if(e.step(),e.solved||e.failed){if(e.solved)return this.adoptClearanceRepairOutput(e),this.activeSubSolver=null,void(this.phase="complete");this.retainFailedSubSolver(e),this.activeSubSolver=null,this.phase="complete"}}adoptClearanceRepairOutput(e){let t=this.acceptConnectivityCheckpoint(e.getOutput(),"clearance-repair");this.clearanceRepairCompleted=!e.budgetLimited;let n=e.stats;this.connectivityValidationError??=n.connectivityValidationError??null,this.connectivityValidationCount+=Number(n.connectivityValidationCount??0);let o=Number(n.connectivityRollbackCount??0);o>0&&(this.connectivityRollbackCount+=o,this.connectivityRollbackPhases.includes("clearance-repair")||this.connectivityRollbackPhases.push("clearance-repair"),this.connectivityRegressionEndpointIds=[...new Set([...this.connectivityRegressionEndpointIds,...n.connectivityRegressionEndpointIds??[]])]);let r=t&&o===0;this.clearanceRepairBestEffortAccepted=e.budgetLimited&&r,this.repairedTraceClearanceSegmentCount=r?Number(n.repairedSegmentCount??0):0,this.repairedPadNeckSegmentCount=r?Number(n.repairedPadNeckSegmentCount??0):0,this.unresolvedTraceClearanceSegmentCount=Number(n.unresolvedSegmentCount??0),this.rebuildObstacleIndex()}stepActiveLayerSolver(){let e=this.activeSubSolver;if(e.step(),e.solved||e.failed){if(e.solved){let t=e.getOutput();if(t){let n=!this.layerRouteReplacementCollides(t,!0)&&this.layerRouteImprovesInterval(t),o=n&&this.layerRoutePreservesSameNetContacts(t);if(o){if(this.activeSubSolver=null,this.pendingLayerOutput=t,this.pendingLayerPushCount=0,!this.layerRouteReplacementCollides(t,!1))return void this.applyLayerRoute(t);if(this.startPendingLayerInflation())return;this.pendingLayerOutput=null}n&&!o&&this.sameNetContactRejectionCount++}}this.retainFailedSubSolver(e),this.activeSubSolver=null,this.layerAttempt&&this.layerAttempt.offsetCursor++,this.phase="try-layer-candidate"}}layerRouteReplacementCollides(e,t){let n=this.traces[this.traceIndex],o=this.layerAttempt;if(!n||!o)return!0;let r=this.getTraceConnectionNames(n),i=t?o.softTraceIndices:void 0,s={start:Math.max(0,o.interval.startIndex-1),end:Math.min(n.route.length-1,o.interval.endIndex+1)},a=this.getFixedViasOutsideInterval(n,o.interval);for(let c=0;c<e.route.length;c++){let l=e.route[c];if(l?.route_type==="via"){if(this.obstacleIndex.collidesVia({point:l,layers:this.obstacleIndex.boardLayers,padDiameter:l.via_diameter??0.6,holeDiameter:l.via_hole_diameter??this.obstacleIndex.defaultViaHoleDiameter,connectionNames:r,ignoreTraceIndex:this.traceIndex,ignoreTraceIndices:i,otherNewViaPoints:e.route.slice(0,c).filter((d)=>d.route_type==="via").map((d)=>({x:d.x,y:d.y})),fixedVias:a,ignoreRouteRange:s,obstacleClearance:this.getDesiredPadClearance(e.traceWidth),blockSameNetObstacles:!0,sameNetObstacleClearance:0}))return!0;continue}let h=e.route[c+1];if(l?.route_type==="wire"&&h?.route_type==="wire"&&l.layer===h.layer&&this.obstacleIndex.collides({start:l,end:h,layer:l.layer,width:Math.max(l.width,h.width),connectionNames:r,ignoreTraceIndex:this.traceIndex,ignoreTraceIndices:i,ignoreRouteRange:s,obstacleClearance:this.getDesiredPadClearance(e.traceWidth)}))return!0}return this.layerRouteBoundaryCollides(e,t)}getFixedViasOutsideInterval(e,t){return e.route.flatMap((n,o)=>n.route_type!=="via"||o>=t.startIndex&&o<=t.endIndex?[]:[{point:{x:n.x,y:n.y},padDiameter:n.via_diameter??0.6,holeDiameter:n.via_hole_diameter??this.obstacleIndex.defaultViaHoleDiameter}])}layerRouteBoundaryCollides(e,t){let n=this.traces[this.traceIndex],o=this.layerAttempt,r=e.route.find((a)=>a.route_type==="wire"),i;for(let a=e.route.length-1;a>=0;a--){let c=e.route[a];if(c?.route_type==="wire"){i=c;break}}if(!r||!i)return!0;let s=[{outside:n.route[o.interval.startIndex-1],inside:r},{outside:n.route[o.interval.endIndex+1],inside:i}];for(let a of s)if(Os(a.outside)&&a.outside.layer===a.inside.layer&&this.obstacleIndex.collides({start:a.outside,end:a.inside,layer:a.inside.layer,width:Math.max(a.outside.width,a.inside.width),connectionNames:this.getTraceConnectionNames(n),ignoreTraceIndex:this.traceIndex,ignoreTraceIndices:t?o.softTraceIndices:void 0,ignoreRouteRange:{start:Math.max(0,o.interval.startIndex-1),end:Math.min(n.route.length-1,o.interval.endIndex+1)},obstacleClearance:this.getDesiredPadClearance(e.traceWidth)}))return!0;return!1}layerRouteImprovesInterval(e){let t=this.traces[this.traceIndex],n=this.layerAttempt.interval,o=this.getRouteQuality(t.route.slice(n.startIndex,n.endIndex+1)),r=this.getRouteQuality(e.route);return r.length<=o.length+10+_r&&r.deficitArea<=o.deficitArea-Math.max(0.05,0.1*o.deficitArea)}getRouteQuality(e){let t=0,n=0;for(let o=0;o<e.length-1;o++){let r=e[o],i=e[o+1];if(!Os(r)||!Os(i)||r.layer!==i.layer)continue;let s=Ms(r,i),a=Math.min(r.width,i.width);t+=s,n+=s*Math.max(0,this.nominalTraceWidth-a)}return{length:t,deficitArea:n}}getLayerInflationCorridor(e){let t=[];for(let n=0;n<e.route.length;n++){let o=e.route[n];if(o?.route_type==="via"){for(let i of this.obstacleIndex.boardLayers)t.push({start:o,end:o,layer:i,width:o.via_diameter??0.6});continue}let r=e.route[n+1];o?.route_type==="wire"&&r?.route_type==="wire"&&o.layer===r.layer&&t.push({start:o,end:r,layer:o.layer,width:Math.max(o.width,r.width)})}return t}startPendingLayerInflation(){let e=this.pendingLayerOutput;if(!e||this.pendingLayerPushCount>=2)return!1;let t=this.getLayerInflationCorridor(e);return t.length!==0&&(this.pendingLayerPushCount++,this.attemptedInflationCount++,this.activeSubSolver=new q$({simpleRouteJson:this.inputProblem,traces:this.traces,powerTraceIndex:this.traceIndex,nominalPowerWidth:e.traceWidth,mutableTraceIndices:this.mutableBlockerTraceIndices,corridor:t,maxRerouteLength:10},this.connectionNameResolver),this.phase="try-trace-inflation",!0)}applyLayerRoute(e){let t=this.traces[this.traceIndex],n=this.layerAttempt.interval,o=this.createLayerRouteReplacement(e);t.route.splice(n.startIndex,n.endIndex-n.startIndex+1,...o),e.viaCount>0&&this.layerReroutedTraceCount++,this.layerRerouteCountByTrace.set(this.traceIndex,(this.layerRerouteCountByTrace.get(this.traceIndex)??0)+1),this.reroutedSegmentCount++,this.insertedViaCount+=e.viaCount,e.viaCount>0&&(this.neckedLayerSegmentCount+=o.filter((r)=>r.route_type==="wire"&&r.width<this.nominalTraceWidth-_r).length),this.routeSegmentIndex=n.startIndex,this.currentIntervals=[],this.layerAttempt=null,this.pendingLayerOutput=null,this.pendingLayerPushCount=0,this.phase="evaluate-segment"}createLayerRouteReplacement(e){let t=this.traces[this.traceIndex],n=this.layerAttempt.interval,o=t.route[n.startIndex],r=t.route[n.endIndex],i=structuredClone(e.route),s=i.findIndex((c)=>c.route_type==="wire"),a=-1;for(let c=i.length-1;c>=0;c--)if(i[c]?.route_type==="wire"){a=c;break}return s>=0&&(i[s]={...o,...i[s]}),a>=0&&(i[a]={...r,...i[a]}),i}layerRoutePreservesSameNetContacts(e){let t=this.traces[this.traceIndex],n=this.layerAttempt.interval;return this.routeReplacementPreservesSameNetContacts(t,n,this.createLayerRouteReplacement(e))}startTraceInflation(e,t){let n=e.route[t],o=e.route[t+1];if(!Os(n)||!Os(o))return!1;let r=Math.min(n.width,o.width),i=this.findBestPushableInflationWidth(e,t,r);if(!i)return!1;let s=this.getLocalInflationCorridor(e,t,i);if(s.length===0)return!1;let a=[this.traceIndex,n.x,n.y,o.x,o.y].join(":"),c=this.inflationAttemptsBySegment.get(a)??0;return!(c>=2)&&(this.inflationAttemptsBySegment.set(a,c+1),this.activeInflationKey=a,this.activeInflationWidth=i,this.attemptedInflationCount++,this.activeSubSolver=new q$({simpleRouteJson:this.inputProblem,traces:this.traces,powerTraceIndex:this.traceIndex,nominalPowerWidth:i,mutableTraceIndices:this.mutableBlockerTraceIndices,corridor:s,maxRerouteLength:10},this.connectionNameResolver),this.phase="try-trace-inflation",!0)}hasOnlyPushableTraceBlockers(e,t,n){let o=Math.max(0,t-1),r=Math.min(e.route.length-2,t+1),i=new Set;for(let s=o;s<=r;s++){let a=e.route[s],c=e.route[s+1];if(!Os(a)||!Os(c)||a.layer!==c.layer)continue;let l={start:a,end:c,layer:a.layer,width:n,connectionNames:this.getTraceConnectionNames(e),ignoreTraceIndex:this.traceIndex,ignoreRouteRange:{start:o,end:r+1},obstacleClearance:this.getDesiredPadClearance(n)},h=this.obstacleIndex.findCollisions(l);if(h.length===0&&this.obstacleIndex.collides(l))return!1;for(let d of h){if(d.kind!=="trace"||d.traceIndex===void 0)return!1;let u=this.traces[d.traceIndex];if(!u)return!1;let _=this.findConnectionForTrace(u);if(!_||(_.nominalTraceWidth??_.width??this.inputProblem.nominalTraceWidth??this.inputProblem.minTraceWidth)>=n-_r)return!1;i.add(d.traceIndex)}}return i.size>0&&i.size<=2}findBestPushableInflationWidth(e,t,n){let o=this.nominalTraceWidth>=0.5?0.05:0.0125;for(let r=this.nominalTraceWidth;r>n+_r;r-=o){let i=Number(r.toFixed(6));if(this.hasOnlyPushableTraceBlockers(e,t,i))return i}return null}stepActiveInflationSolver(){let e=this.activeSubSolver;if(e.step(),e.solved||e.failed){if(e.solved){let t=e.getOutput(),n=t&&this.sameNetContactsArePreserved(this.traces[t.pushedTraceIndex].route,t.traces[t.pushedTraceIndex].route,this.getTraceConnectionNames(this.traces[t.pushedTraceIndex]),t.pushedTraceIndex);if(t&&n){if(this.traces=t.traces,this.pushedTraceCount++,this.expansionPushedTraceIndices.add(t.pushedTraceIndex),t.strategy==="elastic"&&this.elasticPushedTraceCount++,this.activeSubSolver=null,this.activeInflationKey=null,this.activeInflationWidth=null,this.rebuildObstacleIndex(),this.pendingLayerOutput){if(!this.layerRouteReplacementCollides(this.pendingLayerOutput,!1)&&this.layerRoutePreservesSameNetContacts(this.pendingLayerOutput))return void this.applyLayerRoute(this.pendingLayerOutput);if(this.startPendingLayerInflation())return;return this.pendingLayerOutput=null,this.pendingLayerPushCount=0,this.layerAttempt&&this.layerAttempt.offsetCursor++,void(this.phase="try-layer-candidate")}return void(this.phase="evaluate-segment")}t&&!n&&this.sameNetContactRejectionCount++}if(this.retainFailedSubSolver(e),this.activeInflationKey&&this.inflationAttemptsBySegment.set(this.activeInflationKey,2),this.activeInflationKey=null,this.activeInflationWidth=null,this.activeSubSolver=null,this.pendingLayerOutput)return this.pendingLayerOutput=null,this.pendingLayerPushCount=0,this.layerAttempt&&this.layerAttempt.offsetCursor++,void(this.phase="try-layer-candidate");this.phase="evaluate-segment"}}getLocalInflationCorridor(e,t,n){let o=e.route[t],r=e.route[t+1];if(!Os(o)||!Os(r)||o.layer!==r.layer)return[];let i=J0(4*n,2,4),s=i/2,a=t,c=0;for(;a>0;){let _=e.route[a-1],p=e.route[a];if(!Os(_)||!Os(p)||_.layer!==p.layer)break;let m=Ms(_,p);if(c+m>s+_r)break;c+=m,a--}let l=t+1,h=0;for(;l<e.route.length-1;){let _=e.route[l],p=e.route[l+1];if(!Os(_)||!Os(p)||_.layer!==p.layer)break;let m=Ms(_,p);if(h+m>s+_r)break;h+=m,l++}let d=i-c-h;for(;d>_r&&a>0;){let _=e.route[a-1],p=e.route[a];if(!Os(_)||!Os(p)||_.layer!==p.layer)break;let m=Ms(_,p);if(m>d+_r)break;d-=m,a--}for(;d>_r&&l<e.route.length-1;){let _=e.route[l],p=e.route[l+1];if(!Os(_)||!Os(p)||_.layer!==p.layer)break;let m=Ms(_,p);if(m>d+_r)break;d-=m,l++}let u=[];for(let _=a;_<l;_++){let p=e.route[_],m=e.route[_+1];Os(p)&&Os(m)&&p.layer===m.layer&&u.push({start:p,end:m,layer:p.layer,width:n})}return u}applyGridRoute(e){let t=this.traces[this.traceIndex],n=this.currentIntervals[this.intervalCursor],o=this.createGridRouteReplacement(e);t.route.splice(n.startIndex,n.endIndex-n.startIndex+1,...o),this.reroutedSegmentCount++,this.routeSegmentIndex=n.startIndex+o.length-1,this.currentIntervals=[],this.phase="evaluate-segment"}createGridRouteReplacement(e){let t=this.traces[this.traceIndex],n=this.currentIntervals[this.intervalCursor],o=t.route[n.startIndex],r=t.route[n.endIndex],i=e.points.map((s)=>({route_type:"wire",x:s.x,y:s.y,width:e.traceWidth,layer:o.layer}));return i[0].width=Math.max(o.width,e.traceWidth),i[i.length-1].width=Math.max(r.width,e.traceWidth),i}gridRoutePreservesSameNetContacts(e){let t=this.traces[this.traceIndex],n=this.currentIntervals[this.intervalCursor];return this.routeReplacementPreservesSameNetContacts(t,n,this.createGridRouteReplacement(e))}routeReplacementPreservesSameNetContacts(e,t,n){let o=this.getTraceConnectionNames(e),r=this.getSameNetContactIds(e.route.slice(t.startIndex,t.endIndex+1),o,this.traceIndex),i=new Set([...this.getSameNetContactIds(e.route.slice(0,t.startIndex+1),o,this.traceIndex),...this.getSameNetContactIds(e.route.slice(t.endIndex),o,this.traceIndex)]),s=new Set([...r].filter((c)=>!i.has(c)));if(s.size===0)return!0;let a=this.getSameNetContactIds(n,o,this.traceIndex);return[...s].every((c)=>a.has(c))}sameNetContactsArePreserved(e,t,n,o){let r=this.getSameNetContactIds(e,n,o);if(r.size===0)return!0;let i=this.getSameNetContactIds(t,n,o);return[...r].every((s)=>i.has(s))}getSameNetContactIds(e,t,n){let o=new Set;for(let r=0;r<e.length;r++){let i=e[r];if(i?.route_type==="via"){for(let a of this.getViaLayers(i))for(let c of this.obstacleIndex.getSameNetCopperContactIds({start:i,end:i,layer:a,width:i.via_diameter??0.6,connectionNames:t,ignoreTraceIndex:n}))o.add(c);continue}let s=e[r+1];if(i?.route_type==="wire"&&s?.route_type==="wire"&&i.layer===s.layer)for(let a of this.obstacleIndex.getSameNetCopperContactIds({start:i,end:s,layer:i.layer,width:Math.min(i.width,s.width),connectionNames:t,ignoreTraceIndex:n}))o.add(a)}return o}getViaLayers(e){let t=this.obstacleIndex.boardLayers.indexOf(e.from_layer),n=this.obstacleIndex.boardLayers.indexOf(e.to_layer);return t<0||n<0?this.obstacleIndex.boardLayers:this.obstacleIndex.boardLayers.slice(Math.min(t,n),Math.max(t,n)+1)}gridRouteReplacementCollides(e){let t=this.traces[this.traceIndex],n=this.currentIntervals[this.intervalCursor],o=t.route[n.startIndex],r=t.route[n.endIndex],i=this.getTraceConnectionNames(t);for(let s=0;s<e.points.length-1;s++){let a=Math.max(e.traceWidth,s===0?o.width:0,s===e.points.length-2?r.width:0);if(this.obstacleIndex.collides({start:e.points[s],end:e.points[s+1],layer:o.layer,width:a,connectionNames:i,ignoreTraceIndex:this.traceIndex,ignoreRouteRange:{start:Math.max(0,n.startIndex-1),end:Math.min(t.route.length-1,n.endIndex+1)},obstacleClearance:this.getDesiredPadClearance(a)}))return!0}return!1}gridRouteBoundaryCollides(e){let t=this.traces[this.traceIndex],n=this.currentIntervals[this.intervalCursor],o=this.getTraceConnectionNames(t),r=[{startIndex:n.startIndex-1,endIndex:n.startIndex},{startIndex:n.endIndex,endIndex:n.endIndex+1}];for(let i of r){let s=t.route[i.startIndex],a=t.route[i.endIndex];if(Os(s)&&Os(a)&&s.layer===a.layer&&this.obstacleIndex.collides({start:s,end:a,layer:s.layer,width:Math.max(s.width,a.width,e.traceWidth),connectionNames:o,ignoreTraceIndex:this.traceIndex,ignoreRouteRange:{start:i.startIndex,end:i.endIndex},obstacleClearance:this.getDesiredPadClearance(Math.max(s.width,a.width,e.traceWidth))}))return!0}return!1}canExpandSegmentAndEndpoints(e,t,n,o=this.nominalTraceWidth){let r=Math.max(0,t-1),i=Math.min(e.route.length-2,t+1);for(let s=r;s<=i;s++){let a=e.route[s],c=e.route[s+1];if(!Os(a)||!Os(c)||a.layer!==c.layer)continue;let l=s<=t+1&&s+1>=t,h=Math.max(a.width,c.width,l?o:0);if(this.obstacleIndex.collides({start:a,end:c,layer:a.layer,width:h,connectionNames:n,ignoreTraceIndex:this.traceIndex,ignoreRouteRange:{start:r,end:i+1},obstacleClearance:this.getDesiredPadClearance(h)}))return!1}return!0}findMaximumSafeInPlaceWidth(e,t,n){let o=e.route[t],r=e.route[t+1];if(!Os(o)||!Os(r))return 0;let i=Math.min(o.width,r.width);if(this.probeInPlaceWidth(e,t,n,this.nominalTraceWidth))return this.nominalTraceWidth;let s=i,a=this.nominalTraceWidth;for(let h=0;h<7;h++){let d=(s+a)/2;if(d<=s+_r)break;this.probeInPlaceWidth(e,t,n,d)?s=d:a=d}let c=this.nominalTraceWidth>=0.5?0.025:0.0125,l=Math.max(i,Math.floor((s+_r)/c)*c);return l>i+_r&&this.probeInPlaceWidth(e,t,n,l)?l:i}probeInPlaceWidth(e,t,n,o){return this.inPlaceWidthProbeCount++,this.canExpandSegmentAndEndpoints(e,t,n,o)}maximizeGridRouteWidth(e){if(e.traceWidth>=this.nominalTraceWidth-_r)return e;let t=e.traceWidth,n=this.nominalTraceWidth;for(let i=0;i<7;i++){let s=(t+n)/2,a={...e,traceWidth:s};this.gridRouteReplacementCollides(a)||this.gridRouteBoundaryCollides(a)?n=s:t=s}let o=this.nominalTraceWidth>=0.5?0.025:0.0125,r=Math.max(e.traceWidth,Math.floor((t+_r)/o)*o);if(r>e.traceWidth+_r){let i={...e,traceWidth:r};if(!this.gridRouteReplacementCollides(i)&&!this.gridRouteBoundaryCollides(i))return this.pathWidthUpgradeCount++,i}return e}getExponentialIntervalCandidates(e,t,n){let o=this.getExponentialIndices(e,t,-1,n,5),r=this.getExponentialIndices(e,t,1,n,10).filter((s)=>s>t),i=[];for(let s of o)for(let a of r){let c=this.getRouteIntervalLength(e,s,a);c>10.000001||i.push({startIndex:s,endIndex:a,routeLength:c})}return i.sort((s,a)=>s.routeLength-a.routeLength).filter((s,a,c)=>c.findIndex((l)=>l.startIndex===s.startIndex&&l.endIndex===s.endIndex)===a).slice(0,10).map(({startIndex:s,endIndex:a})=>({startIndex:s,endIndex:a}))}getExponentialIndices(e,t,n,o,r){let i=[t],s=0,a=Math.max(o,0.3),c=t,l=t;for(;;){let h=c+n;if(h<0||h>=e.route.length)break;let d=e.route[c],u=e.route[h];if(!Os(d)||!Os(u)||d.layer!==u.layer)break;let _=Ms(d,u);if(s+_>r+_r)break;s+=_,c=h,l=h,s+_r>=a&&(i.push(h),a*=2)}return i.includes(l)||i.push(l),i}getRouteIntervalLength(e,t,n){let o=0;for(let r=t;r<n;r++){let i=e.route[r],s=e.route[r+1];if(!Os(i)||!Os(s)||i.layer!==s.layer)return Number.POSITIVE_INFINITY;o+=Ms(i,s)}return o}getCandidateWidths(e){let t=this.inputProblem.minTraceWidth;return hGt([e,0.875*e,0.75*e,0.625*e,0.5*e,0.375*e,0.25*e,t]).filter((n)=>n>=t-_r)}getGridResolutions(e){return hGt([Math.max(0.1,Math.min(0.5,e/2)),Math.max(0.1,Math.min(0.25,e/3))])}resolveNominalTraceWidth(e){let t=this.findConnectionForTrace(e);return Math.max(t?.nominalTraceWidth??t?.width??this.inputProblem.nominalTraceWidth??this.inputProblem.minTraceWidth,this.inputProblem.minTraceWidth)}getDesiredPadClearance(e=this.nominalTraceWidth){let t=Math.max(this.inputProblem.defaultObstacleMargin??0,this.inputProblem.minTraceToPadEdgeClearance??0,0.1);return e<0.499999||this.phase!=="cleanup"?t:Math.max(t,this.options.powerTraceToPadClearance??e/2)}findConnectionForTrace(e){let t=this.connectionByTraceId.get(e.pcb_trace_id);if(t!==void 0)return t??void 0;let n=this.getTraceConnectionNames(e),o=this.inputProblem.connections.find((r)=>this.connectionMatchesTrace(r,n))??null;return this.connectionByTraceId.set(e.pcb_trace_id,o),o??void 0}getOwnedTraceIndices(){return[...this.selectedOwnedTraceIndices]}connectionMatchesTrace(e,t){return[e.name,e.source_trace_id,e.rootConnectionName,e.netConnectionName,...e.mergedConnectionNames??[]].filter((n)=>Boolean(n)).some((n)=>t.includes(n))}getTraceConnectionNames(e){return[e.connection_name,e.source_trace_id,e.rootConnectionName,...e.mergedConnectionNames??[]].filter((t)=>Boolean(t))}traceMeetsNominalWidth(e,t){return e.route.every((n)=>n.route_type!=="wire"||n.width>=t-_r)}findNextUnderWidthSegment(e,t,n){for(let o=t;o<e.route.length-1;o++){let r=e.route[o],i=e.route[o+1];if(Os(r)&&Os(i)&&r.layer===i.layer&&(r.width<n-_r||i.width<n-_r))return o}return-1}getMutatedImmutableTraceIds(e){return this.immutableTraceIndices.flatMap((t)=>{let n=e[t];return JSON.stringify(n)===this.initialImmutableTraceSignatures.get(t)?[]:[n?.pcb_trace_id??this.traces[t]?.pcb_trace_id??String(t)]})}getImmutableViaViolationSignatures(e){let t=new Set;if(this.immutableTraceIndices.length===0)return t;let n=new xB(this.inputProblem,e),o=new c6(this.inputProblem,e,void 0,[],n);for(let r of this.immutableTraceIndices){let i=e[r];if(!i)continue;let s=[i.pcb_trace_id,i.connection_name,i.source_trace_id,i.rootConnectionName,...i.mergedConnectionNames??[],...i.connectsTo??[]].filter((a)=>Boolean(a));for(let a=0;a<i.route.length;a++){let c=i.route[a];if(c?.route_type!=="via")continue;let l=`${i.pcb_trace_id}:${a}`,h=o.getViaViolationSignatures({point:c,layers:o.boardLayers,padDiameter:c.via_diameter??this.inputProblem.min_via_pad_diameter??this.inputProblem.minViaPadDiameter??this.inputProblem.minViaDiameter??0.6,holeDiameter:c.via_hole_diameter??o.defaultViaHoleDiameter,connectionNames:s,ignoreTraceIndex:r,ignoreRouteRange:{start:a,end:a},blockSameNetObstacles:!0,sameNetObstacleClearance:0});for(let d of h)t.add(`${l}|${d}`)}}return t}countViolatingImmutableVias(e){return new Set([...e].map((t)=>t.split("|")[0])).size}acceptConnectivityCheckpoint(e,t){this.connectivityValidationCount++;let n=!1,o=!1;try{let r=this.connectivityInvariant.validate(e),i=this.getMutatedImmutableTraceIds(e),s=this.getImmutableViaViolationSignatures(e),a=[...s].filter((l)=>!this.lastSafeImmutableViaViolationSignatures.has(l)),c=a.length>0;if(n=!r.safe,o=i.length>0||c,this.connectivityValidationError??=r.validationError??null,!n&&!o)return this.traces=structuredClone(e),this.lastConnectivitySafeTraces=structuredClone(e),this.remainingImmutableViaViolationCount=this.countViolatingImmutableVias(s),this.remainingImmutableViaViolationPairCount=s.size,this.lastSafeImmutableViaViolationSignatures=s,this.connectivityInvariant=new sbe(this.inputProblem,this.lastConnectivitySafeTraces),!0;this.immutableTraceMutationIds=[...new Set([...this.immutableTraceMutationIds,...i])],c&&(this.immutableViaViolationRollbackCount++,this.attemptedImmutableViaViolationCount=this.countViolatingImmutableVias(s),this.attemptedImmutableViaViolationPairCount=s.size,this.immutableViaViolationRegressionIds=[...new Set([...this.immutableViaViolationRegressionIds,...a])]),this.connectivityRegressionEndpointIds=[...new Set([...this.connectivityRegressionEndpointIds,...r.regressions.flatMap((l)=>l.baselineEndpointLabels)])]}catch(r){n=!0,this.connectivityValidationError=r instanceof Error?r.message:String(r)}return n&&(this.connectivityRollbackCount++,this.connectivityRollbackPhases.includes(t)||this.connectivityRollbackPhases.push(t)),o&&(this.immutableSafetyRollbackCount++,this.immutableSafetyRollbackPhases.includes(t)||this.immutableSafetyRollbackPhases.push(t)),t==="expansion"?n?this.rollbackConnectivityRegressedExpansion():this.rollbackImmutableUnsafeExpansion():this.restoreLastConnectivitySafeTraces(),this.remainingImmutableViaViolationCount=this.countViolatingImmutableVias(this.lastSafeImmutableViaViolationSignatures),this.remainingImmutableViaViolationPairCount=this.lastSafeImmutableViaViolationSignatures.size,!1}rebuildObstacleIndex(){this.obstacleIndex=new c6(this.inputProblem,this.traces,this.traceIndex,[],this.connectionNameResolver)}retainFailedSubSolver(e){this.failedSubSolverCount++,this.failedSubSolvers??=[],this.failedSubSolvers.length<16?this.failedSubSolvers.push(e):this.failedSubSolvers[15]=e}tryFinalAcceptance(){this.finalAcceptanceUsed=!0;let e=!1;this.activeSubSolver instanceof yje?(this.activeSubSolver.tryFinalAcceptance(),this.adoptCleanupOutput(this.activeSubSolver),e=!0):this.activeSubSolver instanceof xje&&(this.activeSubSolver.tryFinalAcceptance(),this.adoptClearanceRepairOutput(this.activeSubSolver),e=!0),e||this.phase==="cleanup"||this.phase==="repair-trace-clearance"||this.phase==="complete"||this.discardInFlightExpansion(),this.activeSubSolver=null,this.pendingLayerOutput=null,this.pendingLayerPushCount=0,this.activeInflationKey=null,this.activeInflationWidth=null,this.layerAttempt=null,this.acceptConnectivityCheckpoint(this.traces,"final"),this.traceIndex=this.traces.length,this.phase="complete",this.rebuildObstacleIndex(),this.progress=1,this.solved=!0,this.stats=this.createStats()}createStats(){return{phase:this.phase,pass:this.passIndex+1,completedPassCount:this.completedPassCount,lastNormalizedWidthDeficitGain:this.lastNormalizedWidthDeficitGain,normalizedWidthDeficitGainByPass:[...this.normalizedWidthDeficitGainByPass],plateauReached:this.plateauReached,traceIndex:this.traceIndex,traceCount:this.traces.length,selectedTraceCount:this.traceOrder.length,routeSegmentIndex:this.routeSegmentIndex,nominalTraceWidth:this.nominalTraceWidth,intervalCursor:this.intervalCursor,intervalCount:this.currentIntervals.length,candidateWidth:this.candidateWidths[this.widthCursor],gridSize:this.gridResolutions[this.resolutionCursor],gridOffsetVariant:this.offsetCursor,keptTraceCount:this.keptTraceCount,recreatedTraceCount:this.recreatedTraceCount,expandedSegmentCount:this.expandedSegmentCount,intermediateExpandedSegmentCount:this.intermediateExpandedSegmentCount,pathWidthUpgradeCount:this.pathWidthUpgradeCount,inPlaceWidthProbeCount:this.inPlaceWidthProbeCount,reroutedSegmentCount:this.reroutedSegmentCount,unresolvedSegmentCount:this.unresolvedSegmentCount,attemptedGridCount:this.attemptedGridCount,attemptedLayerGridCount:this.attemptedLayerGridCount,attemptedInflationCount:this.attemptedInflationCount,activeInflationWidth:this.activeInflationWidth,pushedTraceCount:this.pushedTraceCount,elasticPushedTraceCount:this.elasticPushedTraceCount,layerReroutedTraceCount:this.layerReroutedTraceCount,insertedViaCount:this.insertedViaCount,neckedLayerSegmentCount:this.neckedLayerSegmentCount,removedViaPairCount:this.removedViaPairCount,removedViaCount:this.removedViaCount,simplifiedPathCount:this.simplifiedPathCount,normalizedSegmentCount:this.normalizedSegmentCount,cleanupClearanceShoveCount:this.cleanupClearanceShoveCount,relocatedViaCount:this.relocatedViaCount,unresolvedViaCount:this.unresolvedViaCount,initialImmutableViaViolationCount:this.initialImmutableViaViolationCount,remainingImmutableViaViolationCount:this.remainingImmutableViaViolationCount,initialImmutableViaViolationPairCount:this.initialImmutableViaViolationPairCount,remainingImmutableViaViolationPairCount:this.remainingImmutableViaViolationPairCount,skippedImmutableViaRepairCount:this.remainingImmutableViaViolationCount,immutableViaViolationRollbackCount:this.immutableViaViolationRollbackCount,attemptedImmutableViaViolationCount:this.attemptedImmutableViaViolationCount,attemptedImmutableViaViolationPairCount:this.attemptedImmutableViaViolationPairCount,immutableViaViolationRegressionIds:[...this.immutableViaViolationRegressionIds],immutableTraceMutationIds:[...this.immutableTraceMutationIds],padClearanceRerouteCount:this.padClearanceRerouteCount,unresolvedPadClearanceCount:this.unresolvedPadClearanceCount,repairedTraceClearanceSegmentCount:this.repairedTraceClearanceSegmentCount,repairedPadNeckSegmentCount:this.repairedPadNeckSegmentCount,unresolvedTraceClearanceSegmentCount:this.unresolvedTraceClearanceSegmentCount,sameNetContactRejectionCount:this.sameNetContactRejectionCount,connectivityValidationCount:this.connectivityValidationCount,connectivityRollbackCount:this.connectivityRollbackCount,connectivityRollbackPhases:[...this.connectivityRollbackPhases],immutableSafetyRollbackCount:this.immutableSafetyRollbackCount,immutableSafetyRollbackPhases:[...this.immutableSafetyRollbackPhases],connectivityRegressionEndpointIds:[...this.connectivityRegressionEndpointIds],connectivityValidationError:this.connectivityValidationError,connectivityRollbackMutationStats:this.connectivityRollbackMutationStats===null?null:{...this.connectivityRollbackMutationStats},immutableSafetyRollbackMutationStats:this.immutableSafetyRollbackMutationStats===null?null:{...this.immutableSafetyRollbackMutationStats},expansionPushedTraceIndices:[...this.expansionPushedTraceIndices],cleanupMutatedTraceIndices:[...this.cleanupMutatedTraceIndices],discardedExpansionMutationStats:this.discardedExpansionMutationStats===null?null:{...this.discardedExpansionMutationStats},initialPadClearanceViolationCount:this.initialPadClearanceViolationCount,remainingPadClearanceViolationCount:this.remainingPadClearanceViolationCount,initialPadClearanceViolationCountByClearance:{...this.initialPadClearanceViolationCountByClearance},remainingPadClearanceViolationCountByClearance:{...this.remainingPadClearanceViolationCountByClearance},budgetLimitedExpansion:this.budgetLimitedExpansion,finalAcceptanceUsed:this.finalAcceptanceUsed,cleanupCompleted:this.cleanupCompleted,clearanceRepairCompleted:this.clearanceRepairCompleted,cleanupBestEffortAccepted:this.cleanupBestEffortAccepted,clearanceRepairBestEffortAccepted:this.clearanceRepairBestEffortAccepted,cleanupStatus:this.connectivityRollbackPhases.includes("cleanup")?"connectivity_rollback":this.immutableSafetyRollbackPhases.includes("cleanup")?"immutable_safety_rollback":this.cleanupBestEffortAccepted?"budget_limited":this.cleanupCompleted?"completed":this.phase==="cleanup"?"in_progress":"not_started",clearanceRepairStatus:this.connectivityRollbackPhases.includes("clearance-repair")?"connectivity_rollback":this.immutableSafetyRollbackPhases.includes("clearance-repair")?"immutable_safety_rollback":this.clearanceRepairBestEffortAccepted?"budget_limited":this.clearanceRepairCompleted?"completed":this.phase==="repair-trace-clearance"?"in_progress":"not_started",cleanupIterationBudget:this.cleanupIterationBudget,clearanceRepairIterationBudget:this.clearanceRepairIterationBudget,completionReason:this.phase==="complete"||this.solved?this.connectivityRollbackCount>0?"connectivity_rollback":this.immutableSafetyRollbackCount>0?"immutable_safety_rollback":this.connectivityValidationError?"connectivity_validation_unavailable":this.finalAcceptanceUsed?"total_iteration_budget":this.budgetLimitedExpansion?"expansion_budget":this.cleanupBestEffortAccepted?"cleanup_budget":this.clearanceRepairBestEffortAccepted?"clearance_repair_budget":this.remainingImmutableViaViolationCount>0?"immutable_via_violations_preserved":"completed":null,resultStatus:this.finalAcceptanceUsed||this.budgetLimitedExpansion||this.cleanupBestEffortAccepted||this.clearanceRepairBestEffortAccepted||this.connectivityRollbackCount>0||this.immutableSafetyRollbackCount>0||this.connectivityValidationError!==null||this.remainingImmutableViaViolationCount>0?"best_effort":"complete",failedSubSolverCount:this.failedSubSolverCount,retainedFailedSubSolverCount:this.failedSubSolvers?.length??0,expansionIterationBudget:this.getExpansionIterationBudget(),finalizationIterationReserve:this.getFinalizationIterationReserve(),spatialIndexRectCount:this.obstacleIndex.items.length}}computeProgress(){return this.solved||this.phase==="complete"?1:this.budgetLimitedExpansion?0.99:this.traceOrder.length===0?1:Math.min(0.99,(this.passIndex+Math.max(0,this.traceOrderCursor)/this.traceOrder.length)/this.maxPassCount)}getConstructorParams(){return[this.inputProblem,this.options]}getOutput(){return structuredClone(this.lastConnectivitySafeTraces)}visualize(){let e=[],t=[];for(let n=0;n<this.traces.length;n++){let o=this.traces[n],r=this.resolveNominalTraceWidth(o);for(let i of o.route)i.route_type==="via"&&t.push({center:i,radius:(i.via_diameter??0.6)/2,fill:"#d4a017",stroke:"#7a5700"});for(let i=0;i<o.route.length-1;i++){let s=o.route[i],a=o.route[i+1];if(!Os(s)||!Os(a)||s.layer!==a.layer)continue;let c=n===this.traceIndex&&i===this.routeSegmentIndex,l=s.width>=r-_r&&a.width>=r-_r,h=s.layer==="bottom";e.push({points:[s,a],strokeColor:c?"#ff8c00":l?h?"#2468c7":"#169c45":h?"#8b4bb8":"#cc3344",strokeWidth:Math.max(s.width,a.width)})}}return{coordinateSystem:"cartesian",title:`Power trace expander: ${this.phase}`,lines:e,points:[],circles:t,rects:this.obstacleIndex.items.filter((n)=>n.kind==="obstacle").slice(0,2000).map((n)=>({center:{x:(n.minX+n.maxX)/2,y:(n.minY+n.maxY)/2},width:n.maxX-n.minX,height:n.maxY-n.minY,fill:"rgba(80,80,80,0.12)",stroke:"rgba(80,80,80,0.35)"})),texts:[]}}},Qan=class extends ei{constructor(e,t={}){if(super(),this.inputSrj=e,this.options=t,this.powerTraceExpanderSolver=new h6r(e,t),t.onlyConnectionNames?.length===0)return this.MAX_ITERATIONS=1,this.progress=1,this.solved=!0,void(this.stats={selectedTraceCount:0,bypassed:!0});this.MAX_ITERATIONS=this.powerTraceExpanderSolver.MAX_ITERATIONS+1}inputSrj;options;powerTraceExpanderSolver;_step(){let e=this.powerTraceExpanderSolver;if(e.step(),this.progress=e.progress,this.stats=e.stats,e.failed)return this.error=e.error,void(this.failed=!0);e.solved&&(this.solved=!0)}getConstructorParams(){return[this.inputSrj,this.options]}getOutput(){if(!this.solved)throw Error("Cannot get power trace expansion output before solving");return this.powerTraceExpanderSolver.getOutput()}visualize(){return rx({...this.inputSrj,traces:this.getOutput()},{traceColorMode:"layer"})}},JZe=({connections:e,originalConnections:t,layerCount:n,obstacles:o,defaultViaHoleDiameter:r,connMap:i})=>{let s=new Map;for(let d of t)s.has(d.name)||s.set(d.name,d.__netConnectionName);let a=e.map((d)=>{if(d.pointsToConnect.length!==2)throw Error(`Expected Pipeline7 output connection "${d.name}" to have two points, got ${d.pointsToConnect.length}`);let[u,_]=d.pointsToConnect;return{connection:d,connectsTo:[u?.pointId,_?.pointId].filter((p)=>Boolean(p)),outputConnectionName:d.__netConnectionName??s.get(d.name)??d.__rootConnectionNames?.[0]??d.name}}),c=o.filter((d)=>(d.__zLayers?.length??d.layers?.length??0)>1),l=new Map,h=(d)=>{let u=l.get(d.connectionName);u||(u=new Map,l.set(d.connectionName,u));let _=u.get(d.rootConnectionName);if(_)return _;let p=c.filter((m)=>_B(m,d,i));return u.set(d.rootConnectionName,p),p};return(d)=>{let u=[],_=new Map;for(let p of d){let m=_.get(p.connectionName);m?m.push(p):_.set(p.connectionName,[p])}for(let{connection:p,connectsTo:m,outputConnectionName:A}of a){let g=_.get(p.name)??[];for(let f=0;f<g.length;f+=1){let y=g[f];u.push({type:"pcb_trace",pcb_trace_id:`${p.name}_${f}`,connection_name:A,connectsTo:m,route:k3(y,n,{connectionPoints:p.pointsToConnect,defaultViaHoleDiameter:r,connectedMultilayerObstacles:h(y),connMap:i})})}}return u}},H$e=({connections:e,originalConnections:t,hdRoutes:n,layerCount:o,obstacles:r,defaultViaHoleDiameter:i,connMap:s})=>JZe({connections:e,originalConnections:t,layerCount:o,obstacles:r,defaultViaHoleDiameter:i,connMap:s})(n),kan=(e)=>{let t=Math.max(e.minTraceWidth+0.1,2*e.minTraceWidth);return e.connections.flatMap((n)=>(n.nominalTraceWidth??e.nominalTraceWidth??e.minTraceWidth)+0.000001>=t?[n.name]:[])},Lan=({hdRoutes:e,connections:t})=>{let n=new Map(t.map((o)=>[o.name,o]));return e.map((o)=>{if(o.route.length===0)throw Error(`Cannot lock PCB terminals for empty route "${o.connectionName}"`);let r=n.get(o.connectionName);if(!r)throw Error(`Cannot lock PCB terminals: connection "${o.connectionName}" was not found`);if(r.pointsToConnect.length!==2)throw Error(`Cannot lock PCB terminals for "${o.connectionName}": expected 2 connection points, found ${r.pointsToConnect.length}`);let i=new Map;for(let h of r.pointsToConnect)if(h.pcb_port_id){if(i.has(h.pcb_port_id))throw Error(`Cannot lock duplicate PCB terminal "${h.pcb_port_id}" for "${o.connectionName}"`);i.set(h.pcb_port_id,h)}if(i.size===0)return o;let s=[o.startPcbPortId,o.endPcbPortId].filter((h)=>h!==void 0);if(s.length===0)return o;if(new Set(s).size!==s.length||s.some((h)=>!i.has(h)))throw Error(`Cannot lock PCB terminals for "${o.connectionName}": route endpoint IDs do not match connection terminal IDs`);let a=o.startPcbPortId?i.get(o.startPcbPortId):void 0,c=o.endPcbPortId?i.get(o.endPcbPortId):void 0,l=o.route.map((h,d)=>{if(d===0&&a)return{...h,x:a.x,y:a.y,pcb_port_id:a.pcb_port_id};if(d===o.route.length-1&&c)return{...h,x:c.x,y:c.y,pcb_port_id:c.pcb_port_id};let u={...h};return delete u.pcb_port_id,u});return{...o,route:l}})},Han=({originalSrj:e,newlyRoutedTraces:t,currentPreloadedTraces:n,expandedConnectionNames:o,resolveConnectedTraceAliases:r=!1})=>{let i=n??e.traces??[],s=r?d6r({originalSrj:e,newlyRoutedTraces:t,preloadedTraces:i,expandedConnectionNames:o}):new Set(i.filter((h)=>o.includes(h.connection_name))),a=i.filter((h)=>!s.has(h)),c=new Set([...t.map((h)=>h.pcb_trace_id),...a.map((h)=>h.pcb_trace_id)]),l=i.filter((h)=>s.has(h)).map((h)=>{let d=h.pcb_trace_id,u=d,_=2;for(;c.has(u);)u=`${d}_power_expansion_${_++}`;return c.add(u),{...h,pcb_trace_id:u,__replaces_pcb_trace_id:h.__replaces_pcb_trace_id??h.pcb_trace_id}});return{...e,traces:[...t,...l],fixedTraces:a}},d6r=({originalSrj:e,newlyRoutedTraces:t,preloadedTraces:n,expandedConnectionNames:o})=>{let r=new Set(n.map((l)=>l.pcb_trace_id)),i=new Set([...r,...t.map((l)=>l.pcb_trace_id)]),s=t.map((l,h)=>{if(!r.has(l.pcb_trace_id))return l;let d=`__pipeline7_new_trace_${h}_${l.pcb_trace_id}`,u=d,_=2;for(;i.has(u);)u=`${d}_${_++}`;return i.add(u),{...l,pcb_trace_id:u}}),a=new xB({...e,traces:[...s,...n]}),c=new Set(a.canonicalize([...o]));return new Set(n.filter((l)=>a.canonicalize([l.connection_name]).some((h)=>c.has(h))))};function dGt(e){return new Set((e??[]).filter((t)=>t._isComponentTopologyNode).map((t)=>t.capacityMeshNodeId))}function Fan(e,t){return e.nodeIds.some((n)=>t.has(n))}function u6r({sharedEdgeSegments:e,componentCapacityMeshNodeIds:t}){return e.filter((n)=>!Fan(n,t))}function nm(e,t,n,o={}){return{solverName:e,solverClass:t,getConstructorParams:n,onSolved:o.onSolved}}var zan=class extends ei{constructor(e,t={}){super(),this.srj=e,this.opts=t;let n=oP(e);this.originalSrj=n,this.opts={...t};let o=this.opts;if(this.effort=o.effort??1,this.MAX_ITERATIONS=1e8*this.effort,this.maxNodeDimension=o.maxNodeDimension??16,this.maxNodeRatio=o.maxNodeRatio??6,this.minNodeArea=o.minNodeArea??0.010000000000000002,this.visualizationTraceColorMode=o.visualizationTraceColorMode??"layer",this.setSimpleRouteJson(n),o.capacityDepth===void 0){let r=this.srj.bounds.maxX-this.srj.bounds.minX,i=this.srj.bounds.maxY-this.srj.bounds.minY,s=Math.max(r,i),a=o.targetMinCapacity??0.5;o.capacityDepth=ik(s,a)}this.cacheProvider=o.cacheProvider===void 0?hv():o.cacheProvider===null?null:o.cacheProvider,this.startTimeOfPhase={},this.endTimeOfPhase={},this.timeSpentOnPhase={}}srj;opts;getSolverName(){return"AutoroutingPipelineSolver7_MultiGraph"}preprocessSimpleRouteJsonSolver;escapeViaLocationSolver;netToPointPairsSolver;componentTopologyGeneratorSolver;topologyPlanningSolver;topologyMergingSolver;globalTopologyGeneratorSolver;nodeDimensionSubdivisionSolver;nodeTargetMerger;edgeSolver;colorMap;highDensityRouteSolver;highDensityForceImproveSolver;highDensityRepairSolver;highDensityStitchSolver;globalDrcForceImproveSolver;exactGeometryDrcForceImproveSolver;singleLayerNodeMerger;strawSolver;deadEndSolver;traceSimplificationSolver;lengthMatchingPostProcessingSolver;powerTraceExpansionSolver;availableSegmentPointSolver;portPointPathingSolver;multiSectionPortPointOptimizer;uniformPortDistributionSolver;traceWidthSolver;necessaryCrampedPortPointSolver;componentDetectionSolver;viaDiameter;viaHoleDiameter;minTraceWidth;effort;maxNodeDimension;maxNodeRatio;minNodeArea;visualizationTraceColorMode;startTimeOfPhase;endTimeOfPhase;timeSpentOnPhase;activeSubSolver=null;connMap;srjWithEscapeViaLocations;srjWithPointPairs;originalSrj;capacityNodes=null;capacityEdges=null;sharedEdgeSegmentsWithNecessaryCrampedPortPoints;highDensityNodePortPoints;cacheProvider=null;pipelineDef=[nm("preprocessSimpleRouteJsonSolver",r6e,(e)=>[e.originalSrj,{traceColorMode:e.visualizationTraceColorMode}],{onSolved:(e)=>{e.setSimpleRouteJson(e.preprocessSimpleRouteJsonSolver.getOutputSimpleRouteJson())}}),nm("componentDetectionSolver",van,(e)=>[{inputSrj:e.srj}]),nm("escapeViaLocationSolver",t6e,(e)=>[e.srj,{viaDiameter:e.viaDiameter,minTraceWidth:e.minTraceWidth,obstacleMargin:e.srj.defaultObstacleMargin??0.15}],{onSolved:(e)=>{e.srjWithEscapeViaLocations=e.escapeViaLocationSolver?.getOutputSimpleRouteJson()}}),nm("netToPointPairsSolver",Vq,(e)=>{let t=e.srjWithEscapeViaLocations??e.srj;return[t,e.colorMap,nk(t)]},{onSolved:(e)=>{e.srjWithPointPairs=e.netToPointPairsSolver?.getNewSimpleRouteJson(),e.colorMap=JA(e.srjWithPointPairs,e.connMap),e.connMap=im(e.srjWithPointPairs)}}),nm("topologyPlanningSolver",Man,(e)=>[{inputSrj:e.srjWithPointPairs,componentDetectionOutput:e.componentDetectionSolver.getOutput(),viaDiameter:e.viaDiameter,obstacleMargin:e.srj.defaultObstacleMargin??0.15}],{onSolved:(e)=>{e.topologyPlanningSolver.getOutput(),e.globalTopologyGeneratorSolver=e.topologyPlanningSolver.globalTopologySolver,e.componentTopologyGeneratorSolver=new wan(e.topologyPlanningSolver)}}),nm("topologyMergingSolver",Ean,(e)=>{let t=e.topologyPlanningSolver.getOutput();return[{layerCount:e.srj.layerCount,nodeGroups:[{groupId:"global",nodes:t.globalMeshNodes,isComponent:!1},...t.componentMeshNodes.map((n,o)=>({groupId:`component-${o}`,nodes:n,isComponent:!0}))]}]},{onSolved:(e)=>{e.capacityNodes=e.topologyMergingSolver.getOutput()}}),nm("nodeDimensionSubdivisionSolver",Zbe,(e)=>[e.capacityNodes,e.maxNodeDimension,e.maxNodeRatio,e.minNodeArea],{onSolved:(e)=>{e.capacityNodes=e.nodeDimensionSubdivisionSolver.outputNodes}}),nm("edgeSolver",ok,(e)=>[e.capacityNodes],{onSolved:(e)=>{e.capacityEdges=e.edgeSolver?.edges}}),nm("availableSegmentPointSolver",tY,(e)=>[{nodes:e.capacityNodes,edges:e.capacityEdges||[],traceWidth:e.minTraceWidth,colorMap:e.colorMap,shouldReturnCrampedPortPoints:!0}]),nm("necessaryCrampedPortPointSolver",jle,(e)=>{let t=dGt(e.capacityNodes);return[{capacityMeshNodes:e.capacityNodes.filter((n)=>!t.has(n.capacityMeshNodeId)),sharedEdgeSegments:u6r({sharedEdgeSegments:e.availableSegmentPointSolver.getOutput(),componentCapacityMeshNodeIds:t}),simpleRouteJson:e.srjWithPointPairs}]},{onSolved:(e)=>{let t=dGt(e.capacityNodes);e.sharedEdgeSegmentsWithNecessaryCrampedPortPoints=function({originalSharedEdgeSegments:n,filteredSharedEdgeSegments:o,componentCapacityMeshNodeIds:r}){let i=new Map(o.map((s)=>[s.edgeId,s]));return n.map((s)=>Fan(s,r)?s:i.get(s.edgeId)??s)}({originalSharedEdgeSegments:e.availableSegmentPointSolver.getOutput(),filteredSharedEdgeSegments:e.necessaryCrampedPortPointSolver.getOutput(),componentCapacityMeshNodeIds:t})}}),nm("portPointPathingSolver",e6e,(e)=>{let t=e.sharedEdgeSegmentsWithNecessaryCrampedPortPoints??e.necessaryCrampedPortPointSolver?.getOutput()??e.availableSegmentPointSolver.getOutput(),{graph:n,connections:o}=Kle({capacityMeshNodes:e.capacityNodes,layerCount:e.srj.layerCount,connectivityMap:e.connMap,segmentPortPoints:t.flatMap((r)=>r.portPoints),simpleRouteJsonConnections:e.srjWithPointPairs.connections});return[{graph:n,connections:o,layerCount:e.srj.layerCount,effort:Math.min(1,e.effort),preserveTerminalPcbPortIds:!0,minViaPadDiameter:e.viaDiameter,flags:{FORCE_CENTER_FIRST:!0,RIPPING_ENABLED:!0,USE_SELECTIVE_RERIP_ROUTING:!0},weights:{SHUFFLE_SEED:0,MEMORY_PF_FACTOR:4,CENTER_OFFSET_DIST_PENALTY_FACTOR:0,CENTER_OFFSET_FOCUS_SHIFT:0,NODE_PF_FACTOR:0,LAYER_CHANGE_COST:0,RIPPING_PF_COST:0,NODE_PF_MAX_PENALTY:100,BASE_CANDIDATE_COST:0.6,MAX_ITERATIONS_PER_PATH:0,RANDOM_WALK_DISTANCE:0,START_RIPPING_PF_THRESHOLD:0.3,END_RIPPING_PF_THRESHOLD:1,MAX_RIPS:1000,RANDOM_RIP_FRACTION:0.3,STRAIGHT_LINE_DEVIATION_PENALTY_FACTOR:4,GREEDY_MULTIPLIER:0.7,MIN_ALLOWED_BOARD_SCORE:-1e4}}]}),nm("uniformPortDistributionSolver",Tle,(e)=>[{nodeWithPortPoints:e.portPointPathingSolver?.getOutput().nodesWithPortPoints??[],inputNodesWithPortPoints:e.portPointPathingSolver?.getOutput().inputNodeWithPortPoints??[],minTraceWidth:e.minTraceWidth,obstacles:e.srj.obstacles,layerCount:e.srj.layerCount}]),nm("highDensityRouteSolver",cY,(e)=>{let t=e.uniformPortDistributionSolver?.getOutput()??[],n=e.portPointPathingSolver?.getOutput().nodesWithPortPoints??[],o=t.length>0?t:n;return e.highDensityNodePortPoints=structuredClone(o),[{nodePortPoints:o,nodePfById:new Map((e.portPointPathingSolver?.getOutput().inputNodeWithPortPoints??[]).map((r)=>[r.capacityMeshNodeId,e.portPointPathingSolver?.computeNodePf(r)??null])),colorMap:e.colorMap,connMap:e.connMap,viaDiameter:e.viaDiameter,traceWidth:e.minTraceWidth,obstacleMargin:e.srj.defaultObstacleMargin??0.15,obstacles:e.srj.obstacles,layerCount:e.srj.layerCount,useGrowShrinkHighDensityIntraNodeSolver:!0,preserveTerminalPcbPortIds:!0,growShrinkFallbackToInvalidGeometryOnFailure:!0,captureSearchDebug:!1}]}),nm("highDensityForceImproveSolver",$le,(e)=>[{nodeWithPortPoints:e.highDensityNodePortPoints??[],hdRoutes:e.highDensityRouteSolver.routes,colorMap:e.colorMap,totalStepsPerNode:Math.max(12,Math.round(20*Math.min(1,e.effort))),nodeAssignmentMargin:e.srj.defaultObstacleMargin??0.2}]),nm("highDensityRepairSolver",qle,(e)=>[{nodeWithPortPoints:e.highDensityNodePortPoints??[],hdRoutes:e.highDensityForceImproveSolver?.getOutput()??e.highDensityRouteSolver.routes,obstacles:e.srj.obstacles,colorMap:e.colorMap,repairMargin:e.srj.defaultObstacleMargin??0.2,minimumTraceWidth:e.srj.minTraceWidth,connMap:e.connMap}]),nm("highDensityStitchSolver",o6e,(e)=>[{connections:e.srjWithPointPairs.connections,hdRoutes:e.highDensityRepairSolver?.getOutput()??e.highDensityForceImproveSolver?.getOutput()??e.highDensityRouteSolver.routes,colorMap:e.colorMap,layerCount:e.srj.layerCount,defaultViaDiameter:e.viaDiameter,preserveTerminalPcbPortIds:!0}]),nm("traceSimplificationSolver",s6,(e)=>[{hdRoutes:e.highDensityStitchSolver.mergedHdRoutes,obstacles:e.srj.obstacles,connMap:e.connMap,colorMap:e.colorMap,outline:e.srj.outline,defaultViaDiameter:e.viaDiameter,layerCount:e.srj.layerCount,minTraceToPadEdgeClearance:e.srj.minTraceToPadEdgeClearance,minBoardEdgeClearance:e.srj.minBoardEdgeClearance,enableCrossingViaReduction:!0,iterations:2}]),nm("traceWidthSolver",Yq,(e)=>[{hdRoutes:e.traceSimplificationSolver.simplifiedHdRoutes,obstacles:e.srj.obstacles,connMap:e.connMap,colorMap:e.colorMap,minTraceWidth:e.minTraceWidth,connection:e.srj.connections,obstacleMargin:e.srj.minTraceToPadEdgeClearance??0.15,layerCount:e.srj.layerCount}]),nm("globalDrcForceImproveSolver",NS,(e)=>[{srj:e.srjWithPointPairs,hdRoutes:Lan({hdRoutes:e.traceWidthSolver.getHdRoutesWithWidths(),connections:e.netToPointPairsSolver?.newConnections??[]}),connMap:e.connMap,effort:Math.min(1,e.effort),maxIterations:16,enableLargeBoardBroadFallback:!1,enablePostSolveClearanceRelaxation:!1}]),nm("exactGeometryDrcForceImproveSolver",wrn,(e)=>{let t=e.globalDrcForceImproveSolver.getOutput(),n=((o)=>{let r={...o.srjWithPointPairs,obstacles:o.originalSrj.obstacles,minTraceWidth:o.originalSrj.minTraceWidth,minViaDiameter:o.originalSrj.minViaDiameter??o.srjWithPointPairs.minViaDiameter},i=Math.max(rm(o.originalSrj).padDiameter,r.minTraceWidth)+Math.max(0.1,0.1),s=new Hle(r,{connMap:o.connMap,includeTraceViaOwnerMetadata:!0,traceClearance:0.1,viaClearance:0.1,spatialCellSize:i}),a=JZe(o),c=o.originalSrj.traces??[];return({routes:l,hdRoutes:h})=>{let d=l??h;if(!d)throw Error("Pipeline7 autorouting DRC evaluation requires HD routes");let u=a(d),_=c.length?[...c,...u]:u;return s.evaluate(_)}})({connections:e.netToPointPairsSolver?.newConnections??[],originalConnections:e.originalSrj.connections,layerCount:e.srj.layerCount,obstacles:e.srj.obstacles,defaultViaHoleDiameter:e.viaHoleDiameter,connMap:e.connMap,srjWithPointPairs:e.srjWithPointPairs,originalSrj:e.originalSrj});return[{srj:e.srjWithPointPairs,hdRoutes:t,connMap:e.connMap,effort:Math.min(1,e.effort),viaHoleDiameter:e.viaHoleDiameter,drcEvaluator:n,viaInPadDrcEvaluator:n,maxIterations:32,enableLargeBoardBroadFallback:!1,enableBroadFallback:!1,enableTargetedErrorSweep:!0,enablePostSolveClearanceRelaxation:!1,enableSafeTraceLayerMoves:!0,enableViaInPadLayerMoves:e.originalSrj.allowViaInPad??!1,viaInPadMaxIterations:32,broadMaxIterations:12,broadPassMultiplier:3}]}),nm("lengthMatchingPostProcessingSolver",_an,(e)=>{let t=e.netToPointPairsSolver;if(!t)throw Error("Pipeline7: length-matching post-processing requires NetToPointPairsSolver output");let n=t.newConnections,o=new Map;for(let s of e.srj.differentialPairs??[])for(let a of s.connectionNames){let c=n.filter((l)=>l.name===a||l.__rootConnectionNames?.includes(a)||l.__netConnectionName===a);if(c.length!==1)throw Error(`Pipeline7: differential pair connection "${a}" must resolve to exactly one final point-pair connection, got ${c.length}`);o.set(a,c[0].name)}let r=e.exactGeometryDrcForceImproveSolver.getOutput(),i=(e.srj.differentialPairs??[]).map((s)=>{let a=s.connectionNames.map((h)=>{let d=o.get(h);if(!d)throw Error(`Pipeline7: differential pair connection "${h}" is missing from final routed output`);return d});if(a[0]===a[1])throw Error(`Pipeline7: differential pair ${s.connectionNames.join("/")} resolves both members to "${a[0]}"`);if(s.traceGap===void 0)return{connectionNames:a,lengthTolerance:s.lengthTolerance,maxUncoupledLength:s.maxUncoupledLength};let c=a.map((h)=>{let d=r.filter((u)=>u.connectionName===h);if(d.length!==1)throw Error(`Pipeline7: differential pair connection "${h}" must resolve to exactly one final HD route, got ${d.length}`);return d[0]}),l=s.traceGap+c.reduce((h,d)=>h+d.traceThickness/2,0);return{connectionNames:a,lengthTolerance:s.lengthTolerance,maxUncoupledLength:s.maxUncoupledLength,minimumCenterlineDistance:l,maximumCenterlineDistance:l}});return[{hdRoutes:r,differentialPairs:i,obstacles:e.srj.obstacles,bounds:e.srj.bounds,layerCount:e.srj.layerCount}]}),nm("powerTraceExpansionSolver",Qan,(e)=>{let t=e.opts.powerTraceExpansion??{},n=t.onlyConnectionNames??kan(e.originalSrj);return[Han({originalSrj:e.originalSrj,newlyRoutedTraces:e.getPrePowerTraceOutputSimplifiedPcbTraces(),expandedConnectionNames:n}),{allowNewVias:!1,...t,onlyConnectionNames:n}]})];setSimpleRouteJson(e){this.srj=e;let t=rm(this.srj);this.viaDiameter=t.padDiameter,this.viaHoleDiameter=t.holeDiameter,this.minTraceWidth=this.srj.minTraceWidth,this.connMap=im(this.srj),this.colorMap=JA(this.srj,this.connMap)}getConstructorParams(){return[this.srj,this.opts]}currentPipelineStepIndex=0;computeProgress(){let e=this.activeSubSolver?.progress??0;return(this.currentPipelineStepIndex+e)/this.pipelineDef.length}_step(){let e=this.pipelineDef[this.currentPipelineStepIndex];if(!e)return void(this.solved=!0);if(this.activeSubSolver)return this.activeSubSolver.step(),void(this.activeSubSolver.solved?(this.endTimeOfPhase[e.solverName]=performance.now(),this.timeSpentOnPhase[e.solverName]=this.endTimeOfPhase[e.solverName]-this.startTimeOfPhase[e.solverName],e.onSolved?.(this),this.activeSubSolver=null,this.currentPipelineStepIndex++):this.activeSubSolver.failed&&(this.error=this.activeSubSolver?.error,this.failed=!0,this.activeSubSolver=null));let t=e.getConstructorParams(this);this.activeSubSolver=new e.solverClass(...t),this.activeSubSolver instanceof s6&&(this.activeSubSolver.MAX_SIMPLIFICATION_PIPELINE_LOOPS=Math.ceil(this.activeSubSolver.MAX_SIMPLIFICATION_PIPELINE_LOOPS*Math.min(1,this.effort))),e.solverName!=="lengthMatchingPostProcessingSolver"&&e.solverName!=="powerTraceExpansionSolver"||(this.MAX_ITERATIONS=Math.max(this.MAX_ITERATIONS,this.iterations+this.activeSubSolver.MAX_ITERATIONS+1)),this[e.solverName]=this.activeSubSolver,this.timeSpentOnPhase[e.solverName]=0,this.startTimeOfPhase[e.solverName]=performance.now()}solveUntilPhase(e){for(;this.getCurrentPhase()!==e;)this.step()}getCurrentPhase(){return this.pipelineDef[this.currentPipelineStepIndex]?.solverName??"none"}visualize(){if(!this.solved&&this.activeSubSolver)return this.visualizeStage(this.activeSubSolver);let e=this.escapeViaLocationSolver?.visualize(),t=this.netToPointPairsSolver?.visualize(),n=this.componentDetectionSolver?.visualize(),o=this.componentTopologyGeneratorSolver?.visualize(),r=this.globalTopologyGeneratorSolver?.visualize(),i=this.topologyMergingSolver?.visualize(),s=this.nodeDimensionSubdivisionSolver?.visualize(),a=this.nodeTargetMerger?.visualize(),c=this.singleLayerNodeMerger?.visualize(),l=this.strawSolver?.visualize(),h=this.edgeSolver?.visualize(),d=this.deadEndSolver?.visualize(),u=this.availableSegmentPointSolver?.visualize(),_=this.portPointPathingSolver?.visualize(),p=this.multiSectionPortPointOptimizer?.visualize(),m=this.uniformPortDistributionSolver?.visualize(),A=this.highDensityRouteSolver?.visualize(),g=this.highDensityForceImproveSolver?.visualize(),f=this.highDensityRepairSolver?.visualize(),y=this.highDensityStitchSolver?.visualize(),x=this.traceSimplificationSolver?.visualize(),C=this.lengthMatchingPostProcessingSolver?.visualize(),b=this.traceWidthSolver?.visualize(),I=this.necessaryCrampedPortPointSolver?.visualize(),v=(this.highDensityRouteSolver?.visualize(),this.originalSrj),P=v.outline,M=[];if(M.push({points:[{x:v.bounds?.minX??-50,y:v.bounds?.minY??-50},{x:v.bounds?.maxX??50,y:v.bounds?.minY??-50},{x:v.bounds?.maxX??50,y:v.bounds?.maxY??50},{x:v.bounds?.minX??-50,y:v.bounds?.maxY??50},{x:v.bounds?.minX??-50,y:v.bounds?.minY??-50}],strokeColor:"rgba(255,0,0,0.25)"}),P&&P.length>=2){let Y=P.map((X)=>({x:X.x,y:X.y}));Y.push({...Y[0]}),M.push({points:Y,strokeColor:"rgba(0, 136, 255, 0.95)"})}let B=bB(v),T={points:[...v.connections.flatMap((Y)=>Y.pointsToConnect.map((X)=>({...X,layer:IB(X,v.layerCount),label:`${Y.name} ${X.pcb_port_id??""}`})))],rects:[...(v.obstacles??[]).filter((Y)=>!Y.isCopperPour).map((Y)=>({...Y,fill:Y.layers?.includes("top")?"rgba(255,0,0,0.25)":Y.layers?.includes("bottom")?"rgba(0,0,255,0.25)":"rgba(255,0,0,0.25)",layer:$S(Y,v.layerCount),label:B(Y)}))],lines:M},N={traceColorMode:this.visualizationTraceColorMode},D=yB({srj:v,visualizationOptions:N}),L=Bl(T,D),H=this.preprocessSimpleRouteJsonSolver?.visualize(),V=this.globalDrcForceImproveSolver?.visualize(),O=this.exactGeometryDrcForceImproveSolver?.visualize(),U=[L,H,n,o,e,t,r,i,s,a,c,l,h,d,u,I,_,p,m,A?Bl(T,A):null,g,f,y,x,b,V,O,C,this.solved?Bl({lines:M},yB({srj:this.originalSrj,visualizationOptions:N}),this.visualizeFinalOutput()):null].filter(Boolean),j=Bl(...U);return this.visualizationTraceColorMode==="net"?tbe(j,this.colorMap):j}visualizeStage(e){let t=e.visualize();return this.visualizationTraceColorMode==="net"?tbe(t,this.colorMap):t}visualizeFinalOutput(){let e=this.visualizationTraceColorMode,t=this.getOutputSimpleRouteJson();return rx(t,{traceColorMode:e})}preview(){if(this.highDensityRouteSolver){let e=[];for(let t=this.highDensityRouteSolver.routes.length-1;t>=0;t--){let n=this.highDensityRouteSolver.routes[t];if(e.push({points:n.route.map((o)=>({x:o.x,y:o.y})),strokeColor:this.colorMap[n.connectionName]}),e.length>200)break}return{lines:e}}return this.portPointPathingSolver?this.portPointPathingSolver.preview():this.netToPointPairsSolver?this.netToPointPairsSolver.visualize():this.escapeViaLocationSolver?this.escapeViaLocationSolver.visualize():this.componentTopologyGeneratorSolver?this.componentTopologyGeneratorSolver.visualize():this.componentDetectionSolver?this.componentDetectionSolver.visualize():this.preprocessSimpleRouteJsonSolver?this.preprocessSimpleRouteJsonSolver.visualize():{}}_getOutputHdRoutes(){if(this.lengthMatchingPostProcessingSolver){let{hdRoutes:e}=this.lengthMatchingPostProcessingSolver.getOutput();return e}return this.exactGeometryDrcForceImproveSolver?.getOutput()??this.globalDrcForceImproveSolver?.getOutput()??this.traceWidthSolver?.getHdRoutesWithWidths()??this.traceSimplificationSolver?.simplifiedHdRoutes??this.highDensityStitchSolver.mergedHdRoutes}getOutputSimplifiedPcbTraces(){if(!this.solved||!this.highDensityRouteSolver)throw Error("Cannot get output before solving is complete");return this.powerTraceExpansionSolver?this.powerTraceExpansionSolver.getOutput():this.getPrePowerTraceOutputSimplifiedPcbTraces()}getPrePowerTraceOutputSimplifiedPcbTraces(){return H$e({connections:this.netToPointPairsSolver?.newConnections??[],originalConnections:this.originalSrj.connections,hdRoutes:this._getOutputHdRoutes(),layerCount:this.srj.layerCount,obstacles:this.srj.obstacles,defaultViaHoleDiameter:this.viaHoleDiameter,connMap:this.connMap})}getOutputSimpleRouteJson(){return{...this.originalSrj,traces:this.getOutputSimplifiedPcbTraces()}}},uGt=(e)=>[...new Set(e)].sort((t,n)=>t-n),p6r=class extends ei{constructor(e){super(),this.params=e,this.MAX_ITERATIONS=1}params;outputNodes=[];outputSharedEdgeSegments=[];nodeIdByOriginalAndZ=new Map;getSolverName(){return"SplitNodesIntoSingleLayerNodeSolver"}_step(){this.outputNodes=this.params.capacityMeshNodes.flatMap((e)=>uGt(e.availableZ).map((t)=>{let n=((o,r)=>`${o}__z${r}`)(e.capacityMeshNodeId,t);return this.nodeIdByOriginalAndZ.set(`${e.capacityMeshNodeId}:${t}`,n),{...e,capacityMeshNodeId:n,layer:`z${t}`,availableZ:[t],_parent:e}})),this.outputSharedEdgeSegments=this.params.sharedEdgeSegments.flatMap((e)=>this.splitSharedEdgeSegment(e)),this.stats={inputNodeCount:this.params.capacityMeshNodes.length,outputNodeCount:this.outputNodes.length,inputPortPointCount:this.params.sharedEdgeSegments.reduce((e,t)=>e+t.portPoints.length,0),outputPortPointCount:this.outputSharedEdgeSegments.reduce((e,t)=>e+t.portPoints.length,0)},this.solved=!0}getSplitNodeId(e,t){return this.nodeIdByOriginalAndZ.get(`${e}:${t}`)}splitPortPoint(e){return uGt(e.availableZ).flatMap((t)=>{let n=e.nodeIds.map((o)=>this.getSplitNodeId(o,t));return n[0]&&n[1]?[{...e,segmentPortPointId:`${e.segmentPortPointId}__z${t}`,availableZ:[t],nodeIds:[n[0],n[1]]}]:[]})}splitSharedEdgeSegment(e){let t=new Map;for(let n of e.portPoints.flatMap((o)=>this.splitPortPoint(o))){let o=n.availableZ[0];if(o===void 0)continue;let r=t.get(o)??[];r.push(n),t.set(o,r)}return[...t.entries()].map(([n,o])=>({...e,edgeId:`${e.edgeId}__z${n}`,nodeIds:o[0].nodeIds,availableZ:[n],portPoints:o}))}getOutput(){return{capacityMeshNodes:this.outputNodes,sharedEdgeSegments:this.outputSharedEdgeSegments}}getConstructorParams(){return[this.params]}visualize(){return{rects:this.outputNodes.map((e)=>({...qA(e),label:`${e.capacityMeshNodeId}
${e.layer}`})),points:this.outputSharedEdgeSegments.flatMap((e)=>e.portPoints.map((t)=>({x:t.x,y:t.y,label:`${t.segmentPortPointId}
z${t.availableZ.join(",")}`})))}}};function jA(e,t,n,o={}){return{solverName:e,solverClass:t,getConstructorParams:n,onSolved:o.onSolved}}var Oan=class extends ei{constructor(e,t={}){super(),this.srj=e,this.opts=t,this.originalSrj=e,this.opts={...t};let n=this.opts;if(this.effort=n.effort??1,this.MAX_ITERATIONS=1e8*this.effort,this.maxNodeDimension=n.maxNodeDimension??16,this.maxNodeRatio=n.maxNodeRatio??6,this.minNodeArea=n.minNodeArea??0.010000000000000002,this.setSimpleRouteJson(e),n.capacityDepth===void 0){let o=this.srj.bounds.maxX-this.srj.bounds.minX,r=this.srj.bounds.maxY-this.srj.bounds.minY,i=Math.max(o,r),s=n.targetMinCapacity??0.5;n.capacityDepth=ik(i,s)}this.cacheProvider=n.cacheProvider===void 0?hv():n.cacheProvider===null?null:n.cacheProvider,this.startTimeOfPhase={},this.endTimeOfPhase={},this.timeSpentOnPhase={}}srj;opts;preprocessSimpleRouteJsonSolver;escapeViaLocationSolver;netToPointPairsSolver;nodeSolver;nodeDimensionSubdivisionSolver;nodeTargetMerger;edgeSolver;colorMap;highDensityRouteSolver;highDensityForceImproveSolver;highDensityForceImproveRoutes;highDensityRepairSolver;highDensityRepairRoutes;highDensityStitchSolver;globalDrcForceImproveSolver;singleLayerNodeMerger;strawSolver;deadEndSolver;traceSimplificationSolver;availableSegmentPointSolver;splitNodesIntoSingleLayerNodeSolver;portPointPathingSolver;multiSectionPortPointOptimizer;uniformPortDistributionSolver;traceWidthSolver;necessaryCrampedPortPointSolver;viaDiameter;viaHoleDiameter;minTraceWidth;effort;maxNodeDimension;maxNodeRatio;minNodeArea;startTimeOfPhase;endTimeOfPhase;timeSpentOnPhase;activeSubSolver=null;connMap;srjWithEscapeViaLocations;srjWithPointPairs;originalSrj;capacityNodes=null;capacityEdges=null;highDensityNodePortPoints;cacheProvider=null;pipelineDef=[jA("preprocessSimpleRouteJsonSolver",r6e,(e)=>[e.originalSrj],{onSolved:(e)=>{e.setSimpleRouteJson(e.preprocessSimpleRouteJsonSolver.getOutputSimpleRouteJson())}}),jA("escapeViaLocationSolver",t6e,(e)=>[e.srj,{viaDiameter:e.viaDiameter,minTraceWidth:e.minTraceWidth,obstacleMargin:e.srj.defaultObstacleMargin??0.15}],{onSolved:(e)=>{e.srjWithEscapeViaLocations=e.escapeViaLocationSolver?.getOutputSimpleRouteJson()}}),jA("netToPointPairsSolver",Vq,(e)=>{let t=e.srjWithEscapeViaLocations??e.srj;return[t,e.colorMap,nk(t)]},{onSolved:(e)=>{e.srjWithPointPairs=e.netToPointPairsSolver?.getNewSimpleRouteJson(),e.colorMap=JA(e.srjWithPointPairs,e.connMap),e.connMap=im(e.srjWithPointPairs)}}),jA("nodeSolver",Qq,(e)=>[{simpleRouteJson:e.srjWithPointPairs,maxGapFillPasses:4}],{onSolved:(e)=>{e.capacityNodes=e.nodeSolver?.getOutput().meshNodes??[]}}),jA("nodeDimensionSubdivisionSolver",Zbe,(e)=>[e.capacityNodes,e.maxNodeDimension,e.maxNodeRatio,e.minNodeArea],{onSolved:(e)=>{e.capacityNodes=e.nodeDimensionSubdivisionSolver?.outputNodes??[]}}),jA("edgeSolver",ok,(e)=>[e.capacityNodes],{onSolved:(e)=>{e.capacityEdges=e.edgeSolver?.edges}}),jA("availableSegmentPointSolver",tY,(e)=>[{nodes:e.capacityNodes,edges:e.capacityEdges||[],traceWidth:e.minTraceWidth,colorMap:e.colorMap,shouldReturnCrampedPortPoints:!0}]),jA("necessaryCrampedPortPointSolver",jle,(e)=>[{capacityMeshNodes:e.capacityNodes,sharedEdgeSegments:e.availableSegmentPointSolver.getOutput(),simpleRouteJson:e.srjWithPointPairs}]),jA("splitNodesIntoSingleLayerNodeSolver",p6r,(e)=>[{capacityMeshNodes:e.capacityNodes,sharedEdgeSegments:e.necessaryCrampedPortPointSolver?.getOutput()??e.availableSegmentPointSolver.getOutput()}],{onSolved:(e)=>{e.capacityNodes=e.splitNodesIntoSingleLayerNodeSolver.getOutput().capacityMeshNodes}}),jA("portPointPathingSolver",e6e,(e)=>{let t=e.splitNodesIntoSingleLayerNodeSolver.getOutput(),{graph:n,connections:o}=Kle({capacityMeshNodes:t.capacityMeshNodes,layerCount:e.srj.layerCount,connectivityMap:e.connMap,segmentPortPoints:t.sharedEdgeSegments.flatMap((r)=>r.portPoints),simpleRouteJsonConnections:e.srjWithPointPairs.connections,assignableViaObstacles:e.originalSrj.obstacles});return[{graph:n,connections:o,layerCount:e.srj.layerCount,effort:Math.min(1,e.effort),minViaPadDiameter:e.viaDiameter,flags:{FORCE_CENTER_FIRST:!0,RIPPING_ENABLED:!0},weights:{SHUFFLE_SEED:0,MEMORY_PF_FACTOR:4,CENTER_OFFSET_DIST_PENALTY_FACTOR:0,CENTER_OFFSET_FOCUS_SHIFT:0,NODE_PF_FACTOR:0,LAYER_CHANGE_COST:0,RIPPING_PF_COST:0,NODE_PF_MAX_PENALTY:100,BASE_CANDIDATE_COST:0.6,MAX_ITERATIONS_PER_PATH:0,RANDOM_WALK_DISTANCE:0,START_RIPPING_PF_THRESHOLD:0.3,END_RIPPING_PF_THRESHOLD:1,MAX_RIPS:1000,RANDOM_RIP_FRACTION:0.3,STRAIGHT_LINE_DEVIATION_PENALTY_FACTOR:4,GREEDY_MULTIPLIER:0.7,MIN_ALLOWED_BOARD_SCORE:-1e4}}]}),jA("uniformPortDistributionSolver",Tle,(e)=>[{nodeWithPortPoints:e.portPointPathingSolver?.getOutput().nodesWithPortPoints??[],inputNodesWithPortPoints:e.portPointPathingSolver?.getOutput().inputNodeWithPortPoints??[],minTraceWidth:e.minTraceWidth,obstacles:e.srj.obstacles,layerCount:e.srj.layerCount}]),jA("highDensityRouteSolver",cY,(e)=>{let t=e.uniformPortDistributionSolver?.getOutput()??[],n=e.portPointPathingSolver?.getOutput().nodesWithPortPoints??[],o=t.length>0?t:n;return e.highDensityNodePortPoints=structuredClone(o),[{nodePortPoints:o,nodePfById:new Map((e.portPointPathingSolver?.getOutput().inputNodeWithPortPoints??[]).map((r)=>[r.capacityMeshNodeId,e.portPointPathingSolver?.computeNodePf(r)??null])),colorMap:e.colorMap,connMap:e.connMap,viaDiameter:e.viaDiameter,traceWidth:e.minTraceWidth,obstacleMargin:e.srj.defaultObstacleMargin??0.15,obstacles:e.srj.obstacles,layerCount:e.srj.layerCount}]}),jA("highDensityForceImproveSolver",$le,(e)=>[{nodeWithPortPoints:e.getHighDensityNodePortPointsWithAssignableViasFirst(),hdRoutes:e.getMovableHighDensityRoutes(e.highDensityRouteSolver.routes),colorMap:e.colorMap,totalStepsPerNode:Math.max(20,Math.round(60*Math.min(1,e.effort))),nodeAssignmentMargin:e.srj.defaultObstacleMargin??0.2}],{onSolved:(e)=>{e.highDensityForceImproveRoutes=e.mergeMovableHighDensityRoutesBack(e.highDensityRouteSolver.routes,e.highDensityForceImproveSolver.getOutput())}}),jA("highDensityRepairSolver",qle,(e)=>[{nodeWithPortPoints:e.getHighDensityNodePortPointsWithAssignableViasFirst(),hdRoutes:e.getMovableHighDensityRoutes(e.highDensityForceImproveRoutes??e.highDensityForceImproveSolver?.getOutput()??e.highDensityRouteSolver.routes),obstacles:e.srj.obstacles,colorMap:e.colorMap,repairMargin:e.srj.defaultObstacleMargin??0.2,minimumTraceWidth:e.srj.minTraceWidth,connMap:e.connMap}],{onSolved:(e)=>{let t=e.highDensityForceImproveRoutes??e.highDensityForceImproveSolver?.getOutput()??e.highDensityRouteSolver.routes;e.highDensityRepairRoutes=e.mergeMovableHighDensityRoutesBack(t,e.highDensityRepairSolver.getOutput())}}),jA("highDensityStitchSolver",o6e,(e)=>[{connections:e.srjWithPointPairs.connections,hdRoutes:e.highDensityRepairRoutes??e.highDensityRepairSolver?.getOutput()??e.highDensityForceImproveRoutes??e.highDensityForceImproveSolver?.getOutput()??e.highDensityRouteSolver.routes,colorMap:e.colorMap,layerCount:e.srj.layerCount,defaultViaDiameter:e.viaDiameter,allowedLayerTransitionPointKeys:HOt(e.originalSrj.obstacles)}]),jA("traceSimplificationSolver",s6,(e)=>[{hdRoutes:e.highDensityStitchSolver.mergedHdRoutes,obstacles:e.srj.obstacles,connMap:e.connMap,colorMap:e.colorMap,outline:e.srj.outline,defaultViaDiameter:e.viaDiameter,layerCount:e.srj.layerCount,minTraceToPadEdgeClearance:e.srj.minTraceToPadEdgeClearance,iterations:2}]),jA("traceWidthSolver",Yq,(e)=>[{hdRoutes:e.traceSimplificationSolver.simplifiedHdRoutes,obstacles:e.srj.obstacles,connMap:e.connMap,colorMap:e.colorMap,minTraceWidth:e.minTraceWidth,connection:e.srj.connections,obstacleMargin:e.srj.minTraceToPadEdgeClearance??0.15,layerCount:e.srj.layerCount}]),jA("globalDrcForceImproveSolver",NS,(e)=>[{srj:e.srjWithPointPairs,hdRoutes:e.traceWidthSolver.getHdRoutesWithWidths(),effort:Math.min(1,e.effort)}])];setSimpleRouteJson(e){this.srj=e;let t=rm(this.srj);this.viaDiameter=t.padDiameter,this.viaHoleDiameter=t.holeDiameter,this.minTraceWidth=this.srj.minTraceWidth,this.connMap=im(this.srj),this.colorMap=JA(this.srj,this.connMap)}getConstructorParams(){return[this.srj,this.opts]}currentPipelineStepIndex=0;_step(){let e=this.pipelineDef[this.currentPipelineStepIndex];if(!e)return void(this.solved=!0);if(this.activeSubSolver)return this.activeSubSolver.step(),void(this.activeSubSolver.solved?(this.endTimeOfPhase[e.solverName]=performance.now(),this.timeSpentOnPhase[e.solverName]=this.endTimeOfPhase[e.solverName]-this.startTimeOfPhase[e.solverName],e.onSolved?.(this),this.activeSubSolver=null,this.currentPipelineStepIndex++):this.activeSubSolver.failed&&(this.error=this.activeSubSolver?.error,this.failed=!0,this.activeSubSolver=null));let t=e.getConstructorParams(this);this.activeSubSolver=new e.solverClass(...t),this[e.solverName]=this.activeSubSolver,this.timeSpentOnPhase[e.solverName]=0,this.startTimeOfPhase[e.solverName]=performance.now()}solveUntilPhase(e){for(;this.getCurrentPhase()!==e;)this.step()}getCurrentPhase(){return this.pipelineDef[this.currentPipelineStepIndex]?.solverName??"none"}visualize(){if(!this.solved&&this.activeSubSolver)return this.activeSubSolver.visualize();let e=this.escapeViaLocationSolver?.visualize(),t=this.netToPointPairsSolver?.visualize(),n=this.nodeSolver?.visualize(),o=this.nodeDimensionSubdivisionSolver?.visualize(),r=this.nodeTargetMerger?.visualize(),i=this.singleLayerNodeMerger?.visualize(),s=this.strawSolver?.visualize(),a=this.edgeSolver?.visualize(),c=this.deadEndSolver?.visualize(),l=this.availableSegmentPointSolver?.visualize(),h=this.splitNodesIntoSingleLayerNodeSolver?.visualize(),d=this.portPointPathingSolver?.visualize(),u=this.multiSectionPortPointOptimizer?.visualize(),_=this.uniformPortDistributionSolver?.visualize(),p=this.highDensityRouteSolver?.visualize(),m=this.highDensityForceImproveSolver?.visualize(),A=this.highDensityRepairSolver?.visualize(),g=this.highDensityStitchSolver?.visualize(),f=this.traceSimplificationSolver?.visualize(),y=this.necessaryCrampedPortPointSolver?.visualize(),x=(this.highDensityRouteSolver?.visualize(),this.originalSrj),C=x.outline,b=[];if(b.push({points:[{x:x.bounds?.minX??-50,y:x.bounds?.minY??-50},{x:x.bounds?.maxX??50,y:x.bounds?.minY??-50},{x:x.bounds?.maxX??50,y:x.bounds?.maxY??50},{x:x.bounds?.minX??-50,y:x.bounds?.maxY??50},{x:x.bounds?.minX??-50,y:x.bounds?.minY??-50}],strokeColor:"rgba(255,0,0,0.25)"}),C&&C.length>=2){let B=C.map((T)=>({x:T.x,y:T.y}));B.push({...B[0]}),b.push({points:B,strokeColor:"rgba(0, 136, 255, 0.95)"})}let I=bB(x),v={points:[...x.connections.flatMap((B)=>B.pointsToConnect.map((T)=>({...T,layer:IB(T,x.layerCount),label:`${B.name} ${T.pcb_port_id??""}`})))],rects:[...(x.obstacles??[]).filter((B)=>!B.isCopperPour).map((B)=>({...B,fill:B.layers?.includes("top")?"rgba(255,0,0,0.25)":B.layers?.includes("bottom")?"rgba(0,0,255,0.25)":"rgba(255,0,0,0.25)",layer:$S(B,x.layerCount),label:I(B)}))],lines:b},P=yB({srj:x}),M=[Bl(v,P),e,t,n,o,r,i,s,a,c,l,y,h,d,u,_,p?Bl(v,p):null,m,A,g,f,this.solved?Bl({lines:b},yB({srj:this.originalSrj}),rx(this.getOutputSimpleRouteJson())):null].filter(Boolean);return Bl(...M)}preview(){if(this.highDensityRouteSolver){let e=[];for(let t=this.highDensityRouteSolver.routes.length-1;t>=0;t--){let n=this.highDensityRouteSolver.routes[t];if(e.push({points:n.route.map((o)=>({x:o.x,y:o.y})),strokeColor:this.colorMap[n.connectionName]}),e.length>200)break}return{lines:e}}return this.portPointPathingSolver?this.portPointPathingSolver.preview():this.netToPointPairsSolver?this.netToPointPairsSolver.visualize():this.escapeViaLocationSolver?this.escapeViaLocationSolver.visualize():this.preprocessSimpleRouteJsonSolver?this.preprocessSimpleRouteJsonSolver.visualize():{}}_getOutputHdRoutes(){let e=this.globalDrcForceImproveSolver?.getOutput();return e&&this.routesOnlyUsePreplacedVias(e)?e:this.traceWidthSolver?.getHdRoutesWithWidths()??this.traceSimplificationSolver?.simplifiedHdRoutes??this.highDensityRepairRoutes??this.highDensityForceImproveRoutes??this.highDensityStitchSolver.mergedHdRoutes}routesOnlyUsePreplacedVias(e){let t=HOt(this.originalSrj.obstacles);return t.size===0||e.every((n)=>n.vias.every((o)=>t.has(E$(o))))}getHighDensityNodePortPointsWithAssignableViasFirst(){return[...this.highDensityNodePortPoints??[]].sort((e,t)=>{let n=e.capacityMeshNodeId.startsWith("assignable-via:");return n===t.capacityMeshNodeId.startsWith("assignable-via:")?0:n?-1:1})}getPreplacedAssignableViaObstacles(){return this.originalSrj.obstacles.filter((e)=>e.netIsAssignable===!0&&(e.layers?.length??0)>1)}isFixedPreplacedViaRoute(e){let t=this.getPreplacedAssignableViaObstacles();return t.length!==0&&e.vias.length!==0&&t.some((n)=>[...e.route,...e.vias].every((o)=>iP(o,n)<=0))}getMovableHighDensityRouteIndexes(e){return e.map((t,n)=>this.isFixedPreplacedViaRoute(t)?-1:n).filter((t)=>t!==-1)}getMovableHighDensityRoutes(e){return this.getMovableHighDensityRouteIndexes(e).map((t)=>e[t])}mergeMovableHighDensityRoutesBack(e,t){let n=this.getMovableHighDensityRouteIndexes(e),o=[...e];for(let r=0;r<n.length;r++)o[n[r]]=t[r];return o}getOutputSimplifiedPcbTraces(){if(!this.solved||!this.highDensityRouteSolver)throw Error("Cannot get output before solving is complete");let e=[],t=this._getOutputHdRoutes();for(let n of this.netToPointPairsSolver?.newConnections??[]){let o=n.__netConnectionName??this.originalSrj.connections.find((i)=>i.name===n.name)?.__netConnectionName,r=t.filter((i)=>i.connectionName===n.name);for(let i=0;i<r.length;i++){let s=r[i],a={type:"pcb_trace",pcb_trace_id:`${n.name}_${i}`,connection_name:o??n.__rootConnectionNames?.[0]??n.name,route:k3(s,this.srj.layerCount,{connectionPoints:n.pointsToConnect,defaultViaHoleDiameter:this.viaHoleDiameter,obstacles:this.srj.obstacles,connMap:this.connMap})};e.push(a)}}return e}getOutputSimpleRouteJson(){return{...this.originalSrj,traces:this.getOutputSimplifiedPcbTraces()}}},m6r=class extends ei{bestRoutes;bestCost;completedPasses=0;cleanupPasses;simplifier;viaRemovalSolver;params;constructor(e){super(),this.params=e,this.bestRoutes=structuredClone([...e.config.hdRoutes]),this.bestCost=e.getCost(this.bestRoutes),this.cleanupPasses=e.effort<=1?e.viaRemovalPasses??1:Math.ceil(2*e.effort),this.MAX_ITERATIONS=1e8*Math.max(1,this.cleanupPasses),e.effort<=1?this.viaRemovalSolver=this.createViaRemovalSolver():(this.simplifier=new s6({...e.config,enableRoutedTraceDetours:!0,hdRoutes:structuredClone(this.bestRoutes)}),this.simplifier.simplificationPipelineLoops=2,this.simplifier.MAX_SIMPLIFICATION_PIPELINE_LOOPS=2+this.cleanupPasses,this.simplifier.MAX_ITERATIONS=this.MAX_ITERATIONS)}createViaRemovalSolver(){let e=this.params.config,t=new jrn({unsimplifiedHdRoutes:structuredClone(this.bestRoutes),otherHdRoutes:e.otherHdRoutes,obstacles:[...e.obstacles],colorMap:e.colorMap,layerCount:e.layerCount,connMap:e.connMap,outline:e.outline?[...e.outline]:void 0,geometryShortcutTraceMargin:0.1,geometryShortcutObstacleMargin:e.minTraceToPadEdgeClearance??0.15,enableGeometryShortcuts:!0,enableRoutedTraceDetours:!0,enableObstacleDetourShortcuts:e.enableCrossingViaReduction,preserveRouteEndpoints:e.preserveRouteEndpoints,terminalLayerIndicesByPcbPortId:e.terminalLayerIndicesByPcbPortId});return t.MAX_ITERATIONS=this.MAX_ITERATIONS,t}_step(){if(this.viaRemovalSolver){let r=this.viaRemovalSolver;if(r.step(),r.failed)return this.failed=!0,void(this.error=r.error);if(!r.solved)return;let i=r.getOptimizedHdRoutes();if(!i)throw Error("Via removal has no output");let s=this.params.getCost(i),a=s.vias<this.bestCost.vias&&this.params.isValid(i);return a&&(this.bestRoutes=structuredClone(i),this.bestCost=s),this.completedPasses++,a&&this.completedPasses<this.cleanupPasses?void(this.viaRemovalSolver=this.createViaRemovalSolver()):void(this.solved=!0)}let e=this.simplifier;if(!e)throw Error("Cleanup has no active simplifier");let{currentPhase:t,simplificationPipelineLoops:n}=e;if(e.step(),e.failed)return this.failed=!0,void(this.error=e.error);let o=e.simplificationPipelineLoops-2;if(this.completedPasses=o,e.currentPhase!==t||e.simplificationPipelineLoops!==n){let r=e.simplifiedHdRoutes,i=this.params.getCost(r);(i.vias<this.bestCost.vias||i.vias===this.bestCost.vias&&i.points<this.bestCost.points)&&this.params.isValid(r)&&(this.bestRoutes=structuredClone(r),this.bestCost=i)}this.solved=e.solved}getOutput(){if(!this.solved)throw Error("Cleanup is not complete");return this.bestRoutes}},WQ={traceClearance:0.1,viaClearance:0.1},F$e=(e,t)=>{let n=new Set(t.flatMap((o)=>o.__replaces_pcb_trace_id?[o.__replaces_pcb_trace_id]:[]));return[...e.filter((o)=>!n.has(o.pcb_trace_id)),...t]},Z3e=({inputSrj:e,srjWithPointPairs:t,routedTraces:n,drcOptions:o,includeBoardClearance:r=!1,connectivityMaps:i})=>{let s=e.traces??[],a=bZe(t,F$e(s,n),{minTraceWidth:e.minTraceWidth,minViaDiameter:e.minViaDiameter,originalSrj:e,includeOriginalConnections:!0,connectivityMaps:i});return r&&a.push(Nrn({...e,minBoardEdgeClearance:e.minBoardEdgeClearance??0})),{circuitJson:a,...Den(a,{...WQ,holeClearance:e.minTraceToHoleEdgeClearance,...o})}},pGt=(e,t)=>{let n=e.filter((o)=>(o.rootConnectionName??o.connectionName)===t);if(n.length!==0)return n.reduce((o,r)=>o+r.route.slice(1).reduce((i,s,a)=>{let c=r.route[a];return i+Math.hypot(s.x-c.x,s.y-c.y)},0),0)},_6r=(e,t)=>{let n=new Set(e.flatMap((o)=>o.maxLengthSkew===void 0?[]:o.connectionNames));return t.flatMap((o)=>{if(!n.has(o.name))return[];let r=o.pointsToConnect[0],i=o.pointsToConnect.at(-1);if(!r||!i||r===i)throw Error(`Length matching: bus connection "${o.name}" needs at least two points`);return[{...o,pointsToConnect:[r,i]}]})},g6r=class extends ei{constructor(e){super(),this.params=e,this.differentialPairSolver=new _an({hdRoutes:e.hdRoutes,differentialPairs:e.differentialPairs,traces:e.traces,obstacles:e.obstacles,bounds:e.bounds,layerCount:e.layerCount,minTraceToPadEdgeClearance:e.obstacleMargin}),this.MAX_ITERATIONS=this.differentialPairSolver.MAX_ITERATIONS+1e5+10}params;differentialPairSolver;busLengthMatchingSolver;outputHdRoutes;getSolverName(){return"LengthMatchingPostProcessingSolver"}_step(){if(!this.differentialPairSolver.solved)return this.differentialPairSolver.step(),void(this.differentialPairSolver.failed&&(this.failed=!0,this.error=this.differentialPairSolver.error));if(!this.busLengthMatchingSolver){let n=this.differentialPairSolver.getOutput().hdRoutes,o=(e=this.params.buses,t=n,e.flatMap((r)=>{let i=r.maxLengthSkew;if(i===void 0||r.connectionNames.length<2)return[];let s=r.connectionNames.map((c)=>{let l=pGt(t,c);if(l===void 0)throw Error(`Length matching: bus "${r.busId}" has no routed geometry for connection "${c}"`);return{connectionName:c,length:l}}),a=s.reduce((c,l)=>l.length>c.length?l:c);return s.flatMap((c)=>c.connectionName===a.connectionName?[]:[{connectionNames:[c.connectionName,a.connectionName],lengthTolerance:i}])}));return o.length===0?(this.outputHdRoutes=n,void(this.solved=!0)):void(this.busLengthMatchingSolver=new lan({hdRoutes:n,originalConnections:_6r(this.params.buses,this.params.connections),differentialPairs:o,traces:this.params.traces,obstacles:this.params.obstacles,bounds:this.params.bounds,layerCount:this.params.layerCount,obstacleMargin:this.params.obstacleMargin}))}var e,t;if(this.busLengthMatchingSolver.step(),this.busLengthMatchingSolver.failed)return this.failed=!0,void(this.error=this.busLengthMatchingSolver.error);this.busLengthMatchingSolver.solved&&(this.outputHdRoutes=this.busLengthMatchingSolver.getOutput().matchedHdRoutes,((n,o)=>{for(let r of n){if(r.maxLengthSkew===void 0||r.connectionNames.length<2)continue;let i=r.connectionNames.map((a)=>{let c=pGt(o,a);if(c===void 0)throw Error(`Length matching: bus "${r.busId}" lost routed geometry for connection "${a}"`);return c}),s=Math.max(...i)-Math.min(...i);if(s>r.maxLengthSkew+0.000001)throw Error(`Length matching: bus "${r.busId}" routed length skew ${s.toFixed(4)}mm exceeds ${r.maxLengthSkew.toFixed(4)}mm`)}})(this.params.buses,this.outputHdRoutes),this.solved=!0)}getOutput(){if(!this.solved||!this.outputHdRoutes)throw Error("LengthMatchingPostProcessingSolver output requested before completion");return{hdRoutes:this.outputHdRoutes}}visualize(){return this.busLengthMatchingSolver?.visualize()??this.differentialPairSolver.visualize()}},Dq=0.000000001,mGt=(e,t)=>Math.abs(e.x-t.x)<=Dq&&Math.abs(e.y-t.y)<=Dq&&e.z===t.z,A6r=(e,t)=>{if(e.length===0)return void e.push(...t.route);let n=e.at(-1);if(t.route[0]&&mGt(n,t.route[0]))e.push(...t.route.slice(1));else{if(!t.route.at(-1)||!mGt(n,t.route.at(-1)))throw Error(`Pipeline9 could not reconnect mutated preloaded segment "${t.connectionName}"`);e.push(...t.route.slice(0,-1).reverse())}},z$e=(e,t)=>{let n=e.preloadedRoutePositionStart??e.preloadedRouteIndex,o=t.preloadedRoutePositionStart??t.preloadedRouteIndex,r=e.preloadedRoutePositionEnd??n,i=t.preloadedRoutePositionEnd??o;return n-o||r-i||e.preloadedRouteIndex-t.preloadedRouteIndex||e.connectionName.localeCompare(t.connectionName)},f6r=(e)=>{let t=e.route.flatMap((n)=>n.route_type==="wire"||n.route_type==="through_obstacle"?[n.width]:[]);return t.length>0?Math.max(...t):void 0},Van=({trace:e,updatedTraceRoutes:t,layerCount:n,defaultViaHoleDiameter:o,obstacles:r,connMap:i})=>{if(t.length===0)throw Error(`Pipeline9 lost every fixed route for mutated trace "${e.pcb_trace_id}"`);let s=[],a,c=0,l=0;for(let d of[...t].sort(z$e))A6r(s,d),c=Math.max(c,d.traceThickness),l=Math.max(l,d.viaDiameter),a??=d.rootConnectionName;let h={connectionName:e.connection_name,rootConnectionName:a,traceThickness:f6r(e)??c,viaDiameter:l,route:s,vias:s.slice(0,-1).flatMap((d,u)=>{let _=s[u+1];return d.z!==_.z&&Math.abs(d.x-_.x)<=Dq&&Math.abs(d.y-_.y)<=Dq?[{x:_.x,y:_.y}]:[]})};return k3(h,n,{defaultViaHoleDiameter:o,obstacles:r,connMap:i})},Cje=(e,t)=>e.filter((n)=>{if(n.isThroughObstacle===!0)return!1;let{preloadedRoutePositionStart:o,preloadedRoutePositionEnd:r}=n;if(o===void 0||r===void 0)throw Error(`Pipeline9 fixed route "${n.connectionName}" is missing route-position metadata`);let i=Math.min(o,r),s=Math.max(o,r);return i>=t.routePositionStart-Dq&&s<=t.routePositionEnd+Dq}),y6r=({trace:e,originalTraceRoutes:t,updatedTraceRoutes:n,layerCount:o,defaultViaHoleDiameter:r,obstacles:i,connMap:s})=>{if(n.length===0)throw Error(`Pipeline9 lost every fixed route for mutated trace "${e.pcb_trace_id}"`);let a=((d)=>{let u=[],_=0;for(let p=0;p<d.route.length;p++)d.route[p]?.route_type==="through_obstacle"&&(_<p&&u.push({routePositionStart:_,routePositionEnd:p-1}),_=p+1);return _<d.route.length&&u.push({routePositionStart:_,routePositionEnd:d.route.length-1}),u})(e),c=n.filter((d)=>d.isThroughObstacle!==!0);for(let d of c)if(a.filter((u)=>Cje([d],u).includes(d)).length!==1)throw Error(`Pipeline9 fixed route "${d.connectionName}" crosses an immutable through-obstacle primitive`);let l=[],h=0;for(let d of a){l.push(...e.route.slice(h,d.routePositionStart));let u=Cje(t,d),_=Cje(n,d);if(u.length>0&&_.length===0)throw Error(`Pipeline9 lost every fixed route for an ordinary section of mutated trace "${e.pcb_trace_id}"`);l.push(..._.length>0?Van({trace:e,updatedTraceRoutes:_,layerCount:o,defaultViaHoleDiameter:r,obstacles:i,connMap:s}):e.route.slice(d.routePositionStart,d.routePositionEnd+1)),h=d.routePositionEnd+1}return l.push(...e.route.slice(h)),l},O$e=(e,t)=>{let n=new Set(t.map((o)=>o.pcb_trace_id));return e.map((o)=>{if(!n.has(o.pcb_trace_id))return n.add(o.pcb_trace_id),o;let r=`${o.pcb_trace_id}_routed`,i=r,s=2;for(;n.has(i);)i=`${r}_${s}`,s+=1;return n.add(i),{...o,pcb_trace_id:i}})},_Gt=(e,t,n)=>{let o=(s)=>`${s.x}:${s.y}`,r=new Map;for(let s of t){let a=o(s.center),c=r.get(a)??[];c.push(s),r.set(a,c)}let i=new Map;for(let s of e)for(let a of s.pointsToConnect){if(!a.pcb_port_id)continue;let c=i.get(a.pcb_port_id)??new Set,l=E5(a);for(let h of l)c.add(si(h,n));for(let h of r.get(o(a))??[])if(!(h.layers.length<=1)&&h.connectedTo.includes(a.pcb_port_id))for(let d of h.layers)c.add(si(d,n));i.set(a.pcb_port_id,c)}return i},abe=(e,t)=>new Map(e.flatMap((n)=>{let o=t.getNetConnectedToId(n.connectionName)??(n.rootConnectionName?t.getNetConnectedToId(n.rootConnectionName)??(t.netMap[n.rootConnectionName]?n.rootConnectionName:void 0):void 0);return o?[[n.connectionName,o]]:[]})),JO=0.000000001,V$e=0.000001,gGt=(e,t)=>Math.abs(e.x-t.x)<=V$e&&Math.abs(e.y-t.y)<=V$e&&e.z===t.z,Yan=(e)=>new Map(e.map((t,n)=>[t.pcb_trace_id,n])),AGt=(e,t)=>{let n=e[0],o=e.at(-1);if(!n||!o)throw Error("Pipeline9 cannot split an empty preloaded route");if(n.z!==o.z)throw Error("Pipeline9 cannot partially split a preloaded layer transition");return{...n,x:n.x+(o.x-n.x)*t,y:n.y+(o.y-n.y)*t}},fGt=({traces:e,fixedHdRoutes:t,sections:n})=>{let o=(({traces:r,sections:i})=>{let s=Yan(r),a=new Map;for(let c of i){let l=s.get(c.traceId);if(l===void 0)throw Error(`Pipeline9 hypergraph changed missing preloaded trace "${c.traceId}"`);let h=a.get(l)??[];h.push({start:Math.min(c.startRoutePosition,c.endRoutePosition),end:Math.max(c.startRoutePosition,c.endRoutePosition)}),a.set(l,h)}for(let c of a.values())c.sort((l,h)=>l.start-h.start||l.end-h.end);return a})({traces:e,sections:n});return t.flatMap((r)=>{let i=o.get(r.preloadedTraceIndex);if(!i?.length)return[r];let{preloadedRoutePositionStart:s,preloadedRoutePositionEnd:a}=r;if(s===void 0||a===void 0)throw Error(`Pipeline9 fixed route "${r.connectionName}" is missing route-position metadata`);if(Math.abs(a-s)<=JO)return i.some((l)=>l.start-JO<=s&&s<=l.end+JO)?[]:[r];let c=[{start:s,end:a}];for(let l of i)c=c.flatMap((h)=>{if(l.end<=h.start+JO||l.start>=h.end-JO)return[h];let d=[];return l.start>h.start+JO&&d.push({start:h.start,end:Math.min(l.start,h.end)}),l.end<h.end-JO&&d.push({start:Math.max(l.end,h.start),end:h.end}),d});return c.map((l,h)=>{let d=(l.start-s)/(a-s),u=(l.end-s)/(a-s);return{...r,connectionName:`${r.connectionName}_hypergraph_fixed_${h}`,preloadedRoutePositionStart:l.start,preloadedRoutePositionEnd:l.end,route:[AGt(r.route,d),AGt(r.route,u)],vias:[]}})})},x6r=({traces:e,sections:t,stitchedHdRoutes:n,layerCount:o})=>{let r=Yan(e);return t.map((i,s)=>{let a=r.get(i.traceId);if(a===void 0)throw Error(`Pipeline9 cannot materialize missing preloaded trace "${i.traceId}"`);let[c,l]=((p,m)=>{let A=p.connection.pointsToConnect.map((g)=>({x:g.x,y:g.y,z:si(l2(g),m)}));if(!A[0]||!A[1])throw Error(`Pipeline9 changed section "${p.connectionName}" is missing an endpoint`);return[A[0],A[1]]})(i,o),h=n.flatMap((p)=>{if(p.connectionName!==i.connectionName)return[];let m=(({route:A,sectionStart:g,sectionEnd:f})=>{let y=A.route[0],x=A.route.at(-1);if(!y||!x)return null;let C=y.z===g.z&&x.z===f.z,b=y.z===f.z&&x.z===g.z,I=C?kn(y,g)+kn(x,f):Number.POSITIVE_INFINITY,v=b?kn(y,f)+kn(x,g):Number.POSITIVE_INFINITY;return Number.isFinite(I)||Number.isFinite(v)?I<=v?{score:I,reverse:!1}:{score:v,reverse:!0}:null})({route:p,sectionStart:c,sectionEnd:l});return m?[{route:p,...m}]:[]});h.sort((p,m)=>p.score-m.score);let d=h[0],u=h[1];if(!d||u&&Math.abs(u.score-d.score)<=V$e)throw Error(`Pipeline9 expected one nearest stitched route for changed preloaded section "${i.connectionName}", got ${h.length}`);return{...(({route:p,reverse:m,sectionStart:A,sectionEnd:g})=>{let f=m?((y)=>{let x=[...y].reverse().map((C)=>{let{toNextSegmentType:b,...I}=C;return I});for(let C=0;C<y.length-1;C++){let b=y[C]?.toNextSegmentType;b&&(x[y.length-C-2]={...x[y.length-C-2],toNextSegmentType:b})}return x})(p.route):[...p.route];if(!f[0]||!f.at(-1))throw Error(`Pipeline9 cannot materialize empty route "${p.connectionName}"`);return gGt(f[0],A)||f.unshift(A),gGt(f.at(-1),g)||f.push(g),{...p,route:f}})({route:d.route,reverse:d.reverse,sectionStart:c,sectionEnd:l}),preloadedTraceIndex:a,preloadedRouteIndex:Number.MAX_SAFE_INTEGER-t.length+s,preloadedRoutePositionStart:i.startRoutePosition,preloadedRoutePositionEnd:i.endRoutePosition,isThroughObstacle:!1}})},o$=0.000001,Gan=({hdRoute:e,start:t,end:n})=>{if(Math.abs(t.x-n.x)<=o$&&Math.abs(t.y-n.y)<=o$)return"colocated";let o=e.vias.some((i)=>Math.abs(i.x-t.x)<=o$&&Math.abs(i.y-t.y)<=o$),r=e.vias.some((i)=>Math.abs(i.x-n.x)<=o$&&Math.abs(i.y-n.y)<=o$);if(!o&&!r)throw Error(`Pipeline9 route "${e.connectionName}" changes layers from z=${t.z} to z=${n.z} without an explicit via`);if(o===r)throw Error(`Pipeline9 route "${e.connectionName}" has an ambiguous layer transition between (${t.x}, ${t.y}) and (${n.x}, ${n.y})`);return o?"start":"end"},ZZe=(e)=>e.map((t)=>{let n=[];for(let o of t.route){let r=n.at(-1);if(!r||r.z===o.z||r.toNextSegmentType==="through_obstacle"){n.push(o);continue}let i=Gan({hdRoute:t,start:r,end:o});i!=="colocated"?(i==="start"?n.push({x:r.x,y:r.y,z:o.z}):n.push({x:o.x,y:o.y,z:r.z}),n.push(o)):n.push(o)}return{...t,route:n}}),Q$=(e)=>ZZe(e).map((t)=>({...t,route:t.route.flatMap((n,o)=>{let r=t.route[o-1];return!r||r.z===n.z||r.toNextSegmentType==="through_obstacle"||r.x===n.x&&r.y===n.y?[n]:[{x:n.x,y:n.y,z:r.z},n]})})),C6r=(e)=>{let t=new Map;for(let n of e)n.regionId&&t.set(n.regionId,(t.get(n.regionId)??0)+n.route.length);return e.map((n)=>{if(!n.regionId||t.get(n.regionId)<4096)return n;let o=[],r=[];for(let[s,a]of n.route.entries()){for(;o.length>=2;){let c=o[o.length-2],l=o[o.length-1];if(c.z!==l.z||l.z!==a.z||c.toNextSegmentType||c.traceThickness!==void 0||Object.keys(l).some((m)=>m!=="x"&&m!=="y"&&m!=="z")||n.vias.some((m)=>Math.hypot(m.x-l.x,m.y-l.y)<0.000000001))break;let h=l.x-c.x,d=l.y-c.y,u=a.x-l.x,_=a.y-l.y,p=Math.hypot(a.x-c.x,a.y-c.y);if(p===0||h*u+d*_<0||Math.abs(h*_-d*u)>0.000000001*p)break;o.pop(),r.pop()}o.push(a),r.push(s)}let i=[];for(let s=0;s<o.length;s++){let a=o[s];if(o[s-1]){let c=r[s-1],l=r[s];l-c<64&&i.push(...n.route.slice(c+1,l))}i.push(a)}return{...n,route:i}})},nx=0.000000001,Uan=(e)=>({minX:e.center.x-e.width/2,maxX:e.center.x+e.width/2,minY:e.center.y-e.height/2,maxY:e.center.y+e.height/2}),yGt=(e,t)=>e.x>=t.minX-nx&&e.x<=t.maxX+nx&&e.y>=t.minY-nx&&e.y<=t.maxY+nx,xGt=(e,t,n)=>n<=nx?e:n>=0.999999999?t:{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n,z:e.z},b6r=(e,t,n)=>{let o=t.x-e.x,r=t.y-e.y;if(Math.abs(o)<=nx&&Math.abs(r)<=nx)return yGt(e,n)&&yGt(t,n)?{start:e,end:t}:null;let i=0,s=1,a=[[-o,e.x-n.minX],[o,n.maxX-e.x],[-r,e.y-n.minY],[r,n.maxY-e.y]];for(let[c,l]of a){if(Math.abs(c)<=nx){if(l<0)return null;continue}let h=l/c;if(c<0?i=Math.max(i,h):s=Math.min(s,h),i>s+nx)return null}return{start:xGt(e,t,i),end:xGt(e,t,s)}},I6r=(e)=>{let t=e.sourceRoutes[0],n=`pipeline9_fallback:${t.connectionName}`,o=`${n}:start`,r=`${n}:end`;return[{...e.start.point,portPointId:o,nextPortPointId:r,connectionName:t.connectionName,rootConnectionName:t.rootConnectionName},{...e.end.point,portPointId:r,prevPortPointId:o,connectionName:t.connectionName,rootConnectionName:t.rootConnectionName}]},kce=(e,t)=>Math.abs(e.x-t.x)<=nx&&Math.abs(e.y-t.y)<=nx&&e.z===t.z,v6r=(e,t)=>e.sourceRoute.preloadedTraceIndex===t.sourceRoute.preloadedTraceIndex&&kce(e.sourceRoute.route.at(-1),t.sourceRoute.route[0]),Ele=(e,t,n=new Set)=>{let o=new Map,r=[],i=new Set(e.portPoints.map((d)=>d.z)),s=t.map((d)=>((u,_)=>{let p=Uan(_),m,A;for(let g=0;g<u.route.length-1;g++){let f=b6r(u.route[g],u.route[g+1],p);f&&(m??={segmentIndex:g,point:f.start},A={segmentIndex:g,point:f.end})}return m&&A?{sourceRoute:u,start:m,end:A}:null})(d,e)).filter((d)=>d!==null),a=s.filter((d)=>d.sourceRoute.isThroughObstacle!==!0&&(((u,_)=>_.size===0||[u.start.point,...u.sourceRoute.route.slice(u.start.segmentIndex+1,u.end.segmentIndex+1),u.end.point].some((p)=>_.has(p.z)))(d,i)||n.has(d.sourceRoute.connectionName))).sort((d,u)=>d.sourceRoute.preloadedTraceIndex-u.sourceRoute.preloadedTraceIndex||d.sourceRoute.preloadedRouteIndex-u.sourceRoute.preloadedRouteIndex),c=new Set(a.map((d)=>d.sourceRoute)),l=s.map((d)=>d.sourceRoute).filter((d)=>!c.has(d)),h=[];for(let d=0;d<a.length;d++){let u=a[d],_=a[d-1],p=h.at(-1);_&&p&&v6r(_,u)?(p.sourceRoutes.push(u.sourceRoute),p.end=u.end):h.push({sourceRoutes:[u.sourceRoute],start:u.start,end:u.end})}for(let d of h){if(kce(d.start.point,d.end.point))continue;let u=d.sourceRoutes[0].connectionName;if(o.has(u))throw Error(`Pipeline9 regional fallback found duplicate fixed route section identity "${u}"`);o.set(u,d),r.push(I6r(d))}return{nodeWithPortPoints:{...e,portPoints:[...e.portPoints,...r.flatMap((d)=>d)],portPointsInPairs:[...e.portPointsInPairs??[],...r]},fixedRouteSectionsByConnectionName:o,fixedObstacleRoutes:l}},S6r=(e)=>{let t=[];for(let n=0;n<e.length-1;n++){let o=e[n],r=e[n+1];o.z!==r.z&&Math.abs(o.x-r.x)<=nx&&Math.abs(o.y-r.y)<=nx&&t.push({x:r.x,y:r.y})}return t},eet=(e,t)=>Wan({section:e,replacement:t,sourceMutationMasks:new Map,replacementIsMutated:!1}).route,Wan=({section:e,replacement:t,sourceMutationMasks:n,replacementIsMutated:o})=>{let r=e.sourceRoutes[0],i=e.sourceRoutes.at(-1),s=((_,p)=>{let m=_.route,A=m[0],g=m.at(-1);if(!A||!g)throw Error(`Pipeline9 regional fallback produced an empty replacement for "${p.sourceRoutes[0].connectionName}"`);let f=Math.hypot(A.x-p.start.point.x,A.y-p.start.point.y)+Math.hypot(g.x-p.end.point.x,g.y-p.end.point.y);return Math.hypot(g.x-p.start.point.x,g.y-p.start.point.y)+Math.hypot(A.x-p.end.point.x,A.y-p.end.point.y)<f?[...m].reverse():m})(t,e),a=[],c=[],l=(_,p)=>{let m=n.get(_.connectionName);if(m&&m.length!==_.route.length-1)throw Error(`Pipeline9 fixed route mutation mask for "${_.connectionName}" has ${m.length} segments, expected ${_.route.length-1}`);return m?.[p]??!1},h=(_,p)=>{let m=a.at(-1);if(m){if(!kce(m,_)){if(m.z!==_.z&&(Math.abs(m.x-_.x)>nx||Math.abs(m.y-_.y)>nx)){let A={..._,z:m.z};kce(m,A)||(a.push(A),c.push(p))}kce(a.at(-1),_)||(a.push(_),c.push(p))}}else a.push(_)};h(r.route[0],!1);for(let _=1;_<=e.start.segmentIndex;_++)h(r.route[_],l(r,_-1));h(e.start.point,l(r,e.start.segmentIndex));let d=c.length;for(let _ of s.slice(1,-1))h(_,o);h(e.end.point,o);let u=c.length>d;for(let _=e.end.segmentIndex+1;_<i.route.length;_++)h(i.route[_],l(i,_-1));if(c.length!==a.length-1)throw Error(`Pipeline9 produced an invalid mutation mask while splicing "${r.connectionName}"`);return{route:{...r,preloadedRoutePositionStart:r.preloadedRoutePositionStart,preloadedRoutePositionEnd:i.preloadedRoutePositionEnd,traceThickness:Math.max(...e.sourceRoutes.map((_)=>_.traceThickness)),viaDiameter:Math.max(...e.sourceRoutes.map((_)=>_.viaDiameter)),route:a,vias:S6r(a)},mutatedSegments:c,replacementProducedSegment:u}},cbe=0.000001,lbe=(e,t)=>Math.abs(e.x-t.x)<=cbe&&Math.abs(e.y-t.y)<=cbe&&e.z===t.z,CGt=(e,t)=>{for(let n of t)e.at(-1)&&lbe(e.at(-1),n)||e.push(n)},Xan=(e)=>e.slice(0,-1).flatMap((t,n)=>{let o=e[n+1];return t.z!==o.z&&Math.abs(t.x-o.x)<=cbe&&Math.abs(t.y-o.y)<=cbe?[{x:o.x,y:o.y}]:[]}),bGt=(e)=>{let{preloadedRoutePositionStart:t,preloadedRoutePositionEnd:n}=e;if(t===void 0||n===void 0)throw Error(`Pipeline9 fixed route "${e.connectionName}" is missing route-position metadata`);return{start:Math.min(t,n),end:Math.max(t,n)}},jan=(e,t)=>{let n=bGt(e),o=bGt(t);return e.preloadedTraceIndex-t.preloadedTraceIndex||n.start-o.start||n.end-o.end||e.preloadedRouteIndex-t.preloadedRouteIndex||e.connectionName.localeCompare(t.connectionName)},Kan=(e,t)=>{let n=e.route.at(-1),o=t.route[0];return Boolean(n&&o&&e.preloadedTraceIndex===t.preloadedTraceIndex&&lbe(n,o))},IGt=(e,t)=>{let n=e.preloadedRoutePositionStart??e.preloadedRouteIndex;return n+((e.preloadedRoutePositionEnd??e.preloadedRouteIndex)-n)*t/(e.route.length-1)},vGt=(e,t)=>e.route[t].z!==e.route[t+1].z,P6r=({updatedFixedRoutes:e,regionalMutationMasks:t})=>{let n=[],o=(({updatedFixedRoutes:r,regionalMutationMasks:i})=>{let s=new Map;for(let h of r){if(h.route.length===0)throw Error(`Pipeline9 cannot normalize empty fixed route "${h.connectionName}"`);let d=h.route.length-1;if(s.has(h.connectionName))throw Error(`Pipeline9 cannot normalize duplicate fixed route "${h.connectionName}"`);let u=i.get(h.connectionName);if(u&&u.length!==d)throw Error(`Pipeline9 fixed route mutation mask for "${h.connectionName}" has ${u.length} segments, expected ${d}`);let _=h.isThroughObstacle!==!0&&(h.jumpers?.length??0)===0;s.set(h.connectionName,Array.from({length:d},(p,m)=>_&&(u?.[m]??!1)))}let a=[],c=()=>{for(;a[0]&&vGt(a[0].route,a[0].segmentIndex);){let h=a.shift();s.get(h.route.connectionName)[h.segmentIndex]=!1}for(;a.at(-1)&&vGt(a.at(-1).route,a.at(-1).segmentIndex);){let h=a.pop();s.get(h.route.connectionName)[h.segmentIndex]=!1}a=[]},l;for(let h of[...r].sort(jan)){l&&!Kan(l,h)&&c();let d=s.get(h.connectionName);if(d.length!==0){for(let u=0;u<d.length;u++)d[u]?a.push({route:h,segmentIndex:u}):c();l=h}else c(),l=h}return c(),s})({updatedFixedRoutes:e,regionalMutationMasks:t});for(let r of e){let i=r.route.length-1,s=o.get(r.connectionName);if(i===0){n.push({route:r,mutated:!1});continue}let a=[];for(let c=0;c<i;c++){let l=s[c],h=a.at(-1);h?.mutated===l?h.end=c+1:a.push({start:c,end:c+1,mutated:l})}for(let[c,l]of a.entries()){let h=r.route.slice(l.start,l.end+1),d={...r,connectionName:a.length===1?r.connectionName:`${r.connectionName}_mutation_fragment_${c}`,preloadedRouteIndex:r.preloadedRouteIndex+c/(a.length+1),preloadedRoutePositionStart:IGt(r,l.start),preloadedRoutePositionEnd:IGt(r,l.end),route:h,vias:Xan(h)};n.push({route:d,mutated:l.mutated})}}return n},E6r=({updatedFixedRoutes:e,regionalMutationMasks:t})=>{let n=P6r({updatedFixedRoutes:e,regionalMutationMasks:t}),o=n.map(({route:a})=>a),r=((a)=>{let c=[],l;for(let h of[...a].sort((d,u)=>jan(d.route,u.route))){let d=h.route;if(!h.mutated){l=void 0;continue}let u=d.route[0],_=d.route.at(-1);if(!u||!_||d.route.length<2)throw Error(`Pipeline9 cannot simplify empty fixed route "${d.connectionName}"`);let p=l?.sourceRoutes.at(-1);l&&p&&Kan(p,d)?(l.sourceRoutes.push(d),l.end={segmentIndex:d.route.length-2,point:_}):(l={sourceRoutes:[d],start:{segmentIndex:0,point:u},end:{segmentIndex:d.route.length-2,point:_}},c.push(l))}return c})(n),i=r.map((a,c)=>{let l=((h,d)=>{let u=h.sourceRoutes[0],_=h.sourceRoutes.at(-1);if(!u||!_)throw Error("Pipeline9 cannot simplify an empty mutation section");let p=[h.start.point];for(let[m,A]of h.sourceRoutes.entries()){let g=m===0,f=m===h.sourceRoutes.length-1,y=g?h.start.segmentIndex+1:0,x=f?h.end.segmentIndex+1:A.route.length;CGt(p,A.route.slice(y,x))}if(CGt(p,[h.end.point]),p.length<2)throw Error(`Pipeline9 mutation section for "${u.connectionName}" has no routable span`);return{connectionName:`pipeline9_mutated_preload_${u.preloadedTraceIndex}_${d}`,rootConnectionName:u.rootConnectionName,traceThickness:Math.max(...h.sourceRoutes.map((m)=>m.traceThickness)),viaDiameter:Math.max(...h.sourceRoutes.map((m)=>m.viaDiameter)),route:p,vias:Xan(p)}})(a,c);return{connectionName:l.connectionName,section:a,hdRoute:l}}),s=new Set(i.flatMap(({section:a})=>a.sourceRoutes.map((c)=>c.connectionName)));return{sections:i,immutableHdRoutes:o.filter((a)=>!s.has(a.connectionName)),normalizedFixedRoutes:o}},bje=0.000000001,lB=(e,t,n,o,r)=>{let i=r.getNetConnectedToId(e.connection_name)??e.connection_name,s=[],a=(c,l,h=o,d=[],u,_,p=!1)=>{c.length<2||s.push({connectionName:`${e.connection_name}_fixed_${t}_${s.length}`,rootConnectionName:i,preloadedTraceIndex:t,preloadedRouteIndex:s.length,preloadedRoutePositionStart:u,preloadedRoutePositionEnd:_,isThroughObstacle:p,traceThickness:Math.max(bje,l),viaDiameter:Math.max(bje,h),route:c,vias:d})};for(let c=0;c<e.route.length;c++){let l=e.route[c];if(l.route_type==="via"){a([{x:l.x,y:l.y,z:si(l.from_layer,n)},{x:l.x,y:l.y,z:si(l.to_layer,n)}],bje,l.via_diameter??o,[{x:l.x,y:l.y}],c,c);continue}if(l.route_type==="through_obstacle"){let d=si(l.from_layer,n),u=si(l.to_layer,n);for(let _=Math.min(d,u);_<=Math.max(d,u);_++)a([{...l.start,z:_},{...l.end,z:_}],l.width,o,[],c,c+1,!0);continue}let h=e.route[c+1];l.route_type==="wire"&&h?.route_type==="wire"&&l.layer===h.layer&&a([{x:l.x,y:l.y,z:si(l.layer,n)},{x:h.x,y:h.y,z:si(h.layer,n)}],Math.max(l.width,h.width),o,[],c,c+1)}return s};function yQ(e,t){return{x:e.a*t.x+e.b*t.y+e.c,y:e.d*t.x+e.e*t.y+e.f}}var M6r={highResolutionCellSize:0.1,highResolutionCellThickness:8,lowResolutionCellSize:0.4,traceMargin:0.15,traceThickness:0.1,viaDiameter:0.3,viaMinDistFromBorder:0.15},w6r={...M6r},Y$e=(e,t,n)=>{let[o,r]=e;if(o===r)return;let i=((s,a)=>{let c=s.portPointId??`${s.connectionName}:${s.x}:${s.y}:${s.z}`,l=a.portPointId??`${a.connectionName}:${a.x}:${a.y}:${a.z}`;return c<l?`${c}|${l}`:`${l}|${c}`})(o,r);t.has(i)||(t.add(i),n.push(e))},SGt=(e,t,n)=>{for(let o=0;o<e.length-1;o++)Y$e([e[o],e[o+1]],t,n)},B6r=(e)=>{let t=[],n=new Set,o=((s)=>{let a=new Map;for(let c of s)c.portPointId&&a.set(c.portPointId,c);return a})(e);for(let s of e){if(s.prevPortPointId){let a=o.get(s.prevPortPointId);a&&a.connectionName===s.connectionName&&Y$e([a,s],n,t)}if(s.nextPortPointId){let a=o.get(s.nextPortPointId);a&&a.connectionName===s.connectionName&&Y$e([s,a],n,t)}}if(t.length===0)return SGt(e,n,t),t;let r=((s)=>{let a=new Set;for(let[c,l]of s)c.portPointId&&a.add(c.portPointId),l.portPointId&&a.add(l.portPointId);return a})(t),i=e.filter((s)=>!s.portPointId||!r.has(s.portPointId));return SGt(i,n,t),t};function L3e(e,t,n){return Math.max(t,Math.min(n,e))}var Ije=["left","top","right","bottom","middle"],T6r=class{f=new Float64Array(1024);seq=new Uint32Array(1024);id=new Int32Array(1024);n=0;push(e,t,n){this.ensureCapacity(this.n+1);let o=this.n++;for(this.f[o]=e,this.seq[o]=t,this.id[o]=n;o>0;){let r=o-1>>1;if(this.less(r,o))break;this.swap(o,r),o=r}}pop(){let e=this.id[0];return this.n--,this.n>0&&(this.f[0]=this.f[this.n],this.seq[0]=this.seq[this.n],this.id[0]=this.id[this.n],this.siftDown(0)),e}get size(){return this.n}clear(){this.n=0}ensureCapacity(e){if(e<=this.f.length)return;let t=this.f.length;for(;t<e;)t*=2;let n=new Float64Array(t);n.set(this.f),this.f=n;let o=new Uint32Array(t);o.set(this.seq),this.seq=o;let r=new Int32Array(t);r.set(this.id),this.id=r}siftDown(e){for(;;){let t=2*e+1,n=t+1;if(t>=this.n)return;let o=t;if(n<this.n&&!this.less(t,n)&&(o=n),this.less(e,o))return;this.swap(e,o),e=o}}less(e,t){let n=this.f[e],o=this.f[t];return n!==o?n<o:this.seq[e]<this.seq[t]}swap(e,t){let n=this.f[e];this.f[e]=this.f[t],this.f[t]=n;let o=this.seq[e];this.seq[e]=this.seq[t],this.seq[t]=o;let r=this.id[e];this.id[e]=this.id[t],this.id[t]=r}},D6r=class{z=new Int32Array(1024);cellId=new Int32Array(1024);g=new Float64Array(1024);parent=new Int32Array(1024);ripHead=new Int32Array(1024).fill(-1);ripCount=new Int32Array(1024);length=0;clear(){this.length=0}push(e,t,n,o,r,i){this.ensureCapacity(this.length+1);let s=this.length++;return this.z[s]=e,this.cellId[s]=t,this.g[s]=n,this.parent[s]=o,this.ripHead[s]=r,this.ripCount[s]=i,s}ensureCapacity(e){if(e<=this.z.length)return;let t=this.z.length;for(;t<e;)t*=2;let n=new Int32Array(t);n.set(this.z),this.z=n;let o=new Int32Array(t);o.set(this.cellId),this.cellId=o;let r=new Float64Array(t);r.set(this.g),this.g=r;let i=new Int32Array(t);i.set(this.parent),this.parent=i;let s=new Int32Array(t);s.fill(-1),s.set(this.ripHead.subarray(0,this.length)),this.ripHead=s;let a=new Int32Array(t);a.set(this.ripCount.subarray(0,this.length)),this.ripCount=a}},N6r=class{connId=new Int32Array(1024);prev=new Int32Array(1024).fill(-1);length=0;clear(){this.length=0}append(e,t){this.ensureCapacity(this.length+1);let n=this.length++;return this.connId[n]=t,this.prev[n]=e,n}contains(e,t){for(let n=e;n>=0;n=this.prev[n])if(this.connId[n]===t)return!0;return!1}collect(e,t){t.length=0;for(let n=e;n>=0;n=this.prev[n])t.push(this.connId[n])}ensureCapacity(e){if(e<=this.connId.length)return;let t=this.connId.length;for(;t<e;)t*=2;let n=new Int32Array(t);n.set(this.connId),this.connId=n;let o=new Int32Array(t);o.fill(-1),o.set(this.prev.subarray(0,this.length)),this.prev=o}};function vje(e,t){return t??e.replace(/_mst\d+$/,"")}function Sje(e,t){let n=e.x-t.center.x,o=e.y-t.center.y,r=Math.cos(-t.rotationRadians),i=Math.sin(-t.rotationRadians);return{x:n*r-o*i,y:n*i+o*r}}function PGt(e){return{minX:-e.width/2,minY:-e.height/2,maxX:e.width/2,maxY:e.height/2}}function D3(e,t,n){return Math.max(t,Math.min(n,e))}function r$(e,t){for(let n=0;n<e.length;n++)if(e[n]===t)return;e.push(t)}function EGt(e,t){for(let n=0;n<e.length;n++)if(e[n].cellId===t.cellId)return;e.push(t)}function Oae(e,t,n,o,r,i,s){let a=e-D3(e,o,i),c=t-D3(t,r,s);return a*a+c*c<=n*n}function vV(e){let t=e.segmentEnd.x-e.segmentStart.x,n=e.segmentEnd.y-e.segmentStart.y,o=t**2+n**2;if(o===0)return(e.point.x-e.segmentStart.x)**2+(e.point.y-e.segmentStart.y)**2;let r=D3(((e.point.x-e.segmentStart.x)*t+(e.point.y-e.segmentStart.y)*n)/o,0,1),i=e.segmentStart.x+r*t,s=e.segmentStart.y+r*n;return(e.point.x-i)**2+(e.point.y-s)**2}function Ace(e){let t=D3(e.point.x,e.rect.minX,e.rect.maxX),n=D3(e.point.y,e.rect.minY,e.rect.maxY),o=e.point.x-t,r=e.point.y-n;return o*o+r*r}function fce(e){return(e.second.x-e.first.x)*(e.third.y-e.first.y)-(e.second.y-e.first.y)*(e.third.x-e.first.x)}function H3e(e){return!(Math.abs(fce({first:e.segmentStart,second:e.segmentEnd,third:e.point}))>0.000000001)&&(e.point.x>=Math.min(e.segmentStart.x,e.segmentEnd.x)&&e.point.x<=Math.max(e.segmentStart.x,e.segmentEnd.x)&&e.point.y>=Math.min(e.segmentStart.y,e.segmentEnd.y)&&e.point.y<=Math.max(e.segmentStart.y,e.segmentEnd.y))}function $an(e){let t=fce({first:e.firstStart,second:e.firstEnd,third:e.secondStart}),n=fce({first:e.firstStart,second:e.firstEnd,third:e.secondEnd}),o=fce({first:e.secondStart,second:e.secondEnd,third:e.firstStart}),r=fce({first:e.secondStart,second:e.secondEnd,third:e.firstEnd});return t*n<0&&o*r<0||(H3e({point:e.secondStart,segmentStart:e.firstStart,segmentEnd:e.firstEnd})||H3e({point:e.secondEnd,segmentStart:e.firstStart,segmentEnd:e.firstEnd})||H3e({point:e.firstStart,segmentStart:e.secondStart,segmentEnd:e.secondEnd})||H3e({point:e.firstEnd,segmentStart:e.secondStart,segmentEnd:e.secondEnd}))}function R6r(e){return $an(e)?0:Math.min(vV({point:e.firstStart,segmentStart:e.secondStart,segmentEnd:e.secondEnd}),vV({point:e.firstEnd,segmentStart:e.secondStart,segmentEnd:e.secondEnd}),vV({point:e.secondStart,segmentStart:e.firstStart,segmentEnd:e.firstEnd}),vV({point:e.secondEnd,segmentStart:e.firstStart,segmentEnd:e.firstEnd}))}function MGt(e){if(function(n){if(Ace({point:n.segmentStart,rect:n.rect})===0||Ace({point:n.segmentEnd,rect:n.rect})===0)return!0;let o=[{x:n.rect.minX,y:n.rect.minY},{x:n.rect.maxX,y:n.rect.minY},{x:n.rect.maxX,y:n.rect.maxY},{x:n.rect.minX,y:n.rect.maxY}];for(let r=0;r<o.length;r++){let i=(r+1)%o.length;if($an({firstStart:n.segmentStart,firstEnd:n.segmentEnd,secondStart:o[r],secondEnd:o[i]}))return!0}return!1}(e))return!0;let t=e.radius**2;if(Ace({point:e.segmentStart,rect:e.rect})<=t||Ace({point:e.segmentEnd,rect:e.rect})<=t)return!0;return[{x:e.rect.minX,y:e.rect.minY},{x:e.rect.maxX,y:e.rect.minY},{x:e.rect.maxX,y:e.rect.maxY},{x:e.rect.minX,y:e.rect.maxY}].some((n)=>vV({point:n,segmentStart:e.segmentStart,segmentEnd:e.segmentEnd})<=t)}var Q6r=class extends Da{getSolverName(){return"HighDensitySolverB01"}nodeWithPortPoints;obstacles;highResolutionCellSize;highResolutionCellThickness;lowResolutionCellSize;viaDiameter;MAX_RIPS;maxCellCount;traceThickness;traceMargin;obstacleClearanceMargin;viaMinDistFromBorder;showPenaltyMap;showUsedCellMap;effort;stepMultiplier;hyperParameters;initialPenaltyFn;boundsMinX;boundsMaxX;boundsMinY;boundsMaxY;gridToBoundsTransform;availableZ;zToLayer;layerToZ;layers;fineRows;fineCols;lowScale;bandRows;bandCols;regions;planeSize;cellCenterX;cellCenterY;cellMinX;cellMinY;cellMaxX;cellMaxY;cellWidth;cellHeight;cellRegion;cellRow;cellCol;viaAllowed;neighborOffset;neighborIds;neighborCosts;usedCellsFlat;sharedCellsFlat;portOwnerFlat;penalty2d;ripStateBuckets;visitedStamp;bestGStamp;bestGValue;visitedFlatStamp;sharedCrossRootPortFlat;stamp=0;connNameToId;connIdToName;connIdToRootNet;overlapFriendlyRootNets;usedIndicesByConn;unsolvedSegs;solvedRoutes;activeConnSeg=null;activeConnId=-1;nodePool;heap;ripChain;seqCounter=0;_viaOccs=[];_cellOccs=[];_rippedIds=[];ripCount;totalRipEvents=0;searchIterations=0;consecutiveSkips=0;penaltyCap;baseSearchBudgetIters;_moveCost=0;_moveRippedHead=-1;_moveRipCount=0;traceKeepoutRadius;viaKeepoutRadius;obstacleTraceRootIdsFlat;obstacleViaRootIdsByCell;obstacleRootNameToId;obstacleRootNames;obstacleTracePrimitives;obstacleViaPrimitives;obstacleRectPrimitives;obstacleTraceBlockedCellCount=0;obstacleViaBlockedCellCount=0;get unsolvedConnections(){return this.unsolvedSegs}get solvedConnectionsMap(){let e=new Map;for(let t=0;t<this.solvedRoutes.length;t++){let n=this.getSolvedRoutesForConn(t);n.length>0&&e.set(t,n)}return e}get activeConnection(){if(!this.activeConnSeg)return null;let e=this.activeConnSeg.startCellId,t=this.activeConnSeg.endCellId;return{connectionName:this.connIdToName[this.activeConnSeg.connId]??"",start:{cellId:e,region:Ije[this.cellRegion[e]],row:this.cellRow[e],col:this.cellCol[e],x:this.cellCenterX[e],y:this.cellCenterY[e],z:this.activeConnSeg.startZ},end:{cellId:t,region:Ije[this.cellRegion[t]],row:this.cellRow[t],col:this.cellCol[t],x:this.cellCenterX[t],y:this.cellCenterY[t],z:this.activeConnSeg.endZ}}}get openSet(){return{length:this.heap?.size??0}}get gridStats(){return{cells:this.planeSize||0,layers:this.layers||0,states:(this.planeSize||0)*(this.layers||0),ripStateBuckets:this.ripStateBuckets||0,neighborEdges:this.neighborIds?.length??0,regionCounts:this.regions?Object.fromEntries(this.regions.map((e)=>[e.name,e.rows*e.cols])):{},obstacleTraceBlockedCells:this.obstacleTraceBlockedCellCount,obstacleViaBlockedCells:this.obstacleViaBlockedCellCount,obstacleRootCount:this.obstacleRootNames?.length??0,obstacleRectCount:this.obstacleRectPrimitives?.length??0}}constructor(e){super(),this.nodeWithPortPoints=e.nodeWithPortPoints,this.obstacles=e.obstacles,this.highResolutionCellSize=e.highResolutionCellSize??0.1,this.highResolutionCellThickness=Math.max(1,Math.floor(e.highResolutionCellThickness??8)),this.lowResolutionCellSize=e.lowResolutionCellSize??0.4,this.viaDiameter=e.viaDiameter,this.maxCellCount=e.maxCellCount,this.traceThickness=e.traceThickness??0.1,this.traceMargin=e.traceMargin??0.15,this.obstacleClearanceMargin=e.obstacleClearanceMargin??0,this.viaMinDistFromBorder=e.viaMinDistFromBorder??0.15,this.showPenaltyMap=e.showPenaltyMap??!1,this.showUsedCellMap=e.showUsedCellMap??!1,this.effort=e.effort??1,this.stepMultiplier=Math.max(1,Math.floor(e.stepMultiplier??1)),this.hyperParameters={shuffleSeed:0,ripCost:8,ripTracePenalty:0.5,ripViaPenalty:0.75,viaBaseCost:0.1,greedyMultiplier:1.5,sameRootObstacleCostMultiplier:1,...e.hyperParameters},this.MAX_ITERATIONS=1e8,this.MAX_RIPS=200,this.initialPenaltyFn=e.initialPenaltyFn}getConstructorParams(){return[{nodeWithPortPoints:this.nodeWithPortPoints,obstacles:this.obstacles,highResolutionCellSize:this.highResolutionCellSize,highResolutionCellThickness:this.highResolutionCellThickness,lowResolutionCellSize:this.lowResolutionCellSize,viaDiameter:this.viaDiameter,maxCellCount:this.maxCellCount,stepMultiplier:this.stepMultiplier,traceThickness:this.traceThickness,traceMargin:this.traceMargin,obstacleClearanceMargin:this.obstacleClearanceMargin,viaMinDistFromBorder:this.viaMinDistFromBorder,showPenaltyMap:this.showPenaltyMap,showUsedCellMap:this.showUsedCellMap,effort:this.effort,hyperParameters:this.hyperParameters,initialPenaltyFn:this.initialPenaltyFn}]}_setup(){let{nodeWithPortPoints:e}=this,{width:t,height:n,center:o}=e;if(t>15||n>15)return this.error=`HighDensitySolverB01 only supports routing windows up to 15x15mm; received ${t}x${n}mm`,void(this.failed=!0);let r=this.lowResolutionCellSize/this.highResolutionCellSize,i=Math.round(r);if(!Number.isFinite(r)||r<=0||Math.abs(r-i)>0.000000001)return this.error="lowResolutionCellSize must be a positive integer multiple of highResolutionCellSize",void(this.failed=!0);this.lowScale=Math.max(1,i),this.availableZ=e.availableZ??[...new Set(e.portPoints.map((_)=>_.z))].sort((_,p)=>_-p),this.layers=this.availableZ.length,this.zToLayer=new Map,this.layerToZ=new Map;for(let _=0;_<this.availableZ.length;_++){let p=this.availableZ[_];this.zToLayer.set(p,_),this.layerToZ.set(_,p)}this.boundsMinX=o.x-t/2,this.boundsMaxX=o.x+t/2,this.boundsMinY=o.y-n/2,this.boundsMaxY=o.y+n/2,this.traceKeepoutRadius=this.traceMargin+this.traceThickness/2,this.viaKeepoutRadius=this.viaDiameter/2+this.traceKeepoutRadius,this.buildFiveRegionGrid(t,n),this.gridToBoundsTransform=this.computeGridToBoundsTransform();let s=this.layers*this.planeSize;if(this.maxCellCount!==void 0&&s>this.maxCellCount)return this.error=`Cell count ${s} exceeds maxCellCount ${this.maxCellCount}`,void(this.failed=!0);this.connNameToId=new Map,this.connIdToName=[],this.connIdToRootNet=[],this.overlapFriendlyRootNets=new Set,this.unsolvedSegs=this.buildConnectionSegs(),this.penalty2d=new Float64Array(this.planeSize);let a=t>0?1/t:0,c=n>0?1/n:0;for(let _=0;_<this.planeSize;_++){let p=0;this.initialPenaltyFn&&(p+=this.initialPenaltyFn({x:this.cellCenterX[_],y:this.cellCenterY[_],px:(this.cellCenterX[_]-this.boundsMinX)*a,py:(this.cellCenterY[_]-this.boundsMinY)*c,cellId:_,region:Ije[this.cellRegion[_]],row:this.cellRow[_],col:this.cellCol[_]})),this.penalty2d[_]=p}this.usedCellsFlat=new Int32Array(s).fill(-1),this.sharedCellsFlat=Array.from({length:s},()=>{}),this.portOwnerFlat=new Int32Array(s).fill(-1),this.sharedCrossRootPortFlat=new Uint8Array(s),this.obstacleTraceRootIdsFlat=Array.from({length:s},()=>{}),this.obstacleViaRootIdsByCell=Array.from({length:this.planeSize},()=>{}),this.obstacleRootNameToId=new Map,this.obstacleRootNames=[],this.obstacleTracePrimitives=[],this.obstacleViaPrimitives=[],this.obstacleRectPrimitives=[];let l=this.rasterizeObstacles();if(l)return this.error=l,void(this.failed=!0);this.ripStateBuckets=1;let h=s;this.visitedStamp=new Uint32Array(h),this.bestGStamp=new Uint32Array(h),this.bestGValue=new Float64Array(h),this.visitedFlatStamp=new Uint32Array(s),this.stamp=0;let d=new Map;for(let _ of this.nodeWithPortPoints.portPoints){let p=this.connNameToId.get(_.connectionName);if(p===void 0)continue;let m=this.pointToCell(_),A=m.z*this.planeSize+m.cellId,g=this.connIdToRootNet[p],f=d.get(A);f===void 0?d.set(A,g):f!==g&&(this.sharedCrossRootPortFlat[A]=1);let y=this.portOwnerFlat[A];this.portOwnerFlat[A]=y===-1||y===p?p:-2}this.solvedRoutes=[],this.usedIndicesByConn=[],this.ripCount=[],this.consecutiveSkips=0,this.penaltyCap=0.5*this.hyperParameters.ripCost,this.shuffleConnections();let u=function(_){let p=_.planeSize*_.layers,m=_.connectionCount,A=Math.sqrt(m),g=Math.max(1,_.maxIterations),f=L3e(Math.round(p*(8+1.2*A)),150000,12000000),y=L3e(Math.round(f*_.effort),150000,12000000),x=L3e(Math.round(0.2*g),150000,2000000);return{maxIterationsIters:Math.max(1,Math.min(g,Math.max(x,y))),baseSearchBudgetIters:L3e(Math.round(p*(10+0.8*A)*_.effort),50000,4000000)}}({planeSize:this.planeSize,layers:this.layers,connectionCount:this.unsolvedSegs.length,effort:this.effort,maxIterations:this.MAX_ITERATIONS});this.baseSearchBudgetIters=u.baseSearchBudgetIters,this.MAX_ITERATIONS=u.maxIterationsIters,this.activeConnSeg=null,this.activeConnId=-1,this.nodePool=new D6r,this.heap=new T6r,this.ripChain=new N6r,this.seqCounter=0}_step(){for(let e=0;e<this.stepMultiplier;e++){if(this.solved||this.failed)return;this.stepOnce()}}rasterizeObstacles(){for(let e=0;e<this.obstacles.length;e++){let t=this.obstacles[e];if(t.type==="rect"){let r=this.rasterizeRectObstacle(t,e);if(r)return r;continue}if(t.traceThickness<=0||t.viaDiameter<=0||t.route.length<2)return`Obstacle ${e} must have positive trace/via sizes and at least two route points`;let n=vje(t.connectionName,t.rootConnectionName),o=this.internObstacleRootName(n);for(let r=1;r<t.route.length;r++){let i=t.route[r-1],s=t.route[r];if(!(Number.isFinite(i.x)&&Number.isFinite(i.y)&&Number.isFinite(i.z)&&Number.isFinite(s.x)&&Number.isFinite(s.y)&&Number.isFinite(s.z)))return`Obstacle ${e} contains non-finite route coordinates`;if(i.z===s.z){let a=this.zToLayer.get(i.z);if(a===void 0)return`Obstacle ${e} uses unavailable layer z=${i.z}`;this.rasterizeObstacleTraceSegment({segmentStart:i,segmentEnd:s,layer:a,obstacleRootId:o,obstacleTraceThickness:t.traceThickness})}else if(!t.vias.some((a)=>a.x===s.x&&a.y===s.y)){let a=this.rasterizeObstacleVia({center:s,obstacleRootId:o,obstacleViaDiameter:t.viaDiameter,zStart:i.z,zEnd:s.z,obstacleIndex:e});if(a)return a}}for(let r of t.vias){if(!Number.isFinite(r.x)||!Number.isFinite(r.y))return`Obstacle ${e} contains non-finite via coordinates`;let i=this.rasterizeObstacleVia({center:r,obstacleRootId:o,obstacleViaDiameter:t.viaDiameter,zStart:r.zStart,zEnd:r.zEnd,obstacleIndex:e});if(i)return i}}return this.obstacleTraceBlockedCellCount=this.obstacleTraceRootIdsFlat.reduce((e,t)=>e+(t?1:0),0),this.obstacleViaBlockedCellCount=this.obstacleViaRootIdsByCell.reduce((e,t)=>e+(t?1:0),0),null}rasterizeRectObstacle(e,t){if(!Number.isFinite(e.center.x)||!Number.isFinite(e.center.y)||!Number.isFinite(e.width)||!Number.isFinite(e.height)||e.width<=0||e.height<=0)return`Rect obstacle ${t} must have finite geometry and positive dimensions`;let n=[];for(let l of e.zLayers){let h=this.zToLayer.get(l);if(h===void 0)return`Rect obstacle ${t} uses unavailable layer z=${l}`;r$(n,h)}if(n.length===0)return`Rect obstacle ${t} must apply to at least one layer`;let o=this.internObstacleRootName(vje(e.connectionName,e.rootConnectionName)),r={rootId:o,center:e.center,width:e.width,height:e.height,rotationRadians:(e.ccwRotationDegrees??0)*Math.PI/180,layers:n};this.obstacleRectPrimitives.push(r);let i=this.transformBoundsPointToGrid(e.center),s=Math.hypot(e.width/2,e.height/2),a=this.getConservativeGridRadius(s+this.traceThickness/2+this.traceMargin);this.forEachCellNearCircle(i.x,i.y,a,(l)=>{for(let h of n)this.addObstacleRootId({rootIdsByCell:this.obstacleTraceRootIdsFlat,cellIndex:h*this.planeSize+l,obstacleRootId:o})});let c=this.getConservativeGridRadius(s+this.viaDiameter/2+this.traceMargin);return this.forEachCellNearCircle(i.x,i.y,c,(l)=>{this.addObstacleRootId({rootIdsByCell:this.obstacleViaRootIdsByCell,cellIndex:l,obstacleRootId:o})}),null}internObstacleRootName(e){let t=this.obstacleRootNameToId.get(e);if(t!==void 0)return t;let n=this.obstacleRootNames.length;return this.obstacleRootNames.push(e),this.obstacleRootNameToId.set(e,n),n}rasterizeObstacleTraceSegment(e){this.obstacleTracePrimitives.push({rootId:e.obstacleRootId,layer:e.layer,segmentStart:e.segmentStart,segmentEnd:e.segmentEnd,traceRadius:e.obstacleTraceThickness/2});let t=this.transformBoundsPointToGrid(e.segmentStart),n=this.transformBoundsPointToGrid(e.segmentEnd),o=this.getConservativeGridRadius(e.obstacleTraceThickness/2+this.traceMargin),r=this.getConservativeGridRadius(e.obstacleTraceThickness/2+this.viaDiameter/2+this.traceMargin);this.forEachCellNearSegment({segmentStart:t,segmentEnd:n,radius:o},(i)=>{this.addObstacleRootId({rootIdsByCell:this.obstacleTraceRootIdsFlat,cellIndex:e.layer*this.planeSize+i,obstacleRootId:e.obstacleRootId})}),this.forEachCellNearSegment({segmentStart:t,segmentEnd:n,radius:r},(i)=>{this.addObstacleRootId({rootIdsByCell:this.obstacleViaRootIdsByCell,cellIndex:i,obstacleRootId:e.obstacleRootId})})}rasterizeObstacleVia(e){if(e.zStart===void 0!=(e.zEnd===void 0))return`Obstacle ${e.obstacleIndex} via must provide both zStart and zEnd`;let t=Array.from({length:this.layers},(i,s)=>s);if(e.zStart!==void 0&&e.zEnd!==void 0){if(!Number.isFinite(e.zStart)||!Number.isFinite(e.zEnd))return`Obstacle ${e.obstacleIndex} contains a non-finite via layer span`;let i=Math.min(e.zStart,e.zEnd),s=Math.max(e.zStart,e.zEnd);t=this.availableZ.flatMap((a,c)=>a>=i&&a<=s?[c]:[])}if(t.length===0)return null;this.obstacleViaPrimitives.push({rootId:e.obstacleRootId,center:e.center,viaRadius:e.obstacleViaDiameter/2,layers:t});let n=this.transformBoundsPointToGrid(e.center),o=this.getConservativeGridRadius(e.obstacleViaDiameter/2+this.traceThickness/2+this.traceMargin),r=this.getConservativeGridRadius(e.obstacleViaDiameter/2+this.viaDiameter/2+this.traceMargin);return this.forEachCellNearCircle(n.x,n.y,Math.max(o,r),(i)=>{let s=this.getCellRect(i);if(Oae(n.x,n.y,o,s.minX,s.minY,s.maxX,s.maxY))for(let a of t)this.addObstacleRootId({rootIdsByCell:this.obstacleTraceRootIdsFlat,cellIndex:a*this.planeSize+i,obstacleRootId:e.obstacleRootId});Oae(n.x,n.y,r,s.minX,s.minY,s.maxX,s.maxY)&&this.addObstacleRootId({rootIdsByCell:this.obstacleViaRootIdsByCell,cellIndex:i,obstacleRootId:e.obstacleRootId})}),null}forEachCellNearSegment(e,t){let n={x:(e.segmentStart.x+e.segmentEnd.x)/2,y:(e.segmentStart.y+e.segmentEnd.y)/2},o=Math.hypot(e.segmentEnd.x-e.segmentStart.x,e.segmentEnd.y-e.segmentStart.y)/2+e.radius;this.forEachCellNearCircle(n.x,n.y,o,(r)=>{MGt({segmentStart:e.segmentStart,segmentEnd:e.segmentEnd,radius:e.radius,rect:this.getCellRect(r)})&&t(r)})}getCellRect(e){return{minX:this.cellMinX[e],minY:this.cellMinY[e],maxX:this.cellMaxX[e],maxY:this.cellMaxY[e]}}transformBoundsPointToGrid(e){let t=this.gridToBoundsTransform;return{x:(e.x-t.c)/t.a,y:(e.y-t.f)/t.e}}getConservativeGridRadius(e){return e/Math.min(Math.abs(this.gridToBoundsTransform.a),Math.abs(this.gridToBoundsTransform.e))}addObstacleRootId(e){let t=e.rootIdsByCell[e.cellIndex];t||(t=[],e.rootIdsByCell[e.cellIndex]=t),r$(t,e.obstacleRootId)}isBlockedByObstacleRoots(e,t){if(!e)return!1;let n=this.connIdToRootNet[t];for(let o of e)if(this.obstacleRootNames[o]!==n)return!0;return!1}hasSameRootObstacle(e,t){if(!e)return!1;let n=this.connIdToRootNet[t];return e.some((o)=>this.obstacleRootNames[o]===n)}isLateralMoveBlockedByObstacleGeometry(e){let t=this.connIdToRootNet[e.activeConn],n=this.activeConnSeg,o=n&&e.layer===n.startZ&&e.fromCellId===n.startCellId?n.startPoint:yQ(this.gridToBoundsTransform,{x:this.cellCenterX[e.fromCellId],y:this.cellCenterY[e.fromCellId]}),r=n&&e.layer===n.endZ&&e.toCellId===n.endCellId?n.endPoint:yQ(this.gridToBoundsTransform,{x:this.cellCenterX[e.toCellId],y:this.cellCenterY[e.toCellId]});for(let i of this.obstacleTracePrimitives){if(i.layer!==e.layer||this.obstacleRootNames[i.rootId]===t)continue;let s=i.traceRadius+this.traceThickness/2+this.obstacleClearanceMargin;if(R6r({firstStart:o,firstEnd:r,secondStart:i.segmentStart,secondEnd:i.segmentEnd})<s*s)return!0}for(let i of this.obstacleViaPrimitives){if(!i.layers.includes(e.layer)||this.obstacleRootNames[i.rootId]===t)continue;let s=i.viaRadius+this.traceThickness/2+this.obstacleClearanceMargin;if(vV({point:i.center,segmentStart:o,segmentEnd:r})<s*s)return!0}for(let i of this.obstacleRectPrimitives)if(i.layers.includes(e.layer)&&this.obstacleRootNames[i.rootId]!==t&&MGt({segmentStart:Sje(o,i),segmentEnd:Sje(r,i),radius:this.traceThickness/2+this.obstacleClearanceMargin,rect:PGt(i)}))return!0;return!1}isViaMoveBlockedByObstacleGeometry(e){let t=this.connIdToRootNet[e.activeConn],n=yQ(this.gridToBoundsTransform,{x:this.cellCenterX[e.cellId],y:this.cellCenterY[e.cellId]});for(let o of this.obstacleTracePrimitives){if(this.obstacleRootNames[o.rootId]===t)continue;let r=o.traceRadius+this.viaDiameter/2+this.obstacleClearanceMargin;if(vV({point:n,segmentStart:o.segmentStart,segmentEnd:o.segmentEnd})<r*r)return!0}for(let o of this.obstacleViaPrimitives){if(this.obstacleRootNames[o.rootId]===t)continue;let r=o.viaRadius+this.viaDiameter/2+this.obstacleClearanceMargin;if((n.x-o.center.x)**2+(n.y-o.center.y)**2<r*r)return!0}for(let o of this.obstacleRectPrimitives){if(this.obstacleRootNames[o.rootId]===t)continue;let r=Sje(n,o),i=this.viaDiameter/2+this.obstacleClearanceMargin;if(Ace({point:r,rect:PGt(o)})<i*i)return!0}return!1}buildFiveRegionGrid(e,t){this.fineCols=Math.max(1,Math.ceil(e/this.highResolutionCellSize)),this.fineRows=Math.max(1,Math.ceil(t/this.highResolutionCellSize)),this.bandCols=Math.min(this.highResolutionCellThickness,Math.floor(this.fineCols/2)),this.bandRows=Math.min(this.highResolutionCellThickness,Math.floor(this.fineRows/2));let n=Math.max(0,this.fineCols-2*this.bandCols),o=Math.max(0,this.fineRows-2*this.bandRows),r=n,i=n;this.regions=[{id:0,name:"left",fineOriginRow:0,fineOriginCol:0,fineRows:this.fineRows,fineCols:this.bandCols,cellScale:1,rows:this.fineRows,cols:this.bandCols,offset:0},{id:1,name:"top",fineOriginRow:0,fineOriginCol:this.bandCols,fineRows:this.bandRows,fineCols:r,cellScale:1,rows:this.bandRows,cols:r,offset:0},{id:2,name:"right",fineOriginRow:0,fineOriginCol:this.fineCols-this.bandCols,fineRows:this.fineRows,fineCols:this.bandCols,cellScale:1,rows:this.fineRows,cols:this.bandCols,offset:0},{id:3,name:"bottom",fineOriginRow:this.fineRows-this.bandRows,fineOriginCol:this.bandCols,fineRows:this.bandRows,fineCols:i,cellScale:1,rows:this.bandRows,cols:i,offset:0},{id:4,name:"middle",fineOriginRow:this.bandRows,fineOriginCol:this.bandCols,fineRows:o,fineCols:n,cellScale:this.lowScale,rows:o>0?Math.ceil(o/this.lowScale):0,cols:n>0?Math.ceil(n/this.lowScale):0,offset:0}];let s=0;for(let x=0;x<this.regions.length;x++)this.regions[x].offset=s,s+=this.regions[x].rows*this.regions[x].cols;this.planeSize=s,this.cellCenterX=new Float64Array(this.planeSize),this.cellCenterY=new Float64Array(this.planeSize),this.cellMinX=new Float64Array(this.planeSize),this.cellMinY=new Float64Array(this.planeSize),this.cellMaxX=new Float64Array(this.planeSize),this.cellMaxY=new Float64Array(this.planeSize),this.cellWidth=new Float64Array(this.planeSize),this.cellHeight=new Float64Array(this.planeSize),this.cellRegion=new Uint8Array(this.planeSize),this.cellRow=new Int32Array(this.planeSize),this.cellCol=new Int32Array(this.planeSize),this.viaAllowed=new Uint8Array(this.planeSize);for(let x=0;x<this.regions.length;x++){let C=this.regions[x];for(let b=0;b<C.rows;b++){let I=C.fineOriginRow+b*C.cellScale,v=Math.min(C.fineOriginRow+C.fineRows,I+C.cellScale),P=this.boundsMinY+I*this.highResolutionCellSize,M=Math.min(this.boundsMaxY,this.boundsMinY+v*this.highResolutionCellSize);for(let B=0;B<C.cols;B++){let T=C.fineOriginCol+B*C.cellScale,N=Math.min(C.fineOriginCol+C.fineCols,T+C.cellScale),D=this.boundsMinX+T*this.highResolutionCellSize,L=Math.min(this.boundsMaxX,this.boundsMinX+N*this.highResolutionCellSize),H=this.cellIdFor(C.id,b,B);this.cellCenterX[H]=(D+L)/2,this.cellCenterY[H]=(P+M)/2,this.cellMinX[H]=D,this.cellMinY[H]=P,this.cellMaxX[H]=L,this.cellMaxY[H]=M,this.cellWidth[H]=L-D,this.cellHeight[H]=M-P,this.cellRegion[H]=C.id,this.cellRow[H]=b,this.cellCol[H]=B;let V=Math.min(this.cellCenterX[H]-this.boundsMinX,this.boundsMaxX-this.cellCenterX[H],this.cellCenterY[H]-this.boundsMinY,this.boundsMaxY-this.cellCenterY[H]);this.viaAllowed[H]=V>=this.viaMinDistFromBorder?1:0}}}let a=Array.from({length:this.planeSize},()=>[]),c=(x,C)=>{if(x===C||x<0||C<0)return;let b=this.cellCenterX[x]-this.cellCenterX[C],I=this.cellCenterY[x]-this.cellCenterY[C],v=Math.hypot(b,I);EGt(a[x],{cellId:C,cost:v}),EGt(a[C],{cellId:x,cost:v})};for(let x=0;x<this.regions.length;x++){let C=this.regions[x];for(let b=0;b<C.rows;b++)for(let I=0;I<C.cols;I++){let v=this.cellIdFor(C.id,b,I);b+1<C.rows&&c(v,this.cellIdFor(C.id,b+1,I)),I+1<C.cols&&c(v,this.cellIdFor(C.id,b,I+1))}}let l=this.regions[0],h=this.regions[1],d=this.regions[2],u=this.regions[3],_=this.regions[4],p=l.rows>0&&l.cols>0,m=h.rows>0&&h.cols>0,A=d.rows>0&&d.cols>0,g=u.rows>0&&u.cols>0,f=_.rows>0&&_.cols>0;if(p&&m)for(let x=0;x<this.bandRows;x++)c(this.cellIdFor(0,x,l.cols-1),this.cellIdFor(1,x,0));if(m&&A)for(let x=0;x<this.bandRows;x++)c(this.cellIdFor(1,x,h.cols-1),this.cellIdFor(2,x,0));if(p&&g)for(let x=this.fineRows-this.bandRows;x<this.fineRows;x++)c(this.cellIdFor(0,x,l.cols-1),this.cellIdFor(3,x-(this.fineRows-this.bandRows),0));if(g&&A)for(let x=this.fineRows-this.bandRows;x<this.fineRows;x++)c(this.cellIdFor(3,x-(this.fineRows-this.bandRows),u.cols-1),this.cellIdFor(2,x,0));if(p&&f)for(let x=this.bandRows;x<this.fineRows-this.bandRows;x++)c(this.cellIdFor(0,x,l.cols-1),this.cellIdFor(4,Math.floor((x-this.bandRows)/this.lowScale),0));if(A&&f)for(let x=this.bandRows;x<this.fineRows-this.bandRows;x++)c(this.cellIdFor(4,Math.floor((x-this.bandRows)/this.lowScale),_.cols-1),this.cellIdFor(2,x,0));if(m&&f)for(let x=this.bandCols;x<this.fineCols-this.bandCols;x++)c(this.cellIdFor(1,h.rows-1,x-this.bandCols),this.cellIdFor(4,0,Math.floor((x-this.bandCols)/this.lowScale)));if(g&&f)for(let x=this.bandCols;x<this.fineCols-this.bandCols;x++)c(this.cellIdFor(4,_.rows-1,Math.floor((x-this.bandCols)/this.lowScale)),this.cellIdFor(3,0,x-this.bandCols));if(!f&&!m&&!g&&p&&A)for(let x=0;x<Math.min(l.rows,d.rows);x++)c(this.cellIdFor(0,x,l.cols-1),this.cellIdFor(2,x,0));if(!f&&!p&&!A&&m&&g)for(let x=0;x<Math.min(h.cols,u.cols);x++)c(this.cellIdFor(1,h.rows-1,x),this.cellIdFor(3,0,x));let y=this.flattenNeighborLists(a);this.neighborOffset=y.offset,this.neighborIds=y.ids,this.neighborCosts=y.costs}cellIdFor(e,t,n){let o=this.regions[e];return o.offset+t*o.cols+n}stepOnce(){if(!this.activeConnSeg){if(this.unsolvedSegs.length===0)return void(this.solved=!0);let f=this.unsolvedSegs.shift();this.activeConnSeg=f,this.activeConnId=f.connId,this.nodePool.clear(),this.ripChain.clear(),this.heap.clear(),this.seqCounter=0,this.searchIterations=0,this.nextStamp();let y=this.computeH(f.startZ,f.startCellId,f.endZ,f.endCellId)*this.hyperParameters.greedyMultiplier,x=this.nodePool.push(f.startZ,f.startCellId,0,-1,-1,0),C=f.startZ*this.planeSize+f.startCellId,b=this.getSearchStateIdx(C,0);return this.bestGStamp[b]=this.stamp,this.bestGValue[b]=0,void this.heap.push(y,this.seqCounter++,x)}this.searchIterations++;let e=this.ripCount[this.activeConnId]??0,t=Math.round(this.baseSearchBudgetIters*(1+0.25*Math.min(e,10)));if(this.searchIterations>t){let f=this.penalty2d;for(let y=0;y<f.length;y++)f[y]=0.9*f[y];return this.unsolvedSegs.push(this.activeConnSeg),this.activeConnSeg=null,this.activeConnId=-1,this.heap.clear(),this.nodePool.clear(),this.consecutiveSkips++,void(this.consecutiveSkips>=Math.max(3,3*this.unsolvedSegs.length)&&(this.error=`Convergence failure: ${this.unsolvedSegs.length} connections stuck`,this.failed=!0))}if(this.heap.size===0)return this.error=`No path found for ${this.connIdToName[this.activeConnId]}`,void(this.failed=!0);let n=this.heap.pop(),o=this.nodePool.z[n],r=this.nodePool.cellId[n],i=this.nodePool.g[n],s=this.nodePool.ripHead[n],a=this.nodePool.ripCount[n],c=o*this.planeSize+r,l=this.getSearchStateIdx(c,a);if(this.visitedStamp[l]===this.stamp)return;this.visitedStamp[l]=this.stamp,this.visitedFlatStamp[c]=this.stamp;let h=this.activeConnSeg;if(o===h.endZ&&r===h.endCellId)return this.finalizeRoute(n),this.activeConnSeg=null,void(this.activeConnId=-1);let d=this.visitedStamp,u=this.stamp,_=this.activeConnId,{endZ:p,endCellId:m}=h,A=this.neighborOffset[r],g=this.neighborOffset[r+1];for(let f=A;f<g;f++){let y=this.neighborIds[f],x=o*this.planeSize+y;if(this.computeMoveCostAndRips(_,o,r,y,!1,s,a,this.neighborCosts[f]),this._moveCost<0)continue;let C=this.getSearchStateIdx(x,this._moveRipCount);if(d[C]===u)continue;let b=i+this._moveCost;if(this.bestGStamp[C]===u&&b>=this.bestGValue[C])continue;this.bestGStamp[C]=u,this.bestGValue[C]=b;let I=b+this.computeH(o,y,p,m)*this.hyperParameters.greedyMultiplier,v=this.nodePool.push(o,y,b,n,this._moveRippedHead,this._moveRipCount);this.heap.push(I,this.seqCounter++,v)}if(this.viaAllowed[r])for(let f=0;f<this.layers;f++){if(f===o)continue;let y=f*this.planeSize+r;if(this.computeMoveCostAndRips(_,f,r,r,!0,s,a,0),this._moveCost<0)continue;let x=this.getSearchStateIdx(y,this._moveRipCount);if(d[x]===u)continue;let C=i+this._moveCost;if(this.bestGStamp[x]===u&&C>=this.bestGValue[x])continue;this.bestGStamp[x]=u,this.bestGValue[x]=C;let b=C+this.computeH(f,r,p,m)*this.hyperParameters.greedyMultiplier,I=this.nodePool.push(f,r,C,n,this._moveRippedHead,this._moveRipCount);this.heap.push(b,this.seqCounter++,I)}}computeMoveCostAndRips(e,t,n,o,r,i,s,a){let c=0,l=i,h=s,d=t*this.planeSize+o,u=r?this.obstacleViaRootIdsByCell[o]:[...this.obstacleTraceRootIdsFlat[t*this.planeSize+n]??[],...this.obstacleTraceRootIdsFlat[d]??[]];if(this.isBlockedByObstacleRoots(u,e)&&(r?this.isViaMoveBlockedByObstacleGeometry({activeConn:e,cellId:o}):this.isLateralMoveBlockedByObstacleGeometry({activeConn:e,layer:t,fromCellId:n,toCellId:o})))return this._moveCost=-1,this._moveRippedHead=l,void(this._moveRipCount=h);let _=this.hasSameRootObstacle(u,e);if(r){c+=this.hyperParameters.viaBaseCost,c+=Math.min(this.penalty2d[o],this.penaltyCap);let p=this.portOwnerFlat[d],m=this.allowSharedUse(e,p),A=this.activeConnSeg,g=!!A&&t===A.endZ&&o===A.endCellId;if(p>=0&&p!==e&&!m&&!g)return this._moveCost=-1,void(this._moveRippedHead=l);this.fillViaOccupants(o,e);let f=this._viaOccs;for(let y=0;y<f.length;y++){let x=f[y];this.ripChain.contains(l,x)||(c+=this.hyperParameters.ripCost,l=this.ripChain.append(l,x),h++),c+=this.hyperParameters.ripViaPenalty}}else{c+=a,c+=Math.min(this.penalty2d[o],this.penaltyCap);let p=this.portOwnerFlat[d],m=this.allowSharedUse(e,p),A=this.activeConnSeg,g=!!A&&t===A.endZ&&o===A.endCellId;if(p>=0&&p!==e&&!m&&!g)return this._moveCost=-1,void(this._moveRippedHead=l);this.fillTraceOccupants(d,e,this._cellOccs);for(let f=0;f<this._cellOccs.length;f++){let y=this._cellOccs[f];this.ripChain.contains(l,y)||(c+=this.hyperParameters.ripCost,l=this.ripChain.append(l,y),h++),c+=this.hyperParameters.ripTracePenalty}}_&&(c*=this.hyperParameters.sameRootObstacleCostMultiplier),this._moveCost=c,this._moveRippedHead=l,this._moveRipCount=h}fillViaOccupants(e,t){let n=this._viaOccs;n.length=0;let o=this.cellCenterX[e],r=this.cellCenterY[e];this.forEachCellNearCircle(o,r,this.viaKeepoutRadius,(i)=>{if(Oae(o,r,this.viaKeepoutRadius,this.cellMinX[i],this.cellMinY[i],this.cellMaxX[i],this.cellMaxY[i]))for(let s=0;s<this.layers;s++)this.pushFlatOccupants(s*this.planeSize+i,t,n)})}fillTraceOccupants(e,t,n){n.length=0,this.pushFlatOccupants(e,t,n)}pushFlatOccupants(e,t,n){let o=this.usedCellsFlat[e];o===-1||o===t||this.allowSharedUse(t,o)||r$(n,o);let r=this.sharedCellsFlat[e];if(r)for(let i=0;i<r.length;i++){let s=r[i];s!==t&&(this.allowSharedUse(t,s)||r$(n,s))}}addSharedOccupant(e,t){if(this.usedCellsFlat[e]===t)return;let n=this.sharedCellsFlat[e];n||(n=[],this.sharedCellsFlat[e]=n),r$(n,t)}replaceOccupants(e,t){this.usedCellsFlat[e]=t,this.sharedCellsFlat[e]=void 0}removeOccupant(e,t){let n=this.sharedCellsFlat[e];if(this.usedCellsFlat[e]===t)return void(n&&n.length>0?(this.usedCellsFlat[e]=n.pop(),n.length===0&&(this.sharedCellsFlat[e]=void 0)):this.usedCellsFlat[e]=-1);if(!n)return;let o=n.indexOf(t);o!==-1&&(n.splice(o,1),n.length===0&&(this.sharedCellsFlat[e]=void 0))}allowSharedUse(e,t){if(t<0)return!1;return this.connIdToRootNet[t]===this.connIdToRootNet[e]}shouldSkipFixedPortHalo(e,t){let n=this.portOwnerFlat[e];return n!==t&&(n===-2||!(n<0)&&!this.allowSharedUse(t,n))}nextStamp(){this.stamp=this.stamp+1>>>0,this.stamp===0&&(this.visitedStamp.fill(0),this.bestGStamp.fill(0),this.visitedFlatStamp.fill(0),this.stamp=1)}getSearchStateIdx(e,t){return e}computeH(e,t,n,o){let r=Math.hypot(this.cellCenterX[t]-this.cellCenterX[o],this.cellCenterY[t]-this.cellCenterY[o]);return e===n?r:r+this.hyperParameters.viaBaseCost}internConn(e,t){let n=this.connNameToId.get(e);if(n!==void 0)return n;let o=this.connIdToName.length;return this.connIdToName.push(e),this.connIdToRootNet.push(vje(e,t)),this.connNameToId.set(e,o),o}buildConnectionSegs(){let e=new Map;for(let o of this.nodeWithPortPoints.portPoints){let r=o.connectionName;e.has(r)||e.set(r,{points:[],rootConnectionName:o.rootConnectionName}),e.get(r).points.push(o)}let t=[],n=new Map;for(let[o,r]of e){let i=r.points,s=B6r(i);if(s.length===0)continue;let a=this.internConn(o,r.rootConnectionName);for(let[c,l]of s){let h=this.pointToCell(c),d=this.pointToCell(l),u=`${h.z}:${h.cellId}`,_=`${d.z}:${d.cellId}`,p=u<_?`${u}|${_}`:`${_}|${u}`,m=this.connIdToRootNet[a],A=`${m}|${p}`,g=n.get(A);if(g){if(this.overlapFriendlyRootNets.add(m),!g.connectionAliases.some((y)=>y.connectionName===o)){let y=g.startZ===h.z&&g.startCellId===h.cellId&&g.endZ===d.z&&g.endCellId===d.cellId,x=g.startZ===d.z&&g.startCellId===d.cellId&&g.endZ===h.z&&g.endCellId===h.cellId;if(!y&&!x)throw Error(`Connection alias ${o} does not match canonical segment ${A}`);g.connectionAliases.push({connectionName:o,rootConnectionName:m,startPoint:c,endPoint:l,reversedFromCanonical:!y&&x})}continue}let f={connId:a,startZ:h.z,startCellId:h.cellId,startPoint:c,endZ:d.z,endCellId:d.cellId,endPoint:l,connectionAliases:[{connectionName:o,rootConnectionName:m,startPoint:c,endPoint:l,reversedFromCanonical:!1}]};n.set(A,f),t.push(f)}}return t}pointToCell(e){let t=D3(Math.floor((e.x-this.boundsMinX)/this.highResolutionCellSize),0,this.fineCols-1),n=D3(Math.floor((e.y-this.boundsMinY)/this.highResolutionCellSize),0,this.fineRows-1),o=4;t<this.bandCols?o=0:t>=this.fineCols-this.bandCols?o=2:n<this.bandRows?o=1:n>=this.fineRows-this.bandRows&&(o=3);let r=this.regions[o],i=n-r.fineOriginRow,s=t-r.fineOriginCol,a=D3(Math.floor(i/r.cellScale),0,Math.max(0,r.rows-1)),c=D3(Math.floor(s/r.cellScale),0,Math.max(0,r.cols-1));return{z:this.zToLayer.get(e.z)??0,cellId:this.cellIdFor(o,a,c)}}shuffleConnections(){let e=this.unsolvedSegs,t=this.hyperParameters.shuffleSeed>>>0,n=()=>(t=Math.imul(t,1664525)+1013904223>>>0,t/4294967295);for(let o=e.length-1;o>0;o--){let r=Math.floor(n()*(o+1)),i=e[o];e[o]=e[r],e[r]=i}}finalizeRoute(e){this.consecutiveSkips=Math.max(0,this.consecutiveSkips-1);let t=[],n=e;for(;n>=0;){let l=this.nodePool.z[n],h=this.nodePool.cellId[n];t.push(l*this.planeSize+h),n=this.nodePool.parent[n]}for(t.reverse();t.length>1&&this.sharedCrossRootPortFlat[t[0]];)t.shift();for(;t.length>1&&this.sharedCrossRootPortFlat[t[t.length-1]];)t.pop();let o=this.extractViaCellIds(t),r=this.activeConnId;this.ripChain.collect(this.nodePool.ripHead[e],this._rippedIds);for(let l=0;l<this._rippedIds.length;l++)if(this.ripTrace(this._rippedIds[l]),this.failed)return;let i=[];for(let l=0;l<t.length;l++){let h=t[l],d=Math.floor(h/this.planeSize),u=h-d*this.planeSize;this.markTraceFootprint(r,d,u,i)}let s=[];for(let l=0;l<o.length;l++)this.markViaFootprint(r,o[l],i,s);for(;this.usedIndicesByConn.length<=r;)this.usedIndicesByConn.push(void 0);let a=this.usedIndicesByConn[r]??[];for(a.push(...i),this.usedIndicesByConn[r]=a;this.solvedRoutes.length<=r;)this.solvedRoutes.push(void 0);let c=this.solvedRoutes[r]??[];c.push({connId:r,states:Int32Array.from(t),viaCellIds:Int32Array.from(o),startPoint:this.activeConnSeg.startPoint,endPoint:this.activeConnSeg.endPoint,connectionAliases:this.activeConnSeg.connectionAliases}),this.solvedRoutes[r]=c;for(let l=0;l<s.length;l++)if(this.ripTrace(s[l]),this.failed)return;if(this._rippedIds.length>0||s.length>0){let l=this.penalty2d,h=this.penaltyCap;if(this.totalRipEvents>50)for(let d=0;d<l.length;d++)l[d]=0.99*l[d];else for(let d=0;d<l.length;d++)l[d]>h&&(l[d]=0.5*l[d])}}extractViaCellIds(e){let t=[];for(let n=1;n<e.length;n++){let o=e[n-1],r=e[n],i=Math.floor(o/this.planeSize),s=Math.floor(r/this.planeSize);i!==s&&t.push(r-s*this.planeSize)}return t}markTraceFootprint(e,t,n,o){let r=this.cellCenterX[n],i=this.cellCenterY[n];this.forEachCellNearCircle(r,i,this.traceKeepoutRadius,(s)=>{if(!Oae(r,i,this.traceKeepoutRadius,this.cellMinX[s],this.cellMinY[s],this.cellMaxX[s],this.cellMaxY[s]))return;let a=t*this.planeSize+s;if(s!==n&&this.shouldSkipFixedPortHalo(a,e))return;let c=this.usedCellsFlat[a],l=this.allowSharedUse(e,c);(c===-1||c===e||l)&&(c!==-1&&c!==e?this.addSharedOccupant(a,e):this.usedCellsFlat[a]=e,o.push(a))})}markViaFootprint(e,t,n,o){let r=this.cellCenterX[t],i=this.cellCenterY[t];this.forEachCellNearCircle(r,i,this.viaKeepoutRadius,(s)=>{if(Oae(r,i,this.viaKeepoutRadius,this.cellMinX[s],this.cellMinY[s],this.cellMaxX[s],this.cellMaxY[s]))for(let a=0;a<this.layers;a++){let c=a*this.planeSize+s;if(s!==t&&this.shouldSkipFixedPortHalo(c,e))continue;if(this.fillTraceOccupants(c,e,this._cellOccs),this._cellOccs.length>0){for(let h=0;h<this._cellOccs.length;h++)r$(o,this._cellOccs[h]);this.replaceOccupants(c,e),n.push(c);continue}let l=this.usedCellsFlat[c];l!==-1&&l!==e?this.addSharedOccupant(c,e):this.usedCellsFlat[c]=e,n.push(c)}})}forEachCellNearCircle(e,t,n,o){let r=D3(Math.floor((e-n-this.boundsMinX)/this.highResolutionCellSize),0,this.fineCols-1),i=D3(Math.floor((e+n-this.boundsMinX)/this.highResolutionCellSize),0,this.fineCols-1),s=D3(Math.floor((t-n-this.boundsMinY)/this.highResolutionCellSize),0,this.fineRows-1),a=D3(Math.floor((t+n-this.boundsMinY)/this.highResolutionCellSize),0,this.fineRows-1);for(let c=0;c<this.regions.length;c++){let l=this.regions[c];if(l.rows===0||l.cols===0)continue;let h=Math.max(s,l.fineOriginRow),d=Math.min(a,l.fineOriginRow+l.fineRows-1),u=Math.max(r,l.fineOriginCol),_=Math.min(i,l.fineOriginCol+l.fineCols-1);if(h>d)continue;if(u>_)continue;let p=Math.floor((h-l.fineOriginRow)/l.cellScale),m=Math.floor((d-l.fineOriginRow)/l.cellScale),A=Math.floor((u-l.fineOriginCol)/l.cellScale),g=Math.floor((_-l.fineOriginCol)/l.cellScale);for(let f=p;f<=m;f++)for(let y=A;y<=g;y++)o(this.cellIdFor(l.id,f,y))}}ripTrace(e){for(;this.ripCount.length<=e;)this.ripCount.push(0);if(this.ripCount[e]++,this.totalRipEvents++,this.totalRipEvents>=this.MAX_RIPS)return this.error=`Convergence failure: exceeded MAX_RIPS ${this.MAX_RIPS}`,void(this.failed=!0);let t=this.getSolvedRoutesForConn(e);if(t.length>0)for(let o of t){for(let r=0;r<o.states.length;r++){let i=o.states[r]%this.planeSize;this.penalty2d[i]=this.penalty2d[i]+this.hyperParameters.ripTracePenalty}for(let r=0;r<o.viaCellIds.length;r++){let i=o.viaCellIds[r];this.penalty2d[i]=this.penalty2d[i]+this.hyperParameters.ripViaPenalty}}let n=this.usedIndicesByConn[e];if(n){for(let o=0;o<n.length;o++)this.removeOccupant(n[o],e);this.usedIndicesByConn[e]=void 0}if(t.length>0){this.solvedRoutes[e]=void 0;for(let o of t){let r=o.states[0],i=o.states[o.states.length-1],s=Math.floor(r/this.planeSize),a=Math.floor(i/this.planeSize);this.unsolvedSegs.push({connId:e,startZ:s,startCellId:r-s*this.planeSize,startPoint:o.startPoint,endZ:a,endCellId:i-a*this.planeSize,endPoint:o.endPoint,connectionAliases:o.connectionAliases})}}}flattenNeighborLists(e){let t=new Int32Array(e.length+1),n=0;for(let s=0;s<e.length;s++)t[s]=n,n+=e[s].length;t[e.length]=n;let o=new Int32Array(n),r=new Float32Array(n),i=0;for(let s=0;s<e.length;s++){let a=e[s];for(let c=0;c<a.length;c++){let l=a[c];o[i]=l.cellId,r[i]=l.cost,i++}}return{offset:t,ids:o,costs:r}}visualize(){let e=["red","blue","orange","green"],t=this.gridToBoundsTransform,n=[],o=[],r=[],i=[];i.push({center:{x:this.nodeWithPortPoints.center.x,y:this.nodeWithPortPoints.center.y},width:this.nodeWithPortPoints.width,height:this.nodeWithPortPoints.height,stroke:"gray"});let s=({route:c,connectionName:l,strokeWidth:h,strokeDash:d,labelPrefix:u})=>{if(c.length<2)return;let _=0;for(let m=1;m<c.length;m+=1){let A=c[m-1];c[m].z!==A.z&&(m-_>=2&&o.push({points:c.slice(_,m).map((g)=>({x:g.x,y:g.y})),strokeColor:e[A.z]??"rgba(128,128,128,0.75)",strokeWidth:h,strokeDash:d,label:`${u} ${l} z=${A.z}`}),_=m)}if(c.length-_<2)return;let p=c[_].z;o.push({points:c.slice(_).map((m)=>({x:m.x,y:m.y})),strokeColor:e[p]??"rgba(128,128,128,0.75)",strokeWidth:h,strokeDash:d,label:`${u} ${l} z=${p}`})};for(let c of this.obstacles)if(c.type!=="rect"){s({route:c.route,connectionName:c.connectionName,strokeWidth:c.traceThickness,strokeDash:[0.12,0.08],labelPrefix:"fixed obstacle"});for(let l of c.vias)r.push({center:{x:l.x,y:l.y},radius:c.viaDiameter/2,fill:"rgba(128,0,128,0.25)",stroke:"purple",label:`fixed obstacle ${c.connectionName} via`})}else i.push({center:c.center,width:c.width,height:c.height,fill:"rgba(128,0,128,0.12)",stroke:"purple",label:`fixed obstacle ${c.connectionName}`});if(this.showPenaltyMap&&this.penalty2d){let c=0;for(let l=0;l<this.penalty2d.length;l++)this.penalty2d[l]>c&&(c=this.penalty2d[l]);if(c>0)for(let l=0;l<this.planeSize;l++){let h=this.penalty2d[l];if(h<=0)continue;let d=yQ(t,{x:this.cellCenterX[l],y:this.cellCenterY[l]}),u=Math.min(0.6,h/c*0.6);i.push({center:d,width:this.cellWidth[l]*t.a,height:this.cellHeight[l]*t.e,fill:`rgba(255,165,0,${u.toFixed(3)})`})}}if(this.showUsedCellMap&&this.usedCellsFlat)for(let c=0;c<this.layers;c++){let l=c*this.planeSize;for(let h=0;h<this.planeSize;h++){if(this.usedCellsFlat[l+h]===-1)continue;let d=yQ(t,{x:this.cellCenterX[h],y:this.cellCenterY[h]});i.push({center:d,width:this.cellWidth[h]*t.a,height:this.cellHeight[h]*t.e,fill:"rgba(0,0,255,0.5)"})}}for(let c of this.nodeWithPortPoints.portPoints)n.push({x:c.x,y:c.y,color:e[c.z]??"gray",label:c.connectionName});let a=this.getOutput();for(let c of a)s({route:c.route,connectionName:c.connectionName,strokeWidth:this.traceThickness,labelPrefix:"B01 route"});for(let c of a)for(let l of c.vias)r.push({center:{x:l.x,y:l.y},radius:this.viaDiameter/2,fill:"rgba(0,0,0,0.3)",stroke:"black",label:`B01 route ${c.connectionName} via`});if(this.activeConnSeg&&this.visitedFlatStamp){let c=this.stamp;for(let l=0;l<this.layers;l++){let h=l*this.planeSize;for(let d=0;d<this.planeSize;d++){if(this.visitedFlatStamp[h+d]!==c)continue;let u=yQ(t,{x:this.cellCenterX[d],y:this.cellCenterY[d]});n.push({x:u.x,y:u.y,color:"rgba(0,0,255,0.2)"})}}}return{points:n,lines:o,circles:r,rects:i,coordinateSystem:"cartesian",title:`HighDensityB01 [${this.getSolvedRouteCount()} solved, ${this.unsolvedSegs?.length??0} remaining]`}}getOutput(){let e=this.gridToBoundsTransform,t=[];for(let n=0;n<this.solvedRoutes.length;n++){let o=this.getSolvedRoutesForConn(n);if(o.length!==0)for(let r of o){let i=Array.from(r.states,(a)=>{let c=Math.floor(a/this.planeSize),l=a-c*this.planeSize,h=yQ(e,{x:this.cellCenterX[l],y:this.cellCenterY[l]});return{x:h.x,y:h.y,z:this.layerToZ.get(c)??c}}),s=Array.from(r.viaCellIds,(a)=>yQ(e,{x:this.cellCenterX[a],y:this.cellCenterY[a]}));for(let a of r.connectionAliases){let c=(a.reversedFromCanonical?[...i].reverse():i).map((l)=>({...l}));c.length>0&&(c[0]={...a.startPoint},c.length>1&&(c[c.length-1]={...a.endPoint})),t.push({connectionName:a.connectionName,rootConnectionName:a.rootConnectionName,regionId:this.nodeWithPortPoints.capacityMeshNodeId,traceThickness:this.traceThickness,viaDiameter:this.viaDiameter,route:c,vias:s.map((l)=>({...l}))})}}}return t}getSolvedRoutesForConn(e){let t=this.solvedRoutes[e];return t?Array.isArray(t)?t:[t]:[]}getSolvedRouteCount(){let e=0;for(let t=0;t<this.solvedRoutes.length;t++)e+=this.getSolvedRoutesForConn(t).length;return e}computeGridToBoundsTransform(){let e=1/0,t=-1/0,n=1/0,o=-1/0;for(let h=0;h<this.planeSize;h++){let d=this.cellCenterX[h],u=this.cellCenterY[h];d<e&&(e=d),d>t&&(t=d),u<n&&(n=u),u>o&&(o=u)}let r=t-e,i=o-n,s=this.boundsMaxX-this.boundsMinX,a=this.boundsMaxY-this.boundsMinY,c=r>0?s/r:1,l=i>0?a/i:1;return{a:c,b:0,c:r>0?this.boundsMinX-c*e:(this.boundsMinX+this.boundsMaxX)/2-e,d:0,e:l,f:i>0?this.boundsMinY-l*n:(this.boundsMinY+this.boundsMaxY)/2-n}}},Pje=new WeakMap,CB=(e,{layerCount:t,allowBlindAndBuriedVias:n})=>{let o=`${t}:${n===!0}`,r=Pje.get(e)?.get(o);if(r)return r;let i=[],s=[];for(let l=1;l<e.route.length;l++){let h=e.route[l-1],d=e.route[l],u=Math.hypot(d.x-h.x,d.y-h.y),_=Math.max(h.traceThickness??e.traceThickness,d.traceThickness??e.traceThickness);if(h.z!==d.z&&h.toNextSegmentType==="through_obstacle"){let g=Math.min(h.z,d.z),f=Math.max(h.z,d.z);if(u<=0.000000001){let y=e.vias.some((x)=>Math.hypot(x.x-d.x,x.y-d.y)<=0.000000001);s.push({center:{x:d.x,y:d.y},minZ:g,maxZ:f,diameter:y?e.viaDiameter:_});continue}for(let y=g;y<=f;y++)i.push({start:{...h,z:y},end:{...d,z:y},z:y,width:_});continue}let p=h.z===d.z?void 0:Gan({hdRoute:e,start:h,end:d}),m=p==="start"?d.z:h.z;if(u>0.000000001&&i.push({start:h.z===m?h:{...h,z:m},end:d.z===m?d:{...d,z:m},z:m,width:_}),h.z===d.z)continue;let A=p==="start"?h:d;nd(h.z,t),nd(d.z,t),s.push({center:{x:A.x,y:A.y},minZ:n?Math.min(h.z,d.z):0,maxZ:n?Math.max(h.z,d.z):t-1,diameter:e.viaDiameter})}let a={wireSegments:i,viaSpans:s},c=Pje.get(e)??new Map;return c.set(o,a),Pje.set(e,c),a},qan=(e,t,n)=>{let o=e.end.x-e.start.x,r=e.end.y-e.start.y,i=Math.hypot(o,r),s={x:(e.start.x+e.end.x)/2,y:(e.start.y+e.end.y)/2};return Math.abs(o)<=0.000000001||Math.abs(r)<=0.000000001?[{center:s,width:Math.abs(o)>Math.abs(r)?i:e.width,height:Math.abs(o)>Math.abs(r)?e.width:i}]:oan({center:s,width:i,height:e.width,rotation:180*Math.atan2(r,o)/Math.PI},Math.max(n,Math.ceil(i/t)))},Jan=({fixedObstacleRoutes:e,layerCount:t,allowBlindAndBuriedVias:n})=>e.flatMap((o,r)=>{let i=[o.connectionName,o.rootConnectionName].filter((a)=>typeof a=="string"),s=CB(o,{layerCount:t,allowBlindAndBuriedVias:n});return[...s.wireSegments.flatMap((a,c)=>qan(a,0.75,2).map((l,h)=>({obstacleId:`pipeline9_fixed_obstacle_${r}_wire_${c}_${h}`,type:"rect",layers:[nd(a.z,t)],center:l.center,width:l.width,height:l.height,connectedTo:i}))),...s.viaSpans.map((a,c)=>({obstacleId:`pipeline9_fixed_obstacle_${r}_via_${c}`,type:"rect",layers:Array.from({length:a.maxZ-a.minZ+1},(l,h)=>nd(a.minZ+h,t)),center:a.center,width:a.diameter,height:a.diameter,connectedTo:i}))]}),Zan=(e,t,n)=>{let o=[e.connectionName,e.rootConnectionName].filter((i)=>typeof i=="string"),r=[t.connectionName,t.rootConnectionName].filter((i)=>typeof i=="string");return o.some((i)=>r.some((s)=>i===s||n.areIdsConnected(i,s)))},wGt=(e,t)=>e.minX<=t.maxX&&e.maxX>=t.minX&&e.minY<=t.maxY&&e.maxY>=t.minY,ecn=({left:e,right:t,clearance:n,leftBounds:o,layerCount:r,allowBlindAndBuriedVias:i})=>{let s={layerCount:r,allowBlindAndBuriedVias:i},a=CB(e,s),c=CB(t,s),l=o?a.wireSegments.filter((d)=>((u,_)=>{let p={minX:Math.min(u.start.x,u.end.x)-u.width/2,maxX:Math.max(u.start.x,u.end.x)+u.width/2,minY:Math.min(u.start.y,u.end.y)-u.width/2,maxY:Math.max(u.start.y,u.end.y)+u.width/2};return wGt(p,_)})(d,o)):a.wireSegments,h=o?a.viaSpans.filter((d)=>((u,_)=>{let p={minX:u.center.x-u.diameter/2,maxX:u.center.x+u.diameter/2,minY:u.center.y-u.diameter/2,maxY:u.center.y+u.diameter/2};return wGt(p,_)})(d,o)):a.viaSpans;for(let d of l){for(let u of c.wireSegments){if(d.z!==u.z)continue;let _=d.width/2+u.width/2+n;if(MV(d.start,d.end,u.start,u.end)<_)return!0}for(let u of c.viaSpans){if(d.z<u.minZ||d.z>u.maxZ)continue;let _=d.width/2+u.diameter/2+n;if(MV(d.start,d.end,u.center,u.center)<_)return!0}}for(let d of h){for(let u of c.wireSegments){if(u.z<d.minZ||u.z>d.maxZ)continue;let _=d.diameter/2+u.width/2+n;if(MV(d.center,d.center,u.start,u.end)<_)return!0}for(let u of c.viaSpans){if(d.minZ>u.maxZ||u.minZ>d.maxZ)continue;let _=d.diameter/2+u.diameter/2+n;if(Math.hypot(d.center.x-u.center.x,d.center.y-u.center.y)<_)return!0}}return!1},k6r=({routes:e,movablePreloadedConnectionNames:t,boardObstacles:n,connMap:o,layerCount:r,viaToPadClearance:i,allowBlindAndBuriedVias:s})=>e.some((a)=>{if(!t.has(a.connectionName))return!1;return CB(a,{layerCount:r,allowBlindAndBuriedVias:s}).viaSpans.some((c)=>n.some((l)=>{if((({obstacle:d,route:u,connMap:_})=>{if(_B(d,u,_))return!0;if(!u.rootConnectionName)return!1;let p=_.getNetConnectedToId(u.connectionName)??_.getNetConnectedToId(u.rootConnectionName)??(_.netMap[u.rootConnectionName]?u.rootConnectionName:void 0);return!!p&&d.connectedTo.some((m)=>(_.getNetConnectedToId(m)??(_.netMap[m]?m:void 0))===p)})({obstacle:l,route:a,connMap:o}))return!1;return!!((d,u)=>(d.__zLayers??d.zLayers)||d.layers.map((p)=>si(p,u)))(l,r).some((d)=>d>=c.minZ&&d<=c.maxZ)&&((d,u)=>{let _=-1*(u.ccwRotationDegrees??0)*Math.PI/180,p=d.x-u.center.x,m=d.y-u.center.y,A=p*Math.cos(_)-m*Math.sin(_),g=p*Math.sin(_)+m*Math.cos(_),f=Math.max(Math.abs(A)-u.width/2,0),y=Math.max(Math.abs(g)-u.height/2,0);return Math.hypot(f,y)})(c.center,l)<c.diameter/2+i}))}),tcn=class extends ei{params;highDensitySolver;forceImproveSolver;repairSolver;phase="route";constructor(e){super(),this.params=e,this.stats={preloadedViaCandidateRejectionCount:0,forceImproveCandidateRejectionCount:0,repairCandidateRejectionCount:0},this.highDensitySolver=new cY({nodePortPoints:[e.nodeWithPortPoints],colorMap:e.colorMap,connMap:e.connMap,viaDiameter:e.viaDiameter,traceWidth:e.traceWidth,obstacleMargin:e.obstacleMargin,effort:e.effort,nodePfById:e.nodePfById,obstacles:e.obstacles,layerCount:e.layerCount,useGrowShrinkHighDensityIntraNodeSolver:!0,preserveTerminalPcbPortIds:!1,growShrinkFallbackToInvalidGeometryOnFailure:!1,growShrinkSolutionValidator:e.boardObstacles&&e.movablePreloadedConnectionNames&&e.viaToPadClearance!==void 0?(t)=>this.validateCandidateRoutes(t):void 0}),this.activeSubSolver=this.highDensitySolver,this.MAX_ITERATIONS=1e8*e.effort}getSolverName(){return"Pipeline9RegionalFallbackSolver"}validateCandidateRoutes(e){let{boardObstacles:t,movablePreloadedConnectionNames:n,viaToPadClearance:o}=this.params;if(!t||!n||o===void 0)return!0;let r=k6r({routes:e,movablePreloadedConnectionNames:n,boardObstacles:t,connMap:this.params.connMap,layerCount:this.params.layerCount,allowBlindAndBuriedVias:this.params.allowBlindAndBuriedVias,viaToPadClearance:o});return r&&(this.stats.preloadedViaCandidateRejectionCount=Number(this.stats.preloadedViaCandidateRejectionCount??0)+1),!r}_step(){if(this.phase==="route"){if(this.highDensitySolver.step(),this.highDensitySolver.failed)return this.error=this.highDensitySolver.error,void(this.failed=!0);if(!this.highDensitySolver.solved)return;let e=ZZe(this.highDensitySolver.routes);return this.validateCandidateRoutes(e)?(this.forceImproveSolver=new $le({nodeWithPortPoints:[this.params.nodeWithPortPoints],hdRoutes:e,colorMap:this.params.colorMap,totalStepsPerNode:Math.max(12,Math.round(20*this.params.effort)),nodeAssignmentMargin:this.params.obstacleMargin}),this.activeSubSolver=this.forceImproveSolver,void(this.phase="improve")):(this.error="Pipeline9 regional route output failed its candidate validator",void(this.failed=!0))}if(this.phase==="improve"){if(this.forceImproveSolver.step(),this.forceImproveSolver.failed)return this.error=this.forceImproveSolver.error,void(this.failed=!0);if(!this.forceImproveSolver.solved)return;let e=this.forceImproveSolver.getOutput();return this.validateCandidateRoutes(e)?(this.repairSolver=new qle({nodeWithPortPoints:[this.params.nodeWithPortPoints],hdRoutes:e,obstacles:this.params.obstacles,colorMap:this.params.colorMap,repairMargin:this.params.obstacleMargin,minimumTraceWidth:this.params.traceWidth,connMap:this.params.connMap}),this.activeSubSolver=this.repairSolver,void(this.phase="repair")):(this.stats.forceImproveCandidateRejectionCount=Number(this.stats.forceImproveCandidateRejectionCount??0)+1,this.error="Pipeline9 regional force-improve output failed its candidate validator",void(this.failed=!0))}if(this.phase==="repair"){if(this.repairSolver.step(),this.repairSolver.failed)return this.error=this.repairSolver.error,void(this.failed=!0);if(!this.repairSolver.solved)return;let e=this.repairSolver.getOutput();return this.validateCandidateRoutes(e)?(this.activeSubSolver=null,this.phase="done",void(this.solved=!0)):(this.stats.repairCandidateRejectionCount=Number(this.stats.repairCandidateRejectionCount??0)+1,this.error="Pipeline9 regional repair output failed its candidate validator",void(this.failed=!0))}}getOutput(){return this.repairSolver?.getOutput()??this.forceImproveSolver?.getOutput()??this.highDensitySolver.routes}visualize(){return this.repairSolver?.visualize()??this.forceImproveSolver?.visualize()??this.highDensitySolver.visualize()}},BGt=(e,t)=>({minX:e.center.x-e.width/2-t,maxX:e.center.x+e.width/2+t,minY:e.center.y-e.height/2-t,maxY:e.center.y+e.height/2+t}),L6r=(e,t,n,o,r)=>{let i=new Set(t.availableZ??t.portPoints.map((a)=>a.z)),s=CB(e,r);return s.wireSegments.some((a)=>i.has(a.z)&&((c,l,h,d)=>Math.min(c.x,l.x)-h<=d.maxX&&Math.max(c.x,l.x)+h>=d.minX&&Math.min(c.y,l.y)-h<=d.maxY&&Math.max(c.y,l.y)+h>=d.minY)(a.start,a.end,a.width/2+o,n))||s.viaSpans.some((a)=>[...i].some((c)=>c>=a.minZ&&c<=a.maxZ)&&((c,l,h)=>{let d=Math.max(h.minX-c.x,0,c.x-h.maxX),u=Math.max(h.minY-c.y,0,c.y-h.maxY);return d*d+u*u<=l*l})(a.center,a.diameter/2+o,n))},Lce=(e,t)=>{let n=(o)=>({...o,rootConnectionName:t.getNetConnectedToId(o.rootConnectionName??o.connectionName)??o.rootConnectionName??o.connectionName});return{...e,portPoints:e.portPoints.map(n),portPointsInPairs:e.portPointsInPairs?.map(([o,r])=>[n(o),n(r)])}},H6r=({nodeWithPortPoints:e,connMap:t,colorMap:n,viaDiameter:o,traceWidth:r,obstacleMargin:i,effort:s,nodePfById:a,obstacles:c,boardGeometry:l,layerCount:h})=>new cY({nodePortPoints:[Lce(e,t)],colorMap:n,connMap:t,viaDiameter:o,traceWidth:r,obstacleMargin:i,effort:s,nodePfById:a,obstacles:c,layerCount:h,useGrowShrinkHighDensityIntraNodeSolver:!0,enableNegotiatedSearch:!0,gridSearchSegmentWork:500,gridSearchWorkScale:h>2?0.25:1,rejectOverlappingTerminals:h>2,boardGeometry:l,preserveTerminalPcbPortIds:!1,growShrinkFallbackToInvalidGeometryOnFailure:!1,captureSearchDebug:!1}),tet=class extends ei{fixedHdRoutes;connMap;colorMap;obstacles;boardGeometry;layerCount;allowBlindAndBuriedVias;viaDiameter;traceWidth;obstacleMargin;viaToPadClearance;effort;nodePfById;preserveTerminalPcbPortIds;includeBoardObstacles;enableRegionalFallback;maxB01Rips;routes=[];failedSolvers=[];unsolvedNodePortPoints;fixedRouteReplacements=new Map;removedFixedRouteConnectionNames=new Set;preloadedTraceMutationMasks=new Map;activeRegularSolver=null;activeB01Solver=null;activeFallbackSolver=null;activeFallbackFixedRouteSections=new Map;activeFallbackFixedObstacleRoutes=[];activeFallbackPromotedFixedRouteConnectionNames=new Set;activeFallbackReason=null;activeNode=null;constructor(e){super(),this.fixedHdRoutes=e.fixedHdRoutes,this.connMap=e.connMap,this.colorMap=e.colorMap??{},this.obstacles=e.obstacles,this.boardGeometry=e.boardGeometry,this.layerCount=e.layerCount,this.allowBlindAndBuriedVias=e.allowBlindAndBuriedVias??!1,this.viaDiameter=e.viaDiameter,this.traceWidth=e.traceWidth,this.obstacleMargin=e.obstacleMargin,this.viaToPadClearance=e.viaToPadClearance,this.effort=e.effort,this.nodePfById=e.nodePfById instanceof Map?new Map(e.nodePfById):new Map(Object.entries(e.nodePfById??{})),this.preserveTerminalPcbPortIds=e.preserveTerminalPcbPortIds??!1,this.includeBoardObstacles=e.includeBoardObstacles??!1,this.enableRegionalFallback=e.enableRegionalFallback??!0,this.maxB01Rips=e.maxB01Rips,this.unsolvedNodePortPoints=[...e.nodePortPoints],this.MAX_ITERATIONS=1e8*this.effort,this.stats={nodeCount:e.nodePortPoints.length,solvedNodeCount:0,fixedObstacleCount:e.fixedHdRoutes.length,fixedObstacleUses:0,boardObstacleUses:0,fallbackNodeCount:0,regularNodeCount:0,b01NodeCount:0,reroutedFixedRouteCount:0,reroutedFixedRouteSectionCount:0,promotedFallbackAttemptCount:0,promotedFixedRouteCount:0,regionalPreloadedViaCandidateRejectionCount:0,regionalForceImproveCandidateRejectionCount:0,regionalRepairCandidateRejectionCount:0}}getSolverName(){return"Pipeline9HighDensitySolver"}getUpdatedFixedHdRoutes(){return this.fixedHdRoutes.flatMap((e)=>this.removedFixedRouteConnectionNames.has(e.connectionName)?[]:[this.fixedRouteReplacements.get(e.connectionName)??e])}finishActiveNode(e){let t=this.activeNode?((n,o)=>n.map((r)=>({...r,rootConnectionName:o.portPoints.find((i)=>i.connectionName===r.connectionName)?.rootConnectionName??r.rootConnectionName})))(e,this.activeNode):e;this.routes.push(...this.preserveTerminalPcbPortIds&&this.activeNode?((n,o)=>{let r=o.portPoints.filter((i)=>i.pcb_port_id!==void 0);return n.map((i)=>{let s=i.route[0],a=i.route.at(-1),c=r.find((h)=>s!==void 0&&h.connectionName===i.connectionName&&h.x===s.x&&h.y===s.y&&h.z===s.z),l=r.find((h)=>a!==void 0&&h.connectionName===i.connectionName&&h.x===a.x&&h.y===a.y&&h.z===a.z);return{...i,startPcbPortId:c?.pcb_port_id,endPcbPortId:l?.pcb_port_id}})})(t,this.activeNode):t),this.stats.solvedNodeCount=Number(this.stats.solvedNodeCount??0)+1,this.activeB01Solver=null,this.activeRegularSolver=null,this.activeFallbackSolver=null,this.activeFallbackFixedRouteSections.clear(),this.activeFallbackFixedObstacleRoutes=[],this.activeFallbackPromotedFixedRouteConnectionNames.clear(),this.activeFallbackReason=null,this.activeNode=null}startRegularSolver(e){this.activeNode=e,this.activeRegularSolver=H6r({nodeWithPortPoints:e,colorMap:this.colorMap,connMap:this.connMap,viaDiameter:this.viaDiameter,traceWidth:this.traceWidth,obstacleMargin:this.obstacleMargin,effort:this.effort,nodePfById:this.nodePfById,obstacles:this.obstacles,boardGeometry:this.boardGeometry,layerCount:this.layerCount}),this.stats.regularNodeCount=Number(this.stats.regularNodeCount??0)+1}startRegionalFallback(e=new Set){if(!this.activeNode)throw Error("Pipeline9 cannot start a regional fallback without an active node");let t={...Lce(this.activeNode,this.connMap),availableZ:Array.from({length:this.layerCount},(s,a)=>a)},n=Ele(t,this.getUpdatedFixedHdRoutes(),e),o=new Set([...n.fixedRouteSectionsByConnectionName.values()].flatMap((s)=>s.sourceRoutes.map((a)=>a.connectionName)));for(let s of e)if(!o.has(s))throw Error(`Pipeline9 could not promote fixed route "${s}" into the active regional fallback`);let r=[...e].filter((s)=>!this.activeFallbackPromotedFixedRouteConnectionNames.has(s)).length;this.activeFallbackFixedRouteSections=n.fixedRouteSectionsByConnectionName,this.activeFallbackFixedObstacleRoutes=n.fixedObstacleRoutes,this.activeFallbackPromotedFixedRouteConnectionNames=new Set(e);let i=Jan({fixedObstacleRoutes:this.activeFallbackFixedObstacleRoutes,layerCount:this.layerCount,allowBlindAndBuriedVias:this.allowBlindAndBuriedVias});this.activeFallbackSolver=new tcn({nodeWithPortPoints:n.nodeWithPortPoints,colorMap:this.colorMap,connMap:this.connMap,viaDiameter:this.viaDiameter,traceWidth:this.traceWidth,obstacleMargin:this.obstacleMargin,effort:this.effort,nodePfById:this.nodePfById,obstacles:[...this.obstacles,...i],boardObstacles:this.obstacles,movablePreloadedConnectionNames:o,viaToPadClearance:this.viaToPadClearance,layerCount:this.layerCount,allowBlindAndBuriedVias:this.allowBlindAndBuriedVias}),e.size===0?this.stats.fallbackNodeCount=Number(this.stats.fallbackNodeCount??0)+1:(this.stats.promotedFallbackAttemptCount=Number(this.stats.promotedFallbackAttemptCount??0)+1,this.stats.promotedFixedRouteCount=Number(this.stats.promotedFixedRouteCount??0)+r)}finishRegionalFallback(){if(!this.activeFallbackSolver)return;if(!this.activeNode)throw Error("Pipeline9 cannot finish a regional fallback without an active node");this.recordRegionalCandidateRejections();let e=[],t=new Map;for(let u of this.activeFallbackSolver.getOutput()){if(!this.activeFallbackFixedRouteSections.has(u.connectionName)){e.push(u);continue}let _=t.get(u.connectionName)??[];_.push(u),t.set(u.connectionName,_)}let n=[],o=[];for(let[u,_]of this.activeFallbackFixedRouteSections){let p=t.get(u)??[];if(p.length===0){o.push(_);continue}if(p.length>1)return this.error=`Pipeline9 regional fallback expected one replacement for fixed route "${u}", got ${p.length}`,void(this.failed=!0);let m=Wan({section:_,replacement:p[0],sourceMutationMasks:this.preloadedTraceMutationMasks,replacementIsMutated:!0});n.push({connectionName:u,section:_,replacement:m.route,mutatedSegments:m.mutatedSegments,replacementProducedSegment:m.replacementProducedSegment})}let r=[...e,...n.map(({replacement:u})=>u)],i=[...this.activeFallbackFixedObstacleRoutes,...o.flatMap((u)=>u.sourceRoutes)],s=BGt(this.activeNode,this.obstacleMargin+Math.max(this.traceWidth,this.viaDiameter)/2),a=new Map;for(let u of r)for(let _ of i)Zan(u,_,this.connMap)||ecn({left:u,right:_,clearance:this.obstacleMargin,leftBounds:s,layerCount:this.layerCount,allowBlindAndBuriedVias:this.allowBlindAndBuriedVias})&&a.set(_.connectionName,_);if(a.size>0){let u=[...a.keys()],_=[...a].flatMap(([m,A])=>A.isThroughObstacle===!0?[]:[m]),p=new Set(this.activeFallbackPromotedFixedRouteConnectionNames);for(let m of _)p.add(m);if(p.size===this.activeFallbackPromotedFixedRouteConnectionNames.size){let m=[...a].flatMap(([A,g])=>g.isThroughObstacle===!0?[A]:[]);return this.error=m.length>0?`Pipeline9 regional fallback conflicts with immutable through-obstacle route(s): ${m.join(", ")}`:`Pipeline9 promoted regional fallback could not resolve immutable fixed route conflict(s): ${u.join(", ")}`,void(this.failed=!0)}return void this.startRegionalFallback(p)}let c=new Map;for(let{section:u,replacementProducedSegment:_}of n)if(_)for(let p of u.sourceRoutes){let{preloadedRoutePositionStart:m,preloadedRoutePositionEnd:A}=p;if(m===void 0!=(A===void 0))throw Error(`Pipeline9 fixed route "${p.connectionName}" has incomplete route-position metadata`);let g=Math.min(m??p.preloadedRouteIndex,A??p.preloadedRouteIndex),f=Math.max(m??p.preloadedRouteIndex,A??p.preloadedRouteIndex),y=c.get(p.preloadedTraceIndex);c.set(p.preloadedTraceIndex,{start:Math.min(y?.start??g,g),end:Math.max(y?.end??f,f)})}for(let{connectionName:u,section:_,replacement:p,mutatedSegments:m}of n){this.fixedRouteReplacements.set(u,p),this.preloadedTraceMutationMasks.set(u,m);for(let A of _.sourceRoutes.slice(1))this.removedFixedRouteConnectionNames.add(A.connectionName),this.preloadedTraceMutationMasks.delete(A.connectionName)}let l=Ele({...Lce(this.activeNode,this.connMap),portPoints:[],portPointsInPairs:[],availableZ:Array.from({length:this.layerCount},(u,_)=>_)},this.getUpdatedFixedHdRoutes()),h=new Set;for(let u of l.fixedRouteSectionsByConnectionName.values()){let _=u.sourceRoutes[0];if(!_)continue;let p=c.get(_.preloadedTraceIndex);if(p)for(let[m,A]of u.sourceRoutes.entries()){let g=A.preloadedRoutePositionStart??A.preloadedRouteIndex,f=A.preloadedRoutePositionEnd??A.preloadedRouteIndex,y={start:Math.min(g,f),end:Math.max(g,f)},x=y.start===y.end,C=p.start===p.end;if(!(x||C?y.start<=p.end&&p.start<=y.end:y.start<p.end&&p.start<y.end))continue;h.add(_.preloadedTraceIndex);let b=[...this.preloadedTraceMutationMasks.get(A.connectionName)??Array(A.route.length-1).fill(!1)];if(b.length!==A.route.length-1)throw Error(`Pipeline9 fixed route mutation mask for "${A.connectionName}" has ${b.length} segments, expected ${A.route.length-1}`);let I=m===0?u.start.segmentIndex:0,v=m===u.sourceRoutes.length-1?u.end.segmentIndex:A.route.length-2;for(let P=I;P<=v;P++)b[P]=!0;this.preloadedTraceMutationMasks.set(A.connectionName,b)}}for(let u of c.keys())if(!h.has(u))throw Error(`Pipeline9 could not capture accepted mutation provenance for trace ${u}`);let d=n.reduce((u,{section:_})=>u+_.sourceRoutes.length,0);this.stats.reroutedFixedRouteCount=Number(this.stats.reroutedFixedRouteCount??0)+d,this.stats.reroutedFixedRouteSectionCount=Number(this.stats.reroutedFixedRouteSectionCount??0)+n.length,this.finishActiveNode(e)}recordRegionalCandidateRejections(){if(!this.activeFallbackSolver)return;let e=this.activeFallbackSolver.stats;this.stats.regionalPreloadedViaCandidateRejectionCount=Number(this.stats.regionalPreloadedViaCandidateRejectionCount??0)+Number(e.preloadedViaCandidateRejectionCount??0),this.stats.regionalForceImproveCandidateRejectionCount=Number(this.stats.regionalForceImproveCandidateRejectionCount??0)+Number(e.forceImproveCandidateRejectionCount??0),this.stats.regionalRepairCandidateRejectionCount=Number(this.stats.regionalRepairCandidateRejectionCount??0)+Number(e.repairCandidateRejectionCount??0)}finishRegularSolverFailure(e){if(this.activeFallbackReason=`regular high-density routing failed: ${e}`,this.activeRegularSolver=null,!this.enableRegionalFallback)return this.error=`Pipeline9 ${this.activeFallbackReason}`,this.failed=!0,void(this.activeNode=null);this.startRegionalFallback()}_step(){this.stepNodeRouting(),this.activeSubSolver=this.activeFallbackSolver??this.activeRegularSolver??this.activeB01Solver}computeProgress(){if(this.solved)return 1;let e=Number(this.stats.nodeCount);if(e===0)return 0;let t=Math.max(0,Math.min(1,this.activeSubSolver?.progress??0));return Math.max(this.progress,(Number(this.stats.solvedNodeCount)+t)/e)}stepNodeRouting(){if(this.activeFallbackSolver){if(this.activeFallbackSolver.step(),this.activeFallbackSolver.failed)return this.recordRegionalCandidateRejections(),this.error=[`Pipeline9 primary high-density routing failed: ${this.activeFallbackReason??"unknown error"}`,`regional fallback failed: ${this.activeFallbackSolver.error??"unknown error"}`].join("; "),this.failed=!0,this.activeFallbackSolver=null,this.activeFallbackFixedRouteSections.clear(),this.activeFallbackFixedObstacleRoutes=[],this.activeFallbackPromotedFixedRouteConnectionNames.clear(),void(this.activeNode=null);if(!this.activeFallbackSolver.solved)return;return void this.finishRegionalFallback()}if(this.activeRegularSolver){if(this.activeRegularSolver.step(),this.activeRegularSolver.failed)return void this.finishRegularSolverFailure(this.activeRegularSolver.error??"unknown error");if(!this.activeRegularSolver.solved)return;return void this.finishActiveNode(this.activeRegularSolver.routes)}if(this.activeB01Solver){if(this.activeB01Solver.step(),this.activeB01Solver.failed)return this.failedSolvers.push(this.activeB01Solver),this.activeFallbackReason=`B01 failed: ${this.activeB01Solver.error??"unknown error"}`,this.activeB01Solver=null,this.enableRegionalFallback?void this.startRegionalFallback():(this.error=`Pipeline9 ${this.activeFallbackReason}`,this.failed=!0,void(this.activeNode=null));if(!this.activeB01Solver.solved)return;return void this.finishActiveNode(this.activeB01Solver.getOutput())}let e=this.unsolvedNodePortPoints.pop();if(!e)return void(this.solved=!0);let t=BGt(e,this.obstacleMargin),n=Math.max(this.traceWidth,this.viaDiameter)/2,o=this.getUpdatedFixedHdRoutes().filter((s)=>L6r(s,e,t,n,this)).flatMap((s)=>((a,c,l)=>{let h=new Set(c.availableZ??c.portPoints.map((p)=>p.z));if(h.size===0)throw Error(`Pipeline9 B01 node "${c.capacityMeshNodeId}" has no available layers`);let d={type:"route",connectionName:a.connectionName,rootConnectionName:a.rootConnectionName,traceThickness:a.traceThickness,viaDiameter:a.viaDiameter},u=[],_=CB(a,l);for(let p of _.wireSegments)h.has(p.z)&&u.push({...d,traceThickness:p.width,route:[p.start,p.end],vias:[]});for(let p of _.viaSpans)[...h].some((m)=>m>=p.minZ&&m<=p.maxZ)&&u.push({...d,viaDiameter:p.diameter,route:[{...p.center,z:p.minZ},{...p.center,z:p.maxZ}],vias:[{...p.center,zStart:p.minZ,zEnd:p.maxZ}]});return u})(s,e,this));if(this.stats.fixedObstacleUses=Number(this.stats.fixedObstacleUses??0)+o.length,o.length===0)return void this.startRegularSolver(e);let r=(this.includeBoardObstacles?this.obstacles:[]).filter((s)=>((a,c)=>{let l=(a.ccwRotationDegrees??0)*Math.PI/180,h=Math.abs(Math.cos(l)),d=Math.abs(Math.sin(l)),u=a.width/2*h+a.height/2*d,_=a.width/2*d+a.height/2*h;return a.center.x-u<=c.maxX&&a.center.x+u>=c.minX&&a.center.y-_<=c.maxY&&a.center.y+_>=c.minY})(s,t)).map((s)=>(({obstacle:a,node:c,connMap:l,layerCount:h})=>{let d=new Set(c.availableZ??c.portPoints.map((p)=>p.z)),u=(a.zLayers??a.layers.map((p)=>si(p,h))).filter((p)=>d.has(p));if(u.length===0)return;let _=a.connectedTo[0]??a.obstacleId??`pipeline9_obstacle_${a.center.x}_${a.center.y}`;return{type:"rect",connectionName:_,rootConnectionName:l.getNetConnectedToId(_)??_,center:a.center,width:a.width,height:a.height,ccwRotationDegrees:a.ccwRotationDegrees,zLayers:u}})({obstacle:s,node:e,connMap:this.connMap,layerCount:this.layerCount})).filter((s)=>s!==void 0);if(this.stats.boardObstacleUses=Number(this.stats.boardObstacleUses??0)+r.length,this.activeNode=e,e.width>15||e.height>15)return this.activeFallbackReason=`B01 node "${e.capacityMeshNodeId}" exceeds the 15x15mm routing limit (${e.width}x${e.height}mm)`,void this.startRegionalFallback();let i=Lce(e,this.connMap);this.stats.b01NodeCount=Number(this.stats.b01NodeCount??0)+1,this.activeB01Solver=new Q6r({...w6r,nodeWithPortPoints:i,obstacles:[...o,...r],viaDiameter:this.viaDiameter,viaMinDistFromBorder:this.viaDiameter/2,traceThickness:this.traceWidth,traceMargin:this.obstacleMargin,obstacleClearanceMargin:0.15,effort:this.effort}),this.maxB01Rips!==void 0&&(this.activeB01Solver.MAX_RIPS=this.maxB01Rips)}visualize(){return this.activeFallbackSolver?.visualize()??this.activeRegularSolver?.visualize()??this.activeB01Solver?.visualize()??{lines:this.routes.flatMap((e)=>e.route.slice(0,-1).map((t,n)=>({points:[t,e.route[n+1]],strokeWidth:e.traceThickness,layer:`z${t.z}`,label:e.connectionName}))),points:[],rects:[],circles:[]}}},uV=(e,t)=>{let n=e({hdRoutes:t,traces:[]});return Array.isArray(n)?n:n.errorsWithCenters??n.errors},ncn=(e)=>{let t=typeof e.pcb_trace_id=="string"?e.pcb_trace_id:void 0,n=Array.isArray(e.pcb_trace_ids)?e.pcb_trace_ids.filter((s)=>typeof s=="string"):[],o=[...typeof e.pcb_via_id=="string"?[e.pcb_via_id]:[],...Array.isArray(e.pcb_via_ids)?e.pcb_via_ids:[]].filter((s)=>typeof s=="string"),r=t?`overlap_${t}_`:void 0,i=r&&typeof e.pcb_trace_error_id=="string"&&e.pcb_trace_error_id.startsWith(r)?e.pcb_trace_error_id.slice(r.length):void 0;if(n.length>0){let s=t&&!n.includes(t)?[t,...n]:[...n];return s.length<2&&i&&!o.includes(i)&&s.push(i),s}return[t,i].filter((s)=>typeof s=="string"&&!o.includes(s))},F6r=(e)=>ncn(e).filter((t,n,o)=>o.indexOf(t)===n),TGt=(e)=>e.reduce((t,n)=>{if(typeof n.actual_clearance=="number"&&typeof n.minimum_clearance=="number")return t+Math.max(0,n.minimum_clearance-n.actual_clearance);let o=(typeof n.message=="string"?n.message:"").match(/gap: (-?\d+(?:\.\d+)?)mm/);return o?t+Math.max(0,0.1-Number.parseFloat(o[1])):t+1},0),yce=(e,t)=>e.length<t.length||e.length===t.length&&TGt(e)<TGt(t)-0.000000001,Mle=({routes:e,newConnections:t,syntheticConnectionNames:n})=>{let o=new Set([...t.map((s)=>s.name),...n]),r=new Map,i=new Map;for(let s=0;s<e.length;s++){let a=e[s];if(!o.has(a.connectionName))continue;let c=r.get(a.connectionName)??0;r.set(a.connectionName,c+1),i.set(`${a.connectionName}_${c}`,s)}return i},hbe=0.01,z6r=[0.03,0.1,0.25],DGt=(e)=>{let t=0;for(let n of e){if(typeof n.actual_clearance!="number"||!Number.isFinite(n.actual_clearance)||typeof n.minimum_clearance!="number"||!Number.isFinite(n.minimum_clearance))return;if(t+=Math.max(0,n.minimum_clearance-n.actual_clearance),!Number.isFinite(t))return}return t},Eje=({errors:e,errorsWithCenters:t,routeIndexByTraceId:n,padPositionById:o})=>{let r=[],i=0;for(let s of e){let a=s.type==="pcb_via_trace_clearance_error",c=s.type==="pcb_pad_trace_clearance_error";if(!a&&!c||typeof s.pcb_trace_id!="string"||!n.has(s.pcb_trace_id)||typeof s.actual_clearance!="number"||!Number.isFinite(s.actual_clearance)||typeof s.minimum_clearance!="number"||!Number.isFinite(s.minimum_clearance))return;let l=F6r(s);if(a&&l.length<2||l.some((_)=>!n.has(_)))return;let h=t.find((_)=>_.type===s.type&&_.pcb_trace_id===s.pcb_trace_id&&_.pcb_pad_id===s.pcb_pad_id&&_.pcb_via_id===s.pcb_via_id),d=c?typeof s.pcb_pad_id=="string"?o.get(s.pcb_pad_id):void 0:h?.center??s.center;if(!d||typeof d!="object")return;if(!(("x"in d)&&("y"in d)&&typeof d.x=="number"&&Number.isFinite(d.x)&&typeof d.y=="number"&&Number.isFinite(d.y)))return;let u={...s,pcb_trace_id:s.pcb_trace_id,actual_clearance:s.actual_clearance,minimum_clearance:s.minimum_clearance,center:{x:d.x,y:d.y}};if(a){if(typeof s.pcb_via_id!="string")return;r.push({...u,type:"pcb_via_trace_clearance_error",pcb_via_id:s.pcb_via_id,pcb_pad_id:void 0})}else{if(typeof s.pcb_pad_id!="string")return;r.push({...u,type:"pcb_pad_trace_clearance_error",pcb_pad_id:s.pcb_pad_id,pcb_via_id:void 0})}if(i+=Math.max(0,s.minimum_clearance-s.actual_clearance),!Number.isFinite(i))return}return{errors:r,deficit:i}},net=(e)=>((t)=>{let n=typeof t.pcb_trace_id=="string"?t.pcb_trace_id:void 0,o=Array.isArray(t.pcb_trace_ids)?t.pcb_trace_ids.filter((a)=>typeof a=="string"):[],r=[...typeof t.pcb_via_id=="string"?[t.pcb_via_id]:[],...Array.isArray(t.pcb_via_ids)?t.pcb_via_ids:[]].filter((a)=>typeof a=="string"),i=n?`overlap_${n}_`:void 0,s=i&&typeof t.pcb_trace_error_id=="string"&&t.pcb_trace_error_id.startsWith(i)?t.pcb_trace_error_id.slice(i.length):void 0;if(o.length>0){let a=n&&!o.includes(n)?[n,...o]:[...o];return a.length<2&&s&&!r.includes(s)&&a.push(s),a}return[n,s].filter((a)=>typeof a=="string"&&!r.includes(a))})(e).filter((t,n,o)=>o.indexOf(t)===n),O6r=(e,t)=>{let n=[...new Set(t.flatMap(net))];return e.map((o)=>{if(o.jumpers?.length||!n.some((i)=>i===o.connectionName||i.startsWith(`${o.connectionName}_`)))return o;let r=o.route.flatMap((i,s)=>{let a=o.route[s+1];if(!a||i.z!==a.z||i.toNextSegmentType||i.insideJumperPad||a.insideJumperPad||(i.traceThickness??o.traceThickness)!==(a.traceThickness??o.traceThickness))return[i];let c=Math.min(32,Math.ceil(((l,h)=>{let d=Math.max(Math.abs(l),Math.abs(h));if(d===0||d===Number.POSITIVE_INFINITY)return d;let u=l/d,_=h/d;return d*Math.sqrt(u*u+_*_)})(a.x-i.x,a.y-i.y)/0.25));return[i,...Array.from({length:Math.max(0,c-1)},(l,h)=>({x:i.x+(a.x-i.x)*(h+1)/c,y:i.y+(a.y-i.y)*(h+1)/c,z:i.z,traceThickness:i.traceThickness}))]});return r.length===o.route.length?o:{...o,route:r}})},aV=class extends ei{params;state={phase:"initialize"};constructor(e){super(),this.params=e}_step(){let e=this.state,t=this.params;if(e.phase==="initialize"){let l=t.drcEvaluator({traces:[],routes:t.routes,hdRoutes:t.routes}),h=Array.isArray(l)?l:l.errors;if(h.length===0)return this.state={phase:"finished",output:t.routes},void(this.solved=!0);let d={...oP(t.originalSrj),traces:void 0},u=Q$(t.routes),_=t.subdivideSegments?O6r(u,h):u,p=new qgr({srj:d,routes:_,bounds:d.bounds,boundaryMargin:0,boardEdgeClearance:t.originalSrj.minBoardEdgeClearance??0,lockedPointIndices:_.map((m)=>m.route.map(()=>!1)),allowViaMovement:!t.allowPartialRepair,traceClearance:(t.originalSrj.minTraceToPadEdgeClearance??WQ.traceClearance)+(t.allowPartialRepair||t.usePrecisionMargin?hbe:0),viaClearance:(t.originalSrj.minPadEdgeToPadEdgeClearance??WQ.viaClearance)+(t.usePrecisionMargin?hbe:0)});return this.MAX_ITERATIONS=p.MAX_ITERATIONS+4,this.activeSubSolver=p,void(this.state={phase:"relax",context:{srj:d,errors:h,originalCanonicalRoutes:u,canonicalRoutes:_},solver:p})}if(e.phase==="relax"){if(e.solver.step(),this.MAX_ITERATIONS=e.solver.MAX_ITERATIONS+4,e.solver.failed)throw Error(`Clearance relaxation failed: ${e.solver.error}`);return void(e.solver.solved&&(this.activeSubSolver=null,this.state={phase:"select",context:e.context,candidate:e.solver.getOutput()}))}if(e.phase==="finished")throw Error("Clearance projection stepped after completion");let{srj:n,errors:o,originalCanonicalRoutes:r,canonicalRoutes:i}=e.context;if(e.phase==="select"){let l=e.candidate;return t.allowPartialRepair&&(l=(({srj:h,routes:d,proposedRoutes:u})=>{if(d.length!==u.length)throw Error("Clearance projection changed the route count");if(h.allowBlindAndBuriedVias||d.some((M)=>M.jumpers?.length||M.route.some((B)=>B.toNextSegmentType||B.insideJumperPad)))return d;let{holeDiameter:_}=rm(h),p=(M,B)=>({type:"pcb_trace",pcb_trace_id:`projection_${B}`,connection_name:M.rootConnectionName??M.connectionName,route:k3(M,h.layerCount,{defaultViaHoleDiameter:_})}),m=d.map(p),A={...h,minBoardEdgeClearance:h.minBoardEdgeClearance??0,traces:m},g=new xB(A),f=new Set(g.canonicalize([...(h.differentialPairs??[]).flatMap((M)=>M.connectionNames),...(h.buses??[]).flatMap((M)=>M.connectionNames)])),y=[...d],x=[];for(let[M,B]of u.entries()){let T=d[M];if(B.route.length!==T.route.length)throw Error("Partial clearance projection changed routing topology");let N=[m[M].pcb_trace_id];if(!g.canonicalize(N).some((D)=>f.has(D))){y[M]={...T,route:[...B.route]};for(let D=0;D<B.route.length;D++)B.route[D].x===T.route[D].x&&B.route[D].y===T.route[D].y||x.push({routeIndex:M,pointIndex:D})}}let C=new c6(A,y.map(p),void 0,[],g),b=({routeIndex:M,pointIndex:B})=>{let T=y[M];for(let N=Math.max(1,B);N<=Math.min(B+1,T.route.length-1);N++){let D=T.route[N-1],L=T.route[N];if(D.z!==L.z)throw Error("Partial clearance projection moved a layer transition");if(C.collides({start:D,end:L,layer:nd(D.z,h.layerCount),width:Math.max(D.traceThickness??T.traceThickness,L.traceThickness??T.traceThickness),connectionNames:[m[M].pcb_trace_id]}))return!1}return!0},I=x;for(;I.length>0;){let M=I.filter((T)=>!b(T));if(M.length===0)break;for(let{routeIndex:T,pointIndex:N}of M)y[T].route[N]=d[T].route[N];let B=new Set(M);I=I.filter((T)=>!B.has(T)),C=new c6(A,y.map(p),void 0,[],g)}let v=new Set(I);for(let M=0;M<x.length;M++){let B=x[M];if(v.has(B))continue;let T=[B];for(;M+1<x.length;){let N=x[M+1];if(v.has(N)||N.routeIndex!==B.routeIndex||N.pointIndex!==x[M].pointIndex+1)break;T.push(N),M++}for(let{routeIndex:N,pointIndex:D}of T)y[N].route[D]=u[N].route[D];for(;T.length>0;){let N=T.filter((L)=>!b(L));if(N.length===0)break;for(let{routeIndex:L,pointIndex:H}of N)y[L].route[H]=d[L].route[H];let D=new Set(N);T=T.filter((L)=>!D.has(L))}if(T.length!==0){for(let N of T)v.add(N);C=new c6(A,y.map(p),void 0,[],g)}}let P=new Set([...v].map(({routeIndex:M})=>M));return y.map((M,B)=>P.has(B)?M:d[B])})({srj:n,routes:i,proposedRoutes:l}),l=l.map((h,d)=>h===i[d]?r[d]:h)),void(this.state={phase:"physical-validation",context:e.context,candidate:l})}if(e.phase==="physical-validation"){let l=new Map(VV({srj:n,routes:i}).map((h)=>[h.key,h.severity]));return VV({srj:n,routes:e.candidate}).some(({key:h,severity:d})=>!l.has(h)||d>l.get(h)+0.00000001)||Xqe({srj:n,previousRoutes:t.previousRoutes??i,routes:e.candidate}).length>0?(this.state={phase:"finished",output:t.routes},void(this.solved=!0)):void(this.state={...e,phase:"reference-validation"})}let s=t.drcEvaluator({traces:[],routes:e.candidate,hdRoutes:e.candidate}),a=Array.isArray(s)?s:s.errors,c=t.allowPartialRepair?((l,h)=>{if(h.length>=l.length)return!1;let d=(_)=>_.type==="pcb_via_trace_clearance_error"?JSON.stringify([_.type,_.pcb_trace_id,_.pcb_via_id]):_.type==="pcb_pad_trace_clearance_error"?JSON.stringify([_.type,_.pcb_trace_id,_.pcb_pad_id]):_.type==="pcb_via_clearance_error"&&Array.isArray(_.pcb_via_ids)?JSON.stringify([_.type,[..._.pcb_via_ids].sort()]):_.type==="pcb_trace_error"&&typeof _.pcb_trace_error_id=="string"&&_.pcb_trace_error_id.startsWith(`overlap_${_.pcb_trace_id}_`)?JSON.stringify([_.type,_.pcb_trace_error_id]):void 0,u=[...l];for(let _ of h){let p=d(_);if(p===void 0)return!1;let m=u.findIndex((g)=>d(g)===p);if(m<0)return!1;let A=u.splice(m,1)[0];if(_.type!=="pcb_trace_error"&&(typeof _.actual_clearance!="number"||!Number.isFinite(_.actual_clearance)||typeof A.actual_clearance!="number"||!Number.isFinite(A.actual_clearance)||_.minimum_clearance!==A.minimum_clearance||_.actual_clearance<A.actual_clearance-0.000000001))return!1}return!0})(o,a):a.length<o.length;this.state={phase:"finished",output:c?e.candidate:t.routes},this.solved=!0}getOutput(){if(!this.solved||this.state.phase!=="finished")throw Error("Clearance projection is not complete");return this.state.output}computeProgress(){switch(this.state.phase){case"initialize":return 0;case"relax":return 0.9*this.state.solver.progress;case"select":return 0.9;case"physical-validation":return 0.93;case"reference-validation":return 0.96;case"finished":return 1}}},V6r={maxRegions:4,maxCandidateAttempts:1024,maxPathSearchNodes:480000},NGt=(e,t,n)=>{if(!Number.isFinite(n)||n<=0)throw Error("Pipeline9 regional repair effort must be positive and finite");let o=Math.max(1,n);return{maxRegions:Math.ceil(24*o),maxCandidateAttempts:Math.ceil(4096*o),maxPathSearchNodes:Math.ceil(40000000*o),initialMaxRegions:Math.ceil(4*o),initialMaxCandidateAttempts:Math.ceil(1024*o),initialMaxPathSearchNodes:Math.ceil(2000000*o),regionsPerAcceptedRepair:2,candidateAttemptsPerAcceptedRepair:512,pathSearchNodesPerAcceptedRepair:2000000,maxCandidateAttemptsPerRegion:512,maxPathSearchNodesPerCall:1e6,pathGridSizeScale:2,pathHeuristicWeight:3,revisitChangedRegions:!0,regionSizes:[16,32]}},RGt=(e,t)=>({maxRegions:Math.min(e.maxRegions,(e.initialMaxRegions??e.maxRegions)+t*(e.regionsPerAcceptedRepair??0)),maxCandidateAttempts:Math.min(e.maxCandidateAttempts,(e.initialMaxCandidateAttempts??e.maxCandidateAttempts)+t*(e.candidateAttemptsPerAcceptedRepair??0)),maxPathSearchNodes:Math.min(e.maxPathSearchNodes,(e.initialMaxPathSearchNodes??e.maxPathSearchNodes)+t*(e.pathSearchNodesPerAcceptedRepair??0))}),QGt=[3,4,5,6,8],kGt=({error:e,routeIndexByTraceId:t})=>{let n=typeof e.pcb_trace_id=="string"?e.pcb_trace_id:void 0,o=[...typeof e.pcb_via_id=="string"?[e.pcb_via_id]:[],...Array.isArray(e.pcb_via_ids)?e.pcb_via_ids.filter((a)=>typeof a=="string"):[]],r=n?`overlap_${n}_`:void 0,i=r&&typeof e.pcb_trace_error_id=="string"&&e.pcb_trace_error_id.startsWith(r)?e.pcb_trace_error_id.slice(r.length):void 0,s=i!==void 0&&o.includes(i);return[n,...Array.isArray(e.pcb_trace_ids)?e.pcb_trace_ids:[],s?void 0:i].filter((a)=>typeof a=="string"&&t.has(a)).filter((a,c,l)=>l.indexOf(a)===c)},LGt=(e)=>e.filter((t)=>t.type==="pcb_via_clearance_error"||Array.isArray(t.pcb_via_ids)).length,ocn=(e,t)=>{let n=new Map;for(let o of e)n.set(o.connectionName,(n.get(o.connectionName)??0)+1);return e.map((o,r)=>{let i=n.get(o.connectionName)>1?`${o.connectionName}_regional_${r}`:o.connectionName;return i!==o.connectionName&&t.addConnections([[i,o.connectionName,o.rootConnectionName??o.connectionName]]),{...o,connectionName:i,preloadedTraceId:`pipeline9_joint_candidate_${r}`,preloadedTraceIndex:r,preloadedRouteIndex:0,isThroughObstacle:!1}})},HGt=(e,t)=>e.minX<=t.maxX&&e.maxX>=t.minX&&e.minY<=t.maxY&&e.maxY>=t.minY,rcn=(e)=>({minX:e.center.x-e.diameter/2,maxX:e.center.x+e.diameter/2,minY:e.center.y-e.diameter/2,maxY:e.center.y+e.diameter/2}),Y6r=(e)=>({minX:e.center.x-e.width/2,maxX:e.center.x+e.width/2,minY:e.center.y-e.height/2,maxY:e.center.y+e.height/2}),G6r=(e,t,n)=>{let o=CB(e,n);return o.wireSegments.some((r)=>HGt(((i)=>({minX:Math.min(i.start.x,i.end.x)-i.width/2,maxX:Math.max(i.start.x,i.end.x)+i.width/2,minY:Math.min(i.start.y,i.end.y)-i.width/2,maxY:Math.max(i.start.y,i.end.y)+i.width/2}))(r),t))||o.viaSpans.some((r)=>HGt(rcn(r),t))},U6r=({routes:e,fixedRouteCopperSpatialIndex:t,center:n,regionSize:o,srj:r,connMap:i,colorMap:s,viaDiameter:a,traceWidth:c,obstacleMargin:l,effort:h})=>{let d=ocn(e,i),u={capacityMeshNodeId:"pipeline9_joint_drc_regular_fallback",center:n,width:o,height:o,availableZ:Array.from({length:r.layerCount},(f,y)=>y),portPoints:[],portPointsInPairs:[]},_=Ele(u,d);if(_.fixedRouteSectionsByConnectionName.size===0)return;if(!((f)=>{let y=Uan(f);return f.portPoints.every((x)=>YUt({point:x,bounds:y})==="on-boundary")})(_.nodeWithPortPoints))return;let p=[..._.fixedRouteSectionsByConnectionName.values()].flatMap((f)=>f.sourceRoutes).reduce((f,y)=>{let x=CB(y,r);return Math.max(f,y.viaDiameter/2,...x.wireSegments.map((C)=>C.width/2),...x.viaSpans.map((C)=>C.diameter/2))},Math.max(c/2,a/2)),m={minX:n.x-o/2-l-p,maxX:n.x+o/2+l+p,minY:n.y-o/2-l-p,maxY:n.y+o/2+l+p},A=t.getRoutesOverlappingBounds(m),g=Jan({fixedObstacleRoutes:A,layerCount:r.layerCount,allowBlindAndBuriedVias:r.allowBlindAndBuriedVias});return{solver:new tcn({nodeWithPortPoints:_.nodeWithPortPoints,colorMap:s,connMap:i,viaDiameter:a,traceWidth:c,obstacleMargin:l,effort:h,obstacles:[...r.obstacles,...g],layerCount:r.layerCount,allowBlindAndBuriedVias:r.allowBlindAndBuriedVias}),routes:e,regionalRoutes:d,problem:_,candidateBounds:m,localFixedObstacleRoutes:A,obstacleMargin:l,connMap:i,srj:r}},W6r=({solver:e,routes:t,regionalRoutes:n,problem:o,candidateBounds:r,localFixedObstacleRoutes:i,obstacleMargin:s,connMap:a,srj:c})=>{if(!e.solved||e.failed)return;let l=e.getOutput(),h=new Map(l.map((p)=>[p.connectionName,p])),d=new Map,u=new Set;for(let[p,m]of o.fixedRouteSectionsByConnectionName){let A=h.get(p);if(!A)return;d.set(m.sourceRoutes[0].preloadedTraceIndex,eet(m,A));for(let g of m.sourceRoutes.slice(1))u.add(g.preloadedTraceIndex)}let _=n.flatMap((p,m)=>u.has(m)?[]:[{...d.get(m)??p,connectionName:t[m].connectionName}]);return(({candidateRoutes:p,fixedObstacleRoutes:m,obstacleMargin:A,connMap:g,candidateBounds:f,srj:y})=>{for(let x of p)for(let C of m)if(!Zan(x,C,g)&&ecn({left:x,right:C,clearance:A,leftBounds:f,layerCount:y.layerCount,allowBlindAndBuriedVias:y.allowBlindAndBuriedVias}))return!0;return!1})({candidateRoutes:_,fixedObstacleRoutes:i,obstacleMargin:s,connMap:a,candidateBounds:r,srj:c})?void 0:_},X6r=class extends ei{params;candidateSearchBudget;phase="initialize";result;currentRoutes;currentErrors=[];bestRoutes;bestErrors=[];fixedRouteCopperSpatialIndex;routeIndexByTraceId=new Map;repairableErrors=[];passIndex=0;errorIndex=0;traceIndex=0;regionIndex=0;traceIds=[];repairCenter;stopB01SearchForError=!1;acceptedOnPass=!1;attemptedCandidateCount=0;acceptedCandidateCount=0;fallbackCandidateCount=0;candidateSearchCount=0;candidateSearchBudgetExhausted=!1;safeTraceLayerRepairSkippedForBudget=!1;preloadEligibleDrcIssueCount=0;b01Candidate;regularCandidate;safeTraceLayerSolver;constructor(e){super(),this.params=e,this.currentRoutes=e.routes,this.bestRoutes=e.routes,this.candidateSearchBudget=((t)=>{if(!Number.isInteger(t)||t<0)throw Error("Pipeline9 regional repair route count must be nonnegative");let n=Math.floor(7000/Math.max(1,t));return Math.max(16,Math.min(192,n))})(e.routes.length),this.MAX_ITERATIONS=64+8*this.candidateSearchBudget}initializeRepair(){let{initialErrors:e,drcEvaluator:t,newConnections:n,syntheticConnectionNames:o}=this.params;this.currentErrors=e??uV(t,this.currentRoutes),this.MAX_ITERATIONS+=16*this.currentErrors.length,this.preloadEligibleDrcIssueCount=this.currentErrors.filter((s)=>(({error:a,preloadRepairTraceIds:c})=>!!ncn(a).some((l)=>c.has(l))||(a.__collapsed_trace_participants??[]).flatMap((l)=>new Set(l.evaluationTraceIds).size>1?[l.solverTraceId]:[]).some((l)=>c.collidingFixedTraceIds?.has(l)))({error:s,preloadRepairTraceIds:this.params.preloadRepairTraceIds})).length;let r=Mle({routes:this.currentRoutes,newConnections:n,syntheticConnectionNames:o}),i=this.params.allowTracePairRepair===!0&&this.currentErrors.some((s)=>((a,c)=>!(a.type!=="pcb_trace_error"||typeof a.pcb_via_id=="string"||Array.isArray(a.pcb_via_ids)&&a.pcb_via_ids.length>0)&&kGt({error:a,routeIndexByTraceId:c}).length===2)(s,r));this.preloadEligibleDrcIssueCount!==0||i?(this.fixedRouteCopperSpatialIndex=((s,a)=>{let c=new Map,l=(h,d)=>{let u=Math.floor(d.minX/4),_=Math.floor(d.maxX/4),p=Math.floor(d.minY/4),m=Math.floor(d.maxY/4);for(let A=u;A<=_;A++)for(let g=p;g<=m;g++){let f=`${A}:${g}`,y=c.get(f)??new Set;y.add(h),c.set(f,y)}};for(let h=0;h<s.length;h++){let d=CB(s[h],a);for(let u of d.wireSegments)for(let _ of qan(u,4,1))l(h,Y6r(_));for(let u of d.viaSpans)l(h,rcn(u))}return{getRoutesOverlappingBounds:(h)=>{let d=new Set,u=Math.floor(h.minX/4),_=Math.floor(h.maxX/4),p=Math.floor(h.minY/4),m=Math.floor(h.maxY/4);for(let A=u;A<=_;A++)for(let g=p;g<=m;g++)for(let f of c.get(`${A}:${g}`)??[])d.add(f);return[...d].sort((A,g)=>A-g).map((A)=>s[A]).filter((A)=>G6r(A,h,a))}}})(this.params.fixedObstacleRoutes,this.params.srj),this.phase="begin-pass"):this.finishRepair()}beginPass(){this.candidateSearchBudgetExhausted||this.passIndex>=2?this.phase="refine":(this.acceptedOnPass=!1,this.routeIndexByTraceId=Mle({routes:this.currentRoutes,newConnections:this.params.newConnections,syntheticConnectionNames:this.params.syntheticConnectionNames}),this.repairableErrors=this.currentErrors.filter((e)=>(e.type==="pcb_trace_error"||e.type==="pcb_pad_trace_clearance_error"||e.type==="pcb_via_trace_clearance_error"||e.type==="pcb_via_clearance_error")&&typeof e.pcb_trace_id=="string"),this.errorIndex=0,this.phase="begin-error")}beginError(){if(this.candidateSearchBudgetExhausted||this.errorIndex>=this.repairableErrors.length)return void(this.phase="finish-pass");let e=this.repairableErrors[this.errorIndex];this.repairCenter=((t,n)=>{let o=typeof t.pcb_pad_id=="string"?t.pcb_pad_id:typeof t.pcb_trace_error_id=="string"?t.pcb_trace_error_id.match(/(pcb_(?:smtpad|plated_hole|hole|keepout)_\d+)$/)?.[1]:void 0;if(o){let r=n.obstacles.find((i)=>i.obstacleId===o||i.connectedTo[0]===o);if(r)return r.center}return((r)=>{let i=r.center;return i&&typeof i=="object"&&"x"in i&&"y"in i&&typeof i.x=="number"&&typeof i.y=="number"?{x:i.x,y:i.y}:void 0})(t)})(e,this.params.srj),this.traceIds=kGt({error:e,routeIndexByTraceId:this.routeIndexByTraceId}).slice(0,2),this.repairCenter?(this.bestRoutes=this.currentRoutes,this.bestErrors=this.currentErrors,this.traceIndex=0,this.regionIndex=0,this.stopB01SearchForError=!1,this.phase="prepare-b01"):this.errorIndex++}startChildSolver(e){let t=Math.floor(e.MAX_ITERATIONS)+1;if(!Number.isSafeInteger(t)||t<1)throw Error("Regional B01 child has an invalid iteration limit");this.MAX_ITERATIONS+=t,this.activeSubSolver=e}prepareB01Candidate(){if(this.stopB01SearchForError||this.candidateSearchBudgetExhausted||this.traceIndex>=this.traceIds.length)return void(this.phase="prepare-regional");let e=this.routeIndexByTraceId.get(this.traceIds[this.traceIndex]);if(e===void 0)return this.traceIndex++,void(this.regionIndex=0);if(this.regionIndex>=QGt.length)return void(this.bestErrors.length===0?this.stopB01SearchForError=!0:(this.traceIndex++,this.regionIndex=0));if(this.candidateSearchCount>=this.candidateSearchBudget)return this.candidateSearchBudgetExhausted=!0,void(this.phase="prepare-regional");let t=this.repairCenter;if(!t)throw Error("Regional B01 candidate has no repair center");let n=QGt[this.regionIndex];this.regionIndex++,this.candidateSearchCount++,this.b01Candidate=(({routes:o,fixedObstacleRoutes:r,routeIndex:i,center:s,regionSize:a,srj:c,connMap:l,colorMap:h,viaDiameter:d,traceWidth:u,obstacleMargin:_,effort:p})=>{let m=ocn(o,l),A=m[i];if(!A)return;let g={capacityMeshNodeId:`pipeline9_joint_drc_${i}_${a}`,center:s,width:a,height:a,availableZ:Array.from({length:c.layerCount},(C,b)=>b),portPoints:[],portPointsInPairs:[]},f=Ele(g,[A]),y=f.fixedRouteSectionsByConnectionName.get(A.connectionName);if(!y)return;let x=m.filter((C,b)=>b!==i);return{solver:new tet({nodePortPoints:[f.nodeWithPortPoints],fixedHdRoutes:[...x,...r].map((C)=>({...C,rootConnectionName:l.getNetConnectedToId(C.rootConnectionName??C.connectionName)??C.rootConnectionName??C.connectionName})),connMap:l,colorMap:h,obstacles:c.obstacles,layerCount:c.layerCount,allowBlindAndBuriedVias:c.allowBlindAndBuriedVias,viaDiameter:d,traceWidth:u,obstacleMargin:_,effort:p,preserveTerminalPcbPortIds:!0,includeBoardObstacles:!0,enableRegionalFallback:!1,maxB01Rips:120}),routes:o,movableRoute:A,movableSection:y,routeIndex:i}})({...this.params,routes:this.currentRoutes,routeIndex:e,center:t,regionSize:n}),this.b01Candidate&&(this.startChildSolver(this.b01Candidate.solver),this.phase="route-b01")}stepB01Candidate(){let e=this.b01Candidate;if(!e)throw Error("Regional B01 has no active candidate");e.solver.step(),(e.solver.solved||e.solver.failed)&&(this.activeSubSolver=null,this.phase="validate-b01")}validateB01Candidate(){let e=this.b01Candidate;if(!e)throw Error("Regional B01 has no completed candidate");let t=(({solver:n,routes:o,movableRoute:r,movableSection:i,routeIndex:s})=>{if(!n.solved||n.failed)return;let a=n.routes.find((c)=>c.connectionName===r.connectionName);return a?{routes:o.map((c,l)=>l===s?{...eet(i,a),connectionName:c.connectionName}:c),usedFallback:Number(n.stats.fallbackNodeCount??0)>0}:void 0})(e);if(this.b01Candidate=void 0,t){this.attemptedCandidateCount++,t.usedFallback&&this.fallbackCandidateCount++;let n=uV(this.params.drcEvaluator,t.routes);yce(n,this.bestErrors)&&(this.bestRoutes=t.routes,this.bestErrors=n),this.bestErrors.length===0&&(this.stopB01SearchForError=!0)}this.phase="prepare-b01"}prepareRegularCandidate(){if(this.bestRoutes!==this.currentRoutes||this.candidateSearchBudgetExhausted)return void(this.phase="commit-error");if(this.candidateSearchCount>=this.candidateSearchBudget)return this.candidateSearchBudgetExhausted=!0,void(this.phase="commit-error");this.candidateSearchCount++;let e=this.repairCenter,t=this.fixedRouteCopperSpatialIndex;if(!e||!t)throw Error("Regional fallback candidate is missing its fixed context");this.regularCandidate=U6r({...this.params,routes:this.currentRoutes,fixedRouteCopperSpatialIndex:t,center:e,regionSize:3}),this.regularCandidate?(this.startChildSolver(this.regularCandidate.solver),this.phase="route-regional"):this.phase="commit-error"}stepRegularCandidate(){let e=this.regularCandidate;if(!e)throw Error("Regional fallback has no active candidate");e.solver.step(),(e.solver.solved||e.solver.failed)&&(this.activeSubSolver=null,this.phase="validate-regional")}validateRegularCandidate(){let e=this.regularCandidate;if(!e)throw Error("Regional fallback has no completed candidate");let t=W6r(e);if(this.regularCandidate=void 0,t){this.attemptedCandidateCount++,this.fallbackCandidateCount++;let n=uV(this.params.drcEvaluator,t);yce(n,this.bestErrors)&&(this.bestRoutes=t,this.bestErrors=n)}this.phase="commit-error"}commitErrorRepair(){this.bestRoutes!==this.currentRoutes&&(this.currentRoutes=this.bestRoutes,this.currentErrors=this.bestErrors,this.acceptedCandidateCount++,this.acceptedOnPass=!0),this.errorIndex++,this.phase=this.candidateSearchBudgetExhausted?"finish-pass":"begin-error"}finishPass(){this.passIndex++,this.phase=!this.acceptedOnPass||this.currentErrors.length===0||this.candidateSearchBudgetExhausted?"refine":"begin-pass"}refineAcceptedRoutes(){if(this.acceptedCandidateCount>0&&this.currentErrors.length>0){let e=fZe({...this.params.srj,traces:void 0},this.currentRoutes,this.params.effort,1,this.params.connMap);if(e!==this.currentRoutes){let t=uV(this.params.drcEvaluator,e);LGt(t)<=LGt(this.currentErrors)&&yce(t,this.currentErrors)&&(this.currentRoutes=e,this.currentErrors=t)}}this.phase="prepare-safe-layer"}prepareSafeLayerRepair(){let e=this.currentErrors.some((t)=>t.type==="pcb_trace_error"||t.type==="pcb_pad_trace_clearance_error");this.safeTraceLayerRepairSkippedForBudget=e&&this.candidateSearchBudgetExhausted,e&&!this.candidateSearchBudgetExhausted?(this.safeTraceLayerSolver=new NS({srj:{...this.params.srj,traces:void 0},hdRoutes:this.currentRoutes,connMap:this.params.connMap,effort:this.params.effort,drcEvaluator:this.params.drcEvaluator,maxIterations:8,enableLargeBoardBroadFallback:!1,enableTargetedErrorSweep:!1,enablePostSolveClearanceRelaxation:!1,enableSafeTraceLayerMoves:!0,enableViaInPadLayerMoves:!1}),this.startChildSolver(this.safeTraceLayerSolver),this.phase="route-safe-layer"):this.finishRepair()}stepSafeLayerRepair(){let e=this.safeTraceLayerSolver;if(!e)throw Error("Regional B01 has no safe trace-layer solver");if(e.step(),e.failed)throw Error(`Pipeline9 post-regional safe trace-layer repair failed: ${e.error??"unknown error"}`);e.solved&&(this.activeSubSolver=null,this.phase="validate-safe-layer")}validateSafeLayerRepair(){let e=this.safeTraceLayerSolver;if(!e)throw Error("Regional B01 has no completed safe trace-layer solver");let t=e.getOutput(),n=uV(this.params.drcEvaluator,t);yce(n,this.currentErrors)&&(this.currentRoutes=t,this.currentErrors=n),this.safeTraceLayerSolver=void 0,this.finishRepair()}finishRepair(){this.result={routes:this.currentRoutes,attemptedCandidateCount:this.attemptedCandidateCount,acceptedCandidateCount:this.acceptedCandidateCount,fallbackCandidateCount:this.fallbackCandidateCount,candidateSearchCount:this.candidateSearchCount,candidateSearchBudget:this.candidateSearchBudget,candidateSearchBudgetExhausted:this.candidateSearchBudgetExhausted,safeTraceLayerRepairSkippedForBudget:this.safeTraceLayerRepairSkippedForBudget,remainingDrcIssueCount:this.currentErrors.length,preloadEligibleDrcIssueCount:this.preloadEligibleDrcIssueCount,preloadRepairAttempted:this.preloadEligibleDrcIssueCount>0},this.activeSubSolver=null,this.stats={...this.result,routes:void 0},this.phase="done",this.solved=!0}_step(){switch(this.phase){case"initialize":return this.initializeRepair();case"begin-pass":return this.beginPass();case"begin-error":return this.beginError();case"prepare-b01":return this.prepareB01Candidate();case"route-b01":return this.stepB01Candidate();case"validate-b01":return this.validateB01Candidate();case"prepare-regional":return this.prepareRegularCandidate();case"route-regional":return this.stepRegularCandidate();case"validate-regional":return this.validateRegularCandidate();case"commit-error":return this.commitErrorRepair();case"finish-pass":return this.finishPass();case"refine":return this.refineAcceptedRoutes();case"prepare-safe-layer":return this.prepareSafeLayerRepair();case"route-safe-layer":return this.stepSafeLayerRepair();case"validate-safe-layer":return this.validateSafeLayerRepair();case"done":throw Error("Regional B01 repair was stepped after completion")}}computeProgress(){if(this.solved)return 1;let e=this.activeSubSolver?Math.max(0,Math.min(1,this.activeSubSolver.progress)):1;return Math.max(this.progress,Math.min(1,(Math.max(0,this.candidateSearchCount-1)+e)/(this.candidateSearchBudget+1)))}getResult(){if(!this.solved||this.failed||!this.result)throw Error("Pipeline9 regional B01 repair is not complete");return this.result}},j6r=class extends ei{params;merger;result;phase="initialize";physicalSrj;movableRoutes=[];candidateRoutes;beforeErrorCount=0;constructor(e){super(),this.params=e,this.MAX_ITERATIONS=1000004}initializeMerge(){let{srj:e,routes:t,connMap:n,drcEvaluator:o,referenceResult:r}=this.params,i=r??o({traces:[],routes:t,hdRoutes:t});this.result={routes:t,referenceResult:i,referenceValidationCount:r===void 0?1:0,accepted:!1};let s=Array.isArray(i)?i:i.errors;this.beforeErrorCount=s.length;let a=s.filter((l)=>l.type==="pcb_via_clearance_error").flatMap(net);if(this.movableRoutes=t.filter((l)=>a.some((h)=>h===l.connectionName||h.startsWith(`${l.connectionName}_`))),this.movableRoutes.length===0)return this.phase="done",void(this.solved=!0);this.physicalSrj={...oP(e),traces:void 0};let c=new Set(this.movableRoutes);this.merger=new wZe({inputHdRoutes:this.movableRoutes,otherHdRoutes:t.filter((l)=>!c.has(l)),netByConnectionName:abe(t,n),obstacles:this.physicalSrj.obstacles,layerCount:this.physicalSrj.layerCount,connMap:n,colorMap:{},preserveRouteEndpoints:!0}),this.MAX_ITERATIONS=this.merger.MAX_ITERATIONS+4,this.activeSubSolver=this.merger,this.phase="merge"}stepMerge(){let e=this.merger;if(!e)throw Error("Reported via merge has no active merger");if(e.step(),e.failed)throw Error(`Reported via merge failed: ${e.error}`);if(!e.solved)return;if(e.mergedViaHdRoutes.length!==this.movableRoutes.length)throw Error("Reported via merge changed the number of route pieces");let t=new Map(this.movableRoutes.map((n,o)=>[n,e.mergedViaHdRoutes[o]]));this.candidateRoutes=this.params.routes.map((n)=>t.get(n)??n),this.activeSubSolver=null,this.phase="physical-check"}validatePhysicalProposal(){let e=this.physicalSrj,t=this.candidateRoutes;if(!e||!t)throw Error("Reported via merge has no physical proposal");let n=this.params.routes,o=new Map(VV({srj:e,routes:n}).map(({key:r,severity:i})=>[r,i]));if(!VV({srj:e,routes:t}).every(({key:r,severity:i})=>o.has(r)&&i<=o.get(r)+0.00000001)||Xqe({srj:e,previousRoutes:n,routes:t}).length>0)return this.phase="done",void(this.solved=!0);this.phase="reference-check"}validateReferenceProposal(){let e=this.result,t=this.candidateRoutes;if(!e||!t)throw Error("Reported via merge has no reference proposal");let n=this.params.drcEvaluator({traces:[],routes:t,hdRoutes:t});e.referenceValidationCount++,(Array.isArray(n)?n:n.errors).length<this.beforeErrorCount&&(this.result={...e,routes:t,referenceResult:n,accepted:!0}),this.phase="done",this.solved=!0}_step(){switch(this.phase){case"initialize":return this.initializeMerge();case"merge":return this.stepMerge();case"physical-check":return this.validatePhysicalProposal();case"reference-check":return this.validateReferenceProposal();case"done":throw Error("Reported via merge was stepped after completion")}}getResult(){if(!this.solved||this.failed||!this.result)throw Error("Reported via merge is not complete");return this.result}},K6r=[10,16],FGt=class extends ei{params;budget;state={phase:"initialize"};result;reservedChildMaximum=0;constructor(e){super(),this.params=e,this.budget=e.budget??V6r,this.result={routes:e.routes,attemptedRegionCount:0,acceptedRegionCount:0,candidateAttemptCount:0,pathSearchNodeCount:0,referenceValidationCount:0,initialDrcIssueCount:void 0,finalDrcIssueCount:void 0,publishedDrcIssueCount:void 0,repaired:!1},this.MAX_ITERATIONS=16*this.budget.maxRegions+32}updateProgress(){let e=RGt(this.budget,this.result.acceptedRegionCount),t=this.state.phase==="negotiate"?this.state.solver:void 0,n=typeof t?.stats.pathSearchCalls=="number"?t.stats.pathSearchCalls:0,o=typeof t?.stats.pathSearchNodes=="number"?t.stats.pathSearchNodes:0;this.stats={...this.result,routes:void 0,phase:this.state.phase,candidateAttemptCount:this.result.candidateAttemptCount+n,pathSearchNodeCount:this.result.pathSearchNodeCount+o,allowedRegionCount:e.maxRegions,allowedCandidateAttemptCount:e.maxCandidateAttempts,allowedPathSearchNodeCount:e.maxPathSearchNodes};let r=Math.max(this.result.attemptedRegionCount/Math.max(1,this.budget.maxRegions),this.stats.candidateAttemptCount/Math.max(1,this.budget.maxCandidateAttempts),this.stats.pathSearchNodeCount/Math.max(1,this.budget.maxPathSearchNodes));this.progress=this.solved?1:Math.max(this.progress,Math.min(0.99,r))}startChild(e){if(this.activeSubSolver)throw Error("Regional repair started a child before the previous stage completed");this.activeSubSolver=e,this.reservedChildMaximum=e.MAX_ITERATIONS,this.MAX_ITERATIONS+=this.reservedChildMaximum+1}finish(){if(this.activeSubSolver)throw Error("Regional repair finished with an active child solver");this.solved=!0,this.state={phase:"done"}}publish(e,t){this.result.routes=e.currentRoutes,this.result.publishedDrcIssueCount=e.currentErrors.length,this.result.finalDrcIssueCount=e.currentErrors.length,this.result.repaired=t,this.finish()}initialize(){let{originalSrj:e,routes:t,syntheticConnectionNames:n}=this.params;if(e.traces?.length||n.size>0)return void this.finish();let o=Math.max(e.defaultObstacleMargin??0.2,e.minTraceToPadEdgeClearance??0,e.minTraceToHoleEdgeClearance??0,e.minViaEdgeToPadEdgeClearance??0),r=Math.max(e.minTraceWidth,e.minViaDiameter??0);for(let a of t){r=Math.max(r,a.traceThickness,a.viaDiameter);for(let c of a.route)r=Math.max(r,c.traceThickness??0)}let i=Math.max(0.5,r+o),s=(this.budget.regionSizes??K6r).filter((a)=>!Number.isFinite(i)||2*i<a);s.length!==0?this.state={phase:"initial-reference",context:{boundaryMargin:i,regionSizes:s}}:this.finish()}initialReference(e){let t=this.params.drcEvaluator({traces:[],routes:this.params.routes,hdRoutes:this.params.routes});this.result.referenceValidationCount++;let n=Array.isArray(t)?t:t.errors,o={...e,currentRoutes:this.params.routes,reference:t,currentErrors:n,initialErrors:n};if(this.result.initialDrcIssueCount=n.length,this.result.finalDrcIssueCount=n.length,this.result.publishedDrcIssueCount=n.length,n.length===0)return void this.finish();let r=new aV({originalSrj:this.params.originalSrj,routes:o.currentRoutes,drcEvaluator:(i)=>(this.result.referenceValidationCount++,this.params.drcEvaluator(i))});this.state={phase:"initial-projection",context:o,solver:r},this.startChild(r)}initialProjectionReference(e){let t=this.params.drcEvaluator({traces:[],routes:e.currentRoutes,hdRoutes:e.currentRoutes});this.result.referenceValidationCount++,e.reference=t,e.currentErrors=Array.isArray(t)?t:t.errors,this.result.finalDrcIssueCount=e.currentErrors.length,e.currentErrors.length!==0?this.state={phase:"prepare-regions",context:e}:this.publish(e,!0)}prepareRegions(e){let t={...oP(this.params.originalSrj),traces:void 0},n=new Map;for(let i of this.params.originalSrj.obstacles)for(let s of[i.obstacleId,i.circuitJsonMetadata?.pcb_smtpad_id,i.circuitJsonMetadata?.pcb_plated_hole_id,i.connectedTo[0]])typeof s=="string"&&n.set(s,i.center);let o=Q$(e.currentRoutes),r={...e,srj:t,obstacleCenterById:n,currentRoutes:o,attemptedRegions:[],fixedViolations:new Map(VV({srj:t,routes:o}).map(({key:i,severity:s})=>[i,s]))};this.state={phase:"select-region",context:r}}selectRegion(e){let t=RGt(this.budget,this.result.acceptedRegionCount);if(this.result.attemptedRegionCount>=t.maxRegions||this.result.candidateAttemptCount>=t.maxCandidateAttempts||this.result.pathSearchNodeCount>=t.maxPathSearchNodes)return void(this.state={phase:"publish-partial",context:e});let n=(Array.isArray(e.reference)?e.reference:e.reference.errorsWithCenters??e.reference.errors).map((d)=>{let u=`overlap_${d.pcb_trace_id}_`,_=typeof d.pcb_pad_id=="string"?d.pcb_pad_id:typeof d.pcb_trace_error_id=="string"&&d.pcb_trace_error_id.startsWith(u)?d.pcb_trace_error_id.slice(u.length):void 0;return(_?e.obstacleCenterById.get(_):void 0)??d.center??d.pcb_center}).filter((d)=>d!==null&&typeof d=="object"&&("x"in d)&&("y"in d)&&typeof d.x=="number"&&typeof d.y=="number"&&Number.isFinite(d.x)&&Number.isFinite(d.y)),o;for(let d of e.regionSizes){let u=n.filter(({x:y,y:x})=>!e.attemptedRegions.some(({bounds:C,size:b})=>d===b&&y>=C.minX&&y<=C.maxX&&x>=C.minY&&x<=C.maxY)),_=u[0];if(!_)continue;let{x:p,x:m,y:A,y:g}=_,f=d-2*e.boundaryMargin;for(let y of u.slice(1)){let x=Math.min(p,y.x),C=Math.max(m,y.x),b=Math.min(A,y.y),I=Math.max(g,y.y);C-x>=f||I-b>=f||(p=x,m=C,A=b,g=I)}o={center:{x:(p+m)/2,y:(A+g)/2},size:d};break}if(!o)return void(this.state={phase:"publish-partial",context:e});let{center:r,size:i}=o,s=Ugr({srj:e.srj,routes:e.currentRoutes,bounds:{minX:r.x-i/2,maxX:r.x+i/2,minY:r.y-i/2,maxY:r.y+i/2}});if(e.attemptedRegions.push({bounds:s.mutableBounds,size:i}),this.result.attemptedRegionCount++,s.routes.length===0)return;let a=new Set(e.currentErrors.flatMap(net)),c=s.routes.flatMap((d,u)=>[...a].some((_)=>_===d.connectionName||_.startsWith(`${d.connectionName}_`))?[u]:[]),l=Math.min(this.budget.maxCandidateAttemptsPerRegion??(this.budget.revisitChangedRegions?Math.ceil(t.maxCandidateAttempts/2):t.maxCandidateAttempts),t.maxCandidateAttempts-this.result.candidateAttemptCount),h=new Kgr({srj:s.srj,routes:s.routes,bounds:s.mutableBounds,dirtyRouteIndices:c,isLocked:(d,u)=>s.lockedPointIndices[d][u],maxPathSearchCalls:l,maxPathSearchNodes:t.maxPathSearchNodes-this.result.pathSearchNodeCount,maxPathSearchNodesPerCall:this.budget.maxPathSearchNodesPerCall,pathHeuristicWeight:this.budget.pathHeuristicWeight,pathGridSizeScale:e.currentErrors.length>10?this.budget.pathGridSizeScale:void 0,allowLayerChanges:!0,traceClearance:WQ.traceClearance,viaClearance:WQ.viaClearance,viaHoleDiameter:this.params.viaHoleDiameter});this.state={phase:"negotiate",negotiation:{context:e,allowance:t,maxPathSearchCalls:l,region:s},solver:h},this.startChild(h)}completeNegotiation(e){let t=e.solver.getOutput(),{context:n,allowance:o,maxPathSearchCalls:r}=e.negotiation,{pathSearchCalls:i,pathSearchNodes:s}=t;if(this.budget.revisitChangedRegions&&t.unresolvedSpanCount>0&&i<r&&s<o.maxPathSearchNodes-this.result.pathSearchNodeCount&&n.regionSizes.sort((a,c)=>c-a),!Number.isSafeInteger(i)||i<0||i+this.result.candidateAttemptCount>this.budget.maxCandidateAttempts||!Number.isSafeInteger(s)||s<0||s+this.result.pathSearchNodeCount>this.budget.maxPathSearchNodes)throw Error("Pipeline9 bounded regional repair exceeded its work budget");this.result.candidateAttemptCount+=i,this.result.pathSearchNodeCount+=s,this.state={phase:"splice-region",negotiation:e.negotiation,repair:t}}spliceRegion(e){let{context:t,region:n}=e.negotiation,o=(({routes:i,region:s,repairedRoutes:a})=>{if(a.length!==s.routeMappings.length||s.lockedPointIndices.length!==a.length)throw Error("repair04 merge requires exactly one replacement for every extracted fragment");let c=new Map;for(let l=0;l<a.length;l+=1){let h=s.routeMappings[l],d=a[l];if(!i[h.sourceRouteIndex])throw Error("repair04 merge source route no longer exists");if(Wgr(h.originalFragment,d,s.lockedPointIndices[l],s.mutableBounds,s.contextBounds,s.srj.layerCount),Ml(h.originalFragment)===Ml(d))continue;let u=c.get(h.sourceRouteIndex)??[];u.push({mapping:h,repaired:d}),c.set(h.sourceRouteIndex,u)}return i.map((l,h)=>{let d=c.get(h);if(!d)return l;d.sort((A,g)=>w4e(A.mapping.start)-w4e(g.mapping.start));let u=[],_=0;for(let{mapping:A,repaired:g}of d){let f=w4e(A.start),y=w4e(A.end);if(f<_-Ar||y<f||y>l.route.length-1+Ar)throw Error("repair04 merge received overlapping or stale fragment provenance");if(GUt(l,f,y)!==A.sourceGeometryKey)throw Error("repair04 merge rejected stale source geometry");KWe(u,Xje(l,_,f)),KWe(u,g.route),_=y}KWe(u,Xje(l,_,l.route.length-1));let p=new Set(d.flatMap(({mapping:A})=>A.originalFragment.vias.map((g)=>`${g.x},${g.y}`))),m=l.vias.filter((A)=>!p.has(`${A.x},${A.y}`)).map((A)=>structuredClone(A));for(let{repaired:A}of d)for(let g of A.vias)m.some((f)=>Math.abs(f.x-g.x)<=Ar&&Math.abs(f.y-g.y)<=Ar)||m.push(structuredClone(g));return{...l,route:Xgr(u,l,d.map(({mapping:A})=>A)),vias:m}})})({routes:t.currentRoutes,region:n,repairedRoutes:e.repair.routes});if(o.every((i,s)=>i===t.currentRoutes[s]))return void(this.state={phase:"select-region",context:t});let r=new aV({originalSrj:this.params.originalSrj,routes:o,previousRoutes:t.currentRoutes,subdivideSegments:!0,drcEvaluator:(i)=>(this.result.referenceValidationCount++,this.params.drcEvaluator(i))});this.state={phase:"candidate-projection",context:t,solver:r},this.startChild(r)}prepareViaMerge(e){if(!this.params.connMap)return void(this.state={...e,phase:"candidate-physical"});let t=new j6r({srj:e.context.srj,routes:e.candidateRoutes,connMap:this.params.connMap,drcEvaluator:this.params.drcEvaluator});this.state={...e,phase:"via-merge",solver:t},this.startChild(t)}validateCandidate(e){let{context:t,candidateRoutes:n}=e,o=VV({srj:t.srj,routes:n});!o.every(({key:r,severity:i})=>t.fixedViolations.has(r)&&i<=t.fixedViolations.get(r)+0.00000001)||Xqe({srj:t.srj,previousRoutes:t.currentRoutes,routes:n}).length>0?this.state={phase:"select-region",context:t}:this.state=e.candidateReference===void 0?{phase:"candidate-reference",context:t,candidateRoutes:n,candidateFixedViolations:o}:{phase:"accept-candidate",context:t,candidateRoutes:n,candidateFixedViolations:o,candidateReference:e.candidateReference}}referenceCandidate(e){let t=this.params.drcEvaluator({traces:[],routes:e.candidateRoutes,hdRoutes:e.candidateRoutes});this.result.referenceValidationCount++,this.state={...e,phase:"accept-candidate",candidateReference:t}}acceptCandidate(e){let{context:t,candidateReference:n}=e,o=Array.isArray(n)?n:n.errors;o.length>=t.currentErrors.length?this.state={phase:"select-region",context:t}:(t.currentRoutes=e.candidateRoutes,t.currentErrors=o,t.reference=n,t.fixedViolations=new Map(e.candidateFixedViolations.map(({key:r,severity:i})=>[r,i])),this.result.acceptedRegionCount++,this.budget.revisitChangedRegions&&(t.attemptedRegions.length=0),this.result.finalDrcIssueCount=o.length,o.length!==0?this.state={phase:"select-region",context:t}:this.publish(t,!0))}publishPartial(e){(({originalSrj:t,initialErrors:n,remainingErrors:o})=>{if(o.length>=n.length)return!1;let r=new Set(t.obstacles.flatMap((s)=>{let a=s.circuitJsonMetadata;return[a?.pcb_smtpad_id,a?.pcb_plated_hole_id].filter((c)=>typeof c=="string")})),i=[...n];for(let s of o){if(typeof s.pcb_trace_id!="string")return!1;let a=`overlap_${s.pcb_trace_id}_`,c=s.type==="pcb_trace_error"&&typeof s.pcb_trace_error_id=="string"&&s.pcb_trace_error_id.startsWith(a)?s.pcb_trace_error_id.slice(a.length):void 0,l=s.type==="pcb_pad_trace_clearance_error",h=l?s.pcb_pad_id:c;if(typeof h!="string"||!r.has(h))return!1;let d=i.findIndex((_)=>_.type===s.type&&_.pcb_trace_id===s.pcb_trace_id&&(l?_.pcb_pad_id===h:_.pcb_trace_error_id===s.pcb_trace_error_id));if(d===-1)return!1;let u=i.splice(d,1)[0];if(l&&(typeof s.actual_clearance!="number"||!Number.isFinite(s.actual_clearance)||typeof u.actual_clearance!="number"||!Number.isFinite(u.actual_clearance)||typeof s.minimum_clearance!="number"||!Number.isFinite(s.minimum_clearance)||s.minimum_clearance!==u.minimum_clearance||s.actual_clearance<u.actual_clearance))return!1}return!0})({originalSrj:this.params.originalSrj,initialErrors:e.initialErrors,remainingErrors:e.currentErrors})?this.publish(e,!1):this.state={phase:"prepare-independent-projection",context:e}}prepareIndependentProjection(e){let t=new aV({originalSrj:this.params.originalSrj,routes:this.params.routes,allowPartialRepair:!0,drcEvaluator:(n)=>(this.result.referenceValidationCount++,this.params.drcEvaluator(n))});this.state={phase:"independent-projection",context:e,solver:t},this.startChild(t)}prepareIndependentSubdivision(e){let t=new aV({originalSrj:this.params.originalSrj,routes:e.independentRoutes,allowPartialRepair:!0,subdivideSegments:!0,drcEvaluator:(n)=>(this.result.referenceValidationCount++,this.params.drcEvaluator(n))});this.state={phase:"independent-subdivision",context:e.context,solver:t},this.startChild(t)}prepareIndependentCoupled(e){let t=new aV({originalSrj:this.params.originalSrj,routes:e.independentRoutes,usePrecisionMargin:!0,drcEvaluator:(n)=>(this.result.referenceValidationCount++,this.params.drcEvaluator(n))});this.state={phase:"independent-coupled",context:e.context,solver:t},this.startChild(t)}referenceIndependent(e){let t=this.params.drcEvaluator({traces:[],routes:e.independentRoutes,hdRoutes:e.independentRoutes});this.result.referenceValidationCount++;let n=Array.isArray(t)?t:t.errors;this.result.routes=e.independentRoutes,this.result.publishedDrcIssueCount=n.length,this.result.finalDrcIssueCount=n.length,this.result.repaired=n.length===0,this.finish()}completeChild(){let e=this.state;switch(e.phase){case"initial-projection":{let t=e.solver.getOutput();t!==e.context.currentRoutes?(e.context.currentRoutes=t,this.state={phase:"initial-projection-reference",context:e.context}):this.state={phase:"prepare-regions",context:e.context};break}case"negotiate":this.completeNegotiation(e);break;case"candidate-projection":{let t=new aV({originalSrj:this.params.originalSrj,routes:e.solver.getOutput(),previousRoutes:e.context.currentRoutes,usePrecisionMargin:!0,drcEvaluator:(n)=>(this.result.referenceValidationCount++,this.params.drcEvaluator(n))});this.state={phase:"candidate-margin-projection",context:e.context,solver:t},this.startChild(t);break}case"candidate-margin-projection":this.state={phase:"prepare-via-merge",context:e.context,candidateRoutes:e.solver.getOutput()};break;case"via-merge":{let t=e.solver.getResult();this.result.referenceValidationCount+=t.referenceValidationCount,this.state={phase:"candidate-physical",context:e.context,candidateRoutes:t.routes,candidateReference:t.referenceResult};break}case"independent-projection":this.state={phase:"prepare-independent-subdivision",context:e.context,independentRoutes:e.solver.getOutput()};break;case"independent-subdivision":{let t=e.solver.getOutput();t===this.params.routes?this.finish():this.state={phase:"prepare-independent-coupled",context:e.context,independentRoutes:t};break}case"independent-coupled":this.state={phase:"independent-reference",context:e.context,independentRoutes:e.solver.getOutput()};break;default:throw Error(`Regional repair child completed during phase ${e.phase}`)}}_step(){let e=this.activeSubSolver;if(e)return e.step(),e.MAX_ITERATIONS>this.reservedChildMaximum&&(this.MAX_ITERATIONS+=e.MAX_ITERATIONS-this.reservedChildMaximum,this.reservedChildMaximum=e.MAX_ITERATIONS),e.failed?(this.failed=!0,this.error=e.error):e.solved&&(this.activeSubSolver=null,this.reservedChildMaximum=0,this.completeChild()),void this.updateProgress();let t=this.state;switch(t.phase){case"initialize":this.initialize();break;case"initial-reference":this.initialReference(t.context);break;case"initial-projection-reference":this.initialProjectionReference(t.context);break;case"prepare-regions":this.prepareRegions(t.context);break;case"select-region":this.selectRegion(t.context);break;case"splice-region":this.spliceRegion(t);break;case"prepare-via-merge":this.prepareViaMerge(t);break;case"candidate-physical":this.validateCandidate(t);break;case"candidate-reference":this.referenceCandidate(t);break;case"accept-candidate":this.acceptCandidate(t);break;case"publish-partial":this.publishPartial(t.context);break;case"prepare-independent-projection":this.prepareIndependentProjection(t.context);break;case"prepare-independent-subdivision":this.prepareIndependentSubdivision(t);break;case"prepare-independent-coupled":this.prepareIndependentCoupled(t);break;case"independent-reference":this.referenceIndependent(t);break;default:throw Error(`Regional repair has no active child during phase ${t.phase}`)}this.updateProgress()}getResult(){if(!this.solved||this.failed)throw Error("Pipeline9 bounded regional repair result requested before completion");return this.result}},$6r=[0.9,0.72],q6r=Array.from({length:16},(e,t)=>t*Math.PI/8),J6r=(e)=>e.type==="pcb_pad_trace_clearance_error"||e.type==="pcb_trace_error"&&!(Array.isArray(e.pcb_trace_ids)&&e.pcb_trace_ids.length>=2),Z6r=(e)=>{if(typeof e.pcb_pad_id=="string")return e.pcb_pad_id;if(typeof e.pcb_trace_error_id=="string"){let n=e.pcb_trace_error_id.match(/(pcb_(?:smtpad|plated_hole|hole|keepout)_\d+)$/)?.[1];if(n)return n}return(typeof e.message=="string"?e.message:"").match(/(?:pcb_smtpad|pcb_plated_hole|pcb_hole|pcb_keepout)\[#?([^\]"]+)\]/)?.[1]},eIr=(e,t)=>{if(!t)return;let n=t.startsWith("pcb_")?t:`pcb_${t}`;return e.obstacles.find((o)=>o.obstacleId===n||o.connectedTo[0]===n)},tIr=({srj:e,pcbPortId:t,z:n,portPositionMap:o})=>{let r=nd(n,e.layerCount),i=o.get(t),s=e.obstacles.filter((a)=>a.layers.includes(r)&&a.connectedTo.includes(t));return i?s.reduce((a,c)=>a?Math.hypot(c.center.x-i.x,c.center.y-i.y)<Math.hypot(a.center.x-i.x,a.center.y-i.y)?c:a:c,void 0):s[0]},nIr=({terminalObstacle:e,conflictingObstacle:t,traceRadius:n})=>{let o=Math.max(0,e.width/2-n),r=Math.max(0,e.height/2-n),i=(e.ccwRotationDegrees??0)*Math.PI/180;return $6r.flatMap((s)=>q6r.map((a)=>{let c={x:Math.cos(a)*o*s,y:Math.sin(a)*r*s},l=(d=i,{x:(h=c).x*Math.cos(d)-h.y*Math.sin(d),y:h.x*Math.sin(d)+h.y*Math.cos(d)});var h,d;return{x:e.center.x+l.x,y:e.center.y+l.y}})).sort((s,a)=>Math.hypot(a.x-t.center.x,a.y-t.center.y)-Math.hypot(s.x-t.center.x,s.y-t.center.y)).slice(0,16)},oIr=({routes:e,routeIndex:t,endpointIndex:n,point:o,bounds:r,collapseAdjacent:i})=>{let s=((_)=>_.map((p)=>({...p,route:p.route.map((m)=>({...m})),vias:p.vias.map((m)=>({...m}))})))(e),a=s[t];if(!a||a.route.length<2)return;let c=n===0?0:a.route.length-1,l=n===0?1:c-1,h=a.route[c],d=a.route[l];if(!h||!d||h.z!==d.z)return;let u=a.traceThickness/2;if(!(o.x-u<r.minX||o.x+u>r.maxX||o.y-u<r.minY||o.y+u>r.maxY)){if(a.route[c]={...h,...o},i){let _=n===0?l+1:l-1,p=a.route[_],m=a.vias.some((A)=>A.x===d.x&&A.y===d.y);if(!p||p.z!==h.z||d.pcb_port_id!==void 0||m)return;a.route[l]={...d,...o}}return s}},rIr=({srj:e,originalSrj:t,routes:n,newConnections:o,syntheticConnectionNames:r,drcEvaluator:i,effort:s=1})=>{let a=n,c=uV(i,a),l=0,h=0,d=c.length<20||n.length<=120?256:Math.max(32,Math.min(256,Math.floor(16384*Math.max(1,s)/n.length))),u=((_)=>{let p=new Map;for(let m of _.connections)for(let A of m.pointsToConnect)A.pcb_port_id&&p.set(A.pcb_port_id,A);return p})(t);for(let _=0;_<2;_++){let p=!1,m=Mle({routes:a,newConnections:o,syntheticConnectionNames:r});for(let A of c.filter(J6r)){if(l>=d)break;if(typeof A.pcb_trace_id!="string")continue;let g=m.get(A.pcb_trace_id),f=eIr(e,Z6r(A));if(g===void 0||!f)continue;let y=a[g],x=a,C=c;e:for(let b of[0,-1]){let I=b===0?y.route[0]:y.route.at(-1);if(!I||typeof I.pcb_port_id!="string")continue;let v=tIr({srj:t,pcbPortId:I.pcb_port_id,z:I.z,portPositionMap:u});if(!v||v===f)continue;let P=Math.hypot(f.width,f.height)/2+Math.hypot(v.width,v.height)/2+0.5;if(!(Math.hypot(I.x-f.center.x,I.y-f.center.y)>P))for(let M of nIr({terminalObstacle:v,conflictingObstacle:f,traceRadius:y.traceThickness/2}))for(let B of[!1,!0]){if(l>=d)break e;let T=oIr({routes:a,routeIndex:g,endpointIndex:b,point:M,bounds:e.bounds,collapseAdjacent:B});if(!T)continue;l++;let N=uV(i,T);yce(N,C)&&(x=T,C=N)}}x!==a&&(a=x,c=C,h++,p=!0)}if(!p||c.length===0)break}return{routes:a,attemptedCandidateCount:l,acceptedCandidateCount:h,remainingErrors:c}},iIr=["pcb_trace_error_id","pcb_error_id","pcb_via_trace_clearance_error_id","pcb_pad_trace_clearance_error_id"],Mje=(e,t)=>{let n=e,o=[...t].sort(([r],[i])=>i.length-r.length);for(let[r,i]of o)n=n.replaceAll(r,i);return n},zGt=(e,t)=>{let n=String(e.type??e.error_type??"unknown");if(n==="pcb_via_clearance_error")return((r,i)=>{let s=[...typeof r.pcb_trace_id=="string"?[r.pcb_trace_id]:[],...Array.isArray(r.pcb_trace_ids)?r.pcb_trace_ids.filter((h)=>typeof h=="string"):[]].map((h)=>Mje(h,i)).filter((h,d,u)=>u.indexOf(h)===d).sort(),a=r.center&&typeof r.center=="object"?r.center:r.pcb_center&&typeof r.pcb_center=="object"?r.pcb_center:void 0,c=typeof a?.x=="number"&&typeof a.y=="number"?{x:a.x,y:a.y}:void 0,l=typeof r.pcb_via_pair_net_relation=="string"?r.pcb_via_pair_net_relation:void 0;if(s.length!==0&&c&&l)return`pcb_via_clearance_error:${JSON.stringify({traceIds:s,center:c,netRelation:l})}`})(e,t);for(let r of iIr){let i=e[r];if(typeof i=="string")return`${n}:${Mje(i,t)}`}let o=Object.fromEntries(Object.entries(e).filter(([r,i])=>(r.endsWith("_id")||r.endsWith("_ids"))&&(typeof i=="string"||Array.isArray(i))).sort(([r],[i])=>r.localeCompare(i)).map(([r,i])=>[r,typeof i=="string"?Mje(i,t):i]));return`${n}:${JSON.stringify(o)}`},i$=({errors:e,baselineErrors:t,originalTraceIdByPreparedTraceId:n=new Map})=>{let o=new Set(t.filter((r)=>!((i)=>typeof i.pcb_trace_error_id=="string"&&i.pcb_trace_error_id.startsWith("missing_connection_"))(r)).map((r)=>zGt(r,new Map)));return o.delete(void 0),e.filter((r)=>{let i=zGt(r,n);return i===void 0||!o.has(i)})},F3e=1.5,sIr=({errorsWithCenters:e,traces:t,layerCount:n,defaultViaDiameter:o,connMap:r})=>{let i=((a)=>a.flatMap((c)=>{if(c.type!=="pcb_trace_error"||!Array.isArray(c.pcb_port_ids)||c.pcb_port_ids.length<4)return[];let l=c.center;return l&&typeof l=="object"&&"x"in l&&"y"in l&&typeof l.x=="number"&&typeof l.y=="number"?[{x:l.x,y:l.y}]:[]}))(e),s=new Set;for(let a=0;a<t.length;a++){let c=t[a],l=lB(c,a,n,o,r);i.some((h)=>l.some((d)=>{let u=d.route.map((p)=>p.x),_=d.route.map((p)=>p.y);return Math.min(...u)<=h.x+F3e&&Math.max(...u)>=h.x-F3e&&Math.min(..._)<=h.y+F3e&&Math.max(..._)>=h.y-F3e}))&&s.add(c.pcb_trace_id)}return s},aIr=({routes:e,otherHdRoutes:t,obstacles:n,colorMap:o,layerCount:r,connMap:i})=>{let s=abe([...e,...t],i),a=new wZe({inputHdRoutes:e,otherHdRoutes:t,netByConnectionName:s,obstacles:n,colorMap:o,layerCount:r,connMap:i});if(a.solve(),a.failed)throw Error(`Pipeline9 could not merge movable preloaded vias: ${a.error??"unknown error"}`);return a.getMergedViaHdRoutes()??e},OGt=({errors:e,circuitJson:t,newTraceIds:n})=>{let o=new Map(t.flatMap((r)=>r.type==="pcb_via"&&typeof r.pcb_via_id=="string"&&typeof r.pcb_trace_id=="string"?[[r.pcb_via_id,r.pcb_trace_id]]:[]));return e.map((r)=>{let i=typeof r.pcb_trace_id=="string"?r.pcb_trace_id:void 0,s=Array.isArray(r.pcb_trace_ids)?r.pcb_trace_ids.filter((d)=>typeof d=="string"):[],a=[...typeof r.pcb_via_id=="string"?[r.pcb_via_id]:[],...Array.isArray(r.pcb_via_ids)?r.pcb_via_ids.filter((d)=>typeof d=="string"):[]].filter((d,u,_)=>_.indexOf(d)===u);if(i&&typeof r.pcb_trace_error_id=="string"){let d=`overlap_${i}_`,u=r.pcb_trace_error_id.startsWith(d)?r.pcb_trace_error_id.slice(d.length):void 0,_=u!==void 0&&(a.includes(u)||o.has(u)&&!s.includes(u)),p=s.find((m)=>m!==i&&n.has(m))??(u&&!_?u:void 0);if(!n.has(i)&&a.length===0&&p&&n.has(p)){let m=[p,i,...s].filter((A,g,f)=>f.indexOf(A)===g);return{...r,pcb_trace_id:p,pcb_trace_ids:m,pcb_trace_error_id:`overlap_${p}_${i}`}}}let c=a.flatMap((d)=>{let u=o.get(d);return u?[u]:[]}).filter((d,u,_)=>_.indexOf(d)===u),l=c.length>0?c:s.filter((d)=>d!==i),h=l.find((d)=>n.has(d));if(h&&(!i||!n.has(i))){let d=[h,...i?[i]:[],...s,...l].filter((u,_,p)=>p.indexOf(u)===_);return{...r,pcb_trace_id:h,pcb_trace_ids:d,pcb_via_id:a[0],pcb_via_ids:a}}if(a.length>0){let d=[...i?[i]:[],...s,...l].filter((u,_,p)=>p.indexOf(u)===_);return{...r,pcb_trace_ids:d,pcb_via_id:a[0],pcb_via_ids:a}}return r})},dbe=0.000000001,VGt=(e)=>{let t=new Set,n=[];for(let o of e)for(let r of o.route){if(r.route_type!=="via")continue;let i=`${r.x},${r.y},${r.from_layer},${r.to_layer}`;t.has(i)||(t.add(i),n.push({type:"pcb_via",pcb_via_id:`via_${n.length}`,pcb_trace_id:o.pcb_trace_id}))}return n},bS=({errors:e,circuitJson:t,evaluatedTraceIds:n})=>{let o=new Map(t.flatMap((r)=>r.type==="pcb_via"&&typeof r.pcb_via_id=="string"&&typeof r.pcb_trace_id=="string"?[[r.pcb_via_id,r.pcb_trace_id]]:[]));return e.map((r)=>{let i=[...typeof r.pcb_via_id=="string"?[r.pcb_via_id]:[],...Array.isArray(r.pcb_via_ids)?r.pcb_via_ids.filter((_)=>typeof _=="string"):[]],s=typeof r.pcb_trace_id=="string"?r.pcb_trace_id:void 0,a=s?`overlap_${s}_`:void 0,c=a&&typeof r.pcb_trace_error_id=="string"&&r.pcb_trace_error_id.startsWith(a)?r.pcb_trace_error_id.slice(a.length):void 0,l=typeof r.pcb_trace_error_id=="string"?r.pcb_trace_error_id.match(/_(via_\d+)$/)?.[1]:void 0,h=i.length!==0||!l||!o.has(l)||c&&n.has(c)?void 0:l,d=[...i,...h?[h]:[]].filter((_,p,m)=>m.indexOf(_)===p),u=[...typeof r.pcb_trace_id=="string"?[r.pcb_trace_id]:[],...Array.isArray(r.pcb_trace_ids)?r.pcb_trace_ids.filter((_)=>typeof _=="string"):[],...d.flatMap((_)=>{let p=o.get(_);return p?[p]:[]})].filter((_,p,m)=>m.indexOf(_)===p);return{...r,...d.length>0?{pcb_via_id:d[0],pcb_via_ids:d}:{},...d.length>0&&u.length>0?{pcb_trace_ids:u}:{}}})},YGt=(e,t)=>Math.abs(e.x-t.x)<=dbe&&Math.abs(e.y-t.y)<=dbe&&e.z===t.z,cIr=({trace:e,sectionGroup:t,syntheticConnectionName:n,connMap:o})=>{let r=t.routes;if(r.length===0)throw Error(`Pipeline9 cannot exactly repair empty preloaded section for trace "${e.pcb_trace_id}"`);let i=[];for(let h of r){if(i.length===0){i.push(...h.route);continue}let d=i.at(-1);if(h.route[0]&&YGt(d,h.route[0]))i.push(...h.route.slice(1));else{if(!h.route.at(-1)||!YGt(d,h.route.at(-1)))throw Error(`Pipeline9 cannot reconnect preloaded trace "${e.pcb_trace_id}" for exact repair`);i.push(...h.route.slice(0,-1).reverse())}}let s=t.routePositionStart===0,a=t.routePositionEnd===e.route.length-1,c=s?e.connectsTo?.[0]:null,l=a?e.connectsTo?.at(-1):null;return c&&i[0]&&(i[0]={...i[0],pcb_port_id:c}),l&&i.at(-1)&&(i[i.length-1]={...i.at(-1),pcb_port_id:l}),{connectionName:n,rootConnectionName:o.getNetConnectedToId(e.connection_name)??e.connection_name,traceThickness:Math.max(...r.map((h)=>h.traceThickness)),viaDiameter:Math.max(...r.map((h)=>h.viaDiameter)),route:i,vias:i.slice(0,-1).flatMap((h,d)=>{let u=i[d+1];return h.z!==u.z&&(_=h,p=u,Math.abs(_.x-p.x)<=dbe&&Math.abs(_.y-p.y)<=dbe)?[{x:u.x,y:u.y}]:[];var _,p})}},lIr=({trace:e,traceIndex:t,layerCount:n,defaultViaDiameter:o,connMap:r})=>{let i=e.route.flatMap((c,l)=>c.route_type==="through_obstacle"?[l]:[]),s=new Map,a=lB(e,t,n,o,r);for(let c of a){let{preloadedRoutePositionStart:l,preloadedRoutePositionEnd:h}=c;if(l===void 0||h===void 0)throw Error(`Pipeline9 preloaded trace section is missing route positions for "${e.pcb_trace_id}"`);if(e.route[l]?.route_type==="through_obstacle")continue;let d=i.filter((_)=>_<l).length,u=s.get(d)??{routePositionStart:l,routePositionEnd:h,routes:[]};u.routePositionStart=Math.min(u.routePositionStart,l),u.routePositionEnd=Math.max(u.routePositionEnd,h),u.routes.push(c),s.set(d,u)}return[...s.values()]},GGt=(e,t)=>e.map((n)=>{let o=Array.isArray(n.pcb_trace_ids)?n.pcb_trace_ids.filter((m)=>typeof m=="string"):[],r=typeof n.pcb_trace_id=="string"?n.pcb_trace_id:void 0,i=r?`overlap_${r}_`:void 0,s=i&&typeof n.pcb_trace_error_id=="string"&&n.pcb_trace_error_id.startsWith(i)?n.pcb_trace_error_id.slice(i.length):void 0,a=[...typeof n.pcb_via_id=="string"?[n.pcb_via_id]:[],...Array.isArray(n.pcb_via_ids)?n.pcb_via_ids.filter((m)=>typeof m=="string"):[]],c=s!==void 0&&a.includes(s),l=[r,...o,c?void 0:s].filter((m)=>typeof m=="string"),h=new Map;for(let m of l){let A=t.get(m)??m,g=h.get(A)??new Set;g.add(m),h.set(A,g)}let d=[...h].flatMap(([m,A])=>A.size>1?[{solverTraceId:m,evaluationTraceIds:[...A]}]:[]),u=r?t.get(r)??r:void 0,_=o.map((m)=>t.get(m)??m),p=s?c?s:t.get(s)??s:void 0;return u!==r||_.some((m,A)=>m!==o[A])||p!==s?{...n,...r?{pcb_trace_id:u}:{},...Array.isArray(n.pcb_trace_ids)?{pcb_trace_ids:_}:{},...u&&p?{pcb_trace_error_id:`overlap_${u}_${p}`}:{},...d.length>0?{__collapsed_trace_participants:d}:{}}:n}),hIr=(e,t)=>{let n=e.hdRoute.route[0],o=e.hdRoute.route.at(-1);return{name:e.syntheticConnectionName,rootConnectionName:e.hdRoute.rootConnectionName,__netConnectionName:e.originalTrace.connection_name,nominalTraceWidth:e.hdRoute.traceThickness,pointsToConnect:[{x:n.x,y:n.y,layer:nd(n.z,t),pointId:`${e.syntheticConnectionName}:start`},{x:o.x,y:o.y,layer:nd(o.z,t),pointId:`${e.syntheticConnectionName}:end`}]}},dIr=({originalTrace:e,repairedSections:t})=>{let n=[],o=0;for(let r of[...t].sort((i,s)=>i.routePositionStart-s.routePositionStart)){if(r.routePositionStart<o)throw Error(`Pipeline9 found overlapping repaired sections for preloaded trace "${e.pcb_trace_id}"`);n.push(...e.route.slice(o,r.routePositionStart),...r.route),o=r.routePositionEnd+1}return n.push(...e.route.slice(o)),{...e,__replaces_pcb_trace_id:e.pcb_trace_id,route:n}},uIr=class extends ei{params;inputNewHdRoutes;inputUpdatedPreloadedTraces;movablePreloadedSections;fixedPreloadedObstacleRoutes;syntheticConnectionNames;exactRepairSolver;exactRepairParams;clearanceProjectionSolver;drcEvaluator;cachedReferenceDrcEvaluator;clearancePrecisionDrcEvaluator;clearancePrecisionIndexedDrcEvaluator;clearanceMarginDrcEvaluator;referenceDrcValidationCount=0;referenceDrcFalseNegativeCount=0;indexedDrcEvaluationCount=0;indexedDrcCacheHitCount=0;indexedDrcEvaluationTimeMs=0;indexedDrcCandidateCache=new Map;combinedOutput;currentPipelineStepIndex=0;regionalB01Params;boundedRegionalParams;boundedRegionalRepairStartedAt;initialBoundedRegionalRepairSolver;initialBoundedRegionalRepairStartedAt;pipelineDef=[{solverName:"clearanceProjectionSolver",createSolver:()=>{if(!this.exactRepairParams)throw Error("Pipeline9 clearance projection is missing its input");return this.clearanceProjectionSolver=new aV({originalSrj:this.params.originalSrj,routes:this.exactRepairParams.hdRoutes,drcEvaluator:this.cachedReferenceDrcEvaluator}),this.clearanceProjectionSolver},onSolved:()=>{}},{solverName:"initialBoundedRegionalRepairSolver",createSolver:()=>{if(!this.exactRepairParams||!this.cachedReferenceDrcEvaluator)throw Error("Pipeline9 initial regional repair is missing its input");return this.initialBoundedRegionalRepairStartedAt=performance.now(),this.initialBoundedRegionalRepairSolver=new FGt({connMap:this.params.connMap,originalSrj:{...this.params.originalSrj,connections:[...this.params.originalSrj.connections,...this.params.newConnections]},routes:this.clearanceProjectionSolver?.getOutput()??this.exactRepairParams.hdRoutes,viaHoleDiameter:this.params.defaultViaHoleDiameter,syntheticConnectionNames:this.syntheticConnectionNames,drcEvaluator:this.cachedReferenceDrcEvaluator,budget:NGt(this.exactRepairParams.hdRoutes.length,this.stats.initialJointDrcIssueCount,this.params.effort)}),this.initialBoundedRegionalRepairSolver},onSolved:()=>this.finishInitialBoundedRegionalRepair()},{solverName:"exactRepairSolver",createSolver:()=>{if(!this.exactRepairParams)throw Error("Pipeline9 exact repair stage is missing its input");return this.exactRepairSolver=new wrn({...this.exactRepairParams,hdRoutes:this.clearanceProjectionSolver?.getOutput()??this.exactRepairParams.hdRoutes}),this.exactRepairSolver},onSolved:()=>this.finishExactRepair()},{solverName:"regionalB01RepairSolver",createSolver:()=>{if(!this.regionalB01Params)throw Error("Pipeline9 regional B01 stage is missing its input");return this.regionalB01RepairSolver=new X6r(this.regionalB01Params),this.regionalB01RepairSolver},onSolved:()=>this.finishRegionalB01Repair()},{solverName:"boundedRegionalRepairSolver",createSolver:()=>{if(!this.boundedRegionalParams)throw Error("Pipeline9 bounded regional stage is missing its input");return this.boundedRegionalRepairStartedAt=performance.now(),this.boundedRegionalRepairSolver=new FGt(this.boundedRegionalParams),this.boundedRegionalRepairSolver},onSolved:()=>this.finishBoundedRegionalRepair()}];boundedRegionalRepairSolver;regionalB01RepairSolver;cacheIndexedDrcResult(e,t){if(this.indexedDrcCandidateCache.size>=64){let n=this.indexedDrcCandidateCache.keys().next().value;n!==void 0&&this.indexedDrcCandidateCache.delete(n)}this.indexedDrcCandidateCache.set(e,t)}constructor(e){super(),this.params=e,this.inputNewHdRoutes=e.newHdRoutes,this.inputUpdatedPreloadedTraces=e.updatedPreloadedTraces;let t=e.updatedPreloadedTraces.filter((ie)=>e.mutatedPreloadedTraceIds.has(ie.pcb_trace_id)),n=JZe({connections:e.newConnections,originalConnections:e.originalSrj.connections,layerCount:e.layerCount,obstacles:e.obstacles,defaultViaHoleDiameter:e.defaultViaHoleDiameter,connMap:e.connMap}),o=n(e.newHdRoutes),r=new Set(o.map((ie)=>ie.pcb_trace_id)),i=(({originalPreloadedTraces:ie,mutatedPreloadedTraces:le,newTraces:ue})=>{let de=new Set(ue.map((Me)=>Me.pcb_trace_id)),me=new Map(le.map((Me)=>[Me.pcb_trace_id,Me])),Ae=new Set([...ie.map((Me)=>Me.pcb_trace_id),...de]),xe=new Map;return{routedTraces:[...ie.filter((Me)=>de.has(Me.pcb_trace_id)).map((Me)=>{let Re=me.get(Me.pcb_trace_id)??Me,we=`${Me.pcb_trace_id}_preloaded`,_e=we,ye=2;for(;Ae.has(_e);)_e=`${we}_${ye}`,ye+=1;return Ae.add(_e),xe.set(_e,Me.pcb_trace_id),{...Re,pcb_trace_id:_e,__replaces_pcb_trace_id:Me.pcb_trace_id}}),...le.filter((Me)=>!de.has(Me.pcb_trace_id)),...ue],originalPreloadedTraceIdByPreparedTraceId:xe}})({originalPreloadedTraces:e.originalSrj.traces??[],mutatedPreloadedTraces:t,newTraces:o}),s=e.originalSrj.minTraceToPadEdgeClearance??WQ.traceClearance??0.1,a=WQ.viaClearance??0.1,c=e.originalSrj.minViaHoleEdgeToViaHoleEdgeClearance??WQ.viaClearance??0.1,l=Z3e({includeBoardClearance:!0,inputSrj:e.originalSrj,srjWithPointPairs:e.srjWithPointPairs,routedTraces:[],drcOptions:{traceClearance:s,viaClearance:c}}),h=new Set((e.originalSrj.traces??[]).map((ie)=>ie.pcb_trace_id)),d=bS({errors:l.errors,circuitJson:l.circuitJson,evaluatedTraceIds:h}),u=bS({errors:l.errorsWithCenters,circuitJson:l.circuitJson,evaluatedTraceIds:h}),_=Z3e({includeBoardClearance:!0,inputSrj:e.originalSrj,srjWithPointPairs:e.srjWithPointPairs,routedTraces:i.routedTraces,drcOptions:{traceClearance:s,viaClearance:c}}),p=new Set(F$e(e.originalSrj.traces??[],i.routedTraces).map((ie)=>ie.pcb_trace_id)),m=bS({errors:_.errors,circuitJson:_.circuitJson,evaluatedTraceIds:p}),A=bS({errors:_.errorsWithCenters,circuitJson:_.circuitJson,evaluatedTraceIds:p}),g={..._,errors:i$({errors:m,baselineErrors:d,originalTraceIdByPreparedTraceId:i.originalPreloadedTraceIdByPreparedTraceId}),errorsWithCenters:i$({errors:A,baselineErrors:u,originalTraceIdByPreparedTraceId:i.originalPreloadedTraceIdByPreparedTraceId})},f=(({errors:ie,circuitJson:le})=>{let ue=new Map(le.flatMap((me)=>me.type==="pcb_via"&&typeof me.pcb_via_id=="string"&&typeof me.pcb_trace_id=="string"?[[me.pcb_via_id,me.pcb_trace_id]]:[])),de=new Set;for(let me of ie){let Ae=typeof me.pcb_trace_id=="string"?me.pcb_trace_id:void 0,xe=[...typeof me.pcb_via_id=="string"?[me.pcb_via_id]:[],...Array.isArray(me.pcb_via_ids)?me.pcb_via_ids.filter((Re)=>typeof Re=="string"):[]];if(typeof me.pcb_trace_id=="string"&&de.add(me.pcb_trace_id),Array.isArray(me.pcb_trace_ids))for(let Re of me.pcb_trace_ids)typeof Re=="string"&&de.add(Re);if(typeof me.pcb_via_id=="string"){let Re=ue.get(me.pcb_via_id);Re&&de.add(Re)}if(Array.isArray(me.pcb_via_ids))for(let Re of me.pcb_via_ids){if(typeof Re!="string")continue;let we=ue.get(Re);we&&de.add(we)}let Me=Ae?`overlap_${Ae}_`:void 0;if(Me&&typeof me.pcb_trace_error_id=="string"&&me.pcb_trace_error_id.startsWith(Me)){let Re=me.pcb_trace_error_id.slice(Me.length);xe.includes(Re)||de.add(Re)}}return de})({errors:g.errors,circuitJson:g.circuitJson}),y=new Map(e.updatedPreloadedTraces.map((ie)=>[ie.pcb_trace_id,ie])),x=new Set;for(let ie of f){let le=i.originalPreloadedTraceIdByPreparedTraceId.get(ie);le&&y.has(le)?x.add(le):!r.has(ie)&&y.has(ie)&&x.add(ie)}for(let ie of sIr({errorsWithCenters:g.errorsWithCenters,traces:e.updatedPreloadedTraces,layerCount:e.layerCount,defaultViaDiameter:e.defaultViaDiameter,connMap:e.connMap}))x.add(ie);this.movablePreloadedSections=[];for(let ie of x){let le=y.get(ie);if(!le)throw Error(`Pipeline9 cannot find preloaded trace "${ie}" selected for exact repair`);let ue=e.updatedPreloadedTraces.findIndex((me)=>me.pcb_trace_id===ie),de=lIr({trace:le,traceIndex:ue,layerCount:e.layerCount,defaultViaDiameter:e.defaultViaDiameter,connMap:e.connMap});for(let[me,Ae]of de.entries()){let xe=`pipeline9_preloaded_drc_${this.movablePreloadedSections.length}`;this.movablePreloadedSections.push({originalTrace:le,originalRoutePositionStart:Ae.routePositionStart,originalRoutePositionEnd:Ae.routePositionEnd,syntheticConnectionName:xe,evaluationTraceId:`${le.pcb_trace_id}__pipeline9_section_${me}`,hdRoute:cIr({trace:le,sectionGroup:Ae,syntheticConnectionName:xe,connMap:e.connMap})})}}this.syntheticConnectionNames=new Set(this.movablePreloadedSections.map((ie)=>ie.syntheticConnectionName));let C=new Set(this.movablePreloadedSections.map((ie)=>ie.originalTrace.pcb_trace_id));this.fixedPreloadedObstacleRoutes=e.updatedPreloadedTraces.flatMap((ie,le)=>{let ue=lB(ie,le,e.layerCount,e.defaultViaDiameter,e.connMap);return C.has(ie.pcb_trace_id)?ue.filter((de)=>{let me=de.preloadedRoutePositionStart;return me!==void 0&&ie.route[me]?.route_type==="through_obstacle"}):ue});let b=new Map;for(let[ie,le]of this.movablePreloadedSections.entries()){let ue=le.originalTrace.pcb_trace_id,de=b.get(ue)??[];de.push(ie),b.set(ue,de)}for(let ie of(({errors:le,circuitJson:ue,originalTraceIdByPreparedTraceId:de})=>{let me=new Map(ue.flatMap((Ae)=>Ae.type==="pcb_via"&&typeof Ae.pcb_via_id=="string"&&typeof Ae.pcb_trace_id=="string"?[[Ae.pcb_via_id,Ae.pcb_trace_id]]:[]));return le.flatMap((Ae)=>{if(Ae.type!=="pcb_via_clearance_error"||!Array.isArray(Ae.pcb_via_ids)||typeof Ae.actual_clearance!="number"||Ae.actual_clearance>=0)return[];let xe=Ae.pcb_via_ids.flatMap((Me)=>{if(typeof Me!="string")return[];let Re=me.get(Me);return Re?[de.get(Re)??Re]:[]}).filter((Me,Re,we)=>we.indexOf(Me)===Re);return xe.length>0?[xe]:[]})})({errors:g.errors,circuitJson:g.circuitJson,originalTraceIdByPreparedTraceId:i.originalPreloadedTraceIdByPreparedTraceId})){let le=ie.flatMap((me)=>b.get(me)??[]).filter((me,Ae,xe)=>xe.indexOf(me)===Ae);if(le.length===0)continue;let ue=new Set(le),de=aIr({routes:le.map((me)=>this.movablePreloadedSections[me].hdRoute),otherHdRoutes:[...e.newHdRoutes,...this.fixedPreloadedObstacleRoutes,...this.movablePreloadedSections.flatMap((me,Ae)=>ue.has(Ae)?[]:[me.hdRoute])],obstacles:e.obstacles,colorMap:e.colorMap,layerCount:e.layerCount,connMap:e.connMap});for(let me=0;me<le.length;me++)this.movablePreloadedSections[le[me]].hdRoute=de[me]}let I=e.newHdRoutes.length+this.movablePreloadedSections.length,v=g.errors.length>=20&&I>120?Math.min(1,120*Math.max(1,e.effort)/I):1,P=g.errors.length>=200?v**2:v,M=Math.max(g.errors.length>=200?2:8,Math.floor(32*P)),B=Math.max(g.errors.length>=200?1:4,Math.floor(12*P));if(this.stats={initialJointDrcIssueCount:g.errors.length,baselineJointDrcIssueCount:l.errors.length,initialJointDrcIssueCountByType:g.errors.reduce((ie,le)=>{let ue=String(le.type??le.error_type??"unknown");return ie[ue]=(ie[ue]??0)+1,ie},{}),movablePreloadedTraceCount:C.size,movablePreloadedSectionCount:this.movablePreloadedSections.length,exactRepairConfiguredMaxIterations:M,exactRepairConfiguredViaInPadMaxIterations:M,exactRepairConfiguredBroadMaxIterations:B},g.errors.length===0)return void(this.solved=!0);let T=new Set(this.movablePreloadedSections.map((ie)=>ie.originalTrace.pcb_trace_id)),N=t.filter((ie)=>!T.has(ie.pcb_trace_id)),D=new Map(this.movablePreloadedSections.map((ie)=>[ie.syntheticConnectionName,hIr(ie,e.layerCount)])),{traces:L,...H}=e.srjWithPointPairs,V={...H,connections:[...e.srjWithPointPairs.connections,...D.values()]},O=new Hle({...V,obstacles:e.originalSrj.obstacles,minTraceWidth:e.originalSrj.minTraceWidth,minViaDiameter:e.originalSrj.minViaDiameter??e.defaultViaDiameter},{connMap:e.connMap,traceClearance:s,viaClearance:a,includeTraceViaOwnerMetadata:!0,spatialCellSize:Math.max(e.defaultViaDiameter,e.originalSrj.minTraceWidth)+Math.max(s,a)}),U=O.evaluate(e.originalSrj.traces??[]),j=VGt(e.originalSrj.traces??[]),Y={...U,errors:bS({errors:U.errors,circuitJson:j,evaluatedTraceIds:h}),errorsWithCenters:bS({errors:U.errorsWithCenters,circuitJson:j,evaluatedTraceIds:h})},X,K=(ie)=>{let le=ie.filter((_e)=>!this.syntheticConnectionNames.has(_e.connectionName)),ue=n(le),de=O$e(ue,e.originalSrj.traces??[]),me=new Set,Ae=new Map,xe=this.movablePreloadedSections.map((_e)=>{let ye=ie.find((ke)=>ke.connectionName===_e.syntheticConnectionName);if(!ye)throw Error(`Pipeline9 joint DRC repair lost preloaded section "${_e.syntheticConnectionName}"`);let Se=_e.originalTrace.pcb_trace_id;Ae.set(_e.evaluationTraceId,Se);let Ne=!me.has(Se);return me.add(Se),{..._e.originalTrace,pcb_trace_id:_e.evaluationTraceId,...Ne?{__replaces_pcb_trace_id:Se}:{__replaces_pcb_trace_id:void 0},route:k3(ye,e.layerCount,{defaultViaHoleDiameter:e.defaultViaHoleDiameter,obstacles:e.obstacles,connMap:e.connMap})}}),Me=new Map;for(let _e=0;_e<ue.length;_e++)Me.set(de[_e].pcb_trace_id,ue[_e].pcb_trace_id);for(let _e of this.movablePreloadedSections)Me.set(_e.evaluationTraceId,`${_e.syntheticConnectionName}_0`);let Re=new Set(Me.values()),we=[...N,...xe,...de];return{evaluatedTraces:F$e(e.originalSrj.traces??[],we),movableTraceIds:Re,originalTraceIdByEvaluationTraceId:Ae,routedTraces:we,solverTraceIdByEvaluationTraceId:Me}},J=({errors:ie,errorsWithCenters:le,circuitJson:ue,movableTraceIds:de,solverTraceIdByEvaluationTraceId:me})=>{let Ae=ue.map((xe)=>{if(!("pcb_trace_id"in xe)||typeof xe.pcb_trace_id!="string")return xe;let Me=me.get(xe.pcb_trace_id);return Me?{...xe,pcb_trace_id:Me}:xe});return{errors:OGt({errors:GGt(ie,me),circuitJson:Ae,newTraceIds:de}),errorsWithCenters:OGt({errors:GGt(le,me),circuitJson:Ae,newTraceIds:de})}},ee={source:im(e.originalSrj===e.srjWithPointPairs?e.originalSrj:{...e.originalSrj,connections:[...e.srjWithPointPairs.connections,...e.originalSrj.connections]}),route:im(e.srjWithPointPairs)},se=({routes:ie,hdRoutes:le},ue=!0)=>{let de=ie??le;if(!de)throw Error("Pipeline9 reference DRC repair requires HD routes");let me=K(de),Ae=Z3e({includeBoardClearance:!0,connectivityMaps:ee,inputSrj:e.originalSrj,srjWithPointPairs:e.srjWithPointPairs,routedTraces:me.routedTraces,drcOptions:{traceClearance:s,viaClearance:c,includeTraceContinuity:ue}}),xe=new Set(me.evaluatedTraces.map((ye)=>ye.pcb_trace_id)),Me=bS({errors:Ae.errors,circuitJson:Ae.circuitJson,evaluatedTraceIds:xe}),Re=bS({errors:Ae.errorsWithCenters,circuitJson:Ae.circuitJson,evaluatedTraceIds:xe}),we=i$({errors:Me,baselineErrors:d,originalTraceIdByPreparedTraceId:me.originalTraceIdByEvaluationTraceId}),_e=i$({errors:Re,baselineErrors:u,originalTraceIdByPreparedTraceId:me.originalTraceIdByEvaluationTraceId});return J({errors:we,errorsWithCenters:_e,circuitJson:Ae.circuitJson,movableTraceIds:me.movableTraceIds,solverTraceIdByEvaluationTraceId:me.solverTraceIdByEvaluationTraceId})},ne=({routes:ie,hdRoutes:le})=>{let ue=ie??le;if(!ue)throw Error("Pipeline9 cached reference DRC requires HD routes");let de=JSON.stringify(ue);if(X?.candidateKey===de)return X.result;this.referenceDrcValidationCount+=1;let me=se({traces:[],routes:ue,hdRoutes:ue});return X={candidateKey:de,result:me},me};ne.inputMode="routes-only",this.cachedReferenceDrcEvaluator=ne,this.clearancePrecisionDrcEvaluator=({routes:ie,hdRoutes:le})=>se({traces:[],routes:ie,hdRoutes:le},!1);let re=(ie)=>{let le=K(ie);return bZe(e.srjWithPointPairs,le.routedTraces,{minTraceWidth:e.originalSrj.minTraceWidth,minViaDiameter:e.originalSrj.minViaDiameter,originalSrj:e.originalSrj,includeOriginalConnections:!0,connectivityMaps:ee})},Z;this.clearanceMarginDrcEvaluator=(ie,le,ue)=>(Z?.routes!==ue&&(Z={routes:ue,circuitJson:re(ue)}),(({circuitJson:de,originalCircuitJson:me,targets:Ae})=>{let xe=new Map(de.filter((ye)=>ye.type==="pcb_trace").map((ye)=>[ye.pcb_trace_id,ye])),Me=new Map(me.filter((ye)=>ye.type==="pcb_trace").map((ye)=>[ye.pcb_trace_id,ye])),Re=de.filter((ye)=>ye.type==="pcb_via"),we=new Map;for(let ye of de)ye.type==="pcb_via"?we.set(ye.pcb_via_id,ye):ye.type==="pcb_smtpad"?we.set(ye.pcb_smtpad_id,ye):ye.type==="pcb_plated_hole"&&we.set(ye.pcb_plated_hole_id,ye);let _e=[];for(let ye of Ae){let Se=ye.type==="pcb_via_trace_clearance_error",Ne=Se?ye.pcb_via_id:ye.pcb_pad_id;if(!Se&&ye.type!=="pcb_pad_trace_clearance_error"||typeof ye.pcb_trace_id!="string"||typeof Ne!="string"||typeof ye.minimum_clearance!="number"||!Number.isFinite(ye.minimum_clearance)||ye.minimum_clearance<=0)throw Error("Pipeline9 clearance margin requires a valid target pair");let ke=Me.get(ye.pcb_trace_id),nt=me.find((Nt)=>Se?Nt.type==="pcb_via"&&Nt.pcb_via_id===Ne:Nt.type==="pcb_smtpad"&&Nt.pcb_smtpad_id===Ne||Nt.type==="pcb_plated_hole"&&Nt.pcb_plated_hole_id===Ne);if(!ke||!nt)throw Error(`Pipeline9 clearance margin has no original target ${Ne}/${ye.pcb_trace_id}`);let dt=xe.get(ye.pcb_trace_id),rt=we.get(Ne);if(Se){if(nt.type!=="pcb_via"||typeof nt.pcb_trace_id!="string")throw Error("Pipeline9 clearance margin requires the original via owner");let Nt=Me.get(nt.pcb_trace_id);if(!Nt)throw Error("Pipeline9 clearance margin lost the original via owner");let Ht=Nt.route.filter((Le)=>Le.route_type==="via"),Tt=Ht.map((Le,Ze)=>({segment:Le,index:Ze})).filter(({segment:Le})=>Le.x===nt.x&&Le.y===nt.y&&nt.layers.includes(Le.from_layer)&&nt.layers.includes(Le.to_layer)).filter(({segment:Le},Ze,$e)=>$e.findIndex((qe)=>qe.segment.from_layer===Le.from_layer&&qe.segment.to_layer===Le.to_layer)===Ze);if(Tt.length===0)throw Error("Pipeline9 clearance margin lost the original via transition");if(Tt.length!==1)return{status:"unsupported-identity"};let et=Tt[0].index,vt=xe.get(nt.pcb_trace_id),ht=vt?.route.filter((Le)=>Le.route_type==="via");if(!ht||ht.length!==Ht.length||ht.some((Le,Ze)=>Le.from_layer!==Ht[Ze].from_layer||Le.to_layer!==Ht[Ze].to_layer))return{status:"unsupported-identity"};let We=ht[et];rt=Re.filter((Le)=>Le.x===We.x&&Le.y===We.y&&Le.layers.join()===nt.layers.join()).reduce((Le,Ze)=>!Le||Ze.outer_diameter>Le.outer_diameter?Ze:Le,void 0)}if(!(dt&&rt&&("x"in rt)&&("y"in rt)))return{status:"unsupported-identity"};let mt={minClearance:ye.minimum_clearance+1},lt=Se?Ten([dt,rt],mt):Ben([dt,rt],mt),Ct=ye.minimum_clearance+hbe;for(let Nt of lt){let Ht=Nt.actual_clearance;if(typeof Ht!="number"||!Number.isFinite(Ht))throw Error("Pipeline9 clearance margin requires a finite measurement");Ht>=Ct||_e.push({...ye,...rt.type==="pcb_via"?{pcb_via_id:rt.pcb_via_id,pcb_via_ids:[rt.pcb_via_id]}:{},actual_clearance:Ht,minimum_clearance:Ct,center:{x:rt.x,y:rt.y}})}}return{status:"measured",errors:_e}})({circuitJson:re(ie),originalCircuitJson:Z.circuitJson,targets:le})),this.clearancePrecisionIndexedDrcEvaluator=({routes:ie,hdRoutes:le})=>{let ue=ie??le;if(!ue)throw Error("Pipeline9 clearance ranking requires HD routes");let de=K(ue);return O.evaluate(de.evaluatedTraces)};let te=({routes:ie,hdRoutes:le})=>{let ue=ie??le;if(!ue)throw Error("Pipeline9 joint DRC repair requires HD routes");let de=JSON.stringify(ue),me=this.indexedDrcCandidateCache.get(de);if(me!==void 0)return this.indexedDrcCacheHitCount+=1,me;let Ae=performance.now();this.indexedDrcEvaluationCount+=1;let xe=K(ue),Me=O.evaluate(xe.evaluatedTraces),Re=VGt(xe.evaluatedTraces),we=new Set(xe.evaluatedTraces.map((nt)=>nt.pcb_trace_id)),_e=bS({errors:Me.errors,circuitJson:Re,evaluatedTraceIds:we}),ye=bS({errors:Me.errorsWithCenters,circuitJson:Re,evaluatedTraceIds:we}),Se=i$({errors:_e,baselineErrors:Y.errors,originalTraceIdByPreparedTraceId:xe.originalTraceIdByEvaluationTraceId}),Ne=i$({errors:ye,baselineErrors:Y.errorsWithCenters,originalTraceIdByPreparedTraceId:xe.originalTraceIdByEvaluationTraceId});if(Se.length===0){let nt=this.referenceDrcValidationCount,dt=ne({traces:[],routes:ue,hdRoutes:ue}),rt=Array.isArray(dt)?dt:dt.errors;return this.referenceDrcValidationCount>nt&&rt.length>0&&(this.referenceDrcFalseNegativeCount+=1),this.indexedDrcEvaluationTimeMs+=performance.now()-Ae,this.cacheIndexedDrcResult(de,dt),dt}let ke=J({errors:Se,errorsWithCenters:Ne,circuitJson:Re,movableTraceIds:xe.movableTraceIds,solverTraceIdByEvaluationTraceId:xe.solverTraceIdByEvaluationTraceId});return this.indexedDrcEvaluationTimeMs+=performance.now()-Ae,this.cacheIndexedDrcResult(de,ke),ke};te.inputMode="routes-only",this.drcEvaluator=te,this.exactRepairParams={srj:V,hdRoutes:[...e.newHdRoutes,...this.movablePreloadedSections.map((ie)=>ie.hdRoute)],connMap:e.connMap,effort:e.effort,viaHoleDiameter:e.defaultViaHoleDiameter,drcEvaluator:te,viaInPadDrcEvaluator:te,maxIterations:M,enableBroadFallback:!1,enableLargeBoardBroadFallback:!1,enableTargetedErrorSweep:!0,enableTraceViaOwnerTargeting:!0,enablePostSolveClearanceRelaxation:!1,enableSafeTraceLayerMoves:!0,enableViaInPadLayerMoves:e.originalSrj.allowViaInPad??!1,viaInPadMaxIterations:M,broadMaxIterations:B,broadPassMultiplier:3*P},(e.updatedPreloadedTraces.length>0||(e.originalSrj.traces?.length??0)>0)&&this.pipelineDef.splice(1,1),(e.updatedPreloadedTraces.length>0||!e.obstacles.some((ie)=>ie.isNonPlatedHole))&&(this.currentPipelineStepIndex=1),this.activeSubSolver=this.pipelineDef[this.currentPipelineStepIndex].createSolver(),this.MAX_ITERATIONS=this.activeSubSolver.MAX_ITERATIONS+1}getSolverName(){return"Pipeline9JointDrcRepairSolver"}_step(){let e=this.pipelineDef[this.currentPipelineStepIndex];if(e){if(this.activeSubSolver){let t=this.activeSubSolver;return t.step(),this.MAX_ITERATIONS=Math.max(this.MAX_ITERATIONS,this.iterations+t.MAX_ITERATIONS-t.iterations+2),void(t.failed?(this.failed=!0,this.error=t.error,this.activeSubSolver=null):t.solved&&(e.onSolved(),this.activeSubSolver=null,this.currentPipelineStepIndex++))}this.activeSubSolver=e.createSolver(),this.MAX_ITERATIONS=Math.max(this.MAX_ITERATIONS,this.iterations+this.activeSubSolver.MAX_ITERATIONS+2)}else this.solved=!0}computeProgress(){return this.solved?1:Math.max(this.progress,(this.currentPipelineStepIndex+(this.activeSubSolver?.progress??0))/this.pipelineDef.length)}getCurrentPhase(){return this.pipelineDef[this.currentPipelineStepIndex]?.solverName??"none"}finishInitialBoundedRegionalRepair(){if(!this.initialBoundedRegionalRepairSolver?.solved||this.initialBoundedRegionalRepairStartedAt===void 0||!this.cachedReferenceDrcEvaluator)throw Error("Pipeline9 initial regional repair is not complete");let e=this.initialBoundedRegionalRepairSolver.getResult();if(this.stats={...this.stats,initialBoundedRegionalRepairAccepted:!1,initialBoundedRegionalRepairAttemptedRegionCount:e.attemptedRegionCount,initialBoundedRegionalRepairAcceptedRegionCount:e.acceptedRegionCount,initialBoundedRegionalRepairCandidateAttemptCount:e.candidateAttemptCount,initialBoundedRegionalRepairPathSearchNodeCount:e.pathSearchNodeCount,initialBoundedRegionalRepairReferenceValidationCount:e.referenceValidationCount,initialBoundedRegionalRepairPublishedDrcIssueCount:e.publishedDrcIssueCount,initialBoundedRegionalRepairTimeMs:performance.now()-this.initialBoundedRegionalRepairStartedAt},e.publishedDrcIssueCount!==0)return;let t=this.cachedReferenceDrcEvaluator({traces:[],routes:e.routes,hdRoutes:e.routes});if((Array.isArray(t)?t:t.errors).length!==0)throw Error("Pipeline9 initial regional repair lost its zero-DRC validation");this.combinedOutput=e.routes,this.stats={...this.stats,finalDrcIssueCount:0,initialBoundedRegionalRepairAccepted:!0,boundedRegionalRepairMaxRegions:this.initialBoundedRegionalRepairSolver.budget.maxRegions,boundedRegionalRepairMaxCandidateAttempts:this.initialBoundedRegionalRepairSolver.budget.maxCandidateAttempts,boundedRegionalRepairMaxPathSearchNodes:this.initialBoundedRegionalRepairSolver.budget.maxPathSearchNodes,boundedRegionalRepairAttemptedRegionCount:e.attemptedRegionCount,boundedRegionalRepairAcceptedRegionCount:e.acceptedRegionCount,boundedRegionalRepairCandidateAttemptCount:e.candidateAttemptCount,boundedRegionalRepairPathSearchNodeCount:e.pathSearchNodeCount,boundedRegionalRepairReferenceValidationCount:e.referenceValidationCount,boundedRegionalRepairRepaired:e.repaired,boundedRegionalRepairPublishedDrcIssueCount:e.publishedDrcIssueCount,initialBoundedRegionalRepairAddedViaCount:Math.max(0,e.routes.reduce((n,o)=>n+o.vias.length,0)-this.inputNewHdRoutes.reduce((n,o)=>n+o.vias.length,0)),terminalEscapeCandidateCount:0,terminalEscapeAcceptedCount:0,regionalB01RepairAttempted:!1,regionalB01RepairCandidateSearchCount:0,regionalB01RepairCandidateSearchBudget:0,clearancePrecisionCandidateCount:0,clearancePrecisionCandidateValidationCount:0,clearancePrecisionReferenceValidationCount:0,clearancePrecisionRepaired:!1,referenceDrcValidationCount:this.referenceDrcValidationCount,referenceDrcFalseNegativeCount:this.referenceDrcFalseNegativeCount,indexedDrcEvaluationCount:this.indexedDrcEvaluationCount,indexedDrcCacheHitCount:this.indexedDrcCacheHitCount,indexedDrcEvaluationTimeMs:this.indexedDrcEvaluationTimeMs,indexedDrcCandidateCacheSize:this.indexedDrcCandidateCache.size,indexedDrcCandidateCacheCapacity:64},this.solved=!0}finishExactRepair(){if(!this.exactRepairSolver)throw Error("Pipeline9 post-exact repair requires the exact solver");let e=this.exactRepairSolver.getOutput(),t=this.exactRepairSolver.stats.finalDrcIssueCount,n=typeof t=="number"&&Number.isFinite(t)&&t>=0?t:void 0,o,r=0,i=0,s=0,a=!1,c=this.cachedReferenceDrcEvaluator({traces:[],routes:e,hdRoutes:e}),l=Array.isArray(c)?c:c.errors;if(o=l.length,l.length>0){let u=(({srj:_,routes:p,newConnections:m,syntheticConnectionNames:A,connMap:g,indexedDrcEvaluator:f,candidateDrcEvaluator:y,marginDrcEvaluator:x,drcEvaluator:C,initialErrors:b,initialErrorsWithCenters:I=b})=>{let v={routes:p,attemptedCandidateCount:0,candidateValidationCount:0,referenceValidationCount:0,repaired:!1};if((_.traces?.length??0)>0||A.size>0)return v;if(b.length===0)return v;let P=Mle({routes:p,newConnections:m,syntheticConnectionNames:A}),M=new Map;for(let Y of _.obstacles)for(let X of[Y.obstacleId,Y.circuitJsonMetadata?.pcb_smtpad_id,Y.circuitJsonMetadata?.pcb_plated_hole_id,Y.connectedTo[0]])typeof X=="string"&&M.set(X,Y.center);let B=Eje({errors:b,errorsWithCenters:I,routeIndexByTraceId:P,padPositionById:M});if(!B)return v;let T=B,N=B.errors,D=B.errors.map((Y)=>({...Y,minimum_clearance:Y.minimum_clearance+hbe})),L=DGt(D);if(L===void 0)return v;let H={errors:D,deficit:L},V=p,O=0,U=0,j=0;for(let Y=0;Y<8;Y++){let X=new Map;for(let ie of[...H.errors,...T.errors]){let le=JSON.stringify([ie.type,ie.pcb_trace_id,ie.pcb_pad_id,ie.pcb_via_id]);X.set(le,ie)}let K=[...X.values()],J;for(let ie of z6r){let le=jb(V);if(!FKe(_,le,K,P,ie,g,!0,!0,!0,!1))continue;let ue=q9(le);O++;let de=f({traces:[],routes:ue,hdRoutes:ue}),me=DGt(Array.isArray(de)?de:de.errors);me!==void 0&&(!J||me<J.deficit)&&(J={routes:ue,deficit:me})}if(!J)break;U++;let ee=y({traces:[],routes:J.routes,hdRoutes:J.routes}),se=Array.isArray(ee)?ee:ee.errors,ne=Eje({errors:se,errorsWithCenters:Array.isArray(ee)?ee:ee.errorsWithCenters??ee.errors,routeIndexByTraceId:P,padPositionById:M});if(!ne)break;let re=x(J.routes,N,p);if(re.status==="unsupported-identity")break;let Z=re.errors,te=Eje({errors:Z,errorsWithCenters:Z,routeIndexByTraceId:P,padPositionById:M});if(!te)break;if(se.length===0&&Z.length===0){j++;let ie=C({traces:[],routes:J.routes,hdRoutes:J.routes});if((Array.isArray(ie)?ie:ie.errors).length===0)return{routes:J.routes,attemptedCandidateCount:O,candidateValidationCount:U,referenceValidationCount:j,repaired:!0};break}if(ne.deficit+te.deficit>=T.deficit+H.deficit-0.000000001)break;V=J.routes,T=ne,H=te}return{routes:p,attemptedCandidateCount:O,candidateValidationCount:U,referenceValidationCount:j,repaired:!1}})({srj:this.params.srj,routes:e,newConnections:this.params.newConnections,syntheticConnectionNames:this.syntheticConnectionNames,connMap:this.params.connMap,indexedDrcEvaluator:this.clearancePrecisionIndexedDrcEvaluator,candidateDrcEvaluator:this.clearancePrecisionDrcEvaluator,marginDrcEvaluator:this.clearanceMarginDrcEvaluator,drcEvaluator:this.cachedReferenceDrcEvaluator,initialErrors:l,initialErrorsWithCenters:Array.isArray(c)?c:c.errorsWithCenters??c.errors});r=u.attemptedCandidateCount,i=u.candidateValidationCount,s=u.referenceValidationCount,a=u.repaired,u.repaired&&(e=u.routes,o=0)}if(o===0)return this.combinedOutput=e,this.stats={...this.stats,...this.exactRepairSolver.stats,postExactIndexedDrcIssueCount:n,postExactReferenceValidationAttempted:!0,postExactReferenceDrcIssueCount:0,postExactReferenceAccepted:!0,clearancePrecisionCandidateCount:r,clearancePrecisionCandidateValidationCount:i,clearancePrecisionReferenceValidationCount:s,clearancePrecisionRepaired:a,boundedRegionalRepairMaxRegions:0,boundedRegionalRepairMaxCandidateAttempts:0,boundedRegionalRepairMaxPathSearchNodes:0,boundedRegionalRepairAttemptedRegionCount:0,boundedRegionalRepairAcceptedRegionCount:0,boundedRegionalRepairCandidateAttemptCount:0,boundedRegionalRepairPathSearchNodeCount:0,boundedRegionalRepairReferenceValidationCount:0,boundedRegionalRepairRepaired:!1,boundedRegionalRepairTimeMs:0,regionalB01RepairCandidateCount:0,regionalB01RepairAcceptedCount:0,regionalB01RepairFallbackCandidateCount:0,regionalB01RepairCandidateSearchCount:0,regionalB01RepairCandidateSearchBudget:0,regionalB01RepairCandidateSearchBudgetExhausted:!1,regionalB01RepairSafeTraceLayerSkippedForBudget:!1,regionalB01RepairRemainingDrcIssueCount:0,regionalB01RepairPreloadEligibleDrcIssueCount:0,regionalB01RepairAttempted:!1,regionalB01RepairTraceIdCount:0,terminalEscapeCandidateCount:0,terminalEscapeAcceptedCount:0,referenceDrcValidationCount:this.referenceDrcValidationCount,referenceDrcFalseNegativeCount:this.referenceDrcFalseNegativeCount,indexedDrcEvaluationCount:this.indexedDrcEvaluationCount,indexedDrcCacheHitCount:this.indexedDrcCacheHitCount,indexedDrcEvaluationTimeMs:this.indexedDrcEvaluationTimeMs,indexedDrcCandidateCacheSize:this.indexedDrcCandidateCache.size,indexedDrcCandidateCacheCapacity:64},void(this.solved=!0);let h=rIr({srj:this.params.srj,originalSrj:this.params.originalSrj,routes:e,newConnections:this.params.newConnections,syntheticConnectionNames:this.syntheticConnectionNames,drcEvaluator:this.drcEvaluator,effort:this.params.effort}),d=(({routes:u,newConnections:_,syntheticConnectionNames:p,fixedPreloadedObstacleRoutes:m,updatedPreloadedTraces:A})=>{let g=new Set,f=Object.assign(new Set,{collidingFixedTraceIds:g}),y=Mle({routes:u,newConnections:_,syntheticConnectionNames:p}),x=new Set;for(let[C,b]of y)p.has(u[b].connectionName)?f.add(C):x.add(C);for(let C of m){let b=A[C.preloadedTraceIndex];if(!b)throw Error(`Pipeline9 fixed preload route has invalid trace index ${C.preloadedTraceIndex}`);x.has(b.pcb_trace_id)?g.add(b.pcb_trace_id):f.add(b.pcb_trace_id)}return f})({routes:h.routes,newConnections:this.params.newConnections,syntheticConnectionNames:this.syntheticConnectionNames,fixedPreloadedObstacleRoutes:this.fixedPreloadedObstacleRoutes,updatedPreloadedTraces:this.params.updatedPreloadedTraces});this.regionalB01Params={srj:this.params.srj,routes:h.routes,fixedObstacleRoutes:this.fixedPreloadedObstacleRoutes,newConnections:this.params.newConnections,syntheticConnectionNames:this.syntheticConnectionNames,drcEvaluator:this.drcEvaluator,initialErrors:h.remainingErrors,allowTracePairRepair:!0,preloadRepairTraceIds:d,connMap:this.params.connMap,colorMap:this.params.colorMap,viaDiameter:this.params.defaultViaDiameter,traceWidth:this.params.srj.minTraceWidth,obstacleMargin:this.params.srj.defaultObstacleMargin??this.params.srj.minTraceToPadEdgeClearance??0.15,effort:this.params.effort},this.stats={...this.stats,...this.exactRepairSolver.stats,postExactIndexedDrcIssueCount:n,postExactReferenceValidationAttempted:!0,postExactReferenceDrcIssueCount:o,postExactReferenceAccepted:!1,clearancePrecisionCandidateCount:r,clearancePrecisionCandidateValidationCount:i,clearancePrecisionReferenceValidationCount:s,clearancePrecisionRepaired:a,regionalB01RepairTraceIdCount:d.size+(d.collidingFixedTraceIds?.size??0),terminalEscapeCandidateCount:h.attemptedCandidateCount,terminalEscapeAcceptedCount:h.acceptedCandidateCount}}finishRegionalB01Repair(){if(!this.regionalB01RepairSolver?.solved)throw Error("Pipeline9 regional B01 stage must solve before completion");let e=this.regionalB01RepairSolver.getResult(),t=this.cachedReferenceDrcEvaluator({traces:[],routes:e.routes,hdRoutes:e.routes}),n=NGt(e.routes.length,(Array.isArray(t)?t:t.errors).length,this.params.effort);this.boundedRegionalParams={connMap:this.params.connMap,originalSrj:{...this.params.originalSrj,connections:[...this.params.originalSrj.connections,...this.params.newConnections]},routes:e.routes,viaHoleDiameter:this.params.defaultViaHoleDiameter,syntheticConnectionNames:this.syntheticConnectionNames,drcEvaluator:this.cachedReferenceDrcEvaluator,budget:n}}finishBoundedRegionalRepair(){if(!this.boundedRegionalRepairSolver?.solved||!this.regionalB01RepairSolver?.solved||!this.boundedRegionalParams?.budget||this.boundedRegionalRepairStartedAt===void 0)throw Error("Pipeline9 bounded regional stage is missing its completed inputs");let e=this.regionalB01RepairSolver.getResult(),t=this.boundedRegionalRepairSolver.getResult(),n=this.boundedRegionalParams.budget;this.combinedOutput=t.routes,this.stats={...this.stats,boundedRegionalRepairMaxRegions:n.maxRegions,boundedRegionalRepairMaxCandidateAttempts:n.maxCandidateAttempts,boundedRegionalRepairMaxPathSearchNodes:n.maxPathSearchNodes,boundedRegionalRepairAttemptedRegionCount:t.attemptedRegionCount,boundedRegionalRepairAcceptedRegionCount:t.acceptedRegionCount,boundedRegionalRepairCandidateAttemptCount:t.candidateAttemptCount,boundedRegionalRepairPathSearchNodeCount:t.pathSearchNodeCount,boundedRegionalRepairReferenceValidationCount:t.referenceValidationCount,boundedRegionalRepairRepaired:t.repaired,boundedRegionalRepairPublishedDrcIssueCount:t.publishedDrcIssueCount,boundedRegionalRepairTimeMs:performance.now()-this.boundedRegionalRepairStartedAt,regionalB01RepairCandidateCount:e.attemptedCandidateCount,regionalB01RepairAcceptedCount:e.acceptedCandidateCount,regionalB01RepairFallbackCandidateCount:e.fallbackCandidateCount,regionalB01RepairCandidateSearchCount:e.candidateSearchCount,regionalB01RepairCandidateSearchBudget:e.candidateSearchBudget,regionalB01RepairCandidateSearchBudgetExhausted:e.candidateSearchBudgetExhausted,regionalB01RepairSafeTraceLayerSkippedForBudget:e.safeTraceLayerRepairSkippedForBudget,regionalB01RepairRemainingDrcIssueCount:e.remainingDrcIssueCount,regionalB01RepairPreloadEligibleDrcIssueCount:e.preloadEligibleDrcIssueCount,regionalB01RepairAttempted:e.preloadRepairAttempted,referenceDrcValidationCount:this.referenceDrcValidationCount,referenceDrcFalseNegativeCount:this.referenceDrcFalseNegativeCount,indexedDrcEvaluationCount:this.indexedDrcEvaluationCount,indexedDrcCacheHitCount:this.indexedDrcCacheHitCount,indexedDrcEvaluationTimeMs:this.indexedDrcEvaluationTimeMs,indexedDrcCandidateCacheSize:this.indexedDrcCandidateCache.size,indexedDrcCandidateCacheCapacity:64},this.solved=!0}getCombinedOutput(){return this.combinedOutput??this.exactRepairSolver?.getOutput()??this.inputNewHdRoutes}getOutput(){return this.getCombinedOutput().filter((e)=>!this.syntheticConnectionNames.has(e.connectionName))}getUpdatedPreloadedTraces(){let e=new Map(this.getCombinedOutput().map((o)=>[o.connectionName,o])),t=new Map;for(let o of this.movablePreloadedSections){let r=e.get(o.syntheticConnectionName);if(!r)throw Error(`Pipeline9 joint DRC repair output is missing "${o.syntheticConnectionName}"`);let i=o.originalTrace.pcb_trace_id,s=t.get(i)??[];s.push({routePositionStart:o.originalRoutePositionStart,routePositionEnd:o.originalRoutePositionEnd,route:k3(r,this.params.layerCount,{defaultViaHoleDiameter:this.params.defaultViaHoleDiameter,obstacles:this.params.obstacles,connMap:this.params.connMap})}),t.set(i,s)}let n=new Map([...t].map(([o,r])=>{let i=this.inputUpdatedPreloadedTraces.find((s)=>s.pcb_trace_id===o);if(!i)throw Error(`Pipeline9 cannot find preloaded trace "${o}" while rebuilding repaired sections`);return[o,dIr({originalTrace:i,repairedSections:r})]}));return this.inputUpdatedPreloadedTraces.map((o)=>n.get(o.pcb_trace_id)??o)}getMutatedPreloadedTraces(){let e=new Set([...this.params.mutatedPreloadedTraceIds,...this.movablePreloadedSections.map((t)=>t.originalTrace.pcb_trace_id)]);return this.getUpdatedPreloadedTraces().filter((t)=>e.has(t.pcb_trace_id))}visualize(){return this.exactRepairSolver?.visualize()??{}}},icn=0.000001,UGt=(e,t,n)=>{let o=si(e,n),r=si(t,n);return Array.from({length:Math.abs(r-o)+1},(i,s)=>Math.min(o,r)+s)},WGt=(e)=>e.route_type==="wire",pIr=(e,t,n)=>e.portPoints.filter((o)=>o.availableZ.includes(n)&&!(o._preloadedTracePortAssignments??[]).some((r)=>r.z===n&&r.fixedNetId!==t.fixedNetId)).map((o)=>({portPoint:o,distance:xc(o,t.start,t.end)})).sort((o,r)=>o.distance-r.distance||o.portPoint.distToCentermostPortOnZ-r.portPoint.distToCentermostPortOnZ||o.portPoint.segmentPortPointId.localeCompare(r.portPoint.segmentPortPointId))[0]?.portPoint,mIr=(e,t,n)=>{e._preloadedFixedNetIds=[...new Set([...e._preloadedFixedNetIds??[],t.fixedNetId])].sort();let o=t.end.x-t.start.x,r=t.end.y-t.start.y,i=o*o+r*r,s=i===0?0:Math.max(0,Math.min(1,((e.x-t.start.x)*o+(e.y-t.start.y)*r)/i)),a={traceId:t.traceId,fixedNetId:t.fixedNetId,routePosition:t.routePositionStart+s*(t.routePositionEnd-t.routePositionStart),tracePoint:{x:t.start.x+s*o,y:t.start.y+s*r},z:n},c=e._preloadedTracePortAssignments??[];c.some((l)=>l.traceId===a.traceId&&l.fixedNetId===a.fixedNetId&&l.z===a.z&&Math.abs(l.routePosition-a.routePosition)<=icn)||(e._preloadedTracePortAssignments=[...c,a].sort((l,h)=>l.traceId.localeCompare(h.traceId)||l.routePosition-h.routePosition||l.z-h.z))},_Ir=class extends ei{constructor(e,t){super(),this.sharedEdgeSegments=e,this.srj=t,this.MAX_ITERATIONS=1,this.primitives=((n)=>{let o=[],r=im(n);for(let i of n.traces??[]){if(!i.connection_name)throw Error(`Preloaded trace "${i.pcb_trace_id}" is missing a connection name`);let s=r.getNetConnectedToId(i.connection_name)??i.connection_name;for(let[a,c]of i.route.entries())if(c.route_type==="via")o.push({traceId:i.pcb_trace_id,fixedNetId:s,connectionName:i.connection_name,routePositionStart:a,routePositionEnd:a,zLayers:UGt(c.from_layer,c.to_layer,n.layerCount),start:c,end:c});else if(c.route_type==="through_obstacle")o.push({traceId:i.pcb_trace_id,fixedNetId:s,connectionName:i.connection_name,routePositionStart:a,routePositionEnd:a+1,zLayers:UGt(c.from_layer,c.to_layer,n.layerCount),start:c.start,end:c.end});else if(c.route_type==="jumper"){let l=si(c.layer,n.layerCount);for(let[h,d]of[c.start,c.end].entries())o.push({traceId:i.pcb_trace_id,fixedNetId:s,connectionName:i.connection_name,routePositionStart:a+h,routePositionEnd:a+h,zLayers:[l],start:d,end:d})}for(let a=0;a<i.route.length-1;a++){let c=i.route[a],l=i.route[a+1];WGt(c)&&WGt(l)&&c.layer===l.layer&&o.push({traceId:i.pcb_trace_id,fixedNetId:s,connectionName:i.connection_name,routePositionStart:a,routePositionEnd:a+1,zLayers:[si(c.layer,n.layerCount)],start:c,end:l})}}return o})(t)}sharedEdgeSegments;srj;primitives;getSolverName(){return"PreloadedTraceGraphSolver"}_step(){for(let n of this.primitives)for(let o of this.sharedEdgeSegments)if(!(MV(n.start,n.end,o.start,o.end)>icn))for(let r of n.zLayers){if(!o.availableZ.includes(r))continue;let i=pIr(o,n,r);i&&mIr(i,n,r)}let e=this.sharedEdgeSegments.flatMap((n)=>n.portPoints),t=e.filter((n)=>(n._preloadedFixedNetIds?.length??0)>0);this.stats={preloadedTraceCount:this.srj.traces?.length??0,preloadedTraceShapeCount:this.primitives.length,inputBoundaryCount:this.sharedEdgeSegments.length,outputBoundaryCount:this.sharedEdgeSegments.length,inputPortCount:e.length,outputPortCount:e.length,preloadedPortCount:t.length,tracePortAssignmentCount:t.reduce((n,o)=>n+(o._preloadedTracePortAssignments?.length??0),0),topologyChanged:!1},this.solved=!0}getOutput(){if(!this.solved)throw Error("PreloadedTraceGraphSolver has not solved yet");return this.sharedEdgeSegments}},gIr=class extends r6e{_step(){if(this.error=T$e(this.inputSrj),this.error)return void(this.failed=!0);let{traces:e,...t}=this.inputSrj,n=oP(t),o=oP(ian(san(n)));this.error=T$e(o),this.error?this.failed=!0:(this.outputSrj=e===void 0?o:{...o,traces:e},this.solved=!0)}};function XGt(e){return new Set((e??[]).filter((t)=>t._isComponentTopologyNode).map((t)=>t.capacityMeshNodeId))}function scn(e,t){return e.nodeIds.some((n)=>t.has(n))}function AIr({sharedEdgeSegments:e,componentCapacityMeshNodeIds:t}){return e.filter((n)=>!scn(n,t))}function f0(e,t,n,o={}){return{solverName:e,solverClass:t,getConstructorParams:n,onSolved:o.onSolved}}var ehe=class extends ei{constructor(e,t={}){super(),this.srj=e,this.opts=t;let n=oP(e);this.originalSrj=n,this.opts={...t};let o=this.opts;if(this.effort=o.effort??1,this.MAX_ITERATIONS=1e8*this.effort,this.maxNodeDimension=o.maxNodeDimension??15,this.maxNodeRatio=o.maxNodeRatio??6,this.minNodeArea=o.minNodeArea??0.010000000000000002,this.visualizationTraceColorMode=o.visualizationTraceColorMode??"layer",this.setSimpleRouteJson(n),o.capacityDepth===void 0){let r=this.srj.bounds.maxX-this.srj.bounds.minX,i=this.srj.bounds.maxY-this.srj.bounds.minY,s=Math.max(r,i),a=o.targetMinCapacity??0.5;o.capacityDepth=ik(s,a)}this.cacheProvider=o.cacheProvider===void 0?hv():o.cacheProvider===null?null:o.cacheProvider,this.startTimeOfPhase={},this.endTimeOfPhase={},this.timeSpentOnPhase={}}srj;opts;getSolverName(){return"AutoroutingPipelineSolver9_PreloadedTraceGraph"}preprocessSimpleRouteJsonSolver;escapeViaLocationSolver;netToPointPairsSolver;componentTopologyGeneratorSolver;topologyPlanningSolver;topologyMergingSolver;globalTopologyGeneratorSolver;nodeDimensionSubdivisionSolver;nodeTargetMerger;edgeSolver;colorMap;highDensityRouteSolver;highDensityForceImproveSolver;highDensityRepairSolver;highDensityStitchSolver;globalDrcForceImproveSolver;pipeline9JointDrcRepairSolver;singleLayerNodeMerger;strawSolver;deadEndSolver;traceSimplificationSolver;mutatedPreloadedTraceSimplificationSolver;lengthMatchingPostProcessingSolver;powerTraceExpansionSolver;availableSegmentPointSolver;portPointPathingSolver;multiSectionPortPointOptimizer;uniformPortDistributionSolver;traceWidthSolver;necessaryCrampedPortPointSolver;preloadedTraceGraphSolver;componentDetectionSolver;viaDiameter;viaHoleDiameter;minTraceWidth;effort;effortCleanupSolver;maxNodeDimension;maxNodeRatio;minNodeArea;visualizationTraceColorMode;startTimeOfPhase;endTimeOfPhase;timeSpentOnPhase;activeSubSolver=null;connMap;srjWithEscapeViaLocations;srjWithPointPairs;originalSrj;capacityNodes=null;capacityEdges=null;sharedEdgeSegmentsWithNecessaryCrampedPortPoints;highDensityNodePortPoints;cacheProvider=null;pipelineDef=[f0("preprocessSimpleRouteJsonSolver",gIr,(e)=>[e.originalSrj,{traceColorMode:e.visualizationTraceColorMode}],{onSolved:(e)=>{e.setSimpleRouteJson(e.preprocessSimpleRouteJsonSolver.getOutputSimpleRouteJson())}}),f0("componentDetectionSolver",van,(e)=>[{inputSrj:e.srj}]),f0("escapeViaLocationSolver",t6e,(e)=>[e.srj,{viaDiameter:e.viaDiameter,minTraceWidth:e.minTraceWidth,obstacleMargin:e.srj.defaultObstacleMargin??0.15}],{onSolved:(e)=>{e.srjWithEscapeViaLocations=e.escapeViaLocationSolver?.getOutputSimpleRouteJson()}}),f0("netToPointPairsSolver",Vq,(e)=>{let t=e.srjWithEscapeViaLocations??e.srj;return[t,e.colorMap,nk(t)]},{onSolved:(e)=>{e.srjWithPointPairs=e.netToPointPairsSolver?.getNewSimpleRouteJson(),e.colorMap=JA(e.srjWithPointPairs,e.connMap),e.connMap=im(e.srjWithPointPairs)}}),f0("topologyPlanningSolver",Man,(e)=>[{inputSrj:e.srjWithPointPairs,componentDetectionOutput:e.componentDetectionSolver.getOutput(),viaDiameter:e.viaDiameter,obstacleMargin:e.srj.defaultObstacleMargin??0.15}],{onSolved:(e)=>{e.topologyPlanningSolver.getOutput(),e.globalTopologyGeneratorSolver=e.topologyPlanningSolver.globalTopologySolver,e.componentTopologyGeneratorSolver=new wan(e.topologyPlanningSolver)}}),f0("topologyMergingSolver",Ean,(e)=>{let t=e.topologyPlanningSolver.getOutput();return[{layerCount:e.srj.layerCount,nodeGroups:[{groupId:"global",nodes:t.globalMeshNodes,isComponent:!1},...t.componentMeshNodes.map((n,o)=>({groupId:`component-${o}`,nodes:n,isComponent:!0}))]}]},{onSolved:(e)=>{e.capacityNodes=e.topologyMergingSolver.getOutput()}}),f0("nodeDimensionSubdivisionSolver",Zbe,(e)=>[e.capacityNodes,e.maxNodeDimension,e.maxNodeRatio,e.minNodeArea],{onSolved:(e)=>{e.capacityNodes=e.nodeDimensionSubdivisionSolver.outputNodes}}),f0("edgeSolver",ok,(e)=>[e.capacityNodes],{onSolved:(e)=>{e.capacityEdges=e.edgeSolver?.edges}}),f0("availableSegmentPointSolver",tY,(e)=>[{nodes:e.capacityNodes,edges:e.capacityEdges||[],traceWidth:e.minTraceWidth,colorMap:e.colorMap,shouldReturnCrampedPortPoints:!0}]),f0("necessaryCrampedPortPointSolver",jle,(e)=>{let t=XGt(e.capacityNodes);return[{capacityMeshNodes:e.capacityNodes.filter((n)=>!t.has(n.capacityMeshNodeId)),sharedEdgeSegments:AIr({sharedEdgeSegments:e.availableSegmentPointSolver.getOutput(),componentCapacityMeshNodeIds:t}),simpleRouteJson:e.srjWithPointPairs}]},{onSolved:(e)=>{let t=XGt(e.capacityNodes);e.sharedEdgeSegmentsWithNecessaryCrampedPortPoints=function({originalSharedEdgeSegments:n,filteredSharedEdgeSegments:o,componentCapacityMeshNodeIds:r}){let i=new Map(o.map((s)=>[s.edgeId,s]));return n.map((s)=>scn(s,r)?s:i.get(s.edgeId)??s)}({originalSharedEdgeSegments:e.availableSegmentPointSolver.getOutput(),filteredSharedEdgeSegments:e.necessaryCrampedPortPointSolver.getOutput(),componentCapacityMeshNodeIds:t})}}),f0("preloadedTraceGraphSolver",_Ir,(e)=>[e.sharedEdgeSegmentsWithNecessaryCrampedPortPoints,e.srjWithPointPairs]),f0("portPointPathingSolver",e6e,(e)=>{let t=e.sharedEdgeSegmentsWithNecessaryCrampedPortPoints??e.necessaryCrampedPortPointSolver?.getOutput()??e.availableSegmentPointSolver.getOutput(),{graph:n,connections:o}=Kle({capacityMeshNodes:e.capacityNodes,layerCount:e.srj.layerCount,connectivityMap:e.connMap,segmentPortPoints:t.flatMap((r)=>r.portPoints),simpleRouteJsonConnections:e.srjWithPointPairs.connections});return[{graph:n,connections:o,layerCount:e.srj.layerCount,effort:Math.min(1,e.effort),preserveTerminalPcbPortIds:!0,minViaPadDiameter:e.viaDiameter,flags:{FORCE_CENTER_FIRST:!0,RIPPING_ENABLED:!0,USE_SELECTIVE_RERIP_ROUTING:!0,USE_PARTIAL_RIP_ROUTING_WITH_PRELOADED_TRACES:!0},weights:{SHUFFLE_SEED:0,MEMORY_PF_FACTOR:4,CENTER_OFFSET_DIST_PENALTY_FACTOR:0,CENTER_OFFSET_FOCUS_SHIFT:0,NODE_PF_FACTOR:0,LAYER_CHANGE_COST:0,RIPPING_PF_COST:0,NODE_PF_MAX_PENALTY:100,BASE_CANDIDATE_COST:0.6,MAX_ITERATIONS_PER_PATH:0,RANDOM_WALK_DISTANCE:0,START_RIPPING_PF_THRESHOLD:0.3,END_RIPPING_PF_THRESHOLD:1,MAX_RIPS:1000,RANDOM_RIP_FRACTION:0.3,STRAIGHT_LINE_DEVIATION_PENALTY_FACTOR:4,GREEDY_MULTIPLIER:0.7,MIN_ALLOWED_BOARD_SCORE:-1e4}}]}),f0("uniformPortDistributionSolver",Tle,(e)=>[{nodeWithPortPoints:e.portPointPathingSolver?.getOutput().nodesWithPortPoints??[],inputNodesWithPortPoints:e.portPointPathingSolver?.getOutput().inputNodeWithPortPoints??[],minTraceWidth:e.minTraceWidth,obstacles:e.srj.obstacles,layerCount:e.srj.layerCount,useLayerAwareGeometry:e.srj.layerCount>2,preserveSolitaryPorts:Boolean(e.srj.traces?.length)}]),f0("highDensityRouteSolver",tet,(e)=>{let t=e.portPointPathingSolver;if(!t)throw Error("Pipeline9 invariant violated: high-density routing requires the completed port-point pathing solver");let n=t.getOutput(),o=e.uniformPortDistributionSolver?.getOutput()??[],r=n.nodesWithPortPoints,i=o.length>0?o:r;e.highDensityNodePortPoints=structuredClone(i);let s=(e.originalSrj.traces??[]).flatMap((c,l)=>lB(c,l,e.originalSrj.layerCount,e.viaDiameter,e.connMap)),a=fGt({traces:e.originalSrj.traces??[],fixedHdRoutes:s,sections:e.getChangedPreloadedTraceSections()});return[{nodePortPoints:i,boardGeometry:{bounds:e.originalSrj.bounds,outline:e.originalSrj.outline,minBoardEdgeClearance:e.originalSrj.minBoardEdgeClearance},fixedHdRoutes:a,connMap:e.connMap,colorMap:e.colorMap,obstacles:e.srj.obstacles,layerCount:e.srj.layerCount,allowBlindAndBuriedVias:e.srj.allowBlindAndBuriedVias,viaDiameter:e.viaDiameter,traceWidth:e.minTraceWidth,obstacleMargin:e.srj.defaultObstacleMargin??0.15,viaToPadClearance:e.srj.minViaEdgeToPadEdgeClearance,effort:Math.min(1,e.effort),includeBoardObstacles:!0,nodePfById:t.computeNodePfMap(),preserveTerminalPcbPortIds:!0}]}),f0("highDensityForceImproveSolver",$le,(e)=>[{nodeWithPortPoints:e.highDensityNodePortPoints??[],hdRoutes:C6r(ZZe(e.highDensityRouteSolver.routes)),colorMap:e.colorMap,totalStepsPerNode:Math.max(12,Math.round(20*Math.min(1,e.effort))),nodeAssignmentMargin:e.srj.defaultObstacleMargin??0.2}]),f0("highDensityRepairSolver",qle,(e)=>[{nodeWithPortPoints:e.highDensityNodePortPoints??[],hdRoutes:e.highDensityForceImproveSolver?.getOutput()??e.highDensityRouteSolver.routes,obstacles:e.srj.obstacles,colorMap:e.colorMap,repairMargin:e.srj.defaultObstacleMargin??0.2,minimumTraceWidth:e.srj.minTraceWidth,connMap:e.connMap}]),f0("highDensityStitchSolver",o6e,(e)=>[{connections:[...e.srjWithPointPairs.connections,...e.getChangedPreloadedTraceSections().map((t)=>t.connection)],hdRoutes:e.highDensityRepairSolver?.getOutput()??e.highDensityForceImproveSolver?.getOutput()??e.highDensityRouteSolver.routes,colorMap:e.colorMap,layerCount:e.srj.layerCount,defaultViaDiameter:e.viaDiameter,preserveTerminalPcbPortIds:!0,preferSameLayerTerminalEndpoints:!0}]),f0("traceSimplificationSolver",s6,(e)=>{let t=e.getPreloadedTraceUpdatesAfterHighDensity().updatedPreloadedTraces.flatMap((i,s)=>lB(i,s,e.originalSrj.layerCount,e.viaDiameter,e.connMap).map((a)=>({...a,rootConnectionName:i.connection_name}))),n=new Set(e.getChangedPreloadedTraceSections().map((i)=>i.connectionName)),o=e.highDensityStitchSolver.mergedHdRoutes.filter((i)=>!n.has(i.connectionName)),r=abe([...o,...t],e.connMap);return[{hdRoutes:o,obstacles:e.srj.obstacles,connMap:e.connMap,colorMap:e.colorMap,outline:e.srj.outline,defaultViaDiameter:e.viaDiameter,layerCount:e.srj.layerCount,minTraceToPadEdgeClearance:e.srj.minTraceToPadEdgeClearance,minBoardEdgeClearance:e.srj.minBoardEdgeClearance,otherHdRoutes:t,netByConnectionName:r,enableCrossingViaReduction:!0,terminalLayerIndicesByPcbPortId:_Gt(e.srj.connections,e.srj.obstacles,e.srj.layerCount),iterations:2}]}),f0("mutatedPreloadedTraceSimplificationSolver",s6,(e)=>{let t=e.getPreparedMutatedPreloadedTraceSections(),n=t.sections.map((r)=>r.hdRoute),o=[...t.immutableHdRoutes,...e.traceSimplificationSolver.simplifiedHdRoutes];return[{hdRoutes:n,obstacles:e.srj.obstacles,connMap:e.connMap,colorMap:e.colorMap,outline:e.srj.outline,defaultViaDiameter:e.viaDiameter,layerCount:e.srj.layerCount,minTraceToPadEdgeClearance:e.srj.minTraceToPadEdgeClearance,minBoardEdgeClearance:e.srj.minBoardEdgeClearance,otherHdRoutes:o,netByConnectionName:abe([...n,...o],e.connMap),enableCrossingViaReduction:!0,preserveRouteEndpoints:!0,enableVertexShortcuts:!0,iterations:2}]}),f0("traceWidthSolver",Yq,(e)=>[{hdRoutes:e.traceSimplificationSolver.simplifiedHdRoutes,obstacles:e.srj.obstacles,connMap:e.connMap,colorMap:e.colorMap,minTraceWidth:e.minTraceWidth,connection:e.srjWithPointPairs.connections,obstacleMargin:e.srj.minTraceToPadEdgeClearance??0.15,minTraceToHoleEdgeClearance:e.srj.minTraceToHoleEdgeClearance,layerCount:e.srj.layerCount}]),f0("globalDrcForceImproveSolver",NS,(e)=>[{srj:e.getSrjWithMaterializedPreloadedTraces(),hdRoutes:Lan({hdRoutes:Q$(e.traceWidthSolver.getHdRoutesWithWidths()),connections:e.netToPointPairsSolver?.newConnections??[]}),connMap:e.connMap,effort:Math.min(1,e.effort),maxIterations:16,enableLargeBoardBroadFallback:!1,enablePostSolveClearanceRelaxation:!1}]),f0("pipeline9JointDrcRepairSolver",uIr,(e)=>{let t=e.getPreloadedTraceUpdatesAfterHighDensity(),n=e.getSrjWithMaterializedPreloadedTraces();return[{srj:n,srjWithPointPairs:n,originalSrj:e.originalSrj,newConnections:e.netToPointPairsSolver?.newConnections??[],newHdRoutes:e.globalDrcForceImproveSolver.getOutput(),updatedPreloadedTraces:t.updatedPreloadedTraces,mutatedPreloadedTraceIds:new Set(t.mutatedPreloadedTraces.map((o)=>o.pcb_trace_id)),connMap:e.connMap,obstacles:e.srj.obstacles,layerCount:e.srj.layerCount,defaultViaDiameter:e.viaDiameter,defaultViaHoleDiameter:e.viaHoleDiameter,effort:Math.min(1,e.effort),colorMap:e.colorMap}]}),f0("effortCleanupSolver",m6r,(e)=>{let t=e.getUpdatedPreloadedTraces(),n={...e.originalSrj,traces:t},o=Q$(e.pipeline9JointDrcRepairSolver.getOutput()),r=(i)=>O$e(H$e({connections:e.netToPointPairsSolver.newConnections,originalConnections:e.originalSrj.connections,hdRoutes:Q$(i),layerCount:e.srj.layerCount,obstacles:e.srj.obstacles,defaultViaHoleDiameter:e.viaHoleDiameter,connMap:e.connMap}),e.originalSrj.traces??[]);return[{effort:e.effort,viaRemovalPasses:e.pipeline9JointDrcRepairSolver.stats.initialBoundedRegionalRepairAddedViaCount>0?2:1,config:{hdRoutes:o,preserveRouteEndpoints:!0,obstacles:e.srj.obstacles,connMap:e.connMap,colorMap:e.colorMap,outline:e.srj.outline,defaultViaDiameter:e.viaDiameter,layerCount:e.srj.layerCount,minTraceToPadEdgeClearance:e.srj.minTraceToPadEdgeClearance,minBoardEdgeClearance:e.srj.minBoardEdgeClearance,otherHdRoutes:t.flatMap((i,s)=>lB(i,s,e.srj.layerCount,e.viaDiameter,e.connMap)),enableCrossingViaReduction:!0,terminalLayerIndicesByPcbPortId:_Gt(e.srj.connections,e.srj.obstacles,e.srj.layerCount)},getCost:(i)=>{let s=r(i);return{vias:s.reduce((a,c)=>a+c.route.filter((l)=>l.route_type==="via").length,0),points:s.reduce((a,c)=>a+c.route.length,0)}},isValid:(i)=>Z3e({inputSrj:n,srjWithPointPairs:e.srjWithPointPairs,routedTraces:r(i),includeBoardClearance:!0,drcOptions:{traceClearance:e.originalSrj.minTraceToPadEdgeClearance??0.1,viaClearance:e.originalSrj.minViaHoleEdgeToViaHoleEdgeClearance??0.1}}).errors.length===0}]}),f0("lengthMatchingPostProcessingSolver",g6r,(e)=>{let t=e.netToPointPairsSolver;if(!t)throw Error("Pipeline9: length-matching post-processing requires NetToPointPairsSolver output");let n=t.newConnections,o=new Map;for(let s of e.srj.differentialPairs??[])for(let a of s.connectionNames){let c=n.filter((l)=>l.name===a||l.__rootConnectionNames?.includes(a)||l.__netConnectionName===a);if(c.length!==1)throw Error(`Pipeline9: differential pair connection "${a}" must resolve to exactly one final point-pair connection, got ${c.length}`);o.set(a,c[0].name)}let r=e.effortCleanupSolver.getOutput(),i=(e.srj.differentialPairs??[]).map((s)=>{let a=s.connectionNames.map((d)=>{let u=o.get(d);if(!u)throw Error(`Pipeline9: differential pair connection "${d}" is missing from final routed output`);return u});if(a[0]===a[1])throw Error(`Pipeline9: differential pair ${s.connectionNames.join("/")} resolves both members to "${a[0]}"`);let c={connectionNames:a,lengthTolerance:s.lengthTolerance};if(s.maxUncoupledLength!==void 0&&(c.maxUncoupledLength=s.maxUncoupledLength),s.traceGap===void 0)return c;let l=a.map((d)=>{let u=r.filter((_)=>_.connectionName===d);if(u.length!==1)throw Error(`Pipeline9: differential pair connection "${d}" must resolve to exactly one final HD route, got ${u.length}`);return u[0]}),h=s.traceGap+l.reduce((d,u)=>d+u.traceThickness/2,0);return{...c,minimumCenterlineDistance:h,maximumCenterlineDistance:h}});return[{hdRoutes:r,differentialPairs:i,buses:e.srj.buses??[],connections:e.srj.connections,obstacles:e.srj.obstacles,traces:e.getUpdatedPreloadedTraces(),bounds:e.srj.bounds,layerCount:e.srj.layerCount,obstacleMargin:e.srj.minTraceToPadEdgeClearance??0.15}]}),f0("powerTraceExpansionSolver",Qan,(e)=>{let t=e.opts.powerTraceExpansion??{},n=t.onlyConnectionNames??kan(e.originalSrj);return[Han({originalSrj:e.originalSrj,newlyRoutedTraces:e.getNewTracesBeforePowerExpansion(),currentPreloadedTraces:e.getUpdatedPreloadedTraces(),expandedConnectionNames:n,resolveConnectedTraceAliases:!0}),{allowNewVias:!1,...t,onlyConnectionNames:n}]})];setSimpleRouteJson(e){this.srj=e;let t=rm(this.srj);this.viaDiameter=t.padDiameter,this.viaHoleDiameter=t.holeDiameter,this.minTraceWidth=this.srj.minTraceWidth,this.connMap=im(this.srj),this.colorMap=JA(this.srj,this.connMap)}getConstructorParams(){return[this.srj,this.opts]}currentPipelineStepIndex=0;computeProgress(){let e=this.activeSubSolver?.progress??0;return(this.currentPipelineStepIndex+e)/this.pipelineDef.length}_step(){let e=this.pipelineDef[this.currentPipelineStepIndex];if(!e)return void(this.solved=!0);if(this.activeSubSolver)return this.activeSubSolver.step(),void(this.activeSubSolver.solved?(this.endTimeOfPhase[e.solverName]=performance.now(),this.timeSpentOnPhase[e.solverName]=this.endTimeOfPhase[e.solverName]-this.startTimeOfPhase[e.solverName],e.onSolved?.(this),this.activeSubSolver=null,this.currentPipelineStepIndex++):this.activeSubSolver.failed&&(this.error=this.activeSubSolver?.error,this.failed=!0,this.activeSubSolver=null));let t=e.getConstructorParams(this);this.activeSubSolver=new e.solverClass(...t),this.activeSubSolver instanceof s6&&(this.activeSubSolver.MAX_SIMPLIFICATION_PIPELINE_LOOPS=Math.ceil(this.activeSubSolver.MAX_SIMPLIFICATION_PIPELINE_LOOPS*Math.min(1,this.effort))),e.solverName!=="lengthMatchingPostProcessingSolver"&&e.solverName!=="powerTraceExpansionSolver"&&e.solverName!=="effortCleanupSolver"||(this.MAX_ITERATIONS=Math.max(this.MAX_ITERATIONS,this.iterations+this.activeSubSolver.MAX_ITERATIONS+1)),this[e.solverName]=this.activeSubSolver,this.timeSpentOnPhase[e.solverName]=0,this.startTimeOfPhase[e.solverName]=performance.now()}solveUntilPhase(e){for(;this.getCurrentPhase()!==e;)this.step()}getCurrentPhase(){return this.pipelineDef[this.currentPipelineStepIndex]?.solverName??"none"}visualize(){if(!this.solved&&this.activeSubSolver)return this.visualizeStage(this.activeSubSolver);let e=this.escapeViaLocationSolver?.visualize(),t=this.netToPointPairsSolver?.visualize(),n=this.componentDetectionSolver?.visualize(),o=this.componentTopologyGeneratorSolver?.visualize(),r=this.globalTopologyGeneratorSolver?.visualize(),i=this.topologyMergingSolver?.visualize(),s=this.nodeDimensionSubdivisionSolver?.visualize(),a=this.nodeTargetMerger?.visualize(),c=this.singleLayerNodeMerger?.visualize(),l=this.strawSolver?.visualize(),h=this.edgeSolver?.visualize(),d=this.deadEndSolver?.visualize(),u=this.availableSegmentPointSolver?.visualize(),_=this.portPointPathingSolver?.visualize(),p=this.multiSectionPortPointOptimizer?.visualize(),m=this.uniformPortDistributionSolver?.visualize(),A=this.highDensityRouteSolver?.visualize(),g=this.highDensityForceImproveSolver?.visualize(),f=this.highDensityRepairSolver?.visualize(),y=this.highDensityStitchSolver?.visualize(),x=this.traceSimplificationSolver?.visualize(),C=this.mutatedPreloadedTraceSimplificationSolver?.visualize(),b=this.lengthMatchingPostProcessingSolver?.visualize(),I=this.powerTraceExpansionSolver?.visualize(),v=this.traceWidthSolver?.visualize(),P=this.necessaryCrampedPortPointSolver?.visualize(),M=(this.highDensityRouteSolver?.visualize(),this.originalSrj),B=M.outline,T=[];if(T.push({points:[{x:M.bounds?.minX??-50,y:M.bounds?.minY??-50},{x:M.bounds?.maxX??50,y:M.bounds?.minY??-50},{x:M.bounds?.maxX??50,y:M.bounds?.maxY??50},{x:M.bounds?.minX??-50,y:M.bounds?.maxY??50},{x:M.bounds?.minX??-50,y:M.bounds?.minY??-50}],strokeColor:"rgba(255,0,0,0.25)"}),B&&B.length>=2){let K=B.map((J)=>({x:J.x,y:J.y}));K.push({...K[0]}),T.push({points:K,strokeColor:"rgba(0, 136, 255, 0.95)"})}let N=bB(M),D={points:[...M.connections.flatMap((K)=>K.pointsToConnect.map((J)=>({...J,layer:IB(J,M.layerCount),label:`${K.name} ${J.pcb_port_id??""}`})))],rects:[...(M.obstacles??[]).filter((K)=>!K.isCopperPour).map((K)=>({...K,fill:K.layers?.includes("top")?"rgba(255,0,0,0.25)":K.layers?.includes("bottom")?"rgba(0,0,255,0.25)":"rgba(255,0,0,0.25)",layer:$S(K,M.layerCount),label:N(K)}))],lines:T},L={traceColorMode:this.visualizationTraceColorMode},H=yB({srj:M,visualizationOptions:L}),V=Bl(D,H),O=this.preprocessSimpleRouteJsonSolver?.visualize(),U=this.globalDrcForceImproveSolver?.visualize(),j=this.pipeline9JointDrcRepairSolver?.visualize(),Y=[V,O,n,o,e,t,r,i,s,a,c,l,h,d,u,P,_,p,m,A?Bl(D,A):null,g,f,y,x,C,v,U,j,b,I,this.solved?Bl({lines:T},yB({srj:this.originalSrj,visualizationOptions:L}),this.visualizeFinalOutput()):null].filter(Boolean),X=Bl(...Y);return this.visualizationTraceColorMode==="net"?tbe(X,this.colorMap):X}visualizeStage(e){let t=e.visualize();return this.visualizationTraceColorMode==="net"?tbe(t,this.colorMap):t}visualizeFinalOutput(){let e=this.visualizationTraceColorMode,t=this.getOutputSimpleRouteJson();return rx(t,{traceColorMode:e})}preview(){if(this.highDensityRouteSolver){let e=[];for(let t=this.highDensityRouteSolver.routes.length-1;t>=0;t--){let n=this.highDensityRouteSolver.routes[t];if(e.push({points:n.route.map((o)=>({x:o.x,y:o.y})),strokeColor:this.colorMap[n.connectionName]}),e.length>200)break}return{lines:e}}return this.portPointPathingSolver?this.portPointPathingSolver.preview():this.netToPointPairsSolver?this.netToPointPairsSolver.visualize():this.escapeViaLocationSolver?this.escapeViaLocationSolver.visualize():this.componentTopologyGeneratorSolver?this.componentTopologyGeneratorSolver.visualize():this.componentDetectionSolver?this.componentDetectionSolver.visualize():this.preprocessSimpleRouteJsonSolver?this.preprocessSimpleRouteJsonSolver.visualize():{}}_getOutputHdRoutes(){if(((this.originalSrj.differentialPairs?.length??0)>0||(this.originalSrj.buses??[]).some((e)=>e.maxLengthSkew!==void 0))&&this.lengthMatchingPostProcessingSolver){let{hdRoutes:e}=this.lengthMatchingPostProcessingSolver.getOutput();return e}return(this.effortCleanupSolver?.solved?this.effortCleanupSolver.getOutput():void 0)??this.pipeline9JointDrcRepairSolver?.getOutput()??this.globalDrcForceImproveSolver?.getOutput()??this.traceWidthSolver?.getHdRoutesWithWidths()??this.traceSimplificationSolver?.simplifiedHdRoutes??this.highDensityStitchSolver.mergedHdRoutes}getOriginalFixedHdRoutes(){return(this.originalSrj.traces??[]).flatMap((e,t)=>lB(e,t,this.originalSrj.layerCount,this.viaDiameter,this.connMap))}getChangedPreloadedTraceSections(){return this.portPointPathingSolver?.getOutput().changedPreloadedTraceSections??[]}getPreloadedFixedRouteStateAfterHighDensity(){let e=this.getOriginalFixedHdRoutes(),t=this.getChangedPreloadedTraceSections(),n=fGt({traces:this.originalSrj.traces??[],fixedHdRoutes:e,sections:t}),o=t.length===0?[]:x6r({traces:this.originalSrj.traces??[],sections:t,stitchedHdRoutes:this.highDensityStitchSolver?.mergedHdRoutes??[],layerCount:this.originalSrj.layerCount}),r=new Set(t.map((s)=>s.traceId)),i=e.filter((s)=>r.has(this.originalSrj.traces?.[s.preloadedTraceIndex]?.pcb_trace_id??"")).map((s)=>s.connectionName);return{originalFixedRoutes:e,updatedFixedRoutes:[...this.highDensityRouteSolver?.getUpdatedFixedHdRoutes()??n,...o],replacedConnectionNames:new Set([...this.highDensityRouteSolver?.fixedRouteReplacements.keys()??[],...i]),mutationMasks:new Map([...this.highDensityRouteSolver?.preloadedTraceMutationMasks??[],...o.map((s)=>[s.connectionName,Array(s.route.length-1).fill(!0)])])}}getPreparedMutatedPreloadedTraceSections(){let e=this.getPreloadedFixedRouteStateAfterHighDensity();return E6r({updatedFixedRoutes:e.updatedFixedRoutes,regionalMutationMasks:e.mutationMasks})}getPreloadedTraceUpdatesAfterHighDensity(){let e=this.getPreloadedFixedRouteStateAfterHighDensity(),t=this.getPreparedMutatedPreloadedTraceSections(),n=this.mutatedPreloadedTraceSimplificationSolver?.solved===!0?(({updatedFixedRoutes:o,sections:r,simplifiedHdRoutes:i})=>{let s=new Set(r.map((h)=>h.connectionName)),a=new Map(i.map((h)=>[h.connectionName,h]));if(a.size!==r.length||i.some((h)=>!s.has(h.connectionName)))throw Error(`Pipeline9 trace simplification changed the mutation-section set (expected ${r.length}, got ${i.length})`);let c=new Map,l=new Set;for(let h of r){let d=a.get(h.connectionName);if(!d)throw Error(`Pipeline9 trace simplification lost mutation section "${h.connectionName}"`);let u=d.route[0],_=d.route.at(-1);if(!(u&&_&&lbe(u,h.section.start.point)&&lbe(_,h.section.end.point)))throw Error(`Pipeline9 trace simplification changed mutation-section boundary "${h.connectionName}"`);let p=eet(h.section,d),m=h.section.sourceRoutes[0];l.add(m.connectionName);for(let A of h.section.sourceRoutes){if(c.has(A.connectionName))throw Error(`Pipeline9 attempted to simplify fixed route "${A.connectionName}" more than once`);c.set(A.connectionName,p)}}return o.flatMap((h)=>{let d=c.get(h.connectionName);return d?l.has(h.connectionName)?[d]:[]:[h]})})({updatedFixedRoutes:t.normalizedFixedRoutes,sections:t.sections,simplifiedHdRoutes:this.mutatedPreloadedTraceSimplificationSolver.simplifiedHdRoutes}):e.updatedFixedRoutes;return(({originalTraces:o,originalFixedRoutes:r,updatedFixedRoutes:i,replacedConnectionNames:s,layerCount:a,defaultViaHoleDiameter:c,obstacles:l,connMap:h})=>{let d=new Map,u=new Map;for(let p of r){let m=d.get(p.preloadedTraceIndex)??[];m.push(p),d.set(p.preloadedTraceIndex,m)}for(let p of i){let m=u.get(p.preloadedTraceIndex)??[];m.push(p),u.set(p.preloadedTraceIndex,m)}let _=[];return{updatedPreloadedTraces:o.map((p,m)=>{let A=(d.get(m)??[]).sort(z$e);if(!A.some((x)=>s.has(x.connectionName)))return p;let g=(u.get(m)??[]).sort(z$e),f=p.route.some((x)=>x.route_type==="through_obstacle"),y={...p,__replaces_pcb_trace_id:p.pcb_trace_id,route:f?y6r({trace:p,originalTraceRoutes:A,updatedTraceRoutes:g,layerCount:a,defaultViaHoleDiameter:c,obstacles:l,connMap:h}):Van({trace:p,updatedTraceRoutes:g,layerCount:a,defaultViaHoleDiameter:c,obstacles:l,connMap:h})};return _.push(y),y}),mutatedPreloadedTraces:_}})({originalTraces:this.originalSrj.traces??[],originalFixedRoutes:e.originalFixedRoutes,updatedFixedRoutes:n,replacedConnectionNames:e.replacedConnectionNames,layerCount:this.originalSrj.layerCount,defaultViaHoleDiameter:this.viaHoleDiameter,obstacles:this.originalSrj.obstacles,connMap:this.connMap})}getSrjWithMaterializedPreloadedTraces(){return{...this.srjWithPointPairs,traces:this.getPreloadedTraceUpdatesAfterHighDensity().updatedPreloadedTraces}}getUpdatedPreloadedTraces(){return this.pipeline9JointDrcRepairSolver?.getUpdatedPreloadedTraces()??this.getPreloadedTraceUpdatesAfterHighDensity().updatedPreloadedTraces}getMutatedPreloadedTraces(){return this.pipeline9JointDrcRepairSolver?.getMutatedPreloadedTraces()??this.getPreloadedTraceUpdatesAfterHighDensity().mutatedPreloadedTraces}getNewTracesBeforePowerExpansion(){if(!this.highDensityRouteSolver)throw Error("Cannot get new traces before high-density routing");let e=H$e({connections:this.netToPointPairsSolver?.newConnections??[],originalConnections:this.originalSrj.connections,hdRoutes:Q$(this._getOutputHdRoutes()),layerCount:this.srj.layerCount,obstacles:this.srj.obstacles,defaultViaHoleDiameter:this.viaHoleDiameter,connMap:this.connMap});return O$e(e,this.originalSrj.traces??[])}getPowerTraceExpansionFixedTraces(){if(!this.powerTraceExpansionSolver)throw Error("Pipeline9 invariant violated: solved pipeline is missing the unconditional power-trace expansion solver");return this.powerTraceExpansionSolver.inputSrj.fixedTraces}getOutputSimplifiedPcbTraces(){if(!this.solved)throw Error("Cannot get output before solving is complete");if(!this.powerTraceExpansionSolver)throw Error("Pipeline9 invariant violated: solved pipeline is missing the unconditional power-trace expansion solver");return[...this.getPowerTraceExpansionFixedTraces().filter((e)=>e.__replaces_pcb_trace_id!==void 0),...this.powerTraceExpansionSolver.getOutput()]}getOutputSimpleRouteJson(){if(!this.solved)throw Error("Cannot get output before solving is complete");if(!this.powerTraceExpansionSolver)throw Error("Pipeline9 invariant violated: solved pipeline is missing the unconditional power-trace expansion solver");let e=[...this.getPowerTraceExpansionFixedTraces(),...this.powerTraceExpansionSolver.getOutput()];return{...this.originalSrj,traces:e}}},fIr=String("0.0.993"),oet=({nodeWithPortPoints:e,obstacleMargin:t,traceWidth:n,viaDiameter:o})=>{let r=zce(e),i=t+Math.max(n,o)/2+0.000001;return{minX:e.center.x+8*(r.minX-e.center.x)-i,maxX:e.center.x+8*(r.maxX-e.center.x)+i,minY:e.center.y+8*(r.minY-e.center.y)-i,maxY:e.center.y+8*(r.maxY-e.center.y)+i}},acn=(e,t)=>{let n=(e.ccwRotationDegrees??0)*Math.PI/180,o=Math.abs(Math.cos(n)),r=Math.abs(Math.sin(n)),i=e.width/2,s=e.height/2,a=Math.max(i,i*o+s*r),c=Math.max(s,i*r+s*o);return e.center.x-a<=t.maxX&&e.center.x+a>=t.minX&&e.center.y-c<=t.maxY&&e.center.y+c>=t.minY},Z$=(e,t)=>{for(let n of[t.connectionName,t.rootConnectionName,t.portPointId,t.pcb_port_id,t.prevPortPointId,t.nextPortPointId])n!==void 0&&e.add(n)},ccn=(e,t)=>Object.fromEntries(Object.entries(e.netMap).flatMap(([n,o])=>{let r=o.filter((i)=>t.has(i));return r.length>0||t.has(n)?[[n,r]]:[]})),lcn=({obstacle:e,connectedTo:t,preserveRotation:n})=>({type:"rect",layers:e.layers,...e.zLayers===void 0?{}:{zLayers:e.zLayers},...e.__zLayers===void 0?{}:{__zLayers:e.__zLayers},center:e.center,width:e.width,height:e.height,...n&&e.ccwRotationDegrees!==void 0?{ccwRotationDegrees:e.ccwRotationDegrees}:{},connectedTo:t,...e.circuitJsonMetadata===void 0?{}:{circuitJsonMetadata:e.circuitJsonMetadata}});function yIr({nodeWithPortPoints:e,connMap:t,obstacles:n,obstacleMargin:o,traceWidth:r,viaDiameter:i}){let s=oet({nodeWithPortPoints:e,obstacleMargin:o,traceWidth:r,viaDiameter:i}),a=new Set;for(let l of e.portPoints)Z$(a,l);for(let l of e.portPointsInPairs??[])Z$(a,l[0]),Z$(a,l[1]);let c=n.flatMap((l)=>{if(!acn(l,s))return[];let h=(({obstacle:d,nodeWithPortPoints:u,connMap:_})=>{let p=new Set(u.portPoints.flatMap((g)=>{let f=_.getNetConnectedToId(g.rootConnectionName??g.connectionName)??g.rootConnectionName??g.connectionName;return[g.connectionName,f]})),m=new Set(d.connectedTo.filter((g)=>p.has(g))),A=new Map;for(let g of p){let f=_.getNetConnectedToId(g)??g,y=A.get(f)??[];y.push(g),A.set(f,y)}for(let g of A.values()){if([...m].some((y)=>g.some((x)=>x===y||_.areIdsConnected(x,y))))continue;let f=d.connectedTo.find((y)=>g.some((x)=>x===y||_.areIdsConnected(x,y)));f!==void 0&&m.add(f)}return[...m]})({obstacle:l,nodeWithPortPoints:e,connMap:t});for(let d of h)a.add(d);return[lcn({obstacle:l,connectedTo:h,preserveRotation:!0})]});return{connectivityNetMap:ccn(t,a),obstacles:c}}var xIr=(...e)=>{let t=new Map;for(let n of e)for(let[o,r]of Object.entries(n)){let i=t.get(o)??new Set;for(let s of r)i.add(s);t.set(o,i)}return Object.fromEntries([...t].map(([n,o])=>[n,[...o]]))};function CIr({nodeWithPortPoints:e,connMap:t,colorMap:n,obstacles:o,obstacleMargin:r,traceWidth:i,viaDiameter:s}){let a=oet({nodeWithPortPoints:e,obstacleMargin:r,traceWidth:i,viaDiameter:s}),c=((d)=>[...new Set(d.portPoints.map((u)=>u.connectionName))])(e),l=o.flatMap((d)=>{if(!acn(d,a))return[];let u=c.filter((_)=>d.connectedTo.some((p)=>p===_||t.areIdsConnected(_,p)));return u.length===0?[]:[lcn({obstacle:d,connectedTo:u,preserveRotation:!1})]}),h=new Set;for(let d of e.portPoints)Z$(h,d);for(let d of e.portPointsInPairs??[])Z$(h,d[0]),Z$(h,d[1]);for(let d of l)for(let u of[d.circuitJsonMetadata?.pcb_smtpad_id,d.circuitJsonMetadata?.pcb_plated_hole_id,d.circuitJsonMetadata?.pcb_port_id,d.circuitJsonMetadata?.pcb_via_id,...d.connectedTo??[]])u!==void 0&&h.add(u);return{connectivityNetMap:ccn(t,h),colorMap:Object.fromEntries(Object.entries(n??{}).filter(([d])=>h.has(d))),obstacles:l}}var ret="https://hd-cache2.tscircuit.com",jGt=310000,KGt=1835008,$Gt=16777216,$0=class extends Error{constructor(e,t){super(t),this.reason=e,this.name="HdCache2RequestError"}reason},Vae=(e)=>e instanceof Error?e.message:String(e),bIr=new Set(["pcb_smtpad_id","pcb_plated_hole_id","pcb_port_id","pcb_via_id","source_component_name","source_port_name"]),IIr=(e)=>!(!e||typeof e!="object"||Array.isArray(e))&&Object.entries(e).every(([t,n])=>bIr.has(t)&&typeof n=="string"),Yae=(e,t)=>Math.abs(e-t)<=0.000000001*Math.max(1,Math.abs(e),Math.abs(t)),qGt=0.000001,vIr=(e,t)=>{let n=t==="ordinary"?qGt:0.001,o=new Set;for(let i=0;i<e.route.length-1;i++){let s=e.route[i],a=e.route[i+1],c=s.z!==a.z;if(s.toNextSegmentType==="through_obstacle"){if(!c)return!1;continue}if(s.toNextSegmentCircuitJsonMetadata!==void 0)return!1;if(!c)continue;let l=[],h=[];for(let[d,u]of e.vias.entries())Math.hypot(u.x-s.x,u.y-s.y)<=n&&l.push(d),Math.hypot(u.x-a.x,u.y-a.y)<=n&&h.push(d);if(Math.hypot(s.x-a.x,s.y-a.y)<=qGt){if(l.length===0)return!1;for(let d of l)o.add(d)}else{if(t==="regional-fallback")return!1;if(l.length===0==(h.length===0))return!1;for(let d of[...l,...h])o.add(d)}}let r=e.route.at(-1);return r.toNextSegmentType===void 0&&r.toNextSegmentCircuitJsonMetadata===void 0&&e.vias.every((i,s)=>o.has(s))},SIr=(e,t,n)=>{if(!Array.isArray(e))return!1;let o=new Map;for(let c of t.nodeWithPortPoints.portPoints){let l=o.get(c.connectionName)??[];l.push(c),o.set(c.connectionName,l)}let r=new Set(t.nodeWithPortPoints.availableZ??t.nodeWithPortPoints.portPoints.map((c)=>c.z)),i=oet({nodeWithPortPoints:t.nodeWithPortPoints,obstacleMargin:t.obstacleMargin,traceWidth:t.traceWidth,viaDiameter:t.viaDiameter}),s=(c,l)=>(o.get(l)??[]).some((h)=>typeof c.x=="number"&&Yae(c.x,h.x)&&typeof c.y=="number"&&Yae(c.y,h.y)&&c.z===h.z);for(let c of e){if(!c||typeof c!="object")return!1;let l=c;if(typeof l.connectionName!="string"||l.connectionName.length===0||!o.has(l.connectionName)||typeof l.traceThickness!="number"||!Number.isFinite(l.traceThickness)||l.traceThickness<=0||typeof l.viaDiameter!="number"||!Number.isFinite(l.viaDiameter)||l.viaDiameter<=0||!Yae(l.viaDiameter,t.viaDiameter)||!Array.isArray(l.route)||l.route.length<2||!Array.isArray(l.vias))return!1;for(let d of[l.rootConnectionName,l.startPcbPortId,l.endPcbPortId,l.regionId])if(d!==void 0&&typeof d!="string")return!1;for(let d of l.route){if(!d||typeof d!="object")return!1;let u=d;if(typeof u.x!="number"||!Number.isFinite(u.x)||typeof u.y!="number"||!Number.isFinite(u.y)||u.x<i.minX||u.x>i.maxX||u.y<i.minY||u.y>i.maxY||typeof u.z!="number"||!Number.isInteger(u.z)||u.z<0||u.z>=t.layerCount||n==="ordinary"&&!r.has(u.z))return!1;if(u.traceThickness!==void 0&&(typeof u.traceThickness!="number"||!Number.isFinite(u.traceThickness)||u.traceThickness<=0))return!1;if(u.pcb_port_id!==void 0&&typeof u.pcb_port_id!="string")return!1;if(u.insideJumperPad!==void 0&&typeof u.insideJumperPad!="boolean")return!1;if(u.toNextSegmentType!==void 0&&u.toNextSegmentType!=="through_obstacle")return!1;if(u.toNextSegmentCircuitJsonMetadata!==void 0&&!IIr(u.toNextSegmentCircuitJsonMetadata))return!1}let h=l.route;if(!(n!=="ordinary"||s(h[0],l.connectionName)&&s(h.at(-1),l.connectionName)))return!1;for(let d of l.vias){if(!d||typeof d!="object")return!1;let u=d;if(typeof u.x!="number"||!Number.isFinite(u.x)||typeof u.y!="number"||!Number.isFinite(u.y)||u.x<i.minX||u.x>i.maxX||u.y<i.minY||u.y>i.maxY)return!1}if(!vIr(l,n))return!1;if(l.jumpers!==void 0){if(!Array.isArray(l.jumpers))return!1;for(let d of l.jumpers){if(!d||typeof d!="object")return!1;let u=d,{start:_,end:p}=u;if(u.route_type!=="jumper"||u.footprint!=="0603"&&u.footprint!=="1206"&&u.footprint!=="1206x4_pair"||!_||typeof _.x!="number"||!Number.isFinite(_.x)||typeof _.y!="number"||!Number.isFinite(_.y)||!p||typeof p.x!="number"||!Number.isFinite(p.x)||typeof p.y!="number"||!Number.isFinite(p.y)||_.x<i.minX||_.x>i.maxX||_.y<i.minY||_.y>i.maxY||p.x<i.minX||p.x>i.maxX||p.y<i.minY||p.y>i.maxY)return!1}}}let a=e;return n==="ordinary"?((c,l)=>{let h=l.portPointsInPairs??[];if(h.length>0){for(let[u,_]of h)if(!DCe(c,u.connectionName,R3(u)).has(R3(_)))return!1;return!0}let d=new Map;for(let u of l.portPoints){let _=d.get(u.connectionName)??[];_.push(u),d.set(u.connectionName,_)}for(let[u,_]of d)for(let[p,m]of Vce(_))if(!DCe(c,u,R3(p)).has(R3(m)))return!1;return!0})(a,t.nodeWithPortPoints):((c,l)=>{let h=(m,A)=>{if(m.z!==A.z)return!1;let g=m.x-A.x,f=m.y-A.y;return Math.hypot(g,f)<=0.001},d=new Map;for(let m of c){let A=m.route.some((C,b)=>{let I=m.route[b+1];return!(I===void 0||Yae(C.x,I.x)&&Yae(C.y,I.y)&&C.z===I.z)}),g=m.route[0],f=m.route.at(-1);if(!A||!g||!f)return!1;let y=l.portPoints.filter((C)=>C.connectionName===m.connectionName);if(!y.some((C)=>h(g,C))||!y.some((C)=>h(f,C)))return!1;let x=d.get(m.connectionName)??[];x.push({start:g,end:f}),d.set(m.connectionName,x)}let u=(m,A,g)=>{if(h(A,g))return!0;let f=d.get(m)??[],y=[],x=new Set;for(let[C,b]of f.entries())(h(A,b.start)||h(A,b.end))&&(y.push(C),x.add(C));for(;y.length>0;){let C=f[y.pop()];if(h(g,C.start)||h(g,C.end))return!0;for(let[b,I]of f.entries())x.has(b)||(h(C.start,I.start)||h(C.start,I.end)||h(C.end,I.start)||h(C.end,I.end))&&(x.add(b),y.push(b))}return!1},_=l.portPointsInPairs??[];if(_.length>0)return _.every(([m,A])=>u(m.connectionName,m,A));let p=new Map;for(let m of l.portPoints){let A=p.get(m.connectionName)??[];A.push(m),p.set(m.connectionName,A)}return[...p].every(([,m])=>Vce(m).every(([A,g])=>u(A.connectionName,A,g)))})(a,t.nodeWithPortPoints)},PIr=class{constructor(e,t=ret,n={}){this.autorouterVersion=e,this.serverUrl=t;let{cacheVersion:o}=n;if(o!==void 0&&o.trim().length===0)throw Error("hd-cache2 cacheVersion must not be empty");this.cacheVersion=o}autorouterVersion;serverUrl;cacheVersion;stats={batchRequestsStarted:0,batchRequestsCompleted:0,batchItemsStarted:0,batchBodyBytesStarted:0,batchMaxBodyBytes:0,batchCacheMisses:0,singleRequestsStarted:0,batchInvalidLines:0,batchUnknownRequestIds:0,batchDuplicateRequestIds:0};solveMany(e){let t=e.map((i,s)=>this.createPendingSolve(String(s),i)),n=t.filter((i)=>i.serializedItem!==null),{batches:o,singletonSolves:r}=this.prepareBatches(n);for(let i of o)this.fetchBatch(i);for(let i of r)this.launchSingleSolve(i);return t.map((i)=>i.promise)}createPendingSolve(e,t){let n,o={requestId:e,input:t,serializedItem:null,promise:new Promise((r)=>{n=r}),resolve:n,settled:!1,singleSolveStarted:!1};try{o.serializedItem=JSON.stringify({requestId:e,input:t})}catch(r){this.settleWithFallback(o,"request_serialization_error",Vae(r))}return o}settle(e,t){e.settled||(e.settled=!0,e.resolve(t))}settleWithFallback(e,t,n){this.settle(e,{kind:"local-fallback",reason:t,error:n})}parseSuccessfulResponse(e,t){if(!e||typeof e!="object"||Array.isArray(e))throw new $0("invalid_response","hd-cache2 returned a non-object response");let n=e;if(n.ok!==!0)throw new $0("remote_error",typeof n.message=="string"?n.message:"hd-cache2 returned an unsuccessful response");if(n.autorouterVersion!==this.autorouterVersion)throw new $0("version_mismatch",`hd-cache2 returned autorouter version ${String(n.autorouterVersion)}, expected ${this.autorouterVersion}`);if(n.cacheVersion!==this.cacheVersion)throw new $0("cache_version_mismatch",`hd-cache2 returned cache version ${String(n.cacheVersion)}, expected ${String(this.cacheVersion)}`);if(n.source!=="cache"&&n.source!=="solver")throw new $0("invalid_response","hd-cache2 returned an invalid cache source");if(n.solutionStage!=="ordinary"&&n.solutionStage!=="regional-fallback")throw new $0("invalid_response","hd-cache2 returned an invalid solution stage");if(n.solutionStage==="regional-fallback"&&(!t.enableRegionalFallback||typeof n.ordinaryFailure!="string"||n.ordinaryFailure.length===0))throw new $0("invalid_response","hd-cache2 returned invalid regional fallback metadata");if(n.solutionStage==="ordinary"&&Object.prototype.hasOwnProperty.call(n,"ordinaryFailure"))throw new $0("invalid_response","hd-cache2 returned regional metadata on an ordinary result");if(n.solutionStage==="ordinary"&&n.status==="failed"&&t.enableRegionalFallback)throw new $0("invalid_response","hd-cache2 returned an intermediate ordinary failure");if(n.status==="solved"&&SIr(n.routes,t,n.solutionStage))return n;if(n.status==="failed"&&typeof n.error=="string"&&n.error.length>0)return n;throw new $0("invalid_response","hd-cache2 returned an invalid solve result")}parseBatchCacheMiss(e){if(e.ok!==!1||e.code!=="CACHE_MISS")return null;if(e.autorouterVersion!==this.autorouterVersion)throw new $0("version_mismatch",`hd-cache2 returned autorouter version ${String(e.autorouterVersion)}, expected ${this.autorouterVersion}`);if(e.cacheVersion!==this.cacheVersion)throw new $0("cache_version_mismatch",`hd-cache2 returned cache version ${String(e.cacheVersion)}, expected ${String(this.cacheVersion)}`);if(typeof e.message!="string")throw new $0("invalid_response","hd-cache2 returned an invalid cache miss response");return e}async fetchSingle(e){let t=new AbortController,n=!1,o=setTimeout(()=>{n=!0,t.abort(Error("hd-cache2 transport timed out after 310000ms"))},jGt);o.unref?.();try{let i={autorouterVersion:this.autorouterVersion,...this.cacheVersion===void 0?{}:{cacheVersion:this.cacheVersion},input:e.input},s;try{s=JSON.stringify(i)}catch(h){throw new $0("request_serialization_error",Vae(h))}let a=await fetch((r=this.serverUrl,/\/solve\/?$/.test(r)?r.replace(/\/+$/,""):`${r.replace(/\/+$/,"")}/solve`),{method:"POST",headers:{accept:"application/json","content-type":"application/json"},body:s,signal:t.signal}),c=await a.text(),l=null;try{l=c?JSON.parse(c):null}catch{if(!a.ok)throw new $0("http_error",`hd-cache2 request failed with status ${a.status}`);throw new $0("invalid_json",`hd-cache2 returned invalid JSON with status ${a.status}`)}if(!a.ok){let h=l&&typeof l=="object"&&"message"in l&&typeof l.message=="string"?l.message:`hd-cache2 request failed with status ${a.status}`;throw new $0("http_error",h)}this.settle(e,{kind:"remote",response:this.parseSuccessfulResponse(l,e.input)})}catch(i){let s=i instanceof $0?i.reason:n?"transport_timeout":"transport_error";this.settleWithFallback(e,s,Vae(i))}finally{clearTimeout(o)}var r}launchSingleSolve(e){e.singleSolveStarted||e.settled||(e.singleSolveStarted=!0,this.stats.singleRequestsStarted+=1,this.fetchSingle(e))}handleBatchResponseLine(e,t,n){if(e.trim().length===0)return;if(e.length>$Gt)throw new $0("response_too_large","hd-cache2 returned an oversized batch result line");let o;try{o=JSON.parse(e)}catch{return void(this.stats.batchInvalidLines+=1)}if(!o||typeof o!="object"||Array.isArray(o))return void(this.stats.batchInvalidLines+=1);let r=o,i=r.requestId;if(typeof i!="string")return void(this.stats.batchInvalidLines+=1);let s=t.get(i);if(s)if(n.has(i))this.stats.batchDuplicateRequestIds+=1;else{n.add(i);try{if(this.parseBatchCacheMiss(r))return this.stats.batchCacheMisses+=1,void this.launchSingleSolve(s);this.settle(s,{kind:"remote",response:this.parseSuccessfulResponse(r,s.input)})}catch(a){this.stats.batchInvalidLines+=1,this.settleWithFallback(s,a instanceof $0?a.reason:"invalid_response",Vae(a))}}else this.stats.batchUnknownRequestIds+=1}async readBatchResponse(e,t){if(!e.body)throw new $0("invalid_response","hd-cache2 returned an empty batch response body");let n=new Map(t.items.map((a)=>[a.requestId,a])),o=new Set,r=new TextDecoder,i=e.body.getReader(),s="";for(;o.size<t.items.length;){let{done:a,value:c}=await i.read();if(s+=r.decode(c,{stream:!a}),s.length>$Gt&&!s.includes(`
`))throw new $0("response_too_large","hd-cache2 returned an oversized unterminated batch result line");let l=s.indexOf(`
`);for(;l>=0;){let h=s.slice(0,l);s=s.slice(l+1),this.handleBatchResponseLine(h,n,o),l=s.indexOf(`
`)}if(a){s.trim().length>0&&this.handleBatchResponseLine(s,n,o);break}}if(o.size!==t.items.length)for(let a of t.items)o.has(a.requestId)||this.settleWithFallback(a,"missing_response",`hd-cache2 batch ended without result ${a.requestId}`);else await i.cancel().catch(()=>{})}async fetchBatch(e){let t=new AbortController,n=!1,o=setTimeout(()=>{n=!0,t.abort(Error("hd-cache2 batch transport timed out after 310000ms"))},jGt);o.unref?.(),this.stats.batchRequestsStarted+=1,this.stats.batchItemsStarted+=e.items.length,this.stats.batchBodyBytesStarted+=e.bodyBytes,this.stats.batchMaxBodyBytes=Math.max(this.stats.batchMaxBodyBytes,e.bodyBytes);try{let r=await fetch(((i)=>{let s=i.replace(/\/+$/,"");return/\/solve-batch$/.test(s)?s:/\/solve$/.test(s)?s.replace(/\/solve$/,"/solve-batch"):`${s}/solve-batch`})(this.serverUrl),{method:"POST",headers:{accept:"application/x-ndjson","content-type":"application/json"},body:e.body,signal:t.signal});if(!r.ok){let i=await r.text().catch(()=>""),s=`hd-cache2 batch request failed with status ${r.status}`;try{let a=i?JSON.parse(i):null;a&&typeof a=="object"&&"message"in a&&typeof a.message=="string"&&(s=a.message)}catch{}throw new $0("http_error",s)}await this.readBatchResponse(r,e)}catch(r){let i=r instanceof $0?r.reason:n?"transport_timeout":"transport_error";for(let s of e.items)s.singleSolveStarted||this.settleWithFallback(s,i,Vae(r))}finally{clearTimeout(o),this.stats.batchRequestsCompleted+=1}}prepareBatches(e){let t=new TextEncoder,n=this.cacheVersion===void 0?"":`,"cacheVersion":${JSON.stringify(this.cacheVersion)}`,o=`{"autorouterVersion":${JSON.stringify(this.autorouterVersion)}${n},"items":[`,r=t.encode(o+"]}").byteLength,i=[],s=[],a=[],c=r,l=()=>{a.length!==0&&(i.push({body:`${o}${a.map((h)=>h.serializedItem).join(",")}]}`,bodyBytes:c,items:a}),a=[],c=r)};for(let h of e){let d=t.encode(h.serializedItem).byteLength,u=a.length===0?0:1;r+d>KGt?(l(),s.push(h)):((a.length>=100||c+u+d>KGt)&&l(),a.push(h),c+=(a.length===1?0:1)+d)}return l(),{batches:i,singletonSolves:s}}},EIr="ordinary_then_regional_without_fixed_copper_v1",MIr=class extends tet{autorouterVersion;hdCache2ServerUrl;hdCache2CacheVersion;requestTimeoutMs;hdCache2Client;launchedRemoteSolves=!1;waitingForRemoteNode=null;remoteRequestByNode=new Map;remoteResultByNode=new Map;logicallyTimedOutNodes=new Set;constructor({autorouterVersion:e,hdCache2ServerUrl:t,hdCache2CacheVersion:n,requestTimeoutMs:o,...r}){if(super(r),r.effort!==1)throw Error(`Pipeline9 networked high-density routing requires effort=1, received ${r.effort}`);if(this.requestTimeoutMs=o??30000,!Number.isFinite(this.requestTimeoutMs)||this.requestTimeoutMs<=0)throw Error(`Pipeline9 network request timeout must be a positive number, received ${this.requestTimeoutMs}`);this.autorouterVersion=e,this.hdCache2ServerUrl=t??ret,this.hdCache2CacheVersion=n,this.hdCache2Client=new PIr(this.autorouterVersion,this.hdCache2ServerUrl,{cacheVersion:n}),this.pendingEffects=[],this.stats={...this.stats,remoteRequestsStarted:0,remoteRequestsCompleted:0,remoteBatchRequestsStarted:0,remoteBatchRequestsCompleted:0,remoteBatchItemsStarted:0,remoteBatchBodyBytesStarted:0,remoteBatchMaxBodyBytes:0,remoteBatchCacheMisses:0,remoteSingleRequestsStarted:0,remoteBatchInvalidLines:0,remoteBatchUnknownRequestIds:0,remoteBatchDuplicateRequestIds:0,remoteCacheHits:0,remoteSolverResults:0,remoteSolvedResults:0,remoteFailedResults:0,remoteOrdinaryResults:0,remoteRegionalFallbackResults:0,remoteRegionalFallbackResultsApplied:0,remoteRegionalFallbackResultsDeferredToLocal:0,remoteTransportFallbacks:0,remoteLogicalTimeoutFallbacks:0,remoteFallbackReasonCounts:{}}}getSolverName(){return"Pipeline9NetworkedHighDensitySolver"}async waitForAllRemoteRequests(){let e=[...this.remoteRequestByNode.values()];e.length!==0?(await Promise.all(e.map(({promise:t})=>t)),this.syncClientStats()):this.syncClientStats()}createNodeInput(e){let t=this.enableRegionalFallback?yIr({nodeWithPortPoints:e,connMap:this.connMap,obstacles:this.obstacles,obstacleMargin:this.obstacleMargin,traceWidth:this.traceWidth,viaDiameter:this.viaDiameter}):{connectivityNetMap:{},obstacles:[]},n=CIr({nodeWithPortPoints:e,connMap:this.connMap,colorMap:this.colorMap,obstacles:this.enableRegionalFallback?t.obstacles:this.obstacles,obstacleMargin:this.obstacleMargin,traceWidth:this.traceWidth,viaDiameter:this.viaDiameter});return{solvePolicy:EIr,enableRegionalFallback:this.enableRegionalFallback,nodeWithPortPoints:e,connectivityNetMap:xIr(n.connectivityNetMap,t.connectivityNetMap),colorMap:n.colorMap,viaDiameter:this.viaDiameter,traceWidth:this.traceWidth,obstacleMargin:this.obstacleMargin,effort:1,obstacles:n.obstacles,boardGeometry:this.boardGeometry,regionalObstacles:t.obstacles,layerCount:this.layerCount,nodePf:this.nodePfById.get(e.capacityMeshNodeId)??null}}syncClientStats(){let e=this.hdCache2Client.stats;this.stats.remoteBatchRequestsStarted=e.batchRequestsStarted,this.stats.remoteBatchRequestsCompleted=e.batchRequestsCompleted,this.stats.remoteBatchItemsStarted=e.batchItemsStarted,this.stats.remoteBatchBodyBytesStarted=e.batchBodyBytesStarted,this.stats.remoteBatchMaxBodyBytes=e.batchMaxBodyBytes,this.stats.remoteBatchCacheMisses=e.batchCacheMisses,this.stats.remoteSingleRequestsStarted=e.singleRequestsStarted,this.stats.remoteBatchInvalidLines=e.batchInvalidLines,this.stats.remoteBatchUnknownRequestIds=e.batchUnknownRequestIds,this.stats.remoteBatchDuplicateRequestIds=e.batchDuplicateRequestIds}recordFallbackReason(e){let t=this.stats.remoteFallbackReasonCounts;t[e]=(t[e]??0)+1}trackRemoteSolve(e,t){let n=performance.now()+this.requestTimeoutMs;this.stats.remoteRequestsStarted+=1;let o=t.then((r)=>{let i=this.logicallyTimedOutNodes.has(e);i||this.remoteResultByNode.set(e,r),r.kind==="remote"?(r.response.source==="cache"&&(this.stats.remoteCacheHits+=1),r.response.source==="solver"&&(this.stats.remoteSolverResults+=1),r.response.status==="solved"?this.stats.remoteSolvedResults+=1:this.stats.remoteFailedResults+=1):i||(this.stats.remoteTransportFallbacks+=1,this.recordFallbackReason(r.reason)),this.stats.remoteRequestsCompleted+=1,this.syncClientStats()});this.remoteRequestByNode.set(e,{promise:o,deadlineAt:n})}launchRemoteSolves(){let e=[],t=[...this.unsolvedNodePortPoints].reverse();for(let o of t)try{e.push({node:o,input:this.createNodeInput(o)})}catch(r){this.trackRemoteSolve(o,Promise.resolve({kind:"local-fallback",reason:"request_serialization_error",error:r instanceof Error?r.message:String(r)}))}let n=this.hdCache2Client.solveMany(e.map(({input:o})=>o));for(let[o,r]of n.entries())this.trackRemoteSolve(e[o].node,r);this.syncClientStats()}async waitForCurrentRemoteNode(e,t){let n=t.deadlineAt-performance.now();if(n<=0)return void this.recordLogicalTimeout(e);let o,r=await Promise.race([t.promise.then(()=>"request-settled"),new Promise((i)=>{o=setTimeout(()=>i("logical-timeout"),n)})]);o!==void 0&&clearTimeout(o),r==="logical-timeout"&&this.recordLogicalTimeout(e)}recordLogicalTimeout(e){this.logicallyTimedOutNodes.add(e),this.stats.remoteLogicalTimeoutFallbacks+=1,this.stats.remoteTransportFallbacks+=1,this.recordFallbackReason("logical_timeout")}startRegularSolver(e){let t=this.remoteResultByNode.get(e);if(!t){let n=this.remoteRequestByNode.get(e);if(n){this.waitingForRemoteNode=e;let o=this.waitForCurrentRemoteNode(e,n);o.then(()=>{this.waitingForRemoteNode===e&&(this.pendingEffects=[])});let r={name:`hd-cache2:${e.capacityMeshNodeId}`,promise:o};return void(this.pendingEffects=[r])}return void super.startRegularSolver(e)}this.applyRemoteResultToRegularNode(e,t)}applyRemoteResultToRegularNode(e,t){if(t.kind!=="local-fallback"){if(this.stats.regularNodeCount=Number(this.stats.regularNodeCount??0)+1,this.activeNode=e,t.response.solutionStage==="regional-fallback"){if(this.stats.remoteRegionalFallbackResults+=1,!this.canUseNoFixedCopperRegionalResult(e))return this.stats.remoteRegionalFallbackResultsDeferredToLocal+=1,void this.finishRegularSolverFailure(t.response.ordinaryFailure);this.stats.remoteRegionalFallbackResultsApplied+=1,this.stats.fallbackNodeCount=Number(this.stats.fallbackNodeCount??0)+1}else this.stats.remoteOrdinaryResults+=1;if(t.response.status==="failed")return this.error=t.response.error,this.failed=!0,void(this.activeNode=null);this.finishActiveNode(t.response.routes)}else super.startRegularSolver(e)}canUseNoFixedCopperRegionalResult(e){let t={...Lce(e,this.connMap),availableZ:Array.from({length:this.layerCount},(o,r)=>r)},n=Ele(t,this.getUpdatedFixedHdRoutes());return n.fixedRouteSectionsByConnectionName.size===0&&n.fixedObstacleRoutes.length===0}_step(){if(this.syncClientStats(),this.launchedRemoteSolves||(this.launchedRemoteSolves=!0,this.launchRemoteSolves()),this.waitingForRemoteNode){let e=this.waitingForRemoteNode;if(this.logicallyTimedOutNodes.has(e))return this.waitingForRemoteNode=null,this.pendingEffects=[],void super.startRegularSolver(e);let t=this.remoteResultByNode.get(e);if(!t)return;return this.waitingForRemoteNode=null,this.pendingEffects=[],void this.applyRemoteResultToRegularNode(e,t)}super._step()}},c6e=class extends ehe{hdCache2ServerUrl;hdCache2CacheVersion;getSolverName(){return"AutoroutingPipelineSolver9_Networked"}constructor(e,t={}){if(super(e,t),this.effort!==1)throw Error(`AutoroutingPipelineSolver9_Networked is only available at effort=1, received ${this.effort}`);this.hdCache2ServerUrl=t.hdCache2ServerUrl??ret,this.hdCache2CacheVersion=t.hdCache2CacheVersion,this.replaceHighDensityPipelineStep()}replaceHighDensityPipelineStep(){let e=this.pipelineDef.findIndex((o)=>o.solverName==="highDensityRouteSolver"),t=this.pipelineDef[e];if(!t)throw Error("Pipeline9 highDensityRouteSolver step is missing");let n=t.getConstructorParams;this.pipelineDef[e]={...t,solverClass:MIr,getConstructorParams:(o)=>{let[r]=n(o);return[{...r,autorouterVersion:fIr,hdCache2ServerUrl:o.hdCache2ServerUrl,hdCache2CacheVersion:o.hdCache2CacheVersion}]}}}async stepAsync(){if(this.solved||this.failed)return;this.step();let e=aan(this);e.length!==0&&(await Promise.race(e.map((t)=>t.promise.then(()=>t.name,()=>t.name))),this.solved||this.failed||this.step())}async solveAsync(){let e=Date.now();for(;!this.solved&&!this.failed;)await this.stepAsync();this.timeToSolve=Date.now()-e}async solveUntilPhaseAsync(e){for(;this.getCurrentPhase()!==e&&!this.solved&&!this.failed;)await this.stepAsync()}solve(){throw Error("AutoroutingPipelineSolver9_Networked requires async execution. Use solveAsync() or stepAsync().")}solveUntilPhase(e){throw Error("AutoroutingPipelineSolver9_Networked requires solveUntilPhaseAsync().")}};var wLs=globalThis.process?.env?.FANOUT_FLOW_DEBUG==="1";var wIr=class extends Da{constructor(e){super(),this.inputProblem=e,this.simplifiedRouteByTraceId=new Map(e.simplifiedHdRoutes.map((t)=>[t.connectionName,t])),this.MAX_ITERATIONS=e.preparedInput.preparedTraces.length+1}inputProblem;simplifiedRouteByTraceId;outputTraces=[];nextTraceIndex=0;getSolverName(){return"ApplyTraceSimplificationSolver"}_step(){let e=this.inputProblem.preparedInput.preparedTraces,t=e[this.nextTraceIndex];t?(this.outputTraces.push(this.applyTrace(t)),this.nextTraceIndex++,this.progress=this.nextTraceIndex/Math.max(1,e.length)):this.finishApplication()}applyTrace(e){if(!e.mutableHdRoute)return structuredClone(e.originalTrace);let t=this.simplifiedRouteByTraceId.get(e.originalTrace.pcb_trace_id);if(!t||e.uniformTraceWidth===void 0)throw Error(`Simplification removed trace "${e.originalTrace.pcb_trace_id}"`);let n=k3(t,this.inputProblem.preparedInput.srj.layerCount,{defaultViaHoleDiameter:e.viaHoleDiameter,obstacles:this.inputProblem.preparedInput.srj.obstacles,connMap:this.inputProblem.preparedInput.connMap}),o=n.filter((i)=>i.route_type==="jumper"),r=((i,s)=>i.map((a)=>a.route_type==="wire"||a.route_type==="through_obstacle"?{...a,width:s}:a))([...structuredClone(e.leadingTerminalVias),...n.filter((i)=>i.route_type!=="jumper"),...structuredClone(e.trailingTerminalVias),...o],e.uniformTraceWidth);return((i,s)=>{let a=i.filter((c)=>c.route_type==="wire");s.startPcbPortId&&a[0]&&(a[0].start_pcb_port_id=s.startPcbPortId),s.endPcbPortId&&a.at(-1)&&(a.at(-1).end_pcb_port_id=s.endPcbPortId)})(r,t),{...structuredClone(e.originalTrace),route:r}}finishApplication(){let e=this.inputProblem.preparedInput.preparedTraces;this.stats={inputTraceCount:e.length,outputTraceCount:this.outputTraces.length,inputRoutePointCount:e.reduce((t,n)=>t+n.originalTrace.route.length,0),outputRoutePointCount:this.outputTraces.reduce((t,n)=>t+n.route.length,0)},this.progress=1,this.solved=!0}getConstructorParams(){return[this.inputProblem]}getOutput(){if(!this.solved)throw Error("Cannot get applied traces before conversion completes");return{...structuredClone(this.inputProblem.preparedInput.originalSrj),traces:structuredClone(this.outputTraces)}}},Gae=(e,t)=>{let n=e.at(-1);if(n&&(o=n,r=t,Math.abs(o.x-r.x)<=0.000000001&&Math.abs(o.y-r.y)<=0.000000001&&o.z===r.z))return t.traceThickness!==void 0&&(n.traceThickness=t.traceThickness),void(t.pcb_port_id!==void 0&&(n.pcb_port_id=t.pcb_port_id));var o,r;e.push(t)},BIr=(e,t,n)=>{for(let o=t+1;o<e.length;o++){let r=e[o];if(r.route_type==="wire")return si(r.layer,n);if(r.route_type==="through_obstacle")return si(r.from_layer,n)}},TIr=({fromZ:e,toZ:t,previousZ:n,nextZ:o})=>n===e?[e,t]:n===t?[t,e]:o===t?[e,t]:o===e?[t,e]:[e,t],DIr=(e,t)=>{for(let n of e)if(n.route_type==="via"&&n.via_diameter!==void 0)return n.via_diameter;return t},JGt=(e,t)=>{let n=t==="start"?e:[...e].reverse();for(let o of n){if(o.route_type!=="wire")continue;let r=t==="start"?o.start_pcb_port_id:o.end_pcb_port_id;if(r)return r}},NIr=(e)=>({route_type:"jumper",start:{...e.start},end:{...e.end},footprint:e.footprint}),RIr=(e,t)=>{for(let n of e.route)if(n.route_type==="via"&&n.via_hole_diameter!==void 0)return n.via_hole_diameter;return t},QIr=class extends Da{preparedInput;seenTraceIds=new Set;nextTraceIndex=0;constructor(e){super();let t=structuredClone(e.inputSrj),n=oP(t),o=im(n);this.preparedInput={originalSrj:t,srj:n,connMap:o,colorMap:JA(n,o),immutableHdRoutes:[],mutableHdRoutes:[],netByConnectionName:new Map,options:{...e.options},preparedTraces:[]},this.MAX_ITERATIONS=(n.traces?.length??0)+1}getSolverName(){return"PrepareTraceSimplificationSolver"}_step(){let e=this.preparedInput.srj.traces??[],t=e[this.nextTraceIndex];if(!t)return this.stats={inputTraceCount:e.length,mutableTraceCount:this.preparedInput.mutableHdRoutes.length,immutableTraceCount:e.length-this.preparedInput.mutableHdRoutes.length},this.progress=1,void(this.solved=!0);this.prepareTrace(t,this.nextTraceIndex),this.nextTraceIndex++,this.progress=this.nextTraceIndex/Math.max(1,e.length)}prepareTrace(e,t){if(this.seenTraceIds.has(e.pcb_trace_id))throw Error(`Duplicate pcb_trace_id "${e.pcb_trace_id}"`);this.seenTraceIds.add(e.pcb_trace_id);let n=rm(this.preparedInput.srj),o=((d)=>{let u=d.route.flatMap((p)=>p.route_type==="wire"||p.route_type==="through_obstacle"?[p.width]:[]),_=u[0];if(_!==void 0&&!u.some((p)=>Math.abs(p-_)>0.000000001))return _})(e),{traceToSimplify:r,leadingTerminalVias:i,trailingTerminalVias:s}=((d)=>{let u=0;for(;d.route[u]?.route_type==="via";)u++;let _=d.route.length;for(;d.route[_-1]?.route_type==="jumper";)_--;let p=_;for(;p>u&&d.route[p-1]?.route_type==="via";)p--;return{traceToSimplify:{...d,route:[...d.route.slice(u,p),...d.route.slice(_)]},leadingTerminalVias:d.route.slice(0,u),trailingTerminalVias:d.route.slice(p,_)}})(e),a=this.preparedInput.connMap.getNetConnectedToId(e.connection_name)??e.connection_name,c=o===void 0?void 0:((d,u)=>{let _=[],p=[],m=[],A=((g,f)=>{for(let y of g)if(y.route_type==="wire"||y.route_type==="through_obstacle")return y.width;return f})(d.route,u.defaultTraceThickness);for(let g=0;g<d.route.length;g++){let f=d.route[g];if(f.route_type==="jumper"){m.push(NIr(f));continue}if(f.route_type==="wire"){Gae(_,{x:f.x,y:f.y,z:si(f.layer,u.layerCount),traceThickness:f.width,pcb_port_id:f.start_pcb_port_id??f.end_pcb_port_id});continue}let y=si(f.from_layer,u.layerCount),x=si(f.to_layer,u.layerCount),[C,b]=TIr({fromZ:y,toZ:x,previousZ:_.at(-1)?.z,nextZ:BIr(d.route,g,u.layerCount)});if(f.route_type==="via"){Gae(_,{x:f.x,y:f.y,z:C,traceThickness:A}),Gae(_,{x:f.x,y:f.y,z:b,traceThickness:A}),p.push({x:f.x,y:f.y});continue}let I=C===y,v=I?f.start:f.end,P=I?f.end:f.start;Gae(_,{...v,z:C,traceThickness:f.width,toNextSegmentType:"through_obstacle",...f.circuitJsonMetadata?{toNextSegmentCircuitJsonMetadata:f.circuitJsonMetadata}:{}}),Gae(_,{...P,z:b,traceThickness:f.width})}return{connectionName:d.pcb_trace_id,rootConnectionName:u.rootConnectionName,startPcbPortId:JGt(d.route,"start"),endPcbPortId:JGt(d.route,"end"),traceThickness:A,viaDiameter:DIr(d.route,u.defaultViaDiameter),route:_,vias:p,...m.length>0?{jumpers:m}:{}}})(r,{layerCount:this.preparedInput.srj.layerCount,defaultTraceThickness:o,defaultViaDiameter:n.padDiameter,rootConnectionName:a}),l=c&&c.route.length>=2?c:void 0;if(this.preparedInput.preparedTraces.push({originalTrace:e,mutableHdRoute:l,leadingTerminalVias:i,trailingTerminalVias:s,uniformTraceWidth:o,viaHoleDiameter:RIr(e,n.holeDiameter)}),!l)return void this.preparedInput.immutableHdRoutes.push(...lB(e,t,this.preparedInput.srj.layerCount,n.padDiameter,this.preparedInput.connMap));this.preparedInput.mutableHdRoutes.push(l),this.preparedInput.netByConnectionName.set(l.connectionName,a),this.preparedInput.colorMap[l.connectionName]=this.preparedInput.colorMap[a]??this.preparedInput.colorMap[e.connection_name]??"#2563eb";let h={...e,route:[...i,...s]};this.preparedInput.immutableHdRoutes.push(...lB(h,t,this.preparedInput.srj.layerCount,n.padDiameter,this.preparedInput.connMap))}getOutput(){if(!this.solved)throw Error("Cannot get prepared traces before preparation completes");return this.preparedInput}},kIr=class extends Da{constructor(e){super(),this.inputProblem=e;let t=e.preparedInput,n=rm(t.srj);this.traceSimplificationSolver=new s6({hdRoutes:t.mutableHdRoutes,otherHdRoutes:t.immutableHdRoutes,obstacles:t.srj.obstacles,connMap:t.connMap,colorMap:t.colorMap,outline:t.srj.outline,defaultViaDiameter:n.padDiameter,layerCount:t.srj.layerCount,minTraceToPadEdgeClearance:t.srj.minTraceToPadEdgeClearance,minBoardEdgeClearance:t.srj.minBoardEdgeClearance,netByConnectionName:t.netByConnectionName,enableCrossingViaReduction:t.options.enableCrossingViaReduction??!0,preserveRouteEndpoints:!0,useTraceWidthAwareClearance:!0,enableVertexShortcuts:t.options.enableVertexShortcuts??!0}),this.traceSimplificationSolver.MAX_SIMPLIFICATION_PIPELINE_LOOPS=t.options.iterations??2,this.activeSubSolver=this.traceSimplificationSolver,this.MAX_ITERATIONS=this.traceSimplificationSolver.MAX_ITERATIONS+1}inputProblem;traceSimplificationSolver;getSolverName(){return"TraceSimplificationStageSolver"}_step(){if(this.traceSimplificationSolver.step(),this.progress=this.traceSimplificationSolver.progress,this.stats={...this.traceSimplificationSolver.stats},this.traceSimplificationSolver.failed)return this.error=this.traceSimplificationSolver.error??"Trace simplification failed",this.failed=!0,void(this.activeSubSolver=null);this.traceSimplificationSolver.solved&&(this.progress=1,this.solved=!0,this.activeSubSolver=null)}getConstructorParams(){return[this.inputProblem]}getOutput(){if(!this.solved)throw Error("Cannot get simplified routes before cleanup completes");return structuredClone(this.traceSimplificationSolver.simplifiedHdRoutes)}visualize(){return this.traceSimplificationSolver.visualize()}preview(){return this.traceSimplificationSolver.preview()}},LIr=class extends Da{constructor(e){super(),this.inputProblem=e;let t=e.preparedInput;this.drcEngine=new Hle(t.srj,{connMap:t.connMap,traceClearance:t.srj.minTraceToPadEdgeClearance??0.1,viaClearance:0.1}),this.MAX_ITERATIONS=3}inputProblem;drcEngine;phase="baseline";baselineErrorCounts={};outputErrorCounts={};getSolverName(){return"ValidateTraceSimplificationSolver"}_step(){return this.phase==="baseline"?(this.baselineErrorCounts=this.evaluateErrorCounts(this.inputProblem.preparedInput.originalSrj),this.phase="output",void(this.progress=0.3333333333333333)):this.phase==="output"?(this.outputErrorCounts=this.evaluateErrorCounts(this.inputProblem.outputSrj),this.phase="compare",void(this.progress=0.6666666666666666)):(this.assertNoNewDrcErrors(),this.stats={baselineErrorCounts:this.baselineErrorCounts,outputErrorCounts:this.outputErrorCounts},this.progress=1,void(this.solved=!0))}evaluateErrorCounts(e){return((t)=>{let n={};for(let o of t.errors)n[o.type]=(n[o.type]??0)+1;return n})(this.drcEngine.evaluate(e.traces??[]))}assertNoNewDrcErrors(){let e=[...new Set([...Object.keys(this.baselineErrorCounts),...Object.keys(this.outputErrorCounts)])].filter((n)=>(this.outputErrorCounts[n]??0)>(this.baselineErrorCounts[n]??0));if(e.length===0)return;let t=e.map((n)=>`${n}: ${this.baselineErrorCounts[n]??0} -> ${this.outputErrorCounts[n]??0}`).join(", ");throw Error(`Pipeline 11 simplification introduced DRC errors (${t})`)}getConstructorParams(){return[this.inputProblem]}getOutput(){if(!this.solved)throw Error("Cannot get Pipeline 11 output before DRC validation");return structuredClone(this.inputProblem.outputSrj)}},hcn=class extends rP{prepareTraceSimplificationSolver;traceSimplificationStageSolver;applyTraceSimplificationSolver;validateTraceSimplificationSolver;pipelineDef=[Z0("prepareTraceSimplificationSolver",QIr,(e)=>[{inputSrj:e.inputProblem.inputSrj,options:e.inputProblem.options}]),Z0("traceSimplificationStageSolver",kIr,(e)=>[{preparedInput:e.prepareTraceSimplificationSolver.getOutput()}]),Z0("applyTraceSimplificationSolver",wIr,(e)=>[{preparedInput:e.prepareTraceSimplificationSolver.getOutput(),simplifiedHdRoutes:e.traceSimplificationStageSolver.getOutput()}]),Z0("validateTraceSimplificationSolver",LIr,(e)=>[{preparedInput:e.prepareTraceSimplificationSolver.getOutput(),outputSrj:e.applyTraceSimplificationSolver.getOutput()}])];constructor(e,t={}){if(t.iterations!==void 0&&(!Number.isInteger(t.iterations)||t.iterations<1))throw Error("Simplification iterations must be a positive integer");super({inputSrj:e,options:{...t}}),this.MAX_ITERATIONS=1e8}getSolverName(){return"AutoroutingPipelineSolver11_Simplification"}getConstructorParams(){return[this.inputProblem.inputSrj,this.inputProblem.options]}getOutput(){if(!this.validateTraceSimplificationSolver?.solved)throw Error("Pipeline 11 simplification has not solved yet");return this.validateTraceSimplificationSolver.getOutput()}getOutputSimpleRouteJson(){return this.getOutput()}getOutputSimplifiedPcbTraces(){return structuredClone(this.getOutput().traces??[])}initialVisualize(){return rx(this.inputProblem.inputSrj)}finalVisualize(){return rx(this.getOutput())}};var Nq=0.000000001,wje=(e)=>((t)=>t.route_type==="wire")(e)||((t)=>t.route_type==="via")(e)?e:((t)=>t.route_type==="through_obstacle")(e)&&Math.hypot(e.end.x-e.start.x,e.end.y-e.start.y)<=Nq?{route_type:e.route_type,x:e.start.x,y:e.start.y,from_layer:e.from_layer,to_layer:e.to_layer,width:e.width}:null,HIr=(e,t)=>e.layer??t.layer??e.to_layer??t.from_layer??e.from_layer??t.to_layer??"top",FIr=(e,t,n)=>e.width??t.width??n,s$=(e,t,n,o,r)=>({x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n,layer:o,width:r}),ZGt=(e,t)=>({...e,x:Math.abs(e.x-t.minX)<0.000001?t.minX:Math.abs(e.x-t.maxX)<0.000001?t.maxX:e.x,y:Math.abs(e.y-t.minY)<0.000001?t.minY:Math.abs(e.y-t.maxY)<0.000001?t.maxY:e.y}),eUt=({x:e,y:t,layer:n})=>({x:e,y:t,layer:n}),tUt=({x:e,y:t,layer:n,width:o})=>({route_type:"wire",x:e,y:t,layer:n,width:o}),zIr=(e,t,n)=>{let o=t.x-e.x,r=t.y-e.y,i=0,s=1,a=(c,l)=>{if(Math.abs(c)<Nq)return l>=0;let h=l/c;if(c<0){if(h>s)return!1;h>i&&(i=h)}else{if(h<i)return!1;h<s&&(s=h)}return!0};return a(-o,e.x-n.minX)&&a(o,n.maxX-e.x)&&a(-r,e.y-n.minY)&&a(r,n.maxY-e.y)?{startT:i,endT:s}:null},nUt=(e,t)=>e.x>=t.minX-0.000001&&e.x<=t.maxX+0.000001&&e.y>=t.minY-0.000001&&e.y<=t.maxY+0.000001&&(Math.abs(e.x-t.minX)<=0.000001||Math.abs(e.x-t.maxX)<=0.000001||Math.abs(e.y-t.minY)<=0.000001||Math.abs(e.y-t.maxY)<=0.000001),Bje=(e,t,n,o,r)=>{var i,s;(i=o,s=r,Math.hypot(i.x-s.x,i.y-s.y)<=Nq)||e.push({type:"pcb_trace",pcb_trace_id:`${t.pcb_trace_id}_keep_${n}`,connection_name:t.connection_name,route:[tUt(o),tUt(r)]})},oUt=({obstacleId:e,start:t,end:n,layer:o,width:r})=>{let i=n.x-t.x,s=n.y-t.y,a=Math.hypot(i,s);return a>r+Nq?null:{obstacleId:e,type:"rect",layers:[o],center:{x:(t.x+n.x)/2,y:(t.y+n.y)/2},width:a,height:r,ccwRotationDegrees:180*Math.atan2(s,i)/Math.PI,connectedTo:[]}},rUt=({connection:e,point:t,endpointIndex:n})=>({obstacleId:`${e.name}_route_endpoint_${n}`,type:"rect",layers:[t.layer],center:{x:t.x,y:t.y},width:t.width,height:t.width,connectedTo:[e.name,e.__rootConnectionNames?.[0]??e.name]}),iUt=({trace:e,ripIndex:t,start:n,end:o,region:r,allowInteriorStart:i,allowInteriorEnd:s})=>{if(!i&&!nUt(n,r)||!s&&!nUt(o,r))return null;let a=(({trace:c,ripIndex:l,start:h,end:d})=>({name:`${c.connection_name}_reroute_${c.pcb_trace_id}_${l}`,__rootConnectionNames:[c.connection_name],pointsToConnect:[eUt(h),eUt(d)]}))({trace:e,ripIndex:t,start:n,end:o});return{connection:a,endpointObstacles:[rUt({connection:a,point:n,endpointIndex:0}),rUt({connection:a,point:o,endpointIndex:1})]}},OIr=(e,t,n)=>{let o=[],r=[],i=[],s=[],a=null,c=!1,l=0,h=!1;for(let d=0;d<e.route.length-1;d++){let u=wje(e.route[d]),_=wje(e.route[d+1]);if(!u||!_)return null;let p=HIr(u,_),m=FIr(u,_,n),A=zIr(u,_,t),g=s$(u,_,0,p,m),f=s$(u,_,1,p,m),y=d===0;if(!A){Bje(o,e,l++,g,f);continue}if(h=!0,A.startT>Nq){let I=s$(u,_,A.startT,p,m),v=oUt({obstacleId:`${e.pcb_trace_id}_keep_${l}_bounds`,start:g,end:I,layer:p,width:m});v&&s.push(v),Bje(o,e,l++,g,I)}let x=s$(u,_,A.endT,p,m),C=ZGt(s$(u,_,A.startT,p,m),t),b=ZGt(s$(u,_,A.endT,p,m),t);if(a||(a=C,c=y&&A.startT<=Nq),A.endT<0.999999999){let I=iUt({trace:e,ripIndex:r.length,start:a,end:b,region:t,allowInteriorStart:c});I&&(r.push(I.connection),i.push(...I.endpointObstacles)),a=null,c=!1;let v=oUt({obstacleId:`${e.pcb_trace_id}_keep_${l}_bounds`,start:x,end:f,layer:p,width:m});v&&s.push(v),Bje(o,e,l++,x,f)}}if(a){let d=e.route.slice().reverse().map(wje).find((u)=>Boolean(u));if(d){let u=iUt({trace:e,ripIndex:r.length,start:a,end:{x:d.x,y:d.y,layer:d.layer??d.from_layer??a.layer,width:a.width},region:t,allowInteriorStart:c,allowInteriorEnd:!0});u&&(r.push(u.connection),i.push(...u.endpointObstacles))}}return{keptTraces:o,rerouteConnections:r,rerouteEndpointObstacles:i,clippedTraceSegmentObstacles:s,hadIntersection:h}},dcn=(e,t)=>{let n=structuredClone(e),o=[],r=[],i=[],s=[];for(let c of e.traces??[]){let l=OIr(c,t,e.minTraceWidth);l?l.hadIntersection?(o.push(...l.keptTraces),r.push(...l.rerouteConnections),i.push(...l.rerouteEndpointObstacles),s.push(...l.clippedTraceSegmentObstacles)):o.push(structuredClone(c)):o.push(structuredClone(c))}let a=((c,l)=>{let h={minX:c.minX,maxX:c.maxX,minY:c.minY,maxY:c.maxY};for(let d of l){let u=Bi(d);h.minX=Math.min(h.minX,u.minX),h.maxX=Math.max(h.maxX,u.maxX),h.minY=Math.min(h.minY,u.minY),h.maxY=Math.max(h.maxY,u.maxY)}return h})(t,[...i,...s]);return{...n,bounds:a,obstacles:[...n.obstacles,...i],traces:o,connections:r}},ucn=(e,t)=>{let n=new Map(t.connections.map((r)=>[r.name,r.__rootConnectionNames?.[0]??r.name])),o=(t.traces??[]).map((r)=>{let i=n.get(r.connection_name);return i?{...structuredClone(r),connection_name:i}:structuredClone(r)});return{...structuredClone(e),traces:o,jumpers:t.jumpers?structuredClone(t.jumpers):structuredClone(e.jumpers)}};/*! Bundled license information:

is-buffer/index.js:
  (*!
   * Determine if an object is a Buffer
   *
   * @author   Feross Aboukhadijeh <https://feross.org>
   * @license  MIT
   *)

deep-rename-keys/index.js:
  (*!
   * deep-rename-keys <https://github.com/jonschlinkert/deep-rename-keys>
   *
   * Copyright (c) 2015 Jon Schlinkert, contributors.
   * Licensed under the MIT license.
   *)

@tscircuit/checks/dist/index.js:
  (*! Bundled license information:
  
  @tscircuit/circuit-json-pcb-style-analysis/dist/index.js:
    (*!
    * Determine if an object is a Buffer
    *
    * @author   Feross Aboukhadijeh <https://feross.org>
    * @license  MIT
    *)
  *)

@tscircuit/curvy-trace-solver/dist/index.js:
@tscircuit/find-convex-regions/dist/index.js:
  (*! Bundled license information:
  
  is-buffer/index.js:
    (*!
     * Determine if an object is a Buffer
     *
     * @author   Feross Aboukhadijeh <https://feross.org>
     * @license  MIT
     *)
  
  deep-rename-keys/index.js:
    (*!
     * deep-rename-keys <https://github.com/jonschlinkert/deep-rename-keys>
     *
     * Copyright (c) 2015 Jon Schlinkert, contributors.
     * Licensed under the MIT license.
     *)
  *)

@tscircuit/hypergraph/dist/index.js:
  (*! Bundled license information:
  
  @tscircuit/find-convex-regions/dist/index.js:
    (*! Bundled license information:
    
    is-buffer/index.js:
      (*!
       * Determine if an object is a Buffer
       *
       * @author   Feross Aboukhadijeh <https://feross.org>
       * @license  MIT
       *)
    
    deep-rename-keys/index.js:
      (*!
       * deep-rename-keys <https://github.com/jonschlinkert/deep-rename-keys>
       *
       * Copyright (c) 2015 Jon Schlinkert, contributors.
       * Licensed under the MIT license.
       *)
    *)
  *)
*/qt();yc();var GJ=at(j0(),1);qt();qt();async function VIr(e={}){var t,n=e,o=!!globalThis.window,r=!!globalThis.WorkerGlobalScope,i=globalThis.process?.versions?.node&&globalThis.process?.type!="renderer";if(i){let{createRequire:Je}=await import("node:module");var s=Je(import.meta.url)}var a=!1;n.setup=function(){if(a)return;a=!0,n.initTBB();function Je(jt,vn,oo=(vo)=>vo){if(vn)for(let vo of vn)jt.push_back(oo(vo));return jt}function ct(jt,vn=(oo)=>oo){let oo=[],vo=jt.size();for(let pi=0;pi<vo;pi++)oo.push(vn(jt.get(pi)));return oo}function Dt(jt,vn=(oo)=>oo){let oo=[],vo=jt.size();for(let pi=0;pi<vo;pi++){let oa=jt.get(pi),ds=oa.size(),Ea=[];for(let Th=0;Th<ds;Th++)Ea.push(vn(oa.get(Th)));oo.push(Ea)}return oo}function tn(jt){if(jt[0].length<3)jt=[jt];return Je(new n.Vector2_vec2,jt,(vn)=>Je(new n.Vector_vec2,vn,(oo)=>{if(oo instanceof Array)return{x:oo[0],y:oo[1]};return oo}))}function xn(jt){for(let vn=0;vn<jt.size();vn++)jt.get(vn).delete();jt.delete()}function Mn(jt){if(jt[0]instanceof Array)return{x:jt[0][0],y:jt[0][1]};if(typeof jt[0]=="number")return{x:jt[0]||0,y:jt[1]||0};return jt[0]}function Ln(jt){if(jt[0]instanceof Array)return{x:jt[0][0],y:jt[0][1],z:jt[0][2]};if(typeof jt[0]=="number")return{x:jt[0]||0,y:jt[1]||0,z:jt[2]||0};return jt[0]}function uo(jt){return jt=="EvenOdd"?0:jt=="NonZero"?1:jt=="Negative"?3:2}function ko(jt){return jt=="Round"?1:jt=="Miter"?2:0}let tr=n.CrossSection;function Dr(jt,vn="Positive"){if(jt instanceof tr)return jt;else{let oo=tn(jt),vo=new tr(oo,uo(vn));return xn(oo),vo}}n.CrossSection.prototype.translate=function(...jt){return this._Translate(Mn(jt))},n.CrossSection.prototype.scale=function(jt){if(typeof jt=="number")return this._Scale({x:jt,y:jt});return this._Scale(Mn([jt]))},n.CrossSection.prototype.mirror=function(jt){return this._Mirror(Mn([jt]))},n.CrossSection.prototype.warp=function(jt){let vn=H0(function(vo){let pi=Me(vo,"double"),oa=Me(vo+8,"double"),ds=[pi,oa];jt(ds),we(vo,ds[0],"double"),we(vo+8,ds[1],"double")},"vi"),oo=this._Warp(vn);return Df(vn),oo},n.CrossSection.prototype.decompose=function(){let jt=this._Decompose(),vn=ct(jt);return jt.delete(),vn},n.CrossSection.prototype.bounds=function(){let jt=this._Bounds();return{min:["x","y"].map((vn)=>jt.min[vn]),max:["x","y"].map((vn)=>jt.max[vn])}},n.CrossSection.prototype.offset=function(jt,vn="Round",oo=2,vo=0){return this._Offset(jt,ko(vn),oo,vo)},n.CrossSection.prototype.simplify=function(jt=0.000001){return this._Simplify(jt)},n.CrossSection.prototype.extrude=function(jt,vn=0,oo=0,vo=[1,1],pi=!1){vo=Mn([vo]);let oa=n._Extrude(this._ToPolygons(),jt,vn,oo,vo);return pi?oa.translate([0,0,-jt/2]):oa},n.CrossSection.prototype.revolve=function(jt=0,vn=360){return n._Revolve(this._ToPolygons(),jt,vn)},n.CrossSection.prototype.add=function(jt){return this._add(Dr(jt))},n.CrossSection.prototype.subtract=function(jt){return this._subtract(Dr(jt))},n.CrossSection.prototype.intersect=function(jt){return this._intersect(Dr(jt))},n.CrossSection.prototype.toPolygons=function(){let jt=this._ToPolygons(),vn=Dt(jt,(oo)=>[oo.x,oo.y]);return jt.delete(),vn},n.Manifold.prototype.smoothOut=function(jt=52.5,vn=0){return this._SmoothOut(jt,vn)},n.Manifold.prototype.warp=function(jt){let vn=H0(function(pi){let oa=Me(pi,"double"),ds=Me(pi+8,"double"),Ea=Me(pi+16,"double"),Th=[oa,ds,Ea];jt(Th),we(pi,Th[0],"double"),we(pi+8,Th[1],"double"),we(pi+16,Th[2],"double")},"vi"),oo=this._Warp(vn);Df(vn);let vo=oo.status();if(vo!=="NoError")throw new n.ManifoldError(vo);return oo},n.Manifold.prototype.warpBatch=function(jt){let vn=H0(function(pi,oa){let ds=n.HEAPF64??L;if(!ds)throw Error("WASM heap is not initialized (HEAPF64 unavailable)");let Ea=new Float64Array(ds.buffer,pi,oa*3);jt(Ea,oa)},"vii"),oo=this._WarpBatch(vn);Df(vn);let vo=oo.status();if(vo!=="NoError")throw new n.ManifoldError(vo);return oo},n.Manifold.prototype.calculateNormals=function(jt=0,vn=52.5){return this._CalculateNormals(jt,vn)},n.Manifold.prototype.smoothByNormals=function(jt=0){return this._SmoothByNormals(jt)},n.Manifold.prototype.setProperties=function(jt,vn){let oo=this.numProp(),vo=H0(function(oa,ds,Ea){let Th=[];for(let Fl=0;Fl<jt;++Fl)Th[Fl]=Me(oa+8*Fl,"double");let xg=[];for(let Fl=0;Fl<3;++Fl)xg[Fl]=Me(ds+8*Fl,"double");let Cg=[];for(let Fl=0;Fl<oo;++Fl)Cg[Fl]=Me(Ea+8*Fl,"double");vn(Th,xg,Cg);for(let Fl=0;Fl<jt;++Fl)we(oa+8*Fl,Th[Fl],"double")},"viii"),pi=this._SetProperties(jt,vo);return Df(vo),pi},n.Manifold.prototype.translate=function(...jt){return this._Translate(Ln(jt))},n.Manifold.prototype.rotate=function(jt,vn,oo){if(Array.isArray(jt))return this._Rotate(...jt);else return this._Rotate(jt,vn||0,oo||0)},n.Manifold.prototype.scale=function(jt){if(typeof jt=="number")return this._Scale({x:jt,y:jt,z:jt});return this._Scale(Ln([jt]))},n.Manifold.prototype.mirror=function(jt){return this._Mirror(Ln([jt]))},n.Manifold.prototype.trimByPlane=function(jt,vn=0){return this._TrimByPlane(Ln([jt]),vn)},n.Manifold.prototype.slice=function(jt=0){let vn=this._Slice(jt),oo=new tr(vn,uo("Positive"));return xn(vn),oo},n.Manifold.prototype.project=function(){let jt=this._Project(),vn=new tr(jt,uo("Positive"));return xn(jt),vn},n.Manifold.prototype.rayCast=function(jt,vn){let oo=this._RayCast(Ln([jt]),Ln([vn])),vo=ct(oo,(pi)=>({faceID:pi.faceID,distance:pi.distance,position:["x","y","z"].map((oa)=>pi.position[oa]),normal:["x","y","z"].map((oa)=>pi.normal[oa])}));return oo.delete(),vo},n.Manifold.prototype.split=function(jt){let vn=this._Split(jt),oo=ct(vn);return vn.delete(),oo},n.Manifold.prototype.splitByPlane=function(jt,vn=0){let oo=this._SplitByPlane(Ln([jt]),vn),vo=ct(oo);return oo.delete(),vo},n.Manifold.prototype.decompose=function(){let jt=this._Decompose(),vn=ct(jt);return jt.delete(),vn},n.Manifold.prototype.boundingBox=function(){let jt=this._boundingBox();return{min:["x","y","z"].map((vn)=>jt.min[vn]),max:["x","y","z"].map((vn)=>jt.max[vn])}},n.Manifold.prototype.simplify=function(jt=0){return this._Simplify(jt)};class ta{constructor({numProp:jt=3,triVerts:vn=new Uint32Array,vertProperties:oo=new Float32Array,mergeFromVert:vo,mergeToVert:pi,runIndex:oa,runOriginalID:ds,faceID:Ea,halfedgeTangent:Th,runTransform:xg,runFlags:Cg,tolerance:Fl=0}={}){this.numProp=jt,this.triVerts=vn,this.vertProperties=oo,this.mergeFromVert=vo,this.mergeToVert=pi,this.runIndex=oa,this.runOriginalID=ds,this.faceID=Ea,this.halfedgeTangent=Th,this.runTransform=xg,this.runFlags=Cg,this.tolerance=Fl}get numTri(){return this.triVerts.length/3}get numVert(){return this.vertProperties.length/this.numProp}get numRun(){return this.runOriginalID.length}merge(){let{changed:jt,mesh:vn}=n._Merge(this);return Object.assign(this,{...vn}),jt}verts(jt){return this.triVerts.subarray(3*jt,3*(jt+1))}position(jt){return this.vertProperties.subarray(this.numProp*jt,this.numProp*jt+3)}extras(jt){return this.vertProperties.subarray(this.numProp*jt+3,this.numProp*(jt+1))}tangent(jt){return this.halfedgeTangent.subarray(4*jt,4*(jt+1))}transform(jt){let vn=Array(16);for(let oo of[0,1,2,3])for(let vo of[0,1,2])vn[4*oo+vo]=this.runTransform[12*jt+3*oo+vo];return vn[15]=1,vn}backside(jt){return this.runFlags!=null&&jt<this.runFlags.length&&(this.runFlags[jt]&1)!==0}hasNormals(jt){return this.runFlags!=null&&jt<this.runFlags.length&&(this.runFlags[jt]&2)!==0}}n.Mesh=ta,n.Manifold.prototype.getMesh=function(jt=-1){return new ta(this._GetMeshJS(jt))},n.ManifoldError=function(vn,...oo){let vo="Unknown error";switch(vn){case"NonFiniteVertex":vo="Non-finite vertex";break;case"NotManifold":vo="Not manifold";break;case"VertexOutOfBounds":vo="Vertex index out of bounds";break;case"PropertiesWrongLength":vo="Properties have wrong length";break;case"MissingPositionProperties":vo="Less than three properties";break;case"MergeVectorsDifferentLengths":vo="Merge vectors have different lengths";break;case"MergeIndexOutOfBounds":vo="Merge index out of bounds";break;case"TransformWrongLength":vo="Transform vector has wrong length";break;case"RunIndexWrongLength":vo="Run index vector has wrong length";break;case"FaceIDWrongLength":vo="Face ID vector has wrong length";break;case"InvalidConstruction":vo="Manifold constructed with invalid parameters";break;case"ResultTooLarge":vo="Result exceeds maximum size";break;case"InvalidTangents":vo="Invalid halfedge tangents";break}let pi=Error.apply(this,[vo,...oo]);pi.name=this.name="ManifoldError",this.message=pi.message,this.stack=pi.stack,this.code=vn},n.ManifoldError.prototype=Object.create(Error.prototype,{constructor:{value:n.ManifoldError,writable:!0,configurable:!0}}),n.CrossSection=function(jt,vn="Positive"){let oo=tn(jt),vo=new tr(oo,uo(vn));return xn(oo),vo},n.CrossSection.ofPolygons=function(jt,vn="Positive"){return new n.CrossSection(jt,vn)},n.CrossSection.square=function(...jt){let vn=void 0;if(jt.length==0)vn={x:1,y:1};else if(typeof jt[0]=="number")vn={x:jt[0],y:jt[0]};else vn=Mn(jt);let oo=jt[1]||!1;return n._Square(vn,oo)},n.CrossSection.circle=function(jt,vn=0){return n._Circle(jt,vn)};function Pa(jt){return function(...vn){if(vn.length==1)vn=vn[0];let oo=new n.Vector_crossSection;for(let pi of vn)oo.push_back(Dr(pi));let vo=n["_crossSection"+jt](oo);return oo.delete(),vo}}n.CrossSection.compose=Pa("Compose"),n.CrossSection.union=Pa("UnionN"),n.CrossSection.difference=Pa("DifferenceN"),n.CrossSection.intersection=Pa("IntersectionN");function Ws(jt,vn){Je(jt,vn,(oo)=>{if(oo instanceof Array)return{x:oo[0],y:oo[1]};return oo})}n.CrossSection.hull=function(...jt){if(jt.length==1)jt=jt[0];let vn=new n.Vector_vec2;for(let vo of jt)if(vo instanceof tr)n._crossSectionCollectVertices(vn,vo);else if(vo instanceof Array&&vo.length==2&&typeof vo[0]=="number")vn.push_back({x:vo[0],y:vo[1]});else if(vo.x)vn.push_back(vo);else{let oa=vo[0].length==2&&typeof vo[0][0]=="number"||vo[0].x?[vo]:vo;for(let ds of oa)Ws(vn,ds)}let oo=n._crossSectionHullPoints(vn);return vn.delete(),oo},n.CrossSection.prototype=Object.create(tr.prototype),Object.defineProperty(n.CrossSection,Symbol.hasInstance,{get:()=>(jt)=>jt instanceof tr});let na=n.Manifold;n.Manifold=function(jt){let vn=new na(jt),oo=vn.status();if(oo!=="NoError")throw new n.ManifoldError(oo);return vn},n.Manifold.ofMesh=function(jt){return new n.Manifold(jt)},n.Manifold.tetrahedron=function(){return n._Tetrahedron()},n.Manifold.cube=function(...jt){let vn=void 0;if(jt.length==0)vn={x:1,y:1,z:1};else if(typeof jt[0]=="number")vn={x:jt[0],y:jt[0],z:jt[0]};else vn=Ln(jt);let oo=jt[1]||!1;return n._Cube(vn,oo)},n.Manifold.cylinder=function(jt,vn,oo=-1,vo=0,pi=!1){return n._Cylinder(jt,vn,oo,vo,pi)},n.Manifold.sphere=function(jt,vn=0){return n._Sphere(jt,vn)},n.Manifold.smooth=function(jt,vn=[]){let oo=new n.Vector_smoothness;Je(oo,vn);let vo=n._Smooth(jt,oo);return oo.delete(),vo},n.Manifold.extrude=function(jt,vn,oo=0,vo=0,pi=[1,1],oa=!1){return(jt instanceof tr?jt:n.CrossSection(jt,"Positive")).extrude(vn,oo,vo,pi,oa)},n.Manifold.revolve=function(jt,vn=0,oo=360){return(jt instanceof tr?jt:n.CrossSection(jt,"Positive")).revolve(vn,oo)},n.Manifold.reserveIDs=function(jt){return n._ReserveIDs(jt)};function vc(jt){return function(...vn){if(vn.length==1)vn=vn[0];let oo=new n.Vector_manifold;for(let pi of vn)oo.push_back(pi);let vo=n["_manifold"+jt+"N"](oo);return oo.delete(),vo}}n.Manifold.union=vc("Union"),n.Manifold.compose=n.Manifold.union,n.Manifold.difference=vc("Difference"),n.Manifold.intersection=vc("Intersection"),n.Manifold.levelSet=function(jt,vn,oo,vo=0,pi=-1){let oa={min:{x:vn.min[0],y:vn.min[1],z:vn.min[2]},max:{x:vn.max[0],y:vn.max[1],z:vn.max[2]}},ds=H0(function(Th){let xg=Me(Th,"double"),Cg=Me(Th+8,"double"),Fl=Me(Th+16,"double");return jt([xg,Cg,Fl])},"di"),Ea=n._LevelSet(ds,oa,oo,vo,pi);return Df(ds),Ea},n.ExecutionContext.prototype.fromMesh=function(jt){return this._FromMesh(jt)},n.ExecutionContext.prototype.smooth=function(jt,vn=[]){let oo=new n.Vector_smoothness;Je(oo,vn);let vo=this._Smooth(jt,oo);return oo.delete(),vo},n.ExecutionContext.prototype.levelSet=function(jt,vn,oo,vo=0,pi=-1){let oa={min:{x:vn.min[0],y:vn.min[1],z:vn.min[2]},max:{x:vn.max[0],y:vn.max[1],z:vn.max[2]}},ds=H0(function(Th){let xg=Me(Th,"double"),Cg=Me(Th+8,"double"),Fl=Me(Th+16,"double");return jt([xg,Cg,Fl])},"di"),Ea=this._LevelSet(ds,oa,oo,vo,pi);return Df(ds),Ea};function zp(jt,vn){Je(jt,vn,(oo)=>{if(oo instanceof Array)return{x:oo[0],y:oo[1],z:oo[2]};return oo})}n.Manifold.hull=function(...jt){if(jt.length==1)jt=jt[0];let vn=new n.Vector_vec3;for(let vo of jt)if(vo instanceof na)n._manifoldCollectVertices(vn,vo);else if(vo instanceof Array&&vo.length==3&&typeof vo[0]=="number")vn.push_back({x:vo[0],y:vo[1],z:vo[2]});else if(vo.x)vn.push_back(vo);else zp(vn,vo);let oo=n._manifoldHullPoints(vn);return vn.delete(),oo},n.Manifold.prototype=Object.create(na.prototype),Object.defineProperty(n.Manifold,Symbol.hasInstance,{get:()=>(jt)=>jt instanceof na}),n.triangulate=function(jt,vn=-1,oo=!0){let vo=tn(jt),pi=ct(n._Triangulate(vo,vn,oo),(oa)=>[oa[0],oa[1],oa[2]]);return xn(vo),pi}};var c=[],l="./this.program",h=(Je,ct)=>{throw ct},d=import.meta.url,u="";function _(Je){if(n.locateFile)return n.locateFile(Je,u);return u+Je}var p,m;if(i){var A=s("node:fs");if(d.startsWith("file:"))u=s("node:path").dirname(s("node:url").fileURLToPath(d))+"/";if(m=(Je)=>{Je=C(Je)?new URL(Je):Je;var ct=A.readFileSync(Je);return ct},p=async(Je,ct=!0)=>{Je=C(Je)?new URL(Je):Je;var Dt=A.readFileSync(Je,ct?void 0:"utf8");return Dt},process.argv.length>1)l=process.argv[1].replace(/\\/g,"/");c=process.argv.slice(2),h=(Je,ct)=>{throw process.exitCode=Je,ct}}else if(o||r){try{u=new URL(".",d).href}catch{}{if(r)m=(Je)=>{var ct=new XMLHttpRequest;return ct.open("GET",Je,!1),ct.responseType="arraybuffer",ct.send(null),new Uint8Array(ct.response)};p=async(Je)=>{if(C(Je))return new Promise((Dt,tn)=>{var xn=new XMLHttpRequest;xn.open("GET",Je,!0),xn.responseType="arraybuffer",xn.onload=()=>{if(xn.status==200||xn.status==0&&xn.response){Dt(xn.response);return}tn(xn.status)},xn.onerror=tn,xn.send(null)});var ct=await fetch(Je,{credentials:"same-origin"});if(ct.ok)return ct.arrayBuffer();throw Error(ct.status+" : "+ct.url)}}}var g=console.log.bind(console),f=console.error.bind(console),y,x=!1,C=(Je)=>Je.startsWith("file://"),b,I,v,P,M,B,T,N,D,L,H,V,O=!1;function U(){var Je=ty.buffer;v=new Int8Array(Je),M=new Int16Array(Je),P=new Uint8Array(Je),B=new Uint16Array(Je),T=new Int32Array(Je),N=new Uint32Array(Je),D=new Float32Array(Je),L=new Float64Array(Je),H=new BigInt64Array(Je),V=new BigUint64Array(Je)}function j(){if(n.preRun){if(typeof n.preRun=="function")n.preRun=[n.preRun];while(n.preRun.length)xe(n.preRun.shift())}ue(Ae)}function Y(){O=!0,S4.J()}function X(){if(n.postRun){if(typeof n.postRun=="function")n.postRun=[n.postRun];while(n.postRun.length)me(n.postRun.shift())}ue(de)}function K(Je){n.onAbort?.(Je),Je="Aborted("+Je+")",f(Je),x=!0,Je+=". Build with -sASSERTIONS for more info.";var ct=new WebAssembly.RuntimeError(Je);throw I?.(ct),ct}var J;function ee(){if(n.locateFile)return _("manifold.wasm");return new URL("manifold.wasm",import.meta.url).href}function se(Je){if(Je==J&&y)return new Uint8Array(y);if(m)return m(Je);throw"both async and sync fetching of the wasm failed"}async function ne(Je){if(!y)try{var ct=await p(Je);return new Uint8Array(ct)}catch{}return se(Je)}async function re(Je,ct){try{var Dt=await ne(Je),tn=await WebAssembly.instantiate(Dt,ct);return tn}catch(xn){f(`failed to asynchronously prepare wasm: ${xn}`),K(xn)}}async function Z(Je,ct,Dt){if(!Je&&!C(ct)&&!i)try{var tn=fetch(ct,{credentials:"same-origin"}),xn=await WebAssembly.instantiateStreaming(tn,Dt);return xn}catch(Mn){f(`wasm streaming compile failed: ${Mn}`),f("falling back to ArrayBuffer instantiation")}return re(ct,Dt)}function te(){var Je={a:$E};return Je}async function ie(){function Je(Mn,Ln){return S4=Mn.exports,S4=v4(S4),s0(S4),U(),S4}function ct(Mn){return Je(Mn.instance)}var Dt=te();if(n.instantiateWasm)return new Promise((Mn,Ln)=>{n.instantiateWasm(Dt,(uo,ko)=>{Mn(Je(uo,ko))})});J??=ee();var tn=await Z(y,J,Dt),xn=ct(tn);return xn}class le{name="ExitStatus";constructor(Je){this.message=`Program terminated with exit(${Je})`,this.status=Je}}var ue=(Je)=>{while(Je.length>0)Je.shift()(n)},de=[],me=(Je)=>de.push(Je),Ae=[],xe=(Je)=>Ae.push(Je);function Me(Je,ct="i8"){if(ct.endsWith("*"))ct="*";switch(ct){case"i1":return v[Je>>>0];case"i8":return v[Je>>>0];case"i16":return M[Je>>>1>>>0];case"i32":return T[Je>>>2>>>0];case"i64":return H[Je>>>3>>>0];case"float":return D[Je>>>2>>>0];case"double":return L[Je>>>3>>>0];case"*":return N[Je>>>2>>>0];default:K(`invalid type for getValue: ${ct}`)}}var Re=!0;function we(Je,ct,Dt="i8"){if(Dt.endsWith("*"))Dt="*";switch(Dt){case"i1":v[Je>>>0]=ct;break;case"i8":v[Je>>>0]=ct;break;case"i16":M[Je>>>1>>>0]=ct;break;case"i32":T[Je>>>2>>>0]=ct;break;case"i64":H[Je>>>3>>>0]=BigInt(ct);break;case"float":D[Je>>>2>>>0]=ct;break;case"double":L[Je>>>3>>>0]=ct;break;case"*":N[Je>>>2>>>0]=ct;break;default:K(`invalid type for setValue: ${Dt}`)}}class _e{constructor(Je){this.excPtr=Je,this.ptr=Je-24}set_type(Je){N[this.ptr+4>>>2>>>0]=Je}get_type(){return N[this.ptr+4>>>2>>>0]}set_destructor(Je){N[this.ptr+8>>>2>>>0]=Je}get_destructor(){return N[this.ptr+8>>>2>>>0]}set_caught(Je){Je=Je?1:0,v[this.ptr+12>>>0]=Je}get_caught(){return v[this.ptr+12>>>0]!=0}set_rethrown(Je){Je=Je?1:0,v[this.ptr+13>>>0]=Je}get_rethrown(){return v[this.ptr+13>>>0]!=0}init(Je,ct){this.set_adjusted_ptr(0),this.set_type(Je),this.set_destructor(ct)}set_adjusted_ptr(Je){N[this.ptr+16>>>2>>>0]=Je}get_adjusted_ptr(){return N[this.ptr+16>>>2>>>0]}}var ye=0,Se=0;function Ne(Je,ct,Dt){Je>>>=0,ct>>>=0,Dt>>>=0;var tn=new _e(Je);throw tn.init(ct,Dt),ye=Je,Se++,ye}var ke=()=>K(""),nt={},dt=(Je)=>{while(Je.length){var ct=Je.pop(),Dt=Je.pop();Dt(ct)}};function rt(Je){return this.fromWireType(N[Je>>>2>>>0])}var mt={},lt={},Ct={},Nt=class extends Error{constructor(ct){super(ct);this.name="InternalError"}},Ht=(Je)=>{throw new Nt(Je)},Tt=(Je,ct,Dt)=>{Je.forEach((uo)=>Ct[uo]=ct);function tn(uo){var ko=Dt(uo);if(ko.length!==Je.length)Ht("Mismatched type converter count");for(var tr=0;tr<Je.length;++tr)Ze(Je[tr],ko[tr])}var xn=Array(ct.length),Mn=[],Ln=0;for(let[uo,ko]of ct.entries())if(lt.hasOwnProperty(ko))xn[uo]=lt[ko];else{if(Mn.push(ko),!mt.hasOwnProperty(ko))mt[ko]=[];mt[ko].push(()=>{if(xn[uo]=lt[ko],++Ln,Ln===Mn.length)tn(xn)})}if(Mn.length===0)tn(xn)},et=function(Je){Je>>>=0;var ct=nt[Je];delete nt[Je];var{rawConstructor:Dt,rawDestructor:tn,fields:xn}=ct,Mn=xn.map((Ln)=>Ln.getterReturnType).concat(xn.map((Ln)=>Ln.setterArgumentType));Tt([Je],Mn,(Ln)=>{var uo={};for(var[ko,tr]of xn.entries()){let Dr=Ln[ko],{getter:ta,getterContext:Pa}=tr,Ws=Ln[ko+xn.length],{setter:na,setterContext:vc}=tr;uo[tr.fieldName]={read:(zp)=>Dr.fromWireType(ta(Pa,zp)),write:(zp,jt)=>{var vn=[];na(vc,zp,Ws.toWireType(vn,jt)),dt(vn)},optional:Dr.optional}}return[{name:ct.name,fromWireType:(Dr)=>{var ta={};for(var Pa in uo)ta[Pa]=uo[Pa].read(Dr);return tn(Dr),ta},toWireType:(Dr,ta)=>{for(var Pa in uo)if(!(Pa in ta)&&!uo[Pa].optional)throw TypeError(`Missing field: "${Pa}"`);var Ws=Dt();for(Pa in uo)uo[Pa].write(Ws,ta[Pa]);if(Dr!==null)Dr.push(tn,Ws);return Ws},readValueFromPointer:rt,destructorFunction:tn}]})},vt=(Je)=>{Je>>>=0;var ct="";while(!0){var Dt=P[Je++>>>0];if(!Dt)return ct;ct+=String.fromCharCode(Dt)}},ht=class extends Error{constructor(ct){super(ct);this.name="BindingError"}},We=(Je)=>{throw new ht(Je)};function Le(Je,ct,Dt={}){var tn=ct.name;if(!Je)We(`type "${tn}" must have a positive integer typeid pointer`);if(lt.hasOwnProperty(Je))if(Dt.ignoreDuplicateRegistrations)return;else We(`Cannot register type '${tn}' twice`);if(lt[Je]=ct,delete Ct[Je],mt.hasOwnProperty(Je)){var xn=mt[Je];delete mt[Je],xn.forEach((Mn)=>Mn())}}function Ze(Je,ct,Dt={}){return Le(Je,ct,Dt)}var $e=(Je,ct,Dt)=>{switch(ct){case 1:return Dt?(tn)=>v[tn>>>0]:(tn)=>P[tn>>>0];case 2:return Dt?(tn)=>M[tn>>>1>>>0]:(tn)=>B[tn>>>1>>>0];case 4:return Dt?(tn)=>T[tn>>>2>>>0]:(tn)=>N[tn>>>2>>>0];case 8:return Dt?(tn)=>H[tn>>>3>>>0]:(tn)=>V[tn>>>3>>>0];default:throw TypeError(`invalid integer width (${ct}): ${Je}`)}},qe=function(Je,ct,Dt,tn,xn){Je>>>=0,ct>>>=0,Dt>>>=0,ct=vt(ct);let Mn=tn===0n,Ln=(uo)=>uo;if(Mn){let uo=Dt*8;Ln=(ko)=>BigInt.asUintN(uo,ko),xn=Ln(xn)}Ze(Je,{name:ct,fromWireType:Ln,toWireType:(uo,ko)=>{if(typeof ko=="number")ko=BigInt(ko);return ko},readValueFromPointer:$e(ct,Dt,!Mn),destructorFunction:null})};function ft(Je,ct,Dt,tn){Je>>>=0,ct>>>=0,ct=vt(ct),Ze(Je,{name:ct,fromWireType:function(xn){return!!xn},toWireType:function(xn,Mn){return Mn?Dt:tn},readValueFromPointer:function(xn){return this.fromWireType(P[xn>>>0])},destructorFunction:null})}var It=(Je)=>({count:Je.count,deleteScheduled:Je.deleteScheduled,preservePointerOnDelete:Je.preservePointerOnDelete,ptr:Je.ptr,ptrType:Je.ptrType,smartPtr:Je.smartPtr,smartPtrType:Je.smartPtrType}),ze=(Je)=>{function ct(Dt){return Dt.$$.ptrType.registeredClass.name}We(ct(Je)+" instance already deleted")},Xe=!1,it=(Je)=>{},St=(Je)=>{if(Je.smartPtr)Je.smartPtrType.rawDestructor(Je.smartPtr);else Je.ptrType.registeredClass.rawDestructor(Je.ptr)},kt=(Je)=>{Je.count.value-=1;var ct=Je.count.value===0;if(ct)St(Je)},Lt=(Je)=>{if(!globalThis.FinalizationRegistry)return Lt=(ct)=>ct,Je;return Xe=new FinalizationRegistry((ct)=>{kt(ct.$$)}),Lt=(ct)=>{var Dt=ct.$$,tn=!!Dt.smartPtr;if(tn){var xn={$$:Dt};Xe.register(ct,xn,ct)}return ct},it=(ct)=>Xe.unregister(ct),Lt(Je)},Wt=[],bn=()=>{while(Wt.length){var Je=Wt.pop();Je.$$.deleteScheduled=!1,Je.delete()}},pn,wn=()=>{let Je=Fn.prototype;Object.assign(Je,{isAliasOf(Dt){if(!(this instanceof Fn))return!1;if(!(Dt instanceof Fn))return!1;var tn=this.$$.ptrType.registeredClass,xn=this.$$.ptr;Dt.$$=Dt.$$;var Mn=Dt.$$.ptrType.registeredClass,Ln=Dt.$$.ptr;while(tn.baseClass)xn=tn.upcast(xn),tn=tn.baseClass;while(Mn.baseClass)Ln=Mn.upcast(Ln),Mn=Mn.baseClass;return tn===Mn&&xn===Ln},clone(){if(!this.$$.ptr)ze(this);if(this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;else{var Dt=Lt(Object.create(Object.getPrototypeOf(this),{$$:{value:It(this.$$)}}));return Dt.$$.count.value+=1,Dt.$$.deleteScheduled=!1,Dt}},delete(){if(!this.$$.ptr)ze(this);if(this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete)We("Object already scheduled for deletion");if(it(this),kt(this.$$),!this.$$.preservePointerOnDelete)this.$$.smartPtr=void 0,this.$$.ptr=void 0},isDeleted(){return!this.$$.ptr},deleteLater(){if(!this.$$.ptr)ze(this);if(this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete)We("Object already scheduled for deletion");if(Wt.push(this),Wt.length===1&&pn)pn(bn);return this.$$.deleteScheduled=!0,this}});let ct=Symbol.dispose;if(ct)Je[ct]=Je.delete};function Fn(){}var mn=(Je,ct)=>Object.defineProperty(ct,"name",{value:Je}),_n={},no=(Je,ct,Dt)=>{if(Je[ct].overloadTable===void 0){var tn=Je[ct];Je[ct]=function(...xn){if(!Je[ct].overloadTable.hasOwnProperty(xn.length))We(`Function '${Dt}' called with an invalid number of arguments (${xn.length}) - expects one of (${Je[ct].overloadTable})!`);return Je[ct].overloadTable[xn.length].apply(this,xn)},Je[ct].overloadTable=[],Je[ct].overloadTable[tn.argCount]=tn}},To=(Je,ct,Dt)=>{if(n.hasOwnProperty(Je)){if(Dt===void 0||n[Je].overloadTable!==void 0&&n[Je].overloadTable[Dt]!==void 0)We(`Cannot register public name '${Je}' twice`);if(no(n,Je,Je),n[Je].overloadTable.hasOwnProperty(Dt))We(`Cannot register multiple overloads of a function with the same number of arguments (${Dt})!`);n[Je].overloadTable[Dt]=ct}else n[Je]=ct,n[Je].argCount=Dt},ir=48,xt=57,gt=(Je)=>{Je=Je.replace(/[^a-zA-Z0-9_]/g,"$");var ct=Je.charCodeAt(0);if(ct>=ir&&ct<=xt)return`_${Je}`;return Je};function Ot(Je,ct,Dt,tn,xn,Mn,Ln,uo){this.name=Je,this.constructor=ct,this.instancePrototype=Dt,this.rawDestructor=tn,this.baseClass=xn,this.getActualType=Mn,this.upcast=Ln,this.downcast=uo,this.pureVirtualFunctions=[]}var Zt=(Je,ct,Dt)=>{while(ct!==Dt){if(!ct.upcast)We(`Expected null or instance of ${Dt.name}, got an instance of ${ct.name}`);Je=ct.upcast(Je),ct=ct.baseClass}return Je},je=(Je)=>{if(Je===null)return"null";var ct=typeof Je;if(ct==="object"||ct==="array"||ct==="function")return Je.toString();else return""+Je};function Mt(Je,ct){if(ct===null){if(this.isReference)We(`null is not a valid ${this.name}`);return 0}if(!ct.$$)We(`Cannot pass "${je(ct)}" as a ${this.name}`);if(!ct.$$.ptr)We(`Cannot pass deleted object as a pointer of type ${this.name}`);var Dt=ct.$$.ptrType.registeredClass,tn=Zt(ct.$$.ptr,Dt,this.registeredClass);return tn}function Kt(Je,ct){var Dt;if(ct===null){if(this.isReference)We(`null is not a valid ${this.name}`);if(this.isSmartPointer){if(Dt=this.rawConstructor(),Je!==null)Je.push(this.rawDestructor,Dt);return Dt}else return 0}if(!ct||!ct.$$)We(`Cannot pass "${je(ct)}" as a ${this.name}`);if(!ct.$$.ptr)We(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.isConst&&ct.$$.ptrType.isConst)We(`Cannot convert argument of type ${ct.$$.smartPtrType?ct.$$.smartPtrType.name:ct.$$.ptrType.name} to parameter type ${this.name}`);var tn=ct.$$.ptrType.registeredClass;if(Dt=Zt(ct.$$.ptr,tn,this.registeredClass),this.isSmartPointer){if(ct.$$.smartPtr===void 0)We("Passing raw pointer to smart pointer is illegal");switch(this.sharingPolicy){case 0:if(ct.$$.smartPtrType===this)Dt=ct.$$.smartPtr;else We(`Cannot convert argument of type ${ct.$$.smartPtrType?ct.$$.smartPtrType.name:ct.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:Dt=ct.$$.smartPtr;break;case 2:if(ct.$$.smartPtrType===this)Dt=ct.$$.smartPtr;else{var xn=ct.clone();if(Dt=this.rawShare(Dt,ti.toHandle(()=>xn.delete())),Je!==null)Je.push(this.rawDestructor,Dt)}break;default:We("Unsupported sharing policy")}}return Dt}function nn(Je,ct){if(ct===null){if(this.isReference)We(`null is not a valid ${this.name}`);return 0}if(!ct.$$)We(`Cannot pass "${je(ct)}" as a ${this.name}`);if(!ct.$$.ptr)We(`Cannot pass deleted object as a pointer of type ${this.name}`);if(ct.$$.ptrType.isConst)We(`Cannot convert argument of type ${ct.$$.ptrType.name} to parameter type ${this.name}`);var Dt=ct.$$.ptrType.registeredClass,tn=Zt(ct.$$.ptr,Dt,this.registeredClass);return tn}var Zn=(Je,ct,Dt)=>{if(ct===Dt)return Je;if(Dt.baseClass===void 0)return null;var tn=Zn(Je,ct,Dt.baseClass);if(tn===null)return null;return Dt.downcast(tn)},Vn={},Rn=(Je,ct)=>{if(ct===void 0)We("ptr should not be undefined");while(Je.baseClass)ct=Je.upcast(ct),Je=Je.baseClass;return ct},Bn=(Je,ct)=>(ct=Rn(Je,ct),Vn[ct]),ho=(Je,ct)=>{if(!ct.ptrType||!ct.ptr)Ht("makeClassHandle requires ptr and ptrType");var Dt=!!ct.smartPtrType,tn=!!ct.smartPtr;if(Dt!==tn)Ht("Both smartPtrType and smartPtr must be specified");return ct.count={value:1},Lt(Object.create(Je,{$$:{value:ct,writable:!0}}))};function Qo(Je){var ct=this.getPointee(Je);if(!ct)return this.destructor(Je),null;var Dt=Bn(this.registeredClass,ct);if(Dt!==void 0)if(Dt.$$.count.value===0)return Dt.$$.ptr=ct,Dt.$$.smartPtr=Je,Dt.clone();else{var tn=Dt.clone();return this.destructor(Je),tn}function xn(){if(this.isSmartPointer)return ho(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:ct,smartPtrType:this,smartPtr:Je});else return ho(this.registeredClass.instancePrototype,{ptrType:this,ptr:Je})}var Mn=this.registeredClass.getActualType(ct),Ln=_n[Mn];if(!Ln)return xn.call(this);var uo;if(this.isConst)uo=Ln.constPointerType;else uo=Ln.pointerType;var ko=Zn(ct,this.registeredClass,uo.registeredClass);if(ko===null)return xn.call(this);if(this.isSmartPointer)return ho(uo.registeredClass.instancePrototype,{ptrType:uo,ptr:ko,smartPtrType:this,smartPtr:Je});else return ho(uo.registeredClass.instancePrototype,{ptrType:uo,ptr:ko})}var Nn=()=>{Object.assign(mo.prototype,{getPointee(Je){if(this.rawGetPointee)Je=this.rawGetPointee(Je);return Je},destructor(Je){this.rawDestructor?.(Je)},readValueFromPointer:rt,fromWireType:Qo})};function mo(Je,ct,Dt,tn,xn,Mn,Ln,uo,ko,tr,Dr){if(this.name=Je,this.registeredClass=ct,this.isReference=Dt,this.isConst=tn,this.isSmartPointer=xn,this.pointeeType=Mn,this.sharingPolicy=Ln,this.rawGetPointee=uo,this.rawConstructor=ko,this.rawShare=tr,this.rawDestructor=Dr,!xn&&ct.baseClass===void 0)if(tn)this.toWireType=Mt,this.destructorFunction=null;else this.toWireType=nn,this.destructorFunction=null;else this.toWireType=Kt}var Io=(Je,ct,Dt)=>{if(!n.hasOwnProperty(Je))Ht("Replacing nonexistent public symbol");if(n[Je].overloadTable!==void 0&&Dt!==void 0)n[Je].overloadTable[Dt]=ct;else n[Je]=ct,n[Je].argCount=Dt},io=(Je)=>ny.get(Je),Wo=(Je,ct,Dt=[],tn=!1)=>{var xn=io(ct),Mn=xn(...Dt);function Ln(uo){return Je[0]=="p"?uo>>>0:uo}return Ln(Mn)},rr=(Je,ct,Dt=!1)=>(...tn)=>Wo(Je,ct,tn,Dt),xr=(Je,ct,Dt=!1)=>{Je=vt(Je);function tn(){if(Je.includes("p"))return rr(Je,ct,Dt);var Mn=io(ct);return Mn}var xn=tn();if(typeof xn!="function")We(`unknown function pointer with signature ${Je}: ${ct}`);return xn};class Ci extends Error{}var ea=(Je)=>{var ct=Fp(Je),Dt=vt(ct);return lh(ct),Dt},ya=(Je,ct)=>{var Dt=[],tn={};function xn(Mn){if(tn[Mn])return;if(lt[Mn])return;if(Ct[Mn]){Ct[Mn].forEach(xn);return}Dt.push(Mn),tn[Mn]=!0}throw ct.forEach(xn),new Ci(`${Je}: `+Dt.map(ea).join([", "]))};function Oo(Je,ct,Dt,tn,xn,Mn,Ln,uo,ko,tr,Dr,ta,Pa){Je>>>=0,ct>>>=0,Dt>>>=0,tn>>>=0,xn>>>=0,Mn>>>=0,Ln>>>=0,uo>>>=0,ko>>>=0,tr>>>=0,Dr>>>=0,ta>>>=0,Pa>>>=0,Dr=vt(Dr),Mn=xr(xn,Mn),uo&&=xr(Ln,uo),tr&&=xr(ko,tr),Pa=xr(ta,Pa);var Ws=gt(Dr);To(Ws,function(){ya(`Cannot construct ${Dr} due to unbound types`,[tn])}),Tt([Je,ct,Dt],tn?[tn]:[],(na)=>{na=na[0];var vc,zp;if(tn)vc=na.registeredClass,zp=vc.instancePrototype;else zp=Fn.prototype;var jt=mn(Dr,function(...ds){if(Object.getPrototypeOf(this)!==vn)throw new ht(`Use 'new' to construct ${Dr}`);if(oo.constructor_body===void 0)throw new ht(`${Dr} has no accessible constructor`);var Ea=oo.constructor_body[ds.length];if(Ea===void 0)throw new ht(`Tried to invoke ctor of ${Dr} with invalid number of parameters (${ds.length}) - expected (${Object.keys(oo.constructor_body).toString()}) parameters instead!`);return Ea.apply(this,ds)}),vn=Object.create(zp,{constructor:{value:jt}});jt.prototype=vn;var oo=new Ot(Dr,jt,vn,Pa,vc,Mn,uo,tr);if(oo.baseClass)oo.baseClass.__derivedClasses??=[],oo.baseClass.__derivedClasses.push(oo);var vo=new mo(Dr,oo,!0,!1,!1),pi=new mo(Dr+"*",oo,!1,!1,!1),oa=new mo(Dr+" const*",oo,!1,!0,!1);return _n[Je]={pointerType:pi,constPointerType:oa},Io(Ws,jt),[vo,pi,oa]})}var $i=(Je,ct)=>{var Dt=[];for(var tn=0;tn<Je;tn++)Dt.push(N[ct+tn*4>>>2>>>0]);return Dt};function Ei(Je){for(var ct=1;ct<Je.length;++ct)if(Je[ct]!==null&&Je[ct].destructorFunction===void 0)return!0;return!1}function hs(Je,ct,Dt,tn){var xn=Ei(Je),Mn=Je.length-2,Ln=[],uo=["fn"];if(ct)uo.push("thisWired");for(var ko=0;ko<Mn;++ko)Ln.push(`arg${ko}`),uo.push(`arg${ko}Wired`);Ln=Ln.join(","),uo=uo.join(",");var tr=`return function (${Ln}) {
`;if(xn)tr+=`var destructors = [];
`;var Dr=xn?"destructors":"null",ta=["humanName","throwBindingError","invoker","fn","runDestructors","fromRetWire","toClassParamWire"];if(ct)tr+=`var thisWired = toClassParamWire(${Dr}, this);
`;for(var ko=0;ko<Mn;++ko){var Pa=`toArg${ko}Wire`;tr+=`var arg${ko}Wired = ${Pa}(${Dr}, arg${ko});
`,ta.push(Pa)}if(tr+=(Dt||tn?"var rv = ":"")+`invoker(${uo});
`,xn)tr+=`runDestructors(destructors);
`;else for(var ko=ct?1:2;ko<Je.length;++ko){var Ws=ko===1?"thisWired":"arg"+(ko-2)+"Wired";if(Je[ko].destructorFunction!==null)tr+=`${Ws}_dtor(${Ws});
`,ta.push(`${Ws}_dtor`)}if(Dt)tr+=`var ret = fromRetWire(rv);
return ret;
`;return tr+=`}
`,Function(ta,tr)}function il(Je,ct,Dt,tn,xn,Mn){var Ln=ct.length;if(Ln<2)We("argTypes array size mismatch! Must at least get return value and 'this' types!");var uo=ct[1]!==null&&Dt!==null,ko=Ei(ct),tr=!ct[0].isVoid,Dr=ct[0],ta=ct[1],Pa=[Je,We,tn,xn,dt,Dr.fromWireType.bind(Dr),ta?.toWireType.bind(ta)];for(var Ws=2;Ws<Ln;++Ws){var na=ct[Ws];Pa.push(na.toWireType.bind(na))}if(!ko){for(var Ws=uo?1:2;Ws<ct.length;++Ws)if(ct[Ws].destructorFunction!==null)Pa.push(ct[Ws].destructorFunction)}var zp=hs(ct,uo,tr,Mn)(...Pa);return mn(Je,zp)}var kl=function(Je,ct,Dt,tn,xn,Mn){Je>>>=0,Dt>>>=0,tn>>>=0,xn>>>=0,Mn>>>=0;var Ln=$i(ct,Dt);xn=xr(tn,xn),Tt([],[Je],(uo)=>{uo=uo[0];var ko=`constructor ${uo.name}`;if(uo.registeredClass.constructor_body===void 0)uo.registeredClass.constructor_body=[];if(uo.registeredClass.constructor_body[ct-1]!==void 0)throw new ht(`Cannot register multiple constructors with identical number of parameters (${ct-1}) for class '${uo.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return uo.registeredClass.constructor_body[ct-1]=()=>{ya(`Cannot construct ${uo.name} due to unbound types`,Ln)},Tt([],Ln,(tr)=>(tr.splice(1,0,null),uo.registeredClass.constructor_body[ct-1]=il(ko,tr,null,xn,Mn),[])),[]})},Xc=(Je)=>{Je=Je.trim();let ct=Je.indexOf("(");if(ct===-1)return Je;return Je.slice(0,ct)},Od=function(Je,ct,Dt,tn,xn,Mn,Ln,uo,ko,tr){Je>>>=0,ct>>>=0,tn>>>=0,xn>>>=0,Mn>>>=0,Ln>>>=0;var Dr=$i(Dt,tn);ct=vt(ct),ct=Xc(ct),Mn=xr(xn,Mn,ko),Tt([],[Je],(ta)=>{ta=ta[0];var Pa=`${ta.name}.${ct}`;if(ct.startsWith("@@"))ct=Symbol[ct.substring(2)];if(uo)ta.registeredClass.pureVirtualFunctions.push(ct);function Ws(){ya(`Cannot call ${Pa} due to unbound types`,Dr)}var na=ta.registeredClass.instancePrototype,vc=na[ct];if(vc===void 0||vc.overloadTable===void 0&&vc.className!==ta.name&&vc.argCount===Dt-2)Ws.argCount=Dt-2,Ws.className=ta.name,na[ct]=Ws;else no(na,ct,Pa),na[ct].overloadTable[Dt-2]=Ws;return Tt([],Dr,(zp)=>{var jt=il(Pa,zp,ta,Mn,Ln,ko);if(na[ct].overloadTable===void 0)jt.argCount=Dt-2,na[ct]=jt;else na[ct].overloadTable[Dt-2]=jt;return[]}),[]})},cp=[],or=[0,1,,1,null,1,!0,1,!1,1];function Gr(Je){if(Je>>>=0,Je>9&&--or[Je+1]===0)or[Je]=void 0,cp.push(Je)}var ti={toValue:(Je)=>{if(!Je)We(`Cannot use deleted val. handle = ${Je}`);return or[Je]},toHandle:(Je)=>{switch(Je){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{let ct=cp.pop()||or.length;return or[ct]=Je,or[ct+1]=1,ct}}}},$l={name:"emscripten::val",fromWireType:(Je)=>{var ct=ti.toValue(Je);return Gr(Je),ct},toWireType:(Je,ct)=>ti.toHandle(ct),readValueFromPointer:rt,destructorFunction:null};function Ll(Je){return Je>>>=0,Ze(Je,$l)}var Vd=(Je,ct,Dt)=>{switch(ct){case 1:return Dt?function(tn){return this.fromWireType(v[tn>>>0])}:function(tn){return this.fromWireType(P[tn>>>0])};case 2:return Dt?function(tn){return this.fromWireType(M[tn>>>1>>>0])}:function(tn){return this.fromWireType(B[tn>>>1>>>0])};case 4:return Dt?function(tn){return this.fromWireType(T[tn>>>2>>>0])}:function(tn){return this.fromWireType(N[tn>>>2>>>0])};default:throw TypeError(`invalid integer width (${ct}): ${Je}`)}};function $1(Je){return Je===0?"object":Je===1?"number":"string"}function fm(Je,ct,Dt,tn,xn){Je>>>=0,ct>>>=0,Dt>>>=0,ct=vt(ct);let Mn=$1(xn);switch(Mn){case"object":{let tr=function(){};tr.values={},Ze(Je,{name:ct,constructor:tr,valueType:Mn,fromWireType:function(Dr){return this.constructor.values[Dr]},toWireType:(Dr,ta)=>ta.value,readValueFromPointer:Vd(ct,Dt,tn),destructorFunction:null}),To(ct,tr);break}case"number":{var Ln={};Ze(Je,{name:ct,keysMap:Ln,valueType:Mn,fromWireType:(tr)=>tr,toWireType:(tr,Dr)=>Dr,readValueFromPointer:Vd(ct,Dt,tn),destructorFunction:null}),To(ct,Ln),delete n[ct].argCount;break}case"string":{var uo={},ko={},Ln={};Ze(Je,{name:ct,valuesMap:uo,reverseMap:ko,keysMap:Ln,valueType:Mn,fromWireType:function(Dr){return this.reverseMap[Dr]},toWireType:function(Dr,ta){return this.valuesMap[ta]},readValueFromPointer:Vd(ct,Dt,tn),destructorFunction:null}),To(ct,Ln),delete n[ct].argCount;break}}}var xa=(Je,ct)=>{var Dt=lt[Je];if(Dt===void 0)We(`${ct} has unknown type ${ea(Je)}`);return Dt};function k0(Je,ct,Dt){Je>>>=0,ct>>>=0;var tn=xa(Je,"enum");switch(ct=vt(ct),tn.valueType){case"object":{var xn=tn.constructor,Mn=Object.create(tn.constructor.prototype,{value:{value:Dt},constructor:{value:mn(`${tn.name}_${ct}`,function(){})}});xn.values[Dt]=Mn,xn[ct]=Mn;break}case"number":{tn.keysMap[ct]=Dt;break}case"string":{tn.valuesMap[ct]=Dt,tn.reverseMap[Dt]=ct,tn.keysMap[ct]=ct;break}}}var ym=(Je,ct)=>{switch(ct){case 4:return function(Dt){return this.fromWireType(D[Dt>>>2>>>0])};case 8:return function(Dt){return this.fromWireType(L[Dt>>>3>>>0])};default:throw TypeError(`invalid float width (${ct}): ${Je}`)}},_u=function(Je,ct,Dt){Je>>>=0,ct>>>=0,Dt>>>=0,ct=vt(ct),Ze(Je,{name:ct,fromWireType:(tn)=>tn,toWireType:(tn,xn)=>xn,readValueFromPointer:ym(ct,Dt),destructorFunction:null})};function o0(Je,ct,Dt,tn,xn,Mn,Ln,uo){Je>>>=0,Dt>>>=0,tn>>>=0,xn>>>=0,Mn>>>=0;var ko=$i(ct,Dt);Je=vt(Je),Je=Xc(Je),xn=xr(tn,xn,Ln),To(Je,function(){ya(`Cannot call ${Je} due to unbound types`,ko)},ct-1),Tt([],ko,(tr)=>{var Dr=[tr[0],null].concat(tr.slice(1));return Io(Je,il(Je,Dr,null,xn,Mn,Ln),ct-1),[]})}var Zi=function(Je,ct,Dt,tn,xn){Je>>>=0,ct>>>=0,Dt>>>=0,ct=vt(ct);let Mn=tn===0,Ln=(ko)=>ko;if(Mn){var uo=32-8*Dt;Ln=(ko)=>ko<<uo>>>uo,xn=Ln(xn)}Ze(Je,{name:ct,fromWireType:Ln,toWireType:(ko,tr)=>tr,readValueFromPointer:$e(ct,Dt,tn!==0),destructorFunction:null})},Hl=(Je,ct,Dt)=>{let tn=(xn,Mn)=>{let Ln=0;return{next(){if(Ln>=xn)return{done:!0};let uo=Ln;return Ln++,{value:Mn(uo),done:!1}},[Symbol.iterator](){return this}}};if(!Je[Symbol.iterator])Je[Symbol.iterator]=function(){let xn=this[ct]();return tn(xn,(Mn)=>this[Dt](Mn))}},da=function(Je,ct,Dt,tn){Je>>>=0,ct>>>=0,Dt>>>=0,tn>>>=0,Dt=vt(Dt),tn=vt(tn),Tt([],[Je,ct],(xn)=>{let Mn=xn[0];return Hl(Mn.registeredClass.instancePrototype,Dt,tn),[]})};function zc(Je,ct,Dt){Je>>>=0,Dt>>>=0;var tn=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array],xn=tn[ct];function Mn(Ln){var uo=N[Ln>>>2>>>0],ko=N[Ln+4>>>2>>>0];return new xn(v.buffer,ko,uo)}Dt=vt(Dt),Ze(Je,{name:Dt,fromWireType:Mn,readValueFromPointer:Mn},{ignoreDuplicateRegistrations:!0})}var ua=Object.assign({optional:!0},$l);function ri(Je,ct){Je>>>=0,ct>>>=0,Ze(Je,ua)}var ic=(Je,ct,Dt,tn)=>{if(Dt>>>=0,!(tn>0))return 0;var xn=Dt,Mn=Dt+tn-1;for(var Ln=0;Ln<Je.length;++Ln){var uo=Je.codePointAt(Ln);if(uo<=127){if(Dt>=Mn)break;ct[Dt++>>>0]=uo}else if(uo<=2047){if(Dt+1>=Mn)break;ct[Dt++>>>0]=192|uo>>6,ct[Dt++>>>0]=128|uo&63}else if(uo<=65535){if(Dt+2>=Mn)break;ct[Dt++>>>0]=224|uo>>12,ct[Dt++>>>0]=128|uo>>6&63,ct[Dt++>>>0]=128|uo&63}else{if(Dt+3>=Mn)break;ct[Dt++>>>0]=240|uo>>18,ct[Dt++>>>0]=128|uo>>12&63,ct[Dt++>>>0]=128|uo>>6&63,ct[Dt++>>>0]=128|uo&63,Ln++}}return ct[Dt>>>0]=0,Dt-xn},wh=(Je,ct,Dt)=>ic(Je,P,ct,Dt),Qs=(Je)=>{var ct=0;for(var Dt=0;Dt<Je.length;++Dt){var tn=Je.charCodeAt(Dt);if(tn<=127)ct++;else if(tn<=2047)ct+=2;else if(tn>=55296&&tn<=57343)ct+=4,++Dt;else ct+=3}return ct},Yd=globalThis.TextDecoder&&new TextDecoder,Bh=(Je,ct,Dt,tn)=>{var xn=ct+Dt;if(tn)return xn;while(Je[ct]&&!(ct>=xn))++ct;return ct},Gd=(Je,ct=0,Dt,tn)=>{ct>>>=0;var xn=Bh(Je,ct,Dt,tn);if(xn-ct>16&&Je.buffer&&Yd)return Yd.decode(Je.subarray(ct,xn));var Mn="";while(ct<xn){var Ln=Je[ct++];if(!(Ln&128)){Mn+=String.fromCharCode(Ln);continue}var uo=Je[ct++]&63;if((Ln&224)==192){Mn+=String.fromCharCode((Ln&31)<<6|uo);continue}var ko=Je[ct++]&63;if((Ln&240)==224)Ln=(Ln&15)<<12|uo<<6|ko;else Ln=(Ln&7)<<18|uo<<12|ko<<6|Je[ct++]&63;if(Ln<65536)Mn+=String.fromCharCode(Ln);else{var tr=Ln-65536;Mn+=String.fromCharCode(55296|tr>>10,56320|tr&1023)}}return Mn},gA=(Je,ct,Dt)=>(Je>>>=0,Je?Gd(P,Je,ct,Dt):"");function r0(Je,ct){Je>>>=0,ct>>>=0,ct=vt(ct);var Dt=!0;Ze(Je,{name:ct,fromWireType(tn){var xn=N[tn>>>2>>>0],Mn=tn+4,Ln;if(Dt)Ln=gA(Mn,xn,!0);else{Ln="";for(var uo=0;uo<xn;++uo)Ln+=String.fromCharCode(P[Mn+uo>>>0])}return lh(tn),Ln},toWireType(tn,xn){if(xn instanceof ArrayBuffer)xn=new Uint8Array(xn);var Mn,Ln=typeof xn=="string";if(!(Ln||ArrayBuffer.isView(xn)&&xn.BYTES_PER_ELEMENT==1))We("Cannot pass non-string to std::string");if(Dt&&Ln)Mn=Qs(xn);else Mn=xn.length;var uo=uI(4+Mn+1),ko=uo+4;if(N[uo>>>2>>>0]=Mn,Ln)if(Dt)wh(xn,ko,Mn+1);else for(var tr=0;tr<Mn;++tr){var Dr=xn.charCodeAt(tr);if(Dr>255)lh(uo),We("String has UTF-16 code units that do not fit in 8 bits");P[ko+tr>>>0]=Dr}else P.set(xn,ko>>>0);if(tn!==null)tn.push(lh,uo);return uo},readValueFromPointer:rt,destructorFunction(tn){lh(tn)}})}var q1=globalThis.TextDecoder?new TextDecoder("utf-16le"):void 0,Tf=(Je,ct,Dt)=>{var tn=Je>>>1,xn=Bh(B,tn,ct/2,Dt);if(xn-tn>16&&q1)return q1.decode(B.subarray(tn>>>0,xn>>>0));var Mn="";for(var Ln=tn;Ln<xn;++Ln){var uo=B[Ln>>>0];Mn+=String.fromCharCode(uo)}return Mn},lp=(Je,ct,Dt)=>{if(Dt??=2147483647,Dt<2)return 0;Dt-=2;var tn=ct,xn=Dt<Je.length*2?Dt/2:Je.length;for(var Mn=0;Mn<xn;++Mn){var Ln=Je.charCodeAt(Mn);M[ct>>>1>>>0]=Ln,ct+=2}return M[ct>>>1>>>0]=0,ct-tn},fg=(Je)=>Je.length*2,gu=(Je,ct,Dt)=>{var tn="",xn=Je>>>2;for(var Mn=0;!(Mn>=ct/4);Mn++){var Ln=N[xn+Mn>>>0];if(!Ln&&!Dt)break;tn+=String.fromCodePoint(Ln)}return tn},a_=(Je,ct,Dt)=>{if(ct>>>=0,Dt??=2147483647,Dt<4)return 0;var tn=ct,xn=tn+Dt-4;for(var Mn=0;Mn<Je.length;++Mn){var Ln=Je.codePointAt(Mn);if(Ln>65535)Mn++;if(T[ct>>>2>>>0]=Ln,ct+=4,ct+4>xn)break}return T[ct>>>2>>>0]=0,ct-tn},Kh=(Je)=>{var ct=0;for(var Dt=0;Dt<Je.length;++Dt){var tn=Je.codePointAt(Dt);if(tn>65535)Dt++;ct+=4}return ct};function Nx(Je,ct,Dt){Je>>>=0,ct>>>=0,Dt>>>=0,Dt=vt(Dt);var tn,xn,Mn;if(ct===2)tn=Tf,xn=lp,Mn=fg;else tn=gu,xn=a_,Mn=Kh;Ze(Je,{name:Dt,fromWireType:(Ln)=>{var uo=N[Ln>>>2>>>0],ko=tn(Ln+4,uo*ct,!0);return lh(Ln),ko},toWireType:(Ln,uo)=>{if(typeof uo!="string")We(`Cannot pass non-string to C++ string type ${Dt}`);var ko=Mn(uo),tr=uI(4+ko+ct);if(N[tr>>>2>>>0]=ko/ct,xn(uo,tr+4,ko+ct),Ln!==null)Ln.push(lh,tr);return tr},readValueFromPointer:rt,destructorFunction(Ln){lh(Ln)}})}function c_(Je,ct,Dt,tn,xn,Mn){Je>>>=0,ct>>>=0,Dt>>>=0,tn>>>=0,xn>>>=0,Mn>>>=0,nt[Je]={name:vt(ct),rawConstructor:xr(Dt,tn),rawDestructor:xr(xn,Mn),fields:[]}}function N2(Je,ct,Dt,tn,xn,Mn,Ln,uo,ko,tr){Je>>>=0,ct>>>=0,Dt>>>=0,tn>>>=0,xn>>>=0,Mn>>>=0,Ln>>>=0,uo>>>=0,ko>>>=0,tr>>>=0,nt[Je].fields.push({fieldName:vt(ct),getterReturnType:Dt,getter:xr(tn,xn),getterContext:Mn,setterArgumentType:Ln,setter:xr(uo,ko),setterContext:tr})}var J1=function(Je,ct){Je>>>=0,ct>>>=0,ct=vt(ct),Ze(Je,{isVoid:!0,name:ct,fromWireType:()=>{return},toWireType:(Dt,tn)=>{return}})};function hI(Je,ct){Je>>>=0,ct>>>=0,Je=ti.toValue(Je),ct=ti.toValue(ct),Je.set(ct)}var L0=[],dI=(Je)=>{var ct=L0.length;return L0.push(Je),ct},Z1=(Je,ct)=>{var Dt=Array(Je);for(var tn=0;tn<Je;++tn)Dt[tn]=xa(N[ct+tn*4>>>2>>>0],`parameter ${tn}`);return Dt},Ud=(Je,ct,Dt)=>{var tn=[],xn=Je(tn,Dt);if(tn.length)N[ct>>>2>>>0]=ti.toHandle(tn);return xn},Us={},Bo=(Je)=>{var ct=Us[Je];if(ct===void 0)return vt(Je);return ct},_d=function(Je,ct,Dt){ct>>>=0;var tn=8,[xn,...Mn]=Z1(Je,ct),Ln=xn.toWireType.bind(xn),uo=Mn.map((Ws)=>Ws.readValueFromPointer.bind(Ws));Je--;var ko={toValue:ti.toValue},tr=uo.map((Ws,na)=>{var vc=`argFromPtr${na}`;return ko[vc]=Ws,`${vc}(args${na?"+"+na*tn:""})`}),Dr;switch(Dt){case 0:Dr="toValue(handle)";break;case 2:Dr="new (toValue(handle))";break;case 3:Dr="";break;case 1:ko.getStringOrSymbol=Bo,Dr="toValue(handle)[getStringOrSymbol(methodName)]";break}if(Dr+=`(${tr})`,!xn.isVoid)ko.toReturnWire=Ln,ko.emval_returnValue=Ud,Dr=`return emval_returnValue(toReturnWire, destructorsRef, ${Dr})`;Dr=`return function (handle, methodName, destructorsRef, args) {
${Dr}
}`;var ta=Function(Object.keys(ko),Dr)(...Object.values(ko)),Pa=`methodCaller<(${Mn.map((Ws)=>Ws.name)}) => ${xn.name}>`;return dI(mn(Pa,ta))};function sl(Je,ct){return Je>>>=0,ct>>>=0,Je=ti.toValue(Je),ct=ti.toValue(ct),Je==ct}function Sa(Je,ct){return Je>>>=0,ct>>>=0,Je=ti.toValue(Je),ct=ti.toValue(ct),ti.toHandle(Je[ct])}function AA(Je){if(Je>>>=0,Je>9)or[Je+1]+=1}function MC(Je,ct,Dt,tn,xn){return Je>>>=0,ct>>>=0,Dt>>>=0,tn>>>=0,xn>>>=0,L0[Je](ct,Dt,tn,xn)}function dD(Je){return Je>>>=0,ti.toHandle(Bo(Je))}function wC(){return ti.toHandle({})}function YH(Je){Je>>>=0;var ct=ti.toValue(Je);dt(ct),Gr(Je)}function b4(Je,ct,Dt){Je>>>=0,ct>>>=0,Dt>>>=0,Je=ti.toValue(Je),ct=ti.toValue(ct),Dt=ti.toValue(Dt),Je[ct]=Dt}var I4=()=>4294901760,A8=(Je,ct)=>Math.ceil(Je/ct)*ct,i0=(Je)=>{var ct=ty.buffer.byteLength,Dt=(Je-ct+65535)/65536|0;try{return ty.grow(Dt),U(),1}catch(tn){}};function jc(Je){Je>>>=0;var ct=P.length,Dt=I4();if(Je>Dt)return!1;for(var tn=1;tn<=4;tn*=2){var xn=ct*(1+0.2/tn);xn=Math.min(xn,Je+100663296);var Mn=Math.min(Dt,A8(Math.max(Je,xn),65536)),Ln=i0(Mn);if(Ln)return!0}return!1}var f8=(Je,ct)=>{if(yg)for(var Dt=Je;Dt<Je+ct;Dt++){var tn=io(Dt);if(tn)yg.set(tn,Dt)}},yg,ey=(Je)=>{if(!yg)yg=new WeakMap,f8(0,ny.length);return yg.get(Je)||0},xm=[],hp=()=>{if(xm.length)return xm.pop();return ny.grow(1)},Cm=(Je,ct)=>ny.set(Je,ct),bm=(Je)=>{let ct=Je.length;return[ct%128|128,ct>>7,...Je]},y8={i:127,p:127,j:126,f:125,d:124,e:111},l_=(Je)=>bm(Array.from(Je,(ct)=>{var Dt=y8[ct];return Dt})),KE=(Je,ct)=>{var Dt=Uint8Array.of(0,97,115,109,1,0,0,0,1,...bm([1,96,...l_(ct.slice(1)),...l_(ct[0]==="v"?"":ct[0])]),2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0),tn=new WebAssembly.Module(Dt),xn=new WebAssembly.Instance(tn,{e:{f:Je}}),Mn=xn.exports.f;return Mn},H0=(Je,ct)=>{var Dt=ey(Je);if(Dt)return Dt;var tn=hp();try{Cm(tn,Je)}catch(Mn){if(!(Mn instanceof TypeError))throw Mn;var xn=KE(Je,ct);Cm(tn,xn)}return yg.set(Je,tn),tn},Df=(Je)=>{yg.delete(io(Je)),Cm(Je,null),xm.push(Je)};wn(),Nn();{if(n.noExitRuntime)Re=n.noExitRuntime;if(n.print)g=n.print;if(n.printErr)f=n.printErr;if(n.wasmBinary)y=n.wasmBinary;if(n.arguments)c=n.arguments;if(n.thisProgram)l=n.thisProgram;if(n.preInit){if(typeof n.preInit=="function")n.preInit=[n.preInit];while(n.preInit.length>0)n.preInit.shift()()}}n.addFunction=H0,n.removeFunction=Df;var Fp,uI,lh,Nf,BC,ty,ny;function s0(Je){Fp=Je.K,uI=Je.M,lh=Je.N,Nf=ty=Je.I,BC=ny=Je.L}var $E={l:Ne,C:ke,q:et,z:qe,G:ft,j:Oo,i:kl,a:Od,E:Ll,x:fm,d:k0,y:_u,c:o0,p:Zi,m:da,h:zc,n:ri,F:r0,w:Nx,r:c_,k:N2,H:J1,u:hI,g:_d,b:Gr,o:sl,B:Sa,t:AA,f:MC,s:dD,A:wC,e:YH,v:b4,D:jc};function v4(Je){Je=Object.assign({},Je);var ct=(tn)=>(xn)=>tn(xn)>>>0,Dt=(tn)=>()=>tn()>>>0;return Je.K=ct(Je.K),Je.M=ct(Je.M),Je._emscripten_stack_alloc=ct(Je._emscripten_stack_alloc),Je.emscripten_stack_get_current=Dt(Je.emscripten_stack_get_current),Je}function qE(){j();function Je(){if(n.calledRun=!0,x)return;Y(),b?.(n),n.onRuntimeInitialized?.(),X()}if(n.setStatus)n.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>n.setStatus(""),1),Je()},1);else Je()}var S4=await ie();if(qE(),O)t=n;else t=new Promise((Je,ct)=>{b=Je,I=ct});return t}var pcn=VIr;var mcn="AGFzbQEAAAABlwRFYAF/AGACf38AYAJ/fwF/YAN/f38AYAF/AX9gBH9/f38AYAN/f38Bf2AFf39/f38AYAZ/f39/f38AYAR/f39/AX9gCH9/f39/f39/AGADf398AGAAAGABfAF8YAABf2AEf39/fABgAX8BfGACf38BfGAHf39/f39/fwBgBX9/f39/AX9gBH9/f3wBf2AEf398fwBgA398fwBgCn9/f39/f39/f38AYAV/f39/fwF8YAF8AX9gA39/fAF/YAF8AGAEf398fwF/YAR/f398AXxgA3x8fwF8YAJ8fAF8YAJ8fwF/YAJ/fgBgBX9/fHx8AGAGf398f3x/AGAGf3x8fH9/AGADf3x/AX9gA39/fAF8YAR/f3x8AGAHf39/f3x8fABgBn9/f3x8fABgBn9/fH98fABgDX9/f39/f39/f39/f38AYAV/f39+fgBgAnx/AXxgBX9/f398AGAFf39/f3wBf2AFf398fH8AYAZ/f39/fH8AYAJ/fgF/YAV/f398fwF/YAF+AX9gA39/fwF8YAd/f39/fHx/AGAHf39/fHx8fwBgDH9/f39/f39/f39/fwBgCX9/f39/f39/fwBgBn9/fH98fAF/YAd/f39/fHx8AX9gA39/fgBgAn9/AX5gAn98AX9gAn98AGAGf39/fHx8AX9gBn9/fH98fwF/YAZ/fHx8f38Bf2AFf398fHwBf2AEf398fAF/As0BIgFhAWEAFwFhAWIAAAFhAWMACgFhAWQAAwFhAWUAAAFhAWYAGAFhAWcABgFhAWgAAwFhAWkACAFhAWoAKwFhAWsAFwFhAWwAAwFhAW0ABQFhAW4AAQFhAW8AAgFhAXAABwFhAXEAAAFhAXIACAFhAXMABAFhAXQAAAFhAXUAAQFhAXYAAwFhAXcAAwFhAXgABwFhAXkAAwFhAXoALAFhAUEADgFhAUIAAgFhAUMADAFhAUQABAFhAUUAAAFhAUYAAQFhAUcABQFhAUgAAQP1B/MHAAQAAQwEBAABAgEAAgQAAwkBDQEAAgABBAQCAQ0DAgQAAQEAAQUCAAkJAQEBAgQABAABAQECAAEAAQENAQMCCQICCQAMAwEEAQQOAwABAQAMBgQAAQMBBQABAgEDAQsDBQAJBQUGAwABAgABAAMBBQEAAAACDQEAAQEDHAMBAgMQAgEBAQENCQAABBkBCAgAAgICBwcICAgIHQEBCAQEAhkIAQcIAAMBAwcBAAcFCAgICAEAAAEeHwIEBQcAAQMBBwAFAwIFBQMABAIAAwEDAQELEQAEAi0NHxgCCQEJBQUABAACAQIHBgMAAQEBAQQIAQAAAwUDAAADAgIAAwMBBAIBAAMAAQEAAgcFAwwEDQ0NAwcuBQUKCi8DBgEGAgMBMBEDAwUSEgEACgoKAQUxBQEBAQECBTIBAQADCQAAAwYGCgEBAQEKBwoSAQEEAAUFAQEFAQAzAQYDAAAHAQEDBRIDAAoHCgcKBwoHBRMBAQICBgQBCQEABQEBBgEIAgUDBgQGHjQNIA0NBQUDAwUGAggHAQcABwECAgE1AQMBBQUFBggAAQEBBwEEAQMEBQUFCAMBBQMDAgcHBwEDAQEBBQYFAQY2AQUDAwAGBQMDAQUDAwMBASECIQY3AAEDBgEBBQQRBAIVFQABAQEBBQEBFQABBwcPAQMGAyIDDgQEBAUMAQUJCRIFBwMBBggHBQQBBgEFAAEBAQEFAQMAEgcGBAMAAQAIBwEBAAEDCAEBAQEBAQIAAwEFAwMDAQEDBQUBAQECAwEBAQEBAwIXODkCBwcTBxMHChMHChMFAQEBAQEBAQEBAgkBACAFAgEBIyQDAQUBAQEGBAYAAQMBAAYMBgMEAwEEBAQDAgMCAgEABAcGBQUFBgQCBCUCBgYCAgIaAAYCBAIBAQQEAAACAAYEAAQAAAQAAQQQAQECBAsDAwsDARYDAQ4AAAQEAgUBBAQCAQQEAgUBBAQCAQQODg4OAgAEDgIJAQQEAgkBBAQCAQQABCYBAQsDAw8LCwMnAw8FBAQQEAQLCxADDAwAGxsEAgEBBAEFDwAEEAQAAwEABAAABAAABAAEAAAEKAAABAQEBAMDBQMpBAMFAwUDBAIBBAQCAQQDAQEBAwMDBAIBAQQABAEPARYqAAQCAxEBBAQCBQEEBAIBAQQEAgEEBAIBBAkCAwkGFAY6AQYGAwYBBgMGAxQGDwsGAwMGBgMDBgMGAwM7CQYDAwQDAQQEBgMDAQMABAYDAwEABAYDAQQDAQQGAwMBAAQDBAYDAwEEBgMDAQQGAwMBBDw9AwIAPgE/AgJAFBxBBgQlQgYUCR0CAkMGRBoCGhQCAAQEBAgICAcHAgQMBAUBcADvBAUHAQGAAoCABAYIAX8BQbCrBgsHGwYBSQIAAUoAlAgBSwCTCAFMAQABTQAnAU4AIgniCAEAQQEL7gSgBZ0EiQFsiQGEBokBgAaJAf8FiQH+BYkBnQSJAf0FiQHrBekFa+cFvAbmBbsGswG6BsMC1gbVBswG3QXWBc8FtweyB60HqQf8BpQH4gXDBeEFwQXgBd8F4wXABdgFswHZBcMCywOzAc4D1wW/Bd4F+AbGA7ED2wW+BbwF5QW6BeQFuAWbBZsFnweaB6ED9gaSCNoFiwiJCIgI7wbsBusG6ga9BrcGmgaHCJkGnAOYBpcGhgiWBrEDlQaFCNgHnQacA5wGhAibBp8GngaDCN0G2wbaBuYG6QGCCJsEgQicBJoE9AaACMABswG+BqoGnAOQArMBoAS/AZ8EngTkAv8HqQbDAqgGpwamBrMBpAalBpQG/ge2BqEG/QegBvwHowaPAvsHkQX6B5AF+Qf3BvgH+Qb3B8IH9gePBfUHhwT0B/UG8wfXBvIHzQfxB6IGrQXpBugG5wahA7UGrQWOAvAHrwauBu8HrQbuB8IB7QesBqsG9AHzAawFqwX0AfMB9AHzAewH6weqBakFrAWrBfQB8wHqB+kH9AHzAaoFqQWfBbUHtAfoB6sBa2znB+YHqAXlB+QH4werAWts4gfhB6cF4AffB94HqwFrbN0H3AemBdsH2gfZB6sBa2ylBaQFowWiBaEF1wfWB2ts1QfUB6cF0wfSB9EHqwFrbNAHzwfOB8wHywfKB8kHa2zIB8cHqAXGB8UHxAfDB2tswQfAB6YFvwe+B70HqwFrbKUFpAWjBaIFoQW8B6sBa2y7B7oHuQe4B7YHmQWZBZsHmQeXBZgHlweWB5cFlQefBZMHkgezB4UBfLEHhAGwB4UBfK8HhAGuB4UBfKwHhAGcBYUBfKsHhAGqB4UBfKgHhAGnB6YHfKUHpAejB4UBfKIHhAGhB4UBfKAHhAGcBYUBfJ4HhAGdB4UBfJwHhAFSsAWiBFIwkQeQB0JRlQWPB44HUjCNB4wHQlGVBYsHigdSMIkHiAdCUYcHhgeFB1IwhAeDB0JRggeBB4AHUjD/Bv4GQlH9BvsG+gbzBvIGiQW7BTBSMPEG8AZCUYcF7gbtBlJSMOUG5AZCUeIE4wbiBjDhBuAGQlHiBN8G3gZS2QbeBNgG0AbcBtMG1AbSBtEG3wTPBs4GzQYwywbKBskGMMgGxwaJBTDGBsUGxAYwwwbCBsEGMMAGvwZCMLkGuAZCMDC0BrMGQlGyBrEGsAaTBpIGQjAwkQaQBkJRhwWPBo4GMI0GjAZCUYsGigaJBjCIBocGQlGGBoUGgwZSMIIGgQYwUjD8BfsFQlHuA/oF+QVSMPgF9wVCUfYF9QX0BVIw8wXyBUJR6gPxBfAFUjDvBe4FQlHtBewF6gVC6AXSBdwF1QXUBdMFMNEF0AVpxQODAs4FzQXLBcoFUjDJBcgFQlHHBcYFxQXEBcIFxQMwuQUwtwVSMEJCogMwvQUwogMwtgWNCJAItQUwjgiRCLQFMI8IsQWzBTCyBTCMCK8FigivBQwCqgEK2d4e8weEDAEIfwJAIABFDQAgAEEIayIDIABBBGsoAgAiAUF4cSIAaiEFAkAgAUEBcQ0AIAFBAnFFDQEgAyADKAIAIgFrIgNBtKECKAIASQ0BIAAgAWohAAJAAkACQEG4oQIoAgAgA0cEQCADKAIMIQIgAUH/AU0EQCACIAMoAggiBEcNAkGkoQJBpKECKAIAQX4gAUEDdndxNgIADAULIAMoAhghBiACIANHBEAgAygCCCIBIAI2AgwgAiABNgIIDAQLIAMoAhQiAQR/IANBFGoFIAMoAhAiAUUNAyADQRBqCyEEA0AgBCEHIAEiAkEUaiEEIAIoAhQiAQ0AIAJBEGohBCACKAIQIgENAAsgB0EANgIADAMLIAUoAgQiAUEDcUEDRw0DQayhAiAANgIAIAUgAUF+cTYCBCADIABBAXI2AgQgBSAANgIADwsgBCACNgIMIAIgBDYCCAwCC0EAIQILIAZFDQACQCADKAIcIgFBAnQiBCgC1KMCIANGBEAgBEHUowJqIAI2AgAgAg0BQaihAkGooQIoAgBBfiABd3E2AgAMAgsCQCADIAYoAhBGBEAgBiACNgIQDAELIAYgAjYCFAsgAkUNAQsgAiAGNgIYIAMoAhAiAQRAIAIgATYCECABIAI2AhgLIAMoAhQiAUUNACACIAE2AhQgASACNgIYCyADIAVPDQAgBSgCBCIBQQFxRQ0AAkACQAJAAkAgAUECcUUEQEG8oQIoAgAgBUYEQEG8oQIgAzYCAEGwoQJBsKECKAIAIABqIgA2AgAgAyAAQQFyNgIEIANBuKECKAIARw0GQayhAkEANgIAQbihAkEANgIADwtBuKECKAIAIgggBUYEQEG4oQIgAzYCAEGsoQJBrKECKAIAIABqIgA2AgAgAyAAQQFyNgIEIAAgA2ogADYCAA8LIAFBeHEgAGohACAFKAIMIQIgAUH/AU0EQCAFKAIIIgQgAkYEQEGkoQJBpKECKAIAQX4gAUEDdndxNgIADAULIAQgAjYCDCACIAQ2AggMBAsgBSgCGCEGIAIgBUcEQCAFKAIIIgEgAjYCDCACIAE2AggMAwsgBSgCFCIBBH8gBUEUagUgBSgCECIBRQ0CIAVBEGoLIQQDQCAEIQcgASICQRRqIQQgAigCFCIBDQAgAkEQaiEEIAIoAhAiAQ0ACyAHQQA2AgAMAgsgBSABQX5xNgIEIAMgAEEBcjYCBCAAIANqIAA2AgAMAwtBACECCyAGRQ0AAkAgBSgCHCIBQQJ0IgQoAtSjAiAFRgRAIARB1KMCaiACNgIAIAINAUGooQJBqKECKAIAQX4gAXdxNgIADAILAkAgBSAGKAIQRgRAIAYgAjYCEAwBCyAGIAI2AhQLIAJFDQELIAIgBjYCGCAFKAIQIgEEQCACIAE2AhAgASACNgIYCyAFKAIUIgFFDQAgAiABNgIUIAEgAjYCGAsgAyAAQQFyNgIEIAAgA2ogADYCACADIAhHDQBBrKECIAA2AgAPCyAAQf8BTQRAIABB+AFxQcyhAmohAQJ/QaShAigCACIEQQEgAEEDdnQiAHFFBEBBpKECIAAgBHI2AgAgAQwBCyABKAIICyEAIAEgAzYCCCAAIAM2AgwgAyABNgIMIAMgADYCCA8LQR8hAiAAQf///wdNBEAgAEEmIABBCHZnIgFrdkEBcSABQQF0ckE+cyECCyADIAI2AhwgA0IANwIQIAJBAnRB1KMCaiEEAn8CQAJ/QaihAigCACIBQQEgAnQiB3FFBEBBqKECIAEgB3I2AgAgBCADNgIAQRghAkEIDAELIABBGSACQQF2a0EAIAJBH0cbdCECIAQoAgAhBANAIAQiASgCBEF4cSAARg0CIAJBHXYhBCACQQF0IQIgASAEQQRxaiIHKAIQIgQNAAsgByADNgIQQRghAiABIQRBCAshACADIQEgAwwBCyABKAIIIgQgAzYCDCABIAM2AghBGCEAQQghAkEACyEHIAIgA2ogBDYCACADIAE2AgwgACADaiAHNgIAQcShAkHEoQIoAgBBAWsiAEF/IAAbNgIACwsSACAAEFAiAEUEQBCuAgALIAALLwEBfwJAIAAoAggEQCAAIAAoAggiAUEBazYCCCABDQELIAAgACgCACgCEBEAAAsLVwEDfyAAKAIIIAFJBEAgAUECdBAnIQQgACgCACECAkAgACgCBCIDRQ0AIANBAnQiA0UNACAEIAIgA/wKAAALIAIEQCACECILIAAgATYCCCAAIAQ2AgALCwkAQfENEJ4FAAvCKAELfyMAQRBrIgokAAJAAkACQAJAAkACQAJAAkACQAJAIABB9AFNBEBBpKECKAIAIgRBECAAQQtqQfgDcSAAQQtJGyIGQQN2IgB2IgFBA3EEQAJAIAFBf3NBAXEgAGoiA0EDdCIBQcyhAmoiACABKALUoQIiAigCCCIFRgRAQaShAiAEQX4gA3dxNgIADAELIAUgADYCDCAAIAU2AggLIAJBCGohACACIAFBA3I2AgQgASACaiIBIAEoAgRBAXI2AgQMCwsgBkGsoQIoAgAiCE0NASABBEACQEECIAB0IgJBACACa3IgASAAdHFoIgNBA3QiAUHMoQJqIgIgASgC1KECIgAoAggiBUYEQEGkoQIgBEF+IAN3cSIENgIADAELIAUgAjYCDCACIAU2AggLIAAgBkEDcjYCBCAAIAZqIgcgASAGayIFQQFyNgIEIAAgAWogBTYCACAIBEAgCEF4cUHMoQJqIQFBuKECKAIAIQICfyAEQQEgCEEDdnQiA3FFBEBBpKECIAMgBHI2AgAgAQwBCyABKAIICyEDIAEgAjYCCCADIAI2AgwgAiABNgIMIAIgAzYCCAsgAEEIaiEAQbihAiAHNgIAQayhAiAFNgIADAsLQaihAigCACILRQ0BIAtoQQJ0KALUowIiASgCBEF4cSAGayEDIAEhAgNAAkAgASgCECIARQRAIAEoAhQiAEUNAQsgACgCBEF4cSAGayIBIAMgASADSSIBGyEDIAAgAiABGyECIAAhAQwBCwsgAigCGCEJIAIgAigCDCIARwRAIAIoAggiASAANgIMIAAgATYCCAwKCyACKAIUIgEEfyACQRRqBSACKAIQIgFFDQMgAkEQagshBQNAIAUhByABIgBBFGohBSAAKAIUIgENACAAQRBqIQUgACgCECIBDQALIAdBADYCAAwJC0F/IQYgAEG/f0sNACAAQQtqIgFBeHEhBkGooQIoAgAiB0UNAEEfIQhBACAGayEDIABB9P//B00EQCAGQSYgAUEIdmciAGt2QQFxIABBAXRrQT5qIQgLAkACQAJAIAhBAnQoAtSjAiIBRQRAQQAhAAwBC0EAIQAgBkEZIAhBAXZrQQAgCEEfRxt0IQIDQAJAIAEoAgRBeHEgBmsiBCADTw0AIAEhBSAEIgMNAEEAIQMgASEADAMLIAAgASgCFCIEIAQgASACQR12QQRxaigCECIBRhsgACAEGyEAIAJBAXQhAiABDQALCyAAIAVyRQRAQQAhBUECIAh0IgBBACAAa3IgB3EiAEUNAyAAaEECdCgC1KMCIQALIABFDQELA0AgACgCBEF4cSAGayICIANJIQEgAiADIAEbIQMgACAFIAEbIQUgACgCECIBBH8gAQUgACgCFAsiAA0ACwsgBUUNACADQayhAigCACAGa08NACAFKAIYIQggBSAFKAIMIgBHBEAgBSgCCCIBIAA2AgwgACABNgIIDAgLIAUoAhQiAQR/IAVBFGoFIAUoAhAiAUUNAyAFQRBqCyECA0AgAiEEIAEiAEEUaiECIAAoAhQiAQ0AIABBEGohAiAAKAIQIgENAAsgBEEANgIADAcLIAZBrKECKAIAIgVNBEBBuKECKAIAIQACQCAFIAZrIgFBEE8EQCAAIAZqIgIgAUEBcjYCBCAAIAVqIAE2AgAgACAGQQNyNgIEDAELIAAgBUEDcjYCBCAAIAVqIgEgASgCBEEBcjYCBEEAIQFBACECC0GsoQIgATYCAEG4oQIgAjYCACAAQQhqIQAMCQsgBkGwoQIoAgAiAkkEQEGwoQIgAiAGayIBNgIAQbyhAkG8oQIoAgAiACAGaiICNgIAIAIgAUEBcjYCBCAAIAZBA3I2AgQgAEEIaiEADAkLQQAhACAGQS9qIgMCf0H8pAIoAgAEQEGEpQIoAgAMAQtBiKUCQn83AgBBgKUCQoCggICAgAQ3AgBB/KQCIApBDGpBcHFB2KrVqgVzNgIAQZClAkEANgIAQeCkAkEANgIAQYAgCyIBaiIEQQAgAWsiB3EiASAGTQ0IQdykAigCACIFBEBB1KQCKAIAIgggAWoiCSAITSAFIAlJcg0JCwJAQeCkAi0AAEEEcUUEQAJAAkACQAJAQbyhAigCACIFBEBB5KQCIQADQCAAKAIAIgggBU0EQCAFIAggACgCBGpJDQMLIAAoAggiAA0ACwtBABCsASICQX9GDQMgASEEQYClAigCACIAQQFrIgUgAnEEQCABIAJrIAIgBWpBACAAa3FqIQQLIAQgBk0NA0HcpAIoAgAiAARAQdSkAigCACIFIARqIgcgBU0gACAHSXINBAsgBBCsASIAIAJHDQEMBQsgBCACayAHcSIEEKwBIgIgACgCACAAKAIEakYNASACIQALIABBf0YNASAGQTBqIARNBEAgACECDAQLQYSlAigCACICIAMgBGtqQQAgAmtxIgIQrAFBf0YNASACIARqIQQgACECDAMLIAJBf0cNAgtB4KQCQeCkAigCAEEEcjYCAAsgARCsASICQX9GQQAQrAEiAEF/RnIgACACTXINBSAAIAJrIgQgBkEoak0NBQtB1KQCQdSkAigCACAEaiIANgIAQdikAigCACAASQRAQdikAiAANgIACwJAQbyhAigCACIDBEBB5KQCIQADQCACIAAoAgAiASAAKAIEIgVqRg0CIAAoAggiAA0ACwwEC0G0oQIoAgAiAEEAIAAgAk0bRQRAQbShAiACNgIAC0EAIQBB6KQCIAQ2AgBB5KQCIAI2AgBBxKECQX82AgBByKECQfykAigCADYCAEHwpAJBADYCAANAIABBA3QiASABQcyhAmoiBTYC1KECIAEgBTYC2KECIABBAWoiAEEgRw0AC0GwoQIgBEEoayIAQXggAmtBB3EiAWsiBTYCAEG8oQIgASACaiIBNgIAIAEgBUEBcjYCBCAAIAJqQSg2AgRBwKECQYylAigCADYCAAwECyACIANNIAEgA0tyDQIgACgCDEEIcQ0CIAAgBCAFajYCBEG8oQIgA0F4IANrQQdxIgBqIgE2AgBBsKECQbChAigCACAEaiICIABrIgA2AgAgASAAQQFyNgIEIAIgA2pBKDYCBEHAoQJBjKUCKAIANgIADAMLQQAhAAwGC0EAIQAMBAtBtKECKAIAIAJLBEBBtKECIAI2AgALIAIgBGohBUHkpAIhAAJAA0AgBSAAKAIAIgFHBEAgACgCCCIADQEMAgsLIAAtAAxBCHFFDQMLQeSkAiEAA0ACQCAAKAIAIgEgA00EQCADIAEgACgCBGoiBUkNAQsgACgCCCEADAELC0GwoQIgBEEoayIAQXggAmtBB3EiAWsiBzYCAEG8oQIgASACaiIBNgIAIAEgB0EBcjYCBCAAIAJqQSg2AgRBwKECQYylAigCADYCACADIAVBJyAFa0EHcWpBL2siACAAIANBEGpJGyIBQRs2AgQgAUHspAIpAgA3AhAgAUHkpAIpAgA3AghB7KQCIAFBCGo2AgBB6KQCIAQ2AgBB5KQCIAI2AgBB8KQCQQA2AgAgAUEYaiEAA0AgAEEHNgIEIABBCGogAEEEaiEAIAVJDQALIAEgA0YNACABIAEoAgRBfnE2AgQgAyABIANrIgJBAXI2AgQgASACNgIAAn8gAkH/AU0EQCACQfgBcUHMoQJqIQACf0GkoQIoAgAiAUEBIAJBA3Z0IgJxRQRAQaShAiABIAJyNgIAIAAMAQsgACgCCAshASAAIAM2AgggASADNgIMQQwhAkEIDAELQR8hACACQf///wdNBEAgAkEmIAJBCHZnIgBrdkEBcSAAQQF0ckE+cyEACyADIAA2AhwgA0IANwIQIABBAnRB1KMCaiEBAkACQEGooQIoAgAiBUEBIAB0IgRxRQRAQaihAiAEIAVyNgIAIAEgAzYCAAwBCyACQRkgAEEBdmtBACAAQR9HG3QhACABKAIAIQUDQCAFIgEoAgRBeHEgAkYNAiAAQR12IQUgAEEBdCEAIAEgBUEEcWoiBCgCECIFDQALIAQgAzYCEAsgAyABNgIYQQghAiADIgEhAEEMDAELIAEoAggiACADNgIMIAEgAzYCCCADIAA2AghBACEAQRghAkEMCyADaiABNgIAIAIgA2ogADYCAAtBsKECKAIAIgAgBk0NAEGwoQIgACAGayIBNgIAQbyhAkG8oQIoAgAiACAGaiICNgIAIAIgAUEBcjYCBCAAIAZBA3I2AgQgAEEIaiEADAQLQaChAkEwNgIAQQAhAAwDCyAAIAI2AgAgACAAKAIEIARqNgIEIAJBeCACa0EHcWoiCCAGQQNyNgIEIAFBeCABa0EHcWoiBCAGIAhqIgNrIQcCQEG8oQIoAgAgBEYEQEG8oQIgAzYCAEGwoQJBsKECKAIAIAdqIgA2AgAgAyAAQQFyNgIEDAELQbihAigCACAERgRAQbihAiADNgIAQayhAkGsoQIoAgAgB2oiADYCACADIABBAXI2AgQgACADaiAANgIADAELIAQoAgQiAEEDcUEBRgRAIABBeHEhCSAEKAIMIQICQCAAQf8BTQRAIAQoAggiASACRgRAQaShAkGkoQIoAgBBfiAAQQN2d3E2AgAMAgsgASACNgIMIAIgATYCCAwBCyAEKAIYIQYCQCACIARHBEAgBCgCCCIAIAI2AgwgAiAANgIIDAELAkAgBCgCFCIABH8gBEEUagUgBCgCECIARQ0BIARBEGoLIQEDQCABIQUgACICQRRqIQEgACgCFCIADQAgAkEQaiEBIAIoAhAiAA0ACyAFQQA2AgAMAQtBACECCyAGRQ0AAkAgBCgCHCIAQQJ0IgEoAtSjAiAERgRAIAFB1KMCaiACNgIAIAINAUGooQJBqKECKAIAQX4gAHdxNgIADAILAkAgBCAGKAIQRgRAIAYgAjYCEAwBCyAGIAI2AhQLIAJFDQELIAIgBjYCGCAEKAIQIgAEQCACIAA2AhAgACACNgIYCyAEKAIUIgBFDQAgAiAANgIUIAAgAjYCGAsgByAJaiEHIAQgCWoiBCgCBCEACyAEIABBfnE2AgQgAyAHQQFyNgIEIAMgB2ogBzYCACAHQf8BTQRAIAdB+AFxQcyhAmohAAJ/QaShAigCACIBQQEgB0EDdnQiAnFFBEBBpKECIAEgAnI2AgAgAAwBCyAAKAIICyEBIAAgAzYCCCABIAM2AgwgAyAANgIMIAMgATYCCAwBC0EfIQIgB0H///8HTQRAIAdBJiAHQQh2ZyIAa3ZBAXEgAEEBdHJBPnMhAgsgAyACNgIcIANCADcCECACQQJ0QdSjAmohAAJAAkBBqKECKAIAIgFBASACdCIFcUUEQEGooQIgASAFcjYCACAAIAM2AgAMAQsgB0EZIAJBAXZrQQAgAkEfRxt0IQIgACgCACEBA0AgASIAKAIEQXhxIAdGDQIgAkEddiEBIAJBAXQhAiAAIAFBBHFqIgUoAhAiAQ0ACyAFIAM2AhALIAMgADYCGCADIAM2AgwgAyADNgIIDAELIAAoAggiASADNgIMIAAgAzYCCCADQQA2AhggAyAANgIMIAMgATYCCAsgCEEIaiEADAILAkAgCEUNAAJAIAUoAhwiAUECdCICKALUowIgBUYEQCACQdSjAmogADYCACAADQFBqKECIAdBfiABd3EiBzYCAAwCCwJAIAUgCCgCEEYEQCAIIAA2AhAMAQsgCCAANgIUCyAARQ0BCyAAIAg2AhggBSgCECIBBEAgACABNgIQIAEgADYCGAsgBSgCFCIBRQ0AIAAgATYCFCABIAA2AhgLAkAgA0EPTQRAIAUgAyAGaiIAQQNyNgIEIAAgBWoiACAAKAIEQQFyNgIEDAELIAUgBkEDcjYCBCAFIAZqIgQgA0EBcjYCBCADIARqIAM2AgAgA0H/AU0EQCADQfgBcUHMoQJqIQACf0GkoQIoAgAiAUEBIANBA3Z0IgJxRQRAQaShAiABIAJyNgIAIAAMAQsgACgCCAshASAAIAQ2AgggASAENgIMIAQgADYCDCAEIAE2AggMAQtBHyEAIANB////B00EQCADQSYgA0EIdmciAGt2QQFxIABBAXRyQT5zIQALIAQgADYCHCAEQgA3AhAgAEECdEHUowJqIQECQAJAIAdBASAAdCICcUUEQEGooQIgAiAHcjYCACABIAQ2AgAgBCABNgIYDAELIANBGSAAQQF2a0EAIABBH0cbdCEAIAEoAgAhAQNAIAEiAigCBEF4cSADRg0CIABBHXYhByAAQQF0IQAgAiAHQQRxaiIHKAIQIgENAAsgByAENgIQIAQgAjYCGAsgBCAENgIMIAQgBDYCCAwBCyACKAIIIgAgBDYCDCACIAQ2AgggBEEANgIYIAQgAjYCDCAEIAA2AggLIAVBCGohAAwBCwJAIAlFDQACQCACKAIcIgFBAnQiBSgC1KMCIAJGBEAgBUHUowJqIAA2AgAgAA0BQaihAiALQX4gAXdxNgIADAILAkAgAiAJKAIQRgRAIAkgADYCEAwBCyAJIAA2AhQLIABFDQELIAAgCTYCGCACKAIQIgEEQCAAIAE2AhAgASAANgIYCyACKAIUIgFFDQAgACABNgIUIAEgADYCGAsCQCADQQ9NBEAgAiADIAZqIgBBA3I2AgQgACACaiIAIAAoAgRBAXI2AgQMAQsgAiAGQQNyNgIEIAIgBmoiBSADQQFyNgIEIAMgBWogAzYCACAIBEAgCEF4cUHMoQJqIQBBuKECKAIAIQECf0EBIAhBA3Z0IgcgBHFFBEBBpKECIAQgB3I2AgAgAAwBCyAAKAIICyEEIAAgATYCCCAEIAE2AgwgASAANgIMIAEgBDYCCAtBuKECIAU2AgBBrKECIAM2AgALIAJBCGohAAsgCkEQaiQAIAALFgAgAEEQahAvGiAAQQhqEC8aIAAQLwsrAQJ/IAAoAgAiASgCACICBEAgASACEHsgACgCACIAKAIAIAAoAggaECILC/w9AxJ/HXwLfiMAQbACayIMJAAgDEIANwMIIAxCgICAgICAgPg/NwMAIAxCADcDECAMQgA3AxggDEIANwMoIAxCgICAgICAgPg/NwMgIAxCADcDMCAMQgA3AzggDEIANwNIIAxCgICAgICAgPg/NwNAIAxCADcDUCAMQgA3A1ggDEGYAmogAUEYaiIFIAwQygEgDCsDmAIgDCsDoAJiBEAgASgCDCELIwBBwAZrIgMkACADQgA3A/AEIANCgICAgICAgPg/NwPoBCADQgA3A/gEIANCADcDgAUgA0IANwOQBSADQoCAgICAgID4PzcDiAUgA0IANwOYBSADQgA3A6AFIANCADcDsAUgA0KAgICAgICA+D83A6gFIANCADcDuAUgA0IANwPABSADQaADaiAFIANB6ARqEMoBAkAgAysDoAMgAysDqANhBEAgDCALEDcaDAELIAwQOyEIIAsoAkQiAgRAIAggAjYCRAwBCyAFKQMAITEgBSkDCCEyIAUpAxAhMyAFKQMYITQgBSkDICE1IAUpAyghNiAFKQMwITcgBSkDOCE4IAUpA0AhOSAFKQNIITogBSkDUCE7IAMgBSkDWEL///////////8Ag0KAgICAgICA+P8AVDoA8wQgAyA7Qv///////////wCDQoCAgICAgID4/wBUOgDyBCADIDpC////////////AINCgICAgICAgPj/AFQ6APEEIAMgOUL///////////8Ag0KAgICAgICA+P8AVDoA8AQgAyA4Qv///////////wCDQoCAgICAgID4/wBUOgDvBCADIDdC////////////AINCgICAgICAgPj/AFQ6AO4EIAMgNkL///////////8Ag0KAgICAgICA+P8AVDoA7QQgAyA1Qv///////////wCDQoCAgICAgID4/wBUOgDsBCADIDRC////////////AINCgICAgICAgPj/AFQ6AOsEIAMgM0L///////////8Ag0KAgICAgICA+P8AVDoA6gQgAyAyQv///////////wCDQoCAgICAgID4/wBUOgDpBCADIDFC////////////AINCgICAgICAgPj/AFQ6AOgEAkACQCADLQDpBCADLQDoBHFFDQAgAy0A6gRBAXFFDQAgAy0A7AQgAy0A6wRxRQ0AIAMtAO0EQQFxRQ0AIAMtAO8EIAMtAO4EcUUNACADLQDwBEEBcUUNACADLQDyBCADLQDxBHFFDQAgAy0A8wRBAXENAQsgCEEBECwMAQsgCCALKALIATYCyAEgCCALRwRAIAsoAswBIQYgC0HQAWohEiMAQRBrIg0kACAIQcwBaiIKKAIIBEAgDSAKNgIEIAooAgAhAiAKIApBBGo2AgAgCigCBEEANgIIIApCADcCBCANIAIoAgQiBCACIAQbIgI2AgwgDSACNgIIIAIEQCANIAIQsAQ2AggLAkAgDSgCDCICRSAGIBJGcg0AA0AgAiAGKAIQNgIQIAJBGGogBkEYakHqAPwKAAAgAiEJAkAgCigCBCIERQRAIApBBGoiAiEHDAELIAkoAhAhDgNAIAQiAigCECAOSgRAIAIhByACKAIAIgQNAQwCCyACKAIEIgQNAAsgAkEEaiEHCyAKIAIgByAJEIIBIA0gDSgCCCICNgIMIAIEQCANIAIQsAQ2AggLAkAgBigCBCICBEADQCACIgYoAgAiAg0ADAILAAsDQCAGIAYoAggiBigCAEcNAAsLIA0oAgwiAkUNASAGIBJHDQALCyANKAIEIA0oAgwQbyANKAIIIgIEQCACKAIIIgQEQANAIAQiAigCCCIEDQALIA0gAjYCCAsgDSgCBCACEG8LCyAGIBJHBEAgCkEEaiEQA0AjAEEQayIRJABBiAEQIyITQRBqIg8gBkEQakH4APwKAAACfwJAAkAgECIHIApBBGoiBEcEQCAPKAIAIgkgBygCEEoNAQsgBygCACEOAkAgByICIAooAgBHBEACQCAORQRAA0AgAiACKAIIIgIoAgBGDQAMAgsACyAOIQkDQCAJIgIoAgQiCQ0ACwsgDygCACIJIAIoAhBIDQELIA5FBEAgESAHNgIMIAcMBAsgESACNgIMIAJBBGoMAwsDQCAEIgcoAgAiAkUNAgNAIAkgAiIEKAIQSA0BIAIoAgQiAg0ACwsgBEEEaiEHDAELA0AgBCIHKAIAIgJFDQEDQCACIgQoAhAgCU4NASACKAIEIgINAAsLIARBBGohBwsgESAENgIMIAcLIQIgCiARKAIMIAIgExCCASARQRBqJAACQCAGKAIEIgIEQANAIAIiBigCACICDQAMAgsACwNAIAYgBigCCCIGKAIARw0ACwsgBiASRw0ACwsgDUEQaiQACwJAIAhBAGogC0YNACAIKALYASICBEAgAhAiCyAIQgA3AtgBIAggCygC3AEiAjYC4AEgCCACNgLcASACRQ0AIAggAkEEdCICECciBDYC2AEgAkUNACAEIAsoAtgBIAL8CgAACyAIIAsrAzA5AzAgCCALKwM4OQM4IAggCygCQDYCQCAIQYgBaiIOIAtBiAFqEJICIAggC0Ew/AoAACAIQdgAaiIJIAtB2ABqIg8Q7QIgCEHoAGoiByALQegAahDtAiAIQfgAaiIKIAtB+ABqEO0CIAsoArwBIQIgA0IANwOABCADQgA3A4gEIANCADcDkAQgA0IANwOYBCADIAMpA4AENwOgAiADIAMpA4gENwOoAiADIAMpA5AENwOwAiADIAMpA5gENwO4AiAIQbgBaiACIANBoAJqENoEIAhBfzYCyAEgCCgCzAEiAiAIQdABaiIERwRAA0AgAisDICEVIAIrAyghFCACKwMwIRcgAisDOCEbIAIrA0AhGCACKwNIIRYgAisDUCEZIAIrA1ghGiACKwNgIR4gAisDaCEfIAIrA3AhHCACKwN4ISAgA0KAgICAgICA+D83A+AFIAMgIDkD2AUgAyAcOQPQBSADIB85A8gFIANCADcDwAUgAyAeOQO4BSADIBo5A7AFIAMgGTkDqAUgA0IANwOgBSADIBY5A5gFIAMgGDkDkAUgAyAbOQOIBSADQgA3A4AFIAMgFzkD+AQgAyAUOQPwBCADIBU5A+gEIANBoANqIgYgBSADQegEahDwASACQSBqIAZB4AD8CgAAAkAgAigCBCIGBEADQCAGIgIoAgAiBg0ADAILAAsDQCACIAIoAggiAigCAEcNAAsLIAIgBEcNAAsLIAsoAkwhAiADQgA3A5gDIANCADcDkAMgA0IANwOIAyADQgA3A4gCIANCADcDkAIgA0IANwOYAiAIQcgAaiACIANBiAJqEGcgCygCrAEhAiADQgA3A/ACIANCADcD+AIgA0IANwOAAyADIAMpA/ACNwPwASADIAMpA/gCNwP4ASADIAMpA4ADNwOAAiAIQagBaiACIANB8AFqEGcgCygCnAEhAiADQgA3A9gCIANCADcD4AIgA0IANwPoAiADIAMpA9gCNwPYASADIAMpA+ACNwPgASADIAMpA+gCNwPoASAIQZgBaiACIANB2AFqEGcgBSsDQCEeIAUrAzghFSAFKwMwIRQgBSsDKCEXIAUrAyAhGyAFKwMYIRggBSsDECEWIAUrAwghGSAFKwMAIRogAyALKAJMIgQEfCALKAJIIgIgBEEYbGohBCAFKwNYIR0gBSsDUCEhIAUrA0ghIiAIKAJIIQYDQCAGIB0gFiACKwMAIh+iIBcgAisDCCIcoqAgHiACKwMQIiCioKA5AxAgBiAhIBkgH6IgGyAcoqAgFSAgoqCgOQMIIAYgIiAaIB+iIBggHKKgIBQgIKKgoDkDACAGQRhqIQYgAkEYaiICIARHDQALIAUrAxAhFiAFKwMIIRkgBSsDACEaIAUrAzghFSAFKwMwIRQgBSsDKCEXIAUrAyAhGyAFKwMYIRggBSsDQAUgHgs5A6gFIAMgFzkDoAUgAyAWOQOYBSADIBU5A5AFIAMgGzkDiAUgAyAZOQOABSADIBQ5A/gEIAMgGDkD8AQgAyAaOQPoBCADQaADaiICIANB6ARqEJABIAgoAqgBIQYgCygCqAEhBCALKAKsASEQIANBkAFqIg0gAkHIAPwKAAAgBCAEIBBBGGxqIAYgDRC6BCAIKAKYASEGIAsoApgBIQQgCygCnAEhECADQcgAaiINIAJByAD8CgAAIAQgBCAQQRhsaiAGIA0QugQgCygCQCIEQQJKBEAgDyALQcgBaiACIA4gCygCjAEgBG4gBEEAEL4ECyAFKwMYIhsgBSsDOCIYoiAFKwMgIhYgBSsDMCIZoqEgBSsDECIcoiAFKwMAIiAgFiAFKwNAIhqiIAUrAygiHiAYoqGiIAUrAwgiHSAeIBmiIBsgGqKhoqCgIR8gCygCvAEiDgRAIAsoAmghDyALKAK4ASEQIAgoArgBIQ1BACECA0AgECAfRAAAAAAAAAAAYwR/IAIgAkEDcEEBdGtBAnQgD2ooAggFIAILQQV0aiIEKwMQIRUgBCsDACEUIAQrAwghFyANIAJBBXRqIgYgBCsDGDkDGCAGIBwgFKIgHiAXoqAgGiAVoqA5AxAgBiAdIBSiIBYgF6KgIBggFaKgOQMIIAYgICAUoiAbIBeioCAZIBWioDkDACACQQFqIgIgDkcNAAsLAkAgH0QAAAAAAAAAAGNFDQAgCRA4IAcQOCAKEDggCCgCXCICQQNuIQ8gAkEDSQ0AIAooAgAhBCAHKAIAIQcgCSgCACEKQQAhCQNAIAMgCiAJQQNsIhBBAnQiAkEIaiIGaigCACINNgLoBCADIAIgCmooAgAiETYC7AQgAyAGIAdqKAIANgLwBCADIAQgBmooAgA2AvQEIAogAkEEaiIGaigCACEOIAMgDTYC/AQgAyAONgL4BCADIAYgB2ooAgA2AoAFIAQgBmooAgAhBiADIA42AowFIAMgETYCiAUgAyAGNgKEBSADIAIgB2ooAgA2ApAFIAMgAiAEaigCADYClAUgA0ECNgLQAiADQoCAgIAQNwLIAkEAIQYDQCADQegEaiADQcgCaiAGaigCAEEEdGoiAiACKQIAQiCJNwIAIAIgAigCCCICIAJBA29BAXRrQQJqNgIIIAZBBGoiBkEMRw0ACyADQQI2AtACIANCgICAgBA3AsgCQQAhAgNAIAogA0HIAmogAmooAgAiDiAQakECdCIGaiADQegEaiAOQQR0aiIOKAIANgIAIAYgB2ogDigCCDYCACAEIAZqIA4oAgw2AgAgAkEEaiICQQxHDQALIAlBAWoiCSAPRw0ACwsgCBBYIAMgBSkDKDcDyAQgAyAFKQMgNwPABCADIAUpAxg3A7gEIAMgBSkDMDcD0AQgAyAFKQM4NwPYBCADIAUpA0A3A+AEIAMgBSkDADcDoAQgAyAFKQMINwOoBCADIAUpAxA3A7AEIAMgA0GgBGpByAD8CgAAIANB6ARqIgYhBEEAIQcjAEHgAWsiAiQAIAMrAwAhFSADKwMYIRQgAysDMCEXIAMrAwghGyADKwMgIRggAysDOCEWIAMrAxAhGSADKwMoIRogAiADKwNAOQNIIAIgGjkDQCACIBk5AzggAiAWOQMwIAIgGDkDKCACIBs5AyAgAiAXOQMYIAIgFDkDECACIBU5AwggAkHQAGogAkEIaiADEJoCRAAAAAAAAAAAIRUgAisDkAEhKSACKwN4ISMgAisDcCEiIAIrA2AhJiACKwNYIRQgAisDUCEkRAAAAAAAAPA/ISBEAAAAAAAAAAAhF0QAAAAAAAAAACEbA0AgJCAioSIYIBigIhhEAAAAAAAA8D8gFCAUoiAYIBiiIhagn6MiGKJERo0yz2uQ7T8gGL1C////////////AINCgICAgICAgPj/AFQgFCAUROadPzNPUBdAoqIgFmNxIgkbIh0gHaIiFiAUIBiiRGOprqbifdg/IAkbIhggGKIiGaFEAAAAAAAA8D8gFiAZoKMiGaIiFiAiIBaiIBQgHSAYIBigoiAZoiIZoiIcoSIloiAZIBQgFqIiJyAkIBmioSIroqEiKiApoSIUIBSgIhpEAAAAAAAA8D8gIyAWoiAmIBmioSIUIBSiIBogGqIiHqCfoyIaokRGjTLPa5DtPyAavUL///////////8Ag0KAgICAgICA+P8AVCAUIBRE5p0/M09QF0CioiAeY3EiCRsiISAhoiIeIBQgGqJEY6mupuJ92D8gCRsiGiAaoiIfoUQAAAAAAADwPyAeIB+goyIfoiIeICkgHqIgFCAhIBogGqCiIB+iIh+iIiyhIi2iIB8gFCAeoiIuICogH6KhIi+ioSIoIBYgJCAWoiAcoKIgGSAnICIgGaKgoqAiJ6EiFCAUoCIcRAAAAAAAAPA/ICYgFqIgIyAZoqAiIyAeoiAWICuiIBkgJaKgIiUgH6KhIhQgFKIgHCAcoiIZoJ+jIhaiREaNMs9rkO0/IBa9Qv///////////wCDQoCAgICAgID4/wBUIBQgFETmnT8zT1AXQKKiIBljcSIJGyIiICKiIhkgFCAWokRjqa6m4n3YPyAJGyIWIBaiIhyhRAAAAAAAAPA/IBkgHKCjIhyiIhkgJyAZoiAUICIgFiAWoKIgHKIiHKIiK6EiJqIgHCAUIBmiIjAgKCAcoqEiFKKhISQgGSAUoiAcICaioCEmICUgHqIgIyAfoqAiIyAZoiAeIC+iIB8gLaKgIiUgHKKhIRQgJSAZoiAjIByioCEjICAgHaIgFSAYoqEiJSAaoiAbIB2iIBcgGKKgIi0gIaKgIi8gIqIgICAYoiAVIB2ioCIgICGiIBcgHaIgGyAYoqEiFyAaoqEiFSAWoqEhGyAVICKiIC8gFqKgIRUgJSAhoiAtIBqioSIYICKiIBcgIaIgICAaoqAiFyAWoqEhICAYIBaiIBcgIqKgIRcgHiAqIB6iICygoiAfIC4gKSAfoqCioCEiIBkgKCAZoiAroKIgHCAwICcgHKKgoqAhKSAHQQFqIgdBDEcNAAsgAiAXIBWiIhQgGyAgoiIYoSIWIBagOQPQASACIBsgFaIiFiAXICCiIhmgIhogGqA5A8gBIAIgFCAYoCIUIBSgOQPAASACIBsgF6IiFCAVICCiIhihIhogGqA5A7ABIAIgFiAZoSIWIBagOQOoASACIBQgGKAiFCAUoDkDoAEgAkQAAAAAAADwPyAbIBuiIhQgFyAXoiIXoCIbIBugoTkD2AEgAkQAAAAAAADwPyAUIBUgFaIiFaAiFCAUoKE5A7gBIAJEAAAAAAAA8D8gFyAVoCIVIBWgoTkDmAEgAkEIaiADIAJBmAFqIg4QmgIgAiACKwPIASIZIAIrA7ABIhogAisDmAEiHiACKwMIIhUgFaIgAisDECIWIBaioCACKwMYIhwgHKKgIhQgAisDICIgICCiIAIrAygiHSAdoqAgAisDMCIhICGioCIXYyIHGyIfIBcgFCAHGyIiIAIrAzgiIyAjoiACKwNAIiYgJqKgIAIrA0giKiAqoqAiKWMiCRs5A5gBIAIgAisD0AEiJCACKwO4ASIoIAIrA6ABIicgBxsiJSAJGzkDoAEgAisDwAEhGyACKwOoASEYIAIgH5ogGSAJGyIZIB6aIBogBxsiGiAUIBcgBxsgIiApIAkbYyIKGzkDsAEgAiAamiAZIAobOQPIASACICWaICQgCRsiFCAnmiAoIAcbIhcgChs5A7gBIAIgF5ogFCAKGzkD0AEgAiACKwPYASIUIBsgGCAHGyIXIAkbOQOoASACIBiaIBsgBxsiG5ogF5ogFCAJGyIUIAobOQPYASACIBQgGyAKGzkDwAEgBCAmIB0gFiAHGyIlIAkbIiIgIyAgIBUgBxsiKyAJGyIZmSAZIBmiICIgIqKgnyIURI3ttaD3xrA+EPoBoCIXICJEAAAAAAAAAAAgFESN7bWg98awPmQbIhsgGUQAAAAAAAAAAGMiDxsiFEQAAAAAAADwPyAbIBcgDxsiFyAXoiAUIBSioJ+jIhuiIhQgFyAboiIaIBqgoiIboiAZRAAAAAAAAPA/IBQgFCAUoKKhIh6ioCIfmSAqICEgHCAHGyIsIAkbIikgKaIgHyAfoqCfIhdEje21oPfGsD4Q+gGgIhggKUQAAAAAAAAAACAXRI3ttaD3xrA+ZBsiJCAfRAAAAAAAAAAAYyIPGyIXRAAAAAAAAPA/ICQgGCAPGyIYIBiiIBcgF6Kgn6MiJKIiFyAYICSiIiQgJKAiLaIiGDkDECAEIBQgGkQAAAAAAAAAwKKiIBcgF6JEAAAAAAAA4L+gIiggKKAiKKI5AwggBCAUIBSiRAAAAAAAAOC/oCInICegIicgKKI5AwAgBCAcmiAhIAcbIiGaICyaICogCRsiKiAKGyIsIBiiIBaaIB0gBxsiFpogJZogJiAJGyIdIAobIiUgG6IgFZogICAHGyIVmiArmiAjIAkbIiAgChsiKyAeoqAiLkQAAAAAAADwPyAXIBcgF6CioSIcoqA5A3ggBCAqICEgChsiISAYoiAdIBYgChsiFiAboiAgIBUgChsiFSAeoqAiHSAcoqA5A2AgBCApIBiiIB8gHKKgOQNIIAQgFiAeoiAVIBuioSIgmSAgICCiICEgHKIgHSAYoqEiIyAjoqCfIhVEje21oPfGsD4Q+gGgIhYgI0QAAAAAAAAAACAVRI3ttaD3xrA+ZBsiHSAgRAAAAAAAAAAAYyIHGyIVRAAAAAAAAPA/IB0gFiAHGyIWIBaiIBUgFaKgn6MiHaIiFSAoIBYgHaIiFkQAAAAAAAAAwKIiKqKiOQMoIAQgKCAVIBWiRAAAAAAAAOC/oCIdIB2gIiaiOQNAIAQgLCAcoiAuIBiioSIoRAAAAAAAAPA/IBUgFSAVoKKhIh2iICUgHqIgKyAboqEiJSAVIBYgFqCiIiGioTkDiAEgBCAoICGiICUgHaKgOQOAASAEICMgHaIgICAhoqE5A3AgBCAjICGiICAgHaKgOQNoIAQgKSAcoiAfIBiioSIYIB2iICIgHqIgGSAboqEiGSAhoqE5A1ggBCAYICGiIBkgHaKgOQNQIAQgFSAUIBpEAAAAAAAAEECiIBaioqIgFyAnIC2ioiAmoqE5AzAgBCAnICaiIBUgFyAUIBpEAAAAAAAAIMCiICSiIBaioqKioDkDICAEIBUgFyAnICREAAAAAAAAEECiIBaioqKiIBsgJqKgOQMYIAQgFSAqoiAURAAAAAAAABBAoiAVIBQgFqKiIBcgGiAkoqIgJqKgoqA5AzggBEGQAWogDkHIAPwKAAAgAkHgAWokACAIIAMrA7AFIAgrAzCiIhU5AzAgCCAIEKIBRBHqLYGZl3E9oiIUIBUgFCAVZBsiFUQAAAAAAADwvyAVvUL///////////8Ag0KAgICAgICA+P8AVBsiFTkDMCAIIBUgCCsDOCIUIBQgFWMbOQM4IAgoAlxBA0kNAEEAIQ4jAEEgayIKQQI2AhwgCkKAgICAEDcCFCAFIgRBGGohBwNAIApBFGogDmooAgAhAiAKQQI2AhAgCkKAgICAEDcCCEEIQRAgAkEBRhtBACACGyEQQQAhD0EAIQkDQCAEIQICQAJAAkAgCkEIaiAPaigCACINDgICAAELIAchAgwBCyAEQTBByAAgDUECRhtqIQILIAkgAiAQaisDAEQAAAAAAAAAAGFqIQkgD0EEaiIPQQxHDQALIAlBAkYEQCAOQQRqIg5BDEcNAQsLIAlBAkYEQCAIQegBaiICIAtB6AFqELkEIAhB+AFqIAtB+AFqELgEIAhBiAJqIAtBiAJqELcEIAgoAuwBIQkgAyACNgLsBCADIAU2AugEQQAhBCMAQTBrIgckACAJBEAgBiECA0AgByAEQTBsIgYgAigCBCIFKAIAaiACKAIAENsEIAUoAgAgBmogB0Ew/AoAACAEQQFqIgQgCUcNAAsLIAdBMGokAAwBCyAIKAJcQQNJDQAgCEHoAWoiAiALQegBaiIEELkEIAJBEGogBEEQahC4BCACQSBqIARBIGoQtwQgA0EANgLwBCADQgA3AugEIANBADYC0AIgA0IANwLIAiAIIANB6ARqIANByAJqQQAQzwIgAyADKQLoBDcCwAIgAiADQcACahC2BCADKALIAiICBEAgAhAiCyADKALoBCICRQ0AIAIQIgsgA0HABmokAEGoAhAjIgJB2JMCNgIAIAJCADcCBCACQRBqIAwQowEhBCAMIAI2ApwCIAwgBDYCmAIgAUEMaiAMQZgCahBOAkAgDCgCnAIiAkUNACACIAIoAgQiBEEBazYCBCAEDQAgAiACKAIAKAIIEQAAIAIQJAsgDBA6GiABQgA3AyAgAUKAgICAgICA+D83AxggAUIANwMoIAFCADcDMCABQgA3A0AgAUKAgICAgICA+D83AzggAUIANwNIIAFCADcDUCABQgA3A2AgAUKAgICAgICA+D83A1ggAUIANwNoIAFCADcDcAsgACABKAIMNgIAIAAgASgCECIANgIEIAAEQCAAIAAoAgRBAWo2AgQLIAxBsAJqJAAL9QEBBH8jAEEQayIDJAAgACgCABogAQRAIAAoAggiAiACKAIAKAIMEQQAIQIgAUEANgIMIAFBADYCBCABIAIgAkEAR2siAjYCACABIAJBC2w2AggLAkAgACgCCCICIAIoAgAoAggRBABBA0YNACADQQhqIgIgAEEIaiIEKAIAIgUgASAFKAIAKAIAEQMAIAQgAhBOIAMoAgwiAUUNACABIAEoAgQiAkEBazYCBCACDQAgASABKAIAKAIIEQAAIAEQJAsgACgCCAJAIAAoAgwiAEUNACAAKAIEQX9HDQAgACAAKAIAKAIIEQAAIAAQJAsgA0EQaiQAC7EEAQZ/IwBBIGsiAiQAIABBADYCTCAAQoCAgICAgIB4NwMoIABCgICAgICAgHg3AyAgAEKAgICAgICAeDcDGCAAQoCAgICAgID4/wA3AxAgAEKAgICAgICA+P8ANwMIIABCgICAgICAgPj/ADcDACAAQcgAahBxIABB2ABqIgMQOCAAQegAahA4IABB+ABqEDggAxDvAiAAQQA2ApwBIABBmAFqEHEgAEEANgKsASAAQagBahBxIABBADYCvAEgAEG4AWoQkwEgAkIANwIIIAJBfzYCACACQgA3AhggAkIANwIQIAIgAkEIaiIENgIEIABBfzYCyAEgAEHMAWogACgC0AEQbyAAIAIoAgQ2AswBIAAgAigCCCIFNgLQASAAIAIoAgwiBjYC1AEgAEHQAWohAyAAQcgBaiEHAkAgBkUEQCAAIAM2AswBDAELIAUgAzYCCCACQgA3AgggAiAENgIECyACQQRqAkAgAiAHRwRAIAAoAtgBIgQEQCAEECILIAAgAigCEDYC2AEgACACKAIUNgLcASAAIAIoAhg2AuABDAELIAIoAhAiBEUNACAEECILIAJBADYCGCACQgA3AhAgAigCCBBvIAAoAugBIgMEQCADECILIABBADYC8AEgAEIANwPoASAAKAL4ASIDBEAgAxAiCyAAQQA2AoACIABCADcD+AEgACgCiAIiAwRAIAMQIgsgAEEANgKQAiAAQgA3A4gCIAAgATYCRCACQSBqJAALUgEEfyAAKAIAIQECQCAAKAIEIgNFBEAMAQsgA0ECdCIEECchAiAERQ0AIAIgASAE/AoAAAsgACABBH8gARAiIAAoAgQFIAMLNgIIIAAgAjYCAAuQAQECfyMAQRBrIgMkAEEkECMiAkIANwIMIAJBhJYCNgIAIAJCADcCBCACQgA3AhQgAkIANwIcIABCADcCCCAAIAI2AgQgACACQQxqNgIAIABCADcCECABKAIAGiAAQQhqIAFBCGoQXiADQQhqIAFBEGoQfyADIAMpAgg3AwAgAEEQaiADEOcCIANBEGokACAACzcBAn8CQCAAKAIEIgFFDQAgASABKAIEIgJBAWs2AgQgAg0AIAEgASgCACgCCBEAACABECQLIAALBgAgABAiC3IBBH8gACgCBCIDIAFBAXRLIANBEEtxAkAgASADTQ0AIAAgARAlIAEgACgCBCIEayIDQQBMDQAgACgCACAEQQJ0aiEEA0AgBCACNgIAIARBBGohBCADQQFLIANBAWshAw0ACwsgACABNgIEBEAgABAtCwtgACAAIAM2AhBBACEDIABBADYCDAJAIAEEQCABQYCAgIABTw0BIAFBBHQQIyEDCyAAIAM2AgAgACADIAJBBHRqIgI2AgggACADIAFBBHRqNgIMIAAgAjYCBCAADwsQcgALVwEDfyAAKAIIIAFJBEAgAUEYbBAnIQQgACgCACECAkAgACgCBCIDRQ0AIANBGGwiA0UNACAEIAIgA/wKAAALIAIEQCACECILIAAgATYCCCAAIAQ2AgALC6QBAwF8AX4BfyAAvSICQjSIp0H/D3EiA0GyCE0EfCADQf0HTQRAIABEAAAAAAAAAACiDwsCfCAAmSIARAAAAAAAADBDoEQAAAAAAAAww6AgAKEiAUQAAAAAAADgP2QEQCAAIAGgRAAAAAAAAPC/oAwBCyAAIAGgIgAgAUQAAAAAAADgv2VFDQAaIABEAAAAAAAA8D+gCyIAmiAAIAJCAFMbBSAACwtXAQN/IAAoAgggAUkEQCABQQxsECchBCAAKAIAIQICQCAAKAIEIgNFDQAgA0EMbCIDRQ0AIAQgAiAD/AoAAAsgAgRAIAIQIgsgACABNgIIIAAgBDYCAAsLPQECfyAAKAIEIgIgACgCCCIBRwRAIAAgASACIAFrQQ9qQXBxajYCCAsgACgCACIBBEAgACgCDBogARAiCwu7CwEJfyAAIAFByAD8CgAAIABBADYCUCAAQgA3A0gCQCABKAJMIgNFDQAgASgCSCEFIANBGGwiBBAnIQIgBEUNACACIAUgBPwKAAALIAAgAzYCUCAAIAM2AkwgACACNgJIQQAhBCMAQRBrIgIkACAAQdgAaiIDQgA3AgggA0IANwIAIAEoAlghCSABKAJcIQUgAkEANgIAQQQQIyIHQQE2AgAgAiAFNgIIIAIgBTYCBCACIAc2AgwCQCAFRQ0AIAIgBUECdCIIECciBDYCACAIRQ0AIAQgCSAI/AoAAAsgAiADRwRAIAMgBzYCDCACQQA2AgwgAyAFNgIIIAMgBTYCBCADIAQ2AgAgAkEANgIIIAJCADcCAAsgAhBJIANCADcCGCADQgA3AhAgASgCaCEJIAEoAmwhBUEAIQQgAkEANgIAQQQQIyIHQQE2AgAgAiAFNgIIIAIgBTYCBCACIAc2AgwgA0EQaiEKAkAgBUUNACACIAVBAnQiCBAnIgQ2AgAgCEUNACAEIAkgCPwKAAALIAIgCkcEQCADIAc2AhwgAkEANgIMIAMgBTYCGCADIAU2AhQgAyAENgIQIAJBADYCCCACQgA3AgALIAIQSSADQgA3AiggA0IANwIgIAEoAnghCSABKAJ8IQVBACEEIAJBADYCAEEEECMiB0EBNgIAIAIgBTYCCCACIAU2AgQgAiAHNgIMIANBIGohCgJAIAVFDQAgAiAFQQJ0IggQJyIENgIAIAhFDQAgBCAJIAj8CgAACyACIApHBEAgAyAHNgIsIAJBADYCDCADIAU2AiggAyAFNgIkIAMgBDYCICACQQA2AgggAkIANwIACyACEEkgAkEQaiQAIABBADYCkAEgAEIANwOIAQJAIAEoAowBIgNFDQAgASgCiAEhBCADQQN0IgIQJyEGIAJFDQAgBiAEIAL8CgAAC0EAIQIgAEEANgKgASAAQgA3A5gBIAAgAzYCkAEgACADNgKMASAAIAY2AogBQQAhBgJAIAEoApwBIgNFDQAgASgCmAEhBSADQRhsIgQQJyEGIARFDQAgBiAFIAT8CgAACyAAQQA2ArABIABCADcDqAEgACADNgKgASAAIAM2ApwBIAAgBjYCmAECQCABKAKsASIDRQ0AIAEoAqgBIQQgA0EYbCIGECchAiAGRQ0AIAIgBCAG/AoAAAtBACEGIABBADYCwAEgAEIANwO4ASAAIAM2ArABIAAgAzYCrAEgACACNgKoAUEAIQICQCABKAK8ASIDRQ0AIAEoArgBIQUgA0EFdCIEECchAiAERQ0AIAIgBSAE/AoAAAsgACADNgLAASAAIAM2ArwBIAAgAjYCuAEgASgCyAEhAiAAQgA3A9ABIAAgAjYCyAEgACAAQdABajYCzAEgAEHMAWogASgCzAEgAUHQAWoQgwMgAEEANgLgASAAQgA3A9gBAkAgASgC3AEiA0UNACABKALYASEEIANBBHQiAhAnIQYgAkUNACAGIAQgAvwKAAALQQAhAiAAQQA2AvABIABCADcD6AEgACADNgLgASAAIAM2AtwBIAAgBjYC2AFBACEGAkAgASgC7AEiA0UNACABKALoASEFIANBMGwiBBAnIQYgBEUNACAGIAUgBPwKAAALIABBADYCgAIgAEIANwP4ASAAIAM2AvABIAAgAzYC7AEgACAGNgLoAQJAIAEoAvwBIgNFDQAgASgC+AEhBCADQQJ0IgYQJyECIAZFDQAgAiAEIAb8CgAAC0EAIQQgAEEANgKQAiAAQgA3A4gCIAAgAzYCgAIgACADNgL8ASAAIAI2AvgBIAEoAowCIgIEQCABKAKIAiIBIAJBA3QiA2ohBSADECciBCEGA0AgBiABKAIANgIAIAYgASgCBDYCBCAGQQhqIQYgAUEIaiIBIAVHDQALCyAAIAI2ApACIAAgAjYCjAIgACAENgKIAiAAC40CAQR/IwBBEGsiAiQAIAAoAgwoAgBBAk4EQCAAKAIAIQQgACgCBCEBIAJBADYCAEEEECMiA0EBNgIAIAIgATYCCCACIAE2AgQgAiADNgIMAkAgAUUNACACIAFBAnQiARAnIgM2AgAgAUUNACADIAQgAfwKAAALIAAgAkcEQAJAIAAoAgwiAUUNACABIAEoAgAiAUEBazYCACABQQFKDQAgACgCDCIBBEAgARAiCyAAQQA2AgwgACgCACIBRQ0AIAEQIgsgACACKAIMNgIMIAJBADYCDCAAIAIoAgA2AgAgACACKAIENgIEIAAgAigCCDYCCCACQQA2AgggAkIANwIACyACEEkLIAJBEGokAAtXAQN/IAAoAgggAUkEQCABQQR0ECchBCAAKAIAIQICQCAAKAIEIgNFDQAgA0EEdCIDRQ0AIAQgAiAD/AoAAAsgAgRAIAIQIgsgACABNgIIIAAgBDYCAAsLogIBAX8gACgCiAIiAQRAIAEQIgsgAEEANgKQAiAAQgA3A4gCIAAoAvgBIgEEQCABECILIABBADYCgAIgAEIANwP4ASAAKALoASIBBEAgARAiCyAAKALYASIBBEAgARAiCyAAQQA2AuABIABCADcD2AEgAEHMAWogACgC0AEQbyAAKAK4ASIBBEAgARAiCyAAQQA2AsABIABCADcDuAEgACgCqAEiAQRAIAEQIgsgAEEANgKwASAAQgA3A6gBIAAoApgBIgEEQCABECILIABBADYCoAEgAEIANwOYASAAKAKIASIBBEAgARAiCyAAQQA2ApABIABCADcDiAEgAEH4AGoQSSAAQegAahBJIABB2ABqEEkgACgCSCIBBEAgARAiCyAAC7kCACAAQgA3A0AgAEKAgICAgICA+L9/NwM4IABCgICAgICAgPi/fzcDMCAAQoCAgICAgIB4NwMoIABCgICAgICAgHg3AyAgAEKAgICAgICAeDcDGCAAQoCAgICAgID4/wA3AxAgAEKAgICAgICA+P8ANwMIIABCgICAgICAgPj/ADcDACAAQgA3A0ggAEEANgJQIABB2ABqEKECGiAAQgA3A9ABIABBfzYCyAEgAEEANgLAASAAQgA3A7gBIABBADYCsAEgAEIANwOoASAAQQA2AqABIABCADcDmAEgAEEANgKQASAAQgA3A4gBIABBADYCkAIgAEIANwOIAiAAQQA2AoACIABCADcD+AEgAEEANgLwASAAQgA3A+gBIABBADYC4AEgAEIANwPYASAAIABB0AFqNgLMASAAC1UBAn8gAEEANgIIIABCADcCACABKAIEIgIgASgCACIDRwRAIAAgAiADayIBQQR1EI8DIAAoAgQhAiABBEAgAiADIAH8CgAACyAAIAEgAmo2AgQLIAALoAIBBX8jAEEgayIFJAACQAJAIAAoAgQiAiAAKAIIIgNJBEAgAiABKAIANgIAIAJBBGohAQwBCyACIAAoAgAiBGtBAnUiBkEBaiICQYCAgIAETw0BIAVBDGpB/////wMgAyAEayIDQQF1IgQgAiACIARJGyADQfz///8HTxsgBiAAEEoiAigCCCIDIAEoAgA2AgAgAiADQQRqNgIIIAIoAgQgACgCBCAAKAIAIgNrIgFrIQQgAQRAIAQgAyAB/AoAAAsgACgCACEDIAAgBDYCACACIAM2AgQgACACKAIIIgE2AgQgAiADNgIIIAAoAgghBCAAIAIoAgw2AgggAiADNgIAIAIgBDYCDCACEFMLIAAgATYCBCAFQSBqJAAPCxAmAAvQAQIBfAF/IwBBEGsiAiQARAAAAAAAAPh/IQECQCAAvUL///////////8Ag0L/////////9/8AVg0ARAAAAAAAAAAAIQEgAEQAAAAAAAAAAGMEQCAAmhA+miEBDAELIACZRAAAAAAAgFZAIAJBDGoQpQNEGC1EVPshCUCiRAAAAAAAgGZAoyEAAkACQAJAAkAgAigCDEEEbw4EAAECAwQLIAAQqAEhAQwDCyAAEJcBIQEMAgsgABCoAZohAQwBCyAAEJcBmiEBCyACQRBqJAAgAQspACAAIAEoAgQgAhASIgEQGzYCBCAAQZygAjYCACABQQlPBEAgARABCwujAQEBf0EkECMiAkIANwIMIAJBhJYCNgIAIAJCADcCBCACQgA3AhQgAkIANwIcIABCADcDGCAAQoCAgICAgID4PzcDECAAQgA3AwggACACNgIEIAAgAkEMajYCACAAQgA3AyAgAEIANwMwIABCgICAgICAgPg/NwMoIABCADcDOCABKAIAGiAAQQhqIAFBCGoQXiAAQRBqIAFBEGpBMPwKAAAgAAsOACAAQQhqEC8aIAAQLwsCAAtyAQF/QSQQIyICQgA3AgwgAkGElgI2AgAgAkIANwIEIAJCADcCFCACQgA3AhwgACACNgIEIAAgAkEMajYCACAAIAEoAgA2AgggACABKAIEIgI2AgwgAgRAIAIgAigCBEEBajYCBAsgAEIANwIQIAEQLxoLVwEDfyAAKAIIIAFJBEAgAUEDdBAnIQQgACgCACECAkAgACgCBCIDRQ0AIANBA3QiA0UNACAEIAIgA/wKAAALIAIEQCACECILIAAgATYCCCAAIAQ2AgALCy0BAX8gACgCACIBBEAgACABNgIEIAAoAggaIAEQIiAAQQA2AgggAEIANwIACwuLAQEDfyMAQRBrIgMkAEGoAhAjIgJBoJACNgIAIAJCADcCBCACQRBqEDshBCACIAE2AlQgAyACNgIMIAMgBDYCCCACIAIoAgRBAWo2AgQgAyADKQIINwMAIAAgAxBIGiACIAIoAgQiAEEBazYCBCAARQRAIAIgAigCACgCCBEAACACECQLIANBEGokAAs+ACADBEAgACADEKMCIAAoAgQhAyABIAJHBEADQCADIAEQPEEMaiEDIAFBDGoiASACRw0ACwsgACADNgIECwt5AQJ/IwBBEGsiAyQAQSQQIyICQgA3AgwgAkGElgI2AgAgAkIANwIEIAJCADcCFCACQgA3AhwgACACNgIEIAAgAkEMajYCACADQQRqIAEQWSAAIAMoAgQ2AgggACADKAIINgIMIABCADcCECABEC8aIANBEGokACAAC1gBAX8CQCAAKAIMIgFFDQAgASABKAIAIgFBAWs2AgAgAUEBSg0AIAAoAgwiAQRAIAEQIgsgAEEANgIMIAAoAgAiAQRAIAEQIgsgAEEANgIIIABCADcCAAsLYAAgACADNgIQQQAhAyAAQQA2AgwCQCABBEAgAUGAgICABE8NASABQQJ0ECMhAwsgACADNgIAIAAgAyACQQJ0aiICNgIIIAAgAyABQQJ0ajYCDCAAIAI2AgQgAA8LEHIAC2AAIAAgAzYCEEEAIQMgAEEANgIMAkAgAQRAIAFBgICAgAJPDQEgAUEDdBAjIQMLIAAgAzYCACAAIAMgAkEDdGoiAjYCCCAAIAMgAUEDdGo2AgwgACACNgIEIAAPCxByAAu3AgEFfyMAQSBrIgUkAAJAAkAgACgCBCICIAAoAggiA0kEQCACIAEpAwg3AwggAiABKQMANwMAIAJBEGohAQwBCyACIAAoAgAiBGtBBHUiBkEBaiICQYCAgIABTw0BIAVBDGpB/////wAgAyAEayIDQQN1IgQgAiACIARJGyADQfD///8HTxsgBiAAEDIiAigCCCIDIAEpAwg3AwggAyABKQMANwMAIAIgAigCCEEQajYCCCACKAIEIAAoAgQgACgCACIDayIBayEEIAEEQCAEIAMgAfwKAAALIAAoAgAhAyAAIAQ2AgAgAiADNgIEIAAgAigCCCIBNgIEIAIgAzYCCCAAKAIIIQQgACACKAIMNgIIIAIgAzYCACACIAQ2AgwgAhA2CyAAIAE2AgQgBUEgaiQADwsQJgALsgYCC38KfCMAQTBrIgMkACABKAIAGgJAIAErAxggASsDECINIA1EAAAAAAAA8D9hIgIbIg1EAAAAAAAAAABEAAAAAAAA8D8gAhsiDmINACABKwMoIAErAyAiDSANRAAAAAAAAAAAYSICGyINRAAAAAAAAPA/RAAAAAAAAAAAIAIbIg5iDQBEAAAAAAAAAAAhDiABKwM4IAErAzAiDSANRAAAAAAAAAAAYRshDQsgDSAOYgRAIAEoAgghAiADQQA2AgggA0IANwIAIAMgAigCACIEIAIoAgQiAiACIARrQQxtEEcgASsDOCERIAErAzAhEiABKwMoIQ0gASsDECEOIAErAyAhDyABKwMYIRAgA0EANgIUIANCADcCDCADQQxqIAMoAgQgAygCAGtBDG0QViADKAIAIgQgAygCBCIJRwRAIBAgD6IhEyAOIA2iIRQDQCADQSRqIAQQPCEFIANBGGogAygCKCICIAUoAgAiBmtBBHUiCBCSAyEHIAIgBkcEQCAHKAIAIQYgBSgCACEKQQAhAgNAIAYgCCACQX9zaiACIBMgFGQbQQR0aiILIBEgECAKIAJBBHRqIgwrAwAiFaIgDSAMKwMIIhaioKA5AwggCyASIA4gFaIgDyAWoqCgOQMAIAJBAWoiAiAIRw0ACwsgA0EMaiAHEHYgBygCACICBEAgAyACNgIcIAMoAiAaIAIQIgsgBSgCACICBEAgAyACNgIoIAMoAiwaIAIQIgsgBEEMaiIEIAlHDQALC0EYECMiAkG0mgI2AgAgAkIANwIEIAJBDGoiBCADQQxqEFsgAyACNgIoIAMgBDYCJCABQQhqIANBJGoQTgJAIAMoAigiAkUNACACIAIoAgQiBEEBazYCBCAEDQAgAiACKAIAKAIIEQAAIAIQJAsgAyADQQxqNgIYIANBGGoiAhApIAMgAzYCGCACECkgAUKAgICAgICA+D83AxAgAUIANwMgIAFCADcDGCABQoCAgICAgID4PzcDKCABQgA3AzggAUIANwMwCyAAIAEoAgg2AgAgACABKAIMIgA2AgQgAARAIAAgACgCBEEBajYCBAsgA0EwaiQAC0wBAX4gASkCACECIAFCADcCACAAKAIEIQEgACACNwIAAkAgAUUNACABIAEoAgQiAEEBazYCBCAADQAgASABKAIAKAIIEQAAIAEQJAsLjAECAn4CfyAAKAIAIAFBA3RqKAIAIAFHBEADQCAAKAIAIgQgBCABQQN0IgVqKQMAIgOnQQN0aikDACICpyEBIAJC/////w+DIANCgICAgHCDhCICIANSBEAgACgCACAFaiIEIAIgBCkDACICIAIgA1EbNwMACyABIAAoAgAgAUEDdGooAgBHDQALCyABCzMBAn9BASAAIABBAU0bIQADQAJAIAAQJyIBDQBBoKsCKAIAIgJFDQAgAhEMAAwBCwsgAQsPACAAIAAoAgAoAgQRAAALBAAgAAs9AQJ/IAAoAgQiAiAAKAIIIgFHBEAgACABIAIgAWtBA2pBfHFqNgIICyAAKAIAIgEEQCAAKAIMGiABECILC9AUAgx/BnwjAEHgAGsiCSQAAkAgACgCXEUEQCAAKALoASIBBEAgARAiCyAAQQA2AvABIABCADcD6AEgACgC+AEiAQRAIAEQIgsgAEEANgKAAiAAQgA3A/gBIAAoAogCIgEEQCABECILIABBADYCkAIgAEIANwOIAgwBCyAAQdgAahA4IABB6ABqEDggAEH4AGoQOCMAQcABayIEJAAgACgCTCEDIARBADYCtAEgBEIANwKsASAEQawBaiADECUgBCADNgKwAQJAAkACQAJAIAEEQCADRQ0CIAEtABBBAXENAgNAIAZBAWoiBkGACEYEQEEAIQYgAS0AEA0ECyAAKAJIIAJBGGxqIgUrAwAiDiAOYgR/QX8FIAQgBSkDEDcDkAEgBCAFKQMINwOIASAEIAUpAwA3A4ABIARB0ABqIgUgAEEw/AoAACAEQYABaiAFEIUCCyEFIAQoAqwBIAJBAnRqIAU2AgAgAkEBaiICIANHDQALDAELIANFDQIDQCAAKAJIIAJBGGxqIgUrAwAiDiAOYgR/QX8FIAQgBSkDEDcDSCAEIAUpAwg3A0AgBCAFKQMANwM4IARBCGoiBSAAQTD8CgAAIARBOGogBRCFAgshBSAEKAKsASACQQJ0aiAFNgIAIAJBAWoiAiADRw0ACwsgAUUNAQsgAS0AEA0BC0EAIQIgBEEANgKkASAEQgA3ApwBIARBnAFqIAMQJSAEIAM2AqABIAQoApwBIgogA0ECdGohCAJAAkAgAwRAA0AgCiACQQJ0aiACNgIAIAJBAWoiAiADRw0ACyAEIARBrAFqNgK8ASADQYEBSA0BIAMhAgNAIAJBAnQQUCIFRQRAIAJBAXYiAg0BDAMLCyAKIAggBEG8AWogAyAFIAIQugEgBRAiDAILIAQgBEGsAWo2ArwBCyAKIAggBEG8AWogA0EAQQAQugELIAAgBEGcAWogAyABEOEDAkAgAQRAIAEtABANAQsgBCgCnAEiCiECIAQoAqABIgYEQCAEKAKsASEIA0AgAiACIAZBAXYiC0ECdGoiAkEEaiAIIAIoAgBBAnRqKAIAQX9GIgUbIQIgCyAGIAtBf3NqIAUbIgYNAAsLIARBnAFqIgUgAiAKa0ECdUEAEDEgAEHIAGogBRClASAAKAKcASADRw0AIABBmAFqIAUQpQELIAQoApwBIgNFDQAgAxAiCyAEKAKsASIDBEAgAxAiCyAEQcABaiQAIAEEQCABLQAQDQELIAlBADYCWCAJQgA3AlAgCUEANgJIIAlCADcCQCAAIAlB0ABqIgIgCUFAayIDIAEQzwICQAJAIAFFBEAgACACIANBABDjAwwBCyABLQAQDQEgACAJQdAAaiAJQUBrIAEQ4wMgAS0AEA0BCyAAKAJcRQRAIAAoAugBIgEEQCABECILIABBADYC8AEgAEIANwPoASAAKAL4ASIBBEAgARAiCyAAQQA2AoACIABCADcD+AEgACgCiAIiAQRAIAEQIgsgAEEANgKQAiAAQgA3A4gCDAELIAkgCSkCUDcCCCAJIAkpAkA3AgACQCAJQRBqIAlBCGogCRDiAyICIABB6AFqRwRAIAAoAugBIgMEQCADECILIAAgAigCADYC6AEgACACKAIENgLsASAAIAIoAgg2AvABIAJBADYCCCACQgA3AgAgACgC+AEiAwRAIAMQIgsgACACKAIQNgL4ASAAIAIoAhQ2AvwBIAAgAigCGDYCgAIgAkEANgIYIAJCADcCECAAKAKIAiIDBEAgAxAiCyAAIAIoAiA2AogCIAAgAigCJDYCjAIgACACKAIoNgKQAgwBCyACKAIgIgNFDQAgAxAiCyACQQA2AiggAkIANwIgIAIoAhAiAwRAIAMQIgsgAkEANgIYIAJCADcCECACKAIAIgMEQCADECILAnwgACgC7AFFBEBEAAAAAAAA8P8hD0QAAAAAAADw/yEQRAAAAAAAAPD/IRFEAAAAAAAA8H8hEkQAAAAAAADwfyETRAAAAAAAAPB/DAELIAAoAugBIgMrA1ghDyADKwNQIRAgAysDSCERIAMrAzghEiADKwMwIRMgAysDQAshDiAAIA85AyggACAQOQMgIAAgETkDGCAAIA45AxAgACASOQMIIAAgEzkDAEEAIQJBACEGIwBBIGsiByQAAkAgACgCQCIMRQ0AIAAoAowBIQsgB0EANgIYIAdCADcCECAHQRBqIAsgDG4iBEEAEDEgACgCXCEDAkACQCABBEACQCADRQ0AIAEtABBBAXENAANAIAZBAWoiBkGACEYEQEEAIQYgAS0AEA0CCyAHKAIQIAAoAnggAkECdGooAgBBAnRqQQE2AgAgAkEBaiICIANHDQALCyABLQAQRQ0BDAILIANFDQADQCAHKAIQIAAoAnggAkECdGooAgBBAnRqQQE2AgAgAkEBaiICIANHDQALCyAHQQA2AgggB0IANwIAIAcgBEEBakEAEDEgBygCACEKAkAgBygCFCIDRQ0AIAogBygCECIIKAIAIgU2AgQgA0EBRg0AIAggA0ECdGohAyAKQQRqIQIgCEEEaiEGA0AgAiAGKAIAIAVqIgU2AgQgAkEEaiECIAZBBGoiBiADRw0ACwsgAEGIAWohCAJAIAAoAowBIgVFDQAgCCgCACEDIAVBA3QiAhAnIQ0gAkUNACANIAMgAvwKAAALIAggCiAEQQJ0aigCACAMbCIDEEQgACADNgKMASAFQRFJIAUgA0EBdE1yRQRAIAgQlAELAkACQAJAAkAgAQRAIAsgDEkNAiABLQAQQQFxDQIgDEEDdCELIAgoAgAhCkEAIQYgBygCACEIIAcoAhAhBUEAIQIDQCAGQQFqIgZBgAhGBEBBACEGIAEtABANBAsCQCAMQQBMDQAgBSACQQJ0IgNqKAIARSALRXINACAKIAMgCGooAgAgDGxBA3RqIA0gAiALbGogC/wKAAALIAJBAWoiAiAERw0ACwwBCyALIAxJDQIgDEEDdCEGIAgoAgAhC0EAIQIgBygCACEKIAcoAhAhCCAMQQBMIQUDQAJAIAUNACAIIAJBAnQiA2ooAgBFIAZFcg0AIAsgAyAKaigCACAMbEEDdGogDSACIAZsaiAG/AoAAAsgAkEBaiICIARHDQALCyABRQ0BCyABLQAQDQEgACgCXCIKRQ0BIAEtABBBAXENASAAKAJ4IQhBACECIAcoAgAhBUEAIQADQCACQQFqIgJBgAhGBEBBACECIAEtABANAwsgCCAAQQJ0aiIDIAUgAygCAEECdGooAgA2AgAgAEEBaiIAIApHDQALDAELIAAoAlwiBUUNACAAKAJ4IQJBACEAIAcoAgAhAwNAIAIgAEECdGoiASADIAEoAgBBAnRqKAIANgIAIABBAWoiACAFRw0ACwsgDQRAIA0QIgsgBygCACIARQ0AIAAQIgsgBygCECIARQ0AIAAQIgsgB0EgaiQACyAJKAJAIgAEQCAAECILIAkoAlAiAEUNACAAECILIAlB4ABqJAALVwEDfyAAKAIIIAFJBEAgAUEFdBAnIQQgACgCACECAkAgACgCBCIDRQ0AIANBBXQiA0UNACAEIAIgA/wKAAALIAIEQCACECILIAAgATYCCCAAIAQ2AgALC8gBAQR/IwBBIGsiBCQAAkAgACgCCCAAKAIAIgJrQQxtIAFJBEAgAUHWqtWqAU8NASAEQQxqIAEgACgCBCACa0EMbSAAEGEiASgCBCAAKAIEIAAoAgAiBWsiAkF0bUEMbGohAyACBEAgAyAFIAL8CgAACyAAKAIAIQIgACADNgIAIAEgAjYCBCAAIAEoAgg2AgQgASACNgIIIAAoAgghAyAAIAEoAgw2AgggASACNgIAIAEgAzYCDCABENUBCyAEQSBqJAAPCxAmAAtTAQF/IAEoAhAiAkUEQCAAQQA2AhAgAA8LIAEgAkYEQCAAIAA2AhAgASgCECIBIAAgASgCACgCDBEBACAADwsgACACIAIoAgAoAggRBAA2AhAgAAuABQIGfAN/AkAgACgCTCIIBEAgACgCSCIHIAhBGGxqIQlEAAAAAAAA8H8hAkQAAAAAAADwfyEDIAchCEQAAAAAAADwfyEBA0AgCCsDECEFIAgrAwghBiAIKwMAIQQCQCABIAFiBEAgBSECIAYhAyAEIQEMAQsgBCAEYg0AIAIgBSACIAVjGyECIAMgBiADIAZjGyEDIAEgBCABIARjGyEBCyAIQRhqIgggCUcNAAsgACACOQMQIAAgAzkDCCAAIAE5AwBEAAAAAAAA8P8hAkQAAAAAAADw/yEDRAAAAAAAAPD/IQEDQCAHKwMQIQUgBysDCCEGIAcrAwAhBAJAIAEgAWIEQCAFIQIgBiEDIAQhAQwBCyAEIARiDQAgBSACIAIgBWMbIQIgBiADIAMgBmMbIQMgBCABIAEgBGMbIQELIAdBGGoiByAJRw0ACwwBCyAAQoCAgICAgID4/wA3AxAgAEKAgICAgICA+P8ANwMIIABCgICAgICAgPj/ADcDAEQAAAAAAADw/yECRAAAAAAAAPD/IQNEAAAAAAAA8P8hAQsgACACOQMoIAAgAzkDICAAIAE5AxhBACEHAkAgACkDAEL///////////8Ag0L/////////9/8AVg0AIAApAwhC////////////AINCgICAgICAgPj/AFoNACAAKQMQQv///////////wCDQoCAgICAgID4/wBaDQAgACkDGEL///////////8Ag0KAgICAgICA+P8AVCAAKQMgQv///////////wCDQoCAgICAgID4/wBUcSAAKQMoQv///////////wCDQoCAgICAgID4/wBUcSEHCyAHRQRAIABBABAsCwuDAQECf0GgARAjIQMjAEEQayICJAAgA0IANwIEIANBgJQCNgIAIAIgASgCADYCCCACIAEoAgQiATYCDCABBEAgASABKAIEQQFqNgIECyACIAIpAgg3AwAgA0EQaiIBIAIQ/gIgAkEQaiQAIAAgAzYCBCAAIAE2AgAgACADQRRqIAEQjwELwAoCC38GfCMAQUBqIgMkACAAKAJcIQQgA0IANwM4IANCADcDMCADQgA3AyggA0IANwMAIANCADcDCCADQgA3AxAgAEGoAWogBEEDbiIGIAMQZwJAAkACQCAEQQJNBEAgBkEEdCEBDAELIAZBBHQQJyEIA0AgAkEEdCILIAAoAtgBakF/NgIMAkAgACgCWCACQQxsaiIFKAIAIglBAEgEQEQAAAAAAAAAACEMDAELIAAoAqgBIAJBGGxqIgEgACgCSCIHIAUoAgRBGGxqIgorAwAgByAJQRhsaiIJKwMAIgyhIg4gByAFKAIIQRhsaiIFKwMIIAkrAwgiDaEiD6IgCisDCCANoSINIAUrAwAgDKEiEKKhIgwgDCAMoiANIAUrAxAgCSsDECIMoSIRoiAKKwMQIAyhIgwgD6KhIg0gDaIgDCAQoiAOIBGioSIOIA6ioKAiDJ8iD6M5AxAgASAOIA+jOQMIIAEgDSAPoyINOQMAIA0gDWENACABQgA3AwggAUIANwMAIAFCgICAgICAgPg/NwMQCyAIIAtqIgEgAjYCCCABIAw5AwAgAkEBaiICIAZHDQALIAggBkEEdGohASAEQYMDSQ0AIAYhAgNAIAJBBHQQUCIFDQIgAkEBdiICDQALCyAIIAEgBkEAQQAQxQEMAQsgCCABIAYgBSACEMUBIAUQIgsgA0EANgIgIANCADcCGCAEQQNPBEAgCCAGQQR0aiEKIAghBgNAAkAgACgC2AEgBigCCCIFQQR0aiICKAIMQQBODQAgAiAFNgIMIAAoAlggBUEDbCICQQJ0aigCACIEQQBIDQAgACgCqAEgBUEYbGoiASsDECEMIAErAwghDSABKwMAIQ4gACgCSCAEQRhsaiIBKwMQIQ8gASsDCCEQIAErAwAhESADQRhqQQNBABAxIAMoAhgiASACQQJqNgIIIAEgAkEBajYCBCABIAI2AgAgAygCHCICRQ0AA0AgACgCaCADKAIYIAJBAnRqQQRrKAIAQQJ0aigCACEBIANBGGoiByACQQFrIgQQJSADIAQ2AhwgAkERSSACIARBAXRNckUEQCAHEC0LAkAgACgC2AEgAUF+QQEgAUEDb0ECRhtqIgRBA20iAUEEdGoiCSgCDEEATgRAIAMoAhwhAgwBCyADKAIcIQIgACsDOCAOIAAoAkggACgCWEF+QQEgBCABQQNsa0ECRhsiC0ECdGogBEECdGooAgBBGGxqIgcrAwAgEaGiRAAAAAAAAAAAoCANIAcrAwggEKGioCAMIAcrAxAgD6GioJlkRQ0AIAkgBTYCDCAAKAKoASABQRhsaiIBIAw5AxAgASANOQMIIAEgDjkDAAJAAkAgAgRAIAQgACgCaCADKAIYIAJBAnRqQQRrKAIAQQJ0aigCAEYNAQsCQCADKAIgIgEgAk0EQCADQRhqIAFBAXRBgAEgARsQJSADKAIYIAMoAhwiAkECdGogBDYCAAwBCyADKAIYIAJBAnRqIAQ2AgALIAMgAkEBaiIBNgIcDAELIANBGGoiByACQQFrIgEQJSADIAE2AhwgAkERSSACIAFBAXRNcg0AIAcQLSADKAIcIQELIAQgC2ohAgJAIAMoAiAiBCABTQRAIANBGGogBEEBdEGAASAEGxAlIAMoAhggAygCHCIBQQJ0aiACNgIADAELIAMoAhggAUECdGogAjYCAAsgAyABQQFqIgI2AhwLIAINAAsLIAZBEGoiBiAKRw0ACwsgABCUAiADKAIYIgAEQCAAECILIAgEQCAIECILIANBQGskAAtyAQJ/IwBBEGsiAiQAIAJBADYCCCACQgA3AgAgAiABKAIAIgMgASgCBCIBIAEgA2tBDG0QRyAAQQA2AgggAEIANwIAIAAgAigCACIAIAIoAgQiASABIABrQQxtEEcgAiACNgIMIAJBDGoQKSACQRBqJAALwQEBBH8jAEEgayIEJAACQCAAKAIIIAAoAgAiAmtBBHUgAUkEQCABQYCAgIABTw0BIARBDGogASAAKAIEIAJrQQR1IAAQMiIBKAIEIAAoAgQgACgCACIFayICayEDIAIEQCADIAUgAvwKAAALIAAoAgAhAiAAIAM2AgAgASACNgIEIAAgASgCCDYCBCABIAI2AgggACgCCCEDIAAgASgCDDYCCCABIAI2AgAgASADNgIMIAEQNgsgBEEgaiQADwsQJgALwgUDAnwBfgF/IAC9IgNCIIinQf////8HcSIEQYCAwP8DTwRAIAOnIARBgIDA/wNrckUEQEQAAAAAAAAAAEQYLURU+yEJQCADQgBZGw8LRAAAAAAAAAAAIAAgAKGjDwsCfCAEQf////4DTQRARBgtRFT7Ifk/IARBgYCA4wNJDQEaRAdcFDMmppE8IAAgACAAoiIBIAEgASABIAEgAUQJ9/0N4T0CP6JEiLIBdeDvST+gokQ7j2i1KIKkv6CiRFVEiA5Vwck/oKJEfW/rAxLW1L+gokRVVVVVVVXFP6CiIAEgASABIAFEgpIuscW4sz+iRFkBjRtsBua/oKJEyIpZnOUqAECgokRLLYocJzoDwKCiRAAAAAAAAPA/oKOioSAAoUQYLURU+yH5P6APCyADQgBTBEBEGC1EVPsh+T8gAEQAAAAAAADwP6BEAAAAAAAA4D+iIgCfIgEgASAAIAAgACAAIAAgAEQJ9/0N4T0CP6JEiLIBdeDvST+gokQ7j2i1KIKkv6CiRFVEiA5Vwck/oKJEfW/rAxLW1L+gokRVVVVVVVXFP6CiIAAgACAAIABEgpIuscW4sz+iRFkBjRtsBua/oKJEyIpZnOUqAECgokRLLYocJzoDwKCiRAAAAAAAAPA/oKOiRAdcFDMmppG8oKChIgAgAKAPC0QAAAAAAADwPyAAoUQAAAAAAADgP6IiACAAnyICvUKAgICAcIO/IgEgAaKhIAIgAaCjIAIgACAAIAAgACAAIABECff9DeE9Aj+iRIiyAXXg70k/oKJEO49otSiCpL+gokRVRIgOVcHJP6CiRH1v6wMS1tS/oKJEVVVVVVVVxT+goiAAIAAgACAARIKSLrHFuLM/okRZAY0bbAbmv6CiRMiKWZzlKgBAoKJESy2KHCc6A8CgokQAAAAAAADwP6CjoqAgAaAiACAAoAsLYwEBfyABKAIAIQIgASgCBCIBBEAgASABKAIEQQFqNgIECyAAIAI2AgAgACgCBCECIAAgATYCBAJAIAJFDQAgAiACKAIEIgBBAWs2AgQgAA0AIAIgAigCACgCCBEAACACECQLC4kCAgV/A34gACABEE8iAyAAIAIQTyICRwRAA0ACQAJ/IAAoAgAiASADQQN0aigCBEH/////B3EiBCABIAJBA3RqKAIEQf////8HcSIFTSAEIAVHIAIgA01ycUUEQCACIQEgAyECIAUhAyAEDAELIAMhASAEIQMgBQshBiAAKAIAIAFBA3RqIgcgA61CIIYiCSACrSIKhCAHKQMAIgggCCAJIAGthCIJURs3AwAgCCAJUQRAIAQgBUcNASAAKAIAIAJBA3RqIgMgBkEBaq1CIIYgCoQgAykDACIIIAggBq1CIIYgCoRRIgMbNwMAIAMgBnINAQsgACABEE8iAyAAIAIQTyICRw0BCwsLC1UBAn8gAEEANgIIIABCADcCACABKAIEIgIgASgCACIDRwRAIAAgAiADayIBQQJ1EPEBIAAoAgQhAiABBEAgAiADIAH8CgAACyAAIAEgAmo2AgQLIAALYAAgACADNgIQQQAhAyAAQQA2AgwCQCABBEAgAUHWqtWqAU8NASABQQxsECMhAwsgACADNgIAIAAgAyACQQxsaiICNgIIIAAgAyABQQxsajYCDCAAIAI2AgQgAA8LEHIAC5cDAQR/IwBBQGoiAiQAIAAgACgCACIDQQhrKAIAIgVqIQQCQCADQQRrKAIAIgMoAgQgASgCBEYEQEEAIAQgBRshAAwBCyAAIAROBEAgAkIANwIUIAJBADYCECACIAE2AgwgAiAANgIIIAIgAzYCBCACQgA3AhwgAkIANwIkIAJCADcCLCACQQA2AjwgAkKBgICAgICAgAE3AjQgAyACQQRqIAQgBEEBQQAgAygCACgCFBEIACACKAIcDQELIAJCADcCFCACQQA2AhAgAkHk5gE2AgwgAiAANgIIIAIgATYCBCACQgA3AhwgAkIANwIkIAJCADcCLCACQgA3ADMgAkEANgI8IAJBAToAOyADIAJBBGogBEEBQQAgAygCACgCGBEHAEEAIQACQAJAIAIoAigOAgABAgsgAigCGEEAIAIoAiRBAUYbQQAgAigCIEEBRhtBACACKAIsQQFGGyEADAELIAIoAhxBAUcEQCACKAIsDQEgAigCIEEBRw0BIAIoAiRBAUcNAQsgAigCFCEACyACQUBrJAAgAAu1AQIEfwJ+IAEpAwghBiABKQMAIQcgACgCPCIEKAIQIgIoAhAhAwJAIAAgBCgCCEciBUUEQCAHIAIpAwBSDQEgBiACKQMIUg0BIAIPCyAHIAMpAwBSDQAgBiADKQMIUg0AIAMPC0EgECMiACABKQMINwMIIAAgASkDADcDACAAQQA2AhwgACAENgIYIAMgADYCFCAAIAM2AhAgACACNgIUIAIgADYCECAFRQRAIAQgADYCEAsgAAtgACAAIAM2AhBBACEDIABBADYCDAJAIAEEQCABQavVqtUATw0BIAFBGGwQIyEDCyAAIAM2AgAgACADIAJBGGxqIgI2AgggACADIAFBGGxqNgIMIAAgAjYCBCAADwsQcgALVgEFfyAAKAIAIgIoAgAiAQRAIAEhAyACIQQgAigCBCIFIAFHBEADQCABIAVBCGsQLyIFRw0ACyAAKAIAIgQoAgAhAwsgAiABNgIEIAQoAggaIAMQIgsLHQEBf0EEEHQiAEGQ4gE2AgAgAEGc4gFBqwMQCwALkwEBBH8gACgCBCIDIAFBAXRLIANBEEtxAkAgASADTQ0AIAAgARAzIAEgACgCBCIDa0EYbCIEQQBMDQAgBEEYbiEEIAAoAgAgA0EYbGohAwNAIAMgAikDEDcDECADIAIpAwg3AwggAyACKQMANwMAIANBGGohAyAEQQFLIARBAWshBA0ACwsgACABNgIEBEAgABBxCwuKAwEFfyMAQSBrIgUkAAJAAkAgACgCBCICIAAoAggiA0kEQCACQQA2AgggAkIANwIAIAIgASgCADYCACACIAEoAgQ2AgQgAiABKAIINgIIIAFBADYCCCABQgA3AgAgAkEMaiEBDAELIAIgACgCACIEa0EMbSIGQQFqIgJB1qrVqgFPDQEgBUEMakHVqtWqASADIARrQQxtIgNBAXQiBCACIAIgBEkbIANBqtWq1QBPGyAGIAAQYSICKAIIIgNBADYCCCADQgA3AgAgAyABKAIANgIAIAMgASgCBDYCBCADIAEoAgg2AgggAUEANgIIIAFCADcCACACIANBDGo2AgggAigCBCAAKAIEIAAoAgAiA2siAUF0bUEMbGohBCABBEAgBCADIAH8CgAACyAAKAIAIQMgACAENgIAIAIgAzYCBCAAIAIoAggiATYCBCACIAM2AgggACgCCCEEIAAgAigCDDYCCCACIAM2AgAgAiAENgIMIAIQ1QELIAAgATYCBCAFQSBqJAAPCxAmAAvcAgEEfyMAQRBrIgMkACAAQZCcAjYCACAAEN4BIABBJGogACgCJBC9AyAAIAAoAjQiASAAKAI4IgJHBH8DQCABKAIAIgQEQCAEECILIAFBBGoiASACRw0ACyAAKAI0BSABCzYCOCAAQQA6AHwgAEEAOgAYIAAgACgCJDYCMCAAKAKAASIBBEAgACABNgKEASAAKAKIARogARAiCyAAKAJoIgEEQCAAIAE2AmwgACgCcBogARAiCyAAKAJcIgEEQCAAIAE2AmAgACgCZBogARAiCyAAKAJQIgEEQCAAIAE2AlQgACgCWBogARAiCyAAKAJAIgEEQCAAIAE2AkQgACgCSBogARAiCyAAKAI0IgEEQCAAIAE2AjggACgCPBogARAiCyADIABBJGo2AgwgAygCDCIBKAIAIgIEQCABIAIQvQMgAygCDCIBKAIAIAEoAggaECILIANBEGokACAAC40BAQF/QSQQIyICQgA3AgwgAkGElgI2AgAgAkIANwIEIAJCADcCFCACQgA3AhwgAEIANwMYIABCgICAgICAgPg/NwMQIABCADcDCCAAIAI2AgQgACACQQxqNgIAIABCADcDICAAQgA3AzAgAEKAgICAgICA+D83AyggAEIANwM4IABBCGogARBeIAEQLxoLBwAgABEOAAsYAQF/QQwQIyIAQQA2AgggAEIANwIAIAALIAAgACgCBCABEBIiACACKAIEEBUgAEEJTwRAIAAQAQsLSgECfyAAKAIEIgIgACgCCCIBRwRAA0AgACABQQhrIgE2AgggARAvGiACIAAoAggiAUcNAAsLIAAoAgAiAQRAIAAoAgwaIAEQIgsLHQAgAQRAIAAgASgCABBvIAAgASgCBBBvIAEQIgsL+wMBB38CQAJ/QQIgAUEBRg0AGiABIAEgAUEBa3FFDQAaIAEQ9gELIgMgACgCBCIBTQRAIAEgA00NASAAKAIMsyAAKgIQlY38ASECIAEgAyABQQNJIAFpQQFLcgR/IAIQ9gEFIAJBAUEgIAJBAWtna3QgAkECSRsLIgIgAiADSRsiA00NAQsgACEBAkACQCADBEAgA0GAgICABE8NASADQQJ0IgAQIyEFIAEoAgAhAiABIAU2AgAgAgRAIAEoAgQaIAIQIiABKAIAIQULIAEgAzYCBCAABEAgBUEAIAD8CwALIAEoAggiAEUNAiABQQhqIQEgACgCBCECAkAgA2kiBEEBTQRAIAIgA0EBa3EhAgwBCyACIANJDQAgAiADcCECCyAFIAJBAnRqIAE2AgAgACgCACIBRQ0CIANBAWshByAEQQFLIQgDQCABKAIEIQQCQCAIRQRAIAQgB3EhBAwBCyADIARLDQAgBCADcCEECwJAIAIgBEYEQCABIQAMAQsgBSAEQQJ0aiIGKAIARQRAIAYgADYCACABIQAgBCECDAELIAAgASgCADYCACABIAYoAgAoAgA2AgAgBigCACABNgIACyAAKAIAIgENAAsMAgsgASgCACEAIAFBADYCACAABEAgASgCBBogABAiCyABQQA2AgQMAQsQcgALCwtSAQR/IAAoAgAhAQJAIAAoAgQiA0UEQAwBCyADQRhsIgQQJyECIARFDQAgAiABIAT8CgAACyAAIAEEfyABECIgACgCBAUgAws2AgggACACNgIACx0BAX9BBBB0IgBBiO4BNgIAIABByO4BQe0CEAsAC3EBAX8gAkUEQCAAKAIEIAEoAgRGDwsgACABRgRAQQEPCwJAIAAoAgQiAi0AACIARSAAIAEoAgQiAS0AACIDR3INAANAIAEtAAEhAyACLQABIgBFDQEgAUEBaiEBIAJBAWohAiAAIANGDQALCyAAIANGCw4AIABB0ABqECdB0ABqCxsBAX8gAARAIAAoAgAiAQRAIAEQIgsgABAiCwuiAgEFfyMAQSBrIgUkAAJAAkAgACgCBCICIAAoAggiA0kEQCACIAEQPEEMaiEBDAELIAIgACgCACIEa0EMbSIGQQFqIgJB1qrVqgFPDQEgBUEMakHVqtWqASADIARrQQxtIgNBAXQiBCACIAIgBEkbIANBqtWq1QBPGyAGIAAQYSICKAIIIAEQPBogAiACKAIIQQxqNgIIIAIoAgQgACgCBCAAKAIAIgNrIgFBdG1BDGxqIQQgAQRAIAQgAyAB/AoAAAsgACgCACEDIAAgBDYCACACIAM2AgQgACACKAIIIgE2AgQgAiADNgIIIAAoAgghBCAAIAIoAgw2AgggAiADNgIAIAIgBDYCDCACENUBCyAAIAE2AgQgBUEgaiQADwsQJgALgQECAn8BfCMAQRBrIgMkAEHwngItAABBAXFFBEBBAUHYiwJBARAGIQRB8J4CQQE6AABB7J4CIAQ2AgALIANBADYCDEHsngIoAgAgASACIANBDGpBABAFIQUgAygCDCEBIAAgBfwDNgIEIABBnKACNgIAIAEEQCABEAQLIANBEGokAAuoAQEDfyMAQaACayIDJAACQAJAIAEoAgAiBCgCkAEiAkUEQCABKAIEIgEgASgCBEEBajYCBAwBCyACIAIoAgxBAWo2AgwgBCgCkAEhAiABKAIEIgEgASgCBEEBajYCBCACRQ0AIAItABBBAUcNACADQQhqEDsiAUEONgJEIAAgARCjAUEBOgCYAiABEDoaDAELIABBADoAmAIgAEEAOgAACyADQaACaiQAC5UCAQN/IAACfwJAIAEoAgQiBEUEQCABQQRqIgUhAgwBCyACKAIAIQYDQCAEIgIoAhAiBSAGSgRAIAQhBSAEKAIAIgQNAQwCC0EAIAUgBk4NAhogAigCBCIEDQALIAJBBGohBQtBiAEQIyIEIAMoAgAoAgA2AhAgBEEYakEAQfAA/AsAIARCADcDKCAEQoCAgICAgID4PzcDICAEQX82AhggBEIANwMwIARCADcDOCAEQgA3A0ggBEKAgICAgICA+D83A0AgBEIANwNQIARCADcDWCAEQgA3A2ggBEKAgICAgICA+D83A2AgBEIANwNwIARCADcDeCAEQQA7AYABIAEgAiAFIAQQggFBAQs6AAQgACAENgIAC1YBBX8gACgCACICKAIAIgEEQCABIQMgAiEEIAIoAgQiBSABRwRAA0AgASAFQRhrECgiBUcNAAsgACgCACIEKAIAIQMLIAIgATYCBCAEKAIIGiADECILC0oBA38gACgCBCICIAFHBEADQCACQQxrIgQoAgAiAwRAIAJBCGsgAzYCACACQQRrKAIAGiADECILIAQiAiABRw0ACwsgACABNgIECwwAIAEgACgCABEEAAvzAgEFfyAAKAIEIAAoAgAiAmtBAnUiAyABSQRAIwBBIGsiBSQAAkACQAJAIAEgA2siAyAAKAIIIgQgACgCBCICa0ECdU0EQCAAIAMEfyADQQJ0IgAEQCACQQAgAPwLAAsgACACagUgAgs2AgQMAQsgAiAAKAIAIgJrQQJ1IgYgA2oiAUGAgICABE8NASAFQQxqQf////8DIAQgAmsiAkEBdSIEIAEgASAESRsgAkH8////B08bIAYgABBKIgEoAgghAiADQQJ0IgMEQCACQQAgA/wLAAsgASACIANqNgIIIAEoAgQgACgCBCAAKAIAIgRrIgJrIQMgAgRAIAMgBCAC/AoAAAsgACgCACECIAAgAzYCACABIAI2AgQgACABKAIINgIEIAEgAjYCCCAAKAIIIQMgACABKAIMNgIIIAEgAjYCACABIAM2AgwgARBTCyAFQSBqJAAMAQsQJgALDwsgASADSQRAIAAgAiABQQJ0ajYCBAsLSQEBfyABKAJgIAFBADYCYEECRgRAIAEoAkQiA0EANgJgIAAgASADIAJBARDdAQ8LIAEoAkAiA0EANgJgIAAgAyABIAJBARDdAQs7AQF/IAEQowMiAhD1ASAAIAEoAgA2AgAgACABKAIEIgA2AgQgAARAIAAgACgCBEEBajYCBAsgAhD1AQtzAQR/IAAoAgQiAyABQQF0SyADQRBLcQJAIAEgA00NACAAIAEQRCABIAAoAgQiBGsiA0EATA0AIAAoAgAgBEEDdGohBANAIAQgAjkDACAEQQhqIQQgA0EBSyADQQFrIQMNAAsLIAAgATYCBARAIAAQlAELC50BAQR/IAAoAgQiAyABQQF0SyADQRBLcQJAIAEgA00NACAAKAIIIAFJBEAgARAnIQQgACgCACEDIAAoAgQiBUUgBUVyRQRAIAQgAyAF/AoAAAsgAwRAIAMQIgsgACABNgIIIAAgBDYCAAsgASAAKAIEIgRrIgNBAEwgA0VyDQAgACgCACAEaiACIAP8CwALIAAgATYCBARAIAAQhAMLC0IAIAMgATYCCCADQgA3AgAgAiADNgIAIAAoAgAoAgAiAQRAIAAgATYCAAsgACgCBCADEKcBIAAgACgCCEEBajYCCAtSAQR/IAAoAgAhAQJAIAAoAgQiA0UEQAwBCyADQQR0IgQQJyECIARFDQAgAiABIAT8CgAACyAAIAEEfyABECIgACgCBAUgAws2AgggACACNgIACxAAIAEgAiADIAAoAgARBgALEAAgASACIAMgACgCABEDAAucBAEEfyABKAJgBEAgACABIAMQfgsgAigCYARAIAAgAiADEH4LAkACQAJAAkACQAJAIAEgASgCPCIEKAIIIgZGIAIgAigCPCIFKAIIIgdGc0UEQAJAIAEoAlQtABhBA3EEQCAEKAIMIQUgBCAGNgIMIAQgBTYCCAwBCyACKAJULQAYQQNxRQ0CIAUoAgwhBCAFIAc2AgwgBSAENgIIIAUhBAsgBCAEKAIQKAIQNgIQCyABIAMQYyEDIAEoAjwiBCACKAI8IgVGBEAgBCADNgIQIAAtABlBAUcNBCABKAJAIgJFDQIDQAJAIAIoAlgtAAhFBEAgAigCPCIADQELIAIoAkAiAg0BDAQLC0EAIQMCQCAAKAIEIgJFDQADQCACKAIQBEAgAiEDDAILIAIoAgQiAg0ACwsgACADNgIEIAAgBEcEQCAAIQIDQCACKAIEIgJBACACIARHGw0ACyACRQ0ECyAAIAQoAgQ2AgQMAwsgASgCWC0ACEEBRgRAIAEoAjBBAEgNBiACIAEQmgEPCyAEKAIAIAUoAgBJDQUgAiABEJoBDAQLIABBADoAfQ8LQQAhAAsgBCAANgIECyABKAI8IgAEQCAAKAIIQQA2AjwgACgCDEEANgI8IABCADcDCAsgBCgCBCIBRQ0AIAEoAggNAAJAA0AgASgCEA0BIAEoAgQiAQ0AC0EAIQELIAQgATYCBA8LDwsgASACEJoBC4cDAQl+An8gAikDCCABKQMIIgh9IgRCP4ciBacgBEIAVWogASkDACIHIAApAwB9IgNCP4ciBqcgA0IAVWpsIgEgAikDACAHfSIHQj+HIgmnIAdCAFVqIAggACkDCH0iCEI/hyIKpyAIQgBVamwiAEYEQEEBQX8CfyAEIAWFIAV9IgRC/////w+DIgUgAyAGhSAGfSIDQv////8PgyIGfiILQiCIIAUgA0IgiCIDfnwiBUIgiCAEQiCIIgQgA358IAQgBn4gBUL/////D4N8IgRCIIh8IgUgByAJhSAJfSIDQv////8PgyIGIAggCoUgCn0iB0L/////D4MiCX4iCEIgiCAGIAdCIIgiB358IgZCIIggA0IgiCIDIAd+fCADIAl+IAZC/////w+DfCIDQiCIfCIGUQRAQQAgC0L/////D4MgBEIghoQiBCAIQv////8PgyADQiCGhCIFUQ0DGiAEIAVWDAELIAUgBlYLGyIAQQAgAGsgAUEAShsPC0EBQX8gACABSBsLC+wFAgZ/AX4jAEFAaiIDJAAgAyACOgArAkACQAJAAkACQAJAIAEoAgQgASgCACIEa0EYbSICDgICAAELIAAgBBAuGgwECyADQQA2AiQgA0IANwIcIwBBIGsiBiQAAkACQCADQRxqIgQoAgggBCgCACIFa0EDdSACSQRAIAJBgICAgAJPDQEgBkEMaiACIAQoAgQgBWtBA3UgBBBLIgIoAgQgBCgCBCAEKAIAIghrIgVrIQcgBQRAIAcgCCAF/AoAAAsgBCgCACEFIAQgBzYCACACIAU2AgQgBCACKAIINgIEIAIgBTYCCCAEKAIIIQcgBCACKAIMNgIIIAIgBTYCACACIAc2AgwgAhBuCyAGQSBqJAAMAQsQJgALIAEoAgAiAiABKAIEIgdGDQIDQCADQRRqIAIQigECQCADKAIgIgEgAygCJCIESQRAIAEgAygCFDYCACABIAMoAhg2AgQgAUEIaiEBDAELIAEgAygCHCIFa0EDdSIGQQFqIgFBgICAgAJPDQMgA0EsakH/////ASAEIAVrIgRBAnUiBSABIAEgBUkbIARB+P///wdPGyAGIANBHGoQSyEEIAMoAjQiASADKAIUNgIAIAEgAygCGDYCBCADIAFBCGo2AjQgAygCMCADKAIgIAMoAhwiBmsiAWshBSABBEAgBSAGIAH8CgAACyADIAMoAhwiBjYCMCADIAU2AhwgAygCNCEBIAMgBjYCNCADIAE2AiAgAygCJCEFIAMgAygCODYCJCADIAU2AjggBCAGNgIAIAQQbgsgAyABNgIgIAJBGGoiAiAHRw0ACwwCCyAAEOsBGgwCCxAmAAsgA0EsaiADQRxqIANBK2oQgAMgAyADKQIsIgk3AgwgA0IANwIsIAMgCTcDACAAIAMQQwJAIAMoAjAiAEUNACAAIAAoAgQiAUEBazYCBCABDQAgACAAKAIAKAIIEQAAIAAQJAsgAyADQRxqNgIsIANBLGoQZQsgA0FAayQACwsAIAAEQCAAECILCzAAIAEoAgAaIAAgASgCCDYCACAAIAEoAgwiADYCBCAABEAgACAAKAIEQQFqNgIECwtVACAAIAEoAgA2AgAgACABKAIENgIEIAFCADcCACAAIAEoAgg2AgggACABKAIMNgIMIAFCADcCCCAAIAEoAhA2AhAgACABKAIUNgIUIAFCADcCECAAC0UBAn8gACgCBCICIAAoAggiAUcEQCAAIAEgASACa0EYayICQRhwIAJrakEYazYCCAsgACgCACIBBEAgACgCDBogARAiCwuNAQECfCAAIAAQogFEEeotgZmXcT2iIgJEAAAAAAAA8L8gAkQAAAAAAADwv2QbIgJEAAAAAAAA8L8gAr1C////////////AINCgICAgICAgPj/AFQbIgI5AzAgAQRAIAAQogFEAAAAAAAAgD6iIgMgAiACIANjGyECCyAAIAIgACsDOCIDIAIgA2QbOQM4C4sDAQZ/IwBBIGsiAiQAQZiVAiIDIAMoAgAiA0EBajYCACACIAM2AgwgACADNgLIASAAKALcASEBIABB2AFqIgQgACgCXEEDbiIFEDkgACAFNgLcASABQRFJIAEgBUEBdE1yRQRAIAQQgwELIAAoAlwiAUEDbiEFIAFBA08EQCAEKAIAIQZBACEBA0AgBiABQQR0aiIEQX82AgggBCADNgIEIAQgAzYCACABQQFqIgEgBUcNAAsLIAAQ7gIhASAAQcwBaiIEIAAoAtABEG8gACAAQdABajYCzAEgAEIANwPQASACIAJBDGoiADYCFCACQRhqIAQgACACQRRqEHkgAigCGCIAQgA3AyggAEKAgICAgICA+D83AyAgACADNgIYIABCADcDMCAAQgA3AzggAEIANwNIIABCgICAgICAgPg/NwNAIABCADcDUCAAQgA3A1ggAEIANwNoIABCgICAgICAgPg/NwNgIABCADcDcCAAQgA3A3ggAEEAOgCAASAAIAE6AIEBIAJBIGokAAuLAQEBfwJAIAFFDQAgASgCBCIDBEAgAygCBEF/Rw0BCyAAKAIEIgAEQCAAIAAoAgRBAWo2AgQgACAAKAIIQQFqNgIIIAEoAgQhAwsgASAANgIEIAEgAjYCACADBEAgAxAkCyAARQ0AIAAgACgCBCIBQQFrNgIEIAENACAAIAAoAgAoAggRAAAgABAkCwvHAwIBfwx8IwBB0ABrIgIkACABKwNAIQMgASsDECEEIAErAyghBSABKwMwIQYgASsDOCEHIAIgASsDICIIIAErAwAiCaIgASsDCCIKIAErAxgiC6KhOQNIIAIgCiAGoiAHIAmioTkDQCACIAcgC6IgCCAGoqE5AzggAiAEIAuiIAUgCaKhOQMwIAIgAyAJoiAEIAaioTkDKCACIAUgBqIgAyALoqE5AyAgAiAFIAqiIAggBKKhOQMYIAIgByAEoiADIAqioTkDECACIAggA6IgByAFoqE5AwggAisDCCEEIAIrAxAhBSACKwMYIQYgAisDICEHIAIrAyghCCACKwMwIQkgAisDOCEKIAIrA0AhCyAAIAIrA0ggASsDECABKwM4IgMgASsDGCINoiABKwMgIgwgASsDMCIOoqGiIAErAwAgDCABKwNAIgyiIAMgASsDKCIDoqGiIAErAwggAyAOoiAMIA2ioaKgoCIDozkDQCAAIAsgA6M5AzggACAKIAOjOQMwIAAgCSADozkDKCAAIAggA6M5AyAgACAHIAOjOQMYIAAgBiADozkDECAAIAUgA6M5AwggACAEIAOjOQMAIAJB0ABqJAALkgMBBn8gAyEEAkAgASACRg0AIAIgBEYEQCABIQQMAQsgAiABQQRqIgRGBEAgASgCACEFIAMgAmsiAgRAIAEgBCAC/AoAAAsgASACaiIEIAU2AgAMAQsgAyACQQRqRgRAIAMgA0EEayICIAFrIgVrIQQgAigCACEGIAVFIAEgAkZyRQRAIAQgASAF/AoAAAsgASAGNgIADAELAn8gAiABIgRrIgdBAnUiBiADIAJrIghBAnUiAUcEQCAGIQIDQCACIAEiAm8iAQ0ACyAEIAJBAnRqIQUDQCAFQQRrIgUgB2ohAiAFKAIAIQkgBSEBA0AgASACIgEoAgA2AgAgAiAHaiAEIAYgAyACa0ECdSICa0ECdGogAiAGShsiAiAFRw0ACyABIAk2AgAgBCAFRw0ACyAEIAhqDAELAkAgAiAERiACIANGcg0AIAIhAQNAIAQoAgAhBSAEIAEoAgA2AgAgASAFNgIAIARBBGoiBCACRg0BIAFBBGoiASADRw0ACwsgAgshBAsgACADNgIEIAAgBDYCAAuhAgEFfyMAQSBrIgUkAAJAAkAgACgCBCICIAAoAggiA0kEQCACIAEpAwA3AwAgAkEIaiEBDAELIAIgACgCACIEa0EDdSIGQQFqIgJBgICAgAJPDQEgBUEMakH/////ASADIARrIgNBAnUiBCACIAIgBEkbIANB+P///wdPGyAGIAAQSyICKAIIIgMgASkDADcDACACIANBCGo2AgggAigCBCAAKAIEIAAoAgAiA2siAWshBCABBEAgBCADIAH8CgAACyAAKAIAIQMgACAENgIAIAIgAzYCBCAAIAIoAggiATYCBCACIAM2AgggACgCCCEEIAAgAigCDDYCCCACIAM2AgAgAiAENgIMIAIQmQELIAAgATYCBCAFQSBqJAAPCxAmAAtSAQR/IAAoAgAhAQJAIAAoAgQiA0UEQAwBCyADQQV0IgQQJyECIARFDQAgAiABIAT8CgAACyAAIAEEfyABECIgACgCBAUgAws2AgggACACNgIAC1IBBH8gACgCACEBAkAgACgCBCIDRQRADAELIANBA3QiBBAnIQIgBEUNACACIAEgBPwKAAALIAAgAQR/IAEQIiAAKAIEBSADCzYCCCAAIAI2AgALOwECfyAAKAIIIgIEQANAIAIoAgAgAhAiIgINAAsLIAAoAgAhASAAQQA2AgAgAQRAIAAoAgQaIAEQIgsLRAEBfyAAQQA2AgggAEIANwIAIAEEQCAAIAEQkAMgACgCBCECIAFBA3QiAQRAIAJBACAB/AsACyAAIAEgAmo2AgQLIAALkQYCBXwCfyMAQRBrIgYkAAJ8IAC9QiCIp0H/////B3EiB0H7w6T/A00EQEQAAAAAAADwPyAHQZ7BmvIDSQ0BGkQAAAAAAADwPyAAIACiIgFEAAAAAAAA4D+iIgKhIgNEAAAAAAAA8D8gA6EgAqEgASABIAEgAUSQFcsZoAH6PqJEd1HBFmzBVr+gokRMVVVVVVWlP6CiIAEgAaIiAiACoiABIAFE1DiIvun6qL2iRMSxtL2e7iE+oKJErVKcgE9+kr6goqCiIABEAAAAAAAAAICioKCgDAELIAAgAKEgB0GAgMD/B08NABogACAGEIoFIQcgBisDACIBIAGiIgAgAKIhAiAGKwMIIQMCQAJAAkACQCAHQQNxQQFrDgMBAgMAC0QAAAAAAADwPyAARAAAAAAAAOA/oiIEoSIFRAAAAAAAAPA/IAWhIAShIAAgACAAIABEkBXLGaAB+j6iRHdRwRZswVa/oKJETFVVVVVVpT+goiACIAKiIAAgAETUOIi+6fqovaJExLG0vZ7uIT6gokStUpyAT36SvqCioKIgASADoqGgoAwDCyABIAEgAKIiAURJVVVVVVXFP6IgACADRAAAAAAAAOA/oiABIAAgAqIgAER81c9aOtnlPaJE65wriublWr6goiAAIABEff6xV+Mdxz6iRNVhwRmgASq/oKJEpvgQERERgT+goKKhoiADoaChmgwCC0QAAAAAAADwPyAARAAAAAAAAOA/oiIEoSIFRAAAAAAAAPA/IAWhIAShIAAgACAAIABEkBXLGaAB+j6iRHdRwRZswVa/oKJETFVVVVVVpT+goiACIAKiIAAgAETUOIi+6fqovaJExLG0vZ7uIT6gokStUpyAT36SvqCioKIgASADoqGgoJoMAQsgASABIACiIgFESVVVVVVVxT+iIAAgA0QAAAAAAADgP6IgASAAIAKiIABEfNXPWjrZ5T2iROucK4rm5Vq+oKIgACAARH3+sVfjHcc+okTVYcEZoAEqv6CiRKb4EBEREYE/oKCioaIgA6GgoQsgBkEQaiQAC5oCAQV/IAACfyAAKAIEIgIgACgCCEkEQCACIAEQiwFBGGoMAQsjAEEgayIFJAAgACgCBCAAKAIAIgNrQRhtIgRBAWoiAkGr1arVAE8EQBAmAAsgBUEMakGq1arVACAAKAIIIANrQRhtIgNBAXQiBiACIAIgBkkbIANB1arVKk8bIAQgABBkIgIoAgggARCLARogAiACKAIIQRhqNgIIIAAoAgAiASAAKAIEIgMgAigCBCADIAFrQWhtQRhsaiIDEKUCIAAoAgAhASAAIAM2AgAgAiABNgIEIAAgAigCCCIDNgIEIAIgATYCCCAAKAIIIQQgACACKAIMNgIIIAIgATYCACACIAQ2AgwgAhCkAiAFQSBqJAAgAws2AgQLPQECfyAAKAIEIgIgACgCCCIBRwRAIAAgASACIAFrQQdqQXhxajYCCAsgACgCACIBBEAgACgCDBogARAiCwvoAgEGfyABKAI8IgcoAhAiAigCECEFIAAoAjwiAygCECIEKAIQIQYCQAJAIAMoAgggAEYEQCAFIAQ2AhQgBCAFNgIQIAIgBjYCECAGIAI2AhQgAyACNgIQIAMgBygCCCICNgIIIAINAQwCCyAGIAI2AhQgAiAGNgIQIAQgBTYCECAFIAQ2AhQgAyAHKAIMIgI2AgwgAkUNAQsgAiADNgI8C0EAIQUgASgCPCIEQQA2AhAgBEIANwMIIAAoAjwhAwJAIAAoAlQtABhBA3EEQCAEIAMoAhA2AhAgA0EANgIQDAELAkAgAygCBCICRQ0AA0AgAigCEARAIAIhBQwCCyACKAIEIgINAAsLIAMgBTYCBCADQQBHIQUCQCADRSADIARGcg0AIAMhAgNAIAIoAgQiAkEARyEFIAJFDQEgAiAERw0ACwsgBQRAIAMgBCgCBDYCBAsgBCADNgIECyAAQQA2AjwgAUEANgI8C0QCAX8BfCMAQRBrIgIkACACIAEgACsDkAEiAyADIABB+ABqEMICIAAgAkEAEMACIAIgAjYCDCACQQxqECkgAkEQaiQAC68DAQd8IAAgASsDECIEIAErAwAiAyADoiABKwMIIgUgBaKgIAQgBKKgnyIGo0QAAAAAAAAAACADIAajIgi9Qv///////////wCDQoCAgICAgID4/wBUIgEbIgkgAisDECIEIAIrAwAiAyADoiACKwMIIgcgB6KgIAQgBKKgnyIEo0QAAAAAAAAAACADIASjIgO9Qv///////////wCDQoCAgICAgID4/wBUIgIboiAFIAajRAAAAAAAAAAAIAEbIgUgByAEo0QAAAAAAAAAACACG6IgCEQAAAAAAAAAACABGyIGIANEAAAAAAAAAAAgAhuiRAAAAAAAAAAAoKCgIgNEAAAAAAAA4D8gA0QAAAAAAADgP2QbRFVVVVVVVeU/okRWVVVVVVXVP6AiAzkDGCAAIAQgCUQAAAAAAADgP6KiRFVVVVVVVeU/okQAAAAAAAAAAKAgA6M5AxAgACAEIAVEAAAAAAAA4D+iokRVVVVVVVXlP6JEAAAAAAAAAACgIAOjOQMIIAAgBCAGRAAAAAAAAOA/oqJEVVVVVVVV5T+iRAAAAAAAAAAAoCADozkDAAuJBQIGfw58QQECQCABIAEoAjwiBEYNACAAKAI4IgYoAjwiBSAERg0AIAIgAqIhFEE4QTwgAxshByAAKAI8IAYgAxshCSABIgAhAwNAIAUgCUYNAQJAIBQgBSsDGCIPIAArAxgiDaEiDiAOoiAFKwMgIhEgACsDICIOoSIKIAqioCIWZgRAIAUgB2ooAgAhBQwBCyAUIAQrAxgiCiANoSIMIAyiIAQrAyAiDCAOoSILIAuioCIXZgRAIAQoAjwhBAwBCyAUIAogD6EiCyALoiAMIBGhIhAgEKKgIhJmBEAgBCAFIAdqKAIAIgZGDQMgBCgCPCEEIAAhAyAFIQAgBiEFDAELQQBBAUF/IA0gD6EiEyAQoiAOIBGhIhAgC6KhIgtEAAAAAAAAAABkGyALIAuiRAAAAAAAABBAoiACIAIgEiATIBOiIBAgEKKgIgsgCyASYxuiomUbIQYgACADRwRAQQBBAUF/IA0gCqEiCyADKwMgIhAgDKEiEqIgDiAMoSIMIAMrAxgiEyAKoSIKoqEiFUQAAAAAAAAAAGQbIBUgFaJEAAAAAAAAEECiIAIgAiAKIAqiIBIgEqKgIgogCyALoiAMIAyioCIMIAogDGQboqJlGyAGakEAQQFBfyANIBOhIg0gESAQoSIRoiAPIBOhIg8gDiAQoSIOoqEiCkQAAAAAAAAAAGQbIAogCqJEAAAAAAAAEECiIAIgAiAPIA+iIBEgEaKgIg8gDSANoiAOIA6ioCINIA0gD2MboqJlG2ohBgsgBgRAIAZBAEoPCyAWIBdjBEAgBSEDIAUhACAFIAdqKAIAIQUMAQsgBCEDIAQhACAEKAI8IQQLIAEgBEYNASAEIAVHDQALCwv6FQESfyMAQdAAayIDJAAgASgCBCEGIANBADYCPCADQgA3AjQgA0E0aiAGQQNsIgwQNSADIAw2AjggACgCTCEJIANBADYCLCADQgA3AiQgA0EkaiAMECUgAyAMNgIoAkACQAJAAkAgCUH//w9MBEAgA0EANgIcIANCADcCFCADQRRqIAwQRCADIAw2AhggASgCACEJIAMoAjQhBwJAIAIoAgRFBEAgBkUNASADKAIUIQsDQCADQQI2AgwgA0KAgICAEDcCBCAFQQNsIQ0gCSAFQQxsaiEKQQAhBANAIApBBEEIQQRBCCADQQRqIARqKAIAIgJBAUYbQQAgAhsiDkHQ/gBqKAIAIgFBAUYbQQAgARtqKAIAIQEgByACIA1qIg9BDGxqIgggCiAOaigCACICNgIIIAggATYCBCAIIAI2AgAgCyAPQQN0aiACIAEgASACSCIIG6xCgICAgICAgICAf0IAIAEgAkobhCABIAIgCButQiCGhDcDACAEQQRqIgRBDEcNAAsgBUEBaiIFIAZHDQALDAELIAZFDQAgAigCACENIAMoAhQhDkEAIQIDQCADQQI2AgwgA0KAgICAEDcCBCACQQNsIQ8gDSACQQxsIgFqIQogASAJaiEQQQAhBQNAIApBBEEIQQRBCCADQQRqIAVqKAIAIghBAUYbQQAgCBsiC0HQ/gBqKAIAIgFBAUYbQQAgARtqKAIAIQEgCiALaigCACEEIAcgCCAPaiIRQQxsaiIIIAsgEGooAgA2AgggCCABNgIEIAggBDYCACAOIBFBA3RqIAQgASABIARIIggbrEKAgICAgICAgIB/QgAgASAEShuEIAEgBCAIG61CIIaENwMAIAVBBGoiBUEMRw0ACyACQQFqIgIgBkcNAAsLIAMoAiQiBCADKAIoIgJBAnRqIQYgAkUNAUEAIQEDQCAEIAFBAnRqIAE2AgAgAUEBaiIBIAJHDQALIAMgA0EUajYCBCACQYEBSA0CIAIhAQNAIAFBAnQQUCIFRQRAIAFBAXYiAQ0BDAQLCyAEIAYgA0EEaiACIAUgARDGASAFECIMAwsgA0EANgIcIANCADcCFCADQRRqIAwQNSADIAw2AhggA0EANgIMIANCADcCBCADQQRqIAlBAXRBABAxIAEoAgAhByADKAI0IQoCQCACKAIERQRAIAZFDQFBACEBA0AgA0ECNgJMIANCgICAgBA3AkQgCiABQSRsaiENIAcgAUEMbGohCEEAIQQDQCAIQQRBCEEEQQggA0HEAGogBGooAgAiBUEBRhtBACAFGyIOQdD+AGooAgAiAkEBRhtBACACG2ooAgAhAiANIAVBDGxqIgsgCCAOaigCACIFNgIIIAsgAjYCBCALIAU2AgAgAygCBCAFIAIgAiAFShtBAnRqIAlBACACIAVOG0ECdGoiAiACKAIAQQFqNgIAIARBBGoiBEEMRw0ACyABQQFqIgEgBkcNAAsMAQsgBkUNACACKAIAIQ5BACEBA0AgA0ECNgJMIANCgICAgBA3AkQgCiABQSRsaiEPIA4gAUEMbCICaiEIIAIgB2ohEEEAIQUDQCAIQQRBCEEEQQggA0HEAGogBWooAgAiC0EBRhtBACALGyINQdD+AGooAgAiAkEBRhtBACACG2ooAgAhAiAIIA1qKAIAIQQgDyALQQxsaiILIA0gEGooAgA2AgggCyACNgIEIAsgBDYCACADKAIEIAQgAiACIARKG0ECdGogCUEAIAIgBE4bQQJ0aiICIAIoAgBBAWo2AgAgBUEEaiIFQQxHDQALIAFBAWoiASAGRw0ACwsCQCADKAIIIgVFDQAgAygCBCIBKAIAIQIgAUEANgIAIAVBAUYNACABIAVBAnRqIQcgAUEEaiEEA0AgBCgCACEKIAEgAjYCBCABQQRqIQEgAiAKaiECIARBBGoiBCAHRw0ACwsgBgRAQQAhAgNAIANBAjYCTCADQoCAgIAQNwJEIAJBA2whCkEAIQQDQCADKAIEIAMoAjQgA0HEAGogBGooAgAgCmoiCEEMbGoiBSgCACIBIAUoAgQiBSABIAVIG0ECdGpBACAJIAEgBUoiCxtBAnRqIgcgBygCACIHQQFqNgIAIAMoAhQgB0EMbGoiByAINgIIIAcgAjYCBCAHIAEgBSALGzYCACAEQQRqIgRBDEcNAAsgAkEBaiICIAZHDQALIAMoAgghBQsgBQRAQQAhBANAIAMoAgQhBiADKAIkIQkgBAR/IAYgBEECdGpBBGsoAgAFQQALIgIiASAGIARBAnRqKAIAIgZIBEADQCAJIAFBAnRqIAE2AgAgAUEBaiIBIAZHDQALCyADIANBFGo2AkQgAiAGRwRAIAkgAkECdCIBaiAJIAZBAnQiB2ogA0HEAGogByABa0ECdWdBAXRBPnNBARC/BAsgAiAGSARAIAMoAhQhASADKAIkIQkDQCAJIAJBAnRqIgcgASAHKAIAQQxsaigCCDYCACACQQFqIgIgBkcNAAsLIARBAWoiBCAFRw0ACwsgAygCBCIBBEAgARAiCyADKAIUIgFFDQMgARAiDAMLIAMgA0EUajYCBAsgBCAGIANBBGogAkEAQQAQxgELIAMoAhQiAUUNACABECILQQAhBiADQQA2AhwgA0IANwIUIANBFGogDEEAEIEBIAxBAm0hCSAMQQJOBEAgCUEBdCERQQAhAgNAIAMoAjQiBCADKAIkIgggAkECdCISaigCACIFQQxsaiIHQWhBDCAFQQNvQQJGG2ohDiAGIAlqIQEgBygCBCELIAcoAgAhDSADKAIUIQoDQAJAIA0gBCAIIAFBAnRqKAIAIgdBDGwiD2oiECgCBEcNACALIBAoAgBHDQACQCAHIApqLQAADQAgDigCBCAEQWhBDCAHQQNvQQJGG2ogD2ooAgRHDQAgBSAKakEBOgAAIAMoAhQgB2pBAToAACACIAlqIgogAUYNAUEBQX8gASAKSiITGyIOIAFqIQUgASEEA0AgAygCFCEPIAMoAiQhCAJAA0AgBCAOayIEIApOIAQgCkwgExtBAUcNASAPIAggBEECdGooAgAiFGotAAANAAsDQAJAIAggBSAOayIFQQJ0aiEQIAEgBUYNACAPIBAoAgBqLQAADQELCyAQIBQ2AgAMAQsLIAggEmogCUECdGogBzYCAAwBCyABQQFqIgEgEUgNAQsLAkAgAkEBaiICIAlGIgENACANIAMoAjQgAygCJCACQQJ0aigCAEEMbGoiBCgCAEYEQCAEKAIEIAtGDQELIAIhBgsgAUUNAAsLIABB2ABqIgEQ7wIgASAMEMkBIAxBAWpBA08EQCAAKAJoIQYgACgCeCEFIAAoAlghAEEAIQQgAygCNCEHIAMoAhQhCiADKAIkIQgDQCAFIAggBEECdGoiASAJQQJ0aigCACICQQJ0IgtqAn8gCiABKAIAIgFqLQAARQRAIAAgAUECdCIMaiAHIAFBDGxqIg0oAgA2AgAgBSAMaiANKAIINgIAIAYgDGogAjYCACAAIAJBAnRqIAcgAkEMbGoiAigCADYCACACKAIIDAELIAFBAnQhDEF/IQEgACAMakF/NgIAIAUgDGpBADYCACAGIAxqQX82AgAgACACQQJ0akF/NgIAQQALNgIAIAYgC2ogATYCACAEQQFqIgQgCUcNAAsLIAMoAhQiAARAIAAQIgsgAygCJCIABEAgABAiCyADKAI0IgAEQCAAECILIANB0ABqJAALVwEDfyAAKAIIIAFJBEAgAUEwbBAnIQQgACgCACECAkAgACgCBCIDRQ0AIANBMGwiA0UNACAEIAIgA/wKAAALIAIEQCACECILIAAgATYCCCAAIAQ2AgALCy4AIAApAwggASkDCFQgACgCACgCDCgCTCIAIAEoAgAoAgwoAkwiAUkgACABRhsLsAEBDHwgASsDSCEHIAErAzAhCCABKwMAIQkgASsDGCEKIAErA1AhCyABKwM4IQwgASsDCCENIAErAyAhDiAAIAIrAwAiAyABKwMQoiACKwMIIgQgASsDKKKgIAIrAxAiBSABKwNAoqAgAisDGCIGIAErA1iioDkDECAAIAMgDaIgBCAOoqAgBSAMoqAgBiALoqA5AwggACADIAmiIAQgCqKgIAUgCKKgIAYgB6KgOQMAC1oBA3wgACsDKJkiAiAAKwMQmSIBIAEgAmMbIgIgACsDIJkiASAAKwMImSIDIAEgA2QbIgEgASACYxsiAiAAKwMYmSIBIAArAwCZIgMgASADZBsiASABIAJjGwu9BwEDfyAAIAFByAD8CgAAIABBADYCUCAAQgA3A0ggACABKAJINgJIIAAgASgCTDYCTCAAIAEoAlA2AlAgAUEANgJQIAFCADcDSCAAQQA2AmAgAEIANwNYIAAgASgCZDYCZCABQQA2AmQgACABKAJYNgJYIAAgASgCXDYCXCAAIAEoAmA2AmAgAUEANgJgIAFCADcDWCAAQQA2AnAgAEIANwNoIAAgASgCdDYCdCABQQA2AnQgACABKAJoNgJoIAAgASgCbDYCbCAAIAEoAnA2AnAgAUEANgJwIAFCADcDaCAAQQA2AoABIABCADcDeCAAIAEoAoQBNgKEASABQQA2AoQBIAAgASgCeDYCeCAAIAEoAnw2AnwgACABKAKAATYCgAEgAUEANgKAASABQgA3A3ggAEEANgKQASAAQgA3A4gBIAAgASgCiAE2AogBIAAgASgCjAE2AowBIAAgASgCkAE2ApABIAFBADYCkAEgAUIANwOIASAAQQA2AqABIABCADcDmAEgACABKAKYATYCmAEgACABKAKcATYCnAEgACABKAKgATYCoAEgAUEANgKgASABQgA3A5gBIABBADYCsAEgAEIANwOoASAAIAEoAqgBNgKoASAAIAEoAqwBNgKsASAAIAEoArABNgKwASABQQA2ArABIAFCADcDqAEgAEEANgLAASAAQgA3A7gBIAAgASgCuAE2ArgBIAAgASgCvAE2ArwBIAAgASgCwAE2AsABIAFBADYCwAEgAUIANwO4ASAAIAEoAsgBNgLIASAAIAEoAswBNgLMASAAIAEoAtABIgM2AtABIAAgASgC1AEiBDYC1AEgAEHQAWohAgJAIARFBEAgACACNgLMAQwBCyADIAI2AgggAUIANwPQASABIAFB0AFqNgLMAQsgAEEANgLgASAAQgA3A9gBIAAgASgC2AE2AtgBIAAgASgC3AE2AtwBIAAgASgC4AE2AuABIAFBADYC4AEgAUIANwPYASAAQQA2AvABIABCADcD6AEgACABKALoATYC6AEgACABKALsATYC7AEgACABKALwATYC8AEgAUEANgLwASABQgA3A+gBIABBADYCgAIgAEIANwP4ASAAIAEoAvgBNgL4ASAAIAEoAvwBNgL8ASAAIAEoAoACNgKAAiABQQA2AoACIAFCADcD+AEgAEEANgKQAiAAQgA3A4gCIAAgASgCiAI2AogCIAAgASgCjAI2AowCIAAgASgCkAI2ApACIAFBADYCkAIgAUIANwOIAiAAC44BAgJ/AXwjAEEQayICJABB6J4CLQAAQQFxRQRAQQJByIsCQQMQBiEDQeieAkEBOgAAQeSeAiADNgIACyACIAEpAgA3AwggAkEANgIEQeSeAigCAEEAQQAgAkEEaiACQQhqEAUhBCACKAIEIQEgACAE/AM2AgQgAEGcoAI2AgAgAQRAIAEQBAsgAkEQaiQAC5oBAQV/IABCADcCBCAAKAIAIQMgAEEANgIAIAAgASgCBCIEEDMgACAENgIEAkACQCABKAIEIgQEQCAAKAIAIQUgASgCACEGA0AgBSACQRhsaiIAIAMgBiACQQJ0aigCAEEYbGoiASkDEDcDECAAIAEpAwg3AwggACABKQMANwMAIAJBAWoiAiAERw0ACwwBCyADRQ0BCyADECILC4EBAQR/IABCADcCBCAAKAIAIQIgAEEANgIAIAAgASgCBCIEECUgACAENgIEAkACQCABKAIEIgQEQCAAKAIAIQAgASgCACEBA0AgACADQQJ0IgVqIAIgASAFaigCAEECdGooAgA2AgAgA0EBaiIDIARHDQALDAELIAJFDQELIAIQIgsL0gQBBH8gASAAIAFGIgM6AAwCQCADDQADQCABKAIIIgMtAAwNAQJAAkAgAygCCCICKAIAIgQgA0YEQAJAIAIoAgQiBUUNACAFLQAMDQAgA0EBOgAMIAIgACACRjoADCAFQQE6AAwMAgsCQCADKAIAIAFGBEAgAyEBDAELIAMgAygCBCIBKAIAIgA2AgQCQAJAAkAgAEUEQCABIAI2AggMAQsgACADNgIIIAMoAggiAigCACABIAI2AgggA0cNAQsgAiABNgIADAELIAIgATYCBAsgASADNgIAIAMgATYCCCABKAIIIgIoAgAhBAsgAUEBOgAMIAJBADoADCACIAQoAgQiADYCACAABEAgACACNgIICyAEIAIoAggiADYCCAJAIAAoAgAgAkYEQCAAIAQ2AgAMAQsgACAENgIECyAEIAI2AgQgAiAENgIIDwsgBEUNASAELQAMDQEgA0EBOgAMIAIgACACRjoADCAEQQE6AAwLIAIhASAAIAJHDQEMAgsLAkAgAygCACIEIAFHBEAgAyEEDAELIAMgBCgCBCIANgIAIAAEQCAAIAM2AgggAygCCCECCyAEIAI2AggCQCACKAIAIANGBEAgAiAENgIADAELIAIgBDYCBAsgBCADNgIEIAMgBDYCCCAEKAIIIQILIARBAToADCACQQA6AAwgAiACKAIEIgEoAgAiADYCBCAABEAgACACNgIICyABIAIoAggiADYCCAJAIAAoAgAgAkYEQCAAIAE2AgAMAQsgACABNgIECyABIAI2AgAgAiABNgIICwvgBQIFfAJ/IwBBEGsiBiQAAkAgAL1CIIinQf////8HcSIHQfvDpP8DTQRAIAdBgIDA8gNJDQEgACAAIAAgAKIiAKIgACAAIAAgAKKiIABEfNXPWjrZ5T2iROucK4rm5Vq+oKIgACAARH3+sVfjHcc+okTVYcEZoAEqv6CiRKb4EBEREYE/oKCiRElVVVVVVcW/oKKgIQAMAQsgB0GAgMD/B08EQCAAIAChIQAMAQsgACAGEIoFIQcgBisDACIBIAGiIgAgAKIhAiAGKwMIIQMCQAJAAkACQCAHQQNxQQFrDgMBAgMACyABIAEgAKIiAURJVVVVVVXFP6IgACADRAAAAAAAAOA/oiABIAAgAqIgAER81c9aOtnlPaJE65wriublWr6goiAAIABEff6xV+Mdxz6iRNVhwRmgASq/oKJEpvgQERERgT+goKKhoiADoaChIQAMAwtEAAAAAAAA8D8gAEQAAAAAAADgP6IiBKEiBUQAAAAAAADwPyAFoSAEoSAAIAAgACAARJAVyxmgAfo+okR3UcEWbMFWv6CiRExVVVVVVaU/oKIgAiACoiAAIABE1DiIvun6qL2iRMSxtL2e7iE+oKJErVKcgE9+kr6goqCiIAEgA6KhoKAhAAwCCyABIAEgAKIiAURJVVVVVVXFP6IgACADRAAAAAAAAOA/oiABIAAgAqIgAER81c9aOtnlPaJE65wriublWr6goiAAIABEff6xV+Mdxz6iRNVhwRmgASq/oKJEpvgQERERgT+goKKhoiADoaChmiEADAELRAAAAAAAAPA/IABEAAAAAAAA4D+iIgShIgVEAAAAAAAA8D8gBaEgBKEgACAAIAAgAESQFcsZoAH6PqJEd1HBFmzBVr+gokRMVVVVVVWlP6CiIAIgAqIgACAARNQ4iL7p+qi9okTEsbS9nu4hPqCiRK1SnIBPfpK+oKKgoiABIAOioaCgmiEACyAGQRBqJAAgAAtfACAAIAM2AhBBACEDIABBADYCDAJAIAEEQCABQYCAgCBPDQEgAUEGdBAjIQMLIAAgAzYCACAAIAMgAkEGdGoiAjYCCCAAIAMgAUEGdGo2AgwgACACNgIEIAAPCxByAAuSAgEBfyAAKAJwIgEEQCAAIAE2AnQgACgCeBogARAiCyAAKAJkIgEEQCAAIAE2AmggACgCbBogARAiCyAAKAJYIgEEQCAAIAE2AlwgACgCYBogARAiCyAAKAJMIgEEQCAAIAE2AlAgACgCVBogARAiCyAAKAJAIgEEQCAAIAE2AkQgACgCSBogARAiCyAAKAI0IgEEQCAAIAE2AjggACgCPBogARAiCyAAKAIoIgEEQCAAIAE2AiwgACgCMBogARAiCyAAKAIcIgEEQCAAIAE2AiAgACgCJBogARAiCyAAKAIQIgEEQCAAIAE2AhQgACgCGBogARAiCyAAKAIEIgEEQCAAIAE2AgggACgCDBogARAiCwsoAQF/IAAEQCAAKAIAIgEEQCAAIAE2AgQgACgCCBogARAiCyAAECILC1cCAX8BfgJAQcCcAigCACIBrSAArUIHfEL4////H4N8IgJC/////w9YBEAgAqciAD8AQRB0TQ0BIAAQHQ0BC0GgoQJBMDYCAEF/DwtBwJwCIAA2AgAgAQsJACAAvUI0iKcL0AICBX8BfCMAQSBrIgUkAAJAAkAgACgCBCICIAAoAggiA0kEQCABKwMAIQcgAiABKwMIEDT8BjcDCCACIAcQNPwGNwMAIAJBEGohAQwBCyACIAAoAgAiBGtBBHUiBkEBaiICQYCAgIABTw0BIAVBDGpB/////wAgAyAEayIDQQN1IgQgAiACIARJGyADQfD///8HTxsgBiAAEDIhAiABKwMAIQcgAigCCCIDIAErAwgQNPwGNwMIIAMgBxA0/AY3AwAgAiADQRBqNgIIIAIoAgQgACgCBCAAKAIAIgNrIgFrIQQgAQRAIAQgAyAB/AoAAAsgACgCACEDIAAgBDYCACACIAM2AgQgACACKAIIIgE2AgQgAiADNgIIIAAoAgghBCAAIAIoAgw2AgggAiADNgIAIAIgBDYCDCACEDYLIAAgATYCBCAFQSBqJAAPCxAmAAuUBgEFfyMAQRBrIggkAAJAAkACQCADDgMCAgABCyABQQxrIQICQAJAIAFBCGsoAgAiAUUNACAAKAIERQ0AIAAoAgApAwAgAigCACkDAFUNAQwDCyABRQ0CCyAIIAAoAgg2AgggCCAAKQIANwMAIAAgAi0ACDoACCAAIAIpAgA3AgAgAiAILQAIOgAIIAIgCCkDADcCAAwBCyADQYABTARAIAAiAiABIgRGDQEgAEEMaiIDIAFGDQEDQCAAIQEgAyEAAkACQAJAIAEoAhAiBkUNACABKAIERQ0AIAEoAgApAwAgACgCACIFKQMAVQ0BDAILIAZFDQEgACgCACEFCyABKAIUIQcgACABLQAIOgAIIAAgASkCADcCAAJ/IAIgASACRg0AGgNAIAFBDGshAwJAIAFBCGsoAgBFDQAgAygCACkDACAFKQMAVQ0AIAEMAgsgASADLQAIOgAIIAEgAykCADcCACADIgEgAkcNAAsgAgsiASAHOgAIIAEgBjYCBCABIAU2AgALIABBDGoiAyAERw0ACwwBCyADIANBAXYiB2shCSAAIAdBDGwiCmohBiADIAVMBEAgACAGIAIgByAEELMDIAYgASACIAkgBCAKaiIBELMDIAQgA0EMbGohAgJAIAEiAyAERwRAA0AgASACRgRAIAMgBEYNAwNAIAAgBC0ACDoACCAAIAQpAgA3AgAgAEEMaiEAIARBDGoiBCADRw0ACwwDCwJAAkACQAJAIAEoAgQiBUUNACAEKAIERQ0AIAQoAgApAwAgASgCACkDAFUNAQwCCyAFRQ0BCyAAIAEtAAg6AAggACABKQIANwIAIAFBDGohAQwBCyAAIAQtAAg6AAggACAEKQIANwIAIARBDGohBAsgAEEMaiEAIAMgBEcNAAsLIAEgAkYNAANAIAAgAS0ACDoACCAAIAEpAgA3AgAgAEEMaiEAIAFBDGoiASACRw0ACwsMAQsgACAGIAIgByAEIAUQrwEgBiABIAIgCSAEIAUQrwEgACAGIAEgAiAHIAkgBCAFELgCCyAIQRBqJAAL5wYCBX8CfiMAQRBrIgkkAAJAAkACQCADDgMCAgABCwJAIAAoAgAiAigCACIDKQMIIgsgAUEEayIBKAIAIgQoAgAiBSkDCCIMUgRAIAsgDFMNAQwDCyADKQMAIAUpAwBXDQILIAAgBDYCACABIAI2AgAMAQsgA0EATARAIAAiAyABIgZGDQEgAEEEaiIFIAFGDQEgACEBA0AgASEAIAUhAQJAAkAgACgCACIHKAIAIgIpAwgiCyAAKAIEIggoAgAiBCkDCCIMUgRAIAsgDFMNAQwCCyACKQMAIAQpAwBXDQELQQAhBSABQQA2AgAgASECA0AgAEEANgIAIAIgBzYCACAFBEAgBRAiCwJAIAAgA0YEQCADIQAMAQsCQCAAQQRrIgQoAgAiBygCACICKQMIIgsgCCgCACIFKQMIIgxSBEAgCyAMUw0BDAILIAIpAwAgBSkDAFcNAQsgACgCACEFIAAhAiAEIQAMAQsLIAAoAgAhAiAAIAg2AgAgAkUNACACECILIAFBBGoiBSAGRw0ACwwBCyAAIANBAXYiBkECdCIIaiEHIAMgBUwEQCAAIAcgAiAGIAQQtQMgByABIAIgAyAGayAEIAhqIgIQtQMgCSADNgIMIAQgA0ECdGohBQJAIAQiASACIgNHBEADQCACIAVGBEAgASADRg0DA0AgASgCACEFIAFBADYCACAAKAIAIQIgACAFNgIAIAIEQCACECILIABBBGohACABQQRqIgEgA0cNAAsMAwsCQAJAAkAgASgCACIHKAIAIgYpAwgiCyACKAIAIggoAgAiCikDCCIMUgRAIAsgDFMNAQwCCyAGKQMAIAopAwBXDQELIAJBADYCACAAKAIAIQYgACAINgIAIAYEQCAGECILIAJBBGohAgwBCyABQQA2AgAgACgCACEGIAAgBzYCACAGBEAgBhAiCyABQQRqIQELIABBBGohACABIANHDQALCyACIAVGDQADQCACKAIAIQMgAkEANgIAIAAoAgAhASAAIAM2AgAgAQRAIAEQIgsgAEEEaiEAIAJBBGoiAiAFRw0ACwsgCUEMaiAEELQDDAELIAAgByACIAYgBCAFELABIAcgASACIAMgBmsiAyAEIAUQsAEgACAHIAEgAiAGIAMgBCAFELkCCyAJQRBqJAALHQECfyAAKAIEIAAoAgAiAmtBDG0EQCAAIAIQewsLFwAgAEHomgI2AgAgAEEEaiABENEEIAALNQEBfyABIAAoAgQiAkEBdWohASAAKAIAIQAgASACQQFxBH8gASgCACAAaigCAAUgAAsRBAALSgAgACABKAIANgIAIAAgASgCBDYCBCABQgA3AwAgACABKAIINgIIIAAgASgCDDYCDCABQgA3AwggAEEQaiABQRBqQTD8CgAAIAALvAUCBX8CfCMAQSBrIgUkAAJAAkACQCACDgMCAgABCyABQRBrKwMAIAArAwhjRQ0BIAUgACkDEDcDGCAFIAApAwg3AxAgBSAAKQMANwMIIAAgAUEYayIBKAIQNgIQIAAgASkDCDcDCCAAIAEpAwA3AwAgASAFKAIYNgIQIAEgBSkDEDcDCCABIAUpAwg3AwAMAQsgAkGAAUwEQCAAIAFGDQEgAEEYaiIDIAFGDQEgACEEA0AgAyEGIAQrAyAiCiAEKwMIYwRAIAQoAighByADKwMAIQsgAyECA0ACQCACIAQiAygCEDYCECACIAMpAwg3AwggAiADKQMANwMAIAAgA0YEQCAAIQMMAQsgA0EYayEEIAMhAiAKIANBEGsrAwBjDQELCyADIAc2AhAgAyAKOQMIIAMgCzkDAAsgASAGIgRBGGoiA0cNAAsMAQsgAiACQQF2IgdrIQggACAHQRhsIglqIQYCQCACIARMBEAgACAGIAcgAxDPAyAGIAEgCCADIAlqIgEQzwMgAyACQRhsaiEEIAEhAgNAIAIgBEYEQCABIANGDQQDQCAAIAMoAhA2AhAgACADKQMINwMIIAAgAykDADcDACAAQRhqIQAgA0EYaiIDIAFHDQALDAQLAkAgAisDCCADKwMIYwRAIAAgAigCEDYCECAAIAIpAwg3AwggACACKQMANwMAIAJBGGohAgwBCyAAIAMoAhA2AhAgACADKQMINwMIIAAgAykDADcDACADQRhqIQMLIABBGGohACABIANHDQALDAELIAAgBiAHIAMgBBC1ASAGIAEgCCADIAQQtQEgACAGIAEgByAIIAMgBBDHAgwBCyACIARGDQADQCAAIAIoAhA2AhAgACACKQMINwMIIAAgAikDADcDACAAQRhqIQAgAkEYaiICIARHDQALCyAFQSBqJAALwAUCBX8BfCMAQSBrIgUkAAJAAkACQCACDgMCAgABCyABQRhrIgErAwAgACsDAGNFDQEgBSAAKQMQNwMYIAUgACkDCDcDECAFIAApAwA3AwggACABKAIQNgIQIAAgASkDCDcDCCAAIAEpAwA3AwAgASAFKAIYNgIQIAEgBSkDEDcDCCABIAUpAwg3AwAMAQsgAkGAAUwEQCAAIAFGDQEgAEEYaiIDIAFGDQEgACEEA0AgAyEGIAQrAxgiCiAEKwMAYwRAIAUgBCkDKDcDECAFIAQpAyA3AwggAyECA0ACQCACIAQiAygCEDYCECACIAMpAwg3AwggAiADKQMANwMAIAAgA0YEQCAAIQMMAQsgAyECIAogA0EYayIEKwMAYw0BCwsgAyAKOQMAIAMgBSkDCDcDCCADIAUoAhA2AhALIAEgBiIEQRhqIgNHDQALDAELIAIgAkEBdiIHayEIIAAgB0EYbCIJaiEGAkAgAiAETARAIAAgBiAHIAMQ0QMgBiABIAggAyAJaiIBENEDIAMgAkEYbGohBCABIQIDQCACIARGBEAgASADRg0EA0AgACADKAIQNgIQIAAgAykDCDcDCCAAIAMpAwA3AwAgAEEYaiEAIANBGGoiAyABRw0ACwwECwJAIAIrAwAgAysDAGMEQCAAIAIoAhA2AhAgACACKQMINwMIIAAgAikDADcDACACQRhqIQIMAQsgACADKAIQNgIQIAAgAykDCDcDCCAAIAMpAwA3AwAgA0EYaiEDCyAAQRhqIQAgASADRw0ACwwBCyAAIAYgByADIAQQtgEgBiABIAggAyAEELYBIAAgBiABIAcgCCADIAQQyAIMAQsgAiAERg0AA0AgACACKAIQNgIQIAAgAikDCDcDCCAAIAIpAwA3AwAgAEEYaiEAIAJBGGoiAiAERw0ACwsgBUEgaiQAC/gZAiR/CXwjAEGAAWsiCiQAIAVBAWohHCADQQRqIRsgAkEEaiEPIARBBGohEQJAAkACQANAIApCgoCAgDA3AnggCkKAgICAEDcCcEEDIQZBfyELQQAhCEF/IQcDQCAGIQ0gCkHwAGogCGooAgAhBgJAIAtBf0cNACAEIQkCQAJAAkAgBg4CAgABCyARIQkMAQsgBEEIQQwgBkECRhtqIQkLQX8hCyAJKAIADQAgBCELAkACQAJAIA0OAgIAAQsgESELDAELIARBCEEMIA1BAkYbaiELC0F/IAYgCygCABshCwsgBCEJAkACQAJAIAYOAgIAAQsgESEJDAELIARBCEEMIAZBAkYbaiEJC0F+IAYgB0F/RxsgByAJKAIAQQBKGyEHIAhBBGoiCEEQRw0ACwJAIAtBAE4EQCAHQQBOBEAgB0EBayAHQQNxIgxBAnMhEiAEIQYCQAJAAkAgBw4CAgABCyARIQYMAQsgBEEIQQwgB0ECRhtqIQYLQQNxIQ4gBigCACINQQJtIRQgAiEGAkACQAJAIBIOAgIAAQsgDyEGDAELIAJBDEEIIAwbaiEGCyACIQgCQAJAAkAgDg4CAgABCyAPIQgMAQsgAkEIQQwgDkECRhtqIQgLIAMhASAFIQkCQAJAAkAgBw4CAgABCyAbIQEgHCEJDAELIAVBAkEDIAdBAkYiARtqIQkgA0EIQQwgARtqIQELIAEoAgAgFEEAIBRrIAktAAAbaiELIAgoAgAhCSAGKAIAIQECfyAAKAIEIgggACgCCCIGTwRAIAAgBkEBdEGAASAGGxA1IAAoAgAiFyAAKAIEIghBDGxqDAELIAAoAgAiFyAIQQxsagsiBiABNgIAIAdBAWogBiALNgIIIAYgCTYCBCAAIAhBAWoiBjYCBCACIQgCQAJAAkAgDA4CAgABCyAPIQgMAQsgAkEIQQwgDEECRhtqIQgLQQNxIRUgDUF/TgRAIAJBCEEMIA5BAkYbaiEWIAVBAkEDIAdBAkYiARtqIRAgA0EIQQwgARtqIQ0gCCgCACELQQAhCANAIAMhASAFIQkCQAJAAkAgBw4CAgABCyAbIQEgHCEJDAELIA0hASAQIQkLIAhBACAIayAJLQAAGyETIAEoAgAgAiEBAkACQAJAIA4OAgIAAQsgDyEBDAELIBYhAQsgE2ohCSABKAIAIRMCfyAAKAIIIgEgBk0EQCAAIAFBAXRBgAEgARsQNSAAKAIAIhcgACgCBCIGQQxsagwBCyAXIAZBDGxqCyIBIBM2AgAgASAJNgIIIAEgCzYCBCAAIAZBAWoiBjYCBCAIIBRGIAhBAWohCCAJIQtFDQALCyACIQEgFQ4CBQQCCyACKAIAIQkgCkKBgICAIDcCcCACQQhBDCALQQJGG2ohEEEAIRgDQCAKQfAAaiAYaigCACIOIAtqIhJBBG8hDAJAAkAgDkECRw0AIAQhBgJAAkACQCAMDgICAAELIBEhBgwBCyAEQQhBDCAMQQJGG2ohBgsgBigCAEEATA0AIAIhBiADIQcCQAJAAkAgDA4CAgABCyAPIQYgGyEHDAELIANBCEEMIAxBAkYbIgFqIQcgASACaiEGCyAGKAIAIQggBygCACEHIAAoAgQiBiAAKAIIIgFPBEAgACABQQF0QYABIAEbEDUgACAAKAIEIgFBAWo2AgQgACgCACABQQxsaiIBIAk2AgggASAHNgIEIAEgCDYCAAwCCyAAIAZBAWo2AgQgACgCACAGQQxsaiIBIAk2AgggASAHNgIEIAEgCDYCAAwBCyACIQYCQAJAAkAgDA4CAgABCyAPIQYMAQsgAkEIQQwgDEECRhtqIQYLIAYoAgAhCQsgBUECQQMgDEECRiIBG2ohEyADQQhBDCABGyIBaiEWIAEgBGohDUEAIQYCQAJAAkACQANAIAQhBwJAAkACQCAMDgICAAELIBEhBwwBCyANIQcLAkAgBygCACAGTARAIA5BAkYNBSAEIQYgDA4CBAEDCyADIQcgBSEIAkACQAJAIAwOAgIAAQsgGyEHIBwhCAwBCyAWIQcgEyEICyAGQQAgBmsgCC0AABshCCAHKAIAIAIhBwJAAkACQCALDgICAAELIA8hBwwBCyAQIQcLIAhqIQggBygCACEVAn8gACgCBCIBIAAoAggiB08EQCAAIAdBAXRBgAEgBxsQNSAAKAIAIAAoAgQiAUEMbGoMAQsgACgCACABQQxsagsiByAVNgIAIAcgCDYCCCAHIAk2AgQgACABQQFqNgIEIAZBAWohBiAIIQkMAQsLIBEhBgwBCyANIQYLIAYoAgANAQsgAiEGAkACQAJAIAsOAgIAAQsgDyEGDAELIBAhBgsgAiEHAkACQAJAIBJBAWpBBG8iAQ4CAgABCyAPIQcMAQsgAkEIQQwgAUECRhtqIQcLIAcoAgAhCCAGKAIAIQcCfyAAKAIEIgYgACgCCCIBTwRAIAAgAUEBdEGAASABGxA1IAAgACgCBCIBQQFqNgIEIAAoAgAgAUEMbGoMAQsgACAGQQFqNgIEIAAoAgAgBkEMbGoLIgYgBzYCACAGIAg2AgggBiAJNgIECyAYQQRqIhhBCEcNAAsMBQsgAygCDCIdIAQoAgwiGUEBaiAZQX9zIAUtAAMiHhtqIQcgBS0AAEEYdCEGIAQoAgghJCAFLQABIR8gBCgCACEOIAMoAgAhICADKAIEIRIgAigCACEVIAIoAgQhEwJAIBkgBCgCBCIhIBkgIUgbIiVBAEwEQCAeQRB0IB9yISYgEiEWDAELIAYgHkEQdCAfciImQYACciIXciEYICVBAWoiJ7chLCAktyEtIA63IS5BASEaIBIhCANAIBogIWwgJ20iC0EBaiALQX9zIB8bIBJqIhYgCGsiCUEfdSIGQX9zIAYgCXNqISggGSAZIBpsICdtIglrIgZBACAGayAeGyAdaiIUIAdrIgdBH3UiBkF/cyAGIAdzaiEpIAtBACALayAfGyASaiEQIBkgCUF/c2oiBkEAIAZrIB4bIB1qIQ1EAAAAAAAA8D8gGrggLKMiKqEgLqIgKiAtoqAQNCABKAIEISL8AiIMQQBKBEAgDEEBarghLyABKAIAIQlBACELICIhBwNARAAAAAAAAPA/IAtBAWoiC7ggL6MiK6EiKiAJIBBBBXRqIiMrAxiiICsgCSANQQV0aiIGKwMYoqAhMCAqICMrAxCiICsgBisDEKKgITEgKiAjKwMIoiArIAYrAwiioCEyICogIysDAKIgKyAGKwMAoqAhKgJ/IAEoAggiBiAHTQRAIAEgBkEBdEGAASAGGxBVIAEoAgAiCSABKAIEIgdBBXRqDAELIAkgB0EFdGoLIgYgKjkDACAGIDA5AxggBiAxOQMQIAYgMjkDCCABIAdBAWoiBzYCBCALIAxHDQALCyAKIBA2AmQgCiATNgJgIAogFTYCbCAKIA02AmggCiAINgJQIAogIDYCXCAKIBQ2AlggCiAONgJMIAogKTYCSCAKICg2AkAgCiAYNgI8IAogCikCYDcDKCAKIAopAmg3AzAgCiAiNgJUIAogCikCUDcDGCAKIAopAlg3AyAgCiAMNgJEIAogCikCSDcDECAKIAopAkA3AwggCiAYNgIEIAAgASAKQShqIApBGGogCkEIaiAKQQRqELcBIAwgImpBAWshICAaICVGIBpBAWohGiANIRUgECETIBQhByAWIQggFyEYIAwhDkUNAAtBACEGCyAFLQACIQ0gAygCCCELIAIoAgwhCSACIBU2AgwgAigCCCEIIAIgCTYCCCACIAg2AgQgAiATNgIAIAMgIDYCDCADIB02AgggAyALNgIEIAMgFjYCACAEIA42AgwgBCAkNgIEIAQgByAdayIIQR91IgdBf3MgByAIc2o2AgggBCAhIBYgEmsiCEEfdSIHIAcgCHNrajYCACAFIA1BCHQgBnIgJnI2AAAMAQsLIAJBCEEMIBVBAkYbaiEBDAELIA8hAQsCQAJAAkAgBw4CAgABCyARIQQMAQsgBEEIQQwgB0ECRhtqIQQLIAQoAgAiCCAUTA0AIAEoAgAhECACQQxBCCAMG2ohDSAFQQJBAyAHQQJGIgEbaiERIANBCEEMIAEbaiEEA0AgAyEJIAUhCwJAAkACQCAHDgICAAELIBshCSAcIQsMAQsgBCEJIBEhCwsgCEEBayIBQQEgCGsgCy0AABshCyAJKAIAIAIhCAJAAkACQCASDgICAAELIA8hCAwBCyANIQgLIAtqIQkgCCgCACELAn8gACgCCCIIIAZNBEAgACAIQQF0QYABIAgbEDUgACgCACIXIAAoAgQiBkEMbGoMAQsgFyAGQQxsagsiCCALNgIAIAggEDYCCCAIIAk2AgQgACAGQQFqIgY2AgQgCSEQIAEiCCAUSg0ACwsgCkGAAWokAAu+BAEEfwJAAkACQCADDgMCAgABCyACKAIAKAIAIgIgAUEEayIBKAIAIgNBAnRqKAIAIAIgACgCACIEQQJ0aigCAE8NASAAIAM2AgAgASAENgIADwsgA0GAAUwEQCAAIAFGDQEgAEEEaiIEIAFGDQEgAigCACgCACEGIAAhAwNAIAQiByECIAYgAygCBCIIQQJ0aiIJKAIAIAYgAygCACIFQQJ0aigCAEkEQANAAkAgAiAFNgIAIAAgAyIERgRAIAAhBAwBCyAEIQIgCSgCACAGIARBBGsiAygCACIFQQJ0aigCAEkNAQsLIAQgCDYCAAsgByIDQQRqIgQgAUcNAAsMAQsgAyADQQF2IgZrIQggACAGQQJ0IglqIQcCQCADIAVMBEAgACAHIAIgBiAEENkDIAcgASACIAggBCAJaiIBENkDIAQgA0ECdGohBSACKAIAIQcgASEDA0AgAyAFRwRAIAAgAygCACICIAQoAgAiBiAHKAIAIgggAkECdGooAgAgCCAGQQJ0aigCAEkiAhs2AgAgA0EEQQAgAhtqIQMgAEEEaiEAIAEgBEEAQQQgAhtqIgRHDQEMAwsLIAEgBEYNAgNAIAAgBCgCADYCACAAQQRqIQAgBEEEaiIEIAFHDQALDAILIAAgByACIAYgBCAFELgBIAcgASACIAggBCAFELgBIAAgByABIAIgBiAIIAQgBRDLAg8LIAMgBUYNAANAIAAgAygCADYCACAAQQRqIQAgA0EEaiIDIAVHDQALCwu+BAEEfwJAAkACQCADDgMCAgABCyACKAIAKAIAIgIgAUEEayIBKAIAIgNBAnRqKAIAIAIgACgCACIEQQJ0aigCAE8NASAAIAM2AgAgASAENgIADwsgA0GAAUwEQCAAIAFGDQEgAEEEaiIEIAFGDQEgAigCACgCACEGIAAhAwNAIAQiByECIAYgAygCBCIIQQJ0aiIJKAIAIAYgAygCACIFQQJ0aigCAEkEQANAAkAgAiAFNgIAIAAgAyIERgRAIAAhBAwBCyAEIQIgCSgCACAGIARBBGsiAygCACIFQQJ0aigCAEkNAQsLIAQgCDYCAAsgByIDQQRqIgQgAUcNAAsMAQsgAyADQQF2IgZrIQggACAGQQJ0IglqIQcCQCADIAVMBEAgACAHIAIgBiAEENoDIAcgASACIAggBCAJaiIBENoDIAQgA0ECdGohBSACKAIAIQcgASEDA0AgAyAFRwRAIAAgAygCACICIAQoAgAiBiAHKAIAIgggAkECdGooAgAgCCAGQQJ0aigCAEkiAhs2AgAgA0EEQQAgAhtqIQMgAEEEaiEAIAEgBEEAQQQgAhtqIgRHDQEMAwsLIAEgBEYNAgNAIAAgBCgCADYCACAAQQRqIQAgBEEEaiIEIAFHDQALDAILIAAgByACIAYgBCAFELkBIAcgASACIAggBCAFELkBIAAgByABIAIgBiAIIAQgBRDMAg8LIAMgBUYNAANAIAAgAygCADYCACAAQQRqIQAgA0EEaiIDIAVHDQALCwu+BAEEfwJAAkACQCADDgMCAgABCyACKAIAKAIAIgIgAUEEayIBKAIAIgNBAnRqKAIAIAIgACgCACIEQQJ0aigCAE8NASAAIAM2AgAgASAENgIADwsgA0GAAUwEQCAAIAFGDQEgAEEEaiIEIAFGDQEgAigCACgCACEGIAAhAwNAIAQiByECIAYgAygCBCIIQQJ0aiIJKAIAIAYgAygCACIFQQJ0aigCAEkEQANAAkAgAiAFNgIAIAAgAyIERgRAIAAhBAwBCyAEIQIgCSgCACAGIARBBGsiAygCACIFQQJ0aigCAEkNAQsLIAQgCDYCAAsgByIDQQRqIgQgAUcNAAsMAQsgAyADQQF2IgZrIQggACAGQQJ0IglqIQcCQCADIAVMBEAgACAHIAIgBiAEENsDIAcgASACIAggBCAJaiIBENsDIAQgA0ECdGohBSACKAIAIQcgASEDA0AgAyAFRwRAIAAgAygCACICIAQoAgAiBiAHKAIAIgggAkECdGooAgAgCCAGQQJ0aigCAEkiAhs2AgAgA0EEQQAgAhtqIQMgAEEEaiEAIAEgBEEAQQQgAhtqIgRHDQEMAwsLIAEgBEYNAgNAIAAgBCgCADYCACAAQQRqIQAgBEEEaiIEIAFHDQALDAILIAAgByACIAYgBCAFELoBIAcgASACIAggBCAFELoBIAAgByABIAIgBiAIIAQgBRDNAg8LIAMgBUYNAANAIAAgAygCADYCACAAQQRqIQAgA0EEaiIDIAVHDQALCwuJAQEGfAJAIAMgAisDACIFIAErAyAgACsDICIGoaIgAisDCCIHIAErAxggACsDGCIIoaKhIgmZZARAIAUgASgCPCIAKwMgIAahoiAHIAArAxggCKGioSIEmSADZA0BIAUgASgCOCIAKwMgIAahoiAHIAArAxggCKGioSIEmSADZA0BCyAJIQQLIAQLpgICDHwDfwJAIAEoAjwiDigCOCABRw0AIAFBPGohDwNAIAEoAjgiECAORg0BIA4rAxgiAyABKwMYIgahIgcgB6IgDisDICIEIAErAyAiCKEiCSAJoqBEAAAAAAAAEECiIAArA5gBIgIgAqJjRQRAIAYgECsDGCIKoSIFIAQgECsDICIEoSILoiADIAqhIgMgCCAEoSIMoqEiDSANokQAAAAAAAAQQKIgAiACIAMgA6IgCyALoqAiAiAFIAWiIAwgDKKgIgUgAiAFZBuiomVFIAcgCiAGoaJEAAAAAAAAAACgIAQgCKEgCaKgRAAAAAAAAAAAZEVyDQILIAAgARCKBCAAIAEoAjgQvAEgDygCACIBQTxqIQ8gASABKAI8Ig4oAjhGDQALCwvuAQEGfwJAAkACQCAAKAIEIgIgACgCCCIDSQRAIAIgASgCADYCACACQQRqIQEMAQsgAiAAKAIAIgJrIgZBAnUiBUEBaiIEQYCAgIAETw0BIAZB/////wMgAyACayIDQQF1IgcgBCAEIAdJGyADQfz///8HTxsiBAR/IARBgICAgARPDQMgBEECdBAjBUEACyIHaiIDIAEoAgA2AgAgAyAFQQJ0ayEFIAYEQCAFIAIgBvwKAAALIAAgByAEQQJ0ajYCCCAAIANBBGoiATYCBCAAIAU2AgAgAkUNACACECILIAAgATYCBA8LECYACxByAAuOAgEEfwJAAkACQAJAIAMOAwICAAELAkAgAigCACICIAFBBGsiASgCACIDQQR0aiIEKAIEIgUgAiAAKAIAIgZBBHRqIgIoAgQiB0YEQCAEKAIAIAIoAgBIDQEMAwsgBSAHTg0CCyAAIAM2AgAgASAGNgIADwsgA0GAAUwEQCAAIAEgAhCqBA8LIAMgA0EBdiIHayEIIAAgB0ECdCIJaiEGIAMgBUoNASAAIAYgAiAHIAQQlQQgBiABIAIgCCAEIAlqIgEQlQQgBCABIAEgBCADQQJ0aiAAIAIQkQILDwsgACAGIAIgByAEIAUQvgEgBiABIAIgCCAEIAUQvgEgACAGIAEgAiAHIAggBCAFEOMCC10BA38jAEEQayIBJAAgAUEIaiAAQQAQKxAqIAEoAggoAlwCQCABKAIMIgBFDQAgACAAKAIEIgNBAWs2AgQgAw0AIAAgACgCACgCCBEAACAAECQLIAFBEGokAEEDbgtdAQN/IwBBEGsiASQAIAFBCGogAEEAECsQKiABKAIIKAJcAkAgASgCDCIARQ0AIAAgACgCBCIDQQFrNgIEIAMNACAAIAAoAgAoAggRAAAgABAkCyABQRBqJABBA0kLIgAgACABEE4gAEEIaiABQQhqEE4gAEEQaiABQRBqEE4gAAupAQIBfwF8QbSfAigCACIBQQBMBH8gAJkiACAAoEQYLURU+yEJQKJB6JUCKwMAo50hAEEERAAAAAAAgHZAQeCVAisDAKOdIgK9Qv///////////wCDQoCAgICAgID4/wBYBHwgAiAAIAKkIAC9Qv///////////wCDQoCAgICAgID4/wBWGwUgAAtEAAAAAAAACECg/AIiASABQQRvayIBIAFBBEwbBSABCwuOAgEEfwJAAkACQAJAIAMOAwICAAELAkAgAigCACICIAFBBGsiASgCACIDQQR0aiIEKAIEIgUgAiAAKAIAIgZBBHRqIgIoAgQiB0YEQCAEKAIAIAIoAgBIDQEMAwsgBSAHTg0CCyAAIAM2AgAgASAGNgIADwsgA0GAAUwEQCAAIAEgAhCqBA8LIAMgA0EBdiIHayEIIAAgB0ECdCIJaiEGIAMgBUoNASAAIAYgAiAHIAQQqQQgBiABIAIgCCAEIAlqIgEQqQQgBCABIAEgBCADQQJ0aiAAIAIQkQILDwsgACAGIAIgByAEIAUQwwEgBiABIAIgCCAEIAUQwwEgACAGIAEgAiAHIAggBCAFEOgCC9ECAQV/IwBBIGsiBSQAAkACQCAAKAIEIgIgACgCCCIDSQRAIAIgASkDEDcDECACIAEpAwg3AwggAiABKQMANwMAIAJBGGohAQwBCyACIAAoAgAiBGtBGG0iBkEBaiICQavVqtUATw0BIAVBDGpBqtWq1QAgAyAEa0EYbSIDQQF0IgQgAiACIARJGyADQdWq1SpPGyAGIAAQZCICKAIIIgMgASkDEDcDECADIAEpAwg3AwggAyABKQMANwMAIAIgA0EYajYCCCACKAIEIAAoAgQgACgCACIDayIBQWhtQRhsaiEEIAEEQCAEIAMgAfwKAAALIAAoAgAhAyAAIAQ2AgAgAiADNgIEIAAgAigCCCIBNgIEIAIgAzYCCCAAKAIIIQQgACACKAIMNgIIIAIgAzYCACACIAQ2AgwgAhCMAQsgACABNgIEIAVBIGokAA8LECYAC9gEAwV/AXwBfiMAQRBrIgYkAAJAAkACQCACDgMCAgABCyABQRBrIgErAwAgACsDAGRFDQEgBiAAKQMINwMIIAYgACkDADcDACAAIAEpAwg3AwggACABKQMANwMAIAEgBikDCDcDCCABIAYpAwA3AwAMAQsgAkGAAUwEQCAAIAFGDQEgAEEQaiIDIAFGDQEgACEEA0AgAyEFIAQrAxAiCiAEKwMAZARAIAQpAxghCyADIQIDQAJAIAIgBCIDKQMINwMIIAIgAykDADcDACAAIANGBEAgACEDDAELIAMhAiAKIANBEGsiBCsDAGQNAQsLIAMgCzcDCCADIAo5AwALIAEgBSIEQRBqIgNHDQALDAELIAIgAkEBdiIHayEIIAAgB0EEdCIJaiEFAkAgAiAETARAIAAgBSAHIAMQrwQgBSABIAggAyAJaiIBEK8EIAMgAkEEdGohBCABIQIDQCACIARGBEAgASADRg0EA0AgACADKQMINwMIIAAgAykDADcDACAAQRBqIQAgA0EQaiIDIAFHDQALDAQLAkAgAisDACADKwMAZARAIAAgAikDCDcDCCAAIAIpAwA3AwAgAkEQaiECDAELIAAgAykDCDcDCCAAIAMpAwA3AwAgA0EQaiEDCyAAQRBqIQAgASADRw0ACwwBCyAAIAUgByADIAQQxQEgBSABIAggAyAEEMUBIAAgBSABIAcgCCADIAQQ6wIMAQsgAiAERg0AA0AgACACKQMINwMIIAAgAikDADcDACAAQRBqIQAgAkEQaiICIARHDQALCyAGQRBqJAALvQQCBH8BfgJAAkACQCADDgMCAgABCyACKAIAKAIAIgIgAUEEayIBKAIAIgNBA3RqKQMAIAIgACgCACIEQQN0aikDAFoNASAAIAM2AgAgASAENgIADwsgA0GAAUwEQCAAIAFGDQEgAEEEaiIEIAFGDQEgAigCACgCACEGIAAhAwNAIAQiByECIAYgAygCBCIIQQN0aikDACIKIAYgAygCACIFQQN0aikDAFQEQANAAkAgAiAFNgIAIAAgAyIERgRAIAAhBAwBCyAEIQIgCiAGIARBBGsiAygCACIFQQN0aikDAFQNAQsLIAQgCDYCAAsgByIDQQRqIgQgAUcNAAsMAQsgAyADQQF2IgZrIQggACAGQQJ0IglqIQcCQCADIAVMBEAgACAHIAIgBiAEEK4EIAcgASACIAggBCAJaiIBEK4EIAQgA0ECdGohBSACKAIAIQcgASEDA0AgAyAFRwRAIAAgAygCACICIAQoAgAiBiAHKAIAIgggAkEDdGopAwAgCCAGQQN0aikDAFQiAhs2AgAgA0EEQQAgAhtqIQMgAEEEaiEAIAEgBEEAQQQgAhtqIgRHDQEMAwsLIAEgBEYNAgNAIAAgBCgCADYCACAAQQRqIQAgBEEEaiIEIAFHDQALDAILIAAgByACIAYgBCAFEMYBIAcgASACIAggBCAFEMYBIAAgByABIAIgBiAIIAQgBRDqAg8LIAMgBUYNAANAIAAgAygCADYCACAAQQRqIQAgA0EEaiIDIAVHDQALCwspAQF/IAAoAggQxQQgACgCACEBIABBADYCACABBEAgACgCBBogARAiCwuRAgECfwJAIAAoAgQiAyAAKAIIIgRPBEAgACAEQQF0QYABIAQbECUgACgCACAAKAIEIgNBAnRqIAE2AgAMAQsgACgCACADQQJ0aiABNgIACyAAIANBAWo2AgQgAEEQaiEBAkAgACgCFCIDIAAoAhgiBE8EQCABIARBAXRBgAEgBBsQJSAAKAIQIAAoAhQiA0ECdGpBfzYCAAwBCyABKAIAIANBAnRqQX82AgALIAAgA0EBajYCFCAAQSBqIQECQCAAKAIkIgMgACgCKCIETwRAIAEgBEEBdEGAASAEGxAlIAAoAiAgACgCJCIDQQJ0aiACNgIADAELIAEoAgAgA0ECdGogAjYCAAsgACADQQFqNgIkC4gBAQN/IAAoAgQhAiAAIAEQJSAAIAE2AgQgAkERSSACIAFBAXQiBE1yRQRAIAAQLQsgACgCFCECIABBEGoiAyABECUgACABNgIUIAJBEUkgAiAETXJFBEAgAxAtCyAAKAIkIQIgAEEgaiIDIAEQJSAAIAE2AiQgAkERSSACIARNckUEQCADEC0LC6wCAgR8AX8CQAJAIAErAwAiAyACKwMAIgRhBEAgASsDECIFIAErAwgiAyADIAIrAwgiBGEiBxsgAisDECIGIAQgBxtiBEAgB0UNAwwCCyABKwMYIgMgAisDGCIEYg0CIAErAygiBSABKwMgIgMgAyACKwMgIgRhIgcbIAIrAygiBiAEIAcbYgRAIAdFDQMMAgsgASsDMCIDIAIrAzAiBGINAiABKwNAIgUgASsDOCIDIAMgAisDOCIEYSIHGyACKwNAIgYgBCAHG2IEQCAHRQ0DDAILIAErA0giAyACKwNIIgRiDQIgASsDUCIDIAIrA1AiBGINAiAAIAErA1g5AwAgACACKwNYOQMIDwsMAQsgACAGOQMIIAAgBTkDAA8LIAAgBDkDCCAAIAM5AwAL2AYDBX8CfAF+IwBBIGsiBiQAAkACQAJAIAIOAwICAAELIAFBGGsiAisDACIKIAArAwAiC2NFBEAgCiALYg0CIAFBDGsoAgAgACgCDE4NAgsgBiAAKQMQNwMYIAYgACkDCDcDECAGIAApAwA3AwggACACKQMQNwMQIAAgAikDCDcDCCAAIAIpAwA3AwAgAiAGKQMYNwMQIAIgBikDEDcDCCACIAYpAwg3AwAMAQsgAkGAAUwEQCAAIAFGDQEgAEEYaiICIAFGDQEgACEEA0AgBCEDIAIhBAJAAkAgAysDGCIKIAMrAwAiC2MEQCADKAIkIQUMAQsgCiALYg0BIAMoAiQiBSADKAIMTg0BCyADKQMoIQwgAygCICEHIAQgAykDEDcDECAEIAMpAwg3AwggBCADKQMANwMAAn8gACAAIANGDQAaAkADQCAKIANBGGsiAisDACILY0UEQCAKIAtiDQIgBSADQQxrKAIATg0CCyADIAIpAxA3AxAgAyACKQMINwMIIAMgAikDADcDACACIgMgAEcNAAsgAAwBCyADCyICIAw3AxAgAiAFNgIMIAIgBzYCCCACIAo5AwALIAEgBEEYaiICRw0ACwwBCyACIAJBAXYiB2shCCAAIAdBGGwiCWohBQJAIAIgBEwEQCAAIAUgByADEOAEIAUgASAIIAMgCWoiARDgBCADIAJBGGxqIQQgASECA0AgAiAERgRAIAEgA0YNBANAIAAgAykDEDcDECAAIAMpAwg3AwggACADKQMANwMAIABBGGohACADQRhqIgMgAUcNAAsMBAsCQAJAIAIrAwAiCiADKwMAIgtjRQRAIAogC2INASACKAIMIAMoAgxODQELIAAgAikDEDcDECAAIAIpAwg3AwggACACKQMANwMAIAJBGGohAgwBCyAAIAMpAxA3AxAgACADKQMINwMIIAAgAykDADcDACADQRhqIQMLIABBGGohACABIANHDQALDAELIAAgBSAHIAMgBBDLASAFIAEgCCADIAQQywEgACAFIAEgByAIIAMgBBCCAwwBCyACIARGDQADQCAAIAIpAxA3AxAgACACKQMINwMIIAAgAikDADcDACAAQRhqIQAgAkEYaiICIARHDQALCyAGQSBqJAALVgEDfyABIABrIgJBGG0hAwJAIAJBgRhOBEAgAyECA0AgAkEYbBBQIgQNAiACQQF2IgINAAsLIAAgASADQQBBABDLAQ8LIAAgASADIAQgAhDLASAEECILOAEBfyAABEAgACgCABDNASAAKAIEEM0BIAAoAhQiAQRAIAAgATYCGCAAKAIcGiABECILIAAQIgsL8gECCHwCfyABKwMAIQYgAisDACEHIAAgASsDCCIFIAMrAwgiCCACKwMIIgkgBaEiC5kgBCsDCCIKIAihIgyZYyIOGyAJIAogDhsgCCAFoSIFmSAKIAmhIgiZYyINGyALIAwgDhsgBSAIIA0bIAUgCKGjIgVEAAAAAAAAAAAgBb1C////////////AINCgICAgICAgPj/AFQbIgWioDkDCCAAIAYgByANGyAHIAahIAWioDkDACAAIAErAxAiBiACKwMQIgcgDRsgBSAHIAahoqA5AxAgACADKwMQIgYgBCsDECIHIA0bIAUgByAGoaKgOQMYC4UEAgZ/An0gAigCACEGIAACfwJAIAEoAgQiBEUNACABKAIAAn8gBEEBayAGcSAEaSIFQQFNDQAaIAYgBCAGSw0AGiAGIARwCyIHQQJ0aigCACICRQ0AIAIoAgAiAkUNACAEQQFrIQggBUEBSyEJA0ACQCAGIAIoAgQiBUcEQAJAIAlFBEAgBSAIcSEFDAELIAQgBUsNACAFIARwIQULIAUgB0cNAwwBCyACKAIIIAZHDQBBAAwDCyACKAIAIgINAAsLQQwQIyICIAY2AgQgAkEANgIAIAIgAygCADYCCAJAQQAgBCABKAIMQQFqsyIKIAEqAhAiCyAEs5ReGw0AIAEgBCAEQQFrcUEARyAEQQNJciAEQQF0ciIDIAogC5WN/AEiByADIAdLGxBwIAEoAgQiBCAEQQFrIgNxRQRAIAMgBnEhBwwBCyAEIAZLBEAgBiEHDAELIAYgBHAhBwsCQCABKAIAIgYgB0ECdGoiBygCACIDRQRAIAIgASgCCDYCACABIAI2AgggByABQQhqNgIAIAIoAgAiA0UNASADKAIEIQUCQCAEIARBAWsiA3FFBEAgAyAFcSEFDAELIAQgBUsNACAFIARwIQULIAYgBUECdGogAjYCAAwBCyACIAMoAgA2AgAgAyACNgIACyABIAEoAgxBAWo2AgxBAQs6AAQgACACNgIAC7wGAQl/AkACQAJAIAMOAwICAAELIAIoAgAoAgAiAyABQQRrIgEoAgAiBEEDdGoiBSACKAIEKAIAIgJBAnQiBmooAgAiByAGIAMgACgCACIGQQN0aiIDaigCACIITgRAIAcgCEcNAiAFQQEgAmtBAnQiAmooAgAgAiADaigCAE4NAgsgACAENgIAIAEgBjYCAAwBCyADQYABTARAIAAgAUYNASAAQQRqIgMgAUYNAUEBIAIoAgQoAgAiBGshCCACKAIAKAIAIQYgBEECdCEHIAAhBQNAIAUhBCADIQUCQCAGIAQoAgQiDEEDdGoiCSAHaigCACIDIAYgBCgCACICQQN0aiIKIAdqKAIAIgtOBEAgAyALRw0BIAkgCEECdCILaigCACAKIAtqKAIATg0BCyAEIAI2AgQCfyAAIAAgBEYNABogCSAIQQJ0IgpqIQkCQANAIAYgBEEEayICKAIAIgtBA3RqIg0gB2ooAgAiDiADTARAIAMgDkcNAiAJKAIAIAogDWooAgBODQILIAQgCzYCACACIgQgAEcNAAsgAAwBCyAECyAMNgIACyABIAVBBGoiA0cNAAsMAQsgAyADQQF2IgdrIQggACAHQQJ0IglqIQYCQCADIAVMBEAgACAGIAIgByAEEPIEIAYgASACIAggBCAJaiIBEPIEIAQgA0ECdGohBSACKAIEIQYgAigCACECIAEhAwNAIAMgBUYEQCABIARGDQQDQCAAIAQoAgA2AgAgAEEEaiEAIARBBGoiBCABRw0ACwwECwJAAkAgAigCACIHIAMoAgAiCEEDdGoiCSAGKAIAIgxBAnQiCmooAgAiCyAKIAcgBCgCACIKQQN0aiIHaigCACINTgRAIAsgDUcNASAJQQEgDGtBAnQiDGooAgAgByAMaigCAE4NAQsgACAINgIAIANBBGohAwwBCyAAIAo2AgAgBEEEaiEECyAAQQRqIQAgASAERw0ACwwBCyAAIAYgAiAHIAQgBRDQASAGIAEgAiAIIAQgBRDQASAAIAYgASACIAcgCCAEIAUQhQMPCyADIAVGDQADQCAAIAMoAgA2AgAgAEEEaiEAIANBBGoiAyAFRw0ACwsLvAYBCX8CQAJAAkAgAw4DAgIAAQsgAigCACgCACIDIAFBBGsiASgCACIEQQN0aiIFIAIoAgQoAgAiAkECdCIGaigCACIHIAYgAyAAKAIAIgZBA3RqIgNqKAIAIghOBEAgByAIRw0CIAVBASACa0ECdCICaigCACACIANqKAIATg0CCyAAIAQ2AgAgASAGNgIADAELIANBgAFMBEAgACABRg0BIABBBGoiAyABRg0BQQEgAigCBCgCACIEayEIIAIoAgAoAgAhBiAEQQJ0IQcgACEFA0AgBSEEIAMhBQJAIAYgBCgCBCIMQQN0aiIJIAdqKAIAIgMgBiAEKAIAIgJBA3RqIgogB2ooAgAiC04EQCADIAtHDQEgCSAIQQJ0IgtqKAIAIAogC2ooAgBODQELIAQgAjYCBAJ/IAAgACAERg0AGiAJIAhBAnQiCmohCQJAA0AgBiAEQQRrIgIoAgAiC0EDdGoiDSAHaigCACIOIANMBEAgAyAORw0CIAkoAgAgCiANaigCAE4NAgsgBCALNgIAIAIiBCAARw0ACyAADAELIAQLIAw2AgALIAEgBUEEaiIDRw0ACwwBCyADIANBAXYiB2shCCAAIAdBAnQiCWohBgJAIAMgBUwEQCAAIAYgAiAHIAQQ9AQgBiABIAIgCCAEIAlqIgEQ9AQgBCADQQJ0aiEFIAIoAgQhBiACKAIAIQIgASEDA0AgAyAFRgRAIAEgBEYNBANAIAAgBCgCADYCACAAQQRqIQAgBEEEaiIEIAFHDQALDAQLAkACQCACKAIAIgcgAygCACIIQQN0aiIJIAYoAgAiDEECdCIKaigCACILIAogByAEKAIAIgpBA3RqIgdqKAIAIg1OBEAgCyANRw0BIAlBASAMa0ECdCIMaigCACAHIAxqKAIATg0BCyAAIAg2AgAgA0EEaiEDDAELIAAgCjYCACAEQQRqIQQLIABBBGohACABIARHDQALDAELIAAgBiACIAcgBCAFENEBIAYgASACIAggBCAFENEBIAAgBiABIAIgByAIIAQgBRCHAw8LIAMgBUYNAANAIAAgAygCADYCACAAQQRqIQAgA0EEaiIDIAVHDQALCwu8BgEJfwJAAkACQCADDgMCAgABCyACKAIAKAIAIgMgAUEEayIBKAIAIgRBA3RqIgUgAigCBCgCACICQQJ0IgZqKAIAIgcgBiADIAAoAgAiBkEDdGoiA2ooAgAiCE4EQCAHIAhHDQIgBUEBIAJrQQJ0IgJqKAIAIAIgA2ooAgBODQILIAAgBDYCACABIAY2AgAMAQsgA0GAAUwEQCAAIAFGDQEgAEEEaiIDIAFGDQFBASACKAIEKAIAIgRrIQggAigCACgCACEGIARBAnQhByAAIQUDQCAFIQQgAyEFAkAgBiAEKAIEIgxBA3RqIgkgB2ooAgAiAyAGIAQoAgAiAkEDdGoiCiAHaigCACILTgRAIAMgC0cNASAJIAhBAnQiC2ooAgAgCiALaigCAE4NAQsgBCACNgIEAn8gACAAIARGDQAaIAkgCEECdCIKaiEJAkADQCAGIARBBGsiAigCACILQQN0aiINIAdqKAIAIg4gA0wEQCADIA5HDQIgCSgCACAKIA1qKAIATg0CCyAEIAs2AgAgAiIEIABHDQALIAAMAQsgBAsgDDYCAAsgASAFQQRqIgNHDQALDAELIAMgA0EBdiIHayEIIAAgB0ECdCIJaiEGAkAgAyAFTARAIAAgBiACIAcgBBD2BCAGIAEgAiAIIAQgCWoiARD2BCAEIANBAnRqIQUgAigCBCEGIAIoAgAhAiABIQMDQCADIAVGBEAgASAERg0EA0AgACAEKAIANgIAIABBBGohACAEQQRqIgQgAUcNAAsMBAsCQAJAIAIoAgAiByADKAIAIghBA3RqIgkgBigCACIMQQJ0IgpqKAIAIgsgCiAHIAQoAgAiCkEDdGoiB2ooAgAiDU4EQCALIA1HDQEgCUEBIAxrQQJ0IgxqKAIAIAcgDGooAgBODQELIAAgCDYCACADQQRqIQMMAQsgACAKNgIAIARBBGohBAsgAEEEaiEAIAEgBEcNAAsMAQsgACAGIAIgByAEIAUQ0gEgBiABIAIgCCAEIAUQ0gEgACAGIAEgAiAHIAggBCAFEIkDDwsgAyAFRg0AA0AgACADKAIANgIAIABBBGohACADQQRqIgMgBUcNAAsLC7wGAQl/AkACQAJAIAMOAwICAAELIAIoAgAoAgAiAyABQQRrIgEoAgAiBEEDdGoiBSACKAIEKAIAIgJBAnQiBmooAgAiByAGIAMgACgCACIGQQN0aiIDaigCACIITgRAIAcgCEcNAiAFQQEgAmtBAnQiAmooAgAgAiADaigCAE4NAgsgACAENgIAIAEgBjYCAAwBCyADQYABTARAIAAgAUYNASAAQQRqIgMgAUYNAUEBIAIoAgQoAgAiBGshCCACKAIAKAIAIQYgBEECdCEHIAAhBQNAIAUhBCADIQUCQCAGIAQoAgQiDEEDdGoiCSAHaigCACIDIAYgBCgCACICQQN0aiIKIAdqKAIAIgtOBEAgAyALRw0BIAkgCEECdCILaigCACAKIAtqKAIATg0BCyAEIAI2AgQCfyAAIAAgBEYNABogCSAIQQJ0IgpqIQkCQANAIAYgBEEEayICKAIAIgtBA3RqIg0gB2ooAgAiDiADTARAIAMgDkcNAiAJKAIAIAogDWooAgBODQILIAQgCzYCACACIgQgAEcNAAsgAAwBCyAECyAMNgIACyABIAVBBGoiA0cNAAsMAQsgAyADQQF2IgdrIQggACAHQQJ0IglqIQYCQCADIAVMBEAgACAGIAIgByAEEPkEIAYgASACIAggBCAJaiIBEPkEIAQgA0ECdGohBSACKAIEIQYgAigCACECIAEhAwNAIAMgBUYEQCABIARGDQQDQCAAIAQoAgA2AgAgAEEEaiEAIARBBGoiBCABRw0ACwwECwJAAkAgAigCACIHIAMoAgAiCEEDdGoiCSAGKAIAIgxBAnQiCmooAgAiCyAKIAcgBCgCACIKQQN0aiIHaigCACINTgRAIAsgDUcNASAJQQEgDGtBAnQiDGooAgAgByAMaigCAE4NAQsgACAINgIAIANBBGohAwwBCyAAIAo2AgAgBEEEaiEECyAAQQRqIQAgASAERw0ACwwBCyAAIAYgAiAHIAQgBRDTASAGIAEgAiAIIAQgBRDTASAAIAYgASACIAcgCCAEIAUQiwMPCyADIAVGDQADQCAAIAMoAgA2AgAgAEEEaiEAIANBBGoiAyAFRw0ACwsL9AIBBX8gACgCBCAAKAIAIgJrQQN1IgMgAUkEQCMAQSBrIgUkAAJAAkACQCABIANrIgMgACgCCCIEIAAoAgQiAmtBA3VNBEAgACADBH8gA0EDdCIABEAgAkEAIAD8CwALIAAgAmoFIAILNgIEDAELIAIgACgCACICa0EDdSIGIANqIgFBgICAgAJPDQEgBUEMakH/////ASAEIAJrIgJBAnUiBCABIAEgBEkbIAJB+P///wdPGyAGIAAQSyIBKAIIIQIgA0EDdCIDBEAgAkEAIAP8CwALIAEgAiADajYCCCABKAIEIAAoAgQgACgCACIEayICayEDIAIEQCADIAQgAvwKAAALIAAoAgAhAiAAIAM2AgAgASACNgIEIAAgASgCCDYCBCABIAI2AgggACgCCCEDIAAgASgCDDYCCCABIAI2AgAgASADNgIMIAEQmQELIAVBIGokAAwBCxAmAAsPCyABIANJBEAgACACIAFBA3RqNgIECwtpAQR/IAAoAgQiBCAAKAIIIgFHBEADQCAAIAFBDGsiAjYCCCACKAIAIgMEfyABQQhrIAM2AgAgAUEEaygCABogAxAiIAAoAggFIAILIgEgBEcNAAsLIAAoAgAiAgRAIAAoAgwaIAIQIgsLRQECfyAAKAIEIgIgACgCCCIBRwRAIAAgASABIAJrQQxrIgJBDHAgAmtqQQxrNgIICyAAKAIAIgEEQCAAKAIMGiABECILC4sBAQN/IwBBEGsiAiQAIAJBCGoiAyABQfgQED8gAigCDCADEKoCIQMgAigCDCIEQQlPBEAgBBABCyAAQQA2AgggAEIANwIAIAAgAxB9IAIgACgCADYCBCACIAM2AgAgAkEIaiACEKQBIAIoAgwgASgCBBAUIAIoAgwiAEEJTwRAIAAQAQsgAkEQaiQAC5kBAQN8IAAgAKIiAyADIAOioiADRHzVz1o62eU9okTrnCuK5uVavqCiIAMgA0R9/rFX4x3HPqJE1WHBGaABKr+gokSm+BARERGBP6CgIQUgACADoiEEIAJFBEAgBCADIAWiRElVVVVVVcW/oKIgAKAPCyAAIAMgAUQAAAAAAADgP6IgBCAFoqGiIAGhIARESVVVVVVVxT+ioKELkgEBA3xEAAAAAAAA8D8gACAAoiICRAAAAAAAAOA/oiIDoSIERAAAAAAAAPA/IAShIAOhIAIgAiACIAJEkBXLGaAB+j6iRHdRwRZswVa/oKJETFVVVVVVpT+goiACIAKiIgMgA6IgAiACRNQ4iL7p+qi9okTEsbS9nu4hPqCiRK1SnIBPfpK+oKKgoiAAIAGioaCgC7YHAgh/Bn4jAEEwayIDJAAgACEFAkADQCACIQkCQAJAIAEgASgCECICRg0AIAEoAhQgAkYNACAFKQMIIQogASEEAkADQCAEKQMIIg0gClINASAEKAIQIgQgAUcNAAsgBCkDCCENCyAKIA1RDQAgCiANVSEHQQAhBiAKIQwgBCECA0AgBSkDACEOIAIoAhAhAgJAAkACQAJAAkADQAJAIAIgBEYNAAJAIAdBAXEEQANAIAIpAwggDFkNAiACKAIQIgIgBEcNAAwCCwALA0AgAikDCCAMVw0BIAIoAhAiAiAERw0ACwsgAiAERg0AIAIpAwAhCyACKQMIIAxSDQIgCyAOUQ0DIAIoAhQiCCkDCCAMUQRAIA4gCCkDAFMgCyAOV0YNBAsgAigCECICIARHDQELCyAHQQFxIAogDVVHBH8gAigCFCACIAUQhwEiAkUNAkEBIAZrIAYgByACQQBOc0EBcRsFIAYLDQQMBgsgDiACKAIUIggpAwAiD1MgCyAOVXENAiAOIA9XIAsgDllyRQRAQQEgBmshBgwDCyAIIAIgBRCHASIIDQELIAkhAgwFC0EBIAZrIAYgByAIQQBOc0EBcRshBiAFKQMIIQwLIAdBAXMhBwwBCwtBASECIAlBAUYNAwwBC0ECIQIgCUECRw0AQQAhAgwCCyAFKAIQIgUgAEcNAAsgA0EUaiAAELsDIANBCGogARC7A0EAIQICQCADKAIUIgQgAygCGCIBRg0AQQAhBQJAA0ACQAJAAkAgBCADQQhqELoDIgBBAWsOAgEAAgtBACECIAVBAkYNBCAAIQUgBEEQaiIEIAFHDQIMBAtBASECIAVBAUYNAyAAIQUgBEEQaiIEIAFHDQEMAgsgBEEQaiIEIAFHDQALQQAhAiAFQQFHDQELAn4gAygCFCICIAMoAhgiAEYEQEIAIQtCAAwBC0KAgICAgICAgIB/IQtC////////////ACENQv///////////wAhDEKAgICAgICAgIB/IQ8DQCACKQMIIgogCyAKIAtVGyELIAogDCAKIAxTGyEMIAIpAwAiCiAPIAogD1UbIQ8gCiANIAogDVMbIQ0gAkEQaiICIABHDQALIAsgDHxCAn8hCyANIA98QgJ/CyEKIAMgCzcDKCADIAo3AyAgA0EgaiADQQhqELoDQQFGIQILIAMoAggiAARAIAMgADYCDCADKAIQGiAAECILIAMoAhQiAEUNACADIAA2AhggAygCHBogABAiCyADQTBqJAAgAgvdAgEGfyMAQSBrIgYkAEHQABAjIgRBAEHQAPwLACAEIAAoAoQBIgEgACgCgAEiA2tBAnUiAjYCAAJAAkAgACgCiAEiBSABSwRAIAEgBDYCACABQQRqIQMMAQsgAkEBaiIBQYCAgIAETw0BIAZBDGpB/////wMgBSADayIDQQF1IgUgASABIAVJGyADQfz///8HTxsgAiAAQYABahBKIgEoAggiAiAENgIAIAEgAkEEajYCCCABKAIEIAAoAoQBIAAoAoABIgVrIgJrIQMgAgRAIAMgBSAC/AoAAAsgACgCgAEhAiAAIAM2AoABIAEgAjYCBCAAIAEoAggiAzYChAEgASACNgIIIAAoAogBIQUgACABKAIMNgKIASABIAI2AgAgASAFNgIMIAEQUwsgACADNgKEASAEQQA6AEwgBEEANgIEIARCADcDECAEQQA2AhggBkEgaiQAIAQPCxAmAAv8CgIKfwJ+AkACQAJAAkACQCAALQB8QQFHDQAgAigCWC0ACCEFAkAgASgCWC0ACEUEQCAFQQFxRQ0CIAIhBCABIQIMAQsgASEEIAVBAXENAgsgAigCYARAIAAgAiADEH4LIAIoAjQiASABQR91IgVzIAVrQQFHDQECQCAAKAIEQQJGBEAgAigCPA0BDAMLIAIoAlgoAgRFDQILAkACQAJAIAAoAghBAmsOAgABAgsgAUEBRg0BDAMLIAFBf0cNAgsgBCgCPARAIAQgAxBjGgJAIAQoAjwiACgCCCAERgRAIABBADYCCAwBCyAAQQA2AgwLIARBADYCPA8LAkAgAykDACAEKAJYKAIAIgEpAwBSDQAgAykDCCABKQMIUg0AIAEtABhBA3ENAAJAAn8CQAJAIAQoAkQiAUUNACAEKAJYIQIDQCABKAJYIAJGDQIgASkDCCIOIAEpAxhSBEAgBCkDACABKQMAUg0CIAQpAwggDlINAgsgASgCRCIBDQALC0EAIQEgBCgCQCICRQ0AIAQoAlghBQNAIAIgBSACKAJYRg0CGiACKQMIIg4gAikDGFIEQCAEKQMAIAIpAwBSDQIgBCkDCCAOUg0CCyACKAJAIgINAAsLIAELIgFFDQAgASgCPCICRQ0AIAQgAjYCPCABKAI8IQAgBCgCMEEASgRAIAAgATYCDCAAIAQ2AggPCyAAIAQ2AgwgACABNgIIDwsMAwsMAgsgASgCYARAIAAgASADEH4LIAIoAmAEQCAAIAIgAxB+CyAAKAIIIQUCQAJAAkACQAJAIAEoAlgoAgQiByACKAJYKAIEIgpGBEAgASgCNCEEIAVFBEAgASACKAI0NgI0IAIgBDYCNAwECyABIAIoAjAgBGoiBkEAIARrIAYbNgI0IAIoAjQiBCABKAIwIgZHDQEgAkEAIARrNgI0DAILIAUEQCABIAEoAjggAigCMGo2AjggAiACKAI4IAEoAjBrNgI4DAILIAEgASgCOEU2AjggAiACKAI4RTYCOAwCCyACIAQgBms2AjQLQQEhBiAFQQFLDQELIAIoAjQiBCAEQR91IgRzIARrIQggASgCNCIEIARBH3UiBHMgBGshBEEBIQsMAQsgASgCNCEEAn8gACgCDCAFRgRAIAIoAjQMAQtBACAEayEEQQAgAigCNGsLIQggBSEGCyAEQQFLIgwgASgCPCIFRXENACAIQQFLIg0gAigCPCIJRXENACAFBEAgCQRAAkAgDCANckUEQCAHIApGDQEgACgCBEEERg0BCyAAIAEgAiADEIYBDwsCQCAFIAlHBEAgASAFKAIIRw0BCyAAIAEgAiADEIYBDAULIAEgAxBjGgwFCyABIAMQYxogASACEL8DDwsgCQ0DAn4gCwRAIAIoAjgiBSAFQR91IgVzIAVrrSEOIAEoAjgiBSAFQR91IgVzIAVrrQwBCyABKAI4IQUgACgCDCAGRgRAIAI0AjghDiAFrAwBC0EAIAIoAjhrrCEOQQAgBWusCyEPIAcgCkcNAiAEQQFHIAhBAUdyDQACQAJAAkAgACgCBEECaw4DAAEFAgsgD0IAVSAOQgBVcg0CDAQLIA5CAFUiBCAHQQFHIA9CAFdyRXFBASAEIAcgD0IAVXJyG0UNAQwDCyAPQgBXIA5CAFdyDQAgACABIAIgA0EAEN0BCw8LIAAQ2wEiAUEBOgBMIAFBACAEIAQoAjBBAEoiABs2AgwgASAEQQAgABs2AgggBCABNgI8QSAQIyIAIAMpAwg3AwggACADKQMANwMAIABBADYCHCAAIAE2AhggACAANgIUIAAgADYCECABIAA2AhAPCyAAIAEgAiADQQAQ3QEPCyACIAMQYxogASACEL8DC9sCAQR/IAEgABDbASIFNgI8IAIgBTYCPAJAAkACQCABKAJYLQAIQQFGBEAgBUEBOgBMIAVBADYCBCABKAIwQQBMDQEMAgsCQCABKAJAIgcEQANAIAcoAlgtAAhFBEAgBygCPCIGDQMLIAcoAkAiBw0ACwsgBUEANgIEIAQNAgwBCyAALQAZQQFGBEACQCAGKAIEIgBFDQADQCAAKAIQBEAgACEIDAILIAAoAgQiAA0ACwsgBiAINgIEAkAgBSAGRwRAIAYhAANAIAAoAgQiAEEAIAAgBUcbDQALIABFDQELIAYgBSgCBDYCBAsgBSAGNgIECyAEIAcgBigCCEZzDQELIAUgATYCDCAFIAI2AggMAQsgBSACNgIMIAUgATYCCAtBIBAjIgAgAykDCDcDCCAAIAMpAwA3AwAgAEEANgIcIAAgBTYCGCAAIAA2AhQgACAANgIQIAUgADYCEAuAAgEFfyAAKAIcIgEEQANAIAAgASgCRDYCHCABECIgACgCHCIBDQALCyAAQUBrEEUgAEEANgJIIABCADcDQCAAIAAoAlA2AlQgACgCgAEiBCAAKAKEASIFRwRAA0AgBCgCACICKAIQIgEEQCABKAIUQQA2AhADQCABKAIQIAEQIiIBDQALIAJBADYCEAsgAigCGCIBBEAgASgCACIDBEAgASADNgIEIAEoAggaIAMQIgsgARAiCyACKAJAIgEEQCACIAE2AkQgAigCSBogARAiCyACECIgBEEEaiIEIAVHDQALCyAAQYABakEAEH0gACAAKAJcNgJgIAAgACgCaDYCbAupEAIMfwF8IwBBIGsiAiQAIABBBGoiBkEAQfwA/AsAIAJBFGogAUGHDxA/IAIoAhghBSMAQRBrIgMkAEGQnwItAABBAXFFBEBBAkGEjAJBAxAGIQRBkJ8CQQE6AABBjJ8CIAQ2AgALIAIoAhgiBEEJTwRAIAQQEwsgAyAENgIIIANBADYCBEGMnwIoAgAgBUEAIANBBGogA0EIahAFIQ4gAygCBCIEBEAgBBAECyADQRBqJAAgACAO/AI2AgAgAigCGCIDQQlPBEAgAxABCyACQQxqIgMgAUGwChA/IAJBFGogAxDXASAAQRBqEEUgACACKAIUNgIQIAAgAigCGDYCFCAAIAIoAhw2AhggAkEANgIcIAJCADcCFCACKAIQIgNBCU8EQCADEAELIAJBDGoiAyABQaUMED8gAkEUaiADEJsDIAYQRSAAIAIoAhQ2AgQgACACKAIYNgIIIAAgAigCHDYCDCACQQA2AhwgAkIANwIUIAIoAhAiA0EJTwRAIAMQAQsgAkEUaiABQaQJED8gAigCGEECEA4hAyACKAIYIgRBCU8EQCAEEAELAkAgAw0AIAJBDGoiAyABQaQJED8gAkEUaiADENcBIABBHGoQRSAAIAIoAhQ2AhwgACACKAIYNgIgIAAgAigCHDYCJCACQQA2AhwgAkIANwIUIAIoAhAiA0EJSQ0AIAMQAQsgAkEUaiABQZAJED8gAigCGEECEA4hAyACKAIYIgRBCU8EQCAEEAELAkAgAw0AIAJBDGoiAyABQZAJED8gAkEUaiADENcBIABBKGoQRSAAIAIoAhQ2AiggACACKAIYNgIsIAAgAigCHDYCMCACQQA2AhwgAkIANwIUIAIoAhAiA0EJSQ0AIAMQAQsgAkEUaiABQbUIED8gAigCGEECEA4hAyACKAIYIgRBCU8EQCAEEAELAkAgAw0AIAJBDGoiAyABQbUIED8gAkEUaiADENcBIABBNGoQRSAAIAIoAhQ2AjQgACACKAIYNgI4IAAgAigCHDYCPCACQQA2AhwgAkIANwIUIAIoAhAiA0EJSQ0AIAMQAQsgAkEUaiABQasZED8gAigCGEECEA4hAyACKAIYIgRBCU8EQCAEEAELAkAgAw0AIAJBDGoiAyABQasZED8gAkEUaiADENcBIABBQGsQRSAAIAIoAhQ2AkAgACACKAIYNgJEIAAgAigCHDYCSCACQQA2AhwgAkIANwIUIAIoAhAiA0EJSQ0AIAMQAQsgAkEUaiABQbkZED8gAigCGEECEA4hAyACKAIYIgRBCU8EQCAEEAELAkAgAw0AIAJBDGoiAyABQbkZED8gAkEUaiADENcBIABB5ABqEEUgACACKAIUNgJkIAAgAigCGDYCaCAAIAIoAhw2AmwgAkEANgIcIAJCADcCFCACKAIQIgNBCUkNACADEAELIAJBFGogAUG/CRA/IAIoAhhBAhAOIQMgAigCGCIEQQlPBEAgBBABCwJAIAMNACACQQxqIgMgAUG/CRA/IAJBFGogAxCbAyAAQfAAahBFIAAgAigCFDYCcCAAIAIoAhg2AnQgACACKAIcNgJ4IAJBADYCHCACQgA3AhQgAigCECIDQQlJDQAgAxABCyACQRRqIAFBhBAQPyACKAIYQQIQDiEDIAIoAhgiBEEJTwRAIAQQAQsCQCADDQAgAkEMaiIDIAFBhBAQPyACQRRqIAMQmwMgAEHMAGoQRSAAIAIoAhQ2AkwgACACKAIYNgJQIAAgAigCHDYCVCACQQA2AhwgAkIANwIUIAIoAhAiA0EJSQ0AIAMQAQsgAkEUaiABQZwMED8gAigCGEECEA4hAyACKAIYIgRBCU8EQCAEEAELAkAgAw0AIAJBDGoiCyABQZwMED8jAEEQayIDJAAgA0EIaiIEIAtB+BAQPyADKAIMIAQQqgIhBiADKAIMIgRBCU8EQCAEEAELIAJBADYCHCACQgA3AhQCQCACKAIYIAIoAhQiBWsiBCAGSQRAIAYgBGsiBCACKAIcIgcgAigCGCIFa00EQCACIAQEfyAEBEAgBUEAIAT8CwALIAQgBWoFIAULNgIYDAILIAUgAigCFCIJayIKIARqIghBAE4EQEEAIQVB/////wcgByAJayIHQQF0IgwgCCAIIAxJGyAHQf////8DTxsiCARAIAgQIyEFCyAFIApqIQcgBARAIAdBACAE/AsACyAKBEAgBSAJIAr8CgAACyACIAUgCGo2AhwgAiAEIAdqNgIYIAIgBTYCFCAJBEAgCRAiCwwCCxAmAAsgBCAGSwRAIAIgBSAGajYCGAsLIAMgAigCFDYCBCADIAY2AgAgA0EIaiADEN8DIAMoAgwgCygCBBAUIAMoAgwiBEEJTwRAIAQQAQsgA0EQaiQAIABB2ABqEEUgACACKAIUNgJYIAAgAigCGDYCXCAAIAIoAhw2AmAgAkEANgIcIAJCADcCFCACKAIQIgNBCUkNACADEAELIAJBFGogAUG1FhA/IAIoAhhBAhAOIQMgAigCGCIEQQlPBEAgBBABCwJAIAMNACACQRRqIAFBtRYQPyAAIAIoAhghAyMAQRBrIgAkAEGgnwItAABBAXFFBEBBAkGUjAJBAxAGIQFBoJ8CQQE6AABBnJ8CIAE2AgALIAIoAhgiAUEJTwRAIAEQEwsgACABNgIIIABBADYCBEGcnwIoAgAgA0EAIABBBGogAEEIahAFIAAoAgQiAQRAIAEQBAsgAEEQaiQAtjgCfCACKAIYIgBBCUkNACAAEAELIAJBIGokAAuUAwICfw98IwBBgAFrIgMkACABKAIAGiAAEOMBIAErAxAhBSABKwMYIQYgASsDICEHIAErAyghCCABKwMwIQkgASsDOCEKIANCgICAgICAgPg/NwNIIAMgCjkDQCADIAk5AzggA0IANwMwIAMgCDkDKCADIAc5AyAgA0IANwMYIAMgBjkDECADIAU5AwggAysDGCEIIAMrAwghCSADKwMQIQogAysDMCELIAMrAyAhDCADKwMoIQ0gAisDICEFIAIrAwAhBiACKwMQIQcgA0HQAGoiBCACKwMIIg4gAysDOCIRoiACKwMYIg8gAysDQCISoqAgAisDKCIQIAMrA0giE6KgOQMoIAQgBiARoiAHIBKioCAFIBOioDkDICAEIA4gDKIgDyANoqAgECALoqA5AxggBCAGIAyiIAcgDaKgIAUgC6KgOQMQIAQgCSAOoiAKIA+ioCAIIBCioDkDCCAEIAkgBqIgCiAHoqAgCCAFoqA5AwAgAEEQaiAEQTD8CgAAIABBCGogAUEIahBeIANBgAFqJAALRAIBfwF8IwBBEGsiAiQAIAIgASAAKwOQASIDIAMgAEH4AGoQwgIgACACQQEQwAIgAiACNgIMIAJBDGoQKSACQRBqJAALwwIBBH8gACABIAJBABD/AQRAIwBBEGsiAiQAIAMQsQEgAyAAKAKEASAAKAKAAWtBAnUQViAEBEAgBBCxASAEIAAoAoQBIAAoAoABa0ECdRBWCyAAKAKEASIGIAAoAoABIgFHBEADQCABIAdBAnRqKAIAIgUoAhAiCARAIAJBADYCDCACQgA3AgQCQAJAAkAgBEUNACAFLQBMQQFHDQAgBCEBIAggAC0AdUEBIAJBBGogACsDmAEQugINAQwCCyAAIAUQvQIgAyEBIAUoAhAgAC0AdUEAIAJBBGogACsDmAEQugJFDQELIAEgAkEEahBoCyACKAIEIgEEQCACIAE2AgggAigCDBogARAiCyAAKAKEASEGIAAoAoABIQELIAdBAWoiByAGIAFrQQJ1SQ0ACwsgAkEQaiQACyAAEN4BIAAtAH0aC/4CAQZ/IwBBIGsiAiQAQSQQIyIBQgA3AgwgAUGElgI2AgAgAUIANwIEIAFCADcCFCABQgA3AhwgAEIANwMYIABCgICAgICAgPg/NwMQIABCADcDCCAAIAE2AgQgACABQQxqNgIAIABCADcDICAAQgA3AzAgAEKAgICAgICA+D83AyggAEIANwM4IAJBADYCECACQgA3AghBGBAjIgNBtJoCNgIAIANCADcCBCMAQRBrIgEkACABIAIoAggiBTYCACABIAIoAgwiBjYCBCABIAIoAhA2AgggAkEANgIQIAJCADcCCCADQQxqIgRBADYCCCAEQgA3AgAgBCAFIAYgBiAFa0EMbRBHIAEgATYCDCABQQxqECkgAUEQaiQAIAIgAzYCGCACIAQ2AhQgAEEIaiACQRRqEE4CQCACKAIYIgBFDQAgACAAKAIEIgFBAWs2AgQgAQ0AIAAgACgCACgCCBEAACAAECQLIAIgAkEIajYCHCACQRxqECkgAkEgaiQAC64BAQN/IAACfwJAIAEoAgQiBEUEQCABQQRqIgUhAgwBCyACKAIAIQYDQCAEIgIoAhAiBSAGSgRAIAQhBSAEKAIAIgQNAQwCC0EAIAUgBk4NAhogAigCBCIEDQALIAJBBGohBQtBOBAjIQQgAygCACgCACEDIARCADcDGCAEIAM2AhAgBEIANwMgIARCADcDKCAEQgA3AzAgASACIAUgBBCCAUEBCzoABCAAIAQ2AgAL5QEBEXwgACABKwMQIgMgA6IiCSABKwMYIgQgBKIiDSABKwMAIgUgBaIiDqEiDyABKwMIIgYgBqIiCqGgIAIrAxAiC6IgAisDACIMIAUgA6IiECAEIAaiIhGhIgcgB6CiIAIrAwgiByAEIAWiIgggBiADoiISoCITIBOgoqCgOQMQIAAgCyASIAihIgggCKCiIAcgCiAPoCAJoaIgDCAFIAaiIgUgBCADoiIDoCIEIASgoqCgOQMIIAAgCyARIBCgIgQgBKCiIAwgDSAOoCAKoSAJoaIgByAFIAOhIgMgA6CioKA5AwALKAAgACgCvAFFBEBBAA8LIAAoArgBIAFBBXRqKwMYRAAAAAAAAAAAYwuDAwIFfwp8IwBBMGsiBCQAIAEoAkgiBSADQQJ0IgYgASgCWGoiB0F4QQQgAyADQQNtIghBA2xrQQJGG2ooAgBBGGxqIgMrAxAhCyADKwMAIQkgBSAHKAIAQRhsaiIFKwMQIQogBSsDACEMIAQgAysDCCAFKwMIoSIQOQMgIAQgCSAMoSIMOQMYIAQgCyAKoSINOQMoIAQgAisDCCILIA0gASgCqAEiBSAIQRhsaiIDKwMIIAUgASgCaCAGaigCAEEDbUEYbGoiASsDCKAiCiALIAMrAwAgASsDAKAiDiACKwMAIgmiRAAAAAAAAAAAoCAKIAuioCADKwMQIAErAxCgIg8gAisDECIKoqBEAAAAAAAAAABjIgEbIhGiIBAgDyAKIAEbIg+ioSISoiAJIAwgD6IgDSAOIAkgARsiDaKhIg6ioTkDECAEIAkgECANoiAMIBGioSIJoiAKIBKioTkDCCAEIAogDqIgCyAJoqE5AwAgACAEIARBGGoQnAEgBEEwaiQAC7kBAQJ/IwBBIGsiBCQAIARBEGogARCKASAEKAIQIQEgBEEIaiIFIAIQigEgBEEYaiABIAUgAyABKAIAKAIQEQUAIAQgBCkCGDcDACAAIAQQQwJAIAQoAgwiAEUNACAAIAAoAgQiAUEBazYCBCABDQAgACAAKAIAKAIIEQAAIAAQJAsCQCAEKAIUIgBFDQAgACAAKAIEIgFBAWs2AgQgAQ0AIAAgACgCACgCCBEAACAAECQLIARBIGokAAusAgICfwJ8IwBBIGsiAyQAIANBEGogARCKASADKAIQIQQjAEHgAGsiASQAIAFCADcDCCABQoCAgICAgID4PzcDACABQgA3AxAgAUIANwMYIAFCADcDKCABQoCAgICAgID4PzcDICABQgA3AzAgAUIANwM4IAFCgICAgICAgPg/NwNAIAIrAwAhBSACKwMIIQYgASACKwMQRAAAAAAAAAAAoDkDWCABIAZEAAAAAAAAAACgOQNQIAEgBUQAAAAAAAAAAKA5A0ggA0EYaiAEIAEgBCgCACgCBBEDACABQeAAaiQAIAMgAykCGDcDCCAAIANBCGoQQwJAIAMoAhQiAEUNACAAIAAoAgQiAUEBazYCBCABDQAgACAAKAIAKAIIEQAAIAAQJAsgA0EgaiQAC4sBAQN/IwBBEGsiAiQAQagCECMiAUGgkAI2AgAgAUIANwIEIAFBEGoQOyEDIAFBCzYCVCACIAE2AgwgAiADNgIIIAEgASgCBEEBajYCBCACIAIpAgg3AwAgACACEEgaIAEgASgCBCIAQQFrNgIEIABFBEAgASABKAIAKAIIEQAAIAEQJAsgAkEQaiQAC3MBAn8jAEEQayICJABBJBAjIgFCADcCDCABQYSWAjYCACABQgA3AgQgAUIANwIUIAFCADcCHCAAIAE2AgQgACABQQxqNgIAIAJBBGoQ+wIgACACKAIENgIIIAAgAigCCDYCDCAAQgA3AhAgAkEQaiQAIAALRAEBfyAAQQA2AgggAEIANwIAIAEEQCAAIAEQ8QEgACgCBCECIAFBAnQiAQRAIAJBACAB/AsACyAAIAEgAmo2AgQLIAAL1SgCFH8CfSAAKAJcBEAgAEHYAGoQOCAAQegAahA4IABB+ABqEDgjAEEwayIDJAAgACgCXCEGIAAoAkwhASADQQA6ABggA0EMaiABIANBGGoiARD5AiEEIANBADoAGCADIAYgARD5AiIKKAIAIQggBgRAIABByABqIQUDQAJAIAggAkEDdkH8////AXFqKAIAIAJ2QQFxDQAgACgCWCACQQJ0aigCACIBQX9GDQAgBCgCACABQQN2Qfz///8BcWoiBygCACILQQEgAXQiCXEEQCAAKAJIIgkgAUEYbGohAQJAIAAoAkwiByAAKAJQIgtPBEAgAyABKQMQNwMoIAMgASkDCDcDICADIAEpAwA3AxggBSALQQF0QYABIAsbEDMgACAAKAJMIgFBAWo2AkwgACgCSCABQRhsaiIBIAMpAyg3AxAgASADKQMgNwMIIAEgAykDGDcDACAKKAIAIQgMAQsgACAHQQFqNgJMIAkgB0EYbGoiByABKQMQNwMQIAcgASkDCDcDCCAHIAEpAwA3AwALIAAoAkxBAWshByAAKAJYIQsgACgCaCEJIAIhAQNAIAhBfkEBIAkgAUECdGooAgAiAUEDb0ECRhsgAWoiAUEDdkH8////AXFqIgwgDCgCAEEBIAF0cjYCACALIAFBAnQiDGogBzYCACALQXhBBCAJIAxqKAIAIgxBA29BAkYbaiAMQQJ0aiAHNgIAIAEgAkcNAAsMAQsgByAJIAtyNgIAIAAoAmghByACIQEDQCAIQX5BASAHIAFBAnRqKAIAIgFBA29BAkYbIAFqIgFBA3ZB/P///wFxaiILIAsoAgBBASABdHI2AgAgASACRw0ACwsgAkEBaiICIAZHDQALCyAIBEAgCigCCBogCBAiCyAEKAIAIgEEQCAEKAIIGiABECILIANBMGokACAAIQMjAEHQAGsiBiQAA0AgAygCXCEJIAZBADYCFCAGQgA3AgwgBkEAOgAYIAYgCSAGQRhqEPkCIQUgBkEANgI4IAZCADcCMCAGQgA3AyAgBkIANwMYIAZBgICA/AM2AihBACEBIAkEQANAAkAgBSgCACABQQN2Qfz///8BcWooAgAgAXZBAXENACADKAJYIAFBAnRqIgAoAgBBf0YNACAAQXhBBCABQQNvQQJGG2ooAgBBf0YNACAGQQA2AjQgBigCJARAIAYoAiAiAgRAA0AgAigCACACECIiAg0ACwsgBkEANgIgAkAgBigCHCIARQ0AIABBAnQiAEUNACAGKAIYQQAgAPwLAAsgBkEANgIkCyABIQADQCAFKAIAQX5BASADKAJoIABBAnRqKAIAIgBBA29BAkYbIABqIgBBA3ZB/P///wFxaiICIAIoAgBBASAAdHI2AgAgAEEDbyECAkAgAygCWCAAQQJ0aiIIKAIAQX9GDQAgCEF4QQQgAkECRhtqKAIAIgRBf0YNAAJAIAYoAiRFBEAgBigCMCICIAYoAjQiCEEDdGohCgJAIAhFDQADQCACKAIAIARGDQEgAkEIaiICIApHDQALDAILIAIgCkYNASACIAAgAigCBCICIAAgAkgbNgIEDAILIAYgADYCRCAGIAQ2AkBBACEIIAZBQGsiDCgCACECIAYCfwJAIAZBGGoiCygCBCIERQ0AIAsoAgACfyAEQQFrIAJxIARpIgdBAU0NABogAiACIARJDQAaIAIgBHALIghBAnRqKAIAIgpFDQAgCigCACIKRQ0AIARBAWshDiAHQQFLIQ0DQAJAIAIgCigCBCIHRwRAAkAgDUUEQCAHIA5xIQcMAQsgBCAHSw0AIAcgBHAhBwsgByAIRw0DDAELIAooAgggAkcNAEEADAMLIAooAgAiCg0ACwtBEBAjIgogAjYCBCAKQQA2AgAgCiAMKQIANwIIAkBBACAEIAsoAgxBAWqzIhUgCyoCECIWIASzlF4bDQAgCyAEIARBAWtxQQBHIARBA0lyIARBAXRyIgggFSAWlY38ASIEIAQgCEkbEHAgCygCBCIEIARBAWsiCHFFBEAgAiAIcSEIDAELIAIgBEkEQCACIQgMAQsgAiAEcCEICwJAIAsoAgAiDCAIQQJ0aiIIKAIAIgJFBEAgCiALKAIINgIAIAsgCjYCCCAIIAtBCGo2AgAgCigCACICRQ0BIAIoAgQhBwJAIAQgBEEBayICcUUEQCACIAdxIQcMAQsgBCAHSw0AIAcgBHAhBwsgDCAHQQJ0aiAKNgIADAELIAogAigCADYCACACIAo2AgALIAsgCygCDEEBajYCDEEBCzoATCAGIAo2AkggBi0ATA0BIAYoAkgiAiAAIAIoAgwiAiAAIAJIGzYCDAwBCwJAIAYoAjgiAiAITQRAIAZBMGogAkEBdEGAASACGxDQBCAGIAYoAjQiAkEBajYCNCAGKAIwIAJBA3RqIAStIACtQiCGhDcCACAGKAI0IQgMAQsgBiAIQQFqIgg2AjQgCiAANgIEIAogBDYCAAsgCEEhSQ0AIAYoAjAiAiAIQQN0aiEIA0AgBkHIAGogBkEYaiACIAIQiwUgAkEIaiICIAhHDQALIAZBADYCNAsgACABRw0ACyABIQIDQCADKAJYQX5BASADKAJoIAJBAnRqKAIAIgBBA29BAkYbIABqIgJBAnRqIgAoAgAhCCAGIABBeEEEIAJBA29BAkYbaigCACIENgJIAkAgCEF/RiAEQX9Gcg0AIAYoAiRFBEAgBigCMCEAAkAgBigCNCIIRQ0AIAAgCEEDdGohCANAIAAoAgAgBEYNASAAQQhqIgAgCEcNAAsgCCEACyAAKAIEIAJGDQEgBiACNgJAIAZBDGogBkFAaxA9DAELIAZBGGogBkHIAGoQogIoAgwgAkYNACAGIAI2AkAgBkEMaiAGQUBrED0LIAEgAkcNAAsLIAFBAWoiASAJRw0ACwsgBkEYahCVASAGKAIwIgAEQCAAECILIAUoAgAiAARAIAYoAggaIAAQIgsgBigCDCIAIAYoAhAiE0YiFEUEQANAIAAoAgAhByMAQSBrIgQkACADQdgAaiELIAMoAlgiAkF+QQEgB0EDb0ECRhsgB2oiCEECdCIJaigCACEKAkACQCADKAJoIgUgCWooAgAiASAHRg0AIAIgB0ECdGooAgAhDiADKAJ4IAlqKAIAIQwDQCAOIAIgAUECdCIJaigCAEYEQCADKAJIIg4gCkEYbGohAgJAIAMoAkwiCSADKAJQIgVPBEAgBCACKQMQNwMYIAQgAikDCDcDECAEIAIpAwA3AwggA0HIAGogBUEBdEGAASAFGxAzIAMgAygCTCICQQFqNgJMIAMoAkggAkEYbGoiAiAEKQMYNwMQIAIgBCkDEDcDCCACIAQpAwg3AwAMAQsgAyAJQQFqNgJMIA4gCUEYbGoiBSACKQMQNwMQIAUgAikDCDcDCCAFIAIpAwA3AwALAkAgAygCnAEiBUUNACADKAKYASINIApBGGxqIQIgAygCoAEiDiAFTQRAIAQgAikDEDcDGCAEIAIpAwg3AxAgBCACKQMANwMIIANBmAFqIA5BAXRBgAEgDhsQMyADIAMoApwBIgJBAWo2ApwBIAMoApgBIAJBGGxqIgIgBCkDGDcDECACIAQpAxA3AwggAiAEKQMINwMADAELIAMgBUEBajYCnAEgDSAFQRhsaiIFIAIpAxA3AxAgBSACKQMINwMIIAUgAikDADcDAAsgAygCWCEFIAMoAmgiDUF4QQQgAUEDb0ECRhtqIAFBAnRqKAIAIgIgDSAIQQJ0aigCACIORwRAIAIhAQNAIAVBfkEBIAFBA29BAkYbIg9BAnRqIAFBAnRqIAk2AgAgBSABIA9qQQJ0IgFqIAk2AgAgASANaigCACIBIA5HDQALCyAFIAJBAnQiDWooAgAhBSADKAJcIQEgCyAKIAwQyAEgCyAJIAwQyAEgCyAFIAMoAnggDWooAgAQyAEgAygCaCIFIAFBAmoiD0ECdGogBSANaiINKAIAIhA2AgAgBSAQQQJ0aiAPNgIAIAUgAUEBaiIPQQJ0aiACNgIAIA0gDzYCACADQdgBaiEPIAJBA20hEAJAIAMoAtwBIg1FDQAgAygC2AEiEiAQQQR0aiEFIAMoAuABIhEgDU0EQCAEIAUpAgg3AxAgBCAFKQIANwMIIA8gEUEBdEGAASARGxA5IAMgAygC3AEiBUEBajYC3AEgAygC2AEgBUEEdGoiBSAEKQMQNwIIIAUgBCkDCDcCAAwBCyADIA1BAWo2AtwBIBIgDUEEdGoiDSAFKQIINwIIIA0gBSkCADcCAAsgA0GoAWohEQJAIAMoAqwBIg1FDQAgAygCqAEiEiAQQRhsaiEFIAMoArABIhAgDU0EQCAEIAUpAxA3AxggBCAFKQMINwMQIAQgBSkDADcDCCARIBBBAXRBgAEgEBsQMyADIAMoAqwBIgVBAWo2AqwBIAMoAqgBIAVBGGxqIgUgBCkDGDcDECAFIAQpAxA3AwggBSAEKQMINwMADAELIAMgDUEBajYCrAEgEiANQRhsaiINIAUpAxA3AxAgDSAFKQMINwMIIA0gBSkDADcDAAsgDkECdCIFIAMoAlhqKAIAIQ0gCyAJIAwQyAEgCyAKIAwQyAEgCyANIAMoAnggBWooAgAQyAEgAygCaCIJIAFBBWoiDEECdGogBSAJaiIFKAIAIg02AgAgCSANQQJ0aiAMNgIAIAkgAUEEaiIMQQJ0aiAONgIAIAUgDDYCACAJIAFBA2oiBUECdGogATYCACAJIAFBAnRqIAU2AgAgDkEDbSEFAkAgAygC3AEiCUUNACADKALYASIOIAVBBHRqIQEgAygC4AEiDCAJTQRAIAQgASkCCDcDECAEIAEpAgA3AwggDyAMQQF0QYABIAwbEDkgAyADKALcASIBQQFqNgLcASADKALYASABQQR0aiIBIAQpAxA3AgggASAEKQMINwIADAELIAMgCUEBajYC3AEgDiAJQQR0aiIJIAEpAgg3AgggCSABKQIANwIACwJAIAMoAqwBIglFDQAgAygCqAEiDCAFQRhsaiEBIAMoArABIgUgCU0EQCAEIAEpAxA3AxggBCABKQMINwMQIAQgASkDADcDCCARIAVBAXRBgAEgBRsQMyADIAMoAqwBIgFBAWo2AqwBIAMoAqgBIAFBGGxqIgEgBCkDGDcDECABIAQpAxA3AwggASAEKQMINwMADAELIAMgCUEBajYCrAEgDCAJQRhsaiIJIAEpAxA3AxAgCSABKQMINwMIIAkgASkDADcDAAsgAiAHRg0CIAMoAmghAgwDCyAFQXhBBCABQQNvQQJGG2ogCWooAgAiASAHRw0ACwsgAygCSCIFIApBGGxqIQECQCADKAJMIgkgAygCUCICTwRAIAQgASkDEDcDGCAEIAEpAwg3AxAgBCABKQMANwMIIANByABqIAJBAXRBgAEgAhsQMyADIAMoAkwiAUEBajYCTCADKAJIIAFBGGxqIgEgBCkDGDcDECABIAQpAxA3AwggASAEKQMINwMADAELIAMgCUEBajYCTCAFIAlBGGxqIgIgASkDEDcDECACIAEpAwg3AwggAiABKQMANwMACwJAIAMoApwBIgJFDQAgAygCmAEiDCAKQRhsaiEBIAMoAqABIgUgAk0EQCAEIAEpAxA3AxggBCABKQMINwMQIAQgASkDADcDCCADQZgBaiAFQQF0QYABIAUbEDMgAyADKAKcASIBQQFqNgKcASADKAKYASABQRhsaiIBIAQpAxg3AxAgASAEKQMQNwMIIAEgBCkDCDcDAAwBCyADIAJBAWo2ApwBIAwgAkEYbGoiAiABKQMQNwMQIAIgASkDCDcDCCACIAEpAwA3AwALIAMoAlghBSADKAJoIQIgCCEBA0AgBUF+QQEgAiABQQJ0aigCACIBQQNvQQJGGyABaiIBQQJ0IgxqIAk2AgAgBUF4QQQgAiAMaigCACIMQQNvQQJGG2ogDEECdGogCTYCACABIAhHDQALCwJAAkAgAkF+QQEgAiAHQQJ0aigCACIIQQNvQQJGGyIJQQJ0aiAIQQJ0aigCACIBIAhGDQAgCygCACEHA0AgCiAHIAFBAnQiC2ooAgBHBEAgAkF4QQQgAUEDb0ECRhtqIAtqKAIAIgEgCEcNAQwCCwsgASAIRw0BCyADKAJIIgsgCkEYbGohAQJAIAMoAkwiAiADKAJQIgdPBEAgBCABKQMQNwMYIAQgASkDCDcDECAEIAEpAwA3AwggA0HIAGogB0EBdEGAASAHGxAzIAMgAygCTCIBQQFqNgJMIAMoAkggAUEYbGoiASAEKQMYNwMQIAEgBCkDEDcDCCABIAQpAwg3AwAMAQsgAyACQQFqNgJMIAsgAkEYbGoiByABKQMQNwMQIAcgASkDCDcDCCAHIAEpAwA3AwALAkAgAygCnAEiB0UNACADKAKYASILIApBGGxqIQEgAygCoAEiCiAHTQRAIAQgASkDEDcDGCAEIAEpAwg3AxAgBCABKQMANwMIIANBmAFqIApBAXRBgAEgChsQMyADIAMoApwBIgFBAWo2ApwBIAMoApgBIAFBGGxqIgEgBCkDGDcDECABIAQpAxA3AwggASAEKQMINwMADAELIAMgB0EBajYCnAEgCyAHQRhsaiIKIAEpAxA3AxAgCiABKQMINwMIIAogASkDADcDAAsgAygCWCEKIAMoAmghByAIIAlqIgghAQNAIApBfkEBIAcgAUECdGooAgAiAUEDb0ECRhsgAWoiAUECdCILaiACNgIAIApBeEEEIAcgC2ooAgAiC0EDb0ECRhtqIAtBAnRqIAI2AgAgASAIRw0ACwsgBEEgaiQAIABBBGoiACATRw0ACyAGKAIMIQALIAAEQCAGIAA2AhAgBigCFBogABAiCyAURQ0ACyAGQdAAaiQACwvTAwEDfyAAKAIIIAAoAgAiA2tBA3UEQCAAKAIEIgQgA2siBUEDdUUEQCABIAVqIQUgAyAERwRAA0AgAyABEF4gA0EIaiEDIAFBCGoiASAFRw0ACyAAKAIEIQQLIAQhASACIAVHBEADQCABIAUoAgA2AgAgASAFKAIEIgM2AgQgAwRAIAMgAygCBEEBajYCBAsgAUEIaiEBIAVBCGoiBSACRw0ACwsgACAEIAEgBGtqNgIEDwsgASACRwRAA0AgAyABEF4gA0EIaiEDIAFBCGoiASACRw0ACyAAKAIEIQQLIAMgBEcEQANAIAMgBEEIaxAvIgRHDQALCyAAIAM2AgQPCyAAKAIAIgQEQCAEIgMgACgCBCIFRwRAA0AgBCAFQQhrEC8iBUcNAAsgACgCACEDCyAAIAQ2AgQgACgCCBogAxAiIABBADYCCCAAQgA3AgALIABB/////wFBASAAKAIIIAAoAgBrIgNBAnUiBCAEQQFNGyADQfj///8HTxsQkAMgACgCBCEDIAEgAkcEQANAIAMgASgCADYCACADIAEoAgQiBDYCBCAEBEAgBCAEKAIEQQFqNgIECyADQQhqIQMgAUEIaiIBIAJHDQALCyAAIAM2AgQLfgECfyMAQRBrIgIkAEGoAhAjIgNBoJACNgIAIANCADcCBCADQRBqIAEQowEhASACIAM2AgggAiABNgIEIAAgAkEEahDcBAJAIAIoAggiAEUNACAAIAAoAgQiAUEBazYCBCABDQAgACAAKAIAKAIIEQAAIAAQJAsgAkEQaiQAC6sBAQF/IwBB0ABrIgMkACADQThqIAEgAhChASADQSBqIAEgAkEgahChASADQQhqIAEgAkFAaxChASAAQcgAaiABIAJB4ABqEKEBIAAgAykDSDcDECAAIAMpA0A3AwggACADKQM4NwMAIAAgAykDIDcDGCAAIAMpAyg3AyAgACADKQMwNwMoIAAgAykDCDcDMCAAIAMpAxA3AzggACADKQMYNwNAIANB0ABqJAALNAEBfyABQYCAgIAETwRAECYACyAAIAFBAnQiAhAjIgE2AgQgACABNgIAIAAgASACajYCCAs0AQF/IAFBq9Wq1QBPBEAQJgALIAAgAUEYbCICECMiATYCBCAAIAE2AgAgACABIAJqNgIICw8AIAEgACgCAGogAjkDAAsNACABIAAoAgBqKwMACwgAIAAoAgAaC7cMAQd/IwBBEGsiBCQAIAQgADYCDAJAIABB0wFNBEBB0OIBQZDkASAEQQxqEKQDKAIAIQAMAQsgAEF8TwRAEK4CAAsgBCAAIABB0gFuIgVB0gFsIgBrNgIIQZDkAUHQ5QEgBEEIahCkAyIDKAIAIABqIQAgA0GQ5AFrQQJ1IQYDQEEFIQMCQAJAA0AgAyIBQS9GDQEgACABQQJ0KALQ4gEiAm4iByACSQ0EIAFBAWohAyAAIAIgB2xHDQALIAFBL0kNAQtB0wEhAwNAIAAgA24iASADSQ0DIAAgASADbEYNASAAIANBCmoiAW4iAiABSQ0DIAAgASACbEYNASAAIANBDGoiAW4iAiABSQ0DIAAgASACbEYNASAAIANBEGoiAW4iAiABSQ0DIAAgASACbEYNASAAIANBEmoiAW4iAiABSQ0DIAAgASACbEYNASAAIANBFmoiAW4iAiABSQ0DIAAgASACbEYNASAAIANBHGoiAW4iAiABSQ0DIAAgASACbEYNASAAIANBHmoiAW4iAiABSQ0DIAAgASACbEYNASAAIANBJGoiAW4iAiABSQ0DIAAgASACbEYNASAAIANBKGoiAW4iAiABSQ0DIAAgASACbEYNASAAIANBKmoiAW4iAiABSQ0DIAAgASACbEYNASAAIANBLmoiAW4iAiABSQ0DIAAgASACbEYNASAAIANBNGoiAW4iAiABSQ0DIAAgASACbEYNASAAIANBOmoiAW4iAiABSQ0DIAAgASACbEYNASAAIANBPGoiAW4iAiABSQ0DIAAgASACbEYNASAAIANBwgBqIgFuIgIgAUkNAyAAIAEgAmxGDQEgACADQcYAaiIBbiICIAFJDQMgACABIAJsRg0BIAAgA0HIAGoiAW4iAiABSQ0DIAAgASACbEYNASAAIANBzgBqIgFuIgIgAUkNAyAAIAEgAmxGDQEgACADQdIAaiIBbiICIAFJDQMgACABIAJsRg0BIAAgA0HYAGoiAW4iAiABSQ0DIAAgASACbEYNASAAIANB4ABqIgFuIgIgAUkNAyAAIAEgAmxGDQEgACADQeQAaiIBbiICIAFJDQMgACABIAJsRg0BIAAgA0HmAGoiAW4iAiABSQ0DIAAgASACbEYNASAAIANB6gBqIgFuIgIgAUkNAyAAIAEgAmxGDQEgACADQewAaiIBbiICIAFJDQMgACABIAJsRg0BIAAgA0HwAGoiAW4iAiABSQ0DIAAgASACbEYNASAAIANB+ABqIgFuIgIgAUkNAyAAIAEgAmxGDQEgACADQf4AaiIBbiICIAFJDQMgACABIAJsRg0BIAAgA0GCAWoiAW4iAiABSQ0DIAAgASACbEYNASAAIANBiAFqIgFuIgIgAUkNAyAAIAEgAmxGDQEgACADQYoBaiIBbiICIAFJDQMgACABIAJsRg0BIAAgA0GOAWoiAW4iAiABSQ0DIAAgASACbEYNASAAIANBlAFqIgFuIgIgAUkNAyAAIAEgAmxGDQEgACADQZYBaiIBbiICIAFJDQMgACABIAJsRg0BIAAgA0GcAWoiAW4iAiABSQ0DIAAgASACbEYNASAAIANBogFqIgFuIgIgAUkNAyAAIAEgAmxGDQEgACADQaYBaiIBbiICIAFJDQMgACABIAJsRg0BIAAgA0GoAWoiAW4iAiABSQ0DIAAgASACbEYNASAAIANBrAFqIgFuIgIgAUkNAyAAIAEgAmxGDQEgACADQbIBaiIBbiICIAFJDQMgACABIAJsRg0BIAAgA0G0AWoiAW4iAiABSQ0DIAAgASACbEYNASAAIANBugFqIgFuIgIgAUkNAyAAIAEgAmxGDQEgACADQb4BaiIBbiICIAFJDQMgACABIAJsRg0BIAAgA0HAAWoiAW4iAiABSQ0DIAAgASACbEYNASAAIANBxAFqIgFuIgIgAUkNAyAAIAEgAmxGDQEgACADQcYBaiIBbiICIAFJDQMgACABIAJsRg0BIAAgA0HQAWoiAW4iAiABSQ0DIANB0gFqIQMgACABIAJsRw0ACwtBACAGQQFqIgAgAEEwRiIAGyIGQQJ0KAKQ5AEgACAFaiIFQdIBbGohAAwACwALIARBEGokACAAC7MBAQN/IwBBEGsiAyQAIAEhAgNAIAJBBE8EQCAAKAAAQZXTx94FbCIEQRh2IARzQZXTx94FbCABQZXTx94FbHMhASACQQRrIQIgAEEEaiEADAELCwJAAkACQAJAIAJBAWsOAwIBAAMLIAAtAAJBEHQgAXMhAQsgAC0AAUEIdCABcyEBCyABIAAtAABzQZXTx94FbCEBCyABQQ12IAFzQZXTx94FbCIAQQ92IABzIANBEGokAAuoAQACQCABQYAITgRAIABEAAAAAAAA4H+iIQAgAUH/D0kEQCABQf8HayEBDAILIABEAAAAAAAA4H+iIQBB/RcgASABQf0XTxtB/g9rIQEMAQsgAUGBeEoNACAARAAAAAAAAGADoiEAIAFBuHBLBEAgAUHJB2ohAQwBCyAARAAAAAAAAGADoiEAQfBoIAEgAUHwaE0bQZIPaiEBCyAAIAFB/wdqrUI0hr+iCwoAIAAgABCnA6ILQwAgACAAIAGlIAG9Qv///////////wCDQoCAgICAgID4/wBWGyABIAC9Qv///////////wCDQoCAgICAgID4/wBYGwtNAgF/AXwjAEEQayIFJAAgBSAENgIIIAUgAzYCDCAAKAIQIgBFBEAQZgALIAAgASACIAVBDGogBUEIaiAAKAIAKAIYERgAIAVBEGokAAukAgICfwV+AkAgASgCEEUNAAJAIAEpAzggASkDKFUEQCABKQMwIAEpAyBVDQELIAAgARC9AiABKAIQIgNFDQEgAyAALQB1QQAgAUFAaxD9AUUNAUL///////////8AIQdCgICAgICAgICAfyEIAkAgASgCQCICIAEoAkQiAEYEQEKAgICAgICAgIB/IQVC////////////ACEGDAELQv///////////wAhBkKAgICAgICAgIB/IQUDQCACKQMIIgQgCCAEIAhVGyEIIAQgBiAEIAZTGyEGIAIpAwAiBCAFIAQgBVUbIQUgBCAHIAQgB1MbIQcgAkEQaiICIABHDQALCyABIAg3AzggASAFNwMwIAEgBjcDKCABIAc3AyALQQEhAgsgAgvtBgIGfwR+IwBBIGsiCCQAAkAgAEUNACAAKAIQIgQgAEYNACACRQRAIAQgACgCFEYNAQsgAxC2AyABBH8gAEEUagUgACgCECIAQRBqCygCACEGIAApAwAhCiAAKQMIIQsCQAJAAkAgAygCBCIEIAMoAggiBUkEQCAEIAs3AwggBCAKNwMAIARBEGohBAwBCyAEIAMoAgAiCWtBBHUiB0EBaiIEQYCAgIABTw0BIAhBDGpB/////wAgBSAJayIFQQN1IgkgBCAEIAlJGyAFQfD///8HTxsgByADEDIiBSgCCCIEIAs3AwggBCAKNwMAIAUgBEEQajYCCCAFKAIEIAMoAgQgAygCACIJayIEayEHIAQEQCAHIAkgBPwKAAALIAMoAgAhCSADIAc2AgAgBSAJNgIEIAMgBSgCCCIENgIEIAUgCTYCCCADKAIIIQcgAyAFKAIMNgIIIAUgCTYCACAFIAc2AgwgBRA2CyADIAQ2AgQgACAGRwRAQRRBECABGyEJA0AgCiAGKQMAIg1RIAYpAwgiDCALUXFFBEACQCADKAIIIgUgBEsEQCAEIAw3AwggBCANNwMAIARBEGohBAwBCyAEIAMoAgAiBGtBBHUiB0EBaiIBQYCAgIABTw0EIAhBDGpB/////wAgBSAEayIEQQN1IgUgASABIAVJGyAEQfD///8HTxsgByADEDIhBSAIKAIUIgEgDDcDCCABIA03AwAgCCABQRBqNgIUIAgoAhAgAygCBCADKAIAIgdrIgFrIQQgAQRAIAQgByAB/AoAAAsgAygCACEBIAMgBDYCACAIIAE2AhAgAyAIKAIUIgQ2AgQgCCABNgIUIAMoAgghByADIAgoAhg2AgggCCAHNgIYIAUgATYCACAFEDYLIAMgBDYCBCAMIQsgDSEKCyAGIAlqKAIAIgYgAEcNAAsLAkAgAg0AIAQgAygCAGtBMEcNACAGKAIUIgAgBigCECIBKAIQRw0AIAApAwAiCiABKQMAIgt9QgF8QgJYBEAgACkDCCABKQMIfUIBfEIDVA0DCyAGKQMAQgF8IgwgC31CAlgEQCAGKQMIIAEpAwh9QgF8QgNUDQMLIAwgCn1CAlYNACAGKQMIIAApAwh9QgF8QgNUDQILQQEhBgwCCxAmAAtBACEGCyAIQSBqJAAgBgvDBAIEfgZ/IwBBEGsiCSQAIAEgASkDGCIDNwMIIAEgASkDECIFNwMAIAEgASgCVEEQQRQgASgCMEEAShtqKAIAIgY2AlQgBikDACEEIAYpAwghAiABIAU3AyAgASACNwMYIAEgBDcDECABAnwgAiADUgRAIAEpAxAgBX25IAIgA325owwBC0T////////v/0T////////vfyABKQMQIAVVGws5AyggASgCYARAIAAgASABEH4gASkDCCEDIAEpAxghAgsCQCACIANRBEAgASgCWC0ACA0BQQAhBkEQQRQgASgCMEEAShsiCCABKAJUaigCACIHKQMIIANSDQEgASkDACEFIAEpABAhBCAALQB0QQFxIQACQANAIABBACAHKQMAIgIgBFMgBCAFV0YbRQRAIAEgAjcDECABIAc2AlQgBy0AGEEEcQ0CQQEhBiACIQQgAyAHIAhqKAIAIgcpAwhRDQEMAgsLIAQhAiAGQQFxRQ0CCyABRP///////+//RP///////+9/IAIgBVUbOQMoDAELIAkgAjcDCCAAQUBrIAlBCGoQkgECQCAAKAJEIgggACgCQCIKa0EDdSIGQQJIDQAgCiAGQQJrQQF2IgdBA3RqIgYpAwAiAyAIQQhrIgspAwAiBFkNAANAAkAgBiEIIAsgAzcDACAHRQ0AIAYhCyAKIAdBAWtBAXYiB0EDdGoiBikDACIDIARTDQELCyAIIAQ3AwALIAAgASABQQAQgQIgACABIAFBARCAAgsgCUEQaiQAC+tJAwx/DH4IfCMAQRBrIg8kACAAIAM6ABkgACACNgIIIAAgATYCBCMAQRBrIg0kACAALQAYRQRAIA1BB2ohBwJAAkAgACgCKCIFIAAoAiQiBGtBAnUiAkEASgRAIAIhAwNAIANBAnQQUCIGDQIgA0EBdiIDDQALCyAEIAUgByACQQBBABCwAQwBCyAEIAUgByACIAYgAxCwASAGECILIABBAToAGAsgACgCKCIHIAAoAiQiCEcEQCAAQUBrIQQDQCANIAdBBGsiBygCACgCACkDCDcDCCAEIA1BCGoQkgECQCAAKAJEIgMgACgCQCIFa0EDdSICQQJIDQAgBSACQQJrQQF2IghBA3RqIgYpAwAiESADQQhrIgMpAwAiEFkNAANAAkAgBiECIAMgETcDACAIRQ0AIAIhAyAFIAhBAWtBAXYiCEEDdGoiBikDACIRIBBTDQELCyACIBA3AwALIAcgACgCJCIIRw0ACwsgAEEBOgB9IABCADcCHCAAIAg2AjAgDUEQaiQAQQEhAwJAIAFFDQAgACAPQQhqELkDRQ0AQQAhAyAALQB9QQFHDQADQCAPKQMIIRMjAEEQayIKJAACQCAAKAIwIgYgACgCKEYNACAAQUBrIQ0DQCAGKAIAIgQoAgAiASkDCCATUg0BIAAgBkEEajYCMAJAAkAgASgCGCIBQQFxRQRAQegAECMiAkEAQegA/AsAIAJBATYCMCACQTRqQQBBKfwLACACIAQoAgAiASkDADcDACABKQMIIRAgAkF/NgIwIAIgEDcDCCACIAIpAwAiEjcDICACIAQoAgAoAhQiATYCVCACIAEpAwg3AxggASkDACEQIAIgBDYCWCACIBA3AxAgAgJ8IAIpAxgiESACKQMIIhBSBEAgAikDECASfbkgESAQfbmjDAELRP///////+//RP///////+9/IAIpAxAgElUbCzkDKCAEKAIALQAYQQJxRQRAIAIhBgwCC0EAIQYMAgtBACEGQQAhAiABQQJxDQELQegAECMiAUEAQegA/AsAIAFBATYCMCABQTRqQQBBKfwLACABIAQoAgAiAikDADcDACACKQMIIRAgAUEBNgIwIAEgEDcDCCABIAEpAwAiEjcDICABIAQoAgAoAhAiAjYCVCABIAIpAwg3AxggAikDACEQIAEgBDYCWCABIBA3AxAgAQJ8IAEpAxgiESABKQMIIhBSBEAgASkDECASfbkgESAQfbmjDAELRP///////+//RP///////+9/IAEpAxAgElUbCyIcOQMoAkAgBkUEQEEAIQYMAQsCQCAGKQMYIAYpAwhRBEAgBisDKET////////v/2ENAgwBCyAQIBFRBEAgHET////////vf2ENAgwBCyAGKwMoIBxjDQELIAYhAiABIQYMAQsgASECCyACQQE6AFwgAEEcaiEEAkAgACgCHCIBRQRAIAJCADcDQCAAIAI2AhwMAQsgASACEL8CBEADQAJAIAQoAgAiAUHEAGohBCABKAJEIgVFDQAgBSACEL8CDQELCwJAIAEoAmBBAkYEQCABKAJEIgFFDQELIAIgASgCRCIENgJEIAQEQCAEIAI2AkALIAIgATYCQCABIAI2AkQLDAELIAJBADYCQCACIAAoAhwiATYCRCABIAI2AkAgACACNgIcCwJAIAIoAlgtAAhBAUYEQEEAIQUgACgCHCEBAkAgACgCCARAIAEgAkcEQCACKAI4IQQgAigCNCEFA0ACQCABKAJYIgcoAgRBAUYEQCACIAQgASgCMGoiBDYCOAwBCyAHLQAIDQAgAiAFIAEoAjBqIgU2AjQLIAEoAkQiASACRw0ACwsMAQtBACEEAkAgASACRgRAQQAhAQwBCwNAAkAgASgCWCIHKAIEQQFGBEAgBEEBaiEEDAELIAUgBy0ACEEBc2ohBQsgASgCRCIBIAJHDQALIARBAXEhASAFQQFxIQQLIAIgATYCOCACIAQ2AjQLIAIoAjghAQJ/AkACQAJAIAAoAghBAmsOAgABAgsgAigCNEEASiEEIAFBAEoMAgsgAigCNEEfdiEEIAFBH3YMAQsgAigCNEEARyEEIAFBAEcLIQECQAJAIAAoAgRBAWsOAgMAAQsgASAEckEBcyEBDAILIAFBAXMhAQwBCyACKAJYIgUoAgQhCwJAAkACQAJ/AkAgAigCQCIBBEADQCALIAEoAlgiBCgCBEYEQCAELQAIQQFHDQMLIAEoAkAiAQ0ACwsgAiACKAIwNgI0IAAoAhwiASAAKAIIRQ0BGgwDCyAAKAIIDQEgAiACKAIwNgI0IAIgASgCODYCOCABKAJECyIBIAJGDQIgAigCOCEEA0ACQCABKAJYIgUoAgQgC0YNACAFLQAIDQAgAiAERSIENgI4CyABKAJEIgEgAkcNAAsMAgsgAgJ/IAEoAjAiByABKAI0IghsQQBIBEAgCEECa0F8TQRAIAggAigCMCIEQQAgBCAHbEEAThtqDAILQQEgAigCMCAFLQAIGwwBCyAIIAIoAjAiBEEAIAQgB2xBAE4bags2AjQgAiABKAI4NgI4IAEoAkQhAQsgASACRg0AIAIoAjghBANAAkAgASgCWCIFKAIEIAtGDQAgBS0ACA0AIAIgBCABKAIwaiIENgI4CyABKAJEIgEgAkcNAAsLAn8CQAJAAkACQAJAIAAoAggiBUEBaw4DAAECAwsgAigCNCIBIAFBH3UiAXMgAWtBAUYNAgwDCyACKAI0QQFHDQIMAQsgAigCNEF/Rw0BC0EBIQQCQAJAAkACQCAAKAIEQQFrDgQAAQIDBAsgAigCOCEBAkACQAJAIAVBAmsOAgABAgsgAUEASgwGCyABQR92DAULIAFBAEcMBAsgAigCOCEBAkACQAJAIAVBAmsOAgABAgsgAUEATAwFCyABQQBODAQLIAFFDAMLIAIoAjghAQJ/AkACQAJAIAVBAmsOAgABAgsgAUEATAwCCyABQQBODAELIAFFCyACKAJYKAIEQQBHcyEECyAEDAELQQALIQELAkAgBgRAIAZBADoAXCAGIAIoAjQ2AjQgBiACKAI4NgI4IAYgAigCRCIENgJEIAQEQCAEIAY2AkALIAYgAjYCQCACIAY2AkQCQCABQQFxRQ0AIAAgAiAGIAJBARDdASACKQMYIAIpAwhRDQAgACACIAJBABCBAgsCQCAGKAJEIgRFDQADQCAEIAYQvwJFDQEgACAGIAYoAkQgBhDcASAGKAJEIgUoAkQiBARAIAQgBjYCQAsgBigCQCIBBEAgASAFNgJECyAFIAY2AkQgBSABNgJAIAYgBDYCRCAGIAU2AkAgBSgCQEUEQCAAIAU2AhwLIAQNAAsLIAYpAxggBikDCFEEQCAGIAAoAiA2AkwgACAGNgIgDAILIAAgBiAGQQAQgAIgCiAGKQMYNwMIIA0gCkEIahCSASAAKAJEIgQgACgCQCIHa0EDdSIBQQJIDQEgByABQQJrQQF2IgZBA3RqIgEpAwAiECAEQQhrIgQpAwAiEVkNAQNAAkAgASEFIAQgEDcDACAGRQ0AIAEhBCAHIAZBAWtBAXYiBkEDdGoiASkDACIQIBFTDQELCyAFIBE3AwAMAQsgAUEBcUUNACAAENsBIgZBAToATCAGQQAgAiACKAIwQQBKIgEbNgIMIAYgAkEAIAEbNgIIIAIgBjYCPEEgECMiASACKQMINwMIIAEgAikDADcDACABQQA2AhwgASAGNgIYIAEgATYCFCABIAE2AhAgBiABNgIQCwJAIAIpAxgiECACKQMIUQRAIAIgACgCIDYCTCAAIAI2AiAMAQsgCiAQNwMIIA0gCkEIahCSASAAKAJEIgIgACgCQCIFa0EDdSIBQQJIDQAgBSABQQJrQQF2IgZBA3RqIgEpAwAiECACQQhrIgQpAwAiEVkNAANAAkAgASECIAQgEDcDACAGRQ0AIAIhBCAFIAZBAWtBAXYiBkEDdGoiASkDACIQIBFTDQELCyACIBE3AwALIAAoAjAiBiAAKAIoRw0ACwsgCkEQaiQAA0AgACgCICIBBEAgACABKAJMNgIgIAAgARC4AwwBCwsgACgCYCAAKAJcRwRAQQAhCSMAQSBrIg4kAAJAIAAoAlwiBCAAKAJgIghGDQAgBCEFA0AgBSgCACICQRhqIQYDQCAGKAIAIgdBBGohBiAHKAIQIg1FDQALIAIpAwghECACIQECQCAHKAIIBEAgDSgCECEHA0AgByABIgZHBEAgASgCFCIBKQMIIBBRDQELCwNAIAIiASANRg0CIAIoAhAiAikDCCAQUQ0ACwwBCwNAIAIgASIGKAIUIgFHBEAgASkDCCAQUQ0BCwsDQCACIgEoAhAiAiAGRg0BIAIpAwggEFENAAsLAkACQCAGKQMAIhEgASkDACIQUgRAIAUgECARVSICOgAIIAUgASAGIAIbNgIEIAUgBiABIAIbIgE2AgAgASgCHEUNAQsgBUEANgIEDAELIAEgBTYCHCAJQQFqIQkLIAVBDGoiBSAIRw0ACyAJQQJIDQAgDkEMaiEFIAggBGsiAUEMbSECAkACQCABQYEMTgRAIAIhAQNAIAFBDGwQUCIGDQIgAUEBdiIBDQALCyAEIAggBSACQQBBABCvAQwBCyAEIAggBSACIAYgARCvASAGECILIABB6ABqIQogACgCXCIBIAlBDGxqIgtBDGshDQNAAkAgASIHQQxqIgEgC0YNACABIQYDQAJAAkAgBigCACICKQMAIAcoAgQpAwBZDQAgBy0ACCIFIAYtAAhGDQAgBigCBCkDACAHKAIAIgQpAwBXDQAgBCkDCCEQAkACQAJAIAVFBEACQCAEKAIUIgQpAwggEFINAANAIAQpAwAgBigCACICKQMAVQ0BIAcgBDYCACAEKAIUIgQpAwggEFENAAsgBigCACECCyACKAIQIgQpAwggEFINAiAEKQMAIAcoAgApAwBXDQEMAgsCQCAEKAIQIgUpAwggEFINACAFKQMAIAYoAgAiAikDAFUNAANAAkAgByAFIgQ2AgAgBCgCECIFKQMIIBBSDQAgBSkDACAGKAIAIgIpAwBXDQEMAgsLIAYoAgAhAgsCQCACKAIUIgIpAwggEFINAANAIAIpAwAgBygCACIEKQMAVQ0BIAYgAjYCACACKAIUIgIpAwggEFENAAsgBygCACEEC0EgECMhDCAEKAIYIQIgDCAEKQMINwMIIAwgBCkDADcDACAMQQA2AhwgDCACNgIYIAQoAhAiAiAMNgIUIAQgDDYCECAMIAQ2AhQgDCACNgIQIAYoAgAhBEEgECMhCSAEKAIYIQIgCSAEKQMINwMIIAkgBCkDADcDACAJQQA2AhwgCSACNgIYIAQoAhQiAiAJNgIQIAQgCTYCFCAJIAI2AhQgCSAENgIQIAAoAmwiAiAAKAJwIgRJBEAgAiAJNgIEIAIgDDYCACACQQhqIQIMAwsgAiAKKAIAIgJrQQN1IgVBAWoiCEGAgICAAk8NBCAOQQxqQf////8BIAQgAmsiBEECdSICIAggAiAISxsgBEH4////B08bIAUgChBLIQggDigCFCICIAk2AgQgAiAMNgIAIA4gDigCFEEIajYCFCAOKAIQIAAoAmwgACgCaCICayIFayEEIAUEQCAEIAIgBfwKAAALIAAoAmghBSAAIAQ2AmggDiAFNgIQIAAgDigCFCICNgJsIA4gBTYCFCAAKAJwIQQgACAOKAIYNgJwIA4gBDYCGCAIIAU2AgAgCBCZAQwCCwNAIAYgBCICNgIAIAIoAhAiBCkDCCAQUg0BIAQpAwAgBygCACkDAFcNAAsLQSAQIyEMIAIoAhghBCAMIAIpAwg3AwggDCACKQMANwMAIAxBADYCHCAMIAQ2AhggAigCECIEIAw2AhQgAiAMNgIQIAwgAjYCFCAMIAQ2AhAgBygCACEEQSAQIyEJIAQoAhghAiAJIAQpAwg3AwggCSAEKQMANwMAIAlBADYCHCAJIAI2AhggBCgCFCICIAk2AhAgBCAJNgIUIAkgAjYCFCAJIAQ2AhAgACgCbCICIAAoAnAiBEkEQCACIAk2AgQgAiAMNgIAIAJBCGohAgwBCyACIAooAgAiAmtBA3UiBUEBaiIIQYCAgIACTw0CIA5BDGpB/////wEgBCACayIEQQJ1IgIgCCACIAhLGyAEQfj///8HTxsgBSAKEEshCCAOKAIUIgIgCTYCBCACIAw2AgAgDiAOKAIUQQhqNgIUIA4oAhAgACgCbCAAKAJoIgJrIgVrIQQgBQRAIAQgAiAF/AoAAAsgACgCaCEFIAAgBDYCaCAOIAU2AhAgACAOKAIUIgI2AmwgDiAFNgIUIAAoAnAhBCAAIA4oAhg2AnAgDiAENgIYIAggBTYCACAIEJkBCyAAIAI2AmwLIAsgBkEMaiIGRw0BDAILCxAmAAsgASANRw0ACwsgDkEgaiQAIAAgACgCXDYCYAsgACAPKQMINwMQAkAgACAPQQhqELkDBEAgDykDCCEYQQAhAgJAIAAoAhwiB0UNACAHKAJERQ0AIAAgBzYCICAHIQEDQCABIgIgAigCQDYCSCACIAIoAkQiATYCUCACIAE2AkwgAikDECEQAkAgGCACKQMYUQ0AIBAgAikDACIRUQ0AIAIpAwgiECAYUQRAIBEhEAwBCyARIAIrAyggGCAQfbminvwGfCEQCyACIBA3AyAgAQ0ACwNAAkBBACEGIAcoAlBFDQADQCAHIgQoAlAiBQRAIAYhDSAEIAUoAlAiBzYCUAJAIAQgBUYgBSAHRnJFBEAgBCEGIAUhAQNAAkACQCABIgIpAyAgBCkDIFMEQANAIAIoAkghAiMAQSBrIgwkAAJAAn4gAikDGCIRIAIpAwgiFH25Ih0gASkDECITIAEpAwAiFn25Ih6iIAIpAxAiECACKQMAIhV9uSIfIAEpAxgiGiABKQMIIhd9uSIgoqEiHEQAAAAAAAAAAGIEQCAUIBUiEiAWfbkgIKIgHiAUIBd9uaKhIByjIhxEAAAAAAAAAABlDQEaIBAhEiARIBxEAAAAAAAA8D9mDQEaIBwgH6IgFbmg/AYhEiAcIB2iIBS5oPwGDAELIAIpAyAhEiAYCyIZIBhTIgggACkDECIbIBlTckUEQCAZIREgEiEQDAELIAIrAygiIZkiI0QAAAAAAABZQGQiBUUgASsDKCIcmSIiRAAAAAAAAFlAZEVyRQRAICIgI2MEQCAQIBVRIBEgFFFxDQJEAAAAAAAAAAAhHAJAIBIgFX25IB+iIB0gGSAUfbmioCAfIB+iIB0gHaKgoyIhRAAAAAAAAAAAYw0AICEiHEQAAAAAAADwP2RFDQBEAAAAAAAA8D8hHAsgFCAcIB2invwGfCERIBUgHCAfop78BnwhEAwCCyATIBZRBEAgEyEQIBcgGiIRUQ0CC0QAAAAAAAAAACEcAkAgEiAWfbkgHqIgICAZIBd9uaKgIB4gHqIgICAgoqCjIiFEAAAAAAAAAABjDQAgISIcRAAAAAAAAPA/ZEUNAEQAAAAAAADwPyEcCyAXIBwgIKKe/AZ8IREgFiAcIB6invwGfCEQDAELIAUEQCAQIBVRIBEgFFFxDQFEAAAAAAAAAAAhHAJAIBIgFX25IB+iIB0gGSAUfbmioCAfIB+iIB0gHaKgoyIhRAAAAAAAAAAAYw0AICEiHEQAAAAAAADwP2RFDQBEAAAAAAAA8D8hHAsgFCAcIB2invwGfCERIBUgHCAfop78BnwhEAwBCyAiRAAAAAAAAFlAZARAIBMgFlEEQCATIRAgFyAaIhFRDQILRAAAAAAAAAAAIRwCQCASIBZ9uSAeoiAgIBkgF325oqAgHiAeoiAgICCioKMiIUQAAAAAAAAAAGMNACAhIhxEAAAAAAAA8D9kRQ0ARAAAAAAAAPA/IRwLIBcgHCAgop78BnwhESAWIBwgHqKe/AZ8IRAMAQsgGCAbIAgbIRICQAJAICIgI2QEQCARIBJRIBAgFVFyDQEgEiAUUQRAIBQhESAVIRAMBAsgFSAhIBIgFH25op78BnwhEAwBCyASIBpRIBMgFlFyDQEgEiAXUQRAIBchESAWIRAMAwsgFiAcIBIgF325op78BnwhEAsgEiERDAELIBIhESATIRALAkACQAJAIAAoAlQiBSAAKAJYIghJBEAgBSABNgIUIAUgAjYCECAFIBE3AwggBSAQNwMAIAVBGGohCAwBCyAFIABB0ABqIgooAgAiBWtBGG0iC0EBaiIJQavVqtUATw0BIAxBDGpBqtWq1QAgCCAFa0EYbSIIQQF0IgUgCSAFIAlLGyAIQdWq1SpPGyALIAoQZCIKKAIIIgUgATYCFCAFIAI2AhAgBSARNwMIIAUgEDcDACAKIAVBGGo2AgggCigCBCAAKAJUIAAoAlAiBWsiC0FobUEYbGohCCALBEAgCCAFIAv8CgAACyAAKAJQIQsgACAINgJQIAogCzYCBCAAIAooAggiCDYCVCAKIAs2AgggACgCWCEFIAAgCigCDDYCWCAKIAs2AgAgCiAFNgIMIAoQjAELIAAgCDYCVCAMQSBqJAAMAQsQJgALIAIgBEcNAAsgASgCSCEFIAEoAkwiAgRAIAIgBTYCSAsgBSACNgJMIAEgBCgCSCIFNgJIIAUEQCAFIAE2AkwLIAEgBDYCTCAEIAE2AkggBCAGRwRAIAIhBQwDCyABIAc2AlAgDUUEQCAAIAE2AiAMAgsgDSABNgJQDAELIAQoAkwhBAwBCyACIQUgASEGCyAEIAVGDQIgByACIgFHDQALDAELIAQhBgsgBw0BCwsgACgCICIHDQELCyAAKAJUIAAoAlBHIQILIAIEQCMAQSBrIgckACAAKAJUIQEgACgCUCECIAdBywQ2AgggASACRwR/IAIgASAHQQhqIAEgAmtBGG1nQQF0QT5zQQEQtwMgACgCUCECIAAoAlQFIAELIAJHBEADQAJAIAIoAhQiBiACKAIQIgUoAkRGDQAgAiEBIAUoAkAgBkYNAANAAkAgAUEYaiEGIAEoAiwiBSABKAIoIgQoAkRGDQAgBiEBIAQoAkAgBUcNAQsLIAcgAikDEDcDGCAHIAIpAwg3AxAgByACKQMANwMIIAIgBikDEDcDECACIAYpAwg3AwggAiAGKQMANwMAIAYgBykDGDcDECAGIAcpAxA3AwggBiAHKQMINwMAIAIoAhQhBiACKAIQIQULIAAgBSAGIAIQ3AEgAigCECEEIAIoAhQiBSgCRCIGBEAgBiAENgJACyAEKAJAIgEEQCABIAU2AkQLIAUgBDYCRCAFIAE2AkAgBCAGNgJEIAQgBTYCQCAFKAJARQRAIAAgBTYCHAsgBCACKQMAIhA3AyAgBSAQNwMgIAAgBSACQQEQgQIgACACKAIQIAJBARCAAiACQRhqIgIgACgCVEcNAAsLIAdBIGokACAAIAAoAlA2AlQLIA8pAwghEyAAQQA2AiAgACgCHCIBBEADQCABKQMQIRACfwJAIBMgASkDGFEEQCABIBA3AyAgASgCVC0AGEEEcQRAAn8gASgCRCEGAkACQAJAAkACQCABKAJUIgQtABhBA3FFBEAgASgCQCENIAEhAgNAIAIoAkQiAkUNBiACKAJUIARHDQALIAEoAmAEQCAAIAEgAUEQahB+CyACKAJgBEAgACACIAJBEGoQfgsgAiAGRwRAIAFBEGohBQNAIAAgASAGIAUQ3AEgBigCRCIEBEAgBCABNgJACyABKAJAIgcEQCAHIAY2AkQLIAYgATYCRCAGIAc2AkAgASAENgJEIAEgBjYCQCAGKAJARQRAIAAgBjYCHAsgBCIGIAJHDQALCyABKAI8IQYgASgCWC0ACEEBRw0EIAYEQCAAIAEgAiABQRBqEIYBCyAAQRxqIQcgAigCRCIFIAIoAkAiBHJFBEAgAiAAKAIcIgZHDQQLIARFDQEgBCAFNgJEDAILIAEoAjwEQCABIAFBEGoQYxoLIAEpAxggASkDCFENBCABKAI8IgIEQAJAIAIoAgggAUYEQCACQQA2AggMAQsgAkEANgIMCyABQQA2AjwLIAEoAkQiBCABKAJAIgJyRQRAIAEgACgCHEcNBQsCQCACBEAgAiAENgJEDAELIAAgBDYCHAsgBARAIAQgAjYCQAsgARAiIAYMBQsgByAFNgIACyAFBEAgBSAENgJACyACECIgBygCACEGCyABKAJEIgQgASgCQCICckUgASAGR3FFBEACQCACBEAgAiAENgJEDAELIAcgBDYCAAsgBARAIAQgAjYCQAsgARAiCyANQcQAaiAHIA0bKAIADAILIAYEQCAAIAEgAiABQRBqEIYBCyAAQRxqIQcCQCABKAJEIgUgASgCQCIEckUEQCABIAAoAhwiBkcNAQsCQCAEBEAgBCAFNgJEDAELIAcgBTYCAAsgBQRAIAUgBDYCQAsgARAiIAcoAgAhBgsgAigCRCIEIAIoAkAiAXJFIAIgBkdxRQRAAkAgAQRAIAEgBDYCRAwBCyAHIAQ2AgALIAQEQCAEIAE2AkALIAIQIgsgDUHEAGogByANGygCACEGCyAGCwwDCyABKAI8BEAgASABQRBqEGMaCyAAIAEQ/gEgASkDGCABKQMIUg0BIAEgACgCIDYCTCAAIAE2AiAMAQsCQCAQIAEpAwAiEVENACABKQMIIhAgE1EEQCARIRAMAQsgESABKwMoIBMgEH25op78BnwhEAsgASAQNwMgCyABKAJECyIBDQALCwNAIAAoAiAiAUUNAiAAIAEoAkw2AiAgACABELgDDAALAAsgAC0AfUEBRw0CIwBBIGsiCyQAAkACQCAAKAJoIgkgACgCbCINRwRAA0ACf0EAIAkoAgAiBSgCGCIBRQ0AGgNAIAEgASgCEA0BGiABKAIEIgENAAtBAAshAkEAIQMCQCAJKAIEIgQoAhgiAUUNAANAIAEoAhAEQCABIQMMAgsgASgCBCIBDQALCyAEKAIUIQEgBSgCECEGIAUgBDYCECAEIAU2AhQgBiABNgIUIAEgBjYCEAJAAkACQCACIANGBEAgABDbASIHIAY2AhAgBiEBA0AgASAHNgIYIAEoAhAiASAGRw0ACyAHIAIoAhAiASgCGEYEQCACIAkoAgAiATYCECABIAI2AhgLIAAtABlBAUYEQAJAIAEgBygCEBDaAQRAIAIoAhAhAyACIAcoAhA2AhAgByADNgIQIAIoAhAiBiEBA0AgASACNgIYIAEoAhAiASAGRw0ACyADIQEDQCABIAc2AhggASgCECIBIANHDQALIAIhAQwBCyAHKAIQIAIiASgCEBDaAQ0AIAIoAgQhAQsgByABNgIEIAIoAhgiAUUEQEEAIQNBDBAjIgFBADYCCCABQgA3AgAgAiABNgIYIAFBBGohBkEAIQIMAwsgAUEEaiEGIAEoAgQiAyABKAIIIgJPDQIgAyAHNgIAIANBBGohAwwDCyAHIAI2AgQMAwsgA0EANgIQIAAtABlBAUYEQEEAIQYCQCACKAIEIgFFDQADQCABKAIQBEAgASEGDAILIAEoAgQiAQ0ACwsgAiAGNgIEIAIhAQNAIAEoAgQiAUEAIAEgA0cbDQALIAEEQCACIAMoAgQ2AgQLIAMgAjYCBCADKAIYRQ0DIwBBIGsiCCQAIAIoAhhFBEBBDBAjIgFBADYCCCABQgA3AgAgAiABNgIYCwJAAkAgAygCGCIHKAIAIgQgBygCBEcEQANAIAQoAgAiASACRwRAAkAgAigCGCIKKAIEIgUgCigCCCIGSQRAIAUgATYCACAFQQRqIQYMAQsgBSAKKAIAIgFrQQJ1IgVBAWoiB0GAgICABE8NBCAIQQxqQf////8DIAYgAWsiBkEBdSIBIAcgASAHSxsgBkH8////B08bIAUgChBKIQcgCCgCFCIBIAQoAgA2AgAgCCABQQRqNgIUIAgoAhAgCigCBCAKKAIAIgFrIgVrIQYgBQRAIAYgASAF/AoAAAsgCigCACEFIAogBjYCACAIIAU2AhAgCiAIKAIUIgY2AgQgCCAFNgIUIAooAgghASAKIAgoAhg2AgggCCABNgIYIAcgBTYCACAHEFMgAygCGCEHCyAKIAY2AgQLIARBBGoiBCAHKAIERw0ACyAHKAIAIQQLIAcgBDYCBCAIQSBqJAAMAQsQJgALDAMLIAMgAjYCBAwCCyADIAEoAgAiA2tBAnUiBEEBaiIFQYCAgIAETw0EIAtBDGpB/////wMgAiADayIDQQF1IgIgBSACIAVLGyADQfz///8HTxsgBCABEEohBSALKAIUIgIgBzYCACALIAJBBGo2AhQgCygCECAGKAIAIAEoAgAiAmsiBGshAyAEBEAgAyACIAT8CgAACyABKAIAIQQgASADNgIAIAsgBDYCECAGIAsoAhQiAzYCACALIAQ2AhQgASgCCCECIAEgCygCGDYCCCALIAI2AhggBSAENgIAIAUQUwsgBiADNgIACyAJQQhqIgkgDUcNAAsLIAtBIGokAAwBCxAmAAsgAC0AfSEDDAILIAAtAH1BAUYNAAsLIA9BEGokACADQQFxC44CAgJ/BX4CQCABKAJEIgRFDQAgASgCPEUNACAEKAI8RQ0AIAEpAxgiByABKQMIIghRDQAgBCkDGCIJIAQpAwgiClENACABKAJYLQAIDQAgBCgCWC0ACA0AIAIpAwgiBiAHQgJ8WSAGIAlCAnxZcUUgBiAIUyAGIApTcnENAAJAIAMEQCACIAQgBEEQahC8A0RmZmZmZmbWP2RFDQEMAgsgASkDICAEKQMgUg0BCyABQRBqIAIgBEEQahC+AkUNAAJAIAEoAjwoAgAiAyAEKAI8KAIAIgVGBEAgACABIAQgAhCGAQwBCyADIAVJBEAgASAEEJoBDAELIAQgARCaAQsgAUECNgJgIARBATYCYAsLjgICAn8FfgJAIAEoAkAiBEUNACABKAI8RQ0AIAQoAjxFDQAgASkDGCIHIAEpAwgiCFENACAEKQMYIgkgBCkDCCIKUQ0AIAEoAlgtAAgNACAEKAJYLQAIDQAgAikDCCIGIAdCAnxZIAYgCUICfFlxRSAGIAhTIAYgClNycQ0AAkAgAwRAIAIgBCAEQRBqELwDRAAAAAAAANA/ZEUNAQwCCyABKQMgIAQpAyBSDQELIAFBEGogAiAEQRBqEL4CRQ0AAkAgASgCPCgCACIDIAQoAjwoAgAiBUYEQCAAIAQgASACEIYBDAELIAMgBUkEQCABIAQQmgEMAQsgBCABEJoBCyAEQQI2AmAgAUEBNgJgCwujAQACQCAAIABBAWtxDQACQAJAAkACQAJAIABoDgcAAQIFBQMEBQtBEBB0QboVELIBQdSaAkGzBBALAAtBEBB0QeMfELIBQdSaAkGzBBALAAtBEBB0QagTELIBQdSaAkGzBBALAAtBEBB0QZ4fELIBQdSaAkGzBBALAAtBEBB0QeAVELIBQdSaAkGzBBALAAtBEBB0QYAOELIBQdSaAkGzBBALAAu3AQEGfyMAQRBrIgMkACAAQZibAjYCACAAQQhqIgQQhAIgACgCICICBEAgACACNgIkIAAoAigaIAIQIgsgAyAENgIMIAMoAgwiBCgCACICBEAgAiIBIAQiBigCBCIFRwRAA0AgBUEEayIFKAIAIQEgBUEANgIAIAEEQCABIAEoAgAoAgQRAAALIAIgBUcNAAsgAygCDCIGKAIAIQELIAQgAjYCBCAGKAIIGiABECILIANBEGokACAAC1cBA38gACgCBCICIAAoAgAiA2tBAnUEQCACIANHBEADQCACQQRrIgIoAgAhASACQQA2AgAgAQRAIAEgASgCACgCBBEAAAsgAiADRw0ACwsgACADNgIECwv6AgEBfEQAAAAAAPiPQCAAKwMQIAErAxAiAqEgASsDKCACoaNEAAAAAAAAkECiIgJEAAAAAAAAAAAgAkQAAAAAAAAAAGQbIgIgAkQAAAAAAPiPQGQb/ANBgYAEbEH/gYD4AHFBgQJsQY/gg/gAcUERbEHD4bCYBHFBBWxByaSSyQRxRAAAAAAA+I9AIAArAwggASsDCCICoSABKwMgIAKho0QAAAAAAACQQKIiAkQAAAAAAAAAACACRAAAAAAAAAAAZBsiAiACRAAAAAAA+I9AZBv8A0GBgARsQf+BgPgAcUGBAmxBj+CD+ABxQRFsQcPhsJgEcUEKbEGSyaSSeXFEAAAAAAD4j0AgACsDACABKwMAIgKhIAErAxggAqGjRAAAAAAAAJBAoiICRAAAAAAAAAAAIAJEAAAAAAAAAABkGyICIAJEAAAAAAD4j0BkG/wDQYGABGxB/4GAGHFBgQJsQY/ggxhxQRFsQcPhsBhxQRRsQaSSyaQCcXJyCz4BAn8gACgCBCICIAFHBEADQCACQQRrIgIoAgAhAyACQQA2AgAgAwRAIAMQdQsgASACRw0ACwsgACABNgIEC5wCAQV/IwBBIGsiBSQAIAAoAgQgACgCACICa0HIAG0iBEEBaiIDQeTxuBxPBEAQJgALIAVBDGpB4/G4HCAAKAIIIAJrQcgAbSICQQF0IgYgAyADIAZJGyACQfG4nA5PGyAEIAAQ3QIiAygCCCICIAEoAgA2AgAgAkEIakEAQTj8CwAgAkEANgJEIAIgAi0AQEHgAXE6AEAgAyACQcgAajYCCCAAKAIAIgEgACgCBCICIAMoAgQgAiABa0G4f21ByABsaiICENwCIAAoAgAhASAAIAI2AgAgAyABNgIEIAAgAygCCCICNgIEIAMgATYCCCAAKAIIIQQgACADKAIMNgIIIAMgATYCACADIAQ2AgwgAxDbAiAFQSBqJAAgAgvDHgEIfyMAQRBrIgokACAAIAAoAgAQgQQgAEEANgIQIABBDGoiBxCDASAAQQA2AiAgAEEcaiIIEC0gAEEANgIwIABBLGoiCRAtIABBADYCQCAAQTxqEC0gAEEANgJQIABBzABqEC0jAEEgayIMJAAgACgCCCAAKAIAIgVrQcgAbUEESQRAIAxBDGpBBCAAKAIEIAVrQcgAbSAAEN0CIQUgACgCACIGIAAoAgQiCyAFKAIEIAsgBmtBuH9tQcgAbGoiCxDcAiAAKAIAIQYgACALNgIAIAUgBjYCBCAAIAUoAgg2AgQgBSAGNgIIIAAoAgghCyAAIAUoAgw2AgggBSAGNgIAIAUgCzYCDCAFENsCCyAMQSBqJAAgB0EMEDkCfyAAKAIQIgYgACgCFCIFTwRAIAcgBUEBdEGAASAFGxA5IAAoAgwgACgCECIGQQR0agwBCyAHKAIAIAZBBHRqCyIFQQA2AgAgBUIGNwIIIAUgAjYCBCAAIAZBAWo2AhACQCAAKAIgIgUgACgCJCIGTwRAIAggBkEBdEGAASAGGxAlIAAoAhwgACgCICIFQQJ0akEANgIADAELIAgoAgAgBUECdGpBADYCAAsgACAFQQFqNgIgAkAgACgCMCIFIAAoAjQiBk8EQCAJIAZBAXRBgAEgBhsQJSAAKAIsIAAoAjAiBUECdGpBATYCAAwBCyAJKAIAIAVBAnRqQQE2AgALIAAgBUEBajYCMAJAIAAoAhAiBSAAKAIUIgZPBEAgByAGQQF0QYABIAYbEDkgACgCDCAAKAIQIgVBBHRqIgZBADYCAAwBCyAHKAIAIAVBBHRqIgZBADYCAAsgBkIJNwIIIAYgAzYCBCAAIAVBAWo2AhACQCAAKAIgIgUgACgCJCIGTwRAIAggBkEBdEGAASAGGxAlIAAoAhwgACgCICIFQQJ0akEANgIADAELIAgoAgAgBUECdGpBADYCAAsgACAFQQFqNgIgAkAgACgCMCIFIAAoAjQiBk8EQCAJIAZBAXRBgAEgBhsQJSAAKAIsIAAoAjAiBUECdGpBAjYCAAwBCyAJKAIAIAVBAnRqQQI2AgALIAAgBUEBajYCMAJAIAAoAhAiBSAAKAIUIgZPBEAgByAGQQF0QYABIAYbEDkgACgCDCAAKAIQIgVBBHRqIgZBADYCAAwBCyAHKAIAIAVBBHRqIgZBADYCAAsgBkIDNwIIIAYgATYCBCAAIAVBAWo2AhACQCAAKAIgIgUgACgCJCIGTwRAIAggBkEBdEGAASAGGxAlIAAoAhwgACgCICIFQQJ0akEANgIADAELIAgoAgAgBUECdGpBADYCAAsgACAFQQFqNgIgAkAgACgCMCIFIAAoAjQiBk8EQCAJIAZBAXRBgAEgBhsQJSAAKAIsIAAoAjAiBUECdGpBADYCAAwBCyAJKAIAIAVBAnRqQQA2AgALIAAgBUEBajYCMAJAIAAoAhAiBSAAKAIUIgZPBEAgByAGQQF0QYABIAYbEDkgACgCDCAAKAIQIgVBBHRqIgZBADYCAAwBCyAHKAIAIAVBBHRqIgZBADYCAAsgBkICNwIIIAYgAzYCBCAAIAVBAWo2AhACQCAAKAIgIgUgACgCJCIGTwRAIAggBkEBdEGAASAGGxAlIAAoAhwgACgCICIFQQJ0akEBNgIADAELIAgoAgAgBUECdGpBATYCAAsgACAFQQFqNgIgAkAgACgCMCIFIAAoAjQiBk8EQCAJIAZBAXRBgAEgBhsQJSAAKAIsIAAoAjAiBUECdGpBBDYCAAwBCyAJKAIAIAVBAnRqQQQ2AgALIAAgBUEBajYCMAJAIAAoAhAiBSAAKAIUIgZPBEAgByAGQQF0QYABIAYbEDkgACgCDCAAKAIQIgVBBHRqIgZBADYCAAwBCyAHKAIAIAVBBHRqIgZBADYCAAsgBkILNwIIIAYgBDYCBCAAIAVBAWo2AhACQCAAKAIgIgUgACgCJCIGTwRAIAggBkEBdEGAASAGGxAlIAAoAhwgACgCICIFQQJ0akEBNgIADAELIAgoAgAgBUECdGpBATYCAAsgACAFQQFqNgIgAkAgACgCMCIFIAAoAjQiBk8EQCAJIAZBAXRBgAEgBhsQJSAAKAIsIAAoAjAiBUECdGpBBTYCAAwBCyAJKAIAIAVBAnRqQQU2AgALIAAgBUEBajYCMAJAIAAoAhAiBSAAKAIUIgZPBEAgByAGQQF0QYABIAYbEDkgACgCDCAAKAIQIgVBBHRqIgZBADYCAAwBCyAHKAIAIAVBBHRqIgZBADYCAAsgBkIHNwIIIAYgATYCBCAAIAVBAWo2AhACQCAAKAIgIgUgACgCJCIGTwRAIAggBkEBdEGAASAGGxAlIAAoAhwgACgCICIFQQJ0akEBNgIADAELIAgoAgAgBUECdGpBATYCAAsgACAFQQFqNgIgAkAgACgCMCIFIAAoAjQiBk8EQCAJIAZBAXRBgAEgBhsQJSAAKAIsIAAoAjAiBUECdGpBAzYCAAwBCyAJKAIAIAVBAnRqQQM2AgALIAAgBUEBajYCMAJAIAAoAhAiBSAAKAIUIgZPBEAgByAGQQF0QYABIAYbEDkgACgCDCAAKAIQIgVBBHRqIgZBADYCAAwBCyAHKAIAIAVBBHRqIgZBADYCAAsgBkIANwIIIAYgATYCBCAAIAVBAWo2AhACQCAAKAIgIgEgACgCJCIFTwRAIAggBUEBdEGAASAFGxAlIAAoAhwgACgCICIBQQJ0akECNgIADAELIAgoAgAgAUECdGpBAjYCAAsgACABQQFqNgIgAkAgACgCMCIBIAAoAjQiBU8EQCAJIAVBAXRBgAEgBRsQJSAAKAIsIAAoAjAiAUECdGpBBzYCAAwBCyAJKAIAIAFBAnRqQQc2AgALIAAgAUEBajYCMAJAIAAoAhAiASAAKAIUIgVPBEAgByAFQQF0QYABIAUbEDkgACgCDCAAKAIQIgFBBHRqIgVBADYCAAwBCyAHKAIAIAFBBHRqIgVBADYCAAsgBUIFNwIIIAUgBDYCBCAAIAFBAWo2AhACQCAAKAIgIgEgACgCJCIFTwRAIAggBUEBdEGAASAFGxAlIAAoAhwgACgCICIBQQJ0akECNgIADAELIAgoAgAgAUECdGpBAjYCAAsgACABQQFqNgIgAkAgACgCMCIBIAAoAjQiBU8EQCAJIAVBAXRBgAEgBRsQJSAAKAIsIAAoAjAiAUECdGpBCDYCAAwBCyAJKAIAIAFBAnRqQQg2AgALIAAgAUEBajYCMAJAIAAoAhAiASAAKAIUIgVPBEAgByAFQQF0QYABIAUbEDkgACgCDCAAKAIQIgFBBHRqIgVBADYCAAwBCyAHKAIAIAFBBHRqIgVBADYCAAsgBUIKNwIIIAUgAjYCBCAAIAFBAWo2AhACQCAAKAIgIgEgACgCJCIFTwRAIAggBUEBdEGAASAFGxAlIAAoAhwgACgCICIBQQJ0akECNgIADAELIAgoAgAgAUECdGpBAjYCAAsgACABQQFqNgIgAkAgACgCMCIBIAAoAjQiBU8EQCAJIAVBAXRBgAEgBRsQJSAAKAIsIAAoAjAiAUECdGpBBjYCAAwBCyAJKAIAIAFBAnRqQQY2AgALIAAgAUEBajYCMAJAIAAoAhAiASAAKAIUIgVPBEAgByAFQQF0QYABIAUbEDkgACgCDCAAKAIQIgFBBHRqIgVBADYCAAwBCyAHKAIAIAFBBHRqIgVBADYCAAsgBUIBNwIIIAUgAjYCBCAAIAFBAWo2AhACQCAAKAIgIgIgACgCJCIBTwRAIAggAUEBdEGAASABGxAlIAAoAhwgACgCICICQQJ0akEDNgIADAELIAgoAgAgAkECdGpBAzYCAAsgACACQQFqNgIgAkAgACgCMCICIAAoAjQiAU8EQCAJIAFBAXRBgAEgARsQJSAAKAIsIAAoAjAiAkECdGpBCjYCAAwBCyAJKAIAIAJBAnRqQQo2AgALIAAgAkEBajYCMAJAIAAoAhAiAiAAKAIUIgFPBEAgByABQQF0QYABIAEbEDkgACgCDCAAKAIQIgJBBHRqIgFBADYCAAwBCyAHKAIAIAJBBHRqIgFBADYCAAsgAUIINwIIIAEgBDYCBCAAIAJBAWo2AhACQCAAKAIgIgQgACgCJCIBTwRAIAggAUEBdEGAASABGxAlIAAoAhwgACgCICIEQQJ0akEDNgIADAELIAgoAgAgBEECdGpBAzYCAAsgACAEQQFqNgIgAkAgACgCMCIEIAAoAjQiAU8EQCAJIAFBAXRBgAEgARsQJSAAKAIsIAAoAjAiBEECdGpBCzYCAAwBCyAJKAIAIARBAnRqQQs2AgALIAAgBEEBajYCMAJAIAAoAhAiBCAAKAIUIgFPBEAgByABQQF0QYABIAEbEDkgACgCDCAAKAIQIgRBBHRqIgFBADYCAAwBCyAHKAIAIARBBHRqIgFBADYCAAsgAUIENwIIIAEgAzYCBCAAIARBAWo2AhACQCAAKAIgIgEgACgCJCICTwRAIAggAkEBdEGAASACGxAlIAAoAhwgACgCICIBQQJ0akEDNgIADAELIAgoAgAgAUECdGpBAzYCAAsgACABQQFqNgIgAkAgACgCMCIBIAAoAjQiAk8EQCAJIAJBAXRBgAEgAhsQJSAAKAIsIAAoAjAiAUECdGpBCTYCAAwBCyAJKAIAIAFBAnRqQQk2AgALIAAgAUEBajYCMCAKQQA2AgwgAAJ/IAAoAgQiASAAKAIISQRAIAFBADYCACABQQhqQQBBOPwLACABQQA2AkQgASABLQBAQeABcToAQCABQcgAagwBCyAAIApBDGoQhwILIgE2AgQgCkEDNgIMIAACfyAAKAIIIAFLBEAgAUEDNgIAIAFBCGpBAEE4/AsAIAFBADYCRCABIAEtAEBB4AFxOgBAIAFByABqDAELIAAgCkEMahCHAgsiATYCBCAKQQY2AgwgAAJ/IAAoAgggAUsEQCABQQY2AgAgAUEIakEAQTj8CwAgAUEANgJEIAEgAS0AQEHgAXE6AEAgAUHIAGoMAQsgACAKQQxqEIcCCyIBNgIEIApBCTYCDCAAAn8gACgCCCABSwRAIAFBCTYCACABQQhqQQBBOPwLACABQQA2AkQgASABLQBAQeABcToAQCABQcgAagwBCyAAIApBDGoQhwILNgIEIApBEGokAAtKAQd/QQQQIyIDIAI2AgBBBBAjIgQgAjYCAEGI8AEgAUGQ6wEiAUEAIQJB1iVBASEFQcEBIAMgASACQdolaiAFQcEBaiAEEAogAAvaCAMKfwJ+An0jAEEwayIGJAAgBiAAKAIEIAAoAgBrQQR1Igk2AhwgBkJ/NwIUIAYgAjYCECAGIAE2AgwgBiABrSACrUIghoQiDTcDKEEAIQIjAEEQayIIJAACQCAAQRhqIgcoAgQiBEUNACAHKAIMRQ0AIAggBikDKCIONwMIIAhBCGpBCBD3ASEFIAcoAgACfyAFIARBAWtxIARpIgNBAU0NABogBSAEIAVLDQAaIAUgBHALIgpBAnRqKAIAIgFFDQAgASgCACIBRQ0AIARBAWshCyADQQFLIQwDQAJAIAUgASgCBCIDRwRAAkAgDEUEQCADIAtxIQMMAQsgAyAESQ0AIAMgBHAhAwsgAyAKRw0DDAELIAEpAwggDlINACABIQIMAgsgASgCACIBDQALCyAIQRBqJAACQAJAIAJFDQAgAigCECIDIAIoAhQiAUYNACAGIAFBBGsiASgCACIENgIUIAAoAgAgBEEEdGogCTYCCCACIAE2AhQgASADRw0BIwBBEGsiAyQAIAIoAgAaIANBBGogByACEMIEIAMoAgQhASADQQA2AgQgAQRAAkACQCADLQAMQQFGBEAgASgCECICRQ0BIAEgAjYCFCABKAIYGiACECIMAQsgAUUNAQsgARAiCwsgA0EQaiQADAELIAYgDUIgiTcDACAGIAY2AiRBACECIwBBEGsiCCQAIAggBikDACINNwMIIAhBCGpBCBD3ASEBIAYCfwJAIAcoAgQiBEUNACAHKAIAAn8gBEEBayABcSAEaSIFQQFNDQAaIAEgASAESQ0AGiABIARwCyICQQJ0aigCACIDRQ0AIAMoAgAiA0UNACAEQQFrIQkgBUEBSyEKA0ACQCABIAMoAgQiBUcEQAJAIApFBEAgBSAJcSEFDAELIAQgBUsNACAFIARwIQULIAIgBUcNAwwBCyADKQMIIA1SDQBBAAwDCyADKAIAIgMNAAsLQSAQIyIDIAE2AgQgA0EANgIAIAYoAiQpAwAhDSADQQA2AhggA0IANwMQIAMgDTcDCAJAQQAgBCAHKAIMQQFqsyIPIAcqAhAiECAEs5ReGw0AIAcgBCAEQQFrcUEARyAEQQNJciAEQQF0ciICIA8gEJWN/AEiBCACIARLGxBwIAcoAgQiBCAEQQFrIgJxRQRAIAEgAnEhAgwBCyABIARJBEAgASECDAELIAEgBHAhAgsCQCAHKAIAIgkgAkECdGoiAigCACIBRQRAIAMgBygCCDYCACAHIAM2AgggAiAHQQhqNgIAIAMoAgAiAUUNASABKAIEIQUCQCAEIARBAWsiAXFFBEAgASAFcSEFDAELIAQgBUsNACAFIARwIQULIAkgBUECdGogAzYCAAwBCyADIAEoAgA2AgAgASADNgIACyAHIAcoAgxBAWo2AgxBAQs6ACwgBiADNgIoIAhBEGokACAGKAIoQRBqIAZBHGoQPQsgACAGQQxqEOMEIAZBMGokAAsbACAABEAgACgCABCLAiAAKAIEEIsCIAAQIgsLmAIBBX8jAEEgayIGJAACQAJAIAAoAgQiAiAAKAIIIgNJBEAgAiABQcAA/AoAACACQUBrIQEMAQsgAiAAKAIAIgRrQQZ1IgVBAWoiAkGAgIAgTw0BIAZBDGpB////HyADIARrIgNBBXUiBCACIAIgBEkbIANBwP///wdPGyAFIAAQqQEiAigCCCIFIAFBwAD8CgAAIAIoAgQgACgCBCAAKAIAIgNrIgFrIQQgAQRAIAQgAyAB/AoAAAsgACgCACEDIAAgBDYCACACIAM2AgQgACAFQUBrIgE2AgQgAiADNgIIIAAoAgghBCAAIAIoAgw2AgggAiADNgIAIAIgBDYCDCACEKkCCyAAIAE2AgQgBkEgaiQADwsQJgALjgECAn8BfCMAQRBrIgIkAEH4ngItAABBAXFFBEBBAkHciwJBAxAGIQNB+J4CQQE6AABB9J4CIAM2AgALIAIgASkCADcDCCACQQA2AgRB9J4CKAIAQQBBACACQQRqIAJBCGoQBSEEIAIoAgQhASAAIAT8AzYCBCAAQZygAjYCACABBEAgARAECyACQRBqJAALrAICBn8BfiMAQTBrIgIkAEGoAhAjIgNBoJACNgIAIANCADcCBCADQRBqEDshBCACIAM2AiggAiAENgIkIAEoAgQiBiABKAIAIgVrIgNBGG0hB0EAIQECQCAFIAZGDQAgAxAnIQEgA0UNACABIAUgA/wKAAALIAIgBzYCICACIAE2AhwgBCACQRxqQQAQ/gMgAQRAIAEQIgsgAkEMaiACQSRqEFkgAiACKQIMIgg3AhQgAkIANwIMIAIgCDcDACAAIAIQQwJAIAIoAhAiAEUNACAAIAAoAgQiAUEBazYCBCABDQAgACAAKAIAKAIIEQAAIAAQJAsCQCACKAIoIgBFDQAgACAAKAIEIgFBAWs2AgQgAQ0AIAAgACgCACgCCBEAACAAECQLIAJBMGokAAuwAgICfwF+IwBBMGsiAiQAIAJBJGogAUEAECsQKgJAIAIoAiQiAygCRCIBBEAgACABEEYMAQtBqAIQIyIBQaCQAjYCACABQgA3AgQgAUEQaiADEDchAyACIAE2AiAgAiADNgIcIAMQjgEgAxBaIAJBDGogAkEcahBZIAIgAikCDCIENwIUIAJCADcCDCACIAQ3AwAgACACEEMCQCACKAIQIgBFDQAgACAAKAIEIgFBAWs2AgQgAQ0AIAAgACgCACgCCBEAACAAECQLIAIoAiAiAEUNACAAIAAoAgQiAUEBazYCBCABDQAgACAAKAIAKAIIEQAAIAAQJAsCQCACKAIoIgBFDQAgACAAKAIEIgFBAWs2AgQgAQ0AIAAgACgCACgCCBEAACAAECQLIAJBMGokAAtaAQN/IwBBEGsiASQAIAFBCGogAEEAECsQKiABKAIIKAJMAkAgASgCDCIARQ0AIAAgACgCBCIDQQFrNgIEIAMNACAAIAAoAgAoAggRAAAgABAkCyABQRBqJAAL6AEBBn8CQCAAIAFHBEAgBSgCACEFA0AgAiADRgRAIAAgAUYNAwNAIAQgACgCADYCACAEQQRqIQQgAEEEaiIAIAFHDQALDAMLAkACQAJAIAUgAigCACIGQQR0aiIHKAIEIgggBSAAKAIAIglBBHRqIgooAgQiC0YEQCAHKAIAIAooAgBIDQEMAgsgCCALTg0BCyAEIAY2AgAgAkEEaiECDAELIAQgCTYCACAAQQRqIQALIARBBGohBCAAIAFHDQALCyACIANGDQADQCAEIAIoAgA2AgAgBEEEaiEEIAJBBGoiAiADRw0ACwsLXQEBfwJAIAAgAUYNACAAKAIAIgIEQCACECILIABCADcCACAAIAEoAgQiAjYCCCAAIAI2AgQgAkUNACAAIAJBA3QiABAnIgI2AgAgAEUNACACIAEoAgAgAPwKAAALC+0BAQV/IwBBEGsiAiQAIAAoAkwhBCACQQA2AgggAkIANwIAIAIgBEEAEDEgACgCXCIDBEADQCAAKAJYIAFBAnRqKAIAIgVBAE4EQCACKAIAIAVBAnRqQQE2AgALIAFBAWoiASADRw0ACwsgAigCACEDIAQEQCAAKAJIIQVBACEBA0AgAyABQQJ0aigCAEUEQCAFIAFBGGxqIgBCgICAgICAgPz/ADcDECAAQoCAgICAgID8/wA3AwggAEKAgICAgICA/P8ANwMACyABQQFqIgEgBEcNAAsgAigCACEDCyADBEAgAxAiCyACQRBqJAAL4gcCDX8LfCMAQUBqIgUkACAAKAJMIQIgBUIANwM4IAVCADcDMCAFQgA3AyggBUIANwMAIAVCADcDCCAFQgA3AxAgAEGYAWogAiAFEGcgBUEcaiAAKAJMEOwBIQYgACgCTCICBEADQCAGKAIAIAFBAnRqQf////8HNgIAIAFBAWoiASACRw0ACwsgACgCXCIDBEADQEH/////ByECAkAgACgCWCAEQQJ0aigCACIHQQBIDQADQCAGKAIAIAdBAnRqIgEgBCABKAIAIgEgASACRiICGzYCACACDQEgASICIARODQALCyAEQQFqIgQgA0cNAAsLIAAoAkwiCQRAQQAhAgNARAAAAAAAAAAAIQ5EAAAAAAAAAAAhEkQAAAAAAAAAACEQIAYoAgAgAkECdGooAgAiBCEBAkAgBEH/////B0YEQCAAKAKYASACQRhsaiIBQgA3AxAgAUIANwMIIAFCADcDAAwBCwNAQX5BAUF+QQEgACgCaCABQQJ0aigCACIBQQNvQQJGGyABaiIBIAFBA20iCkEDbGtBAkYbIgcgAWoiC0EDbyEMAkAgACgCSCIDIAAoAlgiDSABQQJ0aiIIIAdBAnRqKAIAQRhsaiIHKwMAIAMgCCgCAEEYbGoiCCsDACIRoSIPIA8gD6IgBysDCCAIKwMIIhOhIg8gD6KgIAcrAxAgCCsDECIUoSIVIBWioJ8iFqMiF71C////////////AINC//////////f/AFYNACARIAMgDUF4QQQgDEECRhtqIAtBAnRqKAIAQRhsaiIDKwMAoSIRIBEgEaIgEyADKwMIoSIRIBGioCAUIAMrAxChIhMgE6KgnyIUoyIYvUL///////////8Ag0KAgICAgICA+P8AWg0AIA4CfEQAAAAAAAAAACAVIBajIBMgFKOiIA8gFqMgESAUo6IgFyAYokQAAAAAAAAAAKCgoCIORAAAAAAAAPC/ZQ0AGkQYLURU+yEJQCAORAAAAAAAAPA/Zg0AGiAOmhBdCyIPIAAoAqgBIApBGGxqIgMrAxCioCEOIBIgDyADKwMIoqAhEiAQIA8gAysDAKKgIRALIAEgBEcNAAsgACgCmAEgAkEYbGoiASAOIA4gDqIgEiASoiAQIBCioKCfIg6jRAAAAAAAAAAAIBAgDqMiEL1C////////////AINCgICAgICAgPj/AFQiBBs5AxAgASASIA6jRAAAAAAAAAAAIAQbOQMIIAEgEEQAAAAAAAAAACAEGzkDAAsgAkEBaiICIAlHDQALCyAGKAIAIgAEQCAGIAA2AgQgBigCCBogABAiCyAFQUBrJAALgAEBBH8gACgCBCIDIAFBAXRLIANBEEtxAkAgASADTQ0AIAAgARA5IAEgACgCBCIDayIEQQBMDQAgACgCACADQQR0aiEDA0AgAyACKQIINwIIIAMgAikCADcCACADQRBqIQMgBEEBSyAEQQFrIQQNAAsLIAAgATYCBARAIAAQgwELCz4AIAMEQCAAIAMQ8gEgACgCBCEDIAEgAkcEQANAIAMgARAuQRhqIQMgAUEYaiIBIAJHDQALCyAAIAM2AgQLC4gBAQl8IAErAzAhBiABKwMAIQcgASsDGCEIIAErAzghCSABKwMIIQogASsDICELIAAgAisDACIDIAErAxCiIAIrAwgiBCABKwMooqAgAisDECIFIAErA0CioDkDECAAIAMgCqIgBCALoqAgBSAJoqA5AwggACADIAeiIAQgCKKgIAUgBqKgOQMAC0oBAn8gACgCBCICIAAoAggiAUcEQANAIAAgAUEQayIBNgIIIAEQLxogAiAAKAIIIgFHDQALCyAAKAIAIgEEQCAAKAIMGiABECILCzABAn8jAEGgAmsiASQAIAFBCGoQOyICQQ42AkQgACACEO8BIAIQOhogAUGgAmokAAt3AQF/IwBBMGsiAyQAIANBGGogASACEJcCIAMgASACQRhqEJcCIABBMGogASACQTBqEJcCIAAgAykDKDcDECAAIAMpAyA3AwggACADKQMYNwMAIAAgAykDADcDGCAAIAMpAwg3AyAgACADKQMQNwMoIANBMGokAAuMAQECfyAAIAEoAgA2AgACQAJAIAEoAgQiAkUEQCAAQQA2AgQMAQsgAigCBCEBA0ACQCABQX9GBEBBACECDAELIAIgAUEBaiACKAIEIgMgASADRiIBGzYCBCABDQAgAyEBDAELCyAAIAI2AgQgAg0BC0EEEHQiAEG05gE2AgAgAEHA5gFBvQMQCwALIAALUgEBfyAAQQA2AgggAEIANwIAIAEEQCAAIAEQowIgACgCBCECIAFBDGxBDGsiASABQQxwa0EMaiIBBEAgAkEAIAH8CwALIAAgASACajYCBAsgAAs4AQF/IAAEQCAAKAIAEJ0CIAAoAgQQnQIgACgCGCIBBEAgACABNgIcIAAoAiAaIAEQIgsgABAiCwvlAgEKfyAAIQYgAigCGCEHIAIoAhAhCCACKAIIIQkgAigCACEKAkAgAQRAIABFDQEgAS0AEEEBcQ0BQQAhAgNAIAJBAWoiAkGACEYEQEEAIQIgAS0AEA0DCyAJIANBAnQiBGooAgAiAARAIAAgAEEfdSIFcyAFayELIAQgCGohDCAHIANBGGxqIQRBACEAA0AgCiAMKAIAQRhsaiAAQRhsaiIFIAQpAxA3AxAgBSAEKQMINwMIIAUgBCkDADcDACAAQQFqIgAgC0cNAAsLIANBAWoiAyAGRw0ACwwBCyAARQ0AA0AgCSADQQJ0IgFqKAIAIgAEQCAAIABBH3UiAnMgAmshBCABIAhqIQUgByADQRhsaiEBQQAhAANAIAogBSgCAEEYbGogAEEYbGoiAiABKQMQNwMQIAIgASkDCDcDCCACIAEpAwA3AwAgAEEBaiIAIARHDQALCyADQQFqIgMgBkcNAAsLC4OPAQQjfyF8AX4CfSMAQaAIayIFJAAgASgCkAEhBiAFQQA6AIQGIAVBADYCgAYgBSAGNgL8BQJAIAEoAgAiAygCRARAIAAQOyABKAIAKAJENgJEDAELIAEoAgQiBCgCRARAIAAQOyABKAIEKAJENgJEDAELIAQoAlwhCCADKAJcQQJNBEAgAiAIQQNJckUEQCAAIAQQNxoMAgsgABA7GgwBCyAIQQJNBEAgAkECRgRAIAAQOxoMAgsgACADEDcaDAELIAUgATYC9AUgBSAFQfwFajYC+AUCQAJAIAZFBEAgBUEBNgKABgwBCyAGIAYoAgxBAWo2AgwgASgCkAEhAyAFQQE2AoAGIANFDQAgAy0AEEEBRw0AIAVBiAZqEDsiA0EONgJEIAVB0ANqIANByAD8CgAAIAUgAygCSDYCmAQgBSADKAJMNgKcBCAFIAMoAlA2AqAEIANBADYCUCADQgA3A0ggBSADKAJkNgK0BCADQQA2AmQgBSADKAJYNgKoBCAFIAMoAlw2AqwEIAUgAygCYDYCsAQgA0EANgJgIANCADcDWCAFIAMoAnQ2AsQEIANBADYCdCAFIAMoAmg2ArgEIAUgAygCbDYCvAQgBSADKAJwNgLABCADQQA2AnAgA0IANwNoIAUgAygChAE2AtQEIANBADYChAEgBSADKAJ4NgLIBCAFIAMoAnw2AswEIAUgAygCgAE2AtAEIANBADYCgAEgA0IANwN4IAUgAygCiAE2AtgEIAUgAygCjAE2AtwEIAUgAygCkAE2AuAEIANBADYCkAEgA0IANwOIASAFIAMoApgBNgLoBCAFIAMoApwBNgLsBCAFIAMoAqABNgLwBCADQQA2AqABIANCADcDmAEgBSADKAKoATYC+AQgBSADKAKsATYC/AQgBSADKAKwATYCgAUgA0EANgKwASADQgA3A6gBIAUgAygCuAE2AogFIAUgAygCvAE2AowFIAUgAygCwAE2ApAFIANBADYCwAEgA0IANwO4ASAFIAMoAsgBNgKYBSAFIAMoAswBNgKcBSAFIAMoAtABIgY2AqAFIAUgAygC1AEiCDYCpAUgBUGgBWohBAJAIAhFBEAgBSAENgKcBQwBCyAGIAQ2AgggA0IANwPQASADIANB0AFqNgLMAQsgBSADKALYATYCqAUgBSADKALcATYCrAUgBSADKALgATYCsAUgA0EANgLgASADQgA3A9gBIAUgAygC6AE2ArgFIAUgAygC7AE2ArwFIAUgAygC8AE2AsAFIANBADYC8AEgA0IANwPoASAFIAMoAvgBNgLIBSAFIAMoAvwBNgLMBSAFIAMoAoACNgLQBSADQQA2AoACIANCADcD+AEgBSADKAKIAjYC2AUgBSADKAKMAjYC3AUgBSADKAKQAjYC4AUgA0EANgKQAiADQgA3A4gCIAVBAToA6AUgAxA6GiAFLQDoBUEBRw0AIAAgBUHQA2oiABA3GiAFLQDoBUEBRw0BIAAQOhoMAQsgAS0AjAFFBEAgABA7QQw2AkQMAQtBf0EBIAJBAkcbIQYgASgCICEDIAVBADYCyAMgBUIANwLAAyAFQcADaiADECUgBSADNgLEAyABKAJQIQMgBUEANgK4AyAFQgA3ArADIAVBsANqIAMQJSAFIAM2ArQDIAEoAnAhAyAFQQA2AqgDIAVCADcCoAMgBUGgA2ogAxAlIAUgAzYCpAMgASgCgAEhAyAFQQA2ApgDIAVCADcCkAMgBUGQA2ogAxAlIAUgAzYClAMgASgCICIDBEAgASgCHCIEIANBAnRqIQggBSgCwAMhAwNAIAMgBCgCACAGbDYCACADQQRqIQMgBEEEaiIEIAhHDQALCyABKAJQIgMEQCABKAJMIgQgA0ECdGohCCAFKAKwAyEDA0AgAyAEKAIAIAZsNgIAIANBBGohAyAEQQRqIgQgCEcNAAsLIAEoAnAiAwRAIAJBAkchCCABKAJsIgQgA0ECdGohCSAFKAKgAyEDA0AgAyAEKAIAIAZsIAhqNgIAIANBBGohAyAEQQRqIgQgCUcNAAsLIAEoAoABIgMEQCABKAJ8IgQgA0ECdGohCCACRSEJIAUoApADIQMDQCADIAQoAgAgBmwgCWo2AgAgA0EEaiEDIARBBGoiBCAIRw0ACwsgASgCACgCTCEJIAVBADYCiAMgBUIANwKAAyAFQYADaiAJECUgBSAJNgKEAyAFKAKgAyIDIAUoAqQDIgRBAnRqIQcgBSgCgAMhCAJAIARFDQAgAygCACEGIAhBADYCACAEQQFGDQAgBiAGQR91IgRzIARrIQYgA0EEaiEEIAghAwNAIAQoAgAhCyADIAY2AgQgBiALIAtBH3UiCnMgCmtqIQYgA0EEaiEDIARBBGoiBCAHRw0ACwsgCCAJQQJ0akEEaygCACEDIAdBBGsoAgAhBCABKAIEKAJMIQkgBUEANgL4AiAFQgA3AvACIAVB8AJqIAkQJSAFIAk2AvQCIAUoApADIgcgBSgClAMiBkECdGohCyAFKALwAiEIAkAgBkUNACAHKAIAIQogCCAEIARBH3UiDHMgDGsgAyADQR91IgRzIARraiIDNgIAIAZBAUYNACADIAogCkEfdSIEcyAEa2ohBiAHQQRqIQQgCCEDA0AgBCgCACEHIAMgBjYCBCAGIAcgB0EfdSIKcyAKa2ohBiADQQRqIQMgBEEEaiIEIAtHDQALCyAIIAlBAnRqQQRrKAIAIQMgC0EEaygCACEEIAEoAjAhCSAFQQA2AugCIAVCADcC4AIgBUHgAmogCRAlIAUgCTYC5AIgBCAEQR91IgZzIAZrIAMgA0EfdSIEcyAEa2oiICEEIAEoAjAEQCAFKALAAyIDIAUoAsQDIgRBAnRqIQcgBSgC4AIhCAJAIARFDQAgAygCACEGIAggIDYCACAEQQFGDQAgBiAGQR91IgRzIARrICBqIQYgA0EEaiEEIAghAwNAIAQoAgAhCyADIAY2AgQgBiALIAtBH3UiCnMgCmtqIQYgA0EEaiEDIARBBGoiBCAHRw0ACwsgB0EEaygCACIDIANBH3UiA3MgA2sgCCAJQQJ0akEEaygCACIDIANBH3UiA3MgA2tqIQQLIAEoAmAhCSAFQQA2AtgCIAVCADcC0AIgBUHQAmogCRAlIAUgCTYC1AIgASgCYARAIAUoArADIgMgBSgCtAMiBkECdGohByAFKALQAiEIAkAgBkUNACADKAIAIQsgCCAENgIAIAZBAUYNACAEIAsgC0EfdSIGcyAGa2ohBiADQQRqIQQgCCEDA0AgBCgCACELIAMgBjYCBCAGIAsgC0EfdSIKcyAKa2ohBiADQQRqIQMgBEEEaiIEIAdHDQALCyAHQQRrKAIAIgMgA0EfdSIDcyADayAIIAlBAnRqQQRrKAIAIgMgA0EfdSIDcyADa2ohBAsgBUGIBmoQOyELAkAgBEUEQCAAIAsQowEaDAELIAsgASgCBCIDKwMwIiYgASgCACIGKwMwIicgJiAnZBs5AzAgCyADKwM4IiYgBisDOCInICYgJ2QbOQM4IAtByABqIAQQiAUgASgCkAEhBCABKAIAIgYoAkwhAyAFIAsoAkg2ArACIAUgCygCTDYCtAIgBSAFKQKgAzcCuAIgBSAFKQKAAzcCwAIgBSAGKAJINgLIAiAFIAM2AswCIAMgBCAFQbACahCeAiABKAKQASEEIAEoAgQiBigCTCEDIAUgCygCSDYCkAIgBSALKAJMNgKUAiAFIAUpApADNwKYAiAFIAUpAvACNwKgAiAFIAYoAkg2AqgCIAUgAzYCrAIgAyAEIAVBkAJqEJ4CIAEoApABIQMgBSALKAJINgLwASAFIAsoAkw2AvQBIAUgBSkC4AI3AoACIAUgBSgCwAM2AvgBIAUgBSgCxAMiBDYC/AEgBSABKQIsNwKIAiAEIAMgBUHwAWoQngIgASgCkAEhAyAFIAsoAkg2AtABIAUgCygCTDYC1AEgBSAFKQLQAjcC4AEgBSAFKAKwAzYC2AEgBSAFKAK0AyIENgLcASAFIAEpAlw3AugBIAQgAyAFQdABahCeAiAFQdADaiIDIAVB9AVqEHggBS0A6AVBAUYEQCAAIAMQNxogBS0A6AVBAUcNASADEDoaDAELIAUgBUHIAWoiFTYCxAEgBUIANwLIASAFIAVBvAFqIhk2ArgBIAVCADcCvAEgBSAFQbABaiIXNgKsASAFQgA3ArABIAVBxAFqIAVBrAFqIgMgAUEMaiIEIAVBwANqIAVB4AJqIAEoAgBB2ABqQQFBACABKAKQARDvBCAFQbgBaiADIAFBPGoiFCAFQbADaiAFQdACaiABKAIEQdgAakEAIAEoAhAgASgCkAEQ7wQgBUHQA2oiAyAFQfQFahB4AkAgBS0A6AVBAUYEQCAAIAMQNxogBS0A6AVBAUcNASADEDoaDAELQQAhAyAFQQA2AuQCIAVB4AJqEC0gBUEANgLUAiAFQdACahAtIAVBADYCpAEgBUIANwKcASAFQQA2ApQBIAVCADcCjAEgBUHQA2ohDSABKAIAIQ4gASgCBCERIAJBAUYhFiABKAKQASEMIwBBkAFrIgkkACARKAJcIQYgDigCXCEIIAlBADYCSCAJQgA3AkAgCUFAayAGQQNuIAhBA25qQQAQMSARKAJcIQYgDigCXCEKIAkgCSgCQCIHNgIwIAkgDkHYAGoiCDYCLCAJIApBA24iDzYCNCAJIAUpAqADNwI4IA8gDCAJQSxqEOsEIBEoAlwgCSAGQQNuIhA2AiAgCSAHIA9BAnRqIgo2AhwgCSARQdgAaiISNgIYIAkgBSkCkAM3AiRBA24gDCAJQRhqEOsEIAUoAsADIRMCQAJAAkACQCAFKALEAyIGQaCNBk8EQCAMBEACQCAMLQAQDQBBACEEQQAhCANAIARBAWoiBEGACEYEQEEAIQQgDC0AEA0CCyABKAIMIAhBA3RqIhAoAgAhDyAKIBAoAgRBAnRqIhQgEyAIQQJ0aigCACIQIBBBH3UiEHMgEGsiECAUKAIAajYCACAHIA9BA21BAnRqIhQgFCgCACAQajYCACAHIA4oAmggD0ECdGooAgBBA21BAnRqIg8gDygCACAQajYCACAIQQFqIgggBkcNAAsLIAUoArQDIhBFDQMgDC0AEEEBcQ0DIAUoArADIRNBACEGQQAhCANAIAZBAWoiBkGACEYEQEEAIQYgDC0AEA0FCyABKAI8IAhBA3RqIg8oAgQhBCAHIA8oAgBBAnRqIhQgEyAIQQJ0aigCACIPIA9BH3UiD3MgD2siDyAUKAIAajYCACAKIARBA21BAnRqIhQgFCgCACAPajYCACAKIBEoAmggBEECdGooAgBBA21BAnRqIgQgBCgCACAPajYCACAIQQFqIgggEEcNAAsMAgtBACEIA0AgASgCDCAIQQN0aiIMKAIAIQQgCiAMKAIEQQJ0aiIPIBMgCEECdGooAgAiDCAMQR91IgxzIAxrIgwgDygCAGo2AgAgByAEQQNtQQJ0aiIPIA8oAgAgDGo2AgAgByAOKAJoIARBAnRqKAIAQQNtQQJ0aiIEIAQoAgAgDGo2AgAgCEEBaiIIIAZHDQALIAUoArQDIgxFDQMgBSgCsAMhD0EAIQgDQCABKAI8IAhBA3RqIgYoAgQhBCAHIAYoAgBBAnRqIhAgDyAIQQJ0aigCACIGIAZBH3UiBnMgBmsiBiAQKAIAajYCACAKIARBA21BAnRqIhAgECgCACAGajYCACAKIBEoAmggBEECdGooAgBBA21BAnRqIgQgBCgCACAGajYCACAIQQFqIgggDEcNAAsMAwsgCSAINgJsIAkgBDYCaCAJIAY2AmQgCSATNgJgIAkgEDYCXCAJIAo2AlggCSAPNgJUIAkgBzYCUAJAIAwEQCAGRQ0BIAwtABBBAXENAUEAIQRBACEIA0AgBEEBaiIEQYAIRgRAQQAhBCAMLQAQDQMLIAlB0ABqIAgQ6gQgCEEBaiIIIAZHDQALDAELIAkgCDYCjAEgCSAENgKIASAJIAY2AoQBIAkgEzYCgAEgCSAQNgJ8IAkgCjYCeCAJIA82AnQgCSAHNgJwIAZFDQBBACEIA0AgCUHwAGogCBDqBCAIQQFqIgggBkcNAAsLIAUoArADIQYgBSgCtAMhBCAJIBI2AmwgCSAUNgJoIAkgBDYCZCAJIAY2AmAgCSAPNgJcIAkgBzYCWCAJIBA2AlQgCSAKNgJQIAwEQCAERQ0BIAwtABBBAXENAUEAIQpBACEHA0AgCkEBaiIKQYAIRgRAQQAhCiAMLQAQDQMLIAlB0ABqIAcQ6QQgB0EBaiIHIARHDQALDAELIAkgEjYCjAEgCSAUNgKIASAJIAQ2AoQBIAkgBjYCgAEgCSAPNgJ8IAkgBzYCeCAJIBA2AnQgCSAKNgJwIARFDQBBACEHA0AgCUHwAGogBxDpBCAHQQFqIgcgBEcNAAsLIAxFDQELIAwtABBBAUcNACANQQA2AgggDUIANwIAIA1CADcCECANQQA2AhgMAQsgDigCXCEEIBEoAlwhBiAJQQA2AnggCUIANwJwIAlB8ABqIARBA24gBkEDbmpBAWpBABAxIAkoAnAhBAJAIAkoAkQiBkUNACAEIAkoAkAiCigCAEEASiIINgIEIAZBAUYNACAKIAZBAnRqIQYgBEEEaiEHIApBBGohCgNAIAcgCCAKKAIAQQBKaiIINgIEIAdBBGohByAKQQRqIgogBkcNAAsLIAQgCSgCdEECdGpBBGsoAgAhCiAJQfAAaiARKAJcQQNuIA4oAlxBA25qQQAQMSALKAKsASEEIAtBqAFqIgwgChAzIAsgCjYCrAEgBEERSSAEIApBAXRNckUEQCAMEHEgCygCrAEhCgtBACEHIAlBADYCWCAJQgA3AlAgCUHQAGogChAlIAkgCjYCVCAJKAJQIQQCfyAOKAKsASIIRQRAIAQhBkEADAELIAkoAkAhCiAEIQYDQCAKIAdBAnRqKAIAQQBKBEAgBiAHNgIAIAZBBGohBgsgB0EBaiIHIAhHDQALQQAiCiAEIAZGDQAaIAYgBGtBAnUhCCAMKAIAIRAgDigCqAEhEwNAIBAgCkEYbGoiByATIAQgCkECdGooAgBBGGxqIg8pAxA3AxAgByAPKQMINwMIIAcgDykDADcDACAKQQFqIgogCEcNAAsgBiEEIAgLIQogBCEIIBEoAqwBIg8EQEEAIQcgCSgCQCEQA0AgECAHQQJ0aiAOKAKsAUECdGooAgBBAEoEQCAIIAc2AgAgCEEEaiEICyAHQQFqIgcgD0cNAAsLIBEoAqgBIQ4CQCAWBEAgCUEBOgAVIAkgDjYCECAMKAIAIApBGGxqIQogBCAIRwRAIAggBGtBAnUhDCAJKAIQIQ5BACEGA0AgDiAEIAZBAnRqKAIAQRhsaiIIKwMAISYgCCsDCCEnIAogBkEYbGoiByAIKwMQmjkDECAHICeaOQMIIAcgJpo5AwAgBkEBaiIGIAxHDQALCwwBCyAEIAhGDQAgCCAGa0ECdSERIAwoAgAgCkEYbGohCkEAIQcDQCAKIAdBGGxqIgYgDiAEIAdBAnRqKAIAQRhsaiIIKQMQNwMQIAYgCCkDCDcDCCAGIAgpAwA3AwAgB0EBaiIHIBFHDQALCyAJKAJAIQQgCSgCRCEGIAlBADYCAAJAIAQgBkECdGoiCAJ/IAkoAgAhByAIIARrQQJ1IgYEQANAIAQgByAEKAIARg0CGiAEQQRqIQQgBkEBayIGDQALC0EACyIEIAggBBsiBkYNACAGQQRqIgQgCEYNAANAIAQoAgAiByAJKAIARwRAIAYgBzYCACAGQQRqIQYLIARBBGoiBCAIRw0ACwsgCUEANgIIIAlCADcCACAJIAYgCSgCQGtBAnVBAWpBABAxIAkoAgAhBAJAIAYgCSgCQCIIRg0AIAQgCCgCACIMNgIEIAhBBGoiByAGRg0AIARBBGohCgNAIAogBygCACAMaiIMNgIEIApBBGohCiAHQQRqIgcgBkcNAAsLIA0gBDYCACANIAkoAgQ2AgQgDSAJKAIINgIIIA0gCSgCcDYCECANIAkoAnQ2AhQgDSAJKAJ4NgIYIAlBADYCeCAJQgA3AnAgCSgCUCIERQ0AIAQQIiAJKAJwIgRFDQAgBBAiCyAJKAJAIgQEQCAEECILIAlBkAFqJAAgBSAFQYwBajYCgAEgBSAFQZwBajYCfCAFKAJ8IgQgDUcEQCAEKAIAIgYEQCAGECILIARBADYCCCAEQgA3AgAgBCANKAIANgIAIAQgDSgCBDYCBCAEIA0oAgg2AgggDUEANgIIIA1CADcCAAsgBSgCgAEiBCANQRBqRwRAIAQoAgAiBgRAIAYQIgsgBEEANgIIIARCADcCACAEIA0oAhA2AgAgBCANKAIUNgIEIAQgDSgCGDYCCCANQQA2AhggDUIANwIQCyANKAIQIgQEQCAEECILIA0oAgAiBARAIAQQIgsgDSAFQfQFahB4AkAgBS0A6AVBAUYEQCAAIA0QNxogBS0A6AVBAUcNASANEDoaDAELIAVBADYCxAMgBUHAA2oQLSAFQQA2ArQDIAVBsANqEC0gBUEANgKEASAFQgA3AnwCQCAFKAKgASIERQ0AIAUoApwBIQggBEECdCIGECchAyAGRQ0AIAMgCCAG/AoAAAsgBSAENgKEASAFIAQ2AoABIAUgAzYCfCABKAIAKAJcIQMgBUEANgJ0IAVCADcCbCAFQewAaiIIIANBARCBASABKAIEKAJcIQMgBUEANgJkIAVCADcCXCAFQdwAaiIJIANBARCBASAFKAKcASAFKAKgAUECdGpBBGsoAgAhAyAFQQA2AlQgBUIANwJMIAVBzABqIgQgAxA5IAUgAzYCUCAFKAKcASAFKAKgAUECdGpBBGsoAgAhAyAFQQA2AkQgBUIANwI8IAVBPGoiBiADEDkgBSADNgJAIAsgBiAIIAVB/ABqIgMgBUHEAWogBCABKAIAIAVBoANqIAVBgANqIAUoAowBQQEgASgCkAEQ7gQgCyAGIAkgAyAFQbgBaiAEIAEoAgQgBUGQA2ogBUHwAmogBSgCjAEgASgCACgCXEEDbkECdGpBACABKAKQARDuBCAFQdADaiIDIAVB9AVqEHgCQCAFLQDoBUEBRgRAIAAgAxA3GiAFLQDoBUEBRw0BIAMQOhoMAQsgBSgCyAEQzQEgBSAVNgLEASAFQgA3AsgBIAUoArwBEM0BIAUgGTYCuAEgBUIANwK8ASABKAIAKAJcQQNuIQMgASgCkAEhCiMAQSBrIggkAAJAIAVBrAFqIgQoAgAiCSAEQQRqIhVGDQAgA0ECdCEZA0AgCgRAIAotABANAgsgCSgCFCEMIAkoAhAhDSAJKAIYIAkoAhwQzAEgCSgCGCIEIAkoAhwiBkYiDkUEQCALKAJIIRFEAAAAAAAA8H8hJkQAAAAAAADw/yEnRAAAAAAAAPD/ISlEAAAAAAAA8P8hKEQAAAAAAADwfyEqRAAAAAAAAPB/ISwgBCEDA0AgESADKAIIQRhsaiIHKwMQIi0gJyAnIC1jGyEnIAcrAwgiKyApICkgK2MbISkgBysDACIuICggKCAuYxshKCAmIC0gJiAtYxshJiAqICsgKiArYxshKiAsIC4gLCAuYxshLCADQRhqIgMgBkcNAAsgCygCSEEAQQhBECApICqhIikgJyAmoSImZBsiAyAmICggLKEiJ2MbIAMgJyApZBtqIQcgBCEDA0AgAyAHIAMoAghBGGxqKwMAOQMAIANBGGoiAyAGRw0ACwsgBSgCjAEiAyAZaiAMQQJ0aigCACERIAYgBGtBGG1BAXYhByADIA1BAnRqKAIAIQ8gBCEDAkAgDg0AA0AgBC0AEEEBcUUEQCAGIQMDQCADQRhrIgYgBEYEQCAEIQMMBAsgA0EIayAGIQMtAABBAXFFDQALIAggBCkDEDcDGCAIIAQpAwg3AxAgCCAEKQMANwMIIAQgAykDEDcDECAEIAMpAwg3AwggBCADKQMANwMAIAMgCCkDGDcDECADIAgpAxA3AwggAyAIKQMINwMAIARBGGoiBCADRw0BDAILIARBGGoiBCAGRw0ACyAGIQMLIAkoAhggAxDMASADIAkoAhwQzAEgBwRAIAUoAnwiAyARQQJ0aiEEIAMgD0ECdGohDiAFKAJMIREgBSgCPCEPIAkoAhghFkEAIQYDQCAWIAZBGGxqIgMgB0EYbGooAgghECADKAIIIRMgDiAOKAIAIhRBAWo2AgAgBCAEKAIAIhJBAWo2AgAgDyAUQQR0IhhqIgNBADYCDCADIBI2AgggAyAQNgIEIAMgEzYCACARIBhqIgNBfzYCDCADIA02AgggA0KAgICAcDcCACAPIBJBBHQiEmoiA0EANgIMIAMgFDYCCCADIBM2AgQgAyAQNgIAIBEgEmoiA0F/NgIMIAMgDDYCCCADQoGAgIBwNwIAIAZBAWoiBiAHRw0ACwsCQCAJKAIEIgMEQANAIAMiCSgCACIDDQAMAgsACwNAIAkgCSgCCCIJKAIARw0ACwsgCSAVRw0ACwsgCEEgaiQAIAVB0ANqIgMgBUH0BWoQeCAFLQDoBUEBRgRAIAAgAxA3GiAFLQDoBUEBRw0BIAMQOhoMAQsgBSgCsAEQnQIgBSAXNgKsASAFQgA3ArABIAEoAgAhBgJAIAUoAnAiBEUEQEEAIQMMAQsgBSgCbCEIIAQQJyEDIARFDQAgAyAIIAT8CgAACyAFIAQ2AjQgBSAENgIwIAUgAzYCLCAGKAJcIQQgBSAFKAKMATYCJCAFIARBA242AiggBUH8AGogBUE8aiAFQcwAaiAGIAVBLGogBUGgA2ogBUGAA2ogBUEkakEBIAEoApABEO0EIAMEQCADECILIAVBADYCNCAFQgA3AiwgASgCBCEGQQAhBAJAIAUoAmAiA0UNACAFKAJcIQggAxAnIQQgA0UNACAEIAggA/wKAAALIAUgAzYCHCAFIAM2AhggBSAENgIUIAEoAgAoAlwhAyAFIAYoAlxBA242AhAgBSAFKAKMASADQQNuQQJ0ajYCDCAFQfwAaiAFQTxqIAVBzABqIAYgBUEUaiAFQZADaiAFQfACaiAFQQxqQQAgASgCkAEQ7QQgBARAIAQQIgsgBUEANgIcIAVCADcCFCAFQdADaiIDIAVB9AVqEHggBS0A6AVBAUYEQCAAIAMQNxogBS0A6AVBAUcNASADEDoaDAELIAVBADYCcCAFQewAahCEAyAFQQA2AmAgBUHcAGoQhAMgBUEANgKAASAFQfwAahAtIAVBADYCkAEgBUGMAWoQLSAFQQA2AqQDIAVBoANqEC0gBUEANgKUAyAFQZADahAtIAVBADYChAMgBUGAA2oQLSAFQQA2AvQCIAVB8AJqEC0gBSAFKQI8NwLQAyAFQZwBaiERIAVB0ANqIhQhDiAFQcwAaiEQIAEoApABIQ1BACEJQQAhDyMAQdACayIHJAACQCANBEAgDS0AEA0BCyAHQQA2AvwBIAdCADcC9AEgC0EANgLcASALQdgBaiITEIMBIA4oAgQhAyAHQQA2AuwBIAdCADcC5AEgB0HkAWogA0F/EDEgESgCBCEEIAdBADYC3AEgB0IANwLUASAHQdQBaiAEECUgByAENgLYASAHKALUASIDIARBAnRqQQRrQQA2AgAgB0IANwPIASAHQgA3A8ABIAdBgICA/AM2AtABIAdBADYCvAECQCARKAIEQQJOBEAgC0HIAGohFSAHQaABaiEZA0AgDQRAIA0tABANAwsCQCAJQQJ0IgMgESgCAGoiBCgCBCIGIAQoAgAiCEYEQCAHKALUASADakEANgIADAELIAcoAtQBIANqIAYgCGsiA0ECazYCACADQQVIDQAgCygCqAEgCUEYbGoiAysDCCInmSEoAnwgAysDECImmSIqIAMrAwAiKZkiLGRFICggKmNFckUEQEQAAAAAAAAAACEqRAAAAAAAAAAAIShEAAAAAAAA8D8MAQsgKCAsZARARAAAAAAAAPA/IShEAAAAAAAAAAAhKiAnISZEAAAAAAAAAAAMAQtEAAAAAAAA8D8hKkQAAAAAAAAAACEoICkhJkQAAAAAAAAAAAshJyAHQYQCaiIDIA4oAgAiCCAEKAIAIgRBBHRqIAggBkEEdGogBBD0AiAHICg5A6gCIAcgKJogKCAmRAAAAAAAAAAAYyIEGzkDwAIgByAqOQPIAiAHICqaICogBBs5A7ACIAcgJzkDuAIgByAnmiAnIAQbOQOgAiAHQTBqIgYgB0GgAmpBMPwKAAAgB0GQAmoiBCADIA4gFSAGEMcEIAcgAzYCnAIgB0GcAmoQKSAHQYgBaiAEIAsrAzBBABCRBCAHIAQ2AoQCIAMQKSAHKALUASAHKAK8AUECdGogBygCjAEgBygCiAFrQQR1IAcoApQBa0EDbjYCAEEAIQYjAEEQayIJJAAgBygCvAEhAyAHAn8CQCAHQcABaiIIKAIEIgpFDQAgCCgCAAJ/IApBAWsgA3EgCmkiDEEBTQ0AGiADIAMgCkkNABogAyAKcAsiBkECdGooAgAiBEUNACAEKAIAIgRFDQAgCkEBayESIAxBAUshFwNAAkAgAyAEKAIEIgxHBEACQCAXRQRAIAwgEnEhDAwBCyAKIAxLDQAgDCAKcCEMCyAGIAxHDQMMAQsgBCgCCCADRw0AQQAMAwsgBCgCACIEDQALC0HAABAjIQQgCSAINgIIIAkgBDYCBCAEIAM2AgQgBEEANgIAIAQgBygCvAE2AgggBCAHKAKIATYCECAEIAcoAowBNgIUIAQgBygCkAE2AhggB0EANgKQASAHQgA3A4gBIAQgBygCnAE2AiQgBCAHKQKUATcCHCAHKAKgASESIAdBADYCoAEgBEEoaiIEIBI2AgAgBCAHKAKkATYCBCAHQQA2AqQBIAQgBygCqAEiDDYCCCAEIAcoAqwBIhc2AgwgBCAHKgKwATgCECAXBEAgBEEIaiEXIAwoAgQhDAJAIAQoAgQiBCAEQQFrIhZxRQRAIAwgFnEhDAwBCyAEIAxLDQAgDCAEcCEMCyASIAxBAnRqIBc2AgAgB0IANwKoAQsgCUEBOgAMAkBBACAKIAgoAgxBAWqzIkggCCoCECJJIAqzlF4bDQAgCCAKIApBAWtxQQBHIApBA0lyIApBAXRyIgQgSCBJlY38ASIGIAQgBksbEHAgCCgCBCIKIApBAWsiBHFFBEAgAyAEcSEGDAELIAMgCkkEQCADIQYMAQsgAyAKcCEGCwJAIAgoAgAiEiAGQQJ0aiIGKAIAIgNFBEAgCSgCBCIEIAgoAgg2AgAgCCAENgIIIAYgCEEIajYCACAEKAIAIgNFDQEgAygCBCEMAkAgCiAKQQFrIgNxRQRAIAMgDHEhDAwBCyAKIAxLDQAgDCAKcCEMCyASIAxBAnRqIAQ2AgAMAQsgCSgCBCIEIAMoAgA2AgAgAyAENgIACyAJQQA2AgQgCCAIKAIMQQFqNgIMIAkoAgQhAyAJQQA2AgQgAwRAIAktAAxBAUYEQCADQQhqEMMECyADECILQQELOgCkAiAHIAQ2AqACIAlBEGokACAZEMcBIAcoAogBIgMEQCAHIAM2AowBIAcoApABGiADECILIAcoArwBIQkLIAcgCUEBaiIJNgK8ASAJIBEoAgRBAWtIDQALIAcoAtQBIQMLAkAgBygC2AEiBEUNACADKAIAIQkgA0EANgIAIARBAUYNACADIARBAnRqIQYgA0EEaiEIIAMhBANAIAgoAgAhCiAEIAk2AgQgBEEEaiEEIAkgCmohCSAIQQRqIgggBkcNAAsLIAtB2ABqIhkgAyAHKALYAUECdGpBBGsoAgBBA2wQyQEgBygC1AEgBygC2AFBAnRqQQRrKAIAIQMgB0IANwNwIAdCADcDeCAHQgA3A4ABIAcgBykDcDcDGCAHIAcpA3g3AyAgByAHKQOAATcDKCAHQfQBaiADIAdBGGoQZyAHKALUASAHKALYAUECdGpBBGsoAgAhAyAHQgA3A2AgB0IANwNoIAcgBykDYDcDCCAHIAcpA2g3AxAgEyADIAdBCGoQlQIgESgCBEEBRwRAA0AgDQRAIA0tABANAwsgByAPNgKgAiAHQcABaiAHQaACahCiAiEDAkAgD0ECdCIIIBEoAgBqIgYoAgQiBCAGKAIAIgZGDQAgBygC1AEgCGooAgAhCiALKAKoASAPQRhsaiIIKwMQISogCCsDCCEsIAgrAwAhLQJAAkACQAJAAkACQAJAIAQgBmtBA2sOAgABAgsgByAGNgKgAiAHIAZBAmoiAzYCqAIgByAGQQFqIgQ2AqQCIA4oAgAiCCAGQQR0aigCBCAIIANBBHRqKAIARgRAIAcgBDYCqAIgByADNgKkAgsgByAHKQLkATcCiAFBASEMIBkgB0GIAWogDiAKIAdBoAJqQQEQxgQMAgsCfCAqmSImIC2ZIidkRSAmICyZIilkRXJFBEBEAAAAAAAA8D8hJkQAAAAAAAAAACEoRAAAAAAAAAAAIScgKgwBCyAnICljBEBEAAAAAAAA8D8hJ0QAAAAAAAAAACEoRAAAAAAAAAAAISYgLAwBC0QAAAAAAAAAACEmRAAAAAAAAPA/IShEAAAAAAAAAAAhJyAtCyEpIAdBoAJqIgMgDigCACIIIAZBBHRqIAggBEEEdGogBhD0AiAHQYgBaiAHKAKgAhBgIRcgByADNgKQAiAHQZACahApIBcoAgAiCSgCCCEDIAkoAgAhBCAJKAIEIQggByAJKAIMIgw2AswCIAcgCDYCyAIgByAENgLEAiAHIAw2AsACIAcgAzYCvAIgByAINgK4AiAHIAw2ArQCIAcgAzYCsAIgByAENgKsAiAHIAM2AqgCIAcgCDYCpAIgByAENgKgAiAmmiAmIClEAAAAAAAAAABjIgkbIi8gCygCSCISIA4oAgAiFSADQQR0aigCAEEYbGoiAysDACI4oiAomiAoIAkbIjEgAysDCCI5oqAgJ5ogJyAJGyIyIAMrAxAiOqKgIkQgLyASIBUgBEEEdGooAgBBGGxqIgMrAwAiO6IgMSADKwMIIjyioCAyIAMrAxAiPaKgIjChIjMgM6IgJyA4oiAmIDmioCAoIDqioCJFICcgO6IgJiA8oqAgKCA9oqAiPqEiNCA0oqAhKyAvIBIgFSAIQQR0aigCAEEYbGoiAysDACI/oiAxIAMrAwgiQKKgIDIgAysDECJBoqAiQiAwoSI2IDaiICcgP6IgJiBAoqAgKCBBoqAiQyA+oSI3IDeioCEuIAsrAzAhKUEBIQkCQCA2IDSiIDcgM6KhIjVEAAAAAAAAAABkRQRAIDUgNaJEAAAAAAAAEECiICkgKSArIC4gKyAuZBuiomVFDQELIC8gEiAVIAxBBHRqKAIAQRhsaiIDKwMAIjWiIDEgAysDCCIxoqAgMiADKwMQIjKioCJGIDChIi8gL6IgJyA1oiAmIDGioCAoIDKioCIwID6hIicgJ6KgISYgMyAnoiA0IC+ioSIoRAAAAAAAAAAAZEUEQCAoICiiRAAAAAAAABBAoiApICkgJiArICYgK2QboqJlRQ0BC0EAIQkgRCBCoSIoIDAgQ6EiK6IgRSBDoSIzIEYgQqEiNKKhIjBEAAAAAAAAAABkRQRAIDAgMKJEAAAAAAAAEECiICkgKSA0IDSiICsgK6KgIisgKCAooiAzIDOioCIoICggK2MboqJlRQ0BCyA2ICeiIDcgL6KhIidEAAAAAAAAAABkRQRAICcgJ6JEAAAAAAAAEECiICkgKSAmIC4gJiAuZBuiomVFDQELIDsgOKEiJiAmoiA8IDmhIiYgJqKgID0gOqEiJiAmoqAgPyA1oSImICaiIEAgMaEiJiAmoqAgQSAyoSImICaioGQhCQsgByAHKQLkATcCkAIgGSAHQZACaiAOIAogB0GgAmogCUEYbGpBAhDGBCAXKAIAIgMEQCAHIAM2AowBIAcoApABGiADECILQQIhDAwBCyADKAIUIAMoAhAiCWtBBHUgAygCHCIDayIIIAhBA24iDEEDbCIVayESIApBA2whBCAHKALkASEXIA0EQAJAIAggEkYNACANLQAQQQFxDQAgBCADayEbIAkgA0EEdGohHCALKAJoIR0gCygCeCEeIAsoAlghHyAOKAIAIRZBACESQQAhCANAIBJBAWoiEkGACEYEQEEAIRIgDS0AEA0CCyAfIAQgCGpBAnQiGGogFiAcIAhBBHRqIhooAgBBBHRqKAIANgIAIBggHmogFiAaKAIAQQR0aigCDDYCACAYIB1qQX8gGyAaKAIIIhhqIAMgGEobNgIAIAhBAWoiCCAVRw0ACwsgA0UNAiANLQAQQQFxDQIgBCADayESQQAhBEEAIQgDQCAEQQFqIgRBgAhGBEBBACEEIA0tABANBAsgCSAIQQR0aiIVKAIIIhZBAE4EQCAXIBUoAgRBAnRqIBIgFmo2AgALIAhBAWoiCCADRw0ACwwBCyAIIBJHBEAgBCADayEaIAkgA0EEdGohGyALKAJoIRwgCygCeCEdIAsoAlghHiAOKAIAIRJBACEIA0AgHiAEIAhqQQJ0IhZqIBIgGyAIQQR0aiIYKAIAQQR0aigCADYCACAWIB1qIBIgGCgCAEEEdGooAgw2AgAgFiAcakF/IBogGCgCCCIWaiADIBZKGzYCACAIQQFqIgggFUcNAAsLIANFBEAgEygCACEIIAcoAvQBIQMgByAQKAIAIAZBBHRqIgQpAgg3A6gCIAcgBCkCADcDoAIMBAsgBCADayEEQQAhCANAIAkgCEEEdGoiEigCCCIVQQBOBEAgFyASKAIEQQJ0aiAEIBVqNgIACyAIQQFqIgggA0cNAAsLIBMoAgAhCCAHKAL0ASEDIAcgECgCACAGQQR0aiIEKQIINwOoAiAHIAQpAgA3A6ACIA1FDQIMAQsgEygCACEIIAcoAvQBIQMgByAQKAIAIAZBBHRqIgQpAgg3A6gCIAcgBCkCADcDoAILIAxFDQEgDS0AEEEBcQ0BIAggCkEEdGohBiADIApBGGxqIQhBACEEQQAhCQNAIARBAWoiBEGACEYEQEEAIQQgDS0AEA0DCyAIIAlBGGxqIgMgKjkDECADICw5AwggAyAtOQMAIAYgCUEEdGoiAyAHKQOoAjcCCCADIAcpA6ACNwIAIAlBAWoiCSAMRw0ACwwBCyAMRQ0AIAggCkEEdGohBCADIApBGGxqIQZBACEJA0AgBiAJQRhsaiIDICo5AxAgAyAsOQMIIAMgLTkDACAEIAlBBHRqIgMgBykDqAI3AgggAyAHKQOgAjcCACAJQQFqIgkgDEcNAAsLIA9BAWoiDyARKAIEQQFrSQ0ACwsCQAJAAkAgDQRAIA0tABANBCANLQAQDQIgDigCBCIERQ0CIAsoAmghBiAOKAIAIQogBygC5AEhA0EAIQhBACEJA0AgCEEBaiIIQYAIRgRAQQAhCCANLQAQDQQLAkAgAyAJQQJ0aigCACIMQQBIDQAgCiAJQQR0aigCCCIOQQBIDQAgBiAMQQJ0aiADIA5BAnRqKAIANgIACyAJQQFqIgkgBEcNAAsMAQsgDigCBCIERQ0CIAsoAmghBiAOKAIAIQggBygC5AEhA0EAIQkDQAJAIAMgCUECdGooAgAiCkEASA0AIAggCUEEdGooAggiDEEASA0AIAYgCkECdGogAyAMQQJ0aigCADYCAAsgCUEBaiIJIARHDQALCyANRQ0BCyANLQAQDQELIAdBzABqIAtGDQAgCygCqAEiAwRAIAMQIgsgCyAHKAL0ATYCqAEgCyAHKAL4ATYCrAEgCyAHKAL8ATYCsAEgB0EANgL8ASAHQgA3AvQBCyAHKALIASIDBEADQCADKAIAIANBCGoQwwQgAxAiIgMNAAsLIAcoAsABIQMgB0EANgLAASADBEAgBygCxAEaIAMQIgsgBygC1AEiAwRAIAMQIgsgBygC5AEiAwRAIAMQIgsgBygC9AEiA0UNACADECILIAdB0AJqJAAgBUEANgJQIBAQgwEgBUEANgJAIAVBPGoQgwEgBUEANgKgASAREC1BACEIQQAhCSMAQUBqIQMgCygCXCIHQQNuIQwCQAJAAkACQCABKAKQASIKBEAgCi0AECAHQQNJcg0CIAsoAnghDSALKAJoIQ4gCygCWCERA0AgCEEBaiIIQYAIRgRAQQAhCCAKLQAQDQQLIAMgESAJQQNsIhNBAnQiBGooAgAiDzYCBCADIAQgDmooAgA2AgwgAyAEIA1qKAIANgIQIAMgESAEQQRqIgZqKAIANgIUIAMgBiAOaigCADYCHCADIAYgDWooAgA2AiAgAyARIARBCGoiBGooAgA2AiQgAyAEIA5qKAIANgIsIAMgBCANaigCADYCMCAPQQBOBEAgA0KBgICAIDcCNEEAIQZBACEEA0AgA0E0aiAEaigCACIPIAYgA0EEaiIQIA9BBHRqKAIAIAZBBHQgEGooAgBIGyEGIARBBGoiBEEIRw0ACyADQQI2AjwgA0KAgICAEDcCNEEAIQQDQCADQQRqIANBNGogBGooAgAiECAGakEDb0EEdGoiDygCDCESIA8oAgghFSARIBAgE2pBAnQiEGogDygCADYCACAOIBBqIBU2AgAgDSAQaiASNgIAIARBBGoiBEEMRw0ACwsgCUEBaiIJIAxHDQALDAELIAdBA0kNAyALKAJ4IQggCygCaCENIAsoAlghDgNAIAMgDiAJQQNsIhBBAnQiBGooAgAiETYCBCADIAQgDWooAgA2AgwgAyAEIAhqKAIANgIQIAMgDiAEQQRqIgZqKAIANgIUIAMgBiANaigCADYCHCADIAYgCGooAgA2AiAgAyAOIARBCGoiBGooAgA2AiQgAyAEIA1qKAIANgIsIAMgBCAIaigCADYCMCARQQBOBEAgA0KBgICAIDcCNEEAIQZBACEEA0AgA0E0aiAEaigCACIRIAYgA0EEaiIPIBFBBHRqKAIAIAZBBHQgD2ooAgBIGyEGIARBBGoiBEEIRw0ACyADQQI2AjwgA0KAgICAEDcCNEEAIQQDQCADQQRqIANBNGogBGooAgAiDyAGakEDb0EEdGoiESgCDCETIBEoAgghEiAOIA8gEGpBAnQiD2ogESgCADYCACANIA9qIBI2AgAgCCAPaiATNgIAIARBBGoiBEEMRw0ACwsgCUEBaiIJIAxHDQALCyAKRQ0BCyAKLQAQDQEgCi0AECAHQQNJcg0BIAsoAlghDUEAIQhBACEJA0AgCEEBaiIIQYAIRgRAQQAhCCAKLQAQDQMLIANBAjYCDCADQoCAgIAQNwIEIAlBA2whESALKAJoIQ9BACEHA0AgDSADQQRqIAdqKAIAIBFqQQJ0IgRqKAIAIhBBAE4EQCAEIA9qIhMoAgAhBCADQQI2AjwgA0KAgICAEDcCNCAEIARBA29rIQ5BfyEEQQAhBgNAIANBNGogBmooAgAiEiAEIBAgDUF4QQQgDiASaiIEQQNvQQJGG2ogBEECdGooAgBGGyEEIAZBBGoiBkEMRw0ACyATIAQgDmo2AgAgB0EEaiIHQQxHDQELCyAJQQFqIgkgDEcNAAsMAQsgB0EDSQ0AIAsoAlghCEEAIQkDQCADQQI2AgwgA0KAgICAEDcCBCAJQQNsIQ0gCygCaCEOQQAhBwNAIAggA0EEaiAHaigCACANakECdCIEaigCACIRQQBOBEAgBCAOaiIPKAIAIQQgA0ECNgI8IANCgICAgBA3AjQgBCAEQQNvayEKQX8hBEEAIQYDQCADQTRqIAZqKAIAIhAgBCARIAhBeEEEIAogEGoiBEEDb0ECRhtqIARBAnRqKAIARhshBCAGQQRqIgZBDEcNAAsgDyAEIApqNgIAIAdBBGoiB0EMRw0BCwsgCUEBaiIJIAxHDQALCyAUIAVB9AVqEHggBS0A6AVBAUYEQCAAIBQQNxogBS0A6AVBAUcNASAUEDoaDAELIAEoAgAhByABKAIEIQkgAkEBRiEaIAEoApABIQ1BACEKIwBBwAFrIgYkACALIAcoAkAiGyAJKAJAIhwgGyAcShsiETYCQAJAIBFFDQAgCygCXCECIAZBADYCOCAGQgA3AjAgBkEwaiACEDMgBiACNgI0IAsoAtgBIQMgCygC3AEhBCAHKAJIIQggBygCTCEMIAkoAkghDiAJKAJMIQ8gCygCSCEQIAsoAkwhEyAGKAIwIRQgBiALKwMwIiY5A3ggBiALQdgAaiIVNgJwIAYgCUHYAGoiHTYCbCAGIAdB2ABqIh42AmggBiATNgJkIAYgEDYCYCAGIA82AlwgBiAONgJYIAYgDDYCVCAGIAg2AlAgBiAENgJMIAYgAzYCSCAGIAI2AkQgBiAUNgJAIAJBA24hEgJAAkAgDQRAAkAgAkEDSQ0AIA0tABBBAXENAEEAIQQDQCAKQQFqIgpBgAhGBEBBACEKIA0tABANAgsgBkFAayAEEOYEIARBAWoiBCASRw0ACwsgDS0AEEUNAQwCCyAGICY5A7gBIAYgFTYCsAEgBiAdNgKsASAGIB42AqgBIAYgEzYCpAEgBiAQNgKgASAGIA82ApwBIAYgDjYCmAEgBiAMNgKUASAGIAg2ApABIAYgBDYCjAEgBiADNgKIASAGIBQ2AoABIAYgAjYChAEgAkEDSQ0AQQAhBANAIAZBgAFqIAQQ5gQgBEEBaiIEIBJHDQALCyAGQSRqIAsoAkwiA0EBahCcAiEfIAZCADcDkAEgBkIANwOIASAGQgA3A4ABAn8gCSgCQCIERQRAIAkoAkwMAQsgCSgCjAEgBG4LIQQgBkF/NgJAIAZBgAFqIgggBCAGQUBrEOUEIAhBDHICfyAHKAJAIghFBEAgBygCTAwBCyAHKAKMASAIbgsgBkF/NgJAIAZBQGsQ5QQgC0GIAWoiDyALKAJMIBFsEEQCQCACQQNJDQAgCUHIAWohIkEAIRBBACEMA0AgDQRAIA0tABANAgsgCygCWCAQQQNsIiNBAnRqKAIAQQBOBEAgHCAbIAsoAtgBIBBBBHRqIgIoAgAiDhshEyACKAIIIQJBACEVAn9BACAaRQ0AGkEAIA5FDQAaQQAgE0EDSA0AGiAiIAIQ5AQLISQgHSAeIA4bIRkgCSAHIA4bISUgBkECNgIgIAZCgICAgBA3AhggAkEMbCEXIA5FISEDQCAGKAIwIAZBGGogFWooAgAgI2oiAkEYbGohFCACQQJ0IRZBfyEYAkACQAJAAkAgE0EATARAQX8hCCADIQIMAQsgCygCWCAWaigCACECIAZBAjYCSCAGQoCAgIAQNwJAQQAhCkF+IQgCQAJ/A0AgFEEIQRAgBkFAayAKaigCACIEQQFGG0EAIAQbaisDACImRAAAAAAAAPA/YQRAIAMhAiAZKAIgIBdqIARBAnRqKAIADAILIAQgCCAmRAAAAAAAAAAAYRshCCAKQQRqIgpBDEcNAAsgCEEASA0BIBkoAiAgF2oiCkEEQQggCEEBRhtBACAIGyIIQYzzAGooAgBBAnRqKAIAIgQgCiAIQZjzAGooAgBBAnRqKAIAIgggBCAISiIKGyEYIAggBCAKGwshCCACIANHIAhBAEhyDQEgBkGAAWoiAiACQQxyIA4bKAIAIAhBAnRqIgIoAgAiBEEATg0DIAIgDDYCAAwCCyACIAMgCEF+RhshAkF/IQgLIB8oAgAgAkEMbGoiAigCACIEIAIoAgQiCkcEQANAAkAgBCgCACAhRw0AIAQoAgQgCEcNACAEKAIIIBhHDQAgBCgCDCEEDAQLIARBEGoiBCAKRw0ACwsgBiAMNgJMIAYgGDYCSCAGIAg2AkQgBiAhNgJAIAIgBkFAaxDjBAsgCygCeCAWaiAMNgIAIAxBAWohDCARQQBMDQFBACECA0ACQCACIBNIBEAgBkIANwNQIAZCADcDSCAGQgA3A0AgBkECNgIUIAZCgICAgBA3AgwgJSgCiAEgAkEDdGohCiAZKAIgIBdqIRZBACEEA0AgBkFAa0EIQRAgBkEMaiAEaigCACIIQQFGG0EAIAgbaiAKIBYgCEECdGooAgAgE2xBA3RqKwMAOQMAIARBBGoiBEEMRw0ACyAUKwMAIAYrA0CiRAAAAAAAAAAAoCAUKwMIIAYrA0iioCAUKwMQIAYrA1CioCImmiAmIAJBA0kbICYgJBshJgJAIAsoAowBIgQgCygCkAEiCE8EQCAPIAhBAXRBgAEgCBsQRCALKAKIASALKAKMASIEQQN0aiAmOQMADAELIA8oAgAgBEEDdGogJjkDAAsMAQsCQCALKAKMASIEIAsoApABIghPBEAgDyAIQQF0QYABIAgbEEQgCygCiAEgCygCjAEiBEEDdGpCADcDAAwBCyAPKAIAIARBA3RqQgA3AwALCyALIARBAWo2AowBIAJBAWoiAiARRw0ACwwBCyALKAJ4IBZqIAQ2AgALIBVBBGoiFUEMRw0ACwsgEEEBaiIQIBJHDQALCyAGQZgBaiEEA0AgBEEMayICKAIAIgMEQCAEQQhrIAM2AgAgBEEEaygCABogAxAiCyAGQYABaiIDIAIiBEcNAAsgBiAfNgKAASADECkLIAYoAjAiAkUNACACECILIAZBwAFqJAAgBUHQA2oiAiAFQfQFahB4IAUtAOgFQQFGBEAgACACEDcaIAUtAOgFQQFHDQEgAhA6GgwBCyABKAIAIQkgASgCBCEHIAEoApABIQYjAEEgayIEJAAgCygC2AEiAiALKAJcIgNBA25BBHRqIQogBygC2AEhDCAJKALYASENQZiVAigCACEIAkACQAJAAkAgBgRAIANBA0kNAiAGLQAQQQFxDQJBACEDA0AgA0EBaiIDQYAIRgRAQQAhAyAGLQAQDQQLIAIoAgghDgJAIAIoAgBFBEAgAiANIA5BBHRqIg4pAgg3AgggAiAOKQIANwIADAELIAIgDCAOQQR0aiIOKQIAIkc3AgAgAiAOKQIINwIIIAIgR6cgCGo2AgALIAJBEGoiAiAKRw0ACwwBCyADQQNJDQIDQCACKAIIIQMCQCACKAIARQRAIAIgDSADQQR0aiIDKQIINwIIIAIgAykCADcCAAwBCyACIAwgA0EEdGoiAykCACJHNwIAIAIgAykCCDcCCCACIEenIAhqNgIACyACQRBqIgIgCkcNAAsLIAZFDQELIAYtABANAQsgCSgCzAEiAiAJQdABaiIGRwRAIAtBzAFqIQkDQCAEIAJBEGoiAzYCFCAEQRhqIAkgAyAEQRRqEHkgBCgCGEEYaiACQRhqQeoA/AoAAAJAIAIoAgQiAwRAA0AgAyICKAIAIgMNAAwCCwALA0AgAiACKAIIIgIoAgBHDQALCyACIAZHDQALCyAHKALMASICIAdB0AFqIglGDQAgC0HMAWohBgNAIAQgAigCECAIajYCDCAEIARBDGoiAzYCFCAEQRhqIgcgBiADIARBFGoiChB5IAQoAhhBGGogAkEYakHqAPwKAAAgBCACKAIQIAhqNgIMIAQgAzYCFCAHIAYgAyAKEHkgBCgCGCIDIAMtAIABIBpHOgCAAQJAIAIoAgQiAwRAA0AgAyICKAIAIgMNAAwCCwALA0AgAiACKAIIIgIoAgBHDQALCyACIAlHDQALCyAEQSBqJAAgBUHQA2oiAiAFQfQFahB4IAUtAOgFQQFGBEAgACACEDcaIAUtAOgFQQFHDQEgAhA6GgwBCyALICAQ+AIgCxCTAiALEFggCyABKAKQARBUIAsQtQQgBUHQA2oiASAFQfQFahB4IAUtAOgFQQFGBEAgACABEDcaIAUtAOgFQQFHDQEgARA6GgwBCyAFQQE6AIQGIAAgCxCjARoLIAUoAjwiAARAIAAQIgsgBSgCTCIABEAgABAiCyAFKAJcIgAEQCAAECILIAUoAmwiAARAIAAQIgsgBSgCfCIARQ0AIAAQIgsgBSgCjAEiAARAIAAQIgsgBSgCnAEiAEUNACAAECILIAUoArABEJ0CIAUoArwBEM0BIAUoAsgBEM0BCyALEDoaIAUoAtACIgAEQCAAECILIAUoAuACIgAEQCAAECILIAUoAvACIgAEQCAAECILIAUoAoADIgAEQCAAECILIAUoApADIgAEQCAAECILIAUoAqADIgAEQCAAECILIAUoArADIgAEQCAAECILIAUoAsADIgBFDQAgABAiCyAFKAL8BSEGCwJAIAZFDQAgBi0AEA0AIAUtAIQGQQFxDQAgBSgCgAYiAEEKSg0AIAYgBigCDCAAa0ELajYCDAsgBUGgCGokAAuCAQEDfyAAQgA3AgQgACgCACEDIABBADYCACAAIAEoAgQiBBBEIAAgBDYCBAJAAkAgASgCBCIEBEAgACgCACEAIAEoAgAhAQNAIAAgAkEDdGogAyABIAJBAnRqKAIAQQN0aikCADcCACACQQFqIgIgBEcNAAsMAQsgA0UNAQsgAxAiCwtmAQF/IABBADYCCCAAQgA3AgBBBBAjIgFBATYCACAAQQA2AhggAEIANwIQIAAgATYCDEEEECMiAUEBNgIAIABBADYCKCAAQgA3AiAgACABNgIcQQQQIyIBQQE2AgAgACABNgIsIAALxwEBBn8CQCAAKAIEIgJFDQAgACgCDEUNACABKAIAIQMgACgCAAJ/IAMgAkEBa3EgAmkiAUEBTQ0AGiADIAIgA0sNABogAyACcAsiBUECdGooAgAiAEUNACAAKAIAIgBFDQAgAkEBayEGIAFBAUshBwNAAkAgAyAAKAIEIgFHBEACQCAHRQRAIAEgBnEhAQwBCyABIAJJDQAgASACcCEBCyABIAVHDQMMAQsgACgCCCADRw0AIAAhBAwCCyAAKAIAIgANAAsLIAQLNAEBfyABQdaq1aoBTwRAECYACyAAIAFBDGwiAhAjIgE2AgQgACABNgIAIAAgASACajYCCAtKAQJ/IAAoAgQiAiAAKAIIIgFHBEADQCAAIAFBGGsiATYCCCABECgaIAIgACgCCCIBRw0ACwsgACgCACIBBEAgACgCDBogARAiCws8AQF/IAAgAUcEQCAAIQMDQCACIAMQiwFBGGohAiADQRhqIgMgAUcNAAsDQCAAEChBGGoiACABRw0ACwsLSgECfyAAKAIEIgIgACgCCCIBRwRAA0AgACABQUBqIgE2AgggARBBGiACIAAoAggiAUcNAAsLIAAoAgAiAQRAIAAoAgwaIAEQIgsLtwEBBX8gACgCBCICIQQgASgCBCAAKAIAIgMgAmtqIgYhBSADIARHBEAgAyECA0AgBSACELQBQUBrIQUgAkFAayICIARHDQALA0AgAxBBQUBrIgMgBEcNAAsLIAEgBjYCBCAAIAAoAgAiAjYCBCAAIAEoAgQ2AgAgASACNgIEIAAoAgQhAiAAIAEoAgg2AgQgASACNgIIIAAoAgghAiAAIAEoAgw2AgggASACNgIMIAEgASgCBDYCAAuhAgEFfyMAQSBrIgUkAAJAAkAgACgCBCICIAAoAggiA0kEQCACIAErAwA5AwAgAkEIaiEBDAELIAIgACgCACIEa0EDdSIGQQFqIgJBgICAgAJPDQEgBUEMakH/////ASADIARrIgNBAnUiBCACIAIgBEkbIANB+P///wdPGyAGIAAQSyICKAIIIgMgASsDADkDACACIANBCGo2AgggAigCBCAAKAIEIAAoAgAiA2siAWshBCABBEAgBCADIAH8CgAACyAAKAIAIQMgACAENgIAIAIgAzYCBCAAIAIoAggiATYCBCACIAM2AgggACgCCCEEIAAgAigCDDYCCCACIAM2AgAgAiAENgIMIAIQmQELIAAgATYCBCAFQSBqJAAPCxAmAAs9AQJ/IAAoAgQiAiAAKAIIIgFHBEAgACABIAIgAWtBP2pBQHFqNgIICyAAKAIAIgEEQCAAKAIMGiABECILC4gBAgJ/AXwjAEEQayICJABBmJ8CLQAAQQFxRQRAQQJBjIwCQQMQBiEDQZifAkEBOgAAQZSfAiADNgIACyABKAIEIgFBCU8EQCABEBMLIAIgATYCCCACQQA2AgRBlJ8CKAIAIABBACACQQRqIAJBCGoQBSACKAIEIgAEQCAAEAQLIAJBEGokAPwDC0kBAn8gACgCBCIFQQh1IQYgACgCACIAIAEgBUEBcQR/IAIoAgAgBmooAgAFIAYLIAJqIANBAiAFQQJxGyAEIAAoAgAoAhgRBwALmgEAIABBAToANQJAIAIgACgCBEcNACAAQQE6ADQCQCAAKAIQIgJFBEAgAEEBNgIkIAAgAzYCGCAAIAE2AhAgA0EBRw0CIAAoAjBBAUYNAQwCCyABIAJGBEAgACgCGCICQQJGBEAgACADNgIYIAMhAgsgACgCMEEBRw0CIAJBAUYNAQwCCyAAIAAoAiRBAWo2AiQLIABBAToANgsLdgEBfyAAKAIkIgNFBEAgACACNgIYIAAgATYCECAAQQE2AiQgACAAKAI4NgIUDwsCQAJAIAAoAhQgACgCOEcNACAAKAIQIAFHDQAgACgCGEECRw0BIAAgAjYCGA8LIABBAToANiAAQQI2AhggACADQQFqNgIkCwsFABAcAAt9AQN/AkACQCAAIgFBA3FFDQAgAS0AAEUEQEEADwsDQCABQQFqIgFBA3FFDQEgAS0AAA0ACwwBCwNAIAEiAkEEaiEBQYCChAggAigCACIDayADckGAgYKEeHFBgIGChHhGDQALA0AgAiIBQQFqIQIgAS0AAA0ACwsgASAAawvKAQICfwF8IwBBEGsiASQAAkAgAL1CIIinQf////8HcSICQfvDpP8DTQRAIAJBgIDA8gNJDQEgAEQAAAAAAAAAAEEAENgBIQAMAQsgAkGAgMD/B08EQCAAIAChIQAMAQsgACABEKgDIQIgASsDCCEAIAErAwAhAwJAAkACQAJAIAJBA3FBAWsOAwECAwALIAMgAEEBENgBIQAMAwsgAyAAENkBIQAMAgsgAyAAQQEQ2AGaIQAMAQsgAyAAENkBmiEACyABQRBqJAAgAAvCAQIBfAJ/IwBBEGsiAiQAAnwgAL1CIIinQf////8HcSIDQfvDpP8DTQRARAAAAAAAAPA/IANBnsGa8gNJDQEaIABEAAAAAAAAAAAQ2QEMAQsgACAAoSADQYCAwP8HTw0AGiAAIAIQqAMhAyACKwMIIQAgAisDACEBAkACQAJAAkAgA0EDcUEBaw4DAQIDAAsgASAAENkBDAMLIAEgAEEBENgBmgwCCyABIAAQ2QGaDAELIAEgAEEBENgBCyACQRBqJAALjQEAIAAgACAAIAAgACAARAn3/Q3hPQI/okSIsgF14O9JP6CiRDuPaLUogqS/oKJEVUSIDlXByT+gokR9b+sDEtbUv6CiRFVVVVVVVcU/oKIgACAAIAAgAESCki6xxbizP6JEWQGNG2wG5r+gokTIilmc5SoAQKCiREstihwnOgPAoKJEAAAAAAAA8D+gowtqAQJ/IAAgACgCRDYCSCACKAIEIgMgAigCACIERwRAIAMgBGtBBHVBAWshBEEAIQMDQCAAIAEgAiADIAQQtAIgAyEEIANBAWoiAyACKAIEIAIoAgBrQQR1SQ0ACwsgACgCUCAAQcQAahB2C+4TAwV/B3wCfiMAQSBrIgkkAAJAIAIoAgAiBSADQQR0IgdqIgYpAwAgBSAEQQR0IghqIgUpAwBRBEAgBikDCCAFKQMIUQ0BC0QAAAAAAADwPyEKAkAgACgCOCIFIAdqIgYrAwgiDSAFIAhqIgUrAwAiDqIgBSsDCCIPIAYrAwAiEKKhIgtEAAAAAAAA8D9kDQAgCyIKRAAAAAAAAPC/Y0UNAEQAAAAAAADwvyEKCwJAIAAoApgBRQRAIAArAxAhDAwBCyAAIABBiAFqIAIgAEE4aiADIAQQ+wEiDDkDECABLQAUQQFHDQAgACAMmiIMOQMQCwJAAkAgDJlEEeotgZmXcT1lBEAgAigCACADQQR0aiEGAkAgACgCSCIBIAAoAkwiAkkEQCABIAYpAwg3AwggASAGKQMANwMAIAFBEGohAgwBCyABIABBxABqIgQoAgAiAWtBBHUiA0EBaiIFQYCAgIABTw0CIAlBDGpB/////wAgAiABayICQQN1IgEgBSABIAVLGyACQfD///8HTxsgAyAEEDIiBCgCCCIBIAYpAwg3AwggASAGKQMANwMAIAQgBCgCCEEQajYCCCAEKAIEIAAoAkggACgCRCIBayIDayECIAMEQCACIAEgA/wKAAALIAAoAkQhAyAAIAI2AkQgBCADNgIEIAAgBCgCCCICNgJIIAQgAzYCCCAAKAJMIQEgACAEKAIMNgJMIAQgAzYCACAEIAE2AgwgBBA2CyAAIAI2AkgMAwsgECAOoiANIA+ioCILRCuHFtnO9++/ZEUgCiAMokQAAAAAAAAAAGNFckUEQCAAKAI4IARBBHRqIgQrAwggDKIgAigCACIFIANBBHRqIgEpAwi5oBA0/AYhEiAEKwMAIAyiIAEpAwC5oBA0/AYhESAAQcQAaiEHAkAgACgCSCIEIAAoAkwiAUkEQCAEIBI3AwggBCARNwMAIARBEGohBAwBCyAEIAcoAgAiBGtBBHUiBUEBaiIGQYCAgIABTw0CIAlBDGpB/////wAgASAEayIEQQN1IgEgBiABIAZLGyAEQfD///8HTxsgBSAHEDIiBigCCCIBIBI3AwggASARNwMAIAYgAUEQajYCCCAGKAIEIAAoAkggACgCRCIBayIFayEEIAUEQCAEIAEgBfwKAAALIAAoAkQhBSAAIAQ2AkQgBiAFNgIEIAAgBigCCCIENgJIIAYgBTYCCCAAKAJMIQEgACAGKAIMNgJMIAYgBTYCACAGIAE2AgwgBhA2IAAoAkwhASACKAIAIQULIAAgBDYCSCAFIANBBHRqIQgCQCABIARLBEAgBCAIKQMINwMIIAQgCCkDADcDACAEQRBqIQEMAQsgBCAHKAIAIgRrQQR1IgVBAWoiBkGAgICAAU8NAiAJQQxqQf////8AIAEgBGsiBEEDdSIBIAYgASAGSxsgBEHw////B08bIAUgBxAyIgYoAggiASAIKQMINwMIIAEgCCkDADcDACAGIAYoAghBEGo2AgggBigCBCAAKAJIIAAoAkQiAWsiBWshBCAFBEAgBCABIAX8CgAACyAAKAJEIQUgACAENgJEIAYgBTYCBCAAIAYoAggiATYCSCAGIAU2AgggACgCTCEEIAAgBigCDDYCTCAGIAU2AgAgBiAENgIMIAYQNgsgACABNgJIIANBBHQiBCAAKAI4aiIDKwMIIAArAxAiC6IgAigCACAEaiICKQMIuaAQNPwGIRIgCyADKwMAoiACKQMAuaAQNPwGIRECQCAAKAJMIgIgAUsEQCABIBI3AwggASARNwMAIAFBEGohAgwBCyABIAcoAgAiAWtBBHUiA0EBaiIEQYCAgIABTw0CIAlBDGpB/////wAgAiABayICQQN1IgEgBCABIARLGyACQfD///8HTxsgAyAHEDIiBCgCCCIBIBI3AwggASARNwMAIAQgAUEQajYCCCAEKAIEIAAoAkggACgCRCIBayIDayECIAMEQCACIAEgA/wKAAALIAAoAkQhAyAAIAI2AkQgBCADNgIEIAAgBCgCCCICNgJIIAQgAzYCCCAAKAJMIQEgACAEKAIMNgJMIAQgAzYCACAEIAE2AgwgBBA2CyAAIAI2AkgMAwsgACgCZCIBQQJHIAtEK4cW2c737z9kcQ0BAkACQAJAAkAgAUEBaw4DAwIAAQsgCyAAKwMYRAAAAAAAAPC/oGQNBAsgACACIAMgBBC2AgwECyAAIAIgAyAEAnwgCiALoCAKvUL///////////8Ag0KBgICAgICA+P8AVCALvUL///////////8Ag0KAgICAgICA+P8AWHFFDQAaIAu9IhFCIIinIgJBgIDA/wNrIBGnIgFyRQRAIAoQqQMMAQsgAkEedkECcSIAIAq9IhFCP4inciEEAkAgEUIgiKdB/////wdxIgMgEadyRQRAAkACQCAEQQJrDgIAAQMLRBgtRFT7IQlADAMLRBgtRFT7IQnADAILRBgtRFT7Ifk/IAqmIAEgAkH/////B3EiAXJFDQEaAkAgAUGAgMD/B0YEQCADQYCAwP8HRw0BIARBA3QrA/CZAQwDC0QYLURU+yH5PyAKpiADQYCAwP8HRyABQYCAgCBqIANPcUUNAhoCfCAABEBEAAAAAAAAAAAgA0GAgIAgaiABSQ0BGgsgCiALo5kQqQMLIQoCQAJAAkAgBEEBaw4DAAECBAsgCpoMBAtEGC1EVPshCUAgCkQHXBQzJqahvKChDAMLIApEB1wUMyamobygRBgtRFT7IQnAoAwCCyAEQQN0KwOQmgEhCgsgCgsQtQIMAwsgACACIAMgBBC3AgwCCxAmAAsjAEEgayIGJAAgACgCOCIFIARBBHRqIgQrAwggBSADQQR0IgFqIgMrAwigIAArAxAgC0QAAAAAAADwP6CjIguiIAIoAgAgAWoiASkDCLmgIQogBCsDACADKwMAoCALoiABKQMAuaAhCwJAAkACQCAAKAJIIgEgACgCTCICSQRAIAEgChA0/AY3AwggASALEDT8BjcDACABQRBqIQMMAQsgASAAQcQAaiIEKAIAIgFrQQR1IgNBAWoiBUGAgICAAU8NASAGQQxqQf////8AIAIgAWsiAkEDdSIBIAUgASAFSxsgAkHw////B08bIAMgBBAyIgUoAggiASAKEDT8BjcDCCABIAsQNPwGNwMAIAUgAUEQajYCCCAFKAIEIAAoAkggACgCRCIBayIDayECIAMEQCACIAEgA/wKAAALIAAoAkQhBCAAIAI2AkQgBSAENgIEIAAgBSgCCCIDNgJIIAUgBDYCCCAAKAJMIQEgACAFKAIMNgJMIAUgBDYCACAFIAE2AgwgBRA2CyAAIAM2AkggBkEgaiQADAELECYACwsgCUEgaiQAC5EKAwd/B3wCfiMAQSBrIggkACAAKwMQIQ4gACgCmAEEQCAARBgtRFT7IRlAIA6ZIgxEGC1EVPshCUCiIg9EGC1EVPshCUBEAAAAAAAA8D8gACsDeCINIAwgDCANZBsgDET8qfHSTWJgP6IgDUQR6i2BmZdxPWQbIAyjoRCqA6MiDCAMIA9kGyIMoyINELECOQMwIAAgDRCwAiINOQMoIA5EAAAAAAAAAABjBEAgACANmjkDKAsgACAMRBgtRFT7IRlAozkDIAsgDiAAKAI4IANBBHRqIgUrAwiiIgyaIAwgAiADRiIDGyIMIAEoAgAgAkEEdGoiCSkDCLkiEKAhDSAFKwMAIA6iIg6aIA4gAxsiDiAJKQMAuSIRoCEPIABBxABqIQkCQAJAIAAoAkgiAyAAKAJMIgVJBEAgAyANEDT8BjcDCCADIA8QNPwGNwMAIANBEGohAwwBCyADIAkoAgAiBmtBBHUiB0EBaiIDQYCAgIABTw0BIAhBDGpB/////wAgBSAGayIFQQN1IgYgAyADIAZJGyAFQfD///8HTxsgByAJEDIiBSgCCCIDIA0QNPwGNwMIIAMgDxA0/AY3AwAgBSADQRBqNgIIIAUoAgQgACgCSCAAKAJEIgZrIgNrIQcgAwRAIAcgBiAD/AoAAAsgACgCRCEGIAAgBzYCRCAFIAY2AgQgACAFKAIIIgM2AkggBSAGNgIIIAAoAkwhByAAIAUoAgw2AkwgBSAGNgIAIAUgBzYCDCAFEDYLIAAgAzYCSCAEmSAAKwMgopv8AiILQQJOBEBBASEFA0AgDiAAKwMoIg+iIAwgACsDMCISoqAiBCAQoCENIA4gEqIgDyAMoqEiDiARoCEMAkAgACgCTCIGIANLBEAgAyANEDT8BjcDCCADIAwQNPwGNwMAIANBEGohAwwBCyADIAkoAgAiB2tBBHUiCkEBaiIDQYCAgIABTw0DIA0QNCENIAhBDGpB/////wAgBiAHayIGQQN1IgcgAyADIAdJGyAGQfD///8HTxsgCiAJEDIhByAIKAIUIgMgDfwGNwMIIAMgDBA0/AY3AwAgCCADQRBqNgIUIAgoAhAgACgCSCAAKAJEIgZrIgNrIQogAwRAIAogBiAD/AoAAAsgACgCRCEGIAAgCjYCRCAIIAY2AhAgACAIKAIUIgM2AkggCCAGNgIUIAAoAkwhCiAAIAgoAhg2AkwgCCAKNgIYIAcgBjYCACAHEDYLIAAgAzYCSCAEIQwgBUEBaiIFIAtHDQALCyACQQR0IgIgACgCOGoiBSsDCCAAKwMQIgSiIAEoAgAgAmoiASkDCLmgEDT8BiETIAQgBSsDAKIgASkDALmgEDT8BiEUAkAgACgCTCICIANLBEAgAyATNwMIIAMgFDcDACADQRBqIQUMAQsgAyAJKAIAIgNrQQR1IgVBAWoiAUGAgICAAU8NASAIQQxqQf////8AIAIgA2siAkEDdSIDIAEgASADSRsgAkHw////B08bIAUgCRAyIgEoAggiAiATNwMIIAIgFDcDACABIAJBEGo2AgggASgCBCAAKAJIIAAoAkQiBWsiAmshAyACBEAgAyAFIAL8CgAACyAAKAJEIQIgACADNgJEIAEgAjYCBCAAIAEoAggiBTYCSCABIAI2AgggACgCTCEDIAAgASgCDDYCTCABIAI2AgAgASADNgIMIAEQNgsgACAFNgJIIAhBIGokAA8LECYAC/cFAgR/EXwjAEEgayIEJAAgACgCOCEFAkAgAiADRyIGRQRAIAUgAkEEdGoiBSsDACIImiEKIAUrAwgiCyEJDAELIAUgAkEEdGoiBysDCCAFIANBBHRqIgUrAwgiC6EiDCAMoiAFKwMAIgggBysDAKEiDyAPoqCfIg2ZRPyp8dJNYlA/YwRADAELIA9EAAAAAAAA8D8gDaMiD6IhCiAMIA+iIQkLIAkgACsDECIOoiIQIAogDpkiEaIgASgCACIBIAJBBHRqIgIpAwi5IhegIg2gIg8gDSAQoSIMoSETIAkgEaIgAikDALkiGKAiCSAKIA6iIhShIhEgFCAJoCIKoSIWmiEVIAsgDqIiCyABIANBBHRqIgEpAwi5oCESIAggDqIiCCABKQMAuaAhDgJAIAZFBEAgBCANOQMYIAQgCTkDECANIQggCSELIBMgECAOoCAOoSIQoiAUIBKgIBKhIhQgFaKgIhVEAAAAAAAAAABiBEAgBAJ8IAogDqEgFKIgDCASoSAQoqEgFaMiCEQAAAAAAAAAAGUEQCAEIAo5AxAgCiELIAwMAQsgCEQAAAAAAADwP2YEQCAEIBE5AxAgESELIA8MAQsgBCAIIBaiIAqgIgs5AxAgCCAToiAMoAsiCDkDGAsgBCANIA0gCKGgOQMIIAQgCSAJIAuhoDkDACAAQcQAaiIAIAQQrgEgACAEQRBqEK4BDAELIAQgDTkDGCAEIAk5AxAgEyAIIBigIA6hIgiiIAsgF6AgEqEiCyAVoqAiEEQAAAAAAAAAAGIEQAJAIAogDqEgC6IgDCASoSAIoqEgEKMiCEQAAAAAAAAAAGUEQCAEIAo5AxAMAQsgCEQAAAAAAADwP2YEQCAEIBE5AxAgDyEMDAELIAQgCCAWoiAKoDkDECAIIBOiIAygIQwLIAQgDDkDGAsgAEHEAGoiACAEQRBqEK4BIAQgDSANIAQrAxihoDkDCCAEIAkgCSAEKwMQoaA5AwAgACAEEK4BCyAEQSBqJAALqQIDAn8FfAF+IwBBIGsiBCQAIARCADcDGCAEQgA3AxACfCACIANGBEAgAkEEdCICIAEoAgBqIgEpAwAhCyAAKAI4IAJqIgIrAwAhBiAEIAEpAwi5IgcgACsDEJkiCCACKwMIoiIJoTkDGCAEIAu5IgogCCAGoiIGoTkDECAJIAegIQcgBiAKoAwBCyACQQR0IgIgASgCAGoiASkDACELIAAoAjgiBSADQQR0aiIDKwMAIQcgBCAAKwMQIgYgAysDCKIgASkDCLkiCKA5AxggBCAGIAeiIAu5IgmgOQMQIAYgAiAFaiIBKwMIoiAIoCEHIAYgASsDAKIgCaALIQYgBCAHOQMIIAQgBjkDACAAQcQAaiIAIARBEGoQrgEgACAEEK4BIARBIGokAAuxDQENfyMAQRBrIgwkAAJAIAVFDQADQAJAIAUgB0wgBCAHTHJFBEAgBEUNAyABKAIEIQgDQAJAAkAgCEUNACAAKAIERQ0AIAAoAgApAwAgASgCACkDAFcNAQwECyAIDQMLIABBDGohACAEQQFrIgQNAAsMAwsgACEIIAIhByMAQRBrIgkkAAJAIAQgBUwEQCAGIQIgASAIRwRAA0AgAiAAKAIINgIIIAIgACkCADcCACACQQxqIQIgAEEMaiIAIAFHDQALCwJAIAIgBkYNAANAIAEgB0YEQCACIAZrQQNrIgBFDQIgCCAGIAD8CgAADAILAkACQAJAAkAgASgCBCIARQ0AIAYoAgRFDQAgBigCACkDACABKAIAKQMAVQ0BDAILIABFDQELIAggAS0ACDoACCAIIAEpAgA3AgAgAUEMaiEBDAELIAggBi0ACDoACCAIIAYpAgA3AgAgBkEMaiEGCyAIQQxqIQggAiAGRw0ACwsMAQsgBiECIAEgB0cEQCABIQADQCACIAAoAgg2AgggAiAAKQIANwIAIAJBDGohAiAAQQxqIgAgB0cNAAsLIAkgAzYCDAJAIAYgAiIDRg0AA0AgCCABIgJGBEADQCAHQQxrIgcgA0EMayIDLQAIOgAIIAcgAykCADcCACADIAZHDQAMAwsACyADQQxrIQQgAkEMayEAAkACQAJAIANBCGsoAgAiBUUNACACQQhrKAIARQ0AIAAiASgCACkDACAEKAIAKQMAVw0BDAILIAAhASAFDQELIAIhASAEIgAhAwsgB0EMayIHIAAtAAg6AAggByAAKQIANwIAIAMgBkcNAAsLCyAJQRBqJAAMAgsCQCAEIAVIBEAgASAFQQJtIg9BDGxqIQsgASAAIglHBEAgASAAa0EMbSEQIAsoAgAhEiALKAIEIQoDQCAJIBBBAXYiDUEMbGohCAJ/AkACQAJAIApFDQAgCCgCBEUNACAIKAIAKQMAIBIpAwBXDQEMAgsgCg0BCyAIQQxqIQkgECANQX9zagwBCyANCyIQDQALCyAJIABrQQxtIRAMAQsgBEEBRgRAIAwgACgCCDYCCCAMIAApAgA3AwAgACABLQAIOgAIIAAgASkCADcCACABIAwtAAg6AAggASAMKQMANwIADAMLIAxBADoADyABIQsgACAEQQJtIhBBDGxqIQkgAiABa0EMbSIPBEAgCSgCACENIAkoAgQhEgNAAn8CQAJAIAsgD0EBdiIIQQxsaiIKKAIEIg5FIBJFckUEQCANKQMAIAooAgApAwBVDQEMAgsgDkUNAQsgCkEMaiELIA8gCEF/c2oMAQsgCAsiDw0ACwsgCyABa0EMbSEPCyMAQRBrIg4kAAJAIAEgCUYEQCAMIAs2AgQgDCALNgIADAELIAEgC0YEQCAMIAE2AgQgDCAJNgIADAELAkAgASAJQQxqIghGBEAgDiAJKAIINgIIIA4gCSkCADcDACALIAFrIgFBA2siCgRAIAkgCCAK/AoAAAsgASAJaiIBIA4tAAg6AAggASAOKQMANwIADAELIAsgAUEMakYEQCAOIAtBDGsiCCgCCDYCCCAOIAgpAgA3AwAgCyAIIAlrIgpBdG1BDGxqIQECQCAIIAlGDQAgCkEDayIIRQ0AIAEgCSAI/AoAAAsgCSAOLQAIOgAIIAkgDikDADcCAAwBCwJ/IwBBEGshESABIAkiCmsiE0EMbSISIAsgAWsiFEEMbSIIRwRAIBIhAQNAIAEgCCIBbyIIDQALIAogAUEMbGohDQNAIBEgDUEMayINKAIINgIIIBEgDSkCADcDACANIBNqIQggDSEBA0AgASAILQAIOgAIIAEgCCkCADcCACAIIgEgE2ogCiASIAsgAWtBDG0iCGtBDGxqIAggEkobIgggDUcNAAsgASARLQAIOgAIIAEgESkDADcCACAKIA1HDQALIAogFGoMAQsCQCABIApGIAEgC0ZyDQAgASEIA0AgESAKKAIINgIIIBEgCikCADcDACAKIAgtAAg6AAggCiAIKQIANwIAIAggES0ACDoACCAIIBEpAwA3AgAgCkEMaiIKIAFGDQEgCEEMaiIIIAtHDQALCyABCyEBCyAMIAs2AgQgDCABNgIACyAOQRBqJAAgDCgCACEBAn8gDyAQaiAEIBBrIgQgBSAPayIFakgEQCAAIAkgASADIBAgDyAGIAcQuAIgASEAIAsMAQsgASALIAIgAyAEIAUgBiAHELgCIA8hBSAQIQQgASECIAkLIQEgBQ0ACwsgDEEQaiQAC68MAgl/An4jAEEQayIQJAACQCAFRQ0AA0ACQCAFIAdMIAQgB0xyRQRAIARFDQMgASgCACIJKAIAIggpAwghEQNAAkAgESAAKAIAIgooAgAiCykDCCISUgRAIBEgElcNAQwECyALKQMAIAgpAwBVDQMLIABBBGohACAEQQFrIgQNAAsMAwsgACEHIAEhCUEAIQgjAEEQayIKJAACQAJAAkACQAJAIAQgBUwEQCAAIAFHDQEgBiEADAILIAIgCUcNAiAGIQAMAwsgBiEAIAchAQNAIAEoAgAhAyABQQA2AgAgACADNgIAIABBBGohACAIQQFqIQggAUEEaiIBIAlHDQALCyAKIAg2AgwjAEEQayIDJAACQCAAIAYiAUYNAANAIAIgCUYEQCAAIAFHBEADQCABKAIAIQQgAUEANgIAIAcoAgAhAiAHIAQ2AgAgAgRAIAIQIgsgB0EEaiEHIAFBBGoiASAARw0ACyAAIQELIAMgBzYCDCADIAE2AggMAgsCQAJAAkAgASgCACIFKAIAIgQpAwgiESAJKAIAIggoAgAiCykDCCISUgRAIBEgElMNAQwCCyAEKQMAIAspAwBXDQELIAlBADYCACAHKAIAIQQgByAINgIAIAQEQCAEECILIAlBBGohCQwBCyABQQA2AgAgBygCACEEIAcgBTYCACAEBEAgBBAiCyABQQRqIQELIAdBBGohByAAIAFHDQALCyADQRBqJAAMAgsgBiEAA0AgASgCACEEIAFBADYCACAAIAQ2AgAgAEEEaiEAIAhBAWohCCABQQRqIgEgAkcNAAsLIAogCDYCDCAKIAM2AgggCSEBIAIhBAJAIAYgACICRg0AA0AgASAHRgRAA0AgAkEEayICKAIAIQEgAkEANgIAIARBBGsiBCgCACEAIAQgATYCACAABEAgABAiCyACIAZHDQAMAwsACwJAAkACQCABQQRrIgAoAgAiCSgCACIFKQMIIhEgAkEEayIDKAIAIggoAgAiCykDCCISUgRAIBEgElMNAQwCCyAFKQMAIAspAwBXDQELIABBADYCACAEQQRrIgEoAgAhBSABIAk2AgAgACEBDAELIANBADYCACAEQQRrIgAoAgAhBSAAIAg2AgAgASEAIAMhAgsgBQRAIAUQIiAAIQELIARBBGshBCACIAZHDQALCwsgBgRAIApBDGogBhC0AwsgCkEQaiQADAILAkAgBCAFSARAIAEgBUECbSINQQJ0aiEKIAEgACIJRwRAIAEgAGtBAnUhCCAKKAIAKAIAIgwpAwghEQNAAn8CQAJAIBEgCSAIQQF2IgtBAnRqIg4oAgAoAgAiDykDCCISUgRAIBEgElcNAQwCCyAPKQMAIAwpAwBVDQELIA5BBGohCSAIIAtBf3NqDAELIAsLIggNAAsLIAkiCyAAa0ECdSEODAELIARBAUYEQCAAIAk2AgAgASAKNgIADAMLIBBBADoADiABIQkgACAEQQJtIg5BAnRqIgshCiACIAFrQQJ1IggEQCAKKAIAKAIAIgwpAwghEQNAAn8CQAJAIAkgCEEBdiIKQQJ0aiINKAIAKAIAIg8pAwgiEiARUgRAIBEgElMNAQwCCyAMKQMAIA8pAwBXDQELIA1BBGohCSAIIApBf3NqDAELIAoLIggNAAsLIAkiCiABa0ECdSENCyAFIA1rIQUgBCAOayEEAn8gCiABIAtGDQAaIAsgASAKRg0AGiALKAIAIQkgCyABKAIANgIAIAEgCTYCACALQQRqIQwgCiABQQRqIghHBEADQCAMKAIAIQkgDCAIKAIANgIAIAggCTYCACAIIAEgASAMRhshASAMQQRqIQwgCEEEaiIIIApHDQALCyABIAxHBEAgDCEIIAEhCQNAIAgoAgAhDyAIIAkoAgA2AgAgCSAPNgIAIAhBBGohCCAKIAlBBGoiCUYEQCABIQkgASAIRw0BBSAJIAEgASAIRhshAQwBCwsLIAwLIQECfyANIA5qIAQgBWpIBEAgACALIAEgAyAOIA0gBiAHELkCIAEhACAKDAELIAEgCiACIAMgBCAFIAYgBxC5AiANIQUgDiEEIAEhAiALCyEBIAUNAAsLIBBBEGokAAuHBwMFfwR+AnwjAEEgayIIJAACQCAARQ0AIAAoAhAiBSAARg0AIAJFBEAgBSAAKAIURg0BCyADELYDIAEEfyAAQRRqBSAAKAIQIgBBEGoLIAQgACkDCCIKuaIhDiAEIAApAwAiC7miIQ8oAgAhBgJAAkACQCADKAIEIgIgAygCCCIFSQRAIAIgDjkDCCACIA85AwAgAkEQaiECDAELIAIgAygCACIJa0EEdSIHQQFqIgJBgICAgAFPDQEgCEEMakH/////ACAFIAlrIgVBA3UiCSACIAIgCUkbIAVB8P///wdPGyAHIAMQMiIFKAIIIgIgDjkDCCACIA85AwAgBSACQRBqNgIIIAUoAgQgAygCBCADKAIAIglrIgJrIQcgAgRAIAcgCSAC/AoAAAsgAygCACEJIAMgBzYCACAFIAk2AgQgAyAFKAIIIgI2AgQgBSAJNgIIIAMoAgghByADIAUoAgw2AgggBSAJNgIAIAUgBzYCDCAFEDYLIAMgAjYCBCAAIAZHBEBBFEEQIAEbIQkDQCALIAYpAwAiDVEgBikDCCIMIApRcUUEQCAEIAy5oiEOIAQgDbmiIQ8CQCADKAIIIgUgAksEQCACIA45AwggAiAPOQMAIAJBEGohAgwBCyACIAMoAgAiAmtBBHUiB0EBaiIBQYCAgIABTw0EIAhBDGpB/////wAgBSACayICQQN1IgUgASABIAVJGyACQfD///8HTxsgByADEDIhBSAIKAIUIgEgDjkDCCABIA85AwAgCCABQRBqNgIUIAgoAhAgAygCBCADKAIAIgdrIgFrIQIgAQRAIAIgByAB/AoAAAsgAygCACEBIAMgAjYCACAIIAE2AhAgAyAIKAIUIgI2AgQgCCABNgIUIAMoAgghByADIAgoAhg2AgggCCAHNgIYIAUgATYCACAFEDYLIAMgAjYCBCANIQsgDCEKCyAGIAlqKAIAIgYgAEcNAAsLAkAgAiADKAIAa0EwRw0AIAYoAhQiACAGKAIQIgEoAhBHDQAgACkDACIMIAEpAwAiCn1CAXxCAlgEQCAAKQMIIAEpAwh9QgF8QgNUDQMLIAYpAwBCAXwiCyAKfUICWARAIAYpAwggASkDCH1CAXxCA1QNAwsgCyAMfUICVg0AIAYpAwggACkDCH1CAXxCA1QNAgtBASEGDAILECYAC0EAIQYLIAhBIGokACAGC5UCAQJ/AkAgASgCFA0AIAEpAzggASkDKFcNACABKQMwIAEpAyBXDQACQAJAIAEoAgQiA0UNAANAAkAgAygCGCIEBEAgACABIAQQvAINASABKAIEIQMLAkAgAygCEEUNACAAIAMQ/AEgASgCBCEDRQ0AIAEpAyAgAykDIFMNACABKQMwIAMpAzBVDQAgASkDKCADKQMoUw0AIAEpAzggAykDOFUNACABKAIQIAMoAhAQ2gENASABKAIEIQMLIAEgAygCBCIDNgIEIAMNAQwCCwsgASgCBCIERQ0AIAQoAhQiAw0BIAAgBCACELsCIAEoAgQoAhQhAwwBCyACIQMLIAEgAyABQUBrIAMoAgAoAggRAgA2AhQLC6gCAQN/AkAgAigCACIDIAIoAgRHBEADQAJAIAMgBEECdGooAgAiAygCEA0AIAMoAhgiBUUNACAAIAEgBRC8Ag0DCwJAA0AgAygCEEUEQCADKAIEIgMNAQwCCwsgASADRg0AIAMoAhwgAUYNACADIAE2AhwgAygCGCIFBEAgACABIAUQvAINBAsgACADEPwBRQ0AIAEpAyAgAykDIFMNACABKQMwIAMpAzBVDQAgASkDKCADKQMoUw0AIAEpAzggAykDOFUNACABKAIQIAMoAhAQ2gFFDQAgAyEEA0AgBCgCBCIEBEAgASAERw0BCwsgBARAIAMgASgCBDYCBAsgASADNgIEDAMLIARBAWoiBCACKAIEIAIoAgAiA2tBAnVJDQALC0EADwtBAQveEwMIfxd+BnwCQAJAIAFFDQADQCABKAIQIgNFBEAgASgCBCIBDQEMAgsLIAEtAEwNAAJAAkAgAygCECICIANGDQAgAiADKAIUIgVGDQAgAigCECAFRw0BIAUpAwAiCiACKQMAIgt9QgF8QgJYBEAgBSkDCCACKQMIfUIBfEIDVA0BCyADKQMAQgF8IgwgC31CAlgEQCADKQMIIAIpAwh9QgF8QgNUDQELIAwgCn1CAlYNASADKQMIIAUpAwh9QgF8QgJWDQELIAMoAhRBADYCEAwCCwNAIAMpAwghDCADKQMAIQogAC0AdEEBcSEIIAMhAgNAIAwhCwJAIAIiBSgCECICKQMIIgwgC30iECAQQj+HIhKFIBJ9Ig1C/////w+DIg4gCiIPIAUoAhQiBCkDACIafSIRIBFCP4ciE4UgE30iCkL/////D4MiFH4iFUIgiCAOIApCIIgiG358IhxC/////w+DIA1CIIgiHSAUfnwiHkIghiAVQv////8Pg4QgAikDACIKIA99Ig0gDUI/hyIUhSAUfSIWQv////8PgyIXIAsgBCkDCCIffSIOIA5CP4ciFYUgFX0iGEL/////D4MiGX4iIEIgiCAXIBhCIIgiGH58IhdC/////w+DIBZCIIgiFiAZfnwiGUIghiAgQv////8Pg4RSIBsgHX4gHEIgiHwgHkIgiHwgFiAYfiAXQiCIfCAZQiCIfFJyIBKnIBBCAFVqIBOnIBFCAFVqbCAUpyANQgBVaiAVpyAOQgBVamxHcg0AIA8gGlEgCyAfUXEgCiAPUiALIAxSckUgCEVyckUEQCARuSANuaIgELkgDrmioEQAAAAAAAAAAGNFDQELIAEoAhAgBUYEQCABIAQ2AhALIAQgAjYCECACIAQ2AhQgBRAiAkAgAigCECIFIAJGDQAgBSACKAIUIgRGDQAgAiEDIAUoAhAgBEcNAyAEKQMAIgogBSkDACILfUIBfEICWARAIAQpAwggBSkDCH1CAXxCA1QNAQsgAikDAEIBfCIMIAt9QgJYBEAgAikDCCAFKQMIfUIBfEIDVA0BCyAMIAp9QgJWDQMgAikDCCAEKQMIfUIBfEICVg0DCyABKAIQIgMoAhRBADYCEAwECyACIANHDQALCyAAIQgCQCABIgUoAhAiAygCFCIGIAMoAhAiAigCECIERg0AA0AgAyEAA0AgAiEBAkAgACkDCCAGKQMIIgp9uSIjIAQiAikDACABKQMAIgt9uSIhoiAAKQMAIAYpAwAiDH25IiQgAikDCCABKQMIIg99uSIloqEiIkQAAAAAAAAAAGENACAMIAt9uSImICWiIAogD325IiUgIaKhIiFEAAAAAAAAAABhDQACQCAhRAAAAAAAAAAAZARAICJEAAAAAAAAAABjDQIgISAiZkUNAQwCCyAhICJlICJEAAAAAAAAAABkcg0BCyAmICOiICSaICWioCIhRAAAAAAAAAAAYQ0AAkAgIUQAAAAAAAAAAGQEQCAiRAAAAAAAAAAAZEUgISAiY0VyDQIMAQsgIkQAAAAAAAAAAGNFICEgImRFcg0BCyAAIANHIAEgA0dxRQRAIAUgAygCFDYCEAtCACEKQgAhC0QAAAAAAAAAACEiIwBBIGsiBiQAIAAiAigCECIBKAIQIQMgBSAAKAIUIgA2AhACQCACKQMIIgwgACkDCCIPfbkiIyADKQMAIhIgASkDACINfbkiIaIgAikDACIQIAApAwAiEX25IiQgAykDCCITIAEpAwgiDn25IiWioSImRAAAAAAAAAAAYQ0AIBEiCiANfbkgJaIgISAPIgsgDn25oqEgJqMiIUQAAAAAAAAAAGUNACAMIQsgECEKICFEAAAAAAAA8D9mDQAgISAjoiAPuaD8BiELICEgJKIgEbmg/AYhCgsgACEBA0AgASkDCCABKAIUIgQpAwh8uSAEKQMAIAEpAwB9uaIgIqAhIiABKAIQIgEgAEcNAAsCQAJAAkAgIkQAAAAAAADgP6IiIZkiI0QAAAAAAAAAQGMEQCAAKAIUQQA2AhADQCAAKAIQIAAQIiIADQALIAVBADYCEAwBCyAMIA58uSAQIA19uaIgCyAOfLkgDSAKfbmiIAsgDHy5IAogEH25oqCgIiSZISICfyAKIBFRBEAgACEBIAMgCyAPUQ0BGgsgCiASUQRAIAAhASADIAsgE1ENARoLQSAQIyEBIAAoAhghBCABQQA2AhwgASAENgIYIAEgCzcDCCABIAo3AwAgASAANgIUIAEgAzYCECABCyEEIAMgATYCFCAAIAQ2AhACQAJAICJEAAAAAAAA8D9mRSAiICNkRSAhRAAAAAAAAAAAZEUgJEQAAAAAAAAAAGRGcXJFBEAgCBDbASIDIAUoAgQ2AgQgAiADNgIYIAIoAhAiBCADNgIYQSAQIyIBQQA2AhwgASADNgIYIAEgCzcDCCABIAo3AwAgASAENgIUIAEgAjYCECADIAE2AhAgAiABNgIUIAQgATYCECAILQAZQQFHDQMgACABENoBBEBBDBAjIgBBADYCCCAAQgA3AgAgAyAANgIYIAZBDGpBAUEAIAAQSiIBKAIIIgIgBTYCACABIAJBBGo2AgggASgCBCAAKAIEIAAoAgAiBGsiAmshAyACBEAgAyAEIAL8CgAACyAAKAIAIQIgACADNgIAIAEgAjYCBCAAIAEoAggiAzYCBCABIAI2AgggACgCCCEEIAAgASgCDDYCCCABIAI2AgAgASAENgIMIAEQUyAAIAM2AgQMBAsgBSgCGCIBRQRAQQAhAEEMECMiAUEANgIIIAFCADcCACAFIAE2AhggAUEEaiEEQQAhAgwCCyABQQRqIQQgASgCBCIAIAEoAggiAk8NASAAIAM2AgAgAEEEaiECDAILIAIoAhAiAARAIAAQIgsgAhAiDAILIAAgASgCACIHa0ECdSIJQQFqIgBBgICAgARPDQIgBkEMakH/////AyACIAdrIgJBAXUiByAAIAAgB0kbIAJB/P///wdPGyAJIAEQSiIAKAIIIgIgAzYCACAAIAJBBGo2AgggACgCBCAEKAIAIAEoAgAiA2siAmshByACBEAgByADIAL8CgAACyABKAIAIQMgASAHNgIAIAAgAzYCBCAEIAAoAggiAjYCACAAIAM2AgggASgCCCEHIAEgACgCDDYCCCAAIAM2AgAgACAHNgIMIAAQUwsgBCACNgIACyAGQSBqJAAMAQsQJgALIAUoAhAiA0UNAyADKAIUIgYgAygCECICKAIQIgRHDQIMAwsgASADRg0CIAIoAhAhBCABKAIUIQYgASEADAALAAsACwsPCwNAIAMoAhAgAxAiIgMNAAsgAUEANgIQC8MCARF+IAIpAwggASkDCCIEfSINIA1CP4ciDoUgDn0iBUL/////D4MiBiABKQMAIgcgACkDAH0iDyAPQj+HIhCFIBB9IghC/////w+DIgl+IgNCIIggBiAIQiCIIgh+fCIRQv////8PgyAJIAVCIIgiCX58IhJCIIYgA0L/////D4OEIAIpAwAgB30iBSAFQj+HIgaFIAZ9IgNC/////w+DIgogBCAAKQMIfSIEIARCP4ciB4UgB30iC0L/////D4MiDH4iE0IgiCAKIAtCIIgiC358IgpC/////w+DIANCIIgiAyAMfnwiDEIghiATQv////8Pg4RRIAggCX4gEUIgiHwgEkIgiHwgAyALfiAKQiCIfCAMQiCIfFFxIA6nIA1CAFVqIBCnIA9CAFVqbCAGpyAFQgBVaiAHpyAEQgBVamxGcQuJAwIEfwJ+An8gASkDICIHIAApAyAiBlIEQCAGIAdTDAELIABBEGoiBSABIAFBEGoiAxCHASICBEAgAkEfdgwBCwJAIAAoAlQiBC0AGEEEcQ0AIAApAxggASkDGFcNACABIAUgBEEQQRQgACgCMEEAShtqKAIAEIcBQQBMDAELAkAgASgCVCICLQAYQQRxDQAgASkDGCAAKQMYVw0AIAEgAyACQRBBFCABKAIwQQBKG2ooAgAQhwFBAE4MAQsgAS0AXCICIAEpAwgiBiAAKQMIUg0AGiACIAYgACgCWCgCACkDCFINABogAiAALQBcIAJHDQAaQQECfyAAKAIwQQBKBEAgBCgCFEEUagwBCyAEKAIQQRBqCygCACAAIAUQvgINABogACgCVCEDAn8gACgCMEEASgRAIAMoAhRBFGoMAQsgAygCEEEQagshACABKAJUIQMgAiAAKAIAIAECfyABKAIwQQBKBEAgAygCFEEUagwBCyADKAIQQRBqCygCABCHAUEASkYLQQFxC/QGAgt/An4gAEEAOgAYIAIhCSAAQTRqIQQgAEEkaiEKIwBBIGsiCyQAAkACQAJAIAEoAgAiBiABKAIEIgxGDQAgBiEAA0AgACgCBCAAKAIAa0EEdSADaiEDIABBDGoiACAMRw0ACyADRQ0AQX8gA0EFdCIAIANB////P0sbECMiByAAaiEBIAchAANAIABBADYCGCAAQgA3AxAgAEIANwMIIABCADcDACAAQSBqIgAgAUcNAAsgByECA0ACQCAGKAIAIgMgBigCBCIIRg0AQQAhASACQQA2AhQgAiEAQQAhBQNAAkAgAQRAIAEpAwAgAykDAFEEQCABKQMIIAMpAwhRDQILIAEgADYCEAsgACABNgIUIAAgAykDADcDACAAIAMpAwg3AwggAEEANgIYIAVBAWohBSAAIgFBIGohAAsgA0EQaiIDIAhHDQALIAEoAhQiA0UNACADIAEgASkDCCACKQMIURsgASABKQMAIAIpAwBRGyIDIAI2AhAgAiADNgIUAkAgAiADRiAFQQNIcg0AIAIpAwghDgNAIA4gAykDCCIPUQRAIAMoAhQiAyACRw0BDAILCyAOIA9TIg0hBSACIgEoAhAiCCABRwRAA0AgASEDAkAgBUEBcUUgCCIBKQMIIg4gAykDCCIPV3JFBEAgAyADKAIYQQRyNgIYQQAhBQwBCyAOIA9ZIAVyQQFxDQAgCiADIAkQvgNBASEFCyABKAIQIgggAkcNAAsLIA0gBUEBcUYNACANBEAgCiABIAkQvgMMAQsgASABKAIYQQRyNgIYCyAAIQILIAZBDGoiBiAMRw0ACwJAIAQoAgQiACAEKAIIIgFJBEAgACAHNgIAIABBBGohAwwBCyAAIAQoAgAiAmtBAnUiBkEBaiIAQYCAgIAETw0CIAtBDGpB/////wMgASACayIBQQF1IgIgACAAIAJJGyABQfz///8HTxsgBiAEEEoiACgCCCIBIAc2AgAgACABQQRqNgIIIAAoAgQgBCgCBCAEKAIAIgdrIgFrIQIgAQRAIAIgByAB/AoAAAsgBCgCACEBIAQgAjYCACAAIAE2AgQgBCAAKAIIIgM2AgQgACABNgIIIAQoAgghAiAEIAAoAgw2AgggACABNgIAIAAgAjYCDCAAEFMLIAQgAzYCBAsgC0EgaiQADAELECYACwszAQN/QQQQIyICIAE2AgBB/P0BIABBA0EAIQBB7IQCIABBrtsAakGuAiACQQBBAEEAEAALlwMCBX8CfCMAQTBrIgUkACAAQQA2AgggAEIANwIAIAUgARDHAwJAAkAgAiAFKwMAokQAAAAAAADAw2MNACACIAUrAxCiRAAAAAAAAMBDZA0AIAMgBSsDCKJEAAAAAAAAwMNjDQAgAyAFKwMYokQAAAAAAADAQ2QNACAAIAEoAgQgASgCAGtBDG0QViABKAIAIgYgASgCBCIHRwRAIAJEAAAAAAAAAABhIANEAAAAAAAAAABhciEIA0AgBUEANgIsIAVCADcCJCAIDQMgBUEkaiAGKAIEIAYoAgBrQQR1EFwgBigCACIBIAYoAgQiCUcEQANAIAMgASsDCKIQNCEKIAErAwAhCyAFIAr8BjcDCCAFIAIgC6IQNPwGNwMAIAVBJGogBRBMIAFBEGoiASAJRw0ACwsgACAFQSRqEGggBSgCJCIBBEAgBSABNgIoIAUoAiwaIAEQIgsgBkEMaiIGIAdHDQALCyAFQTBqJAAPCyAEIAQoAgBBwAByNgIAQcAAEIICAAsgBCAEKAIAQQJyNgIAQQIQggIACzUBAX8gASAAKAIEIgJBAXVqIQEgACgCACEAIAEgAkEBcQR/IAEoAgAgAGooAgAFIAALERAAC70FAQl/IwBBEGsiCSQAIAAgACgCACgCEBEEACIKIAJLBEAgCSAAKAIIIAJBAnRqKAIAIgMgAygCACgCEBEEACIFQQFqEJwCIggoAgAiBiADQSBqRwRAIAYgAygCICIGIAMoAiQiByAHIAZrQQR1EJkDCyAFBEADQCADKAIIIARBAnRqKAIAIgYgAUEAEMQCIAgoAgAgBEEBaiIEQQxsaiIHIAZBIGpHBEAgByAGKAIgIgcgBigCJCIGIAYgB2tBBHUQmQMLIAQgBUcNAAsLIAECfyABKAIEIgMgASgCCEkEQCADQQA2AgggA0IANwIAIAMgCCgCACIEIAgoAgQiBiAGIARrQQxtEEcgA0EMagwBCwJ/IwBBIGsiBiQAIAEoAgQgASgCACIEa0EMbSIFQQFqIgNB1qrVqgFJBEAgBkEMakHVqtWqASABKAIIIARrQQxtIgRBAXQiByADIAMgB0kbIARBqtWq1QBPGyAFIAEQYSIDKAIIIgRBADYCCCAEQgA3AgAgBCAIKAIAIgQgCCgCBCIFIAUgBGtBDG0QRyADIAMoAghBDGo2AgggAygCBCABKAIEIAEoAgAiB2siBEF0bUEMbGohBSAEBEAgBSAHIAT8CgAACyABKAIAIQQgASAFNgIAIAMgBDYCBCABIAMoAggiBzYCBCADIAQ2AgggASgCCCEFIAEgAygCDDYCCCADIAQ2AgAgAyAFNgIMIwBBEGsiBCQAIAMoAgQiCyADKAIIIgVHBEADQCADIAVBDGsiBTYCCCAEIAU2AgwgBEEMahApIAsgAygCCCIFRw0ACwsgBEEQaiQAIAMoAgAiBARAIAMoAgwaIAQQIgsgBkEgaiQAIAcMAQsQJgALCzYCBCAKQQFrIAJLBEAgACABIAJBAWoQxAILIAkgCDYCDCAJQQxqECkLIAlBEGokAAvlDgINfwF+IwBBgAJrIgMkAAJAAkACQAJAIAEoAgQgASgCACIEa0EGdQ4CAAECCyAAEOMBDAILIAAgBBBAGgwBCyADQcQAaiAEEE0CQCACQQJHBEAgASgCBCABKAIAIgRrQcEATwRAQQEhCQNAIANB0ABqIAQgCUEGdGoQTSADKAJQIgQoAgQgBCgCAGtBDG0hBgJAIAMoAlQiBEUNACAEIAQoAgQiB0EBazYCBCAHDQAgBCAEKAIAKAIIEQAAIAQQJAsgBSAGaiEFIAlBAWoiCSABKAIEIAEoAgAiBGtBBnVJDQALCyADQQA2AkAgA0IANwI4IANBOGogBRBWIAEoAgQgASgCACIEa0HBAE8EQEEBIQkDQCADQdAAaiAEIAlBBnRqEE0gA0E4aiEGIAMoAjwhByADKAJQIgUoAgAiBCEKIAUoAgQiBSEMIwBBIGsiDSQAAkAgBSAEa0EMbSIIQQBMDQAgBigCCCILIAYoAgQiBGtBDG0gCE4EQCAEIAdrIg5BDG0iDyAISARAAkAgDCAKIA5qIgtGBEAgBCEFDAELIAQhBQNAIAUgCxA8QQxqIQUgC0EMaiILIAxHDQALCyAGIAU2AgQgDkEATA0CIAYgByAEIAcgCEEMbGoQwQMgBiAKIA8gBxDAAwwCCyAGIAcgBCAHIAhBDGxqEMEDIAYgCiAIIAcQwAMMAQsgBCAGKAIAIgVrQQxtIAhqIgRB1qrVqgFJBEAgDUEMakHVqtWqASALIAVrQQxtIgtBAXQiDCAEIAQgDEkbIAtBqtWq1QBPGyAHIAVrQQxtIAYQYSIFKAIIIgsgCEEMbGohBANAIAsgChA8IApBDGohCkEMaiILIARHDQALIAUgBDYCCCAFKAIEGiAGKAIEIAdrIggEQCAEIAcgCPwKAAALIAUgBSgCCCAGKAIEIAdrajYCCCAGIAc2AgQgBSgCBCAHIAYoAgAiCGsiBEF0bUEMbGohByAEBEAgByAIIAT8CgAACyAGKAIAIQQgBiAHNgIAIAUgBDYCBCAGIAUoAgg2AgQgBSAENgIIIAYoAgghByAGIAUoAgw2AgggBSAENgIAIAUgBzYCDCAFENUBDAELECYACyANQSBqJAACQCADKAJUIgVFDQAgBSAFKAIEIgRBAWs2AgQgBA0AIAUgBSgCACgCCBEAACAFECQLIAlBAWoiCSABKAIEIAEoAgAiBGtBBnVJDQALCyADQQA2AjQgA0IANwIsIAMoAkQhASADQegAakEAQegA/AsAIANCADcDYCADQQI2AlwgA0IANwJUIANB7ABqQQBBMPwLACADQaABakEAQST8CwAgA0EANgLYASADQgA3A9ABIANBAToAzQEgA0EBOgDEASADQoCAgICAgICgPjcD6AEgA0KAgICAgICA0MEANwPgASADQfyaAjYCUCADQdAAaiIEIAEQmwEgBCADQThqIgUQ4QEgA0EANgL8ASADQgA3AvQBIARBA0ECIAJBAUYbQQIgA0EsaiICIANB9AFqIgEQ4gEgAyABNgIkIANBJGoQKSAEEGkaQRgQIyIBQbSaAjYCACABQgA3AgQgAUEMaiIGIAIQWyADIAE2AhggAyAGNgIUIAMgAykCFDcDCCAAIANBCGoQaiADIAI2AlAgBBApDAELIANBADYCQCADQgA3AjggA0E4aiADKAJEIgIoAgAiBSACKAIEIgIgAiAFa0EMbRBHIAEoAgQgASgCACIEa0HBAE8EQCADQaABaiEGIANB7ABqIQcgA0HoAGohCEEBIQkDQCADQSRqIAQgCUEGdGoQTSADQQA2AjQgA0IANwIsIAMoAiQhBCAIQQBB6AD8CwAgA0IANwNgIANBAjYCXCADQgA3AlQgB0EAQTD8CwAgBkEAQST8CwAgA0EANgLYASADQgA3A9ABIANBAToAzQEgA0EBOgDEASADQoCAgICAgICgPjcD6AEgA0KAgICAgICA0MEANwPgASADQfyaAjYCUCADQdAAaiIFIANBOGoiAhCbASAFIAQQ4QEgA0EANgL8ASADQgA3AvQBIAVBAUECIANBLGoiBCADQfQBaiIKEOIBIAMgCjYCTCADQcwAahApIAUQaRogAigCACIKBEAgAiAKEHsgAigCCBogAigCABAiIAJBADYCCCACQgA3AgALIAMgAygCLDYCOCADKQIwIRAgA0EANgI0IAMgEDcCPCADQgA3AiwgAyAENgJQIAUQKQJAIAMoAigiAkUNACACIAIoAgQiBUEBazYCBCAFDQAgAiACKAIAKAIIEQAAIAIQJAsgCUEBaiIJIAEoAgQgASgCACIEa0EGdUkNAAsLQRgQIyIBQbSaAjYCACABQgA3AgQgA0HQAGohBCABQQxqIgIgA0E4aiIFEFsgAyABNgIgIAMgAjYCHCADIAMpAhw3AwAgACADEGoLIAMgBTYCUCAEECkgAygCSCIARQ0AIAAgACgCBCIBQQFrNgIEIAENACAAIAAoAgAoAggRAAAgABAkCyADQYACaiQAC+EDAQV/IwBB4AFrIgQkACAEQRxqIAEQTSAEKAIcIQEgBEEUaiACEE0gBEEANgIsIARCADcCJCAEKAIUIQIgBEHIAGpBAEHoAPwLACAEQgA3A0AgBEECNgI8IARCADcCNCAEQcwAakEAQTD8CwAgBEGAAWpBAEEk/AsAIARBADYCuAEgBEIANwOwASAEQQE6AK0BIARBAToApAEgBEKAgICAgICAoD43A8gBIARCgICAgICAgNDBADcDwAEgBEH8mgI2AjAgBEEwaiIFIAEQmwEgBSACEOEBIARBADYC2AEgBEIANwLQASAFQQFBA0ECIANBAUYbIANBAkYbQQIgBEEkaiAEQdABaiIBEOIBIAQgATYC3AEgBEHcAWoQKSAFEGkaAkAgBCgCGCIBRQ0AIAEgASgCBCICQQFrNgIEIAINACABIAEoAgAoAggRAAAgARAkCwJAIAQoAiAiAUUNACABIAEoAgQiAkEBazYCBCACDQAgASABKAIAKAIIEQAAIAEQJAtBGBAjIgFBtJoCNgIAIAFCADcCBCAEQTBqIgMhBiABQQxqIgIgBEEkaiIFEFsgBCABNgIQIAQgAjYCDCAEIAQpAgw3AwAgACAEEGogBCAFNgIwIAMQKSAEQeABaiQAC+MHAgd/AXwjAEEgayIKJAACQCAERQ0AA0ACQAJAIAQgBkwgAyAGTHJFBEAgA0UNBCABKwMIIQ4DQCAOIAArAwhjDQIgAEEYaiEAIANBAWsiAw0ACwwECyADIARKDQEgACABRg0DIAUhAyAAIQcDQCADIAcpAxA3AxAgAyAHKQMINwMIIAMgBykDADcDACADQRhqIQMgB0EYaiIHIAFHDQALA0AgASACRgRAIAMgBWtBBGsiAUUNBSAAIAUgAfwKAAAMBQsCQCABKwMIIAUrAwhjBEAgACABKAIQNgIQIAAgASkDCDcDCCAAIAEpAwA3AwAgAUEYaiEBDAELIAAgBSgCEDYCECAAIAUpAwg3AwggACAFKQMANwMAIAVBGGohBQsgAEEYaiEAIAMgBUcNAAsMAwsCQCADIARIBEAgASAEQQJtIgtBGGxqIQgCQCAAIAFGBEAgACEHDAELIAEgAGtBGG0hCSAIKwMIIQ4gACEHA0AgByAHIAlBAXYiDEEYbGoiB0EYaiAOIAcrAwhjIg0bIQcgDCAJIAxBf3NqIA0bIgkNAAsLIAcgAGtBGG0hDAwBCyADQQFGBEAgCiAAKQMQNwMYIAogACkDCDcDECAKIAApAwA3AwggACABKAIQNgIQIAAgASkDCDcDCCAAIAEpAwA3AwAgASAKKAIYNgIQIAEgCikDEDcDCCABIAopAwg3AwAMBAsgACADQQJtIgxBGGxqIQcCQCABIAJGBEAgASEIDAELIAIgAWtBGG0hCSAHKwMIIQ4gASEIA0AgCCAJQQF2IgtBGGxqIg1BGGogCCANKwMIIA5jIg0bIQggCSALQX9zaiALIA0bIgkNAAsLIAggAWtBGG0hCwsgCkEIaiAHIAEgCBDQAyAKKAIIIQkCfyALIAxqIAQgC2siBCADIAxrIgNqSARAIAAgByAJIAwgCyAFIAYQxwIgCSEAIAgMAQsgCSAIIAIgAyAEIAUgBhDHAiALIQQgDCEDIAkhAiAHCyEBIAQNAQwCCwsgASACRg0AIAUhAyABIQcDQCADIAcpAxA3AxAgAyAHKQMINwMIIAMgBykDADcDACADQRhqIQMgB0EYaiIHIAJHDQALA0AgACABRwRAIAJBGGsiAiABQRhrIgcgA0EYayIIIANBEGsrAwAgAUEQaysDAGMiBBsiBigCEDYCECACIAYpAwg3AwggAiAGKQMANwMAIAcgASAEGyEBIAUgAyAIIAQbIgNHDQEMAgsLA0AgAkEYayICIANBGGsiAygCEDYCECACIAMpAwg3AwggAiADKQMANwMAIAMgBUcNAAsLIApBIGokAAvdBwIHfwF8IwBBIGsiCiQAAkAgBEUNAANAAkACQCAEIAZMIAMgBkxyRQRAIANFDQQgASsDACEOA0AgDiAAKwMAYw0CIABBGGohACADQQFrIgMNAAsMBAsgAyAESg0BIAAgAUYNAyAFIQMgACEHA0AgAyAHKQMQNwMQIAMgBykDCDcDCCADIAcpAwA3AwAgA0EYaiEDIAdBGGoiByABRw0ACwNAIAEgAkYEQCADIAVrQQRrIgFFDQUgACAFIAH8CgAADAULAkAgASsDACAFKwMAYwRAIAAgASgCEDYCECAAIAEpAwg3AwggACABKQMANwMAIAFBGGohAQwBCyAAIAUoAhA2AhAgACAFKQMINwMIIAAgBSkDADcDACAFQRhqIQULIABBGGohACADIAVHDQALDAMLAkAgAyAESARAIAEgBEECbSILQRhsaiEIAkAgACABRgRAIAAhBwwBCyABIABrQRhtIQkgCCsDACEOIAAhBwNAIAcgByAJQQF2IgxBGGxqIgdBGGogDiAHKwMAYyINGyEHIAwgCSAMQX9zaiANGyIJDQALCyAHIABrQRhtIQwMAQsgA0EBRgRAIAogACkDEDcDGCAKIAApAwg3AxAgCiAAKQMANwMIIAAgASgCEDYCECAAIAEpAwg3AwggACABKQMANwMAIAEgCigCGDYCECABIAopAxA3AwggASAKKQMINwMADAQLIAAgA0ECbSIMQRhsaiEHAkAgASACRgRAIAEhCAwBCyACIAFrQRhtIQkgBysDACEOIAEhCANAIAggCUEBdiILQRhsaiINQRhqIAggDSsDACAOYyINGyEIIAkgC0F/c2ogCyANGyIJDQALCyAIIAFrQRhtIQsLIApBCGogByABIAgQ0AMgCigCCCEJAn8gCyAMaiAEIAtrIgQgAyAMayIDakgEQCAAIAcgCSAMIAsgBSAGEMgCIAkhACAIDAELIAkgCCACIAMgBCAFIAYQyAIgCyEEIAwhAyAJIQIgBwshASAEDQEMAgsLIAEgAkYNACAFIQMgASEHA0AgAyAHKQMQNwMQIAMgBykDCDcDCCADIAcpAwA3AwAgA0EYaiEDIAdBGGoiByACRw0ACwNAIAAgAUcEQCACQRhrIgIgAUEYayIEIANBGGsiBiAGKwMAIAQrAwBjIgcbIggoAhA2AhAgAiAIKQMINwMIIAIgCCkDADcDACAEIAEgBxshASAFIAMgBiAHGyIDRw0BDAILCwNAIAJBGGsiAiADQRhrIgMoAhA2AhAgAiADKQMINwMIIAIgAykDADcDACADIAVHDQALCyAKQSBqJAALpgIBBn8jAEEQayIEJAAgACgCACIGIAAoAgQiAkEYbGohBwJAIAEEQAJAIAJBgQFPBEAgAiEDA0AgA0EYbBBQIgUNAiADQQF2IgMNAAsLIAYgByACQQBBABC2AQwCCyAGIAcgAiAFIAMQtgEgBRAiDAELAkAgAkGBAU8EQCACIQMDQCADQRhsEFAiBQ0CIANBAXYiAw0ACwsgBiAHIAJBAEEAELUBDAELIAYgByACIAUgAxC1ASAFECILIAAoAgQiA0ECTwRAIAAoAgAhAiAEIANBAXY2AgwgBCACNgIIIARBCGogAUEBcyICEMkCIAAoAgAhASAEIAAoAgQiACAAQQF2QQFqIgBrNgIEIAQgASAAQRhsajYCACAEIAIQyQILIARBEGokAAtFAQF/IAAoAgAhASAAQQA2AgAgAQRAIAEoAjAiAARAIAAQIgsgAUEANgI4IAFCADcCMCABKAIgIgAEQCAAECILIAEQIgsLkgcBCX8jAEEQayIPJAACQCAFRQ0AA0ACQAJAIAUgB0wgBCAHTHJFBEAgBEUNBCADKAIAKAIAIg0gASgCACIIQQJ0aigCACEJA0AgCSANIAAoAgAiCkECdGooAgBJDQIgAEEEaiEAIARBAWsiBA0ACwwECyAEIAVKDQEgACABRg0DIAYhBCAAIQUDQCAEIAUoAgA2AgAgBEEEaiEEIAVBBGoiBSABRw0ACyADKAIAIQUDQCABIAJGBEAgBCAGayIBRQ0FIAAgBiAB/AoAAAwFCyAAIAEoAgAiAyAGKAIAIgcgBSgCACIIIANBAnRqKAIAIAggB0ECdGooAgBJIgMbNgIAIAFBBEEAIAMbaiEBIABBBGohACAGQQBBBCADG2oiBiAERw0ACwwDCwJAIAQgBUgEQCABIAVBAm0iC0ECdGohCAJAIAAgAUYEQCAAIQkMAQsgASAAa0ECdSEKIA0gCCgCAEECdGooAgAhECAAIQkDQCAJIAkgCkEBdiIMQQJ0aiIJQQRqIBAgDSAJKAIAQQJ0aigCAEkiDhshCSAMIAogDEF/c2ogDhsiCg0ACwsgCSAAa0ECdSEMDAELIARBAUYEQCAAIAg2AgAgASAKNgIADAQLIAAgBEECbSIMQQJ0aiEJAkAgASACRgRAIAEhCAwBCyACIAFrQQJ1IQogDSAJKAIAQQJ0aigCACEQIAEhCANAIAggCkEBdiILQQJ0aiIOQQRqIAggDSAOKAIAQQJ0aigCACAQSSIOGyEIIAogC0F/c2ogCyAOGyIKDQALCyAIIAFrQQJ1IQsLIA9BCGogCSABIAgQkQEgDygCCCEKAn8gCyAMaiAFIAtrIgUgBCAMayIEakgEQCAAIAkgCiADIAwgCyAGIAcQywIgCiEAIAgMAQsgCiAIIAIgAyAEIAUgBiAHEMsCIAshBSAMIQQgCiECIAkLIQEgBQ0BDAILCyABIAJGDQAgBiEEIAEhBQNAIAQgBSgCADYCACAEQQRqIQQgBUEEaiIFIAJHDQALIAMoAgAhBQNAIAAgAUYEQANAIAJBBGsiAiAEQQRrIgQoAgA2AgAgBCAGRw0ADAMLAAsgAkEEayICIAFBBGsiBygCACIDIARBBGsiCCgCACIJIAUoAgAiCiAJQQJ0aigCACAKIANBAnRqKAIASSIDGzYCACAHIAEgAxshASAEIAggAxsiBCAGRw0ACwsgD0EQaiQAC5IHAQl/IwBBEGsiDyQAAkAgBUUNAANAAkACQCAFIAdMIAQgB0xyRQRAIARFDQQgAygCACgCACINIAEoAgAiCEECdGooAgAhCQNAIAkgDSAAKAIAIgpBAnRqKAIASQ0CIABBBGohACAEQQFrIgQNAAsMBAsgBCAFSg0BIAAgAUYNAyAGIQQgACEFA0AgBCAFKAIANgIAIARBBGohBCAFQQRqIgUgAUcNAAsgAygCACEFA0AgASACRgRAIAQgBmsiAUUNBSAAIAYgAfwKAAAMBQsgACABKAIAIgMgBigCACIHIAUoAgAiCCADQQJ0aigCACAIIAdBAnRqKAIASSIDGzYCACABQQRBACADG2ohASAAQQRqIQAgBkEAQQQgAxtqIgYgBEcNAAsMAwsCQCAEIAVIBEAgASAFQQJtIgtBAnRqIQgCQCAAIAFGBEAgACEJDAELIAEgAGtBAnUhCiANIAgoAgBBAnRqKAIAIRAgACEJA0AgCSAJIApBAXYiDEECdGoiCUEEaiAQIA0gCSgCAEECdGooAgBJIg4bIQkgDCAKIAxBf3NqIA4bIgoNAAsLIAkgAGtBAnUhDAwBCyAEQQFGBEAgACAINgIAIAEgCjYCAAwECyAAIARBAm0iDEECdGohCQJAIAEgAkYEQCABIQgMAQsgAiABa0ECdSEKIA0gCSgCAEECdGooAgAhECABIQgDQCAIIApBAXYiC0ECdGoiDkEEaiAIIA0gDigCAEECdGooAgAgEEkiDhshCCAKIAtBf3NqIAsgDhsiCg0ACwsgCCABa0ECdSELCyAPQQhqIAkgASAIEJEBIA8oAgghCgJ/IAsgDGogBSALayIFIAQgDGsiBGpIBEAgACAJIAogAyAMIAsgBiAHEMwCIAohACAIDAELIAogCCACIAMgBCAFIAYgBxDMAiALIQUgDCEEIAohAiAJCyEBIAUNAQwCCwsgASACRg0AIAYhBCABIQUDQCAEIAUoAgA2AgAgBEEEaiEEIAVBBGoiBSACRw0ACyADKAIAIQUDQCAAIAFGBEADQCACQQRrIgIgBEEEayIEKAIANgIAIAQgBkcNAAwDCwALIAJBBGsiAiABQQRrIgcoAgAiAyAEQQRrIggoAgAiCSAFKAIAIgogCUECdGooAgAgCiADQQJ0aigCAEkiAxs2AgAgByABIAMbIQEgBCAIIAMbIgQgBkcNAAsLIA9BEGokAAuSBwEJfyMAQRBrIg8kAAJAIAVFDQADQAJAAkAgBSAHTCAEIAdMckUEQCAERQ0EIAMoAgAoAgAiDSABKAIAIghBAnRqKAIAIQkDQCAJIA0gACgCACIKQQJ0aigCAEkNAiAAQQRqIQAgBEEBayIEDQALDAQLIAQgBUoNASAAIAFGDQMgBiEEIAAhBQNAIAQgBSgCADYCACAEQQRqIQQgBUEEaiIFIAFHDQALIAMoAgAhBQNAIAEgAkYEQCAEIAZrIgFFDQUgACAGIAH8CgAADAULIAAgASgCACIDIAYoAgAiByAFKAIAIgggA0ECdGooAgAgCCAHQQJ0aigCAEkiAxs2AgAgAUEEQQAgAxtqIQEgAEEEaiEAIAZBAEEEIAMbaiIGIARHDQALDAMLAkAgBCAFSARAIAEgBUECbSILQQJ0aiEIAkAgACABRgRAIAAhCQwBCyABIABrQQJ1IQogDSAIKAIAQQJ0aigCACEQIAAhCQNAIAkgCSAKQQF2IgxBAnRqIglBBGogECANIAkoAgBBAnRqKAIASSIOGyEJIAwgCiAMQX9zaiAOGyIKDQALCyAJIABrQQJ1IQwMAQsgBEEBRgRAIAAgCDYCACABIAo2AgAMBAsgACAEQQJtIgxBAnRqIQkCQCABIAJGBEAgASEIDAELIAIgAWtBAnUhCiANIAkoAgBBAnRqKAIAIRAgASEIA0AgCCAKQQF2IgtBAnRqIg5BBGogCCANIA4oAgBBAnRqKAIAIBBJIg4bIQggCiALQX9zaiALIA4bIgoNAAsLIAggAWtBAnUhCwsgD0EIaiAJIAEgCBCRASAPKAIIIQoCfyALIAxqIAUgC2siBSAEIAxrIgRqSARAIAAgCSAKIAMgDCALIAYgBxDNAiAKIQAgCAwBCyAKIAggAiADIAQgBSAGIAcQzQIgCyEFIAwhBCAKIQIgCQshASAFDQEMAgsLIAEgAkYNACAGIQQgASEFA0AgBCAFKAIANgIAIARBBGohBCAFQQRqIgUgAkcNAAsgAygCACEFA0AgACABRgRAA0AgAkEEayICIARBBGsiBCgCADYCACAEIAZHDQAMAwsACyACQQRrIgIgAUEEayIHKAIAIgMgBEEEayIIKAIAIgkgBSgCACIKIAlBAnRqKAIAIAogA0ECdGooAgBJIgMbNgIAIAcgASADGyEBIAQgCCADGyIEIAZHDQALCyAPQRBqJAALHwAgAQRAIAAgASgCABDOAiAAIAEoAgQQzgIgARAiCwu1BAEGfyMAQYABayIEJAAgACgCXCEGIARCgICAgICAgHg3A1ggBEKAgICAgICAeDcDUCAEQoCAgICAgIB4NwNIIARCgICAgICAgPj/ADcDQCAEQoCAgICAgID4/wA3AzggBEKAgICAgICA+P8ANwMwIAQgBEEwakEw/AoAACABKAIEIgUgBkEDbiIGQQF0SyAFQRBLcQJAIAUgBk8NACABIAYQnwEgBiABKAIEIgdrQTBsIgVBAEwNACAFQTBuIQUgASgCACAHQTBsaiEHA0AgByAEQTD8CgAAIAdBMGohByAFQQFLIAVBAWshBQ0ACwsgASAGNgIEBEBBACEGIAEoAgAhBQJAIAEoAgQiB0UNACAHQTBsIggQJyEGIAhFDQAgBiAFIAj8CgAACyABIAUEfyAFECIgASgCBAUgBws2AgggASAGNgIACyACKAIEIQYgAiAAKAJcQQNuIgUQJSACIAU2AgQgBkERSSAGIAVBAXRNckUEQCACEC0LIAAoAlwhBiAEIAI2AmggBCABNgJkIAQgADYCYCAGQQNuIQUCQCADBEAgBkEDSQ0BIAMtABBBAXENAUEAIQBBACECA0AgAEEBaiIAQYAIRgRAQQAhACADLQAQDQMLIARB4ABqIAIQ4AMgAkEBaiICIAVHDQALDAELIAQgAjYCeCAEIAE2AnQgBCAANgJwIAZBA0kNAEEAIQIDQCAEQfAAaiACEOADIAJBAWoiAiAFRw0ACwsgBEGAAWokAAvqGQICfx18IwBB4AJrIgYkAEQAAAAAAADwPyAEoSIPIA8gDyABKwMQIhiiIAQgGCACKwMQIhCgIAIrAxhEAAAAAAAAAACgIgmiIgiioKIgBCAPIAiiIAQgASsDKCIdIAIrAzAiEqAgAisDOEQAAAAAAAAAAKAiDaIiCKKgIguioCIOoiAEIA8gC6IgBCAEIB2iIA8gCKKgoqAiC6KgIRogDyAPIA8gASsDCCIZoiAEIBkgAisDCCIToCAJoiIIoqCiIAQgDyAIoiAEIAErAyAiHiACKwMoIhagIA2iIgiioCIKoqAiDKIgBCAPIAqiIAQgBCAeoiAPIAiioKKgIgiioCEbIA8gDyAPIAErAwAiH6IgBCAfIAIrAwAiF6AgCaIiCqKgoiAEIA8gCqIgBCABKwMYIiAgAisDICIVoCANoiIKoqAiEaKgIhSiIAQgDyARoiAEIAQgIKIgDyAKoqCioCIKoqAhHCAPIA8gDyAEIAmioKIgBCAPIAmiIAQgDaKgIhGioCIJoiAEIA8gEaIgBCAEIA8gDaKgoqAiDaKgIhFEAAAAAAAAAABiBEAgGyARoyEbIBwgEaMhHCAaIBGjIRoLIA1EAAAAAAAAAABiBEAgCyANoyELIAogDaMhCiAIIA2jIQgLIAlEAAAAAAAAAABiBEAgDiAJoyEOIBQgCaMhFCAMIAmjIQwLAkAgCiAUoSIJIAkgCaIgCCAMoSIIIAiioCALIA6hIgkgCaKgnyILoyIMvUL///////////8Ag0L/////////9/8AWARAIAYgDDkD+AEgBiAJIAujOQOIAiAGIAggC6M5A4ACDAELIAZCADcDiAIgBkIANwOAAiAGQgA3A/gBC0QAAAAAAAAAACEOIBKaIBUgFaIgFiAWoqAgEiASoqCfIhGjISQgFSARoyIVvUL///////////8Ag0KAgICAgICA+P8AVCECIAUrAxAhISAFKwMIISIgBSsDACEjIAMrAxAiCSAQIBcgF6IgEyAToqAgECAQoqCfIgijRAAAAAAAAAAAIBcgCKMiC71C////////////AINCgICAgICAgPj/AFQiBRsiECALRAAAAAAAAAAAIAUbIhIgAysDACIKokQAAAAAAAAAAKAgEyAIo0QAAAAAAAAAACAFGyITIAMrAwgiDaKgIBAgCaKgIgiioSIMIAyiIAogEiAIoqEiCyALoiANIBMgCKKhIgggCKKgoCIUIAogCqIgDSANoqAgCSAJoqBEEeotgZmXcT2iYwRAICEgGKEiCCAQIBIgIyAfoSIJokQAAAAAAAAAAKAgEyAiIBmhIgqioCAQIAiioCIIoqEiDCAMoiAJIBIgCKKhIgsgC6IgCiATIAiioSIIIAiioKAhFAtEAAAAAAAAAAAhDUQAAAAAAAAAACEJIAsgFJ8iCqMiC71C////////////AINC//////////f/AFgEQCAIIAqjIQ0gDCAKoyEOIAshCQtEAAAAAAAAAAAhCyADKwMwIgggJEQAAAAAAAAAgCACGyIUIBWaRAAAAAAAAACAIAIbIhcgAysDICIMokQAAAAAAAAAAKAgFpogEaNEAAAAAAAAAIAgAhsiFiADKwMoIhiioCAUIAiioCIRoqEiFSAVoiAMIBcgEaKhIgogCqIgGCAWIBGioSIRIBGioKAiGSAMIAyiIBggGKKgIAggCKKgRBHqLYGZl3E9omMEQCAhIB2hIgggFCAXICMgIKEiDKJEAAAAAAAAAACgIBYgIiAeoSIRoqAgFCAIoqAiCKKhIhUgFaIgDCAXIAiioSIKIAqiIBEgFiAIoqEiESARoqCgIRkLRAAAAAAAAAAAIQxEAAAAAAAAAAAhCCAGIBM5A5gBIAYgCTkDqAEgBiASOQOQASAGIA05A7ABIAYgEiANoiATIAmioTkD0AEgBiAOOQO4ASAGIBA5A6ABIAYgECAJoiASIA6ioTkDyAEgBiATIA6iIBAgDaKhOQPAASAGQdgBaiAGQZABaiICEOQDIAYgFjkDmAEgCiAZnyIKoyIJvUL///////////8Ag0L/////////9/8AWARAIBEgCqMhDCAVIAqjIQsgCSEICyAGIAg5A6gBIAYgFzkDkAEgBiAMOQOwASAGIBcgDKIgFiAIoqE5A9ABIAYgCzkDuAEgBiAUOQOgASAGIBQgCKIgFyALoqE5A8gBIAYgFiALoiAUIAyioTkDwAEgBkHwAGogAhDkAyAGKwNwIg0gBisD2AEiFaJEAAAAAAAAAACgIAYrA3giCSAGKwPgASIRoqAgBisDgAEiCyAGKwPoASIKoqAgBisDiAEiDCAGKwPwASIIoqAiDkQAAAAAAAAAAGMgEiABKwMYIAErAwChIhKiRAAAAAAAAAAAoCATIAErAyAgASsDCKEiE6KgIBAgASsDKCABKwMQoSIQoqAgFyASokQAAAAAAAAAAKAgFiAToqAgFCAQoqCgRAAAAAAAAAAAY0cEQCAOmiEOIAyaIQwgC5ohCyANmiENIAmaIQkLIAYCfCAOmUT+///////vP2QEQCAPIAiiIAQgDKKgIQggDyAKoiAEIAuioCEKIA8gFaIgBCANoqAhCyAPIBGiIAQgCaKgDAELIA8gDhBdIgiiEKgBIQ4gBisD2AEhEiAGKwPgASETIAYrA+gBIQogDiAGKwPwAaIgDCAEIAiiEKgBIgyioCAIEKgBIhCjIQggDiAKoiALIAyioCAQoyEKIA4gEqIgDSAMoqAgEKMhCyAOIBOiIAkgDKKgIBCjCyIJOQNYIAYgCDkDaCAGIAs5A1AgBiAKOQNgIAYgCyAKoiAJIAiioSIMIAygOQO4AiAGIAsgCaIgCiAIoqAiDCAMoDkDsAIgBiALIAuiIAggCKKgIAkgCaKhIAogCqKhOQOoAiAGQZABaiEBAkAgBkGoAmoiBSICKwMAIgkgBisD+AEiDKJEAAAAAAAAAACgIAIrAwgiCCAGKwOAAiIKoqAgAisDECILIAYrA4gCIg6ioCINRP7//////+8/ZgRAIAFCADcDECABQgA3AwggAUIANwMAIAFCgICAgICAgPg/NwMYDAELIA1E/v//////779jBEBEGC1EVPsh+T8QqAEhDCABRBgtRFT7Ifk/EJcBOQMYIAEgDCAIIAlEAAAAAAAAAACiIgqhIAhEAAAAAAAAAACiIhAgCqEiDiAOIA6iIAtEAAAAAAAAAACiIg4gCKEiCCAIoiAJIA6hIgkgCaKgoEQAAAAAAACwPGMiAhsiDSANIA2iIA4gEKEgCCACGyIIIAiiIAogC6EgCSACGyIJIAmioKCfIgujojkDECABIAwgCSALo6I5AwggASAMIAggC6OiOQMADAELIAEgDUQAAAAAAADwP6AiDSANoJ8iDUQAAAAAAADgP6I5AxggASAJIAqiIAwgCKKhRAAAAAAAAPA/IA2jIg2iOQMQIAEgDCALoiAJIA6ioSANojkDCCABIAggDqIgCiALoqEgDaI5AwALIAYgBisDaCIIIAErAxgiCaIgASsDACILIAYrA1AiDKKhIAErAwgiCiAGKwNYIg6ioSAGKwNgIg0gASsDECIQoqE5A0ggBiAJIA2iIAggEKKgIAsgDqKgIAwgCqKhOQNAIAYgDCAQoiAIIAqiIAkgDqKgoCALIA2ioTkDOCAGIAsgCKIgCSAMoqAgCiANoqAgECAOoqE5AzAgAysDACEIIAMrAwghCSADKwMQIQsgBisD2AEhDCAGKwPgASEKIAYrA+gBIQ4gBisD8AEhDSAGIAYpA0g3A8ACIAYgBikDQDcDuAIgBiAGKQM4NwOwAiAGIAYpAzA3A6gCIAYgCzkDoAIgBiAJOQOYAiAGIAg5A5ACIAYgDTkDqAEgBiAOmjkDoAEgBiAKmjkDmAEgBiAMmjkDkAEgBkHIAmoiAiABIAZBkAJqIgcQ5QEgBkEYaiAFIAIQ5QEgAysDICEIIAMrAyghCSADKwMwIQsgBisDcCEMIAYrA3ghCiAGKwOAASEOIAYrA4gBIQ0gBiAGKQNINwPAAiAGIAYpA0A3A7gCIAYgBikDODcDsAIgBiAGKQMwNwOoAiAGIAs5A6ACIAYgCTkDmAIgBiAIOQOQAiAGIA05A6gBIAYgDpo5A6ABIAYgCpo5A5gBIAYgDJo5A5ABIAIgASAHEOUBIAYgBSACEOUBIAYrAxghCCAGKwMAIQkgBisDICELIAYrAwghDCADKwMYIQogAysDOCEOIAAgDyAGKwMooiAEIAYrAxCioDkDMCAAIA8gC6IgBCAMoqA5AyggACAPIAiiIAQgCaKgOQMgIABCgICAgICAgPg/NwMYIAAgGjkDECAAIBs5AwggACAcOQMAIAAgDyAKoiAEIA6ioDkDOCAGQeACaiQAC/slAhN/JnwjAEHwCGsiBCQAAkAgACgCXEEDSQ0AIAAoAlwiBwR/IAAoAmghBSAAKAK4ASEIIAAoArwBIQsDQAJAAkAgC0UNACAIIA9BBXQiFGorAxhEAAAAAAAAAABjIglFIAggBSAPQQJ0aigCACIMQQV0IhBqKwMYIhdEAAAAAAAAAABjRXJFBEBBACETIAhBQEEgIA9BA3AiCUECRhtqIBRqKwMYRAAAAAAAAAAAYw0CIAhBYEHAACAJG2ogFGorAxhEAAAAAAAAAABjDQIgCEFAQSAgDEEDbyIJQQJGG2ogEGorAxhEAAAAAAAAAABjDQIgCEFgQcAAIAkbaiAQaisDGEQAAAAAAAAAAGMNAgwBCyAJIBdEAAAAAAAAAABjc0UNAEEAIRMMAQtBASETIA9BAWoiDyAHRw0BCwsgEwVBAQtFBEAgAEENECwMAQsgBEEoaiAAEDchDSAAQdgAahA4IABB6ABqEDggAEH4AGoQOCAEQRhqIAAgBCABEFciASACENUDAkAgASgCECICIAFGBH9BEAUgAkUNAUEUCyEBIAIgAigCACABaigCABEAAAsCQAJAIANFDQAgAy0AEEEBRw0AIABBDhAsDAELIAQoAhxFDQACQCANKAK8ASANKAJcRw0AIAAoAkwiD0UNACAAKAJIIRMgBCgCGCEUIARByAhqIQkgBEGwCGohCyAEQZgIaiEMA0AgFCAWQShsaiIBKwMgIR4gASsDGCEdIAErAxAhHyABKwMIIRwgBEHgCGogDSABKAIAENcDIA0oAkgiCiANKAJYIgEgBCgC6AgiEUECdCISaigCAEEYbGohDiAKIAEgBCgC5AgiCEECdCIQaigCAEEYbGohBiAKIAEgBCgC4AgiBUECdCIHaigCAEEYbGohAkQAAAAAAAAAACEoRAAAAAAAAAAAISZEAAAAAAAAAAAhKSAEKALsCCIVQQBOBEAgCiABIBVBAnRqKAIAQRhsaiIBKwMQISkgASsDACEoIAErAwghJgsgEyAWQRhsaiEKIAQgAikDEDcDkAggBCACKQMINwOICCAEIAIpAwA3A4AIIAwgBikDEDcDECAMIAYpAwg3AwggDCAGKQMANwMAIAsgDikDEDcDECALIA4pAwg3AwggCyAOKQMANwMAIAQgKTkD2AggBCAmOQPQCCAEICg5A8gIIARCgoCAgDA3AsAGIARCgICAgBA3ArgGQQAhAgJAAkADQCAcIRcCQAJAAkACQCAEQbgGaiACaigCACIBDgMDAAECCyAfIRcMAgsgHSEXDAELIB4hFwsgF0QAAAAAAADwP2IEQCACQQRqIgJBEEYNAgwBCwsgBEGACGohAgJAAkACQAJAIAEOAwMAAQILIAwhAgwCCyALIQIMAQsgCSECCyAKIAIpAxA3AxAgCiACKQMINwMIIAogAikDADcDAAwBCwJAIBVBAEgEQCAEIA0oArgBIgYgBUEFdGoiASkDGDcD0AYgBCABKQMQNwPIBiAEIAEpAwg3A8AGIAQgASkDADcDuAYgBCAGIAhBBXRqIgEpAxg3A/AGIAQgASkDEDcD6AYgBCABKQMINwPgBiAEIAEpAwA3A9gGIAQgBiARQQV0aiIBKQMYNwOQByAEIAEpAxA3A4gHIAQgASkDCDcDgAcgBCABKQMANwP4BiANKAJoIgUgEGooAgAhAiAFIAdqKAIAIQEgBCAGIAUgEmooAgBBBXRqIgUpAxg3A9AFIAQgBSkDEDcDyAUgBCAFKQMINwPABSAEIAUpAwA3A7gFIAQgBiABQQV0aiIBKQMYNwPwBSAEIAEpAxA3A+gFIAQgASkDCDcD4AUgBCABKQMANwPYBSAEIAYgAkEFdGoiASkDGDcDkAYgBCABKQMQNwOIBiAEIAEpAwg3A4AGIAQgASkDADcD+AUgBCAEKwPACCIxRFVVVVVVVdU/oiAEKwOoCCIyRFVVVVVVVdU/oiAEKwOQCCIzRFVVVVVVVdU/oqCgOQP4ByAEIAQrA7gIIjREVVVVVVVV1T+iIAQrA6AIIjVEVVVVVVVV1T+iIAQrA4gIIjZEVVVVVVVV1T+ioKA5A/AHIAQgBCsDsAgiN0RVVVVVVVXVP6IgBCsDmAgiOERVVVVVVVXVP6IgBCsDgAgiOURVVVVVVVXVP6KgoDkD6AcgBEECNgKoBSAEQoCAgIAQNwKgBUQAAAAAAAAAACEiQQAhEkQAAAAAAAAAACEjRAAAAAAAAAAAISREAAAAAAAAAAAhIANAQQRBCCAEQaAFaiASaigCACIOQQFGIhAbQQAgDhsiAkHwlAFqIBwhFwJAAkACQAJAIAJB/JQBaigCACIGDgMDAAECCyAfIRcMAgsgHSEXDAELIB4hFwsoAgAhESAcIRgCQAJAAkACQCAODgMDAAECCyAfIRgMAgsgHSEYDAELIB4hGAtEAAAAAAAA8D8gGKEhGCAEQYAIaiIBIQICQAJAAkACQCARDgMDAAECCyAMIQIMAgsgCyECDAELIAkhAgsgFyAYoyEaAkACQAJAAkAgBg4DAwABAgsgDCEBDAILIAshAQwBCyAJIQELIAQgAikDEDcDyAcgBCACKQMINwPAByAEIAIpAwA3A7gHIAQgASkDEDcD4AcgBCABKQMINwPYByAEIAEpAwA3A9AHIARBIEHAACARQQFGG0EAIBEbIgcgBEG4BmoiBWoiASkDGDcD2AIgBCABKQMQNwPQAiAEIAEpAwg3A8gCIAQgASkDADcDwAIgBEEgQcAAIAZBAUYbQQAgBhsiAiAEQbgFaiIBaiIIKQMYNwP4AiAEIAgpAxA3A/ACIAQgCCkDCDcD6AIgBCAIKQMANwPgAiAEIAEgB2oiASkDGDcD2AQgBCABKQMQNwPQBCAEIAEpAwg3A8gEIAQgASkDADcDwAQgBCACIAVqIgEpAxg3A/gEIAQgASkDEDcD8AQgBCABKQMINwPoBCAEIAEpAwA3A+AEIARBwANqIARBuAdqIARBwAJqIARBwARqIBogBEHoB2oQ0AIgBCsD+ANEAAAAAAAAAACgIScgBCsD0AMiOiAEKwPwA6AgBCsDyAMiOyAEKwPoA6AhGCAEKwPAAyI8IAQrA+ADoCEXIARBgAhqIQEgBCsD2AMhLQJAAkACQAJAIA4OAwMAAQILIAwhAQwCCyALIQEMAQsgCSEBCyAnoiEuIBggJ6IhLyAXICeiITAgASsDEEQAAAAAAADwPyAaoSIXQSBBwAAgEBtBACAOGyICIARBuAZqaiIFKwMQoiAaIARBuAVqIAJqIgIrAxCioKAgFyAFKwMYoiAaIAIrAxiioEQAAAAAAAAAAKAiKqIhISABKwMIIBcgBSsDCKIgGiACKwMIoqCgICqiISsgASsDACAXIAUrAwCiIBogAisDAKKgoCAqoiEsIDMhGiA2IRsgOSEYIBwhFwJAAkACQCAODgICAAELIDIhGiA1IRsgOCEYIB8hFwwBCyAdIB4gDkECRiIBGyEXIDEgKSABGyEaIDQgJiABGyEbIDcgKCABGyEYC0QAAAAAAADwPyAXoSIZICEgF6IgLiAZoqAiJaIgFyAaIBeiICEgGaKgoqAgGSArIBeiIC8gGaKgIhqiIBcgGyAXoiArIBmioKKgISsgGSAsIBeiIDAgGaKgIhuiIBcgGCAXoiAsIBmioKKgISwgFyAqIBeiICcgGaKgIhiiIBkgJyAXoiAtIBmioKKgIS0gFyAloiAZIC4gF6IgOiAZoqCioCElIBcgGqIgGSAvIBeiIDsgGaKgoqAhGiAXIBuiIBkgMCAXoiA8IBmioKKgIRsgGSAYoiAXIBcgKiAZoqCioCEYIBwhFwJAAkACQAJAIA4OAwMAAQILIB8hFwwCCyAdIRcMAQsgHiEXCyAXoiAlRAAAAAAAAPA/IBehIiGioCElICsgF6IgGiAhoqAhGiAsIBeiIBsgIaKgIRsgGCAXoiAtICGioCIXRAAAAAAAAAAAYgRAICUgF6MhJSAaIBejIRogGyAXoyEbCyAcIRcCQAJAAkACQCARDgMDAAECCyAfIRcMAgsgHSEXDAELIB4hFwsgHCEYAkACQAJAAkAgBg4DAwABAgsgHyEYDAILIB0hGAwBCyAeIRgLICIgFyAYoiIXoCEiICMgJSAXoqAhIyAkIBogF6KgISQgICAbIBeioCEgIBJBBGoiEkEMRw0ACwwBCyASIA0oAmgiBmooAgAhAiAGIAdqKAIAIQEgBCANKAK4ASIHIAVBBXRqIgUpAxg3A9AGIAQgBSkDEDcDyAYgBCAFKQMINwPABiAEIAUpAwA3A7gGIAQgByABQQV0aiIBKQMYNwPwBiAEIAEpAxA3A+gGIAQgASkDCDcD4AYgBCABKQMANwPYBiAEIAcgEUEFdGoiASkDGDcDkAcgBCABKQMQNwOIByAEIAEpAwg3A4AHIAQgASkDADcD+AYgBCAHIAJBBXRqIgEpAxg3A7AHIAQgASkDEDcDqAcgBCABKQMINwOgByAEIAEpAwA3A5gHIAYgEGooAgAhASAEIAcgBiAVQQJ0aigCAEEFdGoiAikDGDcD0AUgBCACKQMQNwPIBSAEIAIpAwg3A8AFIAQgAikDADcDuAUgBCAHIAhBBXRqIgIpAxg3A/AFIAQgAikDEDcD6AUgBCACKQMINwPgBSAEIAIpAwA3A9gFIAQgByABQQV0aiIBKQMYNwOQBiAEIAEpAxA3A4gGIAQgASkDCDcDgAYgBCABKQMANwP4BSAEIAcgFUEFdGoiASkDGDcDsAYgBCABKQMQNwOoBiAEIAEpAwg3A6AGIAQgASkDADcDmAYgBCApRAAAAAAAANA/oiAEKwOQCEQAAAAAAADQP6IgBCsDqAhEAAAAAAAA0D+ioCAEKwPACEQAAAAAAADQP6KgoDkDyAcgBCAmRAAAAAAAANA/oiAEKwOICEQAAAAAAADQP6IgBCsDoAhEAAAAAAAA0D+ioCAEKwO4CEQAAAAAAADQP6KgoDkDwAcgBCAoRAAAAAAAANA/oiAEKwOACEQAAAAAAADQP6IgBCsDmAhEAAAAAAAA0D+ioCAEKwOwCEQAAAAAAADQP6KgoDkDuAcgBEHoB2ogBEGACGogBEG4BmogBEG4BWogHyAdoCIYIB0gHqAiHCAEQbgHaiIBEOYDIAQgDCkDEDcD0AQgBCAMKQMINwPIBCAEIAwpAwA3A8AEIAQgCykDEDcD6AQgBCALKQMINwPgBCAEIAspAwA3A9gEIAQgCSkDEDcDgAUgBCAJKQMINwP4BCAEIAkpAwA3A/AEIAQgBCkDkAg3A5gFIAQgBCkDiAg3A5AFIAQgBCkDgAg3A4gFIAQgBCkD8AU3A9gDIAQgBCkD6AU3A9ADIAQgBCkD4AU3A8gDIAQgBCkD2AU3A8ADIAQgBCkDkAY3A/gDIAQgBCkDiAY3A/ADIAQgBCkDgAY3A+gDIAQgBCkD+AU3A+ADIAQgBCkDsAY3A5gEIAQgBCkDqAY3A5AEIAQgBCkDoAY3A4gEIAQgBCkDmAY3A4AEIAQgBCkD0AU3A7gEIAQgBCkDyAU3A7AEIAQgBCkDwAU3A6gEIAQgBCkDuAU3A6AEIAQgBCkD8AY3A9gCIAQgBCkD6AY3A9ACIAQgBCkD4AY3A8gCIAQgBCkD2AY3A8ACIAQgBCkDkAc3A/gCIAQgBCkDiAc3A/ACIAQgBCkDgAc3A+gCIAQgBCkD+AY3A+ACIAQgBCkDsAc3A5gDIAQgBCkDqAc3A5ADIAQgBCkDoAc3A4gDIAQgBCkDmAc3A4ADIAQgBCkD0AY3A7gDIAQgBCkDyAY3A7ADIAQgBCkDwAY3A6gDIAQgBCkDuAY3A6ADIARBoAVqIARBwARqIARBwANqIARBwAJqIBxEAAAAAAAA8D8gGKEiFyABEOYDIBggF6IiGEQAAAAAAAAAAKAgHEQAAAAAAADwPyAcoaIiF6AhIiAYIAQrA/gHokQAAAAAAAAAAKAgFyAEKwOwBaKgISMgGCAEKwPwB6JEAAAAAAAAAACgIBcgBCsDqAWioCEkIBggBCsD6AeiRAAAAAAAAAAAoCAXIAQrA6AFoqAhIAsgIkQAAAAAAAAAAGIEQCAjICKjISMgJCAioyEkICAgIqMhIAsgCiAjOQMQIAogJDkDCCAKICA5AwAgIL1C////////////AINC//////////f/AFYgJL1C////////////AINC//////////f/AFZyRSAjvUL///////////8Ag0L/////////9/8AWHENACAKIAQpA5AINwMQIAogBCkDiAg3AwggCiAEKQOACDcDAAsgFkEBaiIWIA9HDQALCyAAQQA2ArwBIABBuAFqEJMBAkAgDSgCvAEgDSgCXEYEQCAAEFogABBYDAELIAAQlAILIAAgAxBUIABBfzYCyAELIAQoAhgiAARAIAAQIgsgDRA6GgsgBEHwCGokAAsfACABBEAgACABKAIAENICIAAgASgCBBDSAiABECILCzoAIAEEQCAAIAEoAgAQ0wIgACABKAIEENMCIAEoAhQiAARAIAEgADYCGCABKAIcGiAAECILIAEQIgsLghMCCn8afCMAQYABayICJAAgASgCBCILBEADQAJAIAEoAgAgCGotAABBAUcNACAAKAK4ASEKIAAoArwBBEAgCiAIQQV0aisDGEQAAAAAAAAAAGMNAQtBACEDIAJBADYCeCACQgA3AnAgAkEANgJoIAJCADcCYEQAAAAAAAAAACEVIAAoAkgiBSAAKAJYIAhBAnRqIgRBeEEEIAhBA3BBAkYbaigCAEEYbGoiCSsDACAFIAQoAgBBGGwiBGoiBSsDACIfoSIOIA4gDqIgCSsDCCAFKwMIIiChIgwgDKKgIAkrAxAgBSsDECIhoSIPIA+ioJ8iE6MiDkQAAAAAAAAAACAOvUL///////////8Ag0KAgICAgICA+P8AVCIFGyEOIAwgE6NEAAAAAAAAAAAgBRshDCAPIBOjRAAAAAAAAAAAIAUbIRMgACgCmAEgBGoiBCsDECEiIAQrAwghIyAEKwMAISRBACEHIAogCEEFdGoiBCsDECIPIAQrAwAiECAQoiAEKwMIIg0gDaKgIA8gD6KgnyIPo0QAAAAAAAAAACAQIA+jIhC9Qv///////////wCDQoCAgICAgID4/wBUIgQbIhohESANIA+jRAAAAAAAAAAAIAQbIhshDyAQRAAAAAAAAAAAIAQbIhwhEEQAAAAAAAAAACEWRAAAAAAAAAAAIRcgCCEEA0BBfkEBIAAoAmggBEECdGooAgAiBEEDb0ECRhsgBGohBCAAKAK4ASEFAkAgACgCvAEEQCAFIARBBXRqKwMYRAAAAAAAAAAAYw0BCyAFIARBBXRqIgMrAwgiEiADKwMAIg0gDaIgEiASoqAgAysDECIdIB2ioJ8iHqNEAAAAAAAAAAAgDSAeoyIUvUL///////////8Ag0KAgICAgICA+P8AVCIFGyESAnxEAAAAAAAAAAAgEyAAKAJIIAAoAlhBeEEEIARBA29BAkYbaiAEQQJ0aigCAEEYbGoiAysDECAhoSINIAMrAwAgH6EiEyAToiADKwMIICChIhggGKKgIA0gDaKgnyIZo0QAAAAAAAAAACATIBmjIg29Qv///////////wCDQoCAgICAgID4/wBUIgMbIhOiIAwgGCAZo0QAAAAAAAAAACADGyIMoiAOIA1EAAAAAAAAAAAgAxsiDqJEAAAAAAAAAACgoKAiDUQAAAAAAADwP2YNABpEGC1EVPshCUAgDUQAAAAAAADwv2UNABogDRBdCyAPIBREAAAAAAAAAAAgBRsiDaIgECASoqEhGSAQIB0gHqNEAAAAAAAAAAAgBRsiEKIgESANoqEhFCARIBKiIA8gEKKhIQ8gAigCZCIGBHwgAigCYCAGQQN0akEIaysDAAUgJQugIRECQCACKAJoIgMgBk0EQCACQeAAaiADQQF0QYABIAMbEEQgAigCYCACKAJkIgZBA3RqIBE5AwAMAQsgAigCYCAGQQN0aiAROQMACyAXIBmgIRcgFiAUoCEWIBUgD6AhFSACIAZBAWo2AmQCQCAEIAhGBEACQCACKAJ0IgYgAigCeCIDTwRAIAJB8ABqIANBAXRBgAEgAxsQRCACKAJwIgcgAigCdCIGQQN0akKY2pCitb/IjMAANwMADAELIAIoAnAiByAGQQN0akKY2pCitb/IjMAANwMACyACIAZBAWoiAzYCdAwBCwJ8RAAAAAAAAAAAIBogEKIgGyASoiAcIA2iRAAAAAAAAAAAoKCgIg9EAAAAAAAA8D9mDQAaRBgtRFT7IQlAIA9EAAAAAAAA8L9lDQAaIA8QXQshEQJAIAIoAnQiBiACKAJ4IgNPBEAgAkHwAGogA0EBdEGAASADGxBEIAIoAnAiByACKAJ0IgZBA3RqIBE5AwAMAQsgAigCcCIHIAZBA3RqIBE5AwALIAIgBkEBaiIDNgJ0ICIgGyANoiAcIBKioaIgIyAcIBCiIBogDaKhoiAkIBogEqIgGyAQoqGiRAAAAAAAAAAAoKCgRAAAAAAAAAAAY0UNACAHIANBA3RqQQhrIgVEGC1EVPshGUAgBSsDAKE5AwALIBAhESASIQ8gDSEQCyABKAIAIgYgBGotAABBAUcNAAsCQCADQQFGDQAgFSAVoiAWIBaioCAXIBeioCIORAAAAAAAAAAAYQ0AIAcgA0EDdGpBCGsrAwAgAigCYCIJIAIoAmRBA3RqQQhrKwMAoyERRAAAAAAAAAAAIRAgBCAIRgRAQQAhBEQAAAAAAAAAACEMIAMEQANAIAwgByAEQQN0IgVqKwMAIBEgBSAJaisDAKKhIgxEGC1EVPshGUCgIAxEGC1EVPshGcCgIAwgDEQYLURU+yEJQGQbIAxEGC1EVPshCcBjG6AhDCAEQQFqIgQgA0cNAAsLIAwgA7ijIRALIBcgDp8iDqMhEiAWIA6jIQ0gFSAOoyEPQQAhByAIIQkDQCAIQX5BASAAKAJoIAlBAnRqKAIAIgNBA29BAkYbIANqIglHBEAgBiAJai0AAA0CCwJAIAAoArwBBEAgACgCuAEgCUEFdGorAxhEAAAAAAAAAABjDQELIAIoAmAiBSAHQQN0IgRqIgogESAKKwMAoiIUOQMAAkAgCgJ8IBQgBwR8IApBCGsrAwAFRAAAAAAAAAAACyIMoUQYLURU+yEJQGQEQCAMRBgtRFT7IQlAoAwBCyAHQQFqIgMgAigCZE8NASARIAUgA0EDdGorAwCiIg4gFKFEGC1EVPshCUBkRQ0BIA5EGC1EVPshCcCgCyIUOQMACyACKAJwIARqKwMAIAlBBXQiAyAAKAK4AWoiBCsDACEMIAQrAwghDiACIAQrAxA5A1ggAiAOOQNQIAIgDDkDSCAUoSAQoUQAAAAAAADgP6IiDhCoASEMIAIgDhCXATkDQCACIBIgDKI5AzggAiANIAyiOQMwIAIgDyAMojkDKCACQRBqIAJBKGogAkHIAGoQ5QEgAkECNgIMIAJCgICAgBA3AgQgACgCuAEgA2oiBUEIaiEEQQAhBgNAIAJBEGpBCEEQIAJBBGogBmooAgAiCkEBRhtBACAKG2orAwAhDiAFIQMCQAJAAkAgCg4CAgABCyAEIQMMAQsgBUEQQRggCkECRhtqIQMLIAMgDjkDACAGQQRqIgZBDEcNAAsgB0EBaiEHIAEoAgAhBgsgBiAJai0AAEEBRw0ACwsgAigCYCIDBEAgAxAiCyACKAJwIgNFDQAgAxAiCyAIQQFqIgggC0cNAAsLIAJBgAFqJAALHwAgAQRAIAAgASgCABDVAiAAIAEoAgQQ1QIgARAiCwuiAwEJfyAAKAK8AQRAIAAoArgBIAFBBXRqKwMYRAAAAAAAAAAAYw8LAkAgACgC2AEiBCABQQNtIglBBHRqIgIoAgAiBSAEIAAoAmgiACABQQJ0aigCACIGQQNtIgpBBHRqIgMoAgBHDQAgAigCDCIHIAMoAgxHDQAgAigCCCICIAMoAghHDQACQCAFIAQgAEF+QQEgASAJQQNsa0ECRhsgAWoiA0ECdCIJaigCAEEDbUEEdGoiASgCAEcNACAHIAEoAgxHDQAgAiABKAIIRg0BCwJAIAUgBCAAQXhBBCADQQNvQQJGG2ogCWooAgBBA21BBHRqIgEoAgBHDQAgByABKAIMRw0AIAIgASgCCEYNAQsCQCAFIAQgAEF+QQEgBiAKQQNsa0ECRhsgBmoiBkECdCIDaigCAEEDbUEEdGoiASgCAEcNACAHIAEoAgxHDQAgAiABKAIIRg0BCyAEIABBeEEEIAZBA29BAkYbaiADaigCAEEDbUEEdGoiACgCACAFRwRAQQEPC0EBIQggByAAKAIMRw0AIAIgACgCCEchCAsgCAvgBQIDfwl8IwBB0ABrIgQkACABKAJ4IAJBAnRqKAIAIQUgAEIANwMQIABCADcDCCAAQgA3AwAgBEECNgIQIARCgICAgBA3AgggASgCiAEgBSABKAJAbEEDdGogA0EDdGohBkEAIQMDQCAAQQhBECAEQQhqIANqKAIAIgVBAUYbQQAgBRtqIAYgBUEDdGorAwA5AwAgA0EEaiIDQQxHDQALIAJBA20hAgJAIAEoAtABIgNFDQAgASgC2AEgAkEEdGooAgAhAiABQdABaiIFIQEDQCABIAMgAygCECACSCIGGyEBIANBBEEAIAYbaigCACIDDQALIAEgBUYNACACIAEoAhBIDQAgAS0AgQENACMAQZABayICJAAgASsDICEHIAErAzghCCABKwNQIQkgASsDKCEKIAErA0AhCyABKwNYIQwgASsDMCENIAErA0ghDiACIAErA2A5A4gBIAIgDjkDgAEgAiANOQN4IAIgDDkDcCACIAs5A2ggAiAKOQNgIAIgCTkDWCACIAg5A1AgAiAHOQNIIAIgAkHIAGoQkAEgAisDACEIIAIrAwghCSACKwMQIQogAisDGCELIAIrAyAhDCACKwMoIQ0gAisDMCEOIAIrAzghDyAERAAAAAAAAPC/RAAAAAAAAPA/IAEtAIABGyIHIAIrA0CiOQNIIAQgByAPojkDQCAEIAcgDqI5AzggBCAHIA2iOQMwIAQgByAMojkDKCAEIAcgC6I5AyAgBCAHIAqiOQMYIAQgByAJojkDECAEIAcgCKI5AwggAkGQAWokACAEKwM4IQogBCsDCCELIAQrAyAhDCAEKwNAIQ0gBCsDECEOIAQrAyghDyAAIAArAwAiByAEKwMYoiAAKwMIIgggBCsDMKKgIAArAxAiCSAEKwNIoqA5AxAgACAHIA6iIAggD6KgIAkgDaKgOQMIIAAgByALoiAIIAyioCAJIAqioDkDAAsgBEHQAGokAAuZAQIBfgN/AkAgACgCBCAAKAIIQQFrIgQgAUIeiCABhUK5y5Pn0e2RrL9/fiICQhuIIAKFQuujxJmxt5LolH9+IgJCH4ggAoWncSIDQQN0aikDACICIAFRIAJCf1FyDQAgACgCACEFA0AgACgCBCAEIAMgBWpxIgNBA3RqKQMAIgIgAVENASACQn9SDQALCyAAKAIMIANBKGxqC+ACAQd/IwBBIGsiCCQAAkAgACgCCCICIAAoAgxHDQAgACgCBCIEIAAoAgAiA0sEQCACIARrIQYgBCAEIANrQQJ1QQFqQX5tQQJ0IgNqIQcgACACIARHBH8gBgRAIAcgBCAG/AoAAAsgACgCBAUgBAsgA2o2AgQgBiAHaiECDAELIAhBDGpBASACIANrQQF1IAIgA0YbIgMgA0ECdiAAEEoiBSgCCCECIAAoAggiBiAAKAIEIgdHBEAgAiAGIAdraiEDIAchBANAIAIgBCgCADYCACAEQQRqIQQgAkEEaiICIANHDQALIAMhAgsgACgCACEDIAAgBSgCADYCACAFIAM2AgAgACAFKAIENgIEIAUgBzYCBCAAIAI2AgggBSAGNgIIIAAoAgwhAyAAIAUoAgw2AgwgBSADNgIMIAUQUyAAKAIIIQILIAIgASgCADYCACAAIAJBBGo2AgggCEEgaiQAC44DAQV/IwBBIGsiBiQAAkACQCAAKAIEIgMgACgCCCICSQRAIAEoAgAhAiABQQA2AgAgAyACNgIAIANBBGohAQwBCyADIAAoAgAiBGtBAnUiBUEBaiIDQYCAgIAETw0BIAZBDGpB/////wMgAiAEayICQQF1IgQgAyADIARJGyACQfz///8HTxsgBSAAEEoiAygCCCECIAEoAgAhBCABQQA2AgAgAiAENgIAIAMgAkEEajYCCCADKAIEIAAoAgQgACgCACICayIBayEEIAEEQCAEIAIgAfwKAAALIAAoAgAhAiAAIAQ2AgAgAyACNgIEIAAgAygCCCIBNgIEIAMgAjYCCCAAKAIIIQQgACADKAIMNgIIIAMgAjYCACADIAQ2AgwgAygCBCIFIAMoAggiAkcEQANAIAMgAkEEayICNgIIIAIoAgAhBCACQQA2AgAgBARAIAQQdSADKAIIIQILIAIgBUcNAAsLIAMoAgAiAgRAIAMoAgwaIAIQIgsLIAAgATYCBCAGQSBqJAAPCxAmAAtlAQR/IAAoAgQiBCAAKAIIIgFHBEADQCAAIAFByABrIgI2AgggAUEEayIBKAIAIQMgAUEANgIAIAMEfyADEHUgACgCCAUgAgsiASAERw0ACwsgACgCACICBEAgACgCDBogAhAiCwtvAQJ/IAAgAUcEQCAAIQMDQCACIANBwQD8CgAAIAMoAkQhBCADQQA2AkQgAiAENgJEIAJByABqIQIgA0HIAGoiAyABRw0ACwNAIAAoAkQhAiAAQQA2AkQgAgRAIAIQdQsgAEHIAGoiACABRw0ACwsLYgAgACADNgIQQQAhAyAAQQA2AgwCQCABBEAgAUHk8bgcTw0BIAFByABsECMhAwsgACADNgIAIAAgAyACQcgAbGoiAjYCCCAAIAMgAUHIAGxqNgIMIAAgAjYCBCAADwsQcgALGwAgAARAIAAoAgAQ3gIgACgCBBDeAiAAECILCxsAIAAEQCAAKAIAEN8CIAAoAgQQ3wIgABAiCwvWEAIbfAx/IwBB8BZrIh4kACAeIAE2AmwgAEE8aiEkIAEoAhAiHyAAQUBrIiFHBEAgJCAfEIsEIAEgITYCEAsCQCABKAI8Ih8rAxgiECABKwMYIgOhIgQgBKIgHysDICIRIAErAyAiBqEiBSAFoqAiCkQAAAAAAAAQQKIgACsDmAEiCCAIomMEQCABQoCAgICAgIB4NwMIIAEgJCAeQewAahCGBDYCEAwBCwJAAkAgAyABKAI4IiIrAxgiCaEiCyARICIrAyAiB6EiDKIgECAJoSIPIAYgB6EiDqKhIg1EAAAAAAAAAABkRQRAIA0gDaJEAAAAAAAAEECiIAggCKAiDSANIA8gD6IgDCAMoqAiDCALIAuiIA4gDqKgIgsgCyAMYxuiomVFDQELICIrAyggASsDKKJEAAAAAAAAAACgICIrAzAgASsDMKKgRAAAAAAAAPC/oCAIoSELIAUgCSADoSIFoiAEIAcgBqEiBKKhIgwgDKJEAAAAAAAAEECiIAggCCAKIAUgBaIgBCAEoqAiBCAEIApjG6KiZQ0BRAAAAAAAABBAIAkgEKEiBCAEoiAHIBGhIgUgBaKgIgqjIRggBSAKnyIFoyEZIAQgBaMhGiAIIAYgESAHoEQAAAAAAADgP6IiFSAFRAAAAAAAAOA/oiIHoCIEIBUgB6EiBSAEIAVkIgAbIgogBiAKZBugIQ0gCCADIBAgCaBEAAAAAAAA4D+iIhYgB6AiCSAWIAehIgcgByAJYyIhGyIKIAMgCmQboCESIAUgBCAAGyIEIAYgBCAGYxsgCKEhEyAHIAkgIRsiBiADIAMgBmQbIAihIRQgAigCACEAIB8oAgAhJSAiKAIAISYgAigCBCIfQQhNBEAgH0UNAiAAIB9BGGxqISEgCJohBiABKAIAISAgAigCECEjA0ACQCAAKwMAIgMgFGZFDQAgACsDCCIJIBNmRSADIBJlRXIgCSANZUVyDQAgIyAAKAIQQQJ0aigCACICKAI8KAI4IAJHDQAgAigCACIfICBGIB8gJkZyIB8gJUZyDQAgHiABKQMwNwMgIB4gASkDKDcDGCABIAIgHkEYaiAIELsBIQMgHiAiKQMwNwMQIB4gIikDKDcDCCAGIBogAisDICIJIBGhoiAZIAIrAxgiByAQoaKhIgQgASACIB5BCGogCBC7ASIFIAMgAyAFZBsiAyADIARkGyIDZARAIAYgGCAHIBahIgMgA6IgCSAVoSIDIAOioKKhIQMLIAMgC2RFDQAgAyELCyAAQRhqIgAgIUcNAAsMAgtBACEhA0AgHkHwBmogIWoiIEKAgICAgICAeDcDGCAgQoCAgICAgIB4NwMQICBCgICAgICAgPj/ADcDCCAgQoCAgICAgID4/wA3AwAgIUEgaiIhQYAQRw0AC0EAISEgHkHwAmpBAEGABPwLACAImiEXIAEoAgAhJyACKAIQIShEAAAAAAAA8H8hBEQAAAAAAADw/yEKRAAAAAAAAPD/IQxEAAAAAAAA8H8hBQNAIB9BCE0EQCAfBEAgACAfQRhsaiEgA0ACQCAAKwMAIgMgFGZFDQAgACsDCCIGIBNmRSADIBJlRXIgBiANZUVyDQAgKCAAKAIQQQJ0aigCACICKAI8KAI4IAJHDQAgAigCACIfICdGIB8gJkZyIB8gJUZyDQAgHiABKQMwNwNAIB4gASkDKDcDOCABIAIgHkE4aiAIELsBIQMgHiAiKQMwNwMwIB4gIikDKDcDKCAXIBogAisDICIGIBGhoiAZIAIrAxgiCSAQoaKhIgcgASACIB5BKGogCBC7ASIEIAMgAyAEZBsiAyADIAdkGyIDZARAIBcgGCAJIBahIgMgA6IgBiAVoSIDIAOioKKhIQMLIAMgC2RFDQAgAyELCyAAQRhqIgAgIEcNAAsLICFBAEwNAyAeQfAGaiAhQQFrIiFBBXRqIgArAxghBSAAKwMQIQQgACsDCCEMIAArAwAhCiAeQfACaiAhQQN0aiIAKAIEIR8gACgCACEAIB5B8ABqICFBAnRqKAIAISMMAQUgACAfQQF2IgJBGGxqIiArAwghAyAgKwMAIg4hDyAMIQYgDiEJIAUhByAjQQFxBEAgCiEPIAQhCSADIQcgAyEGCwJAIA4gFGZFIAMgE2ZFciAOIBJlRSADIA1lRXJyDQAgKCAgKAIQQQJ0aigCACIgKAI8KAI4ICBHDQAgICgCACIpICdGICYgKUZyICUgKUZyDQAgHiABKQMwNwNgIB4gASkDKDcDWCABICAgHkHYAGogCBC7ASEDIB4gIikDMDcDUCAeICIpAyg3A0ggFyAaICArAyAiDiARoaIgGSAgKwMYIhsgEKGioSIcIAEgICAeQcgAaiAIELsBIh0gAyADIB1kGyIDIAMgHGQbIgNkBEAgFyAYIBsgFqEiAyADoiAOIBWhIgMgA6KgoqEhAwsgAyALZEUNACADIQsLAkACQCAKIBJlRSAMIA1lRXIgCSAUZkUgByATZkVyckUEQCAPIBJlRSAGIA1lRXIgBCAUZkUgBSATZkVycg0BIB5B8AZqICFBBXRqIiAgBTkDGCAgIAQ5AxAgICAGOQMIICAgDzkDACAeQfACaiAhQQN0aiIgIB8gAkEBaiIfazYCBCAeQfAAaiAhQQJ0aiAjQQFqNgIAICAgACAfQRhsajYCACAhQQFqISEMAQsgHyACQQFqIgJrIR8gACACQRhsaiEAIA8hCiAGIQwMAQsgAiEfIAkhBCAHIQULICNBAWohIwwBCwALAAsgAUKAgICAgICA+D83AwgMAQsgASALOQMIIAEgJCAeQewAahCGBDYCEAsgHkHwFmokAAtKAQd/QQQQIyIDIAI2AgBBBBAjIgQgAjYCAEGA8AEgAUGQ6wEiAUEAIQJBsyVBASEFQb8BIAMgASACQbclaiAFQb8BaiAEEAogAAtKAQd/QQQQIyIDIAI2AgBBBBAjIgQgAjYCAEH47wEgAUG86gEiAUEAIQJBkCVBASEFQb0BIAMgASACQZQlaiAFQb0BaiAEEAogAAujAwEIfyMAQRBrIggkAAJAIAVFDQADQAJAIAUgB0wgBCAHTHJFBEAgBEUNAyADKAIAIgogASgCACILQQR0aiIMKAIEIQkDQAJAIAogACgCACINQQR0aiIOKAIEIg8gCUYEQCAMKAIAIA4oAgBODQEMBAsgCSAPSA0DCyAAQQRqIQAgBEEBayIEDQALDAMLIAAgASACIAMgBCAFIAYQpwQMAgsCQCAEIAVIBEAgACABIAEgBUECbSIJQQJ0aiIMIAMQpgQiDSAAa0ECdSELDAELIARBAUYEQCAAIAs2AgAgASANNgIADAMLIAggCjYCCCAIIAMoAgQ2AgwgCEEAOgAAIAEgACAEQQJtIgtBAnRqIg0gAiABa0ECdSAIQQhqEKUEIgwgAWtBAnUhCQsgCCANIAEgDBCkBCAIKAIAIQoCfyAJIAtqIAQgC2siBCAFIAlrIgVqSARAIAAgDSAKIAMgCyAJIAYgBxDjAiAKIQAgDAwBCyAKIAwgAiADIAQgBSAGIAcQ4wIgCSEFIAshBCAKIQIgDQshASAFDQALCyAIQRBqJAALXwEBfyMAQRBrIgIkACACQQhqIAFBABArECogACACKAIIQTD8CgAAAkAgAigCDCIARQ0AIAAgACgCBCIBQQFrNgIEIAENACAAIAAoAgAoAggRAAAgABAkCyACQRBqJAALoAIBBX8jAEEgayIFJAACQAJAIAAoAgQiAiAAKAIIIgNJBEAgAiABKgIAOAIAIAJBBGohAQwBCyACIAAoAgAiBGtBAnUiBkEBaiICQYCAgIAETw0BIAVBDGpB/////wMgAyAEayIDQQF1IgQgAiACIARJGyADQfz///8HTxsgBiAAEEoiAigCCCIDIAEqAgA4AgAgAiADQQRqNgIIIAIoAgQgACgCBCAAKAIAIgNrIgFrIQQgAQRAIAQgAyAB/AoAAAsgACgCACEDIAAgBDYCACACIAM2AgQgACACKAIIIgE2AgQgAiADNgIIIAAoAgghBCAAIAIoAgw2AgggAiADNgIAIAIgBDYCDCACEFMLIAAgATYCBCAFQSBqJAAPCxAmAAtFAQF/IwBBEGsiAiQAIAIgASgCADYCCCACIAEoAgQ2AgwgAUIANwIAIAIgAikCCDcDACAAIAIQSBogARAvGiACQRBqJAALSAECfyAAEKMDIgMQ9QEgACgCACECIAAgASgCADYCACABIAI2AgAgACgCBCECIAAgASgCBDYCBCABIAI2AgQgAxD1ASABEC8aC6MDAQh/IwBBEGsiCCQAAkAgBUUNAANAAkAgBSAHTCAEIAdMckUEQCAERQ0DIAMoAgAiCiABKAIAIgtBBHRqIgwoAgQhCQNAAkAgCiAAKAIAIg1BBHRqIg4oAgQiDyAJRgRAIAwoAgAgDigCAE4NAQwECyAJIA9IDQMLIABBBGohACAEQQFrIgQNAAsMAwsgACABIAIgAyAEIAUgBhCnBAwCCwJAIAQgBUgEQCAAIAEgASAFQQJtIglBAnRqIgwgAxCmBCINIABrQQJ1IQsMAQsgBEEBRgRAIAAgCzYCACABIA02AgAMAwsgCCAKNgIIIAggAygCBDYCDCAIQQA6AAAgASAAIARBAm0iC0ECdGoiDSACIAFrQQJ1IAhBCGoQpQQiDCABa0ECdSEJCyAIIA0gASAMEKQEIAgoAgAhCgJ/IAkgC2ogBCALayIEIAUgCWsiBWpIBEAgACANIAogAyALIAkgBiAHEOgCIAohACAMDAELIAogDCACIAMgBCAFIAYgBxDoAiAJIQUgCyEEIAohAiANCyEBIAUNAAsLIAhBEGokAAvmBAEIfwJAAkACQCAEKAIAKAIAIgYgASgCACIEQQxsaiIIKAIAIgUgBiAAKAIAIgdBDGxqIgkoAgAiCkgNACAFIApGBEAgCCgCBCAJKAIESA0BCyAFIAYgAigCACIHQQxsaiIJKAIAIgpMBEAgBSAKRw0CIAkoAgQgCCgCBE4NAgsgASAHNgIAIAIgBDYCACAGIAEoAgAiB0EMbGoiBSgCACIIIAYgACgCACIJQQxsaiIKKAIAIgtOBEAgCCALRw0DIAUoAgQgCigCBE4NAwsgACAHNgIAIAEgCTYCACACKAIAIQQMAgsCQAJAIAUgBiACKAIAIgpBDGxqIgsoAgAiDEwEQCAFIAxHDQEgCygCBCAIKAIETg0BCyAAIAo2AgAMAQsgACAENgIAIAEgBzYCACAGIAIoAgAiBEEMbGoiBSgCACIIIAkoAgAiCk4EQCAIIApHDQMgBSgCBCAJKAIETg0DCyABIAQ2AgALIAIgBzYCACAHIQQMAQsgByEECwJAIAYgAygCACIHQQxsaiIFKAIAIgggBiAEQQxsaiIJKAIAIgpOBEAgCCAKRw0BIAUoAgQgCSgCBE4NAQsgAiAHNgIAIAMgBDYCACAGIAIoAgAiA0EMbGoiBCgCACIHIAYgASgCACIFQQxsaiIIKAIAIglOBEAgByAJRw0BIAQoAgQgCCgCBE4NAQsgASADNgIAIAIgBTYCACAGIAEoAgAiAkEMbGoiAygCACIEIAYgACgCACIHQQxsaiIGKAIAIgVOBEAgBCAFRw0BIAMoAgQgBigCBE4NAQsgACACNgIAIAEgBzYCAAsLlAcCCH8BfiMAQRBrIg8kAAJAIAVFDQADQAJAAkAgBSAHTCAEIAdMckUEQCAERQ0EIAMoAgAoAgAiDSABKAIAIghBA3RqKQMAIRADQCAQIA0gACgCACIJQQN0aikDAFQNAiAAQQRqIQAgBEEBayIEDQALDAQLIAQgBUoNASAAIAFGDQMgBiEEIAAhBQNAIAQgBSgCADYCACAEQQRqIQQgBUEEaiIFIAFHDQALIAMoAgAhBQNAIAEgAkYEQCAEIAZrIgFFDQUgACAGIAH8CgAADAULIAAgASgCACIDIAYoAgAiByAFKAIAIgggA0EDdGopAwAgCCAHQQN0aikDAFQiAxs2AgAgAUEEQQAgAxtqIQEgAEEEaiEAIAZBAEEEIAMbaiIGIARHDQALDAMLAkAgBCAFSARAIAEgBUECbSILQQJ0aiEIAkAgACABRgRAIAAhCQwBCyABIABrQQJ1IQogDSAIKAIAQQN0aikDACEQIAAhCQNAIAkgCSAKQQF2IgxBAnRqIglBBGogECANIAkoAgBBA3RqKQMAVCIOGyEJIAwgCiAMQX9zaiAOGyIKDQALCyAJIABrQQJ1IQwMAQsgBEEBRgRAIAAgCDYCACABIAk2AgAMBAsgACAEQQJtIgxBAnRqIQkCQCABIAJGBEAgASEIDAELIAIgAWtBAnUhCiANIAkoAgBBA3RqKQMAIRAgASEIA0AgCCAKQQF2IgtBAnRqIg5BBGogCCANIA4oAgBBA3RqKQMAIBBUIg4bIQggCiALQX9zaiALIA4bIgoNAAsLIAggAWtBAnUhCwsgD0EIaiAJIAEgCBCRASAPKAIIIQoCfyALIAxqIAUgC2siBSAEIAxrIgRqSARAIAAgCSAKIAMgDCALIAYgBxDqAiAKIQAgCAwBCyAKIAggAiADIAQgBSAGIAcQ6gIgCyEFIAwhBCAKIQIgCQshASAFDQEMAgsLIAEgAkYNACAGIQQgASEFA0AgBCAFKAIANgIAIARBBGohBCAFQQRqIgUgAkcNAAsgAygCACEFA0AgACABRgRAA0AgAkEEayICIARBBGsiBCgCADYCACAEIAZHDQAMAwsACyACQQRrIgIgAUEEayIHKAIAIgMgBEEEayIIKAIAIgkgBSgCACIKIAlBA3RqKQMAIAogA0EDdGopAwBUIgMbNgIAIAcgASADGyEBIAQgCCADGyIEIAZHDQALCyAPQRBqJAAL3QoCDH8BfCMAQRBrIgokAAJAIARFDQADQAJAAkAgBCAGTCADIAZMckUEQCADRQ0EIAErAwAhEwNAIBMgACsDAGQNAiAAQRBqIQAgA0EBayIDDQALDAQLIAMgBEoNASAAIAFGDQMgBSEHIAAhCANAIAcgCCkDCDcDCCAHIAgpAwA3AwAgB0EQaiEHIAhBEGoiCCABRw0ACwNAIAEgAkYEQCAHIAVrIgFFDQUgACAFIAH8CgAADAULAkAgASsDACAFKwMAZARAIAAgASkDCDcDCCAAIAEpAwA3AwAgAUEQaiEBDAELIAAgBSkDCDcDCCAAIAUpAwA3AwAgBUEQaiEFCyAAQRBqIQAgBSAHRw0ACwwDCwJAIAMgBEgEQCABIARBAm0iDUEEdGohCwJAIAAgAUYEQCAAIQkMAQsgASAAa0EEdSEHIAsrAwAhEyAAIQkDQCAJIAkgB0EBdiIMQQR0aiIJQRBqIBMgCSsDAGQiCBshCSAMIAcgDEF/c2ogCBsiBw0ACwsgCSAAa0EEdSEODAELIANBAUYEQCAKIAApAwg3AwggCiAAKQMANwMAIAAgASkDCDcDCCAAIAEpAwA3AwAgASAKKQMINwMIIAEgCikDADcDAAwECyAAIANBAm0iDkEEdGohCQJAIAEgAkYEQCABIQsMAQsgAiABa0EEdSEHIAkrAwAhEyABIQsDQCALIAdBAXYiDEEEdGoiCEEQaiALIAgrAwAgE2QiCBshCyAHIAxBf3NqIAwgCBsiBw0ACwsgCyABa0EEdSENCyAEIA1rIQQgAyAOayEDIAshBwJAIAEgCUYNACAJIQcgASALRg0AIAEgB0EQaiIIRgRAIAogBykDCDcDCCAKIAcpAwA3AwAgCyABayIBBEAgByAIIAH8CgAACyABIAlqIgcgCikDCDcDCCAHIAopAwA3AwAMAQsgCyABQRBqRgRAIAogC0EQayIIKQMINwMIIAogCCkDADcDACALIAggCWsiAWshByABRSAIIAlGckUEQCAHIAkgAfwKAAALIAkgCikDCDcDCCAJIAopAwA3AwAMAQsgASEIIAEgCWsiEEEEdSIPIQwCQCALIAFrIhJBBHUiESAPRgRAA0AgCiAHKQMINwMIIAogBykDADcDACAHIAgpAwg3AwggByAIKQMANwMAIAggCikDCDcDCCAIIAopAwA3AwAgB0EQaiIHIAFGDQIgCEEQaiIIIAtHDQAMAgsACwNAIAwgESIMbyIRDQALIAkgDEEEdGohDANAIAogDEEQayIMKQMINwMIIAogDCkDADcDACAMIBBqIQggDCEHA0AgByIBIAgiBykDCDcDCCABIAcpAwA3AwAgByAQaiAJIA8gCyAHa0EEdSIBa0EEdGogASAPShsiCCAMRw0ACyAHIAopAwg3AwggByAKKQMANwMAIAkgDEcNAAsgCSASaiEHDAELIAEhBwsCfyANIA5qIAMgBGpIBEAgACAJIAcgDiANIAUgBhDrAiAHIQAgCwwBCyAHIAsgAiADIAQgBSAGEOsCIA0hBCAOIQMgByECIAkLIQEgBA0BDAILCyABIAJGDQAgBSEHIAEhCANAIAcgCCkDCDcDCCAHIAgpAwA3AwAgB0EQaiEHIAhBEGoiCCACRw0ACwNAIAAgAUcEQCACQRBrIgIgAUEQayIJIAdBEGsiBiAGKwMAIAkrAwBkIgQbIgMpAwg3AwggAiADKQMANwMAIAkgASAEGyEBIAUgByAGIAQbIgdHDQEMAgsLA0AgAkEQayICIAdBEGsiBykDCDcDCCACIAcpAwA3AwAgBSAHRw0ACwsgCkEQaiQAC3MBBH8gACgCBCICIAFBAXRLIAJBEEtxAkAgASACTQ0AIAAgARBEIAEgACgCBCIDayICQQBMDQAgACgCACADQQN0aiEDA0AgA0J/NwMAIANBCGohAyACQQFLIAJBAWshAg0ACwsgACABNgIEBEAgABCUAQsLmgEBAX8gACABRwRAAkAgACgCDCICRQ0AIAIgAigCACICQQFrNgIAIAJBAUoNACAAKAIMIgIEQCACECILIABBADYCDCAAKAIAIgIEQCACECILIABBADYCCCAAQgA3AgALIAEoAgwiAiACKAIAQQFqNgIAIAAgASgCDDYCDCAAIAEoAgA2AgAgACABKAIENgIEIAAgASgCCDYCCAsLcgEDfyAAKALUAUUEQEEADwsgACgCzAEiASAAQdABaiICRgRAQQEPCwNAIAEtAIEBIgNBAUYEQAJAIAEoAgQiAARAA0AgACIBKAIAIgANAAwCCwALA0AgASABKAIIIgEoAgBHDQALCyABIAJHDQELCyADCykAIABBADYCBCAAEC0gAEEANgIUIABBEGoQLSAAQQA2AiQgAEEgahAtC8UCAQN/IAAoAgggACgCACIEa0EMbSADTwRAIAAoAgQiBSAEayIGQQxtIANJBEAgASAGaiEDIAQgBUcEQCAGBEAgBCABIAb8CgAACyAAKAIEIQULIAUhASACIANHBEADQCABIAMoAgg2AgggASADKQIANwIAIAFBDGohASADQQxqIgMgAkcNAAsLIAAgBSABIAVrajYCBA8LIAIgAWsiA0UgASACRnJFBEAgBCABIAP8CgAACyAAIAMgBGo2AgQPCyAAEEUgA0HWqtWqAUkEQCAAQdWq1aoBIAAoAgggACgCAGtBDG0iBUEBdCIEIAMgAyAESRsgBUGq1arVAE8bEKMCIAAoAgQhAyABIAJHBEADQCADIAEoAgg2AgggAyABKQIANwIAIANBDGohAyABQQxqIgEgAkcNAAsLIAAgAzYCBA8LECYAC9gCAQN/IAAoAgggACgCACIEa0EYbSADTwRAIAAoAgQiBSAEayIGQRhtIANJBEAgASAGaiEDIAQgBUcEQCAGBEAgBCABIAb8CgAACyAAKAIEIQULIAUhASACIANHBEADQCABIAMpAxA3AxAgASADKQMINwMIIAEgAykDADcDACABQRhqIQEgA0EYaiIDIAJHDQALCyAAIAUgASAFa2o2AgQPCyACIAFrIgNFIAEgAkZyRQRAIAQgASAD/AoAAAsgACADIARqNgIEDwsgABBFIANBq9Wq1QBJBEAgAEGq1arVACAAKAIIIAAoAgBrQRhtIgVBAXQiBCADIAMgBEkbIAVB1arVKk8bEPIBIAAoAgQhAyABIAJHBEADQCADIAEpAxA3AxAgAyABKQMINwMIIAMgASkDADcDACADQRhqIQMgAUEYaiIBIAJHDQALCyAAIAM2AgQPCxAmAAsfACABBEAgACABKAIAEPICIAAgASgCBBDyAiABECILC2EBAn8CQCABKAIEIgNFBEAgASECA0AgAiACKAIIIgIoAgBHDQALDAELA0AgAyICKAIAIgMNAAsLIAEgACgCAEYEQCAAIAI2AgALIAAgACgCCEEBazYCCCAAKAIEIAEQxAQL1AMBCn8jAEEgayIEJAAgBEIANwIYIAQgBEEYaiIKNgIUIAEgAkcEQCABIQUDQCAEIAUoAgA2AgggBCAFIAFrQQR1NgIMQRgQIyIIIAQoAggiDTYCECAIIAQoAgw2AhQCQCAEQRRqIgsoAgQiCUUEQCALQQRqIgYhBwwBCwNAIAkiBigCECANSgRAIAYhByAGKAIAIgkNAQwCCyAGKAIEIgkNAAsgBkEEaiEHCyALIAYgByAIEIIBIAVBEGoiBSACRw0ACwsgAEEANgIIIABCADcCAEEAIQUDQAJAIAUgDEYEQCAEKAIcRQ0BIAQoAhQoAhQhDCAEQQA2AhAgBEIANwIIIAAgBEEIahBoIAQoAggiAgRAIAQgAjYCDCAEKAIQGiACECILIAwhBQsgACgCBCAEIAMgBWo2AghBDGsgBEEIahA9AkACQCAEKAIYIgZFDQAgASAFQQR0aigCBCEHIAohAgNAIAIiBSAGIgkgBigCECAHSCIIGyECIAZBBEEAIAgbaigCACIGDQALIAIgCkYNACAHIAUgCSAIGygCEE4NAQsgCiECCyACKAIUIQUgBEEUaiACEPMCIAIQIgwBCwsgBEEUaiAEKAIYEPICIARBIGokAAvpBQEJfyMAQTBrIgMgATYCJCADQX5BASABQQNvQQJGGyABaiIENgIoIANBfkEBIARBA29BAkYbIARqIgk2AiwgAyAAKAJoIgUgAUECdGooAgAiATYCGCADIAFBfkEBIAFBA29BAkYbaiICNgIcIANBfkEBIAJBA29BAkYbIAJqIgc2AiACQCAFIARBAnRqKAIAIghBf0YNACAAKAJYIgYgCUECdCIBaigCACAGIAdBAnRqKAIARw0AIAEgBWooAgAhAQJAIAcgCEYEQCABIAJGBEAgA0ECNgIUIANCgICAgBA3AgwgACgCSCEKQQAhAQNAIAogBiADQSRqQQRBCCADQQxqIAFqKAIAIgRBAUYbQQAgBBtqKAIAQQJ0aigCAEEYbGoiBEKAgICAgICA/P8ANwMQIARCgICAgICAgPz/ADcDCCAEQoCAgICAgID8/wA3AwAgAUEEaiIBQQxHDQALDAILIAAoAkggBiAEQQJ0aigCAEEYbGoiAUKAgICAgICA/P8ANwMQIAFCgICAgICAgPz/ADcDCCABQoCAgICAgID8/wA3AwAMAQsgASACRw0AIAAoAkggBiACQQJ0aigCAEEYbGoiAUKAgICAgICA/P8ANwMQIAFCgICAgICAgPz/ADcDCCABQoCAgICAgID8/wA3AwALIAUgCEECdGogBSAHQQJ0aigCACIBNgIAIAUgAUECdGogCDYCACAFIAUgCUECdGooAgAiAUECdGogBSACQQJ0aigCACICNgIAIAUgAkECdGogATYCACADQQI2AhQgA0KAgICAEDcCDCAAKAJ4IQBBACEBA0AgBkEEQQggA0EMaiABaigCACICQQFGG0EAIAIbIgQgA0EkamooAgBBAnQiAmpBfzYCACACIAVqQX82AgAgACACakF/NgIAIAYgA0EYaiAEaigCAEECdCICakF/NgIAIAIgBWpBfzYCACAAIAJqQX82AgAgAUEEaiIBQQxHDQALCws6ACAAKAJcBEAgAEHYAGoQOCAAQegAahA4IABB+ABqEDggABDtASAAQQAQzwQgAEEAEM4EIAAQlAILC/8PAhh/GHwjAEEgayIKJAACQCAAKAJoIgsgAUECdCIGaigCACIMQQBIDQAgACsDMCEnIAogATYCFCAKQX5BASABIAFBA20iByIXQQNsa0ECRhsgAWoiDzYCGCAKQX5BASAPQQNvQQJGGyAPaiINNgIcIAogDDYCCCAKQX5BASAMIAxBA24iASIYQQNsa0ECRhsgDGoiCTYCDCAKQX5BASAJQQNvQQJGGyAJaiIQNgIQIAsgCUECdGooAgAiCSAMRiAAKAJIIg4gACgCWCIRIA9BAnRqKAIAIhJBGGxqIgUrAwAiKyAOIAYgEWooAgAiGUEYbGoiBisDACIxoSIdIB2iIAUrAwgiLCAGKwMIIjKhIh0gHaKgIAUrAxAiLSAGKwMQIjOhIh0gHaKgICcgAyADRAAAAAAAAAAAYxsiLiAuoiAnICeiIAQgEkobY3JFBEAgACgCqAEiGiABIgRBGGxqIRMgACgC2AEiFSAHQQR0aiEUIBUgBEEEdGoiASgCACEGIAEoAgghBCABKAIMIQggDiARIBBBAnRqKAIAQRhsaiIBKwMAISMgASsDCCEoIAErAxAhKSAJIQEDQCAOIBFBeEEEQX5BASABQQNvQQJGGyABaiIBIAFBA20iB0EDbGtBAkYbaiABQQJ0IhtqKAIAQRhsaiEBIBUgB0EEdGoiFigCACEFIBogB0EYbGoiBysDCCIemSEDAnwgBysDECIfmSIdIAcrAwAiIpkiKmRFIAMgHWNFckUEQEQAAAAAAAAAACEgRAAAAAAAAAAAISEgHyEdRAAAAAAAAPA/DAELIAMgKmQEQEQAAAAAAADwPyEhRAAAAAAAAAAAISAgHiEdRAAAAAAAAAAADAELRAAAAAAAAPA/ISBEAAAAAAAAAAAhISAiIR1EAAAAAAAAAAALIQMgASsDECEqIAErAwghLyABKwMAITAgA5ogAyAdRAAAAAAAAAAAYyIHGyEdICCaICAgBxshJCAhmiAhIAcbISUCQCAFIAZHIhwgCCAWKAIMIgdHciAEIBYoAggiAUdyRQRAIAYhBSAEIQEgCCEHDAELQQAhCCAFIBQoAgBHDQMgByAUKAIMRw0DIAEgFCgCCEcNAwJAIBwgASAER3INACAiIBMrAwCiRAAAAAAAAAAAoCAeIBMrAwiioCAfIBMrAxCioEQAAAAAAADgv2MNACAGIQUgBCEBDAELIC0gIKIgLCADoiArICGioKAgKSAgoiAoIAOiICMgIaKgoCIioSIeIDMgJaIgMSAdoiAyICSioKAgKSAloiAjIB2iICggJKKgoCImoSIfoiAzICCiIDIgA6IgMSAhoqCgICKhIiIgLSAloiArIB2iICwgJKKgoCAmoSImoqEiNCA0okQAAAAAAAAQQKIgLiAuIB4gHqIgJiAmoqAiHiAiICKiIB8gH6KgIh8gHiAfZBuiomVFDQMLAkAgLSAgoiAsIAOiICsgIaKgoCAqICCiIC8gA6IgMCAhoqCgIiKhIh4gKSAloiAjIB2iICggJKKgoCAqICWiIDAgHaIgLyAkoqCgIiahIh+iICkgIKIgKCADoiAjICGioKAgIqEiAyAtICWiICsgHaIgLCAkoqCgICahIh2ioSIjRAAAAAAAAAAAZA0AICMgI6JEAAAAAAAAEECiICcgJyAeIB6iIB0gHaKgIh0gAyADoiAfIB+ioCIDIAMgHWMboqJlDQBBACEIDAMLIAchCCABIQQgBSEGICohKSAvISggMCEjIAsgG2ooAgAiASAMRw0ACwsgECALIA9BAnRqKAIAIgVHBH8gAigCBCEBA0BBfkEBIAVBA29BAkYbIAVqIQQCQCACKAIIIgUgAU0EQCACIAVBAXRBgAEgBRsQJSACKAIAIAIoAgQiAUECdGogBDYCACAAKAJoIQsMAQsgAigCACABQQJ0aiAENgIACyACIAFBAWoiATYCBCALIARBAnRqKAIAIgUgEEcNAAsgACgCSAUgDgsgGUEYbGoiAUKAgICAgICA/P8ANwMQIAFCgICAgICAgPz/ADcDCCABQoCAgICAgID8/wA3AwAgACAKQQhqEMsEIAkgDUcEQCAJIQQDQEF+QQEgBEEDb0ECRhsgBGohBQJAIAAoAkBFDQACQAJAIAAoAtgBIgYgBUEDbUEEdGoiBCgCACIHIAYgF0EEdGoiCCgCAEcNACAEKAIMIAgoAgxHDQAgDyEBIAQoAgggCCgCCEYNAQsgByAGIBhBBHRqIgYoAgBHDQEgBCgCDCAGKAIMRw0BIAwhASAEKAIIIAYoAghHDQELIAAoAngiBCAFQQJ0aiAEIAFBAnRqKAIANgIACyAFQQNvIQEgBUECdCIGIAAoAmhqKAIAIQQCQCACKAIEIghFDQAgACgCWCIHQXhBBCABQQJGG2ogBmooAgAhCyACKAIAIQ5BACEBA0AgB0F4QQQgDiABQQJ0aigCACIGQQNvQQJGG2ogBkECdGooAgAgC0YEQCAAIAYgBRDMBCACIAFBABAxIAQhCQwCCyABQQFqIgEgCEcNAAsLIAQgDUcNAAsgCSANRwRAIAAoAmghBCAAKAJYIQIgCSEBA0AgAkF+QQEgAUEDb0ECRhsiBUECdGogAUECdGogEjYCACACIAEgBWpBAnQiAWogEjYCACABIARqKAIAIgEgDUcNAAsLIAkhDQsgACAKQRRqEMsEIAAgDRD1AkEBIQgLIApBIGokACAIC6QFARF/IAAoAlwEQCAAQdgAahA4IABB6ABqEDggAEH4AGoQOCAAEO0BIAAgARDPBCMAQSBrIgIkACACQQA2AhggAkIANwIQIAAoAlwhCSACQQA2AgggAkIANwIAIAJBChAlAkADQEEAIQUgCQRAA0ACQCAAKAJoIg8gBUECdCIEaigCACIDQQBIDQAgACgCWCAEaigCACABSA0AIAVBfkEBIANBA3BBAkYbIANqIghHBEAgACgC2AEiCiAFQQNtQQR0aiIEKAIAIhAgCiAIQQNtQQR0aiIGKAIAIgdHIAQoAgwiESAGKAIMIgNHciAEKAIIIhIgBigCCCIER3IhBgNAIAchCyAEIQwgAyENIAYhDiAKQX5BASAPIAhBAnRqKAIAIgNBA29BAkYbIANqIghBA21BBHRqIgQoAgwhAwJAIAQoAgAiByAQRyADIBFHckUgEiAEKAIIIgRGcSAHIAtHIAMgDUdyRSAEIAxGcXJFBEBBASEGIA5BAXENBAwBCyALIQcgDCEEIA0hAwsgBSAIRw0ACwsgAigCFCIDIAIoAhgiBE8EQCACQRBqIARBAXRBgAEgBBsQJSACIAIoAhQiA0EBajYCFCACKAIQIANBAnRqIAU2AgAMAQsgAiADQQFqNgIUIAIoAhAgA0ECdGogBTYCAAsgBUEBaiIFIAlHDQALCyACKAIUIgQEQCACKAIQIgMgBEECdGohB0EAIQQDQCAAIAMoAgAgAkQAAAAAAADwv0EAEPcCIQYgAkEAQQAQMSAEIAZqIQQgA0EEaiIDIAdHDQALIAJBADYCFCACQRBqEC0gBA0BDAILCyACQRBqEC0LIAIoAgAiAwRAIAMQIgsgAigCECIDBEAgAxAiCyACQSBqJAAgACABEM4EIAAQlAILC4cDAQR/IwBBEGsiBSQAIABBADYCCCAAQgA3AgACQCABRQ0AIAAgARDJBCAAKAIEIgRBH3EhAyAAKAIAIARBA3ZB/P///wFxaiEEAkAgAi0AAEEBRgRAIAUgAzYCDCAFIAQ2AgggASECIAUoAgghAyAFKAIMIgQEQCADIAMoAgBBfyAEdEF/QSAgBGsiAiABIAIgASACSRsiAmt2cXI2AgAgA0EEaiEDIAEgAmshAgsCQCACQQV2IgRFDQAgBEECdCIGRQ0AIANB/wEgBvwLAAsgAkEfcSICBEAgAyAEQQJ0aiIDIAMoAgBBf0EgIAJrdnI2AgALDAELIAUgAzYCDCAFIAQ2AgggBUEIaiABEMgECyAAIAAoAgQgAWoiAjYCBCACQR9xIgFFDQBBICABayEDIAAoAgAgAkEDdkH8////AXFqIQIDQCACIAIoAgBBfiABd3E2AgBBACABQQFqIAFBH0YiBBshASACQQRBACAEG2ohAiADQQFrIgMNAAsLIAVBEGokACAAC9Y9Ayh/GHwBfiMAQZABayIGJAACQAJAIAEoAgQgASgCACIFa0EDdSIDQQJPBEAgBkEYaiEcA0ACQCACRQ0AIAItABBBAUcNACAAEJkCDAQLIAZCADcCOCAGQQA2AkAgBkE4aiADIANB6AdrIgVBACADIAVPGyIQaxCfAQJAIBAiAyABKAIEIAEoAgAiBWtBA3VPBEAgBigCPCEJDAELA0AgBkHIAGogBSADQQN0aigCABDdBAJ/IAYoAjwiBSAGKAJAIgdPBEAgBkE4aiAHQQF0QYABIAcbEJ8BIAYoAjggBigCPCIFQTBsagwBCyAGKAI4IAVBMGxqCyAGQcgAakEw/AoAACAGIAVBAWoiCTYCPCADQQFqIgMgASgCBCABKAIAIgVrQQN1SQ0ACwtBACERIAZBADYCNCAGQgA3AiwCQCAJRQRAIAZBADYCKCAGQgA3AiAMAQsCQANAAkAgBigCLCIJIAYoAjAiCkcEfwNAIAkoAgAhAwJ/IAkoAgQiBQRAIAMgBUECdGohBQJAA0AgBigCOCIHIBFBMGxqIAcgAygCAEEwbGoQ1AQNASADQQRqIgMgBUcNAAsgBSEDCyAJKAIEIQUgCSgCAAwBC0EAIQUgAwsgBUECdGogA0cEQCAJQRBqIgkgCkcNAQsLIAYoAjAFIAoLIAlGBEBBACEJIAZBADYCKCAGQgA3AiAgBiARNgIUIAZBIGpBARDxASAGKAIkIQMgHCAGQRRqIgVHBEADQCADIAUoAgA2AgAgA0EEaiEDIAVBBGoiBSAcRw0ACwsgBiADNgIkIAYoAiQiBSAGKAIgIgNrIQcCQCADIAVGDQAgBxAnIQkgB0UNACAJIAMgB/wKAAALIAdBAnUhDAJAIAYoAjAiByAGKAI0IgVJBEAgByAMNgIIIAcgDDYCBCAHIAk2AgAgB0EQaiEFDAELIAcgBigCLCIDa0EEdSIHQQFqIgpBgICAgAFPDQQgBkH8AGpB/////wAgBSADayIFQQN1IgMgCiADIApLGyAFQfD///8HTxsgByAGQSxqEDIhCCAGKAKEASIDIAw2AgggAyAMNgIEIAMgCTYCACAGIANBEGo2AoQBIAYoAjAiBSESIAgoAgQgBigCLCIDIAVraiIKIQkgAyASRwRAIAMhBQNAQQAhDSAJQQA2AgggCUIANwIAAkAgBSgCBCIORQ0AIAUoAgAhByAOQQJ0IgwQJyENIAxFDQAgDSAHIAz8CgAACyAJIA42AgggCSAONgIEIAkgDTYCACAJQRBqIQkgBUEQaiIFIBJHDQALA0AgAygCACIFBEAgBRAiCyADQQA2AgggA0IANwIAIANBEGoiAyASRw0ACwsgCCAKNgIEIAYgBigCLCIDNgIwIAYgCCgCBDYCLCAIIAM2AgQgBigCMCEDIAYgCCgCCDYCMCAIIAM2AgggBigCNCEDIAYgCCgCDDYCNCAIIAM2AgwgCCAIKAIENgIAIAYoAjAhBSAIKAIEIgwgCCgCCCIJRwRAA0AgCCAJQRBrIgc2AgggByIDKAIAIgoEQCAKECIgCCgCCCEDCyAHQQA2AgAgCUEMa0IANwIAIAMiCSAMRw0ACwsgCCgCACIDBEAgCCgCDBogAxAiCyAGKAIgIQMLIAYgBTYCMCADRQ0BIAYgAzYCJCAGKAIoGiADECIMAQsgCSgCBCIFIAkoAggiA08EQCAJIANBAXRBgAEgAxsQJSAJIAkoAgQiA0EBajYCBCAJKAIAIANBAnRqIBE2AgAMAQsgCSAFQQFqNgIEIAkoAgAgBUECdGogETYCAAsgEUEBaiIRIAYoAjxJDQALIAYoAjAhHSAGKAIsIQkgBkEANgIoIAZCADcCICAJIB1GDQEDQAJAIAkoAgQiBUEBRgRAIAZBIGogASgCACAQQQN0aiAJKAIAKAIAQQN0ahD/AgwBCyAGQQA2AhwgBkIANwIUIAUEQCAJKAIAIgMgBUECdGohBQNAIAZBFGogASgCACAQQQN0aiADKAIAQQN0ahD/AiADQQRqIgMgBUcNAAsLIAZBDGohHkEAIQNBACEXQQAhGCMAQbAHayIEJAAgBEEANgL8BCAEQQA2AvgEIARBADYC9AQgBEEANgLwBCAEQgA3AugEIARBADYC5AQgBEIANwLcBCAEQQA2AtgEIARCADcC0AQgBEEANgLMBCAEQgA3AsQEAkACQAJ/IAYoAhQiBSAGKAIYIg5GBEBEAAAAAAAA8L8hL0QAAAAAAADw/yEwRAAAAAAAAPB/ITFEAAAAAAAA8H8hMkQAAAAAAADwfyEzRAAAAAAAAPD/ITREAAAAAAAA8P8hNUQAAAAAAADwvyE2QQAMAQtEAAAAAAAA8H8hM0QAAAAAAADw/yE1RAAAAAAAAPC/ITZEAAAAAAAA8L8hL0QAAAAAAADw/yE0RAAAAAAAAPD/ITBEAAAAAAAA8H8hMkQAAAAAAADwfyExA0AgBSgCACgCDCIHKAJEDQIgBxCiASE/IARBqAJqIgwgBSgCACIHKAIMIAdBGGoQ2wQgBCsDqAIhNyAEKwPAAiE4IAQrA7ACITkgBCsDyAIhOiAEKwO4AiEtIAQrA9ACISsgBSgCACIKKAIMIgcrAzghQiAHKwMwIS4gDCAKEN0EIAQrA6gCIUAgBCsDsAIhQSAEKwO4AiE7IAQrA8ACITwgBCsDyAIhPSAEKwPQAiE+IARB6ARqIARB/ARqED0gBCADQQF0NgKoAiAEQdwEaiAMED0gBEHQBGogBEH4BGoQPSAEQcQEaiAEQfQEahA9IAQgBCgC/AQgBSgCACgCDCISKAJMajYC/AQgBCAEKAL4BCASKAJcIgxBA25qNgL4BCA2ICuZIiwgLZkiKyArICxjGyItIDqZIiwgOZkiKyArICxjGyIrICsgLWMbIi0gOJkiLCA3mSIrICsgLGMbIisgKyAtYxsiK0QR6i2BmZdxPaIiLCAuICsgP6MiK0QAAAAAAADwPyArRAAAAAAAAPA/ZBuiIisgKyAsYxsiK0QAAAAAAADwvyArvUL///////////8Ag0KAgICAgICA+P8AVBsiK2MhCiAXIBIoAkAiDUohByArIDYgChshNiBCIC8gLyBCYxshLyA+IDUgNSA+YxshNSA9IDQgNCA9YxshNCA8IDAgMCA8YxshMCAzIDsgMyA7YxshMyAyIEEgMiBBYxshMiAxIEAgMSBAYxshMSAXIA0gBxshFyAMQQF2IANqIQMgBCANBH8gEigCjAEgDW4FQQELIAQoAvQEajYC9AQgBUEIaiIFIA5HDQALIANBAXQLIQcgBEGoAmoQOyILIC85AzggCyA2OQMwIAsgNTkDKCALIDQ5AyAgCyAwOQMYIAsgMzkDECALIDI5AwggCyAxOQMAIAsoAkwhBSALQcgAaiIZIAQoAvwEIgMQMyALIAM2AkwgBUERSSAFIANBAXRNckUEQCAZEHELIAsoApwBIQUgC0GYAWoiGiAEKAL8BCIDEDMgCyADNgKcASAFQRFJIAUgA0EBdE1yRQRAIBoQcQsgC0HYAGogBxDJASALKAKsASEFIAtBqAFqIhsgBCgC+AQiAxAzIAsgAzYCrAEgBUERSSAFIANBAXRNckUEQCAbEHELIARCADcDoAIgBEIANwOYAiAEQgA3A5ACIARCADcDiAIgBEIANwMIIARCADcDECAEQgA3AxggBEIANwMgIAtBuAFqIAcgBEEIahDaBCALKALcASEFIAtB2AFqIh8gBCgC+AQiAxA5IAsgAzYC3AEgBUERSSAFIANBAXRNckUEQCAfEIMBCyAXQQBKBEAgCyAXNgJAIAtBiAFqIAQoAvQEIBdsRAAAAAAAAAAAEIABC0GYlQIoAgAhICAGKAIUIgMgBigCGCIIRwRAIAggA2tBA3UhKCALQYgBaiEhIARBiAVqISkgBEGwAWohKiAEQdwFaiEiIARBLGohIwNAIAQoAtwEIQUgBigCFCAYQQN0aiIVKAIAIg8oAgwiFigCvAEiAwRAIANBBXQiAwRAIAsoArgBIAUgGEECdGooAgBBBXRqIBYoArgBIAP8CgAACyAVKAIAIg8oAgwhFiAEKALcBCEFCyAYQQJ0IhQgBCgCxARqISQgFigCQCETIBYoAlwiCARAICQoAgAhJSAFIBRqIhEoAgAhEiAEKALoBCAUaigCACENIAsoAnghDiALKAJoIQwgFigCaCEKIAsoAlghByAWKAJYIQNBACEFA0AgByARKAIAIAVqQQJ0IiZqIAMgBUECdCInaigCACANajYCACAMICZqIAogJ2ooAgAgEmo2AgAgDiAmaiATBH8gFigCeCAnaigCACAlagUgJQs2AgAgBUEBaiIFIAhHDQALIBYoAkAhEwsCQCATRSATQQBMcg0AIBMgFigCjAFqQQFrIQ4gISgCACEMIBYoAogBIQpBACEIA0AgDiAIayINIA0gE3AiB0cEQCAKIAhBA3QiA2oiBSANIAdrQQN0aiEHIAwgJCgCACAXbEEDdGogA2ohAwNAIAMgBSsDADkDACADIBdBA3RqIQMgBSATQQN0aiIFIAdHDQALCyAIQQFqIgggE0cNAAsgE0ECTA0AIARCgICAgICAgPg/NwMoIARCADcDQCAEQgA3AzggBEIANwMwIARCgICAgICAgPg/NwNIIARCADcDYCAEQgA3A1ggBEIANwNQIARCgICAgICAgPg/NwNoIARCADcDgAEgBEIANwN4IARCADcDcCAEQdgFaiIDIA9BGGogBEEoaiIFEMoBIBUoAgAhDyAEKwPYBSAEKwPgBWENACAPKwMYITcgDysDMCE4IA8rA0ghOSAPKwMgITogDysDOCEuIA8rA1AhLSAPKwMoISwgDysDQCErIAQgDysDWDkDmAYgBCArOQOQBiAEICw5A4gGIAQgLTkDgAYgBCAuOQP4BSAEIDo5A/AFIAQgOTkD6AUgBCA4OQPgBSAEIDc5A9gFIAUgAxCQASAVKAIAKAIMIgNB2ABqIANByAFqIAUgISAWKAKMASATbiAXIAQoAsQEIBRqKAIAEL4EIBUoAgAhDwsgBEKAgICAgICA+D83AyggBEIANwNAIARCADcDOCAEQgA3AzAgBEKAgICAgICA+D83A0ggBEIANwNgIARCADcDWCAEQgA3A1AgBEKAgICAgICA+D83A2ggBEIANwOAASAEQgA3A3ggBEIANwNwIARB2AVqIA9BGGogBEEoahDKASAVKAIAIQgCQCAEKwPYBSAEKwPgBWEEQCAIKAIMIgUoAkwiAwRAIANBGGwiAwRAIBkoAgAgBCgC6AQgFGooAgBBGGxqIAUoAkggA/wKAAALIBUoAgAiCCgCDCEFCyAFKAKcASIDBEAgA0EYbCIDBEAgGigCACAEKALoBCAUaigCAEEYbGogBSgCmAEgA/wKAAALIBUoAgAiCCgCDCEFCyAFKAKsASIDRQ0BIANBGGwiAwRAIBsoAgAgBCgC0AQgFGooAgBBGGxqIAUoAqgBIAP8CgAACyAVKAIAIQgMAQsgCCsDcCEuIAgrA2ghLSAIKwNgISwgCCgCDCgCSCEFIAgrAxghQCAIKwMwIUEgCCsDSCE7IAgrAyAhPCAIKwM4IT0gCCsDUCE+IAgrAyghPyAIKwNAITcgBCAIKwNYIis5A2ggBCA3OQNgIAQgPzkDWCAEID45A1AgBCA9OQNIIAQgPDkDQCAEIDs5AzggBCBBOQMwIAQgQDkDKCAEQagGaiIDIARBKGoQkAEgFSgCACgCDCINKAKYASEMICMgA0HIAPwKAAAgDSgCqAEhCiAiIANByAD8CgAAIAQoAugEIQ4CQCANKAJMIgNFBEAgDiAUaigCACEPDAELIAUgA0EYbGohByAZKAIAIA4gFGooAgAiD0EYbGohAwNAIAMgLiA/IAUrAwAiOKIgNyAFKwMIIjmioCArIAUrAxAiOqKgoDkDECADIC0gPCA4oiA9IDmioCA+IDqioKA5AwggAyAsIEAgOKIgQSA5oqAgOyA6oqCgOQMAIANBGGohAyAFQRhqIgUgB0cNAAsLIAQgDDYCqAEgKiAjQcgA/AoAACAEQQE6APgBIARBqAFqIA0oApwBIBooAgAgD0EYbGoQ2QQgBCAKNgKABSApICJByAD8CgAAIARBAToA0AUgBEGABWogFSgCACgCDCgCrAEgGygCACAEKALQBCAUaigCAEEYbGoQ2QQgFSgCACIIKwMwIj4gCCsDUCI/oiAIKwM4IjcgCCsDSCI4oqEgCCsDKCItoiAIKwMYIiwgNyAIKwNYIjmiIAgrA0AiOiA/oqGiIAgrAyAiKyA6IDiiID4gOaKhoqCgIS4gCCgCDCINKAK8ASIKBEAgDSgCuAEhByALKAK4ASAEKALcBCAUaigCAEEFdGohA0EAIQUDQCAHIC5EAAAAAAAAAABjBH8gDSgCaCAFIAVBA3BBAXRrQQJ0aigCCAUgBQtBBXRqIg4rAxAhOyAOKwMAITwgDisDCCE9IAMgBUEFdGoiDCAOKwMYOQMYIAwgLSA8oiA6ID2ioCA5IDuioDkDECAMICsgPKIgNyA9oqAgPyA7oqA5AwggDCAsIDyiID4gPaKgIDggO6KgOQMAIAVBAWoiBSAKRw0ACwsgLkQAAAAAAAAAAGNFDQAgDSgCXCIFQQNuIAVBA0kNACAEKALQBCAUaigCACITaiEKIAsoAnghESALKAJoIRIgCygCWCENA0AgBCANIBNBA2wiDkECaiIFQQJ0IgdqIgMoAgA2AoAHIAQgA0F4QQQgBUEDb0ECRhtqKAIANgKEByAEIAcgEmooAgA2AogHIAQgByARaigCADYCjAcgBCANIA5BAWoiB0ECdCIMaiIDKAIAIgU2ApAHIAQgA0F4QQQgB0EDb0ECRhtqKAIANgKUByAEIAwgEmooAgA2ApgHIAQgDCARaigCADYCnAcgDSAOQQJ0IgdqKAIAIQMgBCAFNgKkByAEIAM2AqAHIAQgByASaigCADYCqAcgBCAHIBFqKAIANgKsByAEQQI2AvwGIARCgICAgBA3AvQGQQAhAwNAIARBgAdqIARB9AZqIANqKAIAQQR0aiIFIAUpAgBCIIk3AgAgBSAFKAIIIgUgBUEDb0EBdGtBAmo2AgggA0EEaiIDQQxHDQALIARBAjYC/AYgBEKAgICAEDcC9AZBACEFA0AgDSAEQfQGaiAFaigCACIDIA5qQQJ0IgdqIARBgAdqIANBBHRqIgMoAgA2AgAgByASaiADKAIINgIAIAcgEWogAygCDDYCACAFQQRqIgVBDEcNAAsgE0EBaiITIApHDQALCyAIKAIMIgUoAtwBIgMEQCAYICBsIQwgBSgC2AEiBSADQQR0aiEKIB8oAgAgBCgC0AQgFGooAgBBBHRqIQMDQCAFKAIAIQcgBCAFKAIMNgIwIAQgBSkCBDcDKCADIAcgDGo2AgAgAyAEKQMoNwIEIAMgBCgCMDYCDCADQRBqIQMgBUEQaiIFIApHDQALCyAYQQFqIhggKEcNAAsgBigCGCEIIAYoAhQhAwsgAyAIRwRAIAtBzAFqIRJBACEPA0AgAyAPQQN0aiIRKAIAKAIMIgcoAswBIgUgB0HQAWoiDUcEQCAPICBsIQ4DQCAFLwGAASEMIAUrA3ghLyAFKwNwITAgBSsDaCExIAUrA2AhMiAFKwNYITMgBSsDUCE0IAUrA0ghNSAFKwNAITYgBSsDOCEuIAUrAzAhLSAFKwMoISwgBSsDICErIAUpAxghQyARKAIAIQMgBEKAgICAgICA+D83AyggBEIANwNAIARCADcDOCAEQgA3AzAgBEKAgICAgICA+D83A0ggBEIANwNgIARCADcDWCAEQgA3A1AgBEKAgICAgICA+D83A2ggBEIANwOAASAEQgA3A3ggBEIANwNwIARBqAFqIgogA0EYaiAEQShqIgcQygEgBCsDqAEgBCsDsAFiBEAgESgCACEDIARCgICAgICAgPg/NwOgASAEIC85A5gBIAQgMDkDkAEgBCAxOQOIASAEQgA3A4ABIAQgMjkDeCAEIDM5A3AgBCA0OQNoIARCADcDYCAEIDU5A1ggBCA2OQNQIAQgLjkDSCAEQgA3A0AgBCAtOQM4IAQgLDkDMCAEICs5AyggCiADQRhqIAcQ8AEgBCsD+AEhMCAEKwPwASExIAQrA+gBITIgBCsD4AEhMyAEKwPYASE0IAQrA9ABITUgBCsDyAEhNiAEKwPAASEuIAQrA7gBIS0gBCsDsAEhLCAEKwOAAiEvIAQrA6gBISsLIAQgBSgCECAOajYCgAUgBCAEQYAFaiIDNgKoASAEQShqIBIgAyAEQagBahB5IAQoAigiAyAMOwGAASADIC85A3ggAyAwOQNwIAMgMTkDaCADIDI5A2AgAyAzOQNYIAMgNDkDUCADIDU5A0ggAyA2OQNAIAMgLjkDOCADIC05AzAgAyAsOQMoIAMgKzkDICADIEM3AxgCQCAFKAIEIgMEQANAIAMiBSgCACIDDQAMAgsACwNAIAUgBSgCCCIFKAIARw0ACwsgBSANRw0ACyAGKAIYIQggBigCFCEDCyAPQQFqIg8gCCADa0EDdUkNAAsLIAsQ9gIgC0EAEFQgCxC1BCAeIAsQ7wEgCxA6GgwBCyAEQagCahA7IgMgBSgCACgCDCgCRDYCRCAeIAMQ7wEgAxA6GgsgBCgCxAQiAwRAIAQgAzYCyAQgBCgCzAQaIAMQIgsgBCgC0AQiAwRAIAQgAzYC1AQgBCgC2AQaIAMQIgsgBCgC3AQiAwRAIAQgAzYC4AQgBCgC5AQaIAMQIgsgBCgC6AQiAwRAIAQgAzYC7AQgBCgC8AQaIAMQIgsgBEGwB2okAAJAIAYoAiQiAyAGKAIoIgVJBEAgAyAGKAIMNgIAIAMgBigCEDYCBCAGIANBCGo2AiQMAQsgAyAGKAIgIgNrQQN1IgdBAWoiCkGAgICAAk8NByAGQfwAakH/////ASAFIANrIgVBAnUiAyAKIAMgCksbIAVB+P///wdPGyAHIAZBIGoQSyEKIAYoAoQBIgMgBigCDDYCACADIAYoAhA2AgQgBiADQQhqNgKEASAGQgA3AgwgBigCgAEgBigCJCAGKAIgIgNrIgdrIQUgBwRAIAUgAyAH/AoAAAsgBiAGKAIgIgc2AoABIAYgBTYCICAGKAKEASEFIAYgBzYChAEgBiAFNgIkIAYoAighAyAGIAYoAogBNgIoIAYgAzYCiAEgCiAHNgIAIAoQbiAGIAU2AiQgBigCECIFRQ0AIAUgBSgCBCIDQQFrNgIEIAMNACAFIAUoAgAoAggRAAAgBRAkCyACBEAgAiAJKAIEQQFrIgMgAigCBGo2AgQgAiACKAIMIANBC2xqNgIMCyAGIAZBFGo2AnwgBkH8AGoQZQsgHSAJQRBqIglHDQALDAELECYACyABKAIAIBBBA3RqIgMgASgCBCIFRwRAAkAgAyAFIANraiIJIAEoAgQiCkYEQCADIQUMAQsgAyEFA0AgBSAJEE4gBUEIaiEFIAlBCGoiCSAKRw0ACyABKAIEIQoLIAogAyAFIANraiIDRwRAA0AgAyAKQQhrEC8iCkcNAAsLIAEgAzYCBAsgBkEUakEAIAZBIGogAhDYBAJAIAEoAgQiAyABKAIIIgVJBEAgAyAGKAIUNgIAIAMgBigCGDYCBCABIANBCGo2AgQMAQsgAyABKAIAIgNrQQN1IgdBAWoiEEGAgICAAk8NAyAGQfwAakH/////ASAFIANrIgVBAnUiAyAQIAMgEEsbIAVB+P///wdPGyAHIAEQSyEQIAYoAoQBIgMgBigCFDYCACADIAYoAhg2AgQgBiADQQhqNgKEASAGQgA3AhQgBigCgAEgASgCBCABKAIAIgNrIgdrIQUgBwRAIAUgAyAH/AoAAAsgASgCACEHIAEgBTYCACAGIAc2AoABIAEgBigChAEiBTYCBCAGIAc2AoQBIAEoAgghAyABIAYoAogBNgIIIAYgAzYCiAEgECAHNgIAIBAQbiAGKAIYIQcgASAFNgIEIAdFDQAgByAHKAIEIgNBAWs2AgQgAw0AIAcgBygCACgCCBEAACAHECQLIAEoAgAiECgCACEFIBAgASgCBCIHQQhrIgMoAgA2AgAgAyAFNgIAIBAoAgQhBSAQIAdBBGsiAygCADYCBCADIAU2AgAgBiAGQSBqNgJ8IAZB/ABqEGUgBiAGQSxqNgJ8IAYoAnwiBSgCACIJBEAgBSgCBCIDIAlHBEADQCADQRBrIgcoAgAiEARAIBAQIgsgB0EANgIAIANBDGtCADcCACAHIgMgCUcNAAsLIAUgCTYCBCAGKAJ8IgUoAgAgBSgCCBoQIgsgBigCOCIDBEAgAxAiCyABKAIEIAEoAgAiBWtBA3UiA0EBSw0ACwsgACAFKAIANgIAIAAgBSgCBCIANgIEIABFDQEgACAAKAIEQQFqNgIEDAELECYACyAGQZABaiQAC9gBAQR/QaABECMiAkGAlAI2AgAgAkIANwIEIAJBEGoiAUIANwIEIAFBmJICNgIAQagCECMiA0GgkAI2AgAgA0IANwIEIANBEGoQOyEEIAFCADcDICABQoCAgICAgID4PzcDGCABIAM2AhAgASAENgIMIAFCADcDKCABQgA3AzAgAUIANwNAIAFCgICAgICAgPg/NwM4IAFCADcDSCABQgA3A1AgAUKAgICAgICA+D83A1ggAUHgAGpBAEEw/AsAIAAgAjYCBCAAIAE2AgAgACACQRRqIAEQjwELyQEBAX8gACgCfCIBBEAgARAiCyAAQQA2AoQBIABCADcCfCAAKAJsIgEEQCABECILIABBADYCdCAAQgA3AmwgACgCXCIBBEAgARAiCyAAQQA2AmQgAEIANwJcIAAoAkwiAQRAIAEQIgsgAEEANgJUIABCADcCTCAAKAI8IgEEQCABECILIAAoAiwiAQRAIAEQIgsgAEEANgI0IABCADcCLCAAKAIcIgEEQCABECILIABBADYCJCAAQgA3AhwgACgCDCIABEAgABAiCwufAQECfyMAQbADayIFJAACQCAEBEAgBC0AEEEBRgRAIAAQmQIMAgsgBUGYAWoiBiAFQQRqIAEgAiADIAQQjgMiASADEJ8CIAAgBhDvASAGEDoaIAEQ/AIgBCAEKAIEQQFqNgIEDAELIAVBmAFqIgQgBUEEaiABIAIgA0EAEI4DIgEgAxCfAiAAIAQQ7wEgBBA6GiABEPwCCyAFQbADaiQAC6UBAQF/IABCADcCBCAAQZiSAjYCACAAIAEoAgA2AgwgACABKAIEIgI2AhAgAgRAIAIgAigCBEEBajYCBAsgAEIANwMgIABCgICAgICAgPg/NwMYIABCADcDKCAAQgA3AzAgAEIANwNAIABCgICAgICAgPg/NwM4IABCADcDSCAAQgA3A1AgAEKAgICAgICA+D83A1ggAEHgAGpBAEEw/AsAIAEQLxoL4gIBBX8jAEEgayIFJAACQAJAIAAoAgQiAiAAKAIIIgNJBEAgAiABKAIANgIAIAIgASgCBCIBNgIEIAEEQCABIAEoAgRBAWo2AgQLIAJBCGohAQwBCyACIAAoAgAiBGtBA3UiBkEBaiICQYCAgIACTw0BIAVBDGpB/////wEgAyAEayIDQQJ1IgQgAiACIARJGyADQfj///8HTxsgBiAAEEsiAigCCCIDIAEoAgA2AgAgAyABKAIEIgE2AgQgAiABBH8gASABKAIEQQFqNgIEIAIoAggFIAMLQQhqNgIIIAIoAgQgACgCBCAAKAIAIgNrIgFrIQQgAQRAIAQgAyAB/AoAAAsgACgCACEDIAAgBDYCACACIAM2AgQgACACKAIIIgE2AgQgAiADNgIIIAAoAgghBCAAIAIoAgw2AgggAiADNgIAIAIgBDYCDCACEG4LIAAgATYCBCAFQSBqJAAPCxAmAAubAgEEf0GYARAjIgRBsJMCNgIAIARCADcCBCACLAAAIQUjAEEQayIDJAAgBEEQaiICQgA3AgQgAkG0kgI2AgAgA0EANgIIIANCADcCACADIAEoAgAiBiABKAIEIgEgASAGa0EDdRCBAyACQQxqIAMQ0wQgAyADNgIMIANBDGoQZSACQgA3AyggAkKAgICAgICA+D83AyAgAiAFOgAcIAJCADcDMCACQgA3AzggAkIANwNIIAJCgICAgICAgPg/NwNAIAJCADcDUCACQgA3A1ggAkIANwNoIAJCgICAgICAgPg/NwNgIAJCADcDcCACQgA3A3ggAkIANwOAASADQRBqJAAgACAENgIEIAAgAjYCACAAIARBFGogAhCPAQtkAQF/IAMEQCAAIAMQkAMgACgCBCEDIAEgAkcEQANAIAMgASgCADYCACADIAEoAgQiBDYCBCAEBEAgBCAEKAIEQQFqNgIECyADQQhqIQMgAUEIaiIBIAJHDQALCyAAIAM2AgQLC6kNAgx/AnwjAEEgayIJJAACQCAERQ0AA0ACQAJAIAQgBkwgAyAGTHJFBEAgA0UNBCABKwMAIRMDQCATIAArAwAiFGMNAiATIBRhBEAgASgCDCAAKAIMSA0DCyAAQRhqIQAgA0EBayIDDQALDAQLIAMgBEoNASAAIAFGDQMgBSEHIAAhCANAIAcgCCkDEDcDECAHIAgpAwg3AwggByAIKQMANwMAIAdBGGohByAIQRhqIgggAUcNAAsDQCABIAJGBEAgByAFayIBRQ0FIAAgBSAB/AoAAAwFCwJAAkAgASsDACITIAUrAwAiFGNFBEAgEyAUYg0BIAEoAgwgBSgCDE4NAQsgACABKQMQNwMQIAAgASkDCDcDCCAAIAEpAwA3AwAgAUEYaiEBDAELIAAgBSkDEDcDECAAIAUpAwg3AwggACAFKQMANwMAIAVBGGohBQsgAEEYaiEAIAUgB0cNAAsMAwsCQCADIARIBEAgBEECbSIOQRhsIQwCQCAAIAFGBEAgACEKDAELIAEgAGtBGG0hByABIAxqIggoAgwhDSAIKwMAIRMgACEKA0ACfwJAIBMgCiAHQQF2IghBGGxqIgsrAwAiFGMNACATIBRhBEAgDSALKAIMSA0BCyALQRhqIQogByAIQX9zagwBCyAICyIHDQALCyAKIABrQRhtIQ8MAQsgA0EBRgRAIAkgACkDEDcDGCAJIAApAwg3AxAgCSAAKQMANwMIIAAgASkDEDcDECAAIAEpAwg3AwggACABKQMANwMAIAEgCSkDGDcDECABIAkpAxA3AwggASAJKQMINwMADAQLIAAgA0ECbSIPQRhsaiEKAkAgASACRgRAQQAhDAwBCyACIAFrQRhtIQcgCigCDCELIAorAwAhE0EAIQwDQAJ/AkAgASAHQQF2IghBGGwgDGoiDWoiDisDACIUIBNjRQRAIBMgFGINASAOKAIMIAtODQELIA1BGGohDCAHIAhBf3NqDAELIAgLIgcNAAsLIAxBGG4hDgsgBCAOayEEIAMgD2shAyABIAxqIg0hBwJAIAEgCkYNACAKIQcgDEUNACABIAdBGGoiCEYEQCAJIAcpAxA3AxggCSAHKQMINwMQIAkgBykDADcDCCAMBEAgByAIIAz8CgAACyAKIAxqIgcgCSkDGDcDECAHIAkpAxA3AwggByAJKQMINwMADAELIAxBGEYEQCAJIA1BGGsiASkDEDcDGCAJIAEpAwg3AxAgCSABKQMANwMIIA0gASAKayIIQWhtQRhsaiEHIAhFIAEgCkZyRQRAIAcgCiAI/AoAAAsgCiAJKQMYNwMQIAogCSkDEDcDCCAKIAkpAwg3AwAMAQsgASEIIAEgCmsiEUEYbSIQIQsCQCAMQRhtIhIgEEYEQANAIAkgBykDEDcDGCAJIAcpAwg3AxAgCSAHKQMANwMIIAcgCCkDEDcDECAHIAgpAwg3AwggByAIKQMANwMAIAggCSkDGDcDECAIIAkpAxA3AwggCCAJKQMINwMAIAdBGGoiByABRg0CIAhBGGoiCCANRw0ADAILAAsDQCALIBIiC28iEg0ACyAKIAtBGGxqIQsDQCAJIAtBGGsiCykDEDcDGCAJIAspAwg3AxAgCSALKQMANwMIIAsgEWohCCALIQEDQCABIAgpAxA3AxAgASAIKQMINwMIIAEgCCkDADcDACAIIgEgEWogCiAQIA0gAWtBGG0iB2tBGGxqIAcgEEobIgggC0cNAAsgASAJKQMYNwMQIAEgCSkDEDcDCCABIAkpAwg3AwAgCiALRw0ACyAKIAxqIQcMAQsgASEHCwJ/IA4gD2ogAyAEakgEQCAAIAogByAPIA4gBSAGEIIDIAchACANDAELIAcgDSACIAMgBCAFIAYQggMgDiEEIA8hAyAHIQIgCgshASAEDQEMAgsLIAEgAkYNACAFIQcgASEIA0AgByAIKQMQNwMQIAcgCCkDCDcDCCAHIAgpAwA3AwAgB0EYaiEHIAhBGGoiCCACRw0ACwNAIAAgASIDRgRAA0AgAkEYayICIAdBGGsiBykDEDcDECACIAcpAwg3AwggAiAHKQMANwMAIAUgB0cNAAwDCwALAn8gB0EYayIEKwMAIhMgA0EYayIIKwMAIhRjBEAgCAwBCyATIBRhBEAgCCAHQQxrKAIAIANBDGsoAgBIDQEaCyAEIgghByADCyEBIAJBGGsiAiAIKQMQNwMQIAIgCCkDCDcDCCACIAgpAwA3AwAgBSAHRw0ACwsgCUEgaiQAC/YEAQl/IwBBEGsiCiQAIAEgAkcEQCAAQQRqIQYDQCMAQRBrIggkACAKAn8gCEEIaiEEIAFBEGohCwJAAkACQCAAQQRqIgUgBkcEQCALKAIAIgkgBigCECIDTg0BCyAGKAIAIQcCQCAGIgMgACgCAEcEQAJAIAdFBEADQCADIAMoAggiAygCAEYNAAwCCwALIAchBANAIAQiAygCBCIEDQALCyALKAIAIgkgAygCEEwNAQsgB0UEQCAIIAY2AgwgBgwFCyAIIAM2AgwgA0EEagwECyAFKAIAIgNFDQEgBSEEA0AgAyIFKAIQIgcgCUoEQCADIgQoAgAiAw0BDAQLIAcgCU4NAyAFQQRqIQQgBSgCBCIDDQALDAILIAMgCUgEQAJAIAYoAgQiB0UEQCAGIQMDQCADIAMoAggiAygCAEcNAAsMAQsgByEEA0AgBCIDKAIAIgQNAAsLAkAgAyAFRwRAIAkgAygCEE4NAQsgB0UEQCAIIAY2AgwgBkEEagwFCyAIIAM2AgwgAwwECyAFKAIAIgNFDQEgBSEEA0AgAyIFKAIQIgcgCUoEQCADIgQoAgAiA0UNBAwBCyAHIAlODQMgBUEEaiEEIAUoAgQiAw0ACwwCCyAIIAY2AgwgBCAGNgIAIAQMAgsgBSEECyAIIAU2AgwgBAsiAygCACIEBH9BAAVBiAEQIyIEQRBqIAtB+AD8CgAAIAAgCCgCDCADIAQQggFBAQs6AAwgCiAENgIIIAhBEGokAAJAIAEoAgQiAwRAA0AgAyIBKAIAIgMNAAwCCwALA0AgASABKAIIIgEoAgBHDQALCyABIAJHDQALCyAKQRBqJAALTQEDfyAAKAIAIQICQCAAKAIEIgFFBEAMAQsgARAnIQMgAUUNACADIAIgAfwKAAALIAAgAgR/IAIQIiAAKAIEBSABCzYCCCAAIAM2AgALsgkBDn8jAEEQayIRJAACQCAFRQ0AA0ACQAJAIAUgB0wgBCAHTHJFBEAgBEUNBCADKAIAKAIAIg0gASgCACILQQN0aiIIQQEgAygCBCgCACIJa0ECdCIOaiEKIAggCUECdCIPaigCACEIA0AgCCANIAAoAgAiCUEDdGoiDCAPaigCACIQSA0CIAggEEYEQCAKKAIAIAwgDmooAgBIDQMLIABBBGohACAEQQFrIgQNAAsMBAsgBCAFSg0BIAAgAUYNAyAGIQQgACEIA0AgBCAIKAIANgIAIARBBGohBCAIQQRqIgggAUcNAAsgAygCBCEFIAMoAgAhAwNAIAEgAkYEQCAEIAZrIgFFDQUgACAGIAH8CgAADAULAkACQCADKAIAIgcgASgCACIIQQN0aiILIAUoAgAiCUECdCIKaigCACIMIAogByAGKAIAIgpBA3RqIgdqKAIAIg1OBEAgDCANRw0BIAtBASAJa0ECdCIJaigCACAHIAlqKAIATg0BCyAAIAg2AgAgAUEEaiEBDAELIAAgCjYCACAGQQRqIQYLIABBBGohACAEIAZHDQALDAMLAkAgBCAFSARAIAEgBUECbSIKQQJ0aiELAkAgACABRgRAIAAhCQwBCyANIAsoAgBBA3RqIgggDmohEiAIIA9qKAIAIRAgASAAa0ECdSEIIAAhCQNAAn8CQCAQIA0gCSAIQQF2IgxBAnRqIhMoAgBBA3RqIhQgD2ooAgAiFUgNACAQIBVGBEAgEigCACAOIBRqKAIASA0BCyATQQRqIQkgCCAMQX9zagwBCyAMCyIIDQALCyAJIABrQQJ1IQwMAQsgBEEBRgRAIAAgCzYCACABIAk2AgAMBAsgACAEQQJtIgxBAnRqIQkCQCABIAJGBEAgASELDAELIA0gCSgCAEEDdGoiCCAOaiESIAggD2ooAgAhECACIAFrQQJ1IQggASELA0ACfwJAIBAgDSALIAhBAXYiCkECdGoiEygCAEEDdGoiFCAPaigCACIVTARAIBAgFUcNASAOIBRqKAIAIBIoAgBODQELIBNBBGohCyAIIApBf3NqDAELIAoLIggNAAsLIAsgAWtBAnUhCgsgEUEIaiAJIAEgCxCRASARKAIIIQgCfyAKIAxqIAUgCmsiBSAEIAxrIgRqSARAIAAgCSAIIAMgDCAKIAYgBxCFAyAIIQAgCwwBCyAIIAsgAiADIAQgBSAGIAcQhQMgCiEFIAwhBCAIIQIgCQshASAFDQEMAgsLIAEgAkYNACAGIQQgASEIA0AgBCAIKAIANgIAIARBBGohBCAIQQRqIgggAkcNAAsgAygCBCELIAMoAgAhCQNAIAAgASIDRgRAA0AgAkEEayICIARBBGsiBCgCADYCACAEIAZHDQAMAwsACwJAIAkoAgAiCiAEQQRrIgcoAgAiCEEDdGoiDCALKAIAIg1BAnQiAWooAgAiDiABIAogA0EEayIBKAIAIgVBA3RqIgpqKAIAIg9IDQAgDiAPRgRAIAxBASANa0ECdCINaigCACAKIA1qKAIASA0BCyAIIQUgAyEBIAchBAsgAkEEayICIAU2AgAgBCAGRw0ACwsgEUEQaiQAC5YHAgl8DH8jAEFAaiIPQRBqQQBBMPwLACAPQQI2AgwgD0KAgICAEDcCBCACQRhsIgIgASgCACIOKAKYAWorAwAhCiAOKAJIIAJqIhQrAwAhBiABKAIEIhEoApgBIRUgESgCSCEWQQAhAUEAIQIDQAJ/IAogFSAEIA9BBGogAmooAgBBBHRqIhAoAgRBGGwiDmorAwCaZCAOIBZqIg4rAwAiCCAGYyAGIAhhGyAKIBUgECgCCEEYbCITaisDAJpkIBMgFmoiEysDACIJIAZjIAYgCWEbayIZRQRARAAAAAAAAPh/IQVEAAAAAAAA+H8hB0EADAELIBAoAgAhGCAOKwMQIQcgDisDCCEFAkAgBiAIoSILIAYgCaEiDCALmSAMmWMiDhsgCSAIoaMiCL1C////////////AINC//////////f/AFYNACATKwMIIgkgBaEiC71C////////////AINCgICAgICAgPj/AFoNACATKwMQIgwgB6EiDb1C////////////AINCgICAgICAgPj/AFoNACAHIAwgDhsgCCANoqAhByAFIAkgDhsgCCALoqAhBQsgGUEAIBEoAqgBIg4gGEEDbUEYbGorAwggDiARKAJoIBhBAnRqKAIAQQNtQRhsaisDCKBEAAAAAAAAAABkIAUgFCsDCCIIYyAFIAhhGxsLIQ4CQCAFvUL///////////8Ag0L/////////9/8AVg0AIA5BACAOayAQLQAMGyASaiESIAFBAUoEQEECIQEMAQsgAUUgDkUgF3NFckUEQEEBIQEMAQsgD0EQaiABQRhsaiIQIAc5AxAgECAHOQMIIBAgBTkDACABQQFqIQEgDkEARyEXCyACQQRqIgJBDEcNAAsCfyASRQRARAAAAAAAAPh/IQVBAAwBCyASQQAgESgCqAEgA0EYbGorAxBEAAAAAAAAAABkIA8rAyAiBSAPKwM4IgYgFCsDCCIHIA8rAxAiCKEiCZkgByAPKwMoIgehIgqZYyIBGyAGIAWhIgYgCSAKIAEbIAcgCKGjIgeioCAFIAa9Qv///////////wCDQoCAgICAgID4/wBUGyAFIA8rAzAgDysDGKG9Qv///////////wCDQoCAgICAgID4/wBUGyAFIAe9Qv///////////wCDQoCAgICAgID4/wBUGyIFIBQrAxAiBmMgBSAGYRsbCyEBIAAgBTkDCCAAIAE2AgALsgkBDn8jAEEQayIRJAACQCAFRQ0AA0ACQAJAIAUgB0wgBCAHTHJFBEAgBEUNBCADKAIAKAIAIg0gASgCACILQQN0aiIIQQEgAygCBCgCACIJa0ECdCIOaiEKIAggCUECdCIPaigCACEIA0AgCCANIAAoAgAiCUEDdGoiDCAPaigCACIQSA0CIAggEEYEQCAKKAIAIAwgDmooAgBIDQMLIABBBGohACAEQQFrIgQNAAsMBAsgBCAFSg0BIAAgAUYNAyAGIQQgACEIA0AgBCAIKAIANgIAIARBBGohBCAIQQRqIgggAUcNAAsgAygCBCEFIAMoAgAhAwNAIAEgAkYEQCAEIAZrIgFFDQUgACAGIAH8CgAADAULAkACQCADKAIAIgcgASgCACIIQQN0aiILIAUoAgAiCUECdCIKaigCACIMIAogByAGKAIAIgpBA3RqIgdqKAIAIg1OBEAgDCANRw0BIAtBASAJa0ECdCIJaigCACAHIAlqKAIATg0BCyAAIAg2AgAgAUEEaiEBDAELIAAgCjYCACAGQQRqIQYLIABBBGohACAEIAZHDQALDAMLAkAgBCAFSARAIAEgBUECbSIKQQJ0aiELAkAgACABRgRAIAAhCQwBCyANIAsoAgBBA3RqIgggDmohEiAIIA9qKAIAIRAgASAAa0ECdSEIIAAhCQNAAn8CQCAQIA0gCSAIQQF2IgxBAnRqIhMoAgBBA3RqIhQgD2ooAgAiFUgNACAQIBVGBEAgEigCACAOIBRqKAIASA0BCyATQQRqIQkgCCAMQX9zagwBCyAMCyIIDQALCyAJIABrQQJ1IQwMAQsgBEEBRgRAIAAgCzYCACABIAk2AgAMBAsgACAEQQJtIgxBAnRqIQkCQCABIAJGBEAgASELDAELIA0gCSgCAEEDdGoiCCAOaiESIAggD2ooAgAhECACIAFrQQJ1IQggASELA0ACfwJAIBAgDSALIAhBAXYiCkECdGoiEygCAEEDdGoiFCAPaigCACIVTARAIBAgFUcNASAOIBRqKAIAIBIoAgBODQELIBNBBGohCyAIIApBf3NqDAELIAoLIggNAAsLIAsgAWtBAnUhCgsgEUEIaiAJIAEgCxCRASARKAIIIQgCfyAKIAxqIAUgCmsiBSAEIAxrIgRqSARAIAAgCSAIIAMgDCAKIAYgBxCHAyAIIQAgCwwBCyAIIAsgAiADIAQgBSAGIAcQhwMgCiEFIAwhBCAIIQIgCQshASAFDQEMAgsLIAEgAkYNACAGIQQgASEIA0AgBCAIKAIANgIAIARBBGohBCAIQQRqIgggAkcNAAsgAygCBCELIAMoAgAhCQNAIAAgASIDRgRAA0AgAkEEayICIARBBGsiBCgCADYCACAEIAZHDQAMAwsACwJAIAkoAgAiCiAEQQRrIgcoAgAiCEEDdGoiDCALKAIAIg1BAnQiAWooAgAiDiABIAogA0EEayIBKAIAIgVBA3RqIgpqKAIAIg9IDQAgDiAPRgRAIAxBASANa0ECdCINaigCACAKIA1qKAIASA0BCyAIIQUgAyEBIAchBAsgAkEEayICIAU2AgAgBCAGRw0ACwsgEUEQaiQAC5QHAgl8DH8jAEFAaiIPQRBqQQBBMPwLACAPQQI2AgwgD0KAgICAEDcCBCACQRhsIgIgASgCACIOKAKYAWorAwAhCiAOKAJIIAJqIhQrAwAhBiABKAIEIhEoApgBIRUgESgCSCEWQQAhAUEAIQIDQAJ/IBUgBCAPQQRqIAJqKAIAQQR0aiIQKAIEQRhsIg5qKwMAIApjIA4gFmoiDisDACIIIAZjIAYgCGEbIBUgECgCCEEYbCITaisDACAKYyATIBZqIhMrAwAiCSAGYyAGIAlhG2siGUUEQEQAAAAAAAD4fyEFRAAAAAAAAPh/IQdBAAwBCyAQKAIAIRggDisDECEHIA4rAwghBQJAIAYgCKEiCyAGIAmhIgwgC5kgDJljIg4bIAkgCKGjIgi9Qv///////////wCDQv/////////3/wBWDQAgEysDCCIJIAWhIgu9Qv///////////wCDQoCAgICAgID4/wBaDQAgEysDECIMIAehIg29Qv///////////wCDQoCAgICAgID4/wBaDQAgByAMIA4bIAggDaKgIQcgBSAJIA4bIAggC6KgIQULIBlBACARKAKoASIOIBhBA21BGGxqKwMIIA4gESgCaCAYQQJ0aigCAEEDbUEYbGorAwigRAAAAAAAAAAAYyAFIBQrAwgiCGMgBSAIYRsbCyEOAkAgBb1C////////////AINC//////////f/AFYNACAOQQAgDmsgEC0ADBsgEmohEiABQQFKBEBBAiEBDAELIAFFIA5FIBdzRXJFBEBBASEBDAELIA9BEGogAUEYbGoiECAHOQMQIBAgBzkDCCAQIAU5AwAgAUEBaiEBIA5BAEchFwsgAkEEaiICQQxHDQALAn8gEkUEQEQAAAAAAAD4fyEFQQAMAQsgEkEAIBEoAqgBIANBGGxqKwMQRAAAAAAAAAAAYyAPKwMgIgUgDysDOCIGIBQrAwgiByAPKwMQIgihIgmZIAcgDysDKCIHoSIKmWMiARsgBiAFoSIGIAkgCiABGyAHIAihoyIHoqAgBSAGvUL///////////8Ag0KAgICAgICA+P8AVBsgBSAPKwMwIA8rAxihvUL///////////8Ag0KAgICAgICA+P8AVBsgBSAHvUL///////////8Ag0KAgICAgICA+P8AVBsiBSAUKwMQIgZjIAUgBmEbGwshASAAIAU5AwggACABNgIAC7IJAQ5/IwBBEGsiESQAAkAgBUUNAANAAkACQCAFIAdMIAQgB0xyRQRAIARFDQQgAygCACgCACINIAEoAgAiC0EDdGoiCEEBIAMoAgQoAgAiCWtBAnQiDmohCiAIIAlBAnQiD2ooAgAhCANAIAggDSAAKAIAIglBA3RqIgwgD2ooAgAiEEgNAiAIIBBGBEAgCigCACAMIA5qKAIASA0DCyAAQQRqIQAgBEEBayIEDQALDAQLIAQgBUoNASAAIAFGDQMgBiEEIAAhCANAIAQgCCgCADYCACAEQQRqIQQgCEEEaiIIIAFHDQALIAMoAgQhBSADKAIAIQMDQCABIAJGBEAgBCAGayIBRQ0FIAAgBiAB/AoAAAwFCwJAAkAgAygCACIHIAEoAgAiCEEDdGoiCyAFKAIAIglBAnQiCmooAgAiDCAKIAcgBigCACIKQQN0aiIHaigCACINTgRAIAwgDUcNASALQQEgCWtBAnQiCWooAgAgByAJaigCAE4NAQsgACAINgIAIAFBBGohAQwBCyAAIAo2AgAgBkEEaiEGCyAAQQRqIQAgBCAGRw0ACwwDCwJAIAQgBUgEQCABIAVBAm0iCkECdGohCwJAIAAgAUYEQCAAIQkMAQsgDSALKAIAQQN0aiIIIA5qIRIgCCAPaigCACEQIAEgAGtBAnUhCCAAIQkDQAJ/AkAgECANIAkgCEEBdiIMQQJ0aiITKAIAQQN0aiIUIA9qKAIAIhVIDQAgECAVRgRAIBIoAgAgDiAUaigCAEgNAQsgE0EEaiEJIAggDEF/c2oMAQsgDAsiCA0ACwsgCSAAa0ECdSEMDAELIARBAUYEQCAAIAs2AgAgASAJNgIADAQLIAAgBEECbSIMQQJ0aiEJAkAgASACRgRAIAEhCwwBCyANIAkoAgBBA3RqIgggDmohEiAIIA9qKAIAIRAgAiABa0ECdSEIIAEhCwNAAn8CQCAQIA0gCyAIQQF2IgpBAnRqIhMoAgBBA3RqIhQgD2ooAgAiFUwEQCAQIBVHDQEgDiAUaigCACASKAIATg0BCyATQQRqIQsgCCAKQX9zagwBCyAKCyIIDQALCyALIAFrQQJ1IQoLIBFBCGogCSABIAsQkQEgESgCCCEIAn8gCiAMaiAFIAprIgUgBCAMayIEakgEQCAAIAkgCCADIAwgCiAGIAcQiQMgCCEAIAsMAQsgCCALIAIgAyAEIAUgBiAHEIkDIAohBSAMIQQgCCECIAkLIQEgBQ0BDAILCyABIAJGDQAgBiEEIAEhCANAIAQgCCgCADYCACAEQQRqIQQgCEEEaiIIIAJHDQALIAMoAgQhCyADKAIAIQkDQCAAIAEiA0YEQANAIAJBBGsiAiAEQQRrIgQoAgA2AgAgBCAGRw0ADAMLAAsCQCAJKAIAIgogBEEEayIHKAIAIghBA3RqIgwgCygCACINQQJ0IgFqKAIAIg4gASAKIANBBGsiASgCACIFQQN0aiIKaigCACIPSA0AIA4gD0YEQCAMQQEgDWtBAnQiDWooAgAgCiANaigCAEgNAQsgCCEFIAMhASAHIQQLIAJBBGsiAiAFNgIAIAQgBkcNAAsLIBFBEGokAAuVBwIJfAx/IwBBQGoiD0EQakEAQTD8CwAgD0ECNgIMIA9CgICAgBA3AgQgAkEYbCICIAEoAgAiDigCSGoiFCsDACEIIA4oApgBIAJqKwMAmiELIAEoAgQiEigCmAEhFSASKAJIIRZBACEBQQAhAgNAAn8gFSAEIA9BBGogAmooAgBBBHRqIhEoAghBGGwiDmorAwAgC2QgCCAOIBZqIg4rAwAiBmMgBiAIYRsgFSARKAIEQRhsIhBqKwMAIAtkIAggECAWaiIQKwMAIgljIAggCWEbayIZRQRARAAAAAAAAPh/IQVEAAAAAAAA+H8hB0EADAELIBEoAgAhGCAQKwMQIQcgECsDCCEFAkAgCCAJoSIKIAggBqEiDCAKmSAMmWMiEBsgBiAJoaMiBr1C////////////AINC//////////f/AFYNACAOKwMIIgkgBaEiCr1C////////////AINCgICAgICAgPj/AFoNACAOKwMQIgwgB6EiDb1C////////////AINCgICAgICAgPj/AFoNACAHIAwgEBsgBiANoqAhByAFIAkgEBsgBiAKoqAhBQsgGUEAIBIoAqgBIg4gGEEDbUEYbGorAwggDiASKAJoIBhBAnRqKAIAQQNtQRhsaisDCKBEAAAAAAAAAABkIBQrAwgiBiAFYyAFIAZhGxsLIQ4CQCAFvUL///////////8Ag0L/////////9/8AVg0AQQAgDmsgDiARLQAMGyATaiETIAFBAUoEQEECIQEMAQsgAUUgDkUgF3NFckUEQEEBIQEMAQsgD0EQaiABQRhsaiIRIAc5AxAgESAHOQMIIBEgBTkDACABQQFqIQEgDkEARyEXCyACQQRqIgJBDEcNAAsCfyATRQRARAAAAAAAAPh/IQVBAAwBCyATQQAgEigCqAEgA0EYbGorAxBEAAAAAAAAAABkIBQrAxAiCCAPKwMgIgUgDysDOCIHIBQrAwgiBiAPKwMQIgmhIguZIAYgDysDKCIGoSIKmWMiARsgByAFoSIHIAsgCiABGyAGIAmhoyIGoqAgBSAHvUL///////////8Ag0KAgICAgICA+P8AVBsgBSAPKwMwIA8rAxihvUL///////////8Ag0KAgICAgICA+P8AVBsgBSAGvUL///////////8Ag0KAgICAgICA+P8AVBsiBWMgBSAIYRsbCyEBIAAgBTkDCCAAIAE2AgALsgkBDn8jAEEQayIRJAACQCAFRQ0AA0ACQAJAIAUgB0wgBCAHTHJFBEAgBEUNBCADKAIAKAIAIg0gASgCACILQQN0aiIIQQEgAygCBCgCACIJa0ECdCIOaiEKIAggCUECdCIPaigCACEIA0AgCCANIAAoAgAiCUEDdGoiDCAPaigCACIQSA0CIAggEEYEQCAKKAIAIAwgDmooAgBIDQMLIABBBGohACAEQQFrIgQNAAsMBAsgBCAFSg0BIAAgAUYNAyAGIQQgACEIA0AgBCAIKAIANgIAIARBBGohBCAIQQRqIgggAUcNAAsgAygCBCEFIAMoAgAhAwNAIAEgAkYEQCAEIAZrIgFFDQUgACAGIAH8CgAADAULAkACQCADKAIAIgcgASgCACIIQQN0aiILIAUoAgAiCUECdCIKaigCACIMIAogByAGKAIAIgpBA3RqIgdqKAIAIg1OBEAgDCANRw0BIAtBASAJa0ECdCIJaigCACAHIAlqKAIATg0BCyAAIAg2AgAgAUEEaiEBDAELIAAgCjYCACAGQQRqIQYLIABBBGohACAEIAZHDQALDAMLAkAgBCAFSARAIAEgBUECbSIKQQJ0aiELAkAgACABRgRAIAAhCQwBCyANIAsoAgBBA3RqIgggDmohEiAIIA9qKAIAIRAgASAAa0ECdSEIIAAhCQNAAn8CQCAQIA0gCSAIQQF2IgxBAnRqIhMoAgBBA3RqIhQgD2ooAgAiFUgNACAQIBVGBEAgEigCACAOIBRqKAIASA0BCyATQQRqIQkgCCAMQX9zagwBCyAMCyIIDQALCyAJIABrQQJ1IQwMAQsgBEEBRgRAIAAgCzYCACABIAk2AgAMBAsgACAEQQJtIgxBAnRqIQkCQCABIAJGBEAgASELDAELIA0gCSgCAEEDdGoiCCAOaiESIAggD2ooAgAhECACIAFrQQJ1IQggASELA0ACfwJAIBAgDSALIAhBAXYiCkECdGoiEygCAEEDdGoiFCAPaigCACIVTARAIBAgFUcNASAOIBRqKAIAIBIoAgBODQELIBNBBGohCyAIIApBf3NqDAELIAoLIggNAAsLIAsgAWtBAnUhCgsgEUEIaiAJIAEgCxCRASARKAIIIQgCfyAKIAxqIAUgCmsiBSAEIAxrIgRqSARAIAAgCSAIIAMgDCAKIAYgBxCLAyAIIQAgCwwBCyAIIAsgAiADIAQgBSAGIAcQiwMgCiEFIAwhBCAIIQIgCQshASAFDQEMAgsLIAEgAkYNACAGIQQgASEIA0AgBCAIKAIANgIAIARBBGohBCAIQQRqIgggAkcNAAsgAygCBCELIAMoAgAhCQNAIAAgASIDRgRAA0AgAkEEayICIARBBGsiBCgCADYCACAEIAZHDQAMAwsACwJAIAkoAgAiCiAEQQRrIgcoAgAiCEEDdGoiDCALKAIAIg1BAnQiAWooAgAiDiABIAogA0EEayIBKAIAIgVBA3RqIgpqKAIAIg9IDQAgDiAPRgRAIAxBASANa0ECdCINaigCACAKIA1qKAIASA0BCyAIIQUgAyEBIAchBAsgAkEEayICIAU2AgAgBCAGRw0ACwsgEUEQaiQAC5QHAgl8DH8jAEFAaiIPQRBqQQBBMPwLACAPQQI2AgwgD0KAgICAEDcCBCACQRhsIgIgASgCACIOKAKYAWorAwAhCyAOKAJIIAJqIhQrAwAhCCABKAIEIhIoApgBIRUgEigCSCEWQQAhAUEAIQIDQAJ/IAsgFSAEIA9BBGogAmooAgBBBHRqIhEoAghBGGwiDmorAwBjIAggDiAWaiIOKwMAIgZjIAYgCGEbIAsgFSARKAIEQRhsIhBqKwMAYyAIIBAgFmoiECsDACIJYyAIIAlhG2siGUUEQEQAAAAAAAD4fyEFRAAAAAAAAPh/IQdBAAwBCyARKAIAIRggECsDECEHIBArAwghBQJAIAggCaEiCiAIIAahIgwgCpkgDJljIhAbIAYgCaGjIga9Qv///////////wCDQv/////////3/wBWDQAgDisDCCIJIAWhIgq9Qv///////////wCDQoCAgICAgID4/wBaDQAgDisDECIMIAehIg29Qv///////////wCDQoCAgICAgID4/wBaDQAgByAMIBAbIAYgDaKgIQcgBSAJIBAbIAYgCqKgIQULIBlBACASKAKoASIOIBhBA21BGGxqKwMIIA4gEigCaCAYQQJ0aigCAEEDbUEYbGorAwigRAAAAAAAAAAAZCAUKwMIIgYgBWMgBSAGYRsbCyEOAkAgBb1C////////////AINC//////////f/AFYNAEEAIA5rIA4gES0ADBsgE2ohEyABQQFKBEBBAiEBDAELIAFFIA5FIBdzRXJFBEBBASEBDAELIA9BEGogAUEYbGoiESAHOQMQIBEgBzkDCCARIAU5AwAgAUEBaiEBIA5BAEchFwsgAkEEaiICQQxHDQALAn8gE0UEQEQAAAAAAAD4fyEFQQAMAQsgE0EAIBIoAqgBIANBGGxqKwMQRAAAAAAAAAAAZCAUKwMQIgggDysDICIFIA8rAzgiByAUKwMIIgYgDysDECIJoSILmSAGIA8rAygiBqEiCpljIgEbIAcgBaEiByALIAogARsgBiAJoaMiBqKgIAUgB71C////////////AINCgICAgICAgPj/AFQbIAUgDysDMCAPKwMYob1C////////////AINCgICAgICAgPj/AFQbIAUgBr1C////////////AINCgICAgICAgPj/AFQbIgVjIAUgCGEbGwshASAAIAU5AwggACABNgIAC/wHAw9/A3wDfiMAQdABayIEJAAgBEGgAWpBAEEw/AsAIARB8ABqQQBBMPwLACABKAIAIhAoAlggAkECdGoiBUF4QQQgAkEDb0ECRhtqKAIAIQ8gBSgCACEMIAEoAgQhBSAEQQI2AhAgBEKAgICAEDcCCCAFKAJYIg0gA0EDbCIOQQJ0aiERIAUoAmghEgNAQQEhCQJAIA0gBEEIaiAGaigCACIKIA5qIgtBAnQiB2ooAgAiBSARQQRBCCAKQQFGG0EAIAobQYzpAGooAgBBAnRqKAIAIghIBEAgBSEHIAghBQwBCyAHIBJqKAIAIQtBACEJIAghBwsgBEFAayAKQQR0aiIIIAk6AAwgCCAFNgIIIAggBzYCBCAIIAs2AgAgBkEEaiIGQQxHDQALIAQgDzYCOCAEIAw2AjQgAUEIaiENQQAhBkEAIQdBACEIQQAhCQNAIARBCGogDSAEQTRqIAhqKAIAIgsgAyAEQUBrEIoDAkAgBCsDECITvUL///////////8Ag0L/////////9/8AVg0AIAQoAggiCkEAIAprIAsgDEYbIAlqIQkgBkEBSgRAQQIhBgwBCyAGRSAHIApFc0EBcUVyRQRAQQEhBgwBCyAGQRhsIg4gBEGgAWpqIgUgECgCSCALQRhsaiIHKQMQIhc3AxAgBSAHKQMIIhY3AwggBSAHKQMAIhg3AwAgBSAWNwMQIAUgFzcDCCAEQfAAaiAOaiIFIBY3AxAgBSAYNwMAIAUgEzkDCCAGQQFqIQYgCkEARyEHCyAIQQRqIghBCEcNAAsgBEECNgI8IARCgICAgBA3AjQgAUEQaiEIQQAhBQNAIARBCGogCCACIAwgDyAEQUBrIARBNGogBWooAgBBBHRqIgEoAgAgASgCBCABKAIIEPcEAkAgBCsDECITvUL///////////8Ag0L/////////9/8AVg0AQQAgBCgCCCIDayADIAEtAAwbIAlqIQkgBkEBSgRAQQIhBgwBCyAGRSAHIANFc0EBcUVyRQRAQQEhBgwBCyAGQRhsIgcgBEGgAWpqIgEgEzkDACABIAQrAyAiFDkDCCABIAQrAxgiFTkDECAEQfAAaiAHaiIBIBU5AxAgASAUOQMIIAEgEzkDACABIAQrAyg5AwggBkEBaiEGIANBAEchBwsgBUEEaiIFQQxHDQALAnwgCUUEQEQAAAAAAAD4fyEURAAAAAAAAPh/IRVEAAAAAAAA+H8MAQsgBEEIaiAEQaABaiAEQbgBaiAEQfAAaiAEQYgBahDOASAEKwMQIRUgBCsDGCEUIAQrAwgLIRMgACAVOQMYIAAgFDkDECAAIBM5AwggACAJNgIAIARB0AFqJAALgVYCEX8CfiMAQbABayIFJAAgACAENgKQASAAQQE6AIwBIABBADYChAEgAEIANwJ8IABBADYCdCAAQgA3AmwgAEEANgJkIABCADcCXCAAQQA2AlQgAEIANwJMIABBADYCRCAAQgA3AjwgAEEANgI0IABCADcCLCAAQQA2AiQgAEIANwIcIABBADYCFCAAQgA3AgwgACACNgIEIAAgATYCACAAIANFOgAIIABB/ABqIRUgAEHsAGohEwJAAkACQCABKAJcQQNJDQAgAigCXEEDSQ0AIAEgAhDUBA0BCyATIAEoAkxBABAxIBUgAigCTEEAEDEMAQsgACgCkAEiBwRAIActABANAQsgAEEMaiEGAkACQAJAAkACQAJAAkACQAJAIAAtAAhBAUYEQCAFIAI2AowBIAUgATYCiAEgBSACNgKEASAFIAE2AoABIAUgAjYCfCAFIAE2AnggBUEANgJwIAVCADcCaCAFQQA2AmAgBUIANwJYIAVBADYCUCAFQgA3AkggBSAFQfgAajYCRCABKAJcIQggBSABNgKoAQJAIAIoAowCIgNFDQAgAigC6AEhBCACKALsASEJIAIoAogCIQogBSADNgKgASAFIAo2ApwBIAUgCTYCmAEgBSAENgKUASAFIAVBxABqNgKkASAFIAVBqAFqNgKQASAHBEAgCEUNASAHLQAQQQFxDQFBACEDQQAhBANAIANBAWoiA0GACEYEQEEAIQMgBy0AEA0DCyAFQZABaiAEEIUFIARBAWoiBCAIRw0ACwwBCyAFIAM2AiAgBSAKNgIcIAUgCTYCGCAFIAQ2AhQgBSAFQcQAajYCJCAFIAVBqAFqNgIQIAhFDQBBACEEA0AgBUEQaiAEEIUFIARBAWoiBCAIRw0ACwsCQCAHRQ0AIActABBBAUcNACAFQQA2AjggBUIANwIwIAVBADYCKCAFQgA3AiAgBUEANgIYIAVCADcCEAwJC0EAIQNBACEEAkAgBSgCTCIHRQ0AIAUoAkghCSAHQQN0IggQJyEEIAhFDQAgBCAJIAj8CgAACyAFIAc2AhggBSAHNgIUIAUgBDYCEAJAIAUoAlwiBEUNACAFKAJYIQkgBEECdCIIECchAyAIRQ0AIAMgCSAI/AoAAAsgBSAENgIoIAUgBDYCJCAFIAM2AiBBACEEQQAhAwJAIAUoAmwiCEUNACAFKAJoIQogCEEYbCIJECchAyAJRQ0AIAMgCiAJ/AoAAAsgBUEgaiEKIAUgCDYCOCAFIAg2AjQgBSADNgIwIAVBADYCmAEgBUIANwKQASAFQZABaiAHECUgBSAHNgKUASAFQTBqIQsgBSgCkAEhCCAHRQ0BA0AgCCAEQQJ0aiAENgIAIARBAWoiBCAHRw0ACyAFKAKUASEDIAVBADYCQCAIIANBAnRqIQcgBSAFQUBrNgKsASAFIAVBEGo2AqgBIANBgQFIDQYgAyEEA0AgBEECdBBQIglFBEAgBEEBdiIEDQEMCAsLIAggByAFQagBaiADIAkgBBDTASAJECIMBwsgBSACNgKMASAFIAE2AogBIAUgAjYChAEgBSABNgKAASAFIAI2AnwgBSABNgJ4IAVBADYCcCAFQgA3AmggBUEANgJgIAVCADcCWCAFQQA2AlAgBUIANwJIIAUgBUH4AGo2AkQgASgCXCEIIAUgATYCqAECQCACKAKMAiIDRQ0AIAIoAugBIQQgAigC7AEhCSACKAKIAiEKIAUgAzYCoAEgBSAKNgKcASAFIAk2ApgBIAUgBDYClAEgBSAFQcQAajYCpAEgBSAFQagBajYCkAEgBwRAIAhFDQEgBy0AEEEBcQ0BQQAhA0EAIQQDQCADQQFqIgNBgAhGBEBBACEDIActABANAwsgBUGQAWogBBCEBSAEQQFqIgQgCEcNAAsMAQsgBSADNgIgIAUgCjYCHCAFIAk2AhggBSAENgIUIAUgBUHEAGo2AiQgBSAFQagBajYCECAIRQ0AQQAhBANAIAVBEGogBBCEBSAEQQFqIgQgCEcNAAsLAkAgB0UNACAHLQAQQQFHDQAgBUEANgI4IAVCADcCMCAFQQA2AiggBUIANwIgIAVBADYCGCAFQgA3AhAMBQtBACEDQQAhBAJAIAUoAkwiB0UNACAFKAJIIQkgB0EDdCIIECchBCAIRQ0AIAQgCSAI/AoAAAsgBSAHNgIYIAUgBzYCFCAFIAQ2AhACQCAFKAJcIgRFDQAgBSgCWCEJIARBAnQiCBAnIQMgCEUNACADIAkgCPwKAAALIAUgBDYCKCAFIAQ2AiQgBSADNgIgQQAhBEEAIQMCQCAFKAJsIghFDQAgBSgCaCEKIAhBGGwiCRAnIQMgCUUNACADIAogCfwKAAALIAVBIGohCiAFIAg2AjggBSAINgI0IAUgAzYCMCAFQQA2ApgBIAVCADcCkAEgBUGQAWogBxAlIAUgBzYClAEgBUEwaiELIAUoApABIQggB0UNAQNAIAggBEECdGogBDYCACAEQQFqIgQgB0cNAAsgBSgClAEhAyAFQQA2AkAgCCADQQJ0aiEHIAUgBUFAazYCrAEgBSAFQRBqNgKoASADQYEBSA0CIAMhBANAIARBAnQQUCIJRQRAIARBAXYiBA0BDAQLCyAIIAcgBUGoAWogAyAJIAQQ0gEgCRAiDAMLQQAhAyAFQQA2AkAgBSAFQUBrNgKsASAFIAVBEGo2AqgBIAghBwwEC0EAIQMgBUEANgJAIAUgBUFAazYCrAEgBSAFQRBqNgKoASAIIQcLIAggByAFQagBaiADQQBBABDSAQsgBUEQaiAFQZABaiIDEKACIAogAxCmASALIAMQpQEgBSgCkAEiA0UNACADECILIAUoAmgiAwRAIAMQIgsgBUEANgJwIAVCADcCaCAFKAJYIgMEQCADECILIAVBADYCYCAFQgA3AlggBSgCSCIDRQ0DIAMQIgwDCyAIIAcgBUGoAWogA0EAQQAQ0wELIAVBEGogBUGQAWoiAxCgAiAKIAMQpgEgCyADEKUBIAUoApABIgNFDQAgAxAiCyAFKAJoIgMEQCADECILIAVBADYCcCAFQgA3AmggBSgCWCIDBEAgAxAiCyAFQQA2AmAgBUIANwJYIAUoAkgiA0UNACADECILAkAgBiAFQRBqRwRAIAYoAgAiAwRAIAMQIgsgACAFKAIQNgIMIAAgBSgCFDYCECAAIAUoAhg2AhQgBUEANgIYIAVCADcCECAAKAIcIgMEQCADECILIAAgBSgCIDYCHCAAIAUoAiQ2AiAgACAFKAIoNgIkIAVBADYCKCAFQgA3AiAgACgCLCIDBEAgAxAiCyAAIAUoAjA2AiwgACAFKAI0NgIwIAAgBSgCODYCNAwBCyAFKAIwIgNFDQAgAxAiCyAFQQA2AjggBUIANwIwIAUoAiAiAwRAIAMQIgsgBUEANgIoIAVCADcCICAFKAIQIgMEQCADECILIAAoApABIgcEQCAHLQAQDQELIABBPGohBgJAAkACQAJAAkACQAJAAkACQCAALQAIQQFGBEAgBSACNgKMASAFIAE2AogBIAUgATYChAEgBSACNgKAASAFIAE2AnwgBSACNgJ4IAVBADYCcCAFQgA3AmggBUEANgJgIAVCADcCWCAFQQA2AlAgBUIANwJIIAUgBUH4AGo2AkQgAigCXCEIIAUgAjYCqAECQCABKAKMAiIDRQ0AIAEoAugBIQQgASgC7AEhCSABKAKIAiEKIAUgAzYCoAEgBSAKNgKcASAFIAk2ApgBIAUgBDYClAEgBSAFQcQAajYCpAEgBSAFQagBajYCkAEgBwRAIAhFDQEgBy0AEEEBcQ0BQQAhA0EAIQQDQCADQQFqIgNBgAhGBEBBACEDIActABANAwsgBUGQAWogBBCDBSAEQQFqIgQgCEcNAAsMAQsgBSADNgIgIAUgCjYCHCAFIAk2AhggBSAENgIUIAUgBUHEAGo2AiQgBSAFQagBajYCECAIRQ0AQQAhBANAIAVBEGogBBCDBSAEQQFqIgQgCEcNAAsLAkAgB0UNACAHLQAQQQFHDQAgBUEANgI4IAVCADcCMCAFQQA2AiggBUIANwIgIAVBADYCGCAFQgA3AhAMCQtBACEDQQAhBAJAIAUoAkwiB0UNACAFKAJIIQkgB0EDdCIIECchBCAIRQ0AIAQgCSAI/AoAAAsgBSAHNgIYIAUgBzYCFCAFIAQ2AhACQCAFKAJcIgRFDQAgBSgCWCEJIARBAnQiCBAnIQMgCEUNACADIAkgCPwKAAALIAUgBDYCKCAFIAQ2AiQgBSADNgIgQQAhBEEAIQMCQCAFKAJsIghFDQAgBSgCaCEKIAhBGGwiCRAnIQMgCUUNACADIAogCfwKAAALIAVBIGohCiAFIAg2AjggBSAINgI0IAUgAzYCMCAFQQA2ApgBIAVCADcCkAEgBUGQAWogBxAlIAUgBzYClAEgBUEwaiELIAUoApABIQggB0UNAQNAIAggBEECdGogBDYCACAEQQFqIgQgB0cNAAsgBSgClAEhAyAFQQE2AkAgCCADQQJ0aiEHIAUgBUFAazYCrAEgBSAFQRBqNgKoASADQYEBSA0GIAMhBANAIARBAnQQUCIJRQRAIARBAXYiBA0BDAgLCyAIIAcgBUGoAWogAyAJIAQQ0QEgCRAiDAcLIAUgAjYCjAEgBSABNgKIASAFIAE2AoQBIAUgAjYCgAEgBSABNgJ8IAUgAjYCeCAFQQA2AnAgBUIANwJoIAVBADYCYCAFQgA3AlggBUEANgJQIAVCADcCSCAFIAVB+ABqNgJEIAIoAlwhCCAFIAI2AqgBAkAgASgCjAIiA0UNACABKALoASEEIAEoAuwBIQkgASgCiAIhCiAFIAM2AqABIAUgCjYCnAEgBSAJNgKYASAFIAQ2ApQBIAUgBUHEAGo2AqQBIAUgBUGoAWo2ApABIAcEQCAIRQ0BIActABBBAXENAUEAIQNBACEEA0AgA0EBaiIDQYAIRgRAQQAhAyAHLQAQDQMLIAVBkAFqIAQQggUgBEEBaiIEIAhHDQALDAELIAUgAzYCICAFIAo2AhwgBSAJNgIYIAUgBDYCFCAFIAVBxABqNgIkIAUgBUGoAWo2AhAgCEUNAEEAIQQDQCAFQRBqIAQQggUgBEEBaiIEIAhHDQALCwJAIAdFDQAgBy0AEEEBRw0AIAVBADYCOCAFQgA3AjAgBUEANgIoIAVCADcCICAFQQA2AhggBUIANwIQDAULQQAhA0EAIQQCQCAFKAJMIgdFDQAgBSgCSCEJIAdBA3QiCBAnIQQgCEUNACAEIAkgCPwKAAALIAUgBzYCGCAFIAc2AhQgBSAENgIQAkAgBSgCXCIERQ0AIAUoAlghCSAEQQJ0IggQJyEDIAhFDQAgAyAJIAj8CgAACyAFIAQ2AiggBSAENgIkIAUgAzYCIEEAIQRBACEDAkAgBSgCbCIIRQ0AIAUoAmghCiAIQRhsIgkQJyEDIAlFDQAgAyAKIAn8CgAACyAFQSBqIQogBSAINgI4IAUgCDYCNCAFIAM2AjAgBUEANgKYASAFQgA3ApABIAVBkAFqIAcQJSAFIAc2ApQBIAVBMGohCyAFKAKQASEIIAdFDQEDQCAIIARBAnRqIAQ2AgAgBEEBaiIEIAdHDQALIAUoApQBIQMgBUEBNgJAIAggA0ECdGohByAFIAVBQGs2AqwBIAUgBUEQajYCqAEgA0GBAUgNAiADIQQDQCAEQQJ0EFAiCUUEQCAEQQF2IgQNAQwECwsgCCAHIAVBqAFqIAMgCSAEENABIAkQIgwDCyAFQQE2AkAgBSAFQUBrNgKsASAFIAVBEGo2AqgBQQAhAyAIIQcMBAsgBUEBNgJAIAUgBUFAazYCrAEgBSAFQRBqNgKoAUEAIQMgCCEHCyAIIAcgBUGoAWogA0EAQQAQ0AELIAVBEGogBUGQAWoiAxCgAiAKIAMQpgEgCyADEKUBIAUoApABIgNFDQAgAxAiCyAFKAJoIgMEQCADECILIAVBADYCcCAFQgA3AmggBSgCWCIDBEAgAxAiCyAFQQA2AmAgBUIANwJYIAUoAkgiA0UNAyADECIMAwsgCCAHIAVBqAFqIANBAEEAENEBCyAFQRBqIAVBkAFqIgMQoAIgCiADEKYBIAsgAxClASAFKAKQASIDRQ0AIAMQIgsgBSgCaCIDBEAgAxAiCyAFQQA2AnAgBUIANwJoIAUoAlgiAwRAIAMQIgsgBUEANgJgIAVCADcCWCAFKAJIIgNFDQAgAxAiCwJAIAYgBUEQakcEQCAGKAIAIgMEQCADECILIAAgBSgCEDYCPCAAIAUoAhQ2AkAgACAFKAIYNgJEIAVBADYCGCAFQgA3AhAgACgCTCIDBEAgAxAiCyAAIAUoAiA2AkwgACAFKAIkNgJQIAAgBSgCKDYCVCAFQQA2AiggBUIANwIgIAAoAlwiAwRAIAMQIgsgACAFKAIwNgJcIAAgBSgCNDYCYCAAIAUoAjg2AmQMAQsgBSgCMCIDRQ0AIAMQIgsgBUEANgI4IAVCADcCMCAFKAIgIgMEQCADECILIAVBADYCKCAFQgA3AiAgBSgCECIDBEAgAxAiCwJAIAAoAiBBAE4EQCAAKAJQQQBODQELIABBADoAjAEMAQsgACgCkAEiCgRAIAotABANAQsgBSAAKAIMNgIIIAUgACgCEDYCDCAFQcQAaiELIAAtAAghA0EAIQkjAEGQAWsiBiQAIAUoAgwhByAFKAIIIQgCQAJAAkACQCADBEAgBkHMAGogASgCTCIDEJYBIQwgAwRAIAOtIRcDQCAMKAIAIBanQQN0aiAWNwMAIBZCAXwiFiAXUg0ACwsgASgCXCEOAkACQAJAIAoEQCAKLQAQIA5Fcg0CIAggB0EDdGohEgNAIA1BAWoiDUGACEYEQEEAIQ0gCi0AEA0ECwJAIAEoAlggCUECdGoiAygCACIPIANBeEEEIAlBA3BBAkYbaigCACIQTg0AIAghAyAHIgQEQANAIAMgBEEBdiIRQQN0aiIUQQhqIAMgFCgCACAJSCIUGyEDIAQgEUF/c2ogESAUGyIEDQALCyADIBJHBEAgAygCACAJRg0BCyAMIA8gEBBfCyAJQQFqIgkgDkcNAAsMAQsgDkUNAiAIIAdBA3RqIREDQAJAIAEoAlggCUECdGoiAygCACISIANBeEEEIAlBA3BBAkYbaigCACIPTg0AIAghAyAHIgQEQANAIAMgBEEBdiINQQN0aiIQQQhqIAMgECgCACAJSCIQGyEDIAQgDUF/c2ogDSAQGyIEDQALCyADIBFHBEAgAygCACAJRg0BCyAMIBIgDxBfCyAJQQFqIgkgDkcNAAsLIApFDQELIAotABBBAUcNACALQQA2AgggC0IANwIADAQLIAZCADcDQCAGQgA3AzggBkGAgID8AzYCSCABKAJMBEBBACEDA0AgBiAMIAMQTzYCYCAGQfgAaiAGQThqIAZB4ABqIgQgBBDPASADQQFqIgMgASgCTEkNAAsLAkAgCkUNACAKLQAQRQ0AIAtBADYCCCALQgA3AgAMAwsgBkEANgIwIAZCADcCKCAGQShqIAYoAkQQJSAGKAJAIgRFDQEgBigCLCEDA0AgBCgCCCEHAkAgBigCMCIIIANNBEAgBkEoaiAIQQF0QYABIAgbECUgBigCKCAGKAIsIgNBAnRqIAc2AgAMAQsgBigCKCADQQJ0aiAHNgIACyAGIANBAWoiAzYCLCAEKAIAIgQNAAsMAQsgBkHMAGogASgCTCIDEJYBIQwgAwRAIAOtIRcDQCAMKAIAIBanQQN0aiAWNwMAIBZCAXwiFiAXUg0ACwsgASgCXCEOAkACQAJAAkAgCgRAIAotABAgDkVyDQIgCCAHQQN0aiESA0AgDUEBaiINQYAIRgRAQQAhDSAKLQAQDQQLAkAgASgCWCAJQQJ0aiIDKAIAIg8gA0F4QQQgCUEDcEECRhtqKAIAIhBODQAgCCEDIAciBARAA0AgAyAEQQF2IhFBA3RqIhRBCGogAyAUKAIAIAlIIhQbIQMgBCARQX9zaiARIBQbIgQNAAsLIAMgEkcEQCADKAIAIAlGDQELIAwgDyAQEF8LIAlBAWoiCSAORw0ACwwBCyAORQ0CIAggB0EDdGohEQNAAkAgASgCWCAJQQJ0aiIDKAIAIhIgA0F4QQQgCUEDcEECRhtqKAIAIg9ODQAgCCEDIAciBARAA0AgAyAEQQF2Ig1BA3RqIhBBCGogAyAQKAIAIAlIIhAbIQMgBCANQX9zaiANIBAbIgQNAAsLIAMgEUcEQCADKAIAIAlGDQELIAwgEiAPEF8LIAlBAWoiCSAORw0ACwsgCkUNAQsgCi0AEEEBRw0AIAtBADYCCCALQgA3AgAMAQsgBkIANwNAIAZCADcDOCAGQYCAgPwDNgJIIAEoAkwEQEEAIQMDQCAGIAwgAxBPNgJgIAZB+ABqIAZBOGogBkHgAGoiBCAEEM8BIANBAWoiAyABKAJMSQ0ACwsCQAJAIApFDQAgCi0AEEUNACALQQA2AgggC0IANwIADAELIAZBADYCMCAGQgA3AiggBkEoaiAGKAJEECUgBigCQCIEBEAgBigCLCEDA0AgBCgCCCEHAkAgBigCMCIIIANNBEAgBkEoaiAIQQF0QYABIAgbECUgBigCKCAGKAIsIgNBAnRqIAc2AgAMAQsgBigCKCADQQJ0aiAHNgIACyAGIANBAWoiAzYCLCAEKAIAIgQNAAsLIAEoAkwhAyAGQQA2AiAgBkIANwIYIAZBGGoiBCADQQAQMSAGIAE2AhAgBiACNgIUIAYgBDYCDCAGIAZBKGoiAzYCCCAGIAZBEGo2AgQgBiAGQQRqNgIAIAYoAiwhByAGIAE2AlggBiADNgJcAkAgAigCjAIiA0UNACACKALoASEEIAIoAuwBIQggAigCiAIhCSAGIAM2AnAgBiAJNgJsIAYgCDYCaCAGIAQ2AmQgBiAGNgJ0IAYgBkHYAGo2AmAgCgRAIAdFDQEgCi0AEEEBcQ0BQQAhBEEAIQMDQCAEQQFqIgRBgAhGBEBBACEEIAotABANAwsgBkHgAGogAxCABSADQQFqIgMgB0cNAAsMAQsgBiADNgKIASAGIAk2AoQBIAYgCDYCgAEgBiAENgJ8IAYgBjYCjAEgBiAGQdgAajYCeCAHRQ0AQQAhAwNAIAZB+ABqIAMQgAUgA0EBaiIDIAdHDQALCwJAAkACQAJAAkAgCgRAIAotABANBCAKLQAQDQIgBigCHCIHRQ0CQQAhBEEAIQMDQCAEQQFqIgRBgAhGBEBBACEEIAotABANBAsgAyAMIAMQTyIIRwRAIAYoAhgiCSADQQJ0aiAJIAhBAnRqKAIANgIACyADQQFqIgMgB0cNAAsMAQsgBigCHCIERQ0CQQAhAwNAIAMgDCADEE8iB0cEQCAGKAIYIgggA0ECdGogCCAHQQJ0aigCADYCAAsgA0EBaiIDIARHDQALCyAKRQ0BCyAKLQAQDQELIAsgBigCGDYCACALIAYoAhw2AgQgCyAGKAIgNgIIDAELIAtBADYCCCALQgA3AgAgBigCGCIDRQ0AIAMQIgsgBigCKCIDRQ0AIAMQIgsgBkE4ahCVAQsgDCgCACIDRQ0DIAwgAzYCBCAMKAIIGiADECIMAwsgASgCTCEDIAZBADYCICAGQgA3AhggBkEYaiIEIANBABAxIAYgATYCECAGIAI2AhQgBiAENgIMIAYgBkEoaiIDNgIIIAYgBkEQajYCBCAGIAZBBGo2AgAgBigCLCEHIAYgATYCWCAGIAM2AlwCQCACKAKMAiIDRQ0AIAIoAugBIQQgAigC7AEhCCACKAKIAiEJIAYgAzYCcCAGIAk2AmwgBiAINgJoIAYgBDYCZCAGIAY2AnQgBiAGQdgAajYCYCAKBEAgB0UNASAKLQAQQQFxDQFBACEEQQAhAwNAIARBAWoiBEGACEYEQEEAIQQgCi0AEA0DCyAGQeAAaiADEP8EIANBAWoiAyAHRw0ACwwBCyAGIAM2AogBIAYgCTYChAEgBiAINgKAASAGIAQ2AnwgBiAGNgKMASAGIAZB2ABqNgJ4IAdFDQBBACEDA0AgBkH4AGogAxD/BCADQQFqIgMgB0cNAAsLAkACQAJAAkACQCAKBEAgCi0AEA0EIAotABANAiAGKAIcIgdFDQJBACEEQQAhAwNAIARBAWoiBEGACEYEQEEAIQQgCi0AEA0ECyADIAwgAxBPIghHBEAgBigCGCIJIANBAnRqIAkgCEECdGooAgA2AgALIANBAWoiAyAHRw0ACwwBCyAGKAIcIgRFDQJBACEDA0AgAyAMIAMQTyIHRwRAIAYoAhgiCCADQQJ0aiAIIAdBAnRqKAIANgIACyADQQFqIgMgBEcNAAsLIApFDQELIAotABANAQsgCyAGKAIYNgIAIAsgBigCHDYCBCALIAYoAiA2AggMAQsgC0EANgIIIAtCADcCACAGKAIYIgNFDQAgAxAiCyAGKAIoIgNFDQAgAxAiCyAGQThqEJUBCyAMKAIAIgNFDQAgDCADNgIEIAwoAggaIAMQIgsgBkGQAWokACATIAsQgQUgBSgCRCIDBEAgAxAiCyAAKAKQASIKBEAgCi0AEA0BCyAFIAAoAjw2AgAgBSAAKAJANgIEIAVBxABqIQsgASEIIAIhByAALQAIIQFBACEJQQAhDUIAIRYjAEGQAWsiBiQAIAUoAgQhAyAFKAIAIQQCQAJAAkACQCABBEAgBkHMAGogBygCTCIBEJYBIQwgAQRAIAGtIRcDQCAMKAIAIBanQQN0aiAWNwMAIBZCAXwiFiAXUg0ACwsgBygCXCEOAkACQAJAIAoEQCAKLQAQIA5Fcg0CIAQgA0EDdGohEQNAIA1BAWoiDUGACEYEQEEAIQ0gCi0AEA0ECwJAIAcoAlggCUECdGoiASgCACISIAFBeEEEIAlBA3BBAkYbaigCACIPTg0AIAQhASADIgIEQANAIAEgAkEBdiITQQN0aiIQQQhqIAEgECgCBCAJSCIQGyEBIAIgE0F/c2ogEyAQGyICDQALCyABIBFHBEAgASgCBCAJRg0BCyAMIBIgDxBfCyAJQQFqIgkgDkcNAAsMAQsgDkUNAiAEIANBA3RqIRMDQAJAIAcoAlggCUECdGoiASgCACIRIAFBeEEEIAlBA3BBAkYbaigCACISTg0AIAQhASADIgIEQANAIAEgAkEBdiINQQN0aiIPQQhqIAEgDygCBCAJSCIPGyEBIAIgDUF/c2ogDSAPGyICDQALCyABIBNHBEAgASgCBCAJRg0BCyAMIBEgEhBfCyAJQQFqIgkgDkcNAAsLIApFDQELIAotABBBAUcNACALQQA2AgggC0IANwIADAQLIAZCADcDQCAGQgA3AzggBkGAgID8AzYCSCAHKAJMBEBBACEBA0AgBiAMIAEQTzYCYCAGQfgAaiAGQThqIAZB4ABqIgIgAhDPASABQQFqIgEgBygCTEkNAAsLAkAgCkUNACAKLQAQRQ0AIAtBADYCCCALQgA3AgAMAwsgBkEANgIwIAZCADcCKCAGQShqIAYoAkQQJSAGKAJAIgJFDQEgBigCLCEBA0AgAigCCCEDAkAgBigCMCIEIAFNBEAgBkEoaiAEQQF0QYABIAQbECUgBigCKCAGKAIsIgFBAnRqIAM2AgAMAQsgBigCKCABQQJ0aiADNgIACyAGIAFBAWoiATYCLCACKAIAIgINAAsMAQsgBkHMAGogBygCTCIBEJYBIQwgAQRAIAGtIRcDQCAMKAIAIBanQQN0aiAWNwMAIBZCAXwiFiAXUg0ACwsgBygCXCEOAkACQAJAAkAgCgRAIAotABAgDkVyDQIgBCADQQN0aiERA0AgDUEBaiINQYAIRgRAQQAhDSAKLQAQDQQLAkAgBygCWCAJQQJ0aiIBKAIAIhIgAUF4QQQgCUEDcEECRhtqKAIAIg9ODQAgBCEBIAMiAgRAA0AgASACQQF2IhNBA3RqIhBBCGogASAQKAIEIAlIIhAbIQEgAiATQX9zaiATIBAbIgINAAsLIAEgEUcEQCABKAIEIAlGDQELIAwgEiAPEF8LIAlBAWoiCSAORw0ACwwBCyAORQ0CIAQgA0EDdGohEwNAAkAgBygCWCAJQQJ0aiIBKAIAIhEgAUF4QQQgCUEDcEECRhtqKAIAIhJODQAgBCEBIAMiAgRAA0AgASACQQF2Ig1BA3RqIg9BCGogASAPKAIEIAlIIg8bIQEgAiANQX9zaiANIA8bIgINAAsLIAEgE0cEQCABKAIEIAlGDQELIAwgESASEF8LIAlBAWoiCSAORw0ACwsgCkUNAQsgCi0AEEEBRw0AIAtBADYCCCALQgA3AgAMAQsgBkIANwNAIAZCADcDOCAGQYCAgPwDNgJIIAcoAkwEQEEAIQEDQCAGIAwgARBPNgJgIAZB+ABqIAZBOGogBkHgAGoiAiACEM8BIAFBAWoiASAHKAJMSQ0ACwsCQAJAIApFDQAgCi0AEEUNACALQQA2AgggC0IANwIADAELIAZBADYCMCAGQgA3AiggBkEoaiAGKAJEECUgBigCQCICBEAgBigCLCEBA0AgAigCCCEDAkAgBigCMCIEIAFNBEAgBkEoaiAEQQF0QYABIAQbECUgBigCKCAGKAIsIgFBAnRqIAM2AgAMAQsgBigCKCABQQJ0aiADNgIACyAGIAFBAWoiATYCLCACKAIAIgINAAsLIAcoAkwhASAGQQA2AiAgBkIANwIYIAZBGGoiAiABQQAQMSAGIAc2AhAgBiAINgIUIAYgAjYCDCAGIAZBKGoiATYCCCAGIAZBEGo2AgQgBiAGQQRqNgIAIAYoAiwhAyAGIAc2AlggBiABNgJcAkAgCCgCjAIiAUUNACAIKALoASECIAgoAuwBIQQgCCgCiAIhByAGIAE2AnAgBiAHNgJsIAYgBDYCaCAGIAI2AmQgBiAGNgJ0IAYgBkHYAGo2AmAgCgRAIANFDQEgCi0AEEEBcQ0BQQAhAkEAIQEDQCACQQFqIgJBgAhGBEBBACECIAotABANAwsgBkHgAGogARD+BCABQQFqIgEgA0cNAAsMAQsgBiABNgKIASAGIAc2AoQBIAYgBDYCgAEgBiACNgJ8IAYgBjYCjAEgBiAGQdgAajYCeCADRQ0AQQAhAQNAIAZB+ABqIAEQ/gQgAUEBaiIBIANHDQALCwJAAkACQAJAAkAgCgRAIAotABANBCAKLQAQDQIgBigCHCIDRQ0CQQAhAkEAIQEDQCACQQFqIgJBgAhGBEBBACECIAotABANBAsgASAMIAEQTyIERwRAIAYoAhgiByABQQJ0aiAHIARBAnRqKAIANgIACyABQQFqIgEgA0cNAAsMAQsgBigCHCICRQ0CQQAhAQNAIAEgDCABEE8iA0cEQCAGKAIYIgQgAUECdGogBCADQQJ0aigCADYCAAsgAUEBaiIBIAJHDQALCyAKRQ0BCyAKLQAQDQELIAsgBigCGDYCACALIAYoAhw2AgQgCyAGKAIgNgIIDAELIAtBADYCCCALQgA3AgAgBigCGCIBRQ0AIAEQIgsgBigCKCIBRQ0AIAEQIgsgBkE4ahCVAQsgDCgCACIBRQ0DIAwgATYCBCAMKAIIGiABECIMAwsgBygCTCEBIAZBADYCICAGQgA3AhggBkEYaiICIAFBABAxIAYgBzYCECAGIAg2AhQgBiACNgIMIAYgBkEoaiIBNgIIIAYgBkEQajYCBCAGIAZBBGo2AgAgBigCLCEDIAYgBzYCWCAGIAE2AlwCQCAIKAKMAiIBRQ0AIAgoAugBIQIgCCgC7AEhBCAIKAKIAiEHIAYgATYCcCAGIAc2AmwgBiAENgJoIAYgAjYCZCAGIAY2AnQgBiAGQdgAajYCYCAKBEAgA0UNASAKLQAQQQFxDQFBACECQQAhAQNAIAJBAWoiAkGACEYEQEEAIQIgCi0AEA0DCyAGQeAAaiABEP0EIAFBAWoiASADRw0ACwwBCyAGIAE2AogBIAYgBzYChAEgBiAENgKAASAGIAI2AnwgBiAGNgKMASAGIAZB2ABqNgJ4IANFDQBBACEBA0AgBkH4AGogARD9BCABQQFqIgEgA0cNAAsLAkACQAJAAkACQCAKBEAgCi0AEA0EIAotABANAiAGKAIcIgNFDQJBACECQQAhAQNAIAJBAWoiAkGACEYEQEEAIQIgCi0AEA0ECyABIAwgARBPIgRHBEAgBigCGCIHIAFBAnRqIAcgBEECdGooAgA2AgALIAFBAWoiASADRw0ACwwBCyAGKAIcIgJFDQJBACEBA0AgASAMIAEQTyIDRwRAIAYoAhgiBCABQQJ0aiAEIANBAnRqKAIANgIACyABQQFqIgEgAkcNAAsLIApFDQELIAotABANAQsgCyAGKAIYNgIAIAsgBigCHDYCBCALIAYoAiA2AggMAQsgC0EANgIIIAtCADcCACAGKAIYIgFFDQAgARAiCyAGKAIoIgFFDQAgARAiCyAGQThqEJUBCyAMKAIAIgFFDQAgDCABNgIEIAwoAggaIAEQIgsgBkGQAWokACAVIAsQgQUgBSgCRCIBRQ0AIAEQIgsgBUGwAWokACAACzQBAX8gAUGAgICAAU8EQBAmAAsgACABQQR0IgIQIyIBNgIEIAAgATYCACAAIAEgAmo2AggLNAEBfyABQYCAgIACTwRAECYACyAAIAFBA3QiAhAjIgE2AgQgACABNgIAIAAgASACajYCCAtIAQF/IABBADYCCCAAQgA3AgAgAQRAIAAgARDyASAAKAIEIgIgAUEYbGohAQNAIAIQ6wFBGGoiAiABRw0ACyAAIAE2AgQLIAALRAEBfyAAQQA2AgggAEIANwIAIAEEQCAAIAEQjwMgACgCBCECIAFBBHQiAQRAIAJBACAB/AsACyAAIAEgAmo2AgQLIAAL5SEDFH8BfAx9IwBBgAFrIgQkACAAQgA3A0AgAEKAgICAgICA+L9/NwM4IABCgICAgICAgPi/fzcDMCAAQoCAgICAgIB4NwMoIABCgICAgICAgHg3AyAgAEKAgICAgICAeDcDGCAAQoCAgICAgID4/wA3AxAgAEKAgICAgICA+P8ANwMIIABCgICAgICAgPj/ADcDACAAQgA3A0ggAEEANgJQIABB2ABqEKECGiAAQgA3A9ABIABBfzYCyAEgAEEANgLAASAAQgA3A7gBIABBADYCsAEgAEIANwOoASAAQQA2AqABIABCADcDmAEgAEEANgKQASAAQgA3A4gBIABBADYCkAIgAEIANwOIAiAAQQA2AoACIABCADcD+AEgAEEANgLwASAAQgA3A+gBIABBADYC4AEgAEIANwPYASAAIABB0AFqNgLMAQJAAkAgAkUNACACLQAQQQFHDQAgAEEOECwMAQsgASgCFCABKAIQa0ECdSIRQQNuIg8gASgCCCIHIAEoAgQiBWtBAnUgASgCACIDbiINckUEQCAAQQAQLAwBCyARQQtLIA1BBE9xRQRAIABBAhAsDAELIANBAk0EQCAAQQUQLAwBCyABKAIgIgwgASgCHCIKayABKAIsIAEoAihrRwRAIABBBhAsDAELAkAgASgCTCIDIAEoAlAiBkYEQCABKAJEIQggASgCQCEJDAELIAEoAkQiCCABKAJAIglrQQJ2QQxsIAYgA2tBAnVGDQAgAEEIECwMAQsCQCAIIAlGDQAgASgCNCILIAEoAjgiDkYNACAOIAtrQQJ1IgsgCCAJa0ECdSIIQQFqRiAIIAtGcg0AIABBCRAsDAELIAEoAmQiCCABKAJoIglGIAkgCGtBAnUgD0ZyRQRAIABBChAsDAELAkAgBSAHRg0AA0AgBSgCAEH/////B3FBgICA/AdJBEAgByAFQQRqIgVHDQEMAgsLIABBARAsDAELAkAgAyAGRg0AA0AgAygCAEH/////B3FBgICA/AdJBEAgBiADQQRqIgNHDQEMAgsLIABBCxAsDAELAkAgASgCcCIFIAEoAnQiA0YNAANAIAUoAgBB/////wdxQYCAgPwHSQRAIAMgBUEEaiIFRw0BDAILCyAAQQsQLAwBC0EAIQUgBEEANgJ8IARCADcCdAJAAkAgCiAMRg0AIARB9ABqIA0QfSAEKAJ0IgYgBCgCeCIHRwRAIAYhAwNAIAMgBTYCACAFQQFqIQUgA0EEaiIDIAdHDQALCyABKAIgIgcgASgCHCIDRg0AIAcgA2tBAnUhByABKAIoIQhBACEFA0ACQCANIAMgBUECdCIJaigCACIMSwRAIAggCWooAgAiCSANSQ0BCyAAQQcQLAwDCyAGIAxBAnRqIAk2AgAgBUEBaiIFIAdHDQALCyAAIAEoAgAiB0EDayIKNgJAIABBiAFqIgMoAgQhBiADIAEoAgggASgCBGtBAnUgB24gCmwiBxBEIAMgBzYCBCAGQRFJIAYgB0EBdE1yRQRAIAMQlAELIAAgASoCfLs5AzggAEHIAGogASgCCCABKAIEa0ECdSABKAIAbhCIBSABKAIIIAEoAgQiCWtBAnUiAyABKAIAIgZuIQwgAyAGTwRAIAAoAogBIQsgACgCSCEOQQAhAwNAIARCgICAgBA3AmQgDiADQRhsaiEQIARBAjYCbCAJIAMgBmxBAnRqIQdBACEFA0AgEEEIQRAgBEHkAGogBWooAgAiCEEBRhtBACAIG2ogByAIQQJ0aioCALs5AwAgBUEEaiIFQQxHDQALIAoEQCAHQQxqIQcgCyADIApsQQN0aiEIQQAhBQNAIAggBUEDdGogByAFQQJ0aioCALs5AwAgBUEBaiIFIApHDQALCyADQQFqIgMgDEkNAAsLIABBuAFqIgMoAgQhBiADIAEoAnQgASgCcGtBAnVBAnYiBxBVIAMgBzYCBCAGQRFJIAYgB0EBdE1yRQRAIAMQkwELIAAoArwBIgwEQCAAKAK4ASELIAEoAnAhDkEAIQgDQCAEQoKAgIAwNwJsIARCgICAgBA3AmQgDiAIQQR0aiEQIAsgCEEFdGoiBkEIaiEHQQAhBQNAIBAgBEHkAGogBWooAgAiCUECdGoqAgC7IRcgBiEDAkACQAJAIAkOAgIAAQsgByEDDAELIAZBEEEYIAlBAkYbaiEDCyADIBc5AwAgBUEEaiIFQRBHDQALIAhBAWoiCCAMRw0ACwsgBEEANgJsIARCADcCZCAEQeQAaiIDKAIEIQYgAyABKAIUIAEoAhBrQQJ1QQNuIgcQOSADIAc2AgQgBkERSSAGIAdBAXRNckUEQCADEIMBCyABQUBrIQsgBEHYAGogAUE0ahBgIQcgASgCFCABKAIQa0ECdSEDAkAgBygCACIGIAcoAgQiBUYEQCAEIAM2AjwgBEEANgI4IARBOGohBiAEQUBrIQgCQCAHKAIIIAcoAgAiCWtBAnVBAk8EQCAHKAIEIgMgCWsiDEECdUECSQRAIAYgDGohBSADIAlHBEAgDARAIAkgBiAM/AoAAAsgBygCBCEDCyADIQYgBSAIRwRAA0AgBiAFKAIANgIAIAZBBGohBiAFQQRqIgUgCEcNAAsLIAcgAyAGIANrajYCBAwCCyAIIAZrIgNFIAYgCEZyRQRAIAkgBiAD/AoAAAsgByADIAlqNgIEDAELIAcQRSAHQf////8DQQIgBygCCCAHKAIAayIDQQF1IgUgBUECTRsgA0H8////B08bEPEBIAcoAgQhBSAGIAhHBEADQCAFIAYoAgA2AgAgBUEEaiEFIAZBBGoiBiAIRw0ACwsgByAFNgIECwwBCyAFIAZrIgYgASgCRCABKAJAa0YEQCAEIAM2AjggByAEQThqED0MAQsgBkEERw0AIAQgAzYCOCAHIARBOGoQPQsgBEEBIAEoAkQgASgCQGtBAnUiAyADQQFNGxDBBDYCVAJAIARByABqIAsQYCIMKAIAIgUgDCgCBEYEQCAMIARB1ABqED0gDCgCACIFIAwoAgRGDQELIABBzAFqIRBBACEDA0AgBCAEKAJUIANqNgIcIAUgA0ECdCIGakEAIQhBACEJIAEoAlwgASgCWCILayADSwRAIAMgC2otAAAiCUEBcSEIIAlBAnFBAXYhCQsoAgAhCyAHKAIAIg4gBmooAgBBA24iBSAOIANBAWoiBkECdGoiEygCAEEDbkkEQCAEKAJkIRQgASgCZCIVIAEoAmhGIRYDQCAEKAIcIRIgFCAFQQR0aiIOIAs2AgQgDiASNgIAIBYEf0F/BSAVIAVBAnRqKAIACyESIA4gBTYCDCAOIBI2AgggBUEBaiIFIBMoAgBBA25JDQALCyAKQQJLIAlxIQUCQCABKAJMIgkgASgCUEYEQCAEIARBHGoiAzYCKCAEQThqIBAgAyAEQShqEHkgBCgCOCIDQgA3AyggA0KAgICAgICA+D83AyAgAyALNgIYIANCADcDMCADQgA3AzggA0IANwNIIANCgICAgICAgPg/NwNAIANCADcDUCADQgA3A1ggA0IANwNoIANCgICAgICAgPg/NwNgIANCADcDcCADQgA3A3ggA0EAOgCAASADIAU6AIEBDAELIAkgA0EwbGoiAyoCACEYIAMqAgQhGSADKgIIIRogAyoCDCEbIAMqAhAhHCADKgIUIR0gAyoCGCEeIAMqAhwhHyADKgIgISAgAyoCJCEhIAMqAighIiADKgIsISMgBCAEQRxqIgM2AiggBEE4aiAQIAMgBEEoahB5IAQoAjgiAyAFOgCBASADIAg6AIABIAMgI7s5A3ggAyAiuzkDcCADICG7OQNoIAMgILs5A2AgAyAfuzkDWCADIB67OQNQIAMgHbs5A0ggAyAcuzkDQCADIBu7OQM4IAMgGrs5AzAgAyAZuzkDKCADIBi7OQMgIAMgCzYCGAsgBiIDIAwoAgQgDCgCACIFa0ECdUkNAAsLQQAhCSAEQQA2AkAgBEIANwI4IARBOGogDxA1IARBADYCMCAEQgA3AigCQCAKRQ0AIAQoAnQgBCgCeEYNACAEQShqIA8QNUEBIQkLIABB2AFqIQYgBCgCaARAIAYgDxA5CwJAAkACQCARQQNPBEBBACEIA0AgBEEANgIkIARCADcCHCAEQQA2AhggBEIANwIQIARBAjYCDCAEQoCAgIAQNwIEIAEoAhAgCEEMbGohCyAEKAJ0Ig4gBCgCeEYhEUEAIQMDQCALIARBBGogA2ooAgAiCkECdGooAgAiBSANTw0DQQRBCCAKQQFGG0EAIAobIgogBEEcamogBTYCACAEQRBqIApqIBEEfyAFBSAOIAVBAnRqKAIACzYCACADQQRqIgNBDEcNAAsCQCAEKAIQIgMgBCgCFCIFRg0AIAUgBCgCGCIKRiADIApGcg0AIARBOGohAyAJBH8gAyAEQRxqEI0FIARBKGoFIAMLIARBEGoQjQUgBCgCaEUNACAEKAJkIAhBBHRqIQUjAEEQayIDJAACQCAGKAIEIgogBigCCCILTwRAIAMgBSkCCDcDCCADIAUpAgA3AwAgBiALQQF0QYABIAsbEDkgBiAGKAIEIgVBAWo2AgQgBigCACAFQQR0aiIFIAMpAwg3AgggBSADKQMANwIADAELIAYgCkEBajYCBCAGKAIAIApBBHRqIgogBSkCCDcCCCAKIAUpAgA3AgALIANBEGokAAsgCEEBaiIIIA9HDQALCyAAIARBOGogBEEoahCeAQJ/QQEgACgCXCIFRQ0AGkEAIAVBA3ANABogACgCaCEJIAAoAlghAUEAIQgDQAJAIAEgCEECdCIDaiIGQX5BASAIQQNvQQJGGyINQQJ0aigCACIKIAYoAgAiD3EgAyAJaigCACIDcUF/RwRAQQAhBiABIAggDWoiDUECdCILaigCAEF/RiADQX9Gcg0BIAFBeEEEIA1BA29BAkYbaiALaigCAEF/RiAKIA9Gcg0BIAkgA0ECdCINaigCACAIRw0BIA8gASANaiINQXhBBCADQQNvQQJGG2ooAgBHDQEgCiANKAIARw0BC0EBIQYgCEEBaiIIIAVHDQELCyAGC0UEQCAAQQIQLAwDCwJAAkAgAgRAIAItABBBAUcNASAAQQ4QLAwFCyAAEFggAEEBEI0BIAAQ7QEgABC9BCAAEFogABD2AiAAEJMCIABBABBUDAELIAIgAigCDEEBajYCDCAAEFggAEEBEI0BIAAQ7QEgAi0AEA0CIAIgAigCDEEBajYCDCAAEL0EIAItABBBAUYEQCAAQQ4QLAwECyACIAIoAgxBAWo2AgwgABBaIAItABBBAUYEQCAAQQ4QLAwECyACIAIoAgxBAWo2AgwgABD2AiACLQAQQQFGBEAgAEEOECwMBAsgAiACKAIMQQFqNgIMIAAQkwIgAi0AEEEBRgRAIABBDhAsDAQLIAIgAigCDEEBajYCDCAAIAIQVCACLQAQQQFGBEAgAEEOECwMBAsgAiACKAIMQQFqNgIMCyAAEIMERQRAIABBARAsDAMLIABBfzYCyAEMAgsgAEEDECwMAQsgAEEOECwLIAQoAigiAQRAIAEQIgsgBCgCOCIBBEAgARAiCyAMKAIAIgEEQCAMIAE2AgQgDCgCCBogARAiCyAHKAIAIgEEQCAHIAE2AgQgBygCCBogARAiCyAEKAJkIgFFDQAgARAiCyAEKAJ0IgFFDQAgBCABNgJ4IAQoAnwaIAEQIgsgBEGAAWokACAACzMBAn9BDBAjIgFBADYCCCABQgA3AgAgASAAKAIAIgIgACgCBCIAIAAgAmtBGG0QlgIgAQszAQF/IAFBgICAIE8EQBAmAAsgACABQQZ0IgIQIyIBNgIEIAAgATYCACAAIAEgAmo2AggLYAAgACADNgIQQQAhAyAAQQA2AgwCQCABBEAgAUGAgIDAAE8NASABQQV0ECMhAwsgACADNgIAIAAgAyACQQV0aiICNgIIIAAgAyABQQV0ajYCDCAAIAI2AgQgAA8LEHIAC90CAQV/IwBBIGsiBSQAAkACQCAAKAIEIgIgACgCCCIDSQRAIAIgASkDGDcDGCACIAEpAxA3AxAgAiABKQMINwMIIAIgASkDADcDACACQSBqIQEMAQsgAiAAKAIAIgRrQQV1IgZBAWoiAkGAgIDAAE8NASAFQQxqQf///z8gAyAEayIDQQR1IgQgAiACIARJGyADQeD///8HTxsgBiAAEJYDIgIoAggiAyABKQMYNwMYIAMgASkDEDcDECADIAEpAwg3AwggAyABKQMANwMAIAIgA0EgajYCCCACKAIEIAAoAgQgACgCACIDayIBayEEIAEEQCAEIAMgAfwKAAALIAAoAgAhAyAAIAQ2AgAgAiADNgIEIAAgAigCCCIBNgIEIAIgAzYCCCAAKAIIIQQgACACKAIMNgIIIAIgAzYCACACIAQ2AgwgAhCaBQsgACABNgIEIAVBIGokAA8LECYAC1YBBX8gACgCACICKAIAIgEEQCABIQMgAiEEIAIoAgQiBSABRwRAA0AgASAFQUBqEEEiBUcNAAsgACgCACIEKAIAIQMLIAIgATYCBCAEKAIIGiADECILC4sCAQJ/AkAgACgCCCAAKAIAIgRrQQR1IANPBEAgAyAAKAIEIgMgBGsiBUEEdUsEQCADIARHBEAgBQRAIAQgASAF/AoAAAsgACgCBCEDCyACIAEgBWoiAWsiBEUgASACRnJFBEAgAyABIAT8CgAACyAAIAMgBGo2AgQPCyACIAFrIgNFIAEgAkZyRQRAIAQgASAD/AoAAAsMAQsgABBFIANBgICAgAFJBEAgAEH/////ACAAKAIIIAAoAgBrIgRBA3UiBSADIAMgBUkbIARB8P///wdPGxCPAyAAKAIEIQMgAiABayIERSABIAJGckUEQCADIAEgBPwKAAALDAELECYACyAAIAMgBGo2AgQLogIBBX8jAEEgayIFJAACQAJAIAAoAgQiAiAAKAIIIgNJBEAgAiABQcAA/AoAACACQUBrIQEMAQsgAiAAKAIAIgRrQQZ1IgZBAWoiAkGAgIAgTw0BIAVBDGpB////HyADIARrIgNBBXUiBCACIAIgBEkbIANBwP///wdPGyAGIAAQqQEiAigCCCIDIAFBwAD8CgAAIAIgA0FAazYCCCACKAIEIAAoAgQgACgCACIDayIBayEEIAEEQCAEIAMgAfwKAAALIAAoAgAhAyAAIAQ2AgAgAiADNgIEIAAgAigCCCIBNgIEIAIgAzYCCCAAKAIIIQQgACACKAIMNgIIIAIgAzYCACACIAQ2AgwgAhCpAgsgACABNgIEIAVBIGokAA8LECYAC4sBAQN/IwBBEGsiAiQAIAJBCGoiAyABQfgQED8gAigCDCADEKoCIQMgAigCDCIEQQlPBEAgBBABCyAAQQA2AgggAEIANwIAIAAgAxB9IAIgACgCADYCBCACIAM2AgAgAkEIaiACEI0CIAIoAgwgASgCBBAUIAIoAgwiAEEJTwRAIAAQAQsgAkEQaiQAC1sBA38jAEEgayIDJAAgASAAKAIEIgVBAXVqIQEgACgCACEAIANBCGoiBCABIAIgBUEBcQR/IAEoAgAgAGooAgAFIAALEQMAQRgQIyAEEC4gBBAoGiADQSBqJAALMwEDf0EEECMiAiABNgIAQZjxASAAQQNBACEAQdSGAiAAQbncAGpBsgIgAkEAQQBBABAAC0sBAn8gACgCBCIGQQh1IQcgACgCACIAIAEgAiAGQQFxBH8gAygCACAHaigCAAUgBwsgA2ogBEECIAZBAnEbIAUgACgCACgCFBEIAAtRAQF/AkAgAUUNACABQdjoARBiIgFFDQAgASgCCCAAKAIIQX9zcQ0AIAAoAgwoAgQgASgCDCgCBEcNACAAKAIQKAIEIAEoAhAoAgRGIQILIAILewEDfyAAKAIEIgRBAXEhBgJ/IAEtADdBAUYEQCAEQQh1IgUgBkUNARogAigCACAFaigCAAwBCyAEQQh1IAZFDQAaIAEgACgCACgCBDYCOEEAIQJBAAshBSAAKAIAIgAgASACIAVqIANBAiAEQQJxGyAAKAIAKAIcEQUACwsAIAEgAiAAEQEACw0AIAAoAgQgASgCBEYLQAECfyMAQRBrIgIkACMAQRBrIgEkACABIAA2AgwgAUEMakEEEPcBIAFBEGokACACQRBqJABBH3FBAnRB0JwCagtoAQN/IwBBEGsiAyQAIANBADoADiABIABrQQJ1IQEgAigCACEEA0AgAQRAIAEgAUEBdiICQX9zaiACIAAgAkECdGoiAigCACAESSIFGyEBIAJBBGogACAFGyEADAELCyADQRBqJAAgAAvsBAMEfwV+AXwgAkEANgIAAkAgAb1C////////////AINCgICAgICAgPj/AFYgAUQAAAAAAAAAAGFyRQRAIAC9IglCNIinQf8PcSIDQf8PRw0BCyAAIAGiIgAgAKMPCwJAIABEAAAAAAAAAABhDQAgAb0iCkI0iKdB/w9xIQQCfiADRQRAQQAhAyAJQgyGIgdCAFkEQANAIANBAWshAyAHQgGGIgdCAFkNAAsLIAlBASADa62GDAELIAlC/////////weDQoCAgICAgIAIhAshBwJ+IARFBEBBACEEIApCDIYiCEIAWQRAA0AgBEEBayEEIAhCAYYiCEIAWQ0ACwsgCkEBIARrrYYMAQsgCkL/////////B4NCgICAgICAgAiECyEIAn4CQAJAIAMgBE4EQCADIARKBEADQCAHIAh9IgsgByALQgBZIgYbQgGGIQcgBSAGckEBdCEFIANBAWsiAyAESg0ACyAEIQMLIAUgByAIfSIIQgBZIgZyIQUgCCAHIAYbIgdQBEBBRCEDQgAhBwwDCyAHQv////////8HVg0BA0AgA0EBayEDIAciCEIBhiEHIAhCgICAgICAgARUDQALDAELIANBAWogBEcNAwsgA0EATA0AIAdCgICAgICAgAh9IAOtQjSGhAwBCyAHQQEgA2utiAsgAZkhAL8hAQJAAkAgAyAERg0AIANBAWogBEcNASABIAGgIgwgAGQNACAFQQFxRSAAIAxicg0BCyAFQQFqIQUgASAAoSEBCyACQQAgBUH/////B3EiAmsgAiAJIAqFQgBTGzYCACABmiABIAlCAFMbIQALIAALGwAgAEIBhkKAgICAgICAEHxCgYCAgICAgBBUCxUBAX8jAEEQayIBIAA5AwggASsDCAvaFgMSfwR8AX4jAEEwayIJJAACQAJAAkAgAL0iGEIgiKciA0H/////B3EiBkH61L2ABE0EQCADQf//P3FB+8MkRg0BIAZB/LKLgARNBEAgGEIAWQRAIAEgAEQAAEBU+yH5v6AiAEQxY2IaYbTQvaAiFDkDACABIAAgFKFEMWNiGmG00L2gOQMIQQEhAwwFCyABIABEAABAVPsh+T+gIgBEMWNiGmG00D2gIhQ5AwAgASAAIBShRDFjYhphtNA9oDkDCEF/IQMMBAsgGEIAWQRAIAEgAEQAAEBU+yEJwKAiAEQxY2IaYbTgvaAiFDkDACABIAAgFKFEMWNiGmG04L2gOQMIQQIhAwwECyABIABEAABAVPshCUCgIgBEMWNiGmG04D2gIhQ5AwAgASAAIBShRDFjYhphtOA9oDkDCEF+IQMMAwsgBkG7jPGABE0EQCAGQbz714AETQRAIAZB/LLLgARGDQIgGEIAWQRAIAEgAEQAADB/fNkSwKAiAETKlJOnkQ7pvaAiFDkDACABIAAgFKFEypSTp5EO6b2gOQMIQQMhAwwFCyABIABEAAAwf3zZEkCgIgBEypSTp5EO6T2gIhQ5AwAgASAAIBShRMqUk6eRDuk9oDkDCEF9IQMMBAsgBkH7w+SABEYNASAYQgBZBEAgASAARAAAQFT7IRnAoCIARDFjYhphtPC9oCIUOQMAIAEgACAUoUQxY2IaYbTwvaA5AwhBBCEDDAQLIAEgAEQAAEBU+yEZQKAiAEQxY2IaYbTwPaAiFDkDACABIAAgFKFEMWNiGmG08D2gOQMIQXwhAwwDCyAGQfrD5IkESw0BCyAARIPIyW0wX+Q/okQAAAAAAAA4Q6BEAAAAAAAAOMOgIhX8AiEDAkAgACAVRAAAQFT7Ifm/oqAiFCAVRDFjYhphtNA9oiIWoSIXRBgtRFT7Iem/YwRAIANBAWshAyAVRAAAAAAAAPC/oCIVRDFjYhphtNA9oiEWIAAgFUQAAEBU+yH5v6KgIRQMAQsgF0QYLURU+yHpP2RFDQAgA0EBaiEDIBVEAAAAAAAA8D+gIhVEMWNiGmG00D2iIRYgACAVRAAAQFT7Ifm/oqAhFAsgASAUIBahIgA5AwACQCAGQRR2IgIgAL1CNIinQf8PcWtBEUgNACABIBQgFUQAAGAaYbTQPaIiAKEiFyAVRHNwAy6KGaM7oiAUIBehIAChoSIWoSIAOQMAIAIgAL1CNIinQf8PcWtBMkgEQCAXIRQMAQsgASAXIBVEAAAALooZozuiIgChIhQgFUTBSSAlmoN7OaIgFyAUoSAAoaEiFqEiADkDAAsgASAUIAChIBahOQMIDAELIAZBgIDA/wdPBEAgASAAIAChIgA5AwAgASAAOQMIQQAhAwwBCyAJQRBqIgNBCHIhBCAYQv////////8Hg0KAgICAgICAsMEAhL8hAEEBIQIDQCADIAD8ArciFDkDACAAIBShRAAAAAAAAHBBoiEAIAJBACECIAQhAw0ACyAJIAA5AyBBAiEDA0AgAyICQQFrIQMgCUEQaiINIAJBA3RqKwMARAAAAAAAAAAAYQ0AC0EAIQQjAEGwBGsiBSQAIAZBFHZBlghrIgNBA2tBGG0iCEEAIAhBAEobIgdBaGwgA2ohC0G0mgEoAgAiCCACQQFqIg5BAWsiCmpBAE4EQCAIIA5qIQMgByAKayECA0AgBUHAAmogBEEDdGogAkEASAR8RAAAAAAAAAAABSACQQJ0KALAmgG3CzkDACACQQFqIQIgBEEBaiIEIANHDQALCyALQRhrIQZBACEDIAhBACAIQQBKGyEEIA5BAEwhDANAAkAgDARARAAAAAAAAAAAIQAMAQsgAyAKaiEPQQAhAkQAAAAAAAAAACEAA0AgDSACQQN0aisDACAFQcACaiAPIAJrQQN0aisDAKIgAKAhACACQQFqIgIgDkcNAAsLIAUgA0EDdGogADkDACADIARGIANBAWohA0UNAAtBLyALayEQQTAgC2shDyAHQQJ0QcCaAWohESAIIQMCQANAIAUgA0EDdGorAwAhAEEAIQIgAyEEIANBAEoEQANAIAVB4ANqIAJBAnRqIABEAAAAAAAAcD6i/AK3IhREAAAAAAAAcMGiIACg/AI2AgAgBSAEQQN0akEIaysDACAUoCEAIARBAWshBCACQQFqIgIgA0cNAAsLIAAgBhD4ASIAIABEAAAAAAAAwD+inEQAAAAAAAAgwKKgIgAgAPwCIgy3oSEAAkACQAJAAn8gBkEATCISRQRAIANBAnQgBWoiAiACKALcAyICIAIgD3UiAiAPdGsiBDYC3AMgAiAMaiEMIAQgEHUMAQsgBg0BIANBAnQgBWooAtwDQRd1CyIKQQBMDQIMAQtBAiEKIABEAAAAAAAA4D9mDQBBACEKDAELQQAhAkEAIQdBASEEIANBAEoEQANAIAVB4ANqIAJBAnRqIhMoAgAhBAJ/AkAgEyAHBH9B////BwUgBEUNAUGAgIAICyAEazYCAEEBIQdBAAwBC0EAIQdBAQshBCACQQFqIgIgA0cNAAsLAkAgEg0AQf///wMhAgJAAkAgBkEBaw4CAQACC0H///8BIQILIANBAnQgBWoiByAHKALcAyACcTYC3AMLIAxBAWohDCAKQQJHDQBEAAAAAAAA8D8gAKEhAEECIQogBA0AIABEAAAAAAAA8D8gBhD4AaEhAAsgAEQAAAAAAAAAAGEEQEEAIQQgAyECAkAgAyAITA0AA0AgBUHgA2ogAkEBayICQQJ0aigCACAEciEEIAIgCEoNAAsgBEUNAANAIAZBGGshBiAFQeADaiADQQFrIgNBAnRqKAIARQ0ACwwDC0EBIQIDQCACIgRBAWohAiAFQeADaiAIIARrQQJ0aigCAEUNAAsgAyAEaiEEA0AgBUHAAmogAyAOaiIHQQN0aiARIANBAWoiA0ECdGooAgC3OQMAQQAhAkQAAAAAAAAAACEAIA5BAEoEQANAIA0gAkEDdGorAwAgBUHAAmogByACa0EDdGorAwCiIACgIQAgAkEBaiICIA5HDQALCyAFIANBA3RqIAA5AwAgAyAESA0ACyAEIQMMAQsLAkAgAEEYIAtrEPgBIgBEAAAAAAAAcEFmBEAgBUHgA2ogA0ECdGogAEQAAAAAAABwPqL8AiICt0QAAAAAAABwwaIgAKD8AjYCACADQQFqIQMgCyEGDAELIAD8AiECCyAFQeADaiADQQJ0aiACNgIAC0QAAAAAAADwPyAGEPgBIQAgA0EATgRAIAMhAgNAIAUgAiIEQQN0aiAAIAVB4ANqIAJBAnRqKAIAt6I5AwAgAkEBayECIABEAAAAAAAAcD6iIQAgBA0ACyADIQcDQAJAIAggAyAHayIEIAQgCEobIgZBAEgEQEQAAAAAAAAAACEADAELIAUgB0EDdGohC0EAIQJEAAAAAAAAAAAhAANAIAJBA3QiDSsDkLABIAsgDWorAwCiIACgIQAgAiAGRyACQQFqIQINAAsLIAVBoAFqIARBA3RqIAA5AwAgB0EASiAHQQFrIQcNAAsLRAAAAAAAAAAAIQAgA0EATgRAIAMhAgNAIAIiBEEBayECIAAgBUGgAWogBEEDdGorAwCgIQAgBA0ACwsgCSAAmiAAIAobOQMAIAUrA6ABIAChIQBBASECIANBAEoEQANAIAAgBUGgAWogAkEDdGorAwCgIQAgAiADRyACQQFqIQINAAsLIAkgAJogACAKGzkDCCAFQbAEaiQAIAxBB3EhAyAJKwMAIQAgGEIAUwRAIAEgAJo5AwAgASAJKwMImjkDCEEAIANrIQMMAQsgASAAOQMAIAEgCSsDCDkDCAsgCUEwaiQAIAML9AMDA3wCfwF+IAC9IgZCIIinQf////8HcSIEQYCAwKAETwRAIABEGC1EVPsh+T8gAKYgAL1C////////////AINCgICAgICAgPj/AFYbDwsCQAJ/IARB///v/gNNBEBBfyAEQYCAgPIDTw0BGgwCCyAAmSEAIARB///L/wNNBEAgBEH//5f/A00EQCAAIACgRAAAAAAAAPC/oCAARAAAAAAAAABAoKMhAEEADAILIABEAAAAAAAA8L+gIABEAAAAAAAA8D+goyEAQQEMAQsgBEH//42ABE0EQCAARAAAAAAAAPi/oCAARAAAAAAAAPg/okQAAAAAAADwP6CjIQBBAgwBC0QAAAAAAADwvyAAoyEAQQMLIAAgAKIiAiACoiIBIAEgASABIAFEL2xqLES0or+iRJr93lIt3q2/oKJEbZp0r/Kws7+gokRxFiP+xnG8v6CiRMTrmJmZmcm/oKIhAyACIAEgASABIAEgAUQR2iLjOq2QP6JE6w12JEt7qT+gokRRPdCgZg2xP6CiRG4gTMXNRbc/oKJE/4MAkiRJwj+gokQNVVVVVVXVP6CiIQEgBEH//+/+A00EQCAAIAAgAyABoKKhDwtBA3QiBCsDsJkBIAAgAyABoKIgBCsD0JkBoSAAoaEiAJogACAGQgBTGyEACyAAC64CAwF8AX4BfyAAvSICQiCIp0H/////B3EiA0GAgMD/A08EQCACpyADQYCAwP8Da3JFBEBEAAAAAAAAAABEGC1EVPshCUAgAkIAWRsPC0QAAAAAAAAAACAAIAChow8LAnwgA0H////+A00EQEQYLURU+yH5PyADQYGAgOMDSQ0BGkQHXBQzJqaRPCAAIAAgAKIQsgKioSAAoUQYLURU+yH5P6APCyACQgBTBEBEGC1EVPsh+T8gAEQAAAAAAADwP6BEAAAAAAAA4D+iIgCfIgEgASAAELICokQHXBQzJqaRvKCgoSIAIACgDwtEAAAAAAAA8D8gAKFEAAAAAAAA4D+iIgCfIgEgABCyAqIgACABvUKAgICAcIO/IgAgAKKhIAEgAKCjoCAAoCIAIACgCwvJAgEFfyACIAIoAgAQeyADIAMoAgAQeyAAQQIgAUEAEP8BBEAjAEEQayIEJAAgAhCxASACIAAoAoQBIAAoAoABa0ECdRBWIAMEQCADELEBIAMgACgChAEgACgCgAFrQQJ1EFYLIAAoAoQBIgcgACgCgAEiAUcEQANAIAEgBUECdGooAgAiBigCECIIBEAgBEEANgIMIARCADcCBAJAAkACQCADRQ0AIAYtAExBAUcNACADIQEgCCAALQB1QQEgBEEEahD9AQ0BDAILIAAgBhC9AiACIQEgBigCECAALQB1QQAgBEEEahD9AUUNAQsgASAEQQRqEGgLIAQoAgQiAQRAIAQgATYCCCAEKAIMGiABECILIAAoAoQBIQcgACgCgAEhAQsgBUEBaiIFIAcgAWtBAnVJDQALCyAEQRBqJAALIAAQ3gEgAC0AfRoLpwIBA38gAEECIAFBARD/AQRAIAMgAygCABB7IAIgAigCACgCDBEAACMAQRBrIgEkACACIAIoAgAoAgwRAAAgAxCxASAALQB8QQFGBEAgAyAAKAKEASAAKAKAAWtBAnUQVgsgACgCgAEiBCAAKAKEAUcEQANAAkAgBCAFQQJ0aigCACIERQ0AIAQoAhAiBkUNACAELQBMQQFGBEAgAUEANgIMIAFCADcCBCAGIAAtAHVBASABQQRqIgQQ/QEEQCADIAQQaAsgASgCBCIERQ0BIAEgBDYCCCABKAIMGiAEECIMAQsgACAEEPwBRQ0AIAAgBCACELsCCyAFQQFqIgUgACgChAEgACgCgAEiBGtBAnVJDQALCyABQRBqJAALIAAQ3gEgAC0AfRoLeQIDfAR+IAIpAwghBiABKQMIIQcCfCACKQMAIgggASkDACIJUQRARAAAAAAAAAAAIAYgB1ENARoLRAAAAAAAAPA/IAggCX25IgMgA6IgBiAHfbkiBSAFoqCfoyIEIAOaoiEDIAQgBaILIQQgACADOQMIIAAgBDkDAAuACAMIfwF8Bn4jAEEQayIGJAAgAEEANgIIIABCADcCACAAIAEoAgAiAyABKAIEIgEgASADa0EMbRBHIABBADYCHCAAIAI2AhggAEEAOgAUIABBADoAECAAQQA6AAwCQCAAKAIAIgIgACgCBCIHRwR/A0ACQAJAAkAgAigCACIBIAIoAgQiBEYNAANAIAEiA0EQaiIBIARGDQEgAykDACADKQMQUg0AIAMpAwggAykDGFINAAsMAQsgASIDIARHDQAgBiAENgIIIAYgBDYCBAwBCyAEIANBIGoiAUcEQCADQRBqIQUDQAJAIAMpAwAgASkDAFEEQCADKQMIIAUpAxhRDQELIAMgASkDCDcDGCADIAEpAwA3AxAgA0EQaiEDCyABIQUgAUEQaiIBIARHDQALCyAGIAQ2AgggBiADQRBqNgIECyAGKAIEIgMgAigCBCIBRwRAIAEgAyABIANraiIFayIERSABIAVGckUEQCADIAUgBPwKAAALIAIgAyAEaiIBNgIECwJAIAEgAigCACIFa0ERSQ0AIAUpAwAhDANAIAFBEGsiAykDACAMUg0BIAFBCGspAwAgBSkDCFINASACIAM2AgQgAyIBIAVrQRBLDQALCyACQQxqIgIgB0cNAAsgACgCHAVBAAtFBEBBACEFIAAtABBBAUYEQCAAQQA6ABALIAAoAgQiAiAAKAIAIgRHBEBC////////////ACEOQoCAgICAgICAgH8hDQNARP///////+9/IQsgBCAFQQxsIglqIgEoAgAiAyABKAIEIgpHBEACQANAAkAgAykDCCIMIA1TDQAgDCANUQRAIAMpAwAgDlkNAQsgC0T////////vf2EEQCAAKAIAIgQgCWoiASgCBCIHIAEoAgAiAWsiCEEhSQ0DAkAgB0EQayICIAcgCEEQcSIHGyIIIAFGBEBEAAAAAAAAAAAhCwwBCyACKQMAIQxEAAAAAAAAAAAhCwNAIAEpAwgiDyABKQMYfLkgASkDACIQIAEpAxAiEX25oiAPIAIpAwh8uSAMIBB9uaIgC6CgIQsgAUEQaiECIBEhDCABQSBqIgEgCEcNAAsLIAcEfCABKQMIIAIpAwh8uSACKQMAIAEpAwB9uaIgC6AFIAsLRAAAAAAAAOA/oiILRAAAAAAAAAAAYQ0DIAYgC0QAAAAAAAAAAGM6AAMLIABBAToAECAAIAU2AgwgAykDCCENIAMpAwAhDgsgA0EQaiIDIApHDQALIAAoAgAhBAsgACgCBCECCyAFQQFqIgUgAiAEa0EMbUkNAAsLIAAgAC0AECAGLQADcToAFAwBCyAALQAQQQFGBEAgAEEAOgAQCyAAQQA6ABQLIAZBEGokAAvMAgEGfyMAQSBrIgckACADIABrQRhtIQUCQCACQQJIDQAgAkECa0EBdiIJIAVIDQAgACAFQQF0IgVBAXIiBkEYbGohBCACIAVBAmoiBUoEQCAEQRhqIgggBCAEIAggASgCABECACIIGyEEIAUgBiAIGyEGCyAEIAMgASgCABECAA0AIAcgAykDEDcDGCAHIAMpAwg3AxAgByADKQMANwMIA0ACQCADIAQiBSkDEDcDECADIAQpAwg3AwggAyAEKQMANwMAIAYgCUoNACAAIAZBAXQiA0EBciIGQRhsaiEEIAIgA0ECaiIDSgRAIARBGGoiCCAEIAQgCCABKAIAEQIAIggbIQQgAyAGIAgbIQYLIAUhAyAEIAdBCGogASgCABECAEUNAQsLIAUgBykDGDcDECAFIAcpAxA3AwggBSAHKQMINwMACyAHQSBqJAALwRIBBn8jAEEgayIDJABBASEHAkACQAJAAkACQAJAIAEgAGtBGG0OBgUFAAECAwQLIAFBGGsiASAAIAIoAgARAgBFDQQgAyAAKQMQNwMYIAMgACkDCDcDECADIAApAwA3AwggACABKQMQNwMQIAAgASkDCDcDCCAAIAEpAwA3AwAgASADKQMYNwMQIAEgAykDEDcDCCABIAMpAwg3AwAMBAsgAEEYaiIEIAAgAigCABECACABQRhrIgEgBCACKAIAEQIAIQVFBEAgBUUNBCADIAQpAxA3AxggAyAEKQMINwMQIAMgBCkDADcDCCAEIAEpAxA3AxAgBCABKQMINwMIIAQgASkDADcDACABIAMpAxg3AxAgASADKQMQNwMIIAEgAykDCDcDACAEIAAgAigCABECAEUNBCADIAApAxA3AxggAyAAKQMINwMQIAMgACkDADcDCCAAIAQpAxA3AxAgACAEKQMINwMIIAAgBCkDADcDACAEIAMpAxg3AxAgBCADKQMQNwMIIAQgAykDCDcDAAwECyAFBEAgAyAAKQMQNwMYIAMgACkDCDcDECADIAApAwA3AwggACABKQMQNwMQIAAgASkDCDcDCCAAIAEpAwA3AwAgASADKQMYNwMQIAEgAykDEDcDCCABIAMpAwg3AwAMBAsgAyAAKQMQNwMYIAMgACkDCDcDECADIAApAwA3AwggACAEKQMQNwMQIAAgBCkDCDcDCCAAIAQpAwA3AwAgBCADKQMYNwMQIAQgAykDEDcDCCAEIAMpAwg3AwAgASAEIAIoAgARAgBFDQMgAyAEKQMQNwMYIAMgBCkDCDcDECADIAQpAwA3AwggBCABKQMQNwMQIAQgASkDCDcDCCAEIAEpAwA3AwAgASADKQMYNwMQIAEgAykDEDcDCCABIAMpAwg3AwAMAwsgAUEYayEFIABBGGoiASAAIAIoAgARAgAhCCAAQTBqIgQgASACKAIAEQIAIQYCQCAIRQRAIAZFDQEgAyABKQMQNwMYIAMgASkDCDcDECADIAEpAwA3AwggASAEKQMQNwMQIAEgBCkDCDcDCCABIAQpAwA3AwAgBCADKQMYNwMQIAQgAykDEDcDCCAEIAMpAwg3AwAgASAAIAIoAgARAgBFDQEgAyAAKQMQNwMYIAMgACkDCDcDECADIAApAwA3AwggACABKQMQNwMQIAAgASkDCDcDCCAAIAEpAwA3AwAgASADKQMYNwMQIAEgAykDEDcDCCABIAMpAwg3AwAMAQsgBgRAIAMgACkDEDcDGCADIAApAwg3AxAgAyAAKQMANwMIIAAgBCkDEDcDECAAIAQpAwg3AwggACAEKQMANwMAIAQgAykDGDcDECAEIAMpAxA3AwggBCADKQMINwMADAELIAMgACkDEDcDGCADIAApAwg3AxAgAyAAKQMANwMIIAAgASkDEDcDECAAIAEpAwg3AwggACABKQMANwMAIAEgAykDGDcDECABIAMpAxA3AwggASADKQMINwMAIAQgASACKAIAEQIARQ0AIAMgASkDEDcDGCADIAEpAwg3AxAgAyABKQMANwMIIAEgBCkDEDcDECABIAQpAwg3AwggASAEKQMANwMAIAQgAykDGDcDECAEIAMpAxA3AwggBCADKQMINwMACyAFIAQgAigCABECAEUNAiADIAQpAxA3AxggAyAEKQMINwMQIAMgBCkDADcDCCAEIAUpAxA3AxAgBCAFKQMINwMIIAQgBSkDADcDACAFIAMpAxg3AxAgBSADKQMQNwMIIAUgAykDCDcDACAEIAEgAigCABECAEUNAiADIAEpAxA3AxggAyABKQMINwMQIAMgASkDADcDCCABIAQpAxA3AxAgASAEKQMINwMIIAEgBCkDADcDACAEIAMpAxg3AxAgBCADKQMQNwMIIAQgAykDCDcDACABIAAgAigCABECAEUNAiADIAApAxA3AxggAyAAKQMINwMQIAMgACkDADcDCCAAIAEpAxA3AxAgACABKQMINwMIIAAgASkDADcDACABIAMpAxg3AxAgASADKQMQNwMIIAEgAykDCDcDAAwCCyAAIABBGGogAEEwaiAAQcgAaiABQRhrIAIQsgMMAQsgAEEYaiIFIAAgAigCABECACEIIABBMGoiBCAFIAIoAgARAgAhBgJAIAhFBEAgBkUNASADIAUpAxA3AxggAyAFKQMINwMQIAMgBSkDADcDCCAFIAQpAxA3AxAgBSAEKQMINwMIIAUgBCkDADcDACAEIAMpAxg3AxAgBCADKQMQNwMIIAQgAykDCDcDACAFIAAgAigCABECAEUNASADIAApAxA3AxggAyAAKQMINwMQIAMgACkDADcDCCAAIAUpAxA3AxAgACAFKQMINwMIIAAgBSkDADcDACAFIAMpAxg3AxAgBSADKQMQNwMIIAUgAykDCDcDAAwBCyAGBEAgAyAAKQMQNwMYIAMgACkDCDcDECADIAApAwA3AwggACAEKQMQNwMQIAAgBCkDCDcDCCAAIAQpAwA3AwAgBCADKQMYNwMQIAQgAykDEDcDCCAEIAMpAwg3AwAMAQsgAyAAKQMQNwMYIAMgACkDCDcDECADIAApAwA3AwggACAFKQMQNwMQIAAgBSkDCDcDCCAAIAUpAwA3AwAgBSADKQMYNwMQIAUgAykDEDcDCCAFIAMpAwg3AwAgBCAFIAIoAgARAgBFDQAgAyAFKQMQNwMYIAMgBSkDCDcDECADIAUpAwA3AwggBSAEKQMQNwMQIAUgBCkDCDcDCCAFIAQpAwA3AwAgBCADKQMYNwMQIAQgAykDEDcDCCAEIAMpAwg3AwALIABByABqIgUgAUYNAEEAIQgDQAJAIAUgBCACKAIAEQIARQ0AIAMgBSkDEDcDGCADIAUpAwg3AxAgAyAFKQMANwMIIAUhBgNAAkAgBiAEIgcpAxA3AxAgBiAEKQMINwMIIAYgBCkDADcDACAAIARGBEAgACEHDAELIANBCGogByIGQRhrIgQgAigCABECAA0BCwsgByADKQMYNwMQIAcgAykDEDcDCCAHIAMpAwg3AwAgCEEBaiIIQQhHDQAgBUEYaiABRiEHDAILIAUiBEEYaiIHIQUgASAHRw0AC0EBIQcLIANBIGokACAHC1oBAn8jAEEQayICJAAgASAAKAIEIgNBAXVqIQEgACgCACEAIAIgASADQQFxBH8gASgCACAAaigCAAUgAAsRAQAgAhCYBSACIAI2AgwgAkEMahApIAJBEGokAAuMCgEDfyMAQSBrIgYkACABIAAgBSgCABECACEIIAIgASAFKAIAEQIAIQcCQCAIRQRAIAdFDQEgBiABKQMQNwMYIAYgASkDCDcDECAGIAEpAwA3AwggASACKQMQNwMQIAEgAikDCDcDCCABIAIpAwA3AwAgAiAGKQMYNwMQIAIgBikDEDcDCCACIAYpAwg3AwAgASAAIAUoAgARAgBFDQEgBiAAKQMQNwMYIAYgACkDCDcDECAGIAApAwA3AwggACABKQMQNwMQIAAgASkDCDcDCCAAIAEpAwA3AwAgASAGKQMYNwMQIAEgBikDEDcDCCABIAYpAwg3AwAMAQsgBwRAIAYgACkDEDcDGCAGIAApAwg3AxAgBiAAKQMANwMIIAAgAikDEDcDECAAIAIpAwg3AwggACACKQMANwMAIAIgBikDGDcDECACIAYpAxA3AwggAiAGKQMINwMADAELIAYgACkDEDcDGCAGIAApAwg3AxAgBiAAKQMANwMIIAAgASkDEDcDECAAIAEpAwg3AwggACABKQMANwMAIAEgBikDGDcDECABIAYpAxA3AwggASAGKQMINwMAIAIgASAFKAIAEQIARQ0AIAYgASkDEDcDGCAGIAEpAwg3AxAgBiABKQMANwMIIAEgAikDEDcDECABIAIpAwg3AwggASACKQMANwMAIAIgBikDGDcDECACIAYpAxA3AwggAiAGKQMINwMACwJAIAMgAiAFKAIAEQIARQ0AIAYgAikDEDcDGCAGIAIpAwg3AxAgBiACKQMANwMIIAIgAykDEDcDECACIAMpAwg3AwggAiADKQMANwMAIAMgBikDGDcDECADIAYpAxA3AwggAyAGKQMINwMAIAIgASAFKAIAEQIARQ0AIAYgASkDEDcDGCAGIAEpAwg3AxAgBiABKQMANwMIIAEgAikDEDcDECABIAIpAwg3AwggASACKQMANwMAIAIgBikDGDcDECACIAYpAxA3AwggAiAGKQMINwMAIAEgACAFKAIAEQIARQ0AIAYgACkDEDcDGCAGIAApAwg3AxAgBiAAKQMANwMIIAAgASkDEDcDECAAIAEpAwg3AwggACABKQMANwMAIAEgBikDGDcDECABIAYpAxA3AwggASAGKQMINwMACwJAIAQgAyAFKAIAEQIARQ0AIAYgAykDEDcDGCAGIAMpAwg3AxAgBiADKQMANwMIIAMgBCkDEDcDECADIAQpAwg3AwggAyAEKQMANwMAIAQgBikDGDcDECAEIAYpAxA3AwggBCAGKQMINwMAIAMgAiAFKAIAEQIARQ0AIAYgAikDEDcDGCAGIAIpAwg3AxAgBiACKQMANwMIIAIgAykDEDcDECACIAMpAwg3AwggAiADKQMANwMAIAMgBikDGDcDECADIAYpAxA3AwggAyAGKQMINwMAIAIgASAFKAIAEQIARQ0AIAYgASkDEDcDGCAGIAEpAwg3AxAgBiABKQMANwMIIAEgAikDEDcDECABIAIpAwg3AwggASACKQMANwMAIAIgBikDGDcDECACIAYpAxA3AwggAiAGKQMINwMAIAEgACAFKAIAEQIARQ0AIAYgACkDEDcDGCAGIAApAwg3AxAgBiAAKQMANwMIIAAgASkDEDcDECAAIAEpAwg3AwggACABKQMANwMAIAEgBikDGDcDECABIAYpAxA3AwggASAGKQMINwMACyAGQSBqJAALqAYBA38CQAJAAkACQAJAIAMOAwMAAQILIAQgACgCCDYCCCAEIAApAgA3AgAPCyABQQxrIQICQAJAIAFBCGsoAgAiAUUNACAAKAIERQ0AIAAoAgApAwAgAigCACkDAFUNAQwECyABRQ0DCyAEIAIoAgg2AgggBCACKQIANwIAIAQgACkCADcCDCAEIAAoAgg2AhQPCyADQQhMBEAgBCEDAkAgACABRg0AIAQgACgCCDYCCCAEIAApAgA3AgAgAEEMaiIGIAFGDQADQCAEQQxqIQUCQAJAAkACQCAAKAIQIgJFDQAgBCgCBEUNACAEKAIAKQMAIAYoAgApAwBVDQEMAgsgAkUNAQsgBSAEKAIINgIIIAUgBCkCADcCAAJ/IAMgAyAERg0AGgJAA0AgBEEMayECAkACQCAAKAIQIgdFDQAgBEEIaygCAEUNACACKAIAKQMAIAYoAgApAwBVDQEMAwsgB0UNAgsgBCACLQAIOgAIIAQgAikCADcCACACIgQgA0cNAAsgAwwBCyAECyIAIAYtAAg6AAggACAGKQIANwIADAELIAUgBigCCDYCCCAFIAYpAgA3AgALIAUhBCAGIgBBDGoiBiABRw0ACwsPCyAAIAAgA0EBdiIHQQxsIgZqIgUgAiAHIAQgBxCvASAFIAEgAiADIAdrIgIgBCAGaiACEK8BAkAgBSIDIABHBEADQCABIAVGBEAgACADRg0DA0AgBCAAKAIINgIIIAQgACkCADcCACAEQQxqIQQgAEEMaiIAIANHDQALDAMLAkACQAJAAkAgBSgCBCICRQ0AIAAoAgRFDQAgACgCACkDACAFKAIAKQMAVQ0BDAILIAJFDQELIAQgBSgCCDYCCCAEIAUpAgA3AgAgBUEMaiEFDAELIAQgACgCCDYCCCAEIAApAgA3AgAgAEEMaiEACyAEQQxqIQQgACADRw0ACwsgASAFRg0AA0AgBCAFKAIINgIIIAQgBSkCADcCACAEQQxqIQQgBUEMaiIFIAFHDQALCwsPCyAEIAAoAgg2AgggBCAAKQIANwIAIAQgAikCADcCDCAEIAIoAgg2AhQLQgEDfyAAKAIAIgIEQANAIAEoAgAhAyABQQA2AgAgAUEEaiEBIAMEQCADECIgACgCACECCyAEQQFqIgQgAkkNAAsLC80GAgR/An4CQAJAAkACQAJAIAMOAwMAAQILIAAoAgAhASAAQQA2AgAgBCABNgIADwsCQCAAKAIAIgIoAgAiAykDCCIJIAFBBGsiASgCACIFKAIAIgYpAwgiClIEQCAJIApTDQEMBAsgAykDACAGKQMAVw0DCyABQQA2AgAgBCAFNgIAIAAoAgAhASAAQQA2AgAgBCABNgIEDwsgA0EITARAIAQhAgJAIAAgAUYNACAAKAIAIQMgAEEANgIAIAQgAzYCACAAQQRqIgUgAUYNAANAIAQiAEEEaiEEAkACQAJAIAAoAgAiAygCACIGKQMIIgkgBSgCACIHKAIAIggpAwgiClIEQCAJIApTDQEMAgsgBikDACAIKQMAVw0BCyAAIAM2AgQgAEEANgIAAn8gAiAAIAJGDQAaAkADQAJAIABBBGsiAygCACIHKAIAIgYpAwgiCSAFKAIAKAIAIggpAwgiClIEQCAJIApTDQEMAwsgBikDACAIKQMAVw0CCyADQQA2AgAgACgCACEGIAAgBzYCACAGBEAgBhAiCyADIgAgAkcNAAsgAgwBCyAACyEAIAUoAgAhBiAFQQA2AgAgACgCACEDIAAgBjYCACADRQ0BIAMQIgwBCyAFQQA2AgAgBCAHNgIACyAFQQRqIgUgAUcNAAsLDwsgACAAIANBAXYiBkECdCIHaiIFIAIgBiAEIAYQsAEgBSABIAIgAyAGayICIAQgB2ogAhCwAQJAIAUiAiAARwRAA0AgASAFRgRAIAAgAkYNAwNAIAAoAgAhASAAQQA2AgAgBCABNgIAIARBBGohBCAAQQRqIgAgAkcNAAsMAwsCQAJAAkAgACgCACIDKAIAIgYpAwgiCSAFKAIAIgcoAgAiCCkDCCIKUgRAIAkgClMNAQwCCyAGKQMAIAgpAwBXDQELIAVBADYCACAEIAc2AgAgBUEEaiEFDAELIABBADYCACAEIAM2AgAgAEEEaiEACyAEQQRqIQQgACACRw0ACwsgASAFRg0AA0AgBSgCACEAIAVBADYCACAEIAA2AgAgBEEEaiEEIAVBBGoiBSABRw0ACwsLDwsgAEEANgIAIAQgAjYCACABKAIAIQAgAUEANgIAIAQgADYCBAseAQJ/IAAoAgQgACgCACICa0EEdQRAIAAgAjYCBAsLjzMBCn8jAEEgayIFJAADQCABQcgAayEKIAFBMGshDCABQRhrIQkCQANAAkACQAJAAkACQCABIABrIghBGG0iBg4GBgYAAQIDBAsgAUEYayIBIAAgAigCABECAEUNBSAFIAApAxA3AxggBSAAKQMINwMQIAUgACkDADcDCCAAIAEpAxA3AxAgACABKQMINwMIIAAgASkDADcDACABIAUpAxg3AxAgASAFKQMQNwMIIAEgBSkDCDcDAAwFCyAAQRhqIgMgACACKAIAEQIAIAFBGGsiASADIAIoAgARAgAhBEUEQCAERQ0FIAUgAykDEDcDGCAFIAMpAwg3AxAgBSADKQMANwMIIAMgASkDEDcDECADIAEpAwg3AwggAyABKQMANwMAIAEgBSkDGDcDECABIAUpAxA3AwggASAFKQMINwMAIAMgACACKAIAEQIARQ0FIAUgACkDEDcDGCAFIAApAwg3AxAgBSAAKQMANwMIIAAgAykDEDcDECAAIAMpAwg3AwggACADKQMANwMAIAMgBSkDGDcDECADIAUpAxA3AwggAyAFKQMINwMADAULIAQEQCAFIAApAxA3AxggBSAAKQMINwMQIAUgACkDADcDCCAAIAEpAxA3AxAgACABKQMINwMIIAAgASkDADcDACABIAUpAxg3AxAgASAFKQMQNwMIIAEgBSkDCDcDAAwFCyAFIAApAxA3AxggBSAAKQMINwMQIAUgACkDADcDCCAAIAMpAxA3AxAgACADKQMINwMIIAAgAykDADcDACADIAUpAxg3AxAgAyAFKQMQNwMIIAMgBSkDCDcDACABIAMgAigCABECAEUNBCAFIAMpAxA3AxggBSADKQMINwMQIAUgAykDADcDCCADIAEpAxA3AxAgAyABKQMINwMIIAMgASkDADcDACABIAUpAxg3AxAgASAFKQMQNwMIIAEgBSkDCDcDAAwECyABQRhrIQQgAEEYaiIBIAAgAigCABECACEIIABBMGoiAyABIAIoAgARAgAhBgJAIAhFBEAgBkUNASAFIAEpAxA3AxggBSABKQMINwMQIAUgASkDADcDCCABIAMpAxA3AxAgASADKQMINwMIIAEgAykDADcDACADIAUpAxg3AxAgAyAFKQMQNwMIIAMgBSkDCDcDACABIAAgAigCABECAEUNASAFIAApAxA3AxggBSAAKQMINwMQIAUgACkDADcDCCAAIAEpAxA3AxAgACABKQMINwMIIAAgASkDADcDACABIAUpAxg3AxAgASAFKQMQNwMIIAEgBSkDCDcDAAwBCyAGBEAgBSAAKQMQNwMYIAUgACkDCDcDECAFIAApAwA3AwggACADKQMQNwMQIAAgAykDCDcDCCAAIAMpAwA3AwAgAyAFKQMYNwMQIAMgBSkDEDcDCCADIAUpAwg3AwAMAQsgBSAAKQMQNwMYIAUgACkDCDcDECAFIAApAwA3AwggACABKQMQNwMQIAAgASkDCDcDCCAAIAEpAwA3AwAgASAFKQMYNwMQIAEgBSkDEDcDCCABIAUpAwg3AwAgAyABIAIoAgARAgBFDQAgBSABKQMQNwMYIAUgASkDCDcDECAFIAEpAwA3AwggASADKQMQNwMQIAEgAykDCDcDCCABIAMpAwA3AwAgAyAFKQMYNwMQIAMgBSkDEDcDCCADIAUpAwg3AwALIAQgAyACKAIAEQIARQ0DIAUgAykDEDcDGCAFIAMpAwg3AxAgBSADKQMANwMIIAMgBCkDEDcDECADIAQpAwg3AwggAyAEKQMANwMAIAQgBSkDGDcDECAEIAUpAxA3AwggBCAFKQMINwMAIAMgASACKAIAEQIARQ0DIAUgASkDEDcDGCAFIAEpAwg3AxAgBSABKQMANwMIIAEgAykDEDcDECABIAMpAwg3AwggASADKQMANwMAIAMgBSkDGDcDECADIAUpAxA3AwggAyAFKQMINwMAIAEgACACKAIAEQIARQ0DIAUgACkDEDcDGCAFIAApAwg3AxAgBSAAKQMANwMIIAAgASkDEDcDECAAIAEpAwg3AwggACABKQMANwMAIAEgBSkDGDcDECABIAUpAxA3AwggASAFKQMINwMADAMLIAAgAEEYaiAAQTBqIABByABqIAFBGGsgAhCyAwwCCyAIQb8ETARAIARBAXEEQCACIQYjAEEgayIHJAACQCAAIgIgASIIRg0AIAEgAEEYaiIBRg0AA0AgASIDIAAgBigCABECAARAIAcgASkDEDcDGCAHIAEpAwg3AxAgByABKQMANwMIIAEhBANAAkAgBCAAIgEpAxA3AxAgBCAAKQMINwMIIAQgACkDADcDACAAIAJGBEAgAiEBDAELIAEhBCAHQQhqIAFBGGsiACAGKAIAEQIADQELCyABIAcpAxg3AxAgASAHKQMQNwMIIAEgBykDCDcDAAsgAyIAQRhqIgEgCEcNAAsLIAdBIGokAAwDCyACIQMjAEEgayIIJAACQCABIgYgAEYNACAAQRhqIgEgBkYNAANAIAEiAiAAIAMoAgARAgAEQCAIIAEpAxA3AxggCCABKQMINwMQIAggASkDADcDCANAIAEiBCAAIgEpAxA3AxAgBCAAKQMINwMIIAQgACkDADcDACAIQQhqIABBGGsiACADKAIAEQIADQALIAEgCCkDGDcDECABIAgpAxA3AwggASAIKQMINwMACyACIgBBGGoiASAGRw0ACwsgCEEgaiQADAILIANFBEAgACABRg0CIwBBIGsiCSQAIAEgACIERwRAIAEgAGsiBkEYbSEIIAZBGU4EQCAIQQJrQQF2IQADQCAEIAIgCCAEIAAiA0EYbGoQrwMgAEEBayEAIAMNAAsLIAEiACAARwRAA0AgACAEIAIoAgARAgAEQCAJIAApAxA3AxggCSAAKQMINwMQIAkgACkDADcDCCAAIAQpAxA3AxAgACAEKQMINwMIIAAgBCkDADcDACAEIAkpAxg3AxAgBCAJKQMQNwMIIAQgCSkDCDcDACAEIAIgCCAEEK8DCyAAQRhqIgAgAUcNAAsLIAZBGU4EQCAGQRhuIQMDQCAJIAQpAxA3AxggCSAEKQMINwMQIAkgBCkDADcDCCADIgZBAmtBAXYhCkEAIQggBCEAA0AgCEEBdCIMQQFyIQcgACAIQRhsaiIIQRhqIQMgBiAMQQJqIgxMBH8gBwUgCEEwaiIIIAMgAyAIIAIoAgARAgAiCBshAyAMIAcgCBsLIQggACADKQMQNwMQIAAgAykDCDcDCCAAIAMpAwA3AwAgAyEAIAggCkwNAAsCQCABQRhrIgEgAEYEQCAAIAkpAxg3AxAgACAJKQMQNwMIIAAgCSkDCDcDAAwBCyADIAEpAxA3AxAgAyABKQMINwMIIAMgASkDADcDACABIAkpAwg3AwAgASAJKQMQNwMIIAEgCSkDGDcDECMAQSBrIgckAAJAIANBGGoiACAEa0EYbSIDQQJIDQAgBCADQQJrQQF2IgpBGGxqIgggAEEYayIDIAIoAgARAgBFDQAgByADKQMQNwMYIAcgAykDCDcDECAHIAMpAwA3AwgDQAJAIAMgCCIAKQMQNwMQIAMgACkDCDcDCCADIAApAwA3AwAgCkUNACAAIQMgBCAKQQFrQQF2IgpBGGxqIgggB0EIaiACKAIAEQIADQELCyAAIAcpAxg3AxAgACAHKQMQNwMIIAAgBykDCDcDAAsgB0EgaiQACyAGQQFrIQMgBkECSg0ACwsLIAlBIGokAAwCCyAAIAZBAXZBGGxqIQYgAigCACEHAkAgCEGBGE8EQCAGIAAgBxECACEHIAkgBiACKAIAEQIAIQgCQCAHRQRAIAhFDQEgBSAGKQMQNwMYIAUgBikDCDcDECAFIAYpAwA3AwggBiAJKQMQNwMQIAYgCSkDCDcDCCAGIAkpAwA3AwAgCSAFKQMYNwMQIAkgBSkDEDcDCCAJIAUpAwg3AwAgBiAAIAIoAgARAgBFDQEgBSAAKQMQNwMYIAUgACkDCDcDECAFIAApAwA3AwggACAGKQMQNwMQIAAgBikDCDcDCCAAIAYpAwA3AwAgBiAFKQMYNwMQIAYgBSkDEDcDCCAGIAUpAwg3AwAMAQsgCARAIAUgACkDEDcDGCAFIAApAwg3AxAgBSAAKQMANwMIIAAgCSkDEDcDECAAIAkpAwg3AwggACAJKQMANwMAIAkgBSkDGDcDECAJIAUpAxA3AwggCSAFKQMINwMADAELIAUgACkDEDcDGCAFIAApAwg3AxAgBSAAKQMANwMIIAAgBikDEDcDECAAIAYpAwg3AwggACAGKQMANwMAIAYgBSkDGDcDECAGIAUpAxA3AwggBiAFKQMINwMAIAkgBiACKAIAEQIARQ0AIAUgBikDEDcDGCAFIAYpAwg3AxAgBSAGKQMANwMIIAYgCSkDEDcDECAGIAkpAwg3AwggBiAJKQMANwMAIAkgBSkDGDcDECAJIAUpAxA3AwggCSAFKQMINwMACyAGQRhrIgggAEEYaiIHIAIoAgARAgAhDSAMIAggAigCABECACELAkAgDUUEQCALRQ0BIAUgCCkDEDcDGCAFIAgpAwg3AxAgBSAIKQMANwMIIAggDCkDEDcDECAIIAwpAwg3AwggCCAMKQMANwMAIAwgBSkDGDcDECAMIAUpAxA3AwggDCAFKQMINwMAIAggByACKAIAEQIARQ0BIAUgBykDEDcDGCAFIAcpAwg3AxAgBSAHKQMANwMIIAcgCCkDEDcDECAHIAgpAwg3AwggByAIKQMANwMAIAggBSkDGDcDECAIIAUpAxA3AwggCCAFKQMINwMADAELIAsEQCAFIAcpAxA3AxggBSAHKQMINwMQIAUgBykDADcDCCAHIAwpAxA3AxAgByAMKQMINwMIIAcgDCkDADcDACAMIAUpAxg3AxAgDCAFKQMQNwMIIAwgBSkDCDcDAAwBCyAFIAcpAxA3AxggBSAHKQMINwMQIAUgBykDADcDCCAHIAgpAxA3AxAgByAIKQMINwMIIAcgCCkDADcDACAIIAUpAxg3AxAgCCAFKQMQNwMIIAggBSkDCDcDACAMIAggAigCABECAEUNACAFIAgpAxA3AxggBSAIKQMINwMQIAUgCCkDADcDCCAIIAwpAxA3AxAgCCAMKQMINwMIIAggDCkDADcDACAMIAUpAxg3AxAgDCAFKQMQNwMIIAwgBSkDCDcDAAsgBkEYaiIHIABBMGoiCyACKAIAEQIAIQ4gCiAHIAIoAgARAgAhDQJAIA5FBEAgDUUNASAFIAcpAxA3AxggBSAHKQMINwMQIAUgBykDADcDCCAHIAopAxA3AxAgByAKKQMINwMIIAcgCikDADcDACAKIAUpAxg3AxAgCiAFKQMQNwMIIAogBSkDCDcDACAHIAsgAigCABECAEUNASAFIAspAxA3AxggBSALKQMINwMQIAUgCykDADcDCCALIAcpAxA3AxAgCyAHKQMINwMIIAsgBykDADcDACAHIAUpAxg3AxAgByAFKQMQNwMIIAcgBSkDCDcDAAwBCyANBEAgBSALKQMQNwMYIAUgCykDCDcDECAFIAspAwA3AwggCyAKKQMQNwMQIAsgCikDCDcDCCALIAopAwA3AwAgCiAFKQMYNwMQIAogBSkDEDcDCCAKIAUpAwg3AwAMAQsgBSALKQMQNwMYIAUgCykDCDcDECAFIAspAwA3AwggCyAHKQMQNwMQIAsgBykDCDcDCCALIAcpAwA3AwAgByAFKQMYNwMQIAcgBSkDEDcDCCAHIAUpAwg3AwAgCiAHIAIoAgARAgBFDQAgBSAHKQMQNwMYIAUgBykDCDcDECAFIAcpAwA3AwggByAKKQMQNwMQIAcgCikDCDcDCCAHIAopAwA3AwAgCiAFKQMYNwMQIAogBSkDEDcDCCAKIAUpAwg3AwALIAYgCCACKAIAEQIAIQ0gByAGIAIoAgARAgAhCwJAIA1FBEAgC0UNASAFIAYpAxA3AxggBSAGKQMINwMQIAUgBikDADcDCCAGIAcpAxA3AxAgBiAHKQMINwMIIAYgBykDADcDACAHIAUpAxg3AxAgByAFKQMQNwMIIAcgBSkDCDcDACAGIAggAigCABECAEUNASAFIAgpAxA3AxggBSAIKQMINwMQIAUgCCkDADcDCCAIIAYpAxA3AxAgCCAGKQMINwMIIAggBikDADcDACAGIAUpAxg3AxAgBiAFKQMQNwMIIAYgBSkDCDcDAAwBCyALBEAgBSAIKQMQNwMYIAUgCCkDCDcDECAFIAgpAwA3AwggCCAHKQMQNwMQIAggBykDCDcDCCAIIAcpAwA3AwAgByAFKQMYNwMQIAcgBSkDEDcDCCAHIAUpAwg3AwAMAQsgBSAIKQMQNwMYIAUgCCkDCDcDECAFIAgpAwA3AwggCCAGKQMQNwMQIAggBikDCDcDCCAIIAYpAwA3AwAgBiAFKQMYNwMQIAYgBSkDEDcDCCAGIAUpAwg3AwAgByAGIAIoAgARAgBFDQAgBSAGKQMQNwMYIAUgBikDCDcDECAFIAYpAwA3AwggBiAHKQMQNwMQIAYgBykDCDcDCCAGIAcpAwA3AwAgByAFKQMYNwMQIAcgBSkDEDcDCCAHIAUpAwg3AwALIAUgACkDEDcDGCAFIAApAwg3AxAgBSAAKQMANwMIIAAgBikDEDcDECAAIAYpAwg3AwggACAGKQMANwMAIAYgBSkDGDcDECAGIAUpAxA3AwggBiAFKQMINwMADAELIAAgBiAHEQIAIAkgACACKAIAEQIAIQhFBEAgCEUNASAFIAApAxA3AxggBSAAKQMINwMQIAUgACkDADcDCCAAIAkpAxA3AxAgACAJKQMINwMIIAAgCSkDADcDACAJIAUpAxg3AxAgCSAFKQMQNwMIIAkgBSkDCDcDACAAIAYgAigCABECAEUNASAFIAYpAxA3AxggBSAGKQMINwMQIAUgBikDADcDCCAGIAApAxA3AxAgBiAAKQMINwMIIAYgACkDADcDACAAIAUpAxg3AxAgACAFKQMQNwMIIAAgBSkDCDcDAAwBCyAIBEAgBSAGKQMQNwMYIAUgBikDCDcDECAFIAYpAwA3AwggBiAJKQMQNwMQIAYgCSkDCDcDCCAGIAkpAwA3AwAgCSAFKQMYNwMQIAkgBSkDEDcDCCAJIAUpAwg3AwAMAQsgBSAGKQMQNwMYIAUgBikDCDcDECAFIAYpAwA3AwggBiAAKQMQNwMQIAYgACkDCDcDCCAGIAApAwA3AwAgACAFKQMYNwMQIAAgBSkDEDcDCCAAIAUpAwg3AwAgCSAAIAIoAgARAgBFDQAgBSAAKQMQNwMYIAUgACkDCDcDECAFIAApAwA3AwggACAJKQMQNwMQIAAgCSkDCDcDCCAAIAkpAwA3AwAgCSAFKQMYNwMQIAkgBSkDEDcDCCAJIAUpAwg3AwALIANBAWshAwJAIARBAXEiCw0AIABBGGsgACACKAIAEQIADQBBACEEIwBBMGsiByQAIAcgACkDEDcDECAHIAApAwg3AwggByAAKQMANwMAAkAgByABIghBGGsgAigCABECAARAIAAhBgNAIAcgBkEYaiIGIAIoAgARAgBFDQALDAELIAAhBgNAIAZBGGoiBiAITw0BIAcgBiACKAIAEQIARQ0ACwsgBiAISQRAA0AgByAIQRhrIgggAigCABECAA0ACwsgBiAISQRAA0AgByAGKQMQNwMoIAcgBikDCDcDICAHIAYpAwA3AxggBiAIKQMQNwMQIAYgCCkDCDcDCCAGIAgpAwA3AwAgCCAHKQMoNwMQIAggBykDIDcDCCAIIAcpAxg3AwADQCAHIAZBGGoiBiACKAIAEQIARQ0ACwNAIAcgCEEYayIIIAIoAgARAgANAAsgBiAISQ0ACwsgBkEYayIIIABHBEAgACAIKQMQNwMQIAAgCCkDCDcDCCAAIAgpAwA3AwALIAggBykDEDcDECAIIAcpAwg3AwggCCAHKQMANwMAIAdBMGokACAGIQAMAQsLIAEhByMAQTBrIgkkACAJIAApAxA3AxAgCSAAKQMINwMIIAkgACkDADcDACAAIQYDQCAGIghBGGoiBiAJIAIoAgARAgANAAsCQCAAIAhGBEADQCAGIAdPDQIgB0EYayIHIAkgAigCABECAEUNAAwCCwALA0AgB0EYayIHIAkgAigCABECAEUNAAsLIAYgB08iCkUEQANAIAkgBikDEDcDKCAJIAYpAwg3AyAgCSAGKQMANwMYIAYgBykDEDcDECAGIAcpAwg3AwggBiAHKQMANwMAIAcgCSkDKDcDECAHIAkpAyA3AwggByAJKQMYNwMAA0AgBiIIQRhqIgYgCSACKAIAEQIADQALA0AgB0EYayIHIAkgAigCABECAEUNAAsgBiAHSQ0ACwsgACAIRwRAIAAgCCkDEDcDECAAIAgpAwg3AwggACAIKQMANwMACyAIIAkpAxA3AxAgCCAJKQMINwMIIAggCSkDADcDACAFIAo6AAwgBSAINgIIIAlBMGokACAFKAIIIQgCQCAFLQAMQQFHDQAgACAIIAIQsAMhByAIQRhqIgYgASACELADBEAgCCEBIAdFDQMMAgsgB0UNACAGIQAMAgsgACAIIAIgAyALELcDIAhBGGohAEEAIQQMAQsLIAVBIGokAAubFgIOfwZ+IwBBMGsiBiQAIAZCADcDECAGQgA3AwggASgCMCEDIAEoAlQiAikDCCEQAkAgASgCWC0ACCIOQQFGBEAgA0EASgRAA0AgAiIDKAIQIgIpAwggEFINAyADLQAYQQZxRQ0ADAMLAAsDQCACIgMoAhQiAikDCCAQUg0CIAMtABhBBnFFDQALDAELIANBAEoEQANAIAIiAygCECICKQMIIBBRDQAMAgsACwNAIAIiAygCFCICKQMIIBBRDQALCyADKAIYQR10QR91IANxIQkgASkDICEQAn4CQCABKQMQIhIgASkDAFEEQCABIQIDQCACKAJEIgJBAEchAyACRQ0CIAIoAlQgCUcNAAsMAQsgECASIBAgElUbIRUgECASIBAgElMiAxsMAQsgECEVIBALIRICQAJAIAEoAjxFDQAgBiABKQMINwMgIAYgEDcDGCABIAZBGGoQYyIHKAIYLQBMDQACQCAAKAJgIgIgACgCZCIFSQRAIAJBAToACCACQQA2AgQgAiAHNgIAIAJBDGohBQwBCyACIABB3ABqIgQoAgAiCmtBDG0iDEEBaiICQdaq1aoBTw0CIAZBGGpB1arVqgEgBSAKa0EMbSIFQQF0IgogAiACIApJGyAFQarVqtUATxsgDCAEEGEiAigCCCIFQQE6AAggBUEANgIEIAUgBzYCACACIAVBDGo2AgggAigCBCAAKAJgIAAoAlwiB2siBUF0bUEMbGohBCAFBEAgBCAHIAX8CgAACyAAKAJcIQcgACAENgJcIAIgBzYCBCAAIAIoAggiBTYCYCACIAc2AgggACgCZCEEIAAgAigCDDYCZCACIAc2AgAgAiAENgIMIAIQ1gELIAAgBTYCYAsgAUEQaiEHIABB3ABqIQogAUFAayEMIAFBxABqIQ0DQAJAAkACQCANIAwgAxsoAgAiAkUNAANAIAkgAigCVEYEQAJAIAEoAjxFDQAgAigCYARAIAAgAiACQRBqEH4gASgCPEUNAQsgCSABKAJURwRAA0AgASAHEGMaIAAgARD+ASABKAJUIAlHDQALCyADBEAgACABIAIgBxCGAQwBCyAAIAIgASAHEIYBCwJAIAIoAkQiAyACKAJAIgVyRQRAIAIgACgCHCIHRw0BCwJAIAUEQCAFIAM2AkQMAQsgACADNgIcCyADBEAgAyAFNgJACyACECIgACgCHCEHCyABKAJEIgIgASgCQCIDckUgASAHR3ENAwJAIAMEQCADIAI2AkQMAQsgACACNgIcCyACBEAgAiADNgJACyABECIMAwsCfwJAAkACQAJAIAkgASgCVCIERw0AIAQtABhBA3ENACACKQMgIRQMAQsgAikDICEUAkAgAwRAIBQgFVcNAQwHCyASIBRVDQYLIBQgBykDAFINACACKQMYIhEgAikDCFENACACQSBqIQUgBiAEQRBBFCABKAIwQQBKG2ooAgAiBCkDCDcDECAGIAQpAwA3AwggAigCWCIELQAIIQgCQCADBEACQCAIQQFxRQ0AIAQoAgQgASgCWCgCBEYNACACKAI8DQAgAikDECEQAkAgBikDECITIBFRDQAgECACKQMAIhFRDQAgAikDCCIQIBNRBEAgESEQDAELIBEgAisDKCATIBB9uaKe/AZ8IRALIBAgBikDCFUNCAwCCyACKQMQIRACQCAGKQMQIhMgEVENACAQIAIpAwAiEVENACACKQMIIhAgE1EEQCARIRAMAQsgESACKwMoIBMgEH25op78BnwhEAsgECAGKQMIUw0BDAcLAkACQCAIQQFxRQ0AIAQoAgQgASgCWCgCBEYNACACKAI8DQAgAikDECEQAkAgBikDECITIBFRDQAgECACKQMAIhFRDQAgAikDCCIQIBNRBEAgESEQDAELIBEgAisDKCATIBB9uaKe/AZ8IRALIBAgBikDCFkNAQwICyACKQMQIRACQCAGKQMQIhMgEVENACAQIAIpAwAiEVENACACKQMIIhAgE1EEQCARIRAMAQsgESACKwMoIBMgEH25op78BnwhEAsgECAGKQMIVw0HCyAGIAEpAwg3AxAgBiAUNwMIDAMLIAYgASkDCDcDECAGIBQ3AwgMAQsgBiABKQMINwMQIAYgFDcDCCACQSBqIQUgA0UNAQsgACABIAIgBkEIahDcASACKAJEIgQEQCAEIAE2AkALIAwoAgAiCARAIAggAjYCRAsgAiABNgJEIAIgCDYCQCABIAQ2AkQgASACNgJAIAIoAkBFBEAgACACNgIcCyAAIAIgBkEIakEAEIECIA0MAQsgACACIAEgBkEIahDcASABKAJEIgQEQCAEIAI2AkALIAIoAkAiCARAIAggATYCRAsgASACNgJEIAEgCDYCQCACIAQ2AkQgAiABNgJAIAEoAkBFBEAgACABNgIcCyAAIAIgBkEIakEAEIACIAwLIAEgBSkDADcDICgCACECAkAgASgCPCIERQ0AIAQoAhAhBSAEKAIIIAFHBEAgBSgCECEFCyAFKAIYLQBMDQACQCAAKAJgIgQgACgCZCIISQRAIARBAToACCAEQQA2AgQgBCAFNgIAIARBDGohBQwBCyAEIAooAgAiC2tBDG0iD0EBaiIEQdaq1aoBTw0HIAZBGGpB1arVqgEgCCALa0EMbSIIQQF0IgsgBCAEIAtJGyAIQarVqtUATxsgDyAKEGEhCCAGKAIgIgRBAToACCAEQQA2AgQgBCAFNgIAIAYgBEEMajYCICAGKAIcIAAoAmAgACgCXCIEayIFQXRtQQxsaiELIAUEQCALIAQgBfwKAAALIAAoAlwhBCAAIAs2AlwgBiAENgIcIAAgBigCICIFNgJgIAYgBDYCICAAKAJkIQsgACAGKAIkNgJkIAYgCzYCJCAIIAQ2AgAgCBDWAQsgACAFNgJgCyACDQALCyABKAJUIQICQCAORQ0AIAItABhBA3FFDQAgASgCPARAIAEgBxBjGgJAIAEoAjwiAigCCCABRgRAIAJBADYCCAwBCyACQQA2AgwLIAFBADYCPAsgASgCRCICIAEoAkAiA3JFBEAgASAAKAIcRw0CCwJAIAMEQCADIAI2AkQMAQsgACACNgIcCyACBEAgAiADNgJACyABECIMAQsgASgCPCEDIAJBEEEUIAEoAjBBAEobaigCACkDCCABKQMYUQRAIAMEQCABIAcQYxoLIAAgARD+ASABKQMgIRIgASICKQMQIhAgAikDAFEEQANAIAIoAkQiAkEARyEDIAJFDQQgAigCVCAJRw0ADAQLAAsgEiAQIBAgElMbIRUgEiAQIBAgElUiAxshEgwDCwJAIANFDQAgASAHEGMiBSgCGC0ATA0AAkAgACgCYCICIAAoAmQiA0kEQCACQQE6AAggAkEANgIEIAIgBTYCACACQQxqIQMMAQsgAiAKKAIAIgdrQQxtIglBAWoiAkHWqtWqAU8NBSAGQRhqQdWq1aoBIAMgB2tBDG0iA0EBdCIHIAIgAiAHSRsgA0Gq1arVAE8bIAkgChBhIgIoAggiA0EBOgAIIANBADYCBCADIAU2AgAgAiADQQxqNgIIIAIoAgQgACgCYCAAKAJcIgVrIgNBdG1BDGxqIQcgAwRAIAcgBSAD/AoAAAsgACgCXCEFIAAgBzYCXCACIAU2AgQgACACKAIIIgM2AmAgAiAFNgIIIAAoAmQhByAAIAIoAgw2AmQgAiAFNgIAIAIgBzYCDCACENYBCyAAIAM2AmALIAAgARD+AQsgBkEwaiQADwsgEiEVDAALAAsQJgALzQUCDH8DfiAAKAJAIgUgACgCRCIJRwRAIAEgBSkDACIQNwMAAkAgCSAFa0EDdSILQQJIDQAgC0ECa0EBdiEKIAUhAwNAIARBAXQiCEEBciEGIAMgBEEDdGoiB0EIaiECIAMCfiALIAhBAmoiBEwEQCAGIQQgAikDAAwBCyAEIAYgAikDACIOIAdBEGoiBykDACIPUyIGGyEEIAcgAiAGGyECIA4gDyAOIA9VGws3AwAgAiEDIAQgCkwNAAsgCUEIayIDIAJGBEAgAiAQNwMADAELIAIgAykDADcDACADIBA3AwAgAiAFa0EIakEDdSIDQQJIDQAgBSADQQJrQQF2IgRBA3RqIgMpAwAiDiACKQMAIg9ZDQADQAJAIAMhBiACIA43AwAgBEUNACADIQIgBSAEQQFrQQF2IgRBA3RqIgMpAwAiDiAPUw0BCwsgBiAPNwMACwJAIAUgCUEIayICRg0AIAkhBgNAIAYhByACIQYgASkDACIQIAUpAwBSDQECQCACIAVrQQN1IgxBAkgNACAMQQJrQQF2IQ1BACEEIAUhAwNAIARBAXQiC0EBciEIIAMgBEEDdGoiCkEIaiECIAMCfiAMIAtBAmoiBEwEQCAIIQQgAikDAAwBCyAEIAggAikDACIOIApBEGoiCikDACIPUyIIGyEEIAogAiAIGyECIA4gDyAOIA9VGws3AwAgAiEDIAQgDUwNAAsgB0EQayIDIAJGBEAgAiAQNwMADAELIAIgAykDADcDACADIBA3AwAgAiAFa0EIakEDdSIDQQJIDQAgBSADQQJrQQF2IgRBA3RqIgMpAwAiDiACKQMAIg9ZDQADQAJAIAMhByACIA43AwAgBEUNACADIQIgBSAEQQFrQQF2IgRBA3RqIgMpAwAiDiAPUw0BCwsgByAPNwMACyAFIAZBCGsiAkcNAAsLIAAgAjYCRAsgBSAJRwuuBAILfwZ+QQIhCgJAIAEoAgQiAyABKAIAIgdrQSFJDQACQCAHIgQgA0YNACAAKQMIIQ8DQCAEKQMIIA9SDQEgBEEQaiIEIANHDQALCyADIARGDQAgBCkDCCIRIAApAwgiD1MhCCADIQkgDyEOIAQhAgNAIAJBEGohAiAAKQMAIQ0gCEEBcSEMAkACQAJAAkADQAJAAkAgAiADRwRAIAIhBgwBCyAEIAdGDQEgByEGIAIgBCIDRg0BCwJAIAxFBEAgBiICIANGDQEDQCACKQMIIA5XDQIgAkEQaiICIANHDQALDAELAkAgBiICIANGDQADQCACKQMIIA5ZDQEgAkEQaiICIANHDQALCwsgAiADRg0BIAkgAiACIAdGGyIGQRBrIQsgAikDACEQIAIpAwggDlINAkEAIQogDSAQUQ0HIAZBCGspAwAgDlEEQCANIAspAwBTIA0gEFlGDQgLIAJBEGoiAiAERw0BCwtBAUECIAhBAXEgDyARVUcEfyAJIAkgAiACIAdGGyACIAlGIgEbQRBrIAcgAiABGyAAEIcBIgBFDQJBASAFayAFIAggAEEATnNBAXEbBSAFCxshCgwFCyANIBBTIAspAwAiEiANVXENAiANIBBXIA0gEldyRQRAQQEgBWshBQwDCyALIAIgABCHASIGDQELQQAPC0EBIAVrIAUgCCAGQQBOc0EBcRshBSABKAIEIQkgACkDCCEOCyAIQQFzIQgMAAsACyAKC7UFAgd/An4jAEEgayIHJAAgAEEANgIIIABCADcCAAJAIAEiAiACKAIQIgNGDQAgAikDACEJA0ACQCADKQMAIgogCVEEQCAJIAIoAhQpAwBRDQELIAIpAwgiCSADKQMIUg0CIAkgAigCFCkDCFINAgsgCiEJIAMiAigCECIDIAFHDQALCyAHQQxqQQFBACAAEDIiBCgCCCIDIAIpAwg3AwggAyACKQMANwMAIAQgBCgCCEEQajYCCCAEKAIEIAAoAgQgACgCACIDayIFayEGIAUEQCAGIAMgBfwKAAALIAAoAgAhBSAAIAY2AgAgBCAFNgIEIAAgBCgCCCIINgIEIAQgBTYCCCAAKAIIIQMgACAEKAIMNgIIIAQgBTYCACAEIAM2AgwgBBA2IAAgCDYCBAJAIAEgAigCECIGRwRAA0ACQCAGIgMpAwAiCiADKAIQIgYpAwBRBEAgCiACKQMAUQ0BCyADKQMIIgogBikDCFEEQCAKIAIpAwhRDQELAkAgACgCCCIGIAhLBEAgCCADKQMINwMIIAggAykDADcDACAIQRBqIQgMAQsgCCAAKAIAIgJrQQR1IgVBAWoiBEGAgICAAU8NBCAHQQxqQf////8AIAYgAmsiBkEDdSICIAQgAiAESxsgBkHw////B08bIAUgABAyIQQgBygCFCICIAMpAwg3AwggAiADKQMANwMAIAcgBygCFEEQajYCFCAHKAIQIAAoAgQgACgCACICayIFayEGIAUEQCAGIAIgBfwKAAALIAAoAgAhBSAAIAY2AgAgByAFNgIQIAAgBygCFCIINgIEIAcgBTYCFCAAKAIIIQIgACAHKAIYNgIIIAcgAjYCGCAEIAU2AgAgBBA2CyAAIAg2AgQgAygCECEGIAMhAgsgASAGRw0ACwsgB0EgaiQADwsQJgALcAIEfgN8IAIpAwghBCABKQMIIQMCfCACKQMAIgYgASkDACIFUQRARAAAAAAAAAAAIAMgBFENARoLIAApAwAgBX25IAQgA325IgeiIAYgBX25IgggACkDCCADfbmioSIJIAmiIAggCKIgByAHoqCjCws+AQJ/IAAoAgQiAiABRwRAA0AgAkEEayICKAIAIQMgAkEANgIAIAMEQCADECILIAEgAkcNAAsLIAAgATYCBAuhAwEEfyMAQSBrIgYkAAJAIAEoAhgiA0EIcUUEQCABIANBCHI2AhhBDBAjIgNBADoACCADIAI2AgQgAyABNgIAAkAgACgCBCIBIAAoAggiAkkEQCABIAM2AgAgAUEEaiEDDAELIAEgACgCACIEa0ECdSIFQQFqIgFBgICAgARPDQIgBkEMakH/////AyACIARrIgJBAXUiBCABIAEgBEkbIAJB/P///wdPGyAFIAAQSiIBKAIIIgIgAzYCACABIAJBBGo2AgggASgCBCAAKAIEIAAoAgAiBGsiAmshAyACBEAgAyAEIAL8CgAACyAAKAIAIQIgACADNgIAIAEgAjYCBCAAIAEoAggiAzYCBCABIAI2AgggACgCCCEEIAAgASgCDDYCCCABIAI2AgAgASAENgIMIAEoAgQiBSABKAIIIgJHBEADQCABIAJBBGsiAjYCCCACKAIAIQQgAkEANgIAIAQEQCAEECIgASgCCCECCyACIAVHDQALCyABKAIAIgIEQCABKAIMGiACECILCyAAIAM2AgQLIAZBIGokAA8LECYAC3gBAn8gACgCPCICIAEoAjwiA0YEQCACIAIpAwhCIIk3AwgPCwJAIAJFDQAgAigCCCAARgRAIAIgATYCCAwBCyACIAE2AgwLAkAgA0UNACADKAIIIAFGBEAgAyAANgIIDAELIAMgADYCDAsgACADNgI8IAEgAjYCPAtqAQJ/IwBBEGsiBCQAIAIEQCADIAJBDGxqIQIDQCAEIAA2AgwgBCABEDwhBSADEEUgAyAFKAIANgIAIAMgBCgCBDYCBCADIAQoAgg2AgggAUEMaiEBIANBDGoiAyACRw0ACwsgBEEQaiQAC/wBAQR/IwBBEGsiByQAIAAoAgQiBiEEIAIgASAGIANraiIFSwRAIAUhAwNAIARBADYCCCAEQgA3AgAgBCADKAIANgIAIAQgAygCBDYCBCAEIAMoAgg2AgggA0EANgIIIANCADcCACAEQQxqIQQgA0EMaiIDIAJJDQALCyAAIAQ2AgQgBiEAIAEiAyAFIgZHBEADQCAAIgFBDGsiABBFIAAgBUEMayICKAIANgIAIAFBCGsgBUEIaygCADYCACABQQRrIAVBBGsiASgCADYCACABQQA2AgAgAkIANwIAIAIiBSADRw0ACwsgByAANgIMIAcgBjYCCCAHQRBqJAAL9QMBBn8jAEGQAWsiBCQAAkAgAkECSA0AIAJBAmtBAXYiCSADIABrIgZBBHVIDQAgACAGQQN1IgZBAWoiB0EEdGohBSACIAZBAmoiBkoEQCABKAIAIQggBCAFKQMINwN4IAQgBSkDADcDcCAEIAUpAxA3A2AgBCAFKQMYNwNoIAYgByAEQfAAaiAEQeAAaiAIEQIAIgYbIQcgBUEQaiAFIAYbIQULIAEoAgAhBiAEIAUpAwg3A1ggBCAFKQMANwNQIAQgAykDADcDQCAEIAMpAwg3A0ggBEHQAGogBEFAayAGEQIADQAgBCADKQMINwOIASAEIAMpAwA3A4ABA0ACQCADIAUiBikDCDcDCCADIAUpAwA3AwAgByAJSg0AIAAgB0EBdCIDQQFyIgdBBHRqIQUgAiADQQJqIgNKBEAgASgCACEIIAQgBSkDCDcDOCAEIAUpAwA3AzAgBCAFKQMQNwMgIAQgBSkDGDcDKCADIAcgBEEwaiAEQSBqIAgRAgAiAxshByAFQRBqIAUgAxshBQsgASgCACEIIAQgBSkDCDcDGCAEIAUpAwA3AxAgBCAEKQOAATcDACAEIAQpA4gBNwMIIAYhAyAEQRBqIAQgCBECAEUNAQsLIAYgBCkDiAE3AwggBiAEKQOAATcDAAsgBEGQAWokAAv8FQEHfyMAQeAEayIDJABBASEGAkACQAJAAkACQAJAIAEgAGtBBHUOBgUFAAECAwQLIAIoAgAhAiADIAFBEGsiASkDCDcD2AEgAyABKQMANwPQASADIAApAwA3A8ABIAMgACkDCDcDyAEgA0HQAWogA0HAAWogAhECAEUNBCADIAApAwg3A9gEIAMgACkDADcD0AQgACABKQMINwMIIAAgASkDADcDACABIAMpA9gENwMIIAEgAykD0AQ3AwAMBAsgAigCACEEIAMgACkDGDcD2AIgAyAAKQMQNwPQAiADIAApAwA3A8ACIAMgACkDCDcDyAIgA0HQAmogA0HAAmogBBECACACKAIAIQQgAyABQRBrIgEpAwg3A7gCIAMgASkDADcDsAIgAyAAKQMQNwOgAiADIAApAxg3A6gCIANBsAJqIANBoAJqIAQRAgAhBEUEQCAERQ0EIAMgACkDGDcD2AQgAyAAKQMQNwPQBCAAIAEpAwg3AxggACABKQMANwMQIAEgAykD2AQ3AwggASADKQPQBDcDACACKAIAIQEgAyAAKQMYNwOYAiADIAApAxA3A5ACIAMgACkDADcDgAIgAyAAKQMINwOIAiADQZACaiADQYACaiABEQIARQ0EIAMgACkDCDcD2AQgAyAAKQMANwPQBCAAIAApAxg3AwggACAAKQMQNwMAIAAgAykD2AQ3AxggACADKQPQBDcDEAwECyAEBEAgAyAAKQMINwPYBCADIAApAwA3A9AEIAAgASkDCDcDCCAAIAEpAwA3AwAgASADKQPYBDcDCCABIAMpA9AENwMADAQLIAMgACkDCDcD2AQgAyAAKQMANwPQBCAAIAApAxg3AwggACAAKQMQNwMAIAAgAykD2AQ3AxggACADKQPQBDcDECACKAIAIQIgAyABKQMINwP4ASADIAEpAwA3A/ABIAMgACkDEDcD4AEgAyAAKQMYNwPoASADQfABaiADQeABaiACEQIARQ0DIAMgACkDGDcD2AQgAyAAKQMQNwPQBCAAIAEpAwg3AxggACABKQMANwMQIAEgAykD2AQ3AwggASADKQPQBDcDAAwDCyACKAIAIQQgAyAAKQMYNwO4BCADIAApAxA3A7AEIAMgACkDADcDoAQgAyAAKQMINwOoBCADQbAEaiADQaAEaiAEEQIAIQUgAigCACEEIAMgACkDKDcDmAQgAyAAKQMgNwOQBCADIAApAxA3A4AEIAMgACkDGDcDiAQgAUEQayEBIANBkARqIANBgARqIAQRAgAhBAJAIAVFBEAgBEUNASADIAApAxg3A9gEIAMgACkDEDcD0AQgACAAKQMoNwMYIAAgACkDIDcDECAAIAMpA9gENwMoIAAgAykD0AQ3AyAgAigCACEEIAMgACkDGDcD+AMgAyAAKQMQNwPwAyADIAApAwA3A+ADIAMgACkDCDcD6AMgA0HwA2ogA0HgA2ogBBECAEUNASADIAApAwg3A9gEIAMgACkDADcD0AQgACAAKQMYNwMIIAAgACkDEDcDACAAIAMpA9gENwMYIAAgAykD0AQ3AxAMAQsgBARAIAMgACkDCDcD2AQgAyAAKQMANwPQBCAAIAApAyg3AwggACAAKQMgNwMAIAAgAykD2AQ3AyggACADKQPQBDcDIAwBCyADIAApAwg3A9gEIAMgACkDADcD0AQgACAAKQMYNwMIIAAgACkDEDcDACAAIAMpA9gENwMYIAAgAykD0AQ3AxAgAigCACEEIAMgACkDKDcD2AMgAyAAKQMgNwPQAyADIAApAxA3A8ADIAMgACkDGDcDyAMgA0HQA2ogA0HAA2ogBBECAEUNACADIAApAxg3A9gEIAMgACkDEDcD0AQgACAAKQMoNwMYIAAgACkDIDcDECAAIAMpA9gENwMoIAAgAykD0AQ3AyALIAIoAgAhBCADIAEpAwg3A7gDIAMgASkDADcDsAMgAyAAKQMgNwOgAyADIAApAyg3A6gDIANBsANqIANBoANqIAQRAgBFDQIgAyAAKQMoNwPYBCADIAApAyA3A9AEIAAgASkDCDcDKCAAIAEpAwA3AyAgASADKQPYBDcDCCABIAMpA9AENwMAIAIoAgAhASADIAApAyg3A5gDIAMgACkDIDcDkAMgAyAAKQMQNwOAAyADIAApAxg3A4gDIANBkANqIANBgANqIAERAgBFDQIgAyAAKQMYNwPYBCADIAApAxA3A9AEIAAgACkDKDcDGCAAIAApAyA3AxAgACADKQPYBDcDKCAAIAMpA9AENwMgIAIoAgAhASADIAApAxg3A/gCIAMgACkDEDcD8AIgAyAAKQMANwPgAiADIAApAwg3A+gCIANB8AJqIANB4AJqIAERAgBFDQIgAyAAKQMINwPYBCADIAApAwA3A9AEIAAgACkDGDcDCCAAIAApAxA3AwAgACADKQPYBDcDGCAAIAMpA9AENwMQDAILIAAgAEEQaiAAQSBqIABBMGogAUEQayACEMQDDAELIAIoAgAhBCADIAApAxg3A7gBIAMgACkDEDcDsAEgAyAAKQMANwOgASADIAApAwg3A6gBIANBsAFqIANBoAFqIAQRAgAhByACKAIAIQUgAyAAKQMoNwOYASADIAApAyA3A5ABIAMgACkDEDcDgAEgAyAAKQMYNwOIASAAQSBqIQQgA0GQAWogA0GAAWogBRECACEFAkAgB0UEQCAFRQ0BIAMgACkDGDcD2AQgAyAAKQMQNwPQBCAAIAQpAwg3AxggACAEKQMANwMQIAQgAykD2AQ3AwggBCADKQPQBDcDACACKAIAIQUgAyAAKQMYNwN4IAMgACkDEDcDcCADIAApAwA3A2AgAyAAKQMINwNoIANB8ABqIANB4ABqIAURAgBFDQEgAyAAKQMINwPYBCADIAApAwA3A9AEIAAgACkDGDcDCCAAIAApAxA3AwAgACADKQPYBDcDGCAAIAMpA9AENwMQDAELIAUEQCADIAApAwg3A9gEIAMgACkDADcD0AQgACAEKQMINwMIIAAgBCkDADcDACAEIAMpA9gENwMIIAQgAykD0AQ3AwAMAQsgAyAAKQMINwPYBCADIAApAwA3A9AEIAAgACkDGDcDCCAAIAApAxA3AwAgACADKQPYBDcDGCAAIAMpA9AENwMQIAIoAgAhBSADIAQpAwg3A1ggAyAEKQMANwNQIAMgACkDEDcDQCADIAApAxg3A0ggA0HQAGogA0FAayAFEQIARQ0AIAMgACkDGDcD2AQgAyAAKQMQNwPQBCAAIAQpAwg3AxggACAEKQMANwMQIAQgAykD2AQ3AwggBCADKQPQBDcDAAsgAEEwaiIFIAFGDQADQCACKAIAIQYgAyAFKQMINwM4IAMgBSkDADcDMCADIAQpAwA3AyAgAyAEKQMINwMoAkAgA0EwaiADQSBqIAYRAgBFDQAgAyAFKQMINwPIBCADIAUpAwA3A8AEIAUhBwNAAkAgByAEIgYpAwg3AwggByAEKQMANwMAIAAgBEYEQCAAIQYMAQsgAigCACEJIAMgAykDyAQ3AxggAyADKQPABDcDECADIAZBEGsiBCkDADcDACADIAQpAwg3AwggBiEHIANBEGogAyAJEQIADQELCyAGIAMpA8gENwMIIAYgAykDwAQ3AwAgCEEBaiIIQQhHDQAgBUEQaiABRiEGDAILIAUiBEEQaiIGIQUgASAGRw0AC0EBIQYLIANB4ARqJAAgBgumDAEDfyMAQfACayIGJAAgBSgCACEHIAYgASkDCDcD2AIgBiABKQMANwPQAiAGIAApAwA3A8ACIAYgACkDCDcDyAIgBkHQAmogBkHAAmogBxECACEIIAUoAgAhByAGIAIpAwg3A7gCIAYgAikDADcDsAIgBiABKQMANwOgAiAGIAEpAwg3A6gCIAZBsAJqIAZBoAJqIAcRAgAhBwJAIAhFBEAgB0UNASAGIAEpAwg3A+gCIAYgASkDADcD4AIgASACKQMINwMIIAEgAikDADcDACACIAYpA+gCNwMIIAIgBikD4AI3AwAgBSgCACEHIAYgASkDCDcDmAIgBiABKQMANwOQAiAGIAApAwA3A4ACIAYgACkDCDcDiAIgBkGQAmogBkGAAmogBxECAEUNASAGIAApAwg3A+gCIAYgACkDADcD4AIgACABKQMINwMIIAAgASkDADcDACABIAYpA+gCNwMIIAEgBikD4AI3AwAMAQsgBwRAIAYgACkDCDcD6AIgBiAAKQMANwPgAiAAIAIpAwg3AwggACACKQMANwMAIAIgBikD6AI3AwggAiAGKQPgAjcDAAwBCyAGIAApAwg3A+gCIAYgACkDADcD4AIgACABKQMINwMIIAAgASkDADcDACABIAYpA+gCNwMIIAEgBikD4AI3AwAgBSgCACEHIAYgAikDCDcD+AEgBiACKQMANwPwASAGIAEpAwA3A+ABIAYgASkDCDcD6AEgBkHwAWogBkHgAWogBxECAEUNACAGIAEpAwg3A+gCIAYgASkDADcD4AIgASACKQMINwMIIAEgAikDADcDACACIAYpA+gCNwMIIAIgBikD4AI3AwALIAUoAgAhByAGIAMpAwg3A9gBIAYgAykDADcD0AEgBiACKQMANwPAASAGIAIpAwg3A8gBAkAgBkHQAWogBkHAAWogBxECAEUNACAGIAIpAwg3A+gCIAYgAikDADcD4AIgAiADKQMINwMIIAIgAykDADcDACADIAYpA+gCNwMIIAMgBikD4AI3AwAgBSgCACEHIAYgAikDCDcDuAEgBiACKQMANwOwASAGIAEpAwA3A6ABIAYgASkDCDcDqAEgBkGwAWogBkGgAWogBxECAEUNACAGIAEpAwg3A+gCIAYgASkDADcD4AIgASACKQMINwMIIAEgAikDADcDACACIAYpA+gCNwMIIAIgBikD4AI3AwAgBSgCACEHIAYgASkDCDcDmAEgBiABKQMANwOQASAGIAApAwA3A4ABIAYgACkDCDcDiAEgBkGQAWogBkGAAWogBxECAEUNACAGIAApAwg3A+gCIAYgACkDADcD4AIgACABKQMINwMIIAAgASkDADcDACABIAYpA+gCNwMIIAEgBikD4AI3AwALIAUoAgAhByAGIAQpAwg3A3ggBiAEKQMANwNwIAYgAykDADcDYCAGIAMpAwg3A2gCQCAGQfAAaiAGQeAAaiAHEQIARQ0AIAYgAykDCDcD6AIgBiADKQMANwPgAiADIAQpAwg3AwggAyAEKQMANwMAIAQgBikD6AI3AwggBCAGKQPgAjcDACAFKAIAIQQgBiADKQMINwNYIAYgAykDADcDUCAGIAIpAwA3A0AgBiACKQMINwNIIAZB0ABqIAZBQGsgBBECAEUNACAGIAIpAwg3A+gCIAYgAikDADcD4AIgAiADKQMINwMIIAIgAykDADcDACADIAYpA+gCNwMIIAMgBikD4AI3AwAgBSgCACEDIAYgAikDCDcDOCAGIAIpAwA3AzAgBiABKQMANwMgIAYgASkDCDcDKCAGQTBqIAZBIGogAxECAEUNACAGIAEpAwg3A+gCIAYgASkDADcD4AIgASACKQMINwMIIAEgAikDADcDACACIAYpA+gCNwMIIAIgBikD4AI3AwAgBSgCACECIAYgASkDCDcDGCAGIAEpAwA3AxAgBiAAKQMANwMAIAYgACkDCDcDCCAGQRBqIAYgAhECAEUNACAGIAApAwg3A+gCIAYgACkDADcD4AIgACABKQMINwMIIAAgASkDADcDACABIAYpA+gCNwMIIAEgBikD4AI3AwALIAZB8AJqJAALCAAgABBpECILhAMCBX8BfCMAQUBqIgIkACAAQQA2AgggAEIANwIAIAJBCGogARBNIAJBADYCPCACQgA3AjQgAkE0aiACKAIIIgEoAgAiAyABKAIEIgEgASADa0EMbRBHAkAgAigCDCIBRQ0AIAEgASgCBCIDQQFrNgIEIAMNACABIAEoAgAoAggRAAAgARAkCyAAIAIoAjggAigCNGtBDG0QViACKAI0IgMgAigCOCIFRwRAA0AgAkEoaiADEDwhBCACQQA2AiQgAkIANwIcIAJBHGogAigCLCAEKAIAa0EEdRBcIAQoAgAiASACKAIsIgZHBEADQCABKwMAIQcgAiABKwMIOQMQIAIgBzkDCCACQRxqIAJBCGoQTCABQRBqIgEgBkcNAAsLIAAgAkEcahB2IAIoAhwiAQRAIAIgATYCICACKAIkGiABECILIAQoAgAiAQRAIAIgATYCLCACKAIwGiABECILIANBDGoiAyAFRw0ACwsgAiACQTRqNgIIIAJBCGoQKSACQUBrJAAL5QECBXwDf0T////////vfyEFRP///////+//IQYCQCABKAIAIgcgASgCBCIIRgRARP///////+//IQNE////////738hBAwBC0T////////vfyEERP///////+//IQMDQCAHKAIAIgEgBygCBCIJRwRAA0AgASsDCCICIAMgAiADZBshAyACIAQgAiAEYxshBCABKwMAIgIgBiACIAZkGyEGIAIgBSACIAVjGyEFIAFBEGoiASAJRw0ACwsgB0EMaiIHIAhHDQALCyAAIAM5AxggACAGOQMQIAAgBDkDCCAAIAU5AwAL1QECB3wDfwJAIAEoAgQiCSABKAIAIgprIgtBEUkNACAAKwMIIQcgACsDACEIA0AgCiALaiIAQRBrKwMAIABBIGsrAwAiAqEiAyAHIABBGGsrAwAiBKEiBaIgAEEIaysDACAEoSIEIAggAqEiAqKhIgZEAAAAAAAAAABkBEAgAiACoiAFIAWioCIFIAMgA6IgBCAEoqAiAyADIAVjG0QAAAAAAAAAAKKZIAYgBqJEAAAAAAAAEECiZkUNAgsgASAJQRBrIgk2AgQgCSAKayILQRBLDQALCwuRPwIKfwJ+IwBB0AhrIgUkAANAIAFBMGshCiABQSBrIQsgAUEQayEJAkADQAJAAkACQAJAAkAgASAAa0EEdSIIDgYGBgABAgMECyABQRBrIgEpAwghDyACKAIAIQIgBSABKQMAIhA3A7AFIAUgDzcDuAggBSAQNwOwCCAFIA83A7gFIAUgACkDADcDoAUgBSAAKQMINwOoBSAFQbAFaiAFQaAFaiACEQIARQ0FIAUgACkDCDcDyAggBSAAKQMANwPACCAAIAEpAwg3AwggACABKQMANwMAIAEgBSkDyAg3AwggASAFKQPACDcDAAwFCyACKAIAIQMgBSAAKQMYNwO4BiAFIAApAxA3A7AGIAUgACkDADcDoAYgBSAAKQMINwOoBiAFQbAGaiAFQaAGaiADEQIAIAIoAgAhAyAFIAFBEGsiASkDCDcDmAYgBSABKQMANwOQBiAFIAApAxA3A4AGIAUgACkDGDcDiAYgBUGQBmogBUGABmogAxECACEDRQRAIANFDQUgBSAAKQMYNwPICCAFIAApAxA3A8AIIAAgASkDCDcDGCAAIAEpAwA3AxAgASAFKQPICDcDCCABIAUpA8AINwMAIAIoAgAhASAFIAApAxg3A/gFIAUgACkDEDcD8AUgBSAAKQMANwPgBSAFIAApAwg3A+gFIAVB8AVqIAVB4AVqIAERAgBFDQUgBSAAKQMINwPICCAFIAApAwA3A8AIIAAgACkDGDcDCCAAIAApAxA3AwAgACAFKQPICDcDGCAAIAUpA8AINwMQDAULIAMEQCAFIAApAwg3A8gIIAUgACkDADcDwAggACABKQMINwMIIAAgASkDADcDACABIAUpA8gINwMIIAEgBSkDwAg3AwAMBQsgBSAAKQMINwPICCAFIAApAwA3A8AIIAAgACkDGDcDCCAAIAApAxA3AwAgACAFKQPICDcDGCAAIAUpA8AINwMQIAIoAgAhAiAFIAEpAwg3A9gFIAUgASkDADcD0AUgBSAAKQMQNwPABSAFIAApAxg3A8gFIAVB0AVqIAVBwAVqIAIRAgBFDQQgBSAAKQMYNwPICCAFIAApAxA3A8AIIAAgASkDCDcDGCAAIAEpAwA3AxAgASAFKQPICDcDCCABIAUpA8AINwMADAQLIAIoAgAhAyAFIAApAxg3A5gIIAUgACkDEDcDkAggBSAAKQMANwOACCAFIAApAwg3A4gIIAVBkAhqIAVBgAhqIAMRAgAhBCACKAIAIQMgBSAAKQMoNwP4ByAFIAApAyA3A/AHIAUgACkDEDcD4AcgBSAAKQMYNwPoByABQRBrIQEgBUHwB2ogBUHgB2ogAxECACEDAkAgBEUEQCADRQ0BIAUgACkDGDcDyAggBSAAKQMQNwPACCAAIAApAyg3AxggACAAKQMgNwMQIAAgBSkDyAg3AyggACAFKQPACDcDICACKAIAIQMgBSAAKQMYNwPYByAFIAApAxA3A9AHIAUgACkDADcDwAcgBSAAKQMINwPIByAFQdAHaiAFQcAHaiADEQIARQ0BIAUgACkDCDcDyAggBSAAKQMANwPACCAAIAApAxg3AwggACAAKQMQNwMAIAAgBSkDyAg3AxggACAFKQPACDcDEAwBCyADBEAgBSAAKQMINwPICCAFIAApAwA3A8AIIAAgACkDKDcDCCAAIAApAyA3AwAgACAFKQPICDcDKCAAIAUpA8AINwMgDAELIAUgACkDCDcDyAggBSAAKQMANwPACCAAIAApAxg3AwggACAAKQMQNwMAIAAgBSkDyAg3AxggACAFKQPACDcDECACKAIAIQMgBSAAKQMoNwO4ByAFIAApAyA3A7AHIAUgACkDEDcDoAcgBSAAKQMYNwOoByAFQbAHaiAFQaAHaiADEQIARQ0AIAUgACkDGDcDyAggBSAAKQMQNwPACCAAIAApAyg3AxggACAAKQMgNwMQIAAgBSkDyAg3AyggACAFKQPACDcDIAsgAigCACEDIAUgASkDCDcDmAcgBSABKQMANwOQByAFIAApAyA3A4AHIAUgACkDKDcDiAcgBUGQB2ogBUGAB2ogAxECAEUNAyAFIAApAyg3A8gIIAUgACkDIDcDwAggACABKQMINwMoIAAgASkDADcDICABIAUpA8gINwMIIAEgBSkDwAg3AwAgAigCACEBIAUgACkDKDcD+AYgBSAAKQMgNwPwBiAFIAApAxA3A+AGIAUgACkDGDcD6AYgBUHwBmogBUHgBmogARECAEUNAyAFIAApAxg3A8gIIAUgACkDEDcDwAggACAAKQMoNwMYIAAgACkDIDcDECAAIAUpA8gINwMoIAAgBSkDwAg3AyAgAigCACEBIAUgACkDGDcD2AYgBSAAKQMQNwPQBiAFIAApAwA3A8AGIAUgACkDCDcDyAYgBUHQBmogBUHABmogARECAEUNAyAFIAApAwg3A8gIIAUgACkDADcDwAggACAAKQMYNwMIIAAgACkDEDcDACAAIAUpA8gINwMYIAAgBSkDwAg3AxAMAwsgACAAQRBqIABBIGogAEEwaiABQRBrIAIQxAMMAgsgCEEXTARAIARBAXEEQCACIQYjAEHQAGsiByQAAkAgACICIAEiCEYNACAAQRBqIgEgCEYNAANAIAYoAgAhBCAHIAEiAykDCDcDOCAHIAEpAwA3AzAgByAAKQMANwMgIAcgACkDCDcDKCAHQTBqIAdBIGogBBECAARAIAcgASkDCDcDSCAHIAEpAwA3A0AgASEEA0ACQCAEIAAiASkDCDcDCCAEIAApAwA3AwAgACACRgRAIAIhAQwBCyAGKAIAIQkgByAHKQNINwMYIAcgBykDQDcDECAHIAFBEGsiACkDADcDACAHIAApAwg3AwggASEEIAdBEGogByAJEQIADQELCyABIAcpA0g3AwggASAHKQNANwMACyADIgBBEGoiASAIRw0ACwsgB0HQAGokAAwDCyACIQMjAEHQAGsiCCQAAkAgASIEIABGDQAgASAAQRBqIgFGDQADQCADKAIAIQYgCCABIgIpAwg3AzggCCABKQMANwMwIAggACkDADcDICAIIAApAwg3AyggCEEwaiAIQSBqIAYRAgAEQCAIIAEpAwg3A0ggCCABKQMANwNAA0AgASIGIAAiASkDCDcDCCAGIAApAwA3AwAgAygCACEGIAggCCkDSDcDGCAIIAgpA0A3AxAgCCAAQRBrIgApAwg3AwggCCAAKQMANwMAIAhBEGogCCAGEQIADQALIAEgCCkDSDcDCCABIAgpA0A3AwALIAIiAEEQaiIBIARHDQALCyAIQdAAaiQADAILIANFBEAgACABRg0CIwBBMGsiCSQAIAEgACIDRwRAIAEgAGtBBHUiBkECTgRAIAZBAmtBAXYhAANAIAMgAiAGIAMgACIEQQR0ahDCAyAAQQFrIQAgBA0ACwsgASIAIABHBEADQCACKAIAIQQgCSAAKQMINwMYIAkgACkDADcDECAJIAMpAwA3AwAgCSADKQMINwMIIAlBEGogCSAEEQIABEAgCSAAKQMINwMoIAkgACkDADcDICAAIAMpAwg3AwggACADKQMANwMAIAMgCSkDKDcDCCADIAkpAyA3AwAgAyACIAYgAxDCAwsgAEEQaiIAIAFHDQALCyAGQQJOBEADQCAJIAMpAwg3AyggCSADKQMANwMgIAMhAEEAIQgjAEEwayIKJAAgBkECa0ECbSELA0AgCEEBdCIMQQFyIQcgACAIQQR0aiIIQRBqIQQCQCAGIAxBAmoiDEwEQCAHIQgMAQsgAigCACENIAQpAwghDyAKIAQpAwAiEDcDECAKIA83AyggCiAQNwMgIAogDzcDGCAKIAhBIGoiDikDADcDACAKIAgpAyg3AwggDCAHIApBEGogCiANEQIAIgcbIQggDiAEIAcbIQQLIAAgBCkDCDcDCCAAIAQpAwA3AwAgBCEAIAggC0wNAAsgCkEwaiQAAkAgAUEQayIBIABGBEAgACAJKQMoNwMIIAAgCSkDIDcDAAwBCyAAIAEpAwg3AwggACABKQMANwMAIAEgCSkDIDcDACABIAkpAyg3AwgjAEHQAGsiByQAAkAgAEEQaiIAIANrQQR1IgRBAkgNACACKAIAIQsgByADIARBAmtBAXYiCkEEdGoiCCkDCDcDOCAHIAgpAwA3AzAgByAAQRBrIgQpAwA3AyAgByAEKQMINwMoIAdBMGogB0EgaiALEQIARQ0AIAcgBCkDCDcDSCAHIAQpAwA3A0ADQAJAIAQgCCIAKQMINwMIIAQgACkDADcDACAKRQ0AIAIoAgAhCyAHIAMgCkEBa0EBdiIKQQR0aiIIKQMINwMYIAcgCCkDADcDECAHIAcpA0A3AwAgByAHKQNINwMIIAAhBCAHQRBqIAcgCxECAA0BCwsgACAHKQNINwMIIAAgBykDQDcDAAsgB0HQAGokAAsgBkECSiAGQQFrIQYNAAsLCyAJQTBqJAAMAgsgACAIQQN0QXBxaiEGIAIoAgAhBwJAIAhBgQFPBEAgBSAGKQMINwOYBCAFIAYpAwA3A5AEIAUgACkDADcDgAQgBSAAKQMINwOIBCAFQZAEaiAFQYAEaiAHEQIAIQcgAigCACEIIAUgCSkDCDcD+AMgBSAJKQMANwPwAyAFIAYpAwA3A+ADIAUgBikDCDcD6AMgBUHwA2ogBUHgA2ogCBECACEIAkAgB0UEQCAIRQ0BIAUgBikDCDcDyAggBSAGKQMANwPACCAGIAkpAwg3AwggBiAJKQMANwMAIAkgBSkDyAg3AwggCSAFKQPACDcDACACKAIAIQggBSAGKQMINwPYAyAFIAYpAwA3A9ADIAUgACkDADcDwAMgBSAAKQMINwPIAyAFQdADaiAFQcADaiAIEQIARQ0BIAUgACkDCDcDyAggBSAAKQMANwPACCAAIAYpAwg3AwggACAGKQMANwMAIAYgBSkDyAg3AwggBiAFKQPACDcDAAwBCyAIBEAgBSAAKQMINwPICCAFIAApAwA3A8AIIAAgCSkDCDcDCCAAIAkpAwA3AwAgCSAFKQPICDcDCCAJIAUpA8AINwMADAELIAUgACkDCDcDyAggBSAAKQMANwPACCAAIAYpAwg3AwggACAGKQMANwMAIAYgBSkDyAg3AwggBiAFKQPACDcDACACKAIAIQggBSAJKQMINwO4AyAFIAkpAwA3A7ADIAUgBikDADcDoAMgBSAGKQMINwOoAyAFQbADaiAFQaADaiAIEQIARQ0AIAUgBikDCDcDyAggBSAGKQMANwPACCAGIAkpAwg3AwggBiAJKQMANwMAIAkgBSkDyAg3AwggCSAFKQPACDcDAAsgAigCACEHIAUgBkEQayIIKQMINwOYAyAFIAgpAwA3A5ADIAUgACkDEDcDgAMgBSAAKQMYNwOIAyAFQZADaiAFQYADaiAHEQIAIQwgAigCACEHIAUgCykDCDcD+AIgBSALKQMANwPwAiAFIAgpAwA3A+ACIAUgCCkDCDcD6AIgBUHwAmogBUHgAmogBxECACEHAkAgDEUEQCAHRQ0BIAUgCCkDCDcDyAggBSAIKQMANwPACCAIIAspAwg3AwggCCALKQMANwMAIAsgBSkDyAg3AwggCyAFKQPACDcDACACKAIAIQcgBSAIKQMINwPYAiAFIAgpAwA3A9ACIAUgACkDEDcDwAIgBSAAKQMYNwPIAiAFQdACaiAFQcACaiAHEQIARQ0BIAUgACkDGDcDyAggBSAAKQMQNwPACCAAIAgpAwg3AxggACAIKQMANwMQIAggBSkDyAg3AwggCCAFKQPACDcDAAwBCyAHBEAgBSAAKQMYNwPICCAFIAApAxA3A8AIIAAgCykDCDcDGCAAIAspAwA3AxAgCyAFKQPICDcDCCALIAUpA8AINwMADAELIAUgACkDGDcDyAggBSAAKQMQNwPACCAAIAgpAwg3AxggACAIKQMANwMQIAggBSkDyAg3AwggCCAFKQPACDcDACACKAIAIQcgBSALKQMINwO4AiAFIAspAwA3A7ACIAUgCCkDADcDoAIgBSAIKQMINwOoAiAFQbACaiAFQaACaiAHEQIARQ0AIAUgCCkDCDcDyAggBSAIKQMANwPACCAIIAspAwg3AwggCCALKQMANwMAIAsgBSkDyAg3AwggCyAFKQPACDcDAAsgAigCACEHIAUgBikDGDcDmAIgBSAGKQMQNwOQAiAFIAApAyA3A4ACIAUgACkDKDcDiAIgBUGQAmogBUGAAmogBxECACEMIAIoAgAhByAFIAopAwg3A/gBIAUgCikDADcD8AEgBSAGKQMQNwPgASAFIAYpAxg3A+gBIAVB8AFqIAVB4AFqIAcRAgAhBwJAIAxFBEAgB0UNASAFIAYpAxg3A8gIIAUgBikDEDcDwAggBiAKKQMINwMYIAYgCikDADcDECAKIAUpA8gINwMIIAogBSkDwAg3AwAgAigCACEHIAUgBikDGDcD2AEgBSAGKQMQNwPQASAFIAApAyA3A8ABIAUgACkDKDcDyAEgBUHQAWogBUHAAWogBxECAEUNASAFIAApAyg3A8gIIAUgACkDIDcDwAggACAGKQMYNwMoIAAgBikDEDcDICAGIAUpA8gINwMYIAYgBSkDwAg3AxAMAQsgBwRAIAUgACkDKDcDyAggBSAAKQMgNwPACCAAIAopAwg3AyggACAKKQMANwMgIAogBSkDyAg3AwggCiAFKQPACDcDAAwBCyAFIAApAyg3A8gIIAUgACkDIDcDwAggACAGKQMYNwMoIAAgBikDEDcDICAGIAUpA8gINwMYIAYgBSkDwAg3AxAgAigCACEHIAUgCikDCDcDuAEgBSAKKQMANwOwASAFIAYpAxA3A6ABIAUgBikDGDcDqAEgBUGwAWogBUGgAWogBxECAEUNACAFIAYpAxg3A8gIIAUgBikDEDcDwAggBiAKKQMINwMYIAYgCikDADcDECAKIAUpA8gINwMIIAogBSkDwAg3AwALIAIoAgAhByAFIAYpAwg3A5gBIAUgBikDADcDkAEgBSAIKQMANwOAASAFIAgpAwg3A4gBIAVBkAFqIAVBgAFqIAcRAgAhDCACKAIAIQcgBSAGKQMYNwN4IAUgBikDEDcDcCAFIAYpAwA3A2AgBSAGKQMINwNoIAVB8ABqIAVB4ABqIAcRAgAhBwJAIAxFBEAgB0UNASAFIAYpAwg3A8gIIAUgBikDADcDwAggBiAGKQMYNwMIIAYgBikDEDcDACAGIAUpA8gINwMYIAYgBSkDwAg3AxAgAigCACEHIAUgBikDCDcDWCAFIAYpAwA3A1AgBSAIKQMANwNAIAUgCCkDCDcDSCAFQdAAaiAFQUBrIAcRAgBFDQEgBSAIKQMINwPICCAFIAgpAwA3A8AIIAggBikDCDcDCCAIIAYpAwA3AwAgBiAFKQPICDcDCCAGIAUpA8AINwMADAELIAcEQCAFIAgpAwg3A8gIIAUgCCkDADcDwAggCCAGKQMYNwMIIAggBikDEDcDACAGIAUpA8gINwMYIAYgBSkDwAg3AxAMAQsgBSAIKQMINwPICCAFIAgpAwA3A8AIIAggBikDCDcDCCAIIAYpAwA3AwAgBiAFKQPICDcDCCAGIAUpA8AINwMAIAIoAgAhCCAFIAYpAxg3AzggBSAGKQMQNwMwIAUgBikDADcDICAFIAYpAwg3AyggBUEwaiAFQSBqIAgRAgBFDQAgBSAGKQMINwPICCAFIAYpAwA3A8AIIAYgBikDGDcDCCAGIAYpAxA3AwAgBiAFKQPICDcDGCAGIAUpA8AINwMQCyAFIAApAwg3A8gIIAUgACkDADcDwAggACAGKQMINwMIIAAgBikDADcDACAGIAUpA8gINwMIIAYgBSkDwAg3AwAMAQsgBSAAKQMINwOYBSAFIAApAwA3A5AFIAUgBikDADcDgAUgBSAGKQMINwOIBSAFQZAFaiAFQYAFaiAHEQIAIAIoAgAhCCAFIAkpAwg3A/gEIAUgCSkDADcD8AQgBSAAKQMANwPgBCAFIAApAwg3A+gEIAVB8ARqIAVB4ARqIAgRAgAhCEUEQCAIRQ0BIAUgACkDCDcDyAggBSAAKQMANwPACCAAIAkpAwg3AwggACAJKQMANwMAIAkgBSkDyAg3AwggCSAFKQPACDcDACACKAIAIQggBSAAKQMINwPYBCAFIAApAwA3A9AEIAUgBikDADcDwAQgBSAGKQMINwPIBCAFQdAEaiAFQcAEaiAIEQIARQ0BIAUgBikDCDcDyAggBSAGKQMANwPACCAGIAApAwg3AwggBiAAKQMANwMAIAAgBSkDyAg3AwggACAFKQPACDcDAAwBCyAIBEAgBSAGKQMINwPICCAFIAYpAwA3A8AIIAYgCSkDCDcDCCAGIAkpAwA3AwAgCSAFKQPICDcDCCAJIAUpA8AINwMADAELIAUgBikDCDcDyAggBSAGKQMANwPACCAGIAApAwg3AwggBiAAKQMANwMAIAAgBSkDyAg3AwggACAFKQPACDcDACACKAIAIQYgBSAJKQMINwO4BCAFIAkpAwA3A7AEIAUgACkDADcDoAQgBSAAKQMINwOoBCAFQbAEaiAFQaAEaiAGEQIARQ0AIAUgACkDCDcDyAggBSAAKQMANwPACCAAIAkpAwg3AwggACAJKQMANwMAIAkgBSkDyAg3AwggCSAFKQPACDcDAAsgA0EBayEDAkAgBEEBcSIMDQAgAEEQayIGKQMIIQ8gAigCACEIIAUgBikDACIQNwMQIAUgDzcDqAggBSAQNwOgCCAFIA83AxggBSAAKQMANwMAIAUgACkDCDcDCCAFQRBqIAUgCBECAA0AQQAhBCMAQeABayIHJAAgByAAKQMINwPIASAHIAApAwA3A8ABIAIoAgAhBiAHIAApAwA3A7ABIAcgACkDCDcDuAEgByABIghBEGsiDCkDCDcDqAEgByAMKQMANwOgAQJAIAdBsAFqIAdBoAFqIAYRAgAEQCAAIQYDQCACKAIAIQwgByAHKQPIATcDeCAHIAcpA8ABNwNwIAcgBikDEDcDYCAHIAYpAxg3A2ggBkEQaiEGIAdB8ABqIAdB4ABqIAwRAgBFDQALDAELIAAhBgNAIAZBEGoiBiAITw0BIAIoAgAhDCAHIAcpA8gBNwOYASAHIAcpA8ABNwOQASAHIAYpAwA3A4ABIAcgBikDCDcDiAEgB0GQAWogB0GAAWogDBECAEUNAAsLIAYgCEkEQANAIAIoAgAhDCAHIAcpA8gBNwNYIAcgBykDwAE3A1AgByAIQRBrIggpAwA3A0AgByAIKQMINwNIIAdB0ABqIAdBQGsgDBECAA0ACwsgBiAISQRAA0AgByAGKQMINwPYASAHIAYpAwA3A9ABIAYgCCkDCDcDCCAGIAgpAwA3AwAgCCAHKQPYATcDCCAIIAcpA9ABNwMAA0AgAigCACEMIAcgBykDyAE3AzggByAHKQPAATcDMCAHIAYpAxA3AyAgByAGKQMYNwMoIAZBEGohBiAHQTBqIAdBIGogDBECAEUNAAsDQCACKAIAIQwgByAHKQPIATcDGCAHIAcpA8ABNwMQIAcgCEEQayIIKQMANwMAIAcgCCkDCDcDCCAHQRBqIAcgDBECAA0ACyAGIAhJDQALCyAGQRBrIgggAEcEQCAAIAgpAwg3AwggACAIKQMANwMACyAIIAcpA8gBNwMIIAggBykDwAE3AwAgB0HgAWokACAGIQAMAQsLIAEhByMAQcABayIJJAAgCSAAKQMINwOoASAJIAApAwA3A6ABIAAhBgNAIAIoAgAhCiAJIAYiCCkDGDcDmAEgCSAGKQMQNwOQASAJIAkpA6ABNwOAASAJIAkpA6gBNwOIASAGQRBqIQYgCUGQAWogCUGAAWogChECAA0ACwJAIAAgCEYEQANAIAYgB08NAiACKAIAIQogCSAHQRBrIgcpAwg3A1ggCSAHKQMANwNQIAkgCSkDoAE3A0AgCSAJKQOoATcDSCAJQdAAaiAJQUBrIAoRAgBFDQAMAgsACwNAIAIoAgAhCiAJIAdBEGsiBykDCDcDeCAJIAcpAwA3A3AgCSAJKQOgATcDYCAJIAkpA6gBNwNoIAlB8ABqIAlB4ABqIAoRAgBFDQALCyAGIAdPIgpFBEADQCAJIAYpAwg3A7gBIAkgBikDADcDsAEgBiAHKQMINwMIIAYgBykDADcDACAHIAkpA7gBNwMIIAcgCSkDsAE3AwADQCACKAIAIQsgCSAGIggpAxg3AzggCSAGKQMQNwMwIAkgCSkDoAE3AyAgCSAJKQOoATcDKCAGQRBqIQYgCUEwaiAJQSBqIAsRAgANAAsDQCACKAIAIQsgCSAHQRBrIgcpAwg3AxggCSAHKQMANwMQIAkgCSkDoAE3AwAgCSAJKQOoATcDCCAJQRBqIAkgCxECAEUNAAsgBiAHSQ0ACwsgACAIRwRAIAAgCCkDCDcDCCAAIAgpAwA3AwALIAggCSkDqAE3AwggCCAJKQOgATcDACAFQcAIaiIGIAo6AAQgBiAINgIAIAlBwAFqJAAgBSgCwAghCAJAIAUtAMQIQQFHDQAgACAIIAIQwwMhByAIQRBqIgYgASACEMMDBEAgCCEBIAdFDQMMAgsgB0UNACAGIQAMAgsgACAIIAIgAyAMEMkDIAhBEGohAEEAIQQMAQsLIAVB0AhqJAALiQQCBX8BfCMAQTBrIgIkAAJAIAEoAgQiAyABKAIAIgRrQQR1IgVBAk0EQCAAQQA2AgggAEIANwIADAELIAJBtAQ2AgggAyAERwRAIAQgAyACQQhqIAVnQQF0QT5zQQEQyQMgASgCACEEIAEoAgQhAwtBACEFIAJBADYCLCACQgA3AiQgAyAERwRAA0AgBCACQSRqIgYQyAMgBiAEEEwgBEEQaiIEIANHDQALIAEoAgAhBCABKAIEIQMLIAJBADYCICACQgA3AhggAyAERgR/QQAFA0AgA0EQayIDIAJBGGoiBBDIAyAEIAMQTCADIAEoAgBHDQALIAIoAhghBSACKAIcCyEBIAIgAigCKEEQayIDNgIoIAIgAUEQayIBNgIcIABBADYCCCAAQgA3AgAgACABIAVrQQR1IAMgAigCJGtBBHVqEFwgAigCJCIDIAIoAigiAUcEQANAIAMrAwAhByACIAMrAwg5AxAgAiAHOQMIIAAgAkEIahBMIANBEGoiAyABRw0ACwsgAigCGCIDIAIoAhwiAUcEQANAIAMrAwAhByACIAMrAwg5AxAgAiAHOQMIIAAgAkEIahBMIANBEGoiAyABRw0ACyACKAIYIQMLIAMEQCACIAM2AhwgAigCIBogAxAiCyACKAIkIgBFDQAgAiAANgIoIAIoAiwaIAAQIgsgAkEwaiQAC+wBAQV/IwBBIGsiASQAIAFBCGogABBNIAFBADYCHCABQgA3AhQgAUEUaiABKAIIIgAoAgAiAiAAKAIEIgAgACACa0EMbRBHAkAgASgCDCIARQ0AIAAgACgCBCICQQFrNgIEIAINACAAIAAoAgAoAggRAAAgABAkCyABKAIUIgAgASgCGCIERwRAA0AgAUEIaiAAEDwhAiABKAIMIAIoAgAiAmtBBHUhBSACBEAgASACNgIMIAEoAhAaIAIQIgsgAyAFaiEDIABBDGoiACAERw0ACwsgASABQRRqNgIIIAFBCGoQKSABQSBqJAAgAwtdAQN/AkAgACAAKAIAKAIQEQQAIgNFDQADQCAAKAIIIAJBAnRqKAIAIgQgARDMAyABIARBIGoQdiACIANBAWtPDQEgAkEBaiICIAAgACgCACgCEBEEACIDSQ0ACwsLuAIBBH8gAEECQQJBARD/AQRAIAEgASgCACgCDBEAACABIAArA5gBOQMYIAIgAigCABB7IwBBEGsiBCQAIAEgASgCACgCDBEAACACELEBIAAtAHxBAUYEQCACIAAoAoQBIAAoAoABa0ECdRBWCyAAKAKAASIDIAAoAoQBRwRAA0ACQCADIAVBAnRqKAIAIgNFDQAgAygCECIGRQ0AIAMtAExBAUYEQCAEQQA2AgwgBEIANwIEIAYgAC0AdUEBIARBBGoiAyAAKwOYARC6AgRAIAIgAxBoCyAEKAIEIgNFDQEgBCADNgIIIAQoAgwaIAMQIgwBCyAAIAMQ/AFFDQAgACADIAEQuwILIAVBAWoiBSAAKAKEASAAKAKAASIDa0ECdUkNAAsLIARBEGokAAsgABDeASAALQB9GgtlAQR/IwBBEGsiASQAIAFBCGogABBNIAEoAggiACgCACECIAAoAgQCQCABKAIMIgBFDQAgACAAKAIEIgRBAWs2AgQgBA0AIAAgACgCACgCCBEAACAAECQLIAFBEGokACACa0EMbQuQBgEDfwJAAkACQAJAAkAgAg4DBAIAAQsgAUEYayECIAFBEGsrAwAgACsDCGMEQCADIAIpAxA3AxAgAyACKQMINwMIIAMgAikDADcDACADIAApAxA3AyggAyAAKQMINwMgIAMgACkDADcDGA8LIAMgACkDEDcDECADIAApAwg3AwggAyAAKQMANwMAIAMgAikDEDcDKCADIAIpAwg3AyAgAyACKQMANwMYDwsgAkEITARAIAAgAUYNAyADIAApAxA3AxAgAyAAKQMINwMIIAMgACkDADcDACAAQRhqIgQgAUYNAyADIQIDQCAEIQUgAkEYaiEGAkAgACsDICACKwMIYwRAIAYgAikDEDcDECAGIAIpAwg3AwggBiACKQMANwMAAn8gAyACIANGDQAaA0AgAiAAKwMgIAJBEGsrAwBjRQ0BGiACIAJBGGsiBCgCEDYCECACIAQpAwg3AwggAiAEKQMANwMAIAQiAiADRw0ACyADCyIEIAUoAhA2AhAgBCAFKQMINwMIIAQgBSkDADcDAAwBCyAGIAUpAxA3AxAgBiAFKQMINwMIIAYgBSkDADcDAAsgBiECIAUiAEEYaiIEIAFHDQALDAMLIAAgACACQQF2IgVBGGwiBmoiBCAFIAMgBRC1ASAEIAEgAiAFayICIAMgBmogAhC1ASAEIQIDQCABIAJGBEAgACAERg0EA0AgAyAAKQMQNwMQIAMgACkDCDcDCCADIAApAwA3AwAgA0EYaiEDIABBGGoiACAERw0ACwwECwJAIAIrAwggACsDCGMEQCADIAIpAxA3AxAgAyACKQMINwMIIAMgAikDADcDACACQRhqIQIMAQsgAyAAKQMQNwMQIAMgACkDCDcDCCADIAApAwA3AwAgAEEYaiEACyADQRhqIQMgACAERw0ACwwBCyADIAApAxA3AxAgAyAAKQMINwMIIAMgACkDADcDAAwBCyABIAJGDQADQCADIAIpAxA3AxAgAyACKQMINwMIIAMgAikDADcDACADQRhqIQMgAkEYaiICIAFHDQALCwudBQEIfyMAQSBrIgUkACADIQQCQCABIAJGDQAgAiAERgRAIAEhBAwBCyACIAFBGGoiBEYEQCAFIAEpAxA3AxggBSABKQMINwMQIAUgASkDADcDCCADIAJrIgJBBGsiBwRAIAEgBCAH/AoAAAsgASACaiIEIAUoAhg2AhAgBCAFKQMQNwMIIAQgBSkDCDcDAAwBCyADIAJBGGpGBEAgBSADQRhrIgIpAxA3AxggBSACKQMINwMQIAUgAikDADcDCCADIAIgAWsiB0FobUEYbGohBAJAIAEgAkYNACAHQQRrIgJFDQAgBCABIAL8CgAACyABIAUoAhg2AhAgASAFKQMQNwMIIAEgBSkDCDcDAAwBCwJ/IwBBIGshBiACIAEiBGsiCUEYbSIHIAMgAmsiC0EYbSIBRwRAIAchAgNAIAIgASICbyIBDQALIAQgAkEYbGohAgNAIAYgAkEYayICKQMQNwMYIAYgAikDCDcDECAGIAIpAwA3AwggAiAJaiEIIAIhAQNAIAEiCiAIIgEoAhA2AhAgCiABKQMINwMIIAogASkDADcDACABIAlqIAQgByADIAFrQRhtIghrQRhsaiAHIAhIGyIIIAJHDQALIAEgBigCGDYCECABIAYpAxA3AwggASAGKQMINwMAIAIgBEcNAAsgBCALagwBCwJAIAIgBEYgAiADRnINACACIQEDQCAGIAQpAxA3AxggBiAEKQMINwMQIAYgBCkDADcDCCAEIAEoAhA2AhAgBCABKQMINwMIIAQgASkDADcDACABIAYoAhg2AhAgASAGKQMQNwMIIAEgBikDCDcDACAEQRhqIgQgAkYNASABQRhqIgEgA0cNAAsLIAILIQQLIAAgAzYCBCAAIAQ2AgAgBUEgaiQAC4IGAQN/AkACQAJAAkACQCACDgMEAgABCyABQRhrIgErAwAgACsDAGMEQCADIAEpAxA3AxAgAyABKQMINwMIIAMgASkDADcDACADIAApAxA3AyggAyAAKQMINwMgIAMgACkDADcDGA8LIAMgACkDEDcDECADIAApAwg3AwggAyAAKQMANwMAIAMgASkDEDcDKCADIAEpAwg3AyAgAyABKQMANwMYDwsgAkEITARAIAAgAUYNAyADIAApAxA3AxAgAyAAKQMINwMIIAMgACkDADcDACAAQRhqIgQgAUYNAyADIQADQCAAQRhqIQUCQCAEKwMAIAArAwBjBEAgBSAAKQMQNwMQIAUgACkDCDcDCCAFIAApAwA3AwACfyADIAAgA0YNABoDQCAAIAQrAwAgAEEYayICKwMAY0UNARogACACKAIQNgIQIAAgAikDCDcDCCAAIAIpAwA3AwAgAiIAIANHDQALIAMLIgIgBCgCEDYCECACIAQpAwg3AwggAiAEKQMANwMADAELIAUgBCkDEDcDECAFIAQpAwg3AwggBSAEKQMANwMACyAFIQAgBEEYaiIEIAFHDQALDAMLIAAgACACQQF2IgRBGGwiBmoiBSAEIAMgBBC2ASAFIAEgAiAEayICIAMgBmogAhC2ASAFIQIDQCABIAJGBEAgACAFRg0EA0AgAyAAKQMQNwMQIAMgACkDCDcDCCADIAApAwA3AwAgA0EYaiEDIABBGGoiACAFRw0ACwwECwJAIAIrAwAgACsDAGMEQCADIAIpAxA3AxAgAyACKQMINwMIIAMgAikDADcDACACQRhqIQIMAQsgAyAAKQMQNwMQIAMgACkDCDcDCCADIAApAwA3AwAgAEEYaiEACyADQRhqIQMgACAFRw0ACwwBCyADIAApAxA3AxAgAyAAKQMINwMIIAMgACkDADcDAAwBCyABIAJGDQADQCADIAIpAxA3AxAgAyACKQMINwMIIAMgAikDADcDACADQRhqIQMgAkEYaiICIAFHDQALCwuLCwEQfyMAQSBrIgckACAHQQA2AhggB0IANwIQIAdBEGogASgCJBAlIAEoAgwhDyABKAIIIQogASgCBCELIAEoAgAhBgJAAkACQCACKAIMQQBOBEBBASERDAELQQEhESALQQRBCCAGQQFGG0EAIAYbQZSVAWooAgBHDQELIAohDCAGIQoMAQtBASESIAQgBC0AA0EBczoAAyAEIAQtAAJBAXM6AAIgBCAELQABQQFzOgABIAQgBC0AAEEBczoAAEEAIREgCyEMIAYhCwsgAUEEaiETIAdCgoCAgDA3AgggB0KAgICAEDcCACACQQRqIRADQCAKIQYCQAJAAkACQCAHIAhqKAIAIg0OAwMAAQILIAshBgwCCyAMIQYMAQsgDyEGCyACIQkCQAJAAkAgBg4CAgABCyAQIQkMAQsgAkEIQQwgBkECRhtqIQkLIAkoAgBBAE4EQCAKIQYCQAJAAkACQCANDgMDAAECCyALIQYMAgsgDCEGDAELIA8hBgsgAiEJAkACQAJAIAYOAgIAAQsgECEJDAELIAJBCEEMIAZBAkYbaiEJCyAJKAIAIQkCQCAHKAIUIgYgBygCGCINTwRAIAdBEGogDUEBdEGAASANGxAlIAcoAhAgBygCFCIGQQJ0aiAJNgIADAELIAcoAhAgBkECdGogCTYCAAsgByAGQQFqNgIUCyAIQQRqIghBEEcNAAsgB0KCgICAMDcCCCAHQoCAgIAQNwIAIARBAWohCyADQQRqIQ8gAUEUaiEQIAFBEGohDANAIAwhCCABIQYCQAJAAkAgByAUaigCACIODgICAAELIBAhCCATIQYMAQsgAUEIQQwgDkECRhsiAmohBiACIAxqIQgLIAMhCQJAAkACQCAGKAIAIgIOAgIAAQsgDyEJDAELIANBCEEMIAJBAkYbaiEJCyABIQYCQAJAAkAgDg4CAgABCyATIQYMAQsgAUEIQQwgDkECRhtqIQYLIAgoAgAhCCAEIQoCQAJAAkAgBigCACICDgICAAELIAshCgwBCyAEQQJBAyACQQJGG2ohCgsgCEECTgRAIAFBCEEMIA5BAkYbaiENQQAhAiAJKAIAQQAgCEECayIVIAotAAAbaiEGIAcoAhQhCANAIAIhCQJAIAcoAhgiAiAITQRAIAdBEGogAkEBdEGAASACGxAlIAcoAhAgBygCFCIIQQJ0aiAGNgIADAELIAcoAhAgCEECdGogBjYCAAsgByAIQQFqIgg2AhQgASECAkACQAJAIA4OAgIAAQsgEyECDAELIA0hAgsgBCEKAkACQAJAIAIoAgAiAg4CAgABCyALIQoMAQsgBEECQQMgAkECRhtqIQoLQQFBfyAKLQAAGyAGaiEGIAlBAWohAiAJIBVHDQALCyAUQQRqIhRBEEcNAAsgBygCFCECIAdBEGoiAyABKAIkIggQJSAHIAg2AhQgAkERSSACIAhBAXRNckUEQCADEC0gBygCFCEICyACIAhHBEAgBygCECIDIAhBAnRqIQQgAyACQQJ0aiEIA0AgCCAFNgIAIAVBAWohBSAIQQRqIgggBEcNAAsLIAEoAjQhAyAAQQA2AgggAEIANwIAIAAgAxA1IAAgAzYCBCADBEAgACgCACEEIAEoAjAhBSAHKAIQIQZBACEAA0AgB0ECNgIIIAdCgICAgBA3AgAgBCAAQQxsIgFqIQogASAFaiELQQAhCANAQQghCSAGIAtBBEEIIAcgCGooAgAiAUEBRhtBACABG2ooAgBBAnRqKAIAIQwgEiECAkACQAJAIAEOAgEAAgsgESECC0EEQQAgAhshCQsgCSAKaiAMNgIAIAhBBGoiCEEMRw0ACyAAQQFqIgAgA0cNAAsLIAcoAhAiAARAIAAQIgsgB0EgaiQAC4ACAQV/IAEoAgghBiABKAIAIQUCQCACQQBMBEAgACgCBCEDDAELIAAoAgQhAwNAAn8gACgCCCIEIANNBEAgACAEQQF0QYABIAQbEDUgACgCACAAKAIEIgNBDGxqDAELIAAoAgAgA0EMbGoLIgQgBTYCACAEIAY2AgggBCAHQQNqIgU2AgQgACADQQFqIgM2AgQgB0EBaiIHIAJHDQALCyABKAIEIQICfyAAKAIIIgEgA00EQCAAIAFBAXRBgAEgARsQNSAAKAIAIAAoAgQiA0EMbGoMAQsgACgCACADQQxsagsiASAFNgIAIAEgBjYCCCABIAI2AgQgACADQQFqNgIEC1cBA38gACgCCCABSQRAIAFBKGwQJyEEIAAoAgAhAgJAIAAoAgQiA0UNACADQShsIgNFDQAgBCACIAP8CgAACyACBEAgAhAiCyAAIAE2AgggACAENgIACwuGigEEH38MfAF+An0jAEGACGsiBCQAIAFB2ABqIgUQOCABQegAahA4IAFB+ABqEDggASgCXCEGIARBADYCgAUgBEIANwL4BCAEQfgEaiIHIAYQNSAEIAY2AvwEIAQgBTYC9AYgBCAHNgLwBkEAIQUgBgRAIAQoAvAGKAIAIQkgBCgC9AYoAgAhCwNAIAkgBUEMbGoiCEF/IAUgCyAFQQJ0aiIKKAIAIgcgCkF4QQQgBUEDb0ECRhtqKAIAIgpOGzYCCCAIIAcgCiAHIApKIgwbNgIEIAggCiAHIAwbNgIAIAVBAWoiBSAGRw0ACwsgBCgC+AQiCCAEKAL8BCIGQQxsaiEKIAghBQJAAkAgBkUNAANAIAUoAghBAEgNASAFQQxqIgUgCkcNAAsgCiEGDAELAkAgBSAKRg0AIAVBDGoiByAKRg0AIAUhBgNAIAUoAhRBAE4EQCAGIAcoAgg2AgggBiAHKQIANwIAIAZBDGohBgsgByIFQQxqIgcgCkcNAAsgBCgC+AQhCAwBCyAFIQYLIAQgBCgC+AY2ArADIAQgBCkC8AY3A6gDIARB+ARqIAYgCGtBDG0gBEGoA2oQ9AMgASgCTCEfIAEoAlwhGyAEKAL8BCEUQQAhBSAEQQA2AvAEIARCADcC6AQgBEHoBGogFEEBdCIGECUgBCAGNgLsBCAUBEAgASgCaCEHIAQoAugEIQYgBCgC+AQhCgNAIAYgCiAFQQxsaigCCEECdCIIaiAFNgIAIAYgByAIaigCAEECdGogBTYCACAFQQFqIgUgFEcNAAsLQQAhBSAEQQA2AuAEIARCADcC2AQgBEHYBGogG0EDbiIcEDkgBCAcNgLcBCAbQQNPBEADQCAEQfAGaiABIAUQ1wMgBCgC2AQgBUEEdGoiBiAEKQL4BjcCCCAGIAQpAvAGNwIAIAVBAWoiBSAcRw0ACwsgBEEANgLQBCAEQgA3AsgEIARByARqIgYgFBAlIAQgFDYCzAQgBCAEQfgEajYCpAQgBCAGNgKgBCAEQagEaiACEFchCCAEIAE2AsAEIAQgBCkDoAQ3A4gFIARBkAVqIQYCQAJAAkACQAJAIAQoArgEIgJFBEAgBEEANgKgBSAEIAQoAsAEIgc2AqgFIAQgBCkDiAUiLzcDsAUgBEG4BWohDgwBCwJAIAIgCEYEQCAEIAY2AqAFIAIgBiACKAIAKAIMEQEAIAQoAqAFIQUMAQsgBCACIAIoAgAoAggRBAAiBTYCoAULIAQgBCgCwAQiBzYCqAUgBCAEKQOIBSIvNwOwBSAEQbgFaiEOIAUNAQsgBCAHNgLQBSAEQQA2AsgFIAQgLzcD2AUgBEHgBWohAgwBCwJAIAUgBkYEQCAEIA42AsgFIAUgDiAFKAIAKAIMEQEAIAQoAsgFIQUMAQsgBCAFIAUoAgAoAggRBAAiBTYCyAULIAQgBCgCqAU2AtAFIAQgBCkDsAU3A9gFIARB4AVqIQIgBQ0BCyAEQQA2AvAFDAELIAUgDkYEQCAEIAI2AvAFIAUgAiAFKAIAKAIMEQEADAELIAQgBSAFKAIAKAIIEQQANgLwBQsgBCAEKALQBTYC+AUCQAJAAkAgFARAQQAhBQNAIAQoAtwFKAIAIAVBDGxqIgooAgQhDCAKKAIAIQ1BACEJIAQoAvgFIgcgCigCCCILEOYBRQRAIAcoAkgiCSANQRhsaiIKKwMQIAkgDEEYbGoiCSsDEKEhKiAKKwMIIAkrAwihISsgCisDACAJKwMAoSEsAnwgBygCvAFFBEBEAAAAAAAAAAAhI0QAAAAAAAAAACEkRAAAAAAAAAAAISVEAAAAAAAAAAAhJkQAAAAAAAAAACEnRAAAAAAAAAAAIShEAAAAAAAAAAAhKUQAAAAAAAAAAAwBCyAHKAK4ASIJIAtBBXRqIgorAxghIyAKKwMQISQgCisDCCElIAorAwAhJiAJIAcoAmggC0ECdGooAgBBBXRqIgcrAxghJyAHKwMQISggBysDCCEpIAcrAwALIS0gBCAqOQOQBiAEICs5A4gGIAQgLDkDgAYgBCAjOQOwBiAEICQ5A6gGIAQgJTkDoAYgBCAmOQOYBiAEICc5A9AGIAQgKDkDyAYgBCApOQPABiAEIC05A7gGIAQoAvAFIgdFDQMgByAEQYAGaiAEQZgGaiAEQbgGaiAHKAIAKAIYEQkAIQkLIAQoAtgFKAIAIAVBAnRqIAk2AgAgBUEBaiIFIBRHDQALCyAEIAQpA9gFNwPwBgJAIAQoAvAFIgVFBEAgBEEANgKIByAEIAQoAvgFNgKQBwwBCyAEQfgGaiEHAkAgAiAFRgRAIAQgBzYCiAcgBSAHIAUoAgAoAgwRAQAgBCgCiAchBQwBCyAEQQA2AvAFIAQgBTYCiAcLIAQgBCgC+AU2ApAHIAUgBSAHRgR/QRAFIAVFDQFBFAsgBSgCAGooAgARAAALAkAgAiAEKALwBSIFRgR/QRAFIAVFDQFBFAshAiAFIAUoAgAgAmooAgARAAALAkAgDiAEKALIBSICRgR/QRAFIAJFDQFBFAshBSACIAIoAgAgBWooAgARAAALAkAgBiAEKAKgBSICRgR/QRAFIAJFDQFBFAshBiACIAIoAgAgBmooAgARAAALAkAgCCAEKAK4BCICRgR/QRAFIAJFDQFBFAshBiACIAIoAgAgBmooAgARAAALIAMEQEEAIQsgBEEANgL4BiAEQgA3AvAGIARB8AZqIBQQJSAEIBQ2AvQGIBQEQANAIAtBAnQiAyAEKALwBmogBCgCyAQgA2ooAgA2AgAgASAEKAL4BCALQQxsaigCCCICEOYBRQRAIAQoAvAGIANqKAIAIQogAiEFQQAhCUEAIQhBACEGA0ACQCAEKALIBCAEKALoBCAFQQJ0aigCAEECdGooAgAhByABQX5BASAFQQNvQQJGGyAFaiIFEOYBBEBBACEGQQEhCQwBCyAGIAcgBiAHShshBiAHIAlqIQkgCEEEaiIIQQxHDQELC0EAIQgCf0EAIAZFDQAaQQAgBrhEmpmZmZmZyT+iRAAAAAAAAPA/oPwCIAZBAXQgCWtqIgVBAEwNABogBSAGIAprbCAGbQshDCABKAJoIAJBAnRqKAIAIQVBACEJQQAhBgNAAkAgBCgCyAQgBCgC6AQgBUECdGooAgBBAnRqKAIAIQdBACECIAFBfkEBIAVBA29BAkYbIAVqIgUQ5gEEQEEAIQZBASEIDAELIAYgByAGIAdKGyEGIAcgCGohCCAJQQRqIglBDEcNAQsLAkAgBkUNACAGuESamZmZmZnJP6JEAAAAAAAA8D+g/AIgBkEBdCAIa2oiBUEATA0AIAUgBiAKa2wgBm0hAgsgBCgC8AYgA2oiAyADKAIAIAwgAiACIAxIG2o2AgALIAtBAWoiCyAURw0ACwsgBCgCyAQiAgRAIAIQIgsgBCAEKALwBjYCyAQgBCAEKQL0BjcCzAQLIARBADYCmAQgBEIANwKQBCAEQZAEaiAUECUgBCAUNgKUBCAEKALIBCIDIAQoAswEIgZBAnRqIQogBCgCkAQhAgJAIAZFDQAgAygCACACIB82AgAgBkEBRg0AIB9qIQUgA0EEaiEHIAIhBgNAIAcoAgAgBiAFNgIEIAZBBGohBiAFaiEFIAdBBGoiByAKRw0ACwsgCkEEaygCACEDIAIgFEECdGpBBGsoAgAhAiAAQQA2AgggAEIANwIAIAAgAiADaiIgENQDIAAgIDYCBEEAIQYjAEFAaiICJAAgASgCXCIDQQNuIQcgA0EDTwRAA0AgAkECNgI8IAJCgICAgBA3AjQgBkEDbCEKQQAhBQNAIAJBKGogASACQTRqIAVqKAIAIApqIggQ1gMgAigCLCIJQQBOBEAgAkIANwMgIAJCADcDGCACQgA3AxAgAkIANwMIIAJBIGohAwJAAkACQAJAIAkOAwMAAQILIAJBGGohAwwCCyACQRBqIQMMAQsgAkEIaiEDCyADQoCAgICAgID4PzcDACACKAIoIQkgAisDICEjIAIrAxghJCACKwMQISUgACgCACABKAJYIAhBAnRqKAIAQShsaiIDIAIrAwg5AyAgAyAlOQMYIAMgJDkDECADICM5AwggAyAJNgIACyAFQQRqIgVBDEcNAAsgBkEBaiIGIAdHDQALCyACQUBrJAAgFARAQQAhDANAIAxBAnQiAiAEKAKQBGooAgAhAyAEKALIBCACaigCACEKIARB8AZqIAEgBCgC+AQgDEEMbGooAggQ1gMgBCgC8AYiCEEASCAKQQBMckUEQEQAAAAAAADwPyAKQQFqt6MhJCAAKAIAIANBKGxqIQkgBEGIBWogBEG4BmogBCgC+AYiC0ECRhshAkEAIQcgBCgC9AYhDQNAIARCADcD2AUgBEIANwOwBSAEQgA3A4gFIARCADcDuAYgJCAHIgNBAWoiB7iiISMgBEHYBWoiBSEGAkACQAJAIAsOAgIAAQsgBEGwBWohBgwBCyACIQYLIAYgIzkDAEQAAAAAAADwPyAjoSEjAkACQAJAAkAgDQ4DAwABAgsgBEGwBWohBQwCCyAEQYgFaiEFDAELIARBuAZqIQULIAUgIzkDACAJIANBKGxqIgMgBCsD2AU5AwggAyAEKwOwBTkDECADIAQrA4gFOQMYIAQrA7gGISMgAyAINgIAIAMgIzkDICAHIApHDQALCyAMQQFqIgwgFEcNAAsLAkACQAJAIBtBAk0EQCAcQQZ0IR0MAQsgG0GAgIDgAE8NAiAcQQZ0Ih0QIyEVIB0EQCAVQQAgHfwLAAsgFSAdaiEaIARB6AVqISEgBEGgB2ohFiAEQZAHaiESA0AgBCgC2AQgHkEEdGoiBSgCDCECIAUoAgghAyAFKAIEIQYgBSgCACEKIARBADYC8AcgBEEANgLsByAEQQA2AugHIARBADYC5AcgBEKCgICAMDcC+AYgBEKAgICAEDcC8AYgBCgC6AQiCSAKQQJ0aiEMIAkgBkECdGohDSAEKALIBCEIQQAhBQNAIAohBwJAAkACQAJAIARB8AZqIAVqKAIAIgsOAwMAAQILIAYhBwwCCyADIQcMAQsgAiEHCyAHQQBOBEACfwJAAkACQCALDgIAAQILIAggDCgCAEECdGohByAEQfAHagwCCyAIIA0oAgBBAnRqIQcgBEHsB2oMAQsgCCAJIAMgAiALQQJGIgsbQQJ0aigCAEECdGohByAEQegHaiAEQeQHaiALGwsgBygCAEEBajYCAAsgBUEEaiIFQRBHDQALAkAgBCgC8AciB0UEQCAEQfAGakEAQcAA/AsADAELIAQoAuQHIQ8gBCgC6AchDSAEKALsByEKIAQgBzYC0AcgBCAKNgL8ByAEIA02AvgHIAQgDzYC9AcCfwJAIA9FBEACfyAKIA1OBEBBASETIA0hBUECDAELIAQgDTYC/AcgBCAKNgL4B0ECIRMgCiEFIA0hCkEBCyECQQMhFyAHIApOBEBBACEQIAIhGCAHIQlBACEDIAUMAwsgBCAKNgLQByAEIAc2AvwHIAUgB0oNAUEAIRAgAiEYIAohCSATIQNBACETIAchCiAFDAILIARBAzYC4AUgBEKBgICAIDcC2AVBACELIAchCCAKIQxBACEJA0AgByEGAkACQAJAAkAgBEHYBWogCWooAgAiA0EBakEEbw4DAwABAgsgCiEGDAILIA0hBgwBCyAPIQYLIAchAgJAAkACQAJAIAMOAwMAAQILIAohAgwCCyANIQIMAQsgDyECCwJAIAIgCE4EQCAHIQICQAJAAkACQCADDgMDAAECCyAKIQIMAgsgDSECDAELIA8hAgsgAiAIRyAGIAxOcg0BCyAGIQwgByEIAn8CQAJAIAMiCw4CAwABCyAKDAELIA0gDyADQQJGGwshCAsgCUEEaiIJQQxHDQALIARCgoCAgDA3AuAFIARCgICAgBA3AtgFQQAhCEEBIRNBAiEYQQMhF0EAIQUDQCAEQdgFaiAFaigCACIGIAtqQQRvIgIhAwJAAkACQAJAAkAgBg4DBAECAAsgAiEXDAILIAIhEwwBCyACIRgLIAghAwsgByEIAkACQAJAAkAgAg4DAwABAgsgCiEIDAILIA0hCAwBCyAPIQgLIARB0AdqIQkCQAJAAkACQCAGDgMDAAECCyAEQfwHaiEJDAILIARB+AdqIQkMAQsgBEH0B2ohCQsgCSAINgIAIAMhCCAFQQRqIgVBEEcNAAsgBCgC9AchECAEKALQByEJIAQoAvwHIQogBCgC+AcMAQsgBCAFNgL8ByAEIAc2AvgHQQAhGEEAIRAgCiEJIBMhAyACIRMgBSEKIAcLIRECQAJAQdSfAigCACIIRQ0AQdyfAigCAEUNACAJIBBzIBFzIApzIQYCQCAIaUEBSyILRQRAIAhBAWsgBnEhAgwBCyAGIgIgCEkNACACIAhwIQILQdCfAigCACACQQJ0aigCACIFRQ0AIAUoAgAiBUUNACAIQQFrIQwDQAJAAkAgBiAFKAIEIgdHBEACQCALRQRAIAcgDHEhBwwBCyAHIAhJDQAgByAIcCEHCyACIAdGDQEMBAsgBSgCCCAJRw0AIAUoAgwgCkcNACAFKAIQIBFHDQAgBSgCFCAQRg0BCyAFKAIAIgUNAQwCCwsgBCAFKAIYIgIpAhg3A4gHIAQgAikCEDcDgAcgBCACKQIINwP4BiAEIAIpAgA3A/AGQQAhBiAEQQA2ApgHIARCADcDkAdBACEJAkAgAigCJCIFRQ0AIAIoAiAhCiAFQQV0IgcQJyEJIAdFDQAgCSAKIAf8CgAACyAEQQA2AqgHIARCADcDoAcgBCAFNgKYByAEIAU2ApQHIAQgCTYCkAcCQCACKAI0IgVFDQAgAigCMCEHIAVBDGwiAhAnIQYgAkUNACAGIAcgAvwKAAALIAQgBTYCqAcgBCAFNgKkByAEIAY2AqAHDAELIARBADYCqAcgBEIANwOgByAEQfAGakEAQSz8CwAgBCARNgKIByAEIAo2AoQHIAQgCTYCgAcgBCAQNgKMByASQYABEFUgBCgCkAciCCAEKAKUByIGQQV0aiICQgA3AwggAkKAgICAgICA+D83AwAgAkIANwMQIAJCADcDGCAEIAZBAWoiAjYClAcgBCgCmAchBQJAIBBBAEoEQCAEAn8gAiAFTwRAIBIgBUEBdEGAASAFGxBVIAQoApAHIgggBCgClAciBkEFdGoiAkIANwMQIAJCgICAgICAgPg/NwMIIAJCADcDACACQgA3AxggBCgCmAchBSAGQQFqDAELIAggAkEFdGoiAkIANwMQIAJCgICAgICAgPg/NwMIIAJCADcDACACQgA3AxggBkECagsiBzYClAcCQCAFIAdNBEAgEiAFQQF0QYABIAUbEFUgBCgCkAciCCAEKAKUByIHQQV0aiICQgA3AwggAkIANwMAIAJCADcDGCACQoCAgICAgID4PzcDECAEKAKYByEFDAELIAggB0EFdGoiAkIANwMIIAJCADcDACACQgA3AxggAkKAgICAgICA+D83AxALIAQgB0EBaiICNgKUBwJ/IAIgBU8EQCASIAVBAXRBgAEgBRsQVSAEKAKUByICQQFqIQYgBCgCkAciCCACQQV0agwBCyAHQQJqIQYgCCACQQV0agsiAkIANwMQIAJCADcDCCACQgA3AwAgAkKAgICAgICA+D83AxggBCAGNgKUByAEQoKAgIAwNwLgBSAEQoCAgIAQNwLYBUEAIQ9BACENQQAhBUEAIQ4DQAJAAkAgBEHYBWogDmooAgAiGUEATA0AQQQhByAJIQsCQAJAAkAgGUEBayIMDgICAAELIAUhByAKIQsMAQsgESAQIAxBAkYiAhshCyANIA8gAhshBwsgByALakEBayECAkACQCAMDgIDAQALIAIhDwwBCyACIQ0LIAUhAgsgESAQIBlBAkYbIQxBASEHIAggGUEBakEDcUEFdGoiBSsDGCElIAUrAxAhJiAFKwMIIScgBSsDACEoA0AgCSEFAkACQAJAIBkOAgIAAQsgCiEFDAELIAwhBQsgBSAHTARAIAIhBSAOQQRqIg5BEEcNAiAEIA82ApQFIAQgDTYCkAUgBCACNgKMBSAEQQQ2AogFIAQgEEEBazYCxAYgBCARQQFrNgLABiAEQoCAgIAQNwKwBSAEQoKAgIAwNwK4BSAEQYGChAg2ApgGIARCgICAgBA3A6gBIARCgoCAgDA3A7ABIAQgCkEBazYCvAYgBCAJQQFrNgK4BiAEIAQpApAFNwOgASAEIAQpAogFNwOYASAEIAQpAsAGNwOQASAEIAQpArgGNwOIASAEQYGChAg2AoQBIBYgEiAEQagBaiAEQZgBaiAEQYgBaiAEQYQBahC3AQwEBSAIIBlBBXRqIQUgCSELAkACQAJAIBkOAgIAAQsgCiELDAELIAwhCwsgJSAHuCALt6MiI6JEAAAAAAAA8D8gI6EiJCAFKwMYoqAhKSAmICOiICQgBSsDEKKgISogJyAjoiAFKwMIICSioCErICggI6IgBSsDACAkoqAhIwJ/IAQoApgHIgUgBk0EQCASIAVBAXRBgAEgBRsQVSAEKAKQByIIIAQoApQHIgZBBXRqDAELIAggBkEFdGoLIgUgIzkDACAFICk5AxggBSAqOQMQIAUgKzkDCCAEIAZBAWoiBjYClAcgB0EBaiEHDAELAAsACwALIAQCfyACIAVPBEAgEiAFQQF0QYABIAUbEFUgBCgCkAciCCAEKAKUByIGQQV0aiICQgA3AxAgAkKAgICAgICA+D83AwggAkIANwMAIAJCADcDGCAEKAKYByEFIAZBAWoMAQsgCCACQQV0aiICQgA3AxAgAkKAgICAgICA+D83AwggAkIANwMAIAJCADcDGCAGQQJqCyIHNgKUBwJ/IAUgB00EQCASIAVBAXRBgAEgBRsQVSAEKAKQByIIIAQoApQHIgdBBXRqDAELIAggB0EFdGoLIgJCADcDCCACQgA3AwAgAkIANwMYIAJCgICAgICAgPg/NwMQIAQgB0EBaiIGNgKUByAEQQI2AuAFIARCgICAgBA3AtgFQQAhDgJAAkADQCARIBAgBEHYBWogDmooAgAiAkECRhshDEEBIQcgCCACQQFqQQNvQQV0aiIFKwMYISUgBSsDECEmIAUrAwghJyAFKwMAISgDQCAJIQUCQAJAAkAgAg4CAgABCyAKIQUMAQsgDCEFCwJAIAUgB0wEQCAOQQRqIg5BDEcNAyAKQQFHDQUgCUEBRw0EIAQoAqQHIgIgBCgCqAciBkkNASAWIAZBAXRBgAEgBhsQNSAEIAQoAqQHIgJBAWo2AqQHIAQoAqAHIAJBDGxqIgJBAjYCCCACQoCAgIAQNwIADAYLIAggAkEFdGohBSAJIQsCQAJAAkAgAg4CAgABCyAKIQsMAQsgDCELCyAlIAe4IAu3oyIjokQAAAAAAADwPyAjoSIkIAUrAxiioCEpICYgI6IgJCAFKwMQoqAhKiAnICOiIAUrAwggJKKgISsgKCAjoiAFKwMAICSioCEjAn8gBCgCmAciBSAGTQRAIBIgBUEBdEGAASAFGxBVIAQoApAHIgggBCgClAciBkEFdGoMAQsgCCAGQQV0agsiBSAjOQMAIAUgKTkDGCAFICo5AxAgBSArOQMIIAQgBkEBaiIGNgKUByAHQQFqIQcMAQsLCyAEIAJBAWo2AqQHIAQoAqAHIAJBDGxqIgJBAjYCCCACQoCAgIAQNwIADAILIARBAjYCuAUgBEKAgICAEDcCsAUgBEKAgICAEDcDuAEgBEECNgLAASAWIARBuAFqIAlBAWsQ0wMMAQsgCiAJQQJqIgtqIiJBAWshDSAKIApsIgK4IBEgEWwiBSAJIAlsaiIHuCAJt0TNO39mnqD2v6IgEbeioGQEQCAJQQFqIQICfyAEKAKkByIGIAQoAqgHIgVPBEAgFiAFQQF0QYABIAUbEDUgBCgCoAcgBCgCpAciBkEMbGoMAQsgBCgCoAcgBkEMbGoLIgUgAjYCACAFIAs2AgggBUEBNgIEIAQgCzYCtAUgBCACNgKwBSAEIA02ApAFIARBAzYClAUgBCAJQQNqNgKMBSAEIAlBAms2AsQGIARBfzYCiAUgBCARQQFrNgLABiAEIAZBAWo2AqQHIARCAjcCuAUgBCAKQQJrNgK8BiAEQQA2ArgGIARBgYKECDYCmAYgBEICNwPwASAEIAQpArAFNwPoASAEIAQpApAFNwPgASAEIAQpAogFNwPYASAEIAQpAsAGNwPQASAEIAQpArgGNwPIASAEQYGChAg2AsQBIBYgEiAEQegBaiAEQdgBaiAEQcgBaiAEQcQBahC3AQwBCyAJQQJrIhkgByACa7cgCUEBdLejEDT8AiICIAIgGUobIgxBAmohDyAFIAwgDGxrt58QNCIjRAAAAAAAAPA/ICNEAAAAAAAA8D9kG/wCIgVBAk4EQCAIIA9BBXRqIgIrAxghJSACKwMQISYgAisDCCEnIAIrAwAhKCAFuCEpQQEhAiAGIQcDQCAlIAK4ICmjIiOiRAAAAAAAAPA/ICOhIiQgCCsDWKKgISogJiAjoiAkIAgrA1CioCErICcgI6IgCCsDSCAkoqAhLCAoICOiIAgrA0AgJKKgISMCfyAEKAKYByIOIAdNBEAgEiAOQQF0QYABIA4bEFUgBCgCkAciCCAEKAKUByIHQQV0agwBCyAIIAdBBXRqCyIOICM5AwAgDiAqOQMYIA4gKzkDECAOICw5AwggBCAHQQFqIgc2ApQHIAJBAWoiAiAFRw0ACwsgDEEDaiEOIAlBAWohAgJ/IAQoAqQHIgggBCgCqAciB08EQCAWIAdBAXRBgAEgBxsQNSAEKAKgByAEKAKkByIIQQxsagwBCyAEKAKgByAIQQxsagsiByACNgIAIAcgCzYCCCAHQQE2AgQgBCALNgK0BSAEIAI2ArAFIAQgDzYCvAUgBEECNgK4BSAEIAlBA2o2AowFIAQgDjYClAUgBCAGNgKQBSAEIApBAms2ArwGIARBADYCuAYgBCAIQQFqNgKkByAEIBkgDGs2AsQGIARBgYKECDYC2AMgBEF/NgKIBSAEIAVBAWsiCzYCwAYgBCAEKQKwBTcDmAMgBCAEKQK4BTcDoAMgBCAEKQKIBTcDiAMgBCAEKQKQBTcDkAMgBCAEKQK4BjcD+AIgBCAEKQLABjcDgAMgBEGBgoQINgL0AiAWIBIgBEGYA2ogBEGIA2ogBEH4AmogBEH0AmoQtwEgEUEBRgRAIAQgDzYCnAYgBEEANgKYBiAEQQI2AqAGIARBAjYCgAIgBCAEKQKYBjcD+AEgFiAEQfgBaiAMQQFrENMDDAELIAxBAUYEQAJ/IAQoAqQHIgcgBCgCqAciAk8EQCAWIAJBAXRBgAEgAhsQNSAEKAKgByAEKAKkByIHQQxsagwBCyAEKAKgByAHQQxsagsiAiAGNgIAIAIgDTYCCCACQQI2AgQgBCANNgKcBiAEICI2AoQGIARBfzYCgAYgBEF/NgKIBiAEIAVBAmsiAjYC5AYgBCAGNgKYBiAEIAIgBmo2AowGIARBADYC4AYgBCAHQQFqNgKkByAEQoCAgIAwNwKgBiAEIBFBAms2AtwGIARBADYC2AYgBEGBggQ2AMgDIARCgICAgDA3A7ACIAQgBCkCmAY3A6gCIAQgBCkCgAY3A5gCIAQgBCkCiAY3A6ACIAQgBCkC4AY3A5ACIAQgBCkC2AY3A4gCIARBgYIENgKEAiAWIBIgBEGoAmogBEGYAmogBEGIAmogBEGEAmoQtwEMAQsgBkEBayEHAn8gBCgCpAciAiAEKAKoByIITwRAIBYgCEEBdEGAASAIGxA1IAQoAqAHIAQoAqQHIgJBDGxqDAELIAQoAqAHIAJBDGxqCyIIIAc2AgAgCEKAgICAMDcCBCAEQQM2ApwGIAQgBzYCmAYgBEECNgKkBiAEIA82AqAGIAQgDTYCjAYgBCAFIAZqQQJrNgKIBiAEIBFBAms2AuQGIAQgCzYC4AYgBCACQQFqNgKkByAEQv/////PADcCgAYgBCAMQQJrNgLcBiAEQQA2AtgGIARBgYKACDYAyAMgBEL/////zwA3A9ACIAQgBCkCmAY3A+ACIAQgBCkCoAY3A+gCIAQgBCkCiAY3A9gCIAQgBCkC4AY3A8gCIAQgBCkC2AY3A8ACIARBgYKACDYCvAIgFiASIARB4AJqIARB0AJqIARBwAJqIARBvAJqELcBC0HAABAjIgYgBCkDiAc3AhggBiAEKQOABzcCECAGIAQpA/gGNwIIIAYgBCkD8AY3AgBBACEHQQAhCAJAIAQoApQHIgJFDQAgBCgCkAchCyACQQV0IgUQJyEIIAVFDQAgCCALIAX8CgAACyAGIAI2AiggBiACNgIkIAYgCDYCIAJAIAQoAqQHIgJFDQAgBCgCoAchCCACQQxsIgUQJyEHIAVFDQAgByAIIAX8CgAACyAGIAI2AjggBiACNgI0IAYgBzYCMCAEQQA2ArgDIAQgBjYC6AUgBCAJNgLYBSAEIBA2AuQFIAQgETYC4AUgBCAKNgLcBSAJIBBzIBFzIApzIQICQAJAQdSfAigCACIIRQ0AAkAgCGlBAUsiC0UEQCAIQQFrIAJxIQwMAQsgAiIMIAhJDQAgAiAIcCEMC0HQnwIoAgAgDEECdGooAgAiBUUNACAFKAIAIgVFDQAgCEEBayENA0ACQCACIAUoAgQiB0cEQAJAIAtFBEAgByANcSEHDAELIAcgCEkNACAHIAhwIQcLIAcgDEYNAQwDCyAFKAIIIAlHDQAgBSgCDCAKRw0AIAUoAhAgEUcNACAFKAIUIBBGDQMLIAUoAgAiBQ0ACwtBHBAjIgsgEDYCFCALIBE2AhAgCyAKNgIMIAsgCTYCCCALIAI2AgQgC0EANgIAIARBADYC6AUgCyAGNgIYAkBBACAIQdyfAigCAEEBarMiMEHgnwIqAgAiMSAIs5ReGw0AQQIhCQJAIAggCEEBa3FBAEcgCEEDSXIgCEEBdHIiBiAwIDGVjfwBIgUgBSAGSRsiBkEBRg0AIAYgBkEBa3FFBEAgBiEJDAELIAYQ9gEhCUHUnwIoAgAhCAsCQAJAIAggCU8EQCAIIAlNDQJB3J8CKAIAs0HgnwIqAgCVjfwBIQYgCSAIQQNJIAhpQQFLcgR/IAYQ9gEFIAZBAUEgIAZBAWtna3QgBkECSRsLIgYgBiAJSRsiCSAITw0CIAlFDQELIAlBgICAgARPDQggCUECdCIGECMhDkHQnwIoAgAhBUHQnwIgDjYCACAFBEBB1J8CKAIAGiAFECJB0J8CKAIAIQ4LQdSfAiAJNgIAIAYEQCAOQQAgBvwLAAtB2J8CKAIAIgZFDQEgBigCBCEIAkAgCWlBAUsiDEUEQCAIIAlBAWtxIQgMAQsgCCAJSQ0AIAggCXAhCAsgDiAIQQJ0akHYnwI2AgAgBigCACIHRQ0BIAlBAWshDQNAIAcoAgQhBQJAIAxFBEAgBSANcSEFDAELIAUgCUkNACAFIAlwIQULAkAgBSAIRgRAIAchBgwBCyAOIAVBAnRqIgooAgBFBEAgCiAGNgIAIAchBiAFIQgMAQsgBiAHKAIANgIAIAcgCigCACgCADYCACAKKAIAIAc2AgALIAYoAgAiBw0ACwwBC0HQnwIoAgAhBkHQnwJBADYCACAGBEBB1J8CKAIAGiAGECILQdSfAkEANgIAC0HUnwIoAgAiCCAIQQFrIgZxRQRAIAIgBnEhDAwBCyACIAhJBEAgAiEMDAELIAIgCHAhDAsCQEHQnwIoAgAiBiAMQQJ0aiIFKAIAIgJFBEAgC0HYnwIoAgAiAjYCAEHYnwIgCzYCACAFQdifAjYCACACRQ0BIAIoAgQhBQJAIAggCEEBayICcUUEQCACIAVxIQUMAQsgBSAISQ0AIAUgCHAhBQsgBiAFQQJ0aiALNgIADAELIAsgAigCADYCACACIAs2AgALQdyfAkHcnwIoAgBBAWo2AgALICEQygIgBEG4A2oQygILIAQgFzYC/AYgBCAYNgL4BiAEIBM2AvQGIAQgAzYC8AYLIBUgHkEGdGoiAiAEKQOIBzcCGCACIAQpA4AHNwIQIAIgBCkD+AY3AgggAiAEKQPwBjcCACACKAIgIgMEQCADECILIAIgBCgCkAc2AiAgAiAEKAKUBzYCJCACIAQoApgHNgIoQQAhByAEQQA2ApgHIARCADcDkAcgAigCMCIDBEAgAxAiIAQoApAHIQcLIAIgBCgCoAc2AjAgAiAEKAKkBzYCNCACIAQoAqgHNgI4IARBADYCqAcgBEIANwOgByAHBEAgBxAiCyAeQQFqIh4gHEcNAAsLIARBADYCwAYgBEIANwK4BiAEQbgGaiAcECUgBCAcNgK8BiAVIB1qIQICQCAbQQNJIgMNACAVKAI0IQUgBCgCuAYiB0EANgIAIBtBBkkNACAVQUBrIQYgFSEIA0AgCCgCdCEKIAcgBTYCBCAHQQRqIQcgBSAKaiEFIAYiCEFAayIGIAJHDQALCyAEQQA2AqAGIARCADcCmAYgBEGYBmogHBAlIAQgHDYCnAYCQCADDQAgFSgCHCEDIBUoAhghBiAVKAIUIQUgFSgCECEKIBUoAiQgBCgCmAYiByAAKAIEIgk2AgAgG0EGSQ0AIAlqIAUgCmogBmogA2prIQYgFUFAayEIIBUhBQNAIAUoAlwhAyAFKAJYIQogBSgCVCEJIAUoAlAhCyAFKAJkIAcgBjYCBCAGaiADIAogCSALampqayEGIAdBBGohByAIIgVBQGsiCCACRw0ACwsgGkEMaygCACECIAQoArgGIAQoArwGQQJ0akEEaygCACEDIARBADYCiAYgBEIANwKABiAEQYAGaiACIANqIgIQNSAEIAI2AoQGIBpBHGsoAgAhAiAEKAKYBiAEKAKcBkECdGpBBGsoAgAhBiAaQSRrKAIAIQUgGkEoaygCACEHIBpBLGsoAgAhCiAaQTBrKAIAIQggBEHoA2oiA0EAQSj8CwAgBEHYAGoiCSADQSj8CgAAIAAoAgQiAyACIAZqIAUgByAIIApqamprIgJBAXRLIANBEEtxAkAgAiADTQ0AIAAgAhDUAyACIAAoAgQiA2tBKGwiBkEATA0AIAZBKG4hBiAAKAIAIANBKGxqIQUDQCAFIAlBKPwKAAAgBUEoaiEFIAZBAUsgBkEBayEGDQALCyAAIAI2AgQEQEEAIQIgACgCACEDAkAgACgCBCIGRQ0AIAZBKGwiBRAnIQIgBUUNACACIAMgBfwKAAALIAAgAwR/IAMQIiAAKAIEBSAGCzYCCCAAIAI2AgALIARBADYC4AYgBEIANwLYBiAEQdgGaiAEKAKEBiICEDkgBCACNgLcBiAEQQA2AuADIARCADcC2AMgBEHYA2ogBCgChAYiAhAzIAQgAjYC3AMgG0EDTwRAQQAhCwNAAkAgC0EEdCIXIAQoAtgEaiICKAIAIgNBAEgNACACKAIMIQogAigCCCEIIAIoAgQhBkEAIQIgBEEANgL8ByAEQQA2AvgHIARBADYC9AcgBEEANgLwByAEQQA6AOMHIARBADoA4gcgBEEAOgDhByAEQQA6AO8GIARCgoCAgDA3AvgGIARCgICAgBA3AvAGIAEoAlgiDyADQQJ0IgVqIg5BeEEEIANBA3BBAkYbaiERIA8gBkECdCIHaiISQXhBBCAGQQNvQQJGG2ohFiAEKALoBCIYIAVqIRkgByAYaiEdIAQoApAEIRNBACEMQQAhBUEAIRBBACENA0AgAyEHAkACQAJAAkAgBEHwBmogBWooAgAiCQ4DAwABAgsgBiEHDAILIAghBwwBCyAKIQcLAkAgB0EASARAIARB/AdqIQcCQAJAAkACQCAJDgMDAAECCyAEQfgHaiEHDAILIARB9AdqIQcMAQsgBEHwB2ohBwsgB0F/NgIADAELAn8CQAJAAkAgCQ4CAAECCyAEIA4oAgAiBzYC/AcgByARKAIASCEHIBMgGSgCAEECdGooAgAhDSAEQeMHagwCCyAEIBIoAgAiBzYC+AcgByAWKAIASCEHIBMgHSgCAEECdGooAgAhECAEQeIHagwBCyAEQfQHaiAEQfAHaiAJQQJGIgkbIA8gCCAKIAkbIgdBAnQiHmoiISgCACIiNgIAIAwgEyAYIB5qKAIAQQJ0aigCACIeIAkbIQwgHiACIAkbIQIgIiAhQXhBBCAHQQNvQQJGG2ooAgBIIQcgBEHhB2ogBEHvBmogCRsLIAc6AAALIAVBBGoiBUEQRw0ACyAEIAQoAvwHNgKwBSAEIAQoAvgHNgK0BSAEIAQoAvQHNgK4BSAEIAQoAvAHNgK8BSAEIBA2AowFIAQgDTYCiAUgBCAMNgKUBSAEIAI2ApAFIAQtAOMHIQIgBC0A4gchAyAELQDhByEGIAQgBC0A7wY6AO8HIAQgBjoA7gcgBCADOgDtByAEIAI6AOwHIAtBAnQiDSAEKAKYBmooAgAhAiAEIAQpArAFNwNIIAQgBCkCuAU3A1AgBCAEKQKIBTcDOCAEIAQpApAFNwNAIAQgBCgA7Ac2AjQgBEHYBWogFSALQQZ0aiIMIARByABqIARBOGogBEE0aiACENIDIAQoAtwFIgIEfyACQQxsIgIEQCAEKAKABiAEKAK4BiANaigCAEEMbGogBCgC2AUgAvwKAAALIAQoAtwFBUEACyEFIAQoArgGIA1qKAIAIQYgBCgC2AYhAiAEIAEoAtgBIBdqIgMpAgg3A/gGIAQgAykCADcD8AYgBUEASgRAIAIgBkEEdGohBwNAIAcgBCkD+AY3AgggByAEKQPwBjcCACAHQRBqIQcgBUEBSyAFQQFrIQUNAAsgBCgC3AUhBSAEKAK4BiANaigCACEGCyAEKALYAyEDIAQgASgCqAEgC0EYbGoiAikDEDcDgAcgBCACKQMINwP4BiAEIAIpAwA3A/AGIAUEQCADIAZBGGxqIQcDQCAHIAQpA4AHNwMQIAcgBCkD+AY3AwggByAEKQPwBjcDACAHQRhqIQcgBUEBSyAFQQFrIQUNAAsLIAwoAgwhCSAMKAIIIQggDCgCBCECIAwoAgAhAwJAAkAgCkEATg0AIAJBBEEIIANBAUYbQQAgAxtBlJUBaigCAEYNACACIQogAyECDAELIAghCiADIQgLQQAhBSAEQQA2AugHIARBADYC5AcgBEEANgLcByAEQQA2AugGIARCgoCAgDA3AvgGIARCgICAgBA3AvAGA0AgCCEHAkACQAJAAkAgBEHwBmogBWooAgAiAw4DAwABAgsgAiEHDAILIAohBwwBCyAJIQcLIARB6AdqIQYCQAJAAkACQCAHDgMDAAECCyAEQeQHaiEGDAILIARB3AdqIQYMAQsgBEHoBmohBgsgBiADNgIAIAVBBGoiBUEQRw0ACyAMKAIcIAwoAhggDCgCFCAMKAIQampqQQV0IgIgDCgCJEEFdCIDRwRAIAMgDCgCICIGaiEDIAQoAugGIQogBCgC3AchDCAEKALkByETIAQoAugHIQ8gAiAGaiEHIAAoAgAgBCgCmAYgDWooAgBBKGxqIQUDQCAHKwMYISMgBysDECEkIAcrAwghJSAEIAcrAwA5A/AGIAQgJTkDyAMgBCAkOQO4AyAEICM5A9AHIARB8AZqIgYhCQJAAkACQAJAIA8OAwMAAQILIARByANqIQkMAgsgBEG4A2ohCQwBCyAEQdAHaiEJCwJAAkACQAJAIBMOAwMAAQILIARByANqIQYMAgsgBEG4A2ohBgwBCyAEQdAHaiEGCyAEQfAGaiIIIQICQAJAAkACQCAMDgMDAAECCyAEQcgDaiECDAILIARBuANqIQIMAQsgBEHQB2ohAgsCQAJAAkACQCAKDgMDAAECCyAEQcgDaiEIDAILIARBuANqIQgMAQsgBEHQB2ohCAsgCSsDACEjIAYrAwAhJCACKwMAISUgBSAIKwMAOQMgIAUgJTkDGCAFICQ5AxAgBSAjOQMIIAUgCzYCACAFQShqIQUgB0EgaiIHIANHDQALCyAEKALYBSICRQ0AIAIQIgsgC0EBaiILIBxHDQALCyAEQYAFaiABRwRAIAEoAtgBIgIEQCACECILIAEgBCgC2AY2AtgBIAEgBCgC3AY2AtwBIAEgBCgC4AY2AuABIARBADYC4AYgBEIANwLYBgsgBEGwAmogAUcEQCABKAKoASICBEAgAhAiCyABIAQoAtgDNgKoASABIAQoAtwDNgKsASABIAQoAuADNgKwASAEQQA2AuADIARCADcC2AMLIAAoAgQhAiAEQQA2ApAFIARCADcCiAUgBEGIBWogAhAzIAQgAjYCjAUgACgCBCIMBEAgASgCSCENIAEoAlghEyAEQbgHaiEPIARBoAdqIRggBEGIB2ohCCAAKAIAIRcgBCgCiAUhCSAEKALYBCEOQQAhEANAIBcgEEEobGoiBisDGCEjIAYrAxAhJCAGKwMIISUgDiAGKAIAQQR0aiIFKAIIIQIgBSgCBCEDIAUoAgAhBwJAIAUoAgwiCkEASARAQQAhBSAEQfAGakEAQcgA/AsAIARBAjYC4AUgBEKAgICAEDcC2AUDQCAHIQYCQAJAAkACQCAEQdgFaiAFaigCACILDgMDAAECCyADIQYMAgsgAiEGDAELIAohBgsgBEHwBmpBGEEwIAtBAUYbQQAgCxtqIgsgDSATIAZBAnRqKAIAQRhsaiIGKQMQNwMQIAsgBikDCDcDCCALIAYpAwA3AwAgBUEEaiIFQQxHDQALIAQrA6AHISYgBCsD8AYhJyAEKwOIByEoIAQrA6gHISkgBCsD+AYhKiAEKwOQByErIAkgEEEYbGoiAiAlIAQrA4AHoiAkIAQrA5gHoqAgIyAEKwOwB6KgOQMQIAIgJSAqoiAkICuioCAjICmioDkDCCACICUgJ6IgJCAooqAgIyAmoqA5AwAMAQsgBisDICEmQQAhBiAEQfAGakEAQeAA/AsAIARCgoCAgDA3AuAFIARCgICAgBA3AtgFIAEoAlgiCyAHQQJ0aiERIAsgA0ECdGohEiABKAJIIQMDQAJ/AkACQAJAIARB2AVqIAZqKAIAIgUOAgABAgsgBEHwBmohByADIBEoAgBBGGxqDAILIAghByADIBIoAgBBGGxqDAELIBggDyAFQQJGIgUbIQcgAyALIAIgCiAFG0ECdGooAgBBGGxqCyEFIAcgBSkDEDcDECAHIAUpAwg3AwggByAFKQMANwMAIAZBBGoiBkEQRw0ACyAEKwO4ByEnIAQrA6AHISggBCsD8AYhKSAEKwOIByEqIAQrA8AHISsgBCsDqAchLCAEKwP4BiEtIAQrA5AHIS4gCSAQQRhsaiICICUgBCsDgAeiICQgBCsDmAeioCAjIAQrA7AHoqAgJiAEKwPIB6KgOQMQIAIgJSAtoiAkIC6ioCAjICyioCAmICuioDkDCCACICUgKaIgJCAqoqAgIyAooqAgJiAnoqA5AwALIBBBAWoiECAMRw0ACwsCQCABQcAEayAERg0AIAEoAkgiAgRAIAIQIgsgAUIANwJIIAEgBCgCjAUiAjYCUCABIAI2AkwgAkUNACABIAJBGGwiAhAnIgM2AkggAkUNACADIAQoAogFIAL8CgAACyABKAJAIgJBAEwNAyABKAJMIQMgASgCjAEhBiAEQQA2AtADIARCADcCyAMgBEHIA2ogAyAfayIMIAYgAm4iBiAgIB9ramogAmwiAhBEIAQgAjYCzAMgAUGIAWohCwJAIAEoAowBIgJFDQAgAkEDdCICRQ0AIAQoAsgDIAsoAgAgAvwKAAALIAMgH0cEQCAAKAIAIB9BKGxqIQkgBCgC2AQhDSABKAJAIgBBAEwhE0EAIRcDQCATRQRAIAkgF0EobGoiAisDICEmIAIrAxghIyACKwMQISQgAisDCCElIA0gAigCACIDQQR0aiICKAIIIQ8gASgCeCADQQxsaiEYIAQoAsgDIAYgF2ogAGxBA3RqIQogCygCACEOQQAhAyACKAIMIhBBAE4hESACKAIAQQJ0IRIgAigCBEECdCEWA0ACQCARRQRAIARCADcDgAcgBEIANwP4BiAEQgA3A/AGIARBAjYC4AUgBEKAgICAEDcC2AUgDiADQQN0IgdqIQhBACEFA0AgBEHwBmpBCEEQIARB2AVqIAVqKAIAIgJBAUYbQQAgAhtqIAggGCACQQJ0aigCACAAbEEDdGorAwA5AwAgBUEEaiIFQQxHDQALIAcgCmogJSAEKwPwBqJEAAAAAAAAAACgICQgBCsD+AaioCAjIAQrA4AHoqA5AwAMAQsgBEIANwPYBSAEQgA3A7AFIARCADcDuAMgBEIANwPQByAEQoKAgIAwNwL4BiAEQoCAgIAQNwLwBiABKAJ4IgggEmohGSADQQN0Ih0gCygCAGohAiAIIBZqIR5BACEFA0ACfwJAAkACQCAEQfAGaiAFaigCACIHDgIAAQILIAIgGSgCACAAbEEDdGohByAEQdgFagwCCyACIB4oAgAgAGxBA3RqIQcgBEGwBWoMAQsgAiAIIA8gECAHQQJGIiAbQQJ0aigCACAAbEEDdGohByAEQbgDaiAEQdAHaiAgGwsgBysDADkDACAFQQRqIgVBEEcNAAsgCiAdaiAlIAQrA9gFokQAAAAAAAAAAKAgJCAEKwOwBaKgICMgBCsDuAOioCAmIAQrA9AHoqA5AwALIANBAWoiAyAARw0ACwsgF0EBaiIXIAxHDQALCyAGIB9rIQggFARAIAggDGohByABKAJoIQogASgCeCEJIAEoAkAhAkEAIQ4gBCgC+AQhDSAEKAKQBCETIAQoAsgEIQ8DQCAPIA5BAnQiAGooAgAiA0EASgRAIAcgACATaigCAGohGEQAAAAAAADwPyADQQFqt6MhIyALKAIAIgAgCSAKIA0gDkEMbGooAghBAnRqKAIAIgZBAnRqIgVBeEEEIAZBA29BAkYbaigCACACbEEDdGohFyAAIAUoAgAgAmxBA3RqIRBBACEFIAQoAsgDIREDQCAFQQFqIQAgAkEASgRARAAAAAAAAPA/ICMgALiiIiShISUgESAFIBhqIAJsQQN0aiESQQAhBQNAIBIgBUEDdCIGaiAlIAYgEGorAwCiICQgBiAXaisDAKKgOQMAIAVBAWoiBSACRw0ACwsgACIFIANHDQALCyAOQQFqIg4gFEcNAAsLIARBADYCwAMgBEIANwK4AyAEQbgDaiAEKAKEBiIAEDUgBCAANgK8AyAbQQNPBEBBACEXA0ACQCAEKALYBCAXQQR0aiICKAIAIgBBAEgNACACKAIMIQMgAigCCCEHIAIoAgQhAkEAIQUgBEEANgLQByAEQQA2AvwHIARBADYC+AcgBEEANgL0ByAEQQA2AvAHIARBADYC7AcgBEEANgLoByAEQQA2AuQHIARBAToA6AYgBEEBOgDjByAEQQE6AOIHIARBAToA4QcgBEKCgICAMDcC+AYgBEKAgICAEDcC8AYgBCgC6AQiEyAAQQJ0IgZqIRggASgCeCIJIAZqIQ4gEyACQQJ0IgZqIRAgBiAJaiEUIAEoAmghESABKAJYIRIgBCgCkAQhDQNAIAAhBgJAAkACQAJAIARB8AZqIAVqKAIAIgoOAwMAAQILIAIhBgwCCyAHIQYMAQsgAyEGCwJAIAZBAEgEQCAEQdAHaiEGAkACQAJAAkAgCg4DAwABAgsgBEH8B2ohBgwCCyAEQfgHaiEGDAELIARB9AdqIQYLIAZBfzYCAAwBCwJAAkACQAJAIAoOAgABAgsgBCAOKAIANgLQByAEIA0gGCgCAEECdGooAgA2AvAHIAAhBgwCCyAEIBQoAgA2AvwHIAQgDSAQKAIAQQJ0aigCADYC7AcgAiEGDAELIARB+AdqIARB9AdqIApBAkYiDxsgCSAHIAMgDxsiBkECdCIWaigCADYCACAEQegHaiAEQeQHaiAPGyANIBMgFmooAgBBAnRqKAIANgIACyASIAZBAnRqIg8oAgAgD0F4QQQgBkEDb0ECRhtqKAIASA0AIAAhBgJAAkACQAJAIAoOAwMAAQILIAIhBgwCCyAHIQYMAQsgAyEGCwJAIAkgESAGQQJ0Ig9qKAIAIhZBAnQiG2ooAgAgCUF4QQQgBkEDb0ECRhtqIA9qKAIARgRAIAlBeEEEIBZBA29BAkYbaiAbaigCACAAIQYCQAJAAkACQCAKDgMDAAECCyACIQYMAgsgByEGDAELIAMhBgsgCSAGQQJ0aigCAEYNAQsgBEHwB2ohBgJAAkACQAJAIAoOAwMAAQILIARB7AdqIQYMAgsgBEHoB2ohBgwBCyAEQeQHaiEGCyAGIAYoAgAgDGo2AgAMAQsgBEHoBmohBgJAAkACQAJAIAoOAwMAAQILIARB4wdqIQYMAgsgBEHiB2ohBgwBCyAEQeEHaiEGCyAGQQA6AAALIAVBBGoiBUEQRw0ACyAEIAQoAtAHNgLYBSAEIAQoAvwHNgLcBSAEIAQoAvgHNgLgBSAEIAQoAvQHNgLkBSAEIAQoAuwHIAhqNgK0BSAEIAQoAvAHIAhqNgKwBSAEIAQoAuQHIAhqNgK8BSAEIAQoAugHIAhqNgK4BSAEIAQtAOEHOgDfByAEIAQtAOIHOgDeByAEIAQtAOMHOgDdByAEIAQtAOgGOgDcByAXQQJ0IgAgBCgCmAZqKAIAIQIgBCAEKQK4BTcDGCAEIAQpArAFNwMQIAQgBCkC4AU3AyggBCAEKQLYBTcDICAEIAQoANwHNgIMIARB8AZqIBUgF0EGdGogBEEgaiAEQRBqIARBDGogAiAIahDSAwJAIAQoAvQGIgJFDQAgAkEMbCICRQ0AIAQoArgDIAQoArgGIABqKAIAQQxsaiAEKALwBiAC/AoAAAsgBCgC8AYiAEUNACAAECILIBdBAWoiFyAcRw0ACwsgCyAEQcgDahCSAiABIARBuANqIARBgAZqEJ4BIAQoArgDIgAEQCAAECILIAQoAsgDIgBFDQQgABAiDAQLEHIACxAmAAsQZgALIARBADYC+AYgBEIANwLwBiABIARBgAZqIARB8AZqEJ4BIAQoAvAGIgBFDQAgABAiCyAEKAKIBSIABEAgABAiCyAEKALYAyIABEAgABAiCyAEKALYBiIABEAgABAiCyAEKAKABiIABEAgABAiCyAEKAKYBiIABEAgABAiCyAEKAK4BiIABEAgABAiCyAVBEAgFSAaRwRAA0AgGkEQayIAKAIAIgEEQCABECILIABBADYCACAaQQxrQgA3AgAgGkEgaygCACIABEAgABAiCyAVIBpBQGoiGkcNAAsLIBUQIgsgBCgCkAQiAARAIAAQIgsgBCgCyAQiAARAIAAQIgsgBCgC2AQiAARAIAAQIgsgBCgC6AQiAARAIAAQIgsgBCgC+AQiAARAIAAQIgsgBEGACGokAAvHAQECfyACIAJBA20iAkEDbGsiAyABIAIQ2AMiBEYEQCAAQX82AgggAEJ/NwIADwsgBEEASARAIAAgAzYCBCAAIAI2AgAgAEEEQQggA0EBRhtBACADG0GUlQFqKAIANgIIDwsgACABKAJoIAJBDGxqIARBAnRqKAIAQQNtIgEgAiABIAJIIgEbNgIAIABBBEEIIARBAUYbQQAgBBtBlJUBaigCACICIANHQQJBAyACIANGGyABGyIBNgIEIAAgAUEBakEDcTYCCAufAwEGfyMAQSBrIgMkACADQX82AhwgA0F/NgIYIANBfzYCFCADQX82AhAgA0ECNgIMIANCgICAgBA3AgQgAkEDbCEGA0AgA0EEaiAFaigCACIHIAZqIQggA0EcaiEEAkACQAJAAkAgBw4DAwABAgsgA0EYaiEEDAILIANBFGohBAwBCyADQRBqIQQLIAQgCDYCACAFQQRqIgVBDEcNAAsCQCAAAn8gASACENgDIgRBAEgEQCADKAIUIQUgAygCGCECIAMoAhwhBCADKAIQDAELIAIgASgCaCACQQxsaiAEQQJ0aigCACIFQQNtIgZKBEAgAEJ/NwIIIABCfzcCAAwCCyADQRxqIQECQAJAAkACQCAEDgMDAAECCyADQRhqIQEMAgsgA0EUaiEBDAELIANBEGohAQtBfkEBQX5BASAFIAZBA2xrQQJGGyAFaiIEQQNvQQJGGyAEaiECQX5BAUF+QQEgASgCACIBQQNvQQJGGyABaiIFQQNvQQJGGyAFags2AgwgACAFNgIIIAAgAjYCBCAAIAQ2AgALIANBIGokAAtmAQR/IwBBEGsiAiQAIAJBAjYCDCACQoCAgIAQNwIEIAFBA2whBEF/IQEDQEF+IAJBBGogA2ooAgAiBSABQX9HGyABIAAgBCAFahDmARshASADQQRqIgNBDEcNAAsgAkEQaiQAIAELxQQBBH8CQAJAAkACQCADDgMDAgABCyACKAIAKAIAIgIgAUEEayIBKAIAIgNBAnRqKAIAIAIgACgCACIFQQJ0aigCAEkEQCAEIAM2AgAgBCAAKAIANgIEDwsgBCAFNgIAIAQgASgCADYCBA8LIANBCEwEQCAAIAFGDQIgBCAAKAIANgIAIABBBGoiBSABRg0CIAIoAgAoAgAhBiAEIQADQCAAQQRqIQICQCAGIAUoAgAiA0ECdGooAgAgBiAAKAIAIgdBAnRqKAIASQRAIAAgBzYCBAJ/IAQgACAERg0AGgNAIAAgBiAFKAIAQQJ0aigCACAGIABBBGsiAygCACIHQQJ0aigCAE8NARogACAHNgIAIAMiACAERw0ACyAECyAFKAIANgIADAELIAIgAzYCAAsgAiEAIAVBBGoiBSABRw0ACwwCCyAAIAAgA0EBdiIGQQJ0IgdqIgUgAiAGIAQgBhC4ASAFIAEgAiADIAZrIgMgBCAHaiADELgBIAIoAgAhBiAFIQMCQANAIAEgA0YNASAEIAMoAgAiAiAAKAIAIgcgBigCACIIIAJBAnRqKAIAIAggB0ECdGooAgBJIgIbNgIAIANBBEEAIAIbaiEDIARBBGohBCAAQQBBBCACG2oiACAFRw0ACyABIANGDQIDQCAEIAMoAgA2AgAgBEEEaiEEIANBBGoiAyABRw0ACwwCCyAAIAVGDQEDQCAEIAAoAgA2AgAgBEEEaiEEIABBBGoiACAFRw0ACwwBCyAEIAAoAgA2AgALC8UEAQR/AkACQAJAAkAgAw4DAwIAAQsgAigCACgCACICIAFBBGsiASgCACIDQQJ0aigCACACIAAoAgAiBUECdGooAgBJBEAgBCADNgIAIAQgACgCADYCBA8LIAQgBTYCACAEIAEoAgA2AgQPCyADQQhMBEAgACABRg0CIAQgACgCADYCACAAQQRqIgUgAUYNAiACKAIAKAIAIQYgBCEAA0AgAEEEaiECAkAgBiAFKAIAIgNBAnRqKAIAIAYgACgCACIHQQJ0aigCAEkEQCAAIAc2AgQCfyAEIAAgBEYNABoDQCAAIAYgBSgCAEECdGooAgAgBiAAQQRrIgMoAgAiB0ECdGooAgBPDQEaIAAgBzYCACADIgAgBEcNAAsgBAsgBSgCADYCAAwBCyACIAM2AgALIAIhACAFQQRqIgUgAUcNAAsMAgsgACAAIANBAXYiBkECdCIHaiIFIAIgBiAEIAYQuQEgBSABIAIgAyAGayIDIAQgB2ogAxC5ASACKAIAIQYgBSEDAkADQCABIANGDQEgBCADKAIAIgIgACgCACIHIAYoAgAiCCACQQJ0aigCACAIIAdBAnRqKAIASSICGzYCACADQQRBACACG2ohAyAEQQRqIQQgAEEAQQQgAhtqIgAgBUcNAAsgASADRg0CA0AgBCADKAIANgIAIARBBGohBCADQQRqIgMgAUcNAAsMAgsgACAFRg0BA0AgBCAAKAIANgIAIARBBGohBCAAQQRqIgAgBUcNAAsMAQsgBCAAKAIANgIACwvFBAEEfwJAAkACQAJAIAMOAwMCAAELIAIoAgAoAgAiAiABQQRrIgEoAgAiA0ECdGooAgAgAiAAKAIAIgVBAnRqKAIASQRAIAQgAzYCACAEIAAoAgA2AgQPCyAEIAU2AgAgBCABKAIANgIEDwsgA0EITARAIAAgAUYNAiAEIAAoAgA2AgAgAEEEaiIFIAFGDQIgAigCACgCACEGIAQhAANAIABBBGohAgJAIAYgBSgCACIDQQJ0aigCACAGIAAoAgAiB0ECdGooAgBJBEAgACAHNgIEAn8gBCAAIARGDQAaA0AgACAGIAUoAgBBAnRqKAIAIAYgAEEEayIDKAIAIgdBAnRqKAIATw0BGiAAIAc2AgAgAyIAIARHDQALIAQLIAUoAgA2AgAMAQsgAiADNgIACyACIQAgBUEEaiIFIAFHDQALDAILIAAgACADQQF2IgZBAnQiB2oiBSACIAYgBCAGELoBIAUgASACIAMgBmsiAyAEIAdqIAMQugEgAigCACEGIAUhAwJAA0AgASADRg0BIAQgAygCACICIAAoAgAiByAGKAIAIgggAkECdGooAgAgCCAHQQJ0aigCAEkiAhs2AgAgA0EEQQAgAhtqIQMgBEEEaiEEIABBAEEEIAIbaiIAIAVHDQALIAEgA0YNAgNAIAQgAygCADYCACAEQQRqIQQgA0EEaiIDIAFHDQALDAILIAAgBUYNAQNAIAQgACgCADYCACAEQQRqIQQgAEEEaiIAIAVHDQALDAELIAQgACgCADYCAAsLnQIBDX8gACgCGCABQQJ0aigCACMAQRBrIgVBAjYCDCAFQoCAgIAQNwIEIAFBA2whB0EDbCEIQQAhAQNAIAVBBGogAWooAgAiBCAIaiIJQQJ0IgIgACgCDCIDKAIgaigCACEKIAAoAiAgAygCECACaigCACILQQNtIgxBAnRqKAIAIQ0gBCAHaiIOQQJ0IgQgACgCACIGKAIAaiADKAIAIAJqKAIANgIAIAYoAhAgBGogCyANIAxrQQNsajYCACAGKAIgIARqIAo2AgAgACgCFARAIAAoAgQgDkEFdGoiAiAAKAIQIAlBBXRqIgMpAxg3AxggAiADKQMQNwMQIAIgAykDCDcDCCACIAMpAwA3AwALIAFBBGoiAUEMRw0ACwu+AgELfyMAQdAAayIDJAAgAyACKAIAIgU2AgAgAyACKAIEIgY2AgQgAyACKAIIIgc2AgggAyACKAIMIgg2AgwgAyACKAIQIgk2AhAgAyACKAIUIgo2AhQgAyACKAIYIgs2AhggAyACKAIcIgw2AhwgAyACKAIgIg02AiAgAyACKAIkIgI2AiQCQCABBEAgAEUNASABLQAQQQFxDQFBACECA0AgAkEBaiICQYAIRgRAQQAhAiABLQAQDQMLIAMgBBDcAyAEQQFqIgQgAEcNAAsMAQsgAyACNgJMIAMgDTYCSCADIAw2AkQgAyALNgJAIAMgCjYCPCADIAk2AjggAyAINgI0IAMgBzYCMCADIAY2AiwgAyAFNgIoIABFDQADQCADQShqIAQQ3AMgBEEBaiIEIABHDQALCyADQdAAaiQAC4MBAQN/IABCADcCBCAAKAIAIQMgAEEANgIAIAAgASgCBCIEEJ8BIAAgBDYCBAJAAkAgASgCBCIEBEAgACgCACEAIAEoAgAhAQNAIAAgAkEwbGogAyABIAJBAnRqKAIAQTBsakEw/AoAACACQQFqIgIgBEcNAAsMAQsgA0UNAQsgAxAiCwuOAQICfwF8IwBBEGsiAiQAQYCfAi0AAEEBcUUEQEECQeyLAkEDEAYhA0GAnwJBAToAAEH8ngIgAzYCAAsgAiABKQIANwMIIAJBADYCBEH8ngIoAgBBAEEAIAJBBGogAkEIahAFIQQgAigCBCEBIAAgBPwDNgIEIABBnKACNgIAIAEEQCABEAQLIAJBEGokAAvSAwIHfwx8IwBB4ABrIgIkAAJ/AkAgAUEMbCIDIAAoAgAiBSgCaGooAgBBAEgNACACQoCAgIAQNwJIIAJBAjYCUCAFKAJYIANqIQcgACgCBCgCACABQTBsaiIDKwMoIQwgAysDICENIAMrAxghDiADKwMQIQ8gAysDCCEQIAMrAwAhESAFKAJIIQgDQCAIIAcgAkHIAGogBGooAgBBAnRqKAIAQRhsaiIGKwMAIQkgBisDCCEKIAMgBisDECILIAwgCyAMZBsiDDkDKCADIAogDSAKIA1kGyINOQMgIAMgCSAOIAkgDmQbIg45AxggAyAPIAsgCyAPZBsiDzkDECADIBAgCiAKIBBkGyIQOQMIIAMgESAJIAkgEWQbIhE5AwAgEiALoCESIBMgCqAhEyAUIAmgIRQgBEEEaiIEQQxHDQALIAIgEkQAAAAAAAAIQKM5A1ggAiATRAAAAAAAAAhAozkDUCACIBREAAAAAAAACECjIgk5A0ggCSAJYg0AIAIgAikDWDcDQCACIAIpA1A3AzggAiACKQNINwMwIAIgBUEw/AoAACACQTBqIAIQhQIMAQtBfwshAyAAKAIIKAIAIAFBAnRqIAM2AgAgAkHgAGokAAvyAgEIfyMAQRBrIgUkACAFQQA2AgggBUIANwIAIAUgAhAlIAUgAjYCBCAFKAIAIQIgACgCTCIHBEAgASgCACEBA0AgAiABIARBAnRqKAIAQQJ0aiAENgIAIARBAWoiBCAHRw0ACwsgACgCXCEBIAAoAkAhBwJAIAMEQCABRQ0BIAMtABBBAXENASAAKAJ4IQggACgCWCEGQQAhAEEAIQQDQCAAQQFqIgBBgAhGBEBBACEAIAMtABANAwsCQCAGIARBAnQiCWoiCigCACILQQBIDQAgCiACIAtBAnRqKAIAIgo2AgAgBw0AIAggCWogCjYCAAsgBEEBaiIEIAFHDQALDAELIAFFDQAgACgCeCEDIAAoAlghAEEAIQQDQAJAIAAgBEECdCIIaiIGKAIAIglBAEgNACAGIAIgCUECdGooAgAiBjYCACAHDQAgAyAIaiAGNgIACyAEQQFqIgQgAUcNAAsLIAIEQCACECILIAVBEGokAAu7CAINfwJ+IwBBMGsiBiQAIABBADYCKCAAQgA3AiAgAEEANgIYIABCADcCECAAQQA2AgggAEIANwIAIAEoAgQiBARAIAAgBEEBdEEBayIEEJ8BIAAgBDYCBCAAQRBqIARBfxAxIAEoAgQhBCAGQn83AwggBkJ/NwIoIABBIGogBEEBayAGQQhqELwEIAAoAiQhDiAGIAAoAhA2AhAgBiAAKAIUNgIUIAAoAiAhBCAGIA42AhwgBiAENgIYIAYgAigCADYCICAGIAIoAgQ2AiRBACEEIwBBIGsiByQAIAYpAhAhECAGKQIYIREgByAGKQIgNwIYIAcgETcCECAHIBA3AgggDgRAA0BBfyEFIAcoAhwhCAJ/QX8gBEF/SA0AGkF/IARBAWoiCSAITg0AGiAEIAlzZ0EgciAHKAIYIgIgBEECdGooAgAiAyACIAlBAnRqKAIAIgJGDQAaIAIgA3NnCyEJAkAgBEEATCAEIAhKcg0AIAcoAhgiAiAEQQJ0aigCACIFIAIgBEEBayIDQQJ0aigCACICRgRAIAMgBHNnQSByIQUMAQsgAiAFc2chBQsgBygCGCEKAn9BfyAEIAUgCUggBSAJSmsiC2siAkEASCACIAhOcg0AGiACIARzZ0EgaiAKIARBAnRqKAIAIgMgCiACQQJ0aigCACICRg0AGiACIANzZwshDCAKIARBAnRqIQ1BgAEhBQNAAn9BfyAFIgIgC2wgBGoiA0EASCADIAhOcg0AGiADIARzZ0EgaiANKAIAIgUgCiADQQJ0aigCACIDRg0AGiADIAVzZwsgAkECdCEFIAxKDQALIAJBAXYhBUEAIQMDQAJ/QX8gAyAFaiIPIAtsIARqIgJBAEggAiAITnINABogAiAEc2dBIGogDSgCACIJIAogAkECdGooAgAiAkYNABogAiAJc2cLIQIgDyADIAIgDEobIQMgBUEBdiIFDQALIAQgAyALbCAEaiIDIAMgBEobIQIgBygCGCELAn9BfyAEIAMgAyAESBsiCEEASCAHKAIcIg0gCExyDQAaIAIgCHNnQSBqIAsgAkECdGooAgAiBSALIAhBAnRqKAIAIgNGDQAaIAMgBXNnCyEPIAggAmshDCALIAJBAnRqIQkgAiEDA0AgCCAMQQFqQQF1IgwgA2oiCkoEQCAKIAMCf0F/IApBAEggCiANTnINABogAiAKc2dBIGogCSgCACIFIAsgCkECdGooAgAiA0YNABogAyAFc2cLIA9KGyEDCyAMQQFKDQALIAcoAhAgBEEDdGoiBSADQQF0IAIgA0dyIgk2AgAgBSADQQFqIgJBAXQgAiAIR3IiBTYCBCAHKAIIIgMgCUECdGogBEEBdEEBciICNgIAIAMgBUECdGogAjYCACAEQQFqIgQgDkcNAAsLIAdBIGokACAAIAEQtgQLIAZBMGokACAAC5QJAQp/IwBBIGsiCCQAIAAoAlwhBSAIQQA2AhQgCEIANwIMIAhBDGogBUEDbiIEECUgCCAENgIQIAgoAgwiByAEQQJ0aiEJAkACQCAFQQJLBEADQCAHIAZBAnRqIAY2AgAgBkEBaiIGIARHDQALIAggAjYCHCAFQYMDSQ0BIAQhBgNAIAZBAnQQUCIFRQRAIAZBAXYiBg0BDAMLCyAHIAkgCEEcaiAEIAUgBhC5ASAFECIMAgsgCCACNgIcCyAHIAkgCEEcaiAEQQBBABC5AQsgCCgCDCIJIQYgCCgCECIFBEAgAigCACEHA0AgBiAGIAVBAXYiBEECdGoiBkEEaiAHIAYoAgBBAnRqKAIAQX9GIgobIQYgBCAFIARBf3NqIAobIgUNAAsLIAhBDGoiByAGIAlrQQJ1QQAQMSACIAcQpgEgASAHEN4DQQAhASMAQZABayIEJAAgBygCBCEJIAAoAlwiBkEDbiIFIAAoAtwBRgRAQQAhBiAAQdgBaiICQgA3AgQgAigCACEFIAJBADYCACACIAcoAgQiChA5IAIgCjYCBAJAAkAgBygCBCIKBEAgAigCACECIAcoAgAhCwNAIAIgBkEEdGoiDCAFIAsgBkECdGooAgBBBHRqIg0pAgg3AgggDCANKQIANwIAIAZBAWoiBiAKRw0ACwwBCyAFRQ0BCyAFECILIAAoAlwiBkEDbiEFCyAFIAAoAqwBRgRAIABBqAFqIAcQpQEgACgCXCIGQQNuIQULIAQgACgCZDYCbCAAQQA2AmQgACgCWCECIAQgBjYCZCAEIAI2AmAgBCAAKAJgNgJoIABBADYCYCAAQgA3A1ggBCAAKAJ0NgJ8IABBADYCdCAEIAAoAmg2AnAgBCAAKAJsNgJ0IAQgACgCcDYCeCAAQQA2AnAgAEIANwNoIAQgACgChAE2AowBIABBADYChAEgBCAAKAJ4NgKAASAEIAAoAnw2AoQBIAQgACgCgAE2AogBIABBADYCgAEgAEIANwN4IARBMGoiCkEAQTD8CwAgAEHYAGoiCyAKEKECIgIQ/QMgAkEgahBJIAJBEGoQSSACEEkgACgCvAEhDCAAQgA3ArwBIAAoArgBIQYgAEEANgK4ASAEQQA2AjggBEIANwIwIAogBRAlIAQgBTYCNCAJBEAgBygCACECIAQoAjAhBQNAIAUgAiABQQJ0aigCAEECdGogATYCACABQQFqIgEgCUcNAAsLIABBuAFqIQUgCyAJQQNsIgEQyQEgACgCvAEhAgJAIAxFBEAgAiEBDAELIAUgARBVIAAgATYCvAEgAkERSSACIAlBBmxNcg0AIAUQkwEgACgCvAEhAQsgBCALNgIIIAUoAgAhACAEIAw2AhwgBCAGNgIYIAQgATYCECAEIAA2AgwgBCAEQeAAajYCFCAEIAcpAgA3AiAgBCAEKQIwNwIoIAkgAyAEQQhqEN0DIAQoAjAiAARAIAAQIgsgBgRAIAYQIgsgBEGAAWoQSSAEQfAAahBJIARB4ABqEEkgBEGQAWokACAIKAIMIgAEQCAAECILIAhBIGokAAuxBQINfAV/IwBBoAFrIg8kACAPIAErAwAiAiABKwMgIgOgIAErA0AiBKAiCTkDmAEgDyAEIAKhIAOhIgo5A5ABIA8gAiADoSAEoSILOQOAASAPIAMgAqEgBKEiDDkDiAEgASsDOCECIAErAyghAyABKwMQIQQgASsDMCEFIAErAxghBiABKwMIIQcgD0KAgICAgICA+D83A3ggD0KAgICAgICA+D83A1AgD0KAgICAgICA+D83AyggD0KAgICAgICA+D83AwAgDyAHIAahIgg5A3AgDyAFIAShIg05A2ggDyADIAKhIg45A2AgDyAIOQNYIA8gAyACoCICOQNIIA8gBSAEoCIDOQNAIA8gDTkDOCAPIAI5AzAgDyAHIAagIgI5AyAgDyAOOQMYIA8gAzkDECAPIAI5AwggD0GAAWoiEkEIaiETQQEhEQNAIBMgEkEQQRggEUECRhtqIBFBAUYbKwMAIQIgEiEBAkACQAJAIBAOAgIAAQsgEyEBDAELIBJBEEEYIBBBAkYbaiEBCyARIBAgAiABKwMAZBshECARQQFqIhFBBEcNAAsgDyAQQQV0aiIBKwMAIQYgASsDCCEHIAErAxAhCCAAIAlEAAAAAAAA8D+gIgJEAAAAAAAAAAAgAkQAAAAAAAAAAGQbnyICIAIgAqIgC0QAAAAAAADwP6AiAkQAAAAAAAAAACACRAAAAAAAAAAAZBufIgMgA6IgDEQAAAAAAADwP6AiAkQAAAAAAAAAACACRAAAAAAAAAAAZBufIgQgBKKgIApEAAAAAAAA8D+gIgJEAAAAAAAAAAAgAkQAAAAAAAAAAGQbnyIFIAWioKCfIgKjIAErAximOQMYIAAgBSACoyAIpjkDECAAIAQgAqMgB6Y5AwggACADIAKjIAamOQMAIA9BoAFqJAALTQEHf0EEECMiAyACNgIAQQQQIyIEIAI2AgBBwPABIAFBACEBQYDwASICIAFB1idqQQEhBUHPASADIAIgAUHaJ2ogBUHPAWogBBAKIAAL5QcCA38HfCMAQbACayIHJAAgByABKQMQNwMQIAcgASkDCDcDCCAHIAEpAwA3AwAgByABKQMYNwMYIAcgASkDIDcDICAHIAEpAyg3AyggByACKQMYNwPIASAHIAIpAxA3A8ABIAcgAikDCDcDuAEgByACKQMANwOwASAHIAIpAyA3A9ABIAcgAikDKDcD2AEgByACKQMwNwPgASAHIAIpAzg3A+gBIAcgAykDGDcDiAEgByADKQMQNwOAASAHIAMpAwg3A3ggByADKQMANwNwIAcgAykDIDcDkAEgByADKQMoNwOYASAHIAMpAzA3A6ABIAcgAykDODcDqAEgB0HwAWogByAHQbABaiIIIAdB8ABqIgkgBCAGENACIAcgASkDQDcDUCAHIAEpAzg3A0ggByABKQMwNwNAIAcgASkDSDcDWCAHIAEpA1A3A2AgByABKQNYNwNoIAcgAikDWDcDiAEgByACKQNQNwOAASAHIAIpA0g3A3ggByACKQNANwNwIAcgAikDYDcDkAEgByACKQNoNwOYASAHIAIpA3A3A6ABIAcgAikDeDcDqAEgByADKQNYNwMYIAcgAykDUDcDECAHIAMpA0g3AwggByADKQNANwMAIAcgAykDYDcDICAHIAMpA2g3AyggByADKQNwNwMwIAcgAykDeDcDOCAIIAdBQGsgCSAHRAAAAAAAAPA/IAShIAYQ0AJEAAAAAAAA8D8gBaEiBCAEIAQgBysDgAIiDKIgBSAMIAcrA6ACoCAHKwOoAkQAAAAAAAAAAKAiDKIiDaKgoiAFIAQgDaIgBSAHKwPAASIOIAcrA+ABoCAHKwPoAUQAAAAAAAAAAKAiDaIiC6KgIgqioKIgBSAEIAqiIAUgBSAOoiAEIAuioKKgoqAhDiAEIAQgBCAHKwP4ASILoiAFIAsgBysDmAKgIAyiIguioKIgBSAEIAuiIAUgBysDuAEiCyAHKwPYAaAgDaIiCqKgIg+ioKIgBSAEIA+iIAUgBSALoiAEIAqioKKgoqAhCyAEIAQgBCAHKwPwASIKoiAFIAogBysDkAKgIAyiIgqioKIgBSAEIAqiIAUgBysDsAEiCiAHKwPQAaAgDaIiD6KgIhCioKIgBSAEIBCiIAUgBSAKoiAEIA+ioKKgoqAhCiAAIAQgBCAEIAcrA4gCoiAFIAyioKIgBSAEIAyiIAUgDaKgIgyioKIgBSAEIAyiIAUgBCANoiAFIAcrA8gBoqCioKKgIgREAAAAAAAAAABiBHwgCyAEoyELIAogBKMhCiAOIASjBSAOCzkDECAAIAs5AwggACAKOQMAIAdBsAJqJAALgAsCCH8IfCMAQfAAayIEJAACQAJAAkAgACgCBCIDKAIEIgJFDQAgACgCACEFIANBBGoiBiEDA0AgAyACIAIoAhAgAUgiBxshAyACQQRBACAHG2ooAgAiAg0ACyADIAZGDQAgASADKAIQTg0BCyAAKAIIKAIAIAAoAgwoAgAgAUECdGooAgBqQQE6AAAMAQsCQAJAIAMoAhgiBiADKAIUIgFrQQV1QQFrDgICAAELIAEoAiAhBiAAKAIIKAIAIgIgASgCACIAakEBOgAAIAIgBmpBAToAACAEIAUoArgBIgIgAEEFdGoiASsDACACIAZBBXQiCGoiAisDAKEiCiAKIAqiIAErAwggAisDCKEiCiAKoqAgASsDECACKwMQoSIMIAyioJ8iC6MiDTkDWCAEIAogC6MiDjkDYCAEIAwgC6MiCzkDaCAFKAJIIgcgBSgCWCAAQQJ0aiIJKAIAQRhsaiICKwMAIQogAisDCCEMIAcgCUF4QQQgAEEDb0ECRhtqKAIAQRhsaiIHKwMAIQ8gBysDCCEQIAQgBysDECACKwMQIhGhOQMwIAQgECAMoTkDKCAEIA8gCqE5AyAgBEE4aiICIARB2ABqIARBIGoiBxCcASABIAQpA1A3AxggASAEKQNINwMQIAEgBCkDQDcDCCABIAQpAzg3AwAgBCALmjkDMCAEIA6aOQMoIAQgDZo5AyAgBSgCSCAFKAJYQXhBBCAGQQNvQQJGG2ogBkECdGooAgBBGGxqIgErAwAhCyABKwMIIQ0gBCABKwMQIBGhOQMYIAQgDSAMoTkDECAEIAsgCqE5AwggAiAHIARBCGoQnAEgBSgCuAEgCGoiASAEKQNQNwMYIAEgBCkDSDcDECABIAQpA0A3AwggASAEKQM4NwMAIAMoAhQiAysDGCADKwMooEQAAAAAAADgP6IhCiAFKAJoIQcgACECA0ACQCAGQX5BASAHIAJBAnRqKAIAIgFBA29BAkYbIAFqIgJGBEAgAysDOCADKwMIoEQAAAAAAADgP6IhCgwBCyAAIAJGDQAgBSgCuAEhASAFKAK8AQRAIAEgAkEFdGorAxhEAAAAAAAAAABjDQELRAAAAAAAAAAAIQsgASACQQV0aiIBKwMQIQwgASsDCCENIAErAwAhDiABIApEAAAAAAAAAABiBHwgASsDGAUgCws5AxggASAKIAyiOQMQIAEgCiANojkDCCABIAogDqI5AwALIAAgAkcNAAsMAQsgASAGRgR8RAAAAAAAAPh/BSABIQIDQCALRAAAAAAAAPA/RAAAAAAAAAAAIAIrAwgiDEQAAAAAAAAAAGIboEQAAAAAAADwP0QAAAAAAAAAACACKwMYIg1EAAAAAAAAAABiG6AhCyAKIAygIA2gIQogAkEgaiICIAZHDQALIAogC6MLIQwgBSgCvAEhByAFKAJoIQYgACgCECEAIAEoAgAiASECA0BBfkEBIAYgAkECdGooAgAiAkEDb0ECRhsgAmohAgJAIAcEQCAFKAK4ASACQQV0aisDGEQAAAAAAAAAAGMNAQsCfAJAAkAgACgCACIIIAJBA21qLQAAQQFGBEAgBSgCuAEhAwwBCyAFKAK4ASEDIAggBiACQQJ0aigCAEEDbWotAABBAUcNAQsgAyACQQV0aiIDKwMQIQ0gAysDCCEOIAMrAwAhD0QAAAAAAAAAACELRAAAAAAAAAAADAELRAAAAAAAAAAAIQsgAyACQQV0aiIDKwMQIQ0gAysDCCEOIAMrAwAhDyAMRAAAAAAAAAAAYgRAIAMrAxghCwsgDAshCiADIAs5AxggAyANIAqiOQMQIAMgDiAKojkDCCADIA8gCqI5AwALIAEgAkcNAAsLIARB8ABqJAALpgEBA38gAAJ/AkAgASgCBCIERQRAIAFBBGoiBSECDAELIAIoAgAhBgNAIAQiAigCECIEIAZKBEAgAiEFIAIoAgAiBA0BDAILIAQgBk4EQCACIQRBAAwDCyACKAIEIgQNAAsgAkEEaiEFC0EgECMhBCADKAIAKAIAIQMgBEEANgIcIARCADcCFCAEIAM2AhAgASACIAUgBBCCAUEBCzoABCAAIAQ2AgALyxkDE38CfAF+IwBBwAFrIgMkACAAQQA2ArwBIAAoAlwhCiAAQbgBaiIPEJMBIANBADYCkAEgA0IANwKIASADQYgBaiAKEFUgAyAKNgKMASADQQA2AoABIANCADcCeCADQfgAaiAKQQAQgQEgA0HoAGogABDwAyMAQSBrIgUkACAAKAJcIQYgA0HYAGoiBEEANgIIIARCADcCACAEIAZBA24iEUEAEIEBIAZBA08EQCAEKAIAIQkgACgCaCESIAAoAtgBIQsDQCAFQX82AhwgBUJ/NwIUIAVBAjYCECAFQoCAgIAQNwIIIBIgB0EMbGohEyALIAdBBHRqIgwoAgAhFEEAIQhBACEGA0ACQCALIBMgBUEIaiAGaigCACINQQJ0aigCAEEDbSIVQQR0aiIQKAIAIBRHDQAgECgCDCAMKAIMRw0AIBAoAgggDCgCCEcNACAFQRRqQQRBCCANQQFGG0EAIA0baiAVNgIAIAhBAWohCAsgBkEEaiIGQQxHDQALIAhBAUoEQCAHIAlqQQE6AAAgBUECNgIQIAVCgICAgBA3AghBACEGA0AgBUEUakEEQQggBUEIaiAGaigCACIIQQFGG0EAIAgbaigCACIIQQBOBEAgCCAJakEBOgAACyAGQQRqIgZBDEcNAAsLIAdBAWoiByARRw0ACwsgBUEgaiQAQQAhBiMAQTBrIgUkACAAKAJMIQcgA0HIAGoiCUEANgIIIAlCADcCACAJIAdBfxAxIAAoAkwhByAFQQA2AhggBUIANwIQIAVCfzcDACAFQn83AwggBUJ/NwMgIAVCfzcDKCAFQRBqIAcgBRCVAiAAKAJcIgdBA08EQANAIAQoAgAgBmotAABBAUYEQCAFQQI2AiggBUKAgICAEDcCICAGQQxsIQxBACELA0ACQAJAIAUoAhAgACgCWCAMaiAFQSBqIAtqKAIAQQJ0aigCACINQQR0aiIHKAIAIAAoAtgBIAZBBHRqIggoAgBHDQAgBygCDCAIKAIMRw0AIAcoAgggCCgCCEYNAQsgByAIKQIINwIIIAcgCCkCADcCACAJKAIAIA1BAnRqIgdBfiAGIAcoAgBBf0cbNgIACyALQQRqIgtBDEcNAAsgACgCXCEHCyAGQQFqIgYgB0EDbkkNAAsLIAUoAhAiBARAIAQQIgsgBUEwaiQAAkAgACgCnAEiBEUNACAAKAKYASEFIARBGGwiBBAnIQ4gBEUNACAOIAUgBPwKAAALIAAoAkwiBwRAIAAoAqgBIQggAygCSCEJQQAhBANAIAkgBEECdGooAgAiBkEATgRAIA4gBEEYbGoiBSAIIAZBGGxqIgYpAxA3AxAgBSAGKQMINwMIIAUgBikDADcDAAsgBEEBaiIEIAdHDQALCwJAAkAgAgRAIAItABAEQCAAQQ4QLAwDCyACIAIoAgxBAWo2AgwgCkUNASACLQAQQQFxDQFBACEFIAMoAogBIQdBACEEA0AgBUEBaiIFQYAIRgRAQQAhBSACLQAQDQMLAkAgACAEENYCBEAgA0IANwOoASADQgA3A6ABIANCADcDmAEgA0KAgICAgICA+L9/NwOwAQwBCyADQZgBaiAAIA4gACgCWCAEQQJ0aigCAEEYbGogBBDnAQsgByAEQQV0aiIGIAMpA7ABNwMYIAYgAykDqAE3AxAgBiADKQOgATcDCCAGIAMpA5gBNwMAIARBAWoiBCAKRw0ACwwBCyAKRQ0AQQAhBCADKAKIASEGA0ACQCAAIAQQ1gIEQCADQgA3A6gBIANCADcDoAEgA0IANwOYASADQoCAgICAgID4v383A7ABDAELIANBmAFqIAAgDiAAKAJYIARBAnRqKAIAQRhsaiAEEOcBCyAGIARBBXRqIgUgAykDsAE3AxggBSADKQOoATcDECAFIAMpA6ABNwMIIAUgAykDmAE3AwAgBEEBaiIEIApHDQALCyAPIANBiAFqRwRAIA8oAgAiBARAIAQQIgsgACADKAKIATYCuAEgACADKAKMATYCvAEgACADKAKQATYCwAEgA0EANgKQASADQgA3AogBCyACBEAgAi0AEEEBRgRAIABBDhAsDAILIAIgAigCDEEBajYCDAsgACgCXCIEQQNPBEBBACEFA0AgAygCWCAFai0AAEEBRgRAIANBAjYCECADQoCAgIAQNwIIIAVBA2whB0EAIQQDQAJAAkAgACgCaCADQQhqIARqKAIAIAdqIghBAnRqKAIAQQNtIgYgAygCWGotAABBAUcNACAAKALYASIJIAVBBHRqIgooAgAgCSAGQQR0aiIGKAIARw0AIAooAgwgBigCDEcNACAKKAIIIAYoAghGDQELIANCADcDoAEgAyAINgKYASABIANBmAFqEEwLIARBBGoiBEEMRw0ACyAAKAJcIQQLIAVBAWoiBSAEQQNuSQ0ACwsgAgRAIAItABAEQCAAQQ4QLAwCCyACIAIoAgxBAWo2AgwLIANCADcCQCADIANBQGsiCjYCPAJAAkAgASgCACIHIAEoAgQiD0cEQANAAkAgBysDCCIWRAAAAAAAAPA/Zg0AIAcoAgQhDCADIAcoAgAiCCAIQQJ0IgEgACgCaGooAgAiDSAAKAJYIAFqIgEoAgAiECABQXhBBCAIQQNvQQJGG2ooAgAiEUgiEhsiCTYCMCAKIQECQAJAIAMoAkAiBUUNAANAIAEiBCAFIgYgBSgCECAJSCILGyEBIAVBBEEAIAsbaigCACIFDQALIAEgCkYNACAJIAQgBiALGygCEE4NAQsgAyADQTBqIgE2AgggA0GYAWoiBSADQTxqIgYgASADQQhqIgkQ5AEgAygCmAEiBEKAgICAgICA+D83AzAgBCANNgIoIAQgFjkDICAEIAw2AhwgBCAINgIYIBINASADIAE2AgggBSAGIAEgCRDkASADKAKYASEEIAMgATYCCCAFIAYgASAJEOQBIAMoApgBIQEgAyAEKQMgNwOgASADIAQpAxg3A5gBIAQgASkDMDcDICAEIAEpAyg3AxggASADKQOgATcDMCABIAMpA5gBNwMoDAELAn8gECARSARAIAMgA0EwaiIBNgIIIANBmAFqIANBPGogASADQQhqEOQBIAMoApgBQRhqDAELIAMgA0EwaiIBNgIIIANBmAFqIANBPGogASADQQhqEOQBIAMoApgBQShqCyIBIAErAwgiFyAWIBYgF2QbOQMICyAPIAdBEGoiB0cNAAwCCwALIANCADcCNCADIANBNGo2AjAMAQsgAygCPCEEIAMgA0E0ajYCMCADQgA3AjQgBCAKRg0AA0AgAyAEKQMwNwOwASADIAQpAyg3A6gBIAMgBCkDIDcDoAEgAyAEKQMYIhg3A5gBIAMgACgCWCAYp0ECdGooAgA2AiwgAyADQSxqIgE2ArwBIANBCGoiBSADQTBqIgYgASADQbwBaiIHEOgDIAMoAghBFGogA0GYAWoQlwMgAyAAKAJYIAMoAqgBQQJ0aigCADYCLCADIAE2ArwBIAUgBiABIAcQ6AMgAygCCCADIAMpA7ABNwMQIAMgAykDqAE3AwggAyADKQOgATcDICADIAMpA5gBNwMYQRRqIAUQlwMCQCAEKAIEIgEEQANAIAEiBCgCACIBDQAMAgsACwNAIAQgBCgCCCIEKAIARw0ACwsgBCAKRw0ACwsCQAJAIAIEQCACLQAQBEAgAEEOECwMAwsgAiACKAIMQQFqNgIMIAAoAkwhBSADIAA2AgggAyADQdgAajYCGCADIANB6ABqNgIUIAMgA0H4AGo2AhAgAyADQTBqNgIMAkAgBUUNACACLQAQQQFxDQBBACEBQQAhBANAIAFBAWoiAUGACEYEQEEAIQEgAi0AEA0CCyADQQhqIAQQ5wMgBEEBaiIEIAVHDQALCyACLQAQQQFHDQEgAEEOECwMAgsgACgCTCEBIAMgADYCmAEgAyADQdgAajYCqAEgAyADQegAajYCpAEgAyADQfgAajYCoAEgAyADQTBqNgKcASABBEBBACEEA0AgA0GYAWogBBDnAyAEQQFqIgQgAUcNAAsLIAAQ6wMgACADQfgAahDUAgwBCyACIAIoAgxBAWo2AgwgABDrAyACLQAQQQFGBEAgAEEOECwMAQsgAiACKAIMQQFqNgIMIAAgA0H4AGoQ1AIgAi0AEEEBRgRAIABBDhAsDAELIAIgAigCDEEBajYCDAsgA0EwaiADKAI0ENMCIANBPGogAygCQBDSAgsgDgRAIA4QIgsgAygCSCIABEAgABAiCyADKAJYIgAEQCAAECILIAMoAmgiAARAIAAQIgsgAygCeCIABEAgABAiCyADKAKIASIABEAgABAiCyADQcABaiQAC94CAgJ/BnwjAEEgayIDJAAgA0EIaiABKAIIIgQgAigCACICIAEoAgQQ1wIgACADKwMYIgYgAysDCCIFIAWiIAMrAxAiCCAIoqAgBiAGoqCfIgajRAAAAAAAAAAAIAUgBqMiCr1C////////////AINCgICAgICAgPj/AFQiARsgBCgCqAEgAkEDbUEYbGoiAisDECIFIAIrAwAiByAHoiACKwMIIgkgCaKgIAUgBaKgnyIFo0QAAAAAAAAAACAHIAWjIge9Qv///////////wCDQoCAgICAgID4/wBUIgIboiAIIAajRAAAAAAAAAAAIAEbIAkgBaNEAAAAAAAAAAAgAhuiIApEAAAAAAAAAAAgARsgB0QAAAAAAAAAACACG6JEAAAAAAAAAACgoKBEHqfoSC7/7z9kOgAAIAAgAykDCDcDCCAAIAMpAxA3AxAgACADKQMYNwMYIANBIGokAAvNBAIJfwZ8IAAoArwBIgcEQCAAKAJIIQUgACgCWCEIIAAoAmghCSAAKAK4ASEGQQAhAANAAkAgCCAAQQJ0IgFqIgIoAgAiBCACQXhBBCAAQQNwQQJGG2ooAgAiA04NACAGIABBBXRqIgIrAxgiCkQAAAAAAAAAAGEgBiABIAlqKAIAQQV0aiIBKwMYIgtEAAAAAAAAAABhckUNACAFIANBGGxqIgMrAxAgBSAEQRhsaiIEKwMQoSEMIAMrAwggBCsDCKEhDSADKwMAIAQrAwChIQ4gCkQAAAAAAAAAAGIiAyALRAAAAAAAAAAAYnJFBEAgAkKAgICAgICA+D83AxggAiAMRAAAAAAAAAhAozkDECACIA1EAAAAAAAACECjOQMIIAIgDkQAAAAAAAAIQKM5AwAgAUKAgICAgICA+D83AxggASAMRAAAAAAAAAjAozkDECABIA1EAAAAAAAACMCjOQMIIAEgDkQAAAAAAAAIwKM5AwAMAQsgA0UEQCABKwMAIQogASsDCCELIAErAxAhDyACQoCAgICAgID4PzcDGCACIAwgD6BEAAAAAAAA4D+iOQMQIAIgDSALoEQAAAAAAADgP6I5AwggAiAOIAqgRAAAAAAAAOA/ojkDAAwBCyACKwMAIQogAisDCCELIAIrAxAhDyABQoCAgICAgID4PzcDGCABIA8gDKFEAAAAAAAA4D+iOQMQIAEgCyANoUQAAAAAAADgP6I5AwggASAKIA6hRAAAAAAAAOA/ojkDAAsgAEEBaiIAIAdHDQALCwtNAQd/QQQQIyIDIAI2AgBBBBAjIgQgAjYCAEGw8AEgAUEAIQFBgPABIgIgAUH0JmpBASEFQcUBIAMgAiABQfgmaiAFQcUBaiAEEAogAAugAQEDfyAAAn8CQCABKAIEIgRFBEAgAUEEaiIFIQIMAQsgAigCACEGA0AgBCICKAIQIgQgBkoEQCACIQUgAigCACIEDQEMAgsgBCAGTgRAIAIhBEEADAMLIAIoAgQiBA0ACyACQQRqIQULQeAAECMiBCADKAIAKAIANgIQIARBGGpBAEHIAPwLACABIAIgBSAEEIIBQQELOgAEIAAgBDYCAAvUAQIEfAJ/IAEoAgQiBygCWEF4QQQgAigCACICIAJBA20iCEEDbGtBAkYbaiACQQJ0aigCACECIAAgCDYCACAHKAJIIAJBGGxqIgIrAwAgASgCCCIBKwMAoSIDIAMgA6IgAisDCCABKwMIoSIDIAOioCACKwMQIAErAxChIgQgBKKgnyIFoyIGvUL///////////8Ag0L/////////9/8AWARAIAAgBjkDCCAAIAQgBaM5AxggACADIAWjOQMQDwsgAEIANwMYIABCADcDECAAQgA3AwgLpgUCB38JfCMAQeAAayIDJAAgAyACNgJMIAEoAgQhBwJAAkAgASgCACIGKAIEIgRFDQAgBkEEaiIIIQUDQCAFIAQgBCgCECACSCIJGyEFIARBBEEAIAkbaigCACIEDQALIAUgCEYNACACIAUoAhBODQELIAMgA0HMAGoiBTYCWCADIAdBzAFqIAUgA0HYAGoiBhB5IAMoAgAhBCMAQaACayICJAAgAiAEKQNINwNwIAIgBCkDQDcDaCACIAQpAzg3A2AgAiAEKQNQNwN4IAIgBCkDWDcDgAEgAiAEKQNgNwOIASACIAQpAyA3A0ggAiAEKQMoNwNQIAIgBCkDMDcDWCACQZABaiACQcgAahCQASACIAIrA9ABOQOYAiACIAIrA7gBOQOQAiACIAIrA6ABOQOIAiACIAIrA8gBOQOAAiACIAIrA7ABOQP4ASACIAIrA5gBOQPwASACIAIrA8ABOQPoASACIAIrA6gBOQPgASACIAIrA5ABOQPYASACIAJB2AFqEJABIAIrAwAhCyACKwMIIQwgAisDECENIAIrAxghDiACKwMgIQ8gAisDKCEQIAIrAzAhESACKwM4IRIgA0QAAAAAAADwv0QAAAAAAADwPyAELQCAARsiCiACKwNAojkDQCADIAogEqI5AzggAyAKIBGiOQMwIAMgCiAQojkDKCADIAogD6I5AyAgAyAKIA6iOQMYIAMgCiANojkDECADIAogDKI5AwggAyAKIAuiOQMAIAJBoAJqJAAgASgCACECIAMgBTYCVCAGIAIgBSADQdQAahDtAyADKAJYQRhqIANByAD8CgAAIAEoAgAhBgsgAyADQcwAaiIBNgJYIAMgBiABIANB2ABqEO0DIAAgAygCAEEYakHIAPwKAAAgA0HgAGokAAuzAQEGfyMAQRBrIgIkACABKAJMIQMgAEEANgIIIABCADcCACAAIAMQJSAAIAM2AgQgASgCTCEDIAJBADYCCCACQgA3AgAgAiADQQAQgQEgASgCXCIDBEADQCABKAJYIARBAnRqKAIAIgUgAigCAGoiBi0AACAGQQE6AABBAUcEQCAAKAIAIAVBAnRqIAQ2AgALIARBAWoiBCADRw0ACwsgAigCACIABEAgABAiCyACQRBqJAALkwQCBn8CfSACKAIAIQYgAAJ/AkAgASgCBCIERQ0AIAEoAgACfyAEQQFrIAZxIARpIgVBAU0NABogBiAEIAZLDQAaIAYgBHALIgdBAnRqKAIAIgJFDQAgAigCACICRQ0AIARBAWshCCAFQQFLIQkDQAJAIAYgAigCBCIFRwRAAkAgCUUEQCAFIAhxIQUMAQsgBCAFSw0AIAUgBHAhBQsgBSAHRw0DDAELIAIoAgggBkcNAEEADAMLIAIoAgAiAg0ACwtBEBAjIgIgBjYCBCACQQA2AgAgAygCACgCACEDIAJBADYCDCACIAM2AggCQEEAIAQgASgCDEEBarMiCiABKgIQIgsgBLOUXhsNACABIAQgBEEBa3FBAEcgBEEDSXIgBEEBdHIiAyAKIAuVjfwBIgcgAyAHSxsQcCABKAIEIgQgBEEBayIDcUUEQCADIAZxIQcMAQsgBCAGSwRAIAYhBwwBCyAGIARwIQcLAkAgASgCACIGIAdBAnRqIgcoAgAiA0UEQCACIAEoAgg2AgAgASACNgIIIAcgAUEIajYCACACKAIAIgNFDQEgAygCBCEFAkAgBCAEQQFrIgNxRQRAIAMgBXEhBQwBCyAEIAVLDQAgBSAEcCEFCyAGIAVBAnRqIAI2AgAMAQsgAiADKAIANgIAIAMgAjYCAAsgASABKAIMQQFqNgIMQQELOgAEIAAgAjYCAAuCAQECfwJAIAEoAgAiA0EASA0AIAIgA0ECdGooAgAiAyACIAEoAgRBAnRqKAIAIgRGDQAgBCACIAEoAghBAnRqKAIAIgFGIAEgA0ZyDQAgACgCCCICIAIoAgAiAkEBajYCACAAKAIAIAJBDGxqIgAgATYCCCAAIAQ2AgQgACADNgIACwtTACAAIAEoAgBBAEpBAkEAIAEoAgRBAEobckEEQQAgASgCCEEAShtyQQhBACABKAIMQQBKG3JBDGwiAUHgiAFqIAIQ8gMgACABQaCKAWogAhDyAwvUAQEEfyAAKAIEIgMgAUEBdEsgA0EQS3ECQCABIANNDQAgACABEDUgASAAKAIEIgNrQQxsIgRBAEwNACAEQQxuIQQgACgCACADQQxsaiEDA0AgAyACKAIINgIIIAMgAikCADcCACADQQxqIQMgBEEBSyAEQQFrIQQNAAsLIAAgATYCBARAQQAhASAAKAIAIQICQCAAKAIEIgNFDQAgA0EMbCIEECchASAERQ0AIAEgAiAE/AoAAAsgACACBH8gAhAiIAAoAgQFIAMLNgIIIAAgATYCAAsLqwkDGH8DfgF8IwBBwAFrIgIkACAAKAIUIAFBA3RqKQMAIhpCf1IEQCAaQgGIIhsgACgCMCIErYgiHCAAKAIsIgmtiKdBfyAAKAIodEF/c3EiEUEBaiEDIAAoAhwgAUEobGohBiARIQEgHKdBfyAJdEF/c3EiDCELIBunQX8gBHRBf3NxIg0hEkEBIRMgGqdBAXEiFgRAIA1BAWohEiAMQQFqIQtBACETIAMhAQsgBisDACEdIAYoAgwhDiACQX42ArwBIAJBAUF/IB1EAAAAAAAAAABkGyIFNgK0ASACIAVBACAFayAOQX9GGzYCsAEgAiADNgKsASACQfgAaiAAQRBqIhQgDUEBdK0gGkIBg4QgDK0gBEEBaiIErYaEIAOtIAQgCWqthoQQ2AJBKPwKAAAgAkEBQX8gBisDAEQAAAAAAAAAAGQbIgNBACADayAGKAIQQX9GGzYCuAEgAkECNgJ0IAJCgICAgBA3AmwgAUEBayEOIAtBAWshCSAGQQxqIQ8gAkGUAWohFyACQcwAaiEVA0AgAiASNgKkASACIBM2AqABIAshAyAOIgQhBQJAAkACQEEEQQggAkHsAGogEGooAgAiB0EBRhtBACAHGyIKQcCIAWooAgAiCA4CAgABCyACIAk2AqgBIAEhBCAJIgMhBQwBCyACQaQBaiACQaABaiAIQQJGGyIDIAMoAgBBAWsiBTYCACALIQMgASEECwJAIAVBAEgEQCACQoCAgICAgID8/wA3A0AgAkJ/NwNgIAJCfzcDWCACQn83A1AgAkJ/NwNIDAELIAJBQGsgFCACNAKgASACNAKkAUIBhoQgA6wgACgCMEEBaiIDrYaEIASsIAMgACgCLGqthoQQ2AJBKPwKAAALIAJBAUF/IAYrAwBEAAAAAAAAAABkGyIDQQAgA2sgDyAIQQJ0IgNqKAIQIgRBf0YbIgU2ArwBIAIgBigCDDYCICACIA8gB0ECdCIHaigCBDYCJCACIBUgCkHMiAFqKAIAIghBAnQiCmoiGEEQaigCADYCKCACIAMgFWooAgQiGTYCLCAHIBdqIgcoAgAhAyACIAQ2AjQgAiADNgIwIAJB+ABqIAJBQGtBKPwKAAAgACACQbABaiACQSBqEPMDIAIgDDYCqAEgAiARNgKsASACIA02AqQBIAIgFjYCoAEgAkGsAWohAwJAAkACQAJAIAgOAwMAAQILIAJBqAFqIQMMAgsgAkGkAWohAwwBCyACQaABaiEDCyADIAMoAgBBAWo2AgAgAkFAayAUIAI0AqABIAI0AqQBQgGGhCACNAKoASAAKAIwQQFqIgOthoQgAjQCrAEgAyAAKAIsaq2GhBDYAiIDQSj8CgAAIAIgBTYCuAEgAkEBQX8gBisDAEQAAAAAAAAAAGQbIgVBACAFayAKIA9qKAIEIgVBf0YbIgg2ArwBIAYoAgwhCiACIAQ2AgQgAiAKNgIAIAIgBygCADYCCCAYKAIQIQQgAiAFNgIUIAIgGTYCECACIAQ2AgwgAkH4AGogA0Eo/AoAACAAIAJBsAFqIAIQ8wMgAiAINgK4ASAQQQRqIhBBDEcNAAsLIAJBwAFqJAALsgwDFXwPfwJ+IwBBMGsiGCQAAkACQCAAKAIUIAFBA3RqKQMAIiZCf1ENACAAKAIcIAFBKGxqIh4oAghBAE4NACAAKwNYRAAAAAAAAAAARAAAAAAAAOC/ICanQQFxIiAbIg0gJkIBiCImp0F/IAAoAnQiAXRBf3NxIiG4oCAAKwOIAaKgIRQgACsDUCAAKwOAASANICYgAa2IIianQX8gACgCcCIBdEF/c3EiIrigoqAhFSAAKwNIIAArA3ggDSAmIAGtiKdBfyAAKAJsdEF/c3EiI7igoqAhDSAeQQxqISQgAEEwaiElA0AgHUEEdEHghgFqIgEoAgggIWohGSABKAIEICJqIRsgASgCACAjaiEcIAEoAgwgIGoiGkECRgRAIBlBAWohGSAbQQFqIRsgHEEBaiEcQQAhGgsCQCAAKAIUIBqsIBmsQgGGhCAbrCAAKAJ0QQFqIgGthoQgHKwgASAAKAJwaq2GhCInQh6IICeFQrnLk+fR7ZGsv39+IiZCG4ggJoVC66PEmbG3kuiUf34iJkIfiCAmhacgACgCGEEBa3EiAUEDdGopAwAiJkJ/USAmICdRcg0AA0AgACgCFCAAKAIYQQFrIAAoAhAgAWpxIgFBA3RqKQMAIiYgJ1ENASAmQn9SDQALCyAAKAIcIAFBKGxqIhcrAwAiC71C////////////AINCgICAgICAgPj/AFoEQCAAKAIoIBogGUEBdEECaq0gG0EBaq0gACgCdEEBaiIBrYaEIBxBAWqtIAEgACgCcGqthoSnckEDdGorAwAhCwsgHisDAEQAAAAAAAAAAGQgC0QAAAAAAAAAAGRHBEAgFygCCCIfQQBIBEAgACgCCCIBIAEoAgAiH0EBajYCACAAKwOIASEMIAArA1ghBCAAKwOAASEFIAArA1AhCSAAKwN4IQMgACsDSCECIB4rAwAhCiAAKwOQASEOIAArA5gBIQ8gGCAlEFchASAVIQcgFCEIAnwgDSAKRAAAAAAAAAAAYQ0AGiAERAAAAAAAAAAARAAAAAAAAOC/IBpBAUYbIgYgGbegIAyioCEIIAkgBiAbt6AgBaKgIQcgAiAGIBy3oCADoqAiBiALRAAAAAAAAAAAYQ0AGkQAAAAAAADwPyERRAAAAAAAAPA/IRIgDyAPoCANIgkgBqEiAiACoiAVIgMgB6EiAiACoqAgFCICIAihIgUgBaKgn6MiBUQAAAAAAADwP2MEQANAIBggCiAKIAuho0TNzMzMzMzsP6JEmpmZmZmZqT+gIgxEAAAAAAAA4D8gEiARo0QAAAAAAADgv6AiBCAEmiAMRAAAAAAAAOA/YxuhIAxEAAAAAAAA4L+gmSAEYxsiECAIoiACRAAAAAAAAPA/IBChIhOioCIWOQMoIBggByAQoiADIBOioCIPOQMgIBggBiAQoiAJIBOioCIMOQMYIBgoAhAiF0UNByAKIBcgGEEYaiAXKAIAKAIYEREAIA6hIgQgCkQAAAAAAAAAAGQgBEQAAAAAAAAAAGRzIhcbIQogBCALIBcbIQsgCSAMIBcbIQkgDCAGIBcbIQYgAyAPIBcbIQMgDyAHIBcbIQcgAiAWIBcbIQIgFiAIIBcbIQggEkQAAAAAAADgP6IhEiARIBAgEyAXG6IiESAFZA0ACwsgCCAKIAogC6GjIgWiIAJEAAAAAAAA8D8gBaEiAqKgIQggByAFoiADIAKioCEHIAYgBaIgCSACoqALIQYCQCABIBgoAhAiF0YEf0EQBSAXRQ0BQRQLIRkgFyAXKAIAIBlqKAIAEQAACyAAKwN4IQUgACgCYCEXIAArA0ghBCAAKwOAASEJIAAoAmQhASAAKwNQIQ4gACgCACAfQRhsaiIaIAArA1giAiAIIAIgCGQbIgMgAiAAKwOIASAAKAJot0QAAAAAAADwv6CioCICIAIgA2QbOQMQIBogDiAHIAcgDmMbIgMgDiAJIAG3RAAAAAAAAPC/oKKgIgIgAiADZBs5AwggGiAEIAYgBCAGZBsiAyAEIAUgF7dEAAAAAAAA8L+goqAiAiACIANkGzkDAAsgJCAdQQJ0aiAfNgIACyAdQQFqIh1BB0cNAAsLIBhBMGokAA8LEGYAC5ERAxR/FXwCfiMAQeAAayIFJAACQCAAKAIYIAAoAiQoAgBBAXRJDQAgAUIBiCIrp0F/IAAoAnQiAnRBf3NxIgogACgCaEoNACArIAKtiCIrp0F/IAAoAnAiA3RBf3NxIgsgACgCZEoNACArIAOtiKdBfyAAKAJsdEF/c3EiDCAAKAJgSg0AIAGnQQFxIQ0gBUJ/NwNAIAVCfzcDOCAFQn83AzAgBUJ/NwMoIAUgACgCKCISIApBAXRBAmqtIAFCAYOEIAtBAWqtIAJBAWoiAq0iK4aEIAxBAWqtIAIgA2qtIiyGhKdBA3RqKwMAIho5AyAgGplEAAAAAAAACECiIRggBUEsaiEJQX8hBkEAIQIDQCACQQR0QeCGAWoiCCgCCCAKaiEDIAgoAgQgC2ohBCAIKAIAIAxqIQcgCCgCDCANaiIUQQJGBEAgBEEBaiEEIAdBAWohB0EAIRQgA0EBaiEDCyACQQdqIhVBBHRB4IYBaiIIKAIIIApqIQ8gCCgCBCALaiEQIAgoAgAgDGohESASIANBAXRBAmqtIBStIAdBAWqtICyGhCAEQQFqrSArhoSEp0EDdGorAwAhFyAIKAIMIA1qIgNBAkYEQCAPQQFqIQ8gEEEBaiEQIBFBAWohEUEAIQMLIBIgD0EBdEECaq0gA60gEUEBaq0gLIaEIBBBAWqtICuGhISnQQN0aisDACEWAkAgGkQAAAAAAAAAAGQiAyAXRAAAAAAAAAAAZEcEQCAJIAJBAnRqQX42AgAgAiAGIBeZIhsgGGQgGyAZmWRxIgQbIQYgFyAZIAQbIRkgDiAWRAAAAAAAAAAAZCADc2ohDkEBIRMMAQsgAyAWRAAAAAAAAAAAZEYNACAVIAYgFpkiFyAYZCAXIBmZZHEiAxshBiAWIBkgAxshGQsgAkEBaiICQQdHDQALAkACQCAOQQRIIAZBAE5xRQRAIAlBfzYCGCAJQn83AhAgCUJ/NwIIIAlCfzcCAAwBCyAGQQR0QeCGAWoiAigCCCAKaiEDIAIoAgQgC2ohBCACKAIAIAxqIQdEAAAAAAAA4L8hFkQAAAAAAAAAAEQAAAAAAADgvyANGyIXIAq4oCAAKwOIASIkoiEgIAArA1ghGCAXIAu4oCAAKwOAASIhoiEiIAArA1AhHCAXIAy4oCAAKwN4IiWiIRsgACsDSCEXAkAgAigCDCANaiICQQJGBEAgA0EBaiEDIARBAWohBCAHQQFqIQcMAQtEAAAAAAAAAABEAAAAAAAA4L8gAkEBRhshFgsgACsDkAEhKSAAKwOYASEjIAVBCGogAEEwahBXIQYgHCAioCIiIR0gGCAgoCIgIR4CQAJ8IBcgG6AiGyAaRAAAAAAAAAAAYQ0AGiAYICQgFiADt6CioCEeIBwgISAWIAS3oKKgIR0gFyAlIBYgB7egoqAiHyAZRAAAAAAAAAAAYQ0AGgJAICMgI6AgICAeoSIWIBaiIBsgH6EiFiAWoiAiIB2hIhYgFqKgoJ+jIipEAAAAAAAA8D9jRQRAICAhFiAiIRcgGyEYDAELRAAAAAAAAPA/ISNEAAAAAAAA8D8hJCAbIRggIiEXICAhFgNAIAUgGiAaIBmho0TNzMzMzMzsP6JEmpmZmZmZqT+gIhxEAAAAAAAA4D8gJCAjo0QAAAAAAADgv6AiISAhmiAcRAAAAAAAAOA/YxuhIBxEAAAAAAAA4L+gmSAhYxsiHCAeoiAWRAAAAAAAAPA/IByhIiGioCIlOQNYIAUgHSAcoiAXICGioCImOQNQIAUgHyAcoiAYICGioCInOQNIIAYoAhAiAkUNAyAaIAIgBUHIAGogAigCACgCGBERACApoSIoIBpEAAAAAAAAAABkIChEAAAAAAAAAABkcyICGyEaICggGSACGyEZIBggJyACGyEYICcgHyACGyEfIBcgJiACGyEXICYgHSACGyEdIBYgJSACGyEWICUgHiACGyEeICREAAAAAAAA4D+iISQgIyAcICEgAhuiIiMgKmQNAAsLIB4gGiAaIBmhoyIZoiAWRAAAAAAAAPA/IBmhIhaioCEeIB0gGaIgFyAWoqAhHSAfIBmiIBggFqKgCyEfAkAgBiAGKAIQIgJGBH9BEAUgAkUNAUEUCyEDIAIgAigCACADaigCABEAAAsgHyAboZkgACsDeEQAAAAAAADQP6JjRQ0BIB0gIqGZIAArA4ABRAAAAAAAANA/omNFDQEgHiAgoZkgACsDiAFEAAAAAAAA0D+iY0UNASAAKAIIIgIgAigCACIDQQFqNgIAIAArA3ghGyAAKAJgIQQgACsDSCEWIAArA4ABISIgACgCZCEHIAArA1AhFyAAKAIAIANBGGxqIgIgACsDWCIYIB4gGCAeZBsiICAYIAArA4gBIAAoAmi3RAAAAAAAAPC/oKKgIhggGCAgZBs5AxAgAiAXIB0gFyAdZBsiGCAXICIgB7dEAAAAAAAA8L+goqAiFyAXIBhkGzkDCCACIBYgHyAWIB9kGyIXIBYgGyAEt0QAAAAAAADwv6CioCIWIBYgF2QbOQMAIAUgAzYCKEEAIQIDQCAJIAJBAnRqIgQgAyAEKAIAIgQgBEF+Rhs2AgAgAkEBaiICQQdHDQALDAILEGYACyATRQ0BCyAAKAIYIgIgACgCJCgCAEEBdEkNACABQh6IIAGFQrnLk+fR7ZGsv39+IitCG4ggK4VC66PEmbG3kuiUf34iK0IfiCArhacgAkEBa3EhAgNAIAAoAhQgAkEDdGoiAyABIAMpAwAiKyArQn9RIgMbNwMAIAMEQCAAKAIkIgMgAygCAEEBajYCACAAKAIcIAJBKGxqIAVBIGpBKPwKAAAMAgsgASArUQ0BIAAoAhgiA0EBayAAKAIQIAJqcSECIAAoAiQoAgBBAXQgA00NAAsLIAVB4ABqJAAL4gEBA38CQCABRQRAIABBADYCCCAAQgA3AgAgAEEAEOwCIABBADYCGCAAQQA2AhAMAQsgAEEANgIIIABCADcCACAAQQFBICABQQFrZ2siAXQiAxDsAiAAQQA2AhggAEEANgIQQSggAXQiAhAnIQEgACADNgIYIAAgATYCECACQQBMDQAgAkEobiECA0AgAUJ/NwMIIAFCgICAgICAgPz/ADcDACABQn83AxAgAUJ/NwMYIAFCfzcDICABQShqIQEgAkEBSyACQQFrIQINAAsLIABCgICAgBA3AiAgACADNgIUIAAL5AMDB3wJfwJ+IwBBMGsiDCQAIAAoAmghDSAAKAJsIQ4gACgCZCEJIAAoAlwhCiAAKAJYIQsgACgCYCEPIAArAyAhAyAAKwNQIQQgACsDSCEFIAArA0AhBiAAKwM4IQIgACsDMCEHIAArAyghCCAMIABBCGoQVyEQAkAgCyABQgGIIhIgDq2IIhMgDa2Ip0F/IAl0QX9zcUEBayIJayILIAogE6dBfyANdEF/c3FBAWsiDWsiCiAKIAtKGyIKIA8gEqdBfyAOdEF/c3FBAWsiDmsiCyAKIAtIGyABpyIKQQFxIgtrIg8gCSANIAkgDUgbIhEgDiAOIBFKGyIRIA8gEUgbIg9BAEgEfEQAAAAAAAAAAAUgDCACRAAAAAAAAAAARAAAAAAAAOC/IAsbIgIgDregIASioDkDKCAMIAcgBSACIA23oKKgOQMgIAwgCCAGIAIgCbegoqA5AxggECgCECIJRQ0BIAkgDEEYaiAJKAIAKAIYEREAIAOhIgJEAAAAAAAAAAAgAiACRAAAAAAAAAAAZBsgDxsLIQIgACgCACgCACAKQQN0aiACOQMAAkAgECAQKAIQIgBGBH9BEAUgAEUNAUEUCyEQIAAgACgCACAQaigCABEAAAsgDEEwaiQADwsQZgALTQEHf0EEECMiAyACNgIAQQQQIyIEIAI2AgBBqPABIAFBACEBQfDvASICIAFB1iZqQQEhBUHDASADIAIgAUHaJmogBUHDAWogBBAKIAALzycDGH8Ffgd8IwBBsAhrIgckAAJAAkAgBkUNACAGLQAQQQFHDQAgAEEOECwMAQsgAisDACElIAIrAxghJiACKwMQIScgAisDKCEkIAIrAwghKCACKwMgISkgB0IANwLABCAHQQA2AsgEIAdBwARqIgIgKSAooSIpIAOjRAAAAAAAAPA/oPwCIhBBAmoiCKxBICAkICehIiQgA6NEAAAAAAAA8D+g/AIiEUECaiIJZ2tBACARQQNqQQJPGyITQQFqIgutIiGGIAmsQgGGhCAmICWhIiogA6NEAAAAAAAA8D+g/AIiEkECaiIJrCALQSAgCGdrQQAgEEEDakECTxsiFGqtIiKGhCIjQgGEIiCnIgsQRCAHIAs2AsQEIAcgAjYC0AMgB0HYA2ogARBXIQwgByATNgK8BCAHIBQ2ArgEIAdBICAJZ2tBACASQQNqQQJPGyIVNgK0BCAHIBE2ArAEIAcgEDYCrAQgByASNgKoBCAHICQgEUEBa7ejIgM5A6AEIAcgKSAQQQFrt6MiJjkDmAQgByAqIBJBAWu3oyIkOQOQBCAHICc5A4gEIAcgKDkDgAQgByAlOQP4AyAHIAQ5A/ADIAcgBygC0AM2AtAEIAdB2ARqIQggB0HwA2ohCQJAIAcoAugDIgJFBEAgB0EANgLoBAwBCyACIAxGBEAgByAINgLoBCACIAggAigCACgCDBEBAAwBCyAHIAIgAigCACgCCBEEADYC6AQLIAdB8ARqIg8gCUHQAPwKAAACQCAGBEAgBi0AEA0BQQAhAkEAIQkDQCACQQFqIgJBgAhGBEBBACECIAYtABANAwsgB0HQBGogHxD5AyAfQgF8IR8gCUEBaiIJIAtHDQALDAELIAcgBygC0AQ2AvAFIAdB+AVqIQkCQCAHKALoBCICRQRAIAdBADYCiAYMAQsgAiAIRgRAIAcgCTYCiAYgAiAJIAIoAgAoAgwRAQAMAQsgByACIAIoAgAoAggRBAA2AogGCyAHQZAGaiINIA9B0AD8CgAAQQAhAgNAIAdB8AVqIB8Q+QMgH0IBfCEfIAJBAWoiAiALRw0ACyAHIAcoAvAFNgKQBwJAIAcoAogGIgJFBEAgB0EANgKoByAHQbAHaiANQdAA/AoAAAwBCyAHQZgHaiELAkAgAiAJRgRAIAcgCzYCqAcgAiALIAIoAgAoAgwRAQAgBygCqAchAgwBCyAHQQA2AogGIAcgAjYCqAcLIAdBsAdqIA1B0AD8CgAAIAIgAiALRgR/QRAFIAJFDQFBFAsgAigCAGooAgARAAALIAkgBygCiAYiAkYEf0EQBSACRQ0BQRQLIQkgAiACKAIAIAlqKAIAEQAACwJAIAggBygC6AQiAkYEf0EQBSACRQ0BQRQLIQggAiACKAIAIAhqKAIAEQAACwJAIAwgBygC6AMiAkYEf0EQBSACRQ0BQRQLIQggAiACKAIAIAhqKAIAEQAACwJAIAYEQCAGLQAQQQFGBEAgAEEOECwMAgsgBiAGKAIMQQFqNgIMCyAHQagDakL/////D0IBICC6IimfRAAAAAAAACRAovwHIh9C/////w8gIEIBhiAjQv////8HVhsiICAfICBUGyIfIB9CAVgbIh8gH0L/////D1obpyIZEPgDIQggACgCTCECIABByABqIg8gCCgCBCIJQQdsIgsQMyAAIAs2AkwgAkERSSACIAlBDmxNckUEQCAPEHELRAAAAAAAAPB/IAUgBUQAAAAAAAAAAGUbIQUgEUEBdK0gEK0gIYaEIBKtICKGhEL+////D4MhICAIQSBqIRYgB0HYB2ohFyAHQcAHaiEMIAdBuAZqIQ0gB0GgBmohCSAHQZgFaiEYIAdBgAVqIQsgB0GgAWohGyAHQYgBaiEcIAdBwAJqIR0gB0GoAmohHgNAIAdBADYCoAMgB0IANwKYAyAHQZgDakEBQQAQMSAHIAAoAkg2AvgBIAcgACgCTDYC/AEgByAHKQKYAzcDgAIgByAIKAIkNgKIAiAHIAgoAgA2AowCIAcgCCgCBDYCkAIgByAIKAIQNgKUAiAHIAgoAhQ2ApgCIAcgFjYCnAIgByAHKQLABDcDoAIgHiABEFchCiAHIAU5A5ADIAcgBDkDiAMgByADOQOAAyAHICY5A/gCIAcgJDkD8AIgByATNgLsAiAHIBQ2AugCIAcgFTYC5AIgByARNgLgAiAHIBA2AtwCIAcgEjYC2AIgByAnOQPQAiAHICg5A8gCIAcgJTkDwAIgByAHKQP4ATcD0AQgByAHKAKAAjYC2AQgByAHKAKEAjYC3AQgByAHKAKIAjYC4AQgByAHKAKMAjYC5AQgByAHKAKQAjYC6AQgByAHKAKUAjYC7AQgByAHKAKYAjYC8AQgByAHKAKcAjYC9AQgByAHKAKgAjYC+AQgByAHKAKkAjYC/AQCQCAHKAK4AiICRQRAIAdBADYCkAUMAQsgAiAKRgRAIAcgCzYCkAUgAiALIAIoAgAoAgwRAQAMAQsgByACIAIoAgAoAggRBAA2ApAFCyAYIB1B2AD8CgAAAkAgBgRAIAYtABANAUEAIQJCACEfA0AgAkEBaiICQYAIRgRAQQAhAiAGLQAQDQMLIAdB0ARqIB8Q9wMgHyAgUiAfQgF8IR8NAAsMAQsgByAHKALQBDYC8AUgByAHKQLUBDcC9AUgByAHKQLcBDcC/AUgByAHKQLkBDcChAYgByAHKQLsBDcCjAYgByAHKQL0BDcClAYgByAHKAL8BDYCnAYCQCAHKAKQBSICRQRAIAdBADYCsAYMAQsgAiALRgRAIAcgCTYCsAYgAiAJIAIoAgAoAgwRAQAMAQsgByACIAIoAgAoAggRBAA2ArAGCyANIBhB2AD8CgAAQgAhHwNAIAdB8AVqIB8Q9wMgHyAgUiAfQgF8IR8NAAsgByAHKALwBTYCkAcgByAHKQL0BTcClAcgByAHKQL8BTcCnAcgByAHKQKEBjcCpAcgByAHKQKMBjcCrAcgByAHKQKUBjcCtAcgByAHKAKcBjYCvAcgCQJ/IAcoArAGIgJFBEAgB0EANgLQByAXIA1B2AD8CgAAQQAMAQsCQCACIAlGBEAgByAMNgLQByACIAwgAigCACgCDBEBACAHKALQByECDAELIAcgAiACKAIAKAIIEQQAIgI2AtAHCyAXIA1B2AD8CgAAAkAgAiACIAxGBH9BEAUgAkUNAUEUCyACKAIAaigCABEAAAsgBygCsAYLIgJGBH9BEAUgAkUNAUEUCyEOIAIgAigCACAOaigCABEAAAsCQCALIAcoApAFIgJGBH9BEAUgAkUNAUEUCyEOIAIgAigCACAOaigCABEAAAsCQCAKIAcoArgCIgJGBH9BEAUgAkUNAUEUCyEKIAIgAigCACAKaigCABEAAAsCfwJAIAgoAgQiCiAIKAIgQQF0SQRAIAYEQCAGLQAQQQFGDQILIAggB0GQB2ogGUEBdCApIA8oAgAgBygCmAMoAgBBGGxqIgJBGGsrAwAgJaEgJKP8AqwgIoYgAkEQaysDACAooSAmo/wCrCAhhoQgAkEIaysDACAnoSADo/wCrEIBhoRCAYS6oyIqIBm4ovwDICpEAAAAAABAj0BkGyIZEPgDIgoQkgIgCCgCECICBEAgAhAiCyAIQQA2AhAgCCAHKAKkByICNgIYIAggAjYCFAJAIAJFDQAgCCACQShsIgIQJyIONgIQIAJFDQAgDiAHKAKgByAC/AoAAAsgCCAHKAKwBzYCICAIIAcoArQHNgIkIAcoAqAHIgIEQCACECILIAdBADYCqAcgB0IANwKgByAKKAIAIgIEQCACECILIAgoAgQhAiAHQQA2ApgHIAdCADcCkAcgB0GQB2oiCiACQQdsIgIQMyAHIAI2ApQHAkAgCiAPRwRAIA8oAgAiCgRAIAoQIiAHKAKUByECCyAHKAKQByEKIAAgAjYCTCAAIAo2AkggACAHKAKYBzYCUAwBCyAHKAKQByICRQ0AIAIQIgtBAAwCCyAGBEAgBi0AEEEBRg0BIAYgBigCDEEBajYCDAsgByAAKAJINgJYIAcgACgCTDYCXCAHIAcpApgDNwNgIAcgCCgCJDYCaCAHIAgoAgA2AmwgByAKNgJwIAcgCCgCEDYCdCAHIAgoAhQ2AnggByAWNgJ8IAcgBykCwAQ3A4ABIBwgARBXIRogByAFOQPwASAHIAQ5A+gBIAcgAzkD4AEgByAmOQPYASAHICQ5A9ABIAcgEzYCzAEgByAUNgLIASAHIBU2AsQBIAcgETYCwAEgByAQNgK8ASAHIBI2ArgBIAcgJzkDsAEgByAoOQOoASAHICU5A6ABIAcgBykDWDcD0AQgByAHKAJgNgLYBCAHIAcoAmQ2AtwEIAcgBygCaDYC4AQgByAHKAJsNgLkBCAHIAcoAnA2AugEIAcgBygCdDYC7AQgByAHKAJ4NgLwBCAHIAcoAnw2AvQEIAcgBygCgAE2AvgEIAcgBygChAE2AvwEAkAgBygCmAEiAkUEQCAHQQA2ApAFDAELIAIgGkYEQCAHIAs2ApAFIAIgCyACKAIAKAIMEQEADAELIAcgAiACKAIAKAIIEQQANgKQBQsgGCAbQdgA/AoAAAJAIAYEQCAKRQ0BQQAhDkEAIQIgBi0AEEEBcQ0BA0AgDkEBaiIOQYAIRgRAQQAhDiAGLQAQDQMLIAdB0ARqIAIQ9gMgAkEBaiICIApHDQALDAELIAcgBygC0AQ2AvAFIAcgBykC1AQ3AvQFIAcgBykC3AQ3AvwFIAcgBykC5AQ3AoQGIAcgBykC7AQ3AowGIAcgBykC9AQ3ApQGIAcgBygC/AQ2ApwGAkAgBygCkAUiAkUEQCAHQQA2ArAGDAELIAIgC0YEQCAHIAk2ArAGIAIgCSACKAIAKAIMEQEADAELIAcgAiACKAIAKAIIEQQANgKwBgsgDSAYQdgA/AoAAEEAIQIgCgRAA0AgB0HwBWogAhD2AyACQQFqIgIgCkcNAAsLIAcgBygC8AU2ApAHIAcgBykC9AU3ApQHIAcgBykC/AU3ApwHIAcgBykChAY3AqQHIAcgBykCjAY3AqwHIAcgBykClAY3ArQHIAcgBygCnAY2ArwHIAkCfyAHKAKwBiICRQRAIAdBADYC0AcgFyANQdgA/AoAAEEADAELAkAgAiAJRgRAIAcgDDYC0AcgAiAMIAIoAgAoAgwRAQAgBygC0AchAgwBCyAHIAIgAigCACgCCBEEACICNgLQBwsgFyANQdgA/AoAAAJAIAIgAiAMRgR/QRAFIAJFDQFBFAsgAigCAGooAgARAAALIAcoArAGCyICRgR/QRAFIAJFDQFBFAshCiACIAIoAgAgCmooAgARAAALAkAgCyAHKAKQBSICRgR/QRAFIAJFDQFBFAshCiACIAIoAgAgCmooAgARAAALAkAgGiAHKAKYASICRgR/QRAFIAJFDQFBFAshCiACIAIoAgAgCmooAgARAAALIAYEQCAGLQAQQQFGDQEgBiAGKAIMQQFqNgIMCyAHKAKYAygCACECIAdCADcDQCAHQgA3A0ggB0IANwNQIAdCADcDGCAHQgA3AyAgB0IANwMoIA8gAiAHQRhqEGdBBQwBCyAAQQ4QLEEBCyECIAcoApgDIgoEQCAKECILIAJFDQALAkAgAkEFRw0AIAgoAiAhAUEAIQkgB0EANgLYBCAHQgA3AtAEIAdB0ARqIAFBDGwiARA1IAcgATYC1AQgB0EANgKgAyAHQgA3ApgDIAdBmANqQQFBABAxIAgoAiQhAiAIKAIAIQsgCCgCBCEBIAgoAhAhECAIKAIUIREgBygC0AQhEiAHKALUBCEMIAcoApgDIQ0gBygCnAMhDyAHIBM2AqAGIAcgFDYCnAYgByAVNgKYBiAHIBY2ApQGIAcgETYCkAYgByAQNgKMBiAHIAE2AogGIAcgCzYChAYgByACNgKABiAHIA82AvwFIAcgDTYC+AUgByAMNgL0BSAHIBI2AvAFAkACQAJAIAYEQAJAIAFFDQAgBi0AEEEBcQ0AQQAhAgNAIAlBAWoiCUGACEYEQEEAIQkgBi0AEA0CCyAHQfAFaiACEPUDIAJBAWoiAiABRw0ACwsgBi0AEEEBRw0BIABBDhAsDAMLIAcgEzYCwAcgByAUNgK8ByAHIBU2ArgHIAcgFjYCtAcgByARNgKwByAHIBA2AqwHIAcgATYCqAcgByALNgKkByAHIAI2AqAHIAcgDzYCnAcgByANNgKYByAHIAw2ApQHIAcgEjYCkAcgAUUNAUEAIQIDQCAHQZAHaiACEPUDIAJBAWoiAiABRw0ACwwBCyAGIAYoAgxBAWo2AgwLIAcoApgDKAIAIQEgB0IANwI0IAdBADYCPCAHQgA3AwggB0EANgIQIAdB0ARqIgIgASAHQQhqEPQDIAdBADYCmAcgB0IANwKQByAAIAIgB0GQB2oQngEgBygCkAciAQRAIAEQIgsgABDtASAAEJMCIAAQjgEgABBYIABBABCNASAAIAYQVCAGRQRAIAAQWgwBCyAGLQAQQQFGBEAgAEEOECwMAQsgABBaIAYtABBBAUYEQCAAQQ4QLAwBCyAGIAYoAgxBAWo2AgwLIAcoApgDIgAEQCAAECILIAcoAtAEIgBFDQAgABAiCyAIKAIQIgAEQCAAECILIAhBADYCGCAIQgA3AhAgCCgCACIARQ0AIAAQIgsgBygCwAQiAEUNACAAECILIAdBsAhqJAALLAECfyAAKAIAIgEoAgAiAgRAIAEgAhCGAiAAKAIAIgAoAgAgACgCCBoQIgsLvwMBAX8gACABRwRAAkAgACgCDCICRQ0AIAIgAigCACICQQFrNgIAIAJBAUoNACAAKAIMIgIEQCACECILIABBADYCDCAAKAIAIgIEQCACECILIABBADYCCCAAQgA3AgALIAAgASgCDDYCDCABQQA2AgwgACABKAIANgIAIAAgASgCBDYCBCAAIAEoAgg2AgggAUEANgIIIAFCADcCAAJAIAAoAhwiAkUNACACIAIoAgAiAkEBazYCACACQQFKDQAgACgCHCICBEAgAhAiCyAAQQA2AhwgACgCECICBEAgAhAiCyAAQQA2AhggAEIANwIQCyAAIAEoAhw2AhwgAUEANgIcIAAgASgCEDYCECAAIAEoAhQ2AhQgACABKAIYNgIYIAFBADYCGCABQgA3AhACQCAAKAIsIgJFDQAgAiACKAIAIgJBAWs2AgAgAkEBSg0AIAAoAiwiAgRAIAIQIgsgAEEANgIsIAAoAiAiAgRAIAIQIgsgAEEANgIoIABCADcCIAsgACABKAIsNgIsIAFBADYCLCAAIAEoAiA2AiAgACABKAIkNgIkIAAgASgCKDYCKCABQQA2AiggAUIANwIgCwujTgIefxB8IwBBgANrIgokAAJAIAEoAgQiBUUNAAJAIAJFDQAgAi0AEEEBRw0AIABBDhAsDAELIAEoAgAhASAKIAU2AkwgCiABNgJIIApB0ABqIgNCADcCLCADQQA2AiQgA0IANwIcIAMgCigCSDYCLCADIAooAkw2AjAgA0IANwJEIANCADcCPCADQgA3AjRBBBAjIgFBATYCACADQQA2AogBIANCADcCgAEgA0EANgJ4IANCADcCcCADQQA2AmggA0IANwJgIANBADYCWCADQgA3AlAgAyABNgJMIANBADYC9AEgA0IANwLsASADQQA2AuQBIANCADcC3AEgA0EANgLUASADQgA3AswBIANBADYCxAEgA0IANwK8ASADQgA3A6gBIANCADcDsAEgA0H8AWpBAEEw/AsAIApBADYCQCAKQgA3AjhBACEFIwBBkAFrIgYkAAJAIAMoAjBFBEBBBBAjIgFBATYCACAKIAE2AgwgBkEANgKEASAKQQA2AgggCkIANwIAIAZBADYCgAEgBkIANwJ4IApBADYCGCAKQgA3AhAMAQsgBkEANgKMASAGQgA3AoQBIAZCADcCfCADKAIwIhRBAk8EQEEBIQEgAygCLCIJKwMQIiMhJiAJKwMAIiQhJSAJKwMIIichIQNAAkAgJCAJIAFBGGxqIg8rAwAiImMEQCABIQggIiEkDAELICIgJWNFDQAgASEFICIhJQsCQCAnIA8rAwgiImMEQCABIQQgIiEnDAELICEgImRFDQAgASELICIhIQsCQCAmIA8rAxAiImMEQCABIQwgIiEmDAELICIgI2NFDQAgASEHICIhIwsgAUEBaiIBIBRHDQALIAYgCzYChAEgBiAFNgJ8IAYgBzYCjAEgBiAENgKAASAGIAw2AogBCyAGIAg2AnggAyAGKQKIATcCoAEgAyAGKQKAATcCmAEgAyAGKQJ4NwKQASADQZABaiEBIAMoAiwhBQNAIAUgASANQQJ0IgRqKAIAQRhsaiAEQXhxaisDAJkiISAoICEgKGQbISggDUEBaiINQQZHDQALQQAhDSADQQA6ABggAyAoOQMQIAMgKERIr7ya8td6PqIiITkDACADICEgIaI5AwgjAEEQayIPJAAgA0EANgLQASADQcwBaiIcEC0gA0EANgLgASADQdwBaiIXEC0gA0EANgLwASADQewBaiIUEJQBQQAhBEEAIQFBACELQQAhDCMAQSBrIgckAAJAIAMoAjAiBUEETQRAAkACQAJAAkAgBQ4FAgEBAQABCyADKAIsIQQMAgsgBUEYbCIBECchBCABRQ0AIAQgAygCLCAB/AoAAAsgAygCHCIBBEAgARAiCyADQRxqIQsgAyAFNgIkIAMgBTYCICADIAQ2AhwDQCADKAIcIAVBGGxqIgRBGGshAQJAIAMoAiQiCCAFTQRAIAcgASkDEDcDGCAHIAEpAwg3AxAgByABKQMANwMIIAsgCEEBdEGAASAIGxAzIAMgAygCICIBQQFqNgIgIAMoAhwgAUEYbGoiASAHKQMYNwMQIAEgBykDEDcDCCABIAcpAwg3AwAMAQsgAyAFQQFqNgIgIAQgASkDEDcDECAEIAEpAwg3AwggBCABKQMANwMACyADKAIgIgVBBEkNAAsgAyAFNgIwIAMgAygCHCIENgIsCyADQTRqRAAAAAAAAAAAIAQrAwAiIiAEKwMIIiYgBCsDOCIhoSIjIAQrAyggBCsDQCIkoSIloiAEKwMQIicgJKEiJCAEKwMgICGhIiiioSIhICIgBCsDMCIioSIpICiiICMgBCsDGCAioSIjoqEiIiAioiAhICGiICQgI6IgKSAloqEiISAhoqCgnyIjoyIkoqEgJiAhICOjIiGioSAnICIgI6MiIqKhIAQrA1ggIqIgBCsDUCAhoiAEKwNIICSiRAAAAAAAAAAAoKCgoEQAAAAAAAAAAGYiASABRUECQQMQiAIMAQsgA0GQAWohCSADKAIsIQggAysDCCIiISEDQCABIgRBAWohASAEQQRNBEAgCCAJIARBAnRqKAIAIhFBGGxqIgQrAxAhIyAEKwMIISYgBCsDACEkIAEhBANAICQgCCAJIARBAnRqKAIAIhVBGGxqIg4rAwChIiUgJaIgJiAOKwMIoSIlICWioCAjIA4rAxChIiUgJaKgIiUgISAhICVjIg4bISEgFSALIA4bIQsgESAMIA4bIQwgBEEBaiIEQQZHDQALCyABQQZHDQALICEgImEEQCADQTRqQQBBAUECQQMQiAIMAQtEAAAAAAAA8D8gCCALQRhsaiIBKwMAIisgCCAMQRhsaiIEKwMAIiOhIiYgJqIgASsDCCItIAQrAwgiJKEiJSAloqAgASsDECIuIAQrAxAiJ6EiKCAooqCjIS9BACEEQX8hCSAiISEDQCAIIARBGGxqIgErAwAgI6EiKSApoiABKwMIICShIiwgLKKgIAErAxAgJ6EiKiAqoqAgLyAmICmiRAAAAAAAAAAAoCAlICyioCAoICqioCIpICmioqEiKSAhICEgKWMiARshISAEIAkgARshCSAEQQFqIgQgBUcNAAsgISAiYQRAQQAhAQNAIAEiBUEBaiEBIAUgDEYgBSALRnINAAsgBSEBA0AgAUEBaiIBIAxGIAEgC0ZyDQALIANBNGogDCALIAUgARCIAgwBC0QAAAAAAAAAACAjICQgCCAJQRhsaiIBKwMIIiKhIiogLiABKwMQIimhIi6iIC0gIqEiLSAnICmhIi+ioSIhICMgASsDACIsoSIwIC2iICsgLKEiKyAqoqEiKiAqoiAhICGiICsgL6IgMCAuoqEiISAhoqCgnyIroyItoqEgJCAhICujIi6ioSAnICogK6MiKqKhIStBACEBIAMrAwAiLyEhQQAhBANAICsgLSAIIARBGGxqIg4rAwCiRAAAAAAAAAAAoCAuIA4rAwiioCAqIA4rAxCioKCZIjAgISAhIDBjIg4bISEgBCABIA4bIQEgBEEBaiIEIAVHDQALICEgL2EEQCADQQE6ABggBUEYbCIBECchBCABBEAgBCAIIAH8CgAACyAmICIgJKEiIqIgJSAsICOhIiOioSIhICEgIaIgJSApICehIiSiICggIqKhIiEgIaIgKCAjoiAmICSioSIiICKioKCfIiOjISYgAygCHCIBBEAgARAiIAMoAiwhCAsgAyAFNgIkIAMgBTYCICADIAQ2AhwgCCsDACEkIAgrAwghJSAIKwMQIScgA0EcaiAFQQF0EDMgAygCHCIIIAMoAiAiAUEYbGoiBCAmICegOQMQIAQgIiAjoyAloDkDCCAEICEgI6MgJKA5AwAgAyABQQFqIgQ2AjAgAyAINgIsIAMgBDYCIAsgA0E0aiALIAwgKyAtIAggAUEYbGoiBCsDAKJEAAAAAAAAAACgIC4gBCsDCKKgICogBCsDEKKgoEQAAAAAAAAAAGYiBBsgDCALIAQbIAkgARCIAiADKAI0IgQgAygCOCIRRwRAIAMoAiwhASADKAJgIQsgAygCQCEIA0AgBCABIAggBCgCACIJQQR0aigCBEEYbGoiDCsDACIkIAEgCCALIAsgCUECdGooAgAiDkECdGooAgBBBHRqKAIEQRhsaiIJKwMAIiGhIiIgASAIIA5BBHRqKAIEQRhsaiIOKwMIIAkrAwgiI6EiJqIgDCsDCCIlICOhIiMgDisDACAhoSInoqEiISAhICGiICMgDisDECAJKwMQIiGhIiiiIAwrAxAiKSAhoSIhICaioSIjICOiICEgJ6IgIiAooqEiIiAioqCgnyImoyIhOQMYIAQgIiAmoyIiOQMQIAQgIyAmoyIjOQMIIAQgISAhoiAjICOiICIgIqKgoDkDKCAERAAAAAAAAAAAICQgI6KhICUgIqKhICkgIaKhOQMgIARByABqIgQgEUcNAAsLQQAhAQNAAkAgAygCNCIEIAMoAjgiCEYNAANAIAMgBCABEP8DDQEgBEHIAGoiBCAIRw0ACwsgAUEBaiIBIAVHDQALCyAHQSBqJAAgA0EANgKcAiADKAKQAiADKAKMAiIHa0ECdSIFQQNPBEADQCAHKAIAECIgAyADKAKMAkEEaiIHNgKMAiADKAKQAiAHa0ECdSIFQQJLDQALC0GABCEHAkACQAJAIAVBAWsOAgEAAgtBgAghBwsgAyAHNgKYAgsgA0GIAmohCyADQTRqIQRBACEHA0ACQCAEKAIAIAdByABsaiIBKAJEIgVFDQAgBSgCBEUNACAPIAc2AgQgCyAPQQRqEIAEIAEgAS0AQEECcjoAQAsgB0EBaiIHQQRHDQALIAMoApwCIgEEQCADQfwBaiEdIANBvAFqIRggA0GsAWohHiADQaACaiEfA0AgAygCjAIgAygCmAIiBUEIdkH8//8HcWooAgAgBUH/B3FBAnRqKAIAIQcgAyABQQFrNgKcAiADIAVBAWo2ApgCIAsoAhBBgBBPBEAgCygCBCgCABAiIAsgCygCBEEEajYCBCALIAsoAhBBgAhrNgIQCyADKAI0IAdByABsaiIIIAgtAEBB/QFxOgBAIBZBAWoiAUEAIAFBf0cbIRYCQCAIKAJERQ0AIAgoAgBBf0YNACAIKAI4IRUgA0EANgLgASADKAIsIQwgFxAtIANBADYC8AEgFBCUASADQQA2AtABIBwQLSAVQRhsAkAgAygC8AEiASADKAL0ASIFTwRAIBQgBUEBdEGAASAFGxBEIAMgAygC8AEiAUEBajYC8AEMAQsgAyABQQFqNgLwAQsgAygC7AEgAUEDdGogB61CgICAgHCENwIAIAxqIQwDQAJAIAMoAvABIgEEQCADKALsASABQQN0aiIFQQRrKAIAIQkgBUEIaygCACEHIBQgAUEBayIFEEQgAyAFNgLwASABQRFJIAEgBUEBdE1yRQRAIBQQlAELIBYgBCgCACAHQcgAbGoiASgCPEYEQCABLQBAIgVBAXENAwwCCyABIBY2AjwgAS0AQCEFIAErAyAgASsDCCAMKwMAokQAAAAAAAAAAKAgASsDECAMKwMIoqAgASsDGCAMKwMQoqCgRAAAAAAAAAAAZEUNASABIAVB4gFxQQFyOgBAAkAgAygC0AEiBSADKALUASIOTwRAIBwgDkEBdEGAASAOGxAlIAMgAygC0AEiBUEBajYC0AEMAQsgAyAFQQFqNgLQAQsgAygCzAEgBUECdGogBzYCACAPIAEoAgAiATYCBCAPIAMoAmAiBSABQQJ0aigCACIBNgIIIA8gBSABQQJ0aigCADYCDEEAIQcDQAJAIAMoAkAgD0EEaiAHaigCACIBQQR0aigCCCIFIAlGDQAgAygCUCAFQQJ0aigCACEFIAMoAvABIg4gAygC9AEiEU8EQCAUIBFBAXRBgAEgERsQRCADIAMoAvABIg5BAWo2AvABIAMoAuwBIA5BA3RqIAWtIAGtQiCGhDcCAAwBCyADIA5BAWo2AvABIAMoAuwBIA5BA3RqIAWtIAGtQiCGhDcCAAsgB0EEaiIHQQxHDQALDAILIAMoAuABIQ4Cf0EBIBcoAgQiEUECSQ0AGiADKAJAIQcgFygCACEJQQAhAUEBIQUDQCAHIAkgAUECdGooAgBBBHRqKAIEIRIgBSEBAkADQCAHIAcgCSABQQJ0aiIQKAIAIhNBBHRqKAIIQQR0aigCBCASRg0BIAFBAWoiASARRw0AC0EADAILIAkgBUECdGoiASgCACESIAEgEzYCACAQIBI2AgAgBSIBQQFqIgUgEUcNAAtBAQtFBEAgAyADKAKoAUEBajYCqAEgCEHEAGoiDCgCACIIKAIEIgkEQCAIKAIAIQ5BACEBQQAhBwNAAkBBASEFAkAgFSAOIAdBAnRqIhEoAgAiEkcEQCABIgVBAUYNAQsgBSEBIAdBAWoiByAJSQ0CIAFBAUcNByAIIAlBAWtBABAxIAwoAgAiCCgCBCEJDAELIBFBBGsgEjYCAEECIQEgB0EBaiIHIAgoAgQiCUkNAQsLIAkNBAsgCCgCCEGBAU8EQCAMQQA2AgAgCBB1DAQLIB8gDBDaAgwDC0EAIQkgA0EANgKwASAeEC0gA0EANgLAASAYEC0gHSADKAL8ARCGAiAOQQF0IREgAygC0AEiAQRAIAMoAswBIgUgAUECdGohEwNAIA8gAygCNCAFKAIAIhJByABsaiIZKAIAIgE2AgQgDyADKAJgIgcgAUECdGooAgAiATYCCCAPIAcgAUECdGooAgA2AgxBACEHA0ACQCAZLQBAQQJ2QQdxIAd2QQFxDQAgD0EEaiAHQQJ0aigCACEBIAkgEUkEQAJAIAMoAsABIgggAygCxAEiEE8EQCAYIBBBAXRBgAEgEBsQJSADIAMoAsABIghBAWo2AsABDAELIAMgCEEBajYCwAELIAMoArwBIAhBAnRqIAE2AgAgCUEBaiEJDAELIAQoAgwgAUEEdGpBfzYCCAJAIAQoAlAiCCAEKAJUIhBPBEAgBEHMAGogEEEBdEGAASAQGxAlIAQgBCgCUCIIQQFqNgJQDAELIAQgCEEBajYCUAsgBCgCTCAIQQJ0aiABNgIACyAHQQFqIgdBA0cNAAsgBCgCACASQcgAbGoiB0F/NgIAAkAgBCgCQCIBIAQoAkQiCE8EQCAEQTxqIAhBAXRBgAEgCBsQJSAEIAQoAkAiAUEBajYCQAwBCyAEIAFBAWo2AkALIAQoAjwgAUECdGogEjYCACAHKAJEIQEgB0EANgJEIA8gATYCAAJAIAFFDQAgHSAPENoCIA8oAgAhASAPQQA2AgAgAUUNACABEHULIAVBBGoiBSATRw0ACwsgCSARSQRAIBEgCWshEkEAIQcDQAJAIAQoAlAiAQRAIAQoAkwgAUECdGpBBGsoAgAhBSAEQcwAaiIJIAFBAWsiCBAlIAQgCDYCUCABQRFJIAEgCEEBdE1yDQEgCRAtDAELIARBDGohBQJ/IAQoAhAiASAEKAIUIghPBEAgBSAIQQF0QYABIAgbEDkgBCgCDCAEKAIQIgFBBHRqDAELIAUoAgAgAUEEdGoLIgVCADcCCCAFQgA3AgAgBCABQQFqNgIQIARBHGohBQJAIAQoAiAiASAEKAIkIghPBEAgBSAIQQF0QYABIAgbECUgBCgCHCAEKAIgIgFBAnRqQQA2AgAMAQsgBSgCACABQQJ0akEANgIACyAEIAFBAWo2AiAgBEEsaiEFAkAgBCgCMCIBIAQoAjQiCE8EQCAFIAhBAXRBgAEgCBsQJSAEKAIsIAQoAjAiAUECdGpBADYCAAwBCyAFKAIAIAFBAnRqQQA2AgALIAQgAUEBajYCMCAEKAIQQQFrIQULAkAgAygCwAEiCSADKALEASIBTwRAIBggAUEBdEGAASABGxAlIAMgAygCwAEiCUEBajYCwAEMAQsgAyAJQQFqNgLAAQsgAygCvAEgCUECdGogBTYCACAHQQFqIgcgEkcNAAsLIA4EQCADKAJAIQlBACEHA0AgCSADKALcASAHQQJ0aigCACIIQQR0aiIBKAIEIRkgCSABKAIIQQR0aigCBCESAkAgBCgCQCIBBEAgBCgCACAEKAI8IAFBAnRqQQRrKAIAIgVByABsakIANwMwIARBPGoiECABQQFrIgkQJSAEIAk2AkAgAUERSSABIAlBAXRNcg0BIBAQLQwBCyAEAn8gBCgCBCIBIAQoAghJBEAgAUF/NgIAIAFBCGpBAEE4/AsAIAFBADYCRCABIAEtAEBB4AFxOgBAIAFByABqDAELIwBBIGsiCSQAIAQoAgQgBCgCACIFa0HIAG0iEEEBaiIBQeTxuBxPBEAQJgALIAlBDGpB4/G4HCAEKAIIIAVrQcgAbSIFQQF0IhMgASABIBNJGyAFQfG4nA5PGyAQIAQQ3QIiASgCCCIFQX82AgAgBUEIakEAQTj8CwAgBUEANgJEIAUgBS0AQEHgAXE6AEAgASAFQcgAajYCCCAEKAIAIgUgBCgCBCIQIAEoAgQgECAFa0G4f21ByABsaiIQENwCIAQoAgAhBSAEIBA2AgAgASAFNgIEIAQgASgCCCIQNgIEIAEgBTYCCCAEKAIIIRMgBCABKAIMNgIIIAEgBTYCACABIBM2AgwgARDbAiAJQSBqJAAgEAsiATYCBCABIAQoAgBrQcgAbUEBayEFCwJAIAMoArABIgkgAygCtAEiAU8EQCAeIAFBAXRBgAEgARsQJSADIAMoArABIglBAWo2ArABDAELIAMgCUEBajYCsAELIAMoAqwBIAlBAnRqIAU2AgAgAygCvAEiECAHQQN0aiITKAIAIQEgAygCYCIJIAhBAnQiGmogEygCBCITNgIAIAkgE0ECdCIbaiABNgIAIAkgAUECdCIgaiAINgIAIBsgAygCUCIJaiAFNgIAIAkgIGogBTYCACAJIBpqIAU2AgAgAygCQCIJIAFBBHRqIhogEjYCBCAJIBNBBHRqIhMgFTYCBCADKAIsIhsgEkEYbGoiASsDCCEmIBsgGUEYbGoiEisDCCEkIAErAxAhJSASKwMAIScgASsDACEoIBIrAxAhKSAMKwMIISEgDCsDACEiIAwrAxAhIyADKAI0IAVByABsaiIBIAg2AgAgASAoICKhIiggJCAhoSIkoiAmICGhIiwgJyAioSInoqEiJiAmICaiICwgKSAjoSImoiAlICOhIikgJKKhIiUgJaIgKSAnoiAoICaioSIkICSioKCfIiejIiY5AxggASAkICejIiQ5AxAgASAlICejIiU5AwggASAmICaiICUgJaIgJCAkoqCgOQMoIAFEAAAAAAAAAAAgIiAloqEgISAkoqEgIyAmoqE5AyAgGiAQIAdBAXQgESAHG0ECdGpBBGsoAgA2AgggEyAQIAdBAWoiB0EBdCARcEECdGooAgA2AgggByAORw0ACwsgAygC/AEiASADKAKAAiIIRwRAA0ACQAJ/IAEoAgAiBygCBCIMBEAgBygCACIFIAxBAnRqIQwDQAJAIAUoAgAgFUYNAEEAIQcgDkUNAANAIAMgAygCNCADKAKsASAHQQJ0aigCAEHIAGxqIAUoAgAQ/wMNASAHQQFqIgcgDkkNAAsLIAVBBGoiBSAMRw0ACyABKAIAIgcoAgRBB3RBgAFqDAELQYABCyAHKAIISQRAIAFBADYCACAHEHUMAQsgHyABENoCCyABQQRqIgEgCEcNAAsLIAMoArABIgFFDQIgAygCrAEiByABQQJ0aiEFA0ACQCAEKAIAIAcoAgAiCEHIAGxqIgEoAkRFDQAgAS0AQEECcQ0AIA8gCDYCBCALIA9BBGoQgAQgASABLQBAQQJyOgBACyAFIAdBBGoiB0cNAAsMAgsgASAFQf4BcToAQAJAIAMoAuABIgUgAygC5AEiAU8EQCAXIAFBAXRBgAEgARsQJSADIAMoAuABIgVBAWo2AuABDAELIAMgBUEBajYC4AELIAMoAtwBIAVBAnRqIAk2AgAgAygCNCADKAJQIAlBAnRqKAIAQcgAbGoiASABLQBAQQRBCEEQIAMoAmAgASgCACIBQQJ0aigCACAJRhsgASAJRhtyOgBADAALAAsgAygCnAIiAQ0ACwsgA0GgAmogAygCoAIQhgIgD0EQaiQAIAMtABhBAUYEQCADKAIcIgEgAygCIEEYbGpBGGsiBSABKQMQNwMQIAUgASkDCDcDCCAFIAEpAwA3AwALIAMoAkQhASAGQQA2AoABIAZCADcCeEEEECMiBUEBNgIAIAYgBTYChAEgBkH4AGogARA5IAYgATYCfCADKAJEIQEgBkEANgJwIAZCADcCaCAGQegAaiABECUgBiABNgJsIAMoAkQhASAGQQA2AmAgBkIANwJYIAZB2ABqIAFBABAxIAMoAkQhASAGQQA2AlAgBkIANwJIIAZByABqIAEQJSAGIAE2AkwgAygCNCEBIAMoAjghBSAGQQA2AkAgBkIANwI4IAZBOGogBSABa0HIAG0iARAlIAYgATYCPCAGQQA2AjQgAygCRCIHBEADQAJAIA1BBHQiBCADKAJAaigCCEEASA0AIAMoAjQgDUECdCIFIAMoAlBqKAIAIgFByABsaigCAEF/Rg0AIAYoAlggAUECdGoiASABKAIAIgFBAWo2AgAgAUEASg0AIAYgBigCNCIBQQNqNgI0IAYoAkggBWogATYCACABQQR0IgggBigCeGoiCyADKAJAIARqIgQpAgg3AgggCyAEKQIANwIAIAYoAmggAUECdGogAygCUCAFaigCADYCACADKAJgIAVqKAIAIgtBAnQiBSAGKAJIaiABQQFqIgQ2AgAgBEEEdCIMIAYoAnhqIgkgAygCQCALQQR0aiILKQIINwIIIAkgCykCADcCACAGKAJoIARBAnRqIAMoAlAgBWooAgA2AgAgAygCYCAFaigCACIFQQJ0IgQgBigCSGogAUECaiIBNgIAIAFBBHQiCyAGKAJ4aiIJIAMoAkAgBUEEdGoiBSkCCDcCCCAJIAUpAgA3AgAgBigCaCABQQJ0aiADKAJQIARqKAIANgIAIAYoAngiASAIaiIFIAEgC2oiBCgCBDYCACABIAxqIgEgBSgCBDYCACAEIAEoAgQ2AgALIA1BAWoiDSAHRw0ACyAGKAI0IQ0LIAZCADcDKCAGQgA3AyAgBkIANwMAIAZCADcDCCAGQfgAaiANIAYQlQIgBkHoAGogDUEAEDEgBigCfCIBBEAgBigCeCINIAFBBHRqIQEgBigCSCEFA0AgDSAFIA0oAghBAnRqKAIANgIIIA1BEGoiDSABRw0ACwsgBigCXCEBIAZB2ABqIgUgAygCMEEBaiIEECUgBiAENgJcIAFBEUkgASAEQQF0TXJFBEAgBRAtIAYoAlwhBAsCQCAEQQBMDQAgBEECdCIBRQ0AIAYoAlhBACAB/AsACyAGKAJ8IgFBA24hBSABQQNPBEBBACENA0AgBigCWCANQTBsIgEgBigCeGooAgBBAnRqIgQgBCgCAEEBajYCACAGKAJYIAYoAnggAWooAhBBAnRqIgQgBCgCAEEBajYCACAGKAJYIAYoAnggAWooAiBBAnRqIgEgASgCAEEBajYCACANQQFqIg0gBUcNAAsgBigCXCEECyAGKAJYIg0gBEECdGohAQJAIARFDQAgDSgCACANQQA2AgAgBEEBRg0AQQBKIQQgDUEEaiELA0AgCygCACEFIA0gBDYCBCANQQRqIQ0gBCAFQQBKaiEEIAtBBGoiCyABRw0ACwsgAUEEaygCACEEQQAhDSAGQQA2AhggBkIANwIQIAZBEGogBBAzIAYgBDYCFCADKAIwIgcEQCAGKAIQIQggBigCWCELA0AgCyANQQJ0aiIBKAIEIAEoAgAiAUoEQCAIIAFBGGxqIgEgAygCLCANQRhsaiIFKQMQNwMQIAEgBSkDCDcDCCABIAUpAwA3AwALIA1BAWoiDSAHRw0ACwsgBigCeCEFIAYoAnwiBwRAIAUgB0EEdGohCyAGKAJYIQggBSEBA0AgASAIIAEoAgBBAnRqKAIANgIAIAEgCCABKAIEQQJ0aigCADYCBCABQRBqIgEgC0cNAAsLIAogBigChAE2AgwgBkEANgKEASAKIAc2AgQgCiAFNgIAIAogBigCgAE2AgggBkEANgKAASAGQgA3AnggBigCECEBIAogBDYCFCAKIAE2AhAgCiAGKAIYNgIYIAYoAjgiAQRAIAEQIgsgBigCSCIBBEAgARAiCyAGKAJYIgEEQCABECILIAYoAmgiAQRAIAEQIgsLIAZB+ABqEEkgBkGQAWokACAKIABByABqNgI0IAogCkE4ajYCMCAKKAIwIgEoAgAiBQRAIAUQIgsgAUIANwIAIAEgCigCADYCACABIAooAgQ2AgQgASAKKAIINgIIIApBADYCCCAKQgA3AgAgCigCNCIBIApBEGpHBEAgASgCACIFBEAgBRAiCyABQQA2AgggAUIANwIAIAEgCigCEDYCACABIAooAhQ2AgQgASAKKAIYNgIIIApBADYCGCAKQgA3AhALIAooAhAiAQRAIAEQIgsgCkEANgIYIApCADcCECAKEEkgCiAKKQI4NwIwIApBADYCCCAKQgA3AgBBBBAjIgFBATYCACAKQQA2AhggCkIANwIQIAogATYCDEEEECMiAUEBNgIAIApBADYCKCAKQgA3AiAgCiABNgIcQQQQIyIBQQE2AgAgCiABNgIsIAoQ7wIgCiAKKAI0EMkBIAooAjQiBwRAIAooAiAhCCAKKAIQIQsgCigCACEMIAooAjAhBkEAIQEDQCAMIAFBAnQiBWogBiABQQR0aiIEKAIANgIAIAUgC2ogBCgCCDYCACAFIAhqIAQoAgw2AgAgAUEBaiIBIAdHDQALCyAAQdgAaiAKEP0DIApBIGoQSSAKQRBqEEkgChBJAkACQCACBEAgAi0AEEEBRgRAIABBDhAsDAMLIAAQWCAAQQAQjQEgABCOASAAIAIQVCACLQAQQQFHDQEgAEEOECwMAgsgABBYIABBABCNASAAEI4BIABBABBUCyAAEFoLIAooAjgiAARAIAAQIgsjAEEQayIAJAAgACADQaACajYCBCAAQQRqEPwDIANBiAJqIgJBADYCFCACKAIIIgUgAigCBCIBa0ECdSIEQQNPBEADQCABKAIAECIgAiACKAIEQQRqIgE2AgQgAigCCCIFIAFrQQJ1IgRBAksNAAsLQYAEIQcCQAJAAkAgBEEBaw4CAQACC0GACCEHCyACIAc2AhALIAEgBUcEQANAIAEoAgAQIiABQQRqIgEgBUcNAAsLIAIQUyAAIANB/AFqNgIIIABBCGoQ/AMgAygC7AEiAQRAIAEQIgsgA0EANgL0ASADQgA3AuwBIAMoAtwBIgEEQCABECILIANBADYC5AEgA0IANwLcASADKALMASIBBEAgARAiCyADQQA2AtQBIANCADcCzAEgAygCvAEiAQRAIAEQIgsgA0EANgLEASADQgA3ArwBIAMoAqwBIgEEQCABECILIANBADYCtAEgA0IANwKsASADKAKAASIBBEAgARAiCyADQQA2AogBIANCADcDgAEgAygCcCIBBEAgARAiCyADQQA2AnggA0IANwNwIAMoAmAiAQRAIAEQIgsgA0EANgJoIANCADcDYCADKAJQIgEEQCABECILIANBADYCWCADQgA3A1AgA0FAaxBJIAAgA0E0ajYCDCAAKAIMIgEoAgAiAgRAIAEgAhCBBCAAKAIMIgEoAgAgASgCCBoQIgsgAygCHCIBBEAgARAiCyAAQRBqJAALIApBgANqJAALwAMCB38BfAJAIAErAyAgASsDCCAAKAIsIAJBGGxqIgQrAwCiRAAAAAAAAAAAoCABKwMQIAQrAwiioCABKwMYIAQrAxCioKAiCkQAAAAAAAAAAGRFDQAgCiAKoiAAKwMIIAErAyiiZEUNAAJAIAEoAkQiAw0AIwBBEGsiBSQAAkAgAEGgAmoiBygCBCIAIAcoAgBGBEBBEBAjIgZBADYCCCAGQgA3AgAMAQsgAEEEayIEKAIAIQYgBEEANgIAIAAiAyAARwRAA0AgACgCACEJIABBADYCACAEKAIAIQggBCAJNgIAIAgEQCAIEHULIARBBGohBCAAQQRqIgAgA0cNAAsgAyEACyAFIAQ2AgwgBSAANgIIIAcgBSgCDBCGAgsgBUEQaiQAIAYiA0EANgIEIAMQLSABKAJEIQAgASADNgJEIABFDQAgABB1IAEoAkQhAwsCQCADKAIEIgAgAygCCCIETwRAIAMgBEEBdEGAASAEGxAlIAMgAygCBCIAQQFqNgIEDAELIAMgAEEBajYCBAsgAygCACAAQQJ0aiACNgIAQQEhAyAKIAErAzBkRQ0AIAEgAjYCOCABIAo5AzALIAMLkQwBCn8gACgCFCIHIAAoAhBqIgIgACgCCCIEIAAoAgQiA2tBCHRBAWtBACADIARHG0YEQCMAQSBrIgkkAAJAIAAoAhAiAkGACE8EQCAAIAJBgAhrNgIQIAkgACgCBCICKAIANgIMIAAgAkEEajYCBCAAIAlBDGoQ2QIMAQsCQCAAKAIIIgMgACgCBGsiBCAAKAIMIgIgACgCACIFayIGSQRAIAIgA0YNASAJQYAgECM2AgwgACAJQQxqENkCDAILIAlBDGpBASAGQQF1IAIgBUYbIARBAnUgABBKIQIgCUGAIBAjNgIIIwBBIGsiCCQAAkAgAigCCCIDIAIoAgxHDQAgAigCBCIEIAIoAgAiBUsEQCADIARrIQYgBCAEIAVrQQJ1QQFqQX5tQQJ0IgdqIQUgAiADIARHBH8gBgRAIAUgBCAG/AoAAAsgAigCBAUgBAsgB2o2AgQgBSAGaiEDDAELIAhBDGpBASADIAVrQQF1IAMgBUYbIgMgA0ECdiACKAIQEEoiBygCCCEDIAIoAggiCiACKAIEIgRHBEAgAyAKIARraiEGIAQhBQNAIAMgBSgCADYCACAFQQRqIQUgA0EEaiIDIAZHDQALIAYhAwsgAigCACEFIAIgBygCADYCACAHIAU2AgAgAiAHKAIENgIEIAcgBDYCBCACIAM2AgggByAKNgIIIAIoAgwhAyACIAcoAgw2AgwgByADNgIMIAcQUyACKAIIIQMLIAMgCSgCCDYCACACIANBBGo2AgggCEEgaiQAIAAoAggiByAAKAIEIgNHBEADQCAHQQRrIQcjAEEgayIKJAACQCACKAIEIgQgAigCAEcEQCAEIQMMAQsgAigCCCIFIAIoAgwiA0kEQCAFIAMgBWtBAnVBAWpBAm1BAnQiCGogBSAEayIGayEDIAIgBCAFRwR/IAYEQCADIAQgBvwKAAALIAIoAggFIAULIAhqNgIIDAELIApBDGpBASADIARrQQF1IAMgBEYbIgMgA0EDakECdiACKAIQEEoiCCgCCCEEIAIoAggiCyACKAIEIgVHBEAgBCALIAVraiEGIAUhAwNAIAQgAygCADYCACADQQRqIQMgBEEEaiIEIAZHDQALIAYhBAsgAigCACEDIAIgCCgCADYCACAIIAM2AgAgAiAIKAIENgIEIAggBTYCBCACIAQ2AgggCCALNgIIIAIoAgwhAyACIAgoAgw2AgwgCCADNgIMIAgQUyACKAIEIQMLIANBBGsiAyAHKAIANgIAIAIgAzYCBCAKQSBqJAAgByAAKAIEIgNHDQALIAAoAgghBwsgACgCACEEIAAgAigCADYCACACIAQ2AgAgACACKAIENgIEIAIgAzYCBCAAIAIoAgg2AgggAiAHNgIIIAAoAgwhAyAAIAIoAgw2AgwgAiADNgIMIAIQUwwBCyAJQYAgECM2AgwgCUEMaiEKIwBBIGsiByQAAkAgACgCBCIDIAAoAgBHBEAgAyECDAELIAAoAggiBCAAKAIMIgJJBEAgBCACIARrQQJ1QQFqQQJtQQJ0IgZqIAQgA2siBWshAiAAIAMgBEcEfyAFBEAgAiADIAX8CgAACyAAKAIIBSAECyAGajYCCAwBCyAHQQxqQQEgAiADa0EBdSACIANGGyICIAJBA2pBAnYgABBKIgYoAgghAyAAKAIIIgggACgCBCIERwRAIAMgCCAEa2ohBSAEIQIDQCADIAIoAgA2AgAgAkEEaiECIANBBGoiAyAFRw0ACyAFIQMLIAAoAgAhAiAAIAYoAgA2AgAgBiACNgIAIAAgBigCBDYCBCAGIAQ2AgQgACADNgIIIAYgCDYCCCAAKAIMIQIgACAGKAIMNgIMIAYgAjYCDCAGEFMgACgCBCECCyACQQRrIgIgCigCADYCACAAIAI2AgQgB0EgaiQAIAkgACgCBCICKAIANgIMIAAgAkEEajYCBCAAIAoQ2QILIAlBIGokACAAKAIEIQMgACgCFCIHIAAoAhBqIQILIAMgAkEIdkH8//8HcWooAgAgAkH/B3FBAnRqIAEoAgA2AgAgACAHQQFqNgIUC0QBA38gACgCBCICIAFHBEADQCACQQRrIgMoAgAhBCADQQA2AgAgBARAIAQQdQsgASACQcgAayICRw0ACwsgACABNgIEC/MaAhV8CX8jAEGgAWsiHiQAIB5B2ABqQQBByAD8CwAgHkEQakEAQcgA/AsAIB5BAjYCDCAeQoCAgIAQNwIEIAAoAgQiGigCWCABQQxsaiEbIAAoAgAiACgCWCACQQxsaiEcIBooAkghHSAAKAJIIR8DQCAeQQRqIBlqKAIAIgJBGGwiGiAeQdgAaiIAaiIBIB8gHCACQQJ0IiBqKAIAQRhsaiICKQMQNwMQIAEgAikDCDcDCCABIAIpAwA3AwAgGiAeQRBqIgFqIgIgHSAbICBqKAIAQRhsaiIaKQMINwMIIAIgGikDEDcDECACIBopAwA3AwAgGUEEaiIZQQxHDQALQQAhGUEAIRojAEHAAWsiAiQAIAArAwAhBSAAKwMYIQYgACsDCCEIIAArAyAhBCACIAArAygiCiAAKwMQIguhOQOIASACIAQgCKE5A4ABIAIgBiAFoTkDeCAAKwMwIQcgACsDOCEJIAIgCyAAKwNAIguhOQO4ASACIAggCaE5A7ABIAIgBSAHoTkDqAEgAiALIAqhOQOgASACIAkgBKE5A5gBIAIgByAGoTkDkAEgASsDACEFIAErAxghBiABKwMIIQggASsDICEEIAIgASsDKCIKIAErAxAiC6E5A0AgAiAEIAihOQM4IAIgBiAFoTkDMCABKwMwIQcgASsDOCEJIAIgCyABKwNAIguhOQNwIAIgCCAJoTkDaCACIAUgB6E5A2AgAiALIAqhOQNYIAIgCSAEoTkDUCACIAcgBqE5A0hE////////738hBgJAA0AgACAZQRhsIhtqIR8gACAZQQFrQQIgGRtBGGxqISAgAkH4AGogG2ohIUEAIRsDQCACQgA3AyggAkIANwMgIAJCADcDGCACQgA3AxAgAkIANwMIIAJCADcDACABIBtBGGwiHWoiHCsDACAfKwMAIhChIgQgAkEwaiAdaiIdKwMAIgWiRAAAAAAAAAAAoCAcKwMIIB8rAwgiEaEiByAdKwMIIgiioCAcKwMQIB8rAxAiEqEiCyAdKwMQIgyioCEPIAQgISsDACIJokQAAAAAAAAAAKAgByAhKwMIIgqioCALICErAxAiC6KgIQ1EAAAAAAAAAAAhBCAJIAmiIAogCqKgIAsgC6KgIgcgBSAFoiAIIAiioCAMIAyioCIOoiAJIAWiRAAAAAAAAAAAoCAKIAiioCALIAyioCIMIAyioSIFRAAAAAAAAAAAYgRARAAAAAAAAAAAIA0gDqIgDyAMoqEgBaMiBUQAAAAAAADwPyAFRAAAAAAAAPA/YxsgBUQAAAAAAAAAAGMbIQQLAkAgDkQAAAAAAAAAAGIEQEQAAAAAAAAAACEIIAwgBKIgD6EgDqMiBUQAAAAAAAAAAGMEQEQAAAAAAAAAACEEIAdEAAAAAAAAAABhDQJEAAAAAAAAAAAgDSAHoyIFRAAAAAAAAPA/IAVEAAAAAAAA8D9jGyAFRAAAAAAAAAAAYxshBAwCCyAFIghEAAAAAAAA8D9kRQ0BRAAAAAAAAAAAIQREAAAAAAAA8D8hCCAHRAAAAAAAAAAAYQ0BRAAAAAAAAAAAIA0gDKAgB6MiBUQAAAAAAADwPyAFRAAAAAAAAPA/YxsgBUQAAAAAAAAAAGMbIQQMAQtEAAAAAAAAAAAhCEQAAAAAAAAAACEEIAdEAAAAAAAAAABhDQBEAAAAAAAAAAAgDSAHoyIFRAAAAAAAAPA/IAVEAAAAAAAA8D9jGyAFRAAAAAAAAAAAYxshBAsgAiASIAsgBKKgOQMoIAIgESAKIASioDkDICACIBAgCSAEoqA5AxggHCsDACEFIB0rAwAhBCAcKwMIIQcgHSsDCCEJIAIgCCAdKwMQoiAcKwMQoDkDECACIAcgCCAJoqA5AwggAiAFIAggBKKgOQMAAkAgAisDACIKIAIrAxgiCKEiBCAEoiACKwMIIgsgAisDICINoSIHIAeioCACKwMQIgwgAisDKCIOoSIJIAmioCIFIAZlRQRAIAYhBQwBCyAEICArAwAgCKGiRAAAAAAAAAAAoCAHICArAwggDaGioCAJICArAxAgDqGioCIIRAAAAAAAAAAAZSAEIAEgG0EBa0ECIBsbQRhsaiIcKwMAIAqhokQAAAAAAAAAAKAgByAcKwMIIAuhoqAgCSAcKwMQIAyhoqAiBkQAAAAAAAAAAGZxDQMCQCAIRAAAAAAAAAAAZQRARAAAAAAAAAAAIQgMAQsgBkQAAAAAAAAAAGRFDQBEAAAAAAAAAAAhBgsgBSAIoSAGoEQAAAAAAAAAAGQgGnIhGiAFIQYLIBtBAWoiG0EDRw0ACyAFIQYgGUEBaiIZQQNHDQALAkAgAisDmAEiCyACKwN4Ig2iIAIrA4ABIgwgAisDkAEiDqKhIgYgBqIgDCACKwOgASIPoiACKwOIASIQIAuioSIIIAiiIBAgDqIgDyANoqEiBCAEoqCgIhFEFlbnnq8D0jxkRQ0AIAErAxAhCSABKwMAIRUgASsDCCEWIAErAyghByABKwMYIRcgASsDICEYIAIgCCAAKwMAIhIgASsDMKGiRAAAAAAAAAAAoCAEIAArAwgiEyABKwM4oaKgIAYgACsDECIUIAErA0ChoqAiCjkDKCACIAggEiAXoaJEAAAAAAAAAACgIAQgEyAYoaKgIAYgFCAHoaKgIgc5AyAgAiAIIBIgFaGiRAAAAAAAAAAAoCAEIBMgFqGioCAGIBQgCaGioCIJOQMYAn8CQCAKRAAAAAAAAAAAZEUgCUQAAAAAAAAAAGRFIAdEAAAAAAAAAABkRXJyRQRAIAogCSAHIAcgCWQiGRtjDQEgGUUMAgsgCkQAAAAAAAAAAGNFIAlEAAAAAAAAAABjRSAHRAAAAAAAAAAAY0Vycg0CIAogCSAHIAcgCWMiGRtkDQAgGUUMAQtBAgshGUEBIRogECAEoiAMIAaioSABIBlBGGxqIhsrAwAiByASoaJEAAAAAAAAAACgIA0gBqIgECAIoqEgGysDCCIJIBOhoqAgDCAIoiANIASioSAbKwMQIgogFKGioEQAAAAAAAAAAGRFDQAgDyAEoiALIAaioSAHIAArAxihokQAAAAAAAAAAKAgDiAGoiAPIAiioSAJIAArAyChoqAgCyAIoiAOIASioSAKIAArAyihoqBEAAAAAAAAAABkRQ0AIAogACsDQKEgCCACKwOwASILoiAEIAIrA6gBIg2ioaIgByAAKwMwoSAEIAIrA7gBIgyiIAYgC6KhokQAAAAAAAAAAKAgCSAAKwM4oSAGIA2iIAggDKKhoqCgRAAAAAAAAAAAZEUNACAKIAYgAkEYakEIQRAgGUEBRhtBACAZG2orAwAiBaIgEaOgIAqhIgYgBqIgByAIIAWiIBGjoCAHoSIGIAaiIAkgBCAFoiARo6AgCaEiBSAFoqCgIQUMAQsCQCACKwNQIgsgAisDMCINoiACKwM4IgwgAisDSCIOoqEiBiAGoiAMIAIrA1giD6IgAisDQCIQIAuioSIIIAiiIBAgDqIgDyANoqEiBCAEoqCgIhFEFlbnnq8D0jxkRQ0AIAArAxAhCSAAKwMAIRUgACsDCCEWIAArAyghByAAKwMYIRcgACsDICEYIAIgCCABKwMAIhIgACsDMKGiRAAAAAAAAAAAoCAEIAErAwgiEyAAKwM4oaKgIAYgASsDECIUIAArA0ChoqAiCjkDKCACIAggEiAXoaJEAAAAAAAAAACgIAQgEyAYoaKgIAYgFCAHoaKgIgc5AyAgAiAIIBIgFaGiRAAAAAAAAAAAoCAEIBMgFqGioCAGIBQgCaGioCIJOQMYAn8CQCAKRAAAAAAAAAAAZEUgCUQAAAAAAAAAAGRFIAdEAAAAAAAAAABkRXJyRQRAIAogCSAHIAcgCWQiGRtjDQEgGUUMAgsgCkQAAAAAAAAAAGNFIAlEAAAAAAAAAABjRSAHRAAAAAAAAAAAY0Vycg0CIAogCSAHIAcgCWMiGRtkDQAgGUUMAQtBAgshGUEBIRogECAEoiAMIAaioSAAIBlBGGxqIgArAwAiByASoaJEAAAAAAAAAACgIA0gBqIgECAIoqEgACsDCCIJIBOhoqAgDCAIoiANIASioSAAKwMQIgogFKGioEQAAAAAAAAAAGRFDQAgDyAEoiALIAaioSAHIAErAxihokQAAAAAAAAAAKAgDiAGoiAPIAiioSAJIAErAyChoqAgCyAIoiAOIASioSAKIAErAyihoqBEAAAAAAAAAABkRQ0AIAogASsDQKEgCCACKwNoIguiIAQgAisDYCINoqGiIAcgASsDMKEgBCACKwNwIgyiIAYgC6KhokQAAAAAAAAAAKAgCSABKwM4oSAGIA2iIAggDKKhoqCgRAAAAAAAAAAAZEUNACAKIAogBiACQRhqQQhBECAZQQFGG0EAIBkbaisDACIFoiARo6ChIgYgBqIgByAHIAggBaIgEaOgoSIGIAaiIAkgCSAEIAWiIBGjoKEiBSAFoqCgIQUMAQsgBUQAAAAAAAAAACAaQQFxGyEFCyACQcABaiQAIAMgBSADKwMAIgYgBSAGYxs5AwAgHkGgAWokAAuQAQECf0EBIQEgACgCTCICBEAgACgCSCIAIAJBGGxqIQIDQCABIAApAwBC////////////AINCgICAgICAgPj/AFQgACkDCEL///////////8Ag0KAgICAgICA+P8AVHEgACkDEEL///////////8Ag0KAgICAgICA+P8AVHFxIQEgAEEYaiIAIAJHDQALCyABC7ICAgt8Bn8gACgCXCIOQQNPBHwgDkEDbiESIAAoAkghDyAAKAJYIQ5BACEAIAFBAUchAQNAIA8gDiAAQQxsaiINKAIEQRhsaiIQKwMAIA8gDSgCAEEYbGoiESsDACIHoSIEIA8gDSgCCEEYbGoiDSsDCCARKwMIIgihIgqiIBArAwggCKEiCyANKwMAIAehIgKioSEGIBArAxAgESsDECIJoSIMIAKiIAQgDSsDECAJoSICoqEhBCALIAKiIAwgCqKhIQIgBSABBHwgCSAGoiAIIASiIAcgAqJEAAAAAAAAAACgoKBEAAAAAAAAGECjBSAGIAaiIAIgAqIgBCAEoqCgn0QAAAAAAADgP6ILIgIgAyADIAKgIgOhoKAhBSAAQQFqIgAgEkcNAAsgBSADoAUgAwsL1QICCX8GfEEBIQECQCAAKAJMIAAoAlwiA0EBdmsgA0EDbmpBfnFBAkcNACADBEAgACgCSCEEIAAoAmghBiAAKAKoASEFIAAoAlghB0EAIQADQAJAIAcgAEECdCICaiIBKAIAIgggAUF4QQQgAEEDb0ECRhtqKAIAIglODQAgBSAAQQNuQRhsaiIBKwMQIQogBSACIAZqKAIAQQNtQRhsaiICKwMQIQsgASsDACIMIAIrAwAiDWIgASsDCCIOIAIrAwgiD2JyRSAKIAthcQ0AIA4gC6IgCiAPoqEgBCAJQRhsaiIBKwMAIAQgCEEYbGoiAisDAKGiRAAAAAAAAAAAoCAKIA2iIAwgC6KhIAErAwggAisDCKGioCAMIA+iIA4gDaKhIAErAxAgAisDEKGioEQAAAAAAAAAAGRFDQMLQQEhASAAQQFqIgAgA0cNAAsLIAEPC0EAC6oBAgN/AXxBFBAjIgIgASgCACIBNgIQAkAgACgCBCIDRQRAIABBBGoiASEEDAELIAErAwghBQNAIAMiASgCECsDCCAFZARAIAEhBCABKAIAIgMNAQwCCyABKAIEIgMNAAsgAUEEaiEECyACIAE2AgggAkIANwIAIAQgAjYCACAAKAIAKAIAIgEEQCAAIAE2AgALIAAoAgQgAhCnASAAIAAoAghBAWo2AgggAgvhAQEFfyMAQTBrIgQkACAEQQA2AiwgBEIANwIkIAEoAgAiBSABKAIEIgdHBEADQCAEQQA2AiAgBEIANwIYIAUoAgAiASAFKAIEIghHBEADQCAEIAEpAwg3AwggBCABKQMANwMAIAQgBjYCECAGQQFqIQYgBEEYaiAEEMQBIAFBEGoiASAIRw0ACwsgBEEkaiAEQRhqEI4FIAQoAhgiAQRAIAQgATYCHCAEKAIgGiABECILIAVBDGoiBSAHRw0ACwsgACAEQSRqIgAgAiADEIgEIAQgADYCACAEECkgBEEwaiQAC6kDAQV/IwBBMGsiBCQAIAQgASACIAMQkQQjAEEQayIFJAAgAEEANgIIIABCADcCACAEKAIEIAQoAgBrQQR1IAQoAgxrQQNuIQEjAEEgayIHJAACQAJAIAAoAgggACgCACIDa0EMbSABSQRAIAFB1qrVqgFPDQEgB0EMaiABIAAoAgQgA2tBDG0gABBhIgEoAgQgACgCBCAAKAIAIghrIgNBdG1BDGxqIQYgAwRAIAYgCCAD/AoAAAsgACgCACEDIAAgBjYCACABIAM2AgQgACABKAIINgIEIAEgAzYCCCAAKAIIIQYgACABKAIMNgIIIAEgAzYCACABIAY2AgwgARDWAQsgB0EgaiQADAELECYACyAEKAIMIgMgBCgCBCAEKAIAIgFrQQR1SQRAA0AgBSABIANBBHRqIgEoAgA2AgQgBSABKAIQNgIIIAUgASgCIDYCDCAAIAVBBGoQnQUgA0EDaiIDIAQoAgQgBCgCACIBa0EEdUkNAAsLIAVBEGokACAEQRhqEMcBIAQoAgAiAARAIAQgADYCBCAEKAIIGiAAECILIARBMGokAAtFAQF/IAAoAgwEQCAAKAIIEMUEIABBADYCCAJAIAAoAgQiAUUNACABQQJ0IgFFDQAgACgCAEEAIAH8CwALIABBADYCDAsLxAECAn8CfCABKAI4IgIgASgCPCIDNgI8IAMgAjYCOCACIAMrAyAgAisDIKEiBCADKwMYIAIrAxihIgUgBaIgBCAEoqCfIgSjRAAAAAAAAAAAIAUgBKMiBL1C////////////AINCgICAgICAgPj/AFQiAxs5AzAgAiAERAAAAAAAAAAAIAMbOQMoAkAgASgCOCgCACICIAEoAgAiA0YNACADIAEoAjwoAgAiAUYgASACRnINACAAQcgAaiACIAMgARCOBAsLZQECfwJAIAEoAgQiA0UEQCABIQIDQCACIAIoAggiAigCAEcNAAsMAQsDQCADIgIoAgAiAw0ACwsgASAAKAIARgRAIAAgAjYCAAsgACAAKAIIQQFrNgIIIAAoAgQgARDEBCABECILWgEDfyAAKAIIIAFJBEAgAUEYbBAnIQQgACgCACECAkAgACgCBCIDRQ0AIANBGGxBBGsiA0UNACAEIAIgA/wKAAALIAIEQCACECILIAAgATYCCCAAIAQ2AgALC74BAQR/IAAQiQQgASgCACEDIAFBADYCACAAKAIAIQIgACADNgIAIAIEQCAAKAIEGiACECILIAAgASgCBDYCBCABQQA2AgQgACABKAIMIgI2AgwgACABKgIQOAIQIAAgASgCCCIDNgIIIAIEQCAAQQhqIQQgAygCBCECAkAgACgCBCIDIANBAWsiBXFFBEAgAiAFcSECDAELIAIgA0kNACACIANwIQILIAAoAgAgAkECdGogBDYCACABQgA3AggLCx0AIAAgASACEIoCIAAgAiADEIoCIAAgAyABEIoCCyoAIAAgACgCDCABQQNsahBcIABBGGogACgCJCABarMgACoCKJWN/AEQcAv+AQEFfyABKAIAIgMgASgCBCIFRwRAA0AgAygCBCADKAIAa0EYbSACaiECIANBDGoiAyAFRw0ACwsgACAAKAIEIAAoAgBrQQR1IAJqEFwgAEEYaiAAKAIkIAJqsyAAKgIolY38ARBwIAEoAgAiBCABKAIEIgZHBEADQCAEKAIEIgEgBCgCACICRwRAIAEgAmtBGG0hAUEAIQMDQCAAIAIgA0EBaiIFQQAgASAFSxtBGGxqKAIQIAIgA0EYbGooAhAQigIgBCgCBCAEKAIAIgJrQRhtIgEgBSIDSw0ACwsgBEEMaiIEIAZHDQALCyAAIAAoAgQgACgCAGtBBHU2AgwLmTYEEn8OfAJ+An0jAEGQAmsiBCQAIABCADcDCCAAQgA3AwAgAEIANwMYIABCgICAgICAgPi/fzcDECAAQgA3AyAgAEGAgID8AzYCKCAAQRhqIRIgASgCACEIAkACQCADRQRAIAEoAgQhCgwBCwJAIAEoAgQiCiAIRwRAIAghCQNAIAkoAgQiAyAJKAIAIgZrQRhtIQcgAyAGRwRAIAYrAwAgA0EYaysDAKEiGyAbIBuiIAYrAwggA0EQaysDAKEiHCAcoqCfIhajIRkgHCAWoyEYQQAhBQNAIBshFiAcIRcgByAFQQFqIgNLBEAgBiADQRhsaiIMKwMIIAYgBUEYbGoiBSsDCKEhFyAMKwMAIAUrAwChIRYLIBkgF6IgGCAWoqEiGkQAAAAAAAAAAGUNBSACIBqZZARAIBkgFqJEAAAAAAAAAACgIBggF6KgRAAAAAAAAAAAYw0GCyAXIBYgFqIgFyAXoqCfIhejIRggFiAXoyEZIAMiBSAHRw0ACwsgCUEMaiIJIApHDQALQQAhAwNAIAMgCCgCBCAIKAIAa0EYbWpBAmshAyAIQQxqIgggCkcNAAsMAQtBACEDCyAEQgA3AxAgBEIANwMIIARCADcDICAEQoCAgICAgID4v383AxggBEIANwMoIARBgICA/AM2AjAgBEEIaiIFIAEQkAQgBSADEI8EIAEoAgAiCCABKAIEIgxHBEADQCAIKAIEIAgoAgBrQRhtQQFrIgNBAk8EQEEAIQVBASEGQQEhBwNAIARBCGogCCgCACIBIAVBGGxqKAIQIAEgBiADQQFrIgsgB0EBcSIJG0EYbGooAhAgASADQRhsaigCEBCOBCAHQQFzIQcgBiAFIAkbIgVBAWoiBiADIAsgCRsiA0kNAAsLIAhBDGoiCCAMRw0ACwsgABBFIAAgBCgCCDYCACAAIAQoAgw2AgQgACAEKAIQNgIIIARBADYCECAEQgA3AwggACAEKAIcNgIUIAAgBCkCFDcCDCASIARBIGoiARCNBCABEMcBIAQoAggiAUUNASAEIAE2AgwgBCgCEBogARAiDAELIARCADcDGEEAIQkgBEEANgIQIARCADcDCCAEQgA3AjwgBEIANwMgIARCADcDKCAEQgA3AzAgBEIANwNIIARCADcDUCAEQgA3A1ggBEKAgICAgICA+L9/NwNgIARCADcDaCAEQgA3A3AgBEGAgID8AzYCeCAEQoCAgICAgID4/wA3A4ABIARCgICAgICAgPj/ADcDiAEgBEKAgICAgICAeDcDkAEgBEKAgICAgICAeDcDmAEgBCACOQOgASAEIARBGGoiDTYCFCAEIARBPGoiDDYCOCAEIARByABqIg82AkRBACEFIAggCkcEQCAIIQMDQCADKAIEIAMoAgBrQRhtIAVqIQUgA0EMaiIDIApHDQALCwJAAkAgBSAKIAhrQQxtQQF0aiIDBEAgA0GAgIAgTw0BIAQgBEEIajYCuAEgBCADQQZ0IgUQIyIDNgIIIAQgAzYCDCAEQgA3ArABIARCADcCqAEgBCADIAVqNgIQIARBqAFqEKkCIAEoAgQhCiABKAIAIQggBCgCCCEJCyAEQQA2AvwBIARCADcC9AEgCCAKRwRAA0AgCCgCACIFKAIQIQMgBCAPNgK4ASAEQgA3A7ABIAQgAzYCqAEgBCAFKQMINwPIASAEIAUpAwA3A8ABIARCADcD2AEgBEIANwPQASAEIAk2AuQBIAQgCTYC4AEgBEEIaiAEQagBahCMAiAEIAQoAgwiDkFAaiILNgKEAiAOQSBrIhArAwAhAiAEIAQrA4ABIhcgDkEoayIRKwMAIhYgFiAXZBs5A4ABIAQgAiAEKwOYASIXIAIgF2QbOQOYASAEIBYgBCsDkAEiFyAWIBdkGzkDkAEgBCAEKwOIASIWIAIgAiAWZBs5A4gBIARB9AFqIARBhAJqEL0BIAshByAFQRhqIgYgCCgCBEcEQANAIAUrAxghAiAEIAQrA4gBIhcgBSsDICIWIBYgF2QbOQOIASAEIAQrA4ABIhcgAiACIBdkGzkDgAEgBCACIAQrA5ABIhcgAiAXZBs5A5ABIAQgFiAEKwOYASICIAIgFmMbOQOYASAFKAIoIQMgBCAPNgK4ASAEQgA3A7ABIAQgAzYCqAEgBCAGIgUpAwg3A8gBIAQgBSkDADcDwAEgBEIANwPYASAEQgA3A9ABIAQgCTYC5AEgBCAJNgLgASAEQQhqIARBqAFqEIwCIAciAyAEKAIMIgZBQGoiBzYCPCAGQQhrIAM2AgAgAyAGQSBrKwMAIAMrAyChIgIgBkEoaysDACADKwMYoSIWIBaiIAIgAqKgnyICo0QAAAAAAAAAACAWIAKjIgK9Qv///////////wCDQoCAgICAgID4/wBUIgYbOQMwIAMgAkQAAAAAAAAAACAGGzkDKCAFQRhqIgYgCCgCBEcNAAsLIAcgCzYCPCAOQQhrIAc2AgAgByAQKwMAIAcrAyChIgIgESsDACAHKwMYoSIWIBaiIAIgAqKgnyICo0QAAAAAAAAAACAWIAKjIgK9Qv///////////wCDQoCAgICAgID4/wBUIgMbOQMwIAcgAkQAAAAAAAAAACADGzkDKCAIQQxqIgggCkcNAAsLIARB0ABqIQ4gBCsDoAFEAAAAAAAAAABjBEAgBCAEKwOYAZkiAiAEKwOIAZkiFiACIBZkGyICIAQrA5ABmSIWIAQrA4ABmSIXIBYgF2QbIhYgAiAWZBtEEeotgZmXcT2iOQOgAQsgDiABEJAEIA4gBCgC+AEiCyAEKAL0ASIIa0EBdSAEKAIMIAQoAghrQQZ1ahCPBCAEKAIIIgMgBCgCDEcEQANAIARBCGogAxC8ASADQUBrIgMgBCgCDEcNAAsLIARBLGohECAIIAtGDQEgBEEgaiERIAghAQNAIAEoAgAiCSsDICEeIAkrAxghH0QAAAAAAAAAACEXRAAAAAAAAPD/IRtEAAAAAAAA8H8hGSAEKwOgASEgRAAAAAAAAPB/IRhEAAAAAAAA8P8hHEQAAAAAAADw/yECRAAAAAAAAAAAIRogCSIHIQMCQANAAkACQAJAIAMgAygCPCIGKAI4IgVHBEAgBSgCPCIGKAI4IAVHDQIgBiAFKAI4IgpGDQUgGiAFKwMYIhYgH6EgBisDICAeoaIgBSsDICIdIB6hIAYrAxggH6GioSIaIBcgFyAaoCIXoaCgIRogHSACIAIgHWMbIQIgFiAcIBYgHGQbIRwgGSAdIBkgHWMbIRkgGCAWIBYgGGQbIRggFiAbZEUEQCAFIQcgBSEDDAQLIAUiAyEHIAogCigCPCAgQQEQnQFFDQEMAwsgBiADKAI4IgpGDQQgGiADKwMYIhYgH6EgBisDICAeoaIgAysDICIdIB6hIAYrAxggH6GioSIaIBcgFyAaoCIXoaCgIRogHSACIAIgHWMbIQIgFiAcIBYgHGQbIRwgGSAdIBkgHWMbIRkgGCAWIBYgGGQbIRggFiAbZEUNAiAHIQUgCiAKKAI8ICBBARCdAQ0CCyADIQkgFiEbCyAFIQcLIAcgAygCPCIDRw0ACyAEIAk2AqgBIAcgBCgCDEYNACAXIBqgIhYgICACIBmhIhcgHCAYoSIaIBcgGmQboiIXmmNFIBu9Qv///////////wCDQv/////////3/wBWckUEQEEUECMiByAJNgIQIA0iAyEGAkAgBCgCGCIFRQ0AIAkrAxghFgNAIAUiAygCECsDGCAWYwRAIAMhBiADKAIAIgUNAQwCCyADKAIEIgUNAAsgA0EEaiEGCyAHIAM2AgggB0IANwIAIAYgBzYCACAEKAIUKAIAIgMEQCAEIAM2AhQLIAQoAhggBxCnASAEIAQoAhxBAWo2AhwgDCIGIQMCQCAEKAI8IgVFDQADQCAJIAUiAygCECIFSQRAIAMhBiADKAIAIgUNAQwCCyAFIAlPDQMgAygCBCIFDQALIANBBGohBgtBOBAjIgUgAjkDMCAFIBw5AyggBSAZOQMgIAUgGDkDGCAFIAk2AhAgBSADNgIIIAVCADcDACAGIAU2AgAgBCgCOCgCACIDBEAgBCADNgI4CyAEKAI8IAUQpwEgBCAEKAJAQQFqNgJADAELIBAgBEGoAWoiAxC9ASAWIBdkRQ0AIBEgAxC9AQsgAUEEaiIBIAtHDQALDAELECYACyAIBEAgBCgC/AEaIAgQIgsgDSAEKAIUIghHBEADQCAEIAgoAhAiCjYCqAEgDCIGIQMCQAJAIAQoAjwiBUUNAANAIAUiAygCECIBIApLBEAgAyEGIAMoAgAiBQ0BDAILIAEgCk8NAiADKAIEIgUNAAsgA0EEaiEGC0E4ECMiBUKAgICAgICAeDcDMCAFQoCAgICAgIB4NwMoIAVCgICAgICAgPj/ADcDICAFQoCAgICAgID4/wA3AxggBSAKNgIQIAUgAzYCCCAFQgA3AwAgBiAFNgIAIAQoAjgoAgAiAQRAIAQgATYCOAsgBCgCPCAFEKcBIAQgBCgCQEEBajYCQAsCQAJAIAQoAiAiCyAEKAIkIhFHBEAgCisDICIXIAUrAzAgBCsDoAEiAqFmIhRBf3MgFyAFKwMgIAKgZXEhFSAXIAKhIRwgFyACoCEZIAshASAEKAIMIhMhCQNAIAEoAgAiByEFA0ACQAJAAkAgBSAFKAI8IgYoAjgiA0cEQCADIAMoAjwiBigCOEcEQCADIQcgBSEDDAMLIAMhByAGIAMoAjhHDQEMAwsgBiAFIgMoAjhGDQILAkAgAiADKwMgIhsgF6GZZgRARAAAAAAAAPh/RAAAAAAAAPh/IAMrAxggBisDICAZZRsgFBshFgwBC0QAAAAAAAD4fyEWIBsgHGNFDQAgGSAGKwMgIhhjBEAgAysDGCIWIBcgG6EgBisDGCAWoaIgGCAboaOgIRYMAQsgFSAYIBxjcg0AIAYrAxghFgsgFr1C////////////AINC//////////f/AFYNACAKIAMgAkEBEJ0BRQ0AAkAgCSATRg0AIAkrAxggFqEiGCAJKAI8IgUrAyAgF6EiGqIgCSsDICIdIBehIh4gBSsDGCAWoSIWoqEiH0QAAAAAAAAAAGQEQCAfIB+iRAAAAAAAABBAoiACIAIgFiAWoiAaIBqioCIWIBggGKIgHiAeoqAiGCAWIBhkG6KiZUUNAQsgGyAdZARAIAMgCSACQQAQnQENAQwCCyAJIAMgAkEAEJ0BDQELIAMhCQsgByADKAI8IgVHDQELCyABQQRqIgEgEUcNAAsgCSATRw0BCyAQIARBqAFqEL0BDAELAn8gCisDGCIWIAkrAxhkBEAgCSgCPAwBCyAJIAkoAjwiASsDGCAWYw0AGiAJIAErAyAgF6EgFyAJKwMgoWQNABogAQsiASsDICIbIBehmSACZUUEQCAWIAKhIR0gF0QAAAAAAADwP0QAAAAAAADwvyAXIBtjGyIboiACoSEgA0AgCygCACIGIQUDQAJAAkACQCAFIAUoAjwiBygCOCIDRwRAIAMgAygCPCIHKAI4RwRAIAMhBiAFIQMMAwsgAyEGIAcgAygCOCIFRw0BDAMLIAcgBSIDKAI4IgVGDQILIAMrAxgiHCAdZEUNACAbIAMrAyAiGqIiISAgZEUNACAbRAAAAAAAAAAARAAAAAAAAPA/RAAAAAAAAPC/IBwgFqEiGSABKwMgIiIgF6EiGKIgGiAXoSIaIAErAxgiIyAWoSIeoqEiH0QAAAAAAAAAAGQbIB8gH6JEAAAAAAAAEECiIAIgAiAeIB6iIBggGKKgIhggGSAZoiAaIBqioCIZIBggGWQboqJlG6IiGUQAAAAAAAAAAGRFBEAgISAbICKiY0UgHCAjY0UgGUQAAAAAAAAAAGJycg0BCyADIAkgAkEBEJ0BRQ0AIAEgAyAFIAUoAjwgAkEBEJ0BGyEBCyAGIAMoAjwiBUcNAQsLIAtBBGoiCyARRw0ACwsgBEEIaiIFIAoQjAIgBCgCDCEGIAUgARCMAiAEKAIMIQMgCigCPCAGQUBqIgk2AjggASgCOCADQUBqIgc2AjwgCiABNgI8IAEgCjYCOCAKIAErAyAgCisDIKEiAiABKwMYIAorAxihIhYgFqIgAiACoqCfIgKjRAAAAAAAAAAAIBYgAqMiAr1C////////////AINCgICAgICAgPj/AFQiCxs5AzAgCiACRAAAAAAAAAAAIAsbOQMoIANBBGsgCTYCACAGQQhrIAc2AgAgA0EQayAGQSBrKwMAIANBIGsrAwChIgIgBkEoaysDACADQShrKwMAoSIWIBaiIAIgAqKgnyICo0QAAAAAAAAAACAWIAKjIgK9Qv///////////wCDQoCAgICAgID4/wBUIgYbOQMAIANBGGsgAkQAAAAAAAAAACAGGzkDACAFIAoQvAEgBSAJELwBIAUgARC8ASAFIAcQvAELAkAgCCgCBCIDBEADQCADIggoAgAiAw0ADAILAAsDQCAIIAgoAggiCCgCAEcNAAsLIAggDUcNAAsLIAQoAiwiASAEKAIwIgtHBEAgBEHEAGohDQNAIAEoAgAhCSAEQQA2AowCIARCADcChAIgBEEANgL8ASAEQgA3AvQBIAkiBiEFA0ACQAJAAkAgBSAFKAI8IgcoAjgiA0cEQCADIAMoAjwiBigCOEcEQCADIQYMAgsgBiADKAI4Rg0DIAQoAogCIAQoAoQCa0ECdSEFIAQgAzYC7AECQCAEKAL4ASIGIAQoAvwBIgdPBEAgBCADKQMgNwOwASAEIAMpAxg3A6gBIARB9AFqIAdBAXRBgAEgBxsQjAQgBCAEKAL4ASIGQQFqNgL4ASAEKQOoASEkIAQpA7ABISUgBCgC9AEgBkEYbGoiBiAFNgIQIAYgJTcDCCAGICQ3AwAMAQsgBCAGQQFqNgL4ASADKQMYISQgBCgC9AEgBkEYbGoiBiADKQMgNwMIIAYgJDcDACAGIAU2AhALIARBhAJqIARB7AFqEL0BIAMhBgwCCyAHIAUoAjhGDQIgBCgCiAIgBCgChAJrQQJ1IQMgBCAFNgLsAQJAIAQoAvgBIgcgBCgC/AEiCE8EQCAEIAUpAyA3A7ABIAQgBSkDGDcDqAEgBEH0AWogCEEBdEGAASAIGxCMBCAEIAQoAvgBIgdBAWo2AvgBIAQpA6gBISQgBCkDsAEhJSAEKAL0ASAHQRhsaiIHIAM2AhAgByAlNwMIIAcgJDcDAAwBCyAEIAdBAWo2AvgBIAUpAxghJCAEKAL0ASAHQRhsaiIHIAUpAyA3AwggByAkNwMAIAcgAzYCEAsgBEGEAmogBEHsAWoQvQELIAUhAwsgBiADKAI8IgVHDQELCyAEIAQpAvQBNwLsASMAQRBrIgMkACAEKALwASIFQQlPBEAgBCgC7AEhBiADIAU2AgwgAyAGNgIIIANBCGpBARDJAgsgA0EQaiQAIAQgBCgC9AEiCDYCqAEgBCAEKQL4ATcCrAEgBCAEKAKEAiIHNgK4ASAEIAQoAogCIgM2ArwBIAQgBCgCjAI2AsABAkAgAyAHRg0AIAQoAkgQiwIgBCAPNgJEIARCADcDSEF+IQYgCSEDA0ACfwJAIAMgAygCPCIMKAI4IgVHBEAgBSAFKAI8IgMoAjhHBEAgBSEJIAwMAwsgBSEJIAMgBSgCOEcNAQwECyADIQUgDCADKAI4Rg0DCyAGQQFqIQYgBEEIaiAFIARBqAFqEOACIAUoAjwLIgMgCUcNAAsgAyAEKAIMRiAGQQBMcg0AA0AgDyAEKAJEIgVHBEAgBSgCECEDIA0gBRCLBAsgBEEIaiIFIAMQigQgBSADKAI4IARBqAFqIgkQ4AIgBSADKAI8IAkQ4AIgBkEBSiADKAI8IQMgBkEBayEGDQALCyAHBEAgBxAiCyAIBEAgCBAiCyABQQRqIgEgC0cNAAsLIARBqAFqIA4QPCILIAQoAmQ2AhQgCyAEKQJcNwIMIwBBEGsiDSQAIAtBGGoiAUIANwIIIAFCADcCACABIARB6ABqIg8iAyoCEDgCECABIAMoAgQQcCADKAIIIgYEQANAQQAhBSMAQRBrIgokACAKIAZBCGoiCSkDACIkNwMIIApBCGpBCBD3ASEDIA0CfwJAIAEoAgQiB0UNACABKAIAAn8gB0EBayADcSAHaSIMQQFNDQAaIAMgAyAHSQ0AGiADIAdwCyIFQQJ0aigCACIIRQ0AIAgoAgAiCEUNACAHQQFrIQ4gDEEBSyEQA0ACQCADIAgoAgQiDEcEQAJAIBBFBEAgDCAOcSEMDAELIAcgDEsNACAMIAdwIQwLIAUgDEcNAwwBCyAIKQMIICRSDQBBAAwDCyAIKAIAIggNAAsLQSAQIyIIIAM2AgQgCEEANgIAIAggCSkDADcDCCAIQRBqIAlBCGoQYBoCQEEAIAcgASgCDEEBarMiJiABKgIQIicgB7OUXhsNACABIAcgB0EBa3FBAEcgB0EDSXIgB0EBdHIiBSAmICeVjfwBIgkgBSAJSxsQcCABKAIEIgcgB0EBayIFcUUEQCADIAVxIQUMAQsgAyAHSQRAIAMhBQwBCyADIAdwIQULAkAgASgCACIJIAVBAnRqIgUoAgAiA0UEQCAIIAEoAgg2AgAgASAINgIIIAUgAUEIajYCACAIKAIAIgNFDQEgAygCBCEMAkAgByAHQQFrIgNxRQRAIAMgDHEhDAwBCyAHIAxLDQAgDCAHcCEMCyAJIAxBAnRqIAg2AgAMAQsgCCADKAIANgIAIAMgCDYCAAsgASABKAIMQQFqNgIMQQELOgAMIA0gCDYCCCAKQRBqJAAgBigCACIGDQALCyANQRBqJAAgABBFIAAgCygCADYCACAAIAsoAgQ2AgQgACALKAIINgIIIAtBADYCCCALQgA3AwAgACALKAIUNgIUIAAgCykCDDcCDCASIAEQjQQgARDHASALKAIAIgEEQCALIAE2AgQgCygCCBogARAiCyAEKwOgASECIA8QxwEgBCgCUCIBBEAgBCABNgJUIAQoAlgaIAEQIgsgBCgCSBCLAiAEKAI8EN8CIAQoAiwiAQRAIAQgATYCMCAEKAI0GiABECILIAQoAiAiAQRAIAQgATYCJCAEKAIoGiABECILIAQoAhgQ3gIgBCgCCCIBRQ0AIAQgATYCDCAEKAIQGiABECILIAAgAjkDECASEIkEIBJBABBwIARBkAJqJAALiwEBA38jAEEQayICJABBqAIQIyIBQaCQAjYCACABQgA3AgQgAUEQahA7IQMgAUEONgJUIAIgATYCDCACIAM2AgggASABKAIEQQFqNgIEIAIgAikCCDcDACAAIAIQSBogASABKAIEIgBBAWs2AgQgAEUEQCABIAEoAgAoAggRAAAgARAkCyACQRBqJAALwgEBA38jAEEgayIEJAACQCAAKAIIIAAoAgAiAmtBGG0gAUkEQCABQavVqtUATw0BIARBDGogASAAKAIEIAJrQRhtIAAQZCEBIAAoAgAiAiAAKAIEIgMgASgCBCADIAJrQWhtQRhsaiIDEKUCIAAoAgAhAiAAIAM2AgAgASACNgIEIAAgASgCCDYCBCABIAI2AgggACgCCCEDIAAgASgCDDYCCCABIAI2AgAgASADNgIMIAEQpAILIARBIGokAA8LECYAC4whAxJ/FXwBfiMAQZADayIFJAACQAJAAkAgBEUNACAELQAQQQFHDQBBqAIQIyIBQaCQAjYCACABQgA3AgQgAUEQahA7IQIgAUEONgJUIAUgATYCjAEgBSACNgKIASABIAEoAgRBAWo2AgQgBSAFKQKIATcDKCAAIAVBKGoQSBogASABKAIEIgBBAWs2AgQgAA0BIAEgASgCACgCCBEAACABECQMAQsgARCFBCEHAn8gAhCFBCILIAdFckUEQCABIQZBAQwBCyACIQYgASECIAchCSALCyEMIAYoAlxBAk0EQEGoAhAjIgFBoJACNgIAIAFCADcCBCABQRBqIAIQNyECIAUgATYChAEgBSACNgKAASABIAEoAgRBAWo2AgQgBSAFKQKAATcDACAAIAUQSBogASABKAIEIgBBAWs2AgQgAA0BIAEgASgCACgCCBEAACABECQMAQsgAigCXCEIQagCECMiD0GgkAI2AgAgD0IANwIEIA9BEGohAQJAIAhBAk0EQCABIAYQNyEBIAUgDzYCfCAFIAE2AnggDyAPKAIEQQFqNgIEIAUgBSkCeDcDCCAAIAVBCGoQSBoMAQsgASACEDchASAFIA82AlwgBSABNgJYIA8gDygCBEEBajYCBCAFIAUpAlg3AyAgBUHgAGogBUEgahBIIRMgBUEANgJUIAVCADcCTCAFQcwAaiIBIAIoAlxBA25B5wdqQegHbkEBahCTBCABAn8gASgCBCIIIAEoAghJBEAgCCATEC5BGGoMAQsjAEEgayINJAAgASgCBCABKAIAIgprQRhtIg5BAWoiCEGr1arVAE8EQBAmAAsgDUEMakGq1arVACABKAIIIAprQRhtIgpBAXQiECAIIAggEEkbIApB1arVKk8bIA4gARBkIggoAgggExAuGiAIIAgoAghBGGo2AgggASgCACIKIAEoAgQiDiAIKAIEIA4gCmtBaG1BGGxqIg4QpQIgASgCACEKIAEgDjYCACAIIAo2AgQgASAIKAIIIg42AgQgCCAKNgIIIAEoAgghECABIAgoAgw2AgggCCAKNgIAIAggEDYCDCAIEKQCIA1BIGokACAOCzYCBAJAAkACQCAMIAkgA0EBc3EiAXFBAUYEQCAGKAJIIQggBigCTCEKIAVBADYCgAMgBUIANwL4AiAKIAIoAkxsIQYjAEEgayIJJAACQAJAIAVB+AJqIgEoAgggASgCACIHa0EYbSAGSQRAIAZBq9Wq1QBPDQEgCUEMaiAGIAEoAgQgB2tBGG0gARBkIgYoAgQgASgCBCABKAIAIgxrIgdBaG1BGGxqIQsgBwRAIAsgDCAH/AoAAAsgASgCACEHIAEgCzYCACAGIAc2AgQgASAGKAIINgIEIAYgBzYCCCABKAIIIQsgASAGKAIMNgIIIAYgBzYCACAGIAs2AgwgBhCMAQsgCUEgaiQADAELECYACyACKAJMIgFFDQEgAigCSCIJIAFBGGxqIQ0gCCAKQRhsIgtqIQ4DQAJAIApFDQAgCSsDECEZIAkrAwghGiAJKwMAIRsgCCEHAkAgBSgCgAMiBiAFKAL8AiIBayALSARAIAEgBSgC+AIiB2tBGG0iDCAKaiICQavVqtUASQ0BDAoLA0AgBysDACEXIAcrAwghGCABIBkgBysDEKA5AxAgASAaIBigOQMIIAEgGyAXoDkDACABQRhqIQEgB0EYaiIHIA5HDQALIAUgATYC/AIMAQsgBUGIAWpBqtWq1QAgBiAHa0EYbSIGQQF0IgcgAiACIAdJGyAGQdWq1SpPGyAMIAVB+AJqEGQhDCAFKAKQASIHIAtqIQIgCCEGA0AgBisDACEXIAYrAwghGCAHIBkgBisDEKA5AxAgByAaIBigOQMIIAcgGyAXoDkDACAGQRhqIQYgB0EYaiIHIAJHDQALIAUgAjYCkAEgBSgC/AIgAWsiBgRAIAIgASAG/AoAAAsgBSgC/AIhAiAFIAE2AvwCIAUgBSgCkAEgAiABa2o2ApABIAUoAowBIAEgBSgC+AIiBmsiAUFobUEYbGohAiABBEAgAiAGIAH8CgAACyAFIAUoAvgCIgE2AowBIAUgAjYC+AIgBSkCkAEhLCAFIAE2ApABIAUoAoADIQIgBSAsNwL8AiAFIAI2ApQBIAwgATYCACAMEIwBCyAJQRhqIgkgDUcNAAsMAQsgDCABQQFzcUEBRgRAIAIoAlwiAUEDbiEOIAFBA0kNAiAGKAJIIgggBigCTCIQQRhsIhFqIRRBACEKA0ACQCAERQ0AIAQtABBBAUcNACAAEJIEDAULIAVBQGtB6AcgDiAKayIBIAFB6AdPGyIVEJEDIQxBACELA0AgBUEANgKAAyAFQgA3AvgCIAVBAjYC9AIgBUKAgICAEDcC7AIgCiALakEMbCEWQQAhCQNAAkAgEEUNACACKAJIIAIoAlggFmogBUHsAmogCWooAgBBAnRqKAIAQRhsaiIBKwMQIRkgASsDCCEaIAErAwAhGyAIIQcgBSgCgAMiDSAFKAL8AiIBayARTgRAA0AgBysDACEXIAcrAwghGCABIBkgBysDEKA5AxAgASAaIBigOQMIIAEgGyAXoDkDACABQRhqIQEgB0EYaiIHIBRHDQALIAUgATYC/AIMAQsgASAFKAL4AiIHa0EYbSISIBBqIgZBq9Wq1QBPDQogBUGIAWpBqtWq1QAgDSAHa0EYbSIHQQF0Ig0gBiAGIA1JGyAHQdWq1SpPGyASIAVB+AJqEGQhEiAFKAKQASIHIBFqIQ0gCCEGA0AgBisDACEXIAYrAwghGCAHIBkgBisDEKA5AxAgByAaIBigOQMIIAcgGyAXoDkDACAGQRhqIQYgB0EYaiIHIA1HDQALIAUgDTYCkAEgBSgC/AIgAWsiBgRAIA0gASAG/AoAAAsgBSgC/AIhBiAFIAE2AvwCIAUgBSgCkAEgBiABa2o2ApABIAUoAowBIAEgBSgC+AIiB2siAUFobUEYbGohBiABBEAgBiAHIAH8CgAACyAFIAUoAvgCIgE2AowBIAUgBjYC+AIgBSkCkAEhLCAFIAE2ApABIAUoAoADIQYgBSAsNwL8AiAFIAY2ApQBIBIgATYCACASEIwBCyAJQQRqIglBDEcNAAsgBUGIAWoiASAFQfgCahCOAiAMKAIAIAtBGGxqIAEQwQEaIAEQKBogBSgC+AIiAQRAIAUgATYC/AIgBSgCgAMaIAEQIgsgC0EBaiILIBVHDQALIAVBiAFqIgEgDEEAEIgBIAEgBBArGiAFQcwAaiABEJgBIAEQKBogBSAMNgKIASABEHogCkHoB2oiCiAOSQ0ACwwCCyAHIAtyDQEgBigCXCEBIAIoAlwhByAFQQA2AkggBUIANwJAIAVBQGtByAEgB0EDbiIMIAxByAFPGxCTBCABQQNuIQ0CQCAHQQNPBEAgAUEDSSEOQQAhBwNAIAQEQCAELQAQDQMLIAIoAqgBIAdBGGxqIgErAxAhKSABKwMIISogASsDACErIAIoAkgiASACKAJYIAdBDGxqIggoAgBBGGxqIgkrAxAhGSAJKwMIIRogCSsDACEbIAEgCCgCCEEYbGoiCSsDECEXIAkrAwghGCAJKwMAIR8gASAIKAIEQRhsaiIBKwMQISAgASsDCCEhIAErAwAhIkEAIQEgBUE0aiANEJEDIQsgDkUEQANAAkAgKyABQRhsIhAgBigCqAFqIggrAwCiIhxEAAAAAAAAAACgICogCCsDCKIiHaAgKSAIKwMQoiIeoEQAAAAAAADwv6CZRBHqLYGZl3E9Y0QAAAAAAAAAACAcoSAdoSAeoUQAAAAAAADwv6CZRBHqLYGZl3E9Y3INACAGKAJIIgggBigCWCABQQxsaiIJKAIAQRhsaiIKKwMAIRwgCisDCCEdIAorAxAhHiAIIAkoAgRBGGxqIgorAwAhIyAKKwMIISQgCisDECElIAggCSgCCEEYbGoiCCsDACEmIAgrAwghJyAFIBcgCCsDECIooDkD2AIgBSAYICegOQPQAiAFIB8gJqA5A8gCIAUgFyAloDkDwAIgBSAYICSgOQO4AiAFIB8gI6A5A7ACIAUgFyAeoDkDqAIgBSAYIB2gOQOgAiAFIB8gHKA5A5gCIAUgICAooDkDkAIgBSAhICegOQOIAiAFICIgJqA5A4ACIAUgICAloDkD+AEgBSAhICSgOQPwASAFICIgI6A5A+gBIAUgICAeoDkD4AEgBSAhIB2gOQPYASAFICIgHKA5A9ABIAUgGSAooDkDyAEgBSAaICegOQPAASAFIBsgJqA5A7gBIAUgGSAloDkDsAEgBSAaICSgOQOoASAFIBsgI6A5A6ABIAUgGSAeoDkDmAEgBSAaIB2gOQOQASAFIBsgHKA5A4gBIAVBCTYC6AIgBSAFQYgBajYC5AIgBSAFKQLkAjcDGCAFQewCaiIIQQA2AgggCEIANwIAIAUoAhwiCQRAIAUoAhgiCiAJQRhsaiERIAggCRDyASAIKAIEIQkDQCAJIAopAxA3AxAgCSAKKQMINwMIIAkgCikDADcDACAJQRhqIQkgCkEYaiIKIBFHDQALIAggCTYCBAsgBUH4AmoiCSAIEI4CIAsoAgAgEGogCRDBARogCRAoGiAIKAIAIghFDQAgBSAINgLwAiAFKAL0AhogCBAiCyABQQFqIgEgDUcNAAsLIAVBADYCgAMgBUIANwL4AgJAIAsoAgAiASAFKAI4IghGDQADQCABEMABRQRAIAVB+AJqIAEQmAELIAFBGGoiASAIRw0ACyAFKAL4AiAFKAL8AkYNACAFQYgBaiIBIAVB+AJqQQAQiAEgASAEECsaIAVBQGsgARCYASABECgaCyAFKAJEIAUoAkBrQRhtQcgBTwRAIAVBiAFqIgEgBUFAa0EAEIgBIAEgBBArGiAFKAJAIgggBSgCRCIBRwRAA0AgCCABQRhrECgiAUcNAAsLIAUgCDYCRCAFQUBrIAVBiAFqIgEQmAEgARAoGgsgBSAFQfgCajYCiAEgBUGIAWoiARB6IAUgCzYCiAEgARB6IAdBAWoiByAMRw0ACwsgBSgCQCAFKAJERwRAIAVBiAFqIgEgBUFAa0EAEIgBIAEgBBArGiAFQcwAaiABEJgBIAEQKBoLIAUgBUFAazYCiAEgBUGIAWoQegwCCyAAEJIEIAUgBUFAazYCiAEgBUGIAWoQegwCCyAFQYgBaiIBIAVB+AJqEI4CIAVBzABqIAEQmAEgARAoGiAFKAL4AiIBRQ0AIAUgATYC/AIgBSgCgAMaIAEQIgsCQCAERQ0AIAQtABBBAUcNAEGoAhAjIgFBoJACNgIAIAFCADcCBCABQRBqEDshAiABQQ42AlQgBSABNgKMASAFIAI2AogBIAEgASgCBEEBajYCBCAFIAUpAogBNwMQIAAgBUEQahBIGiABIAEoAgQiAEEBazYCBCAADQEgASABKAIAKAIIEQAAIAEQJAwBCyAFQYgBaiIBIAVBzABqIAMQiAEgASAEECsaIAAgARCPAiABECgaCyAFIAVBzABqNgKIASAFQYgBahB6IBMQKBoLIA8gDygCBCIAQQFrNgIEIAANACAPIA8oAgAoAggRAAAgDxAkCyAFQZADaiQADwsQJgAL8QEBBH8CQAJAAkACQAJAIAMOAwMAAQILIAQgACgCADYCAA8LAkAgAigCACICIAFBBGsiASgCACIDQQR0aiIFKAIEIgYgAiAAKAIAIgdBBHRqIgIoAgQiCEYEQCAFKAIAIAIoAgBIDQEMBAsgBiAITg0DCyAEIAM2AgAgBCAAKAIANgIEDwsgA0EITARAIAAgASAEIAIQqAQPCyAAIAAgA0EBdiIFQQJ0IgdqIgYgAiAFIAQgBRC+ASAGIAEgAiADIAVrIgMgBCAHaiADEL4BIAAgBiAGIAEgBCACEJECCw8LIAQgBzYCACAEIAEoAgA2AgQL8Q8DBH8KfAJ+IwBBkAJrIgQkACACKwMQIQkgAisDACEIIAIrAwghCiAEQoCAgICAgICAwAA3A9gBIARCgICAgICAgIDAADcD0AEgBEKAgICAgICAgMAANwPIASAEQoCAgICAgICAwAA3A1AgBEKAgICAgICAgMAANwNYIARCgICAgICAgIDAADcDYCAEQeABaiICIARB0ABqQQEQkQUgBEKAgICAgICA+D83A7ABIARCADcDuAEgBEIANwPAASAEQoCAgICAgID4PzcDOCAEQgA3A0AgBEIANwNIIARB+AFqIgUgAiAEQThqEOkBIAIQKBogBCABKwMYIgsgASsDACIMoSINIA2iIAErAyAiDSABKwMIIg+hIg4gDqKgIAErAygiDiABKwMQIhChIhEgEaKgn0QAAAAAAADgP6IgCyAMoEQAAAAAAADgP6IgAyAIIAggCKIgCiAKoqAgCSAJoqCfIgyjIguioSIIIAiiIA0gD6BEAAAAAAAA4D+iIAMgCiAMoyIIoqEiCiAKoqAgDiAQoEQAAAAAAADgP6IgAyAJIAyjIgmioSIKIAqioJ+gIgo5A5ABIAQgCjkDiAEgBCAKOQOAASAEIAo5AyAgBCAKOQMoIAQgCjkDMCAEQZgBaiIBIAUgBEEgahCcBCAEIAM5A2ggBEIANwNwIARCADcDeCAEIAM5AwggBEIANwMQIARCADcDGCACIAEgBEEIahDpASAFIAIQwQEhBSACECgaIAEQKBogACAFRAAAAAAAAAAAAnxEAAAAAAAA+H8gCb1C////////////AINCgICAgICAgPj/AFogCZlEAAAAAAAA8D9kcg0AGkS17z+35KtxwCAJRAAAAAAAAPA/YQ0AGkS17z+35KtxQCAJRAAAAAAAAPC/YQ0AGkQYLURU+yH5PyAJEF2hRAAAAAAAgGbAogtEGC1EVPshCUCjAnwgCCIDIAugIAsgC2EgAyADYXFFDQAaIAO9IhJCIIinIQACQAJAIAu9IhNCIIinIgJBgIDA/wNrIBOnIgZyRQRAIABB/////wdxIgBBgIDAoARPDQICfyAAQf//7/4DTQRAQX8gAEGAgIDyA08NARoMAwsgA5khAyAAQf//y/8DTQRAIABB//+X/wNNBEAgAyADoEQAAAAAAADwv6AgA0QAAAAAAAAAQKCjIQNBAAwCCyADRAAAAAAAAPC/oCADRAAAAAAAAPA/oKMhA0EBDAELIABB//+NgARNBEAgA0QAAAAAAAD4v6AgA0QAAAAAAAD4P6JEAAAAAAAA8D+goyEDQQIMAQtEAAAAAAAA8L8gA6MhA0EDCyADIAMgAyADoiILIAuiIgggCCAIIAggCEQvbGosRLSiv6JEmv3eUi3erb+gokRtmnSv8rCzv6CiRHEWI/7Gcby/oKJExOuYmZmZyb+goiIJIAsgCCAIIAggCCAIRBHaIuM6rZA/okTrDXYkS3upP6CiRFE90KBmDbE/oKJEbiBMxc1Ftz+gokT/gwCSJEnCP6CiRA1VVVVVVdU/oKIiCKCioSAAQf//7/4DTQ0DGkEDdCIAQbCAAWorAwAgAyAJIAigoiAAQdCAAWorAwChIAOhoSIDmiADIBJCAFMbDAMLIAJBHnZBAnEiByAAQR92ciEBIABB/////wdxIgAgEqdyRQRAAkACQCABQQJrDgIAAQMLRBgtRFT7IQlADAQLRBgtRFT7IQnADAMLIAJB/////wdxIgIgBnJFDQECQCACQYCAwP8HRgRAIABBgIDA/wdHDQEgAUEDdEGYhgFqKwMADAQLIABBgIDA/wdHIAJBgICAIGogAE9xRQ0CAnwgBwRARAAAAAAAAAAAIABBgICAIGogAkkNARoLAnwCQCADIAujmSIDvSISQiCIp0H/////B3EiAEGAgMCgBE8EQCADIANiDQFEGC1EVPsh+T8gA6YMAgsCfyAAQf//7/4DTQRAQX8gAEGAgIDyA08NARoMAgsgA5khAyAAQf//y/8DTQRAIABB//+X/wNNBEAgAyADoEQAAAAAAADwv6AgA0QAAAAAAAAAQKCjIQNBAAwCCyADRAAAAAAAAPC/oCADRAAAAAAAAPA/oKMhA0EBDAELIABB//+NgARNBEAgA0QAAAAAAAD4v6AgA0QAAAAAAAD4P6JEAAAAAAAA8D+goyEDQQIMAQtEAAAAAAAA8L8gA6MhA0EDCyADIAMgAyADoiILIAuiIgggCCAIIAggCEQvbGosRLSiv6JEmv3eUi3erb+gokRtmnSv8rCzv6CiRHEWI/7Gcby/oKJExOuYmZmZyb+goiIJIAsgCCAIIAggCCAIRBHaIuM6rZA/okTrDXYkS3upP6CiRFE90KBmDbE/oKJEbiBMxc1Ftz+gokT/gwCSJEnCP6CiRA1VVVVVVdU/oKIiCKCioSAAQf//7/4DTQ0BGkEDdCIAQbCAAWorAwAgAyAJIAigoiAAQdCAAWorAwChIAOhoSIDmiADIBJCAFMbIQMLIAMLCyEDAkACQAJAIAFBAWsOAwABAgQLIAOaDAULRBgtRFT7IQlAIANEB1wUMyamobygoQwECyADRAdcFDMmpqG8oEQYLURU+yEJwKAMAwsgAUEDdEG4hgFqKwMAIQMLIAMMAQtEGC1EVPsh+T8gA6YLRAAAAAAAgGZAokQYLURU+yEJQKMQmwQgBRAoGiAEQZACaiQAC6UBAQZ/IwBBEGsiByQAQaABECMiA0GAlAI2AgAgA0IANwIEIANBEGohBSMAQRBrIgIkACACIAEoAgAiBjYCCCAGBEBBEBAjIgQgBjYCDCAEQeyXAjYCACAEQgA3AgQLIAIgBDYCDCABQQA2AgAgAiACKQIINwMAIAUgAhD+AiACQRBqJAAgACADNgIEIAAgBTYCACAAIANBFGogBRCPASAHQRBqJAAL0gQBAn8jAEGQBGsiAyQAIANBhARqIAFBABArECogA0H8A2ogAkEAECsQKiADQcgAaiIBIANB6AJqIAMoAoQEIAMoAvwDQQFBABCOAyICQQIQnwIgA0GYAhAjIAEQowE2AiAgA0HgAmogA0EgahCXBCADKAIgIQEgA0EANgIgIAEEQCABEDoQIgsgA0HIAGoiARA6GiABIAJBARCfAiADQZgCECMgARCjATYCICADQUBrIANBIGoQlwQgAygCICEBIANBADYCICABBEAgARA6ECILIANByABqEDoaIAMgAygC4AI2AjggAyADKALkAiIBNgI8IAEEQCABIAEoAgRBAWo2AgQLIAMgAykCODcDECADQcgAaiADQRBqEEMgAyADKAJANgIYIAMgAygCRCIBNgIcIAEEQCABIAEoAgRBAWo2AgQLIAMgAykCGDcDCCADQSBqIgEgA0EIahBDIAAgA0HIAGoiBBCLARogAEEYaiABEIsBGiABECgaIAQQKBoCQCADKAJEIgBFDQAgACAAKAIEIgFBAWs2AgQgAQ0AIAAgACgCACgCCBEAACAAECQLAkAgAygC5AIiAEUNACAAIAAoAgQiAUEBazYCBCABDQAgACAAKAIAKAIIEQAAIAAQJAsgAhD8AgJAIAMoAoAEIgBFDQAgACAAKAIEIgFBAWs2AgQgAQ0AIAAgACgCACgCCBEAACAAECQLAkAgAygCiAQiAEUNACAAIAAoAgQiAUEBazYCBCABDQAgACAAKAIAKAIIEQAAIAAQJAsgA0GQBGokAAtKAQd/QQQQIyIDIAI2AgBBBBAjIgQgAjYCAEHw7wEgAUGQ6wEiAUEAIQJB7SRBASEFQbsBIAMgASACQfEkaiAFQbsBaiAEEAogAAviAwICfwV8IwBBgAFrIgMkACADQfgAaiABQQAQKxAqAkAgAygCeCgCRCIEBEAgACAEEEYMAQsgAisDACIHIAeiIAIrAwgiBiAGoqAgAisDECIFIAWioCIIRAAAAAAAAAAAYQRAIAAQ6wEaDAELIANCADcDcCADQgA3A2ggA0IANwNgIANEAAAAAAAA8D8gBSAInyIIoyIFIAWiIgkgCaChOQNYIANEAAAAAAAAAAAgBSAGIAijIgaiIgkgCaChIgk5A1AgA0QAAAAAAAAAACAHIAijIgcgBaIiBSAFoKEiBTkDSCADIAk5A0AgA0QAAAAAAADwPyAGIAaiIgggCKChOQM4IANEAAAAAAAAAAAgByAGoiIGIAagoSIGOQMwIAMgBTkDKCADIAY5AyAgA0QAAAAAAADwPyAHIAeiIgUgBaChOQMYIANBCGogARCKASADQRBqIAMoAggiASADQRhqIAEoAgAoAgQRAwAgAyADKQIQNwMAIAAgAxBDIAMoAgwiAEUNACAAIAAoAgQiAUEBazYCBCABDQAgACAAKAIAKAIIEQAAIAAQJAsCQCADKAJ8IgBFDQAgACAAKAIEIgFBAWs2AgQgAQ0AIAAgACgCACgCCBEAACAAECQLIANBgAFqJAALlQUCA38DfCMAQSBrIgUkACAFQRBqIAEQigEgBSgCECEGIwBB0ANrIgEkACACRAAAAAAAgFZAoCIIED4hCSACED4hCiACED4hAiAIED4hCCABQgA3A5ADIAFCgICAgICAgPg/NwOIAyABQgA3A5gDIAFCADcDoAMgASAIOQPIAyABIAKaOQPAAyABQgA3A7gDIAEgCjkDsAMgASAJOQOoAyADRAAAAAAAgFZAoCICED4hCCADED4hCSADED4hAyABIAIQPjkDgAMgAUIANwP4AiABIAM5A/ACIAFCADcD6AIgAUKAgICAgICA+D83A+ACIAFCADcD2AIgASAJmjkD0AIgAUIANwPIAiABIAg5A8ACIAREAAAAAACAVkCgIgIQPiEDIAQQPiEIIAQQPiEEIAIQPiECIAFCADcDoAIgASACOQOYAiABIASaOQOQAiABQgA3A4gCIAEgCDkDgAIgASADOQP4ASABQgA3A6gCIAFCADcDsAIgAUKAgICAgICA+D83A7gCIAFBCGoiByABQfgBaiABQcACahCaAiABQdAAaiAHIAFBiANqEJoCIAFCADcD8AEgAUIANwPoASABQgA3A+ABIAEgASkDUDcDmAEgASABKQNYNwOgASABIAEpA2A3A6gBIAEgASkDaDcDsAEgASABKQNwNwO4ASABIAEpA3g3A8ABIAEgASkDgAE3A8gBIAEgASkDiAE3A9ABIAEgASkDkAE3A9gBIAVBGGogBiABQZgBaiAGKAIAKAIEEQMAIAFB0ANqJAAgBSAFKQIYNwMIIAAgBUEIahBDAkAgBSgCFCIARQ0AIAAgACgCBCIBQQFrNgIEIAENACAAIAAoAgAoAggRAAAgABAkCyAFQSBqJAALpwICCH8BfCMAQSBrIgQkACAEQRBqIAEQigEgBEEYaiAEKAIQIQcjAEHwAGsiAyQAIANBEGpBAEHgAPwLACADQQI2AgwgA0KAgICAEDcCBCADQShqIQkDQCACQQhBECADQQRqIAVqKAIAIgZBAUYbQQAgBhsiCmorAwAhCyADQRBqIQECQAJAAkAgBg4CAgABCyAJIQEMAQsgA0EQakEwQcgAIAZBAkYbaiEBCyABIApqIAs5AwAgBUEEaiIFQQxHDQALIAcgA0EQaiAHKAIAKAIEEQMAIANB8ABqJAAgBCAEKQIYNwMIIAAgBEEIahBDAkAgBCgCFCIARQ0AIAAgACgCBCIBQQFrNgIEIAENACAAIAAoAgAoAggRAAAgABAkCyAEQSBqJAALGAEBf0EQECMiAEIANwMIIABCADcDACAAC3UBA38jAEEQayIBJAAgAUEIaiAAQQAQKxAqAn8gASgCCCIAKAJAIgJFBEAgACgCTAwBCyAAKAKMASACbgsCQCABKAIMIgBFDQAgACAAKAIEIgNBAWs2AgQgAw0AIAAgACgCACgCCBEAACAAECQLIAFBEGokAAtaAQN/IwBBEGsiASQAIAFBCGogAEEAECsQKiABKAIIKAJAAkAgASgCDCIARQ0AIAAgACgCBCIDQQFrNgIEIAMNACAAIAAoAgAoAggRAAAgABAkCyABQRBqJAALXQEDfyMAQRBrIgEkACABQQhqIABBABArECogASgCCCgCXAJAIAEoAgwiAEUNACAAIAAoAgQiA0EBazYCBCADDQAgACAAKAIAKAIIEQAAIAAQJAsgAUEQaiQAQQF2C7YCAQZ/IwBBMGsiBCQAIAQgAkEDbDYCHCABQTRqIARBHGoiAhA9IAQgAygCADYCHCABQUBrIAIQPSAEIAMtAGggAy0AaUEBdHI6AC8gAUHYAGogBEEvahCrBCAALQAARQRAIARCgoCAgDA3AiQgBEKAgICAEDcCHCADQSBqIQggA0EIaiEAIAFBzABqIQkDQCAEQRxqIAVqKAIAIQYgBEKAgICAEDcCECAEQQI2AhggAEEwQcgAIAZBAkYbaiEBQQAhAwNAIARBEGogA2ooAgAhByAAIQICQAJAAkAgBg4CAgABCyAIIQIMAQsgASECCyAEIAJBCEEQIAdBAUYbQQAgBxtqKwMAtjgCDCAJIARBDGoQ5QIgA0EEaiIDQQxHDQALIAVBBGoiBUEQRw0ACwsgBEEwaiQAC8I/AQN/IwBBEGsiASQAQfDvAUHaH0HoJEECQeokQQMQESABQQ9qQcAIQQAQmQRBkghBCBCZBBpB8O8BEBBB+O8BQYwfQYslQQRBjSVBBRARIAFBDmpB4R9BABDiAkHfH0EEEOICQd0fQQgQ4gIaQfjvARAQQYDwAUGZH0GuJUEGQbAlQQcQESABQQ1qQcAIQQAQ4QJBkghBCBDhAkGACEEQEOECGkGA8AEQEEGI8AFB9R5B0SVBCEHTJUEJEBEgAUEMakHACEEAEIkCQZIIQQgQiQJBgAhBEBCJAkHCCEEYEIkCGkGI8AEQEEGQ8AFBowpBBEEBQQAQF0GQ8AFBjg5BABADQZDwAUGlCEEBEANBkPABQYcXQQIQA0GQ8AFBkw1BAxADQZDwAUGiEUEEEANBkPABQcMMQQUQA0GQ8AFB/wtBBhADQZDwAUGlDUEHEANBkPABQbgRQQgQA0GQ8AFBjhFBCRADQZDwAUHNEUEKEANBkPABQbQPQQsQA0GQ8AFBqxVBDBADQZDwAUGNC0ENEANBkPABQaIXQQ4QA0GY8AFB8RRBBEEBQQAQF0GY8AFB+BdBABADQZjwAUGWD0EBEANBmPABQYcTQQIQA0GY8AFBkBNBAxADQaDwAUG/FEEEQQFBABAXQaDwAUG4FEEAEANBoPABQfEWQQEQA0Gg8AFBow5BAhADQaDwAUGyEEEDEANBqPABQYUKQdEmQQpB0yZBCxARIAFBC2pB6Q9BABD6A0G+CEEQEPoDGkGo8AEQEEGw8AFBlAhB7yZBDEHxJkENEBEgAUEKakHpD0EAEOwDQb4IQRgQ7AMaQbDwARAQQbjwAUHFC0GVJ0EOQZcnQQ8QEUEEECMiAEEANgIAQQQQIyICQQA2AgBBuPABQf4VQeDqAUGaJ0HHASAAQeDqAUGeJ0HIASACEApBBBAjIgBBCDYCAEEEECMiAkEINgIAQbjwAUHFC0GQ6wFBoydByQEgAEGQ6wFBpydBygEgAhAKQbjwARAQQcDwAUHdCUG/J0EQQcEnQREQEUEEECMiAEEANgIAQQQQIyICQQA2AgBBwPABQbkZQfjqAUHEJ0HLASAAQfjqAUHIJ0HMASACEApBBBAjIgBBCDYCAEEEECMiAkEINgIAQcDwAUGsFkGQ6wFBzSdBzQEgAEGQ6wFB0SdBzgEgAhAKIAFBCGpBqw9BEBDlA0HKEEEoEOUDGkHA8AEQEEHI8AFB0PABQeDwAUEAQbwoQRJBvyhBAEG/KEEAQcQIQcEoQRMQCUHI8AFBAUHw8AFBxChBFEEVEAhBCBAjIgBBADYCBCAAQRY2AgBByPABQbgQQQJB9PABQccoQRcgAEEAQQBBABAAQQgQIyIAQQA2AgQgAEEYNgIAQcjwAUGYF0ECQfzwAUHLKEEZIABBAEEAQQAQAEEIECMiAEEANgIEIABBGjYCAEHI8AFBtQtBAkGE8QFBzyhBGyAAQQBBAEEAEABBBBAjIgBBHDYCAEHI8AFB/RFBA0GM8QFB+yhB0QEgAEEAQQBBABAAQQQQIyIAQR02AgBByPABQeIQQQRBsPEBQbwpQdIBIABBAEEAQQAQAEEEECMiAEEeNgIAQcjwAUHwCUEHQdDxAUHCKUHTASAAQQBBAEEAEABB5J0CLQAARQRAQeSdAkEBOgAAQezxAUHA8AEQDQtB6PIBQfDyAUGA8wFBAEHILkHUAUG/KEEAQb8oQQBB1glByy5B1QEQCUHo8gFBAUGQ8wFBzi5B1gFB1wEQCEEEECMiAEHYATYCAEHo8gFB0RBBA0GU8wFB0S5BuwIgAEEAQQBBABAAQQQQIyIAQdkBNgIAQejyAUH3EkEEQaDzAUHWLkG8AiAAQQBBAEEAEABBBBAjIgBB2gE2AgBB6PIBQfkSQQJBsPMBQdwuQb0CIABBAEEAQQAQAEEEECMiAEHbATYCAEHo8gFB7AlBA0HA8wFB4C5BvgIgAEEAQQBBABAAQQQQIyIAQdwBNgIAQejyAUHoCUEEQdDzAUHlLkG/AiAAQQBBAEEAEABB6PIBQcDwAUH5EkHsCRAMQfCdAi0AAEUEQEHwnQJBAToAAEHg8wFB+O8BEA0LQcz0AUHU9AFB5PQBQQBBrDNB3QFBvyhBAEG/KEEAQYUfQa8zQd4BEAlBzPQBQQFB9PQBQbIzQd8BQeABEAhBBBAjIgBB4QE2AgBBzPQBQdEQQQNB+PQBQbUzQcACIABBAEEAQQAQAEEEECMiAEHiATYCAEHM9AFB9xJBBEGQ9QFBujNBwQIgAEEAQQBBABAAQQQQIyIAQeMBNgIAQcz0AUH5EkECQaD1AUHAM0HCAiAAQQBBAEEAEABBBBAjIgBB5AE2AgBBzPQBQewJQQNBsPUBQcQzQcMCIABBAEEAQQAQAEEEECMiAEHlATYCAEHM9AFB6AlBBEHA9QFByTNBxAIgAEEAQQBBABAAQcz0AUH47wFB+RJB7AkQDEH8nQItAABFBEBB/J0CQQE6AABB0PUBQYDwARANC0G89gFBxPYBQdT2AUEAQZA4QeYBQb8oQQBBvyhBAEGSH0GTOEHnARAJQbz2AUEBQeT2AUGWOEHoAUHpARAIQQQQIyIAQeoBNgIAQbz2AUHREEEDQej2AUGZOEHFAiAAQQBBAEEAEABBBBAjIgBB6wE2AgBBvPYBQfcSQQRBgPcBQZ44QcYCIABBAEEAQQAQAEEEECMiAEHsATYCAEG89gFB+RJBAkGQ9wFBpDhBxwIgAEEAQQBBABAAQQQQIyIAQe0BNgIAQbz2AUHsCUEDQaD3AUGoOEHIAiAAQQBBAEEAEABBBBAjIgBB7gE2AgBBvPYBQegJQQRBsPcBQa04QckCIABBAEEAQQAQAEG89gFBgPABQfkSQewJEAxBiJ4CLQAARQRAQYieAkEBOgAAQcD3AUHw7wEQDQtBrPgBQbT4AUHE+AFBAEH0PEHvAUG/KEEAQb8oQQBBxh9B9zxB8AEQCUGs+AFBAUHU+AFB+jxB8QFB8gEQCEEEECMiAEHzATYCAEGs+AFB0RBBA0HY+AFB/TxBygIgAEEAQQBBABAAQQQQIyIAQfQBNgIAQaz4AUH3EkEEQfD4AUGCPUHLAiAAQQBBAEEAEABBBBAjIgBB9QE2AgBBrPgBQfkSQQJBgPkBQYg9QcwCIABBAEEAQQAQAEEEECMiAEH2ATYCAEGs+AFB7AlBA0GQ+QFBjD1BzQIgAEEAQQBBABAAQQQQIyIAQfcBNgIAQaz4AUHoCUEEQaD5AUGRPUHOAiAAQQBBAEEAEABBrPgBQfDvAUH5EkHsCRAMQZSeAi0AAEUEQEGUngJBAToAAEGw+QFBrPgBEA0LQZz6AUGk+gFBtPoBQQBB68MAQfgBQb8oQQBBvyhBAEHSH0HuwwBB+QEQCUGc+gFBAUHE+gFB8cMAQfoBQfsBEAhBBBAjIgBB/AE2AgBBnPoBQdEQQQNByPoBQfTDAEHPAiAAQQBBAEEAEABBBBAjIgBB/QE2AgBBnPoBQfcSQQRB4PoBQfnDAEHQAiAAQQBBAEEAEABBBBAjIgBB/gE2AgBBnPoBQfkSQQJB8PoBQf/DAEHRAiAAQQBBAEEAEABBBBAjIgBB/wE2AgBBnPoBQewJQQNBgPsBQYPEAEHSAiAAQQBBAEEAEABBBBAjIgBBgAI2AgBBnPoBQegJQQRBkPsBQYjEAEHTAiAAQQBBAEEAEABBnPoBQaz4AUH5EkHsCRAMQaCeAi0AAEUEQEGgngJBAToAAEGg+wFBkOsBEA0LQYz8AUGU/AFBpPwBQQBBi8cAQYECQb8oQQBBvyhBAEH6HkGOxwBBggIQCUGM/AFBAUG0/AFBkccAQYMCQYQCEAhBBBAjIgBBhQI2AgBBjPwBQdEQQQNBuPwBQZTHAEHUAiAAQQBBAEEAEABBBBAjIgBBhgI2AgBBjPwBQfcSQQRB0PwBQZnHAEHVAiAAQQBBAEEAEABBBBAjIgBBhwI2AgBBjPwBQfkSQQJB4PwBQZ/HAEHWAiAAQQBBAEEAEABBBBAjIgBBiAI2AgBBjPwBQewJQQNB8PwBQaPHAEHXAiAAQQBBAEEAEABBBBAjIgBBiQI2AgBBjPwBQegJQQRBgP0BQajHAEHYAiAAQQBBAEEAEABBjPwBQZDrAUH5EkHsCRAMQayeAi0AAEUEQEGsngJBAToAAEGQ/QFB/P0BEA0LQYT+AUGM/gFBnP4BQQBBu8wAQYoCQb8oQQBBvyhBAEHID0G+zABBiwIQCUGE/gFBAUGs/gFBwcwAQYwCQY0CEAhBBBAjIgBBjgI2AgBBhP4BQdEQQQNBsP4BQcTMAEHZAiAAQQBBAEEAEABBBBAjIgBBjwI2AgBBhP4BQfcSQQRBwP4BQcnMAEHaAiAAQQBBAEEAEABBBBAjIgBBkAI2AgBBhP4BQfkSQQJB0P4BQc/MAEHbAiAAQQBBAEEAEABBBBAjIgBBkQI2AgBBhP4BQewJQQNB4P4BQdPMAEHcAiAAQQBBAEEAEABBBBAjIgBBkgI2AgBBhP4BQegJQQRB8P4BQdjMAEHdAiAAQQBBAEEAEABBhP4BQfz9AUH5EkHsCRAMQbieAi0AAEUEQEG4ngJBAToAAEGA/wFBmPEBEA0LQez/AUH0/wFBhIACQQBBn9EAQZMCQb8oQQBBvyhBAEH3FkGi0QBBlAIQCUHs/wFBAUGUgAJBpdEAQZUCQZYCEAhBBBAjIgBBlwI2AgBB7P8BQdEQQQNBmIACQajRAEHeAiAAQQBBAEEAEABBBBAjIgBBmAI2AgBB7P8BQfcSQQRBsIACQa3RAEHfAiAAQQBBAEEAEABBBBAjIgBBmQI2AgBB7P8BQfkSQQJBwIACQbPRAEHgAiAAQQBBAEEAEABBBBAjIgBBmgI2AgBB7P8BQewJQQNB0IACQbfRAEHhAiAAQQBBAEEAEABBBBAjIgBBmwI2AgBB7P8BQegJQQRB4IACQbzRAEHiAiAAQQBBAEEAEABB7P8BQZjxAUH5EkHsCRAMQcSeAi0AAEUEQEHEngJBAToAAEHwgAJBuPABEA0LQcDxAUHcgQJB7IECQQBB5dUAQZwCQb8oQQBBvyhBAEG+C0Ho1QBBnQIQCUHA8QFBAUH8gQJB69UAQZ4CQZ8CEAhBBBAjIgBBoAI2AgBBwPEBQdEQQQNBgIICQe7VAEHjAiAAQQBBAEEAEABBBBAjIgBBoQI2AgBBwPEBQfcSQQRBkIICQfPVAEHkAiAAQQBBAEEAEABBBBAjIgBBogI2AgBBwPEBQfkSQQJBoIICQfnVAEHlAiAAQQBBAEEAEABBBBAjIgBBowI2AgBBwPEBQewJQQNBsIICQf3VAEHmAiAAQQBBAEEAEABBBBAjIgBBpAI2AgBBwPEBQegJQQRBwIICQYLWAEHnAiAAQQBBAEEAEABBwPEBQbjwAUH5EkHsCRAMQdCeAi0AAEUEQEHQngJBAToAAEHQggJBiPABEA0LQbyDAkHEgwJB1IMCQQBBydoAQaUCQb8oQQBBvyhBAEHuHkHM2gBBpgIQCUG8gwJBAUHkgwJBz9oAQacCQagCEAhBBBAjIgBBqQI2AgBBvIMCQdEQQQNB6IMCQdLaAEHoAiAAQQBBAEEAEABBBBAjIgBBqgI2AgBBvIMCQfcSQQRBgIQCQdfaAEHpAiAAQQBBAEEAEABBBBAjIgBBqwI2AgBBvIMCQfkSQQJBkIQCQd3aAEHqAiAAQQBBAEEAEABBBBAjIgBBrAI2AgBBvIMCQewJQQNBoIQCQeHaAEHrAiAAQQBBAEEAEABBBBAjIgBBrQI2AgBBvIMCQegJQQRBsIQCQebaAEHsAiAAQQBBAEEAEABBvIMCQYjwAUH5EkHsCRAMQfz9AUHAhAJB0IQCQQBBo9sAQR9BvyhBAEG/KEEAQdwPQabbAEEgEAlB/P0BQQNB4IQCQanbAEEhQSIQCEHzF0EjEMECQZMKQSQQwQJB+glBJRDBAkEEECMiAEEmNgIAQfz9AUHBDkEDQfiEAkGz2wBBrwIgAEEAQQBBABAAQQQQIyIAQSc2AgBB/P0BQfoPQQNBhIUCQbjbAEGwAiAAQQBBAEEAEABBCBAjIgBBADYCBCAAQSg2AgBB/P0BQeATQQNBkIUCQb3bAEEpIABBAEEAQQAQAEEIECMiAEEANgIEIABBKjYCAEH8/QFBmRNBA0GchQJBwtsAQSsgAEEAQQBBABAAQQgQIyIAQQA2AgQgAEEsNgIAQfz9AUGdFUEDQZCFAkG92wBBKSAAQQBBAEEAEABBCBAjIgBBADYCBCAAQS02AgBB/P0BQfgNQQNBkIUCQb3bAEEpIABBAEEAQQAQAEEIECMiAEEANgIEIABBLjYCAEH8/QFB6xNBAkGohQJBx9sAQS8gAEEAQQBBABAAQQgQIyIAQQA2AgQgAEEwNgIAQfz9AUGCCEECQbCFAkHL2wBBMSAAQQBBAEEAEABBCBAjIgBBADYCBCAAQTI2AgBB/P0BQYAYQQJBuIUCQc/bAEEzIABBAEEAQQAQAEEIECMiAEEANgIEIABBNDYCAEH8/QFBnAlBAkHAhQJB09sAQTUgAEEAQQBBABAAQQgQIyIAQQA2AgQgAEE2NgIAQfz9AUHZDUECQcCFAkHT2wBBNSAAQQBBAEEAEABBCBAjIgBBADYCBCAAQTc2AgBB/P0BQbsNQQJByIUCQdfbAEE4IABBAEEAQQAQAEEIECMiAEEANgIEIABBOTYCAEH8/QFBighBA0GchQJBwtsAQSsgAEEAQQBBABAAQQQQIyIAQTo2AgBB/P0BQeQJQQZB0IUCQdvbAEGxAiAAQQBBAEEAEABBCBAjIgBBADYCBCAAQTs2AgBB/P0BQdALQQJB6IUCQePbAEE8IABBAEEAQQAQAEEIECMiAEEANgIEIABBPTYCAEH8/QFBlhBBAkHwhQJB59sAQT4gAEEAQQBBABAAQbcUQQNB+IUCQevbAEE/QcAAQQBBABACQY4VQQNBhIYCQfDbAEHBAEHCAEEAQQAQAkH2E0ECQZCGAkH12wBBwwBBxABBAEEAEAJBzhhBAkGQhgJB9dsAQcMAQcUAQQBBABACQfIYQQJBkIYCQfXbAEHDAEHGAEEAQQAQAkGcGEECQZCGAkH12wBBwwBBxwBBAEEAEAJB3QxBA0GYhgJB+dsAQcgAQckAQQBBABACQbkKQQJBpIYCQf7bAEHKAEHLAEEAQQAQAkGY8QFBrIYCQbyGAkEAQa/cAEHMAEG/KEEAQb8oQQBBihdBstwAQc0AEAlBmPEBQQJBzIYCQbXcAEHOAEHPABAIQfQXQdAAEJ0DQZQKQdEAEJ0DQfsJQdIAEJ0DQQQQIyIAQdMANgIAQZjxAUHPCUEDQeCGAkG+3ABBswIgAEEAQQBBABAAQQQQIyIAQdQANgIAQZjxAUHPFEEEQfCGAkHD3ABBtAIgAEEAQQBBABAAQQgQIyIAQQA2AgQgAEHVADYCAEGY8QFB3RRBBEGAhwJBydwAQdYAIABBAEEAQQAQAEEIECMiAEEANgIEIABB1wA2AgBBmPEBQe0PQQNBkIcCQc/cAEHYACAAQQBBAEEAEABBCBAjIgBBADYCBCAAQdkANgIAQZjxAUGYFkEDQZCHAkHP3ABB2AAgAEEAQQBBABAAQQgQIyIAQQA2AgQgAEHaADYCAEGY8QFB5BZBA0GchwJB1NwAQdsAIABBAEEAQQAQAEEIECMiAEEANgIEIABB3AA2AgBBmPEBQYoKQQJBqIcCQdncAEHdACAAQQBBAEEAEABBCBAjIgBBADYCBCAAQd4ANgIAQZjxAUGWEEECQbCHAkHd3ABB3wAgAEEAQQBBABAAQQQQIyIAQeAANgIAQZjxAUGRGEEDQbiHAkHh3ABBtQIgAEEAQQBBABAAQQgQIyIAQQA2AgQgAEHhADYCAEGY8QFByBRBA0HEhwJB5twAQeIAIABBAEEAQQAQAEEIECMiAEEANgIEIABB4wA2AgBBmPEBQf8QQQNB0IcCQevcAEHkACAAQQBBAEEAEABBCBAjIgBBADYCBCAAQeUANgIAQZjxAUHMFkEDQdCHAkHr3ABB5AAgAEEAQQBBABAAQQgQIyIAQQA2AgQgAEHmADYCAEGY8QFB3AtBA0HEhwJB5twAQeIAIABBAEEAQQAQAEEIECMiAEEANgIEIABB5wA2AgBBmPEBQeEIQQRB4IcCQfDcAEHoACAAQQBBAEEAEABBwQ5B6QAQrgVBhxJB6gAQrgVBBBAjIgBB6wA2AgBBmPEBQbQMQQRBgIgCQfvcAEG3AiAAQQBBAEEAEABBBBAjIgBB7AA2AgBBmPEBQfoPQQNBkIgCQYHdAEG4AiAAQQBBAEEAEABBCBAjIgBBADYCBCAAQe0ANgIAQZjxAUHgE0EDQZyIAkGG3QBB7gAgAEEAQQBBABAAQQgQIyIAQQA2AgQgAEHvADYCAEGY8QFBoBNBBUGwiAJBi90AQfAAIABBAEEAQQAQAEEIECMiAEEANgIEIABB8QA2AgBBmPEBQZ0VQQNBnIgCQYbdAEHuACAAQQBBAEEAEABBCBAjIgBBADYCBCAAQfIANgIAQZjxAUH4DUEDQZyIAkGG3QBB7gAgAEEAQQBBABAAQQgQIyIAQQA2AgQgAEHzADYCAEGY8QFB6xNBAkHEiAJBkt0AQfQAIABBAEEAQQAQAEEIECMiAEEANgIEIABB9QA2AgBBmPEBQYIIQQJBzIgCQZbdAEH2ACAAQQBBAEEAEABBBBAjIgBB9wA2AgBBmPEBQaMKQQJB1IgCQdndAEG5AiAAQQBBAEEAEABBCBAjIgBBADYCBCAAQfgANgIAQZjxAUHVCEEDQeSIAkHd3QBB+QAgAEEAQQBBABAAQQgQIyIAQQA2AgQgAEH6ADYCAEGY8QFBnAlBAkHwiAJB4t0AQfsAIABBAEEAQQAQAEEIECMiAEEANgIEIABB/AA2AgBBmPEBQYcWQQJB8IgCQeLdAEH7ACAAQQBBAEEAEABBCBAjIgBBADYCBCAAQf0ANgIAQZjxAUHbEEECQfCIAkHi3QBB+wAgAEEAQQBBABAAQQgQIyIAQQA2AgQgAEH+ADYCAEGY8QFBhw9BAkHwiAJB4t0AQfsAIABBAEEAQQAQAEEIECMiAEEANgIEIABB/wA2AgBBmPEBQYQJQQJB8IgCQeLdAEH7ACAAQQBBAEEAEABBCBAjIgBBADYCBCAAQYABNgIAQZjxAUGYCEECQfiIAkHm3QBBgQEgAEEAQQBBABAAQQgQIyIAQQA2AgQgAEGCATYCAEGY8QFBtRZBAkGAiQJB6t0AQYMBIABBAEEAQQAQAEEIECMiAEEANgIEIABBhAE2AgBBmPEBQb8WQQNB0IcCQevcAEHkACAAQQBBAEEAEABBCBAjIgBBADYCBCAAQYUBNgIAQZjxAUGKCEEDQdCHAkHr3ABB5AAgAEEAQQBBABAAQQgQIyIAQQA2AgQgAEGGATYCAEGY8QFBqgpBAkGIiQJB7t0AQYcBIABBAEEAQQAQAEEIECMiAEEANgIEIABBiAE2AgBBmPEBQeoUQQJBgIkCQerdAEGDASAAQQBBAEEAEABBCBAjIgBBADYCBCAAQYkBNgIAQZjxAUGFGEECQYCJAkHq3QBBgwEgAEEAQQBBABAAQQgQIyIAQQA2AgQgAEGKATYCAEGY8QFBjw9BBEGQiQJB8t0AQYsBIABBAEEAQQAQAEEEECMiAEGMATYCAEGY8QFB7AhBBEGgiQJB+N0AQboCIABBAEEAQQAQAEEIECMiAEEANgIEIABBjQE2AgBBmPEBQZwUQQRBsIkCQf7dAEGOASAAQQBBAEEAEABBCBAjIgBBADYCBCAAQY8BNgIAQZjxAUHtC0EEQcCJAkGE3gBBkAEgAEEAQQBBABAAQQgQIyIAQQA2AgQgAEGRATYCAEGY8QFBoBlBAkGIiQJB7t0AQYcBIABBAEEAQQAQAEEIECMiAEEANgIEIABBkgE2AgBBmPEBQb8QQQJBsIcCQd3cAEHfACAAQQBBAEEAEABB6xZBA0HQiQJBit4AQZMBQZQBQQBBABACQakOQQZB4IkCQY/eAEGVAUGWAUEAQQAQAkGvFEEDQfiJAkGX3gBBlwFBmAFBAEEAEAJBng9BAUGEigJBnN4AQZkBQZoBQQBBABACQeIQQQNBiIoCQZ/eAEGbAUGcAUEAQQAQAkGPFkEGQaCKAkGk3gBBnQFBngFBAEEAEAJB0xNBBEHAigJBrN4AQZ8BQaABQQBBABACQf4SQQRB0IoCQbLeAEGhAUGiAUEAQQAQAkHwCUEGQeCKAkG43gBBowFBpAFBAEEAEAJBpBVBAkH4igJBwN4AQaUBQaYBQQBBABACQcMNQQJBgIsCQcTeAEGnAUGoAUEAQQAQAkGLFEECQYiLAkHI3gBBqQFBqgFBAEEAEAJB4hhBAkGIiwJByN4AQakBQaoBQQBBABACQYsZQQJBiIsCQcjeAEGpAUGrAUEAQQAQAkG3GEECQYiLAkHI3gBBqQFBrAFBAEEAEAJB+gxBA0GQiwJBzN4AQa0BQa4BQQBBABACQdEKQQJBnIsCQdHeAEGvAUGwAUEAQQAQAkH6FEECQaSLAkHV3gBBsQFBsgFBAEEAEAJB3xFBAkGkiwJB1d4AQbEBQbMBQQBBABACQeUKQQJBrIsCQdneAEG0AUG1AUEAQQAQAkH5CkECQbSLAkHd3gBBtgFBtwFBAEEAEAJBnQtBAUG8iwJB4d4AQbgBQbkBQQBBABACQcAZQQFBvIsCQeHeAEG4AUG6AUEAQQAQAiABQRBqJAALVAEBfyMAQRBrIgIkACAAIAFHBEAgACgCABogASgCABogAEEIaiABQQhqEF4gAkEIaiABQRBqEH8gAiACKQIINwMAIABBEGogAhDnAgsgAkEQaiQAC6cDAQZ/IAEgAkYEQCAAIAM2AgQgACADNgIADwsgAiADRgRAIAAgAjYCBCAAIAE2AgAPCwJAIAIgAUEEaiIFRgRAIAEoAgAhBCADIAJrIgIEQCABIAUgAvwKAAALIAEgAmoiAiAENgIADAELIAMgAkEEakYEQCADIANBBGsiBSABayIEayECIAUoAgAhBiAERSABIAVGckUEQCACIAEgBPwKAAALIAEgBjYCAAwBCwJ/IAIgASIEayIHQQJ1IgYgAyACayIIQQJ1IgFHBEAgBiECA0AgAiABIgJvIgENAAsgBCACQQJ0aiEBA0AgAUEEayIBIAdqIQIgASgCACEJIAEhBQNAIAUgAigCADYCACACIgUgB2ogBCAGIAMgAmtBAnUiAmtBAnRqIAIgBkobIgIgAUcNAAsgBSAJNgIAIAEgBEcNAAsgBCAIagwBCwJAIAIgBEYgAiADRnINACACIQEDQCAEKAIAIQUgBCABKAIANgIAIAEgBTYCACAEQQRqIgQgAkYNASABQQRqIgEgA0cNAAsLIAILIQILIAAgAzYCBCAAIAI2AgALgAEBBX8gAgRAIAMoAgAiBCABKAIAQQR0aiIFKAIEIQEDQAJ/AkACQCABIAQgACACQQF2IgNBAnRqIgYoAgBBBHRqIgcoAgQiCEYEQCAHKAIAIAUoAgBODQEMAgsgASAISg0BCyADDAELIAZBBGohACACIANBf3NqCyICDQALCyAAC40BAQV/IAAgAUcEQCABIABrQQJ1IQEgAygCACIEIAIoAgBBBHRqIgUoAgQhAgNAAn8CQAJAIAQgACABQQF2IgNBAnRqIgYoAgBBBHRqIgcoAgQiCCACRgRAIAUoAgAgBygCAEgNAQwCCyACIAhODQELIAMMAQsgBkEEaiEAIAEgA0F/c2oLIgENAAsLIAAL6gMBCH8jAEEQayIIJAACQCAEIAVMBEAgBiEFIAAgAUcEQCAAIQQDQCAFIAQoAgA2AgAgBUEEaiEFIARBBGoiBCABRw0ACwsCQCAFIAZGDQAgAygCACEDA0AgASACRgRAIAUgBmsiAUUNAiAAIAYgAfwKAAAMAgsCQAJAAkAgAyABKAIAIgRBBHRqIgkoAgQiCiADIAYoAgAiC0EEdGoiBygCBCIMRgRAIAkoAgAgBygCAEgNAQwCCyAKIAxODQELIAAgBDYCACABQQRqIQEMAQsgACALNgIAIAZBBGohBgsgAEEEaiEAIAUgBkcNAAsLDAELIAYhBSABIAJHBEAgASEEA0AgBSAEKAIANgIAIAVBBGohBSAEQQRqIgQgAkcNAAsLIAggAzYCDCAAIQQCQCAFIAZGDQAgCCgCDCELA0AgBCABIgBGBEADQCACQQRrIgIgBUEEayIFKAIANgIAIAUgBkcNAAwDCwALAkACQCALKAIAIgcgBUEEayIJKAIAIgpBBHRqIgwoAgQiDSAHIABBBGsiASgCACIDQQR0aiIHKAIEIg5GBEAgDCgCACAHKAIATg0BDAILIA0gDkgNAQsgCiEDIAAhASAJIQULIAJBBGsiAiADNgIAIAUgBkcNAAsLCyAIQRBqJAALnQIBCH8CQCAAIAFGDQAgAiAAKAIANgIAIABBBGoiBCABRg0AIAMoAgAhBSACIQADQCAAQQRqIQsCQAJAAkAgBSAEKAIAIgNBBHRqIgYoAgQiByAFIAAoAgAiCEEEdGoiCSgCBCIKRgRAIAYoAgAgCSgCAEgNAQwCCyAHIApODQELIAAgCDYCBAJ/IAIgACACRg0AGgNAAkACQCAFIAQoAgBBBHRqIgYoAgQiByAFIABBBGsiAygCACIIQQR0aiIJKAIEIgpGBEAgBigCACAJKAIATg0BDAILIAcgCkgNAQsgAAwCCyAAIAg2AgAgAyIAIAJHDQALIAILIAQoAgA2AgAMAQsgCyADNgIACyALIQAgBEEEaiIEIAFHDQALCwvxAQEEfwJAAkACQAJAAkAgAw4DAwABAgsgBCAAKAIANgIADwsCQCACKAIAIgIgAUEEayIBKAIAIgNBBHRqIgUoAgQiBiACIAAoAgAiB0EEdGoiAigCBCIIRgRAIAUoAgAgAigCAEgNAQwECyAGIAhODQMLIAQgAzYCACAEIAAoAgA2AgQPCyADQQhMBEAgACABIAQgAhCoBA8LIAAgACADQQF2IgVBAnQiB2oiBiACIAUgBCAFEMMBIAYgASACIAMgBWsiAyAEIAdqIAMQwwEgACAGIAYgASAEIAIQkQILDwsgBCAHNgIAIAQgASgCADYCBAv2AQEJfwJAIAAgAUYNACAAQQRqIgMgAUYNACACKAIAIQQgACEFA0AgBSECIAMhBQJAAkAgBCACKAIEIgpBBHRqIgYoAgQiAyAEIAIoAgAiB0EEdGoiCCgCBCIJRgRAIAYoAgAgCCgCAEgNAQwCCyADIAlODQELIAIgBzYCBAJ/IAAgACACRg0AGgNAAkACQCAGKAIEIgcgBCACQQRrIgMoAgAiCEEEdGoiCSgCBCILRgRAIAYoAgAgCSgCAE4NAQwCCyAHIAtIDQELIAIMAgsgAiAINgIAIAMiAiAARw0ACyAACyAKNgIACyAFQQRqIgMgAUcNAAsLC8QBAQV/AkACQCAAKAIEIgIgACgCCCIDSQRAIAIgAS0AADoAACACQQFqIQEMAQsgAiAAKAIAIgJrIgVBAWoiBEEASA0BIAVB/////wcgAyACayIDQQF0IgYgBCAEIAZJGyADQf////8DTxsiAwR/IAMQIwVBAAsiBGoiBiABLQAAOgAAIAUEQCAEIAIgBfwKAAALIAAgAyAEajYCCCAAIAZBAWoiATYCBCAAIAQ2AgAgAkUNACACECILIAAgATYCBA8LECYAC9wIAQp/QQEhCwJAAkACQAJAAkACQAJAIAEgAGtBAnUOBgUFAAECAwQLIAIoAgAoAgAiAiABQQRrIgEoAgAiA0EMbGoiBCgCACIIIAIgACgCACIFQQxsaiICKAIAIgZOBEAgBiAIRw0FIAQoAgQgAigCBE4NBQsgACADNgIAIAEgBTYCAAwFCyABQQRrIQECQCACKAIAKAIAIgIgACgCBCIGQQxsaiIEKAIAIgMgAiAAKAIAIghBDGxqIgUoAgAiB0gNACADIAdGBEAgBCgCBCAFKAIESA0BCyADIAIgASgCACIIQQxsaiIFKAIAIgdMBEAgAyAHRw0FIAUoAgQgBCgCBE4NBQsgACAINgIEIAEgBjYCACACIAAoAgQiAUEMbGoiAygCACIEIAIgACgCACIIQQxsaiICKAIAIgVOBEAgBCAFRw0FIAMoAgQgAigCBE4NBQsgACAINgIEIAAgATYCAAwFCwJAIAMgAiABKAIAIgdBDGxqIgooAgAiCUwEQCADIAlHDQEgCigCBCAEKAIETg0BCyAAIAc2AgAgASAINgIADAULIAAgCDYCBCAAIAY2AgAgAiABKAIAIgNBDGxqIgIoAgAiBCAFKAIAIgZOBEAgBCAGRw0EIAIoAgQgBSgCBE4NBAsgACADNgIEIAEgCDYCAAwECyAAIABBBGogAEEIaiABQQRrIAIQ6QIMAwsgACAAQQRqIABBCGogAEEMaiABQQRrIAIQrQQMAgsgAEEIaiEDAkACQCACKAIAKAIAIgggACgCBCIKQQxsaiIGKAIAIgIgCCAAKAIAIgVBDGxqIgQoAgAiB0gNACACIAdGBEAgBigCBCAEKAIESA0BCyACIAggAygCACIJQQxsaiIHKAIAIgxMBEAgAiAMRw0CIAcoAgQgBigCBE4NAgsgACAKNgIIIAAgCTYCBCAHKAIAIgIgBCgCACIGTgRAIAIgBkcNAiAHKAIEIAQoAgRODQILIAAgBTYCBCAAIAk2AgAMAQsCQCACIAggAygCACIJQQxsaiIHKAIAIgxMBEAgAiAMRw0BIAcoAgQgBigCBE4NAQsgACAFNgIIIAAgCTYCAAwBCyAAIAU2AgQgACAKNgIAIAcoAgAiAiAEKAIAIgZOBEAgAiAGRw0BIAcoAgQgBCgCBE4NAQsgACAFNgIIIAAgCTYCBAsgAEEMaiICIAFGDQBBACEGA0ACQCAIIAIoAgAiB0EMbGoiBSgCACIEIAggAygCACILQQxsaiIKKAIAIglOBEAgBCAJRw0BIAUoAgQgCigCBE4NAQsgAiALNgIAAkADQCAFKAIAIgsgCCADQQRrIgQoAgAiCkEMbGoiCSgCACIMTgRAIAsgDEcNAiAFKAIEIAkoAgRODQILIAMgCjYCACAEIgMgAEcNAAsgACEDCyADIAc2AgAgBkEBaiIGQQhHDQAgAkEEaiABRg8LIAIiA0EEaiICIAFHDQALQQEhCwsgCw8LQQEL1AIBBn8gACABIAIgAyAFEOkCAkAgBSgCACgCACIFIAQoAgAiBkEMbGoiBygCACIIIAUgAygCACIJQQxsaiIKKAIAIgtOBEAgCCALRw0BIAcoAgQgCigCBE4NAQsgAyAGNgIAIAQgCTYCACAFIAMoAgAiBEEMbGoiBigCACIHIAUgAigCACIIQQxsaiIJKAIAIgpOBEAgByAKRw0BIAYoAgQgCSgCBE4NAQsgAiAENgIAIAMgCDYCACAFIAIoAgAiA0EMbGoiBCgCACIGIAUgASgCACIHQQxsaiIIKAIAIglOBEAgBiAJRw0BIAQoAgQgCCgCBE4NAQsgASADNgIAIAIgBzYCACAFIAEoAgAiAkEMbGoiAygCACIEIAUgACgCACIGQQxsaiIFKAIAIgdOBEAgBCAHRw0BIAMoAgQgBSgCBE4NAQsgACACNgIAIAEgBjYCAAsLxQQBBH8CQAJAAkACQCADDgMDAgABCyACKAIAKAIAIgIgAUEEayIBKAIAIgNBA3RqKQMAIAIgACgCACIFQQN0aikDAFQEQCAEIAM2AgAgBCAAKAIANgIEDwsgBCAFNgIAIAQgASgCADYCBA8LIANBCEwEQCAAIAFGDQIgBCAAKAIANgIAIABBBGoiBSABRg0CIAIoAgAoAgAhBiAEIQADQCAAQQRqIQICQCAGIAUoAgAiA0EDdGopAwAgBiAAKAIAIgdBA3RqKQMAVARAIAAgBzYCBAJ/IAQgACAERg0AGgNAIAAgBiAFKAIAQQN0aikDACAGIABBBGsiAygCACIHQQN0aikDAFoNARogACAHNgIAIAMiACAERw0ACyAECyAFKAIANgIADAELIAIgAzYCAAsgAiEAIAVBBGoiBSABRw0ACwwCCyAAIAAgA0EBdiIGQQJ0IgdqIgUgAiAGIAQgBhDGASAFIAEgAiADIAZrIgMgBCAHaiADEMYBIAIoAgAhBiAFIQMCQANAIAEgA0YNASAEIAMoAgAiAiAAKAIAIgcgBigCACIIIAJBA3RqKQMAIAggB0EDdGopAwBUIgIbNgIAIANBBEEAIAIbaiEDIARBBGohBCAAQQBBBCACG2oiACAFRw0ACyABIANGDQIDQCAEIAMoAgA2AgAgBEEEaiEEIANBBGoiAyABRw0ACwwCCyAAIAVGDQEDQCAEIAAoAgA2AgAgBEEEaiEEIABBBGoiACAFRw0ACwwBCyAEIAAoAgA2AgALC+QEAQN/AkACQAJAAkACQCACDgMEAgABCyABQRBrIgErAwAgACsDAGQEQCADIAEpAwg3AwggAyABKQMANwMAIAMgACkDCDcDGCADIAApAwA3AxAPCyADIAApAwg3AwggAyAAKQMANwMAIAMgASkDCDcDGCADIAEpAwA3AxAPCyACQQhMBEAgACABRg0DIAMgACkDCDcDCCADIAApAwA3AwAgAEEQaiIEIAFGDQMgAyEFA0AgBSICQRBqIgUhAAJAIAQrAwAgAisDAGRFDQAgBSACKQMINwMIIAUgAikDADcDACADIQAgAiADRg0AA0AgBCsDACACQRBrIgArAwBkRQRAIAIhAAwCCyACIAApAwg3AwggAiAAKQMANwMAIAAiAiADRw0ACyADIQALIAAgBCkDCDcDCCAAIAQpAwA3AwAgBEEQaiIEIAFHDQALDAMLIAAgACACQQF2IgRBBHQiBmoiBSAEIAMgBBDFASAFIAEgAiAEayICIAMgBmogAhDFASAFIQIDQCABIAJGBEAgACAFRg0EA0AgAyAAKQMINwMIIAMgACkDADcDACADQRBqIQMgAEEQaiIAIAVHDQALDAQLAkAgAisDACAAKwMAZARAIAMgAikDCDcDCCADIAIpAwA3AwAgAkEQaiECDAELIAMgACkDCDcDCCADIAApAwA3AwAgAEEQaiEACyADQRBqIQMgACAFRw0ACwwBCyADIAApAwg3AwggAyAAKQMANwMADAELIAEgAkYNAANAIAMgAikDCDcDCCADIAIpAwA3AwAgA0EQaiEDIAJBEGoiAiABRw0ACwsLbAEBfyAAKAIIIgFFBEBBAA8LAkAgACABKAIAIgBGBEAgAUEANgIAA0AgASgCBCIARQ0CA0AgACIBKAIAIgANAAsMAAsACyABQQA2AgQgAEUNAANAIAAiASgCACIADQAgASgCBCIADQALCyABC6ICAQV/IwBBIGsiBSQAAkACQCAAKAIEIgIgACgCCCIDSQRAIAIgASkCADcCACACQQhqIQEMAQsgAiAAKAIAIgRrQQN1IgZBAWoiAkGAgICAAk8NASAFQQxqQf////8BIAMgBGsiA0ECdSIEIAIgAiAESRsgA0H4////B08bIAYgABBLIgIoAgggASkCADcCACACIAIoAghBCGo2AgggAigCBCAAKAIEIAAoAgAiA2siAWshBCABBEAgBCADIAH8CgAACyAAKAIAIQMgACAENgIAIAIgAzYCBCAAIAIoAggiATYCBCACIAM2AgggACgCCCEEIAAgAigCDDYCCCACIAM2AgAgAiAENgIMIAIQmQELIAAgATYCBCAFQSBqJAAPCxAmAAtTAQF/IABBADYCCCAAQgA3AgAgAQRAIAAgARDxASAAKAIEIgMgAUECdGohASACKAIAIQIDQCADIAI2AgAgA0EEaiIDIAFHDQALIAAgATYCBAsgAAtkAQR/IAAoAgQiAkUEQA8LIAEoAgAhAyAAQQRqIgQhAQNAIAEgAiACKAIQIANIIgUbIQEgAkEEQQAgBRtqKAIAIgINAAsCQCABIARGDQAgAyABKAIQSA0AIAAgARDzAiABECILC6sCAQZ/IwBBMGsiBCQAIAQgAkEDbKw3AxggAUE4aiAEQRhqIgIQkgEgBCADKAIANgIYIAFBxABqIAIQPSAEIAMtAGggAy0AaUEBdHI6AC8gAUHcAGogBEEvahCrBCAALQAARQRAIARCgoCAgDA3AiAgBEKAgICAEDcCGCADQSBqIQggA0EIaiEAIAFB0ABqIQkDQCAEQRhqIAVqKAIAIQYgBEKAgICAEDcCDCAEQQI2AhQgAEEwQcgAIAZBAkYbaiEBQQAhAwNAIARBDGogA2ooAgAhByAAIQICQAJAAkAgBg4CAgABCyAIIQIMAQsgASECCyAJIAJBCEEQIAdBAUYbQQAgBxtqEKgCIANBBGoiA0EMRw0ACyAFQQRqIgVBEEcNAAsLIARBMGokAAuPCAILfwJ+IwBB4ABrIgEkACAAKALUAUEBdCECIAFBGGoiA0EANgIIIANCADcCACADQQFBICACQQFrZ2t0QQAgAhsiAhDsAiADQQA2AhggA0IANwIQIANBEGogAkEAEDEgA0EBNgIkIANBADYCICADIQQgASAAKALMASIDNgIMIAAoAtABIQYgAEEANgLQASABIAY2AhAgACgC1AEhAiAAQQA2AtQBIAEgAjYCFCAAIABB0AFqNgLMASABQRBqIQcCQCACRQRAQZiVAkGYlQIoAgAgAmo2AgAgASAHNgIMDAELIAYgBzYCCEGYlQJBmJUCKAIAIgYgAmo2AgAgAyAHRg0AIABBzAFqIQkgBEEgaiELA0AgASAEKAIkNgJAIAEgBCgCADYCRCABIAQoAgQ2AkggASAEKAIQNgJMIAQoAhQhAiABIAs2AlQgASACNgJQIAM0AhAhDSABIAY2AlwgAUHcAGohCgJAIAFBQGsiAigCCCIFIAIoAhQoAgBBAXRJDQAgDUIeiCANhUK5y5Pn0e2RrL9/fiIMQhuIIAyFQuujxJmxt5LolH9+IgxCH4ggDIWnIAVBAWtxIQUDQCACKAIEIAVBA3RqIgggDSAIKQMAIgwgDEJ/USIIGzcDACAIBEAgAigCFCIIIAgoAgBBAWo2AgAgAigCDCAFQQJ0aiAKKAIANgIADAILIAwgDVENASACKAIIIghBAWsgAigCACAFanEhBSACKAIUKAIAQQF0IAhNDQALCyABIAY2AgggASABQQhqIgU2AlwgAiAJIAUgChB5IAEoAkBBGGogA0EYakHqAPwKAAACQCADKAIEIgIEQANAIAIiAygCACICDQAMAgsACwNAIAMgAygCCCIDKAIARw0ACwsgBkEBaiEGIAMgB0cNAAsLIAAoAtgBIQMgACgCXCEAIAQoAiQhAiAEKAIAIQcgBCgCBCEGIAQoAhAhBSAEKAIUIQkgASAEQSBqNgJUIAEgCTYCUCABIAU2AkwgASAGNgJIIAEgBzYCRCABIAI2AkAgAEEDTwRAIAMgAEEDbkEEdGohBwNAAkAgAzQCACINIAFBQGsiACgCBCAAKAIIQQFrIgYgDUIeiCANhUK5y5Pn0e2RrL9/fiIMQhuIIAyFQuujxJmxt5LolH9+IgxCH4ggDIWncSICQQN0aikDACIMUSAMQn9Rcg0AIAAoAgAhBQNAIAAoAgQgBiACIAVqcSICQQN0aikDACIMIA1RDQEgDEJ/Ug0ACwsgAyAAKAIMIAJBAnRqKAIANgIAIANBEGoiAyAHRw0ACwsgAUEMaiABKAIQEG8gBCgCECIABEAgABAiCyAEQQA2AhggBEIANwIQIAQoAgAiAARAIAAQIgsgAUHgAGokAAv9BAMHfwZ8A34jAEHQAGsiAiQAIAEoAgQiAwRAIAEoAgAiASADQTBsaiEFIAAoAgAhAwNAIAMgAUEw/AoAACADQeAAaiEDIAFBMGoiASAFRw0ACwsgACgCJCEBIAJBADYCCCACQgA3AgAgAiABQQAQMSAAKQIAIQ8gACkCECEQIAAoAiAhASACKQIAIREgAiAAKAIkIgM2AkwgAiABNgJIIAIgEDcCQCACIBE3AjggAiAPNwIwIAJBMGohAEEAIQEgA0EBakEAIAMbIgcEQANAIwBBMGsiAyQAIAFBAXQhBgNAAkAgACgCCCAAKAIQIAZBAnRqKAIAIgZBAWtBAm0iBUECdGoiBCAEKAIAIgRBAWo2AgAgBEUNACAAKAIAIgQgACgCGCAFQQN0aiIIKAIAQTBsaiEFIAQgCCgCBEEwbGoiBCsDACEJIAUrAwAhCiAEKwMIIQsgBSsDCCEMIAMgBSsDECINIAQrAxAiDiANIA5jGzkDECADIAwgCyALIAxkGzkDCCADIAogCSAJIApkGzkDACAEKwMYIQkgBSsDGCEKIAQrAyAhCyAFKwMgIQwgAyAEKwMoIg0gBSsDKCIOIA0gDmQbOQMoIAMgCyAMIAsgDGQbOQMgIAMgCSAKIAkgCmQbOQMYIAAoAgAgBkEwbGogA0Ew/AoAACAGQQFHDQELCyADQTBqJAAgAUEBaiIBIAdHDQALCyACIAAoAgA2AhAgAiAAKAIENgIUIAIgACgCCDYCGCACIAAoAgw2AhwgAiAAKAIQNgIgIAIgACgCFDYCJCACIAAoAhg2AiggAiAAKAIcNgIsIAIoAgAiAARAIAAQIgsgAkHQAGokAAuBAQEBfwJAIAAgAUYNACAAKAIAIgIEQCACECILIABCADcCACAAIAEoAgQiAjYCCCAAIAI2AgQgAkUNACAAIAJBA3QiAhAnIgA2AgAgASgCACIBIAJqIQIDQCAAIAEoAgA2AgAgACABKAIENgIEIABBCGohACABQQhqIgEgAkcNAAsLC10BAX8CQCAAIAFGDQAgACgCACICBEAgAhAiCyAAQgA3AgAgACABKAIEIgI2AgggACACNgIEIAJFDQAgACACQQJ0IgAQJyICNgIAIABFDQAgAiABKAIAIAD8CgAACwtdAQF/AkAgACABRg0AIAAoAgAiAgRAIAIQIgsgAEIANwIAIAAgASgCBCICNgIIIAAgAjYCBCACRQ0AIAAgAkEwbCIAECciAjYCACAARQ0AIAIgASgCACAA/AoAAAsL/gEBDXwgACABRwRAIAMrA0AhCCADKwM4IQkgAysDMCEKIAMrAyghCyADKwMgIQwgAysDGCENIAMrAxAhDiADKwMIIQ8gAysDACEQA0AgAkQAAAAAAAAAACAOIAArAwAiBKIgCyAAKwMIIgWioCAIIAArAxAiBqKgIgcgByAHoiAQIASiIA0gBaKgIAogBqKgIgcgB6IgDyAEoiAMIAWioCAJIAaioCIEIASioKCfIgWjIAcgBaMiBiAGYiIDGzkDECACRAAAAAAAAAAAIAQgBaMgAxs5AwggAkQAAAAAAAAAACAGIAMbOQMAIAJBGGohAiAAQRhqIgAgAUcNAAsLC9MBAgJ8AX8jAEEQayIEJAAgBCAAKQNINwIIIAEoAhAiAQRAIAEgBEEIaiABKAIAKAIYEQEAIAAQWAJAIAAQgwRFBEAgAEEBECwMAQsgACAAEKIBRBHqLYGZl3E9oiICRAAAAAAAAPC/IAJEAAAAAAAA8L9kGyICRAAAAAAAAPC/IAK9Qv///////////wCDQoCAgICAgID4/wBUGyICOQMwIAAgAiAAKwM4IgMgAiADZBs5AzggAEEAEFQgABBaIABBfzYCyAELIARBEGokAA8LEGYAC+wBAgR/AX4gACgCBCIDIAFBAXRLIANBEEtxAkAgASADTQ0AIAAgARDQBCABIAAoAgQiA2siBEEATA0AIAIpAgAhByAAKAIAIANBA3RqIQIDQCACIAc3AgAgAkEIaiECIARBAUsgBEEBayEEDQALCyAAIAE2AgQEQEEAIQQgACgCACECIAAoAgQiBQRAIAIgBUEDdCIBaiEDIAEQJyIEIQYgAiEBA0AgBiABKAIANgIAIAYgASgCBDYCBCAGQQhqIQYgAUEIaiIBIANHDQALCyAAIAIEfyACECIgACgCBAUgBQs2AgggACAENgIACwuSBgIPfwJ+IwBBQGoiAiQAAkAgACgCQCIFRQ0AIABB2ABqEDggAEHoAGoQOCAAQfgAahA4IAAoAlwhASACQQA2AiggAkIANwIgIAJCfzcDCCACQn83AzAgAkEgaiABIAJBCGoQvAQgACgCXCIKBEAgACgCiAEhBCAAKAJ4IQYgACgC2AEhByAAKAJoIQsgAigCICEMA0ACQCALIANBAnQiCGooAgAiAUEASA0AIAcgA0EDbkEEdGooAgAgByABQQNuIglBBHRqKAIARw0AIAQgBkF4QQQgASAJQQNsa0ECRhtqIAFBAnRqKAIAIgkgBWxBA3RqIQ0gBCAGIAhqKAIAIgggBWxBA3RqIQ5BACEBA0AgDiABQQN0Ig9qKwMAIA0gD2orAwBiDQEgAUEBaiIBIAVHDQALIAwgA0EDdGoiASAJNgIEIAEgCDYCAAsgA0EBaiIDIApHDQALCyACQQA2AhwgAkIANwIUIAJBMGoCfyAAKAJAIgFFBEAgACgCTAwBCyAAKAKMASABbgsiBRCWASEDIAUEQCAFrSERA0AgAygCACAQp0EDdGogEDcDACAQQgF8IhAgEVINAAsLIAIoAiQiBARAIAIoAiAiASAEQQN0aiEEA0ACQCABKAIAIgZBf0YNACABKAIEIgdBf0YNACADIAYgBxBfCyABQQhqIgEgBEcNAAsLIAMgAkEUahCMBSEEIAMoAgAiAQRAIAMgATYCBCADKAIIGiABECILIAJBMGogBBDsASIEKAIAIQMgBQRAQQAhASACKAIUIQYDQCADIAYgAUECdGooAgBBAnRqIAE2AgAgAUEBaiIBIAVHDQALCwJAAkAgACgCXCIFBEAgACgCeCEAQQAhASACKAIUIQYDQCAAIAFBAnRqIgcgAyAGIAcoAgBBAnRqKAIAQQJ0aigCADYCACABQQFqIgEgBUcNAAsMAQsgA0UNAQsgBCADNgIEIAQoAggaIAMQIgsgAigCFCIABEAgAiAANgIYIAIoAhwaIAAQIgsgAigCICIARQ0AIAAQIgsgAkFAayQAC9gEAgZ/A3wjAEHQAGsiByQAAkAgASgCBCIIIAFBCGoiCkYNAANAIAgtAIEBRQRAAkAgCCgCBCIJBEADQCAJIggoAgAiCQ0ADAILAAsDQCAIIAgoAggiCCgCAEcNAAsLIAggCkcNAQwCCwsgB0EANgJIIAdCADcCQCAHQUBrIARBABCBASAAKAIEBEBBACEEA0ACQCABIARBA24Q5ARFDQAgACgCICAEQQJ0aigCACIIQQBIDQAgBygCQCAIaiIJLQAADQAgCUEBOgAAIAdCADcDOCAHQgA3AzAgB0IANwMoIAdBAjYCJCAHQoCAgIAQNwIcIAYgCGogBWxBA3QiCiADKAIAaiELQQAhCANAIAdBKGoiDEEIQRAgB0EcaiAIaigCACIJQQFGG0EAIAkbaiALIAlBA3RqKwMAOQMAIAhBBGoiCEEMRw0ACyAHIAIgDBCXAiAHIAcrAxAiDSAHKwMAIg4gDqIgBysDCCIPIA+ioCANIA2ioJ8iDaNEAAAAAAAAAAAgDiANoyIOvUL///////////8Ag0KAgICAgICA+P8AVCIIGzkDOCAHIA8gDaNEAAAAAAAAAAAgCBs5AzAgByAORAAAAAAAAAAAIAgbOQMoIAdBAjYCJCAHQoCAgIAQNwIcIAMoAgAgCmohCkEAIQgDQCAKIAdBHGogCGooAgAiCUEDdGogB0EoakEIQRAgCUEBRhtBACAJG2orAwA5AwAgCEEEaiIIQQxHDQALCyAEQQFqIgQgACgCBEkNAAsLIAcoAkAiAEUNACAAECILIAdB0ABqJAALlScBEH8CQANAIAFBBGshDiABQQxrIREgAUEIayESA0ACQAJAAkACQAJAAkACQCABIAAiCGtBAnUiBQ4GCQkAAQQCAwsgAigCACgCACIAIAFBBGsiASgCACICQQxsaiIDKAIAIgQgACAIKAIAIgVBDGxqIgAoAgAiBk4EQCAEIAZHDQkgAygCBCAAKAIETg0JCyAIIAI2AgAgASAFNgIADwsgAUEEayEAAkAgAigCACgCACIBIAgoAgQiBkEMbGoiAygCACICIAEgCCgCACIEQQxsaiIFKAIAIgdIDQAgAiAHRgRAIAMoAgQgBSgCBEgNAQsgAiABIAAoAgAiBEEMbGoiBSgCACIHTARAIAIgB0cNCSAFKAIEIAMoAgRODQkLIAggBDYCBCAAIAY2AgAgASAIKAIEIgBBDGxqIgIoAgAiAyABIAgoAgAiBEEMbGoiASgCACIFTgRAIAMgBUcNCSACKAIEIAEoAgRODQkLIAggBDYCBCAIIAA2AgAPCwJAIAIgASAAKAIAIgdBDGxqIgooAgAiC0wEQCACIAtHDQEgCigCBCADKAIETg0BCyAIIAc2AgAgACAENgIADwsgCCAENgIEIAggBjYCACABIAAoAgAiAkEMbGoiASgCACIDIAUoAgAiBk4EQCADIAZHDQggASgCBCAFKAIETg0ICyAIIAI2AgQgACAENgIADwsgCCAIQQRqIAhBCGogCEEMaiABQQRrIAIQrQQPCyAFQRdKDQEgBEEBcUUNAiABIAhGDQUgCEEEaiIFIAFGDQUgAigCACgCACEEIAghAgNAIAIhACAFIQICQCAEIAAoAgQiB0EMbGoiBigCACIDIAQgACgCACIFQQxsaiIKKAIAIgtOBEAgAyALRw0BIAYoAgQgCigCBE4NAQsgACAFNgIEAn8gCCAAIAhGDQAaAkADQCAGKAIAIgUgBCAAQQRrIgMoAgAiCkEMbGoiCygCACIOTgRAIAUgDkcNAiAGKAIEIAsoAgRODQILIAAgCjYCACADIgAgCEcNAAsgCAwBCyAACyAHNgIACyACQQRqIgUgAUcNAAsMBQsgCCAIQQRqIAhBCGogAUEEayACEOkCDAQLIANFBEAgASAIRg0EIAIoAgAhDCAFQQJrQQF2IgohAANAAkAgCiAAIgNIDQAgCCAAQQJ0aiEEIAggAEEBdCIGQQFyIgBBAnRqIQsgDCgCACEHAkACQCAGQQJqIgYgBU4NACAHIAsoAgBBDGxqIg4oAgAiCSAHIAsoAgRBDGxqIg0oAgAiD04EQCAJIA9HDQEgDigCBCANKAIETg0BCyALQQRqIQsMAQsgACEGCyAHIAsoAgAiAEEMbGoiCSgCACINIAcgBCgCACIPQQxsaiIOKAIAIhFIDQAgDSARRgRAIAkoAgQgDigCBEgNAQsgBCAANgIAAkACQCAGIApKDQADQCAIIAZBAXQiBkEBciIEQQJ0aiEAAkACQCAGQQJqIgYgBU4NACAHIAAoAgBBDGxqIgkoAgAiDSAHIAAoAgRBDGxqIhEoAgAiEk4EQCANIBJHDQEgCSgCBCARKAIETg0BCyAAQQRqIQAMAQsgBCEGCyAHIAAoAgAiBEEMbGoiCSgCACINIA4oAgAiEUgNASANIBFGBEAgCSgCBCAOKAIESA0CCyALIAQ2AgAgACELIAYgCkwNAAsMAQsgCyEACyAAIA82AgALIANBAWshACADDQALA0AgBSIEQQJrQQF2IQwgAigCACELIAgoAgAhDkEAIQAgCCEFA0AgAEEBdCIHQQFyIQMgBSIGIABBAnRqIgBBBGohBQJ/AkAgB0ECaiIHIARODQAgCygCACIJIAAoAgRBDGxqIg0oAgAiDyAJIABBCGoiCigCAEEMbGoiCSgCACIATgRAIAAgD0cNASADIA0oAgQgCSgCBE4NAhoLIAohBSAHDAELIAMLIQAgBiAFKAIANgIAIAAgDEwNAAsCQCABQQRrIgEgBUYEQCAFIA42AgAMAQsgBSABKAIANgIAIAEgDjYCACAFIAhrQQRqQQJ1IgBBAkgNACALKAIAIgcgCCAAQQJrQQF2IgBBAnRqIgYoAgAiCkEMbGoiCygCACIOIAcgBSgCACIMQQxsaiIDKAIAIglOBEAgCSAORw0BIAsoAgQgAygCBE4NAQsgBSAKNgIAAkACQCAARQ0AA0AgByAIIABBAWtBAXYiAEECdGoiBSgCACIKQQxsaiILKAIAIg4gAygCACIJTgRAIAkgDkcNAiALKAIEIAMoAgRODQILIAYgCjYCACAFIQYgAA0ACwwBCyAGIQULIAUgDDYCAAsgBEEBayEFIARBAkoNAAsMBAsgCCAFQQF0QXxxaiEKIAIoAgAoAgAhBwJAAkACQAJAIAVBgQFPBEACQAJAIAcgCigCACILQQxsaiIFKAIAIgAgByAIKAIAIgxBDGxqIgYoAgAiCUgNACAAIAlGBEAgBSgCBCAGKAIESA0BCyAAIAcgDigCACIGQQxsaiIMKAIAIglMBEAgACAJRw0CIAwoAgQgBSgCBE4NAgsgCiAGNgIAIA4gCzYCACAHIAooAgAiAEEMbGoiBSgCACIGIAcgCCgCACILQQxsaiIMKAIAIglOBEAgBiAJRw0CIAUoAgQgDCgCBE4NAgsgCCAANgIAIAogCzYCAAwBCwJAAkAgACAHIA4oAgAiCUEMbGoiDSgCACIPTARAIAAgD0cNASANKAIEIAUoAgRODQELIAggCTYCAAwBCyAIIAs2AgAgCiAMNgIAIAcgDigCACIAQQxsaiIFKAIAIgsgBigCACIJTgRAIAkgC0cNAiAFKAIEIAYoAgRODQILIAogADYCAAsgDiAMNgIACwJAAkAgByAKQQRrIgsoAgAiDEEMbGoiBSgCACIAIAcgCCgCBCIJQQxsaiIGKAIAIg1IDQAgACANRgRAIAUoAgQgBigCBEgNAQsgACAHIBIoAgAiBkEMbGoiCSgCACINTARAIAAgDUcNAiAJKAIEIAUoAgRODQILIAsgBjYCACASIAw2AgAgByALKAIAIgBBDGxqIgUoAgAiBiAHIAgoAgQiDEEMbGoiCSgCACINTgRAIAYgDUcNAiAFKAIEIAkoAgRODQILIAggADYCBCALIAw2AgAMAQsCQAJAIAAgByASKAIAIg1BDGxqIg8oAgAiEEwEQCAAIBBHDQEgDygCBCAFKAIETg0BCyAIIA02AgQMAQsgCCAMNgIEIAsgCTYCACAHIBIoAgAiAEEMbGoiBSgCACIMIAYoAgAiDU4EQCAMIA1HDQIgBSgCBCAGKAIETg0CCyALIAA2AgALIBIgCTYCAAsCQAJAIAcgCigCBCIMQQxsaiIFKAIAIgAgByAIKAIIIglBDGxqIgYoAgAiDUgNACAAIA1GBEAgBSgCBCAGKAIESA0BCyAAIAcgESgCACIGQQxsaiIJKAIAIg1MBEAgACANRw0CIAkoAgQgBSgCBE4NAgsgCiAGNgIEIBEgDDYCACAHIAooAgQiAEEMbGoiBSgCACIGIAcgCCgCCCIMQQxsaiIJKAIAIg1OBEAgBiANRw0CIAUoAgQgCSgCBE4NAgsgCCAANgIIIAogDDYCBAwBCwJAAkAgACAHIBEoAgAiDUEMbGoiDygCACIQTARAIAAgEEcNASAPKAIEIAUoAgRODQELIAggDTYCCAwBCyAIIAw2AgggCiAJNgIEIAcgESgCACIAQQxsaiIFKAIAIgwgBigCACINTgRAIAwgDUcNAiAFKAIEIAYoAgRODQILIAogADYCBAsgESAJNgIACwJAIAcgCigCACIAQQxsaiINKAIAIgwgByALKAIAIgVBDGxqIgkoAgAiBkgNACAGIAxGBEAgDSgCBCAJKAIESA0BCyAMIAcgCigCBCIGQQxsaiIPKAIAIhBMBEAgDCAQRw0EIA8oAgQgDSgCBE4NBAsgCiAANgIEIAogBjYCACAPKAIAIgAgCSgCACIMTgRAIAAgDEcNAyAPKAIEIAkoAgRODQMLIAsgBjYCACAKIAU2AgAMBAsCQCAMIAcgCigCBCIGQQxsaiIPKAIAIhBMBEAgDCAQRw0BIA8oAgQgDSgCBE4NAQsgCyAGNgIAIAogBTYCBAwDCyALIAA2AgAgCiAFNgIAIA8oAgAiACAJKAIAIgtOBEAgACALRw0EIA8oAgQgCSgCBE4NBAsgCiAFNgIEIAogBjYCACAGIQUMAwsCQCAHIAgoAgAiC0EMbGoiBSgCACIAIAcgCigCACIMQQxsaiIGKAIAIglIDQAgACAJRgRAIAUoAgQgBigCBEgNAQsgACAHIA4oAgAiBkEMbGoiDCgCACIJTARAIAAgCUcNBSAMKAIEIAUoAgRODQULIAggBjYCACAOIAs2AgAgByAIKAIAIgBBDGxqIgUoAgAiBiAHIAooAgAiC0EMbGoiDCgCACIJTgRAIAYgCUcNBSAFKAIEIAwoAgRODQULIAogADYCACAIIAs2AgAMBAsCQAJAIAAgByAOKAIAIglBDGxqIg0oAgAiD0wEQCAAIA9HDQEgDSgCBCAFKAIETg0BCyAKIAk2AgAMAQsgCiALNgIAIAggDDYCACAHIA4oAgAiAEEMbGoiBSgCACIKIAYoAgAiC04EQCAKIAtHDQUgBSgCBCAGKAIETg0FCyAIIAA2AgALIA4gDDYCAAwDCyAGIQUMAQsgACEFCyAIKAIAIQAgCCAFNgIAIAogADYCAAsgA0EBayEDIAgoAgAhEwJAAkACQCAEQQFxIhQNACAHIAhBBGsoAgBBDGxqIgAoAgAiBSAHIBNBDGxqIgkoAgAiCkgNACAFIApGBEAgACgCBCAJKAIESA0BCyAHIA4oAgAiDUEMbGoiACgCACILIApMBEAgCiALRw0CIAkoAgQgACgCBE4NAgsgCEEEaiIGIQAgCiAHIAgoAgQiBUEMbGooAgAiDEgNAgNAAkAgCiAMRw0AIAkoAgQgByAFQQxsaigCBE4NACAGIQAMBAsgBigCBCEFIAZBBGoiACEGIAogByAFQQxsaigCACIMTg0ACwwCCyACKAIAKAIAIgkgE0EMbGoiDygCACEAIAghCgNAIAoiBUEEaiEKIAkgBSgCBCINQQxsaiIGKAIAIgcgAEgNACAAIAdGBEAgBigCBCAPKAIESA0BCwsCQCAFIAhHBEAgCSAOIgcoAgAiC0EMbGooAgAiBiAASA0BA0AgACAGRgRAIAkgC0EMbGooAgQgDygCBEgNAwsgCSAHQQRrIgcoAgAiC0EMbGooAgAiBiAATg0ACwwBCyAKIAEiB08NACAJIA4iBygCACILQQxsaigCACIGIABIDQADQAJAIAAgBkYEQCAHIApNDQMgCSALQQxsaigCBCAPKAIETg0BDAMLIAcgCk0NAgsgCSAHQQRrIgcoAgAiC0EMbGooAgAiBiAATg0ACwsgByAKSwRAIAcoAgAhACAKIQYgByEMA0AgBiAANgIAIAwgDTYCACAPKAIAIRADQCAGIgVBBGohBiAJIAUoAgQiDUEMbGoiACgCACILIBBIDQAgCyAQRgRAIAAoAgQgDygCBEgNAQsLAkAgCSAMQQRrIgwoAgAiAEEMbGooAgAiCyAQSA0AA0AgCyAQRgRAIAkgAEEMbGooAgQgDygCBEgNAgsgCSAMQQRrIgwoAgAiAEEMbGooAgAiCyAQTg0ACwsgBiAMSQ0ACwsgBSAIRwRAIAggBSgCADYCAAsgBSATNgIAIAcgCk0EQCAIIAUgAhCsBCEGIAVBBGoiACABIAIQrAQEQCAFIQEgCCEAIAZFDQYMBwsgBg0ECyAIIAUgAiADIBQQvwQgBUEEaiEAQQAhBAwDCyAIQQRqIgAgAU8NAANAIAogByAAKAIAQQxsaiIEKAIAIgVIDQEgBSAKRgRAIAkoAgQgBCgCBEgNAgsgAEEEaiIAIAFJDQALCwJAIAEiBiAATQ0AIAYhBQNAIAVBBGshBiAKIAtOBEAgCiALRw0CIAkoAgQgByANQQxsaigCBE4NAgsgByAFQQhrKAIAIg1BDGxqKAIAIQsgBiEFDAALAAsgACAGSQRAIAYoAgAhDSAAKAIAIQwDQCAAIA02AgAgBiAMNgIAIAAoAgQhDCAAQQRqIgUhAAJAIAkoAgAiBCAHIAxBDGxqKAIAIgtIDQADQAJAIAQgC0cNACAJKAIEIAcgDEEMbGooAgRODQAgBSEADAILIAUoAgQhDCAFQQRqIgAhBSAEIAcgDEEMbGooAgAiC04NAAsLA0AgBCAHIAZBBGsiBigCACINQQxsaiIFKAIAIgpIDQAgBCAKRgRAIAkoAgQgBSgCBEgNAQsLIAAgBkkNAAsLIABBBGsiBCAIRwRAIAggBCgCADYCAAsgBCATNgIAQQAhBAwBCwsLIAEgCEYNACAIQQRqIgUgAUYNACACKAIAKAIAIQIDQCAIIQAgBSEIAkAgAiAAKAIEIgRBDGxqIgMoAgAiBSACIAAoAgAiBkEMbGoiBygCACIKTgRAIAUgCkcNASADKAIEIAcoAgRODQELIAghBQNAIAUgBjYCACADKAIAIgcgAiAAIgVBBGsiACgCACIGQQxsaiIKKAIAIgtIDQAgByALRgRAIAMoAgQgCigCBEgNAQsLIAUgBDYCAAsgCEEEaiIFIAFHDQALCwvUCAIFfwJ8IwBB8AFrIgMkACAAQgA3A0AgAEKAgICAgICA+L9/NwM4IABCgICAgICAgPi/fzcDMCAAQoCAgICAgIB4NwMoIABCgICAgICAgHg3AyAgAEKAgICAgICAeDcDGCAAQoCAgICAgID4/wA3AxAgAEKAgICAgICA+P8ANwMIIABCgICAgICAgPj/ADcDACAAQgA3A0ggAEEANgJQIABB2ABqEKECGiAAQgA3A9ABIABBfzYCyAEgAEEANgLAASAAQgA3A7gBIABBADYCsAEgAEIANwOoASAAQQA2AqABIABCADcDmAEgAEEANgKQASAAQgA3A4gBIABBADYCkAIgAEIANwOIAiAAQQA2AoACIABCADcD+AEgAEEANgLwASAAQgA3A+gBIABBADYC4AEgAEIANwPYASAAIABB0AFqNgLMASADQQA2AuwBIANCADcC5AEgA0EANgLgASADQgA3AtgBAkACQAJAAkAgAQ4DAAECAwsgA0EYaiIBQYD5AEHgAPwKAAAgA0HkAWogASADQfgAakEEEPECIAFB4PkAQTD8CgAAIANB2AFqIAEgA0HIAGpBBBDwAgwCCyADQRhqIgFBkPoAQcAB/AoAACADQeQBaiABIANB2AFqIgVBCBDxAiABQdD7AEGQAfwKAAAgBSABIANBqAFqQQwQ8AIMAQsgA0EYaiIBQeD8AEGQAfwKAAAgA0HkAWogASADQagBakEGEPECIAFB8P0AQeAA/AoAACADQdgBaiABIANB+ABqQQgQ8AILIAMoAugBIgYgAygC5AEiBWsiAUEYbSEHAkAgBSAGRiIGDQAgARAnIQQgAUUNACAEIAUgAfwKAAALIAAoAkgiBQRAIAUQIgsgACAHNgJQIAAgBzYCTCAAIAQ2AkggBkUEQCABIARqIQEDQCADIAQrAwA5AxggAyAEKwMIOQMgIAQrAxAhCCADQoCAgICAgID4PzcDMCADIAg5AyggAyACIANBGGoQoQEgBCADKQMQNwMQIAQgAykDCDcDCCAEIAMpAwA3AwAgBEEYaiIEIAFHDQALCyADQQA2AhggAyADKALcASIFIAMoAtgBIgJrIgFBDG0iBDYCICADIAQ2AhxBACEEAkAgAiAFRg0AIAMgARAnIgQ2AhggAUUNACAEIAIgAfwKAAALIANBADYCCCADQgA3AgAgACADQRhqIAMQngEgBARAIAQQIgsgABCOASAAEFggACAAEKIBRBHqLYGZl3E9oiIIRAAAAAAAAPC/IAhEAAAAAAAA8L9kGyIIRAAAAAAAAPC/IAi9Qv///////////wCDQoCAgICAgID4/wBUGyIIOQMwIAAgCCAAKwM4IgkgCCAJZBs5AzggAEEAEFQgABBaIAMoAtgBIgEEQCADIAE2AtwBIAMoAuABGiABECILIAMoAuQBIgEEQCADIAE2AugBIAMoAuwBGiABECILIANB8AFqJAAgAAsZAQF/QZiVAiIBIAAgASgCACIAajYCACAAC+gCAQd/IAIoAgQhBQJAIAEoAgQiBGkiCEEBTQRAIARBAWsgBXEhBQwBCyAEIAVLDQAgBSAEcCEFCyABKAIAIgkgBUECdGoiBigCACEDA0AgAyIHKAIAIgMgAkcNAAsCQCABQQhqIAdHBEAgBygCBCEDAkAgCEEBTQRAIAMgBEEBa3EhAwwBCyADIARJDQAgAyAEcCEDCyADIAVGDQELIAIoAgAiAwRAIAMoAgQhAwJAIAhBAU0EQCADIARBAWtxIQMMAQsgAyAESQ0AIAMgBHAhAwsgAyAFRg0BCyAGQQA2AgALIAcCf0EAIAIoAgAiBkUNABogBigCBCEDAkAgCEEBTQRAIAMgBEEBa3EhAwwBCyADIARJDQAgAyAEcCEDCyAGIAMgBUYNABogCSADQQJ0aiAHNgIAIAIoAgALNgIAIAJBADYCACABIAEoAgxBAWs2AgwgAEEBOgAIIAAgATYCBCAAIAI2AgALJwEBfyAAQSBqEMcBIAAoAggiAQRAIAAgATYCDCAAKAIQGiABECILC+4JAQZ/An8CQCABIgMoAgAiBARAIAMoAgQiAkUNAQNAIAIiAygCACICDQALCyADKAIEIgQNACADKAIIIQVBACEEQQEMAQsgBCADKAIIIgU2AghBAAshBgJAIAUoAgAiAiADRgRAIAUgBDYCACAAIANGBEBBACECIAQhAAwCCyAFKAIEIQIMAQsgBSAENgIECyADLQAMIQcgASADRwRAIAMgASgCCCIFNgIIAkAgBSgCACABRgRAIAUgAzYCAAwBCyAFIAM2AgQLIAMgASgCACIFNgIAIAUgAzYCCCADIAEoAgQiBTYCBCAFBEAgBSADNgIICyADIAEtAAw6AAwgAyAAIAAgAUYbIQALAkACQCAARSAHQQFxRXJFBEAgBgRAA0AgAi0ADCEEAkAgAigCCCIBKAIAIgMgAkcEQCAEQQFxRQRAIAJBAToADCABQQA6AAwgASABKAIEIgMoAgAiBDYCBCAEBEAgBCABNgIICyADIAEoAggiBDYCCAJAIAQoAgAgAUYEQCAEIAM2AgAMAQsgBCADNgIECyADIAE2AgAgASADNgIIIAIgACAAIAIoAgAiAUYbIQAgASgCBCECCwJAAkACQAJAIAIoAgAiAwRAIAMtAAxBAUcNAQsgAigCBCIBBEAgAS0ADEEBRw0CCyACQQA6AAwgACACKAIIIgJHBEAgAi0ADA0GCyACQQE6AAwPCyACKAIEIgFFDQELIAEtAAxBAUYNACACIQMMAQsgA0EBOgAMIAJBADoADCACIAMoAgQiADYCACAABEAgACACNgIICyADIAIoAggiADYCCAJAIAAoAgAgAkYEQCAAIAM2AgAMAQsgACADNgIECyADIAI2AgQgAiADNgIIIAIhAQsgAyADKAIIIgAtAAw6AAwgAEEBOgAMIAFBAToADCAAIAAoAgQiASgCACICNgIEIAIEQCACIAA2AggLIAEgACgCCCICNgIIAkAgAigCACAARgRAIAIgATYCAAwBCyACIAE2AgQLIAEgADYCACAAIAE2AggPCyAEQQFxRQRAIAJBAToADCABQQA6AAwgASADKAIEIgQ2AgAgBARAIAQgATYCCAsgAyABKAIIIgQ2AggCQCAEKAIAIAFGBEAgBCADNgIADAELIAQgAzYCBAsgAyABNgIEIAEgAzYCCCACIAAgACACKAIEIgFGGyEAIAEoAgAhAgsgAigCACIBBEAgAS0ADEEBRw0FCwJAIAIoAgQiAwRAIAMtAAxBAUcNAQsgAkEAOgAMIAIoAggiAi0ADEEBRiAAIAJHcQ0BIAJBAToADA8LIAEEQCABLQAMQQFHDQUgAigCBCEDCyADQQE6AAwgAkEAOgAMIAIgAygCACIANgIEIAAEQCAAIAI2AggLIAMgAigCCCIANgIIAkAgACgCACACRgRAIAAgAzYCAAwBCyAAIAM2AgQLIAMgAjYCACACIAM2AgggAiEBDAULIAIoAggiAUEEQQAgAiABKAIARhtqKAIAIQIMAAsACyAEQQE6AAwLDwsgAiEDCyADIAMoAggiAC0ADDoADCAAQQE6AAwgAUEBOgAMIAAgACgCACIBKAIEIgI2AgAgAgRAIAIgADYCCAsgASAAKAIIIgI2AggCQCACKAIAIABGBEAgAiABNgIADAELIAIgATYCBAsgASAANgIEIAAgATYCCAs0AQJ/IAAEQANAIAAoAgAgACgCECIBBEAgACABNgIUIAAoAhgaIAEQIgsgABAiIgANAAsLC+cDAQ1/IwBB4ABrIgdBGGpBAEHIAPwLACADQQNsIQwgACgCECENIAAoAiAhDiAAKAIAIQ8gAigCACEQQQAhAgNAIAIhCiAHQQI2AhQgB0KAgICAEDcCDCAEIAlBDGxqIQtBACEDA0AgC0EEQQhBBEEIIAdBDGogA2ooAgAiBkEBRhtBACAGGyIGQfD4AGooAgAiCEEBRhtBACAIG2ooAgAhESAGIAtqKAIAIQggB0EYaiACIgZBDGxqIgIgBiAMaiISNgIIIAIgETYCBCACIAg2AgAgDyASQQJ0IgJqIBAgCEEEdGoiCCgCADYCACACIA5qIAgoAgw2AgAgAiANakF/NgIAIAZBAWohAiADQQRqIgNBDEcNAAsgCUEBaiIJIAVHDQALIAZBAE4EQCAKQQJqIgJBACACQQBKGyECIAAoAhAhCkEAIQMDQCAHQRhqIAMiAEEMbGoiAygCCCEEIAMoAgQhCSADKAIAIQVBACEDAkACQANAAkAgCSAHQRhqIANBDGxqIgYoAgBGBEAgBigCBCAFRg0BCyACIANGIANBAWohA0UNAQwCCwsgBigCCCIDQQBIDQAgCiAEQQJ0aiADNgIADAELIAEoAgAgBUECdGogBDYCAAsgAEEBaiEDIAAgAkcNAAsLC7YCAgZ/CXwjAEEgayIFJAAgAEEANgIIIABCADcCACABKAIAIgYgASgCBCIHRwRAIAQrAyghDiAEKwMgIQ8gBCsDGCEQIAQrAxAhESAEKwMIIRIgBCsDACETA0AgBUEANgIQIAVCADcCCCAAIAVBCGoQaCAFKAIIIgEEQCAFIAE2AgwgBSgCEBogARAiCyAGKAIAIgQgBigCBCIIRwRAA0AgACgCBCADKAIAIAIoAgAgBCgCACIKQQR0aigCAEEYbGoiASsDECELIAErAwAhDCABKwMIIQ0gBSAKNgIYIAUgDCASoiANIBCioCALIA6ioDkDECAFIAwgE6IgDSARoqAgCyAPoqA5AwhBDGsgBUEIahDEASAEQQRqIgQgCEcNAAsLIAZBDGoiBiAHRw0ACwsgBUEgaiQAC5YBAQJ/IAAoAgAhAiAAKAIEIgAEQCACIAIoAgBBfyAAdEF/QSAgAGsiACABIAAgACABSxsiAGt2cUF/c3E2AgAgAkEEaiECIAEgAGshAQsCQCABQQV2IgBFDQAgAEECdCIDRQ0AIAJBACAD/AsACyABQR9xIgEEQCACIABBAnRqIgAgACgCAEF/QSAgAWt2QX9zcTYCAAsLPQEBfyABQQBIBEAQJgALIAFBAWtBBXZBAWpBACABGyIBQQJ0ECMhAiAAIAE2AgggAEEANgIEIAAgAjYCAAvBCAIKfwZ8IAAoAgAiBigCWCIBIAAoAgQiAigCCEECdGooAgAhAyABIAIoAgBBAnRqIAEgACgCCCIEKAIIQQJ0aigCACIFNgIAIAFBeEEEIAIoAggiB0EDb0ECRhtqIAdBAnRqIAU2AgAgASAEKAIAQQJ0aiADNgIAIAFBeEEEIAQoAggiBUEDb0ECRhtqIAVBAnRqIAM2AgAgBigCaCIBIAIoAgAiA0ECdGogASAEKAIIQQJ0aigCACIFNgIAIAEgBUECdGogAzYCACABIAQoAgAiA0ECdGogASACKAIIQQJ0aigCACIFNgIAIAEgBUECdGogAzYCACABIAIoAggiA0ECdGogBCgCCCIFNgIAIAEgBUECdGogAzYCACAGKAKoASIDIAIoAgBBA20iBUEYbGoiASADIAQoAgBBA20iBEEYbGoiAikDEDcDECABIAIpAwg3AwggASACKQMANwMAIAAoAgwoAgAiASAFQQR0aiICIAEgBEEEdGoiASkCCDcCCCACIAEpAgA3AgAgACgCBCEDIAAoAgghBCAGKAKMASIBBEAgACgCECICKwMIIQsgAisDGCENIAIrAwAhDCACKwMQIRAgAisDKCEOIAIrAyAhDyAGKAJ4IgIgAygCBEECdGogAiAEKAIAQQJ0aigCADYCACACIAMoAgBBAnRqIAIgBCgCCEECdGooAgA2AgAgAiADKAIIQQJ0aiACIAQoAghBAnRqKAIANgIAIAEgBigCQCIFbiEIIAVBAEoEQCAGQYgBaiEJRAAAAAAAAPA/IA8gDKEiDyAPoiAOIAuhIg4gDqKgnyAQIAyhIgwgDKIgDSALoSILIAuioJ+jIgtEAAAAAAAA8D8gC0QAAAAAAADwP2MbIgtEAAAAAAAAAAAgC0QAAAAAAAAAAGQbIgyhIQ0gBigCiAEhA0EAIQcgAiAEKAIEQQJ0aigCACAFbEEDdCEKIAIgBCgCAEECdGooAgAgBWxBA3QhBANAIAwgB0EDdCICIAMgBGpqKwMAoiANIAMgCmogAmorAwCioCELAkAgBigCkAEiAiABTQRAIAkgAkEBdEGAASACGxBEIAYoAogBIgMgBigCjAEiAUEDdGogCzkDAAwBCyADIAFBA3RqIAs5AwALIAYgAUEBaiIBNgKMASAHQQFqIgcgBUcNAAsgACgCBCEDIAAoAgghBCAGKAJ4IQILIAIgBCgCAEECdGogCDYCACACIAMoAghBAnRqIAg2AgALIAYoAlgiAkF4QQQgBCgCBCIBQQNvQQJGG2ogAUECdGooAgAhBSADKAIEIQcgBigCaCEIIAQoAgAhAQJAA0AgCCABQQJ0aigCACIBIAdGDQEgAkF4QQRBfkEBIAFBA29BAkYbIAFqIgFBA29BAkYbaiABQQJ0aigCACAFRw0ACyAGIAMoAgggARDMBCAGIAAoAgQoAggQ9QILC8kBAQd/IAAoAmgiBCABKAIEQQJ0aigCACIDQX9HBEAgBCADQQJ0aiAEIAEoAghBAnRqKAIAIgI2AgAgBCACQQJ0aiADNgIAIwBBEGsiA0ECNgIMIANCgICAgBA3AgQgACgCWCEFIAAoAnghBkEAIQADQCAGIAFBBEEIIANBBGogAGooAgAiAkEBRhtBACACG2ooAgBBAnQiAmoiBygCACEIIAIgBWpBfzYCACACIARqQX82AgAgByAINgIAIABBBGoiAEEMRw0ACwsLtAUBC38jAEEgayIFJAAgAEHIAGohBiAAKAJIIgggACgCWCABQQJ0aigCAEEYbGohAwJAIAAoAkwiByAAKAJQIgRPBEAgBSADKQMQNwMYIAUgAykDCDcDECAFIAMpAwA3AwggBiAEQQF0QYABIAQbEDMgACAAKAJMIgNBAWo2AkwgACgCSCADQRhsaiIDIAUpAxg3AxAgAyAFKQMQNwMIIAMgBSkDCDcDAAwBCyAAIAdBAWo2AkwgCCAHQRhsaiIEIAMpAxA3AxAgBCADKQMINwMIIAQgAykDADcDAAsgACgCSCIJIAAoAlhBeEEEIAFBA29BAkYbaiABQQJ0aigCAEEYbGohAwJAIAAoAkwiCCAAKAJQIgRPBEAgBSADKQMQNwMYIAUgAykDCDcDECAFIAMpAwA3AwggBiAEQQF0QYABIAQbEDMgACAAKAJMIgNBAWo2AkwgACgCSCADQRhsaiIDIAUpAxg3AxAgAyAFKQMQNwMIIAMgBSkDCDcDAAwBCyAAIAhBAWo2AkwgCSAIQRhsaiIGIAMpAxA3AxAgBiADKQMINwMIIAYgAykDADcDAAsgACgCaCIEIAFBAnRqIgsoAgAiBiAEIAJBAnRqIgwoAgAiCUcEQCAAKAJYIQogBiEDA0AgCkF+QQEgA0EDb0ECRhsiDUECdGogA0ECdGogBzYCACAKIAMgDWpBAnQiA2ogBzYCACADIARqKAIAIgMgCUcNAAsLIAEgAkcEQCAAKAJYIQcgAiEDA0AgB0F+QQEgA0EDb0ECRhsiCkECdGogA0ECdGogCDYCACAHIAMgCmpBAnQiA2ogCDYCACADIARqKAIAIgMgAUcNAAsLIAsgCTYCACAEIAlBAnRqIAE2AgAgDCAGNgIAIAQgBkECdGogAjYCACAAIAIQ9QIgBUEgaiQAC6UTAgt/DXwjAEHgAWsiBiQAAkAgAUEASA0AIAFBAnQiByAAKAJoaigCACIKQQBIDQAgByADKAIAIgdqKAIAIgkgAigCAEYEQCAHIApBAnRqKAIAIAlGDQELIAYgATYCeCAGQX5BASABIAFBA24iCUEDbGtBAkYbIAFqIgc2AnwgBkF+QQEgB0EDcEECRhsgB2o2AoABIAYgCjYCbCAGQX5BASAKIApBA24iC0EDbGtBAkYbIApqIgc2AnAgBkF+QQEgB0EDb0ECRhsgB2oiDzYCdCAAKAKoASIMIAlBGGxqIgcrAwgiFZkhFAJ8IAcrAxAiEZkiEiAHKwMAIhaZIhNkRSASIBRkRXJFBEBEAAAAAAAAAAAhEkQAAAAAAAAAACETRAAAAAAAAPA/DAELIBMgFGMEQEQAAAAAAADwPyETRAAAAAAAAAAAIRIgFSERRAAAAAAAAAAADAELRAAAAAAAAPA/IRJEAAAAAAAAAAAhEyAWIRFEAAAAAAAAAAALIRQgBkEgakEAQcAA/AsAIAZBAjYCuAEgBkKAgICAEDcCsAEgFJogFCARRAAAAAAAAAAAYyIHGyERIBKaIBIgBxshFSATmiATIAcbIRYgACgCSCEJIAAoAlghDUEAIQcDQCAGQSBqIAZBsAFqIAdqKAIAIghBBHRqIg4gEyAJIA0gBkH4AGpBBEEIIAhBAUYbQQAgCBtqKAIAQQJ0aigCAEEYbGoiCCsDACIZoiAUIAgrAwgiGKKgIBIgCCsDECIXoqA5AwggDiARIBmiIBUgGKKgIBYgF6KgOQMAIAdBBGoiB0EMRw0ACyAAKwM4IRkgBisDMCIcIAYrAyAiFqEiESAGKwNIIhQgBisDKCISoSIToiAGKwM4IhogEqEiFSAGKwNAIhggFqEiF6KhIhtEAAAAAAAAAABkBEAgGyAbokQAAAAAAAAQQKIgGSAZIBcgF6IgEyAToqAiEyARIBGiIBUgFaKgIhcgEyAXZBuiomVFDQELIAYgFTkDuAEgBiAROQOwASAGIBIgFKE5A9gBIAYgFiAYoTkD0AEgBiAUIBqhOQPIASAGIBggHKE5A8ABIAZBAjYCFCAGQoCAgIAQNwIMQQAhBwNAIAZBkAFqIAZBDGogB2ooAgAiCEEDdGogBkGwAWogCEEEdGoiCCsDACIRIBGiIAgrAwgiESARoqA5AwAgB0EEaiIHQQxHDQALIAYrA5ABIhEgBisDmAFkRQ0AIBEgBisDoAFkRQ0AIABB2AFqIQ4gDCALQRhsaiIHKwMIIhWZIRQCfCAHKwMQIhGZIhIgBysDACIWmSITZEUgEiAUZEVyRQRARAAAAAAAAAAAIRJEAAAAAAAAAAAhE0QAAAAAAADwPwwBCyATIBRjBEBEAAAAAAAA8D8hE0QAAAAAAAAAACESIBUhEUQAAAAAAAAAAAwBC0QAAAAAAADwPyESRAAAAAAAAAAAIRMgFiERRAAAAAAAAAAACyEUIAZBAjYCuAEgBkKAgICAEDcCsAEgFJogFCARRAAAAAAAAAAAYyIHGyEVIBKaIBIgBxshFiATmiATIAcbIRhBACEHA0AgBkEgaiIMIAZBsAFqIAdqKAIAIghBBHRqIgsgEyAJIA0gBkH4AGoiEEEEQQggCEEBRhtBACAIG2ooAgBBAnRqKAIAQRhsaiIIKwMAIhGiIBQgCCsDCCIXoqAgEiAIKwMQIhuioDkDCCALIBUgEaIgFiAXoqAgGCAboqA5AwAgB0EEaiIHQQxHDQALIAYgEyAJIA0gD0ECdGooAgBBGGxqIgcrAwAiE6IgFCAHKwMIIhSioCASIAcrAxAiEqKgIhE5A1ggBiAVIBOiIBYgFKKgIBggEqKgIhU5A1AgBiAONgIYIAYgADYCDCAGKwM4IRYgBisDMCEUIAYrAyghEiAGKwMgIRMgBiAMNgIcIAYgBkHsAGo2AhQgBiAQNgIQAkAgESAWoSIYIBMgFKEiF6IgFSAUoSIbIBIgFqEiHKKhIhpEAAAAAAAAAABkBEAgGiAaokQAAAAAAAAQQKIgGSAZIBsgG6IgGCAYoqAiGiAXIBeiIBwgHKKgIh0gGiAdZBuiomVFDQELIAYgHDkDuAEgBiAXOQOwASAGIBYgEaE5A9gBIAYgFCAVoTkD0AEgBiARIBKhOQPIASAGIBUgE6E5A8ABIAZBAjYCjAEgBkKAgICAEDcChAFBACEHA0AgBkGQAWogBkGEAWogB2ooAgAiCUEDdGogBkGwAWogCUEEdGoiCSsDACIRIBGiIAkrAwgiESARoqA5AwAgB0EEaiIHQQxHDQALIAYrA5ABIhEgBisDmAFkRQ0BIBEgBisDoAFkRQ0BIAZBDGoQygQgAigCACEHIAYrA1AgBisDQKEiESARoiAGKwNYIAYrA0ihIhEgEaKgIAArAzgiESARomMEQCACIAdBAWo2AgAgACAGKAKAASAFRAAAAAAAAPC/QQAQ9wIaIAVBAEEAEDEMAgsgAygCACIAIAFBAnRqIAc2AgAgACAKQQJ0aiAHNgIAIAYgBikCbEIgiTcCsAEgBiAGKQJ4QiCJNwK4ASAEKAIEIQdBACEAA0AgBkGwAWogAGooAgAhAQJAIAQoAggiAiAHTQRAIAQgAkEBdEGAASACGxAlIAQoAgAgBCgCBCIHQQJ0aiABNgIADAELIAQoAgAgB0ECdGogATYCAAsgBCAHQQFqIgc2AgQgAEEEaiIAQRBHDQALDAELIBUgE6EiFSAGKwNIIhwgEqEiF6IgESASoSIRIAYrA0AiHSAToSISoqEiE0QAAAAAAAAAAGRFDQAgEyATokQAAAAAAAAQQKIgGSAZIBIgEqIgFyAXoqAiEiAVIBWiIBEgEaKgIhEgESASYxuiomUNACAYIB0gFKEiEaIgGyAcIBahIhWioSIWRAAAAAAAAAAAZEUNACAWIBaiRAAAAAAAABBAoiAZIBkgGiARIBGiIBUgFaKgIhEgESAaYxuiomUNACAGQQxqEMoEIAMoAgAiAyABQQJ0aiACKAIAIgE2AgAgAyAKQQJ0aiABNgIAIAYgACgCaCIAIAYoAmxBAnRqKAIANgKwASAGIAAgBigCfEECdGooAgA2ArQBIAQoAgQhB0EAIQADQCAGQbABaiAAaigCACEBAkAgBCgCCCICIAdNBEAgBCACQQF0QYABIAIbECUgBCgCACAEKAIEIgdBAnRqIAE2AgAMAQsgBCgCACAHQQJ0aiABNgIACyAEIAdBAWoiBzYCBCAAQQRqIgBBCEcNAAsLIAZB4AFqJAAL4RACC38MfCMAQYACayICJAAgAkEANgJIIAJCADcCQCAAKAJcIQogAkEANgI4IAJCADcCMCACQTBqQQoQJSACQQA2AiggAkIANwIgIAAoAlwhAyACQQA2AhggAkIANwIQIAJBEGogA0F/EDEgAkEANgIMAkAgCkUNAANAAkAgBkECdCIFIAAoAmhqKAIAIgNBAEgNACACIAY2ApgBIAJBfkEBIAYgBkEDbSIEQQNsa0ECRhsgBmoiBzYCnAEgAkF+QQEgB0EDb0ECRhsgB2oiCTYCoAEgAiADNgKMASACQX5BASADIANBA24iC0EDbGtBAkYbIANqIgM2ApABIAJBfkEBIANBA29BAkYbIANqIgM2ApQBAkAgBSAAKAJYIgVqKAIAIAFODQAgBSAHQQJ0aigCACABTg0AIAUgCUECdGooAgAgAU4NACAFIANBAnRqKAIAIAFIDQELIAAoAqgBIgkgBEEYbGoiAysDCCIRmSEQAnwgAysDECINmSIPIAMrAwAiEpkiDmRFIA8gEGRFckUEQEQAAAAAAAAAACEPRAAAAAAAAAAAIQ5EAAAAAAAA8D8MAQsgDiAQYwRARAAAAAAAAPA/IQ5EAAAAAAAAAAAhDyARIQ1EAAAAAAAAAAAMAQtEAAAAAAAA8D8hD0QAAAAAAAAAACEOIBIhDUQAAAAAAAAAAAshEEEAIQMgAkHQAGpBAEEw/AsAIAJBAjYC2AEgAkKAgICAEDcC0AEgEJogECANRAAAAAAAAAAAYyIHGyENIA+aIA8gBxshESAOmiAOIAcbIRIgACgCSCEHA0AgAkHQAGogAkHQAWogA2ooAgAiBEEEdGoiDCAOIAcgBSACQZgBakEEQQggBEEBRhtBACAEG2ooAgBBAnRqKAIAQRhsaiIEKwMAIhWiIBAgBCsDCCIUoqAgDyAEKwMQIhOioDkDCCAMIA0gFaIgESAUoqAgEiAToqA5AwAgA0EEaiIDQQxHDQALIAArAzghFSACKwNgIhcgAisDUCISoSINIAIrA3giECACKwNYIg+hIg6iIAIrA2giGCAPoSIRIAIrA3AiFCASoSIToqEiFkQAAAAAAAAAAGQEQCAWIBaiRAAAAAAAABBAoiAVIBUgEyAToiAOIA6ioCIOIA0gDaIgESARoqAiEyAOIBNkG6KiZUUNAQsgAiAROQPYASACIA05A9ABIAIgDyAQoTkD+AEgAiASIBShOQPwASACIBAgGKE5A+gBIAIgFCAXoTkD4AEgAkECNgKsASACQoCAgIAQNwKkAUEAIQMDQCACQbABaiACQaQBaiADaigCACIEQQN0aiACQdABaiAEQQR0aiIEKwMAIg0gDaIgBCsDCCINIA2ioDkDACADQQRqIgNBDEcNAAsgAisDsAEiDSACKwO4AWRFDQAgDSACKwPAAWRFDQAgCSALQRhsaiIDKwMIIhGZIRACfCADKwMQIg2ZIg8gAysDACISmSIOZEUgDyAQZEVyRQRARAAAAAAAAAAAIQ9EAAAAAAAAAAAhDkQAAAAAAADwPwwBCyAOIBBjBEBEAAAAAAAA8D8hDkQAAAAAAAAAACEPIBEhDUQAAAAAAAAAAAwBC0QAAAAAAADwPyEPRAAAAAAAAAAAIQ4gEiENRAAAAAAAAAAACyEQIAJBAjYC2AEgAkKAgICAEDcC0AEgEJogECANRAAAAAAAAAAAYyIDGyENIA+aIA8gAxshESAOmiAOIAMbIRJBACEDA0AgAkHQAGogAkHQAWogA2ooAgAiBEEEdGoiCSAOIAcgBSACQYwBakEEQQggBEEBRhtBACAEG2ooAgBBAnRqKAIAQRhsaiIEKwMAIhSiIBAgBCsDCCIToqAgDyAEKwMQIhaioDkDCCAJIA0gFKIgESAToqAgEiAWoqA5AwAgA0EEaiIDQQxHDQALAkAgAisDYCIXIAIrA1AiEqEiDSACKwN4IhAgAisDWCIPoSIOoiACKwNoIhggD6EiESACKwNwIhQgEqEiE6KhIhZEAAAAAAAAAABkBEAgFiAWokQAAAAAAAAQQKIgFSAVIBMgE6IgDiAOoqAiDiANIA2iIBEgEaKgIhUgDiAVZBuiomVFDQELIAIgETkD2AEgAiANOQPQASACIA8gEKE5A/gBIAIgEiAUoTkD8AEgAiAQIBihOQPoASACIBQgF6E5A+ABIAJBAjYCrAEgAkKAgICAEDcCpAFBACEDA0AgAkGwAWogAkGkAWogA2ooAgAiBUEDdGogAkHQAWogBUEEdGoiBSsDACINIA2iIAUrAwgiDSANoqA5AwAgA0EEaiIDQQxHDQALIAIrA7ABIg0gAisDuAFkRQ0BIA0gAisDwAFkRQ0BCyACKAJEIgMgAigCSCIFTwRAIAJBQGsgBUEBdEGAASAFGxAlIAIgAigCRCIDQQFqNgJEIAIoAkAiCCADQQJ0aiAGNgIADAELIAIgA0EBajYCRCAIIANBAnRqIAY2AgALIAZBAWoiBiAKRw0ACyACKAJEIgFFDQAgCCABQQJ0aiEGA0AgCCgCACEBIAIgAigCDEEBajYCDCAAIAEgAkEMaiACQRBqIAJBIGogAkEwahDNBANAIAIoAiQiAQRAIAIoAiAgAUECdGpBBGsoAgAhBSACQSBqIgQgAUEBayIDECUgAiADNgIkIAFBEUkgASADQQF0TXJFBEAgBBAtCyAAIAUgAkEMaiACQRBqIAJBIGogAkEwahDNBAwBCwsgCEEEaiIIIAZHDQALCyACQQA2AkQgAkFAaxAtIAIoAhAiAARAIAAQIgsgAigCICIABEAgABAiCyACKAIwIgAEQCAAECILIAIoAkAiAARAIAAQIgsgAkGAAmokAAvRAwIJfwN8IwBBIGsiAiQAIAJBADYCGCACQgA3AhAgACgCXCEIIAJBADYCCCACQgA3AgAgAkEKECUCQCAIRQ0AIABBOEEwIAEbaisDACIMIAyiIQ0DQAJAIANBAnQiBCAAKAJoaigCAEEASA0AIAAoAlggBGoiBUF4QQQgA0EDb0ECRhtqKAIAIQQgASAESiIJIAEgBSgCACIHSnENACAAKAJIIgogBEEYbGoiBSsDACAKIAdBGGxqIgcrAwChIgsgC6IgBSsDCCAHKwMIoSILIAuioCAFKwMQIAcrAxChIgsgC6KgIA0gACsDMCILIAuiIAkbY0UNACACKAIUIgQgAigCGCIFTwRAIAJBEGogBUEBdEGAASAFGxAlIAIgAigCFCIEQQFqNgIUIAIoAhAiBiAEQQJ0aiADNgIADAELIAIgBEEBajYCFCAGIARBAnRqIAM2AgALIANBAWoiAyAIRw0ACyACKAIUIgNFDQAgBiADQQJ0aiEDA0AgACAGKAIAIAIgDCABEPcCGiACQQBBABAxIAZBBGoiBiADRw0ACwsgAkEANgIUIAJBEGoQLSACKAIAIgAEQCAAECILIAIoAhAiAARAIAAQIgsgAkEgaiQAC3wBBX8gACgCCCABSQRAIAFBA3QQJyEFIAAoAgAhAyAAKAIEIgIEQCADIAJBA3RqIQYgBSECIAMhBANAIAIgBCgCADYCACACIAQoAgQ2AgQgAkEIaiECIARBCGoiBCAGRw0ACwsgAwRAIAMQIgsgACABNgIIIAAgBTYCAAsLgAEBA38gARCvAiICQff///8HSQRAAkACQCACQQtPBEAgAkEHciIEQQFqECMhAyAAIARB/////wdrNgIIIAAgAzYCACAAIAI2AgQMAQsgACACOgALIAAhAyACRQ0BCyACRQ0AIAMgASAC/AoAAAsgAiADakEAOgAADwtBwBIQngUAC8oDAQh/IwBBIGsiBiQAAkAgASgCBCICIAEoAgBHBEADQCACQQRrKAIAIQQgAkEIayICKAIAIQUgAkIANwIAIAEgAhAvNgIEIAUgBSgCACgCCBEEAEEDRwRAIAAoAgAhAiAEBEAgBCAEKAIEQQFqNgIECwJAIAIoAgQiAyACKAIIIghJBEAgAyAENgIEIAMgBTYCACADQQhqIQMMAQsgAyACKAIAIgdrQQN1IglBAWoiA0GAgICAAk8NBCAGQQxqQf////8BIAggB2siCEECdSIHIAMgAyAHSRsgCEH4////B08bIAkgAhBLIQggBigCFCIDIAQ2AgQgAyAFNgIAIAYgA0EIajYCFCAGKAIQIAIoAgQgAigCACIHayIFayEDIAUEQCADIAcgBfwKAAALIAIoAgAhBSACIAM2AgAgBiAFNgIQIAIgBigCFCIDNgIEIAYgBTYCFCACKAIIIQcgAiAGKAIYNgIIIAYgBzYCGCAIIAU2AgAgCBBuCyACIAM2AgQLAkAgBEUNACAEIAQoAgQiAkEBazYCBCACDQAgBCAEKAIAKAIIEQAAIAQQJAsgASgCBCICIAEoAgBHDQALCyAGQSBqJAAPCxAmAAudAQEEfyMAQRBrIgQkAEEYECMiAkEANgIUIAJCADcCDCACQaiUAjYCACACQgA3AgQgAkEMaiIDIAEoAgAiBSABKAIEIgEgASAFa0EDdRCBAyAAIAI2AgQgACADNgIAQSQQIyIBQdCUAjYCACABQgA3AgQgAUEMaiECIwBBEGsiAyQAIANBEGokACAAIAE2AgwgACACNgIIIARBEGokAAtcAQF/AkAgACsDACABKwMYZUUNACAAKwMIIAErAyBlRQ0AIAArAxAgASsDKGVFDQAgACsDGCABKwMAZkUNACAAKwMgIAErAwhmRQ0AIAArAyggASsDEGYhAgsgAgtWAQV/IAAoAgAiAigCACIBBEAgASEDIAIhBCACKAIEIgUgAUcEQANAIAEgBUEQaxAvIgVHDQALIAAoAgAiBCgCACEDCyACIAE2AgQgBCgCCBogAxAiCwvpAQEEfyMAQRBrIgMkAAJAIAJBAkgNACAAIAJBAmtBAXYiBEEEdGoiBSABQRBrIgIQoAFFDQAgAyACKAIANgIAIAMgAUEMayIGKAIANgIEIAJBADYCACAGQQA2AgAgAyABQQhrKQMANwMIA0ACQCACIAUiARBOIAIgASkDCDcDCCAERQ0AIAEhAiAAIARBAWtBAXYiBEEEdGoiBSADEKABDQELCyABIAMQTiABIAMpAwg3AwggAygCBCIARQ0AIAAgACgCBCIBQQFrNgIEIAENACAAIAAoAgAoAggRAAAgABAkCyADQRBqJAALyQIBCH8jAEEQayIEJAACQCABIABrQQR1IgdBAkgNACAEIAAoAgA2AgAgBCAAKAIENgIEIABCADcCACAEIAApAwg3AwggB0ECa0EBdiEJIAAhBQNAIANBAXQiBkEBciEIIAUgA0EEdGoiA0EQaiECIAcgBkECaiIGTAR/IAgFIANBIGoiAyACIAIgAxCgASIDGyECIAYgCCADGwshAyAFIAIQTiAFIAIpAwg3AwggAiEFIAMgCUwNAAsCQCABQRBrIgUgAkYEQCACIAQQTiACIAQpAwg3AwgMAQsgAiAFEE4gAiABQQhrIgEpAwA3AwggBSAEEE4gASAEKQMINwMAIAAgAkEQaiIBIAEgAGtBBHUQ1gQLIAQoAgQiAEUNACAAIAAoAgQiAUEBazYCBCABDQAgACAAKAIAKAIIEQAAIAAQJAsgBEEQaiQAC/IUAgl/AX4jAEFAaiIFJAACQAJAAkACQAJAIAIoAgQgAigCACIGa0EDdSIEDgMAAQIDCyAAEPsCDAMLIAAgBigCADYCACAAIAYoAgQiADYCBCAARQ0CIAAgACgCBEEBajYCBAwCCyAFQShqIAYoAgAQKiAFKAIoIQQgBUEcaiACKAIAKAIIECogACAEIAUoAhwgASADEP0CAkAgBSgCICIBRQ0AIAEgASgCBCIAQQFrNgIEIAANACABIAEoAgAoAggRAAAgARAkCyAFKAIsIgFFDQEgASABKAIEIgBBAWs2AgQgAA0BIAEgASgCACgCCBEAACABECQMAQsgBUEANgIkIAVCADcCHCMAQSBrIgwkAAJAAkAgBUEcaiIKKAIIIAooAgAiBmtBBHUgBEkEQCAEQYCAgIABTw0BIAxBDGogBCAKKAIEIAZrQQR1IAoQMiIJKAIEIAooAgQgCigCACIEayIIayEGIAgEQCAGIAQgCPwKAAALIAooAgAhCCAKIAY2AgAgCSAINgIEIAogCSgCCDYCBCAJIAg2AgggCigCCCEEIAogCSgCDDYCCCAJIAg2AgAgCSAENgIMIAkQmAILIAxBIGokAAwBCxAmAAsgBUEANgIoIAIoAgQiCyACKAIAIgRHBEADQCAEIAdBA3RqIQkjAEEgayIMJAACQAJAAkAgBUEcaiIKKAIEIgQgCigCCCIGSQRAIAQgCSgCADYCACAEIAkoAgQ2AgQgCUIANwIAIAQgBTUCKDcDCCAEQRBqIQYMAQsgBCAKKAIAIgRrQQR1IgdBAWoiCEGAgICAAU8NASAMQQxqQf////8AIAYgBGsiBkEDdSIEIAggBCAISxsgBkHw////B08bIAcgChAyIggoAggiBCAJKAIANgIAIAQgCSgCBDYCBCAJQgA3AgAgBCAFNQIoNwMIIAggBEEQajYCCCAIKAIEIAooAgQgCigCACIEayIHayEGIAcEQCAGIAQgB/wKAAALIAooAgAhByAKIAY2AgAgCCAHNgIEIAogCCgCCCIGNgIEIAggBzYCCCAKKAIIIQQgCiAIKAIMNgIIIAggBzYCACAIIAQ2AgwgCBCYAgsgCiAGNgIEIAxBIGokAAwBCxAmAAsgBSAFKAIoQQFqIgc2AiggByACKAIEIgsgAigCACIEa0EDdUkNAAsLIAQgC0cEQANAIAQgC0EIaxAvIgtHDQALCyACIAQ2AgQgBSgCICAFKAIcIgprIgRBBHUiCUECTgRAIAlBAmtBAXYiDCEEA0ACQCAMIAQiBkkNACAKIARBBHRqIQcgCiAEQQF0IgJBAXIiC0EEdGohBCAJIAJBAmoiCEoEQCAEQRBqIgIgBCAEIAIQoAEiAhshBCAIIAsgAhshCwsgBCAHEKABDQAgBSAHKAIANgIoIAUgBygCBDYCLCAHQgA3AwAgBSAHKQMINwMwA0ACQCAHIAQiAhBOIAcgBCkDCDcDCCALIAxKDQAgCiALQQF0IgdBAXIiC0EEdGohBCAJIAdBAmoiCEoEQCAEQRBqIgcgBCAEIAcQoAEiBxshBCAIIAsgBxshCwsgAiEHIAQgBUEoahCgAUUNAQsLIAIgBUEoahBOIAIgBSkDMDcDCCAFKAIsIgRFDQAgBCAEKAIEIgJBAWs2AgQgAg0AIAQgBCgCACgCCBEAACAEECQLIAZBAWshBCAGQQBKDQALIAUoAiAgBSgCHCIKayEECyAFQQA2AhggBUIANwIQAkAgBEERTwRAIAmtIQ0DQAJAIANFDQAgAy0AEEEBRw0AIAAQmQIMAwtBACECAkADQCAFKAIgIgYgBSgCHCIEa0EQTQ0BIAQgBhDXBCAFKAIgIgZBDGsiBCgCACEJIARBADYCACAGQRBrIgQoAgAhByAEQQA2AgAgBSAEEC8iBDYCICAFKAIcIAQQ1wQgBSgCICIGQQxrIgQoAgAhDCAEQQA2AgAgBkEQayIEKAIAIQYgBEEANgIAIAUgBBAvNgIgIAVBKGogBxAqIAUoAighBCAFIAYQKiAFQQhqIAQgBSgCACABIAMQ/QICQCAFKAIEIgZFDQAgBiAGKAIEIgRBAWs2AgQgBA0AIAYgBigCACgCCBEAACAGECQLAkAgBSgCLCIGRQ0AIAYgBigCBCIEQQFrNgIEIAQNACAGIAYoAgAoAggRAAAgBhAkCwJAAkAgBSgCFCIHIAUoAhgiBkkEQCAHIAUoAgg2AgAgBSgCDCEEIAcgDTcDCCAHIAQ2AgQgBSAHQRBqNgIUDAELIAcgBSgCECIEa0EEdSIHQQFqIghBgICAgAFPDQEgBUEoakH/////ACAGIARrIgZBA3UiBCAIIAQgCEsbIAZB8P///wdPGyAHIAVBEGoQMiEIIAUoAjAiBCAFKAIINgIAIAQgBSgCDDYCBCAFQgA3AgggBCANNwMIIAUgBEEQajYCMCAFKAIsIAUoAhQgBSgCECIEayIHayEGIAcEQCAGIAQgB/wKAAALIAUgBSgCECIHNgIsIAUgBjYCECAFKAIwIQYgBSAHNgIwIAUgBjYCFCAFKAIYIQQgBSAFKAI0NgIYIAUgBDYCNCAIIAc2AgAgCBCYAiAFIAY2AhQgBSgCDCIGRQ0AIAYgBigCBCIEQQFrNgIEIAQNACAGIAYoAgAoAggRAAAgBhAkCwJAIAxFDQAgDCAMKAIEIgRBAWs2AgQgBA0AIAwgDCgCACgCCBEAACAMECQLAkAgCUUNACAJIAkoAgQiBEEBazYCBCAEDQAgCSAJKAIAKAIIEQAAIAkQJAsgDUIBfCENIAJBAWoiAkEERw0BDAILCxAmAAsgBSgCECIEIAUoAhQiC0cEQANAIwBBIGsiDCQAAkACQAJAIAVBHGoiCSgCBCICIAkoAggiBkkEQCACIAQoAgA2AgAgAiAEKAIENgIEIARCADcDACACIAQpAwg3AwggAkEQaiEGDAELIAIgCSgCACICa0EEdSIHQQFqIghBgICAgAFPDQEgDEEMakH/////ACAGIAJrIgZBA3UiAiAIIAIgCEsbIAZB8P///wdPGyAHIAkQMiIIKAIIIgIgBCgCADYCACACIAQoAgQ2AgQgBEIANwMAIAIgBCkDCDcDCCAIIAJBEGo2AgggCCgCBCAJKAIEIAkoAgAiAmsiB2shBiAHBEAgBiACIAf8CgAACyAJKAIAIQcgCSAGNgIAIAggBzYCBCAJIAgoAggiBjYCBCAIIAc2AgggCSgCCCECIAkgCCgCDDYCCCAIIAc2AgAgCCACNgIMIAgQmAILIAkgBjYCBCAMQSBqJAAMAQsQJgALIAUoAhwiBiAFKAIgIgIgAiAGa0EEdRDWBCAEQRBqIgQgC0cNAAsgBSgCFCELIAUoAhAhBAsgBCALRwRAA0AgBCALQRBrEC8iC0cNAAsLIAUgBDYCFCAFKAIgIAUoAhwiCmtBEEsNAAsLIAAgCigCADYCACAAIAooAgQiADYCBCAARQ0AIAAgACgCBEEBajYCBAsgBSAFQRBqNgIoIAVBKGoiABDVBCAFIAVBHGo2AiggABDVBAsgBUFAayQAC4wCAgF/DXwgAQRAIAAoAgAiAyABQRhsaiEBIAArA0ghCCAAKwNAIQkgACsDOCEKIAArAzAhCyAAKwMoIQwgACsDICENIAArAxghDiAAKwMQIQ8gACsDCCEQA0AgAkQAAAAAAAAAACAOIAMrAwAiBKIgCyADKwMIIgWioCAIIAMrAxAiBqKgIgcgByAHoiAQIASiIA0gBaKgIAogBqKgIgcgB6IgDyAEoiAMIAWioCAJIAaioCIEIASioKCfIgWjIAcgBaMiBiAGYiIAGzkDECACRAAAAAAAAAAAIAQgBaMgABs5AwggAkQAAAAAAAAAACAGIAAbOQMAIAJBGGohAiADQRhqIgMgAUcNAAsLC5QBAQR/IAAoAgQiAyABQQF0SyADQRBLcQJAIAEgA00NACAAIAEQVSABIAAoAgQiA2siBEEATA0AIAAoAgAgA0EFdGohAwNAIAMgAikDGDcDGCADIAIpAxA3AxAgAyACKQMINwMIIAMgAikDADcDACADQSBqIQMgBEEBSyAEQQFrIQQNAAsLIAAgATYCBARAIAAQkwELC5ECAgJ/BnwjAEHQAGsiAyQAIAMgASsDADkDGCADIAErAwg5AyAgASsDECEFIANCgICAgICAgPg/NwMwIAMgBTkDKCADQThqIAIgA0EYaiIEEKEBIAMgASsDGDkDGCADIAErAyA5AyAgASsDKCEFIANCgICAgICAgPg/NwMwIAMgBTkDKCADIAIgBBChASADKwM4IQUgAysDACEGIAMrA0AhByADKwMIIQggACADKwMQIgkgAysDSCIKIAkgCmQiARs5AyggACAIIAcgByAIYyICGzkDICAAIAYgBSAFIAZjIgQbOQMYIAAgCiAJIAEbOQMQIAAgByAIIAIbOQMIIAAgBSAGIAQbOQMAIANB0ABqJAALdAECfyMAQRBrIgIkAEGgARAjIgNBgJQCNgIAIANCADcCBCACIAEoAgA2AgggAiABKAIENgIMIAFCADcCACACIAIpAgg3AwAgA0EQaiIBIAIQ/gIgACADNgIEIAAgATYCACAAIANBFGogARCPASACQRBqJAAL9AQCDn8GfCMAQYABayICJAAgASgCDCEDIAJCADcDICACQoCAgICAgID4PzcDGCACQgA3AyggAkIANwMwIAJCADcDQCACQoCAgICAgID4PzcDOCACQgA3A0ggAkIANwNQIAJCADcDYCACQoCAgICAgID4PzcDWCACQgA3A2ggAkIANwNwIAIgAUEYaiIHIAJBGGoQygECQCACKwMAIAIrAwhhBEAgACADQTD8CgAADAELIAIgASkDcDcDKCACIAEpA2g3AyAgAiABKQNgNwMYIAIgASkDcDcDECACIAEpA2g3AwggAiABKQNgNwMAIAFByABqIQggAUEwaiEJIANBGGohCgNAIAhBCEEQIAVBAUYbQQAgBRsiBGohCyAEIAdqIQwgBCAJaiENIAIgBGoiDisDACERIAJBGGogBGoiDysDACESQQAhAQNAIBECfwJAAkACQCABDgIAAQILIAwrAwAgAysDAKIhEEEAIQYgBwwCCyANKwMAIAMrAwiiIRBBCCEGIAkMAQsgCysDACADKwMQoiEQQRAhBiAICyAEaisDACAGIApqKwMAoiITIBAgECATYxugIREgEiATIBAgECATZBugIRIgAUEBaiIBQQNHDQALIA8gEjkDACAOIBE5AwAgBUEBaiIFQQNHDQALIAIrAwAhECACKwMYIREgAisDCCESIAIrAyAhEyAAIAIrAxAiFCACKwMoIhUgFCAVZCIBGzkDKCAAIBIgEyASIBNkIgMbOQMgIAAgECARIBAgEWQiBBs5AxggACAVIBQgARs5AxAgACATIBIgAxs5AwggACARIBAgBBs5AwALIAJBgAFqJAAL/AMCBX8MfCMAQfABayIDJAAgASsDGCEIIAErAyAhCSABKwMoIQogASsDMCELIAErAzghDCABKwNAIQ0gASsDSCEOIAErA1AhDyABKwNYIRAgASsDYCERIAErA2ghEiABKwNwIRMgA0KAgICAgICA+D83A3ggAyATOQNwIAMgEjkDaCADIBE5A2AgA0IANwNYIAMgEDkDUCADIA85A0ggAyAOOQNAIANCADcDOCADIA05AzAgAyAMOQMoIAMgCzkDICADQgA3AxggAyAKOQMQIAMgCTkDCCADIAg5AwAgA0GAAWoiBCACIAMQ8AEjAEHwAGsiAiQAQaABECMiBUGAlAI2AgAgBUIANwIEIAIgASgCDDYCaCACIAEoAhAiATYCbCABBEAgASABKAIEQQFqNgIECyADQeQBaiEGIAIgAikCaDcDYCACIARB4AD8CgAAIAVBEGoiAUIANwIEIAFBmJICNgIAIAEgAkHgAGoiBygCADYCDCABIAcoAgQiBDYCECAEBEAgBCAEKAIEQQFqNgIECyABQRhqIAJB4AD8CgAAIAFCADcDiAEgAUIANwOAASABQgA3A3ggBxAvGiAGIAU2AgQgBiABNgIAIAYgBUEUaiABEI8BIAJB8ABqJAAgACADKALkATYCACAAIAMoAugBNgIEIANB8AFqJAAL2QIBBH8jAEEwayIEJAAgBCADOgAbIARBADYCFCAEQgA3AgwgBEEEaiABQQRqEJsCIQMgBEEcakEBQQAgBEEMahBLIgEoAggiBSADKAIANgIAIAUgAygCBDYCBCADQgA3AgAgASAFQQhqNgIIIAEoAgQgBCgCECAEKAIMIgdrIgVrIQYgBQRAIAYgByAF/AoAAAsgBCgCDCEFIAQgBjYCDCABIAU2AgQgBCABKAIIIgY2AhAgASAFNgIIIAQoAhQhByAEIAEoAgw2AhQgASAFNgIAIAEgBzYCDCABEG4gAygCBCEBIAQgBjYCEAJAIAFFDQAgASABKAIEIgNBAWs2AgQgAw0AIAEgASgCACgCCBEAACABECQLIARBDGoiASACEP8CIARBHGoiAiABIARBG2oQgAMgACAEKAIcNgIAIAAgBCgCIDYCBCAEIAE2AhwgAhBlIARBMGokAAvgBgIDfwJ8AkACQAJAAkACQCACDgMEAgABCwJAIAFBGGsiAisDACIHIAArAwAiCGNFBEAgByAIYg0BIAFBDGsoAgAgACgCDE4NAQsgAyACKQMQNwMQIAMgAikDCDcDCCADIAIpAwA3AwAgAyAAKQMANwMYIAMgACkDCDcDICADIAApAxA3AygPCyADIAApAxA3AxAgAyAAKQMINwMIIAMgACkDADcDACADIAIpAwA3AxggAyACKQMINwMgIAMgAikDEDcDKA8LIAJBCEoNASAAIAFGDQIgAyAAKQMQNwMQIAMgACkDCDcDCCADIAApAwA3AwAgAEEYaiICIAFGDQIgAyEFA0AgACEGIAIhACAFIgJBGGohBQJ/IAYrAxgiByACKwMAIghjRQRAIAUiBCAHIAhiDQEaIAQgBigCJCACKAIMTg0BGgsgBSACKQMQNwMQIAUgAikDCDcDCCAFIAIpAwA3AwAgAyACIANGDQAaAkADQCAAKwMAIgcgAkEYayIEKwMAIghjRQRAIAcgCGINAiAGKAIkIAJBDGsoAgBODQILIAIgBCkDEDcDECACIAQpAwg3AwggAiAEKQMANwMAIAQiAiADRw0ACyADDAELIAILIgQgACkDEDcDECAEIAApAwg3AwggBCAAKQMANwMAIABBGGoiAiABRw0ACwwCCyADIAApAxA3AxAgAyAAKQMINwMIIAMgACkDADcDAAwBCyAAIAAgAkEBdiIFQRhsIgZqIgQgBSADIAUQywEgBCABIAIgBWsiAiADIAZqIAIQywEgBCECA0AgASACRgRAIAAgBEYNAgNAIAMgACkDEDcDECADIAApAwg3AwggAyAAKQMANwMAIANBGGohAyAAQRhqIgAgBEcNAAsMAgsCQAJAIAIrAwAiByAAKwMAIghjRQRAIAcgCGINASACKAIMIAAoAgxODQELIAMgAikDEDcDECADIAIpAwg3AwggAyACKQMANwMAIAJBGGohAgwBCyADIAApAxA3AxAgAyAAKQMINwMIIAMgACkDADcDACAAQRhqIQALIANBGGohAyAAIARHDQALIAEgAkYNAANAIAMgAikDEDcDECADIAIpAwg3AwggAyACKQMANwMAIANBGGohAyACQRhqIgIgAUcNAAsLC4sBAQV/IwBBEGsiA0KAgICAEDcCBCADQQI2AgwgACgCACgCACABQQxsaiEEIAAoAgQgAUECdGoiBSgCACEBIAAoAgwhBkEAIQADQCAFIAEgBiAEIANBBGogAGooAgBBAnRqKAIAQQJ0aigCACICIAJBH3UiAnMgAmtqIgE2AgAgAEEEaiIAQQxHDQALCwIAC7cCAQV/IwBBIGsiBSQAAkACQCAAKAIEIgIgACgCCCIDSQRAIAIgASkCCDcCCCACIAEpAgA3AgAgAkEQaiEBDAELIAIgACgCACIEa0EEdSIGQQFqIgJBgICAgAFPDQEgBUEMakH/////ACADIARrIgNBA3UiBCACIAIgBEkbIANB8P///wdPGyAGIAAQMiICKAIIIgMgASkCCDcCCCADIAEpAgA3AgAgAiACKAIIQRBqNgIIIAIoAgQgACgCBCAAKAIAIgNrIgFrIQQgAQRAIAQgAyAB/AoAAAsgACgCACEDIAAgBDYCACACIAM2AgQgACACKAIIIgE2AgQgAiADNgIIIAAoAgghBCAAIAIoAgw2AgggAiADNgIAIAIgBDYCDCACEDYLIAAgATYCBCAFQSBqJAAPCxAmAAt4AQN/AkAgACgCCCICRQRAQQAhAgwBCyAAKAIQIAFBBHRqKAIAIQEgAEEIaiIDIQADQCAAIAIgAigCECABSCIEGyEAIAJBBEEAIAQbaigCACICDQALQQAhAiAAIANGDQAgASAAKAIQSA0AIAAtAIEBIQILIAJBAXELkwMBBX8gACgCBCAAKAIAIgNrQQJ1IgQgAUkEQCMAQSBrIgYkAAJAAkACQCABIARrIgQgACgCCCIFIAAoAgQiA2tBAnVNBEAgACAEBH8gAyAEQQJ0aiEAIAIoAgAhAQNAIAMgATYCACADQQRqIgMgAEcNAAsgAAUgAws2AgQMAQsgAyAAKAIAIgNrQQJ1IgcgBGoiAUGAgICABE8NASAGQQxqQf////8DIAUgA2siA0EBdSIFIAEgASAFSRsgA0H8////B08bIAcgABBKIgEoAggiAyAEQQJ0aiEEIAIoAgAhAgNAIAMgAjYCACADQQRqIgMgBEcNAAsgASAENgIIIAEoAgQgACgCBCAAKAIAIgRrIgJrIQMgAgRAIAMgBCAC/AoAAAsgACgCACECIAAgAzYCACABIAI2AgQgACABKAIINgIEIAEgAjYCCCAAKAIIIQMgACABKAIMNgIIIAEgAjYCACABIAM2AgwgARBTCyAGQSBqJAAMAQsQJgALDwsgASAESQRAIAAgAyABQQJ0ajYCBAsL2wwCCn8OfCMAQfAAayIDJAAgACgCMCgCACABQQNsIgpBAnRqKAIAQQBOBEAgAEEsQSggACgCCCABQQR0aiIBKAIAIgIbaigCACABKAIIIQEgA0EoakEAQcgA/AsAIANBAjYCCCADQoCAgIAQNwIAKAIAIAFBDGxqIQUgAEEYQRAgAhtqKAIAIQZBACEBA0AgA0EoakEYQTAgASADaigCACICQQFGG0EAIAIbaiIEIAYgBSACQQJ0aigCAEEYbGoiAikDADcDACAEIAIpAwg3AwggBCACKQMQNwMQIAFBBGoiAUEMRw0ACyADQQI2AiQgA0KAgICAEDcCHEEAIQEDQCAAKAIgIAAoAjAoAgAgA0EcaiABaigCACAKaiILQQJ0aigCAEEYbGohBSAAKwM4IQ0jAEGQAWsiAiQAIANBKGoiBCsDICESIAQrAxghDiAEKwMoIRYgBCsDECEUIAQrA0AhDyAEKwMAIRcgBCsDMCEQIAIgBCsDCCIYIAQrAzgiE6EiDDkDaCACIBcgEKEiETkDYCACIBQgD6EiFTkDcCACIA8gFqEiDzkDWCACIBAgDqEiEDkDSCACIBMgEqEiEzkDUCACIBYgFKEiFjkDiAEgAiAOIBehIg45A3ggAiASIBihIhI5A4ABIAIgESARoiAMIAyioCAVIBWioCIUOQM4IAIgDiAOoiASIBKioCAWIBaioCISOQNAIAIgECAQoiATIBOioCAPIA+ioCIOOQMwIAJCADcDKCACQgA3AyAgAkIANwMYIAJBAjYCFCACQoCAgIAQNwIMIBAgDKIgEyARoqEiFiAWoiATIBWiIA8gDKKhIhMgE6IgDyARoiAQIBWioSIQIBCioKAhFyAOIBRkRSAOIBJkRXIhBiANIA2iIQwgBSsDECERIAUrAwghFSAFKwMAIQ9BACEFAkACQANAIA8gBEEYQTAgAkEMaiAFaigCACIIQQFGG0EAIAgbaiIHKwMAoSINIA2iIBUgBysDCKEiDSANoqAgESAHKwMQoSINIA2ioCAMY0UEQCAFQQRqIgVBDEcNAQwCCwsgAkEYakEIQRAgCEEBRhtBACAIG2pCgICAgICAgPg/NwMAIAMgAikDKDcDECADIAIpAyA3AwggAyACKQMYNwMADAELIAxBCEEQIAYgEiAUY3EiCBtBACAGGyIJIAJBMGpqKwMAIg1kBEAgA0IANwMIIANCgICAgICAgPg/NwMAIANCADcDEAwBCyAMIA2iIBdjBEAgAkECNgIUIAJCgICAgBA3AgxBACEFA0BEAAAAAAAAAAAhDSAVIARBGEEwQQRBCCACQQxqIAVqKAIAIgZBAUYiCBtBACAGG0GM8wBqKAIAIgdBAUYbQQAgBxtqIgcrAwihIg4gAkHIAGpBGEEwIAgbQQAgBhtqIgkrAwAiFKIgDyAHKwMAoSIXIAkrAwgiGKKhIhIgEqIgGCARIAcrAxChIhiiIA4gCSsDECIZoqEiDiAOoiAXIBmiIBggFKKhIhQgFKKgoCAMQQhBECAIG0EAIAYbIgYgAkEwamorAwCiY0UEQCAWIBKiIBMgDqJEAAAAAAAAAACgIBAgFKKgoCENCyACQRhqIAZqIA05AwAgBUEEaiIFQQxHDQALIAIgAisDGCIMIAwgAisDICIRoCACKwMoIhWgIgyjIg85AxggAiARIAyjIhE5AyAgAiAVIAyjIgw5AyggAyAMOQMQIAMgETkDCCADIA85AwAMAQsgBEEYQTBBBEEIIAgbQQAgBhtBjPMAaigCACIFQQFGIgcbQQAgBRtqIgQrAxAhDCAEKwMAIRAgBCsDCCETIAkgAkEYaiIEakIANwMAQQhBECAHG0EAIAUbIARqRAAAAAAAAPA/IA8gEKEgAkHIAGpBGEEwIAgbQQAgBhtqIgYrAwCiRAAAAAAAAAAAoCAVIBOhIAYrAwiioCARIAyhIAYrAxCioCANoyIMoTkDACAEQQhBEEEEQQggBxtBACAFG0GM8wBqKAIAIgRBAUYbQQAgBBtqIAw5AwAgAyACKQMoNwMQIAMgAikDIDcDCCADIAIpAxg3AwALIAJBkAFqJAAgACgCACALQRhsaiICIAMpAxA3AxAgAiADKQMINwMIIAIgAykDADcDACABQQRqIgFBDEcNAAsLIANB8ABqJAAL3AMBD38CQCAAKAIYIAFqLQAARQ0AIAFBAnQiBiAAKAIgIgMoAgBqIgIoAgAiBCACQXhBBCABIAFBA20iCkEDbGtBAkYbaigCACIFTg0AIAAoAiQgBEECdGooAgAiAkUNACACIAJBH3UiB3MgB2shDCAALQA8QQFzIQcgBiADKAIgIghqKAIAIQ0gACgCLCIJIAQgBSACQQBIIgIbQQJ0aigCACEBIAkgBSAEIAIbQQJ0aigCACEEIAggAygCECAGaigCACICQQJ0aigCACEIIAAoAjQiAyAKQQJ0aigCAEECdCEGIAMgAkEDbSIJQQJ0aigCAEECdCEOA0AgACgCECAGaiICIAIoAgAiA0EBajYCACAAKAIQIA5qIgIgAigCACIFQQFqNgIAIAAoAgAiDyADQQR0IhBqIgIgDTYCDCACIAU2AgggAiABNgIEIAIgBDYCACAPIAVBBHQiBWoiAiAINgIMIAIgAzYCCCACIAQ2AgQgAiABNgIAIAAoAggiAyAQaiICQX82AgwgAiAKNgIIIAJBfzYCBCACIAc2AgAgAyAFaiICQX82AgwgAiAJNgIIIAJBfzYCBCACIAc2AgAgAUEBaiEBIARBAWohBCALQQFqIgsgDEcNAAsLC8cCAQV/IwBBIGsiBiQAAkACQCAAKAIEIgIgACgCCCIDSQRAIAIgASkDEDcDECACIAEpAwg3AwggAiABKQMANwMAIAJBGGohAQwBCyACIAAoAgAiBGtBGG0iBUEBaiICQavVqtUATw0BIAZBDGpBqtWq1QAgAyAEa0EYbSIDQQF0IgQgAiACIARJGyADQdWq1SpPGyAFIAAQZCICKAIIIgMgASkDEDcDECADIAEpAwg3AwggAyABKQMANwMAIAIoAgQgACgCBCAAKAIAIgRrIgFBaG1BGGxqIQUgAQRAIAUgBCAB/AoAAAsgACgCACEEIAAgBTYCACACIAQ2AgQgACADQRhqIgE2AgQgAiAENgIIIAAoAgghAyAAIAIoAgw2AgggAiAENgIAIAIgAzYCDCACEIwBCyAAIAE2AgQgBkEgaiQADwsQJgALkwEBA38gACgCGCgCACABQQN0aiICKAIEIQMgACgCCCACKAIAQQJ0aiICIAAoAhAgAUECdGooAgAiASABQR91IgFzIAFrIgEgAigCAGo2AgAgACgCACICIANBA21BAnRqIgQgBCgCACABajYCACACIAAoAhwoAhAgA0ECdGooAgBBA21BAnRqIgAgACgCACABajYCAAuTAQEDfyAAKAIYKAIAIAFBA3RqIgIoAgAhAyAAKAIIIAIoAgRBAnRqIgIgACgCECABQQJ0aigCACIBIAFBH3UiAXMgAWsiASACKAIAajYCACAAKAIAIgIgA0EDbUECdGoiBCAEKAIAIAFqNgIAIAIgACgCHCgCECADQQJ0aigCAEEDbUECdGoiACAAKAIAIAFqNgIAC6gBAQN/IwBBIGsiAyQAAkAgAQRAIAEtABAgAEVyDQEDQCAFQQFqIgVBgAhGBEBBACEFIAEtABANAwsgAiAEEOEEIARBAWoiBCAARw0ACwwBCyADIAIoAgA2AgwgAyACKAIENgIQIAMgAigCCDYCFCADIAIoAgw2AhggAyACKAIQNgIcIABFDQADQCADQQxqIAQQ4QQgBEEBaiIEIABHDQALCyADQSBqJAAL7gECBX8BfgJAAkAgACgCBCICRQRAIABBBGoiBCEDDAELIAEoAgQhBSABKAIAIQYDQAJAAkAgAiIDKAIQIgQgBkwEQCAEIAZIDQIgBSACKAIUIgJODQELIAMhBCADKAIAIgINAgwDCyACIAVIDQAgAyECDAMLIAMoAgQiAg0ACyADQQRqIQQLQSQQIyECIAEpAgAhByACQQA2AiAgAkIANwIYIAIgBzcCECACIAM2AgggAkIANwIAIAQgAjYCACAAKAIAKAIAIgEEQCAAIAE2AgALIAAoAgQgAhCnASAAIAAoAghBAWo2AggLIAJBGGoL1wMBCX8jAEGAAWsiCiQAIAMoAlwhCyABKAIAIQwgASgCBCEBIAIoAgAhDSACKAIEIQIgACgCACEOIAAoAgQhACAEKAIAIQ8gBCgCBCEEIAUoAgAhECAFKAIEIQUgBigCACERIAYoAgQhBiAHKAIAIRIgBygCBCEHIAogCDoAPCAKIAc2AjggCiASNgI0IAogBjYCMCAKIBE2AiwgCiAFNgIoIAogEDYCJCAKIANB2ABqIgM2AiAgCiAENgIcIAogDzYCGCAKIAA2AhQgCiAONgIQIAogAjYCDCAKIA02AgggCiABNgIEIAogDDYCAAJAIAkEQCALRQ0BIAktABBBAXENAUEAIQFBACEDA0AgAUEBaiIBQYAIRgRAQQAhASAJLQAQDQMLIAogAxDnBCADQQFqIgMgC0cNAAsMAQsgCiAIOgB8IAogBzYCeCAKIBI2AnQgCiAGNgJwIAogETYCbCAKIAU2AmggCiAQNgJkIAogAzYCYCAKIAQ2AlwgCiAPNgJYIAogADYCVCAKIA42AlAgCiACNgJMIAogDTYCSCAKIAE2AkQgCiAMNgJAIAtFDQBBACEDA0AgCkFAayADEOcEIANBAWoiAyALRw0ACwsgCkGAAWokAAuYCwIRfwZ8IwBBQGoiDSQAAkAgBCgCACIQIARBBGoiGkYNACAKQQFzIRUDQCALBEAgCy0AEA0CCyAQKAIQIQRBACEMIA1BADYCJCANQgA3AhxBACEKAkACQAJAIBAoAhgiDiAQKAIUIg9HBEAgDiAPayIOQRhtQavVqtUATw0BIA0gDhAjIgo2AiAgDSAKNgIcIA0gCiAOaiIMNgIkIA4EQCAKIA8gDvwKAAALIA0gDDYCIAsgCiAMEMwBIARBAnQiCiAGKAJoaigCACERIAIoAgAgBGpBADoAACARIAIoAgBqQQA6AAAgBigCSCIMIAYoAlggCmoiCkF4QQQgBCAEQQNtIhZBA2xrQQJGG2ooAgAiE0EYbGoiBCsDECAMIAooAgAiDkEYbGoiCisDEKEhHSAEKwMIIAorAwihIR4gBCsDACAKKwMAoSEfIAAoAkghDCANKAIcIgQgDSgCICIPRw0BDAILECYACwNAIAQgHyAMIAQoAghBGGxqIgorAwCiRAAAAAAAAAAAoCAeIAorAwiioCAdIAorAxCioDkDACAEQRhqIgQgD0cNAAsLIAwgCCgCACIPIA5BAnQiDmooAgAiBEEYbGoiCisDECEgIAorAwAhISAKKwMIISJBACEKIA0gBygCACISIA5qKAIAIg5BAEo6ABAgDUH/////BzYCDCANIAQ2AgggDSAfICGiRAAAAAAAAAAAoCAeICKioCAdICCioDkDACAOBEAgDiAOQR91IgxzIAxrIQwDQCANQRxqIA0Q6AQgDSAEQQFqIgQ2AgggCkEBaiIKIAxHDQALIAgoAgAhDyAHKAIAIRIgACgCSCEMCyAMIA8gE0ECdCIOaigCACIEQRhsaiIKKwMQISAgCisDACEhIAorAwghIiANIA4gEmooAgAiCkEfdjoAECANQf////8HNgIMIA0gBDYCCCANIB8gIaJEAAAAAAAAAACgIB4gIqKgIB0gIKKgOQMAIAoEQCAKIApBH3UiDHMgDGshDEEAIQoDQCANQRxqIA0Q6AQgDSAEQQFqIgQ2AgggCkEBaiIKIAxHDQALCyANKAIgIgogDSgCHCIOa0EYbUEBdiEPIAkgFkECdGooAgAhEiAJIBFBA20iG0ECdGooAgAhESAOIgQhDAJAIAQgCkYNAANAIAQtABBBAXFFBEAgCiEMA0AgDEEYayIKIARGBEAgBCEMDAQLIAxBCGsgCiEMLQAAQQFxRQ0ACyANIAQpAxA3AzggDSAEKQMINwMwIA0gBCkDADcDKCAEIAopAxA3AxAgBCAKKQMINwMIIAQgCikDADcDACAKIA0pAzg3AxAgCiANKQMwNwMIIAogDSkDKDcDACAEQRhqIgQgCkcNAQwCCyAEQRhqIgQgCkcNAAsgCiEMCyAOIAwQzAEgDCANKAIgEMwBIA0oAhwhBAJAAkAgDwRAIAMoAgAiCiARQQJ0aiEOIAogEkECdGohESAFKAIAIRIgASgCACETQQAhCgNAIAQgCkEYbGoiDCAPQRhsaigCCCEXIAwoAgghGCARIBEoAgAiGUEBajYCACAOIA4oAgAiFEEBajYCACATIBlBBHQiHGoiDEEANgIMIAwgFDYCCCAMIBc2AgQgDCAYNgIAIBIgHGoiDEF/NgIMIAwgFjYCCCAMQX82AgQgDCAVNgIAIBMgFEEEdCIUaiIMQQA2AgwgDCAZNgIIIAwgGDYCBCAMIBc2AgAgEiAUaiIMQX82AgwgDCAbNgIIIAxBfzYCBCAMIBU2AgAgCkEBaiIKIA9HDQALDAELIARFDQELIA0gBDYCICANKAIkGiAEECILAkAgECgCBCIEBEADQCAEIhAoAgAiBA0ADAILAAsDQCAQIBAoAggiECgCAEcNAAsLIBAgGkcNAAsLIA1BQGskAAv1CAETfyMAQYABayIKJAACQAJAIAgEQCAILQAQDQELIAIoAgRFDQAgAEEEaiEWIAZBAnQhFyAGQQFzQQJ0IRgDQCAIBEAgCC0AEA0CCyAKQZCRAjYCICAKQdiRAjYCCCAKIApBIGo2AjAgCiAKQQhqNgIYIBNBAnQiCSADKAIAaigCACEUIAQoAgAgCWooAgAhGSAFKAIQIAIoAgAgE0EDdGoiCSAYaigCACIPQQJ0aigCACELIAogCSAXaigCACIRNgJoIAogC0EDbSINNgJkAn8gBgRAIBEhEiAPQQNtDAELIAogDTYCaCAKIBE2AmQgD0EDbSESIBELIQwgCiASNgJgIAogDDYCXCAUQR92IQ4CQAJAIBYiECILKAIAIglFDQADQCAJIgsoAhAiECAPSgRAIAkhECAJKAIAIgkNAQwCCyAPIBBMBEAMAwsgCygCBCIJDQALIAtBBGohEAtBIBAjIglBADYCHCAJQgA3AhQgCSAPNgIQIAkgCzYCCCAJQgA3AgAgECAJNgIAIAAoAgAoAgAiCwRAIAAgCzYCAAsgACgCBCAJEKcBIAAgACgCCEEBajYCCAsgCiAPNgI8IAogCUEUajYCQCAKIA46ADggCiABIApB5ABqEOwENgJMIAogDSARczYCSCAKIAYgDkY6AEQgCiABIApB3ABqEOwENgJYIAogDCASczYCVCAKIAYgDkc6AFAgFCAUQR91IglzIAlrIRogByATaiESQQAhEQNAIAogCkE4aiARaiIJKAIEIhs2AmwgCigCMCILRQ0DIAsgCkHsAGogCygCACgCGBEBAAJAIBRFDQAgCS0AACEPIAkoAggiCygCBCEJQQAhEANAAkAgECAZaiEMAkAgCygCCCIOIAlLBEAgCSAPOgAQIAkgEjYCDCAJIAw2AgggCUIANwMAIAlBGGohCQwBCyAJIAsoAgAiDWtBGG0iFUEBaiIJQavVqtUATw0BIApB7ABqQarVqtUAIA4gDWtBGG0iDkEBdCINIAkgCSANSRsgDkHVqtUqTxsgFSALEGQhDiAKKAJ0IgkgDzoAECAJIBI2AgwgCSAMNgIIIAlCADcDACAKKAJwIAsoAgQgCygCACIVayIMQWhtQRhsaiENIAwEQCANIBUgDPwKAAALIAsoAgAhDCALIA02AgAgCiAMNgJwIAsgCUEYaiIJNgIEIAogDDYCdCALKAIIIQ0gCyAKKAJ4NgIIIAogDTYCeCAOIAw2AgAgDhCMAQsgCyAJNgIEIBBBAWoiECAaRw0BDAILCxAmAAsgCiAbNgJsIAooAhgiCUUNAyAJIApB7ABqIAkoAgAoAhgRAQAgEUEMaiIRQSRHDQALAkAgCigCGCILIApBCGpGBH9BEAUgC0UNAUEUCyEJIAsgCygCACAJaigCABEAAAsCQCAKKAIwIgsgCkEgakYEf0EQBSALRQ0BQRQLIQkgCyALKAIAIAlqKAIAEQAACyATQQFqIhMgAigCBEkNAAsLIApBgAFqJAAPCxBmAAvjCQMFfwN8AX4jAEFAaiICJABBASEFAkACQAJAAkACQAJAIAEgAGtBBnUOBgUFAAECAwQLIAFBOGsrAwAgACsDCGNFDQQgAiAAQcAA/AoAACAAIAFBQGoiAEHAAPwKAAAgACACQcAA/AoAAAwECyABQUBqIQMgAEFAayEEIAFBOGsiASsDACEIIAArA0giByAAKwMIY0UEQCAHIAhkRQ0EIAIgBEHAAPwKAAAgBCADQcAA/AoAACADIAJBwAD8CgAAIAArA0ggACsDCGNFDQQgAiAAQcAA/AoAACAAIARBwAD8CgAAIAQgAkHAAPwKAAAMBAsgByAIZARAIAIgAEHAAPwKAAAgACADQcAA/AoAACADIAJBwAD8CgAADAQLIAIgAEHAAPwKAAAgACAEQcAA/AoAACAEIAJBwAD8CgAAIAErAwAgACsDSGNFDQMgAiAEQcAA/AoAACAEIANBwAD8CgAAIAMgAkHAAPwKAAAMAwsgAEGAAWohAyAAQUBrIQQgACsDiAEhCQJAIAArA0giCCAAKwMIIgdjRQRAIAggCWRFDQEgAiAEQcAA/AoAACAEIANBwAD8CgAAIAMgAkHAAPwKAAAgACsDSCAHY0UNASACIABBwAD8CgAAIAAgBEHAAPwKAAAgBCACQcAA/AoAAAwBCyAIIAlkBEAgAiAAQcAA/AoAACAAIANBwAD8CgAAIAMgAkHAAPwKAAAMAQsgAiAAQcAA/AoAACAAIARBwAD8CgAAIAQgAkHAAPwKAAAgCSAAKwNIY0UNACACIARBwAD8CgAAIAQgA0HAAPwKAAAgAyACQcAA/AoAAAsgAUE4aysDACAAKwOIAWNFDQIgAiADQcAA/AoAACADIAFBQGoiAUHAAPwKAAAgASACQcAA/AoAACAAKwOIASAAKwNIY0UNAiACIARBwAD8CgAAIAQgA0HAAPwKAAAgAyACQcAA/AoAACAAKwNIIAArAwhjRQ0CIAIgAEHAAPwKAAAgACAEQcAA/AoAACAEIAJBwAD8CgAADAILIAAgAEFAayAAQYABaiAAQcABaiABQUBqEPEEDAELIABBQGshAyAAQYABaiEEIAArA4gBIQkCQCAAKwNIIgggACsDCCIHY0UEQCAIIAlkRQ0BIAIgA0HAAPwKAAAgAyAEQcAA/AoAACAEIAJBwAD8CgAAIAArA0ggB2NFDQEgAiAAQcAA/AoAACAAIANBwAD8CgAAIAMgAkHAAPwKAAAMAQsgCCAJZARAIAIgAEHAAPwKAAAgACAEQcAA/AoAACAEIAJBwAD8CgAADAELIAIgAEHAAPwKAAAgACADQcAA/AoAACADIAJBwAD8CgAAIAkgACsDSGNFDQAgAiADQcAA/AoAACADIARBwAD8CgAAIAQgAkHAAPwKAAALIABBwAFqIgMgAUYNAANAAkAgAysDCCIHIAQrAwhjRQ0AIAMpAwAhCiACIANBEGpBMPwKAAAgAyEFA0ACQCAFIAQiBUHAAPwKAAAgACAERgRAIAAhBQwBCyAFQUBqIQQgByAFQThrKwMAYw0BCwsgBSAHOQMIIAUgCjcDACAFQRBqIAJBMPwKAAAgBkEBaiIGQQhHDQAgA0FAayABRiEFDAILIAMiBEFAayIFIQMgASAFRw0AC0EBIQULIAJBQGskACAFC8wEAgF/AnwjAEFAaiEFIAIrAwghBgJAIAErAwgiByAAKwMIY0UEQCAGIAdjRQ0BIAUgAUHAAPwKAAAgASACQcAA/AoAACACIAVBwAD8CgAAIAErAwggACsDCGNFDQEgBSAAQcAA/AoAACAAIAFBwAD8CgAAIAEgBUHAAPwKAAAMAQsgBiAHYwRAIAUgAEHAAPwKAAAgACACQcAA/AoAACACIAVBwAD8CgAADAELIAUgAEHAAPwKAAAgACABQcAA/AoAACABIAVBwAD8CgAAIAIrAwggASsDCGNFDQAgBSABQcAA/AoAACABIAJBwAD8CgAAIAIgBUHAAPwKAAALAkAgAysDCCACKwMIY0UNACAFIAJBwAD8CgAAIAIgA0HAAPwKAAAgAyAFQcAA/AoAACACKwMIIAErAwhjRQ0AIAUgAUHAAPwKAAAgASACQcAA/AoAACACIAVBwAD8CgAAIAErAwggACsDCGNFDQAgBSAAQcAA/AoAACAAIAFBwAD8CgAAIAEgBUHAAPwKAAALAkAgBCsDCCADKwMIY0UNACAFIANBwAD8CgAAIAMgBEHAAPwKAAAgBCAFQcAA/AoAACADKwMIIAIrAwhjRQ0AIAUgAkHAAPwKAAAgAiADQcAA/AoAACADIAVBwAD8CgAAIAIrAwggASsDCGNFDQAgBSABQcAA/AoAACABIAJBwAD8CgAAIAIgBUHAAPwKAAAgASsDCCAAKwMIY0UNACAFIABBwAD8CgAAIAAgAUHAAPwKAAAgASAFQcAA/AoAAAsLwwYBCX8CQAJAAkACQAJAIAMOAwQCAAELAkAgAigCACgCACIDIAFBBGsiASgCACIGQQN0aiIHIAIoAgQoAgAiAkECdCIFaigCACILIAUgAyAAKAIAIgVBA3RqIgNqKAIAIglOBEAgCSALRw0BIAdBASACa0ECdCICaigCACACIANqKAIATg0BCyAEIAY2AgAgBCAAKAIANgIEDwsgBCAFNgIAIAQgASgCADYCBA8LIANBCEoNASAAIAFGDQIgBCAAKAIANgIAIABBBGoiBiABRg0CQQEgAigCBCgCACIAayELIAIoAgAoAgAhByAAQQJ0IQUgBCEAA0AgAEEEaiECAkACfwJAAkAgByAGKAIAIgNBA3RqIgkgBWooAgAiCCAHIAAoAgAiCkEDdGoiDCAFaigCACINTgRAIAggDUcNASAJIAtBAnQiCGooAgAgCCAMaigCAE4NAQsgACAKNgIEIAQgACAERg0CGgNAIAcgBigCAEEDdGoiCSAFaigCACIIIAcgAEEEayIDKAIAIgpBA3RqIgwgBWooAgAiDU4EQCAIIA1HDQMgCSALQQJ0IghqKAIAIAggDGooAgBODQMLIAAgCjYCACADIgAgBEcNAAsgBAwCCyACIAM2AgAMAgsgAAsgBigCADYCAAsgAiEAIAZBBGoiBiABRw0ACwwCCyAEIAAoAgA2AgAMAQsgACAAIANBAXYiB0ECdCIFaiIGIAIgByAEIAcQ0AEgBiABIAIgAyAHayIDIAQgBWogAxDQASACKAIEIQcgAigCACECIAYhAwNAIAEgA0YEQCAAIAZGDQIDQCAEIAAoAgA2AgAgBEEEaiEEIABBBGoiACAGRw0ACwwCCwJAAkAgAigCACIFIAMoAgAiC0EDdGoiCSAHKAIAIghBAnQiCmooAgAiDCAKIAUgACgCACIKQQN0aiIFaigCACINTgRAIAwgDUcNASAJQQEgCGtBAnQiCGooAgAgBSAIaigCAE4NAQsgBCALNgIAIANBBGohAwwBCyAEIAo2AgAgAEEEaiEACyAEQQRqIQQgACAGRw0ACyABIANGDQADQCAEIAMoAgA2AgAgBEEEaiEEIANBBGoiAyABRw0ACwsLpwsDD38DfAN+IwBB0AFrIgUkAAJAIAAoAgQgAkEwbGoiBysDACABKwMYZUUNACAHKwMIIAErAyBlRQ0AIAcrAxAgASsDKGVFDQAgBysDGCABKwMAZkUNACAHKwMgIAErAwhmRQ0AIAcrAyggASsDEGZFDQACQCACQQFxDQAgACgCFCgCACEKIAVBoAFqQQBBMPwLACAFQfAAakEAQTD8CwAgCigCACIRKAJYIANBAnRqIgBBeEEEIANBA29BAkYbaigCACEQIAAoAgAhDCAKKAIEIQAgBUECNgIQIAVCgICAgBA3AgggACgCWCINIAJBAXUiDiACaiIPQQJ0aiESIAAoAmghEwNAQQEhAAJAIA0gBUEIaiAIaigCACIJIA9qIgtBAnQiB2ooAgAiBiASQQRBCCAJQQFGG0EAIAkbQYzpAGooAgBBAnRqKAIAIgFIBEAgBiEHIAEhBgwBCyAHIBNqKAIAIQtBACEAIAEhBwsgBUFAayAJQQR0aiIBIAA6AAwgASAGNgIIIAEgBzYCBCABIAs2AgAgCEEEaiIIQQxHDQALIAUgEDYCOCAFIAw2AjQgCkEIaiENQQAhCEEAIQdBACEBQQAhAANAIAVBCGogDSAFQTRqIAFqKAIAIgsgDiAFQUBrEIYDAkAgBSsDECIUvUL///////////8Ag0L/////////9/8AVg0AQQAgBSgCCCIJayAJIAsgDEYbIABqIQAgCEEBSgRAQQIhCAwBCyAIRSAHIAlFc0EBcUVyRQRAQQEhCAwBCyAIQRhsIg8gBUGgAWpqIgYgESgCSCALQRhsaiIHKQMQIhg3AxAgBiAHKQMIIhc3AwggBiAHKQMAIhk3AwAgBiAXNwMQIAYgGDcDCCAFQfAAaiAPaiIGIBc3AxAgBiAZNwMAIAYgFDkDCCAIQQFqIQggCUEARyEHCyABQQRqIgFBCEcNAAsgBUECNgI8IAVCgICAgBA3AjQgCkEQaiEJQQAhBgNAIAVBCGogCSAFQUBrIAVBNGogBmooAgBBBHRqIgEoAgAgASgCBCABKAIIIAMgDCAQEPcEAkAgBSsDECIUvUL///////////8Ag0L/////////9/8AVg0AQQAgBSgCCCIKayAKIAEtAAwbIABqIQAgCEEBSgRAQQIhCAwBCyAIRSAHIApFc0EBcUVyRQRAQQEhCAwBCyAIQRhsIgcgBUGgAWpqIgEgFDkDACABIAUrAyAiFTkDCCABIAUrAxgiFjkDECAFQfAAaiAHaiIHIBY5AxAgByAVOQMIIAcgFDkDACABIAUrAyg5AwggByAVOQMIIAhBAWohCCAKQQBHIQcLIAZBBGoiBkEMRw0ACwJ8IABFBEBEAAAAAAAA+H8hFUQAAAAAAAD4fyEWRAAAAAAAAPh/DAELIAVBCGogBUGgAWogBUG4AWogBUHwAGogBUGIAWoQzgEgBSsDECEWIAUrAxghFSAFKwMICyIUvUL///////////8Ag0L/////////9/8AVg0AAkAgBCgCBCIBIAQoAggiBk8EQCAEIAZBAXRBgAEgBhsQRCAEIAQoAgQiAUEBajYCBAwBCyAEIAFBAWo2AgQLIAQoAgAgAUEDdGogDq0gA61CIIaENwIAIARBEGohAwJAIAQoAhQiASAEKAIYIgZPBEAgAyAGQQF0QYABIAYbECUgBCgCECAEKAIUIgFBAnRqIAA2AgAMAQsgAygCACABQQJ0aiAANgIACyAEIAFBAWo2AhQgBEEgaiEAAn8gBCgCJCIIIAQoAigiAU8EQCAAIAFBAXRBgAEgARsQMyAEKAIgIAQoAiQiCEEYbGoMAQsgACgCACAIQRhsagsiASAUOQMAIAQgCEEBajYCJCABIBY5AxAgASAVOQMICyACQYGAgIB4cUEBRiEGCyAFQdABaiQAIAYLwwYBCX8CQAJAAkACQAJAIAMOAwQCAAELAkAgAigCACgCACIDIAFBBGsiASgCACIGQQN0aiIHIAIoAgQoAgAiAkECdCIFaigCACILIAUgAyAAKAIAIgVBA3RqIgNqKAIAIglOBEAgCSALRw0BIAdBASACa0ECdCICaigCACACIANqKAIATg0BCyAEIAY2AgAgBCAAKAIANgIEDwsgBCAFNgIAIAQgASgCADYCBA8LIANBCEoNASAAIAFGDQIgBCAAKAIANgIAIABBBGoiBiABRg0CQQEgAigCBCgCACIAayELIAIoAgAoAgAhByAAQQJ0IQUgBCEAA0AgAEEEaiECAkACfwJAAkAgByAGKAIAIgNBA3RqIgkgBWooAgAiCCAHIAAoAgAiCkEDdGoiDCAFaigCACINTgRAIAggDUcNASAJIAtBAnQiCGooAgAgCCAMaigCAE4NAQsgACAKNgIEIAQgACAERg0CGgNAIAcgBigCAEEDdGoiCSAFaigCACIIIAcgAEEEayIDKAIAIgpBA3RqIgwgBWooAgAiDU4EQCAIIA1HDQMgCSALQQJ0IghqKAIAIAggDGooAgBODQMLIAAgCjYCACADIgAgBEcNAAsgBAwCCyACIAM2AgAMAgsgAAsgBigCADYCAAsgAiEAIAZBBGoiBiABRw0ACwwCCyAEIAAoAgA2AgAMAQsgACAAIANBAXYiB0ECdCIFaiIGIAIgByAEIAcQ0QEgBiABIAIgAyAHayIDIAQgBWogAxDRASACKAIEIQcgAigCACECIAYhAwNAIAEgA0YEQCAAIAZGDQIDQCAEIAAoAgA2AgAgBEEEaiEEIABBBGoiACAGRw0ACwwCCwJAAkAgAigCACIFIAMoAgAiC0EDdGoiCSAHKAIAIghBAnQiCmooAgAiDCAKIAUgACgCACIKQQN0aiIFaigCACINTgRAIAwgDUcNASAJQQEgCGtBAnQiCGooAgAgBSAIaigCAE4NAQsgBCALNgIAIANBBGohAwwBCyAEIAo2AgAgAEEEaiEACyAEQQRqIQQgACAGRw0ACyABIANGDQADQCAEIAMoAgA2AgAgBEEEaiEEIANBBGoiAyABRw0ACwsLpwsDD38DfAN+IwBB0AFrIgUkAAJAIAAoAgQgAkEwbGoiBysDACABKwMYZUUNACAHKwMIIAErAyBlRQ0AIAcrAxAgASsDKGVFDQAgBysDGCABKwMAZkUNACAHKwMgIAErAwhmRQ0AIAcrAyggASsDEGZFDQACQCACQQFxDQAgACgCFCgCACEKIAVBoAFqQQBBMPwLACAFQfAAakEAQTD8CwAgCigCACIRKAJYIANBAnRqIgBBeEEEIANBA29BAkYbaigCACEQIAAoAgAhDCAKKAIEIQAgBUECNgIQIAVCgICAgBA3AgggACgCWCINIAJBAXUiDiACaiIPQQJ0aiESIAAoAmghEwNAQQEhAAJAIA0gBUEIaiAIaigCACIJIA9qIgtBAnQiB2ooAgAiBiASQQRBCCAJQQFGG0EAIAkbQYzpAGooAgBBAnRqKAIAIgFIBEAgBiEHIAEhBgwBCyAHIBNqKAIAIQtBACEAIAEhBwsgBUFAayAJQQR0aiIBIAA6AAwgASAGNgIIIAEgBzYCBCABIAs2AgAgCEEEaiIIQQxHDQALIAUgEDYCOCAFIAw2AjQgCkEIaiENQQAhCEEAIQdBACEBQQAhAANAIAVBCGogDSAFQTRqIAFqKAIAIgsgDiAFQUBrEIgDAkAgBSsDECIUvUL///////////8Ag0L/////////9/8AVg0AQQAgBSgCCCIJayAJIAsgDEYbIABqIQAgCEEBSgRAQQIhCAwBCyAIRSAHIAlFc0EBcUVyRQRAQQEhCAwBCyAIQRhsIg8gBUGgAWpqIgYgESgCSCALQRhsaiIHKQMQIhg3AxAgBiAHKQMIIhc3AwggBiAHKQMAIhk3AwAgBiAXNwMQIAYgGDcDCCAFQfAAaiAPaiIGIBc3AxAgBiAZNwMAIAYgFDkDCCAIQQFqIQggCUEARyEHCyABQQRqIgFBCEcNAAsgBUECNgI8IAVCgICAgBA3AjQgCkEQaiEJQQAhBgNAIAVBCGogCSAFQUBrIAVBNGogBmooAgBBBHRqIgEoAgAgASgCBCABKAIIIAMgDCAQEPoEAkAgBSsDECIUvUL///////////8Ag0L/////////9/8AVg0AQQAgBSgCCCIKayAKIAEtAAwbIABqIQAgCEEBSgRAQQIhCAwBCyAIRSAHIApFc0EBcUVyRQRAQQEhCAwBCyAIQRhsIgcgBUGgAWpqIgEgFDkDACABIAUrAyAiFTkDCCABIAUrAxgiFjkDECAFQfAAaiAHaiIHIBY5AxAgByAVOQMIIAcgFDkDACABIAUrAyg5AwggByAVOQMIIAhBAWohCCAKQQBHIQcLIAZBBGoiBkEMRw0ACwJ8IABFBEBEAAAAAAAA+H8hFUQAAAAAAAD4fyEWRAAAAAAAAPh/DAELIAVBCGogBUGgAWogBUG4AWogBUHwAGogBUGIAWoQzgEgBSsDECEWIAUrAxghFSAFKwMICyIUvUL///////////8Ag0L/////////9/8AVg0AAkAgBCgCBCIBIAQoAggiBk8EQCAEIAZBAXRBgAEgBhsQRCAEIAQoAgQiAUEBajYCBAwBCyAEIAFBAWo2AgQLIAQoAgAgAUEDdGogDq0gA61CIIaENwIAIARBEGohAwJAIAQoAhQiASAEKAIYIgZPBEAgAyAGQQF0QYABIAYbECUgBCgCECAEKAIUIgFBAnRqIAA2AgAMAQsgAygCACABQQJ0aiAANgIACyAEIAFBAWo2AhQgBEEgaiEAAn8gBCgCJCIIIAQoAigiAU8EQCAAIAFBAXRBgAEgARsQMyAEKAIgIAQoAiQiCEEYbGoMAQsgACgCACAIQRhsagsiASAUOQMAIAQgCEEBajYCJCABIBY5AxAgASAVOQMICyACQYGAgIB4cUEBRiEGCyAFQdABaiQAIAYLwwYBCX8CQAJAAkACQAJAIAMOAwQCAAELAkAgAigCACgCACIDIAFBBGsiASgCACIGQQN0aiIHIAIoAgQoAgAiAkECdCIFaigCACILIAUgAyAAKAIAIgVBA3RqIgNqKAIAIglOBEAgCSALRw0BIAdBASACa0ECdCICaigCACACIANqKAIATg0BCyAEIAY2AgAgBCAAKAIANgIEDwsgBCAFNgIAIAQgASgCADYCBA8LIANBCEoNASAAIAFGDQIgBCAAKAIANgIAIABBBGoiBiABRg0CQQEgAigCBCgCACIAayELIAIoAgAoAgAhByAAQQJ0IQUgBCEAA0AgAEEEaiECAkACfwJAAkAgByAGKAIAIgNBA3RqIgkgBWooAgAiCCAHIAAoAgAiCkEDdGoiDCAFaigCACINTgRAIAggDUcNASAJIAtBAnQiCGooAgAgCCAMaigCAE4NAQsgACAKNgIEIAQgACAERg0CGgNAIAcgBigCAEEDdGoiCSAFaigCACIIIAcgAEEEayIDKAIAIgpBA3RqIgwgBWooAgAiDU4EQCAIIA1HDQMgCSALQQJ0IghqKAIAIAggDGooAgBODQMLIAAgCjYCACADIgAgBEcNAAsgBAwCCyACIAM2AgAMAgsgAAsgBigCADYCAAsgAiEAIAZBBGoiBiABRw0ACwwCCyAEIAAoAgA2AgAMAQsgACAAIANBAXYiB0ECdCIFaiIGIAIgByAEIAcQ0gEgBiABIAIgAyAHayIDIAQgBWogAxDSASACKAIEIQcgAigCACECIAYhAwNAIAEgA0YEQCAAIAZGDQIDQCAEIAAoAgA2AgAgBEEEaiEEIABBBGoiACAGRw0ACwwCCwJAAkAgAigCACIFIAMoAgAiC0EDdGoiCSAHKAIAIghBAnQiCmooAgAiDCAKIAUgACgCACIKQQN0aiIFaigCACINTgRAIAwgDUcNASAJQQEgCGtBAnQiCGooAgAgBSAIaigCAE4NAQsgBCALNgIAIANBBGohAwwBCyAEIAo2AgAgAEEEaiEACyAEQQRqIQQgACAGRw0ACyABIANGDQADQCAEIAMoAgA2AgAgBEEEaiEEIANBBGoiAyABRw0ACwsL6gwDDHwRfwF+IwBBkAFrIhQkACAUQeAAakEAQTD8CwAgFEEwakEAQTD8CwAgFCAENgIsIBQgAzYCKCAUQoCAgIAQNwIAIAEoAgQiGigCSCIfIAdBGGwiFWoiICsDACILIB8gBkEYbCIXaiIhKwMAIgyhIQ4gBUEDbSEiIBooApgBIiMgFWorAwAhDyAXICNqKwMAIRAgASgCACIbKAKYASEcIBsoAkghHUEAIQFBACEXA0ACfyAPIBwgFEEoaiAUIBdqKAIAIh5BAnRqKAIAQRhsIhVqKwMAmiIJZCAVIB1qIhgrAwAiCCALYyAIIAthGyAJIBBjIAggDGMgCCAMYRtrIiRFBEBEAAAAAAAA+H8hCUQAAAAAAAD4fyEKQQAMAQsgISsDECEKICErAwghCQJAIAggDKEiDSAIIAuhIgggDZkgCJljIhUbIA6jIgi9Qv///////////wCDQv/////////3/wBWDQAgICsDCCINIAmhIhG9Qv///////////wCDQoCAgICAgID4/wBaDQAgICsDECISIAqhIhO9Qv///////////wCDQoCAgICAgID4/wBaDQAgCiASIBUbIAggE6KgIQogCSANIBUbIAggEaKgIQkLICRBACAaKAKoASIVICJBGGxqKwMIIBUgGigCaCAFQQJ0aigCAEEDbUEYbGorAwigRAAAAAAAAAAAZCAYKwMIIgggCWMgCCAJYRsbCyEVAkAgCb1C////////////AINC//////////f/AFYNACAVQQAgFWsgHhsgGWohGSABQQFKBEBBAiEBDAELIAFFIBVFIBZzRXJFBEBBASEBDAELIAFBGGwiHiAUQeAAamoiFiAYKQMAIiU3AwAgFiAYKQMQNwMQIBYgGCkDCDcDCCAUQTBqIB5qIhYgCTkDCCAWIAo5AxAgFiAlNwMAIAFBAWohASAVQQBHIRYLIBdBBGoiF0EIRw0ACyAUIAc2AiQgFCAGNgIgIBRCgICAgBA3AgAgHSAEQRhsIhVqIgQrAwAiCyAdIANBGGwiA2oiBisDACIMoSEOIAJBA20hByAVIBxqKwMAmiEPIAMgHGorAwCaIRBBACEXA0ACfyAjIBRBIGogFCAXaigCACIYQQJ0aigCAEEYbCIDaisDACIJIBBkIAwgAyAfaiIDKwMAIghjIAggDGEbIAkgD2QgCCALZCAIIAthG2siHEUEQEQAAAAAAAD4fyEJRAAAAAAAAPh/IQpBAAwBCyAGKwMQIQogBisDCCEJAkAgCCAMoSINIAggC6EiCCANmSAImWMiFRsgDqMiCL1C////////////AINC//////////f/AFYNACAEKwMIIg0gCaEiEb1C////////////AINCgICAgICAgPj/AFoNACAEKwMQIhIgCqEiE71C////////////AINCgICAgICAgPj/AFoNACAKIBIgFRsgCCAToqAhCiAJIA0gFRsgCCARoqAhCQsgHEEAIBsoAqgBIhUgB0EYbGorAwggFSAbKAJoIAJBAnRqKAIAQQNtQRhsaisDCKBEAAAAAAAAAABkIAkgAysDCCIIYyAIIAlhGxsLIRUCQCAJvUL///////////8Ag0L/////////9/8AVg0AIBVBACAVayAYGyAZaiEZIAFBAUoEQEECIQEMAQsgAUUgFUUgFnNFckUEQEEBIQEMAQsgAUEYbCIYIBRBMGpqIhYgAykDACIlNwMAIBYgAykDEDcDECAWIAMpAwg3AwggFEHgAGogGGoiAyAJOQMIIAMgCjkDECADICU3AwAgAUEBaiEBIBVBAEchFgsgF0EEaiIXQQhHDQALAn8gGUUEQEQAAAAAAAD4fyEIRAAAAAAAAPh/IQtEAAAAAAAA+H8hCkQAAAAAAAD4fyEJQQAMAQsgFCAUQeAAaiAUQfgAaiAUQTBqIBRByABqEM4BIBQrAwghCyAUKwMAIQggGUEAIBsoAqgBIgEgB0EYbGorAxAgASAbKAJoIAJBAnRqKAIAQQNtQRhsaisDEKCaIBooAqgBIgEgIkEYbGorAxAgASAaKAJoIAVBAnRqKAIAQQNtQRhsaisDEKBjIBQrAxAiCiAUKwMYIgljIAkgCmEbGwshASAAIAk5AyAgACAKOQMYIAAgCzkDECAAIAg5AwggACABNgIAIBRBkAFqJAAL8QMBA38jAEEgayIGJAACQCAAKAIEIAJBMGxqIgcrAwAgASsDGGVFDQAgBysDCCABKwMgZUUNACAHKwMQIAErAyhlRQ0AIAcrAxggASsDAGZFDQAgBysDICABKwMIZkUNACAHKwMoIAErAxBmRQ0AAkAgAkEBcQ0AIAYgACgCFCgCACADIAJBAXUiABCNAyAGKQMIQv///////////wCDQv/////////3/wBWDQACQCAEKAIEIgEgBCgCCCIFTwRAIAQgBUEBdEGAASAFGxBEIAQgBCgCBCIBQQFqNgIEDAELIAQgAUEBajYCBAsgBCgCACABQQN0aiADrSAArUIghoQ3AgAgBEEQaiEBIAYoAgAhAwJAIAQoAhQiACAEKAIYIgVPBEAgASAFQQF0QYABIAUbECUgBCgCECAEKAIUIgBBAnRqIAM2AgAMAQsgASgCACAAQQJ0aiADNgIACyAEIABBAWo2AhQgBEEgaiEAAn8gBCgCJCIFIAQoAigiAU8EQCAAIAFBAXRBgAEgARsQMyAEKAIgIAQoAiQiBUEYbGoMAQsgACgCACAFQRhsagshACAEIAVBAWo2AiQgACAGKQMYNwMQIAAgBikDEDcDCCAAIAYpAwg3AwALIAJBgYCAgHhxQQFGIQULIAZBIGokACAFC8MGAQl/AkACQAJAAkACQCADDgMEAgABCwJAIAIoAgAoAgAiAyABQQRrIgEoAgAiBkEDdGoiByACKAIEKAIAIgJBAnQiBWooAgAiCyAFIAMgACgCACIFQQN0aiIDaigCACIJTgRAIAkgC0cNASAHQQEgAmtBAnQiAmooAgAgAiADaigCAE4NAQsgBCAGNgIAIAQgACgCADYCBA8LIAQgBTYCACAEIAEoAgA2AgQPCyADQQhKDQEgACABRg0CIAQgACgCADYCACAAQQRqIgYgAUYNAkEBIAIoAgQoAgAiAGshCyACKAIAKAIAIQcgAEECdCEFIAQhAANAIABBBGohAgJAAn8CQAJAIAcgBigCACIDQQN0aiIJIAVqKAIAIgggByAAKAIAIgpBA3RqIgwgBWooAgAiDU4EQCAIIA1HDQEgCSALQQJ0IghqKAIAIAggDGooAgBODQELIAAgCjYCBCAEIAAgBEYNAhoDQCAHIAYoAgBBA3RqIgkgBWooAgAiCCAHIABBBGsiAygCACIKQQN0aiIMIAVqKAIAIg1OBEAgCCANRw0DIAkgC0ECdCIIaigCACAIIAxqKAIATg0DCyAAIAo2AgAgAyIAIARHDQALIAQMAgsgAiADNgIADAILIAALIAYoAgA2AgALIAIhACAGQQRqIgYgAUcNAAsMAgsgBCAAKAIANgIADAELIAAgACADQQF2IgdBAnQiBWoiBiACIAcgBCAHENMBIAYgASACIAMgB2siAyAEIAVqIAMQ0wEgAigCBCEHIAIoAgAhAiAGIQMDQCABIANGBEAgACAGRg0CA0AgBCAAKAIANgIAIARBBGohBCAAQQRqIgAgBkcNAAsMAgsCQAJAIAIoAgAiBSADKAIAIgtBA3RqIgkgBygCACIIQQJ0IgpqKAIAIgwgCiAFIAAoAgAiCkEDdGoiBWooAgAiDU4EQCAMIA1HDQEgCUEBIAhrQQJ0IghqKAIAIAUgCGooAgBODQELIAQgCzYCACADQQRqIQMMAQsgBCAKNgIAIABBBGohAAsgBEEEaiEEIAAgBkcNAAsgASADRg0AA0AgBCADKAIANgIAIARBBGohBCADQQRqIgMgAUcNAAsLC+YMAwx8EX8BfiMAQZABayIUJAAgFEHgAGpBAEEw/AsAIBRBMGpBAEEw/AsAIBQgBDYCLCAUIAM2AiggFEKAgICAEDcCACABKAIEIhooAkgiHyAHQRhsIhVqIiArAwAiCyAfIAZBGGwiF2oiISsDACIMoSEOIAVBA20hIiAaKAKYASIjIBVqKwMAIQ8gFyAjaisDACEQIAEoAgAiGygCmAEhHCAbKAJIIR1BACEBQQAhFwNAAn8gHCAUQShqIBQgF2ooAgAiHkECdGooAgBBGGwiFWorAwAiCSAPYyAVIB1qIhgrAwAiCCALYyAIIAthGyAJIBBjIAggDGMgCCAMYRtrIiRFBEBEAAAAAAAA+H8hCUQAAAAAAAD4fyEKQQAMAQsgISsDECEKICErAwghCQJAIAggDKEiDSAIIAuhIgggDZkgCJljIhUbIA6jIgi9Qv///////////wCDQv/////////3/wBWDQAgICsDCCINIAmhIhG9Qv///////////wCDQoCAgICAgID4/wBaDQAgICsDECISIAqhIhO9Qv///////////wCDQoCAgICAgID4/wBaDQAgCiASIBUbIAggE6KgIQogCSANIBUbIAggEaKgIQkLICRBACAaKAKoASIVICJBGGxqKwMIIBUgGigCaCAFQQJ0aigCAEEDbUEYbGorAwigRAAAAAAAAAAAZCAYKwMIIgggCWMgCCAJYRsbCyEVAkAgCb1C////////////AINC//////////f/AFYNACAVQQAgFWsgHhsgGWohGSABQQFKBEBBAiEBDAELIAFFIBVFIBZzRXJFBEBBASEBDAELIAFBGGwiHiAUQeAAamoiFiAYKQMAIiU3AwAgFiAYKQMQNwMQIBYgGCkDCDcDCCAUQTBqIB5qIhYgCTkDCCAWIAo5AxAgFiAlNwMAIAFBAWohASAVQQBHIRYLIBdBBGoiF0EIRw0ACyAUIAc2AiQgFCAGNgIgIBRCgICAgBA3AgAgHSAEQRhsIhVqIgQrAwAiCyAdIANBGGwiA2oiBisDACIMoSEOIAJBA20hByAVIBxqKwMAIQ8gAyAcaisDACEQQQAhFwNAAn8gECAjIBRBIGogFCAXaigCACIYQQJ0aigCAEEYbCIDaisDACIJYyAMIAMgH2oiAysDACIIYyAIIAxhGyAJIA9kIAggC2QgCCALYRtrIhxFBEBEAAAAAAAA+H8hCUQAAAAAAAD4fyEKQQAMAQsgBisDECEKIAYrAwghCQJAIAggDKEiDSAIIAuhIgggDZkgCJljIhUbIA6jIgi9Qv///////////wCDQv/////////3/wBWDQAgBCsDCCINIAmhIhG9Qv///////////wCDQoCAgICAgID4/wBaDQAgBCsDECISIAqhIhO9Qv///////////wCDQoCAgICAgID4/wBaDQAgCiASIBUbIAggE6KgIQogCSANIBUbIAggEaKgIQkLIBxBACAbKAKoASIVIAdBGGxqKwMIIBUgGygCaCACQQJ0aigCAEEDbUEYbGorAwigRAAAAAAAAAAAYyAJIAMrAwgiCGMgCCAJYRsbCyEVAkAgCb1C////////////AINC//////////f/AFYNACAVQQAgFWsgGBsgGWohGSABQQFKBEBBAiEBDAELIAFFIBVFIBZzRXJFBEBBASEBDAELIAFBGGwiGCAUQTBqaiIWIAMpAwAiJTcDACAWIAMpAxA3AxAgFiADKQMINwMIIBRB4ABqIBhqIgMgCTkDCCADIAo5AxAgAyAlNwMAIAFBAWohASAVQQBHIRYLIBdBBGoiF0EIRw0ACwJ/IBlFBEBEAAAAAAAA+H8hCEQAAAAAAAD4fyELRAAAAAAAAPh/IQpEAAAAAAAA+H8hCUEADAELIBQgFEHgAGogFEH4AGogFEEwaiAUQcgAahDOASAUKwMIIQsgFCsDACEIIBlBACAbKAKoASIBIAdBGGxqKwMQIAEgGygCaCACQQJ0aigCAEEDbUEYbGorAxCgIBooAqgBIgEgIkEYbGorAxAgASAaKAJoIAVBAnRqKAIAQQNtQRhsaisDEKBjIBQrAxAiCiAUKwMYIgljIAkgCmEbGwshASAAIAk5AyAgACAKOQMYIAAgCzkDECAAIAg5AwggACABNgIAIBRBkAFqJAALoAsDD38DfAN+IwBB0AFrIgUkAAJAIAAoAgQgAkEwbGoiCCsDACABKwMYZUUNACAIKwMIIAErAyBlRQ0AIAgrAxAgASsDKGVFDQAgCCsDGCABKwMAZkUNACAIKwMgIAErAwhmRQ0AIAgrAyggASsDEGZFDQACQCACQQFxDQAgACgCFCgCACEKIAVBoAFqQQBBMPwLACAFQfAAakEAQTD8CwAgCigCACIRKAJYIANBAnRqIgBBeEEEIANBA29BAkYbaigCACEQIAAoAgAhDCAKKAIEIQAgBUECNgIQIAVCgICAgBA3AgggACgCWCINIAJBAXUiDiACaiIPQQJ0aiESIAAoAmghEwNAQQEhAAJAIA0gBUEIaiAHaigCACIJIA9qIgtBAnQiCGooAgAiBiASQQRBCCAJQQFGG0EAIAkbQYzpAGooAgBBAnRqKAIAIgFIBEAgBiEIIAEhBgwBCyAIIBNqKAIAIQtBACEAIAEhCAsgBUFAayAJQQR0aiIBIAA6AAwgASAGNgIIIAEgCDYCBCABIAs2AgAgB0EEaiIHQQxHDQALIAUgEDYCOCAFIAw2AjQgCkEIaiENQQAhB0EAIQhBACEBQQAhAANAIAVBCGogDSAFQTRqIAFqKAIAIgsgDiAFQUBrEIwDAkAgBSsDECIUvUL///////////8Ag0L/////////9/8AVg0AIAUoAggiCUEAIAlrIAsgDEYbIABqIQAgB0EBSgRAQQIhBwwBCyAHRSAIIAlFc0EBcUVyRQRAQQEhBwwBCyAHQRhsIg8gBUGgAWpqIgYgESgCSCALQRhsaiIIKQMQIhg3AxAgBiAIKQMIIhc3AwggBiAIKQMAIhk3AwAgBiAXNwMQIAYgGDcDCCAFQfAAaiAPaiIGIBc3AxAgBiAZNwMAIAYgFDkDCCAHQQFqIQcgCUEARyEICyABQQRqIgFBCEcNAAsgBUECNgI8IAVCgICAgBA3AjQgCkEQaiEJQQAhBgNAIAVBCGogCSADIAwgECAFQUBrIAVBNGogBmooAgBBBHRqIgEoAgAgASgCBCABKAIIEPoEAkAgBSsDECIUvUL///////////8Ag0L/////////9/8AVg0AQQAgBSgCCCIKayAKIAEtAAwbIABqIQAgB0EBSgRAQQIhBwwBCyAHRSAIIApFc0EBcUVyRQRAQQEhBwwBCyAHQRhsIgggBUGgAWpqIgEgFDkDACABIAUrAyAiFTkDCCABIAUrAxgiFjkDECAFQfAAaiAIaiIBIBY5AxAgASAVOQMIIAEgFDkDACABIAUrAyg5AwggB0EBaiEHIApBAEchCAsgBkEEaiIGQQxHDQALAnwgAEUEQEQAAAAAAAD4fyEVRAAAAAAAAPh/IRZEAAAAAAAA+H8MAQsgBUEIaiAFQaABaiAFQbgBaiAFQfAAaiAFQYgBahDOASAFKwMQIRYgBSsDGCEVIAUrAwgLIhS9Qv///////////wCDQv/////////3/wBWDQACQCAEKAIEIgEgBCgCCCIGTwRAIAQgBkEBdEGAASAGGxBEIAQgBCgCBCIBQQFqNgIEDAELIAQgAUEBajYCBAsgBCgCACABQQN0aiADrSAOrUIghoQ3AgAgBEEQaiEDAkAgBCgCFCIBIAQoAhgiBk8EQCADIAZBAXRBgAEgBhsQJSAEKAIQIAQoAhQiAUECdGogADYCAAwBCyADKAIAIAFBAnRqIAA2AgALIAQgAUEBajYCFCAEQSBqIQACfyAEKAIkIgcgBCgCKCIBTwRAIAAgAUEBdEGAASABGxAzIAQoAiAgBCgCJCIHQRhsagwBCyAAKAIAIAdBGGxqCyIBIBQ5AwAgBCAHQQFqNgIkIAEgFjkDECABIBU5AwgLIAJBgYCAgHhxQQFGIQYLIAVB0AFqJAAgBgv4HgMOfwJ8AX4jAEHwAGsiCCQAA0AgAUE4ayEOIAFBuAFrIQ8gAUHAAWshDCABQfgAayEQIAFBgAFrIQ0gAUFAaiEKA0AgA0EBcSERAkADQAJAAkACQAJAAkACQCABIAAiBGtBBnUiBg4GBwcAAQIEAwsgAUE4aysDACAEKwMIY0UNBiAIQTBqIgIgBEHAAPwKAAAgBCABQUBqIgBBwAD8CgAAIAAgAkHAAPwKAAAMBgsgAUFAaiECIARBQGshACABQThrIgErAwAhEiAEKwNIIhMgBCsDCGNFBEAgEiATY0UNBiAIQTBqIgEgAEHAAPwKAAAgACACQcAA/AoAACACIAFBwAD8CgAAIAQrA0ggBCsDCGNFDQYgASAEQcAA/AoAACAEIABBwAD8CgAAIAAgAUHAAPwKAAAMBgsgEiATYwRAIAhBMGoiACAEQcAA/AoAACAEIAJBwAD8CgAAIAIgAEHAAPwKAAAMBgsgCEEwaiIDIARBwAD8CgAAIAQgAEHAAPwKAAAgACADQcAA/AoAACABKwMAIAQrA0hjRQ0FIAMgAEHAAPwKAAAgACACQcAA/AoAACACIANBwAD8CgAADAULIARBgAFqIQIgBEFAayEAIAQrA4gBIRICQCAEKwNIIhMgBCsDCGNFBEAgEiATY0UNASAIQTBqIgMgAEHAAPwKAAAgACACQcAA/AoAACACIANBwAD8CgAAIAQrA0ggBCsDCGNFDQEgAyAEQcAA/AoAACAEIABBwAD8CgAAIAAgA0HAAPwKAAAMAQsgEiATYwRAIAhBMGoiAyAEQcAA/AoAACAEIAJBwAD8CgAAIAIgA0HAAPwKAAAMAQsgCEEwaiIDIARBwAD8CgAAIAQgAEHAAPwKAAAgACADQcAA/AoAACASIAQrA0hjRQ0AIAMgAEHAAPwKAAAgACACQcAA/AoAACACIANBwAD8CgAACyABQThrKwMAIAQrA4gBY0UNBCAIQTBqIgMgAkHAAPwKAAAgAiABQUBqIgFBwAD8CgAAIAEgA0HAAPwKAAAgBCsDiAEgBCsDSGNFDQQgAyAAQcAA/AoAACAAIAJBwAD8CgAAIAIgA0HAAPwKAAAgBCsDSCAEKwMIY0UNBCADIARBwAD8CgAAIAQgAEHAAPwKAAAgACADQcAA/AoAAAwECyAGQRdMBEAgASAERiAEQUBrIgAgAUZyIQIgA0EBcQRAIAINBSAEIQUDQCAAIAUrA0giEiAFKwMIYwRAIAApAwAhFCAIQTBqIAVB0ABqQTD8CgAAIAAhBgNAAkAgBiAFIgBBwAD8CgAAIAAgBEYEQCAEIQAMAQsgAEFAaiEFIAAhBiASIABBOGsrAwBjDQELCyAAIBI5AwggACAUNwMAIABBEGogCEEwakEw/AoAAAsiBUFAayIAIAFHDQALDAULIAINBANAIAAgBCsDSCISIAQrAwhjBEAgACkDACEUIAhBMGogBEHQAGpBMPwKAAADQCAAIAQiAEHAAPwKAAAgAEFAaiEEIBIgAEE4aysDAGMNAAsgACASOQMIIAAgFDcDACAAQRBqIAhBMGpBMPwKAAALIgRBQGsiACABRw0ACwwECyACDQEgASAERg0DIAZBAmtBAXYiCSEAA0ACQCAJIAAiAkgNACAEIABBBnRqIQcgBCAAQQF0IgVBAXIiA0EGdGohAAJAAkAgBUECaiIFIAZODQAgACsDCCAAKwNIY0UNACAAQUBrIQAMAQsgAyEFCyAHKwMIIhIgACsDCGQNACAHKQMAIRQgCEEwaiAHQRBqQTD8CgAAA0ACQCAHIAAiB0HAAPwKAAAgBSAJSg0AIAQgBUEBdCIFQQFyIgNBBnRqIQACQAJAIAVBAmoiBSAGTg0AIAArAwggACsDSGNFDQAgAEFAayEADAELIAMhBQsgACsDCCASY0UNAQsLIAcgEjkDCCAHIBQ3AwAgB0EQaiAIQTBqQTD8CgAACyACQQFrIQAgAg0ACwNAIAhBMGogBEHAAPwKAAAgBiIDQQJrQQF2IQpBACEAIAQhBQNAIABBAXQiBkEBciECIAUiByAAQQZ0aiIJQUBrIQUCfyACIAMgBkECaiIGTA0AGiACIAkrA0ggCSsDiAFjRQ0AGiAJQYABaiEFIAYLIQAgByAFQcAA/AoAACAAIApMDQALAkAgAUFAaiIBIAVGBEAgBSAIQTBqQcAA/AoAAAwBCyAFIAFBwAD8CgAAIAEgCEEwakHAAPwKAAAgBSAEa0FAa0EGdSIAQQJIDQAgBSsDCCISIAQgAEECa0EBdiIAQQZ0aiIHKwMIZEUNACAFKQMAIRQgCCAFQRBqQTD8CgAAA0ACQCAFIAciAkHAAPwKAAAgAEUNACAHIQUgBCAAQQFrQQF2IgBBBnRqIgcrAwggEmMNAQsLIAIgEjkDCCACIBQ3AwAgAkEQaiAIQTD8CgAACyADQQFrIQYgA0ECSg0ACwwDCyAEIARBQGsgBEGAAWogBEHAAWogAUFAahDxBAwCCyAEIAZBBXRBQHFqIQAgDisDACESAkAgBkGBAU8EQAJAIAArAwgiEyAEKwMIY0UEQCASIBNjRQ0BIAhBMGoiBSAAQcAA/AoAACAAIApBwAD8CgAAIAogBUHAAPwKAAAgACsDCCAEKwMIY0UNASAFIARBwAD8CgAAIAQgAEHAAPwKAAAgACAFQcAA/AoAAAwBCyASIBNjBEAgCEEwaiIFIARBwAD8CgAAIAQgCkHAAPwKAAAgCiAFQcAA/AoAAAwBCyAIQTBqIgUgBEHAAPwKAAAgBCAAQcAA/AoAACAAIAVBwAD8CgAAIA4rAwAgACsDCGNFDQAgBSAAQcAA/AoAACAAIApBwAD8CgAAIAogBUHAAPwKAAALIABBQGohBSAEQUBrIQcgECsDACESAkAgAEE4ayIJKwMAIhMgBCsDSGNFBEAgEiATY0UNASAIQTBqIgYgBUHAAPwKAAAgBSANQcAA/AoAACANIAZBwAD8CgAAIAkrAwAgBCsDSGNFDQEgBiAHQcAA/AoAACAHIAVBwAD8CgAAIAUgBkHAAPwKAAAMAQsgEiATYwRAIAhBMGoiBiAHQcAA/AoAACAHIA1BwAD8CgAAIA0gBkHAAPwKAAAMAQsgCEEwaiIGIAdBwAD8CgAAIAcgBUHAAPwKAAAgBSAGQcAA/AoAACAQKwMAIAkrAwBjRQ0AIAYgBUHAAPwKAAAgBSANQcAA/AoAACANIAZBwAD8CgAACyAAQUBrIQcgBEGAAWohBiAPKwMAIRICQCAAKwNIIhMgBCsDiAFjRQRAIBIgE2NFDQEgCEEwaiILIAdBwAD8CgAAIAcgDEHAAPwKAAAgDCALQcAA/AoAACAAKwNIIAQrA4gBY0UNASALIAZBwAD8CgAAIAYgB0HAAPwKAAAgByALQcAA/AoAAAwBCyASIBNjBEAgCEEwaiILIAZBwAD8CgAAIAYgDEHAAPwKAAAgDCALQcAA/AoAAAwBCyAIQTBqIgsgBkHAAPwKAAAgBiAHQcAA/AoAACAHIAtBwAD8CgAAIA8rAwAgACsDSGNFDQAgCyAHQcAA/AoAACAHIAxBwAD8CgAAIAwgC0HAAPwKAAALIAArA0ghEgJAIAArAwgiEyAJKwMAY0UEQCASIBNjRQ0BIAhBMGoiBiAAQcAA/AoAACAAIAdBwAD8CgAAIAcgBkHAAPwKAAAgACsDCCAJKwMAY0UNASAGIAVBwAD8CgAAIAUgAEHAAPwKAAAgACAGQcAA/AoAAAwBCyASIBNjBEAgCEEwaiIGIAVBwAD8CgAAIAUgB0HAAPwKAAAgByAGQcAA/AoAAAwBCyAIQTBqIgYgBUHAAPwKAAAgBSAAQcAA/AoAACAAIAZBwAD8CgAAIAArA0ggACsDCGNFDQAgBiAAQcAA/AoAACAAIAdBwAD8CgAAIAcgBkHAAPwKAAALIAhBMGoiBSAEQcAA/AoAACAEIABBwAD8CgAAIAAgBUHAAPwKAAAMAQsgBCsDCCITIAArAwhjRQRAIBIgE2NFDQEgCEEwaiIFIARBwAD8CgAAIAQgCkHAAPwKAAAgCiAFQcAA/AoAACAEKwMIIAArAwhjRQ0BIAUgAEHAAPwKAAAgACAEQcAA/AoAACAEIAVBwAD8CgAADAELIBIgE2MEQCAIQTBqIgUgAEHAAPwKAAAgACAKQcAA/AoAACAKIAVBwAD8CgAADAELIAhBMGoiBSAAQcAA/AoAACAAIARBwAD8CgAAIAQgBUHAAPwKAAAgDisDACAEKwMIY0UNACAFIARBwAD8CgAAIAQgCkHAAPwKAAAgCiAFQcAA/AoAAAsgAkEBayECAkAgEQRAIAQrAwghEgwBCyAEKwMIIhIgBEE4aysDAGQNACAEKQMAIRQgCCAEQRBqQTD8CgAAIAQiACEFAkAgDisDACASZARAA0AgACIDQUBrIQAgEiADKwNIY0UNAAwCCwALA0AgBUFAayIAIAFPDQEgBSsDSCETIAAhBSASIBNjRQ0ACwsgASIFIABLBEADQCAFQThrIQMgBUFAaiEFIBIgAysDAGMNAAsLIAAgBUkEQANAIAhBMGoiAyAAQcAA/AoAACAAIAVBwAD8CgAAIAUgA0HAAPwKAAADQCAAIgNBQGshACASIAMrA0hjRQ0ACwNAIAUiA0FAaiEFIBIgA0E4aysDAGMNAAsgACAFSQ0ACwsgAEFAaiIDIARHBEAgBCADQcAA/AoAAAsgAyAUNwMAIABBOGsgEjkDACAAQTBrIAhBMPwKAABBACEDDAMLIAQpAwAhFCAIIARBEGpBMPwKAAAgBCEHA0AgByIAQUBrIQcgACsDSCASYw0ACyABIgUhBgJAIAAgBEYEQANAIAUgB00EQCAFIQYMAwsgBUE4ayAFQUBqIgYhBSsDACASY0UNAAwCCwALA0AgBiIAQUBqIQYgAEE4aysDACASY0UNAAsLIAciACAGIgVJBEADQCAIQTBqIgkgAEHAAPwKAAAgACAFQcAA/AoAACAFIAlBwAD8CgAAA0AgACIJQUBrIQAgCSsDSCASYw0ACwNAIAUiCUFAaiEFIAlBOGsrAwAgEmNFDQALIAAgBUkNAAsLIABBQGoiBSAERwRAIAQgBUHAAPwKAAALIAUgFDcDACAAQThrIBI5AwAgAEEwayAIQTD8CgAAIAYgB00EQCAEIAUQ8AQhByAAIAEQ8AQEQCAFIQEgBCEAIAdFDQUMAwsgBw0BCwsgBCAFIAIgERD8BEEAIQMMAQsLCyAIQfAAaiQAC5AIAhZ/AnwjAEHAAmsiAiQAIAAoAgAiBCgCACgCSCABQQJ0IhUgBCgCBCgCAGooAgBBGGxqIgErAwghGCABKwMAIRkgACgCBCEWIAAoAgwhFyAAKAIUKAIAIQhBASEAQX8hCQNAIBcgAEEBa0ECbUEDdGoiACgCBCEFQQAhBgJ/QQAgGSAWIAAoAgAiCkEwbGoiACsDGGVFDQAaQQAgGSAAKwMAZkUNABpBACAYIAArAyBlRQ0AGkEAIBggACsDCGZFDQAaAkAgCkEBcQ0AIAgoAgQoAgAgFWooAgAhCyAIKAIAIg4oAgQhACACQQI2AogCIAJCgICAgBA3AoACIAAoAlgiDyAKQQF1IhAgCmoiEUECdGohEiAAKAJoIRNBACEBA0BBASEMAkAgDyACQYACaiABaigCACIHIBFqIg1BAnQiBGooAgAiACASQQRBCCAHQQFGG0EAIAcbQYzpAGooAgBBAnRqKAIAIgNIBEAgACEEIAMhAAwBCyAEIBNqKAIAIQ1BACEMIAMhBAsgAkGQAmoiFCAHQQR0aiIDIAw6AAwgAyAANgIIIAMgBDYCBCADIA02AgAgAUEEaiIBQQxHDQALIAJBgAJqIA4gCyAQIBQQiAMgAikDiAJC////////////AINC//////////f/AFYNACAIKAIIKAIAIAtBAnRqIgAgACgCACACKAKAAms2AgALIApBgYCAgHhxQQFGCyEHAkAgGSAWIAVBMGxqIgArAxhlRQ0AIBkgACsDAGZFDQAgGCAAKwMgZUUNACAYIAArAwhmRQ0AAkAgBUEBcQ0AIAgoAgQoAgAgFWooAgAhCyAIKAIAIg4oAgQhACACQQI2AogCIAJCgICAgBA3AoACIAAoAlgiDyAFQQF1IhAgBWoiEUECdGohEiAAKAJoIRNBACEBA0BBASEMAkAgDyACQYACaiABaigCACIGIBFqIg1BAnQiBGooAgAiACASQQRBCCAGQQFGG0EAIAYbQYzpAGooAgBBAnRqKAIAIgNIBEAgACEEIAMhAAwBCyAEIBNqKAIAIQ1BACEMIAMhBAsgAkGQAmoiFCAGQQR0aiIDIAw6AAwgAyAANgIIIAMgBDYCBCADIA02AgAgAUEEaiIBQQxHDQALIAJBgAJqIA4gCyAQIBQQiAMgAikDiAJC////////////AINC//////////f/AFYNACAIKAIIKAIAIAtBAnRqIgAgACgCACACKAKAAms2AgALIAVBgYCAgHhxQQFGIQYLAkAgBiAHckUEQCAJQQBIDQEgAiAJQQJ0aigCACEAIAlBAWshCQwCCyAKIAUgBxshACAHRSAGRXINASACIAlBAWoiCUECdGogBTYCAAwBCwsgAkHAAmokAAuQCAIWfwJ8IwBBwAJrIgIkACAAKAIAIgQoAgAoAkggAUECdCIVIAQoAgQoAgBqKAIAQRhsaiIBKwMIIRggASsDACEZIAAoAgQhFiAAKAIMIRcgACgCFCgCACEIQQEhAEF/IQkDQCAXIABBAWtBAm1BA3RqIgAoAgQhBUEAIQYCf0EAIBkgFiAAKAIAIgpBMGxqIgArAxhlRQ0AGkEAIBkgACsDAGZFDQAaQQAgGCAAKwMgZUUNABpBACAYIAArAwhmRQ0AGgJAIApBAXENACAIKAIEKAIAIBVqKAIAIQsgCCgCACIOKAIEIQAgAkECNgKIAiACQoCAgIAQNwKAAiAAKAJYIg8gCkEBdSIQIApqIhFBAnRqIRIgACgCaCETQQAhAQNAQQEhDAJAIA8gAkGAAmogAWooAgAiByARaiINQQJ0IgRqKAIAIgAgEkEEQQggB0EBRhtBACAHG0GM6QBqKAIAQQJ0aigCACIDSARAIAAhBCADIQAMAQsgBCATaigCACENQQAhDCADIQQLIAJBkAJqIhQgB0EEdGoiAyAMOgAMIAMgADYCCCADIAQ2AgQgAyANNgIAIAFBBGoiAUEMRw0ACyACQYACaiAOIAsgECAUEIYDIAIpA4gCQv///////////wCDQv/////////3/wBWDQAgCCgCCCgCACALQQJ0aiIAIAAoAgAgAigCgAJrNgIACyAKQYGAgIB4cUEBRgshBwJAIBkgFiAFQTBsaiIAKwMYZUUNACAZIAArAwBmRQ0AIBggACsDIGVFDQAgGCAAKwMIZkUNAAJAIAVBAXENACAIKAIEKAIAIBVqKAIAIQsgCCgCACIOKAIEIQAgAkECNgKIAiACQoCAgIAQNwKAAiAAKAJYIg8gBUEBdSIQIAVqIhFBAnRqIRIgACgCaCETQQAhAQNAQQEhDAJAIA8gAkGAAmogAWooAgAiBiARaiINQQJ0IgRqKAIAIgAgEkEEQQggBkEBRhtBACAGG0GM6QBqKAIAQQJ0aigCACIDSARAIAAhBCADIQAMAQsgBCATaigCACENQQAhDCADIQQLIAJBkAJqIhQgBkEEdGoiAyAMOgAMIAMgADYCCCADIAQ2AgQgAyANNgIAIAFBBGoiAUEMRw0ACyACQYACaiAOIAsgECAUEIYDIAIpA4gCQv///////////wCDQv/////////3/wBWDQAgCCgCCCgCACALQQJ0aiIAIAAoAgAgAigCgAJrNgIACyAFQYGAgIB4cUEBRiEGCwJAIAYgB3JFBEAgCUEASA0BIAIgCUECdGooAgAhACAJQQFrIQkMAgsgCiAFIAcbIQAgB0UgBkVyDQEgAiAJQQFqIglBAnRqIAU2AgAMAQsLIAJBwAJqJAALkAgCFn8CfCMAQcACayICJAAgACgCACIEKAIAKAJIIAFBAnQiFSAEKAIEKAIAaigCAEEYbGoiASsDCCEYIAErAwAhGSAAKAIEIRYgACgCDCEXIAAoAhQoAgAhCEEBIQBBfyEJA0AgFyAAQQFrQQJtQQN0aiIAKAIEIQVBACEGAn9BACAZIBYgACgCACIKQTBsaiIAKwMYZUUNABpBACAZIAArAwBmRQ0AGkEAIBggACsDIGVFDQAaQQAgGCAAKwMIZkUNABoCQCAKQQFxDQAgCCgCBCgCACAVaigCACELIAgoAgAiDigCBCEAIAJBAjYCiAIgAkKAgICAEDcCgAIgACgCWCIPIApBAXUiECAKaiIRQQJ0aiESIAAoAmghE0EAIQEDQEEBIQwCQCAPIAJBgAJqIAFqKAIAIgcgEWoiDUECdCIEaigCACIAIBJBBEEIIAdBAUYbQQAgBxtBjOkAaigCAEECdGooAgAiA0gEQCAAIQQgAyEADAELIAQgE2ooAgAhDUEAIQwgAyEECyACQZACaiIUIAdBBHRqIgMgDDoADCADIAA2AgggAyAENgIEIAMgDTYCACABQQRqIgFBDEcNAAsgAkGAAmogDiALIBAgFBCMAyACKQOIAkL///////////8Ag0L/////////9/8AVg0AIAgoAggoAgAgC0ECdGoiACAAKAIAIAIoAoACajYCAAsgCkGBgICAeHFBAUYLIQcCQCAZIBYgBUEwbGoiACsDGGVFDQAgGSAAKwMAZkUNACAYIAArAyBlRQ0AIBggACsDCGZFDQACQCAFQQFxDQAgCCgCBCgCACAVaigCACELIAgoAgAiDigCBCEAIAJBAjYCiAIgAkKAgICAEDcCgAIgACgCWCIPIAVBAXUiECAFaiIRQQJ0aiESIAAoAmghE0EAIQEDQEEBIQwCQCAPIAJBgAJqIAFqKAIAIgYgEWoiDUECdCIEaigCACIAIBJBBEEIIAZBAUYbQQAgBhtBjOkAaigCAEECdGooAgAiA0gEQCAAIQQgAyEADAELIAQgE2ooAgAhDUEAIQwgAyEECyACQZACaiIUIAZBBHRqIgMgDDoADCADIAA2AgggAyAENgIEIAMgDTYCACABQQRqIgFBDEcNAAsgAkGAAmogDiALIBAgFBCMAyACKQOIAkL///////////8Ag0L/////////9/8AVg0AIAgoAggoAgAgC0ECdGoiACAAKAIAIAIoAoACajYCAAsgBUGBgICAeHFBAUYhBgsCQCAGIAdyRQRAIAlBAEgNASACIAlBAnRqKAIAIQAgCUEBayEJDAILIAogBSAHGyEAIAdFIAZFcg0BIAIgCUEBaiIJQQJ0aiAFNgIADAELCyACQcACaiQAC5AIAhZ/AnwjAEHAAmsiAiQAIAAoAgAiBCgCACgCSCABQQJ0IhUgBCgCBCgCAGooAgBBGGxqIgErAwghGCABKwMAIRkgACgCBCEWIAAoAgwhFyAAKAIUKAIAIQhBASEAQX8hCQNAIBcgAEEBa0ECbUEDdGoiACgCBCEFQQAhBgJ/QQAgGSAWIAAoAgAiCkEwbGoiACsDGGVFDQAaQQAgGSAAKwMAZkUNABpBACAYIAArAyBlRQ0AGkEAIBggACsDCGZFDQAaAkAgCkEBcQ0AIAgoAgQoAgAgFWooAgAhCyAIKAIAIg4oAgQhACACQQI2AogCIAJCgICAgBA3AoACIAAoAlgiDyAKQQF1IhAgCmoiEUECdGohEiAAKAJoIRNBACEBA0BBASEMAkAgDyACQYACaiABaigCACIHIBFqIg1BAnQiBGooAgAiACASQQRBCCAHQQFGG0EAIAcbQYzpAGooAgBBAnRqKAIAIgNIBEAgACEEIAMhAAwBCyAEIBNqKAIAIQ1BACEMIAMhBAsgAkGQAmoiFCAHQQR0aiIDIAw6AAwgAyAANgIIIAMgBDYCBCADIA02AgAgAUEEaiIBQQxHDQALIAJBgAJqIA4gCyAQIBQQigMgAikDiAJC////////////AINC//////////f/AFYNACAIKAIIKAIAIAtBAnRqIgAgACgCACACKAKAAmo2AgALIApBgYCAgHhxQQFGCyEHAkAgGSAWIAVBMGxqIgArAxhlRQ0AIBkgACsDAGZFDQAgGCAAKwMgZUUNACAYIAArAwhmRQ0AAkAgBUEBcQ0AIAgoAgQoAgAgFWooAgAhCyAIKAIAIg4oAgQhACACQQI2AogCIAJCgICAgBA3AoACIAAoAlgiDyAFQQF1IhAgBWoiEUECdGohEiAAKAJoIRNBACEBA0BBASEMAkAgDyACQYACaiABaigCACIGIBFqIg1BAnQiBGooAgAiACASQQRBCCAGQQFGG0EAIAYbQYzpAGooAgBBAnRqKAIAIgNIBEAgACEEIAMhAAwBCyAEIBNqKAIAIQ1BACEMIAMhBAsgAkGQAmoiFCAGQQR0aiIDIAw6AAwgAyAANgIIIAMgBDYCBCADIA02AgAgAUEEaiIBQQxHDQALIAJBgAJqIA4gCyAQIBQQigMgAikDiAJC////////////AINC//////////f/AFYNACAIKAIIKAIAIAtBAnRqIgAgACgCACACKAKAAmo2AgALIAVBgYCAgHhxQQFGIQYLAkAgBiAHckUEQCAJQQBIDQEgAiAJQQJ0aigCACEAIAlBAWshCQwCCyAKIAUgBxshACAHRSAGRXINASACIAlBAWoiCUECdGogBTYCAAwBCwsgAkHAAmokAAtUAQF/IAAgAUcEQCAAKAIAIgIEQCACECILIABBADYCCCAAQgA3AgAgACABKAIANgIAIAAgASgCBDYCBCAAIAEoAgg2AgggAUEANgIIIAFCADcCAAsL8wMCB38JfCMAQcADayICJAACQCAAKAIAKAIAIgQoAlggAUECdGoiAygCACIGIANBeEEEIAFBA29BAkYbaigCACIDTg0AIAQoAkgiBSAGQRhsaiIEKwMAIgkgBSADQRhsaiIDKwMAIgogCSAKYyIGGyIMRAAAAAAAAPB/YQ0AIAMrAxAiCyAEKwMQIg0gCyANZCIFGyEOIAMrAwgiDyAEKwMIIhAgDyAQZCIEGyERIAogCSAGGyEJIA0gCyAFGyEKIBAgDyAEGyELIAAoAhRBBGohB0EBIQNBfyEEA0AgACgCDCADQQFrQQJtQQN0aiIDKAIEIQYgAygCACEDIAIgDjkDuAEgAiAROQOwASACIAk5A6gBIAIgCjkDoAEgAiALOQOYASACIAw5A5ABIAJBMGoiBSACQZABakEw/AoAACAAIAUgAyABIAcQ8wQhBSACIA45A4gBIAIgETkDgAEgAiAJOQN4IAIgCjkDcCACIAs5A2ggAiAMOQNgIAIgAkHgAGpBMPwKAAAgBSAAIAIgBiABIAcQ8wQiCHJFBEAgBEEASA0CIAJBwAFqIARBAnRqKAIAIQMgBEEBayEEDAELIAMgBiAFGyEDIAVFIAhFcg0AIAJBwAFqIARBAWoiBEECdGogBjYCAAwACwALIAJBwANqJAAL8wMCB38JfCMAQcADayICJAACQCAAKAIAKAIAIgQoAlggAUECdGoiAygCACIGIANBeEEEIAFBA29BAkYbaigCACIDTg0AIAQoAkgiBSAGQRhsaiIEKwMAIgkgBSADQRhsaiIDKwMAIgogCSAKYyIGGyIMRAAAAAAAAPB/YQ0AIAMrAxAiCyAEKwMQIg0gCyANZCIFGyEOIAMrAwgiDyAEKwMIIhAgDyAQZCIEGyERIAogCSAGGyEJIA0gCyAFGyEKIBAgDyAEGyELIAAoAhRBBGohB0EBIQNBfyEEA0AgACgCDCADQQFrQQJtQQN0aiIDKAIEIQYgAygCACEDIAIgDjkDuAEgAiAROQOwASACIAk5A6gBIAIgCjkDoAEgAiALOQOYASACIAw5A5ABIAJBMGoiBSACQZABakEw/AoAACAAIAUgAyABIAcQ9QQhBSACIA45A4gBIAIgETkDgAEgAiAJOQN4IAIgCjkDcCACIAs5A2ggAiAMOQNgIAIgAkHgAGpBMPwKAAAgBSAAIAIgBiABIAcQ9QQiCHJFBEAgBEEASA0CIAJBwAFqIARBAnRqKAIAIQMgBEEBayEEDAELIAMgBiAFGyEDIAVFIAhFcg0AIAJBwAFqIARBAWoiBEECdGogBjYCAAwACwALIAJBwANqJAAL8wMCB38JfCMAQcADayICJAACQCAAKAIAKAIAIgQoAlggAUECdGoiAygCACIGIANBeEEEIAFBA29BAkYbaigCACIDTg0AIAQoAkgiBSAGQRhsaiIEKwMAIgkgBSADQRhsaiIDKwMAIgogCSAKYyIGGyIMRAAAAAAAAPB/YQ0AIAMrAxAiCyAEKwMQIg0gCyANZCIFGyEOIAMrAwgiDyAEKwMIIhAgDyAQZCIEGyERIAogCSAGGyEJIA0gCyAFGyEKIBAgDyAEGyELIAAoAhRBBGohB0EBIQNBfyEEA0AgACgCDCADQQFrQQJtQQN0aiIDKAIEIQYgAygCACEDIAIgDjkDuAEgAiAROQOwASACIAk5A6gBIAIgCjkDoAEgAiALOQOYASACIAw5A5ABIAJBMGoiBSACQZABakEw/AoAACAAIAUgAyABIAcQ+AQhBSACIA45A4gBIAIgETkDgAEgAiAJOQN4IAIgCjkDcCACIAs5A2ggAiAMOQNgIAIgAkHgAGpBMPwKAAAgBSAAIAIgBiABIAcQ+AQiCHJFBEAgBEEASA0CIAJBwAFqIARBAnRqKAIAIQMgBEEBayEEDAELIAMgBiAFGyEDIAVFIAhFcg0AIAJBwAFqIARBAWoiBEECdGogBjYCAAwACwALIAJBwANqJAAL8wMCB38JfCMAQcADayICJAACQCAAKAIAKAIAIgQoAlggAUECdGoiAygCACIGIANBeEEEIAFBA29BAkYbaigCACIDTg0AIAQoAkgiBSAGQRhsaiIEKwMAIgkgBSADQRhsaiIDKwMAIgogCSAKYyIGGyIMRAAAAAAAAPB/YQ0AIAMrAxAiCyAEKwMQIg0gCyANZCIFGyEOIAMrAwgiDyAEKwMIIhAgDyAQZCIEGyERIAogCSAGGyEJIA0gCyAFGyEKIBAgDyAEGyELIAAoAhRBBGohB0EBIQNBfyEEA0AgACgCDCADQQFrQQJtQQN0aiIDKAIEIQYgAygCACEDIAIgDjkDuAEgAiAROQOwASACIAk5A6gBIAIgCjkDoAEgAiALOQOYASACIAw5A5ABIAJBMGoiBSACQZABakEw/AoAACAAIAUgAyABIAcQ+wQhBSACIA45A4gBIAIgETkDgAEgAiAJOQN4IAIgCjkDcCACIAs5A2ggAiAMOQNgIAIgAkHgAGpBMPwKAAAgBSAAIAIgBiABIAcQ+wQiCHJFBEAgBEEASA0CIAJBwAFqIARBAnRqKAIAIQMgBEEBayEEDAELIAMgBiAFGyEDIAVFIAhFcg0AIAJBwAFqIARBAWoiBEECdGogBjYCAAwACwALIAJBwANqJAALWgEDfyAAQQA2AgggAEIANwIAIAEoAgQiAiABKAIAIgFHBEAgACACIAFrIgJBGG0Q8gEgACgCBCEDIAJBBGsiBARAIAMgASAE/AoAAAsgACACIANqNgIECyAACwoAIAAoAgRBAWsLLgEBfyAAKAIEIQIgACABEDMgACABNgIEIAJBEUkgAiABQQF0TXJFBEAgABBxCwsKACAAQRBqEDoaC8gIAwR8A38BfiMAQRBrIggkAAJAAkACQCAAvSIJQiCIpyIGQf////8HcSIHQfrUvYAETQRAIAZB//8/cUH7wyRGDQEgB0H8souABE0EQCAJQgBZBEAgASAARAAAQFT7Ifm/oCIARDFjYhphtNC9oCICOQMAIAEgACACoUQxY2IaYbTQvaA5AwhBASEGDAULIAEgAEQAAEBU+yH5P6AiAEQxY2IaYbTQPaAiAjkDACABIAAgAqFEMWNiGmG00D2gOQMIQX8hBgwECyAJQgBZBEAgASAARAAAQFT7IQnAoCIARDFjYhphtOC9oCICOQMAIAEgACACoUQxY2IaYbTgvaA5AwhBAiEGDAQLIAEgAEQAAEBU+yEJQKAiAEQxY2IaYbTgPaAiAjkDACABIAAgAqFEMWNiGmG04D2gOQMIQX4hBgwDCyAHQbuM8YAETQRAIAdBvPvXgARNBEAgB0H8ssuABEYNAiAJQgBZBEAgASAARAAAMH982RLAoCIARMqUk6eRDum9oCICOQMAIAEgACACoUTKlJOnkQ7pvaA5AwhBAyEGDAULIAEgAEQAADB/fNkSQKAiAETKlJOnkQ7pPaAiAjkDACABIAAgAqFEypSTp5EO6T2gOQMIQX0hBgwECyAHQfvD5IAERg0BIAlCAFkEQCABIABEAABAVPshGcCgIgBEMWNiGmG08L2gIgI5AwAgASAAIAKhRDFjYhphtPC9oDkDCEEEIQYMBAsgASAARAAAQFT7IRlAoCIARDFjYhphtPA9oCICOQMAIAEgACACoUQxY2IaYbTwPaA5AwhBfCEGDAMLIAdB+sPkiQRLDQELIABEg8jJbTBf5D+iRAAAAAAAADhDoEQAAAAAAAA4w6AiA/wCIQYCQCAAIANEAABAVPsh+b+ioCICIANEMWNiGmG00D2iIgShIgVEGC1EVPsh6b9jBEAgBkEBayEGIANEAAAAAAAA8L+gIgNEMWNiGmG00D2iIQQgACADRAAAQFT7Ifm/oqAhAgwBCyAFRBgtRFT7Iek/ZEUNACAGQQFqIQYgA0QAAAAAAADwP6AiA0QxY2IaYbTQPaIhBCAAIANEAABAVPsh+b+ioCECCyABIAIgBKEiADkDACAHQRR2IgcgAL1CNIinQf8PcWtBEU4EQAJAIAcgAiADRAAAYBphtNA9oiIAoSIFIANEc3ADLooZozuiIAIgBaEgAKGhIgShIgC9QjSIp0H/D3FrQTJIBEAgBSECDAELIAUgA0QAAAAuihmjO6IiAKEiAiADRMFJICWag3s5oiAFIAKhIAChoSIEoSEACyABIAA5AwALIAEgAiAAoSAEoTkDCAwBCyAHQYCAwP8HTwRAIAEgACAAoSIAOQMAIAEgADkDCEEAIQYMAQsgAEQYLURU+yH5PyAIQQxqEKUDIQAgAUIANwMIIAEgADkDACAIKAIMIQYLIAhBEGokACAGC48EAgZ/An0gAigCACEGIAACfwJAIAEoAgQiBEUNACABKAIAAn8gBEEBayAGcSAEaSIFQQFNDQAaIAYgBCAGSw0AGiAGIARwCyIHQQJ0aigCACICRQ0AIAIoAgAiAkUNACAEQQFrIQggBUEBSyEJA0ACQCAGIAIoAgQiBUcEQAJAIAlFBEAgBSAIcSEFDAELIAQgBUsNACAFIARwIQULIAUgB0cNAwwBCyACKAIIIAZHDQBBAAwDCyACKAIAIgINAAsLQRAQIyICIAY2AgQgAkEANgIAIAIgAygCADYCCCACIAMoAgQ2AgwCQEEAIAQgASgCDEEBarMiCiABKgIQIgsgBLOUXhsNACABIAQgBEEBa3FBAEcgBEEDSXIgBEEBdHIiAyAKIAuVjfwBIgcgAyAHSxsQcCABKAIEIgQgBEEBayIDcUUEQCADIAZxIQcMAQsgBCAGSwRAIAYhBwwBCyAGIARwIQcLAkAgASgCACIGIAdBAnRqIgcoAgAiA0UEQCACIAEoAgg2AgAgASACNgIIIAcgAUEIajYCACACKAIAIgNFDQEgAygCBCEFAkAgBCAEQQFrIgNxRQRAIAMgBXEhBQwBCyAEIAVLDQAgBSAEcCEFCyAGIAVBAnRqIAI2AgAMAQsgAiADKAIANgIAIAMgAjYCAAsgASABKAIMQQFqNgIMQQELOgAEIAAgAjYCAAuRAgEFfyMAQTBrIgIkACABIAAoAgQgACgCAGtBA3UQfSACQgA3AxggAkIANwMQIAJBgICA/AM2AiAgACgCBCAAKAIARgR/QQAFA0AgAiAAIAUQTyIDNgIMAkAgACgCACADQQN0aigCBEH/////B3FFBEAgAigCHCAEaiEDIARBAWohBAwBCyACQRBqIgYgAkEMahCiAiIDRQRAIAIgAigCHCAEaiIDNgIIIAIgAigCDDYCBCACQShqIAYgAkEEaiIGIAYQiwUMAQsgAygCDCEDCyABKAIAIAVBAnRqIAM2AgAgBUEBaiIFIAAoAgQgACgCAGtBA3VJDQALIAIoAhwgBGoLIAJBEGoQlQEgAkEwaiQAC6UBAQN/IwBBEGsiAiQAAkAgACgCBCIDIAAoAggiBE8EQCACIAEoAgg2AgggAiABKQIANwMAIAAgBEEBdEGAASAEGxA1IAAgACgCBCIBQQFqNgIEIAAoAgAgAUEMbGoiACACKAIINgIIIAAgAikDADcCAAwBCyAAIANBAWo2AgQgACgCACADQQxsaiIAIAEoAgg2AgggACABKQIANwIACyACQRBqJAALpAIBBX8jAEEgayIFJAACQAJAIAAoAgQiAiAAKAIIIgNJBEAgAiABEIYFQQxqIQEMAQsgAiAAKAIAIgRrQQxtIgZBAWoiAkHWqtWqAU8NASAFQQxqQdWq1aoBIAMgBGtBDG0iA0EBdCIEIAIgAiAESRsgA0Gq1arVAE8bIAYgABBhIgIoAgggARCGBRogAiACKAIIQQxqNgIIIAIoAgQgACgCBCAAKAIAIgNrIgFBdG1BDGxqIQQgAQRAIAQgAyAB/AoAAAsgACgCACEDIAAgBDYCACACIAM2AgQgACACKAIIIgE2AgQgAiADNgIIIAAoAgghBCAAIAIoAgw2AgggAiADNgIAIAIgBDYCDCACENUBCyAAIAE2AgQgBUEgaiQADwsQJgAL1hACF38LfCMAQdAAayIGJAACQAJAIAJEAAAAAAAAAABlRQRAIAEoAgQgASgCAEcNAQsgABDqAQwBCyAFRAAAAAAAAAAAIAUrAwAiHSAdRAAAAAAAAAAAYxsiJDkDACAFRAAAAAAAAAAAIAUrAwgiHSAdRAAAAAAAAAAAYxsiJTkDCEGoAhAjIghBoJACNgIAIAhCADcCBCAIQRBqEDshECAGQQA2AkggBkIANwJAIAZBADYCPCAGQgA3AjQgCEHYAGohDSABKAIAIgogASgCBCIRRwRAA0AgCigCACEFIAooAgQhDCAGQQA2AjAgBkIANwIoIAwgBWsgBSAMRwRAA0AgBSsDCCEdIAUrAwAhHgJ/IAgoAlwiCSAIKAJgIgtPBEAgDSALQQF0QYABIAsbEDMgCCgCWCAIKAJcIglBGGxqDAELIA0oAgAgCUEYbGoLIgsgHjkDACALQgA3AxAgCyAdOQMIIAggCUEBajYCXCAGIAUpAwg3AxggBiAFKQMANwMQIAYgBzYCICAHQQFqIQcgBkEoaiAGQRBqEMQBIAVBEGoiBSAMRw0ACwsgBkE0aiAGQShqEI4FIAYoAigiBQRAIAYgBTYCLCAGKAIwGiAFECILQQR1IA5qIQ4gCkEMaiIKIBFHDQALCyAkRAAAAAAAAAAAYSAlRAAAAAAAAAAAYXEhEyADQQFqIREgA0EATgRAIBG3ISZBASELA0AgBCALuCAmoyIdoiIeRAAAAAAAgFZAoCIfED4hISAeED4hIiAeED4hHiAfED4hHyABKAIAIgogASgCBCIZRwRAICFEAAAAAAAAAACiRAAAAAAAAPA/IB2hIiAgJSAdoqAiIyAioqAhJyAgICQgHaKgIiAgIaIgIkQAAAAAAAAAAKKgISEgIyAfoiAeRAAAAAAAAAAAoqEhIiAfRAAAAAAAAAAAoiAgIB6ioSEeIAIgHaIhHSALIA5sIRYgCyARRiATcSEaQQAhFEEAIRUDQEEAIQcgCigCBCIDIAooAgAiCUcEQCAUIBZqIRcgFSAWaiIbQQFrIRwgAyAJa0EEdSEHQQAhBQNAIAUgG2ohDyAcIAUgByAFG2ohEgJAIBoEQCAPIA5rIQkgBigCRCIDIAYoAkgiB08EQCAGQUBrIAdBAXRBgAEgBxsQNSAGIAYoAkQiA0EBajYCRCAGKAJAIANBDGxqIgcgFzYCAAwCCyAGIANBAWo2AkQgBigCQCADQQxsaiIHIBc2AgAMAQsgJyAJIAVBBHRqIgMrAwAiH6IgIiADKwMIIiCioCEjICEgH6IgHiAgoqAhHwJ/IAgoAlwiAyAIKAJgIgdPBEAgDSAHQQF0QYABIAcbEDMgCCgCWCAIKAJcIgNBGGxqDAELIA0oAgAgA0EYbGoLIgcgHzkDACAHIB05AxAgByAjOQMIIAggA0EBajYCXCAPIA5rIQkCQCAGKAJEIgwgBigCSCIDTwRAIAZBQGsgA0EBdEGAASADGxA1IAYoAkAiByAGKAJEIgxBDGxqIgMgCTYCCCADIBI2AgQgAyAPNgIAIAYoAkghAwwBCyAGKAJAIgcgDEEMbGoiGCAJNgIIIBggEjYCBCAYIA82AgALIAYgDEEBaiIPNgJEAn8gAyAPTQRAIAZBQGsgA0EBdEGAASADGxA1IAYgBigCRCIDQQFqNgJEIAYoAkAgA0EMbGoMAQsgBiAMQQJqNgJEIAcgD0EMbGoLIgcgEjYCAAsgByAJNgIIIAcgEiAOazYCBCAFQQFqIgUgCigCBCAKKAIAIglrQQR1IgdJDQALCyAHIBVqIRUgFEEBaiEUIApBDGoiCiAZRw0ACwsgCyARRiALQQFqIQtFDQALCwJAIBNFDQAgASgCBCIJIAEoAgAiA0YNACAIKAJcIQVBACEHA0ACQCAIKAJgIgogBU0EQCANIApBAXRBgAEgChsQMyAIKAJYIAgoAlwiBUEYbGoiA0IANwMIIANCADcDACADIAI5AxAgASgCACEDIAEoAgQhCQwBCyANKAIAIAVBGGxqIgpCADcDCCAKQgA3AwAgCiACOQMQCyAIIAVBAWoiBTYCXCAHQQFqIgcgCSADa0EMbUkNAAsLIAZBKGogBkE0akQAAAAAAADwv0EBEIgEIAYoAigiBSAGKAIsIgpHBEAgDiARbCEDIAYoAkQhBwNAIAUoAgQhCSAFKAIIIQ0gBSgCACEOAn8gBigCSCIBIAdNBEAgBkFAayABQQF0QYABIAEbEDUgBigCQCIMIAYoAkQiB0EMbGoMAQsgBigCQCIMIAdBDGxqCyIBIA42AgAgASAJNgIIIAEgDTYCBCAGIAdBAWoiATYCRAJAIBMEQCABIQcMAQsgBSgCCCADaiENIAUoAgQgA2ohDiAFKAIAIANqIQsCfyAGKAJIIgkgAU0EQCAGQUBrIAlBAXRBgAEgCRsQNSAGIAYoAkQiAUEBaiIHNgJEIAYoAkAgAUEMbGoMAQsgBiAHQQJqIgc2AkQgDCABQQxsagsiASALNgIAIAEgDTYCCCABIA42AgQLIAVBDGoiBSAKRw0ACwsgBkEANgIYIAZCADcCECAQIAZBQGsgBkEQahCeASAGKAIQIgEEQCABECILIBAQjgEgEBBYIBBBABCNASAQQQAQVCAQEFogBiAINgIMIAYgEDYCCCAIIAgoAgRBAWo2AgQgBiAGKQIINwMAIAAgBhBIGiAGKAIoIgAEQCAGIAA2AiwgBigCMBogABAiCyAGIAZBNGo2AhAgBkEQahApIAYoAkAiAARAIAAQIgsgCCAIKAIEIgBBAWs2AgQgAA0AIAggCCgCACgCCBEAACAIECQLIAZB0ABqJAAL9gUCBH8DfCMAQYACayIGJAACQAJAIAJEAAAAAAAAAABjIAFEAAAAAAAAAABlcg0AIAJEAAAAAAAAAABhBEAgA0QAAAAAAAAAAGUNASAGQeQBaiIHIAEgA0QAAAAAAAAAACAEQQEQkAUgBkIANwOwASAGQgA3A7gBIAZCgICAgICAgPg/NwPAASAGQgA3AyAgBkIANwMoIAZCgICAgICAgPg/NwMwIAZBzAFqIgQgByAGQSBqEJoEIAcgBBDBARogBBAoGiAFRQRAIAZCADcDmAEgBkIANwOgASAGQgA3AwggBkIANwMQIAYgAUQAAAAAAADgP6IiATkDqAEgBiABOQMYIAQgByAGQQhqEOkBIAcgBBDBARogBBAoGgsgACAGQeQBaiIAEI8CIAAQKBoMAgsgBEECTARAIAIgAxD6ARDCASEECyAGQYwBaiAEEJIDIQcgBEEASgRARAAAAAAAgHZAIAS3oyELA0AgCyAIuKIiCkQAAAAAAIBWQKAQPiEMIAoQPiEKIAcoAgAgCEEEdGoiCSACIAqiOQMIIAkgAiAMojkDACAIQQFqIgggBEcNAAsLIAZBzAFqIAcQPCEEIAZBADYC7AEgBkIANwLkASAGQeQBaiIIIAQgBEEMakEBEEcgBiADIAKjRAAAAAAAAPA/IANEAAAAAAAAAABmGyICOQOAASAGIAI5A3ggBiACOQNQIAYgAjkDWCAAIAggAUEARAAAAAAAAAAAIAZB0ABqEI8FIAYgCDYC/AEgBkH8AWoQKSAEKAIAIggEQCAEIAg2AgQgBCgCCBogCBAiCyAFBEAgBkIANwNgIAZCADcDaCAGQgA3AzggBkIANwNAIAYgAUQAAAAAAADgv6IiATkDcCAGIAE5A0ggBkHMAWoiBCAAIAZBOGoQ6QEgBkHkAWoiBSAEEI8CIAAgBRDBARogBRAoGiAEECgaCyAHKAIAIgBFDQEgByAANgIEIAcoAggaIAAQIgwBCyAAEOoBCyAGQYACaiQAC/QCAgF/A3wjAEHQAWsiAyQAAkACQAJAIAErAwAiBEQAAAAAAAAAAGMNACABKwMIIgVEAAAAAAAAAABjDQAgASsDECIGRAAAAAAAAAAAYw0AIAQgBKIgBSAFoqAgBiAGoqBEAAAAAAAAAABiDQELIAAQ6gEMAQsgA0IANwN4IANCADcDgAEgA0IANwOIASADQgA3A5gBIANCADcDoAEgA0IANwOoASADIAY5A7ABIAMgBkQAAAAAAADgv6JEAAAAAAAAAAAgAhs5A8gBIAMgBTkDkAEgAyAFRAAAAAAAAOC/okQAAAAAAAAAACACGzkDwAEgAyAEOQNwIAMgBEQAAAAAAADgv6JEAAAAAAAAAAAgAhs5A7gBQagCECMiAUGgkAI2AgAgAUIANwIEIANBCGoiAiADQfAAakHgAPwKAAAgAUEQakEBIAIQwAQhAiADIAE2AmwgAyACNgJoIAMgAykCaDcDACAAIAMQSBoLIANB0AFqJAAL0QEBAn8jAEHAAWsiAiQAQagCECMiA0GgkAI2AgAgA0IANwIEIAEoAgAhASACQgA3A2ggAkKAgICAgICA+D83A2AgAkIANwNwIAJCADcDeCACQgA3A4gBIAJCgICAgICAgPg/NwOAASACQgA3A5ABIAJCADcDmAEgAkIANwOoASACQoCAgICAgID4PzcDoAEgAkIANwOwASACQgA3A7gBIAIgAkHgAGpB4AD8CgAAIANBEGogASACEMAEIQEgACADNgIEIAAgATYCACACQcABaiQAC7IHAQl/IwBBkAFrIgUkAAJAAkAgA0UNACADLQAQQQFHDQBBqAIQIyIBQaCQAjYCACABQgA3AgQgAUEQahA7IQIgACABNgIEIAAgAjYCACACQQ4QLAwBCyAFIAEoAgA2AhAgBUEUaiABQQRqEGAaIAVBIGogAUEQahBgGiAFQSxqIAFBHGoQYBogBUE4aiABQShqEGAaIAVBxABqIAFBNGoQYBogBUHQAGogAUFAaxBgGiAFQdwAaiABQcwAahBgGiAFQegAaiIEQQA2AgggBEIANwIAIAEoAlwiBiABKAJYIghHBEAgBiAIayIGQQBIBEAQJgALIAQgBhAjIgc2AgQgBCAHNgIAIAQgBiAHajYCCCAEKAIEIQcgBgRAIAcgCCAG/AoAAAsgBCAGIAdqNgIECyAFQfQAaiABQeQAahBgIQQgBUGAAWogAUHwAGoQYBogBSABKgJ8OAKMASAEIAEoAhQgASgCEGtBAnVBA24QfSAEKAIAIgQgBSgCeCIGRwRAA0AgBCAJNgIAIAlBAWohCSAEQQRqIgQgBkcNAAsLQagCECMiBkGgkAI2AgAgBkIANwIEIAZBEGogBUEQaiADEJMDIQggACAGNgIEIAAgCDYCAAJAIAYoAlQNAEEAIQcjAEFAaiIAJAAgAEIANwMgIABCADcDGCAAQYCAgPwDNgIoIAgoAlxBA08EQANAIAgoAtgBIAdBBHRqKAIIIABBAjYCFCAAQoCAgIAQNwIMIAdBA2whCUEDbCEKQQAhBANAIAAgAEEMaiAEaigCACILIApqNgIIIAAgAEEIaiIMNgI0IABBOGogAEEYaiAMIABBNGoQ8QMgACgCOCAJIAtqNgIMIARBBGoiBEEMRw0ACyAHQQFqIgcgCCgCXEEDbkkNAAsLIAVBBGoiByACEDwiAigCACIEIAIoAgQiAkcEQANAIAAgBCgCADYCNCAAIABBNGoiCTYCOCAAQQxqIABBGGogCSAAQThqEPEDIAQgACgCDCgCDDYCACAEQRBqIgQgAkcNAAsLIABBGGoQlQEgAEFAayQAIAggByADEOkDIAUoAgQiAARAIAUgADYCCCAFKAIMGiAAECILIAYoAmwiAkEDbiEAIAJBA0kNACAGKALoASECQQAhBCABKAJoIAEoAmQiAWtBAnUgAEchAwNAIAIgBEEEdGoiBiADBH9BfwUgASAGKAIIQQJ0aigCAAs2AgggBEEBaiIEIABHDQALCyAFQRBqEKoBCyAFQZABaiQAC9ELAgZ/AXwjAEEgayIDJAAgABAaNgIEIABBnKACNgIAIwBBEGsiBCQAIAAoAgRBhw8QEiEGIwBBEGsiAiQAQeCeAi0AAEEBcUUEQEECQcCLAkEDEAYhBUHgngJBAToAAEHcngIgBTYCAAsgAiABKAIANgIIIAJBADYCBEHcngIoAgBBAEEAIAJBBGogAkEIahAFIQggAigCBCEFIAQgCPwDNgIMIARBnKACNgIIIAUEQCAFEAQLIAJBEGokACAGIAQoAgwQFSAEKAIMIgJBCU8EQCACEAELIAZBCU8EQCAGEAELIARBEGokACABKAIUIQIgAyABKAIQIgQ2AgwgAyACIARrQQJ1NgIIIANBEGogA0EIahCkASADQRhqIgIgAygCFEHeFhB3IABBsAogAhBtIAMoAhwiAkEJTwRAIAIQAQsgAygCFCICQQlPBEAgAhABCyABKAIIIQIgAyABKAIEIgQ2AgwgAyACIARrQQJ1NgIIIANBEGogA0EIahCNAiADQRhqIgIgAygCFEHeFhB3IABBpQwgAhBtIAMoAhwiAkEJTwRAIAIQAQsgAygCFCICQQlPBEAgAhABCyABKAIgIQIgAyABKAIcIgQ2AgwgAyACIARrQQJ1NgIIIANBEGogA0EIahCkASADQRhqIgIgAygCFEHeFhB3IABBpAkgAhBtIAMoAhwiAkEJTwRAIAIQAQsgAygCFCICQQlPBEAgAhABCyABKAIsIQIgAyABKAIoIgQ2AgwgAyACIARrQQJ1NgIIIANBEGogA0EIahCkASADQRhqIgIgAygCFEHeFhB3IABBkAkgAhBtIAMoAhwiAkEJTwRAIAIQAQsgAygCFCICQQlPBEAgAhABCyABKAI4IQIgAyABKAI0IgQ2AgwgAyACIARrQQJ1NgIIIANBEGogA0EIahCkASADQRhqIgIgAygCFEHeFhB3IABBtQggAhBtIAMoAhwiAkEJTwRAIAIQAQsgAygCFCICQQlPBEAgAhABCyABKAJEIQIgAyABKAJAIgQ2AgwgAyACIARrQQJ1NgIIIANBEGogA0EIahCkASADQRhqIgIgAygCFEHeFhB3IABBqxkgAhBtIAMoAhwiAkEJTwRAIAIQAQsgAygCFCICQQlPBEAgAhABCyABKAJoIQIgAyABKAJkIgQ2AgwgAyACIARrQQJ1NgIIIANBEGogA0EIahCkASADQRhqIgIgAygCFEHeFhB3IABBuRkgAhBtIAMoAhwiAkEJTwRAIAIQAQsgAygCFCICQQlPBEAgAhABCyABKAJ0IQIgAyABKAJwIgQ2AgwgAyACIARrQQJ1NgIIIANBEGogA0EIahCNAiADQRhqIgIgAygCFEHeFhB3IABBvwkgAhBtIAMoAhwiAkEJTwRAIAIQAQsgAygCFCICQQlPBEAgAhABCyABKAJQIQIgAyABKAJMIgQ2AgwgAyACIARrQQJ1NgIIIANBEGogA0EIahCNAiADQRhqIgIgAygCFEHeFhB3IABBhBAgAhBtIAMoAhwiAkEJTwRAIAIQAQsgAygCFCICQQlPBEAgAhABCyABKAJcIQIgAyABKAJYIgQ2AgwgAyACIARrNgIIIANBEGogA0EIahDfAyADQRhqIgIgAygCFEHeFhB3IABBnAwgAhBtIAMoAhwiAkEJTwRAIAIQAQsgAygCFCICQQlPBEAgAhABCyMAQRBrIgIkACAAKAIEQbUWEBIhBCMAQRBrIgAkAEGInwItAABBAXFFBEBBAkH8iwJBAxAGIQVBiJ8CQQE6AABBhJ8CIAU2AgALIAAgASoCfDgCCCAAQQA2AgRBhJ8CKAIAQQBBACAAQQRqIABBCGoQBSEIIAAoAgQhASACIAj8AzYCDCACQZygAjYCCCABBEAgARAECyAAQRBqJAAgBCACKAIMEBUgAigCDCIAQQlPBEAgABABCyAEQQlPBEAgBBABCyACQRBqJAAgA0EgaiQACwwAIAEgACgCBBEAAAuMAgIDfwF8IwBBEGsiAiQAIAJBCGoiAyABQfgQED8gAigCDCADEKoCIQMgAigCDCIEQQlPBEAgBBABCyAAQQA2AgggAEIANwIAIAAgAxDUASACIAAoAgA2AgQgAiADNgIAIwBBEGsiACQAQbCfAi0AAEEBcUUEQEECQaSMAkEDEAYhA0GwnwJBAToAAEGsnwIgAzYCAAsgACACKQIANwMIIABBADYCBEGsnwIoAgBBAEEAIABBBGogAEEIahAFIQUgACgCBCEDIAIgBfwDNgIMIAJBnKACNgIIIAMEQCADEAQLIABBEGokACACKAIMIAEoAgQQFCACKAIMIgBBCU8EQCAAEAELIAJBEGokAAs0AQJ/IwBBIGsiAyQAIANBCGoiBCABIAIgACgCABEDAEEYECMgBBAuIAQQKBogA0EgaiQACzIBAn9BDBAjIgFBADYCCCABQgA3AgAgASAAKAIAIgIgACgCBCIAIAAgAmtBDG0QRyABCzABAX8jAEFAaiIDJAAgAyABIAIgACgCABEDAEHAABAjIAMQQCADEEEaIANBQGskAAs9AQJ/IAAoAgQiAiAAKAIIIgFHBEAgACABIAIgAWtBH2pBYHFqNgIICyAAKAIAIgEEQCAAKAIMGiABECILCwsAIAAgAUEAEMUCCzgBAX8jAEEQayIDJAAgACgCACEAIAMgAikDCDcDCCADIAIpAwA3AwAgASADIAARAQAgA0EQaiQAC8ECAQV/IwBBIGsiBSQAAkACQCAAKAIEIgIgACgCCCIDSQRAIAIgASgCCDYCCCACIAEpAgA3AgAgAkEMaiEBDAELIAIgACgCACIEa0EMbSIGQQFqIgJB1qrVqgFPDQEgBUEMakHVqtWqASADIARrQQxtIgNBAXQiBCACIAIgBEkbIANBqtWq1QBPGyAGIAAQYSICKAIIIgMgASgCCDYCCCADIAEpAgA3AgAgAiACKAIIQQxqNgIIIAIoAgQgACgCBCAAKAIAIgNrIgFBdG1BDGxqIQQgAQRAIAQgAyAB/AoAAAsgACgCACEDIAAgBDYCACACIAM2AgQgACACKAIIIgE2AgQgAiADNgIIIAAoAgghBCAAIAIoAgw2AgggAiADNgIAIAIgBDYCDCACENYBCyAAIAE2AgQgBUEgaiQADwsQJgALaQEDf0EIEHQiA0H47gE2AgAgABCvAiICQQ1qECMiAUEANgIIIAEgAjYCBCABIAI2AgAgAUEMaiEBIAJBAWoiAgRAIAEgACAC/AoAAAsgAyABNgIEIANBqO8BNgIAIANBtO8BQe4CEAsAC1kBAX8jAEEgayIDJAAgACgCACEAIAMgAjYCBCADQZygAjYCACADQQhqIgIgASADIAARAwBBGBAjIAIQLiACECgaIAMoAgQiAEEJTwRAIAAQAQsgA0EgaiQAC/EDAEHk6QFBkxcQIUH06QFBkRBBAUEAECBBgOoBQbwOQQFBgH9B/wAQD0GY6gFBtQ5BAUGAf0H/ABAPQYzqAUGzDkEBQQBB/wEQD0Gk6gFB/ghBAkGAgH5B//8BEA9BsOoBQfUIQQJBAEH//wMQD0G86gFBuwlBBEGAgICAeEH/////BxAPQcjqAUGyCUEEQQBBfxAPQdTqAUGuEkEEQYCAgIB4Qf////8HEA9B4OoBQaUSQQRBAEF/EA9B7OoBQZsSQQhCgICAgICAgICAf0L///////////8AEBlB+OoBQZISQQhCAEJ/EBlBhOsBQZ0KQQQQGEGQ6wFBlhVBCBAYQdyIAkHNEhAfQYwgQQRBsxIQFkHUIEECQdkSEBZBoCFBBEHoEhAWQaDxARAeQewhQQBBnx0QB0GUIkEAQeQdEAdB9IsCQQFBvR0QB0G8IkECQewZEAdB5CJBA0GLGhAHQYwjQQRBsxoQB0HQiwJBBUHQGhAHQbQjQQRBiR4QB0HcI0EFQaceEAdBlCJBAEG2GxAHQfSLAkEBQZUbEAdBvCJBAkH4GxAHQeQiQQNB1hsQB0GMI0EEQf4cEAdB0IsCQQVB3BwQB0GEJEEIQbscEAdBrCRBCUGZHBAHQeSLAkEGQfYaEAdBrIwCQQdBzh4QBwsjACAAKAIAIAFBBHRqIgAgAikDCDcDCCAAIAIpAwA3AwBBAQtJACAAAn8gASgCBCABKAIAIgFrQQR1IAJLBEAgACABIAJBBHRqIgEpAwg3AwggACABKQMANwMAQQEMAQsgAEEAOgAAQQALOgAQCxAAIAAoAgQgACgCAGtBBHULngMBBX8CQCAAKAIEIAAoAgAiA2tBBHUiBCABSQRAIwBBIGsiBiQAAkACQCABIARrIgQgACgCCCIFIAAoAgQiA2tBBHVNBEAgACAEBH8gAyAEQQR0aiEAA0AgAyACKQMINwMIIAMgAikDADcDACADQRBqIgMgAEcNAAsgAAUgAws2AgQMAQsgAyAAKAIAIgNrQQR1IgcgBGoiAUGAgICAAU8NASAGQQxqQf////8AIAUgA2siA0EDdSIFIAEgASAFSRsgA0Hw////B08bIAcgABAyIgEoAggiAyAEQQR0aiEEA0AgAyACKQMINwMIIAMgAikDADcDACADQRBqIgMgBEcNAAsgASAENgIIIAEoAgQgACgCBCAAKAIAIgRrIgJrIQMgAgRAIAMgBCAC/AoAAAsgACgCACECIAAgAzYCACABIAI2AgQgACABKAIINgIEIAEgAjYCCCAAKAIIIQMgACABKAIMNgIIIAEgAjYCACABIAM2AgwgARA2CyAGQSBqJAAMAgsQJgALIAEgBEkEQCAAIAMgAUEEdGo2AgQLCwsIACAAIAEQTAsQACAAKAIEIAAoAgBrQRhtCxAAIAAoAgQgACgCAGtBDG0LEAAgACgCBCAAKAIAa0EGdQsoACABIAAoAgBqIgAgAikDEDcDECAAIAIpAwg3AwggACACKQMANwMACzQBAX8gACgCACECQRgQIyIAIAEgAmoiASkDEDcDECAAIAEpAwg3AwggACABKQMANwMAIAALDwAgASAAKAIAaiACNgIACw0AIAEgACgCAGooAgALLwECfyMAQSBrIgIkACACQQhqIgMgASAAEQEAQRgQIyADEC4gAxAoGiACQSBqJAALMwEDf0EEECMiAiABNgIAQZjxASAAQQNBACEAQfCHAiAAQfbcAGpBtgIgAkEAQQBBABAACwwAIAAQsAUaIAAQIgs3AQJ/IABB+O4BNgIAIAAoAgQiAkEEayIBIAEoAgBBAWsiATYCACABQQBIBEAgAkEMaxAiCyAAC8EEAQN/AkAgACABKAIIIAQQcwRAIAIgASgCBEcNASABKAIcQQFGDQEgASADNgIcDwsCQCAAIAEoAgAgBBBzBEACQCABKAIQIAJHBEAgAiABKAIURw0BCyADQQFHDQMgAUEBNgIgDwsgASADNgIgIAEoAixBBEYNASAAQRBqIgUgACgCDEEDdGohB0EAIQMDQAJAAkAgAQJ/AkAgBSAHTw0AIAFBADsBNCAFIAEgAiACQQEgBBCeAyABLQA2DQAgAS0ANUEBRw0DIAEtADRBAUYEQCABKAIYQQFGDQNBASEDQQEhBiAALQAIQQJxRQ0DDAQLQQEhAyAALQAIQQFxDQNBAwwBC0EDQQQgAxsLNgIsIAYNBQwECyABQQM2AiwMBAsgBUEIaiEFDAALAAsgACgCDCEFIABBEGoiBiABIAIgAyAEEKsCIAVBAkkNASAGIAVBA3RqIQYgAEEYaiEFAkAgACgCCCIAQQJxRQRAIAEoAiRBAUcNAQsDQCABLQA2DQMgBSABIAIgAyAEEKsCIAVBCGoiBSAGSQ0ACwwCCyAAQQFxRQRAA0AgAS0ANg0DIAEoAiRBAUYNAyAFIAEgAiADIAQQqwIgBUEIaiIFIAZJDQAMAwsACwNAIAEtADYNAiABKAIkQQFGBEAgASgCGEEBRg0DCyAFIAEgAiADIAQQqwIgBUEIaiIFIAZJDQALDAELIAEgAjYCFCABIAEoAihBAWo2AiggASgCJEEBRw0AIAEoAhhBAkcNACABQQE6ADYLC8sEAQV/IwBBQGoiBSQAAkACQAJAIAEoAgRB7ukBRgRAIAJBADYCAAwBCwJAIAAgASAALQAIQRhxBH9BAQUgAUUNASABQcTnARBiIgZFDQEgBi0ACEEYcUEARwsQcyEDCyADBEBBASEEIAIoAgAiAEUNAyACIAAoAgA2AgAMAwsgAUH05wEQYiIDRQ0CQQAhASACKAIAIgYEQCACIAYoAgAiATYCAAsgAygCCCIHIAAoAggiBkF/c3FBB3EgB0F/cyAGcUHgAHFyDQIgACgCDCIHKAIEIgQgAygCDCIAKAIERw0BC0EBIQQMAQsgBEHs6QFGBEAgAEGk6AEQYkUhBAwBC0EAIQQgB0H05wEQYiIDBEAgBkEBcUUNAQJ/IAMhAUEAIQICQANAQQAgAEUNAhogAEH05wEQYiIARQ0BIAAoAgggASgCCCIEQX9zcQ0BQQEgASgCDCIDKAIEIAAoAgwiACgCBEYNAhogBEEBcUUNASADQfTnARBiIgENAAsgA0HY6AEQYiIBRQ0AIAEgABCfAyECCyACCyEEDAELIAdB2OgBEGIiAwRAIAZBAXFFDQEgAyAAEJ8DIQQMAQsgB0GU5wEQYiIDRQ0AIABBlOcBEGIiAEUNACAFQQhqQQBBOPwLACAFIAFBAEc6ADsgBUF/NgIQIAUgAzYCDCAFIAA2AgQgBUEBNgI0IAAgBUEEaiABQQEgACgCACgCHBEFACAFKAIcIgBBAUYEQCACIAUoAhRBACABGzYCAAsgAEEBRiEECyAFQUBrJAAgBAtyAQJ/IAAoAgQgASgCCCgCBEYEQCABIAIgAxCtAg8LIAAoAgwhBCAAQRBqIgUgASACIAMQoAMCQCAEQQJJDQAgBSAEQQN0aiEEIABBGGohAANAIAAgASACIAMQoAMgAS0ANg0BIABBCGoiACAESQ0ACwsLNQAgACgCBCABKAIIKAIERgRAIAEgAiADEK0CDwsgACgCCCIAIAEgAiADIAAoAgAoAhwRBQALHAAgACgCBCABKAIIKAIERgRAIAEgAiADEK0CCwvEAQECfyMAQdAAayIDJAACQAJ/QQEgACgCBCABKAIERg0AGkEAIAFBlOcBEGIiAUUNABogAigCACIERQ0BIANBGGpBAEE4/AsAIANBAToASyADQX82AiAgAyAANgIcIAMgATYCFCADQQE2AkQgASADQRRqIARBASABKAIAKAIcEQUAIAMoAiwiAEEBRgRAIAIgAygCJDYCAAsgAEEBRgsgA0HQAGokAA8LIANByBk2AgggA0HnAzYCBCADQccONgIAEK4CAAsFAEHkDQsrAQF/IwBBQGoiAiQAIAIgASAAEQEAQcAAECMgAhBAIAIQQRogAkFAayQACwUAQZsQCy0BAX8jAEFAaiIDJAAgAyABIAIgABEWAEHAABAjIAMQQCADEEEaIANBQGskAAsEAEEAC0gBAX8jAEHQAGsiAyQAIAMgASkDADcDACADIAEpAwg3AwggA0EQaiIBIAMgAiAAEQMAQcAAECMgARBAIAEQQRogA0HQAGokAAsEAEEAC1UBAn8jAEFAaiICJAAgASAAKAIEIgNBAXVqIQEgACgCACEAIAIgASADQQFxBH8gASgCACAAaigCAAUgAAsRAQBBwAAQIyACEEAgAhBBGiACQUBrJAALdQECfyMAQSBrIgIkACABIAAoAgQiA0EBdWohASAAKAIAIQAgAiABIANBAXEEfyABKAIAIABqKAIABSAACxEBAEEgECMiACACKQMYNwMYIAAgAikDEDcDECAAIAIpAwg3AwggACACKQMANwMAIAJBIGokACAAC7oBAQN/IwBBEGsiAyQAIAAoAgAhAiADIAEgACgCBCIAQQF1aiIBIABBAXEEfyABKAIAIAJqKAIABSACCxEBAEEMECMiAEEANgIIIABCADcCACADKAIEIgIhBCACIAMoAgAiAWtBBnUiAgRAIAAgAhCVAyAAKAIEIQIgASAERwRAA0AgAiABEEBBQGshAiABQUBrIgEgBEcNAAsLIAAgAjYCBAsgAyADNgIMIANBDGoQmAMgA0EQaiQAIAALVwECfyMAQUBqIgMkACABIAAoAgQiBEEBdWohASAAKAIAIQAgAyABIAIgBEEBcQR/IAEoAgAgAGooAgAFIAALEQsAQcAAECMgAxBAIAMQQRogA0FAayQACwsAIAAQaRogABAiC3MBAn8jAEHQAGsiAyQAIAEgACgCBCIEQQF1aiEBIAAoAgAhACAEQQFxBEAgASgCACAAaigCACEACyADIAIpAwg3AwggAyACKQMANwMAIANBEGoiAiABIAMgABEDAEHAABAjIAIQQCACEEEaIANB0ABqJAALJAECfiAAKQMAIAEpAwBTIAApAwgiAiABKQMIIgNVIAIgA1EbCwYAQYCcAgsUACAAQQRqQQAgASgCBEGhmAFGGwtPAQJ/AkAgASgCBCICBEAgASgCACIBIAJBBHRqIQMDQCAAKAIEKAIQIgJFDQIgAiABIAIoAgAoAhgRAQAgAUEQaiIBIANHDQALCw8LEGYACxUAIAFByJsCNgIAIAEgACgCBDYCBAsdAQF/QQgQIyIBQcibAjYCACABIAAoAgQ2AgQgAQsQACAAKAIMIAAoAghrQQJ1CwoAIABBCGoQhAILZwEDfyAAKAIEIgMgACgCCCIBRwRAA0AgACABQQRrIgE2AgggASgCACECIAFBADYCACACBEAgAiACKAIAKAIEEQAAIAAoAgghAQsgASADRw0ACwsgACgCACIBBEAgACgCDBogARAiCwviBAMGfwF8AX4jAEEgayIGJAACf0EwECMhAyMAQSBrIgIkACADQQA2AiggA0IANwMgIANBADYCECADQgA3AwggAyAANgIEIANBmJsCNgIAAkACQCAARQRAIANCgICAgICAgPg/NwMYIAJBADYCDCACQgA3AgREAAAAAAAA8D8hCAwBCyADIAArAxgiCDkDGCACQQA2AgwgAkIANwIEIAhEAAAAAAAAAABhDQELIAJBBGogASgCBCABKAIAa0EEdRBcIAEoAgAiBCABKAIEIgFHBEADQCAEKQMAIQkgAiAIIAQpAwi5ojkDGCACIAggCbmiOQMQIAJBBGogAkEQahBMIARBEGoiBCABRw0ACwsgA0EgahBFIAMgAigCBDYCICADIAIoAgg2AiQgAyACKAIMNgIoIAJBIGokACADDAELQQIQggIACyEDAkACQCAAKAIMIgEgACgCECICSQRAIAEgAzYCACABQQRqIQMMAQsgASAAQQhqIgQoAgAiBWtBAnUiB0EBaiIBQYCAgIAETw0BIAZBDGpB/////wMgAiAFayICQQF1IgUgASABIAVJGyACQfz///8HTxsgByAEEEoiASgCCCICIAM2AgAgASACQQRqNgIIIAEoAgQgACgCDCAAKAIIIgJrIgNrIQQgAwRAIAQgAiAD/AoAAAsgACgCCCECIAAgBDYCCCABIAI2AgQgACABKAIIIgM2AgwgASACNgIIIAAoAhAhBCAAIAEoAgw2AhAgASACNgIAIAEgBDYCDCABEMwFCyAAIAM2AgwgA0EEaygCACAGQSBqJAAPCxAmAAsJACAAEIMCECILcQEDfyMAQeAAayIDJAAgA0EANgIUIANCADcCDCADQQxqIgQgASgCACIFIAEoAgQiASABIAVrQQxtEEcgA0EYaiIBIAQgAiAAEQMAQcAAECMgARC0ASABEEEaIAMgBDYCXCADQdwAahApIANB4ABqJAALFQAgACgCBCAAQQRqIAAsAA9BAEgbCycAIABB6JoCNgIAIAAsAA9BAEgEQCAAKAIMGiAAKAIEECILIAAQIgslACAAQeiaAjYCACAALAAPQQBIBEAgACgCDBogACgCBBAiCyAACyUBAX8jAEEQayIBJAAgASAAQQxqNgIMIAFBDGoQKSABQRBqJAALDwAgAEG0mgI2AgAgABAiCw0AIABBtJoCNgIAIAALDQAgAARAIAAQQRAiCwuvAQICfwR8IwBBMGsiAiQAIAJBCGogARBNIAJBEGogAigCCBDHAwJAIAIoAgwiAUUNACABIAEoAgQiA0EBazYCBCADDQAgASABKAIAKAIIEQAAIAEQJAsgAisDECEEIAIrAyAhBSAAIAIrAxgiBiACKwMoIgcgBiAHZCIBGzkDGCAAIAUgBCAEIAVjIgMbOQMQIAAgByAGIAEbOQMIIAAgBCAFIAMbOQMAIAJBMGokAAteAQR/IwBBEGsiASQAIAFBCGogABBNIAEoAggiACgCBCAAKAIAAkAgASgCDCIARQ0AIAAgACgCBCIEQQFrNgIEIAQNACAAIAAoAgAoAggRAAAgABAkCyABQRBqJABGC7oCAgJ8Bn8jAEEQayIEJAAgBEEIaiAAEE0gBCgCCCIAKAIAIgUgACgCBCIIRwRAA0BEAAAAAAAAAAAhASACIAUoAgQiBiAFKAIAIgBrIgdBIU8EfAJAIAZBEGsiAyAGIAdBEHEiBhsiByAARgRADAELIAMrAwAhAgNAIAEgAysDCCAAKwMIIgGgIAIgACsDACICoaKgIAEgACsDGKAgAiAAKwMQIgKhoqAhASAAQRBqIQMgAEEgaiIAIAdHDQALCyAGBHwgASADKwMIIAArAwigIAMrAwAgACsDAKGioAUgAQtEAAAAAAAA4D+iBSABC6AhAiAFQQxqIgUgCEcNAAsLAkAgBCgCDCIARQ0AIAAgACgCBCIDQQFrNgIEIAMNACAAIAAoAgAoAggRAAAgABAkCyAEQRBqJAAgAgujAQEDfyMAQTBrIgIkACACQQxqIgMgARDKAyACQQA2AiAgAkIANwIYIAJBGGoiASADIAFBARBHQRgQIyIDQbSaAjYCACADQgA3AgQgA0EMaiIEIAEQWyACIAM2AiggAiAENgIkIAIgAikCJDcDACAAIAIQaiACIAE2AiwgAkEsahApIAIoAgwiAARAIAIgADYCECACKAIUGiAAECILIAJBMGokAAveBQIJfwF8IwBB0ABrIgYkACAGIAEQQBogBkEANgJIIAZCADcCQCAGQUBrIgFBARCVAyABKAIEIQMgASAGIgJHBEADQCADIAIQQBogA0FAayEDIAJBQGsiAiABRw0ACwsgASADNgIEIwBBkAFrIgIkACABKAIAIgMgASgCBCIHRwRAA0AgAkHQAGoiBCADEEAaIAQQywMgBWohBSAEEEEaIANBQGsiAyAHRw0ACwsgAkEANgJMIAJCADcCRCACQcQAaiAFEFwgASgCACIFIAEoAgQiB0cEQANAIAJB0ABqIgMgBRBAGiACQRhqIAMQTSACQQA2AkAgAkIANwI4IAJBOGogAigCGCIDKAIAIgQgAygCBCIDIAMgBGtBDG0QRwJAIAIoAhwiA0UNACADIAMoAgQiBEEBazYCBCAEDQAgAyADKAIAKAIIEQAAIAMQJAsgAigCOCIEIAIoAjwiCEcEQANAIAJBLGogBBA8IgkoAgAiAyACKAIwIgpHBEADQCADKwMAIQsgAiADKwMIOQMgIAIgCzkDGCACQcQAaiACQRhqEEwgA0EQaiIDIApHDQALIAkoAgAhAwsgAwRAIAIgAzYCMCACKAI0GiADECILIARBDGoiBCAIRw0ACwsgAiACQThqNgIYIAJBGGoQKSACQdAAahBBGiAFQUBrIgUgB0cNAAsLIAJBGGoiAyACQcQAahDKAyACQQA2AlggAkIANwJQIAJB0ABqIgUgAyACQSRqQQEQR0EYECMiA0G0mgI2AgAgA0IANwIEIANBDGoiBCAFEFsgAiADNgIUIAIgBDYCECACIAIpAhA3AwggACACQQhqEGogAiAFNgI4IAJBOGoQKSACKAIYIgAEQCACIAA2AhwgAigCIBogABAiCyACKAJEIgAEQCACIAA2AkggAigCTBogABAiCyACQZABaiQAIAYgATYCTCAGQcwAahCYAyAGEEEaIAZB0ABqJAALJAECfCAAKwMIIAErAwhjIAArAwAiAiABKwMAIgNjIAIgA2EbCwYAQfz9AQvZGgIRfwd8IwBBkAJrIgQkACAEQQA2AlggBEIANwNQIARCADcCPCAEQgA3AjQgBEKAgICAgICA+D83A0ggBEGYmwI2AjAgBEEYaiABEE0gBCgCGCEBIARBADYCLCAEQgA3AiQgBEE4ahCEAiAEQfgAakEAQegA/AsAIARCADcDcCAEQQI2AmwgBEIANwJkIARB/ABqQQBBMPwLACAEQbABakEAQST8CwAgBEEANgLoASAEQgA3A+ABIARBAToA3QEgBEEBOgDUASAEQoCAgICAgICgPjcD+AEgBEKAgICAgICA0MEANwPwASAEQfyaAjYCYCAEQeAAaiIGIAEQmwEgBiAEQSRqIgUQ4QEgBEEANgKIAiAEQgA3AoACIAYgBEEwaiAEQYACaiIBEM0DIAQgATYCjAIgBEGMAmoQKSAGEGkaIAQgBTYCYCAGECkCQCAEKAIcIgVFDQAgBSAFKAIEIgFBAWs2AgQgAQ0AIAUgBSgCACgCCBEAACAFECQLIARBADYCiAIgBEIANwKAAiAEQTBqIARBgAJqEMwDIARBADYCLCAEQgA3AiQgBCgCgAIiByAEKAKEAiIJRwRAA0AgBEHgAGogBxA8IQxEAAAAAAAAAAAhFCAEKAJkIgogDCgCACIDayIBQSFPBEACQCAKQRBrIgUgCiABQRBxIggbIgYgA0YEQEQAAAAAAAAAACEWIAMhAQwBCyAFKwMAIRhEAAAAAAAAAAAhFiADIQEDQCAWIAUrAwggASsDCCIWoCAYIAErAwAiFKGioCAWIAErAxigIBQgASsDECIYoaKgIRYgAUEQaiEFIAFBIGoiASAGRw0ACwsgCAR8IBYgBSsDCCABKwMIoCAFKwMAIAErAwChoqAFIBYLRAAAAAAAAOA/opkhFAtEAAAAAAAA8H8hGkQAAAAAAADw/yEYRAAAAAAAAPD/IRZEAAAAAAAA8P8hGUQAAAAAAADwfyEVIAogAyIBRwRAA0AgASsDCCIXIBggFyAYZBshGCABKwMAIhYgGSAWIBlkGyEZIBogFyAXIBpkGyEaIBUgFiAVIBZjGyEVIAFBEGoiASAKRw0ACyAYIBqhIRYgGSAVoSEYCyACIBYgGCAWIBhkG6IgFGMEQCAEQSRqIAwQdiAMKAIAIQMLIAMEQCAEIAM2AmQgBCgCaBogAxAiCyAHQQxqIgcgCUcNAAsgBCgCKCAEKAIka0EMbSEDCyAEQQA2AiAgBEIANwIYIARBGGogAxBWIAQoAiQiASAEKAIoIhNHBEADQCAEQeAAaiELIwBBMGsiDSQAAkAgASgCBCABKAIAayIGQQR1Ig9BA00EQCALIAEQPBoMAQsjAEEQayIJJAAgDUEQaiIKQQA2AgggCkIANwIAAkAgD0UNACAKIA8QyQQgCigCACEFIAkgCigCBCIDQR9xNgIMIAkgBSADQQN2Qfz///8BcWo2AgggCUEIaiAPEMgEIAogCigCBCAPaiIDNgIEIANBH3EiBUUNAEEgIAVrIQggCigCACADQQN2Qfz///8BcWohBwNAIAcgBygCAEF+IAV3cTYCAEEAIAVBAWogBUEfRiIDGyEFIAdBBEEAIAMbaiEHIAhBAWsiCA0ACwsgCUEQaiQAIA1BBGogDxCWASESAnwgASgCACIHKwMYIAcgD0EBayIMQQR0aiIFKwMIIhahIRUgEigCACIQIAcrAxAgBSsDACIUoSIXRAAAAAAAAAAAYSAVRAAAAAAAAAAAYXEEfEQAAAAAAAAAAAUgFSAHKwMAIBShoiAXIAcrAwggFqGioSIUIBSiIBcgF6IgFSAVoqCjCzkDACAGIAdqIgNBGGsrAwAgBysDCCIWoSEVRAAAAAAAAAAAIANBIGsrAwAgBysDACIUoSIXRAAAAAAAAAAAYSAVRAAAAAAAAAAAYXENABogFSAFKwMAIBShoiAXIAUrAwggFqGioSIUIBSiIBcgF6IgFSAVoqCjCyEUIBAgDEEDdGogFDkDACAMQQJPBEAgASgCACEHQQEhAwNAIAcgA0EBaiIFQQR0aiIGKwMIIAcgA0EEdGoiCEEIaysDACIWoSEVIBAgA0EDdGoCfCAGKwMAIAhBEGsrAwAiFKEiF0QAAAAAAAAAAGEEQEQAAAAAAAAAACAVRAAAAAAAAAAAYQ0BGgsgFSAIKwMAIBShoiAXIAgrAwggFqGioSIUIBSiIBcgF6IgFSAVoqCjCzkDACAFIgMgDEcNAAsLIAIgAqIhFyABKAIAIREgCigCACEOQQAhBQNAAkACQAJAIBAgBUEDdGorAwAiGCAXZEUEQCAFIQMMAQsgCigCACEGIAUhAwNAQQAhBwJAIAwgA0EBaiIDTwRAIAYgA0EDdkH8////AXFqKAIAIAN2QQFxDQIMAQsDQCAHIgNBAWohByAGIANBA3ZB/P///wFxaigCACADdkEBcQ0ACwsgAyAFRg0CIBAgA0EDdGorAwAiGCAXZA0ACwtBACEHAkAgA0EBayAMIAMbIgZFDQADQCAOIAZBA3ZB/P///wFxaigCACAGdkEBcUUEQCAGIQcMAgsgBkEBayIGDQALCyAMIQYgDiAHQQN2Qfz///8BcWooAgAgB3ZBAXEEQANAIAYiB0EBayEGIA4gB0EDdkH8////AXFqKAIAIAd2QQFxDQALCyADIQUDQAJAIAwgBUEBaiIFSQRAQQAhBgNAIAYiBUEBaiEGIA4gBUEDdkH8////AXFqKAIAIAV2QQFxDQALDAELIA4gBUEDdkH8////AXFqKAIAIAV2QQFxDQELCyAFIAdGDQACQCAYIBAgBSIGQQN0aisDAGQEQANAIAwgBkEBaiIGSQRAQQAhCANAIAgiBkEBaiEIIA4gBkEDdkH8////AXFqKAIAIAZ2QQFxDQALIAMhCSAFIQMgBiEFIAchCAwDCyAOIAZBA3ZB/P///wFxaigCACAGdkEBcQ0ACyADIQkgBSEDIAYhBSAHIQgMAQtBACEIAkAgB0EBayAMIAcbIgZFDQADQCAOIAZBA3ZB/P///wFxaigCACAGdkEBcUUEQCAGIQgMAgsgBkEBayIGDQALCyAMIQYgDiAIQQN2Qfz///8BcWooAgAgCHZBAXEEQANAIAYiCEEBayEGIA4gCEEDdkH8////AXFqKAIAIAh2QQFxDQALCyAHIQkLIA4gA0EDdkH8////AXFqIgYgBigCAEEBIAN0cjYCACAKKAIAIQYgBSEDA0AgDCADQQFqIgNJBEBBACEHA0AgByIDQQFqIQcgBiADQQN2Qfz///8BcWooAgAgA3ZBAXENAAsMAwsgBiADQQN2Qfz///8BcWooAgAgA3ZBAXENAAsMAQtBACEDIAtBADYCCCALQgA3AgAgCyAPEFwCQANAIAooAgAgA0EDdkH8////AXFqKAIAIAN2QQFxRQRAIAEoAgAgA0EEdGohCQJAIAsoAgQiBSALKAIIIgZJBEAgBSAJKQMINwMIIAUgCSkDADcDACAFQRBqIQcMAQsgBSALKAIAIgVrQQR1IgdBAWoiCEGAgICAAU8NAyANQRxqQf////8AIAYgBWsiBkEDdSIFIAggBSAISxsgBkHw////B08bIAcgCxAyIQggDSgCJCIFIAkpAwg3AwggBSAJKQMANwMAIA0gDSgCJEEQajYCJCANKAIgIAsoAgQgCygCACIFayIHayEGIAcEQCAGIAUgB/wKAAALIAsoAgAhCSALIAY2AgAgDSAJNgIgIAsgDSgCJCIHNgIEIA0gCTYCJCALKAIIIQUgCyANKAIoNgIIIA0gBTYCKCAIIAk2AgAgCBA2CyALIAc2AgQLIANBAWoiAyAPRw0ACyASKAIAIgMEQCASIAM2AgQgEigCCBogAxAiCyAKKAIAIgNFDQMgCigCCBogAxAiDAMLECYACyARIANBBHRqIgYrAwggESAJQQR0aiIDKwMIIhahIRkgECAFQQN0aiAGKwMAIAMrAwAiFKEiFUQAAAAAAAAAAGEgGUQAAAAAAAAAAGFxBHxEAAAAAAAAAAAFIBkgESAFQQR0aiIDKwMAIBShoiAVIAMrAwggFqGioSIUIBSiIBUgFaIgGSAZoqCjCzkDACARIAVBBHRqIgYrAwggESAIQQR0aiIDKwMIIhahIRkgECAJQQN0aiAGKwMAIAMrAwAiFKEiFUQAAAAAAAAAAGEgGUQAAAAAAAAAAGFxBHxEAAAAAAAAAAAFIBkgESAJQQR0aiIDKwMAIBShoiAVIAMrAwggFqGioSIUIBSiIBUgFaIgGSAZoqCjCzkDAAwACwALIA1BMGokACAEQRhqIAsQaCAEKAJgIgMEQCAEIAM2AmQgBCgCaBogAxAiCyABQQxqIgEgE0cNAAsLQRgQIyIFQbSaAjYCACAFQgA3AgQgBUEMaiIDIARBGGoiARBbIAQgBTYCFCAEIAM2AhAgBCAEKQIQNwMIIAAgBEEIahBqIAQgATYCYCAEQeAAaiIAECkgBCAEQSRqNgJgIAAQKSAEIARBgAJqNgJgIAAQKSAEQTBqEIMCGiAEQZACaiQAC7wBAgR8AX8jAEEwayIHJAACQCACKwMAIgQgBKIgAisDCCIDIAOioCIFRAAAAAAAAAAAYQRAIAAQ4wEMAQsgB0IANwMgIAdCADcDKCAHRAAAAAAAAPA/IAMgBZ8iBaMiAyADoiIGIAagoTkDGCAHRAAAAAAAAAAAIAQgBaMiBCADoiIDIAOgoSIDOQMQIAcgAzkDCCAHRAAAAAAAAPA/IAQgBKIiBCAEoKE5AwAgACABIAcQ4AELIAdBMGokAAtXAgF/AnwjAEEwayIDJAAgAisDCCEEIAIrAwAhBSADQgA3AwggAyAFOQMAIANCADcDECADQgA3AyAgAyAEOQMYIANCADcDKCAAIAEgAxDgASADQTBqJAALYAIBfwF8IwBBMGsiAyQAIAIQPiEEIAJEAAAAAACAVkCgED4hAiADQgA3AyAgAyACOQMYIAMgBJo5AxAgAyAEOQMIIAMgAjkDACADQgA3AyggACABIAMQ4AEgA0EwaiQAC2cCAX8CfCMAQTBrIgMkACACKwMAIQQgAisDCCEFIANCADcDCCADQoCAgICAgID4PzcDACADQgA3AxAgAyAFOQMoIAMgBDkDICADQoCAgICAgID4PzcDGCAAIAEgAxDgASADQTBqJAALhwgBBX8jAEGQAmsiAiQAAkACQCABEM4DQQFNBEAgAkHYAGoiAyABEEAaIABBwAAQIyIBNgIAIAAgAUFAayIENgIIIAEgAxBAGiAAIAQ2AgQgAxBBGgwBCyACQQA2AlAgAkIANwNIIAJCADcCNCACQgA3AiwgAkKAgICAgICA+D83A0AgAkGYmwI2AiggAkEgaiABEE0gAigCICEDIAJBADYCHCACQgA3AhQgAkEwahCEAiACQfAAakEAQegA/AsAIAJCADcDaCACQQI2AmQgAkIANwJcIAJB9ABqQQBBMPwLACACQagBakEAQST8CwAgAkEANgLgASACQgA3A9gBIAJBAToA1QEgAkEBOgDMASACQoCAgICAgICgPjcD8AEgAkKAgICAgICA0MEANwPoASACQfyaAjYCWCACQdgAaiIBIAMQmwEgASACQRRqIgMQ4QEgAkEANgKEAiACQgA3AvwBIAEgAkEoaiACQfwBaiIEEM0DIAIgBDYC+AEgAkH4AWoQKSABEGkaIAIgAzYCWCABECkCQCACKAIkIgFFDQAgASABKAIEIgNBAWs2AgQgAw0AIAEgASgCACgCCBEAACABECQLIAJBADYCHCACQgA3AhQgAkEoaiACQRRqQQAQxAIgAEEANgIIIABCADcCACACKAIYIAIoAhRrQQxtIQEjAEEgayIDJAACQAJAIAAoAgggACgCACIEa0EGdSABSQRAIAFBgICAIE8NASAAIANBDGogASAAKAIEIARrQQZ1IAAQqQEiARCnAiABEKYCCyADQSBqJAAMAQsQJgALIAIoAhgiAyACKAIURwRAA0BBGBAjIgFBtJoCNgIAIAFCADcCBCABQQxqIgQgA0EMayIDEFsgAiABNgIQIAIgBDYCDCACIAIpAgw3AwAgAkHYAGoiBCACEGoCQCAAKAIEIgEgACgCCCIFSQRAIAEgBBC0ARogAUFAayEBDAELIAEgACgCACIEa0EGdSIGQQFqIgFBgICAIE8NBCACQfwBakH///8fIAUgBGsiBEEFdSIFIAEgASAFSRsgBEHA////B08bIAYgABCpASEEIAIoAoQCIAJB2ABqELQBGiACIAIoAoQCQUBrNgKEAiAAIAQQpwIgACgCBCEBIAQQpgILIAAgATYCBCACQdgAahBBGiADIAIoAhRHDQALCyACIAJBFGo2AlgjAEEQayIFJAAgAigCWCIBKAIAIgAEQCAAIQMgASEEIAEoAgQiBiAARwRAA0AgBSAGQQxrIgY2AgwgBUEMahApIAAgBkcNAAsgAigCWCIEKAIAIQMLIAEgADYCBCAEKAIIGiADECILIAVBEGokACACQShqEIMCGgsgAkGQAmokAA8LECYAC9oCAgV/A3wjAEFAaiIDJAACQCABRAAAAAAAAAAAZQRAIAAQ4wEMAQsgAkECTARAIAEQwgEhAgsgA0EwaiACEJIDIQUgAkEASgRARAAAAAAAgHZAIAK3oyEJA0AgCSAEuKIiCEQAAAAAAIBWQKAQPiEKIAgQPiEIIAUoAgAgBEEEdGoiBiABIAiiOQMIIAYgASAKojkDACAEQQFqIgQgAkcNAAsLIANBEGogBRA8IQIgA0EANgIkIANCADcCHCADQRxqIgYgAiACQQxqQQEQR0EYECMiBEG0mgI2AgAgBEIANwIEIARBDGoiByAGEFsgAyAENgIsIAMgBzYCKCADIAMpAig3AwggACADQQhqEGogAyAGNgI8IANBPGoQKSACKAIAIgAEQCACIAA2AgQgAigCCBogABAiCyAFKAIAIgBFDQAgBSAANgIEIAUoAggaIAAQIgsgA0FAayQAC5MDAgN/BHwjAEFAaiIDJAACQAJAAkAgASsDACIGRAAAAAAAAAAAYw0AIAErAwgiB0QAAAAAAAAAAGMNACAGIAaiIAcgB6KgRAAAAAAAAAAAYg0BCyAAEOMBDAELIANBwAAQIyIBNgIwIAMgAUFAayIENgI4IAMgBDYCNCACBEAgB0QAAAAAAADgP6IiCJohByAGRAAAAAAAAOA/oiIJmiEGCyABIAc5AzggASAJOQMwIAEgBzkDKCABIAY5AyAgASAIOQMYIAEgBjkDECABIAg5AwggASAJOQMAIANBEGogA0EwahA8IQEgA0EANgIkIANCADcCHCADQRxqIgQgASABQQxqQQEQR0EYECMiAkG0mgI2AgAgAkIANwIEIAJBDGoiBSAEEFsgAyACNgIsIAMgBTYCKCADIAMpAig3AwggACADQQhqEGogAyAENgI8IANBPGoQKSABKAIAIgAEQCABIAA2AgQgASgCCBogABAiCyADKAIwIgBFDQAgAyAANgI0IAMoAjgaIAAQIgsgA0FAayQACzUBAX8gASAAKAIEIgJBAXVqIQEgACgCACEAIAEgAkEBcQR/IAEoAgAgAGooAgAFIAALEQAAC0YBAn9BCBAjIQFBIBAjIgBCADcCDCAAQfiUAjYCACAAQgA3AgQgAEIANwIUIABBADYCHCABIAA2AgQgASAAQQxqNgIAIAELSwEBf0HYnwIoAgAiAARAA0AgACgCACAAQRhqEMoCIAAQIiIADQALC0HQnwIoAgAhAEHQnwJBADYCACAABEBB1J8CKAIAGiAAECILCw0AIAAEQCAAEC8QIgsLBgBBpJoCCwYAQcjwAQsUACAAQQRqQQAgASgCBEH+kwFGGwueCgIGfwt8IwBB0ABrIgQkACAAKAIYIQggACgCBCgCACIFIAEoAgAiAUEFdGpCgICAgICAgPg/NwMYAkAgAi0AACADLQAARg0AIAAoAggiBygCAEF/RgRAIAcgATYCAAwBCyAHKAIEQX9GBEAgByABNgIEDAELIAdBfjYCAAsgAysDCCIMIQoCQCAMRAAAAAAAAAAAYg0AIAMrAxAiCkQAAAAAAAAAAGINACADKwMYIQoLIAJBCGohByACKwMIIQsCQAJAIApEAAAAAAAAAABhDQAgCyEKAkAgC0QAAAAAAAAAAGINACACKwMQIgpEAAAAAAAAAABiDQAgAisDGCEKCyAKRAAAAAAAAAAAYQ0ARAAAAAAAAPA/IQsMAQsCQCALRAAAAAAAAAAAYg0AIAIrAxAiC0QAAAAAAAAAAGINACACKwMYIQsLAkAgC0QAAAAAAAAAAGIEQCAAKAIMIgUgBykDEDcDECAFIAcpAwg3AwggBSAHKQMANwMAIAAoAgQoAgAhBQwBCwJAIAxEAAAAAAAAAABiDQAgAysDECIMRAAAAAAAAAAAYg0AIAMrAxghDAsgACgCECIGKAIAIQkgDEQAAAAAAAAAAGIEQCAJQQBODQEgBiABNgIADAELIAlBAE4NACAGQX42AgALIAAoAgwiBisDACEKIAYrAwghDCAGKwMQIQ0gBSABQQV0aiIGIAAoAhQrAwAiCzkDGCAGIA05AxAgBiAMOQMIIAYgCjkDAAsgCCABENYCBEAgACgCDCIGKwMAIQogBisDCCEMIAYrAxAhDSAFIAFBBXRqIgYgACgCHCsDACILOQMYIAYgDTkDECAGIAw5AwggBiAKOQMACwJAIAtEAAAAAAAAAABjDQAgBSABQQV0aiEFIAMrAxgiCyADKwMIIgogCqIgAysDECIMIAyioCALIAuioJ8iDqNEAAAAAAAAAAAgCiAOoyIQvUL///////////8Ag0KAgICAgICA+P8AVCIDGyACKwMYIg0gAisDCCIRIBGiIAIrAxAiEiASoqAgDSANoqCfIg+jRAAAAAAAAAAAIBEgD6MiE71C////////////AINCgICAgICAgPj/AFQiAhuiIAwgDqNEAAAAAAAAAAAgAxsgEiAPo0QAAAAAAAAAACACG6IgEEQAAAAAAAAAACADGyATRAAAAAAAAAAAIAIbokQAAAAAAAAAAKCgoEQep+hILv/vP2QEQCAEQTBqIAggByABEOcBIAUgBCkDSDcDGCAFIAQpA0A3AxAgBSAEKQM4NwMIIAUgBCkDMDcDAAwBCyAAKAIgKAIAIAFqQQE6AAAgACgCCEF+NgIAIAgoAkgiAiAIKAJYIAFBAnRqIgNBeEEEIAFBA29BAkYbaigCAEEYbGoiACsDECEOIAArAwAhDyACIAMoAgBBGGxqIgErAxAhECABKwMAIRMgBCAAKwMIIAErAwihIhQ5AyAgBCAPIBOhIg85AxggBCAOIBChIg45AyggBCAMIBGiIAogEqKhIhBEAAAAAAAA8L9EAAAAAAAA8D8gCyASoiAMIA2ioSIMIA+iRAAAAAAAAAAAoCAKIA2iIAsgEaKhIgogFKKgIBAgDqKgRAAAAAAAAAAAYxsiC6I5AxAgBCAKIAuiOQMIIAQgDCALojkDACAEQTBqIAQgBEEYahCcASAFIAQpA0g3AxggBSAEKQNANwMQIAUgBCkDODcDCCAFIAQpAzA3AwALIARB0ABqJAALMwAgAUHsmQI2AgAgASAAKQIENwIEIAEgACkCDDcCDCABIAApAhQ3AhQgASAAKQIcNwIcCzsBAX9BJBAjIgFB7JkCNgIAIAEgACkCBDcCBCABIAApAgw3AgwgASAAKQIUNwIUIAEgACkCHDcCHCABCwYAQdyZAgsUACAAQQRqQQAgASgCBEG6kQFGGwsVACABQaSZAjYCACABIAApAgQ3AgQLHQEBf0EMECMiAUGkmQI2AgAgASAAKQIENwIEIAELBgBBlJkCCxQAIABBBGpBACABKAIEQZqPAUYbC6EFAgp8A38jAEEgayIBJAACfEQAAAAAAAAAACAAKAIEIhAoAqgBIg4gAigCAEEYbGoiDysDACAOIAMoAgBBGGxqIg4rAwCiRAAAAAAAAAAAoCAPKwMIIA4rAwiioCAPKwMQIA4rAxCioCIERAAAAAAAAPA/Zg0AGkS17z+35KuBQCAERAAAAAAAAPC/ZQ0AGiAEEF1EAAAAAACAZkCiCyEEIAAoAggrAwAgBEQYLURU+yEJQKNjBEAgACgCDCABQgA3AxggAUIANwMQIAFCADcDCCABQQhqEMQBIAAoAhAgECgC2AEgAygCAEEEdGoQPQsgACgCFCABIAAoAgwiDigCBCAOKAIAa0EYbUEBazYCCCABQQhqED0CQCADKwMIIgS9Qv///////////wCDQv/////////3/wBYBEAgAysDECIIIAIrAxgiCaIgAysDGCIKIAIrAxAiC6KhIgUgBCALoiAIIAIrAwgiDKKhIgYgBqIgBSAFoiAKIAyiIAQgCaKhIgUgBaKgoJ8iDaMiB0QAAAAAAAAAACAHvUL///////////8Ag0KAgICAgICA+P8AVCICGyEHIAUgDaNEAAAAAAAAAAAgAhshBSAGIA2jRAAAAAAAAAAAIAIbIQYCfEQAAAAAAAAAACAJIAqiIAggC6IgBCAMokQAAAAAAAAAAKCgoCIERAAAAAAAAPA/Zg0AGkQYLURU+yEJQCAERAAAAAAAAPC/ZQ0AGiAEEF0LIQQgACgCDCgCBCIAQQhrIgIgBiAEoiACKwMAoDkDACAAQRBrIgIgBSAEoiACKwMAoDkDACAAQRhrIgAgByAEoiAAKwMAoDkDAAwBCyADIAIpAxg3AxggAyACKQMQNwMQIAMgAikDCDcDCAsgAUEgaiQACykAIAFB3JgCNgIAIAEgACkCBDcCBCABIAApAgw3AgwgASAAKAIUNgIUCzEBAX9BGBAjIgFB3JgCNgIAIAEgACkCBDcCBCABIAApAgw3AgwgASAAKAIUNgIUIAELBgBBzJgCCxQAIABBBGpBACABKAIEQZ+NAUYbCxUAIAFBlJgCNgIAIAEgACkCBDcCBAsdAQF/QQwQIyIBQZSYAjYCACABIAApAgQ3AgQgAQsVAQF/QcAAECMiAEEAQcAA/AsAIAALZAEBf0EwECMiAEKAgICAgICAeDcDKCAAQoCAgICAgIB4NwMgIABCgICAgICAgHg3AxggAEKAgICAgICA+P8ANwMQIABCgICAgICAgPj/ADcDCCAAQoCAgICAgID4/wA3AwAgAAtGAQF/QSAQIyIAQoCAgICAgIB4NwMYIABCgICAgICAgHg3AxAgAEKAgICAgICA+P8ANwMIIABCgICAgICAgPj/ADcDACAACyYBAX9BIBAjIgBCADcDGCAAQgA3AxAgAEIANwMIIABCADcDACAACxEAIABBACABKAIEQeCFAUYbCxIAIAAoAgwiAARAIAAQOhAiCwsGAEHclwILHwEBf0EYECMiAEIANwMQIABCADcDCCAAQgA3AwAgAAsUACAAQQhqQQAgASgCBEHJhAFGGwumAgELfCACKwMQIgggASsDECIEIAErAwAiBSAFoiABKwMIIgYgBqKgIAQgBKKgnyIHoyIEIAggBKIgAisDCCIMIAYgB6MiBqIgAisDACIJIAUgB6MiBaJEAAAAAAAAAACgoKAiB6KhIgggAysDECIKIAQgBSADKwMAIguiRAAAAAAAAAAAoCAGIAMrAwgiDaKgIAQgCqKgIgSioSIKoSIOIA6iIAkgBSAHoqEiCSALIAUgBKKhIgWhIgsgC6IgDCAGIAeioSIHIA0gBiAEoqEiBKEiBiAGoqCgnyAIIAiiIAkgCaIgByAHoqCgnyAKIAqiIAUgBaIgBCAEoqCgn6BEAAAAAAAA4D+ioEQAAAAAAAAIQKIgACsDCEQAAAAAAAAQQKKjn/wCCxUAIAFBrJcCNgIAIAEgACkDCDcDCAsdAQF/QRAQIyIBQayXAjYCACABIAApAwg3AwggAQsGAEGclwILFAAgAEEIakEAIAEoAgRBqYMBRhsLLQEBfCABKwMAIgQgBKIgASsDCCIEIASioCABKwMQIgQgBKKgnyAAKwMIo/wCCxUAIAFB7JYCNgIAIAEgACkDCDcDCAsdAQF/QRAQIyIBQeyWAjYCACABIAApAwg3AwggAQsGAEHclgILFAAgAEEEakEAIAEoAgRBlYIBRhsLFQAgAUGslgI2AgAgASAAKAIENgIECx0BAX9BCBAjIgFBrJYCNgIAIAEgACgCBDYCBCABCw8AIABBhJYCNgIAIAAQIgsNACAAQYSWAjYCACAAC7MJAwx/BnwBfiMAQTBrIggkACAIQRhqIgMgACABQQIQ6AECQCADEMABRQ0AIAhBEGogAEEAECsQKiAIKAIQIQkgCEEIaiABQQAQKxAqIAgoAgghCkEAIQAjAEFAaiIEJAAgBEEANgIwIARCADcCKCAEQQA2AiAgBEIANwIYIAogBEEoaiAEQRhqQQAQzwIgBCgCKCEBIAQoAiwiAwRAIAEgA0EwbGohDSABIQADQCAAIAIgACsDKKAiECAAKwMQIAKhIhEgECARZCIOGzkDKCAAIAIgACsDIKAiEiAAKwMIIAKhIhMgEiATZCIFGzkDICAAIAIgACsDGKAiFCAAKwMAIAKhIg8gDyAUYyIDGzkDGCAAIBEgECAOGzkDECAAIBMgEiAFGzkDCCAAIA8gFCADGzkDACAAQTBqIgAgDUcNAAsgBCgCLCEACyAEQoCAgICAgID4/wA3AxAgBCAKNgIMIAQgCTYCCCAEIAA2AjwgBCABNgI4IwBBIGsiByQAIAkoAowCIgMEQCAJKQLoASEVIAkoAogCIQEgByAEQQhqNgIcIAcgAzYCGCAHIAE2AhQgByAVNwIMIAcgBEE4ajYCCEEAIQEjAEEgayIGJAAgBiAHKAIINgIIIAYgBygCDDYCDCAGIAcoAhA2AhAgBiAHKAIUNgIUIAYgBygCGDYCGCAGIAcoAhw2AhwgAARAA0AjAEGAAmsiCiQAAkAgBigCCCgCACABQTBsaiIDKwMAIhBEAAAAAAAA8H9hDQAgAysDKCERIAMrAyAhEiADKwMYIRMgAysDECEUIAMrAwghDyAGKAIcQQhqIQ5BASEFQX8hCwNAIAYoAhQgBUEBa0ECbUEDdGoiAygCBCEMQQAhDQJ/AkAgBigCDCIFIAMoAgAiCUEwbGoiAysDACATZUUNACADKwMIIBJlRQ0AIAMrAxAgEWVFDQAgAysDGCAQZkUNACADKwMgIA9mRQ0AIAMrAyggFGZFDQAgCUEBcUUEQCAGKAIcIAEgCUEBdSAOEIIEIAYoAgwhBQsgCUGBgICAeHFBAUYMAQtBAAshAwJAIAUgDEEwbGoiBSsDACATZUUNACAFKwMIIBJlRQ0AIAUrAxAgEWVFDQAgBSsDGCAQZkUNACAFKwMgIA9mRQ0AIAUrAyggFGZFDQAgDEEBcUUEQCAGKAIcIAEgDEEBdSAOEIIECyAMQYGAgIB4cUEBRiENCyADIA1yRQRAIAtBAEgNAiAKIAtBAnRqKAIAIQUgC0EBayELDAELIAkgDCADGyEFIANFIA1Fcg0AIAogC0EBaiILQQJ0aiAMNgIADAALAAsgCkGAAmokACABQQFqIgEgAEcNAAsLIAZBIGokAAsgB0EgaiQAIAQrAxAhDyAEKAIYIgAEQCAAECILIAQoAigiAARAIAAQIgsgBEFAayQAIAIgAqIiAiAPIAIgD2MbnyEPAkAgCCgCDCIBRQ0AIAEgASgCBCIAQQFrNgIEIAANACABIAEoAgAoAggRAAAgARAkCyAIKAIUIgFFDQAgASABKAIEIgBBAWs2AgQgAA0AIAEgASgCACgCCBEAACABECQLIAhBGGoQKBogCEEwaiQAIA8L/wICAn8BfiMAQUBqIgIkACACQTRqIAFBEGoQfyACQSxqIAEgAigCNBArECoCQCACKAIsKAJEIgEEQCAAIAEQRgwBC0GoAhAjIgFBoJACNgIAIAFCADcCBCABQRBqEDshAyACIAE2AiggAiADNgIkIAIgAigCLCkCSDcCHCADIAJBHGogAigCNBD+AyACQQxqIAJBJGoQWSACIAIpAgwiBDcCFCACQgA3AgwgAiAENwMAIAAgAhBDAkAgAigCECIARQ0AIAAgACgCBCIBQQFrNgIEIAENACAAIAAoAgAoAggRAAAgABAkCyACKAIoIgBFDQAgACAAKAIEIgFBAWs2AgQgAQ0AIAAgACgCACgCCBEAACAAECQLAkAgAigCMCIARQ0AIAAgACgCBCIBQQFrNgIEIAENACAAIAAoAgAoAggRAAAgABAkCwJAIAIoAjgiAEUNACAAIAAoAgQiAUEBazYCBCABDQAgACAAKAIAKAIIEQAAIAAQJAsgAkFAayQAC/YFAQ9/IwBBEGsiBiQAIAZBCGogAUEAECsQKiAGKAIIIQMjAEGwAWsiASQAIAMoAlwhAiABQQA2AqgBIAFCADcCoAEgAUGgAWogAkEBdiICEDkgASACNgKkASADKAJcIgsEQCADKAJ4IQwgAygCWCENIAMoAqgBIQcgAygCaCEIIAEoAqABIQ5BACECA0ACQCAHIAggCCACQQJ0IglqKAIAIgpBAnRqKAIAQQNtQRhsaisDEEQAAAAAAAAAAGZFDQAgByAKQQNtQRhsaisDEEQAAAAAAAAAAGNFDQAgCSANaiIFQXhBBCACQQNvQQJGG2ooAgAhDyAFKAIAIRAgDiAEQQR0aiIFIAkgDGooAgA2AgwgBSAKNgIIIAUgDzYCBCAFIBA2AgAgBEEBaiEECyACQQFqIgIgC0cNAAsLIAFCADcDmAEgAUIANwOQASABQgA3AzAgAUIANwM4IAFBoAFqIAQgAUEwahCVAiABQfgAaiICIAEoAqABIgQgBCABKAKkAUEEdGpBABD0AiABQgA3A0ggAUKAgICAgICA+D83A0AgAUIANwNQIAFCADcDYCABQoCAgICAgID4PzcDWCABQgA3A2ggASABKQKgATcCcCABIAFBQGtBMPwKAAAgAUGEAWogAiABQfAAaiIEIANByABqIAEQxwQgASACNgJwIAQQKSAAQQA2AgggAEIANwIAIAEoAoQBIgMgASgCiAEiBEcEQANAIAFBADYCgAEgAUIANwJ4IAMoAgAiAiADKAIEIgVHBEADQCABQfgAaiACEEwgAkEYaiICIAVHDQALCyAAIAFB+ABqEHYgASgCeCICBEAgASACNgJ8IAEoAoABGiACECILIANBDGoiAyAERw0ACwsgASABQYQBajYCeCABQfgAahApIAEoAqABIgAEQCAAECILIAFBsAFqJAACQCAGKAIMIgBFDQAgACAAKAIEIgFBAWs2AgQgAQ0AIAAgACgCACgCCBEAACAAECQLIAZBEGokAAuODgMPfwl8An4jAEEQayILJAAgC0EIaiABQQAQKxAqIAsoAgghBiMAQcACayIBJAAgASAGKQMINwM4IAEgBikDADcDMCABIAYpAyA3AxAgASAGKQMYNwMIIAFBADYCKCABQgA3AiAgAUEgakGAARCfASABIAEoAiQiA0EBajYCJCABKQMwIRsgASkDOCEcIAEoAiAgA0EwbGoiAyACOQMQIAMgHDcDCCADIBs3AwAgAyABKQMQNwMgIAMgASkDCDcDGCADIAI5AyggAUIANwMQIAFCADcDCCABQYCAgPwDNgIYAkACQCAGKAKMAkUNACABKAIkIg9FDQAgASgCICEQIAYoAogCIREgBigC6AEhDgNAAkAgECAKQTBsaiIDKwMAIhVEAAAAAAAA8H9hDQAgAysDKCEWIAMrAyAhFyADKwMYIRggAysDECEZIAMrAwghGkF/IQRBASEDA0AgESADQQFrQQJtQQN0aiIDKAIEIQhBACEFAn9BACAOIAMoAgAiB0EwbGoiAysDACAYZUUNABpBACADKwMIIBdlRQ0AGkEAIAMrAxAgFmVFDQAaQQAgAysDGCAVZkUNABpBACADKwMgIBpmRQ0AGkEAIAMrAyggGWZFDQAaAkAgB0EBcQ0AIAEgB0EBdSIDNgK8AiABQQI2ArgCIAFCgICAgBA3ArACIAYoAlggA0EMbGohCSAGKAJIIQxEAAAAAAAA8P8hEkQAAAAAAADwfyETQQAhAwNAIAwgCSABQbACaiINIANqKAIAQQJ0aigCAEEYbGorAxAiFCASIBIgFGMbIRIgFCATIBMgFGQbIRMgA0EEaiIDQQxHDQALIAIgE2ZFIAIgEmNFcg0AIA0gAUEIaiABQbwCaiIDIAMQzwELIAdBgYCAgHhxQQFGCyEJAkAgDiAIQTBsaiIDKwMAIBhlRQ0AIAMrAwggF2VFDQAgAysDECAWZUUNACADKwMYIBVmRQ0AIAMrAyAgGmZFDQAgAysDKCAZZkUNAAJAIAhBAXENACABIAhBAXUiAzYCvAIgAUECNgK4AiABQoCAgIAQNwKwAiAGKAJYIANBDGxqIQUgBigCSCEMRAAAAAAAAPD/IRJEAAAAAAAA8H8hE0EAIQMDQCAMIAUgAUGwAmoiDSADaigCAEECdGooAgBBGGxqKwMQIhQgEiASIBRjGyESIBQgEyATIBRkGyETIANBBGoiA0EMRw0ACyACIBNmRSACIBJjRXINACANIAFBCGogAUG8AmoiAyADEM8BCyAIQYGAgIB4cUEBRiEFCyAFIAlyRQRAIARBAEgNAiABQTBqIARBAnRqKAIAIQMgBEEBayEEDAELIAcgCCAJGyEDIAlFIAVFcg0AIAFBMGogBEEBaiIEQQJ0aiAINgIADAALAAsgCkEBaiIKIA9HDQALIAEoAhQgAEEANgIIIABCADcCAEUNAQNAIAEoAhAoAgghCEEAIQMgAUEANgK4AiABQgA3ArACIAFBAjYCOCABQoCAgIAQNwIwIAYoAlggCEEMbGohBSAGKAJIIQcCQANAIAIgByAFIAFBMGogA2ooAgAiBEECdGooAgBBGGxqKwMQYwRAIAcgBUEEQQggBEEBRhtBACAEG0Hw+ABqKAIAIgRBAnRqKAIAQRhsaisDECACZQ0CCyADQQRqIgNBDEcNAAtBACEECyABIAg2ArwCA0AgAUEIaiIDIQcgAyABQbwCahCiAiEFIwBBEGsiAyQAIAUoAgAaIANBBGogByAFEMIEIAMoAgQhBSADQQA2AgQgBQRAIAUQIgsgA0EQaiQAIAIgBigCSCIHIAYoAlgiCkF4QQQgASgCvAJBA2wiCSAEaiIDQQNvIgVBAkYbaiADQQJ0aigCAEEYbGorAxBmBEBBBEEIIARBAUYbQQAgBBtB8PgAaigCACAJaiIDQQNvIQULIAcgCiADQQJ0IglqIgRBeEEEIAVBAkYbaigCAEEYbGoiAysDACETIAcgBCgCAEEYbGoiBCsDACEUIAEgAysDCCACIAQrAxAiEqEgAysDECASoaMiEqIgBCsDCEQAAAAAAADwPyASoSIVoqA5AzggASATIBKiIBQgFaKgOQMwIAFBsAJqIgUgAUEwahBMIAEgBigCaCAJaigCACIEQQNtIgM2ArwCQQRBCCAEIANBA2xrIgRBAUYbQQAgBBtB8PgAaigCACEEIAMgCEcNAAsgACAFEHYgASgCsAIiAwRAIAEgAzYCtAIgASgCuAIaIAMQIgsgASgCFA0ACwwBCyAAQQA2AgggAEIANwIACyABQQhqEJUBIAEoAiAiAARAIAAQIgsgAUHAAmokAAJAIAsoAgwiAEUNACAAIAAoAgQiAUEBazYCBCABDQAgACAAKAIAKAIIEQAAIAAQJAsgC0EQaiQAC5UCAQF/IwBBIGsiAyQAIANBGGogAUEQahB/IANBEGogASADKAIYECsQKgJAIAMoAhAoAkQiAQRAIAAgARBGDAELIANBCGogAiADKAIYECsQKgJAIAMoAggiASgCRCICBEAgACACEEYMAQsgACADKAIQIAFBASADKAIYEJQECyADKAIMIgBFDQAgACAAKAIEIgFBAWs2AgQgAQ0AIAAgACgCACgCCBEAACAAECQLAkAgAygCFCIARQ0AIAAgACgCBCIBQQFrNgIEIAENACAAIAAoAgAoAggRAAAgABAkCwJAIAMoAhwiAEUNACAAIAAoAgQiAUEBazYCBCABDQAgACAAKAIAKAIIEQAAIAAQJAsgA0EgaiQAC5UCAQF/IwBBIGsiAyQAIANBGGogAUEQahB/IANBEGogASADKAIYECsQKgJAIAMoAhAoAkQiAQRAIAAgARBGDAELIANBCGogAiADKAIYECsQKgJAIAMoAggiASgCRCICBEAgACACEEYMAQsgACADKAIQIAFBACADKAIYEJQECyADKAIMIgBFDQAgACAAKAIEIgFBAWs2AgQgAQ0AIAAgACgCACgCCBEAACAAECQLAkAgAygCFCIARQ0AIAAgACgCBCIBQQFrNgIEIAENACAAIAAoAgAoAggRAAAgABAkCwJAIAMoAhwiAEUNACAAIAAoAgQiAUEBazYCBCABDQAgACAAKAIAKAIIEQAAIAAQJAsgA0EgaiQAC3EBA38jAEGQAWsiBCQAIARByABqIgUgARDkAiAEQRhqIgYgBUEw/AoAACAEIAIpAxA3AxAgBCACKQMINwMIIAQgAikDADcDACAEQfgAaiICIAYgBCADEJYEIAAgASACQQIQ6AEgAhAoGiAEQZABaiQAC8oDAgN/AX4jAEHQAGsiAyQAIANBxABqIAFBEGoQfyADQTxqIAEgAygCRBArECoCQCADKAI8IgQoAkQiAQRAIAAgARBGDAELQagCECMiAUGgkAI2AgAgAUIANwIEIAFBEGogBBA3IQQgAyABNgI4IAMgBDYCNAJAIAEoAswBRQ0AIAMgApk5AyAgA0GslwI2AhggAyADQRhqIgU2AiggBCAFQQEgAygCRBDRAiAFIAMoAigiAUYEf0EQBSABRQ0BQRQLIQQgASABKAIAIARqKAIAEQAACyADQQhqIANBNGoQWSADIAMpAggiBjcCECADQgA3AgggAyAGNwMAIAAgAxBDAkAgAygCDCIARQ0AIAAgACgCBCIBQQFrNgIEIAENACAAIAAoAgAoAggRAAAgABAkCyADKAI4IgBFDQAgACAAKAIEIgFBAWs2AgQgAQ0AIAAgACgCACgCCBEAACAAECQLAkAgAygCQCIARQ0AIAAgACgCBCIBQQFrNgIEIAENACAAIAAoAgAoAggRAAAgABAkCwJAIAMoAkgiAEUNACAAIAAoAgQiAUEBazYCBCABDQAgACAAKAIAKAIIEQAAIAAQJAsgA0HQAGokAAvCAwIEfwF+IwBB0ABrIgMkAEEQIQUgA0HEAGogAUEQahB/IANBPGogASADKAJEECsQKgJAIAMoAjwiBCgCRCIBBEAgACABEEYMAQtBqAIQIyIBQaCQAjYCACABQgA3AgQgAUEQaiAEEDchBCADIAE2AjggAyAENgI0IAMgApk5AyAgA0HslgI2AhggAyADQRhqIgY2AiggBCAGQQAgAygCRBDRAgJAIAYgAygCKCIBRwRAQRQhBSABRQ0BCyABIAEoAgAgBWooAgARAAALIANBCGogA0E0ahBZIAMgAykCCCIHNwIQIANCADcCCCADIAc3AwAgACADEEMCQCADKAIMIgBFDQAgACAAKAIEIgFBAWs2AgQgAQ0AIAAgACgCACgCCBEAACAAECQLIAMoAjgiAEUNACAAIAAoAgQiAUEBazYCBCABDQAgACAAKAIAKAIIEQAAIAAQJAsCQCADKAJAIgBFDQAgACAAKAIEIgFBAWs2AgQgAQ0AIAAgACgCACgCCBEAACAAECQLAkAgAygCSCIARQ0AIAAgACgCBCIBQQFrNgIEIAENACAAIAAoAgAoAggRAAAgABAkCyADQdAAaiQAC8cDAgJ/AX4jAEHQAGsiAyQAIANBxABqIAFBEGoQfyADQTxqIAEgAygCRBArECoCQCADKAI8IgQoAkQiAQRAIAAgARBGDAELQagCECMiAUGgkAI2AgAgAUIANwIEIAFBEGogBBA3IQQgAyABNgI4IAMgBDYCNAJAIAJBAkgNACADIAI2AhwgA0GslgI2AhggAyADQRhqIgI2AiggBCACQQAgAygCRBDRAiACIAMoAigiAUYEf0EQBSABRQ0BQRQLIQIgASABKAIAIAJqKAIAEQAACyADQQhqIANBNGoQWSADIAMpAggiBTcCECADQgA3AgggAyAFNwMAIAAgAxBDAkAgAygCDCIARQ0AIAAgACgCBCIBQQFrNgIEIAENACAAIAAoAgAoAggRAAAgABAkCyADKAI4IgBFDQAgACAAKAIEIgFBAWs2AgQgAQ0AIAAgACgCACgCCBEAACAAECQLAkAgAygCQCIARQ0AIAAgACgCBCIBQQFrNgIEIAENACAAIAAoAgAoAggRAAAgABAkCwJAIAMoAkgiAEUNACAAIAAoAgQiAUEBazYCBCABDQAgACAAKAIAKAIIEQAAIAAQJAsgA0HQAGokAAudBQMIfwF8AX4jAEFAaiIEJAAgBEE0aiABQQAQKxAqAkAgBCgCNCIGKAJEIgUEQCAAIAUQRgwBC0GoAhAjIgVBoJACNgIAIAVCADcCBCAFQRBqIAYQNyEGIAQgBTYCMCAEIAY2AiwCQCABEMABDQAjAEEQayIBJAAgBEEgaiIFQQA2AgggBUIANwIAIAYoAlwEQEQtQxzr4jYaPyACIAJELUMc6+I2Gj9jG0QYLURU+yEJQKJEAAAAAACAZkCjIQwDQAJAIAdBAnQiCCAGKAJYaiIJKAIAIAlBeEEEIAdBA29BAkYbaigCAE4NACAGKAKoASIKIAdBA25BGGxqIgkrAwAgCiAGKAJoIAhqKAIAIgtBA25BGGxqIggrAwCiRAAAAAAAAAAAoCAJKwMIIAgrAwiioCAJKwMQIAgrAxCioCICRAAAAAAAAPA/Zg0AIAJEAAAAAAAA8L9lBHxEGC1EVPshCUAFIAIQXQsgDGRFDQAgASADOQMIIAEgBzYCACAFIAEQTCABIAM5AwggASALNgIAIAUgARBMCyAHQQFqIgcgBigCXEkNAAsLIAFBEGokACAGIAVBABDpAyAEKAIgIgFFDQAgBCABNgIkIAQoAigaIAEQIgsgBEEQaiAEQSxqEFkgBCAEKQIQIg03AhggBEIANwIQIAQgDTcDCCAAIARBCGoQQwJAIAQoAhQiAEUNACAAIAAoAgQiAUEBazYCBCABDQAgACAAKAIAKAIIEQAAIAAQJAsgBCgCMCIARQ0AIAAgACgCBCIBQQFrNgIEIAENACAAIAAoAgAoAggRAAAgABAkCwJAIAQoAjgiAEUNACAAIAAoAgQiAUEBazYCBCABDQAgACAAKAIAKAIIEQAAIAAQJAsgBEFAayQAC7AWAwx/C3wBfiMAQTBrIgckACAHQSRqIAFBABArECoCQCAHKAIkIgYoAkQiCQRAIAAgCRBGDAELQagCECMiCUGgkAI2AgAgCUIANwIEIAlBEGogBhA3IQYgByAJNgIgIAcgBjYCHCABEMABRQRAAkAgAiEJIwBBkAJrIgMkACAGQQA2ArwBIAYoAkwhAiAGKAJcIQEgBkG4AWoiDBCTASADQQA2AkAgA0IANwI4IANBOGogARBVIAMgATYCPCADQQA2AjAgA0IANwIoIANBKGogAUEAEIEBIANCgICAgICAgPi/fzcDICADQoCAgICAgICEQDcDGCADQQhqIAYQ8AMCQCACBEAgAygCCCIKIAJBAnRqIQ0DQCAKKAIAIQIgA0J/NwLIASADQX82AsQBIAMgBjYCmAEgAyAJNgKUASADQaSZAjYCkAEgA0IANwO4ASADQgA3A7ABIANCADcDqAEgAyADQZABaiIBNgKgAUEkECMiBSAGNgIYIAVB7JkCNgIAIAUgA0EoajYCICAFIANBIGo2AhwgBSADQRhqNgIUIAUgA0HEAWo2AhAgBSADQagBajYCDCAFIANByAFqNgIIIAUgA0E4ajYCBCADIAI2AtABIANB8AFqIAEgA0HQAWoQ6gMgAiEBA0AgA0F+QQEgBigCaCABQQJ0aigCACIEQQNvQQJGGyAEaiIENgJ4IAMoAqABIghFDQMgA0HQAWoiCyAIIANB+ABqIg4gCCgCACgCGBEDACADIAE2AnggBSAOIANB8AFqIAsgBSgCACgCGBEFACADIAMpA9ABNwPwASADIAMpA9gBNwP4ASADIAMpA+ABNwOAAiADIAMpA+gBNwOIAiAEIgEgAkcNAAsgBSAFKAIAKAIUEQAAAkAgAygCoAEiASADQZABakYEf0EQBSABRQ0BQRQLIQQgASABKAIAIARqKAIAEQAACwJAAkAgAygCxAEiAUF/Rg0AAkAgAysDqAEiD0QAAAAAAAAAAGINACADKwOwASIPRAAAAAAAAAAAYg0AIAMrA7gBIQ8LIA9EAAAAAAAAAABhBEAgAyAGKAKYASAGKAJYIAJBAnRqKAIAQRhsaiIBKQMQNwPgASADIAEpAwg3A9gBIAMgASkDADcD0AEgAygCOCEFIAIhAQNAIAVBfkEBIAYoAmggAUECdGooAgAiAUEDb0ECRhsgAWoiAUEFdGoiBCsDGEQAAAAAAADwv2IEQCADQfABaiAGIANB0AFqIAEQ5wEgBCADKQOIAjcDGCAEIAMpA4ACNwMQIAQgAykD+AE3AwggBCADKQPwATcDAAsgASACRw0ACwwCCyABQQBIDQAgA0HQAWogBkF+QQEgBigCaCABQQJ0aigCACICQQNvQQJGGyACaiAJENcCA0ACQCADKAI4IAFBBXRqIgIrAxhEAAAAAAAACMBiDQAgAisDECEQIAIrAwghESACKwMAIhMhDwJAIBNEAAAAAAAAAABiDQAgESIPRAAAAAAAAAAAYg0AIBAhDwsgAysDuAEgECAPRAAAAAAAAAAAYSIEGyIPIAMrA6gBIBMgBBsiECAQoiADKwOwASARIAQbIhEgEaKgIA8gD6KgnyIUo0QAAAAAAAAAACAQIBSjIhe9Qv///////////wCDQoCAgICAgID4/wBUIgQbIAMrA+ABIhMgAysD0AEiEiASoiADKwPYASIVIBWioCATIBOioJ8iFqNEAAAAAAAAAAAgEiAWoyIYvUL///////////8Ag0KAgICAgICA+P8AVCIFG6IgESAUo0QAAAAAAAAAACAEGyAVIBajRAAAAAAAAAAAIAUboiAXRAAAAAAAAAAAIAQbIBhEAAAAAAAAAAAgBRuiRAAAAAAAAAAAoKCgRB6n6Egu/+8/ZARAIANB8AFqIAYgA0HQAWogARDnASACIAMpA4gCNwMYIAIgAykDgAI3AxAgAiADKQP4ATcDCCACIAMpA/ABNwMADAELIAYoAkgiBSAGKAJYIAFBAnRqIghBeEEEIAFBA29BAkYbaigCAEEYbGoiBCsDECEUIAQrAwAhFiAFIAgoAgBBGGxqIgUrAxAhFyAFKwMAIRggAyAEKwMIIAUrAwihIhk5A4ABIAMgFiAYoSIWOQN4IAMgFCAXoSIUOQOIASADIBEgEqIgECAVoqEiF0QAAAAAAADwv0QAAAAAAADwPyAPIBWiIBEgE6KhIhEgFqJEAAAAAAAAAACgIBAgE6IgDyASoqEiECAZoqAgFyAUoqBEAAAAAAAAAABjGyIPojkDcCADIBAgD6I5A2ggAyARIA+iOQNgIANB8AFqIANB4ABqIANB+ABqEJwBIAIgAykDiAI3AxggAiADKQOAAjcDECACIAMpA/gBNwMIIAIgAykD8AE3AwALIANB8AFqIAYgASAJENcCAkAgAysD8AEiD0QAAAAAAAAAAGINACADKwP4ASIPRAAAAAAAAAAAYg0AIAMrA4ACIQ8LIA9EAAAAAAAAAABiBEAgAyADKQOAAjcD4AEgAyADKQP4ATcD2AEgAyADKQPwATcD0AELIAYoAmhBfEEIIAFBA28baiABQQJ0aigCACIBIAMoAsQBRw0ACwsgAygCyAEiAUEASA0AIAMoAswBIgJBAEgNACAGKAJIIgQgBigCWCILIAFBAnRqIghBeEEEIAFBA3BBAkYbaigCAEEYbGoiBSsDECERIAUrAwAhECAEIAgoAgBBGGxqIggrAxAhEyAIKwMAIRIgAyAFKwMIIAgrAwihIg85A9gBIAMgECASoSIQOQPQASADIBEgE6EiETkD4AEgBCALIAJBAnRqIghBeEEEIAJBA3BBAkYbaigCAEEYbGoiBSsDECEVIAUrAwAhEiAEIAgoAgBBGGxqIgQrAxAhFCAEKwMAIRYgAyAFKwMIIAQrAwihIhM5A4ABIAMgEiAWoSISOQN4IAMgFSAUoSIVOQOIASADIBAgECAQoiAPIA+ioCARIBGioJ8iEKMgEiASIBKiIBMgE6KgIBUgFaKgnyISo6EiFDkDYCADIA8gEKMgEyASo6EiDzkDaCADIBEgEKMgFSASo6EiEDkDcCADQfABaiIFIANB4ABqIANB0AFqEJwBIAMoAjgiCCABQQV0aiIEIAMpA4gCNwMYIAQgAykDgAI3AxAgBCADKQP4ATcDCCAEIAMpA/ABNwMAIAMgEJo5A1ggAyAPmjkDUCADIBSaOQNIIAUgA0HIAGogA0H4AGoQnAEgCCACQQV0aiIEIAMpA4gCNwMYIAQgAykDgAI3AxAgBCADKQP4ATcDCCAEIAMpA/ABNwMAIAEgAygCKCIBakEBOgAAIAEgAmpBAToAAAsgCkEEaiIKIA1HDQALCyAMIANBOGpHBEAgDCgCACIBBEAgARAiCyAGIAMoAjg2ArgBIAYgAygCPDYCvAEgBiADKAJANgLAASADQQA2AkAgA0IANwI4CyAGIANBKGoQ1AIgAygCCCIBBEAgARAiCyADKAIoIgEEQCABECILIAMoAjgiAQRAIAEQIgsgA0GQAmokAAwBCxBmAAsLIAdBDGogB0EcahBZIAcgBykCDCIaNwIUIAdCADcCDCAHIBo3AwAgACAHEEMCQCAHKAIQIgBFDQAgACAAKAIEIgFBAWs2AgQgAQ0AIAAgACgCACgCCBEAACAAECQLIAcoAiAiAEUNACAAIAAoAgQiAUEBazYCBCABDQAgACAAKAIAKAIIEQAAIAAQJAsCQCAHKAIoIgBFDQAgACAAKAIEIgFBAWs2AgQgAQ0AIAAgACgCACgCCBEAACAAECQLIAdBMGokAAvBGwMXfwR8AX4jAEEwayIKJAAgCkEkaiABQQAQKxAqAkAgCigCJCIBKAJEIgUEQCAAIAUQRgwBC0GoAhAjIhNBoJACNgIAIBNCADcCBCATQRBqIAEQNyEIIAogEzYCICAKIAg2AhxBACEFIwBBoAJrIgQkAAJAIAJBAEgNACAIKAJcQQNJDQAgBEQtQxzr4jYaPyADIANELUMc6+I2Gj9jGzkD8AEgCEHYAGoQOCAIQegAahA4IAhB+ABqEDggCCgCQCEOIAgoAkwhASAEQQA2AugBIARCADcC4AEgBEHgAWogAUEAEDEgCCgCXARAA0ACQCAFQQJ0IgEgCCgCWGoiCSgCACAJQXhBBCAFQQNvQQJGGyIGaigCAE4NAAJ8RAAAAAAAAAAAIAgoAqgBIgcgBUEDbkEYbGoiCSsDACAHIAgoAmggAWooAgBBA21BGGxqIgcrAwCiRAAAAAAAAAAAoCAJKwMIIAcrAwiioCAJKwMQIAcrAxCioCIDRAAAAAAAAPA/Zg0AGkS17z+35KuBQCADRAAAAAAAAPC/ZQ0AGiADEF1EAAAAAACAZkCiCyEDIAQrA/ABIANEGC1EVPshCUCjY0UNACAEKALgASIJIAgoAlggAWoiASgCAEECdGoiByAHKAIAQQFqNgIAIAkgASAGaigCAEECdGoiASABKAIAQQFqNgIACyAFQQFqIgUgCCgCXEkNAAsLIA4gAkEDaiIBIAEgDkgbIQ8CfyAIKAJAIgFFBEAgCCgCTAwBCyAIKAKMASABbgshAUEAIQUgBEEANgLYASAEQgA3AtABIARB0AFqIAEgD2xEAAAAAAAAAAAQgAEgCCgCiAEhASAIIAQoAtABNgKIASAEIAE2AtABIAgoAowBIQEgCCAEKALUATYCjAEgBCABNgLUASAIKAKQASEBIAggBCgC2AE2ApABIAQgATYC2AEgCCAPNgJAIAgoAlwhASAEQQA2AsgBIARCADcCwAEgBEHAAWogARAlIAQgATYCxAEgBEG0AWoCfwJAAkAgCCgCXCIVRQRAIARCADcCuAEgBCAEQbgBajYCtAEMAQsgCEGIAWohECAIKAJ4IQEgBCgCwAEhCQNAIAkgBUECdCIHaiABIAdqIgcoAgA2AgAgB0F/NgIAIAVBAWoiBSAVRw0ACyAEQgA3ArgBIAQgBEG4AWo2ArQBIAQgCDYCsAEgBCAEQbQBajYCrAEgFUEASg0BC0EADAELIA5BA3QhEkEAIQkDQAJAIAlBAnQiASAIKAJ4aigCAEEATg0AIAQoAuABIAgoAlggAWooAgAiAUECdGooAgBBAUwEQCAIKAKYASABQRhsaiIBKwMQIRwgASsDCCEeIAErAwAhGwJAIAJFBEAgHiEDIBwhHQwBCyAEQeAAaiAEQawBaiAIKALYASAJQQNuQQR0aigCABDvAyAbIAQrA3CiIB4gBCsDiAGioCAcIAQrA6ABoqAhHSAbIAQrA2iiIB4gBCsDgAGioCAcIAQrA5gBoqAhAyAbIAQrA2CiIB4gBCsDeKKgIBwgBCsDkAGioCEbCyAEIB05A4gCIAQgAzkDgAIgBCAbOQP4AUF/IQYgCSEBA0BBfkEBIAgoAmggAUECdGooAgAiAUEDb0ECRhsgAWoiAUECdCIFIAgoAnhqIAQoAsABIAVqKAIAIgc2AgAgBiAHRwRAIBAoAgAhBQJAIA5FBEAgByAPbCEGDAELIAcgD2whBiASBEAgBSAGQQN0aiAEKALQASAHIA5sQQN0aiAS/AoAAAsgECgCACEFCyAEQQI2AmggBEKAgICAEDcCYCAFIAZBA3RqIAJBA3RqIQtBACEFA0AgCyAEQeAAaiAFaigCACIGQQN0aiAEQfgBakEIQRAgBkEBRhtBACAGG2orAwA5AwAgBUEEaiIFQQxHDQALIAchBgsgASAJRw0ACwwBCyAEIAgoAkggAUEYbGoiASkDEDcDWCAEIAEpAwg3A1AgBCABKQMANwNIIARBADYCRCAEQgA3AjwgBEEANgI4IARCADcCMCAEQQA2AiwgBEIANwIkIAlBA24hBSAJIQEDQAJ8RAAAAAAAAAAAIAgoAqgBIgZBfkEBIAgoAmggAUECdGooAgAiB0EDb0ECRhsgB2oiC0EDbSIMQRhsaiIHKwMAIAYgBUEYbGoiBisDAKJEAAAAAAAAAACgIAcrAwggBisDCKKgIAcrAxAgBisDEKKgIgNEAAAAAAAA8D9mDQAaRLXvP7fkq4FAIANEAAAAAAAA8L9lDQAaIAMQXUQAAAAAAIBmQKILIQMgASALIAQrA/ABIANEGC1EVPshCUCjYyIHGyEBIAdFBEAgBSAMIAcbIQUgASAJRw0BCwsgBCAINgIMIARBlJgCNgIIIAQgBEEIaiIFNgIYIAQgBEHIAGo2AhBBGBAjIgYgCDYCBCAGQdyYAjYCACAGIARBPGo2AhQgBiAEQSRqNgIQIAYgBEEwajYCDCAGIARB8AFqNgIIIAQgATYC+AEgBEHgAGogBSAEQfgBahDuAyABIQUCQAJAA0AgBEF+QQEgCCgCaCAFQQJ0aigCACIHQQNvQQJGGyAHaiIHNgKcAiAEKAIYIgtFDQEgBEH4AWoiDCALIARBnAJqIhEgCygCACgCGBEDACAEIAU2ApwCIAYgESAEQeAAaiAMIAYoAgAoAhgRBQAgBCAEKQP4ATcDYCAEIAQpA4ACNwNoIAQgBCkDiAI3A3AgBCAEKQOQAjcDeCAHIgUgAUcNAAsgBiAGKAIAKAIUEQAAAkAgBCgCGCIFIARBCGpGBH9BEAUgBUUNAUEUCyEHIAUgBSgCACAHaigCABEAAAtBACEFIAQoAjQiCyAEKAIwIg1GDQEDQCANIAVBGGwiBmoiBysDECEcIAcrAwghHiAHKwMAIRsCQCACRQRAIB4hAyAcIR0MAQsgBEHgAGogBEGsAWogBCgCJCAFQQJ0aigCABDvAyAbIAQrA3CiIB4gBCsDiAGioCAcIAQrA6ABoqAhHSAbIAQrA2iiIB4gBCsDgAGioCAcIAQrA5gBoqAhAyAbIAQrA2CiIB4gBCsDeKKgIBwgBCsDkAGioCEbIAQoAjQhCyAEKAIwIQ0LIAYgDWoiByAdIBsgG6IgAyADoqAgHSAdoqCfIh2jRAAAAAAAAAAAIBsgHaMiHL1C////////////AINCgICAgICAgPj/AFQiBhs5AxAgByADIB2jRAAAAAAAAAAAIAYbOQMIIAcgHEQAAAAAAAAAACAGGzkDACAFQQFqIgUgCyANa0EYbUkNAAsMAQsQZgALQQAhC0F/IREgBCgCPCEUQX8hDEEAIRYgASEXA0AgBCgC0AFBfkEBIAgoAmggF0ECdGooAgAiBUEDb0ECRhsgBWoiF0ECdCIaIAQoAsABaigCACIHIA5sQQN0aiEFAkACQCAUIBZBAnQiGGooAgAiGUUgCyAZRnJFBEAgByARRw0BAn8gCCgCQCIHRQRAIAgoAowBIQYgCCgCTAwBCyAIKAKMASIGIAduCyEMIBAgBiAPakQAAAAAAAAAABCAAQJAIA5FBEAgDCAPbCEGDAELIAwgD2whBiASRQ0AIBAoAgAgBkEDdGogBSAS/AoAAAsgBEKAgICAEDcCYCAEQQI2AmggECgCACAGQQN0aiACQQN0aiEGIAQoAjAiDSAEKAI8IhQgGGooAgBBGGxqIQtBACEFA0AgBiAEQeAAaiAFaigCACIHQQN0aiALQQhBECAHQQFGG0EAIAcbaisDADkDACAFQQRqIgVBDEcNAAsgGSELDAILIAcgEUYNAQsgByAPbCEMIBAoAgAhBiAOBEAgEgRAIAYgDEEDdGogBSAS/AoAAAsgBCgCMCENIAQoAjwhFCAQKAIAIQYLIARCgICAgBA3AmAgBiAMQQN0aiACQQN0aiEMIARBAjYCaCANIBQgGGooAgBBGGxqIRFBACEFA0AgDCAEQeAAaiAFaigCACIGQQN0aiARQQhBECAGQQFGG0EAIAYbaisDADkDACAFQQRqIgVBDEcNAAsgByERIAchDAsgCCgCeCAaaiAMNgIAIBZBAWohFiABIBdHDQALIAQoAiQiAQRAIAQgATYCKCAEKAIsGiABECIgBCgCMCENCyANBEAgBCANNgI0IAQoAjgaIA0QIgsgBCgCPCIBRQ0AIAQgATYCQCAEKAJEGiABECILIAlBAWoiCSAVRw0ACyAEKAK4AQsQ1QIgBCgCwAEiAQRAIAEQIgsgBCgC0AEiAQRAIAEQIgsgBCgC4AEiAUUNACABECILIARBoAJqJAACQCACDQAgEygC3AEiASATQeABaiIFRg0AA0AgAUEBOgCBAQJAIAEoAgQiAgRAA0AgAiIBKAIAIgINAAwCCwALA0AgASABKAIIIgEoAgBHDQALCyABIAVHDQALCyAKQQxqIApBHGoQWSAKIAopAgwiHzcCFCAKQgA3AgwgCiAfNwMAIAAgChBDAkAgCigCECIARQ0AIAAgACgCBCIBQQFrNgIEIAENACAAIAAoAgAoAggRAAAgABAkCyAKKAIgIgBFDQAgACAAKAIEIgFBAWs2AgQgAQ0AIAAgACgCACgCCBEAACAAECQLAkAgCigCKCIARQ0AIAAgACgCBCIBQQFrNgIEIAENACAAIAAoAgAoAggRAAAgABAkCyAKQTBqJAALhBIDE38IfAF+IwBBMGsiCiQAIApBJGogAUEAECsQKgJAIAooAiQiASgCRCIEBEAgACAEEEYMAQtBqAIQIyIEQaCQAjYCACAEQgA3AgQgBEEQaiABEDchASAKIAQ2AiAgCiABNgIcIwBB0AFrIgQkAAJAIAIgA3FBAEgNACABKAJcQQNJDQAgASgCTCEFIARBADYCPCAEQgA3AjQgBEE0aiAFRAAAAAAAAAAAEIABIAEoAkwhBSAEQQA2AiwgBEIANwIkIARBJGogBUQYLURU+yEZQBCAASABKAJMIQUgBEEANgIcIARCADcCFCAEQRRqIAVEAAAAAAAAAAAQgAEgASgCTCEFIARBADYCDCAEQgA3AgQgBEEEaiAFRAAAAAAAAAAAEIABIAEoAlwiBUEDbiEPIAVBA08EQCABKAKoASEHIAEoAkghDCAEKAIEIRAgBCgCFCERIAQoAiQhEiAEKAI0IQ4DQEEAIQUgBEGAAWpBAEHIAPwLACAEQgA3A3ggBEIANwNwIARCADcDaCAEQQI2AlggBEKAgICAEDcCUCAJQQNsIRMgByAJQRhsaiEIA0AgBEHoAGpBCEEQIARB0ABqIAVqKAIAIgZBAUYbQQAgBhtqIAwgBiATaiILQQJ0IhQgASgCWGoiDUF4QQQgC0EDb0ECRhtqKAIAIhVBGGxqIgsrAwAgDCANKAIAIhZBGGxqIg0rAwChIhggGKIgCysDCCANKwMIoSIaIBqioCALKwMQIA0rAxChIhkgGaKgnyIXOQMAIARBgAFqIAZBGGxqIgYgGSAXoyIZOQMQIAYgGiAXoyIaOQMIIAYgGCAXoyIYOQMAIA4gFkEDdCILaiINIBdEAAAAAAAA0D+iAnxEAAAAAAAA+H8gGSAHIAEoAmggFGooAgBBA21BGGxqIgYrAwgiFyAIKwMAIhmiIAgrAwgiGyAGKwMAIh2ioaIgGCAbIAYrAxAiGKIgCCsDECIbIBeioaJEAAAAAAAAAACgIBogGyAdoiAYIBmioaKgoCIXmUQAAAAAAADwP2QgF71C////////////AINCgICAgICAgPj/AFpyDQAaRBgtRFT7Ifk/IBdEAAAAAAAA8D9hDQAaRBgtRFT7Ifm/IBdEAAAAAAAA8L9hDQAaRBgtRFT7Ifk/IBcQXaELoiIXIA0rAwCgOQMAIA4gFUEDdGoiBiAXIAYrAwCgOQMAIAsgEGoiBiAGKwMARAAAAAAAAPA/oDkDACAFQQRqIgVBDEcNAAsgBCAEKwOwASAEKwOAASIXokQAAAAAAAAAAKAgBCsDuAEgBCsDiAEiGKKgIAQrA8ABIAQrA5ABIhqioJoQXSIcOQNQIAQgFyAEKwOYASIZokQAAAAAAAAAAKAgGCAEKwOgASIboqAgGiAEKwOoASIdoqCaEF0iHjkDWCAERBgtRFT7IQlAIByhIB6hOQNgIAQrA2ggBCsDcCAEQQI2AkwgBEKAgICAEDcCRKIgFyAboiAYIBmioSIcIByiIBggHaIgGiAboqEiGCAYoiAaIBmiIBcgHaKhIhcgF6KgoJ+iRAAAAAAAABhAoyEXIAlBDGwhBkEAIQUDQCASIAEoAlggBmogBEHEAGogBWooAgAiCEECdGooAgBBA3QiC2oiDSANKwMAIARB0ABqQQhBECAIQQFGG0EAIAgbaisDAKE5AwAgCyARaiIIIBcgCCsDAKA5AwAgBUEEaiIFQQxHDQALIAlBAWoiCSAPRw0ACwsgASgCTCIHBEBBACEFIAQoAiQhCCAEKAI0IQYgBCgCFCEMIAQoAgQhDgNAIAYgBUEDdCIJaiILIAsrAwAgCSAOaisDACAJIAxqKwMARAAAAAAAABhAoqMiF6I5AwAgCCAJaiIJIBcgCSsDAKI5AwAgBUEBaiIFIAdHDQALCyABKAJAIgUgAiADIAIgA0obQQFqIg5KIQsgAUGIAWohCQJAIAEoAowBIghFBEBBACEGDAELIAkoAgAhDSAIQQN0IgwQJyEGIAxFDQAgBiANIAz8CgAACyAFBEAgCCAFbiEHCyAEQQA2AogBIARCADcCgAEgBEGAAWoiDCAHIAUgDiALGyIIbEQAAAAAAAAAABCAAQJAIAkgDEcEQCAJKAIAIgcEQCAHECILIAEgBCgCgAE2AogBIAEgBCgChAE2AowBIAEgBCgCiAE2ApABDAELIAQoAoABIgdFDQAgBxAiCyABIAg2AkACfyAIRQRAIAEoAkwMAQsgASgCjAEgCG4LIQcgBEEANgKIASAEQgA3AoABIARBgAFqIAdBABCBASABKAJcIgdBA24hDyAHQQNPBEAgBUEDdCELQQAhDANAIARBAjYCcCAEQoCAgIAQNwJoIAxBA2whEEEAIQ4DQCAEQegAaiAOaigCACAQakECdCIHIAEoAlhqKAIAIQ0gASgCeCAHaigCACIHIAQoAoABaiIRLQAAIRIgEUEBOgAAAkAgEkEBRg0AIAtFIAVBAExyRQRAIAkoAgAgByAIbEEDdGogBiAFIAdsQQN0aiAL/AoAAAsgAkEATgRAIAkoAgAgByAIbEEDdGogAkEDdGogBCgCJCANQQN0aisDADkDAAsgA0EASA0AIAkoAgAgByAIbEEDdGogA0EDdGogBCgCNCANQQN0aisDADkDAAsgDkEEaiIOQQxHDQALIAxBAWoiDCAPRw0ACwsgBCgCgAEiAQRAIAEQIgsgBgRAIAYQIgsgBCgCBCIBBEAgARAiCyAEKAIUIgEEQCABECILIAQoAiQiAQRAIAEQIgsgBCgCNCIBRQ0AIAEQIgsgBEHQAWokACAKQQxqIApBHGoQWSAKIAopAgwiHzcCFCAKQgA3AgwgCiAfNwMAIAAgChBDAkAgCigCECIARQ0AIAAgACgCBCIBQQFrNgIEIAENACAAIAAoAgAoAggRAAAgABAkCyAKKAIgIgBFDQAgACAAKAIEIgFBAWs2AgQgAQ0AIAAgACgCACgCCBEAACAAECQLAkAgCigCKCIARQ0AIAAgACgCBCIBQQFrNgIEIAENACAAIAAoAgAoAggRAAAgABAkCyAKQTBqJAALBwAgABDBBAtbAQN/IwBBEGsiASQAIAFBCGogAEEAECsQKiABKAIIKALIAQJAIAEoAgwiAEUNACAAIAAoAgQiA0EBazYCBCADDQAgACAAKAIAKAIIEQAAIAAQJAsgAUEQaiQAC14CAn8BfCMAQRBrIgEkACABQQhqIABBABArECogASgCCEEAEIQEAkAgASgCDCIARQ0AIAAgACgCBCICQQFrNgIEIAINACAAIAAoAgAoAggRAAAgABAkCyABQRBqJAALXgICfwF8IwBBEGsiASQAIAFBCGogAEEAECsQKiABKAIIQQEQhAQCQCABKAIMIgBFDQAgACAAKAIEIgJBAWs2AgQgAg0AIAAgACgCACgCCBEAACAAECQLIAFBEGokAAsZACAAEJACIAAQoARrIAAQvwFqQX5tQQFqC54CAgJ/AXwjAEEgayIDJAAgA0EYaiABQQAQKxAqAkAgAygCGCIEKAJEIgEEQCAAIAEQRgwBC0GoAhAjIgFBoJACNgIAIAFCADcCBCABQRBqIAQQNyEEIAErA0giBSACIAJEAAAAAAAAAABhGyICIAVkBEAgASACOQNIIAQQWgsgBEEAEPgCIARBABBUIAEgBTkDSCADIAE2AhQgAyAENgIQIAEgASgCBEEBajYCBCADIAMpAhA3AwggACADQQhqEEgaIAEgASgCBCIAQQFrNgIEIAANACABIAEoAgAoAggRAAAgARAkCwJAIAMoAhwiAEUNACAAIAAoAgQiAUEBazYCBCABDQAgACAAKAIAKAIIEQAAIAAQJAsgA0EgaiQAC50CAgJ/AXwjAEEgayIDJAAgA0EYaiABQQAQKxAqAkAgAygCGCIEKAJEIgEEQCAAIAEQRgwBC0GoAhAjIgFBoJACNgIAIAFCADcCBCABQRBqIAQQNyEEAkAgASsDSCACYwRAIAEgAjkDSCAEEFogBEEAEPgCIARBABBUDAELIAEgAiABKwNAIgUgAiAFZBs5A0gLIAMgATYCFCADIAQ2AhAgASABKAIEQQFqNgIEIAMgAykCEDcDCCAAIANBCGoQSBogASABKAIEIgBBAWs2AgQgAA0AIAEgASgCACgCCBEAACABECQLAkAgAygCHCIARQ0AIAAgACgCBCIBQQFrNgIEIAENACAAIAAoAgAoAggRAAAgABAkCyADQSBqJAALXAICfwF8IwBBEGsiASQAIAFBCGogAEEAECsQKiABKAIIKwM4AkAgASgCDCIARQ0AIAAgACgCBCICQQFrNgIEIAINACAAIAAoAgAoAggRAAAgABAkCyABQRBqJAALVwEBfyMAQRBrIgMkACAAIAEQLhogAyACKAIANgIIIAMgAigCBCIBNgIMIAEEQCABIAEoAgRBAWo2AgQLIAMgAykCCDcDACAAQRBqIAMQ5wIgA0EQaiQACwIACzMBAX9B4JUCQoCAgICAgICSwAA3AwBBtJ8CQQA2AgAgAEHolQJqQoCAgICAgID4PzcDAAsZACAAQQJMQQAgABtFBEBBtJ8CIAA2AgALCxsAIABEAAAAAAAAAABlRQRAQeiVAiAAOQMACwsbACAARAAAAAAAAAAAZUUEQEHglQIgADkDAAsLBgBB1JUCCxQAIABBBGpBACABKAIEQdr/AEYbC6EDAQh/IwBBIGsiBiQAIAEoAgAiBCABKAIEQRhsaiEBIAZBCGogACgCBBBXIgchACMAQSBrIggkACAIQQhqIAAQVyIJIQAjAEEwayIFJAAgBUEYaiECIAUgABBXIQMCQAJAIAEgBCIARwRAA0AgAygCECIERQ0CIAQgACAEKAIAKAIYEQEAIABBGGoiACABRw0ACwsgAygCECIARQRAIAJBADYCEAwCCyAAIANGBEAgAiACNgIQIAAgAiAAKAIAKAIMEQEADAILIAIgADYCECADQQA2AhAMAQsQZgALAkAgAiAFKAIoIgBGBH9BEAUgAEUNAUEUCyEBIAAgACgCACABaigCABEAAAsCQCADIAMoAhAiAEYEf0EQBSAARQ0BQRQLIQEgACAAKAIAIAFqKAIAEQAACyAFQTBqJAACQCAJIAkoAhAiAEYEf0EQBSAARQ0BQRQLIQEgACAAKAIAIAFqKAIAEQAACyAIQSBqJAACQCAHKAIQIgAgB0YEf0EQBSAARQ0BQRQLIQEgACAAKAIAIAFqKAIAEQAACyAGQSBqJAALFQAgAUGklQI2AgAgASAAKAIENgIECx0BAX9BCBAjIgFBpJUCNgIAIAEgACgCBDYCBCABC/AaAxx/CHwDfiMAQaABayIEJAAgBEEYaiEGIwBBEGsiFCQAIBRBCGogAUEAECsQKiAUKAIIIQgCQCAUKAIMIgFFDQAgASABKAIEIgNBAWs2AgQgAw0AIAEgASgCACgCCBEAACABECQLQQBBfyAIEO4CGyEXIwBBoAJrIgIkAAJ/IAgoAkAiEkUEQCAIKAJMDAELIAgoAowBIBJuCyEOIAgoAsgBIQogCCgCXCEJIAZBCGoiC0EAQfgA/AsAIAYgEkEDaqw3AwAgBiAIKwM4OQOAASAGQRRqIAlBA24iEEEDbCIVENQBIAZB9ABqIAgoArwBIgdBAnQQ1AEgB0EASgRAIAYoAnQhDyAIKAK4ASERA0AgESAFQQV0IgNqIgErAwAhHiABKwMIIR8gASsDECEgIAMgD2oiAyABKwMYOQMYIAMgIDkDECADIB85AwggAyAeOQMAIAVBAWoiBSAHRw0ACwsgBkHoAGogEBDUASACQZQCaiAQEOwBIg8oAgAiBSAPKAIEIgdHBEBBACEDIAUhAQNAIAEgAzYCACADQQFqIQMgAUEEaiIBIAdHDQALCyAIKALYASERIApBAEgEQCACIAgoAtwBNgKQAiACIBE2AowCIAJBjAJqIQwCQAJAIAcgBWtBAnUiA0GBAU4EQCADIQEDQCABQQJ0EFAiEw0CIAFBAXYiAQ0ACwsgBSAHIAwgA0EAQQAQwwEMAQsgBSAHIAwgAyATIAEQwwEgExAiCwsgAiAKQQBOIhM6AIsCIAIgAkGAAmoiBzYC/AEgAkIANwKAAiACQfwBaiAIKALMASAIQdABahCDAyAJQQNPBEBBfyEBA0AgESAPKAIAIA1BAnRqKAIAIgpBBHRqIgMoAgwhDCADKAIIIQUgAiADKAIAIgk2AgAgBigCaCANQQN0aiAMIAUgBUEASBusNwMAIAJBAjYCkAEgAkKAgICAEDcCiAEgBigCFCANQRhsaiEFIAgoAlggCkEMbGohCkEAIQMDQCAFIAJBiAFqIANqKAIAIgxBA3RqIAogDEECdGo0AgA3AwAgA0EEaiIDQQxHDQALIAEgCUcEQCACQoCAgICAgID4PzcDkAEgAkF/NgKIASACQgA3A6gBIAJCADcDoAEgAkIANwOYASACQoCAgICAgID4PzcDsAEgAkIANwPIASACQgA3A8ABIAJCADcDuAEgAkKAgICAgICA+D83A9ABIAJBADsB8AEgAkIANwPoASACQgA3A+ABIAJCADcD2AEgByEBAkAgAigCgAIiBUUNAANAIAEiAyAFIgogBSgCECAJSCIMGyEBIAVBBEEAIAwbaigCACIFDQALIAEgB0YNACAJIAMgCiAMGygCEEgNACACQYgBaiABQRhqQeoA/AoAAAsgAkGLAmogBiANIAJBiAFqELQEIAJB/AFqIAIQswQgAigCACEBCyANQQFqIg0gEEcNAAsLIAcgAigC/AEiA0cEQANAIAJBiwJqIAYgECADQRhqELQEAkAgAygCBCIBBEADQCABIgMoAgAiAQ0ADAILAAsDQCADIAMoAggiAygCAEcNAAsLIAMgB0cNAAsLIAIgFa03A4gBIAZBOGogAkGIAWoQkgECQCASRQRAIAsgDkEDbBDUASAOQQBMDQEgCygCACEHIAgoAkghCkEAIQMDQCAKIANBGGwiBWoiASsDACEeIAErAwghHyAFIAdqIgUgASsDEDkDECAFIB85AwggBSAeOQMAIANBAWoiAyAORw0ACwwBCyAIKAJMIQEgAkF/NgKIASACQfwAaiABIAJBiAFqELIEIQ0gAkHwAGogCCgCTBCcAiEQIA4gBigCAGwhASMAQSBrIgUkAAJAAkAgCygCCCALKAIAIgNrQQN1IAFJBEAgAUGAgICAAk8NASAFQQxqIAEgCygCBCADa0EDdSALEEsiASgCBCALKAIEIAsoAgAiCmsiA2shByADBEAgByAKIAP8CgAACyALKAIAIQMgCyAHNgIAIAEgAzYCBCALIAEoAgg2AgQgASADNgIIIAsoAgghByALIAEoAgw2AgggASADNgIAIAEgBzYCDCABEJkBCyAFQSBqJAAMAQsQJgALIAYoAkgiASAGKAJEIgVHBEAgF0EASCATciETIAZBLGohFSAGQSBqIRggBigCOCEDQQAhCgNAIAMgCiIHQQFqIgpBA3QiGWopAwBCA4AgAyAHQQN0aikDAEIDgCImQv////8Pg1YEQCAHQeAAbCEaICanIQUDQCACQQI2AmwgAkKAgICAEDcCZCAFQRhsIRtBACEOA0AgCCgCeCAPKAIAIAVBAnRqKAIAQQxsaiACQeQAaiAOaigCACIDQQJ0aigCACEBAkAgECgCACAGKAIUIBtqIANBA3RqIgkoAgAiEUEMbGoiDCgCACIDIAwoAgQiFkcEQANAIAEgAygCAEYEQCAJIAM0AgQ3AwAMAwsgA0EIaiIDIBZHDQALCyAJIAYoAgwgBigCCGtBA3WtIAYpAwCAIibEIic3AwAgAiAmpyIWNgKMASACIAE2AogBIAwgAkGIAWoQsQQgAkECNgKQASACQoCAgIAQNwKIAUEAIQMDQCALIAgoAkggEUEYbGpBCEEQIAJBiAFqIANqKAIAIglBAUYbQQAgCRtqEKgCIANBBGoiA0EMRw0ACyASQQBKBEBBACEDIAEgEmxBA3QhAQNAIAsgCCgCiAEgAWogA0EDdGoQqAIgA0EBaiIDIBJHDQALCyATRQRAIAJCADcDWCACQgA3A1AgAkIANwNIIAYoAgAhAyAGKAIIIQEgBigCDCEJIAJBAjYCkAEgAkKAgICAEDcCiAEgF0EDdCIMIAEgCSABa0EDdSADa0EDdCIcampBGGohHUEAIQMDQCACQcgAakEIQRAgAkGIAWogA2ooAgAiCUEBRhtBACAJG2ogHSAJQQN0aisDADkDACADQQRqIgNBDEcNAAsCfCAGKAJcIAdqLQAAQQJxBEAgAisDWCEfIAIrA1AhICACKwNIDAELIAYoAlAgGmoiASsDACEeIAErAxghHyABKwMwISAgASsDCCEhIAErAyAhIiABKwM4ISMgASsDECEkIAErAyghJSACIAErA0A5A8gBIAIgJTkDwAEgAiAkOQO4ASACICM5A7ABIAIgIjkDqAEgAiAhOQOgASACICA5A5gBIAIgHzkDkAEgAiAeOQOIASACIAJBiAFqEJABRAAAAAAAAPC/RAAAAAAAAPA/IAYoAlwgB2otAABBAXEbIh4gAisDEKIgAisDSCIhoiAeIAIrAyiiIAIrA1AiIqKgIB4gAisDQKIgAisDWCIjoqAhHyACKwMIIB6iICGiIB4gAisDIKIgIqKgIB4gAisDOKIgI6KgISAgBigCCCEBIAIrAwAgHqIgIaIgHiACKwMYoiAioqAgHiACKwMwoiAjoqALIR4gAiAfIB4gHqIgICAgoqAgHyAfoqCfIh+jRAAAAAAAAAAAIB4gH6MiHr1C////////////AINCgICAgICAgPj/AFQiAxs5A1ggAiAgIB+jRAAAAAAAAAAAIAMbOQNQIAIgHkQAAAAAAAAAACADGzkDSCACQQI2ApABIAJCgICAgBA3AogBIAEgHGogDGpBGGohCUEAIQMDQCAJIAJBiAFqIANqKAIAIgFBA3RqIAJByABqQQhBECABQQFGG0EAIAEbaisDADkDACADQQRqIgNBDEcNAAsLIBFBAnQiASANKAIAaiIDKAIAQX9GBEAgAyAWNgIADAELIAIgJzcDiAEgGCACQYgBaiIDEJIBIAIgDSgCACABajQCADcDiAEgFSADEJIBCyAOQQRqIg5BDEcNAAsgBUEBaiIFrSAGKAI4IgMgGWopAwBCA4BUDQALIAYoAkQhBSAGKAJIIQELIAogASAFa0ECdUkNAAsLIAIgEDYCiAEgAkGIAWoQKSANKAIAIgFFDQAgDSABNgIEIA0oAggaIAEQIgsgAkH8AWogAigCgAIQbyAPKAIAIgEEQCAPIAE2AgQgDygCCBogARAiCyACQaACaiQAIBRBEGokACAEKAIkIAQoAiBrQQN1rSImIAQpAxgiJ4AhKCAmICdaBEBCACEmA0AgBCAEKAIgIAQoAhggJqdsQQN0aiIBKwMAOQMAIAQgASsDCDkDCCAEIAErAxA5AxAgACAEEMQBICggJkIBfCImVg0ACwsgBCgCjAEiAARAIAQgADYCkAEgBCgClAEaIAAQIgsgBCgCgAEiAARAIAQgADYChAEgBCgCiAEaIAAQIgsgBCgCdCIABEAgBCAANgJ4IAQoAnwaIAAQIgsgBCgCaCIABEAgBCAANgJsIAQoAnAaIAAQIgsgBCgCXCIABEAgBCAANgJgIAQoAmQaIAAQIgsgBCgCUCIABEAgBCAANgJUIAQoAlgaIAAQIgsgBCgCRCIABEAgBCAANgJIIAQoAkwaIAAQIgsgBCgCOCIABEAgBCAANgI8IAQoAkAaIAAQIgsgBCgCLCIABEAgBCAANgIwIAQoAjQaIAAQIgsgBCgCICIABEAgBCAANgIkIAQoAigaIAAQIgsgBEGgAWokAAuUDwINfwx8IwBBMGsiByQAIAcgAikDEDcDKCAHIAIpAwg3AyAgByACKQMANwMYIAcgAykDADcDACAHIAMpAwg3AwggByADKQMQNwMQIwBBQGoiAiQAIAJBOGogAUEAECsQKiACIAcpAxg3AyAgAiAHKQMgNwMoIAIgBykDKDcDMCACIAcpAwA3AwggAiAHKQMINwMQIAIgBykDEDcDGCACKAI4IQggAkEgaiEGIwBBwAZrIgEkAAJAIAgoAlxBAk0EQCAAQQA2AgggAEIANwIADAELIAYrAwAhEiACKwMIIRUgBisDCCETIAIrAxAhFiABIAIrAxgiFCAGKwMQIhehIhE5A9gDIAEgFiAToSIYOQPQAyABIBUgEqEiGTkDyAMgGSAZoiAYIBiioCARIBGioEQAAAAAAAAAAGEEQCAAQQA2AgggAEIANwIADAELIAFBsAFqEDshAyABQgA3A6gBIAFCADcDoAEgAUIANwOYASABQgA3AzggAUIANwNAIAFCADcDSCADQcgAakECIAFBOGoQZyADKAJIIgUgBikDEDcDECAFIAYpAwg3AwggBSAGKQMANwMAIAMoAkgiBSACKQMQNwMgIAUgAikDGDcDKCAFIAIpAwg3AxggAUIANwOAASABQgA3A5ABIAFCADcDiAEgAUIANwMoIAFCADcDMCABIAEpA4ABNwMgIANBmAFqQQIgAUEgahBnIAMoApgBQQBBMPwLACADQdgAaiIFQQNBfxAxIAVBEGpBA0F/EDEgBUEgakEDQX8QMSADKAJYIgVBADYCACADKAJoIgRBATYCACADKAJ4IglBADYCACAFQQE2AgQgBEEANgIEIAlBADYCBCAFQX82AgggBEF/NgIIIAlBADYCCCABQgA3A3ggAUIANwNwIAFCADcDaCABQgA3AwggAUIANwMQIAFCADcDGCADQagBakEBIAFBCGoQZyADKAKoASIFQgA3AxAgBUIANwMIIAVCADcDACABIAg2AmQgASADNgJgIAEgCDYCXCABIAM2AlggASAINgJUIAEgAzYCUCAAQQA2AgggAEIANwIAAkAgCCgCjAJFDQAgEiAVIBIgFWMiBRsiGiAVIBIgBRsiEiASIBpkIgUbIhVEAAAAAAAA8H9hDQAgFCAXIBQgF2QiBBsiGyAXIBQgBBsiFCAUIBtjIgQbIRcgFiATIBMgFmMiCRsiHCATIBYgCRsiEyATIBxjIgkbIRYgEiAaIAUbIRIgFCAbIAQbIRQgEyAcIAkbIRMgCCgCiAIhECAIKALoASEMQQhBECAYmSIYIBGZIhFkG0EAIBggGZkiGWNFIBEgGWNFchsiBSABQagGamohDSAFIAZqIQ4gAUHIA2ogBWohD0EBIQRBfyEGA0AgECAEQQFrQQJtQQN0aiIEKAIEIQVBACEKAn9BACAMIAQoAgAiCUEwbGoiBCsDACASZUUNABpBACAEKwMIIBZlRQ0AGkEAIAQrAxAgF2VFDQAaQQAgBCsDGCAVZkUNABpBACAEKwMgIBNmRQ0AGkEAIAQrAyggFGZFDQAaAkAgCUEBcQ0AIAFBoAZqIAFB0ABqQQAgCUEBdSIEEI0DIAEoAqAGRQ0AIAEpA6gGQv///////////wCDQv/////////3/wBWDQAgDSsDACAOKwMAoSAPKwMAoyIRRAAAAAAAAAAAZkUgEUQAAAAAAADwP2VFcg0AIAEgETkD6AUgASAErDcD4AUgASABKQO4BjcDgAYgASABKQOwBjcD+AUgASABKQOoBjcD8AUgASAIKAKoASAEQRhsaiIEKQMINwOQBiABIAQpAxA3A5gGIAEgBCkDADcDiAYgACABQeAFahCaAwsgCUGBgICAeHFBAUYLIQsCQCAMIAVBMGxqIgQrAwAgEmVFDQAgBCsDCCAWZUUNACAEKwMQIBdlRQ0AIAQrAxggFWZFDQAgBCsDICATZkUNACAEKwMoIBRmRQ0AAkAgBUEBcQ0AIAFBoAZqIAFB0ABqQQAgBUEBdSIEEI0DIAEoAqAGRQ0AIAEpA6gGQv///////////wCDQv/////////3/wBWDQAgDSsDACAOKwMAoSAPKwMAoyIRRAAAAAAAAAAAZkUgEUQAAAAAAADwP2VFcg0AIAEgETkD6AUgASAErDcD4AUgASABKQO4BjcDgAYgASABKQOwBjcD+AUgASABKQOoBjcD8AUgASAIKAKoASAEQRhsaiIEKQMINwOQBiABIAQpAxA3A5gGIAEgBCkDADcDiAYgACABQeAFahCaAwsgBUGBgICAeHFBAUYhCgsCQCAKIAtyRQRAIAZBAEgNASABQeADaiAGQQJ0aigCACEEIAZBAWshBgwCCyAJIAUgCxshBCALRSAKRXINASABQeADaiAGQQFqIgZBAnRqIAU2AgAMAQsLIAAoAgAiCCAAKAIEIgBGDQAgCCAAIAAgCGtBBnVnQQF0QT5zQQEQ/AQLIAMQOhoLIAFBwAZqJAACQCACKAI8IgBFDQAgACAAKAIEIgFBAWs2AgQgAQ0AIAAgACgCACgCCBEAACAAECQLIAJBQGskACAHQTBqJAALsQMBBH8jAEGAAWsiBCQAIAQgAikDADcDCCAEIAIpAwg3AxAgBCACKQMQNwMYIARB0ABqIQYjAEGwAWsiAiQAIAJBqAFqIAFBABArECoCQCACKAKoASgCRCIFBEAgAkGQAWoiASAFEEYgBiABEC4aIAZBGGogARAuGiABECgaDAELIAEQwAEEQCACQZABaiIBEOsBGiACQfgAaiIFEOsBGiAGIAEQiwEaIAZBGGogBRCLARogBRAoGiABECgaDAELIAJByABqIgUgARDkAiACQRhqIgcgBUEw/AoAACACIAQpAxg3AxAgAiAEKQMQNwMIIAIgBCkDCDcDACACQZABaiIFIAcgAiADEJYEIAYgASAFEJgEIAUQKBoLAkAgAigCrAEiAUUNACABIAEoAgQiBUEBazYCBCAFDQAgASABKAIAKAIIEQAAIAEQJAsgAkGwAWokACAEQSBqIAYQLiIBQRhqIARB6ABqIgYQLhogAEEANgIIIABCADcCACAAIAEgAUEwaiICQQIQlgIDQCACQRhrECgiAiABRw0ACyAGECgaIARB0ABqECgaIARBgAFqJAALDwAgAEH4lAI2AgAgABAiCw0AIABB+JQCNgIAIAALKAEBfyAAKAIAIgAoAggiAUUEQEQAAAAAAADwPw8LIAAoAgy3IAG3owsXACAAKAIAIgAEfyAALQAQBUEAC0EBcQsMACAAKAIAQQE6ABALdgECfyMAQeAAayIDJAAgA0EwaiIEIAEgAhCYBCADIAQQLiIBQRhqIANByABqIgQQLhogAEEANgIIIABCADcCACAAIAEgAUEwaiICQQIQlgIDQCACQRhrECgiAiABRw0ACyAEECgaIANBMGoQKBogA0HgAGokAAu1AQEDfyAAIwBBEGsiACQAIAAgAUEQahB/IABBCGogASAAKAIAECsQKiAAKAIIKAJEAkAgACgCDCIBRQ0AIAEgASgCBCICQQFrNgIEIAINACABIAEoAgAoAggRAAAgARAkCwJAIAAoAgQiAUUNACABIAEoAgQiAkEBazYCBCACDQAgASABKAIAKAIIEQAAIAEQJAsgAEEQaiQAIgBBDksEf0GWDgUgAEECdEHcjwJqKAIACxDRBAsPACAAQdCUAjYCACAAECILDQAgAEHQlAI2AgAgAAslAQF/IwBBEGsiASQAIAEgAEEMajYCDCABQQxqEGUgAUEQaiQACw8AIABBqJQCNgIAIAAQIgsNACAAQaiUAjYCACAACyoBAX8jAEEQayIBJAAgAEEcahAvGiAAKAIYIgAEQCAAECQLIAFBEGokAAsPACAAQYCUAjYCACAAECILDQAgAEGAlAI2AgAgAAsPACAAQdiTAjYCACAAECILDQAgAEHYkwI2AgAgAAuwAgEFfyMAQRBrIgEkACAAQRBqIgNBDGoCQCADKAIQIgBFDQAgACgCBA0AIAMoAgwhACADKAIUGiABQQA2AgggAUIANwIAIAEgATYCDCABQQxqIAAQ0gQgASgCBCICIAEoAgBHBEADQCACQQRrKAIAIQAgAkEIayIEKAIAIQIgBEIANwIAIAEgBBAvNgIEAkAgAEUNAAJAIAAoAgQNACACKAIQIgRFDQAgBCgCBA0AIAIoAhQaIAFBDGogAigCDBDSBAsgACAAKAIEIgJBAWs2AgQgAg0AIAAgACgCACgCCBEAACAAECQLIAEoAgQiAiABKAIARw0ACwsgASABNgIMIAFBDGoQZQsgA0GAAWoQLxogA0EUahAvGhAvGiADKAIIIgAEQCAAECQLIAFBEGokAAsPACAAQbCTAjYCACAAECILDQAgAEGwkwI2AgAgAAv0AgEHfyMAQdAAayIHJAAgB0EANgJIIAIEQCAHIAI2AjwgB0GMjwI2AjggByAHQThqNgJICyAHQQhqIgsgA0Ew/AoAACMAQeAAayIDJAAgASgCACICQgA3AgAgAkIFNwIIQagCECMiAkGgkAI2AgAgAkIANwIEQRAhCSACQRBqEDshCiADQcgAaiAHQThqIgwQVyEIIAEoAgAhASADQRBqIg0gC0Ew/AoAACAKIAggDSAEIAUgBiABEPsDAkAgCCgCECIBIAhHBEBBFCEJIAFFDQELIAEgASgCACAJaigCABEAAAsgAyACNgJEIAMgCjYCQCACIAIoAgRBAWo2AgQgAyADKQJANwMIIAAgA0EIahDmAiACIAIoAgQiAEEBazYCBCAARQRAIAIgAigCACgCCBEAACACECQLIANB4ABqJAACQCAMIAcoAkgiAEYEf0EQBSAARQ0BQRQLIQEgACAAKAIAIAFqKAIAEQAACyAHQdAAaiQAC1YBAn8jAEEQayICJAAjAEEQayIBJAAgASAAQRBqIgBBhAFqNgIIIAFBCGoQZSABIABB+ABqNgIMIAFBDGoQZSAAQfAAahAvGiABQRBqJAAgAkEQaiQACw8AIABBiJMCNgIAIAAQIgsNACAAQYiTAjYCACAACwQAQQELkgIBBH8jAEEQayIBJABBASEDAkAgACgCgAENAEEAIQMgAUEANgIMIAFCADcCBCABIAA2AgAgAUEEaiABED0gASgCBCICIAEoAggiAEcEQANAIABBBGsiACgCACEEIAEgADYCCAJAIAQoAoABBEAgA0EBaiEDDAELIAQoAhQaIAQoAgwiAigCACIAIAIoAgQiAkcEQANAAkAgACgCACIEIAQoAgAoAggRBABBA0YEQCADQQFqIQMMAQsgASAAKAIANgIAIAFBBGogARA9CyAAQQhqIgAgAkcNAAsLIAEoAgghACABKAIEIQILIAAgAkcNAAsLIAJFDQAgASACNgIIIAEoAgwaIAIQIgsgAUEQaiQAIAMLJQEBf0EDIQEgAC0AHCIAQQJNBH8gAEECdEGM+ABqKAIABSABCwvFIgMVfwF+DHwjAEGgAmsiBCQAIAEoAhQaAkACQAJAIAEoAoABIgUEQCAAIAU2AgAgACABKAKEASIANgIEIAAEQCAAIAAoAgRBAWo2AgQLDAELIARBADYC+AEgBEIANwLwASAEQQA6AOABIARBADYCgAIgBEEANgLoASAEIARBjAJqIAFBBGoQmwIiBygCADYCgAEgBCAHKAIEIgU2AoQBIAUEQCAFIAUoAgRBAWo2AgQLQaABECMiBUGIkwI2AgAgBUIANwIEIAQoAoQBIQMgBC0A4AEhBiABLQAcIQ0gBEEANgKEASAEKAKAASEIIARBADYCgAEgBUEQaiIKQgA3AxAgBUKAgICAgICA+D83AxggBSANOgARIAUgBjoAECAFQgA3AyggBUIANwMwIAVCADcDQCAFQoCAgICAgID4PzcDOCAFQgA3A0ggBUIANwNQIAVCADcDYCAFQoCAgICAgID4PzcDWCAFQgA3A2ggBUIANwNwIAVCADcDeCAFIAM2AoQBIAUgCDYCgAECQCADRQRAIAVCADcDmAEgBUIANwOQASAFQgA3A4gBDAELIAMgAygCBEEBajYCBCAFQgA3A5gBIAVCADcDkAEgBUIANwOIASADIAMoAgQiBkEBazYCBCAGRQRAIAMgAygCACgCCBEAACADECQLCwJAIAQoAvQBIgMgBCgC+AEiBkkEQCADIAU2AgQgAyAKNgIAIANBCGohAwwBCyADIAQoAvABIg1rQQN1IghBAWoiA0GAgICAAk8NAiAEQf////8BIAYgDWsiBkECdSINIAMgAyANSRsgBkH4////B08bIAggBEHwAWoQSyIGKAIIIgMgBTYCBCADIAo2AgAgBiADQQhqNgIIIAYoAgQgBCgC9AEgBCgC8AEiCmsiBWshAyAFBEAgAyAKIAX8CgAACyAEKALwASEFIAQgAzYC8AEgBiAFNgIEIAQgBigCCCIDNgL0ASAGIAU2AgggBCgC+AEhCiAEIAYoAgw2AvgBIAYgBTYCACAGIAo2AgwgBhBuCyAEIAM2AvQBAkAgBCgChAEiBUUNACAFIAUoAgQiA0EBazYCBCADDQAgBSAFKAIAKAIIEQAAIAUQJAsCQCAHKAIEIgVFDQAgBSAFKAIEIgNBAWs2AgQgAw0AIAUgBSgCACgCCBEAACAFECQLAkAgBCgC9AEiAyAEKALwAUcEQCABQYABaiEUIARBCGohDyAEQYgBaiENIARBlAJqIRUDQAJAIAJFDQAgAi0AEEEBRw0AIAQQmQIgBCgC8AEiByAEKAL0ASICRwRAA0AgBygCACgCcCIFKAKAAUUEQCAFQYABaiAEEF4LIAdBCGoiByACRw0ACwsgFCAEEF4gACABKAKAATYCACAAIAEoAoQBIgA2AgQgAARAIAAgACgCBEEBajYCBAsgBCgCBCIARQ0DIAAgACgCBCIBQQFrNgIEIAENAyAAIAAoAgAoAggRAAAgABAkDAMLIANBCGsoAgAhBSADQQRrKAIAIgoEQCAKIAooAgRBAWo2AgQLIAUoAnAiAygCDCEGIAMoAhQaIAUoAnAhAwJAIAUtAABBAUYEQAJAIAMoAoABDQACQAJAAkACQCADLQAcDgMAAgEDCyAEQYABaiAFQfgAaiACEPoCIAQgBCkCgAE3AgAgBEIANwKAASAGIAQgDxDuASAEEC8aIAQoAoQBIgNFDQIgAyADKAIEIgdBAWs2AgQgBw0CIAMgAygCACgCCBEAACADECQMAgsgBEGAAWpBAiAFQfgAaiACENgEIAQgBCkCgAE3AgAgBEIANwKAASAGIAQgDxDuASAEEC8aIAQoAoQBIgNFDQEgAyADKAIEIgdBAWs2AgQgBw0BIAMgAygCACgCCBEAACADECQMAQsgBSgCeCAFKAJ8RgRAIARBgAFqEPsCIAQpAoABIRggBEIANwKAASAEIBg3AgAgBiAEIA8Q7gEgBBAvGiAEKAKEASIDRQ0BIAMgAygCBCIHQQFrNgIEIAcNASADIAMoAgAoAggRAAAgAxAkDAELIAQgBUH4AGogAhD6AgJAIAUoAoQBIAUoAogBRgRAIAQgBSgCeCIDKAIANgKAASAEIAMoAgQiAzYChAEgAwRAIAMgAygCBEEBajYCBAsgBiAEQYABaiIDIA0Q7gEgAxAvGgwBCyAEQYABaiAFQYQBaiACEPoCIARB6AFqIAQoAgAQKiAEKALoASEDIARB4AFqIAQoAoABECogBEGAAmogAyAEKALgAUEBIAIQ/QIgBCAEKQKAAjcCjAIgBEIANwKAAiAGIARBjAJqIgMgFRDuASADEC8aAkAgBCgChAIiA0UNACADIAMoAgQiB0EBazYCBCAHDQAgAyADKAIAKAIIEQAAIAMQJAsCQCAEKALkASIDRQ0AIAMgAygCBCIHQQFrNgIEIAcNACADIAMoAgAoAggRAAAgAxAkCwJAIAQoAuwBIgNFDQAgAyADKAIEIgdBAWs2AgQgBw0AIAMgAygCACgCCBEAACADECQLIAQoAoQBIgNFDQAgAyADKAIEIgdBAWs2AgQgBw0AIAMgAygCACgCCBEAACADECQLIAQoAgQiA0UNACADIAMoAgQiB0EBazYCBCAHDQAgAyADKAIAKAIIEQAAIAMQJAsgBEGAAWogBigCACgCACIDIAUoAnBBIGogAygCACgCBBEDACAEIAQoAoABNgIAIAQgBCgChAEiAzYCBCADBEAgAyADKAIEQQFqNgIECyAFKAJwQYABaiAEEE4CQCAEKAIEIgNFDQAgAyADKAIEIgZBAWs2AgQgBg0AIAMgAygCACgCCBEAACADECQLIAQoAoQBIgNFDQAgAyADKAIEIgZBAWs2AgQgBg0AIAMgAygCACgCCBEAACADECQLAkAgBSgCaCIGRQ0AIARBgAFqIAUoAnAoAoABIAVBCGoQ3gQgBCgChAEiBQRAIAUgBSgCBEEBajYCBAsgBCgCgAEhBwJAIAYoAgQiAyAGKAIIIghJBEAgAyAFNgIEIAMgBzYCACADQQhqIQMMAQsgAyAGKAIAIgxrQQN1IglBAWoiA0GAgICAAk8NCSAEQf////8BIAggDGsiCEECdSIMIAMgAyAMSRsgCEH4////B08bIAkgBhBLIQggBCgCCCIDIAU2AgQgAyAHNgIAIAQgA0EIajYCCCAEKAIEIAYoAgQgBigCACIHayIDayEMIAMEQCAMIAcgA/wKAAALIAYoAgAhByAGIAw2AgAgBCAHNgIEIAYgBCgCCCIDNgIEIAQgBzYCCCAGKAIIIQwgBiAEKAIMNgIIIAQgDDYCDCAIIAc2AgAgCBBuCyAGIAM2AgQgBUUNACAFIAUoAgQiA0EBazYCBCADDQAgBSAFKAIAKAIIEQAAIAUQJAsgBCAEKAL0AUEIaxAvNgL0AQwBCyADLQAcIQwCfwJAIAUoAmhFDQACQAJAIAwgBS0AAUcNACAFKAJ0IgcEQCAHKAIEQQFKDQELIAMoAhAiA0UNACADKAIERQ0BCyAGKAIEIAYoAgBrQQhHDQELIAQgBCgC9AFBCGsQLzYC9AEgBSgCcCIDKwMgIRkgAysDKCEaIAMrAzAhGyADKwM4IRwgAysDQCEdIAMrA0ghHiADKwNQIR8gAysDWCEgIAMrA2AhISADKwNoISIgAysDcCEjIAMrA3ghJCAEQoCAgICAgID4PzcDeCAEICQ5A3AgBCAjOQNoIAQgIjkDYCAEQgA3A1ggBCAhOQNQIAQgIDkDSCAEIB85A0AgBEIANwM4IAQgHjkDMCAEIB05AyggBCAcOQMgIARCADcDGCAEIBs5AxAgBCAaOQMIIAQgGTkDACAEQYABaiAFQQhqIAQQ8AEgBSgCaCERIAUoAmwMAQsgBUEBOgAAIARCgICAgICAgPg/NwOAASANQgA3AxAgDUIANwMIIA1CADcDACAEQoCAgICAgID4PzcDoAEgBEIANwO4ASAEQgA3A7ABIARCADcDqAEgBEKAgICAgICA+D83A8ABIARCADcD2AEgBEIANwPQASAEQgA3A8gBIAVB+ABqIREgBUGEAWoLIRIgBigCACIDIAYoAgRGDQBBACEHIAxBAUYhEwNAIAQgBEGAAWpB4AD8CgAAIARBACAMIBMgB0EAR3EiBRs6AIsCIAQgEiARIAUbIgU2AugBIARBACASIAcbQQAgExs2AuABAkAgAyAHQQN0aiIDKAIAIgggCCgCACgCCBEEAEEDRgRAIARBgAJqIAMoAgAiAyAEIAMoAgAoAgQRAwAgBCgChAIiAwRAIAMgAygCBEEBajYCBAsgBCgCgAIhCQJAIAUoAgQiCCAFKAIIIgtJBEAgCCADNgIEIAggCTYCACAIQQhqIQMMAQsgCCAFKAIAIg5rQQN1IhBBAWoiCEGAgICAAk8NCiAEQYwCakH/////ASALIA5rIgtBAnUiDiAIIAggDkkbIAtB+P///wdPGyAQIAUQSyELIAQoApQCIgggAzYCBCAIIAk2AgAgBCAIQQhqNgKUAiAEKAKQAiAFKAIEIAUoAgAiCGsiA2shCSADBEAgCSAIIAP8CgAACyAFKAIAIQggBSAJNgIAIAQgCDYCkAIgBSAEKAKUAiIDNgIEIAQgCDYClAIgBSgCCCEJIAUgBCgCmAI2AgggBCAJNgKYAiALIAg2AgAgCxBuCyAFIAM2AgQgBCgChAIiBUUNASAFIAUoAgQiA0EBazYCBCADDQEgBSAFKAIAKAIIEQAAIAUQJAwBCyAEQQA6AP8BIAQgAygCADYCgAIgBCADKAIEIgU2AoQCIAUEQCAFIAUoAgRBAWo2AgQLQaABECMiCEGIkwI2AgAgCEIANwIEIwBB4ABrIgkkACAELQD/ASELIAQtAIsCIQ4gCSAEQeAA/AoAACAEKALoASEQIAQoAuABIRYgBCgChAIhAyAEQQA2AoQCIAQoAoACIRcgBEEANgKAAiAIQRBqIgUgDjoAASAFIAs6AAAgBUEIaiAJQeAA/AoAACAFIAM2AnQgBSAXNgJwIAUgFjYCbCAFIBA2AmgCQCADRQRAIAVCADcDiAEgBUIANwOAASAFQgA3A3gMAQsgAyADKAIEQQFqNgIEIAVCADcDiAEgBUIANwOAASAFQgA3A3ggAyADKAIEIgtBAWs2AgQgCw0AIAMgAygCACgCCBEAACADECQLIAlB4ABqJAACQCAEKAL0ASIDIAQoAvgBIglJBEAgAyAINgIEIAMgBTYCACADQQhqIQMMAQsgAyAEKALwASILa0EDdSIOQQFqIgNBgICAgAJPDQggBEGMAmpB/////wEgCSALayIJQQJ1IgsgAyADIAtJGyAJQfj///8HTxsgDiAEQfABahBLIQkgBCgClAIiAyAINgIEIAMgBTYCACAEIANBCGo2ApQCIAQoApACIAQoAvQBIAQoAvABIghrIgVrIQMgBQRAIAMgCCAF/AoAAAsgBCAEKALwASIFNgKQAiAEIAM2AvABIAQoApQCIQMgBCAFNgKUAiAEIAM2AvQBIAQoAvgBIQggBCAEKAKYAjYC+AEgBCAINgKYAiAJIAU2AgAgCRBuCyAEIAM2AvQBIAQoAoQCIgVFDQAgBSAFKAIEIgNBAWs2AgQgAw0AIAUgBSgCACgCCBEAACAFECQLIAdBAWoiByAGKAIEIAYoAgAiA2tBA3VJDQALCwJAIApFDQAgCiAKKAIEIgVBAWs2AgQgBQ0AIAogCigCACgCCBEAACAKECQLIAQoAvQBIgMgBCgC8AFHDQALCyAAIAEoAoABNgIAIAAgASgChAEiADYCBCAARQ0AIAAgACgCBEEBajYCBAsgBCAEQfABajYCACAEEGULIARBoAJqJAAPCxAmAAsQJgALwwQCBH8MfCMAQfABayIDJABBmAEQIyIGQbCTAjYCACAGQgA3AgQjAEEQayIFJAAgBkEQaiIEQgA3AgQgBEG0kgI2AgAgBUEANgIIIAVCADcCACAEQQxqIAUQ0wQgBSAFNgIMIAVBDGoQZSAEQgA3AyggBEKAgICAgICA+D83AyAgBEIANwMwIARCADcDOCAEQgA3A0ggBEKAgICAgICA+D83A0AgBEIANwNQIARCADcDWCAEQgA3A2ggBEKAgICAgICA+D83A2AgBEIANwNwIARCADcDeCAEQgA3A4ABIAVBEGokACADQegBaiIFIAY2AgQgBSAENgIAIAUgBkEUaiAEEI8BIAMoAugBQQxqIgQgAUEMaiIFRwRAIAQgBRBeIARBCGogBUEIahBeCyABKwMgIQcgASsDKCEIIAErAzAhCSABKwM4IQogASsDQCELIAErA0ghDCABKwNQIQ0gASsDWCEOIAErA2AhDyABKwNoIRAgASsDcCERIAErA3ghEiADQoCAgICAgID4PzcDgAEgAyASOQN4IAMgETkDcCADIBA5A2ggA0IANwNgIAMgDzkDWCADIA45A1AgAyANOQNIIANCADcDQCADIAw5AzggAyALOQMwIAMgCjkDKCADQgA3AyAgAyAJOQMYIAMgCDkDECADIAc5AwggA0GIAWoiBCACIANBCGoQ8AEgAygC6AEiAkEgaiAEQeAA/AoAACACIAEtABw6ABwgACACNgIAIAAgAygC7AE2AgQgA0HwAWokAAtnAQJ/IwBBgAFrIgQkACAEIAIQ3wEjAEEQayICJAAgASgCACIFQgA3AgAgBUIONwIIIAJBCGogBCADIAEoAgAQkwUgAiACKQIINwMAIAAgAhDmAiACQRBqJAAgBBCqASAEQYABaiQAC44BAQJ/IwBBgAFrIgQkACAEIAIQ3wEjAEEQayICJAAgASgCACIDQgA3AgAgA0IHNwIIIAEoAgAhA0GoAhAjIgFBoJACNgIAIAFCADcCBCABQRBqIAQgAxCTAyEDIAIgATYCDCACIAM2AgggAiACKQIINwMAIAAgAhDmAiACQRBqJAAgBBCqASAEQYABaiQAC9oCAQd/IwBB0ABrIgYkACAGQQA2AkggAQRAIAYgATYCPCAGQYyPAjYCOCAGIAZBOGo2AkgLIAZBCGoiByACQTD8CgAAIwBB4ABrIgIkAEGoAhAjIgFBoJACNgIAIAFCADcCBEEQIQkgAUEQahA7IQogAkHIAGogBkE4aiILEFchCCACQRBqIgwgB0Ew/AoAACAKIAggDCADIAQgBUEAEPsDAkAgCCAIKAIQIgdHBEBBFCEJIAdFDQELIAcgBygCACAJaigCABEAAAsgAiABNgJEIAIgCjYCQCABIAEoAgRBAWo2AgQgAiACKQJANwMIIAAgAkEIahBIGiABIAEoAgQiAEEBazYCBCAARQRAIAEgASgCACgCCBEAACABECQLIAJB4ABqJAACQCALIAYoAkgiAEYEf0EQBSAARQ0BQRQLIQEgACAAKAIAIAFqKAIAEQAACyAGQdAAaiQACwQAQQML4AEBAn8jAEEQayICJABBoAEQIyIEQYCUAjYCACAEQgA3AgQgBEEQaiIDQgA3AyAgA0KAgICAgICA+D83AxggA0IANwIMIANCADcCBCADQgA3AyggA0IANwMwIANCADcDQCADQoCAgICAgID4PzcDOCADQgA3A0ggA0IANwNQIANCgICAgICAgPg/NwNYIANBmJICNgIAIANB4ABqQQBBMPwLACADQQxqIAFBDGoQXiADQRhqIAFBGGpB4AD8CgAAIAAgBDYCBCAAIAM2AgAgACAEQRRqIAMQjwEgAkEQaiQAC48HAg9/A34jAEEgayIGJAAgBkEANgIYIAMEQCAGIAM2AgwgBkG0jgI2AgggBiAGQQhqNgIYCyAGQQhqIQsjAEHwAGsiAyQAIANBIGogAUEAECsQKgJAIAMoAiAiBygCRCIEBEAgACAEEEYMAQtBqAIQIyIEQaCQAjYCACAEQgA3AgQgBEEQaiAHEDchByADIAQ2AhwgAyAHNgIYIARBmAFqIQcgARCfBCEOAkAgBCgCnAEiBUUNACAHKAIAIQkgBUEDdCIFECchCCAFRQ0AIAggCSAF/AoAAAsCQCACRQRAIARBADYCnAEgBxCUAQwBCyABEJ4EIQUgA0EANgJYIANCADcCUCADQdAAaiACIAVsRAAAAAAAAAAAEIABIAcoAgAiBQRAIAUQIgsgBCADKAJQNgKYASAEIAMoAlQ2ApwBIAQgAygCWDYCoAEgARC/ASIPRQ0AIAJBA3QhDCACQQBMIRBBACEBA0AgA0ECNgJMIANCgICAgBA3AkQgAUEDbCERQQAhBQNAIANBxABqIAVqKAIAIBFqQQJ0IgogBCgCiAFqKAIAIQkCQCALKAIQIg1FBEAgECAMRXINASAHKAIAIAIgCWxBA3RqQQAgDPwLAAwBCyAEKAKYASESIAMgBCgCWCAEKAJoIApqKAIAQRhsaiIKKQMQIhM3AzggAyAKKQMIIhQ3AzAgAyAKKQMAIhU3AyggAyAVNwNQIAMgFDcDWCADIBM3A2AgAyASIAIgCWxBA3RqNgJsIAMgCCAJIA5sQQN0ajYCaCANIANB7ABqIANB0ABqIANB6ABqIA0oAgAoAhgRBQALIAVBBGoiBUEMRw0ACyABQQFqIgEgD0cNAAsLIAQgAjYCUCADQdAAaiADQRhqEFkgAyADKQJQIhM3AhAgA0IANwJQIAMgEzcDCCAAIANBCGoQQwJAIAMoAlQiAEUNACAAIAAoAgQiAUEBazYCBCABDQAgACAAKAIAKAIIEQAAIAAQJAsgCARAIAgQIgsgAygCHCIARQ0AIAAgACgCBCIBQQFrNgIEIAENACAAIAAoAgAoAggRAAAgABAkCwJAIAMoAiQiAEUNACAAIAAoAgQiAUEBazYCBCABDQAgACAAKAIAKAIIEQAAIAAQJAsgA0HwAGokAAJAIAsgBigCGCIARgR/QRAFIABFDQFBFAshASAAIAAoAgAgAWooAgARAAALIAZBIGokAAvHAwIDfwF+IwBBIGsiAyQAIAMgAjYCHCADQeyNAjYCACADIAM2AhAgAyADQRxqNgIEIwBB0ABrIgIkACACQcQAaiABQQAQKxAqAkAgAigCRCIEKAJEIgEEQCAAIAEQRgwBC0GoAhAjIgFBoJACNgIAIAFCADcCBEEQIQUgAUEQaiAEEDchBCACIAE2AkAgAiAENgI8IAQgAkEgaiADEFciBBC7BAJAIAQgBCgCECIBRwRAQRQhBSABRQ0BCyABIAEoAgAgBWooAgARAAALIAJBEGogAkE8ahBZIAIgAikCECIGNwIYIAJCADcCECACIAY3AwggACACQQhqEEMCQCACKAIUIgBFDQAgACAAKAIEIgFBAWs2AgQgAQ0AIAAgACgCACgCCBEAACAAECQLIAIoAkAiAEUNACAAIAAoAgQiAUEBazYCBCABDQAgACAAKAIAKAIIEQAAIAAQJAsCQCACKAJIIgBFDQAgACAAKAIEIgFBAWs2AgQgAQ0AIAAgACgCACgCCBEAACAAECQLIAJB0ABqJAACQCADIAMoAhAiAEYEf0EQBSAARQ0BQRQLIQEgACAAKAIAIAFqKAIAEQAACyADQSBqJAAL4QIBAn8jAEEgayIEJAAgBCADOgAeAkAgA0H9AXEgAigCACIFIAUoAgAoAggRBABBA0ZyRQRAIAIoAgAhBSACKAIEIgIEQCACIAIoAgRBAWo2AgQLIAAgBSAEIAFBBGoQmwIiACADEN8EAkAgACgCBCIARQ0AIAAgACgCBCIBQQFrNgIEIAENACAAIAAoAgAoAggRAAAgABAkCyACRQ0BIAIgAigCBCIAQQFrNgIEIAANASACIAIoAgAoAggRAAAgAhAkDAELIAQgAUEEahCbAiIBIAIoAgA2AgggASACKAIEIgI2AgwgAgRAIAIgAigCBEEBajYCBAsgBEEANgIYIARCADcCECAEQRBqIAEgAUEQaiICQQIQgQMDQCACQQhrEC8iAiABRw0ACyAEIARBEGoiASAEQR5qEIADIAAgBCgCADYCACAAIAQoAgQ2AgQgBCABNgIAIAQQZQsgBEEgaiQAC60EAgZ/AX4jAEEgayIDJAAgA0EANgIYIAIEQCADIAI2AgwgA0GUjQI2AgggAyADQQhqNgIYCyADQQhqIQcjAEHQAGsiAiQAIAJBxABqIAFBABArECoCQCACKAJEIgQoAkQiAQRAIAAgARBGDAELQagCECMiAUGgkAI2AgAgAUIANwIEQRAhCCABQRBqIAQQNyEEIAIgATYCQCACIAQ2AjwgAkEgaiAHEFchBiMAQSBrIgEkACABIAY2AgwgAUGklQI2AgggASABQQhqIgU2AhggBCAFELsEAkAgBSABKAIYIgRGBH9BEAUgBEUNAUEUCyEFIAQgBCgCACAFaigCABEAAAsgAUEgaiQAAkAgBiAGKAIQIgFHBEBBFCEIIAFFDQELIAEgASgCACAIaigCABEAAAsgAkEQaiACQTxqEFkgAiACKQIQIgk3AhggAkIANwIQIAIgCTcDCCAAIAJBCGoQQwJAIAIoAhQiAEUNACAAIAAoAgQiAUEBazYCBCABDQAgACAAKAIAKAIIEQAAIAAQJAsgAigCQCIARQ0AIAAgACgCBCIBQQFrNgIEIAENACAAIAAoAgAoAggRAAAgABAkCwJAIAIoAkgiAEUNACAAIAAoAgQiAUEBazYCBCABDQAgACAAKAIAKAIIEQAAIAAQJAsgAkHQAGokAAJAIAcgAygCGCIARgR/QRAFIABFDQFBFAshASAAIAAoAgAgAWooAgARAAALIANBIGokAAsGAEGIkgILFAAgAEEEakEAIAEoAgRB5PAARhsLCwAgAUHYkQI2AgALEQBBCBAjIgBB2JECNgIAIAALBgBByJECCxQAIABBBGpBACABKAIEQfvrAEYbCwsAIAFBkJECNgIACxEAQQgQIyIAQZCRAjYCACAAC5sDAgl/AXwjAEGQAWsiAyQAIANBhAFqIAIQlgUgA0EgakEAQeAA/AsAIANCgoCAgDA3AhggA0KAgICAEDcCECADQThqIQggAygChAEhCQNAIANBEGogBmooAgAhBCADQoCAgIAQNwIEIAkgBEEFdGohCiADQQI2AgwgA0EgakEwQcgAIARBAkYbaiELQQAhAgNAIAogA0EEaiACaigCACIHQQN0aisDACEMIANBIGohBQJAAkACQCAEDgICAAELIAghBQwBCyALIQULIAVBCEEQIAdBAUYbQQAgBxtqIAw5AwAgAkEEaiICQQxHDQALIAZBBGoiBkEQRw0ACyMAQSBrIgIkACACQRBqIAEQigEgAkEYaiACKAIQIgEgA0EgaiABKAIAKAIEEQMAIAIgAikCGDcDCCAAIAJBCGoQQwJAIAIoAhQiAEUNACAAIAAoAgQiAUEBazYCBCABDQAgACAAKAIAKAIIEQAAIAAQJAsgAkEgaiQAIAMoAoQBIgAEQCADIAA2AogBIAMoAowBGiAAECILIANBkAFqJAALCwAgACABQQIQiAELCwAgACABQQEQiAELCwAgACABQQAQiAELDQAgACABIAJBAhDoAQsNACAAIAEgAkEBEOgBCw0AIAAgASACQQAQ6AELBgBBgJECCxQAIABBBGpBACABKAIEQefoAEYbC/0BAQN/IwBBgAFrIgMkACADIAEQ3wEjAEEgayIBJABBJBAjIgJCADcCDCACQYSWAjYCACACQgA3AgQgAkIANwIUIAJCADcCHCAAIAI2AgQgACACQQxqNgIAQagCECMiAkGgkAI2AgAgAkIANwIEIAJBEGogA0EAEJMDIQQgASACNgIQIAEgBDYCDCABQRRqIAFBDGoQ3AQgACABKAIUNgIIIAAgASgCGDYCDCABQgA3AhQCQCABKAIQIgJFDQAgAiACKAIEIgRBAWs2AgQgBA0AIAIgAigCACgCCBEAACACECQLIABCADcCECABQSBqJAAgAxCqASADQYABaiQACxUAIAFByJACNgIAIAEgACgCBDYCBAsdAQF/QQgQIyIBQciQAjYCACABIAAoAgQ2AgQgAQsPACAAQaCQAjYCACAAECILDQAgAEGgkAI2AgAgAAvwEAITfwJ+IwBB0AFrIgMkACADQcgBaiICIAFBABArECoCQCADKALIASgCRCIEBEAgA0GwAWoiASAEEEYgAEEANgIIIABCADcCACAAIAEgAkEBEJYCIAEQKBoMAQsgA0GkAWogARCQAiICEJYBIQ0gAgRAIAKtIRYDQCANKAIAIBWnQQN0aiAVNwMAIBVCAXwiFSAWUg0ACwsgAygCyAEiBCgCXARAQQAhAgNAIAQoAlggAkECdGoiBSgCACIGIAVBeEEEIAJBA29BAkYbaigCACIFSARAIA0gBiAFEF8gAygCyAEhBAsgAkEBaiICIAQoAlxJDQALCyADQQA2AqABIANCADcCmAECQCANIANBmAFqEIwFIhNBAUYEQCAAQQEQkQMoAgAgARCjBAwBCwJAIAMoApwBIgQgAygCmAEiAkYNACAEIAJrIgQQJyEOIARFDQAgDiACIAT8CgAACyABEJACIQ8gAEEANgIIIABCADcCACATQQBKBEADQEGoAhAjIghBoJACNgIAIAhCADcCBCAIQRBqEDshBiAIIAMoAsgBIgIrAzA5A0AgCCACKwM4OQNIQQAhAiADQQA2ApABIANCADcCiAEgA0GIAWogDxAlIAMgDzYCjAEgAygCiAEiBSEEIA8EQANAIBAgDiACQQJ0aigCAEYEQCAEIAI2AgAgBEEEaiEECyACQQFqIgIgD0cNAAsLIANCADcDgAEgA0IANwN4IANCADcDcCADQgA3AyggA0IANwMwIANCADcDOCAIQdgAaiAEIAVrQQJ1IgQgA0EoahBnIANCADcDaCADQgA3A2AgA0IANwNYIANCADcDECADQgA3AxggA0IANwMgIAhBqAFqIAQgA0EQahBnQQAhAiADQYgBaiAEQQAQMSADKAKMASIEBEAgCCgCWCEKIAMoAsgBIgsoAkghDCADKAKIASEFA0AgCiACQRhsaiIHIAwgBSACQQJ0aigCAEEYbGoiCSkDEDcDECAHIAkpAwg3AwggByAJKQMANwMAIAJBAWoiAiAERw0ACyAIKAKoASEKIAsoApgBIQtBACECA0AgCiACQRhsaiIHIAsgBSACQQJ0aigCAEEYbGoiCSkDEDcDECAHIAkpAwg3AwggByAJKQMANwMAIAJBAWoiAiAERw0ACwtBACECIANBADYCUCADQgA3AkggA0HIAGogARC/ARAlIAMoAsgBIQcgARC/AQRAA0AgECAOIAcoAlggAkEMbGooAgBBAnRqKAIARgRAAkAgAygCTCIEIAMoAlAiBU8EQCADQcgAaiAFQQF0QYABIAUbECUgAygCSCADKAJMIgRBAnRqIAI2AgAMAQsgAygCSCAEQQJ0aiACNgIACyADIARBAWo2AkwLIAEQvwEgAkEBaiICSw0ACwsgAygCTARAIAMoAsgBIQcjAEFAaiIFJAAgBigC3AEhAiAGQdgBaiIEIAMoAkwiCRA5IAYgCTYC3AEgAkERSSACIAlBAXQiCk1yRQRAIAQQgwELIAMoAkwiCwRAIAQoAgAhBCAHKALYASEMIAMoAkghEUEAIQIDQCAEIAJBBHRqIhIgDCARIAJBAnRqKAIAQQR0aiIUKQIINwIIIBIgFCkCADcCACACQQFqIgIgC0cNAAsLIAcoAswBIgIgB0HQAWoiC0cEQCAGQcwBaiEMA0AgBSACQRBqIgQ2AjwgBUEoaiAMIAQgBUE8ahB5IAUoAihBGGogAkEYakHqAPwKAAACQCACKAIEIgQEQANAIAQiAigCACIEDQAMAgsACwNAIAIgAigCCCICKAIARw0ACwsgAiALRw0ACwsgBygCQCICBEAgBiACNgJAIAZBiAFqIAdBiAFqEJICCwJAIAcoAqwBIAcoAlxBA25HDQAgBigCrAEhAiAGQagBaiIEIAkQMyAGIAk2AqwBIAJBEUkgAiAKTXJFBEAgBBBxCyADKAJMIgtFDQAgBCgCACEMIAcoAqgBIREgAygCSCESQQAhAgNAIAwgAkEYbGoiBCARIBIgAkECdGooAgBBGGxqIgopAxA3AxAgBCAKKQMINwMIIAQgCikDADcDACACQQFqIgIgC0cNAAsLIAcoAlwhBEEAIQIgBUEANgIwIAVCADcCKCAFQShqIARBA24iBBAlIAUgBDYCLCAJBEAgAygCSCEEIAUoAighCgNAIAogBCACQQJ0aigCAEECdGogAjYCACACQQFqIgIgCUcNAAsLIAZB2ABqIgogCUEDbCICEMkBAkAgBygCvAFFDQAgBigCvAEhBCAGQbgBaiILIAIQVSAGIAI2ArwBIARBEUkgBCAJQQZsTXINACALEJMBCyAFIAo2AgAgBSAGKAK4ATYCBCAGKAK8ASECIAUgB0HYAGo2AgwgBSACNgIIIAUgBykDuAE3AhAgBSADKQJINwIYIAUgBSkCKDcCICAJQQAgBRDdAyAFKAIoIgIEQCACECILIAVBQGskACAGIANBiAFqIAMoAsgBKAJMQQAQ4QMgBhBYIAZBABBUIAMgCDYCRCADIAY2AkAgCCAIKAIEQQFqNgIEIAMgAykCQDcDCCAAIANBsAFqIANBCGoQSCICEJgBIAIQKBoLIAMoAkgiAgRAIAIQIgsgAygCiAEiAgRAIAIQIgsgCCAIKAIEIgJBAWs2AgQgAkUEQCAIIAgoAgAoAggRAAAgCBAkCyAQQQFqIhAgE0cNAAsLIA5FDQAgDhAiCyADKAKYASIABEAgAyAANgKcASADKAKgARogABAiCyANKAIAIgBFDQAgDSAANgIEIA0oAggaIAAQIgsCQCADKALMASIARQ0AIAAgACgCBCIBQQFrNgIEIAENACAAIAAoAgAoAggRAAAgABAkCyADQdABaiQAC8cQAhR/BnwjAEHgAGsiBCQAIARBADYCXCAEQgA3AlQCQAJAIAEoAgAiBiABKAIEIgpHBEADQCAGKAIEIgEgBigCACIHa0EEdSEIQQAhBQJAAkAgASAHRg0AA0AgByAFQQR0aisDAEQAAAAAAAAAAGNFDQEgBUEBaiIFIAhHDQALDAELIAUgCEYNACAEQQA2AkggBEIANwJAIARB1ABqIARBQGsQaCAEKAJAIgEEQCAEIAE2AkQgBCgCSBogARAiCyAFIQEDQCAGKAIAIg0gAUEEdCIHaiIIKwMAIhhEAAAAAAAAAABmBEAgBCgCWEEMayAIEEwgBigCACINIAdqKwMAIhggGSAYIBlkGyEZCyAYRAAAAAAAAAAAYyANIAFBAWoiAUEAIAEgBigCBCANa0EEdUcbIgFBBHRqIggrAwAiG0QAAAAAAAAAAGNHBEAgByANaisDCCEdIAgrAwghHCAEKAJYIARCADcDQCAEIBwgGyAdIByhoiAYIBuho6E5A0hBDGsgBEFAaxBMCyABIAVHDQALCyAGQQxqIgYgCkcNAAsgBCgCVCAEKAJYRw0BCyAAEOoBDAELRAAAAAAAgHZAIAMgA0QAAAAAAIB2QGQbIRogAkEDTgR8IAK4BSAaIBkQwgG3okQAAAAAAIB2QKMLIQNBqAIQIyIJQaCQAjYCACAJQgA3AgQgCUEQahA7IQwgBEEANgJIIARCADcCQCAEQQA2AjwgBEIANwI0IARBADYCMCAEQgA3AiggBCgCVCILIAQoAlgiFUcEQCAJQdgAaiEWIBogA/wCIhK3oyEZQQAgEiAaRAAAAAAAgHZAYmoiD2shFwNAQQAhBkEAIQIgCygCACIBIQUgCygCBCIKIAFHBEADQCAGIAUrAwBEAAAAAAAAAABkIghqIQYgAiAIRWohAiAFQRBqIgUgCkcNAAsgBiAPbCACaiEIQQAhAgNAIAkoAlwhDiAaRAAAAAAAgHZAYSITRQRAIAQgDjYCGCAEQTRqIARBGGoQPSALKAIAIQELIAEgAkEEdGoiBSsDCCEbIAUrAwAhGEEAIQUgAiIGRQRAIAsoAgQgAWtBBHUhBiAIIQULIA9BAEoEQCAFIA5qQX8gFyABIAZBBHRqQRBrKwMAIhxEAAAAAAAAAABhIg0baiEQQQAhAQNAAkACQEEAIAEgGEQAAAAAAAAAAGQbDQAgGCAZIAG4oiIDRAAAAAAAgFZAoBA+oiEdIBggAxA+oiEDAkAgCSgCXCIFIAkoAmAiBk8EQCAWIAZBAXRBgAEgBhsQMyAJIAkoAlwiBUEBajYCXAwBCyAJIAVBAWo2AlwLIAkoAlggBUEYbGoiBSAdOQMAIAUgGzkDECAFIAM5AwggEw0AIAFFDQELIAEgEiABG0EBayERIBhEAAAAAAAAAABkBEAgDiARaiEHIAEgDmohCkEAIBEgDRsgEGohBQJAIAQoAkQiBiAEKAJIIhRPBEAgBEFAayAUQQF0QYABIBQbEDUgBCAEKAJEIgZBAWo2AkQMAQsgBCAGQQFqNgJECyAEKAJAIAZBDGxqIgYgCjYCACAGIAU2AgggBiAHNgIECyAcRAAAAAAAAAAAZEUNACAQIBFqIQogAUEAIBhEAAAAAAAAAABiGyAOaiEGAkAgBCgCRCIFIAQoAkgiB08EQCAEQUBrIAdBAXRBgAEgBxsQNSAEIAQoAkQiBUEBajYCRAwBCyAEIAVBAWo2AkQLIAQoAkAgBUEMbGoiBSAKNgIAIAUgBjYCCCAFIAEgEGo2AgQLIAFBAWoiASAPRw0ACwsgE0UEQCAEIAkoAlxBAWs2AhggBEEoaiAEQRhqED0LIAJBAWoiAiALKAIEIAsoAgAiAWtBBHVJDQALCyALQQxqIgsgFUcNAAsLAkAgGkQAAAAAAIB2QGENACAEQRhqIARB1ABqIAkrA0BBARCHBCAEKAIYIgEgBCgCHCICRwRAIAQoAkQhBQNAIAQoAjQiCCABKAIIQQJ0aigCACEKIAggASgCBEECdGooAgAhBiAIIAEoAgBBAnRqKAIAIQgCfyAEKAJIIgcgBU0EQCAEQUBrIAdBAXRBgAEgBxsQNSAEKAJAIAQoAkQiBUEMbGoMAQsgBCgCQCAFQQxsagsiByAINgIAIAcgCjYCCCAHIAY2AgQgBCAFQQFqIgU2AkQgAUEMaiIBIAJHDQALIAQoAhwhAiAEKAIYIQELIAEgAkcEQCAEKAJEIQUDQCAEKAIoIgggASgCAEECdGooAgAhCiAIIAEoAgRBAnRqKAIAIQYgCCABKAIIQQJ0aigCACEIAn8gBCgCSCIHIAVNBEAgBEFAayAHQQF0QYABIAcbEDUgBCgCQCAEKAJEIgVBDGxqDAELIAQoAkAgBUEMbGoLIgcgCDYCACAHIAo2AgggByAGNgIEIAQgBUEBaiIFNgJEIAFBDGoiASACRw0ACyAEKAIYIQELIAFFDQAgBCABNgIcIAQoAiAaIAEQIgsgBEEANgIgIARCADcCGCAMIARBQGsgBEEYahCeASAEKAIYIgEEQCABECILIAwQjgEgDBBYIAxBABCNASAMQQAQVCAMEFogBCAJNgIUIAQgDDYCECAJIAkoAgRBAWo2AgQgBCAEKQIQNwMIIAAgBEEIahBIGiAEKAIoIgAEQCAEIAA2AiwgBCgCMBogABAiCyAEKAI0IgAEQCAEIAA2AjggBCgCPBogABAiCyAEKAJAIgAEQCAAECILIAkgCSgCBCIAQQFrNgIEIAANACAJIAkoAgAoAggRAAAgCRAkCyAEIARB1ABqNgJAIARBQGsQKSAEQeAAaiQAC5sHAg1/AX4jAEEgayIIJAAgCEEUaiABEMYDIAgoAhQiASAIKAIYIg1HBEADQCAIQQhqIAEQPCEKIAAoAgQhBCAKKAIAIgMhByAIKAIMIQIjAEEgayILJAACQCACIANrQQR1IglBAEwNACAAKAIIIgUgACgCBCIDa0EEdSAJTgRAIAMgBGsiDEEEdSIOIAlIBEAgAiAHIAxqIgVrIgZFIAIgBUZyRQRAIAMgBSAG/AoAAAsgACADIAZqIgU2AgQgDkEATA0CIAQgCUEEdCIGaiEJIAMgBSICIAZrIgZLBEADQCACIAYpAwg3AwggAiAGKQMANwMAIAJBEGohAiAGQRBqIgYgA0kNAAsLIAAgAjYCBAJAIAUgCUYNACAFIAlrIgJFDQAgBSACayAEIAL8CgAACyAEIAxqIQMgBCECA0AgBykDACEPIAIgBykDCDcDCCACIA83AwAgB0EQaiEHIAJBEGoiAiADRw0ACwwCCyAEIAlBBHQiBmohBSADIgIgBmsiBiACSQRAA0AgAiAGKQMINwMIIAIgBikDADcDACACQRBqIQIgBkEQaiIGIANJDQALCyAAIAI2AgQCQCADIAVGDQAgAyAFayICRQ0AIAMgAmsgBCAC/AoAAAsgBCAJQQR0aiEDIAQhAgNAIAcpAwAhDyACIAcpAwg3AwggAiAPNwMAIAdBEGohByACQRBqIgIgA0cNAAsMAQsgAyAAKAIAIgJrQQR1IAlqIgNBgICAgAFJBEAgC0EMakH/////ACAFIAJrIgVBA3UiBiADIAMgBkkbIAVB8P///wdPGyAEIAJrQQR1IAAQMiIDKAIIIgIgCUEEdGohBQNAIAIgBykDCDcDCCACIAcpAwA3AwAgB0EQaiEHIAJBEGoiAiAFRw0ACyADIAU2AgggAygCBBogACgCBCAEayICBEAgBSAEIAL8CgAACyADIAMoAgggACgCBCAEa2o2AgggACAENgIEIAMoAgQgBCAAKAIAIgVrIgJrIQQgAgRAIAQgBSAC/AoAAAsgACgCACECIAAgBDYCACADIAI2AgQgACADKAIINgIEIAMgAjYCCCAAKAIIIQQgACADKAIMNgIIIAMgAjYCACADIAQ2AgwgAxA2DAELECYACyALQSBqJAAgCigCACICBEAgCCACNgIMIAgoAhAaIAIQIgsgAUEMaiIBIA1HDQALCyAIIAhBFGo2AgggCEEIahApIAhBIGokAAvMBAICfwN8IwBB0ABrIgMkAAJAIAFEAAAAAAAAAABlBEAgABDqAQwBCyACQQBKBH8gAkEDakECdgUgARDCAUEEbQshAiADQQI2AkAgA0HEAGogA0FAaxCSBSADIAI2AhwgA0HIkAI2AhggAyADQRhqIgI2AiggA0EwaiADKAJEIAJBABDVAyADKAIwIgIEQCACECILIANBADYCOCADQgA3AjACQCADKAIoIgIgA0EYakYEf0EQBSACRQ0BQRQLIQQgAiACKAIAIARqKAIAEQAACyADKAJEIgIoAkwiBAR/IAIoAkgiAiAEQRhsaiEEA0BEAAAAAAAA8D8gAisDAKFEGC1EVPsh+T+iEJcBIQVEAAAAAAAA8D8gAisDCKFEGC1EVPsh+T+iEJcBIQcgAiABRAAAAAAAAPA/IAIrAxChRBgtRFT7Ifk/ohCXASIGIAUgBaIgByAHoqAgBiAGoqCfIgajojkDECACIAEgByAGo6I5AwggAiABIAUgBqOiIgU5AwAgBSAFYgRAIAJCADcDECACQgA3AwggAkIANwMACyACQRhqIgIgBEcNAAsgAygCRAUgAgsQjgEgAygCRBBYIAMoAkRBABCNASADKAJEQQAQVCADKAJEEFogAyADKAJENgIQIAMgAygCSCICNgIUIAIEQCACIAIoAgRBAWo2AgQLIAMgAykCEDcDCCAAIANBCGoQSBogAygCSCIARQ0AIAAgACgCBCICQQFrNgIEIAINACAAIAAoAgAoAggRAAAgABAkCyADQdAAaiQAC8NFAxR/A34HfCAF/AIhBkQAAAAAAAAAACEFIwBBMGsiEiQAAkBBAyADIANBA08bIgNBAUYEQEECIQdEGC1EVPshCUAgBkECTAR/IAIQwgEFIAYLt6MQlwEgEkEcaiABEE1EAAAAAAAA8L+gIAKZmqIhBSASKAIcIQEMAQsgEkEcaiABEE0gEigCHCEBAkACQCADQQJrDgIAAQILQQMhBwwBC0EBIQcLIBJBJGohEyMAQcABayIQJAAgEEEANgK4AQJAAkAgAkQAAAAAAAAAAGEEQCATQQA2AgggE0IANwIAIBMgASgCACIDIAEoAgQiASABIANrQQxtEEcMAQsgEEEANgIYIBBBIGpBAEHcAPwLACAQQQA2ArABIBBBADsBmAEgECAEOQOIASAQQgE3AnwgECAFIwBBEGsiBiQARAAAAAAAACRAEK0BIQMCfAJARAAAAAAAACBAEK0BIgpB/w9xIgxBvghrIg1B/35LIANB/w9rQYJwT3ENAEQAAAAAAABQQEKAgICAgICAkMAAEKYDDQEaRAAAAAAAAFlAQoCAgICAgICSwAAQpgMNARogDUH/fk0EQEQAAAAAAAAiQCAMQb0HTQ0CGiAKQf8PTQRARAAAAAAAAABwEPkBDAMLRAAAAAAAAAAQEPkBDAILIAMNAAsCfCAGQcjBASsDAEQAAAAAAAAIQKJBgN0BKwMAoEHo3AErAwAiBEQAAAAAAAD0P6JEAAAAAAAA8L+gIgUgBEQAAAAAAAAAAKIiHaAiBEHAwQErAwBEAAAAAAAACECiQfjcASsDAKAiHiAEIB6gIh6hoKAgHSAEQdDBASsDACIdoiIfIAUgHaIiHaCioCAFIB2iIgUgHiAeIAWgIgWhoKAgBCAEIB+iIh6iIB4gHiAEQYDCASsDAKJB+MEBKwMAoKIgBEHwwQErAwCiQejBASsDAKCgoiAEQeDBASsDAKJB2MEBKwMAoKCioCIEIAUgBSAEoCIFoaA5AwggBb1CgICAQIO/Ih5EAAAAAAAAIECiIQQgHkQAAAAAAAAAAKIgBisDCCAFIB6hoEQAAAAAAAAgQKKgAkAgBBCtAUH/D3EiA0QAAAAAAACQPBCtASIKa0QAAAAAAACAQBCtASAKa0kNACAERAAAAAAAAPA/oCADIApJDQEaRAAAAAAAAJBAEK0BIANLQQAhAw0AIAS9QgBTBEBEAAAAAAAAABAQ+QEMAgtEAAAAAAAAAHAQ+QEMAQsgBEHQsAErAwCiQdiwASsDACIFoCIeIAWhIgVB6LABKwMAoiAFQeCwASsDAKIgBKCgoCIEIASiIgUgBaIgBEGIsQErAwCiQYCxASsDAKCiIAUgBEH4sAErAwCiQfCwASsDAKCiIB69IhunQQR0QfAPcSIKKwPAsQEgBKCgoCEEIAopA8ixASAbQi2GfCEaIANFBEACfCAbQoCAgIAIg1AEQCAaQoCAgICAgICIP32/IgUgBKIgBaBEAAAAAAAAAH+iDAELIBpCgICAgICAgPA/fCIavyIFIASiIh0gBaAiBJlEAAAAAAAA8D9jBHxEAAAAAAAAEAAQpwNEAAAAAAAAEACiIR4jAEEQayAeOQMIIBpCgICAgICAgICAf4O/IAREAAAAAAAA8L9EAAAAAAAA8D8gBEQAAAAAAAAAAGMbIh6gIh8gHSAFIAShoCAEIB4gH6GgoKAgHqEiBCAERAAAAAAAAAAAYRsFIAQLRAAAAAAAABAAogsMAQsgGr8iBSAEoiAFoAsLIR8gBkEQaiQAIB+iOQOQASAQQQxqIgogASAfIB8gEEG4AWoQwgIgEEEYaiEMIwBBIGsiCSQAAkAgCigCBCAKKAIARwRAAkAgDCgCXCIBIAwoAmAiBkkEQCABIAogBxCuAyABQSBqIQcMAQsgASAMQdgAaiIDKAIAIg1rQQV1Ig5BAWoiAUGAgIDAAE8NBCAJQQxqQf///z8gBiANayIGQQR1Ig0gASABIA1JGyAGQeD///8HTxsgDiADEJYDIgEoAgggCiAHEK4DIAEgASgCCEEgajYCCCADKAIAIgchDSADKAIEIgYhDiABKAIEIAcgBmtqIgshBiMAQRBrIggkACANIA5HBEADQCAGQQA2AgggBkIANwIAIAYgBygCADYCACAGIAcoAgQ2AgQgBiAHKAIINgIIIAdBADYCCCAHQgA3AgAgBiAHKAIcNgIcIAYgBykCFDcCFCAGIAcpAgw3AgwgBkEgaiEGIAdBIGoiByAORw0ACwNAIAggDTYCDCAIQQxqECkgDUEgaiINIA5HDQALCyAIQRBqJAAgASALNgIEIAMgAygCACIGNgIEIAMgASgCBDYCACABIAY2AgQgAygCBCEGIAMgASgCCDYCBCABIAY2AgggAygCCCEGIAMgASgCDDYCCCABIAY2AgwgASABKAIENgIAIAwoAlwhByMAQRBrIgMkACABKAIEIg0gASgCCCIGRwRAA0AgASAGQSBrIgY2AgggAyAGNgIMIANBDGoQKSANIAEoAggiBkcNAAsLIANBEGokACABKAIAIgMEQCABKAIMGiADECILCyAMIAc2AlwLIAlBIGokAAwACyAQIAo2ArwBIBBBvAFqECkCQCAQKAK4AQRAIBNBADYCCCATQgA3AgAMAQsgEEEANgIUIBBCADcCDCAQQQxqIhYgECgCDBB7IBBBGGoiB0EANgJUIAcgFjYCUCACIB+iIQJBACEBIwBBoAFrIgwkACAHQQA2AgACQCAHKAJcIgMgBygCWCIKRg0AIAcoAlADQCAKKAIEIAooAgBrQQxtIAooAhxBAUZ0IAFqIQEgCkEgaiIKIANHDQALIAEQVgJAIAKZRAAAAAAAAOA/YwRAQQAhASAHKAJYIgogBygCXCIDRwRAA0AgCigCBCAKKAIAa0EMbSABaiEBIApBIGoiCiADRw0ACwsgBygCUCABEFYgBygCWCIBIAcoAlwiA0YNAQNAIAEoAgAiCiABKAIEIgZHBEAgBygCUCENA0AgDSAKEHYgCkEMaiIKIAZHDQALCyABQSBqIgEgA0cNAAsMAQtEAAAAAAAAAEAhHSAHKwNwIgREAAAAAAAA8D9lRQRARAAAAAAAAABAIAQgBKKjIR0LIAcgAjkDCCAHIB05AxggBygCWCIKIAcoAlxGDQADQCMAQTBrIg4kACAHAnwgCigCHCIDRQRAIAcrAwghAiAKLQAQRQRAIAcgApkiAjkDCAsgApogAiAKLQAUGwwBCyAHKwMImQsiAjkDECAKKAIYIQEgByADNgJoIAcgATYCZCACmSEdAkAgAUECRwRAIAooAhxBBEcNAQsgB0QYLURU+yEZQCAdRBgtRFT7IQlAoiIFRBgtRFT7IQlARAAAAAAAAPA/IAcrA3giBCAdIAQgHWMbIB1E/Knx0k1iYD+iIAREEeotgZmXcT1kGyAdo6EQqgOjIgQgBCAFZBsiBKMiBRCxAjkDMCAHIAUQsAIiBTkDKCACRAAAAAAAAAAAYwRAIAcgBZo5AygLIAcgBEQYLURU+yEZQKM5AyALIAooAgAiDSAKKAIERwRAIAdBOGohFyAHQYgBaiEYIAdBxABqIRUDQCANKAIAIQEgDSgCBCEDIAcgBygCRDYCSAJAAkACQAJAIAMgAWtBBHVBAWsOAgABAgsCQCAHKAKYAQRAIAcgGCANIBdBAEEAEPsBIgI5AxAgCi0AFEEBRgRAIAcgApoiAjkDEAsgApkhHQwBCyAHKwMQIQILIAJEAAAAAAAA8D9jDQIgDSgCACEJAkAgCigCGEECRgRAIA5BEGohASAHKwMgIgIgAqBEGC1EVPshCUCim/wDQQAgAkQAAAAAAAAAAGQbIQsjAEEgayIDJAACQAJAIB1EAAAAAAAAAABlBEAgAUEANgIIIAFCADcCAAwBCyABQQA2AgggAUIANwIAIAtBAk0EQCAdIB2gRAAAAAAAAOA/op9EGC1EVPshCUCi/AMhCwsgASALEFwgHSAJKQMAuaAhAiABKAIIIQggASgCBCEGIAkpAwi5IQREGC1EVPshGUAgC7ijIh4QsQIhBSAeELACIR4CQCAGIAhJBEAgBiAE/AY3AwggBiACEDT8BjcDACAGQRBqIQYMAQsgBiABKAIAIhFrQQR1Ig9BAWoiBkGAgICAAU8NDyADQQxqQf////8AIAggEWsiCEEDdSIRIAYgBiARSRsgCEHw////B08bIA8gARAyIggoAggiBiAE/AY3AwggBiACEDT8BjcDACAIIAZBEGo2AgggCCgCBCABKAIEIAEoAgAiEWsiBmshDyAGBEAgDyARIAb8CgAACyABKAIAIREgASAPNgIAIAggETYCBCABIAgoAggiBjYCBCAIIBE2AgggASgCCCEPIAEgCCgCDDYCCCAIIBE2AgAgCCAPNgIMIAgQNgsgASAGNgIEIAtBAkkNACAemiEiQQEhESAeIQIgBSEEA0AgHSACoiAJKQMIuaAhICAdIASiIAkpAwC5oCEhAkAgASgCCCIIIAZLBEAgBiAgEDT8BjcDCCAGICEQNPwGNwMAIAZBEGohBgwBCyAGIAEoAgAiD2tBBHUiFEEBaiIGQYCAgIABTw0QICAQNCEgIANBDGpB/////wAgCCAPayIIQQN1Ig8gBiAGIA9JGyAIQfD///8HTxsgFCABEDIhDyADKAIUIgYgIPwGNwMIIAYgIRA0/AY3AwAgAyAGQRBqNgIUIAMoAhAgASgCBCABKAIAIghrIgZrIRQgBgRAIBQgCCAG/AoAAAsgASgCACEIIAEgFDYCACADIAg2AhAgASADKAIUIgY2AgQgAyAINgIUIAEoAgghFCABIAMoAhg2AgggAyAUNgIYIA8gCDYCACAPEDYLIAEgBjYCBCAeIASiIAQgBaIgAiAioqAhBCACIAWioCECIBFBAWoiESALRw0ACwsgA0EgaiQADAALIBUQRSAHIA4oAhA2AkQgByAOKAIUNgJIIAcgDigCGDYCTAwBCyAJKQMAIRsgDiAJKQMIIhwgHZv8AqwiGnw3AyggDiAaIBt8NwMgIA4gHCAafTcDGCAOIBsgGn03AxAjAEEgayIIJAAgDkEEaiIBQQA2AgggAUIANwIAIAFBBBBcAkACQCABKAIEIgMgASgCCCIGSQRAIA4pAxAhGiADIA4pAxg3AwggAyAaNwMAIANBEGohAwwBCyADIAEoAgAiCWtBBHUiC0EBaiIDQYCAgIABTw0NIAhBDGpB/////wAgBiAJayIGQQN1IgkgAyADIAlJGyAGQfD///8HTxsgCyABEDIhBiAOKQMQIRogBigCCCIDIA4pAxg3AwggAyAaNwMAIAYgA0EQajYCCCAGKAIEIAEoAgQgASgCACIJayIDayELIAMEQCALIAkgA/wKAAALIAEoAgAhCSABIAs2AgAgBiAJNgIEIAEgBigCCCIDNgIEIAYgCTYCCCABKAIIIQsgASAGKAIMNgIIIAYgCTYCACAGIAs2AgwgBhA2IAEoAgghBgsgASADNgIEAkAgAyAGSQRAIA4pAyAhGiADIA4pAxg3AwggAyAaNwMAIANBEGohAwwBCyADIAEoAgAiCWtBBHUiC0EBaiIDQYCAgIABTw0NIAhBDGpB/////wAgBiAJayIGQQN1IgkgAyADIAlJGyAGQfD///8HTxsgCyABEDIhBiAOKQMgIRogBigCCCIDIA4pAxg3AwggAyAaNwMAIAYgA0EQajYCCCAGKAIEIAEoAgQgASgCACIJayIDayELIAMEQCALIAkgA/wKAAALIAEoAgAhCSABIAs2AgAgBiAJNgIEIAEgBigCCCIDNgIEIAYgCTYCCCABKAIIIQsgASAGKAIMNgIIIAYgCTYCACAGIAs2AgwgBhA2IAEoAgghBgsgASADNgIEAkAgAyAGSQRAIA4pAyAhGiADIA4pAyg3AwggAyAaNwMAIANBEGohAwwBCyADIAEoAgAiCWtBBHUiC0EBaiIDQYCAgIABTw0NIAhBDGpB/////wAgBiAJayIGQQN1IgkgAyADIAlJGyAGQfD///8HTxsgCyABEDIhBiAOKQMgIRogBigCCCIDIA4pAyg3AwggAyAaNwMAIAYgA0EQajYCCCAGKAIEIAEoAgQgASgCACIJayIDayELIAMEQCALIAkgA/wKAAALIAEoAgAhCSABIAs2AgAgBiAJNgIEIAEgBigCCCIDNgIEIAYgCTYCCCABKAIIIQsgASAGKAIMNgIIIAYgCTYCACAGIAs2AgwgBhA2IAEoAgghBgsgASADNgIEAkAgAyAGSQRAIA4pAxAhGiADIA4pAyg3AwggAyAaNwMAIANBEGohCQwBCyADIAEoAgAiCWtBBHUiC0EBaiIDQYCAgIABTw0NIAhBDGpB/////wAgBiAJayIGQQN1IgkgAyADIAlJGyAGQfD///8HTxsgCyABEDIhAyAOKQMQIRogAygCCCIGIA4pAyg3AwggBiAaNwMAIAMgBkEQajYCCCADKAIEIAEoAgQgASgCACILayIGayEJIAYEQCAJIAsgBvwKAAALIAEoAgAhBiABIAk2AgAgAyAGNgIEIAEgAygCCCIJNgIEIAMgBjYCCCABKAIIIQsgASADKAIMNgIIIAMgBjYCACADIAs2AgwgAxA2CyABIAk2AgQgCEEgaiQADAALIBUQRSAHIA4oAgQ2AkQgByAOKAIINgJIIAcgDigCDDYCTAsgBygCUCAVEHYMAgsgCigCHEEBRw0AIAdBBEEDIAooAhhBAkYbNgJoCyMAQTBrIgEkACAHIAcoAjg2AjwgB0E4aiIIIA0oAgQgDSgCAGtBBHUQXAJAIA0oAgQiCSANKAIAIgZHBEAgBygCPCEDIAlBEGsiCyAGRwRAA0AgAUEIaiAGIAZBEGoiBhCtAwJAIAcoAkAiCSADSwRAIAMgASkDEDcDCCADIAEpAwg3AwAgA0EQaiEDDAELIAMgCCgCACIRa0EEdSIPQQFqIgNBgICAgAFPDQ0gAUEcakH/////ACAJIBFrIglBA3UiESADIAMgEUkbIAlB8P///wdPGyAPIAgQMiERIAEoAiQiAyABKQMQNwMIIAMgASkDCDcDACABIAEoAiRBEGo2AiQgASgCICAHKAI8IAcoAjgiCWsiA2shDyADBEAgDyAJIAP8CgAACyAHKAI4IQkgByAPNgI4IAEgCTYCICAHIAEoAiQiAzYCPCABIAk2AiQgBygCQCEPIAcgASgCKDYCQCABIA82AiggESAJNgIAIBEQNgsgByADNgI8IAYgC0cNAAsgDSgCACEGCyABQQhqIAsgBhCtAwJAIAcoAkAiBiADSwRAIAMgASkDEDcDCCADIAEpAwg3AwAgA0EQaiEGDAELIAMgCCgCACIJa0EEdSILQQFqIgNBgICAgAFPDQsgAUEcakH/////ACAGIAlrIgZBA3UiCSADIAMgCUkbIAZB8P///wdPGyALIAgQMiIDKAIIIgYgASkDEDcDCCAGIAEpAwg3AwAgAyADKAIIQRBqNgIIIAMoAgQgBygCPCAHKAI4IghrIgZrIQkgBgRAIAkgCCAG/AoAAAsgBygCOCEIIAcgCTYCOCADIAg2AgQgByADKAIIIgY2AjwgAyAINgIIIAcoAkAhCSAHIAMoAgw2AkAgAyAINgIAIAMgCTYCDCADEDYLIAcgBjYCPAsgAUEwaiQADAALAkACQAJAIAcoAmgOAgABAgsgByAKIA0QswIMAgsjAEEwayIIJAAgByAKIA0QswICQCAIQQxqIA0QPCIJKAIAIgEgCSgCBCIDRg0AIAEgA0EQayIDTw0AA0AgCCABKQMINwMgIAggASkDADcDGCABIAMpAwg3AwggASADKQMANwMAIAMgCCkDIDcDCCADIAgpAxg3AwAgAUEQaiIBIANBEGsiA0kNAAsLAkAgBygCOCIBIAcoAjwiBkYNACABIAZBEGsiA08NAANAIAggASkDCDcDICAIIAEpAwA3AxggASADKQMINwMIIAEgAykDADcDACADIAgpAyA3AwggAyAIKQMYNwMAIAFBEGoiASADQRBrIgNJDQALIAcoAjwhBiAHKAI4IQELIAdBOGohEQJAAkAgBygCQCILIAZLBEAgBiABKQMINwMIIAYgASkDADcDACAGQRBqIQYMAQsgBiABa0EEdSIGQQFqIgNBgICAgAFPDQsgCEEYakH/////ACALIAFrIgtBA3UiDyADIAMgD0kbIAtB8P///wdPGyAGIBEQMiIDKAIIIgYgASkDCDcDCCAGIAEpAwA3AwAgAyADKAIIQRBqNgIIIAMoAgQgBygCPCAHKAI4IgtrIgFrIQYgAQRAIAYgCyAB/AoAAAsgBygCOCEBIAcgBjYCOCADIAE2AgQgByADKAIIIgY2AjwgAyABNgIIIAcoAkAhCyAHIAMoAgw2AkAgAyABNgIAIAMgCzYCDCADEDYLIAcgBjYCPCAGIAcoAjgiA0EQaiIPayELIAMhASAGIA9HBEAgCwRAIAEgDyAL/AoAAAsgESgCACEBCyAHIAMgC2oiAzYCPCABIANHBEADQCABIAErAwCaOQMAIAEgASsDCJo5AwggAUEQaiIBIANHDQALCyAHIAogCRCzAiAJKAIAIgEEQCAJIAE2AgQgCSgCCBogARAiCyAIQTBqJAAMAAsMAQsjAEEgayIJJAAgB0GIAWohCwJAIAcoApgBRQRAIAcrAxAhAgwBCyAHIAsgDSAHQThqQQBBABD7ASICOQMQCwJAAkAgAplEEeotgZmXcT1lBEAgDSgCACEDAkAgBygCSCIBIAcoAkwiBkkEQCABIAMpAwg3AwggASADKQMANwMAIAFBEGohAwwBCyABIAdBxABqIggoAgAiEWtBBHUiD0EBaiIBQYCAgIABTw0MIAlBDGpB/////wAgBiARayIGQQN1IhEgASABIBFJGyAGQfD///8HTxsgDyAIEDIiASgCCCIGIAMpAwg3AwggBiADKQMANwMAIAEgASgCCEEQajYCCCABKAIEIAcoAkggBygCRCIGayIDayEIIAMEQCAIIAYgA/wKAAALIAcoAkQhBiAHIAg2AkQgASAGNgIEIAcgASgCCCIDNgJIIAEgBjYCCCAHKAJMIQggByABKAIMNgJMIAEgBjYCACABIAg2AgwgARA2CyAHIAM2AkgMAQsCQAJAAkAgBygCaEECaw4DAAIBAgsgByANQQBBABC3AgwCCyAHIA1BAEEARBgtRFT7IQlAELUCDAELIAcgDUEAQQAQtgILQQEhASANKAIEIA0oAgBrQQR1IhFBAWsiA0EBSwRAQQAhBgNAIAcgCiANIAEgBhC0AiABIgZBAWoiASADRw0ACwsgBygCOCEIIAMEQCADIQEDQCAIIAFBAWsiBkEEdGoiDysDACECIAggAUEEdGoiASAPKwMImjkDCCABIAKaOQMAIAYiAQ0ACwsgCCAIIANBBHRqIgEpAwg3AwggCCABKQMANwMAAkAgBygCmAFFBEAgBysDECECDAELIAcgCyANIAdBOGogAyADEPsBIgI5AxALAkAgAplEEeotgZmXcT1lBEAgDSgCACADQQR0aiEGAkAgBygCSCIBIAcoAkwiCEkEQCABIAYpAwg3AwggASAGKQMANwMAIAFBEGohBgwBCyABIAdBxABqIgsoAgAiD2tBBHUiFEEBaiIBQYCAgIABTw0MIAlBDGpB/////wAgCCAPayIIQQN1Ig8gASABIA9JGyAIQfD///8HTxsgFCALEDIiASgCCCIIIAYpAwg3AwggCCAGKQMANwMAIAEgASgCCEEQajYCCCABKAIEIAcoAkggBygCRCIIayIGayELIAYEQCALIAggBvwKAAALIAcoAkQhCCAHIAs2AkQgASAINgIEIAcgASgCCCIGNgJIIAEgCDYCCCAHKAJMIQsgByABKAIMNgJMIAEgCDYCACABIAs2AgwgARA2CyAHIAY2AkgMAQsCQAJAAkAgBygCaEECaw4DAAIBAgsgByANIAMgAxC3AgwCCyAHIA0gAyADRBgtRFT7IQlAELUCDAELIAcgDSADIAMQtgILIBFBAmsiAQRAA0AgByAKIA0gASADELQCIAEiA0EBayIBDQALCyAHKAJQIAdBxABqEHYgCUEgaiQADAALCyANQQxqIg0gCigCBEcNAAsLIA5BMGokACAHKAIABEAgBygCUCIBIAEoAgAQewsgCkEgaiIKIAcoAlxHDQALCyAHKAJQIgEoAgQgASgCAEYNAAJ/QQAgBygCWCIKIAcoAlwiA0YNABoCQANAIAooAhxFDQEgCkEgaiIKIANHDQALQQAMAQsgCi0AFAshAyAMQQA7ARggDEIANwMQIAxBAjYCDCAMQgA3AgQgDEEcakEAQTD8CwAgDEHQAGpBAEEk/AsAIAxBADYCiAEgDEIANwOAASAMQYACOwF8IAxBADYCeCAMQaicAjYCACAMIActAIABOgB0IAwgA0EBcSIDIActAIEBRzoAdSAMIAFBABDAAgJAIAcoAlQiAQRAIAMEQCAMQQA2ApgBIAxCADcCkAEgDEEDIAEgDEGQAWoiARCsAwwCCyAMQQA2ApgBIAxCADcCkAEgDEECIAEgDEGQAWoiARCsAwwBCyAHKAJQIQEgAwRAIAxBADYCmAEgDEIANwKQASAMQQMgASAMQZABaiIBEKsDDAELIAxBADYCmAEgDEIANwKQASAMQQIgASAMQZABaiIBEKsDCyAMIAE2ApwBIAxBnAFqECkgDBBpGgsgDEGgAWokAEQAAAAAAADwPyAfoyECIwBBIGsiASQAIBNBADYCCCATQgA3AgAgEyAQKAIQIBAoAgxrQQxtEFYCQAJAIBAoAgwiByAQKAIQIgZHBEAgAkQAAAAAAAAAAGEiAyADciEKA0AgAUEANgIMIAFCADcCBCAKDQIgAUEEaiAHKAIEIAcoAgBrQQR1EFwgBygCACIDIAcoAgQiDEcEQANAIAMpAwAhGiABIAIgAykDCLmiOQMYIAEgAiAauaI5AxAgAUEEaiABQRBqEEwgA0EQaiIDIAxHDQALCyATIAFBBGoQaCABKAIEIgMEQCABIAM2AgggASgCDBogAxAiCyAHQQxqIgcgBkcNAAsLIAFBIGokAAwBCyAQIBAoArgBQQJyNgK4AUECEIICAAsgECAWNgK8ASAQQbwBahApCyMAQRBrIgwkACMAQRBrIgMkACAQQRhqIgoiASgCWCIGIAEoAlwiB0cEQANAIAMgB0EgayIHNgIMIANBDGoQKSAGIAdHDQALCyABIAY2AlwgASABKAI4NgI8IANBEGokAAJAIAooApgBIgEgCkGIAWpGBH9BEAUgAUUNAUEUCyEDIAEgASgCACADaigCABEAAAsgDCAKQdgAajYCDCMAQRBrIg4kACAMKAIMIgMoAgAiAQRAIAEiByADIgYoAgQiDUcEQANAIA4gDUEgayINNgIMIA5BDGoQKSABIA1HDQALIAwoAgwiBigCACEHCyADIAE2AgQgBigCCBogBxAiCyAOQRBqJAAgCigCRCIBBEAgCiABNgJIIAooAkwaIAEQIgsgCigCOCIBBEAgCiABNgI8IAooAkAaIAEQIgsgDEEQaiQACyAQQcABaiQAAkAgEigCICIBRQ0AIAEgASgCBCIDQQFrNgIEIAMNACABIAEoAgAoAggRAAAgARAkC0EYECMiAUG0mgI2AgAgAUIANwIEIAFBDGoiAyASQSRqIgYQWyASIAE2AhggEiADNgIUIBIgEikCFDcDCCAAIBJBCGoQaiASIAY2AhwgEkEcahApIBJBMGokAA8LECYACzwBAX8jAEEgayIBJAAgAUEANgIQIAFBFGogAUEQahCSBSABIAEpAhQ3AwggACABQQhqEEgaIAFBIGokAAsGAEHEjwILFAAgAEEEakEAIAEoAgRBueYARhsLrgcCCH8BfCMAQSBrIgUkACAFQQA2AhggAgRAIAUgAjYCDCAFQbyMAjYCCCAFIAVBCGo2AhgLIwBBIGsiBiQAIAYgBUEIaiIKNgIMIAZByJsCNgIIIAYgBkEIaiIJNgIYIwBB8AFrIgIkACACQQA2AjwgAkIANwI0IAJBQGsgARBNIAJBADYCMCACQgA3AiggAkEoaiACKAJAIgEoAgAiAyABKAIEIgEgASADa0EMbRBHAkAgAigCRCIBRQ0AIAEgASgCBCIDQQFrNgIEIAMNACABIAEoAgAoAggRAAAgARAkCyACKAIoIgEgAigCLCIERwRAA0AgASgCACIDIAEoAgQiB0cEQANAIAMrAwAhCyACIAMrAwg5A0ggAiALOQNAIAJBNGogAkFAaxBMIANBEGoiAyAHRw0ACwsgAUEMaiIBIARHDQALCyACIAIoAjQiATYCICACIAIoAjggAWtBBHU2AiQCQCAJKAIQIgEEQCABIAJBIGogASgCACgCGBEBACACKAIoIgQgAigCLCIHRwRAIAIoAjQhAQNAIAQoAgAiAyAEKAIEIghHBEADQCABKwMAIQsgAyABKwMIOQMIIAMgCzkDACABQRBqIQEgA0EQaiIDIAhHDQALCyAEQQxqIgQgB0cNAAsLIAJBADYCFCACQgA3AgwgAkHYAGpBAEHoAPwLACACQgA3A1AgAkECNgJMIAJCADcCRCACQdwAakEAQTD8CwAgAkGQAWpBAEEk/AsAIAJBADYCyAEgAkIANwPAASACQQE6AL0BIAJBAToAtAEgAkKAgICAgICAoD43A9gBIAJCgICAgICAgNDBADcD0AEgAkH8mgI2AkAgAkFAayIBIAJBKGoiBxCbASACQQA2AugBIAJCADcC4AEgAUECQQIgAkEMaiIEIAJB4AFqIgMQ4gEgAiADNgLsASACQewBahApIAEQaRpBGBAjIgNBtJoCNgIAIANCADcCBCADQQxqIgggBBBbIAIgAzYCHCACIAg2AhggAiACKQIYNwMAIAAgAhBqIAIgBDYCQCABECkgAiAHNgJAIAEQKSACKAI0IgAEQCACIAA2AjggAigCPBogABAiCyACQfABaiQADAELEGYACwJAIAkgBigCGCIARgR/QRAFIABFDQFBFAshASAAIAAoAgAgAWooAgARAAALIAZBIGokAAJAIAogBSgCGCIARgR/QRAFIABFDQFBFAshASAAIAAoAgAgAWooAgARAAALIAVBIGokAAsMACABIAAoAgQREAALFQAgAUGMjwI2AgAgASAAKAIENgIECx0BAX9BCBAjIgFBjI8CNgIAIAEgACgCBDYCBCABCwYAQeyOAgsUACAAQQRqQQAgASgCBEGL5QBGGwtRAQF/IwBBIGsiBCQAIAMoAgAhAyABKAIAIAAoAgQhACAEIAIpAxA3AxggBCACKQMINwMQIAQgAikDADcDCCAEQQhqIAMgABEDACAEQSBqJAALFQAgAUG0jgI2AgAgASAAKAIENgIECx0BAX9BCBAjIgFBtI4CNgIAIAEgACgCBDYCBCABCwYAQaSOAgsUACAAQQRqQQAgASgCBEHj4wBGGwuCAgEGfyMAQRBrIgIkACABKAIAIQcgASgCBCEEQQAhASACQQA2AgwgAkIANwIEIAJBBGogBEEDbBDUASACKAIEIQUgBARAA0AgBSABQRhsIgZqIgMgBiAHaiIGKwMAOQMAIAMgBisDCDkDCCADIAYrAxA5AxAgAUEBaiIBIARHDQALCyAFIAQgACgCBCgCABEBACACKAIEIQACQAJAIAQEQEEAIQEDQCAHIAFBGGwiA2oiBSAAIANqIgMrAwA5AwAgBSADKwMIOQMIIAUgAysDEDkDECABQQFqIgEgBEcNAAsMAQsgAEUNAQsgAiAANgIIIAIoAgwaIAAQIgsgAkEQaiQACxUAIAFB7I0CNgIAIAEgACgCBDYCBAsdAQF/QQgQIyIBQeyNAjYCACABIAAoAgQ2AgQgAQsGAEHMjQILFAAgAEEEakEAIAEoAgRB8+EARhsLFQAgAUGUjQI2AgAgASAAKAIENgIECx0BAX9BCBAjIgFBlI0CNgIAIAEgACgCBDYCBCABCwYAQfSMAgsUACAAQQRqQQAgASgCBEHQ4ABGGwsVACABQbyMAjYCACABIAAoAgQ2AgQLHQEBf0EIECMiAUG8jAI2AgAgASAAKAIENgIEIAEL2gEBAX8jAEFAaiIEJAAgACgCACEAIAQgAikDEDcDKCAEIAIpAwg3AyAgBCACKQMANwMYIAQgAykDADcDACAEIAMpAwg3AwggBCADKQMQNwMQIARBNGogASAEQRhqIAQgABEFAEEMECMiAEEANgIIIABCADcCACAEKAI4IgEgBCgCNCICRwRAIAAgASACayIBQQZ1EJUDIAAoAgQhAyABBEAgAyACIAH8CgAACyAAIAEgA2o2AgQLIAQoAjQiAQRAIAQgATYCOCAEKAI8GiABECILIARBQGskACAAC3kBBX8jAEEQayICJAAgAkEEaiIFIAEgACgCABEBACACKAIIIAIsAA8iASABQQBIIgYbIgBBBGoQJyIDIAA2AgAgAigCBCEEIAAEQCADQQRqIAQgBSAGGyAA/AoAAAsgAUEASARAIAIoAgwaIAQQIgsgAkEQaiQAIAML6wEBBn8jAEHgAGsiAyQAIANB1ABqIAIQlgUgA0EgakEAQTD8CwAgA0ECNgIcIANCgICAgBA3AhQgAygCVCEFA0AgA0EUaiAEaigCACECIANCgICAgBA3AgwgBSACQRhsaiEGIANBIGpBEEEgIAJBAUYbQQAgAhtqIQdBACECA0AgB0EIQQAgA0EMaiACaigCACIIG2ogBiAIQQN0aisDADkDACACQQRqIgJBCEcNAAsgBEEEaiIEQQxHDQALIAAgASADQSBqEOABIAMoAlQiAARAIAMgADYCWCADKAJcGiAAECILIANB4ABqJAALNgECfyMAQSBrIgQkACAEQQhqIgUgASACIAMgACgCABEFAEEYECMgBRAuIAUQKBogBEEgaiQACyoBAX8jAEEQayIDJAAgA0EIaiABIAIgACgCABEDACADKAIMIANBEGokAAthAQF/IwBBMGsiBCQAIAAoAgAhACAEIAIpAxA3AxggBCACKQMINwMQIAQgAikDADcDCCAEQSBqIgIgASAEQQhqIAMgABEPACACEJQDIAQgAjYCLCAEQSxqEHogBEEwaiQACzUBAX8jAEEQayIDJAAgAyABIAIgACgCABEDACADEJQDIAMgAzYCDCADQQxqEHogA0EQaiQACzYBAX8jAEFAaiIGJAAgBiABIAIgAyAEIAUgACgCABEqAEHAABAjIAYQQCAGEEEaIAZBQGskAAsLACAAIAFBAhDFAgtfAQF/IwBB0ABrIgMkACAAKAIAIQAgAyACNgIMIANBnKACNgIIIANBEGoiAiABIANBCGogABEDAEHAABAjIAIQQCACEEEaIAMoAgwiAEEJTwRAIAAQAQsgA0HQAGokAAuBAgICfwF8IwBB4ABrIgMkACADQQhqIgQgASACIAAoAgARAwAgA0EwaiAEQSj8CgAAQQIhACADLQBQQQFGBEAjAEEQayIAJABB2J4CLQAAQQFxRQRAQQJBmIQCQQMQBiEBQdieAkEBOgAAQdSeAiABNgIAC0EgECMiASADKQNINwMYIAEgAykDQDcDECABIAMpAzg3AwggASADKQMwNwMAIAAgATYCCCAAQQA2AgRB1J4CKAIAQQBBACAAQQRqIABBCGoQBSEFIAAoAgQhASADIAX8AzYCXCADQZygAjYCWCABBEAgARAECyAAQRBqJAAgAygCXCEACyADQeAAaiQAIAALTAEBfyMAQSBrIgMkACAAKAIAIQAgAyACKQMYNwMYIAMgAikDEDcDECADIAIpAwg3AwggAyACKQMANwMAIAEgAyAAEQEAIANBIGokAAv8AQMBfwF+AXwjAEFAaiIDJAAgA0EIaiABIAIgACgCABEDACADIAMpAxgiBDcDMCADIAMpAxA3AyggAyADKQMINwMgQQIhACAEp0EBcQRAIwBBEGsiACQAQcyeAi0AAEEBcUUEQEECQaiCAkEDEAYhAUHMngJBAToAAEHIngIgATYCAAtBEBAjIgEgAykDKDcDCCABIAMpAyA3AwAgACABNgIIIABBADYCBEHIngIoAgBBAEEAIABBBGogAEEIahAFIQUgACgCBCEBIAMgBfwDNgI8IANBnKACNgI4IAEEQCABEAQLIABBEGokACADKAI8IQALIANBQGskACAACwsAIAAgAUEBEMUCC90BAgJ/AXwjAEEwayIDJAAgA0EMaiIEIAEgAiAAKAIAEQMAQQIhAAJAIAMtACRBAUcNACMAQRBrIgAkAEHAngItAABBAXFFBEBBAkHIgAJBAxAGIQFBwJ4CQQE6AABBvJ4CIAE2AgALIABBGBAjIAQQLjYCCCAAQQA2AgRBvJ4CKAIAQQBBACAAQQRqIABBCGoQBSEFIAAoAgQhASADIAX8AzYCLCADQZygAjYCKCABBEAgARAECyAAQRBqJAAgAygCLCEAIAMtACRBAUcNACAEECgaCyADQTBqJAAgAAsyAQF/IwBBIGsiAyQAIAAoAgAhACABIANBCGogAhAuIgEgABEBACABECgaIANBIGokAAvbAQIBfwF8IwBB0ABrIgMkACADIAEgAiAAKAIAEQMAQQIhAAJAIAMtAEBBAUcNACMAQRBrIgAkAEG0ngItAABBAXFFBEBBAkHY/gFBAxAGIQFBtJ4CQQE6AABBsJ4CIAE2AgALIABBwAAQIyADEEA2AgggAEEANgIEQbCeAigCAEEAQQAgAEEEaiAAQQhqEAUhBCAAKAIEIQEgAyAE/AM2AkwgA0GcoAI2AkggAQRAIAEQBAsgAEEQaiQAIAMoAkwhACADLQBAQQFHDQAgAxBBGgsgA0HQAGokACAACy8BAX8jAEFAaiIDJAAgACgCACEAIAEgAyACEEAiASAAEQEAIAEQQRogA0FAayQACzABAX8jAEEQayIEJAAgACgCACEAIAQgAzkDCCABIAIgBEEIaiAAEQYAIARBEGokAAvdAQMBfwF+AXwjAEEwayIDJAAgA0EIaiABIAIgACgCABEDACADIAMpAxAiBDcDICADIAMpAwg3AxhBAiEAIASnQQFxBEAjAEEQayIAJABBqJ4CLQAAQQFxRQRAQQJB6PwBQQMQBiEBQaieAkEBOgAAQaSeAiABNgIACyAAIAMrAxg5AwggAEEANgIEQaSeAigCAEEAQQAgAEEEaiAAQQhqEAUhBSAAKAIEIQEgAyAF/AM2AiwgA0GcoAI2AiggAQRAIAEQBAsgAEEQaiQAIAMoAiwhAAsgA0EwaiQAIAALMAEBfyMAQRBrIgQkACAAKAIAIQAgBCADOQMIIAEgAiAEQQhqIAARAwAgBEEQaiQACy4BAX8jAEEQayIDJAAgACgCACEAIAMgAjkDCCABIANBCGogABEBACADQRBqJAAL8wECAn8BfCMAQSBrIgMkACADQQhqIgQgASACIAAoAgARAwBBAiEAAkAgAy0AFEEBRw0AIwBBEGsiACQAQZyeAi0AAEEBcUUEQEECQfj6AUEDEAYhAUGcngJBAToAAEGYngIgATYCAAsgAEEMECMgBBA8NgIIIABBADYCBEGYngIoAgBBAEEAIABBBGogAEEIahAFIQUgACgCBCEBIAMgBfwDNgIcIANBnKACNgIYIAEEQCABEAQLIABBEGokACADKAIcIQAgAy0AFEEBRw0AIAMoAggiAUUNACADIAE2AgwgAygCEBogARAiCyADQSBqJAAgAAsNACAAIAEgAkECEMYCC0gBAX8jAEEQayIDJAAgACgCACEAIAEgA0EEaiACEDwiASAAEQEAIAEoAgAiAARAIAEgADYCBCABKAIIGiAAECILIANBEGokAAv8AQMBfwF+AXwjAEFAaiIDJAAgA0EIaiABIAIgACgCABEDACADIAMpAxgiBDcDMCADIAMpAxA3AyggAyADKQMINwMgQQIhACAEp0EBcQRAIwBBEGsiACQAQZCeAi0AAEEBcUUEQEECQYj5AUEDEAYhAUGQngJBAToAAEGMngIgATYCAAtBEBAjIgEgAykDKDcDCCABIAMpAyA3AwAgACABNgIIIABBADYCBEGMngIoAgBBAEEAIABBBGogAEEIahAFIQUgACgCBCEBIAMgBfwDNgI8IANBnKACNgI4IAEEQCABEAQLIABBEGokACADKAI8IQALIANBQGskACAAC5ICAwF/AX4BfCMAQdAAayIDJAAgA0EIaiABIAIgACgCABEDACADIAMpAyAiBDcDQCADIAMpAxg3AzggAyADKQMQNwMwIAMgAykDCDcDKEECIQAgBKdBAXEEQCMAQRBrIgAkAEGEngItAABBAXFFBEBBAkGY9wFBAxAGIQFBhJ4CQQE6AABBgJ4CIAE2AgALQRgQIyIBIAMpAzg3AxAgASADKQMwNwMIIAEgAykDKDcDACAAIAE2AgggAEEANgIEQYCeAigCAEEAQQAgAEEEaiAAQQhqEAUhBSAAKAIEIQEgAyAF/AM2AkwgA0GcoAI2AkggAQRAIAEQBAsgAEEQaiQAIAMoAkwhAAsgA0HQAGokACAACw0AIAAgASACQQEQxgILRQEBfyMAQSBrIgMkACAAKAIAIQAgAyACKQMQNwMYIAMgAikDCDcDECADIAIpAwA3AwggASADQQhqIAARAQAgA0EgaiQAC/ABAgF/AXwjAEEwayIDJAAgA0EIaiABIAIgACgCABEDACADIAMpAhA3AyAgAyADKQIINwMYQQIhACADLQAkQQFGBEAjAEEQayIAJABB+J0CLQAAQQFxRQRAQQJBqPUBQQMQBiEBQfidAkEBOgAAQfSdAiABNgIAC0EMECMiASADKAIgNgIIIAEgAykCGDcCACAAIAE2AgggAEEANgIEQfSdAigCAEEAQQAgAEEEaiAAQQhqEAUhBCAAKAIEIQEgAyAE/AM2AiwgA0GcoAI2AiggAQRAIAEQBAsgAEEQaiQAIAMoAiwhAAsgA0EwaiQAIAALOAEBfyMAQRBrIgMkACAAKAIAIQAgAyACKAIINgIIIAMgAikCADcDACABIAMgABEBACADQRBqJAAL7QECAn8BfCMAQaABayIDJAAgA0EIaiIEIAEgAiAAKAIAEQMAIANB0ABqIgEgBEHIAPwKAABBAiEAIAMtAJABQQFGBEAjAEEQayIAJABB7J0CLQAAQQFxRQRAQQJBuPMBQQMQBiECQeydAkEBOgAAQeidAiACNgIAC0HAABAjIgIgAUHAAPwKAAAgACACNgIIIABBADYCBEHonQIoAgBBAEEAIABBBGogAEEIahAFIQUgACgCBCEBIAMgBfwDNgKcASADQZygAjYCmAEgAQRAIAEQBAsgAEEQaiQAIAMoApwBIQALIANBoAFqJAAgAAsNACAAIAEgAkEAEMYCCy8BAX8jAEFAaiIDJAAgACgCACEAIAMgAkHAAPwKAAAgASADIAARAQAgA0FAayQAC1EBAn8jAEHQAGsiByQAIAAoAgAhACAHQQhqIgggA0Ew/AoAACAHQThqIgMgASACIAggBCAFIAYgABEoAEEYECMgAxAuIAMQKBogB0HQAGokAAtbAQF/IwBBIGsiBCQAIAAoAgAhACAEIAI2AgQgBEGcoAI2AgAgBEEIaiICIAEgBCADIAARBQBBGBAjIAIQLiACECgaIAQoAgQiAEEJTwRAIAAQAQsgBEEgaiQACzcAIAAoAgAgAUEFdGoiACACKQMYNwMYIAAgAikDEDcDECAAIAIpAwg3AwggACACKQMANwMAQQELmgYCB38BfCMAQdABayIDJABBJBAjIgRCADcCDCAEQYSWAjYCACAEQgA3AgQgBEIANwIUIARCADcCHCAAQgA3AxggAEKAgICAgICA+D83AxAgAEIANwMIIAAgBDYCBCAAIARBDGo2AgAgAEIANwMgIABCADcDMCAAQoCAgICAgID4PzcDKCAAQgA3AzggA0EANgIcIANCADcCFCADQRRqIAEoAgQgASgCAGtBDG0QViABKAIAIgcgASgCBCIIRwRAA0AgA0EgaiAHEDwiCSEBIwBBEGsiBCQAIANBwAFqIgVBADYCCCAFQgA3AgAgBSABKAIEIAEoAgBrQQR1EFwgASgCACIGIAEoAgQiAUcEQANAIAYrAwAhCiAEIAYrAwg5AwggBCAKOQMAIAUgBBBMIAZBEGoiBiABRw0ACwsgBEEQaiQAIANBFGogBRBoIAMoAsABIgEEQCADIAE2AsQBIAMoAsgBGiABECILIAkoAgAiAQRAIAMgATYCJCADKAIoGiABECILIAdBDGoiByAIRw0ACwsgA0EANgIQIANCADcCCCADQThqQQBB6AD8CwAgA0IANwMwIANBAjYCLCADQgA3AiQgA0E8akEAQTD8CwAgA0HwAGpBAEEk/AsAIANBADYCqAEgA0IANwOgASADQQE6AJ0BIANBAToAlAEgA0KAgICAgICAoD43A7gBIANCgICAgICAgNDBADcDsAEgA0H8mgI2AiAgA0EgaiIBIANBFGoQmwEgA0EANgLIASADQgA3AsABIAFBAkEDIAIgAkEDTxsiAkEAIAJBAWtBA0kbIANBCGoiBCADQcABaiICEOIBIAMgAjYCzAEgA0HMAWoQKSABEGkaQRgQIyICQbSaAjYCACACQgA3AgQgAkEMaiIFIAQQWyADIAI2AiQgAyAFNgIgIABBCGogARBOAkAgAygCJCIARQ0AIAAgACgCBCIBQQFrNgIEIAENACAAIAAoAgAoAggRAAAgABAkCyADIANBCGo2AsABIANBwAFqECkgAyADQRRqNgIgIANBIGoQKSADQdABaiQAC10AIAACfyABKAIEIAEoAgAiAWtBBXUgAksEQCAAIAEgAkEFdGoiASkDGDcDGCAAIAEpAxA3AxAgACABKQMINwMIIAAgASkDADcDAEEBDAELIABBADoAAEEACzoAIAsQACAAKAIEIAAoAgBrQQV1C8cDAQV/AkAgACgCBCAAKAIAIgNrQQV1IgQgAUkEQCMAQSBrIgYkAAJAAkAgASAEayIEIAAoAggiBSAAKAIEIgNrQQV1TQRAIAAgBAR/IAMgBEEFdGohAANAIAMgAikDGDcDGCADIAIpAxA3AxAgAyACKQMINwMIIAMgAikDADcDACADQSBqIgMgAEcNAAsgAAUgAws2AgQMAQsgAyAAKAIAIgNrQQV1IgcgBGoiAUGAgIDAAE8NASAGQQxqQf///z8gBSADayIDQQR1IgUgASABIAVJGyADQeD///8HTxsgByAAEJYDIgEoAggiAyAEQQV0aiEEA0AgAyACKQMYNwMYIAMgAikDEDcDECADIAIpAwg3AwggAyACKQMANwMAIANBIGoiAyAERw0ACyABIAQ2AgggASgCBCAAKAIEIAAoAgAiBGsiAmshAyACBEAgAyAEIAL8CgAACyAAKAIAIQIgACADNgIAIAEgAjYCBCAAIAEoAgg2AgQgASACNgIIIAAoAgghAyAAIAEoAgw2AgggASACNgIAIAEgAzYCDCABEJoFCyAGQSBqJAAMAgsQJgALIAEgBEkEQCAAIAMgAUEFdGo2AgQLCwsJACAAIAEQlwMLBgBBvIMCCwYAQcDxAQsUACAAKAIAIAFBGGxqIAIQowRBAQs6ACAAAn8gASgCBCABKAIAIgFrQRhtIAJLBEAgACABIAJBGGxqEC4aQQEMAQsgAEEAOgAAQQALOgAYC5wDAQV/AkAgACgCBCIDIAAoAgAiBWtBGG0iBCABSQRAIwBBIGsiBSQAAkACQCABIARrIgQgACgCCCIGIAAoAgQiA2tBGG1NBEAgACAEBH8gAyAEQRhsaiEAA0AgAyACEC5BGGoiAyAARw0ACyAABSADCzYCBAwBCyADIAAoAgAiA2tBGG0iByAEaiIBQavVqtUATw0BIAVBDGpBqtWq1QAgBiADa0EYbSIDQQF0IgYgASABIAZJGyADQdWq1SpPGyAHIAAQZCIBKAIIIgMgBEEYbGohBANAIAMgAhAuQRhqIgMgBEcNAAsgASAENgIIIAAoAgAiAiAAKAIEIgMgASgCBCADIAJrQWhtQRhsaiIDEKUCIAAoAgAhAiAAIAM2AgAgASACNgIEIAAgASgCCDYCBCABIAI2AgggACgCCCEDIAAgASgCDDYCCCABIAI2AgAgASADNgIMIAEQpAILIAVBIGokAAwCCxAmAAsgASAESQRAIAMgBSABQRhsaiIBRwRAA0AgASADQRhrECgiA0cNAAsLIAAgATYCBAsLCwkAIAAgARCYAQtRAQF/IwBBgAFrIgMkACADIAEQ3wEjAEEQayIBJAAgAUEIaiADIAJBABCTBSABIAEpAgg3AwAgACABEEgaIAFBEGokACADEKoBIANBgAFqJAALKwEBfyMAQRBrIgEkACAABEAgASAANgIMIAFBDGoQeiAAECILIAFBEGokAAsGAEHs/wELPwAgAiAAKAIAIAFBBnRqIgBHBEAgACgCABogAigCABogAEEIaiACQQhqEF4gAEEQaiACQRBqQTD8CgAAC0EBCzoAIAACfyABKAIEIAEoAgAiAWtBBnUgAksEQCAAIAEgAkEGdGoQQBpBAQwBCyAAQQA6AABBAAs6AEALtwIBBX8CQCAAKAIEIgMgACgCACIFa0EGdSIEIAFJBEAjAEEgayIFJAACQAJAIAEgBGsiASAAKAIIIgYgACgCBCIDa0EGdU0EQCAAIAEEfyADIAFBBnRqIQADQCADIAIQQEFAayIDIABHDQALIAAFIAMLNgIEDAELIAMgACgCACIEa0EGdSIHIAFqIgNBgICAIE8NASAFQQxqQf///x8gBiAEayIEQQV1IgYgAyADIAZJGyAEQcD///8HTxsgByAAEKkBIgQoAggiAyABQQZ0aiEBA0AgAyACEEBBQGsiAyABRw0ACyAEIAE2AgggACAEEKcCIAQQpgILIAVBIGokAAwCCxAmAAsgASAESQRAIAMgBSABQQZ0aiIBRwRAA0AgASADQUBqEEEiA0cNAAsLIAAgATYCBAsLC78BAQV/AkAjAEEgayIFJAACQAJAIAAoAgQiAiAAKAIIIgNJBEAgAiABELQBQUBrIQEMAQsgAiAAKAIAIgRrQQZ1IgZBAWoiAkGAgIAgTw0BIAVBDGpB////HyADIARrIgNBBXUiBCACIAIgBEkbIANBwP///wdPGyAGIAAQqQEiAigCCCABELQBGiACIAIoAghBQGs2AgggACACEKcCIAAoAgQhASACEKYCCyAAIAE2AgQgBUEgaiQADAELECYACwssAQF/IwBBEGsiASQAIAAEQCABIAA2AgwgAUEMahCYAyAAECILIAFBEGokAAsGAEGE/gELFwAgACgCACABQQN0aiACKwMAOQMAQQELPQAgAAJ/IAEoAgQgASgCACIBa0EDdSACSwRAIAAgASACQQN0aisDADkDAEEBDAELIABBADoAAEEACzoACAvtGgQVfwZ8A30CfiMAQZABayINJAAgABAaNgIEIABBnKACNgIAIA1BEGoiCCABEN8BIwBBkARrIgIkACACQgA3AogCIAIgAkGIAmoiCjYChAIgAkH4AWogCCgCCCAIKAIEa0ECdSAIKAIAbhDsASIQKAIAIgYgECgCBCIFRwRAIAYhBANAIAQgAzYCACADQQFqIQMgBEEEaiIEIAVHDQALCyAIKAIgIgMgCCgCHCIERwRAIAMgBGtBAnUhBSAIKAIoIQdBACEDA0AgBiAEIANBAnQiCWooAgBBAnRqIAcgCWooAgA2AgAgA0EBaiIDIAVHDQALCyAIKAIUIAgoAhBrQQJ1IgZBA24hDiAIKAIIIAgoAgRrQQJ1IhEgCCgCACISbiETIAZBA08EQEEAIQQDQCACQQI2ApgCIAJCgICAgBA3ApACIARBDGwhFEEAIQMDQCAIKAIQIBRqIgYgAkGQAmogA2ooAgBBAnQiBWooAgAhByACIBAoAgAiCSAGIAVBiJUBaigCAEECdGooAgBBAnRqKAIANgK4ASACIAkgB0ECdGooAgA2ArwBIAJBhAJqIg8iBkEEaiEHAkACQCAGKAIEIgVFDQAgAigCvAEhCyACKAK4ASEJIAchBgNAAkAgCSAFKAIQIgxKBEAgBUEEaiEFDAELIAkgDEgEQCAFIQYMAQsgBiAFIAUoAhQgC0giDBshBiAFQQRBACAMG2ohBQsgBSgCACIFDQALIAYgB0YNACAJIAYoAhAiBUgNACAFIAlIDQEgCyAGKAIUTg0BCyAHIQYLAkAgBiAKRgRAIAIgAikCuAFCIIk3ArgBIwBBEGsiCSQAQRgQIyILIAIpArgBNwIQAkAgDygCBCIFRQRAIA9BBGoiBiEHDAELIAsoAhQhFSALKAIQIQwDQAJAIAUiBigCECIFIAxMBEAgBSAMSA0BIBUgBigCFE4NAQsgBiIHKAIAIgUNAQwCCyAGKAIEIgUNAAsgBkEEaiEHCyAJIAY2AgwgDyAJKAIMIAcgCxCCASAJQRBqJAAMAQsgAkGEAmogBhDzAiAGECILIANBBGoiA0EMRw0ACyAEQQFqIgQgDkcNAAsLAkAgAigCjAIiBkUNAEEAIQUgAkEANgLwASACQgA3AugBIAJB6AFqIAYQJSACIAY2AuwBIAogAigChAIiA0cEQCACKALoASEHA0AgByAFQQJ0aiADKAIQNgIAAkAgAygCBCIEBEADQCAEIgMoAgAiBA0ADAILAAsDQCADIAMoAggiAygCAEcNAAsLIAVBAWohBSADIApHDQALCyAIKAIIIgUgCCgCBCIDayEEQQAhDwJAIAMgBUYNACAEECchDyAERQ0AIA8gAyAE/AoAAAsgAkKAgICAgICAeDcD4AEgAkKAgICAgICAeDcD2AEgAkKAgICAgICAeDcD0AEgAkKAgICAgICA+P8ANwPIASACQoCAgICAgID4/wA3A8ABIAJCgICAgICAgPj/ADcDuAEgAkECNgKYAiACQoCAgIAQNwKQAiAIKAIAIgdBAWshCyACQdABaiEMQQAhBQNARAAAAAAAAPB/IRdEAAAAAAAA8P8hGSALIAQgAkGQAmogBWooAgAiCUECdCIDa0ECdWoiCiAKIAdwIg5HBEAgAyAPaiIDIAogDmtBAnRqIQoDQCADKgIAuyIYIBkgGCAZZBshGSAYIBcgFyAYZBshFyADIAdBAnRqIgMgCkcNAAsLQQhBECAJQQFGG0EAIAkbIgMgAkG4AWpqIBc5AwAgAyAMaiAZOQMAIAVBBGoiBUEMRw0ACyAIKgJ8IR0gAisDuAEhFyACKwPQASEZIAIrA8ABIRggAisD2AEhGiACKwPIASEbIAIrA+ABQQAhBCACQQA2ArABIAJCADcCqAEgAkGoAWogBhCfASACIAY2AqwBIAJBADYCoAEgAkIANwKYASACQZgBaiAGECUgAiAGNgKcAZkiHCAbmSIbIBsgHGMbIhsgGpkiGiAYmSIYIBggGmMbIhggGCAbYxsiGCAZmSIZIBeZIhcgFyAZYxsiFyAXIBhjG0QAAAAAAACAPqIiFyAduyIZIBcgGWQbRAAAAAAAAOA/oiEXA0AgCCgCBCAIKAIAIARBAnQiByACKALoAWooAgBsQQJ0aiIFKgIEIR4gBSoCCCEfIAIoAqgBIARBMGxqIgMgFyAFKgIAIh27IhmgOQMYIAMgGSAXoTkDACADIBcgH7siGKA5AyggAyAXIB67IhqgOQMgIAMgGCAXoTkDECADIBogF6E5AwggAiAYOQOgAiACIBo5A5gCIAIgGTkDkAIgHSAdXAR/QX8FIAIgAikDoAI3A0AgAiACKQOYAjcDOCACIAIpA5ACNwMwIAIgAkG4AWpBMPwKAAAgAkEwaiACEIUCCyEDIAIoApgBIAdqIAM2AgAgBEEBaiIEIAZHDQALQQAhAyACQQA2ApABIAJCADcCiAEgAkGIAWogBhAlIAIgBjYCjAEgAigCiAEhBANAIAQgA0ECdGogAzYCACADQQFqIgMgBkcNAAsgBCAGQQJ0aiEFIAIgAkGYAWo2ApACAkACQCAGQYEBTgRAIAYhAwNAIANBAnQQUCIHDQIgA0EBdiIDDQALCyAEIAUgAkGQAmogBkEAQQAQuAEMAQsgBCAFIAJBkAJqIAYgByADELgBIAcQIgsgAkGYAWogAkGIAWoiAxCmASACQagBaiADEN4DIAJB6AFqIAMQpgEgAiACKQKoATcCkAIgAiACKQKYATcCTCACQdgAaiACQZACaiACQcwAaiIDEOIDIQUgAyATEJYBIQcgESASSSISRQRAIBOtISEDQCAHKAIAICCnQQN0aiAgNwMAICBCAXwiICAhUg0ACwsCQCAFKAIkRQ0AIAIoAqwBIhRFDQAgAigCqAEhFSAFKAIgIRYgBSgCACERQQAhAwNAAkAgFSADQTBsaiIEKwMAIhdEAAAAAAAA8H9hDQAgBCsDKCEZIAQrAyAhGCAEKwMYIRogBCsDECEbIAQrAwghHEF/IQlBASEEA0AgFiAEQQFrQQJtQQN0aiIEKAIEIQpBACEMAn9BACARIAQoAgAiC0EwbGoiBCsDACAaZUUNABpBACAEKwMIIBhlRQ0AGkEAIAQrAxAgGWVFDQAaQQAgBCsDGCAXZkUNABpBACAEKwMgIBxmRQ0AGkEAIAQrAyggG2ZFDQAaAkAgC0EBcQ0AIAtBAXUiBCADRg0AIAcgAigC6AEiDiADQQJ0aigCACAOIARBAnRqKAIAEF8LIAtBgYCAgHhxQQFGCyEOAkAgESAKQTBsaiIEKwMAIBplRQ0AIAQrAwggGGVFDQAgBCsDECAZZUUNACAEKwMYIBdmRQ0AIAQrAyAgHGZFDQAgBCsDKCAbZkUNAAJAIApBAXENACAKQQF1IgQgA0YNACAHIAIoAugBIgwgA0ECdGooAgAgDCAEQQJ0aigCABBfCyAKQYGAgIB4cUEBRiEMCyAMIA5yRQRAIAlBAEgNAiACQZACaiAJQQJ0aigCACEEIAlBAWshCQwBCyALIAogDhshBCAORSAMRXINACACQZACaiAJQQFqIglBAnRqIAo2AgAMAAsACyADQQFqIgMgFEcNAAsLIAgoAhwiBCAIKAIgRwRAQQAhAwNAIAcgBCADQQJ0IglqKAIAIAgoAiggCWooAgAQXyADQQFqIgMgCCgCICAIKAIcIgRrQQJ1SQ0ACwsgCCAENgIgIAggCCgCKDYCLCASRQRAIAhBHGohBCAIQShqIQlBACEDA0AgAyAHIAMQTyIKRwRAIAIgAzYCkAIgBCACQZACaiILED0gAiAKNgKQAiAJIAsQPQsgA0EBaiIDIBNJDQALCyAHKAIAIgMEQCAHIAM2AgQgBygCCBogAxAiCyAFKAIgIgMEQCADECILIAVBADYCKCAFQgA3AiAgBSgCECIDBEAgAxAiCyAFQQA2AhggBUIANwIQIAUoAgAiAwRAIAMQIgsgAigCiAEiAwRAIAMQIgsgAigCmAEiAwRAIAMQIgsgAigCqAEiAwRAIAMQIgsgDwRAIA8QIgsgAigC6AEiA0UNACADECILIBAoAgAiAwRAIBAgAzYCBCAQKAIIGiADECILIAJBhAJqIAIoAogCEM4CIAJBkARqJAAgDSAGQQBHOgAPIwBBEGsiAyQAIAAoAgRB6xcQEiEEIwBBEGsiBiQAQaifAi0AAEEBcUUEQEECQZyMAkEDEAYhBUGonwJBAToAAEGknwIgBTYCAAsgBiANLQAPNgIIIAZBADYCBEGknwIoAgBBAEEAIAZBBGogBkEIahAFIRcgBigCBCEFIAMgF/wDNgIMIANBnKACNgIIIAUEQCAFEAQLIAZBEGokACAEIAMoAgwQFSADKAIMIgZBCU8EQCAGEAELIARBCU8EQCAEEAELIANBEGokAAJAIA0tAA9BAUYEQCANQQRqIAgQlAUMAQsgDSABKAIEIgE2AgggDUGcoAI2AgQgAUEJSQ0AIAEQEwsgAEH4ESANQQRqEG0gDSgCCCIAQQlPBEAgABABCyANQRBqEKoBIA1BkAFqJAALEAAgACgCBCAAKAIAa0EDdQuVAwIFfwF8AkAgACgCBCAAKAIAIgNrQQN1IgQgAUkEQCMAQSBrIgYkAAJAAkAgASAEayIEIAAoAggiBSAAKAIEIgNrQQN1TQRAIAAgBAR/IAMgBEEDdGohACACKwMAIQgDQCADIAg5AwAgA0EIaiIDIABHDQALIAAFIAMLNgIEDAELIAMgACgCACIDa0EDdSIHIARqIgFBgICAgAJPDQEgBkEMakH/////ASAFIANrIgNBAnUiBSABIAEgBUkbIANB+P///wdPGyAHIAAQSyIBKAIIIgMgBEEDdGohBCACKwMAIQgDQCADIAg5AwAgA0EIaiIDIARHDQALIAEgBDYCCCABKAIEIAAoAgQgACgCACIEayICayEDIAIEQCADIAQgAvwKAAALIAAoAgAhAiAAIAM2AgAgASACNgIEIAAgASgCCDYCBCABIAI2AgggACgCCCEDIAAgASgCDDYCCCABIAI2AgAgASADNgIMIAEQmQELIAZBIGokAAwCCxAmAAsgASAESQRAIAAgAyABQQN0ajYCBAsLCwkAIAAgARCoAgsGAEGM/AELMgAgAiAAKAIAIAFBDGxqIgBHBEAgACACKAIAIgAgAigCBCIBIAEgAGtBBHUQmQMLQQELOgAgAAJ/IAEoAgQgASgCACIBa0EMbSACSwRAIAAgASACQQxsahA8GkEBDAELIABBADoAAEEACzoADAuHAwEFfwJAIAAoAgQgACgCACIDa0EMbSIEIAFJBEAjAEEgayIGJAACQAJAIAEgBGsiBCAAKAIIIgUgACgCBCIDa0EMbU0EQCAAIAQEfyADIARBDGxqIQADQCADIAIQPEEMaiIDIABHDQALIAAFIAMLNgIEDAELIAMgACgCACIDa0EMbSIHIARqIgFB1qrVqgFPDQEgBkEMakHVqtWqASAFIANrQQxtIgNBAXQiBSABIAEgBUkbIANBqtWq1QBPGyAHIAAQYSIBKAIIIgMgBEEMbGohBANAIAMgAhA8QQxqIgMgBEcNAAsgASAENgIIIAEoAgQgACgCBCAAKAIAIgRrIgJBdG1BDGxqIQMgAgRAIAMgBCAC/AoAAAsgACgCACECIAAgAzYCACABIAI2AgQgACABKAIINgIEIAEgAjYCCCAAKAIIIQMgACABKAIMNgIIIAEgAjYCACABIAM2AgwgARDVAQsgBkEgaiQADAILECYACyABIARJBEAgACADIAFBDGxqEHsLCwsIACAAIAEQaAsrAQF/IwBBEGsiASQAIAAEQCABIAA2AgwgAUEMahApIAAQIgsgAUEQaiQACwYAQZz6AQu2GAMafwZ8CH0jAEGAAWsiBCQAIwBBEGsiFCQAIBRBCGogAUEAECsQKiAUKAIIIQcCQCAUKAIMIgFFDQAgASABKAIEIgVBAWs2AgQgBQ0AIAEgASgCACgCCBEAACABECQLIAJBAEgEf0EAIAIgBxDuAhsFIAILIRZBACECIwBBoAJrIgMkAAJ/IAcoAkAiEUUEQCAHKAJMDAELIAcoAowBIBFuCyEOIAcoAsgBIQkgBygCXCELIARBBGoiCkEAQfgA/AsAIAQgEUEDajYCACAEIAcrAzi2OAJ8IAQgBxCiAUQAAAAAAACAPqK2IiMgBCoCfCIkICMgJF4bOAJ8IARBEGogC0EDbiINQQNsIhUQfSAEQfAAaiAHKAK8ASIGQQJ0EH0gBkEASgRAIAQoAnAhDyAHKAK4ASEQA0AgECACQQV0aiIBKwMAIR0gASsDCCEeIAErAxAhHyAPIAJBBHRqIgUgASsDGLY4AgwgBSAftjgCCCAFIB62OAIEIAUgHbY4AgAgAkEBaiICIAZHDQALCyAEQeQAaiANEH0gA0GUAmogDRDsASIPKAIAIgUgDygCBCIGRwRAQQAhAiAFIQEDQCABIAI2AgAgAkEBaiECIAFBBGoiASAGRw0ACwsgBygC2AEhECAJQQBIBEAgAyAHKALcATYCkAIgAyAQNgKMAiADQYwCaiEIAkACQCAGIAVrQQJ1IgJBgQFOBEAgAiEBA0AgAUECdBBQIhINAiABQQF2IgENAAsLIAUgBiAIIAJBAEEAEL4BDAELIAUgBiAIIAIgEiABEL4BIBIQIgsLIAMgCUEATiISOgCLAiADIANBgAJqIgY2AvwBIANCADcCgAIgA0H8AWogBygCzAEgB0HQAWoQgwMgC0EDTwRAQX8hAQNAIBAgDEECdCIJIA8oAgBqKAIAIgtBBHRqIgIoAgwhCCACKAIIIQUgAyACKAIANgIAIAQoAmQgCWogCCAFIAVBAEgbNgIAIANBAjYCkAEgA0KAgICAEDcCiAEgBCgCECAMQQxsaiEFIAcoAlggC0EMbGohCUEAIQIDQCAFIANBiAFqIAJqKAIAQQJ0IgtqIAkgC2ooAgA2AgAgAkEEaiICQQxHDQALIAEgAygCACILRwRAIANCgICAgICAgPg/NwOQASADQX82AogBIANCADcDqAEgA0IANwOgASADQgA3A5gBIANCgICAgICAgPg/NwOwASADQgA3A8gBIANCADcDwAEgA0IANwO4ASADQoCAgICAgID4PzcD0AEgA0EAOwHwASADQgA3A+gBIANCADcD4AEgA0IANwPYASAGIQECQCADKAKAAiIFRQ0AA0AgASICIAUiCSAFKAIQIAtIIggbIQEgBUEEQQAgCBtqKAIAIgUNAAsgASAGRg0AIAsgAiAJIAgbKAIQSA0AIANBiAFqIAFBGGpB6gD8CgAACyADQYsCaiAEIAwgA0GIAWoQoQQgA0H8AWogAxCzBCADKAIAIQELIAxBAWoiDCANRw0ACwsgBiADKAL8ASICRwRAA0AgA0GLAmogBCANIAJBGGoQoQQCQCACKAIEIgEEQANAIAEiAigCACIBDQAMAgsACwNAIAIgAigCCCICKAIARw0ACwsgAiAGRw0ACwsgAyAVNgKIASAEQTRqIANBiAFqED0CQCARRQRAIAogDkEDbBB9IA5BAEwNASAKKAIAIQYgBygCSCEJQQAhAgNAIAkgAkEYbGoiASsDACEdIAErAwghHiAGIAJBDGxqIgUgASsDELY4AgggBSAetjgCBCAFIB22OAIAIAJBAWoiAiAORw0ACwwBCyAHKAJMIQEgA0F/NgKIASADQfwAaiABIANBiAFqELIEIQ0gA0HwAGogBygCTBCcAiELIAQoAgAgDmwhASMAQSBrIgUkAAJAAkAgCigCCCAKKAIAIgJrQQJ1IAFJBEAgAUGAgICABE8NASAFQQxqIAEgCigCBCACa0ECdSAKEEoiASgCBCAKKAIEIAooAgAiCWsiAmshBiACBEAgBiAJIAL8CgAACyAKKAIAIQIgCiAGNgIAIAEgAjYCBCAKIAEoAgg2AgQgASACNgIIIAooAgghBiAKIAEoAgw2AgggASACNgIAIAEgBjYCDCABEFMLIAVBIGokAAwBCxAmAAsgBCgCRCIBIAQoAkAiBUcEQCAWQQBIIBJyIRIgBEEoaiEVIARBHGohFyAEKAI0IQJBACEJA0AgAiAJIgZBAnRqKAIAQQNuIg4gAiAGQQFqIglBAnQiGGooAgBBA25JBEAgBkEwbCEZA0AgA0ECNgJsIANCgICAgBA3AmQgDkEMbCEaQQAhBQNAIANB5ABqIAVqKAIAQQJ0IgIgBygCeCAPKAIAIA5BAnRqKAIAQQxsamooAgAhAQJAIAsoAgAgBCgCECAaaiACaiIMKAIAIhBBDGxqIggoAgAiAiAIKAIEIhNHBEADQCABIAIoAgBGBEAgDCACKAIENgIADAMLIAJBCGoiAiATRw0ACwsgDCAEKAIIIAQoAgRrQQJ1IAQoAgBuIgw2AgAgAyAMNgKMASADIAE2AogBIAggA0GIAWoQsQQgA0ECNgKQASADQoCAgIAQNwKIAUEAIQIgEEEYbCEIA0AgAyAHKAJIIAhqQQhBECADQYgBaiACaigCACITQQFGG0EAIBMbaisDALY4AgAgCiADEOUCIAJBBGoiAkEMRw0ACyARQQBKBEBBACECIAEgEWxBA3QhAQNAIAMgBygCiAEgAWogAkEDdGorAwC2OAKIASAKIANBiAFqEOUCIAJBAWoiAiARRw0ACwsgEkUEQCADQgA3A1ggA0IANwNQIANCADcDSCAEKAIAIQIgBCgCBCEBIAQoAgghCCADQoCAgIAQNwKIASADQQI2ApABIBZBAnQiEyABIAggAWtBAnUgAmtBAnQiG2pqQQxqIRxBACECA0AgA0HIAGpBCEEQIANBiAFqIAJqKAIAIghBAUYbQQAgCBtqIBwgCEECdGoqAgC7OQMAIAJBBGoiAkEMRw0ACwJ8IAQoAlggBmotAABBAnEEQCADKwNYIR4gAysDUCEfIAMrA0gMAQsgBCgCTCAZaiIBKgIAISMgASoCDCEkIAEqAhghJSABKgIEISYgASoCECEnIAEqAhwhKCABKgIIISkgASoCFCEqIAMgASoCILs5A8gBIAMgKrs5A8ABIAMgKbs5A7gBIAMgKLs5A7ABIAMgJ7s5A6gBIAMgJrs5A6ABIAMgJbs5A5gBIAMgJLs5A5ABIAMgI7s5A4gBIAMgA0GIAWoQkAFEAAAAAAAA8L9EAAAAAAAA8D8gBCgCWCAGai0AAEEBcRsiHSADKwMQoiADKwNIIiCiIB0gAysDKKIgAysDUCIhoqAgHSADKwNAoiADKwNYIiKioCEeIAMrAwggHaIgIKIgHSADKwMgoiAhoqAgHSADKwM4oiAioqAhHyAEKAIEIQEgAysDACAdoiAgoiAdIAMrAxiiICGioCAdIAMrAzCiICKioAshHSADIB4gHSAdoiAfIB+ioCAeIB6ioJ8iHqNEAAAAAAAAAAAgHSAeoyIdvUL///////////8Ag0KAgICAgICA+P8AVCICGzkDWCADIB8gHqNEAAAAAAAAAAAgAhs5A1AgAyAdRAAAAAAAAAAAIAIbOQNIIANCgICAgBA3AogBIANBAjYCkAEgASAbaiATakEMaiEIQQAhAgNAIAggA0GIAWogAmooAgAiAUECdGogA0HIAGpBCEEQIAFBAUYbQQAgARtqKwMAtjgCACACQQRqIgJBDEcNAAsLIBBBAnQiASANKAIAaiICKAIAQX9GBEAgAiAMNgIADAELIAMgDDYCiAEgFyADQYgBaiICED0gAyANKAIAIAFqKAIANgKIASAVIAIQPQsgBUEEaiIFQQxHDQALIA5BAWoiDiAEKAI0IgIgGGooAgBBA25JDQALIAQoAkAhBSAEKAJEIQELIAkgASAFa0ECdUkNAAsLIAMgCzYCiAEgA0GIAWoQKSANKAIAIgFFDQAgDSABNgIEIA0oAggaIAEQIgsgA0H8AWogAygCgAIQbyAPKAIAIgEEQCAPIAE2AgQgDygCCBogARAiCyADQaACaiQAIBRBEGokACAAIAQQlAUgBBCqASAEQYABaiQACwYAQaz4AQstACAAKAIAIAFBGGxqIgAgAikDEDcDECAAIAIpAwg3AwggACACKQMANwMAQQELUwAgAAJ/IAEoAgQgASgCACIBa0EYbSACSwRAIAAgASACQRhsaiIBKQMQNwMQIAAgASkDCDcDCCAAIAEpAwA3AwBBAQwBCyAAQQA6AABBAAs6ABgLuwMBBX8CQCAAKAIEIAAoAgAiA2tBGG0iBCABSQRAIwBBIGsiBiQAAkACQCABIARrIgQgACgCCCIFIAAoAgQiA2tBGG1NBEAgACAEBH8gAyAEQRhsaiEAA0AgAyACKQMQNwMQIAMgAikDCDcDCCADIAIpAwA3AwAgA0EYaiIDIABHDQALIAAFIAMLNgIEDAELIAMgACgCACIDa0EYbSIHIARqIgFBq9Wq1QBPDQEgBkEMakGq1arVACAFIANrQRhtIgNBAXQiBSABIAEgBUkbIANB1arVKk8bIAcgABBkIgEoAggiAyAEQRhsaiEEA0AgAyACKQMQNwMQIAMgAikDCDcDCCADIAIpAwA3AwAgA0EYaiIDIARHDQALIAEgBDYCCCABKAIEIAAoAgQgACgCACIEayICQWhtQRhsaiEDIAIEQCADIAQgAvwKAAALIAAoAgAhAiAAIAM2AgAgASACNgIEIAAgASgCCDYCBCABIAI2AgggACgCCCEDIAAgASgCDDYCCCABIAI2AgAgASADNgIMIAEQjAELIAZBIGokAAwCCxAmAAsgASAESQRAIAAgAyABQRhsajYCBAsLCwkAIAAgARDEAQsGAEG89gELIwAgACgCACABQQxsaiIAIAIoAgg2AgggACACKQIANwIAQQELSQAgAAJ/IAEoAgQgASgCACIBa0EMbSACSwRAIAAgASACQQxsaiIBKAIINgIIIAAgASkCADcCAEEBDAELIABBADoAAEEACzoADAuoAwEFfwJAIAAoAgQgACgCACIDa0EMbSIEIAFJBEAjAEEgayIGJAACQAJAIAEgBGsiBCAAKAIIIgUgACgCBCIDa0EMbU0EQCAAIAQEfyADIARBDGxqIQADQCADIAIoAgg2AgggAyACKQIANwIAIANBDGoiAyAARw0ACyAABSADCzYCBAwBCyADIAAoAgAiA2tBDG0iByAEaiIBQdaq1aoBTw0BIAZBDGpB1arVqgEgBSADa0EMbSIDQQF0IgUgASABIAVJGyADQarVqtUATxsgByAAEGEiASgCCCIDIARBDGxqIQQDQCADIAIoAgg2AgggAyACKQIANwIAIANBDGoiAyAERw0ACyABIAQ2AgggASgCBCAAKAIEIAAoAgAiBGsiAkF0bUEMbGohAyACBEAgAyAEIAL8CgAACyAAKAIAIQIgACADNgIAIAEgAjYCBCAAIAEoAgg2AgQgASACNgIIIAAoAgghAyAAIAEoAgw2AgggASACNgIAIAEgAzYCDCABENYBCyAGQSBqJAAMAgsQJgALIAEgBEkEQCAAIAMgAUEMbGo2AgQLCwsJACAAIAEQnQULBgBBzPQBCxgAIAAoAgAgAUEGdGogAkHAAPwKAABBAQs+ACAAAn8gASgCBCABKAIAIgFrQQZ1IAJLBEAgACABIAJBBnRqQcAA/AoAAEEBDAELIABBADoAAEEACzoAQAuMAwEFfwJAIAAoAgQgACgCACIDa0EGdSIEIAFJBEAjAEEgayIGJAACQAJAIAEgBGsiBCAAKAIIIgUgACgCBCIDa0EGdU0EQCAAIAQEfyADIARBBnRqIQADQCADIAJBwAD8CgAAIANBQGsiAyAARw0ACyAABSADCzYCBAwBCyADIAAoAgAiA2tBBnUiByAEaiIBQYCAgCBPDQEgBkEMakH///8fIAUgA2siA0EFdSIFIAEgASAFSRsgA0HA////B08bIAcgABCpASIBKAIIIgMgBEEGdGohBANAIAMgAkHAAPwKAAAgA0FAayIDIARHDQALIAEgBDYCCCABKAIEIAAoAgQgACgCACIEayICayEDIAIEQCADIAQgAvwKAAALIAAoAgAhAiAAIAM2AgAgASACNgIEIAAgASgCCDYCBCABIAI2AgggACgCCCEDIAAgASgCDDYCCCABIAI2AgAgASADNgIMIAEQqQILIAZBIGokAAwCCxAmAAsgASAESQRAIAAgAyABQQZ0ajYCBAsLCwkAIAAgARCaAwsGAEHo8gELDwAgASAAKAIAaiACNwMACw0AIAEgACgCAGopAwALHgAgASAAKAIAaiIAIAIpAwg3AwggACACKQMANwMACyoBAX8gACgCACECQRAQIyIAIAEgAmoiASkDCDcDCCAAIAEpAwA3AwAgAAsHACAAEQwACwkAIAEgABEZAAsJACABIAARAAALCQAgASAAERsACwkAIAEgABEEAAtNAQF/IwBBEGsiAiQAIAIgATYCBCACQZygAjYCACACQQhqIAIgABEBACACKAIMIAJBADYCDCACKAIEIgFBCU8EQCABEAELIAJBEGokAAtIAQJ/IwBB0ABrIgYkACAGQQhqIgcgAkEw/AoAACAGQThqIgIgASAHIAMgBCAFIAARKQBBGBAjIAIQLiACECgaIAZB0ABqJAALMwECfyMAQSBrIgQkACAEQQhqIgUgASACIAMgABEPAEEYECMgBRAuIAUQKBogBEEgaiQAC5QBAQJ/IwBBEGsiBCQAIARBBGogASACIAMgABEVAEEMECMiAEEANgIIIABCADcCACAEKAIIIgEgBCgCBCIDRwRAIAAgASADayIBQQxtEKMCIAAoAgQhBSABBEAgBSADIAH8CgAACyAAIAEgBWo2AgQLIAQoAgQiAQRAIAQgATYCCCAEKAIMGiABECILIARBEGokACAAC04BAX8jAEEwayIGJAAgBiAFKQMANwMIIAYgBSkDCDcDECAGQRhqIgUgASACIAMgBCAGQQhqIAARIwBBGBAjIAUQLiAFECgaIAZBMGokAAtSAQF/IwBBIGsiAyQAIAMgATYCBCADQZygAjYCACADQQhqIgEgAyACIAARAwBBGBAjIAEQLiABECgaIAMoAgQiAUEJTwRAIAEQAQsgA0EgaiQACy0BAn8jAEEgayIBJAAgAUEIaiICIAARAABBGBAjIAIQLiACECgaIAFBIGokAAsxAQJ/IwBBIGsiAyQAIANBCGoiBCABIAIgABEWAEEYECMgBBAuIAQQKBogA0EgaiQACzcBAn8jAEEgayIGJAAgBkEIaiIHIAEgAiADIAQgBSAAESQAQRgQIyAHEC4gBxAoGiAGQSBqJAALTwEBfyMAQTBrIgMkACADIAEpAwA3AwAgAyABKQMINwMIIAMgASkDEDcDECADQRhqIgEgAyACIAARAwBBGBAjIAEQLiABECgaIANBMGokAAtdAQN/IwBBIGsiBCQAIAEgACgCBCIGQQF1aiEBIAAoAgAhACAEQQhqIgUgASACIAMgBkEBcQR/IAEoAgAgAGooAgAFIAALEQ8AQRgQIyAFEC4gBRAoGiAEQSBqJAALXQEDfyMAQSBrIgQkACABIAAoAgQiBkEBdWohASAAKAIAIQAgBEEIaiIFIAEgAiADIAZBAXEEfyABKAIAIABqKAIABSAACxEFAEEYECMgBRAuIAUQKBogBEEgaiQACzkBAX8gASAAKAIEIgRBAXVqIQEgACgCACEAIAEgAiADIARBAXEEfyABKAIAIABqKAIABSAACxEmAAtXAQJ/IwBBMGsiAiQAIAEgACgCBCIDQQF1aiEBIAAoAgAhACACIAEgA0EBcQR/IAEoAgAgAGooAgAFIAALEQEAQTAQIyIAIAJBMPwKAAAgAkEwaiQAIAALWgECfyMAQRBrIgIkACABIAAoAgQiA0EBdWohASAAKAIAIQAgAiABIANBAXEEfyABKAIAIABqKAIABSAACxEBACACEJQDIAIgAjYCDCACQQxqEHogAkEQaiQAC18BA38jAEEgayIFJAAgASAAKAIEIgdBAXVqIQEgACgCACEAIAVBCGoiBiABIAIgAyAEIAdBAXEEfyABKAIAIABqKAIABSAACxEiAEEYECMgBhAuIAYQKBogBUEgaiQAC3oBAn8jAEEwayIDJAAgASAAKAIEIgRBAXVqIQEgACgCACEAIARBAXEEQCABKAIAIABqKAIAIQALIAMgAikDEDcDECADIAIpAwg3AwggAyACKQMANwMAIANBGGoiAiABIAMgABEDAEEYECMgAhAuIAIQKBogA0EwaiQAC10BA38jAEEgayIEJAAgASAAKAIEIgZBAXVqIQEgACgCACEAIARBCGoiBSABIAIgAyAGQQFxBH8gASgCACAAaigCAAUgAAsRJwBBGBAjIAUQLiAFECgaIARBIGokAAtbAQN/IwBBIGsiAyQAIAEgACgCBCIFQQF1aiEBIAAoAgAhACADQQhqIgQgASACIAVBAXEEfyABKAIAIABqKAIABSAACxELAEEYECMgBBAuIAQQKBogA0EgaiQAC1kBA38jAEEgayICJAAgASAAKAIEIgRBAXVqIQEgACgCACEAIAJBCGoiAyABIARBAXEEfyABKAIAIABqKAIABSAACxEBAEEYECMgAxAuIAMQKBogAkEgaiQAC1wBAn8jAEEQayIDJAAgASAAKAIEIgRBAXVqIQEgACgCACEAIAMgASACIARBAXEEfyABKAIAIABqKAIABSAACxELACADEJgFIAMgAzYCDCADQQxqECkgA0EQaiQAC3wBAn8jAEEwayIEJAAgASAAKAIEIgVBAXVqIQEgACgCACEAIAVBAXEEQCABKAIAIABqKAIAIQALIAQgAikDEDcDECAEIAIpAwg3AwggBCACKQMANwMAIARBGGoiAiABIAQgAyAAEQ8AQRgQIyACEC4gAhAoGiAEQTBqJAALUQEBfyMAQSBrIgIkACACIAE2AgQgAkGcoAI2AgAgAkEIaiIBIAIgABEBAEEYECMgARCLASABECgaIAIoAgQiAUEJTwRAIAEQAQsgAkEgaiQACw0AIAAEQCAAECgQIgsLBwAgACgCBAsGAEGY8QELBQBB6hALGwAgACABKAIIIAUQcwRAIAEgAiADIAQQrAILCzgAIAAgASgCCCAFEHMEQCABIAIgAyAEEKwCDwsgACgCCCIAIAEgAiADIAQgBSAAKAIAKAIUEQgAC5ICAQZ/IAAgASgCCCAFEHMEQCABIAIgAyAEEKwCDwsgAS0ANSAAKAIMIQYgAUEAOgA1IAEtADQgAUEAOgA0IABBEGoiCSABIAIgAyAEIAUQngMgAS0ANCIKciEIIAEtADUiC3IhBwJAIAZBAkkNACAJIAZBA3RqIQkgAEEYaiEGA0AgAS0ANg0BAkAgCkEBcQRAIAEoAhhBAUYNAyAALQAIQQJxDQEMAwsgC0EBcUUNACAALQAIQQFxRQ0CCyABQQA7ATQgBiABIAIgAyAEIAUQngMgAS0ANSILIAdyQQFxIQcgAS0ANCIKIAhyQQFxIQggBkEIaiIGIAlJDQALCyABIAdBAXE6ADUgASAIQQFxOgA0C6QBAAJAIAAgASgCCCAEEHMEQCACIAEoAgRHDQEgASgCHEEBRg0BIAEgAzYCHA8LIAAgASgCACAEEHNFDQACQCABKAIQIAJHBEAgAiABKAIURw0BCyADQQFHDQEgAUEBNgIgDwsgASACNgIUIAEgAzYCICABIAEoAihBAWo2AigCQCABKAIkQQFHDQAgASgCGEECRw0AIAFBAToANgsgAUEENgIsCwuIAgACQCAAIAEoAgggBBBzBEAgAiABKAIERw0BIAEoAhxBAUYNASABIAM2AhwPCyAAIAEoAgAgBBBzBEACQCABKAIQIAJHBEAgAiABKAIURw0BCyADQQFHDQIgAUEBNgIgDwsgASADNgIgAkAgASgCLEEERg0AIAFBADsBNCAAKAIIIgAgASACIAJBASAEIAAoAgAoAhQRCAAgAS0ANUEBRgRAIAFBAzYCLCABLQA0RQ0BDAMLIAFBBDYCLAsgASACNgIUIAEgASgCKEEBajYCKCABKAIkQQFHDQEgASgCGEECRw0BIAFBAToANg8LIAAoAggiACABIAIgAyAEIAAoAgAoAhgRBwALC1YBA38jAEHQAGsiAiQAIAJBEGoiAyACQQRqIAEQPCIBIAARAQBBwAAQIyADEEAgAxBBGiABKAIAIgAEQCABIAA2AgQgASgCCBogABAiCyACQdAAaiQAC6gEAQV/IAAoAgQiAhCvAkEBaiIBECciAAR/An8gAUGABE8EQCABBEAgACACIAH8CgAACyAADAELIAAgAWohAwJAIAAgAnNBA3FFBEACQCAAQQNxRQRAIAAhAQwBCyABRQRAIAAhAQwBCyAAIQEDQCABIAItAAA6AAAgAkEBaiECIAFBAWoiAUEDcUUNASABIANJDQALCyADQXxxIQQCQCADQcAASQ0AIAEgBEFAaiIFSw0AA0AgASACKAIANgIAIAEgAigCBDYCBCABIAIoAgg2AgggASACKAIMNgIMIAEgAigCEDYCECABIAIoAhQ2AhQgASACKAIYNgIYIAEgAigCHDYCHCABIAIoAiA2AiAgASACKAIkNgIkIAEgAigCKDYCKCABIAIoAiw2AiwgASACKAIwNgIwIAEgAigCNDYCNCABIAIoAjg2AjggASACKAI8NgI8IAJBQGshAiABQUBrIgEgBU0NAAsLIAEgBE8NAQNAIAEgAigCADYCACACQQRqIQIgAUEEaiIBIARJDQALDAELIANBBEkEQCAAIQEMAQsgAUEESQRAIAAhAQwBCyADQQRrIQUgACEBA0AgASACLQAAOgAAIAEgAi0AAToAASABIAItAAI6AAIgASACLQADOgADIAJBBGohAiABQQRqIgEgBU0NAAsLIAEgA0kEQANAIAEgAi0AADoAACACQQFqIQIgAUEBaiIBIANHDQALCyAACwVBAAsLtgEAQdSdAkEBNgIAQdidAkEANgIAEKAFQdidAkHQnQIoAgA2AgBB0J0CQdSdAjYCAEHgnQJBADYCAEHcnQJB7wI2AgAQogRB4J0CQdCdAigCADYCAEHQnQJB3J0CNgIAQdifAkIANwIAQdCfAkIANwIAQeCfAkGAgID8AzYCAEH8oAJBhKACNgIAQdSgAkGAgAQ2AgBB0KACQbCrBjYCAEG0oAJBKjYCAEHYoAJBvJwCKAIANgIACwuzkAKqAQBBgAgL9XB6AGlzRW1wdHkAX1NpbXBsaWZ5AGJveABfYm91bmRpbmdCb3gATm9uRmluaXRlVmVydGV4AHJ1bkluZGV4AG1heAB3AEV4ZWN1dGlvbkNvbnRleHQAd2l0aENvbnRleHQAX1Ntb290aE91dABfUmF5Q2FzdAB1bnNpZ25lZCBzaG9ydABudW1Qcm9wVmVydABtZXJnZVRvVmVydABudW1WZXJ0AG1lcmdlRnJvbVZlcnQAdW5zaWduZWQgaW50AGhhbGZlZGdlVGFuZ2VudABfU3BsaXQAVmVjdG9yX3JheUhpdABfT2Zmc2V0AGdldABfTGV2ZWxTZXQAX2ludGVyc2VjdAByZWN0AF9Qcm9qZWN0AF9zdWJ0cmFjdABmbG9hdABzdGF0dXMAZ2VudXMAdHJpVmVydHMAX2Nyb3NzU2VjdGlvbkh1bGxQb2ludHMAX21hbmlmb2xkSHVsbFBvaW50cwBzZXRDaXJjdWxhclNlZ21lbnRzAGdldENpcmN1bGFyU2VnbWVudHMASW52YWxpZFRhbmdlbnRzAHJlc2V0VG9DaXJjdWxhckRlZmF1bHRzAHByb2dyZXNzAFZlY3Rvcl9zbW9vdGhuZXNzAF9Ub1BvbHlnb25zAF9TbW9vdGhCeU5vcm1hbHMAX0NhbGN1bGF0ZU5vcm1hbHMATWVyZ2VWZWN0b3JzRGlmZmVyZW50TGVuZ3RocwBydW5GbGFncwB2ZXJ0UHJvcGVydGllcwBfU2V0UHJvcGVydGllcwBNaXNzaW5nUG9zaXRpb25Qcm9wZXJ0aWVzAF9jcm9zc1NlY3Rpb25Db2xsZWN0VmVydGljZXMAX21hbmlmb2xkQ29sbGVjdFZlcnRpY2VzAFZlcnRleE91dE9mQm91bmRzAE1lcmdlSW5kZXhPdXRPZkJvdW5kcwBfQm91bmRzAF9SZXNlcnZlSURzACVzOiVkOiAlcwBudW1Db250b3VyAGJhZF93ZWFrX3B0cgB2ZWN0b3IAX01pcnJvcgBVbmtub3duIGVycm9yAE5vRXJyb3IAVW5rbm93bkVycm9yAE1pdGVyAF9DeWxpbmRlcgB1bnNpZ25lZCBjaGFyAF9XYXJwAC9lbXNkay9lbXNjcmlwdGVuL3N5c3RlbS9saWIvbGliY3h4YWJpL3NyYy9wcml2YXRlX3R5cGVpbmZvLmNwcABudW1Qcm9wAG1pbkdhcABOb25aZXJvAF9UZXRyYWhlZHJvbgBwb3NpdGlvbgBJbnZhbGlkQ29uc3RydWN0aW9uAFZlY3Rvcl9jcm9zc1NlY3Rpb24AQ3Jvc3NTZWN0aW9uAG1pbgBtaW5rb3dza2lTdW0AdHJhbnNmb3JtAHJ1blRyYW5zZm9ybQBib29sAGh1bGwAc3RkOjpiYWRfZnVuY3Rpb25fY2FsbABCZXZlbABjYW5jZWwAYXNPcmlnaW5hbABub3JtYWwAcHVzaF9iYWNrAG51bVRyaQBfU21vb3RoAGJhZF9hcnJheV9uZXdfbGVuZ3RoAHJlZmluZVRvTGVuZ3RoAFJ1bkluZGV4V3JvbmdMZW5ndGgAUHJvcGVydGllc1dyb25nTGVuZ3RoAFRyYW5zZm9ybVdyb25nTGVuZ3RoAEZhY2VJRFdyb25nTGVuZ3RoAHNldE1pbkNpcmN1bGFyRWRnZUxlbmd0aABtZXNoAF9Gcm9tTWVzaABfV2FycEJhdGNoAHVuc2lnbmVkIGxvbmcgbG9uZwB1bnNpZ25lZCBsb25nAHN0ZDo6d3N0cmluZwBiYXNpY19zdHJpbmcAc3RkOjpzdHJpbmcAc3RkOjp1MTZzdHJpbmcAc3RkOjp1MzJzdHJpbmcAcmVzaXplAF9SZXZvbHZlAFBvc2l0aXZlAE5lZ2F0aXZlAHJvdGF0ZQBfUm90YXRlAFRoZXJlIG11c3QgYmUgMiB2YWx1ZXMgZm9yIGVhY2ggY29vcmRpbmF0ZQBfVHJpYW5ndWxhdGUAX1RyYW5zbGF0ZQBfRGVjb21wb3NlAF9jcm9zc1NlY3Rpb25Db21wb3NlAF9tYW5pZm9sZENvbXBvc2UAY2FsY3VsYXRlQ3VydmF0dXJlAF9TcGhlcmUAX1NxdWFyZQBqb2ludHlwZQByZWZpbmUAX1NwbGl0QnlQbGFuZQBfVHJpbUJ5UGxhbmUAdm9sdW1lAGZpbGxydWxlAHNldE1pbkNpcmN1bGFyQW5nbGUAX0NpcmNsZQBkb3VibGUAX1NjYWxlAF9NZXJnZQBSZXN1bHRUb29MYXJnZQBQcmVjaXNpb24gZXhjZWVkcyB0aGUgcGVybWl0dGVkIHJhbmdlAFZhbHVlcyBleGNlZWQgcGVybWl0dGVkIHJhbmdlAGhhbGZlZGdlAG51bUVkZ2UAX0V4dHJ1ZGUAbWlua293c2tpRGlmZmVyZW5jZQBkaXN0YW5jZQB0b2xlcmFuY2UAc2V0VG9sZXJhbmNlAHJlZmluZVRvVG9sZXJhbmNlAHNsaWNlAF9TbGljZQBfQ3ViZQBSb3VuZABWZWN0b3JfbWFuaWZvbGQATm90TWFuaWZvbGQAdm9pZABjYW5jZWxsZWQAQ2FuY2VsbGVkAHJlY3Vyc2l2ZV9tdXRleCBjb25zdHJ1Y3RvciBmYWlsZWQAcmVjdXJzaXZlX211dGV4IGxvY2sgZmFpbGVkAGNoYW5nZWQAX2FkZABFdmVuT2RkAGFyZWEAc3VyZmFjZUFyZWEAX0dldE1lc2hKUwBfY3Jvc3NTZWN0aW9uSW50ZXJzZWN0aW9uTgBfbWFuaWZvbGRJbnRlcnNlY3Rpb25OAF9jcm9zc1NlY3Rpb25Vbmlvbk4AX21hbmlmb2xkVW5pb25OAF9jcm9zc1NlY3Rpb25EaWZmZXJlbmNlTgBfbWFuaWZvbGREaWZmZXJlbmNlTgBvcmlnaW5hbElEAHJ1bk9yaWdpbmFsSUQAZmFjZUlEAGluaXRUQkIAY2F0Y2hpbmcgYSBjbGFzcyB3aXRob3V0IGFuIG9iamVjdD8AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8c2hvcnQ+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PHVuc2lnbmVkIHNob3J0PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzxpbnQ+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PHVuc2lnbmVkIGludD4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8ZmxvYXQ+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PHVpbnQ4X3Q+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PGludDhfdD4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8dWludDE2X3Q+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PGludDE2X3Q+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PHVpbnQ2NF90PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzxpbnQ2NF90PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzx1aW50MzJfdD4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8aW50MzJfdD4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8Y2hhcj4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8dW5zaWduZWQgY2hhcj4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8c2lnbmVkIGNoYXI+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PGxvbmc+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PHVuc2lnbmVkIGxvbmc+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PGRvdWJsZT4AVmVjdG9yX3ZlYzQAVmVjdG9yX2Y2NABWZWN0b3JfaXZlYzMAVmVjdG9yX3ZlYzMAVGhlcmUgaXMgYW4gdW5kZWZpbmVkIGVycm9yIGluIENsaXBwZXIyAFZlY3Rvcl92ZWMyAFZlY3RvcjJfdmVjMgAxADAASW52YWxpZCBzY2FsZSAoZWl0aGVyIDAgb3IgdG9vIGxhcmdlKQAAAAAMdgAAFBAAAE5TdDNfXzIxMmJhc2ljX3N0cmluZ0l3TlNfMTFjaGFyX3RyYWl0c0l3RUVOU185YWxsb2NhdG9ySXdFRUVFAAAMdgAAXBAAAE5TdDNfXzIxMmJhc2ljX3N0cmluZ0lEc05TXzExY2hhcl90cmFpdHNJRHNFRU5TXzlhbGxvY2F0b3JJRHNFRUVFAAAADHYAAKgQAABOU3QzX18yMTJiYXNpY19zdHJpbmdJRGlOU18xMWNoYXJfdHJhaXRzSURpRUVOU185YWxsb2NhdG9ySURpRUVFRQAAAAx2AAD0EAAATjEwZW1zY3JpcHRlbjExbWVtb3J5X3ZpZXdJY0VFAAAMdgAAHBEAAE4xMGVtc2NyaXB0ZW4xMW1lbW9yeV92aWV3SWFFRQAADHYAAEQRAABOMTBlbXNjcmlwdGVuMTFtZW1vcnlfdmlld0lzRUUAAAx2AABsEQAATjEwZW1zY3JpcHRlbjExbWVtb3J5X3ZpZXdJdEVFAAAMdgAAlBEAAE4xMGVtc2NyaXB0ZW4xMW1lbW9yeV92aWV3SWlFRQAADHYAALwRAABOMTBlbXNjcmlwdGVuMTFtZW1vcnlfdmlld0lsRUUAAAx2AADkEQAATjEwZW1zY3JpcHRlbjExbWVtb3J5X3ZpZXdJbUVFAAAMdgAADBIAAE4xMGVtc2NyaXB0ZW4xMW1lbW9yeV92aWV3SXhFRQAADHYAADQSAABOMTBlbXNjcmlwdGVuMTFtZW1vcnlfdmlld0l5RUUATjZsaW5hbGczdmVjSWRMaTJFRUUAcAB2cABkcHAAdnBwZABONmxpbmFsZzN2ZWNJaUxpM0VFRQBwAHZwAGlwcAB2cHBpAE42bGluYWxnM3ZlY0lkTGkzRUVFAHAAdnAAZHBwAHZwcGQATjZsaW5hbGczdmVjSWRMaTRFRUUAcAB2cABkcHAAdnBwZABOOG1hbmlmb2xkOE1hbmlmb2xkNUVycm9yRQBOOG1hbmlmb2xkMTJDcm9zc1NlY3Rpb244RmlsbFJ1bGVFAE44bWFuaWZvbGQxMkNyb3NzU2VjdGlvbjhKb2luVHlwZUUATjhtYW5pZm9sZDRSZWN0RQBwAHZwAHBwcAB2cHBwAE44bWFuaWZvbGQzQm94RQBwAHZwAHBwcAB2cHBwAE44bWFuaWZvbGQxMFNtb290aG5lc3NFAHAAdnAAaXBwAHZwcGkAZHBwAHZwcGQATjhtYW5pZm9sZDZSYXlIaXRFAHAAdnAAanBwAHZwcGoAZHBwAHZwcGQAcHBwAHZwcHAATjhtYW5pZm9sZDE2RXhlY3V0aW9uQ29udGV4dEUAUE44bWFuaWZvbGQxNkV4ZWN1dGlvbkNvbnRleHRFAFBLTjhtYW5pZm9sZDE2RXhlY3V0aW9uQ29udGV4dEUAcHAAdgB2cABwcAB2cHAAaXBwAGRwcABOOG1hbmlmb2xkOE1hbmlmb2xkRQBOMTBlbXNjcmlwdGVuM3ZhbEUAcHBwcABOU3QzX18yNnZlY3RvcklOOG1hbmlmb2xkMTBTbW9vdGhuZXNzRU5TXzlhbGxvY2F0b3JJUzJfRUVFRQBwcHBwcABwcHBpcGRkZABOU3QzX18yOG9wdGlvbmFsSU44bWFuaWZvbGQ2UmF5SGl0RUVFAE5TdDNfXzIyN19fb3B0aW9uYWxfbW92ZV9hc3NpZ25fYmFzZUlOOG1hbmlmb2xkNlJheUhpdEVMYjFFRUUATlN0M19fMjI3X19vcHRpb25hbF9jb3B5X2Fzc2lnbl9iYXNlSU44bWFuaWZvbGQ2UmF5SGl0RUxiMUVFRQBOU3QzX18yMjBfX29wdGlvbmFsX21vdmVfYmFzZUlOOG1hbmlmb2xkNlJheUhpdEVMYjFFRUUATlN0M19fMjIwX19vcHRpb25hbF9jb3B5X2Jhc2VJTjhtYW5pZm9sZDZSYXlIaXRFTGIxRUVFAE5TdDNfXzIyM19fb3B0aW9uYWxfc3RvcmFnZV9iYXNlSU44bWFuaWZvbGQ2UmF5SGl0RUxiMEVFRQBOU3QzX18yMjRfX29wdGlvbmFsX2Rlc3RydWN0X2Jhc2VJTjhtYW5pZm9sZDZSYXlIaXRFTGIxRUVFAE5TdDNfXzIxOF9fc2ZpbmFlX2N0b3JfYmFzZUlMYjFFTGIxRUVFAE5TdDNfXzIyMF9fc2ZpbmFlX2Fzc2lnbl9iYXNlSUxiMUVMYjFFRUUATlN0M19fMjZ2ZWN0b3JJTjhtYW5pZm9sZDZSYXlIaXRFTlNfOWFsbG9jYXRvcklTMl9FRUVFAFBOU3QzX18yNnZlY3RvcklOOG1hbmlmb2xkNlJheUhpdEVOU185YWxsb2NhdG9ySVMyX0VFRUUAUEtOU3QzX18yNnZlY3RvcklOOG1hbmlmb2xkNlJheUhpdEVOU185YWxsb2NhdG9ySVMyX0VFRUUAcHAAdnAAcHAAdnBwcAB2cHBpcABpcHAAcHBwaQBpcHBpcABOU3QzX18yOG9wdGlvbmFsSU42bGluYWxnM3ZlY0lpTGkzRUVFRUUATlN0M19fMjI3X19vcHRpb25hbF9tb3ZlX2Fzc2lnbl9iYXNlSU42bGluYWxnM3ZlY0lpTGkzRUVFTGIxRUVFAE5TdDNfXzIyN19fb3B0aW9uYWxfY29weV9hc3NpZ25fYmFzZUlONmxpbmFsZzN2ZWNJaUxpM0VFRUxiMUVFRQBOU3QzX18yMjBfX29wdGlvbmFsX21vdmVfYmFzZUlONmxpbmFsZzN2ZWNJaUxpM0VFRUxiMUVFRQBOU3QzX18yMjBfX29wdGlvbmFsX2NvcHlfYmFzZUlONmxpbmFsZzN2ZWNJaUxpM0VFRUxiMUVFRQBOU3QzX18yMjNfX29wdGlvbmFsX3N0b3JhZ2VfYmFzZUlONmxpbmFsZzN2ZWNJaUxpM0VFRUxiMEVFRQBOU3QzX18yMjRfX29wdGlvbmFsX2Rlc3RydWN0X2Jhc2VJTjZsaW5hbGczdmVjSWlMaTNFRUVMYjFFRUUATlN0M19fMjZ2ZWN0b3JJTjZsaW5hbGczdmVjSWlMaTNFRUVOU185YWxsb2NhdG9ySVMzX0VFRUUAUE5TdDNfXzI2dmVjdG9ySU42bGluYWxnM3ZlY0lpTGkzRUVFTlNfOWFsbG9jYXRvcklTM19FRUVFAFBLTlN0M19fMjZ2ZWN0b3JJTjZsaW5hbGczdmVjSWlMaTNFRUVOU185YWxsb2NhdG9ySVMzX0VFRUUAcHAAdnAAcHAAdnBwcAB2cHBpcABpcHAAcHBwaQBpcHBpcABOU3QzX18yOG9wdGlvbmFsSU42bGluYWxnM3ZlY0lkTGkzRUVFRUUATlN0M19fMjI3X19vcHRpb25hbF9tb3ZlX2Fzc2lnbl9iYXNlSU42bGluYWxnM3ZlY0lkTGkzRUVFTGIxRUVFAE5TdDNfXzIyN19fb3B0aW9uYWxfY29weV9hc3NpZ25fYmFzZUlONmxpbmFsZzN2ZWNJZExpM0VFRUxiMUVFRQBOU3QzX18yMjBfX29wdGlvbmFsX21vdmVfYmFzZUlONmxpbmFsZzN2ZWNJZExpM0VFRUxiMUVFRQBOU3QzX18yMjBfX29wdGlvbmFsX2NvcHlfYmFzZUlONmxpbmFsZzN2ZWNJZExpM0VFRUxiMUVFRQBOU3QzX18yMjNfX29wdGlvbmFsX3N0b3JhZ2VfYmFzZUlONmxpbmFsZzN2ZWNJZExpM0VFRUxiMEVFRQBOU3QzX18yMjRfX29wdGlvbmFsX2Rlc3RydWN0X2Jhc2VJTjZsaW5hbGczdmVjSWRMaTNFRUVMYjFFRUUATlN0M19fMjZ2ZWN0b3JJTjZsaW5hbGczdmVjSWRMaTNFRUVOU185YWxsb2NhdG9ySVMzX0VFRUUAUE5TdDNfXzI2dmVjdG9ySU42bGluYWxnM3ZlY0lkTGkzRUVFTlNfOWFsbG9jYXRvcklTM19FRUVFAFBLTlN0M19fMjZ2ZWN0b3JJTjZsaW5hbGczdmVjSWRMaTNFRUVOU185YWxsb2NhdG9ySVMzX0VFRUUAcHAAdnAAcHAAdnBwcAB2cHBpcABpcHAAcHBwaQBpcHBpcABOU3QzX18yOG9wdGlvbmFsSU42bGluYWxnM3ZlY0lkTGkyRUVFRUUATlN0M19fMjI3X19vcHRpb25hbF9tb3ZlX2Fzc2lnbl9iYXNlSU42bGluYWxnM3ZlY0lkTGkyRUVFTGIxRUVFAE5TdDNfXzIyN19fb3B0aW9uYWxfY29weV9hc3NpZ25fYmFzZUlONmxpbmFsZzN2ZWNJZExpMkVFRUxiMUVFRQBOU3QzX18yMjBfX29wdGlvbmFsX21vdmVfYmFzZUlONmxpbmFsZzN2ZWNJZExpMkVFRUxiMUVFRQBOU3QzX18yMjBfX29wdGlvbmFsX2NvcHlfYmFzZUlONmxpbmFsZzN2ZWNJZExpMkVFRUxiMUVFRQBOU3QzX18yMjNfX29wdGlvbmFsX3N0b3JhZ2VfYmFzZUlONmxpbmFsZzN2ZWNJZExpMkVFRUxiMEVFRQBOU3QzX18yMjRfX29wdGlvbmFsX2Rlc3RydWN0X2Jhc2VJTjZsaW5hbGczdmVjSWRMaTJFRUVMYjFFRUUATlN0M19fMjZ2ZWN0b3JJTjZsaW5hbGczdmVjSWRMaTJFRUVOU185YWxsb2NhdG9ySVMzX0VFRUUAUE5TdDNfXzI2dmVjdG9ySU42bGluYWxnM3ZlY0lkTGkyRUVFTlNfOWFsbG9jYXRvcklTM19FRUVFAFBLTlN0M19fMjZ2ZWN0b3JJTjZsaW5hbGczdmVjSWRMaTJFRUVOU185YWxsb2NhdG9ySVMzX0VFRUUAcHAAdnAAcHAAdnBwcAB2cHBpcABpcHAAcHBwaQBpcHBpcABOU3QzX18yOG9wdGlvbmFsSU5TXzZ2ZWN0b3JJTjZsaW5hbGczdmVjSWRMaTJFRUVOU185YWxsb2NhdG9ySVM0X0VFRUVFRQBOU3QzX18yMjdfX29wdGlvbmFsX21vdmVfYXNzaWduX2Jhc2VJTlNfNnZlY3RvcklONmxpbmFsZzN2ZWNJZExpMkVFRU5TXzlhbGxvY2F0b3JJUzRfRUVFRUxiMEVFRQBOU3QzX18yMjdfX29wdGlvbmFsX2NvcHlfYXNzaWduX2Jhc2VJTlNfNnZlY3RvcklONmxpbmFsZzN2ZWNJZExpMkVFRU5TXzlhbGxvY2F0b3JJUzRfRUVFRUxiMEVFRQBOU3QzX18yMjBfX29wdGlvbmFsX21vdmVfYmFzZUlOU182dmVjdG9ySU42bGluYWxnM3ZlY0lkTGkyRUVFTlNfOWFsbG9jYXRvcklTNF9FRUVFTGIwRUVFAE5TdDNfXzIyMF9fb3B0aW9uYWxfY29weV9iYXNlSU5TXzZ2ZWN0b3JJTjZsaW5hbGczdmVjSWRMaTJFRUVOU185YWxsb2NhdG9ySVM0X0VFRUVMYjBFRUUATlN0M19fMjIzX19vcHRpb25hbF9zdG9yYWdlX2Jhc2VJTlNfNnZlY3RvcklONmxpbmFsZzN2ZWNJZExpMkVFRU5TXzlhbGxvY2F0b3JJUzRfRUVFRUxiMEVFRQBOU3QzX18yMjRfX29wdGlvbmFsX2Rlc3RydWN0X2Jhc2VJTlNfNnZlY3RvcklONmxpbmFsZzN2ZWNJZExpMkVFRU5TXzlhbGxvY2F0b3JJUzRfRUVFRUxiMEVFRQBOU3QzX18yNnZlY3RvcklOUzBfSU42bGluYWxnM3ZlY0lkTGkyRUVFTlNfOWFsbG9jYXRvcklTM19FRUVFTlM0X0lTNl9FRUVFAFBOU3QzX18yNnZlY3RvcklOUzBfSU42bGluYWxnM3ZlY0lkTGkyRUVFTlNfOWFsbG9jYXRvcklTM19FRUVFTlM0X0lTNl9FRUVFAFBLTlN0M19fMjZ2ZWN0b3JJTlMwX0lONmxpbmFsZzN2ZWNJZExpMkVFRU5TXzlhbGxvY2F0b3JJUzNfRUVFRU5TNF9JUzZfRUVFRQBwcAB2cABwcAB2cHBwAHZwcGlwAGlwcABwcHBpAGlwcGlwAE5TdDNfXzI4b3B0aW9uYWxJZEVFAE5TdDNfXzIyN19fb3B0aW9uYWxfbW92ZV9hc3NpZ25fYmFzZUlkTGIxRUVFAE5TdDNfXzIyN19fb3B0aW9uYWxfY29weV9hc3NpZ25fYmFzZUlkTGIxRUVFAE5TdDNfXzIyMF9fb3B0aW9uYWxfbW92ZV9iYXNlSWRMYjFFRUUATlN0M19fMjIwX19vcHRpb25hbF9jb3B5X2Jhc2VJZExiMUVFRQBOU3QzX18yMjNfX29wdGlvbmFsX3N0b3JhZ2VfYmFzZUlkTGIwRUVFAE5TdDNfXzIyNF9fb3B0aW9uYWxfZGVzdHJ1Y3RfYmFzZUlkTGIxRUVFAE5TdDNfXzI2dmVjdG9ySWROU185YWxsb2NhdG9ySWRFRUVFAFBOU3QzX18yNnZlY3RvcklkTlNfOWFsbG9jYXRvcklkRUVFRQBQS05TdDNfXzI2dmVjdG9ySWROU185YWxsb2NhdG9ySWRFRUVFAHBwAHZwAHBwAHZwcGQAdnBwaWQAaXBwAHBwcGkAaXBwaWQATlN0M19fMjhvcHRpb25hbElOOG1hbmlmb2xkMTJDcm9zc1NlY3Rpb25FRUUATlN0M19fMjI3X19vcHRpb25hbF9tb3ZlX2Fzc2lnbl9iYXNlSU44bWFuaWZvbGQxMkNyb3NzU2VjdGlvbkVMYjBFRUUATlN0M19fMjI3X19vcHRpb25hbF9jb3B5X2Fzc2lnbl9iYXNlSU44bWFuaWZvbGQxMkNyb3NzU2VjdGlvbkVMYjBFRUUATlN0M19fMjIwX19vcHRpb25hbF9tb3ZlX2Jhc2VJTjhtYW5pZm9sZDEyQ3Jvc3NTZWN0aW9uRUxiMEVFRQBOU3QzX18yMjBfX29wdGlvbmFsX2NvcHlfYmFzZUlOOG1hbmlmb2xkMTJDcm9zc1NlY3Rpb25FTGIwRUVFAE5TdDNfXzIyM19fb3B0aW9uYWxfc3RvcmFnZV9iYXNlSU44bWFuaWZvbGQxMkNyb3NzU2VjdGlvbkVMYjBFRUUATlN0M19fMjI0X19vcHRpb25hbF9kZXN0cnVjdF9iYXNlSU44bWFuaWZvbGQxMkNyb3NzU2VjdGlvbkVMYjBFRUUATjhtYW5pZm9sZDEyQ3Jvc3NTZWN0aW9uRQBOU3QzX18yNnZlY3RvcklOOG1hbmlmb2xkMTJDcm9zc1NlY3Rpb25FTlNfOWFsbG9jYXRvcklTMl9FRUVFAFBOU3QzX18yNnZlY3RvcklOOG1hbmlmb2xkMTJDcm9zc1NlY3Rpb25FTlNfOWFsbG9jYXRvcklTMl9FRUVFAFBLTlN0M19fMjZ2ZWN0b3JJTjhtYW5pZm9sZDEyQ3Jvc3NTZWN0aW9uRU5TXzlhbGxvY2F0b3JJUzJfRUVFRQBwcAB2cABwcAB2cHBwAHZwcGlwAGlwcABwcHBpAGlwcGlwAE5TdDNfXzI4b3B0aW9uYWxJTjhtYW5pZm9sZDhNYW5pZm9sZEVFRQBOU3QzX18yMjdfX29wdGlvbmFsX21vdmVfYXNzaWduX2Jhc2VJTjhtYW5pZm9sZDhNYW5pZm9sZEVMYjBFRUUATlN0M19fMjI3X19vcHRpb25hbF9jb3B5X2Fzc2lnbl9iYXNlSU44bWFuaWZvbGQ4TWFuaWZvbGRFTGIwRUVFAE5TdDNfXzIyMF9fb3B0aW9uYWxfbW92ZV9iYXNlSU44bWFuaWZvbGQ4TWFuaWZvbGRFTGIwRUVFAE5TdDNfXzIyMF9fb3B0aW9uYWxfY29weV9iYXNlSU44bWFuaWZvbGQ4TWFuaWZvbGRFTGIwRUVFAE5TdDNfXzIyM19fb3B0aW9uYWxfc3RvcmFnZV9iYXNlSU44bWFuaWZvbGQ4TWFuaWZvbGRFTGIwRUVFAE5TdDNfXzIyNF9fb3B0aW9uYWxfZGVzdHJ1Y3RfYmFzZUlOOG1hbmlmb2xkOE1hbmlmb2xkRUxiMEVFRQBOU3QzX18yNnZlY3RvcklOOG1hbmlmb2xkOE1hbmlmb2xkRU5TXzlhbGxvY2F0b3JJUzJfRUVFRQBQTlN0M19fMjZ2ZWN0b3JJTjhtYW5pZm9sZDhNYW5pZm9sZEVOU185YWxsb2NhdG9ySVMyX0VFRUUAUEtOU3QzX18yNnZlY3RvcklOOG1hbmlmb2xkOE1hbmlmb2xkRU5TXzlhbGxvY2F0b3JJUzJfRUVFRQBwcAB2cABwcAB2cHBwAHZwcGlwAGlwcABwcHBpAGlwcGlwAE5TdDNfXzI4b3B0aW9uYWxJTjhtYW5pZm9sZDEwU21vb3RobmVzc0VFRQBOU3QzX18yMjdfX29wdGlvbmFsX21vdmVfYXNzaWduX2Jhc2VJTjhtYW5pZm9sZDEwU21vb3RobmVzc0VMYjFFRUUATlN0M19fMjI3X19vcHRpb25hbF9jb3B5X2Fzc2lnbl9iYXNlSU44bWFuaWZvbGQxMFNtb290aG5lc3NFTGIxRUVFAE5TdDNfXzIyMF9fb3B0aW9uYWxfbW92ZV9iYXNlSU44bWFuaWZvbGQxMFNtb290aG5lc3NFTGIxRUVFAE5TdDNfXzIyMF9fb3B0aW9uYWxfY29weV9iYXNlSU44bWFuaWZvbGQxMFNtb290aG5lc3NFTGIxRUVFAE5TdDNfXzIyM19fb3B0aW9uYWxfc3RvcmFnZV9iYXNlSU44bWFuaWZvbGQxMFNtb290aG5lc3NFTGIwRUVFAE5TdDNfXzIyNF9fb3B0aW9uYWxfZGVzdHJ1Y3RfYmFzZUlOOG1hbmlmb2xkMTBTbW9vdGhuZXNzRUxiMUVFRQBQTlN0M19fMjZ2ZWN0b3JJTjhtYW5pZm9sZDEwU21vb3RobmVzc0VOU185YWxsb2NhdG9ySVMyX0VFRUUAUEtOU3QzX18yNnZlY3RvcklOOG1hbmlmb2xkMTBTbW9vdGhuZXNzRU5TXzlhbGxvY2F0b3JJUzJfRUVFRQBwcAB2cABwcAB2cHBwAHZwcGlwAGlwcABwcHBpAGlwcGlwAE5TdDNfXzI4b3B0aW9uYWxJTjZsaW5hbGczdmVjSWRMaTRFRUVFRQBOU3QzX18yMjdfX29wdGlvbmFsX21vdmVfYXNzaWduX2Jhc2VJTjZsaW5hbGczdmVjSWRMaTRFRUVMYjFFRUUATlN0M19fMjI3X19vcHRpb25hbF9jb3B5X2Fzc2lnbl9iYXNlSU42bGluYWxnM3ZlY0lkTGk0RUVFTGIxRUVFAE5TdDNfXzIyMF9fb3B0aW9uYWxfbW92ZV9iYXNlSU42bGluYWxnM3ZlY0lkTGk0RUVFTGIxRUVFAE5TdDNfXzIyMF9fb3B0aW9uYWxfY29weV9iYXNlSU42bGluYWxnM3ZlY0lkTGk0RUVFTGIxRUVFAE5TdDNfXzIyM19fb3B0aW9uYWxfc3RvcmFnZV9iYXNlSU42bGluYWxnM3ZlY0lkTGk0RUVFTGIwRUVFAE5TdDNfXzIyNF9fb3B0aW9uYWxfZGVzdHJ1Y3RfYmFzZUlONmxpbmFsZzN2ZWNJZExpNEVFRUxiMUVFRQBOU3QzX18yNnZlY3RvcklONmxpbmFsZzN2ZWNJZExpNEVFRU5TXzlhbGxvY2F0b3JJUzNfRUVFRQBQTlN0M19fMjZ2ZWN0b3JJTjZsaW5hbGczdmVjSWRMaTRFRUVOU185YWxsb2NhdG9ySVMzX0VFRUUAUEtOU3QzX18yNnZlY3RvcklONmxpbmFsZzN2ZWNJZExpNEVFRU5TXzlhbGxvY2F0b3JJUzNfRUVFRQBwcAB2cABwcAB2cHBwAHZwcGlwAGlwcABwcHBpAGlwcGlwAFBOOG1hbmlmb2xkMTJDcm9zc1NlY3Rpb25FAFBLTjhtYW5pZm9sZDEyQ3Jvc3NTZWN0aW9uRQBwcAB2cABwcHBpAHBwcHAAcHBwaQBwcHBwAHBwcHAAcHBwZABwcHAAaXBwAGRwcABpcHAAcHBwAHBwcGRpZGQAcHBwAHBwcABwcHBpAHBwZGkAcHBwAHZwcHAAcHBwAFBOOG1hbmlmb2xkOE1hbmlmb2xkRQBQS044bWFuaWZvbGQ4TWFuaWZvbGRFAHBwAHZwAHBwcABwcHBwAHBwcHAAcHBwcGQAcHBwcGQAcHBwcABwcHBkAHBwcABwcHAAcHBwaQBwcHBpAHBwcGQAcHBwZGQAcHBwaQBwcHBpaQBwcHBwAHBwcHAAcHBwZGRkAHBwcABpcHAATlN0M19fMjEyYmFzaWNfc3RyaW5nSWNOU18xMWNoYXJfdHJhaXRzSWNFRU5TXzlhbGxvY2F0b3JJY0VFRUUAcHBwAHBwcHAAaXBwAHBwcABkcHAAaXBwAGRwcHBkAHBwcHBwAHBwcGlpAHBwcGlkAHBwcGkAcHBkZGRpaQBwcGRpAHBwAHBwcHAAcHBwZGlkcABwcHBkaQBwcHBpZABwcGlwZGRkAHBwcABpcGkAcHBwAHZwcHAAcHBwAHZwZAB2cGkAaXBkAHZwAE4xMGVtc2NyaXB0ZW4xMW1lbW9yeV92aWV3SWpFRQBOMTBlbXNjcmlwdGVuMTFtZW1vcnlfdmlld0lmRUUATjEwZW1zY3JpcHRlbjExbWVtb3J5X3ZpZXdJaEVFAE4xMGVtc2NyaXB0ZW4xMW1lbW9yeV92aWV3SWRFRQBOU3QzX18yMTBfX2Z1bmN0aW9uNl9fZnVuY0lQRnZSTjZsaW5hbGczdmVjSWRMaTJFRUVFUzZfRUUATlN0M19fMjEwX19mdW5jdGlvbjZfX2Jhc2VJRnZSTjZsaW5hbGczdmVjSWRMaTJFRUVFRUUAUEZ2Uk42bGluYWxnM3ZlY0lkTGkyRUVFRQBGdlJONmxpbmFsZzN2ZWNJZExpMkVFRUUATlN0M19fMjEwX19mdW5jdGlvbjZfX2Z1bmNJUEZ2Uk42bGluYWxnM3ZlY0lkTGkzRUVFRVM2X0VFAE5TdDNfXzIxMF9fZnVuY3Rpb242X19iYXNlSUZ2Uk42bGluYWxnM3ZlY0lkTGkzRUVFRUVFAFBGdlJONmxpbmFsZzN2ZWNJZExpM0VFRUUARnZSTjZsaW5hbGczdmVjSWRMaTNFRUVFAE5TdDNfXzIxMF9fZnVuY3Rpb242X19mdW5jSVpONm1hbl9qczlXYXJwQmF0Y2hFUk44bWFuaWZvbGQ4TWFuaWZvbGRFbUUzJF8wRnZOUzNfN1ZlY1ZpZXdJTjZsaW5hbGczdmVjSWRMaTNFRUVFRUVFRQBOU3QzX18yMTBfX2Z1bmN0aW9uNl9fYmFzZUlGdk44bWFuaWZvbGQ3VmVjVmlld0lONmxpbmFsZzN2ZWNJZExpM0VFRUVFRUVFAFpONm1hbl9qczlXYXJwQmF0Y2hFUk44bWFuaWZvbGQ4TWFuaWZvbGRFbUUzJF8wAE5TdDNfXzIxMF9fZnVuY3Rpb242X19mdW5jSVBGdlBkTjZsaW5hbGczdmVjSWRMaTNFRUVQS2RFUzhfRUUATlN0M19fMjEwX19mdW5jdGlvbjZfX2Jhc2VJRnZQZE42bGluYWxnM3ZlY0lkTGkzRUVFUEtkRUVFAFBGdlBkTjZsaW5hbGczdmVjSWRMaTNFRUVQS2RFAEZ2UGRONmxpbmFsZzN2ZWNJZExpM0VFRVBLZEUATlN0M19fMjEwX19mdW5jdGlvbjZfX2Z1bmNJUEZkUktONmxpbmFsZzN2ZWNJZExpM0VFRUVGZFM0X0VFRQBOU3QzX18yMTBfX2Z1bmN0aW9uNl9fYmFzZUlGZE42bGluYWxnM3ZlY0lkTGkzRUVFRUVFAFBGZFJLTjZsaW5hbGczdmVjSWRMaTNFRUVFAEZkUktONmxpbmFsZzN2ZWNJZExpM0VFRUUATlN0M19fMjIwX19zaGFyZWRfcHRyX2VtcGxhY2VJTjhtYW5pZm9sZDhNYW5pZm9sZDRJbXBsRU5TXzlhbGxvY2F0b3JJUzNfRUVFRQAATlN0M19fMjEwX19mdW5jdGlvbjZfX2Z1bmNJWk44bWFuaWZvbGQ4TWFuaWZvbGQ2U3BoZXJlRWRpRTMkXzBGaU42bGluYWxnM3ZlY0lkTGkzRUVFTlM2X0lkTGk0RUVFUzhfRUVFAE5TdDNfXzIxMF9fZnVuY3Rpb242X19iYXNlSUZpTjZsaW5hbGczdmVjSWRMaTNFRUVOUzNfSWRMaTRFRUVTNV9FRUUAWk44bWFuaWZvbGQ4TWFuaWZvbGQ2U3BoZXJlRWRpRTMkXzAAAAEAAAACAAAAAAAAAE5TdDNfXzIxMF9fZnVuY3Rpb242X19mdW5jSVpOMTJfR0xPQkFMX19OXzExNUFkZE5ld0VkZ2VWZXJ0c0VSTlNfM21hcElpTlNfNnZlY3RvcklOUzJfN0VkZ2VQb3NFTlNfOWFsbG9jYXRvcklTNV9FRUVFTlNfNGxlc3NJaUVFTlM2X0lOU180cGFpcklLaVM4X0VFRUVFRVJOUzNfSU5TQl9JaWlFRVM4X05TOV9JU0hfRUVOUzZfSU5TQl9JS1NIX1M4X0VFRUVFRVJLTjhtYW5pZm9sZDNWZWNJTlNfNWFycmF5SWlMbTJFRUVMYjBFRUVSS05TUF9JaUxiMEVFRVNYX1JLTlNPXzlIYWxmZWRnZXNFYm1QTlNPXzE2RXhlY3V0aW9uQ29udGV4dDRJbXBsRUUzJF8wRnZtRUVFAE5TdDNfXzIxMF9fZnVuY3Rpb242X19iYXNlSUZ2bUVFRQBaTjEyX0dMT0JBTF9fTl8xMTVBZGROZXdFZGdlVmVydHNFUk5TdDNfXzIzbWFwSWlOUzBfNnZlY3RvcklOU183RWRnZVBvc0VOUzBfOWFsbG9jYXRvcklTM19FRUVFTlMwXzRsZXNzSWlFRU5TNF9JTlMwXzRwYWlySUtpUzZfRUVFRUVFUk5TMV9JTlM5X0lpaUVFUzZfTlM3X0lTRl9FRU5TNF9JTlM5X0lLU0ZfUzZfRUVFRUVFUktOOG1hbmlmb2xkM1ZlY0lOUzBfNWFycmF5SWlMbTJFRUVMYjBFRUVSS05TTl9JaUxiMEVFRVNWX1JLTlNNXzlIYWxmZWRnZXNFYm1QTlNNXzE2RXhlY3V0aW9uQ29udGV4dDRJbXBsRUUzJF8wAE5TdDNfXzIxMF9fZnVuY3Rpb242X19mdW5jSVpOMTJfR0xPQkFMX19OXzExNUFkZE5ld0VkZ2VWZXJ0c0VSTlNfM21hcElpTlNfNnZlY3RvcklOUzJfN0VkZ2VQb3NFTlNfOWFsbG9jYXRvcklTNV9FRUVFTlNfNGxlc3NJaUVFTlM2X0lOU180cGFpcklLaVM4X0VFRUVFRVJOUzNfSU5TQl9JaWlFRVM4X05TOV9JU0hfRUVOUzZfSU5TQl9JS1NIX1M4X0VFRUVFRVJLTjhtYW5pZm9sZDNWZWNJTlNfNWFycmF5SWlMbTJFRUVMYjBFRUVSS05TUF9JaUxiMEVFRVNYX1JLTlNPXzlIYWxmZWRnZXNFYm1QTlNPXzE2RXhlY3V0aW9uQ29udGV4dDRJbXBsRUUzJF8xRnZtRUVFAFpOMTJfR0xPQkFMX19OXzExNUFkZE5ld0VkZ2VWZXJ0c0VSTlN0M19fMjNtYXBJaU5TMF82dmVjdG9ySU5TXzdFZGdlUG9zRU5TMF85YWxsb2NhdG9ySVMzX0VFRUVOUzBfNGxlc3NJaUVFTlM0X0lOUzBfNHBhaXJJS2lTNl9FRUVFRUVSTlMxX0lOUzlfSWlpRUVTNl9OUzdfSVNGX0VFTlM0X0lOUzlfSUtTRl9TNl9FRUVFRUVSS044bWFuaWZvbGQzVmVjSU5TMF81YXJyYXlJaUxtMkVFRUxiMEVFRVJLTlNOX0lpTGIwRUVFU1ZfUktOU01fOUhhbGZlZGdlc0VibVBOU01fMTZFeGVjdXRpb25Db250ZXh0NEltcGxFRTMkXzEAAQAAAAIAAAAAAAAAAgAAAAAAAAABAAAAAE44bWFuaWZvbGQ3Q3NnTm9kZUUATlN0M19fMjIzZW5hYmxlX3NoYXJlZF9mcm9tX3RoaXNJTjhtYW5pZm9sZDdDc2dOb2RlRUVFAE44bWFuaWZvbGQxMUNzZ0xlYWZOb2RlRQBOOG1hbmlmb2xkOUNzZ09wTm9kZUUATlN0M19fMjIwX19zaGFyZWRfcHRyX2VtcGxhY2VJTjhtYW5pZm9sZDEzQ3NnU3RhY2tGcmFtZUVOU185YWxsb2NhdG9ySVMyX0VFRUUATlN0M19fMjIwX19zaGFyZWRfcHRyX2VtcGxhY2VJTjhtYW5pZm9sZDlDc2dPcE5vZGVFTlNfOWFsbG9jYXRvcklTMl9FRUVFAE5TdDNfXzIyMF9fc2hhcmVkX3B0cl9lbXBsYWNlSUtOOG1hbmlmb2xkOE1hbmlmb2xkNEltcGxFTlNfOWFsbG9jYXRvcklTM19FRUVFAE5TdDNfXzIyMF9fc2hhcmVkX3B0cl9lbXBsYWNlSU44bWFuaWZvbGQxMUNzZ0xlYWZOb2RlRU5TXzlhbGxvY2F0b3JJUzJfRUVFRQBOU3QzX18yMjBfX3NoYXJlZF9wdHJfZW1wbGFjZUlOU182dmVjdG9ySU5TXzEwc2hhcmVkX3B0cklOOG1hbmlmb2xkN0NzZ05vZGVFRUVOU185YWxsb2NhdG9ySVM1X0VFRUVOUzZfSVM4X0VFRUUATlN0M19fMjIwX19zaGFyZWRfcHRyX2VtcGxhY2VJTlNfMTVyZWN1cnNpdmVfbXV0ZXhFTlNfOWFsbG9jYXRvcklTMV9FRUVFAAAAAAAAAAACAAAAAQAAAE5TdDNfXzIyMF9fc2hhcmVkX3B0cl9lbXBsYWNlSU44bWFuaWZvbGQxNkV4ZWN1dGlvbkNvbnRleHQ0SW1wbEVOU185YWxsb2NhdG9ySVMzX0VFRUUAAAABAAAAAgBBhvkAC4cB8L8AAAAAAADwvwAAAAAAAPA/AAAAAAAA8L8AAAAAAADwPwAAAAAAAPC/AAAAAAAA8D8AAAAAAADwvwAAAAAAAPC/AAAAAAAA8D8AAAAAAADwPwAAAAAAAPA/AgAAAAAAAAABAAAAAAAAAAMAAAABAAAAAgAAAAMAAAAAAAAAAwAAAAIAAAABAEG++gALAvA/AEHO+gALAvA/AEHm+gALEvA/AAAAAAAA8D8AAAAAAADwPwBBjvsACwLwPwBBnvsACxLwPwAAAAAAAPA/AAAAAAAA8D8AQb77AAufAfA/AAAAAAAA8D8AAAAAAADwPwEAAAAAAAAABAAAAAIAAAAEAAAAAAAAAAEAAAADAAAAAAAAAAMAAAABAAAABQAAAAMAAAACAAAAAAAAAAMAAAAHAAAAAgAAAAUAAAAEAAAABgAAAAUAAAABAAAABAAAAAYAAAAEAAAAAgAAAAcAAAAGAAAAAgAAAAcAAAADAAAABQAAAAcAAAAFAAAABgBB5vwACwLwPwBB/vwACwLwvwBBnv0ACwLwPwBBtv0ACwLwvwBB1v0ACwLwPwBB7v0AC8oI8L8AAAAAAgAAAAQAAAABAAAABQAAAAMAAAACAAAAAQAAAAQAAAADAAAABQAAAAAAAAABAAAAAwAAAAQAAAAAAAAABQAAAAIAAAADAAAAAAAAAAQAAAACAAAABQAAAAEAAAABAAAAAgAAAAAAAABOU3QzX18yMTBfX2Z1bmN0aW9uNl9fZnVuY0laTjhtYW5pZm9sZDhNYW5pZm9sZDRJbXBsNFdhcnBFTlNfOGZ1bmN0aW9uSUZ2Uk42bGluYWxnM3ZlY0lkTGkzRUVFRUVFRTMkXzBGdk5TMl83VmVjVmlld0lTOF9FRUVFRQBaTjhtYW5pZm9sZDhNYW5pZm9sZDRJbXBsNFdhcnBFTlN0M19fMjhmdW5jdGlvbklGdlJONmxpbmFsZzN2ZWNJZExpM0VFRUVFRUUzJF8wAAAAAAAAAE+7YQVnrN0/GC1EVPsh6T+b9oHSC3PvPxgtRFT7Ifk/4mUvIn8rejwHXBQzJqaBPL3L8HqIB3A8B1wUMyamkTxOU3QzX18yMjBfX3NoYXJlZF9wdHJfZW1wbGFjZUlOU181bXV0ZXhFTlNfOWFsbG9jYXRvcklTMV9FRUVFAE5TdDNfXzIxMF9fZnVuY3Rpb242X19mdW5jSVpOSzhtYW5pZm9sZDhNYW5pZm9sZDZSZWZpbmVFaUUzJF8wRmlONmxpbmFsZzN2ZWNJZExpM0VFRU5TNl9JZExpNEVFRVM4X0VFRQBaTks4bWFuaWZvbGQ4TWFuaWZvbGQ2UmVmaW5lRWlFMyRfMABOU3QzX18yMTBfX2Z1bmN0aW9uNl9fZnVuY0laTks4bWFuaWZvbGQ4TWFuaWZvbGQxNFJlZmluZVRvTGVuZ3RoRWRFMyRfMEZpTjZsaW5hbGczdmVjSWRMaTNFRUVOUzZfSWRMaTRFRUVTOF9FRUUAWk5LOG1hbmlmb2xkOE1hbmlmb2xkMTRSZWZpbmVUb0xlbmd0aEVkRTMkXzAATlN0M19fMjEwX19mdW5jdGlvbjZfX2Z1bmNJWk5LOG1hbmlmb2xkOE1hbmlmb2xkMTdSZWZpbmVUb1RvbGVyYW5jZUVkRTMkXzBGaU42bGluYWxnM3ZlY0lkTGkzRUVFTlM2X0lkTGk0RUVFUzhfRUVFAFpOSzhtYW5pZm9sZDhNYW5pZm9sZDE3UmVmaW5lVG9Ub2xlcmFuY2VFZEUzJF8wAE5TdDNfXzIyMF9fc2hhcmVkX3B0cl9wb2ludGVySVBOOG1hbmlmb2xkOE1hbmlmb2xkNEltcGxFTlNfMTRkZWZhdWx0X2RlbGV0ZUlTM19FRU5TXzlhbGxvY2F0b3JJUzNfRUVFRQBOU3QzX18yMTRkZWZhdWx0X2RlbGV0ZUlOOG1hbmlmb2xkOE1hbmlmb2xkNEltcGxFRUUAAAAAABgtRFT7Iek/GC1EVPsh6b/SITN/fNkCQNIhM3982QLAAEHHhgELEYAYLURU+yEJQBgtRFT7IQnAAEHshgELBQEAAAABAEGEhwELAQEAQZiHAQslAQAAAAAAAAD/////AAAAAAAAAAABAAAAAAAAAP////8AAAAAAQBByIcBCxz/////AQAAAP///////////////wEAAAD/////AEH0hwELBP////8AQYiIAQtJ/////wAAAAAAAAAA//////////8BAAAA/////wAAAAD/////AQAAAP//////////AAAAAAEAAAACAAAAAAAAAAEAAAABAAAAAgBB4IgBC7AR////////////////AAAAAAMAAAAEAAAAAAAAAAEAAAAFAAAAAQAAAAUAAAADAAAAAQAAAAQAAAACAAAAAQAAAAAAAAADAAAAAgAAAAUAAAAAAAAABQAAAAMAAAACAAAAAgAAAAMAAAAFAAAAAAAAAAUAAAACAAAAAwAAAAAAAAABAAAAAgAAAAQAAAABAAAAAwAAAAUAAAABAAAABQAAAAEAAAAAAAAABAAAAAMAAAAAAAAA////////////////////////////////////////////////////////////////AwAAAAQAAAABAAAA////////////////AwAAAAIAAAABAAAAAAAAAAQAAAACAAAA////////////////////////////////AgAAAAQAAAAAAAAAAQAAAAIAAAADAAAA////////////////AQAAAAQAAAADAAAA////////////////////////////////////////////////TlN0M19fMjEwX19mdW5jdGlvbjZfX2Z1bmNJWk44bWFuaWZvbGQ4TWFuaWZvbGQ0SW1wbDEwU2V0Tm9ybWFsc0VpZEUzJF8wRlpOUzRfMTBTZXROb3JtYWxzRWlkRThGYWNlRWRnZWlFRUUATlN0M19fMjEwX19mdW5jdGlvbjZfX2Jhc2VJRlpOOG1hbmlmb2xkOE1hbmlmb2xkNEltcGwxMFNldE5vcm1hbHNFaWRFOEZhY2VFZGdlaUVFRQBaTjhtYW5pZm9sZDhNYW5pZm9sZDRJbXBsMTBTZXROb3JtYWxzRWlkRTMkXzAATlN0M19fMjEwX19mdW5jdGlvbjZfX2Z1bmNJWk44bWFuaWZvbGQ4TWFuaWZvbGQ0SW1wbDEwU2V0Tm9ybWFsc0VpZEUzJF8xRnZpUktaTlM0XzEwU2V0Tm9ybWFsc0VpZEU4RmFjZUVkZ2VSUzZfRUVFAE5TdDNfXzIxMF9fZnVuY3Rpb242X19iYXNlSUZ2aVJLWk44bWFuaWZvbGQ4TWFuaWZvbGQ0SW1wbDEwU2V0Tm9ybWFsc0VpZEU4RmFjZUVkZ2VSUzVfRUVFAFpOOG1hbmlmb2xkOE1hbmlmb2xkNEltcGwxMFNldE5vcm1hbHNFaWRFMyRfMQBOU3QzX18yMTBfX2Z1bmN0aW9uNl9fZnVuY0laWk44bWFuaWZvbGQ4TWFuaWZvbGQ0SW1wbDE0Q3JlYXRlVGFuZ2VudHNFaUVOSzMkXzBjbEVpRVVsaUVfRlpaTlM0XzE0Q3JlYXRlVGFuZ2VudHNFaUVOS1M1X2NsRWlFMTBGbGF0Tm9ybWFsaUVFRQBOU3QzX18yMTBfX2Z1bmN0aW9uNl9fYmFzZUlGWlpOOG1hbmlmb2xkOE1hbmlmb2xkNEltcGwxNENyZWF0ZVRhbmdlbnRzRWlFTkszJF8wY2xFaUUxMEZsYXROb3JtYWxpRUVFAFpaTjhtYW5pZm9sZDhNYW5pZm9sZDRJbXBsMTRDcmVhdGVUYW5nZW50c0VpRU5LMyRfMGNsRWlFVWxpRV8ATlN0M19fMjEwX19mdW5jdGlvbjZfX2Z1bmNJWlpOOG1hbmlmb2xkOE1hbmlmb2xkNEltcGwxNENyZWF0ZVRhbmdlbnRzRWlFTkszJF8wY2xFaUVVbGlSS1paTlM0XzE0Q3JlYXRlVGFuZ2VudHNFaUVOS1M1X2NsRWlFMTBGbGF0Tm9ybWFsUzhfRV9GdmlTOF9SUzZfRUVFAE5TdDNfXzIxMF9fZnVuY3Rpb242X19iYXNlSUZ2aVJLWlpOOG1hbmlmb2xkOE1hbmlmb2xkNEltcGwxNENyZWF0ZVRhbmdlbnRzRWlFTkszJF8wY2xFaUUxMEZsYXROb3JtYWxSUzZfRUVFAFpaTjhtYW5pZm9sZDhNYW5pZm9sZDRJbXBsMTRDcmVhdGVUYW5nZW50c0VpRU5LMyRfMGNsRWlFVWxpUktaWk5TMV8xNENyZWF0ZVRhbmdlbnRzRWlFTktTMl9jbEVpRTEwRmxhdE5vcm1hbFM1X0VfAAEAAAACAAAAAAAAAAIAAAAAAAAAAQAAAAEAAAACAAAAAAAAAAEAAAACAAAAAAAAAE5TdDNfXzIyMF9fc2hhcmVkX3B0cl9lbXBsYWNlSUtOOG1hbmlmb2xkOFBhdGhJbXBsRU5TXzlhbGxvY2F0b3JJUzJfRUVFRQBOMTFDbGlwcGVyMkxpYjE3Q2xpcHBlcjJFeGNlcHRpb25FAE4xMUNsaXBwZXIyTGliOENsaXBwZXJERQBOMTFDbGlwcGVyMkxpYjlQb2x5UGF0aERFAE4xMUNsaXBwZXIyTGliOFBvbHlQYXRoRQBOU3QzX18yMTBfX2Z1bmN0aW9uNl9fZnVuY0laTks4bWFuaWZvbGQxMkNyb3NzU2VjdGlvbjRXYXJwRU5TXzhmdW5jdGlvbklGdlJONmxpbmFsZzN2ZWNJZExpMkVFRUVFRUUzJF8wRnZOUzJfN1ZlY1ZpZXdJUzdfRUVFRUUATlN0M19fMjEwX19mdW5jdGlvbjZfX2Jhc2VJRnZOOG1hbmlmb2xkN1ZlY1ZpZXdJTjZsaW5hbGczdmVjSWRMaTJFRUVFRUVFRQBaTks4bWFuaWZvbGQxMkNyb3NzU2VjdGlvbjRXYXJwRU5TdDNfXzI4ZnVuY3Rpb25JRnZSTjZsaW5hbGczdmVjSWRMaTJFRUVFRUVFMyRfMABOMTFDbGlwcGVyMkxpYjExQ2xpcHBlckJhc2VFAE4xMUNsaXBwZXIyTGliOUNsaXBwZXI2NEUAAAAAAAAAAE+7YQVnrN0/GC1EVPsh6T+b9oHSC3PvPxgtRFT7Ifk/4mUvIn8rejwHXBQzJqaBPL3L8HqIB3A8B1wUMyamkTwYLURU+yHpPxgtRFT7Iem/0iEzf3zZAkDSITN/fNkCwABBn5oBC+gVgBgtRFT7IQlAGC1EVPshCcADAAAABAAAAAQAAAAGAAAAg/miAERObgD8KRUA0VcnAN009QBi28AAPJmVAEGQQwBjUf4Au96rALdhxQA6biQA0k1CAEkG4AAJ6i4AHJLRAOsd/gApsRwA6D6nAPU1ggBEuy4AnOmEALQmcABBfl8A1pE5AFODOQCc9DkAi1+EACj5vQD4HzsA3v+XAA+YBQARL+8AClqLAG0fbQDPfjYACcsnAEZPtwCeZj8ALepfALondQDl68cAPXvxAPc5BwCSUooA+2vqAB+xXwAIXY0AMANWAHv8RgDwq2sAILzPADb0mgDjqR0AXmGRAAgb5gCFmWUAoBRfAI1AaACA2P8AJ3NNAAYGMQDKVhUAyahzAHviYABrjMAAGcRHAM1nwwAJ6NwAWYMqAIt2xACmHJYARK/dABlX0QClPgUABQf/ADN+PwDCMugAmE/eALt9MgAmPcMAHmvvAJ/4XgA1HzoAf/LKAPGHHQB8kCEAaiR8ANVu+gAwLXcAFTtDALUUxgDDGZ0ArcTCACxNQQAMAF0Ahn1GAONxLQCbxpoAM2IAALTSfAC0p5cAN1XVANc+9gCjEBgATXb8AGSdKgBw16sAY3z4AHqwVwAXFecAwElWADvW2QCnhDgAJCPLANaKdwBaVCMAAB+5APEKGwAZzt8AnzH/AGYeagCZV2EArPtHAH5/2AAiZbcAMuiJAOa/YADvxM0AbDYJAF0/1AAW3tcAWDveAN6bkgDSIigAKIboAOJYTQDGyjIACOMWAOB9ywAXwFAA8x2nABjgWwAuEzQAgxJiAINIAQD1jlsArbB/AB7p8gBISkMAEGfTAKrd2ACuX0IAamHOAAoopADTmbQABqbyAFx3fwCjwoMAYTyIAIpzeACvjFoAb9e9AC2mYwD0v8sAjYHvACbBZwBVykUAytk2ACio0gDCYY0AEsl3AAQmFAASRpsAxFnEAMjFRABNspEAABfzANRDrQApSeUA/dUQAAC+/AAelMwAcM7uABM+9QDs8YAAs+fDAMf4KACTBZQAwXE+AC4JswALRfMAiBKcAKsgewAutZ8AR5LCAHsyLwAMVW0AcqeQAGvnHwAxy5YAeRZKAEF54gD034kA6JSXAOLmhACZMZcAiO1rAF9fNgC7/Q4ASJq0AGekbABxckIAjV0yAJ8VuAC85QkAjTElAPd0OQAwBRwADQwBAEsIaAAs7lgAR6qQAHTnAgC91iQA932mAG5IcgCfFu8AjpSmALSR9gDRU1EAzwryACCYMwD1S34AsmNoAN0+XwBAXQMAhYl/AFVSKQA3ZMAAbdgQADJIMgBbTHUATnHUAEVUbgALCcEAKvVpABRm1QAnB50AXQRQALQ72wDqdsUAh/kXAElrfQAdJ7oAlmkpAMbMrACtFFQAkOJqAIjZiQAsclAABKS+AHcHlADzMHAAAPwnAOpxqABmwkkAZOA9AJfdgwCjP5cAQ5T9AA2GjAAxQd4AkjmdAN1wjAAXt+cACN87ABU3KwBcgKAAWoCTABARkgAP6NgAbICvANv/SwA4kA8AWRh2AGKlFQBhy7sAx4m5ABBAvQDS8gQASXUnAOu29gDbIrsAChSqAIkmLwBkg3YACTszAA6UGgBROqoAHaPCAK/trgBcJhIAbcJNAC16nADAVpcAAz+DAAnw9gArQIwAbTGZADm0BwAMIBUA2MNbAPWSxADGrUsATsqlAKc3zQDmqTYAq5KUAN1CaAAZY94AdozvAGiLUgD82zcArqGrAN8VMQAArqEADPvaAGRNZgDtBbcAKWUwAFdWvwBH/zoAavm5AHW+8wAok98Aq4AwAGaM9gAEyxUA+iIGANnkHQA9s6QAVxuPADbNCQBOQukAE76kADMjtQDwqhoAT2WoANLBpQALPw8AW3jNACP5dgB7iwQAiRdyAMamUwBvbuIA7+sAAJtKWADE2rcAqma6AHbPzwDRAh0AsfEtAIyZwQDDrXcAhkjaAPddoADGgPQArPAvAN3smgA/XLwA0N5tAJDHHwAq27YAoyU6AACvmgCtU5MAtlcEACkttABLgH4A2genAHaqDgB7WaEAFhIqANy3LQD65f0Aidv+AIm+/QDkdmwABqn8AD6AcACFbhUA/Yf/ACg+BwBhZzMAKhiGAE296gCz568Aj21uAJVnOQAxv1sAhNdIADDfFgDHLUMAJWE1AMlwzgAwy7gAv2z9AKQAogAFbOQAWt2gACFvRwBiEtIAuVyEAHBhSQBrVuAAmVIBAFBVNwAe1bcAM/HEABNuXwBdMOQAhS6pAB2ywwChMjYACLekAOqx1AAW9yEAj2nkACf/dwAMA4AAjUAtAE/NoAAgpZkAs6LTAC9dCgC0+UIAEdrLAH2+0ACb28EAqxe9AMqigQAIalwALlUXACcAVQB/FPAA4QeGABQLZACWQY0Ah77eANr9KgBrJbYAe4k0AAXz/gC5v54AaGpPAEoqqABPxFoALfi8ANdamAD0x5UADU2NACA6pgCkV18AFD+xAIA4lQDMIAEAcd2GAMnetgC/YPUATWURAAEHawCMsKwAssDQAFFVSAAe+w4AlXLDAKMGOwDAQDUABtx7AOBFzABOKfoA1srIAOjzQQB8ZN4Am2TYANm+MQCkl8MAd1jUAGnjxQDw2hMAujo8AEYYRgBVdV8A0r31AG6SxgCsLl0ADkTtABw+QgBhxIcAKf3pAOfW8wAifMoAb5E1AAjgxQD/140AbmriALD9xgCTCMEAfF10AGutsgDNbp0APnJ7AMYRagD3z6kAKXPfALXJugC3AFEA4rINAHS6JADlfWAAdNiKAA0VLACBGAwAfmaUAAEpFgCfenYA/f2+AFZF7wDZfjYA7NkTAIu6uQDEl/wAMagnAPFuwwCUxTYA2KhWALSotQDPzA4AEoktAG9XNAAsVokAmc7jANYguQBrXqoAPiqcABFfzAD9C0oA4fT7AI47bQDihiwA6dSEAPy0qQDv7tEALjXJAC85YQA4IUQAG9nIAIH8CgD7SmoALxzYAFO0hABOmYwAVCLMACpV3ADAxtYACxmWABpwuABplWQAJlpgAD9S7gB/EQ8A9LURAPzL9QA0vC0ANLzuAOhdzADdXmAAZ46bAJIz7wDJF7gAYVibAOFXvABRg8YA2D4QAN1xSAAtHN0ArxihACEsRgBZ89cA2XqYAJ5UwABPhvoAVgb8AOV5rgCJIjYAOK0iAGeT3ABV6KoAgiY4AMrnmwBRDaQAmTOxAKnXDgBpBUgAZbLwAH+IpwCITJcA+dE2ACGSswB7gkoAmM8hAECf3ADcR1UA4XQ6AGfrQgD+nd8AXtRfAHtnpAC6rHoAVfaiACuIIwBBulUAWW4IACEqhgA5R4MAiePmAOWe1ABJ+0AA/1bpABwPygDFWYoAlPorANPBxQAPxc8A21quAEfFhgCFQ2IAIYY7ACx5lAAQYYcAKkx7AIAsGgBDvxIAiCaQAHg8iQCoxOQA5dt7AMQ6wgAm9OoA92eKAA2SvwBloysAPZOxAL18CwCkUdwAJ91jAGnh3QCalBkAqCmVAGjOKAAJ7bQARJ8gAE6YygBwgmMAfnwjAA+5MgCn9Y4AFFbnACHxCAC1nSoAb35NAKUZUQC1+asAgt/WAJbdYQAWNgIAxDqfAIOioQBy7W0AOY16AIK4qQBrMlwARidbAAA07QDSAHcA/PRVAAFZTQDgcYAAQZOwAQutAUD7Ifk/AAAAAC1EdD4AAACAmEb4PAAAAGBRzHg7AAAAgIMb8DkAAABAICV6OAAAAIAiguM2AAAAAB3zaTX+gitlRxVnQAAAAAAAADhDAAD6/kIudr86O568mvcMvb39/////98/PFRVVVVVxT+RKxfPVVWlPxfQpGcREYE/AAAAAAAAyELvOfr+Qi7mPyTEgv+9v84/tfQM1whrrD/MUEbSq7KDP4Q6Tpvg11U/AEHOsQELwhDwP26/iBpPO5s8NTP7qT327z9d3NicE2BxvGGAdz6a7O8/0WaHEHpekLyFf27oFePvPxP2ZzVS0ow8dIUV07DZ7z/6jvkjgM6LvN723Slr0O8/YcjmYU73YDzIm3UYRcfvP5nTM1vko5A8g/PGyj6+7z9te4NdppqXPA+J+WxYte8//O/9khq1jjz3R3IrkqzvP9GcL3A9vj48otHTMuyj7z8LbpCJNANqvBvT/q9mm+8/Dr0vKlJWlbxRWxLQAZPvP1XqTozvgFC8zDFswL2K7z8W9NW5I8mRvOAtqa6agu8/r1Vc6ePTgDxRjqXImHrvP0iTpeoVG4C8e1F9PLhy7z89Mt5V8B+PvOqNjDj5au8/v1MTP4yJizx1y2/rW2PvPybrEXac2Za81FwEhOBb7z9gLzo+9+yaPKq5aDGHVO8/nTiGy4Lnj7wd2fwiUE3vP43DpkRBb4o81oxiiDtG7z99BOSwBXqAPJbcfZFJP+8/lKio4/2Oljw4YnVuejjvP31IdPIYXoc8P6ayT84x7z/y5x+YK0eAPN184mVFK+8/XghxP3u4lryBY/Xh3yTvPzGrCW3h94I84d4f9Z0e7z/6v28amyE9vJDZ2tB/GO8/tAoMcoI3izwLA+SmhRLvP4/LzomSFG48Vi8+qa8M7z+2q7BNdU2DPBW3MQr+Bu8/THSs4gFChjwx2Ez8cAHvP0r401053Y88/xZksgj87j8EW447gKOGvPGfkl/F9u4/aFBLzO1KkrzLqTo3p/HuP44tURv4B5m8ZtgFba7s7j/SNpQ+6NFxvPef5TTb5+4/FRvOsxkZmbzlqBPDLePuP21MKqdIn4U8IjQSTKbe7j+KaSh6YBKTvByArARF2u4/W4kXSI+nWLwqLvchCtbuPxuaSWebLHy8l6hQ2fXR7j8RrMJg7WNDPC2JYWAIzu4/72QGOwlmljxXAB3tQcruP3kDodrhzG480DzBtaLG7j8wEg8/jv+TPN7T1/Aqw+4/sK96u86QdjwnKjbV2r/uP3fgVOu9HZM8Dd39mbK87j+Oo3EANJSPvKcsnXayue4/SaOT3Mzeh7xCZs+i2rbuP184D73G3ni8gk+dViu07j/2XHvsRhKGvA+SXcqkse4/jtf9GAU1kzzaJ7U2R6/uPwWbii+3mHs8/ceX1BKt7j8JVBzi4WOQPClUSN0Hq+4/6sYZUIXHNDy3RlmKJqnuPzXAZCvmMpQ8SCGtFW+n7j+fdplhSuSMvAncdrnhpe4/qE3vO8UzjLyFVTqwfqTuP67pK4l4U4S8IMPMNEaj7j9YWFZ43c6TvCUiVYI4ou4/ZBl+gKoQVzxzqUzUVaHuPygiXr/vs5O8zTt/Zp6g7j+CuTSHrRJqvL/aC3USoO4/7qltuO9nY7wvGmU8sp/uP1GI4FQ93IC8hJRR+X2f7j/PPlp+ZB94vHRf7Oh1n+4/sH2LwEruhrx0gaVImp/uP4rmVR4yGYa8yWdCVuuf7j/T1Aley5yQPD9d3k9poO4/HaVNudwye7yHAetzFKHuP2vAZ1T97JQ8MsEwAe2h7j9VbNar4etlPGJOzzbzou4/Qs+zL8WhiLwSGj5UJ6TuPzQ3O/G2aZO8E85MmYml7j8e/xk6hF6AvK3HI0Yap+4/bldy2FDUlLztkkSb2ajuPwCKDltnrZA8mWaK2ceq7j+06vDBL7eNPNugKkLlrO4//+fFnGC2ZbyMRLUWMq/uP0Rf81mD9ns8NncVma6x7j+DPR6nHwmTvMb/kQtbtO4/KR5si7ipXbzlxc2wN7fuP1m5kHz5I2y8D1LIy0S67j+q+fQiQ0OSvFBO3p+Cve4/S45m12zKhby6B8pw8cDuPyfOkSv8r3E8kPCjgpHE7j+7cwrhNdJtPCMj4xljyO4/YyJiIgTFh7xl5V17ZszuP9Ux4uOGHIs8My1K7JvQ7j8Vu7zT0buRvF0lPrID1e4/0jHunDHMkDxYszATntnuP7Nac26EaYQ8v/15VWve7j+0nY6Xzd+CvHrz079r4+4/hzPLkncajDyt01qZn+juP/rZ0UqPe5C8ZraNKQfu7j+6rtxW2cNVvPsVT7ii8+4/QPamPQ6kkLw6WeWNcvnuPzSTrTj01mi8R1778nb/7j81ilhr4u6RvEoGoTCwBe8/zd1fCtf/dDzSwUuQHgzvP6yYkvr7vZG8CR7XW8IS7z+zDK8wrm5zPJxShd2bGe8/lP2fXDLjjjx60P9fqyDvP6xZCdGP4IQ8S9FXLvEn7z9nGk44r81jPLXnBpRtL+8/aBmSbCxrZzxpkO/cIDfvP9K1zIMYioC8+sNdVQs/7z9v+v8/Xa2PvHyJB0otR+8/Sal1OK4NkLzyiQ0Ih0/vP6cHPaaFo3Q8h6T73BhY7z8PIkAgnpGCvJiDyRbjYO8/rJLB1VBajjyFMtsD5mnvP0trAaxZOoQ8YLQB8yFz7z8fPrQHIdWCvF+bezOXfO8/yQ1HO7kqibwpofUURobvP9OIOmAEtnQ89j+L5y6Q7z9xcp1R7MWDPINMx/tRmu8/8JHTjxL3j7zakKSir6TvP310I+KYro288WeOLUiv7z8IIKpBvMOOPCdaYe4buu8/Muupw5QrhDyXums3K8XvP+6F0TGpZIo8QEVuW3bQ7z/t4zvkujeOvBS+nK392+8/nc2RTTuJdzzYkJ6BwefvP4nMYEHBBVM88XGPK8Lz7z8AOPr+Qi7mPzBnx5NX8y49AAAAAAAA4L9gVVVVVVXlvwYAAAAAAOA/TlVZmZmZ6T96pClVVVXlv+lFSJtbSfK/wz8miysA8D8AAAAAAKD2PwBBmcIBCxfIufKCLNa/gFY3KCS0+jwAAAAAAID2PwBBucIBCxcIWL+90dW/IPfg2AilHL0AAAAAAGD2PwBB2cIBCxdYRRd3dtW/bVC21aRiI70AAAAAAED2PwBB+cIBCxf4LYetGtW/1WewnuSE5rwAAAAAACD2PwBBmcMBCxd4d5VfvtS/4D4pk2kbBL0AAAAAAAD2PwBBucMBCxdgHMKLYdS/zIRMSC/YEz0AAAAAAOD1PwBB2cMBCxeohoYwBNS/OguC7fNC3DwAAAAAAMD1PwBB+cMBCxdIaVVMptO/YJRRhsaxID0AAAAAAKD1PwBBmcQBCxeAmJrdR9O/koDF1E1ZJT0AAAAAAID1PwBBucQBCxcg4bri6NK/2Cu3mR57Jj0AAAAAAGD1PwBB2cQBCxeI3hNaidK/P7DPthTKFT0AAAAAAGD1PwBB+cQBCxeI3hNaidK/P7DPthTKFT0AAAAAAED1PwBBmcUBCxd4z/tBKdK/dtpTKCRaFr0AAAAAACD1PwBBucUBCxeYacGYyNG/BFTnaLyvH70AAAAAAAD1PwBB2cUBCxeoq6tcZ9G/8KiCM8YfHz0AAAAAAOD0PwBB+cUBCxdIrvmLBdG/ZloF/cSoJr0AAAAAAMD0PwBBmcYBCxeQc+Iko9C/DgP0fu5rDL0AAAAAAKD0PwBBucYBCxfQtJQlQNC/fy30nrg28LwAAAAAAKD0PwBB2cYBCxfQtJQlQNC/fy30nrg28LwAAAAAAID0PwBB+cYBCxdAXm0Yuc+/hzyZqypXDT0AAAAAAGD0PwBBmccBCxdg3Mut8M6/JK+GnLcmKz0AAAAAAED0PwBBuccBCxfwKm4HJ86/EP8/VE8vF70AAAAAACD0PwBB2ccBCxfAT2shXM2/G2jKu5G6IT0AAAAAAAD0PwBB+ccBCxegmsf3j8y/NISfaE95Jz0AAAAAAAD0PwBBmcgBCxegmsf3j8y/NISfaE95Jz0AAAAAAODzPwBBucgBCxeQLXSGwsu/j7eLMbBOGT0AAAAAAMDzPwBB2cgBCxfAgE7J88q/ZpDNP2NOujwAAAAAAKDzPwBB+cgBCxew4h+8I8q/6sFG3GSMJb0AAAAAAKDzPwBBmckBCxew4h+8I8q/6sFG3GSMJb0AAAAAAIDzPwBBuckBCxdQ9JxaUsm/49TBBNnRKr0AAAAAAGDzPwBB2ckBCxfQIGWgf8i/Cfrbf7+9Kz0AAAAAAEDzPwBB+ckBCxfgEAKJq8e/WEpTcpDbKz0AAAAAAEDzPwBBmcoBCxfgEAKJq8e/WEpTcpDbKz0AAAAAACDzPwBBucoBCxfQGecP1sa/ZuKyo2rkEL0AAAAAAADzPwBB2coBCxeQp3Aw/8W/OVAQn0OeHr0AAAAAAADzPwBB+coBCxeQp3Aw/8W/OVAQn0OeHr0AAAAAAODyPwBBmcsBCxewoePlJsW/j1sHkIveIL0AAAAAAMDyPwBBucsBCxeAy2wrTcS/PHg1YcEMFz0AAAAAAMDyPwBB2csBCxeAy2wrTcS/PHg1YcEMFz0AAAAAAKDyPwBB+csBCxeQHiD8ccO/OlQnTYZ48TwAAAAAAIDyPwBBmcwBCxfwH/hSlcK/CMRxFzCNJL0AAAAAAGDyPwBBucwBCxdgL9Uqt8G/lqMRGKSALr0AAAAAAGDyPwBB2cwBCxdgL9Uqt8G/lqMRGKSALr0AAAAAAEDyPwBB+cwBCxeQ0Hx+18C/9FvoiJZpCj0AAAAAAEDyPwBBmc0BCxeQ0Hx+18C/9FvoiJZpCj0AAAAAACDyPwBBuc0BCxfg2zGR7L+/8jOjXFR1Jb0AAAAAAADyPwBB2s0BCxYrbgcnvr88APAqLDQqPQAAAAAAAPI/AEH6zQELFituBye+vzwA8CosNCo9AAAAAADg8T8AQZnOAQsXwFuPVF68vwa+X1hXDB29AAAAAADA8T8AQbnOAQsX4Eo6bZK6v8iqW+g1OSU9AAAAAADA8T8AQdnOAQsX4Eo6bZK6v8iqW+g1OSU9AAAAAACg8T8AQfnOAQsXoDHWRcO4v2hWL00pfBM9AAAAAACg8T8AQZnPAQsXoDHWRcO4v2hWL00pfBM9AAAAAACA8T8AQbnPAQsXYOWK0vC2v9pzM8k3lya9AAAAAABg8T8AQdnPAQsXIAY/Bxu1v1dexmFbAh89AAAAAABg8T8AQfnPAQsXIAY/Bxu1v1dexmFbAh89AAAAAABA8T8AQZnQAQsX4BuW10Gzv98T+czaXiw9AAAAAABA8T8AQbnQAQsX4BuW10Gzv98T+czaXiw9AAAAAAAg8T8AQdnQAQsXgKPuNmWxvwmjj3ZefBQ9AAAAAAAA8T8AQfnQAQsXgBHAMAqvv5GONoOeWS09AAAAAAAA8T8AQZnRAQsXgBHAMAqvv5GONoOeWS09AAAAAADg8D8AQbnRAQsXgBlx3UKrv0xw1uV6ghw9AAAAAADg8D8AQdnRAQsXgBlx3UKrv0xw1uV6ghw9AAAAAADA8D8AQfnRAQsXwDL2WHSnv+6h8jRG/Cy9AAAAAADA8D8AQZnSAQsXwDL2WHSnv+6h8jRG/Cy9AAAAAACg8D8AQbnSAQsXwP65h56jv6r+JvW3AvU8AAAAAACg8D8AQdnSAQsXwP65h56jv6r+JvW3AvU8AAAAAACA8D8AQfrSAQsWeA6bgp+/5Al+fCaAKb0AAAAAAIDwPwBBmtMBCxZ4DpuCn7/kCX58JoApvQAAAAAAYPA/AEG50wELF4DVBxu5l785pvqTVI0ovQAAAAAAQPA/AEHa0wELFvywqMCPv5ym0/Z8Ht+8AAAAAABA8D8AQfrTAQsW/LCowI+/nKbT9nwe37wAAAAAACDwPwBBmtQBCxYQayrgf7/kQNoNP+IZvQAAAAAAIPA/AEG61AELFhBrKuB/v+RA2g0/4hm9AAAAAAAA8D8AQe7UAQsC8D8AQY3VAQsDwO8/AEGa1QELFol1FRCAP+grnZlrxxC9AAAAAACA7z8AQbnVAQsXgJNYViCQP9L34gZb3CO9AAAAAABA7z8AQdrVAQsWySglSZg/NAxaMrqgKr0AAAAAAADvPwBB+dUBCxdA54ldQaA/U9fxXMARAT0AAAAAAMDuPwBBmtYBCxYu1K5mpD8o/b11cxYsvQAAAAAAgO4/AEG51gELF8CfFKqUqD99JlrQlXkZvQAAAAAAQO4/AEHZ1gELF8DdzXPLrD8HKNhH8mgavQAAAAAAIO4/AEH51gELF8AGwDHqrj97O8lPPhEOvQAAAAAA4O0/AEGZ1wELF2BG0TuXsT+bng1WXTIlvQAAAAAAoO0/AEG51wELF+DRp/W9sz/XTtulXsgsPQAAAAAAYO0/AEHZ1wELF6CXTVrptT8eHV08BmksvQAAAAAAQO0/AEH51wELF8DqCtMAtz8y7Z2pjR7sPAAAAAAAAO0/AEGZ2AELF0BZXV4zuT/aR706XBEjPQAAAAAAwOw/AEG52AELF2Ctjchquz/laPcrgJATvQAAAAAAoOw/AEHZ2AELF0C8AViIvD/TrFrG0UYmPQAAAAAAYOw/AEH52AELFyAKgznHvj/gReavaMAtvQAAAAAAQOw/AEGZ2QELF+DbOZHovz/9CqFP1jQlvQAAAAAAAOw/AEG52QELF+Ango4XwT/yBy3OeO8hPQAAAAAA4Os/AEHZ2QELF/AjfiuqwT80mThEjqcsPQAAAAAAoOs/AEH52QELF4CGDGHRwj+htIHLbJ0DPQAAAAAAgOs/AEGZ2gELF5AVsPxlwz+JcksjqC/GPAAAAAAAQOs/AEG52gELF7Azgz2RxD94tv1UeYMlPQAAAAAAIOs/AEHZ2gELF7Ch5OUnxT/HfWnl6DMmPQAAAAAA4Oo/AEH52gELFxCMvk5Xxj94Ljwsi88ZPQAAAAAAwOo/AEGZ2wELF3B1ixLwxj/hIZzljRElvQAAAAAAoOo/AEG52wELF1BEhY2Jxz8FQ5FwEGYcvQAAAAAAYOo/AEHa2wELFjnrr77IP9Es6apUPQe9AAAAAABA6j8AQfrbAQsW99xaWsk/b/+gWCjyBz0AAAAAAADqPwBBmdwBCxfgijztk8o/aSFWUENyKL0AAAAAAODpPwBBudwBCxfQW1fYMcs/quGsTo01DL0AAAAAAMDpPwBB2dwBCxfgOziH0Ms/thJUWcRLLb0AAAAAAKDpPwBB+dwBCxcQ8Mb7b8w/0iuWxXLs8bwAAAAAAGDpPwBBmd0BCxeQ1LA9sc0/NbAV9yr/Kr0AAAAAAEDpPwBBud0BCxcQ5/8OU84/MPRBYCcSwjwAAAAAACDpPwBB2t0BCxbd5K31zj8RjrtlFSHKvAAAAAAAAOk/AEH53QELF7CzbByZzz8w3wzK7MsbPQAAAAAAwOg/AEGZ3gELF1hNYDhx0D+RTu0W25z4PAAAAAAAoOg/AEG53gELF2BhZy3E0D/p6jwWixgnPQAAAAAAgOg/AEHZ3gELF+gngo4X0T8c8KVjDiEsvQAAAAAAYOg/AEH53gELF/isy1xr0T+BFqX3zZorPQAAAAAAQOg/AEGZ3wELF2haY5m/0T+3vUdR7aYsPQAAAAAAIOg/AEG53wELF7gObUUU0j/quka63ocKPQAAAAAA4Oc/AEHZ3wELF5DcfPC+0j/0BFBK+pwqPQAAAAAAwOc/AEH53wELF2DT4fEU0z+4PCHTeuIovQAAAAAAoOc/AEGZ4AELFxC+dmdr0z/Id/GwzW4RPQAAAAAAgOc/AEG54AELFzAzd1LC0z9cvQa2VDsYPQAAAAAAYOc/AEHZ4AELF+jVI7QZ1D+d4JDsNuQIPQAAAAAAQOc/AEH54AELF8hxwo1x1D911mcJzicvvQAAAAAAIOc/AEGZ4QELFzAXnuDJ1D+k2AobiSAuvQAAAAAAAOc/AEG54QELF6A4B64i1T9Zx2SBcL4uPQAAAAAA4OY/AEHZ4QELF9DIU/d71T/vQF3u7a0fPQAAAAAAwOY/AEH54QELSmBZ373V1T/cZaQIKgsKvQAAAAAccQAAqwEAAE4CAABPAgAANHYAAChxAAAUdwAATlN0M19fMjE3YmFkX2Z1bmN0aW9uX2NhbGxFAEHU4gELlA0CAAAAAwAAAAUAAAAHAAAACwAAAA0AAAARAAAAEwAAABcAAAAdAAAAHwAAACUAAAApAAAAKwAAAC8AAAA1AAAAOwAAAD0AAABDAAAARwAAAEkAAABPAAAAUwAAAFkAAABhAAAAZQAAAGcAAABrAAAAbQAAAHEAAAB/AAAAgwAAAIkAAACLAAAAlQAAAJcAAACdAAAAowAAAKcAAACtAAAAswAAALUAAAC/AAAAwQAAAMUAAADHAAAA0wAAAAEAAAALAAAADQAAABEAAAATAAAAFwAAAB0AAAAfAAAAJQAAACkAAAArAAAALwAAADUAAAA7AAAAPQAAAEMAAABHAAAASQAAAE8AAABTAAAAWQAAAGEAAABlAAAAZwAAAGsAAABtAAAAcQAAAHkAAAB/AAAAgwAAAIkAAACLAAAAjwAAAJUAAACXAAAAnQAAAKMAAACnAAAAqQAAAK0AAACzAAAAtQAAALsAAAC/AAAAwQAAAMUAAADHAAAA0QAAAAx2AADYcgAATlN0M19fMjE0X19zaGFyZWRfY291bnRFAAAAAJB2AAAMcwAAAAAAAAEAAADQcgAAAAAAAE5TdDNfXzIxOV9fc2hhcmVkX3dlYWtfY291bnRFAAAAAAAAAEBzAAC9AQAAUAIAAFECAAA0dgAATHMAABR3AABOU3QzX18yMTJiYWRfd2Vha19wdHJFAAA0dgAAcHMAANR3AABOMTBfX2N4eGFiaXYxMTZfX3NoaW1fdHlwZV9pbmZvRQAAAAA0dgAAoHMAAGRzAABOMTBfX2N4eGFiaXYxMTdfX2NsYXNzX3R5cGVfaW5mb0UAAAA0dgAA0HMAAGRzAABOMTBfX2N4eGFiaXYxMTdfX3BiYXNlX3R5cGVfaW5mb0UAAAA0dgAAAHQAAMRzAABOMTBfX2N4eGFiaXYxMTlfX3BvaW50ZXJfdHlwZV9pbmZvRQA0dgAAMHQAAGRzAABOMTBfX2N4eGFiaXYxMjBfX2Z1bmN0aW9uX3R5cGVfaW5mb0UAAAAANHYAAGR0AADEcwAATjEwX19jeHhhYml2MTI5X19wb2ludGVyX3RvX21lbWJlcl90eXBlX2luZm9FAAAAAAAAALB0AABSAgAAUwIAAFQCAABVAgAAVgIAADR2AAC8dAAAZHMAAE4xMF9fY3h4YWJpdjEyM19fZnVuZGFtZW50YWxfdHlwZV9pbmZvRQCcdAAA7HQAAHYARG4AAAAAnHQAAPx0AABiAAAAnHQAAAh1AABjAAAAnHQAABR1AABoAAAAnHQAACB1AABhAAAAnHQAACx1AABzAAAAnHQAADh1AAB0AAAAnHQAAER1AABpAAAAnHQAAFB1AABqAAAAnHQAAFx1AABsAAAAnHQAAGh1AABtAAAAnHQAAHR1AAB4AAAAnHQAAIB1AAB5AAAAnHQAAIx1AABmAAAAnHQAAJh1AABkAAAAAAAAACR0AABSAgAAVwIAAFQCAABVAgAAWAIAAAAAAADUdQAAUgIAAFkCAABUAgAAVQIAAFoCAAA0dgAA4HUAAGRzAABOMTBfX2N4eGFiaXYxMTZfX2VudW1fdHlwZV9pbmZvRQAAAAAAAAAAlHMAAFICAABbAgAAVAIAAFUCAABcAgAAXQIAAF4CAABfAgAAAAAAAFR2AABSAgAAYAIAAFQCAABVAgAAXAIAAGECAABiAgAAYwIAADR2AABgdgAAlHMAAE4xMF9fY3h4YWJpdjEyMF9fc2lfY2xhc3NfdHlwZV9pbmZvRQAAAAAAAAAAsHYAAFICAABkAgAAVAIAAFUCAABcAgAAZQIAAGYCAABnAgAANHYAALx2AACUcwAATjEwX19jeHhhYml2MTIxX192bWlfY2xhc3NfdHlwZV9pbmZvRQAAAAAAAAD0cwAAUgIAAGgCAABUAgAAVQIAAGkCAAAAAAAASHcAAG0BAABqAgAAawIAAAx2AAAcdwAAU3Q5ZXhjZXB0aW9uAAAAADR2AAA4dwAAFHcAAFN0OWJhZF9hbGxvYwAAAAA0dgAAVHcAACx3AABTdDIwYmFkX2FycmF5X25ld19sZW5ndGgAAAAAAAAAAIR3AABuAQAAbAIAAG0CAAA0dgAAkHcAABR3AABTdDExbG9naWNfZXJyb3IAAAAAALR3AABuAQAAbgIAAG0CAAA0dgAAwHcAAIR3AABTdDEybGVuZ3RoX2Vycm9yAAAAAAx2AADcdwAAU3Q5dHlwZV9pbmZvAEHw7wELtgEMdgAAUxIAAAx2AAB2EgAADHYAAJkSAAAMdgAAvBIAAMB1AADfEgAAwHUAAPoSAADAdQAAHRMAAAx2AABAEwAADHYAAF8TAAAMdgAAfRMAAAx2AACsEwAADHYAAN8TAADsdgAA/RMAAAAAAABIeAAA7HYAABwUAAABAAAASHgAAFB4AADkdAAAUHgAAPR0AABgeAAAkHUAAGB4AACYeAAASHgAAKB4AAAMdgAAUxQAAAx2AABoFABBsPEBCxaYeAAASHgAAKB4AADAeAAADHYAAIAUAEHQ8QELsgOYeAAASHgAAGB1AAAweAAAkHUAAJB1AACQdQAAkHYAAMsUAAAAAAAAAwAAABR5AAAAAAAAWHkAAAAAAABgeQAAAAAAADR2AADxFAAAIHkAADR2AAAvFQAALHkAADR2AABtFQAAOHkAADR2AACkFQAARHkAADR2AADbFQAAUHkAAAx2AAAVFgAADHYAAFAWAAAMdgAAdxYAAAx2AACgFgAA7HYAANcWAAAAAAAAaHkAAOx2AAAPFwAAAQAAAGh5AABweQAA5HQAAGh5AABAeAAA5HQAAGh5AABIdQAAQHgAAEh1AABoeQAAoHgAAEB4AADseAAAaHkAAEh1AAAAAAAA9HQAAGh5AABIdQAAQHgAAJB2AABrFwAAAAAAAAMAAAAIegAAAAAAAFh5AAAAAAAAYHkAAAAAAAA0dgAAkxcAABR6AAA0dgAA0xcAACB6AAA0dgAAExgAACx6AAA0dgAATBgAADh6AAA0dgAAhRgAAER6AAAMdgAAwRgAAAx2AAD+GAAA7HYAADcZAAAAAAAATHoAAOx2AABxGQAAAQAAAEx6AABUegAA5HQAAEx6AAD4dwBBkPUBC+IB5HQAAEx6AABIdQAA+HcAAEh1AABMegAAoHgAAPh3AADgeQAATHoAAEh1AAAAAAAA9HQAAEx6AABIdQAA+HcAAJB2AADPGQAAAAAAAAMAAAD4egAAAAAAAFh5AAAAAAAAYHkAAAAAAAA0dgAA9xkAAAR7AAA0dgAANxoAABB7AAA0dgAAdxoAABx7AAA0dgAAsBoAACh7AAA0dgAA6RoAADR7AAAMdgAAJRsAAAx2AABiGwAA7HYAAJsbAAAAAAAAPHsAAOx2AADVGwAAAQAAADx7AABEewAA5HQAADx7AAAAeABBgPcBC+IB5HQAADx7AABIdQAAAHgAAEh1AAA8ewAAoHgAAAB4AADQegAAPHsAAEh1AAAAAAAA9HQAADx7AABIdQAAAHgAAJB2AAAzHAAAAAAAAAMAAADoewAAAAAAAFh5AAAAAAAAYHkAAAAAAAA0dgAAWxwAAPR7AAA0dgAAmxwAAAB8AAA0dgAA2xwAAAx8AAA0dgAAFB0AABh8AAA0dgAATR0AACR8AAAMdgAAiR0AAAx2AADGHQAA7HYAAP8dAAAAAAAALHwAAOx2AAA5HgAAAQAAACx8AAA0fAAA5HQAACx8AADwdwBB8PgBC+IB5HQAACx8AABIdQAA8HcAAEh1AAAsfAAAoHgAAPB3AADAewAALHwAAEh1AAAAAAAA9HQAACx8AABIdQAA8HcAAJB2AACXHgAAAAAAAAMAAADYfAAAAAAAAFh5AAAAAAAAYHkAAAAAAAA0dgAA3x4AAOR8AAA0dgAAPx8AAPB8AAA0dgAAnx8AAPx8AAA0dgAA+B8AAAh9AAA0dgAAUSAAABR9AAAMdgAArSAAAAx2AAAKIQAA7HYAAFQhAAAAAAAAHH0AAOx2AACfIQAAAQAAABx9AAAkfQAA5HQAABx9AAAsfABB4PoBC+IB5HQAABx9AABIdQAALHwAAEh1AAAcfQAAoHgAACx8AACwfAAAHH0AAEh1AAAAAAAA9HQAABx9AABIdQAALHwAAJB2AAAOIgAAAAAAAAMAAADIfQAAAAAAAFh5AAAAAAAAYHkAAAAAAAA0dgAAIyIAANR9AAA0dgAAUCIAAOB9AAA0dgAAfSIAAOx9AAA0dgAAoyIAAPh9AAA0dgAAySIAAAR+AAAMdgAA8iIAAAx2AAAcIwAA7HYAAEAjAAAAAAAADH4AAOx2AABlIwAAAQAAAAx+AAAUfgAA5HQAAAx+AACQdQBB0PwBC9ID5HQAAAx+AABIdQAAkHUAAEh1AAAMfgAAoHgAAJB1AACgfQAADH4AAEh1AAAAAAAA9HQAAAx+AABIdQAAkHUAAJB2AACuIwAAAAAAAAMAAAC4fgAAAAAAAFh5AAAAAAAAYHkAAAAAAAA0dgAA2yMAAMR+AAA0dgAAICQAANB+AAA0dgAAZSQAANx+AAA0dgAAoyQAAOh+AAA0dgAA4SQAAPR+AAAMdgAAIiUAAAx2AABkJQAADHYAAH4lAADsdgAAvCUAAAAAAAAEfwAA7HYAAPslAAABAAAABH8AAAx/AADkdAAABH8AAPx+AAAAAAAA5HQAAAR/AABIdQAA/H4AAEh1AAAEfwAAoHgAAPx+AACQfgAABH8AAEh1AAAAAAAA9HQAAAR/AABIdQAA/H4AAJB2AABeJgAAAAAAAAMAAACofwAAAAAAAFh5AAAAAAAAYHkAAAAAAAA0dgAAhiYAALR/AAA0dgAAxiYAAMB/AAA0dgAABicAAMx/AAA0dgAAPycAANh/AAA0dgAAeCcAAOR/AAAMdgAAtCcAAAx2AADxJwAA7HYAACooAAAAAAAA7H8AAOx2AABkKAAAAQAAAOx/AAD0fwAA5HQAAOx/AACYeABBsIACC8ID5HQAAOx/AABIdQAAmHgAAEh1AADsfwAAoHgAAJh4AACAfwAA7H8AAEh1AAAAAAAA9HQAAOx/AABIdQAAmHgAAJB2AADCKAAAAAAAAAMAAACYgAAAAAAAAFh5AAAAAAAAYHkAAAAAAAA0dgAA7SgAAKSAAAA0dgAAMCkAALCAAAA0dgAAcykAALyAAAA0dgAArykAAMiAAAA0dgAA6ykAANSAAAAMdgAAKioAAOx2AABqKgAAAAAAAMB4AADsdgAApyoAAAEAAADAeAAA3IAAAOR0AADAeAAAOHgAAAAAAADkdAAAwHgAAEh1AAA4eAAASHUAAMB4AACgeAAAOHgAAHCAAADAeAAASHUAAAAAAAD0dAAAwHgAAEh1AAA4eAAAkHYAAAgrAAAAAAAAAwAAAHiBAAAAAAAAWHkAAAAAAABgeQAAAAAAADR2AAAwKwAAhIEAADR2AABwKwAAkIEAADR2AACwKwAAnIEAADR2AADpKwAAqIEAADR2AAAiLAAAtIEAAAx2AABeLAAADHYAAJssAADsdgAA1CwAAAAAAAC8gQAA7HYAAA4tAAABAAAAvIEAAMSBAADkdAAAvIEAAAh4AEGAhAILpgTkdAAAvIEAAEh1AAAIeAAASHUAALyBAACgeAAACHgAAFCBAAC8gQAASHUAAAAAAAD0dAAAvIEAAEh1AAAIeAAA7HYAAGwtAAAAAAAA/H4AAOx2AACHLQAAAQAAAPx+AAD8fgAAHH0AADx1AAD8fgAA/H4AAPx+AAD8fgAA/H4AAGB1AAD8fgAA/H4AAKB4AAD8fgAAUIIAAPB3AAD8fgAAUIIAAJB1AAAEfwAAUIIAAPR0AABQggAAkHUAAFCCAABgdQAAUIIAACh4AABQggAA/H4AAPx+AACQdQAAPHUAAJB1AACQdQAAHH0AAFCCAAD8fgAAUIIAAPx+AADwdwAA9HQAAPx+AACQdQAAPHUAAPx+AAAEfwAA5HQAACx8AAD8fgAA/H4AACx8AADsdgAAAi4AAAAAAACYeAAA7HYAABguAAABAAAAmHgAAJh4AACgeAAAmHgAAJh4AACYeAAA7H8AAJh4AACYeAAAAAAAAOx/AACYeAAAAHgAAJB1AACYeAAAPIMAAAB4AACQdQAAmHgAADyDAACYeAAAHH0AADyDAACQdQAAHH0AADyDAACYeAAAPIMAAKB4AACYeAAAPHUAAJh4AAA8gwAAPHUAAJh4AAA8gwAAkHUAAAAAAACYeAAAPIMAAJB1AACQdQAAmHgAAJh4AABgdQAAAAAAAJh4AACYeAAAPHUAAGB1AACYeAAAmHgAAKB4AACYeAAAPIMAAAB4AEGwiAIL4gGYeAAAPIMAAJB1AACQdQAAkHUAAOx/AAA8gwAA9HQAADyDAABchAAAmHgAAAx2AACaLgAAmHgAADyDAABIeAAAYHUAADyDAAAweAAAPIMAAJB1AAA8gwAAPHUAADyDAACQdQAAPIMAAJh4AACQdQAAaHkAAJh4AAAAeAAAAHgAAJh4AAA8gwAAPHUAADx1AACYeAAAPIMAADx1AACQdQAAmHgAAAB4AAD0dAAAAAAAAJh4AACQdQAAkHUAAJB1AAA8dQAA9HQAAJh4AACQdQAAPHUAAJh4AACYeAAAoHgAAMB4AEGgigILFph4AAAcfQAAkHUAADx1AACQdQAA8HcAQcCKAguaC0x6AAAcfQAAkHUAAPR0AACYeAAAHH0AADx1AACQdQAAmHgAAGB1AAAweAAAkHUAAJB1AACQdQAAoHgAAKB4AABIdQAASHUAAJh4AADsfwAA5HQAADx7AACYeAAAmHgAADx7AADkdAAAkHUAAOR0AAA8dQAAPHUAAJB1AADkdAAAoHgAAEh1AACgeAAA0IUAAAx2AABkLwAAoHgAAKB4AADkhQAADHYAAIMvAACgeAAA9IUAAAx2AACiLwAAoHgAAIR1AAA8dQAAoHgAAGB1AACgeAAAhHUAAKB4AACgeAAA9HQAAKB4AAAshgAADHYAAMEvAAAAAAAAYIYAAHABAABxAQAAcgEAAHMBAAB0AQAAdQEAAHYBAAB3AQAAeAEAADR2AADgLwAAbIYAAAx2AAAaMAAA7HYAAFAwAAAAAAAAhIYAAKR1AABqMAAAAAAAALiGAAB5AQAAegEAAHsBAAB8AQAAfQEAAH4BAAB/AQAAgAEAAIEBAAA0dgAAgzAAAMSGAAAMdgAAvTAAAOx2AADzMAAAAAAAANyGAACkdQAADTEAAAAAAAAQhwAAggEAAIMBAACEAQAAhQEAAIYBAACHAQAAiAEAAIkBAACKAQAANHYAACYxAAAchwAADHYAAJkxAAAMdgAA4zEAAAAAAABYhwAAiwEAAIwBAACNAQAAjgEAAI8BAACQAQAAkQEAAJIBAACTAQAANHYAABMyAABkhwAADHYAAFEyAADsdgAAizIAAAAAAAB8hwAApHUAAKkyAAAAAAAAsIcAAJQBAACVAQAAlgEAAJcBAACYAQAAmQEAAJoBAACbAQAAnAEAADR2AADGMgAAvIcAAAx2AAAEMwAA7HYAADkzAAAAAAAA1IcAAKR1AABUMwAADgcAACUEAACHCwAAkwYAAKIIAABDBgAA/wUAAKUGAAC4CAAAjggAAM0IAAC0BwAAqwoAAI0FAACiCwAAAAAAADSIAACdAQAAngEAAJ8BAACgAQAAoQEAADR2AABuMwAA9HIAAAAAAABsiAAAogEAAKMBAACkAQAApQEAAKYBAACnAQAAqAEAAKkBAACqAQAANHYAALwzAAB4iAAADHYAACM0AAAMdgAAZzQAAAAAAAC0iAAArAEAAK0BAACuAQAArwEAALABAACxAQAAsgEAALMBAAC0AQAANHYAAJg0AADAiAAADHYAANk1AAAMdgAA+zUAAAAAAAD8iAAArAEAALUBAAC2AQAAtwEAALgBAAC5AQAAugEAALsBAAC8AQAANHYAACM3AADAiAAADHYAAGQ4AAAAAAAAaIkAAL4BAAC/AQAAwAEAAMEBAADCAQAAAAAAAHSJAADDAQAAxAEAAMUBAADGAQAAxwEAAJB2AAClOQAAAAAAAAEAAABgiQAAAgQAAAx2AAC5OQAANHYAAPA5AABIiQAANHYAAAk6AABIiQAAAAAAAJyJAADIAQAAyQEAAMoBAACgAQAAywEAADR2AAAfOgAA9HIAAAAAAADEiQAAzAEAAM0BAADOAQAAoAEAAM8BAAA0dgAAbToAAPRyAAAAAAAA7IkAANABAADRAQAA0gEAAKABAADTAQAANHYAALY6AAD0cgAAAAAAABSKAADUAQAA1QEAANYBAACgAQAA1wEAADR2AAAEOwAA9HIAAAAAAAA8igAA2AEAANkBAADaAQAAoAEAANsBAAA0dgAAUDsAAPRyAAAAAAAAZIoAANwBAADdAQAA3gEAAKABAADfAQAANHYAAMA7AAD0cgAAAAAAAIyKAADgAQAA4QEAAOIBAACgAQAA4wEAADR2AAAYPAAA9HIAAAEAAAAAAAAAyIoAAIIBAADkAQAA5QEAAOYBAADnAQAA6AEAAOkBAADqAQAA6wEAADR2AABcPwAAHIcAAAx2AADaPwBB5pUCCw8kQAAAAAAAAPA/AAABAAEAQYCWAgvDBhiLAADsAQAA7QEAAO4BAACgAQAA7wEAADR2AABwQAAA9HIAAAAAAABQiwAAogEAAPABAADxAQAA8gEAAPMBAAD0AQAA9QEAAPYBAAD3AQAANHYAAK5AAAB4iAAADHYAABVBAAAAAAAAkIsAAKIBAAD4AQAA+QEAAPoBAAD7AQAA/AEAAP0BAAD+AQAA/wEAADR2AAA5QQAAeIgAAAx2AACpQQAAAAAAANCLAACiAQAAAAIAAAECAAACAgAAAwIAAAQCAAAFAgAABgIAAAcCAAA0dgAA1kEAAHiIAAAMdgAASUIAAAAAAAAAjAAACAIAAAkCAAAKAgAACwIAAAwCAAA0dgAAeUIAAPRyAAAAAAAAOIwAAA0CAAAOAgAADwIAABACAAARAgAAEgIAABMCAAAUAgAAFQIAADR2AADgRQAARIwAAAx2AABMRgAADHYAAJ9GAAAAAAAAgIwAABYCAAAXAgAAGAIAABkCAAAaAgAAGwIAABwCAAAdAgAAHgIAADR2AADNRgAAjIwAAAx2AABARwAADHYAAJpHAAAAAAAAyIwAAB8CAAAgAgAAIQIAACICAAAjAgAAJAIAACUCAAAmAgAAJwIAADR2AADIRwAA1IwAAAx2AABVSAAADHYAALpIAAAAAAAAEI0AACgCAAApAgAAKgIAACsCAAAsAgAALQIAAC4CAAAvAgAAMAIAADR2AAD4SAAAHI0AAAx2AACSSQAADHYAAP5JAAAAAAAASI0AADUCAAA2AgAANwIAAKABAAA4AgAANHYAAKBKAAD0cgAANHYAAOlKAAAUdwAAAAAAAFSNAAAzAgAAOQIAADoCAAAAAAAAhI0AADsCAAA8AgAANHYAAAxLAAAYjgAAAAAAAKyNAAA9AgAAPgIAAD8CAABAAgAAQQIAADR2AAAlSwAAuI0AAAx2AAA/SwAAAAAAAOyNAABCAgAAQwIAAEQCAABFAgAARgIAAEcCAABIAgAASQIAAEoCAAA0dgAAWEsAAPiNAAAMdgAA10sAAAx2AAAhTAAAAAAAABiOAAA7AgAATAIAAAx2AAByTAAAAAAAADCOAAA7AgAATQIAADR2AACPTAAAGI4AAAAgAACwlQEAQdCcAgt+oJIAALiSAADQkgAA6JIAAACTAAAYkwAAMJMAAEiTAABgkwAAeJMAAJCTAACokwAAwJMAANiTAADwkwAACJQAACCUAAA4lAAAUJQAAGiUAACAlAAAmJQAALCUAADIlAAA4JQAAPiUAAAQlQAAKJUAAECVAABYlQAAcJUAAIiV";var l6e=null,iet=null,_cn=null;var YIr=()=>{let e=globalThis.atob(mcn),t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t},GIr=async()=>{let e=Boolean(globalThis.process?.versions?.node&&globalThis.process?.type!=="renderer"),t=_cn?{locateFile:()=>_cn}:e?void 0:{locateFile:()=>"manifold.wasm",wasmBinary:YIr()},n=await pcn(t);return n.setup(),n},gcn=async()=>{if(l6e)return l6e;return iet??=GIr().then((e)=>(l6e=e,e)).catch((e)=>{throw iet=null,e}),iet},set=()=>l6e;yc();er();var Wm=1e6,ohe=(e)=>{let t=0;for(let n=0;n<e.length;n++){let o=e[n],r=e[(n+1)%e.length];t+=o.x*r.y-r.x*o.y}return t/2},UIr=(e)=>{let t=0,n={minX:Number.POSITIVE_INFINITY,minY:Number.POSITIVE_INFINITY,maxX:Number.NEGATIVE_INFINITY,maxY:Number.NEGATIVE_INFINITY};for(let o of e){t+=o.length;for(let[r,i]of o)n.minX=Math.min(n.minX,r),n.minY=Math.min(n.minY,i),n.maxX=Math.max(n.maxX,r),n.maxY=Math.max(n.maxY,i)}return{polygonCount:e.length,pointCount:t,bbox:t>0?n:null,scale:Wm}},WIr=(e,t)=>{if(!Number.isFinite(e.x)||!Number.isFinite(e.y))throw Error(`${t} received non-finite point (${e.x}, ${e.y})`)},Acn=(e,t)=>e.x===t.x&&e.y===t.y,AY=(e,t="normalizeRing")=>{let n=[];for(let r of e){WIr(r,t);let i={x:Math.round(r.x*Wm)/Wm,y:Math.round(r.y*Wm)/Wm},s=n[n.length-1];if(!s||!Acn(s,i))n.push(i)}if(n.length>1&&Acn(n[0],n[n.length-1]))n.pop();if(new Set(n.map((r)=>`${r.x},${r.y}`)).size<3||Math.abs(ohe(n))<0.000000000000000001)return[];return n},rhe=(e,t="toScaledManifoldPolygons")=>{let n=[];for(let o of e){let r=AY(o,t);if(r.length<3)continue;let i=ohe(r)<0?[...r].reverse():r;n.push(i.map((s)=>[Math.round(s.x*Wm),Math.round(s.y*Wm)]))}return n},Ccn=(e)=>e.map((t)=>AY(t.map(([n,o])=>({x:n/Wm,y:o/Wm})),"fromScaledManifoldPolygons")).filter((t)=>t.length>=3),fcn=(e,t)=>{let n=ohe(e);return t==="positive"&&n<0||t==="negative"&&n>0?[...e].reverse():e},ycn=(e)=>e.map((t)=>({x:t.x,y:t.y})),XIr=(e)=>{let t=[];for(let n of e){if(n.outerRing.length<3)continue;let o=fcn(n.outerRing,"negative"),r=n.innerRings.filter((i)=>i.length>=3).map((i)=>fcn(i,"positive"));t.push({outer_ring:{vertices:ycn(o)},inner_rings:r.map((i)=>({vertices:ycn(i)}))})}return t},bcn=async()=>{await gcn()},jIr=()=>Boolean(set()),ak=()=>{let e=set();if(!e)throw Error("Manifold geometry has not been initialized. Call initializeManifoldGeometry() before solving copper pours.");return e.CrossSection},MB=(e,t,n)=>{try{return n()}catch(o){let r=UIr(t),i=o instanceof Error?o.message:String(o);throw Error(`${e} failed: ${i}; details=${JSON.stringify(r)}`)}},KIr=0.00000001,het=()=>ak().square([0,0]),$Ir=(e,t="Positive")=>{let n=rhe([e],"crossSectionFromPolygon"),o=ak();if(n.length===0)return het();return MB("crossSectionFromPolygon",n,()=>o.ofPolygons(n,t))},gY=(e,t="Positive")=>{let n=rhe(e,"crossSectionFromPolygons"),o=ak();if(n.length===0)return het();return MB("crossSectionFromPolygons",n,()=>o.ofPolygons(n,t))},det=(e)=>{let t=e.filter((o)=>!o.isEmpty()),n=ak();if(t.length===0)return het();return MB("composeCrossSections",[],()=>n.compose(t))},the=(e,t,n="Miter")=>{let o=rhe([e],"offsetPolygon");if(o.length===0||t<=0)return o.length===0?[]:[AY(e)];let r=t*Wm,i=ak(),s=MB("offsetPolygon.input",o,()=>i.ofPolygons(o,"Positive")),a=MB("offsetPolygon.offset",o,()=>s.offset(r,n,2,32));return Ccn(a.toPolygons())},qIr=(e,t,n="Miter")=>{if(e.isEmpty()||t<=0)return e;let o=t*Wm,r=e.toPolygons();return MB("offsetCrossSection",r,()=>e.offset(o,n,2,32))},Icn=(e,t)=>{let n=det(t);if(e.isEmpty()||n.isEmpty())return e;return MB("subtractCrossSectionBlockers",[...e.toPolygons(),...n.toPolygons()],()=>e.subtract(n))},JIr=(e,t)=>{let n=$Ir(e),o=gY(t);if(n.isEmpty()||o.isEmpty())return n;let r=[...rhe([e],"subtractBlockersFromPour.pour"),...rhe(t,"subtractBlockersFromPour.blockers")];return MB("subtractBlockersFromPour",r,()=>n.subtract(o))},ZIr=(e,t=KIr)=>{if(e.isEmpty())return e;let n=t*Wm*Wm,o=e.decompose().filter((r)=>Math.abs(r.area())>=n);return det(o)},vcn=(e)=>{let t=[];for(let n of e.decompose()){let o=Ccn(n.toPolygons());if(o.length===0)continue;let r=o.reduce((s,a)=>Math.abs(ohe(a))>Math.abs(ohe(s))?a:s),i=o.filter((s)=>s!==r);t.push({outerRing:r,innerRings:i})}return t};function e9r(e){let{start:t,end:n,start_width:o,end_width:r}=e,i=n.x-t.x,s=n.y-t.y,a=Math.hypot(i,s);if(a===0||o<=0||r<=0)return[];let c=Math.abs(r-o),l=e.width_interpolation_mode==="linear"?1:Math.max(1,Math.ceil(Math.sqrt(c/0.008))),h=[],d=[];for(let u=0;u<=l;u++){let _=u/l,p=o<=r?_:1-_,m=e.width_interpolation_mode==="quadratic"?Math.min(o,r)+c*p*p:o+(r-o)*_,A=t.x+i*_,g=t.y+s*_;h.push({x:A-s/a*m/2,y:g+i/a*m/2}),d.push({x:A+s/a*m/2,y:g-i/a*m/2})}return[...d,...h.reverse()]}var nhe=(e,t,n=32)=>{let o=[];for(let r=0;r<n;r++){let i=r/n*2*Math.PI;o.push({x:e.x+t*Math.cos(i),y:e.y+t*Math.sin(i)})}return o},Scn=(e,t,n,o=0,r=32)=>{if(t<=0||n<=0)return[];let i=t/2,s=n/2,a=o*Math.PI/180,c=Math.cos(a),l=Math.sin(a),h=[];for(let d=0;d<r;d++){let u=d/r*2*Math.PI,_=i*Math.cos(u),p=s*Math.sin(u);h.push({x:e.x+_*c-p*l,y:e.y+_*l+p*c})}return h},aet=(e,t,n,o)=>[{x:e,y:t},{x:n,y:t},{x:n,y:o},{x:e,y:o}],Pcn=(e,t,n,o)=>{let r=t/2,i=n/2,s=o*Math.PI/180,a=Math.cos(s),c=Math.sin(s);return[{x:-r,y:-i},{x:r,y:-i},{x:r,y:i},{x:-r,y:i}].map((l)=>({x:e.x+l.x*a-l.y*c,y:e.y+l.x*c+l.y*a}))},cet=(e,t,n)=>{let o=Math.hypot(e.x-t.x,e.y-t.y);if(o===0)return[];let r=(e.x+t.x)/2,i=(e.y+t.y)/2,s=Math.atan2(t.y-e.y,t.x-e.x),a=Math.cos(s),c=Math.sin(s),l=o/2,h=n/2;return[{x:-l,y:-h},{x:l,y:-h},{x:l,y:h},{x:-l,y:h}].map((d)=>({x:r+d.x*a-d.y*c,y:i+d.x*c+d.y*a}))},Ecn=(e,t,n,o,r=0,i=32)=>{if(o<=0)return[];let s=n>=t,a=Math.max(t,n)-2*o,c=Math.max(0,a/2),h=(s?Math.PI/2:0)+r*Math.PI/180,d=Math.cos(h),u=Math.sin(h),_={x:e.x-c*d,y:e.y-c*u},p={x:e.x+c*d,y:e.y+c*u};if(c===0)return nhe(e,o,i);let m=[],A=Math.max(4,Math.floor(i/2));for(let g=0;g<=A;g++){let f=h-Math.PI/2+g/A*Math.PI;m.push({x:p.x+o*Math.cos(f),y:p.y+o*Math.sin(f)})}for(let g=0;g<=A;g++){let f=h+Math.PI/2+g/A*Math.PI;m.push({x:_.x+o*Math.cos(f),y:_.y+o*Math.sin(f)})}return m},t9r=(e)=>{if(e.shape==="rect")return{x:(e.bounds.minX+e.bounds.maxX)/2,y:(e.bounds.minY+e.bounds.maxY)/2};if(e.shape==="polygon"){let t=e.points.reduce((n,o)=>({minX:Math.min(n.minX,o.x),minY:Math.min(n.minY,o.y),maxX:Math.max(n.maxX,o.x),maxY:Math.max(n.maxY,o.y)}),{minX:Number.POSITIVE_INFINITY,minY:Number.POSITIVE_INFINITY,maxX:Number.NEGATIVE_INFINITY,maxY:Number.NEGATIVE_INFINITY});return{x:(t.minX+t.maxX)/2,y:(t.minY+t.maxY)/2}}return{x:e.x,y:e.y}},n9r=(e)=>{if(e.shape==="rotated_rect"||e.shape==="pill"||e.shape==="oval")return e.ccwRotation;return 0},xcn=(e,t)=>{if(e.shape==="circle")return[nhe({x:e.x,y:e.y},e.radius+t)];if(e.shape==="pill")return[Ecn({x:e.x,y:e.y},e.width+t*2,e.height+t*2,e.radius+t,e.ccwRotation)];if(e.shape==="oval"){let n=Scn({x:e.x,y:e.y},e.width,e.height,e.ccwRotation);return t>0?the(n,t,"Round"):[n]}if(e.shape==="rect")return[aet(e.bounds.minX-t,e.bounds.minY-t,e.bounds.maxX+t,e.bounds.maxY+t)];if(e.shape==="polygon"){let n=AY(e.points,"generateThermalReliefClearances.polygonPad");return t>0?the(n,t,"Round"):[n]}return[Pcn({x:e.x,y:e.y},e.width+t*2,e.height+t*2,e.ccwRotation)]},o9r=(e)=>e.shape==="circle"||e.shape==="oval"||e.shape==="pill"||e.shape==="polygon"||e.shape==="rect"||e.shape==="rotated_rect",r9r=(e,t,n,o=4)=>{if(!o9r(e)||t<=0)return[];if(typeof n!=="number"||!Number.isFinite(n)||n<=0)throw Error("thermal_relief_spoke_width must be greater than 0");if(!Number.isInteger(o)||o<1)throw Error("thermal_relief_spoke_count must be a positive integer");let r=xcn(e,0),i=xcn(e,t),s=t9r(e),a=Math.max(...i.flatMap((_)=>_).map((_)=>Math.hypot(_.x-s.x,_.y-s.y)))+n,c=n9r(e)*Math.PI/180,l=[];for(let _=0;_<o;_++){let p=c+_/o*Math.PI*2;l.push(cet(s,{x:s.x+Math.cos(p)*a,y:s.y+Math.sin(p)*a},n))}let h=gY(i),d=gY([...r,...l]),u=Icn(h,[d]);return vcn(u).map(({outerRing:_})=>_)},i9r=(e)=>e.shape==="rect",s9r=(e)=>e.shape==="rotated_rect",a9r=(e)=>e.shape==="trace",c9r=(e)=>e.shape==="circle",l9r=(e)=>e.shape==="pill",h9r=(e)=>e.shape==="oval",d9r=(e)=>e.shape==="polygon",Mcn=(e,t,n,o)=>{let r=[],{padMargin:i,traceMargin:s,board_edge_margin:a,cutoutMargin:c,use_thermal_reliefs:l,thermal_relief_spoke_width:h,thermal_relief_spoke_count:d}=n;if(o&&o.length>0&&a&&a>0){let _=AY(o,"processObstacles.boardOutline");for(let p=0;p<_.length;p++){let m=_[p===0?_.length-1:p-1],A=_[p],g=_[(p+1)%_.length];if(!m||!A||!g)continue;let f={x:A.x-m.x,y:A.y-m.y},y={x:g.x-A.x,y:g.y-A.y},x=f.x*y.y-f.y*y.x;if(r.push(nhe(A,a)),x<0)r.push(aet(A.x-a,A.y-a,A.x+a,A.y+a))}for(let p=0;p<_.length;p++){let m=_[p],A=_[(p+1)%_.length];if(!m||!A)continue;let g=cet(m,A,a*2);if(g.length>0)r.push(g)}}let u=r.length;for(let _ of e){if(_.connectivityKey===t){if((_.isPlatedHole||_.isSmtPad)&&l)r.push(...r9r(_,i,h,d));continue}let m=_.connectivityKey.startsWith("hole:")||_.connectivityKey.startsWith("cutout:"),A=_.connectivityKey.startsWith("keepout:"),g=(f)=>A?0:m?c??0:f;if(c9r(_)){let f=g(i);r.push(nhe({x:_.x,y:_.y},_.radius+f));continue}if(l9r(_)){let f=g(i);r.push(Ecn({x:_.x,y:_.y},_.width+f*2,_.height+f*2,_.radius+f,_.ccwRotation));continue}if(h9r(_)){let f=g(i),y=Scn({x:_.x,y:_.y},_.width,_.height,_.ccwRotation);r.push(...f>0?the(y,f,"Round"):[y]);continue}if(i9r(_)){let f=g(i),{bounds:y}=_;r.push(aet(y.minX-f,y.minY-f,y.maxX+f,y.maxY+f));continue}if(s9r(_)){let f=g(i);r.push(Pcn({x:_.x,y:_.y},_.width+f*2,_.height+f*2,_.ccwRotation));continue}if(d9r(_)){let f=g(i),y=new Set,x=_.points.filter((b)=>{let I=`${b.x},${b.y}`;if(y.has(I))return!1;return y.add(I),!0});if(x.length<3)continue;let C=AY(x,"processObstacles.polygonPad");if(C.length<3)continue;if(f<=0){r.push(C);continue}r.push(...the(C,f));continue}if(_.shape==="tapered_trace"){let f=e9r(_);if(f.length>=3)r.push(...s>0?the(f,s):[f]);continue}if(a9r(_)){for(let f of _.segments)r.push(nhe(f,_.width/2+s));for(let f=0;f<_.segments.length-1;f++){let y=_.segments[f],x=_.segments[f+1];if(!y||!x)continue;let C=cet(y,x,_.width+s*2);if(C.length>0)r.push(C)}}}return{polygonsToSubtract:r,obstaclePolygons:r.slice(u)}},wcn=(e,t,n)=>{let o=(e+t)*Math.SQRT1_2/Wm,r=(t-e)*Math.SQRT1_2/Wm;return`${Math.floor(o/n)},${Math.floor(r/n)}`},u9r=(e,t,n)=>{let o=new Map;for(let i of e.toPolygons()){let[s,a]=i[0],c=wcn(s,a,t),l=o.get(c)??[];l.push(i),o.set(c,l)}let r=[];for(let i of o.values()){let s=ak().ofPolygons(i,"Positive"),a=s.decompose();try{for(let c of a){if(c.area()<n**2*Wm**2)continue;let l=c.offset(-n/2*Wm,"Round");try{if(!l.isEmpty())r.push(...c.toPolygons())}finally{l.delete()}}}finally{for(let c of a)c.delete();s.delete()}}return r.length>0?ak().ofPolygons(r,"Positive"):ak().square([0,0])},p9r=({solidPour:e,hatchPitch:t=1,hatchWidth:n=0.25,padsForLayer:o,connectivityKey:r,obstaclePolygons:i,higherPriorityPourBlockers:s})=>{if(!Number.isFinite(t)||t<=0)throw Error("crosshatchPitch must be a finite positive distance in mm");if(!Number.isFinite(n)||n<=0||n>=t)throw Error("crosshatchWidth must be positive and less than crosshatchPitch");let a=(t-n)/2;if(e.isEmpty())return e;let c=e.toPolygons();return MB("applyCrosshatch",c,()=>{let l=e.offset(-n*Wm),{polygonsToSubtract:h}=Mcn(o.filter((A)=>A.connectivityKey===r),void 0,{padMargin:n,traceMargin:n}),d=gY(h),u=gY(i),_=det([u,...s]),p=_.offset(n*Wm,"Round"),m=d.add(p);u.delete(),_.delete(),p.delete(),d.delete();try{if(l.isEmpty())return e;let A=1/0,g=-1/0,f=1/0,y=-1/0;for(let L of l.toPolygons())for(let[H,V]of L){let O=(H+V)*Math.SQRT1_2/Wm,U=(V-H)*Math.SQRT1_2/Wm;A=Math.min(A,O),g=Math.max(g,O),f=Math.min(f,U),y=Math.max(y,U)}let x=Math.floor(A/t),C=Math.floor(g/t),b=Math.floor(f/t),I=Math.floor(y/t);if(![x,C,b,I].every(Number.isSafeInteger)||(C-x+1)*(I-b+1)>1e6)throw Error("Crosshatch exceeds 1,000,000 candidate cells; increase crosshatchPitch or reduce the pour area");let v=[];for(let L=x;L<=C;L++)for(let H=b;H<=I;H++){let V=(L+0.5)*t,O=(H+0.5)*t;v.push({key:`${L},${H}`,ring:[[V-a,O-a],[V+a,O-a],[V+a,O+a],[V-a,O+a]].map(([U,j])=>({x:(U-j)*Math.SQRT1_2,y:(U+j)*Math.SQRT1_2}))})}let P=gY(v.map(({ring:L})=>L)),M=P.intersect(m);P.delete();let B=new Set;for(let L of M.toPolygons()){let[H,V]=L[0];B.add(wcn(H,V,t))}M.delete();let T=gY(v.filter(({key:L})=>!B.has(L)).map(({ring:L})=>L)),N=T.intersect(l);T.delete();let D=u9r(N,t,n);N.delete();try{return e.subtract(D)}finally{D.delete()}}finally{l.delete(),m.delete()}})},m9r=(e)=>{let t=e.board_edge_margin??0;if(e.outline&&e.outline.length>0)return AY(e.outline,"getBoardPolygon.outline");let{bounds:n}=e,o={minX:n.minX+t,minY:n.minY+t,maxX:n.maxX-t,maxY:n.maxY-t};if(o.minX>=o.maxX||o.minY>=o.maxY)return[];return[{x:o.minX,y:o.minY},{x:o.maxX,y:o.minY},{x:o.maxX,y:o.maxY},{x:o.minX,y:o.maxY}]},u6e=class extends Rb{constructor(e){super(e);this.input=e}input;pipelineDef=[];getSolverName(){return"CopperPourPipelineSolver"}getOutput(){if(!jIr())throw Error("Manifold geometry has not been initialized. Call initializeManifoldGeometry() before solving copper pours.");let e=this.input.regionsForPour.map(()=>[]),t=[];for(let n=this.input.regionsForPour.length-1;n>=0;n--){let o=this.input.regionsForPour[n],r=m9r(o),i=this.input.pads.filter((p)=>p.layer===o.layer),{polygonsToSubtract:s,obstaclePolygons:a}=Mcn(i,o.connectivityKey,{padMargin:o.padMargin,traceMargin:o.traceMargin,board_edge_margin:o.board_edge_margin,cutoutMargin:o.cutout_margin,use_thermal_reliefs:o.use_thermal_reliefs,thermal_relief_spoke_width:o.thermal_relief_spoke_width,thermal_relief_spoke_count:o.thermal_relief_spoke_count},o.boardEdgeOutline??o.outline),c=o.pourMargin??Math.max(o.padMargin,o.traceMargin),l=t.filter((p)=>p.layer===o.layer&&p.connectivityKey!==o.connectivityKey).map((p)=>qIr(p.section,Math.max(c,p.pourMargin))),h=JIr(r,s),d=ZIr(Icn(h,l)),u=o.crosshatch?p9r({solidPour:d,hatchPitch:o.crosshatchPitch,hatchWidth:o.crosshatchWidth,padsForLayer:i,connectivityKey:o.connectivityKey,obstaclePolygons:a,higherPriorityPourBlockers:l}):d,_=vcn(u);e[n]=XIr(_),t.push({layer:o.layer,connectivityKey:o.connectivityKey,pourMargin:c,section:d})}return{brep_shapes:e.flat(),brep_shapes_by_region:e}}},_9r=(e)=>{let t=e.subcircuit_connectivity_map_key;return typeof t==="string"&&t.length>0?t:void 0},d6e=(e)=>{let t=e.subcircuit_id;return typeof t==="string"&&t.length>0?t:void 0},h6e=(e,t)=>e?`subcircuit:${e}:connectivity:${t}`:t,g9r=(e,t)=>{if(!t)return;let n={};for(let i of e){if(i.type!=="source_group")continue;let s=i.source_group_id,a=d6e(i);if(typeof s==="string"&&a)n[s]=a}let o=new Set([t]),r=!0;while(r){r=!1;for(let i of e){if(i.type!=="source_group")continue;let s=d6e(i);if(!s||o.has(s))continue;let{parent_subcircuit_id:a,parent_source_group_id:c}=i,l=typeof c==="string"?n[c]:void 0;if(typeof a==="string"&&o.has(a)||l&&o.has(l))o.add(s),r=!0}}return o},A9r=(e,t,n)=>{let o=g9r(e,n),r={},i={},s={},a=new Set;for(let h of e){let d=cO(h),u=_9r(h),_=d6e(h);if(d)i[d]=_;if(o&&(!_||!o.has(_)))continue;if(d&&u){let p=h6e(_,u);r[d]=p,a.add(u),s[p]??=[],s[p].push(d)}}let c={};for(let[h,d]of Object.entries(t.netMap)){let u=new Set(d.map((p)=>r[p]).filter((p)=>Boolean(p))),_=Array.from(u).sort()[0];if(_)c[h]=_}let l={};for(let[h,d]of Object.entries(s)){let u=new Set;for(let p of d){let m=t.getNetConnectedToId(p),A=m?c[m]:void 0;u.add(A??h)}if(u.size>1)throw Error(`subcircuit_connectivity_map_key "${h}" maps to multiple global connectivity keys: ${Array.from(u).join(", ")}`);let _=u.values().next().value;if(_)l[h]=_}return{knownSubcircuitConnectivityKeys:new Set([...Object.keys(s),...a]),descendantSubcircuitIds:o,getScopedSubcircuitConnectivityKey:h6e,getElementSubcircuitId:d6e,resolveSubcircuitConnectivityKey(h,d){let u=Object.keys(s).filter((p)=>p===h6e(d,h));if(d&&u.length===0&&o)u.push(...Object.keys(s).filter((p)=>p.endsWith(`:connectivity:${h}`)));if(!d)u.push(...Object.keys(s).filter((p)=>p.endsWith(`:connectivity:${h}`)));let _=Array.from(new Set(u));if(_.length===0){if(d&&o)throw Error(`No subcircuit_connectivity_map_key "${h}" found in subcircuit "${d}" or its child subcircuits.`);return h6e(d,h)}if(_.length>1)throw Error(`subcircuit_connectivity_map_key "${h}" exists in multiple subcircuits. Pass subcircuit_id to disambiguate.`);return l[_[0]]??_[0]},getSubcircuitConnectivityKeyForId(h){if(o){let _=i[h];if(!_||!o.has(_))return}let d=r[h],u=t.getNetConnectedToId(h);if(!u)return d?l[d]??d:void 0;return c[u]??(d?l[d]:void 0)??d}}},f9r=(e,t,n)=>{if(t.subcircuit_connectivity_map_key)return n.resolveSubcircuitConnectivityKey(t.subcircuit_connectivity_map_key,t.subcircuit_id);if(t.source_net_id){let o=e.find((r)=>r.type==="source_net"&&r.source_net_id===t.source_net_id);if(!o)throw Error(`No source_net found with id "${t.source_net_id}"`);if(!o.subcircuit_connectivity_map_key)throw Error(`source_net "${t.source_net_id}" has no subcircuit_connectivity_map_key`);return n.resolveSubcircuitConnectivityKey(o.subcircuit_connectivity_map_key,o.subcircuit_id??t.subcircuit_id)}if(t.source_net_name){let o=e.find((r)=>r.type==="source_net"&&r.name===t.source_net_name&&(!t.subcircuit_id||Boolean(n.descendantSubcircuitIds?.has(r.subcircuit_id??""))));if(!o)throw Error(`No source_net found with name "${t.source_net_name}"`);if(!o.subcircuit_connectivity_map_key)throw Error(`source_net "${t.source_net_name}" has no subcircuit_connectivity_map_key`);return n.resolveSubcircuitConnectivityKey(o.subcircuit_connectivity_map_key,o.subcircuit_id??t.subcircuit_id)}if(t.pour_connectivity_key){if(!n.knownSubcircuitConnectivityKeys.has(t.pour_connectivity_key))throw Error("pour_connectivity_key must be a subcircuit_connectivity_map_key. Use subcircuit_connectivity_map_key, source_net_id, or source_net_name instead of a generated connectivity-map id.");return n.resolveSubcircuitConnectivityKey(t.pour_connectivity_key,t.subcircuit_id)}throw Error("Copper pour requires source_net_id, source_net_name, or subcircuit_connectivity_map_key")},uet=(e,t)=>{if(Array.isArray(t)){if(t.length===0)return{pads:[],regionsForPour:[]};let m=t[0].subcircuit_id;if(t.some((f)=>f.subcircuit_id!==m))throw Error("All copper pours in one input problem must use the same subcircuit_id");let A=t.map((f)=>uet(e,f)),g=new Map;for(let f of A)for(let y of f.pads)g.set(`${y.layer}:${y.padId}`,y);return{pads:[...g.values()],regionsForPour:A.flatMap((f)=>f.regionsForPour)}}let n=t,o=e.find((m)=>m.type==="pcb_board");if(!o)throw Error("No pcb_board found in circuit json");let r=Aa(e),i=A9r(e,r,n.subcircuit_id),s=f9r(e,n,i),{getSubcircuitConnectivityKeyForId:a}=i,c=[];for(let m of e)if(m.type==="pcb_smtpad"){let A=m;if(A.layer!==n.layer)continue;let g;if(g=a(A.pcb_smtpad_id),!g)g=`unconnected:${A.pcb_smtpad_id}`;if(A.shape==="rect")c.push({shape:"rect",padId:A.pcb_smtpad_id,layer:A.layer,connectivityKey:g,isSmtPad:!0,bounds:{minX:A.x-A.width/2,minY:A.y-A.height/2,maxX:A.x+A.width/2,maxY:A.y+A.height/2}});else if(A.shape==="rotated_rect")c.push({shape:"rotated_rect",padId:A.pcb_smtpad_id,layer:A.layer,connectivityKey:g,isSmtPad:!0,x:A.x,y:A.y,width:A.width,height:A.height,ccwRotation:A.ccw_rotation});else if(A.shape==="circle")c.push({shape:"circle",padId:A.pcb_smtpad_id,layer:A.layer,connectivityKey:g,isSmtPad:!0,x:A.x,y:A.y,radius:A.radius});else if(A.shape==="pill"||A.shape==="rotated_pill")c.push({shape:"pill",padId:A.pcb_smtpad_id,layer:A.layer,connectivityKey:g,isSmtPad:!0,x:A.x,y:A.y,width:A.width,height:A.height,radius:A.radius,ccwRotation:A.shape==="rotated_pill"?A.ccw_rotation:0});else if(A.shape==="polygon")c.push({shape:"polygon",padId:A.pcb_smtpad_id,layer:A.layer,connectivityKey:g,isSmtPad:!0,points:A.points})}else if(m.type==="pcb_plated_hole"){let A=m;if(!A.layers.includes(n.layer))continue;let g=a(A.pcb_plated_hole_id);if(!g)g=`unconnected-plated-hole:${A.pcb_plated_hole_id}`;if(A.shape==="hole_with_polygon_pad"){let f=(A.ccw_rotation??0)*Math.PI/180,y=Math.cos(f),x=Math.sin(f);c.push({shape:"polygon",padId:A.pcb_plated_hole_id,layer:n.layer,connectivityKey:g,isPlatedHole:!0,points:A.pad_outline.map((C)=>({x:A.x+C.x*y-C.y*x,y:A.y+C.x*x+C.y*y}))})}else if(A.shape==="circle")c.push({shape:"circle",padId:A.pcb_plated_hole_id,layer:n.layer,connectivityKey:g,isPlatedHole:!0,x:A.x,y:A.y,radius:A.outer_diameter/2});else if(A.shape==="pill")c.push({shape:"pill",padId:A.pcb_plated_hole_id,layer:n.layer,connectivityKey:g,isPlatedHole:!0,x:A.x,y:A.y,width:A.outer_width,height:A.outer_height,radius:Math.min(A.outer_width,A.outer_height)/2,ccwRotation:A.ccw_rotation});else if(A.shape==="oval")c.push({shape:"oval",padId:A.pcb_plated_hole_id,layer:n.layer,connectivityKey:g,isPlatedHole:!0,x:A.x,y:A.y,width:A.outer_width,height:A.outer_height,ccwRotation:A.ccw_rotation});else if(A.shape==="circular_hole_with_rect_pad"||A.shape==="pill_hole_with_rect_pad"||A.shape==="rotated_pill_hole_with_rect_pad"){let{rect_pad_width:f,rect_pad_height:y}=A;if(typeof f!=="number"||typeof y!=="number")continue;let x=A.shape==="pill_hole_with_rect_pad"?0:A.rect_ccw_rotation??0;if(x===0)c.push({shape:"rect",padId:A.pcb_plated_hole_id,layer:n.layer,connectivityKey:g,isPlatedHole:!0,bounds:{minX:A.x-f/2,minY:A.y-y/2,maxX:A.x+f/2,maxY:A.y+y/2}});else c.push({shape:"rotated_rect",padId:A.pcb_plated_hole_id,layer:n.layer,connectivityKey:g,isPlatedHole:!0,x:A.x,y:A.y,width:f,height:y,ccwRotation:x})}}else if(m.type==="pcb_hole"){let A=m;if(A.hole_shape==="rect"){c.push({shape:"rect",padId:A.pcb_hole_id,layer:n.layer,connectivityKey:`hole:${A.pcb_hole_id}`,bounds:{minX:A.x-A.hole_width/2,minY:A.y-A.hole_height/2,maxX:A.x+A.hole_width/2,maxY:A.y+A.hole_height/2}});continue}if(A.hole_shape==="pill"||A.hole_shape==="rotated_pill"){let g=0;if(A.hole_shape==="rotated_pill")g=A.ccw_rotation;c.push({shape:"pill",padId:A.pcb_hole_id,layer:n.layer,connectivityKey:`hole:${A.pcb_hole_id}`,x:A.x,y:A.y,width:A.hole_width,height:A.hole_height,radius:Math.min(A.hole_width,A.hole_height)/2,ccwRotation:g});continue}if(A.hole_shape==="oval"){c.push({shape:"oval",padId:A.pcb_hole_id,layer:n.layer,connectivityKey:`hole:${A.pcb_hole_id}`,x:A.x,y:A.y,width:A.hole_width,height:A.hole_height,ccwRotation:0});continue}if(A.hole_shape!=="circle")continue;c.push({shape:"circle",padId:A.pcb_hole_id,layer:n.layer,connectivityKey:`hole:${A.pcb_hole_id}`,x:A.x,y:A.y,radius:A.hole_diameter/2})}else if(m.type==="pcb_cutout"){let A=m;if(A.shape==="rect")c.push({shape:"rect",padId:A.pcb_cutout_id,layer:n.layer,connectivityKey:`cutout:${A.pcb_cutout_id}`,bounds:{minX:A.center.x-A.width/2,minY:A.center.y-A.height/2,maxX:A.center.x+A.width/2,maxY:A.center.y+A.height/2}});else if(A.shape==="circle")c.push({shape:"circle",padId:A.pcb_cutout_id,layer:n.layer,connectivityKey:`cutout:${A.pcb_cutout_id}`,x:A.center.x,y:A.center.y,radius:A.radius});else if(A.shape==="polygon")c.push({shape:"polygon",padId:A.pcb_cutout_id,layer:n.layer,connectivityKey:`cutout:${A.pcb_cutout_id}`,points:A.points})}else if(m.type==="pcb_keepout"){let A=m;if(!A.layers.includes(n.layer))continue;if(A.shape==="rect")c.push({shape:"rect",padId:A.pcb_keepout_id,layer:n.layer,connectivityKey:`keepout:${A.pcb_keepout_id}`,bounds:{minX:A.center.x-A.width/2,minY:A.center.y-A.height/2,maxX:A.center.x+A.width/2,maxY:A.center.y+A.height/2}});else if(A.shape==="circle")c.push({shape:"circle",padId:A.pcb_keepout_id,layer:n.layer,connectivityKey:`keepout:${A.pcb_keepout_id}`,x:A.center.x,y:A.center.y,radius:A.radius})}else if(m.type==="pcb_via"){let A=m;if(!A.layers.includes(n.layer))continue;let g=a(A.pcb_via_id)??`unconnected-via:${A.pcb_via_id}`;c.push({shape:"circle",padId:A.pcb_via_id,layer:n.layer,connectivityKey:g,x:A.x,y:A.y,radius:A.outer_diameter/2})}else if(m.type==="pcb_trace"){let A=m,g=a(A.pcb_trace_id);if(!g)continue;let f=[],y=null,x=()=>{if(f.length>1)c.push({shape:"trace",padId:`${A.pcb_trace_id}-${c.length}`,layer:n.layer,connectivityKey:g,segments:f,width:y});f=[],y=null};for(let[C,b]of A.route.entries()){let I=A.route[C+1];if(b.route_type==="wire"&&b.layer===n.layer&&b.width_interpolation_mode&&b.start_width!==void 0&&b.end_width!==void 0&&I){let P=I.route_type==="through_pad"?I.start:I;if((I.route_type==="via"?I.from_layer:I.route_type==="through_pad"?I.start_layer:I.layer)===b.layer&&Math.hypot(P.x-b.x,P.y-b.y)>0){f.push({x:b.x,y:b.y}),x(),c.push({shape:"tapered_trace",padId:`${A.pcb_trace_id}-${c.length}`,layer:n.layer,connectivityKey:g,start:{x:b.x,y:b.y},end:{x:P.x,y:P.y},start_width:b.start_width,end_width:b.end_width,width_interpolation_mode:b.width_interpolation_mode});continue}}if(b.route_type==="wire"&&b.layer===n.layer){let P={x:b.x,y:b.y};if(y===null)y=b.width;else if(b.width!==y)f.push(P),x(),y=b.width;f.push(P)}else x()}x()}let{width:l,height:h,center:d}=o,u=n.outline??o.outline,_;if(u&&u.length>0){let m=u.map((g)=>g.x),A=u.map((g)=>g.y);_={minX:Math.min(...m),minY:Math.min(...A),maxX:Math.max(...m),maxY:Math.max(...A)}}else _={minX:d.x-l/2,minY:d.y-h/2,maxX:d.x+l/2,maxY:d.y+h/2};let p=[{shape:"rect",layer:n.layer,bounds:_,boardEdgeOutline:n.board_edge_outline,outline:u,connectivityKey:s,crosshatch:n.crosshatch,crosshatchPitch:n.crosshatchPitch,crosshatchWidth:n.crosshatchWidth,padMargin:n.pad_margin,traceMargin:n.trace_margin,pourMargin:n.pour_margin??Math.max(n.pad_margin,n.trace_margin),board_edge_margin:n.board_edge_margin??0,cutout_margin:n.cutout_margin,use_thermal_reliefs:n.use_thermal_reliefs,thermal_relief_spoke_width:n.thermal_relief_spoke_width,thermal_relief_spoke_count:n.thermal_relief_spoke_count}];return{pads:c,regionsForPour:p}};bp();bp();bp();var Dcn=["x_pos","x_neg","y_pos","y_neg","z_pos","z_neg"],y9r=(e)=>typeof e==="string"&&Dcn.includes(e),x9r=(e,t="face")=>{if(!y9r(e))throw Error(`${t} must be one of ${Dcn.join(", ")}, got ${JSON.stringify(e)}. The named directions (front/back/left/right/top/bottom) were retired: faces are named for the axis their outward normal points along, so the old \`top\` (+Z) is \`z_pos\` and the old \`front\` (+Y) is \`y_pos\`.`);return e},wB=(e)=>e.slice(0,1),$q=(e)=>e.endsWith("_pos")?1:-1,Ncn=(e)=>{let t=wB(e);if(t==="x")return["y","z"];if(t==="y")return["x","z"];return["x","y"]},h6=(e)=>wB(e)==="z",Rcn=(e)=>e==="x"?0:e==="y"?1:2,m6e=(e,t)=>[e.width,e.height,e.depth][Rcn(t)],C9r=(e,t,n,o)=>{let r=n*Math.PI/180,i=Math.abs(Math.cos(r)),s=Math.abs(Math.sin(r));return o==="x"?e*i+t*s:e*s+t*i},b9r=({body:e,face:t})=>{if(!e)return;if(h6(t))return e.aboveBoardHeight??e.size?.z;let n=wB(t)==="y"?"y":"x",o=e.footprint&&(n==="y"?e.footprint.height:e.footprint.width);if(!e.size)return o;let r=C9r(e.size.x,e.size.y,e.rotation??0,n);return o===void 0?r:Math.max(r,o)},I9r=(e)=>e?.aboveBoardHeight,v9r=(e)=>({type:"cuboid",size:e}),S9r=(e,t)=>({type:"cylinder",radius:e,height:t,resolution:32}),pet=(e,t)=>({type:"translate",vector:e,shape:t}),P9r={x:[Math.PI/2,0,Math.PI/2],y:[Math.PI/2,0,0]},E9r=(e,t)=>{let n=wB(e);if(n==="z")return t;return{type:"rotate",angles:P9r[n],shape:t}},Qcn=({width:e,height:t,cutDepth:n})=>v9r([e,t,n]),met=({diameter:e,cutDepth:t})=>S9r(e/2,t),M9r=({width:e,height:t,cutDepth:n})=>{if(Math.abs(e-t)<Number.EPSILON)return met({diameter:e,cutDepth:n});let o=e>t,r=Math.min(e,t)/2,i=Math.abs(e-t),s=Qcn({width:o?i:e,height:o?t:i,cutDepth:n}),a=met({diameter:r*2,cutDepth:n}),c=(l)=>o?[l,0,0]:[0,l,0];return{type:"union",shapes:[s,pet(c(-i/2),a),pet(c(i/2),a)]}},w9r=({placement:e,faceThickness:t,booleanTolerance:n})=>{let{aperture:o,face:r,center:i,width:s,height:a,inwardProjection:c}=e,h=(e.incidenceDegrees??0)*Math.PI/180,d=Math.abs(Math.cos(h)),u=Math.abs(Math.tan(h)),_=(t+n*2)/d+s*u+c,p;switch(o.shape){case"rect":p=Qcn({width:s,height:a,cutDepth:_});break;case"circle":p=met({diameter:s,cutDepth:_});break;case"pill":p=M9r({width:s,height:a,cutDepth:_});break}let m=e.rotation===0?p:{type:"rotate",angles:[0,0,e.rotation*Math.PI/180],shape:p},A=wB(r),g=$q(r),f=[i.x,i.y,i.z];if(A==="z")f[Rcn(A)]-=g*c/2;else{let C=A==="x"?g:0,b=A==="y"?g:0,I=Math.cos(h),v=Math.sin(h),P=C*I-b*v,M=C*v+b*I;f[0]-=P*c/2,f[1]-=M*c/2}let y=E9r(r,m),x=e.incidenceDegrees===void 0||e.incidenceDegrees===0?y:{type:"rotate",angles:[0,0,e.incidenceDegrees*Math.PI/180],shape:y};return{aperture:o,width:s,height:a,cutDepth:_,jscadPlan:pet(f,x)}},Aet=(e)=>{let t=e.margin??0;if(e.shape==="circle"){let n=2*(e.radius+t);return{width:n,height:n}}return{width:e.width+t*2,height:e.height+t*2}},kcn=(e)=>{let t=I9r(e.componentBody);if(t!==void 0)return t/2;return Aet(e).height/2},jq=(e,t)=>{if(!Number.isFinite(e))throw Error(`${t} must be finite, but is ${e}`)},sP=(e,t)=>{if(jq(e,t),e<=0)throw Error(`${t} must be greater than 0, but is ${ul(e)}`)},Kq=(e,t)=>{if(jq(e,t),e<0)throw Error(`${t} must not be negative, but is ${ul(e)}`)},B9r=(e,t)=>{let n=`apertures[${t}]`;if(x9r(e.face,`${n}.face`),jq(e.center.x,`${n}.center.x`),jq(e.center.y,`${n}.center.y`),Kq(e.margin??0,`${n}.margin`),e.shape==="circle")sP(e.radius,`${n}.radius`);else sP(e.width,`${n}.width`),sP(e.height,`${n}.height`);if(e.depth!==void 0)Kq(e.depth,`${n}.depth`);if(e.widthDimensionOffset!==void 0)jq(e.widthDimensionOffset,`${n}.widthDimensionOffset`);if(e.heightDimensionOffset!==void 0)jq(e.heightDimensionOffset,`${n}.heightDimensionOffset`)},Lcn=({floorThickness:e,standoffHeight:t,boardThickness:n})=>{let o=e,r=o+t;return{floorTopZ:o,boardBottomZ:r,boardTopZ:r+n}},T9r=({seamOffsetFromTop:e,totalHeight:t,...n})=>({...Lcn(n),seamZ:t-e,totalHeight:t}),p6e=["y_pos","x_pos","y_neg","x_neg"],_et=5,get=(e,t)=>m6e(t,Ncn(e)[0]),D9r=(e)=>{let t=new Map,o=-p6e.reduce((r,i)=>r+get(i,e),_et*(p6e.length-1))/2;for(let r of p6e){let i=get(r,e);t.set(r,o+i/2),o+=i+_et}return t},Bcn=(e,t)=>{let n=e.get(t);if(n===void 0)throw Error(`Missing ${t} wall panel`);return n},N9r=({graphics:e,placement:t,panelCenterX:n,planViewY:o,isProcessed:r})=>{let{aperture:i,width:s,height:a}=t,c=t.face==="y_pos"||t.face==="y_neg"?t.center.x:t.center.y,l=t.face==="y_pos"||t.face==="x_neg"?-1:1,h=h6(t.face)?{x:t.center.x,y:o+t.center.y}:{x:n+l*c,y:t.center.z},d=r?"rgba(239, 68, 68, 0.4)":"rgba(148, 163, 184, 0.12)",u=r?"#dc2626":"#94a3b8",p=`${h6(t.face)?`${t.face} `:""}${i.shape} ${s.toFixed(1)}×${a.toFixed(1)}`;if(i.shape==="rect"){e.rects?.push({center:h,width:s,height:a,fill:d,stroke:u,label:p});return}if(i.shape==="circle"){e.circles?.push({center:h,radius:s/2,fill:d,stroke:u,label:p});return}let m=s>=a,A=Math.min(s,a)/2,g=Math.abs(s-a);e.rects?.push({center:h,width:m?g:s,height:m?a:g,fill:d,stroke:u,label:p}),e.circles?.push({center:{x:h.x+(m?-g/2:0),y:h.y+(m?0:-g/2)},radius:A,fill:d,stroke:u},{center:{x:h.x+(m?g/2:0),y:h.y+(m?0:g/2)},radius:A,fill:d,stroke:u})},she=({title:e,resolved:t,processedApertureCount:n=0})=>{let{board:o,dimensions:r}=t,i={title:e,coordinateSystem:"cartesian",rects:[],circles:[],lines:[],points:[],texts:[]},s=D9r(r),a=-r.height/2-_et;for(let c of p6e){let l=Bcn(s,c);i.rects?.push({center:{x:l,y:r.depth/2},width:get(c,r),height:r.depth,fill:"rgba(59, 130, 246, 0.08)",stroke:"#2563eb",label:c}),i.texts?.push({x:l,y:r.depth+1.5,text:c,anchorSide:"bottom_center",color:"#1e3a8a",fontSize:1.5})}for(let[c,l]of t.apertures.entries())N9r({graphics:i,placement:l,panelCenterX:h6(l.face)?0:Bcn(s,l.face),planViewY:a,isProcessed:c<n});return i.rects?.push({center:{x:0,y:a},width:r.width,height:r.height,fill:"rgba(59, 130, 246, 0.05)",stroke:"#1d4ed8",label:"enclosure top view"},{center:{x:0,y:a},width:o.width,height:o.height,fill:"rgba(34, 197, 94, 0.18)",stroke:"#15803d",label:"board"}),i},R9r=class extends po{constructor(e){super();this.params=e}params;enclosurePlans;_step(){let e=this.params.apertureCutouts.map((r)=>r.jscadPlan),t=(r)=>e.length===0?r:{type:"subtract",shapes:[r,...e]},n=t(this.params.shellPlans.basePlan),o=t(this.params.shellPlans.lidPlan);this.enclosurePlans={parts:[{id:"base",jscadPlan:n},{id:"lid",jscadPlan:o}],assembledPlan:{type:"union",shapes:[n,o]}},this.solved=!0}getOutput(){if(!this.enclosurePlans)throw Error("Enclosure plan has not been composed");return this.enclosurePlans}getConstructorParams(){return[this.params]}visualize(){return she({title:"Composed enclosure",resolved:this.params.resolved,processedApertureCount:this.params.apertureCutouts.length})}},Q9r=(e,t)=>{if(e==="z_pos")return t.lidThickness;if(e==="z_neg")return t.floorThickness;return t.wallThickness},k9r=class extends po{constructor(e){super();this.params=e,this.MAX_ITERATIONS=e.resolved.apertures.length+1}params;apertureCutouts=[];_step(){let e=this.params.resolved.apertures,t=e[this.apertureCutouts.length];if(!t){this.solved=!0;return}if(this.apertureCutouts.push(w9r({placement:t,faceThickness:Q9r(t.face,this.params.resolved.dimensions),booleanTolerance:this.params.resolved.rules.booleanTolerance})),this.apertureCutouts.length===e.length)this.solved=!0}computeProgress(){let e=this.params.resolved.apertures.length;if(e===0)return this.solved?1:0;return this.apertureCutouts.length/e}getOutput(){return this.apertureCutouts}getConstructorParams(){return[this.params]}visualize(){return she({title:`Aperture cutouts (${this.apertureCutouts.length}/${this.params.resolved.apertures.length})`,resolved:this.params.resolved,processedApertureCount:this.apertureCutouts.length})}},L9r=class extends po{constructor(e){super();this.params=e}params;shellPlans;_step(){let{dimensions:e,rules:t,frame:n}=this.params.resolved,{width:o,height:r,wallThickness:i,floorThickness:s,lidThickness:a,lidLipDepth:c}=e,l=o-2*i,h=r-2*i,d=n.seamZ,u=d-s+t.booleanTolerance*2,_={type:"subtract",shapes:[{type:"translate",vector:[0,0,d/2],shape:{type:"cuboid",size:[o,r,d]}},{type:"translate",vector:[0,0,s+u/2],shape:{type:"cuboid",size:[l,h,u]}}]},p={type:"translate",vector:[0,0,n.seamZ+a/2],shape:{type:"cuboid",size:[o,r,a]}},m=c,A=p;if(m>0){let g=l-t.slidingFitClearance,f=h-t.slidingFitClearance,y=Math.min(i*t.lipWallThicknessRatio,t.lipWallThicknessMax),x=g-2*y,C=f-2*y,b={type:"subtract",shapes:[{type:"translate",vector:[0,0,n.seamZ-m/2],shape:{type:"cuboid",size:[g,f,m]}},{type:"translate",vector:[0,0,n.seamZ-m/2],shape:{type:"cuboid",size:[x,C,m+t.booleanTolerance*2]}}]};A={type:"union",shapes:[p,b]}}this.shellPlans={basePlan:_,lidPlan:A},this.solved=!0}getOutput(){if(!this.shellPlans)throw Error("Enclosure shell has not been created");return this.shellPlans}getConstructorParams(){return[this.params]}visualize(){return she({title:"Base and lid blanks",resolved:this.params.resolved})}},H9r=({axis:e,offset:t,extent:n,dimensions:o,face:r,prefix:i})=>{let s=m6e(o,e)/2,a=n/2,c=t-a,l=t+a,h=`the opening spans ${ul(c)} to ${ul(l)} but the enclosure only spans ${ul(-s)} to ${ul(s)}`;if(Math.abs(t)-a>s)throw Error(`${i} misses the ${r} face along ${e.toUpperCase()}: ${h}`);if(a-Math.abs(t)>s)throw Error(`${i} engulfs the ${r} face along ${e.toUpperCase()}: ${h}`)},F9r=({centerZ:e,extent:t,dimensions:n,prefix:o})=>{let r=e-t/2;if(r<n.floorThickness)throw Error(`${o} intersects the enclosure floor: its lowest edge is at ${ul(r)} but the floor top is at ${ul(n.floorThickness)}. Raise heightDimensionOffset, or reduce the opening height.`);if(r>n.depth)throw Error(`${o} sits entirely above the enclosure: its lowest edge is at ${ul(r)} but the enclosure is only ${ul(n.depth)} tall`)},z9r=({face:e,center:t,width:n,height:o,dimensions:r,prefix:i})=>{let s=Ncn(e),a=[n,o];s.forEach((c,l)=>{let h=a[l];if(c==="z"){F9r({centerZ:t.z,extent:h,dimensions:r,prefix:i});return}H9r({axis:c,offset:c==="x"?t.x:t.y,extent:h,dimensions:r,face:e,prefix:i})})},O9r={wallThickness:2,boardClearance:1,lidThickness:2,standoffHeight:4,topHeadroom:6,lidLipDepth:4,booleanTolerance:0.5,slidingFitClearance:0.3,lipWallThicknessRatio:0.7,lipWallThicknessMax:1.5},V9r=({face:e,boardSide:t="top",componentBody:n,frame:o})=>{let r=b9r({body:n,face:e});if(r===void 0)return;if(!h6(e))return r;let i=t==="bottom"?o.boardBottomZ:o.boardTopZ,s=e==="z_pos"?o.seamZ:o.floorTopZ;return Math.max(0,Math.abs(s-i))},Y9r=({face:e,depth:t=0,dimensions:n,rules:o})=>{if(h6(e)){if(e==="z_neg")return t;return Math.max(t,n.lidLipDepth)}let r=Math.min(n.wallThickness*o.lipWallThicknessRatio,o.lipWallThicknessMax),i=o.slidingFitClearance/2+r+o.booleanTolerance;return Math.max(t,i)},G9r=["x_pos","x_neg","y_pos","y_neg"],U9r=({face:e,origin:t,apertureAxisDirection:n,dimensions:o})=>{if(h6(e)||!n)return e;let r=Math.hypot(n.x,n.y);if(!Number.isFinite(r)||r===0)return e;let i={x:n.x/r,y:n.y/r},s=G9r.flatMap((a)=>{let c=wB(a),l=$q(a);if(i[c]*l<=0)return[];let u=(l*(m6e(o,c)/2-o.wallThickness)-t[c])/i[c];return Number.isFinite(u)&&u>=0?[{face:a,distance:u}]:[]});if(s.length===0)return e;return s.sort((a,c)=>{let l=a.distance-c.distance;if(Math.abs(l)>0.000000001)return l;if(a.face===e)return-1;if(c.face===e)return 1;return 0}),s[0].face},W9r=({face:e,apertureAxisDirection:t})=>{if(h6(e)||!t)return 0;let n=wB(e),o=$q(e),r={x:n==="x"?o:0,y:n==="y"?o:0},i=Math.hypot(t.x,t.y);if(!Number.isFinite(i)||i===0)throw Error(`apertureAxisDirection must have a finite, non-zero XY projection for side face ${e}`);let s={x:t.x/i,y:t.y/i},a=r.x*s.y-r.y*s.x,c=r.x*s.x+r.y*s.y;return Math.atan2(a,c)*180/Math.PI},X9r=({face:e,incidenceDegrees:t,distanceToWall:n})=>{if(h6(e))return 0;let o=n*Math.tan(t*Math.PI/180),r=wB(e),i=$q(e),s=r==="x"?i:-i;return o*s},Hcn=({boardSide:e,heightDatum:t,heightDimensionOffset:n,boardTopZ:o,boardBottomZ:r})=>{let i=t+n;return e==="bottom"?r-i:o+i},j9r=({face:e,boardCenter:t,centerZ:n,widthDimensionOffset:o,heightDimensionOffset:r,rotation:i,incidenceDegrees:s=0,dimensions:a,frame:c})=>{let l=wB(e);if(l==="z"){let u=i*Math.PI/180,_=Math.cos(u),p=Math.sin(u);return{x:t.x+o*_-r*p,y:t.y+o*p+r*_,z:e==="z_pos"?c.seamZ+a.lidThickness/2:a.floorThickness/2}}let h=$q(e)*(m6e(a,l)/2-a.wallThickness/2),d=X9r({face:e,incidenceDegrees:s,distanceToWall:(h-t[l==="x"?"x":"y"])*$q(e)});return l==="x"?{x:h,y:t.y+o+d,z:n}:{x:t.x+o+d,y:h,z:n}},K9r=({apertures:e,floorThickness:t,standoffHeight:n,boardThickness:o,lidThickness:r,lidLipDepth:i})=>{let{boardTopZ:s,boardBottomZ:a}=Lcn({floorThickness:t,standoffHeight:n,boardThickness:o}),c=0;for(let l of e){if(h6(l.face))continue;let d=Hcn({boardSide:l.boardSide??"top",heightDatum:kcn(l),heightDimensionOffset:l.heightDimensionOffset??0,boardTopZ:s,boardBottomZ:a})+Aet(l).height/2+i;c=Math.max(c,d+r)}return c},Tcn=["width","height","depth"],$9r=({board:e,wallThickness:t,boardClearance:n,floorThickness:o,standoffHeight:r,topHeadroom:i,lidThickness:s})=>{let a=t+n,c=(l)=>`to fit the ${ul(l)} board inside ${ul(t)} walls with ${ul(n)} clearance on each side`;return{width:{value:e.width+2*a,because:c(e.width)},height:{value:e.height+2*a,because:c(e.height)},depth:{value:o+r+e.thickness+i+s,because:`to stack ${ul(o)} floor + ${ul(r)} standoffs + ${ul(e.thickness)} board + ${ul(i)} headroom + ${ul(s)} lid`}}},q9r=({input:e,rules:t})=>{sP(e.board.width,"board.width"),sP(e.board.height,"board.height"),sP(e.board.thickness,"board.thickness");let n=e.wallThickness??t.wallThickness,o=e.floorThickness??n,r=e.lidThickness??t.lidThickness,i=e.boardClearance??t.boardClearance,s=e.standoffHeight??t.standoffHeight,a=e.topHeadroom??t.topHeadroom,c=e.lidLipDepth??t.lidLipDepth;sP(n,"wallThickness"),sP(o,"floorThickness"),sP(r,"lidThickness"),Kq(i,"boardClearance"),Kq(s,"standoffHeight"),Kq(a,"topHeadroom"),Kq(c,"lidLipDepth");let l=$9r({board:e.board,wallThickness:n,boardClearance:i,floorThickness:o,standoffHeight:s,topHeadroom:a,lidThickness:r}),h=e.topHeadroom===void 0?Math.max(l.depth.value,K9r({apertures:e.apertures??[],floorThickness:o,standoffHeight:s,boardThickness:e.board.thickness,lidThickness:r,lidLipDepth:c})):l.depth.value,d={width:e.width??l.width.value,height:e.height??l.height.value,depth:e.depth??h,wallThickness:n,floorThickness:o,lidThickness:r,boardClearance:i,standoffHeight:s,topHeadroom:a,lidLipDepth:c};for(let u of Tcn)sP(d[u],u);for(let u of Tcn){let{value:_,because:p}=l[u];if(d[u]<_)throw Error(`${u} must be at least ${ul(_)} ${p}, but is ${ul(d[u])}`)}return d},J9r=({board:e,dimensions:t})=>T9r({floorThickness:t.floorThickness,standoffHeight:t.standoffHeight,boardThickness:e.thickness,seamOffsetFromTop:t.lidThickness,totalHeight:t.depth}),Z9r=(e)=>{let t={...O9r,...e.fdmRules},n=e.apertures??[];for(let[s,a]of n.entries())B9r(a,s);let o=q9r({input:e,rules:t}),r=J9r({board:e.board,dimensions:o});o.lidLipDepth=Math.min(o.lidLipDepth,Math.max(0,r.seamZ-o.floorThickness));let i=n.map((s,a)=>{let c=U9r({face:s.face,origin:s.center,apertureAxisDirection:s.apertureAxisDirection,dimensions:o}),l=`apertures[${a}]`,{width:h,height:d}=Aet(s),u=W9r({face:c,apertureAxisDirection:s.apertureAxisDirection}),_=s.widthDimensionOffset??0,p=s.heightDimensionOffset??0,m=h6(c)?s.rotation??0:0,A=j9r({face:c,boardCenter:s.center,widthDimensionOffset:_,heightDimensionOffset:p,rotation:m,incidenceDegrees:u,centerZ:Hcn({boardSide:s.boardSide??"top",heightDatum:kcn(s),heightDimensionOffset:p,boardTopZ:r.boardTopZ,boardBottomZ:r.boardBottomZ}),dimensions:o,frame:r}),g=h6(c)?h:h/Math.abs(Math.cos(u*Math.PI/180));z9r({face:c,center:A,width:g,height:d,dimensions:o,prefix:l});let f=s.depth??V9r({face:c,boardSide:s.boardSide,componentBody:s.componentBody,frame:r})??0;return{aperture:s,face:c,center:A,width:h,height:d,rotation:m,incidenceDegrees:u,inwardProjection:Y9r({face:c,depth:f,dimensions:o,rules:t})}});return{construction:"fdm_box",board:e.board,apertures:i,dimensions:o,rules:t,frame:r}},evr=class extends po{constructor(e){super();this.input=e}input;resolved;_step(){this.resolved=Z9r(this.input),this.solved=!0}getOutput(){if(!this.resolved)throw Error("FDM enclosure problem is not resolved");return this.resolved}getConstructorParams(){return[this.input]}visualize(){if(!this.resolved)return super.visualize();return she({title:"Resolved FDM enclosure problem",resolved:this.resolved})}},ihe=(e,t)=>{if(!e)throw Error(`${t} has not completed`);return e},_6e=class extends Rb{resolveFdmEnclosureProblemSolver;createFdmEnclosureShellSolver;createFdmApertureCutoutsSolver;composeFdmEnclosureSolver;getResolvedProblem(){return ihe(this.resolveFdmEnclosureProblemSolver,"resolveFdmEnclosureProblemSolver").getOutput()}pipelineDef=[Pi("resolveFdmEnclosureProblemSolver",evr,(e)=>[e.inputProblem]),Pi("createFdmEnclosureShellSolver",L9r,(e)=>[{resolved:e.getResolvedProblem()}]),Pi("createFdmApertureCutoutsSolver",k9r,(e)=>[{resolved:e.getResolvedProblem()}]),Pi("composeFdmEnclosureSolver",R9r,(e)=>[{resolved:e.getResolvedProblem(),shellPlans:ihe(e.createFdmEnclosureShellSolver,"createFdmEnclosureShellSolver").getOutput(),apertureCutouts:ihe(e.createFdmApertureCutoutsSolver,"createFdmApertureCutoutsSolver").getOutput()}])];getConstructorParams(){return[this.inputProblem]}getOutput(){if(!this.solved)throw Error("FDM enclosure solver has not completed");let e=this.getResolvedProblem(),t=ihe(this.composeFdmEnclosureSolver,"composeFdmEnclosureSolver").getOutput();return{dimensions:e.dimensions,frame:e.frame,parts:t.parts,apertures:ihe(this.createFdmApertureCutoutsSolver,"createFdmApertureCutoutsSolver").getOutput(),jscadPlan:t.assembledPlan}}initialVisualize(){return null}finalVisualize(){let e=this.getResolvedProblem();return she({title:"Final FDM enclosure",resolved:e,processedApertureCount:e.apertures.length})}};er();yc();$p();er();var ck=(e,t,n={x:0,y:0})=>{let o=Math.cos(t),r=Math.sin(t),i=e.x-n.x,s=e.y-n.y;return{x:n.x+i*o-s*r,y:n.y+i*r+s*o}},g6e=(e)=>{e.pads=e.pads.map((t)=>{let n=ck(t.offset,e.ccwRotationOffset*Math.PI/180),o=(e.ccwRotationOffset%360+360)%360;return{...t,size:o===90||o===270?{x:t.size.y,y:t.size.x}:t.size,absoluteCenter:{x:e.center.x+n.x,y:e.center.y+n.y}}})};function tvr({components:e,packOrderStrategy:t,packFirst:n=[]}){let o=new Map;return n.forEach((r,i)=>{o.set(r,i)}),[...e].sort((r,i)=>{let s=o.get(r.componentId),a=o.get(i.componentId);if(s!==void 0&&a!==void 0)return s-a;if(s!==void 0)return-1;if(a!==void 0)return 1;if(t==="largest_to_smallest")return i.pads.length-r.pads.length;return r.pads.length-i.pads.length})}var nvr=(e)=>{let t=Math.min(...e.map((i)=>i.minX)),n=Math.min(...e.map((i)=>i.minY)),o=Math.max(...e.map((i)=>i.maxX)),r=Math.max(...e.map((i)=>i.maxY));return{minX:t,minY:n,maxX:o,maxY:r}};function yet(e){let{bounds:t,center:n,width:o,height:r,angleRad:i}=e,s=e.translate?.x??0,a=e.translate?.y??0,c=o/2,l=r/2,h=[{x:n.x-c,y:n.y-l},{x:n.x+c,y:n.y-l},{x:n.x+c,y:n.y+l},{x:n.x-c,y:n.y+l}];for(let d of h){let u=ck(d,i),_=u.x+s,p=u.y+a;t.minX=Math.min(t.minX,_),t.maxX=Math.max(t.maxX,_),t.minY=Math.min(t.minY,p),t.maxY=Math.max(t.maxY,p)}}var fY=(e,t=0)=>{let n={minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0},o=e.ccwRotationOffset*Math.PI/180;for(let r of e.pads){let i=ck(r.offset,o),s=e.center.x+i.x,a=e.center.y+i.y,c=r.size.x/2,l=r.size.y/2;n.minX=Math.min(n.minX,s-c),n.maxX=Math.max(n.maxX,s+c),n.minY=Math.min(n.minY,a-l),n.maxY=Math.max(n.maxY,a+l)}if(e.courtyard)yet({bounds:n,center:e.courtyard.offsetFromCenter,width:e.courtyard.width,height:e.courtyard.height,angleRad:o,translate:e.center});return{minX:n.minX-t,maxX:n.maxX+t,minY:n.minY-t,maxY:n.maxY+t}},Fcn=(e,t,n)=>(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x);function zcn(e,t=0.0000000001){if(e.length<=1)return e;let n=[],o=e[0][0],r=e[0][1];for(let i=1;i<e.length;i++){let s=e[i],[a,c]=s,l=0.000000001;if(!(Math.abs(r.x-a.x)<0.000000001&&Math.abs(r.y-a.y)<0.000000001)){n.push([o,r]),o=a,r=c;continue}let d=Fcn(o,r,c),u=Math.hypot(r.x-o.x,r.y-o.y),_=Math.hypot(c.x-r.x,c.y-r.y),p=Math.max(t,t*u*_);if(Math.abs(d)<p)r=c;else n.push([o,r]),o=a,r=c}if(e.length>2){let i=n[0],s=[o,r];if(i&&n.length>0)if(Math.abs(r.x-i[0].x)<0.000000001&&Math.abs(r.y-i[0].y)<0.000000001){let l=Fcn(o,r,i[1]),h=Math.hypot(r.x-o.x,r.y-o.y),d=Math.hypot(i[1].x-r.x,i[1].y-r.y),u=Math.max(t,t*h*d);if(Math.abs(l)<u)n[0]=[o,i[1]];else n.push(s)}else n.push(s);else n.push(s)}else n.push([o,r]);return n}function ovr(e){let t=0;for(let n=0;n<e.length;n++){let o=(n+1)%e.length,r=e[n],i=e[o];t+=r.x*i.y,t-=i.x*r.y}return t/2}function rvr(e){let t=[],n=e.first;if(!n)return t;do{let o=n.shape,r=o.start??o.ps;t.push({x:r.x,y:r.y}),n=n.next}while(n!==e.first);return t}function ivr(e){let t=[],n=[],o=Array.from(e.faces);for(let r of o){let i=rvr(r);if(i.length<3)continue;let s=ovr(i);if(s>0)t.push(i);else if(s<0)n.push(i)}return{obstacleFreeLoops:t,obstacleContainingLoops:n}}function Ocn(e){let t=[];for(let n=0;n<e.length;n++){let o=e[n],r=e[(n+1)%e.length];t.push([o,r])}return t}function svr(e){let t=ivr(e);return{obstacleFreeLoops:t.obstacleFreeLoops.map(Ocn),obstacleContainingLoops:t.obstacleContainingLoops.map(Ocn)}}var avr=(e)=>{let{component:t,courtyard:n,minGap:o}=e,r=n.width/2+o,i=n.height/2+o,a=[{x:n.offsetFromCenter.x-r,y:n.offsetFromCenter.y-i},{x:n.offsetFromCenter.x+r,y:n.offsetFromCenter.y-i},{x:n.offsetFromCenter.x+r,y:n.offsetFromCenter.y+i},{x:n.offsetFromCenter.x-r,y:n.offsetFromCenter.y+i}].map((_)=>{let p=ck(_,t.ccwRotationOffset*Math.PI/180);return{x:p.x+t.center.x,y:p.y+t.center.y}}),c=a.map(({x:_,y:p})=>[_,p]),l=new He.Polygon(c),h=a.map((_)=>_.x),d=a.map((_)=>_.y),u={minX:Math.min(...h),minY:Math.min(...d),maxX:Math.max(...h),maxY:Math.max(...d)};return{poly:l,bbox:u}},cvr=(e,t)=>e.pads.map((n)=>{let o=n.size.x/2+t,r=n.size.y/2+t,s=[{x:n.offset.x-o,y:n.offset.y-r},{x:n.offset.x+o,y:n.offset.y-r},{x:n.offset.x+o,y:n.offset.y+r},{x:n.offset.x-o,y:n.offset.y+r}].map((u)=>{let _=ck(u,e.ccwRotationOffset*Math.PI/180);return{x:_.x+e.center.x,y:_.y+e.center.y}}),a=s.map(({x:u,y:_})=>[u,_]),c=new He.Polygon(a),l=s.map((u)=>u.x),h=s.map((u)=>u.y),d={minX:Math.min(...l),minY:Math.min(...h),maxX:Math.max(...l),maxY:Math.max(...h)};return{poly:c,bbox:d}}),lvr=(e,t)=>e.map((n)=>{let o=n.width/2+t,r=n.height/2+t,i=n.absoluteCenter.x,s=n.absoluteCenter.y,a=[{x:i-o,y:s-r},{x:i+o,y:s-r},{x:i+o,y:s+r},{x:i-o,y:s+r}],c=a.map(({x:_,y:p})=>[_,p]),l=new He.Polygon(c),h=a.map((_)=>_.x),d=a.map((_)=>_.y),u={minX:Math.min(...h),minY:Math.min(...d),maxX:Math.max(...h),maxY:Math.max(...d)};return{poly:l,bbox:u}}),hvr=(e,t={})=>{let{minGap:n=0,obstacles:o=[]}=t;if(e.length===0&&o.length===0)return[];let r=e.map((A)=>fY(A,n)),i=o.map((A)=>({minX:A.absoluteCenter.x-A.width/2-n,minY:A.absoluteCenter.y-A.height/2-n,maxX:A.absoluteCenter.x+A.width/2+n,maxY:A.absoluteCenter.y+A.height/2+n})),s=nvr([...r,...i]),a=[];for(let A of e)if(A.courtyard)a.push(avr({component:A,courtyard:A.courtyard,minGap:n}));else{let g=cvr(A,n);a.push(...g)}let c=lvr(o,n);if(a.push(...c),a.length===0)return[];let h=dvr(a).map((A)=>A.poly),d=new He.Polygon(new He.Box(s.minX,s.minY,s.maxX,s.maxY)),u=d.clone();for(let A of h)try{d=He.BooleanOperations.subtract(d,A)}catch{}let _=null;try{_=He.BooleanOperations.subtract(u,d)}catch{try{if(h.length>0){let A=h[0];for(let g=1;g<h.length;g++)try{A=He.BooleanOperations.unify(A,h[g])}catch{}_=A}}catch{_=null}}if(!_)return[];let p=svr(_);return[...p.obstacleFreeLoops.map((A)=>zcn(A)),...p.obstacleContainingLoops.map((A)=>zcn(A))].filter((A)=>A.length>=3)};function dvr(e){let t=(i)=>Math.max(0,i.maxX-i.minX)*Math.max(0,i.maxY-i.minY),n=(i,s,a=0.000000001)=>i.minX-a<=s.minX&&i.minY-a<=s.minY&&i.maxX+a>=s.maxX&&i.maxY+a>=s.maxY,o=[...e].sort((i,s)=>t(s.bbox)-t(i.bbox)),r=[];for(let i of o){let s=i.bbox.maxX-i.bbox.minX,a=i.bbox.maxY-i.bbox.minY;if(!(s>0.000000000001&&a>0.000000000001))continue;let c=!1;for(let l of r)if(n(l.bbox,i.bbox)){c=!0;break}if(!c)r.push(i)}return r}var Wcn=(e)=>{if(typeof e==="number")return Math.round(e*100)/100;if(typeof e==="object")return Object.fromEntries(Object.entries(e).map(([t,n])=>[t,Wcn(n)]));return e},Xcn=class{MAX_ITERATIONS=1e5;solved=!1;failed=!1;iterations=0;progress=0;error=null;activeSubSolver;failedSubSolvers;timeToSolve;stats={};_setupDone=!1;getSolverName(){return this.constructor.name}setup(){if(this._setupDone)return;this._setup(),this._setupDone=!0}step(){if(!this._setupDone)this.setup();if(this.solved)return;if(this.failed)return;this.iterations++;try{this._step()}catch(e){throw this.error=`${this.getSolverName()} error: ${e}`,console.error(this.error),this.failed=!0,e}if(!this.solved&&this.iterations>this.MAX_ITERATIONS)this.tryFinalAcceptance();if(!this.solved&&this.iterations>this.MAX_ITERATIONS)this.error=`${this.getSolverName()} ran out of iterations`,console.error(this.error),this.failed=!0;if("computeProgress"in this)this.progress=this.computeProgress()}_setup(){}_step(){}getConstructorParams(){throw Error("getConstructorParams not implemented")}solve(){let e=Date.now();while(!this.solved&&!this.failed)this.step();let t=Date.now();this.timeToSolve=t-e}visualize(){return{lines:[],points:[],rects:[],circles:[]}}tryFinalAcceptance(){}getOutput(){return null}preview(){return{lines:[],points:[],rects:[],circles:[]}}noisySolve(){let e=Date.now();while(!this.solved&&!this.failed)this.step(),console.log(JSON.stringify(Wcn(this.visualize())));let t=Date.now();this.timeToSolve=t-e}},xet=class extends Xcn{offsetPadPoints;targetPointMap;currentPosition;constraintFn;epsilon;useSquaredDistance;optimalPosition;initialPosition;getSolverName(){return"MultiOffsetIrlsSolver"}constructor(e){super();this.offsetPadPoints=[...e.offsetPadPoints],this.targetPointMap=new Map(e.targetPointMap),this.initialPosition={...e.initialPosition},this.currentPosition={...e.initialPosition},this.constraintFn=e.constraintFn,this.epsilon=e.epsilon??0.000001,this.useSquaredDistance=e.useSquaredDistance??!1,this.MAX_ITERATIONS=e.maxIterations??100}getConstructorParams(){return{offsetPadPoints:this.offsetPadPoints.map((e)=>({...e})),targetPointMap:new Map(this.targetPointMap),initialPosition:this.initialPosition,constraintFn:this.constraintFn,epsilon:this.epsilon,useSquaredDistance:this.useSquaredDistance,maxIterations:this.MAX_ITERATIONS}}_setup(){if(this.currentPosition={...this.initialPosition},this.optimalPosition=void 0,!Array.from(this.targetPointMap.values()).some((t)=>t.length>0)||this.offsetPadPoints.length===0)this.optimalPosition={...this.currentPosition},this.solved=!0}_step(){if(this.offsetPadPoints.length===0)return;let{x:e,y:t}=this.currentPosition,n=0,o=0,r=0;for(let h of this.offsetPadPoints){let d=this.targetPointMap.get(h.id)||[];if(d.length===0)continue;let u=e+h.offsetX,_=t+h.offsetY;for(let p of d){let m=u-p.x,A=_-p.y,g=Math.sqrt(m*m+A*A),f;if(this.useSquaredDistance)f=1;else f=g<this.epsilon?1e6:1/g;let y={x:p.x-h.offsetX,y:p.y-h.offsetY};n+=f*y.x,o+=f*y.y,r+=f}}let i={x:r>0?n/r:e,y:r>0?o/r:t},s=this.constraintFn?this.constraintFn(i):i,a=s.x-e,c=s.y-t;if(Math.sqrt(a*a+c*c)<this.epsilon){this.optimalPosition={...s},this.solved=!0;return}this.currentPosition=s}getBestPosition(){return this.optimalPosition||this.currentPosition}getOffsetPadPositions(){let e=this.getBestPosition(),t=new Map;for(let n of this.offsetPadPoints)t.set(n.id,{x:e.x+n.offsetX,y:e.y+n.offsetY});return t}getOffsetPadPosition(e){return this.getOffsetPadPositions().get(e)}getTotalDistance(e){let t=e||this.getBestPosition(),n=0;for(let o of this.offsetPadPoints){let r={x:t.x+o.offsetX,y:t.y+o.offsetY},i=this.targetPointMap.get(o.id)||[];for(let s of i){let a=r.x-s.x,c=r.y-s.y;if(this.useSquaredDistance)n+=a*a+c*c;else n+=Math.sqrt(a*a+c*c)}}return n}getDistanceForPad(e,t){let n=t||this.getBestPosition(),o=this.offsetPadPoints.find((s)=>s.id===e);if(!o)return 0;let r={x:n.x+o.offsetX,y:n.y+o.offsetY};return(this.targetPointMap.get(e)||[]).reduce((s,a)=>{let c=r.x-a.x,l=r.y-a.y;if(this.useSquaredDistance)return s+(c*c+l*l);else return s+Math.sqrt(c*c+l*l)},0)}computeProgress(){if(this.offsetPadPoints.length===0)return 1;let e=this.getTotalDistance(this.initialPosition),t=this.getTotalDistance();if(e===0)return 1;let n=Math.max(0,e-t);return Math.min(1,n/e)}visualize(){let e={lines:[],points:[],rects:[],circles:[]},t=["#4CAF50","#2196F3","#FF9800","#9C27B0","#F44336","#607D8B"],n=this.getBestPosition();for(let o=0;o<this.offsetPadPoints.length;o++){let r=this.offsetPadPoints[o];if(!r)continue;let i=t[o%t.length],s=this.targetPointMap.get(r.id)||[],a={x:n.x+r.offsetX,y:n.y+r.offsetY};for(let c of s)e.points.push({...c,color:i});for(let c of s)e.lines.push({points:[a,c],strokeColor:i});e.points.push({x:a.x,y:a.y,color:i})}if(e.points.push({...this.currentPosition,color:"#f44336"}),this.optimalPosition)e.points.push({...this.optimalPosition,color:"rgba(76, 175, 80, 0.3)"});return e}getOutput(){return this.optimalPosition??this.currentPosition}},uvr=class extends Xcn{offsetPadPoints;targetPointMap;constraintFn;currentPosition;optimalPosition;initialPosition;phase1Epsilon;phase2Epsilon;maxIterations;getSolverName(){return"TwoPhaseIrlsSolver"}phase1Solver;phase2Solver;currentPhase=1;phase1Position;closestTargetPadId;closestTargetPoint;constructor(e){super();this.offsetPadPoints=[...e.offsetPadPoints],this.targetPointMap=new Map(e.targetPointMap),this.initialPosition={...e.initialPosition},this.currentPosition={...e.initialPosition},this.constraintFn=e.constraintFn,this.phase1Epsilon=e.phase1Epsilon??e.epsilon??0.000001,this.phase2Epsilon=e.phase2Epsilon??e.epsilon??0.000001,this.maxIterations=e.maxIterations??100}getConstructorParams(){return{offsetPadPoints:this.offsetPadPoints.map((e)=>({...e})),targetPointMap:new Map(this.targetPointMap),initialPosition:this.initialPosition,constraintFn:this.constraintFn,phase1Epsilon:this.phase1Epsilon,phase2Epsilon:this.phase2Epsilon,maxIterations:this.maxIterations}}_setup(){if(this.currentPosition={...this.initialPosition},this.optimalPosition=void 0,this.currentPhase=1,this.phase1Position=void 0,this.closestTargetPadId=void 0,this.closestTargetPoint=void 0,!Array.from(this.targetPointMap.values()).some((t)=>t.length>0)||this.offsetPadPoints.length===0){this.optimalPosition={...this.currentPosition},this.solved=!0;return}this.phase1Solver=new xet({offsetPadPoints:this.offsetPadPoints,targetPointMap:this.targetPointMap,initialPosition:this.initialPosition,constraintFn:this.constraintFn,epsilon:this.phase1Epsilon,maxIterations:this.maxIterations,useSquaredDistance:!0}),this.phase1Solver.setup()}_step(){if(this.currentPhase===1)this.stepPhase1();else this.stepPhase2()}stepPhase1(){if(!this.phase1Solver)return;if(this.phase1Solver.step(),this.currentPosition=this.phase1Solver.getBestPosition(),this.phase1Solver.solved)this.phase1Position=this.phase1Solver.getBestPosition(),this.setupPhase2();else if(this.phase1Solver.failed)this.failed=!0,this.error=`Phase 1 failed: ${this.phase1Solver.error}`}setupPhase2(){if(!this.phase1Position)return;let e=1/0,t,n;for(let r of this.offsetPadPoints){let i=this.targetPointMap.get(r.id)||[];if(i.length===0)continue;let s=this.phase1Position.x+r.offsetX,a=this.phase1Position.y+r.offsetY;for(let c of i){let l=s-c.x,h=a-c.y,d=Math.sqrt(l*l+h*h);if(d<e)e=d,t=r.id,n=c}}if(this.closestTargetPadId=t,this.closestTargetPoint=n,!t||!n){this.optimalPosition=this.phase1Position,this.solved=!0;return}let o=new Map;o.set(t,[n]),this.phase2Solver=new xet({offsetPadPoints:this.offsetPadPoints,targetPointMap:o,initialPosition:this.phase1Position,constraintFn:this.constraintFn,epsilon:this.phase2Epsilon,maxIterations:this.maxIterations,useSquaredDistance:!1}),this.phase2Solver.setup(),this.currentPhase=2}stepPhase2(){if(!this.phase2Solver)return;if(this.phase2Solver.step(),this.currentPosition=this.phase2Solver.getBestPosition(),this.phase2Solver.solved)this.optimalPosition=this.phase2Solver.getBestPosition(),this.solved=!0;else if(this.phase2Solver.failed)this.failed=!0,this.error=`Phase 2 failed: ${this.phase2Solver.error}`}getBestPosition(){return this.optimalPosition||this.currentPosition}getOffsetPadPositions(){let e=this.getBestPosition(),t=new Map;for(let n of this.offsetPadPoints)t.set(n.id,{x:e.x+n.offsetX,y:e.y+n.offsetY});return t}getTotalDistance(e){let t=e||this.getBestPosition(),n=0;for(let o of this.offsetPadPoints){let r={x:t.x+o.offsetX,y:t.y+o.offsetY},i=this.targetPointMap.get(o.id)||[];for(let s of i){let a=r.x-s.x,c=r.y-s.y;n+=a*a+c*c}}return n}visualize(){let e={lines:[],points:[],rects:[],circles:[]};if(e.points.push({...this.currentPosition,color:this.currentPhase===1?"#FF6B6B":"#4ECDC4",label:`Phase ${this.currentPhase}`}),this.phase1Position&&this.currentPhase===2)e.points.push({...this.phase1Position,color:"rgba(255, 107, 107, 0.5)",label:"Phase 1 result"});if(this.closestTargetPoint&&this.closestTargetPadId){e.points.push({...this.closestTargetPoint,color:"#FFA500",label:`Closest target (${this.closestTargetPadId})`});let n=this.offsetPadPoints.find((o)=>o.id===this.closestTargetPadId);if(n){let o=this.getBestPosition(),r={x:o.x+n.offsetX,y:o.y+n.offsetY};e.lines.push({points:[r,this.closestTargetPoint],strokeColor:"#FFA500"})}}let t=this.currentPhase===1?this.phase1Solver:this.phase2Solver;if(t){let n=t.visualize(),o=this.currentPhase===1?"rgba(255, 107, 107, 0.7)":"rgba(76, 205, 196, 0.7)";if(n.lines){let r=n.lines.map((i)=>({...i,strokeColor:o}));e.lines.push(...r)}if(n.points)e.points.push(...n.points);if(n.rects)e.rects.push(...n.rects);if(n.circles)e.circles.push(...n.circles)}if(this.optimalPosition)e.points.push({...this.optimalPosition,color:"rgba(76, 175, 80, 0.8)",label:"Final optimal position"});return e}getOutput(){return this.optimalPosition??this.currentPosition}};function pvr(e){let t=new Map,n=new Set;for(let{padIds:o,ignoreWeakConnections:r}of e)for(let i of o){let s=t.get(i);if(!s)s=new Set,t.set(i,s);for(let a of o)s.add(a);if(r===!0)n.add(i)}return{explicitlyConnectedPadIdsByPadId:t,padIdsRejectingWeakConnections:n}}var Vcn=new WeakMap;function mvr(e){let t=Vcn.get(e);if(t)return t;let n=pvr(e);return Vcn.set(e,n),n}function A6e(e,t,n){if(!n?.length)return!0;let o=mvr(n);if(o.explicitlyConnectedPadIdsByPadId.get(e)?.has(t))return!0;return!(o.padIdsRejectingWeakConnections.has(e)||o.padIdsRejectingWeakConnections.has(t))}var _vr=(e)=>{let t={};for(let n=0;n<e.length;n++)t[e[n]]=`hsl(${n*300/e.length}, 100%, 50%)`;return t},Cet=(e,t=1)=>`hsl(${e.split("").reduce((o,r)=>o*31+r.charCodeAt(0),0)%360}, 100%, 50%, ${t})`;function Ycn(e,t){let[n,o]=e,r=o.x-n.x,i=o.y-n.y,s=Math.hypot(r,i);if(s===0)return{x:0,y:1};let a=r/s,c=i/s,l={x:-c,y:a},h={x:c,y:-a},d=[];if(t.length>0){d.push(t[0][0]);for(let m of t)d.push(m[1])}let u=(()=>{let m=0;for(let A=0;A<d.length;A++){let g=d[A],f=d[(A+1)%d.length];m+=g.x*f.y-f.x*g.y}return m/2})(),_=u>0?h:l;if(u<0)return{x:-_.x,y:-_.y};return _}var gvr=class extends po{ccwFullOutline;origin;globalBounds;largestRect=null;mode;getSolverName(){return"LargestRectOutsideOutlineFromPointSolver"}constructor(e){super();this.ccwFullOutline=e.ccwFullOutline,this.origin=e.origin,this.globalBounds=e.globalBounds,this.mode=e.mode??"outside"}getConstructorParams(){return{ccwFullOutline:this.ccwFullOutline,origin:this.origin,globalBounds:this.globalBounds,mode:this.mode}}_setup(){}_step(){this.largestRect=this.computeLargestRect(),this.solved=!0}computeLargestRect(){let e=this.makeEdges(this.ccwFullOutline),t={x:this.globalBounds.minX,y:this.globalBounds.minY,w:this.globalBounds.maxX-this.globalBounds.minX,h:this.globalBounds.maxY-this.globalBounds.minY};return this.largestRectContainingPointRegion(e,this.origin,t,this.mode)}almostEqual(e,t,n=0.000000001){return Math.abs(e-t)<=n}makeEdges(e){let t=[];for(let n=0;n<e.length;n++){let o=e[n],r=e[(n+1)%e.length];if(!o||!r)continue;if(this.almostEqual(o.x,r.x)&&this.almostEqual(o.y,r.y))continue;t.push([o,r])}return t}isVertical(e){return this.almostEqual(e[0].x,e[1].x)}isHorizontal(e){return this.almostEqual(e[0].y,e[1].y)}scanlineIntervalsAtY(e,t){let n=[];for(let r of e){if(!this.isVertical(r))continue;let i=r[0].y,s=r[1].y,a=r[0].x,c=Math.min(i,s),l=Math.max(i,s);if(c<=t&&t<l)n.push(a)}n.sort((r,i)=>r-i);let o=[];for(let r=0;r+1<n.length;r+=2){let i=n[r],s=n[r+1];if(i!==void 0&&s!==void 0)o.push([i,s])}return o}clipIntervals(e,t,n){let o=[];for(let[r,i]of e){let s=Math.max(t,r),a=Math.min(n,i);if(a>s)o.push([s,a])}return o}regionIntervalsAtY(e,t,n,o,r){let i=this.clipIntervals(this.scanlineIntervalsAtY(e,t),n,o);if(r==="inside")return i;let s=[],a=n;for(let[c,l]of i){if(c>a)s.push([a,c]);a=Math.max(a,l)}if(a<o)s.push([a,o]);return s}largestRectContainingPointRegion(e,t,n,o){let r=n.x,i=n.x+n.w,s=n.y,a=n.y+n.h,l=this.regionIntervalsAtY(e,t.y,r,i,o).find(([x,C])=>x-0.000000001<=t.x&&t.x<=C+0.000000001);if(!l)return null;let[h,d]=l,u=new Set([h,d]);for(let x of e){if(!this.isVertical(x))continue;let C=x[0].x;if(h<C&&C<d)u.add(C)}let _=Array.from(u).sort((x,C)=>x-C),p=_.length-1;if(p<=0)return null;let m=Array(p).fill(-1/0),A=Array(p).fill(1/0);for(let x=0;x<p;x++){let C=_[x],b=_[x+1];if(C===void 0||b===void 0)continue;let I=0.5*(C+b);if(u.has(I))I+=0.000001;let v=a,P=s;for(let M of e){if(!this.isHorizontal(M))continue;let B=M[0].y,T=Math.min(M[0].x,M[1].x),N=Math.max(M[0].x,M[1].x);if(T-0.000000001<=I&&I<=N+0.000000001){if(B>t.y)v=Math.min(v,B);if(B<t.y)P=Math.max(P,B)}}if(!(P<v))m[x]=-1/0,A[x]=1/0;else m[x]=v,A[x]=P}let g=-1;for(let x=0;x<p;x++){let C=_[x],b=_[x+1];if(C===void 0||b===void 0)continue;if(C-0.000000001<=t.x&&t.x<=b+0.000000001){g=x;break}}if(g===-1)return null;let f=null,y=-1;for(let x=0;x<=g;x++){let C=1/0,b=-1/0;for(let I=x;I<p;I++){let v=m[I],P=A[I];if(v===void 0||P===void 0)continue;if(C=Math.min(C,v),b=Math.max(b,P),I<g)continue;let M=Math.max(0,C-b);if(M<=0)continue;let B=_[x],T=_[I+1];if(B===void 0||T===void 0)continue;let N=T-B,D=N*M;if(D>y)y=D,f={x:B,y:b,w:N,h:M}}}return f}getLargestRect(){if(!this.solved)this.solve();return this.largestRect}getLargestRectBounds(){if(!this.solved)this.solve();if(!this.largestRect)return{minX:0,minY:0,maxX:0,maxY:0};return{minX:this.largestRect.x,minY:this.largestRect.y,maxX:this.largestRect.x+this.largestRect.w,maxY:this.largestRect.y+this.largestRect.h}}visualize(){let e={lines:[],points:[],rects:[],circles:[]};for(let t=0;t<this.ccwFullOutline.length;t++){let n=this.ccwFullOutline[t],o=this.ccwFullOutline[(t+1)%this.ccwFullOutline.length];if(n&&o)e.lines.push({points:[n,o],strokeColor:"rgba(0,0,0,0.5)"})}if(e.lines.push({points:[...this.ccwFullOutline,this.ccwFullOutline[0]],strokeColor:"rgba(200, 200, 200, 0.5)",strokeDash:[10,5]}),e.circles.push({center:this.origin,radius:0.05,fill:"#f44336",label:"Origin"}),this.largestRect)e.rects.push({center:{x:this.largestRect.x+this.largestRect.w/2,y:this.largestRect.y+this.largestRect.h/2},width:this.largestRect.w,height:this.largestRect.h,fill:"rgba(0, 255, 0, 0.3)",stroke:"#4CAF50",label:`Largest Rectangle (Area: ${(this.largestRect.w*this.largestRect.h).toFixed(3)})`});return e}getOutput(){return this.largestRect??null}},Avr=(e,{rotationDegrees:t=0})=>{let n={minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0},o=t*Math.PI/180;for(let r of e.pads)yet({bounds:n,center:r.offset,width:r.size.x,height:r.size.y,angleRad:o});if(e.courtyard)yet({bounds:n,center:e.courtyard.offsetFromCenter,width:e.courtyard.width,height:e.courtyard.height,angleRad:o});return n},fvr=(e,t)=>{let[n,o]=e,r={x:o.x-n.x,y:o.y-n.y},i=yvr(r);return[{x:n.x-i.x*t,y:n.y-i.y*t},{x:o.x+i.x*t,y:o.y+i.y*t}]};function yvr(e){let t=Math.hypot(e.x,e.y);return{x:e.x/t,y:e.y/t}}function qq(e,t){if(t.length<3)return!1;let n=!1,o=t.length,r=[...t];if(r[0].x!==r[o-1].x||r[0].y!==r[o-1].y)r.push({...r[0]});for(let i=0,s=r.length-1;i<r.length;s=i++){let a=r[i].x,c=r[i].y,l=r[s].x,h=r[s].y;if(c>e.y!==h>e.y&&e.x<(l-a)*(e.y-c)/(h-c)+a)n=!n}return n}var xvr=class extends po{outlineSegment;viableOutlineSegment=null;ccwFullOutline;componentRotationDegrees;packStrategy;minGap;obstacles;packedComponents;componentToPack;viableBounds;globalBounds;boundaryOutline;weightedConnections;networkTargetPointMappingsCache;optimalPosition;irlsSolver;twoPhaseIrlsSolver;getSolverName(){return"OutlineSegmentCandidatePointSolver"}largestRectBounds;largestRectMidPoint;largestRectOrigin;constructor(e){super();this.outlineSegment=e.outlineSegment,this.ccwFullOutline=e.ccwFullOutline,this.componentRotationDegrees=e.componentRotationDegrees,this.packStrategy=e.packStrategy,this.minGap=e.minGap,this.packedComponents=e.packedComponents,this.componentToPack=e.componentToPack,this.obstacles=e.obstacles??[],this.globalBounds=e.globalBounds,this.boundaryOutline=e.boundaryOutline,this.weightedConnections=e.weightedConnections,this.networkTargetPointMappingsCache=e.networkTargetPointMappingsCache}getConstructorParams(){return{outlineSegment:this.outlineSegment,ccwFullOutline:this.ccwFullOutline,componentRotationDegrees:this.componentRotationDegrees,packStrategy:this.packStrategy,minGap:this.minGap,packedComponents:this.packedComponents,componentToPack:this.componentToPack,obstacles:this.obstacles,globalBounds:this.globalBounds,boundaryOutline:this.boundaryOutline,weightedConnections:this.weightedConnections,networkTargetPointMappingsCache:this.networkTargetPointMappingsCache}}_getOutlineBoundsWithMargin(e={}){let t=1/0,n=1/0,o=-1/0,r=-1/0;for(let[s,a]of this.ccwFullOutline)t=Math.min(t,s.x,a.x),n=Math.min(n,s.y,a.y),o=Math.max(o,s.x,a.x),r=Math.max(r,s.y,a.y);let i=e.margin??0;return{minX:t-i,minY:n-i,maxX:o+i,maxY:r+i}}_setup(){let[e,t]=this.outlineSegment,n=(T)=>{let N=this.projectPointOntoSegment(T,this.viableOutlineSegment);return this.adjustPositionForOutlineCollision(N)},o=Ycn(this.outlineSegment,this.ccwFullOutline),r=Avr(this.componentToPack,{rotationDegrees:this.componentRotationDegrees}),i=this._getOutlineBoundsWithMargin({margin:Math.max(r.maxX-r.minX,r.maxY-r.minY)*2+this.minGap*2});this.largestRectMidPoint={x:(e.x+t.x)/2,y:(e.y+t.y)/2},this.largestRectOrigin={x:this.largestRectMidPoint.x+o.x*0.0001,y:this.largestRectMidPoint.y+o.y*0.0001};let s=this.ccwFullOutline.flatMap(([T])=>T),a=0;for(let T=0;T<s.length;T++){let N=s[T],D=s[(T+1)%s.length];a+=N.x*D.y-D.x*N.y}a/=2;let l=a<0?"inside":"outside",h={ccwFullOutline:s,globalBounds:i,origin:this.largestRectOrigin,mode:l},d=new gvr(h);d.solve();let u=d.getLargestRectBounds();this.largestRectBounds=u;let _={x:Math.abs(Math.sign(this.outlineSegment[1].x-this.outlineSegment[0].x)),y:Math.abs(Math.sign(this.outlineSegment[1].y-this.outlineSegment[0].y))},p={minX:u.minX-r.minX*_.x,minY:u.minY-r.minY*_.y,maxX:u.maxX-r.maxX*_.x,maxY:u.maxY-r.maxY*_.y};if(this.boundaryOutline&&this.boundaryOutline.length>=3){let T=1/0,N=1/0,D=-1/0,L=-1/0;for(let H of this.boundaryOutline)T=Math.min(T,H.x),N=Math.min(N,H.y),D=Math.max(D,H.x),L=Math.max(L,H.y);p={minX:Math.max(p.minX,T-r.minX),minY:Math.max(p.minY,N-r.minY),maxX:Math.min(p.maxX,D-r.maxX),maxY:Math.min(p.maxY,L-r.maxY)}}this.viableBounds=p;let m=p.maxX-p.minX,A=p.maxY-p.minY,g=r.maxX-r.minX,f=r.maxY-r.minY;if(m<g||A<f){this.failed=!0,this.error="There is nowhere for the component to fit along this outline section";return}let y=Math.hypot(t.x-e.x,t.y-e.y),x=fvr(this.outlineSegment,y),[C,b]=x;this.viableOutlineSegment=[{x:td(C.x,p.minX,p.maxX),y:td(C.y,p.minY,p.maxY)},{x:td(b.x,p.minX,p.maxX),y:td(b.y,p.minY,p.maxY)}];let[I,v]=this.viableOutlineSegment,P=this.adjustPositionForOutlineCollision({x:(I.x+v.x)/2,y:(I.y+v.y)/2}),{offsetPadPoints:M,targetPointMap:B}=this.getNetworkTargetPointMappings();if(this.packStrategy==="minimum_closest_sum_squared_distance")this.twoPhaseIrlsSolver=new uvr({offsetPadPoints:M,targetPointMap:B,initialPosition:P,constraintFn:n,epsilon:0.000001,maxIterations:50});else this.irlsSolver=new xet({offsetPadPoints:M,targetPointMap:B,initialPosition:P,constraintFn:n,epsilon:0.000001,maxIterations:50,useSquaredDistance:this.packStrategy==="minimum_sum_squared_distance_to_network"})}_step(){let e=this.irlsSolver||this.twoPhaseIrlsSolver;if(!e){this.solved=!0;return}if(e.step(),e.solved){let t=e.getBestPosition();this.optimalPosition=t,this.solved=!0}else if(e.failed)this.failed=!0,this.error=e.error}getNetworkTargetPointMappings(){let e=this.networkTargetPointMappingsCache?.get(this.componentRotationDegrees);if(e)return e;let t=this.getRotatedComponentPads(),n=t.map((i)=>({id:i.padId,offsetX:i.offset.x,offsetY:i.offset.y})),o=new Map;for(let i of t){let s=[];for(let a of this.packedComponents)for(let c of a.pads)if(c.networkId===i.networkId){if(!A6e(i.padId,c.padId,this.weightedConnections))continue;s.push({...c.absoluteCenter,networkId:c.networkId})}o.set(i.padId,s)}let r={offsetPadPoints:n,targetPointMap:o};return this.networkTargetPointMappingsCache?.set(this.componentRotationDegrees,r),r}projectPointOntoSegment(e,t){let[n,o]=t,r=o.x-n.x,i=o.y-n.y,s=e.x-n.x,a=e.y-n.y,c=r*r+i*i;if(c===0)return{x:n.x,y:n.y};let l=Math.max(0,Math.min(1,(s*r+a*i)/c));return{x:n.x+l*r,y:n.y+l*i}}getRotatedComponentPads(){let e=this.componentRotationDegrees*Math.PI/180;return this.componentToPack.pads.map((t)=>({...t,size:(this.componentRotationDegrees+90)%180===0?{x:t.size.y,y:t.size.x}:t.size,offset:ck(t.offset,e)}))}createTemporaryPackedComponent(e){let t=this.componentRotationDegrees*Math.PI/180,n=(this.componentRotationDegrees+90)%180===0;return{componentId:this.componentToPack.componentId,center:e,ccwRotationOffset:this.componentRotationDegrees,pads:this.componentToPack.pads.map((o)=>{let r=ck(o.offset,t);return{...o,size:{x:n?o.size.y:o.size.x,y:n?o.size.x:o.size.y},absoluteCenter:{x:e.x+r.x,y:e.y+r.y}}}),courtyard:this.componentToPack.courtyard}}adjustPositionForOutlineCollision(e){let t=this.createTemporaryPackedComponent(e),n=fY(t,0),o=Ycn(this.outlineSegment,this.ccwFullOutline),r=Math.abs(o.x)>Math.abs(o.y),i=!r,s=e;if(r){let a=o.x>0,c=!a;if(a)s={x:n.maxX,y:e.y};else if(c)s={x:n.minX,y:e.y}}else if(i){let a=o.y>0,c=!a;if(a)s={x:e.x,y:n.maxY};else if(c)s={x:e.x,y:n.minY}}if(this.boundaryOutline&&this.boundaryOutline.length>=3){let a=this.createTemporaryPackedComponent(s),c=fY(a,0),l=a.pads.every((d)=>qq(d.absoluteCenter,this.boundaryOutline)),h=[{x:c.minX,y:c.minY},{x:c.minX,y:c.maxY},{x:c.maxX,y:c.minY},{x:c.maxX,y:c.maxY}].every((d)=>qq(d,this.boundaryOutline));if(!l||!h){if(this.viableBounds)s={x:td(s.x,this.viableBounds.minX,this.viableBounds.maxX),y:td(s.y,this.viableBounds.minY,this.viableBounds.maxY)}}}return s}visualize(){let e={lines:[],points:[],rects:[],circles:[]};if(this.obstacles&&this.obstacles.length>0)for(let s of this.obstacles)e.rects.push({center:s.absoluteCenter,width:s.width,height:s.height,fill:"rgba(0,0,0,0.1)",stroke:"#555",label:s.obstacleId});if(this.globalBounds)e.lines.push({points:[{x:this.globalBounds.minX,y:this.globalBounds.minY},{x:this.globalBounds.minX,y:this.globalBounds.maxY},{x:this.globalBounds.maxX,y:this.globalBounds.maxY},{x:this.globalBounds.maxX,y:this.globalBounds.minY},{x:this.globalBounds.minX,y:this.globalBounds.minY}],strokeColor:"rgba(255,0,255,0.5)",strokeDash:"2 2"});if(this.boundaryOutline&&this.boundaryOutline.length){let s=[...this.boundaryOutline];if(s.length>0&&(s[0].x!==s[s.length-1].x||s[0].y!==s[s.length-1].y))s.push({...s[0]});e.lines.push({points:s,strokeColor:"rgba(0, 0, 255, 0.5)",strokeDash:"4 2"})}if(this.viableBounds)e.rects.push({center:{x:(this.viableBounds.minX+this.viableBounds.maxX)/2,y:(this.viableBounds.minY+this.viableBounds.maxY)/2},width:this.viableBounds.maxX-this.viableBounds.minX,height:this.viableBounds.maxY-this.viableBounds.minY,fill:"rgba(0,255,0,0.1)",label:"Viable Bounds"});if(this.largestRectBounds)e.rects.push({center:{x:(this.largestRectBounds.minX+this.largestRectBounds.maxX)/2,y:(this.largestRectBounds.minY+this.largestRectBounds.maxY)/2},width:this.largestRectBounds.maxX-this.largestRectBounds.minX,height:this.largestRectBounds.maxY-this.largestRectBounds.minY,fill:"rgba(255,0,255,0.4)"});if(this.largestRectMidPoint)e.points.push({...this.largestRectMidPoint,label:"Largest Rect Mid Point",color:"rgba(128,0,255,1)"});if(this.largestRectOrigin)e.points.push({...this.largestRectOrigin,label:"Largest Rect Origin",color:"rgba(255,0,128,1)"});if(this.viableOutlineSegment){let[s,a]=this.viableOutlineSegment;e.lines.push({points:[s,a],strokeColor:"#2196F3"})}let[t,n]=this.outlineSegment;e.lines.push({points:[t,n],strokeColor:"rgba(255,0,0,1)",strokeDash:"3 3"});for(let[s,a]of this.ccwFullOutline)e.lines.push({points:[s,a],strokeColor:"rgba(0,0,0,0.5)",strokeDash:"4 4"});for(let s of this.packedComponents)for(let a of s.pads)e.rects.push({center:a.absoluteCenter,width:a.size.x,height:a.size.y,fill:Cet(a.networkId,0.5),stroke:"#333",label:`${a.padId} (${a.networkId})`});let o=this.optimalPosition??this.irlsSolver?.currentPosition??this.twoPhaseIrlsSolver?.currentPosition??{x:0,y:0},r=this.getRotatedComponentPads();for(let s of r){let a={x:o.x+s.offset.x,y:o.y+s.offset.y};e.rects.push({center:a,width:s.size.x,height:s.size.y,fill:this.failed?"rgba(255,0,0,0.5)":Cet(s.networkId,0.5),label:`${s.padId} (${s.networkId})`});for(let c of this.packedComponents)for(let l of c.pads)if(l.networkId===s.networkId){let h=A6e(s.padId,l.padId,this.weightedConnections);e.lines.push({points:[a,l.absoluteCenter],strokeColor:s.networkId==="VCC"?"#FF6B6B":"#4ECDC4",strokeDash:h?void 0:"4 2",label:`${s.networkId} ${h?"strong":"weak"}`})}}let i=this.irlsSolver||this.twoPhaseIrlsSolver;if(i){let s=i.currentPosition;e.points.push({...s,color:"#f44336"});let a=i.visualize();if(a.lines)e.lines.push(...a.lines);if(a.circles)e.circles.push(...a.circles);if(a.rects)e.rects.push(...a.rects);if(a.points)e.points.push(...a.points)}if(this.optimalPosition)e.points.push({...this.optimalPosition,color:"rgba(76, 175, 80, 0.3)"});return e}getOutput(){return this.optimalPosition??null}},bet=(e)=>{let t=[],n=[];if(e.boundaryOutline&&e.boundaryOutline.length){let i=[...e.boundaryOutline];if(i.length>0&&(i[0].x!==i[i.length-1].x||i[0].y!==i[i.length-1].y))i.push({...i[0]});n.push({points:i,strokeColor:"rgba(0, 0, 255, 0.5)",strokeDash:"4 2"})}let o=Array.from(new Set(e.components.flatMap((i)=>i.pads.map((s)=>s.networkId)))),r=_vr(o);if(e.obstacles&&e.obstacles.length>0)for(let i of e.obstacles)t.push({center:{x:i.absoluteCenter.x,y:i.absoluteCenter.y},width:i.width,height:i.height,fill:"rgba(0,0,0,0.1)",stroke:"#555",label:i.obstacleId});for(let i of e.components){let s=fY(i),a=s.maxX-s.minX,c=s.maxY-s.minY,l=Boolean(i.isStatic),h="rgba(33, 150, 243, 0.25)",d="rgba(33, 150, 243, 0.6)",u={center:{x:i.center.x,y:i.center.y},width:a,height:c,fill:l?"rgba(33, 150, 243, 0.25)":"rgba(0,0,0,0.25)",stroke:l?"rgba(33, 150, 243, 0.6)":void 0,label:[i.componentId,`ccwRotationOffset: ${i.ccwRotationOffset.toFixed(1)}°`].join(`
`)};t.push(u);for(let _ of i.pads){let{absoluteCenter:p,size:m,padId:A,networkId:g}=_,f={center:{x:p.x,y:p.y},width:m.x,height:m.y,label:`${A} ${g}`,fill:"rgba(255,0,0,0.8)"};t.push(f)}}for(let i of o){let s=e.components.flatMap((a)=>a.pads.filter((c)=>c.networkId===i));for(let a=0;a<s.length;a++)for(let c=a+1;c<s.length;c++){let l=s[a],h=s[c],d=A6e(l.padId,h.padId,e.weightedConnections);n.push({points:[l.absoluteCenter,h.absoluteCenter],strokeColor:r[i],strokeDash:d?void 0:"4 2"})}}return{coordinateSystem:"cartesian",rects:t,lines:n}};function ahe(e){if(e.courtyard){let t=e.courtyard,n=e.ccwRotationOffset*Math.PI/180,o=ck(t.offsetFromCenter,n),r=(e.ccwRotationOffset%360+360)%360,i=r===90||r===270,{width:s,height:a}=t;if(i)s=t.height,a=t.width;return[{center:{x:e.center.x+o.x,y:e.center.y+o.y},width:s,height:a}]}return e.pads.map((t)=>({center:{x:t.absoluteCenter.x,y:t.absoluteCenter.y},width:t.size.x,height:t.size.y}))}function Cvr({component:e,packedComponents:t,minGap:n}){let o=t.flatMap((i)=>ahe(i)),r=ahe(e);for(let i of r)for(let s of o){let{distance:a}=Ew(i,s);if(a+0.000001<n)return{hasOverlap:!0,gapDistance:a}}return{hasOverlap:!1}}var Gcn=class extends po{componentToPack;packedComponents;packPlacementStrategy;minGap;obstacles;boundaryOutline;weightedConnections;getSolverName(){return"SingleComponentPackSolver"}currentPhase="outline";outlines=[];queuedOutlineSegments=[];currentSegmentIndex=0;currentRotationIndex=0;activeSubSolver=null;candidateResults=[];rejectedCandidates=[];bestCandidate;outputPackedComponent;bounds;networkTargetPointMappingsCache=new Map;constructor(e){super();this.componentToPack=e.componentToPack,this.packedComponents=e.packedComponents,this.packPlacementStrategy=e.packPlacementStrategy,this.minGap=e.minGap??0,this.obstacles=e.obstacles??[],this.bounds=e.bounds,this.boundaryOutline=e.boundaryOutline,this.weightedConnections=e.weightedConnections}_setup(){super._setup(),this.currentPhase="outline",this.outlines=[],this.queuedOutlineSegments=[],this.candidateResults=[],this.activeSubSolver=void 0,this.currentSegmentIndex=0,this.currentRotationIndex=0,this.networkTargetPointMappingsCache.clear()}_step(){if(this.solved||this.failed)return;switch(this.currentPhase){case"outline":this.executeOutlinePhase();break;case"segment_candidate":this.executeSegmentCandidatePhase();break;case"evaluate":this.executeEvaluatePhase();break}}executeOutlinePhase(){if(this.packedComponents.length===0){let n=this.componentToPack.availableRotationDegrees??[0,90,180,270],o={x:0,y:0},r=n[0]??0,i=this.createPackedComponent(o,r),s=ahe(i);if(!(this.obstacles??[]).some((c)=>{let l={center:{x:c.absoluteCenter.x,y:c.absoluteCenter.y},width:c.width,height:c.height};return s.some((h)=>{let{distance:d}=Ew(h,l);return d+0.000001<this.minGap})})){this.outputPackedComponent=i,this.solved=!0;return}}this.outlines=hvr(this.packedComponents,{minGap:this.minGap,obstacles:this.obstacles});let e=this.componentToPack.availableRotationDegrees??[0,90,180,270];for(let n=0;n<this.outlines.length;n++){let o=this.outlines[n];for(let r=0;r<o.length;r++){let i=o[r];this.queuedOutlineSegments.push({segment:i,availableRotations:[...e],segmentIndex:n*1000+r,ccwFullOutline:o})}}if(this.boundaryOutline&&this.boundaryOutline.length>=3){let n=[];for(let r=0;r<this.boundaryOutline.length;r++){let i=this.boundaryOutline[r],s=this.boundaryOutline[(r+1)%this.boundaryOutline.length];n.push([i,s])}let o=this.outlines.length;for(let r=0;r<n.length;r++){let i=n[r];this.queuedOutlineSegments.push({segment:i,availableRotations:[...e],segmentIndex:o*1000+r,ccwFullOutline:n})}}let t=this.outlines.length+1;for(let n of this.obstacles){let o=n.width/2+this.minGap,r=n.height/2+this.minGap,i=n.absoluteCenter.x,s=n.absoluteCenter.y,a=[{x:i-o,y:s-r},{x:i+o,y:s-r},{x:i+o,y:s+r},{x:i-o,y:s+r}],c=[[a[0],a[1]],[a[1],a[2]],[a[2],a[3]],[a[3],a[0]]];for(let l=0;l<c.length;l++){let h=c[l];this.queuedOutlineSegments.push({segment:h,availableRotations:[...e],segmentIndex:t*1000+l,ccwFullOutline:c})}t++}this.currentPhase="segment_candidate",this.currentSegmentIndex=0,this.currentRotationIndex=0}executeSegmentCandidatePhase(){if(this.activeSubSolver?.solved||this.activeSubSolver?.failed){let e=this.queuedOutlineSegments[this.currentSegmentIndex],t=e.availableRotations[this.currentRotationIndex],n=1/0,o;if(this.activeSubSolver.solved&&this.activeSubSolver.optimalPosition){o=this.activeSubSolver.optimalPosition;let r=this.createPackedComponent(o,t),{hasOverlap:i,gapDistance:s}=Cvr({component:r,packedComponents:this.packedComponents,minGap:this.minGap}),a=1/0,c=ahe(r),l=(this.obstacles??[]).some((u)=>{let _={center:{x:u.absoluteCenter.x,y:u.absoluteCenter.y},width:u.width,height:u.height};return c.some((p)=>{let{distance:m}=Ew(p,_);return a=Math.min(a,m),m+0.000001<this.minGap})}),h=!1;if(this.bounds){let u=fY(r,0);h=u.minX<this.bounds.minX||u.maxX>this.bounds.maxX||u.minY<this.bounds.minY||u.maxY>this.bounds.maxY}let d=!1;if(this.boundaryOutline&&this.boundaryOutline.length>=3){let u=fY(r,0),_=r.pads.every((m)=>qq(m.absoluteCenter,this.boundaryOutline)),p=[{x:u.minX,y:u.minY},{x:u.minX,y:u.maxY},{x:u.maxX,y:u.minY},{x:u.maxX,y:u.maxY}].every((m)=>qq(m,this.boundaryOutline));d=!_||!p}if(n=this.calculateDistance(o,t),i)this.rejectedCandidates.push({segment:e.segment,rotation:t,optimalPosition:o,distance:n,segmentIndex:e.segmentIndex,rotationIndex:this.currentRotationIndex,gapDistance:s});else if(l)this.rejectedCandidates.push({segment:e.segment,rotation:t,optimalPosition:o,distance:n,segmentIndex:e.segmentIndex,rotationIndex:this.currentRotationIndex,gapDistance:a});else if(h)this.rejectedCandidates.push({segment:e.segment,rotation:t,optimalPosition:o,distance:n,segmentIndex:e.segmentIndex,rotationIndex:this.currentRotationIndex,gapDistance:-1});else if(d)this.rejectedCandidates.push({segment:e.segment,rotation:t,optimalPosition:o,distance:n,segmentIndex:e.segmentIndex,rotationIndex:this.currentRotationIndex,gapDistance:-1});else this.candidateResults.push({segment:e.segment,rotation:t,optimalPosition:o,distance:n,segmentIndex:e.segmentIndex,rotationIndex:this.currentRotationIndex})}this.currentRotationIndex++,this.activeSubSolver=void 0}while(!this.activeSubSolver){if(this.currentSegmentIndex>=this.queuedOutlineSegments.length){this.currentPhase="evaluate";return}let e=this.queuedOutlineSegments[this.currentSegmentIndex];if(this.currentRotationIndex>=e.availableRotations.length){this.currentSegmentIndex++,this.currentRotationIndex=0;continue}let t=e.availableRotations[this.currentRotationIndex];this.activeSubSolver=new xvr({outlineSegment:e.segment,ccwFullOutline:e.ccwFullOutline,componentRotationDegrees:t,packStrategy:this.packPlacementStrategy,minGap:this.minGap,packedComponents:this.packedComponents,componentToPack:this.componentToPack,obstacles:this.obstacles,globalBounds:this.bounds,boundaryOutline:this.boundaryOutline,weightedConnections:this.weightedConnections,networkTargetPointMappingsCache:this.networkTargetPointMappingsCache}),this.activeSubSolver.setup();break}this.activeSubSolver.step()}executeEvaluatePhase(){if(this.candidateResults.length===0){this.failed=!0,this.error="No valid candidates found";return}if(this.candidateResults.sort((e,t)=>e.distance-t.distance),this.bestCandidate=this.candidateResults[0],this.bestCandidate.optimalPosition)this.outputPackedComponent=this.createPackedComponent(this.bestCandidate.optimalPosition,this.bestCandidate.rotation);this.solved=!0}calculateDistance(e,t){let n=this.createPackedComponent(e,t),o=0,r=this.packPlacementStrategy==="minimum_sum_squared_distance_to_network"||this.packPlacementStrategy==="minimum_closest_sum_squared_distance";for(let i of n.pads){let s=1/0;for(let a of this.packedComponents)for(let c of a.pads)if(c.networkId===i.networkId){if(!A6e(i.padId,c.padId,this.weightedConnections))continue;let l=i.absoluteCenter.x-c.absoluteCenter.x,h=i.absoluteCenter.y-c.absoluteCenter.y,d=Math.sqrt(l*l+h*h);s=Math.min(s,d)}if(s<1/0)o+=r?s*s:s}return o}createPackedComponent(e,t){let n={...this.componentToPack,center:e,ccwRotationOffset:t,pads:this.componentToPack.pads.map((o)=>({...o,absoluteCenter:{x:0,y:0}}))};return g6e(n),n}visualize(){if(this.activeSubSolver)return this.activeSubSolver.visualize();let e=bet({components:this.packedComponents,minGap:this.minGap,packOrderStrategy:"largest_to_smallest",packPlacementStrategy:this.packPlacementStrategy});if(e.points??=[],e.lines??=[],e.rects??=[],e.texts??=[],e.circles??=[],this.obstacles&&this.obstacles.length>0)for(let t of this.obstacles)e.rects.push({center:t.absoluteCenter,width:t.width,height:t.height,fill:"rgba(0,0,0,0.1)",stroke:"#555",label:t.obstacleId});if(this.bounds)e.lines.push({points:[{x:this.bounds.minX,y:this.bounds.minY},{x:this.bounds.minX,y:this.bounds.maxY},{x:this.bounds.maxX,y:this.bounds.maxY},{x:this.bounds.maxX,y:this.bounds.minY},{x:this.bounds.minX,y:this.bounds.minY}],strokeColor:"rgba(0,0,0,0.5)",strokeDash:"2 2"});if(this.boundaryOutline&&this.boundaryOutline.length){let t=[...this.boundaryOutline];if(t.length>0&&(t[0].x!==t[t.length-1].x||t[0].y!==t[t.length-1].y))t.push({...t[0]});e.lines.push({points:t,strokeColor:"rgba(0, 0, 255, 0.5)",strokeDash:"4 2"})}switch(this.currentPhase){case"outline":this.visualizeOutlinePhase(e);break;case"segment_candidate":this.visualizeSegmentCandidatePhase(e);break;case"evaluate":this.visualizeEvaluatePhase(e);break}return e}visualizeOutlinePhase(e){for(let t of this.outlines)for(let n of t){let[o,r]=n;e.lines.push({points:[o,r],strokeColor:"#ff4444"})}for(let t=0;t<this.outlines.length;t++){let n=this.outlines[t];for(let o=0;o<n.length;o++){let[r,i]=n[o];e.points.push({x:r.x,y:r.y,label:`outlines [${t}] [${o}]`,color:"#ff4444"})}}}visualizeSegmentCandidatePhase(e){if(this.visualizeOutlinePhase(e),this.activeSubSolver){let t=this.activeSubSolver.visualize();if(t.lines)e.lines.push(...t.lines);if(t.points)e.points.push(...t.points);if(t.rects)e.rects.push(...t.rects);if(t.circles)e.circles.push(...t.circles??[])}else for(let t=0;t<this.candidateResults.length;t++){let n=this.candidateResults[t];if(n.optimalPosition){let o=this.createPackedComponent(n.optimalPosition,n.rotation);for(let r of o.pads)e.rects.push({center:r.absoluteCenter,width:r.size.x,height:r.size.y,fill:"rgba(255,165,0,0.3)",stroke:"rgba(255,165,0,0.8)",strokeWidth:1});e.points.push({x:n.optimalPosition.x,y:n.optimalPosition.y,label:`c${t}, d=${n.distance.toFixed(3)}`,color:"rgba(255,165,0,0.8)"})}}}visualizeEvaluatePhase(e){this.visualizeOutlinePhase(e);for(let t=0;t<this.candidateResults.length;t++){let n=this.candidateResults[t];if(!n.optimalPosition)continue;let o=t,r=o===0;e.points.push({x:n.optimalPosition.x,y:n.optimalPosition.y,label:`step=${o}, d=${n.distance.toFixed(3)}`,color:r?"rgba(0,255,0,0.8)":"rgba(255,165,0,0.6)"})}for(let t=0;t<this.rejectedCandidates.length;t++){let n=this.rejectedCandidates[t];if(!n.optimalPosition)continue;e.points.push({x:n.optimalPosition.x,y:n.optimalPosition.y,label:`rejected, d=${n.distance.toFixed(3)}
gap_distance=${n.gapDistance}`,color:"rgba(255,0,0,0.8)"})}if(this.outputPackedComponent)for(let t of this.outputPackedComponent.pads)e.rects.push({center:t.absoluteCenter,width:t.size.x,height:t.size.y,fill:"rgba(0,255,0,0.7)"})}getResult(){return this.outputPackedComponent}getOutput(){return this.getResult()}getConstructorParams(){return{componentToPack:this.componentToPack,packedComponents:this.packedComponents,packPlacementStrategy:this.packPlacementStrategy,minGap:this.minGap,obstacles:this.obstacles,bounds:this.bounds,boundaryOutline:this.boundaryOutline,weightedConnections:this.weightedConnections}}};function bvr(e){if(e.length<3){let i=e.reduce((a,c)=>a+c.x,0),s=e.reduce((a,c)=>a+c.y,0);return{x:i/e.length,y:s/e.length}}let t=0,n=0,o=0;for(let i=0;i<e.length;i++){let s=e[i],a=e[(i+1)%e.length],c=s.x*a.y-a.x*s.y;t+=c,n+=(s.x+a.x)*c,o+=(s.y+a.y)*c}if(t*=0.5,Math.abs(t)<0.0000000001){let i=e.reduce((a,c)=>a+c.x,0),s=e.reduce((a,c)=>a+c.y,0);return{x:i/e.length,y:s/e.length}}return n/=6*t,o/=6*t,{x:n,y:o}}var BB=class extends po{packInput;getSolverName(){return"PackSolver2"}unpackedComponentQueue=[];packedComponents=[];componentToPack;constructor(e){super();this.MAX_ITERATIONS=300000,this.packInput=e}getConstructorParams(){return this.packInput}_setup(){let{components:e,packOrderStrategy:t,packFirst:n=[]}=this.packInput,o=e.filter((s)=>{if(s.pads.length===0)return!1;return s.pads.every((a)=>Number.isFinite(a.size.x)&&Number.isFinite(a.size.y)&&a.size.x>0&&a.size.y>0)}),r=o.filter((s)=>s.isStatic),i=o.filter((s)=>!s.isStatic);this.packedComponents=r.map((s)=>{let a={...s,center:s.center??{x:0,y:0},ccwRotationOffset:s.ccwRotationOffset??s.availableRotationDegrees?.[0]??0,pads:s.pads.map((c)=>({...c,absoluteCenter:c.absoluteCenter??{x:0,y:0}}))};return g6e(a),a}),this.unpackedComponentQueue=tvr({components:i,packOrderStrategy:t,packFirst:n})}packFirstComponent(){let e=this.unpackedComponentQueue.shift(),t={x:0,y:0};if(this.packInput.boundaryOutline&&this.packInput.boundaryOutline.length>=3)t=bvr(this.packInput.boundaryOutline);let n={...e,center:t,ccwRotationOffset:e.ccwRotationOffset??e.availableRotationDegrees?.[0]??0,pads:e.pads.map((l)=>({...l,absoluteCenter:{x:0,y:0}}))};g6e(n);let o=this.packInput.obstacles??[],r=ahe(n),i=o.some((l)=>{let h={center:{x:l.absoluteCenter.x,y:l.absoluteCenter.y},width:l.width,height:l.height};return r.some((d)=>{let{distance:u}=Ew(d,h);return u+0.000001<this.packInput.minGap})}),s=!1;if(this.packInput.boundaryOutline&&this.packInput.boundaryOutline.length>=3){let l=fY(n,0),h=n.pads.every((u)=>qq(u.absoluteCenter,this.packInput.boundaryOutline)),d=[{x:l.minX,y:l.minY},{x:l.minX,y:l.maxY},{x:l.maxX,y:l.minY},{x:l.maxX,y:l.maxY}].every((u)=>qq(u,this.packInput.boundaryOutline));s=!h||!d}if(!i&&!s){this.packedComponents.push(n);return}let a=new Gcn({packedComponents:[],componentToPack:e,packPlacementStrategy:this.packInput.packPlacementStrategy,minGap:this.packInput.minGap,obstacles:o,bounds:this.packInput.bounds,boundaryOutline:this.packInput.boundaryOutline,weightedConnections:this.packInput.weightedConnections});a.solve();let c=a.getResult();if(c)this.packedComponents.push(c);else this.packedComponents.push(n)}_step(){if(this.solved||this.failed)return;if(this.packedComponents.length===0){if(this.unpackedComponentQueue.length===0){this.solved=!0;return}this.packFirstComponent();return}if(!this.activeSubSolver){if(this.unpackedComponentQueue.length===0){this.solved=!0;return}if(this.componentToPack=this.unpackedComponentQueue.shift(),!this.componentToPack){this.solved=!0;return}this.activeSubSolver=new Gcn({packedComponents:this.packedComponents,componentToPack:this.componentToPack,packPlacementStrategy:this.packInput.packPlacementStrategy,minGap:this.packInput.minGap,obstacles:this.packInput.obstacles??[],bounds:this.packInput.bounds,boundaryOutline:this.packInput.boundaryOutline,weightedConnections:this.packInput.weightedConnections}),this.activeSubSolver.setup()}if(this.activeSubSolver.step(),this.activeSubSolver.failed){this.failed=!0;return}if(this.activeSubSolver.solved){let e=this.activeSubSolver.getResult();if(e)this.packedComponents.push(e);else{let t={...this.componentToPack,center:{x:0,y:0},ccwRotationOffset:this.componentToPack?.ccwRotationOffset??this.componentToPack?.availableRotationDegrees?.[0]??0,pads:this.componentToPack.pads.map((n)=>({...n,absoluteCenter:{x:0,y:0}}))};g6e(t),this.packedComponents.push(t)}this.componentToPack=void 0,this.activeSubSolver=void 0}}visualize(){if(this.activeSubSolver)return this.activeSubSolver.visualize();let e={coordinateSystem:"cartesian",title:"Pack Solver 2",points:[],lines:[],rects:[],circles:[],texts:[],arrows:[]};if(this.packInput.obstacles&&this.packInput.obstacles.length>0)for(let o of this.packInput.obstacles)e.rects.push({center:o.absoluteCenter,width:o.width,height:o.height,fill:"rgba(0,0,0,0.1)",stroke:"#555",label:o.obstacleId});if(this.packInput.bounds)e.lines.push({points:[{x:this.packInput.bounds.minX,y:this.packInput.bounds.minY},{x:this.packInput.bounds.minX,y:this.packInput.bounds.maxY},{x:this.packInput.bounds.maxX,y:this.packInput.bounds.maxY},{x:this.packInput.bounds.maxX,y:this.packInput.bounds.minY},{x:this.packInput.bounds.minX,y:this.packInput.bounds.minY}],strokeColor:"rgba(0,0,0,0.5)",strokeDash:"2 2"});if(this.packInput.boundaryOutline&&this.packInput.boundaryOutline.length){let o=[...this.packInput.boundaryOutline];if(o.length>0&&(o[0].x!==o[o.length-1].x||o[0].y!==o[o.length-1].y))o.push({...o[0]});e.lines.push({points:o,strokeColor:"rgba(0, 0, 255, 0.5)",strokeDash:"4 2"})}if(this.packedComponents.length===0)for(let o of this.unpackedComponentQueue)for(let r of o.pads)e.rects.push({center:{x:0,y:0},width:r.size.x,height:r.size.y,fill:"rgba(0,0,0,0.1)"});let t=this.packedComponents.flatMap((o)=>o.pads),n=new Map;for(let o of t)if(o.networkId)n.set(o.networkId,[...n.get(o.networkId)||[],o]);for(let o of t)e.rects.push({center:o.absoluteCenter,width:o.size.x,height:o.size.y,fill:"rgba(255,0,0,0.5)"});for(let[o,r]of n.entries())for(let i=0;i<r.length;i++)for(let s=i+1;s<r.length;s++){let a=r[i],c=r[s];e.lines.push({points:[a.absoluteCenter,c.absoluteCenter],strokeColor:Cet(o,0.5)})}return e}getOutput(){return{packedComponents:this.packedComponents,unpackedComponents:this.unpackedComponentQueue}}},jcn=(e)=>{let t=new BB(e);return t.solve(),{...e,components:t.packedComponents}},Ivr=(e)=>{if(!e||e.length===0)return{minX:0,maxX:0,minY:0,maxY:0};let t=1/0,n=1/0,o=-1/0,r=-1/0;for(let i of e)t=Math.min(t,i.x),o=Math.max(o,i.x),n=Math.min(n,i.y),r=Math.max(r,i.y);return{minX:t,maxX:o,minY:n,maxY:r}},fet=(e)=>{let{width:t,height:n,ccwRotationDegrees:o}=e,r=o*Math.PI/180,i=(c)=>{let l=Math.abs(c);if(l<0.000000000001)return 0;if(Math.abs(l-1)<0.000000000001)return 1;return l},s=i(Math.cos(r)),a=i(Math.sin(r));return{width:t*s+n*a,height:t*a+n*s}},Kcn=(e,t,n)=>{let o=[],r=({padId:i,pcbPortId:s,sx:a,sy:c,x:l,y:h})=>o.push({padId:i,networkId:n(s),size:{x:a,y:c},absoluteCenter:{x:l,y:h},pcbPortId:s});for(let i of t.pcb_via.list({pcb_component_id:e.pcb_component_id}))r({padId:i.pcb_via_id,pcbPortId:i.pcb_port_id,sx:i.outer_diameter??i.hole_diameter??0,sy:i.outer_diameter??i.hole_diameter??0,x:i.x,y:i.y});for(let i of t.pcb_plated_hole.list({pcb_component_id:e.pcb_component_id}))switch(i.shape){case"circle":{r({padId:i.pcb_plated_hole_id,pcbPortId:i.pcb_port_id,sx:i.outer_diameter??i.hole_diameter??0,sy:i.outer_diameter??i.hole_diameter??0,x:i.x,y:i.y});break}case"oval":case"pill":{let s=fet({width:i.outer_width,height:i.outer_height,ccwRotationDegrees:i.ccw_rotation});r({padId:i.pcb_plated_hole_id,pcbPortId:i.pcb_port_id,sx:s.width,sy:s.height,x:i.x,y:i.y});break}case"circular_hole_with_rect_pad":{r({padId:i.pcb_plated_hole_id,pcbPortId:i.pcb_port_id,sx:i.rect_pad_width,sy:i.rect_pad_height,x:i.x,y:i.y});break}case"pill_hole_with_rect_pad":{r({padId:i.pcb_plated_hole_id,pcbPortId:i.pcb_port_id,sx:i.rect_pad_width,sy:i.rect_pad_height,x:i.x,y:i.y});break}case"rotated_pill_hole_with_rect_pad":{let s=fet({width:i.rect_pad_width,height:i.rect_pad_height,ccwRotationDegrees:i.rect_ccw_rotation});r({padId:i.pcb_plated_hole_id,pcbPortId:i.pcb_port_id,sx:s.width,sy:s.height,x:i.x,y:i.y});break}default:{console.warn(`Unsupported plated hole shape ${i.shape}`);break}}for(let i of t.pcb_smtpad.list({pcb_component_id:e.pcb_component_id}))switch(i.shape){case"rect":{r({padId:i.pcb_smtpad_id,pcbPortId:i.pcb_port_id,sx:i.width??0,sy:i.height??0,x:i.x,y:i.y});break}case"pill":{r({padId:i.pcb_smtpad_id,pcbPortId:i.pcb_port_id,sx:i.width,sy:i.height,x:i.x,y:i.y});break}case"rotated_rect":case"rotated_pill":{let s=fet({width:i.width,height:i.height,ccwRotationDegrees:i.ccw_rotation});r({padId:i.pcb_smtpad_id,pcbPortId:i.pcb_port_id,sx:s.width,sy:s.height,x:i.x,y:i.y});break}case"circle":{r({padId:i.pcb_smtpad_id,pcbPortId:i.pcb_port_id,sx:i.radius*2,sy:i.radius*2,x:i.x,y:i.y});break}case"polygon":{if(i.points&&i.points.length>0){let{minX:s,maxX:a,minY:c,maxY:l}=Ivr(i.points),h=a-s,d=l-c,u=(s+a)/2,_=(c+l)/2;r({padId:i.pcb_smtpad_id,pcbPortId:i.pcb_port_id,sx:h,sy:d,x:u,y:_})}else console.warn(`Polygon pad ${i.pcb_smtpad_id} has no points`);break}}return o},vvr=(e,t)=>{let n=new Set,o=(i)=>{if(!i)return;if(i.nodeType==="component"){let s=i.otherChildElements?.[0]?.pcb_component_id;if(s)n.add(s)}for(let s of i.childNodes??[])o(s)};o(t);let r=[];for(let i of e.pcb_plated_hole.list({})){if(!("pcb_component_id"in i)||!i.pcb_component_id){r.push(i);continue}if(!n.has(i.pcb_component_id))r.push(i)}for(let i of e.pcb_hole.list({}))r.push(i);return r},Svr=(e,t,n)=>{let o=n*Math.PI/180,r=Math.abs(Math.cos(o)),i=Math.abs(Math.sin(o));return{width:e*r+t*i,height:e*i+t*r}},Pvr=(e)=>{if(e.type==="pcb_plated_hole"&&e.shape==="circular_hole_with_rect_pad"){let{rect_pad_height:t,rect_pad_width:n,x:o,y:r}=e;return{obstacleId:e.pcb_plated_hole_id,absoluteCenter:{x:o,y:r},width:n,height:t}}if(e.type==="pcb_plated_hole"&&e.shape==="rotated_pill_hole_with_rect_pad"){let{rect_pad_height:t,rect_pad_width:n,rect_ccw_rotation:o,x:r,y:i}=e,s=Svr(n,t,o);return{obstacleId:e.pcb_plated_hole_id,absoluteCenter:{x:r,y:i},width:s.width,height:s.height}}if(e.type==="pcb_hole"){let{x:t,y:n,pcb_hole_id:o}=e,r="hole_diameter"in e?e.hole_diameter:e.hole_width,i="hole_diameter"in e?e.hole_diameter:e.hole_height;return{obstacleId:o,absoluteCenter:{x:t,y:n},width:r,height:i}}return},$cn=(e)=>{let{db:t,pcbComponentIds:n,componentCenter:o}=e;if(Array.from(new Set(n)).length!==1)return;let i=new Set(n),s=1/0,a=1/0,c=-1/0,l=-1/0,h=!1;for(let _ of t.pcb_courtyard_rect.list()){if(!i.has(_.pcb_component_id))continue;s=Math.min(s,_.center.x-_.width/2),c=Math.max(c,_.center.x+_.width/2),a=Math.min(a,_.center.y-_.height/2),l=Math.max(l,_.center.y+_.height/2),h=!0}for(let _ of t.pcb_courtyard_polygon.list()){if(!i.has(_.pcb_component_id))continue;for(let p of _.points)s=Math.min(s,p.x),c=Math.max(c,p.x),a=Math.min(a,p.y),l=Math.max(l,p.y);h=!0}for(let _ of t.pcb_courtyard_outline.list()){if(!i.has(_.pcb_component_id))continue;for(let p of _.outline)s=Math.min(s,p.x),c=Math.max(c,p.x),a=Math.min(a,p.y),l=Math.max(l,p.y);h=!0}for(let _ of t.pcb_courtyard_circle.list()){if(!i.has(_.pcb_component_id))continue;s=Math.min(s,_.center.x-_.radius),c=Math.max(c,_.center.x+_.radius),a=Math.min(a,_.center.y-_.radius),l=Math.max(l,_.center.y+_.radius),h=!0}if(!h)return;let d=(s+c)/2,u=(a+l)/2;return{offsetFromCenter:{x:d-o.x,y:u-o.y},width:c-s,height:l-a}},Ucn=(e,t,n,o,r,i=new Map,s={},a=!1)=>{let c=e.flatMap((A)=>{let g=Kcn(A,n,o),f=s[A.pcb_component_id];if(!f)return g;return g.map((y)=>({...y,size:{x:y.size.x+f.left+f.right,y:y.size.y+f.top+f.bottom},absoluteCenter:{x:y.absoluteCenter.x+(f.right-f.left)/2,y:y.absoluteCenter.y+(f.top-f.bottom)/2}}))}),l=1/0,h=1/0,d=-1/0,u=-1/0;for(let A of c)l=Math.min(l,A.absoluteCenter.x-A.size.x/2),d=Math.max(d,A.absoluteCenter.x+A.size.x/2),h=Math.min(h,A.absoluteCenter.y-A.size.y/2),u=Math.max(u,A.absoluteCenter.y+A.size.y/2);let _={x:(l+d)/2,y:(h+u)/2},p=c.map((A)=>({padId:A.padId,networkId:A.networkId,type:"rect",size:A.size,absoluteCenter:A.absoluteCenter,offset:{x:A.absoluteCenter.x-_.x,y:A.absoluteCenter.y-_.y}}));for(let A of c){if(!A.pcbPortId)continue;let g=n.pcb_port.get(A.pcbPortId)?.source_port_id;if(!g)continue;let f=i.get(g)??[];f.push(A.padId),i.set(g,f)}if(r){let A={padId:`${t}-inner`,networkId:`${t}-inner`,type:"rect",size:{x:d-l,y:u-h},absoluteCenter:_,offset:{x:0,y:0}};p.push(A)}let m=$cn({db:n,pcbComponentIds:e.map((A)=>A.pcb_component_id),componentCenter:_});return{componentId:t,isStatic:a,center:_,ccwRotationOffset:0,pads:p,courtyard:m}},qcn=(e,t)=>{if(e.nodeType==="component"){let n=e.otherChildElements[0]?.pcb_component_id;return n?[t.pcb_component.get(n)]:[]}return e.childNodes.flatMap((n)=>qcn(n,t))},Jcn=(e,t={})=>{let n={components:[],minGap:0,packOrderStrategy:"largest_to_smallest",packPlacementStrategy:"shortest_connection_along_outline",obstacles:t.obstacles??[]},o=Pw(e,{source_group_id:t.source_group_id}),r=Ps(e),i=0,s=new Map,a=vvr(r,o),c=e.find((f)=>f.type==="pcb_board");if(c?.outline)n.boundaryOutline=c.outline;let l=(f)=>{if(f){let y=r.pcb_port.get(f);if(y){let x=r.source_port.get(y.source_port_id);if(x?.subcircuit_connectivity_map_key)return x.subcircuit_connectivity_map_key}}return`unnamed${i++}`},h=o.childNodes??[],d=(f)=>{let y=[];if(f.nodeType==="component"){let x=f.otherChildElements.find((C)=>C.type==="pcb_component");if(x&&x.position_mode==="relative_to_group_anchor")y.push(x)}for(let x of f.childNodes??[])y.push(...d(x));return y},u=new Set(t.staticPcbComponentIds??[]),_=new Set;for(let f of h)if(f.nodeType==="component"){let y=f.otherChildElements.find((C)=>C.type==="pcb_component");if(!y)continue;if(y.position_mode==="relative_to_group_anchor"&&!u.has(y.pcb_component_id))continue;let x=t.shouldAddInnerObstacles??!1;if(y.obstructs_within_bounds===!0)x=!0;else if(y.obstructs_within_bounds===!1)x=!1;n.components.push(Ucn([y],y.pcb_component_id,r,l,x,s,t.chipMarginsMap,u.has(y.pcb_component_id)))}else if(f.nodeType==="group"){let y=qcn(f,r);if(!y.length)continue;for(let C of y)_.add(C.pcb_component_id);let x=f.sourceGroup?.source_group_id??f.sourceGroup?.name??`group_${n.components.length}`;n.components.push(Ucn(y,x,r,l,void 0,s,t.chipMarginsMap,u.has(x)))}let p=h.flatMap((f)=>d(f));for(let f of p){if(u.has(f.pcb_component_id))continue;if(_.has(f.pcb_component_id))continue;let y=$cn({db:r,pcbComponentIds:[f.pcb_component_id],componentCenter:f.center});if(y){n.obstacles.push({obstacleId:f.pcb_component_id,absoluteCenter:{x:f.center.x+y.offsetFromCenter.x,y:f.center.y+y.offsetFromCenter.y},width:y.width,height:y.height});continue}let x=Kcn(f,r,l);if(x.length===0)continue;let C=1/0,b=1/0,I=-1/0,v=-1/0;for(let T of x)C=Math.min(C,T.absoluteCenter.x-T.size.x/2),I=Math.max(I,T.absoluteCenter.x+T.size.x/2),b=Math.min(b,T.absoluteCenter.y-T.size.y/2),v=Math.max(v,T.absoluteCenter.y+T.size.y/2);let P={x:(C+I)/2,y:(b+v)/2},M=I-C,B=v-b;n.obstacles.push({obstacleId:f.pcb_component_id,absoluteCenter:P,width:M,height:B})}for(let f of a){let y=Pvr(f);if(y)n.obstacles.push(y)}let m=[],A=new Set,g=typeof r.source_trace.list==="function"?r.source_trace.list():e.filter((f)=>f.type==="source_trace");for(let f of g){let y=f.connected_source_port_ids||[],x=f.connected_source_net_ids||[];if(!(y.length===2&&x.length===0))continue;let[b,I]=y,v=b?s.get(b)??[]:[],P=I?s.get(I)??[]:[];for(let M of v)for(let B of P){let T=[M,B].sort().join("--");if(A.has(T))continue;m.push({padIds:[M,B],weight:1,ignoreWeakConnections:!0}),A.add(T)}}if(m.length>0)n.weightedConnections=m;return n},Zcn=(e)=>{let t=e.components.map((n)=>({...n.isStatic?{...n,pads:n.pads.map((o)=>({...o}))}:{componentId:n.componentId,availableRotationDegrees:n.availableRotationDegrees,pads:n.pads.map(({absoluteCenter:o,...r})=>r),courtyard:n.courtyard}}));return{...e,components:t}};var B6e=at(As(),1);var ef=class{MAX_ITERATIONS=200000;solved=!1;failed=!1;iterations=0;progress=0;error=null;activeSubSolver;failedSubSolvers;timeToSolve;stats={};step(){if(this.solved)return;if(this.failed)return;this.iterations++;try{this._step()}catch(e){throw this.error=`${this.constructor.name} error: ${e}`,this.failed=!0,e}if(!this.solved&&this.iterations>this.MAX_ITERATIONS)this.tryFinalAcceptance();if(!this.solved&&this.iterations>this.MAX_ITERATIONS)this.error=`${this.constructor.name} ran out of iterations`,this.failed=!0;if("computeProgress"in this)this.progress=this.computeProgress()}_step(){}getConstructorParams(){throw Error("getConstructorParams not implemented")}solve(){let e=Date.now();while(!this.solved&&!this.failed)this.step();let t=Date.now();this.timeToSolve=t-e}visualize(){return{lines:[],points:[],rects:[],circles:[]}}tryFinalAcceptance(){}preview(){return{lines:[],points:[],rects:[],circles:[]}}};function Iet(e,t){let n=t*Math.PI/180,o=Math.cos(n),r=Math.sin(n);return{x:e.x*o-e.y*r,y:e.x*r+e.y*o}}function Evr(e,t,n){let o=(n%360+360)%360;if(Math.round((o+90)%180)===0)return{width:t,height:e};return{width:e,height:t}}function Mvr(e,t){let n=Math.min(e,t);return Math.min(0.35,Math.max(0.08,n*0.22))}function wvr(e,t=!1){let n=e.charAt(0).toUpperCase();if(t){if(n==="C")return"rgba(30, 64, 175, 0.35)";if(n==="R")return"rgba(5, 150, 105, 0.35)";if(n==="L")return"rgba(126, 34, 206, 0.35)";if(n==="U")return"rgba(180, 83, 9, 0.35)"}if(n==="C")return"rgba(59, 130, 246, 0.18)";if(n==="R")return"rgba(16, 185, 129, 0.18)";if(n==="L")return"rgba(168, 85, 247, 0.18)";if(n==="U")return"rgba(245, 158, 11, 0.18)";return"rgba(59, 130, 246, 0.12)"}function Sp(e,t){let n={points:[],rects:[],lines:[],circles:[],texts:[]},o={};for(let a of Object.keys(e.netConnMap)){let[c,l]=a.split("-");o[c]=l}for(let[a,c]of Object.entries(e.chipMap)){let l=c.pins.map((g)=>e.chipPinMap[g]),h=t.chipPlacements[a];if(!h)continue;let d,u;if(c.size&&Number.isFinite(c.size.x)&&Number.isFinite(c.size.y))d=c.size.x,u=c.size.y;else{let g=l.map((I)=>I.offset.x),f=l.map((I)=>I.offset.y),y=g.length?Math.min(...g):-5,x=g.length?Math.max(...g):5,C=f.length?Math.min(...f):-5,b=f.length?Math.max(...f):5;d=Math.max(10,x-y+6),u=Math.max(10,b-C+6)}let{x:_,y:p}=h,m=Evr(d,u,h.ccwRotationDegrees),A=c.fixedPosition?`${a} [fixed]`:a;n.rects.push({center:{x:_,y:p},width:m.width,height:m.height,label:A,fill:wvr(a,Boolean(c.fixedPosition)),stroke:"none"}),n.texts.push({x:_,y:p,text:A,fontSize:Mvr(m.width,m.height)});for(let g of l){let f=Iet(g.offset,h.ccwRotationDegrees),y=h.x+f.x,x=h.y+f.y,C=o[g.pinId],b=C?`${g.pinId} (${C})`:g.pinId;n.points.push({x:y,y:x,label:b})}}let r={};for(let[a,c]of Object.entries(o)){if(!r[c])r[c]=[];r[c].push(a)}for(let[,a]of Object.entries(r)){let c=a.map((l)=>{let h=e.chipPinMap[l];if(h){for(let[d,u]of Object.entries(e.chipMap))if(u.pins.includes(l)){let _=t.chipPlacements[d];if(_){let p=Iet(h.offset,_.ccwRotationDegrees);return{x:_.x+p.x,y:_.y+p.y}}}return h.offset}return null}).filter(Boolean);for(let l=0;l<c.length;l++)for(let h=l+1;h<c.length;h++)n.lines.push({points:[c[l],c[h]],strokeColor:"rgba(0,0,0,0.1)"})}let i=(a)=>{let c=e.chipPinMap[a];if(c){for(let[l,h]of Object.entries(e.chipMap))if(h.pins.includes(a)){let d=t.chipPlacements[l];if(d){let u=Iet(c.offset,d.ccwRotationDegrees);return{x:d.x+u.x,y:d.y+u.y}}}return c.offset}return null},s=new Set;for(let[a,c]of Object.entries(e.pinStrongConnMap)){if(!c)continue;let[l,h]=a.split("-"),d=l<h?`${l}-${h}`:`${h}-${l}`;if(s.has(d))continue;s.add(d);let u=i(l),_=i(h);if(!u||!_)continue;n.lines.push({points:[u,_]})}return n}var Bvr=(e)=>JSON.stringify(e),vet=new Map;function TB(e){let t=Bvr(e);if(vet.has(t))return structuredClone(vet.get(t));let n=Object.entries(e.chipMap).map(([s,a])=>{let l=a.pins.map((d)=>e.chipPinMap[d]).map((d)=>{let u=d.pinId;for(let[_,p]of Object.entries(e.pinStrongConnMap))if(p&&_.includes(d.pinId)){let[m,A]=_.split("-");if(m===d.pinId||A===d.pinId){u=[m,A].sort().join("_");break}}return{padId:d.pinId,networkId:u,type:"rect",offset:d.offset,size:{x:0.001,y:0.001}}});l.push({padId:`${s}-body`,networkId:s,type:"rect",offset:{x:0,y:0},size:{x:a.size.x,y:a.size.y}});let h=a.availableRotations?.[0]??0;return{componentId:s,pads:l,availableRotationDegrees:a.availableRotations??[0,90,180,270],...a.fixedPosition&&{isStatic:!0,center:a.fixedPosition,ccwRotationOffset:h}}}),o=jcn({components:n,minGap:0.4,packOrderStrategy:"largest_to_smallest",packPlacementStrategy:"shortest_connection_along_outline"}),r={};for(let s of o.components)r[s.componentId]={x:s.center.x,y:s.center.y,ccwRotationDegrees:s.ccwRotationOffset};let i={chipPlacements:r,groupPlacements:{}};return vet.set(t,i),structuredClone(i)}var xY=(e)=>{let t=new Map;for(let n of Object.values(e.chipMap))for(let o of n.pins)t.set(o,n);return t},tJ=(e)=>{let t={},n=Object.keys(e.chipPinMap);for(let o=0;o<n.length;o++)for(let r=o+1;r<n.length;r++){let i=n[o],s=n[r];if(e.pinStrongConnMap[`${i}-${s}`]||e.pinStrongConnMap[`${s}-${i}`])t[i]??=[],t[s]??=[],t[i].push(e.chipPinMap[s]),t[s].push(e.chipPinMap[i])}return t},Tvr=class extends ef{inputProblem;partitions=[];decouplingCapGroups;crystalCircuitGroups;constructor({inputProblem:e,decouplingCapGroups:t,crystalCircuitGroups:n}){super();this.inputProblem=e,this.decouplingCapGroups=t,this.crystalCircuitGroups=n}_step(){this.partitions=this.createPartitions(this.inputProblem),this.solved=!0}createPartitions(e){let t=Object.keys(e.chipMap),n=new Set,o=[];for(let u of this.crystalCircuitGroups??[]){let _=[u.crystalChipId,...u.loadCaps.map((p)=>p.chipId),...u.seriesResistors.map((p)=>p.chipId)].filter((p)=>e.chipMap[p]);if(_.length<3)continue;o.push({chipIds:_,group:u});for(let p of _)n.add(p)}let r=new Set,i=[],s=tJ(e);if(this.decouplingCapGroups&&this.decouplingCapGroups.length>0)for(let u of this.decouplingCapGroups){let _=[];for(let p of u.decouplingCapChipIds)if(e.chipMap[p]&&!n.has(p))_.push(p);if(_.length===1){let p=e.chipMap[_[0]],m=e.chipMap[u.mainChipId];if(!m||m.pins.length<=2||[...p.pins,...m.pins].some((A)=>s[A]?.length))continue}if(_.length>=1){i.push(_);for(let p of _)r.add(p)}}let a=t.filter((u)=>!r.has(u)&&!n.has(u)),c=new Map,l=xY(e);for(let u of a)c.set(u,new Set);for(let[u,_]of Object.entries(e.pinStrongConnMap)){if(!_)continue;let[p,m]=u.split("-"),A=l.get(p)?.chipId,g=l.get(m)?.chipId;if(A&&g&&A!==g&&!r.has(A)&&!r.has(g)&&!n.has(A)&&!n.has(g))c.get(A).add(g),c.get(g).add(A)}let h=new Set,d=[];for(let u of a)if(!h.has(u)){let _=this.dfs(u,c,h);if(_.length>0)d.push(_)}return[...o.map(({chipIds:u,group:_})=>this.createInputProblemFromPartition(u,e,{partitionType:"crystal_circuit",crystalCircuitGroup:_})),...i.map((u)=>{let _=this.decouplingCapGroups?.find((p)=>p.decouplingCapChipIds.some((m)=>u.includes(m)));return this.createInputProblemFromPartition(u,e,{partitionType:"decoupling_caps",decouplingMainChipId:_?.mainChipId,decouplingMainChipSide:_?.mainChipSide})}),...d.map((u)=>this.createInputProblemFromPartition(u,e))]}dfs(e,t,n){let o=[],r=[e];while(r.length>0){let i=r.pop();if(n.has(i))continue;n.add(i),o.push(i);let s=t.get(i)||new Set;for(let a of s)if(!n.has(a))r.push(a)}return o}createInputProblemFromPartition(e,t,n){let o=e,r=new Set;for(let d of o){let u=t.chipMap[d];for(let _ of u.pins)r.add(_)}let i={},s={},a={},c={},l={};for(let d of o)i[d]=t.chipMap[d];for(let d of r)if(t.chipPinMap[d])s[d]=t.chipPinMap[d];for(let[d,u]of Object.entries(t.pinStrongConnMap)){let[_,p]=d.split("-");if(r.has(_)&&r.has(p))c[d]=u}let h=new Set;for(let[d,u]of Object.entries(t.netConnMap)){if(!u)continue;let[_,p]=d.split("-");if(r.has(_))h.add(p),l[d]=u}for(let d of h)if(t.netMap[d])a[d]=t.netMap[d];return{...t,chipMap:i,chipPinMap:s,netMap:a,pinStrongConnMap:c,netConnMap:l,isPartition:!0,partitionType:n?.partitionType,decouplingMainChipId:n?.decouplingMainChipId,decouplingMainChipSide:n?.decouplingMainChipSide,crystalCircuitGroup:n?.crystalCircuitGroup}}visualize(){if(this.partitions.length===0){let n=TB(this.inputProblem);return Sp(this.inputProblem,n)}let e=this.partitions.map((n)=>{let o=TB(n);return Sp(n,o)}),t=this.partitions.map((n,o)=>`partition${o}`);return zR(e,{titles:t})}},Dvr=(e,t=1)=>{let n=0;for(let o=0;o<e.length;o++){let r=e.charCodeAt(o);n=(n<<5)-n+r,n=n&n}return`hsl(${Math.abs(n)%360}, 70%, 50%, ${t})`},Tln=(e)=>(Math.round(e/90)*90%360+360)%360,ys=(e,t)=>{switch(Tln(t)){case 90:return{x:-e.y,y:e.x};case 180:return{x:-e.x,y:-e.y};case 270:return{x:e.y,y:-e.x};default:return{x:e.x,y:e.y}}},C0=(e,t)=>{let n=Tln(t);if(n===90||n===270)return{x:e.y,y:e.x};return{x:e.x,y:e.y}},Dln=({inputProblem:e,netIds:t})=>{let n=t.filter((i)=>e.netMap[i]?.isPositiveVoltageSource);if(n.length===1)return n[0];let o=t.filter((i)=>e.netMap[i]?.isGround),r=t.filter((i)=>{let s=e.netMap[i];if(!s)return!1;return!s.isGround});if(o.length!==1||r.length!==1)return null;return r[0]},Nvr=2,Rvr=(e,t)=>e[0]===t[0]&&e[1]===t[1],Qvr=({groundedCapacitorsWithoutPowerMetadata:e})=>{let t=[];for(let n of e){let o=t.find((r)=>Rvr(r.netPair,n.netPair));if(o){o.capacitorChipIds.push(n.capacitorChipId);continue}t.push({capacitorChipIds:[n.capacitorChipId],netPair:n.netPair})}return t.filter((n)=>n.capacitorChipIds.length>=Nvr)},kvr=class extends ef{inputProblem;queuedChips;outputDecouplingCapGroups=[];groundedCapacitorsWithoutPowerMetadata=[];groupsByMainChipId=new Map;constructor(e){super();this.inputProblem=e,this.queuedChips=Object.values(e.chipMap)}isTwoPinRestrictedRotation(e){if(e.pins.length!==2)return!1;if(!e.availableRotations)return!1;let t=new Set([0,180]);return e.availableRotations.length>0&&(e.availableRotations.length===1||e.availableRotations.every((n)=>t.has(n)))}pinsOnOppositeYSidesAfterRotation(e){if(e.pins.length!==2)return!1;let[t,n]=e.pins,o=this.inputProblem.chipPinMap[t],r=this.inputProblem.chipPinMap[n];if(!o||!r)return!1;let i=e.availableRotations?.[0]??0,s=ys(o.offset,i),a=ys(r.offset,i),c=Math.abs(s.y-a.y);return c>0&&c>=Math.abs(s.x-a.x)}getStronglyConnectedNeighborChips(e){let t=new Set;for(let[n,o]of Object.entries(this.inputProblem.pinStrongConnMap)){if(!o)continue;let[r,i]=n.split("-");if(r===e){let s=i.split(".")[0];t.add(s)}else if(i===e){let s=r.split(".")[0];t.add(s)}}return t}findMainChipIdForCap(e,t){return this.findStronglyConnectedMainChipId(e)??this.findRailSharingMainChipId(e,t)??this.findUniqueMainChipSharingNetPair(t)}findUniqueMainChipSharingNetPair(e){let t=Object.values(this.inputProblem.chipMap).filter((n)=>!n.isCapacitor&&e.every((o)=>n.pins.some((r)=>this.getNetIdsForPin(r).has(o))));return t.length===1?t[0].chipId:null}findStronglyConnectedMainChipId(e){let t=new Map;for(let r of e.pins){let i=this.getStronglyConnectedNeighborChips(r);for(let s of i){if(s===e.chipId)continue;let a=t.get(s)||0;t.set(s,a+1)}}let n=null,o=0;for(let[r,i]of t){if(i<o)continue;if(n!==null&&i===o&&r>n)continue;n=r,o=i}return n}findRailSharingMainChipId(e,t){for(let n of Object.values(this.inputProblem.chipMap)){if(n.chipId===e.chipId)continue;if(!n.isCapacitor)continue;let o=this.getNormalizedNetPair(n);if(!o||o[0]!==t[0]||o[1]!==t[1])continue;let r=this.findStronglyConnectedMainChipId(n);if(r)return r}return null}getNetIdsForPin(e){let t=new Set;for(let[n,o]of Object.entries(this.inputProblem.netConnMap)){if(!o)continue;let[r,i]=n.split("-");if(r===e)t.add(i)}return t}getNormalizedNetPair(e){if(e.pins.length!==2)return null;let t=new Set;for(let r of e.pins){let i=this.getNetIdsForPin(r);for(let s of i)t.add(s)}if(t.size!==2)return null;let[n,o]=Array.from(t).sort();return[n,o]}addToGroup(e,t,n){let[o,r]=t,i=`${e}__${o}__${r}`,s=this.groupsByMainChipId.get(i);if(!s)s={decouplingCapGroupId:`decap_group_${e}__${o}__${r}`,mainChipId:e,mainChipSide:this.getMainChipSide(e,t),netPair:[o,r],decouplingCapChipIds:[]},this.groupsByMainChipId.set(i,s),this.outputDecouplingCapGroups.push(s);if(!s.decouplingCapChipIds.includes(n))s.decouplingCapChipIds.push(n)}getMainChipSide(e,t){let n=this.inputProblem.chipMap[e];if(!n)return null;let o=Dln({inputProblem:this.inputProblem,netIds:t});if(!o)return null;let r=new Map;for(let a of n.pins){let c=this.inputProblem.chipPinMap[a];if(!c)continue;if(!this.getNetIdsForPin(a).has(o))continue;r.set(c.side,(r.get(c.side)??0)+1)}let i=null,s=0;for(let[a,c]of r){if(c<=s)continue;i=a,s=c}return i}lastChip=null;addGroundedCapacitorGroupsWithoutPowerMetadata(){let e=Qvr({groundedCapacitorsWithoutPowerMetadata:this.groundedCapacitorsWithoutPowerMetadata});for(let t of e){let n=this.findUniqueMainChipSharingNetPair(t.netPair);if(!n)continue;for(let o of t.capacitorChipIds)this.addToGroup(n,t.netPair,o)}}_step(){let e=this.queuedChips.shift();if(this.lastChip=e??null,!e){this.addGroundedCapacitorGroupsWithoutPowerMetadata(),this.solved=!0;return}if(!e.isCapacitor)return;if(!(this.isTwoPinRestrictedRotation(e)&&this.pinsOnOppositeYSidesAfterRotation(e)))return;let n=this.getNormalizedNetPair(e);if(!n)return;let[o,r]=n,i=this.inputProblem.netMap[o],s=this.inputProblem.netMap[r];if(!(i?.isGround&&s?.isPositiveVoltageSource||s?.isGround&&i?.isPositiveVoltageSource)){if(n.filter((h)=>this.inputProblem.netMap[h]?.isGround).length===1)this.groundedCapacitorsWithoutPowerMetadata.push({capacitorChipId:e.chipId,netPair:n});return}let c=this.findMainChipIdForCap(e,n);if(!c)return;this.addToGroup(c,n,e.chipId)}visualize(){let e=TB(this.inputProblem),t=Sp(this.inputProblem,e),n=new Map;for(let o of this.outputDecouplingCapGroups){n.set(o.mainChipId,o);for(let r of o.decouplingCapChipIds)n.set(r,o)}for(let o of t.rects||[])if(o.label!==this.lastChip?.chipId)o.fill="rgba(0,0,0,0.5)";for(let o of t.rects||[]){let r=o.label,i=n.get(r);if(!i)continue;o.label=`${o.label}
${i.decouplingCapGroupId}`,o.fill=Dvr(i.decouplingCapGroupId,0.8)}return t}getConstructorParams(){return[this.inputProblem]}computeProgress(){let e=Object.keys(this.inputProblem.chipMap).length||1,t=e-this.queuedChips.length;return Math.min(1,Math.max(0,t/e))}},Lvr=class extends ef{inputProblem;queuedCrystals;outputCrystalCircuitGroups=[];constructor(e){super();this.inputProblem=e,this.queuedCrystals=Object.values(e.chipMap).filter((t)=>t.isCrystal)}getNetIdsForPin(e){let t=new Set;for(let n of Object.keys(this.inputProblem.netMap))if(this.inputProblem.netConnMap[`${e}-${n}`])t.add(n);return t}pinsAreConnected(e,t){if(this.inputProblem.pinStrongConnMap[`${e}-${t}`]||this.inputProblem.pinStrongConnMap[`${t}-${e}`])return!0;let n=this.getNetIdsForPin(e);return Array.from(this.getNetIdsForPin(t)).some((o)=>n.has(o))}getGroundNetId(e){for(let t of this.getNetIdsForPin(e))if(this.inputProblem.netMap[t]?.isGround)return t;return null}findLoadCapsForCrystalPin(e){let t=[];for(let n of Object.values(this.inputProblem.chipMap)){if(!n.isCapacitor||n.pins.length!==2)continue;for(let o of n.pins){if(!this.pinsAreConnected(e,o))continue;let r=n.pins.find((s)=>s!==o);if(!r)continue;let i=this.getGroundNetId(r);if(!i)continue;t.push({chipId:n.chipId,signalPinId:o,groundPinId:r,groundNetId:i})}}return t}findSeriesResistors(e,t){let n=[];for(let o of Object.values(this.inputProblem.chipMap)){if(!o.isResistor||o.pins.length!==2||t.has(o.chipId))continue;let r=e.flatMap((a)=>o.pins.filter((c)=>this.pinsAreConnected(a,c)).map((c)=>({crystalPinId:a,connectedPinId:c})));if(r.length!==1)continue;let i=r[0],s=o.pins.find((a)=>a!==i.connectedPinId);if(!s||this.getGroundNetId(s))continue;n.push({chipId:o.chipId,crystalPinId:i.crystalPinId,connectedPinId:i.connectedPinId})}return n}identifyCrystal(e){let t=e.pins.filter((c)=>!this.getGroundNetId(c));if(t.length!==2)return null;let[n,o]=t,r=this.findLoadCapsForCrystalPin(n),i=this.findLoadCapsForCrystalPin(o);if(r.length!==1||i.length!==1)return null;if(r[0].chipId===i[0].chipId)return null;if(r[0].groundNetId!==i[0].groundNetId)return null;let s=[{chipId:r[0].chipId,signalPinId:r[0].signalPinId,groundPinId:r[0].groundPinId},{chipId:i[0].chipId,signalPinId:i[0].signalPinId,groundPinId:i[0].groundPinId}],a=new Set(s.map((c)=>c.chipId));return{crystalCircuitGroupId:`crystal_circuit_${e.chipId}`,crystalChipId:e.chipId,activeCrystalPinIds:[n,o],loadCaps:s,groundNetId:r[0].groundNetId,seriesResistors:this.findSeriesResistors([n,o],a)}}_step(){let e=this.queuedCrystals.shift();if(!e){this.solved=!0;return}let t=this.identifyCrystal(e);if(t)this.outputCrystalCircuitGroups.push(t)}visualize(){return Sp(this.inputProblem,TB(this.inputProblem))}getConstructorParams(){return[this.inputProblem]}computeProgress(){let e=Object.values(this.inputProblem.chipMap).filter((t)=>t.isCrystal).length;if(e===0)return 1;return(e-this.queuedCrystals.length)/e}},Hvr=({firstChipId:e,secondChipId:t},n)=>{let o=n.chipMap[e],r=n.chipMap[t];if(o?.isCapacitor&&r?.isCapacitor)return n.decouplingCapsGap??n.chipGap;return n.partitionGap},Fvr=class extends ef{inputProblem;inputLayout;outputLayout=null;constructor(e){super();this.inputProblem=e.inputProblem,this.inputLayout=e.inputLayout}_step(){this.outputLayout=this.createAlignedLayout()??this.inputLayout,this.solved=!0}isPowerGroundNet(e){let t=this.inputProblem.netMap[e];return t?.isPositiveVoltageSource===!0||t?.isGround===!0}getPinNetIds(e){let t=[];for(let[n,o]of Object.entries(this.inputProblem.netConnMap)){if(!o)continue;if(!n.startsWith(`${e}-`))continue;t.push(n.slice(e.length+1))}return t}pinHasStrongConnection(e){for(let[t,n]of Object.entries(this.inputProblem.pinStrongConnMap)){if(!n)continue;if(t.startsWith(`${e}-`)||t.endsWith(`-${e}`))return!0}return!1}getAlignmentGroupId(e){if(e.fixedPosition||e.pins.length!==2)return null;let t=new Set,n=0;for(let o of e.pins){let r=this.getPinNetIds(o);if(r.length===0){if(this.pinHasStrongConnection(o))return null;continue}let i=!1;for(let s of r)if(this.isPowerGroundNet(s))i=!0;else t.add(s);if(i)n++}if(n===0)return null;if(t.size===0)return"power-ground";if(t.size===1)return`signal:${[...t][0]}`;return null}getAlignmentGroups(){let e=Object.keys(this.inputProblem.chipMap);if(e.length<2)return null;let t=new Map;for(let n of e){let o=this.inputProblem.chipMap[n];if(!o)continue;if(!this.inputLayout.chipPlacements[n])continue;let r=this.getAlignmentGroupId(o);if(!r)continue;let i=t.get(r)??[];i.push(n),t.set(r,i)}return[...t.values()].filter((n)=>n.length>1).map((n)=>({chipIds:n}))}alignGroup(e,t){if(t.length<2)return;let n=0,o=t.reduce((s,a)=>s+this.inputLayout.chipPlacements[a].y,0)/t.length,r=t.reduce((s,a)=>s+this.inputLayout.chipPlacements[a].x,0)/t.length;for(let[s,a]of t.entries()){let c=t[s-1];if(c)n+=Hvr({firstChipId:c,secondChipId:a},this.inputProblem);let l=this.inputProblem.chipMap[a],h=this.inputLayout.chipPlacements[a],d=h.ccwRotationDegrees===90||h.ccwRotationDegrees===270,u=l.size.x;if(d)u=l.size.y;let _=n+u/2;e[a]={x:_,y:o,ccwRotationDegrees:h.ccwRotationDegrees},n+=u}let i=n;for(let s of t)e[s].x+=r-i/2}hasChipOverlap(e){let t=Object.keys(this.inputProblem.chipMap);for(let n=0;n<t.length;n++){let o=t[n],r=this.inputProblem.chipMap[o],i=e[o];if(!i)continue;let s=i.ccwRotationDegrees===90||i.ccwRotationDegrees===270,a=r.size.x,c=r.size.y;if(s)a=r.size.y,c=r.size.x;for(let l=n+1;l<t.length;l++){let h=t[l],d=this.inputProblem.chipMap[h],u=e[h];if(!u)continue;let _=u.ccwRotationDegrees===90||u.ccwRotationDegrees===270,p=d.size.x,m=d.size.y;if(_)p=d.size.y,m=d.size.x;let A=Math.abs(i.x-u.x)<(a+p)/2,g=Math.abs(i.y-u.y)<(c+m)/2;if(A&&g)return!0}}return!1}createAlignedLayout(){let e=this.getAlignmentGroups();if(!e)return null;let t={...this.inputLayout.chipPlacements};for(let n of e)this.alignGroup(t,n.chipIds);if(this.hasChipOverlap(t))return null;return{chipPlacements:t,groupPlacements:{...this.inputLayout.groupPlacements}}}visualize(){return Sp(this.inputProblem,this.outputLayout??this.inputLayout)}getConstructorParams(){return[{inputProblem:this.inputProblem,inputLayout:this.inputLayout}]}},DB=({placement:e,size:t,margin:n=0})=>{let o=C0(t,e.ccwRotationDegrees);return Pd({center:e,width:o.x+n*2,height:o.y+n*2})},Nln=({inputProblem:e,chipIdA:t,placementA:n,chipIdB:o,placementB:r})=>{let i=DB({placement:n,size:e.chipMap[t].size,margin:e.chipGap}),s=DB({placement:r,size:e.chipMap[o].size});return iHe(i,s)>0},zvr=0.2,Ovr=({looseTestPointChipIds:e},t)=>{let n=e.reduce((s,a)=>s+t.chipPlacements[a].y,0)/e.length,o=[...e].sort((s,a)=>t.chipPlacements[s].x-t.chipPlacements[a].x),r={},i;for(let s of o){let a={...t.chipPlacements[s],y:n};if(i){let c=r[i],l=C0(t.inputProblem.chipMap[i].size,c.ccwRotationDegrees),h=C0(t.inputProblem.chipMap[s].size,a.ccwRotationDegrees),d=c.x+l.x/2+t.inputProblem.chipGap+h.x/2;if(a.x<d)a.x=d}r[s]=a,i=s}return r},Vvr=({looseTestPointChipIds:e,testPointRow:t},n)=>{let o=new Set(e);return e.some((r)=>Object.entries(n.chipPlacements).some(([i,s])=>!o.has(i)&&Nln({inputProblem:n.inputProblem,chipIdA:r,placementA:t[r],chipIdB:i,placementB:s})))},Yvr=({looseTestPointChipIds:e,testPointRow:t},n)=>{let o=Math.max(n.inputProblem.chipGap,zvr),r=0;while(!0){let i=[0];if(r>0)i.length=0,i.push(-r*o,r*o);for(let s of i){let a=structuredClone(t);for(let c of e)a[c].y+=s;if(!Vvr({looseTestPointChipIds:e,testPointRow:a},n))return a}r++}},Gvr=({anchoredTestPointChipIds:e},t)=>{let n=Object.values(t.inputProblem.chipMap).filter((i)=>i.isTestPoint&&!i.fixedPosition&&i.pins.length===1&&t.chipPlacements[i.chipId]&&!e.has(i.chipId)).map((i)=>i.chipId);if(n.length<2)return;let o=Ovr({looseTestPointChipIds:n},t),r=Yvr({looseTestPointChipIds:n,testPointRow:o},t);for(let[i,s]of Object.entries(r))t.chipPlacements[i]=s},Uvr=1.5,Rln=0.2,eln=0.000001,Wvr=2,Xvr=0.5,jvr={"x-":{x:-1,y:0},"x+":{x:1,y:0},"y-":{x:0,y:-1},"y+":{x:0,y:1}},w6e={"x-":{normalAxis:"x",tangentAxis:"y",direction:-1},"x+":{normalAxis:"x",tangentAxis:"y",direction:1},"y-":{normalAxis:"y",tangentAxis:"x",direction:-1},"y+":{normalAxis:"y",tangentAxis:"x",direction:1}},Kvr={"x-":"x+","x+":"x-","y-":"y+","y+":"y-"},$vr=(e)=>{if(Math.abs(e.x)>Math.abs(e.y)){if(e.x<0)return"x-";return"x+"}if(e.y<0)return"y-";return"y+"},Det=(e,t)=>$vr(ys(jvr[e],t)),b6e=({anchorChipId:e,anchorPinId:t,side:n},o)=>{let r=o.inputLayout.chipPlacements[e],i=o.inputProblem.chipPinMap[t],s=ys(i.offset,r.ccwRotationDegrees),a=w6e[n].tangentAxis;return r[a]+s[a]},qvr=({group:e},t)=>{if(e.members.length<2)return[e];let n=t.inputProblem.chipMap[e.anchorChipId],o=t.inputLayout.chipPlacements[e.anchorChipId],r=n.pins.filter((h)=>{let d=t.inputProblem.chipPinMap[h];return d&&Det(d.side,o.ccwRotationDegrees)===e.side}).map((h)=>b6e({anchorChipId:e.anchorChipId,anchorPinId:h,side:e.side},t)).sort((h,d)=>h-d),i=r.slice(1).map((h,d)=>h-r[d]).filter((h)=>h>eln);if(i.length===0)return[e];let s=Math.min(...i)*Uvr,a=[],c=[],l;for(let h of e.members){let d=b6e({anchorChipId:h.anchorChipId,anchorPinId:h.anchorPinId,side:h.side},t);if(l!==void 0&&d-l>s+eln)a.push({...e,members:c}),c=[];c.push(h),l=d}if(c.length>0)a.push({...e,members:c});return a},Jvr=(e)=>{let t=xY(e.inputProblem),n=tJ(e.inputProblem),o=[];for(let r of Object.values(e.inputProblem.chipMap)){if(!r.isTestPoint||r.fixedPosition||r.pins.length!==1)continue;let i=r.pins[0],s=n[i]?.[0];if(!s)continue;let a=s.pinId,c=t.get(a)?.chipId;if(!c||c===r.chipId)continue;if(e.inputProblem.chipMap[c]?.isTestPoint)continue;let l=e.inputLayout.chipPlacements[c];if(!l)continue;let h=Det(s.side,l.ccwRotationDegrees),d=o.find((u)=>u.anchorChipId===c&&u.side===h);if(!d)d={anchorChipId:c,side:h,members:[]},o.push(d);d.members.push({testPointChipId:r.chipId,testPointPinId:i,anchorChipId:c,anchorPinId:a,side:h})}for(let r of o)r.members.sort((i,s)=>b6e({anchorChipId:i.anchorChipId,anchorPinId:i.anchorPinId,side:i.side},e)-b6e({anchorChipId:s.anchorChipId,anchorPinId:s.anchorPinId,side:s.side},e));return o.flatMap((r)=>qvr({group:r},e))},Zvr=({member:e},t)=>{let n=t.inputProblem.chipMap[e.testPointChipId],o=t.inputProblem.chipPinMap[e.testPointPinId],r=n.availableRotations??[0,90,180,270],i=Kvr[e.side];return r.find((s)=>Det(o.side,s)===i)??r[0]},e8r=({group:e},t)=>{let{inputProblem:n,chipPlacements:o}=t,r=o[e.anchorChipId],i=n.chipMap[e.anchorChipId],s=DB({placement:r,size:i.size}),{normalAxis:a,tangentAxis:c,direction:l}=w6e[e.side],h=e.members.map((u)=>{let _=n.chipPinMap[u.anchorPinId],p=ys(_.offset,r.ccwRotationDegrees),m={x:r.x+p.x,y:r.y+p.y},A=Zvr({member:u},t),g=C0(n.chipMap[u.testPointChipId].size,A);return{member:u,anchorPinPosition:m,ccwRotationDegrees:A,size:g}}).sort((u,_)=>u.anchorPinPosition[c]-_.anchorPinPosition[c]),d=-1/0;for(let u of h){let _=u.size[c],p=u.anchorPinPosition[c],m=Math.max(p,d+n.chipGap+_/2);d=m+_/2;let A=u.anchorPinPosition[a],g=s.minX;if(a==="y")g=s.minY;if(a==="x"&&l>0)g=s.maxX;if(a==="y"&&l>0)g=s.maxY;let f=Math.min(g,A);if(l>0)f=Math.max(g,A);let y=f+l*(n.chipGap+u.size[a]/2),x=y,C=m;if(a==="y")x=m,C=y;o[u.member.testPointChipId]={x,y:C,ccwRotationDegrees:u.ccwRotationDegrees}}},Qln=({group:e},t)=>{let n=new Set(e.members.map((o)=>o.testPointChipId));return e.members.some((o)=>{let r=t.chipPlacements[o.testPointChipId];return Object.entries(t.chipPlacements).some(([i,s])=>i!==e.anchorChipId&&!n.has(i)&&Nln({inputProblem:t.inputProblem,chipIdA:o.testPointChipId,placementA:r,chipIdB:i,placementB:s}))})},t8r=({group:e},t)=>{let{normalAxis:n,direction:o}=w6e[e.side],r=Math.max(t.inputProblem.chipGap,Rln);while(Qln({group:e},t))for(let i of e.members)t.chipPlacements[i.testPointChipId][n]+=o*r},tln=({inputProblem:e,pinId:t,placement:n})=>{let o=e.chipPinMap[t],r=ys(o.offset,n.ccwRotationDegrees);return{x:n.x+r.x,y:n.y+r.y}},kln=({group:e},t)=>{let n=new Set(e.members.map((r)=>r.testPointChipId)),o=0;for(let r of e.members){let i=tln({inputProblem:t.inputProblem,pinId:r.testPointPinId,placement:t.chipPlacements[r.testPointChipId]}),s=tln({inputProblem:t.inputProblem,pinId:r.anchorPinId,placement:t.chipPlacements[r.anchorChipId]});for(let[a,c]of Object.entries(t.chipPlacements)){if(a===r.anchorChipId||n.has(a))continue;let l=DB({placement:c,size:t.inputProblem.chipMap[a].size});if(Xie(i,s,l))o++}}return o},n8r=({group:e,tangentAxis:t,searchStep:n},o)=>{let r=new Set(e.members.map((c)=>c.testPointChipId)),i=e.members.reduce((c,l)=>c+o.chipPlacements[l.testPointChipId][t],0)/e.members.length,s=Math.max(...e.members.map((c)=>{let l=o.chipPlacements[c.testPointChipId];return C0(o.inputProblem.chipMap[c.testPointChipId].size,l.ccwRotationDegrees)[t]})),a=Object.entries(o.chipPlacements).reduce((c,[l,h])=>{if(r.has(l))return c;let d=C0(o.inputProblem.chipMap[l].size,h.ccwRotationDegrees)[t];return Math.max(c,Math.abs(h[t]-i)+d+s)},0)+o.inputProblem.partitionGap;return Math.ceil(a/n)+Wvr},o8r=({group:e},t)=>{let{tangentAxis:n}=w6e[e.side],o=new Map(e.members.map((c)=>[c.testPointChipId,{...t.chipPlacements[c.testPointChipId]}])),r=Math.max(t.inputProblem.partitionGap*Xvr,t.inputProblem.chipGap,Rln),i=n8r({group:e,tangentAxis:n,searchStep:r},t),s=0,a=Number.POSITIVE_INFINITY;for(let c=0;c<=i;c++){let l=[0];if(c>0)l.length=0,l.push(-c*r,c*r);for(let h of l){for(let u of e.members){let _=o.get(u.testPointChipId);t.chipPlacements[u.testPointChipId]={..._,[n]:_[n]+h}}if(Qln({group:e},t))continue;let d=kln({group:e},t);if(d<a)a=d,s=h;if(d===0)break}if(a===0)break}for(let c of e.members){let l=o.get(c.testPointChipId);t.chipPlacements[c.testPointChipId]={...l,[n]:l[n]+s}}},r8r=class extends ef{inputProblem;inputLayout;outputLayout=null;testPointSideGroups=[];connectionBodyCrossingCount=0;constructor(e){super();this.inputProblem=e.inputProblem,this.inputLayout=e.inputLayout}_step(){let e=structuredClone(this.inputLayout.chipPlacements),t={inputProblem:this.inputProblem,chipPlacements:e};this.testPointSideGroups=Jvr({inputProblem:this.inputProblem,inputLayout:this.inputLayout});for(let o of this.testPointSideGroups)e8r({group:o},t);for(let o of this.testPointSideGroups)t8r({group:o},t),o8r({group:o},t);this.connectionBodyCrossingCount=this.testPointSideGroups.reduce((o,r)=>o+kln({group:r},t),0);let n=new Set(this.testPointSideGroups.flatMap((o)=>o.members.map((r)=>r.testPointChipId)));Gvr({anchoredTestPointChipIds:n},t),this.outputLayout={chipPlacements:e,groupPlacements:{...this.inputLayout.groupPlacements}},this.solved=!0}visualize(){return Sp(this.inputProblem,this.outputLayout??this.inputLayout)}};function i8r(e){let{inputProblem:t,pinIdToStronglyConnectedPins:n}=e,o=new Map,r=new Set,i=!1,s=new Map;for(let[a,c]of Object.entries(t.pinStrongConnMap)){if(!c)continue;i=!0;let l=a.split("-");if(l.length===2&&l[0]&&l[1]){let h=t.chipPinMap[l[0]],d=t.chipPinMap[l[1]];if(h&&d){let u=l[0].split(".")[0],_=l[1].split(".")[0];if(u&&_&&u!==_){let p=`${u}-${_}`,m=`${_}-${u}`;if(!s.has(p))s.set(p,new Set);if(!s.has(m))s.set(m,new Set);s.get(p).add(h.side),s.get(m).add(d.side)}}}}if(i)for(let[a,c]of Object.entries(t.netConnMap)){if(!c)continue;let[l,h]=a.split("-");if(l&&h)r.add(l)}else for(let[a,c]of Object.entries(t.netConnMap)){if(!c)continue;let[l,h]=a.split("-");if(l&&h){if(!t.chipPinMap[l])continue;let u=l.split(".")[0],_=!0;for(let[p,m]of s.entries()){let[A,g]=p.split("-");if(A===u)for(let[f,y]of Object.entries(t.netConnMap)){if(!y)continue;let[x,C]=f.split("-");if(C===h&&x&&x!==l){let b=t.chipPinMap[x];if(!b)continue;if(x.split(".")[0]===g){if(!m.has(b.side)){_=!1;break}}}}}if(_)o.set(l,h);else{let p=`${l}_opposite-strong-side-disconnected`;o.set(l,p),r.add(l)}}}for(let[a,c]of Object.entries(t.pinStrongConnMap)){if(!c)continue;let l=a.split("-");if(l.length===2&&l[0]&&l[1]){let h=o.get(l[0])||o.get(l[1]);if(h)o.set(l[0],h),o.set(l[1],h);else o.set(l[0],a),o.set(l[1],a)}}return{pinToNetworkMap:o,filteredPins:r}}var s8r=(e)=>{let t=e.flatMap((a)=>[a.offset.x-a.size.x/2,a.offset.x+a.size.x/2]),n=e.flatMap((a)=>[a.offset.y-a.size.y/2,a.offset.y+a.size.y/2]),o=t.length?Math.min(...t):0,r=t.length?Math.max(...t):0,i=n.length?Math.min(...n):0,s=n.length?Math.max(...n):0;return{minX:o,maxX:r,minY:i,maxY:s}},I6e=0.2,lhe=0.000001,Pet=2,Zq=(e,t)=>{let n=ys(e.offset,t.ccwRotationDegrees);return{x:t.x+n.x,y:t.y+n.y}},a8r=(e,t)=>{for(let[n,o]of Object.entries(e.netMap)){if(!o.isGround)continue;if(e.netConnMap[`${t}-${n}`])return!0}return!1},c8r=({chip:e,inputProblem:t,placement:n})=>{let[o,r]=e.pins,i=o&&t.chipPinMap[o],s=r&&t.chipPinMap[r];if(!i||!s)return!1;let a=ys(i.offset,n.ccwRotationDegrees),c=ys(s.offset,n.ccwRotationDegrees);return Math.abs(a.y-c.y)>Math.abs(a.x-c.x)},l8r=({chipId:e,chipPlacements:t,ignoredChipIds:n,inputProblem:o,minimumGap:r})=>{let i=o.chipMap[e],s=t[e];if(!i||!s)return!1;let a=C0(i.size,s.ccwRotationDegrees),c=Pd({center:s,width:a.x,height:a.y});for(let[l,h]of Object.entries(t)){if(n.has(l))continue;let d=o.chipMap[l];if(!d)continue;let u=C0(d.size,h.ccwRotationDegrees),_=Pd({center:h,width:u.x,height:u.y});if(LR(c,_)<r-lhe)return!1}return!0},yY=({chipIds:e,clearanceGroupChipIds:t,dx:n,dy:o,chipPlacements:r,inputProblem:i,minimumOutsideGap:s})=>{let a=e.map((h)=>r[h]).filter((h)=>Boolean(h));if(a.length!==e.length)return!1;for(let h of a)h.x+=n,h.y+=o;let c=new Set(t??e);if(e.every((h)=>l8r({chipId:h,chipPlacements:r,ignoredChipIds:c,inputProblem:i,minimumGap:s??i.chipGap})))return!0;for(let h of a)h.x-=n,h.y-=o;return!1},Lln=({inputProblem:e,connectedPinsByPinId:t,chipPlacements:n,rigidChipGroups:o=[]})=>{let r=xY(e),i=Object.keys(e.chipMap).length;for(let s of Object.values(e.chipMap)){if(s.pins.length<=Pet)continue;for(let a of s.pins)for(let c of t[a]??[]){let l=r.get(c.pinId);if(!l)continue;if(l.fixedPosition)continue;if(l.pins.length!==Pet)continue;let h=e.chipPinMap[a],d=n[s.chipId],u=n[l.chipId];if(!h||!d||!u)continue;let _=Zq(h,d),p=Zq(c,u),m=Math.abs(_.x-p.x)<=lhe,A=Math.abs(_.y-p.y)<=lhe,g=c8r({chip:l,inputProblem:e,placement:u}),f=o.find((I)=>I.includes(l.chipId)),y=f??[l.chipId];if(m&&g){if(f)continue;yY({chipIds:[l.chipId],dx:-I6e,dy:0,chipPlacements:n,inputProblem:e});continue}let x=i===Pet&&g&&(l.isCapacitor||l.isResistor),C=l.pins.find((I)=>I!==c.pinId),b=C&&a8r(e,C);if(A&&(x||b))yY({chipIds:y,dx:0,dy:-I6e,chipPlacements:n,inputProblem:e})}}},h8r=({groundedLoadPairs:e,inputProblem:t,chipPlacements:n})=>{for(let o of e){if(!o.mainPinId)continue;if(!o.upperChip.isResistor)continue;let r=t.chipPinMap[o.upperInnerPinId],i=t.chipPinMap[o.lowerInnerPinId],s=n[o.upperChip.chipId],a=n[o.lowerChip.chipId];if(!r||!i||!s||!a)continue;let c=Zq(r,s),l=Zq(i,a);if(Math.abs(c.x-l.x)>lhe)continue;yY({chipIds:[o.upperChip.chipId],dx:-I6e,dy:0,chipPlacements:n,inputProblem:t})}},d8r=({railLoadPairs:e,inputProblem:t,chipPlacements:n})=>{for(let o of e){let r=t.chipPinMap[o.mainPinId],i=t.chipPinMap[o.resistorMainPinId],s=n[o.mainChipId],a=n[o.resistor.chipId];if(!r||!i||!s||!a)continue;let c=Zq(r,s),l=Zq(i,a);if(Math.abs(c.y-l.y)>lhe)continue;yY({chipIds:[o.railComponent.chipId,o.resistor.chipId],dx:0,dy:I6e,chipPlacements:n,inputProblem:t})}},nln=0.1,Net=class extends ef{partitionInputProblem;layout=null;pinIdToStronglyConnectedPins;constructor(e){super();this.partitionInputProblem=e.partitionInputProblem,this.pinIdToStronglyConnectedPins=e.pinIdToStronglyConnectedPins}_step(){if(!this.activeSubSolver){let e=i8r({inputProblem:this.partitionInputProblem,pinIdToStronglyConnectedPins:this.pinIdToStronglyConnectedPins}).pinToNetworkMap,t=this.createPackInput(e);this.activeSubSolver=new BB(t),this.activeSubSolver.MAX_ITERATIONS=this.MAX_ITERATIONS}if(this.activeSubSolver.step(),this.activeSubSolver.failed){this.failed=!0,this.error=`PackSolver2 failed: ${this.activeSubSolver.error}`;return}if(this.activeSubSolver.solved)this.layout=this.createLayoutFromPackingResult(this.activeSubSolver.packedComponents),this.solved=!0,this.activeSubSolver=null}createPackInput(e){let t=Object.entries(this.partitionInputProblem.chipMap).map(([o,r])=>{let i=[];for(let l of r.pins){let h=this.partitionInputProblem.chipPinMap[l];if(!h)continue;let d=e.get(l)||`${l}_isolated`;i.push({padId:l,networkId:d,type:"rect",offset:{x:h.offset.x,y:h.offset.y},size:{x:nln,y:nln}})}let s=s8r(i),a={x:s.maxX-s.minX,y:s.maxY-s.minY};i.push({padId:`${o}_body`,networkId:`${o}_body_disconnected`,type:"rect",offset:{x:0,y:0},size:{x:Math.max(a.x,r.size.x),y:Math.max(a.y,r.size.y)}});let c=r.availableRotations?.[0]??0;return{componentId:o,pads:i,availableRotationDegrees:r.availableRotations??[0,90,180,270],...r.fixedPosition&&{isStatic:!0,center:r.fixedPosition,ccwRotationOffset:c}}}),n=this.partitionInputProblem.chipGap;if(this.partitionInputProblem.partitionType==="decoupling_caps")n=this.partitionInputProblem.decouplingCapsGap??n;return{components:t,minGap:n,packOrderStrategy:"largest_to_smallest",packPlacementStrategy:"minimum_closest_sum_squared_distance"}}createLayoutFromPackingResult(e){let t={};for(let n of e){let o=n.componentId;t[o]={x:n.center.x,y:n.center.y,ccwRotationDegrees:n.ccwRotationDegrees??n.ccwRotationOffset??0}}return Lln({inputProblem:this.partitionInputProblem,connectedPinsByPinId:this.pinIdToStronglyConnectedPins,chipPlacements:t}),{chipPlacements:t,groupPlacements:{}}}visualize(){if(this.activeSubSolver&&!this.solved)return this.activeSubSolver.visualize();if(!this.layout){let e=TB(this.partitionInputProblem);return Sp(this.partitionInputProblem,e)}return Sp(this.partitionInputProblem,this.layout)}getConstructorParams(){return[this.partitionInputProblem]}},u8r=2,p8r=4,m8r=3,oln=2,_8r=(e)=>{let t={};for(let[n,o]of Object.entries(e.chipMap))for(let r of o.pins)t[r]=n;return t},g8r=(e)=>{let t=[],n=new Set;for(let[o,r]of Object.entries(e.pinStrongConnMap)){if(!r)continue;let[i,s]=o.split("-"),a=`${i}|${s}`;if(s<i)a=`${s}|${i}`;if(n.has(a))continue;n.add(a),t.push([i,s])}return t},rln=(e,t)=>{for(let[n,o]of Object.entries(e.netConnMap)){if(!o)continue;if(!n.startsWith(`${t}-`))continue;return n.slice(t.length+1)}return null},iln=(e,t)=>{let n=ys(e,t);if(Math.abs(n.x)>=Math.abs(n.y)){if(n.x>=0)return"x+";return"x-"}if(n.y>=0)return"y+";return"y-"},A8r=(e,t)=>{if(t==="x-"||t==="x+")return e.y;return e.x},Hln=(e)=>{let t=_8r(e),n=g8r(e),o=new Set(n.flat()),r=new Map;for(let[h,d]of n){let u=t[h],_=t[d];if(!u||!_||u===_)continue;if(!r.has(u))r.set(u,[]);if(!r.has(_))r.set(_,[]);r.get(u).push({selfPin:h,otherPin:d,otherChip:_}),r.get(_).push({selfPin:d,otherPin:h,otherChip:u})}let i=[];for(let h of r.values()){let d=new Map;for(let u of h){let _=d.get(u.selfPin)??[];_.push(u),d.set(u.selfPin,_)}for(let[u,_]of d){if(_.length<oln)continue;let p=[u,..._.map((A)=>A.otherPin)],m=new Map;for(let A of p){let g=t[A],f=e.chipMap[g];if(!g||f?.fixedPosition||f?.pins.length!==2)continue;let y=f.pins.find((C)=>C!==A);if(!y||o.has(y))continue;let x=rln(e,y);if(!x)continue;m.set(x,[...m.get(x)??[],g])}for(let A of m.values()){if(A.length<oln)continue;let g=p.filter((b)=>!A.includes(t[b]));if(g.length!==1)continue;let f=g[0],y=t[f];if(!y)continue;let x=e.chipMap[y],C=e.chipPinMap[f];if(!x||!C)continue;i.push({mainChipId:y,side:iln(C.offset,x.availableRotations?.[0]??0),passiveChipIds:A,mainChipPinIds:A.map(()=>f)})}}}let s=new Set(i.flatMap((h)=>h.passiveChipIds)),a=[];for(let[h,d]of Object.entries(e.chipMap)){if(s.has(h))continue;if(d.pins.length!==u8r)continue;let u=r.get(h)??[];if(u.length!==1)continue;let{selfPin:_,otherPin:p,otherChip:m}=u[0],A=e.chipMap[m];if(!A||A.pins.length<p8r)continue;let g=d.pins.find((b)=>b!==_);if(!g)continue;let f=rln(e,g);if(!f)continue;let y=A.availableRotations?.[0]??0,x=ys(e.chipPinMap[p].offset,y),C=iln(e.chipPinMap[p].offset,y);a.push({passiveChipId:h,mainChipId:m,mainChipPinId:p,side:C,sharedNetId:f,edgeCoord:A8r(x,C)})}let c=new Map;for(let h of a){let d=`${h.mainChipId}|${h.side}|${h.sharedNetId}`,u=c.get(d)??[];u.push(h),c.set(d,u)}let l=[...i];for(let h of c.values()){if(h.length<m8r)continue;h.sort((d,u)=>d.edgeCoord-u.edgeCoord),l.push({mainChipId:h[0].mainChipId,side:h[0].side,passiveChipIds:h.map((d)=>d.passiveChipId),mainChipPinIds:h.map((d)=>d.mainChipPinId)})}return l},Jq=0.000001,f8r=16,y8r={"x-":{x:-1,y:0},"x+":{x:1,y:0},"y-":{x:0,y:-1},"y+":{x:0,y:1}},sln=(e,t,n)=>{if(n==="x")return Math.max(0,e.minX-t.maxX,t.minX-e.maxX);return Math.max(0,e.minY-t.maxY,t.minY-e.maxY)},x8r=class extends ef{partitionInputProblem;layout=null;pinIdToStronglyConnectedPins;packingSolver=null;constructor(e){super();this.partitionInputProblem=e.partitionInputProblem,this.pinIdToStronglyConnectedPins=e.pinIdToStronglyConnectedPins}_step(){if(!this.packingSolver)this.packingSolver=new Net({partitionInputProblem:this.partitionInputProblem,pinIdToStronglyConnectedPins:this.pinIdToStronglyConnectedPins}),this.activeSubSolver=this.packingSolver;if(this.packingSolver.step(),this.packingSolver.failed){this.failed=!0,this.error=this.packingSolver.error;return}if(this.packingSolver.solved&&this.packingSolver.layout)this.layout=this.alignPassiveGroups(this.packingSolver.layout),this.activeSubSolver=null,this.solved=!0}alignPassiveGroups(e){let t={};for(let[o,r]of Object.entries(e.chipPlacements))t[o]={...r};let n=Hln(this.partitionInputProblem);for(let o of n)this.reflowPassiveGroup(t,o);return Lln({inputProblem:this.partitionInputProblem,connectedPinsByPinId:this.pinIdToStronglyConnectedPins,chipPlacements:t,rigidChipGroups:n.map((o)=>o.passiveChipIds)}),{chipPlacements:t,groupPlacements:e.groupPlacements}}reflowPassiveGroup(e,t){let n=this.partitionInputProblem,o=n.chipGap,r=e[t.mainChipId];if(!r)return;let i=y8r[t.side],s=i.x!==0,a=this.boxFor(t.mainChipId,r),c=m3(a),l=t.mainChipPinIds.map((y)=>{let x=ys(n.chipPinMap[y].offset,r.ccwRotationDegrees);return{x:r.x+x.x,y:r.y+x.y}}),h=c;if(l.length>0){let y=l.reduce((C,b)=>C+b.x,0),x=l.reduce((C,b)=>C+b.y,0);h={x:y/l.length,y:x/l.length}}let d=t.passiveChipIds.map((y)=>C0(n.chipMap[y].size,e[y].ccwRotationDegrees)),u=[],_=0;for(let y=0;y<d.length;y++)u[y]=_+d[y].x/2,_+=d[y].x+o;let p=Math.max(0,_-o);for(let y=0;y<u.length;y++)u[y]-=p/2;let m=Math.max(...d.map((y)=>y.y)),A=new Set(t.passiveChipIds),g=[];if(s){let y=(a.maxX-a.minX)/2+o+p/2,x=c.x+i.x*y,C=h.y;if(l.length>0)C=Math.min(...l.map((b)=>b.y));g.push({x,y:C-m/2}),g.push({x,y:h.y})}else{let y=(a.maxY-a.minY)/2+o+m/2;g.push({x:h.x,y:c.y+i.y*y})}let f=a.maxX-a.minX+p;for(let y of g){let x=0;for(let C=0;C<f8r;C++){let b={};for(let P=0;P<t.passiveChipIds.length;P++){let M=t.passiveChipIds[P];b[M]={x:y.x+x+u[P],y:y.y,ccwRotationDegrees:e[M].ccwRotationDegrees}}let I=this.clearanceAdjustment(b,e,A,o);if(I===0){for(let P of t.passiveChipIds)e[P]=b[P];return}if(I===null)break;let v=x+I;if(Math.abs(v)>f)break;x=v}}}clearanceAdjustment(e,t,n,o){let r=0,i=0;for(let[s,a]of Object.entries(e)){let c=this.boxFor(s,a);for(let[l,h]of Object.entries(t)){if(n.has(l))continue;let d=this.boxFor(l,h);if(LR(c,d)>=o-Jq)continue;let u=sln(c,d,"y"),_=sln(c,d,"x"),m=Math.sqrt(Math.max(0,o*o-u*u))-_;if(m<=Jq)continue;if(m3(c).x>=m3(d).x)r=Math.max(r,m);else i=Math.max(i,m)}}if(r>Jq&&i>Jq)return null;if(r>Jq)return r;if(i>Jq)return-i;return 0}boxFor(e,t){let n=this.partitionInputProblem.chipMap[e],o=C0(n.size,t.ccwRotationDegrees),r=[{x:t.x-o.x/2,y:t.y-o.y/2},{x:t.x+o.x/2,y:t.y+o.y/2}];for(let i of n.pins){let s=this.partitionInputProblem.chipPinMap[i];if(!s)continue;let a=ys(s.offset,t.ccwRotationDegrees);r.push({x:t.x+a.x,y:t.y+a.y})}return Hs(r)}visualize(){if(this.activeSubSolver&&!this.solved)return this.activeSubSolver.visualize();if(!this.layout){let e=TB(this.partitionInputProblem);return Sp(this.partitionInputProblem,e)}return Sp(this.partitionInputProblem,this.layout)}getConstructorParams(){return[this.partitionInputProblem]}},Fln=(e,t)=>{if(e.pins.length!==2)return null;let[n,o]=e.pins.map((a)=>t.chipPinMap[a]);if(!n||!o)return null;let r=e.availableRotations?.[0]??0,i=ys(n.offset,r),s=ys(o.offset,r);if(Math.abs(i.y-s.y)>=Math.abs(i.x-s.x))return"y";return"x"},C8r=(e)=>{if(e.partitionType!=="decoupling_caps")return!1;let t=Object.values(e.chipMap);if(t.length<2)return!1;let n=null;for(let o of t){if(o.fixedPosition)return!1;let r=Fln(o,e);if(!r)return!1;if(n&&n!==r)return!1;n=r}return n!==null},b8r=class extends ef{partitionInputProblem;layout=null;constructor(e){super();this.partitionInputProblem=e.partitionInputProblem}getRotation(e){return e.availableRotations?.[0]??0}isOnRailNet(e){let t=this.partitionInputProblem,n=Dln({inputProblem:t,netIds:Object.keys(t.netMap)});if(!n)return!1;return t.netConnMap[`${e}-${n}`]===!0}getRailOffset(e,t){let n=e.pins.find((r)=>this.isOnRailNet(r));if(!n)return 0;let o=this.partitionInputProblem.chipPinMap[n];if(!o)return 0;return-ys(o.offset,this.getRotation(e))[t]}_step(){let e=this.partitionInputProblem,t=Object.values(e.chipMap),n=Fln(t[0],e),o="y";if(n==="y")o="x";let r=e.decouplingCapsGap??e.chipGap,i=t.map((u)=>C0(u.size,this.getRotation(u))[o]),s=i.reduce((u,_)=>u+_,0)+r*(t.length-1),a={},c=-s/2,l=1,h=e.decouplingMainChipSide;if(o==="x"&&h==="x-"||o==="y"&&h==="y-")c=s/2,l=-1;t.forEach((u,_)=>{let p=i[_],m={x:0,y:0,ccwRotationDegrees:this.getRotation(u)};m[o]=c+l*p/2,m[n]=this.getRailOffset(u,n),a[u.chipId]=m,c+=l*(p+r)}),this.layout={chipPlacements:a,groupPlacements:{}},this.solved=!0}visualize(){return Sp(this.partitionInputProblem,this.layout??{chipPlacements:{},groupPlacements:{}})}getConstructorParams(){return[{partitionInputProblem:this.partitionInputProblem}]}},eJ=(e)=>{if(e.availableRotations?.length)return e.availableRotations;return[0]},I8r=(e,t,n)=>{let o=eJ(e)[0],r=-1/0;for(let i of eJ(e)){let s=n.chipPinMap[t[0]],a=n.chipPinMap[t[1]];if(!s||!a)continue;let c=ys(s.offset,i),l=ys(a.offset,i),h=Math.abs(c.x-l.x)-Math.abs(c.y-l.y);if(h>r)r=h,o=i}return o},v8r=(e,t,n,o)=>{let r=eJ(e)[0],i=-1/0;for(let s of eJ(e)){let a=o.chipPinMap[t],c=o.chipPinMap[n];if(!a||!c)continue;let l=ys(a.offset,s),h=ys(c.offset,s),d=l.y-h.y-Math.abs(l.x-h.x);if(d>i)i=d,r=s}return r},S8r=(e,t,n)=>{let o=e.pins.find((s)=>s!==t),r=eJ(e)[0],i=-1/0;for(let s of eJ(e)){let a=n.chipPinMap[t],c=o&&n.chipPinMap[o];if(!a||!c)continue;let l=ys(a.offset,s),h=ys(c.offset,s),d=h.y-l.y-Math.abs(h.x-l.x);if(d>i)i=d,r=s}return r},P8r=(e)=>{if(e.partitionType!=="crystal_circuit"||!e.crystalCircuitGroup)return!1;return Object.values(e.chipMap).every((t)=>t.fixedPosition===void 0)},E8r=class extends ef{partitionInputProblem;layout=null;constructor(e){super();this.partitionInputProblem=e.partitionInputProblem}_step(){let e=this.partitionInputProblem,t=e.crystalCircuitGroup,n=e.chipMap[t.crystalChipId],o=I8r(n,t.activeCrystalPinIds,e),r=C0(n.size,o),i=e.chipGap,s={[n.chipId]:{x:0,y:0,ccwRotationDegrees:o}},a=new Map;for(let u of t.activeCrystalPinIds){let _=e.chipPinMap[u];a.set(u,ys(_.offset,o))}let c=a.get(t.activeCrystalPinIds[0]),l=a.get(t.activeCrystalPinIds[1]),h;if(Math.abs(c.x-l.x)>=Math.abs(c.y-l.y))h="x";else h="y";let d=t.loadCaps.map((u,_)=>{let p=e.chipMap[u.chipId],m=v8r(p,u.signalPinId,u.groundPinId,e),A=C0(p.size,m),g=ys(e.chipPinMap[u.signalPinId].offset,m),f=ys(e.chipPinMap[u.groundPinId].offset,m),y=t.activeCrystalPinIds[_],x=a.get(y),C=-r.y/2-i-A.y/2;return{chip:p,rotation:m,size:A,signalOffset:g,groundOffset:f,crystalPinOffset:x,highestGroundY:C+f.y}});if(h==="x"){let u=Math.min(...d.map((y)=>y.highestGroundY));for(let y of d)s[y.chip.chipId]={x:y.crystalPinOffset.x-y.signalOffset.x,y:u-y.groundOffset.y,ccwRotationDegrees:y.rotation};let[_,p]=[...d].sort((y,x)=>s[y.chip.chipId].x-s[x.chip.chipId].x),m=s[_.chip.chipId],A=s[p.chip.chipId],g=A.x-p.size.x/2-(m.x+_.size.x/2),f=Math.max(0,(i*2-g)/2);m.x-=f,A.x+=f}else d.forEach((u,_)=>{let p;if(_===0)p=-1;else p=1;s[u.chip.chipId]={x:p*(r.x/2+i+u.size.x/2),y:u.crystalPinOffset.y-u.signalOffset.y,ccwRotationDegrees:u.rotation}});for(let u of t.seriesResistors){let _=e.chipMap[u.chipId],p=S8r(_,u.connectedPinId,e),m=C0(_.size,p),A=ys(e.chipPinMap[u.connectedPinId].offset,p),g=a.get(u.crystalPinId);s[_.chipId]={x:g.x-A.x,y:r.y/2+i+m.y/2,ccwRotationDegrees:p}}this.layout={chipPlacements:s,groupPlacements:{}},this.solved=!0}visualize(){return Sp(this.partitionInputProblem,this.layout??{chipPlacements:{},groupPlacements:{}})}getConstructorParams(){return[{partitionInputProblem:this.partitionInputProblem}]}},hhe=2,M8r=(e)=>{let t=new Map;for(let r of Object.values(e.chipMap))for(let i of r.pins)t.set(i,r.chipId);let n=tJ(e),o=new Map;for(let[r,i]of Object.entries(n)){let s=t.get(r);if(!s)continue;for(let a of i){let c=t.get(a.pinId);if(!c||c===s)continue;let l=o.get(s)??[];l.push({selfPinId:r,otherPinId:a.pinId,otherChipId:c}),o.set(s,l)}}return o},w8r=({inputProblem:e,connectionsByChip:t,mainChipId:n,startChipId:o,endChipId:r})=>{if(o===r)return null;let i=(c)=>{let l=e.chipMap[c];return c!==n&&l?.pins.length===hhe&&!l.fixedPosition};if(!i(o)||!i(r))return null;let s=[[o]],a=new Set([o]);while(s.length>0){let c=s.shift(),l=c[c.length-1];if(l===r)return c;for(let h of t.get(l)??[]){let d=h.otherChipId;if(!i(d)||a.has(d))continue;a.add(d),s.push([...c,d])}}return null},B8r=({inputProblem:e,connectionsByChip:t,mainChipId:n,mainPinIds:o,pathChipIds:r})=>{let i=[];for(let s=0;s<r.length;s++){let a=r[s],c=e.chipMap[a],l=t.get(a)??[];if(!c||l.length!==hhe||new Set(l.map((p)=>p.selfPinId)).size!==hhe)return null;let h=s===0?n:r[s-1],d=s===r.length-1?n:r[s+1],u=l.find((p)=>p.otherChipId===h),_=l.find((p)=>p.otherChipId===d);if(!u||!_||u.selfPinId===_.selfPinId)return null;if(s===0&&u.otherPinId!==o[0])return null;if(s===r.length-1&&_.otherPinId!==o[1])return null;i.push({chipId:a,nearPinId:u.selfPinId,farPinId:_.selfPinId})}return i},zln=(e)=>{let t=M8r(e),n=[],o=new Set;for(let r of Object.values(e.chipMap)){if(r.pins.length<=hhe)continue;let i=t.get(r.chipId)??[];for(let s=0;s<i.length;s++){let a=i[s],c=e.chipPinMap[a.selfPinId];if(!c)continue;for(let l=s+1;l<i.length;l++){let h=i[l],d=e.chipPinMap[h.selfPinId];if(!d||c.side!==d.side||a.selfPinId===h.selfPinId)continue;let u=w8r({inputProblem:e,connectionsByChip:t,mainChipId:r.chipId,startChipId:a.otherChipId,endChipId:h.otherChipId});if(!u||u.length<hhe||u.length%2!==0||u.some((f)=>o.has(f)))continue;let _=[a.selfPinId,h.selfPinId],p=B8r({inputProblem:e,connectionsByChip:t,mainChipId:r.chipId,mainPinIds:_,pathChipIds:u});if(!p)continue;let m=p.length/2,A=p.slice(0,m),g=p.slice(m).reverse().map((f)=>({chipId:f.chipId,nearPinId:f.farPinId,farPinId:f.nearPinId}));n.push({mainChipId:r.chipId,mainPinIds:_,branches:[A,g]});for(let f of u)o.add(f)}}}return n},T8r=[0,90,180,270],aln=0.000001,lk=(e,t)=>e.x*t.x+e.y*t.y,D8r=({outwardCoordinate:e,tangentCoordinate:t,axes:n})=>({x:n.outward.x*e+n.tangent.x*t,y:n.outward.y*e+n.tangent.y*t}),N8r=({pinOffset:e})=>{if(Math.abs(e.x)>=Math.abs(e.y))return{outward:Z7(e.x>=0?"right":"left"),tangent:Z7("up")};return{outward:Z7(e.y>=0?"up":"down"),tangent:Z7("right")}},cln=({size:e,axis:t})=>(Math.abs(t.x)*e.x+Math.abs(t.y)*e.y)/2,R8r=({chip:e,nearPinId:t,farPinId:n,inputProblem:o,outward:r,originalRotation:i})=>{let s=o.chipPinMap[t],a=o.chipPinMap[n];if(!s||!a)return i;let c=e.availableRotations??T8r,l=c[0]??0,h=Number.NEGATIVE_INFINITY;for(let d of c){let u=ys(s.offset,d),_=ys(a.offset,d),p=lk({x:_.x-u.x,y:_.y-u.y},r);if(p>h||p===h&&d===i)h=p,l=d}return l},y6e=({chip:e,placement:t})=>{let n=C0(e.size,t.ccwRotationDegrees);return Pd({center:t,width:n.x,height:n.y})},lln=({branch:e,mainPinId:t,mainChip:n,mainPlacement:o,inputProblem:r,axes:i,originalPlacements:s,extraGap:a})=>{let c=r.chipPinMap[t];if(!c)return null;let l=C0(n.size,o.ccwRotationDegrees),h=ys(c.offset,o.ccwRotationDegrees),d={x:o.x+h.x,y:o.y+h.y},u=lk(o,i.outward)+cln({size:l,axis:i.outward});u=Math.max(u,lk(d,i.outward));let _=lk(d,i.tangent),p={},m=u;for(let A of e){let g=r.chipMap[A.chipId],f=s[A.chipId],y=r.chipPinMap[A.nearPinId],x=r.chipPinMap[A.farPinId];if(!g||!f||!y||!x)return null;let C=R8r({chip:g,nearPinId:A.nearPinId,farPinId:A.farPinId,inputProblem:r,outward:i.outward,originalRotation:f.ccwRotationDegrees}),b=C0(g.size,C),I=cln({size:b,axis:i.outward}),v=ys(y.offset,C),P=ys(x.offset,C),M=u+r.chipGap+a+I,B=_-lk(v,i.tangent),T=D8r({outwardCoordinate:M,tangentCoordinate:B,axes:i});p[g.chipId]={...T,ccwRotationDegrees:C},u=M+I,_=B+lk(P,i.tangent),m=M+lk(P,i.outward)}return{placements:p,terminalOutwardCoordinate:m}},hln=({branchLayout:e,shift:t,tangent:n})=>{for(let o of Object.values(e.placements))o.x+=n.x*t,o.y+=n.y*t},dln=({branchLayout:e,inputProblem:t,tangent:n})=>{let o=Hs(Object.entries(e.placements).flatMap(([r,i])=>{let s=y6e({chip:t.chipMap[r],placement:i});return[{x:s.minX,y:s.minY},{x:s.maxX,y:s.maxY}]}));if(!o)return{min:0,max:0};if(Math.abs(n.x)>=Math.abs(n.y))return{min:o.minX,max:o.maxX};return{min:o.minY,max:o.maxY}},Q8r=({candidatePlacements:e,originalPlacements:t,inputProblem:n})=>{let o=new Set(Object.keys(e)),r=Object.entries(e);for(let i=0;i<r.length;i++){let[s,a]=r[i],c=n.chipMap[s];if(!c)return!1;let l=y6e({chip:c,placement:a});for(let h=i+1;h<r.length;h++){let[d,u]=r[h],_=n.chipMap[d];if(!_||LR(l,y6e({chip:_,placement:u}))<n.chipGap-aln)return!1}for(let[h,d]of Object.entries(t)){if(o.has(h))continue;let u=n.chipMap[h];if(!u||LR(l,y6e({chip:u,placement:d}))<n.chipGap-aln)return!1}}return!0},k8r=({group:e,chipPlacements:t,inputProblem:n})=>{let o=n.chipMap[e.mainChipId],r=t[e.mainChipId],i=n.chipPinMap[e.mainPinIds[0]];if(!o||!r||!i)return null;let s=ys(i.offset,r.ccwRotationDegrees),a=N8r({pinOffset:s}),c=e.branches.map((m,A)=>({branch:m,mainPinId:e.mainPinIds[A]})).sort((m,A)=>{let g=(f)=>{let y=n.chipPinMap[f],x=ys(y.offset,r.ccwRotationDegrees);return lk({x:r.x+x.x,y:r.y+x.y},a.tangent)};return g(m.mainPinId)-g(A.mainPinId)}),l=c.map(({branch:m,mainPinId:A})=>lln({branch:m,mainPinId:A,mainChip:o,mainPlacement:r,inputProblem:n,axes:a,originalPlacements:t,extraGap:0}));if(l.some((m)=>!m))return null;let h=Math.max(...l.map((m)=>m.terminalOutwardCoordinate));if(l=c.map(({branch:m,mainPinId:A},g)=>{let f=l[g],y=(h-f.terminalOutwardCoordinate)/m.length;return lln({branch:m,mainPinId:A,mainChip:o,mainPlacement:r,inputProblem:n,axes:a,originalPlacements:t,extraGap:y})}),l.some((m)=>!m))return null;let d=dln({branchLayout:l[0],inputProblem:n,tangent:a.tangent}),u=dln({branchLayout:l[1],inputProblem:n,tangent:a.tangent}),_=Math.max(0,d.max+n.chipGap-u.min);hln({branchLayout:l[0],shift:-_/2,tangent:a.tangent}),hln({branchLayout:l[1],shift:_/2,tangent:a.tangent});let p=Object.assign({},l[0].placements,l[1].placements);if(!Q8r({candidatePlacements:p,originalPlacements:t,inputProblem:n}))return null;return p},L8r=(e)=>zln(e).length>0,H8r=class extends ef{partitionInputProblem;layout=null;pinIdToStronglyConnectedPins;packingSolver=null;constructor(e){super();this.partitionInputProblem=e.partitionInputProblem,this.pinIdToStronglyConnectedPins=e.pinIdToStronglyConnectedPins}_step(){if(!this.packingSolver)this.packingSolver=new Net({partitionInputProblem:this.partitionInputProblem,pinIdToStronglyConnectedPins:this.pinIdToStronglyConnectedPins}),this.activeSubSolver=this.packingSolver;if(this.packingSolver.step(),this.packingSolver.failed){this.failed=!0,this.error=this.packingSolver.error;return}if(this.packingSolver.solved&&this.packingSolver.layout)this.layout=this.refinePackedLayout(this.packingSolver.layout),this.activeSubSolver=null,this.solved=!0}refinePackedLayout(e){let t={};for(let[n,o]of Object.entries(e.chipPlacements))t[n]={...o};for(let n of zln(this.partitionInputProblem)){let o=k8r({group:n,chipPlacements:t,inputProblem:this.partitionInputProblem});if(o)Object.assign(t,o)}return{chipPlacements:t,groupPlacements:e.groupPlacements}}visualize(){if(this.activeSubSolver&&!this.solved)return this.activeSubSolver.visualize();if(!this.layout){let e=TB(this.partitionInputProblem);return Sp(this.partitionInputProblem,e)}return Sp(this.partitionInputProblem,this.layout)}getConstructorParams(){return[this.partitionInputProblem]}};function che(e,t,n,o){return{solverName:e,solverClass:t,appliesTo:n,getConstructorParams:o}}var F8r=[che("crystalCircuitLayoutSolver",E8r,P8r,(e)=>[{partitionInputProblem:e.partitions[e.currentPartitionIndex]}]),che("decouplingCapRowSolver",b8r,C8r,(e)=>[{partitionInputProblem:e.partitions[e.currentPartitionIndex]}]),che("parallelAlignedPassiveSolver",x8r,(e)=>Hln(e).length>0,(e)=>[{partitionInputProblem:e.partitions[e.currentPartitionIndex],pinIdToStronglyConnectedPins:e.pinIdToStronglyConnectedPins}]),che("parallelSeriesBranchSolver",H8r,L8r,(e)=>[{partitionInputProblem:e.partitions[e.currentPartitionIndex],pinIdToStronglyConnectedPins:e.pinIdToStronglyConnectedPins}]),che("singleInnerPartitionPackingSolver",Net,()=>!0,(e)=>[{partitionInputProblem:e.partitions[e.currentPartitionIndex],pinIdToStronglyConnectedPins:e.pinIdToStronglyConnectedPins}])],z8r=class extends ef{partitions;packedPartitions=[];completedSolvers=[];activeSolver=null;currentPartitionIndex=0;pinIdToStronglyConnectedPins;constructor(e){super();this.partitions=e.partitions,this.pinIdToStronglyConnectedPins=e.pinIdToStronglyConnectedPins}_step(){if(this.currentPartitionIndex>=this.partitions.length){this.solved=!0;return}if(!this.activeSolver){let e=this.partitions[this.currentPartitionIndex],t=F8r.find((o)=>o.appliesTo(e)),n=t.getConstructorParams(this);this.activeSolver=new t.solverClass(...n),this.activeSubSolver=this.activeSolver}if(this.activeSolver.step(),this.activeSolver.failed){this.failed=!0,this.error=`Partition ${this.currentPartitionIndex} failed: ${this.activeSolver.error}`;return}if(this.activeSolver.solved){if(this.completedSolvers.push(this.activeSolver),this.activeSolver.layout)this.packedPartitions.push({inputProblem:this.partitions[this.currentPartitionIndex],layout:this.activeSolver.layout});else{this.failed=!0,this.error=`Partition ${this.currentPartitionIndex} completed but has no layout`;return}this.activeSolver=null,this.activeSubSolver=null,this.currentPartitionIndex++}}visualize(){if(this.activeSolver)return this.activeSolver.visualize();if(this.completedSolvers.length===0){let n=this.partitions.map((r)=>{let i=TB(r);return Sp(r,i)}),o=this.partitions.map((r,i)=>`partition${i}`);return zR(n,{titles:o})}let e=this.completedSolvers.map((n)=>n.visualize()),t=this.completedSolvers.map((n,o)=>`packed_partition_${o}`);return zR(e,{titles:t})}getConstructorParams(){return[this.partitions]}};var Eet=0.000001,uln=2,pln=["x+","y+","x-","y-"],x6e=(e,t)=>e===t?0:e<t?-1:1,mln=(e,t)=>{let n=(Math.round(t/90)%4+4)%4,o=pln.indexOf(e);return pln[(o+n)%4]},v6e=(e,t,n)=>{let o=e.chipPinMap[t],r=ys(o.offset,n.ccwRotationDegrees);return{x:n.x+r.x,y:n.y+r.y}},O8r=(e,t)=>e.distanceSquared-t.distanceSquared||Math.abs(e.yDelta)-Math.abs(t.yDelta)||x6e(e.anchorChipId,t.anchorChipId)||x6e(e.anchorPinId,t.anchorPinId)||x6e(e.resistorPinId,t.resistorPinId),V8r=(e,t,n,o)=>{let r=o[t],i=o[e.anchorChipId];if(!r||!i)return!0;let s=v6e(n,e.resistorPinId,r),a=v6e(n,e.anchorPinId,i);return Object.entries(o).some(([c,l])=>{if(c===t||c===e.anchorChipId)return!1;let h=n.chipMap[c];if(!h)return!1;let d=C0(h.size,l.ccwRotationDegrees);return Xie(s,a,Pd({center:l,width:d.x,height:d.y}))})},Y8r=({inputProblem:e,chipPlacements:t,pinToNetworkMap:n})=>{let o=xY(e),r=new Map;for(let[s,a]of n){let c=r.get(a)??[];c.push(s),r.set(a,c)}let i=Object.values(e.chipMap).filter((s)=>s.isResistor&&!s.fixedPosition&&s.pins.length===uln).sort((s,a)=>x6e(s.chipId,a.chipId));for(let s of i){let a=t[s.chipId];if(!a)continue;let c=[];for(let d of s.pins){let u=e.chipPinMap[d],_=n.get(d);if(!u||!_)continue;let p=mln(u.side,a.ccwRotationDegrees);if(p!=="x-"&&p!=="x+")continue;let m=p==="x+"?1:-1,A=v6e(e,d,a);for(let g of r.get(_)??[]){let f=o.get(g);if(!f||f.chipId===s.chipId||f.pins.length!==uln)continue;let y=e.chipPinMap[g],x=t[f.chipId];if(!y||!x)continue;let C=mln(y.side,x.ccwRotationDegrees);if(p==="x-"&&C!=="x+"||p==="x+"&&C!=="x-")continue;let b=v6e(e,g,x),I=b.x-A.x,v=b.y-A.y,P=I*m;if(P<=Eet||Math.abs(v)<=Eet||Math.abs(v)>P+Eet)continue;c.push({anchorChipId:f.chipId,anchorPinId:g,resistorPinId:d,yDelta:v,distanceSquared:I*I+v*v})}}c.sort(O8r);let l=c[0];if(!l)continue;let h=a.y;if(!yY({chipIds:[s.chipId],dx:0,dy:l.yDelta,chipPlacements:t,inputProblem:e}))continue;if(V8r(l,s.chipId,e,t))a.y=h}},G8r=class extends ef{packedPartitions;inputProblem;finalLayout=null;packSolver2=null;pinToNetworkMap=null;constructor(e){super();this.packedPartitions=e.packedPartitions,this.inputProblem=e.inputProblem}partitionHasFixedChip(e){let t=this.packedPartitions[e];if(!t)return!1;return Object.values(t.inputProblem.chipMap).some((n)=>n.fixedPosition!==void 0)}_step(){try{if(this.packedPartitions.length===0){this.finalLayout={chipPlacements:{},groupPlacements:{}},this.solved=!0;return}if(this.packedPartitions.length===1){this.finalLayout=this.packedPartitions[0].layout,this.solved=!0;return}let e=this.organizePackedPartitions();if(!this.packSolver2){let t=this.createPackInput(e);this.packSolver2=new BB(t),this.activeSubSolver=this.packSolver2}if(this.packSolver2.step(),this.packSolver2.failed){this.failed=!0,this.error=`PackSolver2 failed: ${this.packSolver2.error}`;return}if(this.packSolver2.solved){let t=this.applyPackingResult(this.packSolver2.packedComponents,e);this.finalLayout=t,this.solved=!0,this.activeSubSolver=null}}catch(e){this.failed=!0,this.error=`Failed to pack partitions: ${e}`}}buildConnectivityMap(){let e=new Map;for(let t of this.packedPartitions){for(let[n,o]of Object.entries(t.inputProblem.netConnMap)){if(!o)continue;let[r,i]=n.split("-");if(r&&i)e.set(r,i)}for(let[n,o]of Object.entries(t.inputProblem.pinStrongConnMap)){if(!o)continue;let r=n.split("-");if(r.length===2&&r[0]&&r[1]){let i=e.get(r[0])||e.get(r[1]);if(i)e.set(r[0],i),e.set(r[1],i);else e.set(r[0],n),e.set(r[1],n)}}}return e}getConnectivityMap(){return this.pinToNetworkMap??=this.buildConnectivityMap(),this.pinToNetworkMap}organizePackedPartitions(){let e=[];for(let t=0;t<this.packedPartitions.length;t++){let n=this.packedPartitions[t],o=Object.keys(n.layout.chipPlacements);if(o.length>0){let r=1/0,i=-1/0,s=1/0,a=-1/0;for(let c of o){let l=n.layout.chipPlacements[c],h=n.inputProblem.chipMap[c],d=h.size.x,u=h.size.y;if(l.ccwRotationDegrees===90||l.ccwRotationDegrees===270)[d,u]=[u,d];let _=l.x-d/2,p=l.x+d/2,m=l.y-u/2,A=l.y+u/2;r=Math.min(r,_),i=Math.max(i,p),s=Math.min(s,m),a=Math.max(a,A)}e.push({partitionIndex:t,chipIds:o,bounds:{minX:r,maxX:i,minY:s,maxY:a}})}}return e}createPackInput(e){let t=this.getConnectivityMap();return{components:e.map((o)=>{let r=this.packedPartitions[o.partitionIndex],i=this.partitionHasFixedChip(o.partitionIndex),s=o.bounds.maxX-o.bounds.minX,a=o.bounds.maxY-o.bounds.minY,c=(o.bounds.minX+o.bounds.maxX)/2,l=(o.bounds.minY+o.bounds.maxY)/2,h=[{padId:`partition_${o.partitionIndex}_body`,networkId:`partition_${o.partitionIndex}_disconnected`,type:"rect",offset:{x:0,y:0},size:{x:Math.max(s,0.1),y:Math.max(a,0.1)}}],d=new Set;for(let u of o.chipIds){let _=r.layout.chipPlacements[u],p=r.inputProblem.chipMap[u];for(let m of p.pins){let A=r.inputProblem.chipPinMap[m];if(!A)continue;let g={x:A.offset.x,y:A.offset.y},f=_.ccwRotationDegrees??0;if(f===90)g={x:-A.offset.y,y:A.offset.x};else if(f===180)g={x:-A.offset.x,y:-A.offset.y};else if(f===270)g={x:A.offset.y,y:-A.offset.x};let y=_.x+g.x,x=_.y+g.y,C=t.get(m)??`${m}_disconnected`;if(!d.has(C))d.add(C),h.push({padId:`${o.partitionIndex}_pin_${m}`,networkId:C,type:"rect",offset:{x:y-c,y:x-l},size:{x:0.01,y:0.01}})}}return{componentId:`partition_${o.partitionIndex}`,pads:h,availableRotationDegrees:[0],...i&&{isStatic:!0,center:{x:c,y:l},ccwRotationOffset:0}}}),minGap:this.inputProblem.partitionGap,packOrderStrategy:"largest_to_smallest",packPlacementStrategy:"minimum_sum_squared_distance_to_network"}}applyPackingResult(e,t){let n={};for(let r of e){let i=parseInt(r.componentId.replace("partition_","")),s=t.find((c)=>c.partitionIndex===i),a=this.packedPartitions[i];if(s&&a){let c=(s.bounds.minX+s.bounds.maxX)/2,l=(s.bounds.minY+s.bounds.maxY)/2,h=r.center.x,d=r.center.y,u=h-c,_=d-l;for(let p of s.chipIds){let m=a.layout.chipPlacements[p];n[p]={x:m.x+u,y:m.y+_,ccwRotationDegrees:m.ccwRotationDegrees}}}}let o={chipPlacements:n,groupPlacements:{}};return Y8r({inputProblem:this.inputProblem,chipPlacements:o.chipPlacements,pinToNetworkMap:this.getConnectivityMap()}),o}getCombinedPackedPartitionsProblem(){let e={chipMap:{},chipPinMap:{},pinStrongConnMap:{},netMap:{},netConnMap:{},chipGap:this.inputProblem.chipGap,partitionGap:this.inputProblem.partitionGap};for(let t of this.packedPartitions)Object.assign(e.chipMap,t.inputProblem.chipMap),Object.assign(e.chipPinMap,t.inputProblem.chipPinMap),Object.assign(e.pinStrongConnMap,t.inputProblem.pinStrongConnMap),Object.assign(e.netMap,t.inputProblem.netMap),Object.assign(e.netConnMap,t.inputProblem.netConnMap);return e}getCombinedPackedPartitionsLayout(){let e={};for(let t of this.packedPartitions)Object.assign(e,t.layout.chipPlacements);return{chipPlacements:e,groupPlacements:{}}}visualize(){if(this.packSolver2&&!this.solved)return this.packSolver2.visualize();if(!this.finalLayout){if(this.packedPartitions.length===0)return super.visualize();return Sp(this.getCombinedPackedPartitionsProblem(),this.getCombinedPackedPartitionsLayout())}return Sp(this.getCombinedPackedPartitionsProblem(),this.finalLayout)}getConstructorParams(){return{packedPartitions:this.packedPartitions,inputProblem:this.inputProblem}}},U8r=0.2,_ln=(e,t)=>t.y+ys(e.offset,t.ccwRotationDegrees).y,T6e=({upperPin:e,upperPlacement:t,lowerPin:n,lowerPlacement:o})=>_ln(e,t)-_ln(n,o)-U8r,gln=({chipId:e,side:t},n)=>n.chipMap[e]?.pins.filter((r)=>!t||n.chipPinMap[r]?.side===t).map((r)=>n.chipPinMap[r]).find((r)=>r&&Object.values(n.netMap).some((i)=>i.isPositiveVoltageSource&&n.netConnMap[`${r.pinId}-${i.netId}`])),Tet=(e,{inputProblem:t,layout:n})=>{let o=n.chipPlacements[e],r=t.chipMap[e];if(!o||!r)return null;let i=C0(r.size,o.ccwRotationDegrees);return Pd({center:o,width:i.x,height:i.y})},Aln=(e,t)=>{let n=e.flatMap((o)=>{let r=Tet(o,t);if(!r)return[];return[{x:r.minX,y:r.minY},{x:r.maxX,y:r.maxY}]});return Hs(n)},W8r=({mainPartition:e,mainChipId:t,side:n},o)=>{let r=new Set(o.chipMap[t]?.pins.filter((s)=>o.chipPinMap[s]?.side===n)),i=xY(e.inputProblem);for(let[s,a]of Object.entries(o.pinStrongConnMap)){if(!a)continue;let[c,l]=s.split("-"),h=r.has(c)?l:r.has(l)?c:null;if(!h)continue;let d=i.get(h);if(d?.chipId===t)continue;if(d)return d.chipId}return null},X8r=({partitionA:e,partitionB:t},n)=>{let o=new Set(Object.keys(e.inputProblem.chipPinMap)),r=new Set(Object.keys(t.inputProblem.chipPinMap));return Object.entries(n.pinStrongConnMap).some(([i,s])=>{if(!s)return!1;let[a,c]=i.split("-");return o.has(a)&&r.has(c)||o.has(c)&&r.has(a)})},j8r=(e,t)=>{let n=new Set(e);return e.some((o)=>{let r=Tet(o,t);return Object.keys(t.layout.chipPlacements).some((i)=>{if(!r||n.has(i))return!1;let s=Tet(i,t);return s?qp(r,s):!1})})},K8r=({side:e,chipGap:t,mainBounds:n,rowBounds:o,neighbor:r})=>{let i=m3(o),s={x:r.x-i.x,y:r.y-i.y};if(e==="x+")s.x=n.maxX+t-o.minX;if(e==="x-")s.x=n.minX-t-o.maxX;if(e==="y+")s.y=n.maxY+t-o.minY;if(e==="y-")s.y=n.minY-t-o.maxY;return s},$8r=({layout:e,decouplingPartition:t},{inputProblem:n,packedPartitions:o})=>{let r=t.inputProblem,{decouplingMainChipId:i,decouplingMainChipSide:s}=r;if(r.partitionType!=="decoupling_caps"||!i||!s)return;let a=o.find((f)=>f!==t&&f.inputProblem.chipMap[i]);if(!a||X8r({partitionA:t,partitionB:a},n))return;let c=W8r({mainPartition:a,mainChipId:i,side:s},n),l=e.chipPlacements[i];if(c)l=e.chipPlacements[c];let h=Object.keys(r.chipMap),d={inputProblem:n,layout:e},u=Aln(Object.keys(a.inputProblem.chipMap),d),_=Aln(h,d);if(!l||!u||!_)return;if(!c){let f=h[0],y=gln({chipId:i,side:s},n),x=f&&gln({chipId:f},n),C=f&&e.chipPlacements[f];if(!y||!x||!C)return;l={...l,y:l.y+T6e({upperPin:y,upperPlacement:l,lowerPin:x,lowerPlacement:{...C,y:l.y}})}}let p=n.chipGap;if(!c)p=n.partitionGap;let m=K8r({side:s,chipGap:p,mainBounds:u,rowBounds:_,neighbor:l}),A=B6e.translate(m.x,m.y),g=new Map;for(let f of h){let y=e.chipPlacements[f];if(!y)continue;g.set(f,y),e.chipPlacements[f]={...y,...B6e.applyToPoint(A,y)}}if(j8r(h,d))for(let[f,y]of g)e.chipPlacements[f]=y},q8r=class extends ef{constructor(e){super();this.options=e}options;outputLayout=null;_step(){this.outputLayout=structuredClone(this.options.inputLayout);for(let e of this.options.packedPartitions)$8r({layout:this.outputLayout,decouplingPartition:e},this.options);this.solved=!0}visualize(){return Sp(this.options.inputProblem,this.outputLayout??this.options.inputLayout)}getConstructorParams(){return[this.options]}},J8r=[0,90,180,270],fln=0,f6e=0.5,yln=({chip:e,upperPinId:t,lowerPinId:n,inputProblem:o})=>{let r=o.chipPinMap[t],i=o.chipPinMap[n];if(!r||!i)return fln;let s=e.availableRotations??J8r,a=fln,c=Number.NEGATIVE_INFINITY;for(let l of s){let h=ys(r.offset,l),d=ys(i.offset,l),u=h.y-d.y;if(u<=c)continue;c=u,a=l}return a},Z8r=({railLoadPairs:e,inputProblem:t,inputLayout:n})=>{let o=structuredClone(n),{chipPlacements:r}=o,i=new Map;for(let s of e){let a=i.get(s.mainChipId)??[];a.push(s),i.set(s.mainChipId,a)}for(let s of i.values()){let a;for(let c of s){let l=r[c.railComponent.chipId],h=r[c.resistor.chipId],d=r[c.mainChipId],u=t.chipPinMap[c.mainPinId];if(!l||!h)continue;if(!d||!u)continue;let _=yln({chip:c.railComponent,upperPinId:c.railPinId,lowerPinId:c.railComponentResistorPinId,inputProblem:t}),p=yln({chip:c.resistor,upperPinId:c.resistorRailComponentPinId,lowerPinId:c.resistorMainPinId,inputProblem:t}),m=C0(c.railComponent.size,_),A=C0(c.resistor.size,p),g=m.y*f6e+t.chipGap+A.y*f6e,f=ys(u.offset,d.ccwRotationDegrees),y=t.chipPinMap[c.resistorMainPinId];if(!y)continue;let x=ys(y.offset,p),C=(l.x+h.x)*f6e,b=d.y+f.y-x.y,I=b+g;r[c.railComponent.chipId]={x:C,y:I,ccwRotationDegrees:_},r[c.resistor.chipId]={x:C,y:b,ccwRotationDegrees:p};let v=Math.max(m.x,A.x)*f6e,P=C-v,M=C+v;if(a!==void 0){let B=a+t.partitionGap-P;C+=B,r[c.railComponent.chipId].x=C,r[c.resistor.chipId].x=C,a=M+B;continue}a=M}}return d8r({railLoadPairs:e,inputProblem:t,chipPlacements:r}),o},xln=2,Cln=({connectedPinsByPinId:e,pinId:t})=>(e[t]??[]).map((n)=>n.pinId),e7r=({inputProblem:e,pinId:t})=>{for(let[n,o]of Object.entries(e.netMap)){if(!o.isPositiveVoltageSource)continue;if(e.netConnMap[`${t}-${n}`])return!0}return!1},t7r=(e,t)=>{let{inputProblem:n,pinOwnerMap:o,connectedPinsByPinId:r}=t;for(let i of e.pins){let s=Cln({connectedPinsByPinId:r,pinId:i}).find((u)=>{let _=o.get(u);if(!_)return!1;return _.pins.length>xln&&!_.isCrystal});if(!s)continue;let a=o.get(s);if(!a)continue;let c=e.pins.find((u)=>u!==i);if(!c)continue;let l=Cln({connectedPinsByPinId:r,pinId:c}).find((u)=>{let _=o.get(u);if(!_)return!1;if(_.pins.length!==xln)return!1;return!_.isResistor&&!_.isCapacitor&&!_.fixedPosition});if(!l)continue;let h=o.get(l);if(!h)continue;let d=h.pins.find((u)=>u!==l&&e7r({inputProblem:n,pinId:u}));if(!d)continue;return{railComponent:h,resistor:e,railPinId:d,railComponentResistorPinId:l,resistorRailComponentPinId:c,resistorMainPinId:i,mainChipId:a.chipId,mainPinId:s}}return null},n7r=(e)=>{let t={inputProblem:e,pinOwnerMap:xY(e),connectedPinsByPinId:tJ(e)},n=[];for(let o of Object.values(e.chipMap)){if(!o.isResistor||o.fixedPosition)continue;let r=t7r(o,t);if(r)n.push(r)}return n},o7r=class extends ef{constructor(e){super();this.params=e}params;outputLayout=null;_step(){let e=n7r(this.params.inputProblem);this.outputLayout=Z8r({railLoadPairs:e,inputProblem:this.params.inputProblem,inputLayout:this.params.inputLayout}),this.solved=!0}visualize(){let e=this.params.inputLayout;if(this.outputLayout)e=this.outputLayout;return Sp(this.params.inputProblem,e)}getConstructorParams(){return[this.params]}},hk=2,C6e=({connectedPinsByPinId:e,pinId:t})=>(e[t]??[]).map((n)=>n.pinId),D6e=({inputProblem:e,pinId:t})=>{let n=[];for(let o of Object.keys(e.netMap))if(e.netConnMap[`${t}-${o}`])n.push(o);return n},Oln=({inputProblem:e,netId:t})=>{let n=[];for(let o of Object.keys(e.chipPinMap))if(e.netConnMap[`${o}-${t}`])n.push(o);return n},Ret=({lowerChip:e,lowerInnerPinId:t,inputProblem:n})=>{for(let o of e.pins){if(o===t)continue;let r=D6e({inputProblem:n,pinId:o}).find((i)=>n.netMap[i]?.isGround===!0);if(r)return{groundPinId:o,groundNetId:r}}return null},r7r=({inputProblem:e,pinId:t})=>D6e({inputProblem:e,pinId:t}).some((n)=>e.netMap[n]?.isPositiveVoltageSource===!0),Vln=({upperInnerPinId:e},t)=>{let{inputProblem:n,pinOwnerMap:o,connectedPinsByPinId:r,pairedChipIds:i}=t;for(let s of C6e({connectedPinsByPinId:r,pinId:e})){let a=o.get(s);if(!a)continue;if(a.pins.length!==hk)continue;if(a.fixedPosition)continue;if(i.has(a.chipId))continue;let c=Ret({lowerChip:a,lowerInnerPinId:s,inputProblem:n});if(!c)continue;return{lowerChip:a,lowerInnerPinId:s,...c}}return null},i7r=(e,t)=>{let{inputProblem:n,pinOwnerMap:o,connectedPinsByPinId:r,pairedChipIds:i}=t;for(let s of e.pins){let a=C6e({connectedPinsByPinId:r,pinId:s}).find((_)=>{let p=o.get(_);if(!p)return!1;return p.pins.length>hk&&!p.isCrystal});if(!a)continue;let c=o.get(a);if(!c)continue;let l=e.pins.find((_)=>_!==s);if(!l)continue;let h=C6e({connectedPinsByPinId:r,pinId:l}).map((_)=>o.get(_)).find((_)=>{if(!_)return!1;if(_.pins.length!==hk)return!1;if(_.chipId===e.chipId)return!1;if(_.fixedPosition)return!1;return!i.has(_.chipId)});if(!h)continue;let d=h.pins.find((_)=>C6e({connectedPinsByPinId:r,pinId:_}).some((p)=>o.get(p)?.chipId===e.chipId));if(!d)continue;let u=Ret({lowerChip:h,lowerInnerPinId:d,inputProblem:n});if(!u)continue;return{upperChip:e,lowerChip:h,mainChipId:c.chipId,mainPinId:a,upperOuterPinId:s,upperInnerPinId:l,lowerInnerPinId:d,...u}}return null},s7r=(e,t)=>{let{inputProblem:n,pinOwnerMap:o,pairedChipIds:r}=t,i=e.pins.find((_)=>r7r({inputProblem:n,pinId:_}));if(!i)return null;let s=e.pins.find((_)=>_!==i);if(!s)return null;let a=Vln({upperInnerPinId:s},t);if(a)return{upperChip:e,upperOuterPinId:i,upperInnerPinId:s,...a};let c=D6e({inputProblem:n,pinId:s}).find((_)=>{let p=n.netMap[_];return!p?.isGround&&!p?.isPositiveVoltageSource});if(!c)return null;let l=Oln({inputProblem:n,netId:c});if(l.length!==hk)return null;let h=l.find((_)=>_!==s);if(!h)return null;let d=o.get(h);if(!d)return null;if(d.pins.length!==hk)return null;if(d.fixedPosition)return null;if(r.has(d.chipId))return null;let u=Ret({lowerChip:d,lowerInnerPinId:h,inputProblem:n});if(!u)return null;return{upperChip:e,lowerChip:d,upperOuterPinId:i,upperInnerPinId:s,lowerInnerPinId:h,...u}},a7r=(e,t)=>{let{inputProblem:n}=t;for(let o of e.pins){if(!D6e({inputProblem:n,pinId:o}).some((a)=>{let c=n.netMap[a];if(c?.isGround||c?.isPositiveVoltageSource)return!1;return Oln({inputProblem:n,netId:a}).length===1}))continue;let i=e.pins.find((a)=>a!==o);if(!i)continue;let s=Vln({upperInnerPinId:i},t);if(!s)continue;return{upperChip:e,upperOuterPinId:o,upperInnerPinId:i,...s,isStandaloneSignalChain:!0}}return null},c7r=(e)=>{let t=xY(e),n=[],o=new Set,r=tJ(e),i={inputProblem:e,pinOwnerMap:t,connectedPinsByPinId:r,pairedChipIds:o};for(let s of Object.values(e.chipMap)){if(s.pins.length!==hk)continue;if(s.isCrystal)continue;if(s.fixedPosition)continue;if(o.has(s.chipId))continue;let a=i7r(s,i);if(!a)continue;n.push(a),o.add(a.upperChip.chipId),o.add(a.lowerChip.chipId)}for(let s of Object.values(e.chipMap)){if(s.pins.length!==hk)continue;if(s.isCrystal)continue;if(s.fixedPosition)continue;if(o.has(s.chipId))continue;let a=a7r(s,i);if(!a)continue;n.push(a),o.add(a.upperChip.chipId),o.add(a.lowerChip.chipId)}for(let s of Object.values(e.chipMap)){if(s.pins.length!==hk)continue;if(s.isCrystal)continue;if(s.fixedPosition)continue;if(o.has(s.chipId))continue;let a=s7r(s,i);if(!a)continue;n.push(a),o.add(a.upperChip.chipId),o.add(a.lowerChip.chipId)}return n},l7r=[0,90,180,270],bln=0,Met=0.5,Iln=({chip:e,upperPinId:t,lowerPinId:n,inputProblem:o})=>{let r=o.chipPinMap[t],i=o.chipPinMap[n];if(!r||!i)return bln;let s=l7r;if(e.availableRotations)s=e.availableRotations;let a=bln,c=Number.NEGATIVE_INFINITY;for(let l of s){let h=ys(r.offset,l),d=ys(i.offset,l),u=h.y-d.y;if(u<=c)continue;c=u,a=l}return a},wet=({chip:e,placement:t})=>{let n=C0(e.size,t.ccwRotationDegrees);return Pd({center:t,width:n.x,height:n.y})},h7r=({groundedLoadPair:e,chipPlacements:t,inputProblem:n})=>{let o=t[e.upperChip.chipId],r=t[e.lowerChip.chipId];if(!o||!r)return;let i=wet({chip:e.upperChip,placement:o}),s=wet({chip:e.lowerChip,placement:r}),a=Hs([{x:i.minX,y:i.minY},{x:i.maxX,y:i.maxY},{x:s.minX,y:s.minY},{x:s.maxX,y:s.maxY}]);if(!a)return;let c=0;for(let[l,h]of Object.entries(t)){if(l===e.upperChip.chipId)continue;if(l===e.lowerChip.chipId)continue;let d=n.chipMap[l];if(!d)continue;let u=wet({chip:d,placement:h});if(a.maxX+n.chipGap<=u.minX||a.minX-n.chipGap>=u.maxX)continue;if(u.maxY<=a.maxY)continue;let p=a.maxY+n.chipGap-u.minY;c=Math.max(c,p)}o.y-=c,r.y-=c},d7r=({groundedLoadPair:e,chipPlacements:t,inputProblem:n})=>{let o=t[e.upperChip.chipId],r=t[e.lowerChip.chipId];if(!o||!r)return;let i=Iln({chip:e.upperChip,upperPinId:e.upperOuterPinId,lowerPinId:e.upperInnerPinId,inputProblem:n}),s=Iln({chip:e.lowerChip,upperPinId:e.lowerInnerPinId,lowerPinId:e.groundPinId,inputProblem:n}),a=C0(e.upperChip.size,i),c=C0(e.lowerChip.size,s),l=a.y*Met+n.chipGap+c.y*Met,h=n.chipPinMap[e.upperInnerPinId],d=n.chipPinMap[e.lowerInnerPinId];if(!h||!d)return;let u=ys(h.offset,i),_=ys(d.offset,s),p=Hs([o,r]);if(!p)return;let m=m3(p),A={x:m.x-u.x,y:m.y+l*Met,ccwRotationDegrees:i},g=e.mainPinId;if(g){let f=e.mainChipId;if(!f)return;let y=t[f];if(!y)return;let x=n.chipPinMap[e.upperOuterPinId],C=n.chipPinMap[g];if(!x||!C)return;let b=ys(x.offset,o.ccwRotationDegrees),I=ys(x.offset,i);A.x=o.x+b.x-I.x,A.y=o.y+b.y-I.y,A.y+=T6e({upperPin:C,upperPlacement:y,lowerPin:x,lowerPlacement:A})}t[e.upperChip.chipId]=A,t[e.lowerChip.chipId]={x:A.x+u.x-_.x,y:A.y-l,ccwRotationDegrees:s},h7r({groundedLoadPair:e,chipPlacements:t,inputProblem:n})},Yln=2,dk=(e,t)=>{let{chipPlacements:n}=t,o=n[e.upperChip.chipId],r=n[e.lowerChip.chipId],i=DB({placement:o,size:e.upperChip.size}),s=DB({placement:r,size:e.lowerChip.size});return{minX:Math.min(i.minX,s.minX),maxX:Math.max(i.maxX,s.maxX),minY:Math.min(i.minY,s.minY),maxY:Math.max(i.maxY,s.maxY)}},vln=(e,t)=>{let{chipPlacements:n,inputProblem:o}=t,r=n[e.lowerChip.chipId],i=o.chipPinMap[e.groundPinId],s=ys(i.offset,r.ccwRotationDegrees);return r.y+s.y},S6e=({groundedLoadPair:e,dx:t,dy:n},o)=>{let{chipPlacements:r}=o;for(let i of[e.upperChip.chipId,e.lowerChip.chipId]){let s=r[i];s.x+=t,s.y+=n}},P6e=(e,t)=>dk(e,t).minX,Sln=(e,t)=>{let n=e.map((o)=>dk(o,t));return{minX:Math.min(...n.map((o)=>o.minX)),maxX:Math.max(...n.map((o)=>o.maxX)),minY:Math.min(...n.map((o)=>o.minY)),maxY:Math.max(...n.map((o)=>o.maxY))}},Gln=(e,t,n)=>e.maxY+n<=t.minY||t.maxY+n<=e.minY,u7r=(e,t,n)=>{let{inputProblem:o}=n,r=dk(e,n),i=dk(t,n),s=r.maxX+o.chipGap<=i.minX||i.maxX+o.chipGap<=r.minX,a=Gln(r,i,o.chipGap);return!s&&!a},p7r=(e,t)=>{let n=new Set(e),o=[];while(n.size>0){let r=n.values().next().value;if(!r)break;n.delete(r);let i=[r];for(let s=0;s<i.length;s++){let a=i[s];for(let c of[...n]){if(!u7r(a,c,t))continue;n.delete(c),i.push(c)}}if(i.length>=Yln)o.push(i)}return o},m7r=(e,t)=>{let{inputProblem:n}=t,o=[...e].sort((a,c)=>P6e(a,t)-P6e(c,t)),r=o.map((a)=>vln(a,t)),i=Math.min(...r);for(let a of o){let c=vln(a,t);S6e({groundedLoadPair:a,dx:0,dy:i-c},t)}let s;for(let a of o){let c=dk(a,t);if(s===void 0){s=c.maxX;continue}let l=s+n.partitionGap-c.minX;S6e({groundedLoadPair:a,dx:l,dy:0},t),s=c.maxX+l}},_7r=(e,t)=>{let{inputProblem:n}=t,o=[...e].sort((c,l)=>P6e(c,t)-P6e(l,t)),r=Sln(o,t),i=[];for(let c of o){let l=dk(c,t),h=l.minX;for(let d of i){let u=dk(d,t);if(Gln(u,l,n.chipGap))continue;h=Math.max(h,u.maxX+n.chipGap)}S6e({groundedLoadPair:c,dx:h-l.minX,dy:0},t),i.push(c)}let s=Sln(o,t),a=(r.minX+r.maxX-s.minX-s.maxX)/2;for(let c of o)S6e({groundedLoadPair:c,dx:a,dy:0},t)},g7r=({groundedLoadPairs:e,chipPlacements:t,inputProblem:n})=>{let o={chipPlacements:t,inputProblem:n},r=new Map;for(let s of e){if(!t[s.upperChip.chipId])continue;if(!t[s.lowerChip.chipId])continue;if(!n.chipPinMap[s.groundPinId])continue;let a=r.get(s.groundNetId)??new Map,c=a.get(s.mainChipId)??[];c.push(s),a.set(s.mainChipId,c),r.set(s.groundNetId,a)}for(let s of r.values())for(let a of s.values()){if(a.length<Yln)continue;if(a[0].mainChipId===void 0){m7r(a,o);continue}for(let l of p7r(a,o))_7r(l,o)}let i=y7r({groundedLoadPairs:e,chipPlacements:t,inputProblem:n});h8r({groundedLoadPairs:e.filter((s)=>!i.has(s)),chipPlacements:t,inputProblem:n})},A7r={"x-":{x:-1,y:0},"x+":{x:1,y:0},"y-":{x:0,y:-1},"y+":{x:0,y:1}},f7r=2,y7r=({inputProblem:e,chipPlacements:t,groundedLoadPairs:n})=>{let o=new Set,r=new Set(n);for(let i of r){if(!i.mainChipId||!i.mainPinId)continue;let s=e.chipPinMap[i.mainPinId],a=n.filter((u)=>u.mainChipId===i.mainChipId&&u.mainPinId&&e.chipPinMap[u.mainPinId].side===s.side);if(a.length<f7r)continue;let c=t[i.mainChipId],l=ys(A7r[s.side],c.ccwRotationDegrees);if(l.x===0)continue;a.sort((u,_)=>{let p=ys(e.chipPinMap[u.mainPinId].offset,c.ccwRotationDegrees),m=ys(e.chipPinMap[_.mainPinId].offset,c.ccwRotationDegrees);return p.y-m.y});let h=DB({placement:c,size:e.chipMap[i.mainChipId].size}),d;for(let u of a){r.delete(u);let _=e.chipPinMap[u.mainPinId],p=[u.upperChip.chipId,u.lowerChip.chipId],m=a.filter((b)=>b===u||r.has(b)).flatMap((b)=>[b.upperChip.chipId,b.lowerChip.chipId]),A=t[u.upperChip.chipId],g=T6e({upperPin:_,upperPlacement:c,lowerPin:e.chipPinMap[u.upperOuterPinId],lowerPlacement:A}),{minX:f,maxX:y}=dk(u,{chipPlacements:t,inputProblem:e}),x=Math.max(0,h.maxX+e.chipGap-f);if(l.x<0)x=Math.min(0,h.minX-e.chipGap-y);if(d!==void 0)if(l.x<0)x=Math.min(x,d-e.chipGap-y);else x=Math.max(x,d+e.chipGap-f);let C=[x];for(let[b,I]of Object.entries(t)){if(m.includes(b))continue;let v=DB({placement:I,size:e.chipMap[b].size}),P=v.maxX+e.chipGap-f;if(l.x<0)P=v.minX-e.chipGap-y;if(P*l.x<x*l.x)continue;C.push(P)}C.sort((b,I)=>Math.abs(b)-Math.abs(I));for(let b of C)if(yY({chipIds:p,clearanceGroupChipIds:m,dx:b,dy:g,chipPlacements:t,inputProblem:e})){if(o.add(u),d=y+b,l.x<0)d=f+b;break}}}return o},x7r=class extends ef{constructor(e){super();this.params=e}params;outputLayout=null;groundedLoadPairs=[];_step(){let e={};for(let[t,n]of Object.entries(this.params.inputLayout.chipPlacements))e[t]={...n};this.groundedLoadPairs=c7r(this.params.inputProblem);for(let t of this.groundedLoadPairs)d7r({groundedLoadPair:t,chipPlacements:e,inputProblem:this.params.inputProblem});g7r({groundedLoadPairs:this.groundedLoadPairs,chipPlacements:e,inputProblem:this.params.inputProblem}),this.outputLayout={chipPlacements:e,groupPlacements:{...this.params.inputLayout.groupPlacements}},this.solved=!0}visualize(){let e=this.params.inputLayout;if(this.outputLayout)e=this.outputLayout;return Sp(this.params.inputProblem,e)}getConstructorParams(){return[this.params]}},C7r=(e)=>{let t=Object.values(e.inputProblem.chipMap);return t.length>1&&t.every((n)=>n.pins.length===2&&!n.isCapacitor&&!n.fixedPosition)},b7r=({groundedLoadPairs:e,packedPartitions:t})=>{let o=t.filter(C7r).map((i)=>({chipIds:Object.keys(i.inputProblem.chipMap)})),r=new Set(o.flatMap((i)=>i.chipIds));for(let i of e){if(i.mainChipId)continue;if(i.isStandaloneSignalChain)continue;let s=[i.upperChip.chipId,i.lowerChip.chipId];if(s.some((a)=>r.has(a)))continue;o.push({chipIds:s});for(let a of s)r.add(a)}return o},E6e=({chipId:e},t)=>{let n=t.inputProblem.chipMap[e],o=t.layout.chipPlacements[e];if(!n||!o)return null;let r=C0(n.size,o.ccwRotationDegrees);return Pd({center:o,width:r.x,height:r.y})},Bet=({chipIds:e},t)=>Hs(e.flatMap((n)=>{let o=E6e({chipId:n},t);if(!o)return[];return[{x:o.minX,y:o.minY},{x:o.maxX,y:o.maxY}]})),Pln=({chipIds:e,railNetIds:t},n)=>{let o=null;for(let r of e){let i=n.inputProblem.chipMap[r];if(!i)continue;let s=n.layout.chipPlacements[i.chipId];if(!s)continue;for(let a of i.pins){if(![...t].some((u)=>n.inputProblem.netConnMap[`${a}-${u}`]))continue;let l=n.inputProblem.chipPinMap[a];if(!l)continue;let h=ys(l.offset,s.ccwRotationDegrees),d=s.y+h.y;if(o===null||d>o.y)o={chipId:i.chipId,y:d}}}return o},Eln=({chipIds:e},{inputProblem:t})=>{let n=new Set;for(let o of e){let r=t.chipMap[o];if(!r)continue;for(let i of r.pins)for(let[s,a]of Object.entries(t.netMap)){if(!a.isGround&&!a.isPositiveVoltageSource)continue;if(t.netConnMap[`${i}-${s}`])n.add(s)}}return n},I7r=(e,t)=>e.size>=2&&e.size===t.size&&[...e].every((n)=>t.has(n)),v7r=({chipIds:e,offset:t},{layout:n})=>{let o=new Map;for(let r of e){let i=n.chipPlacements[r];if(!i)continue;o.set(r,i),n.chipPlacements[r]={...i,x:i.x+t.x,y:i.y+t.y}}return o},S7r=({movedChipIds:e},t)=>{let n=new Set(e);return e.some((o)=>{let r=E6e({chipId:o},t);if(!r)return!1;return Object.keys(t.layout.chipPlacements).some((i)=>{if(n.has(i))return!1;let s=E6e({chipId:i},t);if(!s)return!1;return qp(r,s)})})},P7r=(e)=>{let{groundedLoadPairs:t,inputProblem:n,packedPartitions:o}=e,r=structuredClone(e.inputLayout),i={inputProblem:n,layout:r},s=o.filter((l)=>l.inputProblem.partitionType==="decoupling_caps"),a=b7r({groundedLoadPairs:t,packedPartitions:o}),c=new Set;for(let l of s){let h=Eln({chipIds:Object.keys(l.inputProblem.chipMap)},i),d=Object.keys(l.inputProblem.chipMap),u=Bet({chipIds:d},i);if(!u)continue;let _=Pln({chipIds:d,railNetIds:h},i);if(!_)continue;let p=u.maxX;for(let m of a){if(c.has(m))continue;let A=Eln({chipIds:m.chipIds},i);if(!I7r(h,A))continue;let g=m.chipIds;if(!Bet({chipIds:g},i))continue;let y=Pln({chipIds:g,railNetIds:A},i);if(!y)continue;let x=E6e({chipId:y.chipId},i);if(!x)continue;let C=v7r({chipIds:g,offset:{x:p+n.partitionGap-x.minX,y:_.y-y.y}},i);if(S7r({movedChipIds:g},i)){for(let[I,v]of C)r.chipPlacements[I]=v;continue}let b=Bet({chipIds:g},i);if(b)p=b.maxX;c.add(m)}}return r},E7r=class extends ef{constructor(e){super();this.options=e}options;outputLayout=null;_step(){this.outputLayout=P7r(this.options),this.solved=!0}visualize(){return Sp(this.options.inputProblem,this.outputLayout??this.options.inputLayout)}getConstructorParams(){return[this.options]}},Uln=(e,t)=>Object.keys(t.netMap).filter((n)=>t.netConnMap[`${e}-${n}`]),Wln=(e,t)=>new Set(e.pins.flatMap((n)=>Uln(n,t))),Mln=({chipId:e,railNetId:t},n)=>{let o=n.chipMap[e]?.pins.find((r)=>Uln(r,n).includes(t));if(!o)return null;return n.chipPinMap[o]??null},M6e=(e,{inputProblem:t,layout:n})=>{let o=t.chipMap[e],r=n.chipPlacements[e];if(!o||!r)return null;return DB({placement:r,size:o.size})},wln=(e,t)=>e.reduce((n,o)=>n+t.chipPlacements[o].x,0)/e.length,M7r=({groundNetId:e,railNetId:t},{inputProblem:n,layout:o})=>Object.values(n.chipMap).filter((r)=>{if(!r.isCapacitor||r.fixedPosition||r.pins.length!==2)return!1;if(!o.chipPlacements[r.chipId])return!1;let i=Wln(r,n);return i.size===2&&i.has(e)&&i.has(t)}).map((r)=>r.chipId),w7r=(e,t)=>{let{inputProblem:n,layout:o}=t;if(e.fixedPosition||e.pins.length!==3)return null;let r=o.chipPlacements[e.chipId];if(!r)return null;let i=[...Wln(e,n)],s=i.filter((d)=>n.netMap[d]?.isGround),a=i.filter((d)=>n.netMap[d]?.isPositiveVoltageSource);if(s.length!==1||a.length!==2)return null;let c=a.map((d)=>({railNetId:d,capacitorChipIds:M7r({groundNetId:s[0],railNetId:d},t)}));if(c.some((d)=>d.capacitorChipIds.length===0))return null;let l=c.find((d)=>wln(d.capacitorChipIds,o)<r.x),h=c.find((d)=>wln(d.capacitorChipIds,o)>r.x);if(!l||!h)return null;return l.capacitorChipIds.sort((d,u)=>o.chipPlacements[d].x-o.chipPlacements[u].x),h.capacitorChipIds.sort((d,u)=>o.chipPlacements[d].x-o.chipPlacements[u].x),{regulatorChipId:e.chipId,left:l,right:h}},Bln=({group:e,regulatorChipId:t,startX:n,xDirection:o},r)=>{let{inputProblem:i,layout:s}=r,a=s.chipPlacements[t],c=Mln({chipId:t,railNetId:e.railNetId},i);if(!a||!c)return!1;let l=[...e.capacitorChipIds];if(o<0)l.reverse();let h=i.decouplingCapsGap??i.chipGap,d=n;for(let u of l){let _=s.chipPlacements[u],p=M6e(u,r),m=Mln({chipId:u,railNetId:e.railNetId},i);if(!_||!p||!m)return!1;let A=p.maxX-p.minX;s.chipPlacements[u]={..._,x:d+o*A/2,y:_.y+T6e({upperPin:c,upperPlacement:a,lowerPin:m,lowerPlacement:_})},d+=o*(A+h)}return!0},B7r=(e,t)=>{let n=M6e(e.regulatorChipId,t);if(!n)return!1;if(!Bln({group:e.left,regulatorChipId:e.regulatorChipId,startX:n.minX-t.inputProblem.chipGap,xDirection:-1},t))return!1;return Bln({group:e.right,regulatorChipId:e.regulatorChipId,startX:n.maxX+t.inputProblem.chipGap,xDirection:1},t)},T7r=(e,t)=>{let{inputProblem:n,layout:o}=t,r=new Set(e),i=e.map((u)=>M6e(u,t)),s=Math.min(...i.map((u)=>u.minX)),a=Math.min(...i.map((u)=>u.minY)),c=Math.max(...i.map((u)=>u.maxX)),l=Math.max(...i.map((u)=>u.maxY)),h=(s+c)/2,d=0;for(let u of Object.keys(o.chipPlacements)){if(r.has(u))continue;let _=M6e(u,t);if(!_||(_.minX+_.maxX)/2<=h)continue;if(Math.max(_.minY-l,a-_.maxY,0)>=n.partitionGap)continue;d=Math.min(d,_.minX-n.partitionGap-c)}return d},D7r=(e,t)=>{let n=structuredClone(t),o={inputProblem:e,layout:n},r=Object.values(e.chipMap).map((c)=>w7r(c,o)).find((c)=>c!==null);if(!r)return n;let i=[...r.left.capacitorChipIds,r.regulatorChipId,...r.right.capacitorChipIds];if(!B7r(r,o))return t;let a=T7r(i,o);if(!yY({chipIds:i,clearanceGroupChipIds:i,dx:a,dy:0,chipPlacements:n.chipPlacements,inputProblem:e,minimumOutsideGap:e.partitionGap}))return t;return n},N7r=class extends ef{constructor(e){super();this.params=e}params;outputLayout=null;_step(){this.outputLayout=D7r(this.params.inputProblem,this.params.inputLayout),this.solved=!0}visualize(){let e=this.params.inputLayout;if(this.outputLayout)e=this.outputLayout;return Sp(this.params.inputProblem,e)}getConstructorParams(){return[this.params]}};function d6(e,t,n,o={}){return{solverName:e,solverClass:t,getConstructorParams:n,onSolved:o.onSolved}}var N6e=class extends ef{getSolverName(){return"LayoutPipelineSolver"}identifyCrystalCircuitsSolver;identifyDecouplingCapsSolver;chipPartitionsSolver;packInnerPartitionsSolver;partitionPackingSolver;groundedLoadPairSolver;alignPowerGroundRowsSolver;alignTestPointsSolver;placeNetOnlyDecouplingRowsSolver;placeRailConnectedLoadsSolver;alignChipConnectedRailLoadsSolver;alignRegulatorCapacitorRowSolver;startTimeOfPhase;endTimeOfPhase;timeSpentOnPhase;firstIterationOfPhase;pinIdToStronglyConnectedPins;inputProblem;chipPartitions;packedPartitions;pipelineDef=[d6("identifyCrystalCircuitsSolver",Lvr,()=>[this.inputProblem]),d6("identifyDecouplingCapsSolver",kvr,()=>[this.inputProblem],{onSolved:(e)=>{}}),d6("chipPartitionsSolver",Tvr,()=>[{inputProblem:this.inputProblem,decouplingCapGroups:this.identifyDecouplingCapsSolver?.outputDecouplingCapGroups,crystalCircuitGroups:this.identifyCrystalCircuitsSolver?.outputCrystalCircuitGroups}],{onSolved:(e)=>{this.chipPartitions=this.chipPartitionsSolver.partitions}}),d6("packInnerPartitionsSolver",z8r,()=>[{partitions:this.chipPartitions,pinIdToStronglyConnectedPins:this.pinIdToStronglyConnectedPins}],{onSolved:(e)=>{this.packedPartitions=this.packInnerPartitionsSolver.packedPartitions}}),d6("partitionPackingSolver",G8r,()=>[{packedPartitions:this.packedPartitions||[],inputProblem:this.inputProblem}],{onSolved:(e)=>{}}),d6("alignPowerGroundRowsSolver",Fvr,()=>[{inputProblem:this.inputProblem,inputLayout:this.partitionPackingSolver.finalLayout}]),d6("placeNetOnlyDecouplingRowsSolver",q8r,()=>[{inputProblem:this.inputProblem,packedPartitions:this.packedPartitions,inputLayout:this.alignPowerGroundRowsSolver.outputLayout}]),d6("groundedLoadPairSolver",x7r,()=>[{inputProblem:this.inputProblem,inputLayout:this.placeNetOnlyDecouplingRowsSolver.outputLayout}]),d6("placeRailConnectedLoadsSolver",E7r,()=>[{inputProblem:this.inputProblem,groundedLoadPairs:this.groundedLoadPairSolver.groundedLoadPairs,packedPartitions:this.packedPartitions,inputLayout:this.groundedLoadPairSolver.outputLayout}]),d6("alignChipConnectedRailLoadsSolver",o7r,()=>[{inputProblem:this.inputProblem,inputLayout:this.placeRailConnectedLoadsSolver.outputLayout}]),d6("alignRegulatorCapacitorRowSolver",N7r,()=>[{inputProblem:this.inputProblem,inputLayout:this.alignChipConnectedRailLoadsSolver.outputLayout??this.placeRailConnectedLoadsSolver.outputLayout}]),d6("alignTestPointsSolver",r8r,()=>[{inputProblem:this.inputProblem,inputLayout:this.alignRegulatorCapacitorRowSolver.outputLayout??this.alignChipConnectedRailLoadsSolver.outputLayout??this.placeRailConnectedLoadsSolver.outputLayout??this.groundedLoadPairSolver.outputLayout??this.placeNetOnlyDecouplingRowsSolver.outputLayout??this.alignPowerGroundRowsSolver.outputLayout??this.partitionPackingSolver.finalLayout}])];constructor(e){super();this.inputProblem=e,this.MAX_ITERATIONS=1e6,this.startTimeOfPhase={},this.endTimeOfPhase={},this.timeSpentOnPhase={},this.firstIterationOfPhase={},this.pinIdToStronglyConnectedPins=tJ(e)}currentPipelineStepIndex=0;_step(){let e=this.pipelineDef[this.currentPipelineStepIndex];if(!e){this.solved=!0;return}if(this.activeSubSolver){if(this.activeSubSolver.step(),this.activeSubSolver.solved)this.endTimeOfPhase[e.solverName]=performance.now(),this.timeSpentOnPhase[e.solverName]=this.endTimeOfPhase[e.solverName]-this.startTimeOfPhase[e.solverName],e.onSolved?.(this),this.activeSubSolver=null,this.currentPipelineStepIndex++;else if(this.activeSubSolver.failed)this.error=this.activeSubSolver?.error,this.failed=!0,this.activeSubSolver=null;return}let t=e.getConstructorParams(this);this.activeSubSolver=new e.solverClass(...t),this[e.solverName]=this.activeSubSolver,this.timeSpentOnPhase[e.solverName]=0,this.startTimeOfPhase[e.solverName]=performance.now(),this.firstIterationOfPhase[e.solverName]=this.iterations}solveUntilPhase(e){while(this.getCurrentPhase()!==e)this.step()}getCurrentPhase(){return this.pipelineDef[this.currentPipelineStepIndex]?.solverName??"none"}visualize(){if(!this.solved&&this.activeSubSolver)return this.activeSubSolver.visualize();if(this.solved&&this.alignTestPointsSolver?.solved)return this.alignTestPointsSolver.visualize();if(this.solved&&this.placeNetOnlyDecouplingRowsSolver?.solved)return this.placeNetOnlyDecouplingRowsSolver.visualize();if(this.solved&&this.alignPowerGroundRowsSolver?.solved)return this.alignPowerGroundRowsSolver.visualize();if(this.solved&&this.groundedLoadPairSolver?.solved)return this.groundedLoadPairSolver.visualize();if(this.solved&&this.partitionPackingSolver?.solved)return this.partitionPackingSolver.visualize();let e=this.identifyCrystalCircuitsSolver?.visualize(),t=this.identifyDecouplingCapsSolver?.visualize(),n=this.chipPartitionsSolver?.visualize(),o=this.packInnerPartitionsSolver?.visualize(),r=this.partitionPackingSolver?.visualize(),i=this.groundedLoadPairSolver?.visualize(),s=this.alignPowerGroundRowsSolver?.visualize(),a=this.alignTestPointsSolver?.visualize(),c=this.placeNetOnlyDecouplingRowsSolver?.visualize(),l=TB(this.inputProblem),d=[Sp(this.inputProblem,l),e,t,n,o,r,i,s,c,a].filter(Boolean).map((u,_)=>{for(let p of u.rects??[])p.step=_;for(let p of u.points??[])p.step=_;for(let p of u.circles??[])p.step=_;for(let p of u.texts??[])p.step=_;for(let p of u.lines??[])p.step=_;return u});if(d.length===1)return d[0];return{points:d.flatMap((u)=>u.points||[]),rects:d.flatMap((u)=>u.rects||[]),lines:d.flatMap((u)=>u.lines||[]),circles:d.flatMap((u)=>u.circles||[]),texts:d.flatMap((u)=>u.texts||[])}}preview(){if(this.activeSubSolver)return this.activeSubSolver.preview();if(this.alignTestPointsSolver?.solved)return this.alignTestPointsSolver.visualize();if(this.placeNetOnlyDecouplingRowsSolver?.solved)return this.placeNetOnlyDecouplingRowsSolver.visualize();if(this.alignPowerGroundRowsSolver?.solved)return this.alignPowerGroundRowsSolver.visualize();if(this.partitionPackingSolver?.solved)return this.partitionPackingSolver.visualize();if(this.packInnerPartitionsSolver?.solved)return this.packInnerPartitionsSolver.visualize();if(this.chipPartitionsSolver?.solved)return this.chipPartitionsSolver.visualize();if(this.identifyDecouplingCapsSolver?.solved)return this.identifyDecouplingCapsSolver.visualize();if(this.identifyCrystalCircuitsSolver?.solved)return this.identifyCrystalCircuitsSolver.visualize();return super.preview()}checkForOverlaps(e){let t=[],n=Object.keys(e.chipPlacements);for(let o=0;o<n.length;o++)for(let r=o+1;r<n.length;r++){let i=n[o],s=n[r],a=e.chipPlacements[i],c=e.chipPlacements[s],l=this.inputProblem.chipMap[i],h=this.inputProblem.chipMap[s];if(!l||!h)continue;let d=this.getRotatedBounds(a,l.size),u=this.getRotatedBounds(c,h.size),_=this.calculateOverlapArea(d,u);if(_>0)t.push({chip1:i,chip2:s,overlapArea:_})}return t}getRotatedBounds(e,t){let n=t.x/2,o=t.y/2,r=e.ccwRotationDegrees*Math.PI/180,i=Math.abs(Math.cos(r)),s=Math.abs(Math.sin(r)),a=n*i+o*s,c=n*s+o*i;return{minX:e.x-a,maxX:e.x+a,minY:e.y-c,maxY:e.y+c}}calculateOverlapArea(e,t){if(e.maxX<=t.minX||e.minX>=t.maxX||e.maxY<=t.minY||e.minY>=t.maxY)return 0;let n=Math.min(e.maxX,t.maxX)-Math.max(e.minX,t.minX),o=Math.min(e.maxY,t.maxY)-Math.max(e.minY,t.minY);return n*o}getOutputLayout(){if(!this.solved)throw Error("Pipeline not solved yet. Call solve() or step() until solved.");let e;if(this.alignTestPointsSolver?.solved&&this.alignTestPointsSolver.outputLayout)e=this.alignTestPointsSolver.outputLayout;else if(this.placeNetOnlyDecouplingRowsSolver?.solved&&this.placeNetOnlyDecouplingRowsSolver.outputLayout)e=this.placeNetOnlyDecouplingRowsSolver.outputLayout;else if(this.alignPowerGroundRowsSolver?.solved&&this.alignPowerGroundRowsSolver.outputLayout)e=this.alignPowerGroundRowsSolver.outputLayout;else if(this.partitionPackingSolver?.solved&&this.partitionPackingSolver.finalLayout)e=this.partitionPackingSolver.finalLayout;else throw Error("No layout available. Pipeline may have failed or not progressed far enough.");let t=this.checkForOverlaps(e);if(t.length>0){let n=t.map((o)=>`${o.chip1} overlaps ${o.chip2} (area: ${o.overlapArea.toFixed(4)})`).join(", ");console.warn(`Warning: ${t.length} chip overlaps detected in final layout: ${n}`)}return e}};er();er();er();er();er();yc();$p();er();er();var jln={flexGrow:0,flexShrink:1,flexBasis:0,alignSelf:"auto",width:void 0,height:void 0},Kln=class{id;metadata;size={width:0,height:0};position={x:0,y:0};style;constructor(e={}){this.style={...jln,...e},this.id=e.id,this.metadata=e.metadata}},R7r=class extends Kln{build(){}},Xln=class e extends Kln{children=[];direction="row";columnGap=0;rowGap=0;justifyContent="flex-start";alignItems="stretch";constructor(t,n,o={}){super({});this.size.width=t,this.size.height=n,this.id=o.id,Object.assign(this,o)}addChild(t,n){if(t instanceof e){let r=t;if(n)r.style={...jln,...n};return this.children.push(r),r}let o=new R7r(t);return this.children.push(o),o}build(){let t=this.direction.startsWith("row"),n=t?"width":"height",o=t?"height":"width",r=t?this.columnGap:this.rowGap,i=t?this.rowGap:this.columnGap,s=r*Math.max(0,this.children.length-1),a=this.size[n],c=this.size[o],l=0,h=0,d=0;for(let C of this.children)l+=C.style.flexBasis,h+=C.style.flexGrow,d+=C.style.flexShrink;let u=a-l-s;for(let C of this.children){let b=C.style.flexBasis;if(u>0&&h>0)b+=u*C.style.flexGrow/h;else if(u<0&&d>0){if(b+=u*C.style.flexShrink/d,b<0)b=0}C.size[n]=b;let I=C.style.alignSelf!=="auto"?C.style.alignSelf:this.alignItems,v=t?C.style.height:C.style.width;if(v!==void 0)C.size[o]=v;else if(I==="stretch")C.size[o]=c}let _=this.children.reduce((C,b)=>C+b.size[n],0)+s,p=a-_,m=0,A=r,g=this.children.length;switch(this.justifyContent){case"flex-start":break;case"flex-end":m=p;break;case"center":m=p/2;break;case"space-between":A=g>1?r+p/(g-1):0;break;case"space-around":A=r+p/g,m=A/2;break;case"space-evenly":A=r+p/(g+1),m=A;break}let f=this.direction.endsWith("reverse")?[...this.children].reverse():this.children,y=m;for(let C of f){if(t)C.position.x=this.direction==="row"?y:a-y-C.size.width,C.position.y=x(C,o,c,this.alignItems);else C.position.y=this.direction==="column"?y:a-y-C.size.height,C.position.x=x(C,o,c,this.alignItems);y+=C.size[n]+A}for(let C of this.children)if(C instanceof e)C.build();function x(C,b,I,v){switch(C.style.alignSelf!=="auto"?C.style.alignSelf:v){case"flex-start":return 0;case"flex-end":return I-C.size[b];case"center":return(I-C.size[b])/2;case"stretch":default:return 0}}}},R6e=class extends Xln{constructor(e,t,n={}){super(e,t,n)}getLayout(){this.build();let e={};return this._collectLayout(this,e),e}_collectLayout(e,t,n={counter:0}){for(let o of e.children){let r=o.id??`_$$${n.counter++}`;if(t[r]={position:o.position,size:o.size},o instanceof Xln)this._collectLayout(o,t,n)}}};qt();er();qt();var $ln=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20].map((e)=>`hsl(${e*360/21}deg, 100%, 50%)`),Q7r=(e)=>{let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n);return t},ehn=(e)=>$ln[Math.abs(Q7r(e))%$ln.length],k7r=(e)=>{let t=(p)=>!p?void 0:typeof p==="string"?p:p.join(" "),n=["display:grid","background-color:gray"],{gridTemplateRows:o,gridTemplateColumns:r,gap:i,justifyItems:s,alignItems:a,containerWidth:c,containerHeight:l}=e.opts,h=t(o);if(h)n.push(`grid-template-rows:${h}`);let d=t(r);if(d)n.push(`grid-template-columns:${d}`);if(i!==void 0)if(typeof i==="number")n.push(`gap:${i}px`);else{let[p,m]=i;n.push(`row-gap:${p}px`,`column-gap:${m}px`)}if(s)n.push(`justify-items:${s}`);if(a)n.push(`align-items:${a}`);if(c!=null)n.push(`width:${c}px`);if(l!=null)n.push(`height:${l}px`);let u=n.join(";"),_=e.opts.children.map((p)=>{let m=["display:flex",`background-color:${ehn(p.key)}`];if(p.area)m.push(`grid-area:${p.area}`);else{if(typeof p.row==="string"&&p.row.includes("/"))m.push(`grid-row:${p.row}`);else{let y=p.rowStart??p.row,{rowEnd:x,rowSpan:C}=p;if(y!==void 0||x!==void 0)if(y!==void 0&&x!==void 0)m.push(`grid-row:${y} / ${x}`);else if(y!==void 0)C!==void 0?m.push(`grid-row:${y} / span ${C}`):m.push(`grid-row-start:${y}`);else m.push(`grid-row-end:${x}`);else if(C!==void 0)m.push(`grid-row:auto / span ${C}`)}if(typeof p.column==="string"&&p.column.includes("/"))m.push(`grid-column:${p.column}`);else{let y=p.columnStart??p.column,{columnEnd:x,columnSpan:C}=p;if(y!==void 0||x!==void 0)if(y!==void 0&&x!==void 0)m.push(`grid-column:${y} / ${x}`);else if(y!==void 0)C!==void 0?m.push(`grid-column:${y} / span ${C}`):m.push(`grid-column-start:${y}`);else m.push(`grid-column-end:${x}`);else if(C!==void 0)m.push(`grid-column:auto / span ${C}`)}}let A=m.join(";"),g=["font-size: 7px"];if(p.contentWidth!==void 0){let y=typeof p.contentWidth==="string"?p.contentWidth:`${p.contentWidth}px`;g.push(`width:${y}`)}else g.push(`width:${p.key.length*5}px`);if(p.contentHeight!==void 0){let y=typeof p.contentHeight==="string"?p.contentHeight:`${p.contentHeight}px`;g.push(`height:${y}`)}let f=g.join(";");return`  <div id="${p.key}" style="${A}"><div style="${f}">${p.key}</div></div>`});return`<div style="${u}">
${_.join(`
`)}
</div>`},L7r=(e)=>{let t=e.layout(),n={title:"CssGrid",coordinateSystem:"screen",lines:[],circles:[],points:[],rects:[],texts:[]},{cells:o}=t;for(let r of o){let{x:i,y:s,width:a,height:c,key:l}=r;n.rects.push({center:{x:i+a/2,y:s+c/2},width:a,height:c,fill:ehn(l),label:l})}return n};function Q6e(e){return e.replace(/repeat\((\d+),\s*([^)]+)\)/g,(t,n,o)=>Array(Number(n)).fill(o.trim()).join(" "))}function k6e(e){return e.trim().split(/\s+/).filter(Boolean)}function qln(e){if(!e)return 0;return k6e(Q6e(e)).length}function Jln(e,t){if(e==="auto")return{fr:1};if(e.endsWith("%")){let o=parseFloat(e);return t!=null?t*o/100:0}if(e.endsWith("px"))return parseFloat(e);if(e.endsWith("em"))return parseFloat(e)*16;if(e.endsWith("fr"))return{fr:parseFloat(e)};let n=parseFloat(e);if(!Number.isNaN(n))return n;return 0}function Zln(e,t){return e>0?e:t+2+e}var H7r=(e)=>{let t=e.opts,n=t.children,o,r;if("gridTemplate"in t&&typeof t.gridTemplate==="string"){let[b,I]=t.gridTemplate.split("/");o=b?.trim(),r=I?.trim()}else o=typeof t.gridTemplateRows==="string"?t.gridTemplateRows:void 0,r=typeof t.gridTemplateColumns==="string"?t.gridTemplateColumns:void 0;let i=qln(r),s=qln(o);function a(b,I,v,P){if(!b)return 0;let M=Q6e(b),B=k6e(M),T=B.length,N=0,D=!1;for(let H=0;H<B.length;H++){let V=B[H];if(V.endsWith("px"))N+=parseFloat(V);else if(V.endsWith("em"))N+=parseFloat(V)*16;else if(V.endsWith("fr")||V==="auto"){D=!0;let O=0;for(let U of I){let j=v?U.columnStart||U.column:U.rowStart||U.row,Y=v?U.columnSpan||1:U.rowSpan||1,X=v?U.contentWidth:U.contentHeight,K=(typeof j==="number"?j:parseInt(j||"1"))-1,J=typeof Y==="number"?Y:parseInt(Y.toString());if(K<=H&&H<K+J){if(X){let ee=typeof X==="string"&&X.endsWith("px")?parseFloat(X):typeof X==="number"?X:0;O=Math.max(O,ee/J)}}}N+=O}}let L=P*(T-1);return N+L}function c(b,I,v,P=!0,M=1){if(!b)return[];if(I==null){let Y=Q6e(b),X=k6e(Y),K=X.length,J=(ne)=>{if(ne===void 0)return 0;if(typeof ne==="number")return ne;if(ne.endsWith("px"))return parseFloat(ne);return parseFloat(ne)},ee=Array(K).fill(0),se=0;for(let ne of n){let re=P?typeof ne.columnSpan==="number"?ne.columnSpan:ne.columnSpan?parseInt(ne.columnSpan.toString()):1:typeof ne.rowSpan==="number"?ne.rowSpan:ne.rowSpan?parseInt(ne.rowSpan.toString()):1,Z=P?ne.contentWidth:ne.contentHeight,te=J(Z)/re,ie;if(P){if(ne.columnStart!==void 0||ne.column!==void 0)ie=parseInt(ne.columnStart??ne.column)-1}else if(ne.rowStart!==void 0||ne.row!==void 0)ie=parseInt(ne.rowStart??ne.row)-1;if(ie===void 0||Number.isNaN(ie)){if(P)ie=se%K;else ie=Math.floor(se/M);se+=re}for(let le=0;le<re&&ie+le<K;le++)ee[ie+le]=Math.max(ee[ie+le],te)}return X.forEach((ne,re)=>{let Z=Jln(ne,void 0);if(typeof Z==="number")ee[re]=Z}),ee}let B=Q6e(b),T=k6e(B),N=T.length,D=I;if(D==null)D=a(b,n,P,v);let L=D-v*(N-1),H=0,V=0,O=[],U=[];T.forEach((Y,X)=>{let K=Jln(Y,L);if(typeof K==="number")U.push(K),H+=K;else if(K&&typeof K==="object"&&"fr"in K)U.push(K),V+=K.fr,O.push({idx:X,fr:K.fr});else U.push(0),H+=0});let j=Math.max(L-H,0);return U.map((Y)=>typeof Y==="number"?Y:V>0?j/V*Y.fr:0)}let l=typeof t.gap==="number"?t.gap:Array.isArray(t.gap)?t.gap[0]:0,h=typeof t.gap==="number"?t.gap:Array.isArray(t.gap)?t.gap[1]:0,d=c(o,t.containerHeight,l,!1,i||1),u=c(r,t.containerWidth,h,!0,s||1),_=d.length,p=u.length;if(p===0&&n.length>0)p=1;let m=[],A=0;for(let b of n){let I=b.rowStart!==void 0?b.rowStart:b.row,v=b.columnStart!==void 0?b.columnStart:b.column,P=b.rowSpan!==void 0?typeof b.rowSpan==="string"?parseInt(b.rowSpan):b.rowSpan:1,M=b.columnSpan!==void 0?typeof b.columnSpan==="string"?parseInt(b.columnSpan):b.columnSpan:1;if(b.rowEnd!==void 0){let N=typeof b.rowEnd==="string"?parseInt(b.rowEnd):b.rowEnd;if(I!==void 0)P=N-(typeof I==="string"?parseInt(I):I);else I=N-P}if(b.columnEnd!==void 0){let N=typeof b.columnEnd==="string"?parseInt(b.columnEnd):b.columnEnd;if(v!==void 0)M=N-(typeof v==="string"?parseInt(v):v);else v=N-M}if(typeof I==="string")I=parseInt(I);if(typeof v==="string")v=parseInt(v);if(typeof I==="number"&&I<0)I=Zln(I,_);if(typeof v==="number"&&v<0)v=Zln(v,p);if(I===void 0&&v!==void 0)I=1;else if(v===void 0&&I!==void 0)v=1;else if(I===void 0&&v===void 0){let N=A;I=Math.floor(N/p)+1,v=N%p+1}let B=I-1,T=v-1;P=Math.max(1,P),M=Math.max(1,M),m.push({key:b.key,row:B,column:T,rowSpan:P,columnSpan:M,x:0,y:0,width:0,height:0}),A+=M}let g=d.length,f=u.length;for(let b of m){if(b.row+b.rowSpan>g)g=b.row+b.rowSpan;if(b.column+b.columnSpan>f)f=b.column+b.columnSpan}if(d.length===0&&g>0&&t.containerHeight){let b=g,v=(t.containerHeight-l*(b-1))/b;for(let P=0;P<b;P++)d.push(v)}else while(d.length<g)d.push(0);if(u.length===0&&f>0&&t.containerWidth){let b=f,v=(t.containerWidth-h*(b-1))/b;for(let P=0;P<b;P++)u.push(v)}else if(u.length===0&&n.length>0&&t.containerWidth)u.push(t.containerWidth);else while(u.length<f)u.push(0);let y=(b,I,v)=>{let P=0;for(let M=0;M<b;M++)P+=I[M]||0,P+=v;return P},x=(b,I,v,P)=>{let M=0;for(let B=b;B<b+I;B++)if(M+=v[B]||0,B>b)M+=P;return M},C={};for(let b of m){let I=n.find((U)=>U.key===b.key),v=y(b.column,u,h),P=y(b.row,d,l),M=x(b.column,b.columnSpan,u,h),B=x(b.row,b.rowSpan,d,l),T=(U)=>{if(U===void 0)return 0;if(typeof U==="string"){if(U.endsWith("px"))return parseFloat(U);if(U.endsWith("%"))return 0;return parseFloat(U)}return U},N=T(I?.contentWidth),D=T(I?.contentHeight),L=M,H=B,V=v,O=P;if(N>0)switch(L=N,t.justifyItems||"stretch"){case"start":V=v;break;case"end":V=v+M-L;break;case"center":V=v+(M-L)/2;break;case"stretch":L=M,V=v;break}if(D>0)switch(H=D,t.alignItems||"stretch"){case"start":O=P;break;case"end":O=P+B-H;break;case"center":O=P+(B-H)/2;break;case"stretch":H=B,O=P;break}b.x=V,b.y=O,b.width=L,b.height=H,C[b.key]={x:V,y:O,width:L,height:H}}return{cells:m,rowSizes:d,columnSizes:u,rowGap:l,columnGap:h,itemCoordinates:C}},thn=class{opts;constructor(e){this.opts=e}layout(){return H7r(this)}convertToHtml(){return k7r(this)}visualize(){return L7r(this)}};qt();var LSn=at(j0(),1);er();er();qt();qt();er();er();er();var{defineProperty:F7r,getOwnPropertySymbols:nhn}=Object,z7r=Object.prototype.hasOwnProperty,O7r=Object.prototype.propertyIsEnumerable,ohn=(e,t,n)=>(t in e)?F7r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,rhn=(e,t)=>{for(var n in t||(t={}))if(z7r.call(t,n))ohn(e,n,t[n]);if(nhn){for(var n of nhn(t))if(O7r.call(t,n))ohn(e,n,t[n])}return e},V7r=(e)=>{switch(e){case"left":return{x:-1,y:0};case"right":return{x:1,y:0};case"top":return{x:0,y:1};case"bottom":return{x:0,y:-1}}},Y7r=(e)=>{var t,n;let o=Ps(e),r=o.schematic_component.list(),i=o.schematic_net_label.list(),s=o.schematic_port.list(),a={};for(let c of r){let l=o.source_component.get(c.source_component_id);a[c.schematic_component_id]=l==null?void 0:l.name}for(let c of i){let l=o.source_net.get(c.source_net_id);if(!(l==null?void 0:l.name))continue;let h=0;while(Object.values(a).includes(`NL_${l.name}${h}`))h++;a[c.schematic_net_label_id]=`NL_${l.name}${h}`}for(let c of s){let l=o.source_port.get(c.source_port_id);if(!l)continue;let h=o.source_component.get(l.source_component_id);if(!(h==null?void 0:h.name))continue;let d=`${h.name}_${(n=(t=l==null?void 0:l.name)!=null?t:l==null?void 0:l.pin_number)!=null?n:""}`;a[c.schematic_port_id]=d}return a},G7r=(e)=>{var t;let n=Ps(e),o=new Set(n.schematic_net_label.list().map((i)=>{var s,a,c,l;return`${(a=(s=i.anchor_position)==null?void 0:s.x)!=null?a:i.center.x},${(l=(c=i.anchor_position)==null?void 0:c.y)!=null?l:i.center.y}`})),r=[];for(let i of n.schematic_port.list()){let s=`${i.center.x},${i.center.y}`;if(o.has(s))continue;let a=n.source_port.get(i.source_port_id);if(!a)continue;let c=n.source_net.getWhere({subcircuit_connectivity_map_key:a.subcircuit_connectivity_map_key});if(!c)continue;let l=n.source_trace.list().find((_)=>{var p;return(p=_.connected_source_port_ids)==null?void 0:p.includes(i.source_port_id)}),h=n.schematic_trace.getWhere({source_trace_id:l==null?void 0:l.source_trace_id}),u={type:"schematic_net_label",schematic_net_label_id:`netlabel_for_${i.schematic_port_id}`,schematic_port_id:i.schematic_port_id,text:c.name,source_net_id:c.source_net_id,source_trace_id:l==null?void 0:l.source_trace_id,schematic_trace_id:h==null?void 0:h.schematic_trace_id,anchor_position:rhn({},i.center),center:rhn({},i.center),anchor_side:G9t((t=i.facing_direction)!=null?t:"right")};r.push(u)}return r},ihn=(e,t={})=>{let n={boxes:[],pins:[]},o=Ps(e),r=o.schematic_component.list(),i=o.schematic_net_label.list();if(t.inferNetLabels)i=i.concat(G7r(e));let s=t.useReadableIds?Y7r(e):{},a=(l)=>{if(!t.useReadableIds)return l;if(s[l])return s[l];return l},c=0;for(let l of r){let h={boxId:a(l.schematic_component_id),kind:"floating",center:l.center};n.boxes.push(h);let d={pinId:`${a(l.schematic_component_id)}_center`,color:"component_center",networkId:`center_${l.schematic_component_id}`,offset:{x:0,y:0},boxId:a(l.schematic_component_id)};n.pins.push(d);let u=o.schematic_port.list({schematic_component_id:l.schematic_component_id});for(let _ of u){let p=o.source_port.get(_.source_port_id),m=p==null?void 0:p.subcircuit_connectivity_map_key,A="normal";if(m){let f=o.source_net.getWhere({subcircuit_connectivity_map_key:p==null?void 0:p.subcircuit_connectivity_map_key});if(f&&(f.is_power||f.name.startsWith("V")))A="vcc";if(f&&(f.is_ground||f.name.startsWith("GND")))A="gnd"}else m=`disconnected-${c++}`,A="not_connected";let g={pinId:a(_.schematic_port_id),color:A,networkId:m,offset:{x:_.center.x-h.center.x,y:_.center.y-h.center.y},boxId:a(l.schematic_component_id)};n.pins.push(g)}}for(let l of i){let h=o.source_net.get(l.source_net_id),d=h==null?void 0:h.subcircuit_connectivity_map_key,u="normal";if(d){if(h&&(h.is_power||h.name.startsWith("V")))u="vcc";if(h&&(h.is_ground||h.name.startsWith("GND")))u="gnd"}else d=`disconnected-${c++}`,u="not_connected";let _=V7r(l.anchor_side),p={x:l.anchor_position.x-_.x*l.text.length*0.18*0.5,y:l.anchor_position.y-_.y*0.18},m={x:0,y:0};if(l.anchor_position)m={x:l.anchor_position.x-p.x,y:l.anchor_position.y-p.y};let A={boxId:a(l.schematic_net_label_id),kind:"fixed",center:p,boxAttributes:{is_net_label:!0,source_net_id:l.source_net_id,source_trace_id:l.source_trace_id}};n.boxes.push(A);let g={pinId:`${a(l.schematic_net_label_id)}_pin`,boxId:a(l.schematic_net_label_id),networkId:d,color:u,offset:m};n.pins.push(g),n.pins.push({pinId:`${a(l.schematic_net_label_id)}_center`,boxId:a(l.schematic_net_label_id),networkId:`${a(l.schematic_net_label_id)}_center`,color:"netlabel_center",offset:{x:0,y:0}})}return n};var mhn=at(j0(),1),U7r=(e)=>{if(!e)return{x:0,y:0};if("x"in e&&"y"in e)return e;if("center"in e)return e.center;return{x:(e.minX+e.maxX)/2,y:(e.minY+e.maxY)/2}},z6e=(e,t)=>{let n=e.boxes.find((l)=>l.boxId===t),o=e.pins.filter((l)=>l.boxId===t);if(!n)throw Error(`Box "${t}" not found`);let r=n.center??{x:0,y:0},i=1/0,s=1/0,a=-1/0,c=-1/0;for(let l of o)i=Math.min(i,l.offset.x+r.x),s=Math.min(s,l.offset.y+r.y),a=Math.max(a,l.offset.x+r.x),c=Math.max(c,l.offset.y+r.y);return{minX:i,minY:s,maxX:a,maxY:c}},nJ=(e,t,n)=>`hsl(${e*360/t}, 100%, 50%, ${n??1})`;var W7r=(e)=>{let t=new Set;for(let n of e.pins)t.add(n.networkId);return Array.from(t)},shn={not_connected:"rgba(0, 0, 0, 0.2)",normal:"blue",vcc:"orange",gnd:"purple",component_center:"gray"},X7r=["red","green","blue","yellow","purple","orange","brown","gray","black","white"];function j7r(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n);return t}var uhn=(e)=>{if(e.startsWith("rgb")||e.startsWith("hsl")||e.startsWith("#")||X7r.includes(e))return e;if(e in shn)return shn[e];return nJ(j7r(e)%50,50)},pk=(e,t)=>{let n={points:[],lines:[],rects:[],circles:[],texts:[],coordinateSystem:"cartesian",title:"BPC Graph Graphics"},o=new Map,r=new Map;for(let a of e.boxes){let c=z6e(e,a.boxId),l=U7r(c);n.rects.push({label:a.boxId,center:l,width:c.maxX-c.minX+0.1,height:c.maxY-c.minY+0.1,fill:"rgba(0, 0, 0, 0.2)"});let h=e.pins.filter((u)=>u.boxId===a.boxId),d=a.center??{x:0,y:0};for(let u of h){let _={x:u.offset.x+d.x,y:u.offset.y+d.y},p=`${_.x.toFixed(6)},${_.y.toFixed(6)}`;if(!r.has(p))r.set(p,[]);r.get(p).push({box:a,pin:u}),o.set(`${a.boxId}.${u.pinId}`,_)}}for(let[a,c]of r){let l=a.split(",").map(Number),h=l[0],d=l[1];for(let u=0;u<c.length;u++){let _=c[u],{box:p,pin:m}=_,A={x:h,y:d};if(c.length>1){let g=p.center??{x:0,y:0},f=g.x-h,y=g.y-d,x=Math.sqrt(f*f+y*y),C=0,b=0;if(x>0)C=f/x,b=y/x;else{let I=u*2*Math.PI/c.length;C=Math.cos(I),b=Math.sin(I)}A={x:h+0.01*C,y:d+0.01*b}}o.set(`${p.boxId}.${m.pinId}`,A),n.points.push({...A,label:[m.pinId,m.color,m.networkId].join(`
`),color:uhn(m.color)})}}let i=W7r(e);for(let a=0;a<i.length;a++){let c=i[a],l=nJ(a,i.length,0.5),d=e.pins.filter((u)=>u.networkId===c).map((u)=>({pin:u,position:o.get(`${u.boxId}.${u.pinId}`)}));for(let u=0;u<d.length;u++){let{position:_}=d[u];for(let p=u+1;p<d.length;p++){let{position:m}=d[p];n.lines.push({points:[_,m],strokeColor:t?.grayNetworks?"rgba(0, 0, 0, 0.05)":l})}}}let s=Hy(n);if(t?.title)n.title=t.title,n.texts.push({text:t.title,x:s.minX,y:s.maxY,fontSize:(s.maxY-s.minY)*0.05,anchorSide:"bottom_left"});if(t?.caption)n.texts.push({text:t.caption,x:s.minX,y:s.minY,fontSize:(s.maxY-s.minY)*0.05,anchorSide:"top_left"});return n},L6e=(e,t,n)=>{let o=e.pins.find((s)=>s.pinId===n&&s.boxId===t);if(!o)throw Error(`Pin "${n}" not found`);let r=e.boxes.find((s)=>s.boxId===o.boxId);if(!r)throw Error(`Box "${o.boxId}" not found`);let i=r.center??{x:0,y:0};return{x:o.offset.x+i.x,y:o.offset.y+i.y}},K7r=(e,t,n)=>{let o=typeof n==="string"?e.pins.find((_)=>_.pinId===n&&_.boxId===t):n;if(!o)throw Error(`Pin not found "${n}"`);if(!(typeof t==="string"?e.boxes.find((_)=>_.boxId===t):t))throw Error(`Box not found for pin "${n}" (looked for "${o.boxId}")`);let i=z6e(e,o.boxId),s=L6e(e,o.boxId,o.pinId),a=i.maxX-i.minX,c=i.maxY-i.minY;if(a===0&&c===0)if(Math.abs(o.offset.x)>Math.abs(o.offset.y))return o.offset.x>0?"x+":"x-";else return o.offset.y>0?"y+":"y-";if(a===0){if(Math.abs(s.y-i.minY)<0.0001)return"y-";if(Math.abs(s.y-i.maxY)<0.0001)return"y+"}if(c===0){if(Math.abs(s.x-i.minX)<0.0001)return"x-";if(Math.abs(s.x-i.maxX)<0.0001)return"x+"}let l=Math.abs(s.x-i.minX)<0.0001,h=Math.abs(s.x-i.maxX)<0.0001,d=Math.abs(s.y-i.minY)<0.0001,u=Math.abs(s.y-i.maxY)<0.0001;if((l||h)&&(d||u))return o.offset.x>0?"x+":"x-";if(l)return"x-";if(h)return"x+";if(d)return"y-";if(u)return"y+";throw Error(`Pin "${o.pinId}" not on the edge of the box "${o.boxId}" so we couldn't determine the direction`)},oJ=(e,t,n)=>{try{return K7r(e,t,n)}catch(o){return null}};var $7r=(e)=>{let t=new Map,n=[];e.nodes.forEach((i,s)=>{t.set(i.id,s),n.push(i.id)});let o=e.nodes.length,r=Array.from({length:o},()=>Array.from({length:o},()=>0));for(let[i,s]of e.undirectedEdges){let a=t.get(i),c=t.get(s);if(a!==void 0&&c!==void 0&&a!==c)r[a][c]=1,r[c][a]=1}for(let i=0;i<o;++i)r[i][i]=1;return{matrix:r,mapping:t,indexMapping:n}};var H6e=(e)=>{let t=[],n=[],o=new Map;for(let i of e.boxes){if(i.kind==="fixed")o.set(i.boxId,i.center);else o.set(i.boxId,i.center);t.push({id:i.boxId,boxId:i.boxId,color:"box",x:i.center?.x,y:i.center?.y})}let r={};for(let i of e.pins){let s=`${i.boxId}-${i.pinId}`,a=o.get(i.boxId);t.push({id:s,boxId:i.boxId,pinId:i.pinId,color:i.color,x:a?a.x+i.offset.x:void 0,y:a?a.y+i.offset.y:void 0}),r[i.networkId]??=[],r[i.networkId].push(s)}for(let i of Object.values(r))for(let s=0;s<i.length;s++)for(let a=s+1;a<i.length;a++)n.push([i[s],i[a]]);for(let i of e.boxes)for(let s of e.pins)if(s.boxId===i.boxId)n.push([i.boxId,`${i.boxId}-${s.pinId}`]);return{nodes:t,undirectedEdges:n}},q7r=(e,t,n={})=>{let o=e.length;if(e.some((a)=>a.length!==o))throw Error("adjMatrix must be square");let r=(n.nodeInitialColors??Array.from({length:o},()=>"_")).slice(),i=(a)=>{let c={};for(let l of a)c[l]=(c[l]??0)+1;return c},s=[];s.push(i(r));for(let a=0;a<t;a++){let c=Array(o);for(let l=0;l<o;l++){let h=[];for(let d=0;d<o;d++)if(e[l][d])h.push(r[d]);h.sort(),c[l]=`${r[l]}|${h.join(",")}`}r=c,s.push(i(r))}return s},J7r=(e,t)=>{let n=0,o=Math.min(e.length,t.length);for(let r=0;r<o;r++){let i=e[r],s=t[r],a=new Set([...Object.keys(i),...Object.keys(s)]),c=0,l=0;for(let h of a){let d=i[h]??0,u=s[h]??0;c+=Math.min(d,u),l+=Math.max(d,u)}n+=l===0?0:c/l}return n};var Z7r=J7r,F6e=2,O6e=(e,t=F6e)=>{let n=H6e(e),{matrix:o,indexMapping:r}=$7r(n);return q7r(o,t,{nodeInitialColors:r.map((i)=>n.nodes.find((s)=>s.id===i)?.color??"_")})},ket=(e,t,{wlDegrees:n=F6e}={})=>{let o=O6e(e,n),r=O6e(t,n);return(F6e+1-Z7r(o,r))/(F6e+1)},eSr=(e)=>{let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n);return Math.abs(t)},Qet=(e,t={})=>{let n={points:[],lines:[],rects:[],circles:[],texts:[],coordinateSystem:"cartesian",title:"Flat-BPC Graphics"},o=new Map;for(let i of e.nodes){if(i.x===void 0||i.y===void 0)continue;let s={x:i.x,y:i.y};o.set(i.id,s),n.points.push({...s,color:uhn(i.color),label:i.id})}for(let[i,s]of e.undirectedEdges){let a=o.get(i),c=o.get(s);if(a&&c)n.lines.push({points:[a,c],strokeColor:"rgba(0,0,0,0.3)"})}let r=Hy(n);if(t.title)n.texts.push({text:t.title,x:r.minX,y:r.maxY,fontSize:(r.maxY-r.minY)*0.05,anchorSide:"bottom_left"});if(t.caption)n.texts.push({text:t.caption,x:r.minX,y:r.minY,fontSize:(r.maxY-r.minY)*0.05,anchorSide:"top_left"});return n};var tSr=(e)=>{let t=new Map;for(let r of e.pins){let i=e.boxes.find((a)=>a.boxId===r.boxId);if(!i||!i.center)throw Error(`Expected fixed graph – box "${r.boxId}" missing or has no center`);let s={x:i.center.x+r.offset.x,y:i.center.y+r.offset.y};if(!t.has(r.networkId))t.set(r.networkId,[]);t.get(r.networkId).push(s)}let n=new Map,o=0;for(let[r,i]of t){if(i.length===0){n.set(r,0);continue}let s=i.reduce((c,l)=>({x:c.x+l.x,y:c.y+l.y}),{x:0,y:0});s.x/=i.length,s.y/=i.length;let a=i.reduce((c,l)=>{let h=l.x-s.x,d=l.y-s.y;return c+Math.sqrt(h*h+d*d)},0);n.set(r,a),o+=a}return{totalNetworkLength:o,networkLengths:n}},nSr=(e,t)=>{let n=e.pins.filter((r)=>r.networkId===t),o=[];for(let r of n){let i=Math.atan2(r.offset.y,r.offset.x);o.push(i)}return o},ahn=(e)=>{let t=new Map,n=Array.from(new Set(e.pins.map((o)=>o.networkId)));for(let o of n){let r=nSr(e,o);t.set(o,r)}return t},oSr=(e,t)=>{let n=2*Math.PI,o=(e%n+n)%n,r=(t%n+n)%n,i=Math.abs(o-r);return Math.min(i,n-i)},rSr=(e,t)=>{if(e.length===0&&t.length===0)return 0;if(e.length===0||t.length===0)return Math.PI;let n=(o,r)=>{let i=0;for(let s of o){let a=1/0;for(let c of r){let l=oSr(s,c);if(l<a)a=l}i+=a}return i/o.length};return(n(e,t)+n(t,e))/2},iSr=(e,t)=>{let n=new Map,o=Array.from(e.entries()),r=Array.from(t.entries()),i=o.length,s=r.length,a=Array.from({length:i},()=>Array(s).fill(0));for(let u=0;u<i;u++){let[,_]=o[u];for(let p=0;p<s;p++){let[,m]=r[p];a[u][p]=rSr(_,m)}}let c=new Set(Array.from({length:i},(u,_)=>_)),l=new Set(Array.from({length:s},(u,_)=>_)),h=0;while(c.size&&l.size){let u=-1,_=-1,p=1/0;for(let g of c)for(let f of l){let y=a[g][f];if(y<p)p=y,u=g,_=f}let[m]=o[u],[A]=r[_];n.set(m,A),h+=p,c.delete(u),l.delete(_)}let d=Math.PI;return h+=(c.size+l.size)*d,{networkMapping:n,distance:h}},chn=(e)=>{let t=Math.min(...e.map((i)=>i.offset.x)),n=Math.max(...e.map((i)=>i.offset.x)),o=Math.min(...e.map((i)=>i.offset.y)),r=Math.max(...e.map((i)=>i.offset.y));return{minX:t,maxX:n,minY:o,maxY:r}},sSr=(e,t)=>{let n=(c)=>{switch(c.side){case"x+":return c.cwDistanceFromCorner;case"y-":return 1+c.cwDistanceFromCorner;case"x-":return 2+c.cwDistanceFromCorner;case"y+":return 3+c.cwDistanceFromCorner}},o=n(e)%4,r=n(t)%4,i=(r-o+4)%4,s=(o-r+4)%4,a=Math.min(i,s);return{cwDistance:i,ccwDistance:s,minDistance:a}},NB=0.000001,lhn=(e,t)=>{let{minX:n,minY:o,maxX:r,maxY:i}=e,s=(l,h)=>Math.abs(l-h)<NB,a,c;if(s(t.x,r)&&t.y>=o-NB&&t.y<=i+NB)a="x+",c=(i-t.y)/(i-o);else if(s(t.y,i)&&t.x<=r+NB&&t.x>=n-NB)a="y+",c=(t.x-n)/(r-n);else if(s(t.x,n)&&t.y<=i+NB&&t.y>=o-NB)a="x-",c=(t.y-o)/(i-o);else if(s(t.y,o)&&t.x>=n-NB&&t.x<=r+NB)a="y-",c=(r-t.x)/(r-n);else return null;return c=Math.min(1,Math.max(0,c)),{side:a,cwDistanceFromCorner:c}},aSr=(e,t)=>{let n=[],o=new Set,r=new Set,i=new Set,s=new Set,a=chn(e),c=chn(t);for(let l of e){let h=t.filter((p)=>p.color===l.color).filter((p)=>!s.has(p.pinId));if(h.length===0){o.add(l.pinId);continue}let d=lhn(a,l.offset);if(d===null){o.add(l.pinId);continue}let u=1/0,_=h[0];for(let p of h){let m=lhn(c,p.offset);if(m===null)continue;let{minDistance:A}=sSr(d,m);if(A<u)u=A,_=p}n.push([l,_]),i.add(l.pinId),s.add(_.pinId)}for(let l of t){if(s.has(l.pinId))continue;r.add(l.pinId)}return{matchedPins:n,unmatchedPin1Ids:o,unmatchedPin2Ids:r}},cSr=class{constructor(e,t){this.floatingGraph=e,this.fixedGraph=t,this.wipGraph={pins:[],boxes:[]},this.fixedToFloatingNetworkMap=this.computeFixedToFloatingNetworkMap(),this.floatingToFixedNetworkMap=new Map(Array.from(this.fixedToFloatingNetworkMap.entries()).map(([n,o])=>[o,n]))}floatingGraph;fixedGraph;wipGraph;iterations=0;solved=!1;acceptedFloatingBoxIds=new Set;rejectedFloatingBoxIds=new Set;acceptedFixedBoxIds=new Set;assignment=new Map;lastAcceptedEvaluation=null;fixedToFloatingNetworkMap;floatingToFixedNetworkMap;lastComputedEvaluations=[];computeFixedToFloatingNetworkMap(){let e=ahn(this.floatingGraph),t=ahn(this.fixedGraph),{networkMapping:n}=iSr(t,e);return n}getNextFloatingBoxId(){let e=this.floatingGraph.boxes.map((o)=>o.boxId).filter((o)=>!this.acceptedFloatingBoxIds.has(o)&&!this.rejectedFloatingBoxIds.has(o));if(!e.length)throw Error("No remaining floating box ids");let t=e[0],n=0;for(let o of e){let r=this.floatingGraph.pins.filter((i)=>i.boxId===o);if(r.length>n)t=o,n=r.length}return t}getRemainingFloatingBoxIds(){return this.floatingGraph.boxes.map((e)=>e.boxId).filter((e)=>!this.acceptedFloatingBoxIds.has(e)&&!this.rejectedFloatingBoxIds.has(e))}getPartialFloatingGraph(e){let t={pins:[],boxes:[]};for(let n of this.floatingGraph.boxes)if(this.acceptedFloatingBoxIds.has(n.boxId)||n.boxId===e)t.boxes.push(n),t.pins.push(...this.floatingGraph.pins.filter((o)=>o.boxId===n.boxId));return t}evaluateFloatingBoxAssignment(e){let t=this.getPartialFloatingGraph(e),n=ket(t,this.wipGraph),o=null,r=null,i={floatingBoxId:e,originalWipGraph:this.wipGraph,partialFloatingGraph:t,currentWlDist:n,networkLengths:new Map,wlDistances:new Map,wlVecs:new Map,wipGraphsWithAddedFixedBoxId:new Map},s=n,a=n,c=1/0,l=O6e(t);for(let h of this.fixedGraph.boxes.map((d)=>d.boxId)){if(this.acceptedFixedBoxIds.has(h))continue;let d=this.getWipGraphWithAddedFixedBoxIdForFloatingAssignment(h,e),u=ket(t,d),_=O6e(d),{totalNetworkLength:p}=tSr(d);i.wipGraphsWithAddedFixedBoxId.set(h,d),i.wlVecs.set(h,_),i.wlDistances.set(h,u),i.networkLengths.set(h,p);let m=u+p/100;if(m<s)s=m,a=u,c=p,r=d,o=h}return{bestFixedBoxId:o,bestNewWipGraph:r,bestDist:s,bestWlDist:a,bestTotalNetworkLength:c,lastDistanceEvaluation:i,nextFloatingBoxId:e,partialFloatingGraph:t,floatingBoxWlVec:l}}getPinAssignment(){let e={},t={};for(let[n,o]of this.assignment)e[n]={},t[o]=n;for(let n of this.wipGraph.pins){let o=n.boxId,r=t[o],{_floatingPinId:i,_fixedPinId:s}=n;e[r][i]=s}return e}step(){if(this.solved)return;if(this.iterations>1000)throw Error("Too many iterations");if(this.iterations++,this.iterations===1){let o=this.getNextFloatingBoxId(),r=this.evaluateFloatingBoxAssignment(o);this.lastComputedEvaluations=[r],this.acceptEvaluationResult(r);return}let e=this.getRemainingFloatingBoxIds();if(e.length===0){this.solved=!0;return}let t=1/0,n=null;this.lastComputedEvaluations=[];for(let o of e){let r=this.evaluateFloatingBoxAssignment(o);if(this.lastComputedEvaluations.push(r),r.bestDist<t)t=r.bestDist,n=r}if(n)this.acceptEvaluationResult(n)}acceptEvaluationResult(e){let{bestFixedBoxId:t,bestNewWipGraph:n,nextFloatingBoxId:o}=e;if(t===null){this.rejectedFloatingBoxIds.add(o);return}this.acceptedFloatingBoxIds.add(o),this.assignment.set(o,t),this.acceptedFixedBoxIds.add(t),this.wipGraph=n,this.lastAcceptedEvaluation=e.lastDistanceEvaluation}getWipGraphWithAddedFixedBoxIdForFloatingAssignment(e,t){let n=structuredClone(this.wipGraph),o=this.fixedGraph.boxes.find((a)=>a.boxId===e);n.boxes.push(o);let r=this.floatingGraph.pins.filter((a)=>a.boxId===t),i=this.fixedGraph.pins.filter((a)=>a.boxId===e),{matchedPins:s}=aSr(r,i);return n.pins.push(...s.map((a)=>{let[c,l]=a;return{...l,networkId:this.floatingToFixedNetworkMap.get(c.networkId),_floatingPinId:c.pinId,_fixedPinId:l.pinId}})),n}visualize(){let e=pk(this.floatingGraph,{title:"Floating"}),t=pk(this.wipGraph,{title:"WIP"}),n=pk(this.fixedGraph,{title:"Fixed"}),o=pk(this.getPartialFloatingGraph(),{title:"Partial Floating"}),r=new Map,i=new Map;for(let[m,A]of this.assignment){let g=nJ(eSr(m)*47%100,100,0.5);r.set(m,g),i.set(A,m)}function s(m,A,g){let f=r.get(A);m.fill=f,m.label=`${A}→${g}`}for(let m of e.rects??[]){let A=m.label;if(!A)continue;let g=this.assignment.get(A);if(g)s(m,A,g)}for(let m of o.rects??[]){let A=m.label;if(!A)continue;let g=this.assignment.get(A);if(g)s(m,A,g)}let a=[t,n];for(let m of a)for(let A of m.rects??[]){let g=A.label;if(!g)continue;let f=i.get(g);if(f)s(A,f,g)}let c=H6e(this.floatingGraph),l=H6e(this.wipGraph),h=H6e(this.fixedGraph),d=Qet(c,{title:"Floating Flat"}),u=Qet(l,{title:"WIP Flat"}),_=Qet(h,{title:"Fixed Flat"});return zR([rse([e,d,o]),rse([t,u]),rse([n,_])])}},phn=(e,t)=>{let n=new cSr(e,t);while(!n.solved&&n.iterations<1000)n.step();let o={};for(let[s,a]of n.assignment.entries())o[s]=a;let r={};for(let[s,a]of n.floatingToFixedNetworkMap.entries())r[s]=a;let i=n.getPinAssignment();return{floatingToFixedBoxAssignment:o,floatingToFixedNetworkAssignment:r,floatingToFixedPinAssignment:i}};var hhn=(e,{renetworkedNetworkIdMap:t}={})=>{if(t??={},e.length===1)return e[0];let n={boxes:[],pins:[]},o=new Map,r=new Map,i=Object.entries(e.flatMap((a)=>Array.from(new Set(a.boxes.map((c)=>c.boxId)))).reduce((a,c)=>(a[c]=(a[c]||0)+1,a),{})).filter(([a,c])=>c===e.length).map(([a])=>a);if(i.length>1)throw Error(`Expected at most one shared box across all partitions, the following box ids are shared across all graphs: ${i.join(", ")}`);let s=i[0];for(let a of e){let c=a.boxes.find((l)=>l.boxId===s)?.center;for(let l of a.boxes){if(o.has(l.boxId))continue;let h=structuredClone(l);if(h.center&&c)h.center={x:h.center.x-c.x,y:h.center.y-c.y};o.set(l.boxId,h)}for(let l of a.pins)if(!r.has(`${l.boxId}-${l.pinId}`))r.set(`${l.boxId}-${l.pinId}`,structuredClone(l))}return n.boxes=Array.from(o.values()),n.pins=Array.from(r.values()),n};var Let=({graph:e,axis:t,centerBoxId:n})=>{let o=structuredClone(e),r=o.boxes.find((a)=>a.boxId===n);if(!r||!r.center)throw Error(`Center box "${n}" not found or has no center`);let{x:i,y:s}=r.center;for(let a of o.boxes){if(!a.center)continue;if(t==="x")a.center.x=2*i-a.center.x;else a.center.y=2*s-a.center.y}for(let a of o.pins)if(t==="x")a.offset.x=-a.offset.x;else a.offset.y=-a.offset.y;return o},lSr=(e)=>{let t=null,n=-1/0;for(let i of e.boxes){let s=e.pins.filter((a)=>a.boxId===i.boxId).filter((a)=>["x-","x+"].includes(oJ(e,i,a)??"none"));if(s.length>n&&s.length>1)t=i,n=s.length}if(!t)return{g:e,reflected:!1,centerBoxId:null};let o=e.pins.filter((i)=>i.boxId===t.boxId).map((i)=>oJ(e,t,i)),r={"x+":0,"x-":0,"y+":0,"y-":0};for(let i of o){if(!i)continue;r[i]++}if(r["x+"]>=r["x-"])return{g:e,reflected:!1,centerBoxId:t.boxId};return{g:Let({graph:e,axis:"x",centerBoxId:t.boxId}),reflected:!0,centerBoxId:t.boxId}},uk=mhn.default("schematic-partition-processor"),hSr=class{constructor(e,t={}){this.initialGraph=e,this.lastGraph=e,this.singletonKeys=t.singletonKeys??[],this.centerPinColors=t.centerPinColors??[];let n=this.initializeWipPartitions();this.wipPartitions=n.wipPartitions,this.splitBoxIds=n.splitBoxIds,this.addedPins=n.addedPins,this.exploredPins=new Set,this.unexploredPins=this.wipPartitions.flatMap((i)=>i.pins.map((s)=>({...s,partitionId:i.partitionId}))),this.boxSingletonKeys=this.initializeBoxSingletonKeys(),this.pinConnectionCount=(()=>{let i={};for(let s of this.initialGraph.pins)i[`${s.boxId}:${s.pinId}`]=this.getNeighbors(s).length;return i})();let o={};for(let i of this.initialGraph.pins)o[i.networkId]=(o[i.networkId]??0)+1;this.networkSize=o;let r={};for(let i of this.initialGraph.pins)r[`${i.boxId}:${i.pinId}`]=o[i.networkId];this.pinNetworkSize=r}initialGraph;lastGraph;lastExploredPin;solved=!1;iteration=0;wipPartitions;unexploredPins=[];boxSingletonKeys;exploredPins;addedPins;allAcceptedPins=new Set;pinConnectionCount;networkSize;pinNetworkSize;splitBoxIds;acceptedBoxPartitionMap=new Map;singletonKeys;centerPinColors;initializeBoxSingletonKeys(){let e={};for(let t of this.initialGraph.boxes){let n=this.initialGraph.pins.filter((i)=>i.boxId===t.boxId),o=n.length,r=n.map((i)=>`${i.color}/${o}`).filter((i)=>this.singletonKeys.includes(i));e[t.boxId]=new Set(r)}return e}initializeWipPartitions(){let e=[],t=new Set,n=new Set,o=0;for(let r of this.initialGraph.boxes){let i=this.initialGraph.pins.filter((a)=>a.boxId===r.boxId).filter((a)=>oJ(this.initialGraph,r,a)).filter((a)=>!this.centerPinColors.includes(a.color));if(i.length<4)continue;let s=new Set(i.map((a)=>oJ(this.initialGraph,r,a)));if(s.size>1)n.add(r.boxId);for(let a of s){let c={partitionId:`partition${o++}`,filledSingletonSlots:new Set,pins:[]};for(let l of i)if(oJ(this.initialGraph,r,l)===a)c.pins.push({boxId:r.boxId,pinId:l.pinId}),t.add(`${r.boxId}:${l.pinId}`);e.push(c)}}if(e.length===0)e.push(this.createWipPartitionFromEntireGraph()),this.solved=!0;return uk(`splitBoxIds = ${Array.from(n).join(", ")}`),uk(`wipPartitions = ${e.map((r)=>r.partitionId).join(", ")}`),{wipPartitions:e,splitBoxIds:n,addedPins:t}}createWipPartitionFromEntireGraph(){return{partitionId:"entire-graph",filledSingletonSlots:new Set,pins:this.initialGraph.pins.map((e)=>({boxId:e.boxId,pinId:e.pinId}))}}step(){if(this.solved)return;if(this.iteration++,uk(`
── Iteration ${this.iteration} ──  unexplored=${this.unexploredPins.length}  explored=${this.exploredPins.size}`),this.unexploredPins.sort((l,h)=>{let d=`${l.boxId}:${l.pinId}`,u=`${h.boxId}:${h.pinId}`,_=this.pinNetworkSize[d]-this.pinNetworkSize[u];if(_!==0)return _;return this.pinConnectionCount[d]-this.pinConnectionCount[u]}),this.unexploredPins.length===0){this.solved=!0;return}let e=this.unexploredPins.shift(),t=`${e.boxId}:${e.pinId}`;uk(`Exploring pin ${e.boxId}:${e.pinId} for partition "${e.partitionId}"`),this.lastExploredPin={...e,partitionId:e.partitionId};let n=`${e.partitionId}[${t}]`,o=this.initialGraph.pins.find((l)=>l.boxId===e.boxId&&l.pinId===e.pinId);if(!o)return;if(this.exploredPins.has(n))return;let r=this.wipPartitions.find((l)=>l.partitionId===e.partitionId);if(!r)return;let i=this.acceptedBoxPartitionMap.get(e.boxId);if(i&&i!==e.partitionId&&!this.splitBoxIds.has(e.boxId)){uk(`  ↳ rejected (box ${e.boxId} for partition ${e.partitionId} already in partition ${this.acceptedBoxPartitionMap.get(e.boxId)})`),this.exploredPins.add(n);return}let s=this.boxSingletonKeys[e.boxId];if(Array.from(s).some((l)=>r.filledSingletonSlots.has(l))){uk(`  ↳ rejected (singleton already in partition "${e.partitionId}")`),this.exploredPins.add(n);return}for(let l of s)r.filledSingletonSlots.add(l);if(r.pins.push({boxId:e.boxId,pinId:e.pinId}),this.allAcceptedPins.add(t),this.addedPins.add(t),!this.splitBoxIds.has(e.boxId))this.acceptedBoxPartitionMap.set(e.boxId,e.partitionId);this.exploredPins.add(n),uk(`  ↳ accepted → pins in partition now = ${r.pins.length}`);let c=this.getNeighbors(o);for(let l of c){let h=`${l.boxId}:${l.pinId}`;if(this.addedPins.has(h))continue;if(this.centerPinColors.includes(l.color))continue;if(this.exploredPins.has(`${e.partitionId}[${h}]`))continue;this.unexploredPins.push({boxId:l.boxId,pinId:l.pinId,partitionId:e.partitionId})}if(this.unexploredPins.length===0)this.solved=!0;if(this.solved)uk(`Solver finished in ${this.iteration} iterations, partitions=${this.getPartitions().length}`)}getNeighbors(e){let t=[];for(let n of this.initialGraph.pins){if(n.networkId!==e.networkId)continue;if(e.boxId===n.boxId&&n.pinId===e.pinId)continue;t.push(n)}for(let n of this.initialGraph.pins){if(n.boxId!==e.boxId)continue;t.push(n)}return t}solve(){while(!this.solved&&this.iteration<1000)this.step()}getPartitions(){if(!this.solved)throw Error("Graph not solved");let e=[];for(let t of this.wipPartitions){if(t.pins.length===0)continue;let n=new Set(t.pins.map((r)=>r.boxId)),o=this.initialGraph.boxes.filter((r)=>n.has(r.boxId));e.push({boxes:o,pins:this.initialGraph.pins.filter((r)=>t.pins.some((i)=>i.pinId===r.pinId&&i.boxId===r.boxId)||this.centerPinColors.includes(r.color)&&n.has(r.boxId))})}return e}getGraphicsForLastGraph(){let e=pk(this.lastGraph,{title:`Iteration ${this.iteration}`}),t=this.wipPartitions.length,n=0.4;if(this.wipPartitions.forEach((r,i)=>{if(r.pins.length===0)return;let s=nJ(i,t,0.25);for(let{boxId:a,pinId:c}of r.pins){let{x:l,y:h}=L6e(this.lastGraph,a,c);e.rects.push({center:{x:l,y:h},width:0.4,height:0.4,fill:s})}}),this.lastExploredPin){let{boxId:r,pinId:i,color:s}=this.lastExploredPin,a=L6e(this.lastGraph,r,i),c=0.25;e.rects.push({center:{x:a.x,y:a.y},width:0.25,height:0.25,fill:this.lastExploredPin.partitionId?nJ(this.wipPartitions.findIndex((l)=>l.partitionId===this.lastExploredPin.partitionId),this.wipPartitions.length,1):"black"}),e.texts.push({x:a.x,y:a.y,text:`${r}:${i}-${Array.from(this.boxSingletonKeys[r]??[]).join(",")}`,fontSize:0.1})}let o=0.4;for(let r of this.unexploredPins){let{boxId:i,pinId:s,partitionId:a}=r,c=this.wipPartitions.findIndex((_)=>_.partitionId===a);if(c===-1)continue;let l=nJ(c,this.wipPartitions.length,1),{x:h,y:d}=L6e(this.lastGraph,i,s),u=1+0.1*c;e.rects.push({center:{x:h,y:d},width:o*u,height:o*u,fill:"none",stroke:l})}return e}},dSr=(e,t,n={})=>{n.similarityMethod??="wl-distance";let o=ket,r=Object.fromEntries(Object.entries(t).map(([s,a])=>[s,o(e,a)])),i=Object.entries(r).reduce((s,[a,c])=>c<s[1]?[a,c]:s);return{graphName:i[0],graph:t[i[0]],distance:i[1],corpusScores:r}},uSr=(e)=>{if(e.x>0)return"x+";if(e.x<0)return"x-";if(e.y>0)return"y+";if(e.y<0)return"y-";return null},pSr=(e)=>{switch(e){case"x+":return{x:1,y:0};case"x-":return{x:-1,y:0};case"y+":return{x:0,y:1};case"y-":return{x:0,y:-1}}},dhn=(e,t)=>{let n=e.boxes.find((a)=>a.boxId===t);if(!n)throw Error(`Box ${t} not found`);let r=e.pins.filter((a)=>a.boxId===t).map((a)=>oJ(e,n,a)),i={"x-":0,"x+":0,"y-":0,"y+":0};for(let a of r){if(!a)continue;i[a]++}let s=Math.max(...Object.values(i));for(let a of Object.keys(i))if(i[a]===s)return a;return null},mSr=(e,t,{floatingToFixedBoxAssignment:n,floatingBoxIdsWithMutablePinOffsets:o})=>{for(let r of e.boxes){let i=n[r.boxId];if(!i)continue;if(!r.center)continue;if(o?.has(r.boxId))continue;let s=z6e(t,i),a=z6e(e,r.boxId),c=dhn(t,i),l=dhn(e,r.boxId);if(c===null||l===null)continue;if(c!==l)continue;let h=pSr(c),d=s.maxX-s.minX,u=a.maxX-a.minX,_=s.maxY-s.minY,p=a.maxY-a.minY,m=u-d,A=p-_;if(m<0.001&&A<0.001)continue;for(let g of e.boxes){if(g.boxId===r.boxId)continue;if(!g.center)continue;let f={x:g.center.x-r.center.x,y:g.center.y-r.center.y};if(uSr({x:f.x*Math.abs(h.x),y:f.y*Math.abs(h.y)})===c)g.center.x+=h.x*m,g.center.y+=h.y*A}}},_Sr=(e,t,n={})=>{let{floatingBoxIdsWithMutablePinOffsets:o=new Set}=n,{floatingToFixedBoxAssignment:r,floatingToFixedPinAssignment:i}=phn(e,t),s=structuredClone(e);for(let a of s.pins){if(!o.has(a.boxId))continue;if(i[a.boxId]?.[a.pinId]){let c=i[a.boxId]?.[a.pinId],l=r[a.boxId],h=t.pins.find((d)=>d.boxId===l&&d.pinId===c);if(h)a.offset=h.offset}}for(let a of s.boxes)if(r[a.boxId]){let c=r[a.boxId],l=t.boxes.find((h)=>h.boxId===c);if(l)a.center=l.center,a.kind="fixed"}if(n.pushBoxesAsBoxesChangeSize)mSr(s,t,{floatingToFixedBoxAssignment:r,floatingBoxIdsWithMutablePinOffsets:o});return s},gSr=(e)=>{let{floatingGraph:t,fixedCorpusMatch:n,fixedAccessoryCorpusMatch:o}=e,{floatingToFixedBoxAssignment:r,floatingToFixedPinAssignment:i,floatingToFixedNetworkAssignment:s}=phn(t,n);console.log("[netAdaptAccessoryGraph] START",{floatingBoxes:t.boxes.length,fixedBoxes:n.boxes.length,accessoryBoxes:o.boxes.length});let a={};for(let[u,_]of Object.entries(s))a[_]=u;console.log("[netAdaptAccessoryGraph] assignments",{box:r,net:s});let c=[],l=[],h=new Set(Object.values(r)),d={};for(let[u,_]of Object.entries(r))d[_]=u;for(let u of o.boxes){let _=h.has(u.boxId),p=_?d[u.boxId]??u.boxId:u.boxId;if(!u.center){console.log("[netAdaptAccessoryGraph] SKIP box without center",u.boxId);continue}console.log(`[netAdaptAccessoryGraph] ADD accessory box ${u.boxId} (${_?"matched":"unmatched"}) as ${p}`);let m=o.pins.filter((A)=>A.boxId===u.boxId).map((A)=>({...A,boxId:p,networkId:a[A.networkId]??A.networkId}));c.push({...u,kind:"fixed",center:u.center,boxId:p}),l.push(...m)}return console.log("[netAdaptAccessoryGraph] FINISH",{addedBoxes:c.length,addedPins:l.length}),{boxes:c,pins:l}},ASr=(e,{corpus:t,singletonKeys:n,centerPinColors:o,floatingBoxIdsWithMutablePinOffsets:r,accessoryCorpus:i})=>{let s=new hSr(e,{singletonKeys:n,centerPinColors:o});while(!s.solved&&s.iteration<1000)s.step();let l=s.getPartitions().map(lSr).map((m)=>{let{graph:A,distance:g,graphName:f}=dSr(m.g,t),y=i?.[f],x=_Sr(structuredClone(m.g),A,{floatingBoxIdsWithMutablePinOffsets:r,pushBoxesAsBoxesChangeSize:!0}),C;if(y)C=gSr({floatingGraph:structuredClone(m.g),fixedCorpusMatch:A,fixedAccessoryCorpusMatch:y});return{adaptedBpcGraph:x,adaptedAccessoryGraph:C,reflected:m.reflected,centerBoxId:m.centerBoxId,distance:g}}),h=l.map(({adaptedBpcGraph:m,reflected:A,centerBoxId:g})=>{if(!A)return m;return Let({graph:m,axis:"x",centerBoxId:g})}),d;if(i)d=l.filter((m)=>m.adaptedAccessoryGraph!==void 0&&m.centerBoxId!==null).map(({adaptedAccessoryGraph:m,reflected:A,centerBoxId:g})=>{if(!A)return m;return Let({graph:m,axis:"x",centerBoxId:g})});let u=hhn(h),_;if(i)_=hhn(d);let p=l.reduce((m,A)=>m+(A.distance||0),0);return{fixedGraph:u,accessoryFixedGraph:_,distance:p}},_hn=(e,{corpus:t,singletonKeys:n,centerPinColors:o,floatingBoxIdsWithMutablePinOffsets:r})=>{let i=[],s=null;for(let a of e){let{fixedGraph:c,accessoryFixedGraph:l,distance:h}=ASr(a.floatingGraph,{corpus:t,singletonKeys:n,centerPinColors:o,floatingBoxIdsWithMutablePinOffsets:r});if(i.push({variantName:a.variantName,distance:h}),!s||h<s.distance)s={variantName:a.variantName,fixedGraph:c,accessoryFixedGraph:l,distance:h}}return{fixedGraph:s.fixedGraph,accessoryFixedGraph:s.accessoryFixedGraph,selectedVariantName:s.variantName,variantResults:i}};er();er();var zSn=at(j0(),1);var OSn=at(j0(),1);K0();er();er();var XSn=at(j0(),1),KSn=at(j0(),1);rae();var $Sn=at(j0(),1);var qSn=at(j0(),1);var ePn=at(j0(),1),tPn=at(ln(),1);yc();var sPn=at(j0(),1);var sm=0.000000000000001,fSr=class{map;rev;constructor(){this.map=new Map([["0",0]]),this.rev=["0"]}getOrCreate(e){let t=String(e),n=t.toUpperCase();if(this.map.has(n))return this.map.get(n);let o=this.rev.length;return this.map.set(n,o),this.rev.push(t),o}get(e){return this.map.get(String(e).toUpperCase())}count(){return this.rev.length}matrixIndexOfNode(e){if(e===0)return-1;return e-1}};function b1(e){if(e==null)return NaN;let t=String(e).trim();if(t==="")return NaN;if(/^[+-]?\d*\.?\d+(?:[eE][+-]?\d+)?$/.test(t))return parseFloat(t);let n={t:1000000000000,g:1e9,meg:1e6,k:1000,m:0.001,u:0.000001,n:0.000000001,p:0.000000000001,f:0.000000000000001},o=t.match(/^([+-]?\d*\.?\d+(?:[eE][+-]?\d+)?)([a-zA-Z]+)$/);if(!o)return parseFloat(t);let[,r,i]=o;if(r==null)return parseFloat(t);let s=parseFloat(r),a=(i??"").toLowerCase();if(a=a.replace(/(ohm|v|a|s|h|f)$/g,""),a==="meg")return s*n.meg;if(a.length===1&&a in n)return s*n[a];return s}function ySr(e){let o=e.trim().replace(/^pulse\s*\(/i,"(").replace(/^\(/,"").replace(/\)$/,"").trim().split(/[\s,]+/).filter((i)=>i.length);if(o.length<7)throw Error("PULSE(...) requires 7 or 8 args");let r=o.map((i)=>b1(i));if(r.some((i)=>Number.isNaN(i)))throw Error("Invalid PULSE() numeric value");return{v1:r[0],v2:r[1],td:r[2],tr:r[3],tf:r[4],ton:r[5],period:r[6],ncycles:o[7]!=null?r[7]:1/0}}function xSr(e){let o=e.trim().replace(/^pwl\s*\(/i,"(").replace(/^\(/,"").replace(/\)$/,"").trim().split(/[\s,]+/).filter((i)=>i.length);if(o.length===0||o.length%2!==0)throw Error("PWL(...) requires an even number of time/value pairs");let r=[];for(let i=0;i<o.length;i+=2){let s=b1(o[i]),a=b1(o[i+1]);if(Number.isNaN(s)||Number.isNaN(a))throw Error("Invalid PWL() numeric value");r.push({t:s,v:a})}return r}function CSr(e,t){if(t<e.td)return e.v1;let n=t-e.td,o=Math.floor(n/e.period);if(o>=e.ncycles)return e.v1;let r=n-o*e.period;if(r<e.tr){let i=r/Math.max(e.tr,sm);return e.v1+(e.v2-e.v1)*i}if(r<e.tr+e.ton)return e.v2;if(r<e.tr+e.ton+e.tf){let i=(r-(e.tr+e.ton))/Math.max(e.tf,sm);return e.v2+(e.v1-e.v2)*i}return e.v1}function bSr(e,t){if(e.length===0)return 0;if(t<=e[0].t)return e[0].v;for(let n=1;n<e.length;n++){let o=e[n-1],r=e[n];if(t<=r.t){let i=Math.max(r.t-o.t,sm),s=(t-o.t)/i;return o.v+(r.v-o.v)*s}}return e[e.length-1].v}function ISr(e){let t=/"[^"]*"|\w+\s*\([^)]*\)|\([^()]*\)|\S+/g,n=[],o;while((o=t.exec(e))!==null)n.push(o[0]);return n}function th(e,t,n){let o=e[t];if(o==null)throw Error(n);return o}function vSr(e){let t=new Map,n=new Map,o={nodes:new fSr,R:[],C:[],L:[],V:[],S:[],D:[],analyses:{ac:null,tran:null},probes:{tran:[]},skipped:[],models:{vswitch:t,diode:n}},r=e.split(/\r?\n/),i=!1;for(let a of r){let c=a.trim();if(!c)continue;if(/^\*/.test(c))continue;if(/^\s*\.end\b/i.test(c))break;c=c.replace(/\/\/.*$/,""),c=c.replace(/;.*$/,"");let l=ISr(c);if(l.length===0)continue;let h=l[0];if(h.length===0)continue;if(!i&&!/^[rclvgsmiqd]\w*$/i.test(h)&&!/^\./.test(h)){i=!0;continue}if(/^\./.test(h)){let _=h.toLowerCase();if(_===".ac"){let p=th(l,1,".ac missing mode").toLowerCase();if(p!=="dec"&&p!=="lin")throw Error(".ac supports 'dec' or 'lin'");let m=parseInt(th(l,2,".ac missing point count"),10),A=b1(th(l,3,".ac missing start frequency")),g=b1(th(l,4,".ac missing stop frequency"));o.analyses.ac={mode:p,N:m,f1:A,f2:g}}else if(_===".tran"){let p=b1(th(l,1,".tran missing timestep")),m=b1(th(l,2,".tran missing stop time"));o.analyses.tran={dt:p,tstop:m}}else if(_===".print")if(th(l,1,".print missing analysis type").toLowerCase()==="tran"){let m=l.slice(2);for(let A of m){let g=A.match(/^v\(([^)]+)\)$/i);if(g&&g[1]){let f=g[1];if(!o.probes.tran.some((y)=>y.toUpperCase()===f.toUpperCase()))o.probes.tran.push(f)}}}else o.skipped.push(c);else if(_===".model"){let p=th(l,1,".model missing name"),A=th(l,2,".model missing type"),g="";if(A.includes("(")){let y=A.indexOf("(");g=A.slice(y+1),A=A.slice(0,y)}if(!g)g=l.slice(3).join(" ").replace(/^\(/,"").replace(/\)$/,"");else{let y=l.slice(3).join(" ").replace(/\)$/,"");g=`${g} ${y}`.trim()}g=g.replace(/^\(/,"").replace(/\)$/,"").trim();let f=A.toLowerCase();if(f==="vswitch"||f==="sw"){let y={name:p,Ron:1,Roff:1000000000000,Von:0,Voff:0},x,C;if(g.length>0){let b=g.split(/[\s,]+/).filter(Boolean);for(let I of b){let[v,P]=I.split("=");if(!v||P==null)continue;let M=v.toLowerCase(),B=b1(P);if(Number.isNaN(B))continue;if(M==="ron")y.Ron=B;else if(M==="roff")y.Roff=B;else if(M==="von")y.Von=B;else if(M==="voff")y.Voff=B;else if(M==="vt")x=B;else if(M==="vh")C=B}}if(x!==void 0){let b=C??0;y.Von=x+b/2,y.Voff=x-b/2}t.set(p.toLowerCase(),y)}else if(f==="d"){let y={name:p,Is:0.00000000000001,N:1};if(g.length>0){let x=g.split(/[\s,]+/).filter(Boolean);for(let C of x){let[b,I]=C.split("=");if(!b||I==null)continue;let v=b.toLowerCase(),P=b1(I);if(Number.isNaN(P))continue;if(v==="is")y.Is=P;else if(v==="n")y.N=P}}n.set(p.toLowerCase(),y)}else o.skipped.push(c)}else o.skipped.push(c);continue}let d=h.charAt(0).toLowerCase(),u=h;try{if(d==="r"){let _=o.nodes.getOrCreate(th(l,1,"Resistor missing node")),p=o.nodes.getOrCreate(th(l,2,"Resistor missing node")),m=b1(th(l,3,"Resistor missing value"));o.R.push({name:u,n1:_,n2:p,R:m})}else if(d==="c"){let _=o.nodes.getOrCreate(th(l,1,"Capacitor missing node")),p=o.nodes.getOrCreate(th(l,2,"Capacitor missing node")),m=b1(th(l,3,"Capacitor missing value"));o.C.push({name:u,n1:_,n2:p,C:m,vPrev:0})}else if(d==="l"){let _=o.nodes.getOrCreate(th(l,1,"Inductor missing node")),p=o.nodes.getOrCreate(th(l,2,"Inductor missing node")),m=b1(th(l,3,"Inductor missing value"));o.L.push({name:u,n1:_,n2:p,L:m,iPrev:0})}else if(d==="v"){let _=o.nodes.getOrCreate(th(l,1,"Voltage source missing node")),p=o.nodes.getOrCreate(th(l,2,"Voltage source missing node")),m={dc:0,acMag:0,acPhaseDeg:0,waveform:null,index:-1},A=3;if(A<l.length&&!/^[a-zA-Z]/.test(l[A]))m.dc=b1(l[A]),A++;while(A<l.length){let g=l[A].toLowerCase();if(g==="dc"){let f=th(l,A+1,"DC value missing");m.dc=b1(f),A+=2}else if(g==="ac"){let f=th(l,A+1,"AC magnitude missing");m.acMag=b1(f);let y=l[A+2];if(y!=null&&/^[+-]?\d/.test(y))m.acPhaseDeg=b1(y),A+=3;else A+=2}else if(g.startsWith("pulse")){let f=g.includes("(")?g:th(l,A+1,"PULSE() missing arguments");if(!f||!/\(.*\)/.test(f))throw Error("Malformed PULSE() specification");let y=ySr(f);m.waveform=(x)=>CSr(y,x),A+=g.includes("(")?1:2}else if(g.startsWith("pwl")){let f=g.includes("(")?g:th(l,A+1,"PWL() missing arguments");if(!f||!/\(.*\)/.test(f))throw Error("Malformed PWL() specification");let y=xSr(f);m.waveform=(x)=>bSr(y,x),A+=g.includes("(")?1:2}else if(/^\(.*\)$/.test(g))A++;else A++}o.V.push({name:u,n1:_,n2:p,dc:m.dc,acMag:m.acMag,acPhaseDeg:m.acPhaseDeg,waveform:m.waveform,index:m.index??-1})}else if(d==="s"){let _=o.nodes.getOrCreate(th(l,1,"Switch missing node")),p=o.nodes.getOrCreate(th(l,2,"Switch missing node")),m=o.nodes.getOrCreate(th(l,3,"Switch missing control node")),A=o.nodes.getOrCreate(th(l,4,"Switch missing control node")),g=th(l,5,"Switch missing model");o.S.push({name:u,n1:_,n2:p,ncPos:m,ncNeg:A,modelName:g.toLowerCase(),model:null,isOn:!1})}else if(d==="d")if(l.length===4){let _=o.nodes.getOrCreate(th(l,1,"Diode missing node")),p=o.nodes.getOrCreate(th(l,2,"Diode missing node")),m=th(l,3,"Diode missing model");o.D.push({name:u,nPlus:_,nMinus:p,modelName:m.toLowerCase(),model:null,vdPrev:0})}else o.skipped.push(c);else o.skipped.push(c)}catch(_){if(_ instanceof Error)throw Error(`Parse error on line: "${c}"
${_.message}`);throw _}}let s=o.nodes.count()-1;for(let a=0;a<o.V.length;a++){let c=o.V[a];if(!c)continue;c.index=s+a}for(let a of o.S){let c=t.get(a.modelName);if(!c)throw Error(`Unknown .model ${a.modelName} referenced by switch ${a.name}`);a.model=c,a.isOn=!1}for(let a of o.D){let c=n.get(a.modelName);if(!c)throw Error(`Unknown .model ${a.modelName} referenced by diode ${a.name}`);a.model=c}return o}var nh=class e{re;im;constructor(t=0,n=0){this.re=t,this.im=n}static from(t,n=0){return new e(t,n)}static fromPolar(t,n=0){let o=n*Math.PI/180;return new e(t*Math.cos(o),t*Math.sin(o))}clone(){return new e(this.re,this.im)}add(t){return new e(this.re+t.re,this.im+t.im)}sub(t){return new e(this.re-t.re,this.im-t.im)}mul(t){return new e(this.re*t.re-this.im*t.im,this.re*t.im+this.im*t.re)}div(t){let n=t.re*t.re+t.im*t.im;if(n<sm)throw Error("Complex divide by ~0");return new e((this.re*t.re+this.im*t.im)/n,(this.im*t.re-this.re*t.im)/n)}inv(){let t=this.re*this.re+this.im*this.im;if(t<sm)throw Error("Complex invert by ~0");return new e(this.re/t,-this.im/t)}abs(){return Math.hypot(this.re,this.im)}phaseDeg(){return Math.atan2(this.im,this.re)*180/Math.PI}};function SSr(e,t){let n=e.length;for(let r=0;r<n;r++){let i=e[r],s=t[r];if(!i||!s)throw Error("Matrix dimensions mismatch");let a=i.map((c)=>c.clone());a.push(s.clone()),e[r]=a}for(let r=0;r<n;r++){let i=r,s=e[r];if(!s)throw Error("Matrix row missing");let a=s[r]?.abs()??0;for(let h=r+1;h<n;h++){let d=e[h];if(!d)throw Error("Matrix row missing");let u=d[r]?.abs()??0;if(u>a)a=u,i=h}if(a<sm)throw Error("Singular matrix (complex)");if(i!==r){let h=e[r];e[r]=e[i],e[i]=h}let c=e[r];if(!c)throw Error("Pivot row missing");let l=c[r];if(!l)throw Error("Zero pivot encountered");for(let h=r+1;h<n;h++){let d=e[h];if(!d)throw Error("Matrix row missing");let u=d[r];if(!u)continue;let _=u.div(l);if(_.abs()<sm)continue;for(let p=r;p<=n;p++){let m=d[p],A=c[p];if(!m||!A)continue;d[p]=m.sub(_.mul(A))}}}let o=Array(n);for(let r=n-1;r>=0;r--){let i=e[r];if(!i)throw Error("Matrix row missing");let s=i[n];if(!s)throw Error("Augmented column missing");for(let c=r+1;c<n;c++){let l=i[c],h=o[c];if(!l||!h)continue;s=s.sub(l.mul(h))}let a=i[r];if(!a)throw Error("Zero pivot on back-substitution");o[r]=s.div(a)}return o}function PSr(e,t,n){if(e<=0||t<=0)throw Error(".ac frequencies must be > 0");if(t<e)[e,t]=[t,e];let o=Math.log10(t/e),r=Math.max(1,Math.ceil(o*n)),i=[];for(let a=0;a<=r;a++)i.push(e*Math.pow(10,a/n));let s=i[i.length-1];if(s==null||s<t*(1-sm))i.push(t);return i}function Het(e,t,n,o,r){let i=t.matrixIndexOfNode(n),s=t.matrixIndexOfNode(o);if(i>=0){let a=e[i];if(!a)throw Error("Matrix row missing while stamping");a[i]=a[i]?.add(r)??r}if(s>=0){let a=e[s];if(!a)throw Error("Matrix row missing while stamping");a[s]=a[s]?.add(r)??r}if(i>=0&&s>=0){let a=e[i],c=e[s];if(!a||!c)throw Error("Matrix row missing while stamping");a[s]=a[s]?.sub(r)??nh.from(0,0).sub(r),c[i]=c[i]?.sub(r)??nh.from(0,0).sub(r)}}function ESr(e,t,n,o,r){let i=n.matrixIndexOfNode(o.n1),s=n.matrixIndexOfNode(o.n2),a=o.index,c=nh.from(1,0),l=nh.from(-1,0);if(i>=0){let d=e[i];if(!d)throw Error("Matrix row missing while stamping voltage source");d[a]=d[a]?.add(c)??c}if(s>=0){let d=e[s];if(!d)throw Error("Matrix row missing while stamping voltage source");d[a]=d[a]?.sub(c)??l}let h=e[a];if(!h)throw Error("Branch row missing while stamping voltage source");if(i>=0)h[i]=h[i]?.add(c)??c;if(s>=0)h[s]=h[s]?.sub(c)??l;t[a]=(t[a]??nh.from(0,0)).add(r)}function MSr(e){let{mode:t,N:n,f1:o,f2:r}=e;if(t==="dec")return PSr(o,r,n);let i=[],s=Math.max(2,n),a=(r-o)/(s-1);for(let c=0;c<s;c++)i.push(o+c*a);return i}function wSr(e,t,n){let o=Array.from({length:n},()=>Array.from({length:n},()=>nh.from(0,0))),r=Array.from({length:n},()=>nh.from(0,0)),i=2*Math.PI;for(let s of e.R){if(s.R<=0)throw Error(`R ${s.name} must be > 0`);let a=nh.from(1/s.R,0);Het(o,e.nodes,s.n1,s.n2,a)}for(let s of e.C){let a=nh.from(0,i*t*s.C);Het(o,e.nodes,s.n1,s.n2,a)}for(let s of e.L){let a=nh.from(0,i*t*s.L),c=a.abs()<sm?nh.from(0,0):nh.from(1,0).div(a);Het(o,e.nodes,s.n1,s.n2,c)}for(let s of e.V){let a=nh.fromPolar(s.acMag||0,s.acPhaseDeg||0);ESr(o,r,e.nodes,s,a)}return{A:o,b:r}}function BSr(e){if(!e.analyses.ac)return null;let{mode:t,N:n,f1:o,f2:r}=e.analyses.ac,i=e.nodes.count()-1,s=e.V.length,a=i+s,c=MSr({mode:t,N:n,f1:o,f2:r}),l={};e.nodes.rev.forEach((u,_)=>{if(_!==0)l[u]=[]});let h={},d=2*Math.PI;for(let u of c){let{A:_,b:p}=wSr(e,u,a),m=SSr(_,p);for(let A=1;A<e.nodes.count();A++){let g=A-1,f=e.nodes.rev[A];if(!f)continue;let y=l[f];if(!y)continue;y.push(m[g]??nh.from(0,0))}for(let A of e.R){let g=A.n1===0?nh.from(0,0):m[A.n1-1]??nh.from(0,0),f=A.n2===0?nh.from(0,0):m[A.n2-1]??nh.from(0,0),x=nh.from(1/A.R,0).mul(g.sub(f));(h[A.name]||=[]).push(x)}for(let A of e.C){let g=A.n1===0?nh.from(0,0):m[A.n1-1]??nh.from(0,0),f=A.n2===0?nh.from(0,0):m[A.n2-1]??nh.from(0,0),x=nh.from(0,d*u*A.C).mul(g.sub(f));(h[A.name]||=[]).push(x)}for(let A of e.L){let g=A.n1===0?nh.from(0,0):m[A.n1-1]??nh.from(0,0),f=A.n2===0?nh.from(0,0):m[A.n2-1]??nh.from(0,0),y=nh.from(0,d*u*A.L),C=(y.abs()<sm?nh.from(0,0):nh.from(1,0).div(y)).mul(g.sub(f));(h[A.name]||=[]).push(C)}for(let A of e.V){let g=m[A.index]??nh.from(0,0);(h[A.name]||=[]).push(g)}}return{freqs:c,nodeVoltages:l,elementCurrents:h}}var ghn=0.02585;function TSr(e,t){let n=e.length;for(let r=0;r<n;r++){let i=e[r],s=t[r];if(!i||s==null)throw Error("Matrix dimensions mismatch");let a=i.slice();a.push(s),e[r]=a}for(let r=0;r<n;r++){let i=r,s=e[r];if(!s)throw Error("Matrix row missing");let a=Math.abs(s[r]??0);for(let h=r+1;h<n;h++){let d=e[h];if(!d)throw Error("Matrix row missing");let u=Math.abs(d[r]??0);if(u>a)a=u,i=h}if(a<sm)throw Error("Singular matrix (real)");if(i!==r){let h=e[r];e[r]=e[i],e[i]=h}let c=e[r];if(!c)throw Error("Pivot row missing");let l=c[r];if(l==null)throw Error("Zero pivot encountered");for(let h=r+1;h<n;h++){let d=e[h];if(!d)throw Error("Matrix row missing");let u=d[r];if(u==null)continue;let _=u/l;if(Math.abs(_)<sm)continue;for(let p=r;p<=n;p++){let m=d[p],A=c[p];if(m==null||A==null)continue;d[p]=m-_*A}}}let o=Array(n).fill(0);for(let r=n-1;r>=0;r--){let i=e[r];if(!i)throw Error("Matrix row missing");let s=i[n];if(s==null)throw Error("Augmented column missing");for(let c=r+1;c<n;c++){let l=i[c],h=o[c];if(l==null||h==null)continue;s-=l*h}let a=i[r];if(a==null)throw Error("Zero pivot on back-substitution");o[r]=s/a}return o}function dhe(e,t,n,o,r){let i=t.matrixIndexOfNode(n),s=t.matrixIndexOfNode(o);if(i>=0){let a=e[i];if(!a)throw Error("Matrix row missing while stamping");a[i]=(a[i]??0)+r}if(s>=0){let a=e[s];if(!a)throw Error("Matrix row missing while stamping");a[s]=(a[s]??0)+r}if(i>=0&&s>=0){let a=e[i],c=e[s];if(!a||!c)throw Error("Matrix row missing while stamping");a[s]=(a[s]??0)-r,c[i]=(c[i]??0)-r}}function Fet(e,t,n,o,r){let i=t.matrixIndexOfNode(n),s=t.matrixIndexOfNode(o);if(i>=0)e[i]=(e[i]??0)-r;if(s>=0)e[s]=(e[s]??0)+r}function DSr(e,t,n,o,r){let i=n.matrixIndexOfNode(o.n1),s=n.matrixIndexOfNode(o.n2),a=o.index;if(i>=0){let l=e[i];if(!l)throw Error("Matrix row missing while stamping voltage source");l[a]=(l[a]??0)+1}if(s>=0){let l=e[s];if(!l)throw Error("Matrix row missing while stamping voltage source");l[a]=(l[a]??0)-1}let c=e[a];if(!c)throw Error("Branch row missing while stamping voltage source");if(i>=0)c[i]=(c[i]??0)+1;if(s>=0)c[s]=(c[s]??0)-1;t[a]=(t[a]??0)+r}function NSr(e,t){let n=e>sm?e:Math.max(t/1000,sm),o=Math.max(1,Math.ceil(t/Math.max(n,sm)));return{dt:o>0?t/o:t,steps:o}}function RSr(e,t,n,o,r,i,s){for(let a of n.R){let c=1/a.R;dhe(e,n.nodes,a.n1,a.n2,c)}for(let a of n.C){let c=a.C/Math.max(r,sm);dhe(e,n.nodes,a.n1,a.n2,c);let l=-c*a.vPrev;Fet(t,n.nodes,a.n1,a.n2,l)}for(let a of n.L){let c=Math.max(r,sm)/a.L;dhe(e,n.nodes,a.n1,a.n2,c),Fet(t,n.nodes,a.n1,a.n2,a.iPrev)}for(let a of n.S){let c=a.model;if(!c)continue;let l=a.isOn?c.Ron:c.Roff,d=1/Math.max(Math.abs(l),sm);dhe(e,n.nodes,a.n1,a.n2,d)}for(let a of n.V){let c=a.waveform?a.waveform(o):a.dc||0;DSr(e,t,n.nodes,a,c)}for(let a of n.D){let c=a.model;if(!c)continue;let{nPlus:l,nMinus:h}=a,d=n.nodes.matrixIndexOfNode(l),u=n.nodes.matrixIndexOfNode(h),_=l===0?0:i[d]??0,p=h===0?0:i[u]??0,m=_-p,A=s===0?a.vdPrev:m,g=c.N*ghn,f=A;if(A>0.8)f=0.8;if(A<-1)f=-1;let y=Math.exp(f/g),x=c.Is*(y-1),C=Math.max(c.Is/g*y,0.000000000001),b=x-C*f;dhe(e,n.nodes,l,h,C),Fet(t,n.nodes,l,h,b)}}function QSr(e,t){let n=!1;for(let o of e.S){let r=o.model;if(!r)continue;let i=o.ncPos===0?0:t[o.ncPos-1]??0,s=o.ncNeg===0?0:t[o.ncNeg-1]??0,a=i-s,c=o.isOn;if(o.isOn){if(a<r.Voff)c=!1}else if(a>r.Von)c=!0;if(c!==o.isOn)o.isOn=c,n=!0}return n}function kSr(e){if(!e.analyses.tran)return null;let{dt:t,tstop:n}=e.analyses.tran,{dt:o,steps:r}=NSr(t,n),i=e.nodes.count()-1,s=e.V.length,a=i+s,c=[],l={};e.nodes.rev.forEach((u,_)=>{if(_!==0)l[u]=[]});let h={},d=0;for(let u=0;u<=r;u++,d=u*o){c.push(d);let _=Array(a).fill(0);for(let p=0;p<20;p++){let m=Array.from({length:a},()=>Array(a).fill(0)),A=Array(a).fill(0);if(RSr(m,A,e,d,o,_,p),_=TSr(m,A),!QSr(e,_))break;if(p===19)break}for(let p=1;p<e.nodes.count();p++){let m=p-1,A=e.nodes.rev[p];if(!A)continue;let g=l[A];if(!g)continue;g.push(_[m]??0)}for(let p of e.R){let m=p.n1===0?0:_[p.n1-1]??0,A=p.n2===0?0:_[p.n2-1]??0,g=(m-A)/p.R;(h[p.name]||=[]).push(g)}for(let p of e.C){let m=p.n1===0?0:_[p.n1-1]??0,A=p.n2===0?0:_[p.n2-1]??0,g=p.C*(m-A-p.vPrev)/Math.max(o,sm);(h[p.name]||=[]).push(g)}for(let p of e.L){let m=p.n1===0?0:_[p.n1-1]??0,A=p.n2===0?0:_[p.n2-1]??0,f=Math.max(o,sm)/p.L*(m-A)+p.iPrev;(h[p.name]||=[]).push(f)}for(let p of e.V){let m=_[p.index]??0;(h[p.name]||=[]).push(m)}for(let p of e.S){let m=p.model;if(!m)continue;let A=p.n1===0?0:_[p.n1-1]??0,g=p.n2===0?0:_[p.n2-1]??0,f=p.isOn?m.Ron:m.Roff,y=Math.max(Math.abs(f),sm),x=(A-g)/y;(h[p.name]||=[]).push(x)}for(let p of e.D){if(!p.model)continue;let{nPlus:m,nMinus:A,model:g}=p,f=m===0?0:_[m-1]??0,y=A===0?0:_[A-1]??0,x=f-y,C=g.N*ghn,b=Math.exp(x/C),I=g.Is*(b-1);(h[p.name]||=[]).push(I)}for(let p of e.C){let m=p.n1===0?0:_[p.n1-1]??0,A=p.n2===0?0:_[p.n2-1]??0;p.vPrev=m-A}for(let p of e.L){let m=p.n1===0?0:_[p.n1-1]??0,A=p.n2===0?0:_[p.n2-1]??0,g=Math.max(o,sm)/p.L;p.iPrev=g*(m-A)+p.iPrev}for(let p of e.D){let m=p.nPlus===0?0:_[p.nPlus-1]??0,A=p.nMinus===0?0:_[p.nMinus-1]??0;p.vdPrev=m-A}}if(e.probes.tran.length>0){let u={},_=e.probes.tran.map((p)=>p.toUpperCase());for(let p in l)if(_.includes(p.toUpperCase()))u[p]=l[p];return{times:c,nodeVoltages:u,elementCurrents:h}}return{times:c,nodeVoltages:l,elementCurrents:h}}function Ahn(e){let t=vSr(e),n=BSr(t),o=kSr(t);return{circuit:t,ac:n,tran:o}}function fhn(e,t,n){if(!e||!t.analyses.tran)return[];let{dt:o,tstop:r}=t.analyses.tran,{times:i,nodeVoltages:s}=e,a=[];for(let c in s){let l=s[c];a.push({type:"simulation_transient_voltage_graph",simulation_transient_voltage_graph_id:`stvg_${n}_${c}`,simulation_experiment_id:n,timestamps_ms:i.map((h)=>h*1000),voltage_levels:l,time_per_step:o*1000,start_time_ms:0,end_time_ms:r*1000,name:`${c}`})}return a}function HSr(e){let t=new Map,n=0;function o(r){for(let[,s]of t)if(s.has(r))return s;let i=new Set;return t.set(`connectivity_net${n++}`,i),i}for(let r of e){let i=null;for(let s of r){if(!i)i=o(s);else if(!i.has(s)){let a=o(s);if(a!==i){for(let c of a)i.add(c);t.delete(Array.from(t.entries()).find(([,c])=>c===a)[0])}}i.add(s)}}return Object.fromEntries(Array.from(t.entries()).map(([r,i])=>[r,Array.from(i)]))}var FSr=class{netMap;idToNetMap;constructor(e){this.netMap=e,this.idToNetMap={};for(let[t,n]of Object.entries(e))for(let o of n)this.idToNetMap[o]=t}addConnections(e){for(let t of e){let n=new Set;for(let r of t){let i=this.idToNetMap[r];if(i)n.add(i)}let o;if(n.size===0)o=`connectivity_net${Object.keys(this.netMap).length}`,this.netMap[o]=[];else if(n.size===1)o=n.values().next().value??`connectivity_net${Object.keys(this.netMap).length}`;else{o=n.values().next().value??`connectivity_net${Object.keys(this.netMap).length}`;for(let r of n)if(r!==o){this.netMap[o].push(...this.netMap[r]),this.netMap[r]=this.netMap[o];for(let i of this.netMap[o])this.idToNetMap[i]=o}}for(let r of t){if(!this.netMap[o].includes(r))this.netMap[o].push(r);this.idToNetMap[r]=o}}}getIdsConnectedToNet(e){return this.netMap[e]||[]}getNetConnectedToId(e){return this.idToNetMap[e]}areIdsConnected(e,t){if(e===t)return!0;let n=this.getNetConnectedToId(e);if(!n)return!1;let o=this.getNetConnectedToId(t);if(!o)return!1;return n===o||o===e||o===e}areAllIdsConnected(e){let t=this.getNetConnectedToId(e[0]);for(let n of e){let o=this.getNetConnectedToId(n);if(o===void 0)return!1;if(o!==t)return!1}return!0}},yhn=(e)=>{let t=[];for(let o of e)if(o.type==="source_trace")t.push([...o.connected_source_port_ids??[],...o.connected_source_net_ids??[]]);else if(o.type==="source_component"){if(o.internally_connected_source_port_ids)for(let r of o.internally_connected_source_port_ids)t.push(r)}let n=HSr(t);return new FSr(n)};er();var Oet=class{sourceSpan;leadingTrivia=[];trailingComment;constructor(e={}){this.sourceSpan=e.sourceSpan,this.trailingComment=e.trailingComment}getString(e){return this.toSource(e)}},xhn="__default__",RB=class e extends Oet{originalSource;constructor(t={}){super(t);this.originalSource=t.originalSource}static classes={};static register(t){if(!t.spiceTokenKeys||t.spiceTokenKeys.length===0)throw Error("Class must declare static spiceTokenKeys");for(let n of t.spiceTokenKeys)e.classes[n.toLowerCase()]=t}static parseSpiceTokens(t){let n=t.tokens.find((i)=>i.type!=="whitespace"),o=n===void 0?"blank":n.type==="directive"?`.${n.value}`:n.type==="comment"?"comment":n.type==="identifier"?n.raw[0]?.toUpperCase()??xhn:n.type,r=e.classes[o.toLowerCase()]??(n?.type==="identifier"?e.classes.__unknown_element__:void 0)??e.classes[xhn];if(r===void 0)throw Error(`No SPICE card class registered for "${o}"`);return r.fromSpiceTokens(t)}},pl=class extends RB{cardKind="directive"},QB=class extends pl{},Shn=class extends Oet{};function phe(e,t){let n=e?.dialect??"generic";if(n!=="pspice")throw Error(`PSpice-only construct ${t} cannot be serialized to target dialect "${n}". Serialize with { dialect: "pspice" } or translate/remove the construct before exporting.`)}function zSr(e){let t=[],n=[],o,r,i=(a)=>{t.push({tokens:[],originalSource:"",range:{start:a.range.end,end:a.range.end},leadingNewlineRaw:a.raw})},s=()=>{if(n.length===0)return;let a={start:n[0].range.start,end:n.at(-1).range.end};t.push({tokens:n,originalSource:n.map((c)=>c.raw).join(""),range:a,leadingNewlineRaw:r}),n=[],o=void 0,r=void 0};for(let a of e){if(a.type==="newline"){if(o!==void 0){let c=o;s(),i(c),o=a;continue}if(n.length===0)i(a);else o=a;continue}if(o!==void 0){if(a.type==="continuation")n.push(o,a),o=void 0;else{let c=o.raw;s(),r=c,o=void 0,n.push(a)}continue}if(a.type==="continuation"){n.push(a);continue}n.push(a)}return s(),t}function Vet(e){return e.filter((t)=>t.type!=="whitespace"&&t.type!=="newline"&&t.type!=="continuation")}function Phn(e){if(e===void 0)return;if("value"in e&&typeof e.value==="string")return e.value;return e.raw}function OSr(e){let t=[];for(let n=0;n<e.length;n+=1){let o=e[n];if(o===void 0)continue;let r=zet(o);if(r===".control"){let i=[],s,a=o.originalSource;for(n+=1;n<e.length;n+=1){let c=e[n];if(c===void 0)continue;if(a=`${a}${c.leadingNewlineRaw??`
`}${c.originalSource}`,zet(c)===".endc"){s=c;break}i.push(c)}t.push({...o,childCards:i,endCard:s,originalSource:a});continue}if(r===".subckt"){let i=[],s,a=o.originalSource;for(n+=1;n<e.length;n+=1){let c=e[n];if(c===void 0)continue;if(a=`${a}${c.leadingNewlineRaw??`
`}${c.originalSource}`,zet(c)===".ends"){s=c;break}i.push(c)}t.push({...o,childCards:i,endCard:s,originalSource:a});continue}t.push(o)}return t}function zet(e){let[t]=Vet(e.tokens);if(t===void 0)return;if(t.type==="directive")return`.${t.value}`;return Phn(t)}function mk(e){return Phn(e)}function Chn(e){return e.type==="punctuation"&&(e.value==="("||e.value===")"||e.value===",")}var ec=class e{constructor(t){this.card=t,this.tokens=Vet(t.tokens),this.originalSource=t.originalSource}card;tokens;originalSource;static from(t){return new e(t)}head(){return mk(this.tokens[0])??""}headRaw(){return this.tokens[0]?.raw??""}headDesignator(){return this.tokens[0]?.raw[0]?.toUpperCase()??""}arg(t){return mk(this.tokens[t+1])}args(){return this.tokens.slice(1).map((t)=>mk(t)??t.raw)}argsAfter(t){return this.args().slice(t)}argsUntilLast(){return this.args().slice(0,-1)}lastArg(){return this.args().at(-1)}keywordIndex(t){return this.findKeyword(t)?.argIndex??-1}argAfterKeyword(t){let n=this.findKeyword(t);return n===void 0?void 0:mk(this.tokens[n.tokenIndex+n.tokenCount])}hasKeyword(t){return this.findKeyword(t)!==void 0}sweepArg(t,n){let o=this.arg(t)?.toLowerCase();return o==="oct"||o==="lin"||o==="dec"?o:n}paramsAfter(t){return this.readParamsFrom(1+t)}paramAfter(t,n){let o=n.toLowerCase();return this.paramsAfter(t).find(([r])=>r.toLowerCase()===o)?.[1]}paramsAfterExcept(t,n){let o=new Set(n.map((r)=>r.toLowerCase()));return this.paramsAfter(t).filter(([r])=>!o.has(r.toLowerCase()))}paramsAfterKeyword(t){let n=this.findKeyword(t);if(n===void 0)return;return this.readParamsFrom(n.tokenIndex+n.tokenCount)}argsBeforeKeyword(t,n=0){let r=this.findKeyword(t,n)?.tokenIndex??this.tokens.length;return this.tokens.slice(1+n,r).map((i)=>mk(i)??i.raw)}restJoined(t){return this.argsAfter(t).join(" ")}findKeyword(t,n=0){let o=t.endsWith(":"),r=o?t.slice(0,-1):t;for(let i=1+n;i<this.tokens.length;i+=1){let s=this.tokens[i],a=mk(s);if(a===void 0)continue;if(a.toLowerCase()!==r.toLowerCase())continue;if(o){let c=this.tokens[i+1];if(c?.type!=="punctuation"||c.value!==":")continue;return{argIndex:i-1,tokenIndex:i,tokenCount:2}}return{argIndex:i-1,tokenIndex:i,tokenCount:1}}return}readParamsFrom(t){let n=[],o=t;while(o<this.tokens.length){let r=this.tokens[o];if(r===void 0)break;if(Chn(r)){o+=1;continue}let i=this.tokens[o+1],s=this.tokens[o+2];if(i?.type==="operator"&&i.value==="="&&s!==void 0&&!Chn(s)){let a=mk(r),c=mk(s);if(a!==void 0&&c!==void 0)n.push([a,c]);o+=3;continue}o+=1}return n}},bhn=class e{name;constructor(t){this.name=t}static ground(){return new e("0")}getString(){return this.name}},Ehn=class{raw;constructor(e){this.raw=e}getString(){return this.raw}},V6e=class{raw;constructor(e){this.raw=String(e)}getString(){return this.raw}};function Mhn(e){return e instanceof bhn?e:new bhn(e)}function Qu(e){if(e instanceof V6e)return e;if(e instanceof Ehn)return new V6e(e.getString());return new V6e(e)}function VSr(e){if(typeof e==="object"&&!(e instanceof V6e)&&!(e instanceof Ehn))return{magnitude:e.magnitude===void 0?void 0:Qu(e.magnitude),phase:e.phase===void 0?void 0:Qu(e.phase)};return{magnitude:Qu(e)}}var mhe=class e{values;constructor(t=[]){if(t instanceof e)this.values=t.entries();else if(Array.isArray(t))this.values=t.map(([n,o])=>[n,Qu(o)]);else this.values=Object.entries(t).map(([n,o])=>[n,Qu(o)])}get(t){return this.values.find(([n])=>n.toLowerCase()===t.toLowerCase())?.[1]}set(t,n){let o=this.values.findIndex(([i])=>i.toLowerCase()===t.toLowerCase()),r=[t,Qu(n)];if(o===-1)this.values.push(r);else this.values[o]=r}delete(t){let n=this.values.findIndex(([o])=>o.toLowerCase()===t.toLowerCase());if(n===-1)return!1;return this.values.splice(n,1),!0}entries(){return this.values.map(([t,n])=>[t,n])}getString(t){return this.values.map(([n,o])=>`${n}=${o.getString()}`).join(" ")}get isEmpty(){return this.values.length===0}};var Yet=class e extends QB{static spiceTokenKeys=[".ac"];type="ac";command=".ac";sweep;points;start;stop;constructor(t){super(t);this.sweep=t.sweep,this.points=t.points,this.start=Qu(t.start),this.stop=Qu(t.stop)}static fromSpiceTokens(t){let n=ec.from(t);return new e({sweep:n.sweepArg(0,"dec"),points:Number(n.arg(1)??0),start:n.arg(2)??"",stop:n.arg(3)??"",originalSource:n.originalSource})}getChildren(){return[]}toSource(t){if(t?.format!=="pretty"&&this.originalSource!==void 0)return this.originalSource;return`${this.command} ${this.sweep} ${this.points} ${this.start.getString()} ${this.stop.getString()}`}};QB.register(Yet);var YSr=class e extends pl{static spiceTokenKeys=[".control"];type="control";command=".control";lines;constructor(t){super(t);this.lines=t.lines}static fromSpiceTokens(t){let n=ec.from(t);return new e({lines:t.childCards?.map((o)=>o.originalSource)??[],originalSource:n.originalSource})}getChildren(){return[]}toSource(t){if(t?.format!=="pretty"&&this.originalSource!==void 0)return this.originalSource;return[this.command,...this.lines,".endc"].join(`
`)}};pl.register(YSr);var Get=class e extends QB{static spiceTokenKeys=[".dc"];type="dc";command=".dc";sweeps;constructor(t){super(t);let n="sweeps"in t?t.sweeps:[t];this.sweeps=n.map((o)=>({source:o.source,start:Qu(o.start),stop:Qu(o.stop),step:Qu(o.step)}))}static fromSpiceTokens(t){let n=ec.from(t);return new e({source:n.arg(0)??"",start:n.arg(1)??"",stop:n.arg(2)??"",step:n.arg(3)??"",originalSource:n.originalSource})}getChildren(){return[]}toSource(t){if(t?.format!=="pretty"&&this.originalSource!==void 0)return this.originalSource;return[this.command,...this.sweeps.flatMap((n)=>[n.source,n.start.getString(),n.stop.getString(),n.step.getString()])].join(" ")}};QB.register(Get);var uhe=class e extends pl{static spiceTokenKeys=[".end"];type="end";command=".end";static fromSpiceTokens(t){return new e({originalSource:ec.from(t).originalSource})}getChildren(){return[]}toSource(t){if(t?.format!=="pretty"&&this.originalSource!==void 0)return this.originalSource;return this.command}};pl.register(uhe);var GSr=class e extends pl{static spiceTokenKeys=[".include"];type="include";command=".include";path;constructor(t,n={}){super(n);this.path=typeof t==="string"?t:t.path}static fromSpiceTokens(t){let n=ec.from(t);return new e(n.restJoined(0),{originalSource:n.originalSource})}getChildren(){return[]}toSource(t){if(t?.format!=="pretty"&&this.originalSource!==void 0)return this.originalSource;return`${this.command} ${this.path}`}};pl.register(GSr);var USr=class e extends pl{static spiceTokenKeys=[".lib"];type="lib";command=".lib";path;section;constructor(t={}){super(t);this.path=t.path,this.section=t.section}static fromSpiceTokens(t){let n=ec.from(t);return new e({path:n.arg(0),section:n.arg(1),originalSource:n.originalSource})}getChildren(){return[]}toSource(t){if(t?.format!=="pretty"&&this.originalSource!==void 0)return this.originalSource;return[this.command,this.path,this.section].filter(Boolean).join(" ")}};pl.register(USr);var WSr=class e extends pl{static spiceTokenKeys=[".measure"];type="measure";command=".measure";analysis;name;expression;constructor(t){super(t);this.analysis=t.analysis,this.name=t.name,this.expression=t.expression}static fromSpiceTokens(t){let n=ec.from(t);return new e({analysis:n.arg(0),name:n.arg(1)??"",expression:n.restJoined(2),originalSource:n.originalSource})}getChildren(){return[]}toSource(t){if(t?.format!=="pretty"&&this.originalSource!==void 0)return this.originalSource;return[this.command,this.analysis,this.name,this.expression].filter(Boolean).join(" ")}};pl.register(WSr);var whn=class e extends pl{static spiceTokenKeys=[".model"];type="model";command=".model";name;modelType;params;constructor(t){super(t);this.name=t.name,this.modelType=t.type,this.params=new mhe(t.params)}static fromSpiceTokens(t){let n=ec.from(t);return new e({name:n.arg(0)??"",type:n.arg(1)??"",params:n.paramsAfter(2),originalSource:n.originalSource})}getChildren(){return[]}toSource(t){if(t?.format!=="pretty"&&this.originalSource!==void 0)return this.originalSource;let n=this.params.getString(t);return[this.command,this.name,this.modelType,n&&`(${n})`].filter(Boolean).join(" ")}};pl.register(whn);var Uet=class e extends QB{static spiceTokenKeys=[".op"];type="op";command=".op";static fromSpiceTokens(t){return new e({originalSource:ec.from(t).originalSource})}getChildren(){return[]}toSource(t){if(t?.format!=="pretty"&&this.originalSource!==void 0)return this.originalSource;return this.command}};QB.register(Uet);var Wet=class e extends pl{static spiceTokenKeys=[".options"];type="options";command=".options";values;constructor(t,n={}){super(n);this.values=new mhe(t)}static fromSpiceTokens(t){let n=ec.from(t);return new e(n.paramsAfter(0),{originalSource:n.originalSource})}getChildren(){return[]}toSource(t){if(t?.format!=="pretty"&&this.originalSource!==void 0)return this.originalSource;return`${this.command} ${this.values.getString(t)}`.trimEnd()}};pl.register(Wet);var XSr=class e extends pl{static spiceTokenKeys=[".param"];type="param";command=".param";values;constructor(t,n={}){super(n);this.values=new mhe(t)}static fromSpiceTokens(t){let n=ec.from(t);return new e(n.paramsAfter(0),{originalSource:n.originalSource})}getChildren(){return[]}toSource(t){if(t?.format!=="pretty"&&this.originalSource!==void 0)return this.originalSource;return`${this.command} ${this.values.getString(t)}`.trimEnd()}};pl.register(XSr);function jSr(e){let t=e.trim().replace(/^\.print\s+/i,""),[n,...o]=t.split(/\s+/),r=o.join(" ");return{analysis:n,expressions:r.length===0?[]:r.split(",").map((i)=>i.trim())}}var Xet=class e extends pl{static spiceTokenKeys=[".print"];type="print";command=".print";analysis;expressions;constructor(t={}){super(t);this.analysis=t.analysis,this.expressions=t.expressions??[]}static fromSpiceTokens(t){let n=ec.from(t);return new e({...jSr(n.originalSource),originalSource:n.originalSource})}getChildren(){return[]}toSource(t){if(t?.format!=="pretty"&&this.originalSource!==void 0)return this.originalSource;return[this.command,this.analysis,this.expressions.length>0?this.expressions.join(", "):void 0].filter(Boolean).join(" ")}};pl.register(Xet);var KSr=class e extends pl{static spiceTokenKeys=[".probe"];type="probe";command=".probe";expressions;constructor(t=[],n={}){super(n);this.expressions=t}static fromSpiceTokens(t){let n=ec.from(t);return new e(n.args(),{originalSource:n.originalSource})}getChildren(){return[]}toSource(t){if(t?.format!=="pretty"&&this.originalSource!==void 0)return this.originalSource;return[this.command,...this.expressions].join(" ")}};pl.register(KSr);var $Sr=class e extends pl{static spiceTokenKeys=[".text"];type="pspice_text";command=".TEXT";args;constructor(t,n={}){super(n);this.args=t}static fromSpiceTokens(t){let n=ec.from(t);return new e(n.args(),{originalSource:n.originalSource})}getChildren(){return[]}toSource(t){if(phe(t,".TEXT"),t?.format!=="pretty"&&this.originalSource!==void 0)return this.originalSource;return[this.command,...this.args].join(" ")}};pl.register($Sr);var qSr=class e extends pl{static spiceTokenKeys=[".vector"];type="pspice_vector";command=".VECTOR";args;constructor(t,n={}){super(n);this.args=t}static fromSpiceTokens(t){let n=ec.from(t);return new e(n.args(),{originalSource:n.originalSource})}getChildren(){return[]}toSource(t){if(phe(t,".VECTOR"),t?.format!=="pretty"&&this.originalSource!==void 0)return this.originalSource;return[this.command,...this.args].join(" ")}};pl.register(qSr);var JSr=class e extends pl{static spiceTokenKeys=[".watch"];type="pspice_watch";command=".WATCH";args;constructor(t,n={}){super(n);this.args=t}static fromSpiceTokens(t){let n=ec.from(t);return new e(n.args(),{originalSource:n.originalSource})}getChildren(){return[]}toSource(t){if(phe(t,".WATCH"),t?.format!=="pretty"&&this.originalSource!==void 0)return this.originalSource;return[this.command,...this.args].join(" ")}};pl.register(JSr);var jet=class e extends pl{static spiceTokenKeys=[".save"];type="save";command=".save";expressions;constructor(t,n={}){super(n);this.expressions=t}static fromSpiceTokens(t){let n=ec.from(t);return new e(n.args(),{originalSource:n.originalSource})}getChildren(){return[]}toSource(t){if(t?.format!=="pretty"&&this.originalSource!==void 0)return this.originalSource;return[this.command,...this.expressions].join(" ")}};pl.register(jet);var Bhn=class e extends pl{static spiceTokenKeys=[".subckt"];type="subckt";command=".subckt";name;pins;params;cards;endsName;constructor(t){super(t);this.name=t.name,this.pins=(t.pins??[]).map(Mhn),this.params=new mhe(t.params),this.cards=t.cards??[],this.endsName=t.endsName}static fromSpiceTokens(t){let n=ec.from(t),o=t.endCard===void 0?void 0:ec.from(t.endCard);return new e({name:n.arg(0)??"",pins:n.argsBeforeKeyword("params:",1),params:n.paramsAfterKeyword("params:"),cards:t.childCards?.map((r)=>RB.parseSpiceTokens(r)),endsName:o?.arg(0),originalSource:n.originalSource})}add(t){this.cards.push(t)}getChildren(){return this.cards}toSource(t){if(t?.format!=="pretty"&&this.originalSource!==void 0)return this.originalSource;let n=this.params.getString(t);return[[this.command,this.name,...this.pins.map((o)=>o.getString()),n?"params:":void 0,n||void 0].filter((o)=>o!==void 0).join(" "),...this.cards.map((o)=>o.toSource(t)),[".ends",this.endsName??this.name].join(" ")].join(`
`)}};pl.register(Bhn);var ZSr=class e extends pl{static spiceTokenKeys=[".temp"];type="temp";command=".temp";values;constructor(t,n={}){super(n);this.values=t.map(Qu)}static fromSpiceTokens(t){let n=ec.from(t);return new e(n.args(),{originalSource:n.originalSource})}getChildren(){return[]}toSource(t){if(t?.format!=="pretty"&&this.originalSource!==void 0)return this.originalSource;return[this.command,...this.values.map((n)=>n.getString())].join(" ")}};pl.register(ZSr);var Ket=class e extends QB{static spiceTokenKeys=[".tran"];type="tran";command=".tran";step;stop;start;maxStep;uic;pspiceOp;constructor(t){super(t);this.step=t.step===void 0?void 0:Qu(t.step),this.stop=Qu(t.stop),this.start=t.start===void 0?void 0:Qu(t.start),this.maxStep=t.maxStep===void 0?void 0:Qu(t.maxStep),this.uic=t.uic,this.pspiceOp=t.pspiceOp??!1}static fromSpiceTokens(t){let n=ec.from(t);return new e({step:n.arg(0),stop:n.arg(1)??"",start:n.arg(2),maxStep:n.arg(3),uic:n.hasKeyword("uic"),pspiceOp:n.originalSource.trimStart().toLowerCase().startsWith(".tran/op"),originalSource:n.originalSource})}getChildren(){return[]}toSource(t){if(this.pspiceOp)phe(t,".TRAN/OP");if(t?.format!=="pretty"&&this.originalSource!==void 0)return this.originalSource;return[this.command,this.step?.getString(),this.stop.getString(),this.start?.getString(),this.maxStep?.getString(),this.uic?"UIC":void 0].filter(Boolean).join(" ")}};QB.register(Ket);var ePr=class e extends pl{static spiceTokenKeys=["__default__"];type="unknown_dot_command";command;args;constructor(t){super(t);this.command=t.command,this.args=t.args}static fromSpiceTokens(t){let n=ec.from(t);return new e({command:n.headRaw(),args:n.args(),originalSource:n.originalSource})}getChildren(){return[]}toSource(t){if(t?.format!=="pretty"&&this.originalSource!==void 0)return this.originalSource;return[this.command,...this.args].join(" ")}};pl.register(ePr);var wd=class extends RB{cardKind="element";name;nodes;params;constructor(e){super(e);this.name=e.name,this.nodes=(e.nodes??[]).map(Mhn),this.params=new mhe(e.params)}renameNode(e,t){for(let n of this.nodes)if(n.name===e)n.name=t}getChildren(){return[]}formatParts(e,t){if(t?.format!=="pretty"&&this.originalSource!==void 0)return this.originalSource;let n=this.params.getString(t);return[...e,n||void 0].filter((o)=>o!==void 0&&o.length>0).join(" ")}},tPr=class e extends wd{static spiceTokenKeys=["Q"];type="bjt";model;constructor(t){super({...t,nodes:t.nodes.filter((n)=>n!==void 0)});this.model=t.model}static fromSpiceTokens(t){let n=ec.from(t),o=n.args().length>4,r=o?[n.arg(0)??"",n.arg(1)??"",n.arg(2)??"",n.arg(3)??""]:[n.arg(0)??"",n.arg(1)??"",n.arg(2)??""],i=o?4:3;return new e({name:n.head(),nodes:r,model:n.arg(i)??"",params:n.paramsAfter(i+1),originalSource:n.originalSource})}toSource(t){return this.formatParts([this.name,...this.nodes.map((n)=>n.getString()),this.model],t)}};wd.register(tPr);var nPr=class e extends wd{static spiceTokenKeys=["C"];type="capacitor";capacitance;initialCondition;constructor(t){super(t);this.capacitance=Qu(t.capacitance),this.initialCondition=t.ic===void 0?void 0:Qu(t.ic)}static fromSpiceTokens(t){let n=ec.from(t);return new e({name:n.head(),nodes:[n.arg(0)??"",n.arg(1)??""],capacitance:n.arg(2)??"",ic:n.paramAfter(3,"ic"),params:n.paramsAfterExcept(3,["ic"]),originalSource:n.originalSource})}toSource(t){return this.formatParts([this.name,...this.nodes.map((n)=>n.getString()),this.capacitance.getString(),this.initialCondition===void 0?void 0:`IC=${this.initialCondition.getString()}`],t)}};wd.register(nPr);var oPr=class e extends wd{static spiceTokenKeys=["F"];type="cccs";source;gain;constructor(t){super({...t,nodes:t.output});this.source=t.source,this.gain=Qu(t.gain)}static fromSpiceTokens(t){let n=ec.from(t);return new e({name:n.head(),output:[n.arg(0)??"",n.arg(1)??""],source:n.arg(2)??"",gain:n.arg(3)??"",originalSource:n.originalSource})}toSource(t){return this.formatParts([this.name,...this.nodes.map((n)=>n.getString()),this.source,this.gain.getString()],t)}};wd.register(oPr);var rPr=class e extends wd{static spiceTokenKeys=["H"];type="ccvs";source;transresistance;constructor(t){super({...t,nodes:t.output});this.source=t.source,this.transresistance=Qu(t.transresistance)}static fromSpiceTokens(t){let n=ec.from(t);return new e({name:n.head(),output:[n.arg(0)??"",n.arg(1)??""],source:n.arg(2)??"",transresistance:n.arg(3)??"",originalSource:n.originalSource})}toSource(t){return this.formatParts([this.name,...this.nodes.map((n)=>n.getString()),this.source,this.transresistance.getString()],t)}};wd.register(rPr);function Thn(e){let t={},n=e.argAfterKeyword("dc"),o=e.keywordIndex("ac");if(n!==void 0)t.dc=n;else if(o===-1)t.dc=e.arg(2);if(o!==-1)t.ac={magnitude:e.arg(o+1),phase:e.arg(o+2)};return t}var Y6e=class extends wd{dc;ac;transient;constructor(e){super(e);this.dc=e.dc===void 0?void 0:Qu(e.dc),this.ac=e.ac===void 0?void 0:VSr(e.ac),this.transient=e.transient}getChildren(){return this.transient===void 0?[]:[this.transient]}sourceParts(){let e=[this.name,...this.nodes.map((t)=>t.getString())];if(this.dc!==void 0)e.push("DC",this.dc.getString());if(this.ac!==void 0){if(e.push("AC"),this.ac.magnitude!==void 0)e.push(this.ac.magnitude.getString());if(this.ac.phase!==void 0)e.push(this.ac.phase.getString())}if(this.transient!==void 0)e.push(this.transient.toSource());return e}},iPr=class e extends Y6e{static spiceTokenKeys=["I"];type="current_source";static fromSpiceTokens(t){let n=ec.from(t),o=Thn(n);return new e({name:n.head(),nodes:[n.arg(0)??"",n.arg(1)??""],dc:o.dc,ac:o.ac,originalSource:n.originalSource})}toSource(t){return this.formatParts(this.sourceParts(),t)}};Y6e.register(iPr);var sPr=class e extends wd{static spiceTokenKeys=["D"];type="diode";model;constructor(t){super(t);this.model=t.model}static fromSpiceTokens(t){let n=ec.from(t);return new e({name:n.head(),nodes:[n.arg(0)??"",n.arg(1)??""],model:n.arg(2)??"",params:n.paramsAfter(3),originalSource:n.originalSource})}toSource(t){return this.formatParts([this.name,...this.nodes.map((n)=>n.getString()),this.model],t)}};wd.register(sPr);var aPr=class e extends wd{static spiceTokenKeys=["L"];type="inductor";inductance;initialCondition;constructor(t){super(t);this.inductance=Qu(t.inductance),this.initialCondition=t.ic===void 0?void 0:Qu(t.ic)}static fromSpiceTokens(t){let n=ec.from(t);return new e({name:n.head(),nodes:[n.arg(0)??"",n.arg(1)??""],inductance:n.arg(2)??"",ic:n.paramAfter(3,"ic"),params:n.paramsAfterExcept(3,["ic"]),originalSource:n.originalSource})}toSource(t){return this.formatParts([this.name,...this.nodes.map((n)=>n.getString()),this.inductance.getString(),this.initialCondition===void 0?void 0:`IC=${this.initialCondition.getString()}`],t)}};wd.register(aPr);var cPr=class e extends wd{static spiceTokenKeys=["M"];type="mosfet";model;constructor(t){super(t);this.model=t.model}static fromSpiceTokens(t){let n=ec.from(t);return new e({name:n.head(),nodes:[n.arg(0)??"",n.arg(1)??"",n.arg(2)??"",n.arg(3)??""],model:n.arg(4)??"",params:n.paramsAfter(5),originalSource:n.originalSource})}toSource(t){return this.formatParts([this.name,...this.nodes.map((n)=>n.getString()),this.model],t)}};wd.register(cPr);var lPr=new Set(["VALUE","TABLE","LAPLACE","FREQ","CHEBYSHEV"]);function Dhn(e){return e!==void 0&&lPr.has(e.toUpperCase())}function Nhn(e,t,n){let o=e?.dialect??"generic";if(o==="pspice"||o==="ngspice"&&(t==="VALUE"||t==="TABLE"))return;phe(e,n)}var hPr=class e extends wd{type="pspice_abm_voltage_source";form;args;constructor(t){super({...t,nodes:t.output});this.form=t.form,this.args=t.args}static fromTokenCard(t){return new e({name:t.head(),output:[t.arg(0)??"",t.arg(1)??""],form:t.arg(2)?.toUpperCase(),args:t.argsAfter(3),originalSource:t.originalSource})}toSource(t){return Nhn(t,this.form,`${this.form} behavioral voltage source`),this.formatParts([this.name,...this.nodes.map((n)=>n.getString()),this.form,...this.args],t)}},dPr=class e extends wd{type="pspice_abm_current_source";form;args;constructor(t){super({...t,nodes:t.output});this.form=t.form,this.args=t.args}static fromTokenCard(t){return new e({name:t.head(),output:[t.arg(0)??"",t.arg(1)??""],form:t.arg(2)?.toUpperCase(),args:t.argsAfter(3),originalSource:t.originalSource})}toSource(t){return Nhn(t,this.form,`${this.form} behavioral current source`),this.formatParts([this.name,...this.nodes.map((n)=>n.getString()),this.form,...this.args],t)}};function uPr(e){return hPr.fromTokenCard(ec.from(e))}function pPr(e){return dPr.fromTokenCard(ec.from(e))}var mPr=class e extends wd{static spiceTokenKeys=["R"];type="resistor";resistance;constructor(t){super({...t,nodes:t.nodes.filter((n)=>n!==void 0)});this.resistance=Qu(t.resistance)}static fromSpiceTokens(t){let n=ec.from(t);return new e({name:n.head(),nodes:[n.arg(0)??"",n.arg(1)??""],resistance:n.arg(2)??"",params:n.paramsAfter(3),originalSource:n.originalSource})}toSource(t){return this.formatParts([this.name,...this.nodes.map((n)=>n.getString()),this.resistance.getString()],t)}};wd.register(mPr);var _Pr=class e extends wd{static spiceTokenKeys=["X"];type="subckt_instance";subckt;constructor(t){super(t);this.subckt=t.subckt}static fromSpiceTokens(t){let n=ec.from(t);return new e({name:n.head(),nodes:n.argsUntilLast(),subckt:n.lastArg()??"",originalSource:n.originalSource})}toSource(t){return this.formatParts([this.name,...this.nodes.map((n)=>n.getString()),this.subckt],t)}};wd.register(_Pr);var gPr=class e extends wd{static spiceTokenKeys=["__unknown_element__"];type="unknown_element";designator;tokens;constructor(t){super(t);this.designator=t.designator,this.tokens=t.tokens}static fromSpiceTokens(t){let n=ec.from(t),o=n.head();return new e({name:o,designator:n.headDesignator(),tokens:n.args(),originalSource:n.originalSource})}toSource(t){return this.formatParts([this.name,...this.tokens],t)}};wd.register(gPr);var APr=class e extends wd{static spiceTokenKeys=["G"];type="vccs";transconductance;constructor(t){super({...t,nodes:[...t.output,...t.control]});this.transconductance=Qu(t.transconductance)}static fromSpiceTokens(t){let n=ec.from(t);if(Dhn(n.arg(2)))return pPr(t);return new e({name:n.head(),output:[n.arg(0)??"",n.arg(1)??""],control:[n.arg(2)??"",n.arg(3)??""],transconductance:n.arg(4)??"",originalSource:n.originalSource})}toSource(t){return this.formatParts([this.name,...this.nodes.map((n)=>n.getString()),this.transconductance.getString()],t)}};wd.register(APr);var fPr=class e extends wd{static spiceTokenKeys=["E"];type="vcvs";gain;constructor(t){super({...t,nodes:[...t.output,...t.control]});this.gain=Qu(t.gain)}static fromSpiceTokens(t){let n=ec.from(t);if(Dhn(n.arg(2)))return uPr(t);return new e({name:n.head(),output:[n.arg(0)??"",n.arg(1)??""],control:[n.arg(2)??"",n.arg(3)??""],gain:n.arg(4)??"",originalSource:n.originalSource})}toSource(t){return this.formatParts([this.name,...this.nodes.map((n)=>n.getString()),this.gain.getString()],t)}};wd.register(fPr);var yPr=class e extends Y6e{static spiceTokenKeys=["V"];type="voltage_source";static fromSpiceTokens(t){let n=ec.from(t),o=Thn(n);return new e({name:n.head(),nodes:[n.arg(0)??"",n.arg(1)??""],dc:o.dc,ac:o.ac,originalSource:n.originalSource})}toSource(t){return this.formatParts(this.sourceParts(),t)}};Y6e.register(yPr);var xPr=class extends Oet{type="netlist";title;cards;end;dialect;trailingNewline;lineEnding;constructor(e={}){super();this.title=e.title,this.cards=e.cards??[],this.end=e.end instanceof uhe?e.end:e.end===!1?void 0:new uhe,this.dialect=e.dialect??"generic",this.trailingNewline=e.trailingNewline??!0,this.lineEnding=e.lineEnding??`
`}get elements(){return this.cards.filter((e)=>e.cardKind==="element")}get directives(){return this.cards.filter((e)=>e.cardKind==="directive")}get subckts(){return this.cards.filter((e)=>e instanceof Bhn)}get models(){return this.cards.filter((e)=>e instanceof whn)}get analyses(){return this.cards.filter((e)=>e instanceof QB)}add(e){this.cards.push(e)}addAll(e){this.cards.push(...e)}findElement(e){return this.elements.find((t)=>t.name.toLowerCase()===e.toLowerCase())}findModel(e){return this.models.find((t)=>t.name.toLowerCase()===e.toLowerCase())}findSubckt(e){return this.subckts.find((t)=>t.name.toLowerCase()===e.toLowerCase())}renameNode(e,t){for(let n of this.elements)n.renameNode(e,t);for(let n of this.subckts)for(let o of n.cards)if(o instanceof wd)o.renameNode(e,t)}getChildren(){return[...this.cards,...this.end===void 0?[]:[this.end]]}getString(e={}){return this.toSource(e)}toSource(e={}){let t=e.end??"auto",o=[this.title,...this.cards.map((r)=>r.toSource(e)),t==="never"?void 0:t==="always"?(this.end??new uhe).toSource(e):this.end?.toSource(e)].filter((r)=>r!==void 0).join(this.lineEnding);return this.trailingNewline?`${o}${this.lineEnding}`:o}},CPr=class e extends Shn{static spiceTokenKeys=["blank"];type="blank";cardKind="blank";originalSource;constructor(t={}){super();this.originalSource=t.originalSource}static fromSpiceTokens(t){return new e({originalSource:ec.from(t).originalSource})}getChildren(){return[]}toSource(){return this.originalSource??""}};RB.register(CPr);var bPr=class e extends Shn{static spiceTokenKeys=["comment"];type="comment";cardKind="comment";text;marker;originalSource;constructor(t,n={}){super();this.text=t,this.marker=n.marker??"*",this.originalSource=n.originalSource}static fromSpiceTokens(t){let n=ec.from(t),[o]=n.tokens;if(o?.type==="comment")return new e(o.value,{marker:o.marker,originalSource:n.originalSource});return new e(n.originalSource,{originalSource:n.originalSource})}getChildren(){return[]}toSource(t){if(t?.format!=="pretty"&&this.originalSource!==void 0)return this.originalSource;return`${this.marker} ${this.text}`.trimEnd()}};RB.register(bPr);var IPr=class e extends RB{static spiceTokenKeys=["raw","error","number","operator","punctuation"];type="raw_card";cardKind="raw";source;constructor(t){super({originalSource:t});this.source=t}static fromSpiceTokens(t){return new e(ec.from(t).originalSource)}getChildren(){return[]}toSource(){return this.source}};RB.register(IPr);var vPr=/^[+-]?(?:(?:\d+(?:\.\d*)?)|(?:\.\d+))(?:[eE][+-]?\d+)?([a-zA-Z]+)?$/,Ihn=new Set(["=","+","-","*","/","^"]),vhn=new Set(["(",")",",",":"]),SPr={f:0.000000000000001,p:0.000000000001,n:0.000000001,u:0.000001,m:0.001,k:1000,meg:1e6,g:1e9,t:1000000000000};function PPr(e,t={}){let n=t.preserveWhitespace??!1,o=t.preserveComments??!0,r=t.normalizeNumbers??!0,i=[],s=[],a=0,c=1,l=1,h=!0,d=()=>({offset:a,line:c,column:l}),u=(x)=>({start:x,end:d()}),_=(x)=>{for(let C=0;C<x.length;C+=1){let b=x[C];if(a+=1,b===`
`)c+=1,l=1,h=!0;else l+=1}},p=(x)=>{if(x.type==="whitespace"&&!n)return;if(x.type==="comment"&&!o)return;i.push(x)},m=(x)=>x!==void 0&&x>="0"&&x<="9",A=(x)=>{let C=e[x],b=e[x+1];if(m(C))return!0;if(C==="."&&m(b))return!0;if((C==="+"||C==="-")&&!g())return!1;if((C==="+"||C==="-")&&m(b))return!0;return(C==="+"||C==="-")&&b==="."&&m(e[x+2])},g=()=>{let x=i.at(-1);return x===void 0||x.type==="whitespace"||x.type==="newline"||x.type==="continuation"||x.type==="operator"||x.type==="punctuation"},f=()=>{let x="";if(e[a]==="+"||e[a]==="-")x+=e[a],_(e[a]);while(m(e[a]))x+=e[a],_(e[a]);if(e[a]==="."){x+=e[a],_(e[a]);while(m(e[a]))x+=e[a],_(e[a])}if(e[a]==="e"||e[a]==="E"){if(x+=e[a],_(e[a]),e[a]==="+"||e[a]==="-")x+=e[a],_(e[a]);while(m(e[a]))x+=e[a],_(e[a])}while(e[a]!==void 0&&e[a]>="a"&&e[a]<="z"||e[a]!==void 0&&e[a]>="A"&&e[a]<="Z")x+=e[a],_(e[a]);return x},y=(x,C)=>{let b=x.match(vPr);if(!b)return!1;let I=b[1],v=I?.toLowerCase(),P=I===void 0?x:x.slice(0,-I.length),M=Number(P),B=r&&!Number.isNaN(M)?M*(v===void 0?1:SPr[v]??1):null;return p({type:"number",raw:x,value:B,unitSuffix:I,range:C}),!0};while(a<e.length){let x=d(),C=e[a],b=e[a+1];if(C==="\r"||C===`
`){let P=C==="\r"&&b===`
`?`\r
`:C;_(P),p({type:"newline",raw:P,range:u(x)});continue}if(C===" "||C==="\t"){let P="";while(e[a]===" "||e[a]==="\t")P+=e[a],_(e[a]);p({type:"whitespace",raw:P,range:u(x)});continue}if(h&&C==="+"){_(C),h=!1,p({type:"continuation",raw:C,range:u(x)});continue}if(h&&C==="*"||C===";"||C==="$"){let P=C,M="";while(a<e.length&&e[a]!==`
`&&e[a]!=="\r")M+=e[a],_(e[a]);h=!1,p({type:"comment",marker:P,raw:M,value:M.slice(1).trimStart(),range:u(x)});continue}if(C==="#"){let P="";while(a<e.length&&e[a]!==`
`&&e[a]!=="\r")P+=e[a],_(e[a]);let M=u(x),B={message:"Unsupported preprocessor-style line",raw:P,range:M};s.push(B),h=!1,p({type:"error",raw:P,message:B.message,range:M});continue}if(C==='"'||C==="'"){let P=C,M="",B="";_(C),M+=C;while(a<e.length&&e[a]!==P){if(e[a]===`
`||e[a]==="\r")break;B+=e[a],M+=e[a],_(e[a])}if(e[a]===P)M+=P,_(P),p({type:"string",quote:P,raw:M,value:B,range:u(x)});else{let T=u(x),N={message:"Unterminated string",raw:M,range:T};s.push(N),p({type:"error",raw:M,message:N.message,range:T})}h=!1;continue}if(A(a)){let P=f();if(h=!1,y(P,u(x)))continue}if(Ihn.has(C)){_(C),h=!1,p({type:"operator",raw:C,value:C,range:u(x)});continue}if(vhn.has(C)){_(C),h=!1,p({type:"punctuation",raw:C,value:C,range:u(x)});continue}let I="";while(a<e.length&&![" ","\t","\r",`
`,'"',"'",";","$"].includes(e[a])&&!Ihn.has(e[a])&&!vhn.has(e[a]))I+=e[a],_(e[a]);if(I.length===0){_(C);let P=u(x),M={message:`Unexpected character "${C}"`,raw:C,range:P};s.push(M),p({type:"error",raw:C,message:M.message,range:P});continue}h=!1;let v=u(x);if(I.startsWith(".")){p({type:"directive",raw:I,value:I.slice(1).toLowerCase(),range:v});continue}if(y(I,v))continue;p({type:"identifier",raw:I,value:I,range:v})}return{tokens:i,errors:s,source:{text:e,lineCount:c}}}function Rhn(e,t={}){let n=BPr(e),o=MPr(e),r=o[0],i=r!==void 0&&wPr(r)?r.originalSource:void 0,s=i===void 0?o:o.slice(1),a=EPr(s,t),c=a.findIndex((h)=>h instanceof uhe),l=c===-1?void 0:a.splice(c,1)[0];return new xPr({title:i,cards:a,end:l??!1,dialect:t.dialect,trailingNewline:n.trailingNewline,lineEnding:n.lineEnding})}function EPr(e,t){return e.map((n)=>RB.parseSpiceTokens(n))}function MPr(e){let t=PPr(e,{preserveWhitespace:!0,preserveComments:!0,normalizeNumbers:!0});return OSr(zSr(t.tokens))}function wPr(e){let t=Vet(e.tokens),[n]=t;if(n===void 0)return!1;if(n.type==="directive"||n.type==="comment")return!1;if(n.type!=="identifier")return!1;if(t.length===1)return!0;return RB.classes[n.raw[0]?.toLowerCase()??""]===void 0}function BPr(e){let t=e.includes(`\r
`)?`\r
`:e.includes("\r")?"\r":`
`;return{trailingNewline:t===`\r
`?e.endsWith(`\r
`):e.endsWith(t),lineEnding:t}}var TPr=(e)=>{let t=[];if(t.push(e.title),e.models.size>0)t.push(...Array.from(e.models.values()));for(let n of e.components)t.push(n.toSpiceString());if(e.optionStatements.length>0)t.push(...e.optionStatements);if(e.metadataComments.length>0)t.push(...e.metadataComments);for(let n of e.subcircuits)t.push(n.toSpiceString());if(e.printStatements.length>0)t.push(...e.printStatements);if(e.saveStatements.length>0)t.push(...e.saveStatements);if(e.controls.length>0)t.push(".control"),t.push(...e.controls),t.push(".endc");if(e.analysisCommand){let n=e.analysisCommand.trim().toLowerCase().split(/\s+/)[0];if(!t.some((r)=>r.trim().toLowerCase().split(/\s+/)[0]===n))t.push(e.analysisCommand)}return t.push(".END"),t.join(`
`)},DPr=class{title;components;nodes;controls;subcircuits;models;optionStatements;metadataComments;analysisCommand;printStatements;saveStatements;constructor(e="Circuit Netlist"){this.title=e,this.components=[],this.nodes=new Set,this.controls=[],this.subcircuits=[],this.models=new Map,this.optionStatements=[],this.metadataComments=[],this.analysisCommand=null,this.printStatements=[],this.saveStatements=[]}addComponent(e){this.components.push(e);for(let t of e.nodes)this.nodes.add(t)}addSubcircuit(e){if(this.subcircuits.find((t)=>t.name===e.name))return;this.subcircuits.push(e)}get tranCommand(){return this.analysisCommand?.trim().toLowerCase().startsWith(".tran")?this.analysisCommand:null}set tranCommand(e){this.analysisCommand=e}toSpiceString(){return TPr(this)}},sx=class{name;command;nodes;constructor(e,t,n){this.name=e,this.command=t,this.nodes=n}toSpiceString(){return this.command.toSpiceString()}},NPr=class{commandName="bjt";props;constructor(e){this.props=e}toSpiceString(){let{name:e,collector:t,base:n,emitter:o,substrate:r,model:i,area:s}=this.props,a=`Q${e} ${t} ${n} ${o}`;if(r)a+=` ${r}`;if(a+=` ${i}`,s)a+=` ${s}`;return a}},RPr=class{commandName="capacitor";props;constructor(e){this.props=e}toSpiceString(){let{name:e,positiveNode:t,negativeNode:n,modelName:o,value:r,initialCondition:i}=this.props,s=`C${e} ${t} ${n}`;if(o)s+=` ${o}`;if(s+=` ${r}`,i)s+=` IC=${i}`;return s}},Qhn=class{commandName="current_source";props;constructor(e){this.props=e}toSpiceString(){let{name:e,positiveNode:t,negativeNode:n,value:o,acMagnitude:r,acPhase:i}=this.props,s=`I${e} ${t} ${n}`;if(o)s+=` ${o}`;if(r){if(s+=` AC ${r}`,i)s+=` ${i}`}return s}},QPr=class{commandName="diode";props;constructor(e){this.props=e}toSpiceString(){let{name:e,positiveNode:t,negativeNode:n,model:o,area:r}=this.props,i=`D${e} ${t} ${n} ${o}`;if(r)i+=` ${r}`;return i}},kPr=class{commandName="inductor";props;constructor(e){this.props=e}toSpiceString(){let{name:e,positiveNode:t,negativeNode:n,model:o,value:r,initialCondition:i}=this.props,s=`L${e} ${t} ${n}`;if(o)s+=` ${o}`;if(s+=` ${r}`,i)s+=` IC=${i}`;return s}};var LPr=class{commandName="mosfet";props;constructor(e){this.props=e}toSpiceString(){let{name:e,drain:t,gate:n,source:o,substrate:r,model:i,length:s,width:a,drainArea:c,sourceArea:l,drainPerimeter:h,sourcePerimeter:d,drainResistance:u,sourceResistance:_}=this.props,p=`M${e} ${t} ${n} ${o} ${r} ${i}`;return Object.entries({L:s,W:a,AD:c,AS:l,PD:h,PS:d,NRD:u,NRS:_}).forEach(([A,g])=>{if(g)p+=` ${A}=${g}`}),p}},HPr=class{commandName="resistor";props;constructor(e){this.props=e}toSpiceString(){let{name:e,positiveNode:t,negativeNode:n,model:o,value:r}=this.props,i=`R${e} ${t} ${n}`;if(o)i+=` ${o}`;return i+=` ${r}`,i}},khn=class{commandName="subcircuit_call";props;constructor(e){this.props=e}toSpiceString(){let{name:e,nodes:t,subcircuitName:n}=this.props;return`X${e} ${t.join(" ")} ${n}`}};var FPr=class{commandName="voltage_controlled_switch";props;constructor(e){this.props=e}toSpiceString(){let{name:e,positiveNode:t,negativeNode:n,positiveControl:o,negativeControl:r,model:i}=this.props;return`S${e} ${t} ${n} ${o} ${r} ${i}`}},U6e=class{commandName="voltage_source";props;constructor(e){this.props=e}toSpiceString(){let{name:e,positiveNode:t,negativeNode:n,value:o,acMagnitude:r,acPhase:i}=this.props,s=`V${e} ${t} ${n}`;if(o)s+=` ${o}`;if(r){if(s+=` AC ${r}`,i)s+=` ${i}`}return s}};function zPr(e){if(e>=1e6)return`${e/1e6}MEG`;if(e>=1000)return`${e/1000}K`;return e.toString()}function OPr(e){if(e>=0.001)return`${e*1000}M`;if(e>=0.000001)return`${e*1e6}U`;if(e>=0.000000001)return`${e*1e9}N`;if(e>=0.000000000001)return`${e*1000000000000}P`;return e.toString()}function VPr(e){if(e>=1)return e.toString();if(e>=0.001)return`${e*1000}m`;if(e>=0.000001)return`${e*1e6}u`;if(e>=0.000000001)return`${e*1e9}n`;if(e>=0.000000000001)return`${e*1000000000000}p`;return e.toString()}function Lhn(e,t){if(!e)return t;let n=e.replace(/[^A-Za-z0-9_]/g,"_");if(!n)return t;if(/^[0-9]/.test(n))return`${t}_${n}`;return n}function YPr(e){if(!e)return"DC 0";let i=e.starts_closed??!1,s=e.closes_at??0,{opens_at:a,switching_frequency:c}=e,[l,h]=i?[5,0]:[0,5];if(c&&c>0){let d=1/c,u=a&&a>s?Math.min(a-s,d):0,_=u>0?u:Math.max(d/2,0.000000001);return`PULSE(${oh(l)} ${oh(h)} ${oh(s)} 1n 1n ${oh(_)} ${oh(d)})`}if(a!==void 0&&a>s){let d=Math.max(a-s,0.000000001),u=s+d*2;return`PULSE(${oh(l)} ${oh(h)} ${oh(s)} 1n 1n ${oh(d)} ${oh(u)})`}if(s>0){let d=s*2,u=Math.max(d/2,0.000000001);return`PULSE(${oh(l)} ${oh(h)} ${oh(s)} 1n 1n ${oh(u)} ${oh(d)})`}return`DC ${i?5:0}`}function oh(e){if(!Number.isFinite(e))return`${e}`;if(e===0)return"0";let t=Math.abs(e);if(t>=1000||t<=0.001)return Number(e.toExponential(6)).toString();return Number(e.toPrecision(6)).toString()}function rJ(e){if(!Number.isFinite(e))return`${e}`;if(e===0)return"0";let t=[["T",1000000000000],["G",1e9],["MEG",1e6],["k",1000],["m",0.001],["u",0.000001],["n",0.000000001],["p",0.000000000001]];for(let[n,o]of t){let r=e/o;if(Math.abs(r)>=0.999999&&Math.abs(r)<999.999999){let i=Number(r.toPrecision(6));if(Math.abs(i*o-e)<=Math.abs(e)*0.000000001)return`${i}${n}`}}return oh(e)}var GPr=0.000000000001,UPr=({component:e,nodes:t})=>{if("resistance"in e&&"name"in e){let n=e.resistance,o=new HPr({name:e.name,positiveNode:t[0]||"0",negativeNode:t[1]||"0",value:zPr(n===0?GPr:n)});return new sx(e.name,o,t)}return null},WPr=({netlist:e,component:t,nodes:n,simulationSwitchMap:o})=>{let r=Lhn(t.name??t.source_component_id,"SW"),i=n[0]||"0",s=n[1]||"0",a=`NCTRL_${r}`,c=`SW_${r}`,l=o.get(t.source_component_id),h=YPr(l),d=new FPr({name:r,positiveNode:i,negativeNode:s,positiveControl:a,negativeControl:"0",model:c});if(!e.models.has(c))e.models.set(c,`.MODEL ${c} SW(Ron=0.1 Roff=1e9 Vt=2.5 Vh=0.1)`);let u=`CTRL_${r}`,_=new U6e({name:u,positiveNode:a,negativeNode:"0",value:h}),p=new sx(u,_,[a,"0"]);return e.addComponent(p),new sx(r,d,[i,s,a,"0"])},XPr=({component:e,nodes:t})=>{if("capacitance"in e&&"name"in e){let n=new RPr({name:e.name,positiveNode:t[0]||"0",negativeNode:t[1]||"0",value:OPr(e.capacitance)});return new sx(e.name,n,t)}return null},jPr=(e,t)=>{let n=e.find((r)=>r.name?.toLowerCase()==="anode"||r.port_hints?.includes("anode")),o=e.find((r)=>r.name?.toLowerCase()==="cathode"||r.port_hints?.includes("cathode"));return{positiveNode:t.get(n?.source_port_id??"")||"0",negativeNode:t.get(o?.source_port_id??"")||"0"}},Hhn=({netlist:e,component:t,componentPorts:n,nodeMap:o,modelName:r,modelDefinition:i})=>{if("name"in t){let{positiveNode:s,negativeNode:a}=jPr(n,o),c=new QPr({name:t.name,positiveNode:s,negativeNode:a,model:r});return e.models.set(r,i),new sx(t.name,c,[s,a])}return null},KPr=({netlist:e,component:t,componentPorts:n,nodeMap:o})=>Hhn({netlist:e,component:t,componentPorts:n,nodeMap:o,modelName:"D",modelDefinition:".MODEL D D"}),$Pr=({netlist:e,component:t,componentPorts:n,nodeMap:o})=>Hhn({netlist:e,component:t,componentPorts:n,nodeMap:o,modelName:"LED",modelDefinition:".MODEL LED D(IS=1e-20 N=2 RS=10 CJO=2p EG=2.1 BV=5 IBV=10u)"}),qPr=({component:e,nodes:t})=>{if("inductance"in e&&"name"in e){let n=new kPr({name:e.name,positiveNode:t[0]||"0",negativeNode:t[1]||"0",value:VPr(e.inductance)});return new sx(e.name,n,t)}return null},JPr=({netlist:e,component:t,componentPorts:n,nodeMap:o})=>{if("name"in t){let r=n.find((A)=>A.name?.toLowerCase()==="drain"||A.port_hints?.includes("drain")),i=n.find((A)=>A.name?.toLowerCase()==="gate"||A.port_hints?.includes("gate")),s=n.find((A)=>A.name?.toLowerCase()==="source"||A.port_hints?.includes("source")),a=o.get(r?.source_port_id??"")||"0",c=o.get(i?.source_port_id??"")||"0",l=o.get(s?.source_port_id??"")||"0",h=l,d=t.channel_type??"n",u=t.mosfet_mode??"enhancement",_=`${d.toUpperCase()}MOS`,p=`${_}_${u.toUpperCase()}`;if(!e.models.has(p))if(u==="enhancement"){let A=d==="p"?-1:1;e.models.set(p,`.MODEL ${p} ${_} (VTO=${A} KP=0.1)`)}else e.models.set(p,`.MODEL ${p} ${_} (KP=0.1)`);let m=new LPr({name:t.name,drain:a,gate:c,source:l,substrate:h,model:p});return new sx(t.name,m,[a,c,l])}return null},ZPr=({netlist:e,component:t,componentPorts:n,nodeMap:o})=>{if("name"in t){let r=n.find((_)=>_.name?.toLowerCase()==="collector"||_.port_hints?.includes("collector")),i=n.find((_)=>_.name?.toLowerCase()==="base"||_.port_hints?.includes("base")),s=n.find((_)=>_.name?.toLowerCase()==="emitter"||_.port_hints?.includes("emitter"));if(!r||!i||!s)throw Error(`Transistor ${t.name} is missing required ports (collector, base, emitter)`);let a=o.get(r.source_port_id)||"0",c=o.get(i.source_port_id)||"0",l=o.get(s.source_port_id)||"0",h=t.transistor_type??"npn",d=h.toUpperCase();if(!e.models.has(d))e.models.set(d,`.MODEL ${d} ${h.toUpperCase()}`);let u=new NPr({name:t.name,collector:a,base:c,emitter:l,model:d});return new sx(t.name,u,[a,c,l])}return null},eEr=({netlist:e,simulationVoltageSources:t,nodeMap:n})=>{for(let o of t){if(o.type!=="simulation_voltage_source")continue;if(o.is_dc_source===!1){let r=o.terminal1_source_port_id??o.terminal1_source_net_id,i=o.terminal2_source_port_id??o.terminal2_source_net_id;if(r&&i){let s=n.get(r)||"0",a=n.get(i)||"0",c="";if(o.wave_shape==="sinewave"){let h=o.voltage??(o.peak_to_peak_voltage??0)/2,d=o.frequency??0,u=0,_=0,p=o.phase??0;if(d>0)c=`SIN(0 ${h} ${d} 0 0 ${p})`;else c=`DC ${o.voltage??0}`}else if(o.wave_shape==="square"){let h=o.voltage??o.peak_to_peak_voltage??0,d=o.frequency??0,u=d===0?1/0:1/d,_=o.period===void 0?u:o.period/1000,p=o.duty_cycle??0.5,m=_*p,A=o.pulse_delay!==void 0?o.pulse_delay/1000:0,g=o.rise_time!==void 0?rJ(o.rise_time/1000):"1n",f=o.fall_time!==void 0?rJ(o.fall_time/1000):"1n",y=o.pulse_width===void 0?rJ(m):rJ(o.pulse_width/1000),x=rJ(_);c=`PULSE(0 ${h} ${rJ(A)} ${g} ${f} ${y} ${x})`}else if(o.voltage!==void 0)c=`DC ${o.voltage}`;if(c||o.ac_magnitude!==void 0){let l=new U6e({name:o.simulation_voltage_source_id,positiveNode:s,negativeNode:a,value:c,acMagnitude:o.ac_magnitude===void 0?void 0:oh(o.ac_magnitude),acPhase:o.ac_phase===void 0?void 0:oh(o.ac_phase)}),h=new sx(o.simulation_voltage_source_id,l,[s,a]);e.addComponent(h)}}}else{let r="terminal1_source_port_id"in o&&typeof o.terminal1_source_port_id==="string"?o.terminal1_source_port_id:void 0,i="terminal2_source_port_id"in o&&typeof o.terminal2_source_port_id==="string"?o.terminal2_source_port_id:void 0,s=o.positive_source_port_id??o.positive_source_net_id??r,a=o.negative_source_port_id??o.negative_source_net_id??i;if(s&&a){let c=n.get(s)||"0",l=n.get(a)||"0",h=new U6e({name:o.simulation_voltage_source_id,positiveNode:c,negativeNode:l,value:`DC ${o.voltage}`,acMagnitude:o.ac_magnitude===void 0?void 0:oh(o.ac_magnitude),acPhase:o.ac_phase===void 0?void 0:oh(o.ac_phase)}),d=new sx(o.simulation_voltage_source_id,h,[c,l]);e.addComponent(d)}}}},tEr=({netlist:e,simulationCurrentSources:t,nodeMap:n})=>{for(let o of t){if(o.type!=="simulation_current_source")continue;if(o.is_dc_source===!1){let r=o.terminal1_source_port_id??o.terminal1_source_net_id,i=o.terminal2_source_port_id??o.terminal2_source_net_id;if(r&&i){let s=n.get(r)||"0",a=n.get(i)||"0",c="";if(o.wave_shape==="sinewave"){let h=(o.peak_to_peak_current??0)/2,d=o.frequency??0,u=0,_=0,p=o.phase??0;if(d>0)c=`SIN(0 ${h} ${d} 0 0 ${p})`;else c=`DC ${h}`}else if(o.wave_shape==="square"){let h=o.peak_to_peak_current??0,d=o.frequency??0,u=d===0?1/0:1/d,_=o.duty_cycle??0.5,p=u*_,m=0,A="1n",g="1n";c=`PULSE(0 ${h} 0 1n 1n ${p} ${u})`}if(c||o.ac_magnitude!==void 0){let l=new Qhn({name:o.simulation_current_source_id,positiveNode:s,negativeNode:a,value:c,acMagnitude:o.ac_magnitude===void 0?void 0:oh(o.ac_magnitude),acPhase:o.ac_phase===void 0?void 0:oh(o.ac_phase)}),h=new sx(o.simulation_current_source_id,l,[s,a]);e.addComponent(h)}}}else{let r="terminal1_source_port_id"in o&&typeof o.terminal1_source_port_id==="string"?o.terminal1_source_port_id:void 0,i="terminal2_source_port_id"in o&&typeof o.terminal2_source_port_id==="string"?o.terminal2_source_port_id:void 0,s=o.positive_source_port_id??o.positive_source_net_id??r,a=o.negative_source_port_id??o.negative_source_net_id??i;if(s&&a){let c=n.get(s)||"0",l=n.get(a)||"0",h=new Qhn({name:o.simulation_current_source_id,positiveNode:c,negativeNode:l,value:`DC ${o.current}`,acMagnitude:o.ac_magnitude===void 0?void 0:oh(o.ac_magnitude),acPhase:o.ac_phase===void 0?void 0:oh(o.ac_phase)}),d=new sx(o.simulation_current_source_id,h,[c,l]);e.addComponent(d)}}}},nEr=["method","reltol","abstol","vntol"],oEr=(e,t)=>e.find((o)=>o.connected_source_net_ids.includes(t))?.connected_source_port_ids[0],G6e=({sourcePortId:e,sourceNetId:t,sourceTraces:n,nodeMap:o})=>{if(e)return o.get(e);if(!t)return;let r=oEr(n,t);if(!r)return;return o.get(r)},rEr=(e)=>Lhn(`sense_${e.simulation_current_probe_id}`,"sense_current_probe"),iEr=(e)=>{switch(e){case"spice_transient_analysis":return"TRAN";case"spice_dc_operating_point":return"OP";case"spice_dc_sweep":return"DC";case"spice_ac_analysis":return"AC"}},sEr=(e)=>{switch(e){case"linear":return"lin";case"decade":return"dec";case"octave":return"oct"}},aEr=(e)=>{if(e.experiment_type==="spice_transient_analysis"){let{time_per_step:c,end_time_ms:l,start_time_ms:h}=e;if(c===void 0||l===void 0)return null;let d=(h??0)/1000;return new Ket({step:oh(c/1000),stop:oh(l/1000),...d>0?{start:oh(d)}:{},uic:!0})}if(e.experiment_type==="spice_dc_operating_point")return new Uet;if(e.experiment_type==="spice_dc_sweep"){let{dc_sweep_voltage_source_id:c,dc_sweep_current_source_id:l,dc_sweep_start:h,dc_sweep_stop:d,dc_sweep_step:u}=e;if(h===void 0||d===void 0||u===void 0)return null;let _;if(c!==void 0)_=`V${c}`;else if(l!==void 0)_=`I${l}`;else return null;return new Get({source:_,start:oh(h),stop:oh(d),step:oh(u)})}let{ac_sweep_type:t,ac_samples_per_interval:n,ac_sample_count:o,ac_start_frequency_hz:r,ac_stop_frequency_hz:i}=e;if(t===void 0||r===void 0||i===void 0)return null;let s=t==="linear"?o:n;if(s===void 0)return null;let a=sEr(t);return new Yet({sweep:a,points:s,start:oh(r),stop:oh(i)})},cEr=({netlist:e,simulationExperiment:t,simulationVoltageProbes:n,simulationCurrentProbes:o,sourceTraces:r,nodeMap:i})=>{let s=iEr(t.experiment_type),a=new Set,c=t.spice_options;if(c){let l={};for(let h of nEr){let d=c[h];if(d!==void 0)l[h]=d}if(Object.keys(l).length>0)e.optionStatements.push(new Wet(l).getString())}if(n.length>0){let l=[];for(let h of n){let d=G6e({sourcePortId:h.signal_input_source_port_id,sourceNetId:h.signal_input_source_net_id,sourceTraces:r,nodeMap:i});if(!d)continue;if(h.reference_input_source_port_id||h.reference_input_source_net_id){let _=G6e({sourcePortId:h.reference_input_source_port_id,sourceNetId:h.reference_input_source_net_id,sourceTraces:r,nodeMap:i});if(_&&_!=="0"){let p=`V(${d},${_})`;a.add(p),l.push({simulation_voltage_probe_id:h.simulation_voltage_probe_id,name:h.name,spice_vector:p,source_node_name:d,reference_node_name:_})}else if(d!=="0"){let p=`V(${d})`;a.add(p),l.push({simulation_voltage_probe_id:h.simulation_voltage_probe_id,name:h.name,spice_vector:p,source_node_name:d,reference_node_name:_})}}else if(d!=="0"){let _=`V(${d})`;a.add(_),l.push({simulation_voltage_probe_id:h.simulation_voltage_probe_id,name:h.name,spice_vector:_,source_node_name:d})}}if(l.length>0)for(let h of l)e.metadataComments.push(`* tscircuit_probe ${JSON.stringify(h)}`)}if(o.length>0){let l=new Set,h=[];for(let d of o){let u=G6e({sourcePortId:d.positive_source_port_id,sourceNetId:d.positive_source_net_id,sourceTraces:r,nodeMap:i}),_=G6e({sourcePortId:d.negative_source_port_id,sourceNetId:d.negative_source_net_id,sourceTraces:r,nodeMap:i});if(!u||!_)continue;let p=rEr(d),m=p,A=2;while(l.has(m))m=`${p}_${A++}`;l.add(m);let g=`V${m}`,f=`I(${g})`,y=new U6e({name:m,positiveNode:u,negativeNode:_,value:"DC 0"});e.addComponent(new sx(m,y,[u,_])),a.add(f),h.push({simulation_current_probe_id:d.simulation_current_probe_id,name:d.name,spice_vector:f,sense_voltage_source_name:g,positive_node_name:u,negative_node_name:_})}if(h.length>0)for(let d of h)e.metadataComments.push(`* tscircuit_current_probe ${JSON.stringify(d)}`)}if(a.size>0){let l=[...a].join(" "),h=new Xet({analysis:s,expressions:[l]});h.command=".PRINT",e.printStatements.push(h.getString());let d=new jet([l]);d.command=".SAVE",e.saveStatements.push(d.getString())}e.analysisCommand=aEr(t)?.getString()??null},_he="GENERIC_OPAMP",lEr=`
.SUBCKT ${_he} non_inverting_input inverting_input positive_supply negative_supply output
* Generic Op-Amp Model
E1 internal_output 0 non_inverting_input inverting_input 100k
Rin non_inverting_input inverting_input 10Meg
Rout internal_output output 75
D1 output positive_supply opamp_diode
D2 negative_supply output opamp_diode
.model opamp_diode D
.ENDS ${_he}
`.trim(),hEr=(e,t,n)=>{if(t.length===0)return;if(!e.models.has(_he))e.models.set(_he,lEr);for(let o of t){if(o.type!=="simulation_op_amp")continue;let r=n.get(o.non_inverting_input_source_port_id)??"0",i=n.get(o.inverting_input_source_port_id)??"0",s=n.get(o.output_source_port_id)??"0",a=n.get(o.positive_supply_source_port_id)??"0",c=n.get(o.negative_supply_source_port_id)??"0",l=[r,i,a,c,s],h=new khn({name:o.simulation_op_amp_id,nodes:l,subcircuitName:_he}),d=new sx(o.simulation_op_amp_id,h,l);e.addComponent(d)}};function dEr(e){let t=[];for(let s of e.split(/\r?\n/)){let a=s.trim();if(/^\+/.test(a)&&t.length>0){t[t.length-1]+=` ${a.slice(1).trim()}`;continue}t.push(a)}let n=t.find((s)=>/^\.subckt\s+/i.test(s));if(!n)return null;let o=n.split(/\s+/),r=o[1],i=o.slice(2);if(!r||i.length===0)return null;return{modelName:r,pinNames:i}}function uEr(e,t,n){if(t.length===0)return;for(let o of t){let r=dEr(o.subcircuit_source);if(!r)continue;let{modelName:i,pinNames:s}=r;if(!e.models.has(i))e.models.set(i,o.subcircuit_source);let a=s.map((l)=>{let h=o.spice_pin_to_source_port_map[l];return n.get(h)??"0"}),c=new khn({name:o.simulation_spice_subcircuit_id,nodes:a,subcircuitName:i});e.addComponent(new sx(o.simulation_spice_subcircuit_id,c,a))}}function Fhn(e){let t=new DPr("* Circuit JSON to SPICE Netlist"),n=Vo(e).source_component.list(),o=Vo(e).source_port.list(),r=Vo(e).source_trace.list(),i=e.filter((C)=>C.type==="simulation_voltage_probe"),s=e.filter((C)=>C.type==="simulation_current_probe"),a=e.filter((C)=>C.type==="simulation_switch").map((C)=>C),c=e.filter((C)=>C.type==="simulation_op_amp"),l=e.filter((C)=>C.type==="simulation_spice_subcircuit"),h=new Map;for(let C of a)if(C.source_component_id)h.set(C.source_component_id,C);let d=yhn(e),u=new Map,_=new Map,p=1,m=new Set;if(i.length>0){for(let C of i)if(C.name)m.add(C.name)}let A=[...m].map((C)=>/^N(\d+)$/i.exec(C)).filter((C)=>C!==null).map((C)=>parseInt(C[1],10));if(A.length>0)p=Math.max(...A)+1;let g=new Set,f=new Set(Vo(e).source_net.list().filter((C)=>C.name?.toLowerCase().includes("gnd")).map((C)=>C.source_net_id));if(f.size>0){for(let C of Vo(e).source_trace.list())if(C.connected_source_port_ids.length>0){if(C.connected_source_net_ids.some((I)=>f.has(I))){let I=C.connected_source_port_ids[0],v=d.getNetConnectedToId(I);if(v)g.add(v)}}}let y=o.filter((C)=>C.name?.toLowerCase()==="gnd");for(let C of y){let b=d.getNetConnectedToId(C.source_port_id);if(b)g.add(b)}for(let C of Vo(e).simulation_voltage_source.list()){let b=C.negative_source_port_id??C.terminal2_source_port_id;if(b){let I=d.getNetConnectedToId(b);if(I)g.add(I)}}for(let C of g)_.set(C,"0");if(i.length>0)for(let C of i){if(!C.name)continue;if(C.reference_input_source_port_id||C.reference_input_source_net_id)continue;let b,{signal_input_source_port_id:I,signal_input_source_net_id:v}=C;if(I)b=d.getNetConnectedToId(I);else if(v){let P=r.find((M)=>M.connected_source_net_ids.includes(v));if(P&&P.connected_source_port_ids.length>0){let M=P.connected_source_port_ids[0];b=d.getNetConnectedToId(M)}}if(b){if(!_.has(b))_.set(b,C.name)}else if(I&&C.name)u.set(I,C.name)}for(let C of o){let b=C.source_port_id,I=d.getNetConnectedToId(b);if(I){if(!_.has(I))_.set(I,`N${p++}`);u.set(b,_.get(I))}}for(let C of r){let b=C.connected_source_port_ids.map((I)=>u.get(I)).find((I)=>I!==void 0);if(!b)continue;for(let I of C.connected_source_net_ids)u.set(I,b)}for(let C of o){let b=C.source_port_id;if(!u.has(b))u.set(b,`N${p++}`)}for(let C of n){if(C.type!=="source_component")continue;let b=Vo(e).source_port.list({source_component_id:C.source_component_id}).sort((v,P)=>(v.pin_number??0)-(P.pin_number??0)),I=b.map((v)=>u.get(v.source_port_id)||"0");if("ftype"in C){let v=null;switch(C.ftype){case"simple_resistor":{v=UPr({component:C,nodes:I});break}case"simple_switch":{v=WPr({netlist:t,component:C,nodes:I,simulationSwitchMap:h});break}case"simple_capacitor":{v=XPr({component:C,nodes:I});break}case"simple_diode":{v=KPr({netlist:t,component:C,componentPorts:b,nodeMap:u});break}case"simple_led":{v=$Pr({netlist:t,component:C,componentPorts:b,nodeMap:u});break}case"simple_inductor":{v=qPr({component:C,nodes:I});break}case"simple_mosfet":{v=JPr({netlist:t,component:C,componentPorts:b,nodeMap:u});break}case"simple_transistor":{v=ZPr({netlist:t,component:C,componentPorts:b,nodeMap:u});break}}if(v)t.addComponent(v)}}eEr({netlist:t,simulationVoltageSources:Vo(e).simulation_voltage_source.list(),nodeMap:u}),tEr({netlist:t,simulationCurrentSources:Vo(e).simulation_current_source.list(),nodeMap:u}),hEr(t,c,u),uEr(t,l,u);let x=e.find((C)=>C.type==="simulation_experiment");if(x)cEr({netlist:t,simulationExperiment:x,simulationVoltageProbes:i,simulationCurrentProbes:s,sourceTraces:r,nodeMap:u});return t}yc();yc();bp();K0();K0();bp();K0();qt();er();var mst=at(j0(),1),MPn=at(ln(),1);yc();er();qt();qt();qt();$p();$p();qt();qt();bp();bp();bp();K0();qt();qt();function ghe(e,t){t=$et(t||{R:255,G:255,B:255}),e=$et(e);let n=e;if(e.A!==void 0)n={R:t.R+(e.R-t.R)*e.A,G:t.G+(e.G-t.G)*e.A,B:t.B+(e.B-t.B)*e.A};return mEr(pEr(n))}function pEr(e){let t=e.R/255,n=e.G/255,o=e.B/255;if(t>0.04045)t=Math.pow((t+0.055)/1.055,2.4);else t=t/12.92;if(n>0.04045)n=Math.pow((n+0.055)/1.055,2.4);else n=n/12.92;if(o>0.04045)o=Math.pow((o+0.055)/1.055,2.4);else o=o/12.92;t*=100,n*=100,o*=100;let r=t*0.4124+n*0.3576+o*0.1805,i=t*0.2126+n*0.7152+o*0.0722,s=t*0.0193+n*0.1192+o*0.9505;return{X:r,Y:i,Z:s}}function mEr(e){let r=e.Y/100,i=e.Z/108.883,s=e.X/95.047;if(s>0.008856)s=Math.pow(s,0.3333333333333333);else s=7.787*s+0.13793103448275862;if(r>0.008856)r=Math.pow(r,0.3333333333333333);else r=7.787*r+0.13793103448275862;if(i>0.008856)i=Math.pow(i,0.3333333333333333);else i=7.787*i+0.13793103448275862;let a=116*r-16,c=500*(s-r),l=200*(r-i);return{L:a,a:c,b:l}}function $et(e){let t,n,o,r;if("R"in e)t=e.R,n=e.G,o=e.B,r=e.A;else t=e.r,n=e.g,o=e.b,r=e.a;let i={R:t,G:n,B:o};if(r!==void 0)i.A=r;return i}function W6e(e,t,n){if("R"in e||"r"in e)e=ghe(e,n);if("R"in t||"r"in t)t=ghe(t,n);let o=e.L,r=e.a,i=e.b,s=t.L,a=t.a,c=t.b,l=1,h=1,d=1,u=Math.sqrt(Math.pow(r,2)+Math.pow(i,2)),_=Math.sqrt(Math.pow(a,2)+Math.pow(c,2)),p=(u+_)/2,m=0.5*(1-Math.sqrt(Math.pow(p,7)/(Math.pow(p,7)+Math.pow(25,7)))),A=(1+m)*r,g=(1+m)*a,f=Math.sqrt(Math.pow(A,2)+Math.pow(i,2)),y=Math.sqrt(Math.pow(g,2)+Math.pow(c,2)),x=zhn(i,A),C=zhn(c,g),b=s-o,I=y-f,v=gEr(u,_,x,C),P=2*Math.sqrt(f*y)*Math.sin(iJ(v)/2),M=(o+s)/2,B=(f+y)/2,T=AEr(u,_,x,C),N=1-0.17*Math.cos(iJ(T-30))+0.24*Math.cos(iJ(2*T))+0.32*Math.cos(iJ(3*T+6))-0.2*Math.cos(iJ(4*T-63)),D=30*Math.exp(-Math.pow((T-275)/25,2)),L=Math.sqrt(Math.pow(B,7)/(Math.pow(B,7)+Math.pow(25,7))),H=1+0.015*Math.pow(M-50,2)/Math.sqrt(20+Math.pow(M-50,2)),V=1+0.045*B,O=1+0.015*B*N,U=-2*L*Math.sin(iJ(2*D));return Math.sqrt(Math.pow(b/(H*l),2)+Math.pow(I/(V*h),2)+Math.pow(P/(O*d),2)+U*(I/(V*h))*(P/(O*d)))}function _Er(e){return e*(180/Math.PI)}function iJ(e){return e*(Math.PI/180)}function zhn(e,t){if(e===0&&t===0)return 0;else{let n=_Er(Math.atan2(e,t));if(n>=0)return n;else return n+360}}function gEr(e,t,n,o){if(e*t===0)return 0;else if(Math.abs(o-n)<=180)return o-n;else if(o-n>180)return o-n-360;else if(o-n<-180)return o-n+360;else throw Error()}function AEr(e,t,n,o){if(e*t===0)return n+o;else if(Math.abs(n-o)<=180)return(n+o)/2;else if(Math.abs(n-o)>180&&n+o<360)return(n+o+360)/2;else if(Math.abs(n-o)>180&&n+o>=360)return(n+o-360)/2;else throw Error()}function qet(e){return ghe(e)}var yEr=2.3,Ohn={R:255,G:0,B:255},kB=({color1:e,color2:t})=>e.R===t.R&&e.G===t.G&&e.B===t.B,X6e=(e)=>{try{let t=$vt(e);if(t.depth!==8)return null;let{channels:n,data:o}=t,r=new Uint8Array(t.width*t.height*4);if(n===4)r.set(o);else if(n===3)for(let i=0,s=0;i<o.length;i+=3,s+=4)r[s]=o[i],r[s+1]=o[i+1],r[s+2]=o[i+2],r[s+3]=255;else return null;return{width:t.width,height:t.height,data:r,getPixel:(i,s)=>{let a=(s*t.width+i)*4;return{R:r[a],G:r[a+1],B:r[a+2]}}}}catch{return null}},j6e=async(e)=>{if(e instanceof Uint8Array)return e;return new Uint8Array(e)},xEr=(e,t)=>{if(e.byteLength!==t.byteLength)return!1;for(let n=0;n<e.byteLength;n+=1)if(e[n]!==t[n])return!1;return!0},CEr=(e)=>{if(!e)return Ohn;let t=/^#?([0-9a-fA-F]{6})$/.exec(e.trim());if(!t)return Ohn;let n=t[1];return{R:Number.parseInt(n.slice(0,2),16),G:Number.parseInt(n.slice(2,4),16),B:Number.parseInt(n.slice(4,6),16)}},bEr=(e)=>{let t=e*6.2,n=e*0.695,o=null,r=null,i=null,s=null;return(a)=>{if(kB(a))return!0;let c=null,l=null;if(o&&kB({color1:a.color1,color2:o}))c=i;else if(r&&kB({color1:a.color1,color2:r}))c=s;if(o&&kB({color1:a.color2,color2:o}))l=i;else if(r&&kB({color1:a.color2,color2:r}))l=s;if(!c)c=qet(a.color1),o=a.color1,i=c;if(!l)l=qet(a.color2),r=a.color2,s=l;let h=Math.sqrt((c.L-l.L)*(c.L-l.L)+(c.a-l.a)*(c.a-l.a)+(c.b-l.b)*(c.b-l.b));if(h>=t)return!1;if(h<=n)return!0;return W6e(c,l)<e}},IEr=class{_baseComparator;_img1;_img2;_brightnessTolerance;constructor(e,t,n,{antialiasingTolerance:o=0}){this._baseComparator=e,this._img1=t,this._img2=n,this._brightnessTolerance=o}compare(e){return this._baseComparator(e)||this._checkIsAntialiased(e)}_checkIsAntialiased(e){return this._isAntialiased(this._img2,e.x,e.y,e,this._img1)||this._isAntialiased(this._img1,e.x,e.y,e,this._img2)}_isAntialiased(e,t,n,o,r){let i=e.getPixel(t,n),s=Math.max(t-1,0),a=Math.max(n-1,0),c=Math.min(t+1,o.width-1),l=Math.min(n+1,o.height-1),h=!r,d=h?this._brightnessTolerance:0,u=0,_=0,p=0,m=0,A=0,g=0,f=0,y=0,x=0;for(let C=a;C<=l;C+=1)for(let b=s;b<=c;b+=1){if(b===t&&C===n)continue;let I=this._brightnessDelta(e.getPixel(b,C),i);if(Math.abs(I)<=d)u+=1;else if(I>d)_+=1;else p+=1;if(u>2)return!1;if(h)continue;if(I<m)m=I,g=b,f=C;if(I>A)A=I,y=b,x=C}if(h)return!0;if(p===0||_===0)return!1;return!this._isAntialiased(e,g,f,o)&&!this._isAntialiased(r,g,f,o)||!this._isAntialiased(e,y,x,o)&&!this._isAntialiased(r,y,x,o)}_brightnessDelta(e,t){return e.R*0.29889531+e.G*0.58662247+e.B*0.11448223-(t.R*0.29889531+t.G*0.58662247+t.B*0.11448223)}},vEr=class{pixelRatio;caretTopLeft=null;caretBottomRight=null;_baseComparator;_state="init";constructor(e,t){this.pixelRatio=t?Math.floor(t):1,this._baseComparator=e}compare(e){return this._baseComparator(e)||this._checkIsCaret(e)}_checkIsCaret(e){if(this._state==="caretDetected")return this.caretTopLeft!==null&&this.caretBottomRight!==null&&e.x>=this.caretTopLeft.x&&e.x<=this.caretBottomRight.x&&e.y>=this.caretTopLeft.y&&e.y<=this.caretBottomRight.y;if(this.caretTopLeft&&this.caretBottomRight&&e.x>=this.caretTopLeft.x&&e.x<=this.caretBottomRight.x&&e.y>=this.caretTopLeft.y&&e.y<=this.caretBottomRight.y)return!0;let t=this._getLastCaretPoint(e);if(!this._looksLikeCaret({x:e.x,y:e.y},t))return!1;return this.caretTopLeft={x:e.x,y:e.y},this.caretBottomRight=t,this._state="caretDetected",!0}_getLastCaretPoint(e){let t={x:e.x,y:e.y};while(!0){let n=this._getNextCaretPoint({x:e.x,y:e.y},t);if(this._isPointOutsideImages(n,e)||this._areColorsSame(n,e))return t;t=n}}_isPointOutsideImages(e,t){return e.x>=t.minWidth||e.y>=t.minHeight}_areColorsSame(e,t){let n=t.img1.getPixel(e.x,e.y),o=t.img2.getPixel(e.x,e.y);return kB({color1:n,color2:o})}_getNextCaretPoint(e,t){let n=t.x+1;return n<e.x+this.pixelRatio?{x:n,y:t.y}:{x:e.x,y:t.y+1}}_looksLikeCaret(e,t){return this._caretHeight(e,t)>1&&this._caretWidth(e,t)===this.pixelRatio}_caretHeight(e,t){return t.y-e.y+1}_caretWidth(e,t){return t.x-e.x+1}},Vhn=(e={})=>{if(e.strict&&e.tolerance!==void 0)throw TypeError('Unable to use "strict" and "tolerance" options together');if(e.percentThreshold!==void 0&&(!Number.isFinite(e.percentThreshold)||e.percentThreshold<0))throw TypeError('Expected "percentThreshold" to be a non-negative number');return{strict:Boolean(e.strict),tolerance:e.tolerance??yEr,ignoreCaret:e.ignoreCaret??!0,ignoreAntialiasing:e.ignoreAntialiasing??!0,antialiasingTolerance:e.antialiasingTolerance??0,pixelRatio:e.pixelRatio}},Yhn=(e,t,n)=>{let o=n.strict?(r)=>kB(r):bEr(n.tolerance);if(n.ignoreAntialiasing){let r=new IEr(o,e,t,n);o=(i)=>r.compare(i)}if(n.ignoreCaret){let r=new vEr(o,n.pixelRatio);o=(i)=>r.compare(i)}return o},SEr=async(e,t,n)=>{let o=X6e(e),r=X6e(t);if(!o||!r)return{equal:xEr(e,t)};let i=Yhn(o,r,n),s=Math.max(o.width,r.width),a=Math.max(o.height,r.height),c=Math.min(o.width,r.width),l=Math.min(o.height,r.height),h=s*a,d=0;for(let u=0;u<a;u+=1)for(let _=0;_<s;_+=1){if(_>=c||u>=l){d+=1;continue}let p=o.getPixel(_,u),m=r.getPixel(_,u);if(!(kB({color1:p,color2:m})||i({color1:p,color2:m,img1:o,img2:r,x:_,y:u,width:s,height:a,minWidth:c,minHeight:l})))d+=1}return{equal:d===0,differentPixels:d,totalPixels:h}},PEr=async(e,t,n={})=>{let o=Vhn(n),r=await j6e(e),i=await j6e(t);return SEr(r,i,o)},EEr=async({reference:e,current:t,highlightColor:n,...o})=>{let r=Vhn(o),i=await j6e(e),s=await j6e(t),a=X6e(i),c=X6e(s);if(!(a&&c))return s;let l=Yhn(a,c,r),h=Math.max(a.width,c.width),d=Math.max(a.height,c.height),u=Math.min(a.width,c.width),_=Math.min(a.height,c.height),p=CEr(n),m=new Uint8Array(h*d*4);for(let g=0;g<d;g+=1)for(let f=0;f<h;f+=1){let y=(g*h+f)*4;if(f>=u||g>=_){m[y]=p.R,m[y+1]=p.G,m[y+2]=p.B,m[y+3]=255;continue}let x=a.getPixel(f,g),C=c.getPixel(f,g);if(kB({color1:x,color2:C})||l({color1:x,color2:C,img1:a,img2:c,x:f,y:g,width:h,height:d,minWidth:u,minHeight:_}))m[y]=x.R,m[y+1]=x.G,m[y+2]=x.B,m[y+3]=255;else m[y]=p.R,m[y+1]=p.G,m[y+2]=p.B,m[y+3]=255}return DHe({width:h,height:d,data:m,channels:4,depth:8})},aWs=Object.assign(PEr,{createDiff:EEr});$p();function Jet(e,t){return Array.isArray(t)?[e.a*t[0]+e.c*t[1]+e.e,e.b*t[0]+e.d*t[1]+e.f]:{x:e.a*t.x+e.c*t.y+e.e,y:e.b*t.x+e.d*t.y+e.f}}var{cos:PWs,sin:EWs,PI:MWs}=Math;var{tan:QWs}=Math;function wEr(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n}function K6e(e,t,n,o){var r=Error.call(this,e);if(Object.setPrototypeOf)Object.setPrototypeOf(r,K6e.prototype);return r.expected=t,r.found=n,r.location=o,r.name="SyntaxError",r}wEr(K6e,Error);function ett(e,t,n){if(n=n||" ",e.length>t)return e;return t-=e.length,n+=n.repeat(t),e+n.slice(0,t)}K6e.prototype.format=function(e){var t="Error: "+this.message;if(this.location){var n=null,o;for(o=0;o<e.length;o++)if(e[o].source===this.location.source){n=e[o].text.split(/\r\n|\n|\r/g);break}var r=this.location.start,i=this.location.source&&typeof this.location.source.offset==="function"?this.location.source.offset(r):r,s=this.location.source+":"+i.line+":"+i.column;if(n){var a=this.location.end,c=ett("",i.line.toString().length," "),l=n[r.line-1],h=r.line===a.line?a.column:l.length+1,d=h-r.column||1;t+=`
 --> `+s+`
`+c+` |
`+i.line+" | "+l+`
`+c+" | "+ett("",r.column-1," ")+ett("",d,"^")}else t+=`
 at `+s}return t};K6e.buildMessage=function(e,t){var n={literal:function(l){return'"'+r(l.text)+'"'},class:function(l){var h=l.parts.map(function(d){return Array.isArray(d)?i(d[0])+"-"+i(d[1]):i(d)});return"["+(l.inverted?"^":"")+h.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(l){return l.description}};function o(l){return l.charCodeAt(0).toString(16).toUpperCase()}function r(l){return l.replace(/\\/g,"\\\\").replace(/"/g,"\\\"").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(h){return"\\x0"+o(h)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(h){return"\\x"+o(h)})}function i(l){return l.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(h){return"\\x0"+o(h)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(h){return"\\x"+o(h)})}function s(l){return n[l.type](l)}function a(l){var h=l.map(s),d,u;if(h.sort(),h.length>0){for(d=1,u=1;d<h.length;d++)if(h[d-1]!==h[d])h[u]=h[d],u++;h.length=u}switch(h.length){case 1:return h[0];case 2:return h[0]+" or "+h[1];default:return h.slice(0,-1).join(", ")+", or "+h[h.length-1]}}function c(l){return l?'"'+r(l)+'"':"end of input"}return"Expected "+a(e)+" but "+c(t)+" found."};function Ahe(e,t){let n=new FK(e),o=n.getTotalLength(),r=Math.max(2,Math.ceil(o*t)),i=[];for(let s=1;s<=r;s++){let a=s/r*o,c=n.getPointAtLength(a);i.push({x:c.x,y:c.y})}return i}function TEr(e,t=10){let n=new FK(e);n.toAbsolute();let o=n.segments,r=[],i=[],s=0,a=0,c=0,l=0;for(let h of o)switch(h[0]){case"M":{if(i.length>0)r.push(i);s=h[1],a=h[2],c=s,l=a,i=[{x:s,y:a}];break}case"L":{s=h[1],a=h[2],i.push({x:s,y:a});break}case"H":{s=h[1],i.push({x:s,y:a});break}case"V":{a=h[1],i.push({x:s,y:a});break}case"Z":{if(s!==c||a!==l)i.push({x:c,y:l});s=c,a=l;break}case"C":{let u=h[5],_=h[6],p=`M ${s} ${a} C ${h[1]} ${h[2]} ${h[3]} ${h[4]} ${u} ${_}`,m=Ahe(p,t);i.push(...m),s=u,a=_;break}case"S":{let u=h[3],_=h[4],p=`M ${s} ${a} S ${h[1]} ${h[2]} ${u} ${_}`,m=Ahe(p,t);i.push(...m),s=u,a=_;break}case"Q":{let u=h[3],_=h[4],p=`M ${s} ${a} Q ${h[1]} ${h[2]} ${u} ${_}`,m=Ahe(p,t);i.push(...m),s=u,a=_;break}case"T":{let u=h[1],_=h[2],p=`M ${s} ${a} T ${u} ${_}`,m=Ahe(p,t);i.push(...m),s=u,a=_;break}case"A":{let u=h[6],_=h[7],p=`M ${s} ${a} A ${h[1]} ${h[2]} ${h[3]} ${h[4]} ${h[5]} ${u} ${_}`,m=Ahe(p,t);i.push(...m),s=u,a=_;break}}if(i.length>0)r.push(i);return r.map((h)=>{let d=[];for(let u of h)if(d.length===0||Math.abs(d[d.length-1].x-u.x)>0.000000001||Math.abs(d[d.length-1].y-u.y)>0.000000001)d.push(u);return d})}var dv="image/svg+xml",ttt="image/png";async function $6e(e){if(e.startsWith("data:"))return DEr(e);let t;try{t=await fetch(e)}catch(r){throw Error(`Failed to fetch image "${e}". Pass a data URL or a fetchable URL.`,{cause:r})}if(!t.ok)throw Error(`Failed to fetch image "${e}": ${t.status} ${t.statusText}`);let n=t.headers.get("content-type")?.split(";")[0],o=n&&n!=="application/octet-stream"?n:NEr(e);return{mimetype:o,text:o===dv?await t.text():"",dataUrl:e,projectRelativePath:e}}function Whn({svg:e,width:t,height:n,transform:o}){let r=ntt({svg:e,width:t,height:n,transform:o}).map(REr).filter((s)=>s.length>=3).map((s)=>({vertices:s,polygon:Xhn(s),samplePoint:kEr(s)})).map((s)=>({...s,area:s.polygon.area()})).filter((s)=>s.area>0.000000001),i=r.filter((s)=>r.filter((c)=>c!==s&&c.area>s.area&&c.polygon.contains(P_(s.samplePoint.x,s.samplePoint.y))).length%2===0);return i.map((s)=>{let a=r.filter((c)=>c!==s&&c.area<s.area&&s.polygon.contains(P_(c.samplePoint.x,c.samplePoint.y))&&!i.some((l)=>l!==s&&l.area<s.area&&l.area>c.area&&l.polygon.contains(P_(c.samplePoint.x,c.samplePoint.y)))).map((c)=>({vertices:QEr(c.vertices)}));return{outer_ring:{vertices:ott(s.vertices)},inner_rings:a}})}function ntt({svg:e,width:t,height:n,transform:o}){let r=LEr(e),i=t/r.width,s=n/r.height;return HEr(e).flatMap((a)=>TEr(a,0.03).map((c)=>c.map((l)=>Jet(o,{x:(l.x-r.x-r.width/2)*i,y:-(l.y-r.y-r.height/2)*s})).filter((l,h,d)=>h===0||Math.abs(l.x-d[h-1].x)>0.000001||Math.abs(l.y-d[h-1].y)>0.000001)))}function ott(e){return jhn(e)>0?[...e].reverse():e}function DEr(e){let t=e.indexOf(",");if(!e.startsWith("data:")||t===-1)throw Error("Invalid data URL for image source");let n=e.slice(5,t),o=e.slice(t+1),r=n.split(";")[0]||dv,i=n.includes(";base64")?new TextDecoder().decode(Uint8Array.from(atob(o),(s)=>s.charCodeAt(0))):decodeURIComponent(o);return{mimetype:r,text:i,dataUrl:e,projectRelativePath:"inline"}}function NEr(e){let t=e.toLowerCase();if(t.endsWith(".svg"))return dv;if(t.endsWith(".png"))return ttt;return"application/octet-stream"}function REr(e){if(e.length<2)return e;let t=e[0],n=e[e.length-1];if(Math.abs(t.x-n.x)<0.000001&&Math.abs(t.y-n.y)<0.000001)return e.slice(0,-1);return e}function QEr(e){return jhn(e)<0?[...e].reverse():e}function kEr(e){let t=0,n=0;for(let o of e)t+=o.x,n+=o.y;return{x:t/e.length,y:n/e.length}}function Xhn(e){let t=new El;return t.addFace(e.map((n)=>P_(n.x,n.y))),t}function jhn(e){return[...Xhn(e).faces][0].signedArea()}function LEr(e){let n=e.match(/\bviewBox\s*=\s*["']([^"']+)["']/i)?.[1]?.trim().split(/[\s,]+/).map(Number);if(n?.length===4&&n.every(Number.isFinite))return{x:n[0],y:n[1],width:n[2],height:n[3]};return{x:0,y:0,width:1,height:1}}function HEr(e){let t=[],n=/<path\b[^>]*>/gi;for(let o of e.match(n)??[]){let r=o.match(/\bd\s*=\s*(["'])(.*?)\1/i);if(r?.[2])t.push(r[2])}return t}qt();qt();be();be();var Khn={in:25.4,inch:25.4,mil:0.0254,mm:1,m:1000,cm:10,ft:304.8,feet:304.8},YXs=new Intl.NumberFormat("en-US",{useGrouping:!1,notation:"standard",maximumFractionDigits:12}),$hn=(e)=>{let t=typeof e==="number"?"mm":e.replace(/^[^a-zA-Z]+/g,"").toLowerCase();if(!t)t="mm";let n=typeof e==="number"?e:Number.parseFloat(e.split(t)[0]);if(t in Khn)return n*Khn[t];throw Error(`Unsupported unit: ${t}`)};be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();function Hdn(e){if(!/^nema(?:8|17|23)(?:_|$)/i.test(e))return e;return e.replace(/(^|_)jst([0-9]+)_(ph|sh)(?=_|$)/gi,"$1jst$3$2").replace(/(^|_)jst[_-](ph|sh)[_-]([0-9]+)(?=_|$)/gi,"$1jst$2$3").replace(/(^|_)none(?=_|$)/gi,"$1nowires").replace(/(^|_)stubs(?=_|$)/gi,"$1wirestubs")}function ep(e){let t=[],n=0,o=0;for(let r=0;r<e.length;r++){let i=e[r];if(i==="(")n++;if(i===")")n--;if(n<0||n>1)throw Error("Invalid feature parentheses");if(i==="_"&&n===0)t.push(e.slice(o,r)),o=r+1}if(n!==0)throw Error("Unclosed feature parentheses");if(t.push(e.slice(o)),t.some((r)=>!r))throw Error("Model strings cannot contain empty tokens");return t}var qhn=(e)=>{let t=e.match(/^([a-zA-Z]+)([\(\d\.\+\-].*)?$/);if(!t?.[1])return;return{fn:t[1].toLowerCase(),value:t[2]}},Z6e=(e)=>{let t=Hdn(e.trim());if(!t)throw Error("Model string cannot be empty");let n=ep(t),o=n[0],r=qhn(o),i={},s=r?.fn??o.toLowerCase();if(i[s]=!0,i.fn=s,r?.value){let a=Number.parseFloat(r.value);if(Number.isFinite(a))i.num_pins=a}for(let a of n.slice(1)){if(!a)throw Error("Model strings cannot contain empty tokens");let c=qhn(a);if(!c)throw Error(`Invalid model string token "${a}"`);i[c.fn]=c.value??!0}return i.string=t,i};function I1(e,t){return ep(e).map((n,o)=>o>0&&Object.hasOwn(t,n.toLowerCase())?t[n.toLowerCase()]:n).join("_")}function cx(e,t,n,o){if(!ep(e).slice(1).some((c)=>Object.hasOwn(t,c.toLowerCase())))return e;let i=I1(e,t);n(Z6e(i));let s=new Map(Object.entries(t).map(([c,l])=>[l,c])),a=new Set(o.map((c)=>t[c]));return ep(i).flatMap((c,l)=>{if(l===0)return[c.toLowerCase()];let h=c.toLowerCase();if(a.has(h))return[];return[s.get(h)??c]}).join("_")}var Fdn={hex:"drive(hex)",fullthread:"thread(full)",lefthanded:"threadhand(left)",righthanded:"threadhand(right)",male:"threadgender(male)"},FEr=["righthanded","male"];function ku(e){return e}var zEr=class{models=new Map;register(e){if(typeof e.name!=="string"||!/^[a-z]+$/.test(e.name))throw Error("Model names must contain only lowercase letters");if(this.models.has(e.name))throw Error(`Modelprinter function "${e.name}" is already registered`);if(e.normalizeString!==void 0&&typeof e.normalizeString!=="function")throw Error("Model string normalizer must be a function");this.models.set(e.name,{name:e.name,schema:e.schema,parse:e.parse,normalizeString:e.normalizeString})}getModelNames(){return[...this.models.keys()]}normalize(e){let t=this.models.get(e.fn);if(!t?.normalizeString)return e;let n=t.normalizeString(e.string);if(typeof n!=="string")throw Error(`Normalizer for "${t.name}" must return a string`);if(n===e.string)return e;let o=Z6e(n);if(o.fn!==t.name)throw Error(`Normalizer for "${t.name}" must preserve the model name`);return o}parse(e){let t=this.models.get(e.fn);if(!t)throw Error(`Unsupported modelprinter function "${e.fn}"`);let n=t.parse(e);if(n===null||typeof n!=="object"||Array.isArray(n)||n.fn!==t.name)throw Error(`Parser for "${t.name}" must return a model with fn "${t.name}"`);return n}},rd=an([ge(),k()]).transform((e,t)=>{try{let n=$hn(e);if(!Number.isFinite(n))throw Error("Length is not finite");return n}catch{return t.addIssue({code:"custom",message:`Invalid model length: ${String(e)}`}),Cie}}),Bs=rd.refine((e)=>e>0,"Length must be greater than zero"),ax=rd.refine((e)=>e>=0,"Length cannot be negative"),uv=an([ge(),k().regex(/^(?:\d+(?:\.\d+)?|\.\d+)(?:mm|cm|m|in|inch)?$/i).transform((e)=>e.toLowerCase())]).pipe(rd).refine((e)=>e>0,"Length must be positive"),utt={M3:{diameter:3,threadPitch:0.5,headAcrossFlats:5.5,headHeight:2,underHeadRadius:0.1,headChamferAngle:30,tipChamferAngle:45,threadFlankAngle:60,tipChamfer:0.25,threadRootDiameter:2.3865653389860224,threadPitchDiameter:2.6752404735808355,headCornerDiameter:6.3508529610858835,headChamferDiameter:5.5},M4:{diameter:4,threadPitch:0.7,headAcrossFlats:7,headHeight:2.8,underHeadRadius:0.2,headChamferAngle:30,tipChamferAngle:45,threadFlankAngle:60,tipChamfer:0.35,threadRootDiameter:3.141191474580432,threadPitchDiameter:3.5453366630131695,headCornerDiameter:8.082903768654761,headChamferDiameter:7},M5:{diameter:5,threadPitch:0.8,headAcrossFlats:8,headHeight:3.5,underHeadRadius:0.2,headChamferAngle:30,tipChamferAngle:45,threadFlankAngle:60,tipChamfer:0.4,threadRootDiameter:4.018504542377636,threadPitchDiameter:4.480384757729337,headCornerDiameter:9.237604307034013,headChamferDiameter:8},M6:{diameter:6,threadPitch:1,headAcrossFlats:10,headHeight:4,underHeadRadius:0.25,headChamferAngle:30,tipChamferAngle:45,threadFlankAngle:60,tipChamfer:0.5,threadRootDiameter:4.773130677972045,threadPitchDiameter:5.350480947161671,headCornerDiameter:11.547005383792516,headChamferDiameter:10}},OEr=bt(["M3","M4","M5","M6"]),VEr=bt(["iso4017","iso4017:2014"]).default("iso4017").transform(()=>"iso4017:2014"),zdn={standard:VEr,metricSize:OEr,length:uv,thread:ce("full").default("full"),drive:ce("hex").default("hex"),threadHand:bt(["right","left"]).default("right"),threadClass:ce("6g").default("6g"),threadGender:ce("male").default("male"),showThreads:Be().default(!0),diameter:uv.optional(),threadPitch:uv.optional(),headAcrossFlats:uv.optional(),headHeight:uv.optional(),underHeadRadius:uv.optional(),headChamferAngle:ge().finite().positive().optional(),tipChamferAngle:ge().finite().positive().optional(),threadFlankAngle:ge().finite().positive().optional(),tipChamfer:uv.optional(),threadRootDiameter:uv.optional(),threadPitchDiameter:uv.optional(),headCornerDiameter:uv.optional(),headChamferDiameter:uv.optional()},Odn=(e,t)=>{let n=utt[e.metricSize];for(let o of Object.keys(n))if(e[o]!==void 0&&Math.abs(e[o]-n[o])>0.000000001)t.addIssue({code:"custom",path:[o],message:`Dimension ${o} contradicts ${e.standard} ${e.metricSize}`});if(e.length<=n.underHeadRadius+n.tipChamfer)t.addIssue({code:"custom",path:["length"],message:"Length must separate the under-head fillet and fixed tip chamfer"})},KXs=Ee(zdn).strict().superRefine(Odn).transform((e)=>({...e,...utt[e.metricSize]})),Vdn=Ee({fn:ce("hexbolt"),...zdn}).strict().superRefine(Odn).transform((e)=>({...e,...utt[e.metricSize]})),YEr={m:"metricSize",metricsize:"metricSize",l:"length",length:"length",standard:"standard",thread:"thread",drive:"drive",threadhand:"threadHand",threadclass:"threadClass",threadgender:"threadGender",diameter:"diameter",threadpitch:"threadPitch",headacrossflats:"headAcrossFlats",headheight:"headHeight",underheadradius:"underHeadRadius",headchamferangle:"headChamferAngle",tipchamferangle:"tipChamferAngle",threadflankangle:"threadFlankAngle",tipchamfer:"tipChamfer",threadrootdiameter:"threadRootDiameter",threadpitchdiameter:"threadPitchDiameter",headcornerdiameter:"headCornerDiameter",headchamferdiameter:"headChamferDiameter",d:"diameter",headh:"headHeight",af:"headAcrossFlats"},GEr=new Set(["standard","thread","drive","threadHand","threadClass","threadGender"]),Jhn=(e)=>{if(e.fn!=="hexbolt")throw Error(`Expected hexbolt params, got "${e.fn}"`);let[t,...n]=ep(I1(e.string,Fdn));if(t?.toLowerCase()!=="hexbolt")throw Error("The hexbolt function does not accept an inline value");let o={};for(let r of n){let i=r.match(/^([a-z]+)(.*)$/i),s=i?.[1]?.toLowerCase(),a=i?.[2],c,l;if(s==="threads"||s==="nothreads"){if(a!=="")throw Error(`Token "${s}" does not accept a value`);c="showThreads",l=s==="threads"}else{if(c=s?YEr[s]??"":"",!c||!a)throw Error(`Unknown or missing hexbolt token "${r}"`);if(GEr.has(c)){let h=a.match(/^\(([^()]+)\)$/)?.[1];if(!h)throw Error(`Token "${s}" requires a parenthesized selector`);l=h.toLowerCase()}else if(c==="metricSize"){let h=s==="m"?a:a.match(/^\((m\d+)\)$/i)?.[1]?.slice(1);if(!h||!/^\d+$/.test(h))throw Error("Invalid metric size");l=`M${h}`}else{if(!/^(?:\d+(?:\.\d+)?|\.\d+)(?:mm|cm|m|in|inch)?$/i.test(a))throw Error(`Invalid dimension token "${r}"`);l=["headChamferAngle","tipChamferAngle","threadFlankAngle"].includes(c)?Number(a):a}}if(c in o)throw Error(`Property "${c}" is set more than once`);o[c]=l}return Vdn.parse({fn:"hexbolt",...o})},Ydn=ku({name:"hexbolt",schema:Vdn,parse:Jhn,normalizeString:(e)=>cx(e,Fdn,Jhn,FEr)});function UEr(e){e.register(Ydn)}var Gdn=an([ge(),k().regex(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:mm|cm|m|in|inch|mil|ft|feet)?$/i,"Length must be a complete number with an optional supported unit").transform((e)=>e.toLowerCase())]),b0=Gdn.pipe(rd).refine((e)=>e>0,"Length must be greater than zero"),pv=Gdn.pipe(rd).refine((e)=>e>=0,"Length cannot be negative"),Udn=ge().finite().gt(0).lt(90);function CY(e,t){if(!/^\d+$/.test(e))throw Error(`${t} requires a unitless integer`);return Number(e)}function eIe(e,t){if(!/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:deg)?$/i.test(e))throw Error(`${t} requires a numeric angle in degrees`);return Number(e.replace(/deg$/i,""))}function cJ(e){let t=e.match(/^([a-z]+)(.*)$/i);if(!t)throw Error(`Invalid gear token "${e}"`);return[t[1].toLowerCase(),t[2]]}var Wdn={toothCount:ge().int().min(6).max(512).default(24),module:b0.default(1),faceWidth:b0.default(5),pressureAngle:Udn.default(20),backlash:pv.default(0),clearance:pv.default(0.25),boreDiameter:pv.default(0),hubDiameter:pv.default(0),hubLength:pv.default(0),phase:ge().finite().default(0),segmentsPerTooth:ge().int().min(4).max(64).default(12)};function Xdn(e){let t=e.module*e.toothCount;return{pitchDiameter:t,baseDiameter:t*Math.cos(e.pressureAngle*Math.PI/180),outsideDiameter:t+2*e.module,rootDiameter:t-2*(e.module+e.clearance),circularPitch:Math.PI*e.module,toothThickness:Math.PI*e.module/2-e.backlash}}var q6e=(e)=>Math.tan(e)-e;function jdn(e,t){let n=(c,l)=>t.addIssue({code:"custom",message:c,path:l?[l]:[]}),o=Xdn(e);if(Object.values(o).some((c)=>!Number.isFinite(c))||!Number.isFinite(e.faceWidth+e.hubLength)){n("Derived gear dimensions must be finite");return}if(o.rootDiameter<=0){n("Dedendum must leave a positive root diameter","clearance");return}if(e.boreDiameter>=o.rootDiameter)n("Bore diameter must be smaller than the root diameter","boreDiameter");if(e.hubDiameter===0!==(e.hubLength===0))n("Hub diameter and length must both be zero or both be positive");if(e.hubDiameter>0){if(e.hubDiameter>=o.rootDiameter)n("Hub diameter must be smaller than the root diameter","hubDiameter");if(e.boreDiameter>=e.hubDiameter)n("Hub diameter must exceed the bore diameter","hubDiameter")}let r=e.pressureAngle*Math.PI/180,i=o.toothThickness/o.pitchDiameter,s=i+q6e(r)-q6e(Math.acos(o.baseDiameter/o.outsideDiameter));if(!Number.isFinite(s)||s<=0)n("Tooth tip must have positive angular thickness","backlash");let a=i+q6e(r)-q6e(Math.acos(o.baseDiameter/Math.max(o.rootDiameter,o.baseDiameter)));if(!Number.isFinite(a)||a>=Math.PI/e.toothCount)n("Adjacent teeth must leave a positive root gap","pressureAngle")}var ptt=Ee(Wdn).strict().superRefine(jdn),Kdn=Ee({fn:ce("spurgear"),...Wdn}).strict().superRefine(jdn),WEr=(e={})=>Xdn(ptt.parse(e)),$dn={...ptt.innerType().shape,helixAngle:ge().finite().min(0).lt(90).default(20),handedness:bt(["right","left"]).default("right"),segmentsPerTurn:ge().int().min(12).max(128).default(32)};function XEr(e){let{helixAngle:t,handedness:n,segmentsPerTurn:o,...r}=e,i=WEr(r),s=t*Math.PI/180;return{...i,normalModule:e.module*Math.cos(s),normalPressureAngle:Math.atan(Math.tan(e.pressureAngle*Math.PI/180)*Math.cos(s))*180/Math.PI,normalPitch:i.circularPitch*Math.cos(s),twistAngle:t===0?0:(n==="right"?1:-1)*(2*e.faceWidth/i.pitchDiameter*Math.tan(s)*180)/Math.PI}}function qdn(e,t){let{fn:n,helixAngle:o,handedness:r,segmentsPerTurn:i,...s}=e,a=ptt.safeParse(s);if(!a.success){for(let c of a.error.issues)t.addIssue(c);return}if(Object.values(XEr({...a.data,helixAngle:o,handedness:r,segmentsPerTurn:i})).some((c)=>!Number.isFinite(c)))t.addIssue({code:"custom",message:"Derived helical gear dimensions must be finite"})}var ZXs=Ee($dn).strict().superRefine(qdn),Jdn=Ee({fn:ce("helicalgear"),...$dn}).strict().superRefine(qdn);var Zhn={m:"module",module:"module",w:"faceWidth",width:"faceWidth",facewidth:"faceWidth",bore:"boreDiameter",borediameter:"boreDiameter",backlash:"backlash",clearance:"clearance",hubdiameter:"hubDiameter",hublength:"hubLength"};function jEr(e){let t=e.string.split("_"),n=t[0]?.match(/^helicalgear(\d+)?$/i);if(!n||e.fn!=="helicalgear")throw Error("Expected helicalgear with an optional inline tooth count");let o={fn:"helicalgear"};if(n[1])o.toothCount=CY(n[1],"toothCount");for(let r of t.slice(1)){let[i,s]=cJ(r),a,c;if(i in Zhn)a=Zhn[i],c=s;else if(i==="teeth"||i==="segments"||i==="turnsegments")a=i==="teeth"?"toothCount":i==="segments"?"segmentsPerTooth":"segmentsPerTurn",c=CY(s,a);else if(i==="pa"||i==="pressureangle"||i==="phase"||i==="ha"||i==="helixangle")a=i==="phase"?"phase":i==="ha"||i==="helixangle"?"helixAngle":"pressureAngle",c=eIe(s,a);else if(i==="right"||i==="left"){if(s)throw Error(`Helical flag "${i}" does not accept a value`);a="handedness",c=i}else throw Error(`Unknown helical gear token "${r}"`);if(a in o)throw Error(`Helical gear property "${a}" is set more than once`);o[a]=c}return Jdn.parse(o)}var Zdn=ku({name:"helicalgear",schema:Jdn,parse:jEr});function KEr(e){e.register(Zdn)}function tIe(e){let t=/^jst-(ph|sh)-([1-9][0-9]*)$/.exec(e);if(!t)return;let n=Number(t[2]),o=t[1]==="ph";return{standard:o?"jst_ph":"jst_sh",pinCount:n,maxPinCount:o?16:15,pitch:o?2:1,bodyWidth:o?(n-1)*2+3.9:n+3,bodyHeight:o?4.5:2.9,matingDepth:o?6:4.25}}var $Er=k().refine((e)=>{let t=tIe(e);return t!==void 0&&t.pinCount>=2&&t.pinCount<=t.maxPinCount},"Expected jst-ph-N (2–16 pins) or jst-sh-N (2–15 pins)"),LB={M2:{diameter:2,threadPitch:0.4,headDiameter:3.8,headHeight:2,socketWidth:1.5,socketDepth:1},"M2.5":{diameter:2.5,threadPitch:0.45,headDiameter:4.5,headHeight:2.5,socketWidth:2,socketDepth:1.1},M3:{diameter:3,threadPitch:0.5,headDiameter:5.5,headHeight:3,socketWidth:2.5,socketDepth:1.3},M4:{diameter:4,threadPitch:0.7,headDiameter:7,headHeight:4,socketWidth:3,socketDepth:2},M5:{diameter:5,threadPitch:0.8,headDiameter:8.5,headHeight:5,socketWidth:4,socketDepth:2.5},M6:{diameter:6,threadPitch:1,headDiameter:10,headHeight:6,socketWidth:5,socketDepth:3},M8:{diameter:8,threadPitch:1.25,headDiameter:13,headHeight:8,socketWidth:6,socketDepth:4},M10:{diameter:10,threadPitch:1.5,headDiameter:16,headHeight:10,socketWidth:8,socketDepth:5},M12:{diameter:12,threadPitch:1.75,headDiameter:18,headHeight:12,socketWidth:10,socketDepth:6}},Che=bt(["M2","M2.5","M3","M4","M5","M6","M8","M10","M12"]),eun={metricSize:Che,length:Bs,showThreads:Be().default(!0)},ojs=Ee(eun).strict(),tun=Ee({fn:ce("hexsocketbolt"),...eun}).strict(),qEr=an([ce(8),ce(17),ce(23)]),JEr={8:{backFaceScrewSize:"M2",backFaceHoleDepth:2,bodyWidth:20.3,bodyLength:33,mountingHoleSpacing:16,mountingHoleDiameter:2,mountingHoleDepth:2,mountingHoleThrough:!1,pilotDiameter:15,pilotLength:1.5,shaftDiameter:4,shaftLength:15,shaftShape:"round",shaftFlatDepth:0.5,shaftFlatLength:10,shaftFlatAngle:0,frontCapLength:3.5,rearCapLength:3.5,faceCornerChamfer:0.5,bodyCornerChamfer:3},17:{backFaceScrewSize:"M3",backFaceHoleDepth:4.5,bodyWidth:42.3,bodyLength:38,mountingHoleSpacing:31,mountingHoleDiameter:3,mountingHoleDepth:4.5,mountingHoleThrough:!1,pilotDiameter:22,pilotLength:2,shaftDiameter:5,shaftLength:24,shaftShape:"d",shaftFlatDepth:0.5,shaftFlatLength:15,shaftFlatAngle:0,frontCapLength:5,rearCapLength:5,faceCornerChamfer:3,bodyCornerChamfer:6},23:{backFaceScrewSize:"M4",backFaceHoleDepth:4.5,bodyWidth:56.4,bodyLength:51,mountingHoleSpacing:47.14,mountingHoleDiameter:5,mountingHoleDepth:5,mountingHoleThrough:!0,pilotDiameter:38.1,pilotLength:1.6,shaftDiameter:6.35,shaftLength:20.6,shaftShape:"d",shaftFlatDepth:0.5,shaftFlatLength:15,shaftFlatAngle:0,frontCapLength:5,rearCapLength:5,faceCornerChamfer:2,bodyCornerChamfer:15}},nun={nemaSize:qEr,backFace:bt(["plain","holes","screws"]).optional(),backFaceHoleSpacing:Bs.optional(),backFaceHoleDiameter:Bs.optional(),backFaceHoleDepth:Bs.optional(),backFaceScrewSize:Che.optional(),wireConnection:an([bt(["none","stubs"]),$Er]).optional(),wireSideAngle:ge().finite().optional(),wireLength:Bs.optional(),wireDiameter:Bs.optional(),wireCount:ge().int().min(2).max(8).optional(),bodyWidth:Bs.optional(),bodyLength:Bs.optional(),mountingHoleSpacing:Bs.optional(),mountingHoleDiameter:Bs.optional(),mountingHoleDepth:Bs.optional(),mountingHoleThrough:Be().optional(),pilotDiameter:Bs.optional(),pilotLength:Bs.optional(),shaftLength:Bs.optional(),shaftDiameter:Bs.optional(),shaftShape:bt(["round","d"]).optional(),shaftFlatDepth:ax.optional(),shaftFlatLength:ax.optional(),shaftFlatAngle:ge().finite().optional(),frontCapLength:Bs.optional(),rearCapLength:Bs.optional(),faceCornerChamfer:ax.optional(),bodyCornerChamfer:ax.optional()},oun=(e)=>{let t=JEr[e.nemaSize],n=e.backFaceScrewSize??t.backFaceScrewSize,o=LB[n];return{nemaSize:e.nemaSize,wireConnection:e.wireConnection??"stubs",wireSideAngle:((e.wireSideAngle??0)%360+360)%360,wireLength:e.wireLength??6,wireDiameter:e.wireDiameter??1.2,wireCount:e.wireCount??4,backFace:e.backFace??"screws",backFaceHoleSpacing:e.backFaceHoleSpacing??e.mountingHoleSpacing??t.mountingHoleSpacing,backFaceHoleDiameter:e.backFaceHoleDiameter??o.diameter,backFaceHoleDepth:e.backFaceHoleDepth??t.backFaceHoleDepth,backFaceScrewSize:n,bodyWidth:e.bodyWidth??t.bodyWidth,bodyLength:e.bodyLength??t.bodyLength,mountingHoleSpacing:e.mountingHoleSpacing??t.mountingHoleSpacing,mountingHoleDiameter:e.mountingHoleDiameter??t.mountingHoleDiameter,mountingHoleDepth:e.mountingHoleDepth??t.mountingHoleDepth,mountingHoleThrough:e.mountingHoleThrough??t.mountingHoleThrough,pilotDiameter:e.pilotDiameter??t.pilotDiameter,pilotLength:e.pilotLength??t.pilotLength,shaftDiameter:e.shaftDiameter??t.shaftDiameter,shaftLength:e.shaftLength??t.shaftLength,shaftShape:e.shaftShape??t.shaftShape,shaftFlatDepth:e.shaftFlatDepth??t.shaftFlatDepth,shaftFlatLength:e.shaftFlatLength??t.shaftFlatLength,shaftFlatAngle:e.shaftFlatAngle??t.shaftFlatAngle,frontCapLength:e.frontCapLength??t.frontCapLength,rearCapLength:e.rearCapLength??t.rearCapLength,faceCornerChamfer:e.faceCornerChamfer??t.faceCornerChamfer,bodyCornerChamfer:e.bodyCornerChamfer??t.bodyCornerChamfer}},run=(e,t)=>{let n=(i)=>t.addIssue({code:"custom",message:i});if(e.backFace!=="plain"){let i=LB[e.backFaceScrewSize],s=(e.backFace==="screws"?Math.max(e.backFaceHoleDiameter,i.headDiameter):e.backFaceHoleDiameter)/2;if(e.backFaceHoleSpacing<=2*s)n("Rear holes and screw heads must not overlap each other");if(e.backFaceHoleSpacing+2*s>=e.bodyWidth||e.bodyWidth-e.faceCornerChamfer-e.backFaceHoleSpacing<=s*Math.SQRT2)n("Rear holes and screw heads must fit entirely inside the rear face");if(e.backFaceHoleDepth>=e.rearCapLength)n("Rear hole depth must be less than the rear cap length");if(e.backFace==="screws"&&e.backFaceHoleDiameter<i.diameter)n("Rear holes must accommodate the screw diameter")}if(e.wireConnection==="stubs"){if(e.wireDiameter*e.wireCount*1.5>e.bodyWidth-2*e.faceCornerChamfer)n("Wire bundle must fit on the cap side");if(e.wireDiameter>=e.rearCapLength)n("Wire diameter must fit within the rear cap")}let o=tIe(e.wireConnection);if(o&&e.bodyWidth-2*e.faceCornerChamfer<o.bodyWidth)n("JST header must fit on the motor side");let r=e.mountingHoleDiameter/2;if(e.frontCapLength+e.rearCapLength>=e.bodyLength)n("End caps must leave a positive body length");if(e.faceCornerChamfer>=e.bodyWidth/2||e.bodyCornerChamfer>=e.bodyWidth/2)n("Chamfer must be smaller than half the body width");if(e.mountingHoleSpacing+2*r>=e.bodyWidth||e.bodyWidth-e.faceCornerChamfer-e.mountingHoleSpacing<=r*Math.SQRT2)n("Mounting holes must fit entirely inside the front face");if(e.pilotDiameter>=e.bodyWidth||e.pilotDiameter<=e.shaftDiameter)n("Pilot diameter must exceed the shaft diameter and fit inside the face");if(e.mountingHoleSpacing/Math.SQRT2<=e.pilotDiameter/2+r)n("Mounting holes must clear the pilot");if(!e.mountingHoleThrough&&e.mountingHoleDepth>=e.frontCapLength)n("Blind mounting hole depth must be less than the front cap length");if(e.mountingHoleThrough&&e.bodyWidth-e.bodyCornerChamfer-e.mountingHoleSpacing>=-r*Math.SQRT2)n("Body must clear through front mounting holes");if(e.shaftLength<=e.pilotLength)n("Shaft tip must extend beyond the pilot");if(e.shaftShape==="d"&&(e.shaftFlatDepth<=0||e.shaftFlatDepth>=e.shaftDiameter/2||e.shaftFlatLength<=0||e.shaftFlatLength>e.shaftLength-e.pilotLength))n("D flat must have positive depth less than the shaft radius and fit above the pilot")},ZEr=Ee(nun).strict().transform(oun).superRefine(run),iun=Ee({fn:ce("nema"),...nun}).strict().transform(({fn:e,...t})=>({fn:e,...oun(t)})).superRefine(run),edn={wirelength:"wireLength",wirediameter:"wireDiameter",l:"bodyLength",length:"bodyLength",bodylength:"bodyLength",bodywidth:"bodyWidth",backholespacing:"backFaceHoleSpacing",backholediameter:"backFaceHoleDiameter",backholedepth:"backFaceHoleDepth",shaftlength:"shaftLength",shaftdiameter:"shaftDiameter",flatdepth:"shaftFlatDepth",flatlength:"shaftFlatLength",holespacing:"mountingHoleSpacing",holediameter:"mountingHoleDiameter",holedepth:"mountingHoleDepth",pilotdiameter:"pilotDiameter",pilotlength:"pilotLength",frontcap:"frontCapLength",rearcap:"rearCapLength",facechamfer:"faceCornerChamfer",bodychamfer:"bodyCornerChamfer"};function eMr(e){let t=Hdn(e.string).split("_"),n=t[0]?.match(/^nema(8|17|23)$/i);if(!n)throw Error("Expected nema8, nema17 or nema23");let o={fn:"nema",nemaSize:Number(n[1])};for(let r of t.slice(1)){let i=r.match(/^([a-z]+)(.*)$/i);if(!i)throw Error(`Invalid NEMA token "${r}"`);let s=i[1].toLowerCase(),a=i[2],c,l;if(s in edn)c=edn[s],l=a;else if(["backfaceholes","backfacescrews","plainbackface"].includes(s)){if(a)throw Error(`NEMA flag "${s}" does not accept a value`);c="backFace",l=s==="backfaceholes"?"holes":s==="backfacescrews"?"screws":"plain"}else if(["wirestubs","nowires","jstph","jstsh"].includes(s)){let h=s==="jstph"||s==="jstsh";if(h&&!/^[1-9][0-9]*$/.test(a)||!h&&a)throw Error(`Invalid wire connection token "${r}"`);c="wireConnection",l=h?`jst-${s.slice(3)}-${a}`:s==="nowires"?"none":"stubs"}else if(s==="wirecount"){if(c="wireCount",!/^\d+$/.test(a))throw Error("wirecount requires an integer");l=Number(a)}else if(s==="backscrewm")c="backFaceScrewSize",l=`M${a}`;else if(s==="flatangle"||s==="wireangle"){if(c=s==="flatangle"?"shaftFlatAngle":"wireSideAngle",!/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:deg)?$/i.test(a))throw Error(`${s} requires a numeric angle in degrees`);l=Number(a.replace(/deg$/i,""))}else if(["round","dshaft","throughholes","blindholes"].includes(s)){if(a)throw Error(`NEMA flag "${s}" does not accept a value`);c=s==="round"||s==="dshaft"?"shaftShape":"mountingHoleThrough",l=s==="round"?"round":s==="dshaft"?"d":s==="throughholes"}else throw Error(`Unknown NEMA motor token "${r}"`);if(c in o)throw Error(`NEMA property "${c}" is set more than once`);o[c]=l}return iun.parse(o)}var sun=ku({name:"nema",schema:iun,parse:eMr});function tMr(e){e.register(sun)}var tdn={panel:bt(["base","left","right"]),u:rd,v:rd},dtt=ss("shape",[Ee({...tdn,shape:ce("round"),diameter:Bs}).strict(),Ee({...tdn,shape:ce("slot"),length:Bs,width:Bs,axis:bt(["u","v"]).default("v")}).strict()]),aun={profile:bt(["plate","angle","channel"]).default("plate"),width:Bs,baseLength:Bs,flangeHeight:Bs.default(12),thickness:Bs.default(1),insideBendRadius:Bs.default(1),holes:st(dtt).max(100).default([])},ijs=Ee(aun).strict(),cun=Ee({fn:ce("sheetmetal"),...aun}).strict();function nMr(e,t){let n=e.match(/^(hole|slot)[1-9]\d*\(([^()]+)\)$/);if(!n)throw Error(`Invalid sheet metal feature "${e}"`);let o=n[1],r={};for(let m of n[2].split("_")){let A=m.match(/^(leftofcenter|rightofcenter|abovecenter|belowcenter|r|d|l|w)([0-9.].*)$/),g=A?.[1]??m;if(g in r)throw Error(`Duplicate ${g} in ${e}`);r[g]=A?.[2]??""}let i=new Set(["bottomface","angledface","leftface","rightface","leftofcenter","rightofcenter","abovecenter","belowcenter",...o==="hole"?["r","d"]:["l","w","horizontal","vertical"]]);for(let m of Object.keys(r))if(!i.has(m))throw Error(`Unknown ${m} in ${e}`);let s=["bottomface","angledface","leftface","rightface"].filter((m)=>(m in r));if(s.length!==1)throw Error(`Specify exactly one face in ${e}`);let a=s[0];if(a==="angledface"&&t!=="angle"||["leftface","rightface"].includes(a)&&t!=="channel")throw Error(`No ${a} on ${t}`);for(let[m,A]of[["leftofcenter","rightofcenter"],["abovecenter","belowcenter"],["horizontal","vertical"],["r","d"]])if(m in r&&A in r)throw Error(`Conflicting ${m} and ${A} in ${e}`);let c=(m)=>(m in r)?Bs.parse(r[m]):0,l=c("rightofcenter")-c("leftofcenter"),h=c("abovecenter")-c("belowcenter"),d=a==="bottomface"?"base":a==="leftface"?"left":"right",u={panel:d,u:d==="base"?l:h,v:d==="base"?h:l*(d==="left"?-1:1)};if(o==="hole"){if(!("r"in r)&&!("d"in r))throw Error(`Hole requires r or d in ${e}`);return dtt.parse({...u,shape:"round",diameter:"r"in r?2*c("r"):c("d")})}if(!("l"in r)||!("w"in r))throw Error(`Slot requires l and w in ${e}`);let _=c("l"),p=c("w");if(_<p)throw Error("Slot length must be at least its width");return dtt.parse({...u,shape:"slot",length:_,width:p,axis:d==="base"===!("vertical"in r)?"u":"v"})}var oMr={w:"width",l:"baseLength",h:"flangeHeight",t:"thickness",r:"insideBendRadius"};function rMr(e){let t={},n=ep(e.string);if(n[0]!=="sheetmetal")throw Error("Expected sheetmetal");let o=[],r=new Set;for(let s of n.slice(1)){if(/^(hole|slot)[1-9]\d*\(/.test(s)){let c=s.slice(0,s.indexOf("("));if(r.has(c))throw Error(`Duplicate feature "${c}"`);r.add(c),o.push(s);continue}if(["plate","angle","channel"].includes(s)){if(t.profile)throw Error("Duplicate sheet metal profile");t.profile=s;continue}let a=oMr[s[0]];if(!a||s.length<2)throw Error(`Unknown sheet metal token "${s}"`);if(a in t)throw Error(`Duplicate sheet metal property "${a}"`);t[a]=s.slice(1)}let i=cun.parse({fn:"sheetmetal",...t});return i.holes=o.map((s)=>nMr(s,i.profile)),i}var lun=ku({name:"sheetmetal",schema:cun,parse:rMr});function iMr(e){e.register(lun)}var sMr=bt(["sitsFlat","sitsFlatBelowBoard","foldedToFaceAboveBoard","foldedToFaceBelowBoard","foldedToRightAngleAboveBoard","foldedToRightAngleBelowBoard"]),rtt=ge().finite().positive(),aMr=k().refine((e)=>{let t=e.split(":");if(t.length!==2)return!1;let n=Number(t[0]),o=Number(t[1]);return Number.isFinite(n)&&Number.isFinite(o)&&n>0&&o>0},'Aspect ratio must look like "16:9"').transform((e)=>e),ndn=an([rtt,aMr,c1([rtt,rtt])]),odn=Ee({x:rd.optional(),y:rd.optional(),z:rd.optional()}).strict(),itt=an([ge().finite(),k().min(1)]),rdn=c1([itt,itt,itt]),cMr=["sitsFlat","sitsFlatBelowBoard","foldedToFaceAboveBoard","foldedToFaceBelowBoard","foldsAboveBoard","foldsBelowBoard","foldedToRightAngleAboveBoard","foldedToRightAngleBelowBoard"],hun={width:Bs.optional(),height:Bs.optional(),diagonal:Bs.optional(),aspectRatio:ndn.optional(),ratio:ndn.optional(),defaultDiagonal:Bs.optional(),orientation:sMr.optional(),sitsFlat:Be().optional(),sitsFlatBelowBoard:Be().optional(),foldedToFaceAboveBoard:Be().optional(),foldedToFaceBelowBoard:Be().optional(),foldsAboveBoard:Be().optional(),foldsBelowBoard:Be().optional(),foldedToRightAngleAboveBoard:Be().optional(),foldedToRightAngleBelowBoard:Be().optional(),screenThickness:Bs.optional(),bezelInset:ax.optional(),bezelDepth:Bs.optional(),activeAreaWidth:Bs.optional(),activeAreaHeight:Bs.optional(),screenColor:k().min(1).optional(),bezelColor:k().min(1).optional(),showScreen:Be().optional(),flexCableLength:Bs.optional(),flexCableWidth:Bs.optional(),flexCableThickness:Bs.optional(),flexCableColor:k().min(1).optional(),pinCount:ge().int().positive().optional(),pitch:Bs.optional(),padWidth:Bs.optional(),padLength:ax.optional(),tailLength:Bs.optional(),taperLength:Bs.optional(),conductorCount:ge().int().positive().optional(),conductorPitch:Bs.optional(),conductorWidth:Bs.optional(),conductorThickness:Bs.optional(),conductorColor:k().min(1).optional(),cableEdgeMargin:ax.optional(),exposedContactLength:ax.optional(),showConductors:Be().optional(),showFlexCable:Be().optional(),showStiffeners:Be().optional(),stiffenerLength:ax.optional(),stiffenerThickness:Bs.optional(),stiffenerColor:k().min(1).optional(),bendRadius:Bs.optional(),bendSegments:ge().int().min(2).optional(),rightAngleVerticalLead:ax.optional(),distanceAboveBoard:ax.optional(),distanceBelowBoard:ax.optional(),foldDistanceFromConnector:ax.optional(),foldOutset:Bs.optional(),foldSegments:ge().int().min(4).optional(),screenGap:ax.optional(),boardTopZ:rd.optional(),boardThickness:Bs.optional(),boardClearance:ax.optional(),cableStartX:rd.optional(),cableStartY:rd.optional(),cableStartZ:rd.optional(),cableLateralOffset:rd.optional(),screenOffset:odn.optional(),screenRotation:rdn.optional(),rotation:rdn.optional(),offset:odn.optional()},dun=(e,t)=>{let n=cMr.filter((o)=>e[o]===!0);if(n.length>1)t(n[1])},uun=(e,t)=>{if(e.flexCableLength===void 0)return;if(e.tailLength!==void 0&&e.tailLength>=e.flexCableLength)t.addIssue({code:"custom",message:"tailLength must be shorter than flexCableLength",path:["tailLength"]});if((e.tailLength??0)+(e.taperLength??0)>e.flexCableLength)t.addIssue({code:"custom",message:"tailLength and taperLength must fit within flexCableLength",path:["taperLength"]})},ajs=Ee(hun).strict().superRefine((e,t)=>{uun(e,t),dun(e,(n)=>{t.addIssue({code:"custom",message:"Only one FlexScreen orientation shortcut can be true",path:[n]})})}),pun=Ee({fn:ce("flexscreen"),...hun}).strict().superRefine((e,t)=>{uun(e,t),dun(e,(n)=>{t.addIssue({code:"custom",message:"Only one FlexScreen orientation shortcut can be true",path:[n]})})}),lMr={sitsflat:"sitsFlat",sitsflatbelow:"sitsFlatBelowBoard",sitsflatbelowboard:"sitsFlatBelowBoard",foldsabove:"foldedToFaceAboveBoard",foldsaboveboard:"foldedToFaceAboveBoard",foldedtofaceaboveboard:"foldedToFaceAboveBoard",foldsbelow:"foldedToFaceBelowBoard",foldsbelowboard:"foldedToFaceBelowBoard",foldedtofacebelowboard:"foldedToFaceBelowBoard",rightangleabove:"foldedToRightAngleAboveBoard",rightangleaboveboard:"foldedToRightAngleAboveBoard",foldedtorightangleaboveboard:"foldedToRightAngleAboveBoard",rightanglebelow:"foldedToRightAngleBelowBoard",rightanglebelowboard:"foldedToRightAngleBelowBoard",foldedtorightanglebelowboard:"foldedToRightAngleBelowBoard"},hMr={width:["width","w"],height:["height","h"],diagonal:["diagonal","diag","d"],defaultDiagonal:["defaultdiagonal","defaultdiag"],screenThickness:["screenthickness"],bezelInset:["bezelinset"],bezelDepth:["bezeldepth"],activeAreaWidth:["activeareawidth","activew"],activeAreaHeight:["activeareaheight","activeh"],flexCableLength:["flexcablelength","flexlength","flex"],flexCableWidth:["flexcablewidth","flexwidth"],flexCableThickness:["flexcablethickness","flexthickness"],pitch:["pitch","p"],padWidth:["padwidth","pw"],padLength:["padlength","pl"],tailLength:["taillength","tail"],taperLength:["taperlength","taper"],conductorPitch:["conductorpitch"],conductorWidth:["conductorwidth"],conductorThickness:["conductorthickness"],cableEdgeMargin:["cableedgemargin","edgemargin"],exposedContactLength:["exposedcontactlength","contactlength"],stiffenerLength:["stiffenerlength"],stiffenerThickness:["stiffenerthickness"],bendRadius:["bendradius"],rightAngleVerticalLead:["rightangleverticallead","verticallead"],distanceAboveBoard:["distanceaboveboard","distanceabove"],distanceBelowBoard:["distancebelowboard","distancebelow"],foldDistanceFromConnector:["folddistancefromconnector","folddistance","foldstart"],foldOutset:["foldoutset","outset"],screenGap:["screengap"],boardTopZ:["boardtopz"],boardThickness:["boardthickness"],boardClearance:["boardclearance"],cableStartX:["cablestartx"],cableStartY:["cablestarty"],cableStartZ:["cablestartz"],cableLateralOffset:["cablelateraloffset","lateraloffset"]},dMr=Object.fromEntries(Object.entries(hMr).flatMap(([e,t])=>t.map((n)=>[n,e]))),uMr={num_pins:"pinCount",pincount:"pinCount",conductorcount:"conductorCount",conductors:"conductorCount",bendsegments:"bendSegments",foldsegments:"foldSegments"},idn={showscreen:["showScreen",!0],hidescreen:["showScreen",!1],showflex:["showFlexCable",!0],hideflex:["showFlexCable",!1],showconductors:["showConductors",!0],hideconductors:["showConductors",!1],showstiffeners:["showStiffeners",!0],hidestiffeners:["showStiffeners",!1]},pMr={screencolor:"screenColor",bezelcolor:"bezelColor",flexcolor:"flexCableColor",conductorcolor:"conductorColor",stiffenercolor:"stiffenerColor"},mMr=(e)=>{let t=String(e).toLowerCase().replace("x",":");if(t.includes(":")){let[o,r,i]=t.split(":"),s=Number(o),a=Number(r);if(i!==void 0||!Number.isFinite(s)||!Number.isFinite(a)||s<=0||a<=0)throw Error(`Invalid FlexScreen aspect ratio "${String(e)}"`);return`${s}:${a}`}let n=Number(t);if(!Number.isFinite(n)||n<=0)throw Error(`Invalid FlexScreen aspect ratio "${String(e)}"`);return n},_Mr=(e,t)=>{if(typeof e!=="string"||!/^\(.+\)$/.test(e))throw Error(`FlexScreen token "${t}" requires a value in (...)`);return e.slice(1,-1)},sdn=(e,t)=>{if(e!==!0)throw Error(`FlexScreen token "${t}" does not accept a value`)},gMr=(e)=>{if(e.fn!=="flexscreen")throw Error(`Expected FlexScreen params, got "${e.fn}"`);let t={},n,o;for(let[r,i]of Object.entries(e)){if(r==="fn"||r==="string"||r==="flexscreen")continue;let s=lMr[r];if(s){if(sdn(i,r),n&&n!==s)throw Error("A FlexScreen model string can only set one orientation");n=s,t.orientation=s;continue}if(r in idn){sdn(i,r);let[h,d]=idn[r];t[h]=d;continue}let a=pMr[r];if(a){t[a]=_Mr(i,r);continue}if(r==="ratio"){t.aspectRatio=mMr(i);continue}let c=dMr[r];if(c){t[c]=i;continue}if(r==="distance"){o=i;continue}let l=uMr[r];if(l){let h=Number(i);if(!Number.isInteger(h)||h<1)throw Error(`Invalid positive integer in FlexScreen token "${r}${String(i)}"`);t[l]=h;continue}throw Error(`Unknown FlexScreen model token "${r}${String(i)}"`)}if(o!==void 0)if(n==="foldedToFaceAboveBoard")t.distanceAboveBoard=o;else if(n==="foldedToFaceBelowBoard")t.distanceBelowBoard=o;else throw Error('The "distance" token requires foldsabove or foldsbelow; use distanceabove or distancebelow for an explicit side');return pun.parse({fn:"flexscreen",...t})},mun=ku({name:"flexscreen",schema:pun,parse:gMr});function AMr(e){e.register(mun)}var fMr=(e)=>{if(e.fn!=="hexsocketbolt")throw Error(`Expected hexsocketbolt params, got "${e.fn}"`);let t=e.string.split("_");if(t[0]?.toLowerCase()!=="hexsocketbolt")throw Error("The hexsocketbolt function does not accept an inline value");let n=new Set;for(let r of t.slice(1)){let i=r.match(/^[a-z]+/i)?.[0]?.toLowerCase();if(i&&n.has(i))throw Error(`Duplicate bolt token "${i}"`);if(i)n.add(i)}let o={};for(let[r,i]of Object.entries(e)){if(["fn","string","hexsocketbolt"].includes(r))continue;let s,a=i;if(r==="m")s="metricSize",a=`M${String(i)}`;else if(r==="l"||r==="length")s="length";else if(r==="threads"||r==="nothreads"){if(i!==!0)throw Error(`Bolt token "${r}" does not accept a value`);s="showThreads",a=r==="threads"}else throw Error(`Unknown hex socket bolt model token "${r}${String(i)}"`);if(s in o)throw Error(`Bolt property "${s}" is set more than once`);o[s]=a}return tun.parse({fn:"hexsocketbolt",...o})},_un=ku({name:"hexsocketbolt",schema:tun,parse:fMr});function yMr(e){e.register(_un)}var adn={m:"module",module:"module",w:"faceWidth",width:"faceWidth",facewidth:"faceWidth",bore:"boreDiameter",borediameter:"boreDiameter",backlash:"backlash",clearance:"clearance",hubdiameter:"hubDiameter",hublength:"hubLength"};function xMr(e){let t=e.string.split("_"),n=t[0]?.match(/^spurgear(\d+)?$/i);if(!n||e.fn!=="spurgear")throw Error("Expected spurgear with an optional inline tooth count");let o={fn:"spurgear"};if(n[1])o.toothCount=CY(n[1],"toothCount");for(let r of t.slice(1)){let[i,s]=cJ(r),a,c;if(i in adn)a=adn[i],c=s;else if(i==="teeth"||i==="segments")a=i==="teeth"?"toothCount":"segmentsPerTooth",c=CY(s,a);else if(i==="pa"||i==="pressureangle"||i==="phase")a=i==="phase"?"phase":"pressureAngle",c=eIe(s,a);else throw Error(`Unknown spur gear token "${r}"`);if(a in o)throw Error(`Spur gear property "${a}" is set more than once`);o[a]=c}return Kdn.parse(o)}var gun=ku({name:"spurgear",schema:Kdn,parse:xMr});function CMr(e){e.register(gun)}var Aun={module:b0.default(1),pitchDiameter:b0.default(10),length:b0.default(20),starts:ge().int().min(1).max(8).default(1),pressureAngle:Udn.default(20),backlash:pv.default(0),clearance:pv.default(0.25),boreDiameter:pv.default(0),handedness:bt(["right","left"]).default("right"),phase:ge().finite().default(0),radialSegments:ge().int().min(24).max(256).refine((e)=>e%4===0,"Radial segments must be divisible by four").default(96),segmentsPerTurn:ge().int().min(12).max(128).default(32)};function bMr(e){let t=Math.PI*e.module,n=e.starts*t;return{pitchDiameter:e.pitchDiameter,outsideDiameter:e.pitchDiameter+2*e.module,rootDiameter:e.pitchDiameter-2*(e.module+e.clearance),axialPitch:t,lead:n,leadAngle:Math.atan(n/(Math.PI*e.pitchDiameter))*180/Math.PI,toothThickness:t/2-e.backlash}}function fun(e,t){let n=(a,c)=>t.addIssue({code:"custom",message:a,path:c?[c]:[]}),o=bMr(e);if(Object.values(o).some((a)=>!Number.isFinite(a))){n("Derived worm dimensions must be finite");return}if(o.rootDiameter<=0){n("Dedendum must leave a positive root diameter","pitchDiameter");return}if(e.boreDiameter>=o.rootDiameter)n("Bore diameter must be smaller than the root diameter","boreDiameter");let r=Math.tan(e.pressureAngle*Math.PI/180),i=o.toothThickness-2*e.module*r,s=o.toothThickness+2*(e.module+e.clearance)*r;if(!Number.isFinite(i)||i<=0)n("Axial tooth tip must have positive thickness","backlash");if(!Number.isFinite(s)||s>=o.axialPitch)n("Adjacent threads must leave a positive root gap","pressureAngle")}var ljs=Ee(Aun).strict().superRefine(fun),yun=Ee({fn:ce("wormgear"),...Aun}).strict().superRefine(fun);var cdn={m:"module",module:"module",d:"pitchDiameter",pitchdiameter:"pitchDiameter",l:"length",length:"length",bore:"boreDiameter",borediameter:"boreDiameter",backlash:"backlash",clearance:"clearance"};function IMr(e){let t=e.string.split("_");if(t[0]?.toLowerCase()!=="wormgear"||e.fn!=="wormgear")throw Error("The wormgear function does not accept an inline value");let n={fn:"wormgear"};for(let o of t.slice(1)){let[r,i]=cJ(o),s,a;if(r in cdn)s=cdn[r],a=i;else if(["starts","segments","turnsegments"].includes(r))s=r==="starts"?"starts":r==="segments"?"radialSegments":"segmentsPerTurn",a=CY(i,s);else if(r==="pa"||r==="pressureangle"||r==="phase")s=r==="phase"?"phase":"pressureAngle",a=eIe(i,s);else if(r==="right"||r==="left"){if(i)throw Error(`Worm flag "${r}" does not accept a value`);s="handedness",a=r}else throw Error(`Unknown worm gear token "${o}"`);if(s in n)throw Error(`Worm gear property "${s}" is set more than once`);n[s]=a}return yun.parse(n)}var xun=ku({name:"wormgear",schema:yun,parse:IMr});function vMr(e){e.register(xun)}var Cun={"608":{innerDiameter:8,outerDiameter:22,width:7},"625":{innerDiameter:5,outerDiameter:16,width:5},"624":{innerDiameter:4,outerDiameter:13,width:5},"6000":{innerDiameter:10,outerDiameter:26,width:8},"6001":{innerDiameter:12,outerDiameter:28,width:8},"6002":{innerDiameter:15,outerDiameter:32,width:9}},SMr={innerDiameter:8,outerDiameter:22,width:7},PMr=bt(["608","625","624","6000","6001","6002"]),stt=an([ge(),k().regex(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:mm|cm|m|in|inch|mil|ft|feet)?$/i).transform((e)=>e.toLowerCase())]).pipe(rd).refine((e)=>e>0,"Length must be positive"),bun={innerDiameter:stt.optional(),outerDiameter:stt.optional(),width:stt.optional(),code:PMr.optional(),bothSidesOpen:Be().optional(),bothSidesShielded:Be().optional(),bothSidesSealed:Be().optional(),topSideOpen:Be().optional(),topSideShielded:Be().optional(),topSideSealed:Be().optional(),bottomSideOpen:Be().optional(),bottomSideShielded:Be().optional(),bottomSideSealed:Be().optional()};function Iun(e,t){let n=e.code===void 0?SMr:Cun[e.code],o=["Open","Shielded","Sealed"],r=o.filter((l)=>e[`bothSides${l}`]===!0);if(r.length>1)t.addIssue({code:"custom",message:"Both-side flags conflict"});let i=(l)=>{let h=o.filter((u)=>e[`${l}Side${u}`]===!0),d=o.some((u)=>e[`${l}Side${u}`]!==void 0);if(h.length>1||d&&h.length===0)t.addIssue({code:"custom",message:`${l} face must select exactly one flag`});return h[0]??r[0]??"Open"},s=i("top"),a=i("bottom"),c={innerDiameter:e.innerDiameter??n.innerDiameter,outerDiameter:e.outerDiameter??n.outerDiameter,width:e.width??n.width,topSideOpen:s==="Open",topSideShielded:s==="Shielded",topSideSealed:s==="Sealed",bottomSideOpen:a==="Open",bottomSideShielded:a==="Shielded",bottomSideSealed:a==="Sealed"};if(e.code!==void 0){for(let l of["innerDiameter","outerDiameter","width"])if(Math.abs(c[l]-n[l])>0.000000001)t.addIssue({code:"custom",path:[l],message:`Dimension conflicts with bearing designation ${e.code}`})}if(c.innerDiameter>=c.outerDiameter)t.addIssue({code:"custom",path:["innerDiameter"],message:"Inner diameter must be smaller than outer diameter"});return c}var djs=Ee(bun).strict().transform(Iun),vun=Ee({fn:ce("ballbearing"),...bun}).strict().transform((e,t)=>({fn:e.fn,...Iun(e,t)}));var ldn={id:"innerDiameter",innerdiameter:"innerDiameter",od:"outerDiameter",outerdiameter:"outerDiameter",w:"width",width:"width"},hdn={open:"bothSidesOpen",bothsidesopen:"bothSidesOpen",shielded:"bothSidesShielded",bothsidesshielded:"bothSidesShielded",sealed:"bothSidesSealed",bothsidessealed:"bothSidesSealed",topsideopen:"topSideOpen",topsideshielded:"topSideShielded",topsidesealed:"topSideSealed",bottomsideopen:"bottomSideOpen",bottomsideshielded:"bottomSideShielded",bottomsidesealed:"bottomSideSealed"},EMr=["","z","zz","2z","rs","2rs"];function Sun(e){let t=ep(e.string),n=t[0]?.toLowerCase()??"";if(e.fn!=="ballbearing")throw Error("Expected ballbearing");let o={fn:"ballbearing"},r="";if(n!=="ballbearing"){let s=n.slice(11),a=Object.keys(Cun).sort((c,l)=>l.length-c.length).find((c)=>s.startsWith(c)&&EMr.some((l)=>s===c+l));if(!n.startsWith("ballbearing")||!a)throw Error(`Unsupported ballbearing designation "${n}"`);o.code=a,r=s.slice(a.length)}let i=new Set;for(let s of t.slice(1)){let a=s.toLowerCase();if(Object.hasOwn(hdn,a)){let u=hdn[a],_=u.startsWith("both")?"both":u.startsWith("top")?"top":"bottom";if(i.has(_))throw Error(`ballbearing ${_} face flags are repeated or conflict`);i.add(_),o[u]=!0;continue}let c=s.match(/^([a-z]+)(.*)$/i);if(!c)throw Error(`Invalid ballbearing token "${s}"`);let l=c[1].toLowerCase(),h=c[2],d;if(Object.hasOwn(ldn,l))d=ldn[l];else if(l==="code"){if(d="code",!/^\d+$/.test(h))throw Error("Bearing code must be a complete numeric designation")}else throw Error(`Unknown ballbearing token "${s}"`);if(Object.hasOwn(o,d))throw Error(`ballbearing property "${d}" is set more than once`);o[d]=h}if(!i.has("both")){let s=r==="zz"||r==="2z"?"Shielded":r==="2rs"?"Sealed":"Open";if(o[`bothSides${s}`]=!0,!i.has("bottom")&&(r==="z"||r==="rs"))o[r==="z"?"bottomSideShielded":"bottomSideSealed"]=!0}return vun.parse(o)}function att(e){let t=String(e);if(!t.includes("e"))return t;let[n,o]=t.split("e"),[r,i=""]=n.split("."),s=r+i,a=r.length+Number(o);if(a<=0)return`0.${"0".repeat(-a)}${s}`;if(a>=s.length)return s+"0".repeat(a-s.length);return`${s.slice(0,a)}.${s.slice(a)}`}function MMr(e){let t=Sun(Z6e(e)),n=t.topSideOpen?"open":t.topSideShielded?"shielded":"sealed",o=t.bottomSideOpen?"open":t.bottomSideShielded?"shielded":"sealed",r=n===o?`bothsides${n}`:`topside${n}_bottomside${o}`;return`ballbearing_id${att(t.innerDiameter)}mm_od${att(t.outerDiameter)}mm_w${att(t.width)}mm_${r}`}var Pun=ku({name:"ballbearing",schema:vun,parse:Sun,normalizeString:MMr});function wMr(e){e.register(Pun)}var Eun={hexsocket:"drive(hexsocket)",fullthread:"thread(full)",righthanded:"threadhand(right)"},BMr=["righthanded"],Mun={M3:{diameter:3,threadPitch:0.5,headDiameter:5.7,headHeight:1.65,crownFlatDiameter:2.6,crownRadius:3.5,socketWidth:2,socketDepth:1.04,underHeadRadius:0.3,referenceThreadLength:18},M4:{diameter:4,threadPitch:0.7,headDiameter:7.6,headHeight:2.2,crownFlatDiameter:3.8,crownRadius:4.4,socketWidth:2.5,socketDepth:1.3,underHeadRadius:0.4,referenceThreadLength:20},M5:{diameter:5,threadPitch:0.8,headDiameter:9.5,headHeight:2.75,crownFlatDiameter:5,crownRadius:5.5,socketWidth:3,socketDepth:1.56,underHeadRadius:0.45,referenceThreadLength:22},M6:{diameter:6,threadPitch:1,headDiameter:10.5,headHeight:3.3,crownFlatDiameter:6,crownRadius:5.9,socketWidth:4,socketDepth:2.08,underHeadRadius:0.5,referenceThreadLength:24}},ddn=an([ge(),k().regex(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:mm|cm|m|in|inch|mil|ft|feet)?$/i).transform((e)=>e.toLowerCase())]).pipe(rd).refine((e)=>e>0,"Length must be positive"),TMr=bt(["M3","M4","M5","M6"]),wun={standard:bt(["iso7380-1","iso7380-1:2022"]).default("iso7380-1").transform(()=>"iso7380-1:2022"),metricSize:TMr,length:ddn,drive:ce("hexsocket").default("hexsocket"),thread:ce("full").default("full"),threadPitch:ddn.optional(),threadHand:ce("right").default("right"),threadClass:ce("6g").default("6g"),showThreads:Be().default(!0)};function Bun(e,t){let n=Mun[e.metricSize];if(e.threadPitch!==void 0&&Math.abs(e.threadPitch-n.threadPitch)>0.000000001)t.addIssue({code:"custom",path:["threadPitch"],message:"ISO 7380-1 requires the tabulated coarse pitch"});if(e.length>n.referenceThreadLength)t.addIssue({code:"custom",path:["length"],message:"This family supports only lengths at or below the reference full-thread length"});if(e.length<2*n.threadPitch)t.addIssue({code:"custom",path:["length"],message:"Length must allow the fixed thread runout and tip chamfer"})}function Tun(e){return{...e,threadPitch:Mun[e.metricSize].threadPitch}}var pjs=Ee(wun).strict().superRefine(Bun).transform(Tun),Dun=Ee({fn:ce("buttonscrew"),...wun}).strict().superRefine(Bun).transform(Tun);function udn(e){let t=ep(I1(e.string,Eun));if(e.fn!=="buttonscrew"||t[0]?.toLowerCase()!=="buttonscrew")throw Error("Expected buttonscrew without an inline argument");let n={fn:"buttonscrew"},o={l:"length",length:"length",threadpitch:"threadPitch"},r={standard:"standard",drive:"drive",thread:"thread",threadhand:"threadHand",threadclass:"threadClass"};for(let i of t.slice(1)){let s=i.match(/^([a-z]+)(.*)$/i);if(!s)throw Error(`Invalid button screw token "${i}"`);let a=s[1].toLowerCase(),c=s[2],l,h=c;if(a==="m")l="metricSize",h=`M${c}`;else if(a in o)l=o[a];else if(a in r){if(l=r[a],!/^\([^()]+\)$/.test(c))throw Error(`Expected a parenthesized ${a}`);h=c.slice(1,-1).toLowerCase()}else if(a==="threads"||a==="nothreads"){if(c)throw Error("Thread visibility flags cannot have a value");l="showThreads",h=a==="threads"}else throw Error(`Unknown button screw token "${i}"`);if(l in n)throw Error(`Duplicate button screw property "${l}"`);n[l]=h}return Dun.parse(n)}var Nun=ku({name:"buttonscrew",schema:Dun,parse:udn,normalizeString:(e)=>cx(e,Eun,udn,BMr)});function DMr(e){e.register(Nun)}var Run={symmetricring:"shape(symmetricring)"},NMr=[],sJ=an([ge(),k().regex(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:mm|cm|m|in|inch|mil|ft|feet)?$/i,"Expected a complete numeric length with an optional unit")]).pipe(Bs),Qun={panelHoleDiameter:sJ,innerDiameter:sJ,outerDiameter:sJ,height:sJ,grooveWidth:sJ,grooveDepth:sJ,shape:ce("symmetricring").default("symmetricring")};function kun(e,t){if(e.innerDiameter>=e.panelHoleDiameter||e.panelHoleDiameter>=e.outerDiameter)t.addIssue({code:"custom",path:["panelHoleDiameter"],message:"Diameters must satisfy ID < panel hole < OD"});if(e.grooveWidth>=e.height)t.addIssue({code:"custom",path:["grooveWidth"],message:"Groove width must leave two positive-thickness flanges"});let n=e.outerDiameter-2*e.grooveDepth,o=0.000000001*e.outerDiameter;if(!Number.isFinite(n)||Math.abs(n-e.panelHoleDiameter)>o)t.addIssue({code:"custom",path:["grooveDepth"],message:"Panel hole must equal OD minus twice the radial groove depth"});if((n-e.innerDiameter)/2<=0||(e.height-e.grooveWidth)/2<=0)t.addIssue({code:"custom",message:"Derived root wall and flange thicknesses must be positive"})}var _js=Ee(Qun).strict().superRefine(kun),Lun=Ee({fn:ce("cablegrommet"),...Qun}).strict().superRefine(kun);var pdn={panelhole:"panelHoleDiameter",panelholediameter:"panelHoleDiameter",id:"innerDiameter",innerdiameter:"innerDiameter",od:"outerDiameter",outerdiameter:"outerDiameter",h:"height",height:"height",groovew:"grooveWidth",groovewidth:"grooveWidth",grooved:"grooveDepth",groovedepth:"grooveDepth"};function mdn(e){let t=ep(I1(e.string,Run));if(e.fn!=="cablegrommet"||!/^cablegrommet$/i.test(t[0]))throw Error("Expected cablegrommet without an inline value");let n={fn:"cablegrommet"};for(let o of t.slice(1)){let r=o.match(/^([a-z]+)(.*)$/i),i=r?.[1]?.toLowerCase(),s=r?.[2];if(!i||!s)throw Error(`Invalid grommet token "${o}"`);let a,c=s;if(i in pdn)a=pdn[i];else if(i==="shape"){a="shape";let l=s.match(/^\(([a-z]+)\)$/i);if(!l)throw Error("Grommet shape requires parentheses");c=l[1].toLowerCase()}else throw Error(`Unknown grommet token "${o}"`);if(a in n)throw Error(`Grommet property "${a}" is set more than once`);n[a]=c}return Lun.parse(n)}var Hun=ku({name:"cablegrommet",schema:Lun,parse:mdn,normalizeString:(e)=>cx(e,Run,mdn,NMr)});function RMr(e){e.register(Hun)}var Fun={singleclamp:"mount(singleclamp)",lefthanded:"threadhand(left)",righthanded:"threadhand(right)"},QMr=["righthanded"],zun=an([ge().finite(),k().regex(/^[+]?(?:\d+(?:\.\d*)?|\.\d+)(?:mm|cm|m|in|inch|mil|ft|feet)?$/i,"Expected a complete length with a supported unit").transform((e)=>e.toLowerCase())]).pipe(rd),_k=zun.refine((e)=>e>0,"Length must be positive"),kMr=zun.refine((e)=>e>=0,"Length cannot be negative"),Oun={boreDiameter:_k,outerDiameter:_k,width:_k,screwZ:_k.optional(),splitWidth:_k,clampX:_k.optional(),clearanceHoleDiameter:_k.optional(),mount:ce("singleclamp").default("singleclamp"),metricSize:Che,threadPitch:_k.optional(),threadHand:bt(["right","left"]).default("right"),threadClass:ce("6H").default("6H"),chamfer:kMr.default(0)};function mtt(e){let t=LB[e.metricSize].diameter,n=e.threadPitch??LB[e.metricSize].threadPitch;return{...e,threadPitch:n,screwZ:e.screwZ??e.width/2,clampX:e.clampX??(e.outerDiameter+e.boreDiameter)/4,clearanceHoleDiameter:e.clearanceHoleDiameter??t+0.5}}function Vun(e,t){let n=mtt(e),o=(c)=>t.addIssue({code:"custom",message:c}),r=LB[n.metricSize].diameter;if(!Number.isFinite(n.outerDiameter**2))o("Derived dimensions must be finite");let i=(n.outerDiameter-n.boreDiameter)/2;if(i<=0)o("Outer diameter must exceed the bore diameter");if(n.threadPitch>=r)o("Thread pitch must be smaller than its nominal diameter");if(n.splitWidth>=n.boreDiameter)o("Split width must be smaller than the shaft bore");if(n.clearanceHoleDiameter<=r)o("Clearance hole diameter must exceed the thread diameter");let s=n.clearanceHoleDiameter/2;if(n.clampX-s<=n.boreDiameter/2||n.clampX+s>=n.outerDiameter/2)o("Clamp hole must fit within the radial wall without intersecting the shaft bore");if(n.screwZ-s<=n.chamfer||n.screwZ+s>=n.width-n.chamfer)o("Clamp hole must clear both end faces and chamfers");if(n.chamfer>=i/2||n.chamfer>=n.width/2)o("Chamfer must leave material between the bore and exterior");let a=n.outerDiameter/2;if(n.clampX+s<a&&n.splitWidth/2>=Math.sqrt(a**2-(n.clampX+s)**2))o("Split must leave material around both sides of the clamping bore")}var Ajs=Ee(Oun).strict().superRefine(Vun).transform(mtt),Yun=Ee({fn:ce("clampingshaftcollar"),...Oun}).strict().superRefine(Vun).transform((e)=>({fn:e.fn,...mtt(e)}));var LMr={bore:"boreDiameter",od:"outerDiameter",mount:"mount",m:"metricSize",threadpitch:"threadPitch",threadhand:"threadHand",threadclass:"threadClass",chamfer:"chamfer",w:"width",width:"width",screwz:"screwZ",split:"splitWidth",clampx:"clampX",clearance:"clearanceHoleDiameter"};function _dn(e){let t=ep(I1(e.string,Fun));if(e.fn!=="clampingshaftcollar"||t[0]?.toLowerCase()!=="clampingshaftcollar")throw Error("Expected an unadorned clampingshaftcollar function");let n={};for(let o of t.slice(1)){let r=o.match(/^([a-z]+)(.*)$/i),i=r?.[1]?.toLowerCase()??"",s=LMr[i];if(!s)throw Error(`Unknown clampingshaftcollar token "${o}"`);if(s in n)throw Error(`Duplicate clampingshaftcollar property "${s}"`);let a=r[2];if(!a)throw Error(`Token "${i}" requires a value`);if(["mount","threadHand","threadClass"].includes(s)){let c=a.match(/^\(([^()]+)\)$/);if(!c)throw Error(`Token "${i}" requires one parenthesized argument`);n[s]=s==="threadClass"?c[1].toUpperCase():c[1].toLowerCase()}else if(s==="metricSize"){if(!/^\d+(?:\.\d+)?$/.test(a))throw Error("m requires a unitless metric designation");n[s]=`M${a}`}else n[s]=a}return Yun.parse({fn:"clampingshaftcollar",...n})}var Gun=ku({name:"clampingshaftcollar",schema:Yun,parse:_dn,normalizeString:(e)=>cx(e,Fun,_dn,QMr)});function HMr(e){e.register(Gun)}var Uun={closedground:"ends(closedground)",lefthanded:"hand(left)",righthanded:"hand(right)",custom:"spec(custom)",free:"state(free)"},FMr=["righthanded","custom","free"],ctt=an([ge(),k().regex(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:mm|cm|m|in|inch|mil|ft|feet)?$/i).transform((e)=>e.toLowerCase())]).pipe(rd).refine((e)=>e>0,"Length must be positive"),gdn=ge().int().min(1).max(Number.MAX_SAFE_INTEGER),Wun={spec:ce("custom").default("custom"),outerDiameter:ctt,wireDiameter:ctt,freeLength:ctt,totalTurns:gdn.min(3),activeTurns:gdn.optional(),ends:ce("closedground").default("closedground"),hand:bt(["right","left"]).default("right"),state:ce("free").default("free")};function Xun(e,t){if(e.outerDiameter<=2*e.wireDiameter)t.addIssue({code:"custom",path:["outerDiameter"],message:"Outer diameter must exceed twice the wire diameter to leave a positive bore"});if(e.activeTurns!==void 0&&e.activeTurns!==e.totalTurns-2)t.addIssue({code:"custom",path:["activeTurns"],message:"Closed-ground ends require totalTurns = activeTurns + 2"});let n=e.totalTurns*e.wireDiameter;if(!Number.isFinite(n)||e.freeLength<=n)t.addIssue({code:"custom",path:["freeLength"],message:"Free length must exceed the finite solid height totalTurns * wireDiameter"})}function jun(e){return{...e,activeTurns:e.activeTurns??e.totalTurns-2}}var yjs=Ee(Wun).strict().superRefine(Xun).transform(jun),Kun=Ee({fn:ce("compressionspring"),...Wun}).strict().superRefine(Xun).transform(jun);function Adn(e){let t=ep(I1(e.string,Uun));if(e.fn!=="compressionspring"||t[0]?.toLowerCase()!=="compressionspring")throw Error("Expected compressionspring without an inline argument");let n={fn:"compressionspring"},o={od:"outerDiameter",wire:"wireDiameter",l:"freeLength",length:"freeLength",freelength:"freeLength"},r={spec:"spec",ends:"ends",hand:"hand",state:"state"};for(let i of t.slice(1)){let s=i.match(/^([a-z]+)(.*)$/i);if(!s)throw Error(`Invalid compression spring token "${i}"`);let a=s[1].toLowerCase(),c=s[2],l,h=c;if(a in o)l=o[a];else if(a==="turns"||a==="active"){if(l=a==="turns"?"totalTurns":"activeTurns",!/^\d+$/.test(c))throw Error(`${a} requires a unitless integer`);h=Number(c)}else if(a in r){if(l=r[a],!/^\([^()]+\)$/.test(c))throw Error(`Expected a parenthesized ${a}`);h=c.slice(1,-1).toLowerCase()}else throw Error(`Unknown compression spring token "${i}"`);if(l in n)throw Error(`Duplicate compression spring property "${l}"`);n[l]=h}return Kun.parse(n)}var $un=ku({name:"compressionspring",schema:Kun,parse:Adn,normalizeString:(e)=>cx(e,Uun,Adn,FMr)});function zMr(e){e.register($un)}var qun={plainclosed:"style(plainclosed)"},OMr=["plainclosed"],fhe=an([ge(),k().regex(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:mm|cm|m|in|inch|mil|ft|feet)?$/i).transform((e)=>e.toLowerCase())]).pipe(rd).refine((e)=>e>0),Jun={innerDiameter:fhe,outerDiameter:fhe,flangeDiameter:fhe,length:fhe,flangeThickness:fhe,style:ce("plainclosed").default("plainclosed")};function Zun(e,t){if(e.outerDiameter<=e.innerDiameter)t.addIssue({code:"custom",path:["outerDiameter"],message:"Sleeve outside diameter must exceed the bore diameter"});if(e.flangeDiameter<=e.outerDiameter)t.addIssue({code:"custom",path:["flangeDiameter"],message:"Flange diameter must exceed the sleeve outside diameter"});if(e.flangeThickness>=e.length)t.addIssue({code:"custom",path:["flangeThickness"],message:"Flange thickness must leave a positive projecting sleeve length"})}var Cjs=Ee(Jun).strict().superRefine(Zun),e0n=Ee({fn:ce("flangedbushing"),...Jun}).strict().superRefine(Zun);var fdn={id:"innerDiameter",innerdiameter:"innerDiameter",od:"outerDiameter",outerdiameter:"outerDiameter",flangeod:"flangeDiameter",flangediameter:"flangeDiameter",l:"length",length:"length",flangethickness:"flangeThickness"};function ydn(e){let t=ep(I1(e.string,qun));if(e.fn!=="flangedbushing"||t[0]?.toLowerCase()!=="flangedbushing")throw Error("Expected flangedbushing without an inline value");let n={fn:"flangedbushing"};for(let o of t.slice(1)){let r=o.match(/^([a-z]+)(.*)$/i);if(!r)throw Error(`Invalid flanged bushing token "${o}"`);let i=r[1].toLowerCase(),s=r[2],a,c;if(Object.hasOwn(fdn,i))a=fdn[i],c=s;else if(i==="style"){a="style";let l=s.match(/^\(([a-z]+)\)$/i);if(!l)throw Error("Style requires a parenthesized value");c=l[1].toLowerCase()}else throw Error(`Unknown flanged bushing token "${o}"`);if(Object.hasOwn(n,a))throw Error(`Flanged bushing property "${a}" is set more than once`);n[a]=c}return e0n.parse(n)}var t0n=ku({name:"flangedbushing",schema:e0n,parse:ydn,normalizeString:(e)=>cx(e,qun,ydn,OMr)});function VMr(e){e.register(t0n)}var n0n={hexsocket:"drive(hexsocket)",fullthread:"thread(full)",lefthanded:"threadhand(left)",righthanded:"threadhand(right)",male:"threadgender(male)"},YMr=["righthanded","male"],u6=an([ge(),k().regex(/^(?:\d+(?:\.\d+)?|\.\d+)(?:mm|cm|m|in|inch)?$/i).transform((e)=>e.toLowerCase())]).pipe(rd).refine((e)=>e>0,"Length must be positive"),_tt={M3:{diameter:3,threadPitch:0.5,headDiameter:6.72,headHeight:1.86,socketAcrossFlats:2,socketDepth:1.1,underHeadRadius:0.1,maximumThreadLength:18,headAngle:90,tipChamferAngle:45,threadFlankAngle:60,tipChamfer:0.25,threadRootDiameter:2.3865653389860224,threadPitchDiameter:2.6752404735808355},M4:{diameter:4,threadPitch:0.7,headDiameter:8.96,headHeight:2.48,socketAcrossFlats:2.5,socketDepth:1.5,underHeadRadius:0.2,maximumThreadLength:20,headAngle:90,tipChamferAngle:45,threadFlankAngle:60,tipChamfer:0.35,threadRootDiameter:3.141191474580432,threadPitchDiameter:3.5453366630131695},M5:{diameter:5,threadPitch:0.8,headDiameter:11.2,headHeight:3.1,socketAcrossFlats:3,socketDepth:1.9,underHeadRadius:0.2,maximumThreadLength:22,headAngle:90,tipChamferAngle:45,threadFlankAngle:60,tipChamfer:0.4,threadRootDiameter:4.018504542377636,threadPitchDiameter:4.480384757729337},M6:{diameter:6,threadPitch:1,headDiameter:13.44,headHeight:3.72,socketAcrossFlats:4,socketDepth:2.2,underHeadRadius:0.25,maximumThreadLength:24,headAngle:90,tipChamferAngle:45,threadFlankAngle:60,tipChamfer:0.5,threadRootDiameter:4.773130677972045,threadPitchDiameter:5.350480947161671}},GMr=bt(["M3","M4","M5","M6"]),UMr=bt(["iso10642","iso10642:2019"]).default("iso10642").transform(()=>"iso10642:2019"),o0n={standard:UMr,metricSize:GMr,length:u6,thread:ce("full").default("full"),drive:ce("hexsocket").default("hexsocket"),threadHand:bt(["right","left"]).default("right"),threadClass:ce("6g").default("6g"),threadGender:ce("male").default("male"),showThreads:Be().default(!0),diameter:u6.optional(),threadPitch:u6.optional(),headDiameter:u6.optional(),headHeight:u6.optional(),socketAcrossFlats:u6.optional(),socketDepth:u6.optional(),underHeadRadius:u6.optional(),maximumThreadLength:u6.optional(),headAngle:ge().finite().positive().optional(),tipChamferAngle:ge().finite().positive().optional(),threadFlankAngle:ge().finite().positive().optional(),tipChamfer:u6.optional(),threadRootDiameter:u6.optional(),threadPitchDiameter:u6.optional()},r0n=(e,t)=>{let n=_tt[e.metricSize];for(let o of Object.keys(n))if(e[o]!==void 0&&Math.abs(e[o]-n[o])>0.000000001)t.addIssue({code:"custom",path:[o],message:`Dimension ${o} contradicts ${e.standard} ${e.metricSize}`});if(e.length<=n.tipChamfer)t.addIssue({code:"custom",path:["length"],message:"Length must exceed the fixed tip chamfer"});if(e.length<=n.headHeight+n.underHeadRadius+n.tipChamfer)t.addIssue({code:"custom",path:["length"],message:"Overall length must leave a shank beyond the countersunk head, under-head fillet and tip chamfer"});if(e.length-n.headHeight>n.maximumThreadLength+0.000000001)t.addIssue({code:"custom",path:["length"],message:"This contract supports full-thread screws only; length exceeds the pinned thread-length range"})},Ijs=Ee(o0n).strict().superRefine(r0n).transform((e)=>({...e,..._tt[e.metricSize]})),i0n=Ee({fn:ce("flatheadscrew"),...o0n}).strict().superRefine(r0n).transform((e)=>({...e,..._tt[e.metricSize]})),WMr={m:"metricSize",metricsize:"metricSize",l:"length",length:"length",standard:"standard",thread:"thread",drive:"drive",threadhand:"threadHand",threadclass:"threadClass",threadgender:"threadGender",diameter:"diameter",threadpitch:"threadPitch",headdiameter:"headDiameter",headheight:"headHeight",socketacrossflats:"socketAcrossFlats",socketdepth:"socketDepth",underheadradius:"underHeadRadius",maximumthreadlength:"maximumThreadLength",headangle:"headAngle",tipchamferangle:"tipChamferAngle",threadflankangle:"threadFlankAngle",tipchamfer:"tipChamfer",threadrootdiameter:"threadRootDiameter",threadpitchdiameter:"threadPitchDiameter",d:"diameter",headh:"headHeight",headd:"headDiameter",socketaf:"socketAcrossFlats",socketh:"socketDepth"},XMr=new Set(["standard","thread","drive","threadHand","threadClass","threadGender"]),xdn=(e)=>{if(e.fn!=="flatheadscrew")throw Error(`Expected flatheadscrew params, got "${e.fn}"`);let[t,...n]=ep(I1(e.string,n0n));if(t?.toLowerCase()!=="flatheadscrew")throw Error("The flatheadscrew function does not accept an inline value");let o={};for(let r of n){let i=r.match(/^([a-z]+)(.*)$/i),s=i?.[1]?.toLowerCase(),a=i?.[2],c,l;if(s==="threads"||s==="nothreads"){if(a!=="")throw Error(`Token "${s}" does not accept a value`);c="showThreads",l=s==="threads"}else{if(c=s?WMr[s]??"":"",!c||!a)throw Error(`Unknown or missing flatheadscrew token "${r}"`);if(XMr.has(c)){let h=a.match(/^\(([^()]+)\)$/)?.[1];if(!h)throw Error(`Token "${s}" requires a parenthesized selector`);l=h.toLowerCase()}else if(c==="metricSize"){let h=s==="m"?a:a.match(/^\((m\d+)\)$/i)?.[1]?.slice(1);if(!h||!/^\d+$/.test(h))throw Error("Invalid metric size");l=`M${h}`}else{if(!/^(?:\d+(?:\.\d+)?|\.\d+)(?:mm|cm|m|in|inch)?$/i.test(a))throw Error(`Invalid dimension token "${r}"`);l=["headAngle","tipChamferAngle","threadFlankAngle"].includes(c)?Number(a):a}}if(c in o)throw Error(`Property "${c}" is set more than once`);o[c]=l}return i0n.parse({fn:"flatheadscrew",...o})},s0n=ku({name:"flatheadscrew",schema:i0n,parse:xdn,normalizeString:(e)=>cx(e,n0n,xdn,YMr)});function jMr(e){e.register(s0n)}var a0n={righthanded:"threadhand(right)"},KMr=["righthanded"],c0n={M5:{diameter:5,threadPitch:0.8,acrossFlats:8,height:4.7,mouthDiameter:5.75},M6:{diameter:6,threadPitch:1,acrossFlats:10,height:5.2,mouthDiameter:6.75},M8:{diameter:8,threadPitch:1.25,acrossFlats:13,height:6.8,mouthDiameter:8.75},M10:{diameter:10,threadPitch:1.5,acrossFlats:16,height:8.4,mouthDiameter:10.8},M12:{diameter:12,threadPitch:1.75,acrossFlats:18,height:10.8,mouthDiameter:12.96}},$Mr=bt(["M5","M6","M8","M10","M12"]),qMr=an([ge(),k().regex(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:mm|cm|m|in|inch|mil|ft|feet)?$/i).transform((e)=>e.toLowerCase())]).pipe(rd).refine((e)=>e>0,"Length must be positive"),l0n={standard:bt(["iso4032","iso4032:2023"]).default("iso4032").transform(()=>"iso4032:2023"),metricSize:$Mr,threadPitch:qMr.optional(),threadHand:ce("right").default("right"),threadClass:ce("6H").default("6H"),showThreads:Be().default(!0)};function h0n(e,t){if(e.threadPitch!==void 0&&Math.abs(e.threadPitch-c0n[e.metricSize].threadPitch)>0.000000001)t.addIssue({code:"custom",path:["threadPitch"],message:"ISO 4032 requires the tabulated coarse pitch"})}function d0n(e){return{...e,threadPitch:c0n[e.metricSize].threadPitch}}var Sjs=Ee(l0n).strict().superRefine(h0n).transform(d0n),u0n=Ee({fn:ce("hexnut"),...l0n}).strict().superRefine(h0n).transform(d0n);function Cdn(e){let t=ep(I1(e.string,a0n));if(e.fn!=="hexnut"||t[0]?.toLowerCase()!=="hexnut")throw Error("Expected hexnut without an inline argument");let n={fn:"hexnut"},o={standard:"standard",threadhand:"threadHand",threadclass:"threadClass"};for(let r of t.slice(1)){let i=r.match(/^([a-z]+)(.*)$/i);if(!i)throw Error(`Invalid hex nut token "${r}"`);let s=i[1].toLowerCase(),a=i[2],c,l=a;if(s==="m")c="metricSize",l=`M${a}`;else if(s==="threadpitch")c="threadPitch";else if(s in o){if(c=o[s],!/^\([^()]+\)$/.test(a))throw Error(`Expected a parenthesized ${s}`);if(l=a.slice(1,-1).toLowerCase(),c==="threadClass"&&l==="6h")l="6H"}else if(s==="threads"||s==="nothreads"){if(a)throw Error("Thread visibility flags cannot have a value");c="showThreads",l=s==="threads"}else throw Error(`Unknown hex nut token "${r}"`);if(c in n)throw Error(`Duplicate hex nut property "${c}"`);n[c]=l}return u0n.parse(n)}var p0n=ku({name:"hexnut",schema:u0n,parse:Cdn,normalizeString:(e)=>cx(e,a0n,Cdn,KMr)});function JMr(e){e.register(p0n)}var m0n=an([ge(),k().regex(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:mm|cm|m|in|inch|mil|ft|feet)?$/i).transform((e)=>e.toLowerCase())]).pipe(rd),J6e=m0n.refine((e)=>e>0,"Length must be positive"),ltt=m0n.refine((e)=>e>=0,"Length cannot be negative"),_0n={outerDiameter:J6e.default(6),innerDiameter:J6e.default(4),startLength:ltt.default(38),endLength:ltt.default(112),bendRadius:J6e.default(60),bendAngle:ge().finite().min(0).max(180).default(90),ribPitch:J6e.default(2.25),ribDepth:ltt.default(0.25)};function g0n(e,t){if(e.outerDiameter-2*e.ribDepth<=e.innerDiameter)t.addIssue({code:"custom",path:["ribDepth"],message:"Rib roots must leave a positive wall outside the bore"});if(e.bendAngle>0&&e.bendRadius<=e.outerDiameter/2)t.addIssue({code:"custom",path:["bendRadius"],message:"Bend radius must exceed half the outside diameter"});let n=e.startLength+e.bendRadius*(e.bendAngle*Math.PI/180)+e.endLength;if(!Number.isFinite(n)||n<=0)t.addIssue({code:"custom",message:"Centerline length must be finite and positive"})}var Ejs=Ee(_0n).strict().superRefine(g0n),A0n=Ee({fn:ce("hollowpositioningarmtube"),..._0n}).strict().superRefine(g0n);var bdn={od:"outerDiameter",id:"innerDiameter",start:"startLength",end:"endLength",radius:"bendRadius",pitch:"ribPitch",depth:"ribDepth"};function ZMr(e){let t=ep(e.string);if(e.fn!=="hollowpositioningarmtube"||!/^hollowpositioningarmtube$/i.test(t[0]))throw Error("Expected hollowpositioningarmtube without an inline value");let n={fn:"hollowpositioningarmtube"};for(let o of t.slice(1)){let r=o.match(/^([a-z]+)(.*)$/i),i=r?.[1]?.toLowerCase(),s=r?.[2];if(!i||!s)throw Error(`Invalid hollowpositioningarmtube token "${o}"`);let a,c=s;if(i in bdn)a=bdn[i];else if(i==="angle"){if(a="bendAngle",!/^[+]?(?:\d+(?:\.\d*)?|\.\d+)$/.test(s))throw Error("Hollow positioning arm tube angle requires a unitless degree value");c=Number(s)}else throw Error(`Unknown hollowpositioningarmtube token "${o}"`);if(a in n)throw Error(`Duplicate hollowpositioningarmtube property "${a}"`);n[a]=c}return A0n.parse(n)}var f0n=ku({name:"hollowpositioningarmtube",schema:A0n,parse:ZMr});function ewr(e){e.register(f0n)}var y0n={phillips:"drive(phillips)",fullthread:"thread(full)",lefthanded:"threadhand(left)",righthanded:"threadhand(right)",male:"threadgender(male)"},twr=["righthanded","male"],L_=an([ge(),k().regex(/^(?:\d+(?:\.\d+)?|\.\d+)(?:mm|cm|m|in|inch)?$/i).transform((e)=>e.toLowerCase())]).pipe(rd).refine((e)=>e>0,"Length must be positive"),gtt={M3:{diameter:3,threadPitch:0.5,headDiameter:5.6,headHeight:2.4,crownRadius:5,underHeadRadius:0.1,recessNumber:1,recessReferenceDiameter:3,recessPenetration:1.4,maximumThreadLength:25,tipChamferAngle:45,threadFlankAngle:60,tipChamfer:0.25,threadRootDiameter:2.3865653389860224,threadPitchDiameter:2.6752404735808355,recessB:0.97,recessE:0.435,recessG:1.27,recessF:0.535,recessRadius:0.5,recessT1:0.34,recessAlpha:138,recessBeta:7,recessOuterWingAngle:26.5,recessInnerWingAngle:28,recessReferencePlaneHeight:2.169696007084728},M4:{diameter:4,threadPitch:0.7,headDiameter:8,headHeight:3.1,crownRadius:6.5,underHeadRadius:0.2,recessNumber:2,recessReferenceDiameter:4.4,recessPenetration:1.9,maximumThreadLength:38,tipChamferAngle:45,threadFlankAngle:60,tipChamfer:0.35,threadRootDiameter:3.141191474580432,threadPitchDiameter:3.5453366630131695,recessB:1.47,recessE:0.815,recessG:2.29,recessF:0.7,recessRadius:0.6,recessT1:0.61,recessAlpha:140,recessBeta:5.75,recessOuterWingAngle:26.5,recessInnerWingAngle:28,recessReferencePlaneHeight:2.7163714733492106},M5:{diameter:5,threadPitch:0.8,headDiameter:9.5,headHeight:3.7,crownRadius:8,underHeadRadius:0.2,recessNumber:2,recessReferenceDiameter:4.9,recessPenetration:2.4,maximumThreadLength:38,tipChamferAngle:45,threadFlankAngle:60,tipChamfer:0.4,threadRootDiameter:4.018504542377636,threadPitchDiameter:4.480384757729337,recessB:1.47,recessE:0.815,recessG:2.29,recessF:0.7,recessRadius:0.6,recessT1:0.61,recessAlpha:140,recessBeta:5.75,recessOuterWingAngle:26.5,recessInnerWingAngle:28,recessReferencePlaneHeight:3.315608971054121},M6:{diameter:6,threadPitch:1,headDiameter:12,headHeight:4.6,crownRadius:10,underHeadRadius:0.25,recessNumber:3,recessReferenceDiameter:6.9,recessPenetration:3.1,maximumThreadLength:38,tipChamferAngle:45,threadFlankAngle:60,tipChamfer:0.5,threadRootDiameter:4.773130677972045,threadPitchDiameter:5.350480947161671,recessB:2.41,recessE:2.005,recessG:3.81,recessF:0.825,recessRadius:0.8,recessT1:1.01,recessAlpha:146,recessBeta:5.75,recessOuterWingAngle:26.5,recessInnerWingAngle:28,recessReferencePlaneHeight:3.986026848459362}},nwr=bt(["M3","M4","M5","M6"]),owr=bt(["iso7045","iso7045:2011"]).default("iso7045").transform(()=>"iso7045:2011"),x0n={standard:owr,metricSize:nwr,length:L_,thread:ce("full").default("full"),drive:ce("phillips").default("phillips"),threadHand:bt(["right","left"]).default("right"),threadClass:ce("6g").default("6g"),threadGender:ce("male").default("male"),showThreads:Be().default(!0),recessStandard:ce("iso4757:1983").default("iso4757:1983"),recessType:ce("H").default("H"),diameter:L_.optional(),threadPitch:L_.optional(),headDiameter:L_.optional(),headHeight:L_.optional(),crownRadius:L_.optional(),underHeadRadius:L_.optional(),recessNumber:ge().finite().positive().optional(),recessReferenceDiameter:L_.optional(),recessPenetration:L_.optional(),maximumThreadLength:L_.optional(),tipChamferAngle:ge().finite().positive().optional(),threadFlankAngle:ge().finite().positive().optional(),tipChamfer:L_.optional(),threadRootDiameter:L_.optional(),threadPitchDiameter:L_.optional(),recessB:L_.optional(),recessE:L_.optional(),recessG:L_.optional(),recessF:L_.optional(),recessRadius:L_.optional(),recessT1:L_.optional(),recessAlpha:ge().finite().positive().optional(),recessBeta:ge().finite().positive().optional(),recessOuterWingAngle:ge().finite().positive().optional(),recessInnerWingAngle:ge().finite().positive().optional(),recessReferencePlaneHeight:L_.optional()},C0n=(e,t)=>{let n=gtt[e.metricSize];for(let o of Object.keys(n))if(e[o]!==void 0&&Math.abs(e[o]-n[o])>0.000000001)t.addIssue({code:"custom",path:[o],message:`Dimension ${o} contradicts ${e.standard} ${e.metricSize}`});if(e.length<=n.underHeadRadius+n.tipChamfer)t.addIssue({code:"custom",path:["length"],message:"Length must separate the under-head fillet and fixed tip chamfer"});if(e.length>n.maximumThreadLength+0.000000001)t.addIssue({code:"custom",path:["length"],message:"This contract supports full-thread screws only; length exceeds the pinned thread-length range"})},wjs=Ee(x0n).strict().superRefine(C0n).transform((e)=>({...e,...gtt[e.metricSize]})),b0n=Ee({fn:ce("panscrew"),...x0n}).strict().superRefine(C0n).transform((e)=>({...e,...gtt[e.metricSize]})),rwr={m:"metricSize",metricsize:"metricSize",l:"length",length:"length",standard:"standard",thread:"thread",drive:"drive",threadhand:"threadHand",threadclass:"threadClass",threadgender:"threadGender",diameter:"diameter",threadpitch:"threadPitch",headdiameter:"headDiameter",headheight:"headHeight",crownradius:"crownRadius",underheadradius:"underHeadRadius",recessnumber:"recessNumber",recessreferencediameter:"recessReferenceDiameter",recesspenetration:"recessPenetration",maximumthreadlength:"maximumThreadLength",tipchamferangle:"tipChamferAngle",threadflankangle:"threadFlankAngle",tipchamfer:"tipChamfer",threadrootdiameter:"threadRootDiameter",threadpitchdiameter:"threadPitchDiameter",recessb:"recessB",recesse:"recessE",recessg:"recessG",recessf:"recessF",recessradius:"recessRadius",recesst1:"recessT1",recessalpha:"recessAlpha",recessbeta:"recessBeta",recessouterwingangle:"recessOuterWingAngle",recessinnerwingangle:"recessInnerWingAngle",recessreferenceplaneheight:"recessReferencePlaneHeight",d:"diameter",headh:"headHeight",headd:"headDiameter"},iwr=new Set(["standard","thread","drive","threadHand","threadClass","threadGender"]),Idn=(e)=>{if(e.fn!=="panscrew")throw Error(`Expected panscrew params, got "${e.fn}"`);let[t,...n]=ep(I1(e.string,y0n));if(t?.toLowerCase()!=="panscrew")throw Error("The panscrew function does not accept an inline value");let o={};for(let r of n){let i=r.match(/^(recesst1)(.*)$/i)??r.match(/^([a-z]+)(.*)$/i),s=i?.[1]?.toLowerCase(),a=i?.[2],c,l;if(s==="threads"||s==="nothreads"){if(a!=="")throw Error(`Token "${s}" does not accept a value`);c="showThreads",l=s==="threads"}else{if(c=s?rwr[s]??"":"",!c||!a)throw Error(`Unknown or missing panscrew token "${r}"`);if(iwr.has(c)){let h=a.match(/^\(([^()]+)\)$/)?.[1];if(!h)throw Error(`Token "${s}" requires a parenthesized selector`);l=h.toLowerCase()}else if(c==="metricSize"){let h=s==="m"?a:a.match(/^\((m\d+)\)$/i)?.[1]?.slice(1);if(!h||!/^\d+$/.test(h))throw Error("Invalid metric size");l=`M${h}`}else{if(!/^(?:\d+(?:\.\d+)?|\.\d+)(?:mm|cm|m|in|inch)?$/i.test(a))throw Error(`Invalid dimension token "${r}"`);l=["recessNumber","tipChamferAngle","threadFlankAngle","recessAlpha","recessBeta","recessOuterWingAngle","recessInnerWingAngle"].includes(c)?Number(a):a}}if(c in o)throw Error(`Property "${c}" is set more than once`);o[c]=l}return b0n.parse({fn:"panscrew",...o})},I0n=ku({name:"panscrew",schema:b0n,parse:Idn,normalizeString:(e)=>cx(e,y0n,Idn,twr)});function swr(e){e.register(I0n)}var v0n={plainclosed:"style(plainclosed)"},awr=["plainclosed"],S0n=an([ge(),k().regex(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:mm|cm|m|in|inch|mil|ft|feet)?$/i).transform((e)=>e.toLowerCase())]).pipe(rd),htt=S0n.refine((e)=>e>0),P0n={innerDiameter:htt,outerDiameter:htt,length:htt,style:ce("plainclosed").default("plainclosed"),edgeChamfer:S0n.refine((e)=>e>=0).default(0)};function E0n(e,t){if(e.outerDiameter<=e.innerDiameter)t.addIssue({code:"custom",path:["outerDiameter"],message:"Outside diameter must exceed the bore diameter"});else if(e.edgeChamfer>=(e.outerDiameter-e.innerDiameter)/4)t.addIssue({code:"custom",path:["edgeChamfer"],message:"Inner and outer rim chamfers must leave an annular end face"});if(e.edgeChamfer>=e.length/2)t.addIssue({code:"custom",path:["edgeChamfer"],message:"The two end chamfers must leave positive straight bore length"})}var Tjs=Ee(P0n).strict().superRefine(E0n),M0n=Ee({fn:ce("plainbushing"),...P0n}).strict().superRefine(E0n);var vdn={id:"innerDiameter",innerdiameter:"innerDiameter",od:"outerDiameter",outerdiameter:"outerDiameter",l:"length",length:"length",edgechamfer:"edgeChamfer"};function Sdn(e){let t=ep(I1(e.string,v0n));if(e.fn!=="plainbushing"||t[0]?.toLowerCase()!=="plainbushing")throw Error("Expected plainbushing without an inline value");let n={fn:"plainbushing"};for(let o of t.slice(1)){let r=o.match(/^([a-z]+)(.*)$/i);if(!r)throw Error(`Invalid plain bushing token "${o}"`);let i=r[1].toLowerCase(),s=r[2],a,c;if(Object.hasOwn(vdn,i))a=vdn[i],c=s;else if(i==="style"){a="style";let l=s.match(/^\(([a-z]+)\)$/i);if(!l)throw Error("Style requires a parenthesized value");c=l[1].toLowerCase()}else throw Error(`Unknown plain bushing token "${o}"`);if(Object.hasOwn(n,a))throw Error(`Plain bushing property "${a}" is set more than once`);n[a]=c}return M0n.parse(n)}var w0n=ku({name:"plainbushing",schema:M0n,parse:Sdn,normalizeString:(e)=>cx(e,v0n,Sdn,awr)});function cwr(e){e.register(w0n)}var B0n={setscrew:"mount(setscrew)",lefthanded:"threadhand(left)",righthanded:"threadhand(right)"},lwr=["righthanded"],T0n=an([ge().finite(),k().regex(/^[+]?(?:\d+(?:\.\d*)?|\.\d+)(?:mm|cm|m|in|inch|mil|ft|feet)?$/i,"Expected a complete length with a supported unit").transform((e)=>e.toLowerCase())]).pipe(rd),aJ=T0n.refine((e)=>e>0,"Length must be positive"),hwr=T0n.refine((e)=>e>=0,"Length cannot be negative"),D0n={boreDiameter:aJ,outerDiameter:aJ,boreBDiameter:aJ.optional(),length:aJ,screwCount:ce(4).default(4),screwEndOffset:aJ.optional(),screwAngle:ge().finite().default(0),mount:ce("setscrew").default("setscrew"),metricSize:Che,threadPitch:aJ.optional(),threadHand:bt(["right","left"]).default("right"),threadClass:ce("6H").default("6H"),chamfer:hwr.default(0)};function Att(e){let t=e.threadPitch??LB[e.metricSize].threadPitch;return{...e,threadPitch:t,boreBDiameter:e.boreBDiameter??e.boreDiameter,screwEndOffset:e.screwEndOffset??e.length/4,screwAngle:(e.screwAngle%360+360)%360}}function N0n(e,t){let n=Att(e),o=(a)=>t.addIssue({code:"custom",message:a}),r=LB[n.metricSize].diameter;if(!Number.isFinite(n.outerDiameter**2))o("Derived dimensions must be finite");if((n.outerDiameter-n.boreDiameter)/2<=0)o("Outer diameter must exceed the bore diameter");if(n.threadPitch>=r)o("Thread pitch must be smaller than its nominal diameter");let s=(n.outerDiameter-Math.max(n.boreDiameter,n.boreBDiameter))/2;if(s<=0)o("Both bores must be smaller than the outer diameter");if(Math.SQRT2*r>=Math.min(n.boreDiameter,n.boreBDiameter))o("Both bores must separate the perpendicular screw holes with material");if(n.chamfer>=s/2||n.chamfer>=n.length/2)o("Chamfer must leave material between the bore and exterior");if(n.screwEndOffset-r/2<=n.chamfer)o("Screw holes must clear the end chamfers");if(n.length-2*n.screwEndOffset<=r)o("Each end must have a separate, nonintersecting screw-hole plane")}var Njs=Ee(D0n).strict().superRefine(N0n).transform(Att),R0n=Ee({fn:ce("rigidcoupler"),...D0n}).strict().superRefine(N0n).transform((e)=>({fn:e.fn,...Att(e)}));var dwr={bore:"boreDiameter",od:"outerDiameter",mount:"mount",m:"metricSize",threadpitch:"threadPitch",threadhand:"threadHand",threadclass:"threadClass",chamfer:"chamfer",boreb:"boreBDiameter",l:"length",length:"length",screwcount:"screwCount",screwendoffset:"screwEndOffset",screwangle:"screwAngle"};function Pdn(e){let t=ep(I1(e.string,B0n));if(e.fn!=="rigidcoupler"||t[0]?.toLowerCase()!=="rigidcoupler")throw Error("Expected an unadorned rigidcoupler function");let n={};for(let o of t.slice(1)){let r=o.match(/^([a-z]+)(.*)$/i),i=r?.[1]?.toLowerCase()??"",s=dwr[i];if(!s)throw Error(`Unknown rigidcoupler token "${o}"`);if(s in n)throw Error(`Duplicate rigidcoupler property "${s}"`);let a=r[2];if(!a)throw Error(`Token "${i}" requires a value`);if(["mount","threadHand","threadClass"].includes(s)){let c=a.match(/^\(([^()]+)\)$/);if(!c)throw Error(`Token "${i}" requires one parenthesized argument`);n[s]=s==="threadClass"?c[1].toUpperCase():c[1].toLowerCase()}else if(s==="metricSize"){if(!/^\d+(?:\.\d+)?$/.test(a))throw Error("m requires a unitless metric designation");n[s]=`M${a}`}else if(s==="screwCount"){if(!/^\d+$/.test(a))throw Error("screwcount requires a unitless integer");n[s]=Number(a)}else if(s==="screwAngle"){if(!/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:deg)?$/i.test(a))throw Error("screwangle requires an angle in degrees");n[s]=Number(a.replace(/deg$/i,""))}else n[s]=a}return R0n.parse({fn:"rigidcoupler",...n})}var Q0n=ku({name:"rigidcoupler",schema:R0n,parse:Pdn,normalizeString:(e)=>cx(e,B0n,Pdn,lwr)});function uwr(e){e.register(Q0n)}var k0n={setscrew:"mount(setscrew)",lefthanded:"threadhand(left)",righthanded:"threadhand(right)"},pwr=["righthanded"],L0n=an([ge().finite(),k().regex(/^[+]?(?:\d+(?:\.\d*)?|\.\d+)(?:mm|cm|m|in|inch|mil|ft|feet)?$/i,"Expected a complete length with a supported unit").transform((e)=>e.toLowerCase())]).pipe(rd),yhe=L0n.refine((e)=>e>0,"Length must be positive"),mwr=L0n.refine((e)=>e>=0,"Length cannot be negative"),H0n={boreDiameter:yhe,outerDiameter:yhe,width:yhe,screwZ:yhe.optional(),screwAngle:ge().finite().default(0),mount:ce("setscrew").default("setscrew"),metricSize:Che,threadPitch:yhe.optional(),threadHand:bt(["right","left"]).default("right"),threadClass:ce("6H").default("6H"),chamfer:mwr.default(0)};function ftt(e){let t=e.threadPitch??LB[e.metricSize].threadPitch;return{...e,threadPitch:t,screwZ:e.screwZ??e.width/2,screwAngle:(e.screwAngle%360+360)%360}}function F0n(e,t){let n=ftt(e),o=(s)=>t.addIssue({code:"custom",message:s}),r=LB[n.metricSize].diameter;if(!Number.isFinite(n.outerDiameter**2))o("Derived dimensions must be finite");let i=(n.outerDiameter-n.boreDiameter)/2;if(i<=0)o("Outer diameter must exceed the bore diameter");if(n.threadPitch>=r)o("Thread pitch must be smaller than its nominal diameter");if(r>=n.boreDiameter)o("Thread diameter must be smaller than the shaft bore");if(n.chamfer>=i/2||n.chamfer>=n.width/2)o("Chamfer must leave material between the bore and exterior");if(n.screwZ-r/2<=n.chamfer||n.screwZ+r/2>=n.width-n.chamfer)o("Screw hole must clear both end faces and chamfers")}var Qjs=Ee(H0n).strict().superRefine(F0n).transform(ftt),z0n=Ee({fn:ce("shaftcollar"),...H0n}).strict().superRefine(F0n).transform((e)=>({fn:e.fn,...ftt(e)}));var _wr={bore:"boreDiameter",od:"outerDiameter",mount:"mount",m:"metricSize",threadpitch:"threadPitch",threadhand:"threadHand",threadclass:"threadClass",chamfer:"chamfer",w:"width",width:"width",screwz:"screwZ",screwangle:"screwAngle"};function Edn(e){let t=ep(I1(e.string,k0n));if(e.fn!=="shaftcollar"||t[0]?.toLowerCase()!=="shaftcollar")throw Error("Expected an unadorned shaftcollar function");let n={};for(let o of t.slice(1)){let r=o.match(/^([a-z]+)(.*)$/i),i=r?.[1]?.toLowerCase()??"",s=_wr[i];if(!s)throw Error(`Unknown shaftcollar token "${o}"`);if(s in n)throw Error(`Duplicate shaftcollar property "${s}"`);let a=r[2];if(!a)throw Error(`Token "${i}" requires a value`);if(["mount","threadHand","threadClass"].includes(s)){let c=a.match(/^\(([^()]+)\)$/);if(!c)throw Error(`Token "${i}" requires one parenthesized argument`);n[s]=s==="threadClass"?c[1].toUpperCase():c[1].toLowerCase()}else if(s==="metricSize"){if(!/^\d+(?:\.\d+)?$/.test(a))throw Error("m requires a unitless metric designation");n[s]=`M${a}`}else if(s==="screwAngle"){if(!/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:deg)?$/i.test(a))throw Error("screwangle requires an angle in degrees");n[s]=Number(a.replace(/deg$/i,""))}else n[s]=a}return z0n.parse({fn:"shaftcollar",...n})}var O0n=ku({name:"shaftcollar",schema:z0n,parse:Edn,normalizeString:(e)=>cx(e,k0n,Edn,pwr)});function gwr(e){e.register(O0n)}var V0n={lefthanded:"threadhand(left)",righthanded:"threadhand(right)",fullthread:"thread(full)",flatends:"ends(flat)",custom:"spec(custom)"},Awr=["righthanded","flatends","custom"],Y0n=an([ge(),k().regex(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:mm|cm|m|in|inch|mil|ft|feet)?$/i).transform((e)=>e.toLowerCase())]).pipe(rd),Mdn=Y0n.refine((e)=>e>0),fwr=Y0n.refine((e)=>e>=0),ywr={M2:0.4,"M2.5":0.45,M3:0.5,M4:0.7,M5:0.8,M6:1,M8:1.25,M10:1.5,M12:1.75,M16:2,M20:2.5},xwr=bt(["M2","M2.5","M3","M4","M5","M6","M8","M10","M12","M16","M20"]),G0n={spec:ce("custom").default("custom"),metricSize:xwr,length:Mdn,thread:ce("full").default("full"),ends:ce("flat").default("flat"),chamfer:fwr.default(0),threadPitch:Mdn.optional(),threadHand:bt(["right","left"]).default("right")};function ytt(e){return{...e,threadPitch:e.threadPitch??ywr[e.metricSize]}}function U0n(e,t){let n=Number(e.metricSize.slice(1)),o=ytt(e).threadPitch;if(n-1.226869*o<=0)t.addIssue({code:"custom",path:["threadPitch"],message:"Thread pitch must leave a positive external-thread root diameter"});if(e.chamfer>=Math.min(n/2,e.length/2))t.addIssue({code:"custom",path:["chamfer"],message:"Chamfer must leave flat end faces and separate end chamfers"})}var Ljs=Ee(G0n).strict().superRefine(U0n).transform(ytt),W0n=Ee({fn:ce("threadedrod"),...G0n}).strict().superRefine(U0n).transform((e)=>({fn:e.fn,...ytt(e)}));var wdn={l:"length",length:"length",chamfer:"chamfer",threadpitch:"threadPitch"},Bdn={spec:"spec",thread:"thread",ends:"ends",threadhand:"threadHand"};function Tdn(e){let t=ep(I1(e.string,V0n));if(e.fn!=="threadedrod"||t[0]?.toLowerCase()!=="threadedrod")throw Error("Expected threadedrod without an inline value");let n={fn:"threadedrod"};for(let o of t.slice(1)){let r=o.match(/^([a-z]+)(.*)$/i);if(!r)throw Error(`Invalid threaded rod token "${o}"`);let i=r[1].toLowerCase(),s=r[2],a,c;if(i==="m"){if(a="metricSize",!/^\d+(?:\.\d+)?$/.test(s))throw Error("Metric size must be a unitless diameter");c=`M${s}`}else if(Object.hasOwn(wdn,i))a=wdn[i],c=s;else if(Object.hasOwn(Bdn,i)){a=Bdn[i];let l=s.match(/^\(([a-z]+)\)$/i);if(!l)throw Error(`Token "${i}" requires a parenthesized value`);c=l[1].toLowerCase()}else throw Error(`Unknown threaded rod token "${o}"`);if(Object.hasOwn(n,a))throw Error(`Threaded rod property "${a}" is set more than once`);n[a]=c}return W0n.parse(n)}var X0n=ku({name:"threadedrod",schema:W0n,parse:Tdn,normalizeString:(e)=>cx(e,V0n,Tdn,Awr)});function Cwr(e){e.register(X0n)}var bwr=an([ge(),k().regex(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:mm|cm|m|in|inch|mil|ft|feet)?$/i).transform((e)=>e.toLowerCase())]).pipe(rd),xhe=bwr.refine((e)=>e>0,"Length must be positive"),j0n={outerDiameter:xhe.default(8),wireDiameter:xhe.default(0.8),turns:ge().finite().min(1).max(128).default(3.25),pitch:xhe.optional(),startLegLength:xhe.default(10),endLegLength:xhe.default(14),leftHand:Be().default(!1)};function K0n(e){return{...e,pitch:e.pitch??e.wireDiameter*1.25}}function $0n(e,t){if(e.outerDiameter<3*e.wireDiameter)t.addIssue({code:"custom",path:["outerDiameter"],message:"Outer diameter must be at least three wire diameters"});let n=e.pitch??e.wireDiameter*1.25;if(n<1.1*e.wireDiameter)t.addIssue({code:"custom",path:["pitch"],message:"Open coils require pitch at least 1.1 times wire diameter"});if(!Number.isFinite(Math.hypot(Math.PI*(e.outerDiameter-e.wireDiameter),n)*e.turns+e.startLegLength+e.endLegLength))t.addIssue({code:"custom",message:"Spring dimensions must remain finite"})}var Fjs=Ee(j0n).strict().superRefine($0n).transform(K0n),q0n=Ee({fn:ce("torsionspring"),...j0n}).strict().superRefine($0n).transform((e)=>({...K0n(e),fn:e.fn}));var Ddn={od:"outerDiameter",wire:"wireDiameter",pitch:"pitch",start:"startLegLength",end:"endLegLength"};function Iwr(e){let t=ep(e.string);if(e.fn!=="torsionspring"||t[0]?.toLowerCase()!=="torsionspring")throw Error("Expected torsionspring without an inline value");let n={fn:"torsionspring"};for(let o of t.slice(1)){let r=o.toLowerCase();if(r==="left"||r==="right"){if("leftHand"in n)throw Error("Duplicate or conflicting spring handedness");n.leftHand=r==="left";continue}let i=o.match(/^([a-z]+)(.*)$/i),s=i?.[1]?.toLowerCase(),a=i?.[2];if(!s||!a)throw Error(`Invalid torsion spring token "${o}"`);let c,l=a;if(s in Ddn)c=Ddn[s];else if(s==="turns"){if(c="turns",!/^[+]?(?:\d+(?:\.\d*)?|\.\d+)$/.test(a))throw Error("Turns requires a unitless number");l=Number(a)}else throw Error(`Unknown torsion spring token "${o}"`);if(c in n)throw Error(`Duplicate torsion spring property "${c}"`);n[c]=l}return q0n.parse(n)}var J0n=ku({name:"torsionspring",schema:q0n,parse:Iwr});function vwr(e){e.register(J0n)}var Z0n={fourtsolid:"profile(fourtsolid)"},Swr=[],epn={width:b0.default(20),height:b0.default(20),length:b0.default(100),profile:ce("fourtsolid").default("fourtsolid"),slotWidth:b0.default(6),pocketWidth:b0.default(10),pocketDepth:b0.default(2),lipThickness:b0.default(2),boreDiameter:pv.default(0),cornerRadius:pv.default(0)};function tpn(e,t){let n=(i,s)=>t.addIssue({code:"custom",message:i,path:[s]}),o=Math.min(e.width,e.height)/2,r=e.lipThickness+e.pocketDepth;if(!Number.isFinite(r)){n("Total groove depth must be finite","pocketDepth");return}if(e.pocketWidth<=e.slotWidth)n("A T pocket must be wider than its slot opening","pocketWidth");if(e.cornerRadius>=o)n("Corner radius must be smaller than half the section","cornerRadius");if(e.pocketWidth/2+e.cornerRadius>=o)n("Grooves must leave material before the rounded corners","pocketWidth");if(r+e.pocketWidth/2>=o)n("Adjacent perpendicular T pockets must remain separate","pocketDepth");if(e.boreDiameter/2+r>=o)n("The axial bore must remain separate from every T pocket","boreDiameter")}var Ojs=Ee(epn).strict().superRefine(tpn),npn=Ee({fn:ce("tslotextrusion"),...epn}).strict().superRefine(tpn);var Ndn={w:"width",width:"width",h:"height",height:"height",l:"length",length:"length",slot:"slotWidth",slotwidth:"slotWidth",pocket:"pocketWidth",pocketwidth:"pocketWidth",pocketd:"pocketDepth",pocketdepth:"pocketDepth",lip:"lipThickness",lipthickness:"lipThickness",bore:"boreDiameter",borediameter:"boreDiameter",corner:"cornerRadius",cornerradius:"cornerRadius"};function Rdn(e){let t=ep(I1(e.string,Z0n));if(e.fn!=="tslotextrusion"||t[0]?.toLowerCase()!==e.fn)throw Error("Expected tslotextrusion without an inline value");let n={fn:"tslotextrusion"};for(let o of t.slice(1)){let[r,i]=cJ(o),s,a=i;if(r in Ndn)s=Ndn[r];else if(r==="profile"){s="profile";let c=i.match(/^\(([a-z]+)\)$/i);if(!c)throw Error("Profile requires one parenthesized identity");a=c[1].toLowerCase()}else throw Error(`Unknown T-slot extrusion token "${o}"`);if(s in n)throw Error(`T-slot extrusion property "${s}" is repeated`);n[s]=a}return npn.parse(n)}var opn=ku({name:"tslotextrusion",schema:npn,parse:Rdn,normalizeString:(e)=>cx(e,Z0n,Rdn,Swr)});function Pwr(e){e.register(opn)}var rpn={righttriangle:"shape(righttriangle)"},Ewr=[],ipn={width:b0.default(40),height:b0.default(40),thickness:b0.default(4),shape:ce("righttriangle").default("righttriangle"),slotCount:ce(2).default(2),slot:c1([b0,b0]).default([5,12]),centers:c1([b0,b0]).default([12,28]),edgeMargin:b0.default(1)};function spn(e,t){let n=(A,g)=>t.addIssue({code:"custom",message:A,path:[g]}),[o,r]=e.slot;if(r<o){n("Slot length must be at least its width","slot");return}let i=o/2,s=(r-o)/2,a=e.edgeMargin+i,[c,l]=e.centers;if(!Number.isFinite(a)){n("Derived slot centers must be finite","edgeMargin");return}if(c<=r/2||l<=r/2)n("Slots must leave material at the right-angle corner","centers");let h=Math.min(e.width,e.height)/Math.max(e.width,e.height),d=i/Math.min(e.width,e.height)*Math.hypot(1,h),u=c/e.width+a/e.height+s/e.width+d,_=a/e.width+l/e.height+s/e.height+d;if(!Number.isFinite(u)||!Number.isFinite(_)||u>=1||_>=1)n("Both complete slots must remain inside the triangular plate","centers");let p=Math.max(c-s-a,a-c-s,0),m=Math.max(l-s-a,a-l-s,0);if(Math.hypot(p,m)<=o)n("The two slots must retain a positive separating ligament","centers")}var Yjs=Ee(ipn).strict().superRefine(spn),apn=Ee({fn:ce("tslotgusset"),...ipn}).strict().superRefine(spn);var Qdn={w:"width",width:"width",h:"height",height:"height",t:"thickness",thickness:"thickness",edgemargin:"edgeMargin"};function kdn(e){let t=ep(I1(e.string,rpn));if(e.fn!=="tslotgusset"||t[0]?.toLowerCase()!==e.fn)throw Error("Expected tslotgusset without an inline value");let n={fn:"tslotgusset"};for(let o of t.slice(1)){let[r,i]=cJ(o),s,a=i;if(r in Qdn)s=Qdn[r];else if(r==="slots"||r==="slotcount")s="slotCount",a=CY(i,"slotCount");else if(r==="shape"){s="shape";let c=i.match(/^\(([a-z]+)\)$/i);if(!c)throw Error("Shape requires one parenthesized identity");a=c[1].toLowerCase()}else if(r==="slot"||r==="centers"){s=r;let c=i.match(/^\(([^(),]+),([^(),]+)\)$/);if(!c)throw Error(`${r} requires two parenthesized lengths`);a=[c[1].trim(),c[2].trim()]}else throw Error(`Unknown T-slot gusset token "${o}"`);if(s in n)throw Error(`T-slot gusset property "${s}" is repeated`);n[s]=a}return apn.parse(n)}var cpn=ku({name:"tslotgusset",schema:apn,parse:kdn,normalizeString:(e)=>cx(e,rpn,kdn,Ewr)});function Mwr(e){e.register(cpn)}var lpn={width:b0.default(20),legLength:b0.default(40),thickness:b0.default(4),angle:ce(90).default(90),holeCount:ce(2).default(2),holeDiameter:b0.default(5),holeOffset:b0.default(20),bendRadius:pv.default(0)};function hpn(e,t){let n=(r,i)=>t.addIssue({code:"custom",message:r,path:[i]});if(!Number.isFinite(e.bendRadius+e.thickness)){n("Outside bend radius must be finite","bendRadius");return}if(e.thickness>=e.legLength)n("Thickness must be smaller than the leg length","thickness");if(e.bendRadius>=e.legLength)n("Bend radius must leave a straight portion of each leg","bendRadius");let o=e.holeDiameter/2;if(e.holeDiameter>=e.width)n("Holes must leave material at both width edges","holeDiameter");if(e.holeOffset-o<=e.bendRadius)n("Holes must lie wholly beyond the bend tangent","holeOffset");if(e.holeOffset+o>=e.legLength)n("Holes must leave material at the free leg ends","holeOffset")}var Ujs=Ee(lpn).strict().superRefine(hpn),dpn=Ee({fn:ce("tslotinsidecorner"),...lpn}).strict().superRefine(hpn);var Ldn={w:"width",width:"width",leg:"legLength",leglength:"legLength",t:"thickness",thickness:"thickness",hole:"holeDiameter",holediameter:"holeDiameter",offset:"holeOffset",holeoffset:"holeOffset",bendr:"bendRadius",bendradius:"bendRadius"};function wwr(e){let t=ep(e.string);if(e.fn!=="tslotinsidecorner"||t[0]?.toLowerCase()!==e.fn)throw Error("Expected tslotinsidecorner without an inline value");let n={fn:"tslotinsidecorner"};for(let o of t.slice(1)){let[r,i]=cJ(o),s,a=i;if(r in Ldn)s=Ldn[r];else if(r==="holes"||r==="holecount")s="holeCount",a=CY(i,"holeCount");else if(r==="angle")s="angle",a=eIe(i,"angle");else throw Error(`Unknown T-slot inside corner token "${o}"`);if(s in n)throw Error(`T-slot inside corner property "${s}" is repeated`);n[s]=a}return dpn.parse(n)}var upn=ku({name:"tslotinsidecorner",schema:dpn,parse:wwr});function Bwr(e){e.register(upn)}function ppn(e){let t=ZEr.parse(e),n=t.wireSideAngle*Math.PI/180,o=Math.cos(n),r=Math.sin(n),i=Math.min(t.bodyWidth/2/Math.max(Math.abs(o),Math.abs(r)),(t.bodyWidth-t.faceCornerChamfer)/(Math.abs(o)+Math.abs(r))),s=t.shaftFlatAngle*Math.PI/180;return{frontface:{position:{x:0,y:0,z:0},direction:{x:0,y:0,z:1}},backface:{position:{x:0,y:0,z:-t.bodyLength},direction:{x:0,y:0,z:-1}},shafttip:{position:{x:0,y:0,z:t.shaftLength},direction:{x:0,y:0,z:1}},wireside:{position:{x:i*o,y:i*r,z:-t.bodyLength+t.rearCapLength/2},direction:{x:o,y:r,z:0}},shaftflat:t.shaftShape==="d"?{position:{x:(t.shaftDiameter/2-t.shaftFlatDepth)*Math.cos(s),y:(t.shaftDiameter/2-t.shaftFlatDepth)*Math.sin(s),z:t.shaftLength-t.shaftFlatLength/2},direction:{x:Math.cos(s),y:Math.sin(s),z:0}}:void 0}}var Wjs=an([Ydn.schema,sun.schema,lun.schema,mun.schema,_un.schema,Zdn.schema,gun.schema,xun.schema,Pun.schema,Nun.schema,Hun.schema,Gun.schema,$un.schema,t0n.schema,s0n.schema,p0n.schema,f0n.schema,I0n.schema,w0n.schema,Q0n.schema,O0n.schema,X0n.schema,J0n.schema,opn.schema,cpn.schema,upn.schema]);function Twr(e){UEr(e),KEr(e),tMr(e),iMr(e),AMr(e),yMr(e),CMr(e),vMr(e),wMr(e),DMr(e),RMr(e),HMr(e),zMr(e),VMr(e),jMr(e),JMr(e),ewr(e),swr(e),cwr(e),uwr(e),gwr(e),Cwr(e),vwr(e),Pwr(e),Mwr(e),Bwr(e)}var xtt=new zEr;Twr(xtt);var Dwr=(e)=>xtt.parse(e),Nwr=(e)=>{let t=xtt.normalize(Z6e(e));return{params:()=>t,json:()=>Dwr(t)}},mpn=(e)=>Nwr(e).json();var qm=at(fS(),1);var ZPn=at(ln(),1);var eEn=at(ln(),1),k5=at(fS(),1);bp();bp();bp();K0();K0();var Rwr=class extends po{constructor(e){super();this.params=e;let{cellContents:t}=e;for(let n=0;n<t.length;n++)for(let o=n+1;o<t.length;o++)this._allPairs.push([n,o])}params;midlines=[];_pairIdx=0;_allPairs=[];_step(){let{cellContents:e,containerWidth:t,containerHeight:n}=this.params;if(this._pairIdx>=this._allPairs.length){this.solved=!0;return}let[o,r]=this._allPairs[this._pairIdx],i=e[o],s=e[r],a=i.x+i.width,c=s.x+s.width,l=i.y+i.height,h=s.y+s.height;if(a<s.x||c<i.x){let d=a<s.x?(a+s.x)/2:(c+i.x)/2;this.midlines.push({id:`midline-${this.midlines.length}`,start:{x:d,y:0},end:{x:d,y:n},cellIds:[i.cellId,s.cellId],type:"vertical"})}if(l<s.y||h<i.y){let d=l<s.y?(l+s.y)/2:(h+i.y)/2;this.midlines.push({id:`midline-${this.midlines.length}`,start:{x:0,y:d},end:{x:t,y:d},cellIds:[i.cellId,s.cellId],type:"horizontal"})}if(this._pairIdx++,this._pairIdx>=this._allPairs.length)this.solved=!0}getOutput(){return this.midlines}getConstructorParams(){return[this.params]}visualize(){let{cellContents:e}=this.params,t=this._allPairs[this._pairIdx],n=t?new Set([e[t[0]]?.cellId,e[t[1]]?.cellId]):new Set;return{rects:e.map((o)=>({center:{x:o.x+o.width/2,y:o.y+o.height/2},width:o.width,height:o.height,fill:n.has(o.cellId)?"rgba(255, 80, 80, 0.45)":"rgba(255, 165, 0, 0.3)",stroke:n.has(o.cellId)?"#ff2020":"#c87000",label:o.cellId})),lines:this.midlines.map((o)=>({points:[o.start,o.end],strokeColor:"#888888",strokeDash:[4,4],label:o.id}))}}},Qwr=(e,t)=>{let n=e.start.x,o=e.start.y,r=e.end.x,i=e.end.y,s=t.start.x,a=t.start.y,c=t.end.x,l=t.end.y,h=(n-r)*(a-l)-(o-i)*(s-c);if(Math.abs(h)<0.0001)return null;let d=((n-s)*(a-l)-(o-a)*(s-c))/h,u=-((n-r)*(o-a)-(o-i)*(n-s))/h;if(d>=0&&d<=1&&u>=0&&u<=1)return{x:n+d*(r-n),y:o+d*(i-o)};return null},kwr=class extends po{constructor(e){super();this.params=e}params;intersections=[];_outerIdx=0;_step(){let{midlines:e}=this.params;if(e.length<=1){this.solved=!0;return}if(this._outerIdx>=e.length-1){this.solved=!0;return}let t=e[this._outerIdx];for(let n of e.slice(this._outerIdx+1)){let o=Qwr(t,n);if(o)this.intersections.push({point:o,midlineIds:[t.id,n.id]})}if(this._outerIdx++,this._outerIdx>=e.length-1)this.solved=!0}getOutput(){return this.intersections}getConstructorParams(){return[this.params]}visualize(){let{midlines:e}=this.params,t=e[this._outerIdx];return{lines:e.map((n)=>({points:[n.start,n.end],strokeColor:n===t?"#2196f3":"#cccccc",strokeWidth:n===t?2.5:1,strokeDash:n===t?void 0:[4,4]})),points:this.intersections.map((n)=>({x:n.point.x,y:n.point.y,color:"#e63946",label:`(${n.point.x.toFixed(1)}, ${n.point.y.toFixed(1)})`}))}}},Lwr=(e)=>{let t=[];for(let n=0;n+1<e.length;n++){let o=e[n],r=e[n+1];if(o!==void 0&&r!==void 0)t.push([o,r])}return t},Hwr=(e,t)=>{let n=Math.max(t.x,Math.min(e.x,t.x+t.width)),o=Math.max(t.y,Math.min(e.y,t.y+t.height)),r=e.x-n,i=e.y-o;return Math.sqrt(r*r+i*i)},Fwr=(e,t,n)=>{let r=1/0;for(let i=0;i<=10;i++){let s=i/10,a={x:e.x+s*(t.x-e.x),y:e.y+s*(t.y-e.y)};r=Math.min(r,Hwr(a,n))}return r},zwr=(e,t,n)=>Math.min(...n.map((o)=>Fwr(e,t,o))),Owr=class extends po{constructor(e){super();this.params=e}params;allSegments=[];_midlineIdx=0;_segmentId=0;_step(){let{midlines:e,intersections:t,cellContents:n}=this.params;if(this._midlineIdx>=e.length){this.solved=!0;return}let o=e[this._midlineIdx],r=t.filter((i)=>i.midlineIds.includes(o.id)).map((i)=>i.point).sort((i,s)=>o.type==="vertical"?i.y-s.y:i.x-s.x);for(let[i,s]of Lwr([o.start,...r,o.end]))this.allSegments.push({id:`segment-${this._segmentId++}`,start:i,end:s,fromCellIds:o.cellIds,distanceToAnyCell:zwr(i,s,n)});if(this._midlineIdx++,this._midlineIdx>=e.length)this.solved=!0}getOutput(){return this.allSegments}getConstructorParams(){return[this.params]}visualize(){let{cellContents:e,midlines:t}=this.params,n=t[this._midlineIdx],o=Math.max(...this.allSegments.map((r)=>r.distanceToAnyCell??0),1);return{rects:e.map((r)=>({center:{x:r.x+r.width/2,y:r.y+r.height/2},width:r.width,height:r.height,fill:"rgba(255, 165, 0, 0.2)",stroke:"#c87000"})),lines:[...this.allSegments.map((r)=>{let i=(r.distanceToAnyCell??0)/o,s=Math.round(255*(1-i)),a=Math.round(200*i);return{points:[r.start,r.end],strokeColor:`rgb(${s}, ${a}, 80)`,strokeWidth:1.5}}),...n?[{points:[n.start,n.end],strokeColor:"#2196f3",strokeWidth:2,strokeDash:[8,4]}]:[]]}}},_pn=(e)=>{let t=[];for(let n=0;n+1<e.length;n++){let o=e[n],r=e[n+1];if(o!==void 0&&r!==void 0)t.push([o,r])}return t},Vwr=(e,t,n,o)=>{let{x:r,y:i}=e,{x:s,y:a}=t,{x:c,y:l}=n,{x:h,y:d}=o,u=(r-s)*(l-d)-(i-a)*(c-h);if(Math.abs(u)<0.0001)return!1;let _=((r-c)*(l-d)-(i-l)*(c-h))/u,p=-((r-s)*(i-l)-(i-a)*(r-c))/u;return _>=0&&_<=1&&p>=0&&p<=1},Ywr=(e,t,n)=>{let{x:o,y:r,width:i,height:s}=n,a=e.x>=o&&e.x<=o+i&&e.y>=r&&e.y<=r+s,c=t.x>=o&&t.x<=o+i&&t.y>=r&&t.y<=r+s;if(a||c)return!0;let l=[{start:{x:o,y:r},end:{x:o+i,y:r}},{start:{x:o+i,y:r},end:{x:o+i,y:r+s}},{start:{x:o+i,y:r+s},end:{x:o,y:r+s}},{start:{x:o,y:r+s},end:{x:o,y:r}}];for(let h of l)if(Vwr(e,t,h.start,h.end))return!0;return!1},Gwr=(e,t)=>e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y,gpn=["rgba(100, 149, 237, 0.25)","rgba(144, 238, 144, 0.25)","rgba(255, 182, 193, 0.25)","rgba(221, 160, 221, 0.25)","rgba(255, 218, 185, 0.25)","rgba(175, 238, 238, 0.25)"],Uwr=class extends po{constructor(e){super();this.params=e;let t=2;this.MAX_ITERATIONS=Math.max(this.MAX_ITERATIONS,e.allSegments.length+t)}params;validSegments=[];cellContainingRects=[];gridRects=[];_phase=0;_segIdx=0;_acceptedSegs=[];_rejectedSegs=[];_step(){let{allSegments:e,cellContents:t,containerWidth:n,containerHeight:o}=this.params;if(this._phase===0){if(this._segIdx>=e.length){this._phase=1;return}let d=e[this._segIdx];if(!t.some((_)=>Ywr(d.start,d.end,_)))this._acceptedSegs.push(d);else this._rejectedSegs.push(d);this._segIdx++;return}let r=new Set([0,n]),i=new Set([0,o]);this._acceptedSegs.forEach((d)=>{if(Math.abs(d.start.x-d.end.x)<0.001)r.add(d.start.x);else i.add(d.start.y)});let s=Array.from(r).sort((d,u)=>d-u),a=Array.from(i).sort((d,u)=>d-u),c=[];t.forEach((d)=>{let u=s.filter((A)=>A<=d.x).pop()??s[0],_=s.find((A)=>A>=d.x+d.width)??s[s.length-1],p=a.filter((A)=>A<=d.y).pop()??a[0],m=a.find((A)=>A>=d.y+d.height)??a[a.length-1];c.push({cellId:`contain-${d.cellId}`,x:u,y:p,width:Math.max(0,_-u),height:Math.max(0,m-p)})});let l=[],h=0;for(let[d,u]of _pn(s)){if(u-d<=0)continue;for(let[_,p]of _pn(a)){if(p-_<=0)continue;let m={cellId:`gridRect-${h++}`,x:d,y:_,width:u-d,height:p-_};if(t.some((A)=>Gwr(m,A)))continue;l.push(m)}}c.forEach((d)=>{let u=`${d.x},${d.y},${d.width},${d.height}`;if(!l.some((_)=>`${_.x},${_.y},${_.width},${_.height}`===u))l.push(d)}),this.validSegments=this._acceptedSegs,this.cellContainingRects=c,this.gridRects=l,this.solved=!0}getOutput(){return{validSegments:this.validSegments,cellContainingRects:this.cellContainingRects,gridRects:this.gridRects}}getConstructorParams(){return[this.params]}visualize(){let{cellContents:e,allSegments:t}=this.params,n=t[this._segIdx];return{rects:[...this.gridRects.map((o,r)=>({center:{x:o.x+o.width/2,y:o.y+o.height/2},width:o.width,height:o.height,fill:gpn[r%gpn.length],stroke:"#999999"})),...e.map((o)=>({center:{x:o.x+o.width/2,y:o.y+o.height/2},width:o.width,height:o.height,fill:"rgba(255, 165, 0, 0.4)",stroke:"#c87000",label:o.cellId}))],lines:[...this._rejectedSegs.map((o)=>({points:[o.start,o.end],strokeColor:"rgba(220, 50, 50, 0.35)",strokeDash:[3,3],strokeWidth:1})),...this._acceptedSegs.map((o)=>({points:[o.start,o.end],strokeColor:"#2196f3",strokeWidth:1.5})),...n&&this._phase===0?[{points:[n.start,n.end],strokeColor:"#ff9800",strokeWidth:3}]:[],...this.validSegments.map((o)=>({points:[o.start,o.end],strokeColor:"#2196f3",strokeWidth:2}))]}}},lx=0.001,Wwr=(e,t,n=lx)=>Math.abs(e.x-t.x)<n&&Math.abs(e.y-t.y)<n,Xwr=(e,t)=>{let n=Math.max(e.x-(t.x+t.width),t.x-(e.x+e.width),0),o=Math.max(e.y-(t.y+t.height),t.y-(e.y+e.height),0);return n+o},jwr=(e,t,n=0.5)=>{let o=(Math.abs(e.x+e.width-t.x)<n||Math.abs(t.x+t.width-e.x)<n)&&!(e.y+e.height<=t.y||t.y+t.height<=e.y),r=(Math.abs(e.y+e.height-t.y)<n||Math.abs(t.y+t.height-e.y)<n)&&!(e.x+e.width<=t.x||t.x+t.width<=e.x);return o||r},Apn=["rgba(100, 149, 237, 0.35)","rgba(144, 238, 144, 0.35)","rgba(255, 182, 193, 0.35)","rgba(221, 160, 221, 0.35)","rgba(255, 218, 185, 0.35)","rgba(175, 238, 238, 0.35)","rgba(250, 200, 100, 0.35)","rgba(180, 220, 180, 0.35)"],fpn=["#6495ed","#3cb371","#ff69b4","#9370db","#ffa07a","#20b2aa","#daa520","#5f9e5f"],Kwr=class extends po{constructor(e){super();this.params=e}params;mergedRectGroups=[];groupedRects=[];_phase=0;_workRects=[];_unmergedQueue=[];_step(){let{validSegments:e,gridRects:t,cellContainingRects:n,cellContents:o}=this.params;if(this._phase===0){this._workRects=t.map((s)=>{let a=1/0,{x:c,y:l,width:h,height:d}=s;return e.forEach((u)=>{let _=Math.min(u.start.x,u.end.x),p=Math.max(u.start.x,u.end.x),m=Math.min(u.start.y,u.end.y),A=Math.max(u.start.y,u.end.y),g=Math.abs(u.start.y-u.end.y)<lx,f=Math.abs(u.start.x-u.end.x)<lx,y=!1;if(g){if((Math.abs(m-l)<lx||Math.abs(m-(l+d))<lx)&&_<c+h-lx&&p>c+lx&&Math.max(_,c)+lx<Math.min(p,c+h))y=!0}else if(f){if((Math.abs(_-c)<lx||Math.abs(_-(c+h))<lx)&&m<l+d-lx&&A>l+lx&&Math.max(m,l)+lx<Math.min(A,l+d))y=!0}if(y&&u.distanceToAnyCell!==void 0)a=Math.min(a,u.distanceToAnyCell)}),{...s,merged:!1,groupId:null,minBoundingSegmentDistance:a}}),n.forEach((s,a)=>{let c=this._workRects.find((l)=>Wwr({x:l.x,y:l.y},{x:s.x,y:s.y})&&Math.abs(l.width-s.width)<lx&&Math.abs(l.height-s.height)<lx);if(c)c.merged=!0,c.groupId=a}),this._unmergedQueue=this._workRects.filter((s)=>!s.merged).sort((s,a)=>s.minBoundingSegmentDistance-a.minBoundingSegmentDistance),this._updateOutput(),this._phase=1;return}if(this._unmergedQueue.length===0){this._finalize(),this.solved=!0;return}let r=!1,i=[];for(let s of this._unmergedQueue){if(s.merged)continue;if(r){i.push(s);continue}let a=this._workRects.filter((c)=>c.merged&&jwr(s,c));if(a.length>0){if(s.merged=!0,a.length===1)s.groupId=a[0].groupId;else{let c=null,l=1/0;for(let h of a){if(h.groupId===null)continue;let d=o[h.groupId];if(!d)continue;let u=Xwr(s,d);if(u<l||u===l&&(c===null||h.groupId!==null&&h.groupId<c))l=u,c=h.groupId}s.groupId=c}r=!0}else i.push(s)}if(this._unmergedQueue=i.sort((s,a)=>s.minBoundingSegmentDistance-a.minBoundingSegmentDistance),!r)this._finalize(),this.solved=!0;this._updateOutput()}_updateOutput(){this.groupedRects=this._workRects.filter((e)=>e.groupId!==null)}_finalize(){let{cellContainingRects:e,cellContents:t}=this.params;this.mergedRectGroups=[],e.forEach((n,o)=>{let r=this._workRects.filter((s)=>s.merged&&s.groupId===o).map(({merged:s,groupId:a,minBoundingSegmentDistance:c,...l})=>l),i=t[o];if(!i)return;this.mergedRectGroups.push([n,i,...r.filter((s)=>s.cellId!==n.cellId)])})}getOutput(){return{mergedRectGroups:this.mergedRectGroups,groupedRects:this.groupedRects}}getConstructorParams(){return[this.params]}visualize(){let{cellContents:e}=this.params;return{rects:[...this.groupedRects.map((t)=>({center:{x:t.x+t.width/2,y:t.y+t.height/2},width:t.width,height:t.height,fill:Apn[t.groupId%Apn.length],stroke:fpn[t.groupId%fpn.length]})),...this._workRects.filter((t)=>!t.merged).map((t)=>({center:{x:t.x+t.width/2,y:t.y+t.height/2},width:t.width,height:t.height,fill:"rgba(200, 200, 200, 0.2)",stroke:"#aaaaaa",strokeDash:[3,3]})),...e.map((t)=>({center:{x:t.x+t.width/2,y:t.y+t.height/2},width:t.width,height:t.height,fill:"rgba(255, 165, 0, 0.5)",stroke:"#c87000",label:t.cellId}))]}}},$wr=0.001,ypn=(e,t)=>{let n=parseFloat(e.x.toFixed(4)),o=parseFloat(e.y.toFixed(4)),r=parseFloat(t.x.toFixed(4)),i=parseFloat(t.y.toFixed(4));if(n<r||n===r&&o<i)return`${n},${o}_${r},${i}`;return`${r},${i}_${n},${o}`},xpn=["rgba(100, 149, 237, 0.25)","rgba(144, 238, 144, 0.25)","rgba(255, 182, 193, 0.25)","rgba(221, 160, 221, 0.25)","rgba(255, 218, 185, 0.25)","rgba(175, 238, 238, 0.25)","rgba(250, 200, 100, 0.25)","rgba(180, 220, 180, 0.25)"],qwr=class extends po{constructor(e){super();this.params=e}params;outlineLines=[];_outerIdx=0;_segMap=new Map;_step(){let{groupedRects:e}=this.params,t=$wr;if(this._outerIdx>=e.length){this._rebuildLines(),this.solved=!0;return}let n=e[this._outerIdx];for(let o of e.slice(this._outerIdx+1)){if(n.groupId===o.groupId)continue;let r=n.x+n.width,i=o.x+o.width;if(Math.abs(r-o.x)<t||Math.abs(i-n.x)<t){let c=Math.abs(r-o.x)<t?r:i,l=Math.max(n.y,o.y),h=Math.min(n.y+n.height,o.y+o.height);if(h-l>t){let d={x:c,y:l},u={x:c,y:h};this._segMap.set(ypn(d,u),{start:d,end:u})}}let s=n.y+n.height,a=o.y+o.height;if(Math.abs(s-o.y)<t||Math.abs(a-n.y)<t){let c=Math.abs(s-o.y)<t?s:a,l=Math.max(n.x,o.x),h=Math.min(n.x+n.width,o.x+o.width);if(h-l>t){let d={x:l,y:c},u={x:h,y:c};this._segMap.set(ypn(d,u),{start:d,end:u})}}}if(this._outerIdx++,this._rebuildLines(),this._outerIdx>=e.length)this.solved=!0}_rebuildLines(){let e=0;this.outlineLines=[],this._segMap.forEach(({start:t,end:n})=>{this.outlineLines.push({id:`outline-${e++}`,start:t,end:n})})}getOutput(){return this.outlineLines}getConstructorParams(){return[this.params]}visualize(){let{groupedRects:e}=this.params,t=e[this._outerIdx];return{rects:e.map((n)=>({center:{x:n.x+n.width/2,y:n.y+n.height/2},width:n.width,height:n.height,fill:n===t?"rgba(255, 152, 0, 0.45)":xpn[n.groupId%xpn.length],stroke:n===t?"#ff6600":"#cccccc"})),lines:this.outlineLines.map((n)=>({points:[n.start,n.end],strokeColor:"#000000",strokeWidth:3}))}}},pr=0.001,gk=(e,t,n=pr)=>Math.abs(e.x-t.x)<n&&Math.abs(e.y-t.y)<n,m6=(e)=>`${e.x.toFixed(4)},${e.y.toFixed(4)}`,nIe=(e,t)=>{let n=m6(e),o=m6(t);return n<o?`${n}_${o}`:`${o}_${n}`},Ihe=(e)=>gk(e.start,e.end),Jwr=(e)=>Math.abs(e.start.x-e.end.x)<pr||Math.abs(e.start.y-e.end.y)<pr,p6=(e,t,n,o)=>Math.min(t,o)-Math.max(e,n)>pr,lJ=(e)=>e.reduce((t,n)=>t+Math.abs(n.start.x-n.end.x)+Math.abs(n.start.y-n.end.y),0),am=(e,t)=>{if(Math.abs(e.start.x-e.end.x)<pr)return Math.abs(t.x-e.start.x)<pr&&t.y>=Math.min(e.start.y,e.end.y)-pr&&t.y<=Math.max(e.start.y,e.end.y)+pr;if(Math.abs(e.start.y-e.end.y)<pr)return Math.abs(t.y-e.start.y)<pr&&t.x>=Math.min(e.start.x,e.end.x)-pr&&t.x<=Math.max(e.start.x,e.end.x)+pr;return!1},aIe=(e,t,n)=>t==="start"?{start:n,end:e.end}:{start:e.start,end:n},Cpn=(e)=>({x:(e.minX+e.maxX)/2,y:(e.minY+e.maxY)/2}),bpn=(e,t,n)=>e>Math.min(t,n)+pr&&e<Math.max(t,n)-pr,Tpn=(e)=>{let t=new Map;for(let n of e)t.set(m6(n.start),(t.get(m6(n.start))??0)+1),t.set(m6(n.end),(t.get(m6(n.end))??0)+1);return t},Zwr=(e,t)=>t.some((n)=>{let o=(Math.abs(e.x-n.minX)<pr||Math.abs(e.x-n.maxX)<pr)&&e.y>=n.minY-pr&&e.y<=n.maxY+pr,r=(Math.abs(e.y-n.minY)<pr||Math.abs(e.y-n.maxY)<pr)&&e.x>=n.minX-pr&&e.x<=n.maxX+pr;return o||r}),eBr=(e,t)=>{let n=e.start.x,o=e.start.y,r=e.end.x,i=e.end.y;if(Math.abs(n-r)<pr){let s=Math.min(o,i),a=Math.max(o,i);return n>t.minX+pr&&n<t.maxX-pr&&a>t.minY-pr&&s<t.maxY+pr}if(Math.abs(o-i)<pr){let s=Math.min(n,r),a=Math.max(n,r);return o>t.minY+pr&&o<t.maxY-pr&&a>t.minX+pr&&s<t.maxX-pr}return!0},tBr=(e,t)=>{let n=e.start.x,o=e.start.y,r=e.end.x,i=e.end.y;if(Math.abs(n-r)<pr){let s=Math.min(o,i),a=Math.max(o,i);return(Math.abs(n-t.minX)<pr||Math.abs(n-t.maxX)<pr)&&p6(s,a,t.minY,t.maxY)}if(Math.abs(o-i)<pr){let s=Math.min(n,r),a=Math.max(n,r);return(Math.abs(o-t.minY)<pr||Math.abs(o-t.maxY)<pr)&&p6(s,a,t.minX,t.maxX)}return!1},Mhe=(e,t)=>e.length>0&&e.every((n)=>!Ihe(n)&&Jwr(n)&&!t.some((o)=>eBr(n,o)||tBr(n,o))),nBr=(e,t)=>{if(Math.abs(e.start.x-e.end.x)<pr){let n=e.start.x,o=Math.min(e.start.y,e.end.y),r=Math.max(e.start.y,e.end.y);return t.some((i)=>i.maxX<=n+pr&&p6(o,r,i.minY,i.maxY)&&t.some((s)=>s.minX>=n-pr&&p6(o,r,s.minY,s.maxY)&&p6(i.minY,i.maxY,s.minY,s.maxY)))}if(Math.abs(e.start.y-e.end.y)<pr){let n=e.start.y,o=Math.min(e.start.x,e.end.x),r=Math.max(e.start.x,e.end.x);return t.some((i)=>i.maxY<=n+pr&&p6(o,r,i.minX,i.maxX)&&t.some((s)=>s.minY>=n-pr&&p6(o,r,s.minX,s.maxX)&&p6(i.minX,i.maxX,s.minX,s.maxX)))}return!1},oBr=(e,t,n)=>{let o=Cpn(t),r=Cpn(n);if(Math.abs(e.start.x-e.end.x)<pr){let i=e.start.x,s=Math.min(e.start.y,e.end.y),a=Math.max(e.start.y,e.end.y);return bpn(i,o.x,r.x)&&p6(s,a,t.minY,t.maxY)&&p6(s,a,n.minY,n.maxY)}if(Math.abs(e.start.y-e.end.y)<pr){let i=e.start.y,s=Math.min(e.start.x,e.end.x),a=Math.max(e.start.x,e.end.x);return bpn(i,o.y,r.y)&&p6(s,a,t.minX,t.maxX)&&p6(s,a,n.minX,n.maxX)}return!1},rBr=(e,t)=>{let n=new Set;for(let o=0;o<t.length;o++){let r=t[o];if(!r)continue;for(let i=o+1;i<t.length;i++){let s=t[i];if(!s)continue;if(e.some((a)=>oBr(a,r,s)))n.add(`${o}:${i}`)}}return n},iBr=(e,t,n)=>{let o=rBr(e,t);return[...n].every((r)=>o.has(r))},uJ=(e)=>{let t=new Map,n=e.map((s)=>[s.start,s.end]),o=(s,a)=>{let c=m6(s),l=m6(a);if(!t.has(c))t.set(c,new Set);if(!t.has(l))t.set(l,new Set);t.get(c)?.add(l),t.get(l)?.add(c)};for(let s=0;s<e.length;s++){let a=e[s];if(!a||Ihe(a))continue;for(let c=s+1;c<e.length;c++){let l=e[c];if(!l||Ihe(l))continue;let h=Math.abs(a.start.x-a.end.x)<pr,d=Math.abs(a.start.y-a.end.y)<pr,u=Math.abs(l.start.x-l.end.x)<pr,_=Math.abs(l.start.y-l.end.y)<pr;if(h&&_){let p={x:a.start.x,y:l.start.y};if(am(a,p)&&am(l,p))n[s]?.push(p),n[c]?.push(p)}if(d&&u){let p={x:l.start.x,y:a.start.y};if(am(a,p)&&am(l,p))n[s]?.push(p),n[c]?.push(p)}}}for(let s=0;s<e.length;s++){let a=e[s];if(!a||Ihe(a))continue;let c=[...new Map(n[s]?.map((l)=>[m6(l),l]))].map(([,l])=>l).sort((l,h)=>Math.abs(a.start.x-a.end.x)<pr?l.y-h.y:l.x-h.x);for(let l=0;l+1<c.length;l++){let h=c[l],d=c[l+1];if(h&&d&&!gk(h,d))o(h,d)}}let r=0,i=new Set;for(let s of t.keys()){if(i.has(s))continue;r++;let a=[s];i.add(s);while(a.length>0){let c=a.pop();if(!c)continue;for(let l of t.get(c)??[]){if(i.has(l))continue;i.add(l),a.push(l)}}}return r},sBr=(e,t,n)=>{let o=e,r=!0;while(r){r=!1;let i=Tpn(o);for(let s=0;s<o.length;s++){let a=o[s];if(!a)continue;for(let c of["start","end"]){let l=a[c];if(i.get(m6(l))!==1)continue;let h=[],d=Math.abs(a.start.x-a.end.x)<pr,u=Math.abs(a.start.y-a.end.y)<pr;for(let p=0;p<o.length;p++){if(s===p)continue;let m=o[p];if(!m)continue;if(d&&Math.abs(m.start.y-m.end.y)<pr){let A={x:a.start.x,y:m.start.y};if(am(m,A))h.push(A)}if(u&&Math.abs(m.start.x-m.end.x)<pr){let A={x:m.start.x,y:a.start.y};if(am(m,A))h.push(A)}}let _=h.filter((p)=>!gk(p,l)).map((p)=>({point:p,line:aIe(a,c,p)})).filter(({line:p})=>lJ([p])>lJ([a])+pr).filter(({line:p})=>!n?.preserveOriginalSpan||am(p,l)).filter(({line:p})=>Mhe([p],t)).sort((p,m)=>lJ([p.line])-lJ([m.line])||JSON.stringify(p.point).localeCompare(JSON.stringify(m.point))).at(0);if(!_)continue;o=o.map((p,m)=>m===s?_.line:p),r=!0;break}if(r)break}}return o},aBr=(e,t)=>{let n=[],o=Math.abs(e.start.x-e.end.x)<pr,r=Math.abs(e.start.y-e.end.y)<pr;for(let i of t){if(i===e)continue;let s=Math.abs(i.start.x-i.end.x)<pr,a=Math.abs(i.start.y-i.end.y)<pr;if(o&&a){let c={x:e.start.x,y:i.start.y};if(am(e,c)&&am(i,c))n.push(c)}if(r&&s){let c={x:i.start.x,y:e.start.y};if(am(e,c)&&am(i,c))n.push(c)}}return n},cBr=(e,t,n)=>{let o=e,r=!0;while(r){r=!1;let i=Tpn(o),s=uJ(o);for(let a=0;a<o.length;a++){let c=o[a];if(!c)continue;let l=aBr(c,o).filter((h)=>!gk(h,c.start)&&!gk(h,c.end));if(l.length===0)continue;for(let h of["start","end"]){let d=c[h];if(i.get(m6(d))!==1)continue;if(Zwr(d,t))continue;let u=l.map((A)=>({point:A,distance:Math.abs(A.x-d.x)+Math.abs(A.y-d.y)})).sort((A,g)=>A.distance-g.distance).at(0);if(!u)continue;let _={start:d,end:u.point};if(nBr(_,t))continue;let p=aIe(c,h,u.point);if(!Mhe([p],t))continue;let m=o.map((A,g)=>g===a?p:A);if(uJ(m)>s)continue;if(n&&!iBr(m,t,n))continue;o=m,r=!0;break}if(r)break}}return o},lBr=(e)=>{let{start:t,end:n}=e;if(t.y===n.y&&t.x>n.x)[t,n]=[{x:n.x,y:t.y},{x:t.x,y:n.y}];else if(t.x===n.x&&t.y>n.y)[t,n]=[{x:t.x,y:n.y},{x:n.x,y:t.y}];return{start:t,end:n}},btt=(e)=>{if(!e||e.length===0)return[];let t=e.map(lBr),n=[],o=[];for(let a of t)if(a.start.y===a.end.y)n.push(a);else if(a.start.x===a.end.x)o.push(a);let r=[],i=new Map;for(let a of n){let c=i.get(a.start.y)??[];c.push(a),i.set(a.start.y,c)}for(let[,a]of i){a.sort((l,h)=>l.start.x-h.start.x);let c;for(let l of a){if(!c){c={...l};continue}if(l.start.x<=c.end.x)c.end.x=Math.max(c.end.x,l.end.x);else r.push(c),c={...l}}if(c)r.push(c)}let s=new Map;for(let a of o){let c=s.get(a.start.x)??[];c.push(a),s.set(a.start.x,c)}for(let[,a]of s){a.sort((l,h)=>l.start.y-h.start.y);let c;for(let l of a){if(!c){c={...l};continue}if(l.start.y<=c.end.y)c.end.y=Math.max(c.end.y,l.end.y);else r.push(c),c={...l}}if(c)r.push(c)}return r},bhe=(e)=>{let t=[];for(let n=0;n+1<e.length;n++){let o=e[n],r=e[n+1];if(!o||!r||gk(o,r))continue;t.push({start:o,end:r})}return t},hBr=(e,t)=>{let n=bhe(e),o=e.at(0),r=e.at(-1);if(!o||!r||n.length<2)return n;let i=[];if(Math.abs(o.x-r.x)<pr||Math.abs(o.y-r.y)<pr)i.push([{start:o,end:r}]);else i.push(bhe([o,{x:o.x,y:r.y},r]),bhe([o,{x:r.x,y:o.y},r]));let s=[...new Set(e.map((l)=>l.x))],a=[...new Set(e.map((l)=>l.y))];for(let l of s){if(Math.abs(l-o.x)<pr||Math.abs(l-r.x)<pr)continue;i.push(bhe([o,{x:l,y:o.y},{x:l,y:r.y},r]))}for(let l of a){if(Math.abs(l-o.y)<pr||Math.abs(l-r.y)<pr)continue;i.push(bhe([o,{x:o.x,y:l},{x:r.x,y:l},r]))}return i.filter((l)=>l.length<n.length).filter((l)=>Mhe(l,t)).sort((l,h)=>l.length-h.length||lJ(l)-lJ(h)||JSON.stringify(l).localeCompare(JSON.stringify(h))).at(0)??n},dBr=(e,t)=>{let n=new Map,o=new Map,r=(a)=>{let c=m6(a);if(n.set(c,a),!o.has(c))o.set(c,new Set);return c};for(let a of e){if(Ihe(a))continue;let c=r(a.start),l=r(a.end);o.get(c)?.add(l),o.get(l)?.add(c)}let i=new Set,s=[];for(let[a,c]of o){if(c.size===2)continue;for(let l of c){let h=nIe(n.get(a),n.get(l));if(i.has(h))continue;let d=[n.get(a)],u=a,_=l;while(!0){i.add(nIe(n.get(u),n.get(_))),d.push(n.get(_));let p=o.get(_);if(!p||p.size!==2)break;let m=[...p].find((g)=>g!==u);if(!m)break;let A=nIe(n.get(_),n.get(m));if(i.has(A))break;u=_,_=m}s.push(...hBr(d,t))}}for(let[a,c]of o)for(let l of c){let h=nIe(n.get(a),n.get(l));if(i.has(h))continue;i.add(h),s.push({start:n.get(a),end:n.get(l)})}return s},uBr=(e,t)=>{let n=e,o=!0;while(o){o=!1;let r=uJ(n),i=btt(n).length;for(let s=0;s<n.length;s++){let a=n[s];if(!a)continue;let c=Math.abs(a.start.x-a.end.x)<pr,l=Math.abs(a.start.y-a.end.y)<pr;if(!c&&!l)continue;for(let h=0;h<n.length;h++){if(s===h)continue;let d=n[h];if(!d)continue;let u=Math.abs(d.start.x-d.end.x)<pr,_=Math.abs(d.start.y-d.end.y)<pr;if(c!==u||l!==_)continue;if(c&&Math.abs(a.start.x-d.start.x)<pr||l&&Math.abs(a.start.y-d.start.y)<pr)continue;if(!n.some((f,y)=>{if(y===s||y===h)return!1;if(c&&Math.abs(f.start.y-f.end.y)<pr)return am(f,{x:a.start.x,y:f.start.y})&&am(a,{x:a.start.x,y:f.start.y})&&am(f,{x:d.start.x,y:f.start.y})&&am(d,{x:d.start.x,y:f.start.y});if(l&&Math.abs(f.start.x-f.end.x)<pr)return am(f,{x:f.start.x,y:a.start.y})&&am(a,{x:f.start.x,y:a.start.y})&&am(f,{x:f.start.x,y:d.start.y})&&am(d,{x:f.start.x,y:d.start.y});return!1}))continue;let m;if(c)m={start:{x:d.start.x,y:a.start.y},end:{x:d.start.x,y:a.end.y}};else m={start:{x:a.start.x,y:d.start.y},end:{x:a.end.x,y:d.start.y}};if(!Mhe([m],t))continue;let A=n.map((f,y)=>{if(y===s)return m;return f});if(uJ(A)>r)continue;let g=btt(A);if(g.length>=i)continue;n=g,o=!0;break}if(o)break}}return n},pBr=(e,t)=>{let n=e,o=!0;while(o){o=!1;let r=uJ(n);for(let i=0;i<n.length;i++){let s=n[i];if(!s)continue;let a=Math.abs(s.start.y-s.end.y)<pr,c=Math.abs(s.start.x-s.end.x)<pr;if(!a&&!c)continue;for(let l=0;l<n.length;l++){if(i===l)continue;let h=n[l];if(!h)continue;let d=Math.abs(h.start.y-h.end.y)<pr,u=Math.abs(h.start.x-h.end.x)<pr;if(a!==d)continue;if(c!==u)continue;let _=[s.start,s.end],p;if(a)p=_.map((f)=>({x:f.x,y:h.start.y}));else p=_.map((f)=>({x:h.start.x,y:f.y}));if(!p.every((f)=>am(h,f)))continue;let m=new Map,A=!0;for(let f=0;f<_.length;f++){let y=_[f],x=p[f];if(!y||!x){A=!1;break}let C=n.findIndex((M,B)=>{if(B===i||B===l)return!1;let T=Math.abs(M.start.y-M.end.y)<pr,N=Math.abs(M.start.x-M.end.x)<pr;return(a&&N||c&&T)&&am(M,y)});if(C===-1)continue;let b=n[C];if(!b){A=!1;break}let I=gk(b.start,y),v=gk(b.end,y);if(!I&&!v&&am(b,x))continue;if(!I&&!v){A=!1;break}let P;if(I)P=aIe(b,"start",x);else P=aIe(b,"end",x);if(!Mhe([P],t)){A=!1;break}m.set(C,P)}if(!A)continue;let g=n.map((f,y)=>m.get(y)??f).filter((f,y)=>y!==i);if(uJ(g)>r)continue;n=g,o=!0;break}if(o)break}}return n},Dpn=((e)=>(e[e.MergeAlignedSegments=0]="MergeAlignedSegments",e[e.SimplifyChains=1]="SimplifyChains",e[e.ConnectDanglingEndpoints=2]="ConnectDanglingEndpoints",e[e.AlignParallelLinesAcrossConnectors=3]="AlignParallelLinesAcrossConnectors",e[e.RemoveRedundantParallelBridges=4]="RemoveRedundantParallelBridges",e[e.TrimDanglingOverhangs=5]="TrimDanglingOverhangs",e))(Dpn||{}),mBr=class extends po{constructor(e){super();this.params=e;let t=e.offsetX??0,n=e.offsetY??0;this._inputRects=e.cellContents.map((o)=>({minX:o.x+t,minY:o.y+n,maxX:o.x+o.width+t,maxY:o.y+o.height+n}))}params;mergedOriginalLines=[];reducedLines=[];_stage=0;_currentLines=[];_inputRects;_step(){let{outlineLines:e}=this.params,t=this.params.offsetX??0,n=this.params.offsetY??0,o=this._inputRects;switch(this._stage){case 0:{let i=btt(e.map((s)=>({start:{x:s.start.x+t,y:s.start.y+n},end:{x:s.end.x+t,y:s.end.y+n}})));this._currentLines=i,this.mergedOriginalLines=i.map((s)=>({start:{x:s.start.x,y:s.start.y},end:{x:s.end.x,y:s.end.y}}));break}case 1:this._currentLines=dBr(this._currentLines,o);break;case 2:this._currentLines=sBr(this._currentLines,o);break;case 3:this._currentLines=uBr(this._currentLines,o);break;case 4:this._currentLines=pBr(this._currentLines,o);break;case 5:this._currentLines=cBr(this._currentLines,o),this.reducedLines=this._currentLines.map((i)=>({start:{x:i.start.x-t,y:i.start.y-n},end:{x:i.end.x-t,y:i.end.y-n}})),this.mergedOriginalLines=this.mergedOriginalLines.map((i)=>({start:{x:i.start.x-t,y:i.start.y-n},end:{x:i.end.x-t,y:i.end.y-n}})),this.solved=!0;break}let r=this.getNextStage(this._stage);if(r)this._stage=r}getNextStage(e){let t=Object.values(Dpn);return t[t.indexOf(e)+1]}getOutput(){return this.reducedLines}getConstructorParams(){return[this.params]}visualize(){let{cellContents:e,outlineLines:t}=this.params;return{rects:e.map((n)=>({center:{x:n.x+n.width/2,y:n.y+n.height/2},width:n.width,height:n.height,fill:"rgba(255, 165, 0, 0.2)",stroke:"#c87000"})),lines:[...t.map((n)=>({points:[n.start,n.end],strokeColor:"rgba(180, 180, 180, 0.4)",strokeWidth:1,strokeDash:[4,4]})),...this._currentLines.map((n)=>({points:[n.start,n.end],strokeColor:"#0055cc",strokeWidth:2}))]}}},Ti=0.001,Npn=(e,t,n=Ti)=>Math.abs(e.x-t.x)<n&&Math.abs(e.y-t.y)<n,Ctt=(e)=>`${e.x.toFixed(4)},${e.y.toFixed(4)}`,sIe=(e)=>Npn(e.start,e.end),_Br=(e)=>Math.abs(e.start.x-e.end.x)<Ti||Math.abs(e.start.y-e.end.y)<Ti,hJ=(e,t,n,o)=>Math.min(t,o)-Math.max(e,n)>Ti,cIe=(e)=>e.reduce((t,n)=>t+Math.abs(n.start.x-n.end.x)+Math.abs(n.start.y-n.end.y),0),oIe=(e,t)=>{if(Math.abs(e.start.x-e.end.x)<Ti)return Math.abs(t.x-e.start.x)<Ti&&t.y>=Math.min(e.start.y,e.end.y)-Ti&&t.y<=Math.max(e.start.y,e.end.y)+Ti;if(Math.abs(e.start.y-e.end.y)<Ti)return Math.abs(t.y-e.start.y)<Ti&&t.x>=Math.min(e.start.x,e.end.x)-Ti&&t.x<=Math.max(e.start.x,e.end.x)+Ti;return!1},She=(e)=>({x:(e.minX+e.maxX)/2,y:(e.minY+e.maxY)/2}),Ipn=(e,t,n)=>e>Math.min(t,n)+Ti&&e<Math.max(t,n)-Ti,gBr=(e,t)=>{let n=e.start.x,o=e.start.y,r=e.end.x,i=e.end.y;if(Math.abs(n-r)<Ti){let s=Math.min(o,i),a=Math.max(o,i);return n>t.minX+Ti&&n<t.maxX-Ti&&a>t.minY-Ti&&s<t.maxY+Ti}if(Math.abs(o-i)<Ti){let s=Math.min(n,r),a=Math.max(n,r);return o>t.minY+Ti&&o<t.maxY-Ti&&a>t.minX+Ti&&s<t.maxX-Ti}return!0},ABr=(e,t)=>{let n=e.start.x,o=e.start.y,r=e.end.x,i=e.end.y;if(Math.abs(n-r)<Ti){let s=Math.min(o,i),a=Math.max(o,i);return(Math.abs(n-t.minX)<Ti||Math.abs(n-t.maxX)<Ti)&&hJ(s,a,t.minY,t.maxY)}if(Math.abs(o-i)<Ti){let s=Math.min(n,r),a=Math.max(n,r);return(Math.abs(o-t.minY)<Ti||Math.abs(o-t.maxY)<Ti)&&hJ(s,a,t.minX,t.maxX)}return!1},Itt=(e,t)=>e.length>0&&e.every((n)=>!sIe(n)&&_Br(n)&&!t.some((o)=>gBr(n,o)||ABr(n,o))),Rpn=(e,t,n)=>{let o=She(t),r=She(n);if(Math.abs(e.start.x-e.end.x)<Ti){let i=e.start.x,s=Math.min(e.start.y,e.end.y),a=Math.max(e.start.y,e.end.y);return Ipn(i,o.x,r.x)&&hJ(s,a,t.minY,t.maxY)&&hJ(s,a,n.minY,n.maxY)}if(Math.abs(e.start.y-e.end.y)<Ti){let i=e.start.y,s=Math.min(e.start.x,e.end.x),a=Math.max(e.start.x,e.end.x);return Ipn(i,o.y,r.y)&&hJ(s,a,t.minX,t.maxX)&&hJ(s,a,n.minX,n.maxX)}return!1},uIe=(e,t)=>{let n=new Set;for(let o=0;o<t.length;o++){let r=t[o];if(!r)continue;for(let i=o+1;i<t.length;i++){let s=t[i];if(!s)continue;if(e.some((a)=>Rpn(a,r,s)))n.add(`${o}:${i}`)}}return n},fBr=(e,t,n)=>{let o=uIe(e,t);return[...n].every((r)=>o.has(r))},Qpn=(e,t)=>{let n=new Set,o=new Set;for(let r of t)n.add(r.minX),n.add(r.maxX),n.add(She(r).x),o.add(r.minY),o.add(r.maxY),o.add(She(r).y);for(let r of e)n.add(r.start.x),n.add(r.end.x),o.add(r.start.y),o.add(r.end.y);return{xs:[...n].sort((r,i)=>r-i),ys:[...o].sort((r,i)=>r-i)}},yBr=(e,t,n,o)=>e.some((r)=>{if(Math.abs(r.start.x-r.end.x)>=Ti)return!1;if(Math.abs(r.start.x-t)>=Ti)return!1;let i=Math.min(r.start.y,r.end.y),s=Math.max(r.start.y,r.end.y);return n>=i-Ti&&o<=s+Ti}),xBr=(e,t,n,o)=>e.some((r)=>{if(Math.abs(r.start.y-r.end.y)>=Ti)return!1;if(Math.abs(r.start.y-t)>=Ti)return!1;let i=Math.min(r.start.x,r.end.x),s=Math.max(r.start.x,r.end.x);return n>=i-Ti&&o<=s+Ti}),CBr=(e,t)=>{let{xs:n,ys:o}=Qpn(e,t),r=n.length-1,i=o.length-1,s=new Map,a=(l,h)=>`${l}:${h}`,c=0;for(let l=0;l<r;l++)for(let h=0;h<i;h++){let d=a(l,h);if(s.has(d))continue;let u=[{x:l,y:h}];s.set(d,c);while(u.length>0){let _=u.pop();if(!_)continue;let p=[{x:_.x-1,y:_.y},{x:_.x+1,y:_.y},{x:_.x,y:_.y-1},{x:_.x,y:_.y+1}];for(let m of p){if(m.x<0||m.x>=r||m.y<0||m.y>=i)continue;let A=a(m.x,m.y);if(s.has(A))continue;let g=!1;if(m.x!==_.x){let f=n[Math.max(m.x,_.x)],y=o[_.y],x=o[_.y+1];if(f===void 0||y===void 0||x===void 0)continue;g=yBr(e,f,y,x)}else{let f=o[Math.max(m.y,_.y)],y=n[_.x],x=n[_.x+1];if(f===void 0||y===void 0||x===void 0)continue;g=xBr(e,f,y,x)}if(g)continue;s.set(A,c),u.push(m)}}c++}return t.map((l)=>{let h=She(l),d=n.findIndex((_,p)=>p+1<n.length&&h.x>=_-Ti&&h.x<=(n[p+1]??_)+Ti),u=o.findIndex((_,p)=>p+1<o.length&&h.y>=_-Ti&&h.y<=(o[p+1]??_)+Ti);return s.get(a(d,u))??-1})},lIe=(e,t)=>{let n=CBr(e,t),o=0;for(let r=0;r<n.length;r++)for(let i=r+1;i<n.length;i++)if(n[r]===n[i])o++;return o},vpn=(e)=>{let t=new Map,n=e.map((s)=>[s.start,s.end]),o=(s,a)=>{let c=Ctt(s),l=Ctt(a);if(!t.has(c))t.set(c,new Set);if(!t.has(l))t.set(l,new Set);t.get(c)?.add(l),t.get(l)?.add(c)};for(let s=0;s<e.length;s++){let a=e[s];if(!a||sIe(a))continue;for(let c=s+1;c<e.length;c++){let l=e[c];if(!l||sIe(l))continue;let h=Math.abs(a.start.x-a.end.x)<Ti,d=Math.abs(a.start.y-a.end.y)<Ti,u=Math.abs(l.start.x-l.end.x)<Ti,_=Math.abs(l.start.y-l.end.y)<Ti;if(h&&_){let p={x:a.start.x,y:l.start.y};if(oIe(a,p)&&oIe(l,p))n[s]?.push(p),n[c]?.push(p)}if(d&&u){let p={x:l.start.x,y:a.start.y};if(oIe(a,p)&&oIe(l,p))n[s]?.push(p),n[c]?.push(p)}}}for(let s=0;s<e.length;s++){let a=e[s];if(!a||sIe(a))continue;let c=[...new Map(n[s]?.map((l)=>[Ctt(l),l]))].map(([,l])=>l).sort((l,h)=>Math.abs(a.start.x-a.end.x)<Ti?l.y-h.y:l.x-h.x);for(let l=0;l+1<c.length;l++){let h=c[l],d=c[l+1];if(h&&d&&!Npn(h,d))o(h,d)}}let r=0,i=new Set;for(let s of t.keys()){if(i.has(s))continue;r++;let a=[s];i.add(s);while(a.length>0){let c=a.pop();if(!c)continue;for(let l of t.get(c)??[]){if(i.has(l))continue;i.add(l),a.push(l)}}}return r},bBr=(e)=>{let{start:t,end:n}=e;if(t.y===n.y&&t.x>n.x)[t,n]=[{x:n.x,y:t.y},{x:t.x,y:n.y}];else if(t.x===n.x&&t.y>n.y)[t,n]=[{x:t.x,y:n.y},{x:n.x,y:t.y}];return{start:t,end:n}},Ptt=(e)=>{if(!e||e.length===0)return[];let t=e.map(bBr),n=[],o=[];for(let a of t)if(a.start.y===a.end.y)n.push(a);else if(a.start.x===a.end.x)o.push(a);let r=[],i=new Map;for(let a of n){let c=i.get(a.start.y)??[];c.push(a),i.set(a.start.y,c)}for(let[,a]of i){a.sort((l,h)=>l.start.x-h.start.x);let c;for(let l of a){if(!c){c={...l};continue}if(l.start.x<=c.end.x+Ti)c.end.x=Math.max(c.end.x,l.end.x);else r.push(c),c={...l}}if(c)r.push(c)}let s=new Map;for(let a of o){let c=s.get(a.start.x)??[];c.push(a),s.set(a.start.x,c)}for(let[,a]of s){a.sort((l,h)=>l.start.y-h.start.y);let c;for(let l of a){if(!c){c={...l};continue}if(l.start.y<=c.end.y+Ti)c.end.y=Math.max(c.end.y,l.end.y);else r.push(c),c={...l}}if(c)r.push(c)}return r},IBr=(e,t,n,o)=>{let r=e;while(!0){let i=uIe(r,n),s=[...o].find((u)=>!i.has(u));if(!s)break;let[a,c]=s.split(":"),l=n[Number(a)],h=n[Number(c)];if(!l||!h)break;let d=t.filter((u)=>Rpn(u,l,h)).sort((u,_)=>cIe([u])-cIe([_])||JSON.stringify(u).localeCompare(JSON.stringify(_))).at(0);if(!d)break;r=Ptt([...r,d])}return r},vBr=(e,t,n)=>{let o=e;while(!0){let r=lIe(o,n);if(r===0)break;let{xs:i,ys:s}=Qpn(o,n),a=[];for(let l=0;l<o.length;l++){let h=o[l];if(!h)continue;if(Math.abs(h.start.y-h.end.y)<Ti){let d=Math.min(h.start.x,h.end.x),u=Math.max(h.start.x,h.end.x);for(let _ of i){if(_>=d-Ti&&_<=u+Ti)continue;let p={start:{x:Math.min(_,d),y:h.start.y},end:{x:Math.max(_,u),y:h.start.y}};if(!Itt([p],n))continue;a.push(o.map((m,A)=>{if(A===l)return p;return m}))}}if(Math.abs(h.start.x-h.end.x)<Ti){let d=Math.min(h.start.y,h.end.y),u=Math.max(h.start.y,h.end.y);for(let _ of s){if(_>=d-Ti&&_<=u+Ti)continue;let p={start:{x:h.start.x,y:Math.min(_,d)},end:{x:h.start.x,y:Math.max(_,u)}};if(!Itt([p],n))continue;a.push(o.map((m,A)=>{if(A===l)return p;return m}))}}}for(let l of t)a.push([...o,l]);let c=a.map((l)=>({lines:Ptt(l),shared:lIe(l,n)})).filter((l)=>l.shared<r).sort((l,h)=>l.shared-h.shared||l.lines.length-h.lines.length||cIe(l.lines)-cIe(h.lines)).at(0);if(!c)break;o=c.lines}return o},SBr=(e,t)=>{let n=e,o=!0;while(o){o=!1;let r=uIe(n,t),i=lIe(n,t),s=vpn(n);for(let a=0;a<n.length;a++){let c=n.filter((l,h)=>h!==a);if(!Itt(c,t))continue;if(!fBr(c,t,r))continue;if(lIe(c,t)>i)continue;if(vpn(c)>s)continue;n=c,o=!0;break}}return n},kpn=((e)=>(e[e.RestoreMissingSeparators=0]="RestoreMissingSeparators",e[e.FixSharedCellRegions=1]="FixSharedCellRegions",e[e.RemoveRedundantSeparators=2]="RemoveRedundantSeparators",e))(kpn||{}),PBr=class extends po{constructor(e){super();this.params=e,this._inputRects=e.cellContents.map((t)=>({minX:t.x,minY:t.y,maxX:t.x+t.width,maxY:t.y+t.height})),this._currentLines=e.reducedLines}params;repairedLines=[];_stage=0;_currentLines=[];_inputRects;_step(){let e=Ptt(this.params.originalLines),t=this._inputRects;switch(this._stage){case 0:{let o=uIe(e,t);this._currentLines=IBr(this._currentLines,e,t,o);break}case 1:this._currentLines=vBr(this._currentLines,e,t);break;case 2:this._currentLines=SBr(this._currentLines,t),this.repairedLines=this._currentLines,this.solved=!0;break}let n=this.getNextStage(this._stage);if(n)this._stage=n}getNextStage(e){let t=Object.values(kpn);return t[t.indexOf(e)+1]}getOutput(){return this.repairedLines}getConstructorParams(){return[this.params]}visualize(){let{cellContents:e,reducedLines:t}=this.params;return{rects:e.map((n)=>({center:{x:n.x+n.width/2,y:n.y+n.height/2},width:n.width,height:n.height,fill:"rgba(255, 165, 0, 0.2)",stroke:"#c87000"})),lines:[...t.map((n)=>({points:[n.start,n.end],strokeColor:"rgba(180, 180, 180, 0.4)",strokeWidth:1,strokeDash:[4,4]})),...this._currentLines.map((n)=>({points:[n.start,n.end],strokeColor:"#cc5500",strokeWidth:2}))]}}},wo=0.001,bY=(e,t,n=wo)=>Math.abs(e.x-t.x)<n&&Math.abs(e.y-t.y)<n,HB=(e)=>`${e.x.toFixed(4)},${e.y.toFixed(4)}`,vhe=(e)=>bY(e.start,e.end),EBr=(e)=>Math.abs(e.start.x-e.end.x)<wo||Math.abs(e.start.y-e.end.y)<wo,dJ=(e,t,n,o)=>Math.min(t,o)-Math.max(e,n)>wo,rIe=(e)=>e.reduce((t,n)=>t+Math.abs(n.start.x-n.end.x)+Math.abs(n.start.y-n.end.y),0),iu=(e,t)=>{if(Math.abs(e.start.x-e.end.x)<wo)return Math.abs(t.x-e.start.x)<wo&&t.y>=Math.min(e.start.y,e.end.y)-wo&&t.y<=Math.max(e.start.y,e.end.y)+wo;if(Math.abs(e.start.y-e.end.y)<wo)return Math.abs(t.y-e.start.y)<wo&&t.x>=Math.min(e.start.x,e.end.x)-wo&&t.x<=Math.max(e.start.x,e.end.x)+wo;return!1},hIe=(e,t,n)=>t==="start"?{start:n,end:e.end}:{start:e.start,end:n},dIe=(e,t)=>t==="start"?e.end:e.start,Phe=(e)=>({x:(e.minX+e.maxX)/2,y:(e.minY+e.maxY)/2}),Spn=(e,t,n)=>e>Math.min(t,n)+wo&&e<Math.max(t,n)-wo,Lpn=(e)=>{let t=new Map;for(let n of e)t.set(HB(n.start),(t.get(HB(n.start))??0)+1),t.set(HB(n.end),(t.get(HB(n.end))??0)+1);return t},MBr=(e,t)=>t.some((n)=>{let o=(Math.abs(e.x-n.minX)<wo||Math.abs(e.x-n.maxX)<wo)&&e.y>=n.minY-wo&&e.y<=n.maxY+wo,r=(Math.abs(e.y-n.minY)<wo||Math.abs(e.y-n.maxY)<wo)&&e.x>=n.minX-wo&&e.x<=n.maxX+wo;return o||r}),vtt=(e,t)=>{if(Math.abs(e.start.x-e.end.x)>=wo)return;if(Math.abs(e.start.y-t)<wo)return"start";if(Math.abs(e.end.y-t)<wo)return"end";return},Ppn=(e,t)=>{if(Math.abs(e.start.y-e.end.y)>=wo)return;if(Math.abs(e.start.x-t)<wo)return"start";if(Math.abs(e.end.x-t)<wo)return"end";return},wBr=(e,t)=>{let n=e.start.x,o=e.start.y,r=e.end.x,i=e.end.y;if(Math.abs(n-r)<wo){let s=Math.min(o,i),a=Math.max(o,i);return n>t.minX+wo&&n<t.maxX-wo&&a>t.minY-wo&&s<t.maxY+wo}if(Math.abs(o-i)<wo){let s=Math.min(n,r),a=Math.max(n,r);return o>t.minY+wo&&o<t.maxY-wo&&a>t.minX+wo&&s<t.maxX-wo}return!0},BBr=(e,t)=>{let n=e.start.x,o=e.start.y,r=e.end.x,i=e.end.y;if(Math.abs(n-r)<wo){let s=Math.min(o,i),a=Math.max(o,i);return(Math.abs(n-t.minX)<wo||Math.abs(n-t.maxX)<wo)&&dJ(s,a,t.minY,t.maxY)}if(Math.abs(o-i)<wo){let s=Math.min(n,r),a=Math.max(n,r);return(Math.abs(o-t.minY)<wo||Math.abs(o-t.maxY)<wo)&&dJ(s,a,t.minX,t.maxX)}return!1},w5=(e,t)=>e.length>0&&e.every((n)=>!vhe(n)&&EBr(n)&&!t.some((o)=>wBr(n,o)||BBr(n,o))),TBr=(e,t,n)=>{let o=Phe(t),r=Phe(n);if(Math.abs(e.start.x-e.end.x)<wo){let i=e.start.x,s=Math.min(e.start.y,e.end.y),a=Math.max(e.start.y,e.end.y);return Spn(i,o.x,r.x)&&dJ(s,a,t.minY,t.maxY)&&dJ(s,a,n.minY,n.maxY)}if(Math.abs(e.start.y-e.end.y)<wo){let i=e.start.y,s=Math.min(e.start.x,e.end.x),a=Math.max(e.start.x,e.end.x);return Spn(i,o.y,r.y)&&dJ(s,a,t.minX,t.maxX)&&dJ(s,a,n.minX,n.maxX)}return!1},FB=(e,t)=>{let n=new Set;for(let o=0;o<t.length;o++){let r=t[o];if(!r)continue;for(let i=o+1;i<t.length;i++){let s=t[i];if(!s)continue;if(e.some((a)=>TBr(a,r,s)))n.add(`${o}:${i}`)}}return n},whe=(e,t,n)=>{let o=FB(e,t);return[...n].every((r)=>o.has(r))},DBr=(e,t)=>{let n=new Set,o=new Set;for(let r of t)n.add(r.minX),n.add(r.maxX),n.add(Phe(r).x),o.add(r.minY),o.add(r.maxY),o.add(Phe(r).y);for(let r of e)n.add(r.start.x),n.add(r.end.x),o.add(r.start.y),o.add(r.end.y);return{xs:[...n].sort((r,i)=>r-i),ys:[...o].sort((r,i)=>r-i)}},NBr=(e,t,n,o)=>e.some((r)=>{if(Math.abs(r.start.x-r.end.x)>=wo)return!1;if(Math.abs(r.start.x-t)>=wo)return!1;let i=Math.min(r.start.y,r.end.y),s=Math.max(r.start.y,r.end.y);return n>=i-wo&&o<=s+wo}),RBr=(e,t,n,o)=>e.some((r)=>{if(Math.abs(r.start.y-r.end.y)>=wo)return!1;if(Math.abs(r.start.y-t)>=wo)return!1;let i=Math.min(r.start.x,r.end.x),s=Math.max(r.start.x,r.end.x);return n>=i-wo&&o<=s+wo}),QBr=(e,t)=>{let{xs:n,ys:o}=DBr(e,t),r=n.length-1,i=o.length-1,s=new Map,a=(l,h)=>`${l}:${h}`,c=0;for(let l=0;l<r;l++)for(let h=0;h<i;h++){let d=a(l,h);if(s.has(d))continue;let u=[{x:l,y:h}];s.set(d,c);while(u.length>0){let _=u.pop();if(!_)continue;let p=[{x:_.x-1,y:_.y},{x:_.x+1,y:_.y},{x:_.x,y:_.y-1},{x:_.x,y:_.y+1}];for(let m of p){if(m.x<0||m.x>=r||m.y<0||m.y>=i)continue;let A=a(m.x,m.y);if(s.has(A))continue;let g=!1;if(m.x!==_.x){let f=n[Math.max(m.x,_.x)],y=o[_.y],x=o[_.y+1];if(f===void 0||y===void 0||x===void 0)continue;g=NBr(e,f,y,x)}else{let f=o[Math.max(m.y,_.y)],y=n[_.x],x=n[_.x+1];if(f===void 0||y===void 0||x===void 0)continue;g=RBr(e,f,y,x)}if(g)continue;s.set(A,c),u.push(m)}}c++}return t.map((l)=>{let h=Phe(l),d=n.findIndex((_,p)=>p+1<n.length&&h.x>=_-wo&&h.x<=(n[p+1]??_)+wo),u=o.findIndex((_,p)=>p+1<o.length&&h.y>=_-wo&&h.y<=(o[p+1]??_)+wo);return s.get(a(d,u))??-1})},aP=(e,t)=>{let n=QBr(e,t),o=0;for(let r=0;r<n.length;r++)for(let i=r+1;i<n.length;i++)if(n[r]===n[i])o++;return o},mv=(e)=>{let t=new Map,n=e.map((s)=>[s.start,s.end]),o=(s,a)=>{let c=HB(s),l=HB(a);if(!t.has(c))t.set(c,new Set);if(!t.has(l))t.set(l,new Set);t.get(c)?.add(l),t.get(l)?.add(c)};for(let s=0;s<e.length;s++){let a=e[s];if(!a||vhe(a))continue;for(let c=s+1;c<e.length;c++){let l=e[c];if(!l||vhe(l))continue;let h=Math.abs(a.start.x-a.end.x)<wo,d=Math.abs(a.start.y-a.end.y)<wo,u=Math.abs(l.start.x-l.end.x)<wo,_=Math.abs(l.start.y-l.end.y)<wo;if(h&&_){let p={x:a.start.x,y:l.start.y};if(iu(a,p)&&iu(l,p))n[s]?.push(p),n[c]?.push(p)}if(d&&u){let p={x:l.start.x,y:a.start.y};if(iu(a,p)&&iu(l,p))n[s]?.push(p),n[c]?.push(p)}}}for(let s=0;s<e.length;s++){let a=e[s];if(!a||vhe(a))continue;let c=[...new Map(n[s]?.map((l)=>[HB(l),l]))].map(([,l])=>l).sort((l,h)=>Math.abs(a.start.x-a.end.x)<wo?l.y-h.y:l.x-h.x);for(let l=0;l+1<c.length;l++){let h=c[l],d=c[l+1];if(h&&d&&!bY(h,d))o(h,d)}}let r=0,i=new Set;for(let s of t.keys()){if(i.has(s))continue;r++;let a=[s];i.add(s);while(a.length>0){let c=a.pop();if(!c)continue;for(let l of t.get(c)??[]){if(i.has(l))continue;i.add(l),a.push(l)}}}return r},Stt=(e,t,n)=>{let o=e,r=!0;while(r){r=!1;let i=Lpn(o);for(let s=0;s<o.length;s++){let a=o[s];if(!a)continue;for(let c of["start","end"]){let l=a[c];if(i.get(HB(l))!==1)continue;let h=[],d=Math.abs(a.start.x-a.end.x)<wo,u=Math.abs(a.start.y-a.end.y)<wo;for(let p=0;p<o.length;p++){if(s===p)continue;let m=o[p];if(!m)continue;if(d&&Math.abs(m.start.y-m.end.y)<wo){let A={x:a.start.x,y:m.start.y};if(iu(m,A))h.push(A)}if(u&&Math.abs(m.start.x-m.end.x)<wo){let A={x:m.start.x,y:a.start.y};if(iu(m,A))h.push(A)}}let _=h.filter((p)=>!bY(p,l)).map((p)=>({point:p,line:hIe(a,c,p)})).filter(({line:p})=>rIe([p])>rIe([a])+wo).filter(({line:p})=>!n?.preserveOriginalSpan||iu(p,l)).filter(({line:p})=>w5([p],t)).sort((p,m)=>rIe([p.line])-rIe([m.line])||JSON.stringify(p.point).localeCompare(JSON.stringify(m.point))).at(0);if(!_)continue;o=o.map((p,m)=>m===s?_.line:p),r=!0;break}if(r)break}}return o},kBr=(e,t)=>{let n=[],o=Math.abs(e.start.x-e.end.x)<wo,r=Math.abs(e.start.y-e.end.y)<wo;for(let i of t){if(i===e)continue;let s=Math.abs(i.start.x-i.end.x)<wo,a=Math.abs(i.start.y-i.end.y)<wo;if(o&&a){let c={x:e.start.x,y:i.start.y};if(iu(e,c)&&iu(i,c))n.push(c)}if(r&&s){let c={x:i.start.x,y:e.start.y};if(iu(e,c)&&iu(i,c))n.push(c)}}return n},Epn=(e,t,n)=>{let o=e,r=!0;while(r){r=!1;let i=Lpn(o),s=mv(o);for(let a=0;a<o.length;a++){let c=o[a];if(!c)continue;let l=kBr(c,o).filter((h)=>!bY(h,c.start)&&!bY(h,c.end));if(l.length===0)continue;for(let h of["start","end"]){let d=c[h];if(i.get(HB(d))!==1)continue;if(MBr(d,t))continue;let u=l.map((m)=>({point:m,distance:Math.abs(m.x-d.x)+Math.abs(m.y-d.y)})).sort((m,A)=>m.distance-A.distance).at(0);if(!u)continue;let _=hIe(c,h,u.point);if(!w5([_],t))continue;let p=o.map((m,A)=>A===a?_:m);if(mv(p)>s)continue;if(n&&!whe(p,t,n))continue;o=p,r=!0;break}if(r)break}}return o},LBr=(e)=>{let{start:t,end:n}=e;if(t.y===n.y&&t.x>n.x)[t,n]=[{x:n.x,y:t.y},{x:t.x,y:n.y}];else if(t.x===n.x&&t.y>n.y)[t,n]=[{x:t.x,y:n.y},{x:n.x,y:t.y}];return{start:t,end:n}},Ehe=(e)=>{if(!e||e.length===0)return[];let t=e.map(LBr),n=[],o=[];for(let a of t)if(a.start.y===a.end.y)n.push(a);else if(a.start.x===a.end.x)o.push(a);let r=[],i=new Map;for(let a of n){let c=i.get(a.start.y)??[];c.push(a),i.set(a.start.y,c)}for(let[,a]of i){a.sort((l,h)=>l.start.x-h.start.x);let c;for(let l of a){if(!c){c={...l};continue}if(l.start.x<=c.end.x)c.end.x=Math.max(c.end.x,l.end.x);else r.push(c),c={...l}}if(c)r.push(c)}let s=new Map;for(let a of o){let c=s.get(a.start.x)??[];c.push(a),s.set(a.start.x,c)}for(let[,a]of s){a.sort((l,h)=>l.start.y-h.start.y);let c;for(let l of a){if(!c){c={...l};continue}if(l.start.y<=c.end.y)c.end.y=Math.max(c.end.y,l.end.y);else r.push(c),c={...l}}if(c)r.push(c)}return r},HBr=(e,t)=>{let n=e,o=!0,r=(i)=>{let s=FB(n,t),a=FB(i,t);return[...s].every((c)=>a.has(c))};while(o){o=!1;let i=aP(n,t);for(let a=0;a<n.length;a++){let c=n[a];if(!c||Math.abs(c.start.y-c.end.y)>=wo)continue;let l=c.start.y;for(let h=0;h<n.length;h++){if(h===a)continue;let d=n[h];if(!d)continue;let u=vtt(d,l);if(!u)continue;if(!iu(c,{x:d.start.x,y:l}))continue;for(let _=h+1;_<n.length;_++){if(_===a)continue;let p=n[_];if(!p)continue;let m=vtt(p,l);if(!m)continue;if(!iu(c,{x:p.start.x,y:l}))continue;let A=dIe(d,u),g=dIe(p,m);if((A.y-l)*(g.y-l)>=-wo)continue;let f=(d.start.x+p.start.x)/2,y={start:{x:f,y:Math.min(A.y,g.y)},end:{x:f,y:Math.max(A.y,g.y)}};if(!w5([y],t))continue;let x=n.filter((C,b)=>b!==h&&b!==_).concat(y);if(!w5(x,t))continue;if(!r(x))continue;if(aP(x,t)>i)continue;n=Ehe(x),o=!0;break}if(o)break}if(o)break}if(o)continue;let s=mv(n);for(let a=0;a<n.length;a++){let c=n[a];if(!c||Math.abs(c.start.x-c.end.x)>=wo)continue;for(let l=a+1;l<n.length;l++){let h=n[l];if(!h||Math.abs(h.start.x-h.end.x)>=wo)continue;if(Math.abs(c.start.x-h.start.x)<wo)continue;let d=Math.max(Math.min(c.start.y,c.end.y),Math.min(h.start.y,h.end.y)),u=Math.min(Math.max(c.start.y,c.end.y),Math.max(h.start.y,h.end.y));if(u-d<-wo)continue;if(!n.some((g,f)=>{if(f===a||f===l)return!1;if(Math.abs(g.start.y-g.end.y)>=wo)return!1;let y=g.start.y;if(y<d-wo||y>u+wo)return!1;return iu(g,{x:c.start.x,y})&&iu(g,{x:h.start.x,y})}))continue;let p=Math.min(c.start.y,c.end.y,h.start.y,h.end.y),m=Math.max(c.start.y,c.end.y,h.start.y,h.end.y),A=[c.start.x,h.start.x].map((g)=>({start:{x:g,y:p},end:{x:g,y:m}})).filter((g)=>w5([g],t));for(let g of A){let f=n.filter((y,x)=>x!==a&&x!==l).concat(g);if(!w5(f,t))continue;if(!r(f))continue;if(mv(f)>s)continue;if(aP(f,t)>i)continue;for(let y=0;y<f.length;){let x=f[y];if(!x||Math.abs(x.start.y-x.end.y)>=wo||x.start.y<d-wo||x.start.y>u+wo||!iu(x,{x:c.start.x,y:x.start.y})||!iu(x,{x:h.start.x,y:x.start.y})){y++;continue}let C=f.filter((b,I)=>I!==y);if(w5(C,t)&&r(C)&&mv(C)<=s&&aP(C,t)<=i){f=C;continue}y++}n=Ehe(f),o=!0;break}if(o)break}if(o)break}}return n},Mpn=(e,t)=>{let n=e,o=!0;while(o){o=!1;let r=aP(n,t),i=FB(n,t);for(let s=0;s<n.length;s++){let a=n[s];if(!a||Math.abs(a.start.x-a.end.x)>=wo)continue;let c=a.start.x;for(let l=0;l<n.length;l++){if(l===s)continue;let h=n[l];if(!h)continue;if(!Ppn(h,c))continue;if(!iu(a,{x:c,y:h.start.y}))continue;for(let d=l+1;d<n.length;d++){if(d===s)continue;let u=n[d];if(!u)continue;if(!iu(u,{x:c,y:u.start.y}))continue;if(!iu(a,{x:c,y:u.start.y}))continue;if(Math.abs(h.start.y-u.start.y)<wo)continue;for(let[_,p]of[[h,u],[u,h]]){let m=vtt(a,_.start.y);if(!m)continue;let A=Ppn(_,c);if(!A)continue;let g=dIe(_,A),f=Math.min(p.start.x,p.end.x),y=Math.max(p.start.x,p.end.x);if(g.x<c-wo&&y<=c+wo)continue;if(g.x>c+wo&&f>=c-wo)continue;let x=dIe(a,m);for(let C of[_.start.y,p.start.y]){let b={start:{x:Math.min(g.x,f),y:C},end:{x:Math.max(g.x,y),y:C}};if(!w5([b],t))continue;let I={start:x,end:{x:c,y:C}};if(vhe(I))continue;if(!w5([I],t))continue;let v=n.filter((P,M)=>M!==l&&M!==d&&M!==s).concat(b,I);if(v=Stt(v,t,{preserveOriginalSpan:!0}),!w5(v,t))continue;if(!whe(v,t,i))continue;if(aP(v,t)>r)continue;n=Ehe(v),o=!0;break}if(o)break}if(o)break}if(o)break}if(o)break}}return n},wpn=(e)=>Math.abs(e.start.y-e.end.y)<wo,Bpn=(e)=>Math.abs(e.start.x-e.end.x)<wo,Hpn=(e,t)=>{let n=FB(e,t),o=aP(e,t),r=mv(e);for(let i=0;i<e.length;i++){let s=e[i];if(!s||!wpn(s))continue;for(let a=i+1;a<e.length;a++){let c=e[a];if(!c||!wpn(c))continue;let l=Math.min(s.start.y,c.start.y),h=Math.max(s.start.y,c.start.y);if(h-l<wo)continue;let d=Math.min(s.start.x,s.end.x),u=Math.max(s.start.x,s.end.x),_=Math.min(c.start.x,c.end.x),p=Math.max(c.start.x,c.end.x),m=Math.max(d,_),A=Math.min(u,p);if(A<m-wo)continue;if(!e.some((I)=>{if(!Bpn(I))return!1;if(A-m<wo){let P=Math.min(I.start.y,I.end.y),M=Math.max(I.start.y,I.end.y);if(P>=l-wo||M<=h+wo)return!1}let v=I.start.x;return v>=m-wo&&v<=A+wo&&iu(I,{x:v,y:l})&&iu(I,{x:v,y:h})}))continue;let f=Math.min(d,_),y=Math.max(u,p),x=new Set([l,h]);for(let I of t){if(I.maxX<=f+wo||I.minX>=y-wo)continue;if(I.minY>l&&I.minY<h)x.add(I.minY);if(I.maxY>l&&I.maxY<h)x.add(I.maxY)}let C=[...x].sort((I,v)=>I-v),b=[];if(A-m<wo)b.push(l,h);else for(let I=1;I<C.length;I++){let v=C[I-1],P=C[I];if(v===void 0||P===void 0)continue;b.push((v+P)/2)}for(let I of b){let v={start:{x:f,y:I},end:{x:y,y:I}};if(!w5([v],t))continue;let P=[];for(let M=0;M<e.length;M++){if(M===i||M===a)continue;let B=e[M];if(!B)continue;if(!Bpn(B)||B.start.x<f||B.start.x>y){P.push(B);continue}let T=B.start.x;if(!(iu(B,{x:T,y:l})||iu(B,{x:T,y:h}))){P.push(B);continue}let D=B.start.y>=l&&B.start.y<=h,L=B.end.y>=l&&B.end.y<=h;if(D&&L)continue;if(D)P.push({start:{x:T,y:I},end:B.end});else if(L)P.push({start:B.start,end:{x:T,y:I}});else P.push(B)}if(P.push(v),!w5(P,t))continue;if(!whe(P,t,n))continue;if(aP(P,t)>o)continue;if(mv(P)>r)continue;return Hpn(Ehe(P),t)}}}return e},FBr=(e,t)=>{let n=e,o=!0;while(o){o=!1;let r=mv(n),i=FB(n,t);for(let s=0;s<n.length;s++){let a=n[s];if(!a)continue;let c=Math.abs(a.start.y-a.end.y)<wo,l=Math.abs(a.start.x-a.end.x)<wo;if(!c&&!l)continue;for(let h=0;h<n.length;h++){if(s===h)continue;let d=n[h];if(!d)continue;let u=Math.abs(d.start.y-d.end.y)<wo,_=Math.abs(d.start.x-d.end.x)<wo;if(c!==u)continue;if(l!==_)continue;let p=[a.start,a.end],m;if(c)m=p.map((y)=>({x:y.x,y:d.start.y}));else m=p.map((y)=>({x:d.start.x,y:y.y}));if(!m.every((y)=>iu(d,y)))continue;let A=new Map,g=!0;for(let y=0;y<p.length;y++){let x=p[y],C=m[y];if(!x||!C){g=!1;break}let b=n.findIndex((B,T)=>{if(T===s||T===h)return!1;let N=Math.abs(B.start.y-B.end.y)<wo,D=Math.abs(B.start.x-B.end.x)<wo;return(c&&D||l&&N)&&iu(B,x)});if(b===-1)continue;let I=n[b];if(!I){g=!1;break}let v=bY(I.start,x),P=bY(I.end,x);if(!v&&!P&&iu(I,C))continue;if(!v&&!P){g=!1;break}let M;if(v)M=hIe(I,"start",C);else M=hIe(I,"end",C);if(!w5([M],t)){g=!1;break}A.set(b,M)}if(!g)continue;let f=n.map((y,x)=>A.get(x)??y).filter((y,x)=>x!==s);if(mv(f)>r)continue;if(!whe(f,t,i))continue;n=f,o=!0;break}if(o)break}}return n},zBr=(e,t)=>{let n=e,o=!0;while(o){o=!1;let r=FB(n,t),i=aP(n,t),s=mv(n);for(let a=0;a<n.length;a++){let c=n.filter((l,h)=>h!==a);if(!w5(c,t))continue;if(!whe(c,t,r))continue;if(aP(c,t)>i)continue;if(mv(c)>s)continue;n=c,o=!0;break}}return n},Fpn=((e)=>(e[e.ConnectDanglingEndpoints=0]="ConnectDanglingEndpoints",e[e.CollapseVerticalDoglegs=1]="CollapseVerticalDoglegs",e[e.CollapseHorizontalSteps=2]="CollapseHorizontalSteps",e[e.RemoveRedundantParallelBridges=3]="RemoveRedundantParallelBridges",e[e.ReconnectDanglingEndpoints=4]="ReconnectDanglingEndpoints",e[e.TrimDanglingOverhangs=5]="TrimDanglingOverhangs",e[e.RemoveRedundantSeparators=6]="RemoveRedundantSeparators",e[e.MergeAlignedSegments=7]="MergeAlignedSegments",e))(Fpn||{}),OBr=class extends po{constructor(e){super();this.params=e,this._inputRects=e.cellContents.map((t)=>({minX:t.x,minY:t.y,maxX:t.x+t.width,maxY:t.y+t.height})),this._currentLines=e.repairedLines}params;refinedLines=[];_stage=0;_currentLines=[];_inputRects;_step(){let e=this._inputRects;switch(this._stage){case 0:this._currentLines=Stt(this._currentLines,e,{preserveOriginalSpan:!0});break;case 1:this._currentLines=HBr(this._currentLines,e);break;case 2:this._currentLines=Mpn(this._currentLines,e);break;case 3:this._currentLines=FBr(this._currentLines,e);break;case 4:this._currentLines=Stt(this._currentLines,e,{preserveOriginalSpan:!0});break;case 5:this._currentLines=Epn(this._currentLines,e,FB(this._currentLines,e));break;case 6:this._currentLines=zBr(this._currentLines,e);break;case 7:this._currentLines=Ehe(this._currentLines),this._currentLines=Mpn(this._currentLines,e),this._currentLines=Hpn(this._currentLines,e),this._currentLines=Epn(this._currentLines,e,FB(this._currentLines,e)),this.refinedLines=this._currentLines,this.solved=!0;break}let t=this.getNextStage(this._stage);if(t)this._stage=t}getNextStage(e){let t=Object.values(Fpn);return t[t.indexOf(e)+1]}getOutput(){return this.refinedLines}getConstructorParams(){return[this.params]}visualize(){let{cellContents:e,repairedLines:t}=this.params;return{rects:e.map((n)=>({center:{x:n.x+n.width/2,y:n.y+n.height/2},width:n.width,height:n.height,fill:"rgba(255, 165, 0, 0.2)",stroke:"#c87000"})),lines:[...t.map((n)=>({points:[n.start,n.end],strokeColor:"rgba(180, 180, 180, 0.4)",strokeWidth:1,strokeDash:[4,4]})),...this._currentLines.map((n)=>({points:[n.start,n.end],strokeColor:"#000000",strokeWidth:3}))]}}},VBr=class extends Rb{computeMidlinesSolver;computeIntersectionsSolver;computeSegmentsSolver;buildGridSolver;mergeGridSolver;buildOutlineSolver;reduceBoundaryLinesSolver;repairBoundaryLinesSolver;refineBoundaryLinesSolver;pipelineDef=[Pi("computeMidlinesSolver",Rwr,(e)=>[{cellContents:e.inputProblem.cellContents,containerWidth:e.inputProblem.containerWidth,containerHeight:e.inputProblem.containerHeight}]),Pi("computeIntersectionsSolver",kwr,(e)=>[{midlines:e.getSolver("computeMidlinesSolver").midlines}]),Pi("computeSegmentsSolver",Owr,(e)=>[{midlines:e.getSolver("computeMidlinesSolver").midlines,intersections:e.getSolver("computeIntersectionsSolver").intersections,cellContents:e.inputProblem.cellContents}]),Pi("buildGridSolver",Uwr,(e)=>[{allSegments:e.getSolver("computeSegmentsSolver").allSegments,cellContents:e.inputProblem.cellContents,containerWidth:e.inputProblem.containerWidth,containerHeight:e.inputProblem.containerHeight}]),Pi("mergeGridSolver",Kwr,(e)=>[{validSegments:e.getSolver("buildGridSolver").validSegments,gridRects:e.getSolver("buildGridSolver").gridRects,cellContainingRects:e.getSolver("buildGridSolver").cellContainingRects,cellContents:e.inputProblem.cellContents}]),Pi("buildOutlineSolver",qwr,(e)=>[{groupedRects:e.getSolver("mergeGridSolver").groupedRects}]),Pi("reduceBoundaryLinesSolver",mBr,(e)=>[{outlineLines:e.getSolver("buildOutlineSolver").outlineLines,cellContents:e.inputProblem.cellContents,offsetX:e.inputProblem.offsetX,offsetY:e.inputProblem.offsetY}]),Pi("repairBoundaryLinesSolver",PBr,(e)=>[{reducedLines:e.getSolver("reduceBoundaryLinesSolver").reducedLines,originalLines:e.getSolver("reduceBoundaryLinesSolver").mergedOriginalLines,cellContents:e.inputProblem.cellContents}]),Pi("refineBoundaryLinesSolver",OBr,(e)=>[{repairedLines:e.getSolver("repairBoundaryLinesSolver").repairedLines,cellContents:e.inputProblem.cellContents}])];finalVisualize(){let e=this.getSolver("refineBoundaryLinesSolver"),t=this.getSolver("buildOutlineSolver"),n=e?.refinedLines??t?.outlineLines;if(!n)return null;return{rects:this.inputProblem.cellContents.map((o)=>({center:{x:o.x+o.width/2,y:o.y+o.height/2},width:o.width,height:o.height,fill:"rgba(255, 165, 0, 0.3)",stroke:"#c87000",label:o.cellId})),lines:n.map((o)=>({points:[o.start,o.end],strokeColor:"#000000",strokeWidth:3}))}}initialVisualize(){return{rects:this.inputProblem.cellContents.map((e)=>({center:{x:e.x+e.width/2,y:e.y+e.height/2},width:e.width,height:e.height,fill:"rgba(255, 165, 0, 0.3)",stroke:"#c87000",label:e.cellId}))}}getConstructorParams(){return[this.inputProblem]}getOutput(){return{midlines:this.getSolver("computeMidlinesSolver")?.midlines??[],allSegments:this.getSolver("computeSegmentsSolver")?.allSegments??[],validSegments:this.getSolver("buildGridSolver")?.validSegments??[],mergedRectGroups:this.getSolver("mergeGridSolver")?.mergedRectGroups??[],cellRects:this.inputProblem.cellContents,gridRects:this.getSolver("buildGridSolver")?.gridRects??[],outlineLines:this.getSolver("refineBoundaryLinesSolver")?.refinedLines??this.getSolver("buildOutlineSolver")?.outlineLines??[]}}},YBr=(e,t,n)=>({...e,start:{x:e.start.x+t,y:e.start.y+n},end:{x:e.end.x+t,y:e.end.y+n}}),pIe=(e)=>{let t=1/0,n=1/0,o=-1/0,r=-1/0;for(let i of e)t=Math.min(t,i.minX),n=Math.min(n,i.minY),o=Math.max(o,i.maxX),r=Math.max(r,i.maxY);return{minX:t,minY:n,maxX:o,maxY:r}},GBr=(e)=>{let{start:t,end:n}=e;if(t.y===n.y&&t.x>n.x)[t,n]=[{x:n.x,y:t.y},{x:t.x,y:n.y}];else if(t.x===n.x&&t.y>n.y)[t,n]=[{x:t.x,y:n.y},{x:n.x,y:t.y}];return{...e,start:t,end:n}},UBr=(e)=>{if(!e||e.length===0)return[];let t=e.map(GBr),n=[],o=[];for(let a of t)if(a.start.y===a.end.y)n.push(a);else if(a.start.x===a.end.x)o.push(a);let r=[],i=new Map;for(let a of n){let c=i.get(a.start.y)??[];c.push(a),i.set(a.start.y,c)}for(let[,a]of i){a.sort((l,h)=>l.start.x-h.start.x);let c;for(let l of a){if(!c){c={...l};continue}if(l.start.x<=c.end.x)c.end.x=Math.max(c.end.x,l.end.x);else r.push(c),c={...l}}if(c)r.push(c)}let s=new Map;for(let a of o){let c=s.get(a.start.x)??[];c.push(a),s.set(a.start.x,c)}for(let[,a]of s){a.sort((l,h)=>l.start.y-h.start.y);let c;for(let l of a){if(!c){c={...l};continue}if(l.start.y<=c.end.y)c.end.y=Math.max(c.end.y,l.end.y);else r.push(c),c={...l}}if(c)r.push(c)}return r};var iIe=(e,t)=>e.x!==t.x?e.x-t.x:e.y-t.y,WBr=(e,t,n)=>{let o=e.map((_,p)=>({..._,cellId:`cell-${p}`})),r=pIe(o.map((_)=>({minX:_.x,minY:_.y,maxX:_.x+_.width,maxY:_.y+_.height}))),{minX:i,minY:s}=r;t??=r.maxX-r.minX,n??=r.maxY-r.minY;let a=o.map((_)=>({..._,x:_.x-i,y:_.y-s})),c=new VBr({cellContents:a,containerWidth:t,containerHeight:n,offsetX:i,offsetY:s});c.solve();let l=c.getOutput(),h=(_)=>YBr(_,i,s),d=l.outlineLines.map(h);return UBr(d).map((_)=>({start:iIe(_.start,_.end)<0?_.start:_.end,end:iIe(_.start,_.end)<0?_.end:_.start})).sort((_,p)=>iIe(_.start,p.start)||iIe(_.end,p.end))};function XBr(e,t){if(!Number.isFinite(t)||t<0)throw Error("cellMargin must be finite and nonnegative");if(t===0||e.length<2)return e;let n=e.map((i)=>({...i,minX:i.minX-t,maxX:i.maxX+t,minY:i.minY-t,maxY:i.maxY+t})),o=[n[0]],r=n.slice(1);while(r.length>0){let i=r.findIndex((s)=>o.some((a)=>a.minX<=s.maxX&&a.maxX>=s.minX&&a.minY<=s.maxY&&a.maxY>=s.minY));if(i<0)return n;o.push(...r.splice(i,1))}return e}var zpn=(e,t={})=>WBr(XBr(e,t.cellMargin??0).map((n)=>({x:n.minX,y:n.minY,width:n.maxX-n.minX,height:n.maxY-n.minY})));qt();er();var aEn=at(ln(),1);var Bhe=at(EUe(),1),mIe=at(ln(),1),Ak=(e)=>{if(Array.isArray(e)&&e.length===1)return e[0];return e};function Opn(e,t={}){let n=(r,i,s,a,c)=>{let l=(h)=>{if(h==null||typeof h==="boolean")return[];if(Array.isArray(h))return h.flatMap(l);if(!mIe.default.isValidElement(h))throw Error("Expected JSCAD elements, not text or arbitrary objects");let d=n(h.type,h.props,[],a,c);return Array.isArray(d)?d.flat(1/0):d==null?[]:[d]};if(r===mIe.default.Fragment)return l(i.children);if(typeof r==="function")return l(r(i));switch(r){case"cube":return e.primitives.cube({size:i.size});case"sphere":return e.primitives.sphere({radius:i.radius,segments:i.segments});case"cuboid":return e.primitives.cuboid({size:i.size});case"roundedCuboid":return e.primitives.roundedCuboid({size:i.size,roundRadius:i.roundRadius});case"geodesicSphere":return e.primitives.geodesicSphere({radius:i.radius,frequency:i.frequency});case"ellipsoid":return e.primitives.ellipsoid({radius:i.radius});case"cylinder":return e.primitives.cylinder({radius:i.radius,height:i.height});case"roundedCylinder":return e.primitives.roundedCylinder({radius:i.radius,height:i.height,roundRadius:i.roundRadius});case"cylinderElliptic":return e.primitives.cylinderElliptic({radius:i.radius,height:i.height,startRadius:i.startRadius,endRadius:i.endRadius,startAngle:i.startAngle,endAngle:i.endAngle});case"torus":return e.primitives.torus({innerRadius:i.innerRadius,outerRadius:i.outerRadius,innerSegments:i.innerSegments,outerSegments:i.outerSegments,innerRotation:i.innerRotation,outerRotation:i.outerRotation,startAngle:i.startAngle});case"jscadPolygon":return e.primitives.polygon({points:i.points});case"extrudeLinear":{let{children:h,...d}=i,u=l(h);return e.extrusions.extrudeLinear({height:d.height},Ak(u))}case"extrudeRotate":{let{children:h,...d}=i,u=l(h);return e.extrusions.extrudeRotate({angle:d.angle},Ak(u))}case"extrudeRectangular":{let{children:h,...d}=i,u=l(h);return e.extrusions.extrudeRectangular({size:d.size,height:d.height},Ak(u))}case"extrudeHelical":{let{children:h,...d}=i,u=l(h);return e.extrusions.extrudeHelical({height:d.height,angle:d.angle,startAngle:d.startAngle||0,pitch:d.pitch||0,endOffset:d.endOffset||0,segmetsPerRotation:d.segmetsPerRotation||32},Ak(u))}case"extrudeFromSlices":{let{baseSlice:h,...d}=i;return e.extrusions.extrudeFromSlices(d,h)}case"project":{let{children:h,...d}=i,u=l(h);return e.extrusions.project({axis:d.axis,origin:d.origin},Ak(u))}case"colorize":{let{children:h,...d}=i,u=l(h),_=d.color;return Ak(u.map((m)=>e.colors.colorize(_,m)))}case"custom":{let{geometry:h}=i;return h}case"union":{let h=l(i.children);if(h.length===0)return[];if(h.length===1)return h[0];return e.booleans.union(...h)}case"subtract":{let h=mIe.default.Children.toArray(i.children);if(h.length<2)throw Error("Subtract must have at least one base component and one component to subtract.");let d=l(h[0]);if(d.length!==1)throw Error("Subtract requires exactly one solid base");let u=h.slice(1).flatMap(l);return u.length?e.booleans.subtract(d[0],...u):d[0]}case"translate":{let{args:h,children:d}=i,u=l(d);return Ak(u.map((_)=>e.transforms.translate(h,_)))}case"rotate":{let{children:h,...d}=i,u=l(h);return Ak(u.map((_)=>e.transforms.rotate(d.angles,_)))}case"hull":case"hullChain":{let h=l(i.children);if(!h.length)return[];if(h.length===1)return h[0];return e.hulls[r](...h)}case"rectangle":{let{size:h,name:d,reference:u}=i;if(u&&!d?.trim())throw Error("Reference rectangles require a nonblank name");if(u&&!t.preserveReferences)return[];let _=e.primitives.rectangle({size:h});return t.preserveReferences&&(d!==void 0||u!==void 0)?{..._,...d!==void 0?{name:d}:{},...u!==void 0?{reference:u}:{}}:_}case"circle":{let{radius:h}=i;return e.primitives.circle({radius:h})}default:throw Error(`Unknown element type: ${r}`)}};return{now:Date.now,supportsMutation:!0,supportsPersistence:!1,supportsHydration:!1,currentUpdatePriority:Bhe.DefaultEventPriority,createInstance:n,createTextInstance(){throw Error("Text elements are not supported in JSCAD")},appendInitialChild(r,i){return r},appendChild(r,i){return r},removeChild(r,i){return r},appendChildToContainer(r,i){r.push(i)},removeChildFromContainer(r,i){let s=r.indexOf(i);if(s!==-1)r.splice(s,1)},prepareUpdate(){return!0},commitUpdate(r,i,s,a,c){let l=n(s,c,r,{},null);for(let h in r)delete r[h];Object.assign(r,l)},finalizeInitialChildren(){return!1},prepareForCommit(){return null},resetAfterCommit(){},getPublicInstance(r){return r},getRootHostContext(r){return e},getChildHostContext(r,i,s){return r},shouldSetTextContent(){return!1},clearContainer(){},scheduleTimeout:setTimeout,cancelTimeout:clearTimeout,noTimeout:-1,isPrimaryRenderer:!0,getCurrentEventPriority:()=>99,getInstanceFromNode:()=>null,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},prepareScopeUpdate:()=>{},getInstanceFromScope:()=>null,detachDeletedInstance:()=>{},resolveUpdatePriority:()=>Bhe.DiscreteEventPriority,setCurrentUpdatePriority:(r)=>{},getCurrentUpdatePriority:()=>Bhe.DefaultEventPriority,maySuspendCommit(){return!1}}}var gTr=at(lo(),1),lmn=at(_v(),1),hmn=at(lo(),1),umn=at(lo(),1),fIe=at(lo(),1),yIe=at(lo(),1),mmn=at(lo(),1),_mn=at(lo(),1),CTr=at(lo(),1),gmn=at(lo(),1),xIe=at(lo(),1),fmn=at(lo(),1),ymn=at(lo(),1),xmn=at(lo(),1),Cmn=at(lo(),1),bmn=at(lo(),1),Imn=at(lo(),1),vmn=at(lo(),1),Smn=at(lo(),1),Pmn=at(lo(),1),Emn=at(lo(),1),GTr=at(lo(),1),UTr=at(lo(),1),WTr=at(lo(),1),Mmn=at(lo(),1),wmn=at(lo(),1),Bmn=at(lo(),1),Tmn=at(lo(),1),Dmn=at(lo(),1),oDr=at(lo(),1),Nmn=at(lo(),1),Rmn=at(ln(),1),CIe=at(cmn(),1);function dmn({color:e,children:t}){if(!Array.isArray(e))e=lmn.default(e).rgb().array().map((n)=>n/255);return hmn.jsx("colorize",{color:e,children:t})}var Rtt=(e)=>{if(!e)return null;if(Array.isArray(e))return e;return[e.x,e.y,e.z]};function pmn({offset:e,center:t,x:n,y:o,z:r,children:i}){let s=Rtt(e),a=Rtt(t),c=[s?.[0]||a?.[0]||n||0,s?.[1]||a?.[1]||o||0,s?.[2]||a?.[2]||r||0];return umn.jsx("translate",{args:c,children:i})}function Kg(e){let t=(n)=>{let{color:o,...r}=n;if(!o)return fIe.jsx(e,{...r});return fIe.jsx(dmn,{color:o,children:fIe.jsx(e,{...r})})};return t.displayName=`WithColor(${e.displayName||e.name||"Component"})`,t}function $g(e){let t=(n)=>{let{center:o,offset:r,...i}=n;if(!o&&!r)return yIe.jsx(e,{...i});return yIe.jsx(pmn,{offset:o||r,children:yIe.jsx(e,{...i})})};return t.displayName=`WithOffset(${e.displayName||e.name||"Component"})`,t}var ATr=({size:e})=>mmn.jsx("cube",{size:e}),fTr=$g(Kg(ATr)),yTr=({size:e})=>_mn.jsx("cuboid",{size:e}),xTr=$g(Kg(yTr));var Qhe=(e)=>{if(typeof e==="string"){let t=e.replace(/[^\d.-]/g,""),n=parseFloat(t);if(!isNaN(n)){if(e.toLowerCase().includes("deg"))return n*Math.PI/180;return n}throw Error(`Invalid rotation value: ${e}`)}return e},Qtt=(e)=>{if(typeof e==="string"||typeof e==="number")return[0,0,Qhe(e)];else if(Array.isArray(e))return e.map(Qhe);else if(e&&typeof e==="object")return[Qhe(e.x),Qhe(e.y),Qhe(e.z)];return[0,0,0]},bTr=({rotation:e,angles:t,children:n})=>{let o=e?Qtt(e):Qtt(t);return gmn.jsx("rotate",{angles:o,children:n})},Amn=$g(Kg(bTr));function ITr(e){let t=(n)=>{let{rotation:o,...r}=n;if(!o)return xIe.jsx(e,{...r});return xIe.jsx(Amn,{rotation:o,children:xIe.jsx(e,{...r})})};return t.displayName=`WithRotation(${e.displayName||e.name||"Component"})`,t}var vTr=({radius:e,height:t})=>fmn.jsx("cylinder",{radius:e,height:t}),STr=Kg($g(ITr(vTr))),PTr=({height:e,startRadius:t,endRadius:n,segments:o=32,startAngle:r=0,endAngle:i=Math.PI*2})=>ymn.jsx("cylinderElliptic",{height:e,startRadius:t,endRadius:n,segments:o,startAngle:r,endAngle:i}),ETr=$g(Kg(PTr)),MTr=({radius:e})=>xmn.jsx("ellipsoid",{radius:e}),wTr=$g(Kg(MTr)),BTr=({height:e,angle:t,startAngle:n,pitch:o,endOffset:r,segmetsPerRotation:i,children:s})=>Cmn.jsx("extrudeHelical",{height:e,angle:t,startAngle:n,pitch:o,endOffset:r,segmetsPerRotation:i,children:s}),TTr=$g(Kg(BTr)),DTr=({height:e,twistAngle:t,twistSteps:n,children:o})=>bmn.jsx("extrudeLinear",{height:e,twistAngle:t,twistSteps:n,children:o}),NTr=$g(Kg(DTr)),RTr=({size:e,height:t,children:n})=>Imn.jsx("extrudeRectangular",{size:e,height:t,children:n}),QTr=$g(Kg(RTr)),kTr=({angle:e,startAngle:t,segments:n,children:o})=>vmn.jsx("extrudeRotate",{angle:e,startAngle:t,segments:n,children:o}),LTr=$g(Kg(kTr)),HTr=({radius:e,frequency:t})=>Smn.jsx("geodesicSphere",{radius:e,frequency:t}),FTr=$g(Kg(HTr)),zTr=({children:e})=>Pmn.jsx("hull",{children:e}),OTr=$g(Kg(zTr)),VTr=({children:e})=>Emn.jsx("hullChain",{children:e}),YTr=$g(Kg(VTr));var XTr=({size:e,roundRadius:t})=>Mmn.jsx("roundedCuboid",{size:e,roundRadius:t}),jTr=$g(Kg(XTr)),KTr=({radius:e,height:t,roundRadius:n})=>wmn.jsx("roundedCylinder",{radius:e,height:t,roundRadius:n}),$Tr=$g(Kg(KTr)),qTr=({radius:e,segments:t})=>Bmn.jsx("sphere",{radius:e,segments:t||32}),JTr=Kg($g(qTr)),ZTr=({children:e})=>{if(!Array.isArray(e)||e.length<2)throw Error("Subtract must have at least two children");return Tmn.jsx("subtract",{children:e})},eDr=$g(Kg(ZTr)),tDr=({innerRadius:e,outerRadius:t,innerSegments:n=32,outerSegments:o=32,innerRotation:r=0,outerRotation:i=1,startAngle:s=0})=>Dmn.jsx("torus",{innerRadius:e,outerRadius:t,innerSegments:n,outerSegments:o,innerRotation:r,outerRotation:i,startAngle:s}),nDr=$g(Kg(tDr));var rDr=({numberOfSlices:e,capStart:t,capEnd:n,close:o,repair:r,baseSlice:i,callback:s})=>Nmn.jsx("extrudeFromSlices",{numberOfSlices:e,capStart:t,capEnd:n,close:o,repair:r,baseSlice:i,callback:s}),iDr=$g(Kg(rDr)),Qmn={...CIe.jscadPlanner,primitives:{...CIe.jscadPlanner.primitives,rectangle:({size:[e,t]})=>{if(![e,t].every((n)=>Number.isFinite(n)&&n>0))throw Error("Rectangles require two positive finite dimensions");return CIe.jscadPlanner.primitives.polygon({points:[[-e/2,-t/2],[e/2,-t/2],[e/2,t/2],[-e/2,t/2]]})}}},sDr=Opn(Qmn,{preserveReferences:!0});function ktt(e){if(typeof e==="function"||typeof e==="symbol"||typeof e==="bigint"||typeof e==="number"&&!Number.isFinite(e))throw Error("JSCAD plans must contain finite, JSON-serializable values");if(Array.isArray(e))e.forEach(ktt);else if(e&&typeof e==="object")Object.values(e).forEach(ktt)}function Ltt(e){let t=sDr.createInstance(Rmn.Fragment,{children:e},[],Qmn,null),n=(Array.isArray(t)?t.flat(1/0):[t]).filter(Boolean);if(!n.length)throw Error("Cannot compile an empty JSCAD plan");let o=n.length===1?n[0]:{type:"union",shapes:n};function r(i){if(!i||typeof i.type!=="string")throw Error("Expected a JSCAD operation; raw Custom geometry is not supported by the plan compiler");if("shape"in i)r(i.shape);if("shapes"in i)i.shapes.forEach(r)}return r(o),ktt(o),o}var bst=at(bWe(),1);be();be();be();be();var Ist=at(fS(),1);var mx=at(fS(),1);var WY=at(fS(),1),yv=at(fS(),1),mEn=at(ln(),1),jgi=at(ln(),1),gla=at(ln(),1);var IG=at(lo(),1);var gEn=at(lo(),1),Kgi=at(lo(),1);var AEn=at(lo(),1);var fEn=at(lo(),1);var yEn=at(lo(),1),$gi=at(ln(),1);var oHr=Object.defineProperty,TJ=((e)=>vX)(function(e){return vX.apply(this,arguments)}),rHr=(e,t)=>{for(var n in t)oHr(e,n,{get:t[n],enumerable:!0})},x4n={};rHr(x4n,{Ammeter:()=>Cmi,AnalogAcSweepSimulation:()=>vgi,AnalogAnalysisSimulation:()=>nee,AnalogDcOperatingPointSimulation:()=>bgi,AnalogDcSweepSimulation:()=>Igi,AnalogSimulation:()=>xgi,AnalogSweepParameter:()=>Bgi,AnalogTransientSimulation:()=>Cgi,Antenna:()=>cmi,AssemblyCable:()=>pEn,AssemblyDevice:()=>XPn,AssemblyMotor:()=>qPn,AssemblyPart:()=>nEn,AssemblyPrintedPart:()=>cEn,AssemblyReferenceSurface:()=>oEn,AssemblyScreen:()=>JPn,AssemblySubassembly:()=>xst,AutoroutingPhase:()=>Tmi,Battery:()=>q_i,Board:()=>Iv,Breakout:()=>yst,BreakoutPoint:()=>bG,Bus:()=>Xhi,CadAssembly:()=>Rzr,CadModel:()=>Lzr,Capacitor:()=>L3n,Chip:()=>$ue,Connector:()=>V3n,Constraint:()=>Imi,CopperPour:()=>F_i,CopperText:()=>$4n,CourtyardCircle:()=>q4n,CourtyardOutline:()=>J4n,CourtyardRect:()=>Z4n,Crystal:()=>rgi,CurrentSource:()=>zPn,Cutout:()=>sve,DifferentialPair:()=>Zhi,Diode:()=>G3n,DrcCheck:()=>Bmi,EnclosureCutoutAperture:()=>Xct,EnclosureFdmBox:()=>iEn,FabricationNoteDimension:()=>Dmi,FabricationNotePath:()=>e3n,FabricationNoteRect:()=>t3n,FabricationNoteText:()=>n3n,Fanout:()=>yst,FanoutPoint:()=>bG,Fiducial:()=>P_i,Footprint:()=>R8e,Fuse:()=>hmi,Group:()=>UP,Hole:()=>YJ,Inductor:()=>yPn,Interconnect:()=>umi,Jumper:()=>dmi,Keepout:()=>kve,Led:()=>xPn,Mosfet:()=>CPn,MountedBoard:()=>Zpi,Net:()=>oT,NetLabel:()=>vui,NormalComponent:()=>Xl,OpAmp:()=>igi,Panel:()=>rmi,PcbBend:()=>zgi,PcbNoteDimension:()=>Nmi,PcbNoteLine:()=>o3n,PcbNotePath:()=>r3n,PcbNoteRect:()=>i3n,PcbNoteText:()=>s3n,PcbReturnCurrentExcitation:()=>Ngi,PcbReturnCurrentSimulation:()=>Tgi,PcbSoldermaskOpening:()=>a3n,PcbStiffener:()=>Ogi,PcbTrace:()=>kst,PcbVia:()=>c3n,PinHeader:()=>J_i,Pinout:()=>lmi,PlatedHole:()=>UB,Port:()=>sd,Potentiometer:()=>ngi,PowerSource:()=>mmi,PrimitiveComponent:()=>lr,PushButton:()=>bPn,Renderable:()=>w4n,Resistor:()=>IPn,Resonator:()=>egi,SchematicArc:()=>h3n,SchematicBox:()=>kSn,SchematicCell:()=>ygi,SchematicCircle:()=>d3n,SchematicGraphic:()=>ggi,SchematicLine:()=>Nrt,SchematicPath:()=>u3n,SchematicRect:()=>p3n,SchematicRow:()=>fgi,SchematicSection:()=>dgi,SchematicSheet:()=>_gi,SchematicSymbol:()=>hgi,SchematicTable:()=>Agi,SchematicText:()=>m3n,SilkscreenCircle:()=>_3n,SilkscreenGraphic:()=>S_i,SilkscreenLine:()=>g3n,SilkscreenPath:()=>A3n,SilkscreenRect:()=>f3n,SilkscreenText:()=>Lst,SmtPad:()=>WB,SolderJumper:()=>pmi,SolderPaste:()=>y3n,SpiceModel:()=>Fgi,Subcircuit:()=>QPn,Subpanel:()=>HPn,Switch:()=>vPn,Symbol:()=>Hst,TestPoint:()=>sgi,Trace:()=>O_,TraceHint:()=>RSn,Transistor:()=>SPn,Via:()=>Y4n,VoltageProbe:()=>Hgi,VoltageSource:()=>FPn});var iHr=(e,t)=>{switch(t){case"i2c_sda":e.supports_i2c_sda=!0;return;case"i2c_scl":e.supports_i2c_scl=!0;return;case"spi_cs":e.supports_spi_cs=!0;return;case"spi_sck":e.supports_spi_sck=!0;return;case"spi_mosi":e.supports_spi_mosi=!0;return;case"spi_miso":e.supports_spi_miso=!0;return;case"uart_tx":e.supports_uart_tx=!0;return;case"uart_rx":e.supports_uart_rx=!0;return;default:throw Error(`Unhandled pin capability: ${t}`)}},sHr=(e,t)=>{switch(t){case"i2c_sda":e.is_configured_for_i2c_sda=!0;return;case"i2c_scl":e.is_configured_for_i2c_scl=!0;return;case"spi_cs":e.is_configured_for_spi_cs=!0;return;case"spi_sck":e.is_configured_for_spi_sck=!0;return;case"spi_mosi":e.is_configured_for_spi_mosi=!0;return;case"spi_miso":e.is_configured_for_spi_miso=!0;return;case"uart_tx":e.is_configured_for_uart_tx=!0;return;case"uart_rx":e.is_configured_for_uart_rx=!0;return;default:throw Error(`Unhandled configured pin capability: ${t}`)}},C4n=(e,t)=>{if(t.isInput!==void 0)e.is_input=t.isInput;if(t.isOutput!==void 0)e.is_output=t.isOutput;if(t.isBidirectional!==void 0)e.is_bidirectional=t.isBidirectional;if(t.isPassive!==void 0)e.is_passive=t.isPassive;if(t.canUseTriState!==void 0)e.can_use_tri_state=t.canUseTriState;if(t.isUsingTriState!==void 0)e.is_using_tri_state=t.isUsingTriState;if(t.canUseOpenCollector!==void 0)e.can_use_open_collector=t.canUseOpenCollector;if(t.isUsingOpenCollector!==void 0)e.is_using_open_collector=t.isUsingOpenCollector;if(t.canUseOpenEmitter!==void 0)e.can_use_open_emitter=t.canUseOpenEmitter;if(t.isUsingOpenEmitter!==void 0)e.is_using_open_emitter=t.isUsingOpenEmitter;if(t.isGpio!==void 0)e.is_gpio=t.isGpio;if(t.highlightColor!==void 0)e.highlight_color=t.highlightColor;for(let o of t.capabilities??[])iHr(e,o);let n=new Set([...t.activeCapabilities??[],...t.activeCapability?[t.activeCapability]:[]]);for(let o of n)sHr(e,o);if(t.mustBeConnected!==void 0)e.must_be_connected=t.mustBeConnected;if(t.providesPower!==void 0)e.provides_power=t.providesPower;if(t.requiresPower!==void 0)e.requires_power=t.requiresPower;if(t.providesGround!==void 0)e.provides_ground=t.providesGround;if(t.requiresGround!==void 0)e.requires_ground=t.requiresGround;if(t.providesVoltage!==void 0)e.provides_voltage=_h.parse(t.providesVoltage);if(t.requiresVoltage!==void 0)e.requires_voltage=_h.parse(t.requiresVoltage);if(t.doNotConnect!==void 0)e.do_not_connect=t.doNotConnect;if(t.includeInBoardPinout!==void 0)e.include_in_board_pinout=t.includeInBoardPinout;if(t.canUseInternalPullup!==void 0)e.can_use_internal_pullup=t.canUseInternalPullup;if(t.isUsingInternalPullup!==void 0)e.is_using_internal_pullup=t.isUsingInternalPullup;if(t.needsExternalPullup!==void 0)e.needs_external_pullup=t.needsExternalPullup;if(t.canUseInternalPulldown!==void 0)e.can_use_internal_pulldown=t.canUseInternalPulldown;if(t.isUsingInternalPulldown!==void 0)e.is_using_internal_pulldown=t.isUsingInternalPulldown;if(t.needsExternalPulldown!==void 0)e.needs_external_pulldown=t.needsExternalPulldown;if(t.canUseOpenDrain!==void 0)e.can_use_open_drain=t.canUseOpenDrain;if(t.isUsingOpenDrain!==void 0)e.is_using_open_drain=t.isUsingOpenDrain;if(t.canUsePushPull!==void 0)e.can_use_push_pull=t.canUsePushPull;if(t.isUsingPushPull!==void 0)e.is_using_push_pull=t.isUsingPushPull;if(t.shouldHaveDecouplingCapacitor!==void 0)e.should_have_decoupling_capacitor=t.shouldHaveDecouplingCapacitor;if(t.recommendedDecouplingCapacitorCapacitance!==void 0)e.recommended_decoupling_capacitor_capacitance=t.recommendedDecouplingCapacitorCapacitance},aHr=(e,t)=>{let n=[];for(let o of Object.keys(e)){if(o==="highlightColor"||o==="includeInBoardPinout")continue;let r={};if(C4n(r,{[o]:e[o]}),o==="capabilities"){for(let i of Object.keys(t))if(i.startsWith("supports_"))Object.assign(r,{[i]:r[i]??!1})}for(let i of Object.keys(r)){let s=r[i],a=i.startsWith("is_configured_for_")?i.replace("is_configured_for_","supports_"):i.startsWith("is_using_")?i.replace("is_using_","can_use_"):void 0;if(a){if(s===!0&&t[a]===!1)n.push(`${o}: ${JSON.stringify(e[o])}, fetched ${a}: false`);continue}let c=t[i],l=typeof c==="number"&&typeof s==="number"?Math.abs(c-s)<=Number.EPSILON*8*Math.max(1,Math.abs(c),Math.abs(s)):c===s;if(c!==void 0&&s!==void 0&&!l)n.push(`${o}: ${JSON.stringify(e[o])}, fetched ${i}: ${JSON.stringify(c)}`)}}return n},b4n=(e,t)=>{if(new Set(t.map((a)=>a.source_component_id)).size>1)return{};let n=e.props.pinNumber,o=n===void 0?[]:t.filter((a)=>a.pin_number===n),r=e.getNameAndAliases(),i=o.length>0?o:t.filter((a)=>[a.name,...a.port_hints??[]].some((c)=>r.includes(c)));if(i.length!==1)return{};let s=_j.parse(i[0]);for(let a of Object.keys(s))if(s[a]===void 0)delete s[a];return s},Eve=(e)=>{let t=b4n(e,e.getParentNormalComponent()?._importedSourcePorts??[]);for(let n of e._getMatchingPinAttributes()){for(let o of Object.keys(t))if(n.capabilities!==void 0&&o.startsWith("supports_")||(n.activeCapability!==void 0||n.activeCapabilities!==void 0)&&o.startsWith("is_configured_for_"))delete t[o];C4n(t,n)}return t},cHr=(e)=>{let t=e._fetchedInternallyConnectedPinNames??e._importedInternallyConnectedPinNames??[],n=e._getAllPortsFromChildren(),o=(s)=>{let a=String(s),c=n.find((h)=>h.physicalPinName===a||h.props.pinNumber!==void 0&&(String(h.props.pinNumber)===a||`pin${h.props.pinNumber}`===a));if(c)return c;let l=n.filter((h)=>{let d=h.getNameAndAliases();return d.includes(a)||a.startsWith("pin")&&d.includes(a.slice(3))});return l.length===1?l[0]:void 0},r=e._parsedProps.internallyConnectedPins,i=(r??[]).map((s)=>s.map(o).filter((a)=>a!==void 0));return t.flatMap((s)=>{let a=s.map(o);if(a.some((_)=>!_))return[];let c=[...new Set(a)];if(c.length<2)return[];let l=new Set([c[0]]),h=!0;while(h){h=!1;for(let _ of i){if(!_.some((p)=>l.has(p)))continue;for(let p of _)if(!l.has(p))l.add(p),h=!0}}if(c.every((_)=>l.has(_)))return[];let d=c.map((_)=>{let p=_.getNameAndAliases();return p.find((m)=>!/^(?:pin)?\d+$/.test(m))??p[0]??"unnamed pin"});return[{message:`The datasheet reports pins ${d.length===2?d.join(" and "):`${d.slice(0,-1).join(", ")} and ${d.at(-1)}`} are internally connected, but ${r===void 0?`the internallyConnectedPins prop isn't set on ${e.getDisplayName()}`:`internallyConnectedPins on ${e.getDisplayName()} does not declare that connection`}.`,sourcePortIds:c.flatMap((_)=>_.source_port_id?[_.source_port_id]:[])}]})},yAn=new WeakMap,Art=async(e,t)=>{let{supplierPartNumber:n,manufacturerPartNumber:o,platformFetch:r}=t,i={supplierPartNumber:n,manufacturerPartNumber:o,platformFetch:r};try{return{circuitJson:await e(t)}}catch(s){if(!t.includeDatasheetInformation&&!(s instanceof Ny&&s.issues.some((u)=>u.code==="unrecognized_keys"&&u.keys.includes("includeDatasheetInformation"))))throw s;let a={...t,includeDatasheetInformation:!1},c,l=!1;try{l=!t.includeDatasheetInformation,c=await e(l?i:a)}catch{if(l)throw s;c=await e(i),l=!0}if(!c?.length)throw s;let h=c.flatMap((u)=>u.type==="source_component"&&u.manufacturer_part_number?[u.manufacturer_part_number]:[]);if(o&&h.some((u)=>u.trim().toLowerCase()!==o.trim().toLowerCase()))throw s;let d=l?"the parts engine only accepted a request without the datasheet option":s instanceof Error?s.message:String(s);return{circuitJson:c,datasheetFailureReason:d}}},I4n=async(e,t)=>{let{circuitJson:n}=await Art(e,{...t,includeDatasheetInformation:!1});return n},vst=async({fetchPartCircuitJson:e,supplierPartNumber:t,manufacturerPartNumber:n},o)=>{let r=o.config.componentName==="Chip"||o.config.componentName==="OpAmp"||o.config.componentName==="PushButton",i={supplierPartNumber:t,manufacturerPartNumber:n,platformFetch:o.root?.platform?.platformFetch,includeDatasheetInformation:r},s,a=o.root;if(o.config.componentName==="Chip"&&a){let h=yAn.get(a);if(!h)h=new WeakMap,yAn.set(a,h);let d=h.get(e);if(!d)d=new Map,h.set(e,d);let u=`datasheet_part:${JSON.stringify([t,n])}`;s=d.get(u)??Art(e,i),d.set(u,s)}else s=Art(e,i);let{circuitJson:c,datasheetFailureReason:l}=await s;if(r&&l!==void 0){let h=`Datasheet information for ${o.getDisplayName()} could not be fetched: ${l}. Pin attributes may not be populated.`;if(o.source_component_id&&o.root)o.root.db.source_property_ignored_warning.insert({source_component_id:o.source_component_id,property_name:"pinAttributes",message:h,error_type:"source_property_ignored_warning"});else console.warn(h)}return c},v4n=(e)=>{let t=e.filter((o)=>o.type==="source_port"),n=e.filter((o)=>o.type==="source_component").filter((o)=>o.internally_connected_source_port_ids!==void 0);if(!n.length)return;return n.flatMap((o)=>(o.internally_connected_source_port_ids??[]).flatMap((r)=>{let i=r.map((s)=>t.find((a)=>a.source_port_id===s&&a.source_component_id===o.source_component_id));if(i.some((s)=>!s))return[];return[i.map((s)=>s.pin_number!==void 0?`pin${s.pin_number}`:s.name)]}))},lHr=(e)=>{if(!["Chip","PushButton","OpAmp"].includes(e.config.componentName))return;if(e._hasStartedPinAttributesFetch)return;if(e.getInheritedProperty("partsEngineDisabled"))return;if(e.getInheritedProperty("bomDisabled"))return;if(e._importedInternallyConnectedPinNames!==void 0)return;if(e._importedSourcePorts.some((s)=>Object.values(_j.parse(s)).some((a)=>a!==void 0)))return;let t=e.getInheritedProperty("partsEngine");if(!t?.fetchPartCircuitJson)return;let n=e.resolveFootprint(),o=e._parsedProps.supplierPartNumbers;if(Rw.shape.supplierPartNumbers.unwrap().keySchema.options.some((s)=>typeof e.root?.platform?.footprintLibraryMap?.[s]!=="function"&&o?.[s]?.some((a)=>n===`${s}:${a}`)))return;let r=Object.values(o??{}).flat()[0],i=hi(e._parsedProps);if(!r&&!i)return;e._hasStartedPinAttributesFetch=!0,e._queueAsyncEffect("fetch-datasheet-validation-metadata",async()=>{try{let s=await vst({fetchPartCircuitJson:t.fetchPartCircuitJson,supplierPartNumber:r,manufacturerPartNumber:i},e);e._fetchedSourcePortsForPinAttributes=s?.filter((a)=>a.type==="source_port")??[],e._fetchedInternallyConnectedPinNames=v4n(s??[]),e._markDirty("SourceDesignRuleChecks")}catch{}})},xAn=(e)=>{if(!["Chip","PushButton","OpAmp"].includes(e.config.componentName))return;let t=e.config.componentName==="Chip";if(!e.source_component_id)return;let{db:n}=e.root,o=n.source_component_pins_underspecified_warning.getWhere({source_component_id:e.source_component_id}),r=e.root?.platform?.drcChecksDisabled??e.getInheritedProperty("drcChecksDisabled"),i=e.root?.platform?.pinSpecificationDrcChecksDisabled??e.getInheritedProperty("pinSpecificationDrcChecksDisabled"),s=r||i;if(!s)lHr(e);let a=s?[]:e.selectAll("port").flatMap((g)=>{if(!g.source_port_id)return[];let f=n.source_port.get(g.source_port_id);return f?.source_component_id===e.source_component_id?[f]:[]}),c=s?null:n.source_component.get(e.source_component_id),l=c?[c,...a]:[],h=[];if(!s&&t)for(let g of e.selectAll("port")){let f=a.find((b)=>b.source_port_id===g.source_port_id);if(!f)continue;let y={};for(let b of g.getNameAndAliases())Object.assign(y,e._parsedProps.pinAttributes?.[b]);let x=b4n(g,e._fetchedSourcePortsForPinAttributes.length?e._fetchedSourcePortsForPinAttributes:e._importedSourcePorts),C=aHr(y,x);if(C.length)h.push({pinName:f.name||"unnamed pin",reasons:C,sourcePort:f})}for(let[g,f]of[[n.source_no_power_pin_defined_warning,l7t],[n.source_no_ground_pin_defined_warning,h7t]]){let y=g.getWhere({source_component_id:e.source_component_id}),x=y?.type==="source_no_power_pin_defined_warning"?y.source_no_power_pin_defined_warning_id:y?.source_no_ground_pin_defined_warning_id,[C]=s||!t||h.length?[]:f(l);if(C)if(x)g.update(x,{message:C.message,source_port_ids:C.source_port_ids,subcircuit_id:C.subcircuit_id});else n.insertAll([C]);else if(x)g.delete(x)}let[d]=s||!t?[]:a7t(l),u=s?[]:cHr(e);if(!h.length&&!d&&!u.length){if(o)n.source_component_pins_underspecified_warning.delete(o.source_component_pins_underspecified_warning_id);return}let _=h.slice(0,3).map(({pinName:g,reasons:f})=>`${g} (${f.join("; ")})`).join(", "),p=h.length>3?`, and ${h.length-3} more`:"",m=h.length?`Chip ${e.name||"unnamed chip"} has pinAttributes that conflict with fetched pin metadata on ${h.length} pin${h.length===1?"":"s"}: ${_}${p}. Check the chip configuration against the part datasheet.`:d?.message,A={source_component_id:e.source_component_id,source_port_ids:[...new Set([...h.length?h.map(({sourcePort:g})=>g.source_port_id):d?.source_port_ids??[],...u.flatMap((g)=>g.sourcePortIds)])],subcircuit_id:e.getSubcircuit().subcircuit_id??void 0,warning_type:"source_component_pins_underspecified_warning",message:[m,...u.map((g)=>g.message)].filter(Boolean).join(" ")};if(o)n.source_component_pins_underspecified_warning.update(o.source_component_pins_underspecified_warning_id,A);else n.source_component_pins_underspecified_warning.insert(A)},hHr=/^(?:pin)?(\d+)$/,jB=(e)=>{let t=e.match(hHr);if(!t)return null;return Number.parseInt(t[1],10)},Rde=(e)=>/^[A-Z]+[1-9]\d*$/.test(e);function Sst(e){let t=new Set(Object.keys(e).flatMap((i)=>{let s=jB(i);return s===null?[]:[s]})),n=Object.keys(e).filter(Rde).sort((i,s)=>{let[,a,c]=i.match(/^([A-Z]+)(\d+)$/),[,l,h]=s.match(/^([A-Z]+)(\d+)$/);return a.length-l.length||(a<l?-1:a>l?1:0)||Number(c)-Number(h)}),o=[],r=1;for(let i of n){while(t.has(r))r++;o.push({physicalPinName:i,pinNumber:r++})}return Object.entries(e).map(([i,s])=>{let a=jB(i),c=a??o.find((l)=>l.physicalPinName===i)?.pinNumber;if(c===void 0)throw Error(`Invalid pinLabels key "${i}". Expected a numeric pin (e.g. pin1) or physical ball name (e.g. A1).`);return{pinNumber:c,physicalPinName:a===null?i:void 0,labels:typeof s==="string"?[s]:[...s]}})}function bde(e){if(!Object.keys(e).some(Rde))return Object.fromEntries(Object.entries(e).map(([t,n])=>[t,typeof n==="string"?n:[...n]]));return Object.fromEntries(Sst(e).map(({pinNumber:t,physicalPinName:n,labels:o})=>[`pin${t}`,n?[...o,n]:o]))}var frt=({layer:e,pcbCcwRotationDegrees:t,modelCcwRotationOffsetDegrees:n})=>{let o=e==="bottom";return{x:n.x,y:n.y+(o?180:0),z:Bu(o?n.z-t:t+n.z)}},dHr={invalid_bend_geometry:"Invalid bend geometry",unsupported_bend_geometry:"Unsupported bend geometry",nonparallel_bends:"Bends must be parallel with the same moving direction",overlapping_bend_zones:"Overlapping PCB bend zones or incompatible moving regions are not supported",invalid_finite_bend_region:"The bend does not define a valid finite moving region",incomplete_bend_cross_section:"The bend cross-section does not cover the board",rigid_bend_zone_intersection:"CAD mount intersects PCB bend zone"};function S4n(e,t){let n=dHr[e.code];if(!e.bendId)return n;let o=t.find((r)=>r.pcb_bend_id===e.bendId);return`${n} ${o?.name??"unnamed bend"}`}var MP=class extends Error{constructor(e){super(e.message);this.issue=e,this.name="PcbFoldError"}issue};function uHr(e){try{return{ok:!0,value:e()}}catch(t){if(!(t instanceof MP))throw t;return{ok:!1,issue:t.issue}}}var id=0.0000001,yrt=(e,t)=>Math.hypot(e.x-t.x,e.y-t.y)<id;function CP(e,t,n=!0){let o=!1;for(let r=0;r<t.length;r++){let i=t[r],s=t[(r+1)%t.length],a=(e.x-i.x)*(s.y-i.y)-(e.y-i.y)*(s.x-i.x);if(Math.abs(a)<id*Math.max(1,Math.hypot(s.x-i.x,s.y-i.y))&&e.x>=Math.min(i.x,s.x)-id&&e.x<=Math.max(i.x,s.x)+id&&e.y>=Math.min(i.y,s.y)-id&&e.y<=Math.max(i.y,s.y)+id)return n;if(i.y>e.y!==s.y>e.y&&e.x<i.x+(s.x-i.x)*(e.y-i.y)/(s.y-i.y))o=!o}return o}function CAn(e,t,n,o){let r=[];for(let i=0;i<e.length;i++){let s=e[i],a=e[(i+1)%e.length],c=s.x*t+s.y*n-o,l=a.x*t+a.y*n-o;if(Math.abs(c)<id&&Math.abs(l)<id)continue;if(c>id&&l>id||c<-id&&l<-id)continue;if(Math.abs(c-l)<id)continue;let h=Math.max(0,Math.min(1,c/(c-l))),d={x:s.x+(a.x-s.x)*h,y:s.y+(a.y-s.y)*h};if(r.some((u)=>yrt(u.point,d)))continue;r.push(h>1-id?{point:a,edge:(i+1)%e.length,fraction:0}:{point:d,edge:i,fraction:h})}return r.sort((i,s)=>-n*i.point.x+t*i.point.y-(-n*s.point.x+t*s.point.y))}function bAn(e,t,n,o,r){let i=[];for(let d=0;d<e.length;d++){i.push(e[d]);for(let u of[t,n].filter((_)=>_.edge===d).sort((_,p)=>_.fraction-p.fraction))if(u.fraction>id)i.push(u.point)}let s=i.findIndex((d)=>yrt(d,t.point)),a=i.findIndex((d)=>yrt(d,n.point));if(s<0||a<0)throw Error("Cannot resolve PCB bend boundary crossings");let c=(d,u)=>{let _=[i[d]];while(d!==u)d=(d+1)%i.length,_.push(i[d]);return _},l=e.reduce((d,u,_)=>{let p=e[(_+1)%e.length];return d+u.x*p.y-p.x*u.y},0);return Math.sign(l)*((n.point.y-t.point.y)*o-(n.point.x-t.point.x)*r)>0?c(s,a):c(a,s)}function pHr({bendId:e,outline:t,nx:n,ny:o,center:r,proximal:i,axisMin:s,axisMax:a}){let c=CAn(t,n,o,r).filter(({point:m})=>{let A=-o*m.x+n*m.y;return A>=s-id&&A<=a+id});if(c.length!==2)throw new MP({code:"invalid_finite_bend_region",message:"A finite PCB bend must cut one board cross-section from boundary to boundary",bendId:e});let[l,h]=c,d={x:(l.point.x+h.point.x)/2,y:(l.point.y+h.point.y)/2};if(!CP(d,t,!1))throw new MP({code:"invalid_finite_bend_region",message:"A finite PCB bend must pass through the board interior",bendId:e});let u=bAn(t,l,h,n,o),_=-o*d.x+n*d.y,p=CAn(t,n,o,i);for(let m=0;m+1<p.length;m++){let A=p[m],g=p[m+1],f=-o*A.point.x+n*A.point.y,y=-o*g.point.x+n*g.point.y;if(_<=f+id||_>=y-id)continue;let x={x:(A.point.x+g.point.x)/2,y:(A.point.y+g.point.y)/2};if(!CP(x,t,!1))continue;let C=bAn(t,A,g,n,o);if(C.some((b)=>b.x*n+b.y*o<i-id)||u.some((b)=>!CP(b,C))||C.some((b)=>b.x*n+b.y*o>=r-id&&!CP(b,u)))break;return C}throw new MP({code:"invalid_finite_bend_region",message:"The finite PCB bend zone must remain in one connected board cross-section",bendId:e})}function mHr(e,t){if(e.some((o)=>CP(o,t))||t.some((o)=>CP(o,e)))return!0;let n=(o,r,i)=>(r.x-o.x)*(i.y-o.y)-(r.y-o.y)*(i.x-o.x);for(let o=0;o<e.length;o++)for(let r=0;r<t.length;r++){let i=e[o],s=e[(o+1)%e.length],a=t[r],c=t[(r+1)%t.length];if(n(i,s,a)*n(i,s,c)<-id&&n(a,c,i)*n(a,c,s)<-id)return!0}return!1}function IAn(e,t){if(t.some((n)=>!CP(n,e)))return!1;for(let n=0;n<t.length;n++){let o=t[n],r=t[(n+1)%t.length],i=r.x-o.x,s=r.y-o.y,a=i*i+s*s;if(a<id*id)continue;let c=[0,1];for(let l=0;l<e.length;l++){let h=e[l],d=e[(l+1)%e.length],u=d.x-h.x,_=d.y-h.y,p=i*_-s*u,m=h.x-o.x,A=h.y-o.y;if(Math.abs(p)<id){if(Math.abs(m*s-A*i)>id)continue;for(let g of[h,d]){let f=((g.x-o.x)*i+(g.y-o.y)*s)/a;if(f>0&&f<1)c.push(f)}}else{let g=(m*_-A*u)/p,f=(m*s-A*i)/p;if(g>0&&g<1&&f>=-id&&f<=1+id)c.push(g)}}c.sort((l,h)=>l-h);for(let l=1;l<c.length;l++){let h=(c[l-1]+c[l])/2;if(!CP({x:o.x+h*i,y:o.y+h*s},e))return!1}}return!0}var KB=0.0000001;function _Hr(e){let t=[...e].sort((a,c)=>a.start-c.start||a.nx-c.nx||a.ny-c.ny||a.id.localeCompare(c.id)),n=new Map,o=(a)=>{throw new MP({code:"overlapping_bend_zones",message:"Overlapping PCB bend zones or incompatible moving regions are not supported",bendId:a.id})};for(let a=0;a<t.length;a++)for(let c=a+1;c<t.length;c++){let l=t[a],h=t[c];if(l.movingOutline&&h.movingOutline){if(!mHr(l.movingOutline,h.movingOutline))continue;let d=IAn(l.movingOutline,h.movingOutline),u=IAn(h.movingOutline,l.movingOutline);if(d===u)o(h);let _=d?l:h,p=d?h:l;if(p.movingOutline.some((m)=>m.x*_.nx+m.y*_.ny<_.end-KB))o(p);n.set(p,[...n.get(p)??[],_])}else{if(Math.abs(l.nx-h.nx)>KB||Math.abs(l.ny-h.ny)>KB)throw new MP({code:"nonparallel_bends",message:"Nonparallel PCB bends or bends with opposite moving directions require a board outline to resolve their moving regions"});if(h.start<l.end-KB)o(h);n.set(h,[...n.get(h)??[],l])}}let r=[],i=new Set,s=(a)=>{if(i.has(a))return;for(let c of n.get(a)??[])s(c);i.add(a),r.push(a)};for(let a of t)s(a);return r}function gHr(e,t,{outline:n}={}){if(!Number.isFinite(t)||t<0)throw Error("Board thickness must be finite and nonnegative");if(n&&(n.length<3||n.some((c)=>!Number.isFinite(c.x)||!Number.isFinite(c.y))))throw Error("A finite board outline with at least three points is required");let o=e.map((c)=>{let{start:l,end:h,bend_angle:d,bend_radius:u}=c;if([l?.x,l?.y,h?.x,h?.y,d,u].some((b)=>!Number.isFinite(b))||u<=t/2||!["left","right"].includes(c.bend_side))throw new MP({code:"invalid_bend_geometry",message:`Invalid PCB bend ${c.pcb_bend_id}: finite geometry and radius greater than half the board thickness are required`,bendId:c.pcb_bend_id});let p=Math.hypot(h.x-l.x,h.y-l.y);if(p<KB||Math.abs(d)>180)throw new MP({code:"unsupported_bend_geometry",message:`Unsupported PCB bend ${c.pcb_bend_id}: distinct endpoints and angles within ±180 degrees are required`,bendId:c.pcb_bend_id});let m=c.bend_side==="right"?1:-1,A=m*(h.y-l.y)/p,g=-m*(h.x-l.x)/p,f=d*Math.PI/180,y=u*Math.abs(f),x=l.x*A+l.y*g,C={id:c.pcb_bend_id,nx:A,ny:g,start:x-y/2,end:x+y/2,angle:f,radius:u,axisMin:Math.min(-g*l.x+A*l.y,-g*h.x+A*h.y),axisMax:Math.max(-g*l.x+A*l.y,-g*h.x+A*h.y)};if(n&&Math.abs(f)>KB)C.movingOutline=pHr({bendId:c.pcb_bend_id,outline:n,nx:A,ny:g,center:x,proximal:C.start,axisMin:C.axisMin,axisMax:C.axisMax});return C}).filter((c)=>Math.abs(c.angle)>KB),r=_Hr(o),i=[...r].reverse(),s=({p:c,anchor:l,direction:h})=>{let d={...c};for(let u of i){if(u.movingOutline&&!CP(l,u.movingOutline))continue;let _=u.end-u.start,p=l.x*u.nx+l.y*u.ny-u.start,m=Math.max(0,Math.min(_,p)),A=u.angle*m/_,g=Math.cos(A),f=Math.sin(A),y=d.x*u.nx+d.y*u.ny-(h?0:u.start),x=d.x-(y+(h?0:u.start))*u.nx,C=d.y-(y+(h?0:u.start))*u.ny,b=Math.sign(u.angle)*u.radius,I=h?0:b*f-m*g,v=h?0:b*(1-g)-m*f,P=y*g-d.z*f+I;d={x:x+(P+(h?0:u.start))*u.nx,y:C+(P+(h?0:u.start))*u.ny,z:y*f+d.z*g+v}}return d},a=({p:c,anchor:l,direction:h})=>{let d=h?{x:0,y:0,z:0}:s({p:{x:0,y:0,z:0},anchor:l,direction:!1}),u={x:c.x-d.x,y:c.y-d.y,z:c.z-d.z},_=[{x:1,y:0,z:0},{x:0,y:1,z:0},{x:0,y:0,z:1}].map((m)=>s({p:m,anchor:l,direction:!0})),p=(m)=>m.x*u.x+m.y*u.y+m.z*u.z;return{x:p(_[0]),y:p(_[1]),z:p(_[2])}};return{bends:r,inversePoint:(c,l)=>a({p:c,anchor:l,direction:!1}),inverseDirection:(c,l)=>a({p:c,anchor:l,direction:!0}),point:(c,l=c)=>s({p:c,anchor:l,direction:!1}),direction:(c,l)=>s({p:c,anchor:l,direction:!0}),assertRigid(c,l){for(let h of o){let d=h.end-h.start,u=c.map((_)=>h.movingOutline&&!CP(_,h.movingOutline)?0:Math.max(0,Math.min(d,_.x*h.nx+_.y*h.ny-h.start)));if(Math.max(...u)>KB&&Math.min(...u)<d-KB)throw new MP({code:"rigid_bend_zone_intersection",message:`${l} intersects PCB bend zone ${h.id}`,bendId:h.id})}}}}function AHr(e,t,n={}){return uHr(()=>gHr(e,t,n))}var fHr=[{x:1,y:0,z:0},{x:0,y:1,z:0},{x:0,y:0,z:1}];function yHr(e,t){let[n,o,r]=[t.x,t.y,t.z].map((a)=>a*Math.PI/180),i={x:Math.cos(r)*e.x-Math.sin(r)*e.y,y:Math.sin(r)*e.x+Math.cos(r)*e.y,z:e.z},s={x:Math.cos(o)*i.x+Math.sin(o)*i.z,y:i.y,z:-Math.sin(o)*i.x+Math.cos(o)*i.z};return{x:s.x,y:Math.cos(n)*s.y-Math.sin(n)*s.z,z:Math.sin(n)*s.y+Math.cos(n)*s.z}}function xHr([e,t,n]){let o=Math.asin(Math.max(-1,Math.min(1,n.x))),r=Math.abs(n.x)<0.999999999999;return{x:(r?Math.atan2(-n.y,n.z):Math.atan2(t.z,t.y))*180/Math.PI,y:o*180/Math.PI,z:(r?Math.atan2(-t.x,e.x):0)*180/Math.PI}}function CHr({cadComponentPlacement:e,foldPcbs:t},n){if(e.is_on_folded_board===!0===t)return e;let{fold:o,boardCenter:r,flatMount:i}=n,s={x:i.x-r.x,y:i.y-r.y,z:0};o.assertRigid([s],"CAD mount");let a={x:e.position.x-r.x,y:e.position.y-r.y,z:e.position.z},c=t?o.direction:o.inverseDirection,l=t?o.point(a,s):o.inversePoint(a,s),h=e.rotation??n.defaultRotation??{x:0,y:0,z:0},d=fHr.map((u)=>c(yHr(u,h),s));return{...e,position:{x:l.x+r.x,y:l.y+r.y,z:l.z},rotation:xHr(d),is_on_folded_board:t}}function bHr(e){let t=e._getBoard();if(!t?.pcbFold||!t.pcb_board_id||!e.pcb_component_id)return;let{db:n}=e.root,o=n.pcb_board.get(t.pcb_board_id),r=n.pcb_component.get(e.pcb_component_id);return{fold:t.pcbFold,boardCenter:o.center,flatMount:r.center}}function xrt(e,t){let n=bHr(e);if(!n)return t;try{return CHr({cadComponentPlacement:t,foldPcbs:!0},n)}catch(o){if(!(o instanceof MP))throw o;let{db:r}=e.root,i=r.pcb_component.get(e.pcb_component_id),s=r.source_component.get(i.source_component_id)?.name??"unnamed component";return r.pcb_placement_error.insert({error_type:"pcb_placement_error",message:`Unable to fold CAD for PCB component ${s}; CAD remains flat: ${S4n(o.issue,r.pcb_bend.list())}`,subcircuit_id:e.getSubcircuit()?.subcircuit_id??void 0}),t}}var vAn=class{input;constructor({input:e}){this.input=e}solveAndMapToTraces(){let e=[];for(let t of this.input.connections){if(t.pointsToConnect.length!==2)continue;let[n,o]=t.pointsToConnect,r={type:"pcb_trace",pcb_trace_id:"",connection_name:t.name,route:[{route_type:"wire",x:n.x,y:n.y,layer:"top",width:0.1},{route_type:"wire",x:o.x,y:o.y,layer:"top",width:0.1}]};e.push(r)}return e}},IHr=(e)=>{let t=Math.min(...e.map((i)=>i.center.x)),n=Math.max(...e.map((i)=>i.center.x)),o=Math.min(...e.map((i)=>i.center.y)),r=Math.max(...e.map((i)=>i.center.y));return{minX:t,maxX:n,minY:o,maxY:r}},vHr=["top","bottom","inner1","inner2"],rve=(e,t,n)=>{let o=[];if(n.length===0){let c=e[0].layers;for(let l of c)o.push(...rve(e.slice(1),t,[l]));return o}if(e.length===0)return[];let r=e[0],i=r.via||r.optional_via,s=n[n.length-1];if(e.length===1){let c=r;if(c.layers&&i)return c.layers.map((l)=>({layer_path:[...n,l]}));if(c.layers?.includes(s))return[{layer_path:[...n,s]}];return[]}if(!i){if(r.layers){if(!r.layers.includes(s))return[]}return rve(e.slice(1),t,n.concat([s]))}let a=(r.optional_via?t:t.filter((c)=>c!==s)).filter((c)=>!r.layers||r.layers?.includes(c));for(let c of a)o.push(...rve(e.slice(1),t,n.concat(c)));return o},SHr=(e,t={})=>rve(e,t.layerSelectionPreference??vHr,[]);function SAn(e){let t={x:e.to.x-e.from.x,y:e.to.y-e.from.y},n=Math.abs(t.x),o=Math.abs(t.y);if(n>o)return t.x>0?"right":"left";return t.y>0?"down":"up"}var Xk=(e)=>{if(e.route_type==="through_pad")return e.start;return{x:e.x,y:e.y}},E4n=(e)=>{if(e.route_type==="through_pad")return[e.start,e.end];return[{x:e.x,y:e.y}]},Mve=(e,t="constant")=>{let n=e.slice().reverse().map((o)=>{if(o.route_type==="wire"){let{start_width:r,end_width:i,width_interpolation_mode:s,...a}=o;return a}if(o.route_type!=="through_pad")return{...o};return{...o,start:o.end,end:o.start,start_layer:o.end_layer,end_layer:o.start_layer}});if(t==="constant"){for(let o=0;o<n.length-1;o++){let r=n[o],i=n[o+1];if(r?.route_type!=="wire"||i?.route_type!=="wire"||r.layer!==i.layer)continue;let s=e[e.length-o-2];if(s?.route_type==="wire")r.width=s.width}for(let o=0;o<n.length;o++){let r=n[o];if(r?.route_type!=="wire")continue;let i=n[o+1];if(i?.route_type==="wire"&&i.layer===r.layer)continue;let s=e.length-o-1;while(s<e.length-1){let c=e[s],l=e[s+1];if(c?.route_type!=="wire"||l?.route_type!=="wire"||c.layer!==l.layer)break;s++}let a=e[s];if(a?.route_type==="wire")r.width=a.width}}for(let o=0;o<e.length-1;o++){let r=e[o],i=e[o+1];if(r.route_type!=="wire"||!r.width_interpolation_mode)continue;if(i.route_type!=="wire"||i.layer!==r.layer)continue;let s=n[e.length-o-2];if(s.route_type!=="wire")continue;Object.assign(s,{width:r.end_width,start_width:r.end_width,end_width:r.start_width,width_interpolation_mode:r.width_interpolation_mode})}return n};function DJ(e,t){let n=Xk(e),o=Xk(t);return Math.hypot(n.x-o.x,n.y-o.y)}var PHr=(e)=>{if(e.length===1)return e[0];if(e.some((c)=>c.length===0))throw Error("Cannot merge routes with zero length");let t=[],n=e[0][0],o=e[0][e[0].length-1],r=e[1][0],i=e[1][e[1].length-1],s=Math.min(DJ(n,r),DJ(n,i)),a=Math.min(DJ(o,r),DJ(o,i));if(s<a)t.push(...Mve(e[0]));else t.push(...e[0]);for(let c=1;c<e.length;c++){let l=t[t.length-1],h=e[c],d=h[0],u=h[h.length-1],_=DJ(l,d),p=DJ(l,u);if(_<p)t.push(...h);else t.push(...Mve(h))}for(let c=1;c<t.length-1;c++){let l=t[c-1],h=t[c];if(l.route_type!=="wire")continue;if(h.route_type!=="wire")continue;if(l.layer!==h.layer)t.splice(c,0,{x:l.x,y:l.y,from_layer:l.layer,to_layer:h.layer,route_type:"via"})}return t};function Crt(e,t){if(e.length<2||!e.some((o)=>o.physicalPinName))return;let n=e.map((o)=>`${o.getParentNormalComponent()?.name??"unnamed component"}.${o.physicalPinName??o.name}`);throw Error(`Ambiguous port "${t}"; use a physical ball name: ${n.join(", ")}.`)}var PAn=new WeakMap,EHr=(e)=>{let t=PAn.get(e);if(!t)t="partial"in e?e.partial({name:!0}):e,PAn.set(e,t);return t},EAn=new WeakMap,MHr=(e,t)=>{let n=EAn.get(e);if(!n){n=new Map;for(let o of e)for(let r of o.getNameAndAliases().join(" ").split(/\s+/)){let i=`net.${r}`;if(!n.has(i))n.set(i,o)}EAn.set(e,n)}return n.get(t)??null},WIe=M4n.default("tscircuit:renderable"),YY=["ReactSubtreesRender","RenderIsolatedSubcircuits","InflateSubcircuitCircuitJson","SourceNameDuplicateComponentRemoval","PcbFootprintStringRender","FetchPartFootprint","ResolveFootprintPinLabels","InitializePortsFromChildren","CreateNetsFromProps","AssignFallbackProps","CreateTracesFromProps","CreateTracesFromNetLabels","CreateTraceHintsFromProps","CreateAutoplacedBreakoutPoints","SourceGroupRender","AssignNameToUnnamedComponents","SourceRender","CheckRefDesConvention","SourceComponentPropertyValidation","SourceParentAttachment","PortMatching","OptimizeSelectorCache","SourceTraceRender","SourceAddConnectivityMapKey","SourceDesignRuleChecks","SimulationRender","SchematicComponentRender","SchematicPortRender","SymbolContainerRender","SchematicPrimitiveRender","SchematicSymbolResize","SchematicComponentSizeCalculation","SchematicLayout","SchematicSectionRender","SchematicTraceRender","SchematicSheetRender","SchematicReplaceNetLabelsWithSymbols","SchematicLabelNetsWithConflictingNames","PanelBoardLayout","ValidatePcbCoordinates","PcbComponentRender","PcbPrimitiveRender","PcbFootprintLayout","PcbPortRender","PcbPortAttachment","PcbComponentSizeCalculation","PcbComponentAnchorAlignment","PcbCalcPlacementResolution","PcbLayout","PcbBoardAutoSize","PanelLayout","PcbFlexRender","PcbAutoplaceBreakoutPoints","PcbTraceHintRender","PcbManualTraceRender","PcbPlacementDesignRuleChecks","PcbTraceRender","PcbRouteNetIslands","PcbTraceTeardropRender","PcbCopperPourRender","PcbViaStitchRender","PcbCopperPourCleanup","PcbSimulationRender","PcbDesignRuleChecks","SilkscreenOverlapAdjustment","CadModelRender","PartsEngineRender","MissingManufacturerPartNumberWarning","ComponentAvailabilityWarning","PartOrientationAnalysis","SupplierFootprintMismatchWarning","SimulationSpiceEngineRender"],MAn=new Map(YY.map((e,t)=>[e,t])),wHr={InflateSubcircuitCircuitJson:["RenderIsolatedSubcircuits"],ResolveFootprintPinLabels:["PcbFootprintStringRender","FetchPartFootprint"],SchematicComponentRender:["PcbFootprintStringRender","FetchPartFootprint"],SchematicPortRender:["PcbFootprintStringRender","FetchPartFootprint"],SymbolContainerRender:["PcbFootprintStringRender","FetchPartFootprint"],SchematicPrimitiveRender:["PcbFootprintStringRender","FetchPartFootprint"],SchematicSymbolResize:["PcbFootprintStringRender","FetchPartFootprint"],SchematicComponentSizeCalculation:["PcbFootprintStringRender","FetchPartFootprint"],SchematicLayout:["PcbFootprintStringRender","FetchPartFootprint"],SchematicSectionRender:["PcbFootprintStringRender","FetchPartFootprint"],SchematicTraceRender:["PcbFootprintStringRender","FetchPartFootprint"],SchematicSheetRender:["PcbFootprintStringRender","FetchPartFootprint"],SchematicReplaceNetLabelsWithSymbols:["PcbFootprintStringRender","FetchPartFootprint"],SchematicLabelNetsWithConflictingNames:["RenderIsolatedSubcircuits","PcbFootprintStringRender","FetchPartFootprint","SchematicTraceRender"],PcbFootprintLayout:["PcbFootprintStringRender","FetchPartFootprint"],PcbComponentSizeCalculation:["PcbFootprintStringRender","FetchPartFootprint"],PcbLayout:["PcbFootprintStringRender","FetchPartFootprint"],PcbBoardAutoSize:["PcbFootprintStringRender","FetchPartFootprint"],PcbTraceHintRender:["PcbFootprintStringRender","FetchPartFootprint"],PcbManualTraceRender:["PcbFootprintStringRender","FetchPartFootprint"],PcbTraceTeardropRender:["PcbTraceRender","PcbRouteNetIslands"],PcbCopperPourRender:["PcbFootprintStringRender","FetchPartFootprint","PcbPlacementDesignRuleChecks","PcbTraceRender","PcbRouteNetIslands","PcbTraceTeardropRender"],PcbViaStitchRender:["PcbFootprintStringRender","FetchPartFootprint","PcbPlacementDesignRuleChecks","PcbTraceRender","PcbRouteNetIslands","PcbCopperPourRender"],PcbPlacementDesignRuleChecks:["PcbFootprintStringRender","FetchPartFootprint"],PcbCopperPourCleanup:["PcbFootprintStringRender","FetchPartFootprint","PcbPlacementDesignRuleChecks","PcbTraceRender","PcbRouteNetIslands","PcbCopperPourRender","PcbViaStitchRender"],PcbTraceRender:["PcbFootprintStringRender","FetchPartFootprint"],PcbRouteNetIslands:["PcbFootprintStringRender","FetchPartFootprint","PcbPlacementDesignRuleChecks"],PcbDesignRuleChecks:["PcbFootprintStringRender","FetchPartFootprint","PcbPlacementDesignRuleChecks","PcbTraceRender","PcbCopperPourRender","PcbViaStitchRender","PcbCopperPourCleanup"],PcbSimulationRender:["PcbFootprintStringRender","FetchPartFootprint","PcbPlacementDesignRuleChecks","PcbTraceRender","PcbRouteNetIslands","PcbCopperPourRender","PcbViaStitchRender","PcbCopperPourCleanup"],SilkscreenOverlapAdjustment:["PcbFootprintStringRender","FetchPartFootprint"],CadModelRender:["PcbFootprintStringRender","FetchPartFootprint"],PartsEngineRender:["PcbFootprintStringRender","FetchPartFootprint"],MissingManufacturerPartNumberWarning:["PcbFootprintStringRender","FetchPartFootprint","PartsEngineRender"],ComponentAvailabilityWarning:["PcbFootprintStringRender","FetchPartFootprint","PartsEngineRender"],PartOrientationAnalysis:["PcbFootprintStringRender","FetchPartFootprint","PartsEngineRender"],SupplierFootprintMismatchWarning:["PcbFootprintStringRender","FetchPartFootprint","PartsEngineRender"],SourceAddConnectivityMapKey:["PcbFootprintStringRender","FetchPartFootprint"],PcbComponentAnchorAlignment:["PcbFootprintStringRender","FetchPartFootprint"],PcbCalcPlacementResolution:["PcbFootprintStringRender","FetchPartFootprint"],ValidatePcbCoordinates:["PcbFootprintStringRender","FetchPartFootprint"],SourceTraceRender:["PcbFootprintStringRender","FetchPartFootprint"],SourceDesignRuleChecks:["PcbFootprintStringRender","FetchPartFootprint"]},BHr=0,THr=0,w4n=class e{_phaseStatesByName;_phaseStatesByIndex;get renderPhaseStates(){return this._phaseStatesByName??=Object.fromEntries(YY.map((t,n)=>[t,this._phaseStatesByIndex[n]]))}set renderPhaseStates(t){this._phaseStatesByName=t}shouldBeRemoved=!1;children;isPcbPrimitive=!1;isSchematicPrimitive=!1;_renderId;_currentRenderPhase=null;_pcbTraceRenderWaitingForPlacementChecks=!1;_asyncEffects=[];parent=null;constructor(t){this._renderId=`${BHr++}`,this.children=[],this._phaseStatesByIndex=Array.from({length:YY.length},()=>({initialized:!1,dirty:!1}))}_markDirty(t){let n=MAn.get(t);for(let o=n;o<YY.length;o++){let r=this._phaseStatesByName?.[YY[o]]??this._phaseStatesByIndex[o];r.dirty=!0}if(this.parent?._markDirty)this.parent._markDirty(t)}_queueAsyncEffect(t,n){let o=`${this._renderId}:${THr++}`,r={asyncEffectId:o,promise:n(),phase:this._currentRenderPhase,effectName:t,complete:!1};this._asyncEffects.push(r);let i=this._getRootCircuit();if(i)i.emit("asyncEffect:start",{asyncEffectId:o,effectName:t,componentDisplayName:this.getString(),phase:r.phase});r.promise.then(()=>{r.complete=!0;let s=this._getRootCircuit();if(s)s.emit("asyncEffect:end",{asyncEffectId:o,effectName:t,componentDisplayName:this.getString(),phase:r.phase})}).catch((s)=>{console.error(`Async effect error in ${r.phase} "${t}":
${s.stack}`),r.complete=!0;let a=this._getRootCircuit();if(a)a.emit("asyncEffect:end",{asyncEffectId:o,effectName:t,componentDisplayName:this.getString(),phase:r.phase,error:s.toString()})})}_emitRenderLifecycleEvent(t,n){let o=this._getRootCircuit();if(o?._hasRenderLifecycleListeners===!1&&!WIe.enabled)return;let r=`renderable:renderLifecycle:${t}:${n}`,i=o&&(!o.hasEventListener||o.hasEventListener(r)||o.hasEventListener("renderable:renderLifecycle:anyEvent"));if(!WIe.enabled&&!i)return;let s=this.getString();if(WIe.enabled)WIe(`${t}:${n} ${s}`);if(!i)return;let a={renderId:this._renderId,componentDisplayName:s,type:r};o.emit(r,a),o.emit("renderable:renderLifecycle:anyEvent",{...a,type:r})}getString(){return this.constructor.name}_hasIncompleteAsyncEffects(){if(this._asyncEffects.some((t)=>!t.complete))return!0;return this.children.some((t)=>typeof t._hasIncompleteAsyncEffects==="function"?t._hasIncompleteAsyncEffects():!1)}_hasIncompleteAsyncEffectsInSubtreeForPhase(t){for(let n of this._asyncEffects)if(!n.complete&&n.phase===t)return!0;for(let n of this.children)if(n._hasIncompleteAsyncEffectsInSubtreeForPhase(t))return!0;return!1}_hasIncompleteAsyncEffectsForPhase(t){let n=this._getRootCircuit();if(n?._hasIncompleteAsyncEffectsForPhase)return n._hasIncompleteAsyncEffectsForPhase(t);return this._hasIncompleteAsyncEffectsInSubtreeForPhase(t)}getCurrentRenderPhase(){return this._currentRenderPhase}getRenderGraph(){return{id:this._renderId,currentPhase:this._currentRenderPhase,renderPhaseStates:this.renderPhaseStates,shouldBeRemoved:this.shouldBeRemoved,children:this.children.map((t)=>t.getRenderGraph())}}getTopLevelRenderable(){let t=this;while(t.parent&&t.parent instanceof e)t=t.parent;return t}runRenderCycle(){for(let t of YY)this.runRenderPhaseForChildren(t),this.runRenderPhase(t)}runRenderPhase(t){this._currentRenderPhase=t;let n=MAn.get(t),o=this._phaseStatesByName?.[t]??this._phaseStatesByIndex[n],{initialized:r,dirty:i}=o;if(!r&&this.shouldBeRemoved)return;if(this.shouldBeRemoved&&r){this._emitRenderLifecycleEvent(t,"start"),this?.[`remove${t}`]?.(),o.initialized=!1,o.dirty=!1,this._emitRenderLifecycleEvent(t,"end");return}let s=n-1;if(this._asyncEffects.length>0&&s>=0){let c=YY[s];if(this._asyncEffects.some((h)=>h.phase===c&&!h.complete))return}let a=wHr[t]||[];if(a.length>0){for(let c of a)if(this._hasIncompleteAsyncEffectsForPhase(c))return}if(this._emitRenderLifecycleEvent(t,"start"),r){if(i)this?.[`update${t}`]?.(),o.dirty=!1;this._emitRenderLifecycleEvent(t,"end");return}o.dirty=!1,this?.[`doInitial${t}`]?.(),o.initialized=!0,this._emitRenderLifecycleEvent(t,"end")}runRenderPhaseForChildren(t){for(let n of this.children){if(t==="RenderIsolatedSubcircuits"&&"_isIsolatedSubcircuit"in this&&this._isIsolatedSubcircuit&&"doInitialRenderIsolatedSubcircuits"in this)continue;n.runRenderPhaseForChildren(t),n.runRenderPhase(t)}}_getRootCircuit(){if("root"in this)return this.root??null;return null}renderError(t){if(typeof t==="string")throw Error(t);throw Error(JSON.stringify(t,null,2))}},B4n=class extends Error{constructor(e,t,n){let o,r=Object.keys(n).filter((c)=>c!=="_errors"),i=[],s=t.pinLabels;if(s)for(let[c,l]of Object.entries(s)){let h=Array.isArray(l)?l:[l];for(let d of h)if(typeof d==="string"&&(d.startsWith(" ")||d.endsWith(" ")))i.push(`pinLabels.${c} ("${d}" has leading or trailing spaces)`)}let a=r.map((c)=>{if(c==="pinLabels"&&i.length>0)return i.join(", ");if(n[c]._errors[0])return`${c} (${n[c]._errors[0]})`;return`${c} (${JSON.stringify(n[c])})`}).join(", ");if("name"in t)o=`Invalid props for ${e} "${t.name}": ${a}`;else if("footprint"in t&&typeof t.footprint==="string")o=`Invalid props for ${e} (unnamed ${t.footprint} component): ${a}`;else o=`Invalid props for ${e} (unnamed): ${a}`;super(o);this.componentName=e,this.originalProps=t,this.formattedError=n}componentName;originalProps;formattedError},T4n={mm:1};function DHr(e,t){let{knownVariables:n,units:o}=t,r={...T4n,...o??{}},i=D4n(N4n(e)),s=R4n(i,r);return NHr(s,n)}function brt(e){let t=D4n(N4n(e));return R4n(t,T4n).filter((o)=>o.type==="identifier").map((o)=>o.value)}function D4n(e){let t={minx:"minX",maxx:"maxX",miny:"minY",maxy:"maxY"};return e.replace(/\.(minx|maxx|miny|maxy)\b/gi,(n,o)=>`.${t[String(o).toLowerCase()]??n.slice(1)}`)}function N4n(e){let t=e.trim();if(!t.toLowerCase().startsWith("calc"))return t;let n=t.match(/^calc\s*\((.*)\)$/is);if(!n)throw Error(`Invalid calc() expression: "${e}"`);return n[1].trim()}function R4n(e,t){let n=[],o=0,r=(a)=>a>="0"&&a<="9",i=(a)=>a>="A"&&a<="Z"||a>="a"&&a<="z"||a==="_",s=(a)=>i(a)||r(a)||a===".";while(o<e.length){let a=e[o];if(a===" "||a==="\t"||a===`
`||a==="\r"){o++;continue}if(r(a)||a==="."&&o+1<e.length&&r(e[o+1])){let c=o;o++;while(o<e.length){let u=e[o];if(r(u)||u===".")o++;else break}let l=e.slice(c,o),h=Number(l);if(Number.isNaN(h))throw Error(`Invalid number: "${l}"`);let d=o;while(o<e.length&&/[A-Za-z]/.test(e[o]))o++;if(o>d){let u=e.slice(d,o),_=t[u];if(_==null)throw Error(`Unknown unit: "${u}"`);h*=_}n.push({type:"number",value:h});continue}if(i(a)){let c=o;o++;while(o<e.length&&s(e[o]))o++;let l=e.slice(c,o);n.push({type:"identifier",value:l});continue}if(a==="("||a===")"){n.push({type:"paren",value:a}),o++;continue}if(a==="+"||a==="-"||a==="*"||a==="/"){n.push({type:"operator",value:a}),o++;continue}throw Error(`Unexpected character "${a}" in expression "${e}"`)}return n}function NHr(e,t){let n=0,o=()=>e[n],r=()=>e[n++],i=()=>{let h=o();if(!h)throw Error("Unexpected end of expression");if(h.type==="number")return r(),h.value;if(h.type==="identifier"){r();let d=t[h.value];if(d==null)throw Error(`Unknown variable: "${h.value}"`);return d}if(h.type==="paren"&&h.value==="("){r();let d=c(),u=o();if(!u||u.type!=="paren"||u.value!==")")throw Error('Expected ")"');return r(),d}throw Error(`Unexpected token "${h.value}"`)},s=()=>{let h=o();if(h&&h.type==="operator"&&(h.value==="+"||h.value==="-")){r();let d=s();return h.value==="+"?d:-d}return i()},a=()=>{let h=s();while(!0){let d=o();if(!d||d.type!=="operator")break;if(d.value!=="*"&&d.value!=="/")break;r();let u=s();if(d.value==="*")h*=u;else h/=u}return h},c=()=>{let h=a();while(!0){let d=o();if(!d||d.type!=="operator")break;if(d.value!=="+"&&d.value!=="-")break;r();let u=a();if(d.value==="+")h+=u;else h-=u}return h},l=c();if(n<e.length){let h=e.slice(n).map((d)=>("value"in d)?d.value:"?").join(" ");throw Error(`Unexpected tokens at end of expression: ${h}`)}return l}function Q4n(e){let{vars:t,componentName:n,position:o,size:r}=e;t[`${n}.x`]=o.x,t[`${n}.y`]=o.y,t[`${n}.width`]=r.width,t[`${n}.height`]=r.height,t[`${n}.minX`]=o.x-r.width/2,t[`${n}.maxX`]=o.x+r.width/2,t[`${n}.minY`]=o.y-r.height/2,t[`${n}.maxY`]=o.y+r.height/2}function RHr(e){let t={};for(let n of e.source_component.list()){if(!n.name)continue;let o=e.pcb_component.getWhere({source_component_id:n.source_component_id});if(!o)continue;Q4n({vars:t,componentName:n.name,position:{x:o.center.x,y:o.center.y},size:{width:o.width??0,height:o.height??0}})}return t}var QHr={from_left:{x:-1,y:0,z:0},from_right:{x:1,y:0,z:0},from_top:{x:0,y:1,z:0},from_bottom:{x:0,y:-1,z:0},from_above:{x:0,y:0,z:1},from_below:{x:0,y:0,z:-1}},Qde=(e)=>{let{componentLayer:t,originalLayer:n}=e;return t==="bottom"!==(n==="bottom")},Irt=(e)=>{let{insertionDirection:t,rotationDegrees:n=0,isFlipped:o=!1}=e;if(!t)return;let r=Pfe[t],i=QHr[r],s=Hi(Yg(Bu(n)*Math.PI/180),o?ZR():fh()),a=_o(s,i);return{x:a.x,y:a.y,z:o?-i.z:i.z}},kHr=(e)=>{let t=Irt(e);if(!t)return;if(t.z!==0)return t.z>0?"from_above":"from_below";if(Math.abs(t.x)>=Math.abs(t.y))return t.x>=0?"from_right":"from_left";return t.y>=0?"from_top":"from_bottom"};function LHr(e){if(!e)return;let t={},n={};if(e.silkscreenFontSize!==void 0)n.fontSize=e.silkscreenFontSize;if(e.silkscreenTextVisibility!==void 0)n.visibility=e.silkscreenTextVisibility;if(Object.keys(n).length>0)t["& silkscreentext"]=n;if(Object.keys(t).length===0)return;return t}function HHr({parentResolvedPcbSx:e,pcbStyle:t,ownPcbSx:n}){let o=LHr(t),r={},i=new Set;if(e)for(let s of Object.keys(e))i.add(s);if(o)for(let s of Object.keys(o))i.add(s);if(n)for(let s of Object.keys(n))i.add(s);for(let s of i)r[s]={...e?.[s],...o?.[s],...n?.[s]};return r}function Pst(e,t){let n=["right","up","left","down"],o=n.indexOf(e);if(o===-1)return e;let r=Math.round(t/90),i=(o+r)%4;return n[i<0?i+4:i]}function Est(e,t){if(!e)return e;let n=e,o=n.match(/_(right|left|up|down)$/);if(o)n=n.replace(o[0],`_${Pst(o[1],t)}`);let r=n.match(/_(horz|vert)$/);if(r&&Mst(t))n=n.replace(r[0],r[1]==="horz"?"_vert":"_horz");return n}function Mst(e){let t=(Math.round(e)%360+360)%360;return t===90||t===270}function vrt(e,t){if(!Mst(t))return e;return{width:e.height,height:e.width}}function Qnt(e,t){let n=t.match(/^#(\w+)/);if(n)return e.props.id===n[1];let o=t.match(/^\.(\w+)/);if(o)return e.isMatchingNameOrAlias(o[1]);let[r,...i]=t.split(/(?=[#.[])/);if(r==="pin")r="port";if(r&&r!=="*"&&e.lowercaseComponentName!==r.toLowerCase())return!1;return i.every((s)=>{if(s.startsWith("#"))return e.props.id===s.slice(1);if(s.startsWith("."))return e.isMatchingNameOrAlias(s.slice(1));let a=s.match(/\[(\w+)=['"]?(.+?)['"]?\]/);if(!a)return!0;let[,c,l]=a;return e.props[c].toString()===l})}var FZ={isTag:(e)=>!0,getParent:(e)=>e.parent,getChildren:(e)=>e.children,getName:(e)=>e.lowercaseComponentName,getAttributeValue:(e,t)=>{if(t==="class"&&"getNameAndAliases"in e)return e.getNameAndAliases().join(" ");if(t==="name"&&e._parsedProps?.name)return e._parsedProps.name;if(e._parsedProps&&t in e._parsedProps){let r=e._parsedProps[t];return typeof r==="string"?r:r!==null&&r!==void 0?String(r):null}let n=Object.keys(e._parsedProps??{}).find((r)=>r.toLowerCase()===t);if(n){let r=e._parsedProps[n];return typeof r==="string"?r:r!==null&&r!==void 0?String(r):null}if(t in e){let r=e[t];return typeof r==="string"?r:r!==null&&r!==void 0?String(r):null}let o=e._attributeLowerToCamelNameMap;if(o){let r=o[t];if(r&&r in e){let i=e[r];return typeof i==="string"?i:i!==null&&i!==void 0?String(i):null}}return null},hasAttrib:(e,t)=>{if(t==="class")return!!e._parsedProps?.name;if(e._parsedProps&&t in e._parsedProps)return!0;if(Object.keys(e._parsedProps??{}).some((o)=>o.toLowerCase()===t))return!0;if(t in e)return!0;let n=e._attributeLowerToCamelNameMap;if(n){let o=n[t];if(o&&o in e)return!0}return!1},getSiblings:(e)=>{if(!e.parent)return[];return e.parent.children},prevElementSibling:(e)=>{if(!e.parent)return null;let t=e.parent.children,n=t.indexOf(e);return n>0?t[n-1]:null},getText:()=>"",removeSubsets:(e)=>e.filter((t,n)=>!e.some((o,r)=>n!==r&&o!==t&&o.getDescendants().includes(t))),existsOne:(e,t)=>t.some(e),findAll:(e,t)=>{let n=[],o=(r)=>{if(e(r))n.push(r);for(let i of r.children)o(i)};for(let r of t)o(r);return n},findOne:(e,t)=>{for(let n of t){if(e(n))return n;let o=n.children;if(o.length>0){let r=FZ.findOne(e,o);if(r)return r}}return null},equals:(e,t)=>e._renderId===t._renderId,isHovered:(e)=>!1,isVisited:(e)=>!1,isActive:(e)=>!1},FHr={...FZ,getChildren:(e)=>e.children.filter((t)=>!t.isSubcircuit)},wAn={...FZ,getChildren:(e)=>e.children.filter((t)=>t.isSubcircuit)},zHr=(e,t)=>{let n=e.split("net.")[1]?.split(/[ >]/)[0]??e;return`Net names cannot contain "+" or "-" (component "${t?.componentName??"Unknown component"}" received "${n}" via "${e}"). Try using underscores instead, e.g. VCC_P`},wve=(e,t)=>{if(/net\.[^\s>]*\./.test(e))throw Error('Net names cannot contain a period, try using "sel.net..." to autocomplete with conventional net names, e.g. V3_3');if(/net\.[^\s>]*[+-]/.test(e))throw Error(zHr(e,t));if(/net\.[0-9]/.test(e)){let n=e.match(/net\.([^ >]+)/),o=n?n[1]:"";throw Error(`Net name "${o}" cannot start with a number, try using a prefix like "VBUS1"`)}return e.replace(/ pin(?=[\d.])/g," port").replace(/ subcircuit\./g," group[isSubcircuit=true]").replace(/([^ ])\>([^ ])/g,"$1 > $2").replace(/(^|[ >])(?!pin\.)(?!port\.)(?!net\.)([A-Z][A-Za-z0-9_-]*)\.([A-Za-z0-9_-]+)/g,(n,o,r,i)=>{let s=/^\d+$/.test(i)?`pin${i}`:i;return`${o}.${r} > .${s}`}).trim()},knt={adapter:FHr,cacheResults:!0},OHr={componentName:"",zodProps:Ee({}).passthrough()},lr=class extends w4n{parent=null;_childrenVersion=0;children;childrenPendingRemoval;get config(){return OHr}props;_parsedProps;get componentName(){return this.config.componentName}getInheritedProperty(e){let t=this;while(t){if(t._parsedProps&&e in t._parsedProps)return t._parsedProps[e];t=t.parent}if(this.root?.platform&&e in this.root.platform)return this.root.platform[e];return}getInheritedMergedProperty(e){let t=this.parent?.getInheritedMergedProperty?.(e),n=this._parsedProps?.[e];return{...t,...n}}getResolvedPcbSx(){return HHr({parentResolvedPcbSx:this.parent?.getResolvedPcbSx?.(),pcbStyle:this._parsedProps?.pcbStyle,ownPcbSx:this._parsedProps?.pcbSx})}getSchematicSectionName(){return this._parsedProps?.schSectionName??null}get lowercaseComponentName(){return this.componentName.toLowerCase()}externallyAddedAliases;get isSubcircuit(){return Boolean(this.props.subcircuit)||this.lowercaseComponentName==="group"&&this?.parent?.isRootCircuit}get isGroup(){return this.lowercaseComponentName==="group"}get isRoutingDirective(){return!1}get name(){return this._parsedProps.name??this.fallbackUnassignedName}isPrimitiveContainer=!1;canHaveTextChildren=!1;source_group_id=null;source_component_id=null;schematic_component_id=null;schematic_sheet_id=null;pcb_component_id=null;cad_component_id=null;_reportedInvalidPcbCalcWarnings=new Set;_reportInvalidComponentPropertyError(e,t){if(!this.root||this._reportedInvalidPcbCalcWarnings.has(e))return;this.root.db.source_invalid_component_property_error.insert({source_component_id:this.source_component_id||"",property_name:e,message:t,error_type:"source_invalid_component_property_error"}),this._reportedInvalidPcbCalcWarnings.add(e)}fallbackUnassignedName;constructor(e){super(e);this.children=[],this.childrenPendingRemoval=[],this.props=e??{},this.externallyAddedAliases=[];let n=EHr(this.config.zodProps).safeParse(e??{});if(n.success)this._parsedProps=n.data;else throw new B4n(this.lowercaseComponentName,this.props,n.error.format())}setProps(e){let t=this.config.zodProps.parse({...this.props,...e}),n=this.props;this.props=t,this._parsedProps=this.config.zodProps.parse(e),this.onPropsChange({oldProps:n,newProps:t,changedProps:Object.keys(e)}),this.parent?.onChildChanged?.(this)}_getPcbRotationBeforeLayout(){let{pcbRotation:e}=this.props;if(typeof e==="string")return parseFloat(e);return e??null}getResolvedPcbPositionProp(){return{pcbX:this._resolvePcbCoordinate(this._parsedProps.pcbX,"pcbX"),pcbY:this._resolvePcbCoordinate(this._parsedProps.pcbY,"pcbY")}}doInitialValidatePcbCoordinates(){if(this.root?.pcbDisabled)return;let e=this.props,{pcbX:t,pcbY:n}=e;this._validatePcbCoordinateReferences({rawValue:t,axis:"pcbX",propertyName:"pcbX"}),this._validatePcbCoordinateReferences({rawValue:n,axis:"pcbY",propertyName:"pcbY"})}_validatePcbCoordinateReferences(e){let{rawValue:t,axis:n,propertyName:o=n}=e;if(typeof t!=="string")return;let i=this._isNormalComponent!==!0&&!this._isInsideFootprint(),s=[];try{s=brt(t)}catch{this._reportInvalidComponentPropertyError(o,`Invalid ${o} value for ${this.componentName}: Invalid calc() expression. expression="${t}"`);return}if(s.some((c)=>!c.startsWith("board."))&&!i)this._reportInvalidComponentPropertyError(o,`Invalid ${o} value for ${this.componentName}: component-relative calc references are not supported for footprint elements (${this.componentName}); ${o} will be ignored. expression="${t}"`)}_resolvePcbCoordinate(e,t,n={}){if(e==null)return 0;let o=n.propertyName??t;if(typeof e==="number"){if(Number.isFinite(e))return e;return 0}if(typeof e!=="string")throw Error(`Invalid ${t} value for ${this.componentName}: ${String(e)}`);let r=n.allowBoardVariables??this._shouldAllowBoardVariablesByDefault(),i=this._isNormalComponent===!0,s=n.allowComponentVariables??(!i&&!this._isInsideFootprint()),a=e.includes("board."),c={};if(r){let l=this._getBoard(),h=l?._getBoardCalcVariables()??{};if(a&&!l)return this._reportInvalidComponentPropertyError(o,`Invalid ${o} value for ${this.componentName}: no board found for board.* variables. expression="${e}"`),0;if(a&&l&&Object.keys(h).length===0)return this._reportInvalidComponentPropertyError(o,`Invalid ${o} value for ${this.componentName}: Cannot do calculations based on board size when the board is auto-sized. expression="${e}"`),0;Object.assign(c,h)}if(s){let l=this.root?.db;if(l)Object.assign(c,RHr(l));Object.assign(c,n.componentVariables??{})}try{if(brt(e).some((d)=>!d.startsWith("board."))&&!s){if(this._isInsideFootprint()&&this.root&&!this._reportedInvalidPcbCalcWarnings.has(t))this.root.db.source_invalid_component_property_error.insert({source_component_id:this.source_component_id||"",property_name:t,message:`component-relative calc references are not supported for footprint elements (${this.componentName}); ${t} will be ignored. expression="${e}"`,error_type:"source_invalid_component_property_error"}),this._reportedInvalidPcbCalcWarnings.add(t);return 0}return DHr(e,{knownVariables:c})}catch(l){let h=l instanceof Error?l.message:String(l);return this._reportInvalidComponentPropertyError(o,`Invalid ${o} value for ${this.componentName}: ${h}. expression="${e}"`),0}}_shouldAllowBoardVariablesByDefault(){if(this._isNormalComponent===!0)return!0;return!this._isInsideFootprint()&&!this._isInsideNonBoardSubcircuit()}_isInsideFootprint(){let e=this.parent;while(e){if(e.componentName==="Footprint")return!0;e=e.parent}return!1}_isInsideNonBoardSubcircuit(){let e=this.parent;while(e){let t=e.componentName;if(t==="Board"||t==="MountedBoard")return!1;if(e.isSubcircuit)return!0;e=e.parent}return!1}_hasUserDefinedPcbPosition(){let e=this._parsedProps;return e.pcbX!==void 0||e.pcbY!==void 0||e.pcbLeftEdgeX!==void 0||e.pcbRightEdgeX!==void 0||e.pcbTopEdgeY!==void 0||e.pcbBottomEdgeY!==void 0}resolvePcbCoordinate(e){let{rawValue:t,axis:n,allowBoardVariables:o,allowComponentVariables:r,componentVariables:i,propertyName:s}=e;return this._resolvePcbCoordinate(t,n,{allowBoardVariables:o,allowComponentVariables:r,componentVariables:i,propertyName:s})}computePcbPropsTransform(){let e=this._getPcbRotationBeforeLayout()??0,{pcbX:t,pcbY:n}=this.getResolvedPcbPositionProp();return Hi(Ii(t,n),Yg(e*Math.PI/180))}_computePcbGlobalTransformBeforeLayout(){let e=this.getSubcircuit()._getPcbManualPlacementForComponent(this);if(e&&this.props.pcbX===void 0&&this.props.pcbY===void 0){let t=this._getPcbRotationBeforeLayout()??0;return Hi(this.parent?._computePcbGlobalTransformBeforeLayout()??fh(),Hi(Ii(e.x,e.y),Yg(t*Math.PI/180)))}if(this.isPcbPrimitive){let{isFlipped:t}=this._getPcbPrimitiveFlippedHelpers();if(t)return Hi(this.parent?._computePcbGlobalTransformBeforeLayout()??fh(),ZR(),this.computePcbPropsTransform())}return Hi(this.parent?._computePcbGlobalTransformBeforeLayout()??fh(),this.computePcbPropsTransform())}_getEnclosingFootprint(){let e=this.parent;while(e){if(e.componentName==="Footprint")return e;e=e.parent}return null}getPrimitiveContainer(){if(this.isPrimitiveContainer)return this;return this.parent?.getPrimitiveContainer?.()??null}_getIsSmt(){let e=this.getPrimitiveContainer();return e&&e!==this?e._getIsSmt():!0}_getSymbolAncestor(){let e=this.getPrimitiveContainer();if(e?.componentName==="Symbol")return e;return null}getParentNormalComponent(){let e=this.parent;while(e){if(e.isPrimitiveContainer&&e.doInitialPcbComponentRender)return e;e=e.parent}return null}getCollapsedSchematicBoxAncestor(){let e=this.parent;while(e){if(e.componentName==="Group"&&e._parsedProps?.showAsSchematicBox)return e;e=e.parent}return null}_resolveText(){let e=this._parsedProps.text;if(!e)return"";if(!e.includes("{NAME}")&&!e.includes("{REF}")&&!e.includes("{REFERENCE}"))return e;let n=this.getParentNormalComponent()?.name;if(!n)return e;return e.replace(/\{NAME\}/g,n).replace(/\{REF\}/g,n).replace(/\{REFERENCE\}/g,n)}emitSolderMaskMarginWarning(e,t){if(e&&t!==void 0){let n=this.getParentNormalComponent();if(n?.source_component_id)this.root.db.source_property_ignored_warning.insert({source_component_id:n.source_component_id,property_name:"solderMaskMargin",message:"solderMaskMargin is set but coveredWithSolderMask is true. When a component is fully covered with solder mask, a margin doesn't apply.",error_type:"source_property_ignored_warning"})}}_getPcbCircuitJsonBounds(){return{center:{x:0,y:0},bounds:{left:0,top:0,right:0,bottom:0},width:0,height:0}}_getPcbLocalBoundsBeforeLayout(){let{width:e,height:t}=this.getPcbSize();return{left:-e/2,right:e/2,top:t/2,bottom:-t/2}}_getPcbBoundsBeforeLayout(){let e=this._getGlobalPcbPositionBeforeLayout(),{width:t,height:n}=this.getPcbSize();return{left:e.x-t/2,right:e.x+t/2,top:e.y+n/2,bottom:e.y-n/2}}_getPcbComponentLayer(){return this._parsedProps.layer}_getPcbPrimitiveFlippedHelpers(){let e=this.getPrimitiveContainer(),t=this.componentName==="Footprint"?this:this._getEnclosingFootprint(),n=e?._getPcbComponentLayer(),o=!e?!1:Qde({componentLayer:n,originalLayer:t?._parsedProps.originalLayer});return{isFlipped:o,maybeFlipLayer:(i)=>{if(o)return i==="top"?"bottom":"top";return i}}}_setPositionFromLayout(e){throw Error(`_setPositionFromLayout not implemented for ${this.componentName}`)}computeSchematicPropsTransform(){let{_parsedProps:e}=this;return Hi(Ii(e.schX??0,e.schY??0))}computeSchematicGlobalTransform(){let e=this._getSchematicGlobalManualPlacementTransform(this);if(e)return e;return Hi(this.parent?.computeSchematicGlobalTransform?.()??fh(),this.computeSchematicPropsTransform())}_getSchematicSymbolName(){let{_parsedProps:e}=this,t=this.config.schematicSymbolName,n={horizontal:0,pos_left:0,neg_right:0,pos_right:180,neg_left:180,pos_top:270,neg_bottom:90,vertical:270,pos_bottom:90,neg_top:90},o=e.schOrientation!==void 0?n[e.schOrientation]:e.schRotation;if(o===void 0)o=0;if(o=o%360,o<0)o+=360;if(e.schRotation!==void 0&&o%90!==0)throw Error(`Schematic rotation ${e.schRotation} is not supported for ${this.componentName}`);if(/_(horz|vert|up|down|left|right)$/.test(t)&&t in zs){let d=Est(t,o);if(d&&d in zs)return d;return t}let i=`${t}_horz`,s=`${t}_vert`,a=`${t}_up`,c=`${t}_down`,l=`${t}_left`,h=`${t}_right`;if(h in zs&&o===0)return h;if(a in zs&&o===90)return a;if(l in zs&&o===180)return l;if(c in zs&&o===270)return c;if(i in zs){if(o===0)return i;if(o===180)return i}if(s in zs){if(o===90)return s;if(o===270)return s}if(t in zs)return t;return}_getSchematicSymbolNameOrThrow(){let e=this._getSchematicSymbolName();if(!e)throw Error(`No schematic symbol found (given: "${this.config.schematicSymbolName}")`);return e}getSchematicSymbol(){let e=this._getSchematicSymbolName();if(!e)return null;return zs[e]??null}_getPcbManualPlacementForComponent(e){if(!this.isSubcircuit)return null;let t=this.props.manualEdits;if(!t)return null;let n=t?.pcb_placements;if(!n)return null;for(let o of n)if(Qnt(e,o.selector)||e.props.name===o.selector)return _o(this._computePcbGlobalTransformBeforeLayout(),o.center);return null}_getSchematicManualPlacementForComponent(e){if(!this.isSubcircuit)return null;let t=this.props.manualEdits;if(!t)return null;let n=t.schematic_placements;if(!n)return null;for(let o of n)if(Qnt(e,o.selector)||e.props.name===o.selector)return _o(this.computeSchematicGlobalTransform(),o.center);return null}_getSchematicGlobalManualPlacementTransform(e){let t=this.getSubcircuit()?._parsedProps.manualEdits;if(!t)return null;for(let n of t.schematic_placements??[])if(Qnt(e,n.selector)||e.props.name===n.selector){if(n.relative_to==="group_center")return Hi(this.parent?._computePcbGlobalTransformBeforeLayout()??fh(),Ii(n.center.x,n.center.y))}return null}_getGlobalPcbPositionBeforeLayout(){return _o(this._computePcbGlobalTransformBeforeLayout(),{x:0,y:0})}_getGlobalSchematicPositionBeforeLayout(){return _o(this.computeSchematicGlobalTransform(),{x:0,y:0})}_getBoard(){let e=this;while(e){let t=e,n=t.componentName;if(n==="Board"||n==="MountedBoard")return t;e=e.parent??null}return this.root?._getBoard()}get root(){return this.parent?.root??null}onAddToParent(e){this.parent=e}onPropsChange(e){}onChildChanged(e){this.parent?.onChildChanged?.(e)}add(e){let t=e.__text;if(typeof t==="string"){if(this.canHaveTextChildren||t.trim()==="")return;let n=this._parsedProps?.name,o=n?`<${this.componentName} name="${n}">`:`<${this.componentName}>`,i=/^NaN/.test(t.trim())?` This looks like a numeric expression that evaluated to NaN (e.g. \`\${value}${t.trim().replace(/^NaN/,"")}\` where \`value\` is NaN) — check the computation that produces this value.`:"";throw Error(`Invalid JSX Element: ${o} received stray text "${t}" as a child, but it cannot hold text children. Remove the text or wrap it in an appropriate component.${i}`)}if(Object.keys(e).length===0)return;if(e.lowercaseComponentName==="panel")throw Error("<panel> must be a root-level element");if(!e.onAddToParent)throw Error(`Invalid JSX Element: Expected a React component but received "${JSON.stringify(e)}"`);e.onAddToParent(this),e.parent=this,this.children.push(e),this._childrenVersion++,this._clearSelectorCachesUpTree()}addAll(e){for(let t of e)this.add(t)}remove(e){this.children=this.children.filter((t)=>t!==e),this._childrenVersion++,this.childrenPendingRemoval.push(e),e.shouldBeRemoved=!0,this._clearSelectorCachesUpTree()}_clearSelectorCachesUpTree(){let e=this;while(e)e._cachedSelectAllQueries?.clear(),e._cachedSelectOneQueries?.clear(),e=e.parent}getSubcircuitSelector(){let e=this.name,t=e?`${this.lowercaseComponentName}.${e}`:this.lowercaseComponentName;if(!this.parent)return t;if(this.parent.isSubcircuit)return t;return`${this.parent.getSubcircuitSelector()} > ${t}`}getFullPathSelector(){let e=this.name,t=e?`${this.lowercaseComponentName}.${e}`:this.lowercaseComponentName,n=this.parent?.getFullPathSelector?.();if(!n)return t;return`${n} > ${t}`}getNameAndAliases(){return[this.name,...this._parsedProps.portHints??[]].filter(Boolean)}isMatchingNameOrAlias(e){return this.getNameAndAliases().includes(e)}isMatchingAnyOf(e){return this.getNameAndAliases().some((t)=>e.map((n)=>n.toString()).includes(t))}getPcbSize(){throw Error(`getPcbSize not implemented for ${this.componentName}`)}doesSelectorMatch(e){let t=[this.componentName,this.lowercaseComponentName],n=[this.name].filter(Boolean),o=e.trim().split(/\> /)[0],r=o[0];if(o.length>1)return!1;if(e==="*")return!0;if(e[0]==="#"&&e.slice(1)===this.props.id)return!0;if(e[0]==="."&&n.includes(e.slice(1)))return!0;if(/^[a-zA-Z0-9_]/.test(r)&&t.includes(r))return!0;return!1}getSubcircuit(){if(this.isSubcircuit)return this;let e=this.parent?.getSubcircuit?.();if(!e)throw Error("Component is not inside an opaque group (no board?)");return e}getGroup(){if(this.isGroup)return this;return this.parent?.getGroup?.()??null}_resolveSchematicSheetId(){let e=this._parsedProps?.schSheetName??this.props.schSheetName;if(e){let t=this.root?.db.schematic_sheet.list().find((n)=>n.name===e);if(t)return t.schematic_sheet_id}if(this.schematic_sheet_id)return this.schematic_sheet_id;return this.parent?._resolveSchematicSheetId?.()}doInitialAssignNameToUnnamedComponents(){if(!this._parsedProps.name)this.fallbackUnassignedName=this.getSubcircuit().getNextAvailableName(this)}doInitialOptimizeSelectorCache(){if(!this.isSubcircuit)return;let e=this.selectAll("port"),t=(n)=>/^[A-Za-z_][A-Za-z0-9_-]*$/.test(n);for(let n of e){let r=(n.getParentNormalComponent?.()??n.parent)?.getNameAndAliases(),i=n.getNameAndAliases();if(!r)continue;for(let s of r)for(let a of i){let c=[`.${s} > .${a}`,`.${s} .${a}`];if(t(s)&&t(a))c.push(`${s}.${a}`);for(let l of c){let h=this._cachedSelectAllQueries.get(l);if(h)h.push(n);else this._cachedSelectAllQueries.set(l,[n])}}}for(let[n,o]of this._cachedSelectAllQueries.entries())if(o.length===1)this._cachedSelectOneQueries.set(n,o[0])}updateOptimizeSelectorCache(){this._cachedSelectAllQueries.clear(),this._cachedSelectOneQueries.clear(),this.doInitialOptimizeSelectorCache()}_cachedSelectAllQueries=new Map;selectAll(e){if(this._cachedSelectAllQueries.has(e))return this._cachedSelectAllQueries.get(e);let t=wve(e,this),n=RO(t,this,knt);if(n.length>0)return this._cachedSelectAllQueries.set(e,n),n;let[o,...r]=t.split(" "),i=gK(o,this,{adapter:wAn});if(!i)return this._cachedSelectAllQueries.set(e,n),n;let s=i.selectAll(r.join(" "));return this._cachedSelectAllQueries.set(e,s),s}_cachedSelectOneQueries=new Map;selectOne(e,t){if(/^net\.[A-Za-z_][A-Za-z0-9_]*$/.test(e)){if(t?.port||t?.type&&t.type!=="net")return null;return MHr(this.selectAll("net"),e)}if(this._cachedSelectOneQueries.has(e))return this._cachedSelectOneQueries.get(e);let n=wve(e,this);if(t?.port)t.type="port";let o=null;if(t?.type){let c=RO(n,this,knt).filter((l)=>l.lowercaseComponentName===t.type);if(t.type==="port")Crt(c,e);o=c[0]??null}if(!t?.type)o??=gK(n,this,knt);if(o){if(!t?.type&&o.componentName==="Port")Crt(this.selectAll(e).filter((a)=>a.componentName==="Port"),e);return this._cachedSelectOneQueries.set(e,o),o}let[r,...i]=n.split(" "),s=gK(r,this,{adapter:wAn});if(!s)return null;return o=s.selectOne(i.join(" "),t),this._cachedSelectOneQueries.set(e,o),o}getAvailablePcbLayers(){if(this.isPcbPrimitive){let{maybeFlipLayer:e}=this._getPcbPrimitiveFlippedHelpers();if("layer"in this._parsedProps||this.componentName==="SmtPad")return[e(this._parsedProps.layer??"top")];if("layers"in this._parsedProps)return this._parsedProps.layers;if(this.componentName==="PlatedHole")return[...this.root?._getBoard()?.allLayers??["top","bottom"]];return[]}return[]}getDescendants(){let e=[];for(let t of this.children)e.push(t),e.push(...t.getDescendants());return e}getSelectableDescendants(){let e=[];for(let t of this.children)if(t.isSubcircuit)e.push(t);else e.push(t),e.push(...t.getSelectableDescendants());return e}_getPrimaryPinCount(){return 0}_getSchematicBoxDimensions(){return null}_getSchematicBoxComponentDimensions(){if(this.getSchematicSymbol())return null;if(!this.config.shouldRenderAsSchematicBox)return null;let{_parsedProps:e}=this;return{schWidth:e.schWidth,schHeight:e.schHeight}}renderError(e){if(typeof e==="string")return super.renderError(e);switch(e.type){case"pcb_placement_error":this.root?.db.pcb_placement_error.insert(e);break;case"pcb_via_clearance_error":this.root?.db.pcb_via_clearance_error.insert(e);break;case"pcb_trace_error":this.root?.db.pcb_trace_error.insert(e);break;case"pcb_manual_edit_conflict_warning":this.root?.db.pcb_manual_edit_conflict_warning.insert(e);break;default:this.root?.db.pcb_placement_error.insert(e)}}getString(){let{lowercaseComponentName:e,_parsedProps:t,parent:n}=this;if(t?.pinNumber!==void 0&&n?.props?.name&&t?.name)return`<${e}#${this._renderId}(pin:${t.pinNumber} .${n?.props.name}>.${t.name}) />`;if(n?.props?.name&&t?.name)return`<${e}#${this._renderId}(.${n?.props.name}>.${t?.name}) />`;if(t?.from&&t?.to)return`<${e}#${this._renderId}(from:${t.from} to:${t?.to}) />`;if(t?.name)return`<${e}#${this._renderId} name=".${t?.name}" />`;if(t?.portHints)return`<${e}#${this._renderId}(${t.portHints.map((o)=>`.${o}`).join(", ")}) />`;return`<${e}#${this._renderId} />`}getDisplayName(){if(this.name)return`${this.lowercaseComponentName} "${this.name}"`;return`${this.lowercaseComponentName} (unnamed)`}get[Symbol.toStringTag](){return this.getString()}[Symbol.for("nodejs.util.inspect.custom")](){return this.getString()}};function k4n(e){let t=[];for(let n=0;n<e.length-1;n++)t.push([e[n],e[n+1]]);return t}var Yue=/(?:^|_)(?:GND|AGND|DGND|PGND|VSS)/i,wst=/(?:^|_)(?:V(?!SS)|\d+(?:[_.]\d+)?V)/i,oT=class extends lr{source_net_id;subcircuit_connectivity_map_key=null;get config(){return{componentName:"Net",zodProps:kSt}}getPortSelector(){return`net.${this.props.name}`}doInitialCreateTracesFromProps(){let{connectsTo:e}=this._parsedProps;if(!e)return;if(typeof e==="string")e=[e];for(let t of e)this.add(new O_({from:t,to:this.getPortSelector()}))}doInitialSourceRender(){let{db:e}=this.root,{_parsedProps:t}=this,n=t.isGroundNet??Yue.test(t.name),o=t.isPowerNet??wst.test(t.name),r=e.source_net.insert({name:t.name,member_source_group_ids:[],is_ground:n,is_power:o,trace_width:t.nominalTraceWidth,is_positive_voltage_source:o});this.source_net_id=r.source_net_id}doInitialSourceParentAttachment(){let e=this.getSubcircuit();if(!e)return;let{db:t}=this.root;t.source_net.update(this.source_net_id,{subcircuit_id:e.subcircuit_id})}getAllConnectedPorts(){let e=this.getSubcircuit().selectAll("port"),t=[];for(let n of e){let o=n._getDirectlyConnectedTraces();for(let r of o)if(r._isExplicitlyConnectedToNet(this)){t.push(n);break}}return t}_getAllDirectlyConnectedTraces(){let e=this.getSubcircuit().selectAll("trace"),t=[];for(let n of e)if(n._isExplicitlyConnectedToNet(this))t.push(n);return t}doInitialPcbRouteNetIslands(){if(this.root?.pcbDisabled)return;let e=this.getSubcircuit();if(this.root?.pcbRoutingDisabled||e.getInheritedProperty("routingDisabled"))return;if(e._isInflatedFromCircuitJson)return;if(e._getAutorouterConfig().groupMode!=="sequential-trace")return;let{db:t}=this.root,{_parsedProps:n}=this,o=this._getAllDirectlyConnectedTraces().filter((s)=>(s._portsRoutedOnPcb?.length??0)>0),r=[];for(let s of o){let a=s._portsRoutedOnPcb,c=r.find((l)=>a.some((h)=>l.ports.includes(h)));if(!c){r.push({ports:[...a],traces:[s]});continue}c.traces.push(s),c.ports.push(...a)}if(r.length===0)return;let i=k4n(r);for(let[s,a]of i){let c=s.ports.map((g)=>g._getGlobalPcbPositionBeforeLayout()),l=a.ports.map((g)=>g._getGlobalPcbPositionBeforeLayout()),h=1/0,d=[-1,-1];for(let g=0;g<c.length;g++){let f=c[g];for(let y=0;y<l.length;y++){let x=l[y],C=Math.sqrt((f.x-x.x)**2+(f.y-x.y)**2);if(C<h)h=C,d=[g,y]}}let u=s.ports[d[0]],_=a.ports[d[1]],p=t.toArray().filter((g)=>g.type==="pcb_smtpad"||g.type==="pcb_trace"||g.type==="pcb_plated_hole"||g.type==="pcb_hole"||g.type==="source_port"||g.type==="pcb_port"),{solution:m}=YMt(p.concat([{type:"source_trace",source_trace_id:"__net_trace_tmp",connected_source_port_ids:[u.source_port_id,_.source_port_id]}])),A=m[0];if(!A){this.renderError({pcb_trace_error_id:"",pcb_trace_id:"__net_trace_tmp",pcb_component_ids:[u.pcb_component_id,_.pcb_component_id].filter(Boolean),pcb_port_ids:[u.pcb_port_id,_.pcb_port_id].filter(Boolean),type:"pcb_trace_error",error_type:"pcb_trace_error",message:`Failed to route net islands for "${this.getString()}"`,source_trace_id:"__net_trace_tmp"});return}t.pcb_trace.insert(A)}}renderError(e){if(typeof e==="string")return super.renderError(e);this.root?.db.pcb_trace_error.insert(e)}},Gue=(e,t)=>{for(let n of t)if(typeof n==="string"&&n.startsWith("net.")){if(/net\.[^\s>]*\./.test(n))throw Error('Net names cannot contain a period, try using "sel.net..." to autocomplete with conventional net names, e.g. V3_3');if(/net\.[^\s>]*[+-]/.test(n)){let r=n.split("net.")[1],i=`Net names cannot contain "+" or "-" (component "${e.componentName}" received "${r}" via "${n}"). Try using underscores instead, e.g. VCC_P`;throw Error(i)}if(/net\.[0-9]/.test(n)){let r=n.split("net.")[1];throw Error(`Net name "${r}" cannot start with a number, try using a prefix like "VBUS1"`)}let o=e.getSubcircuit();if(!o.selectOne(n)){let r=new oT({name:n.split("net.")[1]});o.add(r)}}},VHr=(e,t)=>{let n="_getGlobalPcbPositionBeforeLayout"in e?e._getGlobalPcbPositionBeforeLayout():e,o="_getGlobalPcbPositionBeforeLayout"in t?t._getGlobalPcbPositionBeforeLayout():t;return Math.sqrt((n.x-o.x)**2+(n.y-o.y)**2)};function BAn(e,t){if(t.length===0)throw Error("No candidates given to getClosest method");let n=t[0],o=1/0;for(let r of t){let i=VHr(e,r);if(i<o)n=r,o=i}return n}var YHr=(e)=>{if(e.outline&&e.outline.length>0)return new El(e.outline.map((t)=>P_(t.x,t.y)));return new El(new YA(e.center.x-e.width/2,e.center.y-e.height/2,e.center.x+e.width/2,e.center.y+e.height/2).toPoints())},GHr=({mergedRoute:e,db:t,pcbBoardId:n})=>{let o=t.pcb_board.get(n);if(!o)return!1;let r=YHr(o);return!e.flatMap(E4n).every((i)=>r.contains(P_(i.x,i.y)))},kP=({fromLayer:e,toLayer:t,layerCount:n})=>{if(e===t)return[e];let o=["top"];for(let s=1;s<=n-2;s++)o.push(`inner${s}`);o.push("bottom");let r=o.indexOf(e),i=o.indexOf(t);if(r===-1||i===-1)return[e,t];return r<=i?o.slice(r,i+1):o.slice(i,r+1).reverse()},vG=(e)=>{if(e<=1)return["top"];return kP({fromLayer:"top",toLayer:"bottom",layerCount:e})},L4n=({fromLayer:e,toLayer:t,layerCount:n,allowBlindAndBuriedVias:o=!1,physicalLayers:r})=>{let i=vG(n);if(!o)return i;if(r?.length){let s=new Set(r),a=i.filter((d)=>s.has(d)),c=i.indexOf(a[0]),l=i.indexOf(a[a.length-1]),h=i.slice(c,l+1);if(s.has(e)&&s.has(t)&&s.size===h.length&&h.every((d)=>s.has(d)))return h}return kP({fromLayer:e,toLayer:t,layerCount:n})},Bst=(e)=>{let t=vG(e);if(t.length<=1)return t;return[t[0],t[t.length-1],...t.slice(1,-1)]};function UHr(e,t={}){let{center:n,radius:o}=e,{rectHeight:r=0.1}=t,i=[],s=Math.ceil(o*2/r);for(let a=0;a<s;a++){let c=n.y-o+(a+0.5)*r,l=c-n.y,h=Math.sqrt(o*o-l*l);if(h>0)i.push({center:{x:n.x,y:c},width:h*2,height:r})}return i}function Srt(e,t={}){if(e.length<3)return[];let{rectHeight:n=0.1}=t,o=[],r=e.map((a)=>a.y),i=Math.min(...r),s=Math.max(...r);for(let a=i;a<s;a+=n){let c=a+n/2,l=[];for(let h=0;h<e.length;h++){let d=e[h],u=e[(h+1)%e.length];if(d.y<=c&&u.y>c||u.y<=c&&d.y>c){let _=(c-d.y)*(u.x-d.x)/(u.y-d.y)+d.x;l.push(_)}}l.sort((h,d)=>h-d);for(let h=0;h<l.length;h+=2)if(h+1<l.length){let d=l[h],_=l[h+1]-d;if(_>0.000001)o.push({center:{x:d+_/2,y:c},width:_,height:n})}}return o}var WHr=0.001,XHr=(e)=>{let t=(c,l)=>Math.abs(c-l)<=WHr,n=e.filter((c,l)=>l===0||!t(c.x,e[l-1].x)||!t(c.y,e[l-1].y));if(n.length>1&&t(n[0].x,n.at(-1).x)&&t(n[0].y,n.at(-1).y))n.pop();if(n.length<4)return null;let o=Math.min(...n.map((c)=>c.x)),r=Math.max(...n.map((c)=>c.x)),i=Math.min(...n.map((c)=>c.y)),s=Math.max(...n.map((c)=>c.y)),a=[{x:o,y:i},{x:o,y:s},{x:r,y:i},{x:r,y:s}];if(!n.every((c)=>t(c.x,o)||t(c.x,r)||t(c.y,i)||t(c.y,s))||!a.every((c)=>n.some((l)=>t(l.x,c.x)&&t(l.y,c.y))))return null;return{center:{x:(o+r)/2,y:(i+s)/2},width:r-o,height:s-i}},jHr=12,KHr=0.99,$Hr=0.001,qHr=(e)=>{let{outline:t,stroke_width:n}=e,o=t[0],r=t.at(-1);if(!o||!r)return null;if(o.x!==r.x||o.y!==r.y)return null;let i=t.slice(0,-1);if(i.length<jHr)return null;let s=Math.min(...i.map(({x:y})=>y)),a=Math.max(...i.map(({x:y})=>y)),c=Math.min(...i.map(({y})=>y)),l=Math.max(...i.map(({y})=>y)),h=a-s,d=l-c,u=Math.max(h,d);if(!Number.isFinite(u)||u<=0||Math.min(h,d)/u<KHr)return null;let _={x:(s+a)/2,y:(c+l)/2},p=i.map(({x:y,y:x})=>Math.hypot(y-_.x,x-_.y));if(Math.max(...p)-Math.min(...p)>u*$Hr)return null;let m=i.map(({x:y,y:x})=>Math.atan2(x-_.y,y-_.x)),A=m.map((y,x)=>{let C=m[(x+1)%m.length];return Math.atan2(Math.sin(C-y),Math.cos(C-y))}),g=Math.sign(A[0]);if(g===0||A.some((y)=>Math.sign(y)!==g||Math.abs(y)>4*Math.PI/i.length))return null;let f=u+n;return{center:_,width:f,height:f}},JHr=(e,t)=>{let{outline:n,stroke_width:o}=e;if(!Number.isFinite(o)||o<=0)return[];let r=qHr(e);if(r)return[{obstacleId:e.pcb_keepout_id,componentId:t,type:"rect",layers:e.layers,...r,connectedTo:[]}];let i=[];for(let c=0;c<n.length-1;c++){let l=n[c],h=n[c+1],d=h.x-l.x,u=h.y-l.y,_=Math.hypot(d,u);if(!Number.isFinite(_)||_===0)continue;i.push({obstacleId:`${e.pcb_keepout_id}_segment_${c}`,componentId:t,type:"rect",layers:e.layers,center:{x:(l.x+h.x)/2,y:(l.y+h.y)/2},width:_,height:o,ccwRotationDegrees:Math.atan2(u,d)*180/Math.PI,connectedTo:[]})}let a=n.length>1&&n[0].x===n.at(-1)?.x&&n[0].y===n.at(-1)?.y?n.slice(0,-1):n;for(let[c,l]of a.entries())i.push({obstacleId:`${e.pcb_keepout_id}_join_${c}`,componentId:t,type:"rect",layers:e.layers,center:l,width:o,height:o,connectedTo:[]});return i},TAn=(e,t)=>Math.abs(e-t)<0.0001,ZHr=(e,t,{viaDiameter:n=0.5}={})=>{let o=[];for(let r=0;r<e.length-1;r++){let[i,s]=[e[r],e[r+1]],a=r-1>=0?e[r-1]:null,c=TAn(i.y,s.y),l=TAn(i.x,s.x);if(!c&&!l)throw Error(`getObstaclesFromTrace currently only supports horizontal and vertical traces (not diagonals) Conflicting trace: ${t}, start: (${i.x}, ${i.y}), end: (${s.x}, ${s.y})`);let h={type:"rect",layers:[i.layer],center:{x:(i.x+s.x)/2,y:(i.y+s.y)/2},width:c?Math.abs(i.x-s.x):0.1,height:l?Math.abs(i.y-s.y):0.1,connectedTo:[t]};if(o.push(h),a&&a.layer===i.layer&&i.layer!==s.layer){let d={type:"rect",layers:[i.layer,s.layer],center:{x:i.x,y:i.y},connectedTo:[t],width:n,height:n};o.push(d)}}return o},eFr=0.01,Lnt=(e)=>{let t=(e.rotation%360+360)%360,n=[0,90,180,270];for(let o of n){if(Math.min(Math.abs(t-o),360-Math.abs(t-o))>eFr)continue;let i=o===90||o===270;return{center:e.center,width:i?e.height:e.width,height:i?e.width:e.height}}return null},H4n=(e,t)=>{let n=e.find((d)=>d.type==="pcb_board"),o=vG(n?.num_layers??4),r=new Map(e.flatMap((d)=>d.type==="pcb_component"?[[d.pcb_component_id,d]]:[])),i=new Map(e.flatMap((d)=>d.type==="pcb_port"?[[d.pcb_port_id,d]]:[])),s=new Map(e.flatMap((d)=>d.type==="source_component"?[[d.source_component_id,d]]:[])),a=new Map(e.flatMap((d)=>d.type==="source_port"?[[d.source_port_id,d]]:[])),c=({pcbComponentId:d,pcbPortId:u})=>{let _=u?i.get(u):void 0,p=_?a.get(_.source_port_id):void 0,m=(d?r.get(d)?.source_component_id:void 0)??p?.source_component_id,A=m?s.get(m):void 0;return{...A?.name?{source_component_name:A.name}:{},...p?.name?{source_port_name:p.name}:{}}},l=(d)=>t?d.concat(d.map((u)=>t?.getNetConnectedToId(u)).filter(Boolean)):d,h=[];for(let d of e){let u=d.pcb_component_id??void 0;if(d.type==="pcb_smtpad"){let _={pcb_smtpad_id:d.pcb_smtpad_id,pcb_port_id:d.pcb_port_id,...c({pcbComponentId:u,pcbPortId:d.pcb_port_id})};if(d.shape==="circle")h.push({circuitJsonMetadata:_,componentId:u,type:"rect",shape:"circle",layers:[d.layer],center:{x:d.x,y:d.y},width:d.radius*2,height:d.radius*2,connectedTo:l([d.pcb_smtpad_id])});else if(d.shape==="rect")h.push({circuitJsonMetadata:_,componentId:u,type:"rect",layers:[d.layer],center:{x:d.x,y:d.y},width:d.width,height:d.height,connectedTo:l([d.pcb_smtpad_id])});else if(d.shape==="rotated_rect"){let p={center:{x:d.x,y:d.y},width:d.width,height:d.height,rotation:d.ccw_rotation},m=Lnt(p),A=m??p;h.push({circuitJsonMetadata:_,componentId:u,type:"rect",layers:[d.layer],center:A.center,width:A.width,height:A.height,ccwRotationDegrees:m?void 0:d.ccw_rotation,connectedTo:l([d.pcb_smtpad_id])})}else if(d.shape==="pill"||d.shape==="rotated_pill")h.push({circuitJsonMetadata:_,componentId:u,type:"rect",layers:[d.layer],center:{x:d.x,y:d.y},width:d.width,height:d.height,...d.shape==="rotated_pill"?{ccwRotationDegrees:d.ccw_rotation}:{},connectedTo:l([d.pcb_smtpad_id])});else if(d.shape==="polygon"){let p=XHr(d.points);if(p){h.push({circuitJsonMetadata:_,componentId:u,type:"rect",layers:[d.layer],...p,connectedTo:l([d.pcb_smtpad_id])});continue}let m=Srt(d.points,{rectHeight:0.1});for(let A of m)h.push({circuitJsonMetadata:_,componentId:u,type:"rect",layers:[d.layer],center:A.center,width:A.width,height:A.height,connectedTo:l([d.pcb_smtpad_id])})}}else if(d.type==="pcb_keepout"){if(d.warning_only||d.allow_traces)continue;if(d.shape==="circle")h.push({componentId:u,type:"rect",layers:d.layers,center:{x:d.center.x,y:d.center.y},width:d.radius*2,height:d.radius*2,connectedTo:[]});else if(d.shape==="rect")h.push({componentId:u,type:"rect",layers:d.layers,center:{x:d.center.x,y:d.center.y},width:d.width,height:d.height,connectedTo:[]});else if(d.shape==="outline")h.push(...JHr(d,u))}else if(d.type==="pcb_cutout"){if(d.shape==="rect")h.push({componentId:u,type:"rect",layers:o,center:{x:d.center.x,y:d.center.y},width:d.width,height:d.height,ccwRotationDegrees:d.rotation,connectedTo:[]});else if(d.shape==="circle"){let _=UHr({center:d.center,radius:d.radius},{rectHeight:0.6});for(let p of _)h.push({componentId:u,type:"rect",layers:o,center:p.center,width:p.width,height:p.height,connectedTo:[]})}else if(d.shape==="polygon"){let _=Srt(d.points,{rectHeight:0.6});for(let p of _)h.push({componentId:u,type:"rect",layers:o,center:p.center,width:p.width,height:p.height,connectedTo:[]})}}else if(d.type==="pcb_hole"){if(d.hole_shape==="oval")h.push({componentId:u,obstacleId:d.pcb_hole_id,isNonPlatedHole:!0,type:"rect",layers:o,center:{x:d.x,y:d.y},width:d.hole_width,height:d.hole_height,connectedTo:[]});else if(d.hole_shape==="pill"||d.hole_shape==="rotated_pill")h.push({componentId:u,obstacleId:d.pcb_hole_id,isNonPlatedHole:!0,type:"rect",layers:o,center:{x:d.x,y:d.y},width:d.hole_width,height:d.hole_height,...d.hole_shape==="rotated_pill"?{ccwRotationDegrees:d.ccw_rotation}:{},connectedTo:[]});else if(d.hole_shape==="rect")h.push({componentId:u,obstacleId:d.pcb_hole_id,isNonPlatedHole:!0,type:"rect",layers:o,center:{x:d.x,y:d.y},width:d.hole_width,height:d.hole_height,connectedTo:[]});else if(d.hole_shape==="square")h.push({componentId:u,obstacleId:d.pcb_hole_id,isNonPlatedHole:!0,type:"rect",layers:o,center:{x:d.x,y:d.y},width:d.hole_diameter,height:d.hole_diameter,connectedTo:[]});else if(d.hole_shape==="round"||d.hole_shape==="circle")h.push({componentId:u,obstacleId:d.pcb_hole_id,isNonPlatedHole:!0,type:"rect",shape:"circle",layers:o,center:{x:d.x,y:d.y},width:d.hole_diameter,height:d.hole_diameter,connectedTo:[]})}else if(d.type==="pcb_plated_hole"){let _={pcb_plated_hole_id:d.pcb_plated_hole_id,pcb_port_id:d.pcb_port_id,...c({pcbComponentId:u,pcbPortId:d.pcb_port_id})};if(d.shape==="circle")h.push({circuitJsonMetadata:_,componentId:u,type:"oval",layers:o,center:{x:d.x,y:d.y},width:d.outer_diameter,height:d.outer_diameter,connectedTo:l([d.pcb_plated_hole_id])});else if(d.shape==="circular_hole_with_rect_pad"||d.shape==="pill_hole_with_rect_pad"||d.shape==="rotated_pill_hole_with_rect_pad"){let p=d.shape==="pill_hole_with_rect_pad"?0:d.rect_ccw_rotation??0,m={center:{x:d.x,y:d.y},width:d.rect_pad_width,height:d.rect_pad_height,rotation:p},A=Lnt(m),g=A??m;h.push({circuitJsonMetadata:_,componentId:u,type:"rect",layers:o,center:g.center,width:g.width,height:g.height,ccwRotationDegrees:A?void 0:m.rotation,connectedTo:l([d.pcb_plated_hole_id])})}else if(d.shape==="oval"){let p={center:{x:d.x,y:d.y},width:d.outer_width,height:d.outer_height,rotation:d.ccw_rotation??0},m=Lnt(p),A=m??p;h.push({circuitJsonMetadata:_,componentId:u,type:"oval",layers:o,center:A.center,width:A.width,height:A.height,ccwRotationDegrees:m?void 0:p.rotation,connectedTo:l([d.pcb_plated_hole_id])})}else if(d.shape==="pill")h.push({circuitJsonMetadata:_,componentId:u,type:"rect",layers:o,center:{x:d.x,y:d.y},width:d.outer_width,height:d.outer_height,ccwRotationDegrees:d.ccw_rotation,connectedTo:l([d.pcb_plated_hole_id])});else if(d.shape==="hole_with_polygon_pad"){if("pad_outline"in d&&d.pad_outline&&d.pad_outline.length>0){let p=d.pad_outline.map((b)=>d.x+b.x),m=d.pad_outline.map((b)=>d.y+b.y),A=Math.min(...p),g=Math.max(...p),f=Math.min(...m),y=Math.max(...m),x=(A+g)/2,C=(f+y)/2;h.push({circuitJsonMetadata:_,componentId:u,type:"rect",layers:o,center:{x,y:C},width:g-A,height:y-f,connectedTo:l([d.pcb_plated_hole_id])})}}}else if(d.type==="pcb_trace"){let _=ZHr(d.route.flatMap((p)=>{if(p.route_type==="through_pad")return[{x:p.start.x,y:p.start.y,layer:p.start_layer},{x:p.end.x,y:p.end.y,layer:p.end_layer}];return[{x:p.x,y:p.y,layer:p.route_type==="wire"?p.layer:p.from_layer}]}),d.source_trace_id??d.pcb_trace_id);h.push(..._.map((p)=>({...p,componentId:u})))}else if(d.type==="pcb_via"){let _=Boolean(d.net_is_assignable??d.netIsAssignable);h.push({circuitJsonMetadata:{pcb_via_id:d.pcb_via_id,...c({pcbComponentId:u})},componentId:u,type:"rect",shape:"circle",layers:d.layers,center:{x:d.x,y:d.y},connectedTo:l([d.pcb_via_id]),width:d.outer_diameter,height:d.outer_diameter,netIsAssignable:_||void 0})}}return h},$B=({text:e,font_size:t=0.18})=>{let n=t/0.18,o=0.12*n,r=0.12*n;return e.length*o+r},wP=({anchor_position:e,anchor_side:t,text:n,font_size:o=0.18})=>{let r=$B({text:n,font_size:o}),i=o,s={...e};switch(t){case"right":s.x-=r/2;break;case"left":s.x+=r/2;break;case"top":s.y-=i/2;break;case"bottom":s.y+=i/2;break}return s},tFr=(e,t)=>{let n=0;n+=e.length??0,n+=t.filter((o)=>o.is_crossing).length;for(let o=1;o<t.length;o++){let r=t[o-1],i=t[o],s=Math.abs(r.from.x-r.to.x)<0.01,a=Math.abs(i.from.x-i.to.x)<0.01;if(s!==a)n++}return n},mZ=(e)=>({up:"bottom",down:"top",left:"right",right:"left"})[e]??null,Prt=({firstEdge:e,firstEdgePort:t,firstDominantDirection:n,lastEdge:o,lastEdgePort:r,lastDominantDirection:i})=>{if(e&&t)return Prt({lastEdge:{from:e.to,to:e.from},lastEdgePort:t,lastDominantDirection:n}).reverse().map((a)=>({from:a.to,to:a.from}));let s=[];if(o&&r){let a={x:o.to.x,y:o.to.y};if(i==="left"||i==="right")a.x=r.position.x,s.push({from:o.to,to:{...a}}),s.push({from:a,to:{...r.position}});else a.y=r.position.y,s.push({from:o.to,to:{...a}}),s.push({from:a,to:{...r.position}})}return s=s.filter((a)=>Jl(a.from,a.to)>0.01),s};function nFr(e){try{return[e(),null]}catch(t){return[null,t]}}var oFr=oRt.version??"unknown",Ide=class extends Error{constructor(e){super(`${e} (capacity-autorouter@${oFr})`);this.name="AutorouterError"}},dG=class extends Error{constructor(e){super(e.message);this.errorData=e,this.name="TraceConnectionError"}errorData},rFr=0.2,iFr=0.3,DAn=(e,t)=>{if(e===void 0)return t;if(typeof e==="number")return e;let n=parseFloat(e);return Number.isFinite(n)?n:t},cT=(e)=>({holeDiameter:DAn(e?.viaHoleDiameter,rFr),padDiameter:DAn(e?.viaPadDiameter,iFr)}),sFr=(e,t)=>{let n=cT(t);return{holeDiameter:e.holeDiameter??n.holeDiameter,padDiameter:e.padDiameter??n.padDiameter}},Tst=(e)=>{if(e===void 0)return{};return{tented_on_top:e==="top_tented"||e==="top_and_bottom_tented",tented_on_bottom:e==="bottom_tented"||e==="top_and_bottom_tented"}};function F4n(e,t){let n=t.x-e.x,o=t.y-e.y;if(Math.abs(n)>Math.abs(o))return n>=0?"right":"left";return o>=0?"up":"down"}var aFr=new Proxy({},{get:(e,t)=>t}),LP=aFr,qB="rgba(132, 0, 0)",B8e=0.12,Bve=(e)=>{if(e.length<=1)return!0;let t=e.map((i)=>{let s=i._getPcbCircuitJsonBounds();return{left:s.bounds.left,right:s.bounds.right,top:s.bounds.top,bottom:s.bounds.bottom}}),n=Array(t.length).fill(!1).map(()=>Array(t.length).fill(!1));for(let i=0;i<t.length;i++)for(let s=i+1;s<t.length;s++){let a=t[i],c=t[s];n[i][s]=n[s][i]=!(a.right<c.left||a.left>c.right||a.bottom>c.top||a.top<c.bottom)}let o=new Set,r=(i)=>{o.add(i);for(let s=0;s<t.length;s++)if(n[i][s]&&!o.has(s))r(s)};return r(0),o.size===t.length},Ert=(e)=>{if(e.length===0)throw Error("Cannot get center of empty PCB primitives array");let t=e.map((r)=>r._getPcbCircuitJsonBounds().center).filter(Boolean),n=t.reduce((r,i)=>r+i.x,0),o=t.reduce((r,i)=>r+i.y,0);return{x:n/t.length,y:o/t.length}},cFr=(e)=>{if(!e)return[];return typeof e==="string"?[e]:[...e]};function lFr(e){if(!e.isGroupPort())return;let t=e._parsedProps.connectsTo;if(!t)return;let n=e.parent;if(!n)return;let o=n._parsedProps?.connections;if(Object.keys(o??{}).some((c)=>e.isMatchingAnyOf([c])))return;let i=n.name,s=e.name;if(!i||!s)return;let a=`.${i} > .${s}`;for(let c of cFr(t)){if(n.children.some((h)=>{if(!(h instanceof O_))return!1;let d=h._parsedProps;if(!("from"in d)||!("to"in d))return!1;return d.from===a&&d.to===c||d.from===c&&d.to===a}))continue;n.add(new O_({from:a,to:c}))}}function hFr(e){let t=Eve(e);if(t.requires_ground===!0||t.provides_ground===!0)return!0;for(let n of e.getNameAndAliases())if(Yue.test(n))return!0;return!1}function dFr(e){return e._parsedProps.isGroundNet??Yue.test(e._parsedProps.name)}function uFr(e){let t=new Set([e,...e._getPortsInternallyConnectedToThisPort()]),n=new Set([...t].flatMap((o)=>o._getDirectlyConnectedTraces()));for(let o of n){let r=o._findConnectedPorts().ports??[],i=new Set(r.flatMap((s)=>[s,...s._getPortsInternallyConnectedToThisPort()]));for(let s of i){if(t.has(s))continue;if(hFr(s))return!0}for(let s of o._findConnectedNets().nets)if(s&&dFr(s))return!0}return!1}function pFr(e){if(e.getParentNormalComponent()?.config.componentName!=="Chip")return!1;let t=Eve(e);if(t.should_have_decoupling_capacitor!==void 0)return t.should_have_decoupling_capacitor;if(t.requires_power!==void 0)return t.requires_power;if(t.provides_power===!0)return!1;let n=e.getNameAndAliases();if(t.requires_ground===!0||t.provides_ground===!0||n.some((o)=>Yue.test(o)))return!1;for(let o of n){if(o===e.physicalPinName)continue;if(wst.test(o))return!0}return!1}function mFr(e){let t=new Set([e,...e._getPortsInternallyConnectedToThisPort()]),n=new Set([...t].flatMap((o)=>o._getDirectlyConnectedTraces()));for(let o of n){let r=o._findConnectedPorts().ports??[],i=new Set(r.flatMap((s)=>[s,...s._getPortsInternallyConnectedToThisPort()]));for(let s of i){if(t.has(s))continue;if(pFr(s))return!0}}return!1}function Hnt(e){if(e.root?.pcbDisabled)return!1;if(e.pcb_port_id)return!0;let{db:t}=e.root,n=e.matchedComponents.filter((c)=>c.isPcbPrimitive),o=n.length===1?n[0]._getPcbCircuitJsonBounds().center:n.length>1&&Bve(n)?Ert(n):null;if(o){let c=t.pcb_port.insert({pcb_component_id:void 0,layers:e.getAvailablePcbLayers(),subcircuit_id:e.getSubcircuit()?.subcircuit_id??void 0,pcb_group_id:e.getGroup()?.pcb_group_id??void 0,...o,source_port_id:e.source_port_id,is_board_pinout:e.parent?.componentName==="Board"});return e.pcb_port_id=c.pcb_port_id,!0}let r=e._getConnectedPortsFromConnectsTo()[0];if(!r?.pcb_port_id)return!1;let i=t.pcb_port.get(r.pcb_port_id);if(!i)return!1;let s=e.getSubcircuit(),a=t.pcb_port.insert({pcb_component_id:void 0,layers:r.getAvailablePcbLayers(),subcircuit_id:s?.subcircuit_id??void 0,pcb_group_id:e.getGroup()?.pcb_group_id??void 0,x:i.x,y:i.y,source_port_id:e.source_port_id,is_board_pinout:!1});return e.pcb_port_id=a.pcb_port_id,!0}var NAn=(e,t)=>e.localeCompare(t,void 0,{numeric:!0,sensitivity:"base"}),z4n=(e,t)=>{let n=t.source_component_id?e.source_component.get(t.source_component_id):void 0,o=!n?e.source_group.list().find((r)=>r.subcircuit_id===t.subcircuit_id):void 0;return n?.name??o?.name},O4n=(e,t)=>{let n=e.source_port.get(t);if(!n?.name)return;let o=z4n(e,n);if(!o)return;return`${o}_${n.name}`},Dst=(e,t)=>{let n=t.map((i)=>e.source_port.get(i)).filter((i)=>Boolean(i));if(n.length===0)return;let o=new Map;for(let i of e.source_port.list()){if(!i.source_component_id)continue;o.set(i.source_component_id,(o.get(i.source_component_id)??0)+1)}let r=n.map((i)=>{let s=z4n(e,i);if(!s||!i.name)return null;return{sourcePort:i,ownerName:s,label:`${s}_${i.name}`,ownerPinCount:i.source_component_id?o.get(i.source_component_id)??0:0}}).filter((i)=>Boolean(i));return r.sort((i,s)=>{let a=s.ownerPinCount-i.ownerPinCount;if(a!==0)return a;let c=NAn(i.ownerName,s.ownerName);if(c!==0)return c;let l=i.sourcePort.pin_number??Number.POSITIVE_INFINITY,h=s.sourcePort.pin_number??Number.POSITIVE_INFINITY,d=l-h;if(d!==0)return d;return NAn(i.sourcePort.name,s.sourcePort.name)}),r[0]?.label},_Fr=0.12,sd=class extends lr{source_port_id=null;pcb_port_id=null;schematic_port_id=null;schematic_stem_line_id=null;shouldCreateSourcePort;schematicSymbolPortDef=null;matchedComponents;_isPrimaryPort=!0;_primaryPinNumber=null;facingDirection=null;originDescription=null;get config(){return{componentName:"Port",zodProps:pEt}}constructor(e,t={}){if(!e.name&&e.pinNumber!==void 0)e.name=`pin${e.pinNumber}`;if(!e.name)throw Error("Port must have a name or a pinNumber");super(e);if(t.originDescription)this.originDescription=t.originDescription;this.shouldCreateSourcePort=t.shouldCreateSourcePort??!0,this.matchedComponents=[]}isGroupPort(){return this.parent?.isGroup===!0}isComponentPort(){return!this.isGroupPort()}_getConnectedPortsFromConnectsTo(){let{_parsedProps:e}=this,t=e.connectsTo;if(!t)return[];let n=[],o=Array.isArray(t)?t:[t];for(let r of o){let i=this.getSubcircuit().selectOne(r,{type:"port"});if(i)n.push(i)}return n}_isBoardPinoutFromAttributes(){let e=this.parent;if(e?._parsedProps?.pinAttributes){let t=e._parsedProps.pinAttributes;for(let n of this.getNameAndAliases())if(t[n]?.includeInBoardPinout)return!0}}_getGlobalPcbPositionBeforeLayout(){if(this.pcb_port_id){let n=this.root?.db.pcb_port.get(this.pcb_port_id);if(n?.pcb_component_id)return{x:n.x,y:n.y}}let e=this.matchedComponents.find((n)=>n.isPcbPrimitive),t=this.parent;if(t&&!t.props.footprint)throw Error(`${t.componentName} "${t.props.name}" does not have a footprint. Add a footprint prop, e.g. <${t.componentName.toLowerCase()} footprint="..." />`);if(!e)throw Error(`Port ${this} has no matching PCB primitives. This often means the footprint's pads lack matching port hints.`);return e?._getGlobalPcbPositionBeforeLayout()??{x:0,y:0}}_getPcbCircuitJsonBounds(){if(!this.pcb_port_id)return super._getPcbCircuitJsonBounds();let{db:e}=this.root,t=e.pcb_port.get(this.pcb_port_id);return{center:{x:t.x,y:t.y},bounds:{left:0,top:0,right:0,bottom:0},width:0,height:0}}_getGlobalPcbPositionAfterLayout(){return this._getPcbCircuitJsonBounds().center}_getPortsInternallyConnectedToThisPort(){let e=this.parent;if(!e||!e._getInternallyConnectedPins)return[];let t=e._getInternallyConnectedPins(),n=new Set([this]),o=!0;while(o){o=!1;for(let r of t){if(!r.some((i)=>n.has(i)))continue;for(let i of r)if(!n.has(i))n.add(i),o=!0}}return n.size>1?[...n]:[]}_hasSchematicPort(){let e=this.getParentNormalComponent();if(e?._parsedProps?.noSchematicRepresentation===!0)return!1;let{schX:t,schY:n}=this._parsedProps;if(t!==void 0&&n!==void 0)return!0;if(e?.getSchematicSymbol()){if(this.schematicSymbolPortDef)return!0;if(this._getPortsInternallyConnectedToThisPort().some((s)=>s.schematicSymbolPortDef))return!0;return!1}let r=e?._getSchematicBoxDimensions();if(r&&this._parsedProps.pinNumber!==void 0){if(r.getPortPositionByPinNumber(this._parsedProps.pinNumber))return!0}return!1}_getGlobalSchematicPositionBeforeLayout(){let{schX:e,schY:t}=this._parsedProps;if(e!==void 0&&t!==void 0){if(this._getSymbolAncestor())return _o(this.computeSchematicGlobalTransform(),{x:0,y:0});return{x:e,y:t}}let n=this.getParentNormalComponent(),o=n?.getSchematicSymbol();if(o){let i=this.schematicSymbolPortDef;if(!i){if(i=this._getPortsInternallyConnectedToThisPort().find((a)=>a.schematicSymbolPortDef)?.schematicSymbolPortDef??null,!i)throw Error(`Couldn't find schematicSymbolPortDef for port ${this.getString()}, searched internally connected ports and none had a schematicSymbolPortDef. Why are we trying to get the schematic position of this port?`)}let s=Hi(n.computeSchematicGlobalTransform(),Ii(-o.center.x,-o.center.y));return _o(s,i)}let r=n?._getSchematicBoxDimensions();if(r&&this._parsedProps.pinNumber!==void 0){let i=r.getPortPositionByPinNumber(this._parsedProps.pinNumber);if(!i)throw Error(`Couldn't find position for schematic_port for port ${this.getString()} inside of the schematic box`);return _o(n.computeSchematicGlobalTransform(),i)}throw Error(`Couldn't find position for schematic_port for port ${this.getString()}`)}_getGlobalSchematicPositionAfterLayout(){let{db:e}=this.root;if(!this.schematic_port_id)throw Error(`Can't get schematic port position after layout for "${this.getString()}", no schematic_port_id`);let t=e.schematic_port.get(this.schematic_port_id);if(!t)throw Error(`Schematic port not found when trying to get post-layout position: ${this.schematic_port_id}`);return t.center}registerMatch(e){this.matchedComponents.push(e)}physicalPinName;getNameAndAliases(){let{_parsedProps:e}=this;return Array.from(new Set([...this.physicalPinName?[this.physicalPinName]:[],...e.name?[e.name]:[],...e.aliases??[],...typeof e.pinNumber==="number"?[`pin${e.pinNumber}`,e.pinNumber.toString()]:[],...this.externallyAddedAliases??[]]))}_getMatchingPinAttributes(){let t=(this.getParentNormalComponent()??this.parent)?._parsedProps,n=t?.pinAttributes,o=t?.noConnect,r=[];for(let i of this.getNameAndAliases()){if(n){let s=n[i];if(s)r.push(s)}if(o?.includes(i))r.push({doNotConnect:!0})}if(r.length===0)return[];return r}_shouldIncludeInBoardPinout(){return this._getMatchingPinAttributes().some((e)=>e.includeInBoardPinout===!0)}isMatchingPort(e){return this.isMatchingAnyOf(e.getNameAndAliases())}getPortSelector(){return`.${(this.getParentNormalComponent()??this.parent)?.props.name} > port.${this.props.name}`}getAvailablePcbLayers(){let{layer:e,layers:t}=this._parsedProps;if(t)return t;if(e)return[e];if(this.pcb_port_id){let n=this.root?.db.pcb_port.get(this.pcb_port_id);if(n?.pcb_component_id)return n.layers}return Array.from(new Set(this.matchedComponents.flatMap((n)=>n.getAvailablePcbLayers())))}_getDirectlyConnectedTraces(){let e=this.getSubcircuit().selectAll("trace"),t=[];for(let n of e){if(n._couldNotFindPort)continue;try{if(n._isExplicitlyConnectedToPort(this))t.push(n)}catch(o){if(o instanceof dG)continue;throw o}}return t}isConnectedToPower(){return mFr(this)}isConnectedToGround(){return uFr(this)}doInitialCreateTracesFromProps(){lFr(this)}doInitialSourceRender(){if(!this.shouldCreateSourcePort)return;let{db:e}=this.root,{_parsedProps:t}=this,n=this.getNameAndAliases(),o=this.getParentNormalComponent(),i=(this.parent?.source_component_id?this.parent:o)?.source_component_id??null,s=Eve(this),a=e.source_port.insert({name:this.physicalPinName??t.name,pin_number:this.physicalPinName?void 0:t.pinNumber,port_hints:n,source_component_id:i,subcircuit_id:this.getSubcircuit()?.subcircuit_id,...s});this.source_port_id=a.source_port_id}updateSourceRender(){if(!this.source_port_id||!this.shouldCreateSourcePort)return;this.root.db.source_port.update(this.source_port_id,Eve(this))}doInitialSourceParentAttachment(){if(!this.shouldCreateSourcePort)return;let{db:e}=this.root,t=this.getParentNormalComponent(),n=this.parent?.source_component_id?this.parent:t;if(this.isGroupPort()){e.source_port.update(this.source_port_id,{source_component_id:null,subcircuit_id:this.getSubcircuit()?.subcircuit_id});return}if(!n?.source_component_id)throw Error(`${this.getString()} has no parent source component (parent: ${this.parent?.getString()})`);e.source_port.update(this.source_port_id,{source_component_id:n.source_component_id,subcircuit_id:this.getSubcircuit()?.subcircuit_id}),this.source_component_id=n.source_component_id}doInitialPcbPortRender(){if(this.root?.pcbDisabled)return;if(this.getPrimitiveContainer()?.isSchematicPrimitive)return;let{db:e}=this.root,{matchedComponents:t}=this;if(this.isGroupPort()){Hnt(this);return}let n=this.getParentNormalComponent(),o=this.parent?.pcb_component_id?this.parent:n;if(!o?.pcb_component_id)throw Error(`${this.getString()} has no parent pcb component, cannot render pcb_port (parent: ${this.parent?.getString()}, parentNormalComponent: ${n?.getString()})`);let r=t.filter((s)=>s.isPcbPrimitive);if(r.length===0)return;let i=null;if(r.length===1)i=r[0]._getPcbCircuitJsonBounds().center;if(r.length>1){if(!Bve(r)){let s=this.props.name,a=this.getParentNormalComponent()?.props.name??"unknown",c=this.getNameAndAliases().filter((h)=>h!==s),l=c.length>0?` (consider using alternate aliases: ${c.join(", ")})`:"";e.source_ambiguous_port_reference.insert({error_type:"source_ambiguous_port_reference",message:`${a}.${s} is ambiguous: ${a}.${s} references multiple non-overlapping pads: ${r.map((h)=>h.getString()).join(", ")}${l}`,source_port_id:this.source_port_id??void 0,source_component_id:this.getParentNormalComponent()?.source_component_id??void 0});return}i=Ert(r)}if(i){let s=this.getSubcircuit(),a=this._shouldIncludeInBoardPinout(),c=e.pcb_port.insert({pcb_component_id:o.pcb_component_id,layers:this.getAvailablePcbLayers(),subcircuit_id:s?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0,...a?{is_board_pinout:!0}:{},...i,source_port_id:this.source_port_id,is_board_pinout:this._isBoardPinoutFromAttributes()});this.pcb_port_id=c.pcb_port_id}else{let s=r[0];throw Error(`${s.getString()} does not have a center or _getGlobalPcbPositionBeforeLayout method (needed for pcb_port placement)`)}}updatePcbPortRender(){if(this.root?.pcbDisabled)return;if(this.getPrimitiveContainer()?.isSchematicPrimitive)return;let{db:e}=this.root;if(this.pcb_port_id)return;if(this.isGroupPort()){Hnt(this);return}let t=this.matchedComponents.filter((c)=>c.isPcbPrimitive);if(t.length===0)return;let n=null;if(t.length===1)n=t[0]._getPcbCircuitJsonBounds().center;if(t.length>1)try{if(Bve(t))n=Ert(t)}catch{}if(!n)return;let o=this.getParentNormalComponent(),r=this.parent?.pcb_component_id?this.parent:o,i=this.getSubcircuit(),s=this._shouldIncludeInBoardPinout(),a=e.pcb_port.insert({pcb_component_id:r?.pcb_component_id,layers:this.getAvailablePcbLayers(),subcircuit_id:i?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0,...s?{is_board_pinout:!0}:{},...n,source_port_id:this.source_port_id,is_board_pinout:this._isBoardPinoutFromAttributes()});this.pcb_port_id=a.pcb_port_id}doInitialPcbPortAttachment(){if(!this.pcb_port_id&&this.source_port_id){let e=this.root?.db.pcb_port.list({source_port_id:this.source_port_id}).find((t)=>Boolean(t.pcb_component_id));if(e){this.pcb_port_id=e.pcb_port_id;return}}if(!this.isGroupPort()||this.pcb_port_id)return;Hnt(this)}_getBestDisplayPinLabel(){let{db:e}=this.root,t=e.source_port.get(this.source_port_id),n=[];for(let i of t?.port_hints??[]){if(i.match(/^(pin)?\d+$/))continue;if(i.match(/^(left|right)/)&&!t?.name.match(/^(left|right)/))continue;n.push(i)}if(this.getParentNormalComponent()?.props?.showPinAliases&&n.length>0)return n.join("/");else if(n.length>0)return n[0];return}doInitialSchematicPortRender(){if(this.root?.schematicDisabled)return;let e=this.getCollapsedSchematicBoxAncestor();if(e&&this.parent!==e)return;let{db:t}=this.root,{_parsedProps:n}=this,{schX:o,schY:r}=n,i=o!==void 0&&r!==void 0?this.getParentNormalComponent():this.getPrimitiveContainer();if(!i)return;if(!this._hasSchematicPort())return;let s=i._getGlobalSchematicPositionBeforeLayout(),a=this._getGlobalSchematicPositionBeforeLayout(),c=null,l=i._getSchematicBoxDimensions();if(l&&n.pinNumber!==void 0)c=l.getPortPositionByPinNumber(n.pinNumber);if(this.getSubcircuit().props._schDebugObjectsEnabled)t.schematic_debug_object.insert({shape:"rect",center:a,size:{width:0.1,height:0.1},label:"obstacle"});let h=o!==void 0&&r!==void 0&&!!this._getSymbolAncestor();if(h&&n.direction)this.facingDirection=n.direction;else if(!c?.side)this.facingDirection=F4n(s,a);else this.facingDirection={left:"left",right:"right",top:"up",bottom:"down"}[c.side];let d=this._getBestDisplayPinLabel(),u=this.getParentNormalComponent(),_=n.direction==="up"?"top":n.direction==="down"?"bottom":n.direction,m=(h&&n.direction?_:void 0)??c?.side??_,A=n.schPinLabelFontSize==="sm"?_Fr:n.schPinLabelFontSize==="default"?void 0:n.schPinLabelFontSize,g={type:"schematic_port",schematic_component_id:u?.schematic_component_id,center:a,source_port_id:this.source_port_id,facing_direction:this.facingDirection,distance_from_component_edge:n.schStemLength??0.4,side_of_component:m,pin_number:n.pinNumber,true_ccw_index:c?.trueIndex,display_pin_label:d,display_pin_label_font_size:A,is_connected:!1,schematic_sheet_id:this._resolveSchematicSheetId()};for(let y of this._getMatchingPinAttributes()){if(y.requiresPower)g.has_input_arrow=!0;if(y.providesPower)g.has_output_arrow=!0}let f=t.schematic_port.insert(g);if(this.schematic_port_id=f.schematic_port_id,n.schStemLength!==void 0&&n.schStemLength!==0){let{schStemLength:y,direction:x}=n,{x:C,y:b}=a;if(x==="right")C-=y;else if(x==="left")C+=y;else if(x==="up")b-=y;else if(x==="down")b+=y;let I=t.schematic_line.insert({schematic_component_id:u?.schematic_component_id,x1:a.x,y1:a.y,x2:C,y2:b,stroke_width:0.02,color:qB,is_dashed:!1,schematic_sheet_id:this._resolveSchematicSheetId()});this.schematic_stem_line_id=I.schematic_line_id}}doInitialSchematicSymbolResize(){if(this.root?.schematicDisabled)return;if(!this.schematic_port_id)return;let t=this._getSymbolAncestor()?.getUserCoordinateToResizedSymbolTransform();if(!t)return;let{db:n}=this.root,o=n.schematic_port.get(this.schematic_port_id);if(o){let r=_o(t,o.center),i=Math.atan2(t.b,t.a)*180/Math.PI;if(o.facing_direction&&i!==0)this.facingDirection=Pst(o.facing_direction,i),n.schematic_port.update(this.schematic_port_id,{facing_direction:this.facingDirection,side_of_component:this.facingDirection==="up"?"top":this.facingDirection==="down"?"bottom":this.facingDirection});if(n.schematic_port.update(this.schematic_port_id,{center:r}),this.schematic_stem_line_id){let s=n.schematic_line.get(this.schematic_stem_line_id);if(s){let a=_o(t,{x:s.x1,y:s.y1}),c=_o(t,{x:s.x2,y:s.y2});n.schematic_line.update(this.schematic_stem_line_id,{x1:a.x,y1:a.y,x2:c.x,y2:c.y});let l=Math.sqrt((a.x-c.x)**2+(a.y-c.y)**2);n.schematic_port.update(this.schematic_port_id,{distance_from_component_edge:l})}}}}_getSubcircuitConnectivityKey(){return this.root?.db.source_port.get(this.source_port_id)?.subcircuit_connectivity_map_key}_setPositionFromLayout(e){let{db:t}=this.root;if(!this.pcb_port_id)return;t.pcb_port.update(this.pcb_port_id,{x:e.x,y:e.y})}_hasMatchedPcbPrimitive(){let e=this.pcb_port_id?this.root?.db.pcb_port.get(this.pcb_port_id):null;return Boolean(e?.pcb_component_id)||this.matchedComponents.some((t)=>t.isPcbPrimitive)}_getNetLabelText(){if(!this.root||!this.source_port_id)return;return O4n(this.root.db,this.source_port_id)}};function Tve(e){try{return e._getPcbBoundsBeforeLayout()}catch{return null}}function V4n(e,t){let n=Tve(e),o=Tve(t);if(!n||!o)return!1;return!(n.right<o.left||n.left>o.right||n.bottom>o.top||n.top<o.bottom)}function gFr(e,t){let n=Tve(e),o=Tve(t);if(!n||!o)return!1;return n.left>=o.left&&n.right<=o.right&&n.bottom>=o.bottom&&n.top<=o.top}function AFr(e){let t=[],n=new Set;for(let o of e){if(n.has(o))continue;let r=[],i=[o];n.add(o);while(i.length>0){let s=i.pop();r.push(s);for(let a of e){if(n.has(a))continue;if(!V4n(s,a))continue;n.add(a),i.push(a)}}t.push(r)}return t}var Y4n=class extends lr{pcb_via_id=null;matchedPort=null;isPcbPrimitive=!0;source_manually_placed_via_id=null;source_trace_id=null;subcircuit_connectivity_map_key=null;constructor(e){super(e);let t=this._getLayers();this._parsedProps.layers=t,this.initPorts()}get config(){return{componentName:"Via",zodProps:p1e}}getAvailablePcbLayers(){return this._getLayers()}_getResolvedViaDiameters(e){return sFr({holeDiameter:this._parsedProps.holeDiameter,padDiameter:this._parsedProps.outerDiameter},e)}getPcbSize(){let e=this.getInheritedMergedProperty("pcbStyle"),{padDiameter:t}=this._getResolvedViaDiameters(e);return{width:t,height:t}}_getPcbCircuitJsonBounds(){let{db:e}=this.root,t=e.pcb_via.get(this.pcb_via_id),n=this.getPcbSize();return{center:{x:t.x,y:t.y},bounds:{left:t.x-n.width/2,top:t.y-n.height/2,right:t.x+n.width/2,bottom:t.y+n.height/2},width:n.width,height:n.height}}_setPositionFromLayout(e){let{db:t}=this.root;t.pcb_via.update(this.pcb_via_id,{x:e.x,y:e.y})}_getLayers(){let{fromLayer:e="top",toLayer:t="bottom"}=this._parsedProps,n=this.parent?this.getSubcircuit()._getSubcircuitLayerCount():2;return kP({fromLayer:e,toLayer:t,layerCount:n})}initPorts(){let e=this._parsedProps.layers;for(let t of e){let n=new sd({name:t,layer:t});n.registerMatch(this),this.add(n)}}_getConnectedNetOrTrace(){let e=this._parsedProps.connectsTo;if(!e)return this._getPortFromContainingPad()?._getDirectlyConnectedTraces()[0]??null;let t=this.getSubcircuit(),n=Array.isArray(e)?e:[e];for(let o of n)if(o.startsWith("net.")){let r=t.selectOne(o,{type:"net"});if(r)return r}return null}doInitialCreateNetsFromProps(){let e=this._parsedProps.connectsTo;if(!e)return;Gue(this,Array.isArray(e)?e:[e])}_getPortFromContainingPad(){if(this.parent?.componentName!=="Footprint")return null;let e=new Set(this.parent.children.filter((t)=>t.componentName==="SmtPad").filter((t)=>gFr(this,t)).map((t)=>t.matchedPort).filter((t)=>t!==null));return e.size===1?[...e][0]:null}doInitialPcbComponentRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,t=this.getInheritedMergedProperty("pcbStyle"),{padDiameter:n}=this._getResolvedViaDiameters(t),o=this._getGlobalPcbPositionBeforeLayout(),r=this.getSubcircuit(),i=e.pcb_component.insert({center:o,width:n,height:n,layer:this._parsedProps.fromLayer??"top",rotation:0,source_component_id:this.source_component_id,subcircuit_id:r?.subcircuit_id??void 0,obstructs_within_bounds:!0});this.pcb_component_id=i.pcb_component_id}doInitialSourceRender(){let{db:e}=this.root,t=this.getGroup(),n=this.getSubcircuit(),o=e.source_manually_placed_via.insert({source_group_id:t?.source_group_id,subcircuit_id:n?.subcircuit_id??void 0});this.source_manually_placed_via_id=o.source_manually_placed_via_id,this.source_component_id=o.source_manually_placed_via_id}doInitialSourceTraceRender(){let e=this._parsedProps.connectsTo;if(!e)return;let{db:t}=this.root,n=this.getSubcircuit(),o=Array.isArray(e)?e:[e],r=[],i=[];for(let s of o){if(s.startsWith("net.")){let c=n.selectOne(s,{type:"net"});if(!c?.source_net_id){this.renderError(`Could not find net for via selector "${s}"`);return}i.push(c);continue}let a=n.selectOne(s,{type:"port"})??this.getParentNormalComponent()?.children.find((c)=>c instanceof sd&&c.isMatchingAnyOf([s]))??null;if(!a?.source_port_id){this.renderError(`Could not find port for via selector "${s}"`);return}r.push(a)}if(r.length>0){let s=t.source_trace.insert({connected_source_port_ids:r.map((a)=>a.source_port_id),connected_source_net_ids:i.map((a)=>a.source_net_id),subcircuit_id:n.subcircuit_id??void 0,display_name:this._parsedProps.name?`${this._parsedProps.name} connectivity`:"Manually placed via connectivity"});this.source_trace_id=s.source_trace_id}t.source_manually_placed_via.update(this.source_manually_placed_via_id,{source_net_id:i[0]?.source_net_id,source_trace_id:this.source_trace_id??void 0})}doInitialPcbPortAttachment(){if(this.root?.pcbDisabled)return;this.root.db.pcb_via.update(this.pcb_via_id,{pcb_port_ids:this.children.flatMap((e)=>e instanceof sd&&e.pcb_port_id?[e.pcb_port_id]:[])})}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,t=this.getInheritedMergedProperty("pcbStyle"),{holeDiameter:n,padDiameter:o}=this._getResolvedViaDiameters(t),r=this._getGlobalPcbPositionBeforeLayout(),i=this.getSubcircuit(),s=this._getConnectedNetOrTrace(),{isFlipped:a}=this._getPcbPrimitiveFlippedHelpers(),c=Tst(this._parsedProps.tented),l=this.source_trace_id??(s instanceof oT?void 0:s?.source_trace_id),h=!l&&s instanceof oT?s.source_net_id:void 0,d=e.pcb_via.insert({x:r.x,y:r.y,hole_diameter:n,outer_diameter:o,layers:this._getLayers(),from_layer:this._parsedProps.fromLayer||"bottom",to_layer:this._parsedProps.toLayer||"top",subcircuit_id:i?.subcircuit_id??void 0,subcircuit_connectivity_map_key:this.subcircuit_connectivity_map_key??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0,net_is_assignable:this._parsedProps.netIsAssignable??void 0,tented_on_top:a?c.tented_on_bottom:c.tented_on_top,tented_on_bottom:a?c.tented_on_top:c.tented_on_bottom,...l?{source_trace_id:l}:{},...h?{source_net_id:h}:{}});this.pcb_via_id=d.pcb_via_id}};function fFr(e){if(e.root?.schematicDisabled)return;let{db:t}=e.root,{_parsedProps:n,parent:o}=e;if(!o)throw Error("Trace has no parent");let{allPortsFound:r,portsWithSelectors:i}=e._findConnectedPorts();if(!r)return;let s=i.map(({port:x})=>({port:x,position:x._getGlobalSchematicPositionAfterLayout(),schematic_port_id:x.schematic_port_id,facingDirection:x.facingDirection}));if(s.length<2)throw Error("Expected at least two ports in portsWithPosition.");let a,c,l=s[0].position,h=s[0].port;if("path"in e.props){if(e.props.path.length!==2)throw Error("Invalid 'path': Must contain exactly two elements.");[a,c]=e.props.path}else{if(!(("from"in e.props)&&("to"in e.props)))throw Error("Missing 'from' or 'to' properties in props.");a=e.props.from,c=e.props.to}if(!h.source_port_id)throw Error(`Missing source_port_id for the 'from' port (${a}).`);let d=s[1].position,u=s[1].port;if(!u.source_port_id)throw Error(`Missing source_port_id for the 'to' port (${c}).`);let _=t.schematic_net_label.list().find((x)=>x.source_net_id===h.source_port_id),p=t.schematic_net_label.list().find((x)=>x.source_net_id===u.source_port_id),[m,A]=i.map(({port:x})=>x),f=m.parent?.config.shouldRenderAsSchematicBox?`${m?.parent?.props.name}_${m?.props.name}`:`${A?.parent?.props.name}_${A?.props.name}`,y=e._getSchematicNetLabelText()??f;if(_&&_.text!==y)_.text=`${y} / ${_.text}`;if(p&&p?.text!==y)p.text=`${y} / ${p.text}`;if(!p){let x=mZ(u.facingDirection)??"bottom";t.schematic_net_label.insert({text:y,source_net_id:u.source_port_id,anchor_position:d,center:wP({anchor_position:d,anchor_side:x,text:y}),anchor_side:x,schematic_sheet_id:e._resolveSchematicSheetId()})}if(!_){let x=mZ(h.facingDirection)??"bottom";t.schematic_net_label.insert({text:y,source_net_id:h.source_port_id,anchor_position:l,center:wP({anchor_position:l,anchor_side:x,text:y}),anchor_side:x,schematic_sheet_id:e._resolveSchematicSheetId()})}}function yFr(e){let{_parsedProps:t,parent:n}=e;if(!n)throw Error("Trace has no parent");let o=e.getTracePortPathSelectors(),r=(s)=>{if(s.lastIndexOf(".")>s.lastIndexOf(" "))return null;let c=e.getSubcircuit().selectOne(s);if(!c&&!/[.#\[]/.test(s))c=e.getSubcircuit().selectOne(`.${s}`);if(!c)return null;let l=c.children.filter((h)=>h.componentName==="Port");return l.length===1?l[0]:null},i=o.map((s)=>({selector:s,port:e.getSubcircuit().selectOne(s,{type:"port"})??r(s)}));for(let{selector:s,port:a}of i)if(!a){let c,l,h=s.lastIndexOf(".");if(h!==-1&&h>s.lastIndexOf(" "))c=s.slice(0,h),l=s.slice(h+1);else{let C=s.match(/^(.*[ >])?([^ >]+)$/);c=C?.[1]?.trim()??"",l=C?.[2]??s}let d=c?e.getSubcircuit().selectOne(c):null;if(!d&&c&&!/[.#\[]/.test(c))d=e.getSubcircuit().selectOne(`.${c}`);if(!d){let C=c?`Could not find port for selector "${s}". Component "${c}" not found`:`Could not find port for selector "${s}"`,b=e.getSubcircuit(),I=b.getGroup();throw new dG({error_type:"source_trace_not_connected_error",message:C,subcircuit_id:b.subcircuit_id??void 0,source_group_id:I?.source_group_id??void 0,source_trace_id:e.source_trace_id??void 0,selectors_not_found:[s]})}let u=d.children.filter((C)=>C.componentName==="Port"),_=l.includes(".")?l.split(".").pop()??"":l,p=u.flatMap((C)=>C.getNameAndAliases()),m=p.some((C)=>!/^(pin\d+|\d+)$/.test(C)),A=Array.from(new Set(p)).join(", "),g;if(u.length===0)g="It has no ports";else if(!m)g=`It has ${u.length} pins and no pinLabels (consider adding pinLabels)`;else g=`It has [${A}]`;let f=`Could not find port for selector "${s}". Component "${d.props.name??c}" found, but does not have pin "${_}". ${g}`,y=e.getSubcircuit(),x=y.getGroup();throw new dG({error_type:"source_trace_not_connected_error",message:f,subcircuit_id:y.subcircuit_id??void 0,source_group_id:x?.source_group_id??void 0,source_trace_id:e.source_trace_id??void 0,selectors_not_found:[s]})}if(i.some((s)=>!s.port))return{allPortsFound:!1};return{allPortsFound:!0,portsWithSelectors:i,ports:i.map(({port:s})=>s)}}function Dve(e){let t=e.flatMap(E4n),n=e.filter(({route_type:o})=>o==="via").length*1.6;for(let o=1;o<t.length;o++){let r=t[o-1],i=t[o];n+=Math.hypot(i.x-r.x,i.y-r.y)}return n}var G4n=({trace:e,pcbTrace:t,ports:n,pathIndex:o})=>{let{db:r}=e.root,i=r.pcb_via.list({pcb_trace_id:t.pcb_trace_id}),s=r.source_trace.get(e.source_trace_id)?.display_name,a="unnamed trace";if(s&&e._parsedProps.name)a=`${e.getDisplayName()}, ${s}`;else if(s)a=s;else if(e._parsedProps.name)a=e.getDisplayName();let c="pcbPath";if(o!==void 0)c=`pcbPaths[${o}]`;let l,h=0;for(let d of t.route){if(d.route_type==="wire"){l=d.layer;continue}if(d.route_type!=="via")continue;h+=1;let u=i[h-1];if(l&&!u.layers.includes(l)){let _=Number(d.x.toFixed(4)),p=Number(d.y.toFixed(4));r.pcb_trace_error.insert({error_type:"pcb_trace_error",source_trace_id:e.source_trace_id,message:`Invalid ${c} (${a}): via ${h} (${d.from_layer} → ${d.to_layer}) at board (${_}, ${p}) mm does not reach incoming ${l} copper.`,center:{x:d.x,y:d.y},pcb_trace_id:t.pcb_trace_id,pcb_component_ids:[],pcb_port_ids:n.map((m)=>m.pcb_port_id).filter(Boolean),subcircuit_id:t.subcircuit_id,is_fatal:!1})}l=d.to_layer}};function RAn(e){let{lineStart:t,lineEnd:n,rectCenter:o,rectWidth:r,rectHeight:i}=e,s=o.x-r/2,a=o.x+r/2,c=o.y+i/2,l=o.y-i/2,h=n.x-t.x,d=n.y-t.y,u=[];if(h!==0){let _=(s-t.x)/h;if(_>=0&&_<=1){let p=t.y+_*d;if(p>=l&&p<=c)u.push({x:s,y:p,t:_})}}if(h!==0){let _=(a-t.x)/h;if(_>=0&&_<=1){let p=t.y+_*d;if(p>=l&&p<=c)u.push({x:a,y:p,t:_})}}if(d!==0){let _=(l-t.y)/d;if(_>=0&&_<=1){let p=t.x+_*h;if(p>=s&&p<=a)u.push({x:p,y:l,t:_})}}if(d!==0){let _=(c-t.y)/d;if(_>=0&&_<=1){let p=t.x+_*h;if(p>=s&&p<=a)u.push({x:p,y:c,t:_})}}if(u.length===0)return null;return u.sort((_,p)=>_.t-p.t),{x:u[0].x,y:u[0].y}}function QAn(e){let{lineStart:t,lineEnd:n,circleCenter:o,circleRadius:r}=e,i=t.x-o.x,s=t.y-o.y,a=n.x-o.x,c=n.y-o.y,l=a-i,h=c-s,d=l*l+h*h,u=2*(i*l+s*h),_=i*i+s*s-r*r,p=u*u-4*d*_;if(p<0)return null;let m=Math.sqrt(p),A=(-u-m)/(2*d),g=(-u+m)/(2*d),f=null;if(A>=0&&A<=1)f=A;else if(g>=0&&g<=1)f=g;if(f===null)return null;return{x:t.x+f*l,y:t.y+f*h}}function kAn(e){let{traceStart:t,traceEnd:n,traceWidth:o,port:r}=e,i=r.matchedComponents.find((u)=>u.isPcbPrimitive);if(!i)return n;let s=i._getPcbCircuitJsonBounds(),{width:a,height:c,center:l}=s,h=Math.min(a,c);if(o<=h/2)return n;let d=null;if(i.componentName==="SmtPad"){let u=i,_=u._parsedProps.shape;if(_==="circle"){let p=u._parsedProps.radius;d=QAn({lineStart:t,lineEnd:n,circleCenter:l,circleRadius:p})}else if(_==="rect"||_==="rotated_rect"||_==="pill"||_==="polygon")d=RAn({lineStart:t,lineEnd:n,rectCenter:l,rectWidth:a,rectHeight:c})}else if(i.componentName==="PlatedHole"){let u=i;if(u._parsedProps.shape==="circle"){let p=u._parsedProps.outerDiameter;d=QAn({lineStart:t,lineEnd:n,circleCenter:l,circleRadius:p/2})}else d=RAn({lineStart:t,lineEnd:n,rectCenter:l,rectWidth:a,rectHeight:c})}return d??n}function LAn(e){let n=(e._parsedProps?.portHints??[]).filter(Boolean);if(n.length>0)return`<${e.lowercaseComponentName}(${n.map((o)=>`.${o}`).join(", ")}) />`;return`<${e.lowercaseComponentName} />`}function Nve(e,t){let n=t.matchedComponents.filter((a)=>a.isPcbPrimitive),o=t.getParentNormalComponent()?.props.name??t.parent?.props.name??"unknown",r=t.getParentNormalComponent(),i=e.trim().split(/\s+|>/).filter(Boolean).at(-1)?.replace(/^port\./,"").replace(/^\./,"");if(i&&!/^(pin)?\d+$/.test(i)){let a=(r?.children??[]).filter((c)=>c.componentName==="Port"&&c.isMatchingAnyOf([i]));if(a.length>1){if(!(r?._getInternallyConnectedPins?.()??[]).some((h)=>a.every((d)=>h.includes(d)))){let h=Array.from(new Set(a.flatMap((_)=>_.getNameAndAliases().filter((p)=>/^pin\d+$/.test(p)).map((p)=>`${o}.${p}`)))),d=h.length>0?` Use a raw pin selector like ${h.map((_)=>`"${_}"`).join(" or ")}.`:"",u=a.flatMap((_)=>_.matchedComponents.filter((p)=>p.isPcbPrimitive));return`Trace selector "${e}" resolved to "${o}.${t.props.name}", but alias "${i}" matches multiple PCB pads: ${u.map((_)=>LAn(_)).join(", ")}.${d}`}}}if(t.pcb_port_id)return null;let s=Array.from(new Set(t.getNameAndAliases().filter((a)=>/^pin\d+$/.test(a)).map((a)=>`${o}.${a}`)));if(n.length>1&&!Bve(n)){let a=s.length>0?` Use a raw pin selector like ${s.map((c)=>`"${c}"`).join(" or ")}.`:"";return`Trace selector "${e}" resolved to "${o}.${t.props.name}", but that target maps to multiple non-overlapping PCB pads: ${n.map((c)=>LAn(c)).join(", ")}.${a}`}return null}var g6={min_trace_width:0.1,min_via_hole_edge_to_via_hole_edge_clearance:0.1,min_plated_hole_drill_edge_to_drill_edge_clearance:0.15,min_trace_to_hole_edge_clearance:0.2,min_trace_to_pad_edge_clearance:0.1,min_pad_edge_to_pad_edge_clearance:0.1,min_board_edge_clearance:0.2,min_via_hole_diameter:0.2,min_via_pad_diameter:0.3},xFr=({trace:e,path:t,anchorPort:n,width:o})=>{let{db:r}=e.root,i=e.getSubcircuit(),s=i._isInflatedFromCircuitJson?e._computePcbGlobalTransformBeforeLayout():n._computePcbGlobalTransformBeforeLayout?.()??fh(),a=n.getAvailablePcbLayers()[0]??"top",c=[];for(let[l,h]of t.entries()){if(typeof h==="string"){let u=i.selectOne(h,{type:"port"});if(!u){r.pcb_trace_error.insert({error_type:"pcb_trace_error",source_trace_id:e.source_trace_id,message:`Could not resolve pcbPaths selector "${h}" for ${e}`,pcb_trace_id:e.pcb_trace_id,pcb_component_ids:[],pcb_port_ids:[]});return}let _=Nve(h,u);if(_){r.pcb_trace_error.insert({error_type:"pcb_trace_error",source_trace_id:e.source_trace_id,message:_,pcb_trace_id:e.pcb_trace_id,pcb_component_ids:[],pcb_port_ids:[]});return}if(l===0)a=u.getAvailablePcbLayers()[0]??a;let p=u._getGlobalPcbPositionAfterLayout();c.push({route_type:"wire",x:p.x,y:p.y,width:o,layer:a,...l===0?{start_pcb_port_id:u.pcb_port_id}:{},...l===t.length-1?{end_pcb_port_id:u.pcb_port_id}:{}});continue}let d=_o(s,{x:h.x,y:h.y});if(h.via){let u=h.fromLayer??a,_=h.toLayer??a;c.push({route_type:"via",x:d.x,y:d.y,from_layer:u,to_layer:_}),a=_}else c.push({route_type:"wire",x:d.x,y:d.y,width:o,layer:a})}return c},U4n=({trace:e,pcbTrace:t,path:n,ports:o,pathIndex:r})=>{if(e._getBoard()?.getInheritedProperty("allowBlindAndBuriedVias"))return;let{db:s}=e.root,a=s.source_trace.get(e.source_trace_id)?.display_name,c=[e._parsedProps.name?e.getDisplayName():void 0,a].filter(Boolean).join(", ")||"unnamed trace",l=r===void 0?"pcbPath":`pcbPaths[${r}]`,h=[];for(let[A,g]of n.entries())if(typeof g!=="string"&&g.via)h.push(A);let d=s.pcb_via.list({pcb_trace_id:t.pcb_trace_id}),u=[],_=new Set,p;for(let[A,g]of d.entries()){let f=g.layers.includes("top"),y=g.layers.includes("bottom");if(f&&y)continue;let x=f||y?"blind":"buried";_.add(x);let C=h[A],b=`${l}[${C}]`,I=Number(g.x.toFixed(4)),v=Number(g.y.toFixed(4));p??=g,u.push(`${b}: ${x} via (fromLayer: "${g.from_layer}", toLayer: "${g.to_layer}") spanning [${g.layers.join(", ")}] at board (${I}, ${v}) mm`)}if(!p)return;let m=[..._].sort().join(" and ");s.pcb_trace_error.insert({error_type:"pcb_trace_error",source_trace_id:e.source_trace_id,pcb_trace_id:t.pcb_trace_id,pcb_component_ids:[],pcb_port_ids:o.map((A)=>A.pcb_port_id).filter(Boolean),subcircuit_id:t.subcircuit_id,center:{x:p.x,y:p.y},is_fatal:!1,message:`${m} vias aren't allowed by allowBlindAndBuriedVias settings in ${l} (${c}): ${u.length} disallowed via${u.length===1?"":"s"}. Use top-to-bottom through vias (fromLayer: "top", toLayer: "bottom", or the reverse) and adjust the adjoining wire layers to match, or set allowBlindAndBuriedVias={true} on <board> if fabrication supports blind/buried vias. Saved copper has been preserved. Affected indices (zero-based): ${u.join("; ")}.`})},CFr=({trace:e,paths:t,ports:n,portsWithSelectors:o,width:r})=>{let{db:i}=e.root,{pcbPathRelativeTo:s}=e._parsedProps,a=e.getSubcircuit(),c=s?o.find(({selector:_})=>_===s)?.port:void 0;if(!c&&s)c=a.selectOne(s,{type:"port"});if(c??=n[0],!c){i.source_trace_not_connected_error.insert({error_type:"source_trace_not_connected_error",source_trace_id:e.source_trace_id??void 0,subcircuit_id:a.subcircuit_id??void 0,message:"pcbPaths requires a connected port or pcbPathRelativeTo port"});return}let l=e.getInheritedMergedProperty("pcbStyle"),{holeDiameter:h,padDiameter:d}=cT(l),u=e.subcircuit_connectivity_map_key??i.source_trace.get(e.source_trace_id)?.subcircuit_connectivity_map_key;for(let[_,p]of t.entries()){let m=xFr({trace:e,path:p,anchorPort:c,width:r});if(!m||m.length<2)continue;let A=i.pcb_trace.insert({route:m,is_antenna_trace:e.isAntennaTrace,source_trace_id:e.source_trace_id,subcircuit_id:a.subcircuit_id??void 0,pcb_group_id:e.getGroup()?.pcb_group_id??void 0,trace_length:Dve(m)});e.pcb_trace_id??=A.pcb_trace_id;for(let g of m){if(g.route_type!=="via")continue;let{from_layer:f,to_layer:y}=g;i.pcb_via.insert({pcb_trace_id:A.pcb_trace_id,x:g.x,y:g.y,hole_diameter:h,outer_diameter:d,layers:kP({fromLayer:f,toLayer:y,layerCount:a._getSubcircuitLayerCount()}),from_layer:f,to_layer:y,subcircuit_id:a.subcircuit_id??void 0,pcb_group_id:e.getGroup()?.pcb_group_id??void 0,subcircuit_connectivity_map_key:u})}G4n({trace:e,pcbTrace:A,ports:n,pathIndex:_}),e._insertErrorIfTraceIsOutsideBoard(m,n),U4n({trace:e,pcbTrace:A,path:p,ports:n,pathIndex:_})}e._portsRoutedOnPcb=n},bFr=(e,t)=>{if(t.route_type!=="via")return;return e?.find((n)=>Math.abs(n.x-t.x)<0.0001&&Math.abs(n.y-t.y)<0.0001&&(!n.from_layer||n.from_layer===t.from_layer)&&(!n.to_layer||n.to_layer===t.to_layer))},IFr=(e)=>{let t=e;return{holeDiameter:t.hole_diameter??t.via_hole_diameter,outerDiameter:t.outer_diameter??t.via_diameter}};function vFr(e){if(e.root?.pcbDisabled)return;let{db:t}=e.root,{_parsedProps:n}=e,o=e.getSubcircuit(),r=n.pcbPath!==void 0,i=n.pcbPaths!==void 0,s=Boolean(n.pcbStraightLine),a=e._inflatedPcbTraces??[];if(!r&&!i&&!s&&a.length===0)return;let c,l,h;try{let N=e._findConnectedPorts();c=N.allPortsFound,l=N.ports??[],h=N.portsWithSelectors??[]}catch(N){if(N instanceof dG){t.source_trace_not_connected_error.insert({...N.errorData,error_type:"source_trace_not_connected_error"}),e._couldNotFindPort=!0;return}throw N}if(!c)return;let d=h.map(({selector:N,port:D})=>Nve(N,D)).find(Boolean);if(d){t.pcb_trace_error.insert({error_type:"pcb_trace_error",source_trace_id:e.source_trace_id,message:d,pcb_trace_id:e.pcb_trace_id,pcb_component_ids:[],pcb_port_ids:l.map((N)=>N.pcb_port_id).filter(Boolean)});return}let u=[];for(let N of l)if(!N._hasMatchedPcbPrimitive())u.push(N);if(u.length>0){t.pcb_trace_error.insert({error_type:"pcb_trace_error",source_trace_id:e.source_trace_id,message:`Some ports did not have a matching PCB primitive (e.g. a pad or plated hole), this can happen if a footprint is missing. As a result, ${e} wasn't routed. Missing ports: ${u.map((N)=>N.getString()).join(", ")}`,pcb_trace_id:e.pcb_trace_id,pcb_component_ids:[],pcb_port_ids:u.map((N)=>N.pcb_port_id).filter(Boolean)});return}let _=e._getExplicitTraceThickness()??e.getSubcircuit()._parsedProps.minTraceWidth??g6.min_trace_width;if(a.length>0){let{isFlipped:N,maybeFlipLayer:D}=e._getPcbPrimitiveFlippedHelpers(),L=e._computePcbGlobalTransformBeforeLayout(),H=[],V=e.subcircuit_connectivity_map_key??t.source_trace.get(e.source_trace_id)?.subcircuit_connectivity_map_key;for(let O of a){let U=O.route.map((J)=>{if(J.route_type==="wire"){let{x:ee,y:se,...ne}=J,re=_o(L,{x:ee,y:se});return{...ne,...re,layer:D(J.layer)}}if(J.route_type==="via"){let{x:ee,y:se,...ne}=J,re=_o(L,{x:ee,y:se});return{...ne,...re,from_layer:D(J.from_layer),to_layer:D(J.to_layer),tented_on_top:N?J.tented_on_bottom:J.tented_on_top,tented_on_bottom:N?J.tented_on_top:J.tented_on_bottom}}return{...J,start:_o(L,J.start),end:_o(L,J.end),start_layer:D(J.start_layer),end_layer:D(J.end_layer)}}),j=t.pcb_trace.insert({...O,route:U,source_trace_id:e.source_trace_id,subcircuit_id:o?.subcircuit_id??void 0,pcb_group_id:e.getGroup()?.pcb_group_id??void 0}),Y=e.getInheritedMergedProperty("pcbStyle"),{holeDiameter:X,padDiameter:K}=cT(Y);for(let J=0;J<U.length;J++){let ee=U[J];if(ee.route_type==="via"){let se=O.route[J],ne=bFr(e._inflatedPcbVias,se),re=ne?vR.parse(ne):void 0,Z=IFr(ee),te=D(re?.from_layer??ee.from_layer),ie=D(re?.to_layer??ee.to_layer),le=(re?.layers??kP({fromLayer:ee.from_layer,toLayer:ee.to_layer,layerCount:o._getSubcircuitLayerCount()})).map((ue)=>D(ue));t.pcb_via.insert({pcb_trace_id:j.pcb_trace_id,x:ee.x,y:ee.y,hole_diameter:re?.hole_diameter??Z.holeDiameter??X,outer_diameter:re?.outer_diameter??Z.outerDiameter??K,layers:le,from_layer:te,to_layer:ie,subcircuit_id:o?.subcircuit_id??void 0,pcb_group_id:e.getGroup()?.pcb_group_id??void 0,subcircuit_connectivity_map_key:re?.subcircuit_connectivity_map_key??V,net_is_assignable:re?.net_is_assignable,net_assigned:re?.net_assigned,tented_on_top:(N?re?.tented_on_bottom:re?.tented_on_top)??ee.tented_on_top,tented_on_bottom:(N?re?.tented_on_top:re?.tented_on_bottom)??ee.tented_on_bottom})}}if(!e.pcb_trace_id)e.pcb_trace_id=j.pcb_trace_id;H.push(j.route)}for(let O of H)e._insertErrorIfTraceIsOutsideBoard(O,l);e._portsRoutedOnPcb=l;return}if(n.pcbPaths){CFr({trace:e,paths:n.pcbPaths,ports:l,portsWithSelectors:h,width:_});return}if(s&&!r){if(!l||l.length<2){e.renderError("pcbStraightLine requires exactly two connected ports");return}let[N,D]=l,L=N.getAvailablePcbLayers(),H=D.getAvailablePcbLayers(),O=L.find((se)=>H.includes(se))??L[0]??H[0]??"top",U=N._getGlobalPcbPositionAfterLayout(),j=D._getGlobalPcbPositionAfterLayout(),Y=kAn({traceStart:j,traceEnd:U,traceWidth:_,port:N}),X=kAn({traceStart:U,traceEnd:j,traceWidth:_,port:D}),K=[{route_type:"wire",x:Y.x,y:Y.y,width:_,layer:O,start_pcb_port_id:N.pcb_port_id},{route_type:"wire",x:X.x,y:X.y,width:_,layer:O,end_pcb_port_id:D.pcb_port_id}],J=Dve(K),ee=t.pcb_trace.insert({route:K,source_trace_id:e.source_trace_id,subcircuit_id:o?.subcircuit_id??void 0,pcb_group_id:e.getGroup()?.pcb_group_id??void 0,trace_length:J});e._portsRoutedOnPcb=l,e.pcb_trace_id=ee.pcb_trace_id,e._insertErrorIfTraceIsOutsideBoard(K,l);return}if(!n.pcbPath)return;let p;if(n.pcbPathRelativeTo){if(p=h.find((N)=>N.selector===n.pcbPathRelativeTo)?.port,!p)p=e.getSubcircuit().selectOne(n.pcbPathRelativeTo)}if(!p)p=l[0];if(!p){t.source_trace_not_connected_error.insert({error_type:"source_trace_not_connected_error",source_trace_id:e.source_trace_id??void 0,subcircuit_id:o.subcircuit_id??void 0,message:"pcbPath requires a connected port or pcbPathRelativeTo port"});return}let m=l.find((N)=>N!==p)??l[1],g=p.getAvailablePcbLayers()[0]||"top",f=p._getGlobalPcbPositionAfterLayout(),y=m?._getGlobalPcbPositionAfterLayout(),x=[];x.push({route_type:"wire",x:f.x,y:f.y,width:_,layer:g,start_pcb_port_id:p.pcb_port_id});let C=o._isInflatedFromCircuitJson?e._computePcbGlobalTransformBeforeLayout():p?._computePcbGlobalTransformBeforeLayout?.()||fh(),b=n.pcbPath;for(let N of b){let D,L=!1,H=typeof N!=="string"&&N.via,V,O;if(typeof N==="string"){let j=e.getSubcircuit().selectOne(N,{type:"port"});if(!j){t.pcb_trace_error.insert({error_type:"pcb_trace_error",source_trace_id:e.source_trace_id,message:`Could not resolve pcbPath selector "${N}" for ${e}`,pcb_trace_id:e.pcb_trace_id,pcb_component_ids:[],pcb_port_ids:[]});continue}let Y=Nve(N,j);if(Y){t.pcb_trace_error.insert({error_type:"pcb_trace_error",source_trace_id:e.source_trace_id,message:Y,pcb_trace_id:e.pcb_trace_id,pcb_component_ids:[],pcb_port_ids:[]});return}let X=j._getGlobalPcbPositionAfterLayout();D={x:X.x,y:X.y},L=!0}else if(D={x:N.x,y:N.y},L=!1,N.via)V=N.fromLayer??g,O=N.toLayer;let U=L?D:_o(C,D);if(H)x.push({route_type:"via",x:U.x,y:U.y,from_layer:V??g,to_layer:O??g}),g=O??g;else x.push({route_type:"wire",x:U.x,y:U.y,width:_,layer:g})}if(m&&y)x.push({route_type:"wire",x:y.x,y:y.y,width:_,layer:g,end_pcb_port_id:m.pcb_port_id});let I=Dve(x),v=t.pcb_trace.insert({route:x,is_antenna_trace:e.isAntennaTrace,source_trace_id:e.source_trace_id,subcircuit_id:o?.subcircuit_id??void 0,pcb_group_id:e.getGroup()?.pcb_group_id??void 0,trace_length:I}),P=e.subcircuit_connectivity_map_key??t.source_trace.get(e.source_trace_id)?.subcircuit_connectivity_map_key,M=e.getInheritedMergedProperty("pcbStyle"),{holeDiameter:B,padDiameter:T}=cT(M);for(let N of x)if(N.route_type==="via"){let{from_layer:D,to_layer:L}=N;t.pcb_via.insert({pcb_trace_id:v.pcb_trace_id,x:N.x,y:N.y,hole_diameter:B,outer_diameter:T,layers:kP({fromLayer:D,toLayer:L,layerCount:o._getSubcircuitLayerCount()}),from_layer:D,to_layer:L,subcircuit_id:o?.subcircuit_id??void 0,pcb_group_id:e.getGroup()?.pcb_group_id??void 0,subcircuit_connectivity_map_key:P})}U4n({trace:e,pcbTrace:v,path:n.pcbPath,ports:l}),e._portsRoutedOnPcb=l,e.pcb_trace_id=v.pcb_trace_id,G4n({trace:e,pcbTrace:v,ports:l}),e._insertErrorIfTraceIsOutsideBoard(x,l)}function SFr(e,t){let n=[],o=(r)=>{let i=0;for(let s of t)if(s.layer===r.layer&&Math.hypot(s.x-r.x,s.y-r.y)<0.000001)i=Math.max(i,s.diameter);return i};for(let r=0;r<e.length;r++){let i=e[r],s=e[r+1];if(i.route_type!=="wire"||s?.route_type!=="wire"||i.layer!==s.layer||i.width_interpolation_mode){n.push(i);continue}let a=Math.hypot(s.x-i.x,s.y-i.y),c=o(i),l=o(s),h=(p)=>{let m=p*0.8,A=Math.min(p*1.5,a*0.45);return m>i.width&&A>p/2?{width:m,length:A}:void 0},d=h(c),u=h(l);if(!d&&!u){n.push(i);continue}let _=(p)=>({route_type:"wire",x:i.x+(s.x-i.x)*p/a,y:i.y+(s.y-i.y)*p/a,width:i.width,layer:i.layer});if(d)n.push({...i,width:d.width,start_width:d.width,end_width:i.width,width_interpolation_mode:"quadratic"}),n.push(_(d.length));else n.push(i);if(u)n.push({..._(a-u.length),start_width:i.width,end_width:u.width,width_interpolation_mode:"quadratic"})}return n}function W4n(e){return e.map((t,n)=>{if(t.route_type!=="wire"||!t.width_interpolation_mode)return{...t};let o=e[n+1];if(o?.route_type!=="wire"||o.layer!==t.layer||o.x===t.x&&o.y===t.y)throw Error("Width interpolation requires a distinct next wire point on the same layer");return{...t,start_width:t.width,end_width:o.width}})}function nue(e,t,n){let o,r;for(let i=t-1;i>=0;i--){let s=e[i];if(s.route_type==="wire"){o=s.width;break}}for(let i=t+1;i<e.length;i++){let s=e[i];if(s.route_type==="wire"){r=s.width;break}}return{fromWidth:o??r??n,toWidth:r??o??n}}var HAn=new WeakMap;function FAn(e){let{is_inside_copper_pour:t,copper_pour_id:n,...o}=e;return JSON.stringify(o)}function PFr(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;return e.every((n,o)=>FAn(n)===FAn(t[o]))}function EFr(e){let t=HAn.get(e);if(t)return t;let n=new Map;return HAn.set(e,n),n}function Mrt({pcbTrace:e,pcbTraceTeardropRenderState:t}){if(PFr(e.route,t.generatedRoute))return!1;return t.originalRoute=e.route,t.generatedRoute=e.route,!0}function MFr({route:e,contacts:t}){return e.flatMap((n,o)=>{if(n.route_type!=="via"||!t.some((l)=>Math.hypot(l.x-n.x,l.y-n.y)<0.000001))return[n];let{fromWidth:r,toWidth:i}=nue(e,o,0);if(!r||!i)return[n];let s=e[o-1],a=e[o+1],c=[];if(!(s?.route_type==="wire"&&s.x===n.x&&s.y===n.y&&s.layer===n.from_layer))c.push({route_type:"wire",x:n.x,y:n.y,width:r,layer:n.from_layer});if(c.push(n),!(a?.route_type==="wire"&&a.x===n.x&&a.y===n.y&&a.layer===n.to_layer))c.push({route_type:"wire",x:n.x,y:n.y,width:i,layer:n.to_layer});return c})}function wFr({root:e,pcbTraceId:t,pcbTraceTeardropRenderStateByPcbTraceId:n}){let o=n.get(t);if(!o)return;let r=e.db.pcb_trace.get(t);if(!r){n.delete(t);return}Mrt({pcbTrace:r,pcbTraceTeardropRenderState:o});let i=[...o.contactsBySourceTraceId.values()].flat(),s=MFr({route:o.originalRoute,contacts:i}),a=SFr(s,i);if(e.db.pcb_trace.update(t,{route:a}),i.length===0){n.delete(t);return}o.generatedRoute=a}function BFr({root:e,sourceTraceId:t,contactsByPcbTraceId:n}){let o=EFr(e),r=new Set;for(let[i,s]of o){let a=e.db.pcb_trace.get(i);if(!a){o.delete(i);continue}if(Mrt({pcbTrace:a,pcbTraceTeardropRenderState:s}))r.add(i);if(s.contactsBySourceTraceId.delete(t))r.add(i)}for(let[i,s]of n){let a=e.db.pcb_trace.get(i);if(!a||s.length===0)continue;let c=o.get(i);if(!c)c={originalRoute:a.route,generatedRoute:a.route,contactsBySourceTraceId:new Map},o.set(i,c);else Mrt({pcbTrace:a,pcbTraceTeardropRenderState:c});c.contactsBySourceTraceId.set(t,s),r.add(i)}for(let i of r)wFr({root:e,pcbTraceId:i,pcbTraceTeardropRenderStateByPcbTraceId:o})}function TFr(e){if(e.shape==="polygon")return 0;if(e.shape==="circle")return e.radius*2;return Math.min(e.width,e.height)}function DFr({root:e,sourceTraceId:t}){let o=e.db.source_trace.get(t)?.subcircuit_connectivity_map_key;if(!o)return e.db.pcb_trace.list({source_trace_id:t});return e.db.pcb_trace.list().filter((r)=>{if(r.source_trace_id===t)return!0;if(!r.source_trace_id)return!1;return e.db.source_trace.get(r.source_trace_id)?.subcircuit_connectivity_map_key===o})}function NFr({root:e,pcbTrace:t,enabledPorts:n,padContacts:o,enableUnmatchedVias:r}){let i=[...o];for(let s of e.db.pcb_via.list({pcb_trace_id:t.pcb_trace_id})){let a=n.find(({port:c})=>{let l=c._getGlobalPcbPositionAfterLayout();return Math.hypot(l.x-s.x,l.y-s.y)<0.000001});if(!(a?a.enabled:r))continue;for(let c of s.layers)i.push({x:s.x,y:s.y,layer:c,diameter:s.outer_diameter})}return i}function RFr({selector:e,selectors:t,props:n}){if(e===t[0])return n.pcbTeardropStart??n.pcbTeardrops??!1;if(e===t.at(-1))return n.pcbTeardropEnd??n.pcbTeardrops??!1;return n.pcbTeardrops??!1}function QFr({root:e,enabledPorts:t}){let n=[];for(let{port:o,enabled:r}of t){if(!r||!o.pcb_port_id)continue;for(let i of e.db.pcb_smtpad.list({pcb_port_id:o.pcb_port_id})){if(i.shape==="polygon")continue;n.push({x:i.x,y:i.y,layer:i.layer,diameter:TFr(i)})}for(let i of e.db.pcb_plated_hole.list({pcb_port_id:o.pcb_port_id})){if(i.shape!=="circle")continue;for(let s of i.layers)n.push({x:i.x,y:i.y,layer:s,diameter:i.outer_diameter})}}return n}function zAn(e){if(!e.root||e.root.pcbDisabled||!e.source_trace_id)return;let{root:t,source_trace_id:n,_parsedProps:o}=e,r=new Map,s=Boolean(o.pcbTeardrops||o.pcbTeardropStart||o.pcbTeardropEnd)?e._findConnectedPorts():void 0;if(s?.allPortsFound){let a=e._getTracePortOrNetSelectorListFromProps(),c=s.portsWithSelectors.map(({port:h,selector:d})=>({port:h,enabled:RFr({selector:d,selectors:a,props:o})})),l=QFr({root:t,enabledPorts:c});for(let h of DFr({root:t,sourceTraceId:n}))r.set(h.pcb_trace_id,NFr({root:t,pcbTrace:h,enabledPorts:c,padContacts:l,enableUnmatchedVias:o.pcbTeardrops??!1}))}BFr({root:t,sourceTraceId:n,contactsByPcbTraceId:r})}var wrt=(e)=>e.map((t)=>{let{circuitJsonMetadata:n,...o}=t;if(o.route_type!=="via")return o;let{layers:r,...i}=o;return i}),Brt=({component:e,subcircuit:t})=>{e._pcbTraceRenderWaitingForPlacementChecks=!1;let n=e,o=0,r=null,i=!1;while(n){if("_pcbPlacementDrcErrorCount"in n){if("_pcbPlacementDrcChecksPending"in n&&n._pcbPlacementDrcChecksPending===!0){i=!0;break}if(typeof n._pcbPlacementDrcErrorCount==="number"){o=n._pcbPlacementDrcErrorCount;break}if("_pcbPlacementDrcCheckError"in n&&typeof n._pcbPlacementDrcCheckError==="string"){r=n._pcbPlacementDrcCheckError;break}}n=n.parent}if(i)return e._pcbTraceRenderWaitingForPlacementChecks=!0,!0;if(o===0&&!r)return!1;let{db:s}=e.root,a=`pcb_autorouting_skipped_placement_errors_${t.subcircuit_id}`;if(!s.pcb_autorouting_error.list().some((l)=>l.pcb_error_id===a))s.pcb_autorouting_error.insert({pcb_error_id:a,error_type:"pcb_autorouting_error",subcircuit_id:t.subcircuit_id??void 0,message:r?`Autorouting was skipped because PCB placement checks could not be completed: ${r}`:`Autorouting was skipped because ${o} PCB placement error${o===1?" was":"s were"} found. Fix the placement errors or set placementDrcChecksDisabled to true to route anyway.`});return!0},kFr=0.000001,LFr=(e)=>{let t=0;for(let n=0;n<e.length;n++){let o=e[n];for(let r=n+1;r<e.length;r++){let i=e[r];t=Math.max(t,Math.hypot(i.x-o.x,i.y-o.y))}}return t},HFr=(e,t)=>{let n=Number.POSITIVE_INFINITY;for(let o of e)for(let r of t)n=Math.min(n,Math.hypot(r.x-o.x,r.y-o.y));return n},FFr=({component:e,subcircuit:t})=>{let{db:n}=e.root,o=n.source_trace.list().filter((a)=>a.subcircuit_id===t.subcircuit_id),r=new l5({});r.addConnections(o.map((a)=>[a.source_trace_id,...a.connected_source_port_ids,...a.connected_source_net_ids]));let i=new Map;for(let a of n.pcb_port.list()){if(typeof a.source_port_id!=="string"||typeof a.x!=="number"||typeof a.y!=="number")continue;i.set(a.source_port_id,{pcb_port_id:a.pcb_port_id,source_port_id:a.source_port_id,x:a.x,y:a.y})}let s=[];for(let a of o){if(typeof a.max_length!=="number")continue;let c=a.connected_source_port_ids.map((h)=>i.get(h)).filter((h)=>Boolean(h)),l;if(c.length>=2)l=LFr(c);else{if(c.length!==1||a.connected_source_net_ids.length===0)continue;let h=r.getNetConnectedToId(a.source_trace_id);if(!h)continue;let u=r.getIdsConnectedToNet(h).filter((p)=>!a.connected_source_port_ids.includes(p)&&i.has(p)).map((p)=>i.get(p)).filter((p)=>Boolean(p));if(u.length===0)continue;if(n.toArray().some((p)=>(p.type==="source_pcb_ground_plane"||p.type==="pcb_ground_plane"||p.type==="pcb_copper_pour")&&typeof p.source_net_id==="string"&&r.areIdsConnected(a.source_trace_id,p.source_net_id)))continue;l=HFr(c,u)}if(l<=a.max_length+kFr)continue;s.push({sourceTraceId:a.source_trace_id,traceDisplayName:a.display_name,straightLineDistance:l,maximumTraceLength:a.max_length})}return s},Trt=({component:e,subcircuit:t})=>{let n=FFr({component:e,subcircuit:t});if(n.length===0)return!1;let{db:o}=e.root,r=`pcb_autorouting_skipped_trace_length_violations_${t.subcircuit_id}`;if(!o.pcb_autorouting_error.list().some((s)=>s.pcb_error_id===r)){let s=n[0],a=s.traceDisplayName??s.sourceTraceId,c=n.length-1,l=c>0?` (${c} additional violation${c===1?"":"s"})`:"";o.pcb_autorouting_error.insert({pcb_error_id:r,error_type:"pcb_autorouting_error",subcircuit_id:t.subcircuit_id??void 0,message:`Autorouting was skipped because the ${s.maximumTraceLength}mm maximum length for ${a} cannot be satisfied: its endpoints are ${s.straightLineDistance.toFixed(2)}mm apart${l}.`})}return!0},XIe=(e)=>({...e._getGlobalPcbPositionAfterLayout(),layers:e.getAvailablePcbLayers()}),zFr=!1,OAn=(e,t)=>{let n=Xk(e);return Math.hypot(n.x-t.x,n.y-t.y)},OFr=(e,t)=>{if(e.length<2)return e;let n=e[0],o=e[e.length-1];return OAn(o,t)<OAn(n,t)?Mve(e):e};function VFr(e){if(e.root?.pcbDisabled)return;let{db:t}=e.root,{_parsedProps:n,parent:o}=e,r=e.getSubcircuit(),i=e._getBoard(),s=i?.pcb_board_id?t.pcb_board.get(i.pcb_board_id):void 0;if(!o)throw Error("Trace has no parent");if(e.root?.pcbRoutingDisabled||r.getInheritedProperty("routingDisabled"))return;if(r._isInflatedFromCircuitJson)return;let a=r._parsedProps.pcbRouteCache?.pcbTraces;if(a){if(r._isLegacyAutorouterDisabled())return;let U=t.pcb_trace.insert({route:a.flatMap((j)=>j.route),source_trace_id:e.source_trace_id,subcircuit_id:r?.subcircuit_id??void 0,pcb_group_id:e.getGroup()?.pcb_group_id??void 0});e.pcb_trace_id=U.pcb_trace_id;return}if(n.pcbPath&&n.pcbPath.length>0)return;if(n.pcbPaths!==void 0)return;if(n.pcbStraightLine)return;if(!r._shouldUseTraceByTraceRouting())return;let c,l,h;try{let U=e._findConnectedPorts();c=U.allPortsFound,l=U.ports??[],h=U.portsWithSelectors??[]}catch(U){if(U instanceof dG){t.source_trace_not_connected_error.insert({...U.errorData,error_type:"source_trace_not_connected_error"}),e._couldNotFindPort=!0;return}throw U}let d=[];if(!c)return;let u=h.map(({selector:U,port:j})=>Nve(U,j)).find(Boolean);if(u){t.pcb_trace_error.insert({error_type:"pcb_trace_error",source_trace_id:e.source_trace_id,message:u,pcb_trace_id:e.pcb_trace_id,pcb_component_ids:[],pcb_port_ids:l.map((U)=>U.pcb_port_id).filter(Boolean)});return}let _=[];for(let U of l)if(!U._hasMatchedPcbPrimitive())_.push(U);if(_.length>0){t.pcb_trace_error.insert({error_type:"pcb_trace_error",source_trace_id:e.source_trace_id,message:`Some ports did not have a matching PCB primitive (e.g. a pad or plated hole), this can happen if a footprint is missing. As a result, ${e} wasn't routed. Missing ports: ${_.map((U)=>U.getString()).join(", ")}`,pcb_trace_id:e.pcb_trace_id,pcb_component_ids:[],pcb_port_ids:_.map((U)=>U.pcb_port_id).filter(Boolean)});return}let p=Brt({component:e,subcircuit:r}),m=Trt({component:e,subcircuit:r});if(p||m)return;let A=e._findConnectedNets().netsWithSelectors;if(l.length===0&&A.length===2){let[U,j]=A.map(({net:ee})=>ee),Y=U.getAllConnectedPorts(),X=j.getAllConnectedPorts();if(Y.length===0||X.length===0){console.log("Nothing to connect this net to, one of the nets is empty. TODO should emit a warning!");return}let K=[Y[0],X[0]],J=1/0;for(let ee of Y){let se=BAn(ee,X),ne=ee._getGlobalPcbPositionBeforeLayout(),re=se._getGlobalPcbPositionBeforeLayout(),Z=Math.sqrt((ne.x-re.x)**2+(ne.y-re.y)**2);if(Z<J)J=Z,K=[ee,se]}l.push(...K)}else if(l.length===1&&A.length===1){let U=l[0],Y=A[0].net.getAllConnectedPorts().filter((K)=>K!==U);if(Y.length===0){console.log("Nothing to connect this port to, the net is empty. TODO should emit a warning!");return}let X=BAn(U,Y);d.push(X),l.push(X)}else if(l.length>1&&A.length>=1){e.renderError("Trace has more than one port and one or more nets, we don't currently support this type of complex trace routing");return}let g=l.flatMap((U)=>U.matchedComponents.filter((j)=>j.componentName==="TraceHint")),f=(e._parsedProps.pcbRouteHints??[]).concat(g.flatMap((U)=>U.getPcbRouteHints()));if(l.length>2){e.renderError(`Trace has more than two ports (${l.map((U)=>U.getString()).join(", ")}), routing between more than two ports for a single trace is not implemented`);return}if(e.getSubcircuit().selectAll("trace").filter((U)=>U.renderPhaseStates.PcbTraceRender.initialized).some((U)=>U._portsRoutedOnPcb.length===l.length&&U._portsRoutedOnPcb.every((j)=>l.includes(j))))return;let C=[];if(f.length===0)C=[XIe(l[0]),XIe(l[1])];else C=[XIe(l[0]),...f,XIe(l[1])];let b=SHr(C,{layerSelectionPreference:Bst(r._getSubcircuitLayerCount())});if(zFr&&b.length===0){e.renderError(`Could not find a common layer (using hints) for trace ${e.getString()}`);return}let I=Aa(e.root.db.toArray()),[v,P]=nFr(()=>H4n(e.root.db.toArray()));if(P){e.renderError({type:"pcb_trace_error",error_type:"pcb_trace_error",pcb_trace_error_id:e.pcb_trace_id,message:`Error getting obstacles for autorouting: ${P.message}`,source_trace_id:e.source_trace_id,center:{x:0,y:0},pcb_port_ids:l.map((U)=>U.pcb_port_id),pcb_trace_id:e.pcb_trace_id,pcb_component_ids:[]});return}for(let U of v)if(U.connectedTo.length>0){let Y=I.getNetConnectedToId(U.connectedTo[0]);if(Y)U.connectedTo.push(Y)}let M=[];if(b.length===0)M=C;else{let U=b[0].layer_path;M=C.map((j,Y)=>{if(j.via)return{...j,via_to_layer:U[Y]};return{...j,layers:[U[Y]]}})}M[0].pcb_port_id=l[0].pcb_port_id,M[M.length-1].pcb_port_id=l[1].pcb_port_id;let B=[];for(let[U,j]of k4n(M)){let Y="via_to_layer"in U?U.via_to_layer:null,X=2,K="layers"in U&&U.layers.length===1?U.layers[0]:Y??"top",J="layers"in j&&j.layers.length===1?j.layers[0]:Y??"top",ee="pcb_port_id"in U?U.pcb_port_id:null,se="pcb_port_id"in j?j.pcb_port_id:null,ne=e._getExplicitTraceThickness()??e.getSubcircuit()._parsedProps.minTraceWidth??g6.min_trace_width,re=new H1e({OBSTACLE_MARGIN:ne*2,isRemovePathLoopsEnabled:!0,optimizeWithGoalBoxes:Boolean(ee&&se),connMap:I,input:{obstacles:v,minTraceWidth:ne,connections:[{name:e.source_trace_id,pointsToConnect:[{...U,layer:K,pcb_port_id:ee},{...j,layer:J,pcb_port_id:se}]}],layerCount:e.getSubcircuit()._getSubcircuitLayerCount(),bounds:{minX:Math.min(U.x,j.x)-2,maxX:Math.max(U.x,j.x)+2,minY:Math.min(U.y,j.y)-2,maxY:Math.max(U.y,j.y)+2}}}),Z=null;try{Z=re.solveAndMapToTraces()}catch(le){e.renderError({type:"pcb_trace_error",pcb_trace_error_id:e.source_trace_id,error_type:"pcb_trace_error",message:`error solving route: ${le.message}`,source_trace_id:e.pcb_trace_id,center:{x:(U.x+j.x)/2,y:(U.y+j.y)/2},pcb_port_ids:l.map((ue)=>ue.pcb_port_id),pcb_trace_id:e.pcb_trace_id,pcb_component_ids:l.map((ue)=>ue.pcb_component_id)})}if(!Z)return;if(Z.length===0){e.renderError({type:"pcb_trace_error",error_type:"pcb_trace_error",pcb_trace_error_id:e.pcb_trace_id,message:`Could not find a route for ${e}`,source_trace_id:e.source_trace_id,center:{x:(U.x+j.x)/2,y:(U.y+j.y)/2},pcb_port_ids:l.map((le)=>le.pcb_port_id),pcb_trace_id:e.pcb_trace_id,pcb_component_ids:l.map((le)=>le.pcb_component_id)});return}let[te]=Z;if(te.route=OFr(te.route,U),Y)te.route=te.route.map((le)=>{if(le.route_type==="wire"&&!le.layer)le.layer=Y;return le});if(ee&&te.route[0].route_type==="wire")te.route[0].start_pcb_port_id=ee;let ie=te.route[te.route.length-1];if(se&&ie.route_type==="wire")ie.end_pcb_port_id=se;B.push(te.route)}let T=PHr(B),N=Dve(T),D=e.getInheritedMergedProperty("pcbStyle"),{holeDiameter:L,padDiameter:H}=cT(D),V=t.pcb_trace.insert({route:wrt(T),source_trace_id:e.source_trace_id,subcircuit_id:e.getSubcircuit()?.subcircuit_id,trace_length:N}),O=e.subcircuit_connectivity_map_key??t.source_trace.get(e.source_trace_id)?.subcircuit_connectivity_map_key;e._portsRoutedOnPcb=l,e.pcb_trace_id=V.pcb_trace_id;for(let U of T)if(U.route_type==="via"){let j=U,{from_layer:Y,to_layer:X}=U;t.pcb_via.insert({pcb_trace_id:V.pcb_trace_id,x:U.x,y:U.y,hole_diameter:L,outer_diameter:H,layers:L4n({fromLayer:Y,toLayer:X,layerCount:r._getSubcircuitLayerCount(),allowBlindAndBuriedVias:s?.allow_blind_and_buried_vias??!1,physicalLayers:j.layers}),from_layer:Y,to_layer:X,subcircuit_id:r?.subcircuit_id??void 0,pcb_group_id:e.getGroup()?.pcb_group_id??void 0,subcircuit_connectivity_map_key:O})}e._insertErrorIfTraceIsOutsideBoard(T,l)}var Rve=(e)=>{switch(e){case"up":return"y+";case"down":return"y-";case"left":return"x-";case"right":return"x+";default:}},Nst=({db:e,source_trace_id:t,schematic_sheet_id:n,sameNetOnly:o,differentNetOnly:r})=>{if(!o&&!r)r=!0;let i=e.source_trace.get(t),s=[];for(let a of e.schematic_trace.list()){if(a.source_trace_id===t)continue;if(n!==void 0&&a.schematic_sheet_id!==n)continue;let l=e.source_trace.get(a.source_trace_id)?.subcircuit_connectivity_map_key===i.subcircuit_connectivity_map_key;if(r&&l)continue;if(o&&!l)continue;s.push(a)}return s},YFr=({edges:e,otherEdges:t})=>{let n=[...e];for(let o=0;o<n.length;o++){if(o>2000)throw Error("Over 2000 iterations spent inside createSchematicTraceCrossingSegments, you have triggered an infinite loop, please report this!");let r=n[o],i=Math.abs(r.from.x-r.to.x)<0.01?"vertical":r.from.y===r.to.y?"horizontal":"not-orthogonal";if(i==="not-orthogonal")continue;let s=[];for(let m of t){let A=m.from.x===m.to.x?"vertical":m.from.y===m.to.y?"horizontal":"not-orthogonal";if(A==="not-orthogonal")continue;if(i===A)continue;if(QR([r.from,r.to],[m.from,m.to],{lineThickness:0.01})){let f=i==="vertical"?r.from.x:m.from.x,y=i==="vertical"?m.from.y:r.from.y,x={x:f,y};s.push({otherEdge:m,crossingPoint:x,distanceFromEdgeFrom:Jl(r.from,x)})}}if(s.length===0)continue;let a=s[0];for(let m of s)if(m.distanceFromEdgeFrom<a.distanceFromEdgeFrom)a=m;let c=a.crossingPoint,l=0.075;if(c.x===r.from.x&&c.y===r.from.y)continue;let h=Lj(r.from,c),d={x:c.x-h.x*l/2,y:c.y-h.y*l/2},u={x:c.x+h.x*l/2,y:c.y+h.y*l/2},_=Jl(u,r.to)<l,p=[{from:r.from,to:d},{from:d,to:u,is_crossing:!0},{from:u,to:r.to}];if(n.splice(o,1,...p),o+=p.length-2,_)o++}return n},Drt=0.001,NJ=(e,t)=>{let n=Math.min(t.from.x,t.to.x),o=Math.max(t.from.x,t.to.x),r=Math.min(t.from.y,t.to.y),i=Math.max(t.from.y,t.to.y);return e.x>=n&&e.x<=o&&e.y>=r&&e.y<=i},VAn=(e)=>{let t=Math.abs(e.from.x-e.to.x)<Drt,n=Math.abs(e.from.y-e.to.y)<Drt;if(t)return"vertical";if(n)return"horizontal";return"diagonal"},GFr=(e,t)=>{let n=VAn(e),o=VAn(t);if(n===o)return null;if(n==="vertical"&&o==="horizontal"||n==="horizontal"&&o==="vertical"){let d=n==="vertical"?e:t,u=n==="horizontal"?e:t,_=d.from.x,p=u.from.y,m={x:_,y:p};return NJ(m,e)&&NJ(m,t)?m:null}if(n==="vertical"||o==="vertical"){let d=n==="vertical"?e:t,u=n==="vertical"?t:e,_=d.from.x,p=(u.to.y-u.from.y)/(u.to.x-u.from.x),m=u.from.y-p*u.from.x,A=p*_+m,g={x:_,y:A};return NJ(g,e)&&NJ(g,t)?g:null}let r=(e.to.y-e.from.y)/(e.to.x-e.from.x),i=e.from.y-r*e.from.x,s=(t.to.y-t.from.y)/(t.to.x-t.from.x),a=t.from.y-s*t.from.x;if(Math.abs(r-s)<Drt)return null;let c=(a-i)/(r-s),l=r*c+i,h={x:c,y:l};return NJ(h,e)&&NJ(h,t)?h:null},YAn=({edges:e,db:t,source_trace_id:n,schematic_sheet_id:o})=>{let r=Nst({db:t,source_trace_id:n,schematic_sheet_id:o,sameNetOnly:!0}).flatMap((s)=>s.edges),i=new Map;for(let s of e)for(let a of r){let c=GFr(s,a);if(c){let l=`${c.x.toFixed(6)},${c.y.toFixed(6)}`;if(!i.has(l))i.set(l,c)}}return Array.from(i.values())};function GAn(e){let t=e%360;return t<0?t+360:t}function UFr(e,t,n,o){if(o==="counterclockwise"){if(n>=t)return e>=t&&e<=n;return e>=t||e<=n}if(n<=t)return e<=t&&e>=n;return e<=t||e>=n}function WFr(e){let{center:t,radius:n,start_angle_degrees:o,end_angle_degrees:r}=e,i=e.direction??"counterclockwise";if(!t||typeof t.x!=="number"||typeof t.y!=="number"||typeof n!=="number"||typeof o!=="number"||typeof r!=="number")return null;let s=GAn(o),a=GAn(r),c=new Set([s,a]),l=[0,90,180,270];for(let p of l)if(UFr(p,s,a,i))c.add(p);let h=1/0,d=1/0,u=-1/0,_=-1/0;for(let p of c){let m=p*Math.PI/180,A=t.x+n*Math.cos(m),g=t.y+n*Math.sin(m);h=Math.min(h,A),u=Math.max(u,A),d=Math.min(d,g),_=Math.max(_,g)}if(!Number.isFinite(h)||!Number.isFinite(d))return null;return{minX:h,maxX:u,minY:d,maxY:_}}function Uue(e){let t=1/0,n=1/0,o=-1/0,r=-1/0;for(let i of e){let s,a,c,l;if(i.type==="schematic_component")s=i.center?.x,a=i.center?.y,c=i.size?.width,l=i.size?.height;else if(i.type==="schematic_box")s=i.x,a=i.y,c=i.width,l=i.height;else if(i.type==="schematic_port")s=i.center?.x,a=i.center?.y,c=0.2,l=0.2;else if(i.type==="schematic_text")s=i.position?.x,a=i.position?.y,c=(i.text?.length??0)*0.1,l=0.2;else if(i.type==="schematic_line"){let h=i.x1??0,d=i.y1??0,u=i.x2??0,_=i.y2??0;s=(h+u)/2,a=(d+_)/2,c=Math.abs(u-h),l=Math.abs(_-d)}else if(i.type==="schematic_rect"){if(s=i.center?.x,a=i.center?.y,c=i.width,l=i.height,i.rotation&&s!==void 0&&a!==void 0&&c!==void 0&&l!==void 0){let h=Hi(Ii(s,a),Hb(i.rotation));for(let d of[-c/2,c/2])for(let u of[-l/2,l/2]){let _=_o(h,{x:d,y:u});t=Math.min(t,_.x),o=Math.max(o,_.x),n=Math.min(n,_.y),r=Math.max(r,_.y)}continue}}else if(i.type==="schematic_circle"){s=i.center?.x,a=i.center?.y;let h=i.radius;if(typeof h==="number")c=h*2,l=h*2}else if(i.type==="schematic_arc"){let h=WFr(i);if(h)t=Math.min(t,h.minX),o=Math.max(o,h.maxX),n=Math.min(n,h.minY),r=Math.max(r,h.maxY);continue}else if(i.type==="schematic_path"){let h=i.points;if(Array.isArray(h)){for(let d of h)if(typeof d.x==="number"&&typeof d.y==="number")t=Math.min(t,d.x),o=Math.max(o,d.x),n=Math.min(n,d.y),r=Math.max(r,d.y)}continue}if(typeof s==="number"&&typeof a==="number"&&typeof c==="number"&&typeof l==="number")t=Math.min(t,s-c/2),o=Math.max(o,s+c/2),n=Math.min(n,a-l/2),r=Math.max(r,a+l/2)}return{minX:t,maxX:o,minY:n,maxY:r}}function XFr(e,t={}){let{minX:n,maxX:o,minY:r,maxY:i}=e,s=t.padding??1;if(!isFinite(n)||!isFinite(o)||!isFinite(r)||!isFinite(i))return[];let a=n-s,c=o+s,l=i+s,h=r-s,d=0.01;return[{type:"rect",layers:["top"],center:{x:(a+c)/2,y:l},width:c-a,height:d,connectedTo:[]},{type:"rect",layers:["top"],center:{x:(a+c)/2,y:h},width:c-a,height:d,connectedTo:[]},{type:"rect",layers:["top"],center:{x:a,y:(l+h)/2},width:d,height:l-h,connectedTo:[]},{type:"rect",layers:["top"],center:{x:c,y:(l+h)/2},width:d,height:l-h,connectedTo:[]}]}var jFr=(e)=>{let t=e.root.db,n=e._findConnectedPorts().ports??[],o=new Set(n.map((s)=>s.schematic_port_id)),r=[];for(let s of t.toArray()){if(s.type==="schematic_component"){let a=Boolean(s.symbol_name),c=s.size.width>s.size.height?"horz":"vert";r.push({type:"rect",layers:["top"],center:s.center,width:s.size.width+(a&&c==="horz"?-0.5:0),height:s.size.height+(a&&c==="vert"?-0.5:0),connectedTo:[]})}if(s.type==="schematic_port"){if(o.has(s.schematic_port_id))continue;let a=s.facing_direction?Z7(s.facing_direction):{x:0,y:0};r.push({type:"rect",layers:["top"],center:{x:s.center.x-a.x*0.1,y:s.center.y-a.y*0.1},width:0.1+Math.abs(a.x)*0.3,height:0.1+Math.abs(a.y)*0.3,connectedTo:[]})}if(s.type==="schematic_text")r.push({type:"rect",layers:["top"],center:s.position,width:(s.text?.length??0)*0.1,height:0.2,connectedTo:[]});if(s.type==="schematic_box")r.push({type:"rect",layers:["top"],center:{x:s.x,y:s.y},width:s.width,height:s.height,connectedTo:[]})}let i=Uue(t.toArray());return r.push(...XFr(i,{padding:1})),r},KFr=({edges:e,db:t,source_trace_id:n,schematic_sheet_id:o})=>{let r=Nst({db:t,source_trace_id:n,schematic_sheet_id:o,differentNetOnly:!0}).flatMap((s)=>s.edges),i=(s)=>{let{from:a,to:c}=s;return a.x===c.x?"vertical":"horizontal"};for(let s of e){let a=i(s),c=()=>r.find((h)=>i(h)===a&&QR([s.from,s.to],[h.from,h.to],{lineThickness:0.05})),l=c();while(l){if(a==="horizontal")s.from.y+=0.1,s.to.y+=0.1;else s.from.x+=0.1,s.to.x+=0.1;l=c()}}},$Fr=(e)=>{if(e.root?._featureMspSchematicTraceRouting)return;if(e._couldNotFindPort)return;if(e.root?.schematicDisabled)return;if(e.getCollapsedSchematicBoxAncestor())return;let{db:t}=e.root,{_parsedProps:n,parent:o}=e,r=e._getSchematicNetLabelText(),i=e._resolveSchematicSheetId();if(!o)throw Error("Trace has no parent");let s,a;try{let O=e._findConnectedPorts();s=O.allPortsFound,a=O.portsWithSelectors??[]}catch(O){if(O instanceof dG){t.source_trace_not_connected_error.insert({...O.errorData,error_type:"source_trace_not_connected_error"});return}throw O}let{netsWithSelectors:c}=e._findConnectedNets();if(!s)return;let l=(O)=>{if(i&&O.source_port_id){let U=t.schematic_port.getWhere({source_port_id:O.source_port_id,schematic_sheet_id:i});if(U)return U}if(O.schematic_port_id)return t.schematic_port.get(O.schematic_port_id)??null;if(!i&&O.source_port_id){let U=t.schematic_port.list({source_port_id:O.source_port_id}).filter((j)=>!j.schematic_sheet_id);if(U.length===1)return U[0]}return null},h=a.flatMap(({port:O})=>{let U=l(O);if(!U)return[];return[{port:O,position:U.center,schematic_port_id:U.schematic_port_id,facingDirection:U.facing_direction??null}]}),d=h.map(({schematic_port_id:O})=>O).sort(),u=h.some(({port:O,schematic_port_id:U})=>O.schematic_port_id!==U),_=d.join(","),p=e.root?._getBoard();if(p?._connectedSchematicPortPairs){if(p._connectedSchematicPortPairs.has(_))return}let m={name:e.source_trace_id,pointsToConnect:[]},A=jFr(e);if(h.length===1&&c.length===1){let O=c[0].net,{port:U,position:j}=h[0],Y=e.getSubcircuit().selectAll("netlabel").find((J)=>{let ee=J._parsedProps.connection??J._parsedProps.connectsTo;if(!ee)return!1;if(Array.isArray(ee))return ee.some((ne)=>e.getSubcircuit().selectOne(ne,{port:!0})===U);return e.getSubcircuit().selectOne(ee,{port:!0})===U});if(!Y){let J=t.schematic_net_label.getWhere({source_trace_id:e.source_trace_id});if(J)Y=J}if(Y){let J="_getGlobalSchematicPositionBeforeLayout"in Y?Y._getGlobalSchematicPositionBeforeLayout():Y.anchor_position,ee=[];if(j.x===J.x||j.y===J.y)ee.push({from:j,to:J});else ee.push({from:j,to:{x:J.x,y:j.y}}),ee.push({from:{x:J.x,y:j.y},to:J});let se=YAn({edges:ee,db:t,source_trace_id:e.source_trace_id,schematic_sheet_id:i}),ne=t.schematic_trace.insert({source_trace_id:e.source_trace_id,edges:ee,junctions:se,subcircuit_connectivity_map_key:e.subcircuit_connectivity_map_key??void 0,schematic_sheet_id:i});e.schematic_trace_id=ne.schematic_trace_id;return}if(r){let J=mZ(U.facingDirection)??"bottom";t.schematic_net_label.insert({text:r,source_net_id:O.source_net_id,anchor_position:j,center:wP({anchor_position:j,anchor_side:J,text:r}),anchor_side:J,schematic_sheet_id:e._resolveSchematicSheetId()});return}let X=mZ(U.facingDirection)??"bottom",K=t.schematic_net_label.insert({text:O._parsedProps.name,source_net_id:O.source_net_id,anchor_position:j,center:wP({anchor_position:j,anchor_side:X,text:O._parsedProps.name}),anchor_side:X,schematic_sheet_id:e._resolveSchematicSheetId()});return}if(r&&!u){if("from"in e.props&&"to"in e.props||"path"in e.props){e._doInitialSchematicTraceRenderWithDisplayLabel();return}}if(h.length<2)return;let y=(()=>{let O=[];for(let j=0;j<h.length-1;j++){let Y=h[j],X=h[j+1],K=FO({x:Y.position.x,y:Y.position.y,facingDirection:Rve(Y.facingDirection)},{x:X.position.x,y:X.position.y,facingDirection:Rve(X.facingDirection)});for(let J=0;J<K.length-1;J++)O.push({from:K[J],to:K[J+1]})}let U=(j,Y)=>{let X=Y.width/2,K=Y.height/2,J=Y.center.x-X,ee=Y.center.x+X,se=Y.center.y-K,ne=Y.center.y+K,re=(te)=>te.x>=J&&te.x<=ee&&te.y>=se&&te.y<=ne;if(re(j.from)||re(j.to))return!0;return[[{x:J,y:se},{x:ee,y:se}],[{x:ee,y:se},{x:ee,y:ne}],[{x:ee,y:ne},{x:J,y:ne}],[{x:J,y:ne},{x:J,y:se}]].some((te)=>QR([j.from,j.to],te,{lineThickness:0}))};for(let j of O)for(let Y of A)if(U(j,Y))return null;return O})();if(y&&y.length===0)y=null;m.pointsToConnect=h.map(({position:O})=>({...O,layer:"top"}));let x=IHr(A),C=2,b={minTraceWidth:0.1,obstacles:A,connections:[m],bounds:{minX:x.minX-C,maxX:x.maxX+C,minY:x.minY-C,maxY:x.maxY+C},layerCount:1},I=H1e,v=!1;if(e.getSubcircuit().props._schDirectLineRoutingEnabled)I=vAn,v=!0;if(!y){let U=new I({input:b,MAX_ITERATIONS:100,OBSTACLE_MARGIN:0.1,isRemovePathLoopsEnabled:!0,isShortenPathWithShortcutsEnabled:!0,marginsWithCosts:[{margin:1,enterCost:0,travelCostFactor:1},{margin:0.3,enterCost:0,travelCostFactor:1},{margin:0.2,enterCost:0,travelCostFactor:2},{margin:0.1,enterCost:0,travelCostFactor:3}]}).solveAndMapToTraces();if(U.length===0){if(!u&&(e._isSymbolToChipConnection()||e._isSymbolToSymbolConnection()||e._isChipToChipConnection())){e._doInitialSchematicTraceRenderWithDisplayLabel();return}U=new vAn({input:b}).solveAndMapToTraces(),v=!0}let[{route:j}]=U;y=[];let Y=j.filter((X)=>X.route_type==="wire"||X.route_type==="via");for(let X=0;X<Y.length-1;X++)y.push({from:Y[X],to:Y[X+1]})}let P=e.source_trace_id,M=[];if(!v){KFr({edges:y,db:t,source_trace_id:P,schematic_sheet_id:i});let O=Nst({db:t,source_trace_id:P,schematic_sheet_id:i,differentNetOnly:!0}).flatMap((U)=>U.edges);y=YFr({edges:y,otherEdges:O}),M=YAn({edges:y,db:t,source_trace_id:e.source_trace_id,schematic_sheet_id:i})}if(!y||y.length===0)return;let B=y[y.length-1],T=h[h.length-1],N=SAn(B);y.push(...Prt({lastEdge:B,lastEdgePort:T,lastDominantDirection:N}));let D=y[0],L=h[0],H=SAn(D);if(y.unshift(...Prt({firstEdge:D,firstEdgePort:L,firstDominantDirection:H})),!e.source_trace_id)throw Error("Missing source_trace_id for schematic trace insertion.");if(!u&&e.getSubcircuit()._parsedProps.schTraceAutoLabelEnabled&&tFr(M,y)>=5&&(e._isSymbolToChipConnection()||e._isSymbolToSymbolConnection()||e._isChipToChipConnection())){e._doInitialSchematicTraceRenderWithDisplayLabel();return}let V=t.schematic_trace.insert({source_trace_id:e.source_trace_id,edges:y,junctions:M,subcircuit_connectivity_map_key:e.subcircuit_connectivity_map_key??void 0,schematic_sheet_id:i});e.schematic_trace_id=V.schematic_trace_id;for(let{schematic_port_id:O}of h)t.schematic_port.update(O,{is_connected:!0});if(p?._connectedSchematicPortPairs)p._connectedSchematicPortPairs.add(_)},qFr=(e,{db:t})=>{let n=e.map((o)=>{let r=t.source_port.get(o.source_port_id);if(!r?.source_component_id)return null;let i=t.source_component.get(r.source_component_id);if(i?.ftype==="simple_capacitor")return i.max_decoupling_trace_length;return null}).filter((o)=>typeof o==="number");if(n.length===0)return;return Math.min(...n)};function JFr({ports:e,nets:t}){if(e.length>=2)return`${e[0]?.selector} to ${e[1]?.selector}`;if(e.length===1&&t.length===1)return`${e[0]?.selector} to net.${t[0]._parsedProps.name}`;return}function ZFr(e){let t=new Set;for(let{port:n}of e){if(!(n.parent instanceof Y4n))continue;let o=n.parent._getConnectedNetOrTrace();if(o instanceof oT)t.add(o)}return[...t]}var O_=class extends lr{source_trace_id=null;pcb_trace_id=null;isAntennaTrace=!1;schematic_trace_id=null;_inflatedPcbTraces;_inflatedPcbVias;_portsRoutedOnPcb;subcircuit_connectivity_map_key=null;_exposesSubcircuitConnection=!1;_traceConnectionHash=null;_couldNotFindPort;constructor(e){super(e);this._portsRoutedOnPcb=[]}_getExplicitTraceThickness(){return this._parsedProps.thickness??this._parsedProps.width}_getSchematicNetLabelText(){return this._parsedProps.schDisplayLabel??this._parsedProps.displayName??this._parsedProps.name}get config(){return{zodProps:GSt,componentName:"Trace"}}_getTracePortOrNetSelectorListFromProps(){if("from"in this.props&&"to"in this.props)return[typeof this.props.from==="string"?this.props.from:this.props.from.getPortSelector(),typeof this.props.to==="string"?this.props.to:this.props.to.getPortSelector()];if("path"in this.props)return this.props.path.map((e)=>typeof e==="string"?e:e.getPortSelector());return[]}getTracePortPathSelectors(){return this._getTracePortOrNetSelectorListFromProps().filter((e)=>!e.includes("net."))}getTracePathNetSelectors(){return this._getTracePortOrNetSelectorListFromProps().filter((e)=>e.includes("net."))}_findConnectedPorts(){return yFr(this)}_resolveNet(e){let t=this.getSubcircuit().selectOne(e,{type:"net"});if(t)return t;let n=e.match(/^net\.(.+)$/),o=n?n[1]:null;if(!o)return null;let r=this.root?._getBoard();if(!r)return this.renderError(`Could not find a <board> ancestor for ${this}, so net "${e}" cannot be resolved`),null;return r.getDescendants().find((s)=>s.componentName==="Net"&&s._parsedProps.name===o)||null}_findConnectedNets(){let e=this.getTracePathNetSelectors().map((n)=>({selector:n,net:this._resolveNet(n)})),t=e.filter((n)=>!n.net);if(t.length>0)this.renderError(`Could not find net for selector "${t[0].selector}" inside ${this}`);return{netsWithSelectors:e,nets:e.map((n)=>n.net)}}_getAllTracesConnectedToSameNet(){let e=this.getSubcircuit().selectAll("trace"),t=this._findConnectedNets().nets,n=this._findConnectedPorts().ports??[];return e.filter((o)=>{if(o===this)return!1;let r=o._findConnectedNets().nets,i=o._findConnectedPorts().ports??[];return r.some((s)=>t.includes(s))||i.some((s)=>n.includes(s))})}_isExplicitlyConnectedToPort(e){let{allPortsFound:t,portsWithSelectors:n}=this._findConnectedPorts();if(!t)return!1;return n.map((r)=>r.port).includes(e)}_isExplicitlyConnectedToNet(e){return this._findConnectedNets().nets.includes(e)}doInitialCreateNetsFromProps(){Gue(this,this.getTracePathNetSelectors())}_computeTraceConnectionHash(){let{allPortsFound:e,ports:t}=this._findConnectedPorts();if(!e||!t)return null;return[...t].sort((r,i)=>(r.pcb_port_id||"").localeCompare(i.pcb_port_id||"")).map((r)=>r.pcb_port_id).join(",")}doInitialSourceTraceRender(){let{db:e}=this.root,{_parsedProps:t,parent:n}=this;if(!n){this.renderError("Trace has no parent");return}let o,r;try{let h=this._findConnectedPorts();o=h.allPortsFound,r=h.portsWithSelectors??[]}catch(h){if(h instanceof dG){e.source_trace_not_connected_error.insert({...h.errorData,error_type:"source_trace_not_connected_error"}),this._couldNotFindPort=!0;return}throw h}if(!o)return;this._traceConnectionHash=this._computeTraceConnectionHash();let s=e.source_trace.list().find((h)=>h.subcircuit_connectivity_map_key===this.subcircuit_connectivity_map_key&&[...h.connected_source_port_ids].sort().join(",")===this._traceConnectionHash);if(s){this.source_trace_id=s.source_trace_id;return}let a=this._findConnectedNets().nets;for(let h of ZFr(r))if(!a.includes(h))a.push(h);let c=JFr({ports:r,nets:a}),l=e.source_trace.insert({connected_source_port_ids:r.map((h)=>h.port.source_port_id),connected_source_net_ids:a.map((h)=>h.source_net_id),subcircuit_id:this.getSubcircuit()?.subcircuit_id,name:t.name,max_length:t.maxLength??qFr(r.map((h)=>h.port),{db:e}),max_via_count:t.maxViaCount,display_name:t.displayName??c,min_trace_thickness:this._getExplicitTraceThickness()});if(this.source_trace_id=l.source_trace_id,!t.name&&a.length===0)e.source_unnamed_trace_warning.insert({message:`${this.getString()} is missing a name. Add a name prop to make the trace easier to identify.`,source_trace_id:l.source_trace_id,subcircuit_id:this.getSubcircuit()?.subcircuit_id??void 0,warning_type:"source_unnamed_trace_warning"})}_insertErrorIfTraceIsOutsideBoard(e,t){let{db:n}=this.root,o=this._getBoard();if(!o)return;let r=o.pcb_board_id;if(!r)return;if(GHr({mergedRoute:e,db:n,pcbBoardId:r}))n.pcb_trace_error.insert({error_type:"pcb_trace_error",source_trace_id:this.source_trace_id,message:`Trace ${this.getString()} routed outside the board boundaries.`,pcb_trace_id:this.pcb_trace_id,pcb_component_ids:[],pcb_port_ids:t.map((s)=>s.pcb_port_id)})}doInitialPcbManualTraceRender(){vFr(this)}doInitialPcbTraceTeardropRender(){zAn(this)}updatePcbTraceTeardropRender(){zAn(this)}doInitialPcbTraceRender(){VFr(this)}_doInitialSchematicTraceRenderWithDisplayLabel(){fFr(this)}_isSymbolToChipConnection(){let{allPortsFound:e,ports:t}=this._findConnectedPorts();if(!e||t.length!==2)return!1;let[n,o]=t;if(!n?.parent||!o?.parent)return!1;let r=n.parent.config.shouldRenderAsSchematicBox,i=o.parent.config.shouldRenderAsSchematicBox;return r&&!i||!r&&i}_isSymbolToSymbolConnection(){let{allPortsFound:e,ports:t}=this._findConnectedPorts();if(!e||t.length!==2)return!1;let[n,o]=t;if(!n?.parent||!o?.parent)return!1;let r=!n.parent.config.shouldRenderAsSchematicBox,i=!o.parent.config.shouldRenderAsSchematicBox;return r&&i}_isChipToChipConnection(){let{allPortsFound:e,ports:t}=this._findConnectedPorts();if(!e||t.length!==2)return!1;let[n,o]=t;if(!n?.parent||!o?.parent)return!1;let r=n.parent.config.shouldRenderAsSchematicBox,i=o.parent.config.shouldRenderAsSchematicBox;return r&&i}doInitialSchematicTraceRender(){$Fr(this)}},Qve={},j4n=(e)=>{let t=Object.fromEntries(Object.entries(e).map(([n,o])=>[n.toLowerCase(),o]));Object.assign(Qve,e),Object.assign(Qve,t)},ezr=class extends lr{constructor(e,t){super(e);let n=(o,r)=>{if(typeof o==="number")return o;if(typeof o==="string")try{return this._resolvePcbCoordinate(o,r,{allowBoardVariables:!1})}catch(i){return 0}return 0};this._parsedProps={...e,error:t,type:e.type||"unknown",component_name:e.name,error_type:"source_failed_to_create_component_error",message:t instanceof Error?t.message:String(t),pcbX:n(e.pcbX,"pcbX"),pcbY:n(e.pcbY,"pcbY"),schX:e.schX,schY:e.schY}}formatErrorDetails(){let e=this._parsedProps.selector??this._parsedProps.selectors??this._parsedProps.in??this._parsedProps.within,t=e===void 0?void 0:typeof e==="string"?e:this.safeStringify(e),n=this.safeStringify(this._parsedProps);return{selectorText:t,propsText:n}}safeStringify(e){let t=new WeakSet,n=JSON.stringify(e,(o,r)=>{if(typeof r==="bigint")return r.toString();if(typeof r==="function")return`[Function ${r.name||"anonymous"}]`;if(typeof r==="symbol")return r.toString();if(typeof r==="object"&&r!==null){if(t.has(r))return"[Circular]";t.add(r)}return r},2);if(!n)return"undefined";if(n.length>2000)return`${n.slice(0,2000)}…`;return n}get config(){return{componentName:"ErrorPlaceholder",zodProps:Ee({}).passthrough()}}doInitialSourceRender(){if(this.root?.db){let e=this._getGlobalPcbPositionBeforeLayout(),t=this._getGlobalSchematicPositionBeforeLayout(),{selectorText:n,propsText:o}=this.formatErrorDetails(),r=[n?`Within selector: ${n}`:null,`Props: ${o}`].filter(Boolean).join(" "),i=`Could not create ${this._parsedProps.componentType??"component"}${this._parsedProps.name?` "${this._parsedProps.name}"`:""}. ${this._parsedProps.error?.formattedError?._errors?.join("; ")||this._parsedProps.message}`;this.root.db.source_failed_to_create_component_error.insert({component_name:this._parsedProps.component_name,error_type:"source_failed_to_create_component_error",message:`${i}${r?` Details: ${r}`:""}`,pcb_center:e,schematic_center:t})}}};function tzr(e,t){return new ezr(e,t)}function nzr(e,t){let n=e;return n.__tsci={...t},e}var ozr={supportsMutation:!0,createInstance(e,t){let n=Qve[e];if(!n){if(Object.keys(Qve).length===0)throw Error("No components registered in catalogue, did you forget to import lib/register-catalogue in your test file?");throw Error(`Unsupported component type "${e}". No element with this name is registered in the @tscircuit/core catalogue. Check for typos or see https://docs.tscircuit.com/category/built-in-elements for a list of valid components. To add your own component, see docs/CREATING_NEW_COMPONENTS.md`)}try{return nzr(new n(t),{})}catch(o){return tzr({...t,componentType:e},o)}},createTextInstance(e){return{__text:e}},appendInitialChild(e,t){e.add(t)},appendChild(e,t){e.add(t)},appendChildToContainer(e,t){e.add(t)},finalizeInitialChildren(){return!1},prepareUpdate(){return null},shouldSetTextContent(){return!1},getRootHostContext(){return{}},getChildHostContext(){return{}},prepareForCommit(){return null},resetAfterCommit(){},commitMount(){},commitUpdate(){},removeChild(){},clearContainer(){},supportsPersistence:!1,getPublicInstance(e){return e},preparePortalMount(e){throw Error("Function not implemented.")},scheduleTimeout(e,t){throw Error("Function not implemented.")},cancelTimeout(e){throw Error("Function not implemented.")},noTimeout:void 0,isPrimaryRenderer:!1,getInstanceFromNode(e){throw Error("Function not implemented.")},beforeActiveInstanceBlur(){throw Error("Function not implemented.")},afterActiveInstanceBlur(){throw Error("Function not implemented.")},prepareScopeUpdate:(e,t)=>{throw Error("Function not implemented.")},getInstanceFromScope:(e)=>{throw Error("Function not implemented.")},detachDeletedInstance:(e)=>{throw Error("Function not implemented.")},getCurrentEventPriority:()=>ive.DefaultEventPriority,getCurrentUpdatePriority:()=>ive.DefaultEventPriority,resolveUpdatePriority:()=>ive.DefaultEventPriority,setCurrentUpdatePriority:()=>{},maySuspendCommit:()=>!1,supportsHydration:!1},jIe=X4n.default(ozr),Wue=(e)=>{let t={children:[],props:{name:"$root"},add(i){i.parent=this,this.children.push(i)},computePcbGlobalTransform(){return fh()}},n=[],o=jIe.createContainer(t,0,null,!1,null,"tsci",(i)=>{console.log("Error in createContainer"),console.error(i),n.push(i)},null);if(jIe.updateContainerSync(e,o,null,()=>{}),jIe.flushSyncWork(),n.length>0)throw n[0];let r=jIe.getPublicRootInstance(o);if(r)return r;return t.children[0]};function rzr(e){if(!e)return{validPinLabels:e,invalidPinLabelsMessages:[]};let t={},n=[];for(let[o,r]of Object.entries(e)){let i=Array.isArray(r)?r.slice():[r],s=[];for(let a of i)if(izr(o,a))s.push(a);else{let c=K4n(a),l=c?` Try using "${c}" instead.`:"";n.push(`Invalid pin label: ${o} = '${a}' - excluding from component. Pin labels can only contain letters, numbers and underscores.${l}`)}if(s.length>0)t[o]=Array.isArray(r)?s:s[0]}return{validPinLabels:Object.keys(t).length>0?t:void 0,invalidPinLabelsMessages:n}}function izr(e,t){return/^[A-Za-z0-9_]+$/.test(t)}function K4n(e){let t=e.match(/^\+?(\d+)\.(\d+)V(_\d+)?$/i);if(t)return`V${t[1]}_${t[2]}${t[3]??""}`;let n=e.match(/^\+?(\d+)V(\d+)(_\d+)?$/i);if(n)return`V${n[1]}_${n[2]}${n[3]??""}`;let o=e.match(/^\+?(\d+)V(_\d+)?$/i);if(o)return`V${o[1]}${o[2]??""}`;return}var UAn=(e)=>{let t=K4n(e),n=t?` Try using "${t}" instead.`:"";return`No pin labels provided and pin number or label is not a number: "${e}".${n}`},$Y=(e,t)=>{if(typeof e==="number")return e;let n=jB(e);if(n!==null)return n;if(e.startsWith("pin"))throw Error(`Invalid pinLabels key "${e}". Expected "pin\${number}" (e.g. pin1, pin2).`);if(!t)throw Error(UAn(e));let o=Sst(t),r=o.find((s)=>s.physicalPinName===e);if(r)return r.pinNumber;let i=o.filter((s)=>s.labels.includes(e));if(i.length>1&&i.some((s)=>s.physicalPinName))throw Error(`Ambiguous pin label "${e}"; use a physical ball name: ${i.map((s)=>s.physicalPinName??`pin${s.pinNumber}`).join(", ")}.`);if(i.length>0)return i[0].pinNumber;throw Error(UAn(e))},Rst=(e,t)=>{if(!e)return;let n={},o={};for(let[r,i]of Object.entries(e)){let s=$Y(r,t);o[s]={...o[s],...i}}for(let[r,i]of Object.entries(o)){let s=`pin${r}`;n[s]={bottom_margin:i.bottomMargin,left_margin:i.leftMargin,right_margin:i.rightMargin,top_margin:i.topMargin}}return n},Qst=(e)=>{if(!e)return;if("leftSide"in e||"rightSide"in e||"topSide"in e||"bottomSide"in e)return{left_side:e.leftSide,right_side:e.rightSide,top_side:e.topSide,bottom_side:e.bottomSide};if("leftPinCount"in e||"rightPinCount"in e||"topPinCount"in e||"bottomPinCount"in e)return{left_size:e.leftPinCount,right_size:e.rightPinCount,top_size:e.topPinCount,bottom_size:e.bottomPinCount};if("leftSize"in e||"rightSize"in e||"topSize"in e||"bottomSize"in e)return{left_size:e.leftSize,right_size:e.rightSize,top_size:e.topSize,bottom_size:e.bottomSize};return};function Xue(e){return e.replace(/\\n/g,`
`)}var $4n=class extends lr{isPcbPrimitive=!0;pcb_copper_text_id=null;get config(){return{componentName:"CopperText",zodProps:iEt}}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,n=this.getPrimitiveContainer(),o=this._getGlobalPcbPositionBeforeLayout(),r=this.getSubcircuit(),i=e.pcb_copper_text.insert({anchor_alignment:t.anchorAlignment,anchor_position:{x:o.x,y:o.y},font:"tscircuit2024",font_size:t.fontSize,layer:t.layer??"top",text:Xue(t.text),ccw_rotation:t.pcbRotation,is_mirrored:t.mirrored,is_knockout:t.knockout,pcb_component_id:n.pcb_component_id,subcircuit_id:r?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0});this.pcb_copper_text_id=i.pcb_copper_text_id}getPcbSize(){let{_parsedProps:e}=this,t=e.fontSize??1,o=(e.text??"").length*t,r=t;return{width:o*t,height:r*t}}_moveCircuitJsonElements({deltaX:e,deltaY:t}){if(this.root?.pcbDisabled)return;let{db:n}=this.root;if(!this.pcb_copper_text_id)return;let o=n.pcb_copper_text.get(this.pcb_copper_text_id);if(o)n.pcb_copper_text.update(this.pcb_copper_text_id,{anchor_position:{x:o.anchor_position.x+e,y:o.anchor_position.y+t}})}},q4n=class extends lr{pcb_courtyard_circle_id=null;isPcbPrimitive=!0;get config(){return{componentName:"CourtyardCircle",zodProps:QPt}}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,n=this._getGlobalPcbPositionBeforeLayout(),{maybeFlipLayer:o}=this._getPcbPrimitiveFlippedHelpers(),r=o(t.layer??"top");if(r!=="top"&&r!=="bottom")throw Error(`Invalid layer "${r}" for CourtyardCircle. Must be "top" or "bottom".`);let i=this.getSubcircuit(),s=this.parent?.pcb_component_id??this.getPrimitiveContainer()?.pcb_component_id,a=e.pcb_courtyard_circle.insert({pcb_component_id:s,layer:r,center:{x:n.x,y:n.y},radius:t.radius,subcircuit_id:i?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0});this.pcb_courtyard_circle_id=a.pcb_courtyard_circle_id}getPcbSize(){let{_parsedProps:e}=this,t=e.radius*2;return{width:t,height:t}}_moveCircuitJsonElements({deltaX:e,deltaY:t}){if(this.root?.pcbDisabled)return;let{db:n}=this.root;if(!this.pcb_courtyard_circle_id)return;let o=n.pcb_courtyard_circle.get(this.pcb_courtyard_circle_id);if(o)n.pcb_courtyard_circle.update(this.pcb_courtyard_circle_id,{center:{x:o.center.x+e,y:o.center.y+t}})}},J4n=class extends lr{pcb_courtyard_outline_id=null;isPcbPrimitive=!0;get config(){return{componentName:"CourtyardOutline",zodProps:RPt}}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,{maybeFlipLayer:n}=this._getPcbPrimitiveFlippedHelpers(),o=n(t.layer??"top");if(o!=="top"&&o!=="bottom")throw Error(`Invalid layer "${o}" for CourtyardOutline. Must be "top" or "bottom".`);let r=this._computePcbGlobalTransformBeforeLayout(),i=this.getSubcircuit(),s=this.parent?.pcb_component_id??this.getPrimitiveContainer()?.pcb_component_id,a=e.pcb_courtyard_outline.insert({pcb_component_id:s,layer:o,outline:t.outline.map((c)=>{let l=_o(r,{x:c.x,y:c.y});return{x:l.x,y:l.y}}),subcircuit_id:i?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0});this.pcb_courtyard_outline_id=a.pcb_courtyard_outline_id}_setPositionFromLayout(e){let{db:t}=this.root,n=t.pcb_courtyard_outline.get(this.pcb_courtyard_outline_id);if(!n)return;let o=0,r=0;for(let c of n.outline)o+=c.x,r+=c.y;o/=n.outline.length,r/=n.outline.length;let i=e.x-o,s=e.y-r,a=n.outline.map((c)=>({x:c.x+i,y:c.y+s}));t.pcb_courtyard_outline.update(this.pcb_courtyard_outline_id,{outline:a})}_moveCircuitJsonElements({deltaX:e,deltaY:t}){if(this.root?.pcbDisabled)return;let{db:n}=this.root;if(!this.pcb_courtyard_outline_id)return;let o=n.pcb_courtyard_outline.get(this.pcb_courtyard_outline_id);if(o)n.pcb_courtyard_outline.update(this.pcb_courtyard_outline_id,{outline:o.outline.map((r)=>({x:r.x+e,y:r.y+t}))})}getPcbSize(){let{_parsedProps:e}=this;if(!e.outline||e.outline.length===0)return{width:0,height:0};let t=Hs(e.outline);if(!t)return{width:0,height:0};return{width:t.maxX-t.minX,height:t.maxY-t.minY}}},Z4n=class extends lr{pcb_courtyard_rect_id=null;isPcbPrimitive=!0;get config(){return{componentName:"CourtyardRect",zodProps:NPt}}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,n=this._getGlobalPcbPositionBeforeLayout(),{maybeFlipLayer:o,isFlipped:r}=this._getPcbPrimitiveFlippedHelpers(),i=o(t.layer??"top");if(i!=="top"&&i!=="bottom")throw Error(`Invalid layer "${i}" for CourtyardRect. Must be "top" or "bottom".`);let s=this.getSubcircuit(),a=this.parent?.pcb_component_id??this.getPrimitiveContainer()?.pcb_component_id,h=(Zd(this._computePcbGlobalTransformBeforeLayout()).rotation.angle*180/Math.PI%360+360)%360;if(r)h=(180-h+360)%360;let d=e.pcb_courtyard_rect.insert({pcb_component_id:a,layer:i,center:{x:n.x,y:n.y},width:t.width,height:t.height,ccw_rotation:h||void 0,subcircuit_id:s?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0});this.pcb_courtyard_rect_id=d.pcb_courtyard_rect_id}getPcbSize(){let{_parsedProps:e}=this;return{width:e.width,height:e.height}}_moveCircuitJsonElements({deltaX:e,deltaY:t}){if(this.root?.pcbDisabled)return;let{db:n}=this.root;if(!this.pcb_courtyard_rect_id)return;let o=n.pcb_courtyard_rect.get(this.pcb_courtyard_rect_id);if(o)n.pcb_courtyard_rect.update(this.pcb_courtyard_rect_id,{center:{x:o.center.x+e,y:o.center.y+t}})}};function vde({width:e,height:t,ccwRotationDegrees:n}){let o=n*Math.PI/180,r=Math.cos(o),i=Math.sin(o),s=e/2,a=t/2,c=Math.abs(s*r)+Math.abs(a*i),l=Math.abs(s*i)+Math.abs(a*r);return{width:c*2,height:l*2,xExtent:c,yExtent:l}}var sve=class extends lr{pcb_cutout_id=null;isPcbPrimitive=!0;get config(){return{componentName:"Cutout",zodProps:HSt}}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,n=this.getSubcircuit(),o=this.getGroup()?.pcb_group_id??void 0,r=this._getGlobalPcbPositionBeforeLayout(),i=this.getPrimitiveContainer(),s=this.parent?.pcb_component_id??i?.pcb_component_id??void 0,a=void 0;if(t.shape==="rect"){let c=this._computePcbGlobalTransformBeforeLayout(),l=c.a*c.d-c.b*c.c<0,{rotation:h}=Zd(c,!1,l),d={shape:"rect",center:r,width:t.width,height:t.height,rotation:h.angle*180/Math.PI,subcircuit_id:n?.subcircuit_id??void 0,pcb_group_id:o,pcb_component_id:s};a=e.pcb_cutout.insert(d)}else if(t.shape==="circle"){let c={shape:"circle",center:r,radius:t.radius,subcircuit_id:n?.subcircuit_id??void 0,pcb_group_id:o,pcb_component_id:s};a=e.pcb_cutout.insert(c)}else if(t.shape==="polygon"){let c=this._computePcbGlobalTransformBeforeLayout(),h={shape:"polygon",points:t.points.map((d)=>_o(c,d)),subcircuit_id:n?.subcircuit_id??void 0,pcb_group_id:o,pcb_component_id:s};a=e.pcb_cutout.insert(h)}if(a)this.pcb_cutout_id=a.pcb_cutout_id}getPcbSize(){let{_parsedProps:e}=this;if(e.shape==="rect")return{width:e.width,height:e.height};if(e.shape==="circle")return{width:e.radius*2,height:e.radius*2};if(e.shape==="polygon"){if(e.points.length===0)return{width:0,height:0};let t=1/0,n=-1/0,o=1/0,r=-1/0;for(let i of e.points)t=Math.min(t,i.x),n=Math.max(n,i.x),o=Math.min(o,i.y),r=Math.max(r,i.y);return{width:n-t,height:r-o}}return{width:0,height:0}}_getPcbCircuitJsonBounds(){if(!this.pcb_cutout_id)return super._getPcbCircuitJsonBounds();let{db:e}=this.root,t=e.pcb_cutout.get(this.pcb_cutout_id);if(!t)return super._getPcbCircuitJsonBounds();if(t.shape==="rect"){let{width:n,height:o,xExtent:r,yExtent:i}=vde({width:t.width,height:t.height,ccwRotationDegrees:t.rotation??0});return{center:t.center,bounds:{left:t.center.x-r,top:t.center.y+i,right:t.center.x+r,bottom:t.center.y-i},width:n,height:o}}else if(t.shape==="circle")return{center:t.center,bounds:{left:t.center.x-t.radius,top:t.center.y+t.radius,right:t.center.x+t.radius,bottom:t.center.y-t.radius},width:t.radius*2,height:t.radius*2};else if(t.shape==="polygon"){if(t.points.length===0)return super._getPcbCircuitJsonBounds();let n=1/0,o=-1/0,r=1/0,i=-1/0;for(let s of t.points)n=Math.min(n,s.x),o=Math.max(o,s.x),r=Math.min(r,s.y),i=Math.max(i,s.y);return{center:{x:(n+o)/2,y:(r+i)/2},bounds:{left:n,top:i,right:o,bottom:r},width:o-n,height:i-r}}return super._getPcbCircuitJsonBounds()}_setPositionFromLayout(e){if(!this.pcb_cutout_id)return;let{db:t}=this.root,n=t.pcb_cutout.get(this.pcb_cutout_id);if(!n)return;if(n.shape==="rect"||n.shape==="circle")t.pcb_cutout.update(this.pcb_cutout_id,{...n,center:e});else if(n.shape==="polygon"){let o=this._getPcbCircuitJsonBounds().center,r=e.x-o.x,i=e.y-o.y,s=n.points.map((a)=>({x:a.x+r,y:a.y+i}));t.pcb_cutout.update(this.pcb_cutout_id,{...n,points:s})}}_moveCircuitJsonElements({deltaX:e,deltaY:t}){if(!this.pcb_cutout_id)return;let{db:n}=this.root,o=n.pcb_cutout.get(this.pcb_cutout_id);if(!o)return;if(o.shape==="rect"||o.shape==="circle")n.pcb_cutout.update(this.pcb_cutout_id,{center:{x:o.center.x+e,y:o.center.y+t}});else if(o.shape==="polygon")n.pcb_cutout.update(this.pcb_cutout_id,{points:o.points.map((r)=>({x:r.x+e,y:r.y+t}))})}},e3n=class extends lr{fabrication_note_path_id=null;isPcbPrimitive=!0;get config(){return{componentName:"FabricationNotePath",zodProps:MPt}}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,t=this.getSubcircuit(),{_parsedProps:n}=this,{maybeFlipLayer:o}=this._getPcbPrimitiveFlippedHelpers(),r=o(n.layer??"top");if(r!=="top"&&r!=="bottom")throw Error(`Invalid layer "${r}" for FabricationNotePath. Must be "top" or "bottom".`);let i=this._computePcbGlobalTransformBeforeLayout(),s=this.parent?.pcb_component_id??this.getPrimitiveContainer()?.pcb_component_id,a=e.pcb_fabrication_note_path.insert({pcb_component_id:s,layer:r,color:n.color,is_filled:n.isFilled,has_stroke:n.hasStroke,route:n.route.map((c)=>{let l=_o(i,{x:c.x,y:c.y});return{...c,x:l.x,y:l.y}}),stroke_width:n.strokeWidth??0.1,subcircuit_id:t?.subcircuit_id??void 0});this.fabrication_note_path_id=a.pcb_fabrication_note_path_id}getPcbSize(){let{_parsedProps:e}=this;if(e.route.length===0)return{width:0,height:0};let t=e.route.map((a)=>typeof a.x==="string"?parseFloat(a.x):a.x),n=e.route.map((a)=>typeof a.y==="string"?parseFloat(a.y):a.y),o=Math.min(...t),r=Math.max(...t),i=Math.min(...n),s=Math.max(...n);return{width:r-o,height:s-i}}_moveCircuitJsonElements({deltaX:e,deltaY:t}){if(this.root?.pcbDisabled)return;let{db:n}=this.root;if(!this.fabrication_note_path_id)return;let o=n.pcb_fabrication_note_path.get(this.fabrication_note_path_id);if(o)n.pcb_fabrication_note_path.update(this.fabrication_note_path_id,{route:o.route.map((r)=>({...r,x:r.x+e,y:r.y+t}))})}},t3n=class extends lr{fabrication_note_rect_id=null;isPcbPrimitive=!0;get config(){return{componentName:"FabricationNoteRect",zodProps:EPt}}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,n=this._getGlobalPcbPositionBeforeLayout(),{maybeFlipLayer:o}=this._getPcbPrimitiveFlippedHelpers(),r=o(t.layer??"top");if(r!=="top"&&r!=="bottom")throw Error(`Invalid layer "${r}" for FabricationNoteRect. Must be "top" or "bottom".`);let i=this.parent?.pcb_component_id??this.getPrimitiveContainer()?.pcb_component_id,s=this.getSubcircuit(),a=t.hasStroke??(t.strokeWidth!==void 0&&t.strokeWidth!==null),c=e.pcb_fabrication_note_rect.insert({pcb_component_id:i,layer:r,color:t.color,center:{x:n.x,y:n.y},width:t.width,height:t.height,stroke_width:t.strokeWidth??1,is_filled:t.isFilled??!1,has_stroke:a,is_stroke_dashed:t.isStrokeDashed??!1,subcircuit_id:s?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0,corner_radius:t.cornerRadius??void 0});this.fabrication_note_rect_id=c.pcb_fabrication_note_rect_id}getPcbSize(){let{_parsedProps:e}=this;return{width:e.width,height:e.height}}_moveCircuitJsonElements({deltaX:e,deltaY:t}){if(this.root?.pcbDisabled)return;let{db:n}=this.root;if(!this.fabrication_note_rect_id)return;let o=n.pcb_fabrication_note_rect.get(this.fabrication_note_rect_id);if(o)n.pcb_fabrication_note_rect.update(this.fabrication_note_rect_id,{center:{x:o.center.x+e,y:o.center.y+t}})}};function szr(e){let t=e.indexOf("[");if(t===-1)return{tag:e};let n=e.slice(0,t),r=e.slice(t+1,e.lastIndexOf("]")).match(/^(\w+)(\^=|\$=|=)['"]?(.*?)['"]?$/);if(!r)return{tag:n};return{tag:n,attrName:r[1],attrOp:r[2],attrValue:r[3]}}function WAn(e,t){if(e.lowercaseComponentName!==t.tag)return!1;if(!t.attrName)return!0;let n=e.props?.[t.attrName];if(n===void 0)return!1;let o=String(n);switch(t.attrOp){case"^=":return o.startsWith(t.attrValue);case"$=":return o.endsWith(t.attrValue);case"=":return o===t.attrValue;default:return!1}}function azr(e,t){if(!WAn(e,t[t.length-1]))return!1;let n=t.length-2,o=e.parent;while(n>=0&&o){if(WAn(o,t[n]))n--;o=o.parent}return n<0}function VJ({propertyName:e,resolvedPcbSx:t,pathFromAmpersand:n,component:o}){if(!t)return;let r,i=0;for(let[s,a]of Object.entries(t)){if(!a||!(e in a))continue;let c=s.startsWith("& ")?s.slice(2):s;if(c===n){if(1>i)i=1,r=a[e];continue}if(!o)continue;let l=c.split(/\s+/).map(szr);if(l.length<2)continue;if(azr(o,l)){let h=l.length;if(h>i)i=h,r=a[e]}}return r}var n3n=class extends lr{pcb_fabrication_note_text_id=null;isPcbPrimitive=!0;get config(){return{componentName:"FabricationNoteText",zodProps:PPt}}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,n=this._getGlobalPcbPositionBeforeLayout(),i=(Zd(this._computePcbGlobalTransformBeforeLayout()).rotation.angle*180/Math.PI%360+360)%360,s=this.getPrimitiveContainer(),a=this.getSubcircuit(),{maybeFlipLayer:c}=this._getPcbPrimitiveFlippedHelpers(),l=c(t.layer??"top");if(l!=="top"&&l!=="bottom")throw Error(`Invalid layer "${l}" for FabricationNoteText. Must be "top" or "bottom".`);if(VJ({propertyName:"visibility",resolvedPcbSx:this.getResolvedPcbSx(),pathFromAmpersand:"fabricationnotetext",component:this})==="hidden")return;let d=e.pcb_fabrication_note_text.insert({anchor_alignment:t.anchorAlignment,anchor_position:{x:n.x,y:n.y},font:t.font??"tscircuit2024",font_size:t.fontSize??1,layer:l,color:t.color,ccw_rotation:i,text:Xue(t.text??""),pcb_component_id:s.pcb_component_id,subcircuit_id:a?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0});this.pcb_fabrication_note_text_id=d.pcb_fabrication_note_text_id}getPcbSize(){let{_parsedProps:e}=this,t=typeof e.fontSize==="string"?parseFloat(e.fontSize):e.fontSize??1,n=t*0.6;return{width:(e.text??"").length*n,height:t}}_moveCircuitJsonElements({deltaX:e,deltaY:t}){if(this.root?.pcbDisabled)return;let{db:n}=this.root;if(this.pcb_fabrication_note_text_id){let o=n.pcb_fabrication_note_text.get(this.pcb_fabrication_note_text_id);if(o)n.pcb_fabrication_note_text.update(this.pcb_fabrication_note_text_id,{anchor_position:{x:o.anchor_position.x+e,y:o.anchor_position.y+t}})}}},YJ=class extends lr{pcb_hole_id=null;isPcbPrimitive=!0;get config(){return{componentName:"Hole",zodProps:VSt}}getPcbSize(){let{_parsedProps:e}=this,t=e.shape==="pill",n=e.shape==="oval",o=e.shape==="rect";if(t||n)return{width:e.width,height:e.height};else if(o)return{width:e.width,height:e.height};else return{width:e.diameter,height:e.diameter}}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,n=this.getSubcircuit(),o=this._getGlobalPcbPositionBeforeLayout(),r=t.solderMaskMargin,i=t.coveredWithSolderMask??!1,s=this.parent?.pcb_component_id??this.getPrimitiveContainer()?.pcb_component_id;if(this.emitSolderMaskMarginWarning(i,r),t.shape==="pill")if(t.pcbRotation&&t.pcbRotation!==0){let a=e.pcb_hole.insert({pcb_component_id:s,type:"pcb_hole",hole_shape:"rotated_pill",hole_width:t.width,hole_height:t.height,x:o.x,y:o.y,ccw_rotation:t.pcbRotation,soldermask_margin:r,is_covered_with_solder_mask:i,subcircuit_id:n?.subcircuit_id??void 0,pcb_group_id:n?.getGroup()?.pcb_group_id??void 0});this.pcb_hole_id=a.pcb_hole_id}else{let a=e.pcb_hole.insert({pcb_component_id:s,type:"pcb_hole",hole_shape:"pill",hole_width:t.width,hole_height:t.height,x:o.x,y:o.y,soldermask_margin:r,is_covered_with_solder_mask:i,subcircuit_id:n?.subcircuit_id??void 0,pcb_group_id:n?.getGroup()?.pcb_group_id??void 0});this.pcb_hole_id=a.pcb_hole_id}else if(t.shape==="oval"){let a=e.pcb_hole.insert({pcb_component_id:s,type:"pcb_hole",hole_shape:"oval",hole_width:t.width,hole_height:t.height,x:o.x,y:o.y,soldermask_margin:r,is_covered_with_solder_mask:i,subcircuit_id:n?.subcircuit_id??void 0,pcb_group_id:n?.getGroup()?.pcb_group_id??void 0});this.pcb_hole_id=a.pcb_hole_id}else if(t.shape==="rect"){let a=e.pcb_hole.insert({pcb_component_id:s,type:"pcb_hole",hole_shape:"rect",hole_width:t.width,hole_height:t.height,x:o.x,y:o.y,soldermask_margin:r,is_covered_with_solder_mask:i,subcircuit_id:n?.subcircuit_id??void 0,pcb_group_id:n?.getGroup()?.pcb_group_id??void 0});this.pcb_hole_id=a.pcb_hole_id}else{let a=e.pcb_hole.insert({pcb_component_id:s,type:"pcb_hole",hole_shape:"circle",hole_diameter:t.diameter,x:o.x,y:o.y,soldermask_margin:r,is_covered_with_solder_mask:i,subcircuit_id:n?.subcircuit_id??void 0,pcb_group_id:n?.getGroup()?.pcb_group_id??void 0});this.pcb_hole_id=a.pcb_hole_id}}_getPcbCircuitJsonBounds(){let{db:e}=this.root,t=e.pcb_hole.get(this.pcb_hole_id),n=this.getPcbSize();return{center:{x:t.x,y:t.y},bounds:{left:t.x-n.width/2,top:t.y-n.height/2,right:t.x+n.width/2,bottom:t.y+n.height/2},width:n.width,height:n.height}}_setPositionFromLayout(e){let{db:t}=this.root;t.pcb_hole.update(this.pcb_hole_id,{x:e.x,y:e.y})}_moveCircuitJsonElements({deltaX:e,deltaY:t}){if(this.root?.pcbDisabled)return;let{db:n}=this.root;if(!this.pcb_hole_id)return;let o=n.pcb_hole.get(this.pcb_hole_id);if(o)n.pcb_hole.update(this.pcb_hole_id,{x:o.x+e,y:o.y+t})}},kve=class extends lr{pcb_keepout_id=null;isPcbPrimitive=!0;get config(){return{componentName:"Keepout",zodProps:DPt}}getExcludedPcbComponentIds(){let e=this._parsedProps.excludeRefs?.flatMap((t)=>this.getSubcircuit().selectAll(t).map((n)=>n.pcb_component_id).filter((n)=>n!==null))??[];return Array.from(new Set(e))}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let e=this.getSubcircuit(),{db:t}=this.root,{_parsedProps:n}=this,o=this.getPrimitiveContainer()?.pcb_component_id??void 0,r=o?{pcb_component_id:o}:{},i=this.getGroup()?.pcb_group_id??void 0,s=this._getGlobalPcbPositionBeforeLayout(),a=Zd(this._computePcbGlobalTransformBeforeLayout()),c=Math.abs(a.rotation.angle*(180/Math.PI)-90)%180<0.01,l=n.layers;if(!l&&n.layer)l=[n.layer];if(!l)l=["top"];let h=this.getExcludedPcbComponentIds(),d=h.length>0?{excluded_pcb_component_ids:h}:{},u=null;if(n.shape==="circle")u=t.pcb_keepout.insert({layers:l,shape:"circle",...r,...d,...n.allowTraces!==void 0?{allow_traces:n.allowTraces}:{},...n.allowPlacements!==void 0?{allow_placements:n.allowPlacements}:{},...n.warningOnly!==void 0?{warning_only:n.warningOnly}:{},radius:n.radius,center:{x:s.x,y:s.y},subcircuit_id:e?.subcircuit_id??void 0,pcb_group_id:i});else if(n.shape==="rect")u=t.pcb_keepout.insert({layers:l,shape:"rect",...r,...d,...n.allowTraces!==void 0?{allow_traces:n.allowTraces}:{},...n.allowPlacements!==void 0?{allow_placements:n.allowPlacements}:{},...n.warningOnly!==void 0?{warning_only:n.warningOnly}:{},...c?{width:n.height,height:n.width}:{width:n.width,height:n.height},center:{x:s.x,y:s.y},subcircuit_id:e?.subcircuit_id??void 0,pcb_group_id:i});if(u)this.pcb_keepout_id=u.pcb_keepout_id}getPcbSize(){let{_parsedProps:e}=this;if(e.shape==="circle")return{width:e.radius*2,height:e.radius*2};if(e.shape==="rect")return{width:e.width,height:e.height};return{width:0,height:0}}};var o3n=class extends lr{pcb_note_line_id=null;isPcbPrimitive=!0;get config(){return{componentName:"PcbNoteLine",zodProps:AEt}}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,n=this.getSubcircuit(),o=this.getGroup(),r=this._computePcbGlobalTransformBeforeLayout(),i=_o(r,{x:t.x1,y:t.y1}),s=_o(r,{x:t.x2,y:t.y2}),a=this.parent?.pcb_component_id??this.getPrimitiveContainer()?.pcb_component_id??void 0,c=e.pcb_note_line.insert({pcb_component_id:a,subcircuit_id:n?.subcircuit_id??void 0,pcb_group_id:o?.pcb_group_id??void 0,x1:i.x,y1:i.y,x2:s.x,y2:s.y,layer:t.layer==="bottom"?"bottom":"top",stroke_width:t.strokeWidth??0.1,color:t.color,is_dashed:t.isDashed});this.pcb_note_line_id=c.pcb_note_line_id}getPcbSize(){let{_parsedProps:e}=this;return{width:Math.abs(e.x2-e.x1),height:Math.abs(e.y2-e.y1)}}_moveCircuitJsonElements({deltaX:e,deltaY:t}){if(this.root?.pcbDisabled)return;let{db:n}=this.root;if(!this.pcb_note_line_id)return;let o=n.pcb_note_line.get(this.pcb_note_line_id);if(o)n.pcb_note_line.update(this.pcb_note_line_id,{x1:o.x1+e,y1:o.y1+t,x2:o.x2+e,y2:o.y2+t})}},r3n=class extends lr{pcb_note_path_id=null;isPcbPrimitive=!0;get config(){return{componentName:"PcbNotePath",zodProps:gEt}}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,n=this._computePcbGlobalTransformBeforeLayout(),o=this.getSubcircuit(),r=this.getGroup(),i=this.parent?.pcb_component_id??this.getPrimitiveContainer()?.pcb_component_id??void 0,s=t.route.map((c)=>{let{x:l,y:h,...d}=c,u=typeof l==="string"?parseFloat(l):l,_=typeof h==="string"?parseFloat(h):h,p=_o(n,{x:u,y:_});return{...d,x:p.x,y:p.y}}),a=e.pcb_note_path.insert({pcb_component_id:i,subcircuit_id:o?.subcircuit_id??void 0,pcb_group_id:r?.pcb_group_id??void 0,route:s,layer:t.layer==="bottom"?"bottom":"top",stroke_width:t.strokeWidth??0.1,color:t.color});this.pcb_note_path_id=a.pcb_note_path_id}getPcbSize(){let{_parsedProps:e}=this;if(e.route.length===0)return{width:0,height:0};let t=e.route.map((a)=>typeof a.x==="string"?parseFloat(a.x):a.x),n=e.route.map((a)=>typeof a.y==="string"?parseFloat(a.y):a.y),o=Math.min(...t),r=Math.max(...t),i=Math.min(...n),s=Math.max(...n);return{width:r-o,height:s-i}}_moveCircuitJsonElements({deltaX:e,deltaY:t}){if(this.root?.pcbDisabled)return;let{db:n}=this.root;if(!this.pcb_note_path_id)return;let o=n.pcb_note_path.get(this.pcb_note_path_id);if(o)n.pcb_note_path.update(this.pcb_note_path_id,{route:o.route.map((r)=>({...r,x:r.x+e,y:r.y+t}))})}},i3n=class extends lr{pcb_note_rect_id=null;isPcbPrimitive=!0;get config(){return{componentName:"PcbNoteRect",zodProps:_Et}}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,n=this._computePcbGlobalTransformBeforeLayout(),o=_o(n,{x:0,y:0}),r=this.getSubcircuit(),i=this.getGroup(),s=this.parent?.pcb_component_id??this.getPrimitiveContainer()?.pcb_component_id??void 0,a=e.pcb_note_rect.insert({pcb_component_id:s,subcircuit_id:r?.subcircuit_id??void 0,pcb_group_id:i?.pcb_group_id??void 0,center:o,width:t.width,height:t.height,layer:t.layer==="bottom"?"bottom":"top",stroke_width:t.strokeWidth??0.1,is_filled:t.isFilled??!1,has_stroke:t.hasStroke??!0,is_stroke_dashed:t.isStrokeDashed??!1,color:t.color,corner_radius:t.cornerRadius??void 0});this.pcb_note_rect_id=a.pcb_note_rect_id}getPcbSize(){let{_parsedProps:e}=this,t=typeof e.width==="string"?parseFloat(e.width):e.width,n=typeof e.height==="string"?parseFloat(e.height):e.height;return{width:t,height:n}}_moveCircuitJsonElements({deltaX:e,deltaY:t}){if(this.root?.pcbDisabled)return;let{db:n}=this.root;if(!this.pcb_note_rect_id)return;let o=n.pcb_note_rect.get(this.pcb_note_rect_id);if(o)n.pcb_note_rect.update(this.pcb_note_rect_id,{center:{x:o.center.x+e,y:o.center.y+t}})}},s3n=class extends lr{pcb_note_text_id=null;isPcbPrimitive=!0;get config(){return{componentName:"PcbNoteText",zodProps:mEt}}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,n=this._computePcbGlobalTransformBeforeLayout(),o=_o(n,{x:0,y:0}),r=this.getSubcircuit(),i=this.getGroup(),s=this.parent?.pcb_component_id??this.getPrimitiveContainer()?.pcb_component_id??void 0,a=e.pcb_note_text.insert({pcb_component_id:s,subcircuit_id:r?.subcircuit_id??void 0,pcb_group_id:i?.pcb_group_id??void 0,font:t.font??"tscircuit2024",font_size:t.fontSize??1,text:Xue(t.text),anchor_position:o,anchor_alignment:t.anchorAlignment??"center",layer:t.layer==="bottom"?"bottom":"top",color:t.color});this.pcb_note_text_id=a.pcb_note_text_id}getPcbSize(){let{_parsedProps:e}=this,t=typeof e.fontSize==="string"?parseFloat(e.fontSize):e.fontSize??1,n=t*0.6;return{width:e.text.length*n,height:t}}_moveCircuitJsonElements({deltaX:e,deltaY:t}){if(this.root?.pcbDisabled)return;let{db:n}=this.root;if(!this.pcb_note_text_id)return;let o=n.pcb_note_text.get(this.pcb_note_text_id);if(o)n.pcb_note_text.update(this.pcb_note_text_id,{anchor_position:{x:o.anchor_position.x+e,y:o.anchor_position.y+t}})}},a3n=class extends lr{pcb_soldermask_opening_id=null;isPcbPrimitive=!0;get config(){return{componentName:"PcbSoldermaskOpening",zodProps:gSt}}_getPcbLocalBoundsBeforeLayout(){let e=this._parsedProps;if(e.shape==="polygon"){let o=Hs(e.points);return{left:o.minX,right:o.maxX,top:o.maxY,bottom:o.minY}}let t=e.shape==="circle"?e.radius*2:e.width,n=e.shape==="circle"?e.radius*2:e.height;return{left:-t/2,right:t/2,top:n/2,bottom:-n/2}}getPcbSize(){let e=this._getPcbLocalBoundsBeforeLayout();return{width:e.right-e.left,height:e.top-e.bottom}}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,t=this._parsedProps,n=this._computePcbGlobalTransformBeforeLayout(),{maybeFlipLayer:o,isFlipped:r}=this._getPcbPrimitiveFlippedHelpers(),i=this.getPrimitiveContainer(),s={layer:o(t.layer),pcb_component_id:this.parent?.pcb_component_id??i?.pcb_component_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0,subcircuit_id:this.getSubcircuit().subcircuit_id??void 0},a=_o(n,{x:0,y:0}),c=Zd(n,!1,r).rotation.angle*180/Math.PI,l=t.shape==="polygon"?{shape:"polygon",points:t.points.map((h)=>_o(n,h))}:t.shape==="circle"?{shape:"circle",...a,radius:t.radius}:{...Math.abs(c)<0.00000001?{shape:"rect"}:{shape:"rotated_rect",ccw_rotation:c},...a,width:t.width,height:t.height};this.pcb_soldermask_opening_id=e.pcb_soldermask_opening.insert({...s,...l}).pcb_soldermask_opening_id}_moveCircuitJsonElements({deltaX:e,deltaY:t}){if(!this.pcb_soldermask_opening_id)return;let{db:n}=this.root,o=n.pcb_soldermask_opening.get(this.pcb_soldermask_opening_id);n.pcb_soldermask_opening.update(this.pcb_soldermask_opening_id,o.shape==="polygon"?{points:o.points.map((r)=>({x:r.x+e,y:r.y+t}))}:{x:o.x+e,y:o.y+t})}doRemovePcbPrimitiveRender(){if(!this.pcb_soldermask_opening_id)return;this.root.db.pcb_soldermask_opening.delete(this.pcb_soldermask_opening_id),this.pcb_soldermask_opening_id=null}},czr=Ee({route:st(Mfe),source_trace_id:k().optional()}),kst=class extends lr{pcb_trace_id=null;_materializedRouteViaIndices=new Set;isAntennaTrace=!1;isPcbPrimitive=!0;get config(){return{componentName:"PcbTrace",zodProps:czr}}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,n=this.getPrimitiveContainer(),o=this.getSubcircuit(),{isFlipped:r,maybeFlipLayer:i}=this._getPcbPrimitiveFlippedHelpers(),s=this._computePcbGlobalTransformBeforeLayout(),a=t.route.map((d)=>{if(d.route_type==="wire"){let{x:u,y:_,...p}=d,m=_o(s,{x:u,y:_});return{...p,...m,layer:i(d.layer)}}if(d.route_type==="via"){let{x:u,y:_,...p}=d,m=_o(s,{x:u,y:_});return{...p,...m,from_layer:i(d.from_layer),to_layer:i(d.to_layer),tented_on_top:r?d.tented_on_bottom:d.tented_on_top,tented_on_bottom:r?d.tented_on_top:d.tented_on_bottom}}return{...d,start:_o(s,d.start),end:_o(s,d.end),start_layer:i(d.start_layer),end_layer:i(d.end_layer)}}),c=e.pcb_trace.insert({pcb_component_id:n.pcb_component_id,source_trace_id:t.source_trace_id,route:a,is_antenna_trace:this.isAntennaTrace,subcircuit_id:o?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0});this.pcb_trace_id=c.pcb_trace_id;let{holeDiameter:l,padDiameter:h}=cT(this.getInheritedMergedProperty("pcbStyle"));for(let[d,u]of a.entries()){if(u.route_type!=="via")continue;if(this._materializedRouteViaIndices.has(d))continue;e.pcb_via.insert({pcb_trace_id:c.pcb_trace_id,x:u.x,y:u.y,hole_diameter:u.hole_diameter??l,outer_diameter:u.outer_diameter??h,layers:kP({fromLayer:u.from_layer,toLayer:u.to_layer,layerCount:o._getSubcircuitLayerCount()}),from_layer:u.from_layer,to_layer:u.to_layer,tented_on_top:u.tented_on_top,tented_on_bottom:u.tented_on_bottom,subcircuit_id:c.subcircuit_id,pcb_group_id:c.pcb_group_id})}}getPcbSize(){let e=this._getPcbLocalBoundsBeforeLayout();return{width:e.right-e.left,height:e.top-e.bottom}}_getPcbLocalBoundsBeforeLayout(){let{_parsedProps:e}=this;if(!e.route||e.route.length===0)return{left:0,right:0,top:0,bottom:0};let t=1/0,n=-1/0,o=1/0,r=-1/0;for(let i of e.route){if(i.route_type==="through_pad")t=Math.min(t,i.start.x,i.end.x),n=Math.max(n,i.start.x,i.end.x),o=Math.min(o,i.start.y,i.end.y),r=Math.max(r,i.start.y,i.end.y);else t=Math.min(t,i.x),n=Math.max(n,i.x),o=Math.min(o,i.y),r=Math.max(r,i.y);if(i.route_type==="wire")t=Math.min(t,i.x-i.width/2),n=Math.max(n,i.x+i.width/2),o=Math.min(o,i.y-i.width/2),r=Math.max(r,i.y+i.width/2);else if(i.route_type==="through_pad")t=Math.min(t,i.start.x-i.width/2,i.end.x-i.width/2),n=Math.max(n,i.start.x+i.width/2,i.end.x+i.width/2),o=Math.min(o,i.start.y-i.width/2,i.end.y-i.width/2),r=Math.max(r,i.start.y+i.width/2,i.end.y+i.width/2)}if(t===1/0||n===-1/0||o===1/0||r===-1/0)return{left:0,right:0,top:0,bottom:0};return{left:t,right:n,top:r,bottom:o}}},lzr=p1e.extend({layers:st(Lo).optional(),isTented:Be().optional(),tentedOnTop:Be().optional(),tentedOnBottom:Be().optional()}).partial({fromLayer:!0,toLayer:!0}),c3n=class extends lr{pcb_via_id=null;_importedPcbTraceId;isPcbPrimitive=!0;get config(){return{componentName:"PcbVia",zodProps:lzr}}_getLayers(){let{layers:e,fromLayer:t="top",toLayer:n="bottom"}=this._parsedProps;if(e&&e.length>0)return e;let o=this.parent?this.getSubcircuit()._getSubcircuitLayerCount():2;return kP({fromLayer:t,toLayer:n,layerCount:o})}getAvailablePcbLayers(){return this._getLayers()}getPcbSize(){let e=this._parsedProps.outerDiameter??0.6;return{width:e,height:e}}_getPcbCircuitJsonBounds(){let{db:e}=this.root,t=e.pcb_via.get(this.pcb_via_id),n=this.getPcbSize();return{center:{x:t.x,y:t.y},bounds:{left:t.x-n.width/2,top:t.y-n.height/2,right:t.x+n.width/2,bottom:t.y+n.height/2},width:n.width,height:n.height}}_setPositionFromLayout(e){let{db:t}=this.root;t.pcb_via.update(this.pcb_via_id,{x:e.x,y:e.y})}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{holeDiameter:t,outerDiameter:n,netIsAssignable:o,tented:r,isTented:i,tentedOnTop:s,tentedOnBottom:a}=this._parsedProps,c=Tst(r),l=s??c.tented_on_top??i,h=a??c.tented_on_bottom??i,d=this.getSubcircuit(),u=this._getGlobalPcbPositionBeforeLayout(),{isFlipped:_,maybeFlipLayer:p}=this._getPcbPrimitiveFlippedHelpers(),m=this._getLayers().map((y)=>p(y)),A=this._parsedProps.fromLayer?p(this._parsedProps.fromLayer):m[0],g=this._parsedProps.toLayer?p(this._parsedProps.toLayer):m[m.length-1]??A,f=e.pcb_via.insert({x:u.x,y:u.y,...t!==void 0?{hole_diameter:t}:{},...n!==void 0?{outer_diameter:n}:{},layers:m,from_layer:A,to_layer:g,pcb_trace_id:this._importedPcbTraceId,subcircuit_id:d?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0,net_is_assignable:o,tented_on_top:_?h:l,tented_on_bottom:_?l:h});this.pcb_via_id=f.pcb_via_id}},hzr=(e)=>{for(let t of e){let n=t.toString();if(!/^(pin)?\d+$/.test(n))continue;return Number.parseInt(n.replace(/^pin/,""))}return null};function l3n(e,t,n){let o=hzr(n),r=e.filter((h)=>h.isMatchingAnyOf(n));if(r.length===0)return null;let i=r.filter((h)=>h.physicalPinName&&n.includes(h.physicalPinName));if(i.length===1)return i[0];let s=o===null?r:r.filter((h)=>h._parsedProps.pinNumber===o||h._primaryPinNumber===o),a=s.length>0?s:r;Crt(a,n.join(", "));let c=a.find((h)=>h.matchedComponents.some((d)=>d.isPcbPrimitive&&V4n(d,t)));if(c)return c;return a.find((h)=>!h.matchedComponents.some((d)=>d.isPcbPrimitive))??a[0]}var UB=class extends lr{pcb_plated_hole_id=null;matchedPort=null;isPcbPrimitive=!0;get config(){return{componentName:"PlatedHole",zodProps:MSt}}getAvailablePcbLayers(){return[...this.root?._getBoard()?.allLayers??["top","bottom"]]}getPcbSize(){let{_parsedProps:e}=this;if(e.shape==="circle")return{width:e.outerDiameter,height:e.outerDiameter};if(e.shape==="oval"||e.shape==="pill")return{width:e.outerWidth,height:e.outerHeight};if(e.shape==="circular_hole_with_rect_pad")return{width:e.rectPadWidth,height:e.rectPadHeight};if(e.shape==="pill_hole_with_rect_pad")return{width:e.rectPadWidth,height:e.rectPadHeight};if(e.shape==="hole_with_polygon_pad"){if(!e.padOutline||e.padOutline.length===0)throw Error("padOutline is required for hole_with_polygon_pad shape");let t=e.padOutline.map((a)=>{if(typeof a.x==="number")return a.x;return parseFloat(String(a.x))}),n=e.padOutline.map((a)=>{if(typeof a.y==="number")return a.y;return parseFloat(String(a.y))}),o=Math.min(...t),r=Math.max(...t),i=Math.min(...n),s=Math.max(...n);return{width:r-o,height:s-i}}throw Error(`getPcbSize for shape "${e.shape}" not implemented for ${this.componentName}`)}_getPcbCircuitJsonBounds(){let{db:e}=this.root,t=e.pcb_plated_hole.get(this.pcb_plated_hole_id),n=this.getPcbSize();return{center:{x:t.x,y:t.y},bounds:{left:t.x-n.width/2,top:t.y+n.height/2,right:t.x+n.width/2,bottom:t.y-n.height/2},width:n.width,height:n.height}}_setPositionFromLayout(e){let{db:t}=this.root;t.pcb_plated_hole.update(this.pcb_plated_hole_id,{x:e.x,y:e.y}),this.matchedPort?._setPositionFromLayout(e)}doInitialPortMatching(){let e=this.getPrimitiveContainer()?.selectAll("port");if(!this._parsedProps.portHints)return;let t=l3n(e,this,this._parsedProps.portHints);if(!t)return;this.matchedPort=t,t.registerMatch(this)}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,n=this._getGlobalPcbPositionBeforeLayout(),o=this.parent?.pcb_component_id??this.getPrimitiveContainer()?.pcb_component_id,r=this.getSubcircuit(),i=this._getIsSmt(),s=this.getAvailablePcbLayers(),a=t.solderMaskMargin,c=t.coveredWithSolderMask??!1;this.emitSolderMaskMarginWarning(c,a);let u=(Zd(this._computePcbGlobalTransformBeforeLayout()).rotation.angle*180/Math.PI%360+360)%360;if(t.shape==="circle"){let _=e.pcb_plated_hole.insert({pcb_component_id:o,pcb_port_id:this.matchedPort?.pcb_port_id,outer_diameter:t.outerDiameter,hole_diameter:t.holeDiameter,shape:"circle",port_hints:this.getNameAndAliases(),x:n.x,y:n.y,layers:s,soldermask_margin:a,is_covered_with_solder_mask:c,subcircuit_id:r?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0});if(this.pcb_plated_hole_id=_.pcb_plated_hole_id,i&&!r._isInflatedFromCircuitJson)e.pcb_solder_paste.insert({layer:"top",shape:"circle",radius:t.outerDiameter/2,x:n.x,y:n.y,subcircuit_id:r?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0}),e.pcb_solder_paste.insert({layer:"bottom",shape:"circle",radius:t.outerDiameter/2,x:n.x,y:n.y,subcircuit_id:r?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0})}else if(t.shape==="pill"&&t.rectPad){let _=e.pcb_plated_hole.insert({pcb_component_id:o,pcb_port_id:this.matchedPort?.pcb_port_id,outer_width:t.outerWidth,outer_height:t.outerHeight,hole_width:t.holeWidth,hole_height:t.holeHeight,shape:"rotated_pill_hole_with_rect_pad",type:"pcb_plated_hole",port_hints:this.getNameAndAliases(),x:n.x,y:n.y,layers:s,soldermask_margin:a,is_covered_with_solder_mask:c,subcircuit_id:r?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0,hole_shape:"rotated_pill",pad_shape:"rect",hole_ccw_rotation:u,rect_ccw_rotation:u,rect_pad_width:t.outerWidth,rect_pad_height:t.outerHeight,hole_offset_x:t.holeOffsetX,hole_offset_y:t.holeOffsetY});this.pcb_plated_hole_id=_.pcb_plated_hole_id}else if(t.shape==="pill"||t.shape==="oval"){let _=e.pcb_plated_hole.insert({pcb_component_id:o,pcb_port_id:this.matchedPort?.pcb_port_id,outer_width:t.outerWidth,outer_height:t.outerHeight,hole_width:t.holeWidth,hole_height:t.holeHeight,shape:t.shape,port_hints:this.getNameAndAliases(),x:n.x,y:n.y,layers:s,soldermask_margin:a,is_covered_with_solder_mask:c,subcircuit_id:r?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0,ccw_rotation:u});if(this.pcb_plated_hole_id=_.pcb_plated_hole_id,t.shape==="pill"&&i)e.pcb_solder_paste.insert({layer:"top",shape:"rotated_pill",radius:Math.min(t.outerWidth,t.outerHeight)/2,ccw_rotation:u,width:t.outerWidth,height:t.outerHeight,x:n.x,y:n.y,subcircuit_id:r?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0}),e.pcb_solder_paste.insert({layer:"bottom",shape:"rotated_pill",radius:Math.min(t.outerWidth,t.outerHeight)/2,ccw_rotation:u,width:t.outerWidth,height:t.outerHeight,x:n.x,y:n.y,subcircuit_id:r?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0});else if(t.shape==="oval"&&i)e.pcb_solder_paste.insert({layer:"top",shape:"oval",width:t.outerWidth,height:t.outerHeight,x:n.x,y:n.y,subcircuit_id:r?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0}),e.pcb_solder_paste.insert({layer:"bottom",shape:"oval",width:t.outerWidth,height:t.outerHeight,x:n.x,y:n.y,subcircuit_id:r?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0})}else if(t.shape==="circular_hole_with_rect_pad"){let _=e.pcb_plated_hole.insert({pcb_component_id:o,pcb_port_id:this.matchedPort?.pcb_port_id,hole_diameter:t.holeDiameter,rect_pad_width:t.rectPadWidth,rect_pad_height:t.rectPadHeight,shape:"circular_hole_with_rect_pad",port_hints:this.getNameAndAliases(),x:n.x,y:n.y,layers:s,soldermask_margin:a,is_covered_with_solder_mask:c,subcircuit_id:r?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0,hole_offset_x:t.holeOffsetX,hole_offset_y:t.holeOffsetY,rect_border_radius:t.rectBorderRadius??0,rect_ccw_rotation:u});this.pcb_plated_hole_id=_.pcb_plated_hole_id}else if(t.shape==="pill_hole_with_rect_pad")if(u!==0){let _=e.pcb_plated_hole.insert({pcb_component_id:o,pcb_port_id:this.matchedPort?.pcb_port_id,hole_width:t.holeWidth,hole_height:t.holeHeight,rect_pad_width:t.rectPadWidth,rect_pad_height:t.rectPadHeight,hole_offset_x:t.holeOffsetX,hole_offset_y:t.holeOffsetY,shape:"rotated_pill_hole_with_rect_pad",type:"pcb_plated_hole",hole_shape:"rotated_pill",pad_shape:"rect",hole_ccw_rotation:u,rect_ccw_rotation:u,rect_border_radius:t.rectBorderRadius,port_hints:this.getNameAndAliases(),x:n.x,y:n.y,layers:s,soldermask_margin:a,is_covered_with_solder_mask:c,subcircuit_id:r?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0});this.pcb_plated_hole_id=_.pcb_plated_hole_id}else{let _=e.pcb_plated_hole.insert({pcb_component_id:o,pcb_port_id:this.matchedPort?.pcb_port_id,hole_width:t.holeWidth,hole_height:t.holeHeight,rect_pad_width:t.rectPadWidth,rect_pad_height:t.rectPadHeight,hole_offset_x:t.holeOffsetX,hole_offset_y:t.holeOffsetY,shape:"pill_hole_with_rect_pad",rect_border_radius:t.rectBorderRadius,port_hints:this.getNameAndAliases(),x:n.x,y:n.y,layers:s,soldermask_margin:a,is_covered_with_solder_mask:c,subcircuit_id:r?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0});this.pcb_plated_hole_id=_.pcb_plated_hole_id}else if(t.shape==="hole_with_polygon_pad"){let _=(t.padOutline||[]).map((g)=>{let f=g.x;if(typeof f!=="number")f=parseFloat(String(f));let y=g.y;if(typeof y!=="number")y=parseFloat(String(y));return{x:f,y}}),p=t.holeOffsetX;if(typeof p!=="number")p=parseFloat(String(p||0));let m=t.holeOffsetY;if(typeof m!=="number")m=parseFloat(String(m||0));let A=e.pcb_plated_hole.insert({pcb_component_id:o,pcb_port_id:this.matchedPort?.pcb_port_id,shape:"hole_with_polygon_pad",hole_shape:t.holeShape||"circle",hole_diameter:t.holeDiameter,hole_width:t.holeWidth,hole_height:t.holeHeight,pad_outline:_,hole_offset_x:p,hole_offset_y:m,port_hints:this.getNameAndAliases(),x:n.x,y:n.y,layers:s,soldermask_margin:a,is_covered_with_solder_mask:c,subcircuit_id:r?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0});this.pcb_plated_hole_id=A.pcb_plated_hole_id}}doInitialPcbPortAttachment(){if(this.root?.pcbDisabled)return;let{db:e}=this.root;e.pcb_plated_hole.update(this.pcb_plated_hole_id,{pcb_port_id:this.matchedPort?.pcb_port_id})}_moveCircuitJsonElements({deltaX:e,deltaY:t}){if(this.root?.pcbDisabled)return;let{db:n}=this.root;if(!this.pcb_plated_hole_id)return;let o=n.pcb_plated_hole.get(this.pcb_plated_hole_id);if(o){let r={x:o.x+e,y:o.y+t};this._setPositionFromLayout(r)}}},h3n=class extends lr{isSchematicPrimitive=!0;get config(){return{componentName:"SchematicArc",zodProps:UPt}}schematic_arc_id;doInitialSchematicPrimitiveRender(){if(this.root?.schematicDisabled)return;if(this.getCollapsedSchematicBoxAncestor())return;let{db:e}=this.root,{_parsedProps:t}=this,n=this._getGlobalSchematicPositionBeforeLayout(),o=this.getPrimitiveContainer()?.parent?.schematic_component_id,r=this._getSymbolAncestor()?.schematic_symbol_id,i=e.schematic_arc.insert({schematic_component_id:o,schematic_symbol_id:r,center:{x:t.center.x+n.x,y:t.center.y+n.y},radius:t.radius,start_angle_degrees:t.startAngleDegrees,end_angle_degrees:t.endAngleDegrees,direction:t.direction,stroke_width:t.strokeWidth??B8e,color:t.color??qB,is_dashed:t.isDashed,subcircuit_id:this.getSubcircuit().subcircuit_id??void 0,schematic_sheet_id:this._resolveSchematicSheetId()});this.schematic_arc_id=i.schematic_arc_id}doInitialSchematicSymbolResize(){if(this.root?.schematicDisabled)return;if(!this.schematic_arc_id)return;let t=this._getSymbolAncestor()?.getUserCoordinateToResizedSymbolTransform();if(!t)return;let{db:n}=this.root,o=n.schematic_arc.get(this.schematic_arc_id);if(!o)return;let r=_o(t,o.center),i=_o(t,{x:o.center.x+o.radius,y:o.center.y}),s=Math.hypot(i.x-r.x,i.y-r.y),a=Math.atan2(t.b,t.a)*180/Math.PI;n.schematic_arc.update(this.schematic_arc_id,{center:{x:r.x,y:r.y},radius:s,start_angle_degrees:o.start_angle_degrees+a,end_angle_degrees:o.end_angle_degrees+a})}},d3n=class extends lr{isSchematicPrimitive=!0;get config(){return{componentName:"SchematicCircle",zodProps:jPt}}schematic_circle_id;doInitialSchematicPrimitiveRender(){if(this.root?.schematicDisabled)return;if(this.getCollapsedSchematicBoxAncestor())return;let{db:e}=this.root,{_parsedProps:t}=this,n=this._getGlobalSchematicPositionBeforeLayout(),o=this.getPrimitiveContainer()?.parent?.schematic_component_id,r=this._getSymbolAncestor()?.schematic_symbol_id,i=e.schematic_circle.insert({schematic_component_id:o,schematic_symbol_id:r,center:{x:t.center.x+n.x,y:t.center.y+n.y},radius:t.radius,stroke_width:t.strokeWidth??B8e,color:t.color??qB,is_filled:t.isFilled,fill_color:t.fillColor,is_dashed:t.isDashed,subcircuit_id:this.getSubcircuit().subcircuit_id??void 0,schematic_sheet_id:this._resolveSchematicSheetId()});this.schematic_circle_id=i.schematic_circle_id}doInitialSchematicSymbolResize(){if(this.root?.schematicDisabled)return;if(!this.schematic_circle_id)return;let t=this._getSymbolAncestor()?.getUserCoordinateToResizedSymbolTransform();if(!t)return;let{db:n}=this.root,o=n.schematic_circle.get(this.schematic_circle_id);if(!o)return;let r=_o(t,o.center),i=_o(t,{x:o.center.x+o.radius,y:o.center.y}),s=Math.hypot(i.x-r.x,i.y-r.y);n.schematic_circle.update(this.schematic_circle_id,{center:{x:r.x,y:r.y},radius:s})}},Nrt=class extends lr{isSchematicPrimitive=!0;get config(){return{componentName:"SchematicLine",zodProps:$Pt}}schematic_line_id;doInitialSchematicPrimitiveRender(){if(this.root?.schematicDisabled)return;if(this.getCollapsedSchematicBoxAncestor())return;let{db:e}=this.root,{_parsedProps:t}=this,n=this._getGlobalSchematicPositionBeforeLayout(),o=this.getPrimitiveContainer()?.parent?.schematic_component_id,r=this._getSymbolAncestor()?.schematic_symbol_id,i=e.schematic_line.insert({schematic_component_id:o,schematic_symbol_id:r,x1:t.x1+n.x,y1:t.y1+n.y,x2:t.x2+n.x,y2:t.y2+n.y,stroke_width:t.strokeWidth??B8e,color:t.color??qB,is_dashed:t.isDashed||t.dashLength!==void 0||t.dashGap!==void 0,dash_length:t.dashLength,dash_gap:t.dashGap,subcircuit_id:this.getSubcircuit().subcircuit_id??void 0,schematic_sheet_id:this._resolveSchematicSheetId()});this.schematic_line_id=i.schematic_line_id}doInitialSchematicSymbolResize(){if(this.root?.schematicDisabled)return;if(!this.schematic_line_id)return;let t=this._getSymbolAncestor()?.getUserCoordinateToResizedSymbolTransform();if(!t)return;let{db:n}=this.root,o=n.schematic_line.get(this.schematic_line_id);if(!o)return;let r=_o(t,{x:o.x1,y:o.y1}),i=_o(t,{x:o.x2,y:o.y2});n.schematic_line.update(this.schematic_line_id,{x1:r.x,y1:r.y,x2:i.x,y2:i.y})}};function ode(e,t){let n=new FK(e),o=n.getTotalLength(),r=Math.max(2,Math.ceil(o*t)),i=[];for(let s=1;s<=r;s++){let a=s/r*o,c=n.getPointAtLength(a);i.push({x:c.x,y:c.y})}return i}function dzr(e,t=10){let n=new FK(e);n.toAbsolute();let o=n.segments,r=[],i=[],s=0,a=0,c=0,l=0;for(let h of o)switch(h[0]){case"M":{if(i.length>0)r.push(i);s=h[1],a=h[2],c=s,l=a,i=[{x:s,y:a}];break}case"L":{s=h[1],a=h[2],i.push({x:s,y:a});break}case"H":{s=h[1],i.push({x:s,y:a});break}case"V":{a=h[1],i.push({x:s,y:a});break}case"Z":{if(s!==c||a!==l)i.push({x:c,y:l});s=c,a=l;break}case"C":{let u=h[5],_=h[6],p=`M ${s} ${a} C ${h[1]} ${h[2]} ${h[3]} ${h[4]} ${u} ${_}`,m=ode(p,t);i.push(...m),s=u,a=_;break}case"S":{let u=h[3],_=h[4],p=`M ${s} ${a} S ${h[1]} ${h[2]} ${u} ${_}`,m=ode(p,t);i.push(...m),s=u,a=_;break}case"Q":{let u=h[3],_=h[4],p=`M ${s} ${a} Q ${h[1]} ${h[2]} ${u} ${_}`,m=ode(p,t);i.push(...m),s=u,a=_;break}case"T":{let u=h[1],_=h[2],p=`M ${s} ${a} T ${u} ${_}`,m=ode(p,t);i.push(...m),s=u,a=_;break}case"A":{let u=h[6],_=h[7],p=`M ${s} ${a} A ${h[1]} ${h[2]} ${h[3]} ${h[4]} ${h[5]} ${u} ${_}`,m=ode(p,t);i.push(...m),s=u,a=_;break}}if(i.length>0)r.push(i);return r.map((h)=>{let d=[];for(let u of h)if(d.length===0||Math.abs(d[d.length-1].x-u.x)>0.000000001||Math.abs(d[d.length-1].y-u.y)>0.000000001)d.push(u);return d})}var u3n=class extends lr{isSchematicPrimitive=!0;schematic_path_ids=[];get config(){return{componentName:"SchematicPath",zodProps:JPt}}doInitialSchematicPrimitiveRender(){if(this.root?.schematicDisabled)return;if(this.getCollapsedSchematicBoxAncestor())return;let{db:e}=this.root,{_parsedProps:t}=this,n=this._getGlobalSchematicPositionBeforeLayout(),o=this.getPrimitiveContainer()?.parent?.schematic_component_id,r=this._getSymbolAncestor()?.schematic_symbol_id,i=this.getSubcircuit().subcircuit_id??void 0;if(this.schematic_path_ids=[],t.svgPath){let s=dzr(t.svgPath);for(let a of s){let c=e.schematic_path.insert({schematic_component_id:o,schematic_symbol_id:r,points:a.map((l)=>({x:l.x+n.x,y:l.y+n.y})),is_filled:t.isFilled,is_dashed:t.dashLength!==void 0||t.dashGap!==void 0,fill_color:t.fillColor,stroke_color:t.strokeColor,stroke_width:t.strokeWidth,dash_length:t.dashLength,dash_gap:t.dashGap,subcircuit_id:i,schematic_sheet_id:this._resolveSchematicSheetId()});this.schematic_path_ids.push(c.schematic_path_id)}}else if(t.points&&t.points.length>0){let s=e.schematic_path.insert({schematic_component_id:o,schematic_symbol_id:r,points:t.points.map((a)=>({x:a.x+n.x,y:a.y+n.y})),is_filled:t.isFilled,is_dashed:t.dashLength!==void 0||t.dashGap!==void 0,fill_color:t.fillColor,stroke_color:t.strokeColor,stroke_width:t.strokeWidth,dash_length:t.dashLength,dash_gap:t.dashGap,subcircuit_id:i,schematic_sheet_id:this._resolveSchematicSheetId()});this.schematic_path_ids.push(s.schematic_path_id)}}doInitialSchematicSymbolResize(){if(this.root?.schematicDisabled)return;if(this.schematic_path_ids.length===0)return;let t=this._getSymbolAncestor()?.getUserCoordinateToResizedSymbolTransform();if(!t)return;let{db:n}=this.root;for(let o of this.schematic_path_ids){let r=n.schematic_path.get(o);if(!r)continue;let i=r.points.map((s)=>{let a=_o(t,s);return{x:a.x,y:a.y}});n.schematic_path.update(o,{points:i})}}},p3n=class extends lr{isSchematicPrimitive=!0;get config(){return{componentName:"SchematicRect",zodProps:KPt}}schematic_rect_id;doInitialSchematicPrimitiveRender(){if(this.root?.schematicDisabled)return;if(this.getCollapsedSchematicBoxAncestor())return;let{db:e}=this.root,{_parsedProps:t}=this,n=this._getGlobalSchematicPositionBeforeLayout(),o=this.getPrimitiveContainer()?.parent?.schematic_component_id,r=this._getSymbolAncestor()?.schematic_symbol_id,i=e.schematic_rect.insert({schematic_symbol_id:r,center:{x:n.x,y:n.y},width:t.width,height:t.height,stroke_width:t.strokeWidth??B8e,color:t.color??qB,is_filled:t.isFilled,schematic_component_id:o,is_dashed:t.isDashed,rotation:t.rotation??0,subcircuit_id:this.getSubcircuit().subcircuit_id??void 0,schematic_sheet_id:this._resolveSchematicSheetId()});this.schematic_rect_id=i.schematic_rect_id}doInitialSchematicSymbolResize(){if(this.root?.schematicDisabled)return;if(!this.schematic_rect_id)return;let t=this._getSymbolAncestor()?.getUserCoordinateToResizedSymbolTransform();if(!t)return;let{db:n}=this.root,o=n.schematic_rect.get(this.schematic_rect_id);if(!o)return;let r=Math.hypot(t.a,t.b),i=Math.hypot(t.c,t.d),s=Math.atan2(t.b,t.a)*180/Math.PI;n.schematic_rect.update(this.schematic_rect_id,{center:_o(t,o.center),width:o.width*r,height:o.height*i,rotation:(o.rotation??0)+s})}},m3n=class extends lr{isSchematicPrimitive=!0;schematic_text_id;get config(){return{componentName:"SchematicText",zodProps:qPt}}doInitialSchematicPrimitiveRender(){if(this.root?.schematicDisabled)return;if(this.getCollapsedSchematicBoxAncestor())return;let{db:e}=this.root,{_parsedProps:t}=this,n=this._getGlobalSchematicPositionBeforeLayout(),o=this._getSymbolAncestor()?.schematic_symbol_id,r=this.getParentNormalComponent()?.schematic_component_id??void 0,i=this._resolveText(),s=e.schematic_text.insert({schematic_symbol_id:o,schematic_component_id:r,anchor:t.anchor??"center",text:Xue(i),font_size:t.fontSize,color:t.color||"#000000",position:{x:n.x,y:n.y},rotation:t.schRotation??0,schematic_sheet_id:this._resolveSchematicSheetId()});this.schematic_text_id=s.schematic_text_id}doInitialSchematicSymbolResize(){if(this.root?.schematicDisabled)return;if(!this.schematic_text_id)return;let t=this._getSymbolAncestor()?.getUserCoordinateToResizedSymbolTransform();if(!t)return;let{db:n}=this.root,o=n.schematic_text.get(this.schematic_text_id);if(!o)return;let r=_o(t,o.position);n.schematic_text.update(this.schematic_text_id,{position:{x:r.x,y:r.y},rotation:(o.rotation??0)+Math.atan2(t.b,t.a)*180/Math.PI})}},_3n=class extends lr{pcb_silkscreen_circle_id=null;isPcbPrimitive=!0;get config(){return{componentName:"SilkscreenCircle",zodProps:hEt}}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,n=this._getGlobalPcbPositionBeforeLayout(),{maybeFlipLayer:o}=this._getPcbPrimitiveFlippedHelpers(),r=o(t.layer??"top");if(r!=="top"&&r!=="bottom")throw Error(`Invalid layer "${r}" for SilkscreenCircle. Must be "top" or "bottom".`);let i=this.getSubcircuit(),s=this.parent?.pcb_component_id??this.getPrimitiveContainer()?.pcb_component_id,a=e.pcb_silkscreen_circle.insert({pcb_component_id:s,layer:r,center:{x:n.x,y:n.y},radius:t.radius,subcircuit_id:i?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0,stroke_width:t.strokeWidth??0.1});this.pcb_silkscreen_circle_id=a.pcb_silkscreen_circle_id}getPcbSize(){let{_parsedProps:e}=this,t=e.radius*2;return{width:t,height:t}}_moveCircuitJsonElements({deltaX:e,deltaY:t}){if(this.root?.pcbDisabled)return;let{db:n}=this.root;if(!this.pcb_silkscreen_circle_id)return;let o=n.pcb_silkscreen_circle.get(this.pcb_silkscreen_circle_id);if(o)n.pcb_silkscreen_circle.update(this.pcb_silkscreen_circle_id,{center:{x:o.center.x+e,y:o.center.y+t}})}},g3n=class extends lr{pcb_silkscreen_line_id=null;isPcbPrimitive=!0;get config(){return{componentName:"SilkscreenLine",zodProps:cEt}}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,{maybeFlipLayer:n}=this._getPcbPrimitiveFlippedHelpers(),o=n(t.layer??"top");if(o!=="top"&&o!=="bottom")throw Error(`Invalid layer "${o}" for SilkscreenLine. Must be "top" or "bottom".`);let r=this.getSubcircuit(),i=this._computePcbGlobalTransformBeforeLayout(),s=_o(i,{x:t.x1,y:t.y1}),a=_o(i,{x:t.x2,y:t.y2}),c=this.parent?.pcb_component_id??this.getPrimitiveContainer()?.pcb_component_id,l=e.pcb_silkscreen_line.insert({pcb_component_id:c,layer:o,x1:s.x,y1:s.y,x2:a.x,y2:a.y,stroke_width:t.strokeWidth??0.1,subcircuit_id:r?.subcircuit_id??void 0,pcb_group_id:r?.getGroup()?.pcb_group_id??void 0});this.pcb_silkscreen_line_id=l.pcb_silkscreen_line_id}getPcbSize(){let{_parsedProps:e}=this,t=Math.abs(e.x2-e.x1),n=Math.abs(e.y2-e.y1);return{width:t,height:n}}_moveCircuitJsonElements({deltaX:e,deltaY:t}){if(this.root?.pcbDisabled)return;let{db:n}=this.root;if(!this.pcb_silkscreen_line_id)return;let o=n.pcb_silkscreen_line.get(this.pcb_silkscreen_line_id);if(o)n.pcb_silkscreen_line.update(this.pcb_silkscreen_line_id,{x1:o.x1+e,y1:o.y1+t,x2:o.x2+e,y2:o.y2+t})}},A3n=class extends lr{pcb_silkscreen_path_id=null;isPcbPrimitive=!0;get config(){return{componentName:"SilkscreenPath",zodProps:aEt}}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,{maybeFlipLayer:n}=this._getPcbPrimitiveFlippedHelpers(),o=n(t.layer??"top");if(o!=="top"&&o!=="bottom")throw Error(`Invalid layer "${o}" for SilkscreenPath. Must be "top" or "bottom".`);let r=this._computePcbGlobalTransformBeforeLayout(),i=this.getSubcircuit(),s=this.parent?.pcb_component_id??this.getPrimitiveContainer()?.pcb_component_id,a=e.pcb_silkscreen_path.insert({pcb_component_id:s,layer:o,route:t.route.map((c)=>{let l=_o(r,{x:c.x,y:c.y});return{...c,x:l.x,y:l.y}}),stroke_width:t.strokeWidth??0.1,subcircuit_id:i?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0});this.pcb_silkscreen_path_id=a.pcb_silkscreen_path_id}_setPositionFromLayout(e){let{db:t}=this.root,{_parsedProps:n}=this,o=t.pcb_silkscreen_path.get(this.pcb_silkscreen_path_id);if(!o)return;let r=0,i=0;for(let l of o.route)r+=l.x,i+=l.y;r/=o.route.length,i/=o.route.length;let s=e.x-r,a=e.y-i,c=o.route.map((l)=>({...l,x:l.x+s,y:l.y+a}));t.pcb_silkscreen_path.update(this.pcb_silkscreen_path_id,{route:c})}_moveCircuitJsonElements({deltaX:e,deltaY:t}){if(this.root?.pcbDisabled)return;let{db:n}=this.root;if(!this.pcb_silkscreen_path_id)return;let o=n.pcb_silkscreen_path.get(this.pcb_silkscreen_path_id);if(o)n.pcb_silkscreen_path.update(this.pcb_silkscreen_path_id,{route:o.route.map((r)=>({...r,x:r.x+e,y:r.y+t}))})}getPcbSize(){let{_parsedProps:e}=this;if(!e.route||e.route.length===0)return{width:0,height:0};let t=1/0,n=-1/0,o=1/0,r=-1/0;for(let i of e.route)t=Math.min(t,i.x),n=Math.max(n,i.x),o=Math.min(o,i.y),r=Math.max(r,i.y);return{width:n-t,height:r-o}}},f3n=class extends lr{pcb_silkscreen_rect_id=null;isPcbPrimitive=!0;get config(){return{componentName:"SilkscreenRect",zodProps:lEt}}_isRotated90Degrees(){let e=this._computePcbGlobalTransformBeforeLayout(),o=(Zd(e).rotation.angle*180/Math.PI%360+360)%360,r=0.01;return Math.abs(o-90)<0.01||Math.abs(o-270)<0.01}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,{maybeFlipLayer:n}=this._getPcbPrimitiveFlippedHelpers(),o=n(t.layer??"top");if(o!=="top"&&o!=="bottom")throw Error(`Invalid layer "${o}" for SilkscreenRect. Must be "top" or "bottom".`);let r=this.getSubcircuit(),i=this._getGlobalPcbPositionBeforeLayout(),s=this._isRotated90Degrees(),a=s?t.height:t.width,c=s?t.width:t.height,l=this.parent?.pcb_component_id??this.getPrimitiveContainer()?.pcb_component_id,h=e.pcb_silkscreen_rect.insert({pcb_component_id:l,layer:o,center:{x:i.x,y:i.y},width:a,height:c,subcircuit_id:r?.subcircuit_id??void 0,pcb_group_id:this?.getGroup()?.pcb_group_id??void 0,stroke_width:t.strokeWidth??0.1,is_filled:t.filled??!1,corner_radius:t.cornerRadius??void 0});this.pcb_silkscreen_rect_id=h.pcb_silkscreen_rect_id}getPcbSize(){let{_parsedProps:e}=this;if(this._isRotated90Degrees())return{width:e.height,height:e.width};return{width:e.width,height:e.height}}_moveCircuitJsonElements({deltaX:e,deltaY:t}){if(this.root?.pcbDisabled)return;let{db:n}=this.root;if(!this.pcb_silkscreen_rect_id)return;let o=n.pcb_silkscreen_rect.get(this.pcb_silkscreen_rect_id);if(o)n.pcb_silkscreen_rect.update(this.pcb_silkscreen_rect_id,{center:{x:o.center.x+e,y:o.center.y+t}})}},Lst=class extends lr{pcb_silkscreen_text_ids=[];isPcbPrimitive=!0;_footprinterFontSize;get config(){return{componentName:"SilkscreenText",zodProps:sEt}}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,n=this.getPrimitiveContainer(),{maybeFlipLayer:o,isFlipped:r}=this._getPcbPrimitiveFlippedHelpers(),i=this.getSubcircuit(),s=0;if(t.pcbRotation!==void 0&&t.pcbRotation!==0)s=t.pcbRotation;else{let x=this._computePcbGlobalTransformBeforeLayout();s=Zd(x).rotation.angle*180/Math.PI}if(r)s=(s+180)%360;let a=new Set(t.layers);if(t.layer)a.add(t.layer);let c=a.size>0?Array.from(a):["top"],l=VJ({propertyName:"fontSize",resolvedPcbSx:this.getResolvedPcbSx(),pathFromAmpersand:"silkscreentext",component:this}),h=VJ({propertyName:"pcbX",resolvedPcbSx:this.getResolvedPcbSx(),pathFromAmpersand:"silkscreentext",component:this}),d=VJ({propertyName:"pcbY",resolvedPcbSx:this.getResolvedPcbSx(),pathFromAmpersand:"silkscreentext",component:this});if(VJ({propertyName:"visibility",resolvedPcbSx:this.getResolvedPcbSx(),pathFromAmpersand:"silkscreentext",component:this})==="hidden")return;let _=t.fontSize??l??this.getInheritedProperty("pcbStyle")?.silkscreenFontSize??this._footprinterFontSize??1,m=(h!==void 0||d!==void 0)&&this._footprinterFontSize!==void 0?_o(Hi(this.parent?._computePcbGlobalTransformBeforeLayout()??fh(),r?ZR():fh()),{x:this.resolvePcbCoordinate({rawValue:h??t.pcbX??0,axis:"pcbX"}),y:this.resolvePcbCoordinate({rawValue:d??t.pcbY??0,axis:"pcbY"})}):this._getGlobalPcbPositionBeforeLayout(),A=t.knockoutPadding??0,f=t.knockoutPadding!==void 0||t.knockoutPaddingLeft!==void 0||t.knockoutPaddingRight!==void 0||t.knockoutPaddingTop!==void 0||t.knockoutPaddingBottom!==void 0?{left:t.knockoutPaddingLeft??A,right:t.knockoutPaddingRight??A,top:t.knockoutPaddingTop??A,bottom:t.knockoutPaddingBottom??A}:void 0,y=this._resolveText();for(let x of c){let C=e.pcb_silkscreen_text.insert({anchor_alignment:t.anchorAlignment,anchor_position:{x:m.x,y:m.y},font:t.font??"tscircuit2024",font_size:_,layer:o(x),text:Xue(y),ccw_rotation:s,pcb_component_id:n.pcb_component_id,subcircuit_id:i?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0,is_knockout:t.isKnockout,knockout_padding:f});this.pcb_silkscreen_text_ids.push(C.pcb_silkscreen_text_id)}}getPcbSize(){let{_parsedProps:e}=this,t=VJ({propertyName:"fontSize",resolvedPcbSx:this.getResolvedPcbSx(),pathFromAmpersand:"silkscreentext",component:this}),n=e.fontSize??t??this.getInheritedProperty("pcbStyle")?.silkscreenFontSize??this._footprinterFontSize??1,r=this._resolveText().length*n,i=n;return{width:r*n,height:i*n}}_moveCircuitJsonElements({deltaX:e,deltaY:t}){if(this.root?.pcbDisabled)return;let{db:n}=this.root;for(let o of this.pcb_silkscreen_text_ids){let r=n.pcb_silkscreen_text.get(o);if(r)n.pcb_silkscreen_text.update(o,{anchor_position:{x:r.anchor_position.x+e,y:r.anchor_position.y+t}})}}},KIe=(e)=>{let t=new He.Polygon(e.map(({x:n,y:o})=>new He.Point(n,o)));if(t.orientation()===He.ORIENTATION.CW)t.reverse();return t};function uzr({points:e,solderPasteMargin:t}){if(t===0)return[{points:e}];let n=KIe(e),o=n;if(t===void 0){let r=Hs(e),i=(r.minX+r.maxX)/2,s=(r.minY+r.maxY)/2,a=Hi(Ii(i,s),Fb(0.7),Ii(-i,-s));o=He.BooleanOperations.intersect(n,KIe(e.map((c)=>_o(a,c))))}else{let r=n.vertices,i=r.map((a,c)=>new He.Segment(a,r[(c+1)%r.length])).filter((a)=>!a.isZeroLength()),s=i.map((a)=>a.translate(a.tangentInStart().rotate90CW().multiply(t)));for(let[a,c]of i.entries()){let l=s[a],h=KIe([c.start,c.end,l.end,l.start]);o=t>0?He.BooleanOperations.unify(o,h):He.BooleanOperations.subtract(o,h);let d=(a+1)%i.length,u=i[d],_=s[d],p=c.tangentInStart().cross(u.tangentInStart());if(He.Utils.EQ_0(p)||p*t<0)continue;let[m]=new He.Line(l.start,l.end).intersect(new He.Line(_.start,_.end)),A=KIe([c.end,l.end,m,_.start]);o=t>0?He.BooleanOperations.unify(o,A):He.BooleanOperations.subtract(o,A)}}return o.splitToIslands().map((r)=>{let i=[...r.faces].sort((c,l)=>l.area()-c.area()),[s,...a]=i;return{points:s.vertices.map(({x:c,y:l})=>({x:c,y:l})),...a.length?{holes:a.map((c)=>c.vertices.map(({x:l,y:h})=>({x:l,y:h})))}:{}}})}var WB=class extends lr{pcb_smtpad_id=null;matchedPort=null;_inflatedPcbSolderPaste;isPcbPrimitive=!0;get config(){return{componentName:"SmtPad",zodProps:zSt}}getPcbSize(){let{_parsedProps:e}=this;if(e.shape==="circle")return{width:e.radius*2,height:e.radius*2};if(e.shape==="rect")return{width:e.width,height:e.height};if(e.shape==="rotated_rect"){let{width:t,height:n}=vde({width:e.width,height:e.height,ccwRotationDegrees:e.ccwRotation??0});return{width:t,height:n}}if(e.shape==="polygon"){let t=e.points,n=t.map((c)=>c.x),o=t.map((c)=>c.y),r=Math.min(...n),i=Math.max(...n),s=Math.min(...o),a=Math.max(...o);return{width:i-r,height:a-s}}if(e.shape==="pill")return{width:e.width,height:e.height};if(e.shape==="rotated_pill"){let{width:t,height:n}=vde({width:e.width,height:e.height,ccwRotationDegrees:e.ccwRotation});return{width:t,height:n}}throw Error(`getPcbSize for shape "${e.shape}" not implemented for ${this.componentName}`)}_getPcbBoundsBeforeLayout(){let{_parsedProps:e}=this;if(e.shape!=="polygon")return super._getPcbBoundsBeforeLayout();let t=this._computePcbGlobalTransformBeforeLayout(),n=e.points.map((r)=>_o(t,r)),o=Hs(n);return{left:o.minX,right:o.maxX,top:o.maxY,bottom:o.minY}}doInitialPortMatching(){let e=this.getPrimitiveContainer()?.selectAll("port");if(!this.props.portHints)return;let t=l3n(e,this,this.props.portHints);if(!t)return;this.matchedPort=t,t.registerMatch(this)}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,n=t.coveredWithSolderMask??!1,o=!t.noSolderPaste&&!n&&this._getIsSmt(),{solderMaskMargin:r,solderPasteMargin:i}=t,s=(M,B=2)=>i!==void 0?Math.max(M+B*i,0):M*0.7;this.emitSolderMaskMarginWarning(n,r);let a=this.getSubcircuit(),c=this._getGlobalPcbPositionBeforeLayout(),l=this._computePcbGlobalTransformBeforeLayout(),u=(Zd(this._computePcbGlobalTransformBeforeLayout()).rotation.angle*180/Math.PI%360+360)%360,_=0.01,p=Math.abs(u)<_||Math.abs(u-180)<_||Math.abs(u-360)<_,m=Math.abs(u-90)<_||Math.abs(u-270)<_,A=Math.abs(u-360)<_?0:u,g=A,{maybeFlipLayer:f,isFlipped:y}=this._getPcbPrimitiveFlippedHelpers(),x=this.getPrimitiveContainer(),C=x?.props?.layer!==void 0?x?._parsedProps.layer:void 0,b=(M)=>C??f(M);if(y)A=(360-A+360)%360;let I=t.portHints?.map((M)=>M.toString())??[],v=null,P=this.parent?.pcb_component_id??this.getPrimitiveContainer()?.pcb_component_id;if(t.shape==="circle"){v=e.pcb_smtpad.insert({pcb_component_id:P,pcb_port_id:this.matchedPort?.pcb_port_id,layer:b(t.layer??"top"),shape:"circle",radius:t.radius,port_hints:I,is_covered_with_solder_mask:n,soldermask_margin:r,x:c.x,y:c.y,subcircuit_id:a?.subcircuit_id??void 0});let M=s(v.radius,1);if(o&&M>0)e.pcb_solder_paste.insert({layer:v.layer,shape:"circle",radius:M,x:v.x,y:v.y,pcb_component_id:v.pcb_component_id,pcb_smtpad_id:v.pcb_smtpad_id,subcircuit_id:a?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0})}else if(t.shape==="rect"){if(!p&&!m)v=e.pcb_smtpad.insert({pcb_component_id:P,pcb_port_id:this.matchedPort?.pcb_port_id,layer:b(t.layer??"top"),shape:"rotated_rect",width:t.width,height:t.height,corner_radius:t.cornerRadius??void 0,x:c.x,y:c.y,ccw_rotation:A,port_hints:I,is_covered_with_solder_mask:n,soldermask_margin:r,subcircuit_id:a?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0});else v=e.pcb_smtpad.insert({pcb_component_id:P,pcb_port_id:this.matchedPort?.pcb_port_id,layer:b(t.layer??"top"),shape:"rect",width:m?t.height:t.width,height:m?t.width:t.height,corner_radius:t.cornerRadius??void 0,port_hints:I,is_covered_with_solder_mask:n,soldermask_margin:r,x:c.x,y:c.y,subcircuit_id:a?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0});let B=s(v.width),T=s(v.height);if(o&&B>0&&T>0){if(v.shape==="rect")e.pcb_solder_paste.insert({layer:b(t.layer??"top"),shape:"rect",width:B,height:T,x:v.x,y:v.y,pcb_component_id:v.pcb_component_id,pcb_smtpad_id:v.pcb_smtpad_id,subcircuit_id:a?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0});else if(v.shape==="rotated_rect")e.pcb_solder_paste.insert({layer:b(t.layer??"top"),shape:"rotated_rect",width:B,height:T,x:v.x,y:v.y,ccw_rotation:v.ccw_rotation,pcb_component_id:v.pcb_component_id,pcb_smtpad_id:v.pcb_smtpad_id,subcircuit_id:a?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0})}}else if(t.shape==="rotated_rect"){let M=t.ccwRotation??0,B=(g+M+360)%360,T=y?(360-B+360)%360:B;v=e.pcb_smtpad.insert({pcb_component_id:P,pcb_port_id:this.matchedPort?.pcb_port_id,layer:b(t.layer??"top"),shape:"rotated_rect",width:t.width,height:t.height,corner_radius:t.cornerRadius??void 0,x:c.x,y:c.y,ccw_rotation:T,port_hints:I,is_covered_with_solder_mask:n,soldermask_margin:r,subcircuit_id:a?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0});let N=s(v.width),D=s(v.height);if(o&&N>0&&D>0)e.pcb_solder_paste.insert({layer:b(t.layer??"top"),shape:"rotated_rect",width:N,height:D,x:c.x,y:c.y,ccw_rotation:T,pcb_component_id:P,pcb_smtpad_id:v.pcb_smtpad_id,subcircuit_id:a?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0})}else if(t.shape==="polygon"){let M=t.points.map(({x:T,y:N})=>({x:Ke.parse(T),y:Ke.parse(N)})),B=M.map((T)=>_o(l,T));if(v=e.pcb_smtpad.insert({pcb_component_id:P,pcb_port_id:this.matchedPort?.pcb_port_id,layer:b(t.layer??"top"),shape:"polygon",points:B,port_hints:I,is_covered_with_solder_mask:n,soldermask_margin:r,subcircuit_id:a?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0}),o){let T=this._inflatedPcbSolderPaste??uzr({points:M,solderPasteMargin:i});for(let N of T)e.pcb_solder_paste.insert({shape:"polygon",layer:v.layer,points:N.points.map((D)=>_o(l,D)),holes:N.holes?.map((D)=>D.map((L)=>_o(l,L))),pcb_component_id:P??void 0,pcb_smtpad_id:v.pcb_smtpad_id,subcircuit_id:a?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0})}}else if(t.shape==="rotated_pill"){let M=(g+t.ccwRotation+360)%360,B=y?(360-M+360)%360:M;v=e.pcb_smtpad.insert({pcb_component_id:P,pcb_port_id:this.matchedPort?.pcb_port_id,layer:b(t.layer??"top"),shape:"rotated_pill",x:c.x,y:c.y,radius:t.radius,height:t.height,width:t.width,ccw_rotation:B,port_hints:I,is_covered_with_solder_mask:n,soldermask_margin:r,subcircuit_id:a?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0})}else if(t.shape==="pill")if(A!==0)v=e.pcb_smtpad.insert({pcb_component_id:P,pcb_port_id:this.matchedPort?.pcb_port_id,layer:b(t.layer??"top"),shape:"rotated_pill",x:c.x,y:c.y,radius:t.radius,height:t.height,width:t.width,ccw_rotation:A,port_hints:I,is_covered_with_solder_mask:n,soldermask_margin:r,subcircuit_id:a?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0});else v=e.pcb_smtpad.insert({pcb_component_id:P,pcb_port_id:this.matchedPort?.pcb_port_id,layer:b(t.layer??"top"),shape:"pill",x:c.x,y:c.y,radius:t.radius,height:t.height,width:t.width,port_hints:I,is_covered_with_solder_mask:n,soldermask_margin:r,subcircuit_id:a?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0});if(o&&(v?.shape==="pill"||v?.shape==="rotated_pill")){let M=s(v.width),B=s(v.height);if(M>0&&B>0){let T={x:v.x,y:v.y,width:M,height:B,radius:s(v.radius,1),layer:v.layer,pcb_component_id:v.pcb_component_id,pcb_smtpad_id:v.pcb_smtpad_id,subcircuit_id:v.subcircuit_id,pcb_group_id:v.pcb_group_id};if(v.shape==="rotated_pill")e.pcb_solder_paste.insert({...T,shape:"rotated_pill",ccw_rotation:v.ccw_rotation});else e.pcb_solder_paste.insert({...T,shape:"pill"})}}if(v)this.pcb_smtpad_id=v.pcb_smtpad_id}doInitialPcbPortAttachment(){if(this.root?.pcbDisabled)return;let{db:e}=this.root;e.pcb_smtpad.update(this.pcb_smtpad_id,{pcb_port_id:this.matchedPort?.pcb_port_id})}getAvailablePcbLayers(){let{maybeFlipLayer:e}=this._getPcbPrimitiveFlippedHelpers(),t=this.getPrimitiveContainer();return[(t?.props?.layer!==void 0?t?._parsedProps.layer:void 0)??e(this._parsedProps.layer??"top")]}_getPcbCircuitJsonBounds(){let{db:e}=this.root,t=e.pcb_smtpad.get(this.pcb_smtpad_id);if(t.shape==="rect")return{center:{x:t.x,y:t.y},bounds:{left:t.x-t.width/2,top:t.y+t.height/2,right:t.x+t.width/2,bottom:t.y-t.height/2},width:t.width,height:t.height};if(t.shape==="rotated_rect"){let{width:n,height:o,xExtent:r,yExtent:i}=vde({width:t.width,height:t.height,ccwRotationDegrees:t.ccw_rotation});return{center:{x:t.x,y:t.y},bounds:{left:t.x-r,right:t.x+r,top:t.y-i,bottom:t.y+i},width:n,height:o}}if(t.shape==="circle")return{center:{x:t.x,y:t.y},bounds:{left:t.x-t.radius,top:t.y-t.radius,right:t.x+t.radius,bottom:t.y+t.radius},width:t.radius*2,height:t.radius*2};if(t.shape==="polygon"){let n=t.points,o=n.map((l)=>l.x),r=n.map((l)=>l.y),i=Math.min(...o),s=Math.max(...o),a=Math.min(...r),c=Math.max(...r);return{center:{x:(i+s)/2,y:(a+c)/2},bounds:{left:i,top:c,right:s,bottom:a},width:s-i,height:c-a}}if(t.shape==="pill"){let n=t.width/2,o=t.height/2;return{center:{x:t.x,y:t.y},bounds:{left:t.x-n,top:t.y-o,right:t.x+n,bottom:t.y+o},width:t.width,height:t.height}}if(t.shape==="rotated_pill"){let{width:n,height:o,xExtent:r,yExtent:i}=vde({width:t.width,height:t.height,ccwRotationDegrees:t.ccw_rotation});return{center:{x:t.x,y:t.y},bounds:{left:t.x-r,right:t.x+r,top:t.y-i,bottom:t.y+i},width:n,height:o}}throw Error(`circuitJson bounds calculation not implemented for shape "${t.shape}"`)}_setPositionFromLayout(e){let{db:t}=this.root;t.pcb_smtpad.update(this.pcb_smtpad_id,{x:e.x,y:e.y});let n=t.pcb_solder_paste.list().find((o)=>o.pcb_smtpad_id===this.pcb_smtpad_id);if(n)t.pcb_solder_paste.update(n.pcb_solder_paste_id,{x:e.x,y:e.y});this.matchedPort?._setPositionFromLayout(e)}_moveCircuitJsonElements({deltaX:e,deltaY:t}){if(this.root?.pcbDisabled)return;let{db:n}=this.root;if(!this.pcb_smtpad_id)return;let o=n.pcb_smtpad.get(this.pcb_smtpad_id);if(o.shape==="rect"||o.shape==="circle"||o.shape==="rotated_rect"||o.shape==="pill"||o.shape==="rotated_pill")this._setPositionFromLayout({x:o.x+e,y:o.y+t});else if(o.shape==="polygon"){n.pcb_smtpad.update(this.pcb_smtpad_id,{points:o.points.map((i)=>({x:i.x+e,y:i.y+t}))});for(let i of n.pcb_solder_paste.list()){if(i.pcb_smtpad_id!==this.pcb_smtpad_id||i.shape!=="polygon")continue;n.pcb_solder_paste.update(i.pcb_solder_paste_id,{points:i.points.map(({x:s,y:a})=>({x:s+e,y:a+t})),holes:i.holes?.map((s)=>s.map(({x:a,y:c})=>({x:a+e,y:c+t})))})}let r={x:this._getPcbCircuitJsonBounds().center.x+e/2,y:this._getPcbCircuitJsonBounds().center.y+t/2};this.matchedPort?._setPositionFromLayout(r)}}},pzr=(e)=>e.type==="pcb_solder_paste"&&!e.pcb_smtpad_id&&(e.shape==="circle"||e.shape==="rect"||e.shape==="rotated_rect"),y3n=class e extends lr{pcb_solder_paste_id=null;isPcbPrimitive=!0;circuitJsonRotation=0;static fromCircuitJson(t){let n={pcbX:t.x,pcbY:t.y,layer:t.layer},o;if(t.shape==="circle")o={...n,shape:"circle",radius:t.radius};else o={...n,shape:"rect",width:t.width,height:t.height};let r=new e(o);if(t.shape==="rotated_rect")r.circuitJsonRotation=t.ccw_rotation;return r}_getPcbRotationBeforeLayout(){return this.circuitJsonRotation}get config(){return{componentName:"SolderPaste",zodProps:OSt}}getPcbSize(){let t=this._parsedProps;if(t.shape==="circle")return{width:t.radius*2,height:t.radius*2};return{width:t.width,height:t.height}}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let{db:t}=this.root,n=this._parsedProps,o=n.layer??"top";if(o!=="top"&&o!=="bottom")throw Error(`Invalid layer "${o}" for SolderPaste. Must be "top" or "bottom".`);let r=this._computePcbGlobalTransformBeforeLayout(),{maybeFlipLayer:i,isFlipped:s}=this._getPcbPrimitiveFlippedHelpers(),a=_o(r,{x:0,y:0}),c=Zd(r,!1,s).rotation.angle*180/Math.PI,l={...a,layer:i(o),pcb_component_id:this.parent?.pcb_component_id??this.getPrimitiveContainer()?.pcb_component_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0,subcircuit_id:this.getSubcircuit().subcircuit_id??void 0},h;if(n.shape==="circle")h=t.pcb_solder_paste.insert({...l,shape:"circle",radius:n.radius});else if(Math.abs(c)<0.00000001)h=t.pcb_solder_paste.insert({...l,shape:"rect",width:n.width,height:n.height});else h=t.pcb_solder_paste.insert({...l,shape:"rotated_rect",ccw_rotation:c,width:n.width,height:n.height});this.pcb_solder_paste_id=h.pcb_solder_paste_id}_moveCircuitJsonElements({deltaX:t,deltaY:n}){if(!this.pcb_solder_paste_id)return;let{db:o}=this.root,r=o.pcb_solder_paste.get(this.pcb_solder_paste_id);o.pcb_solder_paste.update(this.pcb_solder_paste_id,{x:r.x+t,y:r.y+n})}removePcbPrimitiveRender(){if(!this.pcb_solder_paste_id)return;this.root.db.pcb_solder_paste.delete(this.pcb_solder_paste_id),this.pcb_solder_paste_id=null}},Hst=class extends lr{isPrimitiveContainer=!0;schematic_symbol_id;userCoordinateToResizedSymbolTransformMat;schematicSymbolBoundsInSymbolLocalCoordinateSpace;get config(){return{componentName:"Symbol",zodProps:JSt}}hasExplicitSize(){let{_parsedProps:e}=this;return e.width!==void 0||e.height!==void 0}doInitialSymbolContainerRender(){if(this.root?.schematicDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,o=this.getParentNormalComponent()?._parsedProps?.kicadSymbolMetadata,r=e.schematic_symbol.insert({name:t.name,metadata:o?{kicad_symbol:o}:void 0});this.schematic_symbol_id=r.schematic_symbol_id}getSchematicSymbolBounds(){if(this.schematicSymbolBoundsInSymbolLocalCoordinateSpace)return this.schematicSymbolBoundsInSymbolLocalCoordinateSpace;return this._computeSchematicSymbolBounds(),this.schematicSymbolBoundsInSymbolLocalCoordinateSpace??null}getUserCoordinateToResizedSymbolTransform(){if(this.userCoordinateToResizedSymbolTransformMat)return this.userCoordinateToResizedSymbolTransformMat;this._computeUserCoordinateToResizedSymbolTransform();let e=this.getParentNormalComponent(),t=e?._parsedProps.schRotation??0;if(e&&t!==0){let n=e._getGlobalSchematicPositionBeforeLayout();this.userCoordinateToResizedSymbolTransformMat=Hi(Ii(n.x,n.y),Hb(t),Ii(-n.x,-n.y),this.userCoordinateToResizedSymbolTransformMat??fh())}return this.userCoordinateToResizedSymbolTransformMat??null}_computeSchematicSymbolBounds(){if(this.root?.schematicDisabled)return;let{db:e}=this.root,{viewbox:t}=this._parsedProps;if(t){let r=this._getGlobalSchematicPositionBeforeLayout();this.schematicSymbolBoundsInSymbolLocalCoordinateSpace={minX:r.x+t.minX,maxX:r.x+t.maxX,minY:r.y+t.minY,maxY:r.y+t.maxY};return}let n=[];for(let r of this.children){if(r.componentName==="Port"){let i=r.schematic_port_id;if(i){let s=e.schematic_port.get(i);if(s)n.push(s)}continue}if(!r.isSchematicPrimitive)continue;if(r.componentName==="SchematicLine"){let i=e.schematic_line.get(r.schematic_line_id);if(i)n.push(i)}else if(r.componentName==="SchematicRect"){let i=e.schematic_rect.get(r.schematic_rect_id);if(i)n.push(i)}else if(r.componentName==="SchematicCircle"){let i=e.schematic_circle.get(r.schematic_circle_id);if(i)n.push(i)}else if(r.componentName==="SchematicArc"){let i=e.schematic_arc.get(r.schematic_arc_id);if(i)n.push(i)}else if(r.componentName==="SchematicText"){let i=e.schematic_text.get(r.schematic_text_id);if(i)n.push(i)}else if(r.componentName==="SchematicPath"){let i=r.schematic_path_ids;if(i)for(let s of i){let a=e.schematic_path.get(s);if(a)n.push(a)}}}if(n.length===0)return;let o=Uue(n);this.schematicSymbolBoundsInSymbolLocalCoordinateSpace=o}_computeUserCoordinateToResizedSymbolTransform(){if(!this.hasExplicitSize())return;let e=this.getSchematicSymbolBounds();if(!e)return;let{_parsedProps:t}=this,{width:n,height:o}=t;if(n===void 0&&o===void 0)return;let r=e.maxX-e.minX,i=e.maxY-e.minY;if(r===0&&i===0)return;let s=(e.minX+e.maxX)/2,a=(e.minY+e.maxY)/2,c=n!==void 0&&r>0?n/r:1,l=o!==void 0&&i>0?o/i:1;if(t.fit==="contain"){let d=[];if(n!==void 0&&r>0)d.push(n/r);if(o!==void 0&&i>0)d.push(o/i);let u=d.length?Math.min(...d):1;c=u,l=u}let h=this._getGlobalSchematicPositionBeforeLayout();this.userCoordinateToResizedSymbolTransformMat=Hi(Ii(h.x,h.y),Fb(c,l),Ii(-s,-a))}},mzr=({elm:e,pinLabels:t,layer:n,readableRotation:o,anchorAlignment:r})=>{let i=e.text.replace(/[{}]/g,"").toLowerCase(),s=i;if(Array.isArray(t)){let c=parseInt(i.replace(/[^\d]/g,""),10)-1;s=String(t[c]??i)}else if(typeof t==="object")s=String(t[i]??i);let a=new Lst({anchorAlignment:r||"center",text:s??i,layer:n||"top",pcbX:isNaN(e.anchor_position.x)?0:e.anchor_position.x,pcbY:e.anchor_position.y,pcbRotation:o??0});return a._footprinterFontSize=e.font_size+0.2,a},_zr=(e,t)=>{let n=parseInt(e||"0",10),o;if(t!==void 0&&t!==null)o=t-n;else o=n;return(o%360+360)%360},RJ=(e)=>e??void 0,gzr=(e)=>{for(let t of e??[]){if(/^\d+$/.test(t))return Number(t);let n=/^pin(\d+)$/i.exec(t);if(n)return Number(n[1])}},Azr=(e)=>{switch(e){case"left":case"right":return e;case"top":return"up";case"bottom":return"down"}return null},fzr=["schematic_line","schematic_rect","schematic_circle","schematic_arc","schematic_path"],yzr=(e)=>fzr.includes(e.type),XAn=(e)=>{if(!("schematic_symbol_id"in e))return;if(typeof e.schematic_symbol_id==="string")return e.schematic_symbol_id;return},JB=({sourcePortOwner:e,componentName:t,componentRotation:n,footprinterString:o,pinLabels:r,pcbPinLabels:i,preserveSolderPaste:s=!1},a)=>{let c=a.filter((f)=>f.type==="source_port");if(e){let f=v4n(a);if(f!==void 0)e._importedInternallyConnectedPinNames=f}if(e&&c.length>0){e._importedSourcePorts=c;for(let f of e._getAllPortsFromChildren())f._markDirty("SourceRender")}let l=[],h=new Map,d=new Map,u=new Map,_=new Map,p=new Map,m=new Map;for(let f of a){if(f.type==="pcb_component"&&typeof f.source_component_id==="string")u.set(f.pcb_component_id,f.source_component_id);if(f.type==="source_port"){if(_.set(f.source_port_id,f),typeof f.pin_number==="number"&&typeof f.source_component_id==="string"){let y=p.get(f.source_component_id);if(!y)y=new Map,p.set(f.source_component_id,y);y.set(f.pin_number,f)}}}let A=(f,y)=>{let x=gzr(f);if(typeof y!=="string")return f;let C=u.get(y);if(typeof x!=="number"||!C)return f;let b=p.get(C)?.get(x);if(!b)return f;let I=Array.from(new Set([...f??[],...b.port_hints??[],b.name].filter((v)=>typeof v==="string"&&v.length>0)));if(I.length>0)return I;return f};for(let f of a){if(f.type!=="schematic_symbol")continue;let y=new Hst({name:f.name});h.set(f.schematic_symbol_id,y),l.push(y)}for(let f of a){if(!yzr(f))continue;let y=XAn(f),x=f.stroke_width;if(!y||typeof x!=="number"||!Number.isFinite(x)||m.has(y))continue;m.set(y,x)}for(let f of a){if(f.type!=="schematic_component")continue;d.set(f.schematic_component_id,f)}let g=(f,y)=>{let x=XAn(f);if(x===void 0&&"schematic_component_id"in f&&typeof f.schematic_component_id==="string")x=d.get(f.schematic_component_id)?.schematic_symbol_id;if(typeof x==="string"){let C=h.get(x);if(C){C.add(y);return}}l.push(y)};for(let f of a){let y;if("port_hints"in f){if(y=f.port_hints,"pcb_component_id"in f)y=A(f.port_hints,f.pcb_component_id)}let x;if(s&&f.type==="pcb_smtpad"&&!a.some((C)=>C.type==="pcb_solder_paste"&&C.pcb_smtpad_id===f.pcb_smtpad_id)){if(f.shape==="circle")x=-f.radius;else if(f.shape!=="polygon")x=-Math.min(f.width,f.height)/2}if(pzr(f))l.push(y3n.fromCircuitJson(f));else if(f.type==="pcb_soldermask_opening"){let C;if(f.shape==="polygon")C={shape:"polygon",layer:f.layer,points:f.points};else if(f.shape==="circle")C={shape:"circle",layer:f.layer,pcbX:f.x,pcbY:f.y,radius:f.radius};else{let b=0;if(f.shape==="rotated_rect")b=f.ccw_rotation;C={shape:"rect",layer:f.layer,pcbX:f.x,pcbY:f.y,width:f.width,height:f.height,pcbRotation:b}}l.push(new a3n(C))}else if(f.type==="pcb_smtpad"&&f.shape==="rect")l.push(new WB({pcbX:f.x,pcbY:f.y,layer:f.layer,shape:"rect",height:f.height,width:f.width,portHints:y,rectBorderRadius:f.rect_border_radius,solderPasteMargin:x}));else if(f.type==="pcb_smtpad"&&f.shape==="circle")l.push(new WB({pcbX:f.x,pcbY:f.y,layer:f.layer,shape:"circle",radius:f.radius,portHints:y,solderPasteMargin:x}));else if(f.type==="pcb_smtpad"&&f.shape==="pill")l.push(new WB({shape:"pill",height:f.height,width:f.width,radius:f.radius,portHints:y,pcbX:f.x,pcbY:f.y,layer:f.layer,solderPasteMargin:x}));else if(f.type==="pcb_smtpad"&&f.shape==="rotated_pill")l.push(new WB({shape:"rotated_pill",height:f.height,width:f.width,radius:f.radius,portHints:y,pcbX:f.x,pcbY:f.y,layer:f.layer,ccwRotation:f.ccw_rotation,solderPasteMargin:x}));else if(f.type==="pcb_smtpad"&&f.shape==="rotated_rect")l.push(new WB({pcbX:f.x,pcbY:f.y,layer:f.layer,shape:"rotated_rect",height:f.height,width:f.width,ccwRotation:f.ccw_rotation,cornerRadius:f.corner_radius,portHints:y,solderPasteMargin:x}));else if(f.type==="pcb_smtpad"&&f.shape==="polygon"){let C=new WB({shape:"polygon",points:f.points,portHints:y,layer:f.layer,coveredWithSolderMask:f.is_covered_with_solder_mask,solderMaskMargin:f.soldermask_margin}),b=a.filter((I)=>I.type==="pcb_solder_paste"&&I.shape==="polygon"&&I.pcb_smtpad_id===f.pcb_smtpad_id);if(s||b.length>0)C._inflatedPcbSolderPaste=b;l.push(C)}else if(f.type==="pcb_silkscreen_path")l.push(new A3n({layer:f.layer,route:f.route,strokeWidth:f.stroke_width}));else if(f.type==="pcb_copper_text")l.push(new $4n({text:f.text,pcbX:f.anchor_position.x,pcbY:f.anchor_position.y,pcbRotation:f.ccw_rotation,anchorAlignment:f.anchor_alignment,fontSize:f.font_size,layer:f.layer,mirrored:f.is_mirrored,knockout:f.is_knockout}));else if(f.type==="pcb_plated_hole"){if(f.shape==="circle")l.push(new UB({pcbX:f.x,pcbY:f.y,shape:"circle",holeDiameter:f.hole_diameter,outerDiameter:f.outer_diameter,portHints:y}));else if(f.shape==="circular_hole_with_rect_pad")l.push(new UB({pcbX:f.x,pcbY:f.y,shape:"circular_hole_with_rect_pad",holeDiameter:f.hole_diameter,rectPadHeight:f.rect_pad_height,rectPadWidth:f.rect_pad_width,portHints:y,rectBorderRadius:f.rect_border_radius,holeOffsetX:f.hole_offset_x,holeOffsetY:f.hole_offset_y}));else if(f.shape==="pill"||f.shape==="oval")l.push(new UB({pcbX:f.x,pcbY:f.y,shape:f.shape,holeWidth:f.hole_width,holeHeight:f.hole_height,outerWidth:f.outer_width,outerHeight:f.outer_height,portHints:y}));else if(f.shape==="pill_hole_with_rect_pad")l.push(new UB({pcbX:f.x,pcbY:f.y,shape:"pill_hole_with_rect_pad",holeShape:"pill",padShape:"rect",holeWidth:f.hole_width,holeHeight:f.hole_height,rectPadWidth:f.rect_pad_width,rectPadHeight:f.rect_pad_height,rectBorderRadius:f.rect_border_radius,portHints:y,holeOffsetX:f.hole_offset_x,holeOffsetY:f.hole_offset_y}));else if(f.shape==="rotated_pill_hole_with_rect_pad")l.push(new UB({pcbX:f.x,pcbY:f.y,shape:"pill_hole_with_rect_pad",holeShape:"pill",padShape:"rect",holeWidth:f.hole_width,holeHeight:f.hole_height,rectPadWidth:f.rect_pad_width,rectPadHeight:f.rect_pad_height,rectBorderRadius:f.rect_border_radius,portHints:y,holeOffsetX:f.hole_offset_x,holeOffsetY:f.hole_offset_y,pcbRotation:f.hole_ccw_rotation}));else if(f.shape==="hole_with_polygon_pad")l.push(new UB({pcbX:f.x,pcbY:f.y,shape:"hole_with_polygon_pad",holeShape:f.hole_shape||"circle",holeDiameter:f.hole_diameter,holeWidth:f.hole_width,holeHeight:f.hole_height,padOutline:f.pad_outline||[],holeOffsetX:f.hole_offset_x,holeOffsetY:f.hole_offset_y,portHints:y}))}else if(f.type==="pcb_keepout"&&f.shape==="circle")l.push(new kve({warningOnly:f.warning_only,allowTraces:f.allow_traces,allowPlacements:f.allow_placements,layers:f.layers.map((C)=>Lo.parse(C)),pcbX:f.center.x,pcbY:f.center.y,shape:"circle",radius:f.radius}));else if(f.type==="pcb_keepout"&&f.shape==="rect")l.push(new kve({warningOnly:f.warning_only,allowTraces:f.allow_traces,allowPlacements:f.allow_placements,layers:f.layers.map((C)=>Lo.parse(C)),pcbX:f.center.x,pcbY:f.center.y,shape:"rect",width:f.width,height:f.height}));else if(f.type==="pcb_hole"&&f.hole_shape==="circle")l.push(new YJ({pcbX:f.x,pcbY:f.y,diameter:f.hole_diameter}));else if(f.type==="pcb_hole"&&f.hole_shape==="rect")l.push(new YJ({pcbX:f.x,pcbY:f.y,shape:"rect",width:f.hole_width,height:f.hole_height}));else if(f.type==="pcb_hole"&&f.hole_shape==="pill")l.push(new YJ({pcbX:f.x,pcbY:f.y,shape:"pill",width:f.hole_width,height:f.hole_height}));else if(f.type==="pcb_hole"&&f.hole_shape==="oval")l.push(new YJ({pcbX:f.x,pcbY:f.y,shape:"oval",width:f.hole_width,height:f.hole_height}));else if(f.type==="pcb_hole"&&f.hole_shape==="rotated_pill")l.push(new YJ({pcbX:f.x,pcbY:f.y,shape:"pill",width:f.hole_width,height:f.hole_height,pcbRotation:f.ccw_rotation}));else if(f.type==="pcb_cutout"){if(f.shape==="rect")l.push(new sve({pcbX:f.center.x,pcbY:f.center.y,shape:"rect",width:f.width,height:f.height}));else if(f.shape==="circle")l.push(new sve({pcbX:f.center.x,pcbY:f.center.y,shape:"circle",radius:f.radius}));else if(f.shape==="polygon")l.push(new sve({shape:"polygon",points:f.points}))}else if(f.type==="pcb_silkscreen_text"){let C=_zr(n,f.ccw_rotation);if((o?.includes("pinrow")||o?.includes("headermodule"))&&f.text.includes("PIN"))l.push(mzr({elm:f,pinLabels:i??r??{},layer:f.layer,readableRotation:C,anchorAlignment:f.anchor_alignment}));else{let b=t||f.text;if(o?.includes("silkscreenlabel(")&&f.text!=="{REF}"&&f.text!=="{NAME}"&&f.text!=="{REFERENCE}")b=f.text;let I=f.anchor_position.x;if(Number.isNaN(I))I=0;let v=new Lst({anchorAlignment:f.anchor_alignment||"center",text:b,pcbX:I,pcbY:f.anchor_position.y,pcbRotation:C??0});v._footprinterFontSize=f.font_size+0.2,l.push(v)}}else if(f.type==="pcb_trace"){let C=new kst({route:f.route});for(let[b,I]of f.route.entries()){if(I.route_type!=="via")continue;if(a.some((v)=>v.type==="pcb_via"&&v.x===I.x&&v.y===I.y&&v.layers.includes(I.from_layer)&&v.layers.includes(I.to_layer)))C._materializedRouteViaIndices.add(b)}l.push(C)}else if(f.type==="pcb_via"){let C=vR.parse(f),b=f.layers??[],I=new c3n({pcbX:f.x,pcbY:f.y,holeDiameter:f.hole_diameter,outerDiameter:f.outer_diameter,fromLayer:f.from_layer??b[0],toLayer:f.to_layer??b[b.length-1],layers:b,netIsAssignable:f.net_is_assignable,tentedOnTop:C.tented_on_top,tentedOnBottom:C.tented_on_bottom});I._importedPcbTraceId=f.pcb_trace_id,l.push(I)}else if(f.type==="pcb_silkscreen_rect")l.push(new f3n({pcbX:f.center.x,pcbY:f.center.y,width:f.width,height:f.height,layer:f.layer,strokeWidth:f.stroke_width,filled:f.is_filled,cornerRadius:f.corner_radius}));else if(f.type==="pcb_silkscreen_circle")l.push(new _3n({pcbX:f.center.x,pcbY:f.center.y,radius:f.radius,layer:f.layer,strokeWidth:f.stroke_width}));else if(f.type==="pcb_silkscreen_line")l.push(new g3n({x1:f.x1,y1:f.y1,x2:f.x2,y2:f.y2,layer:f.layer,strokeWidth:f.stroke_width}));else if(f.type==="pcb_fabrication_note_text")l.push(new n3n({pcbX:f.anchor_position.x,pcbY:f.anchor_position.y,text:f.text,fontSize:f.font_size,anchorAlignment:f.anchor_alignment,color:f.color,font:f.font,layer:f.layer,pcbRotation:f.ccw_rotation}));else if(f.type==="pcb_fabrication_note_path")l.push(new e3n({route:f.route,strokeWidth:f.stroke_width,color:f.color,isFilled:f.is_filled,hasStroke:f.has_stroke,layer:f.layer}));else if(f.type==="pcb_fabrication_note_rect")l.push(new t3n({pcbX:f.center.x,pcbY:f.center.y,width:f.width,height:f.height,strokeWidth:f.stroke_width,isFilled:f.is_filled,color:f.color,layer:f.layer,cornerRadius:f.corner_radius,hasStroke:f.has_stroke,isStrokeDashed:f.is_stroke_dashed}));else if(f.type==="pcb_note_text")l.push(new s3n({pcbX:f.anchor_position.x,pcbY:f.anchor_position.y,text:f.text??"",fontSize:f.font_size,anchorAlignment:f.anchor_alignment,color:f.color,font:f.font}));else if(f.type==="pcb_note_rect")l.push(new i3n({pcbX:f.center.x,pcbY:f.center.y,width:f.width,height:f.height,strokeWidth:f.stroke_width,isFilled:f.is_filled,color:f.color,cornerRadius:f.corner_radius,hasStroke:f.has_stroke,isStrokeDashed:f.is_stroke_dashed}));else if(f.type==="pcb_note_path")l.push(new r3n({route:f.route,strokeWidth:f.stroke_width,color:f.color}));else if(f.type==="pcb_note_line")l.push(new o3n({x1:f.x1,y1:f.y1,x2:f.x2,y2:f.y2,strokeWidth:f.stroke_width,color:f.color,isDashed:f.is_dashed}));else if(f.type==="pcb_courtyard_rect")l.push(new Z4n({pcbX:f.center.x,pcbY:f.center.y,width:f.width,height:f.height,pcbRotation:f.ccw_rotation,layer:f.layer}));else if(f.type==="pcb_courtyard_circle")l.push(new q4n({pcbX:f.center.x,pcbY:f.center.y,radius:f.radius,layer:f.layer}));else if(f.type==="pcb_courtyard_outline")l.push(new J4n({outline:f.outline,layer:f.layer}));else if(f.type==="schematic_line")g(f,new Nrt({x1:f.x1,y1:f.y1,x2:f.x2,y2:f.y2,strokeWidth:RJ(f.stroke_width),color:f.color,isDashed:f.is_dashed}));else if(f.type==="schematic_rect")g(f,new p3n({schX:f.center.x,schY:f.center.y,width:f.width,height:f.height,rotation:f.rotation,strokeWidth:RJ(f.stroke_width),color:f.color,isFilled:f.is_filled,fillColor:f.fill_color,isDashed:f.is_dashed}));else if(f.type==="schematic_circle")g(f,new d3n({center:f.center,radius:f.radius,strokeWidth:RJ(f.stroke_width),color:f.color,isFilled:f.is_filled,fillColor:f.fill_color,isDashed:f.is_dashed}));else if(f.type==="schematic_arc")g(f,new h3n({center:f.center,radius:f.radius,startAngleDegrees:f.start_angle_degrees,endAngleDegrees:f.end_angle_degrees,direction:f.direction,strokeWidth:RJ(f.stroke_width),color:f.color,isDashed:f.is_dashed}));else if(f.type==="schematic_text")g(f,new m3n({schX:f.position.x,schY:f.position.y,text:f.text,fontSize:f.font_size,anchor:f.anchor,color:f.color,schRotation:f.rotation}));else if(f.type==="schematic_path")g(f,new u3n({points:f.points,strokeWidth:RJ(f.stroke_width),strokeColor:f.stroke_color,dashLength:f.dash_length,dashGap:f.dash_gap,isFilled:f.is_filled,fillColor:f.fill_color}));else if(f.type==="schematic_port"){let C=f.schematic_component_id;if(typeof C!=="string")continue;let b=d.get(C),I=b?.schematic_symbol_id,v;if(typeof I==="string")v=h.get(I);if(v&&b?.is_box_with_pins===!0&&f.center&&f.side_of_component){let P=f.distance_from_component_edge,M=Azr(f.side_of_component);if(!M)continue;let B=Z7(M),T=-1;if(f.facing_direction===M)T=1;let N={x:f.center.x+B.x*P*T,y:f.center.y+B.y*P*T},D=_.get(f.source_port_id),L=Array.from(new Set([f.display_pin_label,D?.name,...D?.port_hints??[]].filter((U)=>typeof U==="string"&&U.length>0))),H=f.schematic_port_id;if(f.pin_number)H=`pin${f.pin_number}`;let V=L[0]??f.source_port_id??H;v.add(new sd({pinNumber:f.pin_number,name:V,aliases:L,schX:f.center.x,schY:f.center.y,direction:M}));let O;if(typeof I==="string")O=RJ(m.get(I));v.add(new Nrt({x1:f.center.x,y1:f.center.y,x2:N.x,y2:N.y,strokeWidth:O,isDashed:!1}))}}}return l};var xzr=["Silkscreen","PcbNote","Courtyard","FabricationNote"];function T8e(e){let t=1/0,n=1/0,o=-1/0,r=-1/0,i=!1;for(let c of e)if(c.isPcbPrimitive&&!xzr.some((l)=>c.componentName.startsWith(l))){let l=c._getPcbLocalBoundsBeforeLayout(),d=[{x:l.left,y:l.bottom},{x:l.right,y:l.bottom},{x:l.right,y:l.top},{x:l.left,y:l.top}].map((p)=>_o(c._computePcbGlobalTransformBeforeLayout(),p)),u=d.map((p)=>p.x),_=d.map((p)=>p.y);t=Math.min(t,...u),n=Math.min(n,..._),o=Math.max(o,...u),r=Math.max(r,..._),i=!0}else if(c.children.length>0){let l=T8e(c.children);if(l.width>0||l.height>0)t=Math.min(t,l.minX),n=Math.min(n,l.minY),o=Math.max(o,l.maxX),r=Math.max(r,l.maxY),i=!0}if(!i)return{minX:0,minY:0,maxX:0,maxY:0,width:0,height:0};let s=o-t,a=r-n;if(s<0)s=0;if(a<0)a=0;return{minX:t,minY:n,maxX:o,maxY:r,width:s,height:a}}var D8e=(e)=>{let t=e.find((n)=>/^(pin)?\d+$/.test(n));if(!t)return null;return Number.parseInt(t.replace(/^pin/,""))};function Rrt(e,t){let n=D8e(e);if(!n)return null;let r=[...e.filter((i)=>i.toString()!==n.toString()&&i!==`pin${n}`&&i.trim()!==""),...t?.additionalAliases?.[`pin${n}`]??[]];return new sd({pinNumber:n,aliases:r})}function jk(e){if(!e)return[];if(Array.isArray(e))return e;return e.pins??[]}var x3n=(e)=>{for(let t of["leftSide","rightSide","topSide","bottomSide"])if(t in e&&typeof e[t]==="number")throw Error(`A number was specified for "${t}", you probably meant to use "size" not "side"`);return"leftSide"in e||"rightSide"in e||"topSide"in e||"bottomSide"in e},ave=(e)=>{if(!e||!x3n(e))return[];return[...jk(e.leftSide),...jk(e.rightSide),...jk(e.topSide),...jk(e.bottomSide)]},Czr=(e)=>{if(x3n(e))return{leftSize:jk(e.leftSide).length,rightSize:jk(e.rightSide).length,topSize:jk(e.topSide).length,bottomSize:jk(e.bottomSide).length};let{leftSize:t=0,rightSize:n=0,topSize:o=0,bottomSize:r=0}=e;return{leftSize:t,rightSize:n,topSize:o,bottomSize:r}},$Ie=0.4,C3n=0.1,jAn=0.1,bzr=(e)=>typeof e==="string"?e:e?.[0]??"",Izr=(e)=>Array.from(bzr(e)).length*C3n;function b3n(e){let t=e;return t.leftSide!==void 0||t.rightSide!==void 0||t.topSide!==void 0||t.bottomSide!==void 0}var Fst=(e)=>{let t=e.portDistanceFromEdge??0.4,n=e.schPortArrangement?Czr(e.schPortArrangement):null,o={left:0,right:0,top:0,bottom:0},r=e.pinCount??null;if(r===null)if(n)r=n.leftSize+n.rightSize+n.topSize;else throw Error("Could not determine pin count for the schematic box");if(r&&!n){let p=Math.floor(r/2);n={leftSize:r-p,rightSize:p,topSize:0,bottomSize:0}}if(!n)n={leftSize:0,rightSize:0,topSize:0,bottomSize:0};let i=({side:p,sideIndex:m,truePinIndex:A})=>{if(!e.schPortArrangement)return A+1;if(!b3n(e.schPortArrangement))return A+1;let g={left:"top-to-bottom",bottom:"left-to-right",right:"bottom-to-top",top:"right-to-left"}[p],f=e.schPortArrangement?.[`${p}Side`]?.direction??g,y=e.schPortArrangement?.[`${p}Side`]?.pins,x=m;if(f!==g)x=y.length-m-1;return $Y(y[x],e.pinLabels)},s=[],a=0,c=0;for(let p=0;p<n.leftSize;p++){let m=i({side:"left",sideIndex:p,truePinIndex:c}),A=e.numericSchPinStyle?.[`pin${m}`]??e.numericSchPinStyle?.[m];if(A?.topMargin)a+=A.topMargin;if(s.push({trueIndex:m-1,pinNumber:m,side:"left",distanceFromOrthogonalEdge:a}),A?.bottomMargin)a+=A.bottomMargin;if(p!==n.leftSize-1)a+=e.schPinSpacing;else o.left=a;c++}a=0;for(let p=0;p<n.bottomSize;p++){let m=i({side:"bottom",sideIndex:p,truePinIndex:c}),A=e.numericSchPinStyle?.[`pin${m}`]??e.numericSchPinStyle?.[m];if(A?.leftMargin)a+=A.leftMargin;if(s.push({trueIndex:m-1,pinNumber:m,side:"bottom",distanceFromOrthogonalEdge:a}),A?.rightMargin)a+=A.rightMargin;if(p!==n.bottomSize-1)a+=e.schPinSpacing;else o.bottom=a;c++}a=0;for(let p=0;p<n.rightSize;p++){let m=i({side:"right",sideIndex:p,truePinIndex:c}),A=e.numericSchPinStyle?.[`pin${m}`]??e.numericSchPinStyle?.[m];if(A?.bottomMargin)a+=A.bottomMargin;if(s.push({trueIndex:m-1,pinNumber:m,side:"right",distanceFromOrthogonalEdge:a}),A?.topMargin)a+=A.topMargin;if(p!==n.rightSize-1)a+=e.schPinSpacing;else o.right=a;c++}a=0;for(let p=0;p<n.topSize;p++){let m=i({side:"top",sideIndex:p,truePinIndex:c}),A=e.numericSchPinStyle?.[`pin${m}`]??e.numericSchPinStyle?.[m];if(A?.rightMargin)a+=A.rightMargin;if(s.push({trueIndex:m-1,pinNumber:m,side:"top",distanceFromOrthogonalEdge:a}),A?.leftMargin)a+=A.leftMargin;if(p!==n.topSize-1)a+=e.schPinSpacing;else o.top=a;c++}let l=e.schWidth;if(l===void 0){if(l=Math.max(o.top+$Ie,o.bottom+$Ie),e.pinLabels){if(s.filter((y)=>y.side==="left"||y.side==="right").some((y)=>e.pinLabels?.[`pin${y.pinNumber}`]||e.pinLabels?.[y.pinNumber]))l=Math.max(l,0.5)}let p=e.pinLabels?Math.max(...Object.values(e.pinLabels).map((g)=>g.length*C3n)):0,m=p>0?1.1:0;l=Math.max(l,p+m);let A={left:0,right:0};for(let g of s){if(g.side!=="left"&&g.side!=="right")continue;let f=e.pinLabels?.[`pin${g.pinNumber}`]??e.pinLabels?.[g.pinNumber];A[g.side]=Math.max(A[g.side],Izr(f))}l=Math.max(l,A.left+A.right+2*jAn)}let h=e.schHeight;if(!h)h=Math.max(o.left+$Ie,o.right+$Ie);if(e.pinLabels){let m=jAn,A=0.075,g=(B)=>{let T=e.pinLabels[`pin${B}`]??e.pinLabels[`${B}`];return T?T.length*0.13:0},f=s.filter((B)=>B.side==="left").map((B)=>({y:o.left/2-B.distanceFromOrthogonalEdge,len:g(B.pinNumber)})).filter((B)=>B.len>0),y=s.filter((B)=>B.side==="right").map((B)=>({y:-o.right/2+B.distanceFromOrthogonalEdge,len:g(B.pinNumber)})).filter((B)=>B.len>0),x=s.filter((B)=>B.side==="top").map((B)=>({x:o.top/2-B.distanceFromOrthogonalEdge,len:g(B.pinNumber)})).filter((B)=>B.len>0),C=s.filter((B)=>B.side==="bottom").map((B)=>({x:-o.bottom/2+B.distanceFromOrthogonalEdge,len:g(B.pinNumber)})).filter((B)=>B.len>0),b=(B,T)=>Math.min(B.maxX,T.maxX)>Math.max(B.minX,T.minX)&&Math.min(B.maxY,T.maxY)>Math.max(B.minY,T.minY),I=(B,T)=>({minX:-T/2+m,maxX:-T/2+m+B.len,minY:B.y-0.075,maxY:B.y+0.075}),v=(B,T)=>({minX:T/2-m-B.len,maxX:T/2-m,minY:B.y-0.075,maxY:B.y+0.075}),P=(B,T)=>({minX:B.x-0.075,maxX:B.x+0.075,minY:T/2-m-B.len,maxY:T/2-m}),M=(B,T)=>({minX:B.x-0.075,maxX:B.x+0.075,minY:-T/2+m,maxY:-T/2+m+B.len});if(!e.schHeight){let B=!1;for(let T of x)for(let N of C)if(b(P(T,h),M(N,h)))B=!0,h=Math.max(h,T.len+N.len+2*m);if(B){for(let T of x){let N=P(T,h);for(let D of f){let L=I(D,l);if(b(N,L))h=Math.max(h,2*(L.maxY+m+T.len))}for(let D of y){let L=v(D,l);if(b(N,L))h=Math.max(h,2*(L.maxY+m+T.len))}}for(let T of C){let N=M(T,h);for(let D of f){let L=I(D,l);if(b(N,L))h=Math.max(h,2*(m+T.len-L.minY))}for(let D of y){let L=v(D,l);if(b(N,L))h=Math.max(h,2*(m+T.len-L.minY))}}}}}let d={left:{x:-l/2-t,y:o.left/2},bottom:{x:-o.bottom/2,y:-h/2-t},right:{x:l/2+t,y:-o.right/2},top:{x:o.top/2,y:h/2+t}},u={left:{x:0,y:-1},right:{x:0,y:1},top:{x:-1,y:0},bottom:{x:1,y:0}},_=s.map((p)=>{let{distanceFromOrthogonalEdge:m,side:A}=p,g=d[A],f=u[A];return{x:g.x+m*f.x,y:g.y+m*f.y,...p}});return{getPortPositionByPinNumber(p){let m=_.find((A)=>A.pinNumber.toString()===p.toString());if(!m)return null;return m},getSize(){return{width:l,height:h}},getSizeIncludingPins(){return{width:l+(n.leftSize||n.rightSize?0.4:0),height:h+(n.topSize||n.bottomSize?0.4:0)}},pinCount:r}},oue=(e,t)=>{if(!e)return;let n={};for(let[o,r]of Object.entries(e)){let i=$Y(o,t),s=r.marginLeft??r.leftMargin,a=r.marginRight??r.rightMargin,c=r.marginTop??r.topMargin,l=r.marginBottom??r.bottomMargin,d={...n[`pin${i}`]??{}};if(s!==void 0)d.leftMargin=Ke.parse(s);if(a!==void 0)d.rightMargin=Ke.parse(a);if(c!==void 0)d.topMargin=Ke.parse(c);if(l!==void 0)d.bottomMargin=Ke.parse(l);n[`pin${i}`]=d}return n},vzr=(e)=>e==="schematic_symbol"||e==="schematic_component"||e==="schematic_line"||e==="schematic_rect"||e==="schematic_circle"||e==="schematic_arc"||e==="schematic_text"||e==="schematic_path",Qrt=(e)=>Array.isArray(e)&&e.length>0&&e.some((t)=>vzr(t.type)),krt=(e)=>typeof e?.x==="number"&&Number.isFinite(e.x)&&typeof e.y==="number"&&Number.isFinite(e.y),Fnt=(e,t)=>({x:e.x-t.x,y:e.y-t.y}),Szr=(e)=>e.type==="schematic_component"||e.type==="schematic_port"||e.type==="schematic_line"||e.type==="schematic_rect"||e.type==="schematic_circle"||e.type==="schematic_arc"||e.type==="schematic_text"||e.type==="schematic_path",Pzr=(e)=>{let t=e.find((r)=>r.type==="schematic_component"&&krt(r.center));if(t)return t.center;let n=e.filter(Szr);if(n.length===0)return null;let o=Uue(n);if(!Number.isFinite(o.minX)||!Number.isFinite(o.maxX)||!Number.isFinite(o.minY)||!Number.isFinite(o.maxY))return null;return{x:(o.minX+o.maxX)/2,y:(o.minY+o.maxY)/2}},Ezr=(e,t)=>{switch(e.type){case"schematic_component":case"schematic_port":case"schematic_rect":case"schematic_circle":case"schematic_arc":return krt(e.center)?{...e,center:Fnt(e.center,t)}:e;case"schematic_line":return{...e,x1:e.x1-t.x,y1:e.y1-t.y,x2:e.x2-t.x,y2:e.y2-t.y};case"schematic_text":return krt(e.position)?{...e,position:Fnt(e.position,t)}:e;case"schematic_path":return{...e,points:e.points.map((n)=>Fnt(n,t))};default:return e}},Mzr=(e)=>{let t=Pzr(e);if(!t)return[...e];if(t.x===0&&t.y===0)return[...e];return e.map((n)=>Ezr(n,t))},KAn=(e)=>e.type==="schematic_line"||e.type==="schematic_rect"||e.type==="schematic_circle"||e.type==="schematic_arc"||e.type==="schematic_text"||e.type==="schematic_path",$An=(e,t)=>{if(!(t in e))return;let n=e[t];return typeof n==="string"?n:void 0},wzr=(e)=>{let t=e.filter((u)=>u.type==="schematic_symbol"),n=e.filter((u)=>u.type==="schematic_component"),o=n.find((u)=>typeof u.schematic_symbol_id==="string")?.schematic_symbol_id??t[0]?.schematic_symbol_id,r=(o?n.find((u)=>u.schematic_symbol_id===o):void 0)??n[0],i=r?.schematic_component_id,s=typeof r?.source_component_id==="string"?r.source_component_id:void 0,a=(o?t.find((u)=>u.schematic_symbol_id===o):void 0)??t[0],c=new Set,l=new Set,h=[],d=(u)=>{if(!u||l.has(u))return;l.add(u),h.push(u)};d(a),d(r);for(let u of e){if(u.type!=="schematic_port")continue;if(!i||u.schematic_component_id!==i)continue;if(d(u),typeof u.source_port_id==="string")c.add(u.source_port_id)}for(let u of e){if(!KAn(u))continue;let _=$An(u,"schematic_symbol_id"),p=$An(u,"schematic_component_id");if(o&&_===o||i&&p===i||!o&&!i)d(u)}for(let u of e){if(u.type!=="source_port")continue;if(c.has(u.source_port_id)||s&&u.source_component_id===s)d(u)}if(h.length>0)return h;return e.filter((u)=>u.type==="schematic_symbol"||u.type==="schematic_component"||u.type==="schematic_port"||KAn(u))},jue=(e,t)=>{let n=t.split("."),o=e;for(let r of n.reverse()){if(!o||o.name!==r)return!1;o=o.parent}return!0},N8e=(e)=>{let t=e._parsedProps.cadModel,o=[...e.componentName==="AssemblyPrintedPart"?e.printedPartPlan?.referencePlanes??(t&&typeof t==="object"&&"jscad"in t?I3n.resolveReferencePlanes(t.jscad).referencePlanes:[]):[],...e.children.filter((i)=>i.componentName==="AssemblyReferenceSurface").map((i)=>i.referenceFrame)],r=new Set;for(let i of o){if(r.has(i.name))throw Error(`Part "${e.name}" has duplicate reference surface "${i.name}"`);r.add(i.name)}return o},Lrt=(e)=>{let t=e.parent;while(t){if(t.componentName==="AssemblyDevice")return t;t=t.parent}return e.root.firstChild},SG=(e)=>{let t=Lrt(e);return[t,...t.getDescendants()].filter((n)=>Lrt(n)===t)},znt=(e)=>e.componentName==="AssemblyMotor"||e.componentName==="AssemblyPart"||e.componentName==="AssemblyPrintedPart",zst=(e)=>e.componentName==="AssemblyPrintedPart",kde=(e)=>e.componentName==="AssemblyMotor",Ok=()=>[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],v3n=(e)=>{let t=e[10]<0,n=t?-1:1;return{position:{x:e[12],y:e[13],z:e[14]},pcbRotation:Math.atan2(n*e[1],n*e[0])*180/Math.PI,layer:t?"bottom":"top"}},Ont=({origin:e,normal:t,xAxis:n})=>{let o=hm.vec3.cross([0,0,0],t,n);return hm.mat4.targetTo(Ok(),e,hm.vec3.subtract([0,0,0],e,t),o)},S3n=(e,t)=>{if(!kde(e)){let n=N8e(e).find((o)=>o.name===t);if(!n)throw Error(`Part "${e.name}" has no reference face "${t}"`);return n}if(t!=="backface"&&t!=="frontface")throw Error(`Motor "${e.name}" has no mounting face "${t}"; use frontface or backface`);return{name:t,origin:[0,0,t==="backface"?-e.motorModel.bodyLength:0],normal:[0,0,t==="backface"?-1:1],xAxis:[1,0,0]}},qAn=(e,t,n)=>{let o=t.lastIndexOf("."),r=t.slice(0,o),i=t.slice(o+1);if(o<1||!i)throw Error(`"${e.name}" mountedTo must name a part and face, e.g. "SPACER.board"`);let s=n.filter((c)=>jue(c,r));if(s.length!==1)throw Error(`"${e.name}" mountedTo "${t}" matched ${s.length} assembly parts; expected exactly one in the assembly device`);let a=s[0];return{part:a,face:S3n(a,i)}},Bzr=(e,t)=>{let n=Ok();if(zst(e))return n;if(!kde(e)){if(!t)throw Error(`Part "${e.name}" has no inherited placement`);if(hm.mat4.translate(n,n,[t.position.x,t.position.y,t.position.z]),hm.mat4.rotateZ(n,n,t.pcbRotation*Math.PI/180),t.layer==="bottom")hm.mat4.rotateY(n,n,Math.PI);return n}switch(e._parsedProps.shaftFacingDirection){case"x+":return hm.mat4.rotateY(n,n,Math.PI/2);case"x-":return hm.mat4.rotateY(n,n,-Math.PI/2);case"y+":return hm.mat4.rotateX(n,n,-Math.PI/2);case"y-":return hm.mat4.rotateX(n,n,Math.PI/2);case"z-":return hm.mat4.rotateY(n,n,Math.PI);default:return n}},uG=(e)=>{let t=SG(e),n=t.filter(znt),o=new Map,r=new Map,i=new Map,s,a=(h,d=[])=>{if(d.includes(h))throw Error(`Assembly mounting cycle: ${[...d,h].map((A)=>A.name).join(" -> ")}`);let u=o.get(h);if(u)return u;let _,p=h,m=h.componentName==="AssemblyPart"?Kue(h):void 0;if(m&&znt(m))_=[...a(m,[...d,h])],p=r.get(m);else{let A=h.componentName==="AssemblyPart"?Ost(h,[],(g)=>{let f=a(g,[...d,h]);return p=r.get(g),v3n(f)}):void 0;_=Bzr(h,A)}if((kde(h)||zst(h))&&h._parsedProps.mountedTo){let{part:A,face:g}=qAn(h,h._parsedProps.mountedTo,n),f=a(A,[...d,h]),y=S3n(h,h._parsedProps.mountFace),x=Ont(g);hm.mat4.translate(x,x,[0,0,h._parsedProps.mountGap??0]),hm.mat4.rotateX(x,x,Math.PI);let C=hm.mat4.invert(Ok(),Ont(y));_=hm.mat4.multiply(Ok(),f,hm.mat4.multiply(Ok(),x,C)),p=r.get(A)}return r.set(h,p),o.set(h,_),_};for(let h of n)a(h);let c=new Set(n.filter((h)=>kde(h)&&h._parsedProps.mountedTo).map((h)=>r.get(h))),l=new Set;for(let h of t.filter((d)=>d.componentName==="Board")){if(!h._parsedProps.mountedTo)continue;let{part:d,face:u}=qAn(h,h._parsedProps.mountedTo,n),_=r.get(d);if(l.has(_))throw Error(`Assembly "${_.name}" has multiple mounted boards; only one board may determine its placement`);if(l.add(_),kde(_)&&!["z+","z-"].includes(_._parsedProps.shaftFacingDirection??"z+"))throw Error(`Board "${h.name}" cannot mount to motor "${_.name}" facing ${_._parsedProps.shaftFacingDirection}: rotated PCB boards are not yet supported`);let p=h.root.db.pcb_board.get(h.pcb_board_id);if(!p)throw Error(`Mounted board "${h.name}" has no PCB geometry`);let m=hm.mat4.multiply(Ok(),o.get(d),Ont(u));if(Math.abs(Math.abs(m[10])-1)>0.000001)throw Error(`Board "${h.name}" cannot mount to a tilted reference face; its PCB plane must remain parallel to XY`);if(c.has(_)){if(h._parsedProps.mountRotation||h._parsedProps.mountRotationAnchor)throw Error(`Board "${h.name}" mountRotation and mountRotationAnchor are not supported in a face-mounted motor assembly; set the target reference face's in-plane X direction instead`);let C=m[10]<0?"top_layer_toward_mount_face":"bottom_layer_toward_mount_face";if(h._parsedProps.mountOrientation&&h._parsedProps.mountOrientation!==C)throw Error(`Board "${h.name}" mountOrientation conflicts with its resolved mounting face`)}let A=h._computePcbGlobalTransformBeforeLayout(),g=Math.atan2(A.b,A.a)-Math.atan2(m[1],m[0]),f=hm.mat4.fromZRotation(Ok(),g),y=hm.vec3.transformMat4([0,0,0],[m[12],m[13],m[14]],f),x=m[10]>0?1:-1;f[12]=p.center.x-y[0],f[13]=p.center.y-y[1],f[14]=-x*(p.thickness/2+(h._parsedProps.mountGap??0))-y[2],i.set(_,g);for(let[C,b]of o)if(r.get(C)===_)o.set(C,hm.mat4.multiply(Ok(),f,b));if(e===h||znt(e)&&r.get(e)===_)s=p.subcircuit_id}return{transforms:o,roots:r,yawByRoot:i,subcircuitId:s,motorMountRoots:c}},Tzr=(e)=>{if(!SG(e).some((c)=>c.componentName==="AssemblyPrintedPart"))return;let{transforms:n,roots:o,yawByRoot:r,subcircuitId:i}=uG(e);if(![...o].some(([c,l])=>zst(c)&&l===e))return;let s=n.get(e),a=e._parsedProps.shaftFacingDirection==="z-";return{position:{x:s[12],y:s[13],z:s[14]},pcbRotation:(r.get(e)??0)*180/Math.PI,layer:a?"bottom":"top",subcircuit_id:i}},Dzr=(e)=>{let t=e._parsedProps.mountedTo;if(!t)return!1;let n=t.slice(0,t.lastIndexOf("."));return SG(e).some((o)=>(o.componentName==="AssemblyPrintedPart"||o.componentName==="AssemblyPart")&&jue(o,n))},Nzr=(e,t)=>{let n=e.componentName==="AssemblyScreen"?"assembly.screen":"assembly.subassembly",o=e.root?.firstChild;if(!o)throw Error(`Could not resolve ${n} "${e.name}" because the circuit has no root component`);let r=o,i=e.parent;while(i){if(i.componentName==="AssemblyDevice"){r=i;break}i=i.parent}let s=RO(wve(t,e),r,{adapter:FZ});if(s.length!==1)throw Error(`${n} "${e.name}" connectsTo selector "${t}" matched ${s.length} components; expected exactly one`);let a=s[0];if(!a.pcb_component_id&&a.componentName!=="AssemblyScreen"&&a.componentName!=="AssemblyPart"&&a.componentName!=="AssemblySubassembly")throw Error(`${n} "${e.name}" connectsTo selector "${t}" matched ${a.getString()}, but it has no PCB component`);return a},Hrt=(e)=>e.componentName==="AssemblyPart"||e.componentName==="AssemblyPrintedPart"||e.componentName==="AssemblyScreen"||e.componentName==="AssemblySubassembly",Kue=(e)=>{let t=e.parent;while(t){if(Hrt(t))return t;if(t.componentName==="AssemblyDevice"||t.pcb_component_id)return;t=t.parent}return},zZ=(e,t=[])=>{if(t.includes(e))throw Error(`Assembly attachment cycle: ${[...t,e].map((n)=>n.name).join(" -> ")}`);if(e.componentName==="AssemblyPrintedPart"||e.componentName==="AssemblyPart"){let n=e,{transforms:o,subcircuitId:r}=uG(n),i=o.get(n);if(n.componentName==="AssemblyPart")return{...v3n(i),worldTransform:Math.abs(Math.abs(i[10])-1)>0.000001?i:void 0,subcircuit_id:r};return{worldTransform:i,position:{x:i[12],y:i[13],z:i[14]},pcbRotation:0,layer:"top",subcircuit_id:r}}return Ost(e,t)},Ost=(e,t=[],n)=>{if(t.includes(e))throw Error(`Assembly attachment cycle: ${[...t,e].map((y)=>y.name).join(" -> ")}`);let o=[...t,e],r=e.componentName==="AssemblyScreen"?Nzr(e,e._parsedProps.connectsTo):Kue(e);if(!r)return{position:{x:0,y:0,z:0},pcbRotation:0,layer:"top"};if(n&&(r.componentName==="AssemblyPart"||r.componentName==="AssemblyPrintedPart"))return n(r);if(n&&Hrt(r))return Ost(r,o,n);if(Hrt(r))return zZ(r,o);let i=e.root.db,s=i.pcb_component.get(r.pcb_component_id);if(!s)throw Error(`Assembly target "${r.name}" has no PCB component`);let a=r._getBoard();if(!a)throw Error(`Assembly target "${r.name}" is not on a board`);let l=(a.pcb_board_id?i.pcb_board.get(a.pcb_board_id):null)?.thickness??a.boardThickness,h=s.layer==="bottom"?"bottom":"top",d=h==="bottom",u=s.rotation??0,_=r instanceof Xl?r._getPcbComponentInsertionAxisDirection(h,u):void 0,p=_?Math.hypot(_.x,_.y):0,m=s.cable_insertion_center??s.center,A={x:m.x-s.center.x,y:m.y-s.center.y},g=Math.hypot(A.x,A.y),f=Bu(_&&p>0.000000001?Math.atan2(-_.x,_.y)*180/Math.PI:g>0.000000001?Math.atan2(-A.x,A.y)*180/Math.PI:u);return{position:{...m,z:d?-l/2:l/2},pcbRotation:f,layer:h,subcircuit_id:s.subcircuit_id}},Rzr=class extends lr{isPrimitiveContainer=!0;doInitialAssignNameToUnnamedComponents(){if(Kue(this))return;super.doInitialAssignNameToUnnamedComponents()}get config(){return{componentName:"CadAssembly",zodProps:LPt}}},Qzr=(e,t)=>{let n=e.replace(/\/+$/,""),o=t.replace(/^\/+/,"");return`${n}/${o}`},Vst=(e,t)=>{if(!t)return e;if(!e.startsWith("/"))return e;try{let n=new URL(t);if(n.pathname!=="/"&&e.startsWith(n.pathname))return new URL(e,n.origin).toString();return Qzr(t,e)}catch(n){return e}},Yst=(e)=>{if(!e)return null;let t=e.match(/#ext=(\w+)$/);if(t)return t[1].toLowerCase();let o=e.split("?")[0].split("#")[0],r=o.split("/").pop()??o;if(!r.includes("."))return null;return r.split(".").pop()?.toLowerCase()??null},Frt=(e)=>{let t=e.replace(/#ext=\w+$/,"");switch(Yst(e)){case"obj":return{objUrl:t};case"gltf":return{gltfUrl:t};case"glb":return{glbUrl:t};case"step":case"stp":return{stepUrl:t};case"wrl":case"vrml":return{wrlUrl:t};default:return{stlUrl:t}}},P3n=(e)=>{let t=Math.asin(Math.max(-1,Math.min(1,-e[2])));return(Math.abs(Math.cos(t))>0.00000001?[Math.atan2(e[6],e[10]),t,Math.atan2(e[1],e[0])]:[0,t,Math.atan2(-e[4],e[5])]).map((o)=>o===0?0:o)},lT=(e,t,n)=>{let o=C3.parse(typeof t==="string"?{}:t),r=n.layer==="bottom",i=Vy.parse(o.positionOffset??{x:0,y:0,z:0}),s=Hi(Ii(n.position.x,n.position.y),Yg(n.pcbRotation*Math.PI/180),r?ZR():fh()),a=_o(s,i),c=o.pcbRotationOffset??o.rotationOffset??0,l=typeof c==="number"?{x:0,y:0,z:c}:{x:ii.parse(c.x),y:ii.parse(c.y),z:ii.parse(c.z)},h=(m)=>Vst(m,e.root?.platform?.projectBaseUrl),d,u;if(n.worldTransform){let m=lZ.vec3.transformMat4([0,0,0],[i.x,i.y,i.z+(o.zOffsetFromSurface??0)],n.worldTransform);d={x:m[0],y:m[1],z:m[2]};let A=[...n.worldTransform];lZ.mat4.rotateZ(A,A,l.z*Math.PI/180),lZ.mat4.rotateY(A,A,l.y*Math.PI/180),lZ.mat4.rotateX(A,A,l.x*Math.PI/180);let g=P3n(A).map((f)=>f*180/Math.PI);u={x:g[0],y:g[1],z:Bu(g[2])}}let _=typeof t==="string"?{footprinter_string:t}:{model_stl_url:"stlUrl"in t?h(t.stlUrl):void 0,model_obj_url:"objUrl"in t?h(t.objUrl):void 0,model_mtl_url:"mtlUrl"in t&&t.mtlUrl?h(t.mtlUrl):void 0,model_gltf_url:"gltfUrl"in t?h(t.gltfUrl):void 0,model_glb_url:"glbUrl"in t?h(t.glbUrl):void 0,model_step_url:t.stepUrl?h(t.stepUrl):void 0,model_wrl_url:"wrlUrl"in t?h(t.wrlUrl):void 0,model_jscad:"jscad"in t?t.jscad:void 0};return e.root.db.cad_component.insert({..._,position:d??{...a,z:n.position.z+(r?-1:1)*(i.z+(o.zOffsetFromSurface??0))},rotation:u??{x:l.x,y:(r?180:0)+l.y,z:Bu((r?-1:1)*(n.pcbRotation+l.z))},layer:n.layer,source_component_id:e.source_component_id,color:e.componentName==="AssemblyPrintedPart"?e._parsedProps.color:void 0,subcircuit_id:n.subcircuit_id,model_origin_position:o.modelOriginPosition??{x:0,y:0,z:0},model_unit_to_mm_scale_factor:o.modelUnitToMmScale??1,model_object_fit:"contain_within_bounds",model_board_normal_direction:o.modelBoardNormalDirection,size:o.size,anchor_alignment:"center",show_as_translucent_model:o.showAsTranslucentModel??!1}).cad_component_id},kzr=(e)=>{let t=Kue(e);if(!t)return!1;if(e.root?.pcbDisabled||!t.source_component_id)return!0;let n=zZ(t),o=typeof e._parsedProps==="string"?{modelUrl:e._parsedProps}:e._parsedProps;if(!o)return!0;let{pcbX:r,pcbY:i}=e.getResolvedPcbPositionProp(),a={...C3.parse({...o,positionOffset:o.positionOffset??Vy.parse({x:r,y:i,z:o.pcbZ??0})}),...Frt(o.modelUrl)};return e.cad_component_id=lT(t,a,n),!0},Vnt=an([ge(),k()]),JAn=Ee({x:Vnt,y:Vnt,z:Vnt}),Lzr=class extends lr{doInitialAssignNameToUnnamedComponents(){if(Kue(this))return;super.doInitialAssignNameToUnnamedComponents()}get config(){return{componentName:"CadModel",zodProps:FPt}}doInitialCadModelRender(){if(kzr(this))return;let e=this._findParentWithPcbComponent();if(!e)return;if(!e.pcb_component_id)return;let{db:t}=this.root,{boardThickness:n=0}=e._getBoard()??{},o=e._getPcbCircuitJsonBounds(),r=t.pcb_component.get(e.pcb_component_id),i=this._parsedProps;if(!i||typeof i.modelUrl!=="string"&&typeof i.stepUrl!=="string")return;let s=e._computePcbGlobalTransformBeforeLayout(),c=Zd(s).rotation.angle*180/Math.PI,l=i.pcbRotationOffset??i.rotationOffset,h=JAn.parse({x:0,y:0,z:0});if(typeof l==="number")h.z=Number(l);else if(typeof l==="object"){let C=JAn.parse(l);h.x=Number(C.x),h.y=Number(C.y),h.z=Number(C.z)}let{pcbX:d,pcbY:u}=this.getResolvedPcbPositionProp(),_=Vy.parse({x:d,y:u,z:i.pcbZ??0,...typeof i.positionOffset==="object"?i.positionOffset:{}}),p=i.zOffsetFromSurface!==void 0?Ke.parse(i.zOffsetFromSurface):0,m=e.props.layer==="bottom"?"bottom":"top",A=i.modelUrl?Yst(i.modelUrl):void 0,g=i.modelUrl?.replace(/#ext=\w+$/,""),f={};if(A==="stl")f.model_stl_url=this._addCachebustToModelUrl(g);else if(A==="obj")f.model_obj_url=this._addCachebustToModelUrl(g);else if(A==="gltf")f.model_gltf_url=this._addCachebustToModelUrl(g);else if(A==="glb")f.model_glb_url=this._addCachebustToModelUrl(g);else if(A==="step"||A==="stp")f.model_step_url=this._addCachebustToModelUrl(g);else if(A==="wrl"||A==="vrml")f.model_wrl_url=this._addCachebustToModelUrl(g);else f.model_stl_url=this._addCachebustToModelUrl(g);if(i.stepUrl){let C=this._addCachebustToModelUrl(i.stepUrl);if(C)f.model_step_url=C}let y={position:{x:o.center.x+Number(_.x),y:o.center.y+Number(_.y),z:(m==="bottom"?-n/2:n/2)+(m==="bottom"?-p:p)+Number(_.z)},rotation:frt({layer:m,pcbCcwRotationDegrees:c,modelCcwRotationOffsetDegrees:{x:Number(h.x),y:Number(h.y),z:Number(h.z)}})};y=xrt(e,y);let x=t.cad_component.insert({...y,pcb_component_id:e.pcb_component_id,model_board_normal_direction:i.modelBoardNormalDirection,model_origin_alignment:"center_of_component_on_board_surface",anchor_alignment:"center_of_component_on_board_surface",model_origin_position:i.modelOriginPosition,size:i.size?Vy.parse(i.size):void 0,source_component_id:e.source_component_id,model_unit_to_mm_scale_factor:typeof i.modelUnitToMmScale==="number"?i.modelUnitToMmScale:void 0,show_as_translucent_model:i.showAsTranslucentModel??e._parsedProps.showAsTranslucentModel,...f});this.cad_component_id=x.cad_component_id}_findParentWithPcbComponent(){let e=this.parent;while(e&&!e.pcb_component_id)e=e.parent;return e}_addCachebustToModelUrl(e){if(!e)return e;let t=this.root?.platform?.projectBaseUrl,n=Vst(e,t);if(!n.includes("modelcdn.tscircuit.com"))return n;let o=this.root?.getClientOrigin()??"";return`${n}${n.includes("?")?"&":"?"}cachebust_origin=${encodeURIComponent(o)}`}},Hzr=E3n.default("tscircuit:core:footprint"),R8e=class extends lr{get config(){return{componentName:"Footprint",zodProps:qSt}}doInitialPcbFootprintLayout(){if(this.root?.pcbDisabled)return;let e=this.children.filter((d)=>d.componentName==="Constraint");if(e.length===0)return;let{isFlipped:t}=this._getPcbPrimitiveFlippedHelpers(),n=(d)=>{if(t){if("left"in d&&"right"in d)return{...d,left:d.right,right:d.left}}return d},o=e.flatMap((d)=>d._getAllReferencedComponents().componentsWithSelectors).map(({component:d,selector:u,componentSelector:_,edge:p})=>({component:d,selector:u,componentSelector:_,edge:p,bounds:d._getPcbCircuitJsonBounds()}));if(o.some((d)=>d.edge))throw Error("edge constraints not implemented yet for footprint layout, contributions welcome!");function r(d){return o.find(({selector:u})=>u===d)}let i=new fae,s={};function a(d){if(!(d in s))s[d]=new sQ(d),i.addEditVariable(s[d],Oh.weak);return s[d]}for(let{selector:d,bounds:u}of o){let _=a(`${d}_x`),p=a(`${d}_y`);i.suggestValue(_,u.center.x),i.suggestValue(p,u.center.y)}for(let d of e){let u=d._parsedProps;if("xDist"in u){let{xDist:_,left:p,right:m,edgeToEdge:A,centerToCenter:g}=n(u),f=a(`${p}_x`),y=a(`${m}_x`),x=r(p)?.bounds,C=r(m)?.bounds;if(g){let b=new Md(y,[-1,f]);i.addConstraint(new XA(b,tm.Eq,u.xDist,Oh.required))}else if(A){let b=new Md(y,-C.width/2,[-1,f],-x.width/2);i.addConstraint(new XA(b,tm.Eq,u.xDist,Oh.required))}}else if("yDist"in u){let{yDist:_,top:p,bottom:m,edgeToEdge:A,centerToCenter:g}=u,f=a(`${p}_y`),y=a(`${m}_y`),x=r(p)?.bounds,C=r(m)?.bounds;if(g){let b=new Md(f,[-1,y]);i.addConstraint(new XA(b,tm.Eq,u.yDist,Oh.required))}else if(A){let b=new Md(f,x.height/2,[-1,y],-C.height/2);i.addConstraint(new XA(b,tm.Eq,u.yDist,Oh.required))}}else if("sameY"in u){let{for:_}=u;if(_.length<2)continue;let p=_.map((A)=>a(`${A}_y`)),m=new Md(...p.slice(1));i.addConstraint(new XA(m,tm.Eq,p[0],Oh.required))}else if("sameX"in u){let{for:_}=u;if(_.length<2)continue;let p=_.map((A)=>a(`${A}_x`)),m=new Md(...p.slice(1));i.addConstraint(new XA(m,tm.Eq,p[0],Oh.required))}}if(i.updateVariables(),Hzr.enabled)console.log("Solution to layout constraints:"),console.table(Object.entries(s).map(([d,u])=>({var:d,val:u.value()})));let c={left:1/0,right:-1/0,top:-1/0,bottom:1/0};for(let{selector:d,bounds:{width:u,height:_}}of o){let p=a(`${d}_x`),m=a(`${d}_y`),A=p.value()-u/2,g=p.value()+u/2,f=m.value()+_/2,y=m.value()-_/2;c.left=Math.min(c.left,A),c.right=Math.max(c.right,g),c.top=Math.max(c.top,f),c.bottom=Math.min(c.bottom,y)}let l={x:-(c.right+c.left)/2,y:-(c.top+c.bottom)/2},h=this.getPrimitiveContainer()._getGlobalPcbPositionBeforeLayout();l.x+=h.x,l.y+=h.y;for(let{component:d,selector:u}of o){let _=a(`${u}_x`),p=a(`${u}_y`);d._setPositionFromLayout({x:_.value()+l.x,y:p.value()+l.y})}}},Fzr=(e)=>{let{db:t}=e.root;if(e.pcb_component_id){let n=t.pcb_component.get(e.pcb_component_id);if(!n)return null;return{width:n.width,height:n.height}}if(e.pcb_group_id){let n=t.pcb_group.get(e.pcb_group_id);if(!n)return null;if(n.outline&&n.outline.length>0){let o=Hs(n.outline);if(!o)return null;return{width:o.maxX-o.minX,height:o.maxY-o.minY}}return{width:n.width??0,height:n.height??0}}return null},zzr=(e,t)=>{let{db:n}=e.root,o=n.toArray();if(e.pcb_component_id){r2e(o,e.pcb_component_id,t);return}if(e.source_group_id){i2e(o,e.source_group_id,t);return}throw Error(`Cannot reposition component ${e.getString()}: no pcb_component_id or source_group_id`)},Ozr="MARKED INTERNALLY CONNECTED",Vzr=0.12,Yzr=0.05,ZAn=0.12,Gzr=(e)=>{let{db:t}=e.root,n={pcb_component_id:e.pcb_component_id};return t.pcb_fabrication_note_text.list(n).length>0||t.pcb_fabrication_note_path.list(n).length>0||t.pcb_fabrication_note_rect.list(n).length>0||t.pcb_fabrication_note_dimension.list(n).length>0},Uzr=(e)=>{let t={from:e[0],to:e[1],length:-1/0};for(let s=1;s<e.length;s++){let a=e[s-1],c=e[s],l=Math.hypot(c.x-a.x,c.y-a.y);if(l>t.length)t={from:a,to:c,length:l}}let n=t.to.x-t.from.x,o=t.to.y-t.from.y,r=Math.max(t.length,Number.EPSILON),i=Math.atan2(o,n)*180/Math.PI;if(i>90)i-=180;if(i<-90)i+=180;return{anchorPosition:{x:(t.from.x+t.to.x)/2-o/r*ZAn,y:(t.from.y+t.to.y)/2+n/r*ZAn},ccwRotation:(i%360+360)%360}},Wzr=(e)=>{let t=e.root;if(!t||t.pcbDisabled||!e.pcb_component_id)return;if(e.componentName==="SolderJumper")return;if(e._getPrimaryPinCount()>=6)return;if(Gzr(e))return;let{db:n}=t,o=n.pcb_component.get(e.pcb_component_id);if(!o)return;let r=o.layer;if(r!=="top"&&r!=="bottom")return;let i=e.getSubcircuit()?.subcircuit_id??void 0,s=e.getGroup()?.pcb_group_id??void 0;for(let a of e._getInternallyConnectedPins()){let c=a.flatMap((u)=>{if(!u?.pcb_port_id)return[];let _=n.pcb_port.get(u.pcb_port_id);return _?[{x:_.x,y:_.y}]:[]}),l=c.filter((u,_)=>c.findIndex((p)=>p.x===u.x&&p.y===u.y)===_);if(l.length<2)continue;let{anchorPosition:h,ccwRotation:d}=Uzr(l);n.pcb_fabrication_note_path.insert({pcb_component_id:e.pcb_component_id,subcircuit_id:i,layer:r,route:l,stroke_width:Yzr}),n.pcb_fabrication_note_text.insert({pcb_component_id:e.pcb_component_id,pcb_group_id:s,subcircuit_id:i,font:"tscircuit2024",font_size:Vzr,text:Ozr,ccw_rotation:d,layer:r,anchor_position:h,anchor_alignment:"center"})}},Xzr={simple_ammeter:["A"],simple_battery:["B","BT"],simple_capacitor:["C"],simple_chip:["U","IC"],simple_connector:["J","P","CONN"],simple_crystal:["Y","X"],simple_current_source:["I","IS"],simple_diode:["D"],simple_fuse:["F"],simple_inductor:["L","FB"],simple_interconnect:["ICN"],simple_led:["D","LED"],simple_mosfet:["Q"],simple_op_amp:["U","IC"],simple_pin_header:["J","P","JP"],simple_pinout:["J","P"],simple_potentiometer:["RV","RP"],simple_power_source:["B","BT","V","VS"],simple_push_button:["SW","S"],simple_resistor:["R"],simple_resonator:["Y","X"],simple_switch:["SW","S"],simple_test_point:["TP"],simple_transistor:["Q"],simple_voltage_probe:["VP"],simple_voltage_source:["V","VS"]},M3n=(e)=>{if(!e)return;return Xzr[e]},jzr=(e)=>e.match(/^[A-Za-z]+/)?.[0]?.toUpperCase(),Kzr=[{prefix:"J",recommendation:"a <connector /> or <jumper />"},{prefix:"Q",recommendation:"a <transistor />"},{prefix:"C",recommendation:"a <capacitor />"},{prefix:"R",recommendation:"a <resistor />"},{prefix:"L",recommendation:"an <inductor />"},{prefix:"Y",recommendation:"a <crystal />"},{prefix:"X",recommendation:"a <crystal />"},{prefix:"F",recommendation:"a <fuse />"},{prefix:"S",recommendation:"a <switch /> or <pushbutton />"},{prefix:"TP",recommendation:"a <testpoint />"}],$zr=(e)=>{let{db:t}=e.root;if(!e.source_component_id)return;let n=t.source_component.get(e.source_component_id);if(!n?.name||!n.ftype)return;let o=jzr(n.name),r=e.componentName==="Chip"&&n.ftype==="simple_chip"&&o!==void 0?Kzr.find(({prefix:c})=>o.startsWith(c)):void 0,i=e.getRefDesPrefixes()??(r?M3n("simple_chip"):void 0);if(!i||i.length===0)return;if(o&&i.some((c)=>o===c||o.startsWith(c)))return;let s=i.length===1?i[0]:`one of ${i.join(", ")}`,a=r?`The "${r.prefix}" prefix is being used with a <chip />, try using it with ${r.recommendation}`:`Component ${n.name} has ftype="${n.ftype}" but reference designator should start with ${s}`;t.insert({type:"source_refdes_convention_warning",warning_type:"source_refdes_convention_warning",message:a,source_component_id:n.source_component_id,refdes:n.name,source_component_ftype:n.ftype,expected_prefixes:i,actual_prefix:o,subcircuit_id:n.subcircuit_id})},efn=new WeakMap,qzr=(e)=>{let t=efn.get(e);if(t)return t;let n=new Map;return efn.set(e,n),n},Jzr=new Set(["a","anode","pos","positive","+"]),Zzr=new Set(["c","k","cathode","neg","negative","-"]),w3n=(e)=>e.toLowerCase().replace(/[^a-z0-9+-]/g,""),B3n=(e,t)=>{let n=e.filter((o)=>o.type==="source_port"&&(!t||o.source_component_id===t));return n.find((o)=>o.pin_number===1)??n.find((o)=>[o.name,...o.port_hints??[]].map(w3n).includes("pin1"))??null},T3n=(e)=>{if(!e)return null;let t=[e.name,...e.port_hints??[]].map(w3n),n=t.some((r)=>Jzr.has(r)),o=t.some((r)=>Zzr.has(r));if(n===o)return null;return n?"anode":"cathode"},eOr=(e)=>{if(!e)return[];let t=[];for(let n of Object.keys(e)){let o=e[n]?.[0];if(o)t.push({supplierName:n,supplierPartNumber:o})}return t},tOr=(e)=>{if(typeof e!=="string")return null;let t=e.match(/(?:^|_)pin1location\((leftside|rightside|topside|bottomside),(left|right|top|bottom)\)(?:_|$)/i);if(!t)return null;let n=uj.safeParse(`${t[1].toLowerCase()}_${t[2].toLowerCase()}`);return n.success?n.data:null},nOr=({component:e,pcbComponent:t,pcbElements:n})=>{let o=-t.rotation*Math.PI/180,r=Math.cos(o),i=Math.sin(o),s=Qde({componentLayer:t.layer,originalLayer:e._getFootprintOriginalLayer()}),a=(c)=>{let l=c.x-t.center.x,h=c.y-t.center.y,d=s?-h:h;return{x:l*r-d*i,y:l*i+d*r}};return n.map((c)=>{let l=structuredClone(c);if(typeof l.x==="number"&&typeof l.y==="number"){let h=a(l);l.x=h.x,l.y=h.y}if(l.points)l.points=l.points.map(a);return l})},oOr=({supplierName:e,supplierPartNumber:t})=>`part-orientation-analysis:v4:${e}:${t}`,rOr=async({cacheKey:e,component:t})=>{let n=await t.root?.platform?.localCacheEngine?.getItem(e);if(!n)return{cacheHit:!1};try{let o=JSON.parse(n),r=uj.safeParse(o.pin1_location),i=o.pin1_location===null?null:r.success?r.data:void 0,s=o.pin1_polarity===null||o.pin1_polarity==="anode"||o.pin1_polarity==="cathode"?o.pin1_polarity:void 0;if(i===void 0||s===void 0)return{cacheHit:!1};return{cacheHit:!0,analysis:{pin1Location:i,pin1Polarity:s}}}catch{return{cacheHit:!1}}},iOr=async({component:e,partsEngine:t,supplierPartCandidate:n})=>{let o=oOr(n),r=await rOr({cacheKey:o,component:e});if(r.cacheHit)return r.analysis;let i=qzr(t),s=i.get(o);if(s)return s;let a=(async()=>{let c=await Promise.resolve(I4n(t.fetchPartCircuitJson,{supplierPartNumber:n.supplierPartNumber,platformFetch:e.root?.platform?.platformFetch}));if(!c?.length)return{pin1Location:null,pin1Polarity:null};let l=eHe(c),h=T3n(B3n(c));try{await e.root?.platform?.localCacheEngine?.setItem(o,JSON.stringify({pin1_location:l,pin1_polarity:h}))}catch{}return{pin1Location:l,pin1Polarity:h}})().finally(()=>{i.delete(o)});return i.set(o,a),a},sOr=(e)=>{if(!e.root)return;if(e.root.platform?.enablePartOrientationAnalysis===!1)return;if(e.root.pcbDisabled||e.props.doNotPlace)return;if(!e.pcb_component_id)return;let{db:t}=e.root,n=t.pcb_component.get(e.pcb_component_id);if(!n)return;let o=[...t.pcb_smtpad.list({pcb_component_id:e.pcb_component_id}),...t.pcb_plated_hole.list({pcb_component_id:e.pcb_component_id})];if(o.length===0)return;let r=tOr(e.resolveFootprint())??eHe(nOr({component:e,pcbComponent:n,pcbElements:o}));if(r)t.pcb_component.update(e.pcb_component_id,{pin1_location:r});if(e.getInheritedProperty("bomDisabled"))return;if(e.getInheritedProperty("partsEngineDisabled"))return;let i=e.getInheritedProperty("partsEngine");if(!i?.fetchPartCircuitJson)return;let s=t.source_component.get(e.source_component_id),c=s?.ftype==="simple_diode"||s?.ftype==="simple_led"?B3n(t.source_port.list(),e.source_component_id??void 0):null,l=T3n(c),h=eOr(s?.supplier_part_numbers);if(h.length===0)return;if(e._hasStartedPartOrientationAnalysis)return;e._hasStartedPartOrientationAnalysis=!0,e._queueAsyncEffect("analyze-part-orientation",async()=>{let d={};for(let u of h)try{let{pin1Location:_,pin1Polarity:p}=await iOr({component:e,partsEngine:i,supplierPartCandidate:u});if(_)d[u.supplierName]=_;if(l&&p&&l!==p){let m=bw.parse({type:"source_component_misconfigured_error",error_type:"source_component_misconfigured_error",message:`${e.getString()} maps pin 1 to the ${l}, but supplier part ${u.supplierName}:${u.supplierPartNumber} maps pin 1 to the ${p}. Update pinLabels or use a supplier part with matching diode polarity.`,source_component_ids:[e.source_component_id],source_port_ids:c?.source_port_id?[c.source_port_id]:void 0});e.root.db.source_component_misconfigured_error.insert(m)}}catch{}e._asyncSupplierPin1LocationMap=d,e._markDirty("PartOrientationAnalysis")})},aOr=(e)=>{let t=e._asyncSupplierPin1LocationMap;if(!t||!e.pcb_component_id)return;let{db:n}=e.root,o=n.pcb_component.get(e.pcb_component_id);if(!o||Object.keys(t).length===0)return;n.pcb_component.update(e.pcb_component_id,{supplier_pin1_location_map:{...o.supplier_pin1_location_map,...t}})};function cOr(e){if(e.root?.pcbDisabled)return;if(!e.pcb_component_id)return;let{pcbX:t,pcbY:n}=e._parsedProps,o=e.props?.pcbPositionAnchor;if(!o)return;if(t===void 0&&n===void 0)return;let r=T8e(e.children);if(r.width===0||r.height===0)return;let s={...{x:(r.minX+r.maxX)/2,y:(r.minY+r.maxY)/2}},a=null;if(new Set(["center","top_left","top_center","top_right","center_left","center_right","bottom_left","bottom_center","bottom_right"]).has(o)){let h={left:r.minX,right:r.maxX,top:r.minY,bottom:r.maxY};switch(o){case"center":a=s;break;case"top_left":a={x:h.left,y:h.top};break;case"top_center":a={x:s.x,y:h.top};break;case"top_right":a={x:h.right,y:h.top};break;case"center_left":a={x:h.left,y:s.y};break;case"center_right":a={x:h.right,y:s.y};break;case"bottom_left":a={x:h.left,y:h.bottom};break;case"bottom_center":a={x:s.x,y:h.bottom};break;case"bottom_right":a={x:h.right,y:h.bottom};break}}else try{let h=e.portMap[o];if(h)a=h._getGlobalPcbPositionBeforeLayout()}catch{}if(!a)return;let l={...s};if(t!==void 0)l.x+=t-a.x;if(n!==void 0)l.y+=n-a.y;if(Math.abs(l.x-s.x)>0.000001||Math.abs(l.y-s.y)>0.000001)e._repositionOnPcb(l)}var D3n=(e)=>{let t=e.find((r)=>r.type==="cad_component");if(!t)return;let n={stlUrl:t.model_stl_url,objUrl:t.model_obj_url,gltfUrl:t.model_gltf_url,glbUrl:t.model_glb_url,stepUrl:t.model_step_url,wrlUrl:t.model_wrl_url,modelOriginPosition:t.model_origin_position??void 0,modelUnitToMmScale:t.model_unit_to_mm_scale_factor,modelBoardNormalDirection:t.model_board_normal_direction,size:t.size??void 0,rotationOffset:t.rotation??void 0,positionOffset:t.position??void 0,showAsTranslucentModel:t.show_as_translucent_model};if(!n.stlUrl&&!n.objUrl&&!n.gltfUrl&&!n.glbUrl&&!n.stepUrl&&!n.wrlUrl&&!t.model_jscad)return;if(t.model_jscad&&typeof t.model_jscad==="object")n.jscad=t.model_jscad;let o=CO.safeParse(n);return o.success?o.data:void 0},lOr=N3n.default("tscircuit:core:resolveStaticFileImport");async function R3n(e,t){if(!e)return e;let n=e.startsWith("./")?e.slice(1):e,o=t?.resolveProjectStaticFileImportUrl;if(o&&(e.startsWith("/")||e.startsWith("./")))try{let r=await o(n);if(r)return r}catch(r){lOr("failed to resolve static file via platform resolver",r)}return Vst(n,t?.projectBaseUrl)}var rL=(e)=>e.startsWith("blob:"),iL=(e)=>e.startsWith("http://")||e.startsWith("https://"),Lde=(e)=>e.startsWith("/")||e.startsWith("./"),JJ=(e)=>{if(iL(e)||rL(e))return null;let t=e.indexOf(":");if(t<=0)return null;let n=e.slice(0,t),o=e.slice(t+1);if(!n||!o)return null;return{footprintLib:n,footprintName:o}},hOr=Rw.shape.supplierPartNumbers.unwrap().keySchema.options,dOr=(e)=>e.componentName==="Symbol"||e.isSchematicPrimitive,uOr=(e,t,n)=>{if(e.getInheritedProperty("partsEngineDisabled"))return;let o=e.props.supplierPartNumbers,r=hOr.find((c)=>c===t);if(!r)return;if(!o?.[r]?.includes(n))return;let a=e.getInheritedProperty("partsEngine")?.fetchPartCircuitJson;if(!a)return;return async(c)=>({footprintCircuitJson:await vst({fetchPartCircuitJson:a,supplierPartNumber:c,manufacturerPartNumber:hi(e.props)},e)??[]})},pOr=async(e,t,n)=>{if(!e)throw Error(`No footprint resolver is configured for library "${t}".`);return e(n)};function mOr(e,t){let n=e.resolveFootprint();if(!n)return;let{pcbRotation:o,pcbPinLabels:r}=e.props,i=e._resolvePinLabels(),s=Yst(String(n)),a=s?e.root?.platform?.footprintFileParserMap?.[s]:null;if(typeof n==="string"&&(iL(n)||rL(n)||Lde(n))&&a){if(e._hasStartedFootprintUrlLoad)return;e._hasStartedFootprintUrlLoad=!0,t("load-footprint-from-platform-file-parser",async()=>{let c=iL(n)||rL(n)?n:await R3n(n,e.root?.platform);try{let l=await a.loadFromUrl(c),h=JB({sourcePortOwner:e,componentName:e.name,componentRotation:o,footprinterString:c,pinLabels:i,pcbPinLabels:r},l.footprintCircuitJson);e.addAll(h);for(let d of e.children)if(d.componentName==="Port")d._markDirty("PcbPortRender");e._markDirty("ResolveFootprintPinLabels"),e._markDirty("InitializePortsFromChildren")}catch(l){let h=e.root?.db;if(h&&e.source_component_id&&e.pcb_component_id){let d=e.getSubcircuit(),u=`${e.getString()} failed to load footprint "${c}": `+(l instanceof Error?l.message:String(l)),_=gj.parse({type:"external_footprint_load_error",message:u,pcb_component_id:e.pcb_component_id,source_component_id:e.source_component_id,subcircuit_id:d.subcircuit_id??void 0,pcb_group_id:e.getGroup()?.pcb_group_id??void 0,footprinter_string:c});h.external_footprint_load_error.insert(_)}throw l}});return}if(typeof n==="string"&&iL(n)){if(e._hasStartedFootprintUrlLoad)return;e._hasStartedFootprintUrlLoad=!0;let c=n;t("load-footprint-url",async()=>{try{let l=await fetch(c);if(!l.ok)throw Error(`Failed to fetch footprint: ${l.status}`);let h=await l.json(),d=JB({sourcePortOwner:e,componentName:e.name,componentRotation:o,footprinterString:c,pinLabels:i,pcbPinLabels:r},h);e.addAll(d),e._markDirty("ResolveFootprintPinLabels"),e._markDirty("InitializePortsFromChildren")}catch(l){let h=e.root?.db;if(h&&e.source_component_id&&e.pcb_component_id){let d=e.getSubcircuit(),u=`${e.getString()} failed to load external footprint "${c}": `+(l instanceof Error?l.message:String(l)),_=gj.parse({type:"external_footprint_load_error",message:u,pcb_component_id:e.pcb_component_id,source_component_id:e.source_component_id,subcircuit_id:d.subcircuit_id??void 0,pcb_group_id:e.getGroup()?.pcb_group_id??void 0,footprinter_string:c});h.external_footprint_load_error.insert(_)}throw l}});return}if(typeof n==="string"&&rL(n))return;if(typeof n==="string"){let c=JJ(n);if(!c)return;if(e._hasStartedFootprintUrlLoad)return;e._hasStartedFootprintUrlLoad=!0;let h=e.root?.platform?.footprintLibraryMap?.[c.footprintLib],d=typeof h==="function"?h:void 0,u=uOr(e,c.footprintLib,c.footprintName),_=d??u;t("load-lib-footprint",async()=>{try{let p=await pOr(_,c.footprintLib,c.footprintName),m=null;if(Array.isArray(p))m=p;else if(Array.isArray(p.footprintCircuitJson))m=p.footprintCircuitJson;if(!m||m.length===0)throw Error(`Footprint resolver returned no circuit elements for "${n}".`);let A=JB({sourcePortOwner:e,componentName:e.name,componentRotation:o,footprinterString:n,pinLabels:i,pcbPinLabels:r},m),g=new R8e({src:n}),f=[];for(let y of A)if(dOr(y))f.push(y);else g.add(y);e.add(g),e.addAll(f),e._asyncFootprintCadModel=!Array.isArray(p)&&p.cadModel||D3n(m);for(let y of e.children)if(y.componentName==="Port")y._markDirty?.("PcbPortRender");e._markDirty("ResolveFootprintPinLabels"),e._markDirty("InitializePortsFromChildren")}catch(p){let m=e.root?.db;if(m&&e.source_component_id&&e.pcb_component_id){let A=e.getSubcircuit(),g=`${e.getString()} failed to load external footprint "${n}": `+(p instanceof Error?p.message:String(p)),f=gj.parse({type:"external_footprint_load_error",message:g,pcb_component_id:e.pcb_component_id,source_component_id:e.source_component_id,subcircuit_id:A.subcircuit_id??void 0,pcb_group_id:e.getGroup()?.pcb_group_id??void 0,footprinter_string:n});m.external_footprint_load_error.insert(f)}throw p}});return}if(!zrt.isValidElement(n)&&n.componentName==="Footprint")e.add(n);if(Array.isArray(n)&&!zrt.isValidElement(n)&&n.length>0){try{let c=JB({sourcePortOwner:e,componentName:e.name,componentRotation:o,footprinterString:"",pinLabels:i,pcbPinLabels:r},n);e.addAll(c)}catch(c){let l=e.root?.db;if(l&&e.source_component_id&&e.pcb_component_id){let h=e.getSubcircuit(),d=`${e.getString()} failed to load json footprint: `+(c instanceof Error?c.message:String(c)),u=Dfe.parse({type:"circuit_json_footprint_load_error",message:d,pcb_component_id:e.pcb_component_id,source_component_id:e.source_component_id,subcircuit_id:h.subcircuit_id??void 0,pcb_group_id:e.getGroup()?.pcb_group_id??void 0});l.circuit_json_footprint_load_error.insert(u)}throw c}return}}function _Or(e){let t=e._impliedFootprintPinLabels??{},n={},o=e.getPortsFromFootprint({allowImplicitPinNumbers:!e._parsedProps.pinLabels});for(let i of o){let s=i._parsedProps.pinNumber;if(s===void 0)continue;let a=new Set([`pin${s}`,`${s}`]),c=i.getNameAndAliases().filter((l)=>!a.has(l));if(c.length>0)n[`pin${s}`]=c}let r={...n};for(let[i,s]of Object.entries(t))r[i]=Array.isArray(s)?s:[s];if(e._impliedFootprintPinLabels=r,Object.keys(e._impliedFootprintPinLabels).length===0)return;for(let i of e.children){if(i.componentName!=="Port")continue;let s=i,a=s._parsedProps.pinNumber;if(a===void 0)continue;let c=`pin${a}`,l=e._impliedFootprintPinLabels[c];if(!l)continue;let h=Array.isArray(l)?l:[l],d=s.getNameAndAliases();for(let u of h)if(!d.includes(u))s.externallyAddedAliases.push(u)}}function gOr(e){if(e.root?.schematicDisabled)return;if(e.getCollapsedSchematicBoxAncestor())return;if(e._parsedProps?.noSchematicRepresentation===!0)return;let{db:t}=e.root;if(e._invalidPinLabelMessages?.length&&e.root?.db)for(let a of e._invalidPinLabelMessages){let c="pinLabels",l=a.match(/^Invalid pin label:\s*([^=]+)=\s*'([^']+)'/);if(l)c=`pinLabels['${l[2]}']`;e.root.db.source_property_ignored_warning.insert({source_component_id:e.source_component_id,property_name:c,message:a,error_type:"source_property_ignored_warning"})}if(e._parsedProps.schPinSpacing!==void 0&&e.root?.db)e.root.db.source_property_ignored_warning.insert({source_component_id:e.source_component_id,property_name:"schPinSpacing",error_type:"source_property_ignored_warning",message:"schPinSpacing is deprecated and will be ignored. Pin spacing is always 0.2."});let{schematicSymbolName:n}=e.config,{_parsedProps:o}=e,r=e.children.some((a)=>a.componentName==="Symbol");if(o.symbol&&Q3n.isValidElement(o.symbol)||r)e._doInitialSchematicComponentRenderWithReactSymbol(o.symbol);else if(n)e._doInitialSchematicComponentRenderWithSymbol();else{let a=e._getSchematicBoxDimensions();if(a)e._doInitialSchematicComponentRenderWithSchematicBoxDimensions(a)}let i=e.getSubcircuit()?._getSchematicManualPlacementForComponent(e);if(e.schematic_component_id&&(e.props.schX!==void 0||e.props.schY!==void 0)&&!!i){if(!e.schematic_component_id)return;let a=vfe.parse({type:"schematic_manual_edit_conflict_warning",schematic_manual_edit_conflict_warning_id:`schematic_manual_edit_conflict_${e.source_component_id}`,message:`${e.getString()} has both manual placement and prop coordinates. schX and schY will be used. Remove schX/schY or clear the manual placement.`,schematic_component_id:e.schematic_component_id,source_component_id:e.source_component_id,subcircuit_id:e.getSubcircuit()?.subcircuit_id});t.schematic_manual_edit_conflict_warning.insert(a)}let s=e._parsedProps?.schSheetName??e.props.schSheetName;if(s&&e.source_component_id&&!e._resolveSchematicSheetId())t.source_property_ignored_warning.insert({source_component_id:e.source_component_id,property_name:"schSheetName",error_type:"source_property_ignored_warning",subcircuit_id:e.getSubcircuit()?.subcircuit_id??void 0,message:`${e.getString()} references schSheetName "${s}", which does not match any schematic sheet and will be ignored.`})}function AOr(e){let t=e.font_size,n=e.text.length*t*0.6,o=t,r=e.anchor_alignment||"center",i=e.anchor_position.x,s=e.anchor_position.y;switch(r){case"top_left":i=e.anchor_position.x+n/2,s=e.anchor_position.y+o/2;break;case"top_center":i=e.anchor_position.x,s=e.anchor_position.y+o/2;break;case"top_right":i=e.anchor_position.x-n/2,s=e.anchor_position.y+o/2;break;case"center_left":i=e.anchor_position.x+n/2,s=e.anchor_position.y;break;case"center":i=e.anchor_position.x,s=e.anchor_position.y;break;case"center_right":i=e.anchor_position.x-n/2,s=e.anchor_position.y;break;case"bottom_left":i=e.anchor_position.x+n/2,s=e.anchor_position.y-o/2;break;case"bottom_center":i=e.anchor_position.x,s=e.anchor_position.y-o/2;break;case"bottom_right":i=e.anchor_position.x-n/2,s=e.anchor_position.y-o/2;break;default:i=e.anchor_position.x,s=e.anchor_position.y;break}return{x:i-n/2,y:s-o/2,width:n,height:o}}function fOr(e){if(!e._adjustSilkscreenTextAutomatically)return;if(e.root?.pcbDisabled||!e.pcb_component_id)return;let{db:t}=e.root,o=e._getPcbCircuitJsonBounds().center,r=t.pcb_silkscreen_text.list({pcb_component_id:e.pcb_component_id}).filter((c)=>c.text===e.name);if(r.length===0)return;let a=e.getSubcircuit().selectAll("[_isNormalComponent=true]").filter((c)=>c!==e&&c.pcb_component_id).map((c)=>{let l=c._getPcbCircuitJsonBounds(),h={center:l.center,width:l.width,height:l.height};return kR(h)});for(let c of r){let l=c.anchor_position,h=AOr(c),d={center:{x:h.x+h.width/2,y:h.y+h.height/2},width:h.width,height:h.height},u=kR(d);if(!a.some((y)=>qp(u,y)))continue;let p=2*o.x-l.x,m=2*o.y-l.y,A={center:{x:p,y:m},width:h.width,height:h.height},g=kR(A);if(!a.some((y)=>qp(g,y)))t.pcb_silkscreen_text.update(c.pcb_silkscreen_text_id,{anchor_position:{x:p,y:m}})}}var yOr=(e)=>{if(e.root?.platform?.drcChecksDisabled??e.getInheritedProperty("drcChecksDisabled"))return;let{db:n}=e.root;if(!e.source_component_id)return;let o=e.selectAll("port"),r=n.source_trace.list(),i=new Set;for(let a of r)for(let c of a.connected_source_port_ids)i.add(c);let s=e._getInternallyConnectedPins();for(let a of s)if(a.some((c)=>c.source_port_id&&i.has(c.source_port_id))){for(let c of a)if(c.source_port_id)i.add(c.source_port_id)}for(let a of o){if(!a.source_port_id)continue;if(!xOr(e,a))continue;if(n.source_port.get(a.source_port_id)?.do_not_connect)continue;if(i.has(a.source_port_id))continue;n.source_pin_missing_trace_warning.insert({message:`Port ${a.getNameAndAliases()[0]} on ${e.props.name} is missing a trace`,source_component_id:e.source_component_id,source_port_id:a.source_port_id,subcircuit_id:e.getSubcircuit().subcircuit_id??void 0,warning_type:"source_pin_missing_trace_warning"})}},xOr=(e,t)=>{if(e.config.componentName==="Interconnect")return!1;if(e.config.componentName==="Chip"){let n=e.props.pinAttributes;if(!n)return!1;for(let o of t.getNameAndAliases()){let r=n[o];if(r?.requiresPower||r?.requiresGround||r?.requiresVoltage!==void 0)return!0}return!1}return!0},COr=(e)=>{let t=e.root?.platform?.drcChecksDisabled??e.getInheritedProperty("drcChecksDisabled"),{db:n}=e.root;if(!e.source_component_id)return;let o=n.source_component.get(e.source_component_id);if(!o)return;let r=n.source_missing_manufacturer_part_number_warning.getWhere({source_component_id:e.source_component_id}),i=Object.values(o.supplier_part_numbers??{}).some((a)=>a?.some((c)=>c.trim()));if(t||e.props.doNotPlace||o.ftype==="simple_resistor"||o.ftype==="simple_capacitor"||o.ftype==="simple_inductor"||o.manufacturer_part_number?.trim()||i){if(r)n.source_missing_manufacturer_part_number_warning.delete(r.source_missing_manufacturer_part_number_warning_id);return}if(r)return;let s=o.ftype==="simple_connector"?o.standard:void 0;n.source_missing_manufacturer_part_number_warning.insert({source_component_id:e.source_component_id,subcircuit_id:e.getSubcircuit()?.subcircuit_id??void 0,standard:s,warning_type:"source_missing_manufacturer_part_number_warning",message:`${e.getString()} is missing a manufacturer part number and could not be resolved to a supplier part. Specify mpn, manufacturerPartNumber, or mfn, provide supplierPartNumbers, or configure a parts engine to select a part. If this part will not be assembled, mark it doNotPlace.`})},tfn=new WeakMap,bOr=async(e,t)=>{let n=new AbortController,o,r=new Promise((i)=>{o=setTimeout(()=>{n.abort(),i(!1)},1e4)});try{let i=Promise.resolve().then(()=>e.fetchPartAvailability({...t,signal:n.signal})).then((s)=>s===void 0?void 0:s.stock!==null&&s.stock>0).catch(()=>!1);return await Promise.race([i,r])}finally{clearTimeout(o)}},IOr=(e,{partsEngine:t,...n})=>{let o=tfn.get(e);if(!o)o=new WeakMap,tfn.set(e,o);let r=o.get(t);if(!r)r=new Map,o.set(t,r);let i=`${n.supplierName}:${n.supplierPartNumber}`,s=r.get(i);if(s)return s;let a=bOr(t,{...n,platformFetch:e.platform?.platformFetch}).finally(()=>{r.delete(i)});return r.set(i,a),a},Ynt=new WeakMap,vOr=Rw.shape.supplierPartNumbers.unwrap().keySchema.options;function nfn(e,{refresh:t=!1}={}){let{root:n,source_component_id:o}=e;if(!n||!o)return;let{db:r}=n,i=e.getInheritedProperty("partsEngine"),s=e.props.supplierPartNumbers??{},a=vOr.map((u)=>({supplierName:u,partNumbers:[...new Set((s[u]??[]).map((_)=>_.trim()).filter(Boolean))]})).filter((u)=>u.partNumbers.length>0),c=n.platform?.checkAvailability===!0&&!!i?.fetchPartAvailability&&!e.props.doNotPlace&&!e.getInheritedProperty("bomDisabled")&&!e.getInheritedProperty("partsEngineDisabled")&&!(n.platform?.drcChecksDisabled??e.getInheritedProperty("drcChecksDisabled"))&&a.length>0,l=c?JSON.stringify(a):"disabled",h=Ynt.get(e);if(!t&&h?.key===l&&h.partsEngine===i)return;let d={key:l,partsEngine:i};Ynt.set(e,d);for(let u of r.source_component_availability_warning.list({source_component_id:o}))r.source_component_availability_warning.delete(u.source_component_availability_warning_id);if(!c||!i)return;e._queueAsyncEffect("check-component-availability",async()=>{let u=await Promise.all(a.map(async({supplierName:_,partNumbers:p})=>({supplierName:_,partNumbers:p,availability:await Promise.all(p.map((m)=>IOr(n,{partsEngine:i,supplierName:_,supplierPartNumber:m})))})));if(Ynt.get(e)!==d||n.platform?.checkAvailability!==!0||e.shouldBeRemoved)return;for(let{supplierName:_,partNumbers:p,availability:m}of u){if(m.some((g)=>g===!0))continue;let A=p.filter((g,f)=>m[f]!==void 0);if(!A.length)continue;r.source_component_availability_warning.insert(Eie.parse({type:"source_component_availability_warning",source_component_id:o,subcircuit_id:e.getSubcircuit()?.subcircuit_id??void 0,supplier_name:_,supplier_part_numbers:A,message:`${e.name||"Unnamed component"} may not have availability from ${_} (${A.join(", ")}).`}))}})}var SOr=0.8,POr=Rw.shape.supplierPartNumbers.unwrap().keySchema.options,EOr=(e)=>Number.isFinite(e.minX)&&Number.isFinite(e.minY)&&Number.isFinite(e.maxX)&&Number.isFinite(e.maxY)&&e.maxX>e.minX&&e.maxY>e.minY,ofn=(e,t=0)=>{let n={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};for(let o of e){if(o.type!=="pcb_smtpad"&&o.type!=="pcb_plated_hole")continue;let r=o.type==="pcb_smtpad"?kj(o):RR(o,t),i=Uie(r,{x:0,y:0},-t).box;n.minX=Math.min(n.minX,i.xmin),n.minY=Math.min(n.minY,i.ymin),n.maxX=Math.max(n.maxX,i.xmax),n.maxY=Math.max(n.maxY,i.ymax)}if(!EOr(n))return null;return n},rfn=(e)=>({width:e.maxX-e.minX,height:e.maxY-e.minY}),ifn=(e,t,n)=>{let o=rfn(e),r=rfn(t),i=n?.rotateB?r.height:r.width,s=n?.rotateB?r.width:r.height,a=Math.min(o.width,i),c=Math.min(o.height,s),l=a*c,h=o.width*o.height+i*s-l;if(h<=0)return 0;return l/h},MOr=(e,t)=>Math.max(ifn(e,t),ifn(e,t,{rotateB:!0})),wOr=(e)=>{if(!e)return[];let t=[];for(let n of POr){let o=e[n];if(!Array.isArray(o))continue;for(let r of o){if(!r)continue;t.push({supplierName:n,supplierPartNumber:r})}}return t};function BOr(e){if(e.root?.pcbDisabled)return;if(e.props.doNotPlace)return;if(e.props.footprint===void 0)return;if(e.getInheritedProperty("bomDisabled"))return;if(e.getInheritedProperty("partsEngineDisabled"))return;let t=e.getInheritedProperty("partsEngine");if(!t?.fetchPartCircuitJson)return;let{db:n}=e.root,o=n.source_component.get(e.source_component_id);if(!o?.supplier_part_numbers)return;if(!e.pcb_component_id)return;if(e._hasStartedSupplierFootprintMismatchWarningCheck)return;let r=wOr(o.supplier_part_numbers);if(r.length===0)return;let i=[...n.pcb_smtpad.list({pcb_component_id:e.pcb_component_id}),...n.pcb_plated_hole.list({pcb_component_id:e.pcb_component_id})],s=n.pcb_component.get(e.pcb_component_id),a=ofn(i,s.rotation);if(!a)return;e._hasStartedSupplierFootprintMismatchWarningCheck=!0,e._queueAsyncEffect("check-supplier-footprint-mismatch",async()=>{let{db:c}=e.root,l=t.fetchPartCircuitJson;for(let h of r){let{supplierName:d,supplierPartNumber:u}=h;try{let _=await Promise.resolve(I4n(l,{supplierPartNumber:u}))??null;if(!_?.length)continue;let p=ofn(_);if(!p)continue;let m=MOr(a,p);if(m>=SOr)return;let A=typeof e.props.footprint==="string"?`"${e.props.footprint}"`:"the provided footprint",g=Number(m.toFixed(4)),f=Rfe.parse({type:"supplier_footprint_mismatch_warning",message:`${e.getString()} footprint ${A} does not match supplier footprint ${d}:${u} (copper IoU ${g}).`,source_component_id:e.source_component_id,pcb_component_id:e.pcb_component_id,pcb_group_id:e.getGroup()?.pcb_group_id??void 0,subcircuit_id:e.getSubcircuit()?.subcircuit_id??void 0,supplier_name:d,supplier_part_number:u,footprint_copper_intersection_over_union:g});c.supplier_footprint_mismatch_warning.insert(f);return}catch(_){let p=_ instanceof Error?_.message:String(_),m=IR.parse({type:"source_part_not_found_warning",message:`Failed to fetch supplier footprint for ${e.getString()} (${d}:${u}): ${p}`,source_component_id:e.source_component_id??void 0,subcircuit_id:e.getSubcircuit()?.subcircuit_id??void 0,supplier_name:d,supplier_part_number:u});c.source_part_not_found_warning.insert(m);return}}})}var sfn=(e,t)=>{let n=e._parsedProps.pinNumber,o=t._parsedProps.pinNumber;if(n!==void 0&&o!==void 0&&n!==o)return!1;return e.isMatchingAnyOf(t.getNameAndAliases())},TOr=(e,t)=>{let n=e.toSorted(),o=t.toSorted();return n.length===o.length&&n.every((r,i)=>r===o[i])},DOr=(e)=>e.getNameAndAliases().find((t)=>/^pin\d+$/.test(t))??null,NOr=(e,t)=>{if(!e._isPrimaryPort&&e.props.name)return e.props.name;if(e.props.name&&(t.get(e.props.name)??0)<=1)return e.props.name;let n=DOr(e);if(n)return n;return e.props.name??null};function k3n(e,t){let n=new Map;for(let o of e)for(let r of new Set(o.getNameAndAliases())){if(/^(pin)?\d+$/.test(r))continue;if(!o._isPrimaryPort&&r===o.props.name)continue;if(!n.has(r))n.set(r,[]);n.get(r).push(o)}for(let o of n.values()){let r=Array.from(new Set(o));if(r.length<2)continue;let i=new Map;for(let c of r){if(!c.props.name)continue;i.set(c.props.name,(i.get(c.props.name)??0)+1)}let s=r.map((c)=>NOr(c,i)).filter((c)=>Boolean(c)),a=Array.from(new Set(s));if(a.length<2)continue;if(t.some((c)=>TOr(c,a)))continue;t.push(a)}}function Gnt(e,t){let n=1,o=new Map;for(let i of e){let s=i.hints.filter((u)=>u&&u.trim()!=="");if(s.length===0)continue;let a=s,c=a.map((u)=>t?.implicitPinNumberByHint?.get(u)).find((u)=>u!==void 0&&a.includes(t?.getPhysicalPinName?.(u)??""));if(c!==void 0)a=[...a.filter((u)=>!/^(?:pin)?\d+$/.test(u)),`pin${c}`];if(!a.some((u)=>u.startsWith("pin")||/^(?:pin)?\d+$/.test(u))){let u=a.map((_)=>t?.implicitPinNumberByHint?.get(_)).find((_)=>_!==void 0);if(u!==void 0)a=[...a,`pin${u}`];else if(t?.allowImplicitPinNumbers===!1)continue;else a=[...a,`pin${n}`]}n++;let h=Rrt(a,t);if(!h)continue;h.originDescription=i.originDescription;let d=h._parsedProps.pinNumber;if(d===void 0)continue;if(h.physicalPinName=t?.getPhysicalPinName?.(d),!o.has(d))o.set(d,[]);o.get(d).push({port:h,component:i.component})}let r=[];for(let[i,s]of o){let a=(u,_)=>{let p=_.getNameAndAliases().filter((m)=>!u.getNameAndAliases().includes(m));u.externallyAddedAliases.push(...p)},c=s[0].port,l=s.filter((u)=>Boolean(u.component));if(l.length!==s.length){for(let u of s.slice(1))a(c,u.port);r.push(c);continue}let h=AFr(l.map((u)=>u.component));if(h.length<=1){for(let u of s.slice(1))a(c,u.port);r.push(c);continue}let d=[c.props.name];for(let[u,_]of h.entries()){let p=l.filter((A)=>_.includes(A.component));if(u===0){for(let A of p.slice(1))a(c,A.port);r.push(c);continue}let m=new sd({name:`pin${i}_internal_${u}`,aliases:c.getNameAndAliases()});m._isPrimaryPort=!1,m._primaryPinNumber=i,m.originDescription=`implicitInternalPhysicalPort:pin${i}:${u}`;for(let A of p)a(m,A.port);d.push(m.props.name),r.push(m)}t?.inferredInternallyConnectedPinNames?.push(d)}if(t?.inferredInternallyConnectedPinNames&&t.inferSharedAliases!==!1)k3n(r,t.inferredInternallyConnectedPinNames);return r}var ROr=P4n.default("tscircuit:core"),QOr=Ee({x:ii,y:ii,z:ii}),Xl=class extends lr{schematicBoxDimensions=null;reactSubtrees=[];_impliedFootprint;_resolvedPcbCalcOffsetX;_resolvedPcbCalcOffsetY;isPrimitiveContainer=!0;_isNormalComponent=!0;_getIsSmt(){if(this._parsedProps.isSmt!==void 0)return this._parsedProps.isSmt;return this.selectAll("smtpad").some((e)=>e.getPrimitiveContainer()===this)}_attributeLowerToCamelNameMap={_isnormalcomponent:"_isNormalComponent"};_asyncSupplierPartNumbers;_asyncFootprintCadModel;_importedSourcePorts=[];_importedInternallyConnectedPinNames;_fetchedSourcePortsForPinAttributes=[];_fetchedInternallyConnectedPinNames;_hasStartedPinAttributesFetch=!1;_isCadModelChild;_inferredInternallyConnectedPinNames=[];pcb_missing_footprint_error_id;_hasStartedFootprintUrlLoad=!1;_hasStartedPartOrientationAnalysis=!1;_asyncSupplierPin1LocationMap;_hasStartedSupplierFootprintMismatchWarningCheck=!1;_hasInflatedCircuitJsonSymbol=!1;_invalidFootprintPropMessages=[];_invalidPinLabelMessages=[];_impliedFootprintPinLabels;_adjustSilkscreenTextAutomatically=!1;get defaultInternallyConnectedPinNames(){return[]}get internallyConnectedPinNames(){return[...this._parsedProps.internallyConnectedPins??this._importedInternallyConnectedPinNames??this.defaultInternallyConnectedPinNames,...this._inferredInternallyConnectedPinNames].map((t)=>t.map((n)=>typeof n==="number"?`pin${n}`:n))}constructor(e){let t={...e},n=[];if(t.pinLabels&&!Array.isArray(t.pinLabels)){let{validPinLabels:o,invalidPinLabelsMessages:r}=rzr(t.pinLabels);t.pinLabels=o,n=r}super(t);if(t.pinLabels&&!Array.isArray(t.pinLabels)){let o=Object.keys(t.pinLabels).find((r)=>jB(r)===null&&!Rde(r));if(o)throw new B4n(this.lowercaseComponentName,this.props,{_errors:[],pinLabels:{_errors:[`Invalid pinLabels key "${o}". Expected "pin\${number}" (e.g. pin1, pin2) or a physical ball name (e.g. A1).`]}})}this._invalidPinLabelMessages=n,this._addChildrenFromStringFootprint(),this._addChildrenFromCircuitJsonSymbol(),this.initPorts()}doInitialSourceNameDuplicateComponentRemoval(){if(!this.name)return;let e=this.root;if((this.getSubcircuit().getNormalComponentNameMap?.()?.get(this.props.name)??[]).filter((r)=>r!==this&&r.renderPhaseStates.SourceNameDuplicateComponentRemoval.initialized).length>0){let r=this._getGlobalPcbPositionBeforeLayout(),i=this._getGlobalSchematicPositionBeforeLayout();e.db.source_failed_to_create_component_error.insert({component_name:this.name,error_type:"source_failed_to_create_component_error",message:`Cannot create component "${this.name}": A component with the same name already exists`,pcb_center:r,schematic_center:i}),this.shouldBeRemoved=!0;let s=[...this.children];for(let a of s)this.remove(a)}}initPorts(e={}){if(A6.isValidElement(this.props.symbol)&&!this.children.some((p)=>p.componentName==="Symbol"))return;this._inferredInternallyConnectedPinNames=[];let{config:n}=this,o=[],r=this._resolvePinLabels(),i=this._parsedProps.pinLabels,s=i&&Array.isArray(i)?Object.fromEntries(i.map((p,m)=>[`pin${m+1}`,p])):i?bde(i):void 0,a=this._getAllPortsFromChildren(),c=a.some((p)=>p._getSymbolAncestor()!==null),l=(p)=>a.some((m)=>m._parsedProps.pinNumber===p)||o.some((m)=>m._parsedProps.pinNumber===p),h=this._getSchematicPortArrangement();if(h&&!r){for(let A in h){let g=h[A].pins;if(Array.isArray(g))for(let f of g){let y=$Y(f,r);if(l(y))continue;o.push(new sd({pinNumber:y,aliases:e.additionalAliases?.[`pin${y}`]??[]},{originDescription:`schPortArrangement:${A}`}))}}let p=["left","right","top","bottom"],m=1;for(let A of p){let g=h[`${A}Size`];for(let f=0;f<g;f++){let y=m++;if(l(y))continue;o.push(new sd({pinNumber:y,aliases:e.additionalAliases?.[`pin${y}`]??[]},{originDescription:`schPortArrangement:${A}`}))}}}if(r)for(let[p,m]of Object.entries(r)){let A=jB(p);if(A===null)throw Error(`Invalid pinLabels key "${p}". Expected "pin\${number}" (e.g. pin1, pin2) or a physical ball name (e.g. A1).`);let g=a.find((v)=>v._parsedProps.pinNumber===A)??o.find((v)=>v._parsedProps.pinNumber===A),f=Array.isArray(m)?m:[m],x=s?.[p]!==void 0,C=this._getPhysicalPinName(A),b=C??(x?f[0]:`pin${A}`),I=C?f:x?f.slice(1):f;if(!g)g=new sd({pinNumber:A,name:b,aliases:[...x?[]:e.additionalAliases?.[`pin${A}`]??[],...I,...x?e.additionalAliases?.[`pin${A}`]??[]:[]]},{originDescription:`pinLabels:pin${A}`}),o.push(g);else g.externallyAddedAliases.push(b,...I);g.physicalPinName=C}if(n.schematicSymbolName&&!e.ignoreSymbolPorts){let p=zs[this._getSchematicSymbolNameOrThrow()];if(!p)return;let m=p.ports.some((f)=>f.labels.some((y)=>!/^(?:pin)?\d+$/.test(y)));if(m&&r){for(let f=1;f<=(e.pinCount??0);f++)if(!l(f))o.push(new sd({pinNumber:f}))}let A=[...this._getAllPortsFromChildren(),...o],g=new Map;for(let f of p.ports){let y=f.labels.filter((C)=>!/^(?:pin)?\d+$/.test(C)),x=A.filter((C)=>C.getNameAndAliases().some((b)=>y.includes(b)));if(x.length===1)g.set(f,x[0])}for(let f of p.ports){let y=D8e(f.labels);if(!y)continue;let x=A.filter((b)=>![...g.values()].includes(b)),C=g.get(f)??x.find((b)=>b._parsedProps.pinNumber===Number(y))??(m&&p.ports.length-g.size===1&&x.length===1?x[0]:void 0);if(C)g.set(f,C),C.schematicSymbolPortDef=f;else{if(c)continue;let b=Rrt(f.labels.concat(e.additionalAliases?.[`pin${y}`]??[]));if(b)b.originDescription=`schematicSymbol:labels[0]:${f.labels[0]}`,b.schematicSymbolPortDef=f,o.push(b)}}this.addAll(o)}let d=A6.isValidElement(this.props.symbol),u=Qrt(this.props.symbol);if(!d&&!u){let p=this.getPortsFromFootprint({...e,allowImplicitPinNumbers:!s,collectInferredInternallyConnectedPins:!0}),m=this._getAllPortsFromChildren();for(let A of p){if(!A._isPrimaryPort){o.push(A);continue}let g=m.find((f)=>sfn(f,A))??o.find((f)=>sfn(f,A));if(g){let f=A.getNameAndAliases().filter((y)=>!g.getNameAndAliases().includes(y));g.externallyAddedAliases.push(...f)}else if(!h)o.push(A)}}let _=e.pinCount??this._getPrimaryPinCount()??0;for(let p=1;p<=_;p++){if(l(p))continue;if(!h&&s&&!Array.isArray(i)&&!s[`pin${p}`])continue;if(!h){o.push(new sd({pinNumber:p,aliases:e.additionalAliases?.[`pin${p}`]??[]}));continue}let m=ave(h).map((A)=>$Y(A,r));if(["leftSize","rightSize","topSize","bottomSize","leftPinCount","rightPinCount","topPinCount","bottomPinCount"].some((A)=>(A in h)))m=Array.from({length:this._getPrimaryPinCount()},(A,g)=>g+1);if(!m.includes(p))continue;o.push(new sd({pinNumber:p,aliases:e.additionalAliases?.[`pin${p}`]??[]},{originDescription:`notOtherwiseAddedButDeducedFromPinCount:${p}`}))}if(k3n(Array.from(new Set([...this._getAllPortsFromChildren(),...o].filter((p)=>!p.physicalPinName))),this._inferredInternallyConnectedPinNames),o.length>0)this.addAll(o)}_resolvePinLabels(){let e=this._parsedProps.pinLabels,t=e&&Array.isArray(e)?Object.fromEntries(e.map((o,r)=>[`pin${r+1}`,o])):e?bde(e):void 0,n={...this._impliedFootprintPinLabels??{},...t??{}};if(Object.keys(n).length===0)return;return n}_resolvedPackagePins;_getPhysicalPinName(e){let t=this._parsedProps?.pinLabels??this.props.pinLabels;if(!t||Array.isArray(t))return;return this._resolvedPackagePins??=Sst(t),this._resolvedPackagePins.find((n)=>n.pinNumber===e)?.physicalPinName}_getImpliedFootprintString(){return null}resolveFootprint(){return this._parsedProps.footprint??this.props.footprint??this._getImpliedFootprintString?.()}_addChildrenFromStringFootprint(){let{pcbRotation:e,pcbPinLabels:t}=this.props,n=this._resolvePinLabels(),o=this.resolveFootprint();if(!o)return;if(typeof o==="string"){if(iL(o))return;if(rL(o))return;if(Lde(o))return;if(JJ(o))return;let r;try{r=Ah.string(o).soup()}catch(s){this._queueInvalidFootprintPropMessage(o,s);return}let i=JB({sourcePortOwner:this,componentName:this.name??this.componentName,componentRotation:e,footprinterString:o,pinLabels:n,pcbPinLabels:t},r);this.addAll(i)}}_addChildrenFromCircuitJsonSymbol(){if(this._hasInflatedCircuitJsonSymbol)return;let e=this._parsedProps.symbol;if(!Qrt(e))return;if(this.children.some((i)=>i.componentName==="Symbol")){this._hasInflatedCircuitJsonSymbol=!0;return}let t=wzr(e);if(t.length===0)return;let n=Mzr(t),o=JB({sourcePortOwner:this,componentName:this.name??this.componentName,componentRotation:String(this.props.schRotation??0)},n);if(o.length===0)return;if(this._hasInflatedCircuitJsonSymbol=!0,!o.some((i)=>i.componentName==="Symbol")){let i=new Hst({name:this.name??this.componentName});i.addAll(o),this.add(i);return}this.addAll(o)}get portMap(){return new Proxy({},{get:(e,t)=>{let n=this.children.find((r)=>r.componentName==="Symbol"),o=[...this.children,...n?.children??[]].find((r)=>r.componentName==="Port"&&r.isMatchingNameOrAlias(t));if(!o)throw Error(`There was an issue finding the port "${t.toString()}" inside of a ${this.componentName} component with name: "${this.props.name}". This is a bug in @tscircuit/core`);return o}})}getInstanceForReactElement(e){for(let t of this.reactSubtrees)if(t.element===e)return t.component;return null}doInitialSourceRender(){let e=this.config.sourceFtype;if(!e)return;let{db:t}=this.root,{_parsedProps:n}=this,o=t.source_component.insert({ftype:e,name:this.name,manufacturer_part_number:hi(n),supplier_part_numbers:n.supplierPartNumbers,display_name:n.displayName});this.source_component_id=o.source_component_id}getRefDesPrefixes(){return M3n(this.config.sourceFtype)}doInitialCheckRefDesConvention(){$zr(this)}doInitialSourceParentAttachment(){let{db:e}=this.root,t=this._getInternallyConnectedPins().map((n)=>n.map((o)=>o.source_port_id).filter((o)=>o!==null)).filter((n)=>n.length>=2);if(this.source_component_id&&t.length>0)e.source_component.update(this.source_component_id,{internally_connected_source_port_ids:t});for(let n of t)e.source_component_internal_connection.insert({source_component_id:this.source_component_id,subcircuit_id:this.getSubcircuit()?.subcircuit_id,source_port_ids:n})}updateSourceParentAttachment(){let{db:e}=this.root;for(let t of e.source_component_internal_connection.list({source_component_id:this.source_component_id}))e.source_component_internal_connection.delete(t.source_component_internal_connection_id);this.doInitialSourceParentAttachment()}doInitialSchematicComponentRender(){gOr(this)}_getSchematicSymbolDisplayValue(){return}_getInternallyConnectedPins(){if(this.internallyConnectedPinNames.length===0)return[];let e=[];for(let t of this.internallyConnectedPinNames){let n=[];for(let o of t){let r=this.portMap[o]??this.portMap[`pin${o}`];if(r)n.push(r)}e.push(n)}return e}_doInitialSchematicComponentRenderWithSymbol(){if(this.root?.schematicDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,n=this._getSchematicSymbolNameOrThrow(),o=zs[n],r=this._getGlobalSchematicPositionBeforeLayout();if(o){let i=e.schematic_component.insert({center:r,size:{...o.size},source_component_id:this.source_component_id,is_box_with_pins:!0,symbol_name:n,schematic_sheet_id:this._resolveSchematicSheetId(),symbol_display_value:this._getSchematicSymbolDisplayValue()});this.schematic_component_id=i.schematic_component_id}}_doInitialSchematicComponentRenderWithReactSymbol(e){if(this.root?.schematicDisabled)return;let{db:t}=this.root,n=this._getGlobalSchematicPositionBeforeLayout(),o=t.schematic_component.insert({center:n,size:{width:0,height:0},source_component_id:this.source_component_id,symbol_display_value:this._getSchematicSymbolDisplayValue(),is_box_with_pins:!1,schematic_sheet_id:this._resolveSchematicSheetId()});this.schematic_component_id=o.schematic_component_id}_doInitialSchematicComponentRenderWithSchematicBoxDimensions(e){if(this.root?.schematicDisabled)return;let{db:t}=this.root,{_parsedProps:n}=this;this.schematicBoxDimensions=e;let o={};if(Array.isArray(n.pinLabels))n.pinLabels.forEach((_,p)=>{o[String(p+1)]=_});else for(let[_,p]of Object.entries(n.pinLabels??{}))o[_]=Array.isArray(p)?p[0]:p;let r=this._getGlobalSchematicPositionBeforeLayout(),i=this._getSchematicPortArrangement(),s=t.schematic_component.insert({center:r,rotation:n.schRotation??0,size:e.getSize(),port_arrangement:Qst(i),pin_spacing:0.2,pin_styles:Rst(n.schPinStyle,n.pinLabels),port_labels:o,source_component_id:this.source_component_id,schematic_sheet_id:this._resolveSchematicSheetId()}),a=i?.topSide!==void 0,c=a||i?.bottomSide!==void 0,l=e?.getSize().width,h=e?.getSize().height,d=t.schematic_text.insert({text:hi(n)??"",schematic_component_id:s.schematic_component_id,anchor:"left",rotation:0,position:{x:a?r.x+(l??0)/2+0.1:r.x-(l??0)/2,y:c?r.y+(h??0)/2+0.35:r.y-(h??0)/2-0.13},color:"#006464",font_size:0.18,schematic_sheet_id:this._resolveSchematicSheetId()}),u=t.schematic_text.insert({text:n.displayName??n.name??"",schematic_component_id:s.schematic_component_id,anchor:"left",rotation:0,position:{x:a?r.x+(l??0)/2+0.1:r.x-(l??0)/2,y:c?r.y+(h??0)/2+0.55:r.y+(h??0)/2+0.13},color:"#006464",font_size:0.18,schematic_sheet_id:this._resolveSchematicSheetId()});this.schematic_component_id=s.schematic_component_id}doInitialPcbComponentRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,n=this.getSubcircuit(),o=this._getPcbComponentLayer();if(o!=="top"&&o!=="bottom"){let l=Aj.parse({type:"pcb_component_invalid_layer_error",message:`Component cannot be placed on layer '${o}'. Components can only be placed on 'top' or 'bottom' layers.`,source_component_id:this.source_component_id,layer:o,subcircuit_id:n.subcircuit_id??void 0});e.pcb_component_invalid_layer_error.insert(l)}let r=this.getGlobalTransformRotation(),i=e.pcb_component.insert({center:this._getGlobalPcbPositionBeforeLayout(),width:0,height:0,layer:o==="top"||o==="bottom"?o:"top",rotation:Bu(r),insertion_direction:this._getPcbComponentInsertionDirection(o,r),source_component_id:this.source_component_id,subcircuit_id:n.subcircuit_id??void 0,do_not_place:t.doNotPlace??!1,obstructs_within_bounds:t.obstructsWithinBounds??!0,is_allowed_to_be_off_board:t.allowOffBoard??!1,metadata:t.kicadFootprintMetadata?{kicad_footprint:t.kicadFootprintMetadata}:void 0}),s=this.resolveFootprint(),a=this.children.some((l)=>l.componentName==="Footprint");if(!s&&!a&&!this.isGroup){let l=e.pcb_missing_footprint_error.insert({message:`No footprint specified for component: ${this.getString()}`,source_component_id:`${this.source_component_id}`,error_type:"pcb_missing_footprint_error"});this.pcb_missing_footprint_error_id=l.pcb_missing_footprint_error_id}this.pcb_component_id=i.pcb_component_id;let c=this.getSubcircuit()._getPcbManualPlacementForComponent(this);if((this.props.pcbX!==void 0||this.props.pcbY!==void 0)&&!!c){let l=Nfe.parse({type:"pcb_manual_edit_conflict_warning",pcb_manual_edit_conflict_warning_id:`pcb_manual_edit_conflict_${this.source_component_id}`,message:`${this.getString()} has both manual placement and prop coordinates. pcbX and pcbY will be used. Remove pcbX/pcbY or clear the manual placement.`,pcb_component_id:this.pcb_component_id,source_component_id:this.source_component_id,subcircuit_id:n.subcircuit_id??void 0});e.pcb_manual_edit_conflict_warning.insert(l)}}doInitialPcbComponentSizeCalculation(){if(this.root?.pcbDisabled)return;if(!this.pcb_component_id)return;let{db:e}=this.root;Wzr(this);let t=T8e(this.children);if(t.width===0||t.height===0)return;let n={x:(t.minX+t.maxX)/2,y:(t.minY+t.maxY)/2};e.pcb_component.update(this.pcb_component_id,{center:n,width:t.width,height:t.height})}updatePcbComponentSizeCalculation(){this.doInitialPcbComponentSizeCalculation()}doInitialSchematicComponentSizeCalculation(){if(this.root?.schematicDisabled)return;if(!this.schematic_component_id)return;let{db:e}=this.root;if(!e.schematic_component.get(this.schematic_component_id))return;let n=[],o=(l)=>{for(let h of l){if(h.isSchematicPrimitive&&h.componentName==="SchematicLine"){let d=e.schematic_line.get(h.schematic_line_id);if(d)n.push(d)}if(h.isSchematicPrimitive&&h.componentName==="SchematicRect"){let d=e.schematic_rect.get(h.schematic_rect_id);if(d)n.push(d)}if(h.isSchematicPrimitive&&h.componentName==="SchematicCircle"){let d=e.schematic_circle.get(h.schematic_circle_id);if(d)n.push(d)}if(h.isSchematicPrimitive&&h.componentName==="SchematicArc"){let d=e.schematic_arc.get(h.schematic_arc_id);if(d)n.push(d)}if(h.isSchematicPrimitive&&h.componentName==="SchematicPath"){let d=h.schematic_path_ids;if(d)for(let u of d){let _=e.schematic_path.get(u);if(_)n.push(_)}}if(h.children&&h.children.length>0)o(h.children)}};if(o(this.children),n.length===0)return;let r=Uue(n),i=Math.abs(r.maxX-r.minX),s=Math.abs(r.maxY-r.minY);if(i===0&&s===0)return;let a=(r.minX+r.maxX)/2,c=(r.minY+r.maxY)/2;e.schematic_component.update(this.schematic_component_id,{center:{x:a,y:c},size:{width:i,height:s}})}updateSchematicComponentSizeCalculation(){this.doInitialSchematicComponentSizeCalculation()}doInitialPcbComponentAnchorAlignment(){cOr(this)}updatePcbComponentAnchorAlignment(){this.doInitialPcbComponentAnchorAlignment()}doInitialResolveFootprintPinLabels(){_Or(this)}updateResolveFootprintPinLabels(){this.doInitialResolveFootprintPinLabels()}_renderReactSubtree(e){let t=Wue(e);return{element:e,component:t}}doInitialInitializePortsFromChildren(){this.initPorts()}updateInitializePortsFromChildren(){this.initPorts()}getGlobalTransformRotation(){let e=this._computePcbGlobalTransformBeforeLayout();return Zd(e).rotation.angle*180/Math.PI}_footprintChildCache;_getFootprintMetadataForPcbComponent(){if(!this._footprintChildCache||this._footprintChildCache.children!==this.children||this._footprintChildCache.childrenVersion!==this._childrenVersion||this._footprintChildCache.childCount!==this.children.length)this._footprintChildCache={children:this.children,childrenVersion:this._childrenVersion,childCount:this.children.length,footprintChild:this.children.find((n)=>n.componentName==="Footprint")};let{footprintChild:e}=this._footprintChildCache;if(e)return{insertionDirection:e._parsedProps.insertionDirection,cutoutApertureDirection:e._parsedProps.cutoutApertureDirection,originalLayer:e._parsedProps.originalLayer};let t=this.resolveFootprint();if(A6.isValidElement(t)){let n=t.props;return{insertionDirection:n.insertionDirection,cutoutApertureDirection:n.cutoutApertureDirection,originalLayer:n.originalLayer}}if(t?.componentName==="Footprint")return{insertionDirection:t._parsedProps?.insertionDirection??t.props?.insertionDirection,cutoutApertureDirection:t._parsedProps?.cutoutApertureDirection??t.props?.cutoutApertureDirection,originalLayer:t._parsedProps?.originalLayer??t.props?.originalLayer};if(typeof t==="string"&&/^(pinrow|headermodule|smdpinheader)(?=\d|_|$)/.test(t)){if(!Ah.string(t).params().rightangle)return{insertionDirection:"from_above"}}return}_getPcbComponentLayer(){return this._parsedProps.layer??(this._getFootprintOriginalLayer()==="bottom"?"bottom":"top")}_getFootprintOriginalLayer(){return this._getFootprintMetadataForPcbComponent()?.originalLayer}_getPcbComponentInsertionDirection(e,t=this.getGlobalTransformRotation()){let n=this._getFootprintMetadataForPcbComponent();if(!n?.insertionDirection)return;return kHr({insertionDirection:n.insertionDirection,rotationDegrees:t,isFlipped:Qde({componentLayer:e,originalLayer:n.originalLayer})})}_getPcbComponentInsertionAxisDirection(e,t=this.getGlobalTransformRotation()){let n=this._getFootprintMetadataForPcbComponent();if(!n?.insertionDirection)return;return Irt({insertionDirection:n.insertionDirection,rotationDegrees:t,isFlipped:Qde({componentLayer:e,originalLayer:n.originalLayer})})}_getEnclosureApertureAxisDirection(e,t=this.getGlobalTransformRotation()){let n=this._getFootprintMetadataForPcbComponent(),o=n?.cutoutApertureDirection??n?.insertionDirection;if(!o)return;return Irt({insertionDirection:o,rotationDegrees:t,isFlipped:Qde({componentLayer:e,originalLayer:n?.originalLayer})})}doInitialReactSubtreesRender(){let e=this.props.footprint;if(A6.isValidElement(e)){if(!this.children.some((i)=>i.componentName==="Footprint"))this.add(e)}let t=this.props.symbol;if(A6.isValidElement(t)){if(!this.children.some((i)=>i.componentName==="Symbol"))this.add(t)}let n=this.props.cadModel;if(A6.isValidElement(n)){this._isCadModelChild=!0;let r=this.children.some((s)=>s.componentName==="CadAssembly"),i=this.children.some((s)=>s.componentName==="CadModel");if(!r&&!i)this.add(n)}let o=this.props.spiceModel;if(A6.isValidElement(o)){if(!this.children.some((i)=>i.componentName==="SpiceModel"))this.add(o)}}doInitialPcbFootprintStringRender(){mOr(this,(e,t)=>this._queueAsyncEffect(e,t))}_getAllPortsFromChildren(){let e=[],t=(n)=>{if(n.componentName==="Port")e.push(n);for(let o of n.children)t(o)};for(let n of this.children)t(n);return e}_hasExistingPortExactly(e){return this._getAllPortsFromChildren().some((n)=>{let o=e.getNameAndAliases(),r=n.getNameAndAliases();return o.length===r.length&&o.every((i)=>r.includes(i))})}_hasMatchingPort(e){let t=this._getAllPortsFromChildren(),n=e._parsedProps.pinNumber;if(n===void 0)return!1;return t.some((o)=>o._parsedProps.pinNumber===n)}add(e){let t;if(A6.isValidElement(e)){let n=this._renderReactSubtree(e);this.reactSubtrees.push(n),t=n.component}else t=e;if(t.componentName==="Port"){if(this._hasExistingPortExactly(t))return;if(this._hasMatchingPort(t)){ROr(`Skipping port ${t} because a matching port already exists`);return}}super.add(t)}getPortsFromFootprint(e){let t=void 0;if(e?.collectInferredInternallyConnectedPins)t=this._inferredInternallyConnectedPinNames;let n=this._parsedProps?.pinLabels??this.props.pinLabels,o=n&&!Array.isArray(n)&&Object.keys(n).some(Rde),r=new Map,i=new Set,s=this._parsedProps?.pinLabels??this.props.pinLabels,a=s&&!Array.isArray(s)?bde(s):s;if(a){let h=Array.isArray(a)?a.map((d,u)=>[`pin${u+1}`,d]):Object.entries(a);for(let[d,u]of h){let _=jB(d);if(_===null)continue;let p=Array.isArray(u)?u:[u];for(let m of p)if(typeof m==="string"&&m.length>0){let A=r.get(m);if(o&&A!==void 0&&A!==_)i.add(m);r.set(m,_)}}}for(let h of i)r.delete(h);let c={...e,inferSharedAliases:!o,getPhysicalPinName:(h)=>this._getPhysicalPinName(h),inferredInternallyConnectedPinNames:t,implicitPinNumberByHint:r},{footprint:l}=this.props;if(typeof l==="string"&&JJ(l)&&this.children.some((h)=>h.componentName==="Footprint"))l=this.children.find((h)=>h.componentName==="Footprint");else if(!l||A6.isValidElement(l))l=this.children.find((h)=>h.componentName==="Footprint");if(typeof l==="string"){if(iL(l))return[];if(rL(l))return[];if(Lde(l))return[];if(JJ(l))return[];let h;try{h=Ah.string(l).soup()}catch(d){return this._queueInvalidFootprintPropMessage(l,d),[]}return Gnt(h.flatMap((d)=>("port_hints"in d)&&d.port_hints?[{hints:d.port_hints,originDescription:`footprint:string:${l}:port_hints[0]:${d.port_hints[0]}`}]:[]),c)}if(!A6.isValidElement(l)&&l&&l.componentName==="Footprint")return Gnt(l.children.flatMap((d)=>d.props.portHints?[{hints:d.props.portHints,originDescription:`footprint:${l}`,component:d}]:[]),c);if(!l)return Gnt(this.children.filter((h)=>h.props.portHints&&h.isPcbPrimitive).map((h)=>({hints:h.props.portHints,originDescription:"direct PCB primitive",component:h})),{...c,allowImplicitPinNumbers:!1});return[]}_queueInvalidFootprintPropMessage(e,t){let n=t instanceof Error?t.message:String(t),o=e.includes("/")&&!e.includes(":"),i=/^c\d+$/i.test(e)?`C${e.replace(/^c/i,"")}`:null,s=o?` If this is a KiCad footprint, use "kicad:${e}".`:i?` If this is a JLCPCB part number, use "jlcpcb:${i}".`:"",a=`Invalid footprint prop on ${this.getDisplayName()}: "${e}".${s} Parser details: ${n}`;if(!this._invalidFootprintPropMessages.includes(a))this._invalidFootprintPropMessages.push(a)}_insertInvalidFootprintPropErrors(){for(let e of this._invalidFootprintPropMessages)this.root.db.source_invalid_component_property_error.insert({source_component_id:this.source_component_id||"",property_name:"footprint",message:e,error_type:"source_invalid_component_property_error"});this._invalidFootprintPropMessages=[]}getPortsFromSchematicSymbol(){if(this.root?.schematicDisabled)return[];let{config:e}=this;if(!e.schematicSymbolName)return[];let t=zs[e.schematicSymbolName];if(!t)return[];let n=[];for(let o of t.ports){let r=Rrt(o.labels);if(r)r.schematicSymbolPortDef=o,n.push(r)}return n}doInitialCreateNetsFromProps(){this._createNetsFromProps(this._getNetsFromConnectionsProp())}_getNetsFromConnectionsProp(){let{_parsedProps:e}=this,t=[];if(e.connections)for(let[n,o]of Object.entries(e.connections)){let r=Array.isArray(o)?o:[o];for(let i of r)t.push(String(i))}return t}_createNetsFromProps(e){Gue(this,e)}_getPcbCircuitJsonBounds(){let{db:e}=this.root;if(!this.pcb_component_id)return super._getPcbCircuitJsonBounds();let t=e.pcb_component.get(this.pcb_component_id);return{center:{x:t.center.x,y:t.center.y},bounds:{left:t.center.x-t.width/2,top:t.center.y-t.height/2,right:t.center.x+t.width/2,bottom:t.center.y+t.height/2},width:t.width,height:t.height}}_getPinCountFromSchematicPortArrangement(){let e=this._getSchematicPortArrangement();if(!e)return 0;if(!b3n(e))return(e.leftSize??e.leftPinCount??0)+(e.rightSize??e.rightPinCount??0)+(e.topSize??e.topPinCount??0)+(e.bottomSize??e.bottomPinCount??0);let n=ave(e),o=0;for(let r of n){if(typeof r==="number"){o=Math.max(o,r);continue}let i=jB(r);if(i!==null){o=Math.max(o,i);continue}let s=this._parsedProps.pinLabels;if(s)o=Math.max(o,$Y(r,s))}return Math.max(o,n.length)}_getPrimaryPinCount(){if(this._getSchematicPortArrangement())return this._getPinCountFromSchematicPortArrangement();let t=this.getPortsFromFootprint();if(t.length>0)return t.filter((o)=>o._isPrimaryPort).length;let{pinLabels:n}=this._parsedProps;if(n){if(Array.isArray(n))return n.length;let o=Object.keys(n).map((r)=>jB(r)).filter((r)=>r!==null&&!Number.isNaN(r));if(o.length>0)return Math.max(...o);return Object.keys(n).length}return 0}_getSchematicPortArrangement(){return this._parsedProps.schPinArrangement??this._parsedProps.schPortArrangement}_getPinLabelsFromPorts(){let e=this.selectAll("port"),t={};for(let n of e){let o=n.props.pinNumber;if(o!==void 0){let r=n._getBestDisplayPinLabel();if(r)t[`pin${o}`]=r}}return t}_getImplicitSparseSchematicPortArrangement(e){let t=Array.from(new Set(this._getAllPortsFromChildren().filter((i)=>i._isPrimaryPort).map((i)=>i._parsedProps.pinNumber).filter((i)=>i!==void 0))).sort((i,s)=>i-s);if(t.length!==e)return;if(!t.some((i,s)=>i!==s+1))return;let o=Math.floor(e/2),r=e-o;return{leftSide:{pins:t.slice(0,r)},rightSide:{pins:t.slice(r)}}}_getSchematicBoxDimensions(){if(this.schematicBoxDimensions)return this.schematicBoxDimensions;return this._computeSchematicBoxDimensions()}_computeSchematicBoxDimensions(){if(this.getSchematicSymbol())return null;if(!this.config.shouldRenderAsSchematicBox&&!this._parsedProps?.showAsSchematicBox)return null;let{_parsedProps:e}=this,t=this._getPrimaryPinCount(),n=0.2,o=this._getPinLabelsFromPorts(),r=Array.isArray(e.pinLabels)?Object.fromEntries(e.pinLabels.map((a,c)=>[`pin${c+1}`,a])):e.pinLabels?bde(e.pinLabels):void 0,i={...o,...r},s=this._getSchematicPortArrangement()??this._getImplicitSparseSchematicPortArrangement(t);if(e.pinLabels&&!Array.isArray(e.pinLabels)&&Object.keys(e.pinLabels).some(Rde)&&s)for(let a of ave(s))$Y(a,e.pinLabels);return Fst({schWidth:e.schWidth,schHeight:e.schHeight,schPinSpacing:n,numericSchPinStyle:oue(e.schPinStyle,!Array.isArray(e.pinLabels)?e.pinLabels??i:i),pinCount:t,schPortArrangement:s,pinLabels:i})}getFootprinterString(){let e=this.resolveFootprint();if(typeof e==="string")return e;return null}doInitialCadModelRender(){if(this._isCadModelChild)return;if(this.props.doNotPlace)return;let{db:e}=this.root,{boardThickness:t=0}=this._getBoard()??{},n=this._parsedProps.cadModel,o=n===void 0?this._asyncFootprintCadModel:n,r=this.getFootprinterString()??void 0,i=!1;if(r)i=!JJ(r)&&!iL(r)&&!rL(r)&&!Lde(r);if(!this.pcb_component_id)return;if(o===null)return;let s=this._getPcbCircuitJsonBounds();if(typeof o==="string")throw Error("String cadModel not yet implemented");let a=o?.pcbRotationOffset??o?.rotationOffset,c=QOr.parse({x:0,y:0,z:typeof a==="number"?a:0,...typeof a==="object"?a:{}}),l=i5.parse({x:0,y:0,z:0,...typeof o?.positionOffset==="object"?o.positionOffset:{}}),h=o&&typeof o==="object"&&"zOffsetFromSurface"in o?o.zOffsetFromSurface!==void 0?Ke.parse(o.zOffsetFromSurface):0:0,d=this.props.layer==="bottom"?"bottom":"top",u=e.pcb_component.get(this.pcb_component_id),_=this._computePcbGlobalTransformBeforeLayout(),m=Zd(_).rotation.angle*180/Math.PI,A=u?.position_mode==="packed"?u.rotation??m:m,g=d==="bottom";if(!o&&!i){let C={position:{x:s.center.x,y:s.center.y,z:d==="bottom"?-t/2:t/2},rotation:frt({layer:d,pcbCcwRotationDegrees:A,modelCcwRotationOffsetDegrees:{x:0,y:0,z:0}})};C=xrt(this,C);let b=e.cad_component.insert({...C,pcb_component_id:this.pcb_component_id,source_component_id:this.source_component_id,model_origin_alignment:"center_of_component_on_board_surface",anchor_alignment:"center_of_component_on_board_surface",show_as_bounding_box:!0,show_as_translucent_model:this._parsedProps.showAsTranslucentModel});this.cad_component_id=b.cad_component_id;return}let f;if(!o&&i)f=r;let y={position:{x:s.center.x+l.x,y:s.center.y+l.y,z:(d==="bottom"?-t/2:t/2)+(d==="bottom"?-h:h)+l.z},rotation:frt({layer:d,pcbCcwRotationDegrees:A,modelCcwRotationOffsetDegrees:c})};y=xrt(this,y);let x=e.cad_component.insert({...y,pcb_component_id:this.pcb_component_id,source_component_id:this.source_component_id,model_stl_url:"stlUrl"in(o??{})?this._addCachebustToModelUrl(o.stlUrl):void 0,model_obj_url:"objUrl"in(o??{})?this._addCachebustToModelUrl(o.objUrl):void 0,model_mtl_url:"mtlUrl"in(o??{})?this._addCachebustToModelUrl(o.mtlUrl):void 0,model_gltf_url:"gltfUrl"in(o??{})?this._addCachebustToModelUrl(o.gltfUrl):void 0,model_glb_url:"glbUrl"in(o??{})?this._addCachebustToModelUrl(o.glbUrl):void 0,model_step_url:"stepUrl"in(o??{})?this._addCachebustToModelUrl(o.stepUrl):void 0,model_wrl_url:"wrlUrl"in(o??{})?this._addCachebustToModelUrl(o.wrlUrl):void 0,model_jscad:"jscad"in(o??{})?o.jscad:void 0,model_unit_to_mm_scale_factor:typeof o?.modelUnitToMmScale==="number"?o.modelUnitToMmScale:void 0,model_board_normal_direction:o?.modelBoardNormalDirection,model_origin_alignment:"center_of_component_on_board_surface",anchor_alignment:"center_of_component_on_board_surface",model_origin_position:o?.modelOriginPosition,...o?.size?{size:o.size}:{},footprinter_string:f,show_as_translucent_model:this._parsedProps.showAsTranslucentModel});this.cad_component_id=x.cad_component_id}_addCachebustToModelUrl(e){if(!e||!e.includes("modelcdn.tscircuit.com"))return e;let t=this.root?.getClientOrigin()??"";return`${e}${e.includes("?")?"&":"?"}cachebust_origin=${encodeURIComponent(t)}`}_getPartsEngineCacheKey(e,t){return JSON.stringify({ftype:e.ftype,name:e.name,manufacturer_part_number:e.manufacturer_part_number,standard:e.standard,pin_count:e.pin_count,footprinterString:t})}async _getSupplierPartNumbers(e,t,n){if(this.props.doNotPlace)return{};let o=this.root?.platform?.localCacheEngine,r=this._getPartsEngineCacheKey(t,n);if(o){let a=await o.getItem(r);if(a)try{return JSON.parse(a)}catch{}}let i=await Promise.resolve(e.findPart({sourceComponent:t,footprinterString:n}));if(typeof i==="string"){if(i.includes("<!DOCTYPE")||i.includes("<html"))throw Error(`Failed to fetch supplier part numbers: Received HTML response instead of JSON. Response starts with: ${i.substring(0,100)}`);if(i==="Not found")throw Error(`Part not found for ${this.getString()}${n?` with footprint "${n}"`:""}`);throw Error(`Invalid supplier part numbers format: Expected object but got string: "${i}"`)}if(!i||Array.isArray(i)||typeof i!=="object"){let a=i===null?"null":Array.isArray(i)?"array":typeof i;throw Error(`Invalid supplier part numbers format: Expected object but got ${a}`)}let s=i;if(o)try{await o.setItem(r,JSON.stringify(s))}catch{}return s}doInitialPartsEngineRender(){if(this.props.doNotPlace)return;if(this.getInheritedProperty("bomDisabled"))return;if(this.getInheritedProperty("partsEngineDisabled"))return;let e=this.getInheritedProperty("partsEngine");if(!e)return;let{db:t}=this.root,n=t.source_component.get(this.source_component_id);if(!n)return;if(n.supplier_part_numbers)return;let o=this.props.footprint??this._getImpliedFootprintString(),r=typeof o==="string"?o:void 0,i=this._getSupplierPartNumbers(e,n,r);if(!(i instanceof Promise)){t.source_component.update(this.source_component_id,{supplier_part_numbers:i});return}this._queueAsyncEffect("get-supplier-part-numbers",async()=>{await i.then((s)=>{this._asyncSupplierPartNumbers=s,this._markDirty("PartsEngineRender")}).catch((s)=>{this._asyncSupplierPartNumbers={};let a=IR.parse({type:"source_part_not_found_warning",message:`Failed to fetch supplier part numbers for ${this.getString()}: ${s.message}`,source_component_id:this.source_component_id??void 0,subcircuit_id:this.getSubcircuit()?.subcircuit_id??void 0,manufacturer_part_number:n.manufacturer_part_number??void 0,part_name:n.name??void 0});t.source_part_not_found_warning.insert(a),this._markDirty("PartsEngineRender")})})}updatePartsEngineRender(){if(this.props.doNotPlace)return;if(this.getInheritedProperty("bomDisabled"))return;if(this.getInheritedProperty("partsEngineDisabled"))return;let{db:e}=this.root,t=e.source_component.get(this.source_component_id);if(!t)return;if(t.supplier_part_numbers)return;if(this._asyncSupplierPartNumbers){e.source_component.update(this.source_component_id,{supplier_part_numbers:this._asyncSupplierPartNumbers});return}}doInitialMissingManufacturerPartNumberWarning(){COr(this)}updateMissingManufacturerPartNumberWarning(){this.doInitialMissingManufacturerPartNumberWarning()}doInitialComponentAvailabilityWarning(){nfn(this)}updateComponentAvailabilityWarning(){nfn(this,{refresh:!0})}doInitialPartOrientationAnalysis(){sOr(this)}updatePartOrientationAnalysis(){aOr(this)}doInitialSupplierFootprintMismatchWarning(){BOr(this)}updateSupplierFootprintMismatchWarning(){this.doInitialSupplierFootprintMismatchWarning()}doInitialAssignFallbackProps(){let{_parsedProps:e}=this;if(e.connections&&!this.name)this.fallbackUnassignedName=this.getSubcircuit().getNextAvailableName(this)}doInitialCreateTracesFromProps(){this._createTracesFromConnectionsProp()}_createTracesFromConnectionsProp(){let{_parsedProps:e}=this;if(e.connections)for(let[t,n]of Object.entries(e.connections)){let o=Array.isArray(n)?n:[n];for(let r of o)this.add(new O_({from:`.${this.name} > .${t}`,to:String(r)}))}}doInitialSourceDesignRuleChecks(){yOr(this),xAn(this)}updateSourceDesignRuleChecks(){xAn(this)}doInitialSourceComponentPropertyValidation(){this._insertInvalidFootprintPropErrors()}doInitialValidatePcbCoordinates(){if(super.doInitialValidatePcbCoordinates(),this.root?.pcbDisabled)return;let e=this._parsedProps,t=this.props,n=typeof t.pcbLeftEdgeX==="string"?t.pcbLeftEdgeX:e.pcbLeftEdgeX??t.pcbLeftEdgeX,o=typeof t.pcbRightEdgeX==="string"?t.pcbRightEdgeX:e.pcbRightEdgeX??t.pcbRightEdgeX,r=typeof t.pcbTopEdgeY==="string"?t.pcbTopEdgeY:e.pcbTopEdgeY??t.pcbTopEdgeY,i=typeof t.pcbBottomEdgeY==="string"?t.pcbBottomEdgeY:e.pcbBottomEdgeY??t.pcbBottomEdgeY;if(!(e.pcbX!==void 0||e.pcbY!==void 0||n!==void 0||o!==void 0||r!==void 0||i!==void 0))return;if(n!==void 0)this._validatePcbCoordinateReferences({rawValue:n,axis:"pcbX",propertyName:"pcbLeftEdgeX"});if(o!==void 0)this._validatePcbCoordinateReferences({rawValue:o,axis:"pcbX",propertyName:"pcbRightEdgeX"});if(r!==void 0)this._validatePcbCoordinateReferences({rawValue:r,axis:"pcbY",propertyName:"pcbTopEdgeY"});if(i!==void 0)this._validatePcbCoordinateReferences({rawValue:i,axis:"pcbY",propertyName:"pcbBottomEdgeY"})}doInitialPcbLayout(){if(this.root?.pcbDisabled)return;if(!this.pcb_component_id)return;let{db:e}=this.root,t=this._parsedProps,n=this.props,o=t.pcbLeftEdgeX??n.pcbLeftEdgeX,r=t.pcbRightEdgeX??n.pcbRightEdgeX,i=t.pcbTopEdgeY??n.pcbTopEdgeY,s=t.pcbBottomEdgeY??n.pcbBottomEdgeY;if(!(t.pcbX!==void 0||t.pcbY!==void 0||o!==void 0||r!==void 0||i!==void 0||s!==void 0))return;if(o!==void 0&&r!==void 0)throw Error(`${this.componentName} cannot set both pcbLeftEdgeX and pcbRightEdgeX`);if(i!==void 0&&s!==void 0)throw Error(`${this.componentName} cannot set both pcbTopEdgeY and pcbBottomEdgeY`);let c=e.pcb_component.get(this.pcb_component_id),l=c?.width??0,h=c?.height??0,u=this.getGroup()?.pcb_group_id??void 0,_=u?void 0:this._getBoard()?.pcb_board_id??void 0,p=this._resolvedPcbCalcOffsetX??(t.pcbX!==void 0?this._resolvePcbCoordinate(t.pcbX,"pcbX"):o!==void 0?this._resolvePcbCoordinate(o,"pcbX",{propertyName:"pcbLeftEdgeX"})+l/2:r!==void 0?this._resolvePcbCoordinate(r,"pcbX",{propertyName:"pcbRightEdgeX"})-l/2:void 0),m=this._resolvedPcbCalcOffsetY??(t.pcbY!==void 0?this._resolvePcbCoordinate(t.pcbY,"pcbY"):i!==void 0?this._resolvePcbCoordinate(i,"pcbY",{propertyName:"pcbTopEdgeY"})-h/2:s!==void 0?this._resolvePcbCoordinate(s,"pcbY",{propertyName:"pcbBottomEdgeY"})+h/2:void 0);e.pcb_component.update(this.pcb_component_id,{position_mode:"relative_to_group_anchor",positioned_relative_to_pcb_group_id:u,positioned_relative_to_pcb_board_id:_,display_offset_x:p,display_offset_y:m})}_getMinimumFlexContainerSize(){return Fzr(this)}_repositionOnPcb(e){return zzr(this,e)}doInitialSilkscreenOverlapAdjustment(){return fOr(this)}isRelativelyPositioned(){let e=this.props;return this._parsedProps.pcbX!==void 0||this._parsedProps.pcbY!==void 0||this._parsedProps.pcbLeftEdgeX!==void 0||this._parsedProps.pcbRightEdgeX!==void 0||this._parsedProps.pcbTopEdgeY!==void 0||this._parsedProps.pcbBottomEdgeY!==void 0||e.pcbLeftEdgeX!==void 0||e.pcbRightEdgeX!==void 0||e.pcbTopEdgeY!==void 0||e.pcbBottomEdgeY!==void 0}},Gst=(e,t)=>{let n=e.source_group.list(),o=[],r=(i)=>{let s=n.filter((a)=>a.parent_subcircuit_id===i);for(let a of s)if(a.subcircuit_id)o.push(a.subcircuit_id),r(a.subcircuit_id)};return r(t),o},kOr=({boardAnchorPosition:e,boardAnchorAlignment:t,width:n,height:o})=>{let{x:r,y:i}=e,s=r,a=i;switch(t){case"top_left":s=r+n/2,a=i-o/2;break;case"top_right":s=r-n/2,a=i-o/2;break;case"bottom_left":s=r+n/2,a=i+o/2;break;case"bottom_right":s=r-n/2,a=i+o/2;break;case"top":s=r,a=i-o/2;break;case"bottom":s=r,a=i+o/2;break;case"left":s=r+n/2,a=i;break;case"right":s=r-n/2,a=i;break;case"center":default:break}return{x:s,y:a}};function LOr(e,t){let{subcircuit:n}=t;if(n.lowercaseComponentName==="board"||n.lowercaseComponentName==="mountedboard")return;if(n.parent?.lowercaseComponentName==="board")return;let o={name:"inflated_board"};if(e.width)o.width=e.width;if(e.height)o.height=e.height;if(e.center)o.pcbX=e.center.x,o.pcbY=e.center.y;if(e.outline)o.outline=e.outline;if(e.thickness)o.thickness=e.thickness;if(e.material)o.material=e.material;if(e.is_via_in_pad_allowed!==void 0)o.isViaInPadAllowed=e.is_via_in_pad_allowed;if(e.allow_blind_and_buried_vias!==void 0)o.allowBlindAndBuriedVias=e.allow_blind_and_buried_vias;let r=new Iv(o);return r.pcb_board_id=e.pcb_board_id,n.add(r),r}var Unt=new WeakMap,afn=(e)=>{let t=[e.name,...e.port_hints??[]].map((r)=>r.toLowerCase().replace(/[^a-z0-9+-]/g,"")),n=t.some((r)=>["a","anode","pos","positive","+"].includes(r)),o=t.some((r)=>["k","cathode","neg","negative","-"].includes(r));if(n===o)return null;return n?"positive":"negative"},HOr=(e)=>{let t=e.root;if(!t)return;let{db:n}=t;for(let A of Unt.get(e)??[])n.pcb_fabrication_note_path.delete(A.pcb_fabrication_note_path_id);if(Unt.delete(e),t.pcbDisabled||!e.props.polarized||!e.pcb_component_id)return;let o=n.pcb_component.get(e.pcb_component_id);if(!o||o.layer!=="top"&&o.layer!=="bottom")return;let r=n.source_port.list({source_component_id:e.source_component_id}),i=r.filter((A)=>afn(A)==="positive"),s=r.filter((A)=>afn(A)==="negative");if(i.length!==1||s.length!==1)return;let a=n.pcb_port.getWhere({source_port_id:i[0].source_port_id}),c=n.pcb_port.getWhere({source_port_id:s[0].source_port_id});if(!a||!c)return;let l=Math.hypot(c.x-a.x,c.y-a.y);if(l<0.000001)return;let h=Hi(Ii((a.x+c.x)/2,(a.y+c.y)/2),Yg(Math.atan2(c.y-a.y,c.x-a.x))),d=(A,g)=>_o(h,{x:A,y:g}),u=l/4,_=Math.min(l*0.12,0.3),p=[[d(-u-_,0),d(-u+_,0)],[d(-u,-_),d(-u,_)],[d(u-_,0),d(u+_,0)]],m=[];Unt.set(e,m);for(let A of p)m.push(n.pcb_fabrication_note_path.insert({pcb_component_id:o.pcb_component_id,subcircuit_id:e.getSubcircuit()?.subcircuit_id??void 0,layer:o.layer,route:A,stroke_width:Math.min(0.08,_*0.4)}))},FOr=1;function zOr(e){let t=[];for(let n of e.children)if(n instanceof sd)t.push(n);return t}function OOr(e){let t=zOr(e);if(t.length!==2)return;let n=t[0].isConnectedToPower(),o=t[0].isConnectedToGround(),r=t[1].isConnectedToPower(),i=t[1].isConnectedToGround();return n&&!o&&i&&!r||r&&!i&&o&&!n?FOr:void 0}var VOr=new Set(["01005","0201","0402","0603","0805","1206","1210","2010","2512"]),L3n=class extends Xl{_adjustSilkscreenTextAutomatically=!0;get config(){let e=this.props.symbolName??"capacitor",t=this.props.schSize==="sm"||this.props.schSize==="xs"?this.props.schSize:void 0,n=t&&e==="capacitor"?`capacitor_${t}`:void 0,o=n&&`${n}_right`in zs?n:e;return{componentName:"Capacitor",schematicSymbolName:this.props.polarized?"capacitor_polarized":o,zodProps:RSt,sourceFtype:LP.simple_capacitor}}initPorts(){if(typeof this.props.footprint==="string")super.initPorts({additionalAliases:{pin1:["anode","pos"],pin2:["cathode","neg"]}});else super.initPorts()}_getSchematicSymbolDisplayValue(){let e=this.props.capacitance,t;if(this._parsedProps.capacitance!==void 0&&!isNaN(this._parsedProps.capacitance))t=typeof e==="string"?e:`${vd(this._parsedProps.capacitance)}F`;else t=`${vd(this._parsedProps.capacitance)}F`;if(this._parsedProps.schShowRatings&&this._parsedProps.maxVoltageRating)return`${t}/${vd(this._parsedProps.maxVoltageRating)}V`;return t}getFootprinterString(){let e=super.getFootprinterString();if(e&&VOr.has(e))return`cap${e}`;return e}doInitialCreateNetsFromProps(){this._createNetsFromProps([this.props.decouplingFor,this.props.decouplingTo,...this._getNetsFromConnectionsProp()])}doInitialCreateTracesFromProps(){if(this.props.decouplingFor&&this.props.decouplingTo)this.add(new O_({from:`${this.getSubcircuitSelector()} > port.1`,to:this.props.decouplingFor})),this.add(new O_({from:`${this.getSubcircuitSelector()} > port.2`,to:this.props.decouplingTo}));this._createTracesFromConnectionsProp()}doInitialPcbComponentSizeCalculation(){super.doInitialPcbComponentSizeCalculation(),HOr(this)}doInitialSourceRender(){let{db:e}=this.root,{_parsedProps:t}=this,n=e.source_component.insert({ftype:"simple_capacitor",name:this.name,manufacturer_part_number:hi(t),supplier_part_numbers:t.supplierPartNumbers,capacitance:t.capacitance,max_voltage_rating:t.maxVoltageRating,max_decoupling_trace_length:t.maxDecouplingTraceLength??OOr(this),display_capacitance:this._getSchematicSymbolDisplayValue(),are_pins_interchangeable:!t.polarized,display_name:t.displayName});this.source_component_id=n.source_component_id}},YOr=({pcbComponent:e,db:t,componentName:n})=>{let o=e.center||{x:0,y:0},r=e.rotation||0,i=Xse(Hi(Ii(o.x,o.y),Yg(r*Math.PI/180))),s=t.toArray().filter((c)=>("pcb_component_id"in c)&&c.pcb_component_id===e.pcb_component_id),a=structuredClone(s);return TR(a,i),JB({componentName:n,componentRotation:"0deg",preserveSolderPaste:!0},a)},M6=(e,t)=>{let{injectionDb:n,normalComponent:o}=t;if(!o)return null;let r=YOr({pcbComponent:e,db:n,componentName:o.name});if(r.length===0)return null;let i=new R8e({originalLayer:e.layer});return i.addAll(r),i},w6=({pcbComponent:e,sourceGroupId:t,inflatorContext:n})=>{if(!e?.center)return{pcbX:void 0,pcbY:void 0};if(t){let o=n.injectionDb.pcb_group.getWhere({source_group_id:t});if(o?.anchor_position)return{pcbX:e.center.x-o.anchor_position.x,pcbY:e.center.y-o.anchor_position.y}}return{pcbX:e.center.x,pcbY:e.center.y}};function GOr(e,t){let{injectionDb:n,subcircuit:o,groupsMap:r}=t,i=n.pcb_component.getWhere({source_component_id:e.source_component_id}),s=n.cad_component.getWhere({source_component_id:e.source_component_id}),{pcbX:a,pcbY:c}=w6({pcbComponent:i,sourceGroupId:e.source_group_id,inflatorContext:t}),l=new L3n({name:e.name,capacitance:e.capacitance,layer:i?.layer,pcbX:a,pcbY:c,pcbRotation:i?.rotation,doNotPlace:i?.do_not_place,obstructsWithinBounds:i?.obstructs_within_bounds});if(i){let h=M6(i,{...t,normalComponent:l});if(h)l.add(h)}if(e.source_group_id&&r?.has(e.source_group_id))r.get(e.source_group_id).add(l);else o.add(l)}var H3n=({circuitJson:e,pcbComponentId:t,sourceComponentId:n})=>{let o=e.filter((i)=>{if(i.type==="pcb_component")return i.pcb_component_id===t;if(i.type==="source_component")return i.source_component_id===n;if("pcb_component_id"in i&&i.pcb_component_id===t)return!0;if("source_component_id"in i&&i.source_component_id===n)return!0;return!1});if(o.length===0)return null;let r=hLt(o);return{x:r.x,y:r.y}},UOr=(e)=>{if(e.root?.pcbDisabled)return;if(!e.name.toUpperCase().startsWith("J"))return;if(!e.pcb_component_id||!e.source_component_id)return;let t=e.root?.platform?.placementDrcChecksDisabled??e.getInheritedProperty("placementDrcChecksDisabled"),n=e.root?.platform?.drcChecksDisabled??e.getInheritedProperty("drcChecksDisabled");if(t||n)return;let{db:o}=e.root;if(o.source_component.get(e.source_component_id)?.ftype!=="simple_chip")return;let i=o.subtree({subcircuit_id:e.getSubcircuit().subcircuit_id}).toArray(),s=H3n({circuitJson:i,pcbComponentId:e.pcb_component_id,sourceComponentId:e.source_component_id});if(!s)return;let a=i.map((h)=>h.type==="pcb_component"&&h.pcb_component_id===e.pcb_component_id?{...h,cable_insertion_center:s}:h),c=UFe(a).find((h)=>h.pcb_component_id===e.pcb_component_id);if(!c)return;if(o.toArray().some((h)=>h.type===c.type&&h.message===c.message))return;o.insertAll([c])},$ue=class extends Xl{get config(){return{componentName:"Chip",zodProps:u1,shouldRenderAsSchematicBox:!0}}initPorts(e={}){super.initPorts(e);let{_parsedProps:t}=this;if(t.externallyConnectedPins){let n=new Set;for(let[o,r]of t.externallyConnectedPins)n.add(o),n.add(r);for(let o of n)if(!this.children.find((i)=>i instanceof sd&&i.isMatchingAnyOf([o]))){let i=o.match(/^pin(\d+)$/);if(i){let s=parseInt(i[1]);this.add(new sd({pinNumber:s,aliases:[o]}))}else this.add(new sd({name:o,aliases:[o]}))}}}doInitialSourceRender(){let{db:e}=this.root,{_parsedProps:t}=this,n=e.source_component.insert({ftype:"simple_chip",name:this.name,manufacturer_part_number:hi(t),supplier_part_numbers:t.supplierPartNumbers,display_name:t.displayName});this.source_component_id=n.source_component_id}doInitialPcbComponentRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,{pcbX:n,pcbY:o}=this.getResolvedPcbPositionProp(),r=t.footprint??this._getImpliedFootprintString(),i=this.children.some((l)=>l.componentName==="Footprint");if(!r&&!i&&!this._hasStartedFootprintUrlLoad){let l=e.pcb_missing_footprint_error.insert({message:`No footprint specified for component: ${this.getString()}`,source_component_id:`${this.source_component_id}`,error_type:"pcb_missing_footprint_error"});this.pcb_missing_footprint_error_id=l.pcb_missing_footprint_error_id}let s=this._getPcbComponentLayer();if(s!=="top"&&s!=="bottom"){let l=this.getSubcircuit(),h=Aj.parse({type:"pcb_component_invalid_layer_error",message:`Component cannot be placed on layer '${s}'. Components can only be placed on 'top' or 'bottom' layers.`,source_component_id:this.source_component_id,layer:s,subcircuit_id:l.subcircuit_id??void 0});e.pcb_component_invalid_layer_error.insert(h)}let a=this.getGlobalTransformRotation(),c=e.pcb_component.insert({center:{x:n,y:o},width:2,height:3,layer:s==="top"||s==="bottom"?s:"top",rotation:Bu(a),insertion_direction:this._getPcbComponentInsertionDirection(s,a),source_component_id:this.source_component_id,subcircuit_id:this.getSubcircuit().subcircuit_id??void 0,do_not_place:t.doNotPlace??!1,obstructs_within_bounds:t.obstructsWithinBounds??!0,is_allowed_to_be_off_board:t.allowOffBoard??!1,metadata:t.kicadFootprintMetadata?{kicad_footprint:t.kicadFootprintMetadata}:void 0});this.pcb_component_id=c.pcb_component_id}doInitialPcbPlacementDesignRuleChecks(){UOr(this)}doInitialCreateTracesFromProps(){let{_parsedProps:e}=this;if(e.externallyConnectedPins)for(let[t,n]of e.externallyConnectedPins)this.add(new O_({from:`${this.getSubcircuitSelector()} > port.${t}`,to:`${this.getSubcircuitSelector()} > port.${n}`}));this._createTracesFromConnectionsProp()}doInitialSimulationRender(){let{db:e}=this.root,{pinAttributes:t}=this.props;if(!t)return;let n=null,o=null,r,i=this.selectAll("port");for(let h of i)for(let d of h.getNameAndAliases())if(t[d]){let u=t[d];if(u.providesPower)n=h,r=u.providesVoltage;if(u.providesGround)o=h}if(!n||!o||r===void 0)return;let s=e.source_port.get(n.source_port_id);if(!s?.subcircuit_connectivity_map_key)return;let a=e.source_port.get(o.source_port_id);if(!a?.subcircuit_connectivity_map_key)return;let c=e.source_net.getWhere({subcircuit_connectivity_map_key:s.subcircuit_connectivity_map_key}),l=e.source_net.getWhere({subcircuit_connectivity_map_key:a.subcircuit_connectivity_map_key});if(!c||!l)return;e.simulation_voltage_source.insert({type:"simulation_voltage_source",positive_source_port_id:n.source_port_id,positive_source_net_id:c.source_net_id,negative_source_port_id:o.source_port_id,negative_source_net_id:l.source_net_id,voltage:r})}},WOr=(e,t)=>{if(!e||e.length===0)return;let{injectionDb:n}=t,o=e.map((r)=>r.map((i)=>{let s=n.source_port.get(i);if(!s)return null;if(s.pin_number!==void 0&&s.pin_number!==null)return`pin${s.pin_number}`;return s.name}).filter((i)=>i!==null)).filter((r)=>r.length>0);return o.length>0?o:void 0},XOr=(e,t)=>{let{injectionDb:n,subcircuit:o,groupsMap:r}=t,i=n.pcb_component.getWhere({source_component_id:e.source_component_id}),s=n.schematic_component.getWhere({source_component_id:e.source_component_id}),a=n.cad_component.getWhere({source_component_id:e.source_component_id}),c=WOr(e.internally_connected_source_port_ids,t),l=a?.footprinter_string??null,{pcbX:h,pcbY:d}=w6({pcbComponent:i,sourceGroupId:e.source_group_id,inflatorContext:t}),u=new $ue({name:e.name,manufacturerPartNumber:e.manufacturer_part_number,supplierPartNumbers:e.supplier_part_numbers??void 0,pinLabels:s?.port_labels??void 0,schWidth:s?.size?.width,schHeight:s?.size?.height,schPinSpacing:s?.pin_spacing,schX:s?.center?.x,schY:s?.center?.y,layer:i?.layer,pcbX:h,pcbY:d,pcbRotation:i?.rotation,doNotPlace:i?.do_not_place,obstructsWithinBounds:i?.obstructs_within_bounds,internallyConnectedPins:c});if(l)Object.assign(u.props,{footprint:l}),Object.assign(u._parsedProps,{footprint:l});if(i){let _=M6(i,{...t,normalComponent:u});if(_)u.add(_)}if(e.source_group_id&&r?.has(e.source_group_id))r.get(e.source_group_id).add(u);else o.add(u)},jOr=/^(?:pin)?(\d+)$/i,KOr=(e)=>{for(let t of e??[]){let n=t.trim().match(jOr);if(n)return Number.parseInt(n[1],10)}},cfn=(e,t)=>e!==void 0&&e>=1&&e<=t,$Or=(e,t)=>{let n=new Map;for(let r of e)if(r.type==="source_port"&&typeof r.pin_number==="number")n.set(r.source_port_id,r.pin_number);let o=new Map;for(let r of e){if(r.type!=="pcb_port")continue;let i=n.get(r.source_port_id);if(i!==void 0)o.set(r.pcb_port_id,i)}return e.filter((r)=>!r.type.startsWith("schematic_")).map((r)=>{if(r.type==="source_port"){let c=r.pin_number;return{...r,name:typeof c==="number"?`pin${c}`:r.name,port_hints:cfn(c,t)?[`pin${c}`]:[]}}if(!("port_hints"in r)&&!("pcb_port_id"in r))return r;let i="port_hints"in r?KOr(r.port_hints):void 0,s="pcb_port_id"in r&&typeof r.pcb_port_id==="string"?o.get(r.pcb_port_id):void 0,a=i??s;return{...r,port_hints:cfn(a,t)?[`pin${a}`]:[]}})},F3n=[{label:"GND1",aliases:[]},{label:"VBUS1",aliases:[]},{label:"CC1",aliases:[]},{label:"DP1",aliases:[]},{label:"DM1",aliases:["DN1"]},{label:"SBU1",aliases:[]},{label:"SBU2",aliases:[]},{label:"DM2",aliases:["DN2"]},{label:"DP2",aliases:[]},{label:"CC2",aliases:[]},{label:"VBUS2",aliases:[]},{label:"GND2",aliases:[]},{label:"SHELL1",aliases:["MH1","EH1","MOUNT1"]},{label:"SHELL2",aliases:["MH2","EH2","MOUNT2"]},{label:"SHELL3",aliases:["MH3","EH3","MOUNT3"]},{label:"SHELL4",aliases:["MH4","EH4","MOUNT4"]}],qOr=/^(?:pin)?(\d+)$/i,JOr=(e)=>Array.from(new Set(e)),ZOr=(e)=>{let t=[];for(let o of e){if(o.type!=="source_port")continue;let r=o.pin_number;if(typeof r!=="number")continue;let i=new Set;for(let s of o.port_hints??[])i.add(s.trim().toUpperCase());t.push({pinKey:`pin${r}`,upperCaseHints:i})}let n={};for(let{label:o,aliases:r}of F3n){let i=[o,...r].map((c)=>c.toUpperCase()),s=t.findIndex((c)=>i.some((l)=>c.upperCaseHints.has(l)));if(s===-1)continue;let{pinKey:a}=t[s];n[a]=[o],t.splice(s,1)}if(Object.keys(n).length===0)return e;return e.map((o)=>{if(!("port_hints"in o)||!Array.isArray(o.port_hints))return o;let r=o.port_hints.filter((a)=>typeof a==="string").map((a)=>a.trim()).filter((a)=>a.length>0);if(r.length===0)return o;let i=new Set;if(o.type==="source_port"&&typeof o.pin_number==="number")i.add(`pin${o.pin_number}`);for(let a of r){let c=a.match(qOr);if(!c)continue;i.add(`pin${Number.parseInt(c[1],10)}`)}let s=[];for(let a of i)s.push(...n[a]??[]);if(s.length===0)return o;return{...o,port_hints:JOr([...r,...s])}})},lfn=0.5,eVr=0.15;function tVr(e,t){if(!e.schematic_component_id||!e.root)return;let{db:n}=e.root,o=n.schematic_component.get(e.schematic_component_id);if(!o)return;if(o.symbol_name)return;let r=o.size.width*lfn,i=o.size.height*lfn,s=Math.min(r/t.size.width,i/t.size.height);if(!Number.isFinite(s)||s<=0)return;let a=e.getSubcircuit()?.subcircuit_id??void 0,c=o.center,l=t.center,h=-o.size.width*eVr,d=(u)=>({x:c.x+h+(u.x-l.x)*s,y:c.y+(u.y-l.y)*s});for(let u of t.primitives)if(u.type==="path"){let _=u.points.map(d);if(u.closed&&_.length>1){let p=_[0],m=_[_.length-1];if(p.x!==m.x||p.y!==m.y)_.push(p)}n.schematic_path.insert({schematic_component_id:e.schematic_component_id,points:_,is_filled:u.fill??!1,is_dashed:!1,fill_color:u.fill?qB:void 0,stroke_width:0.02,subcircuit_id:a,schematic_sheet_id:e._resolveSchematicSheetId()})}else if(u.type==="circle")n.schematic_circle.insert({schematic_component_id:e.schematic_component_id,center:d({x:u.x,y:u.y}),radius:u.radius*s,stroke_width:0.02,color:qB,is_filled:u.fill,fill_color:u.fill?qB:void 0,is_dashed:!1,subcircuit_id:a,schematic_sheet_id:e._resolveSchematicSheetId()});else if(u.type==="box"){let _=d({x:u.x,y:u.y}),p=d({x:u.x+u.width,y:u.y+u.height});n.schematic_rect.insert({schematic_component_id:e.schematic_component_id,center:{x:(_.x+p.x)/2,y:(_.y+p.y)/2},width:Math.abs(p.x-_.x),height:Math.abs(p.y-_.y),stroke_width:0.02,color:qB,is_filled:!1,is_dashed:!1,rotation:0,subcircuit_id:a,schematic_sheet_id:e._resolveSchematicSheetId()})}}var z3n=["VBUS1","VBUS2","CC1","CC2","DP1","DP2","DM1","DM2","SBU1","SBU2","GND1","GND2"],O3n=["SHELL1","SHELL2","SHELL3","SHELL4"],nVr=[...z3n,...O3n],oVr=new Set([...nVr]),rVr=new Set(["jst_sh","jst_gh","jst_zh","jst_ph","jst_xh","jst_vh"]),Wnt=(e)=>e!==void 0&&rVr.has(e),iVr=[["CC1",{marginTop:0.15}],["DP1",{marginTop:0.15}],["SBU1",{marginTop:0.15}],["GND1",{marginTop:0.15}],["SHELL4",{marginRight:0.15}]],V3n=class extends $ue{_getConnectorProps(){return this._parsedProps}initPorts(){let e=this._getConnectorProps();super.initPorts({pinCount:Wnt(e.standard)?e.pinCount:void 0})}_hasExplicitFootprint(){return this._getConnectorProps().footprint!==void 0||this.children.some((t)=>t.componentName==="Footprint")}_shouldUseStandardPartsEngineCircuitJsonFlow(){if(!this._getConnectorProps().standard)return!1;if(this._hasExplicitFootprint())return!1;if(this.getInheritedProperty("partsEngineDisabled"))return!1;return!0}_addUsbCCanonicalFallbackPorts(){if(this.selectAll("port").length>0)return;this.addAll(F3n.map(({label:e,aliases:t},n)=>new sd({pinNumber:n+1,name:e,aliases:[...t]}))),this._markDirty("InitializePortsFromChildren")}_handleStandardConnectorCircuitJsonFailure(e,t){let{db:n}=this.root,o=IR.parse({type:"source_part_not_found_warning",message:`Failed to fetch circuit JSON for ${this.getString()} (standard="${e}"): ${t}`,source_component_id:this.source_component_id??void 0,subcircuit_id:this.getSubcircuit()?.subcircuit_id??void 0,manufacturer_part_number:hi(this._getConnectorProps()),part_name:this.name});if(n.source_part_not_found_warning.insert(o),e==="usb_c")this._addUsbCCanonicalFallbackPorts()}_getSupplierPartNumbersToTry(e){let t=[];for(let n of Object.keys(e??{})){let o=e?.[n];if(Array.isArray(o)&&o.length>0)t.push(o[0])}return t}async _tryFetchPartCircuitJson(e,t){let n=await vst({fetchPartCircuitJson:e,...t},this)??null;if(Array.isArray(n)&&n.length>0)return n;return null}async _fetchStandardConnectorCircuitJson(e,t,n){for(let o of this._getSupplierPartNumbersToTry(t)){let r=await this._tryFetchPartCircuitJson(e,{supplierPartNumber:o,manufacturerPartNumber:n});if(r)return r}if(!n)return null;return this._tryFetchPartCircuitJson(e,{manufacturerPartNumber:n})}_addConnectorFootprintFromCircuitJson(e,t){let n=this._getConnectorProps(),o=e==="usb_c"?ZOr(t):Wnt(e)?$Or(t,n.pinCount??0):t,r=JB({sourcePortOwner:this,componentName:this.name,componentRotation:String(n.pcbRotation??0),footprinterString:`standard:${e}`,pinLabels:n.pinLabels,pcbPinLabels:n.pcbPinLabels},o),i=D3n(o);if(i)this._asyncFootprintCadModel=i;this.addAll(r),this._markDirty("InitializePortsFromChildren")}_getUsbCCanonicalLabelToPinNumberMap(){let e=new Map,t=this.selectAll("port");for(let n of t){let o=n.props.pinNumber;if(typeof o!=="number")continue;for(let r of n.getNameAndAliases()){let i=r.trim().toUpperCase();if(!oVr.has(i))continue;let s=i;if(!e.has(s))e.set(s,o)}}return e}_getSchematicPortArrangement(){let e=super._getSchematicPortArrangement();if(e&&Object.keys(e).length>0)return e;let t=this._getConnectorProps();if(Wnt(t.standard))return{leftSize:0,rightSize:t.pinCount??0};if(t.standard!=="usb_c")return e;let n=this._getUsbCCanonicalLabelToPinNumberMap(),o=z3n.map((s)=>n.get(s)).filter((s)=>typeof s==="number"),r=O3n.map((s)=>n.get(s)).filter((s)=>typeof s==="number");if(o.length===0&&r.length===0)return e;let i={};if(o.length>0)i.rightSide={pins:o,direction:"top-to-bottom"};if(r.length>0)i.bottomSide={pins:r,direction:"left-to-right"};return i}_computeSchematicBoxDimensions(){if(this._getConnectorProps().standard!=="usb_c")return super._computeSchematicBoxDimensions();if(this.getSchematicSymbol())return null;if(!this.config.shouldRenderAsSchematicBox)return null;let{_parsedProps:e}=this,t=this._getPrimaryPinCount(),n=0.2,r={...this._getPinLabelsFromPorts()};if(e.pinLabels){for(let[l,h]of Object.entries(e.pinLabels))if(typeof h==="string")r[l]=h}let i=this._getUsbCCanonicalLabelToPinNumberMap(),s={};for(let[l,h]of iVr){let d=i.get(l);if(typeof d!=="number")continue;s[`pin${d}`]=h}let a={...s,...e.schPinStyle??{}},c=this._getSchematicPortArrangement();return Fst({schWidth:e.schWidth,schHeight:e.schHeight,schPinSpacing:n,numericSchPinStyle:oue(a,r),pinCount:t,schPortArrangement:c??void 0,pinLabels:r})}get config(){return{componentName:"Connector",zodProps:SSt,shouldRenderAsSchematicBox:!0}}doInitialSourceRender(){let{db:e}=this.root,t=this._getConnectorProps(),n=hi(t),o=e.source_component.insert({ftype:"simple_connector",name:this.name,manufacturer_part_number:n,supplier_part_numbers:t.supplierPartNumbers,display_name:t.displayName,standard:t.standard,pin_count:t.pinCount});this.source_component_id=o.source_component_id}_isUsingStandardPartsEngineCircuitJsonFlow(){if(!this._shouldUseStandardPartsEngineCircuitJsonFlow())return!1;let e=this.getInheritedProperty("partsEngine");return Boolean(e?.fetchPartCircuitJson)}doInitialFetchPartFootprint(){let e=this._getConnectorProps(),t=e.standard;if(!t)return;if(!this._shouldUseStandardPartsEngineCircuitJsonFlow())return;if(this._hasStartedFootprintUrlLoad)return;let n=this.getInheritedProperty("partsEngine");if(n&&!n.fetchPartCircuitJson){this._handleStandardConnectorCircuitJsonFailure(t,"partsEngine.fetchPartCircuitJson is not configured");return}let o=n?.fetchPartCircuitJson;if(!o)return;this._hasStartedFootprintUrlLoad=!0;let r={type:"source_component",ftype:"simple_connector",name:this.name,manufacturer_part_number:hi(e),standard:t,pin_count:e.pinCount};this._queueAsyncEffect("load-standard-connector-circuit-json",async()=>{let{db:i}=this.root;try{let s=await this._getSupplierPartNumbers(n,r,`standard:${t}`);if(this.source_component_id)i.source_component.update(this.source_component_id,{supplier_part_numbers:s});let a=await this._fetchStandardConnectorCircuitJson(o,s,r.manufacturer_part_number);if(!a){this._handleStandardConnectorCircuitJsonFailure(t,"part circuit JSON was not found");return}this._addConnectorFootprintFromCircuitJson(t,a)}catch(s){if(this.source_component_id)i.source_component.update(this.source_component_id,{supplier_part_numbers:{}});this._handleStandardConnectorCircuitJsonFailure(t,s.message)}})}doInitialPartsEngineRender(){if(this._isUsingStandardPartsEngineCircuitJsonFlow())return;super.doInitialPartsEngineRender()}updatePartsEngineRender(){if(this._isUsingStandardPartsEngineCircuitJsonFlow())return;super.updatePartsEngineRender()}doInitialSchematicComponentRender(){if(super.doInitialSchematicComponentRender(),!this.root?.schematicDisabled&&this.schematic_component_id&&this._getConnectorProps().standard==="usb_c"){let e=zs.usbc;if(e)tVr(this,e)}}doInitialPcbComponentSizeCalculation(){if(super.doInitialPcbComponentSizeCalculation(),this.root?.pcbDisabled)return;if(!this.pcb_component_id||!this.source_component_id)return;let{db:e}=this.root,t=H3n({circuitJson:e.toArray(),pcbComponentId:this.pcb_component_id,sourceComponentId:this.source_component_id});if(!t)return;e.pcb_component.update(this.pcb_component_id,{cable_insertion_center:{x:t.x,y:t.y}})}},sVr=(e)=>{let t=e?.port_arrangement;if(!t)return;if("left_size"in t)return{leftPinCount:t.left_size,rightPinCount:t.right_size,topPinCount:t.top_size,bottomPinCount:t.bottom_size};let n={};if(t.left_side)n.leftSide={pins:t.left_side.pins,direction:t.left_side.direction??"top-to-bottom"};if(t.right_side)n.rightSide={pins:t.right_side.pins,direction:t.right_side.direction??"top-to-bottom"};if(t.top_side)n.topSide={pins:t.top_side.pins,direction:t.top_side.direction??"left-to-right"};if(t.bottom_side)n.bottomSide={pins:t.bottom_side.pins,direction:t.bottom_side.direction??"left-to-right"};return n},aVr=(e,t)=>{let n=t.injectionDb.source_port.list().filter((r)=>r.source_component_id===e.source_component_id),o={};for(let r of n){let i=r.pin_number;if(i===void 0||i===null)continue;let s=Array.from(new Set([r.name,...r.port_hints??[]].filter((a)=>typeof a==="string"&&a.length>0)));if(s.length>0)o[`pin${i}`]=s}if(Object.keys(o).length===0)return;return o};function cVr(e,t){let{injectionDb:n,subcircuit:o,groupsMap:r}=t,i=n.pcb_component.getWhere({source_component_id:e.source_component_id}),s=n.schematic_component.getWhere({source_component_id:e.source_component_id}),a=n.cad_component.getWhere({source_component_id:e.source_component_id}),{pcbX:c,pcbY:l}=w6({pcbComponent:i,sourceGroupId:e.source_group_id,inflatorContext:t}),h={name:e.name,standard:e.standard,manufacturerPartNumber:e.manufacturer_part_number,supplierPartNumbers:e.supplier_part_numbers??void 0,pinLabels:aVr(e,t)??s?.port_labels??void 0,schPortArrangement:sVr(s),schWidth:s?.size?.width,schHeight:s?.size?.height,schPinSpacing:s?.pin_spacing,schX:s?.center?.x,schY:s?.center?.y,layer:i?.layer,pcbX:c,pcbY:l,pcbRotation:i?.rotation,doNotPlace:i?.do_not_place,obstructsWithinBounds:i?.obstructs_within_bounds},d=new V3n(h);if(a?.footprinter_string)Object.assign(d.props,{footprint:a.footprinter_string}),Object.assign(d._parsedProps,{footprint:a.footprinter_string});if(i){let u=M6(i,{...t,normalComponent:d});if(u)d.add(u)}if(e.source_group_id&&r?.has(e.source_group_id))r.get(e.source_group_id).add(d);else o.add(d)}var Y3n=(e)=>typeof e==="string"&&!JJ(e)&&!iL(e)&&!rL(e)&&!Lde(e),G3n=class extends Xl{get config(){let e={schottky:"schottky_diode",avalanche:"avalanche_diode",zener:"zener_diode",photodiode:"photodiode"},t=this.props.schottky?"schottky":this.props.avalanche?"avalanche":this.props.zener?"zener":this.props.photo?"photo":this.props.standard?"standard":this.props.variant,n=t==="photo"?"photodiode":t,o=n&&e[n]||this.props.symbolName||"diode",r=this.props.schSize==="sm"||this.props.schSize==="xs"?this.props.schSize:void 0,i=r&&(o==="diode"||o==="avalanche_diode"||o==="zener_diode")?`${o}_${r}`:void 0;return{schematicSymbolName:i&&`${i}_right`in zs?i:o,componentName:"Diode",zodProps:bPt,sourceFtype:"simple_diode"}}initPorts(){let e=this.children.some((r)=>r.componentName==="Footprint"),t=this.resolveFootprint(),n=Boolean(this._resolvePinLabels()),o=!n&&!e&&(!t||Y3n(t));super.initPorts({pinCount:2,ignoreSymbolPorts:!n&&!o,additionalAliases:{pin1:o?["anode","pos","left"]:[],pin2:o?["cathode","neg","right"]:[]}})}doInitialSourceRender(){let{db:e}=this.root,{_parsedProps:t}=this,n=e.source_component.insert({ftype:"simple_diode",name:this.name,manufacturer_part_number:hi(t),supplier_part_numbers:t.supplierPartNumbers,are_pins_interchangeable:!1,display_name:t.displayName});this.source_component_id=n.source_component_id}getRefDesPrefixes(){return["D"]}get pos(){return this.portMap.pos}get anode(){return this.portMap.anode}get neg(){return this.portMap.neg}get cathode(){return this.portMap.cathode}},lVr=(e)=>Array.from(new Set([e?.name,...e?.port_hints??[]].filter((t)=>typeof t==="string"&&t.length>0))),hVr=(e,t)=>{let n=t.injectionDb.source_port.list().filter((r)=>r.source_component_id===e.source_component_id),o={};for(let r of n){if(r.pin_number===void 0||r.pin_number===null)continue;let i=lVr(r);if(i.length===0)continue;o[`pin${r.pin_number}`]=i}return Object.keys(o).length>0?o:void 0};function dVr(e,t){let{injectionDb:n,subcircuit:o,groupsMap:r}=t,i=n.pcb_component.getWhere({source_component_id:e.source_component_id}),{pcbX:s,pcbY:a}=w6({pcbComponent:i,sourceGroupId:e.source_group_id,inflatorContext:t}),c=hVr(e,t),l={name:e.name,manufacturerPartNumber:e.manufacturer_part_number,supplierPartNumbers:e.supplier_part_numbers??void 0,pinLabels:c,layer:i?.layer,pcbX:s,pcbY:a,pcbRotation:i?.rotation,doNotPlace:i?.do_not_place,obstructsWithinBounds:i?.obstructs_within_bounds},h=new G3n(l);if(i){let d=M6(i,{...t,normalComponent:h});if(d)h.add(d)}if(e.source_group_id&&r?.has(e.source_group_id))r.get(e.source_group_id).add(h);else o.add(h)}var uVr=class extends Xl{get config(){return{componentName:"Fiducial",zodProps:d1e,sourceFtype:"simple_fiducial"}}doInitialSchematicComponentRender(){}};function pVr(e,t){let{injectionDb:n,subcircuit:o,groupsMap:r}=t,i=n.pcb_component.getWhere({source_component_id:e.source_component_id}),{pcbX:s,pcbY:a}=w6({pcbComponent:i,sourceGroupId:e.source_group_id,inflatorContext:t}),c=n.pcb_smtpad.list({pcb_component_id:i?.pcb_component_id}).find((d)=>d.shape==="circle"),l=c&&"radius"in c?c.radius*2:"1mm",h=new uVr({name:e.name,padDiameter:l,layer:i?.layer,pcbX:s,pcbY:a,pcbRotation:i?.rotation,doNotPlace:i?.do_not_place,obstructsWithinBounds:i?.obstructs_within_bounds});if(i){let d=M6(i,{...t,normalComponent:h});if(d)h.add(d)}if(e.source_group_id&&r?.has(e.source_group_id))r.get(e.source_group_id).add(h);else o.add(h)}function U3n(e,t){let n=t._getGlobalPcbPositionBeforeLayout(),o=t._getGlobalPcbPositionAfterLayout();return Hi(Ii(o.x-n.x,o.y-n.y),e._computePcbGlobalTransformBeforeLayout())}var hfn=({point:e,endpoint:t},n)=>Math.hypot(e.x-t.x,e.y-t.y)<0.0001&&(e.pcb_port_id?n.pcb_port.get(e.pcb_port_id).layers.some((o)=>o===t.layer):e.layer===t.layer);function mVr(e,t,n){return W3n({group:e.getGroup(),subcircuit:e.getSubcircuit(),paths:e._parsedProps.pcbTracePaths??[],phaseIndex:e._parsedProps.phaseIndex,input:t,isFanout:n})}function W3n({group:e,subcircuit:t,paths:n,phaseIndex:o,input:r,isFanout:i}){let s=vG(r.layerCount),a=new Map(r.connections.map((_)=>[_,[..._.pointsToConnect]])),c=new Set,l=new Set,h=[];for(let[_,p]of n.entries()){let m=t.selectOne(p.connection,{type:"port"});if(!m)throw Error(`Saved phase path "${p.connection}" must select a PCB port`);if(l.has(m))throw Error(`Duplicate saved phase path for "${p.connection}"`);l.add(m);let A=r.connections.filter((N)=>N.pointsToConnect.some((D)=>D.pcb_port_id===m.pcb_port_id));if(A.length!==1)throw Error(`Saved phase path "${p.connection}" must select exactly one connection in this phase`);let g=A[0],f=a.get(g),y=f.findIndex((N)=>N.pcb_port_id===m.pcb_port_id);if(y<0)throw Error(`Saved phase path "${p.connection}" starts at an endpoint already joined by another path`);let x=U3n(e,m),C=W4n(p.route).map((N)=>({...N,..._o(x,N)}));for(let N of C)if((N.route_type==="wire"?[N.layer]:[N.from_layer,N.to_layer]).some((L)=>!s.includes(L)))throw Error(`Saved phase path "${p.connection}" uses a layer unavailable on this board`);let b=C[0],I=C.at(-1),v=b.route_type==="wire"?b.layer:b.from_layer,P=I.route_type==="wire"?I.layer:I.to_layer;if(!hfn({point:f[y],endpoint:{...b,layer:v}},m.root.db))throw Error(`Saved phase path "${p.connection}" must start at its PCB port on an available layer`);let M=f.findIndex((N,D)=>D!==y&&hfn({point:N,endpoint:{...I,layer:P}},m.root.db));if(!r.allowViaInPad&&(b.route_type==="via"||I.route_type==="via"&&M>=0))throw Error(`Saved phase path "${p.connection}" has a via at a pad; enable allowViaInPad`);let B=`saved_phase_${e.pcb_group_id}_${o??"default"}_${_}`;if(M<0&&!i)throw Error(`Saved phase path "${p.connection}" must end at another connection endpoint; use autorouter="fanout" for saved escapes`);if(M>=0)f.splice(y,1);else f[y]={x:I.x,y:I.y,layer:P,pointId:`${B}_exit`};let T=C.flatMap((N,D)=>{if(N.route_type!=="via")return[N];let{fromWidth:L,toWidth:H}=nue(C,D,r.minTraceWidth);return[{route_type:"wire",x:N.x,y:N.y,layer:N.from_layer,width:L},N,{route_type:"wire",x:N.x,y:N.y,layer:N.to_layer,width:H}]});if(I.route_type==="via"){let{toWidth:N}=nue(C,C.length-1,r.minTraceWidth);T.push({route_type:"wire",x:I.x,y:I.y,layer:I.to_layer,width:N})}c.add(g),h.push({type:"pcb_trace",pcb_trace_id:B,connection_name:g.name,connectsTo:[g.source_trace_id,...g.pointsToConnect.map((N)=>N.pointId)].filter((N)=>Boolean(N)),route:T})}for(let _ of r.connections){if(!c.has(_))throw Error(`pcbTracePaths must cover every connection in the phase; missing: ${_.name}`);if(!i&&a.get(_).length>1)throw Error(`Saved phase paths for "${_.name}" must connect every endpoint; use autorouter="fanout" for saved escapes`)}let d=r.connections.flatMap((_)=>{let p=a.get(_);return p.length>1?[{..._,pointsToConnect:p}]:[]}),u=new Set(d.map((_)=>_.name));return{traces:h,outputSimpleRouteJson:i?{...r,connections:d,buses:r.buses?.map((_)=>({..._,connectionNames:_.connectionNames.filter((p)=>u.has(p))})).filter((_)=>_.connectionNames.length>0),differentialPairs:r.differentialPairs?.filter((_)=>_.connectionNames.every((p)=>u.has(p))),traces:[...r.traces??[],...h]}:void 0}}var dfn=(e,t,n=!1)=>Math.hypot(e.x-t.x,e.y-t.y)<0.0001&&(e.route_type==="wire"?e.layer:n?e.to_layer:e.from_layer)===t.layer;function _Vr({group:e,subcircuit:t,input:n,traces:o,isFanout:r}){try{let i=new Map(t.selectAll("port").filter((_)=>_.pcb_port_id).map((_)=>[_.pcb_port_id,_])),s=n.connections.flatMap((_)=>_.pointsToConnect),a=o.map((_)=>{if(_.route.length<2||_.route.some((p)=>p.route_type!=="wire"&&p.route_type!=="via"))throw Error("Only port-anchored wire/via routes can be saved");return _.route}),c=a.map((_)=>[s.filter((p)=>dfn(_[0],p)),s.filter((p)=>dfn(_.at(-1),p,!0))]),l=new Map;for(let _ of c)for(let p of new Set(_.flat()))l.set(p,(l.get(p)??0)+1);let h=[],d=new Set,u=new Set(a.keys());while(u.size){let _=!1;for(let p of u)for(let m of[!1,!0]){let A=c[p][m?1:0].filter((b)=>b.pcb_port_id);if(A.length!==1)continue;let g=A[0];if(!g.pcb_port_id||l.get(g)!==1)continue;let f=i.get(g.pcb_port_id);if(!f||d.has(f))continue;let y=g.port_selector??f.getPortSelector();if(t.selectOne(y,{type:"port"})!==f)throw Error(`PCB port selector is not unique: ${y}`);let x=m?a[p].toReversed().map((b)=>b.route_type==="via"?{...b,from_layer:b.to_layer,to_layer:b.from_layer}:b):a[p],C=Xse(U3n(e,f));h.push(Mse.parse({connection:y,route:x.map((b)=>({...b,..._o(C,b)}))})),d.add(f),u.delete(p);for(let b of new Set(c[p].flat()))l.set(b,l.get(b)-1);_=!0;break}if(!_)throw Error("Routes contain a junction or endpoint that cannot select a unique PCB port")}return W3n({group:e,subcircuit:t,paths:h,input:n,isFanout:r}),{pcbTracePaths:h}}catch(i){return{pcbTracePathsUnavailableReason:i instanceof Error?i.message:String(i)}}}function gVr(e,t){if(t.size===0)return e;let n=(e.traces??[]).filter((r)=>t.has(r.pcb_trace_id));if(n.length===0)return e;let o=[];for(let r of n){let i=[r.connection_name??r.pcb_trace_id,...r.connectsTo??[]];for(let[s,a]of r.route.entries()){if(a.route_type==="via"){let u=vG(e.layerCount),_=u.findIndex((A)=>A===a.from_layer),p=u.findIndex((A)=>A===a.to_layer),m=a.via_diameter??e.minViaPadDiameter??e.minViaDiameter??0.6;o.push({type:"rect",center:{x:a.x,y:a.y},width:m,height:m,layers:u.slice(Math.min(_,p),Math.max(_,p)+1),connectedTo:i})}let c=r.route[s+1];if(!c||a.route_type!=="wire"&&a.route_type!=="via"||c.route_type!=="wire"&&c.route_type!=="via")continue;let l=a.route_type==="wire"?a.width:c.route_type==="wire"?c.width:e.minTraceWidth,h=a.route_type==="wire"?a.layer:a.to_layer,d=a.x===c.x||a.y===c.y?1:Math.max(1,Math.ceil(Math.hypot(c.x-a.x,c.y-a.y)/l));for(let u=0;u<d;u++){let _=a.x+(c.x-a.x)*u/d,p=a.y+(c.y-a.y)*u/d,m=a.x+(c.x-a.x)*(u+1)/d,A=a.y+(c.y-a.y)*(u+1)/d;o.push({type:"rect",center:{x:(_+m)/2,y:(p+A)/2},width:Math.abs(m-_)+l,height:Math.abs(A-p)+l,layers:[h],connectedTo:i})}}}return{...e,traces:e.traces?.filter((r)=>!t.has(r.pcb_trace_id)),obstacles:[...e.obstacles,...o]}}function AVr(e){let t=[...e.schematic_net_label.list(),...e.schematic_text.list().filter((a)=>a.source_trace_id)];if(t.length===0)return;let n=Aa(e.toArray().filter((a)=>a.type.startsWith("source_")));n.addConnections([...e.source_net.list().map((a)=>[a.source_net_id]),...e.source_component_internal_connection.list().map((a)=>a.source_port_ids)]);let o=t.map((a)=>{let c=a.type==="schematic_net_label",l=a.source_trace_id??(c&&a.schematic_trace_id?e.schematic_trace.get(a.schematic_trace_id)?.source_trace_id:void 0),h=(c?n.getNetConnectedToId(a.source_net_id):void 0)??(l?n.getNetConnectedToId(l):void 0);return{label:a,network:h}}),r=new Map,i=(a,c)=>{if(!a.trim()||c===void 0)return;let l=r.get(a)??[];if(!l.includes(c))l.push(c);r.set(a,l)};for(let{label:a,network:c}of o)i(a.text,c);let s=(a)=>[...n.getIdsConnectedToNet(a)].sort()[0];for(let a of r.values())a.sort((c,l)=>s(c).localeCompare(s(l),"en",{numeric:!0}));for(let{label:a,network:c}of o){let l=r.get(a.text)??[],h=c!==void 0&&l.length>1?String(l.indexOf(c)+1):void 0;if(a.display_superscript===h)continue;if(a.type==="schematic_net_label")e.schematic_net_label.update(a.schematic_net_label_id,{display_superscript:h});else e.schematic_text.update(a.schematic_text_id,{display_superscript:h})}}var Lve=(e)=>typeof e==="object"&&e!==null&&("isAssemblyDeviceContainer"in e)&&e.isAssemblyDeviceContainer===!0;function PG(e){let t=`${e.connectionName}:source-${e.sourcePointIndex}`;return{boundaryExitPointId:`fanout-exit:${t}`,planeExitPointId:`fanout-plane:${t}`,traceId:`fanout:${t}`,viaObstacleId:`fanout-via:${t}`,planeEndpointPointId:`fanout-plane-endpoint-point:${t}`,planeEndpointTraceId:`fanout-plane-endpoint:${t}`,planeEndpointViaObstacleId:`fanout-plane-endpoint-via:${t}`}}function fVr(e){return`fanout-completion:${e.connectionName}:source-${e.sourcePointIndex}:${e.candidateIndex}`}var ZB=0.000000001;function Q8e(e){return e.shape==="circle"}function rue(e,t){let n=-(t.ccwRotationDegrees??0)*Math.PI/180,o=e.x-t.center.x,r=e.y-t.center.y;return{x:o*Math.cos(n)-r*Math.sin(n),y:o*Math.sin(n)+r*Math.cos(n)}}function Ut(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function Vr(e,t,n){let o=n.x-t.x,r=n.y-t.y,i=o*o+r*r,s=i<ZB?0:((e.x-t.x)*o+(e.y-t.y)*r)/i,a=Math.max(0,Math.min(1,s));return Math.hypot(e.x-(t.x+a*o),e.y-(t.y+a*r))}function qIe(e,t,n){return(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x)}function yVr(e,t,n,o){let r=qIe(n,o,e),i=qIe(n,o,t),s=qIe(e,t,n),a=qIe(e,t,o);return(r>0&&i<0||r<0&&i>0)&&(s>0&&a<0||s<0&&a>0)}function ad(e,t,n,o){if(yVr(e,t,n,o))return 0;return Math.min(Vr(e,n,o),Vr(t,n,o),Vr(n,e,t),Vr(o,e,t))}function OZ(e,t,n=ZB){if(Q8e(t))return Ut(e,t.center)<=t.width/2+n;let o=rue(e,t);return Math.abs(o.x)<=t.width/2+n&&Math.abs(o.y)<=t.height/2+n}function k8e(e){let{center:t,diameter:n,obstacle:o,tolerance:r=ZB}=e,i=n/2;if(Q8e(o))return Ut(t,o.center)+i<=o.width/2+r;let s=rue(t,o);return Math.abs(s.x)+i<=o.width/2+r&&Math.abs(s.y)+i<=o.height/2+r}function X5(e,t){if(Q8e(t))return Math.max(0,Ut(e,t.center)-t.width/2);let n=rue(e,t),o=Math.max(Math.abs(n.x)-t.width/2,0),r=Math.max(Math.abs(n.y)-t.height/2,0);return Math.hypot(o,r)}function Wl(e,t){if(Q8e(t))return Math.max(0,Vr(t.center,e.start,e.end)-t.width/2);let n=rue(e.start,t),o=rue(e.end,t);if(Math.abs(n.x)<=t.width/2+ZB&&Math.abs(n.y)<=t.height/2+ZB)return 0;if(Math.abs(o.x)<=t.width/2+ZB&&Math.abs(o.y)<=t.height/2+ZB)return 0;let r=-t.width/2,i=t.width/2,s=-t.height/2,a=t.height/2,c=[{x:r,y:s},{x:i,y:s},{x:i,y:a},{x:r,y:a}],l=Number.POSITIVE_INFINITY;for(let h=0;h<c.length;h++)l=Math.min(l,ad(n,o,c[h],c[(h+1)%c.length]));return l}function V_(e,t,n){if(e.layer!==t.layer)return!0;let o=(e.width+t.width)/2+n,r=o+ZB;if(Math.min(e.start.x,e.end.x)-Math.max(t.start.x,t.end.x)>r||Math.min(t.start.x,t.end.x)-Math.max(e.start.x,e.end.x)>r||Math.min(e.start.y,e.end.y)-Math.max(t.start.y,t.end.y)>r||Math.min(t.start.y,t.end.y)-Math.max(e.start.y,e.end.y)>r)return!0;return ad(e.start,e.end,t.start,t.end)>=o-ZB}var ufn=new WeakMap;function X3n(e){return e.netConnectionName??e.rootConnectionName??e.name}function wY(e,t,n){if(!t)return!1;let o=e.get(t)??new Set,r=o.size;return o.add(n),e.set(t,o),o.size!==r}function Xnt(e,t){let n=new Set;for(let o of t)for(let r of e.get(o)??[])n.add(r);return n}function xVr(e){let t=new Map,n=new Map;for(let a of e.connections){let c=X3n(a);t.set(a.name,c),wY(n,a.name,c),wY(n,a.rootConnectionName,c),wY(n,a.netConnectionName,c);for(let l of a.pointsToConnect)wY(n,l.pointId,c),wY(n,l.pcb_port_id,c)}for(let a of e.traces??[]){let c=[a.connection_name,a.pcb_trace_id,...a.connectsTo??[]],l=Xnt(n,c);if(l.size!==1)continue;let h=[...l][0];t.set(a.connection_name,h);for(let d of c)wY(n,d,h)}for(let a=0;a<2;a++){let c=!1;for(let l of e.obstacles){let h=Xnt(n,l.connectedTo);if(h.size!==1)continue;let d=[...h][0];for(let u of l.connectedTo)c=wY(n,u,d)||c}if(!c)break}let o=new Map,r=(a)=>{let c=o.get(a)??a;if(o.set(a,c),c===a)return a;let l=r(c);return o.set(a,l),l},i=(a,c)=>{let l=r(a),h=r(c);if(l!==h)o.set(h,l)};for(let a of n.values()){let[c,...l]=[...a];if(!c)continue;for(let h of l)i(c,h)}for(let a of[...e.obstacles.map((c)=>c.connectedTo),...(e.traces??[]).map((c)=>c.connectsTo??[])]){let[c,...l]=[...Xnt(n,a)];if(!c)continue;for(let h of l)i(c,h)}for(let[a,c]of t)t.set(a,r(c));let s=new Map;for(let[a,c]of n){let l=c.values().next().value;if(l!==void 0)s.set(a,r(l))}return{connectionNetKeys:t,tokenNetKeys:s}}function j3n(e){let t=ufn.get(e);if(t)return t;let n=xVr(e);return ufn.set(e,n),n}function Y5(e,t,n){let o=j3n(e),r=o.connectionNetKeys.get(t),i=o.connectionNetKeys.get(n);return r!==void 0&&r===i}function P6(e,t,n){let o=j3n(e),r=o.connectionNetKeys.get(n);if(!r)return!1;for(let i of t.connectedTo)if(o.tokenNetKeys.get(i)===r)return!0;return!1}function rT(e){if(!Number.isInteger(e)||e<1)throw Error(`FanoutSolver: layerCount must be a positive integer, received ${e}`);if(e===1)return["top"];if(e===2)return["top","bottom"];return["top",...Array.from({length:e-2},(t,n)=>`inner${n+1}`),"bottom"]}function K3n(e,t,n){let o=n.indexOf(e),r=n.indexOf(t);if(o<0||r<0)throw Error(`FanoutSolver: cannot build via span from "${e}" to "${t}"`);let i=Math.min(o,r),s=Math.max(o,r);return n.slice(i,s+1)}function G5(e){let{fromLayer:t,toLayer:n,layerNames:o,allowBlindAndBuriedVias:r}=e,i=K3n(t,n,o);return r?i:[...o]}function $3n(e){let{fromLayer:t,toLayer:n,layers:o,layerNames:r,allowBlindAndBuriedVias:i}=e,s=G5({fromLayer:t,toLayer:n,layerNames:r,allowBlindAndBuriedVias:i});if(!o)return s;if(o.length===0||!o.includes(t)||!o.includes(n)||o.some((a)=>!r.includes(a)))throw Error(`FanoutSolver: route via from "${t}" to "${n}" has an invalid physical layer span`);return[...o]}function CVr(e){let{busIds:t,layers:n,layersByBusId:o,maxAssignments:r}=e;if(n.length===0)throw Error("FanoutSolver: no escape layers are available");if(!Number.isInteger(r)||r<1)throw Error(`FanoutSolver: maxLayerCombinations must be positive, received ${r}`);let i=t.map((m)=>o?.[m]??n),s=i.findIndex((m)=>m.length===0);if(s>=0)throw Error(`FanoutSolver: no escape layers are available for bus "${t[s]}"`);let a=i.reduce((m,A)=>m*A.length,1),c=Math.min(r,Number.isFinite(a)?a:r),l=[],h=new Set;function d(m){let A={};for(let f=0;f<t.length;f++)A[t[f]]=i[f][m[f]];let g=JSON.stringify(A);if(h.has(g))return;h.add(g),l.push(A)}if(a<=r){for(let m=0;m<c;m++){let A=[],g=m;for(let f=0;f<t.length;f++){let y=i[f].length,x=g%y;g=Math.floor(g/y),A.push((x+f)%y)}d(A)}return l}function u(m){let A=m|0;return A=Math.imul(A^A>>>16,569420461),A=Math.imul(A^A>>>15,1935289751),(A^A>>>15)>>>0}let _=t.map((m,A)=>A%i[A].length);d(_);let p=Math.max(...i.map((m)=>m.length));for(let m=1;m<p&&l.length<c;m++)d(_.map((A,g)=>(A+m)%i[g].length));for(let m=0;m<t.length&&l.length<c;m++)for(let A=1;A<i[m].length&&l.length<c;A++){let g=[..._];g[m]=(_[m]+A)%i[m].length,d(g)}for(let m=1;l.length<c&&m<c*20;m++)d(t.map((A,g)=>u(m*2654435761+g*2246822507)%i[g].length));return l}var uP=0.000001;function bVr(e){return"layer"in e?[e.layer]:e.layers}function rde(e,t){return e.some((n)=>t.includes(n))}function IVr(e,t){let n=[],o;for(let r of e.route){if(r.route_type==="via"){n.push({type:"via",center:{x:r.x,y:r.y},diameter:r.via_diameter??0,layers:K3n(r.from_layer,r.to_layer,t)}),o=void 0;continue}if(r.route_type!=="wire")continue;if(o&&o.layer===r.layer&&Ut(o,r)>uP)n.push({type:"segment",segment:{start:{x:o.x,y:o.y},end:{x:r.x,y:r.y},width:r.width,layer:r.layer}});o=r}return n}function YB(e,t){if(e.type==="plane"&&t.type==="plane")return e.layer===t.layer;if(e.type==="plane"&&t.type==="via")return t.layers.includes(e.layer);if(e.type==="via"&&t.type==="plane")return YB(t,e);if(e.type==="plane"&&t.type==="segment")return e.layer===t.segment.layer;if(e.type==="segment"&&t.type==="plane")return YB(t,e);if(e.type==="endpoint"&&t.type==="endpoint")return rde(e.layers,t.layers)&&Ut(e.point,t.point)<=uP;if(e.type==="endpoint"&&t.type==="obstacle")return rde(e.layers,t.obstacle.layers)&&OZ(e.point,t.obstacle,uP);if(e.type==="obstacle"&&t.type==="endpoint")return YB(t,e);if(e.type==="endpoint"&&t.type==="segment")return e.layers.includes(t.segment.layer)&&Vr(e.point,t.segment.start,t.segment.end)<=t.segment.width/2+uP;if(e.type==="segment"&&t.type==="endpoint")return YB(t,e);if(e.type==="endpoint"&&t.type==="via")return rde(e.layers,t.layers)&&Ut(e.point,t.center)<=t.diameter/2+uP;if(e.type==="via"&&t.type==="endpoint")return YB(t,e);if(e.type==="obstacle"&&t.type==="segment")return e.obstacle.layers.includes(t.segment.layer)&&Wl(t.segment,e.obstacle)<=t.segment.width/2+uP;if(e.type==="segment"&&t.type==="obstacle")return YB(t,e);if(e.type==="obstacle"&&t.type==="via")return rde(e.obstacle.layers,t.layers)&&X5(t.center,e.obstacle)<=t.diameter/2+uP;if(e.type==="via"&&t.type==="obstacle")return YB(t,e);if(e.type==="segment"&&t.type==="segment")return e.segment.layer===t.segment.layer&&ad(e.segment.start,e.segment.end,t.segment.start,t.segment.end)<=(e.segment.width+t.segment.width)/2+uP;if(e.type==="segment"&&t.type==="via")return t.layers.includes(e.segment.layer)&&Vr(t.center,e.segment.start,e.segment.end)<=t.diameter/2+e.segment.width/2+uP;if(e.type==="via"&&t.type==="segment")return YB(t,e);if(e.type==="via"&&t.type==="via")return rde(e.layers,t.layers)&&Ut(e.center,t.center)<=(e.diameter+t.diameter)/2+uP;return!1}var vVr=class{parent;constructor(e){this.parent=Array.from({length:e},(t,n)=>n)}find(e){let t=this.parent[e];if(t===e)return e;let n=this.find(t);return this.parent[e]=n,n}union(e,t){let n=this.find(e),o=this.find(t);if(n!==o)this.parent[o]=n}};function SVr(e,t,n){return Boolean(t.connection_name&&Y5(e,t.connection_name,n.name))}function b6(e){let{inputSrj:t,routedSrj:n}=e,o=n.fanoutPlaneConnectivity,r=rT(n.layerCount),i=new Map;for(let h of t.connections){let d=X3n(h),u=i.get(d)??[];u.push(h),i.set(d,u)}let s=[],a=0,c=0;for(let h of i.values()){let d=h[0],u=h.flatMap((y)=>y.pointsToConnect.map((x,C)=>({type:"endpoint",connectionName:y.name,endpointIndex:C,point:x,layers:bVr(x)}))),_=t.obstacles.filter((y)=>P6(t,y,d.name)).map((y)=>({type:"obstacle",obstacle:y})),p=(n.traces??[]).filter((y)=>SVr(t,y,d)).flatMap((y)=>IVr(y,r)),m=[...new Set((o??[]).flatMap((y)=>Y5(t,y.connectionName,d.name)?[y.layer]:[]))].map((y)=>({type:"plane",layer:y})),A=[...u,..._,...p,...m],g=new vVr(A.length);for(let y=0;y<A.length;y++)for(let x=y+1;x<A.length;x++)if(YB(A[y],A[x]))g.union(y,x);let f=new Map;for(let y=0;y<u.length;y++){let x=u[y],C=f.get(x.connectionName)??[];C[x.endpointIndex]=y,f.set(x.connectionName,C)}for(let y of h){let x=f.get(y.name)??[],C=x[0],b=C===void 0?void 0:g.find(C),I=x.flatMap((v,P)=>b===void 0||g.find(v)!==b?[P]:[]);if(c+=x.length-I.length,I.length===0)a++;else s.push({code:"original-endpoints-disconnected",connectionName:y.name,disconnectedEndpointIndices:I,message:`Connection ${y.name} has no physical copper path from endpoint 0 to original endpoint${I.length===1?"":"s"} ${I.join(", ")}`})}}let l=t.connections.reduce((h,d)=>h+d.pointsToConnect.length,0);return{valid:s.length===0,checkedConnectionCount:t.connections.length,connectedConnectionCount:a,checkedEndpointCount:l,connectedEndpointCount:c,issues:s}}var mP=0.000001;function que(e){let{inputSrj:t,segment:n,bodyObstacle:o,connectionName:r}=e;if(o.connectedTo.length>0||!o.componentId)return!1;let i=t.obstacles.filter((s)=>s.componentId===o.componentId&&s.layers.includes(n.layer)&&P6(t,s,r));for(let s of i)for(let[a,c]of[[n.start,n.end],[n.end,n.start]]){if(!OZ(a,s,mP))continue;let l={x:a.x-o.center.x,y:a.y-o.center.y},h={x:c.x-a.x,y:c.y-a.y};if(l.x*h.x+l.y*h.y>mP)return!0}return!1}function jnt(e,t){return Ut(e,t)<=mP}function U3(e,t){e.push(t)}function PVr(e){let{srj:t,trace:n,connectionName:o,layerNames:r,allowBlindAndBuriedVias:i,issues:s}=e,a=[],c=[],l,h;for(let d of n.route){if(d.route_type==="via"){let u=$3n({fromLayer:d.from_layer,toLayer:d.to_layer,layers:"layers"in d&&Array.isArray(d.layers)?d.layers:void 0,layerNames:r,allowBlindAndBuriedVias:i});if(c.push({center:{x:d.x,y:d.y},diameter:d.via_diameter??t.minViaPadDiameter??t.minTraceWidth,spanLayers:u}),!l||!jnt(l,d)||l.layer!==d.from_layer)U3(s,{code:"disconnected-trace",traceId:n.pcb_trace_id,connectionName:o,message:`Trace ${n.pcb_trace_id} reaches a via without a matching ${d.from_layer} wire endpoint`});h=d;continue}if(d.route_type!=="wire"){U3(s,{code:"unsupported-route-point",traceId:n.pcb_trace_id,connectionName:o,message:`Trace ${n.pcb_trace_id} contains unsupported ${d.route_type} geometry`}),l=void 0,h=void 0;continue}if(h){if(!jnt(d,h)||d.layer!==h.to_layer)U3(s,{code:"disconnected-trace",traceId:n.pcb_trace_id,connectionName:o,message:`Trace ${n.pcb_trace_id} does not continue from its via on ${h.to_layer}`});l=d,h=void 0;continue}if(l){if(l.layer!==d.layer)U3(s,{code:"disconnected-trace",traceId:n.pcb_trace_id,connectionName:o,message:`Trace ${n.pcb_trace_id} changes from ${l.layer} to ${d.layer} without a via`});else if(!jnt(l,d))a.push({start:{x:l.x,y:l.y},end:{x:d.x,y:d.y},width:d.width,layer:d.layer})}l=d}if(h)U3(s,{code:"disconnected-trace",traceId:n.pcb_trace_id,connectionName:o,message:`Trace ${n.pcb_trace_id} ends at a via without a wire on ${h.to_layer}`});return{trace:n,connectionName:o,segments:a,vias:c}}function lu(e){let{inputSrj:t,routedSrj:n,clearance:o,allowBlindAndBuriedVias:r=!0}=e,i=[],s=rT(n.layerCount),a=[],c=[t,n].flatMap((l)=>l.connections.flatMap((h)=>h.pointsToConnect.map((d)=>({connectionName:h.name,point:d}))));for(let l of n.traces??[]){let h=l.connection_name;if(!h||!t.connections.some((d)=>d.name===h)){U3(i,{code:"unknown-trace-connection",traceId:l.pcb_trace_id,...h?{connectionName:h}:{},message:`Trace ${l.pcb_trace_id} does not identify an input connection`});continue}a.push(PVr({srj:n,trace:l,connectionName:h,layerNames:s,allowBlindAndBuriedVias:r,issues:i}))}for(let l of a){let h=new Set(t.obstacles.filter((u)=>P6(t,u,l.connectionName))),d=t.obstacles.filter((u)=>!h.has(u));for(let u of l.segments)for(let _ of d){if(!_.layers.includes(u.layer))continue;if(que({inputSrj:t,segment:u,bodyObstacle:_,connectionName:l.connectionName}))continue;let p=Wl(u,_),m=u.width/2+o;if(p<m-mP)U3(i,{code:"trace-obstacle-clearance",traceId:l.trace.pcb_trace_id,connectionName:l.connectionName,layer:u.layer,obstacleId:_.obstacleId,message:`Trace ${l.trace.pcb_trace_id} on ${u.layer} is ${p.toFixed(4)}mm from different-net obstacle ${_.obstacleId}; ${m.toFixed(4)}mm is required`})}for(let u of l.vias){let _=c.find(({point:m})=>Ut(u.center,m)<=mP),p=t.allowViaInPad===!0&&t.obstacles.some((m)=>m.layers.some((A)=>u.spanLayers.includes(A))&&h.has(m)&&k8e({center:u.center,diameter:u.diameter,obstacle:m,tolerance:mP}));if(_&&!p)U3(i,{code:"via-at-endpoint",traceId:l.trace.pcb_trace_id,connectionName:l.connectionName,otherConnectionName:_.connectionName,message:`Via in ${l.trace.pcb_trace_id} is placed directly at an original or routed connection endpoint`});for(let m of d){if(!m.layers.some((f)=>u.spanLayers.includes(f)))continue;let A=X5(u.center,m),g=u.diameter/2+o;if(A<g-mP)U3(i,{code:"via-obstacle-clearance",traceId:l.trace.pcb_trace_id,connectionName:l.connectionName,obstacleId:m.obstacleId,message:`Via in ${l.trace.pcb_trace_id} is ${A.toFixed(4)}mm from different-net obstacle ${m.obstacleId} on its layer span; ${g.toFixed(4)}mm is required`})}}}for(let l=0;l<a.length;l++){let h=a[l];for(let d=l+1;d<a.length;d++){let u=a[d];if(Y5(t,h.connectionName,u.connectionName))continue;for(let _ of h.segments){for(let p of u.segments){if(V_(_,p,o))continue;U3(i,{code:"different-net-trace-clearance",traceId:h.trace.pcb_trace_id,connectionName:h.connectionName,otherTraceId:u.trace.pcb_trace_id,otherConnectionName:u.connectionName,layer:_.layer,message:`Different-net traces ${h.trace.pcb_trace_id} and ${u.trace.pcb_trace_id} intersect or violate clearance on ${_.layer}`})}for(let p of u.vias){if(!p.spanLayers.includes(_.layer)||Vr(p.center,_.start,_.end)>=p.diameter/2+_.width/2+o-mP)continue;U3(i,{code:"different-net-trace-via-clearance",traceId:h.trace.pcb_trace_id,connectionName:h.connectionName,otherTraceId:u.trace.pcb_trace_id,otherConnectionName:u.connectionName,layer:_.layer,message:`Trace ${h.trace.pcb_trace_id} violates via clearance to ${u.trace.pcb_trace_id} on ${_.layer}`})}}for(let _ of h.vias){for(let p of u.segments){if(!_.spanLayers.includes(p.layer)||Vr(_.center,p.start,p.end)>=_.diameter/2+p.width/2+o-mP)continue;U3(i,{code:"different-net-trace-via-clearance",traceId:h.trace.pcb_trace_id,connectionName:h.connectionName,otherTraceId:u.trace.pcb_trace_id,otherConnectionName:u.connectionName,layer:p.layer,message:`Via in ${h.trace.pcb_trace_id} violates trace clearance to ${u.trace.pcb_trace_id} on ${p.layer}`})}for(let p of u.vias){if(!_.spanLayers.some((m)=>p.spanLayers.includes(m))||Ut(_.center,p.center)>=(_.diameter+p.diameter)/2+o-mP)continue;U3(i,{code:"different-net-via-clearance",traceId:h.trace.pcb_trace_id,connectionName:h.connectionName,otherTraceId:u.trace.pcb_trace_id,otherConnectionName:u.connectionName,message:`Different-net vias in ${h.trace.pcb_trace_id} and ${u.trace.pcb_trace_id} violate clearance on an overlapping layer span`})}}}}return{valid:i.length===0,checkedTraceCount:n.traces?.length??0,checkedSegmentCount:a.reduce((l,h)=>l+h.segments.length,0),checkedViaCount:a.reduce((l,h)=>l+h.vias.length,0),issues:i}}var Ust=0.000000001;function iue(e,t){if("layer"in e)return e.layer;if(t&&e.layers.includes(t))return t;let n=e.layers[0];if(!n)throw Error("Endpoint completion received a layerless point");return n}function pfn(e){let t=[];for(let n of e){if(t.at(-1)&&Ut(t.at(-1),n)<Ust)continue;t.push(n)}return t}function mfn(e,t){let n=pfn(e);if(n.length<3)return n;let o=[n[0]];for(let r=1;r<n.length-1;r++){let i=n[r-1],s=n[r],a=n[r+1],c=Ut(i,s),l=Ut(s,a),h={x:(s.x-i.x)/c,y:(s.y-i.y)/c},d={x:(a.x-s.x)/l,y:(a.y-s.y)/l};if(Math.abs(h.x*d.x+h.y*d.y)>0.000001){o.push(s);continue}let u=Math.min(t,c/2,l/2);o.push({x:s.x-h.x*u,y:s.y-h.y*u}),o.push({x:s.x+d.x*u,y:s.y+d.y*u})}return o.push(n.at(-1)),pfn(o)}function EVr(e){let{inputSrj:t,connectionName:n,target:o,targetLayer:r}=e;return t.obstacles.find((i)=>i.layers.includes(r)&&P6(t,i,n)&&OZ(o,i,0.000001))}function MVr(e){let{inputSrj:t,plan:n}=e,o=iue(n.targetPoint),r=EVr({inputSrj:t,connectionName:n.connectionName,target:n.targetPoint,targetLayer:o}),i=t.obstacles.find((l)=>l.componentId===r?.componentId&&l.connectedTo.length===0),s=i?{x:n.targetPoint.x-i.center.x,y:n.targetPoint.y-i.center.y}:{x:n.targetPoint.x-n.sourcePoint.x,y:n.targetPoint.y-n.sourcePoint.y},a=Math.hypot(s.x,s.y),c=a>Ust?{x:s.x/a,y:s.y/a}:{x:1,y:0};return{outward:c,perpendicular:{x:-c.y,y:c.x}}}function q3n(e){let{plan:t,branchStart:n,viaPoint:o,assignedLayerPath:r,terminalApproach:i,traceWidth:s,viaDiameter:a,viaHoleDiameter:c,candidateIndex:l,chamfer:h}=e,d=iue(t.targetPoint),u=mfn(r,h),_=mfn([o,...i?[i]:[],t.targetPoint],h),p=u.map((m)=>({route_type:"wire",x:m.x,y:m.y,width:s,layer:n.layer}));if(n.layer!==d)p.push({route_type:"via",x:o.x,y:o.y,from_layer:n.layer,to_layer:d,via_diameter:a,via_hole_diameter:c}),p.push({route_type:"wire",x:o.x,y:o.y,width:s,layer:d});for(let m of _.slice(1))p.push({route_type:"wire",x:m.x,y:m.y,width:s,layer:d});return{type:"pcb_trace",pcb_trace_id:fVr({connectionName:t.connectionName,sourcePointIndex:t.sourcePointIndex,candidateIndex:l}),connection_name:t.connectionName,route:p}}function rG(e,t){return!e.issues.some((n)=>n.connectionName===t)}function Wst(e){let{trace:t,endpointSrjs:n}=e,o=n.flatMap((r)=>r.connections.flatMap((i)=>i.pointsToConnect));return t.route.some((r)=>r.route_type==="via"&&o.some((i)=>Ut(r,i)<=0.000001))}function wVr(e){let{inputSrj:t,fanoutSrj:n,plan:o,acceptedTraces:r,traceWidth:i,viaDiameter:s,viaHoleDiameter:a,clearance:c,allowBlindAndBuriedVias:l}=e,{outward:h,perpendicular:d}=MVr({inputSrj:t,plan:o}),u=[...o.via?[{x:o.via.center.x,y:o.via.center.y,layer:o.targetLayer}]:[],{x:o.sourcePoint.x,y:o.sourcePoint.y,layer:o.sourceLayer}],_=[],p=Number.POSITIVE_INFINITY,m=0,A=t.connections.length>32?600:Number.POSITIVE_INFINITY,g=o.termination.type==="plane"?J3n({trace:o.trace,endpoint:o.exitPoint,layer:o.sourceLayer,distances:[0.2,0.3,0.4]}):[],f=[...o.termination.type==="plane"&&o.via?[{...o.via.center}]:[],...g,...[0.4,0.8,1.2,1.6].flatMap((y)=>[0,0.4,-0.4,0.8,-0.8,1.2,-1.2,1.6,-1.6].map((x)=>({x:o.sourcePoint.x+h.x*y+d.x*x,y:o.sourcePoint.y+h.y*y+d.y*x})))];for(let y of f){let x=[...o.termination.type==="plane"?[{...y,layer:o.targetLayer}]:[],...u,...g.flatMap((C)=>Ut(C,y)<=0.000001?[{...C,layer:o.sourceLayer}]:[])];for(let C of x){let b=Ut(C,y)<=0.000001?[[C]]:[[C,y],[C,{x:y.x,y:C.y},y],[C,{x:C.x,y:y.y},y],...[0.4,-0.4].map((I)=>[C,{x:C.x+I,y:C.y},{x:C.x+I,y:y.y},y])];for(let I of b){let v=[void 0,...[0.4,0.8].map((P)=>({x:o.targetPoint.x+h.x*P,y:o.targetPoint.y+h.y*P})),...[0.4,-0.4].map((P)=>({x:o.targetPoint.x+h.x*0.4+d.x*P,y:o.targetPoint.y+h.y*0.4+d.y*P}))];for(let P of v){if(m>=A)return{blockingConnectionNames:_};let M=q3n({plan:o,branchStart:C,viaPoint:y,assignedLayerPath:I,terminalApproach:P,traceWidth:i,viaDiameter:s,viaHoleDiameter:a,candidateIndex:m++,chamfer:0});if(Wst({trace:M,endpointSrjs:[t,n]}))continue;let B={...n,traces:[...n.traces??[],...r,M]},T=lu({inputSrj:t,routedSrj:B,clearance:c,allowBlindAndBuriedVias:l});if(!T.valid){if(T.issues.length<p)p=T.issues.length,_=[...new Set(T.issues.flatMap((D)=>[D.connectionName,D.otherConnectionName].flatMap((L)=>L&&L!==o.connectionName?[L]:[])))];continue}let N=b6({inputSrj:t,routedSrj:B});if(rG(N,o.connectionName))return{trace:M,blockingConnectionNames:[]}}}}}return{blockingConnectionNames:_}}function BVr(e){let{inputSrj:t,fanoutSrj:n,plans:o,traceWidth:r,viaDiameter:i,viaHoleDiameter:s,clearance:a,allowBlindAndBuriedVias:c}=e,l=[],h=[],d=new Set;for(let _ of o){let p=wVr({inputSrj:t,fanoutSrj:n,plan:_,acceptedTraces:l,traceWidth:r,viaDiameter:i,viaHoleDiameter:s,clearance:a,allowBlindAndBuriedVias:c});if(p.trace)l.push(p.trace);else{h.push(_.connectionName);for(let m of p.blockingConnectionNames)d.add(m)}}let u={...n,traces:[...n.traces??[],...l]};return{traces:l,failedConnectionNames:h,blockingConnectionNames:[...d],connectivity:b6({inputSrj:t,routedSrj:u}),drc:lu({inputSrj:t,routedSrj:u,clearance:a,allowBlindAndBuriedVias:c})}}function _fn(e){let t=0,n;for(let o of e.route){if(o.route_type!=="wire"){n=void 0;continue}if(n?.layer===o.layer)t+=Ut(n,o);n=o}return t}function TVr(e){let{fanoutSrj:t,completionTraces:n}=e,o=new Map(n.flatMap((i)=>{let s=i.route.find((a)=>a.route_type==="wire");return s?[[i.connection_name,{x:s.x,y:s.y,layer:s.layer}]]:[]})),r=(t.traces??[]).map((i)=>{if(!i.pcb_trace_id.startsWith("fanout:"))return i;let s=o.get(i.connection_name);if(!s)return i;let a;for(let c=0;c<i.route.length;c++){let l=i.route[c];if(l?.route_type!=="wire"){a=void 0;continue}if(a!==void 0){let h=i.route[a];if(h?.route_type==="wire"&&h.layer===s.layer&&l.layer===s.layer&&Vr(s,h,l)<=0.000001){let d=i.route.slice(0,a+1);if(Ut(h,s)>0.000001)d.push({route_type:"wire",x:s.x,y:s.y,width:l.width,layer:s.layer});return{...i,route:d}}}a=c}return i});return{...t,traces:r}}function DVr(e){let{inputSrj:t,fanoutSrj:n,localTraces:o,candidates:r,clearance:i,allowBlindAndBuriedVias:s}=e,a=[...n.traces??[],...o],c={...n,traces:a},l=b6({inputSrj:t,routedSrj:c}),d=r.filter((p)=>p.route.length>1&&p.route.every((m)=>m.route_type==="wire"||m.route_type==="via")&&!Wst({trace:p,endpointSrjs:[t,n]})).filter((p)=>{let m=b6({inputSrj:t,routedSrj:{...n,traces:[...a,p]}});return m.connectedConnectionCount>l.connectedConnectionCount&&rG(m,p.connection_name)}),u={...n,traces:[...a,...d]};if(lu({inputSrj:t,routedSrj:u,clearance:i,allowBlindAndBuriedVias:s}).valid)return d;let _=[];for(let p of d.toSorted((m,A)=>_fn(m)-_fn(A))){let m={...n,traces:[...a,..._,p]};if(!lu({inputSrj:t,routedSrj:m,clearance:i,allowBlindAndBuriedVias:s}).valid)continue;let g=b6({inputSrj:t,routedSrj:{...n,traces:[...a,..._]}}),f=b6({inputSrj:t,routedSrj:m});if(f.connectedConnectionCount>g.connectedConnectionCount&&rG(f,p.connection_name))_.push(p)}return _}function J3n(e){let{trace:t,endpoint:n,layer:o,distances:r}=e,i=t.route.findLastIndex((s)=>s.route_type==="wire"&&s.layer===o&&Ut(s,n)<=0.000001);if(i<0)return[];return r.flatMap((s)=>{let a=s,c=n;for(let l=i-1;l>=0;l--){let h=t.route[l];if(h?.route_type!=="wire"||h.layer!==o)break;let d=Ut(c,h);if(d<=Ust)continue;if(a<d-0.000001)return[{x:c.x+(h.x-c.x)*a/d,y:c.y+(h.y-c.y)*a/d}];a-=d,c=h}return[]})}function gfn(e){let{inputSrj:t,fanoutSrj:n,plan:o,acceptedTraces:r,traceWidth:i,viaDiameter:s,viaHoleDiameter:a,clearance:c,allowBlindAndBuriedVias:l}=e,h={x:o.exitPoint.x,y:o.exitPoint.y,layer:o.targetLayer},d=o.targetPoint,u=iue(d),_=0,p=(A)=>{let g=q3n({plan:o,branchStart:A.start,viaPoint:A.viaPoint,assignedLayerPath:[A.start,A.viaPoint],terminalApproach:A.terminalApproach,traceWidth:i,viaDiameter:s,viaHoleDiameter:a,candidateIndex:1e4+_++,chamfer:Math.max(i,0.1)});if(Wst({trace:g,endpointSrjs:[t,n]}))return;let f={...n,traces:[...n.traces??[],...r,g]};if(!lu({inputSrj:t,routedSrj:f,clearance:c,allowBlindAndBuriedVias:l}).valid)return;if(rG(b6({inputSrj:t,routedSrj:f}),o.connectionName))return g;return};if(h.layer!==u){let A=J3n({trace:o.trace,endpoint:o.exitPoint,layer:o.targetLayer,distances:[0.4,0.8,1.2,1.6]});for(let g of A){let f={...g,layer:o.targetLayer};for(let y of[void 0,{x:d.x,y:g.y},{x:g.x,y:d.y}]){let x=p({start:f,viaPoint:g,terminalApproach:y});if(x)return x}}}let m=[[d],[{x:d.x,y:h.y},d],[{x:h.x,y:d.y},d]];for(let A of m){let g=A[0],f=Ut(h,g),y=h.layer===u?[0]:[0.4,0.8,1.2,1.6];for(let x of y){if(h.layer!==u&&(f<=x+0.2||x<=0.000001))continue;let C=h.layer===u?{x:h.x,y:h.y}:{x:h.x+(g.x-h.x)*x/f,y:h.y+(g.y-h.y)*x/f},b=p({start:h,viaPoint:C,terminalApproach:A.length>1?g:void 0});if(b)return b}}return}function NVr(e){let{inputSrj:t,fanoutSrj:n,plans:o,traceWidth:r,viaDiameter:i,viaHoleDiameter:s,clearance:a,allowBlindAndBuriedVias:c=!0,effort:l=1,routeDownstreamConnections:h}=e,d=[],u=lu({inputSrj:t,routedSrj:n,clearance:a,allowBlindAndBuriedVias:c}),_=b6({inputSrj:t,routedSrj:n}),p=o.filter((N)=>{let D=iue(N.sourcePoint),L=iue(N.targetPoint);return D!==L&&Ut(N.sourcePoint,N.targetPoint)<=0.25&&!rG(_,N.connectionName)}),m={traces:[],failedConnectionNames:p.map((N)=>N.connectionName),blockingConnectionNames:[],connectivity:_,drc:u},A=0;if(!u.valid)d.push("Fanout prefix failed emitted-copper DRC; skipped completion");else{let N=[],D=new Map(p.map((H,V)=>[H.connectionName,V])),L=t.connections.length>32?1:3;for(let H=0;H<L;H++){let V=new Map(N.map((j,Y)=>[j,Y])),O=p.toSorted((j,Y)=>(V.get(j.connectionName)??Number.MAX_SAFE_INTEGER)-(V.get(Y.connectionName)??Number.MAX_SAFE_INTEGER)||(D.get(j.connectionName)??0)-(D.get(Y.connectionName)??0)),U=BVr({inputSrj:t,fanoutSrj:n,plans:O,traceWidth:r,viaDiameter:i,viaHoleDiameter:s,clearance:a,allowBlindAndBuriedVias:c});if(A++,U.drc.valid&&(U.connectivity.connectedConnectionCount>m.connectivity.connectedConnectionCount||U.connectivity.connectedConnectionCount===m.connectivity.connectedConnectionCount&&U.traces.length<m.traces.length))m=U;if(N=[...new Set([...U.failedConnectionNames,...U.blockingConnectionNames,...N])],U.failedConnectionNames.length===0)break}}let g=new Set(p.map((N)=>N.connectionName)),f=o.filter((N)=>!g.has(N.connectionName)&&!rG(_,N.connectionName)),y=[];if(u.valid)for(let N of f){let D=gfn({inputSrj:t,fanoutSrj:n,plan:N,acceptedTraces:[...m.traces,...y],traceWidth:r,viaDiameter:i,viaHoleDiameter:s,clearance:a,allowBlindAndBuriedVias:c});if(D)y.push(D)}let x={...n,traces:[...n.traces??[],...m.traces,...y]},C=new Set(b6({inputSrj:t,routedSrj:x}).issues.map((N)=>N.connectionName)),b=n.connections.filter((N)=>!g.has(N.name)&&C.has(N.name)),I=[];if(u.valid&&b.length>0&&b.length<=12&&h){let N=new Set(b.map((L)=>L.name)),D={...n,connections:b,buses:n.buses?.map((L)=>({...L,connectionNames:L.connectionNames.filter((H)=>N.has(H))})).filter((L)=>L.connectionNames.length>0),obstacles:n.obstacles,traces:x.traces};try{let L=h(D,{effort:l});I=DVr({inputSrj:t,fanoutSrj:n,localTraces:[...m.traces,...y],candidates:L.filter((H)=>N.has(H.connection_name)),clearance:a,allowBlindAndBuriedVias:c})}catch(L){d.push(`Downstream router failed: ${L instanceof Error?L.message:String(L)}`)}}else if(!u.valid&&b.length>0)d.push("Skipped downstream router because the endpoint-completion baseline failed emitted-copper DRC");else if(b.length>12)d.push(`Skipped downstream router for ${b.length} unresolved connections (bounded at 12)`);else if(b.length>0&&!h)d.push(`Skipped downstream router for ${b.length} unresolved connections because no routeDownstreamConnections callback was provided`);let v=[...m.traces,...y,...I];for(let N of f){let D={...n,traces:[...n.traces??[],...v]};if(rG(b6({inputSrj:t,routedSrj:D}),N.connectionName))continue;let L=gfn({inputSrj:t,fanoutSrj:n,plan:N,acceptedTraces:v,traceWidth:r,viaDiameter:i,viaHoleDiameter:s,clearance:a,allowBlindAndBuriedVias:c});if(L)v.push(L)}let P={...n,traces:[...n.traces??[],...v]},M=TVr({fanoutSrj:P,completionTraces:v}),B=b6({inputSrj:t,routedSrj:M}),T=lu({inputSrj:t,routedSrj:M,clearance:a,allowBlindAndBuriedVias:c});if(!T.valid)return d.push("Final endpoint-completion output failed emitted-copper DRC"),{simpleRouteJson:n,traces:[],report:{attemptedLocalConnectionCount:p.length,attemptedDownstreamConnectionCount:f.length,completionTraceCount:0,searchPassCount:A,errors:d,connectivity:b6({inputSrj:t,routedSrj:n}),drc:u}};return{simpleRouteJson:M,traces:v,report:{attemptedLocalConnectionCount:p.length,attemptedDownstreamConnectionCount:f.length,completionTraceCount:v.length,searchPassCount:A,errors:d,connectivity:B,drc:T}}}var RVr={topside_left:{direction:"left",preferredExit:"top-left",exitEdge:"top"},topside_center:{direction:"up",preferredExit:"top",exitEdge:"top"},topside_right:{direction:"right",preferredExit:"top-right",exitEdge:"top"},rightside_top:{direction:"up",preferredExit:"top-right",exitEdge:"right"},rightside_center:{direction:"right",preferredExit:"right",exitEdge:"right"},rightside_bottom:{direction:"down",preferredExit:"bottom-right",exitEdge:"right"},bottomside_right:{direction:"right",preferredExit:"bottom-right",exitEdge:"bottom"},bottomside_center:{direction:"down",preferredExit:"bottom",exitEdge:"bottom"},bottomside_left:{direction:"left",preferredExit:"bottom-left",exitEdge:"bottom"},leftside_bottom:{direction:"down",preferredExit:"bottom-left",exitEdge:"left"},leftside_center:{direction:"left",preferredExit:"left",exitEdge:"left"},leftside_top:{direction:"up",preferredExit:"top-left",exitEdge:"left"},center:{}};function Z3n(e){let t=RVr[e];if(!t)throw Error(`Invalid fanout exit position "${e}"`);return t}function Xst(e){let t=e.differentialPairs;if(t===void 0)return[];if(!Array.isArray(t))throw Error("Differential pairs must be an array");let n=new Map;return e.connections.forEach((o,r)=>{let i=n.get(o.name)??[];i.push(r),n.set(o.name,i)}),t.map((o,r)=>{let i=o,s=i?.connectionNames,a=i?.lengthTolerance;if(!Array.isArray(s)||s.length!==2||s.some((l)=>typeof l!=="string"||l.length===0)||s[0]===s[1]||typeof a!=="number"||!Number.isFinite(a)||a<0)throw Error(`Differential pair ${r} requires two distinct connection names and a finite nonnegative tolerance`);let c=s.map((l)=>{let h=n.get(l);if(h?.length!==1)throw Error(`Differential pair ${r} cannot resolve original connection ${l}`);return h[0]});return{connectionNames:s,connectionIndices:c,lengthTolerance:a}})}function L8e(e,t,n=!0){let o=rT(e.layerCount),r=[],i=[],s;for(let a of t.route){if(a.route_type==="via"){i.push({center:{x:a.x,y:a.y},diameter:a.via_diameter??e.minViaPadDiameter??e.min_via_pad_diameter??e.minViaDiameter??e.minTraceWidth,spanLayers:$3n({fromLayer:a.from_layer,toLayer:a.to_layer,layers:"layers"in a&&Array.isArray(a.layers)?a.layers:void 0,layerNames:o,allowBlindAndBuriedVias:n})}),s=void 0;continue}if(a.route_type!=="wire"){s=void 0;continue}if(s?.layer===a.layer&&(s.x!==a.x||s.y!==a.y))r.push({start:{x:s.x,y:s.y},end:{x:a.x,y:a.y},width:Math.max(s.width,a.width),layer:a.layer});s=a}return{trace:t,connectionName:t.connection_name,segments:r,vias:i}}function WP(e,t=!0){return(e.traces??[]).map((n)=>L8e(e,n,t))}function*QVr(e){let{plan:t,bus:n,inputSrj:o,layerNames:r,clearance:i,consumeWork:s}=e;if(!t.via||(t.additionalVias?.length??0)>4)return;let a=(n.routableEscapeLayers??n.allowedLayers??r).filter((f)=>f!==t.targetLayer&&r.includes(f)&&(n.allowedLayers??r).includes(f));if(!a.length)return;let c=e.plans.filter((f)=>f.connectionIndex!==t.connectionIndex),l=WP(o,!1),h=[...c.flatMap((f)=>[...f.segments,...f.planeEndpointSegments??[]]),...l.flatMap((f)=>f.segments)],d=[...e.plans.flatMap((f)=>[f.via,...f.additionalVias??[],f.planeEndpointVia].filter((y)=>!!y)),...l.flatMap((f)=>f.vias)],u=t.via.diameter,{sharedBoundary:_,componentBounds:p}=n,m=u/2+i,A=[];for(let[f,y]of t.segments.entries()){if(y.layer!==t.targetLayer||f<(t.sourceEscapeSegmentCount??1))continue;let x=Ut(y.start,y.end),C=Math.max(1,Math.ceil(x/(y.width/2)));for(let b=0;b<=C;b++){s();let I=b/C,v={x:y.start.x+(y.end.x-y.start.x)*I,y:y.start.y+(y.end.y-y.start.y)*I};if(v.x>=p.minX-m&&v.x<=p.maxX+m&&v.y>=p.minY-m&&v.y<=p.maxY+m)continue;if(Math.min(v.x-_.minX,_.maxX-v.x,v.y-_.minY,_.maxY-v.y)<u/2+0.0000001)continue;if(A.some((P)=>Ut(P.point,v)<0.0000001))continue;if(o.obstacles.some((P)=>X5(v,P)<m-0.000000001))continue;if(d.some((P)=>Ut(v,P.center)<(u+P.diameter)/2+i-0.000000001))continue;if(h.some((P)=>Vr(v,P.start,P.end)<(u+P.width)/2+i-0.000000001))continue;if(A.push({index:f,point:v}),A.length===64)break}if(A.length===64)break}let g=A.flatMap((f,y)=>A.slice(y+1).flatMap((x)=>{if(f.index>=x.index||Ut(f.point,x.point)<u+i)return[];let C=t.segments.slice(f.index,x.index+1);if(C.some((b)=>b.layer!==t.targetLayer))return[];return[{a:f,b:x,length:C.reduce((b,I)=>b+Ut(I.start,I.end),0)}]})).sort((f,y)=>y.length-f.length);for(let{a:f,b:y}of g){let x=t.segments[f.index],C=t.segments[y.index],b=[...t.segments.slice(0,f.index),{...x,end:f.point}].filter((D)=>Ut(D.start,D.end)>0.0000001),I=[{...C,start:y.point},...t.segments.slice(y.index+1)].filter((D)=>Ut(D.start,D.end)>0.0000001),v=[{...x,start:f.point},...t.segments.slice(f.index+1,y.index),{...C,end:y.point}].filter((D)=>Ut(D.start,D.end)>0.0000001),P=y.point.x-f.point.x,M=y.point.y-f.point.y,B=Math.min(Math.abs(P),Math.abs(M)),T=[{x:f.point.x+Math.sign(P)*B,y:f.point.y+Math.sign(M)*B},{x:y.point.x-Math.sign(P)*B,y:y.point.y-Math.sign(M)*B}],N=[v,...T.map((D)=>[{...x,start:f.point,end:D},{...x,start:D,end:y.point}].filter((L)=>Ut(L.start,L.end)>0.0000001))];for(let D of a){let L=h.filter((U)=>U.layer===D),H=d.filter((U)=>U.spanLayers.includes(D)),V=o.obstacles.filter((U)=>U.layers.includes(D)),O=[{...t.via,center:f.point,fromLayer:t.targetLayer,toLayer:D,spanLayers:r},{...t.via,center:y.point,fromLayer:D,toLayer:t.targetLayer,spanLayers:r}];for(let U of N){s();let j=U.map((Y)=>({...Y,layer:D}));if(j.some((Y)=>L.some((X)=>!V_(Y,X,i))||H.some((X)=>Vr(X.center,Y.start,Y.end)<(X.diameter+Y.width)/2+i-0.000000001)||V.some((X)=>Wl(Y,X)<Y.width/2+i-0.000000001)))continue;yield{before:b,window:j,after:I,tuningLayer:D,addedVias:O}}}}}function pG(e){let{points:t,chamfer:n,segmentIsClear:o}=e;if(t.length<2)return null;let r=0.0000001,i=[[t[0]]];for(let s=1;s<t.length;s++){let a=t[s-1],c=t[s],l=c.x-a.x,h=c.y-a.y;if(a.z!==c.z||Math.abs(l)<r||Math.abs(h)<r||Math.abs(Math.abs(l)-Math.abs(h))<r){for(let _ of i)_.push(c);continue}let d=Math.min(Math.abs(l),Math.abs(h)),u=[{x:a.x+Math.sign(l)*d,y:a.y+Math.sign(h)*d,z:a.z},{x:c.x-Math.sign(l)*d,y:c.y-Math.sign(h)*d,z:a.z},{x:c.x,y:a.y,z:a.z},{x:a.x,y:c.y,z:a.z}].filter((_)=>o(a,_)&&o(_,c));if(i=i.flatMap((_)=>u.map((p)=>[..._,p,c])).slice(0,16),i.length===0)return null}for(let s of i){let a=[s[0]],c=!0;for(let l=1;l<s.length-1;l++){let h=s[l-1],d=s[l],u=s[l+1],_=Ut(h,d),p=Ut(d,u);if(h.z!==d.z||d.z!==u.z||_<r||p<r){a.push(d);continue}let m=(d.x-h.x)/_,A=(d.y-h.y)/_,g=(u.x-d.x)/p,f=(u.y-d.y)/p,y=m*g+A*f,x=e.repairReversingDiagonalCorners===!0&&Math.abs(y+Math.SQRT1_2)<r;if(Math.abs(y)>r&&!x){a.push(d);continue}let C=Math.min(n,_/3,p/3),b=!1;while(C>=0.000001){let I={x:d.x-m*C,y:d.y-A*C,z:d.z},v={x:d.x+g*C,y:d.y+f*C,z:d.z},P=Math.sign(m*f-A*g),M=x?{x:I.x+(m-P*A)*Math.SQRT1_2*C*(Math.SQRT2-1),y:I.y+(A+P*m)*Math.SQRT1_2*C*(Math.SQRT2-1),z:d.z}:void 0;if(M?o(I,M)&&o(M,v):o(I,v)){a.push(I,...M?[M]:[],v),b=!0;break}C/=2}if(!b){c=!1;break}}if(!c)continue;a.push(s.at(-1));for(let l=1;l<a.length;l++){let h=a[l-1],d=a[l];if(h.z!==d.z){if(Ut(h,d)>r)c=!1;continue}if(!o(h,d)){c=!1;break}let u=Math.abs(h.x-d.x),_=Math.abs(h.y-d.y);if(u>r&&_>r&&Math.abs(u-_)>r){c=!1;break}let p=a[l+1];if(p?.z===d.z&&Ut(h,d)>r&&Ut(d,p)>r){if(((d.x-h.x)*(p.x-d.x)+(d.y-h.y)*(p.y-d.y))/(Ut(h,d)*Ut(d,p))<Math.SQRT1_2-r){c=!1;break}}}if(c)return a}return null}var Jue=class{layers=new Map;constructor(e){let t=new Map;for(let n of e){let o=n.width/2,r={segment:n,minX:Math.min(n.start.x,n.end.x)-o,maxX:Math.max(n.start.x,n.end.x)+o,minY:Math.min(n.start.y,n.end.y)-o,maxY:Math.max(n.start.y,n.end.y)+o},i=t.get(n.layer)??[];i.push(r),t.set(n.layer,i)}for(let[n,o]of t)this.layers.set(n,this.build(o))}querySegment(e,t){let n=e.width/2+t+0.00000001;return this.query([e.layer],{minX:Math.min(e.start.x,e.end.x)-n,maxX:Math.max(e.start.x,e.end.x)+n,minY:Math.min(e.start.y,e.end.y)-n,maxY:Math.max(e.start.y,e.end.y)+n})}queryVia(e,t){let n=e.diameter/2+t+0.00000001;return this.query(e.spanLayers,{minX:e.center.x-n,maxX:e.center.x+n,minY:e.center.y-n,maxY:e.center.y+n})}query(e,t){let n=[],o=(i)=>!(i.minX>t.maxX||i.maxX<t.minX||i.minY>t.maxY||i.maxY<t.minY),r=(i)=>{if(!o(i))return;if(i.entries){for(let s of i.entries)if(o(s))n.push(s.segment)}else r(i.left),r(i.right)};for(let i of e){let s=this.layers.get(i);if(s)r(s)}return n}build(e){let t=e.reduce((r,i)=>({minX:Math.min(r.minX,i.minX),maxX:Math.max(r.maxX,i.maxX),minY:Math.min(r.minY,i.minY),maxY:Math.max(r.maxY,i.maxY)}),{minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0});if(e.length<=8)return{...t,entries:e};let n=t.maxX-t.minX>=t.maxY-t.minY;e.sort((r,i)=>n?r.minX+r.maxX-i.minX-i.maxX:r.minY+r.maxY-i.minY-i.maxY);let o=Math.floor(e.length/2);return{...t,left:this.build(e.slice(0,o)),right:this.build(e.slice(o))}}};function sue(e){switch(e){case"left":return"left";case"right":return"right";case"up":return"top";case"down":return"bottom"}}function BP(e){switch(e){case"left":return"left";case"right":return"right";case"top":return"up";case"bottom":return"down"}}function eCn(e,t){return e===t||e.includes(t)}function Xi(e,t){if(!e||!t?.includes("-"))return;if(!eCn(t,e))return;if(e==="left"||e==="right")return t.startsWith("top-")?"maximum":"minimum";return t.endsWith("-right")?"maximum":"minimum"}function kVr(e,t){let n=t==="up"||t==="down"?"y":"x",o=e.slice(0,32).map(({connectionIndex:r})=>[r]);for(let r=0;r<e.length;r++)for(let i=r+1;i<e.length;i++){if(o.length>=32)return o;let s=e[r],a=e[i];if(Math.abs(s.sourcePoint[n]-a.sourcePoint[n])<=0.000000001)o.push([s.connectionIndex,a.connectionIndex])}return o}var zu=0.000000001,LVr=1e5;function tCn(e){for(let[n,o]of[["viaDiameter",e.viaDiameter],["traceWidth",e.traceWidth]])if(!Number.isFinite(o)||o<=0)throw Error(`FanoutSolver: dogbone ${n} must be a positive finite number, received ${o}`);if(!Number.isFinite(e.clearance)||e.clearance<0)throw Error(`FanoutSolver: dogbone clearance must be a non-negative finite number, received ${e.clearance}`);if(e.viaHoleDiameter!==void 0&&(!Number.isFinite(e.viaHoleDiameter)||e.viaHoleDiameter<=0))throw Error(`FanoutSolver: dogbone viaHoleDiameter must be a positive finite number, received ${e.viaHoleDiameter}`);if(e.holeToHoleClearance!==void 0&&(!Number.isFinite(e.holeToHoleClearance)||e.holeToHoleClearance<0))throw Error(`FanoutSolver: dogbone holeToHoleClearance must be a non-negative finite number, received ${e.holeToHoleClearance}`);if(e.holeToHoleClearance!==void 0&&e.viaHoleDiameter===void 0)throw Error("FanoutSolver: dogbone holeToHoleClearance requires viaHoleDiameter");let t=e.maximumSearchStates??LVr;if(!Number.isInteger(t)||t<1)throw Error(`FanoutSolver: dogbone maximumSearchStates must be a positive integer, received ${t}`);return t}function Ort(e){let t=[];for(let n of e.toSorted((o,r)=>o-r)){if(!Number.isFinite(n))continue;if(t.length===0||Math.abs(t.at(-1)-n)>zu)t.push(n)}return t}function nCn(e){let t=new Map,n=new Map,o=new Map;for(let r of e){let i=t.get(r.componentId);if(!i)i={componentId:r.componentId,connections:[],obstacles:[],xCoordinates:[],yCoordinates:[],pitchX:Number.POSITIVE_INFINITY,pitchY:Number.POSITIVE_INFINITY},t.set(r.componentId,i),o.set(r.componentId,new Set);if(i.xCoordinates.push(...r.xCoordinates),i.yCoordinates.push(...r.yCoordinates),Number.isFinite(r.pitchX)&&r.pitchX>zu)i.pitchX=Math.min(i.pitchX,r.pitchX);if(Number.isFinite(r.pitchY)&&r.pitchY>zu)i.pitchY=Math.min(i.pitchY,r.pitchY);let s=o.get(r.componentId);for(let a of r.componentObstacles)if(!s.has(a))s.add(a),i.obstacles.push(a);for(let a of r.connections){let c=n.get(a.connectionIndex);if(c!==void 0){if(c!==r.componentId)throw Error(`FanoutSolver: connection index ${a.connectionIndex} belongs to multiple components`);continue}n.set(a.connectionIndex,r.componentId),i.connections.push({preparedConnection:a,busId:r.busId,direction:r.direction,terminationType:r.termination.type})}}return[...t.values()].map((r)=>({...r,connections:r.connections.toSorted((i,s)=>i.preparedConnection.connectionIndex-s.preparedConnection.connectionIndex),xCoordinates:Ort(r.xCoordinates),yCoordinates:Ort(r.yCoordinates)})).toSorted((r,i)=>r.componentId.localeCompare(i.componentId))}function HVr(e){let{coordinates:t,pitch:n}=e;if(t.length===0||!Number.isFinite(n)||n<=zu)return[];let o=[t[0]-n/2];for(let r=1;r<t.length;r++)o.push((t[r-1]+t[r])/2);return o.push(t.at(-1)+n/2),Ort(o)}function Afn(e){let{sourceCoordinate:t,coordinates:n,pitch:o}=e,r=HVr({coordinates:n,pitch:o}),i=r.filter((a)=>a<t-zu).at(-1),s=r.find((a)=>a>t+zu);return[i,s].filter((a)=>a!==void 0)}function FVr(e,t){let n=Math.abs(t.x-e.x),o=Math.abs(t.y-e.y);return n<=zu||o<=zu||Math.abs(n-o)<=zu}function zVr(e){let{source:t,site:n,direction:o}=e,r=o==="right"?n.x-t.x:o==="left"?t.x-n.x:o==="up"?n.y-t.y:t.y-n.y;return r>zu?0:Math.abs(r)<=zu?1:2}function OVr(e){let{point:t,obstacles:n,viaDiameter:o,clearance:r}=e,i=o/2+r;return n.every((s)=>X5(t,s)>=i-zu)}function VVr(e){let{segment:t,sourceObstacle:n,obstacles:o,clearance:r}=e,i=t.width/2+r;return o.every((s)=>s===n||!s.layers.includes(t.layer)||Wl(t,s)>=i-zu)}function oCn(e){let{connection:t,component:n,rules:o}=e,{preparedConnection:r,direction:i}=t,s=o.additionalObstacles?[...new Set([...n.obstacles,...o.additionalObstacles])]:n.obstacles,a={x:r.sourcePoint.x,y:r.sourcePoint.y},c=Afn({sourceCoordinate:a.x,coordinates:n.xCoordinates,pitch:n.pitchX}),l=Afn({sourceCoordinate:a.y,coordinates:n.yCoordinates,pitch:n.pitchY}),h=[...c.map((I)=>({x:I,y:a.y})),...l.map((I)=>({x:a.x,y:I})),...c.flatMap((I)=>l.map((v)=>({x:I,y:v})))],d=[];for(let I of h)if(!d.some((v)=>Ut(v,I)<=zu))d.push(I);let u=o.fixedViaPointsByConnectionIndex?.get(r.connectionIndex),_=u?[u]:d,p=[];for(let I of _){if(t.terminationType==="plane"&&!FVr(a,I))continue;if(!OVr({point:I,obstacles:s,viaDiameter:o.viaDiameter,clearance:o.clearance}))continue;let v={start:a,end:I,width:o.traceWidth,layer:r.sourceLayer};if(!VVr({segment:v,sourceObstacle:r.sourceObstacle,obstacles:s,clearance:o.clearance}))continue;if(!(o.blockingSegments??[]).every((B)=>{if(B.connectionIndex===r.connectionIndex)return!0;if(o.canShareCopper?.(r.connectionIndex,B.connectionIndex))return!0;let T=o.viaDiameter/2+B.segment.width/2+o.clearance;if(Vr(I,B.segment.start,B.segment.end)<T-zu)return!1;return B.segment.layer!==v.layer||V_(v,B.segment,o.clearance)}))continue;if(!(o.blockingVias??[]).every((B)=>{if(B.connectionIndex===r.connectionIndex)return!0;if(Ut(I,B.center)<(o.viaDiameter+B.diameter)/2+o.clearance-zu)return!1;if(B.spanLayers.includes(v.layer)&&Vr(B.center,v.start,v.end)<B.diameter/2+v.width/2+o.clearance-zu)return!1;return!0}))continue;p.push({connectionIndex:r.connectionIndex,point:I,sourceSegment:v,outwardRank:zVr({source:a,site:I,direction:i})})}let m=i==="left"||i==="right"?n.yCoordinates:n.xCoordinates,A=i==="left"||i==="right"?a.y:a.x,g=m.findIndex((I)=>Math.abs(I-A)<=zu),f=g>=0?g%2===0?1:-1:void 0,y=t.terminationType==="boundary"?o.preferredBoundaryPerpendicularSideByBusId?.get(t.busId):o.preferPlaneCheckerboardSites&&t.terminationType==="plane"&&(i==="left"||i==="right")?f:void 0,x=t.terminationType==="boundary"?o.preferBoundaryOutwardByBusId?.get(t.busId)??!0:!0,C=o.preferredViaPointsByConnectionIndex?.get(r.connectionIndex),b=(I)=>{if(y===void 0)return 0;let v=i==="left"||i==="right"?I.point.y-a.y:I.point.x-a.x;return v*y>zu?0:Math.abs(v)<=zu?1:2};return p.toSorted((I,v)=>(C?Number(Ut(I.point,C)>zu)-Number(Ut(v.point,C)>zu):0)||(x?I.outwardRank-v.outwardRank:v.outwardRank-I.outwardRank)||b(I)-b(v)||Ut(a,I.point)-Ut(a,v.point)||I.point.x-v.point.x||I.point.y-v.point.y)}function YVr(e){let{first:t,second:n,rules:o}=e,r=o.canShareCopper?.(t.connectionIndex,n.connectionIndex)??!1,i=o.viaHoleDiameter?o.viaHoleDiameter+(o.holeToHoleClearance??o.clearance):0,s=r?i:Math.max(o.viaDiameter+o.clearance,i);if(Ut(t.point,n.point)<s-zu)return!1;let a=o.viaDiameter/2+o.traceWidth/2+o.clearance;if(!r){if(Vr(t.point,n.sourceSegment.start,n.sourceSegment.end)<a-zu||Vr(n.point,t.sourceSegment.start,t.sourceSegment.end)<a-zu)return!1}if(r)return!0;return V_(t.sourceSegment,n.sourceSegment,o.clearance)}function GVr(e){let{component:t,rules:n,consumeSearchState:o}=e,r=t.connections.map((_)=>({connection:_,candidates:oCn({connection:_,component:t,rules:n})}));if(r.some((_)=>_.candidates.length===0))return null;let i=new Map,s=(_,p)=>{let m=i.get(_)?.get(p);if(m!==void 0)return m;let A=YVr({first:_,second:p,rules:n}),g=i.get(_)??new Map;g.set(p,A),i.set(_,g);let f=i.get(p)??new Map;return f.set(_,A),i.set(p,f),A},a=r.flatMap((_)=>_.candidates.length===1?[_.candidates[0]]:[]);for(let _=0;_<a.length;_++){let p=a[_];for(let m=0;m<_;m++)if(!s(p,a[m]))return null}let c=new Map(a.map((_)=>[_.connectionIndex,_])),l=new Set(r.flatMap((_)=>_.candidates.length>1?[_.connection.preparedConnection.connectionIndex]:[])),h=new Map(r.map((_)=>[_.connection.preparedConnection.connectionIndex,_]));if(l.size===0)return new Map([...c.entries()].map(([_,p])=>[_,{...p.point}]));let d=(_)=>_.candidates.filter((p)=>[...c.values()].every((m)=>s(p,m))),u=()=>{if(!o())return!1;if(l.size===0)return!0;let _,p=[];for(let A of[...l].toSorted((g,f)=>g-f)){let g=h.get(A),f=d(g);if(f.length===0)return!1;if(!_||f.length<p.length||f.length===p.length&&A<_.connection.preparedConnection.connectionIndex)_=g,p=f}let m=_.connection.preparedConnection.connectionIndex;l.delete(m);for(let A of p){if(c.set(m,A),u())return!0;c.delete(m)}return l.add(m),!1};if(!u())return null;return new Map([...c.entries()].toSorted(([_],[p])=>_-p).map(([_,p])=>[_,{...p.point}]))}function I0(e,t){let n=tCn(t);if(e.length===0)return new Map;let o=0,r=()=>(o++,o<=n),i=new Map;for(let s of nCn(e)){let a=GVr({component:s,rules:t,consumeSearchState:r});if(!a)return null;for(let[c,l]of a)i.set(c,l)}return i}function Kk(e,t){return tCn(t),nCn(e).flatMap((n)=>n.connections.flatMap((o)=>oCn({connection:o,component:n,rules:t}).map((r)=>({connectionIndex:r.connectionIndex,point:{...r.point}}))))}function*UVr(e,t,n){let o=Kk([e],t),r=24;for(let i of e.connections.toReversed()){let s=n.get(i.connectionIndex);if(!s)continue;for(let a of o){if(a.connectionIndex!==i.connectionIndex||Ut(a.point,s)<=zu)continue;if(r--<=0)return;let c=new Map(n);c.set(i.connectionIndex,a.point),yield c}}}var bh=0.0000001;var WVr=160000,XVr=240000,jVr=5000,KVr=24,ffn=3.25,$Vr=class{constructor(e,t,n,o,r,i,s,a){this.minX=t,this.minY=n,this.cellSize=i,this.columnCount=Math.max(1,Math.ceil((o-t)/i)),this.rowCount=Math.max(1,Math.ceil((r-n)/i)),this.cells=Array(this.columnCount*this.rowCount);for(let c of e){let l={...c,minX:Math.min(c.segment.start.x,c.segment.end.x),maxX:Math.max(c.segment.start.x,c.segment.end.x),minY:Math.min(c.segment.start.y,c.segment.end.y),maxY:Math.max(c.segment.start.y,c.segment.end.y)},h=(c.segment.width+s)/2+a,d=this.column(l.minX-h),u=this.column(l.maxX+h),_=this.row(l.minY-h),p=this.row(l.maxY+h);for(let m=_;m<=p;m++)for(let A=d;A<=u;A++){let g=m*this.columnCount+A;(this.cells[g]??=[]).push(l)}}}minX;minY;cellSize;cells;columnCount;rowCount;seen=new Map;queryCount=0;column(e){return Math.max(0,Math.min(this.columnCount-1,Math.floor((e-this.minX)/this.cellSize)))}row(e){return Math.max(0,Math.min(this.rowCount-1,Math.floor((e-this.minY)/this.cellSize)))}querySegment(e){let t=this.column(Math.min(e.start.x,e.end.x)),n=this.column(Math.max(e.start.x,e.end.x)),o=this.row(Math.min(e.start.y,e.end.y)),r=this.row(Math.max(e.start.y,e.end.y));if(t===n&&o===r)return this.cells[o*this.columnCount+t]??[];let i=[],s=++this.queryCount;for(let a=o;a<=r;a++)for(let c=t;c<=n;c++)for(let l of this.cells[a*this.columnCount+c]??[]){if(this.seen.get(l)===s)continue;this.seen.set(l,s),i.push(l)}return i}};function qVr(e){let t=e;if(t.shape==="circle"){let l=e.width/2;return{minX:e.center.x-l,maxX:e.center.x+l,minY:e.center.y-l,maxY:e.center.y+l,xRadius:l}}let n=(t.ccwRotationDegrees??0)*Math.PI/180,o=Math.abs(Math.cos(n)),r=Math.abs(Math.sin(n)),i=e.width/2,s=e.height/2,a=o*i+r*s,c=r*i+o*s;return{minX:e.center.x-a,maxX:e.center.x+a,minY:e.center.y-c,maxY:e.center.y+c,xRadius:a}}var JVr=class{obstaclesByCenterX;maximumXRadius;constructor(e){this.obstaclesByCenterX=e.map((t)=>({obstacle:t,...qVr(t)})).toSorted((t,n)=>t.obstacle.center.x-n.obstacle.center.x),this.maximumXRadius=this.obstaclesByCenterX.reduce((t,n)=>Math.max(t,n.xRadius),0)}querySegment(e,t){let n=Math.min(e.start.x,e.end.x),o=Math.max(e.start.x,e.end.x),r=Math.min(e.start.y,e.end.y),i=Math.max(e.start.y,e.end.y),s=n-t-this.maximumXRadius,a=o+t+this.maximumXRadius,c=0,l=this.obstaclesByCenterX.length;while(c<l){let d=Math.floor((c+l)/2);if(this.obstaclesByCenterX[d].obstacle.center.x<s)c=d+1;else l=d}let h=[];for(let d=c;d<this.obstaclesByCenterX.length;d++){let u=this.obstaclesByCenterX[d];if(u.obstacle.center.x>a)break;if(u.maxX<n-t||u.minX>o+t||u.maxY<r-t||u.minY>i+t)continue;h.push(u.obstacle)}return h}};function*ZVr(e){let{initialOrderFactories:t,rotationBase:n,getItemKey:o,maximumOrderCount:r=Number.POSITIVE_INFINITY}=e,i=new Set,s=0,a=(c)=>c.map(o).join("\x00");for(let c of t){if(s>=r)return;let l=c(),h=a(l);if(i.has(h))continue;i.add(h),s++,yield l}for(let c=1;c<n.length;c++){if(s>=r)return;let l=[...n.slice(c),...n.slice(0,c)],h=a(l);if(i.has(h))continue;i.add(h),s++,yield l}}var eYr=class{values=[];get size(){return this.values.length}sampleEntries(e){if(this.values.length<=e)return this.values;let t=Math.ceil(this.values.length/e);return this.values.filter((n,o)=>o%t===0)}push(e){this.values.push(e);let t=this.values.length-1;while(t>0){let n=Math.floor((t-1)/2);if(this.values[n].score<=e.score)break;this.values[t]=this.values[n],t=n}this.values[t]=e}pop(){let e=this.values[0],t=this.values.pop();if(!e||!t||this.values.length===0)return e;let n=0;while(!0){let o=n*2+1,r=o+1;if(o>=this.values.length)break;let i=r<this.values.length&&this.values[r].score<this.values[o].score?r:o;if(this.values[i].score>=t.score)break;this.values[n]=this.values[i],n=i}return this.values[n]=t,e}};function QJ(e,t){return t==="left"||t==="right"?e.y:e.x}function tYr(e,t){let n=t.x-e.x,o=t.y-e.y,r=Math.abs(n),i=Math.abs(o);if(r<bh||i<bh||Math.abs(r-i)<bh)return[[e,t]];if(r>i)return[[e,{x:e.x+Math.sign(n)*i,y:t.y},t],[e,{x:t.x-Math.sign(n)*i,y:e.y},t]];return[[e,{x:t.x,y:e.y+Math.sign(o)*r},t],[e,{x:e.x,y:t.y-Math.sign(o)*r},t]]}function nYr(e){if(e.length<3)return e;let t=[e[0]];for(let n=1;n<e.length-1;n++){let o=t.at(-1),r=e[n],i=e[n+1],s=Math.sign(r.x-o.x),a=Math.sign(r.y-o.y),c=Math.sign(i.x-r.x),l=Math.sign(i.y-r.y);if(s!==c||a!==l)t.push(r)}return t.push(e.at(-1)),t}function Hde(e,t,n){return e.slice(1).flatMap((o,r)=>{let i=e[r];return Ut(i,o)<bh?[]:[{start:i,end:o,width:t,layer:n}]})}function oYr(e){let t=Math.abs(e.end.x-e.start.x),n=Math.abs(e.end.y-e.start.y);return t<bh||n<bh||Math.abs(t-n)<bh}function rYr(e){for(let t=0;t<e.length;t++)for(let n=t+2;n<e.length;n++){if(t===0&&n===e.length-1&&Ut(e[t].start,e[n].end)<bh)continue;if(ad(e[t].start,e[t].end,e[n].start,e[n].end)<bh)return!1}return!0}function iYr(e){return[e.via,...e.additionalVias??[],e.planeEndpointVia].filter((t)=>Boolean(t))}function sYr(e){let{srj:t,acceptedPlans:n,allowBlindAndBuriedVias:o}=e,r=WP(t,o);return{segments:[...r.flatMap((i)=>i.segments.map((s)=>({connectionName:i.connectionName,segment:s}))),...n.flatMap((i)=>[...i.segments,...i.planeEndpointSegments??[]].map((s)=>({connectionName:i.connectionName,segment:s})))],vias:[...r.flatMap((i)=>i.vias.map((s)=>({connectionName:i.connectionName,via:s}))),...n.flatMap((i)=>iYr(i).map((s)=>({connectionName:i.connectionName,via:s})))]}}function B6(e){let{bus:t,terminal:n,targetLayer:o,targetLayerPoints:r,layerNames:i,traceWidth:s,viaDiameter:a,viaHoleDiameter:c,allowBlindAndBuriedVias:l}=e,h=n.connection,d={x:h.sourcePoint.x,y:h.sourcePoint.y},u=e.sourceEscapePoints??[d,n.viaPoint];if(u.length<2||Ut(u[0],d)>bh||Ut(u.at(-1),n.viaPoint)>bh)throw Error("FanoutSolver: source escape must connect the source pad to its first via");let _=Hde([...u],s,h.sourceLayer),p=Ut(d,n.viaPoint)>bh,m=h.sourceLayer!==o,A=Hde(r,s,o),g=G5({fromLayer:h.sourceLayer,toLayer:o,layerNames:i,allowBlindAndBuriedVias:l}),f={center:n.viaPoint,diameter:a,holeDiameter:c,fromLayer:h.sourceLayer,toLayer:o,spanLayers:g},y=[{route_type:"wire",...d,width:s,layer:h.sourceLayer,...h.sourcePoint.pcb_port_id?{start_pcb_port_id:h.sourcePoint.pcb_port_id}:{}},...p?[...u.slice(1).map((I)=>({route_type:"wire",...I,width:s,layer:h.sourceLayer}))]:[],...m?[{route_type:"via",...n.viaPoint,from_layer:h.sourceLayer,to_layer:o,via_diameter:a,via_hole_diameter:c},{route_type:"wire",...n.viaPoint,width:s,layer:o}]:[],...r.slice(1).map((I)=>({route_type:"wire",...I,width:s,layer:o}))],x=PG({connectionName:h.connection.name,sourcePointIndex:h.sourcePointIndex}),C=[...p?_:[],...A],b=Xi(t.exitEdge,t.preferredExit);return{busId:t.busId,connectionName:h.connection.name,connectionIndex:h.connectionIndex,sourcePointIndex:h.sourcePointIndex,sourcePoint:h.sourcePoint,sourceObstacle:h.sourceObstacle,sourceLayer:h.sourceLayer,targetPoint:h.targetPoint,targetLayer:o,termination:t.termination,direction:t.direction,...t.exitEdge?{exitEdge:t.exitEdge}:{},...b?{cornerBandSide:b}:{},exitPoint:n.exitPoint,trace:{type:"pcb_trace",pcb_trace_id:x.traceId,connection_name:h.connection.name,connectsTo:[...h.sourcePoint.pointId?[h.sourcePoint.pointId]:[],...h.sourcePoint.pcb_port_id?[h.sourcePoint.pcb_port_id]:[],x.boundaryExitPointId],route:y},segments:C,..._.length>1?{sourceEscapeSegmentCount:_.length}:{},via:m?f:void 0,length:C.reduce((I,v)=>I+Ut(v.start,v.end),0)}}function*w1(e,t=1,n=!1){if(!Number.isInteger(t)||t<1)throw Error(`FanoutSolver: maximum winding alternatives must be a positive integer, received ${t}`);let{srj:o,bus:r,targetLayer:i,terminals:s,acceptedPlans:a,layerNames:c,traceWidth:l,viaDiameter:h,viaHoleDiameter:d,clearance:u,allowBlindAndBuriedVias:_=!0,allowSameNetMerges:p=!1,maximumRouteOrderAttempts:m,maximumSearchStates:A=XVr,reservedVias:g=[],softReservedVias:f=[],gridStepDivisor:y=1,heuristicWeight:x=1,preferTargetDirectedLaneBias:C=!1,allowSourceLayerRouting:b=!1,adaptiveRouteOrder:I=!1,alignGridToPads:v=!1,includeReverseTargetRotation:P=!1,reserveTerminalExitPoints:M=!1,forbidEarlyExitBoundaryContact:B=!1}=e;if(m!==void 0&&(!Number.isInteger(m)||m<1))throw Error(`FanoutSolver: maximumRouteOrderAttempts must be a positive integer, received ${m}`);if(!Number.isSafeInteger(A)||A<1)throw Error(`FanoutSolver: maximumSearchStates must be a positive safe integer, received ${A}`);if(!Number.isFinite(x)||x<=0)throw Error(`FanoutSolver: heuristicWeight must be a positive finite number, received ${x}`);if(y!==1&&y!==2)throw Error(`FanoutSolver: gridStepDivisor must be 1 or 2, received ${y}`);if(s.length===0||!r.exitEdge||!b&&s.some((Xe)=>Xe.connection.sourceLayer===i))return[];let T=(l+u)/y,N=Math.min(r.pitchX,r.pitchY),D=v&&y===2&&Number.isFinite(N),L=e.gridStep??(D?N/(2*Math.ceil(N/(2*T))):T);if(!Number.isFinite(L)||L<=0)return[];let{minX:H,maxX:V,minY:O,maxY:U}=r.sharedBoundary,j=e.gridOrigin?.x??r.xCoordinates[0]??H,Y=e.gridOrigin?.y??r.yCoordinates[0]??O,X=D?j+Math.ceil((H-j)/L)*L:H,K=D?Y+Math.ceil((O-Y)/L)*L:O,J=Math.floor((V-X)/L)+1,ee=Math.floor((U-K)/L)+1,se=J*ee;if(J<2||ee<2||se>WVr)return[];let ne=Array.from({length:se},(Xe,it)=>{let St=it%J,kt=Math.floor(it/J);return{column:St,row:kt,point:{x:X+St*L,y:K+kt*L}}}),re=f.length?new Float32Array(se):void 0;if(re)for(let{via:Xe}of f){if(!Xe.spanLayers.includes(i))continue;let it=Xe.diameter/2+l/2+u,St=Math.max(0,Math.ceil((Xe.center.x-it-X)/L)),kt=Math.min(J-1,Math.floor((Xe.center.x+it-X)/L)),Lt=Math.max(0,Math.ceil((Xe.center.y-it-K)/L)),Wt=Math.min(ee-1,Math.floor((Xe.center.y+it-K)/L));for(let bn=Lt;bn<=Wt;bn++)for(let pn=St;pn<=kt;pn++){let wn=bn*J+pn;if(Ut(ne[wn].point,Xe.center)<it)re[wn]=re[wn]+25*L}}let Z=n?ne.filter((Xe,it)=>it%Math.max(1,Math.ceil(ne.length/1000))===0).map((Xe)=>Xe.point):[],te=o.obstacles.filter((Xe)=>Xe.layers.includes(i)),ie=new JVr(te),le=sYr({srj:o,acceptedPlans:a,allowBlindAndBuriedVias:_}),ue=le.segments.filter(({segment:Xe})=>{if(Xe.layer!==i)return!1;let it=(Xe.width+l)/2+u;return!(Math.max(Xe.start.x,Xe.end.x)<H-it||Math.min(Xe.start.x,Xe.end.x)>V+it||Math.max(Xe.start.y,Xe.end.y)<O-it||Math.min(Xe.start.y,Xe.end.y)>U+it)});if(b)ue.push(...g.flatMap((Xe)=>Xe.sourceEscapeSegment?.layer===i?[{connectionName:Xe.connectionName,segment:Xe.sourceEscapeSegment}]:[]));let de=le.vias.filter(({via:Xe})=>{if(!Xe.spanLayers.includes(i))return!1;let it=Xe.diameter/2+l/2+u;return!(Xe.center.x<H-it||Xe.center.x>V+it||Xe.center.y<O-it||Xe.center.y>U+it)});de.push(...g.filter(({via:Xe})=>{if(!Xe.spanLayers.includes(i))return!1;let it=Xe.diameter/2+l/2+u;return!(Xe.center.x<H-it||Xe.center.x>V+it||Xe.center.y<O-it||Xe.center.y>U+it)}));let me=s.filter((Xe)=>Xe.connection.sourceLayer!==i).map((Xe)=>({connectionName:Xe.connection.connection.name,via:{center:Xe.viaPoint,diameter:h,spanLayers:G5({fromLayer:Xe.connection.sourceLayer,toLayer:i,layerNames:c,allowBlindAndBuriedVias:_})}})),Ae=BP(r.exitEdge),xe=(Xe,it)=>Xe===it||p&&Y5(o,Xe,it),Me=(Xe)=>new $Vr(Xe,H,O,V,U,L*8,l,u),Re=Me(ue),we=[...de,...me],_e=we.reduce((Xe,{via:it})=>Math.max(Xe,it.diameter/2+l/2+u),l/2+u),ye=we.toSorted((Xe,it)=>Xe.via.center.x-it.via.center.x),Se=(Xe)=>{let it=0,St=ye.length;while(it<St){let kt=Math.floor((it+St)/2);if(ye[kt].via.center.x<Xe)it=kt+1;else St=kt}return it},Ne=(Xe)=>{let{segment:it,terminal:St,acceptedAttemptSegmentIndex:kt}=Xe;if(B){let mn=r.sharedBoundary;for(let _n of[it.start,it.end])if((Math.abs(_n.x-mn.minX)<bh||Math.abs(_n.x-mn.maxX)<bh||Math.abs(_n.y-mn.minY)<bh||Math.abs(_n.y-mn.maxY)<bh)&&Ut(_n,St.exitPoint)>bh)return!1}let Lt=St.connection.connection.name,Wt=Math.min(it.start.x,it.end.x),bn=Math.max(it.start.x,it.end.x),pn=Math.min(it.start.y,it.end.y),wn=Math.max(it.start.y,it.end.y),Fn=it.width/2+u;for(let mn of ie.querySegment(it,Fn)){if(mn.connectedTo.includes(Lt)||p&&P6(o,mn,Lt))continue;if(Wl(it,mn)<Fn-bh)return!1}for(let mn of Re.querySegment(it)){if(xe(Lt,mn.connectionName))continue;let _n=(it.width+mn.segment.width)/2+u;if(bn+_n<mn.minX||Wt-_n>mn.maxX||wn+_n<mn.minY||pn-_n>mn.maxY)continue;if(ad(it.start,it.end,mn.segment.start,mn.segment.end)<_n-bh)return!1}for(let mn of kt.querySegment(it)){if(xe(Lt,mn.connectionName))continue;let _n=(it.width+mn.segment.width)/2+u;if(bn+_n<mn.minX||Wt-_n>mn.maxX||wn+_n<mn.minY||pn-_n>mn.maxY)continue;if(ad(it.start,it.end,mn.segment.start,mn.segment.end)<(it.width+mn.segment.width)/2+u-bh)return!1}for(let mn of M?s:[]){if(xe(Lt,mn.connection.connection.name))continue;if(Vr(mn.exitPoint,it.start,it.end)<l+u-bh)return!1}for(let mn=Se(Wt-_e);mn<ye.length;mn++){let _n=ye[mn];if(_n.via.center.x>bn+_e)break;if(xe(Lt,_n.connectionName))continue;let no=_n.via.diameter/2+it.width/2+u;if(_n.via.center.x<Wt-no||_n.via.center.x>bn+no||_n.via.center.y<pn-no||_n.via.center.y>wn+no)continue;if(Vr(_n.via.center,it.start,it.end)<no-bh)return!1}return!0},ke=(Xe)=>{let{terminal:it,endpoint:St,acceptedAttemptSegmentIndex:kt}=Xe,Lt=[],Wt=L*ffn,bn=Math.max(0,Math.ceil((St.x-Wt-X)/L)-1),pn=Math.min(J-1,Math.floor((St.x+Wt-X)/L)+1),wn=Math.max(0,Math.ceil((St.y-Wt-K)/L)-1),Fn=Math.min(ee-1,Math.floor((St.y+Wt-K)/L)+1);for(let mn=wn;mn<=Fn;mn++)for(let _n=bn;_n<=pn;_n++){let no=mn*J+_n,To=ne[no],ir=Ut(St,To.point);if(ir>L*ffn)continue;for(let xt of tYr(St,To.point)){let gt=Hde(xt,l,i);if(!gt.every((Ot)=>Ne({segment:Ot,terminal:it,acceptedAttemptSegmentIndex:kt})))continue;Lt.push({nodeIndex:no,points:xt,radialDistance:ir,length:gt.reduce((Ot,Zt)=>Ot+Ut(Zt.start,Zt.end),0)})}}return Lt.toSorted((mn,_n)=>mn.radialDistance-_n.radialDistance||mn.length-_n.length||mn.nodeIndex-_n.nodeIndex).slice(0,KVr)},nt=(Xe)=>{let{terminal:it,acceptedAttemptSegments:St,expandedPoints:kt,frontierPoints:Lt,bestPath:Wt,expandedStateCount:bn,searchBatch:pn,connectionComplete:wn}=Xe;return{title:`Winding ${r.busId}: ${it.connection.connection.name}`,rects:[{center:{x:(H+V)/2,y:(O+U)/2},width:V-H,height:U-O,fill:"rgba(0, 0, 0, 0)",stroke:"rgba(14, 165, 233, 0.9)",label:"A* search boundary"}],points:[...Z.map((Fn)=>({...Fn,color:"rgba(148, 163, 184, 0.22)"})),...Lt.map((Fn)=>({...Fn,color:"rgba(6, 182, 212, 0.75)",label:"open frontier"})),...kt.map((Fn)=>({...Fn,color:"rgba(244, 63, 94, 0.8)",label:"expanded in current step"})),{...it.connection.sourcePoint,color:"#f97316",label:`source: ${it.connection.connection.name}`},{...it.exitPoint,color:"#a855f7",label:"target exit"}],circles:s.map((Fn)=>({center:Fn.viaPoint,radius:h/2,fill:Fn===it?"rgba(250, 204, 21, 0.85)":"rgba(250, 204, 21, 0.25)",stroke:Fn===it?"#ca8a04":"#a16207",label:Fn===it?"active via":`reserved via: ${Fn.connection.connection.name}`})),lines:[...St.map(({segment:Fn,connectionName:mn})=>({points:[Fn.start,Fn.end],strokeColor:"rgba(34, 197, 94, 0.9)",strokeWidth:Math.max(l,L*0.35),label:`accepted: ${mn}`})),{points:[it.viaPoint,it.exitPoint],strokeColor:"rgba(168, 85, 247, 0.45)",strokeWidth:Math.max(l*0.5,L*0.15),strokeDash:[L,L],label:"active via-to-exit search"},...Wt?[{points:[...Wt],strokeColor:"#facc15",strokeWidth:Math.max(l,L*0.45),label:"best path so far"}]:[]],texts:[{x:H,y:U+L*2,text:wn?`connection complete · ${bn.toLocaleString()} states`:`A* batch ${pn} · ${bn.toLocaleString()} states`,color:"#0f172a",fontSize:Math.max(L*2.5,0.5),anchorSide:"bottom_left"}]}},dt=function*(Xe){let{terminal:it,acceptedAttemptSegments:St,laneBias:kt}=Xe,Lt=Me(St),Wt=ke({terminal:it,endpoint:it.viaPoint,acceptedAttemptSegmentIndex:Lt}),bn=ke({terminal:it,endpoint:it.exitPoint,acceptedAttemptSegmentIndex:Lt});if(Wt.length===0||bn.length===0)return{points:null,expandedStateCount:0};let pn=new Map;for(let Bn of bn){let ho=pn.get(Bn.nodeIndex)??[];ho.push(Bn),pn.set(Bn.nodeIndex,ho)}let wn=se*9,Fn=new Uint8Array(se*8),mn=x>1?new Uint8Array(wn):void 0,_n=new Float64Array(wn).fill(Number.POSITIVE_INFINITY),no=new Int32Array(wn).fill(-1),To=new eYr,ir=new Float64Array(se),xt=new Float64Array(se),gt=QJ(it.exitPoint,Ae);for(let Bn=0;Bn<se;Bn++){let ho=ne[Bn].point,Qo=Math.abs(ho.x-it.exitPoint.x),Nn=Math.abs(ho.y-it.exitPoint.y);ir[Bn]=Math.max(Qo,Nn)+(Math.SQRT2-1)*Math.min(Qo,Nn);let mo=QJ(ho,Ae);xt[Bn]=kt===0?0:kt>0?Math.max(0,gt-mo)*0.2:Math.max(0,mo-gt)*0.2}for(let Bn of Wt){let ho=Bn.nodeIndex*9+8;if(Bn.length>=_n[ho])continue;_n[ho]=Bn.length;let Qo=ir[Bn.nodeIndex];To.push({node:Bn.nodeIndex,direction:8,score:Bn.length+x*Qo})}let Ot=[[1,0],[1,1],[0,1],[-1,1],[-1,0],[-1,-1],[0,-1],[1,-1]],Zt=Array.from({length:9},(Bn,ho)=>Ot.flatMap((Qo,Nn)=>{let mo=Math.abs(ho-Nn);return ho===8||Math.min(mo,8-mo)<=1?[Nn]:[]})),je=new Map;for(let Bn of Wt){let ho=je.get(Bn.nodeIndex)??[];ho.push(Bn),je.set(Bn.nodeIndex,ho)}let Mt=Number.POSITIVE_INFINITY,Kt=null,nn=0,Zn=0,Vn=0,Rn=[];while(To.size>0&&nn<A){let Bn=To.pop();if(Bn.score>=Mt-bh)break;let ho=Bn.node*9+Bn.direction;if(mn?.[ho])continue;let Qo=_n[ho];if(Bn.score>Qo+x*ir[Bn.node]+bh)continue;if(mn)mn[ho]=1;if(nn++,Zn++,n&&Zn%50===0)Rn.push(ne[Bn.node].point);let Nn=pn.get(Bn.node);if(Nn){let Io=[],io=ho;while(io>=0)Io.push(ne[Math.floor(io/9)].point),io=no[io];Io.reverse();let Wo=ho;while(no[Wo]>=0)Wo=no[Wo];let rr=Math.floor(Wo/9),xr=je.get(rr)??[],Ci=Math.min(...xr.map((ea)=>ea.length));for(let ea of xr)for(let ya of Nn){let Oo=Qo-Ci+ea.length+ya.length;if(Oo>=Mt-bh)continue;let $i=nYr([...ea.points,...Io.slice(1),...ya.points.toReversed().slice(1)]),Ei=Hde($i,l,i);if(!Ei.every(oYr)||!rYr(Ei)||!Ei.every((hs)=>Ne({segment:hs,terminal:it,acceptedAttemptSegmentIndex:Lt})))continue;Mt=Oo,Kt=$i}}if(x>1&&Kt)return{points:Kt,expandedStateCount:nn};let mo=ne[Bn.node];for(let Io of Zt[Bn.direction]){let[io,Wo]=Ot[Io],rr=mo.column+io,xr=mo.row+Wo;if(rr<0||rr>=J||xr<0||xr>=ee)continue;let Ci=xr*J+rr,ea=ne[Ci].point,ya=Bn.direction!==8&&Bn.direction!==Io,Oo=xt[Ci],$i=Qo+(io!==0&&Wo!==0?L*Math.SQRT2:L)+(ya?L*0.2:0)+Oo+(re?.[Ci]??0),Ei=Ci*9+Io;if(mn?.[Ei])continue;if($i>=_n[Ei]-bh)continue;let hs=Bn.node*8+Io;if(Fn[hs]===0){let kl=Ne({segment:{start:mo.point,end:ea,width:l,layer:i},terminal:it,acceptedAttemptSegmentIndex:Lt});Fn[hs]=kl?1:2,Fn[Ci*8+(Io+4)%8]=kl?1:2}if(Fn[hs]===2)continue;_n[Ei]=$i,no[Ei]=ho;let il=ir[Ci];To.push({node:Ci,direction:Io,score:$i+x*il})}if(Zn>=jVr)Zn=0,Vn++,yield{expandedStateCount:nn,...n?{visualization:nt({terminal:it,acceptedAttemptSegments:St,expandedPoints:Rn,frontierPoints:To.sampleEntries(120).map((Io)=>ne[Io.node].point),bestPath:Kt,expandedStateCount:nn,searchBatch:Vn,connectionComplete:!1})}:{}},Rn=[]}return{points:Kt,expandedStateCount:nn}},rt=s.toSorted((Xe,it)=>QJ(Xe.exitPoint,Ae)-QJ(it.exitPoint,Ae)||Xe.connection.connection.name.localeCompare(it.connection.connection.name)),mt=s.map((Xe)=>QJ(Xe.viaPoint,Ae)),lt=rt.map((Xe)=>QJ(Xe.exitPoint,Ae)),Ct=mt.reduce((Xe,it)=>Xe+it,0)/mt.length,Nt=lt.reduce((Xe,it)=>Xe+it,0)/lt.length,Ht=Math.max(...mt)<Math.min(...lt)-bh,Tt=Math.min(...mt)>Math.max(...lt)+bh,et=e.routeOrder?[e.laneBias??0]:C?Ht?[0,1,-1]:Tt?[0,-1,1]:r.direction===Ae&&Nt>Ct+bh?[1,0,-1]:r.direction===Ae&&Nt<Ct-bh?[-1,0,1]:[0,1,-1]:Ht?[1,0,-1]:Tt?[-1,0,1]:[0,1,-1],vt=[];if(e.routeOrder){if(e.routeOrder.length!==s.length||new Set(e.routeOrder).size!==s.length||e.routeOrder.some((Xe)=>!Number.isInteger(Xe)||Xe<0||Xe>=s.length))throw Error("FanoutSolver: routeOrder must contain every terminal index exactly once");vt.push(()=>e.routeOrder.map((Xe)=>s[Xe]))}if(v&&C&&Ht)vt.push(()=>rt);if(Ht)vt.push(()=>[...rt.slice(1),rt[0]]);else if(Tt){if(vt.push(()=>[...rt].reverse()),P&&rt.length>2)vt.push(()=>[...rt.slice(0,-1).toReversed(),rt.at(-1)])}vt.push(...C&&r.direction===Ae&&Nt<Ct-bh&&!Ht&&!Tt?[()=>[...rt].reverse(),()=>rt]:[()=>rt,()=>[...rt].reverse()],()=>s.toSorted((Xe,it)=>Xe.viaPoint.x-it.viaPoint.x||Xe.viaPoint.y-it.viaPoint.y),()=>s.toSorted((Xe,it)=>it.viaPoint.x-Xe.viaPoint.x||it.viaPoint.y-Xe.viaPoint.y),()=>s.toSorted((Xe,it)=>Xe.viaPoint.y-it.viaPoint.y||Xe.viaPoint.x-it.viaPoint.x),()=>s.toSorted((Xe,it)=>it.viaPoint.y-Xe.viaPoint.y||it.viaPoint.x-Xe.viaPoint.x));let ht=m===void 0?void 0:Math.ceil(m/et.length),We=ZVr({initialOrderFactories:vt,rotationBase:rt,getItemKey:(Xe)=>Xe.connection.connection.name,maximumOrderCount:ht}),Le=[],Ze=new Set,$e=function*(){while(!0){let Xe=Le.shift(),it=Xe?{done:!1,value:Xe}:We.next();if(it.done)return;let St=it.value.map((kt)=>kt.connection.connection.name).join("|");if(Ze.has(St))continue;Ze.add(St),yield it.value}},qe=[],ft=new Set,It=new Map,ze=0;for(let Xe of $e())for(let it of et){if(m!==void 0&&ze>=m)return qe;ze++;let St=[],kt=new Map,Lt=!1;for(let pn=0;pn<Xe.length;pn++){let wn=Xe[pn],Fn=JSON.stringify([s.indexOf(wn),it,St.map(({connectionName:Zt,segment:je})=>[Zt,je.start.x,je.start.y,je.end.x,je.end.y,je.width,je.layer])]),mn=It.get(Fn),_n=dt({terminal:wn,acceptedAttemptSegments:St,laneBias:it}),no=mn===void 0?_n.next():{done:!0,value:{points:null,expandedStateCount:mn.expandedStateCount}},To=mn?.searchBatch??0,ir=0;while(!no.done)ir=no.value.expandedStateCount,yield{phase:"route-connection",routeOrderAttempt:ze,connectionIndex:pn,connectionCount:Xe.length,connectionName:wn.connection.connection.name,searchBatch:++To,expandedStateCount:ir,connectionComplete:!1,...no.value.visualization?{visualization:no.value.visualization}:{}},no=_n.next();let{points:xt,expandedStateCount:gt}=no.value;if(ir=gt,yield{phase:"route-connection",routeOrderAttempt:ze,connectionIndex:pn,connectionCount:Xe.length,connectionName:wn.connection.connection.name,searchBatch:To,expandedStateCount:ir,connectionComplete:!0,...n?{visualization:nt({terminal:wn,acceptedAttemptSegments:St,expandedPoints:[],frontierPoints:[],bestPath:xt,expandedStateCount:ir,searchBatch:To,connectionComplete:!0})}:{}},!xt){if(It.set(Fn,{expandedStateCount:gt,searchBatch:To}),I&&m!==void 0&&pn>0){let Zt=Xe.filter((je)=>je!==wn);Le.push([wn,...Zt])}Lt=!0;break}let Ot=wn.connection.connection.name;kt.set(Ot,xt),St.push(...Hde(xt,l,i).map((Zt)=>({connectionName:Ot,segment:Zt})))}if(Lt)continue;let Wt=s.map((pn)=>{let wn=kt.get(pn.connection.connection.name);if(!wn)throw Error(`FanoutSolver: via-minimal winding route omitted "${pn.connection.connection.name}"`);return B6({bus:r,terminal:pn,targetLayer:i,targetLayerPoints:wn,sourceEscapePoints:e.sourceEscapePaths?.get(pn.connection.connectionIndex),layerNames:c,traceWidth:l,viaDiameter:h,viaHoleDiameter:d,allowBlindAndBuriedVias:_})}),bn=Wt.map((pn)=>pn.segments.map((wn)=>`${wn.start.x},${wn.start.y},${wn.end.x},${wn.end.y},${wn.layer}`).join(";")).join("|");if(ft.has(bn))continue;if(ft.add(bn),qe.push(Wt),qe.length>=t)return qe}return qe}function aYr(e,t=1){let n=w1(e,t),o=n.next();while(!o.done)o=n.next();return o.value}function rCn(e){return aYr(e,1)[0]??null}function jst(e){return e.allowViaInPad===!0}function vh(e){return e==="left"||e==="right"}function HP(e){return e==="right"||e==="up"?1:-1}function j3(e,t){return vh(t)?e.x:e.y}function cu(e,t){return vh(t)?e.y:e.x}function y6(e){return Xi(e.exitEdge,e.preferredExit)}function cYr(e){return Xi(sue(e.direction),e.preferredExit)}function _Z(e){return Boolean(e.exitEdge&&e.termination.type==="boundary"&&e.connections.length>0&&e.connections.every((t)=>t.hasExplicitLayeredExitTarget===!0))}function JIe(e){if("source_trace_id"in e&&typeof e.source_trace_id==="string")return e.source_trace_id;return e.name}function iCn(e){let{bus:t,boundaryDirection:n,layerNames:o,targetLayer:r}=e,i=(g)=>g.exitTargetPoint?.layer??$st(g.targetPoint),s=(g,f)=>{let y=cu(g.exitTargetPoint??g.targetPoint,n)-cu(f.exitTargetPoint??f.targetPoint,n);if(y!==0)return y;let x=JIe(g.connection),C=JIe(f.connection),b=x.localeCompare(C);if(b!==0)return b;return g.connection.name.localeCompare(f.connection.name)||g.connectionIndex-f.connectionIndex},a=t.connections.toSorted((g,f)=>{let y=cu(g.exitTargetPoint??g.targetPoint,n)-cu(f.exitTargetPoint??f.targetPoint,n);if(y!==0)return y;return g.connection.name.localeCompare(f.connection.name)||JIe(g.connection).localeCompare(JIe(f.connection))||o.indexOf(i(g))-o.indexOf(i(f))||g.connectionIndex-f.connectionIndex}),c=new Map;for(let g of t.connections){let f=i(g),y=c.get(f)??[];y.push(g),c.set(f,y)}let l=[...c.keys()].toSorted((g,f)=>Number(f===r)-Number(g===r)||o.indexOf(g)-o.indexOf(f)||g.localeCompare(f)),h=new Map(l.map((g,f)=>[g,f])),d=new Map;for(let g of l)for(let[f,y]of c.get(g).toSorted(s).entries())d.set(y.connectionIndex,f);let u=t.connections.toSorted((g,f)=>(d.get(g.connectionIndex)??0)-(d.get(f.connectionIndex)??0)||(h.get(i(g))??0)-(h.get(i(f))??0)||s(g,f)),_=[u];for(let g=0;g+1<u.length;g++){let f=u[g],y=u[g+1];if(i(f)===i(y))continue;let x=[...u];x[g]=y,x[g+1]=f,_.push(x)}_.push(a);let p=new Set(_.map((g)=>g.map((f)=>f.connectionIndex).join(","))).size;if(!y6(t)&&t.connections.length<=8&&l.length>1){let g=l.map((C)=>c.get(C).toSorted(s)),f=g.map(()=>0),y=[],x=()=>{if(_.length>=128)return;if(y.length===t.connections.length){_.push([...y]);return}for(let C=0;C<g.length;C++){let b=f[C],I=g[C][b];if(!I)continue;f[C]=b+1,y.push(I),x(),y.pop(),f[C]=b}};x()}let m=new Set;return{orders:_.filter((g)=>{let f=g.map((y)=>y.connectionIndex).join(",");if(m.has(f))return!1;return m.add(f),!0}),legacyOrder:a,ordinaryOrderCount:p}}function sCn(e){let{connection:t,windingOrderIndex:n=0}=e,{orders:o,legacyOrder:r}=iCn(e),i=e.windingOrderIndex===void 0?r:o[n]??o[0]??r,s=i.findIndex((a)=>a.connectionIndex===t.connectionIndex);if(s<0)throw Error(`FanoutSolver: connection "${t.connection.name}" is missing from winding order`);return{rank:s,connectionCount:i.length}}function lYr(e){let{bus:t,escapeLayer:n}=e;return(t.routableEscapeLayers??t.allowedLayers)?.find((o)=>o!==n)}function Vrt(e){let{bus:t,boundaryDirection:n,traceWidth:o,clearance:r}=e;if(y6(t)||!_Z(t))return;let i=new Set(t.connections.map((d)=>d.exitTargetPoint?.layer??$st(d.targetPoint))),s=vh(n)?t.sharedBoundary.minY:t.sharedBoundary.minX,a=vh(n)?t.sharedBoundary.maxY:t.sharedBoundary.maxX,c=t.connections.map((d)=>Math.max(s,Math.min(a,cu(d.exitTargetPoint??d.targetPoint,n)))).toSorted((d,u)=>d-u),l=o+r;if((i.size<2||!e.allowLayerInterleaving)&&c.every((d,u)=>u===0||d-c[u-1]>=l-0.000000001))return;if(a-s<(c.length-1)*l-0.000000001)return;let h=[];for(let[d,u]of c.entries()){h.push({start:d,count:1,mean:u-d*l});while(h.length>1&&h.at(-2).mean>h.at(-1).mean){let _=h.pop(),p=h.pop();h.push({start:p.start,count:p.count+_.count,mean:(p.mean*p.count+_.mean*_.count)/(p.count+_.count)})}}for(let d of h){let u=Math.max(s,Math.min(a-(c.length-1)*l,d.mean));for(let _=d.start;_<d.start+d.count;_++)c[_]=u+_*l}return c}function iG(e){let t=e.fixedBoundaryTracksByConnectionIndex?.get(e.connection.connectionIndex);if(t!==void 0)return t;let n=cu(e.connection.exitTargetPoint??e.connection.targetPoint,e.boundaryDirection),o=vh(e.boundaryDirection)?e.bus.sharedBoundary.minY:e.bus.sharedBoundary.minX,r=vh(e.boundaryDirection)?e.bus.sharedBoundary.maxY:e.bus.sharedBoundary.maxX,i=e.traceWidth!==void 0&&e.clearance!==void 0?Vrt({...e,traceWidth:e.traceWidth,clearance:e.clearance}):void 0;if(i&&e.layerNames&&e.targetLayer){let{rank:s}=sCn({...e,layerNames:e.layerNames,targetLayer:e.targetLayer});return i[s]}return Math.max(o,Math.min(r,n))}function Tv(e){let t=e.fixedBoundaryTracksByConnectionIndex?.get(e.connection.connectionIndex);if(t!==void 0)return t;let{bus:n,connection:o,cornerExitLaneOffset:r,traceWidth:i,viaDiameter:s,clearance:a,layerNames:c,targetLayer:l,windingOrderIndex:h,cornerBandTargetTrackOffset:d=0}=e,u=y6(n);if(!u||!n.exitEdge)return cu(o.exitTargetPoint??o.targetPoint,n.direction);let _=BP(n.exitEdge),p=vh(_)?n.sharedBoundary.minY:n.sharedBoundary.minX,m=vh(_)?n.sharedBoundary.maxY:n.sharedBoundary.maxX,A=Math.max(i+a,s+a),g=p+(m-p)*(u==="minimum"?0.25:0.75)+d,f=_Z(n)?sCn({bus:n,connection:o,boundaryDirection:_,layerNames:c,targetLayer:l,windingOrderIndex:h}):void 0,y=Math.max(n.connections.length,n.cornerBandConnectionCount??n.connections.length,r+(f?.connectionCount??0)),x=g-(y-1)*A/2,C=f?.rank??aue(n,o),b=r+C,v=!f&&u==="maximum"===HP(_)>0?y-1-b:b;return x+v*A}function yfn(e,t){let n=y6(e);if(!n||!e.exitEdge)return{exit:0,localChannel:0,boundaryChannel:0};let o=t.filter((s)=>s.exitEdge&&s.cornerBandSide!==void 0),r=o.filter((s)=>s.exitEdge===e.exitEdge&&s.cornerBandSide===n),i=o.filter((s)=>s.direction===e.direction);return{exit:r.length,localChannel:i.length,boundaryChannel:r.length}}function cf(e,t,n){return vh(n)?{x:e,y:t}:{x:t,y:e}}function bP(e,t=e.direction){switch(t){case"right":return e.sharedBoundary.maxX;case"left":return e.sharedBoundary.minX;case"up":return e.sharedBoundary.maxY;case"down":return e.sharedBoundary.minY}}function gZ(e){return vh(e.direction)?e.pitchX:e.pitchY}function aCn(e){return vh(e.direction)?e.pitchY:e.pitchX}function xfn(e,t){if(e.length<3)return[...e];let n=[e[0]];for(let o=1;o<e.length-1;o++){let r=e[o-1],i=e[o],s=e[o+1],a={x:i.x-r.x,y:i.y-r.y},c={x:s.x-i.x,y:s.y-i.y},l=Math.hypot(a.x,a.y),h=Math.hypot(c.x,c.y),d=Math.abs(a.x)<=0.000000001||Math.abs(a.y)<=0.000000001,u=Math.abs(c.x)<=0.000000001||Math.abs(c.y)<=0.000000001,_=Math.abs(a.x*c.x+a.y*c.y)<=0.000000001;if(l<=0.000000001||h<=0.000000001||!d||!u||!_){n.push(i);continue}let p=Math.min(t,l/3,h/3);n.push({x:i.x-a.x/l*p,y:i.y-a.y/l*p}),n.push({x:i.x+c.x/h*p,y:i.y+c.y/h*p})}return n.push(e.at(-1)),n.filter((o,r)=>r===0||Ut(o,n[r-1])>0.000000001)}function Cfn(e,t){let n=t.x-e.x,o=t.y-e.y,r=Math.abs(n),i=Math.abs(o);if(r<=0.000000001||i<=0.000000001||Math.abs(r-i)<=0.000000001)return[[e,t]];if(r>i)return[[e,{x:e.x+Math.sign(n)*i,y:t.y},t],[e,{x:t.x-Math.sign(n)*i,y:e.y},t]];return[[e,{x:t.x,y:e.y+Math.sign(o)*r},t],[e,{x:e.x,y:t.y-Math.sign(o)*r},t]]}function hYr(e){let t=(vh(e.direction)?e.xCoordinates:e.yCoordinates).toSorted((r,i)=>r-i),n=e.connections.reduce((r,i)=>r+j3(i.sourcePoint,e.direction),0)/e.connections.length,o=HP(e.direction)>0?t.at(-1):t[0];return Math.abs(o-n)/gZ(e)}function Kst(e){let t=vh(e.direction)?e.xCoordinates:e.yCoordinates,n=e.connections.reduce((r,i)=>r+j3(i.sourcePoint,e.direction),0)/e.connections.length,o=HP(e.direction)>0?Math.max(...t):Math.min(...t);return Math.abs(n-o)<0.000001}function aue(e,t){let n=[...e.connections].sort((o,r)=>cu(o.sourcePoint,e.direction)-cu(r.sourcePoint,e.direction)).findIndex((o)=>o.connectionIndex===t.connectionIndex);if(n<0)throw Error(`FanoutSolver: connection "${t.connection.name}" is missing from bus "${e.busId}"`);return n}function dYr(e,t){return{minX:Math.min(e.minX,t.minX),maxX:Math.max(e.maxX,t.maxX),minY:Math.min(e.minY,t.minY),maxY:Math.max(e.maxY,t.maxY)}}function Knt(e,t){return e.x>=t.minX-0.000001&&e.x<=t.maxX+0.000001&&e.y>=t.minY-0.000001&&e.y<=t.maxY+0.000001}function $nt(e,t,n,o,r){let i=t-e,s=Math.floor((i-o)/(n+o)+0.000000001);if(s<1)return[];let a=s*n+(s-1)*o,c=e+(i-a)/2+n/2;return Array.from({length:s},(l,h)=>({value:c+h*(n+o),kind:r}))}function uYr(e){let{bus:t,connection:n,preferredTrack:o,traceWidth:r,clearance:i}=e,s=(vh(t.direction)?t.yCoordinates:t.xCoordinates).toSorted((A,g)=>A-g),a=Math.max(...t.componentObstacles.map((A)=>vh(t.direction)?A.height/2:A.width/2)),c=vh(t.direction)?t.sharedBoundary.minY:t.sharedBoundary.minX,l=vh(t.direction)?t.sharedBoundary.maxY:t.sharedBoundary.maxX,h=l-c,d=c,u=l,_=[{value:o,kind:"preferred"},...$nt(d,s[0]-a,r,i,"margin")];for(let A=0;A<s.length;A++)if(_.push({value:s[A],kind:"corridor"}),A<s.length-1)_.push(...$nt(s[A]+a,s[A+1]-a,r,i,"gap"));_.push(...$nt(s.at(-1)+a,u,r,i,"margin"));let p=cu(n.sourcePoint,t.direction),m=(s[0]+s.at(-1))/2;return _.filter((A)=>Math.abs(A.value-p)<=h+0.000000001).filter((A,g,f)=>f.findIndex((y)=>Math.abs(y.value-A.value)<0.000000001)===g).sort((A,g)=>Math.abs(A.value-o)-Math.abs(g.value-o)-(Math.abs(A.value-m)-Math.abs(g.value-m))*0.001)}function pYr(e){let t=y6(e.bus)||_Z(e.bus)?cu(e.connection.sourcePoint,e.bus.direction):cu(e.connection.exitTargetPoint??e.connection.targetPoint,e.bus.direction),n=vh(e.bus.direction)?e.bus.sharedBoundary.minY:e.bus.sharedBoundary.minX,o=vh(e.bus.direction)?e.bus.sharedBoundary.maxY:e.bus.sharedBoundary.maxX;return Math.max(n+e.traceWidth/2,Math.min(o-e.traceWidth/2,t))}function mYr(e){let{bus:t,connection:n,targetUsesVia:o,interstitialEscape:r,compactBusTracks:i,traceWidth:s,viaDiameter:a,clearance:c}=e,l=(vh(t.direction)?t.yCoordinates:t.xCoordinates).toSorted((v,P)=>v-P),h=cu(n.sourcePoint,t.direction);if(i){let v=aue(t,n);return(l[0]+l.at(-1))/2+(v-(t.connections.length-1)/2)*(s+c)}if(!o||!r)return h;let d=hYr(t),u=s+c,_=Math.ceil(t.connections.length/2),p=(_-1)*u,m=a/2+s/2+c+0.001,A=Math.round(d)+1,g=A*m+(A-1)*p,f=aue(t,n),y=l[0],x=l.at(-1),C=f<_?y-g-(_-f-1)*u:x+g+(f-_)*u,b=vh(t.direction)?t.sharedBoundary.minY:t.sharedBoundary.minX,I=vh(t.direction)?t.sharedBoundary.maxY:t.sharedBoundary.maxX;return Math.max(b+s/2,Math.min(I-s/2,C))}function cCn(e){let t=HP(e.direction),n=[...e.connections].sort((i,s)=>{let a=t*(j3(s.sourcePoint,e.direction)-j3(i.sourcePoint,e.direction));if(Math.abs(a)>0.000001)return a;return cu(i.sourcePoint,e.direction)-cu(s.sourcePoint,e.direction)}),o=[...e.connections].sort((i,s)=>cu(i.sourcePoint,e.direction)-cu(s.sourcePoint,e.direction)||t*(j3(s.sourcePoint,e.direction)-j3(i.sourcePoint,e.direction))),r=[n,[...n].reverse(),o,[...o].reverse()];for(let i=1;i<Math.min(n.length,8);i++)r.push([...n.slice(i),...n.slice(0,i)]);return r}function bfn(e,t,n,o,r){if(Ut(t,n)<0.000000001)return;e.push({start:t,end:n,width:o,layer:r})}function qnt(e,t){if(e.length<3)return e;let n=[e[0]];for(let o=1;o<e.length-1;o++){let r=e[o-1],i=e[o],s=e[o+1],a=Ut(r,i),c=Ut(i,s);if(a<0.000000001||c<0.000000001)continue;let l={x:(i.x-r.x)/a,y:(i.y-r.y)/a},h={x:(s.x-i.x)/c,y:(s.y-i.y)/c},d=l.x*h.x+l.y*h.y;if(Math.abs(d)>0.000001){n.push(i);continue}let u=Math.min(t,a/2,c/2);n.push({x:i.x-l.x*u,y:i.y-l.y*u}),n.push({x:i.x+h.x*u,y:i.y+h.y*u})}return n.push(e.at(-1)),n}function Hve(e){let{preparedConnection:t,bus:n,targetLayer:o,traceWidth:r,viaDiameter:i,clearance:s,viaHandedness:a}=e,c={x:t.sourcePoint.x,y:t.sourcePoint.y},l=o!==t.sourceLayer,h=gZ(n),d=aCn(n),u=vh(n.direction)?t.sourceObstacle.width:t.sourceObstacle.height,_=l&&!Kst(n)?u>=h?u/2+i/2+s+0.001:h*0.5:!l?u/2+r/2+s+0.001:Math.max(h*0.5,u/2+(l?i:r)/2+s+0.001),p=j3(c,n.direction)+HP(n.direction)*_,m=cu(c,n.direction)+a*d*0.5;return cf(p,m,n.direction)}function cve(e){let{preparedConnection:t,bus:n,targetLayer:o,track:r,exitAxis:i,layerNames:s,traceWidth:a,viaDiameter:c,viaHoleDiameter:l,viaHandedness:h,interstitialEscape:d,spreadLaneIndex:u,cornerExitLaneOffset:_,cornerLocalChannelLaneOffset:p,cornerBoundaryChannelLaneOffset:m,clearance:A,terminateAtVia:g,allowBlindAndBuriedVias:f,initialViaPoint:y,sourceEscapePath:x,cornerBandTargetTrackOffset:C,fixedBoundaryTracksByConnectionIndex:b}=e,I=b?.get(t.connectionIndex),v=y6(n),P=n.exitEdge?BP(n.exitEdge):n.direction,M=I!==void 0&&!v&&n.direction===P?I:r,B={x:t.sourcePoint.x,y:t.sourcePoint.y},T=o,N=_Z(n)?lYr({bus:n,escapeLayer:T}):void 0,D=Boolean(N),L=HP(n.direction),H=gZ(n),V=x?.at(-1),O=V!==void 0?{x:V.x,y:V.y}:y===void 0?Hve({preparedConnection:t,bus:n,targetLayer:o,traceWidth:a,viaDiameter:c,clearance:A,viaHandedness:h}):{x:y.x,y:y.y},U=x?x.map((Nt)=>({x:Nt.x,y:Nt.y})):[B,O];if(U.length<2||Ut(U[0],B)>0.000000001||Ut(U.at(-1),O)>0.000000001)throw Error(`FanoutSolver: source escape path for "${t.connection.name}" must run from its source point to its via`);let j=j3(O,n.direction),Y=cu(O,n.direction),X=c/2+a/2+A+0.001+u*(a+A),K=d&&H>=X+c/2+A,J=K?cf(j+L*X,Y,n.direction):O,ee=K?j3(J,n.direction):j+L*Math.abs(M-Y),se=cf(ee,M,n.direction),ne=HP(P),re=bP(n,P),Z=I??(v&&n.exitEdge?Tv({bus:n,connection:t,cornerExitLaneOffset:_,traceWidth:a,viaDiameter:c,clearance:A,layerNames:s,targetLayer:o,cornerBandTargetTrackOffset:C}):D?iG({bus:n,connection:t,boundaryDirection:P,traceWidth:a,clearance:A,layerNames:s,targetLayer:o}):M),te=aue(n,t),le=cYr(n)==="maximum"?p+te:p+n.connections.length-1-te,ue=m+te,de=Math.max(n.connections.length,n.cornerBandConnectionCount??n.connections.length),me=ne>0?ue:de-1-ue,Ae=D?c/2+a/2+A:a+A,xe=(Nt)=>c/2+a/2+A+Nt*Ae,Me=bP(n,n.direction)-L*xe(le),Re=re-ne*xe(me),we=cf(Me,M,n.direction),_e=cf(Re,Me,P),ye=cf(Re,Z,P),Se=vh(n.direction)!==vh(P)?_e:cf(Re,M,P),Ne=g?O:v||D||I!==void 0?cf(re,Z,P):cf(i,M,n.direction),ke=[],nt=[];nt.push({route_type:"wire",x:B.x,y:B.y,width:a,layer:t.sourceLayer,start_pcb_port_id:t.sourcePoint.pcb_port_id});for(let Nt=1;Nt<U.length;Nt++){let Ht=U[Nt-1],Tt=U[Nt];if(bfn(ke,Ht,Tt,a,t.sourceLayer),Ut(Ht,Tt)<=0.000000001)continue;nt.push({route_type:"wire",x:Tt.x,y:Tt.y,width:a,layer:t.sourceLayer})}let dt=ke.length,rt;if(o!==t.sourceLayer){let Nt=G5({fromLayer:t.sourceLayer,toLayer:o,layerNames:s,allowBlindAndBuriedVias:f});rt={center:O,diameter:c,holeDiameter:l,fromLayer:t.sourceLayer,toLayer:o,spanLayers:Nt},nt.push({route_type:"via",x:O.x,y:O.y,from_layer:t.sourceLayer,to_layer:o,via_diameter:c,via_hole_diameter:l}),nt.push({route_type:"wire",x:O.x,y:O.y,width:a,layer:o})}let mt=(Nt,Ht)=>{for(let Tt=1;Tt<Nt.length;Tt++){let et=Nt[Tt-1],vt=Nt[Tt];bfn(ke,et,vt,a,Ht),nt.push({route_type:"wire",x:vt.x,y:vt.y,width:a,layer:Ht})}},lt=[];if(D&&N){let Nt=qnt([O,...K?[J]:[],se,...vh(n.direction)!==vh(P)?[we]:[],Se],Math.max(a+A,a*2));mt(Nt,T);let Ht=(Tt,et,vt)=>{if(et===vt)return;lt.push({center:Tt,diameter:c,holeDiameter:l,fromLayer:et,toLayer:vt,spanLayers:G5({fromLayer:et,toLayer:vt,layerNames:s,allowBlindAndBuriedVias:f})}),nt.push({route_type:"via",x:Tt.x,y:Tt.y,from_layer:et,to_layer:vt,via_diameter:c,via_hole_diameter:l}),nt.push({route_type:"wire",x:Tt.x,y:Tt.y,width:a,layer:vt})};Ht(Se,T,N),mt([Se,ye],N),Ht(ye,N,T),mt([ye,Ne],T)}else{let Nt=g?[O]:v?qnt([O,...K?[J]:[],se,we,...vh(n.direction)!==vh(P)?[_e]:[],ye,Ne],Math.max(a+A,a*2)):K?qnt([O,J,se,Ne],Math.max(a+A,a*2)):[O,se,Ne];mt(Nt,T)}let Ct=PG({connectionName:t.connection.name,sourcePointIndex:t.sourcePointIndex});return{busId:n.busId,connectionName:t.connection.name,connectionIndex:t.connectionIndex,sourcePointIndex:t.sourcePointIndex,sourcePoint:t.sourcePoint,sourceObstacle:t.sourceObstacle,sourceLayer:t.sourceLayer,targetPoint:t.targetPoint,targetLayer:o,termination:n.termination,direction:n.direction,...n.exitEdge?{exitEdge:n.exitEdge}:{},...v?{cornerBandSide:v}:{},exitPoint:Ne,trace:{type:"pcb_trace",pcb_trace_id:Ct.traceId,connection_name:t.connection.name,connectsTo:[...t.sourcePoint.pointId?[t.sourcePoint.pointId]:[],...t.sourcePoint.pcb_port_id?[t.sourcePoint.pcb_port_id]:[],Ct.boundaryExitPointId],route:nt},segments:ke,...dt>1?{sourceEscapeSegmentCount:dt}:{},via:rt,...lt.length>0?{additionalVias:lt}:{},length:ke.reduce((Nt,Ht)=>Nt+Ut(Ht.start,Ht.end),0)}}function $st(e){let t="layer"in e?e.layer:e.layers[0];if(!t)throw Error("FanoutSolver: plane endpoint has no copper layer");return t}function Jnt(e){let{preparedConnection:t,bus:n,viaDiameter:o,clearance:r}=e,{sourcePoint:i,targetPoint:s}=t,a=Math.max(n.pitchX,n.pitchY)*0.5;if(Ut(i,s)<=0.000001||Ut(i,s)>a)return[];let c=(()=>{switch(n.direction){case"left":return{x:-1,y:0};case"right":return{x:1,y:0};case"up":return{x:0,y:1};case"down":return{x:0,y:-1}}})(),l=Math.SQRT1_2,h=[c,...[{x:l,y:l},{x:l,y:-l},{x:-l,y:l},{x:-l,y:-l},{x:1,y:0},{x:-1,y:0},{x:0,y:1},{x:0,y:-1}].toSorted((p,m)=>m.x*c.x+m.y*c.y-(p.x*c.x+p.y*c.y))],d=Math.max(o,o/2+r),u=[d,Math.max(d,Math.min(n.pitchX,n.pitchY)*0.5),Math.max(d,Math.min(n.pitchX,n.pitchY)*0.625),Math.max(d,Math.min(n.pitchX,n.pitchY)*0.75)],_=[];for(let p of[i,s])for(let m of u)for(let A of h){let g={x:p.x+A.x*m,y:p.y+A.y*m};if(Ut(g,i)<=0.000001||Ut(g,s)<=0.000001||_.some((f)=>Ut(f,g)<=0.000001))continue;_.push(g)}return _}function Znt(e){let{plan:t,preparedConnection:n,planeLayer:o,viaPoint:r,layerNames:i,traceWidth:s,viaDiameter:a,viaHoleDiameter:c,allowBlindAndBuriedVias:l}=e,h={x:n.targetPoint.x,y:n.targetPoint.y},d=$st(n.targetPoint),u=G5({fromLayer:o,toLayer:d,layerNames:i,allowBlindAndBuriedVias:l});if(!u.includes(o))throw Error(`FanoutSolver: via for "${n.connection.name}" does not cross plane ${o}`);let _=[{start:r,end:h,width:s,layer:d}],p={center:r,diameter:a,holeDiameter:c,fromLayer:o,toLayer:d,spanLayers:u},m=PG({connectionName:n.connection.name,sourcePointIndex:n.sourcePointIndex}),A={type:"pcb_trace",pcb_trace_id:m.planeEndpointTraceId,connection_name:n.connection.name,connectsTo:[...n.targetPoint.pointId?[n.targetPoint.pointId]:[],...n.targetPoint.pcb_port_id?[n.targetPoint.pcb_port_id]:[],m.planeEndpointPointId],route:[{route_type:"wire",...r,width:s,layer:o},{route_type:"via",...r,from_layer:o,to_layer:d,via_diameter:a,via_hole_diameter:c},{route_type:"wire",...r,width:s,layer:d},{route_type:"wire",...h,width:s,layer:d}]};return{...t,planeEndpointTrace:A,planeEndpointSegments:_,planeEndpointVia:p,length:t.length+_.reduce((g,f)=>g+Ut(f.start,f.end),0)}}function _Yr(e){let{segment:t,plan:n,segmentIndex:o,srj:r,allowSameNetMerges:i,obstacles:s,clearance:a}=e;for(let c of s){if(!c.layers.includes(t.layer))continue;if(c.connectedTo.includes(n.connectionName))continue;if(i&&P6(r,c,n.connectionName))continue;if(que({inputSrj:r,segment:t,bodyObstacle:c,connectionName:n.connectionName}))continue;if(o>=0&&o<(n.sourceEscapeSegmentCount??1)&&c===n.sourceObstacle&&t.layer===n.sourceLayer)continue;if(Wl(t,c)<t.width/2+a-0.000000001)return!1}return!0}function iT(e){return e.planeEndpointSegments?.length?[...e.segments,...e.planeEndpointSegments]:e.segments}function AZ(e){return[e.via,...e.additionalVias??[],e.planeEndpointVia].filter((t)=>Boolean(t))}function gYr(e,t){return Ut(t.center,e.sourcePoint)<=0.000000001&&k8e({center:t.center,diameter:t.diameter,obstacle:e.sourceObstacle})}function qst(e){let{plan:t,srj:n,sharedBoundary:o,clearance:r,allowBlindAndBuriedVias:i,allowSameNetMerges:s}=e,a=dYr(n.bounds,o);if(!Knt(t.exitPoint,a)||iT(t).some((h)=>!Knt(h.start,a)||!Knt(h.end,a)))return!1;let c=iT(t),l;if(e.segmentCache){let h=e.segmentCache.byConnection.get(t.connectionName);if(!h)h=new WeakMap,e.segmentCache.byConnection.set(t.connectionName,h);if(l=h.get(t.sourceObstacle),!l)l=[new WeakMap,new WeakMap],h.set(t.sourceObstacle,l)}for(let h=0;h<c.length;h++){let d=c[h],u=h<t.segments.length?h:-1,_=u>=0&&u<(t.sourceEscapeSegmentCount??1)&&d.layer===t.sourceLayer,p=l?.[_?1:0],m=p?.get(d);if(m===void 0)m=_Yr({segment:d,plan:t,segmentIndex:u,srj:n,allowSameNetMerges:s,obstacles:e.segmentCache?e.segmentCache.obstaclesByLayer.get(d.layer)??[]:n.obstacles,clearance:r}),p?.set(d,m);if(!m)return!1}for(let h of AZ(t))for(let d of n.obstacles){if(jst(n)&&d===t.sourceObstacle&&gYr(t,h))continue;if(!d.layers.some((u)=>h.spanLayers.includes(u)))continue;if(s&&P6(n,d,t.connectionName))continue;if(X5(h.center,d)<h.diameter/2+r-0.000000001)return!1}for(let h of WP(n,i)){if(t.connectionName===h.connectionName||s&&Y5(n,t.connectionName,h.connectionName))continue;for(let d of iT(t)){for(let u of h.segments)if(!V_(d,u,r))return!1;for(let u of h.vias)if(u.spanLayers.includes(d.layer)&&Vr(u.center,d.start,d.end)<u.diameter/2+d.width/2+r-0.000000001)return!1}for(let d of AZ(t)){for(let u of h.segments)if(d.spanLayers.includes(u.layer)&&Vr(d.center,u.start,u.end)<d.diameter/2+u.width/2+r-0.000000001)return!1;for(let u of h.vias)if(d.spanLayers.some((_)=>u.spanLayers.includes(_))&&Ut(d.center,u.center)<(d.diameter+u.diameter)/2+r-0.000000001)return!1}}return!0}function H8e(e){let{plan:t,otherPlans:n,srj:o,allowSameNetMerges:r,clearance:i,blockingBusCounts:s,segmentIndexes:a}=e,c=iT(t),l=AZ(t);for(let h of n){if(r&&Y5(o,t.connectionName,h.connectionName))continue;if(t.sourcePoint.pcb_port_id&&t.sourcePoint.pcb_port_id===h.sourcePoint.pcb_port_id||t.sourcePoint.pointId&&t.sourcePoint.pointId===h.sourcePoint.pointId)continue;let u=()=>{if(h.busId===t.busId)return;s?.set(h.busId,(s.get(h.busId)??0)+1)},_=iT(h),p=AZ(h),m=a?.get(h);if(a&&!m)m=new Jue(_),a.set(h,m);for(let A of c){for(let g of m?.querySegment(A,i)??_)if(!V_(A,g,i))return u(),!1;for(let g of p)if(g.spanLayers.includes(A.layer)&&Vr(g.center,A.start,A.end)<g.diameter/2+A.width/2+i-0.000000001)return u(),!1}for(let A of l){for(let g of m?.queryVia(A,i)??_)if(A.spanLayers.includes(g.layer)&&Vr(A.center,g.start,g.end)<A.diameter/2+g.width/2+i-0.000000001)return u(),!1;for(let g of p)if(A.spanLayers.some((f)=>g.spanLayers.includes(f))&&Ut(A.center,g.center)<(A.diameter+g.diameter)/2+i-0.000000001)return u(),!1}}return!0}function Ifn(e){let{plans:t,srj:n,clearance:o,allowSameNetMerges:r=!1}=e;return t.every((i,s)=>H8e({plan:i,otherPlans:t.filter((a,c)=>c!==s),srj:n,allowSameNetMerges:r,clearance:o}))}function lve(e){let{plan:t,otherPlans:n,staticClearanceCache:o,blockingBusCounts:r,cacheKey:i,srj:s,sharedBoundary:a,clearance:c,allowBlindAndBuriedVias:l,allowSameNetMerges:h}=e,d=o?.get(i);if(d===void 0)d=qst({plan:t,srj:s,sharedBoundary:a,clearance:c,allowBlindAndBuriedVias:l,allowSameNetMerges:h}),o?.set(i,d);return d&&H8e({plan:t,otherPlans:n,srj:s,allowSameNetMerges:h,clearance:c,blockingBusCounts:r})}function wp(e){let{plans:t,srj:n,sharedBoundary:o,clearance:r,allowBlindAndBuriedVias:i=!0,allowSameNetMerges:s=!1,allowSameNetPlaneMerges:a=!1}=e;for(let c=0;c<t.length;c++){let l=t[c];if(!qst({plan:l,srj:n,sharedBoundary:o,clearance:r,allowBlindAndBuriedVias:i,allowSameNetMerges:s||a&&l.termination.type==="plane"}))return!1;let h=t.filter((d,u)=>u!==c&&!(a&&l.termination.type==="plane"&&d.termination.type==="plane"&&Y5(n,l.connectionName,d.connectionName)));if(!H8e({plan:l,otherPlans:h,srj:n,allowSameNetMerges:s,clearance:r}))return!1}return!0}function F8e(e){let{srj:t,sharedBoundary:n,clearance:o,allowBlindAndBuriedVias:r=!0,allowSameNetMerges:i=!1,allowSameNetPlaneMerges:s=!1}=e,a={obstaclesByLayer:new Map,byConnection:new Map};for(let A of t.obstacles)for(let g of A.layers){let f=a.obstaclesByLayer.get(g)??[];f.push(A),a.obstaclesByLayer.set(g,f)}let c=s&&!i?{obstaclesByLayer:a.obstaclesByLayer,byConnection:new Map}:a,l=new WeakMap,h=new WeakMap,d=new WeakMap,u=new Set,_=(A)=>{let g=h.get(A);if(g===void 0)g=qst({segmentCache:A.termination.type==="plane"?c:a,plan:A,srj:t,sharedBoundary:n,clearance:o,allowBlindAndBuriedVias:r,allowSameNetMerges:i||s&&A.termination.type==="plane"}),h.set(A,g);return g},p=(A,g)=>{let f=d.get(A);if(!f)f=new WeakMap,d.set(A,f);let y=f.get(g);if(y===void 0){let x=iT(A).length>iT(g).length;y=H8e({plan:x?g:A,otherPlans:[x?A:g],segmentIndexes:l,srj:t,clearance:o,allowSameNetMerges:i||s&&A.termination.type==="plane"&&g.termination.type==="plane"}),f.set(g,y);let C=d.get(g);if(!C)C=new WeakMap,d.set(g,C);C.set(A,y)}return y};return Object.assign((A)=>{let g=new Set(A);if(g.size===A.length){let f=A.filter((y)=>!u.has(y));for(let y of A){let x=u.has(y);if(!x&&!_(y))return!1;for(let C of x?f:A){if(y===C)continue;if(!p(y,C))return!1}}}else for(let[f,y]of A.entries()){if(!_(y))return!1;for(let[x,C]of A.entries())if(x!==f&&!p(y,C))return!1}return u=g,!0},{mutuallyClear:(A)=>A.every((g,f)=>A.every((y,x)=>x===f?!0:p(g,y)))})}function vfn(e){let{srj:t,bus:n,targetLayer:o,acceptedPlans:r,layerNames:i,traceWidth:s,viaDiameter:a,viaHoleDiameter:c,clearance:l,staticClearanceCache:h,blockingBusCounts:d,allowBlindAndBuriedVias:u=!0,allowSameNetMerges:_=!1,fixedViaPointsByConnectionIndex:p,planeCandidateSkipCount:m=0}=e,A=n.connections[0]?.sourceObstacle;if(!A||n.termination.type!=="plane")return null;let g=n.connections[0].sourceLayer;if(o===g)return null;let f=m,y=(b,I)=>{for(let[v,P]of b.entries()){if(!I(P,v))continue;if(f>0){f--;continue}if(e.collectAlternative&&!e.collectAlternative(P))continue;return P}return};if(p){let b=[];for(let I of n.connections){let v=p.get(I.connectionIndex);if(!v)return null;let P={x:I.sourcePoint.x,y:I.sourcePoint.y},M=cve({preparedConnection:I,bus:n,targetLayer:o,track:cu(P,n.direction),exitAxis:bP(n),layerNames:i,traceWidth:s,viaDiameter:a,viaHoleDiameter:c,viaHandedness:0,interstitialEscape:!1,spreadLaneIndex:0,cornerExitLaneOffset:0,cornerLocalChannelLaneOffset:0,cornerBoundaryChannelLaneOffset:0,clearance:l,terminateAtVia:!0,allowBlindAndBuriedVias:u,initialViaPoint:v,sourceEscapePath:e.sourceEscapePaths?.get(I.connectionIndex)?[...e.sourceEscapePaths.get(I.connectionIndex)]:[P,v]}),T=[...Jnt({preparedConnection:I,bus:n,viaDiameter:a,clearance:l}).map((D)=>Znt({plan:M,preparedConnection:I,planeLayer:o,viaPoint:D,layerNames:i,traceWidth:s,viaDiameter:a,viaHoleDiameter:c,allowBlindAndBuriedVias:u})),M],N=y(T,(D,L)=>lve({plan:D,otherPlans:[...r,...b],staticClearanceCache:h,blockingBusCounts:d,cacheKey:`plane-fixed:${n.busId}:${o}:${I.connectionIndex}:${v.x}:${v.y}:${L}`,srj:t,sharedBoundary:n.sharedBoundary,clearance:l,allowBlindAndBuriedVias:u,allowSameNetMerges:_}));if(!N)return null;b.push(N)}return b}if(jst(t)&&n.connections.length===1&&k8e({center:n.connections[0].sourcePoint,diameter:a,obstacle:A})){let b=n.connections[0],I=cve({preparedConnection:b,bus:n,targetLayer:o,track:cu(b.sourcePoint,n.direction),exitAxis:bP(n),layerNames:i,traceWidth:s,viaDiameter:a,viaHoleDiameter:c,viaHandedness:0,interstitialEscape:!1,spreadLaneIndex:0,cornerExitLaneOffset:0,cornerLocalChannelLaneOffset:0,cornerBoundaryChannelLaneOffset:0,clearance:l,terminateAtVia:!0,allowBlindAndBuriedVias:u,initialViaPoint:b.sourcePoint}),P=[...Jnt({preparedConnection:b,bus:n,viaDiameter:a,clearance:l}).map((B)=>Znt({plan:I,preparedConnection:b,planeLayer:o,viaPoint:B,layerNames:i,traceWidth:s,viaDiameter:a,viaHoleDiameter:c,allowBlindAndBuriedVias:u})),I],M=y(P,(B,T)=>lve({plan:B,otherPlans:r,staticClearanceCache:h,blockingBusCounts:d,cacheKey:`plane-via-in-pad:${n.busId}:${o}:${T}`,srj:t,sharedBoundary:n.sharedBoundary,clearance:l,allowBlindAndBuriedVias:u,allowSameNetMerges:_}));if(M)return[M]}let x=[n.direction,...["left","right","up","down"].filter((b)=>b!==n.direction)],C=[...x.map((b)=>({direction:b,centeredOutward:!1})),...x.map((b)=>({direction:b,centeredOutward:!0}))];for(let{direction:b,centeredOutward:I}of C){let v=b===n.direction?n:{...n,direction:b},P=vh(b)?A.width:A.height,M=gZ(v)/2-P/2>=a/2+l-0.000000001,B=I?!M&&Kst(v)?[0]:[]:M?[0]:[1,-1];for(let T of B)for(let N of cCn(v)){let D=[],L=!0;for(let H of N){let V=cu(H.sourcePoint,b),O=Hve({preparedConnection:H,bus:v,targetLayer:o,traceWidth:s,viaDiameter:a,clearance:l,viaHandedness:T}),U=gZ(v),j=HP(b),Y=bP(v,b),X=j*(Y-j3(O,b))-(a/2+l),K=Math.max(0,Math.floor(X/U)),J={x:H.sourcePoint.x,y:H.sourcePoint.y},ee=j3(O,b),se=cu(O,b),ne=aCn(v),re=[],Z=128;for(let ie=0;ie<=K&&re.length<128;ie++){let le=cf(ee+j*ie*U,se,b);if(ie===0)re.push([J,O]);else{for(let ue of Cfn(J,le))if(re.push(ue),re.length>=128)break;if(re.length<128)re.push([J,O,le])}for(let ue=1;ue<=Math.min(3,ie-1)&&re.length<128;ue++){let de=ie-ue;if(de<1||de>K)continue;for(let me of[-1,1]){let Ae=se+me*ue*ne,xe=cf(ee,Ae,b),Me=cf(ee+j*de*U,se,b),Re=cf(ee+j*de*U,Ae,b),we=Math.min(U,ne)*0.2;for(let _e of Cfn(J,Re))if(re.push(_e),re.length>=128)break;if(re.length>=128)break;if(re.push(xfn([J,O,xe,Re],we),xfn([J,O,Me,Re],we)),re.length>=128)break}}}let te;for(let[ie,le]of re.entries()){let ue=cve({preparedConnection:H,bus:v,targetLayer:o,track:V,exitAxis:bP(v),layerNames:i,traceWidth:s,viaDiameter:a,viaHoleDiameter:c,viaHandedness:T,interstitialEscape:!M,spreadLaneIndex:0,cornerExitLaneOffset:0,cornerLocalChannelLaneOffset:0,cornerBoundaryChannelLaneOffset:0,clearance:l,terminateAtVia:!0,allowBlindAndBuriedVias:u,sourceEscapePath:le}),me=[...Jnt({preparedConnection:H,bus:v,viaDiameter:a,clearance:l}).map((Ae)=>Znt({plan:ue,preparedConnection:H,planeLayer:o,viaPoint:Ae,layerNames:i,traceWidth:s,viaDiameter:a,viaHoleDiameter:c,allowBlindAndBuriedVias:u})),ue];if(te=y(me,(Ae,xe)=>lve({plan:Ae,otherPlans:[...r,...D],staticClearanceCache:h,blockingBusCounts:d,cacheKey:`plane:${n.busId}:${o}:${b}:${H.connectionIndex}:${T}:${ie}:${xe}`,srj:t,sharedBoundary:n.sharedBoundary,clearance:l,allowBlindAndBuriedVias:u,allowSameNetMerges:_})),te)break}if(!te){L=!1;break}D.push(te)}if(L)return D}}return null}function*z8e(e,t=1,n=!1){let{srj:o,bus:r,targetLayer:i,acceptedPlans:s,layerNames:a,traceWidth:c,viaDiameter:l,viaHoleDiameter:h,clearance:d,compactBusTracks:u,staticClearanceCache:_,blockingBusCounts:p,allowBlindAndBuriedVias:m=!0,allowSameNetMerges:A=!1,rejectedViaMinimalCandidates:g,stopAfterFirstRejectedViaMinimalCandidate:f=!1,fixedViaPointsByConnectionIndex:y,fixedBoundaryTracksByConnectionIndex:x,reservedVias:C=[],softReservedVias:b=[],viaMinimalOnly:I=!1,allowBoundarySideViaFallback:v=!1,preferCornerBoundaryVia:P=!1,adaptiveWindingRouteOrder:M=!1,alignWindingGridToPads:B=!1,fixedViaFallbackRouteOrderAttempts:T=24,allowFixedViaReservedExitFallback:N=!1,cornerBandTargetTrackOffset:D,cornerExitLaneOffset:L,forbidEarlyExitBoundaryContact:H=!1}=e;if(!Number.isInteger(t)||t<1)throw Error(`FanoutSolver: maxAlternatives must be a positive integer, received ${t}`);if(L!==void 0&&(!Number.isSafeInteger(L)||L<0))throw Error(`FanoutSolver: cornerExitLaneOffset must be a non-negative safe integer, received ${L}`);if(y&&r.connections.some((le)=>!y.has(le.connectionIndex)))return[];if(r.termination.type==="plane"){let le=[];if(r.connections.length===1&&t>1)return vfn({...e,planeCandidateSkipCount:0,collectAlternative:(ue)=>(le.push([ue]),le.length>=t)}),le;for(let ue=0;ue<t;ue++){let de=vfn({...e,planeCandidateSkipCount:ue});if(!de)break;le.push(de)}return le}if(x){if(!r.exitEdge)throw Error("FanoutSolver: fixed boundary tracks require an exit edge");let le=r.exitEdge==="left"||r.exitEdge==="right",ue=le?r.sharedBoundary.minY:r.sharedBoundary.minX,de=le?r.sharedBoundary.maxY:r.sharedBoundary.maxX;for(let me of r.connections){let Ae=x.get(me.connectionIndex);if(Ae===void 0||!Number.isFinite(Ae)||Ae<ue-0.000000001||Ae>de+0.000000001)throw Error(`FanoutSolver: invalid fixed boundary track for ${me.connection.name}`)}}let V=bP(r),O=r.connections[0]?.sourceObstacle;if(!O)return[[]];let U=vh(r.direction)?O.width:O.height,j=r.connections[0].sourceLayer,Y=i!==j,X=Kst(r),K=gZ(r)/2-U/2>=l/2+d-0.000000001,J=Y&&!X&&!K,ee=Y?K||X?[0]:m?[1,-1]:[-1,1]:[0],se=(()=>{if(m)return ee;if(ee.length!==2||!ee.includes(-1)||!ee.includes(1))return ee;let le=r.connections.reduce((de,me)=>de+cu(me.sourcePoint,r.direction),0)/r.connections.length,ue=r.connections.reduce((de,me)=>de+cu(me.exitTargetPoint??me.targetPoint,r.direction),0)/r.connections.length;if(ue>le+0.000000001)return[-1,1];if(ue<le-0.000000001)return[1,-1];return ee})(),ne=[],re=new Set,Z=yfn(r,s);if(L!==void 0)Z.exit=L;let te=(le)=>{if(x&&le.some((de)=>{let me=x.get(de.connectionIndex),Ae=r.exitEdge==="left"||r.exitEdge==="right"?de.exitPoint.y:de.exitPoint.x;return Math.abs(Ae-me)>0.000000001}))return;let ue=le.map((de)=>`${de.connectionIndex}:${de.targetLayer}:${de.exitPoint.x}:${de.exitPoint.y}:${de.segments.map((me)=>`${me.start.x},${me.start.y},${me.end.x},${me.end.y},${me.layer}`).join(";")}`).join("|");if(re.has(ue))return;re.add(ue),ne.push(le)};if(!_Z(r)&&r.exitEdge&&r.connections.length===1&&a.includes(i)&&(r.allowedLayers===void 0||r.allowedLayers.includes(i))&&(r.routableEscapeLayers===void 0||r.routableEscapeLayers.includes(i))&&r.connections[0].sourceLayer!==i&&y&&e.sourceEscapePaths?.has(r.connections[0].connectionIndex)){let le=r.connections[0],ue=BP(r.exitEdge),de=w1({srj:o,bus:r,targetLayer:i,terminals:[{connection:le,viaPoint:y.get(le.connectionIndex),exitPoint:cf(bP(r,ue),iG({fixedBoundaryTracksByConnectionIndex:x,bus:r,connection:le,boundaryDirection:ue}),ue)}],acceptedPlans:s,layerNames:a,traceWidth:c,viaDiameter:l,viaHoleDiameter:h,clearance:d,allowBlindAndBuriedVias:m,allowSameNetMerges:A,maximumRouteOrderAttempts:3,reservedVias:C,softReservedVias:b,gridStepDivisor:2,gridStep:e.windingGridStep,alignGridToPads:B,sourceEscapePaths:e.sourceEscapePaths,heuristicWeight:e.windingHeuristicWeight,forbidEarlyExitBoundaryContact:H},t,n),me=de.next();while(!me.done)yield{phase:"via-minimal-winding",busId:r.busId,targetLayer:i,winding:me.value},me=de.next();for(let Ae of me.value){if(!wp({plans:[...s,...Ae],srj:o,sharedBoundary:r.sharedBoundary,clearance:d,allowBlindAndBuriedVias:m,allowSameNetMerges:A}))continue;if(te(Ae),ne.length>=t)return ne}}if(_Z(r)&&r.exitEdge){let le=BP(r.exitEdge),ue=bP(r,le),de=y6(r),me=jst(o)&&r.connections.every((We)=>k8e({center:We.sourcePoint,diameter:l,obstacle:We.sourceObstacle})),Ae=24,xe=Boolean(de||Vrt({bus:r,boundaryDirection:le,traceWidth:c,clearance:d})),Me=iCn({bus:r,boundaryDirection:le,layerNames:a,targetLayer:i}),Re=Me.orders.length,we=xe?Me.ordinaryOrderCount:1,_e=se.map((We)=>({label:`uniform-${We}`,useViaInPad:!1,getViaHandedness:()=>We,maximumRouteOrderAttempts:m?void 0:24})),ye=r.connections.toSorted((We,Le)=>cu(We.sourcePoint,r.direction)-cu(Le.sourcePoint,r.direction)||j3(We.sourcePoint,r.direction)-j3(Le.sourcePoint,r.direction)||We.connectionIndex-Le.connectionIndex),Se=new Map(ye.map((We,Le)=>[We.connectionIndex,Le])),Ne=(We)=>We<ye.length/2?1:-1,ke=Math.floor(ye.length/2),nt=[0,1,ke,ke+1,...ye.map((We,Le)=>Le)].filter((We,Le,Ze)=>We>=0&&We<ye.length&&Ze.indexOf(We)===Le),dt=[[ke],[ke+1],[0],[1],[0,ke+1],[1,ke],[0,ke],[1,ke+1],[0,1],[ke,ke+1],...nt.map((We)=>[We])].map((We)=>We.filter((Le)=>Le>=0&&Le<ye.length).toSorted((Le,Ze)=>Le-Ze)).filter((We,Le,Ze)=>We.length>0&&Ze.findIndex(($e)=>$e.join(",")===We.join(","))===Le),rt=!m&&(C.length>0||s.some((We)=>We.termination.type==="plane"))&&se.includes(-1)&&se.includes(1)?[{label:"toward-source-median",useViaInPad:!1,maximumRouteOrderAttempts:24,getViaHandedness:(We)=>Ne(Se.get(We.connectionIndex)??0)},...dt.slice(0,12).map((We)=>({label:`toward-source-median-with-ranks-${We.join("-")}-flipped`,useViaInPad:!1,maximumRouteOrderAttempts:6,getViaHandedness:(Le)=>{let Ze=Se.get(Le.connectionIndex)??0,$e=Ne(Ze);return We.includes(Ze)?-$e:$e}})),{label:"alternating-source-grid-a",useViaInPad:!1,maximumRouteOrderAttempts:3,getViaHandedness:(We)=>(Se.get(We.connectionIndex)??0)%2===0?-1:1},{label:"alternating-source-grid-b",useViaInPad:!1,maximumRouteOrderAttempts:3,getViaHandedness:(We)=>(Se.get(We.connectionIndex)??0)%2===0?1:-1},{label:"away-from-source-median",useViaInPad:!1,maximumRouteOrderAttempts:24,getViaHandedness:(We)=>(Se.get(We.connectionIndex)??0)<ye.length/2?-1:1}]:[],mt={label:"via-in-pad",useViaInPad:!0,getViaHandedness:()=>0},lt=y??(!m&&(r.connections.length>=8||Vrt({bus:r,boundaryDirection:le,traceWidth:c,clearance:d}))&&C.length===0?I0([r],{viaDiameter:l,viaHoleDiameter:h,traceWidth:c,clearance:d,additionalObstacles:o.obstacles,blockingSegments:s.flatMap((We)=>iT(We).map((Le)=>({connectionIndex:We.connectionIndex,segment:Le}))),blockingVias:s.flatMap((We)=>AZ(We).map((Le)=>({connectionIndex:We.connectionIndex,...Le.center,center:Le.center,diameter:Le.diameter,spanLayers:Le.spanLayers})))}):null),Ct=lt?[...Array.from({length:we},(We,Le)=>({label:`component-matched-vias-winding-${Le}`,useViaInPad:!1,getViaHandedness:()=>0,getViaPoint:(Ze)=>lt.get(Ze.connectionIndex),maximumRouteOrderAttempts:1,windingOrderIndex:Le,preferTargetDirectedLaneBias:!0})),{label:"component-matched-vias-fallback",useViaInPad:!1,getViaHandedness:()=>0,getViaPoint:(We)=>lt.get(We.connectionIndex),maximumRouteOrderAttempts:T,windingOrderIndex:0,preferTargetDirectedLaneBias:!0},...!y6(r)&&Re>1?Array.from({length:Re},(We,Le)=>[!0,!1].map((Ze)=>({label:`expanded-winding-${Le}-${Ze}`,useViaInPad:!1,getViaHandedness:()=>0,getViaPoint:($e)=>lt.get($e.connectionIndex),maximumRouteOrderAttempts:1,windingOrderIndex:Le,preferTargetDirectedLaneBias:Ze,reserveTerminalExitPoints:!Ze,allowLayerInterleaving:!0}))).flat():[],...N&&y&&!y6(r)&&Re===1&&r.connections.length>2?[!0,!1].map((We)=>({label:`fixed-vias-reserved-exits-${We}`,useViaInPad:!1,getViaHandedness:()=>0,getViaPoint:(Le)=>lt.get(Le.connectionIndex),maximumRouteOrderAttempts:Math.min(24,T),windingOrderIndex:0,preferTargetDirectedLaneBias:We,reserveTerminalExitPoints:!0})):[]]:[],Nt=s.some((We)=>We.termination.type==="plane"),Tt=s.some((We)=>We.termination.type==="boundary")&&!m?[...rt,..._e]:[..._e,...rt],et=me?Nt?[mt,...Tt]:[...Tt,mt]:Tt,vt=y?Ct:[...Ct,...et];if(!y&&!m&&r.connections.length>1&&r.connections.every((We)=>We.sourceLayer!==i)&&se.includes(-1)&&se.includes(1)){let We=kVr(r.connections,r.direction);for(let Le of se)for(let Ze of We)vt.push({label:`local-dogbone-repair-${Le}-${Ze.join("-")}`,useViaInPad:!1,getViaHandedness:()=>Le,maximumRouteOrderAttempts:6,localDogboneRepair:!0,getViaPoint:($e)=>{let qe=Hve({preparedConnection:$e,bus:r,targetLayer:i,traceWidth:c,viaDiameter:l,clearance:d,viaHandedness:Le});if(!Ze.includes($e.connectionIndex))return qe;return r.direction==="up"||r.direction==="down"?{x:qe.x,y:2*$e.sourcePoint.y-qe.y}:{x:2*$e.sourcePoint.x-qe.x,y:qe.y}}})}if(B&&de&&L===void 0){let We=yfn(r,s.filter((Le)=>Le.targetLayer===i)).exit;if(We!==Z.exit)vt.push(...vt.map((Le)=>({...Le,label:`${Le.label}-layer-local-corner`,cornerExitLaneOffset:We})))}let ht=new Set;for(let We of vt){let Le=r.connections.map((Xe)=>{let it=We.getViaHandedness(Xe),St=de?Tv({fixedBoundaryTracksByConnectionIndex:x,bus:r,connection:Xe,cornerExitLaneOffset:We.cornerExitLaneOffset??Z.exit,traceWidth:c,viaDiameter:l,clearance:d,layerNames:a,targetLayer:i,windingOrderIndex:We.windingOrderIndex,cornerBandTargetTrackOffset:D}):iG({fixedBoundaryTracksByConnectionIndex:x,allowLayerInterleaving:We.allowLayerInterleaving,bus:r,connection:Xe,boundaryDirection:le,traceWidth:c,clearance:d,layerNames:a,targetLayer:i,windingOrderIndex:We.windingOrderIndex});return{connection:Xe,viaPoint:We.getViaPoint?We.getViaPoint(Xe):We.useViaInPad?{x:Xe.sourcePoint.x,y:Xe.sourcePoint.y}:Hve({preparedConnection:Xe,bus:r,targetLayer:i,traceWidth:c,viaDiameter:l,clearance:d,viaHandedness:it}),exitPoint:cf(ue,St,le)}}),Ze=B||Boolean(We.getViaPoint&&!y);if(We.localDogboneRepair&&!I0([r],{viaDiameter:l,viaHoleDiameter:h,traceWidth:c,clearance:d,additionalObstacles:o.obstacles,fixedViaPointsByConnectionIndex:new Map(Le.map((Xe)=>[Xe.connection.connectionIndex,Xe.viaPoint])),blockingSegments:s.flatMap((Xe)=>iT(Xe).map((it)=>({connectionIndex:Xe.connectionIndex,segment:it}))),blockingVias:[...s.flatMap((Xe)=>AZ(Xe).map((it)=>({connectionIndex:Xe.connectionIndex,center:it.center,diameter:it.diameter,spanLayers:it.spanLayers}))),...C.map(({via:Xe})=>({connectionIndex:-1,...Xe}))]}))continue;let $e=We.getViaPoint&&Math.min(r.pitchX,r.pitchY)-2*(l/2+c/2+d)<c+d?2:1,qe=`${Le.map((Xe)=>`${Xe.connection.connectionIndex}:${Xe.viaPoint.x}:${Xe.viaPoint.y}:${Xe.exitPoint.x}:${Xe.exitPoint.y}`).join("|")}:${We.maximumRouteOrderAttempts??"all"}:${$e}:${Ze}:${Boolean(We.localDogboneRepair)}:${Boolean(We.preferTargetDirectedLaneBias)}:${Boolean(We.reserveTerminalExitPoints)}`;if(ht.has(qe))continue;ht.add(qe);let ft=w1({heuristicWeight:e.windingHeuristicWeight,srj:o,bus:r,targetLayer:i,terminals:Le,acceptedPlans:s,layerNames:a,traceWidth:c,viaDiameter:l,viaHoleDiameter:h,clearance:d,allowBlindAndBuriedVias:m,allowSameNetMerges:A,maximumRouteOrderAttempts:We.maximumRouteOrderAttempts,adaptiveRouteOrder:M,alignGridToPads:Ze,includeReverseTargetRotation:We.localDogboneRepair,reservedVias:C,softReservedVias:b,reserveTerminalExitPoints:We.reserveTerminalExitPoints,gridStepDivisor:$e,gridStep:e.windingGridStep,sourceEscapePaths:e.sourceEscapePaths,preferTargetDirectedLaneBias:We.preferTargetDirectedLaneBias,forbidEarlyExitBoundaryContact:H},y&&I?Math.min(2,Math.max(1,t-ne.length)):We.maximumRouteOrderAttempts===void 0?Math.min(2,t-ne.length):2,n),It=ft.next();while(!It.done)yield{phase:"via-minimal-winding",busId:r.busId,targetLayer:i,winding:It.value},It=ft.next();let ze=It.value;for(let Xe of ze){if(!wp({plans:[...s,...Xe],srj:o,sharedBoundary:r.sharedBoundary,clearance:d,allowBlindAndBuriedVias:m,allowSameNetMerges:A})){if(wp({plans:Xe,srj:o,sharedBoundary:r.sharedBoundary,clearance:d,allowBlindAndBuriedVias:m,allowSameNetMerges:A})&&g){if(g.push(Xe),f)return ne}continue}if(te(Xe),ne.length>=t)return ne}}}if(ne.length===0&&v&&y&&r.connections.length<=2&&r.exitEdge&&r.connections.every((le)=>le.sourceLayer===r.connections[0].sourceLayer&&le.sourceLayer!==i)){let le=r.connections[0].sourceLayer,ue=BP(r.exitEdge),de=bP(r,ue),me=r.connections.map((rt)=>P&&y6(r)?Tv({fixedBoundaryTracksByConnectionIndex:x,bus:r,connection:rt,cornerExitLaneOffset:Z.exit,traceWidth:c,viaDiameter:l,clearance:d,layerNames:a,targetLayer:i,cornerBandTargetTrackOffset:D}):iG({fixedBoundaryTracksByConnectionIndex:x,bus:r,connection:rt,boundaryDirection:ue,traceWidth:c,clearance:d,layerNames:a,targetLayer:i})),Ae=me.map((rt)=>cf(de,rt,ue)),xe={...o,obstacles:o.obstacles.map((rt)=>{let mt=r.connections.find((lt)=>rt===lt.sourceObstacle||Ut(rt.center,lt.sourcePoint)<=0.0000001&&rt.layers.includes(lt.sourceLayer));return mt?{...rt,connectedTo:[...rt.connectedTo,mt.connection.name]}:rt})},Me=Math.max(l/2+d,Math.min(r.pitchX,r.pitchY)/2),Re=P?y6(r):void 0,we=[1,2,3,4,5].flatMap((rt)=>{let mt=rt*Me,lt=me.map((Ct)=>cf(de-HP(ue)*mt,Ct,ue));if(!Re)return[lt];return[me.map((Ct)=>cf(de-HP(ue)*mt,Ct+(Re==="maximum"?mt:-mt),ue)),lt]}),_e={x:r.connections.reduce((rt,mt)=>rt+mt.sourcePoint.x,0)/r.connections.length,y:r.connections.reduce((rt,mt)=>rt+mt.sourcePoint.y,0)/r.connections.length},ye=[{x:-1,y:0,distance:_e.x-Math.min(...r.xCoordinates)},{x:1,y:0,distance:Math.max(...r.xCoordinates)-_e.x},{x:0,y:-1,distance:_e.y-Math.min(...r.yCoordinates)},{x:0,y:1,distance:Math.max(...r.yCoordinates)-_e.y}].toSorted((rt,mt)=>rt.distance-mt.distance),Se=r.connections.length===2?ye.flatMap((rt)=>[3].map((mt)=>r.connections.map((lt)=>{let Ct=y.get(lt.connectionIndex);return{x:Ct.x+rt.x*mt*r.pitchX,y:Ct.y+rt.y*mt*r.pitchY}}))):[],Ne=r.connections.map((rt)=>y.get(rt.connectionIndex)),ke=[{distance:_e.x-r.componentBounds.minX,axis:"x",value:r.componentBounds.minX-2*Me},{distance:r.componentBounds.maxX-_e.x,axis:"x",value:r.componentBounds.maxX+2*Me},{distance:_e.y-r.componentBounds.minY,axis:"y",value:r.componentBounds.minY-2*Me},{distance:r.componentBounds.maxY-_e.y,axis:"y",value:r.componentBounds.maxY+2*Me}].toSorted((rt,mt)=>rt.distance-mt.distance).flatMap(({axis:rt,value:mt})=>{let lt=rt==="x"?"y":"x",Ct=Ne.reduce((et,vt)=>et+vt[lt],0)/Ne.length,Nt=Ne.map((et,vt)=>({index:vt,track:et[lt]})).toSorted((et,vt)=>et.track-vt.track||et.index-vt.index),Ht=l+d,Tt=Ne.map((et,vt)=>({...et,[rt]:mt,[lt]:Nt.length===2&&Math.abs(Nt[1].track-Nt[0].track)<Ht?Ct+(Nt.findIndex((ht)=>ht.index===vt)-0.5)*Ht:et[lt]}));return Tt.length===2?[Tt,[Tt[1],Tt[0]]]:[Tt]}),nt=r.connections.length===2&&Boolean(y6(r)),dt=[...(nt?ke:[]).map((rt)=>({points:rt,boundarySide:!1})),...Se.map((rt)=>({points:rt,boundarySide:!1})),...we.map((rt)=>({points:rt,boundarySide:!0})),...(!nt?ke:[]).map((rt)=>({points:rt,boundarySide:!1}))];for(let{points:rt,boundarySide:mt}of dt){let lt=r.connections.map((We,Le)=>({connectionName:We.connection.name,via:{center:rt[Le],diameter:l,spanLayers:G5({fromLayer:le,toLayer:i,layerNames:a,allowBlindAndBuriedVias:m})}}));if(lt.some((We,Le)=>lt.some((Ze,$e)=>Le!==$e&&(Ut(We.via.center,Ze.via.center)<l+d-0.000000001||mt&&Vr(We.via.center,Ze.via.center,Ae[$e])<l/2+c/2+d-0.000000001))))continue;if(lt.some(({via:We})=>o.obstacles.some((Le)=>Le.layers.some((Ze)=>We.spanLayers.includes(Ze))&&X5(We.center,Le)<We.diameter/2+d-0.000000001)))continue;let Ct=w1({heuristicWeight:e.windingHeuristicWeight,srj:xe,bus:r,targetLayer:le,terminals:r.connections.map((We,Le)=>({connection:We,viaPoint:We.sourcePoint,exitPoint:rt[Le]})),acceptedPlans:s,layerNames:a,traceWidth:c,viaDiameter:l,viaHoleDiameter:h,clearance:d,allowBlindAndBuriedVias:m,allowSameNetMerges:A,maximumRouteOrderAttempts:r.connections.length===1?3:6,softReservedVias:b,reservedVias:r.connections.length>1?[...C,...lt]:C,gridStepDivisor:2,allowSourceLayerRouting:!0,alignGridToPads:!0,forbidEarlyExitBoundaryContact:H},1,n),Nt=Ct.next();while(!Nt.done)yield{phase:"via-minimal-winding",busId:r.busId,targetLayer:le,winding:Nt.value},Nt=Ct.next();let Ht=Nt.value[0];if(!Ht||Ht.length!==r.connections.length)continue;let Tt;if(!mt){let We=w1({heuristicWeight:e.windingHeuristicWeight,srj:o,bus:r,targetLayer:i,terminals:r.connections.map((Ze,$e)=>({connection:Ze,viaPoint:rt[$e],exitPoint:Ae[$e]})),acceptedPlans:s,layerNames:a,traceWidth:c,viaDiameter:l,viaHoleDiameter:h,clearance:d,allowBlindAndBuriedVias:m,allowSameNetMerges:A,maximumRouteOrderAttempts:6,reservedVias:C,softReservedVias:b,gridStepDivisor:2,alignGridToPads:!0,forbidEarlyExitBoundaryContact:H},1,n),Le=We.next();while(!Le.done)yield{phase:"via-minimal-winding",busId:r.busId,targetLayer:i,winding:Le.value},Le=We.next();if(Tt=Le.value[0],!Tt)continue}let et=Ht.map((We,Le)=>{let Ze=rt[Le],$e=Ae[Le],ft=Tt?Tt[Le].segments.filter((Xe)=>Xe.layer===i):[{start:Ze,end:$e,width:c,layer:i}],It={center:Ze,diameter:l,holeDiameter:h,fromLayer:le,toLayer:i,spanLayers:G5({fromLayer:le,toLayer:i,layerNames:a,allowBlindAndBuriedVias:m})},ze=We.trace.route.filter((Xe)=>Xe.route_type==="wire");return{...We,...P||r.connections.length>1||!mt?{sourceEscapeSegmentCount:We.segments.length}:{},targetLayer:i,exitPoint:$e,via:It,segments:[...We.segments,...ft],length:We.length+ft.reduce((Xe,it)=>Xe+Ut(it.start,it.end),0),trace:{...We.trace,route:[...ze,{route_type:"via",...Ze,from_layer:le,to_layer:i,via_diameter:l,via_hole_diameter:h},{route_type:"wire",...Ze,width:c,layer:i},...ft.map((Xe)=>({route_type:"wire",...Xe.end,width:c,layer:i}))]}}}),vt=wp({plans:[...s,...et],srj:o,sharedBoundary:r.sharedBoundary,clearance:d,allowBlindAndBuriedVias:m,allowSameNetMerges:A}),ht=et.every((We)=>C.every((Le)=>{let Ze=We.via;if(Le.connectionName===We.connectionName||A&&Y5(o,Le.connectionName,We.connectionName))return!0;if(Ze.spanLayers.some(($e)=>Le.via.spanLayers.includes($e))&&Ut(Ze.center,Le.via.center)<(Ze.diameter+Le.via.diameter)/2+d-0.000000001)return!1;return We.segments.every(($e)=>!Le.via.spanLayers.includes($e.layer)||Vr(Le.via.center,$e.start,$e.end)>=Le.via.diameter/2+c/2+d-0.000000001)}));if(vt&&ht)return te(et),ne}}if(I||y||e.sourceEscapePaths||C.length>0)return ne;let ie=(le,ue,de,me)=>{if(ne.length>=t)return;if(de>=le.length){te(me);return}let Ae=le[de],xe=aue(r,Ae),Re=[pYr({bus:r,connection:Ae,traceWidth:c}),mYr({bus:r,connection:Ae,targetUsesVia:Y,interstitialEscape:J,compactBusTracks:u,traceWidth:c,viaDiameter:l,clearance:d})].filter((we,_e,ye)=>ye.findIndex((Se)=>Math.abs(Se-we)<0.000000001)===_e).flatMap((we)=>uYr({bus:r,connection:Ae,preferredTrack:we,traceWidth:c,clearance:d})).filter((we,_e,ye)=>ye.findIndex((Se)=>Math.abs(Se.value-we.value)<0.000000001)===_e);for(let we=0;we<Re.length;we++){let _e=Re[we],ye=cve({preparedConnection:Ae,bus:r,targetLayer:i,track:_e.value,exitAxis:V,layerNames:a,traceWidth:c,viaDiameter:l,viaHoleDiameter:h,viaHandedness:ue,interstitialEscape:J,spreadLaneIndex:Math.min(xe,r.connections.length-xe-1),cornerExitLaneOffset:Z.exit,cornerLocalChannelLaneOffset:Z.localChannel,cornerBoundaryChannelLaneOffset:Z.boundaryChannel,clearance:d,terminateAtVia:!1,allowBlindAndBuriedVias:m,cornerBandTargetTrackOffset:D,fixedBoundaryTracksByConnectionIndex:x});if(!lve({plan:ye,otherPlans:[...s,...me],staticClearanceCache:_,blockingBusCounts:p,cacheKey:`boundary:${r.busId}:${i}:${Ae.connectionIndex}:${ue}:${we}:${r.exitEdge??"legacy"}:${Z.exit}:${Z.localChannel}:${Z.boundaryChannel}:${D??0}:${x?.get(Ae.connectionIndex)??"default"}`,srj:o,sharedBoundary:r.sharedBoundary,clearance:d,allowBlindAndBuriedVias:m,allowSameNetMerges:A}))continue;if(ie(le,ue,de+1,[...me,ye]),ne.length>=t)return;if(t===1)return}};for(let le of se)for(let ue of cCn(r))if(ie(ue,le,0,[]),ne.length>=t)return ne;return ne}function UJ(e,t=1){let n=z8e(e,t),o=n.next();while(!o.done)o=n.next();return o.value}function GY(e){return UJ(e,1)[0]??null}var Fu=0.0000001,Fde=(e,t,n)=>t==="left"?e.x-n.minX:t==="right"?n.maxX-e.x:t==="top"?n.maxY-e.y:e.y-n.minY;function AYr(e,t,n,o){let r=Fde(e.start,t,n),i=Fde(e.end,t,n);if(Math.min(r,i)>o)return null;if(Math.max(r,i)<=o)return e;let s=(o-r)/(i-r),a={x:e.start.x+(e.end.x-e.start.x)*s,y:e.start.y+(e.end.y-e.start.y)*s};return{...e,...r>o?{start:a}:{end:a}}}function Yrt(e){let t=e.segments.length-1;while(t>0&&e.segments[t-1].layer===e.targetLayer)t--;let n=e.segments.slice(t);return{first:t,points:n.length?[n[0].start,...n.map((o)=>o.end)]:[]}}function Sfn(e,t,n){let o=[...e.segments.slice(0,t),...n.slice(1).flatMap((i,s)=>Ut(n[s],i)>Fu?[{start:n[s],end:i,layer:e.targetLayer,width:e.segments.at(-1).width}]:[])],r=e.trace.route.length;while(r>0){let i=e.trace.route[r-1];if(i.route_type!=="wire"||i.layer!==e.targetLayer)break;r--}return{...e,segments:o,length:o.reduce((i,s)=>i+Ut(s.start,s.end),0),trace:{...e.trace,route:[...e.trace.route.slice(0,r),...n.map((i)=>({route_type:"wire",x:i.x,y:i.y,layer:e.targetLayer,width:e.segments.at(-1).width}))]}}}function fYr(e,t){let n=[...e],o=(r,i)=>{let s=Math.abs(i.x-r.x),a=Math.abs(i.y-r.y);return s<Fu||a<Fu||Math.abs(s-a)<Fu};for(let r=Math.max(1,t);r<n.length-1;r++){let i=n[r-1],s=n[r],a=n[r+1],c=Ut(i,s),l=Ut(s,a);if(c<Fu||l<Fu||((s.x-i.x)*(a.x-s.x)+(s.y-i.y)*(a.y-s.y))/(c*l)>=-Fu)continue;if(o(i,a)){n.splice(r,1),r--;continue}let h=[];for(let u of["x","y"]){let _=(i[u]-s[u])/(a[u]-s[u]);if(_>Fu&&_<1-Fu)h.push({x:s.x+(a.x-s.x)*_,y:s.y+(a.y-s.y)*_});let p=(a[u]-i[u])/(s[u]-i[u]);if(p>Fu&&p<1-Fu)h.push({x:i.x+(s.x-i.x)*p,y:i.y+(s.y-i.y)*p})}let d=h.find((u)=>o(i,u)&&o(u,a));if(d)n[r]=d}return n}function yYr(e,t){let n=(o)=>{let r=new Map;for(let i of e)for(let s of Yrt(i).points.slice(0,-1)){let a=(s[o]%t+t)%t,c=a<0.000001||t-a<0.000001?0:Math.round(a*1e6)/1e6;r.set(c,(r.get(c)??0)+1)}return[...r].sort((i,s)=>s[1]-i[1]||i[0]-s[0])[0]?.[0]??0};return{x:n("x"),y:n("y")}}function xYr(e,t,n,o){let r=t==="left"||t==="right"?"y":"x",i=e.map((c)=>c.exitPoint[r]).sort((c,l)=>c-l),s=[],a=(c,l)=>Math.abs(c-l-Math.round((c-l)/o)*o)<=Fu;if(i.length===1&&!a(i[0],n[r]))s.push({coordinate:i[0],count:1});for(let c=1;c<i.length;c++)for(let l of[i[c-1],i[c]]){if(a(l,n[r]))continue;let h=s.find((d)=>a(d.coordinate,l));if(h)h.count++;else s.push({coordinate:l,count:1})}return[n,...s.sort((c,l)=>l.count-c.count||c.coordinate-l.coordinate).slice(0,3).map(({coordinate:c})=>({...n,[r]:c}))]}function CYr(e,t,n,o,r){let i=o+r,s=e.map((h,d)=>d),a=(h)=>{while(s[h]!==h)h=s[h];return h},c=(h,d)=>{let u={x:d.x+(n==="left"?2*i:n==="right"?-2*i:0),y:d.y+(n==="bottom"?2*i:n==="top"?-2*i:0)};return h.some((_)=>ad(_.start,_.end,d,u)<(_.width+o)/2+r-Fu)};for(let h=0;h<e.length;h++)for(let d=h+1;d<e.length;d++){if(a(h)===a(d))continue;if(Ut(e[h].exitPoint,e[d].exitPoint)<=2*i+Fu||c(t[h],e[d].exitPoint)||c(t[d],e[h].exitPoint)||t[h].some((_)=>t[d].some((p)=>ad(_.start,_.end,p.start,p.end)<(_.width+p.width)/2+r-Fu)))s[a(d)]=a(h)}let l=new Map;return e.forEach((h,d)=>{let u=a(d),_=l.get(u)??[];_.push(h),l.set(u,_)}),[...l.values()]}function Grt(e){let{inputSrj:t,preparedBuses:n,reservedPlans:o=[],traceWidth:r,clearance:i}=e,s=r+i,a=e.gridStep??r;if(!(s>0)||!(a>0)||!Number.isFinite(a))throw Error("FanoutSolver: boundary tail repair requires positive finite trace/grid spacing");let c=new Map(n.flatMap((p)=>p.connections.map((m)=>[m.connectionIndex,{bus:p,connection:m}]))),l=[...e.plans],h=new Map;for(let p of l){let m=c.get(p.connectionIndex);if(!m)throw Error(`FanoutSolver: missing prepared boundary-tail connection ${p.connectionIndex}`);if(p.termination.type!=="boundary"||!p.exitEdge||Math.abs(Fde(p.exitPoint,p.exitEdge,m.bus.sharedBoundary))>Fu)continue;let A=`${p.exitEdge}:${p.targetLayer}`,g=h.get(A)??[];g.push(p),h.set(A,g)}let d=[...h.values()];for(let p=0;p<d.length;p++){let m=d[p],A=m[0].exitEdge,g=m[0].targetLayer,f=c.get(m[0].connectionIndex).bus.sharedBoundary,y=Math.min(24*s,(A==="left"||A==="right"?f.maxX-f.minX:f.maxY-f.minY)/3),x=m.map((B)=>B.segments.filter((T)=>T.layer===g).flatMap((T)=>AYr(T,A,f,y)??[])),C=CYr(m,x,A,r,i);if(C.length>1){d.splice(p,1,...C),p--;continue}let b=new Set;for(let B of m)if(Yrt(B).points.slice(0,-1).some((T)=>Math.abs(Fde(T,A,f))<=Fu&&Ut(T,B.exitPoint)>Fu))b.add(B);for(let B=0;B<m.length;B++)for(let T=B+1;T<m.length;T++)if(x[B].some((N)=>x[T].some((D)=>ad(N.start,N.end,D.start,D.end)<(N.width+D.width)/2+i-Fu)))b.add(m[B]),b.add(m[T]);if(!b.size)continue;let I=!0;while(I){I=!1;for(let B of m)if(!b.has(B)&&[...b].some((T)=>{if(Ut(B.exitPoint,T.exitPoint)<=2*s+Fu)return!0;let N={x:T.exitPoint.x+(A==="left"?2*s:A==="right"?-2*s:0),y:T.exitPoint.y+(A==="bottom"?2*s:A==="top"?-2*s:0)};return B.segments.some((D)=>D.layer===g&&ad(D.start,D.end,T.exitPoint,N)<(D.width+r)/2+i-Fu)}))b.add(B),I=!0}let v=m.filter((B)=>b.has(B));if(v.length>32)return null;let P=xYr(v,A,e.gridOrigin??yYr(v,a),a),M=null;for(let B of P){for(let T of[8,16,24]){let N=Math.min(T*s,y),D=A==="left"||A==="right"?"x":"y",L=A==="left"||A==="bottom"?1:-1,H=A==="left"?f.minX:A==="right"?f.maxX:A==="top"?f.maxY:f.minY,V=H+L*N,O=B[D]+(L>0?Math.ceil((V-B[D])/a):Math.floor((V-B[D])/a))*a,U=(O-H)*L,j=v.map((de)=>{let{first:me,points:Ae}=Yrt(de),xe=Ae.findLastIndex((Se)=>Fde(Se,A,f)>=U-Fu);if(xe<0){let Se=de.additionalVias?.at(-1)??de.via;if(!Se||Se.toLayer!==de.targetLayer||!Ae[0]||Ut(Se.center,Ae[0])>Fu||me<(de.sourceEscapeSegmentCount??1))return null;return{plan:de,first:me,prefix:[Ae[0]],point:Ae[0]}}if(xe>=Ae.length-1)return null;let Me=Ae[xe],Re=Ae[xe+1],we=(O-Me[D])/(Re[D]-Me[D]);if(!Number.isFinite(we)||we<-Fu||we>1+Fu)return null;let _e={x:Me.x+(Re.x-Me.x)*we,y:Me.y+(Re.y-Me.y)*we},ye=[...Ae.slice(0,xe+1),...Ut(Me,_e)>Fu?[_e]:[]];if(me+ye.length-1<(de.sourceEscapeSegmentCount??1))return null;return{plan:de,first:me,prefix:ye,point:_e}});if(j.some((de)=>!de))continue;let Y=j.filter((de)=>de!==null),X=[...l.filter((de)=>!b.has(de)),...o],K=Y.map((de)=>({...Sfn(de.plan,de.first,de.prefix),exitPoint:de.point})),J=[...X,...K],ee=Y.map((de)=>({connection:{...c.get(de.plan.connectionIndex).connection,sourcePoint:{...de.point,layer:g},sourceLayer:g},viaPoint:de.point,exitPoint:de.plan.exitPoint})),se={...f};if(A==="left")se.maxX=Math.min(f.maxX,O+3*s);if(A==="right")se.minX=Math.max(f.minX,O-3*s);if(A==="bottom")se.maxY=Math.min(f.maxY,O+3*s);if(A==="top")se.minY=Math.max(f.minY,O-3*s);let ne=D==="x"?"y":"x",re=ee.flatMap((de)=>[de.viaPoint[ne],de.exitPoint[ne]]);if(ne==="x")se.minX=Math.max(se.minX,Math.min(...re)-3*s),se.maxX=Math.min(se.maxX,Math.max(...re)+3*s);else se.minY=Math.max(se.minY,Math.min(...re)-3*s),se.maxY=Math.min(se.maxY,Math.max(...re)+3*s);let Z={...c.get(v[0].connectionIndex).bus,connections:ee.map((de)=>de.connection),sharedBoundary:se},te=w1({...e,srj:t,bus:Z,terminals:ee,targetLayer:g,sourceEscapePaths:void 0,acceptedPlans:J,reservedVias:J.flatMap((de)=>[de.via,...de.additionalVias??[],de.planeEndpointVia].filter((me)=>!!me).map((me)=>({connectionName:de.connectionName,via:me}))),gridStep:a,gridOrigin:B,gridStepDivisor:2,alignGridToPads:!0,heuristicWeight:2,maximumRouteOrderAttempts:72,reserveTerminalExitPoints:!0,adaptiveRouteOrder:!0,allowSourceLayerRouting:!0,forbidEarlyExitBoundaryContact:!0},1,!1),ie=te.next();while(!ie.done)ie=te.next();let le=ie.value[0];if(!le)continue;let ue=Y.map((de)=>{let me=le.find((xe)=>xe.connectionIndex===de.plan.connectionIndex);if(!me||me.via||me.additionalVias?.length)throw Error("FanoutSolver: boundary-tail repair added a physical via");let Ae=fYr([...de.prefix,...me.segments.map((xe)=>xe.end)],de.prefix.length-1);return Sfn(de.plan,de.first,Ae)});if(!wp({plans:ue,srj:{...t,traces:[...t.traces??[],...X.flatMap((de)=>[de.trace,...de.planeEndpointTrace?[de.planeEndpointTrace]:[]])]},sharedBoundary:f,clearance:i,allowBlindAndBuriedVias:e.allowBlindAndBuriedVias,allowSameNetMerges:e.allowSameNetMerges}))continue;M=ue;break}if(M)break}if(!M)return null;for(let B of M)l[l.findIndex((T)=>T.connectionIndex===B.connectionIndex)]=B}let u=[...l,...o];if(t.traces?.length&&u.length){let p=n.map((A)=>A.sharedBoundary);if(!F8e({srj:t,sharedBoundary:{minX:Math.min(...p.map((A)=>A.minX)),maxX:Math.max(...p.map((A)=>A.maxX)),minY:Math.min(...p.map((A)=>A.minY)),maxY:Math.max(...p.map((A)=>A.maxY))},clearance:i,allowBlindAndBuriedVias:e.allowBlindAndBuriedVias,allowSameNetMerges:e.allowSameNetMerges})(u))return null}return lu({inputSrj:t,routedSrj:{...t,traces:[...u.flatMap((p)=>[p.trace,...p.planeEndpointTrace?[p.planeEndpointTrace]:[]])]},clearance:i,allowBlindAndBuriedVias:e.allowBlindAndBuriedVias}).valid?l:null}var $s=0.0000001;function VZ(e,t,n,o){let r=new Float64Array(t.length+1),i=new Int32Array(t.length);for(let c=0;c<t.length;c++){let l=t[c],h=t[c-1];r[c+1]=r[c]+Ut(l.start,l.end),i[c]=c===0?0:i[c-1]+Number(h.layer!==l.layer||Ut(h.end,l.start)>$s)}let s=[e.via,...e.additionalVias??[],e.planeEndpointVia].filter((c)=>!!c),a=(c,l)=>{if(i[c]!==i[l])return!1;let h=0,d=0;for(let u=c;u<=l;u++){let _=t[u],p=_.end.x-_.start.x,m=_.end.y-_.start.y;if(Math.abs(p)>$s){let A=Math.sign(p);if(h&&h!==A)return!1;h=A}if(Math.abs(m)>$s){let A=Math.sign(m);if(d&&d!==A)return!1;d=A}}return!0};for(let[c,l]of t.entries()){if(o&&!o.has(c))continue;if(!o&&e.segments.some((h)=>h.layer===l.layer&&h.width===l.width&&Vr(l.start,h.start,h.end)<=$s&&Vr(l.end,h.start,h.end)<=$s))continue;for(let[h,d]of t.entries()){if(d.layer!==l.layer)continue;let u=(l.width+d.width)/2+n,_=Math.min(c,h),p=Math.max(c,h);if(i[c]===i[h]&&Math.max(0,r[p]-r[_+1])<=u+$s)continue;if(!V_(l,d,n)){if(!a(_,p))return!1}}for(let h of s){if(!h.spanLayers.includes(l.layer))continue;let d=(l.width+h.diameter)/2+n;if(Vr(h.center,l.start,l.end)>=d-$s)continue;if([l.start,l.end].some((_)=>Ut(_,h.center)<=$s))continue;let u=(_)=>{let p=_===-1?l.start:l.end,m=_===-1?l.end:l.start;if(Ut(p,h.center)>d+$s||(p.x-h.center.x)*(m.x-p.x)+(p.y-h.center.y)*(m.y-p.y)<-$s)return!1;for(let A=c+_;A>=0&&A<t.length;A+=_){let g=t[A];if(g.layer!==l.layer||Ut(p,_===-1?g.end:g.start)>$s)return!1;let f=_===-1?g.start:g.end;if(Ut(f,h.center)>d+$s||(f.x-h.center.x)*(f.x-p.x)+(f.y-h.center.y)*(f.y-p.y)>$s)return!1;if(p=f,Ut(p,h.center)<=$s)return!0}return!1};if(!u(-1)&&!u(1))return!1}}return!0}function Zue(e,t,n,o,r=!1,i=e.traceWidth/4){let{inputSrj:s,layerNames:a,traceWidth:c,clearance:l}=e,h=t.trace.route.findIndex((C)=>C.route_type==="via");if(h<0)return null;let d=t.trace.route.slice(h+1).flatMap((C)=>C.route_type==="wire"?[{x:C.x,y:C.y,z:a.indexOf(C.layer)}]:[]);for(let C=1;r&&C<d.length-1;C++){let b=d[C-1],I=d[C],v=d[C+1];if(b.z!==I.z||I.z!==v.z)continue;if(((I.x-b.x)*(v.x-I.x)+(I.y-b.y)*(v.y-I.y))/(Ut(b,I)*Ut(I,v))<-$s)d.splice(C,1),C--}let u=WP(s,!1),_=new Jue([...n.flatMap((C)=>[...C.segments,...C.planeEndpointSegments??[]]),...u.flatMap((C)=>C.segments)]),p=[...n.flatMap((C)=>[C.via,...C.additionalVias??[],C.planeEndpointVia].filter((b)=>!!b)),...u.flatMap((C)=>C.vias)],m=pG({points:d,chamfer:i,repairReversingDiagonalCorners:!0,segmentIsClear:(C,b)=>{let I={start:C,end:b,layer:a[C.z],width:c};for(let v of[C,b]){let P=o.sharedBoundary;if(v.x<P.minX-$s||v.x>P.maxX+$s||v.y<P.minY-$s||v.y>P.maxY+$s)return!1;if((Math.abs(v.x-P.minX)<$s||Math.abs(v.x-P.maxX)<$s||Math.abs(v.y-P.minY)<$s||Math.abs(v.y-P.maxY)<$s)&&Ut(v,t.exitPoint)>$s)return!1}return s.obstacles.every((v)=>!v.layers.includes(I.layer)||Wl(I,v)>=c/2+l-0.000000001)&&_.querySegment(I,l).every((v)=>V_(I,v,l))&&p.every((v)=>!v.spanLayers.includes(I.layer)||Vr(v.center,C,b)>=(c+v.diameter)/2+l-0.000000001)}});if(!m)return null;let A=t.trace.route.slice(0,h+1);for(let C=0;C<m.length;C++){let b=m[C],I=m[C-1];if(I&&I.z!==b.z){let v=t.trace.route.find((P)=>P.route_type==="via"&&Ut(P,b)<$s&&P.from_layer===a[I.z]&&P.to_layer===a[b.z]);if(!v)return null;A.push(v)}A.push({route_type:"wire",x:b.x,y:b.y,layer:a[b.z],width:c})}A[A.length-1]=t.trace.route.at(-1);let g={...t.trace,route:A},f=L8e(s,g,!1).segments,y=t.sourceEscapeSegmentCount??1,x=[...t.segments.slice(0,y),...f.slice(y)];if(!VZ(t,x,l))return null;return{...t,trace:g,segments:x,length:x.reduce((C,b)=>C+Ut(b.start,b.end),0)}}function kk(e){for(let t=0;t<e.length;t++){let n=e[t],o=n.end.x-n.start.x,r=n.end.y-n.start.y,i=Math.hypot(o,r);if(Math.min(Math.abs(o),Math.abs(r),Math.abs(Math.abs(o)-Math.abs(r)))>$s)return!1;let s=e[t+1];if(s&&Ut(n.end,s.start)>$s)return!1;if(!s||s.layer!==n.layer||i<$s)continue;let a=s.end.x-s.start.x,c=s.end.y-s.start.y,l=Math.hypot(a,c);if(l<$s)continue;if((o*a+r*c)/(i*l)<Math.SQRT1_2-$s)return!1}return!0}function ide(e,t){let n=t.sharedBoundary;return e.segments.every((o)=>[o.start,o.end].every((r)=>{if(r.x<n.minX-$s||r.x>n.maxX+$s||r.y<n.minY-$s||r.y>n.maxY+$s)return!1;if(e.termination.type!=="boundary")return!0;return!(Math.abs(r.x-n.minX)<$s||Math.abs(r.x-n.maxX)<$s||Math.abs(r.y-n.minY)<$s||Math.abs(r.y-n.maxY)<$s)||Ut(r,e.exitPoint)<$s}))}function bYr(e,t,n,o,r=!1){let i=t.sourceEscapeSegmentCount??1;if(t.termination.type!==(r?"boundary":"plane")||!t.via||!r&&t.additionalVias?.length||t.planeEndpointTrace||t.planeEndpointSegments?.length||t.planeEndpointVia||!r&&t.segments.length!==i)return null;let s=t.segments.slice(0,i);if(!s.length||s.some((I)=>I.layer!==t.sourceLayer)||Ut(s[0].start,t.sourcePoint)>$s||Ut(s.at(-1).end,t.via.center)>$s)return null;let a=o.connections.find((I)=>I.connectionIndex===t.connectionIndex);if(!a?.sourceObstacle)return null;let c=t.trace.route.findIndex((I)=>I.route_type==="via");if(c<1)return null;let{inputSrj:l,traceWidth:h,clearance:d,layerNames:u}=e,_=(I)=>t.termination.type==="plane"&&Y5(l,t.connectionName,I),p=n.filter((I)=>I.termination.type!=="plane"||!_(I.connectionName)),m=WP(l,!1).filter((I)=>!_(I.connectionName)),A=new Jue([...t.segments.slice(i),...p.flatMap((I)=>[...I.segments,...I.planeEndpointSegments??[]]),...m.flatMap((I)=>I.segments)]),g=[...t.additionalVias??[],...p.flatMap((I)=>[I.via,...I.additionalVias??[],I.planeEndpointVia].filter((v)=>!!v)),...m.flatMap((I)=>I.vias)],f=pG({points:[t.sourcePoint,...s.map((I)=>I.end)].map((I)=>({...I,z:u.indexOf(t.sourceLayer)})),chamfer:h/4,repairReversingDiagonalCorners:!0,segmentIsClear:(I,v)=>{let P={start:I,end:v,layer:t.sourceLayer,width:h},M=o.sharedBoundary;if([I,v].some((B)=>B.x<M.minX||B.x>M.maxX||B.y<M.minY||B.y>M.maxY))return!1;return l.obstacles.every((B)=>{if(!B.layers.includes(t.sourceLayer))return!0;if(Wl(P,B)>=h/2+d-0.000000001)return!0;if(B===a.sourceObstacle&&OZ(I,B,h/2+d)&&(I.x-a.sourcePoint.x)*(v.x-I.x)+(I.y-a.sourcePoint.y)*(v.y-I.y)>=-$s)return!0;if(B!==a.sourceObstacle&&t.termination.type==="plane"&&P6(l,B,t.connectionName))return!0;return que({inputSrj:l,segment:P,bodyObstacle:B,connectionName:t.connectionName})})&&A.querySegment(P,d).every((B)=>V_(P,B,d))&&g.every((B)=>!B.spanLayers.includes(P.layer)||Vr(B.center,I,v)>=(h+B.diameter)/2+d-0.000000001)}});if(!f)return null;let y={...t.trace,route:[t.trace.route[0],...f.slice(1).map((I)=>({route_type:"wire",x:I.x,y:I.y,layer:t.sourceLayer,width:h})),...t.trace.route.slice(c)]},x=L8e(l,{...y,route:y.route.slice(0,f.length)},!1).segments,C=[...x,...t.segments.slice(i)],b=!1;for(let I of x){let v=Wl(I,a.sourceObstacle);if(b&&v<h/2+d-0.000000001)return null;if(X5(I.end,a.sourceObstacle)>=h/2+d-0.000000001)b=!0}if(!kk(x)||!VZ(t,C,d,new Set(x.map((I,v)=>v))))return null;return{...t,trace:y,segments:C,sourceEscapeSegmentCount:x.length,length:[...C,...t.planeEndpointSegments??[]].reduce((I,v)=>I+Ut(v.start,v.end),0)}}function Jst(e){let t=new Map(e.preparedBuses.map((c)=>[c.busId,c]));if(new Set(e.plans.map((c)=>c.connectionIndex)).size!==e.plans.length)return null;let n=[...e.plans],o=!1;if(e.repairPlaneSourceCorners||e.repairSignalSourceCorners)for(let c=0;c<n.length;c++){let l=n[c];if(kk(l.segments.slice(0,l.sourceEscapeSegmentCount??1)))continue;let h=t.get(l.busId);if(!h)return null;if(l.termination.type==="plane"?!e.repairPlaneSourceCorners:!e.repairSignalSourceCorners)return null;let d=bYr(e,l,n.filter((u,_)=>_!==c),h,l.termination.type==="boundary");if(!d)return null;n[c]=d,o=!0}if(o&&e.rematchRepairedLengths){let c=e.rematchRepairedLengths(n);if(!c)return null;n=c}let r=[...n],i=Xst(e.inputSrj);for(let c of n){if(!t.has(c.busId))throw Error("Final normalization requires each original prepared bus");if(!kk(c.segments.slice(0,c.sourceEscapeSegmentCount??1))||!ide({...c,segments:c.segments.slice(0,c.sourceEscapeSegmentCount??1)},t.get(c.busId))||!kk(c.planeEndpointSegments??[]))return null}if(n.some((c)=>!ide(c,t.get(c.busId)))){let c=Grt({...e,plans:n,allowBlindAndBuriedVias:!1,allowSameNetMerges:!1});if(!c)return null;if(n=c,e.rematchRepairedLengths){let l=e.rematchRepairedLengths(n);if(!l)return null;n=l}}for(let c=0;c<n.length;c++){let l=n[c];if(kk(l.segments)&&ide(l,t.get(l.busId)))continue;let h=t.get(l.busId),d=null,u=null;for(let _=e.traceWidth/4;_>=0.000001;_=Math.max(0.000001,_/4)){let p=Zue(e,l,n.filter((m,A)=>A!==c),h,!1,_);if(p){u??=p;let m=n.filter((g)=>g.busId===h.busId).map((g)=>g===l?p.length:g.length);if(i.every((g)=>{if(!g.connectionIndices.includes(l.connectionIndex))return!0;let f=g.connectionIndices.map((x)=>n.find((C)=>C.connectionIndex===x));if(f.some((x)=>!x))return!0;let y=f.map((x)=>x===l?p.length:x.length);return Math.abs(y[0]-y[1])<=g.lengthTolerance+$s})&&(h.maxLengthSkew===void 0||Math.max(...m)-Math.min(...m)<=h.maxLengthSkew+$s)){d=p;break}}if(_===0.000001)break}if(!d&&u&&e.rematchRepairedLengths){let _=e.rematchRepairedLengths(n.map((m,A)=>A===c?u:m)),p=_?.find((m)=>m.connectionIndex===l.connectionIndex);if(_&&p&&kk(p.segments))n=_,d=p}if(!d)return null;n[c]=d}for(let c=0;c<n.length;c++){let l=n[c],h=r.find((p)=>p.connectionIndex===l.connectionIndex);if(!h||l.targetLayer!==h.targetLayer||Ut(l.exitPoint,h.exitPoint)>$s||JSON.stringify(l.via)!==JSON.stringify(h.via)||JSON.stringify(l.additionalVias)!==JSON.stringify(h.additionalVias)||!kk(l.segments)||!ide(l,t.get(l.busId)))return null;if(l===h)continue;let d=h.trace.route.findIndex((p)=>p.route_type==="via"),u=l.trace.route.findIndex((p)=>p.route_type==="via");if(d<0||u<0)return null;let _=h.sourceEscapeSegmentCount??1;n[c]={...l,sourcePoint:h.sourcePoint,via:h.via,additionalVias:h.additionalVias,exitPoint:h.exitPoint,sourceEscapeSegmentCount:_,segments:[...h.segments.slice(0,_),...l.segments.slice(l.sourceEscapeSegmentCount??1)],trace:{...h.trace,route:[...h.trace.route.slice(0,d+1),...l.trace.route.slice(u+1)]}}}for(let c of e.preparedBuses){let l=n.filter((h)=>h.busId===c.busId);if(l.length!==c.connections.length||l.some((h)=>!kk(h.segments)||!ide(h,c)))return null;if(c.maxLengthSkew===void 0)continue;if(Math.max(...l.map((h)=>h.length))-Math.min(...l.map((h)=>h.length))>c.maxLengthSkew+$s)return null}let s=new Map(n.map((c)=>[c.connectionIndex,c]));for(let c of i){let l=c.connectionIndices.map((d)=>s.get(d));if(l.some((d)=>!d))continue;let h=l.map((d)=>[...d.segments,...d.planeEndpointSegments??[]].reduce((u,_)=>u+Ut(_.start,_.end),0));if(h.some((d)=>!Number.isFinite(d))||Math.abs(h[0]-h[1])>c.lengthTolerance+$s)return null}if(e.inputSrj.traces?.length&&n.length){let c=e.preparedBuses.map((h)=>h.sharedBoundary);if(!F8e({srj:e.inputSrj,sharedBoundary:{minX:Math.min(...c.map((h)=>h.minX)),maxX:Math.max(...c.map((h)=>h.maxX)),minY:Math.min(...c.map((h)=>h.minY)),maxY:Math.max(...c.map((h)=>h.maxY))},clearance:e.clearance,allowBlindAndBuriedVias:!1,allowSameNetPlaneMerges:!0})(n))return null}return lu({inputSrj:e.inputSrj,routedSrj:{...e.inputSrj,traces:[...n.flatMap((c)=>[c.trace,...c.planeEndpointTrace?[c.planeEndpointTrace]:[]])]},clearance:e.clearance,allowBlindAndBuriedVias:!1}).valid?n:null}function IYr(e){let{inputSrj:t,plans:n,unroutedSourceBuses:o,clearance:r}=e,i=new Map(n.map((y)=>[y.connectionIndex,y])),s=rT(t.layerCount),a=o.filter((y)=>y.termination.type==="boundary"&&y.connections.length>0&&y.connections.every((x)=>{let C=i.get(x.connectionIndex),b=C?.segments[0],I=C?.via;return C?.connectionName===x.connection.name&&C.termination.type==="boundary"&&C.segments.length===1&&(C.sourceEscapeSegmentCount??1)===1&&!C.additionalVias?.length&&!C.planeEndpointTrace&&!C.planeEndpointVia&&b&&b.layer===x.sourceLayer&&I&&I.fromLayer===x.sourceLayer&&I.toLayer===C.targetLayer&&I.toLayer!==I.fromLayer&&I.spanLayers.length===s.length&&s.every((v)=>I.spanLayers.includes(v))&&Ut(b.start,x.sourcePoint)<0.0000001&&Ut(b.end,I.center)<0.0000001&&Ut(C.exitPoint,I.center)<0.0000001})),c=a[0]?.connections[0];if(!c)return null;let l=i.get(c.connectionIndex),h=l.via,d=l.segments[0].width;if(a.some((y)=>y.connections.some((x)=>{let C=i.get(x.connectionIndex);return C.via.diameter!==h.diameter||C.via.holeDiameter!==h.holeDiameter||C.segments[0].width!==d})))return null;let u=new Set(a.flatMap((y)=>y.connections.map((x)=>x.connectionIndex))),_=n.filter((y)=>!u.has(y.connectionIndex)),p=WP(t,!1),m=I0(a,{traceWidth:d,clearance:r,viaDiameter:h.diameter,viaHoleDiameter:h.holeDiameter,maximumSearchStates:1e4,preferredViaPointsByConnectionIndex:new Map(n.filter((y)=>u.has(y.connectionIndex)).map((y)=>[y.connectionIndex,y.via.center])),additionalObstacles:t.obstacles,blockingSegments:[..._.flatMap((y)=>[...y.segments,...y.planeEndpointSegments??[]].map((x)=>({connectionIndex:y.connectionIndex,segment:x}))),...p.flatMap((y)=>y.segments.map((x)=>({connectionIndex:-1,segment:x})))],blockingVias:[..._.flatMap((y)=>[y.via,...y.additionalVias??[],y.planeEndpointVia].filter((x)=>x!==void 0).map((x)=>({connectionIndex:y.connectionIndex,...x}))),...p.flatMap((y)=>y.vias.map((x)=>({connectionIndex:-1,...x})))]});if(!m)return null;let A=new Map;for(let y of a)for(let x of y.connections){let C=i.get(x.connectionIndex),b=m.get(x.connectionIndex);if(Ut(b,C.via.center)<0.0000001)continue;let I=b.x-x.sourcePoint.x,v=b.y-x.sourcePoint.y;if(Math.min(Math.abs(I),Math.abs(v),Math.abs(Math.abs(I)-Math.abs(v)))>0.0000001)return null;A.set(x.connectionIndex,B6({bus:y,terminal:{connection:x,viaPoint:b,exitPoint:b},targetLayer:C.targetLayer,targetLayerPoints:[b],layerNames:s,traceWidth:d,viaDiameter:h.diameter,viaHoleDiameter:h.holeDiameter,allowBlindAndBuriedVias:!1}))}if(!A.size)return null;let g=n.map((y)=>A.get(y.connectionIndex)??y);if(!wp({plans:g,srj:t,sharedBoundary:a[0].sharedBoundary,clearance:r,allowBlindAndBuriedVias:!1,allowSameNetMerges:!1}))return null;return lu({inputSrj:t,routedSrj:{...t,traces:[...t.traces??[],...g.flatMap((y)=>[y.trace,...y.planeEndpointTrace?[y.planeEndpointTrace]:[]])]},clearance:r,allowBlindAndBuriedVias:!1}).valid?g:null}var ai=0.000001;function fx(e,t){return Ut(e,t)<=ai}function O8e(e){return[e.via,...e.additionalVias??[]].filter((t)=>t!==void 0)}function vYr(e,t){let n=t[0];if(!n)return null;let o=e.trace.route.find((u)=>u.route_type==="wire"),r=e.trace.route.findLast((u)=>u.route_type==="wire"),i=(u)=>{if(u?.route_type!=="wire")return{};let _={...u};return delete _.route_type,delete _.x,delete _.y,delete _.width,delete _.layer,_},s=O8e(e),c=fx(n.start,e.sourcePoint)&&n.layer!==e.sourceLayer&&s.some((u)=>fx(u.center,n.start)&&u.spanLayers.includes(e.sourceLayer)&&u.spanLayers.includes(n.layer))?e.sourceLayer:n.layer,l=[{...i(o),route_type:"wire",...n.start,width:n.width,layer:c}],h=n.start,d=c;for(let[u,_]of t.entries()){if(!fx(h,_.start))return null;if(d!==_.layer){let p=s.find((m)=>fx(m.center,_.start)&&m.spanLayers.includes(d)&&m.spanLayers.includes(_.layer));if(!p)return null;l.push({route_type:"via",..._.start,from_layer:d,to_layer:_.layer,via_diameter:p.diameter,via_hole_diameter:p.holeDiameter}),l.push({route_type:"wire",..._.start,width:_.width,layer:_.layer}),d=_.layer}l.push({...u===t.length-1?i(r):{},route_type:"wire",..._.end,width:_.width,layer:_.layer}),h=_.end}return l}function Mv(e,t,n=!1){let o=vYr(e,t);if(!o)return null;let r=[...t,...e.planeEndpointSegments??[]].reduce((s,a)=>s+Ut(a.start,a.end),0),i=t.findIndex((s)=>s.layer!==e.sourceLayer);return{...e,...n&&e.sourceEscapeSegmentCount!==void 0&&i>=0?{sourceEscapeSegmentCount:i}:{},trace:{...e.trace,route:o},segments:t,length:r}}function Fve(e,t,n){let o=[...O8e(e),...e.planeEndpointVia?[e.planeEndpointVia]:[]];for(let r of t){for(let a of o){if(a===r)continue;if(r.spanLayers.some((c)=>a.spanLayers.includes(c))&&Ut(r.center,a.center)<(r.diameter+a.diameter)/2+n-0.000000001)return!1}let i=e.segments.flatMap((a,c)=>{let l=e.segments[c+1];return a.layer===r.fromLayer&&l?.layer===r.toLayer&&fx(a.end,r.center)&&fx(l.start,r.center)?[c]:[]});if(i.length!==1)return!1;let s=new Set;for(let a of[-1,1]){let c=r.center,l=0,h=a===-1?r.fromLayer:r.toLayer;for(let d=i[0]+(a===1?1:0);d>=0&&d<e.segments.length;d+=a){let u=e.segments[d],_=a===-1?u.end:u.start,p=a===-1?u.start:u.end,m=(r.diameter+u.width)/2+n;if(u.layer!==h||!fx(c,_)||l>m+ai)break;s.add(d),l+=Ut(_,p),c=p}}for(let[a,c]of[...e.segments,...e.planeEndpointSegments??[]].entries()){if(s.has(a)||!r.spanLayers.includes(c.layer))continue;if(Vr(r.center,c.start,c.end)<(r.diameter+c.width)/2+n-0.000000001)return!1}}return!0}function*SYr(e){let{plan:t,bus:n,layerNames:o,clearance:r,workBudget:i}=e;if(!t.via||O8e(t).length>5)return;let s=n.allowedLayers??o,a=(n.routableEscapeLayers??s).filter((d)=>s.includes(d)&&o.includes(d)&&d!==t.sourceLayer&&d!==t.targetLayer),c=[];for(let d of t.segments){let u=c.at(-1);if(u?.layer===d.layer&&d.layer===t.targetLayer){let _=u.end.x-u.start.x,p=u.end.y-u.start.y,m=d.end.x-d.start.x,A=d.end.y-d.start.y;if(Math.abs(_*A-p*m)<=ai*Math.hypot(_,p)*Math.hypot(m,A)&&_*m+p*A>0){u.end=d.end;continue}}c.push({...d})}let l=Mv(t,c);if(!l)return;let h=(d,u,_)=>({center:d,fromLayer:u,toLayer:_,diameter:t.via.diameter,holeDiameter:t.via.holeDiameter,spanLayers:o});for(let d of a)for(let u of[!0,!1]){if(u&&(l.additionalVias?.length||l.via.toLayer!==l.targetLayer))continue;for(let[_,p]of l.segments.entries()){if(p.layer!==l.targetLayer)continue;if(Ut(p.start,p.end)<=ai)continue;for(let m=0;m<37;m++){let A=0.05+m*0.025;if(!u&&A>=0.5)break;sG(i);let g=(b)=>({x:p.start.x+(p.end.x-p.start.x)*b,y:p.start.y+(p.end.y-p.start.y)*b}),f=g(A),y=g(1-A);if(!u&&Ut(f,y)<t.via.diameter+r)continue;let x=u?[h(y,d,p.layer)]:[h(f,p.layer,d),h(y,d,p.layer)],C=u?Mv({...l,via:{...l.via,toLayer:d},additionalVias:x},[...l.segments.slice(0,_).map((b)=>b.layer===l.targetLayer?{...b,layer:d}:b),{...p,end:y,layer:d},{...p,start:y},...l.segments.slice(_+1)]):Mv({...l,additionalVias:[...l.additionalVias??[],...x]},[...l.segments.slice(0,_),{...p,end:f},{...p,start:f,end:y,layer:d},{...p,start:y},...l.segments.slice(_+1)]);if(C&&Fve(C,x,r))yield{plan:C,tuningLayer:d,addedVias:x}}}}}function lCn(e,t,n){return e.x<t.minX-n||e.x>t.maxX+n||e.y<t.minY-n||e.y>t.maxY+n}function PYr(e){let{segment:t,bounds:n,margin:o}=e,r={minX:n.minX-o,maxX:n.maxX+o,minY:n.minY-o,maxY:n.maxY+o},i=t.end.x-t.start.x,s=t.end.y-t.start.y,a=[0,1],c=(h)=>{if(h<=ai||h>=1-ai)return;let d={x:t.start.x+i*h,y:t.start.y+s*h};if(d.x<r.minX-ai||d.x>r.maxX+ai||d.y<r.minY-ai||d.y>r.maxY+ai)return;a.push(h)};if(Math.abs(i)>ai)c((r.minX-t.start.x)/i),c((r.maxX-t.start.x)/i);if(Math.abs(s)>ai)c((r.minY-t.start.y)/s),c((r.maxY-t.start.y)/s);let l=a.toSorted((h,d)=>h-d).filter((h,d,u)=>d===0||Math.abs(h-u[d-1])>ai);return l.slice(1).map((h,d)=>{let u=l[d];return{...t,start:{x:t.start.x+i*u,y:t.start.y+s*u},end:{x:t.start.x+i*h,y:t.start.y+s*h}}})}function hCn(e){return e.componentObstacles.reduce((t,n)=>({minX:Math.min(t.minX,n.center.x-n.width/2),maxX:Math.max(t.maxX,n.center.x+n.width/2),minY:Math.min(t.minY,n.center.y-n.height/2),maxY:Math.max(t.maxY,n.center.y+n.height/2)}),{minX:Number.POSITIVE_INFINITY,maxX:Number.NEGATIVE_INFINITY,minY:Number.POSITIVE_INFINITY,maxY:Number.NEGATIVE_INFINITY})}function Urt(e,t){if(e.layer!==t.layer)return!1;if(Math.min(e.start.x,e.end.x)>Math.max(t.start.x,t.end.x)+ai||Math.min(t.start.x,t.end.x)>Math.max(e.start.x,e.end.x)+ai||Math.min(e.start.y,e.end.y)>Math.max(t.start.y,t.end.y)+ai||Math.min(t.start.y,t.end.y)>Math.max(e.start.y,e.end.y)+ai)return!1;return ad(e.start,e.end,t.start,t.end)<=ai}function dCn(e){let t;return(n,o,r)=>{if(!t){t=[];for(let a=0;a<e.length;a++)for(let c=a+2;c<e.length;c++)if(Urt(e[a],e[c]))t.push([a,c])}let i=o+r-1,s=(a,c)=>c===a+2&&fx(n[a].end,n[c].start);for(let[a,c]of t){if(a===o||c===o)continue;let l=a>o?a+r-1:a,h=c>o?c+r-1:c;if(!s(l,h))return!0}for(let a=o;a<=i;a++)for(let c=0;c<n.length;c++){if(Math.abs(a-c)<2)continue;if(c>=o&&c<a)continue;let l=Math.min(a,c),h=Math.max(a,c);if(s(l,h))continue;if(Urt(n[l],n[h]))return!0}return!1}}function Zst(e){let{plan:t,segments:n,replacementStartIndex:o,replacementSegmentCount:r,clearance:i}=e,s=o+r-1,a=O8e(t),c=new Int32Array(n.length),l=new Float64Array(n.length+1);for(let d=0;d<n.length;d++){let u=n[d],_=n[d-1];c[d]=d===0?0:c[d-1]+Number(_.layer!==u.layer||!fx(_.end,u.start)),l[d+1]=l[d]+Ut(u.start,u.end)}let h=(d,u)=>{if(d===u)return 0;if(c[d]!==c[u])return Number.POSITIVE_INFINITY;let _=Math.min(d,u),p=Math.max(d,u);return Math.max(0,l[p]-l[_+1])};for(let d=o;d<=s;d++){let u=n[d],_=t.segments[o];if(u.layer===_.layer&&u.width===_.width&&Vr(u.start,_.start,_.end)<=ai&&Vr(u.end,_.start,_.end)<=ai)continue;for(let[p,m]of n.entries()){let A=u.width/2+m.width/2+i;if(h(d,p)<=A+ai)continue;if(!V_(u,m,i))return!1}for(let p of a){if(!p.spanLayers.includes(u.layer))continue;if(fx(p.center,u.start)||fx(p.center,u.end))continue;let m=p.diameter/2+u.width/2+i,A=(g)=>{let f=g===-1?u.start:u.end,y=0;for(let x=d+g;x>=0&&x<n.length;x+=g){let C=n[x];if(C.layer!==u.layer)return!1;let b=g===-1?C.end:C.start;if(!fx(f,b))return!1;if(y+=Ut(C.start,C.end),y>m+ai)return!1;if(f=g===-1?C.start:C.end,fx(f,p.center))return!0}return!1};if(Vr(p.center,u.start,u.end)<m-ai&&!A(-1)&&!A(1))return!1}}return!0}function uCn(e,t){return e.x>=t.minX-ai&&e.x<=t.maxX+ai&&e.y>=t.minY-ai&&e.y<=t.maxY+ai}function _2(e,t,n){return{x:e.x+t.x*n,y:e.y+t.y*n}}function EYr(e){let{segment:t,toothCount:n,targetAddedLength:o,pitch:r,placementFraction:i,normalSign:s}=e,a=t.end.x-t.start.x,c=t.end.y-t.start.y,l=Math.hypot(a,c);if(l<=ai)return null;let h=Math.abs(a)<=ai||Math.abs(c)<=ai,d=Math.abs(Math.abs(a)-Math.abs(c))<=ai;if(!h&&!d)return null;let u={x:a/l,y:c/l},_={x:-u.y*s,y:u.x*s},p=Math.min(r/2,o/(8*n*(Math.SQRT2-1)),e.chamferLimit??Number.POSITIVE_INFINITY),m=e.plateauLength??r,A=p*4+m,g=r,f=n*A+Math.max(0,n-1)*g,y=r/4;if(f+y*2>l+ai)return null;let x=4*p*(Math.SQRT2-1);if(o+ai<x*n)return null;let C=(o/n-x)/2,b=l-f-y*2,I=y+Math.max(0,b)*i,v=_2(t.start,u,I),P=[{...t.start},{...v}];for(let M=0;M<n;M++)if(v=_2(_2(v,u,p),_,p),P.push(v),v=_2(v,_,C),P.push(v),v=_2(_2(v,u,p),_,p),P.push(v),v=_2(v,u,m),P.push(v),v=_2(_2(v,u,p),_,-p),P.push(v),v=_2(v,_,-C),P.push(v),v=_2(_2(v,u,p),_,-p),P.push(v),M<n-1)v=_2(v,u,g),P.push(v);return P.push({...t.end}),P.filter((M,B)=>B===0||!fx(M,P[B-1]))}var pCn=class extends Error{};function sG(e){if(e&&e.remaining--<=0)throw new pCn}function*Lk(e){let{plan:t,bus:n,targetAddedLength:o,clearance:r,sharedBoundary:i,allowInsideDenseBounds:s=!1,allowSourcePrefixMatching:a=!1,denseBoundarySplitApplied:c=!1}=e,l=hCn(n),h=dCn(t.segments),d=t.segments[0]?.width?t.segments[0].width/2+r:r,u=t.segments.map((m,A)=>({segment:m,segmentIndex:A})).filter(({segment:m,segmentIndex:A})=>m.layer===t.targetLayer||e.allowTransitLayerMatching&&m.layer!==t.sourceLayer&&(n.allowedLayers??[t.targetLayer]).includes(m.layer)&&(n.routableEscapeLayers??n.allowedLayers??[t.targetLayer]).includes(m.layer)||a&&t.via&&t.sourceLayer!==t.targetLayer&&A>0&&A<(t.sourceEscapeSegmentCount??1)&&m.layer===t.sourceLayer).toSorted((m,A)=>Ut(A.segment.start,A.segment.end)-Ut(m.segment.start,m.segment.end));for(let{segment:m,segmentIndex:A}of u){let g=m.width+r,f=Ut(m.start,m.end),y=Math.min(12,Math.max(0,e.chamferLimit===void 0?Math.floor((f/g+0.5)/4):Math.floor((f+g/2)/(4*e.chamferLimit+(e.plateauLength??g)+g))));for(let x=1;x<=y;x++)for(let C of e.placementFractions??[0.5,0,1,0.25,0.75])for(let b of[1,-1]){sG(e.workBudget);let I=EYr({segment:m,toothCount:x,targetAddedLength:o,pitch:g,placementFraction:C,normalSign:b,plateauLength:e.plateauLength,chamferLimit:e.chamferLimit});if(!I)continue;if(I.some((B)=>!uCn(B,i)))continue;if(!s&&I.slice(1,-1).some((B)=>!lCn(B,l,d)))continue;let v=I.slice(1).map((B,T)=>({start:I[T],end:B,width:m.width,layer:m.layer})),P=[...t.segments.slice(0,A),...v,...t.segments.slice(A+1)];if(m.layer===t.sourceLayer&&m.layer!==t.targetLayer&&v.some((B)=>Wl(B,t.sourceObstacle)<B.width/2+r-ai))continue;if(h(P,A,v.length))continue;if(!Zst({plan:t,segments:P,replacementStartIndex:A,replacementSegmentCount:v.length,clearance:r}))continue;let M=Mv(t,P,a);if(M)yield M}}if(c)return;let _=t.segments.flatMap((m,A)=>a&&A===0?[m]:PYr({segment:m,bounds:l,margin:d})),p=Mv(t,_,a);if(!p)return;yield*Lk({...e,plan:p,denseBoundarySplitApplied:!0})}function*ZIe(e){let{plan:t,bus:n,targetAddedLength:o,clearance:r}=e,i=hCn(n);for(let s=0;s<t.segments.length;s++){let a=t.segments[s],c=a.layer===t.sourceLayer&&a.layer!==t.targetLayer;if(c){if(!e.allowSourcePrefixMatching||!t.via||s===0)continue}else if(a.layer!==t.targetLayer&&(!e.allowTransitLayerMatching||!(n.allowedLayers??[t.targetLayer]).includes(a.layer)||!(n.routableEscapeLayers??n.allowedLayers??[t.targetLayer]).includes(a.layer)))continue;let l=Ut(a.start,a.end);if(l<=ai)continue;let h={x:(a.end.x-a.start.x)/l,y:(a.end.y-a.start.y)/l};for(let d=s+2;d<Math.min(t.segments.length,s+16);d++){if(t.segments.slice(s,d+1).some((x)=>x.layer!==a.layer))break;let _=t.segments[d],p=Ut(_.start,_.end);if(p<=ai)continue;let m={x:(_.end.x-_.start.x)/p,y:(_.end.y-_.start.y)/p};if(Math.abs(h.x+m.x)>ai||Math.abs(h.y+m.y)>ai)continue;sG(e.workBudget);let A=(x)=>({...x,x:x.x+h.x*o/2,y:x.y+h.y*o/2}),g=t.segments.map((x,C)=>C<s||C>d?x:C===s?{...x,end:A(x.end)}:C===d?{...x,start:A(x.start)}:{...x,start:A(x.start),end:A(x.end)}),f=g.slice(s,d+1);if(f.some((x,C)=>{let b=s+C;return g.some((I,v)=>{if(Math.abs(b-v)<2)return!1;let P=Math.min(b,v),M=Math.max(b,v);if(M===P+2&&fx(g[P].end,g[M].start))return!1;return Urt(x,I)})}))continue;if(f.some((x)=>[x.start,x.end].some((C)=>!uCn(C,n.sharedBoundary)||!e.allowInsideDenseBounds&&!lCn(C,i,x.width/2+r))))continue;if(c&&f.some((x)=>Wl(x,t.sourceObstacle)<x.width/2+r-ai))continue;if(!Zst({plan:t,segments:g,replacementStartIndex:s,replacementSegmentCount:d-s+1,clearance:r}))continue;let y=Mv(t,g);if(y)yield y}}}function AP(e){let t=e.map((n)=>n.length);return Math.max(...t)-Math.min(...t)}function XY(e,t){return e.filter((n)=>t.has(n.connectionIndex))}function*MYr(e,t,n){let o=dCn(e.segments);for(let{segment:r,index:i}of e.segments.map((s,a)=>({segment:s,index:a})).filter(({segment:s})=>s.layer===e.targetLayer).toSorted((s,a)=>Ut(a.segment.start,a.segment.end)-Ut(s.segment.start,s.segment.end))){let s=Ut(r.start,r.end);if(s<=ai)continue;let a=Math.abs(r.end.x-r.start.x),c=Math.abs(r.end.y-r.start.y);if(a>ai&&c>ai&&Math.abs(a-c)>ai)continue;let l={x:(r.end.x-r.start.x)/s,y:(r.end.y-r.start.y)/s},h=r.width+t;for(let d of[2,3,4,6]){let u=h*d;if(s<2*u+h)continue;for(let _ of[1,-1]){sG(n);let p={x:-l.y*_,y:l.x*_},m=[r.start,_2(_2(r.start,l,u),p,u),_2(_2(r.end,l,-u),p,u),r.end],A=m.slice(1).map((y,x)=>({...r,start:m[x],end:y})),g=[...e.segments.slice(0,i),...A,...e.segments.slice(i+1)];if(o(g,i,A.length))continue;if(!Zst({plan:e,segments:g,replacementStartIndex:i,replacementSegmentCount:A.length,clearance:t}))continue;let f=Mv(e,g);if(f)yield f}}}}function yx(e){if(e.maximumWorkUnits!==void 0&&(!Number.isSafeInteger(e.maximumWorkUnits)||e.maximumWorkUnits<0))throw Error("maximumWorkUnits must be a non-negative safe integer");let t=e.maximumWorkUnits===void 0?void 0:{remaining:e.maximumWorkUnits},n=Xst(e.inputSrj),o=new Map;for(let i of e.plans){let s=o.get(i.connectionIndex)??[];s.push(i),o.set(i.connectionIndex,s)}e={...e,preparedBuses:e.preparedBuses.filter((i)=>i.maxLengthSkew!==void 0||i.connections.some((s)=>o.has(s.connectionIndex)))};for(let i of e.preparedBuses)if(i.connections.some((s)=>{let a=o.get(s.connectionIndex);return a?.length!==1||a[0].busId!==i.busId||a[0].connectionName!==s.connection.name||e.inputSrj.connections[s.connectionIndex]?.name!==s.connection.name}))return{plans:null,failedBus:i};let r=F8e({srj:e.inputSrj,sharedBoundary:e.sharedBoundary,clearance:e.clearance,allowBlindAndBuriedVias:e.allowBlindAndBuriedVias,allowSameNetMerges:e.allowSameNetMerges});try{let i=eat(e,r,t);return i.plans?wYr(e,i.plans,n,r,t):i}catch(i){if(i instanceof pCn&&t?.activeBus)return{plans:null,failedBus:e.preparedBuses.find((s)=>s.busId===t.activeBus.busId)??t.activeBus};throw i}}function Pfn({plans:e,connectionIndex:t,connectionName:n}){let o=e.filter((s)=>s.connectionIndex===t),r=o[0];if(o.length!==1||!r||r.connectionName!==n||!Number.isFinite(r.length))throw Error(`Differential-pair matching cannot resolve exactly one original plan for ${n}`);let i=[...r.segments,...r.planeEndpointSegments??[]].reduce((s,a)=>s+Ut(a.start,a.end),0);if(!Number.isFinite(i)||Math.abs(i-r.length)>ai)throw Error(`Differential-pair matching found inconsistent copper length for ${r.connectionName}`);return r}function e9e({plans:e,pair:t}){return[Pfn({plans:e,connectionIndex:t.connectionIndices[0],connectionName:t.connectionNames[0]}),Pfn({plans:e,connectionIndex:t.connectionIndices[1],connectionName:t.connectionNames[1]})]}function wYr(e,t,n,o,r){let i=new Map(e.preparedBuses.flatMap((d)=>d.connections.map((u)=>[u.connectionIndex,{bus:d,connection:u}]))),s=n.filter((d)=>d.connectionIndices.some((u)=>i.has(u)));if(!s.length)return{plans:t};let a=e.preparedBuses.map((d)=>({bus:d,indices:new Set(d.connections.map((u)=>u.connectionIndex))})),c=t,l=(d)=>a.every(({bus:u,indices:_})=>{if(u.maxLengthSkew===void 0)return!0;let p=XY(d,_);return p.length===u.connections.length&&AP(p)<=u.maxLengthSkew+ai});for(let d=0;d<=s.length;d++){for(let u of s){let _=e9e({plans:c,pair:u});if(AP(_)<=u.lengthTolerance+ai)continue;let p=u.connectionIndices.map((C)=>i.get(C)),m=p.find((C)=>C).bus;if(p.some((C)=>!C))return{plans:null,failedBus:m};let A=_[0].length<=_[1].length?0:1,g=p[A].bus,f={...g,connections:p.map((C)=>C.connection),maxLengthSkew:u.lengthTolerance},y=Math.max(..._.map((C)=>C.length)),x=eat({...e,plans:c,preparedBuses:[f],unroutedSourceBuses:void 0,allowUnconstrainedLaneRerouting:!1,allowPairLaneSpreading:p[0].bus===p[1].bus&&e.allowPairLaneSpreading,candidatePlansAreFeasible:(C)=>l(C)&&e9e({plans:C,pair:u}).every((b)=>b.length<=y+ai)&&(!e.candidatePlansAreFeasible||e.candidatePlansAreFeasible(C))},o,r);if(!x.plans)return{plans:null,failedBus:g};c=x.plans}if(s.every((u)=>AP(e9e({plans:c,pair:u}))<=u.lengthTolerance+ai)){if(!l(c))return{plans:null,failedBus:a.find(({bus:u,indices:_})=>u.maxLengthSkew!==void 0&&AP(XY(c,_))>u.maxLengthSkew+ai).bus};return{plans:c}}}return{plans:null,failedBus:s.find((d)=>AP(e9e({plans:c,pair:d}))>d.lengthTolerance+ai).connectionIndices.map((d)=>i.get(d)?.bus).find((d)=>d)}}function eat(e,t,n){let{preparedBuses:o,inputSrj:r,sharedBoundary:i,clearance:s,allowBlindAndBuriedVias:a=!0,allowSameNetMerges:c=!1,allowMatchingInsideDenseBounds:l=!1,candidatePlansAreFeasible:h}=e,d=(A)=>(sG(n),t(A)),u=[...e.plans],_=0,p=new Set(e.unroutedSourceBuses?.flatMap((A)=>A.connections.map((g)=>g.connectionIndex))),m=o.filter((A)=>A.maxLengthSkew!==void 0&&A.connections.length>1);if(m.length===0)return{plans:u};for(let A of m){let g=new Set(A.connections.map((C)=>C.connectionIndex));if(n)n.activeBus=A;if(A.termination.type!=="boundary")return{plans:null,failedBus:A};let f=A.connections.length*(e.allowDistributedMatching?24:2),y=new Set;for(let C=0;C<f;C++){let b=XY(u,g);if(b.length!==A.connections.length)return{plans:null,failedBus:A};let I=A.maxLengthSkew,v=AP(b);if(v<=I+ai)break;let P=b.filter((V)=>!y.has(V.connectionIndex)).toSorted((V,O)=>V.length-O.length||V.connectionName.localeCompare(O.connectionName))[0],M=Math.max(...b.map((V)=>V.length));if(!P||M-P.length<=I+ai)return{plans:null,failedBus:A};let B=M-P.length,T=Math.max(ai,B-I+ai),N=[T,T+I*0.1,B-I*0.5,B-I*0.75,B,B+I].filter((V,O,U)=>V>ai&&U.findIndex((j)=>Math.abs(j-V)<ai)===O).toSorted((V,O)=>V-O),D=null,L=(V)=>{let O=u.map((j)=>j===P?V:j),U=XY(O,g);if(AP(U)>v+ai)return null;if(!d(O))return null;if(h&&!h(O))return null;return O};if(e.allowMultiSegmentTuningWindows){let V=Math.max(P.length+T,...Xst(r).filter((O)=>O.connectionIndices.includes(P.connectionIndex)).flatMap((O)=>O.connectionIndices.filter((U)=>U!==P.connectionIndex).flatMap((U)=>{let j=u.find((Y)=>Y.connectionIndex===U);return j?[j.length-O.lengthTolerance+ai]:[]})));for(let O of QVr({plan:P,bus:A,inputSrj:r,plans:u,layerNames:rT(r.layerCount),clearance:s,consumeWork:()=>sG(n)})){let U={...P,additionalVias:[...P.additionalVias??[],...O.addedVias]},j=(re)=>Mv(U,[...O.before,...re,...O.after]),Y=(re,Z)=>{let te=A.sharedBoundary;for(let[le,ue]of Z.entries()){let de=ue.end.x-ue.start.x,me=ue.end.y-ue.start.y;if(Math.min(Math.abs(de),Math.abs(me),Math.abs(Math.abs(de)-Math.abs(me)))>0.0000001)return!1;if([ue.start,ue.end].some((xe)=>xe.x<=te.minX+0.0000001||xe.x>=te.maxX-0.0000001||xe.y<=te.minY+0.0000001||xe.y>=te.maxY-0.0000001))return!1;let Ae=Z[le+1];if(Ae){let xe=Ae.end.x-Ae.start.x,Me=Ae.end.y-Ae.start.y;if((de*xe+me*Me)/(Math.hypot(de,me)*Math.hypot(xe,Me))<Math.SQRT1_2-0.0000001)return!1}if(r.obstacles.some((xe)=>xe.layers.includes(ue.layer)&&Wl(ue,xe)<ue.width/2+s-0.000000001))return!1}let ie=new Set(Z.map((le,ue)=>O.before.length+ue));return Fve(re,O.addedVias,s)&&VZ(re,re.segments,s,ie)},X=j(O.window);if(!X||!Y(X,O.window)||!d(u.map((re)=>re===P?X:re)))continue;let K={...X,targetLayer:O.tuningLayer,segments:O.window},J=V-X.length,ee={plan:K,bus:A,targetAddedLength:J,clearance:s,sharedBoundary:A.sharedBoundary,allowInsideDenseBounds:l,workBudget:n},se=O.window[0].width+s,ne=[ZIe(ee),...[1,2,4,8].map((re)=>Lk({...ee,plateauLength:se*re,chamferLimit:se/4,placementFractions:[0.5,0,1,0.25,0.75,0.1,0.9]}))];for(let re of ne){for(let Z of re){let te=j(Z.segments);if(!te||!Y(te,Z.segments))continue;if(D=L(te),D)break}if(D)break}if(D)break}}let H=(V)=>{let j=0,Y=(K)=>{if(K.length<=48)return[...K];return Array.from({length:48},(J,ee)=>K[Math.floor(ee*K.length/48)])},X=(K,J)=>{sG(n);let ee=K.length-P.length,se=V-ee;if(se<=ai)return L(K);if(J<=0)return null;let ne=se/J,re=Y([...Lk({plan:K,bus:A,targetAddedLength:ne,clearance:s,sharedBoundary:A.sharedBoundary,allowInsideDenseBounds:l,allowSourcePrefixMatching:e.allowSourcePrefixMatching,allowTransitLayerMatching:e.allowTransitLayerMatching,workBudget:n})]);for(let Z of re){if(j++,j>320)return null;if(!L(Z))continue;let te=X(Z,J-1);if(te)return te}return null};for(let K=2;K<=8;K++){let J=X(P,K);if(J)return J;if(j>320)break}return null};for(let V of N){if(D)break;if(e.allowDistributedMatching){for(let U of ZIe({plan:P,bus:A,targetAddedLength:V,clearance:s,allowInsideDenseBounds:l,allowSourcePrefixMatching:e.allowSourcePrefixMatching,allowTransitLayerMatching:e.allowTransitLayerMatching,workBudget:n}))if(D=L(U),D)break;if(D)break}let O=Lk({plan:P,bus:A,targetAddedLength:V,clearance:s,sharedBoundary:A.sharedBoundary,allowInsideDenseBounds:l,allowSourcePrefixMatching:e.allowSourcePrefixMatching,allowTransitLayerMatching:e.allowTransitLayerMatching,workBudget:n});for(let U of O){if(D=L(U),!D)continue;break}if(!D&&Math.abs(V-T)<=ai){if(e.allowDistributedMatching)for(let U of[V/2,V/4,Math.min(V,1),Math.min(V,0.5),Math.min(V,0.25),Math.min(V,0.1)]){if(U<=ai)continue;let j={plan:P,bus:A,targetAddedLength:U,clearance:s,sharedBoundary:A.sharedBoundary,allowInsideDenseBounds:l,allowSourcePrefixMatching:e.allowSourcePrefixMatching,allowTransitLayerMatching:e.allowTransitLayerMatching,workBudget:n};for(let Y of[ZIe(j),Lk(j)]){for(let X of Y)if(D=L(X),D)break;if(D)break}if(D)break}if(!D)D=H(V)}if(D)break}if(!D&&e.allowAdditionalMatchingVias)for(let V of SYr({plan:P,bus:A,layerNames:rT(r.layerCount),clearance:s,workBudget:n})){if(!d(u.map((U)=>U===P?V.plan:U)))continue;let O={plan:{...V.plan,targetLayer:V.tuningLayer},bus:A,targetAddedLength:T,clearance:s,sharedBoundary:A.sharedBoundary,allowInsideDenseBounds:l,workBudget:n};for(let U of[ZIe(O),Lk(O)]){for(let j of U){if(!Fve(j,V.addedVias,s))continue;if(D=L({...j,targetLayer:P.targetLayer}),D)break}if(D)break}if(D)break}if(!D&&e.allowPairLaneSpreading&&A.connections.length===2){let V=b.find((U)=>U!==P),O=0;for(let U of MYr(V,s,n)){let j=u.map((X)=>X===V?U:X);if(!d(j))continue;if(h&&!h(j))continue;let Y=eat({...e,plans:j,preparedBuses:[A],allowPairLaneSpreading:!1},t,n);if(Y.plans){D=Y.plans;break}if(++O>=4)break}}if(!D&&e.allowUnconstrainedLaneRerouting){let V=0;e:for(let O of N){let U=Lk({plan:P,bus:A,targetAddedLength:O,clearance:s,sharedBoundary:A.sharedBoundary,allowInsideDenseBounds:l,allowSourcePrefixMatching:e.allowSourcePrefixMatching,allowTransitLayerMatching:e.allowTransitLayerMatching,workBudget:n});for(let j of U){if(!d([j]))continue;let Y=u.filter((ee)=>ee!==P&&!t.mutuallyClear([j,ee]));if(Y.length!==1)continue;let X=Y[0],K=o.find((ee)=>ee.busId===X.busId);if(!K||K.termination.type!=="boundary"||K.maxLengthSkew!==void 0||K.connections.length!==1||!X.via||X.additionalVias?.length||X.planeEndpointVia||X.segments.filter((ee)=>ee.layer===X.sourceLayer).length!==1)continue;let J=u.map((ee)=>ee===P?j:ee);for(let ee of[!0,!1]){if(V++>=4)break e;let se=rCn({srj:r,bus:K,terminals:[{connection:K.connections[0],viaPoint:X.via.center,exitPoint:X.exitPoint}],targetLayer:X.targetLayer,acceptedPlans:J.filter((Z)=>Z!==X),layerNames:rT(r.layerCount),traceWidth:X.segments[0].width,viaDiameter:X.via.diameter,viaHoleDiameter:X.via.holeDiameter,clearance:s,allowBlindAndBuriedVias:a,allowSameNetMerges:c,gridStepDivisor:2,alignGridToPads:ee,maximumRouteOrderAttempts:1,preferTargetDirectedLaneBias:!0})?.[0];if(!se)continue;let ne=Mv(X,[X.segments[0],...se.segments.slice(1)]);if(!ne)continue;let re=J.map((Z)=>Z===X?ne:Z);if(AP(XY(re,g))>I+ai||!d(re)||h&&!h(re))continue;D=re;break e}}}}if(!D&&e.unroutedSourceBuses?.length)e:for(let V of N)for(let O of Lk({plan:P,bus:A,targetAddedLength:V,clearance:s,sharedBoundary:A.sharedBoundary,allowInsideDenseBounds:l,allowSourcePrefixMatching:e.allowSourcePrefixMatching,allowTransitLayerMatching:e.allowTransitLayerMatching,workBudget:n})){if(_>=4)break e;if(!d([O]))continue;let U=u.filter((Y)=>Y!==P&&!t.mutuallyClear([O,Y]));if(U.length!==1||!p.has(U[0].connectionIndex))continue;_++;let j=IYr({inputSrj:r,plans:u.map((Y)=>Y===P?O:Y),unroutedSourceBuses:e.unroutedSourceBuses,clearance:s});if(!j||AP(XY(j,g))>v+ai||!d(j)||h&&!h(j))continue;D=j;break e}if(!D){if(e.allowDistributedMatching){y.add(P.connectionIndex);continue}return{plans:null,failedBus:A}}u=D}let x=XY(u,g);if(AP(x)>A.maxLengthSkew+ai)return{plans:null,failedBus:A}}return{plans:u}}function mCn(e){let{points:t,topZ:n,traceWidth:o,viaDiameter:r,clearance:i}=e,s=[],a=[],c=0;for(let h=0;h+1<t.length;h++){let d=t[h],u=t[h+1];if(d.z!==u.z){if(Ut(d,u)>0.0000001)return!1;a.push({center:d,fromZ:d.z,toZ:u.z,edge:h}),c++}else if(Ut(d,u)>0.000000001)s.push({a:d,b:u,z:d.z,edge:h,run:c})}let l=s.filter((h)=>h.z===n);for(let h=0;h<l.length;h++)for(let d=h+1;d<l.length;d++){let u=l[h],_=l[d];if(u.run!==_.run&&ad(u.a,u.b,_.a,_.b)<o+i-0.000000001)return!1}for(let h=0;h<a.length;h++){let d=a[h];for(let p=h+1;p<a.length;p++)if(Ut(d.center,a[p].center)<r+i-0.000000001)return!1;let u=(r+o)/2+i,_=new Set;for(let p of[-1,1]){let m=d.center,A=0,g=p===-1?d.fromZ:d.toZ;for(let f=d.edge+p;f>=0&&f+1<t.length;f+=p){let y=t[f],x=t[f+1],C=p===-1?x:y,b=p===-1?y:x;if(y.z!==g||x.z!==g||Ut(m,C)>0.0000001||A>u+0.0000001)break;_.add(f),A+=Ut(C,b),m=b}}for(let p of s)if(!_.has(p.edge)&&Vr(d.center,p.a,p.b)<u-0.000000001)return!1}return!0}var Zg=0.0000001,eot=180;function BYr(e,t){let n=t.x-e.x,o=t.y-e.y,r=Math.min(Math.abs(n),Math.abs(o));if(Math.abs(n)<Zg||Math.abs(o)<Zg||Math.abs(Math.abs(n)-Math.abs(o))<Zg)return[[e,t]];return[[e,{x:e.x+Math.sign(n)*r,y:e.y+Math.sign(o)*r,z:e.z},t],[e,{x:t.x-Math.sign(n)*r,y:t.y-Math.sign(o)*r,z:e.z},t],[e,{x:e.x,y:t.y,z:e.z},t],[e,{x:t.x,y:e.y,z:e.z},t]]}function TYr(e,t,n){if(e.length<3)return e;let o=e.length,r=o<=eot?e.map((l,h)=>h):[...new Set([0,...Array.from({length:eot-2},(l,h)=>Math.round((h+1)*(o-1)/(eot-1))),o-1])],i=new Float64Array(o).fill(1/0),s=Array(o);i[0]=0;for(let l=1;l<r.length;l++){let h=r[l];for(let d=0;d<l;d++){let u=r[d],_=e[u],p=e[h],m=Math.abs(p.x-_.x),A=Math.abs(p.y-_.y),g=Math.max(m,A)+(Math.SQRT2-1)*Math.min(m,A);if(i[u]+g>=i[h]-Zg)continue;for(let f of BYr(_,p)){let y=f.slice(1).reduce((x,C,b)=>x+Ut(f[b],C),0);if(i[u]+y>=i[h]-Zg||!f.slice(1).every((x,C)=>n(f[C],x)))continue;i[h]=i[u]+y,s[h]={previous:u,points:f}}}if(!s[h]){let d=r[l-1],u=e.slice(d,h+1);i[h]=i[d]+u.slice(1).reduce((_,p,m)=>_+Ut(u[m],p),0),s[h]={previous:d,points:u}}}let a=[];for(let l=o-1;l>0;){let h=s[l];if(!h)throw Error("FanoutSolver: shortcut graph lost a retained path");a.unshift(h.points),l=h.previous}let c=a.flatMap((l,h)=>h?l.slice(1):l);return pG({points:c,chamfer:t/4,segmentIsClear:n})??e}function Efn(e,t,n){if(e.x<t.minX-Zg||e.x>t.maxX+Zg||e.y<t.minY-Zg||e.y>t.maxY+Zg)return!1;return!(Math.abs(e.x-t.minX)<Zg||Math.abs(e.x-t.maxX)<Zg||Math.abs(e.y-t.minY)<Zg||Math.abs(e.y-t.maxY)<Zg)||Ut(e,n)<Zg}function hZ(e){let{inputSrj:t,preparedBuses:n,layerNames:o,clearance:r,allowBlindAndBuriedVias:i=!0,allowSameNetMerges:s=!1}=e,a=new Map(n.map((u)=>[u.busId,u])),c=new Map(n.map((u)=>[u.busId,Math.min(...e.plans.filter((_)=>_.busId===u.busId).map((_)=>_.length))])),l=WP(t,i),h=[...e.plans];for(let u=0;u<3;u++){let _=!1;for(let p of h.toSorted((m,A)=>A.length-m.length)){let m=a.get(p.busId),A=c.get(p.busId);if(!m||A===void 0||!Number.isFinite(A)||m.maxLengthSkew===void 0||p.termination.type!=="boundary"||p.length<=A+m.maxLengthSkew+Zg)continue;if(e.selectedBusIds&&!e.selectedBusIds.has(p.busId))continue;if(e.selectedConnectionIndices&&!e.selectedConnectionIndices.has(p.connectionIndex))continue;let g=p.trace.route.findIndex((D)=>D.route_type==="via");if(g<0)continue;let f=(D)=>D===p.connectionName||s&&Y5(t,D,p.connectionName),y=h.filter((D)=>D.connectionIndex!==p.connectionIndex&&!f(D.connectionName)),x=l.filter((D)=>!f(D.connectionName)),C=new Jue([...y.flatMap((D)=>[...D.segments,...D.planeEndpointSegments??[]]),...x.flatMap((D)=>D.segments)]),b=[...y.flatMap((D)=>[D.via,...D.additionalVias??[],D.planeEndpointVia].filter((L)=>!!L)),...x.flatMap((D)=>D.vias)],I=t.obstacles.filter((D)=>!(s&&P6(t,D,p.connectionName))),v=g+1;if(e.allowSourcePrefixShortcuts){v=1;while(v<g){let D=p.trace.route[v];if(D.route_type==="wire"&&X5(D,p.sourceObstacle)>=D.width/2+r-0.000000001)break;v++}}let P=p.trace.route.slice(0,v),M=v;while(M<p.trace.route.length){let D=p.trace.route[M];if(D.route_type!=="wire"){P.push(D),M++;continue}let L=M+1;while(L<p.trace.route.length){let J=p.trace.route[L];if(J.route_type!=="wire"||J.layer!==D.layer)break;L++}let H=p.trace.route.slice(M,L),V=o.indexOf(D.layer);if(V<0)throw Error(`FanoutSolver: shortcut uses unknown layer ${D.layer}`);let O=H.map((J)=>({x:J.x,y:J.y,z:V})),U=Math.max(...H.map((J)=>J.width)),j=P.at(-1),Y=(J,ee)=>{let se={start:J,end:ee,layer:D.layer,width:U};return Efn(J,m.sharedBoundary,p.exitPoint)&&Efn(ee,m.sharedBoundary,p.exitPoint)&&I.every((ne)=>!ne.layers.includes(D.layer)||M<g&&ne===p.sourceObstacle&&j?.route_type==="wire"&&Vr(J,j,O[0])<Zg&&Vr(ee,j,O[0])<Zg||Wl(se,ne)>=U/2+r-0.000000001)&&C.querySegment(se,r).every((ne)=>V_(se,ne,r))&&b.every((ne)=>!ne.spanLayers.includes(D.layer)||Vr(ne.center,J,ee)>=(U+ne.diameter)/2+r-0.000000001)},X=TYr(O,U,Y),K;if(M<g&&j?.route_type==="wire"&&j.layer===D.layer){let J=pG({points:[{x:j.x,y:j.y,z:V},...X],chamfer:U/4,segmentIsClear:Y});if(J)P.pop(),K=j,X=J;else X=O}P.push(...X.map((J,ee)=>({...ee===0?K:void 0,route_type:"wire",x:J.x,y:J.y,layer:D.layer,width:U}))),M=L}let B={...p.trace,route:P},T=L8e(t,B,i).segments,N={...p,trace:B,segments:T,...e.allowSourcePrefixShortcuts?{sourceEscapeSegmentCount:T.findIndex((D)=>D.layer!==p.sourceLayer)}:{},length:T.reduce((D,L)=>D+Ut(L.start,L.end),0)};if(N.length<A-Zg||N.length>=p.length-Zg)continue;if(e.allowSourcePrefixShortcuts&&!mCn({points:B.route.flatMap((D)=>D.route_type==="wire"?[{x:D.x,y:D.y,z:o.indexOf(D.layer)}]:[]),topZ:o.indexOf(p.sourceLayer),traceWidth:e.traceWidth,viaDiameter:p.via.diameter,clearance:r}))continue;if(!wp({plans:[N],srj:{...t,traces:[...t.traces??[],...y.flatMap((D)=>[D.trace,...D.planeEndpointTrace?[D.planeEndpointTrace]:[]])]},sharedBoundary:m.sharedBoundary,clearance:r,allowBlindAndBuriedVias:i,allowSameNetMerges:s}))continue;h=h.map((D)=>D===p?N:D),_=!0}if(!_)break}return lu({inputSrj:t,routedSrj:{...t,traces:[...t.traces??[],...h.flatMap((u)=>[u.trace,...u.planeEndpointTrace?[u.planeEndpointTrace]:[]])]},clearance:r,allowBlindAndBuriedVias:i}).valid?h:null}function DYr(e,t,n,o,r,i,s){if(s&&n==="top"&&Wl({start:e,end:e,width:o,layer:n},i)<o/2+r-0.000000001&&Ut(t,s.sourcePoint)>=Ut(e,s.sourcePoint)-0.000000001)return s.connectionName;return}function NYr(e){let t=new Int32Array(e.planeSize+1),n=[],o=[];for(let r=0;r<e.planeSize;r++){t[r]=n.length;let i=new Set;for(let l=e.neighborOffset[r];l<e.neighborOffset[r+1];l++){let h=e.neighborIds[l];i.add(h),n.push(h),o.push(e.neighborCosts[l])}let s=new Set,a=e.cellMaxX[r]-e.cellMinX[r],c=e.cellMaxY[r]-e.cellMinY[r];for(let l=e.neighborOffset[r];l<e.neighborOffset[r+1];l++){let h=e.neighborIds[l];for(let d=e.neighborOffset[h];d<e.neighborOffset[h+1];d++){let u=e.neighborIds[d];if(u===r||i.has(u))continue;let _=Math.abs(e.cellCenterX[u]-e.cellCenterX[r]),p=Math.abs(e.cellCenterY[u]-e.cellCenterY[r]);if(_<0.000000001||Math.abs(_-p)>0.000000001||Math.abs(_-a)>0.000000001||Math.abs(p-c)>0.000000001||Math.abs(e.cellMaxX[u]-e.cellMinX[u]-a)>0.000000001||Math.abs(e.cellMaxY[u]-e.cellMinY[u]-c)>0.000000001)continue;s.add(u)}}for(let l of[...s].sort((h,d)=>h-d))n.push(l),o.push(Math.hypot(e.cellCenterX[l]-e.cellCenterX[r],e.cellCenterY[l]-e.cellCenterY[r]))}return t[e.planeSize]=n.length,{neighborOffset:t,neighborIds:Int32Array.from(n),neighborCosts:Float32Array.from(o)}}function RYr(e){let{edge:t,bounds:n,exit:o,approachLength:r}=e;if(!["left","right","top","bottom"].includes(t))throw Error("Terminal approach requires a valid boundary edge");if(!Number.isFinite(r)||r<=0)throw Error("terminalApproachLength must be finite and positive");let i=t==="left"||t==="right",s=t==="left"?n.minX:t==="right"?n.maxX:t==="bottom"?n.minY:n.maxY,a=t==="left"||t==="bottom"?-1:1,c=i?{x:o.x-a*r,y:o.y}:{x:o.x,y:o.y-a*r};if(![o.x,o.y,c.x,c.y,n.minX,n.maxX,n.minY,n.maxY].every(Number.isFinite)||Math.abs((i?o.x:o.y)-s)>0.0000001||c.x<=n.minX||c.x>=n.maxX||c.y<=n.minY||c.y>=n.maxY)throw Error("Terminal approach must end on its shared edge and start inside it");return{connectionName:e.connectionName,edge:t,layer:e.layer,exit:{...o},goal:c}}function V8e(e,t){let{goal:n,edge:o}=t,r=o==="left"||o==="right",i=o==="left"||o==="bottom"?-1:1,s=r?n.x-e.x:n.y-e.y,a=r?n.y-e.y:n.x-e.x,c=i*s;if(c<Math.abs(a)-0.000000001){if(c<=0.000000001)return null;let h=r?{x:e.x,y:n.y-Math.sign(a)*c}:{x:n.x-Math.sign(a)*c,y:e.y};return[e,h,n]}let l=r?{x:e.x+i*Math.abs(a),y:n.y}:{x:n.x,y:e.y+i*Math.abs(a)};return[e,l,n].filter((h,d,u)=>d===0||Ut(h,u[d-1])>0.0000000001)}var QYr=(e,t,n=t)=>e.some((o)=>Math.max(t.x,n.x)>=o.minX&&Math.min(t.x,n.x)<=o.maxX&&Math.max(t.y,n.y)>=o.minY&&Math.min(t.y,n.y)<=o.maxY);function _Cn(e,t,n){let o=[],r=0;for(let[c,l]of e.entries()){if(l.layer===n&&Vr(t,l.start,l.end)<0.00000001){let h=r+Ut(l.start,t);if(!o.some((d)=>Math.abs(d.offset-h)<0.00000001))o.push({index:c,offset:h})}r+=Ut(l.start,l.end)}if(o.length!==1)return null;let i=o[0].index,s=e[i],a=[...e];if(Ut(t,s.end)<0.00000001)i++;else if(Ut(t,s.start)>0.00000001)a.splice(i,1,{...s,end:t},{...s,start:t}),i++;if(i>=a.length)return null;return{segments:a,changed:new Set(a.slice(i).map((c,l)=>i+l))}}function Wrt(e){let{plan:t,splice:n,clearance:o,maximumJoinLength:r}=e,{rawSegments:i,firstEntrySegmentIndex:s}=n;if(!Number.isInteger(s)||s<0||s>=i.length||!Number.isFinite(r)||r<0)return!1;let a=(u,_,p=u)=>{let m={...t,segments:[...u]},A=[t.via,...t.additionalVias??[],t.planeEndpointVia].filter((g)=>!!g).filter((g)=>[..._].some((f)=>{let y=u[f];return g.spanLayers.includes(y.layer)&&Vr(g.center,y.start,y.end)<(g.diameter+y.width)/2+o+0.0000001}));return Fve({...m,segments:[...p]},A,o)&&VZ(m,u,o,_)};if(!a(i,new Set(i.slice(s).map((u,_)=>s+_))))return!1;let c=i[s],l=i[s-1],h=c.start;if(l?.layer===c.layer&&Ut(l.end,h)<0.00000001){let u=l.start;for(let m=s-2;m>=0;m--){let A=i[m];if(A.layer!==l.layer||Ut(A.end,u)>0.00000001)break;let g=u.x-A.start.x,f=u.y-A.start.y,y=h.x-u.x,x=h.y-u.y;if(Math.abs(g*x-f*y)>=0.0000000001||g*y+f*x<0)break;u=A.start}let _=Ut(u,h);if(_<0.0000000001)return!1;let p=Math.min(r,_/3);h={x:h.x+(u.x-h.x)*p/_,y:h.y+(u.y-h.y)*p/_}}let d=_Cn(t.segments,h,c.layer);return!!d&&a(d.segments,d.changed,t.segments)}function*kYr(e){let{splice:t,connector:n,clearance:o}=e,r=t.firstEntrySegmentIndex,i=t.rawSegments[r];if(!i||i.layer!==n.layer)return;let s=4*(i.width+o),a=0;for(let c=r;c>=Math.max(0,r-16);c--){let l=t.rawSegments[c];if(l.layer!==n.layer||c<r&&Ut(l.end,t.rawSegments[c+1].start)>0.0000001)break;if(c<r)a+=Ut(l.start,l.end);if(a>s+0.0000001)break;let h=l.start,{goal:d,exit:u,edge:_}=n,p=_==="left"||_==="right",m=_==="left"||_==="bottom"?-1:1,A=m*(p?d.x-h.x:d.y-h.y),g=Math.abs(p?d.y-h.y:d.x-h.x),f=[];if(c<r){let y=V8e(h,n);if(y)f.push(y)}if(A>=g-0.000000001){let y=p?{x:d.x-m*g,y:h.y}:{x:h.x,y:d.y-m*g};f.push([h,y,d])}for(let y of f){let x=[...y,u].filter((C,b,I)=>b===0||Ut(C,I[b-1])>0.0000000001);yield{replacement:x.slice(1).map((C,b)=>({...l,start:x[b],end:C})),firstEntrySegmentIndex:c}}}}function LYr(e){let t=[...e.plans],n=new Map(e.splices);for(let[o,r]of t.entries()){let i=e.connectors.get(r.connectionName);if(!i)continue;let s=n.get(r.connectionName);if(!s)return null;if(Wrt({plan:r,splice:s,maximumJoinLength:0,clearance:e.clearance}))continue;let a=t.filter((l)=>l.connectionIndex!==r.connectionIndex),c=!1;for(let{replacement:l,firstEntrySegmentIndex:h}of kYr({splice:s,connector:i,clearance:e.clearance})){let d=l[0],u=_Cn(r.segments,d.start,d.layer);if(!u)continue;let _=Math.min(...u.changed),p=[...u.segments.slice(0,_),...l],m=Mv(r,p);if(!m)continue;let A={rawSegments:[...s.rawSegments.slice(0,h),...l],firstEntrySegmentIndex:h};if(!Wrt({plan:m,splice:A,maximumJoinLength:0,clearance:e.clearance}))continue;if(l.some((g)=>!e.segmentIsClear(g,r.connectionName)||a.some((f)=>[...f.segments,...f.planeEndpointSegments??[]].some((y)=>!V_(g,y,e.clearance))||[f.via,...f.additionalVias??[],f.planeEndpointVia].filter((y)=>!!y).some((y)=>y.spanLayers.includes(g.layer)&&Vr(y.center,g.start,g.end)<(y.diameter+g.width)/2+e.clearance-0.000000001))))continue;t[o]=m,n.set(r.connectionName,A),c=!0;break}if(!c)return null}return{plans:t,splices:n}}function HYr(e){let{grid:t}=e;if(!Number.isFinite(e.margin)||e.margin<0)throw Error("Terminal connector margin must be finite and non-negative");let n=(l)=>({x:t.cellCenterX[l],y:t.cellCenterY[l]}),o=new Map,r=new Set,i=new Map;for(let{connector:l,cellId:h}of e.terminals){if(!Number.isInteger(h)||h<0||h>=t.planeSize)throw Error("Invalid native terminal cell");let d=new Set([h]);for(let m=t.neighborOffset[h];m<t.neighborOffset[h+1];m++){let A=t.neighborIds[m];d.add(A);for(let g=t.neighborOffset[A];g<t.neighborOffset[A+1];g++)d.add(t.neighborIds[g])}let u=[l.exit,l.goal,...[...d].map(n)],_={minX:Math.min(...u.map((m)=>m.x))-e.margin,maxX:Math.max(...u.map((m)=>m.x))+e.margin,minY:Math.min(...u.map((m)=>m.y))-e.margin,maxY:Math.max(...u.map((m)=>m.y))+e.margin},p=i.get(l.edge);i.set(l.edge,p?{minX:Math.min(p.minX,_.minX),maxX:Math.max(p.maxX,_.maxX),minY:Math.min(p.minY,_.minY),maxY:Math.max(p.maxY,_.maxY)}:_);for(let m of d){if(m===h)continue;let A=!1;for(let y=t.neighborOffset[m];y<t.neighborOffset[m+1];y++)if(t.neighborIds[y]===h)A=!0;if(A)continue;let g=V8e(n(m),l);if(!g||g.slice(1).some((y,x)=>!e.segmentIsClear(g[x],y,l)))continue;let f=o.get(m)??new Set;f.add(h),o.set(m,f),r.add(`${m}:${h}`)}}let s=new Int32Array(t.planeSize+1),a=[],c=[];for(let l=0;l<t.planeSize;l++){s[l]=a.length;for(let h=t.neighborOffset[l];h<t.neighborOffset[l+1];h++)a.push(t.neighborIds[h]),c.push(t.neighborCosts[h]);for(let h of o.get(l)??[])a.push(h),c.push(Ut(n(l),n(h)))}return s[t.planeSize]=a.length,{neighborOffset:s,neighborIds:Int32Array.from(a),neighborCosts:Float32Array.from(c),extendedEdges:r,regions:[...i.values()]}}function FYr(e,t,n){let o=e.route.at(-2),r=e.route.at(-1);if(!o||!r||Ut(r,t.goal)>0.0000001)throw Error("Native terminal route does not end at its reserved goal");let i=e.route.slice(0,-2),s=o;if(o.z!==r.z){if(Ut(o,n)>0.0000001)throw Error("Native terminal via has a noncoincident departure");i=[...i,o],s={...n,z:r.z}}let a=V8e(s,t);if(!a)throw Error("Native terminal route has no perpendicular entry");return{...e,route:[...i,...a.map((c)=>({...c,z:r.z})),{...t.exit,z:r.z}]}}var zYr=class{constructor(e){this.params=e,this.padding=Math.max(e.traceWidth,e.viaDiameter)+e.clearance,this.cellSize=Math.max(e.traceWidth+e.clearance,e.viaDiameter)}params;dirty=!0;buckets=new Map;cellSize;padding;invalidate(){this.dirty=!0}intersects(e,t=e){return QYr(this.params.regions,e,t)}cells(e,t,n,o){for(let r=Math.floor((Math.min(e.x,t.x)-n)/this.cellSize);r<=Math.floor((Math.max(e.x,t.x)+n)/this.cellSize);r++)for(let i=Math.floor((Math.min(e.y,t.y)-n)/this.cellSize);i<=Math.floor((Math.max(e.y,t.y)+n)/this.cellSize);i++)o(`${r},${i}`)}refresh(){if(!this.dirty)return;this.buckets.clear();let e=(t,n,o=n)=>{if(!this.intersects(n,o))return;this.cells(n,o,this.padding,(r)=>{let i=this.buckets.get(r)??new Set;i.add(t),this.buckets.set(r,i)})};for(let t of this.params.getRoutes()){for(let n=1;n<t.route.length;n++){let o=t.route[n-1],r=t.route[n];if(o.z===r.z)e({kind:"segment",owner:t.connectionName,a:o,b:r},o,r)}for(let n of t.vias)e({kind:"via",owner:t.connectionName,center:n},n)}this.dirty=!1}nearby(e,t=e){this.refresh();let n=new Set;return this.cells(e,t,0,(o)=>{for(let r of this.buckets.get(o)??[])n.add(r)}),n}blockingSegmentOwners(e,t,n){let o=new Set;for(let r=1;r<t.length;r++){let i=t[r-1],s=t[r];if(!this.intersects(i,s))continue;for(let a of this.nearby(i,s)){if(a.owner===e)continue;let c=a.kind==="via"?Vr(a.center,i,s):a.a.z===n?ad(i,s,a.a,a.b):1/0,l=(this.params.traceWidth+(a.kind==="via"?this.params.viaDiameter:this.params.traceWidth))/2+this.params.clearance;if(c<l-0.000000001)o.add(a.owner)}}return o}blockingViaOwners(e,t){let n=new Set;if(!this.intersects(t))return n;for(let o of this.nearby(t)){if(o.owner===e)continue;let r=o.kind==="via"?Ut(t,o.center):Vr(t,o.a,o.b),i=(this.params.viaDiameter+(o.kind==="via"?this.params.viaDiameter:this.params.traceWidth))/2+this.params.clearance;if(r<i-0.000000001)n.add(o.owner)}return n}};function OYr(e){if(typeof e.fillViaOccupants!=="function"||typeof e.pushFlatOccupants!=="function")throw Error("FanoutSolver: native via-occupant interface changed");let t=e.fillViaOccupants.bind(e),n=e.pushFlatOccupants.bind(e),o=new Map;e.fillViaOccupants=(r,i)=>{let s=o.get(r);if(s){let l=e._viaOccs;l.length=0;let{usedCellsFlat:h,sharedCellsFlat:d}=e;for(let u=0;u<s.length;u++){let _=s[u];if(h&&d&&h[_]===-1&&!d[_])continue;n(_,i,l)}return}let a=[],c=e.pushFlatOccupants;e.pushFlatOccupants=(l,h,d)=>{a.push(l),n(l,h,d)};try{t(r,i)}finally{e.pushFlatOccupants=c}o.set(r,Int32Array.from(a))}}var VYr=0.000000001;function Xrt(e){let{vias:t,activeConnectionIndices:n,traceWidth:o,clearance:r,gridStep:i}=e;for(let[u,_]of[["traceWidth",o],["gridStep",i]])if(!Number.isFinite(_)||_<=0)throw Error(`FanoutSolver: ${u} must be positive and finite`);if(!Number.isFinite(r)||r<0)throw Error("FanoutSolver: clearance must be non-negative and finite");for(let u of t)if(!Number.isSafeInteger(u.connectionIndex)||u.connectionIndex<0||!Number.isFinite(u.center.x)||!Number.isFinite(u.center.y)||!Number.isFinite(u.diameter)||u.diameter<=0)throw Error("FanoutSolver: invalid via channel grid site");let s=(u)=>(u%i+i)%i,a=(u)=>{let _=s(u+i/2)-i/2;return Math.abs(_)<Number.EPSILON?0:_},c=(o+r)/i,l=Math.ceil(c-Number.EPSILON*Math.max(1,Math.abs(c))*4),h=Number.EPSILON*Math.max(1,i)*32,d=(u)=>{let _=u==="x"?"y":"x",p=t.toSorted((C,b)=>C.center[_]-b.center[_]||C.center[u]-b.center[u]||C.connectionIndex-b.connectionIndex),m=[];for(let C of p){let b=m.at(-1);if(b&&Math.abs(b[0].center[_]-C.center[_])<=VYr)b.push(C);else m.push([C])}let A=[];for(let C of m){C.sort((b,I)=>b.center[u]-I.center[u]);for(let b=1;b<C.length;b++){let I=C[b-1],v=C[b],P=I.center[u]+I.diameter/2+o/2+r,M=v.center[u]-v.diameter/2-o/2-r-l*i;if(!Number.isFinite(P)||!Number.isFinite(M))throw Error("FanoutSolver: non-finite via channel bounds");if(M<P-h)continue;A.push({start:s(P),length:Math.max(0,M-P),active:n.has(I.connectionIndex)||n.has(v.connectionIndex)})}}let g=A.filter((C)=>C.length<i-h).flatMap((C)=>[C.start,s(C.start+C.length)]).sort((C,b)=>C-b).filter((C,b,I)=>b===0||C-I[b-1]>h);if(g.length===0)return 0;let f=(C)=>{let b=0,I=0;for(let v of A)if(v.length>=i-h||s(C-v.start)<=v.length+h){if(I++,v.active)b++}return[b,I]},y={active:-1,total:-1,width:0,phase:0},x=(C,b)=>{C=a(C);let[I,v]=f(C);if(I>y.active||I===y.active&&(v>y.total||v===y.total&&(b>y.width+h||Math.abs(b-y.width)<=h&&(Math.abs(C)<Math.abs(y.phase)-h||Math.abs(Math.abs(C)-Math.abs(y.phase))<=h&&C<y.phase))))y={active:I,total:v,width:b,phase:C}};for(let C=0;C<g.length;C++){let b=g[C],I=g[C+1]??g[0]+i;if(I-b>h)x((b+I)/2,I-b)}if(y.total===0)for(let C of g)x(C,0);return y.phase};return{x:d("x"),y:d("y")}}var YYr=class{constructor(e,t,n,o){this.planeSize=e,this.neighborOffset=n,this.neighborIds=o,this.layerStride=o.length+e,this.classes=new Uint32Array(this.layerStride*t)}planeSize;neighborOffset;neighborIds;classes;layerStride;values=[void 0,!0,!1];ownerIds=new Map;overflow=new Map;getSlot(e,t){let n=e<this.planeSize?e:e%this.planeSize,o=e<this.planeSize?0:(e-n)/this.planeSize*this.layerStride;if(t===n)return o+this.neighborIds.length+n;let r=this.neighborOffset[n+1];for(let i=this.neighborOffset[n];i<r;i++)if(this.neighborIds[i]===t)return o+i;return-1}get(e,t,n=!1){if(n)return;let o=this.getSlot(e,t);return o<0?this.overflow.get(e*this.planeSize+t):this.values[this.classes[o]]}set(e,t,n,o=!1){if(o)return;let r=this.getSlot(e,t);if(r<0){this.overflow.set(e*this.planeSize+t,n);return}let i=n===!0?1:n===!1?2:this.ownerIds.get(n);if(i===void 0)i=this.values.length,this.values.push(n),this.ownerIds.set(n,i);this.classes[r]=i}};function GYr(e,t,n,o){let r=e.planeSize*e.layers;e.visitedStamp=new Uint32Array(r*3),e.bestGStamp=new Uint32Array(r*3),e.bestGValue=new Float64Array(r*3);let i=new Uint8Array(1024),s=new Int32Array(1024),a=0,c=-1,l=-1,h=-1,d=0,u=()=>t[e.activeConnId]===!0,_=(g,f,y,x,C)=>g===0&&f===n&&x!==n?1:g===1&&f!==n&&f===x&&y!==C?2:g,p=e.nodePool.push.bind(e.nodePool);e.nodePool.push=(g,f,y,x,C,b)=>{let I=p(g,f,y,x,C,b);if(I>=i.length){let v=Math.max(I+1,i.length*2),P=new Uint8Array(v),M=new Int32Array(v);P.set(i),M.set(s),i=P,s=M}if(x<0||!u()){i[I]=0,s[I]=-1,d=0;let v=e.activeConnSeg;if(u()&&v&&v.startCellId===v.endCellId&&v.startZ===v.endZ)e.failed=!0}else{let v=i[x],P=e.nodePool.z[x];i[I]=_(v,P,e.nodePool.cellId[x],g,f),s[I]=v===0&&P===n&&g!==n?f:s[x]}return I};let m=e.heap.pop.bind(e.heap);e.heap.pop=()=>{let g=m();return a=i[g],d=a,c=s[g],l=e.nodePool.cellId[g],h=e.nodePool.z[g],g};let A=e.getSearchStateIdx.bind(e);return e.getSearchStateIdx=(g,f)=>A(g,f)+(u()?d*r:0),{beforeFirstVia:()=>!u()||a===0,prepareMove(g,f,y){if(d=u()?_(a,h,l,g,f):0,!u())return!0;if(y&&g===n){if(d!==2||c<0)return!1;if(Math.hypot(e.cellCenterX[f]-e.cellCenterX[c],e.cellCenterY[f]-e.cellCenterY[c])<o-0.000000001)return!1}let x=e.activeConnSeg;return g!==x.endZ||f!==x.endCellId||d===2}}}function dx(e,t){return e.targetLayerByBusId?.get(t)??e.targetLayer}var UYr=class extends po{constructor(e){super();this.options=e,this.activeSubSolver=e.router,this.MAX_ITERATIONS=Math.ceil(e.router.MAX_ITERATIONS/5000)+1}options;partialCandidates=[];partialSignatures=new Set;_step(){let{router:e}=this.options;for(let t=0;t<5000&&!e.solved&&!e.failed;t++)e.step();if(this.collectPartialCandidate(),this.stats={iterations:e.iterations,routedConnectionCount:e.getSolvedRouteCount(),connectionCount:this.options.connectionCount},e.solved||e.failed)this.activeSubSolver=null,this.solved=!0}collectPartialCandidate(){let{router:e,connectionCount:t,sourceOrigin:n,maximumPartialCandidates:o}=this.options;if(o===0||t<(n?2:3)||e.getSolvedRouteCount()!==t-1)return;let r=e.getOutput(),i=r.map((s)=>{let a=s.route[Math.floor(s.route.length/2)];return`${s.connectionName}:${s.route.length}:${a.x},${a.y}`}).sort().join(";");if(this.partialSignatures.has(i)||n&&this.partialCandidates.length>=o)return;if(this.partialSignatures.add(i),this.partialCandidates.push(r),this.partialCandidates.length>o)this.partialCandidates.shift()}computeProgress(){return this.options.router.iterations/this.options.router.MAX_ITERATIONS}getConstructorParams(){return[this.options]}visualize(){return this.activeSubSolver?.visualize()??this.options.router.visualize()}},WYr=class e{constructor(t,n){this.cellSize=t,this.margin=n}cellSize;margin;buckets=new Map;add(t){let n,o,r,i;if(t.kind==="segment"){let s=t.segment,a=this.margin+s.width/2;n=Math.min(s.start.x,s.end.x)-a,o=Math.max(s.start.x,s.end.x)+a,r=Math.min(s.start.y,s.end.y)-a,i=Math.max(s.start.y,s.end.y)+a}else if(t.kind==="via"){let s=this.margin+t.diameter/2;n=t.center.x-s,o=t.center.x+s,r=t.center.y-s,i=t.center.y+s}else{let s=t.obstacle,a=Math.hypot(s.width,s.height)/2+this.margin;n=s.center.x-a,o=s.center.x+a,r=s.center.y-a,i=s.center.y+a}for(let s=this.cell(n);s<=this.cell(o);s++)for(let a=this.cell(r);a<=this.cell(i);a++){let c=`${s},${a}`,l=this.buckets.get(c)??new Set;l.add(t),this.buckets.set(c,l)}}nearby(t,n=t){let o=new Set;for(let r=this.cell(Math.min(t.x,n.x));r<=this.cell(Math.max(t.x,n.x));r++)for(let i=this.cell(Math.min(t.y,n.y));i<=this.cell(Math.max(t.y,n.y));i++)for(let s of this.buckets.get(`${r},${i}`)??[])o.add(s);return[...o]}clone(){let t=new e(this.cellSize,this.margin);for(let[n,o]of this.buckets)t.buckets.set(n,new Set(o));return t}cell(t){return Math.floor(t/this.cellSize)}};function hve(e){let t=[];for(let n of e){let o=t.at(-2),r=t.at(-1);if(o&&r&&o.z===r.z&&r.z===n.z){let i=r.x-o.x,s=r.y-o.y,a=n.x-r.x,c=n.y-r.y;if(Math.abs(i*c-s*a)<0.0000000001&&i*a+s*c>=0)t.pop()}t.push(n)}return t}function t9e(e,t,n){let o=new Map(e.buses.flatMap((s)=>s.connections.map((a)=>[a.connection.name,{bus:s,connection:a}]))),r=new Map(e.terminals.map((s)=>[s.connection.connection.name,s])),i=[];for(let s of t){let a=o.get(s.connectionName),c=r.get(s.connectionName);if(!a||!c)return null;let{bus:l,connection:h}=a,d=hve(s.route),u=n.get(h.connectionIndex);if(!d.length||Ut(d[0],c.viaPoint)>0.0000001||Ut(d.at(-1),c.exitPoint)>0.0000001||e.startLayerByBusId!==void 0&&e.layerNames[d[0].z]!==e.startLayerByBusId.get(l.busId)||e.layerNames[d.at(-1).z]!==dx(e,l.busId)||d.some((f)=>!(l.allowedLayers??e.layerNames).includes(e.layerNames[f.z])))return null;let _=B6({...e,bus:l,terminal:c,targetLayer:e.layerNames[d[0].z],targetLayerPoints:[c.viaPoint,c.exitPoint],sourceEscapePoints:u,allowBlindAndBuriedVias:!1}),p=_.trace.route.findIndex((f)=>f.route_type==="via");if(p<0)return null;let m=_.trace.route.slice(0,p+2),A=u.slice(1).map((f,y)=>({start:u[y],end:f,width:e.traceWidth,layer:h.sourceLayer})),g=[];for(let f=1;f<d.length;f++){let y=d[f],x=d[f-1],C=e.layerNames[x.z],b=e.layerNames[y.z];if(C!==b){if(Ut(x,y)>0.0000001)return null;g.push({center:{x:y.x,y:y.y},diameter:e.viaDiameter,holeDiameter:e.viaHoleDiameter,fromLayer:C,toLayer:b,spanLayers:[...e.layerNames]}),m.push({route_type:"via",x:y.x,y:y.y,from_layer:C,to_layer:b,via_diameter:e.viaDiameter,via_hole_diameter:e.viaHoleDiameter})}else if(Ut(x,y)>0.000000001)A.push({start:{x:x.x,y:x.y},end:{x:y.x,y:y.y},width:e.traceWidth,layer:b});m.push({route_type:"wire",x:y.x,y:y.y,layer:b,width:e.traceWidth})}i.push({..._,targetLayer:dx(e,l.busId),trace:{..._.trace,route:m},segments:A,additionalVias:g,length:A.reduce((f,y)=>f+Ut(y.start,y.end),0)})}return i}function q3(e){return tat(e,new WeakMap)}function*tat(e,t){let{buses:n,allBuses:o,targetLayer:r,layerNames:i,traceWidth:s,clearance:a,viaDiameter:c,srj:l}=e,h=e.maximumIterations??30000000,d=e.heuristicWeight??1.5;if(!Number.isFinite(d)||d<=0)throw Error("heuristicWeight must be finite and positive");if(!Number.isSafeInteger(h)||h<1)throw Error("maximumIterations must be a positive safe integer");let u=e.maximumLocalRepairAttempts??3,_=e.maximumSourceOriginRepairAttempts??0;if(!Number.isSafeInteger(u)||u<0)throw Error("maximumLocalRepairAttempts must be a non-negative safe integer");if(!Number.isSafeInteger(_)||_<0)throw Error("maximumSourceOriginRepairAttempts must be a non-negative safe integer");let p=e.ripCost??8;if(!Number.isFinite(p)||p<=0)throw Error("ripCost must be finite and positive");if(e.maximumRipEvents!==void 0&&(!Number.isSafeInteger(e.maximumRipEvents)||e.maximumRipEvents<1))throw Error("maximumRipEvents must be a positive safe integer");let m=e.traceMarginExtra??s/2;if(!Number.isFinite(m)||m<0)throw Error("traceMarginExtra must be finite and non-negative");let A=e.routeFromSourcePads??!1;if(e.terminalApproachLength!==void 0&&(!Number.isFinite(e.terminalApproachLength)||e.terminalApproachLength<=0))throw Error("terminalApproachLength must be finite and positive");let g=A||e.startLayerByBusId!==void 0||e.terminalApproachLength!==void 0,f=e.sourceLayerTravelCost??1;if(!Number.isFinite(f)||f<1)throw Error("sourceLayerTravelCost must be finite and at least one");let y=[...new Set(n.map((qe)=>dx(e,qe.busId)))],x=e.startLayerByBusId?n.map((qe)=>e.startLayerByBusId.get(qe.busId)):[],C=A?[...new Set([r,"top",...e.transitLayers??[],...y,...x])]:[...new Set([r,...e.transitLayers??[],...y,...x])],b=i.indexOf(r),I=A&&e.allowSourceOriginTopFinal===!0&&y.includes("top"),v=I?n.filter((qe)=>dx(e,qe.busId)==="top"):[],P=new Map(v.map((qe)=>[qe.busId,o.find((ft)=>ft.busId===qe.busId)])),M=new Set((I?o:[]).flatMap((qe)=>qe.termination.type==="plane"?[qe.termination.layer]:[]));if(v.some((qe)=>{let ft=P.get(qe.busId);if(!ft||qe.connections.length!==ft.connections.length||qe.connections.some((ze)=>!ft.connections.some((Xe)=>Xe.connectionIndex===ze.connectionIndex&&Xe.connection.name===ze.connection.name&&Xe.sourceObstacle===ze.sourceObstacle)))return!0;let It=(ft.routableEscapeLayers??ft.allowedLayers??i).filter((ze)=>(ft.allowedLayers??i).includes(ze));return!It.includes("top")||!C.some((ze)=>ze!=="top"&&!M.has(ze)&&It.includes(ze)&&(qe.routableEscapeLayers??qe.allowedLayers??i).includes(ze)&&(qe.allowedLayers??i).includes(ze))}))return null;if(n.length===0||b<0||y.some((qe)=>!i.includes(qe))||e.targetLayerByBusId&&n.some((qe)=>!e.targetLayerByBusId.has(qe.busId))||e.startLayerByBusId&&(A||n.some((qe)=>!e.startLayerByBusId.has(qe.busId)))||C.some((qe)=>!i.includes(qe)))return null;let B=n.flatMap((qe)=>qe.connections),T=new Set(B.map((qe)=>qe.connectionIndex));if(A&&B.some((qe)=>qe.sourceLayer!=="top")||T.size!==B.length||e.terminals.length!==B.length||new Set(e.terminals.map((qe)=>qe.connection.connectionIndex)).size!==T.size||e.terminals.some((qe)=>!T.has(qe.connection.connectionIndex)))return null;if(n.some((qe)=>qe.termination.type!=="boundary"||!(qe.allowedLayers??i).includes(dx(e,qe.busId))||!(qe.routableEscapeLayers??qe.allowedLayers??i).includes(dx(e,qe.busId)))||(e.startLayerByBusId?n.some((qe)=>{let ft=e.startLayerByBusId.get(qe.busId);return!(qe.allowedLayers??i).includes(ft)||!(qe.routableEscapeLayers??qe.allowedLayers??i).includes(ft)||qe.connections.some((It)=>It.sourceLayer===ft)}):!I&&o.some((qe)=>qe.connections.some((ft)=>y.includes(ft.sourceLayer)))))return null;let N=n[0].sharedBoundary;if(n.some((qe)=>Object.keys(N).some((ft)=>qe.sharedBoundary[ft]!==N[ft])))return null;let D=new Map,L=new Map,H=new WYr(Math.max(0.5,c*2),Math.max(s,c)/2+a+0.0000001),V=new Map(B.map((qe)=>[qe.connection.name,qe])),O=new Map(B.map((qe)=>[qe.sourceObstacle,qe])),U=A?new Map(B.map((qe)=>[qe.sourceObstacle,{connectionName:qe.connection.name,sourcePoint:V.get(qe.connection.name).sourcePoint}])):void 0;for(let qe of l.obstacles)H.add({kind:"obstacle",obstacle:qe});for(let qe of o)for(let ft of qe.connections){L.set(ft.connection.name,qe);let It=e.fixedViaPointsByConnectionIndex.get(ft.connectionIndex);if(!It)return null;let ze=e.sourceEscapePaths?.get(ft.connectionIndex)??[ft.sourcePoint,It];if(ze.length<2||Ut(ze[0],ft.sourcePoint)>0.0000001||Ut(ze.at(-1),It)>0.0000001)return null;if(D.set(ft.connectionIndex,ze),A&&T.has(ft.connectionIndex))continue;H.add({kind:"via",connectionName:ft.connection.name,center:It,diameter:c,layers:i});for(let Xe=1;Xe<ze.length;Xe++)H.add({kind:"segment",connectionName:ft.connection.name,segment:{start:ze[Xe-1],end:ze[Xe],width:s,layer:ft.sourceLayer}})}for(let qe of e.terminals)if(Ut(qe.viaPoint,e.fixedViaPointsByConnectionIndex.get(qe.connection.connectionIndex))>0.0000001)return null;for(let qe of e.acceptedPlans){for(let ft of[...qe.segments,...qe.planeEndpointSegments??[]])H.add({kind:"segment",connectionName:qe.connectionName,segment:ft});for(let ft of[qe.via,...qe.additionalVias??[],qe.planeEndpointVia])if(ft)H.add({kind:"via",connectionName:qe.connectionName,...ft,layers:ft.spanLayers})}for(let qe of WP(l,!1)){for(let ft of qe.segments)H.add({kind:"segment",connectionName:qe.connectionName,segment:ft});for(let ft of qe.vias)H.add({kind:"via",connectionName:qe.connectionName,...ft,layers:ft.spanLayers})}let j=new Map;if(e.terminalApproachLength!==void 0)for(let qe of e.terminals){let ft=qe.connection.connection.name,It=L.get(ft),ze=RYr({connectionName:ft,edge:It.exitEdge??sue(It.direction),layer:dx(e,It.busId),exit:qe.exitPoint,bounds:N,approachLength:e.terminalApproachLength});j.set(ft,ze),H.add({kind:"segment",connectionName:ft,segment:{start:ze.goal,end:ze.exit,width:s,layer:ze.layer}})}let Y={capacityMeshNodeId:"reserved-via-buses",center:{x:(N.minX+N.maxX)/2,y:(N.minY+N.maxY)/2},width:N.maxX-N.minX,height:N.maxY-N.minY,availableZ:C.map((qe)=>i.indexOf(qe)),portPoints:e.terminals.flatMap((qe)=>[A?qe.connection.sourcePoint:qe.viaPoint,j.get(qe.connection.connection.name)?.goal??qe.exitPoint].map((ft,It)=>({...ft,z:A&&It===0?i.indexOf(qe.connection.sourceLayer):It===0&&e.startLayerByBusId?i.indexOf(e.startLayerByBusId.get(L.get(qe.connection.connection.name).busId)):i.indexOf(dx(e,L.get(qe.connection.connection.name).busId)),connectionName:qe.connection.connection.name,rootConnectionName:qe.connection.connection.name})))};if(e.tightViaChannels){let qe=Xrt({vias:[...e.fixedViaPointsByConnectionIndex].filter(([ft])=>!A||!e.sourceOriginPhysicalGridPhase||!T.has(ft)).map(([ft,It])=>({connectionIndex:ft,center:It,diameter:c})),activeConnectionIndices:T,traceWidth:s,clearance:a,gridStep:s});for(let ft of["x","y"]){let It=(ft==="x"?N.minX:N.minY)+s/2;Y.center[ft]+=qe[ft]-(It+Math.round((qe[ft]-It)/s)*s)}}let K=new XV({nodeWithPortPoints:Y,traceWidth:s,viaDiameter:c}).generateSolver({HIGH_DENSITY_A03:!0});if(typeof K.computeMoveCostAndRips!=="function"||typeof K.markTraceFootprint!=="function"||typeof K.addSharedOccupant!=="function"||typeof K.getSolvedRouteCount!=="function"||j.size>0&&(typeof K.pointToCell!=="function"||typeof K.finalizeRoute!=="function"||typeof K.ripTrace!=="function"))return null;let ee=new K.constructor({nodeWithPortPoints:Y,highResolutionCellSize:s,lowResolutionCellSize:s,traceThickness:s,traceMargin:a+m,viaDiameter:c,maxCellCount:160000*C.length,effort:20,hyperParameters:{shuffleSeed:e.shuffleSeed??1,greedyMultiplier:d,ripCost:p}}),se=ee._setup.bind(ee),ne=ee.computeMoveCostAndRips.bind(ee),re=-1,Z=-1,te=[],ie=[],le,ue=[],de=new Set,me,Ae=new Map,xe=new WeakMap,Me=new Map,Re,we=(qe)=>({x:ee.cellCenterX[qe],y:ee.cellCenterY[qe]}),_e=(qe)=>qe.x>=N.minX-0.000000001&&qe.x<=N.maxX+0.000000001&&qe.y>=N.minY-0.000000001&&qe.y<=N.maxY+0.000000001,ye=(qe)=>{let ft=Me.get(qe);if(ft!==void 0)return ft;let It=we(qe),ze=H.nearby(It).every((Xe)=>{if(Xe.kind==="via")return Ut(It,Xe.center)>=(c+Xe.diameter)/2+a-0.000000001;if(Xe.kind==="segment")return Vr(It,Xe.segment.start,Xe.segment.end)>=(c+Xe.segment.width)/2+a-0.000000001;return Wl({start:It,end:It,width:0,layer:r},Xe.obstacle)>=c/2+a-0.000000001});return Me.set(qe,ze),ze};ee._setup=()=>{if(se(),ee.failed)return;if(e.includeDiagonalNeighbors)Object.assign(ee,NYr(ee));if(j.size>0){if(typeof ee.ripChain?.contains!=="function"||typeof ee.ripChain?.append!=="function"||!Number.isFinite(ee.hyperParameters.ripTracePenalty)||!Number.isFinite(ee.hyperParameters.ripViaPenalty)){ee.failed=!0;return}for(let kt of j.values())if(!Ne(kt.goal,kt.exit,kt.layer,kt.connectionName)){ee.failed=!0;return}let ft=[...j.values()].map((kt)=>({connector:kt,cellId:ee.pointToCell(kt.goal).cellId})),It=HYr({grid:ee,terminals:ft,margin:Math.max(s,c)+a+0.0000001,segmentIsClear:(kt,Lt,Wt)=>_e(kt)&&_e(Lt)&&Ne(kt,Lt,Wt.layer,Wt.connectionName)});ee.neighborOffset=It.neighborOffset,ee.neighborIds=It.neighborIds,ee.neighborCosts=It.neighborCosts,de=It.extendedEdges;let ze=new Map(ft.map(({connector:kt,cellId:Lt})=>[kt.connectionName,Lt])),Xe=ee.getOutput.bind(ee);ee.getOutput=()=>Xe().map((kt)=>{let Lt=FYr(kt,j.get(kt.connectionName),we(ze.get(kt.connectionName))),Wt=[];if(!A){let mn=V.get(kt.connectionName),_n=D.get(mn.connectionIndex);for(let no=1;no<_n.length;no++)Wt.push({start:_n[no-1],end:_n[no],width:s,layer:mn.sourceLayer})}let bn=kt.route.at(-2).z!==kt.route.at(-1).z,pn=kt.route.length-(bn?1:2),wn=-1;for(let mn=1;mn<Lt.route.length;mn++){let _n=Lt.route[mn-1],no=Lt.route[mn];if(_n.z!==no.z)continue;if(mn-1===pn)wn=Wt.length;Wt.push({start:_n,end:no,width:s,layer:i[_n.z]})}let Fn={rawSegments:Wt,firstEntrySegmentIndex:wn};return Ae.set(kt.connectionName,Fn),xe.set(Lt,Fn),Lt}),me=new zYr({regions:It.regions,traceWidth:s,clearance:a,viaDiameter:c,getRoutes:()=>ee.getOutput()});let it=ee.finalizeRoute.bind(ee),St=ee.ripTrace.bind(ee);ee.finalizeRoute=(kt)=>{it(kt),me.invalidate()},ee.ripTrace=(kt)=>{St(kt),me.invalidate()}}if(OYr(ee),Re=new YYr(ee.planeSize,C.length,ee.neighborOffset,ee.neighborIds),te=Array.from({length:C.length},(ft,It)=>i[ee.layerToZ.get(It)]),ie=ee.connIdToName.map((ft)=>{let It=L.get(ft),ze=It?(It.routableEscapeLayers??It.allowedLayers??i).filter((St)=>(It.allowedLayers??i).includes(St)):[],Xe=It&&P.get(It.busId),it=Xe?(Xe.routableEscapeLayers??Xe.allowedLayers??i).filter((St)=>(Xe.allowedLayers??i).includes(St)&&!M.has(St)):void 0;return te.map((St)=>(ze.includes(St)||A&&St==="top")&&(!it||it.includes(St)))}),ee.MAX_ITERATIONS=h,e.maximumRipEvents!==void 0)ee.MAX_RIPS=e.maximumRipEvents;ee.gridToBoundsTransform={a:1,b:0,c:0,d:0,e:1,f:0};let qe=ee.heap.pop.bind(ee.heap);if(ee.heap.pop=()=>{let ft=qe();return re=ee.nodePool.cellId[ft],Z=ee.nodePool.z[ft],ft},I){let ft=ee.layers*ee.planeSize,It=te.indexOf("top");if(typeof ee.getSearchStateIdx!=="function"||typeof ee.nodePool.push!=="function"||!(ee.visitedStamp instanceof Uint32Array)||!(ee.bestGStamp instanceof Uint32Array)||!(ee.bestGValue instanceof Float64Array)||ee.visitedStamp.length!==ft||ee.bestGStamp.length!==ft||ee.bestGValue.length!==ft||ee.getSearchStateIdx(0,0)!==0||ee.getSearchStateIdx(ft-1,1)!==ft-1||It<0){ee.failed=!0;return}ue=ee.connIdToName.map((ze)=>{let Xe=L.get(ze);return!!Xe&&dx(e,Xe.busId)==="top"}),le=GYr(ee,ue,It,c+a)}},ee.markTraceFootprint=(qe,ft,It,ze)=>{let Xe=we(It),it=ee.traceKeepoutRadius;ee.forEachCellNearCircle(Xe.x,Xe.y,it,(St)=>{let kt=e.tightViaChannels?ee.cellCenterX[St]-Xe.x:Math.max(ee.cellMinX[St]-Xe.x,0,Xe.x-ee.cellMaxX[St]),Lt=e.tightViaChannels?ee.cellCenterY[St]-Xe.y:Math.max(ee.cellMinY[St]-Xe.y,0,Xe.y-ee.cellMaxY[St]),Wt=it-(e.tightViaChannels?0.000000001:0);if(e.tightViaChannels?kt*kt+Lt*Lt>=Wt*Wt:kt*kt+Lt*Lt>Wt*Wt)return;let bn=ft*ee.planeSize+St;if(St!==It&&ee.shouldSkipFixedPortHalo(bn,qe))return;let pn=ee.usedCellsFlat[bn];if(pn!==-1&&pn!==qe)ee.addSharedOccupant(bn,qe);else ee.usedCellsFlat[bn]=qe;ze.push(bn)})};let Se=(qe,ft,It,ze)=>{if(ze.kind==="obstacle")return!ze.obstacle.layers.includes(It)||Wl({start:qe,end:ft,width:s,layer:It},ze.obstacle)>=s/2+a-0.000000001;if(ze.kind==="via")return!ze.layers.includes(It)||Vr(ze.center,qe,ft)>=(s+ze.diameter)/2+a-0.000000001;return ze.segment.layer!==It||ad(qe,ft,ze.segment.start,ze.segment.end)>=(s+ze.segment.width)/2+a-0.000000001},Ne=(qe,ft,It,ze,Xe=H.nearby(qe,ft))=>Xe.every((it)=>it.kind!=="obstacle"&&it.connectionName===ze||A&&it.kind==="obstacle"&&It==="top"&&O.get(it.obstacle)?.connection.name===ze&&Wl({start:qe,end:qe,width:s,layer:It},it.obstacle)<s/2+a-0.000000001&&Ut(ft,V.get(ze).sourcePoint)>=Ut(qe,V.get(ze).sourcePoint)-0.000000001||Se(qe,ft,It,it)),ke=(qe,ft,It)=>{let ze;for(let Xe of H.nearby(qe,ft)){if(Se(qe,ft,It,Xe))continue;if(Xe.kind==="obstacle"&&!A)return!1;let it=Xe.kind==="obstacle"?DYr(qe,ft,It,s,a,Xe.obstacle,U?.get(Xe.obstacle)):Xe.connectionName;if(it===void 0||ze!==void 0&&ze!==it)return!1;ze=it}return ze??!0};ee.computeMoveCostAndRips=(qe,ft,It,ze,Xe,it,St)=>{let kt=ee.connIdToName[qe],Lt=te[ft],Wt=ee.activeConnSeg;if(le&&!le.prepareMove(ft,It,ze)||!ie[qe][ft]||ze&&(A&&Lt==="top"&&!ue[qe]||!ye(It))){ee._moveCost=-1;return}let bn=re===Wt.startCellId&&(!g||Z===Wt.startZ)&&(!le||le.beforeFirstVia()),pn,wn,Fn;if(me){let To=It===Wt.endCellId&&ft===Wt.endZ;if(de.has(`${re}:${It}`)&&!To){ee._moveCost=-1;return}let ir=j.get(kt);if(pn=bn?Wt.startPoint:we(re),wn=To?Wt.endPoint:we(It),Fn=To?V8e(ze?we(It):pn,ir):void 0,To&&(!Fn||ze&&Ut(pn,we(It))>0.0000001)){ee._moveCost=-1;return}}let mn=ft*ee.planeSize+re,_n=bn||It===Wt.endCellId&&(!g||ft===Wt.endZ),no=Re.get(mn,It,_n);if(no===void 0){if(pn??=bn?Wt.startPoint:we(re),wn??=It===Wt.endCellId&&(!g||ft===Wt.endZ)?Wt.endPoint:we(It),!_e(pn)||!_e(wn)){ee._moveCost=-1;return}no=_n?Fn?Fn.slice(1).every((To,ir)=>Ne(Fn[ir],To,Lt,kt)):Ne(pn,wn,Lt,kt):ke(pn,wn,Lt),Re.set(mn,It,no,_n)}if(no!==!0&&no!==kt){ee._moveCost=-1;return}if(ne(qe,ft,It,ze,Xe,it,St),me&&ee._moveCost>=0){let To=ze?me.blockingViaOwners(kt,we(It)):me.blockingSegmentOwners(kt,Fn??[pn,wn],ee.layerToZ.get(ft));if(ze&&Fn)for(let ir of me.blockingSegmentOwners(kt,Fn,ee.layerToZ.get(ft)))To.add(ir);for(let ir of To){let xt=ee.connIdToName.indexOf(ir);if(xt<0)throw Error("Cannot resolve dynamic terminal copper owner");if(!ee.ripChain.contains(ee._moveRippedHead,xt))ee._moveRippedHead=ee.ripChain.append(ee._moveRippedHead,xt),ee._moveRipCount++,ee._moveCost+=p;ee._moveCost+=ze?ee.hyperParameters.ripViaPenalty:ee.hyperParameters.ripTracePenalty}}if(A&&!ze&&Lt==="top"&&ee._moveCost>=0&&(!le||le.beforeFirstVia()))ee._moveCost+=St*(f-1)};let nt=A?_:u;ee.setup();let dt=new UYr({router:ee,connectionCount:B.length,sourceOrigin:A,maximumPartialCandidates:nt});yield{type:"subsolver",solver:dt,iterations:ee.iterations,routedConnectionCount:ee.getSolvedRouteCount(),connectionCount:B.length};while(!dt.solved&&!dt.failed)dt.step(),yield{iterations:ee.iterations,routedConnectionCount:ee.getSolvedRouteCount(),connectionCount:B.length};let{partialCandidates:rt}=dt,mt=(qe)=>o.flatMap((ft)=>ft.connections.filter((It)=>!qe.has(It.connectionIndex)).map((It)=>{let ze=e.fixedViaPointsByConnectionIndex.get(It.connectionIndex),Xe=ft.termination.type==="plane"?ft.termination.layer:(ft.allowedLayers??i).find((it)=>it!==It.sourceLayer);return B6({...e,bus:ft,terminal:{connection:It,viaPoint:ze,exitPoint:ze},targetLayer:Xe,targetLayerPoints:[ze],sourceEscapePoints:D.get(It.connectionIndex),allowBlindAndBuriedVias:!1})})),lt=(qe,ft=new Set)=>{let It=mt(new Set([...[...qe,...e.acceptedPlans].map((ze)=>ze.connectionIndex),...ft]));return(j.size===0||qe.every((ze)=>{let Xe=j.get(ze.connectionName);if(!Xe)return!0;let it=ze.segments.at(-1);return!!it&&it.layer===Xe.layer&&Ut(it.end,Xe.exit)<0.0000001&&Vr(Xe.goal,it.start,it.end)<0.0000001&&Wrt({plan:ze,splice:t.get(ze)??Ae.get(ze.connectionName)??{rawSegments:[],firstEntrySegmentIndex:-1},maximumJoinLength:s/4,clearance:a})}))&&wp({plans:[...qe],srj:l,sharedBoundary:N,clearance:a,allowBlindAndBuriedVias:!1,allowSameNetMerges:!1})&&lu({inputSrj:l,routedSrj:{...l,traces:[...l.traces??[],...[...qe,...e.acceptedPlans,...It].flatMap((ze)=>[ze.trace,...ze.planeEndpointTrace?[ze.planeEndpointTrace]:[]])]},clearance:a,allowBlindAndBuriedVias:!1}).valid},Ct=(qe,ft)=>{let It=qe.findIndex((St,kt)=>kt>0&&St.z!==qe[kt-1].z);if(It<1||qe.slice(0,It).some((St)=>i[St.z]!=="top")||Ut(qe[It-1],qe[It])>0.0000001)return!1;let ze=L.get(ft);if(!P.has(ze.busId))return!qe.slice(It).some((St)=>i[St.z]==="top");let Xe=!1,it=!1;for(let St=It+1;St<qe.length;St++){let kt=qe[St-1],Lt=qe[St];if(kt.z===Lt.z&&i[kt.z]!=="top"&&Ut(kt,Lt)>0.0000001)Xe=!0;if(kt.z!==Lt.z&&i[Lt.z]==="top"){if(!Xe||Ut(kt,Lt)>0.0000001||Ut(qe[It],Lt)<c+a-0.000000001)return!1;it=!0}}return it&&mCn({points:qe,topZ:i.indexOf("top"),traceWidth:s,viaDiameter:c,clearance:a})},Nt=(qe)=>{if(Ae.clear(),j.size===0)return!0;for(let ft of qe){let It=xe.get(ft);if(!It)return!1;Ae.set(ft.connectionName,It)}return!0},Ht=(qe,ft=new Set)=>{if(!qe||!lt(qe,ft))return null;for(let It of qe){let ze=Ae.get(It.connectionName);if(ze&&!t.has(It))t.set(It,ze)}return qe},Tt=(qe)=>{if(j.size===0)return qe;let ft=LYr({plans:qe,splices:Ae,connectors:j,clearance:a,segmentIsClear:(It,ze)=>_e(It.start)&&_e(It.end)&&Ne(It.start,It.end,It.layer,ze)});if(!ft)return null;for(let[It,ze]of ft.splices)Ae.set(It,ze);return ft.plans},et=(qe,ft=new Set)=>{if(!Nt(qe))return null;let It=new Map(D),ze=[],Xe=[];for(let mn of qe){let _n=e.terminals.find((ir)=>ir.connection.connection.name===mn.connectionName),no=mn.route.findIndex((ir,xt)=>xt>0&&ir.z!==mn.route[xt-1].z);if(!Ct(mn.route,mn.connectionName)||i[mn.route.at(-1).z]!==dx(e,L.get(mn.connectionName).busId)||Ut(mn.route[no-1],mn.route[no])>0.0000001)return null;let To=mn.route[no];It.set(_n.connection.connectionIndex,hve(mn.route.slice(0,no)).map(({x:ir,y:xt})=>({x:ir,y:xt}))),ze.push({..._n,viaPoint:{x:To.x,y:To.y}}),Xe.push({...mn,route:mn.route.slice(no),vias:[]})}let it=t9e({...e,terminals:ze},Xe,It);if(!it)return null;let St=Tt(it);if(!St)return null;let kt=Grt({...e,inputSrj:l,plans:St,preparedBuses:n,reservedPlans:[...e.acceptedPlans,...mt(T)],allowBlindAndBuriedVias:!1,allowSameNetMerges:!1});if(!kt)return null;let Lt=kt.map((mn)=>({connectionName:mn.connectionName,route:mn.trace.route.flatMap((_n)=>_n.route_type==="wire"?[{x:_n.x,y:_n.y,z:i.indexOf(_n.layer)}]:[]),vias:[mn.via.center]})),Wt=H.clone(),bn=(mn)=>{for(let _n=1;_n<mn.route.length;_n++){let no=mn.route[_n-1],To=mn.route[_n];if(no.z===To.z)Wt.add({kind:"segment",connectionName:mn.connectionName,segment:{start:no,end:To,width:s,layer:i[no.z]}});else Wt.add({kind:"via",connectionName:mn.connectionName,center:no,diameter:c,layers:i})}};Lt.forEach(bn);let pn=[],wn=[];for(let mn of Lt){let _n=e.terminals.find((xt)=>xt.connection.connection.name===mn.connectionName),no=pG({points:hve(mn.route),chamfer:s/4,segmentIsClear:(xt,gt)=>{for(let Ot of[xt,gt]){if(!_e(Ot))return!1;if((Math.abs(Ot.x-N.minX)<0.0000001||Math.abs(Ot.x-N.maxX)<0.0000001||Math.abs(Ot.y-N.minY)<0.0000001||Math.abs(Ot.y-N.maxY)<0.0000001)&&Ut(Ot,_n.exitPoint)>0.0000001)return!1}return Ne(xt,gt,i[xt.z],mn.connectionName,Wt.nearby(xt,gt))}});if(!no)return null;let To=no.findIndex((xt,gt)=>gt>0&&xt.z!==no[gt-1].z);if(!Ct(no,mn.connectionName)||i[no.at(-1).z]!==dx(e,L.get(mn.connectionName).busId))return null;let ir=no[To];D.set(_n.connection.connectionIndex,no.slice(0,To).map(({x:xt,y:gt})=>({x:xt,y:gt}))),wn.push({..._n,viaPoint:{x:ir.x,y:ir.y}}),pn.push({...mn,route:no.slice(To),vias:[]}),bn({...mn,route:no})}let Fn=t9e({...e,terminals:wn},pn,D);return Ht(Fn,ft)},vt=(qe)=>{if(!Nt(qe))return null;let ft=qe,It=H.clone(),ze=new Set([...ft.map((bn)=>e.terminals.find((pn)=>pn.connection.connection.name===bn.connectionName).connection.connectionIndex),...e.acceptedPlans.map((bn)=>bn.connectionIndex)]),Xe=mt(ze),it=t9e(e,ft,D);if(!it)return null;let St=Tt(it);if(!St)return null;let kt=Grt({...e,inputSrj:l,plans:St,preparedBuses:n,reservedPlans:[...e.acceptedPlans,...Xe],allowBlindAndBuriedVias:!1,allowSameNetMerges:!1});if(!kt)return null;ft=kt.map((bn)=>{let pn=bn.trace.route.findIndex((wn)=>wn.route_type==="via");return{connectionName:bn.connectionName,route:bn.trace.route.slice(pn+1).flatMap((wn)=>wn.route_type==="wire"?[{x:wn.x,y:wn.y,z:i.indexOf(wn.layer)}]:[]),vias:(bn.additionalVias??[]).map((wn)=>wn.center)}});let Lt=(bn)=>{for(let pn=1;pn<bn.route.length;pn++){let wn=bn.route[pn-1],Fn=bn.route[pn];if(wn.z===Fn.z)It.add({kind:"segment",connectionName:bn.connectionName,segment:{start:wn,end:Fn,width:s,layer:i[wn.z]}})}for(let pn of bn.vias)It.add({kind:"via",connectionName:bn.connectionName,center:pn,diameter:c,layers:i})};for(let bn of ft)Lt(bn);for(let bn of ft){let pn=e.terminals.find((Fn)=>Fn.connection.connection.name===bn.connectionName),wn=pG({points:hve(bn.route),chamfer:s/4,segmentIsClear:(Fn,mn)=>{for(let _n of[Fn,mn]){if(!_e(_n))return!1;if((Math.abs(_n.x-N.minX)<0.0000001||Math.abs(_n.x-N.maxX)<0.0000001||Math.abs(_n.y-N.minY)<0.0000001||Math.abs(_n.y-N.maxY)<0.0000001)&&Ut(_n,pn.exitPoint)>0.0000001)return!1}return Ne(Fn,mn,i[Fn.z],bn.connectionName,It.nearby(Fn,mn))}});if(!wn)return null;bn.route=wn,Lt(bn)}let Wt=t9e(e,ft,D);return Ht(Wt)};if(ee.solved&&!ee.failed){let qe=ee.getOutput();if(qe.length!==B.length||new Set(qe.map((ft)=>ft.connectionName)).size!==B.length)return null;return A?et(qe):vt(qe)}if(A&&_>0){for(let qe of rt){let ft=new Set(qe.map((Lt)=>Lt.connectionName)),It=e.terminals.filter((Lt)=>!ft.has(Lt.connection.connection.name));if(It.length!==1)continue;let ze=It[0].connection.connectionIndex,Xe=new Map(D),it=et(qe,new Set([ze]));D.clear();for(let[Lt,Wt]of Xe)D.set(Lt,Wt);if(!it)continue;let St=XYr(e,it,t),kt=St.next();while(!kt.done)yield{iterations:ee.iterations+kt.value.iterations,routedConnectionCount:kt.value.routedConnectionCount,connectionCount:B.length},kt=St.next();if(kt.value&&lt(kt.value))return kt.value}return null}if(A||u===0||rt.length===0)return null;let ht=mt(new Set(e.acceptedPlans.map((qe)=>qe.connectionIndex))),We=new Map(ht.map((qe)=>[qe.connectionIndex,qe])),Le=ht.flatMap((qe)=>qe.via?[{connectionName:qe.connectionName,via:qe.via}]:[]),Ze=Xrt({...e,gridStep:s,vias:o.flatMap((qe)=>qe.connections.map((ft)=>({connectionIndex:ft.connectionIndex,center:e.fixedViaPointsByConnectionIndex.get(ft.connectionIndex),diameter:c}))),activeConnectionIndices:T}),$e=0;for(let qe of rt.toReversed()){let ft=vt(qe);if(!ft)continue;let It=new Set(ft.map((it)=>it.connectionIndex)),ze=e.terminals.find((it)=>!It.has(it.connection.connectionIndex)),Xe=ft.toSorted((it,St)=>Ut(it.exitPoint,ze.exitPoint)-Ut(St.exitPoint,ze.exitPoint));for(let it of Xe.slice(0,16)){let St=ze.connection.connectionIndex,kt=ft.filter((Fn)=>Fn!==it),Lt=[...e.acceptedPlans,...kt,...ht.filter((Fn)=>!It.has(Fn.connectionIndex)&&Fn.connectionIndex!==St),We.get(it.connectionIndex)],Wt=L.get(ze.connection.connection.name),bn=w1({...e,bus:{...Wt,exitEdge:Wt.exitEdge??sue(Wt.direction),connections:[ze.connection]},terminals:[ze],targetLayer:dx(e,Wt.busId),acceptedPlans:Lt,reservedVias:Le.filter((Fn)=>Fn.connectionName!==ze.connection.connection.name),sourceEscapePaths:D,gridStep:s,gridOrigin:Ze,gridStepDivisor:2,maximumRouteOrderAttempts:1,maximumSearchStates:240000,heuristicWeight:1,alignGridToPads:!0},1,!1),pn=bn.next();while(!pn.done)yield{iterations:ee.iterations+pn.value.expandedStateCount,routedConnectionCount:ft.length,connectionCount:B.length},pn=bn.next();if(!pn.value[0]?.length)continue;let wn=kt.toSorted((Fn,mn)=>{let _n=(no)=>Math.min(...no.segments.filter((To)=>To.layer===dx(e,Wt.busId)).map((To)=>Vr(ze.viaPoint,To.start,To.end)));return _n(Fn)-_n(mn)});for(let Fn of wn.slice(0,1)){if($e++>=u)return null;let mn=new Set([St,it.connectionIndex,Fn.connectionIndex]),_n=n.map((gt)=>({...gt,connections:gt.connections.filter((Ot)=>mn.has(Ot.connectionIndex))})).filter((gt)=>gt.connections.length>0),no=[...e.acceptedPlans,...ft.filter((gt)=>!mn.has(gt.connectionIndex)),...ht.filter((gt)=>!It.has(gt.connectionIndex)&&!mn.has(gt.connectionIndex))],To=tat({...e,buses:_n,terminals:e.terminals.filter((gt)=>mn.has(gt.connection.connectionIndex)),acceptedPlans:no,maximumLocalRepairAttempts:0,maximumIterations:Math.min(h,2000000)},t),ir=To.next();while(!ir.done)yield{iterations:ee.iterations+ir.value.iterations,routedConnectionCount:ft.length-2+ir.value.routedConnectionCount,connectionCount:B.length},ir=To.next();if(!ir.value)continue;let xt=[...ft.filter((gt)=>!mn.has(gt.connectionIndex)),...ir.value];if(xt.length===B.length&&new Set(xt.map((gt)=>gt.connectionIndex)).size===T.size&&lt(xt))return xt}break}}return null}function*XYr(e,t,n){let{buses:o,layerNames:r}=e;if(!e.routeFromSourcePads)return null;let i=new Map(e.terminals.map((g)=>[g.connection.connectionIndex,g])),s=new Set(t.map((g)=>g.connectionIndex));if(i.size<2||s.size!==t.length||t.length!==i.size-1||t.some((g)=>i.get(g.connectionIndex)?.connection.connection.name!==g.connectionName||g.targetLayer!==dx(e,g.busId)||g.sourceLayer!==i.get(g.connectionIndex).connection.sourceLayer||Ut(g.sourcePoint,i.get(g.connectionIndex).connection.sourcePoint)>0.0000001||!g.via||Ut(g.exitPoint,i.get(g.connectionIndex).exitPoint)>0.0000001))return null;let a=e.terminals.filter((g)=>!s.has(g.connection.connectionIndex)),c=a[0].connection.connectionIndex,l=new Map(e.fixedViaPointsByConnectionIndex),h=new Map(e.sourceEscapePaths);for(let g of t)l.set(g.connectionIndex,g.via.center),h.set(g.connectionIndex,[g.sourcePoint,...g.segments.slice(0,g.sourceEscapeSegmentCount??1).map((f)=>f.end)]);let d=o.map((g)=>({...g,connections:g.connections.filter((f)=>f.connectionIndex===c)})).filter((g)=>g.connections.length>0),u=dx(e,d[0].busId),_=r.filter((g)=>g!==u&&d.every((f)=>(f.routableEscapeLayers??f.allowedLayers??r).includes(g)&&f.connections.every((y)=>y.sourceLayer!==g))),p=tat({...e,buses:d,targetLayer:u,terminals:a,transitLayers:_,fixedViaPointsByConnectionIndex:l,sourceEscapePaths:h,acceptedPlans:[...e.acceptedPlans,...t],includeDiagonalNeighbors:!0,ripCost:256,maximumIterations:Math.min(e.maximumIterations??5000000,5000000),maximumRipEvents:Math.min(e.maximumRipEvents??400,400),maximumLocalRepairAttempts:0,maximumSourceOriginRepairAttempts:0},n),m=p.next();while(!m.done)yield{...m.value,routedConnectionCount:t.length+m.value.routedConnectionCount,connectionCount:i.size},m=p.next();if(!m.value)return null;let A=[...t,...m.value];return A.length===i.size&&new Set(A.map((g)=>g.connectionIndex)).size===i.size?A:null}var z_=0.0000001,X3=(e)=>Math.max(...e.map((t)=>t.length))-Math.min(...e.map((t)=>t.length));function mG(e,t){let n=e.trace.route.findIndex((i)=>i.route_type==="via"),o=t.trace.route.findIndex((i)=>i.route_type==="via");if(n<0||o<0)return null;let r=e.sourceEscapeSegmentCount??1;return{...t,sourcePoint:e.sourcePoint,via:e.via,exitPoint:e.exitPoint,sourceEscapeSegmentCount:r,segments:[...e.segments.slice(0,r),...t.segments.slice(t.sourceEscapeSegmentCount??1)],trace:{...e.trace,route:[...e.trace.route.slice(0,n+1),...t.trace.route.slice(o+1)]}}}function nat(e,t,n){if(!t.exitEdge||e.termination.type!=="boundary")return null;let o=t.sharedBoundary,r=(_)=>t.exitEdge==="left"?_.x-o.minX:t.exitEdge==="right"?o.maxX-_.x:t.exitEdge==="top"?o.maxY-_.y:_.y-o.minY;if(Math.abs(r(e.exitPoint))>z_)return null;let i=e.segments.length-1;while(i>0&&e.segments[i-1].layer===e.targetLayer)i--;if(i<(e.sourceEscapeSegmentCount??1))return null;let s=-1;for(let _=i;_<e.segments.length;_++){let p=e.segments[_];if(r(p.start)>=n&&r(p.end)<=n)s=_}if(s<0)s=i;let a=e.segments[s],c=r(a.start),l=r(a.end),h=c>n&&l<c?(c-n)/(c-l):0,d={x:a.start.x+(a.end.x-a.start.x)*h,y:a.start.y+(a.end.y-a.start.y)*h};if(r(d)<=z_)return null;let u=[{...a,start:d},...e.segments.slice(s+1)].filter((_)=>Ut(_.start,_.end)>z_);if(!u.length||u.some((_)=>_.layer!==e.targetLayer))return null;return{...e,sourcePoint:{...e.sourcePoint,...d},sourceEscapeSegmentCount:0,via:void 0,additionalVias:[],segments:u,length:u.reduce((_,p)=>_+Ut(p.start,p.end),0),trace:{...e.trace,pcb_trace_id:`${e.trace.pcb_trace_id}-retained-tail`,route:[d,...u.map((_)=>_.end)].map((_)=>({route_type:"wire",..._,layer:e.targetLayer,width:u[0].width}))}}}function oat(e){let{inputSrj:t,preparedBuses:n,layerNames:o,viaDiameter:r,viaHoleDiameter:i}=e,s=new Map(e.plans.map((h)=>[h.connectionIndex,h])),a=n.flatMap((h)=>h.connections);if(a.length!==t.connections.length||s.size!==a.length||s.size!==e.plans.length||a.some((h)=>s.get(h.connectionIndex)?.connectionName!==h.connection.name))throw Error("Retained-tail repair requires every original connection exactly once");let c=new Map,l=new Map;for(let h of a){let d=s.get(h.connectionIndex),u=d.segments.slice(0,d.sourceEscapeSegmentCount??1);if(!d.via||!u.length||u.some((_)=>_.layer!==h.sourceLayer)||Ut(u[0].start,h.sourcePoint)>z_||Ut(u.at(-1).end,d.via.center)>z_||u.some((_,p)=>p>0&&Ut(u[p-1].end,_.start)>z_)||d.via.fromLayer!==h.sourceLayer||d.via.toLayer!==d.targetLayer||d.via.diameter!==r||d.via.holeDiameter!==i||d.via.spanLayers.length!==o.length||!o.every((_)=>d.via.spanLayers.includes(_)))return null;c.set(h.connectionIndex,d.via.center),l.set(h.connectionIndex,[u[0].start,...u.map((_)=>_.end)])}return{fixed:c,sourcePaths:l}}function*jYr(e,t){let{inputSrj:n,preparedBuses:o,layerNames:r,traceWidth:i,clearance:s,viaDiameter:a,viaHoleDiameter:c}=e,l=e.maximumIterationsPerAttempt??1e7;if(!Number.isSafeInteger(l)||l<1)throw Error("maximumIterationsPerAttempt must be a positive safe integer");let h=oat(e);if(!h)return null;let{fixed:d,sourcePaths:u}=h,_=[...e.plans],p=o.filter((A)=>A.termination.type==="boundary"&&A.maxLengthSkew!==void 0&&A.connections.length>1&&(!e.busIds||e.busIds.includes(A.busId)));for(let A of p){let g=_.filter((O)=>O.busId===A.busId);if(g.length!==A.connections.length)return null;if(X3(g)<=A.maxLengthSkew+z_)continue;let f=g[0].targetLayer;if(g.some((O)=>O.targetLayer!==f||O.planeEndpointTrace||O.planeEndpointSegments||O.planeEndpointVia)||!A.exitEdge)return null;let y=(A.routableEscapeLayers??A.allowedLayers??r).filter((O)=>(A.allowedLayers??r).includes(O));if(!y.includes(f))return null;let x=y.filter((O)=>O!==f);if(!x.length)return null;let C=(O,U,j)=>{let Y={srj:n,allBuses:o,buses:[{...A,connections:O}],targetLayer:f,transitLayers:x,terminals:O.map((X)=>({connection:X,viaPoint:d.get(X.connectionIndex),exitPoint:U.get(X.connectionIndex)})),fixedViaPointsByConnectionIndex:d,sourceEscapePaths:u,acceptedPlans:j,layerNames:r,traceWidth:i,clearance:s,viaDiameter:a,viaHoleDiameter:c,tightViaChannels:!0,includeDiagonalNeighbors:!0,heuristicWeight:1,maximumIterations:l,maximumRipEvents:200,maximumLocalRepairAttempts:0,ripCost:256,shuffleSeed:1};return q3(Y)},b=g.toSorted((O,U)=>U.length-O.length)[0],I=A.connections.find((O)=>O.connectionIndex===b.connectionIndex),v=C([I],new Map([[b.connectionIndex,b.exitPoint]]),_.filter((O)=>O!==b)),P=v.next();while(!P.done)yield{...P.value,busId:A.busId,phase:"lane"},P=v.next();let M=P.value?.[0]?mG(b,P.value[0]):null;if(M&&M.length<b.length-z_&&X3(g.map((O)=>O===b?M:O))<X3(g)-z_)t.push({busId:A.busId,plan:M});if(M&&X3(g.map((O)=>O===b?M:O))<=A.maxLengthSkew+z_){_=_.map((O)=>O===b?M:O);continue}let B=Math.min(12*(i+s),(A.exitEdge==="left"||A.exitEdge==="right"?A.sharedBoundary.maxX-A.sharedBoundary.minX:A.sharedBoundary.maxY-A.sharedBoundary.minY)/3),T=g.map((O)=>nat(O,A,B));if(T.some((O)=>!O))return null;let N=T,D=_.filter((O)=>O.busId!==A.busId),L=C(A.connections,new Map(N.map((O)=>[O.connectionIndex,O.sourcePoint])),[...D,...N]),H=L.next();while(!H.done)yield{...H.value,busId:A.busId,phase:"bus"},H=L.next();if(!H.value||H.value.length!==g.length)return null;let V=_.map((O)=>{let U=H.value.find((K)=>K.connectionIndex===O.connectionIndex);if(!U)return O;let j=mG(O,U);if(!j)throw Error("Retained-tail routing lost its source via");let Y=N.find((K)=>K.connectionIndex===j.connectionIndex),X=[...j.trace.route,...Y.trace.route.slice(1)];return X[X.length-1]=O.trace.route.at(-1),{...j,exitPoint:O.exitPoint,trace:{...O.trace,route:X},segments:[...j.segments,...Y.segments],length:j.length+Y.length}});for(let O of g){let U=V.find((Y)=>Y.connectionIndex===O.connectionIndex),j=Zue(e,U,V.filter((Y)=>Y!==U),A,!0);if(!j)return null;V=V.map((Y)=>Y===U?j:Y)}if(X3(V.filter((O)=>O.busId===A.busId))>A.maxLengthSkew+z_||!wp({plans:V,srj:n,sharedBoundary:A.sharedBoundary,clearance:s,allowBlindAndBuriedVias:!1,allowSameNetMerges:!1}))return null;_=V}return lu({inputSrj:n,routedSrj:{...n,traces:[...n.traces??[],..._.flatMap((A)=>[A.trace,...A.planeEndpointTrace?[A.planeEndpointTrace]:[]])]},clearance:s,allowBlindAndBuriedVias:!1}).valid?_:null}function*KYr(e,t){let n=yield*jYr(e,t);if(n)return n;let o=oat(e);if(!o)return null;let{fixed:r,sourcePaths:i}=o,{inputSrj:s,preparedBuses:a,layerNames:c,traceWidth:l,clearance:h}=e,d=a.filter((m)=>m.termination.type==="boundary"&&m.connections.length>1&&m.maxLengthSkew!==void 0&&(!e.busIds||e.busIds.includes(m.busId))),u=new Map;for(let m of d){let A=e.plans.filter((y)=>y.busId===m.busId);if(A.length!==m.connections.length||!m.exitEdge)return null;let g=A[0].targetLayer;if(A.some((y)=>y.targetLayer!==g||y.planeEndpointTrace||y.planeEndpointSegments||y.planeEndpointVia))return null;let f=`${g}:${m.exitEdge}`;u.set(f,[...u.get(f)??[],m])}let _=[...e.plans];for(let m of u.values()){let A=new Set(m.map((H)=>H.busId)),g=_.filter((H)=>A.has(H.busId));if(m.every((H)=>X3(g.filter((V)=>V.busId===H.busId))<=H.maxLengthSkew+z_))continue;if(m.length<2)return null;let f=g[0].targetLayer,y=c.filter((H)=>m.every((V)=>(V.routableEscapeLayers??V.allowedLayers??c).includes(H)&&(V.allowedLayers??c).includes(H)));if(!y.includes(f))return null;let x=y.filter((H)=>H!==f);if(!x.length)return null;let C=m[0].sharedBoundary,b=Math.min(12*(l+h),(m[0].exitEdge==="left"||m[0].exitEdge==="right"?C.maxX-C.minX:C.maxY-C.minY)/3),I=g.map((H)=>nat(H,m.find((V)=>V.busId===H.busId),b));if(I.some((H)=>!H))return null;let v=I,P=_.filter((H)=>!A.has(H.busId)),M=q3({...e,srj:s,allBuses:a,buses:m,targetLayer:f,transitLayers:x,terminals:m.flatMap((H)=>H.connections.map((V)=>({connection:V,viaPoint:r.get(V.connectionIndex),exitPoint:v.find((O)=>O.connectionIndex===V.connectionIndex).sourcePoint}))),fixedViaPointsByConnectionIndex:r,sourceEscapePaths:i,acceptedPlans:[...P,...v],tightViaChannels:!0,includeDiagonalNeighbors:!0,heuristicWeight:1,ripCost:8,shuffleSeed:1,maximumIterations:e.maximumIterationsPerAttempt??1e7,maximumRipEvents:200,maximumLocalRepairAttempts:0}),B=M.next();while(!B.done)yield{...B.value,busId:m[0].busId,phase:"layer"},B=M.next();if(!B.value||B.value.length!==g.length)return null;let T=B.value,N=_.map((H)=>{let V=T.find((Y)=>Y.connectionIndex===H.connectionIndex);if(!V)return H;let O=mG(H,V);if(!O)throw Error("Joint retained-tail routing lost its source via");let U=v.find((Y)=>Y.connectionIndex===H.connectionIndex),j=[...O.trace.route,...U.trace.route.slice(1)];return j[j.length-1]=H.trace.route.at(-1),{...O,trace:{...H.trace,route:j},segments:[...O.segments,...U.segments],length:O.length+U.length}});for(let H of g){let V=N.find((U)=>U.connectionIndex===H.connectionIndex),O=Zue(e,V,N.filter((U)=>U!==V),m.find((U)=>U.busId===H.busId),!0);if(!O)return null;N=N.map((U)=>U===V?O:U)}if(!wp({plans:N,srj:s,sharedBoundary:C,clearance:h,allowBlindAndBuriedVias:!1,allowSameNetMerges:!1}))return null;N=hZ({...e,plans:N,preparedBuses:m,selectedBusIds:A,allowBlindAndBuriedVias:!1})??N;let D=yx({...e,plans:N,preparedBuses:m,sharedBoundary:C,allowBlindAndBuriedVias:!1,allowSameNetMerges:!1,allowMatchingInsideDenseBounds:!0,allowPairLaneSpreading:!0,allowUnconstrainedLaneRerouting:!0,maximumWorkUnits:1000});if(!D.plans)return null;let L=D.plans;if(N=_.map((H)=>{if(!A.has(H.busId))return H;let V=L.find((U)=>U.connectionIndex===H.connectionIndex),O=mG(H,V);if(!O)throw Error("Joint retained-tail tuning lost its source via");return O}),m.some((H)=>X3(N.filter((V)=>V.busId===H.busId))>H.maxLengthSkew+z_))return null;_=N}if(d.some((m)=>X3(_.filter((A)=>A.busId===m.busId))>m.maxLengthSkew+z_))return null;return lu({inputSrj:s,routedSrj:{...s,traces:[...s.traces??[],..._.flatMap((m)=>[m.trace,...m.planeEndpointTrace?[m.planeEndpointTrace]:[]])]},clearance:h,allowBlindAndBuriedVias:!1}).valid?_:null}function*$Yr(e){let t=[],n=yield*KYr(e,t);if(n)return n;if(!t.length)return null;let o=[...e.plans],r=!1;for(let{busId:s,plan:a}of t){let c=e.preparedBuses.find((m)=>m.busId===s),l=o.find((m)=>m.connectionIndex===a.connectionIndex),h=Zue(e,a,o.filter((m)=>m!==l),c,!0);if(!h)continue;let d=o.map((m)=>m===l?h:m),u=yx({...e,plans:d,preparedBuses:[c],sharedBoundary:c.sharedBoundary,allowBlindAndBuriedVias:!1,allowSameNetMerges:!1,allowMatchingInsideDenseBounds:!0,allowPairLaneSpreading:!0,allowUnconstrainedLaneRerouting:!0,maximumWorkUnits:1000});if(!u.plans)continue;let _=o.map((m)=>{if(m.busId!==s)return m;let A=u.plans.find((g)=>g.connectionIndex===m.connectionIndex);return mG(m,A)});if(_.some((m)=>!m))continue;let p=_;if(X3(p.filter((m)=>m.busId===s))>c.maxLengthSkew+z_||!wp({plans:p,srj:e.inputSrj,sharedBoundary:c.sharedBoundary,clearance:e.clearance,allowBlindAndBuriedVias:!1,allowSameNetMerges:!1}))continue;o=p,r=!0}if(!r)return null;if(e.preparedBuses.some((s)=>(!e.busIds||e.busIds.includes(s.busId))&&s.maxLengthSkew!==void 0&&X3(o.filter((a)=>a.busId===s.busId))>s.maxLengthSkew+z_))return null;return lu({inputSrj:e.inputSrj,routedSrj:{...e.inputSrj,traces:[...e.inputSrj.traces??[],...o.flatMap((s)=>[s.trace,...s.planeEndpointTrace?[s.planeEndpointTrace]:[]])]},clearance:e.clearance,allowBlindAndBuriedVias:!1}).valid?o:null}function*qYr(e){let t=oat(e);if(!t)return null;let{inputSrj:n,preparedBuses:o,layerNames:r}=e,i=e.maximumIterationsPerAttempt??5000000;if(!Number.isSafeInteger(i)||i<1)throw Error("maximumIterationsPerAttempt must be a positive safe integer");let s=Math.min(i,5000000),a=o.filter((d)=>d.termination.type==="boundary"&&d.connections.length>2&&d.maxLengthSkew!==void 0&&(!e.busIds||e.busIds.includes(d.busId))),c=[...e.plans],l=!1;for(let d of a){let u=c.filter((T)=>T.busId===d.busId);if(u.length!==d.connections.length)return null;if(X3(u)<=d.maxLengthSkew+z_)continue;let _=Math.min(...u.map((T)=>T.length)),p=u.filter((T)=>T.length>_+d.maxLengthSkew+z_).toSorted((T,N)=>N.length-T.length||T.connectionIndex-N.connectionIndex).slice(0,2);if(p.length!==2)return null;let m=u[0].targetLayer;if(!d.exitEdge||u.some((T)=>T.targetLayer!==m||T.planeEndpointTrace||T.planeEndpointSegments||T.planeEndpointVia))return null;let A=(d.routableEscapeLayers??d.allowedLayers??r).filter((T)=>(d.allowedLayers??r).includes(T)),g=A.filter((T)=>T!==m);if(!A.includes(m)||!g.length)return null;let f=new Set(p.map((T)=>T.connectionIndex)),y=d.connections.filter((T)=>f.has(T.connectionIndex)),x=q3({...e,srj:n,allBuses:o,buses:[{...d,connections:y}],targetLayer:m,transitLayers:g,terminals:y.map((T)=>({connection:T,viaPoint:t.fixed.get(T.connectionIndex),exitPoint:u.find((N)=>N.connectionIndex===T.connectionIndex).exitPoint})),fixedViaPointsByConnectionIndex:t.fixed,sourceEscapePaths:t.sourcePaths,acceptedPlans:c.filter((T)=>!f.has(T.connectionIndex)),tightViaChannels:!0,includeDiagonalNeighbors:!0,ripCost:64,shuffleSeed:1,maximumIterations:s,maximumRipEvents:80,maximumLocalRepairAttempts:0}),C=x.next();while(!C.done)yield{...C.value,busId:d.busId,phase:"overlong-pair"},C=x.next();if(!C.value||C.value.length!==2)return null;let b=new Map(C.value.map((T)=>[T.connectionIndex,T])),I=c.map((T)=>{let N=b.get(T.connectionIndex);return N?mG(T,N):T});if(I.some((T)=>!T))return null;let v=yx({...e,plans:I,preparedBuses:[d],sharedBoundary:d.sharedBoundary,allowBlindAndBuriedVias:!1,allowSameNetMerges:!1,allowMatchingInsideDenseBounds:!0,allowPairLaneSpreading:!0,allowUnconstrainedLaneRerouting:!0,maximumWorkUnits:1000});if(!v.plans)return null;let P=new Map(v.plans.map((T)=>[T.connectionIndex,T])),M=c.map((T)=>T.busId===d.busId?mG(T,P.get(T.connectionIndex)):T);if(M.some((T)=>!T))return null;let B=M;if(X3(B.filter((T)=>T.busId===d.busId))>d.maxLengthSkew+z_||!wp({plans:B,srj:n,sharedBoundary:d.sharedBoundary,clearance:e.clearance,allowBlindAndBuriedVias:!1,allowSameNetMerges:!1}))return null;c=B,l=!0}if(!l||o.some((d)=>(!e.busIds||e.busIds.includes(d.busId))&&d.maxLengthSkew!==void 0&&X3(c.filter((u)=>u.busId===d.busId))>d.maxLengthSkew+z_))return null;return lu({inputSrj:n,routedSrj:{...n,traces:[...n.traces??[],...c.flatMap((d)=>[d.trace,...d.planeEndpointTrace?[d.planeEndpointTrace]:[]])]},clearance:e.clearance,allowBlindAndBuriedVias:!1}).valid?c:null}function*JYr(e){let t=yield*$Yr(e);if(t)return t;return yield*qYr(e)}function dve(e,t,n){return e.buses.flatMap((o)=>o.connections.map((r)=>{let i=t.get(r.connectionIndex),s=o.termination.type==="plane"?o.termination.layer:(o.allowedLayers??e.layerNames).filter((a)=>a!==r.sourceLayer).at(-1);return B6({...e,bus:o,terminal:{connection:r,viaPoint:i,exitPoint:i},targetLayer:s,targetLayerPoints:[i],sourceEscapePoints:n.get(r.connectionIndex),allowBlindAndBuriedVias:!1})}))}function ZYr(e){if(!e.buses.length||e.buses.some((r)=>r.connections.some((i)=>i.sourceLayer!=="top")))return null;let t=I0(e.buses,{...e,maximumSearchStates:1e4,additionalObstacles:e.srj.obstacles});if(!t)return null;let n=new Map(e.buses.flatMap((r)=>r.connections.map((i)=>[i.connectionIndex,[i.sourcePoint,t.get(i.connectionIndex)]]))),o=dve(e,t,n);if(!lu({inputSrj:e.srj,routedSrj:{...e.srj,traces:[...e.srj.traces??[],...o.map((r)=>r.trace)]},clearance:e.clearance,allowBlindAndBuriedVias:!1}).valid)return null;return{fixedViaPointsByConnectionIndex:t,sourceEscapePaths:n,sourcePlans:o}}function*eGr(e){let t=q3({...e,transitLayers:[],routeFromSourcePads:!0,sourceLayerTravelCost:e.sourceLayerTravelCost??2,maximumRipEvents:1200,maximumIterations:e.maximumSourceIterations??50000000,maximumLocalRepairAttempts:0,shuffleSeed:1}),n=t.next();while(!n.done)yield n.value,n=t.next();if(!n.value)return null;let o=n.value,r=new Map(e.fixedViaPointsByConnectionIndex),i=new Map(e.allBuses.flatMap((l)=>l.connections.map((h)=>[h.connectionIndex,e.sourceEscapePaths?.get(h.connectionIndex)??[h.sourcePoint,r.get(h.connectionIndex)]]))),s=new Map(e.buses.flatMap((l)=>l.connections.map((h)=>[h.connectionIndex,{bus:l,connection:h}]))),a=(l)=>{if(!l.via)throw Error("Source-origin routing lost a required first via");r.set(l.connectionIndex,l.via.center);let h=l.segments.slice(0,l.sourceEscapeSegmentCount??1);i.set(l.connectionIndex,[l.sourcePoint,...h.map((d)=>d.end)])};o.forEach(a);let c=(l)=>{let h=s.get(l.connectionIndex).bus;if(h.connections.length<=2||h.maxLengthSkew===void 0)return!1;let d=Math.min(...o.filter((u)=>u.busId===l.busId).map((u)=>u.length));return l.length>d+h.maxLengthSkew+0.0000001};for(let l=0;l<2;l++){let h=o.filter(c).toSorted((u,_)=>_.length-u.length).slice(0,8),d=!1;for(let u of h){let _=o.find((I)=>I.connectionIndex===u.connectionIndex);if(!c(_))continue;let{bus:p,connection:m}=s.get(_.connectionIndex),A=e.cleanupRetainedBoundaryTails?nat(_,p,(l===0?12:6)*(e.traceWidth+e.clearance)):null;if(e.cleanupRetainedBoundaryTails&&!A)continue;let g=q3({...e,buses:[{...p,connections:[m]}],transitLayers:[],routeFromSourcePads:!0,sourceLayerTravelCost:1,includeDiagonalNeighbors:e.cleanupRetainedBoundaryTails||e.includeDiagonalNeighbors,fixedViaPointsByConnectionIndex:r,sourceEscapePaths:i,acceptedPlans:[...e.acceptedPlans,...o.filter((I)=>I!==_),...A?[A]:[]],terminals:[{connection:m,viaPoint:r.get(m.connectionIndex),exitPoint:A?.sourcePoint??_.exitPoint}],maximumRipEvents:1,maximumIterations:2000000,maximumLocalRepairAttempts:0,shuffleSeed:1}),f=g.next();while(!f.done)yield{...f.value,connectionCount:o.length},f=g.next();let y=f.value?.[0];if(y&&A){let I={...y,exitPoint:_.exitPoint,segments:[...y.segments,...A.segments],length:y.length+A.length,trace:{...y.trace,route:[...y.trace.route,...A.trace.route.slice(1)]}};y=Zue({...e,inputSrj:e.srj},I,[...e.acceptedPlans,...o.filter((v)=>v!==_),...dve({...e,buses:e.allBuses.filter((v)=>!e.buses.some((P)=>P.busId===v.busId))},r,i)],p,!0)??void 0}if(!y||y.length>=_.length-0.0000001)continue;let x=o.filter((I)=>I.busId===_.busId),C=x.map((I)=>I.length),b=x.map((I)=>I===_?y.length:I.length);if(Math.max(...b)-Math.min(...b)>Math.max(...C)-Math.min(...C)+0.0000001)continue;if(A&&!lu({inputSrj:e.srj,routedSrj:{...e.srj,traces:[...e.srj.traces??[],...e.acceptedPlans.flatMap((I)=>[I.trace,...I.planeEndpointTrace?[I.planeEndpointTrace]:[]]),...o.map((I)=>(I===_?y:I).trace),...dve({...e,buses:e.allBuses.filter((I)=>!e.buses.some((v)=>v.busId===I.busId)&&!e.acceptedPlans.some((v)=>v.busId===I.busId))},r,i).map((I)=>I.trace)]},clearance:e.clearance,allowBlindAndBuriedVias:!1}).valid)continue;o=o.map((I)=>I===_?y:I),a(y),d=!0}if(!d)break}return{plans:o,fixedViaPointsByConnectionIndex:r,sourceEscapePaths:i,sourcePlans:dve({...e,buses:e.allBuses},r,i)}}function rat(e){let t=e.filter((n)=>n.termination.type==="boundary"&&n.connections.length>=8&&n.allowedLayers?.length===1&&n.allowedLayers[0]!=="top");if(t.some((n)=>n.connections.length>=16))return!1;return t.some((n,o)=>t.slice(o+1).some((r)=>r.componentId===n.componentId&&r.exitEdge===n.exitEdge&&r.allowedLayers[0]===n.allowedLayers[0]))}function Y8e(e){return e.some((t)=>{if(t.termination.type!=="boundary"||t.connections.length<8||t.allowedLayers?.length!==1||t.allowedLayers[0]==="top")return!1;let n=t.exitEdge==="left"||t.exitEdge==="right"?"x":"y",o=t.exitEdge==="left"||t.exitEdge==="bottom"?-1:1,r=n==="x"?(t.componentBounds.minX+t.componentBounds.maxX)/2:(t.componentBounds.minY+t.componentBounds.maxY)/2;return t.connections.every((i)=>o*(i.sourcePoint[n]-r)<-0.0000001)})}function tGr(e,t){let n=e[0];if(!n||t||e.some((c)=>c.componentId!==n.componentId||c.connections.some((l)=>l.sourceLayer!=="top")))return!1;let o=e.filter((c)=>c.termination.type==="boundary"),r=o.filter((c)=>c.connections.length>=8),i=r[0]?.exitEdge;if(!i||r.some((c)=>c.exitEdge!==i)||!(r.some((c)=>c.connections.length>=16&&c.allowedLayers?.length===1&&c.allowedLayers[0]!=="top")||rat(r)))return!1;let s=o.reduce((c,l)=>c+l.connections.length,0);if(e.filter((c)=>c.termination.type==="plane").reduce((c,l)=>c+l.connections.length,0)<s)return!1;return!0}var WJ=0.0000001,nGr={left:"right",right:"left",up:"down",down:"up"};function jrt(e){let t=e;if(t.shape==="circle"||e.type!=="rect")return null;let n=(t.ccwRotationDegrees??0)/90;if(Math.abs(n-Math.round(n))>WJ)return null;return Math.abs(Math.round(n))%2===0?{x:e.width,y:e.height}:{x:e.height,y:e.width}}function Mfn(e,t){let n=jrt(t);if(!n||Math.abs(n.x-n.y)<WJ)return null;let{center:o}=t;if(n.x>n.y){if(Math.abs(o.x-n.x/2-e.minX)<WJ)return"left";if(Math.abs(o.x+n.x/2-e.maxX)<WJ)return"right"}else{if(Math.abs(o.y-n.y/2-e.minY)<WJ)return"down";if(Math.abs(o.y+n.y/2-e.maxY)<WJ)return"up"}return null}function iat(e){let t=e.buses[0];if(!t||e.allowBlindAndBuriedVias||e.buses.some((a)=>a.componentId!==t.componentId||a.connections.some((c)=>c.sourceLayer!=="top")))return null;let n={minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0};for(let a of t.componentObstacles){let c=jrt(a);if(!c)return null;n.minX=Math.min(n.minX,a.center.x-c.x/2),n.maxX=Math.max(n.maxX,a.center.x+c.x/2),n.minY=Math.min(n.minY,a.center.y-c.y/2),n.maxY=Math.max(n.maxY,a.center.y+c.y/2)}let o=new Set;for(let a of e.buses){if(a.termination.type!=="boundary")continue;for(let c of a.connections){let l=Mfn(n,c.sourceObstacle);if(!l)return null;o.add(l)}}if(o.size!==4)return null;let r=new Map,i=new Map,s=[];for(let a of e.buses){let c=a.termination.type==="plane"?a.termination.layer:(a.routableEscapeLayers??a.allowedLayers??e.layerNames).filter((l)=>l!=="top").at(-1);if(!c||!e.layerNames.includes(c))return null;for(let l of a.connections){let h=l.sourceObstacle,d=jrt(h);if(!d)return null;let u=Mfn(n,h);if(!u){if(a.termination.type!=="plane")return null;u=a.direction}else if((e.side??"inward")==="inward")u=nGr[u];let _=l.sourcePoint,p=e.viaDiameter/2+e.clearance+0.001,m=u==="left"?{x:h.center.x-d.x/2-p,y:_.y}:u==="right"?{x:h.center.x+d.x/2+p,y:_.y}:u==="up"?{x:_.x,y:h.center.y+d.y/2+p}:{x:_.x,y:h.center.y-d.y/2-p},A=a.sharedBoundary,g=e.viaDiameter/2;if(m.x-g<A.minX||m.x+g>A.maxX||m.y-g<A.minY||m.y+g>A.maxY)return null;if(r.has(l.connectionIndex))throw Error("FanoutSolver: duplicate peripheral source connection");r.set(l.connectionIndex,m),i.set(l.connectionIndex,[_,m]),s.push(B6({...e,bus:a,terminal:{connection:l,viaPoint:m,exitPoint:m},targetLayer:c,targetLayerPoints:[m],sourceEscapePoints:[_,m],allowBlindAndBuriedVias:!1}))}}if(!wp({...e,plans:s,sharedBoundary:t.sharedBoundary,allowBlindAndBuriedVias:!1})||!lu({inputSrj:e.srj,routedSrj:{...e.srj,traces:[...e.srj.traces??[],...s.map((a)=>a.trace)]},clearance:e.clearance,allowBlindAndBuriedVias:!1}).valid)return null;return{fixedViaPointsByConnectionIndex:r,sourceEscapePaths:i,sourcePlans:s}}function gCn(e){let t=new Map;for(let o of e){let r=Xi(o.exitEdge,o.preferredExit);if(o.termination.type!=="boundary"||!o.exitEdge||!r)continue;let i=`${o.exitEdge}:${r}`,s=t.get(i)??[];s.push(o),t.set(i,s)}let n=new Map;for(let o of t.values()){let r=o[0].exitEdge==="left"||o[0].exitEdge==="right"?"y":"x",i=o.map((c,l)=>({bus:c,index:l,min:Math.min(...c.connections.map((h)=>h.sourcePoint[r])),max:Math.max(...c.connections.map((h)=>h.sourcePoint[r]))})).sort((c,l)=>c.min-l.min||c.index-l.index),s=[];for(let c of i){let l=s.at(-1);if(!l||c.min>l.max+0.000000001)s.push({max:c.max,members:[c]});else l.max=Math.max(l.max,c.max),l.members.push(c)}let a=0;for(let c of s)for(let{bus:l}of c.members.sort((h,d)=>h.index-d.index))n.set(l.busId,a),a+=l.connections.length}return n}function Krt(e){let{buses:t,targetLayerByBusId:n,traceWidth:o,clearance:r}=e,i=o+r;if(!(o>0)||!(e.viaDiameter>0)||r<0||![o,e.viaDiameter,r].every(Number.isFinite))throw Error("FanoutSolver: invalid boundary packing dimensions");let s=gCn(t),a=[],c=new Map;for(let l of t){if(l.termination.type!=="boundary")continue;if(l.connections.length===0)throw Error(`FanoutSolver: bus ${l.busId} has no connections`);if(!l.exitEdge)throw Error(`FanoutSolver: bus ${l.busId} has no boundary edge`);let h=n.get(l.busId);if(!h||!e.layerNames.includes(h)||!(l.routableEscapeLayers??l.allowedLayers??e.layerNames).includes(h))throw Error(`FanoutSolver: bus ${l.busId} has no legal assigned layer`);let d=BP(l.exitEdge),u=Xi(l.exitEdge,l.preferredExit),_=l.connections.map((y)=>u?Tv({...e,bus:l,connection:y,targetLayer:h,cornerExitLaneOffset:s.get(l.busId)??0,windingOrderIndex:0}):iG({...e,bus:l,connection:y,targetLayer:h,boundaryDirection:d,windingOrderIndex:0})),p=_.toSorted((y,x)=>y-x);if(p.some((y,x)=>!Number.isFinite(y)||x>0&&y-p[x-1]<i-0.00000001))throw Error(`FanoutSolver: bus ${l.busId} already contains overlapping desired lanes`);let m=l.exitEdge==="left"||l.exitEdge==="right",A={busId:l.busId,layer:h,edge:l.exitEdge,minimum:m?l.sharedBoundary.minY:l.sharedBoundary.minX,maximum:m?l.sharedBoundary.maxY:l.sharedBoundary.maxX,connectionIndices:l.connections.map((y)=>y.connectionIndex),desiredTracks:_,tracks:[..._],desiredStart:p[0],desiredEnd:p.at(-1),start:p[0],end:p.at(-1),shift:0};if(![A.minimum,A.maximum].every(Number.isFinite)||A.maximum<A.minimum)throw Error(`FanoutSolver: invalid boundary for ${l.busId}`);a.push(A);let g=`${h}:${l.exitEdge}`,f=c.get(g)??[];f.push(A),c.set(g,f)}for(let l of c.values()){let h=(f)=>Number(((f.desiredStart+f.desiredEnd)/2).toFixed(9)),d=l.toSorted((f,y)=>h(f)-h(y)),u=Math.max(...d.map((f)=>f.minimum)),_=Math.min(...d.map((f)=>f.maximum));if(d.every((f,y)=>f.desiredStart>=u&&f.desiredEnd<=_&&(y===0||f.desiredStart-d[y-1].desiredEnd>=i-0.00000001)))continue;let p=[],m=0;for(let[f,y]of d.entries())p.push(m),m+=y.desiredEnd-y.desiredStart+(f<d.length-1?i:0);if(m>_-u+0.00000001)throw Error(`FanoutSolver: bus intervals do not fit ${d[0].layer}/${d[0].edge}`);let A=[];for(let[f,y]of d.entries()){A.push({first:f,last:f,weight:y.connectionIndices.length,mean:y.desiredStart-p[f]});while(A.length>1&&A.at(-2).mean>A.at(-1).mean){let x=A.pop(),C=A.pop(),b=C.weight+x.weight;A.push({first:C.first,last:x.last,weight:b,mean:(C.mean*C.weight+x.mean*x.weight)/b})}}let g=_-m;for(let f of A){let y=Math.max(u,Math.min(g,f.mean));for(let x=f.first;x<=f.last;x++){let C=d[x];C.start=y+p[x],C.shift=C.start-C.desiredStart,C.end=C.desiredEnd+C.shift,C.tracks=C.desiredTracks.map((b)=>b+C.shift)}}}return{tracksByConnectionIndex:new Map(a.flatMap((l)=>l.connectionIndices.map((h,d)=>[h,l.tracks[d]]))),intervals:a}}function oGr(e){if(e.exitTargetPoint)return e.exitTargetPoint.layer??"top";let t=e.targetPoint;return"layer"in t?t.layer??"top":t.layers[0]??"top"}function ACn(e){let t=e.exitEdge==="left"||e.exitEdge==="right"?"y":"x",n=new Map;for(let o of e.connections){let r=oGr(o);n.set(r,[...n.get(r)??[],o])}return[...n.values()].map((o)=>o.toSorted((r,i)=>{let s=(r.exitTargetPoint??r.targetPoint)[t]-(i.exitTargetPoint??i.targetPoint)[t];if(s!==0)return s;let a=(c)=>("source_trace_id"in c.connection)&&typeof c.connection.source_trace_id==="string"?c.connection.source_trace_id:c.connection.name;return a(r).localeCompare(a(i))||r.connection.name.localeCompare(i.connection.name)||r.connectionIndex-i.connectionIndex}))}function rGr(e,t){let n=e.exitEdge==="left"||e.exitEdge==="right"?"y":"x";return ACn(e).every((o)=>o.every((r,i)=>{let s=t.get(r.connectionIndex);if(!s||!Number.isFinite(s.x)||!Number.isFinite(s.y))return!1;return i===0||s[n]>t.get(o[i-1].connectionIndex)[n]}))}function sat(e){let t=e.maximumSearchStates??4096;if(!Number.isSafeInteger(t)||t<1)throw Error("FanoutSolver: invalid boundary merge work bound");let n=new Map(e.exits);for(let o of e.buses){if(o.termination.type!=="boundary"||!o.exitEdge||o.connections.length<3)continue;if(o.connections.some((m)=>!m.hasExplicitLayeredExitTarget))continue;let r=ACn(o);if(r.length<2)continue;if(r.reduce((m,A)=>m*(A.length+1),1)>t)continue;let s=o.exitEdge==="left"||o.exitEdge==="right"?"y":"x",a=s==="x"?"y":"x",c=o.exitEdge==="left"||o.exitEdge==="bottom"?-1:1,l={x:(o.componentBounds.minX+o.componentBounds.maxX)/2,y:(o.componentBounds.minY+o.componentBounds.maxY)/2},h=new Map(o.connections.map((m)=>[m.connectionIndex,Math.atan2(m.sourcePoint[s]-l[s],c*(m.sourcePoint[a]-l[a]))])),d=o.connections.map((m)=>{let A=n.get(m.connectionIndex);if(!A||!Number.isFinite(A.x)||!Number.isFinite(A.y))throw Error("FanoutSolver: missing packed boundary target");return A[s]}).sort((m,A)=>m-A);if(d.some((m,A)=>A>0&&m<=d[A-1]))throw Error("FanoutSolver: duplicate packed boundary tracks");let u=new Map,_=(m)=>{let A=m.join(","),g=u.get(A);if(g)return g;let f=m.reduce((x,C)=>x+C,0);if(f===d.length)return{inversions:0,length:0,order:[]};let y;for(let[x,C]of r.entries()){let b=C[m[x]];if(!b)continue;let I=r.reduce((T,N,D)=>T+N.slice(0,m[D]).filter((L)=>h.get(L.connectionIndex)>h.get(b.connectionIndex)+0.000000001).length,0),v=[...m];v[x]++;let P=_(v),M={...n.get(b.connectionIndex),[s]:d[f]},B={inversions:I+P.inversions,length:Math.hypot(b.sourcePoint.x-M.x,b.sourcePoint.y-M.y)+P.length,order:[b,...P.order]};if(!y||B.inversions<y.inversions||B.inversions===y.inversions&&B.length<y.length)y=B}if(!y)throw Error("FanoutSolver: incomplete boundary merge state");return u.set(A,y),y},p=new Map(n);for(let[m,A]of _(r.map(()=>0)).order.entries())p.set(A.connectionIndex,{...n.get(A.connectionIndex),[s]:d[m]});if(!rGr(o,p))throw Error("FanoutSolver: boundary merge changed a layer's lane order");for(let m of o.connections)n.set(m.connectionIndex,p.get(m.connectionIndex))}return n}var tot=(e,t)=>{let n=e.sharedBoundary;switch(e.exitEdge){case"left":return{x:n.minX,y:t};case"right":return{x:n.maxX,y:t};case"top":return{x:t,y:n.maxY};case"bottom":return{x:t,y:n.minY};default:throw Error(`FanoutSolver: bus ${e.busId} has no boundary edge`)}};function iGr(e,t,n,o){let r=(i,s,a)=>(s.x-i.x)*(a.y-i.y)-(s.y-i.y)*(a.x-i.x);return r(e,t,n)*r(e,t,o)<-0.000000000001&&r(n,o,e)*r(n,o,t)<-0.000000000001}function sGr(e){let{buses:t,layerNames:n,traceWidth:o,clearance:r}=e,i=o+r,s=new Map,a=[];for(let d of t){if(d.termination.type==="plane"){s.set(d.busId,d.termination.layer);continue}let u=new Set(d.connections.map((g)=>g.sourceLayer)),_=(d.routableEscapeLayers??d.allowedLayers??n).filter((g)=>e.allowSourceLayerTargets||!u.has(g));if(!_.length)return null;let p=_.map((g)=>Krt({...e,buses:[d],targetLayerByBusId:new Map([[d.busId,g]])}).intervals[0]),m=d.connections.length,A=d.connections.reduce((g,f)=>({x:g.x+f.sourcePoint.x/m,y:g.y+f.sourcePoint.y/m}),{x:0,y:0});a.push({bus:d,source:A,intervals:p})}a.sort((d,u)=>d.intervals.length-u.intervals.length||Math.max(...u.intervals.map((_)=>_.end-_.start))-Math.max(...d.intervals.map((_)=>_.end-_.start))||u.bus.connections.length-d.bus.connections.length);let c=[];for(let{bus:d,source:u,intervals:_}of a){let p;for(let m of _){let A=c.filter((M)=>M.interval.layer===m.layer),g=A.filter((M)=>M.interval.edge===m.edge),f=Math.max(m.minimum,...g.map((M)=>M.interval.minimum)),y=Math.min(m.maximum,...g.map((M)=>M.interval.maximum)),x=m.end-m.start+g.reduce((M,B)=>M+B.interval.end-B.interval.start+i,0);if(x>y-f+0.00000001)continue;let C=tot(d,(m.start+m.end)/2),b=A.reduce((M,B)=>M+(iGr(u,C,B.source,B.target)?Math.min(d.connections.length,B.bus.connections.length):0),0),I=g.reduce((M,B)=>M+B.bus.connections.length,0),v=A.reduce((M,B)=>M+B.bus.connections.length,0),P=b*4+I+v/4+10*x/Math.max(i,y-f);if(!p||P<p.score||P===p.score&&n.indexOf(m.layer)>n.indexOf(p.interval.layer))p={interval:m,score:P}}if(!p)return null;s.set(d.busId,p.interval.layer),c.push({bus:d,source:u,interval:p.interval,target:tot(d,(p.interval.start+p.interval.end)/2)})}let l=Krt({...e,targetLayerByBusId:s}),h=new Map;for(let{bus:d}of a)for(let u of d.connections)h.set(u.connectionIndex,tot(d,l.tracksByConnectionIndex.get(u.connectionIndex)));return{targetLayerByBusId:s,exits:sat({buses:t,exits:h})}}function*aGr(e){let{plans:t,bus:n,preparedBuses:o,inputSrj:r,layerNames:i}=e;if(n.termination.type!=="boundary"||n.connections.length!==2||n.maxLengthSkew===void 0||n.connections.some((g)=>g.sourceLayer!=="top"))return null;let s=o.flatMap((g)=>g.connections),a=new Map(t.map((g)=>[g.connectionIndex,g]));if(s.length!==r.connections.length||a.size!==s.length||t.length!==a.size||s.some((g)=>a.get(g.connectionIndex)?.connectionName!==g.connection.name))throw Error("FanoutSolver: transit pair repair requires every original plan");let c=n.connections.map((g)=>a.get(g.connectionIndex)),l=c[0].targetLayer;if(c.some((g)=>g.targetLayer!==l)||Math.abs(c[0].length-c[1].length)<=n.maxLengthSkew+0.000001)return null;let h=(n.routableEscapeLayers??n.allowedLayers??i).filter((g)=>g!=="top"&&g!==l);if(!h.length)return null;let d=new Map,u=new Map;for(let g of s){let f=a.get(g.connectionIndex);if(!f.via)return null;let y=f.segments.slice(0,f.sourceEscapeSegmentCount??1);if(!y.length||y.some((x)=>x.layer!==g.sourceLayer)||Ut(y[0].start,g.sourcePoint)>0.000001||Ut(y.at(-1).end,f.via.center)>0.000001||y.some((x,C)=>C>0&&Ut(y[C-1].end,x.start)>0.000001))return null;d.set(g.connectionIndex,f.via.center),u.set(g.connectionIndex,[g.sourcePoint,...y.map((x)=>x.end)])}let _=new Set(n.connections.map((g)=>g.connectionIndex)),p=(n.routableEscapeLayers??n.allowedLayers??i).filter((g)=>g!=="top"),m=5000000,A;for(let g of[void 0,...p]){if(m<=0)break;let f=new Map(d),y=new Map(u);if(g!==void 0){if(A??=iat({...e,srj:r,buses:o,side:"inward"}),!A)break;for(let T of _)f.set(T,A.fixedViaPointsByConnectionIndex.get(T)),y.set(T,A.sourceEscapePaths.get(T))}let x=q3({...e,srj:r,allBuses:o,buses:[n],targetLayer:l,startLayerByBusId:g===void 0?void 0:new Map([[n.busId,g]]),transitLayers:h,terminals:n.connections.map((T)=>({connection:T,viaPoint:f.get(T.connectionIndex),exitPoint:a.get(T.connectionIndex).exitPoint})),fixedViaPointsByConnectionIndex:f,sourceEscapePaths:y,acceptedPlans:t.filter((T)=>!_.has(T.connectionIndex)),routeFromSourcePads:g===void 0,sourceLayerTravelCost:1,sourceOriginPhysicalGridPhase:!0,tightViaChannels:!0,includeDiagonalNeighbors:!0,traceMarginExtra:0,maximumIterations:Math.min(m,g===void 0?5000000:2000000),maximumRipEvents:80,maximumLocalRepairAttempts:0,ripCost:256,shuffleSeed:1}),C=x.next(),b=0;while(!C.done)b=C.value.iterations,yield C.value,C=x.next();m-=b;let I=C.value;if(!I||I.length!==2)continue;let v=new Map(I.map((T)=>[T.connectionIndex,T])),P=t.map((T)=>v.get(T.connectionIndex)??T),M=yx({...e,plans:P,preparedBuses:[n],sharedBoundary:n.sharedBoundary,maximumWorkUnits:1e5,allowSourcePrefixMatching:!0,allowDistributedMatching:!0,allowTransitLayerMatching:!0,allowMatchingInsideDenseBounds:!0});if(!M.plans||M.plans.some((T)=>!_.has(T.connectionIndex)&&T!==a.get(T.connectionIndex)))continue;let B=M.plans.filter((T)=>_.has(T.connectionIndex));if(B.length!==2||Math.abs(B[0].length-B[1].length)>n.maxLengthSkew+0.000001)continue;if(lu({inputSrj:r,routedSrj:{...r,traces:[...r.traces??[],...M.plans.flatMap((T)=>[T.trace,...T.planeEndpointTrace?[T.planeEndpointTrace]:[]])]},clearance:e.clearance,allowBlindAndBuriedVias:!1}).valid)return M.plans}return null}var BY=0.000001,not=(e)=>Math.max(...e.map((t)=>t.length))-Math.min(...e.map((t)=>t.length));function*fCn(e){let{plans:t,bus:n,preparedBuses:o,inputSrj:r}=e,i=o.flatMap((p)=>p.connections),s=new Map(t.map((p)=>[p.connectionIndex,p]));if(i.length!==r.connections.length||s.size!==t.length||s.size!==i.length||i.some((p)=>s.get(p.connectionIndex)?.connectionName!==p.connection.name))throw Error("FanoutSolver: source-origin length repair requires every original plan");let a=n.connections.map((p)=>s.get(p.connectionIndex));if(n.termination.type!=="boundary"||n.maxLengthSkew===void 0||a.length<2||not(a)<=n.maxLengthSkew+BY)return null;let c=a[0].targetLayer;if(a.some((p)=>p.targetLayer!==c))return null;let l=Math.min(...a.map((p)=>p.length)),h=new Set((a.length===2?a:a.filter((p)=>p.length>l+n.maxLengthSkew+BY).toSorted((p,m)=>m.length-p.length||p.connectionIndex-m.connectionIndex).slice(0,2)).map((p)=>p.connectionIndex));if(!h.size)return null;let d=new Map,u=new Map;for(let p of i){let m=s.get(p.connectionIndex);if(!m.via)return null;let A=m.segments.slice(0,m.sourceEscapeSegmentCount??1);if(!A.length||A.some((g)=>g.layer!==p.sourceLayer)||Ut(A[0].start,p.sourcePoint)>BY||Ut(A.at(-1).end,m.via.center)>BY||A.some((g,f)=>f>0&&Ut(A[f-1].end,g.start)>BY))return null;d.set(p.connectionIndex,m.via.center),u.set(p.connectionIndex,[p.sourcePoint,...A.map((g)=>g.end)])}let _=n.connections.filter((p)=>h.has(p.connectionIndex));for(let p of[!1,!0]){let m=yield*q3({...e,srj:r,allBuses:o,buses:[{...n,connections:_}],targetLayer:c,transitLayers:e.transitLayers??[],terminals:_.map((x)=>({connection:x,viaPoint:d.get(x.connectionIndex),exitPoint:s.get(x.connectionIndex).exitPoint})),fixedViaPointsByConnectionIndex:d,sourceEscapePaths:u,acceptedPlans:t.filter((x)=>!h.has(x.connectionIndex)),routeFromSourcePads:!0,includeDiagonalNeighbors:p,sourceLayerTravelCost:1,tightViaChannels:!0,ripCost:256,shuffleSeed:1,maximumRipEvents:40,maximumIterations:5000000,maximumLocalRepairAttempts:0});if(!m||m.length!==h.size)continue;let A=new Map(m.map((x)=>[x.connectionIndex,x])),g=t.map((x)=>A.get(x.connectionIndex)??x),f=a.map((x)=>A.get(x.connectionIndex)??x);if(not(f)>=not(a)-BY&&Math.max(...f.map((x)=>x.length))>=Math.max(...a.map((x)=>x.length))-BY)continue;if(lu({inputSrj:r,routedSrj:{...r,traces:[...r.traces??[],...g.flatMap((x)=>[x.trace,...x.planeEndpointTrace?[x.planeEndpointTrace]:[]])]},clearance:e.clearance,allowBlindAndBuriedVias:!1}).valid)return g}return null}function cue(e){return typeof e==="object"&&e!==null&&"type"in e&&e.type==="subsolver"&&"solver"in e&&e.solver instanceof po}function*cGr(e){let{srj:t,buses:n,layerNames:o}=e;yield{phase:"sources",routedConnectionCount:0};let r=iat(e);if(!r)return null;let i=n.filter((C)=>C.termination.type==="boundary");if(!i.length||i.some((C)=>!C.exitEdge))return null;let s=sGr(e);if(!s)return null;let a=sat({buses:n,exits:s.exits}),c=new Set(i.map((C)=>s.targetLayerByBusId.get(C.busId))),l=o.findLast((C)=>c.has(C)),h=o.filter((C)=>C!==l&&i.some((b)=>(b.routableEscapeLayers??b.allowedLayers??o).includes(C))),d=r.sourcePlans.filter((C)=>C.termination.type==="plane"),u=q3({...e,allBuses:n,buses:i,targetLayer:l,targetLayerByBusId:s.targetLayerByBusId,transitLayers:h,terminals:i.flatMap((C)=>C.connections.map((b)=>({connection:b,viaPoint:r.fixedViaPointsByConnectionIndex.get(b.connectionIndex),exitPoint:a.get(b.connectionIndex)}))),...r,acceptedPlans:d,routeFromSourcePads:!0,sourceLayerTravelCost:2,sourceOriginPhysicalGridPhase:!0,includeDiagonalNeighbors:!0,traceMarginExtra:0,maximumIterations:60000000,maximumRipEvents:1000,maximumLocalRepairAttempts:0,ripCost:64,shuffleSeed:1}),_=u.next();while(!_.done){if(cue(_.value)){let C=yield _.value;_=u.next(C);continue}yield{phase:"route-layer",iterations:_.value.iterations,routedConnectionCount:d.length+_.value.routedConnectionCount},_=u.next()}if(!_.value)return null;let p=[..._.value,...d];yield{phase:"repair-lengths",routedConnectionCount:p.length};let m=hZ({...e,inputSrj:t,plans:p,preparedBuses:n});if(!m)return null;p=m;for(let C of i){if(C.maxLengthSkew===void 0)continue;let b=fCn({...e,inputSrj:t,plans:p,preparedBuses:n,bus:C}),I=b.next();while(!I.done)yield{phase:"repair-lengths",iterations:I.value.iterations,routedConnectionCount:p.length},I=b.next();if(I.value)p=I.value}yield{phase:"match-layer",routedConnectionCount:p.length};let A=p,g={...e,inputSrj:t,plans:p,preparedBuses:n,sharedBoundary:i[0].sharedBoundary,maximumWorkUnits:1000,allowSourcePrefixMatching:!0,candidatePlansAreFeasible:(C)=>(A=[...C],!0)},f=yx(g);if(!f.plans)f=yx({...g,maximumWorkUnits:1e5,allowDistributedMatching:!0,allowTransitLayerMatching:!0,allowMatchingInsideDenseBounds:!0});let y=new Set;while(!f.plans){let C=f.failedBus.busId,b=i.find((P)=>P.busId===C);if(!b||b.connections.length!==2||b.maxLengthSkew===void 0||y.has(b.busId))return null;y.add(b.busId);let I=aGr({...e,inputSrj:t,plans:A,preparedBuses:n,bus:b}),v=I.next();while(!v.done)yield{phase:"repair-lengths",iterations:v.value.iterations,routedConnectionCount:p.length},v=I.next();if(!v.value)return null;A=v.value,f=yx({...g,plans:A,maximumWorkUnits:1e5,allowDistributedMatching:!0,allowTransitLayerMatching:!0,allowMatchingInsideDenseBounds:!0})}if(!f.plans)return null;let x=Jst({...e,inputSrj:t,plans:f.plans,preparedBuses:n});if(!x||x.length!==t.connections.length||new Set(x.map((C)=>C.connectionIndex)).size!==x.length)return null;return lu({inputSrj:t,routedSrj:{...t,traces:[...t.traces??[],...x.flatMap((C)=>[C.trace,...C.planeEndpointTrace?[C.planeEndpointTrace]:[]])]},clearance:e.clearance,allowBlindAndBuriedVias:!1}).valid?x:null}function lGr(e){let t=e.candidateSets.flat(),n=t.length,o=new Uint8Array(n*n),r=new Set,i=new Map,s=0,a=e.candidateSets.map((x)=>x.map(()=>s++)),c=0,l=(x,C)=>{let b=Math.min(x,C)*n+Math.max(x,C),I=o[b];if(I)return I===1;let v=e.areCompatible(t[x],t[C]);return o[b]=v?1:2,v},h=a.map(()=>[]);for(let x=0;x<a.length;x++)for(let C=x+1;C<a.length;C++)if(a[x].some((b)=>a[C].some((I)=>!l(b,I))))h[x].push(C),h[C].push(x);let d=(x,C,b)=>{let I=[],v=!0;for(let P of C){if(x[P].length===0){r.add(P),v=!1;continue}for(let M of h[P])if(C.includes(M)&&(b===void 0||M===b))I.push([P,M])}for(let P=0;P<I.length;P++){let[M,B]=I[P];if(x[M].length===0||x[B].length===0)continue;let T=x[M].filter((N)=>x[B].some((D)=>l(N,D)));if(T.length===x[M].length)continue;if(i.set(M,B),x[M]=T,T.length===0){r.add(M),v=!1;continue}for(let N of h[M])if(N!==B&&C.includes(N))I.push([N,M])}return v},u=a.map((x,C)=>C),_=(x)=>{let C=[...x],b=new Set(C);for(let I=0;I<C.length;I++){let v=i.get(C[I]);if(v!==void 0&&!b.has(v))b.add(v),C.push(v)}return[...b]},p=a.map((x)=>[...x]);if(!d(p,u))return{selection:null,searchStates:c,emptyDomainIndices:[...r],conflictDomainIndices:_([...r])};let A=(()=>{let C=Math.max(1,Math.min(5000,Math.floor(e.maximumSearchStates/12)));for(let b=0;b<12;b++){let I=p.map((v,P)=>v[(b*17+P*7)%v.length]);for(let v=0;v<C;v++){let P=I.map(()=>0);for(let D=0;D<I.length;D++)for(let L of h[D]){if(L<=D||l(I[D],I[L]))continue;P[D]=P[D]+1,P[L]=P[L]+1}let M=Math.max(...P);if(M===0)return I;let B=P.map((D,L)=>({conflicts:D,index:L})).filter(({conflicts:D})=>D===M),T=B[(v+b)%B.length].index,N=p[T].map((D,L)=>({candidate:D,index:L,conflicts:h[T].filter((H)=>!l(D,I[H])).length})).toSorted((D,L)=>D.conflicts-L.conflicts||(D.index-v-b)%p[T].length-(L.index-v-b)%p[T].length);I[T]=N[0].candidate}}return null})();if(A)return{selection:A.map((x)=>t[x]),searchStates:c,emptyDomainIndices:[],conflictDomainIndices:[]};let g=(x,C,b)=>{if(!d(x,C,b))return null;let I=new Set(C.filter((B)=>x[B].length>1)),v=[];while(I.size>0){let B=[I.values().next().value];I.delete(B[0]);for(let T=0;T<B.length;T++)for(let N of h[B[T]])if(I.delete(N))B.push(N);v.push(B)}if(v.length>1){let B=x;for(let T of v){let N=g(B.slice(),T);if(!N)return null;B=N}return B}let P=-1;for(let B of C)if(x[B].length>1&&(P<0||x[B].length<x[P].length))P=B;if(P<0)return x;let M=x[P].map((B)=>{let T=h[P].filter((N)=>C.includes(N)&&x[N].length>1).map((N)=>x[N].filter((D)=>l(B,D)).length);return{candidate:B,minimumSupport:Math.min(...T),totalSupport:T.reduce((N,D)=>N+D,0)}}).toSorted((B,T)=>T.minimumSupport-B.minimumSupport||T.totalSupport-B.totalSupport);for(let{candidate:B}of M){if(c>=e.maximumSearchStates)return null;c++;let T=x.slice();T[P]=[B];let N=g(T,C,P);if(N)return N}return null},f=g(p,u),y=r.size>0||f?[...r]:[u.toSorted((x,C)=>h[C].length-h[x].length||p[x].length-p[C].length)[0]];return{selection:f?.map((x)=>t[x[0]])??null,searchStates:c,emptyDomainIndices:y,conflictDomainIndices:f?[]:_(y)}}var n9e=0.000000001;function hGr(e){let t=e.candidateBusIds.filter((p)=>!e.activeBusIds.has(p));if(t.length<2)return t;let n=t.length-1,o=e.planeBuses.find((p)=>p.busId===t[n]),r=o?.connections[0]?.sourcePoint;if(!o||!r||o.connections.length!==1||o.termination.type!=="plane")return t;let i=o.termination.layer,s=o.direction==="up"||o.direction==="down"?"x":"y",a=s==="x"?"y":"x",c=s==="x"?o.xCoordinates:o.yCoordinates,l=s==="x"?o.pitchX:o.pitchY;if(c.length===0||!Number.isFinite(l)||l<=n9e)return t;let h=(Math.min(...c)+Math.max(...c))/2,d=Math.sign(h-r[s]);if(d===0)return t;let u=new Set(t),_=e.planeBuses.filter((p)=>{let m=p.connections[0]?.sourcePoint;if(p===o||p.componentId!==o.componentId||p.termination.type!=="plane"||p.termination.layer!==i||p.direction!==o.direction||p.connections.length!==1||!m||e.activeBusIds.has(p.busId)||u.has(p.busId)||Math.abs(m[a]-r[a])>n9e)return!1;let A=(m[s]-r[s])*d;return A>n9e&&A<=l+n9e}).toSorted((p,m)=>{let A=p.connections[0].sourcePoint,g=m.connections[0].sourcePoint;return Math.abs(A[s]-r[s])-Math.abs(g[s]-r[s])||p.connections[0].connectionIndex-m.connections[0].connectionIndex})[0];if(!_)return t;return t.map((p,m)=>m===n?_.busId:p)}function dGr(e){let t=e[0];if(!t||e.some((l)=>l.componentId!==t.componentId))return;let n=e.flatMap((l)=>l.connections.map((h)=>h.sourcePoint));if(n.length===0)return;let o=n.reduce((l,h)=>({x:l.x+h.x,y:l.y+h.y}),{x:0,y:0});o.x/=n.length,o.y/=n.length;let{minX:r,maxX:i,minY:s,maxY:a}=t.componentBounds,c=[{edge:"left",distance:Math.abs(o.x-r)},{edge:"right",distance:Math.abs(i-o.x)},{edge:"bottom",distance:Math.abs(o.y-s)},{edge:"top",distance:Math.abs(a-o.y)}].toSorted((l,h)=>l.distance-h.distance);if(Math.abs(c[0].distance-c[1].distance)<=0.000000001)return;return c[0].edge}function wfn(e,t){if(t)return!1;let n=e.filter((d)=>d.termination.type==="boundary"),o=n.filter((d)=>d.connections.length===1),r=n.filter((d)=>d.connections.length===2),i=n.filter((d)=>d.connections.length>=8),s=e.filter((d)=>d.termination.type==="plane"&&d.connections.length===1).length,a=i[0]?.exitEdge;if(n.length!==9||o.length!==3||r.length!==3||i.length!==3||s<64||a===void 0||i.some((d)=>d.exitEdge!==a))return!1;let c=dGr(i);if(c===void 0)return!1;return(c==="left"||c==="right")!==(a==="left"||a==="right")}function uGr(e){let{trace:t,layerNames:n,allowBlindAndBuriedVias:o}=e;return{...t,route:t.route.map((r)=>r.route_type==="via"&&!o?{...r,layers:G5({fromLayer:r.from_layer,toLayer:r.to_layer,layerNames:n,allowBlindAndBuriedVias:o})}:{...r})}}function pGr(e){let{srj:t,layerNames:n,allowBlindAndBuriedVias:o}=e;return{...t,traces:(t.traces??[]).map((r)=>uGr({trace:r,layerNames:n,allowBlindAndBuriedVias:o}))}}function oot(e,t,n,o){let r=n.spanLayers.map((s)=>{let a=t.indexOf(s);if(a<0)throw Error(`FanoutSolver: via for "${e.connectionName}" uses unknown layer "${s}"`);return a}),i=PG(e);return{obstacleId:o==="endpoint"?i.planeEndpointViaObstacleId:o===0?i.viaObstacleId:`${i.viaObstacleId}:${o}`,type:"rect",center:n.center,width:n.diameter,height:n.diameter,layers:n.spanLayers,zLayers:r,__zLayers:r,connectedTo:[e.connectionName,e.trace.pcb_trace_id]}}function TY(e){let{inputSrj:t,plans:n,layerNames:o}=e,r=t.connections.map((d)=>({...d,pointsToConnect:d.pointsToConnect.map((u)=>({...u}))})),i=[],s=new Set;for(let d of n){let u=r[d.connectionIndex];if(!u)throw Error(`FanoutSolver: output connection index ${d.connectionIndex} is missing`);let _=PG(d);if(u.pointsToConnect[d.sourcePointIndex]={x:d.exitPoint.x,y:d.exitPoint.y,layer:d.targetLayer,pointId:d.termination.type==="plane"?_.planeExitPointId:_.boundaryExitPointId},d.termination.type==="plane")s.add(d.connectionName);if(d.via){let p=oot(d,o,d.via,0);if(p)i.push(p)}for(let[p,m]of(d.additionalVias??[]).entries()){let A=oot(d,o,m,p+1);if(A)i.push(A)}if(d.planeEndpointVia){let p=oot(d,o,d.planeEndpointVia,"endpoint");if(p)i.push(p)}}let a=n.flatMap((d)=>[d.trace,...d.planeEndpointTrace?[d.planeEndpointTrace]:[]]),c=a.flatMap((d)=>d.route.filter((u)=>("x"in u)&&("y"in u))),l=Math.max(t.defaultObstacleMargin??0,t.minTraceWidth),h=c.length===0?{...t.bounds}:{minX:Math.min(t.bounds.minX,...c.map((d)=>d.x-l)),maxX:Math.max(t.bounds.maxX,...c.map((d)=>d.x+l)),minY:Math.min(t.bounds.minY,...c.map((d)=>d.y-l)),maxY:Math.max(t.bounds.maxY,...c.map((d)=>d.y+l))};return{...t,fanoutPlaneConnectivity:n.flatMap((d)=>d.termination.type==="plane"?[{connectionName:d.connectionName,layer:d.termination.layer}]:[]),bounds:h,connections:r.filter((d)=>!s.has(d.name)),buses:t.buses?.map((d)=>({...d,connectionNames:d.connectionNames.filter((u)=>!s.has(u))})).filter((d)=>d.connectionNames.length>0),obstacles:[...t.obstacles.map((d)=>({...d,center:{...d.center},layers:[...d.layers],connectedTo:[...d.connectedTo]})),...i],traces:[...(t.traces??[]).map((d)=>({...d,route:d.route.map((u)=>({...u}))})),...a]}}var mGr=5,_Gr=40,gGr=64,Bfn=10,AGr=8;function yCn(e){let t=e.length,n=e.reduce((o,r)=>o+r,0);return t>=mGr&&t<=_Gr&&n<=gGr||t===4&&new Set(e).size>1}function fGr({boundaryBusConnectionCounts:e,planeBusCount:t}){let n=e.length;if(n<=Bfn-1&&t>=AGr)return"mixed_with_planes";if(n>=Bfn&&t===0&&yCn(e))return"large_boundary_only";return null}function o9e(e){if(!e.exitEdge)throw Error(`Cannot order boundary bus ${e.busId} without an exit edge`);let t=BP(e.exitEdge);return e.connections.reduce((n,o)=>n+iG({bus:e,connection:o,boundaryDirection:t}),0)/e.connections.length}function yGr({busesInRoutingOrder:e,busLayerAssignments:t,routingMode:n}){if(n!=="large_boundary_only")return[...e];let o=e.filter((s)=>s.connections.length===1);if(new Set(o.map((s)=>s.exitEdge)).size!==1)return[...e];let r=[...e.filter((s)=>s.connections.length>=8).toSorted((s,a)=>o9e(a)-o9e(s)),...e.filter((s)=>s.connections.length>1&&s.connections.length<8)],i=[];for(let s of o){let a=t[s.busId];if(!a)throw Error(`Cannot order boundary bus ${s.busId} without a layer`);let c=i.find((l)=>l.targetLayer===a);if(!c)c={targetLayer:a,buses:[]},i.push(c);c.buses.push(s)}return[...r,...i.flatMap((s)=>s.buses.toSorted((a,c)=>o9e(c)-o9e(a)))]}var r9e=0.0000001;function zde(e,t){let n=e.sourceObstacle,o={...n,width:n.width-0.00000002,height:n.height-0.00000002},r=[],i=!1,s=!1,a=!1;for(let[c,l]of[...e.segments,...e.planeEndpointSegments??[]].entries()){if(!n.layers.includes(l.layer))continue;let h=Wl(l,n),d=l.width/2;if(i&&o.width>0&&o.height>0&&Wl(l,o)<0.0000000001)r.push({segmentIndex:c,kind:"outline"});if(s&&h<d-r9e)r.push({segmentIndex:c,kind:"copper"});if(a&&h<d+t-r9e)r.push({segmentIndex:c,kind:"clearance"});if(!OZ(l.end,n,0.000000001))i=!0;let u=X5(l.end,n);if(u>d+r9e)s=!0;if(u>=d+t-r9e)a=!0}return r}function*xGr(e,t){let n=e.sourceEscapeSegmentCount??1,o=e.segments.slice(0,n),r=o.slice(0,64).findIndex((s,a)=>!VZ(e,e.segments,t,new Set([a])));if(r<0)return;let i=o[r].width+t;for(let s=r;s>=Math.max(0,r-3);s--){let a=0;for(let c=s;c<Math.min(o.length,r+8);c++){let l=o[c];if(l.layer!==e.sourceLayer||c>s&&Ut(o[c-1].end,l.start)>0.0000001)break;if(a+=Ut(l.start,l.end),a>4*i+0.0000001)break;if(c<=r)continue;let h=o[s].start,d=l.end,u=d.x-h.x,_=d.y-h.y,p=Math.min(Math.abs(u),Math.abs(_));for(let m of[{x:h.x+Math.sign(u)*p,y:h.y+Math.sign(_)*p},{x:d.x-Math.sign(u)*p,y:d.y-Math.sign(_)*p}]){if(Ut(h,m)+Ut(m,d)>=a-0.0000001)continue;yield[o[0].start,...o.slice(0,s).map((A)=>A.end),m,d,...o.slice(c+1).map((A)=>A.end)].filter((A,g,f)=>g===0||Ut(A,f[g-1])>0.0000001)}}}}var Vk=0.0000001,CGr=64;function bGr(e,t,n){let o=e,r=(o.ccwRotationDegrees??0)/90;if(e.type!=="rect"||o.shape==="circle"||Math.abs(r-Math.round(r))>Vk||Math.abs(e.width-e.height)<Vk)return null;let i=Math.abs(Math.round(r))%2===1,s=i?e.height:e.width,a=i?e.width:e.height,c=s>a?"x":"y",l=(c==="x"?s:a)/2;return[-1,1].map((h)=>({...t,[c]:e.center[c]+h*(l+n)}))}function IGr(e){let{inputSrj:t,preparedBuses:n,layerNames:o,traceWidth:r,clearance:i}=e,s=n[0];if(!s)return e.plans.length?null:[];let a=s.sharedBoundary;if(n.some((u)=>["minX","maxX","minY","maxY"].some((_)=>u.sharedBoundary[_]!==a[_])))return null;let c=new Map(n.map((u)=>[u.busId,u]));if(new Set(e.plans.map((u)=>u.connectionIndex)).size!==e.plans.length)return null;let l=[...e.plans],h=WP(t,!1),d=F8e({srj:t,sharedBoundary:a,clearance:i,allowBlindAndBuriedVias:!1,allowSameNetMerges:!1});for(let[u,_]of l.entries()){if(!zde(_,i).length)continue;let m=c.get(_.busId)?.connections.find((D)=>D.connectionIndex===_.connectionIndex),A=_.sourceEscapeSegmentCount??1,g=_.segments.slice(0,A),f=_.trace.route.findIndex((D)=>D.route_type==="via"),y=bGr(_.sourceObstacle,_.sourcePoint,r/2+i+0.000001);if(!m||m.sourceObstacle!==_.sourceObstacle||!_.via||f<1||!y||!g.length||g.some((D)=>D.layer!==_.sourceLayer||D.width!==r)||Ut(g[0].start,_.sourcePoint)>Vk||Ut(g.at(-1).end,_.via.center)>Vk||!o.includes(_.sourceLayer))return null;let x=l.filter((D,L)=>L!==u),C=new Jue([..._.segments.slice(A),..._.planeEndpointSegments??[],...x.flatMap((D)=>[...D.segments,...D.planeEndpointSegments??[]]),...h.flatMap((D)=>D.segments)]),b=[..._.additionalVias??[],..._.planeEndpointVia?[_.planeEndpointVia]:[],...x.flatMap((D)=>[D.via,...D.additionalVias??[],D.planeEndpointVia].filter((L)=>!!L)),...h.flatMap((D)=>D.vias)],I=[...new Set([...Array.from({length:Math.min(g.length,CGr-1)},(D,L)=>L+1),g.length])],v=[],P=new Set;for(let D of I){let L=g[D-1].end;for(let H of[null,...y]){let V=H??_.sourcePoint,O=L.x-V.x,U=L.y-V.y,j=Math.min(Math.abs(O),Math.abs(U));for(let Y of[{x:V.x+Math.sign(O)*j,y:V.y+Math.sign(U)*j},{x:L.x-Math.sign(O)*j,y:L.y-Math.sign(U)*j}]){let X=[_.sourcePoint,...H?[H]:[],Y,L].filter((ee,se,ne)=>se===0||Ut(ee,ne[se-1])>Vk),K=JSON.stringify([D,X]);if(P.has(K))continue;P.add(K);let J=X.slice(1).reduce((ee,se,ne)=>ee+Ut(X[ne],se),0)+g.slice(D).reduce((ee,se)=>ee+Ut(se.start,se.end),0);v.push({anchor:D,points:X,length:J})}}}v.sort((D,L)=>D.length-L.length||D.anchor-L.anchor);let M=(D)=>{let L=pG({points:D.map((U)=>({...U,z:o.indexOf(_.sourceLayer)})),chamfer:r/2,segmentIsClear:(U,j)=>{if([U,j].some((X)=>X.x<a.minX||X.x>a.maxX||X.y<a.minY||X.y>a.maxY))return!1;let Y={start:U,end:j,width:r,layer:_.sourceLayer};return t.obstacles.every((X)=>X===_.sourceObstacle||!X.layers.includes(Y.layer)||Wl(Y,X)>=r/2+i-Vk||que({inputSrj:t,segment:Y,bodyObstacle:X,connectionName:_.connectionName}))&&C.querySegment(Y,i).every((X)=>V_(Y,X,i))&&b.every((X)=>!X.spanLayers.includes(Y.layer)||Vr(X.center,U,j)>=(r+X.diameter)/2+i-Vk)}});if(!L)return null;let H=L.slice(1).map((U,j)=>({start:{x:L[j].x,y:L[j].y},end:{x:U.x,y:U.y},width:r,layer:_.sourceLayer})).filter((U)=>Ut(U.start,U.end)>Vk),V=[...H,..._.segments.slice(A)],O=Mv(_,V,!0);if(!O)return null;return O.sourceEscapeSegmentCount=H.length,O.trace={..._.trace,route:[_.trace.route[0],...H.map((U)=>({route_type:"wire",...U.end,width:U.width,layer:U.layer})),..._.trace.route.slice(f)]},zde(O,i).length||!d([...x,O])?null:O},B=(D)=>VZ(D,D.segments,i,new Set(Array.from({length:D.sourceEscapeSegmentCount??1},(L,H)=>H))),T=null,N=null;for(let D of v){let L=M([...D.points,...g.slice(D.anchor).map((H)=>H.end)]);if(!L)continue;if(!B(L)){N??=L;continue}T=L;break}if(!T&&N)for(let D of xGr(N,i)){let L=M(D);if(L&&B(L)){T=L;break}}if(!T)return null;l[u]=T}if(l.some((u)=>zde(u,i).length)||!d(l))return null;return lu({inputSrj:t,routedSrj:{...t,traces:[...t.traces??[],...l.flatMap((u)=>[u.trace,...u.planeEndpointTrace?[u.planeEndpointTrace]:[]])]},clearance:i,allowBlindAndBuriedVias:!1}).valid?l:null}var vGr=new Set(["left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]),SGr=new Set(["left","right","top","bottom"]),PGr={top_left:{direction:"up",preferredExit:"top-left",exitEdge:"top"},top_middle:{direction:"up",preferredExit:"top",exitEdge:"top"},top_right:{direction:"up",preferredExit:"top-right",exitEdge:"top"},right_top:{direction:"right",preferredExit:"top-right",exitEdge:"right"},right_middle:{direction:"right",preferredExit:"right",exitEdge:"right"},right_bottom:{direction:"right",preferredExit:"bottom-right",exitEdge:"right"},bottom_right:{direction:"down",preferredExit:"bottom-right",exitEdge:"bottom"},bottom_middle:{direction:"down",preferredExit:"bottom",exitEdge:"bottom"},bottom_left:{direction:"down",preferredExit:"bottom-left",exitEdge:"bottom"},left_bottom:{direction:"left",preferredExit:"bottom-left",exitEdge:"left"},left_middle:{direction:"left",preferredExit:"left",exitEdge:"left"},left_top:{direction:"left",preferredExit:"top-left",exitEdge:"left"},top:{direction:"up",preferredExit:"top",exitEdge:"top"},right:{direction:"right",preferredExit:"right",exitEdge:"right"},bottom:{direction:"down",preferredExit:"bottom",exitEdge:"bottom"},left:{direction:"left",preferredExit:"left",exitEdge:"left"}};function Tfn(e){let t=[...e].sort((o,r)=>o-r),n=[];for(let o of t)if(n.length===0||Math.abs(n[n.length-1]-o)>0.000001)n.push(o);return n}function Dfn(e){let t=Number.POSITIVE_INFINITY;for(let n=1;n<e.length;n++){let o=e[n]-e[n-1];if(o>0.000001)t=Math.min(t,o)}return t}function Nfn(e,t){let n=t==="x"?"y":"x",o=Number.POSITIVE_INFINITY;for(let r=0;r<e.length;r++){let i=e[r];for(let s=r+1;s<e.length;s++){let a=e[s];if(Math.abs(i.center[n]-a.center[n])>0.000001)continue;let c=Math.abs(i.center[t]-a.center[t]);if(c>0.000001)o=Math.min(o,c)}}return o}function EGr(e){return{minX:Math.min(...e.map((t)=>t.center.x-t.width/2)),maxX:Math.max(...e.map((t)=>t.center.x+t.width/2)),minY:Math.min(...e.map((t)=>t.center.y-t.height/2)),maxY:Math.max(...e.map((t)=>t.center.y+t.height/2))}}function xCn(e,t){let n=t.componentBounds?.[e.componentId];if(!n){let r=e.pitchX*2.25,i=e.pitchY*2.25;return{minX:e.bounds.minX-r,maxX:e.bounds.maxX+r,minY:e.bounds.minY-i,maxY:e.bounds.maxY+i}}if([n.minX,n.maxX,n.minY,n.maxY].some((r)=>!Number.isFinite(r))||n.minX>=n.maxX||n.minY>=n.maxY)throw Error(`FanoutSolver: componentBounds for "${e.componentId}" must contain finite, increasing bounds`);if(n.minX>e.bounds.minX+0.000001||n.maxX<e.bounds.maxX-0.000001||n.minY>e.bounds.minY+0.000001||n.maxY<e.bounds.maxY-0.000001)throw Error(`FanoutSolver: componentBounds for "${e.componentId}" must contain every component pad`);return{...n}}function Rfn(e,t){if([e.minX,e.maxX,e.minY,e.maxY].some((o)=>!Number.isFinite(o))||e.minX>=e.maxX||e.minY>=e.maxY)throw Error("FanoutSolver: sharedBoundary must contain finite, increasing bounds");for(let o of t)if(e.minX>o.bounds.minX+0.000001||e.maxX<o.bounds.maxX-0.000001||e.minY>o.bounds.minY+0.000001||e.maxY<o.bounds.maxY-0.000001)throw Error(`FanoutSolver: sharedBoundary must contain every pad of component "${o.componentId}"`);return{...e}}function MGr(e,t){if(t.sharedBoundary)return Rfn(t.sharedBoundary,e);let n=e.map((i)=>xCn(i,t)),r=Math.max(...e.flatMap((i)=>[i.pitchX,i.pitchY]))*2.25;return Rfn({minX:Math.min(...n.map((i)=>i.minX))-r,maxX:Math.max(...n.map((i)=>i.maxX))+r,minY:Math.min(...n.map((i)=>i.minY))-r,maxY:Math.max(...n.map((i)=>i.maxY))+r},e)}function wGr(e){let t=new Map;for(let o of e){if(!o.componentId||o.isCopperPour)continue;let r=t.get(o.componentId)??[];r.push(o),t.set(o.componentId,r)}let n=[];for(let[o,r]of t){let i=Tfn(r.map((A)=>A.center.x)),s=Tfn(r.map((A)=>A.center.y)),a=Nfn(r,"x"),c=Nfn(r,"y"),l=Dfn(i),h=Dfn(s),d=Math.min(...[a,c,l,h].filter(Number.isFinite)),u=Math.max(...r.flatMap((A)=>[A.width,A.height])),_=Number.isFinite(d)?d:u,p=Number.isFinite(a)?a:Number.isFinite(l)?l:_,m=Number.isFinite(c)?c:Number.isFinite(h)?h:_;n.push({componentId:o,obstacles:r,xCoordinates:i,yCoordinates:s,pitchX:p,pitchY:m,bounds:EGr(r)})}return n}function CCn(e){return"layer"in e?[e.layer]:e.layers}function bCn(e){let{point:t,connection:n,componentGrids:o}=e,r=CCn(t),i=[];for(let s of o){let a=s.obstacles.filter((c)=>c.layers.some((l)=>r.includes(l))).filter((c)=>OZ(t,c,0.00001)).sort((c,l)=>{let h=c.connectedTo.includes(n.name)||c.connectedTo.includes(t.pointId??"")||c.connectedTo.includes(t.pcb_port_id??""),d=l.connectedTo.includes(n.name)||l.connectedTo.includes(t.pointId??"")||l.connectedTo.includes(t.pcb_port_id??"");if(h!==d)return h?-1:1;return c.width*c.height-l.width*l.height});if(a[0])i.push({grid:s,obstacle:a[0]})}return i}function BGr(e){for(let n of e.pointsToConnect)if("layers"in n&&n.busId)return n.busId;return/^BUS[_:-]([^_:-]+)(?:[_:-]\d+)?$/i.exec(e.name)?.[1]??null}function Ode(e,t){if(t===void 0)return;if(!vGr.has(t))throw Error(`FanoutSolver: bus "${e}" has invalid preferredExit "${t}"`);return t}function TGr(e,t){if(t===void 0)return;if(!SGr.has(t))throw Error(`FanoutSolver: bus "${e}" has invalid exitEdge "${t}"`);return t}function DGr(e,t){if(t===void 0)return;try{return Z3n(t)}catch{throw Error(`FanoutSolver: bus "${e}" has invalid exitPosition "${t}"`)}}function rot(e){let{busId:t,exitPosition:n,fieldName:o,expected:r,actual:i,sourceName:s}=e;if(i===void 0||i===r)return;throw Error(`FanoutSolver: bus "${t}" exitPosition "${n}" conflicts with ${s} ${o} "${i}"`)}function NGr(e){let{busId:t,requestedBus:n,options:o}=e,r=n.exitPosition,i=DGr(t,r),s=Ode(t,n.preferredExit),a=Ode(t,o.busExitPreferences?.[t]),c=TGr(t,n.exitEdge);if(i&&r){for(let[d,u]of[[n.direction,"bus"],[o.busDirections?.[t],"busDirections"]])rot({busId:t,exitPosition:r,fieldName:"direction",expected:i.direction,actual:d,sourceName:u});for(let[d,u]of[[s,"bus"],[a,"busExitPreferences"]])rot({busId:t,exitPosition:r,fieldName:"preferredExit",expected:i.preferredExit,actual:d,sourceName:u});return rot({busId:t,exitPosition:r,fieldName:"exitEdge",expected:i.exitEdge,actual:c,sourceName:"bus"}),{exitPosition:r,...i.direction?{direction:i.direction}:{},...i.preferredExit?{preferredExit:i.preferredExit}:{},...i.exitEdge?{exitEdge:i.exitEdge}:{}}}let l=o.busDirections?.[t]??n.direction??o.defaultDirection,h=Ode(t,a??s??o.defaultPreferredExit);return{...l?{direction:l}:{},...h?{preferredExit:h}:{},...c?{exitEdge:c}:{}}}function RGr(e,t){if(t===void 0)return;if(t.length===0)throw Error(`FanoutSolver: bus "${e}" must allow at least one layer`);for(let n of t)if(typeof n!=="string"||n.length===0)throw Error(`FanoutSolver: bus "${e}" has an invalid allowed layer`);return[...new Set(t)]}function QGr(e,t){if(t===void 0)return;if(!Number.isFinite(t)||t<0)throw Error(`FanoutSolver: bus "${e}" maxLengthSkew must be a finite non-negative number`);return t}function ICn(e){if(e===void 0)return;if(e.length===0)throw Error("FanoutSolver: availableCornersAndSides must contain at least one boundary region");let t=[],n=new Set;for(let o of e){let r=PGr[o];if(!r)throw Error(`FanoutSolver: invalid availableCornersAndSides value "${o}"`);let i=`${r.exitEdge}:${r.direction}:${r.preferredExit}`;if(n.has(i))continue;n.add(i),t.push(r)}return t}function kGr(e,t){if(t===void 0||t.type==="boundary")return{type:"boundary"};if(t.type!=="plane"||typeof t.layer!=="string"||t.layer.length===0)throw Error(`FanoutSolver: bus "${e}" has an invalid termination target`);return{type:"plane",layer:t.layer}}function LGr(e,t){let n=t.buses??e.buses,o=new Map,r=new Set,i=new Set(e.connections.map((s)=>s.name));for(let s of n??[]){if(o.has(s.busId))throw Error(`FanoutSolver: duplicate bus id "${s.busId}"`);for(let d of s.connectionNames){if(!i.has(d))throw Error(`FanoutSolver: bus "${s.busId}" references unknown connection "${d}"`);if(r.has(d))throw Error(`FanoutSolver: connection "${d}" belongs to more than one bus`);r.add(d)}let a=kGr(s.busId,s.termination),c=NGr({busId:s.busId,requestedBus:s,options:t}),l=RGr(s.busId,s.allowedLayers),h=QGr(s.busId,s.maxLengthSkew);if(a.type==="plane"&&h!==void 0)throw Error(`FanoutSolver: plane-terminated bus "${s.busId}" cannot specify maxLengthSkew`);if(a.type==="plane"&&c.preferredExit!==void 0)throw Error(`FanoutSolver: plane-terminated bus "${s.busId}" cannot also specify preferredExit`);o.set(s.busId,{...s,sourceComponentId:s.sourceComponentId??t.sourceComponentId,...c,...l===void 0?{}:{allowedLayers:l},...h===void 0?{}:{maxLengthSkew:h},termination:a})}for(let s of e.connections){if(r.has(s.name))continue;let a=BGr(s);if(a){let c=o.get(a);if(c)o.set(a,{...c,connectionNames:[...c.connectionNames,s.name]});else o.set(a,{busId:a,connectionNames:[s.name],direction:t.busDirections?.[a]??t.defaultDirection,sourceComponentId:t.sourceComponentId,preferredExit:Ode(a,t.busExitPreferences?.[a]??t.defaultPreferredExit),termination:{type:"boundary"}})}else{let c=`connection:${s.name}`;o.set(c,{busId:c,connectionNames:[s.name],sourceComponentId:t.sourceComponentId,direction:t.busDirections?.[c]??t.defaultDirection,preferredExit:Ode(c,t.busExitPreferences?.[c]??t.defaultPreferredExit),termination:{type:"boundary"}})}}return[...o.values()]}function HGr(e){let{busSpec:t,connections:n,componentGrids:o}=e,r=new Map;for(let l of n){let h=new Set;for(let d of l.pointsToConnect)for(let u of bCn({point:d,connection:l,componentGrids:o}))h.add(u.grid.componentId);for(let d of h)r.set(d,(r.get(d)??0)+1)}let i=[...o].sort((l,h)=>{let d=(r.get(h.componentId)??0)-(r.get(l.componentId)??0);if(d!==0)return d;return h.obstacles.length-l.obstacles.length})[0],s=t.sourceComponentId?o.find((l)=>l.componentId===t.sourceComponentId):void 0;if(t.sourceComponentId&&!s)throw Error(`FanoutSolver: source component "${t.sourceComponentId}" for bus "${t.busId}" was not found`);let a=s??i,c=a?r.get(a.componentId)??0:0;if(!a||c!==n.length)throw Error(t.sourceComponentId?`FanoutSolver: source component "${t.sourceComponentId}" is not an endpoint on every connection in bus "${t.busId}"`:`FanoutSolver: bus "${t.busId}" does not have one component endpoint on every connection`);return a}function FGr(e,t,n,o){let i=t.pointsToConnect.filter((s,a)=>a!==n).sort((s,a)=>Ut(e,a)-Ut(e,s))[0];if(!i&&o.type==="plane")return e;if(!i)throw Error(`FanoutSolver: connection "${t.name}" has no target beyond its BGA pad`);return i}function zGr(e){let{connection:t,connectionIndex:n,sourceGrid:o,componentGrids:r,termination:i,exitTargetPoint:s}=e;for(let a=0;a<t.pointsToConnect.length;a++){let c=t.pointsToConnect[a],l=bCn({point:c,connection:t,componentGrids:r}).find((u)=>u.grid.componentId===o.componentId);if(!l)continue;let h=CCn(c).find((u)=>l.obstacle.layers.includes(u));if(!h)throw Error(`FanoutSolver: connection "${t.name}" has no source layer shared with its BGA pad`);let d=FGr(c,t,a,i);return{connection:t,connectionIndex:n,sourcePoint:c,sourcePointIndex:a,sourceLayer:h,sourceObstacle:l.obstacle,targetPoint:d,exitTargetPoint:s??{x:d.x,y:d.y},hasExplicitLayeredExitTarget:s?.layer!==void 0}}throw Error(`FanoutSolver: connection "${t.name}" does not touch component "${o.componentId}"`)}function $rt(e,t){let n=0,o=0;for(let r of t){let i=r.exitTargetPoint??r.targetPoint;n+=i.x-r.sourcePoint.x,o+=i.y-r.sourcePoint.y}if(Math.abs(n)<0.000000001&&Math.abs(o)<0.000000001)throw Error(`FanoutSolver: cannot infer an escape direction for bus "${e}"`);if(Math.abs(n)>=Math.abs(o))return n>=0?"right":"left";return o>=0?"up":"down"}function OGr(e){switch(e){case"left":return["left"];case"right":return["right"];case"top":return["up"];case"bottom":return["down"];case"top-left":return["up","left"];case"top-right":return["up","right"];case"bottom-left":return["down","left"];case"bottom-right":return["down","right"]}}function vCn(e){return{x:e.reduce((t,n)=>t+n.sourcePoint.x,0)/e.length,y:e.reduce((t,n)=>t+n.sourcePoint.y,0)/e.length}}function zve(e,t,n){switch(t){case"left":return e.x-n.minX;case"right":return n.maxX-e.x;case"up":return n.maxY-e.y;case"down":return e.y-n.minY}}function Ove(e,t){if(e.direction==="up"||e.direction==="down"){if(e.preferredExit.endsWith("left"))return t.minX;if(e.preferredExit.endsWith("right"))return t.maxX;return(t.minX+t.maxX)/2}if(e.preferredExit.startsWith("top"))return t.maxY;if(e.preferredExit.startsWith("bottom"))return t.minY;return(t.minY+t.maxY)/2}function Qfn(e,t){return t==="up"||t==="down"?e.x:e.y}function VGr(e,t){try{return $rt(e,t)}catch{return}}function YGr(e){let{busId:t,explicitDirection:n,preferredExit:o,connections:r,sharedBoundary:i,availableRegions:s}=e,a=s.filter((u)=>(n===void 0||u.direction===n)&&(o===void 0||u.preferredExit===o));if(a.length===0)throw Error(`FanoutSolver: bus "${t}" cannot use its requested exit with availableCornersAndSides`);let c=n?void 0:VGr(t,r),l=c?a.filter((u)=>u.direction===c):[],h=l.length>0?l:a,d=vCn(r);return[...h].toSorted((u,_)=>zve(d,u.direction,i)-zve(d,_.direction,i)||Math.abs(Qfn(d,u.direction)-Ove(u,i))-Math.abs(Qfn(d,_.direction)-Ove(_,i))||u.preferredExit.localeCompare(_.preferredExit))[0]}function GGr(e){let{busId:t,exitEdge:n,preferredExit:o,availableRegions:r}=e,i=Xi(n,o);if(!r.some((a)=>a.exitEdge===n&&Xi(a.exitEdge,a.preferredExit)===i))throw Error(`FanoutSolver: bus "${t}" cannot use its requested exit with availableCornersAndSides`)}function UGr(e){let{busId:t,explicitDirection:n,preferredExit:o,connections:r,sharedBoundary:i,availableRegions:s}=e;if(s)return YGr({busId:t,explicitDirection:n,preferredExit:o,connections:r,sharedBoundary:i,availableRegions:s});if(!o)return{direction:n??$rt(t,r)};let a=OGr(o);if(n){if(!a.includes(n))throw Error(`FanoutSolver: bus "${t}" direction "${n}" is incompatible with preferredExit "${o}"`);return{direction:n,preferredExit:o}}if(a.length===1)return{direction:a[0],preferredExit:o};let c;try{c=$rt(t,r)}catch{c=void 0}if(c&&a.includes(c))return{direction:c,preferredExit:o};let l=vCn(r);return{direction:a.toSorted((h,d)=>zve(l,h,i)-zve(l,d,i)||h.localeCompare(d))[0],preferredExit:o}}function WGr(e,t){let n=wGr(e.obstacles);if(n.length===0&&e.connections.length>0)throw Error("FanoutSolver: no componentId-tagged pad footprint was found");let o=new Map(e.connections.map((h,d)=>[h.name,d])),r=LGr(e,t).map((h)=>{for(let[p,m]of Object.entries(h.connectionExitTargets??{})){if(!h.connectionNames.includes(p))throw Error(`FanoutSolver: connectionExitTargets contains connection "${p}" outside bus "${h.busId}"`);if(!Number.isFinite(m.x)||!Number.isFinite(m.y))throw Error(`FanoutSolver: connectionExitTargets for connection "${p}" must contain finite x and y coordinates`)}let d=h.connectionNames.map((p)=>{let m=o.get(p);if(m===void 0)throw Error(`FanoutSolver: connection "${p}" is missing from the input`);return e.connections[m]}),u=HGr({busSpec:h,connections:d,componentGrids:n}),_=d.map((p)=>zGr({connection:p,connectionIndex:o.get(p.name),sourceGrid:u,componentGrids:n,termination:h.termination??{type:"boundary"},exitTargetPoint:h.connectionExitTargets?.[p.name]}));return{busSpec:h,sourceGrid:u,preparedConnections:_}}),i=[...new Map(r.map(({sourceGrid:h})=>[h.componentId,h])).values()],s=MGr(i,t),a=ICn(t.availableCornersAndSides),c=[];for(let{busSpec:h,sourceGrid:d,preparedConnections:u}of r){if(h.exitEdge&&!h.preferredExit)throw Error(`FanoutSolver: bus "${h.busId}" exitEdge requires preferredExit`);if(h.exitEdge&&h.preferredExit&&!eCn(h.preferredExit,h.exitEdge))throw Error(`FanoutSolver: bus "${h.busId}" exitEdge "${h.exitEdge}" is incompatible with preferredExit "${h.preferredExit}"`);let _=UGr({busId:h.busId,explicitDirection:h.direction??t.busDirections?.[h.busId],preferredExit:h.preferredExit,connections:u,sharedBoundary:s,availableRegions:h.termination?.type==="plane"||h.exitEdge?void 0:a});if(h.termination?.type!=="plane"&&h.exitEdge&&_.preferredExit&&a)GGr({busId:h.busId,exitEdge:h.exitEdge,preferredExit:_.preferredExit,availableRegions:a});c.push({busId:h.busId,...h.maxLengthSkew===void 0?{}:{maxLengthSkew:h.maxLengthSkew},direction:_.direction,preferredExit:_.preferredExit,...h.exitEdge?{exitEdge:h.exitEdge}:{},cornerBandConnectionCount:0,allowedLayers:h.allowedLayers,termination:h.termination??{type:"boundary"},connections:u,componentId:d.componentId,componentObstacles:d.obstacles,componentBounds:xCn(d,t),sharedBoundary:s,xCoordinates:[...d.xCoordinates],yCoordinates:[...d.yCoordinates],pitchX:d.pitchX,pitchY:d.pitchY})}let l=new Map;for(let h of c){let d=Xi(h.exitEdge,h.preferredExit);if(!h.exitEdge||!d)continue;let u=`${h.exitEdge}:${d}`;l.set(u,(l.get(u)??0)+h.connections.length)}for(let h of c){let d=Xi(h.exitEdge,h.preferredExit);if(!h.exitEdge||!d)continue;h.cornerBandConnectionCount=l.get(`${h.exitEdge}:${d}`)??h.connections.length}return c}var Ek=0.000000001,kfn=Math.PI*2;function XGr(e){let{buses:t,rules:n}=e,o=t.find((T)=>T.busId===e.busId);if(!o||o.termination.type!=="boundary"||!o.exitEdge||o.connections.length<3)return null;let r=e.maximumOrderingStates??1e4,i=e.maximumCompleteAssignments??16;for(let[T,N]of Object.entries({maximumOrderingStates:r,maximumCompleteAssignments:i}))if(!Number.isSafeInteger(N)||N<1)throw Error(`FanoutSolver: ${T} must be a positive safe integer`);let s={x:(o.componentBounds.minX+o.componentBounds.maxX)/2,y:(o.componentBounds.minY+o.componentBounds.maxY)/2},a=(T)=>Math.atan2(T.y-s.y,T.x-s.x),c=(T)=>{let N=T.exitTargetPoint??T.targetPoint;return o.exitEdge==="right"?N.y:o.exitEdge==="top"?-N.x:o.exitEdge==="left"?-N.y:N.x},l=o.connections.toSorted((T,N)=>c(T)-c(N)||T.connectionIndex-N.connectionIndex),h=[];for(let T of l){if(Ut(T.sourcePoint,s)<Ek)return null;let N=a(T.sourcePoint);while(N<(h.at(-1)??N)-Ek)N+=kfn;h.push(N)}if(h.at(-1)-h[0]>=kfn-Ek)return null;let d=new Map(t.flatMap((T)=>T.connections.map((N)=>[N.connectionIndex,N]))),u=new Map(l.map((T,N)=>[T.connectionIndex,N])),_=new Map,p=new Map;for(let T of d.values())p.set(T.connectionIndex,[]);for(let T of Kk(t,n)){let N=d.get(T.connectionIndex),D=`${T.point.x.toFixed(9)},${T.point.y.toFixed(9)}`;if(!_.has(D))_.set(D,_.size);let L=u.get(T.connectionIndex),H=a(N.sourcePoint),V=L===void 0?a(T.point):h[L]+Math.atan2(Math.sin(a(T.point)-H),Math.cos(a(T.point)-H));p.get(T.connectionIndex).push({...T,angle:V,siteIndex:_.get(D),sourceSegment:{start:N.sourcePoint,end:T.point,layer:N.sourceLayer,width:n.traceWidth}})}let m=[...p.entries()].map(([T,N])=>({connectionIndex:T,candidates:N}));if(m.some((T)=>T.candidates.length===0))return null;let A=l.map((T,N)=>p.get(T.connectionIndex).toSorted((D,L)=>Math.abs(D.angle-h[N])-Math.abs(L.angle-h[N])||Ut(L.point,s)-Ut(D.point,s))),g=n.viaHoleDiameter?n.viaHoleDiameter+(n.holeToHoleClearance??n.clearance):0,f=n.viaDiameter/2+n.traceWidth/2+n.clearance,y=(T,N)=>{let D=n.canShareCopper?.(T.connectionIndex,N.connectionIndex)??!1,L=D?g:Math.max(g,n.viaDiameter+n.clearance);if(Ut(T.point,N.point)<L-Ek)return!1;if(D)return!0;return Vr(T.point,N.sourceSegment.start,N.sourceSegment.end)>=f-Ek&&Vr(N.point,T.sourceSegment.start,T.sourceSegment.end)>=f-Ek&&V_(T.sourceSegment,N.sourceSegment,n.clearance)},x=new Map;for(let T of A)for(let N of T){let D=new Set;for(let L of m)for(let H of L.candidates)if(N.connectionIndex!==H.connectionIndex&&!y(N,H))D.add(H);x.set(N,D)}let C=[],b=g>Ek||!n.canShareCopper,I=()=>{if(!b)return!0;let T=new Map(C.map((H)=>[H.connectionIndex,H.siteIndex])),N=m.map((H)=>H.candidates.filter((V)=>(!T.has(V.connectionIndex)||T.get(V.connectionIndex)===V.siteIndex)&&C.every((O)=>!x.get(O).has(V))).map((V)=>V.siteIndex)).sort((H,V)=>H.length-V.length);if(N.some((H)=>H.length===0))return!1;let D=new Int32Array(_.size).fill(-1),L=(H,V)=>{for(let O of N[H]){if(V[O])continue;if(V[O]=1,D[O]===-1||L(D[O],V))return D[O]=H,!0}return!1};return N.every((H,V)=>L(V,new Uint8Array(_.size)))},v=0,P=0,M=null,B=(T)=>{if(++v>r)return!1;if(T===A.length){if(++P>i)return!1;let N=new Map(n.fixedViaPointsByConnectionIndex);for(let D of C)N.set(D.connectionIndex,D.point);return M=I0(t,{...n,fixedViaPointsByConnectionIndex:N}),M!==null}for(let N of A[T]){if(N.angle<(C.at(-1)?.angle??-1/0)-Ek||C.some((D)=>x.get(D).has(N)))continue;if(C.push(N),I()&&B(T+1))return!0;if(C.pop(),v>r||P>=i)break}return!1};return B(0),M}var op=0.000000001,Mk=1,lue=globalThis.process?.env?.FANOUT_FLOW_DEBUG==="1";function jGr(e){let{boundary:t,sourcePoints:n,traceWidth:o,update:r}=e,i=t.maxX-t.minX,s=t.maxY-t.minY,a=Math.max(Math.min(i,s)*0.02,0.2),c=r.grid?Math.max(1,Math.ceil(r.grid.points.length/1200)):1,l=r.grid?r.grid.points.flatMap((d,u)=>u%c===0?[{point:d,index:u}]:[]):[],h=r.grid?.processedNodeCount??r.grid?.points.length??0;return{title:`Adaptive exits: ${r.phase}`,rects:[{center:{x:(t.minX+t.maxX)/2,y:(t.minY+t.maxY)/2},width:i,height:s,fill:"rgba(0, 0, 0, 0)",stroke:"rgba(14, 165, 233, 0.9)",label:"adaptive flow grid boundary"}],points:[...l.map(({point:d,index:u})=>{let _=u<h;return{...d,color:!_?"rgba(148, 163, 184, 0.18)":r.grid.obstacleFreeNodes[u]?"rgba(34, 197, 94, 0.38)":"rgba(100, 116, 139, 0.28)",label:_?r.grid.obstacleFreeNodes[u]?"available flow node":"blocked flow node":"unprocessed flow node"}}),...n.map((d)=>({...d,color:"#f97316",label:"adaptive route source"})),...(r.candidatePoints??[]).map((d)=>({...d,color:"#06b6d4",label:"selected terminal node"}))],lines:(r.segments??[]).map((d)=>({points:[d.start,d.end],strokeColor:"rgba(250, 204, 21, 0.9)",strokeWidth:Math.max(o,a*0.4),label:"current adaptive route"})),texts:[{x:t.minX,y:t.maxY+a*2,text:`${r.phase}${r.direction?` · ${r.direction}`:""}${r.processed!==void 0&&r.total!==void 0?` · ${r.processed}/${r.total}`:""}`,color:"#0f172a",fontSize:a*1.5,anchorSide:"bottom_left"}]}}function KGr(e){let t=e.connection;return e.sourceObstacle.connectedTo.find((o)=>o.startsWith("connectivity_net"))??t.netConnectionName??e.connection.name.replace(/::fanout:\d+$/,"")}function SCn(e,t){return e===t.connection.sourceObstacle||e.connectedTo.includes(t.connection.connection.name)||e.connectedTo.includes(t.netKey)}function Vve(e,t){let n=t.x-e.x,o=t.y-e.y,r=Math.abs(n),i=Math.abs(o);if(r<op||i<op||Math.abs(r-i)<op)return[e,t];if(r>i)return[e,{x:e.x+Math.sign(n)*i,y:t.y},t];return[e,{x:t.x,y:e.y+Math.sign(o)*r},t]}function PCn(e){if(e.length<2)return e;let t=[e[0]];for(let n of e.slice(1)){let o=t.at(-1),r=Math.abs(n.x-o.x),i=Math.abs(n.y-o.y);if(r<op||i<op||Math.abs(r-i)<op){t.push(n);continue}t.push(...Vve(n,o).reverse().slice(1))}return G8e(t)}function G8e(e){if(e.length<3)return e;let t=[e[0]];for(let n=1;n<e.length-1;n++){let o=t.at(-1),r=e[n],i=e[n+1];if(Math.sign(r.x-o.x)!==Math.sign(i.x-r.x)||Math.sign(r.y-o.y)!==Math.sign(i.y-r.y))t.push(r)}return t.push(e.at(-1)),t}function $Gr(e,t){if(e.length<3)return e;let n=[e[0]];for(let o=1;o<e.length-1;o++){let r=e[o-1],i=e[o],s=e[o+1],a=Ut(r,i),c=Ut(i,s);if(a<op||c<op)continue;let l={x:(i.x-r.x)/a,y:(i.y-r.y)/a},h={x:(s.x-i.x)/c,y:(s.y-i.y)/c};if(Math.abs(l.x*h.x+l.y*h.y)>0.000001){n.push(i);continue}let d=Math.min(t,a/2,c/2);n.push({x:i.x-l.x*d,y:i.y-l.y*d}),n.push({x:i.x+h.x*d,y:i.y+h.y*d})}return n.push(e.at(-1)),G8e(n)}function ZJ(e,t){let n=[];for(let o=1;o<e.length;o++){if(Ut(e[o-1],e[o])<op)continue;n.push({start:e[o-1],end:e[o],width:t,layer:"top"})}return n}var qGr=class{edges;levels;nextEdges;constructor(e){this.edges=Array.from({length:e},()=>[]),this.levels=new Int32Array(e),this.nextEdges=new Int32Array(e)}addEdge(e,t,n,o={}){let r={to:t,reverseIndex:this.edges[t].length,capacity:n,initialCapacity:n,...o},i={to:e,reverseIndex:this.edges[e].length,capacity:0,initialCapacity:0};this.edges[e].push(r),this.edges[t].push(i)}buildLevels(e,t){this.levels.fill(-1);let n=new Int32Array(this.edges.length),o=0,r=0;n[r++]=e,this.levels[e]=0;while(o<r){let i=n[o++];for(let s of this.edges[i]){if(s.capacity<=0||this.levels[s.to]>=0)continue;this.levels[s.to]=this.levels[i]+1,n[r++]=s.to}}return this.levels[t]>=0}sendFlow(e,t){if(e===t)return 1;for(let n=this.nextEdges[e];n<this.edges[e].length;n++,this.nextEdges[e]=n){let o=this.edges[e][n];if(o.capacity<=0||this.levels[o.to]!==this.levels[e]+1)continue;let r=this.sendFlow(o.to,t);if(r===0)continue;return o.capacity-=r,this.edges[o.to][o.reverseIndex].capacity+=r,r}return 0}*maximumFlowSteps(e,t,n){let o=0;while(o<n&&this.buildLevels(e,t)){this.nextEdges.fill(0);let r=0;while(o<n){let i=this.sendFlow(e,t);if(i===0)break;if(o+=i,r+=i,r>=4&&o<n)r=0,yield o}}return o}};function*JGr(e){let{boundary:t,obstacles:n,traceWidth:o,clearance:r,reportProgress:i}=e,s=o+r,a=Math.round((t.maxX-t.minX)/s)+1,c=Math.round((t.maxY-t.minY)/s)+1,l=a*c,h=Array.from({length:l},(A,g)=>({x:t.minX+g%a*s,y:t.minY+Math.floor(g/a)*s})),d=o/2+r,u=new Map;for(let A=0;A<n.length;A++){let g=n[A],f=Math.floor((g.center.x-g.width/2-d)/Mk),y=Math.floor((g.center.x+g.width/2+d)/Mk),x=Math.floor((g.center.y-g.height/2-d)/Mk),C=Math.floor((g.center.y+g.height/2+d)/Mk);for(let b=f;b<=y;b++)for(let I=x;I<=C;I++){let v=`${b}:${I}`,P=u.get(v)??[];P.push(A),u.set(v,P)}if((A+1)%128===0)i({phase:"index-obstacles",processed:A+1,total:n.length}),yield}let _=(A,g=A)=>{let f=Math.floor(Math.min(A.x,g.x)/Mk),y=Math.floor(Math.max(A.x,g.x)/Mk),x=Math.floor(Math.min(A.y,g.y)/Mk),C=Math.floor(Math.max(A.y,g.y)/Mk),b=new Set;for(let I=f;I<=y;I++)for(let v=x;v<=C;v++)for(let P of u.get(`${I}:${v}`)??[])b.add(P);return[...b].map((I)=>n[I])},p=new Uint8Array(l);for(let A=0;A<l;A++){let g=h[A];if(_(g).every((f)=>X5(g,f)>=d-op))p[A]=1;if((A+1)%2048===0)i({phase:"classify-flow-grid",processed:A+1,total:l,grid:{points:h,obstacleFreeNodes:p,processedNodeCount:A+1}}),yield}let m=Array.from({length:l},()=>[]);for(let A=0;A<l;A++){if(!p[A])continue;let g=A%a,f=Math.floor(A/a);for(let[y,x]of[[1,0],[0,1]]){let C=g+y,b=f+x;if(C>=a||b>=c)continue;let I=b*a+C;if(!p[I])continue;let v={start:h[A],end:h[I],width:o,layer:"top"};if(_(v.start,v.end).some((P)=>Wl(v,P)<d-op))continue;m[A].push(I),m[I].push(A)}if((A+1)%2048===0)i({phase:"connect-flow-grid",processed:A+1,total:l,grid:{points:h,obstacleFreeNodes:p,processedNodeCount:l}}),yield}return{boundary:t,step:s,columnCount:a,rowCount:c,nodeCount:l,points:h,obstacleFreeNodes:p,neighbors:m}}function*ZGr(e){let{direction:t,availableDirections:n,items:o,grid:r,obstacles:i,traceWidth:s,clearance:a,occupiedNodes:c,acceptedSegments:l,connectorSelectionOffset:h=0,reportProgress:d}=e;if(o.length===0)return{routes:[],usedNodes:[],unmatchedItems:[]};let{boundary:u,step:_,columnCount:p,rowCount:m,nodeCount:A}=r,g=(se)=>r.points[se],f=s/2+a,y=s+a,x=new Uint8Array(A);for(let se=0;se<A;se++)if(!c[se]&&r.obstacleFreeNodes[se])x[se]=1;let C=(se,ne)=>{let re=ZJ(se,s);return re.every((Z)=>i.every((te)=>SCn(te,ne)||Wl(Z,te)>=f-op))&&re.every((Z)=>l.every((te)=>ad(Z.start,Z.end,te.start,te.end)>=y-op))},b=new Map;for(let se of o){let ne=`${se.source.x.toFixed(6)}:${se.source.y.toFixed(6)}:${se.netKey}`,re=b.get(ne)??[];re.push(se),b.set(ne,re)}let I=Array.from({length:3721},(se,ne)=>{let re=ne%61-30,Z=Math.floor(ne/61)-30;return{x:re,y:Z,distanceSquared:re*re+Z*Z}}).sort((se,ne)=>se.distanceSquared-ne.distanceSquared),v=[],P=0;for(let se of b.values()){let ne=se[0],re=Math.hypot(ne.connection.sourceObstacle.width/2,ne.connection.sourceObstacle.height/2)+a+_*2,Z=Math.round((ne.source.x-u.minX)/_),te=Math.round((ne.source.y-u.minY)/_),ie=[],le=new Set;for(let ue of I){let de=Z+ue.x,me=te+ue.y;if(de<0||de>=p||me<0||me>=m)continue;let Ae=me*p+de;if(!x[Ae]||le.has(Ae))continue;if(Ut(ne.source,g(Ae))>re)continue;let xe=Vve(ne.source,g(Ae));if(!C(xe,ne))continue;if(le.add(Ae),ie.push({node:Ae,connectorPoints:xe}),ie.length>=12)break}if(ie.length===0)return null;if(v.push({item:ne,equivalentItems:se,candidates:ie}),P++,P%8===0)d({phase:"discover-terminal-connectors",direction:t,processed:P,total:b.size,grid:{points:r.points,obstacleFreeNodes:x,processedNodeCount:A},candidatePoints:v.flatMap((ue)=>ue.candidates.map((de)=>g(de.node))),segments:l}),yield}let M=[],B=0;for(let se of[...v].sort((ne,re)=>ne.candidates.length-re.candidates.length)){let ne=se.candidates.length===0?0:h%se.candidates.length,Z=[...se.candidates.slice(ne),...se.candidates.slice(0,ne)].find((te)=>{let ie=ZJ(te.connectorPoints,s);return M.every((le)=>le.netKey===se.item.netKey||ie.every((ue)=>le.segments.every((de)=>ad(ue.start,ue.end,de.start,de.end)>=y-op)))});if(!Z)return null;if(se.candidates=[Z],M.push({netKey:se.item.netKey,segments:ZJ(Z.connectorPoints,s)}),B++,B%8===0)d({phase:"select-terminal-connectors",direction:t,processed:B,total:v.length,grid:{points:r.points,obstacleFreeNodes:x,processedNodeCount:A},candidatePoints:v.flatMap((te)=>te.candidates.map((ie)=>g(ie.node))),segments:[...l,...M.flatMap((te)=>te.segments)]}),yield}let T=new Set(v.map((se)=>se.candidates[0].node));for(let se of M)for(let ne of se.segments){let re=Math.max(0,Math.floor((Math.min(ne.start.x,ne.end.x)-y-u.minX)/_)),Z=Math.min(p-1,Math.ceil((Math.max(ne.start.x,ne.end.x)+y-u.minX)/_)),te=Math.max(0,Math.floor((Math.min(ne.start.y,ne.end.y)-y-u.minY)/_)),ie=Math.min(m-1,Math.ceil((Math.max(ne.start.y,ne.end.y)+y-u.minY)/_));for(let le=te;le<=ie;le++)for(let ue=re;ue<=Z;ue++){let de=le*p+ue;if(!x[de]||T.has(de))continue;let me=g(de);if(ad(ne.start,ne.end,me,me)<y-op)x[de]=0}}let N=0,D=1,L=D+v.length,H=L+A,V=H+A,O=new qGr(V+1);for(let se=0;se<v.length;se++){let ne=D+se;O.addEdge(N,ne,1);for(let re of v[se].candidates)O.addEdge(ne,L+re.node,1,{gridNode:re.node})}for(let se=0;se<A;se++){if(!x[se])continue;O.addEdge(L+se,H+se,1);let ne=se%p,re=Math.floor(se/p);for(let te of r.neighbors[se]){if(!x[te])continue;O.addEdge(H+se,L+te,1,{gridNode:te})}if(t==="any"&&((!n||n.has("left"))&&ne===0||(!n||n.has("right"))&&ne===p-1||(!n||n.has("down"))&&re===0||(!n||n.has("up"))&&re===m-1)||t==="left"&&ne===0||t==="right"&&ne===p-1||t==="down"&&re===0||t==="up"&&re===m-1)O.addEdge(H+se,V,1,{isSink:!0});if((se+1)%2048===0)d({phase:"build-flow-network",direction:t,processed:se+1,total:A,grid:{points:r.points,obstacleFreeNodes:x,processedNodeCount:A},candidatePoints:v.map((te)=>g(te.candidates[0].node)),segments:[...l,...M.flatMap((te)=>te.segments)]}),yield}let U=O.maximumFlowSteps(N,V,v.length),j=U.next();while(!j.done)d({phase:"augment-terminal-flow",direction:t,processed:j.value,total:v.length,grid:{points:r.points,obstacleFreeNodes:x,processedNodeCount:A},candidatePoints:v.map((se)=>g(se.candidates[0].node)),segments:[...l,...M.flatMap((se)=>se.segments)]}),yield,j=U.next();let Y=j.value,X=(se)=>{let ne=D+se;return O.edges[N].some((re)=>re.to===ne&&re.initialCapacity===1&&re.capacity===0)};if(Y!==v.length){if(lue){let se=v.flatMap((ne,re)=>X(re)?[]:[ne.item.connection.connection.name]);console.error("single-layer flow group failed",{direction:t,achievedFlow:Y,requiredFlow:v.length,unmatchedConnections:se})}}let K=[],J=[],ee=[];for(let se=0;se<v.length;se++){let ne=v[se];if(!X(se)){ee.push(...ne.equivalentItems);continue}let re=D+se,Z=O.edges[re].find((xe)=>xe.initialCapacity===1&&xe.capacity===0&&xe.gridNode!==void 0);if(Z?.gridNode===void 0)return null;let te=ne.candidates.find((xe)=>xe.node===Z.gridNode);if(!te)return null;let ie=[g(te.node)],le=te.node,ue=[le];for(let xe=0;xe<=A;xe++){let Me=H+le,Re=O.edges[Me].find((we)=>we.initialCapacity===1&&we.capacity===0&&(we.gridNode!==void 0||we.isSink));if(!Re)return null;if(Re.isSink)break;if(Re.gridNode===void 0)return null;le=Re.gridNode,ue.push(le),ie.push(g(le))}J.push(...ue);let de=G8e([...te.connectorPoints,...ie.slice(1)]),me=PCn($Gr(de,_/2)),Ae=ZJ(me,s);for(let xe of ne.equivalentItems)K.push({item:xe,points:me,segments:Ae});if((se+1)%8===0)d({phase:"extract-flow-routes",direction:t,processed:se+1,total:v.length,grid:{points:r.points,obstacleFreeNodes:x,processedNodeCount:A},segments:[...l,...K.flatMap((xe)=>xe.segments)]}),yield}return{routes:K,usedNodes:J,unmatchedItems:ee}}function Lfn(e,t){let{item:n,points:o,segments:r}=e,i=o.map((a,c)=>({route_type:"wire",x:a.x,y:a.y,width:t,layer:"top",...c===0&&n.connection.sourcePoint.pcb_port_id?{start_pcb_port_id:n.connection.sourcePoint.pcb_port_id}:{}})),s=PG({connectionName:n.connection.connection.name,sourcePointIndex:n.connection.sourcePointIndex});return{busId:n.bus.busId,connectionName:n.connection.connection.name,connectionIndex:n.connection.connectionIndex,sourcePointIndex:n.connection.sourcePointIndex,sourcePoint:n.connection.sourcePoint,sourceObstacle:n.connection.sourceObstacle,sourceLayer:n.connection.sourceLayer,targetPoint:n.connection.targetPoint,targetLayer:"top",termination:n.bus.termination,direction:n.bus.direction,...n.bus.exitEdge?{exitEdge:n.bus.exitEdge}:{},exitPoint:o.at(-1),trace:{type:"pcb_trace",pcb_trace_id:s.traceId,connection_name:n.connection.connection.name,connectsTo:[...n.connection.sourcePoint.pointId?[n.connection.sourcePoint.pointId]:[],...n.connection.sourcePoint.pcb_port_id?[n.connection.sourcePoint.pcb_port_id]:[],s.boundaryExitPointId],route:i},segments:r,length:r.reduce((a,c)=>a+Ut(c.start,c.end),0)}}function eUr(e,t){let n=Vve(e,t),o=Vve(t,e).reverse();return n.length===o.length&&n.every((r,i)=>Ut(r,o[i])<op)?[n]:[n,o]}function Hfn(e){let{plans:t,items:n,obstacles:o,traceWidth:r,clearance:i}=e,s=new Map(n.map((u)=>[u.connection.connection.name,u.netKey])),a=new Map,c=new Map;for(let u of t){let _=s.get(u.connectionName),p=a.get(_)??[],m=c.get(_)??new Set;for(let A of u.segments){let f=[A.start,A.end].map((y)=>`${y.x.toFixed(6)}:${y.y.toFixed(6)}`).sort().join(":");if(m.has(f))continue;m.add(f),p.push(A)}a.set(_,p),c.set(_,m)}let l=r/2+i;for(let[u,_]of a)for(let p of _)for(let m of o){if(m.connectedTo.includes(u)||Wl(p,m)>=l-op)continue;if(lue)console.error("single-layer route violates obstacle clearance",{netKey:u,segment:p,obstacleId:m.obstacleId,distance:Wl(p,m),requiredObstacleDistance:l});return!1}let h=r+i,d=[...a];for(let u=0;u<d.length;u++)for(let _=u+1;_<d.length;_++)for(let p of d[u][1])for(let m of d[_][1])if(ad(p.start,p.end,m.start,m.end)<h-op){if(lue)console.error("single-layer routes violate copper clearance",{firstNetKey:d[u][0],secondNetKey:d[_][0],first:p,second:m,distance:ad(p.start,p.end,m.start,m.end),requiredRouteDistance:h});return!1}return!0}function tUr(e,t){if(Math.abs(e.x-t.minX)<op)return"left";if(Math.abs(e.x-t.maxX)<op)return"right";if(Math.abs(e.y-t.minY)<op)return"down";if(Math.abs(e.y-t.maxY)<op)return"up";return null}function*nUr(e){let{items:t,grid:n,obstacles:o,traceWidth:r,clearance:i,availableBoundaryRegions:s,onPartialRoutes:a,reportProgress:c}=e,l=s?new Set(s.map((g)=>g.direction)):void 0,h=new Set(t.filter((g)=>g.connection.sourceObstacle.width>2&&g.connection.sourceObstacle.height>2)),d=null;for(let g=0;g<4;g++){let f=t.filter((b)=>!h.has(b)),y=null;for(let b=0;b<4;b++){let I=yield*ZGr({direction:"any",availableDirections:l,items:f,grid:n,obstacles:o,traceWidth:r,clearance:i,occupiedNodes:new Uint8Array(n.nodeCount),acceptedSegments:[],connectorSelectionOffset:b,reportProgress:c});if(!I)continue;if(a&&I.routes.length>0&&I.routes.length<t.length){let v=I.routes.map((P)=>Lfn(P,r));if(Hfn({plans:v,items:t,obstacles:o,traceWidth:r,clearance:i}))a(v)}if(!y||I.routes.length>y.routes.length)y=I;if(I.routes.length===f.length)break}if(!y)return null;if(y.routes.length===f.length){d=y;break}let x=new Map;for(let b of f)x.set(b.netKey,(x.get(b.netKey)??0)+1);let C=!1;for(let b of y.unmatchedItems){if((x.get(b.netKey)??0)<2)continue;h.add(b),C=!0}if(!C)return null}if(!d)return null;let u=[...d.routes],_=r/2+i,p=r+i;for(let g of h){let f=u.filter((x)=>x.item.netKey===g.netKey).flatMap((x)=>x.points.map((C,b)=>({route:x,point:C,pointIndex:b}))).sort((x,C)=>Number(C.route.item.bus.componentId===g.bus.componentId)-Number(x.route.item.bus.componentId===g.bus.componentId)||Ut(g.source,x.point)-Ut(g.source,C.point)),y=null;for(let x of f){for(let C of eUr(g.source,x.point)){let b=ZJ(C,r),I=b.every((M)=>o.every((B)=>SCn(B,g)||Wl(M,B)>=_-op)),v=b.every((M)=>u.every((B)=>B.item.netKey===g.netKey||B.segments.every((T)=>ad(M.start,M.end,T.start,T.end)>=p-op)));if(!I||!v)continue;let P=PCn(G8e([...C,...x.route.points.slice(x.pointIndex+1)]));y={item:g,points:P,segments:ZJ(P,r)};break}if(y)break}if(!y)return null;u.push(y),c({phase:"merge-same-net-routes",processed:u.length,total:t.length,grid:{points:n.points,obstacleFreeNodes:n.obstacleFreeNodes,processedNodeCount:n.nodeCount},segments:u.flatMap((x)=>x.segments)}),yield}let m=u.map((g)=>Lfn(g,r));if(!Hfn({plans:m,items:t,obstacles:o,traceWidth:r,clearance:i})){if(lue)console.error("single-layer adaptive exits failed exact clearance");return null}for(let g of m){let f=tUr(g.exitPoint,n.boundary);if(!f||l&&!l.has(f))return null;let y=t.find((b)=>b.connection.connection.name===g.connectionName);y.bus.direction=f;let x=s?.filter((b)=>b.direction===f),C=f==="up"||f==="down"?g.exitPoint.x:g.exitPoint.y;y.bus.preferredExit=x?.toSorted((b,I)=>Math.abs(C-Ove(b,n.boundary))-Math.abs(C-Ove(I,n.boundary)))[0]?.preferredExit??(f==="up"?"top":f==="down"?"bottom":f),g.direction=f}let A=new Map(m.map((g)=>[g.connectionName,g]));return t.map((g)=>A.get(g.connection.connection.name))}function*_G(e){let{srj:t,buses:n,traceWidth:o,clearance:r,availableBoundaryRegions:i,onPartialRoutes:s,onProgress:a}=e;if(n.some((m)=>m.connections.length!==1))return null;let c=n.flatMap((m)=>m.connections.map((A)=>({bus:m,connection:A,source:{x:A.sourcePoint.x,y:A.sourcePoint.y},netKey:KGr(A)}))),l=t.obstacles.filter((m)=>m.layers.includes("top")),h=n[0]?.sharedBoundary;if(!h)return[];let d=c.map((m)=>m.source),u=(m)=>{a?.(jGr({boundary:h,sourcePoints:d,traceWidth:o,update:m}),{adaptivePhase:m.phase,...m.direction?{adaptiveDirection:m.direction}:{},...m.processed!==void 0?{adaptiveWorkUnit:m.processed}:{},...m.total!==void 0?{adaptiveWorkUnitCount:m.total}:{}})};u({phase:"prepare-flow-grid",processed:0,total:l.length});let _=yield*JGr({boundary:h,obstacles:l,traceWidth:o,clearance:r,reportProgress:u});if(lue)console.error("single-layer adaptive-exit grid ready",{nodeCount:_.nodeCount});let p=yield*nUr({items:c,grid:_,obstacles:l,traceWidth:o,clearance:r,availableBoundaryRegions:i,onPartialRoutes:s,reportProgress:u});if(p)return p;return null}var ux=0.000000001;function oUr(e,t){let n=[e[0]];for(let o=1;o<e.length-1;o++){let r=e[o-1],i=e[o],s=e[o+1],a=i.x-r.x,c=i.y-r.y,l=s.x-i.x,h=s.y-i.y,d=Math.hypot(a,c),u=Math.hypot(l,h);if(d<ux||u<ux)continue;if(Math.abs(a*l+c*h)<ux){let _=Math.min(t,d/2,u/2);n.push({x:i.x-a/d*_,y:i.y-c/d*_},{x:i.x+l/u*_,y:i.y+h/u*_})}else n.push(i)}return n.push(e.at(-1)),n.filter((o,r)=>r===0||Ut(o,n[r-1])>ux)}function rUr(e,t,n){let o=e.toSorted((a,c)=>Math.atan2(a.exitPoint.y-n.y,a.exitPoint.x-n.x)-Math.atan2(c.exitPoint.y-n.y,c.exitPoint.x-n.x)),r=(a,c)=>{for(let l=0;l<Math.min(a.length,c.length);l++){let h=t.get(a[l].connectionIndex)-t.get(c[l].connectionIndex);if(h)return h<0}return!1},i=(a,c)=>a.length>c.length||a.length===c.length&&r(a,c),s=[];for(let a=o.length-1;a>=0;a--){let c=[];for(let l=a+1;l<o.length;l++)if(t.get(o[l].connectionIndex)>t.get(o[a].connectionIndex)&&i(s[l],c))c=s[l];s[a]=[o[a],...c]}return s.reduce((a,c)=>i(c,a)?c:a,[])}function*iUr(e){let{bus:t,srj:n,traceWidth:o,clearance:r,viaDiameter:i}=e;if(t.termination.type!=="boundary"||t.exitEdge!=="right"||t.connections.length<6||t.connections.some((ee)=>ee.sourceLayer!=="top")||!(t.allowedLayers??e.layerNames).includes(e.targetLayer)||e.targetLayer==="top")return null;let s=t.componentObstacles.filter((ee)=>ee.layers.includes("top"));if(!s.length)return null;let a={minX:Math.min(...s.map((ee)=>ee.center.x-ee.width/2)),maxX:Math.max(...s.map((ee)=>ee.center.x+ee.width/2)),minY:Math.min(...s.map((ee)=>ee.center.y-ee.height/2)),maxY:Math.max(...s.map((ee)=>ee.center.y+ee.height/2))},c={x:(a.minX+a.maxX)/2,y:(a.minY+a.maxY)/2},l=o+r,h=Math.max(t.pitchX,t.pitchY);if(!Number.isFinite(h)||h<=0)return null;let d=Math.ceil(((a.maxX-a.minX)/2+h+l)/l)*l,u=Math.ceil(((a.maxY-a.minY)/2+h+l)/l)*l,_={minX:c.x-d,maxX:c.x+d,minY:c.y-u,maxY:c.y+u};if(_.minX<=t.sharedBoundary.minX||_.maxX>=t.sharedBoundary.maxX||_.minY<=t.sharedBoundary.minY||_.maxY>=t.sharedBoundary.maxY)return null;let p=t.connections.map((ee,se)=>({...t,busId:`${t.busId}:source-perimeter:${se}`,sharedBoundary:_,preferredExit:void 0,exitEdge:void 0,connections:[{...ee,exitTargetPoint:void 0,hasExplicitLayeredExitTarget:!1,hasExplicitExitTarget:!1}]})),m=yield*_G({srj:n,buses:p,traceWidth:o,clearance:r});if(!m||m.length!==t.connections.length)return null;let A=(ee)=>e.targetPointsByConnectionIndex?.get(ee.connectionIndex)??{x:t.sharedBoundary.maxX,y:(ee.exitTargetPoint??ee.targetPoint).y},g=t.connections.toSorted((ee,se)=>A(ee).y-A(se).y||ee.connectionIndex-se.connectionIndex),f=new Map(g.map((ee,se)=>[ee.connectionIndex,se])),y=rUr(m,f,c);if(y.length<3||y.length>=t.connections.length||y.some((ee)=>Math.abs(ee.exitPoint.y-_.maxY)>ux&&(Math.abs(ee.exitPoint.x-_.minX)>ux||ee.exitPoint.y<c.y)))return null;let x=new Map(e.buses.flatMap((ee)=>ee.connections.map((se)=>[se.connectionIndex,{bus:ee,connection:se}]))),C=t.sharedBoundary.maxX-Math.max(h/2,i/2+r),b=i/2+o/2+r,v=C-b-0.00001-(y.length-1)*l,M=t.sharedBoundary.maxY-l-(y.length-1)*l;if(v<=a.maxX+b||M<=_.maxY+l)return null;let B=(ee,se)=>{let ne=x.get(ee.connectionIndex).bus,re=ne.busId===t.busId?e.targetLayer:ne.termination.type==="plane"?ne.termination.layer:e.targetLayerByBusId?.get(ne.busId)??(ne.allowedLayers??e.layerNames).find((Z)=>Z!==ee.sourceLayer);if(!re)throw Error("FanoutSolver: missing target layer for peripheral via assignment");return{center:se,diameter:i,holeDiameter:e.viaHoleDiameter,fromLayer:ee.sourceLayer,toLayer:re,spanLayers:G5({fromLayer:ee.sourceLayer,toLayer:re,layerNames:e.layerNames,allowBlindAndBuriedVias:e.allowBlindAndBuriedVias??!1})}},T=(ee,se)=>({connectionIndex:ee.connectionIndex,connectionName:ee.connection.name,segments:se.slice(1).map((ne,re)=>({start:se[re],end:ne,width:o,layer:ee.sourceLayer})),via:B(ee,se.at(-1))}),N=y.map((ee,se)=>{let ne=x.get(ee.connectionIndex).connection,re=A(ne),Z=M+se*l,te=v+se*l;return T(ne,oUr([ee.segments[0].start,...ee.segments.map((ie)=>ie.end),{x:ee.exitPoint.x,y:Z},{x:te,y:Z},{x:te,y:re.y},{x:C,y:re.y}],o))}),D=new Set(N.map((ee)=>ee.connectionIndex)),L=(ee,se)=>{let ne=x.get(ee.connectionIndex).connection;if(ee.segments.some((re)=>[re.start,re.end].some((Z)=>Z.x<t.sharedBoundary.minX-ux||Z.x>t.sharedBoundary.maxX+ux||Z.y<t.sharedBoundary.minY-ux||Z.y>t.sharedBoundary.maxY+ux)))return!1;for(let re of n.obstacles){if(re.layers.some((Z)=>ee.via.spanLayers.includes(Z))&&X5(ee.via.center,re)<i/2+r-ux)return!1;if(re!==ne.sourceObstacle&&ee.segments.some((Z)=>re.layers.includes(Z.layer)&&Wl(Z,re)<o/2+r-ux))return!1}for(let re of se){if(ee.connectionIndex===re.connectionIndex)continue;if(Ut(ee.via.center,re.via.center)<i+r-ux)return!1;if(ee.segments.some((Z)=>Vr(re.via.center,Z.start,Z.end)<b-ux)||re.segments.some((Z)=>Vr(ee.via.center,Z.start,Z.end)<b-ux))return!1;if(ee.segments.some((Z)=>re.segments.some((te)=>!V_(Z,te,r))))return!1}return!0};if(N.some((ee)=>!L(ee,N)))return null;let H=()=>{let ee=new Set(N.map((se)=>se.connectionIndex));return e.buses.map((se)=>({...se,connections:se.connections.filter((ne)=>!ee.has(ne.connectionIndex))})).filter((se)=>se.connections.length)},V=()=>({viaDiameter:i,viaHoleDiameter:e.viaHoleDiameter,traceWidth:o,clearance:r,additionalObstacles:n.obstacles,maximumSearchStates:300000,blockingSegments:N.flatMap((ee)=>ee.segments.map((se)=>({connectionIndex:ee.connectionIndex,segment:se}))),blockingVias:N.map((ee)=>({connectionIndex:ee.connectionIndex,...ee.via})),preferredViaPointsByConnectionIndex:e.initialViaPoints}),O=H(),U=new Set(Kk(O,V()).map((ee)=>ee.connectionIndex));for(let ee of O)for(let se of ee.connections){if(U.has(se.connectionIndex))continue;if(ee.termination.type!=="plane")return null;let{sourcePoint:ne,sourceObstacle:re}=se,Z=[{x:0,y:1,gap:a.maxY-ne.y},{x:-1,y:0,gap:ne.x-a.minX},{x:0,y:-1,gap:ne.y-a.minY},{x:1,y:0,gap:a.maxX-ne.x}].sort((ie,le)=>ie.gap-le.gap),te=null;for(let ie of Z){for(let le=0;le<8;le++){let ue=(ie.x?re.width:re.height)/2+i/2+r+0.00001+le*o,de=T(se,[ne,{x:ne.x+ie.x*ue,y:ne.y+ie.y*ue}]);if(L(de,N)){te=de;break}}if(te)break}if(!te)return null;N.push(te)}O=H();let j=V(),Y=I0(O,j);if(!Y)return null;yield;let X=XGr({buses:O,busId:t.busId,rules:{...j,preferredViaPointsByConnectionIndex:Y}});if(!X)return null;let K=[...N,...O.flatMap((ee)=>ee.connections.map((se)=>T(se,[se.sourcePoint,X.get(se.connectionIndex)])))];if(K.some((ee)=>!L(ee,K)))return null;let J=new Map(K.map((ee)=>[ee.connectionIndex,ee.via.center]));return{sourceEscapes:K,viaPointsByConnectionIndex:J,remoteConnectionIndices:D,localBus:O.find((ee)=>ee.busId===t.busId),sourceBoundary:_}}function*sUr(e){let{srj:t,bus:n,targetLayer:o,sourceBoundary:r,sourceEscapes:i,remoteConnectionIndices:s,traceWidth:a,clearance:c}=e;if(n.exitEdge!=="right"||n.termination.type!=="boundary")return null;let l=a+c,h=Math.min(n.pitchX,n.pitchY),d=new Map(i.map((D)=>[D.connectionIndex,D])),u=n.connections.map((D)=>{let L=d.get(D.connectionIndex);if(!L)throw Error(`FanoutSolver: missing source escape for ${D.connection.name}`);let H=D.exitTargetPoint??D.targetPoint;return{connection:D,viaPoint:L.via.center,exitPoint:{x:n.sharedBoundary.maxX,y:H.y}}}).sort((D,L)=>D.exitPoint.y-L.exitPoint.y),_=u.filter((D)=>!s.has(D.connection.connectionIndex));if(_.length<2||_.length===u.length)return null;let p=Math.min(...n.componentObstacles.map((D)=>D.center.x-D.width/2)),m=Math.max(..._.map((D)=>D.viaPoint.x))-a/2,A=p+e.viaDiameter/2;if(m-A<(_.length-1)*l)return null;let g=r.maxY,f={minX:p-h,maxX:Math.max(..._.map((D)=>D.viaPoint.x))+2*h,minY:Math.min(..._.map((D)=>D.viaPoint.y))-3*h,maxY:g},y=new Set(_.map((D)=>D.connection.connectionIndex)),x=_.map((D,L)=>({...D,exitPoint:{x:m+(A-m)*L/(_.length-1),y:g}})),C={...n,exitEdge:"top",direction:"up",preferredExit:void 0,sharedBoundary:f,connections:_.map((D)=>D.connection)},b=new Map(i.map((D)=>[D.connectionIndex,[D.segments[0].start,...D.segments.map((L)=>L.end)]])),I;for(let D of[-1,0,1]){let L=yield*w1({...e,bus:C,srj:{...t,bounds:f},acceptedPlans:[],terminals:x,sourceEscapePaths:b,reservedVias:i.filter((H)=>!y.has(H.connectionIndex)).map((H)=>({connectionName:H.connectionName,via:H.via})),allowBlindAndBuriedVias:!1,allowSameNetMerges:!1,gridStepDivisor:2,gridStep:l/4,alignGridToPads:!0,maximumRouteOrderAttempts:1,routeOrder:_.map((H,V)=>_.length-V-1),laneBias:D},1,!1);if(L.length){I=L[0];break}}if(!I)return null;let v=new Map(I.map((D)=>[D.connectionIndex,D])),P=g+h,M=n.sharedBoundary.maxX-(_.length+1)*l-2*e.viaDiameter;if(P+(_.length-1)*l+a/2>n.sharedBoundary.maxY)return null;let B=0,T=[];for(let D of u){let L=d.get(D.connection.connectionIndex),H=v.get(D.connection.connectionIndex),V;if(H){let O=H.segments.filter((se)=>se.layer===o),U=O.at(-1),j=U.end.x-U.start.x,Y=U.end.y-U.start.y;if(Y<=0||Math.abs(j)>Y+0.0000001)return null;let X=U.end,K=P+B*l,J=M+B*l;B++;let ee=aUr([X,{x:X.x,y:K},{x:J,y:K},{x:J,y:D.exitPoint.y},D.exitPoint],a);V=[O[0].start,...O.map((se)=>se.end),...ee.slice(1)]}else V=[L.via.center,D.exitPoint];T.push(B6({...e,bus:n,terminal:D,targetLayerPoints:V,sourceEscapePoints:b.get(D.connection.connectionIndex),allowBlindAndBuriedVias:!1}))}let N=T.map((D)=>D.length);if(n.maxLengthSkew!==void 0&&Math.max(...N)-Math.min(...N)>n.maxLengthSkew+0.000001)return null;if(!wp({plans:T,srj:t,sharedBoundary:n.sharedBoundary,clearance:c,allowBlindAndBuriedVias:!1,allowSameNetMerges:!1}))return null;for(let D of T)for(let L of i){if(D.connectionIndex===L.connectionIndex)continue;for(let H of D.segments){if(L.via.spanLayers.includes(H.layer)&&Vr(L.via.center,H.start,H.end)<L.via.diameter/2+H.width/2+c-0.0000001)return null;for(let V of L.segments)if(H.layer===V.layer&&ad(H.start,H.end,V.start,V.end)<(H.width+V.width)/2+c-0.0000001)return null}}return T}function aUr(e,t){let n=e.filter((o,r)=>r===0||Ut(o,e[r-1])>0.000000001);return n.flatMap((o,r)=>{if(r===0||r===n.length-1)return[o];let i=n[r-1],s=n[r+1],a=Math.min(t,Ut(i,o)/3,Ut(o,s)/3);if(Math.abs((o.x-i.x)*(s.x-o.x)+(o.y-i.y)*(s.y-o.y))>0.000000001)return[o];return[{x:o.x+(i.x-o.x)*a/Ut(i,o),y:o.y+(i.y-o.y)*a/Ut(i,o)},{x:o.x+(s.x-o.x)*a/Ut(o,s),y:o.y+(s.y-o.y)*a/Ut(o,s)}]})}function*cUr(e){let{bus:t,sourceBoundary:n,sourceEscapes:o,traceWidth:r,clearance:i,targetLayer:s}=e,a=Xi(t.exitEdge,t.preferredExit);if(e.allowBlindAndBuriedVias||t.exitEdge!=="right"||a!==void 0&&a!=="minimum"||t.connections.length<3)return null;let c=t.routableEscapeLayers??t.allowedLayers??[],l=c.find((U)=>U!==s);if(!l||!c.includes(s)||t.connections.some((U)=>U.sourceLayer===s))return null;let h=new Map(o.map((U)=>[U.connectionIndex,U])),d=r+i,u=Math.min(t.pitchX,t.pitchY),_=e.viaDiameter+i,p=t.sharedBoundary.minX+Math.max(u/2,e.viaDiameter/2+i);if(p+(t.connections.length-1)*_>=n.minX)return null;let m=e.acceptedPlans.filter((U)=>U.exitEdge===t.exitEdge&&U.cornerBandSide==="minimum").length,A=t.connections.map((U)=>{let j=h.get(U.connectionIndex);if(!j)throw Error(`FanoutSolver: missing crossbar source escape for ${U.connection.name}`);return{connection:U,viaPoint:j.via.center,exitPoint:{x:t.sharedBoundary.maxX,y:a?Tv({...e,connection:U,cornerExitLaneOffset:m}):Tv({...e,bus:{...t,preferredExit:"bottom-right"},connection:U,cornerExitLaneOffset:m,windingOrderIndex:0})}}}),g=A.toSorted((U,j)=>U.exitPoint.y-j.exitPoint.y);if(!a)for(let[U,j]of g.entries())j.exitPoint.y=n.minY+u+U*_;let f=new Map(g.map((U)=>[U.connection.connectionIndex,U.exitPoint.y])),y=Math.min(n.maxY-d,Math.max(...A.map((U)=>U.viaPoint.y))+2*u),x=Math.max(n.minY+d,Math.min(...A.map((U)=>U.viaPoint.y))-2*u,...a?[]:[Math.max(...f.values())+e.viaDiameter/2+r/2+i+d]);if(y-x<(A.length-1)*_||x<=Math.max(...f.values())+e.viaDiameter/2+r/2+i)return null;let C=new Map(o.map((U)=>[U.connectionIndex,[U.segments[0].start,...U.segments.map((j)=>j.end)]])),b=[...e.srj.obstacles.filter((U)=>U.layers.includes(s)).map((U)=>({...U,layers:["top"]})),...o.map((U)=>({type:"rect",shape:"circle",center:U.via.center,width:U.via.diameter,height:U.via.diameter,layers:["top"],connectedTo:[U.connectionName]}))];for(let U=n.minY;U<=n.maxY;U+=d)if(U<x||U>y)b.push({type:"rect",shape:"circle",center:{x:n.minX,y:U},width:r/1000,height:r/1000,layers:["top"],connectedTo:["blocked-port"]});let I=A.map((U,j)=>({...t,busId:t.busId+":"+j,sharedBoundary:n,preferredExit:void 0,exitEdge:void 0,connections:[{...U.connection,sourcePoint:{...U.viaPoint,layer:"top"},sourceLayer:"top",sourceObstacle:b.find((Y)=>Y.connectedTo.includes(U.connection.connection.name)&&Ut(Y.center,U.viaPoint)<0.0000001),exitTargetPoint:void 0,hasExplicitLayeredExitTarget:!1,hasExplicitExitTarget:!1}]})),v=_G({srj:{...e.srj,obstacles:b},buses:I,traceWidth:r,clearance:i,availableBoundaryRegions:[{exitEdge:"left",direction:"left",preferredExit:"left"}]}),P=v.next();while(!P.done)yield{phase:"route-connection",routeOrderAttempt:0,connectionIndex:0,connectionCount:A.length,connectionName:A[0].connection.connection.name,searchBatch:0,expandedStateCount:0,connectionComplete:!1},P=v.next();let M=P.value?.length===A.length?P.value.map((U)=>{let j=A.find((Y)=>Y.connection.connectionIndex===U.connectionIndex);return B6({...e,terminal:{...j,exitPoint:U.exitPoint},sourceEscapePoints:C.get(U.connectionIndex),targetLayerPoints:[U.segments[0].start,...U.segments.map((Y)=>Y.end)],allowBlindAndBuriedVias:!1})}):void 0;if(!M)return null;let B=M.toSorted((U,j)=>a?U.exitPoint.y-j.exitPoint.y:A.find((Y)=>Y.connection.connectionIndex===U.connectionIndex).exitPoint.y-A.find((Y)=>Y.connection.connectionIndex===j.connectionIndex).exitPoint.y),T=(U,j,Y)=>({center:U,diameter:e.viaDiameter,holeDiameter:e.viaHoleDiameter,fromLayer:j,toLayer:Y,spanLayers:G5({fromLayer:j,toLayer:Y,layerNames:e.layerNames,allowBlindAndBuriedVias:!1})}),N=new Map;for(let[U,j]of B.entries()){let Y=j.segments.at(-1),X=Y.end.x-Y.start.x,K=Y.end.y-Y.start.y;if(X>=0||Math.abs(K)>-X+0.0000001)return null;let J=A.find((Z)=>Z.connection.connectionIndex===j.connectionIndex),ee=p+U*_,se={x:ee,y:j.exitPoint.y},ne={x:ee,y:f.get(j.connectionIndex)},re=[{start:j.exitPoint,end:se,width:r,layer:s},{start:se,end:ne,width:r,layer:l}];N.set(j.connectionIndex,{...j,segments:[...j.segments,...re],additionalVias:[T(se,s,l),T(ne,l,s)],direction:t.direction,exitEdge:t.exitEdge,cornerBandSide:Xi(t.exitEdge,t.preferredExit),exitPoint:J.exitPoint})}let D=[...N.values()],L=A.map((U)=>({...U.connection,sourcePoint:{...N.get(U.connection.connectionIndex).additionalVias[1].center,layer:s},sourceLayer:s})),H={...e,bus:{...t,connections:L},terminals:L.map((U,j)=>({connection:U,viaPoint:U.sourcePoint,exitPoint:A[j].exitPoint})),acceptedPlans:[...e.acceptedPlans,...D],reservedVias:[...o.map((U)=>({connectionName:U.connectionName,via:U.via})),...D.flatMap((U)=>U.additionalVias.map((j)=>({connectionName:U.connectionName,via:j})))],allowSourceLayerRouting:!0,sourceEscapePaths:void 0,gridStep:d*3/8,gridStepDivisor:2,alignGridToPads:!0,maximumRouteOrderAttempts:6,routeOrder:A.map((U,j)=>j).sort((U,j)=>A[U].exitPoint.y-A[j].exitPoint.y)},V=yield*w1(H,1,!1);if(!V.length)return null;let O=M.map((U)=>{let j=N.get(U.connectionIndex),Y=V[0].find((ne)=>ne.connectionIndex===U.connectionIndex),[X,K]=j.additionalVias,J=(ne,re)=>({route_type:"wire",...ne,width:r,layer:re}),ee=(ne)=>({route_type:"via",...ne.center,from_layer:ne.fromLayer,to_layer:ne.toLayer,via_diameter:ne.diameter,via_hole_diameter:ne.holeDiameter}),se=[...j.segments,...Y.segments];return{...j,segments:se,trace:{...U.trace,route:[...U.trace.route,J(X.center,s),ee(X),J(X.center,l),J(K.center,l),ee(K),...Y.trace.route]},length:se.reduce((ne,re)=>ne+Ut(re.start,re.end),0)}});if(!wp({...e,plans:[...e.acceptedPlans,...O],sharedBoundary:t.sharedBoundary}))return null;for(let U of O)for(let j of o){if(U.connectionIndex===j.connectionIndex)continue;for(let Y of U.segments){if(j.via.spanLayers.includes(Y.layer)&&Vr(j.via.center,Y.start,Y.end)<j.via.diameter/2+r/2+i-0.0000001)return null;for(let X of j.segments)if(X.layer===Y.layer&&ad(Y.start,Y.end,X.start,X.end)<r+i-0.0000001)return null}for(let Y of U.additionalVias){if(Ut(Y.center,j.via.center)<e.viaDiameter+i-0.0000001)return null;for(let X of j.segments)if(Y.spanLayers.includes(X.layer)&&Vr(Y.center,X.start,X.end)<e.viaDiameter/2+r/2+i-0.0000001)return null}}return O}function Yve(e){let t=new Map,n=(o)=>{if(o===null||typeof o!=="object")return o;if(t.has(o))return t.get(o);if(o instanceof Map){let a=new Map;t.set(o,a);for(let[c,l]of o)a.set(c,n(l));return a}if(o instanceof Set){let a=new Set(o);return t.set(o,a),a}if(Array.isArray(o)){let a=[];t.set(o,a);for(let c of o)a.push(n(c));return a}let r=o,i={};t.set(o,i);for(let[a,c]of Object.entries(r))i[a]=n(c);if(typeof r.x==="number"&&typeof r.y==="number")i.x=-r.x;if(typeof r.minX==="number"&&typeof r.maxX==="number")i.minX=-r.maxX,i.maxX=-r.minX;if(Array.isArray(r.xCoordinates))i.xCoordinates=r.xCoordinates.map((a)=>-a).sort((a,c)=>a-c);if(typeof r.ccwRotationDegrees==="number")i.ccwRotationDegrees=-r.ccwRotationDegrees;let s=(a)=>a==="left"?"right":a==="right"?"left":a;for(let a of["direction","exitEdge","preferredExit"])if(typeof r[a]==="string")i[a]=r[a].split("-").map(s).join("-");if(r.cornerBandSide&&(r.exitEdge==="top"||r.exitEdge==="bottom"))i.cornerBandSide=r.cornerBandSide==="minimum"?"maximum":"minimum";return i};return n(e)}function*ECn(e){let{bus:t,srj:n,sourceEscapes:o,sourceBoundary:r,targetLayer:i,acceptedPlans:s,traceWidth:a,clearance:c,viaDiameter:l}=e,h=t.exitEdge==="left",d=h?e.oppositeLayout:void 0,u=t.routableEscapeLayers??t.allowedLayers??[],_=t.connections[0].sourceLayer,p=h?u.find((Ne)=>Ne!==i):_;if(t.termination.type!=="boundary"||t.exitEdge!=="right"&&!h||!p||!u.includes(i)||p===i||!(t.routableEscapeLayers??t.allowedLayers??[]).includes(p))return null;let m=Xi(t.exitEdge,t.preferredExit)==="minimum",A=t.connections.length,g=a+c,f=Math.ceil((l+c)/g)*g,y=new Map(o.map((Ne)=>[Ne.connectionIndex,Ne])),x=t.connections.map((Ne)=>y.get(Ne.connectionIndex));if(A<2||x.some((Ne)=>!Ne))return null;let C=x.map((Ne)=>Ne.via.center),b=Math.round(((h?(r.minX+r.maxX)/2+(d?.sourcePortOffset??0):Math.min(...C.map((Ne)=>Ne.x)))+f-r.minX)/g),I=Math.round(f/g),v=new Set(Array.from({length:A},(Ne,ke)=>b+ke*I)),P=Math.round((r.maxX-r.minX)/g);if(b<1||Math.max(...v)>=P)return null;let M=(Ne,ke,nt)=>({type:"rect",shape:"circle",center:ke,width:nt,height:nt,layers:["top"],connectedTo:[Ne]}),B=[...n.obstacles.filter((Ne)=>Ne.layers.includes(i)).map((Ne)=>({...Ne,layers:["top"]})),...o.map((Ne)=>M(Ne.connectionName,Ne.via.center,Ne.via.diameter)),...s.flatMap((Ne)=>(Ne.additionalVias??[]).map((ke)=>M(Ne.connectionName,ke.center,ke.diameter))),...s.flatMap((Ne)=>Ne.segments.filter((ke)=>ke.layer===i).map((ke)=>({type:"rect",center:{x:(ke.start.x+ke.end.x)/2,y:(ke.start.y+ke.end.y)/2},width:Ut(ke.start,ke.end),height:ke.width,ccwRotationDegrees:Math.atan2(ke.end.y-ke.start.y,ke.end.x-ke.start.x)*180/Math.PI,layers:["top"],connectedTo:[Ne.connectionName]})))];for(let Ne=0;Ne<=P;Ne++)if(!v.has(Ne))B.push(M(`reserved-crossbar-port-${Ne}`,{x:r.minX+Ne*g,y:r.minY},a/1000));let T=t.connections.map((Ne,ke)=>{let nt=C[ke],dt=B.find((rt)=>rt.connectedTo.includes(Ne.connection.name)&&Ut(rt.center,nt)<0.0000001);return{...t,busId:`${t.busId}:source-${ke}`,sharedBoundary:r,preferredExit:void 0,exitEdge:void 0,connections:[{...Ne,sourcePoint:{...Ne.sourcePoint,...nt,layer:"top"},sourceObstacle:dt,sourceLayer:"top",exitTargetPoint:void 0,hasExplicitLayeredExitTarget:!1,hasExplicitExitTarget:!1}]}}),N=_G({srj:{...n,bounds:r,obstacles:B},buses:T,traceWidth:a,clearance:c,availableBoundaryRegions:[{direction:"down",preferredExit:"bottom",exitEdge:"bottom"}]}),D=N.next();while(!D.done)yield{phase:"route-connection",routeOrderAttempt:0,connectionIndex:0,connectionCount:A,connectionName:t.connections[0].connection.name,searchBatch:0,expandedStateCount:0,connectionComplete:!1},D=N.next();if(!D.value||D.value.length!==A)return null;let L=new Map(D.value.map((Ne)=>[Ne.connectionIndex,Ne])),H=(Ne)=>Xi(t.exitEdge,t.preferredExit)!==void 0?Tv({...e,connection:Ne,cornerExitLaneOffset:0}):iG({...e,connection:Ne,boundaryDirection:h?"left":"right"}),V=t.connections.toSorted((Ne,ke)=>H(Ne)-H(ke)),O=Math.max(...t.componentObstacles.map((Ne)=>Ne.center.x+Ne.width/2)),U=o.filter((Ne)=>Ne.via.center.x>r.maxX).map((Ne)=>Ne.via.center.x),j=U.length?Math.min(...U):t.sharedBoundary.maxX,Y=l/2+a/2+c,X=m||d?.compactRows?Math.max(Y,(l+c)/Math.SQRT2)+0.00001:f,K=Math.min(...s.flatMap((Ne)=>Ne.segments).filter((Ne)=>Ne.layer!==p).flatMap((Ne)=>[Ne.start.y,Ne.end.y])),J=Math.min(r.minY-l/2-c-(d?.rowOffset??0),m?K-Y-0.00001:1/0),ee=J-(A-1)*X,se=o.flatMap((Ne)=>Ne.segments).filter((Ne)=>Ne.layer===p&&(!m||Math.max(Ne.start.x,Ne.end.x)>=Math.min(...[...L.values()].map((ke)=>ke.exitPoint.x))-Y)&&Math.min(Ne.start.y,Ne.end.y)<=J+Y&&Math.max(Ne.start.y,Ne.end.y)>=ee-Y),ne=se.length?Math.min(...se.map((Ne)=>Math.min(Ne.start.x,Ne.end.x)))-Y-0.00001:t.sharedBoundary.maxX,re=Math.min(t.sharedBoundary.maxX-l-c,j-Y-a,ne),Z=[...o.map((Ne)=>Ne.via),...s.flatMap((Ne)=>Ne.additionalVias??[])].filter((Ne)=>Ne.spanLayers.includes(i)).map((Ne)=>({minimum:Ne.center.x-Ne.diameter/2-a/2-c-0.00001,maximum:Ne.center.x+Ne.diameter/2+a/2+c+0.00001})),te=Array.from({length:A},(Ne,ke)=>re-ke*X),ie=[];if(te.every((Ne)=>Z.every((ke)=>Ne<ke.minimum||Ne>ke.maximum)))ie.push(...te);else{let Ne=re;for(let ke=0;ke<A;ke++){for(let nt=0;nt<=Z.length;nt++){let dt=Z.filter((rt)=>Ne>=rt.minimum&&Ne<=rt.maximum);if(!dt.length)break;Ne=Math.min(...dt.map((rt)=>rt.minimum))-0.0000001}ie.push(Ne),Ne-=m?X:l+c}}let le=ie.at(-1),ue=[...o.map((Ne)=>Ne.via),...s.flatMap((Ne)=>Ne.additionalVias??[])].filter((Ne)=>Ne.spanLayers.includes(i)&&Ne.center.x+Ne.diameter/2+a/2+c>=(h?t.sharedBoundary.minX:le)&&Ne.center.x-Ne.diameter/2-a/2-c<=t.sharedBoundary.maxX).map((Ne)=>({minimum:Ne.center.y-Ne.diameter/2-a/2-c-a/100,maximum:Ne.center.y+Ne.diameter/2+a/2+c+a/100})),de=[],me=t.sharedBoundary.maxY-a/2;for(let Ne=A-1;Ne>=0;Ne--){for(let ke=0;ke<=ue.length;ke++){let nt=ue.filter((dt)=>me>=dt.minimum&&me<=dt.maximum);if(!nt.length)break;me=Math.min(...nt.map((dt)=>dt.minimum))-0.0000001}de[Ne]=me,me-=l+c}if(m)de.splice(0,de.length,...V.map(H));let Ae=de[0],xe=J;if(xe-(A-1)*X-l/2<t.sharedBoundary.minY||le<=Math.max(...[...L.values()].map((Ne)=>Ne.exitPoint.x))+Y||!m&&Ae<=(t.sharedBoundary.minY+t.sharedBoundary.maxY)/2)return null;let Me=V.map((Ne,ke)=>{let nt=L.get(Ne.connectionIndex),dt=y.get(Ne.connectionIndex),rt=de[ke];return{connectionIndex:Ne.connectionIndex,length:dt.segments.reduce((mt,lt)=>mt+Ut(lt.start,lt.end),0)+(d?.compactRows?2*ie[A-1-ke]:0)+nt.length+rt-nt.exitPoint.x}}).sort((Ne,ke)=>ke.length-Ne.length),Re=new Map(Me.map((Ne,ke)=>[Ne.connectionIndex,ke])),we=(Ne,ke)=>Ne.slice(1).flatMap((nt,dt)=>Ut(Ne[dt],nt)<0.000000001?[]:[{start:Ne[dt],end:nt,width:a,layer:ke}]),_e=(Ne,ke)=>Ne.map((nt)=>({route_type:"wire",...nt,width:a,layer:ke})),ye=(Ne)=>({route_type:"via",...Ne.center,from_layer:Ne.fromLayer,to_layer:Ne.toLayer,via_diameter:Ne.diameter,via_hole_diameter:Ne.holeDiameter}),Se=V.map((Ne,ke)=>{let nt=y.get(Ne.connectionIndex),dt=L.get(Ne.connectionIndex),rt=xe-Re.get(Ne.connectionIndex)*X,mt={x:dt.exitPoint.x,y:rt},lt={x:ie[h?A-1-ke:ke],y:rt},Ct={x:h?t.sharedBoundary.minX:t.sharedBoundary.maxX,y:de[ke]},Nt=[nt.segments[0].start,...nt.segments.map((ht)=>ht.end)],Ht=[dt.segments[0].start,...dt.segments.map((ht)=>ht.end),mt],Tt=[lt,{x:lt.x,y:Ct.y-Math.sign(Ct.y-lt.y)*a},{x:lt.x+(h?-a:a),y:Ct.y},Ct],et=B6({...e,terminal:{connection:Ne,viaPoint:nt.via.center,exitPoint:Ct},sourceEscapePoints:Nt,targetLayerPoints:[nt.via.center,Ct],allowBlindAndBuriedVias:!1}),vt=[{center:mt,diameter:l,holeDiameter:e.viaHoleDiameter,spanLayers:e.layerNames,fromLayer:i,toLayer:p},{center:lt,diameter:l,holeDiameter:e.viaHoleDiameter,spanLayers:e.layerNames,fromLayer:p,toLayer:i}];return et.segments=[...nt.segments,...we(Ht,i),...we([mt,lt],p),...we(Tt,i)],et.additionalVias=vt,et.sourceEscapeSegmentCount=nt.segments.length,et.length=et.segments.reduce((ht,We)=>ht+Ut(We.start,We.end),0),et.trace.route=[..._e(Nt,_),ye(et.via),..._e(Ht,i),ye(vt[0]),..._e([mt,lt],p),ye(vt[1]),..._e(Tt,i)],et});if(t.maxLengthSkew!==void 0&&!d?.compactRows){let Ne=Se.map((ke)=>ke.length);if(Math.max(...Ne)-Math.min(...Ne)>t.maxLengthSkew+0.000001)return null}if(!wp({...e,plans:[...s,...Se],sharedBoundary:t.sharedBoundary}))return null;for(let Ne of Se)for(let ke of o){if(Ne.connectionIndex===ke.connectionIndex)continue;for(let nt of Ne.segments){if(ke.via.spanLayers.includes(nt.layer)&&Vr(ke.via.center,nt.start,nt.end)<ke.via.diameter/2+a/2+c-0.0000001)return null;for(let dt of ke.segments)if(nt.layer===dt.layer&&ad(nt.start,nt.end,dt.start,dt.end)<(a+dt.width)/2+c-0.0000001)return null}for(let nt of Ne.additionalVias){if(Ut(nt.center,ke.via.center)<(nt.diameter+ke.via.diameter)/2+c-0.0000001)return null;for(let dt of ke.segments)if(nt.spanLayers.includes(dt.layer)&&Vr(nt.center,dt.start,dt.end)<nt.diameter/2+dt.width/2+c-0.0000001)return null}}return Se}function*lUr(e){if(e.bus.exitEdge!=="right")return null;let t=Yve(e),n=Math.min(e.bus.pitchX,e.bus.pitchY),o=e.traceWidth+e.clearance,r=Math.ceil((e.viaDiameter+e.clearance)/o)*o,i=Math.max(0,Math.min(8,Math.floor(((t.sourceBoundary.maxX-t.sourceBoundary.minX)/2-e.bus.connections.length*r-o)/n))),s=[void 0,{sourcePortOffset:-n,rowOffset:0,compactRows:!1},...[0,1,2,3].map((l)=>({sourcePortOffset:-n,rowOffset:l*o,compactRows:!0})),...Array.from({length:i},(l,h)=>i-h).flatMap((l)=>[0,1,2,3].map((h)=>({sourcePortOffset:l*n,rowOffset:h*o,compactRows:!0})))],a=null;for(let l of s)if(a=yield*ECn({...t,oppositeLayout:l}),a)break;if(!a)return null;let c=new Map(e.bus.connections.map((l)=>[l.connectionIndex,l]));return Yve(a).map((l)=>({...l,sourceObstacle:c.get(l.connectionIndex).sourceObstacle}))}function Ffn(e){let{bus:t,targetLayer:n,traceWidth:o,clearance:r}=e;if(!t.exitEdge)return[];let i=t.exitEdge==="left"||t.exitEdge==="right",s=i?"y":"x",a=i?"x":"y",c=t.sharedBoundary,l=t.exitEdge==="left"?c.minX:t.exitEdge==="right"?c.maxX:t.exitEdge==="bottom"?c.minY:c.maxY,h=i?c.minY:c.minX,d=i?c.maxY:c.maxX,u=(h+d)/2,_=Xi(t.exitEdge,t.preferredExit),p=(_==="maximum"?u:h)+o/2,m=(_==="minimum"?u:d)-o/2,A=[];for(let C of e.acceptedPlans)for(let b of[...C.segments,...C.planeEndpointSegments??[]]){if(b.layer!==n)continue;let I=(b.width+o)/2+r,v=b.start[a],P=b.end[a]-v,M=0,B=1;if(Math.abs(P)<0.000000001){if(Math.abs(v-l)>I)continue}else{let H=(l-I-v)/P,V=(l+I-v)/P;if(M=Math.max(0,Math.min(H,V)),B=Math.min(1,Math.max(H,V)),M>B)continue}let T=b.start[s],N=b.end[s]-T,D=T+M*N,L=T+B*N;A.push([Math.min(D,L)-I,Math.max(D,L)+I])}let g=[...e.acceptedPlans.flatMap((C)=>[...C.via?[C.via]:[],...C.additionalVias??[],...C.planeEndpointVia?[C.planeEndpointVia]:[]]),...(e.reservedVias??[]).map((C)=>C.via)];for(let C of g){if(!C.spanLayers.includes(n))continue;let b=C.diameter/2+o/2+r,I=Math.abs(C.center[a]-l);if(I>=b)continue;let v=Math.sqrt(b*b-I*I);A.push([C.center[s]-v,C.center[s]+v])}let f=[],y=p;for(let[C,b]of A.sort((I,v)=>I[0]-v[0])){if(b<=y||C>=m)continue;if(C>y)f.push([y,Math.min(C,m)]);if(y=Math.max(y,b),y>=m)break}if(y<m)f.push([y,m]);let x=f.filter(([C,b])=>b-C>0.000001).map(([C,b])=>(C+b)/2);return x.length<=32?x:Array.from({length:32},(C,b)=>x[Math.round(b*(x.length-1)/31)])}function*hUr(e){if(e.buses.some((p)=>p.termination.type!=="boundary"||p.connections.length>2))return null;let t=0,n=192,o=e.traceWidth+e.clearance;function*r(p,m,A=p.preferredExit,g=0){if(t++>=n)return[];return yield*z8e({...e,bus:{...p,preferredExit:A},acceptedPlans:m,reservedVias:e.reservedVias?.filter((f)=>!p.connections.some((y)=>y.connection.name===f.connectionName)),viaMinimalOnly:!0,adaptiveWindingRouteOrder:!0,alignWindingGridToPads:!0,windingGridStep:o/2,fixedViaFallbackRouteOrderAttempts:32,cornerBandTargetTrackOffset:g},1,!1)}let i=(p)=>p.map((m)=>{let A=e.buses.find((g)=>g.busId===m.busId);return A?{...m,cornerBandSide:Xi(A.exitEdge,A.preferredExit)}:m}),s=[...e.acceptedPlans];for(let p of e.buses){let m=yield*r(p,s);if(!m.length){s=[];break}s.push(...m[0])}if(s.length)return i(s.slice(e.acceptedPlans.length));let a=(p,m)=>p.connections.reduce((A,g)=>A+(e.fixedViaPointsByConnectionIndex?.get(g.connectionIndex)??g.sourcePoint)[m],0)/p.connections.length;if(e.buses.length>1)for(let p of[1,-1]){let m=e.buses.toSorted((g,f)=>{let y=Xi(g.exitEdge,g.preferredExit)!==void 0,x=Xi(f.exitEdge,f.preferredExit)!==void 0;if(y!==x)return Number(x)-Number(y);let C=g.exitEdge==="left"||g.exitEdge==="right"?"y":"x";return p*(a(g,C)-a(f,C))}),A=[...e.acceptedPlans];for(let g of m){let f=yield*r(g,A);if(!f.length){A=[];break}A.push(...f[0])}if(A.length)return i(A.slice(e.acceptedPlans.length))}let c=e.buses.toSorted((p,m)=>{let A=Xi(p.exitEdge,p.preferredExit),g=Xi(m.exitEdge,m.preferredExit),f=A==="minimum",y=g==="minimum";if(f!==y)return Number(y)-Number(f);if(f)return a(p,"y")-a(m,"y");if(p.connections.length!==m.connections.length)return p.connections.length-m.connections.length;if(p.connections.length===1)return a(p,"x")-a(m,"x");if(A!==g)return Number(A==="maximum")-Number(g==="maximum");return(A==="maximum"?1:-1)*(a(p,"y")-a(m,"y"))});if(e.buses.length>1){let p=c.toSorted((f,y)=>{let x=(C)=>C.connections.length===1&&!Xi(C.exitEdge,C.preferredExit);return Number(x(y))-Number(x(f))}),m=Math.min(n,t+48);function*A(f,y){if(f===p.length)return y;if(t>=m)return null;let x=p[f],C=yield*r(x,y);for(let I of C){let v=yield*A(f+1,[...y,...I]);if(v)return v}let b=yield*l(x,y,m);for(let I of b){let v=yield*A(f+1,[...y,...I]);if(v)return v}return null}let g=yield*A(0,[...e.acceptedPlans]);if(g)return i(g.slice(e.acceptedPlans.length))}function*l(p,m,A){if(!p.exitEdge)return[];let g=e.reservedVias?.filter((M)=>!p.connections.some((B)=>B.connection.name===M.connectionName)),f={...e,bus:p,acceptedPlans:m,reservedVias:g},y=Xi(p.exitEdge,p.preferredExit),x=p.exitEdge==="left"||p.exitEdge==="right",C=p.sharedBoundary,b=x?C.minY:C.minX,I=x?C.maxY:C.maxX,v=(b+I)/2,P=[];for(let M of Ffn(f)){if(t>=A)break;let B=y?p.preferredExit:h(p).find((O)=>Xi(p.exitEdge,O)===(M>v?"maximum":"minimum")),T=p.connections.map((O)=>Tv({...f,bus:{...p,preferredExit:B},connection:O,cornerExitLaneOffset:0,windingOrderIndex:0})),N=T.reduce((O,U)=>O+U,0)/T.length,D=T.map((O)=>O-N+M);if(D.some((O)=>O<=b+e.traceWidth/2||O>=I-e.traceWidth/2||y==="minimum"&&O>=v||y==="maximum"&&O<=v))continue;let L=p.connections.map((O,U)=>{let j=e.fixedViaPointsByConnectionIndex?.get(O.connectionIndex),Y=D[U],X=p.exitEdge==="left"?{x:C.minX,y:Y}:p.exitEdge==="right"?{x:C.maxX,y:Y}:p.exitEdge==="bottom"?{x:Y,y:C.minY}:{x:Y,y:C.maxY};return{connection:O,viaPoint:j,exitPoint:X}});if(L.some((O)=>!O.viaPoint))return[];t++;let H=w1({...f,terminals:L,gridStep:o/2,alignGridToPads:!0,maximumRouteOrderAttempts:p.connections.length===1?3:16,adaptiveRouteOrder:!0},1,!1),V=H.next();while(!V.done)yield{phase:"via-minimal-winding",busId:p.busId,targetLayer:e.targetLayer,winding:V.value},V=H.next();P.push(...V.value)}return P}function h(p){if(Xi(p.exitEdge,p.preferredExit))return[p.preferredExit];switch(p.exitEdge){case"right":return[p.preferredExit,"top-right","bottom-right"];case"left":return[p.preferredExit,"top-left","bottom-left"];case"top":return[p.preferredExit,"top-left","top-right"];case"bottom":return[p.preferredExit,"bottom-left","bottom-right"];default:return[p.preferredExit]}}function d(p,m,A){let g=Xi(p.exitEdge,A);if(!g||e.buses.length>1)return[0];let f=p.exitEdge==="left"||p.exitEdge==="right",y=f?p.sharedBoundary.minY:p.sharedBoundary.minX,x=f?p.sharedBoundary.maxY:p.sharedBoundary.maxX,C=(y+x)/2,b=m.filter((N)=>N.exitEdge===p.exitEdge&&N.cornerBandSide===g).length,I=p.connections.map((N)=>Tv({...e,bus:{...p,preferredExit:A},connection:N,cornerExitLaneOffset:b,windingOrderIndex:0})),v=g==="minimum"?-1:1,P=Math.min(p.pitchX,p.pitchY),M=I.reduce((N,D)=>N+D,0)/I.length,B=g==="minimum"?y+o:x-o,T=[0,v*2*o,-v*2*o,v*P,v*2*P,v*3*P,v*4*P,B-M];return T.filter((N,D)=>T.indexOf(N)===D&&I.every((L)=>L+N>y+e.traceWidth/2&&L+N<x-e.traceWidth/2&&(g==="minimum"?L+N<C:L+N>C)))}function*u(p,m){if(!p.length)return m;if(t>=n)return null;for(let A of p)for(let g of h(A))for(let f of d(A,m,g)){let y=yield*r(A,m,g,f);if(!y.length)continue;let x=yield*u(p.filter((C)=>C!==A),[...m,...y[0]]);if(x)return x;if(t>=n)return null}for(let A of p){if(A.connections.length!==1||!A.exitEdge)continue;let g=A.connections[0],f=e.fixedViaPointsByConnectionIndex?.get(g.connectionIndex);if(!f)continue;let y=e.reservedVias?.filter((C)=>C.connectionName!==g.connection.name),x=Ffn({...e,bus:A,acceptedPlans:m,reservedVias:y});for(let C of x){if(t++>=n)return null;let b=A.sharedBoundary,I=A.exitEdge==="left"?{x:b.minX,y:C}:A.exitEdge==="right"?{x:b.maxX,y:C}:A.exitEdge==="bottom"?{x:C,y:b.minY}:{x:C,y:b.maxY},v=w1({...e,bus:A,acceptedPlans:m,reservedVias:y,terminals:[{connection:g,viaPoint:f,exitPoint:I}],gridStep:o/2,alignGridToPads:!0,maximumRouteOrderAttempts:3},1,!1),P=v.next();while(!P.done)yield{phase:"via-minimal-winding",busId:A.busId,targetLayer:e.targetLayer,winding:P.value},P=v.next();if(!P.value.length)continue;let M=yield*u(p.filter((B)=>B!==A),[...m,...P.value[0]]);if(M)return M}}return null}let _=yield*u(c,[...e.acceptedPlans]);return _&&i(_.slice(e.acceptedPlans.length))}function*dUr(e){let{bus:t,sourceBoundary:n,sourceEscapes:o,traceWidth:r,clearance:i,targetLayer:s}=e,a=Xi(t.exitEdge,t.preferredExit);if(e.allowBlindAndBuriedVias||t.exitEdge!=="right"||a!==void 0&&a!=="minimum"||t.connections.length<3)return null;let c=t.routableEscapeLayers??t.allowedLayers??[],l=c.find((Y)=>Y!==s);if(!l||!c.includes(s)||t.connections.some((Y)=>Y.sourceLayer===s))return null;let h=new Map(o.map((Y)=>[Y.connectionIndex,Y])),d=r+i,u=Math.min(t.pitchX,t.pitchY),_=e.viaDiameter+i,p={x:(t.componentBounds.minX+t.componentBounds.maxX)/2,y:(t.componentBounds.minY+t.componentBounds.maxY)/2},m=t.sharedBoundary.minX+Math.max(u/2,e.viaDiameter/2+i);if(m+(t.connections.length-1)*_>=n.minX)return null;let A=e.acceptedPlans.filter((Y)=>Y.exitEdge===t.exitEdge&&Y.cornerBandSide==="minimum").length,g=t.connections.map((Y)=>{let X=h.get(Y.connectionIndex);if(!X)throw Error(`FanoutSolver: missing crossbar source escape for ${Y.connection.name}`);return{connection:Y,viaPoint:X.via.center,exitPoint:{x:t.sharedBoundary.maxX,y:a?Tv({...e,connection:Y,cornerExitLaneOffset:A}):Tv({...e,bus:{...t,preferredExit:"bottom-right"},connection:Y,cornerExitLaneOffset:A,windingOrderIndex:0})}}}),f=g.toSorted((Y,X)=>Y.exitPoint.y-X.exitPoint.y);if(!a)for(let[Y,X]of f.entries())X.exitPoint.y=n.minY+u+Y*_;let y=new Map(f.map((Y)=>[Y.connection.connectionIndex,Y.exitPoint.y])),x=Math.min(n.maxY-d,Math.max(...g.map((Y)=>Y.viaPoint.y))+2*u),C=Math.max(n.minY+d,Math.min(...g.map((Y)=>Y.viaPoint.y))-2*u,...a?[]:[Math.max(...y.values())+e.viaDiameter/2+r/2+i+d]);if(x-C<(g.length-1)*_||C<=Math.max(...y.values())+e.viaDiameter/2+r/2+i)return null;let b=(Y)=>{let X=g[Y].viaPoint,K=Math.atan2(X.y-p.y,X.x-p.x);return K<0?K+2*Math.PI:K},I=g.map((Y,X)=>X).sort((Y,X)=>b(Y)-b(X)),v=new Map(I.map((Y,X)=>[Y,{x:n.minX,y:x-(x-C)*X/(g.length-1)}])),P={minX:n.minX,maxX:p.x,minY:Math.min(C-u,Math.min(...g.map((Y)=>Y.viaPoint.y))-2*u),maxY:n.maxY},M=new Map(o.map((Y)=>[Y.connectionIndex,[Y.segments[0].start,...Y.segments.map((X)=>X.end)]])),B=new Set(g.map((Y)=>Y.connection.connectionIndex)),T=o.filter((Y)=>!B.has(Y.connectionIndex)).map((Y)=>({connectionName:Y.connectionName,via:Y.via})),N;for(let Y of[0,-1,1]){let X=yield*w1({...e,bus:{...t,exitEdge:"left",direction:"left",preferredExit:void 0,sharedBoundary:P},terminals:g.map((K,J)=>({...K,exitPoint:v.get(J)})),sourceEscapePaths:M,reservedVias:T,gridStep:d/4,gridStepDivisor:2,alignGridToPads:!0,maximumRouteOrderAttempts:1,routeOrder:I,laneBias:Y},1,!1);if(X.length){N=X[0];break}}if(!N)return null;let D=N.toSorted((Y,X)=>a?Y.exitPoint.y-X.exitPoint.y:g.find((K)=>K.connection.connectionIndex===Y.connectionIndex).exitPoint.y-g.find((K)=>K.connection.connectionIndex===X.connectionIndex).exitPoint.y),L=(Y,X,K)=>({center:Y,diameter:e.viaDiameter,holeDiameter:e.viaHoleDiameter,fromLayer:X,toLayer:K,spanLayers:G5({fromLayer:X,toLayer:K,layerNames:e.layerNames,allowBlindAndBuriedVias:!1})}),H=new Map;for(let[Y,X]of D.entries()){let K=X.segments.at(-1),J=K.end.x-K.start.x,ee=K.end.y-K.start.y;if(J>=0||Math.abs(ee)>-J+0.0000001)return null;let se=g.find((ie)=>ie.connection.connectionIndex===X.connectionIndex),ne=m+Y*_,re={x:ne,y:X.exitPoint.y},Z={x:ne,y:y.get(X.connectionIndex)},te=[{start:X.exitPoint,end:re,width:r,layer:s},{start:re,end:Z,width:r,layer:l}];H.set(X.connectionIndex,{...X,segments:[...X.segments,...te],additionalVias:[L(re,s,l),L(Z,l,s)],direction:t.direction,exitEdge:t.exitEdge,cornerBandSide:Xi(t.exitEdge,t.preferredExit),exitPoint:se.exitPoint})}let V=[...H.values()],O=g.map((Y)=>({...Y.connection,sourcePoint:{...H.get(Y.connection.connectionIndex).additionalVias[1].center,layer:s},sourceLayer:s})),U=yield*w1({...e,bus:{...t,connections:O},terminals:O.map((Y,X)=>({connection:Y,viaPoint:Y.sourcePoint,exitPoint:g[X].exitPoint})),acceptedPlans:[...e.acceptedPlans,...V],reservedVias:[...o.map((Y)=>({connectionName:Y.connectionName,via:Y.via})),...V.flatMap((Y)=>Y.additionalVias.map((X)=>({connectionName:Y.connectionName,via:X})))],allowSourceLayerRouting:!0,sourceEscapePaths:void 0,gridStep:d/2,gridStepDivisor:2,alignGridToPads:!0,maximumRouteOrderAttempts:12},1,!1);if(!U.length)return null;let j=N.map((Y)=>{let X=H.get(Y.connectionIndex),K=U[0].find((Z)=>Z.connectionIndex===Y.connectionIndex),[J,ee]=X.additionalVias,se=(Z,te)=>({route_type:"wire",...Z,width:r,layer:te}),ne=(Z)=>({route_type:"via",...Z.center,from_layer:Z.fromLayer,to_layer:Z.toLayer,via_diameter:Z.diameter,via_hole_diameter:Z.holeDiameter}),re=[...X.segments,...K.segments];return{...X,segments:re,trace:{...Y.trace,route:[...Y.trace.route,se(J.center,s),ne(J),se(J.center,l),se(ee.center,l),ne(ee),...K.trace.route]},length:re.reduce((Z,te)=>Z+Ut(te.start,te.end),0)}});if(!wp({...e,plans:[...e.acceptedPlans,...j],sharedBoundary:t.sharedBoundary}))return null;for(let Y of j)for(let X of o){if(Y.connectionIndex===X.connectionIndex)continue;for(let K of Y.segments){if(X.via.spanLayers.includes(K.layer)&&Vr(X.via.center,K.start,K.end)<X.via.diameter/2+r/2+i-0.0000001)return null;for(let J of X.segments)if(J.layer===K.layer&&ad(K.start,K.end,J.start,J.end)<r+i-0.0000001)return null}for(let K of Y.additionalVias){if(Ut(K.center,X.via.center)<e.viaDiameter+i-0.0000001)return null;for(let J of X.segments)if(K.spanLayers.includes(J.layer)&&Vr(K.center,J.start,J.end)<e.viaDiameter/2+r/2+i-0.0000001)return null}}return j}function*MCn(e){if(e.buses.some((p)=>p.termination.type==="boundary")&&e.buses.every((p)=>p.termination.type==="plane"||p.exitEdge==="left")){let p=Yve(e),m=yield*MCn(p);if(!m)return null;let A=Yve(m),g=new Map(e.buses.flatMap((f)=>f.connections.map((y)=>[y.connectionIndex,y])));return A.map((f)=>({...f,sourceObstacle:g.get(f.connectionIndex).sourceObstacle}))}let{buses:t,sourceEscapes:n,initialPlans:o}=e,r=new Map(n.map((p)=>[p.connectionIndex,p])),i=new Set(o.map((p)=>p.connectionIndex)),s=t.filter((p)=>p.connections.some((m)=>!i.has(m.connectionIndex)));if(s.some((p)=>p.connections.some((m)=>i.has(m.connectionIndex))))throw Error("FanoutSolver: a reserved-source continuation cannot start with a partially committed bus");for(let p of s)for(let m of p.connections)if(!r.has(m.connectionIndex))throw Error(`FanoutSolver: missing reserved source escape for ${m.connection.name}`);let a=new Map(n.map((p)=>[p.connectionIndex,p.via.center])),c=new Map(n.map((p)=>[p.connectionIndex,[p.segments[0].start,...p.segments.map((m)=>m.end)]])),l=[...o],h=(p)=>{let m=e.targetLayerByBusId?.get(p.busId)??(p.allowedLayers??e.layerNames).find((A)=>A!==p.connections[0].sourceLayer);return o.filter((A)=>A.targetLayer===m).length},d=s.filter((p)=>p.termination.type==="boundary").sort((p,m)=>m.connections.length-p.connections.length||h(p)-h(m)),u=new Set;for(let p of[...d,...s.filter((m)=>m.termination.type==="plane")]){if(u.has(p.busId))continue;if(p.termination.type==="boundary"&&p.connections.length<=2&&e.targetLayerByBusId){let x=e.targetLayerByBusId.get(p.busId);if(!x)return null;let C=d.filter((I)=>I.connections.length<=2&&e.targetLayerByBusId.get(I.busId)===x),b=yield*hUr({...e,buses:C,targetLayer:x,acceptedPlans:l,fixedViaPointsByConnectionIndex:a,sourceEscapePaths:c,reservedVias:n.map((I)=>({connectionName:I.connectionName,via:I.via}))});if(!b)return null;l.push(...b);for(let I of C)u.add(I.busId);continue}let m=new Set(p.connections.map((x)=>x.connectionIndex)),A=n.filter((x)=>!m.has(x.connectionIndex)).map((x)=>({connectionName:x.connectionName,via:x.via,...x.segments.length===1?{sourceEscapeSegment:x.segments[0]}:{}})),g=e.targetLayerByBusId?.get(p.busId),f=g?[g]:p.termination.type==="plane"?[p.termination.layer]:(p.routableEscapeLayers??p.allowedLayers??e.layerNames).filter((x)=>x!==p.connections[0].sourceLayer),y;for(let x of f){let C={...e,bus:p,targetLayer:x,acceptedPlans:l,fixedViaPointsByConnectionIndex:a,sourceEscapePaths:c,reservedVias:A};if(e.sourceBoundary&&p.termination.type==="boundary"&&p.connections.length>2){for(let I of[ECn,dUr,cUr,lUr]){let v=I({...C,sourceBoundary:e.sourceBoundary}),P=v.next();while(!P.done)yield{phase:"via-minimal-winding",busId:p.busId,targetLayer:x,winding:P.value},P=v.next();if(P.value){y=P.value;break}}if(y)break}let b=yield*z8e({...e,bus:p,targetLayer:x,acceptedPlans:l,fixedViaPointsByConnectionIndex:a,sourceEscapePaths:c,reservedVias:A,viaMinimalOnly:!0,adaptiveWindingRouteOrder:!0,alignWindingGridToPads:!0,windingGridStep:(e.traceWidth+e.clearance)/2,fixedViaFallbackRouteOrderAttempts:32},1,!1);if(b.length){y=b[0];break}}if(!y)return null;l.push(...y)}let _=t[0]?.sharedBoundary;if(!_||!wp({...e,plans:l,sharedBoundary:_}))return null;return l}function*uUr(e,t){let n={reserveFutureApproaches:!0,failedNarrowGroup:!1,failedWideMatching:!1},o=yield*t(n);if(o||!e||!n.failedNarrowGroup&&!n.failedWideMatching)return o;return yield*t({reserveFutureApproaches:!1,failedNarrowGroup:!1,failedWideMatching:!1})}function wCn(e){let{buses:t,fixedViaPointsByConnectionIndex:n,clearance:o}=e,r=t[0];if(!r?.exitEdge||t.some((c)=>c.componentId!==r.componentId||c.exitEdge!==r.exitEdge||c.termination.type!=="boundary"||c.connections.length>2||c.allowedLayers?.length!==1||c.allowedLayers[0]==="top"||c.connections.some((l)=>l.sourceLayer!=="top")))return!1;let i=r.exitEdge==="left"||r.exitEdge==="right"?"x":"y",s=r.exitEdge==="top"||r.exitEdge==="right"?1:-1,a=0;for(let c of t){if(c.connections.length!==2||c.maxLengthSkew===void 0||c.maxLengthSkew>=Math.min(c.pitchX,c.pitchY))continue;let l=c.componentBounds,h=i==="x"?s>0?l.minX:l.maxX:s>0?l.minY:l.maxY,d=c.connections.map((u)=>({source:u.sourcePoint,via:n.get(u.connectionIndex)}));if(d.some((u,_)=>{let p=d[1-_];if(!u.via||!p.via)return!1;return s*(u.via[i]-h)<-0.0000001&&p.via.x>=l.minX&&p.via.x<=l.maxX&&p.via.y>=l.minY&&p.via.y<=l.maxY&&s*(p.via[i]-p.source[i])>o}))a++}return a>=2}function pUr(e){return e.groups.filter((t)=>wCn({...e,buses:t}))}function BCn(e){return e.completedBuses.filter((t)=>e.selectedBusIds.has(t.busId)&&t.termination.type==="boundary"&&t.connections.length>2&&t.allowedLayers?.length===1&&t.maxLengthSkew!==void 0)}function TCn(e){return BCn(e).some((t)=>{let n=e.plans.filter((r)=>r.busId===t.busId),o=Math.min(...n.map((r)=>r.length))+t.maxLengthSkew;return n.some((r)=>r.segments.slice(0,r.sourceEscapeSegmentCount??1).reduce((i,s)=>i+Ut(s.start,s.end),0)>o+0.000001)})}function*mUr(e){let{inputSrj:t,preparedBuses:n,completedBuses:o,selectedBusIds:r}=e;if(!TCn(e))return null;let i=BCn(e),s=n.flatMap((m)=>m.connections),a=new Map(s.map((m)=>[m.connectionIndex,m])),c=(m)=>{if(a.size!==t.connections.length||m.length!==a.size||new Set(m.map((A)=>A.connectionIndex)).size!==a.size||m.some((A)=>{let g=a.get(A.connectionIndex);return g?.connection.name!==A.connectionName||g.sourceObstacle!==A.sourceObstacle}))throw Error("Wide source length repair requires every original source")};c(e.plans);let l=new Set(o.map((m)=>m.busId)),h=n.filter((m)=>m.termination.type==="boundary"&&!l.has(m.busId)),d=hZ({...e,preparedBuses:o,allowBlindAndBuriedVias:!1,allowSameNetMerges:!1,allowSourcePrefixShortcuts:!0});if(!d)return null;let u=d,_=()=>{let m=u,A=yx({...e,plans:u,preparedBuses:o,sharedBoundary:i[0].sharedBoundary,allowBlindAndBuriedVias:!1,allowSameNetMerges:!1,allowMatchingInsideDenseBounds:!0,allowSourcePrefixMatching:!0,allowTransitLayerMatching:!0,allowDistributedMatching:!0,allowPairLaneSpreading:!0,allowUnconstrainedLaneRerouting:!0,unroutedSourceBuses:h,maximumWorkUnits:1e5,candidatePlansAreFeasible:(g)=>(c(g),m=[...g],!0)});return u=A.plans??m,A},p=_();if(!p.plans){let m=p.failedBus;if(!i.some((b)=>b.busId===m.busId))return null;let A=u.filter((b)=>b.busId===m.busId),g=Math.max(...A.map((b)=>b.length)),f=A.filter((b)=>g-b.length>m.maxLengthSkew+0.000001);if(f.length!==1||u.some((b)=>!b.via))return null;let y=f[0],x=a.get(y.connectionIndex),C=yield*q3({...e,srj:t,allBuses:n,buses:[{...m,connections:[x]}],targetLayer:y.targetLayer,transitLayers:[],terminals:[{connection:x,viaPoint:y.via.center,exitPoint:y.exitPoint}],fixedViaPointsByConnectionIndex:new Map(u.map((b)=>[b.connectionIndex,b.via.center])),sourceEscapePaths:new Map(u.map((b)=>[b.connectionIndex,[b.sourcePoint,...b.segments.slice(0,b.sourceEscapeSegmentCount??1).map((I)=>I.end)]])),acceptedPlans:u.filter((b)=>b!==y),routeFromSourcePads:!0,sourceLayerTravelCost:3,includeDiagonalNeighbors:!0,tightViaChannels:!0,ripCost:64,shuffleSeed:1,maximumIterations:2000000,maximumLocalRepairAttempts:0});if(!C||C.length!==1)return null;u=u.map((b)=>b===y?C[0]:b),p=_()}if(!p.plans)return null;return c(p.plans),lu({inputSrj:t,routedSrj:{...t,traces:[...t.traces??[],...p.plans.flatMap((m)=>[m.trace,...m.planeEndpointTrace?[m.planeEndpointTrace]:[]])]},clearance:e.clearance,allowBlindAndBuriedVias:!1}).valid?p.plans:null}function _Ur(e){let{buses:t,targetLayer:n,exits:o,layerNames:r,viaDiameter:i,clearance:s}=e,a=t[0];if(!a?.exitEdge||t.length<2||t.some((g)=>g.termination.type!=="boundary"||g.connections.length<=2||g.componentId!==a.componentId||g.exitEdge!==a.exitEdge||g.connections.some((f)=>f.sourceLayer!=="top")))return!1;let c=(g)=>g.routableEscapeLayers??g.allowedLayers??r;if(n==="top"||t.some((g)=>!c(g).includes(n))||!r.some((g)=>g!=="top"&&g!==n&&t.every((f)=>c(f).includes(g))))return!1;let l=t.flatMap((g)=>g.connections),h=a.exitEdge==="left"||a.exitEdge==="right"?"y":"x",d=l.map((g)=>o.get(g.connectionIndex)?.[h]);if(d.some((g)=>g===void 0||!Number.isFinite(g)))return!1;if(Math.max(...d)-Math.min(...d)>=(l.length-1)*(i+s)-0.00000001)return!1;let _=l.reduce((g,f)=>({x:g.x+f.sourcePoint.x/l.length,y:g.y+f.sourcePoint.y/l.length}),{x:0,y:0}),p=a.componentBounds,m=Math.min(Math.abs(_.x-p.minX),Math.abs(_.x-p.maxX)),A=Math.min(Math.abs(_.y-p.minY),Math.abs(_.y-p.maxY));return h==="x"?m+0.00000001<A:A+0.00000001<m}function gUr(e){let t=e.length*(e.length-1)/2;if(t===0)return!1;let n=0;for(let o=0;o<e.length;o++){let r=e[o];for(let i of e.slice(o+1))if(ad(r.source,r.target,i.source,i.target)<0.0000001&&++n>t/2)return!0}return!1}var AUr=class{constructor(e){if(this.options=e,this.pending=[e.preferSourceTransit?{ripCost:e.sourceTransitRipCost??8,shuffleSeed:1,transitLayers:e.allTransitLayers}:{ripCost:e.firstRipCost,shuffleSeed:1,transitLayers:e.transitLayers}],e.preferAlternateOrder)this.originalOrder=this.pending[0],this.preferredOrder={...this.originalOrder,shuffleSeed:2},this.pending[0]=this.preferredOrder;if(e.preferSourceOrigin)this.pending.unshift({ripCost:e.sourceOriginRipCost??256,shuffleSeed:1,transitLayers:[],routeFromSourcePads:!0})}options;pending;attempted=new Set;preferredOrder;originalOrder;next(){while(this.pending.length>0){let e=this.pending.shift(),t=JSON.stringify(e);if(this.attempted.has(t))continue;return this.attempted.add(t),e}return}failed(e,t){if(e.routeFromSourcePads)return;let n=(o)=>{if(!this.attempted.has(JSON.stringify(o)))this.pending.unshift(o)};if(e===this.preferredOrder){if(n(this.originalOrder),t==="lengths")this.pending.push({...this.originalOrder,ripCost:256});return}if(e.sourceLayerTravelCost!==void 0){let{reserveFutureApproaches:o,sourceLayerTravelCost:r,maximumSourceIterations:i,...s}=e;if(o===!1&&t==="routing")n({...s,sourceLayerTravelCost:4,reserveFutureApproaches:!0});else this.failed(s,"lengths");return}if(e.sourceOriginPhysicalGridPhase){let{sourceOriginPhysicalGridPhase:o,...r}=e;n({...r,ripCost:256,shuffleSeed:1});return}if(this.options.preferSourceTransit&&e.ripCost===(this.options.sourceTransitRipCost??8)&&e.transitLayers.length===this.options.allTransitLayers.length)n({ripCost:this.options.firstRipCost,shuffleSeed:1,transitLayers:this.options.transitLayers});else if(this.options.wideSingleLayer){if(t==="lengths"&&e.ripCost===64){let o={...e,shuffleSeed:1,sourceLayerTravelCost:3,maximumSourceIterations:20000000,reserveFutureApproaches:!1},r={...e,shuffleSeed:1,sourceOriginPhysicalGridPhase:!0};if(this.options.retrySourceOriginFreshReservations&&!this.attempted.has(JSON.stringify(o)))n(o);else if(this.options.retrySourceOriginPhysicalGridPhase&&!this.attempted.has(JSON.stringify(r)))n(r);else n({...e,ripCost:256,shuffleSeed:1})}if(t==="routing"&&e.shuffleSeed===1)n({...e,ripCost:64,shuffleSeed:2})}else if(e.transitLayers.length<this.options.allTransitLayers.length){let o={ripCost:t==="lengths"?8:this.options.firstRipCost,shuffleSeed:1,transitLayers:this.options.allTransitLayers};if(t==="routing"&&o.ripCost!==256&&this.attempted.has(JSON.stringify(o)))n({...o,ripCost:256});else n(o)}else if(t==="routing"&&e.ripCost!==256)n({...e,ripCost:256})}};function fUr(e){let t=e.traceWidth+e.clearance;if(!Number.isFinite(t)||!(e.traceWidth>0)||e.clearance<0)throw Error("Boundary approach reservations require valid trace rules");return e.buses.filter((n)=>n.termination.type==="boundary"&&!e.excludedBusIds.has(n.busId)).flatMap((n)=>{let o=e.targetLayerByBusId.get(n.busId);if(!o||!n.exitEdge)throw Error(`Missing boundary approach layer or edge for ${n.busId}`);return n.connections.map((r)=>{let i=e.exits.get(r.connectionIndex);if(!i)throw Error(`Missing boundary approach target for ${r.connectionIndex}`);let s={...i};if(n.exitEdge==="bottom")s.y+=t;else if(n.exitEdge==="top")s.y-=t;else if(n.exitEdge==="left")s.x+=t;else s.x-=t;return{type:"pcb_trace",pcb_trace_id:`fanout-approach-reservation:${r.connectionIndex}`,connection_name:r.connection.name,route:[s,i].map((a)=>({route_type:"wire",...a,layer:o,width:e.traceWidth}))}})})}function yUr(e){let t={minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0};for(let n of e){let o=n,r=(o.ccwRotationDegrees??0)*Math.PI/180,i=n.width/2,s=n.height/2,a=o.shape==="circle"?i:Math.abs(Math.cos(r))*i+Math.abs(Math.sin(r))*s,c=o.shape==="circle"?s:Math.abs(Math.sin(r))*i+Math.abs(Math.cos(r))*s;t.minX=Math.min(t.minX,n.center.x-a),t.maxX=Math.max(t.maxX,n.center.x+a),t.minY=Math.min(t.minY,n.center.y-c),t.maxY=Math.max(t.maxY,n.center.y+c)}return t}function xUr(e,t){let n=e.filter((u)=>u.termination.type==="boundary"),o=n[0]?.exitEdge;if(!o||n.some((u)=>u.exitEdge!==o))return[...e];let r=n.flatMap((u)=>u.connections),i={x:(t.minX+t.maxX)/2,y:(t.minY+t.maxY)/2},s=r.reduce((u,_)=>u+_.sourcePoint.x-i.x,0),a=r.reduce((u,_)=>u+_.sourcePoint.y-i.y,0);if(Math.hypot(s,a)<0.000000001)return[...e];let c=["right","up","left","down"],l=Math.abs(s)>=Math.abs(a)?s>=0?"right":"left":a>=0?"up":"down",h=o==="top"?"up":o==="bottom"?"down":o,d=c.indexOf(l)-c.indexOf(h);return e.map((u)=>u.termination.type==="plane"?u:{...u,direction:c[(c.indexOf(u.direction)+d+4)%4]})}function CUr(e){return e.flatMap((t)=>{let n=[t.connectionName],o=[t.sourceLayer],r=[];if(t.via)r.push({type:"rect",shape:"circle",center:t.via.center,width:t.via.diameter,height:t.via.diameter,connectedTo:n,layers:o});for(let i of t.segments){let{start:s,end:a,width:c}=i,l=a.x-s.x,h=a.y-s.y;r.push({type:"rect",center:{x:(s.x+a.x)/2,y:(s.y+a.y)/2},width:Math.hypot(l,h),height:c,ccwRotationDegrees:Math.atan2(h,l)*180/Math.PI,connectedTo:n,layers:o})}for(let i of[t.sourcePoint,...t.segments.map((s)=>s.end)])r.push({type:"rect",shape:"circle",center:i,width:t.segments[0]?.width??0,height:t.segments[0]?.width??0,connectedTo:n,layers:o});return r})}function*bUr(e){let{srj:t,buses:n,layerNames:o,traceWidth:r,clearance:i,viaDiameter:s,viaHoleDiameter:a}=e,c=n[0];if(!c||n.some((N)=>N.componentId!==c.componentId||N.connections.some((D)=>D.sourceLayer!=="top")))return null;let l=c.componentObstacles.filter((N)=>N.layers.includes("top"));if(!l.length)return null;let h=yUr(l),d=Math.max(c.pitchX,c.pitchY),u=r+i;if(!Number.isFinite(d)||d<=0)return null;let _={x:(h.minX+h.maxX)/2,y:(h.minY+h.maxY)/2},p=Math.ceil(((h.maxX-h.minX)/2+d+u)/u)*u,m=Math.ceil(((h.maxY-h.minY)/2+d+u)/u)*u,A={minX:_.x-p,maxX:_.x+p,minY:_.y-m,maxY:_.y+m};if(n.some((N)=>A.minX<=N.sharedBoundary.minX||A.maxX>=N.sharedBoundary.maxX||A.minY<=N.sharedBoundary.minY||A.maxY>=N.sharedBoundary.maxY))return null;let g=new Map;for(let N of n){if(N.termination.type!=="boundary"||N.allowedLayers?.length!==1||N.allowedLayers[0]==="top")continue;let D=N.allowedLayers[0];g.set(D,[...g.get(D)??[],N])}let f=[...g].sort(([N,D],[L,H])=>Math.max(...H.map((V)=>V.connections.length))-Math.max(...D.map((V)=>V.connections.length))||N.localeCompare(L));if(!f.length)return null;let y=new Map(n.flatMap((N)=>N.connections.map((D)=>[D.connectionIndex,{bus:N,connection:D}])));if(y.size!==n.reduce((N,D)=>N+D.connections.length,0))throw Error("FanoutSolver: source preparation requires unique connection indices");let x=xUr(n,h),C={traceWidth:r,clearance:i,viaDiameter:s,viaHoleDiameter:a,maximumSearchStates:e.maximumSearchStates??1e4,additionalObstacles:t.obstacles},b=e.initialViaPointsByConnectionIndex;if(b&&(b.size!==y.size||[...b].some(([N,D])=>!y.has(N)||!Number.isFinite(D.x)||!Number.isFinite(D.y))))throw Error("FanoutSolver: initial source sites must contain every connection exactly once");let I=I0(x,{...C,fixedViaPointsByConnectionIndex:b});if(!I)return null;let v=(N,D,L)=>{let{bus:H,connection:V}=y.get(N),O=H.termination.type==="plane"?H.termination.layer:(H.allowedLayers??o).filter((U)=>U!==V.sourceLayer).at(-1);if(!O)throw Error("FanoutSolver: source through-via preparation requires a non-source target layer");return B6({...e,allowBlindAndBuriedVias:!1,bus:H,terminal:{connection:V,viaPoint:D,exitPoint:D},targetLayer:O,targetLayerPoints:[D],sourceEscapePoints:L})},P=(N,D)=>[...y.keys()].map((L)=>v(L,N.get(L),D.get(L))),M=(N)=>lu({inputSrj:t,routedSrj:{...t,traces:[...t.traces??[],...N.map((D)=>D.trace)]},clearance:i,allowBlindAndBuriedVias:!1}).valid,B={sourceBoundary:A,fixedViaPointsByConnectionIndex:I,sourceEscapePaths:new Map([...I].map(([N,D])=>[N,[y.get(N).connection.sourcePoint,D]])),sourcePlans:[],prefixPlans:[],remotePlans:[],layerGroups:[]};if(B.sourcePlans=P(I,B.sourceEscapePaths),!M(B.sourcePlans))return null;let T=Math.max(d,s/2+r/2+i);for(let[N,D]of f){let L=new Set(D.flatMap((J)=>J.connections.map((ee)=>ee.connectionIndex))),H=new Set(B.remotePlans.map((J)=>J.connectionIndex)),V=new Map([...B.fixedViaPointsByConnectionIndex].filter(([J])=>!L.has(J)&&!H.has(J))),O={...t,obstacles:[...t.obstacles,...CUr(B.sourcePlans.filter((J)=>!L.has(J.connectionIndex)))]},U=D.flatMap((J)=>J.connections.map((ee)=>({...J,busId:`${J.busId}:source-${ee.connectionIndex}`,sharedBoundary:A,preferredExit:void 0,exitEdge:void 0,connections:[{...ee,exitTargetPoint:void 0,hasExplicitLayeredExitTarget:!1}]}))),j=null,Y=0,X=(J)=>{if(J.length<=Y)return;let ee=J.map((de)=>({...de,busId:y.get(de.connectionIndex).bus.busId,sourceObstacle:y.get(de.connectionIndex).connection.sourceObstacle,sourceEscapeSegmentCount:de.segments.length}));if(!wp({plans:ee,srj:O,sharedBoundary:A,clearance:i,allowBlindAndBuriedVias:!1,allowSameNetMerges:!1}))return;let se=[],ne=new Map;for(let de of ee){let me=de.exitPoint,Ae=Math.abs(me.x-A.maxX)<0.0000001?{x:T,y:0}:Math.abs(me.x-A.minX)<0.0000001?{x:-T,y:0}:Math.abs(me.y-A.maxY)<0.0000001?{x:0,y:T}:Math.abs(me.y-A.minY)<0.0000001?{x:0,y:-T}:null;if(!Ae)throw Error("FanoutSolver: source prefix does not end on its source boundary");let xe={x:me.x+Ae.x,y:me.y+Ae.y},Me=y.get(de.connectionIndex).bus.sharedBoundary;if(xe.x<Me.minX||xe.x>Me.maxX||xe.y<Me.minY||xe.y>Me.maxY)return;let Re=[de.sourcePoint,...de.segments.map((we)=>we.end),xe];ne.set(de.connectionIndex,Re),se.push(v(de.connectionIndex,xe,Re))}let re=[...B.remotePlans,...se];if(!M(re))return;let Z=new Set(re.map((de)=>de.connectionIndex)),te=x.map((de)=>({...de,connections:de.connections.filter((me)=>!Z.has(me.connectionIndex))})).filter((de)=>de.connections.length),ie=I0(te,{...C,fixedViaPointsByConnectionIndex:V,preferredViaPointsByConnectionIndex:B.fixedViaPointsByConnectionIndex,blockingSegments:re.flatMap((de)=>de.segments.map((me)=>({connectionIndex:de.connectionIndex,segment:me}))),blockingVias:re.map((de)=>({connectionIndex:de.connectionIndex,center:de.via.center,diameter:de.via.diameter,spanLayers:de.via.spanLayers}))});if(!ie)return;let le=new Map([...ie,...re.map((de)=>[de.connectionIndex,de.via.center])]);if(le.size!==y.size)throw Error("FanoutSolver: source preparation lost a connection");for(let de of H)ne.set(de,B.sourceEscapePaths.get(de));for(let[de,me]of ie)ne.set(de,[y.get(de).connection.sourcePoint,me]);let ue=P(le,ne);if(!M(ue))return;Y=J.length,j={sourceBoundary:A,fixedViaPointsByConnectionIndex:le,sourceEscapePaths:ne,sourcePlans:ue,prefixPlans:[...B.prefixPlans,...ee],remotePlans:re,layerGroups:[...B.layerGroups,{layer:N,connectionCount:L.size,escapedCount:J.length}]}},K=yield*_G({srj:O,buses:U,traceWidth:r,clearance:i,onPartialRoutes:X});if(K)X(K);if(j)B=j;else B.layerGroups.push({layer:N,connectionCount:L.size,escapedCount:0})}return B.remotePlans.length?B:null}function IUr(e,t){return e.some((n)=>{if(!Y8e([n]))return!1;let o=n.exitEdge==="left"||n.exitEdge==="right"?"x":"y",r=o==="x"?"y":"x",i=n.exitEdge==="left"||n.exitEdge==="bottom"?-1:1,s=o==="x"?(n.componentBounds.minX+n.componentBounds.maxX)/2:(n.componentBounds.minY+n.componentBounds.maxY)/2,a=n.connections.map((c)=>t.get(c.connectionIndex)?.[r]);if(a.some((c)=>c===void 0||!Number.isFinite(c)))return!1;return e.some((c)=>{if(c.termination.type!=="boundary"||c.connections.length!==2||c.componentId!==n.componentId||c.exitEdge!==n.exitEdge||c.allowedLayers?.length!==1||c.allowedLayers[0]===n.allowedLayers[0]||!c.connections.every((d)=>i*(d.sourcePoint[o]-s)<-0.0000001))return!1;let l=c.connections.map((d)=>t.get(d.connectionIndex)?.[r]);if(l.some((d)=>d===void 0||!Number.isFinite(d)))return!1;let h=c.connections.flatMap((d)=>{let u=d.sourceObstacle?.center[r]??d.sourcePoint[r],_=((r==="x"?d.sourceObstacle?.width:d.sourceObstacle?.height)??0)/2;return[u-_,u+_]});return Math.max(Math.min(...a),Math.min(...l),Math.min(...h))<=Math.min(Math.max(...a),Math.max(...l),Math.max(...h))})})}function vUr(e,t){return e.some((n)=>{if(!Y8e([n]))return!1;let o=n.exitEdge==="left"||n.exitEdge==="right"?"y":"x",r=n.connections.map((a)=>t.get(a.connectionIndex)?.[o]);if(r.some((a)=>a===void 0||!Number.isFinite(a)))return!1;let i=o==="x"?n.componentBounds.minX:n.componentBounds.minY,s=o==="x"?n.componentBounds.maxX:n.componentBounds.maxY;return Math.min(...r)<=s+0.0000001&&Math.max(...r)>=i-0.0000001})}var cP=0.000001,sde=(e)=>Math.max(...e.map((t)=>t.length))-Math.min(...e.map((t)=>t.length));function SUr(e,t){let n=e.trace.route.findIndex((i)=>i.route_type==="via"),o=t.trace.route.findIndex((i)=>i.route_type==="via");if(n<0||o<0)return null;let r=[...e.trace.route.slice(0,n+1),...t.trace.route.slice(o+1)];return r[r.length-1]=e.trace.route.at(-1),{...e,trace:{...e.trace,route:r},segments:[...e.segments.slice(0,e.sourceEscapeSegmentCount??1),...t.segments.slice(t.sourceEscapeSegmentCount??1)],length:t.length}}function*PUr(e){let{inputSrj:t,preparedBuses:n,layerNames:o,traceWidth:r,clearance:i,viaDiameter:s,viaHoleDiameter:a,maximumPasses:c=3,maximumConnectionAttempts:l=24,maximumSearchStates:h=1200000}=e;for(let[v,P]of[["maximumPasses",c],["maximumConnectionAttempts",l],["maximumSearchStates",h]])if(!Number.isSafeInteger(P)||P<1)throw Error(`FanoutSolver: ${v} must be a positive safe integer`);let d=new Map(e.plans.map((v)=>[v.connectionIndex,v])),u=n.flatMap((v)=>v.connections);if(d.size!==e.plans.length||d.size!==t.connections.length||u.length!==d.size||u.some((v)=>d.get(v.connectionIndex)?.connectionName!==v.connection.name))throw Error("FanoutSolver: overlong-lane rerouting requires every original plan");let _=n.filter((v)=>v.termination.type==="boundary"&&(!e.selectedBusIds||e.selectedBusIds.has(v.busId))),p=_.filter((v)=>v.maxLengthSkew!==void 0&&v.connections.length>1),m=[...e.plans],A=new Map;for(let v of m){if(!v.via)continue;let P=v.segments.slice(0,v.sourceEscapeSegmentCount??1);if(!P.length||P.some((M)=>M.layer!==v.sourceLayer)||Ut(P[0].start,v.sourcePoint)>cP||Ut(P.at(-1).end,v.via.center)>cP||P.some((M,B)=>B>0&&Ut(P[B-1].end,M.start)>cP))continue;A.set(v.connectionIndex,[P[0].start,...P.map((M)=>M.end)])}let g=new Map,f=(r+i)/2,y=0,x=!1,C=(v,P)=>{let M=v.via;return Boolean(M&&!(v.additionalVias?.length??0)&&!v.planeEndpointTrace&&!v.planeEndpointVia&&A.has(v.connectionIndex)&&M.fromLayer===v.sourceLayer&&M.toLayer===v.targetLayer&&M.diameter===s&&M.holeDiameter===a&&M.spanLayers.length===o.length&&o.every((B)=>M.spanLayers.includes(B))&&(P.routableEscapeLayers??P.allowedLayers??o).includes(v.targetLayer)&&v.segments.slice(v.sourceEscapeSegmentCount??1).every((B)=>B.layer===v.targetLayer))};function*b(v,P,M,B,T){if(y>=l||!C(v,M))return null;y++;let N=w1({srj:t,bus:M,targetLayer:v.targetLayer,terminals:[{connection:M.connections.find((H)=>H.connectionIndex===v.connectionIndex),viaPoint:v.via.center,exitPoint:v.exitPoint}],acceptedPlans:P.filter((H)=>H.connectionIndex!==v.connectionIndex),layerNames:o,traceWidth:r,clearance:i,viaDiameter:s,viaHoleDiameter:a,allowBlindAndBuriedVias:!1,sourceEscapePaths:A,gridStepDivisor:2,gridStep:f,gridOrigin:B,alignGridToPads:!0,heuristicWeight:1,maximumRouteOrderAttempts:1,maximumSearchStates:h,preferTargetDirectedLaneBias:!0},1,!1),D=N.next();while(!D.done)yield{...D.value,busId:M.busId,pass:T,connectionAttempt:y},D=N.next();let L=D.value[0]?.[0];return L?SUr(v,L):null}for(let v of p){let P=m.filter((T)=>T.busId===v.busId),M=sde(P);if(M<=v.maxLengthSkew+cP)continue;let B=[...m];for(let T=0;T<c;T++){let N=Math.min(...P.map((H)=>H.length)),D=!1,L=P.filter((H)=>H.length>N+v.maxLengthSkew+cP).toSorted((H,V)=>V.length-H.length||H.connectionIndex-V.connectionIndex);for(let H of L){if(y>=l)break;let V=H.targetLayer;if(!C(H,v))continue;let O=g.get(V);if(!O)O=Xrt({vias:m.flatMap((X)=>[X.via,...X.additionalVias??[],X.planeEndpointVia].filter((K)=>K?.spanLayers.includes(V)).map((K)=>({connectionIndex:X.connectionIndex,center:K.center,diameter:K.diameter}))),activeConnectionIndices:new Set(_.flatMap((X)=>X.connections.filter((K)=>d.get(K.connectionIndex)?.targetLayer===V).map((K)=>K.connectionIndex))),traceWidth:r,clearance:i,gridStep:f}),g.set(V,O);let U=yield*b(H,m,v,O,T);if(!U||U.length>=H.length-cP)continue;let j=m.filter((X)=>X.busId===v.busId),Y=j.map((X)=>X.connectionIndex===H.connectionIndex?U:X);if(sde(Y)>sde(j)+cP){if(j.length!==2)continue;let X=j.find((ee)=>ee!==H);if(X.targetLayer!==V)continue;let K=m.map((ee)=>ee===H?U:ee),J=yield*b(X,K,v,O,T);if(!J||J.length>=X.length-cP||sde([U,J])>v.maxLengthSkew+cP)continue;m=K.map((ee)=>ee===X?J:ee)}else m=m.map((X)=>X===H?U:X);D=!0}if(P=m.filter((H)=>H.busId===v.busId),!D||y>=l)break}if(sde(P)<M-cP)x=!0;else m=B;if(y>=l)break}if(!x)return m;return lu({inputSrj:t,routedSrj:{...t,traces:[...t.traces??[],...m.flatMap((v)=>[v.trace,...v.planeEndpointTrace?[v.planeEndpointTrace]:[]])]},clearance:i,allowBlindAndBuriedVias:!1}).valid?m:null}var wk=0.000001,i9e=(e)=>Math.max(...e.map((t)=>t.length))-Math.min(...e.map((t)=>t.length));function*EUr(e){let{inputSrj:t,preparedBuses:n,layerNames:o,traceWidth:r,clearance:i,viaDiameter:s,viaHoleDiameter:a,maximumConnectionAttempts:c=8,maximumIterationsPerConnection:l=30000000}=e;for(let[y,x]of[["maximumConnectionAttempts",c],["maximumIterationsPerConnection",l]])if(!Number.isSafeInteger(x)||x<1)throw Error(`FanoutSolver: ${y} must be a positive safe integer`);let h=new Map(e.plans.map((y)=>[y.connectionIndex,y])),d=n.flatMap((y)=>y.connections);if(d.length!==t.connections.length||h.size!==e.plans.length||h.size!==d.length||d.some((y)=>h.get(y.connectionIndex)?.connectionName!==y.connection.name))throw Error("FanoutSolver: transit length repair requires every original plan");let u=n.filter((y)=>y.termination.type==="boundary"&&y.maxLengthSkew!==void 0&&y.connections.length>1&&(!e.busIds||e.busIds.includes(y.busId))),_=[...e.plans],p=u.filter((y)=>i9e(_.filter((x)=>x.busId===y.busId))>y.maxLengthSkew+wk);if(!p.length)return _;let m=new Map,A=new Map;for(let y of d){let x=h.get(y.connectionIndex);if(!x.via)return null;let C=x.segments.slice(0,x.sourceEscapeSegmentCount??1);if(!C.length||C.some((b)=>b.layer!==y.sourceLayer)||Ut(C[0].start,y.sourcePoint)>wk||Ut(C.at(-1).end,x.via.center)>wk||C.some((b,I)=>I>0&&Ut(C[I-1].end,b.start)>wk))return null;m.set(y.connectionIndex,x.via.center),A.set(y.connectionIndex,[C[0].start,...C.map((b)=>b.end)])}let g=0;for(let y of p){let x=_.filter((P)=>P.busId===y.busId);if(x.length!==y.connections.length)return null;let C=x[0].targetLayer,b=y.routableEscapeLayers??y.allowedLayers??o,I=b.filter((P)=>P!==C);if(!b.includes(C)||!I.length||x.some((P)=>P.targetLayer!==C))return null;let v=new Set;while(i9e(x)>y.maxLengthSkew+wk){let P=Math.min(...x.map((Y)=>Y.length)),M=x.filter((Y)=>!v.has(Y.connectionIndex)&&Y.length>P+y.maxLengthSkew+wk).toSorted((Y,X)=>X.length-Y.length||Y.connectionIndex-X.connectionIndex)[0];if(!M||g>=c)return null;v.add(M.connectionIndex);let B=M.via;if(M.planeEndpointTrace!==void 0||M.planeEndpointSegments!==void 0||M.planeEndpointVia!==void 0||B.fromLayer!==M.sourceLayer||B.toLayer!==C||B.diameter!==s||B.holeDiameter!==a||B.spanLayers.length!==o.length||!o.every((Y)=>B.spanLayers.includes(Y)))continue;let T=y.connections.find((Y)=>Y.connectionIndex===M.connectionIndex);g++;let N=q3({srj:t,allBuses:n,buses:[{...y,connections:[T]}],targetLayer:C,transitLayers:I,terminals:[{connection:T,viaPoint:B.center,exitPoint:M.exitPoint}],fixedViaPointsByConnectionIndex:m,sourceEscapePaths:A,acceptedPlans:_.filter((Y)=>Y!==M),layerNames:o,traceWidth:r,clearance:i,viaDiameter:s,viaHoleDiameter:a,tightViaChannels:!0,ripCost:64,shuffleSeed:1,maximumRipEvents:1,maximumIterations:l}),D=N.next();while(!D.done)yield{...D.value,busId:y.busId,connectionName:M.connectionName,connectionAttempt:g},D=N.next();let L=D.value?.[0];if(!L||L.length>=M.length-wk)continue;let H=M.sourceEscapeSegmentCount??1,V=M.trace.route.findIndex((Y)=>Y.route_type==="via"),O=L.trace.route.findIndex((Y)=>Y.route_type==="via");if(V<0||O<0)return null;let U={...M,via:B,additionalVias:L.additionalVias,segments:[...M.segments.slice(0,H),...L.segments.slice(L.sourceEscapeSegmentCount??1)],trace:{...M.trace,route:[...M.trace.route.slice(0,V+1),...L.trace.route.slice(O+1)]},length:L.length},j=x.map((Y)=>Y===M?U:Y);if(i9e(j)>i9e(x)+wk)continue;_=_.map((Y)=>Y===M?U:Y),x=j}}return lu({inputSrj:t,routedSrj:{...t,traces:[...t.traces??[],..._.flatMap((y)=>[y.trace,...y.planeEndpointTrace?[y.planeEndpointTrace]:[]])]},clearance:i,allowBlindAndBuriedVias:!1}).valid?_:null}function DCn(e){let{buses:t,layerNames:n,traceWidth:o,clearance:r}=e,i=t.filter((p)=>p.termination.type==="boundary"),s=new Map;for(let p of i)if(p.allowedLayers?.length===1){let m=p.allowedLayers[0];s.set(m,(s.get(m)??0)+p.connections.length)}let a=new Map;for(let p of t){let m=new Set(p.connections.map((f)=>f.sourceLayer)),A=(p.routableEscapeLayers??p.allowedLayers??n).filter((f)=>!m.has(f)).toSorted((f,y)=>(s.get(f)??0)-(s.get(y)??0)||n.indexOf(y)-n.indexOf(f)),g=p.termination.type==="plane"?p.termination.layer:A[0];if(!g)return null;a.set(p.busId,g)}let c=Krt({...e,targetLayerByBusId:a}),l=new Map(c.tracksByConnectionIndex),h=gCn(t),d=(p)=>p.exitEdge==="left"||p.exitEdge==="right"?"y":"x",u=o+r;for(let p of i){if(p.allowedLayers?.length!==1)continue;let m=d(p),A=p.sharedBoundary,g=m==="y"?A.minY:A.minX,f=m==="y"?A.maxY:A.maxX,y=p.connections.map((P)=>(P.exitTargetPoint??P.targetPoint)[m]),x=y.toSorted((P,M)=>P-M);if(x.some((P,M)=>!Number.isFinite(P)||M>0&&P-x[M-1]<u-0.00000001))continue;let C=x.at(-1)-x[0];if(C>f-g)continue;let b;if(!h.has(p.busId)){let P=Math.max(g-x[0],Math.min(0,f-x.at(-1)));b=y.map((M)=>M+P)}else if(p.connections.length===2){let P=p.connections.map((T)=>l.get(T.connectionIndex)),M=(P[0]+P[1])/2,B=Math.abs(P[1]-P[0]);b=P.map((T)=>M+(T-M)*C/B)}else continue;let I=new Set(p.connections.map((P)=>P.connectionIndex)),v=i.filter((P)=>P.exitEdge===p.exitEdge&&a.get(P.busId)===a.get(p.busId)).flatMap((P)=>P.connections.filter((M)=>!I.has(M.connectionIndex)).map((M)=>l.get(M.connectionIndex)));if(b.some((P)=>P<g||P>f||v.some((M)=>Math.abs(P-M)<u-0.00000001)))continue;for(let[P,M]of p.connections.entries())l.set(M.connectionIndex,b[P])}let _=new Map;for(let p of i)for(let m of p.connections){let A=l.get(m.connectionIndex),g=p.sharedBoundary,f=p.exitEdge==="left"?{x:g.minX,y:A}:p.exitEdge==="right"?{x:g.maxX,y:A}:p.exitEdge==="top"?{x:A,y:g.maxY}:{x:A,y:g.minY};_.set(m.connectionIndex,f)}return{targetLayerByBusId:a,exits:_}}function*MUr(e){let t=new Set,n,o=()=>iot(e,{reserveFutureApproaches:!1,failedNarrowGroup:!1,failedWideMatching:!1},t,{travelCost:3,maximumIterations:20000000}),r=!1;if(e.sourceOriginRouting&&rat(e.buses)){let s=DCn(e),a={requested:!!s&&vUr(e.buses,s.exits),reached:!1},c=iot({...e,sourceOriginRouting:!1},{reserveFutureApproaches:!0,failedNarrowGroup:!1,failedWideMatching:!1},t,void 0,a),l=c.next();while(!l.done&&!a.reached)yield l.value,l=c.next();if(l.done){if(l.value)return l.value}else n=c;if(Y8e(e.buses)){if(r=!!s&&IUr(e.buses,s.exits),!r){let h=yield*o();if(h)return h}}}let i=yield*uUr(e.sourceOriginRouting??!1,(s)=>iot(e,s,t));if(!i&&r)i=yield*o();if(i)return i;return n?yield*n:null}function*iot(e,t,n,o,r){let{buses:i,srj:s,layerNames:a}=e,c=DCn(e);if(!c)return null;let l=e.sourceOriginRouting?function*(){return ZYr(e)}():bUr(e),h=l.next();while(!h.done)yield{phase:"sources",routedConnectionCount:0},h=l.next();if(!h.value)return null;let{fixedViaPointsByConnectionIndex:d,sourceEscapePaths:u,sourcePlans:_}=h.value,p=[],m=new Set(i.filter((b)=>b.termination.type==="plane").map((b)=>b.busId)),A=new Map;for(let b of i)if(b.termination.type==="boundary"){let I=c.targetLayerByBusId.get(b.busId);A.set(I,[...A.get(I)??[],b])}let g=[...A].sort(([,b],[,I])=>Math.max(...b.map((v)=>v.allowedLayers?.length??a.length))-Math.max(...I.map((v)=>v.allowedLayers?.length??a.length))||Math.max(...I.map((v)=>v.connections.length))-Math.max(...b.map((v)=>v.connections.length))),f=pUr({groups:g.map(([,b])=>b),fixedViaPointsByConnectionIndex:d,clearance:e.clearance}),y=e.sourceOriginRouting&&rat(i),x=y&&!o&&Y8e(i),C=!1;for(let[b,I]of g){if(x&&b===g.at(-1)[0]){let J=sat({buses:I,exits:c.exits});for(let[ee,se]of J)c.exits.set(ee,se)}let v=Math.max(...I.map((J)=>J.connections.length)),P=v>2&&I.every((J)=>J.allowedLayers?.length===1),M=a.filter((J)=>J!==b&&I.every((ee)=>(ee.routableEscapeLayers??ee.allowedLayers??a).includes(J)&&ee.connections.every((se)=>se.sourceLayer!==J))),B=a.filter((J)=>J!==b&&I.every((ee)=>(ee.routableEscapeLayers??ee.allowedLayers??a).includes(J))),T=wCn({buses:I,fixedViaPointsByConnectionIndex:d,clearance:e.clearance}),N=C&&v>2&&M.length===0&&B.length>0,D=C&&v>2&&M.length>0,L=x&&v>2&&M.length===0&&B.length>0,H=p,V=e.sourceOriginRouting&&b===g[0][0]&&P,O=new AUr({wideSingleLayer:P,retrySourceOriginPhysicalGridPhase:V&&!o,retrySourceOriginFreshReservations:V&&!o&&t.reserveFutureApproaches,preferAlternateOrder:!e.sourceOriginRouting&&P&&b===g[0][0]&&f.some((J)=>I.every((ee)=>J.every((se)=>se.componentId===ee.componentId&&se.exitEdge===ee.exitEdge)))||y&&!P&&v>2&&M.length>0&&b===g.at(-1)[0],firstRipCost:v<=2?256:64,transitLayers:M,allTransitLayers:B,sourceOriginRipCost:D?64:256,sourceTransitRipCost:N?64:8,preferSourceOrigin:T||y&&v<=2&&H.length>0||D||_Ur({...e,buses:I,targetLayer:b,exits:c.exits}),preferSourceTransit:!L&&(N||v>2&&M.length===0&&B.length>0&&gUr(I.flatMap((J)=>J.connections.map((ee)=>({source:d.get(ee.connectionIndex),target:c.exits.get(ee.connectionIndex)})))))}),U=!1,j=!1,Y=0,X={sites:new Map(d),paths:new Map(u),plans:[..._]},K=(J)=>{d.clear();for(let[ee,se]of J.sites)d.set(ee,se);u.clear();for(let[ee,se]of J.paths)u.set(ee,se);_.splice(0,_.length,...J.plans)};for(let J=O.next();J;J=O.next()){let ee=Y++===0;p=H;for(let Se of I)m.delete(Se.busId);let se=J.sourceOriginPhysicalGridPhase||J.sourceLayerTravelCost!==void 0?{sites:new Map(d),paths:new Map(u),plans:[..._]}:void 0,ne=()=>{if(!se)return;K(se)};if(J.sourceLayerTravelCost!==void 0)K(X);let re=J.routeFromSourcePads||J.transitLayers.length<B.length,Z={...e,srj:V&&(J.reserveFutureApproaches??t.reserveFutureApproaches)?{...s,traces:[...s.traces??[],...fUr({...e,...c,excludedBusIds:new Set(I.map((Se)=>Se.busId))})]}:s,allBuses:i,buses:I,targetLayer:b,transitLayers:J.transitLayers,fixedViaPointsByConnectionIndex:d,sourceEscapePaths:u,acceptedPlans:p,terminals:I.flatMap((Se)=>Se.connections.map((Ne)=>({connection:Ne,viaPoint:d.get(Ne.connectionIndex),exitPoint:c.exits.get(Ne.connectionIndex)}))),tightViaChannels:!0,heuristicWeight:L?2:void 0,ripCost:J.ripCost,maximumRipEvents:400,maximumLocalRepairAttempts:re?0:3,maximumIterations:1e8,shuffleSeed:J.shuffleSeed,sourceOriginPhysicalGridPhase:J.sourceOriginPhysicalGridPhase,sourceLayerTravelCost:J.sourceLayerTravelCost??(V?o?.travelCost:void 0),maximumSourceIterations:J.maximumSourceIterations??(V?o?.maximumIterations:void 0)},te=function*(){if(J.routeFromSourcePads)return yield*q3({...Z,routeFromSourcePads:!0,sourceLayerTravelCost:2,maximumRipEvents:1200,maximumIterations:50000000,maximumLocalRepairAttempts:0});if(!V)return yield*q3(Z);let Se=yield*eGr({...Z,cleanupRetainedBoundaryTails:J.sourceOriginPhysicalGridPhase});if(!Se)return null;d.clear();for(let[Ne,ke]of Se.fixedViaPointsByConnectionIndex)d.set(Ne,ke);u.clear();for(let[Ne,ke]of Se.sourceEscapePaths)u.set(Ne,ke);return _.splice(0,_.length,...Se.sourcePlans),Se.plans}(),ie=te.next();while(!ie.done){if(cue(ie.value)){let Se=yield ie.value;ie=te.next(Se);continue}yield{phase:"route-layer",layer:b,routedConnectionCount:p.length+ie.value.routedConnectionCount,iterations:ie.value.iterations},ie=te.next()}let le=ie.value;if(!le){if(ne(),V&&!J.sourceOriginPhysicalGridPhase&&J.sourceLayerTravelCost===void 0)return t.failedWideMatching=j,null;if(O.failed(J,"routing"),r?.requested&&!e.sourceOriginRouting&&P&&b===g[0][0]&&ee&&J.shuffleSeed===1&&!J.routeFromSourcePads)r.requested=!1,r.reached=!0,yield{phase:"route-layer",layer:b,routedConnectionCount:p.length};continue}p=[...p,...le];for(let Se of I)m.add(Se.busId);yield{phase:"match-layer",layer:b,routedConnectionCount:p.length};let ue=new Set(p.map((Se)=>Se.connectionIndex)),de=[...p,..._.filter((Se)=>!ue.has(Se.connectionIndex))],me=i.filter((Se)=>m.has(Se.busId));de=hZ({...e,inputSrj:s,plans:de,preparedBuses:me,selectedBusIds:new Set(I.map((Se)=>Se.busId)),allowBlindAndBuriedVias:!1})??de;let Ae=J.routeFromSourcePads&&D,xe=J.routeFromSourcePads??!1,Me=e.sourceOriginRouting===!0&&v<=2&&H.length>0,Re=e.sourceOriginRouting&&P?i.filter((Se)=>Se.termination.type==="boundary"&&!m.has(Se.busId)):void 0,we=(Se)=>yx({...e,inputSrj:s,sharedBoundary:i[0].sharedBoundary,plans:de,preparedBuses:me,allowBlindAndBuriedVias:!1,allowSameNetMerges:!1,allowMatchingInsideDenseBounds:!0,allowSourcePrefixMatching:Ae,allowPairLaneSpreading:!0,allowUnconstrainedLaneRerouting:!0,unroutedSourceBuses:Re,maximumWorkUnits:Se});function*_e(){let Se=PUr({...e,inputSrj:s,plans:de,preparedBuses:i,selectedBusIds:new Set(I.map((ke)=>ke.busId))}),Ne=Se.next();while(!Ne.done)yield{phase:"repair-lengths",layer:b,routedConnectionCount:p.length},Ne=Se.next();de=Ne.value??de}if(P)yield*_e();let ye=we(P?void 0:1000);if(!ye.plans&&x&&v>2&&b===g.at(-1)[0]){let Se=yx({...e,inputSrj:s,sharedBoundary:i[0].sharedBoundary,plans:de,preparedBuses:me,allowBlindAndBuriedVias:!1,allowSameNetMerges:!1,allowMatchingInsideDenseBounds:!0,allowSourcePrefixMatching:!0,allowTransitLayerMatching:!0,allowDistributedMatching:!0,allowPairLaneSpreading:!0,allowUnconstrainedLaneRerouting:!0,maximumWorkUnits:1e5});if(Se.plans)ye=Se,xe=!0}if(!ye.plans&&!P&&!Me)yield*_e(),ye=we(re||(e.sourceOriginRouting||C)&&v>2?1000:void 0);if(!ye.plans&&Me&&y&&J.routeFromSourcePads){let Se=Ae;Ae=!0;let Ne=we(1000);if(Ne.plans)ye=Ne;else Ae=Se}if(!ye.plans&&(Me||ye.failedBus&&J.routeFromSourcePads&&(T||D))){let Se=de,Ne=Ae,ke=xe,nt=new Set,dt=Me?I.filter((rt)=>rt.connections.length===2).length:1;for(let rt=0;rt<dt;rt++){if(!ye.failedBus||ye.plans)break;let mt=ye.failedBus;if(Me){if(mt.connections.length!==2||!I.some((Ht)=>Ht.busId===mt.busId)||nt.has(mt.busId))break;nt.add(mt.busId)}let lt=fCn({...e,inputSrj:s,plans:de,preparedBuses:i,bus:mt}),Ct=lt.next();while(!Ct.done)yield{phase:"repair-lengths",layer:b,routedConnectionCount:p.length,iterations:Ct.value.iterations},Ct=lt.next();if(!Ct.value)break;if(de=Ct.value,xe=!0,Me)Ae=!0;let Nt=function*(){de=hZ({...e,inputSrj:s,plans:de,preparedBuses:me,selectedBusIds:new Set(I.map((Tt)=>Tt.busId)),allowBlindAndBuriedVias:!1})??de;let Ht=we(1000);if(!Ht.plans&&!Me)yield*_e(),Ht=we(1000);return Ht};if(ye=yield*Nt(),!ye.plans&&T)Ae=!0,ye=yield*Nt()}if(Me&&!ye.plans)de=Se,Ae=Ne,xe=ke,yield*_e(),ye=we()}if(!ye.plans&&e.sourceOriginRouting&&!P&&v>2&&b===g.at(-1)[0]){let Se=de,Ne=ye,ke=Ae,nt=xe,dt=q3({...Z,routeFromSourcePads:!0,transitLayers:[],sourceLayerTravelCost:2,ripCost:64,shuffleSeed:1,maximumIterations:30000000,maximumRipEvents:400,maximumLocalRepairAttempts:0}),rt=dt.next();while(!rt.done){if(cue(rt.value)){let mt=yield rt.value;rt=dt.next(mt);continue}yield{phase:"repair-lengths",layer:b,routedConnectionCount:p.length,iterations:rt.value.iterations},rt=dt.next()}if(rt.value)de=[...H,...rt.value,..._.filter((mt)=>!ue.has(mt.connectionIndex))],de=hZ({...e,inputSrj:s,plans:de,preparedBuses:me,selectedBusIds:new Set(I.map((mt)=>mt.busId)),allowBlindAndBuriedVias:!1})??de,Ae=!0,ye=we(1000),xe=!0;if(!ye.plans)de=Se,ye=Ne,Ae=ke,xe=nt}if(ye.plans)de=ye.plans;else{if(o&&V)return null;if(j=!0,re){ne(),O.failed(J,"lengths");continue}let Se=EUr({...e,inputSrj:s,plans:de,preparedBuses:i,busIds:I.map((ke)=>ke.busId)}),Ne=Se.next();while(!Ne.done)yield{phase:"repair-lengths",layer:b,routedConnectionCount:p.length,iterations:Ne.value.iterations},Ne=Se.next();if(Ne.value)de=Ne.value;else{let ke=JYr({...e,inputSrj:s,plans:de,preparedBuses:i,busIds:I.map((dt)=>dt.busId)}),nt=ke.next();while(!nt.done)yield{phase:"repair-lengths",layer:b,routedConnectionCount:p.length,iterations:nt.value.iterations},nt=ke.next();if(!nt.value){let dt=new Set(I.map((Ct)=>Ct.busId)),rt=e.sourceOriginRouting&&P&&I.every((Ct)=>!n.has(Ct.busId))&&TCn({plans:de,completedBuses:me,selectedBusIds:dt});if(rt)for(let Ct of I)n.add(Ct.busId);let mt=rt?mUr({...e,inputSrj:s,plans:de,preparedBuses:i,completedBuses:me,selectedBusIds:dt}):void 0,lt=mt?.next();while(lt&&!lt.done)yield{phase:"repair-lengths",layer:b,routedConnectionCount:p.length,iterations:lt.value.iterations},lt=mt.next();if(!lt?.value){ne(),O.failed(J,"lengths");continue}de=lt.value,xe=!0}else de=nt.value}}if(p=de.filter((Se)=>ue.has(Se.connectionIndex)),xe||Re?.length){let Se=new Map([...I,...Re??[]].flatMap((Ne)=>Ne.connections.map((ke)=>{let nt=de.find((mt)=>mt.connectionIndex===ke.connectionIndex);if(!nt.via)throw Error("Source-origin routing lost its source reservation");let dt=[ke.sourcePoint,...nt.segments.slice(0,nt.sourceEscapeSegmentCount??1).map((mt)=>mt.end)],rt=B6({...e,bus:Ne,terminal:{connection:ke,viaPoint:nt.via.center,exitPoint:nt.via.center},targetLayer:nt.via.toLayer,targetLayerPoints:[nt.via.center],sourceEscapePoints:dt,allowBlindAndBuriedVias:!1});return[ke.connectionIndex,{plan:rt,path:dt}]})));for(let[Ne,ke]of Se)d.set(Ne,ke.plan.via.center),u.set(Ne,ke.path);for(let Ne=0;Ne<_.length;Ne++)_[Ne]=Se.get(_[Ne].connectionIndex)?.plan??_[Ne]}if(T&&J.routeFromSourcePads)C=!0;U=!0;break}if(!U)return t.failedNarrowGroup=v<=2&&H.length>0,t.failedWideMatching=e.sourceOriginRouting===!0&&v>2&&j,null}return Jst({...e,inputSrj:s,preparedBuses:i,plans:[...p,..._.filter((b)=>m.has(b.busId)&&b.termination.type==="plane")]})}function*wUr(e){let t=(i,s=e.preparedBuses)=>yx({plans:i,preparedBuses:s,inputSrj:e.inputSrj,sharedBoundary:e.sharedBoundary,clearance:e.clearance,allowBlindAndBuriedVias:e.allowBlindAndBuriedVias,allowSameNetMerges:e.allowSameNetMerges}),n=(i)=>Math.max(...i.map((s)=>s.length))-Math.min(...i.map((s)=>s.length)),o=new Set,r=[...e.plans];while(o.size<3){let i=t(r);if(i.plans)return i.plans;let s=i.failedBus;if(o.has(s.busId)||s.connections.length!==2||s.termination.type!=="boundary"||!s.exitEdge)return null;o.add(s.busId);let a=r.filter((x)=>x.busId===s.busId);if(a.length!==2||a.some((x)=>!x.via||x.additionalVias?.length)||a[0].targetLayer!==a[1].targetLayer)return null;let c=r.filter((x)=>x.busId!==s.busId),l=new Map(a.map((x)=>[x.connectionIndex,[x.sourcePoint,...x.segments.slice(0,x.sourceEscapeSegmentCount??1).map((C)=>C.end)]])),h=s.exitEdge==="left"||s.exitEdge==="right",d=h?"y":"x",u=h?e.sharedBoundary.minY:e.sharedBoundary.minX,_=h?e.sharedBoundary.maxY:e.sharedBoundary.maxX,p=(u+_)/2,m=Xi(s.exitEdge,s.preferredExit),A=e.traceWidth+e.clearance,g=n(a),f=[],y=null;e:for(let x of[0,1,-1,2,-2,3,-3,4,-4]){let C=x*A;if(a.some((b)=>{let I=b.exitPoint[d]+C;return I<u+e.traceWidth/2||I>_-e.traceWidth/2||m==="minimum"&&I>=p||m==="maximum"&&I<=p}))continue;for(let b of[0,-1,1])for(let I of[[0,1],[1,0]]){let v=yield*w1({...e,bus:s,targetLayer:a[0].targetLayer,acceptedPlans:c,terminals:s.connections.map((B)=>{let T=a.find((N)=>N.connectionIndex===B.connectionIndex);return{connection:B,viaPoint:T.via.center,exitPoint:{...T.exitPoint,[d]:T.exitPoint[d]+C}}}),sourceEscapePaths:l,reservedVias:void 0,gridStep:A/2,gridStepDivisor:2,alignGridToPads:!0,maximumRouteOrderAttempts:1,routeOrder:I,laneBias:b},1,!1);if(!v.length||n(v[0])>=g)continue;let P=v[0].map((B)=>({...B,cornerBandSide:m}));if(f.push(P),n(P)>2*s.maxLengthSkew)continue;let M=t([...c,...P],[s]);if(!M.plans)continue;y=M.plans;break e}}if(!y)for(let x of f.toSorted((C,b)=>n(C)-n(b)).slice(0,3)){let C=t([...c,...x],[s]);if(!C.plans)continue;y=C.plans;break}if(!y)return null;r=y}return t(r).plans}var S1=0.0000001;function Gve(e,t){let n=e.filter((o,r)=>!r||Ut(o,e[r-1])>0.000000001);return n.flatMap((o,r)=>{if(!r||r===n.length-1)return[o];let i=n[r-1],s=n[r+1],a=Ut(i,o),c=Ut(o,s);if(Math.abs((o.x-i.x)*(s.x-o.x)+(o.y-i.y)*(s.y-o.y))>0.000000001)return[o];let l=Math.min(t,a/3,c/3);return[{x:o.x+(i.x-o.x)*l/a,y:o.y+(i.y-o.y)*l/a},{x:o.x+(s.x-o.x)*l/c,y:o.y+(s.y-o.y)*l/c}]})}function BUr(e,t,n){if(e.length>28)return null;let{traceWidth:o,clearance:r,viaDiameter:i}=t,s=t.buses.flatMap((g)=>g.connections),a=Kk(t.buses,{...t,additionalObstacles:t.srj.obstacles}),c=new Map(e.map((g,f)=>[g.connectionIndex,f])),l=s.map((g)=>({own:c.get(g.connectionIndex),masks:a.filter((f)=>f.connectionIndex===g.connectionIndex).map((f)=>{let y={start:g.sourcePoint,end:f.point,width:o,layer:g.sourceLayer},x=0;return e.forEach((C,b)=>{if(C.connectionIndex===g.connectionIndex)return;if(Ut(f.point,C.exitPoint)<i+r-S1||Vr(C.exitPoint,y.start,y.end)<i/2+o/2+r-S1||C.segments.some((I)=>Vr(f.point,I.start,I.end)<i/2+o/2+r-S1||!V_(y,I,r)))x|=1<<b}),x})})),h=(g)=>Math.atan2(g.y-n.y,g.x-n.x),d=e.map((g,f)=>f).sort((g,f)=>h(e[f].exitPoint)-h(e[g].exitPoint)),u=t.bus.connections.toSorted((g,f)=>h(f.exitTargetPoint??f.targetPoint)-h(g.exitTargetPoint??g.targetPoint)),_=new Map(u.map((g,f)=>[g.connectionIndex,f])),p=(g)=>l.every((f)=>f.own!==void 0&&g&1<<f.own||f.masks.some((y)=>!(y&g))),m=[],A=0;for(let g=0;g<e.length;g++){let f=[...d.slice(g),...d.slice(0,g)],y=(x,C,b,I)=>{if(++A>1e6||I.length+f.length-x<m.length)return;if(x===f.length){if(I.length>m.length&&p(b))m=[...I];return}let v=f[x],P=_.get(e[v].connectionIndex);if(P>C)y(x+1,P,b|1<<v,[...I,v]);y(x+1,C,b,I)};y(0,-1,0,[])}return m.length>=3?m.map((g)=>e[g]):null}function*TUr(e){let{bus:t,srj:n,traceWidth:o,clearance:r,viaDiameter:i}=e;if(t.termination.type!=="boundary"||t.exitEdge!=="left"||t.connections.length<8||t.connections.length>28||e.targetLayer==="top"||t.connections.some((le)=>le.sourceLayer!=="top"))return null;let s=Math.min(t.pitchX,t.pitchY),a=o+r;if(!Number.isFinite(s)||s<=0)return null;let c=t.componentObstacles.filter((le)=>le.layers.includes("top")),l={minX:Math.min(...c.map((le)=>le.center.x-le.width/2)),maxX:Math.max(...c.map((le)=>le.center.x+le.width/2)),minY:Math.min(...c.map((le)=>le.center.y-le.height/2)),maxY:Math.max(...c.map((le)=>le.center.y+le.height/2))},h={x:(l.minX+l.maxX)/2,y:(l.minY+l.maxY)/2},d=Math.ceil(((l.maxX-l.minX)/2+s+a)/a)*a,u=Math.ceil(((l.maxY-l.minY)/2+s+a)/a)*a,_={minX:h.x-d,maxX:h.x+d,minY:h.y-u,maxY:h.y+u};if(_.minX<=t.sharedBoundary.minX||_.maxY>=t.sharedBoundary.maxY||_.minY<=t.sharedBoundary.minY)return null;let p=new Map(e.buses.flatMap((le)=>le.connections.map((ue)=>[ue.connectionIndex,{owner:le,connection:ue}]))),m=(le)=>e.targetPointsByConnectionIndex?.get(le.connectionIndex)??{x:t.sharedBoundary.minX,y:(le.exitTargetPoint??le.targetPoint).y},A=(le)=>le.map((ue,de)=>({...t,busId:`${t.busId}:split-source:${de}`,sharedBoundary:_,preferredExit:void 0,exitEdge:void 0,connections:[{...ue,exitTargetPoint:void 0,hasExplicitLayeredExitTarget:!1,hasExplicitExitTarget:!1}]})),g=yield*_G({srj:n,buses:A(t.connections),traceWidth:o,clearance:r});if(!g||g.length!==t.connections.length)return null;let f=BUr(g,e,h);if(!f)return null;let y=(le,ue)=>{let de=p.get(le.connectionIndex).owner,me=de===t?e.targetLayer:de.termination.type==="plane"?de.termination.layer:e.targetLayerByBusId?.get(de.busId)??(de.allowedLayers??e.layerNames).find((Ae)=>Ae!==le.sourceLayer);if(!me)throw Error("FanoutSolver: split source has no legal target layer");return{connectionIndex:le.connectionIndex,connectionName:le.connection.name,segments:ue.slice(1).map((Ae,xe)=>({start:ue[xe],end:Ae,width:o,layer:le.sourceLayer})),via:{center:ue.at(-1),diameter:i,holeDiameter:e.viaHoleDiameter,fromLayer:le.sourceLayer,toLayer:me,spanLayers:G5({fromLayer:le.sourceLayer,toLayer:me,layerNames:e.layerNames,allowBlindAndBuriedVias:!1})}}},x=(le,ue)=>{let de=p.get(le.connectionIndex).connection;if(le.segments.some((me)=>[me.start,me.end].some((Ae)=>Ae.x<t.sharedBoundary.minX-S1||Ae.x>t.sharedBoundary.maxX+S1||Ae.y<t.sharedBoundary.minY-S1||Ae.y>t.sharedBoundary.maxY+S1)))return!1;for(let me of n.obstacles){if(me.layers.some((Ae)=>le.via.spanLayers.includes(Ae))&&X5(le.via.center,me)<i/2+r-S1)return!1;if(me!==de.sourceObstacle&&le.segments.some((Ae)=>me.layers.includes(Ae.layer)&&Wl(Ae,me)<o/2+r-S1))return!1}return ue.every((me)=>me.connectionIndex===le.connectionIndex||Ut(le.via.center,me.via.center)>=i+r-S1&&le.segments.every((Ae)=>Vr(me.via.center,Ae.start,Ae.end)>=i/2+o/2+r-S1&&me.segments.every((xe)=>V_(Ae,xe,r)))&&me.segments.every((Ae)=>Vr(le.via.center,Ae.start,Ae.end)>=i/2+o/2+r-S1))},C=(le)=>{let ue=new Set(le.map((de)=>de.connectionIndex));return e.buses.map((de)=>({...de,connections:de.connections.filter((me)=>!ue.has(me.connectionIndex))})).filter((de)=>de.connections.length)},b=e.initialViaPoints,I=(le)=>({...e,additionalObstacles:n.obstacles,maximumSearchStates:300000,blockingSegments:le.flatMap((ue)=>ue.segments.map((de)=>({connectionIndex:ue.connectionIndex,segment:de}))),blockingVias:le.map((ue)=>({connectionIndex:ue.connectionIndex,...ue.via})),preferredViaPointsByConnectionIndex:b}),v=f.map((le)=>y(p.get(le.connectionIndex).connection,[le.segments[0].start,...le.segments.map((ue)=>ue.end)])),P=I0(C(v),I(v));if(!P)return null;b=new Map([...P,...v.map((le)=>[le.connectionIndex,le.via.center])]);let M=f.toSorted((le,ue)=>m(p.get(le.connectionIndex).connection).y-m(p.get(ue.connectionIndex).connection).y),B=[];for(let le of M){let ue=[le],de=le.exitPoint.x;for(let me of M.slice(M.indexOf(le)+1))if(me.exitPoint.x>de+a-S1)ue.push(me),de=me.exitPoint.x;if(ue.length>B.length)B=ue}if(B.length<3)return null;let T=new Map(B.map((le)=>[le.connectionIndex,[le.segments[0].start,...le.segments.map((ue)=>ue.end)]])),N=t.sharedBoundary.minX+Math.max(s/2,i/2+r),D=_.maxY+s-a/2,L=_.minX-s+a/2,H=()=>[...T].sort(([le],[ue])=>m(p.get(le).connection).y-m(p.get(ue).connection).y).map(([le,ue],de)=>{let me=m(p.get(le).connection),Ae=ue.at(-1);return y(p.get(le).connection,Gve([...ue,{x:Ae.x,y:D+de*a},{x:L-de*a,y:D+de*a},{x:L-de*a,y:me.y},{x:N,y:me.y}],o))}),V=H();if(V.some((le)=>!x(le,V)))return null;for(let le of t.connections.toSorted((ue,de)=>m(ue).y-m(de).y)){if(T.has(le.connectionIndex))continue;let ue=[...T].filter(([me])=>m(p.get(me).connection).y<m(le).y).at(-1)?.[1].at(-1)?.x??_.minX,de=[...T].filter(([me])=>m(p.get(me).connection).y>m(le).y)[0]?.[1].at(-1)?.x??_.maxX;for(let me of[-1,1]){let Ae={x:le.sourcePoint.x+me*s/2,y:le.sourcePoint.y+s/2};if(Ae.x<ue+a-S1||Ae.x>de-a+S1)continue;let xe=[le.sourcePoint,Ae,{x:Ae.x,y:_.maxY}];T.set(le.connectionIndex,xe);let Me=H();if(Me.every((Re)=>x(Re,Me))&&I0(C(Me),I(Me))){V=Me;break}T.delete(le.connectionIndex)}}let O=Math.min(...V.map((le)=>m(p.get(le.connectionIndex).connection).y));for(let le of g.filter((ue)=>Math.abs(ue.exitPoint.x-_.minX)<S1&&m(p.get(ue.connectionIndex).connection).y<O).sort((ue,de)=>m(p.get(de.connectionIndex).connection).y-m(p.get(ue.connectionIndex).connection).y)){let ue=p.get(le.connectionIndex).connection,de=m(ue),me=_.minX-a,Ae=y(ue,Gve([le.segments[0].start,...le.segments.map((xe)=>xe.end),{x:me,y:le.exitPoint.y},{x:me,y:de.y},{x:N,y:de.y}],o));if(x(Ae,V)&&I0(C([...V,Ae]),I([...V,Ae])))V.push(Ae)}let U=new Set(V.map((le)=>le.connectionIndex)),j=t.connections.filter((le)=>!U.has(le.connectionIndex)).sort((le,ue)=>m(le).y-m(ue).y);if(j.length<5)return null;let Y=j.slice(0,3),X=Y[1],K=Y[2],J=[...n.obstacles,...V.flatMap((le)=>le.segments.map((ue)=>({type:"rect",center:{x:(ue.start.x+ue.end.x)/2,y:(ue.start.y+ue.end.y)/2},width:Ut(ue.start,ue.end),height:ue.width,ccwRotationDegrees:Math.atan2(ue.end.y-ue.start.y,ue.end.x-ue.start.x)*180/Math.PI,layers:[ue.layer],connectedTo:[le.connectionName]})))],ee=yield*_G({srj:{...n,obstacles:J},buses:A([X,K]),traceWidth:o,clearance:r,availableBoundaryRegions:[{direction:"down",preferredExit:"bottom",exitEdge:"bottom"}]});if(!ee?.length)return null;let se=ee.find((le)=>le.connectionIndex===X.connectionIndex),ne=y(X,[se.segments[0].start,...se.segments.map((le)=>le.end)]);if(!x(ne,V))return null;V.push(ne),U.add(ne.connectionIndex);let re=C(V),Z=new Map([[K.connectionIndex,{x:K.sourcePoint.x-s/2,y:K.sourcePoint.y-s/2}]]),te=I0(re,{...I(V),fixedViaPointsByConnectionIndex:Z});if(!te)return null;let ie=[...V,...re.flatMap((le)=>le.connections.map((ue)=>y(ue,[ue.sourcePoint,te.get(ue.connectionIndex)])))];if(ie.some((le)=>!x(le,ie)))return null;return{sourceEscapes:ie,sourceBoundary:_,remoteConnectionIndices:U,bottomRemoteConnectionIndices:new Set([ne.connectionIndex]),lowerConnectionIndices:Y.map((le)=>le.connectionIndex),viaPointsByConnectionIndex:new Map(ie.map((le)=>[le.connectionIndex,le.via.center]))}}function*sot(e){let t=new Set,n=new Set,o=[],r=0,i=null;function*s(l,h){let d=l.join(",")+":"+h;if(t.has(d)||r>=256)return;t.add(d),r++;let u=0,_=w1({...e,routeOrder:l,laneBias:h,maximumRouteOrderAttempts:1},1,!1),p=_.next();while(!p.done)u=Math.max(u,p.value.connectionIndex),yield p.value,p=_.next();if(p.value.length){i=p.value[0];return}let m=l.slice(0,u+1).join(",")+":"+h;if(!n.has(m))n.add(m),o.push({order:l,bias:h,completed:u})}let c=e.terminals.map((l,h)=>h).toSorted((l,h)=>e.terminals[l].exitPoint.x-e.terminals[h].exitPoint.x);for(let l of[0,1,-1]){if(yield*s(c,l),i)return i;if(yield*s(c.toReversed(),l),i)return i}while(o.length&&r<256){o.sort((u,_)=>_.completed-u.completed);let{order:l,bias:h,completed:d}=o.shift();if(o.length>256)o.length=256;for(let u=d-1;u>=0;u--){let _=[...l],[p]=_.splice(d,1);if(_.splice(u,0,p),yield*s(_,h),i)return i;let m=[...l];if([m[d],m[u]]=[m[u],m[d]],yield*s(m,h),i)return i}}return null}function*NCn(e){let{bus:t,srj:n,sourceBoundary:o,sourceEscapes:r,remoteConnectionIndices:i,bottomRemoteConnectionIndices:s,lowerConnectionIndices:a,targetLayer:c,traceWidth:l,clearance:h}=e;if(t.exitEdge!=="left"||t.termination.type!=="boundary"||a.length!==3)return null;let d=Math.min(t.pitchX,t.pitchY),u=l+h,_=new Map(r.map((ie)=>[ie.connectionIndex,ie])),p=t.connections.map((ie)=>({connection:ie,viaPoint:_.get(ie.connectionIndex).via.center,exitPoint:{x:t.sharedBoundary.minX,y:(ie.exitTargetPoint??ie.targetPoint).y}})).sort((ie,le)=>ie.exitPoint.y-le.exitPoint.y),m=new Map(p.map((ie)=>[ie.connection.connectionIndex,ie])),A=a.map((ie)=>m.get(ie)),g=new Set(a),f=p.filter((ie)=>!g.has(ie.connection.connectionIndex)&&!i.has(ie.connection.connectionIndex));if(f.length<2||A.some((ie)=>!ie))return null;let y=new Map(r.map((ie)=>[ie.connectionIndex,[ie.segments[0].start,...ie.segments.map((le)=>le.end)]])),x=(ie,le)=>B6({...e,bus:t,terminal:ie,targetLayerPoints:le,sourceEscapePoints:y.get(ie.connection.connectionIndex),allowBlindAndBuriedVias:!1}),C=Math.min(o.minY-e.viaDiameter/2-l/2-h-0.00001,...A.map((ie,le)=>ie.exitPoint.y+(A.length-1-le)*u-u-l)),b=(ie,le,ue)=>{let de=(ue?f:A).findIndex((Re)=>Re.connection.connectionIndex===ie.connection.connectionIndex),me=le.at(-1),Ae=ue?o.maxY+d-u/2+de*u:C-(A.length-1-de)*u,xe=o.minX-e.viaDiameter/2-l/2-h-0.00001-(ue?de:A.length-1-de)*u,Me=Gve([me,{x:me.x,y:Ae},{x:xe,y:Ae},{x:xe,y:ie.exitPoint.y},ie.exitPoint],l);return x(ie,[...le,...Me.slice(1)])},I=p.filter((ie)=>i.has(ie.connection.connectionIndex)).map((ie)=>s.has(ie.connection.connectionIndex)?b(ie,[ie.viaPoint],!1):x(ie,[ie.viaPoint,ie.exitPoint])),v=!!e.rematchPendingSources,P=(ie,le,ue,de,me=!1)=>{let Ae=new Set(ie.map((Me)=>Me.connection.connectionIndex)),xe={...t,connections:ie.map((Me)=>Me.connection),exitEdge:ue?"top":"bottom",direction:ue?"up":"down",preferredExit:void 0,sharedBoundary:me?t.sharedBoundary:{...t.sharedBoundary,maxY:o.maxY,...!ue?{minY:o.minY}:{}}};return{...e,bus:xe,terminals:ie.map((Me,Re)=>({...Me,exitPoint:de[Re]})),acceptedPlans:le,reservedVias:r.filter((Me)=>!Ae.has(Me.connectionIndex)&&(!v||!e.rematchPendingSources?.connectionIndices.has(Me.connectionIndex))).map((Me)=>({connectionName:Me.connectionName,via:Me.via})),sourceEscapePaths:y,allowBlindAndBuriedVias:!1,allowSameNetMerges:!1,gridStepDivisor:2,gridStep:u/2,alignGridToPads:!0,reserveTerminalExitPoints:!0}},M=A[0],B=A.at(-1),T=f[0],N=B.connection.sourcePoint,D=N.x+d,L=[{x:T.connection.sourcePoint.x,y:T.connection.sourcePoint.y-d},{x:N.x-d,y:N.y},{x:D,y:N.y}],H=[M.viaPoint];for(let ie of L){let le={...M,viaPoint:H.at(-1)},ue=P([le],I,!0,[ie],!0);ue.bus={...ue.bus,exitEdge:"right",direction:"right"},ue.sourceEscapePaths=void 0;let de=yield*sot(ue);if(!de)return null;H.push(...de[0].segments.filter((me)=>me.layer===c).map((me)=>me.end))}H=Gve([...H,{x:D,y:o.minY}],l);let V=b(M,H,!1),U={x:r.find((ie)=>s.has(ie.connectionIndex)).via.center.x-d,y:o.minY};v=!1;let j=yield*sot(P([B],[...I,V],!1,[U]));if(!j)return null;let Y=j[0].segments.filter((ie)=>ie.layer===c),X=b(B,[Y[0].start,...Y.map((ie)=>ie.end)],!1);if(e.rematchPendingSources){if(!e.rematchPendingSources.afterLowerStage([...I,V,X]))return null;for(let ie of r)y.set(ie.connectionIndex,[ie.segments[0].start,...ie.segments.map((le)=>le.end)])}let K=Math.min(...t.componentObstacles.map((ie)=>ie.center.x-ie.width/2)),J=K+e.viaDiameter/2,ee=Math.max(...f.map((ie)=>ie.connection.sourcePoint.x))-d/2-l/2;if(ee-J<(f.length-1)*u)return null;let se=f.map((ie,le)=>({x:J+(ee-J)*le/(f.length-1),y:o.maxY})),ne=yield*sot(P(f,[...I,V,X],!0,se));if(!ne)return null;let re=ne.map((ie)=>{let le=ie.segments.filter((de)=>de.layer===c),ue=le.at(-1);if(ue.end.y<=ue.start.y)return null;return b(m.get(ie.connectionIndex),[le[0].start,...le.map((de)=>de.end)],!0)});if(re.some((ie)=>!ie))return null;let Z=[...I,V,X,...re];if(Z.length!==t.connections.length)return null;let te=Z.map((ie)=>ie.length);if(t.maxLengthSkew!==void 0&&Math.max(...te)-Math.min(...te)>t.maxLengthSkew+aot)return null;if(!wp({plans:Z,srj:n,sharedBoundary:t.sharedBoundary,clearance:h,allowBlindAndBuriedVias:!1,allowSameNetMerges:!1}))return null;for(let ie of Z)for(let le of r){if(ie.connectionIndex===le.connectionIndex)continue;for(let ue of ie.segments){if(le.via.spanLayers.includes(ue.layer)&&Vr(le.via.center,ue.start,ue.end)<le.via.diameter/2+ue.width/2+h-aot)return null;for(let de of le.segments)if(ue.layer===de.layer&&ad(ue.start,ue.end,de.start,de.end)<(ue.width+de.width)/2+h-aot)return null}}return Z}var aot=0.0000001,xv=0.0000001;function zfn(e,t){let n=new Map(e.buses.flatMap((r)=>r.connections).map((r)=>[r.connectionIndex,r])),o=e.bus.sharedBoundary;for(let r of t){let i=n.get(r.connectionIndex),s=r.via.diameter/2;for(let a of e.srj.obstacles){if(a.layers.some((c)=>r.via.spanLayers.includes(c))&&X5(r.via.center,a)<s+e.clearance-xv)return!1;if(a!==i.sourceObstacle&&r.segments.some((c)=>a.layers.includes(c.layer)&&Wl(c,a)<c.width/2+e.clearance-xv))return!1}for(let a of r.segments)if([a.start,a.end].some((c)=>c.x<o.minX-xv||c.x>o.maxX+xv||c.y<o.minY-xv||c.y>o.maxY+xv))return!1;for(let a of t){if(r.connectionIndex===a.connectionIndex)continue;if(Ut(r.via.center,a.via.center)<s+a.via.diameter/2+e.clearance-xv)return!1;if(r.segments.some((c)=>a.via.spanLayers.includes(c.layer)&&Vr(a.via.center,c.start,c.end)<a.via.diameter/2+c.width/2+e.clearance-xv))return!1;if(r.segments.some((c)=>a.segments.some((l)=>!V_(c,l,e.clearance))))return!1}}return!0}function*DUr(e){let{bus:t,traceWidth:n,clearance:o,viaDiameter:r}=e;if(t.exitEdge!=="left"||t.termination.type!=="boundary"||e.bottomRemoteConnectionIndices.size!==1)return null;let i=[...e.bottomRemoteConnectionIndices][0],s=e.sourceEscapes.find((p)=>p.connectionIndex===i),a=s?.segments.at(-1);if(!a||Math.abs(a.start.x-a.end.x)>xv||a.start.y<=a.end.y)return null;let c=Math.min(t.pitchX,t.pitchY);if(!Number.isFinite(c)||c<=0)return null;let l=n+o,h=t.yCoordinates.slice(1).map((p,m)=>(p+t.yCoordinates[m])/2).filter((p)=>p>a.end.y+xv&&p<a.start.y-xv).sort((p,m)=>p-m).slice(0,4),d=new Set([...t.connections.map((p)=>p.connectionIndex),...e.sourceEscapes.filter((p)=>p.segments.length>1).map((p)=>p.connectionIndex)]),u=e.buses.map((p)=>({...p,connections:p.connections.filter((m)=>!d.has(m.connectionIndex))})).filter((p)=>p.connections.length),_=new Set(u.flatMap((p)=>p.connections).map((p)=>p.connectionIndex));for(let p of h){yield{phase:"route-connection",routeOrderAttempt:0,connectionIndex:0,connectionCount:t.connections.length,connectionName:s.connectionName,searchBatch:0,expandedStateCount:0,connectionComplete:!1};let m=e.sourceEscapes.map((b)=>({...b,segments:b.segments.map((I)=>({...I,start:{...I.start},end:{...I.end}})),via:{...b.via,center:{...b.via.center}}})),A=new Map(e.viaPointsByConnectionIndex),g=m.find((b)=>b.connectionIndex===i);g.via.center={x:a.end.x,y:p},g.segments.at(-1).end=g.via.center,A.set(i,g.via.center);let f=m.filter((b)=>d.has(b.connectionIndex)),y=(b=[])=>{let I=I0(u,{...e,additionalObstacles:e.srj.obstacles,maximumSearchStates:300000,preferredViaPointsByConnectionIndex:A,blockingSegments:[...f.flatMap((v)=>v.segments.map((P)=>({connectionIndex:v.connectionIndex,segment:P}))),...b.flatMap((v)=>v.segments.filter((P)=>P.layer===e.targetLayer).map((P)=>({connectionIndex:v.connectionIndex,segment:P})))],blockingVias:f.map((v)=>({connectionIndex:v.connectionIndex,...v.via}))});if(!I)return!1;for(let v of m)if(_.has(v.connectionIndex)){let P=I.get(v.connectionIndex);v.via={...v.via,center:P},v.segments=[{...v.segments[0],end:P}],A.set(v.connectionIndex,P)}return zfn(e,m)};if(!y())continue;let x={...e.sourceBoundary,minY:p-c+r/2+n/2+o+0.00001+l},C=yield*NCn({...e,sourceEscapes:m,sourceBoundary:x,viaPointsByConnectionIndex:A,rematchPendingSources:{connectionIndices:_,afterLowerStage:y}});if(C&&zfn(e,m))return{plans:C,sourceEscapes:m,sourceBoundary:{...e.sourceBoundary},viaPointsByConnectionIndex:A,remoteConnectionIndices:new Set(e.remoteConnectionIndices),bottomRemoteConnectionIndices:new Set(e.bottomRemoteConnectionIndices),lowerConnectionIndices:[...e.lowerConnectionIndices]}}return null}function TP(e){return e==="left"||e==="right"}function U8e(e){return e==="right"||e==="up"?1:-1}function P1(e,t){return TP(t)?e.x:e.y}function DP(e,t){return TP(t)?e.y:e.x}function F5(e,t,n){return TP(n)?{x:e,y:t}:{x:t,y:e}}function W8e(e){switch(e.direction){case"right":return e.sharedBoundary.maxX;case"left":return e.sharedBoundary.minX;case"up":return e.sharedBoundary.maxY;case"down":return e.sharedBoundary.minY}}function uve(e){if(e.length<3)return e;let t=[e[0]];for(let n=1;n<e.length-1;n++){let o=t.at(-1),r=e[n],i=e[n+1],s={x:Math.sign(r.x-o.x),y:Math.sign(r.y-o.y)},a={x:Math.sign(i.x-r.x),y:Math.sign(i.y-r.y)};if(s.x!==a.x||s.y!==a.y)t.push(r)}return t.push(e.at(-1)),t}function Vde(e,t){let n=[];for(let o=1;o<e.length;o++){if(Ut(e[o-1],e[o])<0.000000001)continue;n.push({start:e[o-1],end:e[o],width:t,layer:"top"})}return n}function NUr(e){let{srj:t,bus:n,connection:o,traceWidth:r,clearance:i}=e,s=n.direction,a=U8e(s),c={x:o.sourcePoint.x,y:o.sourcePoint.y},l=P1(c,s),h=DP(c,s),d=r/2+i,u=(()=>{switch(s){case"right":return n.componentBounds.maxX+d;case"left":return n.componentBounds.minX-d;case"up":return n.componentBounds.maxY+d;case"down":return n.componentBounds.minY-d}})(),_=(C)=>Math.min(...t.obstacles.filter((b)=>b!==o.sourceObstacle&&b.layers.includes("top")).map((b)=>Wl(C,b))),p={start:c,end:F5(u,h,s),width:r,layer:"top"};if(_(p)>=d-0.000000001)return null;let m=TP(s)?{minimum:n.componentBounds.minY,maximum:n.componentBounds.maxY}:{minimum:n.componentBounds.minX,maximum:n.componentBounds.maxX},A=a*(u-l),g=DP(o.exitTargetPoint??o.targetPoint,s),f=r+i,y=W8e(n),x=[-1,1].map((C)=>{let b=C<0?m.minimum-d:m.maximum+d,I=C*(b-h),v=Math.max(A,I),P=F5(l+a*v,h+C*v,s);if(a*(y-P1(P,s))<f-0.000000001)return null;let M=[c,P];if(!M.every((N)=>N.x>=n.sharedBoundary.minX-0.000000001&&N.x<=n.sharedBoundary.maxX+0.000000001&&N.y>=n.sharedBoundary.minY-0.000000001&&N.y<=n.sharedBoundary.maxY+0.000000001))return null;let T=Math.min(...Vde(M,r).map(_));if(T<d-0.000000001)return null;return{points:M,obstacleDistance:T,targetDistance:Math.abs(DP(P,s)-g)}}).filter((C)=>C!==null).toSorted((C,b)=>b.obstacleDistance-C.obstacleDistance||C.targetDistance-b.targetDistance);return x.length>0?x.map((C)=>C.points):null}function RUr(e){let{item:t,srj:n,acceptedSegments:o,traceWidth:r,clearance:i}=e,s=t.cornerChannelPrefixes;if(!s)return null;let a=t.direction,c=U8e(a),l=W8e(t.bus),h=r+i,d=r/2+i,u=TP(a)?t.bus.sharedBoundary.minY:t.bus.sharedBoundary.minX,_=TP(a)?t.bus.sharedBoundary.maxY:t.bus.sharedBoundary.maxX,p=u+r/2,m=_-r/2,A=DP(t.connection.exitTargetPoint??t.connection.targetPoint,a),g=h/2,f=new Set([Math.max(p,Math.min(m,A))]);for(let x=Math.ceil(p/g)*g;x<=m+0.000000001;x+=g)f.add(Number(x.toFixed(9)));let y=[...f].toSorted((x,C)=>Math.abs(x-A)-Math.abs(C-A));for(let x of s){let C=x.at(-1),b=DP(C,a);for(let I of y){let v=Math.abs(I-b),P=F5(P1(C,a)+c*h,b,a),M=F5(P1(P,a)+c*v,I,a);if(c*(l-P1(M,a))<-0.000000001)continue;let B=F5(l,I,a),T=[...x,P,...v>0.000000001?[M]:[]];if(Ut(T.at(-1),B)>0.000000001)T.push(B);let N=uve(T),D=Vde(N,r);if(!D.every((V)=>n.obstacles.every((O)=>O===t.connection.sourceObstacle||!O.layers.includes("top")||Wl(V,O)>=d-0.000000001)))continue;if(!D.every((V)=>o.every((O)=>ad(V.start,V.end,O.start,O.end)>=r+i-0.000000001)))continue;return{item:t,points:N,track:I}}}return null}function QUr(e){let{route:t,direction:n,exitAxis:o,signedShift:r,maximumShift:i,obstacles:s,requiredObstacleDistance:a}=e;if(i<=0.000000001||Math.abs(r)<=0.000000001)return 0;let c=Math.sign(r),l=(u)=>{if(u<=0.000000001)return!0;let _={start:F5(o-U8e(n)*u,t.track,n),end:F5(o,t.track+c*u,n),width:0,layer:"top"};return s.every((p)=>p===t.item.connection.sourceObstacle||!p.layers.includes("top")||Wl(_,p)>=a-0.000000001)};if(l(i))return i;let h=0,d=i;for(let u=0;u<32;u++){let _=(h+d)/2;if(l(_))h=_;else d=_}return h}function kUr(e){let{requestedTracks:t,currentTracks:n,candidateTracks:o,maximumShifts:r}=e,i=t.length+1,s=o.length+1,a=Array.from({length:i},()=>new Float64Array(s).fill(Number.POSITIVE_INFINITY)),c=Array.from({length:i},()=>new Uint8Array(s));a[0].fill(0);for(let u=1;u<i;u++)for(let _=1;_<s;_++){let p=a[u][_-1],m=Math.abs(t[u-1]-o[_-1]),g=Math.abs(n[u-1]-o[_-1])>r[u-1]+0.000000001?Number.POSITIVE_INFINITY:a[u-1][_-1]+m;if(g<p)a[u][_]=g,c[u][_]=1;else a[u][_]=p}if(!Number.isFinite(a.at(-1).at(-1)))return null;let l=[],h=t.length,d=o.length;while(h>0&&d>0){if(c[h][d])l.push(o[d-1]),h--;d--}if(h>0)return null;return l.reverse()}function LUr(e){let{direction:t,activeRoutes:n,obstacles:o,boundaryMinimum:r,boundaryMaximum:i,traceWidth:s,clearance:a,requestedTracks:c,maximumShifts:l}=e,h=s+a,d=s/2+a,u=null,_=Number.POSITIVE_INFINITY;for(let p of Array.from({length:Math.round(h/s)},(m,A)=>A*s)){let m=[],A=Math.ceil((r-p)/h)*h+p;for(let y=A;y<=i+0.000000001;y+=h){let x=Math.round(y/s)*s;if(o.every((C)=>{let b=DP(C.center,t),I=TP(t)?C.height:C.width;return Math.abs(x-b)>=I/2+d-0.000000001}))m.push(x)}let g=kUr({requestedTracks:c,currentTracks:n.map((y)=>y.track),candidateTracks:m,maximumShifts:l});if(!g)continue;let f=g.reduce((y,x,C)=>y+Math.abs(x-c[C]),0);if(f<_)_=f,u=g}return u}function HUr(e,t){switch(t){case"up":if(e==="top-left")return"minimum";if(e==="top-right")return"maximum";return null;case"down":if(e==="bottom-left")return"minimum";if(e==="bottom-right")return"maximum";return null;case"left":if(e==="bottom-left")return"minimum";if(e==="top-left")return"maximum";return null;case"right":if(e==="bottom-right")return"minimum";if(e==="top-right")return"maximum";return null}}function FUr(e){let{items:t,direction:n,boundaryMinimum:o,boundaryMaximum:r,traceWidth:i,clearance:s,borderDistribution:a,currentTrackByConnectionName:c}=e,l=(I)=>c.get(I.connection.connection.name)??DP(I.source,n),h=[...t].toSorted((I,v)=>l(I)-l(v)||I.connection.connection.name.localeCompare(v.connection.connection.name)),d=i+s,u=o+i/2,_=r-i/2,p=_-u,m=d*Math.max(h.length-1,0);if(p<m-0.000000001)return null;let A=h.map(l),g=[...A],f=d,y=new Set;if(a==="even"&&h.length>1){let I=A[0],v=A.at(-1),P=Math.max(d,(v-I)/(h.length-1)),M=(T)=>{let N=[...A],D=Math.floor(h.length/2),L=h.length%2===0?D-1:D;if(L!==D){let H=N[D]-N[L];if(H<T){let V=(T-H)/2;N[L]=N[L]-V,N[D]=N[D]+V}}for(let H=L-1;H>=0;H--)N[H]=Math.min(N[H],N[H+1]-T);for(let H=D+1;H<N.length;H++)N[H]=Math.max(N[H],N[H-1]+T);return N},B=(T)=>T[0]>=u-0.000000001&&T.at(-1)<=_+0.000000001;if(g=M(P),B(g))f=P;else{let T=d,N=P;if(g=M(T),!B(g))return null;for(let D=0;D<32;D++){let L=(T+N)/2,H=M(L);if(B(H))T=L,g=H;else N=L}f=T}for(let T of h)y.add(T.connection.connection.name)}let x=[],C=[];for(let I=0;I<h.length;I++){let v=h[I],P=v.bus.preferredExit;if(!P?.includes("-"))continue;let M=HUr(P,n);if(!M)return null;if(y.add(v.connection.connection.name),M==="minimum")x.push(I);else C.push(I)}if(x.some((I,v)=>I!==v)||C.some((I,v)=>I!==h.length-C.length+v))return null;let b=d*2;if(x.length>0){g[0]=u+b;for(let I=1;I<x.length;I++){let v=Math.max(f,A[I]-A[I-1]);g[I]=g[I-1]+v}}if(C.length>0){let I=h.length-1;g[I]=_-b;for(let v=I-1;v>=h.length-C.length;v--){let P=Math.max(f,A[v+1]-A[v]);g[v]=g[v+1]-P}}return{byConnectionName:new Map(h.map((I,v)=>[I.connection.connection.name,g[v]])),enforcedConnectionNames:y}}function zUr(e){let{item:t,points:n,segments:o}=e,r=n.map((s,a)=>({route_type:"wire",x:s.x,y:s.y,width:o[0]?.width??0.1,layer:"top",...a===0&&t.connection.sourcePoint.pcb_port_id?{start_pcb_port_id:t.connection.sourcePoint.pcb_port_id}:{}})),i=PG({connectionName:t.connection.connection.name,sourcePointIndex:t.connection.sourcePointIndex});return{busId:t.bus.busId,connectionName:t.connection.connection.name,connectionIndex:t.connection.connectionIndex,sourcePointIndex:t.connection.sourcePointIndex,sourcePoint:t.connection.sourcePoint,sourceObstacle:t.connection.sourceObstacle,sourceLayer:t.connection.sourceLayer,targetPoint:t.connection.targetPoint,targetLayer:"top",termination:t.bus.termination,direction:t.direction,...t.bus.exitEdge?{exitEdge:t.bus.exitEdge}:{},exitPoint:n.at(-1),trace:{type:"pcb_trace",pcb_trace_id:i.traceId,connection_name:t.connection.connection.name,connectsTo:[...t.connection.sourcePoint.pointId?[t.connection.sourcePoint.pointId]:[],...t.connection.sourcePoint.pcb_port_id?[t.connection.sourcePoint.pcb_port_id]:[],i.boundaryExitPointId],route:r},segments:o,length:o.reduce((s,a)=>s+Ut(a.start,a.end),0)}}function OUr(e){let{paths:t,obstacles:n,traceWidth:o,clearance:r}=e,i=o/2+r,s=o+r;for(let a of t){if(Math.abs(P1(a.points.at(-1),a.item.direction)-W8e(a.item.bus))>0.000001)return!1;for(let c of a.segments)for(let l of n){if(l===a.item.connection.sourceObstacle||!l.layers.includes("top"))continue;if(Wl(c,l)<i-0.000000001)return!1}}for(let a=0;a<t.length;a++)for(let c=a+1;c<t.length;c++)for(let l of t[a].segments)for(let h of t[c].segments)if(ad(l.start,l.end,h.start,h.end)<s-0.000000001)return!1;return!0}function VUr(e){let{srj:t,buses:n,traceWidth:o,clearance:r,borderDistribution:i}=e,s=o/2+r,a=new Map,c=new Map,l=n.flatMap((_)=>_.connections.map((p)=>{let m={x:p.sourcePoint.x,y:p.sourcePoint.y},A=NUr({srj:t,bus:_,connection:p,traceWidth:o,clearance:r});return{bus:_,connection:p,direction:_.direction,source:m,...A?{cornerChannelPrefixes:A}:{}}}));for(let _ of["left","right","up","down"]){let p=U8e(_),m=l.filter((D)=>D.direction===_&&!D.cornerChannelPrefixes);if(m.length===0)continue;let A=TP(_)?m[0].bus.sharedBoundary.minY:m[0].bus.sharedBoundary.minX,g=TP(_)?m[0].bus.sharedBoundary.maxY:m[0].bus.sharedBoundary.maxX,f=W8e(m[0].bus),y=new Map,x=new Map,C=new Map;for(let D of m){let L=P1(D.source,_),H=L.toFixed(6);C.set(H,L);let V=y.get(H)??[];V.push(D),y.set(H,V)}for(let[D,L]of y){let H=C.get(D),V=new Set(L.map((O)=>O.bus.componentId));x.set(D,t.obstacles.filter((O)=>O.layers.includes("top")&&!!O.componentId&&V.has(O.componentId)&&Math.abs(P1(O.center,_)-H)<0.000001))}let b=[...C.values()].toSorted((D,L)=>p*(D-L)),I=new Map;for(let D=0;D<b.length;D++){let L=b[D],H=L.toFixed(6);for(let X of y.get(H)??[]){let K=TP(_)?X.connection.sourceObstacle.width:X.connection.sourceObstacle.height,J=Math.max(X.connection.sourceObstacle.width,X.connection.sourceObstacle.height)<1.5?K/2+s:0,ee=F5(L+p*J,DP(X.source,_),_);I.set(X.connection.connection.name,{item:X,points:Ut(X.source,ee)>0.000000001?[X.source,ee]:[X.source],track:DP(X.source,_)})}let V=b[D+1]??f;if(I.size===0||p*(V-L)<=0.000000001)continue;let O=[...I.values()].toSorted((X,K)=>X.track-K.track||X.item.connection.connection.name.localeCompare(K.item.connection.connection.name)),U=b.slice(D+1,D+3).flatMap((X)=>x.get(X.toFixed(6))??[]),j=O.map((X)=>Math.abs(V-P1(X.points.at(-1),_))),Y=LUr({direction:_,activeRoutes:O,obstacles:U,boundaryMinimum:A,boundaryMaximum:g,traceWidth:o,clearance:r,requestedTracks:O.map((X)=>X.track),maximumShifts:j});if(!Y)return null;for(let X=0;X<O.length;X++){let K=O[X],J=Y[X],ee=Math.abs(J-K.track),se=P1(K.points.at(-1),_),ne=F5(se+p*ee,J,_);if(Ut(K.points.at(-1),ne)>0.000000001)K.points.push(ne);let re=F5(V,J,_);if(Ut(K.points.at(-1),re)>0.000000001)K.points.push(re);K.track=J}}let v=FUr({items:m,direction:_,boundaryMinimum:A,boundaryMaximum:g,traceWidth:o,clearance:r,borderDistribution:i,currentTrackByConnectionName:new Map([...I.values()].map((D)=>[D.item.connection.connection.name,D.track]))});if(!v)return null;let P=[...I.values()].toSorted((D,L)=>D.track-L.track||D.item.connection.connection.name.localeCompare(L.item.connection.connection.name)),M=new Map,B=o+r,T=B;for(let D of P){let L=D.item.connection.connection.name;if(!v.enforcedConnectionNames.has(L))continue;if(v.byConnectionName.get(L)-D.track>=-0.000000001)continue;M.set(L,T),T+=B*2}let N=B;for(let D=P.length-1;D>=0;D--){let L=P[D],H=L.item.connection.connection.name;if(!v.enforcedConnectionNames.has(H))continue;if(v.byConnectionName.get(H)-L.track<=0.000000001)continue;M.set(H,N),N+=B*2}for(let D of P){let L=D.item.connection.connection.name,H=v.byConnectionName.get(L)??D.track,V=M.get(L)??0,O=D.points.at(-2),U=O?p*(f-P1(O,_)):0,j=H-D.track,Y=Math.min(Math.abs(j),Math.max(0,U-V)),X=QUr({route:D,direction:_,exitAxis:f,signedShift:j,maximumShift:Y,obstacles:t.obstacles,requiredObstacleDistance:s}),K=Math.sign(j)*X;v.byConnectionName.set(L,D.track+K)}for(let D of v.enforcedConnectionNames)c.set(D,v.byConnectionName.get(D));for(let D of P){let L=D.item.connection.connection.name,H=v.byConnectionName.get(L)??D.track,V=Math.abs(H-D.track),O=M.get(L)??0,U=V>0.000000001?O+V:0,j=f-p*U,Y=D.points.at(-1);if(Math.abs(P1(Y,_)-f)>0.000001)return null;let X=D.points.at(-2);if(X&&(Math.abs(DP(X,_)-D.track)>0.000001||p*(j-P1(X,_))<-0.000001))return null;let K=F5(j,D.track,_);if(X&&Ut(X,K)<0.000000001)D.points.pop();else D.points[D.points.length-1]=K}for(let D of P){let L=D.item.connection.connection.name,H=v.byConnectionName.get(L)??D.track,V=Math.abs(H-D.track),O=M.get(L)??0;if(V>0.000000001&&O>0.000000001)D.points.push(F5(P1(D.points.at(-1),_)+p*O,D.track,_));if(V>0.000000001)D.points.push(F5(P1(D.points.at(-1),_)+p*V,H,_)),D.track=H;let U=F5(f,D.track,_);if(Ut(D.points.at(-1),U)>0.000000001){if(p*(f-P1(D.points.at(-1),_))<-0.000001)return null;D.points.push(U)}a.set(L,D)}}let h=[...a.values()].flatMap((_)=>Vde(uve(_.points),o));for(let _ of l){if(!_.cornerChannelPrefixes)continue;let p=RUr({item:_,srj:t,acceptedSegments:h,traceWidth:o,clearance:r});if(!p)return null;a.set(_.connection.connection.name,p),h.push(...Vde(uve(p.points),o))}if(a.size!==l.length)return null;let d=(o+r)/2+0.000001;for(let[_,p]of c){let m=a.get(_);if(!m||Math.abs(m.track-p)>d)return null}let u=l.map((_)=>{let p=a.get(_.connection.connection.name),m=uve(p.points);return{item:_,points:m,segments:Vde(m,o)}});if(!OUr({paths:u,obstacles:t.obstacles,traceWidth:o,clearance:r}))return null;return u.map(zUr)}var YUr=(e)=>e.process??{env:{}};function GUr(e){let{bus:t}=e,n=[...e.plans];if(t.maxLengthSkew===void 0)return n;let o=n.filter((r)=>r.busId===t.busId).toSorted((r,i)=>i.length-r.length);for(let r of o){let i=Math.min(...n.filter((a)=>a.busId===t.busId).map((a)=>a.length));if(r.length-i<=t.maxLengthSkew)continue;if(!r.via||r.additionalVias?.length||r.planeEndpointVia||r.segments.filter((a)=>a.layer===r.sourceLayer).length!==1)continue;let s=t.connections.find((a)=>a.connectionIndex===r.connectionIndex);for(let a of[!0,!1]){let c=rCn({...e,bus:{...t,connections:[s],routableEscapeLayers:[r.targetLayer]},terminals:[{connection:s,viaPoint:r.via.center,exitPoint:r.exitPoint}],targetLayer:r.targetLayer,acceptedPlans:n.filter((h)=>h!==r),allowBlindAndBuriedVias:!1,gridStepDivisor:2,alignGridToPads:a,maximumRouteOrderAttempts:1})?.[0];if(!c||c.length>=r.length-0.000001)continue;let l=n.map((h)=>h===r?c:h);if(!wp({...e,plans:l,allowBlindAndBuriedVias:!1}))continue;n=l;break}}return n}var Ih=0.000001;function g2(e,t){return Ut(e,t)<=Ih}function Ofn(e){return"layer"in e?[e.layer]:e.layers}function qY(e){return[...e.segments,...e.planeEndpointSegments??[]]}function JY(e){return[e.via,...e.additionalVias??[],e.planeEndpointVia].filter((t)=>Boolean(t))}function Vfn(e,t){return g2(e,t)&&Ofn(e).join("\x00")===Ofn(t).join("\x00")&&e.pointId===t.pointId&&e.pcb_port_id===t.pcb_port_id}function Yfn(e,t){let n=e.x>=t.minX-Ih&&e.x<=t.maxX+Ih&&e.y>=t.minY-Ih&&e.y<=t.maxY+Ih,o=Math.abs(e.x-t.minX)<=Ih||Math.abs(e.x-t.maxX)<=Ih||Math.abs(e.y-t.minY)<=Ih||Math.abs(e.y-t.maxY)<=Ih;return n&&o}function UUr(e,t,n){if(!(e.x>=n.minX-Ih&&e.x<=n.maxX+Ih&&e.y>=n.minY-Ih&&e.y<=n.maxY+Ih))return!1;switch(t){case"left":return Math.abs(e.x-n.minX)<=Ih;case"right":return Math.abs(e.x-n.maxX)<=Ih;case"top":return Math.abs(e.y-n.maxY)<=Ih;case"bottom":return Math.abs(e.y-n.minY)<=Ih}}function Gfn(e,t){return e.x>=t.minX-Ih&&e.x<=t.maxX+Ih&&e.y>=t.minY-Ih&&e.y<=t.maxY+Ih}function aa(e,t,n,o,r){e.push({code:t,message:n,...o?{connectionName:o.connectionName,busId:o.busId}:{},...r?{otherConnectionName:r}:{}})}function Ufn(e){let{trace:t,plan:n,issues:o}=e,r=[],i,s;for(let a of t.route){if(a.route_type==="via"){if(!i||!g2(i,a)||i.layer!==a.from_layer)aa(o,"disconnected-trace",`Trace ${t.pcb_trace_id} reaches a via without a matching ${a.from_layer} wire endpoint`,n);s=a;continue}if(a.route_type!=="wire"){aa(o,"unsupported-route-point",`Trace ${t.pcb_trace_id} contains unsupported ${a.route_type} geometry`,n);continue}if(s){if(!g2(a,s)||a.layer!==s.to_layer)aa(o,"disconnected-trace",`Trace ${t.pcb_trace_id} does not continue from its via on ${s.to_layer}`,n);i=a,s=void 0;continue}if(i){if(i.layer!==a.layer)aa(o,"disconnected-trace",`Trace ${t.pcb_trace_id} changes from ${i.layer} to ${a.layer} without a via`,n);else if(!g2(i,a))r.push({start:{x:i.x,y:i.y},end:{x:a.x,y:a.y},width:a.width,layer:a.layer})}i=a}if(s)aa(o,"disconnected-trace",`Trace ${t.pcb_trace_id} ends at a via without a wire on ${s.to_layer}`,n);return r}function WUr(e){let{plan:t,preparedBus:n,inputSrj:o,outputSrj:r,sharedBoundary:i,issues:s}=e,a=o.connections[t.connectionIndex];if(!a||a.name!==t.connectionName){aa(s,"connection-mismatch",`Plan index ${t.connectionIndex} does not identify connection ${t.connectionName}`,t);return}let c=n?.connections.find((g)=>g.connectionIndex===t.connectionIndex);if(!c||c.sourcePointIndex!==t.sourcePointIndex||!Vfn(c.sourcePoint,t.sourcePoint)||c.sourceObstacle.obstacleId!==t.sourceObstacle.obstacleId)aa(s,"source-mismatch",`Plan ${t.connectionName} does not start at its prepared component endpoint`,t);if(n?.termination.type!==t.termination.type)aa(s,"termination-mismatch",`Plan ${t.connectionName} does not use its bus termination`,t);let l=Xi(n?.exitEdge,n?.preferredExit);if(n?.exitEdge!==t.exitEdge||l!==t.cornerBandSide)aa(s,"output-exit-mismatch",`Plan ${t.connectionName} does not retain its prepared boundary edge and band`,t);else if(n?.exitEdge&&!UUr(t.exitPoint,n.exitEdge,i))aa(s,"output-exit-mismatch",`Plan ${t.connectionName} does not terminate on its declared ${n.exitEdge} edge`,t);if(!(o.allowViaInPad===!0&&t.termination.type==="plane"&&t.via!==void 0&&g2(t.via.center,t.sourcePoint)&&g2(t.exitPoint,t.sourcePoint))&&(t.segments.length===0||t.length<=Ih))aa(s,"not-broken-out",`Plan ${t.connectionName} has no non-zero escape geometry`,t);else{let g={minX:Math.min(o.bounds.minX,i.minX),maxX:Math.max(o.bounds.maxX,i.maxX),minY:Math.min(o.bounds.minY,i.minY),maxY:Math.max(o.bounds.maxY,i.maxY)};if(t.segments.some((f)=>!Gfn(f.start,g)||!Gfn(f.end,g)))aa(s,"outside-routing-bounds",`Plan ${t.connectionName} leaves the routable SRJ/shared-boundary area`,t);if(t.segments[0]&&!g2(t.segments[0].start,t.sourcePoint))aa(s,"disconnected-trace",`Plan ${t.connectionName} does not start at its source pad`,t);if(t.segments.at(-1)&&!g2(t.segments.at(-1).end,t.exitPoint))aa(s,"disconnected-trace",`Plan ${t.connectionName} does not end at its declared exit`,t);for(let f=1;f<t.segments.length;f++){let y=t.segments[f-1],x=t.segments[f];if(!g2(y.end,x.start))aa(s,"disconnected-trace",`Plan ${t.connectionName} has a gap between route segments`,t);let C=JY(t).find((b)=>g2(y.end,b.center)&&b.spanLayers.includes(y.layer)&&b.spanLayers.includes(x.layer));if(y.layer!==x.layer&&!C)aa(s,"disconnected-trace",`Plan ${t.connectionName} changes layers without a connecting via`,t)}}let d=[...t.segments,...t.planeEndpointSegments??[]].reduce((g,f)=>g+Ut(f.start,f.end),0);if(Math.abs(d-t.length)>0.000001)aa(s,"plan-length-mismatch",`Plan ${t.connectionName} declares ${t.length.toFixed(6)}mm but contains ${d.toFixed(6)}mm of routed copper`,t);let u=Ufn({trace:t.trace,plan:t,issues:s}),_=t.segments.filter((g)=>Ut(g.start,g.end)>Ih);if(u.length!==_.length||u.some((g,f)=>{let y=_[f];return!y||g.layer!==y.layer||Math.abs(g.width-y.width)>Ih||!g2(g.start,y.start)||!g2(g.end,y.end)}))aa(s,"trace-plan-mismatch",`Trace ${t.trace.pcb_trace_id} does not encode its declared route segments`,t);if(t.planeEndpointTrace||t.planeEndpointSegments||t.planeEndpointVia)if(!t.planeEndpointTrace||!t.planeEndpointSegments||!t.planeEndpointVia)aa(s,"trace-plan-mismatch",`Plane endpoint geometry for ${t.connectionName} is incomplete`,t);else{let g=Ufn({trace:t.planeEndpointTrace,plan:t,issues:s});if(g.length!==t.planeEndpointSegments.length||g.some((f,y)=>{let x=t.planeEndpointSegments?.[y];return!x||f.layer!==x.layer||Math.abs(f.width-x.width)>Ih||!g2(f.start,x.start)||!g2(f.end,x.end)})||Ut(t.planeEndpointVia.center,t.targetPoint)<=Ih)aa(s,"trace-plan-mismatch",`Trace ${t.planeEndpointTrace.pcb_trace_id} does not encode a valid offset plane-to-endpoint dogbone`,t)}let p=t.trace.route.find((g)=>("x"in g)&&("y"in g)),m=[...t.trace.route].reverse().find((g)=>("x"in g)&&("y"in g));if(!p||!m||!g2(p,t.sourcePoint)||!g2(m,t.exitPoint))aa(s,"disconnected-trace",`Trace ${t.trace.pcb_trace_id} does not span its source and exit`,t);let A=r.connections.find((g)=>g.name===t.connectionName);if(t.termination.type==="boundary")if(!A)aa(s,"output-connection-missing",`Boundary connection ${t.connectionName} was removed from the output`,t);else{let g=A.pointsToConnect[t.sourcePointIndex];if(!g||!g2(g,t.exitPoint)||!("layer"in g)||g.layer!==t.targetLayer)aa(s,"output-exit-mismatch",`Output connection ${t.connectionName} is not attached to its fanout exit`,t);for(let f=0;f<a.pointsToConnect.length;f++){if(f===t.sourcePointIndex)continue;let y=a.pointsToConnect[f],x=A.pointsToConnect[f];if(!y||!x||!Vfn(y,x))aa(s,"downstream-endpoint-lost",`Output connection ${t.connectionName} did not retain downstream endpoint ${f}`,t)}}else if(A)aa(s,"plane-connection-retained",`Plane-terminated connection ${t.connectionName} remains in the output`,t)}function XUr(e,t){let n=qY(e),o=qY(t),r=JY(e),i=JY(t);for(let s of n){for(let a of o)if(s.layer===a.layer&&ad(s.start,s.end,a.start,a.end)<=(s.width+a.width)/2+Ih)return!0;for(let a of i)if(a.spanLayers.includes(s.layer)&&Vr(a.center,s.start,s.end)<=a.diameter/2+s.width/2+Ih)return!0}for(let s of r){for(let a of o)if(s.spanLayers.includes(a.layer)&&Vr(s.center,a.start,a.end)<=s.diameter/2+a.width/2+Ih)return!0;for(let a of i)if(s.spanLayers.some((c)=>a.spanLayers.includes(c))&&Ut(s.center,a.center)<=(s.diameter+a.diameter)/2+Ih)return!0}return!1}function jUr(e){let{plans:t,inputSrj:n,sharedBoundary:o,issues:r}=e,i=new Set,s=new Map;for(let c of t)s.set(c,[]);for(let c=0;c<t.length;c++){let l=t[c];if(l.termination.type==="plane"?Boolean(l.via):l.segments.some((h)=>Yfn(h.start,o)||Yfn(h.end,o)))i.add(l);for(let h=c+1;h<t.length;h++){let d=t[h];if(!Y5(n,l.connectionName,d.connectionName)||!XUr(l,d))continue;s.get(l).push(d),s.get(d).push(l)}}let a=[...i];while(a.length>0){let c=a.shift();for(let l of s.get(c)??[]){if(i.has(l))continue;i.add(l),a.push(l)}}for(let c of t){if(i.has(c))continue;aa(r,"not-broken-out",c.termination.type==="boundary"?`Connection ${c.connectionName} has no continuous same-net copper path to the shared boundary`:`Plane connection ${c.connectionName} has no terminating via`,c)}return i}function KUr(e){let{plans:t,inputSrj:n,clearance:o,allowBlindAndBuriedVias:r,issues:i}=e;for(let s of t){if(zde(s,o).some((c)=>c.kind!=="clearance"))aa(i,"source-pad-reentry",`Trace ${s.connectionName} returns into its source pad after leaving it`,s);let a=qY(s);for(let c=0;c<a.length;c++){let l=a[c];for(let h of n.obstacles){if(!h.layers.includes(l.layer))continue;if(P6(n,h,s.connectionName))continue;if(c===0&&h.obstacleId===s.sourceObstacle.obstacleId&&l.layer===s.sourceLayer)continue;if(que({inputSrj:n,segment:l,bodyObstacle:h,connectionName:s.connectionName}))continue;let d=Wl(l,h),u=l.width/2+o;if(d<u-0.000000001)aa(i,"obstacle-clearance",`Trace ${s.connectionName} on ${l.layer} is ${d.toFixed(4)}mm from different-net obstacle ${h.obstacleId}; ${u.toFixed(4)}mm is required`,s)}}for(let c of JY(s))for(let l of n.obstacles){if(!l.layers.some((u)=>c.spanLayers.includes(u))||P6(n,l,s.connectionName))continue;let h=X5(c.center,l),d=c.diameter/2+o;if(h<d-0.000000001)aa(i,"via-obstacle-clearance",`Via ${s.connectionName} is ${h.toFixed(4)}mm from different-net obstacle ${l.obstacleId} on its layer span; ${d.toFixed(4)}mm is required`,s)}for(let c of WP(n,r)){if(s.connectionName===c.connectionName||Y5(n,s.connectionName,c.connectionName))continue;for(let l of qY(s)){for(let h of c.segments)if(!V_(l,h,o))aa(i,"different-net-trace-clearance",`Trace ${s.connectionName} violates routed trace ${c.trace.pcb_trace_id} on ${l.layer}`,s,c.connectionName);for(let h of c.vias)if(h.spanLayers.includes(l.layer)&&Vr(h.center,l.start,l.end)<h.diameter/2+l.width/2+o-0.000000001)aa(i,"different-net-trace-via-clearance",`Trace ${s.connectionName} violates a via in routed trace ${c.trace.pcb_trace_id} on ${l.layer}`,s,c.connectionName)}for(let l of JY(s)){for(let h of c.segments)if(l.spanLayers.includes(h.layer)&&Vr(l.center,h.start,h.end)<l.diameter/2+h.width/2+o-0.000000001)aa(i,"different-net-trace-via-clearance",`Via ${s.connectionName} violates routed trace ${c.trace.pcb_trace_id} on ${h.layer}`,s,c.connectionName);for(let h of c.vias)if(l.spanLayers.some((d)=>h.spanLayers.includes(d))&&Ut(l.center,h.center)<(l.diameter+h.diameter)/2+o-0.000000001)aa(i,"different-net-via-clearance",`Via ${s.connectionName} violates a via in routed trace ${c.trace.pcb_trace_id}`,s,c.connectionName)}}}for(let s=0;s<t.length;s++){let a=t[s];for(let c=s+1;c<t.length;c++){let l=t[c];if(Y5(n,a.connectionName,l.connectionName))continue;let h=qY(a),d=qY(l),u=JY(a),_=JY(l);for(let p of h){for(let m of d)if(!V_(p,m,o))aa(i,"different-net-trace-clearance",`Different-net traces ${a.connectionName} and ${l.connectionName} intersect or violate clearance on ${p.layer}`,a,l.connectionName);for(let m of _)if(m.spanLayers.includes(p.layer)&&Vr(m.center,p.start,p.end)<m.diameter/2+p.width/2+o-0.000000001)aa(i,"different-net-trace-via-clearance",`Trace ${a.connectionName} violates via clearance to ${l.connectionName} on ${p.layer}`,a,l.connectionName)}for(let p of u){for(let m of d)if(p.spanLayers.includes(m.layer)&&Vr(p.center,m.start,m.end)<p.diameter/2+m.width/2+o-0.000000001)aa(i,"different-net-trace-via-clearance",`Via ${a.connectionName} violates trace clearance to ${l.connectionName} on ${m.layer}`,a,l.connectionName);for(let m of _)if(p.spanLayers.some((A)=>m.spanLayers.includes(A))&&Ut(p.center,m.center)<(p.diameter+m.diameter)/2+o-0.000000001)aa(i,"different-net-via-clearance",`Vias ${a.connectionName} and ${l.connectionName} violate clearance on an overlapping layer span`,a,l.connectionName)}}}}function $Ur(e,t,n){let o=e.differentialPairs;if(o===void 0)return;if(!Array.isArray(o)){aa(n,"invalid-differential-pair","Differential pairs must be an array");return}let r=new Map;e.connections.forEach((i,s)=>{let a=r.get(i.name)??[];a.push(s),r.set(i.name,a)}),o.forEach((i,s)=>{let a=i,c=a?.connectionNames,l=a?.lengthTolerance;if(!Array.isArray(c)||c.length!==2||c.some((_)=>typeof _!=="string"||_.length===0)||c[0]===c[1]||typeof l!=="number"||!Number.isFinite(l)||l<0){aa(n,"invalid-differential-pair",`Differential pair ${s} must name two distinct connections and a finite nonnegative length tolerance`);return}let h=[];for(let _ of c){let p=r.get(_),m=t.get(_);if(p?.length!==1||m?.length!==1||m[0].connectionIndex!==p[0]){aa(n,"invalid-differential-pair",`Differential pair ${s} cannot resolve exactly one original plan for connection ${_}`);return}h.push(m[0])}let d=h.map((_)=>qY(_).reduce((p,m)=>p+Ut(m.start,m.end),0));if(d.some((_)=>!Number.isFinite(_))){aa(n,"invalid-differential-pair",`Differential pair ${s} has nonfinite routed copper length`,h[0],c[1]);return}let u=Math.abs(d[0]-d[1]);if(u>l+Ih)aa(n,"differential-pair-length-skew",`Differential pair ${c[0]}/${c[1]} has ${u.toFixed(6)}mm routed-length skew; ${l.toFixed(6)}mm is allowed`,h[0],c[1])})}function qUr(e){let{inputSrj:t,outputSrj:n,plans:o,preparedBuses:r,sharedBoundary:i,clearance:s,allowBlindAndBuriedVias:a=!0}=e,c=[],l=new Map,h=new Map(r.map((u)=>[u.busId,u]));for(let u of o){let _=l.get(u.connectionName)??[];_.push(u),l.set(u.connectionName,_)}$Ur(t,l,c);for(let u of r){if(u.maxLengthSkew===void 0)continue;let _=o.filter((A)=>A.busId===u.busId);if(_.length<2)continue;let p=_.map((A)=>A.length),m=Math.max(...p)-Math.min(...p);if(m>u.maxLengthSkew+0.000001)aa(c,"bus-length-skew",`Bus ${u.busId} has ${m.toFixed(6)}mm routed-length skew; ${u.maxLengthSkew.toFixed(6)}mm is allowed`,_[0])}for(let u of t.connections){let _=l.get(u.name)??[];if(_.length===0)aa(c,"missing-plan",`Connection ${u.name} has no fanout plan`);else if(_.length>1)aa(c,"duplicate-plan",`Connection ${u.name} has ${_.length} fanout plans`,_[0])}for(let u of o){if(!t.connections.some((_)=>_.name===u.connectionName)){aa(c,"unknown-plan",`Plan ${u.connectionName} is not an input connection`,u);continue}WUr({plan:u,preparedBus:h.get(u.busId),inputSrj:t,outputSrj:n,sharedBoundary:i,issues:c})}let d=jUr({plans:o,inputSrj:t,sharedBoundary:i,issues:c});return KUr({plans:o,inputSrj:t,clearance:s,allowBlindAndBuriedVias:a,issues:c}),{valid:c.length===0,checkedConnectionCount:t.connections.length,brokenOutConnectionCount:new Set([...d].map((u)=>u.connectionName)).size,issues:c}}var Wfn=["#ef4444","#2563eb","#16a34a","#9333ea","#f59e0b","#0891b2","#db2777","#65a30d","#4f46e5","#ea580c"];function JUr(e){if(!Number.isInteger(e)||e<0)throw Error(`FanoutSolver: copper layer index must be a non-negative integer, received ${e}`);return Wfn[e%Wfn.length]}var ZUr=new Set(["top","bottom","inner1","inner2","inner3","inner4","inner5","inner6","inner7","inner8"]),eWr={"0603":{padLength:0.8,padWidth:0.95},"1206":{padLength:0.6,padWidth:1.6},"1206x4_pair":{padLength:0.8,padWidth:0.5}},hue=(e,t)=>{let n=e.indexOf(t);if(n<0)throw Error(`FanoutSolver: cannot visualize unknown copper layer "${t}"`);return n},ade=(e,t)=>`z${[...new Set(t.map((o)=>hue(e,o)))].sort((o,r)=>o-r).join(",")}`,tWr=(e)=>{let t="layers"in e?e.layers:void 0;if(t&&t.length>0)return t;return[e.layer]},nWr=(e,t)=>{if(e.__zLayers&&e.__zLayers.length>0)return[...new Set(e.__zLayers)].filter((n)=>Number.isInteger(n)&&n>=0&&n<t.length).sort((n,o)=>n-o);return[...new Set(e.layers.map((n)=>hue(t,n)))].sort((n,o)=>n-o)},oWr=(e,t,n)=>{let o=hue(e,t),r=hue(e,n);return e.slice(Math.min(o,r),Math.max(o,r)+1)},Xfn=(...e)=>e.find((t)=>typeof t==="number"&&Number.isFinite(t)),rWr=(e)=>{let t=Xfn(e.min_via_hole_diameter,e.minViaHoleDiameter),n=Xfn(e.min_via_pad_diameter,e.minViaPadDiameter,e.minViaDiameter);return Math.max(n??e.minViaDiameter??0.3,t??0)},iWr=(e)=>Object.fromEntries(e.map((t,n)=>[t.name,`hsl(${n*340/e.length}, 100%, 50%)`])),sWr=(e,t,n)=>{let o=(1-Math.abs(2*n-1))*t,r=(e%360+360)%360/60,i=o*(1-Math.abs(r%2-1)),[s,a,c]=r<1?[o,i,0]:r<2?[i,o,0]:r<3?[0,o,i]:r<4?[0,i,o]:r<5?[i,0,o]:[o,0,i],l=n-o/2;return[s,a,c].map((h)=>Math.round((h+l)*255))},cot=(e,t)=>{let o={blue:[0,0,255],orange:[255,165,0],purple:[128,0,128],red:[255,0,0]}[e],r=1,i=/^rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)(?:\s*,\s*([\d.]+))?\s*\)$/.exec(e);if(i)o=[Number(i[1]),Number(i[2]),Number(i[3])],r=i[4]===void 0?1:Number(i[4]);let s=/^hsl\(\s*([\d.-]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%\s*\)$/.exec(e);if(s)o=sWr(Number(s[1]),Number(s[2])/100,Number(s[3])/100);if(!o)return e;let a=+Math.max(0,r*100-t*100).toFixed(2)/100;if(a>=1){let c=o.map((l)=>Math.round(l).toString(16).padStart(2,"0")).join("");return c[0]===c[1]&&c[2]===c[3]&&c[4]===c[5]?`#${c[0]}${c[2]}${c[4]}`:`#${c}`}return`rgba(${o.join(",")},${a})`},aWr=(e)=>{let t=new Set;return e.filter((n)=>{if(t.has(n))return!1;return t.add(n),!0})},cWr=(e)=>{let t=new Map,n=(o,r)=>{if(!o)return;let i=t.get(o)??[];if(!i.includes(r))i.push(r);t.set(o,i)};for(let o of e.connections){let r=o.__rootConnectionNames??[o.name];for(let i of r){n(o.name,i),n(i,i),n(o.__netConnectionName,i);for(let s of o.pointsToConnect)n(s.pointId,i),n(s.pcb_port_id,i)}}return(o)=>{let i=aWr([...o.connectedTo.flatMap((s)=>t.get(s)??[]),...(o.offBoardConnectsTo??[]).flatMap((s)=>t.get(s)??[])]).join(", ");return o.layers.map((s)=>i?`${s}
${i}`:s).join(`
`)}};function lWr(e){let t=rT(e.layerCount),n=(e.traces??[]).some((u)=>u.route.some((_,p)=>{let m=u.route[p+1];return _.route_type==="wire"&&m?.route_type==="wire"&&m.layer===_.layer&&!ZUr.has(_.layer)})),o=new Set(e.connections.map(({name:u})=>u)),r=n?[...new Set((e.traces??[]).map(({connection_name:u})=>u).filter((u)=>u&&!o.has(u)))].map((u)=>({name:u,pointsToConnect:[]})):[],i=[...e.connections,...r],s=iWr(i),a=cWr({...e,connections:i}),c=[],l=[],h=[],d=[];for(let u of i)for(let _ of u.pointsToConnect){let p=tWr(_),m=u.__rootConnectionNames??[u.name];d.push({x:_.x,y:_.y,color:s[u.name],layer:ade(t,p),label:[u.name,m.join(", "),p.join(",")].join(`
`)})}for(let u of e.traces??[]){let _=u.route.filter((m)=>m.route_type==="jumper"),p=(m,A)=>_.some((g)=>Math.abs(m.x-g.start.x)<0.01&&Math.abs(m.y-g.start.y)<0.01&&Math.abs(A.x-g.end.x)<0.01&&Math.abs(A.y-g.end.y)<0.01||Math.abs(m.x-g.end.x)<0.01&&Math.abs(m.y-g.end.y)<0.01&&Math.abs(A.x-g.start.x)<0.01&&Math.abs(A.y-g.start.y)<0.01);for(let m of u.route)if(m.route_type==="via"){let A=oWr(t,m.from_layer,m.to_layer);l.push({center:{x:m.x,y:m.y},radius:(m.via_diameter??rWr(e))/2,fill:n?s[u.connection_name]:"blue",stroke:"none",layer:ade(t,A)})}else if(m.route_type==="through_obstacle")c.push({points:[m.start,m.end],strokeColor:cot(s[u.connection_name]??"purple",0.35),strokeWidth:m.width,strokeDash:[0.1,0.1],layer:ade(t,[m.from_layer,m.to_layer]),label:`${u.connection_name} through_obstacle`});for(let m=0;m<u.route.length-1;m++){let A=u.route[m],g=u.route[m+1];if(A.route_type==="jumper"){let f=s[u.connection_name]??"rgba(255, 165, 0, 0.8)",y=eWr[A.footprint==="1206x4_pair"?"1206x4_pair":"0603"],x=Math.abs(A.end.x-A.start.x)>Math.abs(A.end.y-A.start.y),C=x?y.padLength:y.padWidth,b=x?y.padWidth:y.padLength,I=ade(t,[A.layer]);for(let v of[A.start,A.end])h.push({center:v,width:C,height:b,fill:cot(f,0.5),stroke:"rgba(0, 0, 0, 0.5)",layer:I});c.push({points:[A.start,A.end],strokeColor:"rgba(100, 100, 100, 0.8)",strokeWidth:y.padWidth*0.3,layer:I})}else if(A.route_type==="wire"&&g.route_type==="wire"&&g.layer===A.layer&&!p(A,g)){let f=hue(t,A.layer);c.push({points:[{x:A.x,y:A.y},{x:g.x,y:g.y}],layer:`z${f}`,strokeWidth:A.width,strokeColor:JUr(f),...n?{label:u.connection_name}:{}})}}}for(let u of e.obstacles){if(u.isCopperPour)continue;let _=nWr(u,t);if(_.length===0)throw Error(`FanoutSolver: cannot visualize obstacle "${u.obstacleId??"unknown"}" without a valid layer`);let p=_.length===1?t[_[0]]:void 0,m=cot(p==="bottom"?"blue":"red",0.5**_.length),A=u.shape,g={center:u.center,fill:m,layer:`z${_.join(",")}`,label:a(u)};if(A==="circle")l.push({...g,radius:Math.min(u.width,u.height)/2});else h.push({...g,width:u.width,height:u.height,ccwRotationDegrees:u.ccwRotationDegrees})}for(let u of e.jumpers??[])for(let _ of u.pads)h.push({center:_.center,width:_.width,height:_.height,ccwRotationDegrees:_.ccwRotationDegrees,fill:"rgba(255, 165, 0, 0.3)",stroke:"rgba(255, 165, 0, 0.8)",layer:ade(t,_.layers)});return{rects:h,circles:l,lines:c,points:d}}var tc=YUr(globalThis),hWr=class extends po{constructor(e,t,n,o,r){super();this.solverName=e,this.generator=t,this.getVisualization=n,this.getStats=o,this.getProgress=r,this.MAX_ITERATIONS=1e6}solverName;generator;getVisualization;getStats;getProgress;output;hasOutput=!1;nextInput;getSolverName(){return this.solverName}_step(){if(this.activeSubSolver){if(this.activeSubSolver.step(),this.activeSubSolver.failed){this.failedSubSolvers=[...this.failedSubSolvers??[],this.activeSubSolver],this.error=this.activeSubSolver.error,this.failed=!0,this.activeSubSolver=null;return}if(this.activeSubSolver.solved)this.nextInput=this.activeSubSolver.getOutput(),this.activeSubSolver=null;this.stats=this.getStats();return}let e=this.generator.next(this.nextInput);if(this.nextInput=void 0,this.stats=this.getStats(),e.done){this.output=e.value,this.hasOutput=!0,this.solved=!0;return}if(cue(e.value))this.activeSubSolver=e.value.solver}computeProgress(){return this.getProgress()}getConstructorParams(){return[]}getOutput(){if(!this.solved||!this.hasOutput)throw Error(`${this.solverName}: output requested before completion`);return this.output}visualize(){return this.activeSubSolver?.visualize()??this.getVisualization()}};function cde(e,t){if(!Number.isFinite(t)||t<=0)throw Error(`FanoutSolver: ${e} must be a positive number, received ${t}`);return t}function dWr(e,t){let n=cde("traceWidth",t.traceWidth??e.nominalTraceWidth??e.minTraceWidth),o=cde("viaDiameter",t.viaDiameter??e.minViaPadDiameter??e.min_via_pad_diameter??e.minViaDiameter??Math.max(n*2,0.3)),r=cde("viaHoleDiameter",t.viaHoleDiameter??e.minViaHoleDiameter??e.min_via_hole_diameter??o*0.5);if(r>=o)throw Error(`FanoutSolver: viaHoleDiameter ${r} must be smaller than viaDiameter ${o}`);let i=cde("clearance",t.clearance??e.minViaEdgeToPadEdgeClearance??e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??e.minTraceWidth),s=rT(e.layerCount),a=t.escapeLayers??s;for(let l of a)if(!s.includes(l))throw Error(`FanoutSolver: escape layer "${l}" is not available in a ${e.layerCount}-layer SimpleRouteJson`);if(new Set(a).size!==a.length)throw Error("FanoutSolver: escapeLayers contains duplicates");let c=t.borderDistribution??"preserve";if(c!=="preserve"&&c!=="even")throw Error(`FanoutSolver: borderDistribution must be "preserve" or "even", received "${c}"`);return{traceWidth:n,viaDiameter:o,viaHoleDiameter:r,clearance:i,compactBusTracks:t.compactBusTracks??!1,allowBlindAndBuriedVias:t.allowBlindAndBuriedVias??!0,allowSameNetMerges:t.allowSameNetMerges??!1,densePlaneReservationBusIds:t.densePlaneReservationBusIds??[],denseUnrestrictedPlaneRoutingBusIds:t.denseUnrestrictedPlaneRoutingBusIds??[],singleLayerPushAndShove:t.singleLayerPushAndShove??!1,singleLayerAdaptiveExits:t.singleLayerAdaptiveExits??!1,borderDistribution:c,layerNames:s,escapeLayers:a,maxLayerCombinations:t.maxLayerCombinations===void 0?256:cde("maxLayerCombinations",t.maxLayerCombinations),balanceLayerLoadByConnectionCount:t.balanceLayerLoadByConnectionCount??!1}}function uWr(e,t){let n=new Set,o=Math.max(t.traceWidth+t.clearance,t.viaDiameter+t.clearance),r=Math.max(t.viaDiameter/2+t.clearance,o);for(let i of e){let s=Xi(i.exitEdge,i.preferredExit);if(!i.exitEdge||!s)continue;let a=`${i.exitEdge}:${s}`;if(n.has(a))continue;n.add(a);let c=i.exitEdge==="left"||i.exitEdge==="right"?i.sharedBoundary.maxY-i.sharedBoundary.minY:i.sharedBoundary.maxX-i.sharedBoundary.minX,l=i.cornerBandConnectionCount??i.connections.length,h=(l-1)*o/2,d=c/4-r;if(h>d+0.000001)throw Error(`FanoutSolver: ${s} band on the ${i.exitEdge} edge cannot fit ${l} via-safe exits`)}}function s9e(e,t,n){let o=new Map(t.map((i)=>[i.busId,i.connections.length])),r=new Map;for(let[i,s]of Object.entries(e))r.set(s,(r.get(s)??0)+(n?o.get(i)??1:1));return[...r.values()].reduce((i,s)=>i+s*s,0)}function a9e(e){return e.balanceLayerLoadByConnectionCount?0.25:0.01}function jfn(e,t,n){let o=Number(e.termination.type==="plane")-Number(t.termination.type==="plane");return n?-o:o}function c9e(e){return e.reduce((t,n)=>t+Number(Boolean(n.via))+(n.additionalVias?.length??0)+Number(Boolean(n.planeEndpointVia)),0)}function kJ(e){let t=e.connections.reduce((n,o)=>{let r=e.direction==="left"||e.direction==="right"?o.sourcePoint.x:o.sourcePoint.y;return n+r},0)/e.connections.length;switch(e.direction){case"right":return e.sharedBoundary.maxX-t;case"left":return t-e.sharedBoundary.minX;case"up":return e.sharedBoundary.maxY-t;case"down":return t-e.sharedBoundary.minY}}function qrt(e){let t=e.direction==="left"||e.direction==="right";return e.connections.some((n)=>{let o=n.exitTargetPoint??n.targetPoint,r=t?n.sourcePoint.y:n.sourcePoint.x,i=t?o.y:o.x;return Math.abs(r-i)>0.000001})}function eZ(e){if(e.connections.length===0||e.connections.some((o)=>!o.hasExplicitLayeredExitTarget||!o.exitTargetPoint?.layer))return;let t=new Set(e.connections.map((o)=>o.exitTargetPoint.layer));if(t.size!==1)return;let[n]=t;return n}function pWr(e){let t=e.direction==="left"||e.direction==="right",n=t?e.xCoordinates:e.yCoordinates,o=e.connections.reduce((i,s)=>i+(t?s.sourcePoint.x:s.sourcePoint.y),0)/e.connections.length,r=e.direction==="right"||e.direction==="up"?Math.max(...n):Math.min(...n);return Math.abs(o-r)<0.000001}function Jrt(e){let t=e.direction==="left"||e.direction==="right",n=t?e.xCoordinates:e.yCoordinates,o=e.connections.reduce((s,a)=>s+(t?a.sourcePoint.x:a.sourcePoint.y),0)/e.connections.length,r=e.direction==="right"||e.direction==="up"?Math.max(...n):Math.min(...n),i=t?e.pitchX:e.pitchY;return Math.round(Math.abs(o-r)/i)}function mWr(e){let{buses:t,escapeLayers:n,escapeLayersByBusId:o,preferOrderedCoordinatedWindingLayers:r}=e,i={},s=new Map,a=0;for(let c of t){let l=s.get(c.componentId)??new Set;l.add(c.direction),s.set(c.componentId,l)}for(let c of t){let l=c.connections[0]?.sourceLayer;if(!l)throw Error(`FanoutSolver: bus "${c.busId}" has no connections`);if(c.termination.type==="plane"){i[c.busId]=c.termination.layer;continue}let h=o[c.busId]??n,d=h.filter((_)=>_!==l),u=eZ(c);if(u&&h.includes(u))i[c.busId]=u;else if(!_P(c)&&h.includes(l)&&(qrt(c)||pWr(c)))i[c.busId]=l;else if(d.length>0){let _=c.connections.map((y)=>y.sourcePoint.x),p=c.connections.map((y)=>y.sourcePoint.y),m=(y)=>t.filter((x)=>{let C=x.connections[0]?.sourcePoint;return x.termination.type==="boundary"&&C!==void 0&&C.x>Math.min(..._)+0.000000001&&C.x<Math.max(..._)-0.000000001&&C.y>Math.min(...p)+0.000000001&&C.y<Math.max(...p)-0.000000001&&eZ(x)===y&&RCn({singletonBus:x,singletonTargetLayer:y,wideBuses:[c]})}).length,A=d.toSorted((y,x)=>m(y)-m(x));if(m(A[0])<m(d[0])){i[c.busId]=A[0];continue}if(r&&_P(c)){let y=Xi(c.exitEdge,c.preferredExit),x=(C)=>{if(!c.exitEdge||c.connections.length<8)return 0;let b=c.exitEdge==="left"||c.exitEdge==="right",I=b?"y":"x",v=b?c.sharedBoundary.minY:c.sharedBoundary.minX,P=b?c.sharedBoundary.maxY:c.sharedBoundary.maxX;if(!y){let N=c.connections.map((Y)=>{let X=Y.exitTargetPoint??Y.targetPoint;return Math.max(v,Math.min(P,X[I]))}),D=Math.min(...N),L=Math.max(...N),H=b?"x":"y",V=c.exitEdge==="right"||c.exitEdge==="top"?1:-1,O=Math.min(...c.connections.map((Y)=>V*Y.sourcePoint[H])),U=Math.min(...c.connections.map((Y)=>Y.sourcePoint[I])),j=Math.max(...c.connections.map((Y)=>Y.sourcePoint[I]));return t.reduce((Y,X)=>{let K=Xi(X.exitEdge,X.preferredExit);if(X===c||X.termination.type!=="boundary"||X.componentId!==c.componentId||X.exitEdge!==c.exitEdge||!K||eZ(X)!==C)return Y;let J=v+(P-v)*(K==="minimum"?0.25:0.75),ee=(Math.max(X.connections.length,X.cornerBandConnectionCount??0)-1)*Math.max(e.traceWidth+e.clearance,e.viaDiameter+e.clearance)/2,se=e.traceWidth+e.clearance,ne=L+se>=J-ee&&D-se<=J+ee,re=Math.max(...X.connections.map((Z)=>V*Z.sourcePoint[H]))<O-0.000000001&&Math.min(...X.connections.map((Z)=>Z.sourcePoint[I]))<=j+se&&Math.max(...X.connections.map((Z)=>Z.sourcePoint[I]))>=U-se;return Y+(ne||re?X.connections.length:0)},0)}let M=v+(P-v)*(y==="minimum"?0.25:0.75),B=Math.max(e.traceWidth+e.clearance,e.viaDiameter+e.clearance),T=(Math.max(c.connections.length,c.cornerBandConnectionCount??0)-1)*B/2;return t.reduce((N,D)=>{if(D===c||D.termination.type!=="boundary"||D.componentId!==c.componentId||D.exitEdge!==c.exitEdge||Xi(D.exitEdge,D.preferredExit)||eZ(D)!==C)return N;return N+D.connections.filter((L)=>{let H=L.exitTargetPoint??L.targetPoint,V=Math.max(v,Math.min(P,H[I]));return Math.abs(V-M)<=T+e.traceWidth+e.clearance}).length},0)};i[c.busId]=d.toSorted((C,b)=>x(C)-x(b))[0];continue}let g=s.get(c.componentId);if(g.has("left")&&g.has("right")||g.has("up")&&g.has("down")){let y=Jrt(c);i[c.busId]=d[Math.max(y-1,0)%d.length]}else i[c.busId]=d[a%d.length],a++}else i[c.busId]=l}return i}function _Wr(e){let{initialAssignment:t,generatedAssignments:n,maxAssignments:o}=e,r=JSON.stringify(t);return[t,...n.filter((i)=>JSON.stringify(i)!==r)].slice(0,o)}function _P(e){return Boolean(e.exitEdge&&e.termination.type==="boundary"&&e.connections.length>0&&e.connections.every((t)=>t.hasExplicitLayeredExitTarget===!0))}function Zrt(e){let t=e.length,n=e.filter((o)=>o===1).length;return(t===5||t===6||t===7)&&n===1||t===8&&(n===1||n===2)||t===9&&n>=1&&n<=3}function gWr(e){if(!Zrt(e))return 0;let t=e.filter((n)=>n===1).length;return Math.max(1,t-1)}function RCn(e){let t=e.singletonBus.connections[0]?.sourcePoint;if(e.singletonBus.connections.length!==1||!t)return!1;return e.wideBuses.some((n)=>{let o=n.routableEscapeLayers??n.allowedLayers??[];if(n.connections.length<8||n.componentId!==e.singletonBus.componentId||n.exitEdge!==e.singletonBus.exitEdge||o.length<2||!o.includes(e.singletonTargetLayer))return!1;let r=n.connections.map((s)=>s.sourcePoint.x),i=n.connections.map((s)=>s.sourcePoint.y);return t.x>=Math.min(...r)-0.000000001&&t.x<=Math.max(...r)+0.000000001&&t.y>=Math.min(...i)-0.000000001&&t.y<=Math.max(...i)+0.000000001})}function AWr(e){let t=Math.max(e.traceWidth+e.clearance,e.viaDiameter+e.clearance);return-e.leadingLaneCount*t/2}function fWr(e){if(e.boundaryBusCount===5||e.boundaryBusCount>9)return!1;if(e.boundaryBusCount===6||e.boundaryBusCount===7||e.boundaryBusCount===8||e.boundaryBusCount===9)return e.connectionCount>2&&e.rawSkew-e.maximumSkew>Math.max(1,e.maximumSkew*0.5);return e.rawSkew-e.maximumSkew>Math.max(1,e.maximumSkew*0.25)}function due(e){let t=e.connections[0],n=t?.exitTargetPoint,o=0;if(t&&n){let r=n.x-t.sourcePoint.x,i=n.y-t.sourcePoint.y;o=e.direction==="right"?r:e.direction==="left"?-r:e.direction==="up"?i:-i}return{isCorner:Boolean(Xi(e.exitEdge,e.preferredExit)),targetProjection:o}}function yWr(e,t){let n=due(e),o=due(t);return Number(n.isCorner)-Number(o.isCorner)||(n.isCorner&&o.isCorner?n.targetProjection-o.targetProjection:0)||e.busId.localeCompare(t.busId)}function xWr(e,t){let n=due(e),o=due(t);return Number(n.isCorner)-Number(o.isCorner)||(n.isCorner&&o.isCorner?Number(n.targetProjection>0)-Number(o.targetProjection>0):0)||e.busId.localeCompare(t.busId)}function CWr(e){let{pairBuses:t}=e,n=t[0],o=n?.connections[0]?.sourceLayer;if(e.boundaryBusCount!==7&&e.boundaryBusCount!==8&&e.boundaryBusCount!==9||t.length!==3||n===void 0||n.exitEdge===void 0||n.assignedLayer===void 0||o===void 0||t.some((i)=>i.connections.length!==2||i.componentId!==n.componentId||i.exitEdge!==n.exitEdge||i.assignedLayer!==n.assignedLayer||i.connections.some((s)=>{let a=s.exitTargetPoint;return s.sourceLayer!==o||a?.layer!==n.assignedLayer||!Number.isFinite(s.sourcePoint.x)||!Number.isFinite(s.sourcePoint.y)||!Number.isFinite(a?.x)||!Number.isFinite(a?.y)})))return null;let r=(i)=>Math.max(...i.connections.map((s)=>{let a=s.exitTargetPoint;return Math.hypot(a.x-s.sourcePoint.x,a.y-s.sourcePoint.y)}));return t.map((i)=>Number(r(i).toFixed(9)))}function bWr(e){let{bus:t,srj:n,config:o,staticClearanceCache:r}=e,i=t.allowedLayers,s=i===void 0?o.escapeLayers:o.escapeLayers.filter((l)=>i.includes(l));if(_P(t))return s;let a=s.filter((l)=>GY({srj:n,bus:t,targetLayer:l,acceptedPlans:[],layerNames:o.layerNames,traceWidth:o.traceWidth,viaDiameter:o.viaDiameter,viaHoleDiameter:o.viaHoleDiameter,clearance:o.clearance,compactBusTracks:o.compactBusTracks,allowBlindAndBuriedVias:o.allowBlindAndBuriedVias,allowSameNetMerges:o.allowSameNetMerges,staticClearanceCache:r})!==null);return a.length>0?a:s}var pve=class extends po{constructor(e,t={}){super();this.inputSrj=e,this.options=t,this.routingSrj={...e,obstacles:[...e.obstacles]},this.config=dWr(e,t),this.preparedBuses=WGr(this.routingSrj,t),uWr(this.preparedBuses,this.config);for(let r of this.preparedBuses){for(let s of r.connections){if(!s.hasExplicitLayeredExitTarget)continue;let a=s.exitTargetPoint?.layer;if(typeof a!=="string"||a.length===0||!this.config.layerNames.includes(a))throw Error(`FanoutSolver: connection exit target for "${s.connection.name}" uses unavailable layer "${String(a)}"`)}for(let s of r.allowedLayers??[])if(!this.config.layerNames.includes(s))throw Error(`FanoutSolver: bus "${r.busId}" allows unavailable layer "${s}"`);if(r.termination.type==="boundary"&&r.allowedLayers!==void 0&&!r.allowedLayers.some((s)=>this.config.escapeLayers.includes(s)))throw Error(`FanoutSolver: bus "${r.busId}" has no allowed layer in escapeLayers`);if(r.routableEscapeLayers=this.config.escapeLayers.filter((s)=>r.allowedLayers?.includes(s)??!0),r.termination.type!=="plane")continue;let i=r.termination.layer;if(!this.config.layerNames.includes(i))throw Error(`FanoutSolver: plane-terminated bus "${r.busId}" targets unavailable layer "${i}"`);if(r.allowedLayers!==void 0&&!r.allowedLayers.includes(i))throw Error(`FanoutSolver: plane-terminated bus "${r.busId}" targets disallowed layer "${i}"`);if(r.connections.some((s)=>s.sourceLayer===i))throw Error(`FanoutSolver: plane-terminated bus "${r.busId}" must target a layer below its source pad`)}this.boundaryBuses=this.preparedBuses.filter((r)=>r.termination.type==="boundary"),this.fixedPlaneAssignments=Object.fromEntries(this.preparedBuses.flatMap((r)=>r.termination.type==="plane"?[[r.busId,r.termination.layer]]:[]));let n=this.preparedBuses.length*3+8,o=this.boundaryBuses.length+1+this.config.maxLayerCombinations*n+this.preparedBuses.length*2+20;this.MAX_ITERATIONS=Math.max(1e4,o)}inputSrj;options;preparedBuses;attempts=[];layerAssignments=[];config;routingSrj;escapeLayersByBusId={};boundaryBuses;fixedPlaneAssignments;evaluatedAssignmentKeys=new Set;queuedAssignmentKeys=new Set;assignmentRepairDepthByKey=new Map;pendingRepairAssignments=[];routeStaticClearanceCache=new Map;routingPrefixCache=new Map;layerReservedRoutingEvaluated=!1;groupedBeamEvaluated=!1;routingInitialized=!1;nextCandidateLayerBusIndex=0;nextAssignmentIndex=0;nextGeneratedAssignmentIndex=0;activeOperation=null;inProgressPlans=[];activeRoutingVisualization=null;activeAdaptiveVisualization=null;bestAttempt=null;lengthMatchingFailure=null;endpointCompletion=null;getSolverName(){return"FanoutSolver"}shouldTryLayerReservedRouting(){if(this.config.allowBlindAndBuriedVias||this.boundaryBuses.length<4)return!1;if((this.config.compactBusTracks||this.config.borderDistribution==="even")&&this.boundaryBuses.some((i)=>i.connections.length>1&&i.connections.some((s)=>!s.hasExplicitLayeredExitTarget)))return!1;let e=this.preparedBuses[0],t=this.boundaryBuses.reduce((i,s)=>i+s.connections.length,0);if(this.inputSrj.connections.length-t<t||this.preparedBuses.some((i)=>i.componentId!==e.componentId||i.connections.some((s)=>s.sourceLayer!=="top"))||this.boundaryBuses.some((i)=>!i.exitEdge||i.exitEdge!==this.boundaryBuses[0].exitEdge||i.connections.length>8||!i.allowedLayers?.length||i.allowedLayers.some((s)=>!this.config.escapeLayers.includes(s))))return!1;let o=new Map,r=!1;for(let i of this.boundaryBuses){let s=i.allowedLayers.filter((a)=>a!=="top");if(!s.length)return!1;if(s.length>1)r=!0;if(s.length===1&&i.connections.length>2){let a=s[0];o.set(a,(o.get(a)??0)+1)}}return r&&[...o.values()].some((i)=>i>1)}*evaluateLayerReservedRoutingSteps(e=!1,t=!1){let n={...this.config,sourceOriginRouting:e,srj:this.routingSrj,buses:this.preparedBuses},o=t?cGr(n):MUr(n),r=o.next();while(!r.done){if(cue(r.value)){this.stats={...this.stats,phase:"layer-reserved-route-layer",workUnit:r.value.routedConnectionCount,workUnitCount:this.inputSrj.connections.length,routedConnections:`${r.value.routedConnectionCount}/${this.inputSrj.connections.length}`,routingIterations:r.value.iterations};let l=yield r.value;r=o.next(l);continue}this.stats={...this.stats,phase:`layer-reserved-${r.value.phase}`,targetLayer:r.value.layer,workUnit:r.value.routedConnectionCount,workUnitCount:this.inputSrj.connections.length,routedConnections:`${r.value.routedConnectionCount}/${this.inputSrj.connections.length}`,routingIterations:r.value.iterations},yield,r=o.next()}if(!r.value||r.value.length!==this.inputSrj.connections.length)return null;let i=this.normalizeCompletePlanCorners(r.value);if(!i)return null;let s=TY({inputSrj:this.inputSrj,plans:i,layerNames:this.config.layerNames});if(!this.validateCompletePlans(i,s).valid)return null;let a=Object.fromEntries(i.map((l)=>[l.busId,l.targetLayer])),c=i.reduce((l,h)=>l+h.length,0)+c9e(i)*0.1+s9e(a,this.preparedBuses,this.config.balanceLayerLoadByConnectionCount)*a9e(this.config);return this.inProgressPlans=[...i],{plans:i,outputSrj:s,stopAfterCompleteValidation:!0,blockingBusIds:[],summary:{assignmentIndex:0,busLayerAssignments:a,routedBusCount:this.preparedBuses.length,routedConnectionCount:i.length,failedBusIds:[],score:c}}}stepRoutingInitialization(){let e=this.boundaryBuses[this.nextCandidateLayerBusIndex];if(e){this.escapeLayersByBusId[e.busId]=bWr({bus:e,srj:this.routingSrj,config:this.config,staticClearanceCache:this.routeStaticClearanceCache}),this.nextCandidateLayerBusIndex++,this.stats={phase:"discover-candidate-layers",bus:e.busId,busIndex:this.nextCandidateLayerBusIndex,busCount:this.boundaryBuses.length};return}let t=CVr({busIds:this.boundaryBuses.map((n)=>n.busId),layers:this.config.escapeLayers,layersByBusId:this.escapeLayersByBusId,maxAssignments:this.config.maxLayerCombinations}).map((n)=>({...n,...this.fixedPlaneAssignments}));this.layerAssignments.push(..._Wr({initialAssignment:mWr({buses:this.preparedBuses,escapeLayers:this.config.escapeLayers,escapeLayersByBusId:this.escapeLayersByBusId,traceWidth:this.config.traceWidth,viaDiameter:this.config.viaDiameter,clearance:this.config.clearance,preferOrderedCoordinatedWindingLayers:this.config.densePlaneReservationBusIds.length>0||this.config.denseUnrestrictedPlaneRoutingBusIds.length>0||wfn(this.preparedBuses,this.config.allowBlindAndBuriedVias)}),generatedAssignments:t,maxAssignments:this.config.maxLayerCombinations})),this.routingInitialized=!0,this.stats={phase:"prepare-layer-assignments",assignmentCount:this.layerAssignments.length}}*initializeRoutingSteps(){while(!this.routingInitialized)if(this.stepRoutingInitialization(),!this.routingInitialized)yield}setInProgressPlans(e){this.inProgressPlans=[...e.plans],this.stats={...this.stats,phase:e.phase,...e.strategy?{routingStrategy:e.strategy}:{},...e.unitIndex!==void 0?{workUnit:e.unitIndex}:{},...e.unitCount!==void 0?{workUnitCount:e.unitCount}:{},...e.busId?{bus:e.busId}:{},routedConnections:`${e.plans.length}/${this.inputSrj.connections.length}`}}visualizeCurrentState(){let e=this.endpointCompletion?.simpleRouteJson??(!this.solved&&!this.failed&&this.inProgressPlans.length>0?TY({inputSrj:this.inputSrj,plans:this.inProgressPlans,layerNames:this.config.layerNames}):void 0)??this.bestAttempt?.outputSrj??this.inputSrj;return lWr(e)}visualizeWorkState(e){let t=this.visualizeCurrentState(),n=this.preparedBuses[0]?.sharedBoundary??this.inputSrj.bounds,o=typeof this.stats.bus==="string"?this.stats.bus:void 0,r=o?this.preparedBuses.find((d)=>d.busId===o):void 0,i=n.maxX-n.minX,s=n.maxY-n.minY,a=Math.max(Math.min(i,s)*0.025,0.25),c=typeof this.stats.phase==="string"?this.stats.phase:"starting",l=[typeof this.stats.routeConnection==="string"?`connection ${this.stats.routeConnection}`:void 0,typeof this.stats.searchBatch==="number"?`batch ${this.stats.searchBatch}`:void 0,typeof this.stats.expandedStates==="number"?`${this.stats.expandedStates.toLocaleString()} states`:void 0].filter(Boolean).join(" · "),h=`${e}: ${c}`;return{...Nb(t,{rects:[{center:{x:(n.minX+n.maxX)/2,y:(n.minY+n.maxY)/2},width:i,height:s,fill:"rgba(0, 0, 0, 0)",stroke:"rgba(14, 165, 233, 0.8)",label:`${e} working boundary`}],circles:(r?.connections??[]).map((d)=>({center:d.sourcePoint,radius:Math.max(a,Math.min(d.sourceObstacle.width,d.sourceObstacle.height)*0.6),fill:"rgba(250, 204, 21, 0.25)",stroke:"#f59e0b",label:`active bus ${o}: ${d.connection.name}`})),texts:[{x:n.minX,y:n.maxY+a*2,text:`${e} · ${c}${l?` · ${l}`:""}`,color:"#0f172a",fontSize:a*1.5,anchorSide:"bottom_left"}]}),title:h}}visualizeBoundaryRoutingState(){if(!this.activeRoutingVisualization)return this.visualizeWorkState("BoundaryBusRoutingSolver");return{...Nb(this.visualizeCurrentState(),this.activeRoutingVisualization),title:this.activeRoutingVisualization.title}}visualizeAdaptiveRoutingState(){if(this.activeAdaptiveVisualization)return this.activeAdaptiveVisualization;let e=this.preparedBuses[0]?.sharedBoundary??this.inputSrj.bounds,t=e.maxX-e.minX,n=e.maxY-e.minY,o=Math.max(Math.min(t,n)*0.02,0.2);return{title:"SingleLayerAdaptiveExitSolver: preparing flow grid",rects:[{center:{x:(e.minX+e.maxX)/2,y:(e.minY+e.maxY)/2},width:t,height:n,fill:"rgba(0, 0, 0, 0)",stroke:"rgba(14, 165, 233, 0.9)",label:"adaptive flow grid boundary"}],points:this.preparedBuses.flatMap((r)=>r.connections.map((i)=>({...i.sourcePoint,color:"#f97316",label:"adaptive route source"}))),texts:[{x:e.minX,y:e.maxY+o*2,text:"preparing adaptive flow grid",color:"#0f172a",fontSize:o*1.5,anchorSide:"bottom_left"}]}}startOperation(e){let t=this.createWorkSolver(e.name,e.generator,e.getProgress);this.MAX_ITERATIONS=Math.max(this.MAX_ITERATIONS,this.iterations+t.MAX_ITERATIONS+1),this.activeOperation={solver:t,onSolved:e.onSolved},this.activeSubSolver=t}createWorkSolver(e,t,n,o){return new hWr(e,t,o??(()=>this.visualizeWorkState(e)),()=>({...this.stats}),n??(()=>0))}*routeBusAlternativesWorkSteps(e,t){let n=z8e(e,t,!0),o=n.next();while(!o.done){let{winding:r}=o.value;if(r.visualization)this.activeRoutingVisualization=r.visualization;this.stats={...this.stats,phase:"route-boundary-bus-connection",bus:o.value.busId,targetLayer:o.value.targetLayer,routeOrderAttempt:r.routeOrderAttempt,routeConnection:`${r.connectionIndex+1}/${r.connectionCount}`,connection:r.connectionName,searchBatch:r.searchBatch,expandedStates:r.expandedStateCount,connectionComplete:r.connectionComplete},yield,o=n.next()}return o.value}stepActiveOperation(){let e=this.activeOperation;if(!e)return;if(e.solver.step(),e.solver.failed){this.failedSubSolvers=[...this.failedSubSolvers??[],e.solver],this.error=e.solver.error,this.failed=!0,this.activeOperation=null,this.activeSubSolver=null;return}if(!e.solver.solved)return;let t=e.solver.getOutput();this.activeOperation=null,this.activeSubSolver=null,e.onSolved(t)}completeBestAttemptEndpoints(){if(!this.options.completeOriginalEndpoints||this.endpointCompletion||!this.bestAttempt)return;this.endpointCompletion=NVr({inputSrj:this.routingSrj,fanoutSrj:this.bestAttempt.outputSrj,plans:this.bestAttempt.plans,traceWidth:this.config.traceWidth,viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,clearance:this.config.clearance,allowBlindAndBuriedVias:this.config.allowBlindAndBuriedVias,effort:this.options.endpointCompletionEffort,routeDownstreamConnections:this.options.routeDownstreamConnections})}getValidationBoundary(){if(this.options.sharedBoundary)return this.options.sharedBoundary;let e=this.preparedBuses[0]?.sharedBoundary;if(!e)return this.inputSrj.bounds;return this.preparedBuses.slice(1).reduce((t,n)=>({minX:Math.min(t.minX,n.sharedBoundary.minX),maxX:Math.max(t.maxX,n.sharedBoundary.maxX),minY:Math.min(t.minY,n.sharedBoundary.minY),maxY:Math.max(t.maxY,n.sharedBoundary.maxY)}),{...e})}validateCompletePlans(e,t){return qUr({inputSrj:this.inputSrj,outputSrj:t,plans:e,preparedBuses:this.preparedBuses,sharedBoundary:this.getValidationBoundary(),clearance:this.config.clearance,allowBlindAndBuriedVias:this.config.allowBlindAndBuriedVias})}matchCompletePlanLengths(e,t={}){return yx({plans:e,preparedBuses:this.preparedBuses,inputSrj:this.inputSrj,sharedBoundary:this.getValidationBoundary(),clearance:this.config.clearance,allowBlindAndBuriedVias:this.config.allowBlindAndBuriedVias,allowSameNetMerges:this.config.allowSameNetMerges,...t})}normalizeCompletePlanCorners(e){if(this.config.allowBlindAndBuriedVias)return[...e];let t=Jst({...this.config,inputSrj:this.inputSrj,preparedBuses:this.preparedBuses,plans:e,repairPlaneSourceCorners:!0,repairSignalSourceCorners:!0,rematchRepairedLengths:(n)=>this.matchCompletePlanLengths(n,{maximumWorkUnits:1e4,allowMatchingInsideDenseBounds:!0}).plans});if(!t||t.every((n)=>zde(n,this.config.clearance).every((o)=>o.kind==="clearance")))return t;return IGr({...this.config,inputSrj:this.inputSrj,preparedBuses:this.preparedBuses,plans:t})}*routePeripheralMixedTerminationSteps(e){if(this.config.allowBlindAndBuriedVias)return null;let t=e.busesInRoutingOrder.find((g)=>g.termination.type==="boundary"&&(g.exitEdge==="right"||g.exitEdge==="left")&&g.connections.length>=16&&g.componentObstacles.length>=200);if(!t)return null;let n=e.busLayerAssignments[t.busId];if(!n)return null;let o=new Map(Object.entries(e.busLayerAssignments));this.setInProgressPlans({phase:"route-peripheral-source-escapes",plans:[],busId:t.busId});let r=(t.exitEdge==="left"?TUr:iUr)({...this.config,srj:this.routingSrj,buses:this.preparedBuses,bus:t,targetLayer:n,targetLayerByBusId:o}),i=r.next();while(!i.done)yield,i=r.next();if(!i.value)return null;let s=i.value,a={...this.config,...s,srj:this.routingSrj,bus:t,targetLayer:n},c="lowerConnectionIndices"in s?NCn({...a,...s}):sUr(a),l=c.next();while(!l.done)yield,l=c.next();let h=l.value;if(!h&&"lowerConnectionIndices"in s){let g=DUr({...a,...s,buses:this.preparedBuses}),f=g.next();while(!f.done)yield,f=g.next();if(f.value)s=f.value,h=f.value.plans}if(!h)return null;this.setInProgressPlans({phase:"route-peripheral-bus-continuations",plans:h,busId:t.busId});let d=MCn({...this.config,srj:this.routingSrj,buses:this.preparedBuses,sourceEscapes:s.sourceEscapes,sourceBoundary:s.sourceBoundary,initialPlans:h,targetLayerByBusId:o}),u=d.next();while(!u.done)yield,u=d.next();if(!u.value)return null;let _=wUr({...this.config,srj:this.routingSrj,inputSrj:this.inputSrj,plans:u.value,preparedBuses:this.preparedBuses,sharedBoundary:this.getValidationBoundary()}),p=_.next();while(!p.done)yield,p=_.next();if(!p.value)return null;let m=this.normalizeCompletePlanCorners(p.value);if(!m)return null;let A=TY({inputSrj:this.inputSrj,plans:m,layerNames:this.config.layerNames});if(!this.validateCompletePlans(m,A).valid)return null;return{plans:m,failedBusIds:[],stopAfterCompleteValidation:!0}}*routeDenseThroughAllMixedTerminationSteps(e){if(this.config.allowBlindAndBuriedVias)return null;let t=e.preferredBoundaryViaPoints,n=e.denseRoutingStrategy!=="boundary-aligned",o=(...ze)=>{if(tc.env.FANOUT_DEBUG_DENSE==="1"){if(tc.env.FANOUT_DEBUG_DENSE_SUMMARY==="1"&&!["start","plane-match:preflight-failed","plane-match:incremental-complete","plane-match:incremental-failed","plane-route:alternate-candidate-counts","plane-route:alternate-search","plane-route:csp","plane-reservation-core","plane-route:promote-failed","plane-route:alternate-choice","plane-route:promote-zero-candidates","length-match:complete","length-match:start","plane-route:failed","dense-validation"].includes(String(ze[0])))return;console.error("dense:",...ze)}},r=e.busesInRoutingOrder.filter((ze)=>ze.termination.type==="boundary"),i=r.filter((ze)=>ze.connections.length>=8),s=(ze,Xe)=>Xe.componentId!==ze.componentId&&this.config.layerNames.every((it)=>Xe.layers.includes(it))&&Xe.center.x>=ze.componentBounds.minX&&Xe.center.x<=ze.componentBounds.maxX&&Xe.center.y>=ze.componentBounds.minY&&Xe.center.y<=ze.componentBounds.maxY,a=i.some((ze)=>this.routingSrj.obstacles.some((Xe)=>s(ze,Xe))),c=this.preparedBuses.flatMap((ze)=>ze.termination.type==="plane"?ze.connections.map((Xe)=>Xe.connection.name):[]),l=i.some((ze)=>this.routingSrj.obstacles.some((Xe)=>s(ze,Xe)&&c.some((it)=>P6(this.routingSrj,Xe,it)))),h=this.config.densePlaneReservationBusIds.length>0||this.config.denseUnrestrictedPlaneRoutingBusIds.length>0,d=!h&&wfn(this.preparedBuses,this.config.allowBlindAndBuriedVias),u=h||d,_=!h&&!d&&l,p=e.boundaryRecovery!==void 0,m=u||_||p,A=p||(d||_)&&((e.planeReservationRetryCount??0)===0||Boolean(e.preferredBoundaryViaPoints)),g=(u||_)&&e.lengthMatchingStage!=="before-planes",f=yCn(r.map((ze)=>ze.connections.length)),y=r.filter((ze)=>ze.connections.length===2),x=CWr({boundaryBusCount:r.length,pairBuses:y.map((ze)=>({...ze,assignedLayer:e.busLayerAssignments[ze.busId]}))}),C=x?new Map(y.map((ze,Xe)=>[ze.busId,x[Xe]])):null,b=new Map;if(a)for(let ze of Kk(r,{viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,traceWidth:this.config.traceWidth,clearance:this.config.clearance,additionalObstacles:this.routingSrj.obstacles}))b.set(ze.connectionIndex,(b.get(ze.connectionIndex)??0)+1);let I=(ze)=>ze.connections.reduce((Xe,it)=>Xe+(b.get(it.connectionIndex)??0),0),v=new Map;if(n&&!h)for(let ze of i){if(!Xi(ze.exitEdge,ze.preferredExit)||new Set(ze.routableEscapeLayers??ze.allowedLayers??[]).size!==1)continue;let Xe=ze.direction==="up"||ze.direction==="down"?"y":"x",it=Xe==="x"?"y":"x",St=ze.direction==="up"||ze.direction==="right"?1:-1,kt=Math.max(...ze.connections.map((wn)=>St*wn.sourcePoint[Xe])),Lt=Math.min(...ze.connections.map((wn)=>wn.sourcePoint[it])),Wt=Math.max(...ze.connections.map((wn)=>wn.sourcePoint[it])),bn=Xe==="x"?ze.pitchX:ze.pitchY,pn=i.find((wn)=>{if(wn===ze||wn.componentId!==ze.componentId||wn.exitEdge!==ze.exitEdge||Xi(wn.exitEdge,wn.preferredExit))return!1;let mn=Math.min(...wn.connections.map((_n)=>St*_n.sourcePoint[Xe]))-kt;return mn>=-0.000000001&&mn<=bn+0.000000001&&Math.min(...wn.connections.map((_n)=>_n.sourcePoint[it]))<=Wt+0.000000001&&Math.max(...wn.connections.map((_n)=>_n.sourcePoint[it]))>=Lt-0.000000001});if(pn)v.set(ze,pn)}let P=u&&i.length===3,M=(ze)=>{let Xe=ze.connections.map((it)=>{let St=it.exitTargetPoint??it.targetPoint;return ze.exitEdge==="top"||ze.exitEdge==="bottom"?St.x:St.y});return{minimum:Math.min(...Xe),maximum:Math.max(...Xe)}},B=(ze)=>{if(ze.connections.length>=8)return!1;let Xe=M(ze);return i.some((it)=>{if(it.exitEdge!==ze.exitEdge)return!1;let St=M(it);return Xe.maximum>=St.minimum-0.000000001&&Xe.minimum<=St.maximum+0.000000001})},T=(ze)=>{if(ze.connections.length>=8)return;return i.find((Xe)=>{let it=Xe.connections.map((pn)=>pn.sourcePoint.x),St=Xe.connections.map((pn)=>pn.sourcePoint.y),kt=Math.min(...it),Lt=Math.max(...it),Wt=Math.min(...St),bn=Math.max(...St);return ze.connections.every((pn)=>pn.sourcePoint.x>=kt-0.000000001&&pn.sourcePoint.x<=Lt+0.000000001&&pn.sourcePoint.y>=Wt-0.000000001&&pn.sourcePoint.y<=bn+0.000000001)})},N=(ze)=>Boolean(T(ze)),D=(ze)=>B(ze)&&!N(ze)?0:ze.connections.length>=8?1:ze.connections.length>1?2:3,L=r.toSorted((ze,Xe)=>{if(f||i.length>0){if(P){let Fn=D(ze)-D(Xe);if(Fn!==0)return Fn}let wn=r.length===2&&Math.max(...r.map((Fn)=>Fn.connections.length))>=8?ze.connections.length-Xe.connections.length:Xe.connections.length-ze.connections.length;if(wn!==0)return wn;if(a&&ze.connections.length>=8&&Xe.connections.length>=8){let Fn=I(ze)-I(Xe);if(Fn!==0)return Fn}}let it=e.busLayerAssignments[ze.busId],St=e.busLayerAssignments[Xe.busId],kt=C?.get(ze.busId),Lt=C?.get(Xe.busId);if(kt!==void 0&&Lt!==void 0&&kt!==Lt)return kt-Lt;let Wt=Number(Boolean(Xi(Xe.exitEdge,Xe.preferredExit)))-Number(Boolean(Xi(ze.exitEdge,ze.preferredExit)));if(Wt!==0)return Wt;if(!Boolean(Xi(ze.exitEdge,ze.preferredExit))){let wn=(mn)=>{let _n=mn.connections.map((To)=>To.sourcePoint.x),no=mn.connections.map((To)=>To.sourcePoint.y);return Math.max(..._n)-Math.min(..._n)+Math.max(...no)-Math.min(...no)},Fn=wn(Xe)-wn(ze);if(Math.abs(Fn)>0.000000001)return Fn}let pn=this.config.layerNames.indexOf(it??"")-this.config.layerNames.indexOf(St??"");if(pn!==0)return-pn;if(r.length!==6&&r.length!==7&&r.length!==8&&r.length!==9)return 0;return ze.busId.localeCompare(Xe.busId)}),H=tc.env.FANOUT_DEBUG_BOUNDARY_ORDER?.split(",")??(tc.env.FANOUT_DEBUG_FIRST_BOUNDARY_BUS?[tc.env.FANOUT_DEBUG_FIRST_BOUNDARY_BUS]:e.boundaryRecovery?[e.boundaryRecovery.busId]:[]),V=H.length>0?L.toSorted((ze,Xe)=>{let it=H.indexOf(ze.busId),St=H.indexOf(Xe.busId);return(it<0?Number.POSITIVE_INFINITY:it)-(St<0?Number.POSITIVE_INFINITY:St)}):L,O=this.preparedBuses.filter((ze)=>ze.termination.type==="plane"),U=new Set(O.flatMap((ze)=>ze.connections.map((Xe)=>Xe.connectionIndex))),j=this.config.allowSameNetMerges||_,Y=u||_?this.routingSrj.obstacles:void 0,X=Number.parseInt(tc.env.FANOUT_INITIAL_PLANE_RESERVATIONS??"8",10),K=tc.env.FANOUT_DEBUG_INITIAL_PLANE_INDICES?.split(",").map((ze)=>Number(ze)-1),J=tc.env.FANOUT_DEBUG_INITIAL_PLANE_BUS_IDS?.split(","),ee=J?O.filter((ze)=>J.includes(ze.busId)):K?K.flatMap((ze)=>O[ze]?[O[ze]]:[]):this.config.densePlaneReservationBusIds.length>0?O.filter((ze)=>this.config.densePlaneReservationBusIds.includes(ze.busId)):u||_?O.slice(0,Number.isFinite(X)?X:8):O;if(e.promotedPlaneReservationBusIds)ee=[...new Set([...ee,...O.filter((ze)=>e.promotedPlaneReservationBusIds.includes(ze.busId))])];let se=new Set,ne,re,Z=V.map((ze)=>ze.connections.length),te=fGr({boundaryBusConnectionCounts:Z,planeBusCount:O.length});if(o("start",V.map((ze)=>`${ze.busId}:${ze.connections.length}`),`planes:${O.length}`,`joint:${f}`),V.length===0||te===null||V.some((ze)=>!_P(ze))||O.some((ze)=>ze.connections.length!==1)||V.length+O.length!==e.busesInRoutingOrder.length)return null;let ie=new Map(this.preparedBuses.flatMap((ze)=>ze.connections.map((Xe)=>[Xe.connectionIndex,Xe.connection.name]))),ue=Z.filter((ze)=>ze===1).length>1&&Zrt(Z),de=new Map(V.map((ze)=>[ze.busId,P&&ze.connections.length<8&&N(ze)?-1:1])),me=new Map(V.map((ze)=>[ze.busId,ze.connections.length===1?P&&N(ze)?!0:ue&&Xi(ze.exitEdge,ze.preferredExit)?due(ze).targetProjection>0:sue(ze.direction)!==ze.exitEdge:P&&ze.connections.length>=8?!1:sue(ze.direction)!==ze.exitEdge]));for(let ze of i){if(u)continue;if(!Xi(ze.exitEdge,ze.preferredExit))continue;if(i.some((it)=>{if(it===ze||it.componentId!==ze.componentId)return!1;let St=it.connections.map((wn)=>wn.sourcePoint.x),kt=it.connections.map((wn)=>wn.sourcePoint.y),Lt=Math.min(...St),Wt=Math.max(...St),bn=Math.min(...kt),pn=Math.max(...kt);return ze.connections.some(({sourcePoint:wn})=>{let Fn=wn.x+(ze.direction==="left"?-ze.pitchX/2:ze.direction==="right"?ze.pitchX/2:0),mn=wn.y+(ze.direction==="down"?-ze.pitchY/2:ze.direction==="up"?ze.pitchY/2:0);return Fn>=Lt&&Fn<=Wt&&mn>=bn&&mn<=pn})}))me.set(ze.busId,!1)}if(e.boundaryRecovery)de.set(e.boundaryRecovery.busId,e.boundaryRecovery.perpendicularSide),me.set(e.boundaryRecovery.busId,e.boundaryRecovery.preferOutward);let Ae=tc.env.FANOUT_DEBUG_FLIP_BOUNDARY_BUS;if(Ae)de.set(Ae,-1);let xe=tc.env.FANOUT_DEBUG_OUTWARD_BOUNDARY_BUS;if(xe)me.set(xe,!0);let Me=(ze,Xe)=>{let it=U.has(ze)&&U.has(Xe);if(!this.config.allowSameNetMerges&&!(j&&it))return!1;let St=ie.get(ze),kt=ie.get(Xe);return Boolean(St&&kt&&Y5(this.routingSrj,St,kt))},Re=V.filter((ze)=>ze.connections.length===1),we=!P&&!_&&Zrt(Z)?Re.toSorted(V.length===9?yWr:xWr).slice(0,gWr(Z)):[],_e=V.length===8||V.length===9?we.filter((ze)=>{let Xe=e.busLayerAssignments[ze.busId];return Boolean(Xe&&RCn({singletonBus:ze,singletonTargetLayer:Xe,wideBuses:V}))}):[],ye=P?Re.filter((ze)=>{let Xe=T(ze),it=e.busLayerAssignments[ze.busId];if(!Xe||!it)return!1;let St=Xe.routableEscapeLayers??Xe.allowedLayers??[],kt=ze.exitEdge==="left"||ze.exitEdge==="right"?"x":"y",Lt=Xe.connections.map((pn)=>pn.sourcePoint[kt]),Wt=ze.exitEdge==="left"||ze.exitEdge==="bottom"?Math.min(...Lt):Math.max(...Lt),bn=ze.connections.every((pn)=>Math.abs(pn.sourcePoint[kt]-Wt)<0.000000001);return Boolean(!St.includes(it)||d&&bn&&Xi(ze.exitEdge,ze.preferredExit))}):[],Se=ye.flatMap((ze)=>{let Xe=T(ze),it=e.busLayerAssignments[ze.busId];return V.filter((St)=>St.connections.length>1&&St.connections.length<8&&St.direction===ze.direction&&e.busLayerAssignments[St.busId]===it&&T(St)===Xe)}),Ne=tc.env.FANOUT_DEBUG_DISABLE_LEADING_NARROW==="1"?[]:ye.flatMap((ze)=>[ze,...Se.filter((Xe)=>Xe.direction===ze.direction&&e.busLayerAssignments[Xe.busId]===e.busLayerAssignments[ze.busId])]),ke=[..._e,...Ne].filter((ze,Xe,it)=>it.indexOf(ze)===Xe),nt=new Map;if(V.length===9&&ke.length>0)for(let ze of ke){me.set(ze.busId,!0);let Xe=Xi(ze.exitEdge,ze.preferredExit);if(!ze.exitEdge||!Xe)continue;let it=`${ze.exitEdge}:${Xe}`;if(!V.some((kt)=>{if(kt===ze||kt.connections.length<8)return!1;return kt.exitEdge===ze.exitEdge&&Xi(kt.exitEdge,kt.preferredExit)===Xe}))continue;nt.set(it,(nt.get(it)??0)+ze.connections.length)}let dt=new Set([...tc.env.FANOUT_DEBUG_PROVISIONAL_NARROW==="1"?V.filter((ze)=>ze.connections.length<8):[],...we.filter((ze)=>{let Xe=T(ze),it=ze.connections[0].sourcePoint,St={x:(ze.componentBounds.minX+ze.componentBounds.maxX)/2,y:(ze.componentBounds.minY+ze.componentBounds.maxY)/2},kt=ze.exitEdge?BP(ze.exitEdge):ze.direction,Lt=kt==="right"?St.x-it.x:kt==="left"?it.x-St.x:kt==="up"?St.y-it.y:it.y-St.y,Wt=n&&!u&&Xe&&(e.busLayerAssignments[Xe.busId]===e.busLayerAssignments[ze.busId]||Lt>0.000000001);return!ke.includes(ze)&&!Wt}),...P?V.filter((ze)=>ze.connections.length===2&&!B(ze)&&!ke.includes(ze)):[]]),rt=(ze)=>{let Xe=Xi(ze.exitEdge,ze.preferredExit);if(!ze.exitEdge||!Xe)return 0;let it=nt.get(`${ze.exitEdge}:${Xe}`)??0;return AWr({leadingLaneCount:it,traceWidth:this.config.traceWidth,viaDiameter:this.config.viaDiameter,clearance:this.config.clearance})},mt=V.filter((ze)=>!dt.has(ze)),lt=f?I0([...ee,...mt],{viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,traceWidth:this.config.traceWidth,clearance:this.config.clearance,maximumSearchStates:1e5,preferredViaPointsByConnectionIndex:e.preferredBoundaryViaPoints,preferredBoundaryPerpendicularSideByBusId:de,preferBoundaryOutwardByBusId:me,additionalObstacles:Y,preferPlaneCheckerboardSites:u,canShareCopper:Me}):null,Ct=lt??I0([...ee,V[0]],{viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,traceWidth:this.config.traceWidth,clearance:this.config.clearance,maximumSearchStates:20000,preferredViaPointsByConnectionIndex:e.preferredBoundaryViaPoints,preferredBoundaryPerpendicularSideByBusId:de,preferBoundaryOutwardByBusId:me,additionalObstacles:Y,preferPlaneCheckerboardSites:u,canShareCopper:Me}),Nt=tc.env.FANOUT_DEBUG_FIXED_VIAS;if(Ct&&Nt){Ct=new Map(Ct);for(let ze of Nt.split(",")){let Xe=ze.split(":"),it=Xe.pop(),St=Xe.pop(),kt=Xe.join(":"),Lt=[...ie].find(([,pn])=>pn===kt)?.[0],Wt=Number(St),bn=Number(it);if(Lt!==void 0&&Number.isFinite(Wt)&&Number.isFinite(bn))Ct.set(Lt,{x:Wt,y:bn})}}let Ht=tc.env.FANOUT_DEBUG_STAGED_PLANE_BUS_IDS?O.filter((ze)=>tc.env.FANOUT_DEBUG_STAGED_PLANE_BUS_IDS.split(",").includes(ze.busId)):tc.env.FANOUT_DEBUG_STAGED_PLANE_INDICES?.split(",").flatMap((ze)=>O[Number(ze)-1]?[O[Number(ze)-1]]:[])??[];if(Ct&&Ht.length>0)for(let ze of Ht){if(ee.includes(ze))continue;let Xe=I0([...ee,ze,...mt],{viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,traceWidth:this.config.traceWidth,clearance:this.config.clearance,maximumSearchStates:1e5,preferredViaPointsByConnectionIndex:e.preferredBoundaryViaPoints,preferredBoundaryPerpendicularSideByBusId:de,preferBoundaryOutwardByBusId:me,fixedViaPointsByConnectionIndex:Ct,additionalObstacles:Y,preferPlaneCheckerboardSites:u,canShareCopper:Me});if(o("plane-reservation:staged",ze.busId,Xe?.size??"failed"),!Xe)break;Ct=new Map([...Ct,...Xe]),ee.push(ze)}if(o("seed",Ct?.size??"failed"),Ct&&tc.env.FANOUT_DEBUG_DENSE_POINTS==="1")console.error("dense: seed-points",[...Ct].map(([ze,Xe])=>({connection:ie.get(ze),point:Xe})));let Tt=1,et=V.length+O.length+3;if(this.setInProgressPlans({phase:"reserve-dense-via-sites",plans:[],strategy:"default",unitIndex:Tt,unitCount:et}),yield,Ct){let ze=yGr({busesInRoutingOrder:[...a?[]:_e,...V.filter((gt)=>(a||!_e.includes(gt))&&!Ne.includes(gt)).flatMap((gt)=>[...Ne.filter((Ot)=>T(Ot)===gt),gt])],busLayerAssignments:e.busLayerAssignments,routingMode:te}),Xe=i.every((gt)=>gt.exitEdge&&gt.direction===BP(gt.exitEdge)),it=_&&Xe?Re.filter((gt)=>{let Ot=T(gt);return Boolean(Ot&&gt.direction===Ot.direction)}):[];if(e.boundaryRecovery&&it.length>0){let gt=ze.findIndex((Ot)=>Ot.busId===e.boundaryRecovery.busId);if(gt>=0){let Ot=ze[gt],Zt=new Set(it),je=ze.filter((Mt)=>Mt!==Ot&&!Zt.has(Mt));ze.splice(0,ze.length,Ot,...it,...je)}}for(let[gt]of v){let Ot=gt.direction==="up"||gt.direction==="down"?"y":"x",Zt=gt.direction==="up"||gt.direction==="right"?1:-1,je=Math.min(...gt.connections.map((nn)=>Zt*nn.sourcePoint[Ot])),Mt=ze.indexOf(gt),Kt=ze.findIndex((nn)=>nn!==gt&&nn.connections.length>=8&&nn.componentId===gt.componentId&&nn.direction===gt.direction&&Math.max(...nn.connections.map((Zn)=>Zt*Zn.sourcePoint[Ot]))<=je+0.000000001&&nn.exitEdge===gt.exitEdge&&Xi(nn.exitEdge,nn.preferredExit)===Xi(gt.exitEdge,gt.preferredExit));if(Kt>=0&&Kt<Mt)ze.splice(Mt,1),ze.splice(Kt,0,gt)}let St=(gt,Ot)=>{if(!n||gt.componentId!==Ot.componentId||gt.exitEdge!==Ot.exitEdge||gt.direction!==Ot.direction||Xi(gt.exitEdge,gt.preferredExit)!==Xi(Ot.exitEdge,Ot.preferredExit)||e.busLayerAssignments[gt.busId]!==e.busLayerAssignments[Ot.busId]||T(gt)!==T(Ot)||!T(gt))return!1;let Zt={x:gt.connections.reduce((nn,Zn)=>nn+Zn.sourcePoint.x,0)/gt.connections.length,y:gt.connections.reduce((nn,Zn)=>nn+Zn.sourcePoint.y,0)/gt.connections.length},je={x:Ot.connections.reduce((nn,Zn)=>nn+Zn.sourcePoint.x,0)/Ot.connections.length,y:Ot.connections.reduce((nn,Zn)=>nn+Zn.sourcePoint.y,0)/Ot.connections.length};if(Math.hypot(Zt.x-je.x,Zt.y-je.y)>1.5*Math.min(gt.pitchX,gt.pitchY))return!1;let Mt=gt.exitEdge==="left"||gt.exitEdge==="right"?"y":"x",Kt=(nn)=>nn.connections.reduce((Zn,Vn)=>Zn+(Vn.exitTargetPoint??Vn.targetPoint)[Mt],0)/nn.connections.length;return(Zt[Mt]-je[Mt])*(Kt(gt)-Kt(Ot))<-0.000000001},kt=new Set;for(let gt of ke){if(Xi(gt.exitEdge,gt.preferredExit))continue;for(let Ot of V){if(Ot.connections.length!==2||!St(Ot,gt))continue;let Zt=ze.indexOf(Ot),je=ze.indexOf(gt);if(Zt>je)ze.splice(Zt,1),ze.splice(je,0,Ot),kt.add(`${Ot.componentId}:${Ot.exitEdge}`)}}for(let gt of V){if(!kt.has(`${gt.componentId}:${gt.exitEdge}`)||gt.connections.length!==2||!Xi(gt.exitEdge,gt.preferredExit))continue;for(let Ot of Re){if(!St(Ot,gt))continue;let Zt=ze.indexOf(Ot),je=ze.indexOf(gt);if(Zt>je)ze.splice(Zt,1),ze.splice(je,0,Ot)}}for(let gt of v.values())for(let Ot of V){if(Ot.connections.length!==2||T(Ot)!==gt)continue;for(let Zt of Re){if(!St(Zt,Ot))continue;let je=ze.indexOf(Ot),Mt=ze.indexOf(Zt);if(Mt>je)ze.splice(Mt,1),ze.splice(je,0,Zt)}}let Lt=Ct,Wt=[],bn=!0,pn=(gt)=>{let Ot=new Set(gt.connections.map((Zt)=>Zt.connection.name));return this.preparedBuses.flatMap((Zt)=>{let je=e.busLayerAssignments[Zt.busId];if(!je)return[];return Zt.connections.flatMap((Mt)=>{if(Ot.has(Mt.connection.name))return[];let Kt=Lt.get(Mt.connectionIndex);if(!Kt)return[];return[{connectionName:Mt.connection.name,sourceEscapeSegment:Wt.some((nn)=>nn.connectionIndex===Mt.connectionIndex)?void 0:{start:Mt.sourcePoint,end:Kt,layer:Mt.sourceLayer,width:this.config.traceWidth},via:{center:Kt,diameter:this.config.viaDiameter,spanLayers:G5({fromLayer:Mt.sourceLayer,toLayer:je,layerNames:this.config.layerNames,allowBlindAndBuriedVias:!1})}}]})})},wn=function*(gt){if(o("route:start",gt.busId,Wt.length),tc.env.FANOUT_DEBUG_DENSE_POINTS==="1")console.error("dense: points",gt.busId,gt.connections.map((Nn)=>({source:Nn.sourcePoint,via:Lt.get(Nn.connectionIndex),target:Nn.exitTargetPoint??Nn.targetPoint})));let Ot=e.busLayerAssignments[gt.busId];if(!Ot)return!1;let Zt=!u&&!Xi(gt.exitEdge,gt.preferredExit)&&gt.connections.length>2&&i.some((Nn)=>Xi(Nn.exitEdge,Nn.preferredExit)),je=this.config.traceWidth+this.config.clearance,Mt=gt.connections.some((Nn)=>{let mo=Nn.exitTargetPoint??Nn.targetPoint,Io=gt.sharedBoundary;return gt.exitEdge==="left"||gt.exitEdge==="right"?mo.y-Io.minY<=je+0.000000001||Io.maxY-mo.y<=je+0.000000001:mo.x-Io.minX<=je+0.000000001||Io.maxX-mo.x<=je+0.000000001}),Kt={srj:this.routingSrj,bus:gt,targetLayer:Ot,acceptedPlans:Wt,layerNames:this.config.layerNames,traceWidth:this.config.traceWidth,viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,clearance:this.config.clearance,compactBusTracks:this.config.compactBusTracks,allowBlindAndBuriedVias:!1,allowSameNetMerges:this.config.allowSameNetMerges,staticClearanceCache:this.routeStaticClearanceCache,fixedViaPointsByConnectionIndex:Lt,reservedVias:pn(gt),viaMinimalOnly:tc.env.FANOUT_DEBUG_ALLOW_EXTRA_VIAS!=="1",allowBoundarySideViaFallback:gt.connections.length===1,preferCornerBoundaryVia:u,adaptiveWindingRouteOrder:Zt,allowFixedViaReservedExitFallback:p,forbidEarlyExitBoundaryContact:Mt,alignWindingGridToPads:n&&!h,fixedViaFallbackRouteOrderAttempts:Zt?60:u?6:24,cornerBandTargetTrackOffset:rt(gt)},nn=function*(Nn,mo){return this.activeRoutingVisualization=null,yield{type:"subsolver",solver:this.createWorkSolver("BoundaryBusRoutingSolver",this.routeBusAlternativesWorkSteps(Nn,mo),void 0,()=>this.visualizeBoundaryRoutingState())}}.bind(this),Vn=(gt.routableEscapeLayers??gt.allowedLayers??[]).some((Nn)=>Nn!==Ot)?{...gt,routableEscapeLayers:[Ot]}:gt,Rn=V.some((Nn)=>Nn.connections.length<8&&T(Nn)===gt&&Wt.some((mo)=>mo.busId===Nn.busId)),Bn=u&&Vn!==gt&&!Rn,ho=!1,Qo=(yield*nn(Bn?{...Kt,bus:Vn}:Kt,1))[0];if(!Qo&&Bn)Qo=(yield*nn(Kt,1))[0];if(!Qo){let Nn=Lt,mo=me.get(gt.busId)??!0,Io=de.get(gt.busId)??1;for(let[io,Wo]of[[!mo,Io],[mo,-Io],[!mo,-Io]]){let rr=I0([...new Set([...ee,...mt,...this.preparedBuses.filter((xr)=>Wt.some((Ci)=>Ci.busId===xr.busId)),gt])],{viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,traceWidth:this.config.traceWidth,clearance:this.config.clearance,maximumSearchStates:1e5,preferredBoundaryPerpendicularSideByBusId:new Map([...de,[gt.busId,Wo]]),preferBoundaryOutwardByBusId:new Map([...me,[gt.busId,io]]),fixedViaPointsByConnectionIndex:new Map(Wt.filter((xr)=>xr.via).map((xr)=>[xr.connectionIndex,xr.via.center])),preferredViaPointsByConnectionIndex:new Map([...Nn].filter(([xr])=>!gt.connections.some((Ci)=>Ci.connectionIndex===xr))),blockingSegments:Wt.flatMap((xr)=>xr.segments.map((Ci)=>({connectionIndex:xr.connectionIndex,segment:Ci}))),additionalObstacles:this.routingSrj.obstacles,preferPlaneCheckerboardSites:u,canShareCopper:Me});if(o("retry-sites",gt.busId,io,Wo,rr?.size??"failed"),!rr)continue;if(Lt=rr,Qo=(yield*nn({...Kt,fixedViaPointsByConnectionIndex:rr,reservedVias:pn(gt),alignWindingGridToPads:u,fixedViaFallbackRouteOrderAttempts:3},1))[0],Qo)break}if(!Qo){if(Lt=Nn,gt.connections.length===2)Qo=(yield*nn({...Kt,fixedViaPointsByConnectionIndex:Nn,reservedVias:pn(gt),allowBoundarySideViaFallback:!0,fixedViaFallbackRouteOrderAttempts:1},1))[0]}}if(!Qo&&d&&gt.connections.length>=8&&Xi(gt.exitEdge,gt.preferredExit)&&new Set(gt.routableEscapeLayers??gt.allowedLayers??[]).size===1&&!Wt.some((Nn)=>i.some((mo)=>mo.busId===Nn.busId))){let Nn=pn(gt),mo=UVr(gt,{viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,traceWidth:this.config.traceWidth,clearance:this.config.clearance,additionalObstacles:this.routingSrj.obstacles,blockingSegments:[...Wt.flatMap((Io)=>Io.segments.map((io)=>({connectionIndex:Io.connectionIndex,segment:io}))),...Nn.flatMap((Io)=>Io.sourceEscapeSegment?[{connectionIndex:-1,segment:Io.sourceEscapeSegment}]:[])],blockingVias:[...Wt.flatMap((Io)=>Io.via?[{connectionIndex:Io.connectionIndex,...Io.via}]:[]),...Nn.map((Io)=>({connectionIndex:-1,...Io.via}))]},Lt);for(let Io of mo){let io=(yield*nn({...Kt,fixedViaPointsByConnectionIndex:Io,reservedVias:Nn,fixedViaFallbackRouteOrderAttempts:1},1))[0];if(!io)continue;Qo=io,Lt=Io,ho=!0;break}}if(!Qo&&d&&gt.connections.length>=8&&Xi(gt.exitEdge,gt.preferredExit)){if(Qo=(yield*nn({...Kt,fixedViaPointsByConnectionIndex:void 0,reservedVias:pn(gt)},1))[0],Qo)ho=!0,Lt=new Map([...Lt,...Qo.filter((Nn)=>Nn.via).map((Nn)=>[Nn.connectionIndex,Nn.via.center])]);o("local-sites",gt.busId,Qo?.length??"failed")}if(!Qo&&gt.connections.length>=8&&(v.has(gt)||V.some((Nn)=>Nn.connections.length>=8&&Wt.some((mo)=>mo.busId===Nn.busId)))){let Nn=new Set(Wt.map((io)=>io.connectionName)),mo=new Set(this.preparedBuses.filter((io)=>io.termination.type==="plane"||io===v.get(gt)).flatMap((io)=>io.connections.map((Wo)=>Wo.connection.name)).filter((io)=>!Nn.has(io))),Io=(yield*nn({...Kt,fixedViaPointsByConnectionIndex:void 0,reservedVias:Kt.reservedVias.filter((io)=>!mo.has(io.connectionName)),softReservedVias:Kt.reservedVias.filter((io)=>mo.has(io.connectionName))},1))[0];if(Io){let io=[...Wt,...Io],Wo=I0(this.preparedBuses,{viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,traceWidth:this.config.traceWidth,clearance:this.config.clearance,maximumSearchStates:3000000,preferredBoundaryPerpendicularSideByBusId:de,preferBoundaryOutwardByBusId:me,fixedViaPointsByConnectionIndex:new Map(io.filter((rr)=>rr.via).map((rr)=>[rr.connectionIndex,rr.via.center])),preferredViaPointsByConnectionIndex:Lt,blockingSegments:io.flatMap((rr)=>rr.segments.map((xr)=>({connectionIndex:rr.connectionIndex,segment:xr}))),additionalObstacles:this.routingSrj.obstacles,preferPlaneCheckerboardSites:u,canShareCopper:Me});if(o("free-sites:rematched",gt.busId,Wo?.size??"failed"),Wo)Qo=Io,Lt=Wo,ho=!0}}if(Qo&&gt.maxLengthSkew!==void 0){let Nn=Qo.map((io)=>io.length),mo=Math.max(...Nn)-Math.min(...Nn);if(fWr({boundaryBusCount:V.length,connectionCount:gt.connections.length,rawSkew:mo,maximumSkew:gt.maxLengthSkew})&&!g&&!ho)Qo=(yield*nn(Kt,3)).toSorted((io,Wo)=>{let rr=io.map((Ci)=>Ci.length),xr=Wo.map((Ci)=>Ci.length);return Math.max(...rr)-Math.min(...rr)-(Math.max(...xr)-Math.min(...xr))})[0]}if(!Qo){if(ne??=gt,gt.connections.length>=8)re??=gt;return o("route:failed",gt.busId),!1}if(Wt.push(...Qo),Wt.length===V.reduce((Nn,mo)=>Nn+mo.connections.length,0)&&Wt.some((Nn)=>{let mo=V.find((io)=>io.busId===Nn.busId);if(mo?.connections.length!==1||!Nn.via)return!1;let{center:Io}=Nn.via;return Io.x<mo.componentBounds.minX||Io.x>mo.componentBounds.maxX||Io.y<mo.componentBounds.minY||Io.y>mo.componentBounds.maxY}))t=new Map(Wt.filter((Nn)=>Nn.via).map((Nn)=>[Nn.connectionIndex,Nn.via.center]));return o("route:complete",gt.busId,Qo.length),!0}.bind(this),Fn=[],mn=(gt)=>{if(gt.connections.length>=8&&!u&&!_&&tc.env.FANOUT_DEBUG_NO_PLANE_EXPANSION!=="1"&&ee.length<O.length)ee=O,o("plane-reservations:expanded",O.length)},_n=te==="large_boundary_only"?ze:ze.slice(0,1),no;for(let gt of _n){let Ot=yield*wn(gt);if(this.setInProgressPlans({phase:"route-dense-boundary-buses",plans:Wt,strategy:"default",unitIndex:++Tt,unitCount:et,busId:gt.busId}),yield,!Ot)continue;no=gt;break}if(no)Fn.push(no),mn(no);else bn=!1;let To=ze.filter((gt)=>gt!==no);while(bn&&To.length>0){let gt=Wt.flatMap((Zt)=>Zt.segments.map((je)=>({connectionIndex:Zt.connectionIndex,segment:je}))),Ot=-1;for(let Zt=0;Zt<To.length;Zt++){let je=To[Zt];o("candidate:start",je.busId);let Mt=new Map(Lt),Kt=tc.env.FANOUT_DEBUG_LATE_FIXED_VIAS;if(Kt){let Nn=new Set(je.connections.map((mo)=>mo.connectionIndex));for(let mo of Kt.split(",")){let Io=mo.split(":"),io=Io.pop(),Wo=Io.pop(),rr=Io.join(":"),xr=[...ie].find(([,ya])=>ya===rr)?.[0],Ci=Number(Wo),ea=Number(io);if(xr!==void 0&&Nn.has(xr)&&Number.isFinite(Ci)&&Number.isFinite(ea))Mt.set(xr,{x:Ci,y:ea})}}let nn=je.connections.every((Nn)=>Mt.has(Nn.connectionIndex)),Zn=lt&&nn?new Map(Mt):I0([...ee,...Fn,je],{viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,traceWidth:this.config.traceWidth,clearance:this.config.clearance,maximumSearchStates:1e5,preferredBoundaryPerpendicularSideByBusId:de,preferBoundaryOutwardByBusId:me,fixedViaPointsByConnectionIndex:Mt,blockingSegments:gt,additionalObstacles:Y,preferPlaneCheckerboardSites:u,canShareCopper:Me}),Vn=Zn?new Map([...Mt,...Zn]):null;if(o("candidate:matched",je.busId,Vn?.size??"failed"),this.setInProgressPlans({phase:"reserve-next-dense-boundary-bus",plans:Wt,strategy:"default",unitIndex:Tt,unitCount:et,busId:je.busId}),yield,!Vn)continue;let Rn=Lt,Bn=Wt.length,ho=To.filter((Nn,mo)=>mo!==Zt),Qo=Vn;if(ho.length===1){let Nn=ho[0],mo=I0([...ee,...Fn,je,Nn],{viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,traceWidth:this.config.traceWidth,clearance:this.config.clearance,maximumSearchStates:1e5,preferredBoundaryPerpendicularSideByBusId:de,preferBoundaryOutwardByBusId:me,fixedViaPointsByConnectionIndex:Vn,blockingSegments:gt,additionalObstacles:Y,preferPlaneCheckerboardSites:u,canShareCopper:Me});if(o("future:matched",Nn.busId,mo?.size??"failed"),mo){let Io=new Map;for(let rr of Kk([Nn],{viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,traceWidth:this.config.traceWidth,clearance:this.config.clearance,blockingSegments:gt,additionalObstacles:Y,preferPlaneCheckerboardSites:u,canShareCopper:Me}))Io.set(rr.connectionIndex,(Io.get(rr.connectionIndex)??0)+1);let io=Nn.connections.toSorted((rr,xr)=>(Io.get(rr.connectionIndex)??0)-(Io.get(xr.connectionIndex)??0)||rr.connectionIndex-xr.connectionIndex),Wo=new Map(Vn);for(let rr of io){let xr=mo.get(rr.connectionIndex);if(xr)Wo.set(rr.connectionIndex,xr)}Qo=Wo}}if(Lt=Qo,yield*wn(je)){o("lookahead:start",je.busId);let Nn=ho.length===0||ho.some((mo)=>{let Io=Wt.flatMap((io)=>io.segments.map((Wo)=>({connectionIndex:io.connectionIndex,segment:Wo})));return Boolean(I0([...ee,...Fn,je,mo],{viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,traceWidth:this.config.traceWidth,clearance:this.config.clearance,maximumSearchStates:1e5,preferredBoundaryPerpendicularSideByBusId:de,preferBoundaryOutwardByBusId:me,fixedViaPointsByConnectionIndex:Lt,blockingSegments:Io,additionalObstacles:Y,preferPlaneCheckerboardSites:u,canShareCopper:Me}))});if(o("lookahead:complete",je.busId,Nn),Nn){Ot=Zt,Fn.push(je),mn(je),this.setInProgressPlans({phase:"route-dense-boundary-buses",plans:Wt,strategy:"default",unitIndex:++Tt,unitCount:et,busId:je.busId}),yield;break}Wt.splice(Bn)}Lt=Rn,this.setInProgressPlans({phase:"retry-dense-boundary-bus",plans:Wt,strategy:"default",unitIndex:Tt,unitCount:et,busId:je.busId}),yield}if(Ot<0){bn=!1;break}To.splice(Ot,1)}let ir=null;if(bn){let gt=null,Ot=[],Zt=(Mt,Kt=new Set)=>{Ot=[],ir=null;let nn=new Map(Mt.flatMap((Nn)=>Nn.via?[[Nn.connectionIndex,Nn.via.center]]:[])),Zn=Mt.flatMap((Nn)=>Nn.segments.map((mo)=>({connectionIndex:Nn.connectionIndex,segment:mo}))),Vn=!u||Mt.some((Nn)=>Nn.segments.filter((mo)=>mo.layer===Nn.sourceLayer).length>1),Rn=!Vn?V:[],Bn=!Vn?[]:Mt.flatMap((Nn)=>[Nn.via,...Nn.additionalVias??[],Nn.planeEndpointVia].filter((mo)=>mo!==void 0).map((mo)=>({connectionIndex:Nn.connectionIndex,center:mo.center,diameter:mo.diameter,spanLayers:mo.spanLayers}))),ho=!Vn?null:I0(O,{viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,traceWidth:this.config.traceWidth,clearance:this.config.clearance,maximumSearchStates:1,preferredBoundaryPerpendicularSideByBusId:de,preferBoundaryOutwardByBusId:me,fixedViaPointsByConnectionIndex:new Map([...Lt,...nn]),blockingSegments:Zn,blockingVias:Bn,additionalObstacles:Y,preferPlaneCheckerboardSites:u,canShareCopper:Me});if(ho)return new Map([...nn,...ho]);if(m||tc.env.FANOUT_DEBUG_INCREMENTAL_PLANE_MATCH==="1"){let Nn=new Map(nn),mo=p?[]:[...ee];for(let or of mo)for(let Gr of or.connections){let ti=Lt.get(Gr.connectionIndex);if(ti)Nn.set(Gr.connectionIndex,ti)}for(let or of mo){let Gr=e.busLayerAssignments[or.busId];if(!Gr)return null;let ti=GY({srj:this.routingSrj,bus:or,targetLayer:Gr,acceptedPlans:[...Mt,...Ot],layerNames:this.config.layerNames,traceWidth:this.config.traceWidth,viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,clearance:this.config.clearance,compactBusTracks:this.config.compactBusTracks,allowBlindAndBuriedVias:!1,allowSameNetMerges:j,staticClearanceCache:this.routeStaticClearanceCache,fixedViaPointsByConnectionIndex:Nn});if(!ti)return null;Ot.push(...ti)}let Io=O.filter((or)=>!mo.includes(or)&&!I0([...mo,or,...Rn],{viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,traceWidth:this.config.traceWidth,clearance:this.config.clearance,maximumSearchStates:1e5,preferredBoundaryPerpendicularSideByBusId:de,preferBoundaryOutwardByBusId:me,fixedViaPointsByConnectionIndex:Nn,blockingSegments:Zn,blockingVias:Bn,additionalObstacles:Y,preferPlaneCheckerboardSites:u,canShareCopper:Me})),io=Math.min(...O.map((or)=>this.config.layerNames.indexOf(e.busLayerAssignments[or.busId]??""))),Wo=u||tc.env.FANOUT_DEBUG_ROUTE_DEEP_PLANES_FIRST==="1"?O.filter((or)=>!mo.includes(or)&&this.config.layerNames.indexOf(e.busLayerAssignments[or.busId]??"")>io):[],rr=new Set([...Kt,...this.config.denseUnrestrictedPlaneRoutingBusIds,...tc.env.FANOUT_DEBUG_ADDITIONAL_ALTERNATE_PLANE_BUS_IDS?.split(",")??[]]),xr=O.filter((or)=>!mo.includes(or)&&rr.has(or.busId)),Ci=[...Wo,...Io.filter((or)=>!Wo.includes(or)),...xr.filter((or)=>!Wo.includes(or)&&!Io.includes(or))],ea=tc.env.FANOUT_DEBUG_ALTERNATE_PLANE_ORDER?.split(",")??[],ya=Ci.toSorted((or,Gr)=>{let ti=this.config.layerNames.indexOf(e.busLayerAssignments[or.busId]??""),$l=this.config.layerNames.indexOf(e.busLayerAssignments[Gr.busId]??"");if(ti!==$l&&tc.env.FANOUT_DEBUG_ALTERNATE_IGNORE_LAYERS!=="1")return tc.env.FANOUT_DEBUG_ALTERNATE_SHALLOW_FIRST==="1"?ti-$l:$l-ti;let Ll=ea.indexOf(or.busId),Vd=ea.indexOf(Gr.busId);return(Ll<0?ea.length:Ll)-(Vd<0?ea.length:Vd)||or.connections[0].connectionIndex-Gr.connections[0].connectionIndex});if(Ci.length>0){if(o("plane-match:preflight-failed",Io.map((xa)=>xa.busId)),!m&&tc.env.FANOUT_DEBUG_ROUTE_UNMATCHED_PLANES!=="1")return null;let or=0,Gr=Number(tc.env.FANOUT_DEBUG_ALTERNATE_SEARCH_STATES??(d&&(e.planeReservationRetryCount??0)===0?1e4:u?3000000:p?1e4:1000)),ti=Number(tc.env.FANOUT_DEBUG_ALTERNATE_ROUTE_COUNT??(u?128:8)),$l=0,Ll=new Map,Vd=(xa,k0,ym=ti)=>{let _u=e.busLayerAssignments[xa.busId];if(!_u)return[];return UJ({srj:this.routingSrj,bus:xa,targetLayer:_u,acceptedPlans:[...Mt,...k0],layerNames:this.config.layerNames,traceWidth:this.config.traceWidth,viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,clearance:this.config.clearance,compactBusTracks:this.config.compactBusTracks,allowBlindAndBuriedVias:!1,allowSameNetMerges:j,staticClearanceCache:this.routeStaticClearanceCache},ym)},$1=(xa,k0)=>{if(xa.length===0)return k0;if(or>=Gr)return null;$l=Math.max($l,ya.length-xa.length);let ym=xa.map((ri)=>({planeBus:ri,alternatives:Vd(ri,k0)})),_u=tc.env.FANOUT_DEBUG_DYNAMIC_ALTERNATE_ORDER==="1"?ym.toSorted((ri,ic)=>ri.alternatives.length-ic.alternatives.length||ya.indexOf(ri.planeBus)-ya.indexOf(ic.planeBus)):ym,o0=_u[0],{planeBus:Zi,alternatives:Hl}=o0;if(tc.env.FANOUT_DEBUG_ALTERNATE_CHOICES==="1"&&or<64)o("plane-route:alternate-choice",`depth:${ya.length-xa.length}`,Zi.busId,ym.map((ri)=>[ri.planeBus.busId,ri.alternatives.length]));if(Hl.length===0)return Ll.set(Zi.busId,(Ll.get(Zi.busId)??0)+1),null;let zc=(tc.env.FANOUT_DEBUG_BRANCH_ALTERNATE_ORDER==="1"?_u:[o0]).flatMap((ri)=>ri.alternatives.map((ic)=>({selection:ri,alternative:ic,remaining:xa.filter((wh)=>wh!==ri.planeBus)}))),ua=tc.env.FANOUT_DEBUG_LEAST_CONSTRAINING_ALTERNATES==="1"?zc.map((ri)=>{let ic=[...k0,...ri.alternative],wh=ri.remaining.map((Qs)=>Vd(Qs,ic,Math.min(4,ti)).length);return{...ri,remainingOptionCounts:wh,minimumRemainingOptions:wh.length===0?Number.POSITIVE_INFINITY:Math.min(...wh),totalRemainingOptions:wh.reduce((Qs,Yd)=>Qs+Yd,0)}}).filter((ri)=>ri.minimumRemainingOptions!==0).toSorted((ri,ic)=>ic.minimumRemainingOptions-ri.minimumRemainingOptions||ic.totalRemainingOptions-ri.totalRemainingOptions):zc;for(let ri of ua){or++;let ic=$1(ri.remaining,[...k0,...ri.alternative]);if(ic)return ic;if(or>=Gr)break}return Ll.set(Zi.busId,(Ll.get(Zi.busId)??0)+1),null},fm;if(m||tc.env.FANOUT_DEBUG_EXACT_COVER_ALTERNATES==="1"){let xa=ya.map((Zi)=>({planeBus:Zi,candidates:Vd(Zi,Ot).map((Hl,da)=>({key:`${Zi.busId}:${da}`,planeBus:Zi,plans:Hl}))}));if(A){let Zi=[...Mt,...Ot];for(let Hl of O){if(mo.includes(Hl)||xa.some((ua)=>ua.planeBus===Hl))continue;let da=[],zc=Kk([Hl],{viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,traceWidth:this.config.traceWidth,clearance:this.config.clearance,blockingSegments:Zi.flatMap((ua)=>ua.segments.map((ri)=>({connectionIndex:ua.connectionIndex,segment:ri}))),blockingVias:Zi.flatMap((ua)=>[ua.via,...ua.additionalVias??[],ua.planeEndpointVia].filter((ri)=>ri!==void 0).map((ri)=>({connectionIndex:ua.connectionIndex,center:ri.center,diameter:ri.diameter,spanLayers:ri.spanLayers}))),additionalObstacles:this.routingSrj.obstacles,preferPlaneCheckerboardSites:!0,canShareCopper:Me});for(let ua of zc){let ri=GY({srj:this.routingSrj,bus:Hl,targetLayer:e.busLayerAssignments[Hl.busId],acceptedPlans:Zi,layerNames:this.config.layerNames,traceWidth:this.config.traceWidth,viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,clearance:this.config.clearance,compactBusTracks:this.config.compactBusTracks,allowBlindAndBuriedVias:!1,allowSameNetMerges:j,fixedViaPointsByConnectionIndex:new Map([[ua.connectionIndex,ua.point]])});if(ri)da.push({key:`${Hl.busId}:local:${da.length}`,planeBus:Hl,plans:ri})}xa.push({planeBus:Hl,candidates:da})}}o("plane-route:alternate-candidate-counts",xa.map((Zi)=>[Zi.planeBus.busId,Zi.candidates.length]));for(let Zi of xa)if(Zi.candidates.length===0)se.add(Zi.planeBus.busId);let k0=new Map,ym=(Zi,Hl)=>{let da=[Zi.key,Hl.key].toSorted().join("|"),zc=k0.get(da);if(zc!==void 0)return zc;let ua=Ifn({plans:[...Zi.plans,...Hl.plans],srj:this.routingSrj,clearance:this.config.clearance,allowSameNetMerges:j});return k0.set(da,ua),ua},_u=(Zi,Hl)=>{if(Zi.length===0)return Hl;if(or>=Gr)return null;$l=Math.max($l,ya.length-Zi.length);let da=Zi.toSorted((ri,ic)=>ri.candidates.length-ic.candidates.length)[0];if(da.candidates.length===0)return Ll.set(da.planeBus.busId,(Ll.get(da.planeBus.busId)??0)+1),null;let zc=Zi.filter((ri)=>ri!==da),ua=Number(tc.env.FANOUT_DEBUG_ALTERNATE_CANDIDATE_BATCH_SIZE??16);for(let ri=0;ri<da.candidates.length;ri+=ua){let ic=da.candidates.slice(ri,ri+ua).map((wh)=>{let Qs=zc.map((Bh)=>({...Bh,candidates:Bh.candidates.filter((Gd)=>ym(wh,Gd))})),Yd=Qs.map((Bh)=>Bh.candidates.length);return{candidate:wh,projectedSets:Qs,minimumProjectedCount:Yd.length===0?Number.POSITIVE_INFINITY:Math.min(...Yd),totalProjectedCount:Yd.reduce((Bh,Gd)=>Bh+Gd,0)}}).filter((wh)=>wh.minimumProjectedCount!==0).toSorted((wh,Qs)=>Qs.minimumProjectedCount-wh.minimumProjectedCount||Qs.totalProjectedCount-wh.totalProjectedCount);for(let wh of ic){or++;let Qs=_u(wh.projectedSets,[...Hl,wh.candidate]);if(Qs)return Qs;if(or>=Gr)break}if(or>=Gr)break}return Ll.set(da.planeBus.busId,(Ll.get(da.planeBus.busId)??0)+1),null},o0;if(d||_){let Zi=(zc)=>zc.map((ua)=>[...new Map(ua.candidates.map((ri)=>[JSON.stringify(ri.plans.map((ic)=>[ic.segments,ic.via,ic.additionalVias,ic.planeEndpointSegments,ic.planeEndpointVia])),ri])).values()]),da=((zc,ua=Gr)=>lGr({candidateSets:Zi(zc),maximumSearchStates:ua,areCompatible:(ri,ic)=>Ifn({plans:[...ri.plans,...ic.plans],srj:this.routingSrj,clearance:this.config.clearance,allowSameNetMerges:j})}))(xa);if(o("plane-route:csp",da.selection?"complete":"failed",da.searchStates,da.emptyDomainIndices.map((zc)=>xa[zc].planeBus.busId)),o0=da.selection,or=da.searchStates,!da.selection&&(d||_)){let zc=da.emptyDomainIndices.map((ua)=>xa[ua].planeBus.busId).filter((ua)=>!ya.some((ri)=>ri.busId===ua));if(zc.length>0)return o("plane-route:expand-domains",zc),Zt(Mt,new Set([...Kt,...zc]))}if(!da.selection)for(let zc of(e.planeReservationRetryCount??0)===0?da.conflictDomainIndices:da.emptyDomainIndices.slice(0,1))se.add(xa[zc].planeBus.busId)}else o0=_u(xa,[]);fm=o0?[...Ot,...o0.flatMap((Zi)=>Zi.plans)]:null}else fm=$1(ya,Ot);if(o("plane-route:alternate-search",fm?"complete":"failed",or,`depth:${$l}/${ya.length}`,[...Ll].toSorted(([,xa],[,k0])=>k0-xa)),!fm)return null;if(Ot=fm,A)return ir=[],new Map([...nn,...fm.filter((xa)=>xa.via).map((xa)=>[xa.connectionIndex,xa.via.center])])}let Oo=new Set,$i=[...Zn],Ei=[],hs=[...O],il=new Map,kl=new Map,Xc=()=>{Oo=new Set(Ot.map((Gr)=>Gr.busId));let or=Ot.flatMap((Gr)=>[...Gr.segments,...Gr.planeEndpointSegments??[]].map((ti)=>({connectionIndex:Gr.connectionIndex,segment:ti})));$i=[...Zn,...or],Ei=Ot.flatMap((Gr)=>[Gr.via,...Gr.additionalVias??[],Gr.planeEndpointVia].flatMap((ti)=>ti?[{connectionIndex:Gr.connectionIndex,center:ti.center,diameter:ti.diameter,spanLayers:ti.spanLayers}]:[])),hs=O.filter((Gr)=>!Oo.has(Gr.busId)),il=new Map,kl=new Map;for(let Gr of Kk(hs,{viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,traceWidth:this.config.traceWidth,clearance:this.config.clearance,blockingSegments:$i,blockingVias:Ei,additionalObstacles:Y,preferPlaneCheckerboardSites:u,canShareCopper:Me})){il.set(Gr.connectionIndex,(il.get(Gr.connectionIndex)??0)+1);let ti=kl.get(Gr.connectionIndex)??[];ti.push(Gr.point),kl.set(Gr.connectionIndex,ti)}};Xc();for(let or=0;or<O.length;or++){let Gr=hs.filter((ti)=>!il.has(ti.connections[0].connectionIndex));if(Gr.length===0)break;if(o("plane-route:promote-zero-candidates",Gr.map((ti)=>ti.busId)),Gr.some((ti)=>mo.includes(ti)))return null;for(let ti of Gr){let $l=e.busLayerAssignments[ti.busId];if(!$l)return null;let Ll=UJ({srj:this.routingSrj,bus:ti,targetLayer:$l,acceptedPlans:[...Mt,...Ot],layerNames:this.config.layerNames,traceWidth:this.config.traceWidth,viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,clearance:this.config.clearance,compactBusTracks:this.config.compactBusTracks,allowBlindAndBuriedVias:!1,allowSameNetMerges:j,staticClearanceCache:this.routeStaticClearanceCache},8)[0];if(!Ll)return o("plane-route:promote-failed",ti.busId),Zt(Mt,new Set([...Kt,...Gr.map((Vd)=>Vd.busId)]));Ot.push(...Ll)}Xc()}let Od=tc.env.FANOUT_DEBUG_PLANE_MATCH_ORDER?.split(",")??[],cp=hs.toSorted((or,Gr)=>{let ti=(il.get(or.connections[0].connectionIndex)??0)-(il.get(Gr.connections[0].connectionIndex)??0);if(ti!==0)return ti;let $l=Od.indexOf(or.busId),Ll=Od.indexOf(Gr.busId),Vd=($l<0?Od.length:$l)-(Ll<0?Od.length:Ll);if(Vd!==0)return Vd;return or.connections[0].connectionIndex-Gr.connections[0].connectionIndex});for(let or of cp){if(mo.includes(or))continue;if(tc.env.FANOUT_DEBUG_PLANE_CANDIDATES?.split(",").includes(or.busId))o("plane-match:candidates",or.busId,kl.get(or.connections[0].connectionIndex));let Gr=I0([...mo,or,...Rn],{viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,traceWidth:this.config.traceWidth,clearance:this.config.clearance,maximumSearchStates:1e5,preferredBoundaryPerpendicularSideByBusId:de,preferBoundaryOutwardByBusId:me,fixedViaPointsByConnectionIndex:Nn,blockingSegments:$i,blockingVias:[...Bn,...Ei],additionalObstacles:Y,preferPlaneCheckerboardSites:u,canShareCopper:Me});if(o(Gr?"plane-match:incremental":"plane-match:incremental-failed",or.busId,il.get(or.connections[0].connectionIndex)??0,Gr?.get(or.connections[0].connectionIndex),Gr?.size??"failed"),!Gr)return null;Nn=new Map([...Nn,...Gr]),mo.push(or)}return ir=mo.filter((or)=>!Oo.has(or.busId)),o("plane-match:incremental-complete",Nn.size),Nn}let Qo=I0([...O,...Rn],{viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,traceWidth:this.config.traceWidth,clearance:this.config.clearance,maximumSearchStates:1e5,preferredBoundaryPerpendicularSideByBusId:de,preferBoundaryOutwardByBusId:me,fixedViaPointsByConnectionIndex:nn,blockingSegments:Zn,blockingVias:Bn,additionalObstacles:Y,preferPlaneCheckerboardSites:u,canShareCopper:Me});return Qo?new Map([...nn,...Qo]):null};o("length-match:start",Wt.length);let je=g?{plans:Wt}:yx({plans:Wt,preparedBuses:this.preparedBuses,inputSrj:this.inputSrj,sharedBoundary:this.getValidationBoundary(),clearance:this.config.clearance,allowBlindAndBuriedVias:!1,allowSameNetMerges:this.config.allowSameNetMerges,allowMatchingInsideDenseBounds:!0,candidatePlansAreFeasible:(Mt)=>{let Kt=Zt(Mt);if(!Kt)return!1;return gt=Kt,!0}});if(o("length-match:complete",je.plans?.length??"failed"),this.setInProgressPlans({phase:"match-dense-boundary-lengths",plans:je.plans??Wt,strategy:"default",unitIndex:++Tt,unitCount:et}),yield,je.plans){Wt=je.plans;let Mt=gt??Zt(Wt);if(Mt)Lt=Mt,Wt.push(...Ot);else bn=!1}else bn=!1;this.setInProgressPlans({phase:"rematch-dense-via-sites",plans:Wt,strategy:"default",unitIndex:Tt,unitCount:et}),yield}if(bn)for(let gt of ir??O){o("plane-route:start",gt.busId);let Ot=e.busLayerAssignments[gt.busId],Zt=new Map,je=Ot?GY({srj:this.routingSrj,bus:gt,targetLayer:Ot,acceptedPlans:Wt,layerNames:this.config.layerNames,traceWidth:this.config.traceWidth,viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,clearance:this.config.clearance,compactBusTracks:this.config.compactBusTracks,allowBlindAndBuriedVias:!1,allowSameNetMerges:j,staticClearanceCache:this.routeStaticClearanceCache,blockingBusCounts:Zt,fixedViaPointsByConnectionIndex:Lt}):null;if(!je&&Ot&&a){if(je=GY({srj:this.routingSrj,bus:gt,targetLayer:Ot,acceptedPlans:Wt,layerNames:this.config.layerNames,traceWidth:this.config.traceWidth,viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,clearance:this.config.clearance,compactBusTracks:this.config.compactBusTracks,allowBlindAndBuriedVias:!1,allowSameNetMerges:j,staticClearanceCache:this.routeStaticClearanceCache,blockingBusCounts:Zt}),je)Lt=new Map([...Lt,...je.flatMap((Mt)=>Mt.via?[[Mt.connectionIndex,Mt.via.center]]:[])])}if(!je){o("plane-route:failed",gt.busId,Lt.get(gt.connections[0].connectionIndex),[...Zt]),bn=!1;break}Wt.push(...je),o("plane-route:complete",gt.busId),this.setInProgressPlans({phase:"route-dense-plane-buses",plans:Wt,strategy:"default",unitIndex:++Tt,unitCount:et,busId:gt.busId}),yield}if(bn&&g){let gt={plans:Wt,preparedBuses:this.preparedBuses,inputSrj:this.inputSrj,sharedBoundary:this.getValidationBoundary(),clearance:this.config.clearance,allowBlindAndBuriedVias:!1,allowSameNetMerges:j,allowMatchingInsideDenseBounds:!0,allowPairLaneSpreading:!0,allowUnconstrainedLaneRerouting:!0},Ot=yx(gt),Zt=new Set;while(!Ot.plans&&Ot.failedBus&&!Zt.has(Ot.failedBus.busId)){let je=Ot.failedBus;Zt.add(je.busId);let Mt=GUr({plans:Wt,bus:je,srj:this.inputSrj,sharedBoundary:this.getValidationBoundary(),layerNames:this.config.layerNames,traceWidth:this.config.traceWidth,viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,clearance:this.config.clearance,allowSameNetMerges:j});if(Mt.every((Kt,nn)=>Kt===Wt[nn]))break;Wt=Mt,Ot=yx({...gt,plans:Wt})}if(Ot.plans)Wt=Ot.plans;else bn=!1;this.setInProgressPlans({phase:"match-dense-complete-lengths",plans:Wt,strategy:"default",unitIndex:++Tt,unitCount:et}),yield}let xt=bn&&wp({plans:Wt,srj:this.routingSrj,sharedBoundary:V[0].sharedBoundary,clearance:this.config.clearance,allowBlindAndBuriedVias:!1,allowSameNetMerges:j});if(o("dense-validation",bn,Wt.length,xt),xt){let gt=this.normalizeCompletePlanCorners(Wt);if(gt){let Ot=TY({inputSrj:this.inputSrj,plans:gt,layerNames:this.config.layerNames});if(this.validateCompletePlans(gt,Ot).valid)return{plans:gt,failedBusIds:[],stopAfterCompleteValidation:!0}}}}if((d||_)&&se.size>0&&(e.planeReservationRetryCount??0)<5){let ze=[...se].filter((it)=>!ee.some((St)=>St.busId===it)),Xe=(e.planeReservationRetryCount??0)===0?hGr({candidateBusIds:ze,activeBusIds:new Set(ee.map((it)=>it.busId)),planeBuses:O}):ze;if(Xe.length>0)return o("plane-reservation-core",Xe),o("promote-reservations",Xe),yield*this.routeDenseThroughAllMixedTerminationSteps({...e,preferredBoundaryViaPoints:t,promotedPlaneReservationBusIds:[...e.promotedPlaneReservationBusIds??[],...Xe],planeReservationRetryCount:(e.planeReservationRetryCount??0)+1})}if(g&&!ne)return yield*this.routeDenseThroughAllMixedTerminationSteps({...e,lengthMatchingStage:"before-planes"});if(n&&!u){let ze=yield*this.routeDenseThroughAllMixedTerminationSteps({...e,denseRoutingStrategy:"boundary-aligned"});if(ze)return ze;if(!p&&re){let Xe=re.busId,it=me.get(Xe)??!0,St=de.get(Xe)??1;for(let[kt,Lt]of[[!it,-St],[!it,St],[it,-St],[it,St]]){let Wt=yield*this.routeDenseThroughAllMixedTerminationSteps({...e,boundaryRecovery:{busId:Xe,preferOutward:kt,perpendicularSide:Lt}});if(Wt)return Wt}}}if(!n||tc.env.FANOUT_DEBUG_DENSE_ONLY==="1")return null;let vt=8,ht=(ze,Xe=[])=>{let it=[{plans:[...Xe],failedBusIds:[]}];for(let St of V){let kt=e.busLayerAssignments[St.busId];if(!kt)return null;let Lt=[],Wt=it.map((bn)=>({state:bn,alternatives:UJ({srj:this.routingSrj,bus:St,targetLayer:kt,acceptedPlans:bn.plans,layerNames:this.config.layerNames,traceWidth:this.config.traceWidth,viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,clearance:this.config.clearance,compactBusTracks:this.config.compactBusTracks,allowBlindAndBuriedVias:!1,allowSameNetMerges:this.config.allowSameNetMerges,staticClearanceCache:this.routeStaticClearanceCache},ze)}));for(let bn=0;bn<ze;bn++){for(let{state:pn,alternatives:wn}of Wt){let Fn=wn[bn];if(!Fn)continue;if(Lt.push({plans:[...pn.plans,...Fn],failedBusIds:[]}),Lt.length>=vt)break}if(Lt.length>=vt)break}if(Lt.length===0)return null;it=Lt}return it},We=(ze)=>{if(V.length!==2)return null;let[Xe,it]=V;if(!Xe||!it)return null;let St=(mn,_n,no)=>{let To=e.busLayerAssignments[mn.busId];if(!To)return null;return UJ({srj:this.routingSrj,bus:mn,targetLayer:To,acceptedPlans:_n,layerNames:this.config.layerNames,traceWidth:this.config.traceWidth,viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,clearance:this.config.clearance,compactBusTracks:this.config.compactBusTracks,allowBlindAndBuriedVias:!1,allowSameNetMerges:this.config.allowSameNetMerges,staticClearanceCache:this.routeStaticClearanceCache,rejectedViaMinimalCandidates:no,stopAfterFirstRejectedViaMinimalCandidate:no!==void 0},1)[0]??null},kt=St(Xe,[...ze]);if(!kt)return null;let Lt=[],Wt=St(it,[...ze,...kt],Lt);if(Wt)return{plans:[...ze,...kt,...Wt],failedBusIds:[]};let bn=Lt[0];if(!bn)return null;let pn=bn.map((mn)=>({...mn,termination:{type:"plane",layer:mn.targetLayer}})),wn=St(Xe,[...ze,...pn]);if(!wn)return null;let Fn=[...ze,...wn,...bn];if(!wp({plans:Fn,srj:this.routingSrj,sharedBoundary:Xe.sharedBoundary,clearance:this.config.clearance,allowBlindAndBuriedVias:!1,allowSameNetMerges:this.config.allowSameNetMerges}))return null;return{plans:Fn,failedBusIds:[]}},Le=new Map(O.map((ze)=>[ze.busId,ze])),Ze=(ze,Xe,it)=>{let St=e.busLayerAssignments[ze.busId];if(!St)return null;return GY({srj:this.routingSrj,bus:ze,targetLayer:St,acceptedPlans:Xe,layerNames:this.config.layerNames,traceWidth:this.config.traceWidth,viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,clearance:this.config.clearance,compactBusTracks:this.config.compactBusTracks,allowBlindAndBuriedVias:!1,allowSameNetMerges:this.config.allowSameNetMerges,staticClearanceCache:this.routeStaticClearanceCache,blockingBusCounts:it})},$e=(ze,Xe)=>{let it={plans:[...ze],failedBusIds:[]};for(let St of Xe){let kt=new Map,Lt=Ze(St,it.plans,kt);if(!Lt){let Wt=[...kt.entries()].filter(([pn])=>it.plans.some((wn)=>wn.busId===pn)).filter(([pn])=>Le.has(pn)).toSorted(([,pn],[,wn])=>wn-pn).slice(0,8).map(([pn])=>pn),bn=[...Wt.map((pn)=>[pn]),...Wt.flatMap((pn,wn)=>Wt.slice(wn+1).map((Fn)=>[pn,Fn]))];for(let pn of bn){let wn=new Set(pn),Fn=it.plans.filter((no)=>!wn.has(no.busId)),mn=Ze(St,Fn);if(!mn)continue;Fn.push(...mn);let _n=!0;for(let no of pn){let To=Le.get(no),ir=To?Ze(To,Fn):null;if(!ir){_n=!1;break}Fn.push(...ir)}if(!_n)continue;it.plans=Fn,Lt=[];break}}if(Lt)it.plans.push(...Lt);else it.failedBusIds.push(St.busId)}return it},qe=null,ft=null,It=(ze,Xe)=>{let it=null;for(let St of ze){let kt=[...Xe],Lt=new Set;for(let Wt=0;Wt<3;Wt++){let bn=kt.map((Fn)=>Fn.busId).join("\x00");if(Lt.has(bn))break;Lt.add(bn);let pn=$e(St.plans,kt);if(!qe||pn.plans.length>qe.plans.length||pn.plans.length===qe.plans.length&&pn.failedBusIds.length<qe.failedBusIds.length)qe=pn;if(!it||pn.plans.length>it.plans.length||pn.plans.length===it.plans.length&&pn.failedBusIds.length<it.failedBusIds.length)it=pn;if(pn.failedBusIds.length===0)return pn;let wn=new Set(pn.failedBusIds);kt=[...pn.failedBusIds.flatMap((Fn)=>{let mn=Le.get(Fn);return mn?[mn]:[]}),...kt.filter((Fn)=>!wn.has(Fn.busId))]}}return ft=it,null};for(let ze of[1,4]){let Xe=ht(ze);if(!Xe)continue;let it=It(Xe,O);if(it)return it;let St=qe?.failedBusIds.slice(0,3);if(ze===1&&St)for(let kt of St){let Lt=[],Wt=new Set,bn=kt;for(let Fn=0;Fn<3&&bn;Fn++){let mn=Le.get(bn);if(!mn)break;let _n=Ze(mn,Lt);if(!_n)break;Lt.push(..._n),Wt.add(bn);let no=We(Lt);if(!no)break;let To=It([no],O.filter((xt)=>!Wt.has(xt.busId)));if(To)return To;bn=ft?.failedBusIds?.find((xt)=>!Wt.has(xt))}if(Lt.length===0)continue;let pn=ht(1,Lt);if(!pn)continue;let wn=It(pn,O.filter((Fn)=>!Wt.has(Fn.busId)));if(wn)return wn}}return qe}*evaluateAssignmentWithStrategySteps(e,t,n){let o=[],r=[],i=new Map,s=this.config.escapeLayers.length===1,a=s&&this.config.singleLayerPushAndShove&&!this.preparedBuses.some((C)=>C.exitEdge&&C.preferredExit?.includes("-"));if(a){let C={srj:this.routingSrj,buses:this.preparedBuses,traceWidth:this.config.traceWidth,clearance:this.config.clearance,borderDistribution:this.config.borderDistribution},b=VUr(C);if(!b&&this.config.singleLayerAdaptiveExits)this.setInProgressPlans({phase:"prepare-single-layer-adaptive-exits",plans:o,strategy:n}),yield,this.setInProgressPlans({phase:"route-single-layer-adaptive-exits",plans:o,strategy:n}),this.activeAdaptiveVisualization=null,b=yield{type:"subsolver",solver:this.createWorkSolver("SingleLayerAdaptiveExitSolver",_G({...C,availableBoundaryRegions:ICn(this.options.availableCornersAndSides),onProgress:(v,P)=>{this.activeAdaptiveVisualization=v,this.stats={...this.stats,...P}}}),void 0,()=>this.visualizeAdaptiveRoutingState())};if(b)o.push(...b);else r.push(...this.preparedBuses.map((I)=>I.busId));this.setInProgressPlans({phase:"route-single-layer",plans:o,strategy:n,unitIndex:1,unitCount:1}),yield}let c=[...this.preparedBuses].sort((C,b)=>{let I=_P(C),v=_P(b),P=this.config.layerNames.indexOf(t[C.busId]??""),M=this.config.layerNames.indexOf(t[b.busId]??"");return jfn(C,b,this.config.allowBlindAndBuriedVias)||Number(v)-Number(I)||(I&&v?M-P:0)||(n==="group-by-layer"?(t[C.busId]??"").localeCompare(t[b.busId]??""):0)||b.componentObstacles.length-C.componentObstacles.length||(s?kJ(b)-kJ(C):b.connections.length-C.connections.length||(n==="deep-first"?kJ(b)-kJ(C):kJ(C)-kJ(b)))}),l=null;if(!a&&n==="default")l=yield{type:"subsolver",solver:this.createWorkSolver("PeripheralMixedTerminationSolver",this.routePeripheralMixedTerminationSteps({busLayerAssignments:t,busesInRoutingOrder:c}))};if(!l&&!a&&n==="default")l=yield{type:"subsolver",solver:this.createWorkSolver("DenseMixedTerminationSolver",this.routeDenseThroughAllMixedTerminationSteps({busLayerAssignments:t,busesInRoutingOrder:c}),()=>{let b=Number(this.stats.workUnit??0),I=Number(this.stats.workUnitCount??0);return I>0?b/I:0})};if(!l&&!a&&n==="default"&&tc.env.FANOUT_DEBUG_DENSE_ONLY==="1")l={plans:[],failedBusIds:this.preparedBuses.map((C)=>C.busId)};if(l)o=l.plans,r=l.failedBusIds,this.setInProgressPlans({phase:"route-dense-mixed-terminations",plans:o,strategy:n,unitIndex:this.preparedBuses.length,unitCount:this.preparedBuses.length}),yield;let h=`${n}|`,d=0;for(let C of a||l?[]:c){d++;let b=t[C.busId];if(!b)throw Error(`FanoutSolver: assignment ${e} has no layer for bus "${C.busId}"`);h+=`${C.busId.length}:${C.busId};${b.length}:${b};`;let I=this.routingPrefixCache.get(h);if(I){o=[...I.plans],r=[...I.failedBusIds],i=new Map(I.blockingBusCounts),this.setInProgressPlans({phase:"route-assignment",plans:o,strategy:n,unitIndex:d,unitCount:c.length,busId:C.busId}),yield;continue}let v=new Map,P=GY({srj:this.routingSrj,bus:C,targetLayer:b,acceptedPlans:o,layerNames:this.config.layerNames,traceWidth:this.config.traceWidth,viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,clearance:this.config.clearance,compactBusTracks:this.config.compactBusTracks,allowBlindAndBuriedVias:this.config.allowBlindAndBuriedVias,allowSameNetMerges:this.config.allowSameNetMerges,staticClearanceCache:this.routeStaticClearanceCache,blockingBusCounts:v});if(!P){r.push(C.busId);for(let[M,B]of v)i.set(M,(i.get(M)??0)+B)}else o.push(...P);this.routingPrefixCache.set(h,{plans:[...o],failedBusIds:[...r],blockingBusCounts:new Map(i)}),this.setInProgressPlans({phase:"route-assignment",plans:o,strategy:n,unitIndex:d,unitCount:c.length,busId:C.busId}),yield}let u,_=l?.stopAfterCompleteValidation===!0&&o.length===this.inputSrj.connections.length;if(!_&&o.length===this.inputSrj.connections.length){let C=this.matchCompletePlanLengths(o);if(C.plans)o=C.plans;else{let b=C.failedBus,I={code:"bus-length-skew",message:`Bus ${b.busId} could not satisfy its ${b.maxLengthSkew.toFixed(6)}mm routed-length skew within the fanout boundary`,busId:b.busId};u=[I],this.lengthMatchingFailure??=I,o=[],r=[b.busId,...this.preparedBuses.map((v)=>v.busId).filter((v)=>v!==b.busId)],i.clear()}}if(!_&&o.length===this.inputSrj.connections.length){let C=this.normalizeCompletePlanCorners(o);if(C)o=C;else u=[{code:"fanout-normalization",message:"Completed fanout could not normalize every corner while preserving its original clearance and length constraints"}],o=[],r=this.preparedBuses.map((b)=>b.busId),i.clear()}let p=TY({inputSrj:this.inputSrj,plans:o,layerNames:this.config.layerNames}),m=o.length===this.inputSrj.connections.length?this.validateCompletePlans(o,p):null;if(m&&!m.valid)u=m.issues,o=[],r=this.preparedBuses.map((C)=>C.busId),i.clear(),p=TY({inputSrj:this.inputSrj,plans:o,layerNames:this.config.layerNames});let A=this.preparedBuses.length-r.length,g=o.reduce((C,b)=>C+b.length,0),y=(this.inputSrj.connections.length-o.length)*1e6+r.length*1e5+g+c9e(o)*0.1+s9e(t,this.preparedBuses,this.config.balanceLayerLoadByConnectionCount)*a9e(this.config),x={assignmentIndex:e,busLayerAssignments:t,routedBusCount:A,routedConnectionCount:o.length,failedBusIds:r,score:y,...u?{validationIssues:u}:{}};return this.setInProgressPlans({phase:"finalize-assignment-strategy",plans:o,strategy:n}),{summary:x,plans:o,...l?.stopAfterCompleteValidation&&m?.valid?{stopAfterCompleteValidation:!0}:{},blockingBusIds:[...i.entries()].toSorted(([,C],[,b])=>b-C).map(([C])=>C),outputSrj:p}}*evaluateAssignmentSteps(e,t){let n=yield*this.evaluateAssignmentWithStrategySteps(e,t,"default");if(tc.env.FANOUT_DEBUG_DENSE_ONLY==="1")return n;if(n.summary.routedConnectionCount===this.inputSrj.connections.length&&(n.stopAfterCompleteValidation||this.getCoordinatedAdditionalViaCount(n.plans)===0))return n;for(let o of["group-by-layer","deep-first"]){let r=yield*this.evaluateAssignmentWithStrategySteps(e,t,o);if(this.isAttemptBetter(r,n))n=r;if(n.summary.routedConnectionCount===this.inputSrj.connections.length&&(n.stopAfterCompleteValidation||this.getCoordinatedAdditionalViaCount(n.plans)===0))return n}return n}*evaluateGroupedBeamSteps(e,t=!1){if(this.config.escapeLayers.length<2)return null;if(this.preparedBuses.length>56)return null;let n=this.inputSrj.connections.length;if(n>64)return null;if(new Set(this.preparedBuses.map((x)=>x.componentId)).size!==1)return null;let o=(x)=>{let C=this.config.layerNames.indexOf(x.connections[0]?.sourceLayer??""),b=x.termination.type==="plane"?[x.termination.layer]:this.escapeLayersByBusId[x.busId]??this.config.escapeLayers;return Math.max(0,...b.map((I)=>Math.abs(this.config.layerNames.indexOf(I)-C)))},r=[...this.preparedBuses].sort((x,C)=>{let b=_P(x),I=_P(C),v=x.termination.type==="plane"?1:this.escapeLayersByBusId[x.busId]?.length??this.config.escapeLayers.length,P=C.termination.type==="plane"?1:this.escapeLayersByBusId[C.busId]?.length??this.config.escapeLayers.length;return jfn(x,C,this.config.allowBlindAndBuriedVias)||Number(I)-Number(b)||(b&&I?o(C)-o(x):0)||(t?x.direction.localeCompare(C.direction):0)||v-P||C.componentObstacles.length-x.componentObstacles.length||C.connections.length-x.connections.length||Jrt(C)-Jrt(x)||x.busId.localeCompare(C.busId)}),i=n<=24,s=this.preparedBuses.some((x)=>x.connections.length>1),a=i?48:n<=32?24:12,c=i&&!s?4:1,l=[{assignment:{},plans:[]}],h=(x)=>{let C=x.plans.reduce((v,P)=>v+P.length,0),b=c9e(x.plans),I=this.preparedBuses.reduce((v,P)=>{if(P.termination.type!=="boundary"||!qrt(P))return v;let M=P.connections[0]?.sourceLayer,B=eZ(P)??M;return x.assignment[P.busId]===B?v:v+P.connections.length},0);return C+b*0.1+I*1e4+s9e(x.assignment,this.preparedBuses,this.config.balanceLayerLoadByConnectionCount)*a9e(this.config)},d=0;for(let x of r){d++;let C=[];for(let I of l){let v=x.termination.type==="plane"?[x.termination.layer]:this.escapeLayersByBusId[x.busId]??this.config.escapeLayers,P=new Map;for(let[D,L]of Object.entries(I.assignment)){let H=this.preparedBuses.find((V)=>V.busId===D);P.set(L,(P.get(L)??0)+(this.config.balanceLayerLoadByConnectionCount?H?.connections.length??1:1))}let M=x.connections[0]?.sourceLayer,B=eZ(x),T=qrt(x),N=v.toSorted((D,L)=>(P.get(D)??0)-(P.get(L)??0)||Number(L===B)-Number(D===B)||(T?Number(L===M)-Number(D===M):Number(D===M)-Number(L===M))||D.localeCompare(L));for(let D of N){let L=UJ({srj:this.routingSrj,bus:x,targetLayer:D,acceptedPlans:I.plans,layerNames:this.config.layerNames,traceWidth:this.config.traceWidth,viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,clearance:this.config.clearance,compactBusTracks:this.config.compactBusTracks,allowBlindAndBuriedVias:this.config.allowBlindAndBuriedVias,allowSameNetMerges:this.config.allowSameNetMerges,staticClearanceCache:this.routeStaticClearanceCache},c);for(let H of L)C.push({assignment:{...I.assignment,[x.busId]:D},plans:[...I.plans,...H]})}}if(C.length===0)return null;C.sort((I,v)=>{let P=this.getCoordinatedAdditionalViaCount(I.plans)-this.getCoordinatedAdditionalViaCount(v.plans);if(P!==0)return P;let M=h(I)-h(v);if(Math.abs(M)>0.000000001)return M;return JSON.stringify(I.assignment).localeCompare(JSON.stringify(v.assignment))});let b=new Map;l=[];for(let I of C){let v=JSON.stringify(I.assignment),P=b.get(v)??0;if(P>=2)continue;if(b.set(v,P+1),l.push(I),l.length>=a)break}this.setInProgressPlans({phase:"route-grouped-beam",plans:l[0]?.plans??[],strategy:"grouped-beam",unitIndex:d,unitCount:r.length,busId:x.busId}),yield}let u,_,{POSITIVE_INFINITY:p,POSITIVE_INFINITY:m}=Number,A=(x)=>x.plans.reduce((C,b)=>C+b.length,0)+c9e(x.plans)*0.1+s9e(x.assignment,this.preparedBuses,this.config.balanceLayerLoadByConnectionCount)*a9e(this.config),g=this.preparedBuses.some((x)=>x.maxLengthSkew!==void 0);for(let x of l){if(x.plans.length!==this.inputSrj.connections.length){yield;continue}let C=this.matchCompletePlanLengths(x.plans);if(!C.plans){yield;continue}let b=this.normalizeCompletePlanCorners(C.plans);if(!b){yield;continue}let I=TY({inputSrj:this.inputSrj,plans:b,layerNames:this.config.layerNames});if(!this.validateCompletePlans(b,I).valid){yield;continue}let v={...x,plans:b},P=this.getCoordinatedAdditionalViaCount(b),M=A(v);if(!u||P<m||P===m&&M<p)u=v,_=I,p=M,m=P;if(!g)break;this.setInProgressPlans({phase:"validate-grouped-beam",plans:b,strategy:"grouped-beam"}),yield}if(!u||!_)return null;let f=p;if(!Number.isFinite(f))return null;return{summary:{assignmentIndex:e,busLayerAssignments:u.assignment,routedBusCount:this.preparedBuses.length,routedConnectionCount:u.plans.length,failedBusIds:[],score:f},plans:u.plans,blockingBusIds:[],outputSrj:_}}*evaluateGroupedBeamAlternativesSteps(e){let t=yield*this.evaluateGroupedBeamSteps(e);if(t)return t;return yield*this.evaluateGroupedBeamSteps(e,!0)}prioritizeFailedBusRepairs(e,t,n){let o=JSON.stringify(e),r=this.assignmentRepairDepthByKey.get(o)??0;if(r>=2)return;let i=8,s=[],a=new Set,c=(h)=>{let d=JSON.stringify(h);if(a.has(d)||this.evaluatedAssignmentKeys.has(d)||this.queuedAssignmentKeys.has(d))return;a.add(d),this.queuedAssignmentKeys.add(d),this.assignmentRepairDepthByKey.set(d,r+1),s.push(h)},l=[];for(let h=0;h<Math.max(t.length,n.length);h++){let d=t[h],u=n[h];if(d&&!l.includes(d))l.push(d);if(u&&!l.includes(u))l.push(u)}for(let h of t){let d=e[h],u=this.escapeLayersByBusId[h];if(!d||!u)continue;for(let _ of n.slice(0,4)){let p=e[_],m=this.escapeLayersByBusId[_];if(!p||!m||!u.includes(p)||!m.includes(d))continue;if(c({...e,[h]:p,[_]:d}),s.length>=i)break}if(s.length>=i)break}for(let h of l){let d=e[h],u=this.escapeLayersByBusId[h];if(!d||!u)continue;let _=u.indexOf(d);for(let p=1;p<u.length;p++){let m=u[(Math.max(_,0)+p)%u.length];if(m===d)continue;if(c({...e,[h]:m}),s.length>=i)break}if(s.length>=i)break}this.pendingRepairAssignments.push(...s)}hasCompleteBestAttempt(){return this.bestAttempt?.summary.routedConnectionCount===this.inputSrj.connections.length}getCoordinatedAdditionalViaCount(e){let t=new Set(this.preparedBuses.filter(_P).map((n)=>n.busId));return e.reduce((n,o)=>n+(t.has(o.busId)?o.additionalVias?.length??0:0),0)}isAttemptBetter(e,t){if(e.summary.routedConnectionCount!==t.summary.routedConnectionCount)return e.summary.routedConnectionCount>t.summary.routedConnectionCount;if(e.summary.routedBusCount!==t.summary.routedBusCount)return e.summary.routedBusCount>t.summary.routedBusCount;let n=this.getCoordinatedAdditionalViaCount(e.plans),o=this.getCoordinatedAdditionalViaCount(t.plans);if(n!==o)return n<o;return e.summary.score<t.summary.score}hasGloballyViaMinimalBestAttempt(){if(!this.hasCompleteBestAttempt()||!this.bestAttempt)return!1;if(this.preparedBuses.length===0||!this.preparedBuses.every(_P))return!1;return this.bestAttempt.plans.every((e)=>e.via!==void 0&&(e.additionalVias?.length??0)===0)}shouldEvaluateGroupedBeam(){if(this.groupedBeamEvaluated||this.nextAssignmentIndex===0)return!1;return this.hasCompleteBestAttempt()||this.pendingRepairAssignments.length===0||this.nextAssignmentIndex>=this.config.maxLayerCombinations}commitGroupedBeamAttempt(e){if(!e){if(this.hasCompleteBestAttempt()&&this.bestAttempt&&this.getCoordinatedAdditionalViaCount(this.bestAttempt.plans)===0)this.completeBestAttemptEndpoints(),this.solved=!0;return}if(this.attempts.push(e.summary),!this.bestAttempt||this.isAttemptBetter(e,this.bestAttempt))this.bestAttempt=e;let t=this.bestAttempt.summary;if(this.stats={phase:"complete-grouped-beam",assignment:t.assignmentIndex<0?0:t.assignmentIndex+1,assignmentCount:this.config.maxLayerCombinations,routedBuses:`${t.routedBusCount}/${this.preparedBuses.length}`,routedConnections:`${t.routedConnectionCount}/${this.inputSrj.connections.length}`,failedBuses:"none",bestScore:t.score},this.getCoordinatedAdditionalViaCount(this.bestAttempt.plans)===0)this.completeBestAttemptEndpoints(),this.solved=!0}commitAssignmentAttempt(e,t){if(this.nextAssignmentIndex++,this.evaluatedAssignmentKeys.add(JSON.stringify(e)),!this.bestAttempt||t.summary.routedConnectionCount>=this.bestAttempt.summary.routedConnectionCount)this.prioritizeFailedBusRepairs(e,t.summary.failedBusIds,t.blockingBusIds);if(this.attempts.push(t.summary),!this.bestAttempt||this.isAttemptBetter(t,this.bestAttempt))this.bestAttempt=t;if(this.stats={phase:"complete-assignment",assignment:t.summary.assignmentIndex+1,assignmentCount:this.config.maxLayerCombinations,routedBuses:`${t.summary.routedBusCount}/${this.preparedBuses.length}`,routedConnections:`${t.summary.routedConnectionCount}/${this.inputSrj.connections.length}`,failedBuses:t.summary.failedBusIds.join(", ")||"none",bestScore:this.bestAttempt.summary.score},t.stopAfterCompleteValidation&&this.hasCompleteBestAttempt()||this.groupedBeamEvaluated&&t.summary.routedConnectionCount===this.inputSrj.connections.length&&this.getCoordinatedAdditionalViaCount(this.bestAttempt.plans)===0)this.completeBestAttemptEndpoints(),this.solved=!0}getNextAssignment(){let e;while(!e&&this.nextAssignmentIndex<this.config.maxLayerCombinations){let t=this.nextAssignmentIndex%3===0,n,o=!1;if(!this.groupedBeamEvaluated&&this.nextAssignmentIndex>0)n=this.pendingRepairAssignments.pop(),o=n!==void 0;else if(t)n=this.layerAssignments[this.nextGeneratedAssignmentIndex++];else n=this.pendingRepairAssignments.pop(),o=n!==void 0;if(!n&&(this.groupedBeamEvaluated||this.nextAssignmentIndex===0))n=t?this.pendingRepairAssignments.pop():this.layerAssignments[this.nextGeneratedAssignmentIndex++],o=t&&n!==void 0;if(!n)break;let r=JSON.stringify(n);if(o)this.queuedAssignmentKeys.delete(r);if(this.evaluatedAssignmentKeys.has(r))continue;e=n}return e}finishWithoutAnotherAssignment(){if(this.hasCompleteBestAttempt()){this.completeBestAttemptEndpoints(),this.solved=!0;return}this.failed=!0;let e=this.lengthMatchingFailure?.message??this.bestAttempt?.summary.validationIssues?.[0]?.message;this.error=e?`FanoutSolver: ${e}`:this.bestAttempt?`FanoutSolver: best layer assignment routed ${this.bestAttempt.summary.routedConnectionCount}/${this.inputSrj.connections.length} connections`:"FanoutSolver: no layer assignment could be evaluated"}_step(){if(this.activeOperation){this.stepActiveOperation();return}if(!this.layerReservedRoutingEvaluated){this.layerReservedRoutingEvaluated=!0;let t=tGr(this.preparedBuses,this.config.allowBlindAndBuriedVias),n=!t&&iat({...this.config,srj:this.routingSrj,buses:this.preparedBuses})!==null;if(n||t||this.shouldTryLayerReservedRouting()){this.startOperation({name:"FanoutLayerReservedSolver",generator:this.evaluateLayerReservedRoutingSteps(t,n),onSolved:(o)=>{if(!o){this.inProgressPlans=[],this.stats={phase:"layer-reserved-fallback"};return}let r=o.summary.busLayerAssignments;this.layerAssignments.push(r),this.routingInitialized=!0,this.commitAssignmentAttempt(r,o)},getProgress:()=>Number(this.stats.workUnit??0)/Math.max(1,this.inputSrj.connections.length)}),this.stats={phase:"prepare-layer-reserved-routing"};return}}if(!this.routingInitialized){this.startOperation({name:"FanoutCandidateLayerSolver",generator:this.initializeRoutingSteps(),onSolved:()=>{},getProgress:()=>this.nextCandidateLayerBusIndex/Math.max(1,this.boundaryBuses.length+1)});return}if(this.nextAssignmentIndex>0&&this.hasGloballyViaMinimalBestAttempt()){this.completeBestAttemptEndpoints(),this.solved=!0;return}if(this.shouldEvaluateGroupedBeam()){this.groupedBeamEvaluated=!0,this.startOperation({name:"FanoutGroupedBeamSolver",generator:this.evaluateGroupedBeamAlternativesSteps(-1),onSolved:(t)=>this.commitGroupedBeamAttempt(t),getProgress:()=>{let t=Number(this.stats.workUnit??0),n=Number(this.stats.workUnitCount??0);return n>0?t/n:0}}),this.stats={...this.stats,phase:"prepare-grouped-beam"};return}let e=this.getNextAssignment();if(!e&&!this.groupedBeamEvaluated)return;if(!e){this.finishWithoutAnotherAssignment();return}this.startOperation({name:"FanoutAssignmentSolver",generator:this.evaluateAssignmentSteps(this.nextAssignmentIndex,e),onSolved:(t)=>this.commitAssignmentAttempt(e,t),getProgress:()=>{let t=this.stats.routingStrategy==="group-by-layer"?1:this.stats.routingStrategy==="deep-first"?2:0,n=Number(this.stats.workUnit??0),o=Number(this.stats.workUnitCount??0),r=o>0?Math.min(1,n/o):0;return(t+r)/3}}),this.stats={...this.stats,phase:"prepare-assignment",assignment:this.nextAssignmentIndex+1,assignmentCount:this.config.maxLayerCombinations,routedConnections:`0/${this.inputSrj.connections.length}`}}computeProgress(){if(this.solved||this.failed)return 1;if(this.activeSubSolver?.getSolverName()==="FanoutLayerReservedSolver")return Math.min(0.99,Number(this.stats.workUnit??0)/Math.max(1,this.inputSrj.connections.length));if(!this.routingInitialized)return 0.05*(this.nextCandidateLayerBusIndex/Math.max(1,this.boundaryBuses.length+1));let e=0;if(this.activeSubSolver?.getSolverName()==="FanoutAssignmentSolver"){let t=this.stats.routingStrategy==="group-by-layer"?1:this.stats.routingStrategy==="deep-first"?2:0,n=Number(this.stats.workUnit??0),o=Number(this.stats.workUnitCount??0),r=o>0?Math.min(1,n/o):0;e=(t+r)/3}return Math.min(0.99,0.05+0.95*((this.nextAssignmentIndex+e)/this.config.maxLayerCombinations))}getConstructorParams(){return[this.inputSrj,this.options]}getOutput(){if(!this.solved||!this.bestAttempt)throw Error("FanoutSolver: getOutput() called before a complete fanout was solved");let e=this.validateCompletePlans(this.bestAttempt.plans,this.bestAttempt.outputSrj);if(!e.valid)throw Error(`FanoutSolver: completed output failed validation: ${e.issues[0]?.message??"unknown validation error"}`);let t=pGr({srj:this.endpointCompletion?.simpleRouteJson??this.bestAttempt.outputSrj,layerNames:this.config.layerNames,allowBlindAndBuriedVias:this.config.allowBlindAndBuriedVias}),n=new Map((t.traces??[]).map((o)=>[o.pcb_trace_id,o]));return{simpleRouteJson:t,fanoutTraces:this.bestAttempt.plans.flatMap((o)=>[n.get(o.trace.pcb_trace_id)??o.trace,...o.planeEndpointTrace?[n.get(o.planeEndpointTrace.pcb_trace_id)??o.planeEndpointTrace]:[]]),completionTraces:(this.endpointCompletion?.traces??[]).map((o)=>n.get(o.pcb_trace_id)??o),...this.endpointCompletion?{endpointCompletion:this.endpointCompletion.report}:{},planeTerminations:this.bestAttempt.plans.flatMap((o)=>o.termination.type==="plane"&&o.via?[{busId:o.busId,connectionName:o.connectionName,layer:o.termination.layer,via:o.via}]:[]),busLayerAssignments:this.bestAttempt.summary.busLayerAssignments,busDirections:Object.fromEntries(this.preparedBuses.map((o)=>[o.busId,o.direction])),attempts:[...this.attempts],validation:e}}getOutputSimpleRouteJson(){return this.getOutput().simpleRouteJson}visualize(){return this.activeSubSolver?.visualize()??this.visualizeCurrentState()}};var IWr=(e)=>{if(typeof e!=="object"){let t=Ke.parse(e);return{top:t,right:t,bottom:t,left:t}}return{top:e.top===void 0?0:Ke.parse(e.top),right:e.right===void 0?0:Ke.parse(e.right),bottom:e.bottom===void 0?0:Ke.parse(e.bottom),left:e.left===void 0?0:Ke.parse(e.left)}},vWr=(e)=>{let t=(e.ccwRotationDegrees??0)*Math.PI/180,n=Math.abs(Math.cos(t)),o=Math.abs(Math.sin(t));return{x:(n*e.width+o*e.height)/2,y:(o*e.width+n*e.height)/2}},SWr=({preparedBuses:e,padding:t})=>{if(t===void 0)return;let n=new Map;for(let a of e){if(n.has(a.componentId))continue;n.set(a.componentId,a.componentObstacles.filter((c)=>c.connectedTo.length>0))}let o=[...n.values()].flat();if(o.length===0)throw Error("Cannot apply fanout boundary padding without source pad obstacles");let r=o.map((a)=>{let c=vWr(a);return{minX:a.center.x-c.x,maxX:a.center.x+c.x,minY:a.center.y-c.y,maxY:a.center.y+c.y}}),i=IWr(t),s={minX:Math.min(...r.map((a)=>a.minX))-i.left,maxX:Math.max(...r.map((a)=>a.maxX))+i.right,minY:Math.min(...r.map((a)=>a.minY))-i.bottom,maxY:Math.max(...r.map((a)=>a.maxY))+i.top};for(let a of e){if(a.termination.type!=="boundary")continue;for(let c of a.connections)if(a.direction==="left"||a.direction==="right")s.minY=Math.min(s.minY,c.targetPoint.y),s.maxY=Math.max(s.maxY,c.targetPoint.y);else s.minX=Math.min(s.minX,c.targetPoint.x),s.maxX=Math.max(s.maxX,c.targetPoint.x)}return s},PWr=(e)=>Math.round(e*1000)/1000,EWr=(e,t)=>{let n;for(let o of e.obstacles){if(!o.componentId||!t.has(o.componentId))continue;let r=o.center.x-o.width/2,i=o.center.x+o.width/2,s=o.center.y-o.height/2,a=o.center.y+o.height/2;n=n?{minX:Math.min(n.minX,r),maxX:Math.max(n.maxX,i),minY:Math.min(n.minY,s),maxY:Math.max(n.maxY,a)}:{minX:r,maxX:i,minY:s,maxY:a}}return n},MWr=(e,t)=>Math.min(e.minX-t.minX,t.maxX-e.maxX,e.minY-t.minY,t.maxY-e.maxY),wWr=({input:e,solverError:t,componentIds:n,sharedBoundary:o,componentNamesById:r})=>{let i=t?.match(/routed (\d+)\/(\d+) connections/),s=i?Number(i[1]):void 0,a=i?Number(i[2]):e.connections.length,c=[...n].map((u)=>r?.get(u)??u).sort(),l=c.length>0?` for ${c.join(", ")}`:"",h=[s===void 0?`Fanout failed${l}: ${t??"the fanout solver did not report a reason"}.`:`Fanout failed${l}: only ${s} of ${a} connections could escape to the breakout boundary.`],d=EWr(e,n);if(d&&o){let u=MWr(d,o);h.push(`The breakout boundary is ${PWr(u)}mm from the pads at its narrowest point, which all ${a} escapes have to share.`)}return h.push("Give the fanout more room by increasing the breakout's padding, or by extending the breakout to include the parts crowding it (decoupling capacitors, series resistors) so their pads sit inside the boundary instead of against it."),h.join(" ")},BWr=(e,t)=>Math.abs(e.minX-t.minX)>0.000001||Math.abs(e.maxX-t.maxX)>0.000001||Math.abs(e.minY-t.minY)>0.000001||Math.abs(e.maxY-t.maxY)>0.000001,TWr=(e,t)=>{if(!e&&t.length===0)return;return{minX:Math.min(e?.minX??Number.POSITIVE_INFINITY,...t.map((n)=>n.x)),maxX:Math.max(e?.maxX??Number.NEGATIVE_INFINITY,...t.map((n)=>n.x)),minY:Math.min(e?.minY??Number.POSITIVE_INFINITY,...t.map((n)=>n.y)),maxY:Math.max(e?.maxY??Number.NEGATIVE_INFINITY,...t.map((n)=>n.y))}},DWr=(e,t)=>e?.map((n)=>{let{preferredLayer:o,preferredLayers:r,...i}=n,s=t?.[n.busId],a=s===void 0?void 0:aat(s),c=a&&a!=="center"&&cat(a)?a:void 0,l={...i,...n.termination?.type==="plane"?{}:c?{exitPosition:c}:{}},h=[...o===void 0?[]:[o],...r??[]].filter((_,p,m)=>m.indexOf(_)===p);if(h.length===0)return l;let d=n.allowedLayers,u=d===void 0?h:h.filter((_)=>d.includes(_));return{...l,allowedLayers:u}}),aat=(e)=>typeof e==="string"?e:e.direction,NWr=new Set(pze),cat=(e)=>NWr.has(e),RWr=(e)=>{switch(e){case"top_left":return"top-left";case"top_center":return"top";case"top_right":return"top-right";case"center_left":return"left";case"center":return;case"center_right":return"right";case"bottom_left":return"bottom-left";case"bottom_center":return"bottom";case"bottom_right":return"bottom-right"}},QWr=(e)=>{switch(e){case"top_left":case"top_center":case"top_right":return"up";case"center_left":return"left";case"center":return;case"center_right":return"right";case"bottom_left":case"bottom_center":case"bottom_right":return"down"}},kWr=(e)=>{let t=aat(e);return cat(t)?Z3n(t).direction:QWr(t)},LWr=(e,t)=>e.obstacles.find((o)=>o.componentId&&o.layers.includes(t.layer)&&(t.pointId&&o.connectedTo.includes(t.pointId)||t.x>=o.center.x-o.width/2&&t.x<=o.center.x+o.width/2&&t.y>=o.center.y-o.height/2&&t.y<=o.center.y+o.height/2))?.componentId,HWr=(e,t)=>{let n=new Set(t.connectionNames),o=new Map;for(let f of e.connections){if(!n.has(f.name))continue;for(let y of f.pointsToConnect){let x=LWr(e,y);if(!x)continue;let C=o.get(x)??[];C.push(y),o.set(x,C)}}let r=[...o.entries()].sort(([f,y],[x,C])=>C.length-y.length||f.localeCompare(x))[0];if(!r)return;let[i,s]=r,a=e.obstacles.filter((f)=>f.componentId===i);if(a.length===0)return;let c=a.map((f)=>f.center.x),l=a.map((f)=>f.center.y),h=Math.min(...c),d=Math.max(...c),u=Math.min(...l),_=Math.max(...l),p={x:(h+d)/2,y:(u+_)/2},m={x:Math.max((d-h)/2,0.000001),y:Math.max((_-u)/2,0.000001)},A={x:s.reduce((f,y)=>f+y.x,0)/s.length,y:s.reduce((f,y)=>f+y.y,0)/s.length},g={x:(A.x-p.x)/m.x,y:(A.y-p.y)/m.y};if(Math.abs(g.x)>Math.abs(g.y))return g.x>=0?"right":"left";if(Math.abs(g.y)>0.000000001)return g.y>=0?"up":"down";return"right"},FWr=({fanoutSimpleRouteJson:e,sourceComponentIds:t})=>{let n=new Map;for(let r of e.obstacles){if(!r.componentId||!t.has(r.componentId))continue;let i=n.get(r.componentId)??[];i.push(r),n.set(r.componentId,i)}let o=[];for(let[r,i]of n){let s=Math.min(...i.map((h)=>h.center.x-h.width/2)),a=Math.max(...i.map((h)=>h.center.x+h.width/2)),c=Math.min(...i.map((h)=>h.center.y-h.height/2)),l=Math.max(...i.map((h)=>h.center.y+h.height/2));o.push({obstacleId:`fanout-source-keepout:${r}`,componentId:r,isFanoutSourceKeepout:!0,type:"rect",layers:vG(e.layerCount),center:{x:(s+a)/2,y:(c+l)/2},width:a-s,height:l-c,connectedTo:[]})}return{...e,obstacles:[...e.obstacles.filter((r)=>!r.componentId||!t.has(r.componentId)),...o]}},eit=class e{constructor(t,n){this.input=t,this.options=n}input;options;isRouting=!1;outputSimpleRouteJson;startTimeoutId;eventHandlers={complete:[],error:[],progress:[]};getLegacyBusExitPreferences(){if(!this.options.busFanoutDirections)return;let t=new Set(this.input.buses?.map((r)=>r.busId)??[]),n=new Set(this.input.buses?.filter((r)=>r.termination?.type==="plane").map((r)=>r.busId)??[]),o={};for(let[r,i]of Object.entries(this.options.busFanoutDirections)){if(!t.has(r))throw Error(`Fanout direction references unknown bus "${r}" in this autorouting phase`);if(n.has(r))continue;let s=aat(i);if(cat(s))continue;let a=RWr(s);if(a)o[r]=a}return Object.keys(o).length>0?o:void 0}getPlaneBusDirections(){let t=this.input.buses?.filter((r)=>r.termination?.type==="plane")??[],n=new Set(t.map((r)=>r.busId)),o={};for(let[r,i]of Object.entries(this.options.busFanoutDirections??{})){if(!n.has(r))continue;let s=kWr(i);if(s)o[r]=s}for(let r of t){if(o[r.busId])continue;let i=HWr(this.input,r);if(i)o[r.busId]=i}return Object.keys(o).length>0?o:void 0}getFanoutSolverOptions(){let t={buses:DWr(this.input.buses,this.options.busFanoutDirections),borderDistribution:"even",compactBusTracks:!0,busDirections:this.getPlaneBusDirections(),busExitPreferences:this.getLegacyBusExitPreferences(),escapeLayers:this.options.fanoutRoutingLayers,allowBlindAndBuriedVias:this.options.allowBlindAndBuriedVias??this.input.allowBlindAndBuriedVias};if(this.options.mode==="single_layer_fanout")return{...t,escapeLayers:["top"],singleLayerPushAndShove:!0};return t}static resolveFanoutBounds(t,n){let o,r;if(n.fanoutBoundaryPadding!==void 0){let i=new e(t,n),s=new pve(t,i.getFanoutSolverOptions());o=SWr({preparedBuses:s.preparedBuses,padding:n.fanoutBoundaryPadding})}else if(n.fanoutBounds===void 0){let i=new e(t,n);r=new pve(t,i.getFanoutSolverOptions()).preparedBuses[0]?.sharedBoundary}if(n.fanoutBounds&&o&&BWr(n.fanoutBounds,o))n.onFanoutBoundsConflict?.();return TWr(n.fanoutBounds??o??r,n.breakoutPoints??[])}solveFanout(){let t=this.getFanoutSolverOptions(),n=new pve(this.input,{...t,...this.options.fanoutBounds?{sharedBoundary:this.options.fanoutBounds}:{}}),o=n.getConstructorParams();if(this.options.onSolverStarted?.({solverName:"FanoutSolver",solverParams:o[0],solverConstructorArgs:o}),n.solve(),n.failed)throw Error(wWr({input:this.input,solverError:n.error,componentIds:new Set(n.preparedBuses.map((a)=>a.componentId)),sharedBoundary:this.options.fanoutBounds??t.sharedBoundary,componentNamesById:this.options.componentNamesById}));let r=n.getOutput(),{simpleRouteJson:i,fanoutTraces:s}=r;return{downstreamSimpleRouteJson:FWr({fanoutSimpleRouteJson:i,sourceComponentIds:new Set(n.preparedBuses.map((a)=>a.componentId))}),fanoutTraces:s,debugGraphics:n.visualize()}}startFanout(){try{let{downstreamSimpleRouteJson:t,fanoutTraces:n,debugGraphics:o}=this.solveFanout();if(!this.isRouting)return;this.outputSimpleRouteJson=t,this.emitEvent({type:"progress",steps:1,progress:1,phase:this.options.mode,debugGraphics:o}),this.isRouting=!1,this.emitEvent({type:"complete",traces:n})}catch(t){this.isRouting=!1,this.emitEvent({type:"error",error:t instanceof Error?t:Error(String(t))})}}start(){if(this.isRouting)return;this.isRouting=!0,this.startTimeoutId=setTimeout(()=>{this.startTimeoutId=void 0,this.startFanout()},0)}stop(){if(this.startTimeoutId!==void 0)clearTimeout(this.startTimeoutId),this.startTimeoutId=void 0;this.isRouting=!1}on(t,n){if(t==="complete")this.eventHandlers.complete.push(n);else if(t==="error")this.eventHandlers.error.push(n);else this.eventHandlers.progress.push(n)}emitEvent(t){if(t.type==="complete")for(let n of this.eventHandlers.complete)n(t);else if(t.type==="error")for(let n of this.eventHandlers.error)n(t);else for(let n of this.eventHandlers.progress)n(t)}solveSync(){let{downstreamSimpleRouteJson:t,fanoutTraces:n}=this.solveFanout();return this.outputSimpleRouteJson=t,n}getOutputSimpleRouteJson(){return this.outputSimpleRouteJson}},l9e=0.000001;function zWr(e,t){if(!e.subcircuit_connectivity_map_key||e.subcircuit_connectivity_map_key!==t.subcircuit_connectivity_map_key||e.subcircuit_id!==t.subcircuit_id)return!1;let n=e.layers.toSorted(),o=t.layers.toSorted();return Math.abs(e.x-t.x)<=l9e&&Math.abs(e.y-t.y)<=l9e&&Math.abs(e.hole_diameter-t.hole_diameter)<=l9e&&Math.abs(e.outer_diameter-t.outer_diameter)<=l9e&&n.length===o.length&&n.every((r,i)=>r===o[i])}var OWr=({db:e,connectedOffboardObstacles:t,simpleRouteJson:n,subcircuit_id:o})=>{if(Object.keys(t).length===0)return;let r=new Map;for(let a of e.pcb_port.list())if(a.source_port_id){let c=e.pcb_smtpad.getWhere({pcb_port_id:a.pcb_port_id});if(c)r.set(c.pcb_smtpad_id,a.source_port_id);let l=e.pcb_plated_hole.getWhere({pcb_port_id:a.pcb_port_id});if(l)r.set(l.pcb_plated_hole_id,a.source_port_id)}let i=new Map;for(let a of n.obstacles)if(a.obstacleId)i.set(a.obstacleId,a);let s=new Map;for(let[a,c]of Object.entries(t)){if(!s.has(c))s.set(c,[]);s.get(c).push(a)}for(let[a,c]of s){let l=new Set;for(let _ of c){let p=i.get(_);if(!p)continue;for(let m of p.connectedTo){let A=r.get(m);if(A)l.add(A)}}if(l.size<2)continue;let h=Array.from(l);if(e.source_trace.list().some((_)=>{let p=new Set(_.connected_source_port_ids);return h.every((m)=>p.has(m))}))continue;e.source_trace.insert({connected_source_port_ids:h,connected_source_net_ids:[],subcircuit_id:o??void 0,display_name:`offboard_${a}`})}},QCn=({traceWidth:e,traceToPadClearance:t,viaPadDiameter:n})=>(n??Math.max(e*2,0.3))+2*(e+t),VWr=(e)=>{let t=new Map;for(let n of e.pcb_component.list()){let o=e.source_component.get(n.source_component_id);if(o?.name)t.set(n.pcb_component_id,o.name)}return t},lot=(e)=>e?.replace(/-/g,"_");function kCn(e){if(!e)return null;if(typeof e==="string"){let n=lot(e);return n==="sequential_trace"||n==="auto_cloud"?n:null}let t=lot(e.preset);if(t==="sequential_trace"||t==="auto_cloud")return t;return lot(e.groupMode)==="sequential_trace"?"sequential_trace":null}function Yde(e,t){let n={serverUrl:"https://registry-api.tscircuit.com",serverMode:"job",serverCacheEnabled:!0};if(typeof e==="object"&&!e.preset)return{local:!(e.serverUrl||e.serverMode||e.serverCacheEnabled),...n,...e};let o=typeof e==="object"?e.preset:e,r=typeof e==="object"?e:{},i=typeof o==="string"?o.replace(/_/g,"-"):o,s=i&&typeof i==="string"?t?.autorouterMap?.[i]:void 0;if(s)return{local:!0,groupMode:"subcircuit",algorithmFn:async(a)=>s.createAutorouter(a)};switch(i){case"default":case"auto":case"auto-local":return{local:!0,groupMode:"subcircuit"};case"sequential-trace":return{local:!0,groupMode:"sequential-trace"};case"subcircuit":return{local:!0,groupMode:"subcircuit"};case"beta-pipeline9":return{local:!0,groupMode:"subcircuit",autorouterVersion:"beta_pipeline9"};case"single-layer-fanout":return{local:!0,groupMode:"subcircuit",preset:"single_layer_fanout"};case"single-layer-routing":case"bus-lanes":return{...r,local:!0,groupMode:"subcircuit",preset:"bus_lanes"};case"dogbone":return{local:!0,groupMode:"subcircuit",preset:"dogbone"};case"fanout":return{...r,local:!0,groupMode:"subcircuit",preset:"fanout"};case"simplify":return{local:!0,groupMode:"subcircuit",preset:"simplify"};case"auto-cloud":{let{preset:a,local:c,groupMode:l,...h}=r;return{local:!1,groupMode:"subcircuit",...n,...h}}case"laser-prefab":{let{preset:a,local:c,groupMode:l,...h}=r;return{local:!0,groupMode:"subcircuit",preset:"laser_prefab",...h}}case"auto-jumper":{let{preset:a,local:c,groupMode:l,...h}=r;return{local:!0,groupMode:"subcircuit",preset:"auto_jumper",...h}}default:return{local:!0,groupMode:"subcircuit"}}}var ZY=0.000000001;function LCn(e){return e.shape==="circle"}function tit(e,t){let n=-(t.ccwRotationDegrees??0)*Math.PI/180,o=e.x-t.center.x,r=e.y-t.center.y;return{x:o*Math.cos(n)-r*Math.sin(n),y:o*Math.sin(n)+r*Math.cos(n)}}function Yk(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function eT(e,t,n){let o=n.x-t.x,r=n.y-t.y,i=o*o+r*r,s=i<ZY?0:((e.x-t.x)*o+(e.y-t.y)*r)/i,a=Math.max(0,Math.min(1,s));return Math.hypot(e.x-(t.x+a*o),e.y-(t.y+a*r))}function h9e(e,t,n){return(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x)}function YWr(e,t,n,o){let r=h9e(n,o,e),i=h9e(n,o,t),s=h9e(e,t,n),a=h9e(e,t,o);return(r>0&&i<0||r<0&&i>0)&&(s>0&&a<0||s<0&&a>0)}function HCn(e,t,n,o){if(YWr(e,t,n,o))return 0;return Math.min(eT(e,n,o),eT(t,n,o),eT(n,e,t),eT(o,e,t))}function GWr(e,t){if(LCn(t))return Math.max(0,Yk(e,t.center)-t.width/2);let n=tit(e,t),o=Math.max(Math.abs(n.x)-t.width/2,0),r=Math.max(Math.abs(n.y)-t.height/2,0);return Math.hypot(o,r)}function UWr(e,t){if(LCn(t))return Math.max(0,eT(t.center,e.start,e.end)-t.width/2);let n=tit(e.start,t),o=tit(e.end,t);if(Math.abs(n.x)<=t.width/2+ZY&&Math.abs(n.y)<=t.height/2+ZY)return 0;if(Math.abs(o.x)<=t.width/2+ZY&&Math.abs(o.y)<=t.height/2+ZY)return 0;let r=-t.width/2,i=t.width/2,s=-t.height/2,a=t.height/2,c=[{x:r,y:s},{x:i,y:s},{x:i,y:a},{x:r,y:a}],l=Number.POSITIVE_INFINITY;for(let h=0;h<c.length;h++)l=Math.min(l,HCn(n,o,c[h],c[(h+1)%c.length]));return l}function FCn(e,t,n){if(e.layer!==t.layer)return!0;let o=(e.width+t.width)/2+n,r=o+ZY;if(Math.min(e.start.x,e.end.x)-Math.max(t.start.x,t.end.x)>r||Math.min(t.start.x,t.end.x)-Math.max(e.start.x,e.end.x)>r||Math.min(e.start.y,e.end.y)-Math.max(t.start.y,t.end.y)>r||Math.min(t.start.y,t.end.y)-Math.max(e.start.y,e.end.y)>r)return!0;return HCn(e.start,e.end,t.start,t.end)>=o-ZY}var v0=0.000000001,WWr=1e5;function XWr(e){for(let[n,o]of[["viaDiameter",e.viaDiameter],["traceWidth",e.traceWidth]])if(!Number.isFinite(o)||o<=0)throw Error(`FanoutSolver: dogbone ${n} must be a positive finite number, received ${o}`);if(!Number.isFinite(e.clearance)||e.clearance<0)throw Error(`FanoutSolver: dogbone clearance must be a non-negative finite number, received ${e.clearance}`);if(e.viaHoleDiameter!==void 0&&(!Number.isFinite(e.viaHoleDiameter)||e.viaHoleDiameter<=0))throw Error(`FanoutSolver: dogbone viaHoleDiameter must be a positive finite number, received ${e.viaHoleDiameter}`);if(e.holeToHoleClearance!==void 0&&(!Number.isFinite(e.holeToHoleClearance)||e.holeToHoleClearance<0))throw Error(`FanoutSolver: dogbone holeToHoleClearance must be a non-negative finite number, received ${e.holeToHoleClearance}`);if(e.holeToHoleClearance!==void 0&&e.viaHoleDiameter===void 0)throw Error("FanoutSolver: dogbone holeToHoleClearance requires viaHoleDiameter");let t=e.maximumSearchStates??WWr;if(!Number.isInteger(t)||t<1)throw Error(`FanoutSolver: dogbone maximumSearchStates must be a positive integer, received ${t}`);return t}function nit(e){let t=[];for(let n of e.toSorted((o,r)=>o-r)){if(!Number.isFinite(n))continue;if(t.length===0||Math.abs(t.at(-1)-n)>v0)t.push(n)}return t}function jWr(e){let t=new Map,n=new Map,o=new Map;for(let r of e){let i=t.get(r.componentId);if(!i)i={componentId:r.componentId,connections:[],obstacles:[],xCoordinates:[],yCoordinates:[],pitchX:Number.POSITIVE_INFINITY,pitchY:Number.POSITIVE_INFINITY},t.set(r.componentId,i),o.set(r.componentId,new Set);if(i.xCoordinates.push(...r.xCoordinates),i.yCoordinates.push(...r.yCoordinates),Number.isFinite(r.pitchX)&&r.pitchX>v0)i.pitchX=Math.min(i.pitchX,r.pitchX);if(Number.isFinite(r.pitchY)&&r.pitchY>v0)i.pitchY=Math.min(i.pitchY,r.pitchY);let s=o.get(r.componentId);for(let a of r.componentObstacles)if(!s.has(a))s.add(a),i.obstacles.push(a);for(let a of r.connections){let c=n.get(a.connectionIndex);if(c!==void 0){if(c!==r.componentId)throw Error(`FanoutSolver: connection index ${a.connectionIndex} belongs to multiple components`);continue}n.set(a.connectionIndex,r.componentId),i.connections.push({preparedConnection:a,busId:r.busId,direction:r.direction,terminationType:r.termination.type})}}return[...t.values()].map((r)=>({...r,connections:r.connections.toSorted((i,s)=>i.preparedConnection.connectionIndex-s.preparedConnection.connectionIndex),xCoordinates:nit(r.xCoordinates),yCoordinates:nit(r.yCoordinates)})).toSorted((r,i)=>r.componentId.localeCompare(i.componentId))}function KWr(e){let{coordinates:t,pitch:n}=e;if(t.length===0||!Number.isFinite(n)||n<=v0)return[];let o=[t[0]-n/2];for(let r=1;r<t.length;r++)o.push((t[r-1]+t[r])/2);return o.push(t.at(-1)+n/2),nit(o)}function Kfn(e){let{sourceCoordinate:t,coordinates:n,pitch:o}=e,r=KWr({coordinates:n,pitch:o}),i=r.filter((a)=>a<t-v0).at(-1),s=r.find((a)=>a>t+v0);return[i,s].filter((a)=>a!==void 0)}function $Wr(e,t){let n=Math.abs(t.x-e.x),o=Math.abs(t.y-e.y);return n<=v0||o<=v0||Math.abs(n-o)<=v0}function qWr(e){let{source:t,site:n,direction:o}=e,r=o==="right"?n.x-t.x:o==="left"?t.x-n.x:o==="up"?n.y-t.y:t.y-n.y;return r>v0?0:Math.abs(r)<=v0?1:2}function JWr(e){let{point:t,obstacles:n,viaDiameter:o,clearance:r}=e,i=o/2+r;return n.every((s)=>GWr(t,s)>=i-v0)}function ZWr(e){let{segment:t,sourceObstacle:n,obstacles:o,clearance:r}=e,i=t.width/2+r;return o.every((s)=>s===n||UWr(t,s)>=i-v0)}function eXr(e){let{connection:t,component:n,rules:o}=e,{preparedConnection:r,direction:i}=t,s=o.additionalObstacles?[...new Set([...n.obstacles,...o.additionalObstacles])]:n.obstacles,a={x:r.sourcePoint.x,y:r.sourcePoint.y},c=Kfn({sourceCoordinate:a.x,coordinates:n.xCoordinates,pitch:n.pitchX}),l=Kfn({sourceCoordinate:a.y,coordinates:n.yCoordinates,pitch:n.pitchY}),h=[...c.map((I)=>({x:I,y:a.y})),...l.map((I)=>({x:a.x,y:I})),...c.flatMap((I)=>l.map((v)=>({x:I,y:v})))],d=[];for(let I of h)if(!d.some((v)=>Yk(v,I)<=v0))d.push(I);let u=o.fixedViaPointsByConnectionIndex?.get(r.connectionIndex),_=u?[u]:d,p=[];for(let I of _){if(t.terminationType==="plane"&&!$Wr(a,I))continue;if(!JWr({point:I,obstacles:s,viaDiameter:o.viaDiameter,clearance:o.clearance}))continue;let v={start:a,end:I,width:o.traceWidth,layer:r.sourceLayer};if(!ZWr({segment:v,sourceObstacle:r.sourceObstacle,obstacles:s,clearance:o.clearance}))continue;if(!(o.blockingSegments??[]).every((B)=>{if(B.connectionIndex===r.connectionIndex)return!0;if(o.canShareCopper?.(r.connectionIndex,B.connectionIndex))return!0;let T=o.viaDiameter/2+B.segment.width/2+o.clearance;if(eT(I,B.segment.start,B.segment.end)<T-v0)return!1;return B.segment.layer!==v.layer||FCn(v,B.segment,o.clearance)}))continue;if(!(o.blockingVias??[]).every((B)=>{if(B.connectionIndex===r.connectionIndex)return!0;if(Yk(I,B.center)<(o.viaDiameter+B.diameter)/2+o.clearance-v0)return!1;if(B.spanLayers.includes(v.layer)&&eT(B.center,v.start,v.end)<B.diameter/2+v.width/2+o.clearance-v0)return!1;return!0}))continue;p.push({connectionIndex:r.connectionIndex,point:I,sourceSegment:v,outwardRank:qWr({source:a,site:I,direction:i})})}let m=i==="left"||i==="right"?n.yCoordinates:n.xCoordinates,A=i==="left"||i==="right"?a.y:a.x,g=m.findIndex((I)=>Math.abs(I-A)<=v0),f=g>=0?g%2===0?1:-1:void 0,y=t.terminationType==="boundary"?o.preferredBoundaryPerpendicularSideByBusId?.get(t.busId):o.preferPlaneCheckerboardSites&&t.terminationType==="plane"&&(i==="left"||i==="right")?f:void 0,x=t.terminationType==="boundary"?o.preferBoundaryOutwardByBusId?.get(t.busId)??!0:!0,C=o.preferredViaPointsByConnectionIndex?.get(r.connectionIndex),b=(I)=>{if(y===void 0)return 0;let v=i==="left"||i==="right"?I.point.y-a.y:I.point.x-a.x;return v*y>v0?0:Math.abs(v)<=v0?1:2};return p.toSorted((I,v)=>(C?Number(Yk(I.point,C)>v0)-Number(Yk(v.point,C)>v0):0)||(x?I.outwardRank-v.outwardRank:v.outwardRank-I.outwardRank)||b(I)-b(v)||Yk(a,I.point)-Yk(a,v.point)||I.point.x-v.point.x||I.point.y-v.point.y)}function tXr(e){let{first:t,second:n,rules:o}=e,r=o.canShareCopper?.(t.connectionIndex,n.connectionIndex)??!1,i=o.viaHoleDiameter?o.viaHoleDiameter+(o.holeToHoleClearance??o.clearance):0,s=r?i:Math.max(o.viaDiameter+o.clearance,i);if(Yk(t.point,n.point)<s-v0)return!1;let a=o.viaDiameter/2+o.traceWidth/2+o.clearance;if(!r){if(eT(t.point,n.sourceSegment.start,n.sourceSegment.end)<a-v0||eT(n.point,t.sourceSegment.start,t.sourceSegment.end)<a-v0)return!1}if(r)return!0;return FCn(t.sourceSegment,n.sourceSegment,o.clearance)}function nXr(e){let{component:t,rules:n,consumeSearchState:o}=e,r=t.connections.map((_)=>({connection:_,candidates:eXr({connection:_,component:t,rules:n})}));if(r.some((_)=>_.candidates.length===0))return null;let i=new Map,s=(_,p)=>{let m=i.get(_)?.get(p);if(m!==void 0)return m;let A=tXr({first:_,second:p,rules:n}),g=i.get(_)??new Map;g.set(p,A),i.set(_,g);let f=i.get(p)??new Map;return f.set(_,A),i.set(p,f),A},a=r.flatMap((_)=>_.candidates.length===1?[_.candidates[0]]:[]);for(let _=0;_<a.length;_++){let p=a[_];for(let m=0;m<_;m++)if(!s(p,a[m]))return null}let c=new Map(a.map((_)=>[_.connectionIndex,_])),l=new Set(r.flatMap((_)=>_.candidates.length>1?[_.connection.preparedConnection.connectionIndex]:[])),h=new Map(r.map((_)=>[_.connection.preparedConnection.connectionIndex,_]));if(l.size===0)return new Map([...c.entries()].map(([_,p])=>[_,{...p.point}]));let d=(_)=>_.candidates.filter((p)=>[...c.values()].every((m)=>s(p,m))),u=()=>{if(!o())return!1;if(l.size===0)return!0;let _,p=[];for(let A of[...l].toSorted((g,f)=>g-f)){let g=h.get(A),f=d(g);if(f.length===0)return!1;if(!_||f.length<p.length||f.length===p.length&&A<_.connection.preparedConnection.connectionIndex)_=g,p=f}let m=_.connection.preparedConnection.connectionIndex;l.delete(m);for(let A of p){if(c.set(m,A),u())return!0;c.delete(m)}return l.add(m),!1};if(!u())return null;return new Map([...c.entries()].toSorted(([_],[p])=>_-p).map(([_,p])=>[_,{...p.point}]))}function oXr(e,t){let n=XWr(t);if(e.length===0)return new Map;let o=0,r=()=>(o++,o<=n),i=new Map;for(let s of jWr(e)){let a=nXr({component:s,rules:t,consumeSearchState:r});if(!a)return null;for(let[c,l]of a)i.set(c,l)}return i}var joa=Math.PI*2,Koa=globalThis.process?.env?.FANOUT_FLOW_DEBUG==="1",rXr=(e)=>e.process??{env:{}},$oa=rXr(globalThis);function iXr(e){if(e<=1)return["top"];return["top",...Array.from({length:e-2},(t,n)=>`inner${n+1}`),"bottom"]}var zCn=class extends po{constructor(e){super();this.params=e,this.MAX_ITERATIONS=e.input.connections.length*2+10,this.steps=this.solveSteps()}params;phase="preparing";sources=[];sites=new Map;traces=[];steps;getConstructorParams(){return[this.params]}_step(){try{if(this.steps.next().done)this.phase="complete",this.progress=1,this.solved=!0}catch(e){this.error=e instanceof Error?e.message:String(e),this.failed=!0}}getOutput(){if(!this.solved)throw Error(this.error??"Dogbone fanout is not solved");return this.traces}visualize(){return{rects:this.params.input.obstacles.filter((e)=>e.shape!=="circle").map((e)=>({center:e.center,width:e.width,height:e.height,fill:"rgba(200,40,40,0.3)"})),circles:[...this.params.input.obstacles.filter((e)=>e.shape==="circle").map((e)=>({center:e.center,radius:e.width/2,fill:"rgba(200,40,40,0.3)"})),...[...this.sites.values()].map((e)=>({center:e,radius:(this.params.input.minViaPadDiameter??this.params.input.minViaDiameter??0.6)/2,fill:"orange"}))],lines:[...this.sites].map(([e,t])=>({points:[this.sources[e].port,t],strokeColor:"orange",strokeWidth:this.params.input.minTraceWidth}))}}*solveSteps(){let{input:e,fanoutRoutingLayers:t}=this.params,n=e.minTraceWidth,o=e.minTraceToPadEdgeClearance??0.1,r=e.minViaPadDiameter??e.minViaDiameter??0.6,i=e.minViaHoleDiameter??0.3,s=e.minViaEdgeToPadEdgeClearance??o,a=e.minBoardEdgeClearance??o,c=e.minViaHoleEdgeToViaHoleEdgeClearance??o;this.sources=e.connections.map((g)=>{let f=g.pointsToConnect.find((x)=>x.pcb_port_id&&e.obstacles.some((C)=>C.componentId&&Math.hypot(C.center.x-x.x,C.center.y-x.y)<0.000001));if(!f?.pcb_port_id)throw Error(`Dogbone connection ${g.name} has no source pad`);let y=e.obstacles.find((x)=>x.componentId&&Math.hypot(x.center.x-f.x,x.center.y-f.y)<0.000001);return{port:{pcb_port_id:f.pcb_port_id,pcb_component_id:y.componentId,x:f.x,y:f.y,layers:[Lo.parse(f.layer)]},sourceTraceId:g.source_trace_id}});let l=this.sources,h=iXr(e.layerCount),d=t??h;if(d.some((g)=>!h.some((f)=>f===g)))throw Error("Dogbone fanout targets an unavailable board layer");let u=[],_=l.map(({port:g,sourceTraceId:f},y)=>{let x=e.obstacles.find((P)=>P.componentId===g.pcb_component_id&&Math.hypot(P.center.x-g.x,P.center.y-g.y)<0.000001);if(!x)throw Error("Dogbone fanout requires a component pad at each source port");if(g.layers.length!==1||!h.includes(g.layers[0]))throw Error("Dogbone fanout requires a single-layer SMT source pad");let C=g.layers[0],b=d.find((P)=>P!==C);if(!b)throw Error("Dogbone fanout requires a legal layer distinct from the source pad");let I=u.find((P)=>P.componentId===x.componentId);if(!I){let P=e.obstacles.filter((N)=>N.componentId===x.componentId),M=[...new Set(P.map((N)=>Math.round(N.center.x*1e6)/1e6))].sort((N,D)=>N-D),B=[...new Set(P.map((N)=>Math.round(N.center.y*1e6)/1e6))].sort((N,D)=>N-D);if(M.length<2||B.length<2)throw Error("Dogbone fanout requires a two-dimensional pad grid");let T=(N)=>Math.min(...N.slice(1).map((D,L)=>D-N[L]));I={busId:x.componentId,componentId:x.componentId,componentObstacles:P,connections:[],direction:"down",termination:{type:"boundary"},componentBounds:{minX:M[0],maxX:M.at(-1),minY:B[0],maxY:B.at(-1)},sharedBoundary:e.bounds,xCoordinates:M,yCoordinates:B,pitchX:T(M),pitchY:T(B)},u.push(I)}let v={x:g.x,y:g.y,layer:C,pcb_port_id:g.pcb_port_id};return I.connections.push({connectionIndex:y,connection:{name:g.pcb_port_id,pointsToConnect:[v]},sourcePoint:v,sourcePointIndex:0,sourceLayer:C,sourceObstacle:x,targetPoint:v}),{sourceTraceId:f,port:g,sourceLayer:C,targetLayer:b}}),p=this.sites,m=[],A=[];for(let g of u){this.phase="assigning_sites",yield;let f=oXr([g],{traceWidth:n,clearance:Math.max(o,s),viaDiameter:r,viaHoleDiameter:i,holeToHoleClearance:c,additionalObstacles:e.obstacles,blockingSegments:m,blockingVias:A});if(!f||f.size!==g.connections.length)throw Error("No complete local dogbone assignment within clearance/search limits");for(let y of g.connections){let x=y.connectionIndex,C=f.get(x);p.set(x,C),m.push({connectionIndex:x,segment:{start:y.sourcePoint,end:C,width:n,layer:y.sourceLayer}}),A.push({connectionIndex:x,center:C,diameter:r,spanLayers:h})}}this.phase="creating_traces";for(let[g,{sourceTraceId:f,port:y,sourceLayer:x,targetLayer:C}]of _.entries()){let b=p.get(g),I=Math.abs(b.x-y.x),v=Math.abs(b.y-y.y);if(I>0.000001&&v>0.000001&&Math.abs(I-v)>0.000001)throw Error("Dogbone fanout requires straight or 45-degree local escapes");let P=r/2+a;if(b.x<e.bounds.minX+P||b.x>e.bounds.maxX-P||b.y<e.bounds.minY+P||b.y>e.bounds.maxY-P)throw Error("Dogbone via violates board-edge clearance");this.traces.push({type:"pcb_trace",pcb_trace_id:`dogbone_${y.pcb_port_id}`,source_trace_id:f,connectsTo:[y.pcb_port_id],route:[{route_type:"wire",x:y.x,y:y.y,layer:x,width:n},{route_type:"wire",...b,layer:x,width:n},{route_type:"via",...b,from_layer:x,to_layer:C,via_diameter:r,via_hole_diameter:i,layers:h},{route_type:"wire",...b,layer:C,width:n},{route_type:"wire",...b,layer:C,width:n}]}),this.progress=(g+1)/_.length,yield}}},sXr=class{constructor(e,t={}){this.params=e,this.callbacks=t,this.solver=new zCn(e)}params;callbacks;get input(){return this.params.input}isRouting=!1;solver;timer;listeners=[];finishSolver(){this.callbacks.onSolverEnded?.({solverName:"DogboneFanoutSolver",solved:this.solver.solved,failed:this.solver.failed,iterations:this.solver.iterations,error:this.solver.error})}getTraces(){return this.solver.getOutput().map((e)=>{let t=this.params.input.connections.find((n)=>n.pointsToConnect.some((o)=>o.pcb_port_id&&e.connectsTo?.includes(o.pcb_port_id)));if(!t)throw Error("Dogbone fanout lost its source connection");return{...e,connection_name:t.name,source_trace_id:t.source_trace_id,connectsTo:[...new Set([...e.connectsTo??[],...t.routingPcbGroupId?t.pointsToConnect.flatMap((n)=>!n.pcb_port_id&&n.pointId?[n.pointId]:[]):[`${e.pcb_trace_id}_exit`]])]}})}getOutputSimpleRouteJson(){let e=this.getTraces();return{...this.params.input,traces:e,connections:this.params.input.connections.map((t)=>{let n=e.find((r)=>r.connection_name===t.name);if(!n)return t;let o=n.route.at(-1);if(o.route_type!=="wire")throw Error("Dogbone fanout lost its exit");return{...t,pointsToConnect:t.pointsToConnect.map((r)=>{let i=!r.pcb_port_id;if(!(t.routingPcbGroupId?i:Boolean(r.pcb_port_id&&n.connectsTo?.includes(r.pcb_port_id))))return r;if(t.routingPcbGroupId)return{...r,x:o.x,y:o.y,layer:o.layer};let{pcb_port_id:a,...c}=r;return{...c,pointId:`${n.pcb_trace_id}_exit`,x:o.x,y:o.y,layer:o.layer}})}})}}on(e,t){this.listeners.push({event:e,callback:t})}emit(e){for(let t of this.listeners)if(t.event===e.type)t.callback(e)}start(){if(this.isRouting)return;this.isRouting=!0,this.callbacks.onSolverStarted?.({solverName:"DogboneFanoutSolver",solverParams:this.params,solverConstructorArgs:this.solver.getConstructorParams()});let e=()=>{if(!this.isRouting)return;try{for(let t=0;t<16&&!this.solver.solved&&!this.solver.failed;t++)this.solver.step();if(this.emit({type:"progress",steps:this.solver.iterations,progress:this.solver.progress,phase:this.solver.phase,debugGraphics:this.solver.visualize()}),!this.isRouting)return;if(this.solver.failed){this.finishSolver(),this.isRouting=!1,this.emit({type:"error",error:Error(this.solver.error??"Dogbone routing failed")});return}if(this.solver.solved){this.finishSolver(),this.isRouting=!1,this.emit({type:"complete",traces:this.getTraces()});return}this.timer=setTimeout(e,0)}catch(t){this.isRouting=!1,this.emit({type:"error",error:t instanceof Error?t:Error(String(t))})}};this.timer=setTimeout(e,0)}stop(){if(this.isRouting=!1,this.timer)clearTimeout(this.timer)}solveSync(){if(this.solver.solve(),this.solver.failed)throw Error(this.solver.error??"Dogbone routing failed");return this.getTraces()}},{create:aXr,defineProperty:OCn,getOwnPropertyDescriptor:cXr,getOwnPropertyNames:VCn,getPrototypeOf:lXr}=Object,hXr=Object.prototype.hasOwnProperty,d9e=((e)=>typeof TJ<"u"?TJ:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof TJ<"u"?TJ:t)[n]}):e)(function(e){if(typeof TJ<"u")return TJ.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')}),X8e=(e,t)=>function(){return t||(0,e[VCn(e)[0]])((t={exports:{}}).exports,t),t.exports},dXr=(e,t,n,o)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let r of VCn(t))if(!hXr.call(e,r)&&r!==n)OCn(e,r,{get:()=>t[r],enumerable:!(o=cXr(t,r))||o.enumerable})}return e},YZ=(e,t,n)=>(n=e!=null?aXr(lXr(e)):{},dXr(t||!e||!e.__esModule?OCn(n,"default",{value:e,enumerable:!0}):n,e)),YCn=X8e({"node_modules/svgson/dist/svgson.umd.js"(e,t){(function(n,o){typeof e==="object"&&typeof t<"u"?t.exports=o():typeof define==="function"&&define.amd?define(o):(n=typeof globalThis<"u"?globalThis:n||self,n.svgson=o())})(e,function(){var n=function(Y){return Y!=null&&(o(Y)||r(Y)||!!Y._isBuffer)};function o(Y){return!!Y.constructor&&typeof Y.constructor.isBuffer==="function"&&Y.constructor.isBuffer(Y)}function r(Y){return typeof Y.readFloatLE==="function"&&typeof Y.slice==="function"&&o(Y.slice(0,0))}var i=Object.prototype.toString,s=function(X){if(typeof X>"u")return"undefined";if(X===null)return"null";if(X===!0||X===!1||X instanceof Boolean)return"boolean";if(typeof X==="string"||X instanceof String)return"string";if(typeof X==="number"||X instanceof Number)return"number";if(typeof X==="function"||X instanceof Function)return"function";if(typeof Array.isArray<"u"&&Array.isArray(X))return"array";if(X instanceof RegExp)return"regexp";if(X instanceof Date)return"date";var K=i.call(X);if(K==="[object RegExp]")return"regexp";if(K==="[object Date]")return"date";if(K==="[object Arguments]")return"arguments";if(K==="[object Error]")return"error";if(n(X))return"buffer";if(K==="[object Set]")return"set";if(K==="[object WeakSet]")return"weakset";if(K==="[object Map]")return"map";if(K==="[object WeakMap]")return"weakmap";if(K==="[object Symbol]")return"symbol";if(K==="[object Int8Array]")return"int8array";if(K==="[object Uint8Array]")return"uint8array";if(K==="[object Uint8ClampedArray]")return"uint8clampedarray";if(K==="[object Int16Array]")return"int16array";if(K==="[object Uint16Array]")return"uint16array";if(K==="[object Int32Array]")return"int32array";if(K==="[object Uint32Array]")return"uint32array";if(K==="[object Float32Array]")return"float32array";if(K==="[object Float64Array]")return"float64array";return"object"};function a(Y,X){return X={exports:{}},Y(X,X.exports),X.exports}var c=a(function(Y){(function(){function X(K,J){if(typeof J!=="function")return K;var ee={};for(var se in K)if(Object.prototype.hasOwnProperty.call(K,se))ee[J(se,K[se])||se]=K[se];return ee}if(Y.exports)Y.exports=X;else window.rename=X})()}),l=function Y(X,K){var J=s(X);if(J!=="object"&&J!=="array")throw Error("expected an object");var ee=[];if(J==="object")X=c(X,K),ee={};for(var se in X)if(X.hasOwnProperty(se)){var ne=X[se];if(s(ne)==="object"||s(ne)==="array")ee[se]=Y(ne,K);else ee[se]=ne}return ee},h=a(function(Y){var X=Object.prototype.hasOwnProperty,K="~";function J(){}if(Object.create){if(J.prototype=Object.create(null),!new J().__proto__)K=!1}function ee(ne,re,Z){this.fn=ne,this.context=re,this.once=Z||!1}function se(){this._events=new J,this._eventsCount=0}se.prototype.eventNames=function(){var re=[],Z,te;if(this._eventsCount===0)return re;for(te in Z=this._events)if(X.call(Z,te))re.push(K?te.slice(1):te);if(Object.getOwnPropertySymbols)return re.concat(Object.getOwnPropertySymbols(Z));return re},se.prototype.listeners=function(re,Z){var te=K?K+re:re,ie=this._events[te];if(Z)return!!ie;if(!ie)return[];if(ie.fn)return[ie.fn];for(var le=0,ue=ie.length,de=Array(ue);le<ue;le++)de[le]=ie[le].fn;return de},se.prototype.emit=function(re,Z,te,ie,le,ue){var de=K?K+re:re;if(!this._events[de])return!1;var me=this._events[de],Ae=arguments.length,xe,Me;if(me.fn){if(me.once)this.removeListener(re,me.fn,void 0,!0);switch(Ae){case 1:return me.fn.call(me.context),!0;case 2:return me.fn.call(me.context,Z),!0;case 3:return me.fn.call(me.context,Z,te),!0;case 4:return me.fn.call(me.context,Z,te,ie),!0;case 5:return me.fn.call(me.context,Z,te,ie,le),!0;case 6:return me.fn.call(me.context,Z,te,ie,le,ue),!0}for(Me=1,xe=Array(Ae-1);Me<Ae;Me++)xe[Me-1]=arguments[Me];me.fn.apply(me.context,xe)}else{var Re=me.length,we;for(Me=0;Me<Re;Me++){if(me[Me].once)this.removeListener(re,me[Me].fn,void 0,!0);switch(Ae){case 1:me[Me].fn.call(me[Me].context);break;case 2:me[Me].fn.call(me[Me].context,Z);break;case 3:me[Me].fn.call(me[Me].context,Z,te);break;case 4:me[Me].fn.call(me[Me].context,Z,te,ie);break;default:if(!xe)for(we=1,xe=Array(Ae-1);we<Ae;we++)xe[we-1]=arguments[we];me[Me].fn.apply(me[Me].context,xe)}}}return!0},se.prototype.on=function(re,Z,te){var ie=new ee(Z,te||this),le=K?K+re:re;if(!this._events[le])this._events[le]=ie,this._eventsCount++;else if(!this._events[le].fn)this._events[le].push(ie);else this._events[le]=[this._events[le],ie];return this},se.prototype.once=function(re,Z,te){var ie=new ee(Z,te||this,!0),le=K?K+re:re;if(!this._events[le])this._events[le]=ie,this._eventsCount++;else if(!this._events[le].fn)this._events[le].push(ie);else this._events[le]=[this._events[le],ie];return this},se.prototype.removeListener=function(re,Z,te,ie){var le=K?K+re:re;if(!this._events[le])return this;if(!Z){if(--this._eventsCount===0)this._events=new J;else delete this._events[le];return this}var ue=this._events[le];if(ue.fn){if(ue.fn===Z&&(!ie||ue.once)&&(!te||ue.context===te))if(--this._eventsCount===0)this._events=new J;else delete this._events[le]}else{for(var de=0,me=[],Ae=ue.length;de<Ae;de++)if(ue[de].fn!==Z||ie&&!ue[de].once||te&&ue[de].context!==te)me.push(ue[de]);if(me.length)this._events[le]=me.length===1?me[0]:me;else if(--this._eventsCount===0)this._events=new J;else delete this._events[le]}return this},se.prototype.removeAllListeners=function(re){var Z;if(re){if(Z=K?K+re:re,this._events[Z])if(--this._eventsCount===0)this._events=new J;else delete this._events[Z]}else this._events=new J,this._eventsCount=0;return this},se.prototype.off=se.prototype.removeListener,se.prototype.addListener=se.prototype.on,se.prototype.setMaxListeners=function(){return this},se.prefixed=K,se.EventEmitter=se,Y.exports=se});function d(Y,X,K){if(X in Y)Object.defineProperty(Y,X,{value:K,enumerable:!0,configurable:!0,writable:!0});else Y[X]=K;return Y}var u=function(){},_={data:"state-data",cdata:"state-cdata",tagBegin:"state-tag-begin",tagName:"state-tag-name",tagEnd:"state-tag-end",attributeNameStart:"state-attribute-name-start",attributeName:"state-attribute-name",attributeNameEnd:"state-attribute-name-end",attributeValueBegin:"state-attribute-value-begin",attributeValue:"state-attribute-value"},p={lt:"action-lt",gt:"action-gt",space:"action-space",equal:"action-equal",quote:"action-quote",slash:"action-slash",char:"action-char",error:"action-error"},m={text:"text",openTag:"open-tag",closeTag:"close-tag",attributeName:"attribute-name",attributeValue:"attribute-value"},A={" ":p.space,"\t":p.space,"\n":p.space,"\r":p.space,"<":p.lt,">":p.gt,'"':p.quote,"'":p.quote,"=":p.equal,"/":p.slash},g=function(X){return A[X]||p.char},f=function(X){var K,J,ee,se,ne,re,Z,te,ie,le;X=Object.assign({debug:!1},X);var ue=new h,de=_.data,me="",Ae="",xe="",Me="",Re="",we="",_e=function(Ne,ke){if(Ae[0]==="?"||Ae[0]==="!")return;var nt={type:Ne,value:ke};if(X.debug)console.log("emit:",nt);ue.emit("data",nt)};ue.stateMachine=(le={},d(le,_.data,(K={},d(K,p.lt,function(){if(me.trim())_e(m.text,me);Ae="",Re=!1,de=_.tagBegin}),d(K,p.char,function(Se){me+=Se}),K)),d(le,_.cdata,d({},p.char,function(Se){if(me+=Se,me.substr(-3)==="]]>")_e(m.text,me.slice(0,-3)),me="",de=_.data})),d(le,_.tagBegin,(J={},d(J,p.space,u),d(J,p.char,function(Se){Ae=Se,de=_.tagName}),d(J,p.slash,function(){Ae="",Re=!0}),J)),d(le,_.tagName,(ee={},d(ee,p.space,function(){if(Re)de=_.tagEnd;else de=_.attributeNameStart,_e(m.openTag,Ae)}),d(ee,p.gt,function(){if(Re)_e(m.closeTag,Ae);else _e(m.openTag,Ae);me="",de=_.data}),d(ee,p.slash,function(){de=_.tagEnd,_e(m.openTag,Ae)}),d(ee,p.char,function(Se){if(Ae+=Se,Ae==="![CDATA[")de=_.cdata,me="",Ae=""}),ee)),d(le,_.tagEnd,(se={},d(se,p.gt,function(){_e(m.closeTag,Ae),me="",de=_.data}),d(se,p.char,u),se)),d(le,_.attributeNameStart,(ne={},d(ne,p.char,function(Se){xe=Se,de=_.attributeName}),d(ne,p.gt,function(){me="",de=_.data}),d(ne,p.space,u),d(ne,p.slash,function(){Re=!0,de=_.tagEnd}),ne)),d(le,_.attributeName,(re={},d(re,p.space,function(){de=_.attributeNameEnd}),d(re,p.equal,function(){_e(m.attributeName,xe),de=_.attributeValueBegin}),d(re,p.gt,function(){Me="",_e(m.attributeName,xe),_e(m.attributeValue,Me),me="",de=_.data}),d(re,p.slash,function(){Re=!0,Me="",_e(m.attributeName,xe),_e(m.attributeValue,Me),de=_.tagEnd}),d(re,p.char,function(Se){xe+=Se}),re)),d(le,_.attributeNameEnd,(Z={},d(Z,p.space,u),d(Z,p.equal,function(){_e(m.attributeName,xe),de=_.attributeValueBegin}),d(Z,p.gt,function(){Me="",_e(m.attributeName,xe),_e(m.attributeValue,Me),me="",de=_.data}),d(Z,p.char,function(Se){Me="",_e(m.attributeName,xe),_e(m.attributeValue,Me),xe=Se,de=_.attributeName}),Z)),d(le,_.attributeValueBegin,(te={},d(te,p.space,u),d(te,p.quote,function(Se){we=Se,Me="",de=_.attributeValue}),d(te,p.gt,function(){Me="",_e(m.attributeValue,Me),me="",de=_.data}),d(te,p.char,function(Se){we="",Me=Se,de=_.attributeValue}),te)),d(le,_.attributeValue,(ie={},d(ie,p.space,function(Se){if(we)Me+=Se;else _e(m.attributeValue,Me),de=_.attributeNameStart}),d(ie,p.quote,function(Se){if(we===Se)_e(m.attributeValue,Me),de=_.attributeNameStart;else Me+=Se}),d(ie,p.gt,function(Se){if(we)Me+=Se;else _e(m.attributeValue,Me),me="",de=_.data}),d(ie,p.slash,function(Se){if(we)Me+=Se;else _e(m.attributeValue,Me),Re=!0,de=_.tagEnd}),d(ie,p.char,function(Se){Me+=Se}),ie)),le);var ye=function(Ne){if(X.debug)console.log(de,Ne);var ke=ue.stateMachine[de],nt=ke[g(Ne)]||ke[p.error]||ke[p.char];nt(Ne)};return ue.write=function(Se){var Ne=Se.length;for(var ke=0;ke<Ne;ke++)ye(Se[ke])},ue},y={State:_,Action:p,Type:m,create:f},x=y.Type,C={element:"element",text:"text"},b=function(X){return Object.assign({name:"",type:C.element,value:"",parent:null,attributes:{},children:[]},X)},I=function(X){X=Object.assign({stream:!1,parentNodes:!0,doneEvent:"done",tagPrefix:"tag:",emitTopLevelOnly:!1,debug:!1},X);var K=void 0,J=void 0,ee=void 0,se=void 0,ne=new h,re=function(te){switch(te.type){case x.openTag:if(ee===null)ee=J,ee.name=te.value;else{var ie=b({name:te.value,parent:ee});ee.children.push(ie),ee=ie}break;case x.closeTag:var le=ee.parent;if(!X.parentNodes)ee.parent=null;if(ee.name!==te.value)break;if(X.stream&&le===J)J.children=[],ee.parent=null;if(!X.emitTopLevelOnly||le===J)ne.emit(X.tagPrefix+ee.name,ee),ne.emit("tag",ee.name,ee);if(ee===J)K.removeAllListeners("data"),ne.emit(X.doneEvent,ee),J=null;ee=le;break;case x.text:if(ee)ee.children.push(b({type:C.text,value:te.value,parent:X.parentNodes?ee:null}));break;case x.attributeName:se=te.value,ee.attributes[se]="";break;case x.attributeValue:ee.attributes[se]=te.value;break}};return ne.reset=function(){K=y.create({debug:X.debug}),K.on("data",re),J=b(),ee=null,se="",ne.parse=K.write},ne.reset(),ne},v=function(X,K){K=Object.assign({},K,{stream:!1,tagPrefix:":"});var J=I(K),ee=void 0;return J.on("done",function(se){ee=se}),J.parse(X),ee},P={parseSync:v,create:I,NodeType:C},M=P.parseSync,B=function(X){var K=M("<root>".concat(X,"</root>"),{parentNodes:!1}),J=K.children&&K.children.length>0&&K.children.every(function(ee){return ee.name==="svg"});if(J)return K.children.length===1?K.children[0]:K.children;else throw Error("nothing to parse")},T=function(X){return l(X,function(K){if(!D(K))return N(K);return K})},N=function(X){return X.replace(/[-|:]([a-z])/gi,function(K,J){return J.toUpperCase()})},D=function(X){return/^(data|aria)(-\w+)/.test(X)},L=function(X){if(X){var K=String(X);return/[&<>]/.test(K)?"<![CDATA[".concat(K.replace(/]]>/,"]]]]><![CDATA[>"),"]]>"):K}return""},H=function(X){return String(X).replace(/&/g,"&amp;").replace(/'/g,"&apos;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},V=function(X){var K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},J=K.transformNode,ee=J===void 0?function(Z){return Z}:J,se=K.camelcase,ne=se===void 0?!1:se,re=function(te){var ie=ee(te);if(ne)ie=T(ie);return ie};return re(B(X))};function O(){for(var Y=arguments.length,X=Array(Y),K=0;K<Y;K++)X[K]=arguments[K];return new Promise(function(J,ee){try{var se=V.apply(void 0,X);J(se)}catch(ne){ee(ne)}})}var U=function Y(X){var K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},J=K.transformAttr,ee=J===void 0?function(de,me,Ae){return"".concat(de,'="').concat(Ae(me),'"')}:J,se=K.transformNode,ne=se===void 0?function(de){return de}:se,re=K.selfClose,Z=re===void 0?!0:re;if(Array.isArray(X))return X.map(function(de){return Y(de,{transformAttr:ee,selfClose:Z,transformNode:ne})}).join("");var te=ne(X);if(te.type==="text")return L(te.value);var ie="";for(var le in te.attributes){var ue=ee(le,te.attributes[le],H,te.name);ie+=ue?" ".concat(ue):""}return te.children&&te.children.length>0||!Z?"<".concat(te.name).concat(ie,">").concat(Y(te.children,{transformAttr:ee,transformNode:ne,selfClose:Z}),"</").concat(te.name,">"):"<".concat(te.name).concat(ie,"/>")},j=Object.assign({},{parse:O,parseSync:V,stringify:U});return j})}}),uXr=X8e({"node_modules/heap/lib/heap.js"(e,t){(function(){var n,o,r,i,s,a,c,l,h,d,u,_,p,m,A;r=Math.floor,d=Math.min,o=function(g,f){if(g<f)return-1;if(g>f)return 1;return 0},h=function(g,f,y,x,C){var b;if(y==null)y=0;if(C==null)C=o;if(y<0)throw Error("lo must be non-negative");if(x==null)x=g.length;while(y<x)if(b=r((y+x)/2),C(f,g[b])<0)x=b;else y=b+1;return[].splice.apply(g,[y,y-y].concat(f)),f},a=function(g,f,y){if(y==null)y=o;return g.push(f),m(g,0,g.length-1,y)},s=function(g,f){var y,x;if(f==null)f=o;if(y=g.pop(),g.length)x=g[0],g[0]=y,A(g,0,f);else x=y;return x},l=function(g,f,y){var x;if(y==null)y=o;return x=g[0],g[0]=f,A(g,0,y),x},c=function(g,f,y){var x;if(y==null)y=o;if(g.length&&y(g[0],f)<0)x=[g[0],f],f=x[0],g[0]=x[1],A(g,0,y);return f},i=function(g,f){var y,x,C,b,I,v,P,M;if(f==null)f=o;v=function(){M=[];for(var B=0,T=r(g.length/2);0<=T?B<T:B>T;0<=T?B++:B--)M.push(B);return M}.apply(this).reverse(),P=[];for(x=0,b=v.length;x<b;x++)y=v[x],P.push(A(g,y,f));return P},p=function(g,f,y){var x;if(y==null)y=o;if(x=g.indexOf(f),x===-1)return;return m(g,0,x,y),A(g,x,y)},u=function(g,f,y){var x,C,b,I,v;if(y==null)y=o;if(C=g.slice(0,f),!C.length)return C;i(C,y),v=g.slice(f);for(b=0,I=v.length;b<I;b++)x=v[b],c(C,x,y);return C.sort(y).reverse()},_=function(g,f,y){var x,C,b,I,v,P,M,B,T,N;if(y==null)y=o;if(f*10<=g.length){if(I=g.slice(0,f).sort(y),!I.length)return I;b=I[I.length-1],B=g.slice(f);for(v=0,M=B.length;v<M;v++)if(x=B[v],y(x,b)<0)h(I,x,0,null,y),I.pop(),b=I[I.length-1];return I}i(g,y),N=[];for(C=P=0,T=d(f,g.length);0<=T?P<T:P>T;C=0<=T?++P:--P)N.push(s(g,y));return N},m=function(g,f,y,x){var C,b,I;if(x==null)x=o;C=g[y];while(y>f){if(I=y-1>>1,b=g[I],x(C,b)<0){g[y]=b,y=I;continue}break}return g[y]=C},A=function(g,f,y){var x,C,b,I,v;if(y==null)y=o;C=g.length,v=f,b=g[f],x=2*f+1;while(x<C){if(I=x+1,I<C&&!(y(g[x],g[I])<0))x=I;g[f]=g[x],f=x,x=2*f+1}return g[f]=b,m(g,v,f,y)},n=function(){g.push=a,g.pop=s,g.replace=l,g.pushpop=c,g.heapify=i,g.updateItem=p,g.nlargest=u,g.nsmallest=_;function g(f){this.cmp=f!=null?f:o,this.nodes=[]}return g.prototype.push=function(f){return a(this.nodes,f,this.cmp)},g.prototype.pop=function(){return s(this.nodes,this.cmp)},g.prototype.peek=function(){return this.nodes[0]},g.prototype.contains=function(f){return this.nodes.indexOf(f)!==-1},g.prototype.replace=function(f){return l(this.nodes,f,this.cmp)},g.prototype.pushpop=function(f){return c(this.nodes,f,this.cmp)},g.prototype.heapify=function(){return i(this.nodes,this.cmp)},g.prototype.updateItem=function(f){return p(this.nodes,f,this.cmp)},g.prototype.clear=function(){return this.nodes=[]},g.prototype.empty=function(){return this.nodes.length===0},g.prototype.size=function(){return this.nodes.length},g.prototype.clone=function(){var f=new g;return f.nodes=this.nodes.slice(0),f},g.prototype.toArray=function(){return this.nodes.slice(0)},g.prototype.insert=g.prototype.push,g.prototype.top=g.prototype.peek,g.prototype.front=g.prototype.peek,g.prototype.has=g.prototype.contains,g.prototype.copy=g.prototype.clone,g}(),function(g,f){if(typeof define==="function"&&define.amd)return define([],f);else if(typeof e==="object")return t.exports=f();else return g.Heap=f()}(this,function(){return n})}).call(e)}}),pXr=X8e({"node_modules/heap/index.js"(e,t){t.exports=uXr()}}),lat=X8e({"node_modules/object-hash/dist/object_hash.js"(e,t){(function(n){var o;typeof e=="object"?t.exports=n():typeof define=="function"&&define.amd?define(n):(typeof window<"u"?o=window:typeof global<"u"?o=global:typeof self<"u"&&(o=self),o.objectHash=n())})(function(){return function n(o,r,i){function s(l,h){if(!r[l]){if(!o[l]){var d=typeof d9e=="function"&&d9e;if(!h&&d)return d(l,!0);if(a)return a(l,!0);throw Error("Cannot find module '"+l+"'")}h=r[l]={exports:{}},o[l][0].call(h.exports,function(u){var _=o[l][1][u];return s(_||u)},h,h.exports,n,o,r,i)}return r[l].exports}for(var a=typeof d9e=="function"&&d9e,c=0;c<i.length;c++)s(i[c]);return s}({1:[function(n,o,r){(function(i,s,a,c,l,h,d,u,_){var p=n("crypto");function m(b,I){I=f(b,I);var v;return(v=I.algorithm!=="passthrough"?p.createHash(I.algorithm):new C).write===void 0&&(v.write=v.update,v.end=v.update),x(I,v).dispatch(b),v.update||v.end(""),v.digest?v.digest(I.encoding==="buffer"?void 0:I.encoding):(b=v.read(),I.encoding!=="buffer"?b.toString(I.encoding):b)}(r=o.exports=m).sha1=function(b){return m(b)},r.keys=function(b){return m(b,{excludeValues:!0,algorithm:"sha1",encoding:"hex"})},r.MD5=function(b){return m(b,{algorithm:"md5",encoding:"hex"})},r.keysMD5=function(b){return m(b,{algorithm:"md5",encoding:"hex",excludeValues:!0})};var A=p.getHashes?p.getHashes().slice():["sha1","md5"],g=(A.push("passthrough"),["buffer","hex","binary","base64"]);function f(b,I){var v={};if(v.algorithm=(I=I||{}).algorithm||"sha1",v.encoding=I.encoding||"hex",v.excludeValues=!!I.excludeValues,v.algorithm=v.algorithm.toLowerCase(),v.encoding=v.encoding.toLowerCase(),v.ignoreUnknown=I.ignoreUnknown===!0,v.respectType=I.respectType!==!1,v.respectFunctionNames=I.respectFunctionNames!==!1,v.respectFunctionProperties=I.respectFunctionProperties!==!1,v.unorderedArrays=I.unorderedArrays===!0,v.unorderedSets=I.unorderedSets!==!1,v.unorderedObjects=I.unorderedObjects!==!1,v.replacer=I.replacer||void 0,v.excludeKeys=I.excludeKeys||void 0,b===void 0)throw Error("Object argument required.");for(var P=0;P<A.length;++P)A[P].toLowerCase()===v.algorithm.toLowerCase()&&(v.algorithm=A[P]);if(A.indexOf(v.algorithm)===-1)throw Error('Algorithm "'+v.algorithm+'"  not supported. supported values: '+A.join(", "));if(g.indexOf(v.encoding)===-1&&v.algorithm!=="passthrough")throw Error('Encoding "'+v.encoding+'"  not supported. supported values: '+g.join(", "));return v}function y(b){if(typeof b=="function")return/^function\s+\w*\s*\(\s*\)\s*{\s+\[native code\]\s+}$/i.exec(Function.prototype.toString.call(b))!=null}function x(b,I,v){v=v||[];function P(M){return I.update?I.update(M,"utf8"):I.write(M,"utf8")}return{dispatch:function(M){return this["_"+((M=b.replacer?b.replacer(M):M)===null?"null":typeof M)](M)},_object:function(M){var B,T=Object.prototype.toString.call(M),N=/\[object (.*)\]/i.exec(T);if(N=(N=N?N[1]:"unknown:["+T+"]").toLowerCase(),0<=(T=v.indexOf(M)))return this.dispatch("[CIRCULAR:"+T+"]");if(v.push(M),a!==void 0&&a.isBuffer&&a.isBuffer(M))return P("buffer:"),P(M);if(N==="object"||N==="function"||N==="asyncfunction")return T=Object.keys(M),b.unorderedObjects&&(T=T.sort()),b.respectType===!1||y(M)||T.splice(0,0,"prototype","__proto__","constructor"),b.excludeKeys&&(T=T.filter(function(D){return!b.excludeKeys(D)})),P("object:"+T.length+":"),B=this,T.forEach(function(D){B.dispatch(D),P(":"),b.excludeValues||B.dispatch(M[D]),P(",")});if(!this["_"+N]){if(b.ignoreUnknown)return P("["+N+"]");throw Error('Unknown object type "'+N+'"')}this["_"+N](M)},_array:function(M,D){D=D!==void 0?D:b.unorderedArrays!==!1;var T=this;if(P("array:"+M.length+":"),!D||M.length<=1)return M.forEach(function(L){return T.dispatch(L)});var N=[],D=M.map(function(L){var H=new C,V=v.slice();return x(b,H,V).dispatch(L),N=N.concat(V.slice(v.length)),H.read().toString()});return v=v.concat(N),D.sort(),this._array(D,!1)},_date:function(M){return P("date:"+M.toJSON())},_symbol:function(M){return P("symbol:"+M.toString())},_error:function(M){return P("error:"+M.toString())},_boolean:function(M){return P("bool:"+M.toString())},_string:function(M){P("string:"+M.length+":"),P(M.toString())},_function:function(M){P("fn:"),y(M)?this.dispatch("[native]"):this.dispatch(M.toString()),b.respectFunctionNames!==!1&&this.dispatch("function-name:"+String(M.name)),b.respectFunctionProperties&&this._object(M)},_number:function(M){return P("number:"+M.toString())},_xml:function(M){return P("xml:"+M.toString())},_null:function(){return P("Null")},_undefined:function(){return P("Undefined")},_regexp:function(M){return P("regex:"+M.toString())},_uint8array:function(M){return P("uint8array:"),this.dispatch(Array.prototype.slice.call(M))},_uint8clampedarray:function(M){return P("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(M))},_int8array:function(M){return P("int8array:"),this.dispatch(Array.prototype.slice.call(M))},_uint16array:function(M){return P("uint16array:"),this.dispatch(Array.prototype.slice.call(M))},_int16array:function(M){return P("int16array:"),this.dispatch(Array.prototype.slice.call(M))},_uint32array:function(M){return P("uint32array:"),this.dispatch(Array.prototype.slice.call(M))},_int32array:function(M){return P("int32array:"),this.dispatch(Array.prototype.slice.call(M))},_float32array:function(M){return P("float32array:"),this.dispatch(Array.prototype.slice.call(M))},_float64array:function(M){return P("float64array:"),this.dispatch(Array.prototype.slice.call(M))},_arraybuffer:function(M){return P("arraybuffer:"),this.dispatch(new Uint8Array(M))},_url:function(M){return P("url:"+M.toString())},_map:function(M){return P("map:"),M=Array.from(M),this._array(M,b.unorderedSets!==!1)},_set:function(M){return P("set:"),M=Array.from(M),this._array(M,b.unorderedSets!==!1)},_file:function(M){return P("file:"),this.dispatch([M.name,M.size,M.type,M.lastModfied])},_blob:function(){if(b.ignoreUnknown)return P("[blob]");throw Error(`Hashing Blob objects is currently not supported
(see https://github.com/puleos/object-hash/issues/26)
Use "options.replacer" or "options.ignoreUnknown"
`)},_domwindow:function(){return P("domwindow")},_bigint:function(M){return P("bigint:"+M.toString())},_process:function(){return P("process")},_timer:function(){return P("timer")},_pipe:function(){return P("pipe")},_tcp:function(){return P("tcp")},_udp:function(){return P("udp")},_tty:function(){return P("tty")},_statwatcher:function(){return P("statwatcher")},_securecontext:function(){return P("securecontext")},_connection:function(){return P("connection")},_zlib:function(){return P("zlib")},_context:function(){return P("context")},_nodescript:function(){return P("nodescript")},_httpparser:function(){return P("httpparser")},_dataview:function(){return P("dataview")},_signal:function(){return P("signal")},_fsevent:function(){return P("fsevent")},_tlswrap:function(){return P("tlswrap")}}}function C(){return{buf:"",write:function(b){this.buf+=b},end:function(b){this.buf+=b},read:function(){return this.buf}}}r.writeToStream=function(b,I,v){return v===void 0&&(v=I,I={}),x(I=f(b,I),v).dispatch(b)}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/fake_9a5aa49d.js","/")},{buffer:3,crypto:5,lYpoI2:11}],2:[function(n,o,r){(function(i,s,a,c,l,h,d,u,_){(function(p){var m=typeof Uint8Array<"u"?Uint8Array:Array,A=43,g=47,f=48,y=97,x=65,C=45,b=95;function I(v){return v=v.charCodeAt(0),v===A||v===C?62:v===g||v===b?63:v<f?-1:v<f+10?v-f+26+26:v<x+26?v-x:v<y+26?v-y+26:void 0}p.toByteArray=function(v){var P,M;if(0<v.length%4)throw Error("Invalid string. Length must be a multiple of 4");var B=v.length,B=v.charAt(B-2)==="="?2:v.charAt(B-1)==="="?1:0,T=new m(3*v.length/4-B),N=0<B?v.length-4:v.length,D=0;function L(H){T[D++]=H}for(P=0;P<N;P+=4,0)L((16711680&(M=I(v.charAt(P))<<18|I(v.charAt(P+1))<<12|I(v.charAt(P+2))<<6|I(v.charAt(P+3))))>>16),L((65280&M)>>8),L(255&M);return B==2?L(255&(M=I(v.charAt(P))<<2|I(v.charAt(P+1))>>4)):B==1&&(L((M=I(v.charAt(P))<<10|I(v.charAt(P+1))<<4|I(v.charAt(P+2))>>2)>>8&255),L(255&M)),T},p.fromByteArray=function(v){var P,M,B,T,N=v.length%3,D="";function L(H){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(H)}for(P=0,B=v.length-N;P<B;P+=3)M=(v[P]<<16)+(v[P+1]<<8)+v[P+2],D+=L((T=M)>>18&63)+L(T>>12&63)+L(T>>6&63)+L(63&T);switch(N){case 1:D=(D+=L((M=v[v.length-1])>>2))+L(M<<4&63)+"==";break;case 2:D=(D=(D+=L((M=(v[v.length-2]<<8)+v[v.length-1])>>10))+L(M>>4&63))+L(M<<2&63)+"="}return D}})(r===void 0?this.base64js={}:r)}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/base64-js/lib/b64.js","/node_modules/gulp-browserify/node_modules/base64-js/lib")},{buffer:3,lYpoI2:11}],3:[function(n,o,r){(function(i,s,A,c,l,h,d,u,_){var p=n("base64-js"),m=n("ieee754");function A(Z,te,ie){if(!(this instanceof A))return new A(Z,te,ie);var le,ue,de,me,Ae=typeof Z;if(te==="base64"&&Ae=="string")for(Z=(me=Z).trim?me.trim():me.replace(/^\s+|\s+$/g,"");Z.length%4!=0;)Z+="=";if(Ae=="number")le=O(Z);else if(Ae=="string")le=A.byteLength(Z,te);else{if(Ae!="object")throw Error("First argument needs to be a number, array or string.");le=O(Z.length)}if(A._useTypedArrays?ue=A._augment(new Uint8Array(le)):((ue=this).length=le,ue._isBuffer=!0),A._useTypedArrays&&typeof Z.byteLength=="number")ue._set(Z);else if(U(me=Z)||A.isBuffer(me)||me&&typeof me=="object"&&typeof me.length=="number")for(de=0;de<le;de++)A.isBuffer(Z)?ue[de]=Z.readUInt8(de):ue[de]=Z[de];else if(Ae=="string")ue.write(Z,0,te);else if(Ae=="number"&&!A._useTypedArrays&&!ie)for(de=0;de<le;de++)ue[de]=0;return ue}function g(Z,te,ie,le){return A._charsWritten=K(function(ue){for(var de=[],me=0;me<ue.length;me++)de.push(255&ue.charCodeAt(me));return de}(te),Z,ie,le)}function f(Z,te,ie,le){return A._charsWritten=K(function(ue){for(var de,me,Ae=[],xe=0;xe<ue.length;xe++)me=ue.charCodeAt(xe),de=me>>8,me=me%256,Ae.push(me),Ae.push(de);return Ae}(te),Z,ie,le)}function y(Z,te,ie){var le="";ie=Math.min(Z.length,ie);for(var ue=te;ue<ie;ue++)le+=String.fromCharCode(Z[ue]);return le}function x(Z,te,ie,de){de||(re(typeof ie=="boolean","missing or invalid endian"),re(te!=null,"missing offset"),re(te+1<Z.length,"Trying to read beyond buffer length"));var ue,de=Z.length;if(!(de<=te))return ie?(ue=Z[te],te+1<de&&(ue|=Z[te+1]<<8)):(ue=Z[te]<<8,te+1<de&&(ue|=Z[te+1])),ue}function C(Z,te,ie,de){de||(re(typeof ie=="boolean","missing or invalid endian"),re(te!=null,"missing offset"),re(te+3<Z.length,"Trying to read beyond buffer length"));var ue,de=Z.length;if(!(de<=te))return ie?(te+2<de&&(ue=Z[te+2]<<16),te+1<de&&(ue|=Z[te+1]<<8),ue|=Z[te],te+3<de&&(ue+=Z[te+3]<<24>>>0)):(te+1<de&&(ue=Z[te+1]<<16),te+2<de&&(ue|=Z[te+2]<<8),te+3<de&&(ue|=Z[te+3]),ue+=Z[te]<<24>>>0),ue}function b(Z,te,ie,le){if(le||(re(typeof ie=="boolean","missing or invalid endian"),re(te!=null,"missing offset"),re(te+1<Z.length,"Trying to read beyond buffer length")),!(Z.length<=te))return le=x(Z,te,ie,!0),32768&le?-1*(65535-le+1):le}function I(Z,te,ie,le){if(le||(re(typeof ie=="boolean","missing or invalid endian"),re(te!=null,"missing offset"),re(te+3<Z.length,"Trying to read beyond buffer length")),!(Z.length<=te))return le=C(Z,te,ie,!0),2147483648&le?-1*(4294967295-le+1):le}function v(Z,te,ie,le){return le||(re(typeof ie=="boolean","missing or invalid endian"),re(te+3<Z.length,"Trying to read beyond buffer length")),m.read(Z,te,ie,23,4)}function P(Z,te,ie,le){return le||(re(typeof ie=="boolean","missing or invalid endian"),re(te+7<Z.length,"Trying to read beyond buffer length")),m.read(Z,te,ie,52,8)}function M(Z,te,ie,le,ue){if(ue||(re(te!=null,"missing value"),re(typeof le=="boolean","missing or invalid endian"),re(ie!=null,"missing offset"),re(ie+1<Z.length,"trying to write beyond buffer length"),ee(te,65535)),ue=Z.length,!(ue<=ie))for(var de=0,me=Math.min(ue-ie,2);de<me;de++)Z[ie+de]=(te&255<<8*(le?de:1-de))>>>8*(le?de:1-de)}function B(Z,te,ie,le,ue){if(ue||(re(te!=null,"missing value"),re(typeof le=="boolean","missing or invalid endian"),re(ie!=null,"missing offset"),re(ie+3<Z.length,"trying to write beyond buffer length"),ee(te,4294967295)),ue=Z.length,!(ue<=ie))for(var de=0,me=Math.min(ue-ie,4);de<me;de++)Z[ie+de]=te>>>8*(le?de:3-de)&255}function T(Z,te,ie,le,ue){ue||(re(te!=null,"missing value"),re(typeof le=="boolean","missing or invalid endian"),re(ie!=null,"missing offset"),re(ie+1<Z.length,"Trying to write beyond buffer length"),se(te,32767,-32768)),Z.length<=ie||M(Z,0<=te?te:65535+te+1,ie,le,ue)}function N(Z,te,ie,le,ue){ue||(re(te!=null,"missing value"),re(typeof le=="boolean","missing or invalid endian"),re(ie!=null,"missing offset"),re(ie+3<Z.length,"Trying to write beyond buffer length"),se(te,2147483647,-2147483648)),Z.length<=ie||B(Z,0<=te?te:4294967295+te+1,ie,le,ue)}function D(Z,te,ie,le,ue){ue||(re(te!=null,"missing value"),re(typeof le=="boolean","missing or invalid endian"),re(ie!=null,"missing offset"),re(ie+3<Z.length,"Trying to write beyond buffer length"),ne(te,340282346638528860000000000000000000000,-340282346638528860000000000000000000000)),Z.length<=ie||m.write(Z,te,ie,le,23,4)}function L(Z,te,ie,le,ue){ue||(re(te!=null,"missing value"),re(typeof le=="boolean","missing or invalid endian"),re(ie!=null,"missing offset"),re(ie+7<Z.length,"Trying to write beyond buffer length"),ne(te,179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,-179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Z.length<=ie||m.write(Z,te,ie,le,52,8)}r.Buffer=A,r.SlowBuffer=A,r.INSPECT_MAX_BYTES=50,A.poolSize=8192,A._useTypedArrays=function(){try{var Z=new ArrayBuffer(0),te=new Uint8Array(Z);return te.foo=function(){return 42},te.foo()===42&&typeof te.subarray=="function"}catch(ie){return!1}}(),A.isEncoding=function(Z){switch(String(Z).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},A.isBuffer=function(Z){return!(Z==null||!Z._isBuffer)},A.byteLength=function(Z,te){var ie;switch(Z+="",te||"utf8"){case"hex":ie=Z.length/2;break;case"utf8":case"utf-8":ie=Y(Z).length;break;case"ascii":case"binary":case"raw":ie=Z.length;break;case"base64":ie=X(Z).length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":ie=2*Z.length;break;default:throw Error("Unknown encoding")}return ie},A.concat=function(Z,te){if(re(U(Z),`Usage: Buffer.concat(list, [totalLength])
list should be an Array.`),Z.length===0)return new A(0);if(Z.length===1)return Z[0];if(typeof te!="number")for(ue=te=0;ue<Z.length;ue++)te+=Z[ue].length;for(var ie=new A(te),le=0,ue=0;ue<Z.length;ue++){var de=Z[ue];de.copy(ie,le),le+=de.length}return ie},A.prototype.write=function(Z,te,ie,le){isFinite(te)?isFinite(ie)||(le=ie,ie=void 0):(xe=le,le=te,te=ie,ie=xe),te=Number(te)||0;var ue,de,me,Ae,xe=this.length-te;switch((!ie||xe<(ie=Number(ie)))&&(ie=xe),le=String(le||"utf8").toLowerCase()){case"hex":ue=function(Me,Re,we,_e){we=Number(we)||0;var ye=Me.length-we;(!_e||ye<(_e=Number(_e)))&&(_e=ye),re((ye=Re.length)%2==0,"Invalid hex string"),ye/2<_e&&(_e=ye/2);for(var Se=0;Se<_e;Se++){var Ne=parseInt(Re.substr(2*Se,2),16);re(!isNaN(Ne),"Invalid hex string"),Me[we+Se]=Ne}return A._charsWritten=2*Se,Se}(this,Z,te,ie);break;case"utf8":case"utf-8":de=this,me=te,Ae=ie,ue=A._charsWritten=K(Y(Z),de,me,Ae);break;case"ascii":case"binary":ue=g(this,Z,te,ie);break;case"base64":de=this,me=te,Ae=ie,ue=A._charsWritten=K(X(Z),de,me,Ae);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":ue=f(this,Z,te,ie);break;default:throw Error("Unknown encoding")}return ue},A.prototype.toString=function(Z,te,ie){var le,ue,de,me,Ae=this;if(Z=String(Z||"utf8").toLowerCase(),te=Number(te)||0,(ie=ie!==void 0?Number(ie):Ae.length)===te)return"";switch(Z){case"hex":le=function(xe,Me,Re){var we=xe.length;(!Me||Me<0)&&(Me=0),(!Re||Re<0||we<Re)&&(Re=we);for(var _e="",ye=Me;ye<Re;ye++)_e+=j(xe[ye]);return _e}(Ae,te,ie);break;case"utf8":case"utf-8":le=function(xe,Me,Re){var we="",_e="";Re=Math.min(xe.length,Re);for(var ye=Me;ye<Re;ye++)xe[ye]<=127?(we+=J(_e)+String.fromCharCode(xe[ye]),_e=""):_e+="%"+xe[ye].toString(16);return we+J(_e)}(Ae,te,ie);break;case"ascii":case"binary":le=y(Ae,te,ie);break;case"base64":ue=Ae,me=ie,le=(de=te)===0&&me===ue.length?p.fromByteArray(ue):p.fromByteArray(ue.slice(de,me));break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":le=function(xe,Me,Re){for(var we=xe.slice(Me,Re),_e="",ye=0;ye<we.length;ye+=2)_e+=String.fromCharCode(we[ye]+256*we[ye+1]);return _e}(Ae,te,ie);break;default:throw Error("Unknown encoding")}return le},A.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},A.prototype.copy=function(Z,te,ie,le){if(te=te||0,(le=le||le===0?le:this.length)!==(ie=ie||0)&&Z.length!==0&&this.length!==0){re(ie<=le,"sourceEnd < sourceStart"),re(0<=te&&te<Z.length,"targetStart out of bounds"),re(0<=ie&&ie<this.length,"sourceStart out of bounds"),re(0<=le&&le<=this.length,"sourceEnd out of bounds"),le>this.length&&(le=this.length);var ue=(le=Z.length-te<le-ie?Z.length-te+ie:le)-ie;if(ue<100||!A._useTypedArrays)for(var de=0;de<ue;de++)Z[de+te]=this[de+ie];else Z._set(this.subarray(ie,ie+ue),te)}},A.prototype.slice=function(Z,te){var ie=this.length;if(Z=V(Z,ie,0),te=V(te,ie,ie),A._useTypedArrays)return A._augment(this.subarray(Z,te));for(var le=te-Z,ue=new A(le,void 0,!0),de=0;de<le;de++)ue[de]=this[de+Z];return ue},A.prototype.get=function(Z){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(Z)},A.prototype.set=function(Z,te){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(Z,te)},A.prototype.readUInt8=function(Z,te){if(te||(re(Z!=null,"missing offset"),re(Z<this.length,"Trying to read beyond buffer length")),!(Z>=this.length))return this[Z]},A.prototype.readUInt16LE=function(Z,te){return x(this,Z,!0,te)},A.prototype.readUInt16BE=function(Z,te){return x(this,Z,!1,te)},A.prototype.readUInt32LE=function(Z,te){return C(this,Z,!0,te)},A.prototype.readUInt32BE=function(Z,te){return C(this,Z,!1,te)},A.prototype.readInt8=function(Z,te){if(te||(re(Z!=null,"missing offset"),re(Z<this.length,"Trying to read beyond buffer length")),!(Z>=this.length))return 128&this[Z]?-1*(255-this[Z]+1):this[Z]},A.prototype.readInt16LE=function(Z,te){return b(this,Z,!0,te)},A.prototype.readInt16BE=function(Z,te){return b(this,Z,!1,te)},A.prototype.readInt32LE=function(Z,te){return I(this,Z,!0,te)},A.prototype.readInt32BE=function(Z,te){return I(this,Z,!1,te)},A.prototype.readFloatLE=function(Z,te){return v(this,Z,!0,te)},A.prototype.readFloatBE=function(Z,te){return v(this,Z,!1,te)},A.prototype.readDoubleLE=function(Z,te){return P(this,Z,!0,te)},A.prototype.readDoubleBE=function(Z,te){return P(this,Z,!1,te)},A.prototype.writeUInt8=function(Z,te,ie){ie||(re(Z!=null,"missing value"),re(te!=null,"missing offset"),re(te<this.length,"trying to write beyond buffer length"),ee(Z,255)),te>=this.length||(this[te]=Z)},A.prototype.writeUInt16LE=function(Z,te,ie){M(this,Z,te,!0,ie)},A.prototype.writeUInt16BE=function(Z,te,ie){M(this,Z,te,!1,ie)},A.prototype.writeUInt32LE=function(Z,te,ie){B(this,Z,te,!0,ie)},A.prototype.writeUInt32BE=function(Z,te,ie){B(this,Z,te,!1,ie)},A.prototype.writeInt8=function(Z,te,ie){ie||(re(Z!=null,"missing value"),re(te!=null,"missing offset"),re(te<this.length,"Trying to write beyond buffer length"),se(Z,127,-128)),te>=this.length||(0<=Z?this.writeUInt8(Z,te,ie):this.writeUInt8(255+Z+1,te,ie))},A.prototype.writeInt16LE=function(Z,te,ie){T(this,Z,te,!0,ie)},A.prototype.writeInt16BE=function(Z,te,ie){T(this,Z,te,!1,ie)},A.prototype.writeInt32LE=function(Z,te,ie){N(this,Z,te,!0,ie)},A.prototype.writeInt32BE=function(Z,te,ie){N(this,Z,te,!1,ie)},A.prototype.writeFloatLE=function(Z,te,ie){D(this,Z,te,!0,ie)},A.prototype.writeFloatBE=function(Z,te,ie){D(this,Z,te,!1,ie)},A.prototype.writeDoubleLE=function(Z,te,ie){L(this,Z,te,!0,ie)},A.prototype.writeDoubleBE=function(Z,te,ie){L(this,Z,te,!1,ie)},A.prototype.fill=function(Z,te,ie){if(te=te||0,ie=ie||this.length,re(typeof(Z=typeof(Z=Z||0)=="string"?Z.charCodeAt(0):Z)=="number"&&!isNaN(Z),"value is not a number"),re(te<=ie,"end < start"),ie!==te&&this.length!==0){re(0<=te&&te<this.length,"start out of bounds"),re(0<=ie&&ie<=this.length,"end out of bounds");for(var le=te;le<ie;le++)this[le]=Z}},A.prototype.inspect=function(){for(var Z=[],te=this.length,ie=0;ie<te;ie++)if(Z[ie]=j(this[ie]),ie===r.INSPECT_MAX_BYTES){Z[ie+1]="...";break}return"<Buffer "+Z.join(" ")+">"},A.prototype.toArrayBuffer=function(){if(typeof Uint8Array>"u")throw Error("Buffer.toArrayBuffer not supported in this browser");if(A._useTypedArrays)return new A(this).buffer;for(var Z=new Uint8Array(this.length),te=0,ie=Z.length;te<ie;te+=1)Z[te]=this[te];return Z.buffer};var H=A.prototype;function V(Z,te,ie){return typeof Z!="number"?ie:te<=(Z=~~Z)?te:0<=Z||0<=(Z+=te)?Z:0}function O(Z){return(Z=~~Math.ceil(+Z))<0?0:Z}function U(Z){return(Array.isArray||function(te){return Object.prototype.toString.call(te)==="[object Array]"})(Z)}function j(Z){return Z<16?"0"+Z.toString(16):Z.toString(16)}function Y(Z){for(var te=[],ie=0;ie<Z.length;ie++){var le=Z.charCodeAt(ie);if(le<=127)te.push(Z.charCodeAt(ie));else for(var ue=ie,de=(55296<=le&&le<=57343&&ie++,encodeURIComponent(Z.slice(ue,ie+1)).substr(1).split("%")),me=0;me<de.length;me++)te.push(parseInt(de[me],16))}return te}function X(Z){return p.toByteArray(Z)}function K(Z,te,ie,le){for(var ue=0;ue<le&&!(ue+ie>=te.length||ue>=Z.length);ue++)te[ue+ie]=Z[ue];return ue}function J(Z){try{return decodeURIComponent(Z)}catch(te){return String.fromCharCode(65533)}}function ee(Z,te){re(typeof Z=="number","cannot write a non-number as a number"),re(0<=Z,"specified a negative value for writing an unsigned value"),re(Z<=te,"value is larger than maximum value for type"),re(Math.floor(Z)===Z,"value has a fractional component")}function se(Z,te,ie){re(typeof Z=="number","cannot write a non-number as a number"),re(Z<=te,"value larger than maximum allowed value"),re(ie<=Z,"value smaller than minimum allowed value"),re(Math.floor(Z)===Z,"value has a fractional component")}function ne(Z,te,ie){re(typeof Z=="number","cannot write a non-number as a number"),re(Z<=te,"value larger than maximum allowed value"),re(ie<=Z,"value smaller than minimum allowed value")}function re(Z,te){if(!Z)throw Error(te||"Failed assertion")}A._augment=function(Z){return Z._isBuffer=!0,Z._get=Z.get,Z._set=Z.set,Z.get=H.get,Z.set=H.set,Z.write=H.write,Z.toString=H.toString,Z.toLocaleString=H.toString,Z.toJSON=H.toJSON,Z.copy=H.copy,Z.slice=H.slice,Z.readUInt8=H.readUInt8,Z.readUInt16LE=H.readUInt16LE,Z.readUInt16BE=H.readUInt16BE,Z.readUInt32LE=H.readUInt32LE,Z.readUInt32BE=H.readUInt32BE,Z.readInt8=H.readInt8,Z.readInt16LE=H.readInt16LE,Z.readInt16BE=H.readInt16BE,Z.readInt32LE=H.readInt32LE,Z.readInt32BE=H.readInt32BE,Z.readFloatLE=H.readFloatLE,Z.readFloatBE=H.readFloatBE,Z.readDoubleLE=H.readDoubleLE,Z.readDoubleBE=H.readDoubleBE,Z.writeUInt8=H.writeUInt8,Z.writeUInt16LE=H.writeUInt16LE,Z.writeUInt16BE=H.writeUInt16BE,Z.writeUInt32LE=H.writeUInt32LE,Z.writeUInt32BE=H.writeUInt32BE,Z.writeInt8=H.writeInt8,Z.writeInt16LE=H.writeInt16LE,Z.writeInt16BE=H.writeInt16BE,Z.writeInt32LE=H.writeInt32LE,Z.writeInt32BE=H.writeInt32BE,Z.writeFloatLE=H.writeFloatLE,Z.writeFloatBE=H.writeFloatBE,Z.writeDoubleLE=H.writeDoubleLE,Z.writeDoubleBE=H.writeDoubleBE,Z.fill=H.fill,Z.inspect=H.inspect,Z.toArrayBuffer=H.toArrayBuffer,Z}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/buffer/index.js","/node_modules/gulp-browserify/node_modules/buffer")},{"base64-js":2,buffer:3,ieee754:10,lYpoI2:11}],4:[function(n,o,r){(function(i,s,p,c,l,h,d,u,_){var p=n("buffer").Buffer,m=4,A=new p(m);A.fill(0),o.exports={hash:function(g,f,y,x){for(var C=f(function(M,B){M.length%m!=0&&(T=M.length+(m-M.length%m),M=p.concat([M,A],T));for(var T,N=[],D=B?M.readInt32BE:M.readInt32LE,L=0;L<M.length;L+=m)N.push(D.call(M,L));return N}(g=p.isBuffer(g)?g:new p(g),x),8*g.length),f=x,b=new p(y),I=f?b.writeInt32BE:b.writeInt32LE,v=0;v<C.length;v++)I.call(b,C[v],4*v,!0);return b}}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/helpers.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:11}],5:[function(n,o,r){(function(i,s,p,c,l,h,d,u,_){var p=n("buffer").Buffer,m=n("./sha"),A=n("./sha256"),g=n("./rng"),f={sha1:m,sha256:A,md5:n("./md5")},y=64,x=new p(y);function C(M,B){var T=f[M=M||"sha1"],N=[];return T||b("algorithm:",M,"is not yet supported"),{update:function(D){return p.isBuffer(D)||(D=new p(D)),N.push(D),D.length,this},digest:function(D){var L=p.concat(N),L=B?function(H,V,O){p.isBuffer(V)||(V=new p(V)),p.isBuffer(O)||(O=new p(O)),V.length>y?V=H(V):V.length<y&&(V=p.concat([V,x],y));for(var U=new p(y),j=new p(y),Y=0;Y<y;Y++)U[Y]=54^V[Y],j[Y]=92^V[Y];return O=H(p.concat([U,O])),H(p.concat([j,O]))}(T,B,L):T(L);return N=null,D?L.toString(D):L}}}function b(){var M=[].slice.call(arguments).join(" ");throw Error([M,"we accept pull requests","http://github.com/dominictarr/crypto-browserify"].join(`
`))}x.fill(0),r.createHash=function(M){return C(M)},r.createHmac=C,r.randomBytes=function(M,B){if(!B||!B.call)return new p(g(M));try{B.call(this,void 0,new p(g(M)))}catch(T){B(T)}};var I,v=["createCredentials","createCipher","createCipheriv","createDecipher","createDecipheriv","createSign","createVerify","createDiffieHellman","pbkdf2"],P=function(M){r[M]=function(){b("sorry,",M,"is not implemented yet")}};for(I in v)P(v[I],I)}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/index.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./md5":6,"./rng":7,"./sha":8,"./sha256":9,buffer:3,lYpoI2:11}],6:[function(n,o,r){(function(i,s,a,c,l,h,d,u,_){var p=n("./helpers");function m(b,I){b[I>>5]|=128<<I%32,b[14+(I+64>>>9<<4)]=I;for(var v=1732584193,P=-271733879,M=-1732584194,B=271733878,T=0;T<b.length;T+=16){var N=v,D=P,L=M,H=B,v=g(v,P,M,B,b[T+0],7,-680876936),B=g(B,v,P,M,b[T+1],12,-389564586),M=g(M,B,v,P,b[T+2],17,606105819),P=g(P,M,B,v,b[T+3],22,-1044525330);v=g(v,P,M,B,b[T+4],7,-176418897),B=g(B,v,P,M,b[T+5],12,1200080426),M=g(M,B,v,P,b[T+6],17,-1473231341),P=g(P,M,B,v,b[T+7],22,-45705983),v=g(v,P,M,B,b[T+8],7,1770035416),B=g(B,v,P,M,b[T+9],12,-1958414417),M=g(M,B,v,P,b[T+10],17,-42063),P=g(P,M,B,v,b[T+11],22,-1990404162),v=g(v,P,M,B,b[T+12],7,1804603682),B=g(B,v,P,M,b[T+13],12,-40341101),M=g(M,B,v,P,b[T+14],17,-1502002290),v=f(v,P=g(P,M,B,v,b[T+15],22,1236535329),M,B,b[T+1],5,-165796510),B=f(B,v,P,M,b[T+6],9,-1069501632),M=f(M,B,v,P,b[T+11],14,643717713),P=f(P,M,B,v,b[T+0],20,-373897302),v=f(v,P,M,B,b[T+5],5,-701558691),B=f(B,v,P,M,b[T+10],9,38016083),M=f(M,B,v,P,b[T+15],14,-660478335),P=f(P,M,B,v,b[T+4],20,-405537848),v=f(v,P,M,B,b[T+9],5,568446438),B=f(B,v,P,M,b[T+14],9,-1019803690),M=f(M,B,v,P,b[T+3],14,-187363961),P=f(P,M,B,v,b[T+8],20,1163531501),v=f(v,P,M,B,b[T+13],5,-1444681467),B=f(B,v,P,M,b[T+2],9,-51403784),M=f(M,B,v,P,b[T+7],14,1735328473),v=y(v,P=f(P,M,B,v,b[T+12],20,-1926607734),M,B,b[T+5],4,-378558),B=y(B,v,P,M,b[T+8],11,-2022574463),M=y(M,B,v,P,b[T+11],16,1839030562),P=y(P,M,B,v,b[T+14],23,-35309556),v=y(v,P,M,B,b[T+1],4,-1530992060),B=y(B,v,P,M,b[T+4],11,1272893353),M=y(M,B,v,P,b[T+7],16,-155497632),P=y(P,M,B,v,b[T+10],23,-1094730640),v=y(v,P,M,B,b[T+13],4,681279174),B=y(B,v,P,M,b[T+0],11,-358537222),M=y(M,B,v,P,b[T+3],16,-722521979),P=y(P,M,B,v,b[T+6],23,76029189),v=y(v,P,M,B,b[T+9],4,-640364487),B=y(B,v,P,M,b[T+12],11,-421815835),M=y(M,B,v,P,b[T+15],16,530742520),v=x(v,P=y(P,M,B,v,b[T+2],23,-995338651),M,B,b[T+0],6,-198630844),B=x(B,v,P,M,b[T+7],10,1126891415),M=x(M,B,v,P,b[T+14],15,-1416354905),P=x(P,M,B,v,b[T+5],21,-57434055),v=x(v,P,M,B,b[T+12],6,1700485571),B=x(B,v,P,M,b[T+3],10,-1894986606),M=x(M,B,v,P,b[T+10],15,-1051523),P=x(P,M,B,v,b[T+1],21,-2054922799),v=x(v,P,M,B,b[T+8],6,1873313359),B=x(B,v,P,M,b[T+15],10,-30611744),M=x(M,B,v,P,b[T+6],15,-1560198380),P=x(P,M,B,v,b[T+13],21,1309151649),v=x(v,P,M,B,b[T+4],6,-145523070),B=x(B,v,P,M,b[T+11],10,-1120210379),M=x(M,B,v,P,b[T+2],15,718787259),P=x(P,M,B,v,b[T+9],21,-343485551),v=C(v,N),P=C(P,D),M=C(M,L),B=C(B,H)}return Array(v,P,M,B)}function A(b,I,v,P,M,B){return C((I=C(C(I,b),C(P,B)))<<M|I>>>32-M,v)}function g(b,I,v,P,M,B,T){return A(I&v|~I&P,b,I,M,B,T)}function f(b,I,v,P,M,B,T){return A(I&P|v&~P,b,I,M,B,T)}function y(b,I,v,P,M,B,T){return A(I^v^P,b,I,M,B,T)}function x(b,I,v,P,M,B,T){return A(v^(I|~P),b,I,M,B,T)}function C(b,I){var v=(65535&b)+(65535&I);return(b>>16)+(I>>16)+(v>>16)<<16|65535&v}o.exports=function(b){return p.hash(b,m,16)}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/md5.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],7:[function(n,o,r){(function(i,s,a,c,l,h,d,u,_){var p;o.exports=p||function(m){for(var A,g=Array(m),f=0;f<m;f++)(3&f)==0&&(A=4294967296*Math.random()),g[f]=A>>>((3&f)<<3)&255;return g}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/rng.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:11}],8:[function(n,o,r){(function(i,s,a,c,l,h,d,u,_){var p=n("./helpers");function m(f,y){f[y>>5]|=128<<24-y%32,f[15+(y+64>>9<<4)]=y;for(var x,C,b,I=Array(80),v=1732584193,P=-271733879,M=-1732584194,B=271733878,T=-1009589776,N=0;N<f.length;N+=16){for(var D=v,L=P,H=M,V=B,O=T,U=0;U<80;U++){I[U]=U<16?f[N+U]:g(I[U-3]^I[U-8]^I[U-14]^I[U-16],1);var j=A(A(g(v,5),(j=P,C=M,b=B,(x=U)<20?j&C|~j&b:!(x<40)&&x<60?j&C|j&b|C&b:j^C^b)),A(A(T,I[U]),(x=U)<20?1518500249:x<40?1859775393:x<60?-1894007588:-899497514)),T=B,B=M,M=g(P,30),P=v,v=j}v=A(v,D),P=A(P,L),M=A(M,H),B=A(B,V),T=A(T,O)}return Array(v,P,M,B,T)}function A(f,y){var x=(65535&f)+(65535&y);return(f>>16)+(y>>16)+(x>>16)<<16|65535&x}function g(f,y){return f<<y|f>>>32-y}o.exports=function(f){return p.hash(f,m,20,!0)}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],9:[function(n,o,r){(function(i,s,a,c,l,h,d,u,_){function p(y,x){var C=(65535&y)+(65535&x);return(y>>16)+(x>>16)+(C>>16)<<16|65535&C}function m(y,x){var C,b=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],I=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],v=Array(64);y[x>>5]|=128<<24-x%32,y[15+(x+64>>9<<4)]=x;for(var P,M,B=0;B<y.length;B+=16){for(var T=I[0],N=I[1],D=I[2],L=I[3],H=I[4],V=I[5],O=I[6],U=I[7],j=0;j<64;j++)v[j]=j<16?y[j+B]:p(p(p((M=v[j-2],g(M,17)^g(M,19)^f(M,10)),v[j-7]),(M=v[j-15],g(M,7)^g(M,18)^f(M,3))),v[j-16]),C=p(p(p(p(U,g(M=H,6)^g(M,11)^g(M,25)),H&V^~H&O),b[j]),v[j]),P=p(g(P=T,2)^g(P,13)^g(P,22),T&N^T&D^N&D),U=O,O=V,V=H,H=p(L,C),L=D,D=N,N=T,T=p(C,P);I[0]=p(T,I[0]),I[1]=p(N,I[1]),I[2]=p(D,I[2]),I[3]=p(L,I[3]),I[4]=p(H,I[4]),I[5]=p(V,I[5]),I[6]=p(O,I[6]),I[7]=p(U,I[7])}return I}var A=n("./helpers"),g=function(y,x){return y>>>x|y<<32-x},f=function(y,x){return y>>>x};o.exports=function(y){return A.hash(y,m,32,!0)}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha256.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],10:[function(n,o,r){(function(i,s,a,c,l,h,d,u,_){r.read=function(p,m,A,g,B){var y,x,C=8*B-g-1,b=(1<<C)-1,I=b>>1,v=-7,P=A?B-1:0,M=A?-1:1,B=p[m+P];for(P+=M,y=B&(1<<-v)-1,B>>=-v,v+=C;0<v;y=256*y+p[m+P],P+=M,v-=8);for(x=y&(1<<-v)-1,y>>=-v,v+=g;0<v;x=256*x+p[m+P],P+=M,v-=8);if(y===0)y=1-I;else{if(y===b)return x?NaN:1/0*(B?-1:1);x+=Math.pow(2,g),y-=I}return(B?-1:1)*x*Math.pow(2,y-g)},r.write=function(p,m,A,g,f,T){var x,C,b=8*T-f-1,I=(1<<b)-1,v=I>>1,P=f===23?Math.pow(2,-24)-Math.pow(2,-77):0,M=g?0:T-1,B=g?1:-1,T=m<0||m===0&&1/m<0?1:0;for(m=Math.abs(m),isNaN(m)||m===1/0?(C=isNaN(m)?1:0,x=I):(x=Math.floor(Math.log(m)/Math.LN2),m*(g=Math.pow(2,-x))<1&&(x--,g*=2),2<=(m+=1<=x+v?P/g:P*Math.pow(2,1-v))*g&&(x++,g/=2),I<=x+v?(C=0,x=I):1<=x+v?(C=(m*g-1)*Math.pow(2,f),x+=v):(C=m*Math.pow(2,v-1)*Math.pow(2,f),x=0));8<=f;p[A+M]=255&C,M+=B,C/=256,f-=8);for(x=x<<f|C,b+=f;0<b;p[A+M]=255&x,M+=B,x/=256,b-=8);p[A+M-B]|=128*T}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/ieee754/index.js","/node_modules/gulp-browserify/node_modules/ieee754")},{buffer:3,lYpoI2:11}],11:[function(n,o,r){(function(i,s,a,c,l,h,d,u,_){var p,m,A;function g(){}(i=o.exports={}).nextTick=(m=typeof window<"u"&&window.setImmediate,A=typeof window<"u"&&window.postMessage&&window.addEventListener,m?function(f){return window.setImmediate(f)}:A?(p=[],window.addEventListener("message",function(f){var y=f.source;y!==window&&y!==null||f.data!=="process-tick"||(f.stopPropagation(),0<p.length&&p.shift()())},!0),function(f){p.push(f),window.postMessage("process-tick","*")}):function(f){setTimeout(f,0)}),i.title="browser",i.browser=!0,i.env={},i.argv=[],i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.binding=function(f){throw Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(f){throw Error("process.chdir is not supported")}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/process/browser.js","/node_modules/gulp-browserify/node_modules/process")},{buffer:3,lYpoI2:11}]},{},[1])(1)})}});function Gn(e,t){let n=e.x-t.x,o=e.y-t.y;return Math.sqrt(n*n+o*o)}function $k(e,t){return gx(e,t[0],t[1])}function gx(e,t,n){let o=n.x-t.x,r=n.y-t.y;if(o===0&&r===0)return Gn(e,t);let i=Math.max(0,Math.min(1,((e.x-t.x)*o+(e.y-t.y)*r)/(o*o+r*r||1))),s=e.x-t.x-i*o,a=e.y-t.y-i*r;return Math.sqrt(s*s+a*a)}var u9e=(e,t,n)=>(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x);function sT(e,t){let[n,o]=e,[r,i]=t;if(Math.max(n.x,o.x)>=Math.min(r.x,i.x)&&Math.max(r.x,i.x)>=Math.min(n.x,o.x)&&Math.max(n.y,o.y)>=Math.min(r.y,i.y)&&Math.max(r.y,i.y)>=Math.min(n.y,o.y)&&u9e(n,o,r)*u9e(n,o,i)<=0&&u9e(r,i,n)*u9e(r,i,o)<=0)return 0;return Math.min($k(n,t),$k(o,t),$k(r,e),$k(i,e))}var br=(e)=>e.slice(1).reduce((t,n,o)=>t+Gn(e[o],n),0);function T1(e){let t=[];for(let[n,o]of e.entries()){if(t.length&&Gn(t.at(-1),o)<0.000000000001){if(n===e.length-1)t[t.length-1]=o;continue}while(t.length>1){let r=t[t.length-2],i=t.at(-1),s=i.x-r.x,a=i.y-r.y,c=o.x-i.x,l=o.y-i.y,h=Math.hypot(s,a)*Math.hypot(c,l);if(s*c+a*l<=0||Math.abs(s*l-a*c)>h*0.00000001||$k(i,[r,o])>0.0000000001)break;t.pop()}t.push(o)}return t}function C2(e,t){let n=e.connections.find((o)=>o.name===t);return(e.traces??[]).filter((o)=>o.connection_name===t||o.source_trace_id===(n?.source_trace_id??t)).reduce((o,r)=>o+br(r.route),0)}function NP(e,t){return(e.buses??[]).map((n)=>{let o=n.connectionNames.map((a)=>{let c=t.find((l)=>l.connection_name===a);return{name:a,carrierLengthMm:c?br(c.route):null,fixedLengthMm:C2(e,a),totalLengthMm:c?br(c.route)+C2(e,a):null}}),r=o.every((a)=>a.totalLengthMm!==null),i=o.map((a)=>a.totalLengthMm??0),s=r&&i.length?Math.max(...i)-Math.min(...i):null;return{busId:n.busId,minLengthMm:n.minLength??null,aboveMinimumLength:n.minLength===void 0?!0:r&&i.every((a)=>a>=n.minLength-0.0000001),maxLengthMm:n.maxLength??null,withinLengthLimit:n.maxLength===void 0?!0:r&&i.every((a)=>a<=n.maxLength+0.0000001),toleranceMm:n.maxLengthSkew??null,skewMm:s,matched:n.maxLengthSkew!==void 0&&s!==null&&s<=n.maxLengthSkew+0.0000001,lengths:o}})}function hat(e){return[...(e.buses??[]).filter((t)=>t.maxLengthSkew!==void 0).map((t)=>({names:t.connectionNames,tolerance:t.maxLengthSkew})),...(e.differentialPairs??[]).map((t)=>({names:t.connectionNames,tolerance:t.lengthTolerance}))]}function sL(e,t){let n=new Map(t.map((r)=>[r.connection_name,br(r.route)+C2(e,r.connection_name)]));for(let r of e.buses??[])if(r.minLength!==void 0){for(let i of r.connectionNames)if(n.has(i))n.set(i,Math.max(n.get(i),r.minLength))}let o=hat(e);for(let r=0;r<n.size;r++){let i=!1;for(let{names:s,tolerance:a}of o){let c=Math.max(...s.map((l)=>n.get(l)))-a;for(let l of s)if(n.get(l)<c-0.000000001)n.set(l,c),i=!0}if(!i)break}return n}function oit(e,t){return NP({...e,buses:(e.differentialPairs??[]).map((n,o)=>({busId:`pair_${o}`,connectionNames:n.connectionNames,maxLengthSkew:n.lengthTolerance}))},t)}function Ax(e,t){return Math.min(1/0,...(e.buses??[]).filter((n)=>n.connectionNames.includes(t)&&n.maxLength!==void 0).map((n)=>n.maxLength-C2(e,t)))}function mXr(e,t){for(let n of e.buses??[])if(n.maxLength!==void 0&&n.connectionNames.some((o)=>(t.get(o)??1/0)>n.maxLength+0.0000001))throw Error(`${n.busId}: matching would exceed maximum length ${n.maxLength} mm`)}function GCn(e,t){let n=new Set(e.buses?.flatMap((i)=>i.connectionNames)),o=sL(e,t),r=new Set;for(let i of e.differentialPairs??[])if(i.connectionNames.some((s)=>{let a=t.find((u)=>u.connection_name===s);if(!a?.coupledSection||!n.has(s))return!1;let[c,l]=a.coupledSection,h=0;for(let u=c+1;u<=l;u++)h=Math.max(h,Gn(a.route[u-1],a.route[u]));return(o.get(s)??0)-br(a.route)-C2(e,s)>h/2}))for(let s of i.connectionNames)r.add(s);return r}function $fn(e){if(e.some((c)=>!c.coupledSection))return e;let t=e.map((c)=>c.coupledSection[0]),n=e.map((c,l)=>c.route[t[l]]),o=e.map((c,l)=>c.route[t[l]+1]);if(n.some((c)=>c?.route_type!=="wire")||o.some((c)=>c?.route_type!=="wire")||n.some((c)=>c.layer!==n[0].layer)||o.some((c)=>c.layer!==n[0].layer)||e.some((c,l)=>c.curvedSegments?.includes(t[l]+1)))return e;let r=n.map((c,l)=>{let h=Gn(c,o[l]);return{span:h,x:(o[l].x-c.x)/h,y:(o[l].y-c.y)/h}});if(r.some((c)=>c.span<0.00000001)||Gn(r[0],r[1])>0.0000001)return e;let i=r[0],s=(c)=>c.x*i.x+c.y*i.y,a=Math.max(...n.map(s));if(n.some((c,l)=>a-s(c)>r[l].span+0.00000001))return e;return e.map((c,l)=>{let h=t[l],d=a-s(n[l]);if(d<0.00000001)return c;if(Math.abs(d-r[l].span)<0.00000001){if(h+1>=c.coupledSection[1])return c;return{...c,coupledSection:[h+1,c.coupledSection[1]]}}let u={...n[l],x:n[l].x+i.x*d,y:n[l].y+i.y*d};return{...c,route:[...c.route.slice(0,h+1),u,...c.route.slice(h+1)],coupledSection:[h+1,c.coupledSection[1]+1],curvedSegments:c.curvedSegments?.map((_)=>_>h?_+1:_)}})}function qfn(e){let t=e.route.length;return{...e,route:e.route.toReversed(),coupledSection:e.coupledSection&&[t-1-e.coupledSection[1],t-1-e.coupledSection[0]],curvedSegments:e.curvedSegments?.map((n)=>t-n).sort((n,o)=>n-o)}}function j8e(e,t){let n=[...t];for(let o of e.differentialPairs??[]){let r=o.connectionNames.map((a)=>n.findIndex((c)=>c.connection_name===a)),i=r.map((a)=>n[a]);if(i.some((a)=>!a?.coupledSection))continue;let s=$fn($fn(i).map(qfn)).map(qfn);r.forEach((a,c)=>{n[a]=s[c]})}return n}var _x=(e,t)=>e.x>=t.minX&&e.x<=t.maxX&&e.y>=t.minY&&e.y<=t.maxY;function EG(e,t){let n=e.obstacles.filter((i)=>i.componentId),o=new Map,r=(i,s,a,c=a)=>{i.minX=Math.min(i.minX,s.x-a),i.maxX=Math.max(i.maxX,s.x+a),i.minY=Math.min(i.minY,s.y-c),i.maxY=Math.max(i.maxY,s.y+c)};for(let i of n){let s=o.get(i.componentId);if(!s){let c={minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0};s={pads:c,copper:{...c}},o.set(i.componentId,s)}let a=(i.ccwRotationDegrees??0)*Math.PI/180;r(s.pads,i.center,(Math.abs(Math.cos(a))*i.width+Math.abs(Math.sin(a))*i.height)/2,(Math.abs(Math.sin(a))*i.width+Math.abs(Math.cos(a))*i.height)/2)}for(let i of o.values())i.copper={...i.pads};for(let i of e.traces??[]){let s=i.route.filter((g)=>g.route_type==="via");if(s.length!==1||!i.route.length)continue;let a=i.route[0],c=n.find((g)=>Gn(g.center,a)<0.0001);if(!c)continue;let l=o.get(c.componentId),h=s[0],d=(h.via_diameter??e.minViaPadDiameter??0.6)/2,u=(c.ccwRotationDegrees??0)*Math.PI/180,_=e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075,p=(Math.abs(Math.cos(u))*c.width+Math.abs(Math.sin(u))*c.height)/2+d+_,m=(Math.abs(Math.sin(u))*c.width+Math.abs(Math.cos(u))*c.height)/2+d+_,A=0.001;if(Math.abs(h.x-a.x)>p+A+0.0001||Math.abs(h.y-a.y)>m+A+0.0001)continue;r(l.copper,h,(h.via_diameter??e.minViaPadDiameter??0.6)/2)}for(let i of o.values())i.copper.minX-=t,i.copper.maxX+=t,i.copper.minY-=t,i.copper.maxY+=t;return[...o.values()]}function e0e(e,t,n={}){let o=t.route[0].width,r=(e.traces??[]).filter((a)=>a.connection_name===t.connection_name).flatMap((a)=>a.route.filter((c)=>c.route_type==="via")).map((a)=>({via:a,reach:((a.via_diameter??e.minViaPadDiameter??0.6)+o)/2}));if(!r.length)return(a)=>!0;let i=t.route.filter((a)=>a.route_type==="wire"),s=(a,c)=>Math.abs(a.x-c.x)<0.00000001&&Math.abs(a.y-c.y)<0.00000001;return(a)=>{let c=0,l=0;while(c<Math.min(a.length,i.length)&&s(a[c],i[c]))c++;while(l<Math.min(a.length,i.length)&&s(a[a.length-1-l],i[i.length-1-l]))l++;for(let{via:h,reach:d}of r){let u=s(h,a[0]);if(!u&&!s(h,a.at(-1)))continue;let _=0;for(let p=1;p<a.length;p++){let m=u?p:a.length-p,A=a[u?m-1:m],g=a[u?m:m-1];if(!(n.preserveExistingApproach!==!1&&(u?m<c:m>=a.length-l+1))&&_>d+0.000000001&&Math.min(A.x,g.x)<=h.x+d&&Math.max(A.x,g.x)>=h.x-d&&Math.min(A.y,g.y)<=h.y+d&&Math.max(A.y,g.y)>=h.y-d&&gx(h,A,g)<=d+0.000000001)return!1;if(_<=d+0.000000001)_+=Gn(A,g)}}return!0}}var t0e=class{root;constructor(e){let t=e.map((i)=>({copper:i,...i.rect??{minX:Math.min(i.a.x,i.b.x)-i.radius,maxX:Math.max(i.a.x,i.b.x)+i.radius,minY:Math.min(i.a.y,i.b.y)-i.radius,maxY:Math.max(i.a.y,i.b.y)+i.radius}})),n=(i,s)=>{let a=t[i];t[i]=t[s],t[s]=a},o=(i,s,a,c)=>{let l=(h)=>c?h.minX+h.maxX:h.minY+h.maxY;while(s-i>1){let h=l(t[i]),d=l(t[i+s>>1]),u=l(t[s-1]),_=h<d?d<u?d:Math.max(h,u):h<u?h:Math.max(d,u),p=i,m=s,A=i;while(A<m){let g=l(t[A]);if(g<_)n(p++,A++);else if(g>_)n(A,--m);else A++}if(a<p)s=p;else if(a>=m)i=m;else return}},r=(i,s)=>{let a={minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0};for(let h=i;h<s;h++){let d=t[h];a.minX=Math.min(a.minX,d.minX),a.maxX=Math.max(a.maxX,d.maxX),a.minY=Math.min(a.minY,d.minY),a.maxY=Math.max(a.maxY,d.maxY)}if(s-i<=8)return{...a,entries:t.slice(i,s)};let c=a.maxX-a.minX>=a.maxY-a.minY,l=i+s>>1;return o(i,s,l,c),{...a,left:r(i,l),right:r(l,s)}};if(t.length)this.root=r(0,t.length)}distanceToPoint(e,t,n=0){let o=1/0,r=(s)=>{let a=Math.max(s.minX-e.x,0,e.x-s.maxX),c=Math.max(s.minY-e.y,0,e.y-s.maxY);return a||c?Math.hypot(a,c)-n:-1/0},i=(s,a)=>{if(a>=o)return;if(s.entries){for(let h of s.entries)if(r(h)<o)o=Math.min(o,t(h.copper));return}let c=r(s.left),l=r(s.right);if(c<=l)i(s.left,c),i(s.right,l);else i(s.right,l),i(s.left,c)};if(this.root)i(this.root,r(this.root));return o}some(e,t){let n=(o)=>{if(o.minX>e.maxX||o.maxX<e.minX||o.minY>e.maxY||o.maxY<e.minY)return!1;if(o.entries){for(let r of o.entries){if(r.minX>e.maxX||r.maxX<e.minX||r.minY>e.maxY||r.maxY<e.minY)continue;if(t(r.copper))return!0}return!1}return n(o.left)||n(o.right)};return this.root?n(this.root):!1}};function fa(e){let t=[];for(let o of e.obstacles){let r=(o.ccwRotationDegrees??0)*Math.PI/180,i=Math.abs(Math.cos(r))*o.width+Math.abs(Math.sin(r))*o.height,s=Math.abs(Math.sin(r))*o.width+Math.abs(Math.cos(r))*o.height;for(let a of o.layers)t.push({a:o.center,b:o.center,radius:o.shape==="circle"?o.width/2:0,layer:a,owners:o.connectedTo,rect:o.shape==="circle"?void 0:{minX:o.center.x-i/2,maxX:o.center.x+i/2,minY:o.center.y-s/2,maxY:o.center.y+s/2}})}let n=Array.from({length:e.layerCount},(o,r)=>r===0?"top":r===e.layerCount-1?"bottom":`inner${r}`);for(let o of e.traces??[])for(let r=0;r<o.route.length;r++){let i=o.route[r],s=o.route[r+1],a=[o.connection_name??"",o.source_trace_id??""];if(i.route_type==="via"){let c=n.indexOf(i.from_layer),l=n.indexOf(i.to_layer);for(let h of i.layers??n.slice(Math.min(c,l),Math.max(c,l)+1))t.push({a:i,b:i,radius:(i.via_diameter??0.3)/2,layer:h,owners:a})}else if(s?.route_type==="wire"){if(i.layer!==s.layer)throw Error("Fixed trace changes layer without a via");t.push({a:i,b:s,radius:i.width/2,layer:i.layer,owners:a})}if(s&&i.route_type!==s.route_type&&Gn(i,s)>0.0000000001){let c=i.route_type==="wire"?i:s;t.push({a:i,b:s,radius:c.width/2,layer:c.layer,owners:a})}}return t}function oi(e){return e.route.slice(1).map((t,n)=>({a:e.route[n],b:t,radius:t.width/2,layer:t.layer,owners:[e.connection_name??""]}))}var _Xr=(e,t,n)=>{let o=0,r=1;for(let[i,s,a,c]of[[e.x,t.x-e.x,n.minX,n.maxX],[e.y,t.y-e.y,n.minY,n.maxY]]){if(Math.abs(s)<0.000000000001){if(i<a||i>c)return!1;continue}let l=(a-i)/s,h=(c-i)/s;if(l>h)[l,h]=[h,l];if(o=Math.max(o,l),r=Math.min(r,h),o>r)return!1}return!0};function n0e(e,t,n){if(!n.rect){if(e.x===t.x&&e.y===t.y){if(n.a.x===n.b.x&&n.a.y===n.b.y)return Gn(e,n.a)-n.radius;return $k(e,[n.a,n.b])-n.radius}if(n.a.x===n.b.x&&n.a.y===n.b.y)return $k(n.a,[e,t])-n.radius;return sT([e,t],[n.a,n.b])-n.radius}let o=n.rect;if(_Xr(e,t,o))return 0;let r=[{x:o.minX,y:o.minY},{x:o.maxX,y:o.minY},{x:o.maxX,y:o.maxY},{x:o.minX,y:o.maxY}];return Math.min(...r.map((i,s)=>sT([e,t],[i,r[(s+1)%4]])))}function rit(e,t,n,o){if(n.rect)return n0e(e,t,n)<o;let{a:r,b:i,radius:s}=n;if(r.x===i.x&&r.y===i.y)return gx(r,e,t)-s<o;if(e.x===t.x&&e.y===t.y)return gx(e,r,i)-s<o;if(Math.max(e.x,t.x)>=Math.min(r.x,i.x)&&Math.max(r.x,i.x)>=Math.min(e.x,t.x)&&Math.max(e.y,t.y)>=Math.min(r.y,i.y)&&Math.max(r.y,i.y)>=Math.min(e.y,t.y)&&((t.x-e.x)*(r.y-e.y)-(t.y-e.y)*(r.x-e.x))*((t.x-e.x)*(i.y-e.y)-(t.y-e.y)*(i.x-e.x))<=0&&((i.x-r.x)*(e.y-r.y)-(i.y-r.y)*(e.x-r.x))*((i.x-r.x)*(t.y-r.y)-(i.y-r.y)*(t.x-r.x))<=0)return-s<o;return gx(e,r,i)-s<o||gx(t,r,i)-s<o||gx(r,e,t)-s<o||gx(i,e,t)-s<o}function gXr(e){let t=e.b.x-e.a.x,n=e.b.y-e.a.y;return{copper:e,ax:e.a.x,ay:e.a.y,bx:e.b.x,by:e.b.y,dx:t,dy:n,denominator:t*t+n*n}}function LJ(e,t,n,o,r,i,s){let a=e-n,c=t-o;if(r===0&&i===0)return Math.sqrt(a*a+c*c);let l=Math.max(0,Math.min(1,(a*r+c*i)/(s||1))),h=a-l*r,d=c-l*i;return Math.sqrt(h*h+d*d)}function Jfn(e,t,n,o,r,i,s,a,c){let l=a.copper.radius;if(a.copper.rect)return rit({x:e,y:t},{x:n,y:o},a.copper,c);if(a.dx===0&&a.dy===0)return LJ(a.ax,a.ay,e,t,r,i,s)-l<c;if(r===0&&i===0)return LJ(e,t,a.ax,a.ay,a.dx,a.dy,a.denominator)-l<c;if(Math.max(e,n)>=Math.min(a.ax,a.bx)&&Math.max(a.ax,a.bx)>=Math.min(e,n)&&Math.max(t,o)>=Math.min(a.ay,a.by)&&Math.max(a.ay,a.by)>=Math.min(t,o)&&(r*(a.ay-t)-i*(a.ax-e))*(r*(a.by-t)-i*(a.bx-e))<=0&&(a.dx*(t-a.ay)-a.dy*(e-a.ax))*(a.dx*(o-a.ay)-a.dy*(n-a.ax))<=0)return-l<c;return LJ(e,t,a.ax,a.ay,a.dx,a.dy,a.denominator)-l<c||LJ(n,o,a.ax,a.ay,a.dx,a.dy,a.denominator)-l<c||LJ(a.ax,a.ay,e,t,r,i,s)-l<c||LJ(a.bx,a.by,e,t,r,i,s)-l<c}var Di=class{constructor(e,t,n,o){this.input=e,this.connection=t,this.width=n,this.owners=new Set([t.name,t.source_trace_id,...t.pointsToConnect.flatMap((r)=>[r.pointId,r.pcb_port_id])].filter((r)=>!!r)),this.copper=o.filter((r)=>r.layer===t.pointsToConnect[0].layer&&!r.owners.some((i)=>this.owners.has(i))),this.margin=n/2+(e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075)}input;connection;width;visibleCalls=0;copperIndex;copper;owners;margin;visible(e,t){let n=this.width/2+(this.input.minBoardEdgeClearance??0),o=this.input.bounds;if([e,t].some((c)=>c.x<o.minX+n-0.000000001||c.x>o.maxX-n+0.000000001||c.y<o.minY+n-0.000000001||c.y>o.maxY-n+0.000000001))return!1;let r=Math.min(e.x,t.x)-this.margin,i=Math.max(e.x,t.x)+this.margin,s=Math.min(e.y,t.y)-this.margin,a=Math.max(e.y,t.y)+this.margin;if(++this.visibleCalls===16)this.copperIndex=new t0e(this.copper);if(this.copperIndex)return!this.copperIndex.some({minX:r,maxX:i,minY:s,maxY:a},(c)=>rit(e,t,c,this.margin-0.00000001));for(let c of this.copper){let l=c.rect??{minX:Math.min(c.a.x,c.b.x)-c.radius,maxX:Math.max(c.a.x,c.b.x)+c.radius,minY:Math.min(c.a.y,c.b.y)-c.radius,maxY:Math.max(c.a.y,c.b.y)+c.radius};if(l.minX>i||l.maxX<r||l.minY>a||l.maxY<s)continue;if(rit(e,t,c,this.margin-0.00000001))return!1}return!0}pathVisible(e){return e.slice(1).every((t,n)=>this.visible(e[n],t))}vertices(){let e=[],t=Math.SQRT2-1;for(let r of this.copper)if(r.rect){let i=r.rect,s=this.margin+0.00001;e.push({x:i.minX-s,y:i.minY-s},{x:i.minX-s,y:i.maxY+s},{x:i.maxX+s,y:i.minY-s},{x:i.maxX+s,y:i.maxY+s})}else{let i=r.radius+this.margin+0.00001;for(let s of Gn(r.a,r.b)<0.000000001?[r.a]:[r.a,r.b])for(let[a,c]of[[1,t],[t,1],[-t,1],[-1,t],[-1,-t],[-t,-1],[t,-1],[1,-t]])e.push({x:s.x+a*i,y:s.y+c*i})}let o=new Set;return e.filter((r)=>{let i=`${r.x.toFixed(9)},${r.y.toFixed(9)}`;if(o.has(i))return!1;return o.add(i),this.visible(r,r)})}};function AXr(e,t,n){let o=fa(e);function*r(c,l){let h=e.connections.find((y)=>y.name===c.connection_name),d=c.coupledSection?(y)=>!0:e0e(e,c),u=c.route[0].width,_=C2(e,h.name),p=n.get(h.name)-br(c.route)-_;if(p<0.00000001){yield c;return}let m=e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075,A=Math.max(u+m,3*u),g=2*(A+2*u),f=c.route.slice(1).map((y,x)=>({i:x,span:Gn(c.route[x],y)})).sort((y,x)=>x.span-y.span);for(let{i:y}of f){let x=c.route[y],C=c.route[y+1],b=Gn(x,C);if(b<0.01)continue;let I=(C.x-x.x)/b,v=(C.y-x.y)/b,P=Math.floor(b*0.9/g),M=Math.min(P,Math.max(2,Math.ceil(p/(12*u)))),B=Array.from({length:P},(T,N)=>N+1).sort((T,N)=>Math.abs(T-M)-Math.abs(N-M)||N-T);for(let T of B)for(let N of[0.9,0.65,0.4]){let D=b*N/T;if(D<g)continue;let L=Math.min(p/(2*T),D/10,(D/2-A)/2),H=p/(2*T)+2*L*(2-Math.SQRT2);for(let V of[0.5,0,1])for(let O of[1,-1]){let U=(X,K)=>({x:x.x+I*X-v*K*O,y:x.y+v*X+I*K*O}),j=[U(0,0)];for(let X=0;X<T;X++){let K=b*(1-N)*(0.05+0.9*V)+X*D,J=D*0.5;j.push(...[[K,0],[K+L,L],[K+L,H-L],[K+2*L,H],[K+J-2*L,H],[K+J-L,H-L],[K+J-L,L],[K+J,0]].map(([ee,se])=>U(ee,se)))}if(j.push(U(b,0)),!l.pathVisible(j))continue;let Y=T1([...c.route.slice(0,y),...j,...c.route.slice(y+2)]);if(Math.abs(br(Y)+_-n.get(h.name))>0.000001)continue;if(!d(Y)||!ml(Y,A))continue;yield{...c,route:Y.map((X)=>({...X,route_type:"wire",layer:h.pointsToConnect[0].layer,width:u}))}}}}}let i=[...t],s=new Set(t.map((c,l)=>l)),a=!0;while(s.size&&a){a=!1;for(let c of s){let l=e.connections.find((u)=>u.name===t[c].connection_name),h=new Di(e,l,t[c].route[0].width,[...o,...i.flatMap(oi)]),d=r(t[c],h).next().value;if(!d)continue;i[c]=d,s.delete(c),a=!0}}if(s.size)throw Error(`Insufficient tuning clearance for ${[...s].map((c)=>t[c].connection_name).join(", ")}`);return i}function ml(e,t){let n=[0],o=[0],r=[0];for(let i=1;i<e.length-1;i++){let s={x:e[i].x-e[i-1].x,y:e[i].y-e[i-1].y},a={x:e[i+1].x-e[i].x,y:e[i+1].y-e[i].y},c=Math.abs(Math.atan2(s.x*a.y-s.y*a.x,s.x*a.x+s.y*a.y)),l=Math.abs(s.x*a.y-s.y*a.x),h=l<0.000000000001?1/0:Math.hypot(s.x,s.y)*Math.hypot(a.x,a.y)*Gn(e[i-1],e[i+1])/(2*l);o.push(o[i-1]+c),r.push(r[i-1]+Number(c>Math.PI/8+0.00000001||h<t/2-0.00000001))}for(let i=1;i<e.length;i++)n.push(n[i-1]+Gn(e[i-1],e[i]));for(let i=0;i<e.length-1;i++)for(let s=i+2;s<e.length-1;s++){let a=e[i],c=e[i+1],l=e[s],h=e[s+1],d=Math.max(t,0.000000001);if(Math.max(a.x,c.x)+d<Math.min(l.x,h.x)||Math.max(l.x,h.x)+d<Math.min(a.x,c.x)||Math.max(a.y,c.y)+d<Math.min(l.y,h.y)||Math.max(l.y,h.y)+d<Math.min(a.y,c.y))continue;let u=sT([a,c],[l,h]);if(u<0.000000001&&n[s]-n[i+1]>0.00000001)return!1;if(n[s]-n[i+1]<=Math.PI*t+0.00000001&&(o[s]-o[i]<=Math.PI/2+0.00000001||o[s]-o[i]<=Math.PI+0.00000001&&r[s]===r[i]))continue;if(u>=t-0.00000001)continue;let _=0,p=0;for(let m=i;m<=s;m++){let A=e[m+1].x-e[m].x,g=e[m+1].y-e[m].y;if(Math.abs(A)>0.00000001){if(_&&_!==Math.sign(A))return!1;_=Math.sign(A)}if(Math.abs(g)>0.00000001){if(p&&p!==Math.sign(g))return!1;p=Math.sign(g)}}}return!0}function uL(e,t,n=fa(e),o=1.5){if(!Number.isFinite(o)||o<=0)throw Error("Corner trim must be a positive finite number of trace widths");let r=t.map((s)=>({...s,route:[...s.route]})),i=e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075;for(let[s,a]of r.entries()){if(a.route.some((d)=>d.route_type!=="wire"))continue;let c=e.connections.find((d)=>d.name===a.connection_name);if(!c)continue;let l=fa({...e,obstacles:[],traces:r.filter((d,u)=>u!==s)}),h=new Map;for(let d=1;d<a.route.length-1;d++){let[u,_,p]=a.route.slice(d-1,d+2);if(u.route_type!=="wire"||_.route_type!=="wire"||p.route_type!=="wire"||u.layer!==_.layer||_.layer!==p.layer||a.curvedSegments?.some((P)=>P===d||P===d+1)||a.coupledSection&&d>a.coupledSection[0]&&d<a.coupledSection[1])continue;let m=Gn(u,_),A=Gn(_,p);if(m<0.00000001||A<0.00000001)continue;let g={x:(_.x-u.x)/m,y:(_.y-u.y)/m},f={x:(p.x-_.x)/A,y:(p.y-_.y)/A},y=(P)=>Math.min(Math.abs(P.x),Math.abs(P.y))<0.00000001||Math.abs(Math.abs(P.x)-Math.abs(P.y))<0.00000001,x=g.x*f.x+g.y*f.y,C=Math.abs(x+Math.SQRT1_2)<0.00000001;if(!y(g)||!y(f)||Math.abs(x)>0.00000001&&!C)continue;let b=`${_.layer}/${_.width}`,I=h.get(b);if(!I)I=new Di(e,{...c,pointsToConnect:c.pointsToConnect.map((P)=>({...P,layer:_.layer}))},_.width,[...n,...l]),h.set(b,I);let v=Math.min(o*_.width,m/2,A/2);for(let P=0;P<8;P++){let M=v/2**P;if(M<0.000001)break;let B={..._,x:_.x-g.x*M,y:_.y-g.y*M},T={..._,x:_.x+f.x*M,y:_.y+f.y*M},N=Math.sign(g.x*f.y-g.y*f.x),D=(Math.SQRT2-1)*M,L={..._,x:B.x+(g.x-N*g.y)*Math.SQRT1_2*D,y:B.y+(g.y+N*g.x)*Math.SQRT1_2*D},H=C?[B,L,T]:[B,T],V=H.length-1,O=[...a.route.slice(0,d),...H,...a.route.slice(d+1)];if(!I.pathVisible(O)||!ml(O,_.width+i)&&ml(a.route,_.width+i))continue;a.route=O,a.curvedSegments=a.curvedSegments?.map((U)=>U>d?U+V:U),a.coupledSection=a.coupledSection?.map((U,j)=>U>d||U===d&&j===0?U+V:U),d+=V;break}}}return r}function aG(e){return e.every((t)=>{let n,o;for(let r of t.route){if(r.route_type!=="wire"){n=o=void 0;continue}if(!n||n.layer!==r.layer){n=r,o=void 0;continue}let i=Gn(n,r);if(i<0.00000001)continue;let s={x:(r.x-n.x)/i,y:(r.y-n.y)/i};if(o&&o.x*s.x+o.y*s.y<Math.cos(45.2*Math.PI/180))return!1;n=r,o=s}return!0})}function pL(e,t){return(e.differentialPairs??[]).map((n)=>{let o=n.connectionNames.map((A)=>t.find((g)=>g.connection_name===A||g.source_trace_id===A)),r=o.map((A)=>A?.coupledSection?A.route.slice(A.coupledSection[0],A.coupledSection[1]+1):[]),i=o.every((A)=>A?.coupledSection?.length===2&&A.coupledSection.every(Number.isInteger)&&A.coupledSection[0]>=0&&A.coupledSection[1]<A.route.length&&A.coupledSection[0]<A.coupledSection[1])&&r.every((A)=>A.length>=2&&A.every((g)=>g.route_type==="wire"&&Number.isFinite(g.x)&&Number.isFinite(g.y)&&Number.isFinite(g.width)&&g.width>0))&&r.flat().every((A)=>A.layer===r[0][0]?.layer),s=n.traceGap!==void 0||n.maxUncoupledLength!==void 0,a=n.traceGap??e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075,c={connectionNames:n.connectionNames,requestedGapMm:n.traceGap??null};if(!i)return{...c,sharedSectionPresent:!1,minEdgeGapMm:null,maxEdgeGapMm:null,maxSamplingErrorMm:null,sharedCopperMm:null,maxAllowedEdgeGapMm:null,matched:!s};let l=r.map((A)=>A[0].width);if(r.some((A,g)=>A.some((f)=>Math.abs(f.width-l[g])>0.00000001)))return{...c,sharedSectionPresent:!1,minEdgeGapMm:null,maxEdgeGapMm:null,maxSamplingErrorMm:null,sharedCopperMm:null,maxAllowedEdgeGapMm:null,matched:!s};let h=(l[0]+l[1])/2,d=(h+a)/Math.cos(Math.PI/8)-h+0.002,u=1/0,_=-1/0,p=0,m=[0,0];for(let A=0;A<2;A++){let g=r[A],f=o[1-A].route,y=f.slice(1).flatMap((C,b)=>{let I=f[b];return I.route_type==="wire"&&C.route_type==="wire"&&I.layer===g[0].layer&&C.layer===g[0].layer?[{a:I,b:C,radius:I.width/2,layer:I.layer,owners:[]}]:[]}),x=new t0e(y);for(let C=1;C<g.length;C++){let b=g[C-1],I=g[C],v=Gn(b,I),P=Math.max(1,Math.ceil(v/0.002));m[A]+=v,p=Math.max(p,v/(2*P));for(let M=0;M<P;M++){let B=(M+0.5)/P,T={x:b.x+(I.x-b.x)*B,y:b.y+(I.y-b.y)*B},N=x.distanceToPoint(T,(D)=>gx(T,D.a,D.b)-D.radius)-b.width/2;u=Math.min(u,N),_=Math.max(_,N)}}}return{...c,sharedSectionPresent:!0,minEdgeGapMm:u,maxEdgeGapMm:_,maxSamplingErrorMm:p,sharedCopperMm:m,maxAllowedEdgeGapMm:d,matched:!s||m.every((A)=>A>0)&&_+p<=d}})}function UCn(e,t,n,o,r,i,s){let a=Gn(e,t),c=s+n/2;if(!Number.isFinite(a+n+o+s)||n<0||i!==1&&i!==-1||s<=0||o<=0||!Number.isInteger(r)||r<1||r>64||a<6*c)return null;let l=(4*r+2)*c,h=(t.x-e.x)/a,d=(t.y-e.y)/a,u=(f)=>{let y=[{x:0,y:0},{x:c,y:0},{x:c,y:l},{x:f,y:l}];for(let b=1;b<=2*r;b++){let I=b%2?3*c:f,v=l-2*c*b;y.push({x:y.at(-1).x,y:v},{x:I,y:v})}y.push({x:f,y:0},{x:a,y:0});let x=[[],[]],C=(b,I,v,P)=>{for(let M=0;M<(n?2:1);M++){let B=(M===0?1:-1)*n/2,T=b-i*P*B,N=i*I+v*B,D={x:e.x+h*T-d*N,y:e.y+d*T+h*N};if(!x[M].length||Gn(x[M].at(-1),D)>0.0000000001)x[M].push(D)}};C(0,0,1,0);for(let b=1;b<y.length-1;b++){let I=y[b-1],v=y[b],P=y[b+1],M=Gn(I,v),B=Gn(v,P),T={x:(v.x-I.x)/M,y:(v.y-I.y)/M},N={x:(P.x-v.x)/B,y:(P.y-v.y)/B},D={x:v.x-T.x*c,y:v.y-T.y*c},L={x:D.x+N.x*c,y:D.y+N.y*c},H=T.x*N.y-T.y*N.x,V=Math.atan2(D.y-L.y,D.x-L.x);for(let O=0;O<=18;O++){let U=V+H*Math.PI/2*O/18;C(L.x+c*Math.cos(U),L.y+c*Math.sin(U),-H*Math.sin(U),H*Math.cos(U))}}if(C(a,0,1,0),!n)x[1]=x[0];return x},_=5*c,p=a-c,m=4*(r+1)*c*(36*Math.sin(Math.PI/72)-2),A=2*l+4*r*c+m;if(A>o+0.00000001)return null;let g=_+(o-A)/(2*r);if(g>p+0.00000001)return null;return u(Math.min(g,p))}function fXr(e,t,n,o,r,i){return UCn(e,t,0,n,o,r,i)?.[0]??null}function yXr(e,t,n,o,r,i){let s=Gn(e,t),a=s/o;if(s<=0||n<=0||o<1)return null;let c=(t.x-e.x)/s,l=(t.y-e.y)/s,h=a*a/(2*Math.PI*Math.PI*i),d=Math.max(48,Math.ceil(a/Math.max(0.005,i/6))),u=[],_=[];for(let f=0;f<o;f++)for(let y=0;y<d;y++)u.push(a*(f+y/d)),_.push(1-Math.cos(2*Math.PI*y/d));let p=(f)=>{let y=[];for(let x=0;x<u.length;x++){let C=u[x],b=r*f*_[x]/2;y.push({x:e.x+c*C-l*b,y:e.y+l*C+c*b})}return y.push(t),y},m=(f)=>{let y=0,x=0,C=0;for(let b=0;b<u.length;b++){let I=u[b],v=r*f*_[b]/2,P=e.x+c*I-l*v,M=e.y+l*I+c*v;if(b>0){let B=x-P,T=C-M;y+=Math.sqrt(B*B+T*T)}x=P,C=M}if(u.length){let b=x-t.x,I=C-t.y;y+=Math.sqrt(b*b+I*I)}return y},A=0,g=Math.min(h,n+s);if(m(g)-s<n)return null;for(let f=0;f<40;f++){let y=(A+g)/2;if(m(y)-s<n)A=y;else g=y}return p((A+g)/2)}function xXr(e,t,n,o,r,i,s){let a=Gn(e,t),c=a/r;if(a<=0||o<=0)return null;let l=(t.x-e.x)/a,h=(t.y-e.y)/a,d=c*c/(2*Math.PI*Math.PI*(s+n/2)),u=Math.max(64,Math.ceil(c/Math.max(0.005,s/6))),_=[],p=[],m=[];for(let x=0;x<=u*r;x++){let C=2*Math.PI*x/u;_.push(x*a/(u*r)),p.push(1-Math.cos(C)),m.push(Math.sin(C))}let A=(x)=>{let C=[[],[]];for(let b=0;b<_.length;b++){let I=_[b],v=i*x*p[b]/2,P=i*x*Math.PI/c*m[b],M=Math.hypot(1,P);for(let B=0;B<2;B++){let T=(B===0?1:-1)*n/2,N=I-T*P/M,D=v+T/M;C[B].push({x:e.x+l*N-h*D,y:e.y+h*N+l*D})}}return C},g=(x)=>{let C=[0,0],b=[0,0],I=[0,0];for(let v=0;v<_.length;v++){let P=_[v],M=i*x*p[v]/2,B=i*x*Math.PI/c*m[v],T=Math.hypot(1,B);for(let N=0;N<2;N++){let D=(N===0?1:-1)*n/2,L=P-D*B/T,H=M+D/T,V=e.x+l*L-h*H,O=e.y+h*L+l*H;if(v>0){let U=b[N]-V,j=I[N]-O;C[N]+=Math.sqrt(U*U+j*j)}b[N]=V,I[N]=O}}return Math.min(C[0]-a,C[1]-a)},f=0,y=Math.min(d,o+a);if(g(y)<o)return null;for(let x=0;x<40;x++){let C=(f+y)/2;if(g(C)<o)f=C;else y=C}return A((f+y)/2)}function WCn(e,t,n,o,r,i,s){let a=Gn(e,t),c=a/r,l=s+n/2;if(o<=0||r<1||c<4*l)return null;let h=(t.x-e.x)/a,d=(t.y-e.y)/a,u=Math.max(18,Math.ceil(Math.PI*l/(2*Math.max(0.005,s/6)))),_=n===0?1:2,p=[];for(let C=0;C<r;C++)for(let[b,I,v,P]of[[0,0,-Math.PI/2,0],[2*l,1,Math.PI,Math.PI/2],[c-2*l,1,Math.PI/2,0],[c,0,Math.PI,Math.PI*1.5]])for(let M=0;M<=u;M++){let B=v+(P-v)*M/u,T=Math.sign(P-v),N=C*c+b+l*Math.cos(B),D=-Math.sin(B)*T,L=i*Math.cos(B)*T;for(let H=0;H<_;H++){let V=(H===0?1:-1)*n/2;p.push({px:N-L*V,sin:l*Math.sin(B),offsetY:D*V,raised:!!I,rail:H})}}let m=(C)=>{let b=[[],[]];for(let I of p){let v=I.raised?C-l:l,P=i*(v+I.sin)+I.offsetY,M={x:e.x+h*I.px-d*P,y:e.y+d*I.px+h*P},B=b[I.rail];if(!B.length||Gn(B.at(-1),M)>0.0000000001)B.push(M)}if(_===1)b[1]=b[0];return b},A=[p.filter((C)=>C.rail===0),p.filter((C)=>C.rail===1)],g=(C)=>{let b=1/0;for(let I=0;I<_;I++){let v=0,P=0,M=0,B=!0;for(let T of A[I]){let N=T.raised?C-l:l,D=i*(N+T.sin)+T.offsetY,L=e.x+h*T.px-d*D,H=e.y+d*T.px+h*D,V=v-L,O=P-H,U=Math.sqrt(V*V+O*O);if(B||U>0.0000000001){if(!B)M+=U;v=L,P=H,B=!1}}b=Math.min(b,M-a)}return b},f=2*l,y=g(f);if(y>o+0.00000001)return null;let x=f+Math.max(0,o-y)/(2*r);return x=Math.max(f,x+(o-g(x))/(2*r)),m(x)}function CXr(e,t,n,o,r,i){return WCn(e,t,0,n,o,r,i)?.[0]??null}var bXr=class extends Error{constructor(e,t){super(`Insufficient tuning clearance for ${t.join(", ")}`);this.traces=e,this.unfinished=t}traces;unfinished};function fZ(e,t,n,o={}){let r=0,i=!1,s=fa(e);function*a(p,m,A=1){let g=e.connections.find((L)=>L.name===p.connection_name),f=p.coupledSection?(L)=>!0:e0e(e,p),y=p.route[0].width,x=C2(e,g.name),C=br(p.route)+x,b=(n.get(g.name)-C)*A;if(b<0.00000001){yield p;return}let I=e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075,v=e.differentialPairs?.find((L)=>L.connectionNames.includes(p.connection_name)),P=v&&o.packageOnlyPairTuning?EG(e,y+(v.traceGap??I)/2+I):[],M=y+I,B=4*Math.max(y*1.2,I),T=p.route.slice(1).map((L,H)=>{let V=p.route[H],O=Gn(V,L),U={x:(V.x+L.x)/2,y:(V.y+L.y)/2},j=O>0.00000001?{x:-(L.y-V.y)/O,y:(L.x-V.x)/O}:{x:0,y:0},Y=2*Math.max(y*1.2,I),X=[-1,1].filter((K)=>m.visible(U,{x:U.x+K*j.x*Y,y:U.y+K*j.y*Y})).length;return{i:H,span:O,openSides:X}}).sort((L,H)=>H.openSides-L.openSides||H.span-L.span),N=i,D=0;for(let L of N?[!1]:[!1,!0])for(let{i:H}of T){if(p.curvedSegments?.includes(H+1))continue;if(p.coupledSection&&H>=p.coupledSection[0]&&H<p.coupledSection[1])continue;let V=p.route[H],O=p.route[H+1],U=Gn(V,O);if(U<0.01)continue;let j=(O.x-V.x)/U,Y=(O.y-V.y)/U,X=Math.floor(U*0.9/B),K=Math.min(X,o.packMeanders?X:Math.max(2,Math.ceil(b/(12*y)))),J=Array.from({length:X},(se,ne)=>ne+1).sort((se,ne)=>Math.abs(se-K)-Math.abs(ne-K)||ne-se);function*ee(){if(N){for(let se of[1,2,3])for(let ne of[0.9,0.65,0.4])for(let re of[0.5,0,1])yield{teeth:se,fraction:ne,position:re};return}for(let se of J)if(!L)for(let ne of[0.9,0.65,0.4])for(let re of[0.5,0,1])yield{teeth:se,fraction:ne,position:0.05+0.9*re};else{for(let ne of[0.9,0.65,0.4])for(let re of[0,1])yield{teeth:se,fraction:ne,position:re};for(let ne of[0.25,0.15,0.1])for(let re of[0.5,0.05,0.95,0,1])yield{teeth:se,fraction:ne,position:re}}}for(let{teeth:se,fraction:ne,position:re}of ee()){let Z=U*ne/se;if(!N&&Z<B)continue;for(let te of[1,-1])for(let ie of N?[fXr]:[CXr,yXr]){let le=U*(1-ne)*re,ue={x:V.x+j*le,y:V.y+Y*le},de={x:ue.x+j*U*ne,y:ue.y+Y*U*ne};if(N){if(++D>Math.min(1024,o.maxCandidates??1024))return}if(!N&&++r>(o.maxCandidates??1/0)){if(o.packMeanders)return;throw Error("Smooth tuning candidate budget exhausted")}let me=ie(ue,de,b,se,te,Math.max(y*1.2,I));if(!me||P.length&&!P.some((Re)=>me.every((we)=>_x(we,Re.copper))))continue;let Ae=[V,...me,O];if(!m.pathVisible(Ae))continue;let xe=(p.coupledSection?(Re)=>Re:T1)([...p.route.slice(0,H),...Ae,...p.route.slice(H+2)]);if(Math.abs(br(xe)+x-(C+b))>0.000001)continue;if(!f(xe)||!ml(xe,M))continue;let Me={...p,coupledSection:p.coupledSection?p.coupledSection.map((Re)=>Re>H?Re+xe.length-p.route.length:Re):void 0,curvedSegments:xe.slice(1).flatMap((Re,we)=>{let _e=Math.abs(Re.x-xe[we].x),ye=Math.abs(Re.y-xe[we].y);return Math.min(_e,ye)>0.00000001&&Math.abs(_e-ye)>0.00000001?[we+1]:[]}),route:xe.map((Re)=>({...Re,route_type:"wire",layer:g.pointsToConnect[0].layer,width:y}))};if(aG([Me]))yield Me}}}}let c=[...t],l=t.map((p)=>n.get(p.connection_name)-br(p.route)-C2(e,p.connection_name)),h=new Set(t.map((p,m)=>m).sort((p,m)=>{let A=o.priorityConnectionNames??[],g=(f)=>{let y=A.indexOf(t[f].connection_name);return y<0?1/0:y};return g(p)-g(m)||l[m]-l[p]})),d=new Map,u=!1,_=!0;while(h.size&&_){_=!1;for(let p of h){let m=e.connections.find((f)=>f.name===t[p].connection_name),A=new Di(e,m,c[p].route[0].width,[...s,...c.flatMap(oi)]),g=a(c[p],A).next().value;if(!g&&u&&(d.get(p)??0)<8){for(let f of[0.5,0.25])if(g=a(c[p],A,f).next().value,g){d.set(p,(d.get(p)??0)+1);break}}if(!g)continue;if(c[p]=g,br(g.route)+C2(e,m.name)>=n.get(m.name)-0.00000001)h.delete(p);_=!0}if(!_&&!u)u=!0,_=!0;else if(!_&&!i&&o.packMeanders){i=!0,u=!1;for(let p of h)c[p]=t[p];d.clear(),_=!0}}if(h.size)throw new bXr(c,[...h].map((p)=>t[p].connection_name));return c}function IXr(e){if(e.length!==2||e.some((a)=>!a.coupledSection))return e;let t=e.map((a)=>a.coupledSection[1]),n=e.map((a,c)=>a.route[t[c]]),o=e.map((a,c)=>{let l=a.route[t[c]-1],h=n[c],d=Gn(l,h);return{x:(h.x-l.x)/d,y:(h.y-l.y)/d}});if(Gn(o[0],o[1])>0.0000001)return e;let r=o[0],i=e.map((a,c)=>{let l=0;for(let h=t[c]+1;h<a.route.length;h++){let d=a.route[h],u=d.x-n[c].x,_=d.y-n[c].y,p=u*r.x+_*r.y;if(Math.abs(u*r.y-_*r.x)>0.00000001||p<l)break;l=p}return l}),s=Math.min(...i);if(s<0.00000001)return e;return e.map((a,c)=>{let l={...n[c],x:n[c].x+r.x*s,y:n[c].y+r.y*s},h=t[c]+1;while(h<a.route.length){let d=a.route[h].x-n[c].x,u=a.route[h].y-n[c].y;if(Math.abs(d*r.y-u*r.x)>0.00000001||d*r.x+u*r.y>s+0.00000001)break;h++}return{...a,curvedSegments:a.curvedSegments?.filter((d)=>d<=t[c]||d>=h).map((d)=>d>=h?d-(h-t[c]-1):d),route:[...a.route.slice(0,t[c]),l,...a.route.slice(h)]}})}var Zfn=new WeakMap;function vXr(e,t){let n=JSON.stringify([e,t]),o=Zfn.get(e);if(!o||o.scene!==n)o={scene:n,alternatives:new Map},Zfn.set(e,o);return{get(r){let i=o.alternatives.get(r);return i?structuredClone(i):void 0},set(r,i){if(o.alternatives.size>=512)o.alternatives.delete(o.alternatives.keys().next().value);o.alternatives.set(r,structuredClone(i))}}}var SXr=class{entries=[];sequence=0;get length(){return this.entries.length}values(){return this.entries.map((e)=>e.value)}before(e,t){return e.value.f<t.value.f||e.value.f===t.value.f&&e.sequence<t.sequence}push(e){let t={value:e,sequence:this.sequence++},n=this.entries.length;this.entries.push(t);while(n>0){let o=n-1>>1;if(!this.before(t,this.entries[o]))break;this.entries[n]=this.entries[o],n=o}this.entries[n]=t}pop(){let e=this.entries[0],t=this.entries.pop();if(this.entries.length){let n=0;while(n*2+1<this.entries.length){let o=n*2+1;if(o+1<this.entries.length&&this.before(this.entries[o+1],this.entries[o]))o++;if(!this.before(this.entries[o],t))break;this.entries[n]=this.entries[o],n=o}this.entries[n]=t}return e.value}};function qk(e,t){let n=t.x-e.x,o=t.y-e.y,r=Math.sign(n),i=Math.sign(o),s=Math.min(Math.abs(n),Math.abs(o));if(Math.min(Math.abs(n),Math.abs(o))<0.0000000001||Math.abs(Math.abs(n)-Math.abs(o))<0.0000000001)return[[e,t]];let a=(Math.max(Math.abs(n),Math.abs(o))-s)/2;return[Math.abs(n)>Math.abs(o)?[e,{x:e.x+r*a,y:e.y},{x:t.x-r*a,y:t.y},t]:[e,{x:e.x,y:e.y+i*a},{x:t.x,y:t.y-i*a},t],[e,{x:e.x+r*s,y:e.y+i*s},t],[e,{x:t.x-r*s,y:t.y-i*s},t],[e,{x:e.x,y:t.y},t],[e,{x:t.x,y:e.y},t]]}var Sde=class{constructor(e,t,n){this.scene=e,this.start=t,this.end=n,this.vertices=[t,n],this.open.push({id:0,g:0,f:Gn(t,n)}),this.best.set(0,0)}scene;start;end;vertices;open=new SXr;best=new Map;expanded=0;failed=!1;solved=!1;result=[];geometryLoaded=!1;current;visibleEdges=[];step(){if(!this.geometryLoaded){this.geometryLoaded=!0;let n=Math.max(Math.abs(this.end.x-this.start.x),Math.abs(this.end.y-this.start.y))+(Math.SQRT2-1)*Math.min(Math.abs(this.end.x-this.start.x),Math.abs(this.end.y-this.start.y));for(let o of qk(this.start,this.end)){if(br(o)>n+0.000000001||!this.scene.pathVisible(o))continue;this.visibleEdges=[o],this.result=T1(o),this.solved=!0,this.expanded=1;return}this.vertices.push(...this.scene.vertices())}if(!this.open.length){this.failed=!0;return}let e=this.open.pop();if(e.g>(this.best.get(e.id)??1/0)+0.000000001)return;if(this.current=e,this.expanded++,this.visibleEdges=[],e.id===1){let n=[];for(let o=e;o?.parent;o=o.parent)n.push(o.edge);this.result=T1([this.start,...n.reverse().flatMap((o)=>o.slice(1))]),this.solved=!0;return}let t=this.vertices[e.id];for(let n=1;n<this.vertices.length;n++){if(n===e.id)continue;let o=this.vertices[n];if(e.g+Gn(t,o)>=(this.best.get(n)??1/0)-0.000000001)continue;let i=qk(t,o).sort((s,a)=>br(s)-br(a));for(let s of i){let a=e.g+br(s);if(a>=(this.best.get(n)??1/0)-0.000000001)continue;if(!this.scene.pathVisible(s))continue;if(this.best.set(n,a),this.open.push({id:n,g:a,f:a+Gn(o,this.end),parent:e,edge:s}),this.visibleEdges.length<100)this.visibleEdges.push(s);break}}}currentPath(){let e=[];for(let t=this.current;t?.parent;t=t.parent)e.push(t.edge);return[this.start,...e.reverse().flatMap((t)=>t.slice(1))]}};function b2(e,t){let n=T1(e);for(let o=0;o<12;o++){let r=!1;for(let i=0;i<n.length-2;i++)for(let s=n.length-1;s>i+1;s--){let a=br(n.slice(i,s+1)),c=qk(n[i],n[s]).sort((h,d)=>br(h)-br(d)||h.length-d.length),l=!1;for(let h of c){if(br(h)>a+0.00000001||h.length>=s-i+1&&br(h)>=a-0.00000001||!t.pathVisible(h))continue;let d=T1([...n.slice(0,i),...h,...n.slice(s+1)]),u=t.width/2+t.margin;if(!ml(d,u)&&ml(n,u))continue;n=d,r=!0,l=!0;break}if(l)break}if(!r)break}return ml(n,t.width/2+t.margin)?n:e}var PXr=class{labels=new Map;heap=[];sequence=0;get length(){return this.heap.length}clear(){this.labels.clear(),this.heap.length=0,this.sequence=0}dominated(e,t,n){return this.labels.get(e)?.some((o)=>o.cost<=t+0.0000000001&&o.travelled<=n+0.0000000001)??!1}add(e,t,n,o,r,i){if(this.dominated(e,t,n))return;let a=(this.labels.get(e)??[]).filter((h)=>{if(t<=h.cost+0.0000000001&&n<=h.travelled+0.0000000001)return h.active=!1,!1;return!0}),c={node:e,cost:t,travelled:n,priority:t+o,sequence:this.sequence++,parent:r,rootPath:i,active:!0};a.push(c),this.labels.set(e,a);let l=this.heap.length;this.heap.push(c);while(l>0){let h=l-1>>1;if(!this.before(c,this.heap[h]))break;this.heap[l]=this.heap[h],l=h}this.heap[l]=c}before(e,t){return e.priority<t.priority||e.priority===t.priority&&(e.cost>t.cost||e.cost===t.cost&&e.sequence<t.sequence)}pop(){while(this.heap.length){let e=this.heap[0],t=this.heap.pop();if(this.heap.length){let n=0;while(2*n+1<this.heap.length){let o=2*n+1;if(o+1<this.heap.length&&this.before(this.heap[o+1],this.heap[o]))o++;if(!this.before(this.heap[o],t))break;this.heap[n]=this.heap[o],n=o}this.heap[n]=t}if(e.active)return e}}},e2n=class{constructor(e,t){this.width=t;let n=[0],o=[0],r=[0],i=[1],s=(l)=>{while(r[l]!==l)r[l]=r[r[l]],l=r[l];return l},a=1,c=1;for(let l=0;l<e.length;l+=t){let h=Math.min(l+t,e.length),d=r.length,u=e.subarray(l,h),_=l,p=a;while(_<h){let m=u.indexOf(0,_-l);if(m<0)break;let A=l+m,g=u.indexOf(1,m),f=g<0?h:l+g,y=r.length;n.push(A),o.push(f),r.push(y);while(p<c&&o[p]+t<A)p++;for(let x=p;x<c&&n[x]+t<=f;x++){let C=s(y),b=s(x);if(C!==b)r[Math.max(C,b)]=Math.min(C,b)}_=f}a=d,c=r.length,i.push(c)}this.starts=Uint32Array.from(n),this.ends=Uint32Array.from(o),this.roots=Uint32Array.from(r.map((l,h)=>s(h))),this.rows=Uint32Array.from(i)}width;starts;ends;roots;rows;get storageBytes(){return this.starts.byteLength+this.ends.byteLength+this.roots.byteLength+this.rows.byteLength}at(e){let t=Math.floor(e/this.width),n=this.rows[t],o=this.rows[t+1];while(n<o){let r=n+o>>>1;if(e<this.starts[r])o=r;else if(e>=this.ends[r])n=r+1;else return this.roots[r]}return 0}},EXr=class{ids=new Int32Array(1024);costs=new Float64Array(1024);priorities=new Float64Array(1024);sequences=new Float64Array(1024);size=0;positions;constructor(e){this.positions=new Int32Array(e)}sequence=0;id=0;g=0;get length(){return this.size}get storageBytes(){return this.positions.byteLength+this.ids.byteLength+this.costs.byteLength+this.priorities.byteLength+this.sequences.byteLength}clear(){for(let e=0;e<this.size;e++)this.positions[this.ids[e]]=0;this.size=0,this.sequence=0,this.id=0,this.g=0}push(e,t,n){let o=this.sequence++,r=this.positions[e];if(r&&(n>this.priorities[r-1]||n===this.priorities[r-1]&&t<=this.costs[r-1])){this.sink(r-1,e,t,n,o);return}let i=r?r-1:this.size++;if(i===this.ids.length){let d=new Int32Array(i*2),u=new Float64Array(i*2),_=new Float64Array(i*2),p=new Float64Array(i*2);d.set(this.ids),u.set(this.costs),_.set(this.priorities),p.set(this.sequences),this.ids=d,this.costs=u,this.priorities=_,this.sequences=p}let{ids:s,positions:a,costs:c,priorities:l,sequences:h}=this;while(i>0){let d=i-1>>2,u=l[d];if(n>u||n===u&&(t<c[d]||t===c[d]&&o>=h[d]))break;s[i]=s[d],a[s[i]]=i+1,c[i]=c[d],l[i]=u,h[i]=h[d],i=d}s[i]=e,a[e]=i+1,c[i]=t,l[i]=n,h[i]=o}pop(){let{ids:e,positions:t,costs:n,priorities:o,sequences:r}=this;this.id=e[0],this.g=n[0],t[this.id]=0;let i=--this.size,s=e[i],a=n[i],c=o[i],l=r[i];if(!i)return;this.sink(0,s,a,c,l)}sink(e,t,n,o,r){let i=this.size,s=e,{ids:a,costs:c,priorities:l,sequences:h,positions:d}=this;while(e*4+1<i){let u=e*4+1,_=l[u],p=c[u],m=h[u],A=Math.min(u+4,i);for(let g=u+1;g<A;g++){let f=l[g];if(f<_||f===_&&(c[g]>p||c[g]===p&&h[g]<m))u=g,_=f,p=c[g],m=h[g]}a[e]=a[u],d[a[e]]=e+1,c[e]=p,l[e]=_,h[e]=m,e=u}while(e>s){let u=e-1>>2,_=l[u];if(o>_||o===_&&(n<c[u]||n===c[u]&&r>=h[u]))break;a[e]=a[u],d[a[e]]=e+1,c[e]=c[u],l[e]=_,h[e]=h[u],e=u}a[e]=t,d[t]=e+1,c[e]=n,l[e]=o,h[e]=r}},t2n=67108864,n2n=new WeakMap;function MXr(e){return e.best.byteLength+e.parent.byteLength+(e.travel?.byteLength??0)+e.heap.storageBytes}var wXr=class{available=new Map;retained=new Map;bytes=0;acquire(e,t){let n=this.available.get(e),o=n?.pop()??{cellCount:e,best:new Float64Array(e),parent:new Int32Array(e),heap:new EXr(e)};if(n&&!n.length)this.available.delete(e);let r=this.retained.get(o);if(r!==void 0)this.bytes-=r,this.retained.delete(o);if(o.best.fill(1/0),t&&!o.travel)o.travel=new Float64Array(e);let i=!0;return{scratch:o,release:()=>{if(!i)return;i=!1,this.retain(o)}}}retain(e){e.heap.clear();let t=MXr(e);if(t>t2n)return;while(this.bytes+t>t2n){let o=this.retained.keys().next().value;this.bytes-=this.retained.get(o),this.retained.delete(o);let r=this.available.get(o.cellCount);if(r.splice(r.indexOf(o),1),!r.length)this.available.delete(o.cellCount)}let n=this.available.get(e.cellCount)??[];n.push(e),this.available.set(e.cellCount,n),this.retained.set(e,t),this.bytes+=t}};function BXr(e,t,n){let o=n2n.get(e);if(!o)n2n.set(e,o=new wXr);return o.acquire(t,n)}var o2n=class{dense;sparse;storageBytes;minX;minY;maxX;maxY;width;constructor(e){this.minX=Math.floor(e.minX),this.minY=Math.floor(e.minY),this.maxX=Math.ceil(e.maxX)+1,this.maxY=Math.ceil(e.maxY)+1,this.width=this.maxX-this.minX+1;let t=this.width*(this.maxY-this.minY+1);if(t<=65536)this.dense=Array(t),this.storageBytes=t*8;else this.sparse=new Map,this.storageBytes=0}add(e,t,n){if(e<this.minX||e>this.maxX||t<this.minY||t>this.maxY)return;let o=e-this.minX+(t-this.minY)*this.width,r=this.dense?this.dense[o]:this.sparse.get(o);if(!r)if(r=[],this.dense)this.dense[o]=r;else this.sparse.set(o,r);if(r[r.length-1]!==n)r.push(n)}addCopper(e,t){let n=e.copper,o=(l,h,d,u)=>{for(let _=Math.floor(l);_<=Math.floor(h);_++)for(let p=Math.floor(d);p<=Math.floor(u);p++)this.add(_,p,e)};if(n.rect){o(e.minX,e.maxX,e.minY,e.maxY);return}let r=n.b.x-n.a.x,i=n.b.y-n.a.y,s=Math.max(1,Math.ceil(Math.max(Math.abs(r),Math.abs(i)))),a=n.radius+t+Math.abs(r)/(2*s)+0.000000001,c=n.radius+t+Math.abs(i)/(2*s)+0.000000001;for(let l=0;l<=s;l++){let h=n.a.x+r*l/s,d=n.a.y+i*l/s;o(h-a,h+a,d-c,d+c)}}get(e,t){if(e<this.minX||e>this.maxX||t<this.minY||t>this.maxY)return;let n=e-this.minX+(t-this.minY)*this.width;return this.dense?this.dense[n]:this.sparse.get(n)}*values(){if(this.dense){for(let e of this.dense)if(e)yield e}else yield*this.sparse.values()}},r2n=new WeakMap,hot=16777216,i2n=new Uint8Array(0),s2n=new WeakMap,dot=67108864;function a2n(e,t){let n=e.rect??{minX:Math.min(e.a.x,e.b.x)-e.radius,maxX:Math.max(e.a.x,e.b.x)+e.radius,minY:Math.min(e.a.y,e.b.y)-e.radius,maxY:Math.max(e.a.y,e.b.y)+e.radius};return{...gXr({...e,a:{...e.a},b:{...e.b},rect:e.rect?{...e.rect}:void 0}),minX:n.minX-t,maxX:n.maxX+t,minY:n.minY-t,maxY:n.maxY+t}}function TXr(e,t){let n=e.input,o=n.bounds,r=e.connection.pointsToConnect[0].layer,i=fa(n).filter((m)=>m.layer===r),s=n.connections.flatMap((m)=>m.pointsToConnect);for(let m of i)if(m.rect)s.push({x:m.rect.minX,y:m.rect.minY,layer:r},{x:m.rect.maxX,y:m.rect.maxY,layer:r});else s.push({x:Math.min(m.a.x,m.b.x)-m.radius,y:Math.min(m.a.y,m.b.y)-m.radius,layer:r},{x:Math.max(m.a.x,m.b.x)+m.radius,y:Math.max(m.a.y,m.b.y)+m.radius,layer:r});let a=Math.min(...s.map((m)=>m.x)),c=Math.max(...s.map((m)=>m.x)),l=Math.min(...s.map((m)=>m.y)),h=Math.max(...s.map((m)=>m.y)),d=n.minTraceWidth+(n.minTraceToPadEdgeClearance??n.defaultObstacleMargin??0.075),u=Math.max(2,n.connections.length*d,Math.min(c-a,h-l)/2),_=(m,A)=>A+Math.floor((m-A)/t)*t,p=(m,A)=>A+Math.ceil((m-A)/t)*t;return{minX:Math.max(o.minX,_(a-u,o.minX)),maxX:Math.min(o.maxX,p(c+u,o.minX)),minY:Math.max(o.minY,_(l-u,o.minY)),maxY:Math.min(o.maxY,p(h+u,o.minY))}}var dat=class{constructor(e,t){this.scene=e,this.packageGrid=e.input.obstacles.some((o)=>o.componentId),this.stepSize=Math.max(0.01,t?.step??e.input.minTraceWidth/(this.packageGrid?2:1));let n=t?.bounds??(this.packageGrid?TXr(e,this.stepSize):e.input.bounds);if(this.gridBounds=n,this.origin={x:n.minX,y:n.minY},this.nx=Math.ceil((n.maxX-n.minX)/this.stepSize)+1,this.ny=Math.ceil((n.maxY-n.minY)/this.stepSize)+1,this.xs=Float64Array.from({length:this.nx},(o,r)=>this.origin.x+r*this.stepSize),this.ys=Float64Array.from({length:this.ny},(o,r)=>this.origin.y+r*this.stepSize),this.cellCount>8000000)throw Error("Dense grid search budget exceeded")}scene;packageGrid;gridBounds;nx;ny;stepSize;origin;xs;ys;get cellCount(){return this.nx*this.ny}penalizeIntersection(e,t,n,o,r,i,s=!1){let a=new Set,c=new Set;for(let[l,h]of[[t,n],[o,r]]){let d=s?new Set:c,u=Math.max(1,Math.ceil(Gn(l,h)/this.stepSize));for(let _=0;_<=u;_++){let p={x:l.x+(h.x-l.x)*_/u,y:l.y+(h.y-l.y)*_/u},m=Math.round((p.x-this.origin.x)/this.stepSize),A=Math.round((p.y-this.origin.y)/this.stepSize),g=Math.ceil(i/this.stepSize);for(let f=-g;f<=g;f++)for(let y=-g;y<=g;y++){if(m+y<0||m+y>=this.nx||A+f<0||A+f>=this.ny)continue;let x=m+y+(A+f)*this.nx;if(a.has(x)||d.has(x))continue;d.add(x);let C=this.point(x);if(sT([C,C],[l,h])>i)continue;if(!s&&(sT([C,C],[t,n])>i||sT([C,C],[o,r])>i))continue;a.add(x)}}}for(let l of a)e[l]+=s?0.3:1}point(e){return{x:this.xs[e%this.nx],y:this.ys[Math.floor(e/this.nx)]}}},Tl=class extends dat{constructor(e,t,n,o=[],r=4,i,s){super(e,s);this.start=t,this.end=n,this.penalty=r,this.history=i;let a=this.gridBounds;this.softMargin=e.margin,this.hasSoftCopper=o.some((I)=>I.layer===e.connection.pointsToConnect[0].layer),this.copperBuckets=new o2n(a),this.neighbors=[];for(let I=-1;I<=1;I++)for(let v=-1;v<=1;v++){if(!(v||I))continue;let P=(I+1)*3+v+1,M=P>4?P-1:P;this.neighbors.push({dx:v,dy:I,offset:v+I*this.nx,cost:v&&I?Math.SQRT2:1,bit:1<<M,reverse:1<<7-M})}let c=s?.ends??[n];this.goalBounds={minX:Math.min(...c.map((I)=>I.x)),maxX:Math.max(...c.map((I)=>I.x)),minY:Math.min(...c.map((I)=>I.y)),maxY:Math.max(...c.map((I)=>I.y))},this.hx=this.xs.map((I)=>Math.max(this.goalBounds.minX-I,I-this.goalBounds.maxX,0)/this.stepSize),this.hy=this.ys.map((I)=>Math.max(this.goalBounds.minY-I,I-this.goalBounds.maxY,0)/this.stepSize);let l=this.nx*this.ny,h=s2n.get(e.input)??new Map;s2n.set(e.input,h);let d=JSON.stringify([a.minX,a.minY,a.maxX,a.maxY,this.nx,this.ny,this.stepSize,e.margin,e.width,e.input.minBoardEdgeClearance,e.input.bounds,e.copper.map((I)=>[I.a.x,I.a.y,I.b.x,I.b.y,I.radius,I.rect])]),u=h.get(d),_=u?.attachments??new Map;if(u)h.delete(d),h.set(d,u);if(this.blocked=u?.blocked??new Uint8Array(l),this.hardEdgeKnown=u?.edgeKnown??new Uint8Array(l),this.hardEdgeBlocked=u?.edgeBlocked??new Uint8Array(l),u)this.copperBuckets=u.buckets;if(this.maxLength=s?.maxLength??1/0,s?.paretoLength&&Number.isFinite(this.maxLength))this.lengthFrontier=new PXr;let p=u?.components;if(!u){let I=new Uint32Array(l),v=0,P=(B,T,N,D,L)=>{let H=L.copper,V=Math.max(0,Math.floor((B-a.minX)/this.stepSize)),O=Math.min(this.nx-1,Math.ceil((T-a.minX)/this.stepSize)),U=Math.max(0,Math.floor((N-a.minY)/this.stepSize)),j=Math.min(this.ny-1,Math.ceil((D-a.minY)/this.stepSize)),Y=!H.rect&&H.a.x===H.b.x&&H.a.y===H.b.y,X=e.margin-0.00000001;for(let K=U;K<=j;K++){let J=this.ys[K],ee=J-H.a.y,se=K*this.nx;for(let ne=V;ne<=O;ne++){let re=ne+se;if(this.blocked[re]||I[re]===v)continue;if(I[re]=v,Y){let Z=this.xs[ne]-H.a.x;if(Math.sqrt(Z*Z+ee*ee)-H.radius<X)this.blocked[re]=1}else if(Jfn(this.xs[ne],J,this.xs[ne],J,0,0,0,L,X))this.blocked[re]=1}}};for(let B of e.copper){v++;let T=a2n(B,e.margin),N=e.margin+B.radius;if(this.copperBuckets.addCopper(T,e.margin),B.rect){let H=B.rect;P(H.minX-N,H.maxX+N,H.minY-N,H.maxY+N,T);continue}let D=Gn(B.a,B.b),L=Math.max(1,Math.ceil(D/this.stepSize));for(let H=0;H<=L;H++){let V={x:B.a.x+(B.b.x-B.a.x)*H/L,y:B.a.y+(B.b.y-B.a.y)*H/L};P(V.x-N,V.x+N,V.y-N,V.y+N,T)}}p=s?.checkReachability?new e2n(this.blocked,this.nx):void 0;let M=(p?.storageBytes??0)+l*3+this.copperBuckets.storageBytes+d.length*2+[...this.copperBuckets.values()].reduce((B,T)=>B+T.length*8+64,0)+e.copper.length*136;if(M<=dot){let B=[...h.values()].reduce((T,N)=>T+N.bytes,0);while(B+M>dot&&h.size){let T=h.keys().next().value;B-=h.get(T).bytes,h.delete(T)}u={attachments:_,blocked:this.blocked,edgeKnown:this.hardEdgeKnown,edgeBlocked:this.hardEdgeBlocked,buckets:this.copperBuckets,bytes:M,components:p},h.set(d,u)}}if(s?.checkReachability&&!p){if(p=new e2n(this.blocked,this.nx),u){u.components=p,u.bytes+=p.storageBytes;let I=[...h.values()].reduce((v,P)=>v+P.bytes,0);while(I>dot&&h.size){let v=h.keys().next().value;I-=h.get(v).bytes,h.delete(v)}}}if(this.hasSoftCopper){this.softBuckets=new o2n(a);let I=JSON.stringify([a.minX,a.minY,a.maxX,a.maxY,this.nx,this.ny,this.stepSize,this.softMargin,e.connection.pointsToConnect[0].layer]),v=r2n.get(e.input)??new Map;r2n.set(e.input,v);let P=v.get(I),M=new Map;for(let N of o){if(N.layer!==e.connection.pointsToConnect[0].layer)continue;let D=JSON.stringify([N.a.x,N.a.y,N.b.x,N.b.y,N.radius,N.rect]),L=P?.copper.get(D)??a2n(N,this.softMargin);this.softBuckets.addCopper(L,this.softMargin),M.set(D,L)}let B=l*2+I.length*2+[...M.keys()].reduce((N,D)=>N+D.length*2+136,0),T=P&&!P.lease.active&&B<=hot?P:void 0;if(this.softEdgeKnown=T?.edgeKnown??new Uint8Array(l),this.softEdgeBlocked=T?.edgeBlocked??new Uint8Array(l),T){let N=(L,H,V,O)=>{let U=Math.max(0,Math.floor((L-a.minX)/this.stepSize)),j=Math.min(this.nx-1,Math.ceil((H-a.minX)/this.stepSize)),Y=Math.max(0,Math.floor((V-a.minY)/this.stepSize)),X=Math.min(this.ny-1,Math.ceil((O-a.minY)/this.stepSize));if(j<U)return;for(let K=Y;K<=X;K++){let J=K*this.nx;this.softEdgeKnown.fill(0,J+U,J+j+1),this.softEdgeBlocked.fill(0,J+U,J+j+1)}},D=(L)=>{let H=this.stepSize+0.000000001;if(L.copper.rect){N(L.minX-H,L.maxX+H,L.minY-H,L.maxY+H);return}let V=L.copper.radius+this.softMargin+H,O=Math.max(0,Math.floor((Math.min(L.ay,L.by)-V-a.minY)/this.stepSize)),U=Math.min(this.ny-1,Math.ceil((Math.max(L.ay,L.by)+V-a.minY)/this.stepSize));for(let j=O;j<=U;j++){let Y=0,X=1;if(L.dy===0){if(Math.abs(this.ys[j]-L.ay)>V)continue}else{let re=(this.ys[j]-V-L.ay)/L.dy,Z=(this.ys[j]+V-L.ay)/L.dy;if(Y=Math.max(0,Math.min(re,Z)),X=Math.min(1,Math.max(re,Z)),Y>X)continue}let K=L.ax+L.dx*Y,J=L.ax+L.dx*X,ee=Math.max(0,Math.floor((Math.min(K,J)-V-a.minX)/this.stepSize)),se=Math.min(this.nx-1,Math.ceil((Math.max(K,J)+V-a.minX)/this.stepSize));if(se<ee)continue;let ne=j*this.nx;this.softEdgeKnown.fill(0,ne+ee,ne+se+1),this.softEdgeBlocked.fill(0,ne+ee,ne+se+1)}};for(let[L,H]of T.copper)if(!M.has(L))D(H);for(let[L,H]of M)if(!T.copper.has(L))D(H)}if(B<=hot){if(P)v.delete(I);let N=[...v.values()].reduce((D,L)=>D+L.bytes,0);while(N+B>hot&&v.size){let D=v.keys().next().value;N-=v.get(D).bytes,v.delete(D)}this.softMemoLease={active:!0},v.set(I,{edgeKnown:this.softEdgeKnown,edgeBlocked:this.softEdgeBlocked,copper:M,lease:this.softMemoLease,bytes:B})}}let m=(I)=>{let v=JSON.stringify(I);if(_.has(v))return structuredClone(_.get(v));let P=Math.round((I.x-a.minX)/this.stepSize),M=Math.round((I.y-a.minY)/this.stepSize),B=[];for(let N=-4;N<=4;N++)for(let D=-4;D<=4;D++){if(P+D<0||P+D>=this.nx||M+N<0||M+N>=this.ny)continue;let L=P+D+(M+N)*this.nx;if(this.blocked[L])continue;for(let H of qk(I,this.point(L)))if(e.pathVisible(H)){B.push({id:L,path:H});break}}let T=B.sort((N,D)=>br(N.path)-br(D.path)||N.id-D.id).slice(0,8);if(_.size>=128)_.delete(_.keys().next().value);return _.set(v,structuredClone(T)),T},A=(I)=>{let v=new Map;for(let P of I.sort((M,B)=>br(M.path)-br(B.path)))if(!v.has(P.id))v.set(P.id,P);return[...v.values()]};this.startAttachments=s?.starts?A(s.starts.flatMap((I)=>s.nearestTerminalAttachments?m(I).slice(0,1):m(I))):m(t),this.endAttachments=s?.ends?A(c.flatMap((I)=>s.nearestTerminalAttachments?m(I).slice(0,1):m(I))):m(n);let g=this.startAttachments[0],f=this.endAttachments[0];if(!g||!f){if(this.failed=!0,this.softMemoLease)this.softMemoLease.active=!1;return}let y=p,x=(I,v)=>I.some((P)=>v.some((M)=>y.at(P.id)!==0&&y.at(P.id)===y.at(M.id))),C=!1;if(s?.checkReachability&&!x([g],[f])){if(!x(this.startAttachments,this.endAttachments)){if(this.failed=!0,this.softMemoLease)this.softMemoLease.active=!1;return}C=!0}this.scratchLease=BXr(e.input,l,Number.isFinite(this.maxLength));let b=this.scratchLease.scratch;if(this.heap=b.heap,this.best=b.best,this.parent=b.parent,this.travel=Number.isFinite(this.maxLength)?b.travel:void 0,this.startPath=g.path,this.endPath=f.path.toReversed(),this.goal=f.id,this.best[g.id]=0,this.parent[g.id]=-1,this.travel)this.travel[g.id]=br(g.path);if(this.lengthFrontier)this.lengthFrontier.add(g.id,0,br(g.path),this.heuristic(t),void 0,g.path);else this.heap.push(g.id,0,this.heuristic(t));if(C||s?.allTerminalAttachments||s?.starts||s?.ends)this.retryAttachments()}start;end;penalty;history;expanded=0;failed=!1;solved=!1;result=[];heap;lengthFrontier;scratchLease;neighbors;travel;maxLength=1/0;best;parent;blocked;softMargin;softBuckets;hasSoftCopper;softEdgeKnown=i2n;softMemoLease;softEdgeBlocked=i2n;hardEdgeKnown;hardEdgeBlocked;copperBuckets;goal=-1;startPath=[];endPath=[];startAttachments=[];endAttachments=[];alternateAttachments=!1;rootPaths=new Map;goalPaths=new Map;attachmentResult;goalBounds;hx;hy;retryAttachments(){if(this.alternateAttachments||this.startAttachments.length<=1&&this.endAttachments.length<=1)return!1;this.alternateAttachments=!0,this.heap.clear(),this.lengthFrontier?.clear(),this.best.fill(1/0);for(let e of this.startAttachments){let t=br(e.path);if(t>this.maxLength+0.00000001)continue;let n=t/this.stepSize;if(this.best[e.id]=n,this.parent[e.id]=-1,this.travel)this.travel[e.id]=t;if(this.rootPaths.set(e.id,e.path),this.lengthFrontier)this.lengthFrontier.add(e.id,n,t,this.heuristic(this.point(e.id)),void 0,e.path);else this.heap.push(e.id,n,n+this.heuristic(this.point(e.id)))}for(let e of this.endAttachments)this.goalPaths.set(e.id,e.path.toReversed());return!0}pathTo(e,t,n){if(n){let i=[],s=n;for(let a=n;a;a=a.parent)s=a,i.push(this.point(a.node));return T1([...s.rootPath,...i.reverse().slice(1),...t.slice(1)])}let o=[],r=e;for(let i=e;i>=0;i=this.parent[i])r=i,o.push(this.point(i));return T1([...this.alternateAttachments?this.rootPaths.get(r):this.startPath,...o.reverse().slice(1),...t.slice(1)])}finish(e){if(this.result=e,this.solved=!0,this.softMemoLease)this.softMemoLease.active=!1;this.scratchLease?.release(),this.lengthFrontier?.clear()}edgeClear(e,t,n,o,r,i=this.scene.margin){if(!r)return!0;let s=Math.min(e,n),a=Math.max(e,n),c=Math.min(t,o),l=Math.max(t,o),h=n-e,d=o-t,u=h*h+d*d,_=i-0.00000001,p=Math.floor(a),m=Math.floor(l);for(let A=Math.floor(s);A<=p;A++)for(let g=Math.floor(c);g<=m;g++){let f=r.get(A,g);if(!f)continue;for(let y=0;y<f.length;y++){let x=f[y];if(x.minX>a||x.maxX<s||x.minY>l||x.maxY<c)continue;if(Jfn(e,t,n,o,h,d,u,x,_))return!1}}return!0}heuristic(e){let t=Math.max(this.goalBounds.minX-e.x,e.x-this.goalBounds.maxX,0)/this.stepSize,n=Math.max(this.goalBounds.minY-e.y,e.y-this.goalBounds.maxY,0)/this.stepSize;return Math.max(t,n)+(Math.SQRT2-1)*Math.min(t,n)}cancel(){if(!this.solved)this.failed=!0;if(this.softMemoLease)this.softMemoLease.active=!1;this.scratchLease?.release(),this.lengthFrontier?.clear()}step(){let{heap:e,lengthFrontier:t,best:n,parent:o,blocked:r,nx:i,ny:s,xs:a,ys:c,hx:l,hy:h,history:d,travel:u,stepSize:_,maxLength:p,penalty:m,hasSoftCopper:A,softEdgeKnown:g,softEdgeBlocked:f,hardEdgeKnown:y,hardEdgeBlocked:x,softBuckets:C,copperBuckets:b,softMargin:I}=this,v=this.scene.input.bounds,P=this.scene.width/2+(this.scene.input.minBoardEdgeClearance??0),M=v.minX+P,B=v.maxX-P,T=v.minY+P,N=v.maxY-P;for(let D=0;D<500&&!this.failed&&!this.solved;D++){if(!(t?.length??e.length)){if(this.attachmentResult){this.finish(this.attachmentResult.path);return}if(this.retryAttachments())continue;if(this.failed=!0,this.softMemoLease)this.softMemoLease.active=!1;this.scratchLease?.release(),this.lengthFrontier?.clear();return}let L=t?.pop();if(t&&!L)continue;if(!t)e.pop();let H=L?.node??e.id,V=L?.cost??e.g;if(!t&&V!==n[H])continue;if(this.expanded++,this.attachmentResult&&V+this.heuristic(this.point(H))>=this.attachmentResult.score){this.finish(this.attachmentResult.path);return}let O=this.alternateAttachments?this.goalPaths.get(H):H===this.goal?this.endPath:void 0;if(O){let Y=this.pathTo(H,O,L);if(br(Y)>p+0.00000001||!this.scene.pathVisible(Y)){if(!this.alternateAttachments&&!t){if(this.retryAttachments())continue;if(this.failed=!0,this.softMemoLease)this.softMemoLease.active=!1;this.scratchLease?.release(),this.lengthFrontier?.clear();return}}else if(this.alternateAttachments){let X=V+br(O)/_;if(!this.attachmentResult||X<this.attachmentResult.score)this.attachmentResult={score:X,path:Y}}else{this.finish(Y);return}}let U=H%i,j=Math.floor(H/i);for(let{dx:Y,dy:X,offset:K,cost:J,bit:ee,reverse:se}of this.neighbors){if(U+Y<0||U+Y>=i||j+X<0||j+X>=s)continue;let ne=H+K;if(r[ne])continue;let re=V+J+0+(d?.[ne]??0);if(!t&&m>=0&&re>=n[ne]-0.0000000001)continue;let Z=l[U+Y],te=h[j+X],ie=Math.max(Z,te)+(Math.SQRT2-1)*Math.min(Z,te),le=(L?.travelled??u?.[H]??0)+J*_;if(u&&le+ie*_>p+0.00000001)continue;if(t&&m>=0&&t.dominated(ne,re,le))continue;let ue=a[U+Y],de=c[j+X];if(ue<M||ue>B||de<T||de>N)continue;let me=0;if(A){if(!(g[H]&ee)){if(g[H]|=ee,g[ne]|=se,!this.edgeClear(a[U],c[j],ue,de,C,I))f[H]|=ee,f[ne]|=se}me=f[H]&ee?m:0}let Ae=V+J+me+(d?.[ne]??0);if(t?t.dominated(ne,Ae,le):Ae>=n[ne]-0.0000000001)continue;if(!(y[H]&ee)){if(y[H]|=ee,y[ne]|=se,!this.edgeClear(a[U],c[j],ue,de,b))x[H]|=ee,x[ne]|=se}if(x[H]&ee)continue;if(t)t.add(ne,Ae,le,ie,L);else{if(n[ne]=Ae,u)u[ne]=le;o[ne]=H,e.push(ne,Ae,Ae+ie)}}}}};function hf(e,t){let n=e.slice(1).map((o,r)=>{let i=e[r],s=Gn(i,o);return{x:-(o.y-i.y)/s,y:(o.x-i.x)/s}});return e.map((o,r)=>{let i=n[Math.max(0,r-1)],s=n[Math.min(n.length-1,r)],a=1+i.x*s.x+i.y*s.y;if(a<0.00001)throw Error("Pair centerline reverses direction");return{x:o.x+t*(i.x+s.x)/a,y:o.y+t*(i.y+s.y)/a}})}function*CL(e,t,n,o){let r=t.connectionNames.map((Y)=>e.connections.find((X)=>X.name===Y));if(r.some((Y)=>!Y||Y.pointsToConnect.length!==2))throw Error("Pair requires two two-terminal connections");let i=r.map((Y)=>(e.buses??[]).find((X)=>X.connectionNames.includes(Y.name))?.traceWidth??Y.nominalTraceWidth??Y.width??e.minTraceWidth);if(Math.abs(i[0]-i[1])>0.00000001)throw Error("Coupled pair requires equal trace widths");let s=i[0],a=t.traceGap??e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075,c=r.map((Y)=>C2(e,Y.name)),l=(Y,X)=>{let K=!1;for(let J=0,ee=X.length-1;J<X.length;ee=J++){let se=X[J],ne=X[ee];if(se.y>Y.y!==ne.y>Y.y&&Y.x<(ne.x-se.x)*(Y.y-se.y)/(ne.y-se.y)+se.x)K=!K}return K},h=r[0].pointsToConnect[0].layer;if(r.some((Y)=>Y.pointsToConnect.some((X)=>X.layer!==h)))throw Error("Pair requires a common signal layer");let d=e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075;if(a<d-0.00000001)throw Error("Pair gap is below trace clearance");let u=[0,1].map((Y)=>({x:(r[0].pointsToConnect[Y].x+r[1].pointsToConnect[Y].x)/2,y:(r[0].pointsToConnect[Y].y+r[1].pointsToConnect[Y].y)/2})),_=Math.abs(u[1].y-u[0].y)>=Math.abs(u[1].x-u[0].x),p=_?"y":"x",m=_?"x":"y",A=Math.sign(u[1][p]-u[0][p])||1,g=r.map((Y)=>(e.obstacles??[]).filter((X)=>X.componentId&&X.connectedTo.includes(Y.name))),f=(e.buses??[]).some((Y)=>t.connectionNames.some((X)=>Y.connectionNames.includes(X))),y=u.map((Y,X)=>{let K=g.flat().filter((me)=>Math.abs(me.center[p]-Y[p])<Math.abs(u[1][p]-u[0][p])/2),J=new Set(K.map((me)=>me.componentId)),ee=e.obstacles.filter((me)=>me.componentId&&J.has(me.componentId)),se=X===0?A:-A,ne=ee.length?se>0?Math.max(...ee.map((me)=>me.center[p]+(_?me.height:me.width)/2)):Math.min(...ee.map((me)=>me.center[p]-(_?me.height:me.width)/2)):Y[p],re=2*s+a+d,Z={...Y,[p]:ne+se*re};if(!ee.length)return[Z];let te=Math.min(...ee.map((me)=>me.center.x-me.width/2))-re,ie=Math.max(...ee.map((me)=>me.center.x+me.width/2))+re,le=Math.min(...ee.map((me)=>me.center.y-me.height/2))-re,ue=Math.max(...ee.map((me)=>me.center.y+me.height/2))+re;return[f?Z:X===0?{...Z,[p]:Z[p]+se*Math.max(4*s,Gn(r[0].pointsToConnect[X],r[1].pointsToConnect[X]))}:{...Z,[m]:_?(te+ie)/2:(ue+le)/2},Z,{x:te,y:Y.y},{x:ie,y:Y.y},{x:Y.x,y:le},{x:Y.x,y:ue}]}),x=(e.buses??[]).filter((Y)=>e.connections.some((X)=>Y.connectionNames.includes(X.name)&&X.pointsToConnect[0].layer===h));if(!f&&x.length){let Y=e.obstacles.filter((X)=>X.componentId);if(Y.length){let X=Math.max(...x.map((se)=>se.connectionNames.length))*(s+d),K=(se)=>{let ne=(se.ccwRotationDegrees??0)*Math.PI/180;return(_?Math.abs(Math.cos(ne))*se.width+Math.abs(Math.sin(ne))*se.height:Math.abs(Math.sin(ne))*se.width+Math.abs(Math.cos(ne))*se.height)/2},J=Math.min(...Y.map((se)=>se.center[m]-K(se)))-X-s-a-d,ee=Math.max(...Y.map((se)=>se.center[m]+K(se)))+X+s+a+d;for(let se=0;se<2;se++)y[se].push({...u[se],[m]:J},{...u[se],[m]:ee})}}let C=new Set((e.buses??[]).filter((Y)=>t.connectionNames.some((X)=>Y.connectionNames.includes(X))).flatMap((Y)=>Y.connectionNames)),b=e.connections.filter((Y)=>C.has(Y.name));if(b.length>2&&g.some((Y)=>Y.length)){let Y=b.length*(s+d),X=u[1][m]-u[0][m],K=Math.abs(X)<0.00000001?A:Math.sign(X),J=b.flatMap((se)=>se.pointsToConnect.map((ne)=>ne[m])),ee=(K>0?Math.max(...J):Math.min(...J))+K*(Y+2*s+a+d);for(let se=0;se<2;se++){let ne=y[se][0];if(y[se].unshift({...y[se][0],[p]:y[se][0][p]+(se===0?A:-A)*Y,[m]:ee}),se===0)y[se].unshift({...ne,[p]:ne[p]+A*Y/2})}}for(let Y=0;Y<2;Y++){y[Y]=y[Y].filter((K,J,ee)=>ee.findIndex((se)=>Gn(K,se)<0.00000001)===J);let X=(K)=>2*Gn(K,u[Y])+Gn(K,u[1-Y]);y[Y].sort((K,J)=>X(K)-X(J))}let I=o?.variant??0,v=I%y[0].length,P=o?.handoffOffsets??[v,v+Math.floor(I/y[0].length)];for(let Y=0;Y<2;Y++){let X=P[Y]%y[Y].length;y[Y]=[...y[Y].slice(X),...y[Y].slice(0,X)]}let M=new Set(r.flatMap((Y)=>[Y.name,Y.source_trace_id??Y.name])),B=n.filter((Y)=>!Y.owners.some((X)=>M.has(X))),T=2*s+a,N=(Y,X,K=!1)=>({type:"pcb_trace",pcb_trace_id:`bus_lane_${Y.name}`,connection_name:Y.name,source_trace_id:Y.source_trace_id??Y.name,route:(K?X:T1(X)).map((J)=>({...J,route_type:"wire",layer:h,width:s}))}),D=null,L=1/0,H=0,V=new Map,O=g.some((Y)=>Y.length>0),U=(O?[s/2,s/10]:[void 0]).flatMap((Y)=>y[0].map((X)=>({point:X,approachStep:Y}))),j=o&&!o.copper.length&&!o.penalty&&!o.history?vXr(e,n):void 0;for(let{point:Y,approachStep:X}of U)for(let K of y[1])e:for(let J of[0,-1,1,-2,2]){let ee=[Y,K].map((Me)=>({...Me,[m]:Me[m]+J*T})),se=JSON.stringify([t,h,s,a,X,ee]),ne=j?.get(se);if(ne){if(ne.traces&&ne.score<L)L=ne.score,D=ne.traces;if(ne.hasMatchedAlternative)return D;if(ne.countsAttempt&&D&&++H>=4)return D;continue}let re=null,Z=1/0,te={name:"pair_corridor",pointsToConnect:ee.map((Me)=>({...Me,layer:h}))},ie=new Di(e,te,T,B),le=o?new Di(e,te,T,[...B,...o.copper]):ie,ue=qk(ee[0],ee[1]).find((Me)=>le.pathVisible(Me)),de=ue?{solved:!0,failed:!1,expanded:0,result:ue,step(){}}:O||e.connections.length>12?new Tl(ie,ee[0],ee[1],o?.copper,o?.penalty,o?.history):new Sde(ie,ee[0],ee[1]);try{while(!de.solved&&!de.failed&&de.expanded<(de instanceof Tl?500000:1000))de.step(),yield}finally{if(de instanceof Tl)de.cancel()}if(!de.solved){j?.set(se,{traces:null,score:1/0,hasMatchedAlternative:!1,countsAttempt:!1});continue}let me=b2(de.result,le);if(me.length<2||me.some((Me,Re)=>{if(!Re)return!1;let we=me[Re-1],_e=Gn(we,Me);if(_e<0.00000001)return!0;if(Re<2)return!1;let ye=me[Re-2],Se=Gn(ye,we);return 1+((we.x-ye.x)*(Me.x-we.x)+(we.y-ye.y)*(Me.y-we.y))/(Se*_e)<0.00001})){j?.set(se,{traces:null,score:1/0,hasMatchedAlternative:!1,countsAttempt:!1});continue}let Ae=[hf(me,(s+a)/2),hf(me,-(s+a)/2)],xe=[!1,!0].sort((Me,Re)=>{let we=(_e)=>r.reduce((ye,Se,Ne)=>{let ke=Ae[_e?1-Ne:Ne];return ye+Gn(Se.pointsToConnect[0],ke[0])+Gn(Se.pointsToConnect[1],ke.at(-1))},0);return we(Me)-we(Re)});for(let Me of xe){let Re=Me?Ae.toReversed():Ae,we=r.map((_e,ye)=>N(_e,Re[ye]));for(let _e of[[[0,1],[0,1]],[[0,1],[1,0]],[[1,0],[0,1]],[[1,0],[1,0]]]){let ye=[[],[]],Se=!1;for(let Tt=0;Tt<2;Tt++)for(let et of _e[Tt]){let vt=r[et],ht=Re[et][Tt===0?0:Re[et].length-1],We=vt.pointsToConnect[Tt],Le=e,Ze=Tt===0?Re[et]:Re[et].toReversed(),$e=4*s,qe=[];for(let kt=1;kt<Ze.length;kt++){let Lt=Ze[kt-1],Wt=Ze[kt],bn=Gn(Lt,Wt);if($e>=bn){$e-=bn;continue}qe.push({a:{x:Lt.x+(Wt.x-Lt.x)*$e/bn,y:Lt.y+(Wt.y-Lt.y)*$e/bn},b:Wt,radius:s/2,layer:h,owners:["reserved_pair_tail"]}),$e=0}let ft=new Di(Le,vt,s,[...n,...qe,...we.flatMap(oi),...ye.flat().flatMap(oi)]),It=o?new Di(Le,vt,s,[...n,...qe,...we.flatMap(oi),...ye.flat().flatMap(oi),...o.copper]):ft,ze=qk(We,ht).find((kt)=>It.pathVisible(kt)),Xe=30*s,it={minX:Math.max(e.bounds.minX,Math.min(We.x,ht.x)-Xe),maxX:Math.min(e.bounds.maxX,Math.max(We.x,ht.x)+Xe),minY:Math.max(e.bounds.minY,Math.min(We.y,ht.y)-Xe),maxY:Math.min(e.bounds.maxY,Math.max(We.y,ht.y)+Xe)},St=ze?{solved:!0,failed:!1,expanded:0,result:ze,step(){}}:new Tl(ft,We,ht,o?.copper,o?.penalty,O?void 0:o?.history,O?{step:X,bounds:it}:void 0);try{while(!St.solved&&!St.failed&&St.expanded<500000)St.step(),yield}finally{if(St instanceof Tl)St.cancel()}if(!St.solved){Se=!0;break}ye[et][Tt]=N(vt,b2(St.result,It))}if(Se)continue;let Ne=IXr(r.map((Tt,et)=>({...N(Tt,[...ye[et][0].route,...Re[et].slice(1),...ye[et][1].route.toReversed().slice(1)],!0),coupledSection:[ye[et][0].route.length-1,ye[et][0].route.length+Re[et].length-2]})));if(!Ne.every((Tt,et)=>new Di(e,r[et],s,[...n,...Ne.flatMap(oi)]).pathVisible(Tt.route)))continue;let ke={...e,connections:r,buses:[],differentialPairs:[t]},nt;for(let Tt of[1.5,0.75,0.375,0.1875]){let et=uL(ke,Ne,n,Tt);if(!aG(et)||pL(ke,et).some((vt)=>!vt.matched))continue;if(et.some((vt)=>br(vt.route)>Ax(e,vt.connection_name)+0.0000001))continue;try{let vt=fZ(ke,et,sL(ke,et),{maxCandidates:512}),ht=EG(ke,s+a/2+d),We=new Map;for(let Ze of ke.traces??[])We.set(Ze.connection_name,(We.get(Ze.connection_name)??0)+1);if((ke.traces?.length??0)>0&&[...We.values()].every((Ze)=>Ze===2)&&ke.traces.every((Ze)=>Ze.route.filter(($e)=>$e.route_type==="via").length===1)&&ht.length&&vt.some((Ze)=>Ze.curvedSegments?.some(($e)=>!ht.some((qe)=>_x(Ze.route[$e-1],qe.copper)&&_x(Ze.route[$e],qe.copper)))))vt=fZ(ke,et,sL(ke,et),{maxCandidates:512,packageOnlyPairTuning:!0});if(aG(vt)&&pL(ke,vt).every((Ze)=>Ze.matched)){nt=vt;break}}catch{}}if(!nt)continue;Ne=nt;let dt=[...Ne[0].route,...Ne[1].route.toReversed()],rt=e.connections.filter((Tt)=>!t.connectionNames.includes(Tt.name)&&Tt.pointsToConnect.some((et)=>et.layer===h&&l(et,dt))),mt=!1,lt=Math.abs(br(Ne[0].route)+c[0]-br(Ne[1].route)-c[1]),Ct=o?lt+0.05*Ne.reduce((Tt,et)=>Tt+br(et.route),0):Ne.reduce((Tt,et)=>Tt+br(et.route),0),Nt=(o?rt:e.connections).filter((Tt)=>!t.connectionNames.includes(Tt.name)&&Tt.pointsToConnect[0].layer===h),Ht=Nt.length?JSON.stringify(Ne.map((Tt)=>Tt.route)):"";for(let Tt of Nt){let et=`${Tt.name}:${Ht}`,vt=V.get(et);if(!vt){let ht=(e.buses??[]).find((ft)=>ft.connectionNames.includes(Tt.name))?.traceWidth??Tt.nominalTraceWidth??Tt.width??e.minTraceWidth,We=new Di(e,Tt,ht,[...n,...Ne.flatMap(oi)]),Le=qk(Tt.pointsToConnect[0],Tt.pointsToConnect[1]),Ze=br(Le[0]),$e=Le.find((ft)=>br(ft)<=Ze+0.00000001&&We.pathVisible(ft)),qe=$e?{solved:!0,failed:!1,expanded:0,result:$e,step(){},cancel(){}}:new Tl(We,Tt.pointsToConnect[0],Tt.pointsToConnect[1]);try{while(!qe.solved&&!qe.failed&&qe.expanded<500000)qe.step(),yield}finally{qe.cancel()}vt={reachable:qe.solved,length:qe.solved?br(qe.result):1/0},V.set(et,vt)}if(!vt.reachable){mt=!0;break}Ct+=o?0.05*Math.max(0,vt.length-br(qk(Tt.pointsToConnect[0],Tt.pointsToConnect[1])[0])):vt.length}if(!mt&&Ne.every((Tt)=>ml(Tt.route,s+d))){if(Ct<Z)Z=Ct,re=Ne;if(Ct<L)L=Ct,D=Ne;if(o&&lt<=t.lengthTolerance)return j?.set(se,{traces:re,score:Z,hasMatchedAlternative:!0,countsAttempt:!0}),D;if(!o&&++H>=2)return D;if(!o)continue e}}}if(j?.set(se,{traces:re,score:Z,hasMatchedAlternative:!1,countsAttempt:!0}),o&&D&&++H>=4)return D}return D}function Jk(e){let t=new Map,n=e.obstacles.filter((s)=>s.componentId),o=new Map;for(let s of n){let a=s.circuitJsonMetadata?.pcb_port_id;if(a)o.set(a,s.componentId);let c=(s.ccwRotationDegrees??0)*Math.PI/180,l=Math.abs(Math.cos(c))*s.width+Math.abs(Math.sin(c))*s.height,h=Math.abs(Math.sin(c))*s.width+Math.abs(Math.cos(c))*s.height,d=t.get(s.componentId)??{left:1/0,right:-1/0,bottom:1/0,top:-1/0};d.left=Math.min(d.left,s.center.x-l/2),d.right=Math.max(d.right,s.center.x+l/2),d.bottom=Math.min(d.bottom,s.center.y-h/2),d.top=Math.max(d.top,s.center.y+h/2),t.set(s.componentId,d)}let r=new Map([...t].map(([s,a])=>[s,{x:(a.left+a.right)/2,y:(a.bottom+a.top)/2}])),i=new Map;for(let s of e.connections){if(s.pointsToConnect.length!==2)continue;let a=s.pointsToConnect.map((c)=>{let l=c.pcb_port_id?o.get(c.pcb_port_id):void 0;if(l)return l;let h=new Set([s.name,s.source_trace_id,c.pointId,c.pcb_port_id].filter((d)=>!!d));return n.filter((d)=>d.connectedTo.some((u)=>h.has(u))).sort((d,u)=>Gn(c,d.center)-Gn(c,u.center))[0]?.componentId});for(let[c,l]of a.entries()){let h=a[1-c];if(!l||!h||l===h)continue;let d=JSON.stringify([l,h]),u=i.get(d)??{source:l,remote:h,points:[]};u.points.push(s.pointsToConnect[c]),i.set(d,u)}}return[...i.values()].some((s)=>{let a=r.get(s.source),c=r.get(s.remote),l={x:s.points.reduce((h,d)=>h+d.x,0)/s.points.length,y:s.points.reduce((h,d)=>h+d.y,0)/s.points.length};return(l.x-a.x)*(c.x-a.x)+(l.y-a.y)*(c.y-a.y)<-0.000000001})}function*iit(e,t,n){let o=e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075;for(let r of t){let i=r.route[0].width;if(ml(r.route,i+o))continue;if(r.coupledSection)return!1;let s=e.connections.find((d)=>d.name===r.connection_name),a=new Di(e,s,i,[...n,...t.flatMap(oi)]),c=i*10,l={minX:Math.max(e.bounds.minX,Math.min(...r.route.map((d)=>d.x))-c),maxX:Math.min(e.bounds.maxX,Math.max(...r.route.map((d)=>d.x))+c),minY:Math.max(e.bounds.minY,Math.min(...r.route.map((d)=>d.y))-c),maxY:Math.min(e.bounds.maxY,Math.max(...r.route.map((d)=>d.y))+c)},h=!1;for(let d of[i/4,i/5]){for(let u of[!1,!0]){let _=u?s.pointsToConnect.toReversed():s.pointsToConnect,p=new Tl(a,_[0],_[1],[],0,void 0,{step:d,bounds:l});try{while(!p.failed&&!p.solved)p.step(),yield;if(!p.solved)continue;let m=b2(u?p.result.toReversed():p.result,a);if(!ml(m,i+o))continue;r.route=m.map((A)=>({...A,route_type:"wire",layer:s.pointsToConnect[0].layer,width:i})),h=!0;break}finally{p.cancel()}}if(h)break}if(!h)return!1}return!0}function*DXr(e,t,n,o,r,i,s){let a=new Map,c=0;for(let l=0;l<24&&c<20000;l++){let h=o.select(r,i);if(h)return h;let d=o.unresolvedUnits(r);if(!d?.length)return null;let u=d.join("\x00"),_=a.get(u)??0;a.set(u,_+1);let p=0;for(let m of[...d].sort((A,g)=>Number(e.differentialPairs?.some((f)=>f.connectionNames.includes(A)))-Number(e.differentialPairs?.some((f)=>f.connectionNames.includes(g))))){let A=e.differentialPairs?.find((C)=>C.connectionNames.includes(m));if(A){if(p||_<1)continue;for(let C=0;C<4&&c<20000;C++){let b=o.conditionalRoutes(d.filter((M)=>M!==m),C===0?-1:_*4+C,C%2===0?r.filter((M)=>M!==m):[]);if(!b)continue;let I=CL(e,A,[...t,...b.flatMap(oi)],{copper:[],penalty:0,variant:_}),v=I.next(),P=0;try{while(!v.done&&c<20000&&P<2000)c++,P++,yield,v=I.next()}finally{if(!v.done)I.return(null)}if(v.done&&v.value){let M=o.revisionNumber;o.add(m,v.value),p+=Number(o.revisionNumber!==M)}}continue}let g=e.connections.find((C)=>C.name===m),y=e.buses?.some((C)=>C.connectionNames.includes(m))?[g.pointsToConnect[0].layer]:s.get(m)??[g.pointsToConnect[0].layer],x=d.filter((C)=>C!==m);for(let C=0;C<12&&c<20000;C++){let b=o.conditionalRoutes(x,C===0?-1:_*12+C,C%2===0?r.filter((I)=>I!==m):[]);if(!b)continue;for(let I of y){let v={...g,pointsToConnect:g.pointsToConnect.map((D)=>({...D,layer:I}))},P=n.get(m)??e.minTraceWidth,M=new Di(e,v,P,[...t,...b.flatMap(oi)]),B=new Tl(M,v.pointsToConnect[0],v.pointsToConnect[1]);try{while(!B.solved&&!B.failed&&B.expanded<500000&&c<20000)B.step(),c++,yield}finally{B.cancel()}if(!B.solved)continue;let T=b2(B.result,M);if(!ml(T,P/2+M.margin))continue;let N=o.revisionNumber;o.add(m,[{type:"pcb_trace",pcb_trace_id:`bus_lane_${m}`,connection_name:m,source_trace_id:g.source_trace_id??m,route:T.map((D)=>({...D,route_type:"wire",layer:I,width:P}))}]),p+=Number(o.revisionNumber!==N)}}}if(!p&&_>5)return null}return o.select(r,i)}function*XCn(e,t,n,o,r,i){let[s,a]=e.connection.pointsToConnect,c=new Tl(e,s,t,n,o,r,{maxLength:i-Gn(t,a)});try{while(!c.solved&&!c.failed)c.step(),yield}finally{c.cancel()}if(!c.solved)return null;let l=b2(c.result,e),h=[],d=br(l)-e.width-e.margin-0.0000001;for(let A=1;A<l.length&&d>0;A++){let g=l[A-1],f=l[A],y=Gn(g,f),x=Math.min(1,d/y);h.push({a:g,b:{x:g.x+(f.x-g.x)*x,y:g.y+(f.y-g.y)*x},radius:e.width/2,layer:s.layer,owners:["waypoint_prefix"]}),d-=y}let u=new Di(e.input,e.connection,e.width,[...e.copper,...h]),_=new Tl(u,t,a,n,o,r,{maxLength:i-br(l)});try{while(!_.solved&&!_.failed)_.step(),yield}finally{_.cancel()}if(!_.solved)return null;let p=b2(_.result,u),m=T1([...l,...p.slice(1)]);if(br(m)>i+0.00000001||!ml(m,e.width/2+e.margin))return null;return m}var c2n=new WeakMap;function*NXr(e,t,n,o){let r=JSON.stringify([e.bounds,e.layerCount,e.minTraceWidth,e.obstacles,e.traces,e.connections.map((c)=>c.pointsToConnect),e.minBoardEdgeClearance,e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075,n,t.map((c)=>[c.name,c.source_trace_id,c.pointsToConnect,o.get(c.name)])]),i=c2n.get(e)??new Map;c2n.set(e,i);let s=i.get(r);if(s)return structuredClone(s);let a=[];for(let c of t){let l=o.get(c.name),h=new Tl(new Di(e,c,l,n),c.pointsToConnect[0],c.pointsToConnect[1]);try{while(!h.solved&&!h.failed)h.step(),yield;if(h.solved)a.push({type:"pcb_trace",pcb_trace_id:`certificate_${c.name}`,connection_name:c.name,route:h.result.map((d)=>({...d,route_type:"wire",layer:c.pointsToConnect[0].layer,width:l}))})}finally{if(!h.solved&&!h.failed)h.cancel()}}if(i.size>=8)i.delete(i.keys().next().value);return i.set(r,structuredClone(a)),a}var GZ=class{geometry=new WeakMap;conflicts=new WeakMap;getGeometry(e){let t=this.geometry.get(e);if(t)return t;let n=[],o=new Float64Array(Math.max(0,e.length-1)*4),r=1/0,i=-1/0,s=1/0,a=-1/0;for(let l=1;l<e.length;l++){let h=e[l-1],d=e[l],u=(l-1)*4;n.push([h,d]),o[u]=Math.min(h.x,d.x),o[u+1]=Math.max(h.x,d.x),o[u+2]=Math.min(h.y,d.y),o[u+3]=Math.max(h.y,d.y),r=Math.min(r,o[u]),i=Math.max(i,o[u+1]),s=Math.min(s,o[u+2]),a=Math.max(a,o[u+3])}let c={edges:n,bounds:o,minX:r,maxX:i,minY:s,maxY:a};return this.geometry.set(e,c),c}firstConflict(e,t,n){let o=this.conflicts.get(e),r=o?.get(t);if(r?.required===n)return r.result;if(!o)o=new WeakMap,this.conflicts.set(e,o);let i=this.getGeometry(e),s=this.getGeometry(t),a=null;if(i.maxX+n>=s.minX&&s.maxX+n>=i.minX&&i.maxY+n>=s.minY&&s.maxY+n>=i.minY)e:for(let c=0;c<i.edges.length;c++){let l=c*4;for(let h=0;h<s.edges.length;h++){let d=h*4;if(i.bounds[l+1]+n<s.bounds[d]||s.bounds[d+1]+n<i.bounds[l]||i.bounds[l+3]+n<s.bounds[d+2]||s.bounds[d+3]+n<i.bounds[l+2])continue;if(sT(i.edges[c],s.edges[h])<n){a=[c+1,h+1];break e}}}return o.set(t,{required:n,result:a}),a}},RXr=class{bits=new Uint8Array(0);sparse=new Map;get(e){if(e>=4096)return this.sparse.get(e);let t=this.bits[e];return t?t===2:void 0}set(e,t){if(e>=4096){this.sparse.set(e,t);return}if(e>=this.bits.length){let n=new Uint8Array(Math.max(16,2**Math.ceil(Math.log2(e+1))));n.set(this.bits),this.bits=n}this.bits[e]=t?2:1}keys(){return this.sparse.keys()}delete(e){this.sparse.delete(e)}},sit=class{constructor(e,t=120){this.clearance=e,this.limit=t}clearance;limit;pools=new Map;nextId=0;additions=0;assignments=new Map;routeConflicts=new GZ;signatures=new Map;routeSignatures=new WeakMap;revision=0;selection;add(e,t){let n=this.pools.get(e)??[],o=this.signatures.get(e);if(!o)o=new Set,this.signatures.set(e,o);let r=`[${t.map((a)=>{let c=this.routeSignatures.get(a.route);if(c===void 0)c=JSON.stringify(a.route),this.routeSignatures.set(a.route,c);return c}).join(",")}]`;if(o.has(r))return;let i=t.map((a)=>br(a.route)),s={traces:t,key:r,length:i.reduce((a,c)=>a+c,0),peak:Math.max(...i),layers:[...new Set(t.map((a)=>a.route[0].layer))],singleLayer:t.every((a)=>a.route[0].layer===t[0].route[0].layer)?t[0].route[0].layer:void 0,conflicts:new RXr,id:this.nextId++};if(n.push(s),o.add(r),n.length>this.limit)o.delete(n.shift().key);this.pools.set(e,n),this.additions++,this.revision++}transformUnit(e,t){let n=this.pools.get(e)??[];this.pools.delete(e),this.signatures.delete(e),this.revision++;for(let o of n){let r=t(o.traces);if(r)this.add(e,r)}}hasEveryUnit(e){return e.every((t)=>!!this.pools.get(t)?.length)}unresolvedUnits(e){if(this.compatible(e.map((n)=>this.pools.get(n)??[]),500000))return null;let t=e.slice();for(let n of e){let o=t.filter((r)=>r!==n);if(!this.compatible(o.map((r)=>this.pools.get(r)??[]),500000))t=o}return t}conditionalRoutes(e,t,n=[]){if(!e.length)return[];let o=t%e.length,r=Math.floor(t/e.length),i=e.map((c,l)=>{let h=this.pools.get(c)??[];return t<0||l!==o||!h.length?h:[h[r%h.length]]}),s=this.compatible(i,500000);if(!s)return null;let a=s.map((c)=>[c]);for(let c of n){if(e.includes(c))continue;let l=this.pools.get(c)??[],h=this.compatible([...a,l]);if(!h)continue;a.push(l),s=h}return s.flatMap((c)=>c.traces)}get revisionNumber(){return this.revision}collides(e,t){if(e.singleLayer!==void 0&&t.singleLayer!==void 0&&e.singleLayer!==t.singleLayer)return!1;let n=e.id<t.id?e:t,o=Math.max(e.id,t.id),r=n.conflicts,i=r.get(o);if(i!==void 0)return i;if(!e.layers.some((s)=>t.layers.includes(s)))return r.set(o,!1),!1;for(let s of e.traces)for(let a of t.traces){if(s.route[0].layer!==a.route[0].layer)continue;let c=(s.route[0].width+a.route[0].width)/2+this.clearance-0.00000001;if(this.routeConflicts.firstConflict(s.route,a.route,c))return r.set(o,!0),!0}return r.set(o,!1),!1}compatible(e,t=50000){let n=`${t}:`+e.map((r)=>r.map((i)=>i.id).join(",")).join(";");if(this.assignments.has(n))return this.assignments.get(n);let o=this.computeCompatible(e,t);if(this.assignments.size>=128)this.assignments.delete(this.assignments.keys().next().value);return this.assignments.set(n,o),o}computeCompatible(e,t){if(e.some((a)=>!a.length))return null;let n=e.map((a)=>new Set(a.flatMap((c)=>c.layers))),o=new Set(e.map((a,c)=>c)),r=[];while(o.size){let a=[o.values().next().value];o.delete(a[0]);for(let c=0;c<a.length;c++)for(let l of o){if(![...n[l]].some((h)=>n[a[c]].has(h)))continue;o.delete(l),a.push(l)}r.push(a)}if(r.length>1){let a=[];for(let c of r){let l=this.compatible(c.map((h)=>e[h]),t);if(!l)return null;c.forEach((h,d)=>{a[h]=l[d]})}return a}let i=e.map(()=>{return}),s=(a)=>{if(--t<0)return null;let c=-1;for(let l=0;l<a.length;l++){if(i[l])continue;if(!a[l].length)return null;if(c<0||a[l].length<a[c].length)c=l}if(c<0)return i;for(let l of a[c]){i[c]=l;let h=a.map((u,_)=>i[_]?u:u.filter((p)=>!this.collides(l,p))),d=s(h);if(d)return d.slice();if(i[c]=void 0,t<0)break}return null};return s(e.map((a)=>[...a].sort((c,l)=>c.length-l.length)))}pruneConflicts(){let e=new Set([...this.pools.values()].flat().map((t)=>t.id));for(let t of this.pools.values())for(let n of t)for(let o of n.conflicts.keys())if(!e.has(o))n.conflicts.delete(o);this.additions=0}select(e,t=[]){let n=JSON.stringify([e,t]);if(this.selection?.revision===this.revision&&this.selection.key===n)return this.selection.result?.slice()??null;let o=this.computeSelection(e,t);return this.selection={revision:this.revision,key:n,result:o},o?.slice()??null}computeSelection(e,t){if(this.additions>=100)this.pruneConflicts();let n=e.map((i)=>this.pools.get(i)??[]),o=this.compatible(n);if(!o)return null;let r=(i)=>i.peak;for(let i of[e,...t]){let s=new Set(i.map((d)=>e.indexOf(d)).filter((d)=>d>=0));if(!s.size)continue;let a=Math.max(...o.filter((d,u)=>s.has(u)).map(r)),c=[...new Set(n.flatMap((d,u)=>s.has(u)?d.map(r):[]))].filter((d)=>d<a).sort((d,u)=>d-u),l=0,h=c.length-1;while(l<=h){let d=l+h>>1,u=this.compatible(n.map((_,p)=>s.has(p)?_.filter((m)=>r(m)<=c[d]):_));if(u)o=u,a=c[d],h=d-1;else l=d+1}n=n.map((d,u)=>s.has(u)?d.filter((_)=>r(_)<=a):d)}return o.flatMap((i)=>i.traces)}};function*ait(e){if(!e.length)yield[];else for(let t=0;t<e.length;t++)for(let n of ait(e.filter((o,r)=>t!==r)))yield[e[t],...n]}function*QXr(e){if(e.length<=4){yield*ait(e);return}let t=new Set;for(let n of ait(e))for(let o=0;o<n.length;o++){let r=[...n.slice(o),...n.slice(0,o)],i=JSON.stringify(r);if(t.has(i))continue;if(t.add(i),yield r,t.size===24)return}}function*kXr(e,t,n,o,r,i={}){let s=new Map(t.map((p)=>[p.name,p])),a=(p)=>r.get(p)??s.get(p)?.width??s.get(p)?.nominalTraceWidth??e.minTraceWidth,c=(p)=>{let m=s.get(p.connection_name??"");return!!m&&m.pointsToConnect.length===2&&p.route.length>=2&&p.route.every((A)=>A.route_type==="wire"&&Number.isFinite(A.x)&&Number.isFinite(A.y)&&A.layer===m.pointsToConnect[0].layer&&Number.isFinite(A.width)&&A.width>0&&Math.abs(A.width-a(m.name))<0.000000000001)&&Gn(p.route[0],m.pointsToConnect[0])<=0.00000001&&Gn(p.route.at(-1),m.pointsToConnect[1])<=0.00000001};if(o.some((p)=>!c(p)))return null;let l=new Set((e.differentialPairs??[]).flatMap((p)=>p.connectionNames)),h=t.filter((p)=>!o.some((m)=>m.connection_name===p.name));if(!h.length||h.some((p)=>l.has(p.name)||p.pointsToConnect.length!==2||p.pointsToConnect[0].layer!==p.pointsToConnect[1].layer))return null;let d=new Map;for(let p of h){let m=p.pointsToConnect[0].layer,A=d.get(m)??[];A.push(p),d.set(m,A)}if([...d.values()].some((p)=>p.length>2))return null;let u=o.slice(),_={searches:0,searchSteps:0,candidates:0};for(let p of d.keys()){let m=t.filter((y)=>y.pointsToConnect[0].layer===p),A=new Set(m.map((y)=>y.name)),g=u.filter((y)=>!A.has(y.connection_name)),f=yield*LXr(e,m,[...n,...g.flatMap(oi)],u.filter((y)=>A.has(y.connection_name)),r,i,_);if(!f)return null;u=[...g,...f]}if(u.length!==t.length||new Set(u.map((p)=>p.connection_name)).size!==t.length)return null;for(let p of u){if(!c(p))return null;let m=s.get(p.connection_name);if(!new Di(e,m,a(m.name),[...n,...u.filter((g)=>g!==p).flatMap(oi)]).pathVisible(p.route)||!(i.deferRetainedSelfClearance&&o.some((g)=>g.route===p.route))&&!ml(p.route,a(m.name)+(e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075)))return null}return u}function*LXr(e,t,n,o,r,i,s){let a=Math.min(5,i.maxSubsetSize??4),c=i.maxSearches??1200,l=i.maxSearchSteps??180000,h=i.maxCandidatesPerLane??80,d=e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075,u=new Map(t.map((j)=>[j.name,j])),_=new Set((e.differentialPairs??[]).flatMap((j)=>j.connectionNames)),p=(j)=>!_.has(j.name)&&j.pointsToConnect.length===2&&j.pointsToConnect[0].layer===j.pointsToConnect[1].layer,m=(j)=>r.get(j)??u.get(j)?.width??u.get(j)?.nominalTraceWidth??e.minTraceWidth,A=(j)=>{let Y=u.get(j.connection_name??"");return!!Y&&Y.pointsToConnect.length===2&&j.route.length>=2&&j.route.every((X)=>X.route_type==="wire"&&Number.isFinite(X.x)&&Number.isFinite(X.y)&&X.layer===Y.pointsToConnect[0].layer&&Number.isFinite(X.width)&&X.width>0&&Math.abs(X.width-m(Y.name))<0.000000000001)&&Gn(j.route[0],Y.pointsToConnect[0])<=0.00000001&&Gn(j.route.at(-1),Y.pointsToConnect[1])<=0.00000001};if(o.some((j)=>!A(j)))return null;let g=new Set(o.map((j)=>j.connection_name)),f=t.filter((j)=>!g.has(j.name));if(!f.length||f.length>2||f.length>a||f.some((j)=>!p(j)))return null;let y=new WeakMap,x=(j)=>{let Y=y.get(j);if(!Y)Y=oi(j),y.set(j,Y);return Y},C=(j,Y)=>({type:"pcb_trace",pcb_trace_id:`lane_closure_repair_${j}`,connection_name:j,source_trace_id:u.get(j).source_trace_id,route:Y.map((X)=>({...X,route_type:"wire",layer:u.get(j).pointsToConnect[0].layer,width:m(j)}))}),b=(j)=>{let Y=u.get(j.connection_name??"");return!!Y&&p(Y)&&!j.coupledSection&&!j.curvedSegments?.length&&j.route.every((X)=>X.route_type==="wire")},I=o,v=f.map((j)=>j.name),P=0,M=()=>s.searches>=c||s.searchSteps>=l,B=()=>i.onProgress?.({searches:s.searches,searchSteps:s.searchSteps,subset:[...v],candidates:s.candidates}),T=2*Math.max(...t.map((j)=>Gn(j.pointsToConnect[0],j.pointsToConnect[1]))),N=new Map;function*D(j,Y,X=!1){if(M())return null;let K=JSON.stringify([j,X,u.get(j).pointsToConnect,m(j),Y.map((Z)=>[Z.connection_name,Z.route])]);if(N.has(K))return N.get(K);let J=(Z)=>{if(N.size>=256)N.delete(N.keys().next().value);return N.set(K,Z),Z};s.searches++,B();let ee=u.get(j),se=new Di(e,ee,m(j),[...n,...Y.flatMap(x)]),ne=new Tl(se,ee.pointsToConnect[X?1:0],ee.pointsToConnect[X?0:1],[],0,void 0,{maxLength:i.maxLengths?.get(j)??T}),re=0;try{while(re<(i.maxSearchStepsPerAttempt??500)&&!ne.solved&&!ne.failed&&s.searchSteps<l)ne.step(),re++,s.searchSteps++,yield;if(!ne.solved)return J(null);let Z=X?ne.result.toReversed():ne.result,te=b2(Z,se);if(!se.pathVisible(te)||!ml(te,m(j)+d))return J(null);return J(C(j,te))}finally{ne.cancel(),B()}}let L=new Map,H=new Map;for(let j of f){let Y=yield*D(j.name,I);if(Y)L.set(j.name,[Y]);else for(let X of I){if(!b(X)||X.route[0].layer!==j.pointsToConnect[0].layer)continue;let K=yield*D(j.name,I.filter((J)=>J!==X));if(!K)continue;H.set(X.connection_name,(H.get(X.connection_name)??0)+1),L.set(j.name,[...L.get(j.name)??[],K])}}function*V(j,Y,X=0,K=[]){if(!Y){yield K;return}for(let J=X;J<=j.length-Y;J++)yield*V(j,Y-1,J+1,[...K,j[J]])}for(let j of f){if(L.has(j.name))continue;let Y=I.filter((K)=>b(K)&&K.route[0].layer===j.pointsToConnect[0].layer),X=!1;for(let K=2;K<=a-f.length&&!X;K++)for(let J of V(Y,K)){if(M())break;let ee=yield*D(j.name,I.filter((se)=>!J.includes(se)));if(!ee)continue;for(let se of J)H.set(se.connection_name,(H.get(se.connection_name)??0)+1);L.set(j.name,[ee]),X=!0;break}}for(let[j]of[...H].sort((Y,X)=>X[1]-Y[1])){if(v.length>=Math.min(4,a))break;v.push(j)}if(M())return null;function*O(){let j=I.filter((K)=>!v.includes(K.connection_name)),Y=new Map;for(let K of f.map((J)=>J.name)){let J=yield*D(K,j);if(!J)continue;for(let ee of v.filter((se)=>se!==K)){if(yield*D(ee,[...j,J]))continue;for(let se of j){if(!b(se)||se.route[0].layer!==u.get(ee).pointsToConnect[0].layer)continue;if(!(yield*D(ee,[...j.filter((re)=>re!==se),J])))continue;let ne=Y.get(se.connection_name)??new Set;ne.add(ee),Y.set(se.connection_name,ne)}}}let X=[...Y].sort((K,J)=>J[1].size-K[1].size)[0]?.[0];if(X)return X;for(let K of f){let J=yield*D(K.name,I.filter((se)=>!b(se)));if(!J)continue;let ee=j.find((se)=>b(se)&&!new Di(e,K,m(K.name),[...n,...x(se)]).pathVisible(J.route));if(ee)return ee.connection_name}return null}let U=[...I,...[...L.values()].flat()];for(;;){let j=I.filter((de)=>!v.includes(de.connection_name)),Y=[...n,...j.flatMap(x)],X=new sit(d,h),K=new Map,J=new Map,ee=(de)=>{let me=de.connection_name;if(!A(de))return!1;if(!new Di(e,u.get(me),m(me),Y).pathVisible(de.route)||!(i.deferRetainedSelfClearance&&o.some((we)=>we.route===de.route))&&!ml(de.route,m(me)+d))return!1;let xe=JSON.stringify(de.route),Me=J.get(me)??new Set;if(Me.has(xe))return!1;let Re=K.get(me)??[];if(Re.push(de),Me.add(xe),Re.length>h)Me.delete(JSON.stringify(Re.shift().route));return K.set(me,Re),J.set(me,Me),X.add(me,[de]),P++,s.candidates++,!0},se=()=>{let de=X.select(v,[v]);if(!de)return null;let me=[...j,...de];if(me.length!==t.length||new Set(me.map((Ae)=>Ae.connection_name)).size!==t.length)return null;for(let Ae of me){let xe=u.get(Ae.connection_name);if(!xe||!A(Ae))return null;if(!new Di(e,xe,m(xe.name),[...n,...me.filter((Re)=>Re!==Ae).flatMap(x)]).pathVisible(Ae.route)||!(i.deferRetainedSelfClearance&&o.some((Re)=>Re.route===Ae.route))&&!ml(Ae.route,m(xe.name)+d))return null}return me};for(let de of U)if(v.includes(de.connection_name))ee(de);for(let de of v){let me=yield*D(de,j);if(me)ee(me)}let ne=se();if(ne)return ne;for(let de of QXr(v)){let me=[];for(let Ae of de){let xe=yield*D(Ae,[...j,...me]);if(!xe)break;if(me.push(xe),ee(xe),ne=se(),ne)return ne}if(M())return null}let re=(de,me)=>{let Ae=K.get(de)??[],xe=[...Ae].sort((Me,Re)=>br(Me.route)-br(Re.route));return Ae.length<=me?xe:[...new Set([Ae[0],...xe.slice(0,me/2-1),...Ae.slice(-me/2)])]};function*Z(de=!1,me=!1){let Ae=de?Math.min(8,h):h;for(let xe=0;xe<(me?0:de?1:i.maxConditionalPasses??4);xe++){let Me=P,Re=new Map(v.map((we)=>[we,re(we,Ae)]));for(let we of v)for(let _e of v.filter((ye)=>ye!==we))for(let ye of Re.get(_e)){let Se=yield*D(we,[...j,ye]);if(Se)ee(Se);let Ne=se();if(Ne)return Ne;if(M())return null}if(P===Me)break}for(let xe of v){let Me=v.filter((we)=>we!==xe),Re=new Map(Me.map((we)=>[we,re(we,Ae)]));for(let we of Me)for(let _e of Re.get(we)){let ye=new sit(d,h);for(let nt of Me)for(let dt of nt===we?[_e]:Re.get(nt))ye.add(nt,[dt]);let Se=ye.select(Me,[Me]);if(!Se)continue;let Ne=yield*D(xe,[...j,...Se]);if(Ne)ee(Ne);let ke=se();if(ke)return ke;if(M())return null}}return null}if(ne=yield*Z(!0),ne||M())return ne;if(v.length<a){let de=yield*O();if(M())return null;if(de){U.push(...[...K.values()].flat()),v.push(de);continue}}let te=t.flatMap((de)=>de.pointsToConnect),ie=(m(f[0].name)+d)*2,le=e.obstacles.filter((de)=>de.componentId),ue=P;for(let de of[0.1,0.3,0.5,0.7,0.9])for(let me=0;me<11;me++)for(let Ae of v){if(M())return null;s.searches++;let xe=u.get(Ae),[Me,Re]=xe.pointsToConnect,we=Math.abs(Re.y-Me.y)>=Math.abs(Re.x-Me.x),_e=(lt)=>we?lt.x:lt.y,ye=Math.min(...te.map(_e))-ie,Se=Math.max(...te.map(_e))+ie,Ne=Array.from({length:9},(lt,Ct)=>ye+(Se-ye)*Ct/8);if(le.length)Ne.push(Math.min(...le.map((lt)=>_e(lt.center)-(we?lt.width:lt.height)/2))-ie,Math.max(...le.map((lt)=>_e(lt.center)+(we?lt.width:lt.height)/2))+ie);let ke=Ne[me%Ne.length],nt=we?{x:ke,y:Me.y+(Re.y-Me.y)*de}:{x:Me.x+(Re.x-Me.x)*de,y:ke},dt=new Di(e,xe,m(Ae),Y),rt=XCn(dt,nt,[],0,void 0,i.maxLengths?.get(Ae)??T),mt=rt.next();try{while(!mt.done&&s.searchSteps<l)s.searchSteps++,yield,mt=rt.next()}finally{if(!mt.done)rt.return(null)}if(mt.done&&mt.value)ee(C(Ae,mt.value));if(ne=se(),ne)return ne;if(P-ue>=12){if(ne=yield*Z(!0,!0),ne||M())return ne;ue=P}}return yield*Z()}}function*MG(e,t,n,o,r,i,s=new Map,a=()=>!0,c=!1,l=!1){let h=t.some((U)=>(s.get(U.name)?.length??1)>1),d=new Map,u=new Map,_=new Map,p=e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075,m=(e.differentialPairs??[]).filter((U)=>(U.traceGap!==void 0||U.maxUncoupledLength!==void 0)&&U.connectionNames.every((j)=>t.some((Y)=>Y.name===j))),A=new Set(m.flatMap((U)=>U.connectionNames)),g=[...m.map((U)=>({pair:U,connections:U.connectionNames.map((j)=>t.find((Y)=>Y.name===j))})),...t.filter((U)=>!A.has(U.name)).map((U)=>({pair:void 0,connections:[U]}))].sort((U,j)=>Number(!U.pair)-Number(!j.pair)||br(U.connections[0].pointsToConnect)-br(j.connections[0].pointsToConnect)),f=new Map,y=new Map;for(let U of e.buses??[]){let j=t.filter((X)=>U.connectionNames.includes(X.name)),Y=1.4849999999999999*Math.max(...j.map((X)=>br(X.pointsToConnect)));for(let X of j){let K=Ax(e,X.name);f.set(X.name,Math.min(Y,K)),y.set(X.name,Math.min(Y*4/3,K))}}let x=new sit(p,240),C=new GZ,b=g.map((U)=>U.connections[0].name),I=[...(e.buses??[]).map((U)=>g.filter((j)=>j.connections.some((Y)=>U.connectionNames.includes(Y.name))).map((j)=>j.connections[0].name)),...g.filter((U)=>!U.connections.some((j)=>(e.buses??[]).some((Y)=>Y.connectionNames.includes(j.name)))).map((U)=>[U.connections[0].name])],v=new WeakMap,P=(U)=>{let j=v.get(U);if(!j)j=oi(U),v.set(U,j);return j},M=o.flatMap(P),B=new Map,T=[...g],N=0,D=0,L=0,H=0,V=0,O=-1/0;e:for(let U=0;U<12000&&T.length;U++){let Y=10+Math.floor(U/Math.max(1,t.length/4))*4;if(U-D>=g.length*8){for(let[ie,le]of f){let ue=y.get(ie);if(le<ue)f.set(ie,Math.min(ue,le*1.025))}let Z=new Set(T.flatMap((ie)=>ie.connections.map((le)=>le.pointsToConnect[0].layer))),te=g.filter((ie)=>ie.pair&&Z.has(ie.connections[0].pointsToConnect[0].layer));if(te.length){let ie=te[L++%te.length],le=T.indexOf(ie);if(le>=0)T.splice(le,1);T.unshift(ie)}D=U}let X=T.shift(),K=[X];for(let Z of K){let te=Z.connections[0],ie=(B.get(te.name)??0)+1;B.set(te.name,ie);let le=Z.connections.flatMap((rt)=>d.has(rt.name)?[d.get(rt.name)]:[]);for(let rt of Z.connections)d.delete(rt.name);let ue=s.get(te.name)?.filter((rt)=>Z.connections.every((mt)=>s.get(mt.name)?.includes(rt)))??[te.pointsToConnect[0].layer],de=le.length?le:Z.connections.map((rt)=>({connection_name:rt.name,route:rt.pointsToConnect})),me=(rt)=>{let mt=rt===te.pointsToConnect[0].layer?0:0.25;for(let lt of d.values()){if(lt.route[0].layer!==rt)continue;if(de.some((Nt)=>C.firstConflict(Nt.route,lt.route,(r.get(Nt.connection_name)+lt.route[0].width)/2+p-0.00000001)))mt++}return mt};if(ue.length>1){let rt=new Map(ue.map((mt)=>[mt,me(mt)]));ue.sort((mt,lt)=>rt.get(mt)-rt.get(lt))}let Ae=ue[0];for(let rt of Z.connections)for(let mt of rt.pointsToConnect)mt.layer=Ae;let xe=r.get(te.name),Me=te.pointsToConnect[0].layer;d.delete(te.name);let Re=[...d.values()],we=[...o,...Re],_e=Re.flatMap(P),ye=[...n,...M,...!Z.pair?Re.filter((rt)=>A.has(rt.connection_name)).flatMap(P):[]],Se=new Di(e,te,xe,ye);if(Z.pair){let rt=new dat(Se);if(!u.has(Me))u.set(Me,new Float32Array(rt.cellCount));_.set(Me,rt);let mt=CL(e,Z.pair,n,{copper:[],penalty:0,variant:ie-1}),lt=mt.next();try{while(!lt.done)yield Re,lt=mt.next()}finally{if(!lt.done)lt=mt.return(null)}if(!lt.value){if(le.length!==Z.connections.length)return null;for(let Ct of le){d.set(Ct.connection_name,Ct);let Nt=Z.connections.find((Ht)=>Ht.name===Ct.connection_name);for(let Ht of Nt.pointsToConnect)Ht.layer=Ct.route[0].layer}continue}x.add(te.name,lt.value);for(let Ct of lt.value)d.set(Ct.connection_name,Ct);continue}let Ne=[],ke=[];if(e.buses?.length&&U>=g.length*4&&a()){let rt=NXr(e,t.filter((Ct)=>!A.has(Ct.name)),ye,r),mt=rt.next();try{while(!mt.done)yield we,mt=rt.next()}finally{if(!mt.done)rt.return([])}let lt=mt.value;ke=lt,Ne=lt.filter((Ct)=>Ct.connection_name!==te.name&&!d.has(Ct.connection_name)).flatMap(P)}let nt=new Tl(Se,te.pointsToConnect[0],te.pointsToConnect[1],[..._e,...Ne],Y,u.get(Me),{maxLength:f.get(te.name),paretoLength:Number.isFinite(Ax(e,te.name)),checkReachability:l});if(!u.has(Me))u.set(Me,new Float32Array(nt.cellCount));_.set(Me,nt);let dt;for(let rt of ue){for(let Nt of te.pointsToConnect)Nt.layer=rt;let mt=rt===Me?Se:new Di(e,te,xe,ye),lt=rt===Me?nt:new Tl(mt,te.pointsToConnect[0],te.pointsToConnect[1],[..._e,...Ne],Y,u.get(rt),{maxLength:f.get(te.name),paretoLength:Number.isFinite(Ax(e,te.name)),checkReachability:l});if(!u.has(rt))u.set(rt,new Float32Array(lt.cellCount));_.set(rt,lt);try{while(!lt.solved&&!lt.failed)lt.step(),yield we}finally{if(!lt.solved&&!lt.failed)lt.cancel()}if(!lt.solved&&f.has(te.name)){lt=new Tl(mt,te.pointsToConnect[0],te.pointsToConnect[1],[],0,void 0,{checkReachability:l,maxLength:Ax(e,te.name)});try{while(!lt.solved&&!lt.failed)lt.step(),yield we}finally{if(!lt.solved&&!lt.failed)lt.cancel()}if(lt.solved&&br(lt.result)>f.get(te.name)){let Nt=e.buses.find((Ht)=>Ht.connectionNames.includes(te.name));for(let Ht of Nt.connectionNames)f.set(Ht,Math.min(br(lt.result)*1.05,Ax(e,Ht)))}}if(!lt.solved)continue;let Ct=[lt.result];if(ie>1&&ie%2===0&&f.has(te.name)){let[Nt,Ht]=te.pointsToConnect,Tt=Math.abs(Ht.y-Nt.y)>=Math.abs(Ht.x-Nt.x),et=[...t.flatMap((It)=>It.pointsToConnect),...e.obstacles.filter((It)=>It.componentId).flatMap((It)=>[{x:It.center.x-It.width/2-0.6,y:It.center.y-It.height/2-0.6},{x:It.center.x+It.width/2+0.6,y:It.center.y+It.height/2+0.6}]),...[...d.values()].filter((It)=>It.coupledSection).flatMap((It)=>It.route)].map((It)=>Tt?It.x:It.y),vt=Math.min(...et)-(xe+p)*2,ht=Math.max(...et)+(xe+p)*2,We=Math.floor(ie/2)-1,Le=vt+(ht-vt)*(We*5%9)/8,Ze=[-0.15,0.2,0.5,0.8,1.15,0.35,0.65,0.1,0.9][We%9],$e=Tt?{x:Le,y:Nt.y+(Ht.y-Nt.y)*Ze}:{x:Nt.x+(Ht.x-Nt.x)*Ze,y:Le},qe=XCn(mt,$e,_e,Y,u.get(rt),f.get(te.name)),ft=qe.next();try{while(!ft.done)yield we,ft=qe.next()}finally{if(!ft.done)qe.return(null)}if(ft.value)Ct.push(ft.value)}for(let Nt of Ct){if(br(Nt)>Ax(e,te.name)+0.0000001)continue;let Ht=0;for(let vt of d.values()){if(vt.route[0].layer!==rt)continue;if(C.firstConflict(Nt,vt.route,(xe+vt.route[0].width)/2+p-0.00000001))Ht++}let Tt=br(Nt)+Ht*br(te.pointsToConnect),et={score:Tt,trace:{type:"pcb_trace",pcb_trace_id:`bus_lane_${te.name}`,connection_name:te.name,source_trace_id:te.source_trace_id??te.name,route:Nt.map((vt)=>({...vt,route_type:"wire",layer:rt,width:xe}))}};if(x.add(te.name,[et.trace]),!dt||Tt<dt.score)dt=et}}if(!dt){if(!ke.length)return null;for(let rt of le){d.set(rt.connection_name,rt);let mt=Z.connections.find((lt)=>lt.name===rt.connection_name);for(let lt of mt.pointsToConnect)lt.layer=rt.route[0].layer}T.push(Z),i?.(U+1,t.length-d.size),yield[...o,...d.values()];continue e}for(let rt of te.pointsToConnect)rt.layer=dt.trace.route[0].layer;x.add(te.name,[dt.trace]),d.set(te.name,dt.trace)}let J=x.select(b,I);if(J){d.clear();for(let Z of J){d.set(Z.connection_name,Z);let te=t.find((ie)=>ie.name===Z.connection_name);for(let ie of te.pointsToConnect)ie.layer=Z.route[0].layer}}let ee=new Set,se=[...d.values()];for(let Z=0;Z<se.length;Z++)for(let te=0;te<Z;te++){let ie=se[Z],le=se[te],ue=ie.route[0].layer;if(ue!==le.route[0].layer)continue;let de=(ie.route[0].width+le.route[0].width)/2+p,me=C.firstConflict(ie.route,le.route,de-0.00000001);if(me){let[Ae,xe]=me;ee.add(ie.connection_name),ee.add(le.connection_name),_.get(ue).penalizeIntersection(u.get(ue),ie.route[Ae-1],ie.route[Ae],le.route[xe-1],le.route[xe],de*1.25,!0)}}if(ee.size)for(let Z of g){if(Z===X||!Z.connections.some((te)=>ee.has(te.name)))continue;for(let te of Z.connections)d.delete(te.name);if(!T.includes(Z))T.push(Z)}if(d.size>N)N=d.size,D=U;let ne=t.length-d.size;if(ne>0&&ne<=3&&!h&&H<6&&U>=g.length*2&&U-O>=g.length*4&&t.every((Z)=>d.has(Z.name)||!A.has(Z.name))){H++,O=U;let Z=kXr(e,t,[...n,...M],[...d.values()],r,{deferRetainedSelfClearance:c,maxSubsetSize:5,maxSearches:64,maxSearchSteps:6000,maxLengths:y}),te=Z.next();try{while(!te.done)yield[...o,...d.values()],te=Z.next()}finally{if(!te.done)Z.return(null)}if(te.value){d.clear();for(let ie of te.value)d.set(ie.connection_name,ie);ne=0}}if(ne>0&&ne<=3&&!h&&V<2&&U>=g.length*(e.buses?.length?8+V*4:2+V*2)&&x.hasEveryUnit(b)){V++;let Z=DXr(e,[...n,...M],r,x,b,I,s),te=Z.next();try{while(!te.done)yield[...o,...d.values()],te=Z.next()}finally{if(!te.done)Z.return(null)}if(te.value){d.clear();for(let ie of te.value){d.set(ie.connection_name,ie);for(let le of t.find((ue)=>ue.name===ie.connection_name).pointsToConnect)le.layer=ie.route[0].layer}ne=0}}if(i?.(U+1,ne),yield[...o,...d.values()],ne)continue;let re=[...o,...d.values()];for(let Z of d.values()){if(Z.coupledSection)continue;let te=t.find((ue)=>ue.name===Z.connection_name),ie=r.get(te.name),le=new Di(e,te,ie,[...n,...re.flatMap(oi)]);Z.route=b2(Z.route,le).map((ue)=>({...ue,route_type:"wire",layer:te.pointsToConnect[0].layer,width:ie}))}return re}return null}function uat(e){if((e.buses?.length??0)<2)return null;let t=new Set([...(e.buses??[]).flatMap((r)=>r.connectionNames),...(e.differentialPairs??[]).flatMap((r)=>r.connectionNames)]);if(e.connections.some((r)=>!t.has(r.name)||r.pointsToConnect.some((i)=>i.layer!==r.pointsToConnect[0].layer)))return null;let n=[...new Set(e.connections.map((r)=>r.pointsToConnect[0].layer))];if(n.length<2)return null;let o=n.map((r)=>{let i=e.connections.filter((l)=>l.pointsToConnect[0].layer===r),s=new Set(i.map((l)=>l.name)),a=(e.buses??[]).filter((l)=>l.connectionNames.some((h)=>s.has(h))),c=(e.differentialPairs??[]).filter((l)=>l.connectionNames.some((h)=>s.has(h)));if(a.some((l)=>l.connectionNames.some((h)=>!s.has(h)))||c.some((l)=>l.connectionNames.some((h)=>!s.has(h)))||c.length>1)return null;return{...e,connections:i,buses:a,differentialPairs:c}});return o.every((r)=>r!==null)?o:null}function*HXr(e,t,n,o){let r=[];for(let i of e){let s=i.differentialPairs?.[0],a=i.connections.filter((h)=>!s?.connectionNames.includes(h.name)),c=null,l=Jk(i)?[0,5,1,4,2,3]:[0,1,2,3,4,5];for(let h of l){if(c)break;let d=[];if(s){let m=CL(i,s,t,{copper:[],penalty:0,variant:h}),A=m.next(),g=0;try{while(!A.done&&g++<12000)yield r,A=m.next()}finally{if(!A.done)m.return(null)}if(!A.done||!A.value)continue;d=A.value}if(!a.length){c=o(i,d);continue}let u=MG(i,a,t,d,n,void 0,new Map,()=>!1),_=u.next(),p=0;try{while(!_.done&&p++<12000)yield[...r,..._.value],_=u.next()}finally{if(!_.done)u.return(null)}if(_.done&&_.value){let m=iit(i,_.value,t),A=m.next(),g=0;try{while(!A.done&&g++<6000)yield[...r,..._.value],A=m.next()}finally{if(!A.done)m.return(!1)}if(!A.done||!A.value)continue;c=o(i,_.value)}}if(!c)return null;r.push(...c),yield r}return r}function*jCn(e,t,n=0){let o=new Set([...(e.buses??[]).flatMap((h)=>h.connectionNames),...(e.differentialPairs??[]).flatMap((h)=>h.connectionNames)]),r=uat({...e,connections:e.connections.filter((h)=>o.has(h.name))});if(!r||r.some((h)=>h.differentialPairs?.length!==1))return null;let i=fa(e),s=[],a=[];for(let h of r){let d=h.differentialPairs[0],u=!1;for(let _=0;_<6&&!u;_++){let p=CL(h,d,i,{copper:[],penalty:0,variant:(_+(typeof n==="number"?n:n[s.length]??0))%6}),m=p.next(),A=0;try{while(!m.done&&A++<8000)yield,m=p.next()}finally{if(!m.done)p.return(null)}if(!m.done||!m.value)continue;let g=j8e(h,m.value),f=g.map((j)=>j.route.slice(j.coupledSection[0],j.coupledSection[1]+1));if(f[0].length!==f[1].length)continue;let y=f[0].map((j,Y)=>({x:(j.x+f[1][Y].x)/2,y:(j.y+f[1][Y].y)/2})),x=f[0][0].width,C=d.traceGap??e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075,b=x+C,I=x+b,v=f[0][0].layer,P=(j,Y)=>{let X=Gn(j,Y),K=Math.min(X*0.95,x*5);return{x:j.x+(Y.x-j.x)*K/X,y:j.y+(Y.y-j.y)*K/X}},M=P(y[0],y[1]),B=P(y.at(-1),y.at(-2)),T=`pair_${d.connectionNames[0]}`,N=[-b/2,b/2].sort((j,Y)=>Gn(hf(y,j)[0],f[0][0])-Gn(hf(y,Y)[0],f[0][0])),D={name:T,nominalTraceWidth:I,pointsToConnect:[M,B].map((j)=>({...j,layer:v}))},L=[],H=[],V=[];for(let j=0;j<2;j++)for(let Y=0;Y<2;Y++){let X=g[j],K=f[j],J=Y?K.at(-1):K[0],ee=e.connections.find((ie)=>ie.name===X.connection_name).pointsToConnect[Y],se=`approach_${X.connection_name}_${Y}`;L.push({name:se,source_trace_id:X.connection_name,nominalTraceWidth:x,pointsToConnect:[ee,J]});let ne=hf(Y?[B,y.at(-1)]:[y[0],M],N[j]).map((ie)=>({...ie,route_type:"wire",layer:v,width:x})),re={type:"pcb_trace",pcb_trace_id:se,connection_name:T,source_trace_id:X.connection_name,route:ne};H.push(re);let[Z,te]=X.coupledSection;V.push({...re,route:Y?[...ne,...X.route.slice(te+1)]:[...X.route.slice(0,Z),...ne]})}let O=new Tl(new Di(e,D,I,[...i,...V.flatMap(oi)]),D.pointsToConnect[0],D.pointsToConnect[1]);try{let j=0;while(!O.solved&&!O.failed&&j++<4000)O.step(),yield;if(!O.solved)continue}finally{O.cancel()}let U=!e.buses?.some((j)=>d.connectionNames.some((Y)=>j.connectionNames.includes(Y)));s.push({rails:g,sections:f,center:y,width:x,envelope:I,offsets:N,connection:D,approaches:U?[]:L,pair:d}),a.push(...U?V:H),u=!0}if(!u)return null}let c=new Map(s.flatMap((h)=>h.pair.connectionNames.map((d)=>[d,h.connection.name]))),l={...e,obstacles:[...e.obstacles,...s.flatMap((h)=>h.connection.pointsToConnect.map((d)=>({shape:"circle",center:{x:d.x,y:d.y},width:h.envelope,height:h.envelope,layers:[d.layer],connectedTo:[h.connection.name,...h.pair.connectionNames]})))],connections:[...e.connections.filter((h)=>!c.has(h.name)),...s.map((h)=>h.connection),...s.flatMap((h)=>h.approaches)],differentialPairs:[],traces:[...e.traces??[],...a],buses:e.buses?.map((h)=>{let d=[...new Set(h.connectionNames.map((u)=>c.get(u)??u))];return{...h,connectionNames:[...d,...s.filter((u)=>d.includes(u.connection.name)).flatMap((u)=>u.approaches.map((_)=>_.name))]}})};return{input:e,local:l,transforms:s,layers:t,copper:fa(l),widths:new Map(l.connections.map((h)=>[h.name,e.buses?.find((d)=>d.connectionNames.includes(h.name))?.traceWidth??h.nominalTraceWidth??h.width??e.minTraceWidth]))}}function*cit(e,t,n={}){let{input:o,local:r,transforms:i}=e,s=fa(o),a=[...t],c=o.minTraceToPadEdgeClearance??o.defaultObstacleMargin??0.075,l=a.filter((h)=>o.connections.some((d)=>d.name===h.connection_name));for(let h of i){let{connection:d,center:u,width:_,envelope:p,offsets:m}=h,A=a.findIndex((x)=>x.connection_name===d.name);if(A<0)return null;let g=a[A].route[0].layer,f=a.filter((x,C)=>C!==A),y=null;for(let x of[0,_*6,_*10]){let C=[{x:d.pointsToConnect[0].x-u[0].x,y:d.pointsToConnect[0].y-u[0].y},{x:u.at(-1).x-d.pointsToConnect[1].x,y:u.at(-1).y-d.pointsToConnect[1].y}],b=new Di({...r},d,p,[...e.copper,...f.flatMap(oi)]),I=b.visible.bind(b),v=(O,U,j)=>(U.x-O.x)*j.x+(U.y-O.y)*j.y>0&&Math.abs((U.x-O.x)*j.y-(U.y-O.y)*j.x)<0.00000001;b.visible=(O,U)=>{for(let[j,Y]of d.pointsToConnect.entries()){let X=C[j],K={x:-X.x,y:-X.y};if(Gn(O,Y)<0.00000001&&!v(O,U,j?K:X))return!1;if(Gn(U,Y)<0.00000001&&!v(O,U,j?X:K))return!1}return I(O,U)};let P=d.pointsToConnect.map((O,U)=>{let j=C[U],Y=(U?-1:1)*x/Math.hypot(j.x,j.y);return{...O,x:O.x+Y*j.x,y:O.y+Y*j.y}});if(x&&(!b.pathVisible([d.pointsToConnect[0],P[0]])||!b.pathVisible([P[1],d.pointsToConnect[1]])))continue;let M=new Tl(b,P[0],P[1],[],4,void 0,{allTerminalAttachments:!0}),B=null;try{let O=0;while(!M.solved&&!M.failed&&O++<1000)M.step(),yield;if(M.solved)B=b2(M.result,b)}finally{M.cancel()}if(!B)continue;if(x)B=[d.pointsToConnect[0],...B,d.pointsToConnect[1]];if(!ml(B,p+c))continue;let T={...a[A],route:B.map((O)=>({...O,route_type:"wire",layer:g,width:p}))},N={...T,route:T1([u[0],...B,u.at(-1)]).map((O)=>({...O,route_type:"wire",layer:g,width:p}))},D={...r,connections:r.connections.map((O)=>O.name===d.name?{...O,pointsToConnect:[u[0],u.at(-1)].map((U)=>({...U,layer:g}))}:O)},L=uL(D,[N],[...s,...f.filter((O)=>!h.approaches.some((U)=>U.name===O.connection_name)).flatMap(oi)],2)[0],H=FXr(h,L,a);if(!H)continue;let V=[...s,...H.flatMap(oi)];if(h.approaches.length&&H.some((O)=>!new Di(o,o.connections.find((U)=>U.name===O.connection_name),_,V).pathVisible(O.route)))continue;if(H.some((O)=>!ml(O.route.slice(O.coupledSection[0],O.coupledSection[1]+1),_+c)))continue;a[A]=T,y=H;break}if(!y)return null;l.push(...y)}for(let h of o.connections){let d=l.find((u)=>u.connection_name===h.name);if(!d){if(n.allowPartial)continue;return null}for(let u of h.pointsToConnect)u.layer=d.route[0].layer}return l}function FXr(e,t,n){let{width:o,offsets:r}=e,i=t.route[0].layer,s=[];for(let[a,c]of e.rails.entries()){let[l,h]=c.coupledSection,d=n.find((p)=>p.connection_name===`approach_${c.connection_name}_0`)?.route??(e.approaches.length?void 0:c.route.slice(0,l+1)),u=n.find((p)=>p.connection_name===`approach_${c.connection_name}_1`)?.route.toReversed()??(e.approaches.length?void 0:c.route.slice(h));if(!d||!u)return null;let _=hf(t.route,r[a]).map((p)=>({...p,route_type:"wire",layer:i,width:o}));if(Gn(d.at(-1),_[0])>0.00000001||Gn(u[0],_.at(-1))>0.00000001)return null;s.push({...c,curvedSegments:e.approaches.length?[]:c.curvedSegments?.flatMap((p)=>p<=l?[p]:p>h?[p+_.length-(h-l+1)]:[]),route:[...d.slice(0,-1),..._,...u.slice(1)],coupledSection:[d.length-1,d.length+_.length-2]})}return s}function KCn(e,t){let n=[...t],o=fa(e),r=e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075;for(let i of e.differentialPairs??[]){let s=i.connectionNames.map((A)=>n.findIndex((g)=>g.connection_name===A)),a=s.map((A)=>n[A]);if(a.some((A)=>!A?.coupledSection||A.curvedSegments?.some((g)=>g>A.coupledSection[0]&&g<=A.coupledSection[1])))continue;let c=a.map((A)=>A.route.slice(A.coupledSection[0],A.coupledSection[1]+1));if(c[0].length!==c[1].length)continue;let l=c[0][0].width,h=(l+(i.traceGap??r))/2,d=c[0].map((A,g)=>({x:(A.x+c[1][g].x)/2,y:(A.y+c[1][g].y)/2})),u=[-h,h].sort((A,g)=>Gn(hf(d,A)[0],c[0][0])-Gn(hf(d,g)[0],c[0][0])),_=(A)=>a.map((g,f)=>{let[y,x]=g.coupledSection,C=hf(A,u[f]).map((I)=>({...I,route_type:"wire",layer:c[f][0].layer,width:l})),b=C.length-(x-y+1);return{...g,route:[...g.route.slice(0,y),...C,...g.route.slice(x+1)],coupledSection:[y,x+b],curvedSegments:g.curvedSegments?.map((I)=>I>x?I+b:I)}}),p=n.filter((A,g)=>!s.includes(g)).flatMap(oi),m=a;for(let A=1;A+1<d.length;A++){let[g,f,y]=d.slice(A-1,A+2),x=Gn(g,f),C=Gn(f,y);if(Math.min(x,C)<0.00000001)continue;let b={x:(f.x-g.x)/x,y:(f.y-g.y)/x},I={x:(y.x-f.x)/C,y:(y.y-f.y)/C},v=b.x*I.x+b.y*I.y;if(v>Math.SQRT1_2-0.00000001)continue;for(let P=0;P<10;P++){let M=Math.min(l*10,x/2,C/2)/2**P,B={x:f.x-b.x*M,y:f.y-b.y*M},T={x:f.x+I.x*M,y:f.y+I.y*M},N=Math.sign(b.x*I.y-b.y*I.x),D=(Math.SQRT2-1)*M,L={x:B.x+(b.x-N*b.y)*Math.SQRT1_2*D,y:B.y+(b.y+N*b.x)*Math.SQRT1_2*D},H=v<-0.1?[B,L,T]:[B,T],V=[...d.slice(0,A),...H,...d.slice(A+1)],O=_(V);if(O.some((j,Y)=>ml(m[Y].route,l+r)&&!ml(j.route,l+r)))continue;let U=[...o,...p,...O.flatMap(oi)];if(O.some((j)=>!new Di(e,e.connections.find((Y)=>Y.name===j.connection_name),l,U).pathVisible(j.route)))continue;if(pL({...e,differentialPairs:[i]},O).some((j)=>!j.matched))continue;d=V,m=O,A+=H.length-1;break}}s.forEach((A,g)=>{n[A]=m[g]})}return n}function $Cn(e,t,n=fa(e)){let o=[...t],r=e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075,i=32;for(let s of e.differentialPairs??[]){let a=s.connectionNames.map((m)=>o.findIndex((A)=>A.connection_name===m)),c=a.map((m)=>o[m]);if(c.some((m)=>!m?.coupledSection))continue;let l=c.map((m)=>m.route.slice(m.coupledSection[0],m.coupledSection[1]+1)),h=l[0][0].width;if(l[0].length!==l[1].length||l.flat().some((m)=>m.route_type!=="wire"||m.width!==h||m.layer!==l[0][0].layer))continue;let d=l[0].map((m,A)=>({x:(m.x+l[1][A].x)/2,y:(m.y+l[1][A].y)/2})),u=(h+(s.traceGap??r))/2,_=[-u,u].sort((m,A)=>Gn(hf(d,m)[0],l[0][0])-Gn(hf(d,A)[0],l[0][0])),p=o.filter((m,A)=>!a.includes(A)).flatMap(oi);for(let m=1;m+2<d.length;m++){if(c.some((J)=>J.curvedSegments?.some((ee)=>ee>=J.coupledSection[0]+m&&ee<=J.coupledSection[0]+m+2)))continue;let[A,g,f,y]=d.slice(m-1,m+3),x=Gn(A,g),C=Gn(f,y);if(Math.min(x,C)<0.00000001)continue;let b={x:(g.x-A.x)/x,y:(g.y-A.y)/x},I={x:(y.x-f.x)/C,y:(y.y-f.y)/C};if(b.x*I.x+b.y*I.y>-0.99999999)continue;let v={x:-b.y,y:b.x},P=(f.x-g.x)*v.x+(f.y-g.y)*v.y,M=Math.sign(P),B=Math.abs(P)/2;if(B<u/Math.cos(Math.PI/64)+(h+r)/2+0.00000001)continue;let T=(g.x-f.x)*b.x+(g.y-f.y)*b.y,N=Math.max(0,T),D=Math.max(0,-T);if(N>=x-0.00000001||D>=C-0.00000001)continue;let L={x:g.x-b.x*N,y:g.y-b.y*N},H={x:f.x+I.x*D,y:f.y+I.y*D},V={x:L.x+v.x*B*M,y:L.y+v.y*B*M},O=Math.atan2(L.y-V.y,L.x-V.x),U=Array.from({length:33},(J,ee)=>({x:V.x+B*Math.cos(O+M*Math.PI*ee/32),y:V.y+B*Math.sin(O+M*Math.PI*ee/32)}));U[0]=L,U[32]=H;let j=[...d.slice(0,m),...U,...d.slice(m+2)],Y=31,X=c.map((J,ee)=>{let[se,ne]=J.coupledSection,re=hf(j,_[ee]).map((Z)=>({...Z,route_type:"wire",layer:l[ee][0].layer,width:h}));return re[0]={...J.route[se]},re[re.length-1]={...J.route[ne]},{...J,route:[...J.route.slice(0,se),...re,...J.route.slice(ne+1)],coupledSection:[se,ne+Y],curvedSegments:[...(J.curvedSegments??[]).map((Z)=>Z>se+m+1?Z+Y:Z),...Array.from({length:32},(Z,te)=>se+m+te+1)].sort((Z,te)=>Z-te)}}),K=[...n,...p,...X.flatMap(oi)];if(X.some((J)=>!ml(J.route,h+r)||!new Di(e,e.connections.find((ee)=>ee.name===J.connection_name),h,K).pathVisible(J.route)))continue;if(pL({...e,differentialPairs:[s]},X).some((J)=>!J.matched))continue;a.forEach((J,ee)=>{o[J]=X[ee]});break}}return o}function*tZ(e,t,n,o,r=new Map,i={}){let s=0,a=e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075;function*c(h,d,u){if(++s>(i.maxSearches??200))return null;let _={...h,pointsToConnect:h.pointsToConnect.map((g)=>({...g,layer:u}))},p=o.get(h.name)??e.minTraceWidth,m=new Di(e,_,p,[...n,...d.flatMap(oi)]),A=new Tl(m,_.pointsToConnect[0],_.pointsToConnect[1]);try{let g=0;while(!A.solved&&!A.failed&&g++<1000)A.step(),yield;if(!A.solved)return null;let f=i.requireSelfClear?b2(A.result,m):A.result;if(i.requireSelfClear&&!ml(f,p+a))return null;return{type:"pcb_trace",pcb_trace_id:h.name,connection_name:h.name,source_trace_id:h.source_trace_id,route:f.map((y)=>({...y,route_type:"wire",layer:u,width:p}))}}finally{A.cancel()}}function*l(h,d,u=0,_=new Set){if(!h.length)return d;if(s>=(i.maxSearches??200))return null;let p=h[0],m=r.get(p.name)??[p.pointsToConnect[0].layer];for(let A of m){let g=yield*c(p,d,A);if(!g)continue;let f=yield*l(h.slice(1),[...d,g],u,new Set([..._,p.name]));if(f)return f}if(u>=(i.maxDepth??5))return null;for(let A of d){if(A.coupledSection||!A.connection_name||_.has(A.connection_name)||!m.includes(A.route[0].layer))continue;let g=e.connections.find((f)=>f.name===A.connection_name);if(!g)continue;for(let f of m){let y=d.filter((b)=>b!==A),x=yield*c(p,y,f);if(!x)continue;let C=yield*l([...h.slice(1),g],[...y,x],u+1,new Set([..._,p.name]));if(C)return C}}return null}return yield*l(e.connections.filter((h)=>!t.some((d)=>d.connection_name===h.name)),t)}function*qCn(e,t){let{input:n,layers:o,transforms:r}=e,i=fa(n),s=n.minTraceToPadEdgeClearance??n.defaultObstacleMargin??0.075,a=structuredClone(t),c=new Set,l=new Map(n.connections.map((g)=>[g.name,n.buses?.find((f)=>f.connectionNames.includes(g.name))?.traceWidth??g.nominalTraceWidth??g.width??n.minTraceWidth]));for(let g of a){if(g.coupledSection)continue;if(!(yield*iit(n,[g],[...i,...a.filter((y)=>y!==g).flatMap(oi)])))c.add(g)}for(let g of a){if(!g.coupledSection)continue;for(let v of[0,1]){let[P,M]=g.coupledSection,B=v?g.route.slice(M):g.route.slice(0,P+1),T=v?g.route.slice(0,M):g.route.slice(P+1),N={...g,coupledSection:void 0,curvedSegments:void 0,route:B},D={...n.connections.find((O)=>O.name===g.connection_name),pointsToConnect:[B[0],B.at(-1)]},L={...n,connections:[D]},H=[...i,...a.filter((O)=>O!==g).flatMap(oi),...oi({...g,connection_name:"reserved_other_approach",source_trace_id:void 0,route:T})];if(yield*iit(L,[N],H)){if(N.route!==B){let O=N.route.length-B.length;g.curvedSegments=g.curvedSegments?.flatMap((U)=>v?U<=M?[U]:[]:U>P?[U+O]:[])}if(g.route=v?[...g.route.slice(0,M),...N.route]:[...N.route,...g.route.slice(P+1)],!v)g.coupledSection=[N.route.length-1,M+N.route.length-B.length]}}let[f,y]=g.coupledSection,x=g.route[0].width,C=new Di(n,n.connections.find((v)=>v.name===g.connection_name),x,[...i,...a.flatMap(oi)]),b=g.curvedSegments?.some((v)=>v<=f)?g.route.slice(0,f+1):b2(g.route.slice(0,f+1),C),I=g.curvedSegments?.some((v)=>v>y)?g.route.slice(y):b2(g.route.slice(y),C);g.curvedSegments=g.curvedSegments?.map((v)=>v>f?v+b.length-(f+1):v),g.route=[...b.slice(0,-1),...g.route.slice(f,y+1),...I.slice(1)].map((v)=>({...v,route_type:"wire",width:x,layer:g.route[0].layer})),g.coupledSection=[b.length-1,b.length+y-f-1]}let h=yield*tZ(n,a.filter((g)=>!c.has(g)),i,l,o,{requireSelfClear:!0,maxSearches:1000});if(!h)return null;let d=$Cn(n,KCn(n,h),i),u=(g)=>br(g.route)+C2(n,g.connection_name);for(let g of r){let f=g.pair.connectionNames.map((v)=>d.find((P)=>P.connection_name===v)),y=f.map((v)=>{let P=g.rails.find((H)=>H.connection_name===v.connection_name),[M,B]=P.coupledSection,[T,N]=v.coupledSection,D=v.route.slice(T,N+1),L=D.length-(B-M+1);return{...v,route:[...P.route.slice(0,M),...D,...P.route.slice(B+1)],coupledSection:[M,M+D.length-1],curvedSegments:[...(P.curvedSegments??[]).flatMap((H)=>H<=M?[H]:H>B?[H+L]:[]),...(v.curvedSegments??[]).filter((H)=>H>T&&H<=N).map((H)=>H+M-T)]}});if(Math.abs(u(y[0])-u(y[1]))>=Math.abs(u(f[0])-u(f[1]))-0.00000001)continue;let x=[...i,...d.filter((v)=>v.coupledSection&&!f.includes(v)).flatMap(oi),...y.flatMap(oi)];if(y.some((v)=>!ml(v.route,v.route[0].width+s)||!new Di(n,n.connections.find((P)=>P.name===v.connection_name),v.route[0].width,x).pathVisible(v.route)))continue;let b=d.map((v)=>y.find((P)=>P.connection_name===v.connection_name)??v).filter((v)=>v.coupledSection||y.every((P)=>new Di(n,n.connections.find((M)=>M.name===P.connection_name),P.route[0].width,oi(v)).pathVisible(P.route))),I=yield*tZ(n,b,i,l,o,{requireSelfClear:!0,maxSearches:200});if(I)d=I}let _=d.filter((g)=>g.coupledSection),p=d.filter((g)=>g.coupledSection||_.every((f)=>new Di(n,n.connections.find((y)=>y.name===f.connection_name),f.route[0].width,oi(g)).pathVisible(f.route))),m=yield*tZ(n,p,i,l,o,{requireSelfClear:!0,maxSearches:1000});if(!m)return null;let A=m;for(let g of r.filter((f)=>!f.approaches.length)){let y=A.map((C)=>g.rails.find((b)=>b.connection_name===C.connection_name)??C).filter((C)=>C.coupledSection||g.rails.every((b)=>new Di(n,n.connections.find((I)=>I.name===b.connection_name),b.route[0].width,oi(C)).pathVisible(b.route))),x=yield*tZ(n,y,i,l,o,{requireSelfClear:!0,maxSearches:1000});if(!x)return null;A=x}for(let g of n.connections)for(let f of g.pointsToConnect)f.layer=A.find((y)=>y.connection_name===g.name).route[0].layer;return A}function*zXr(e,t){let n=yield*jCn(e,t);if(!n)return null;let{local:o,copper:r,widths:i}=n,s=MG(o,o.connections,r,[],i,void 0,t,()=>!1,!0),a=null,c=0;try{let h=s.next(),d=0;while(!h.done&&d++<200000){if(h.value.length>c){if(c=h.value.length,c>=o.connections.length-1){if(a=yield*tZ(o,h.value,r,i,t,{maxSearches:120}),a)break}}yield,h=s.next()}if(h.done)a=h.value}finally{s.return(null)}if(!a)return null;let l=yield*cit(n,a);if(!l)return null;return yield*qCn(n,l)}function OXr(e,t,n,o,r,i,s){let a=n.map((d)=>({...d,route:d.route.map((u)=>({...u}))})),c=r+i,l=(d,u)=>d.x*u.y-d.y*u.x,h=(d,u)=>({x:d.x-u.x,y:d.y-u.y});for(let d=0;d<2;d++){let u=a[d];for(let _=1;_+2<u.route.length;_++){if(u.coupledSection&&_+1>=u.coupledSection[0]&&_<=u.coupledSection[1])continue;let[p,m,A,g]=u.route.slice(_-1,_+3),f=Gn(m,A);if(f<4*c)continue;let y={x:(A.x-m.x)/f,y:(A.y-m.y)/f},x=a[1-d].route;for(let C=0;C+1<x.length;C++){let b=x[C],I=x[C+1],v=h(I,b);if(Math.abs(l(y,v))>0.0000001)continue;let P=l(y,h(b,m));if(Math.abs(P)<=c+0.0000001||Math.abs(P)>2*c)continue;let M=[b,I].map((O)=>(O.x-m.x)*y.x+(O.y-m.y)*y.y);if(Math.min(f,Math.max(...M))-Math.max(0,Math.min(...M))<4*c)continue;let B=P-Math.sign(P)*c,T={x:m.x-y.y*B,y:m.y+y.x*B},N=(O,U)=>{let j=l(U,y);if(Math.abs(j)<0.00000001)return null;let Y=l(h(T,O),y)/j;return{x:O.x+Y*U.x,y:O.y+Y*U.y}},D=N(p,h(m,p)),L=N(g,h(A,g));if(!D||!L||Gn(D,m)>2*c||Gn(L,A)>2*c)continue;let H={...A,x:A.x-y.x*(2*c+Math.abs(B))-y.y*B,y:A.y-y.y*(2*c+Math.abs(B))+y.x*B},V={...A,x:A.x-y.x*2*c,y:A.y-y.y*2*c};for(let O of[[{...m,...D},{...A,...L}],[{...m,...D},H,V,A]]){let U=(Y,X,K)=>(X.x-Y.x)*K.x+(X.y-Y.y)*K.y>0.0000000001;if(!U(p,O[0],h(m,p))||!U(O.at(-1),g,h(g,A))||!U(O[0],O.at(-1),y))continue;let j=[...u.route.slice(0,_),...O,...u.route.slice(_+2)];if(!ml(j,r+s))continue;if(!new Di(e,t[d],r,[...o,...oi(a[1-d])]).pathVisible(j))continue;if(u.route=j,u.coupledSection)u.coupledSection=u.coupledSection.map((Y)=>Y>_?Y+O.length-2:Y);_+=O.length-2;break}if(u.route[_]!==m)break}}}return a}function JCn(e,t,n,o,r,i,s=6){if(!Number.isFinite(s)||s<=0)throw Error("Pair corner trim must be a positive finite number of trace widths");let a=n.map((c)=>({...c,route:[...c.route]}));for(let c=0;c<2;c++){let l=a[c];for(let h=1;h<l.route.length-1;h++){if(l.curvedSegments?.includes(h)||l.curvedSegments?.includes(h+1))continue;if(l.coupledSection&&h>l.coupledSection[0]&&h<l.coupledSection[1])continue;let[d,u,_]=l.route.slice(h-1,h+2),p=Gn(d,u),m=Gn(u,_);if(p<0.00000001||m<0.00000001)continue;let A={x:(u.x-d.x)/p,y:(u.y-d.y)/p},g={x:(_.x-u.x)/m,y:(_.y-u.y)/m};if(Math.abs(A.x*g.x+A.y*g.y+Math.SQRT1_2)>0.000001)continue;let f=Math.sign(A.x*g.y-A.y*g.x),y=Math.min(r*s,p/2,m*0.8),x={...u,x:u.x-A.x*y,y:u.y-A.y*y},C=(Math.SQRT2-1)*y,b={...u,x:x.x+(A.x-f*A.y)*Math.SQRT1_2*C,y:x.y+(A.y+f*A.x)*Math.SQRT1_2*C},I={...u,x:u.x+g.x*y,y:u.y+g.y*y},v=[...l.route.slice(0,h),x,b,I,...l.route.slice(h+1)];if(!ml(v,r+i)||!new Di(e,t[c],r,[...o,...oi(a[1-c])]).pathVisible(v))continue;if(l.route=v,l.curvedSegments)l.curvedSegments=l.curvedSegments.map((P)=>P>h?P+2:P);if(l.coupledSection)l.coupledSection=l.coupledSection.map((P,M)=>P>h?P+2:P===h&&M===0?P+2:P);h+=2}}return a}function VXr(e,t,n,o,r,i,s,a){let c=n.map((h)=>({...h,route:[...h.route]})),l=r+i;for(let h=0;h<2;h++){let d=c[h],u=c[1-h];if(!d.coupledSection||!u.coupledSection)continue;let _=d.coupledSection[1]-1,p=u.coupledSection[1]-1;for(let m=d.coupledSection[1]+1;m<d.route.length-1;m++){let A=d.route[m],g=d.route[m+1],f=Gn(A,g);if(f<4*l)continue;let y={x:(g.x-A.x)/f,y:(g.y-A.y)/f};for(let x=u.coupledSection[1]+1;x<u.route.length-1;x++){let C=u.route[x],b=u.route[x+1],I=Gn(C,b);if(I<4*l||Math.abs((b.x-C.x)/I-y.x)>0.0000001||Math.abs((b.y-C.y)/I-y.y)>0.0000001)continue;let v=-(C.x-A.x)*y.y+(C.y-A.y)*y.x;if(Math.abs(Math.abs(v)-l)>0.0000001)continue;let P=(V)=>(V.x-A.x)*y.x+(V.y-A.y)*y.y;if(P(b)<f-0.0000001||P(C)>f-4*l)continue;let M;try{M=a(d.route.slice(_,m+2),v)}catch{continue}let B=u.route[p],T=u.route[p+1],N=T.x-B.x,D=T.y-B.y;if(Math.abs((M[0].x-B.x)*D-(M[0].y-B.y)*N)>0.0000001)continue;let L={x:M[1].x-M[0].x,y:M[1].y-M[0].y};if((M[1].x-B.x)*L.x+(M[1].y-B.y)*L.y<=0.0000000001)continue;M=M.slice(1);let H=[...u.route.slice(0,p+1),...M.map((V)=>({...u.route[0],...V})),...u.route.slice(Gn(M.at(-1),u.route[x+1])<0.00000001?x+2:x+1)];if(!ml(H,r+s)||!new Di(e,t[1-h],r,[...o,...oi(d)]).pathVisible(H))continue;return u.route=H,u.coupledSection=[u.coupledSection[0],p+M.length],d.coupledSection=[d.coupledSection[0],m+1],c}}}return n}var DY=(e,t)=>e.x*t.x+e.y*t.y,YXr=(e)=>{if(!e.coupledSection)return;let t=e.coupledSection[1];if(t<1||t+2>=e.route.length)return;let n=e.route[t-1],o=e.route[t],r=Gn(n,o);if(r<0.00000001)return;let i={x:(o.x-n.x)/r,y:(o.y-n.y)/r};for(let s=t;s+2<e.route.length;s++){let[a,c,l]=e.route.slice(s,s+3),h=Gn(a,c);if(h<0.00000001)return;let d={x:(c.x-a.x)/h,y:(c.y-a.y)/h};if(Gn(d,i)<0.0000001)continue;let u=Gn(c,l);if(u<0.00000001)return;let _={x:(l.x-c.x)/u,y:(l.y-c.y)/u};if(Math.abs(i.x*d.x+i.y*d.y-Math.SQRT1_2)>0.0000001||Gn(_,i)>0.0000001||e.curvedSegments?.some((p)=>p===s||p===s+1||p===s+2))return;return{index:s,direction:i,handedness:Math.sign(i.x*d.y-i.y*d.x)}}};function GXr(e,t,n,o,r,i,s,a){let c=n.map(YXr);if(!c[0]||!c[1]||c[0].handedness!==c[1].handedness||Gn(c[0].direction,c[1].direction)>0.0000001)return n;let l=c[0].direction,h=r+i,d=n.map((f,y)=>{let x=c[y],C=c[1-y],b=x.index;if(b<=f.coupledSection[1])return;let I=n[1-y],v=I.route[C.index],P=-(f.route[b].x-v.x)*l.y+(f.route[b].y-v.y)*l.x,M;try{M=a(I.route.slice(C.index-1,C.index+3),Math.sign(P)*h)}catch{return}let B=(DY(M[1],l)-DY(f.route[b],l)+(DY(M[2],l)-DY(f.route[b+1],l)))/2;if(Math.abs(B)<0.00000001||Gn(f.route[b-1],f.route[b])+B<=0.00000001||Gn(f.route[b+1],f.route[b+2])-B<=0.00000001)return;let T=f.route.map((N,D)=>D===b||D===b+1?{...N,x:N.x+l.x*B,y:N.y+l.y*B}:N);if(!ml(T,r+s)||!new Di(e,t[y],r,[...o,...oi(I)]).pathVisible(T))return;return{...f,route:T}});if(d.every((f)=>!f))return n;let u=[n,...d.flatMap((f,y)=>f?[n.map((x,C)=>C===y?f:x)]:[])].flatMap((f)=>f.flatMap((y,x)=>[y.route[c[x].index],y.route[c[x].index+1]]).map((y)=>DY(y,l))),_=Math.min(...u)-h,p=Math.max(...u)+h,m=(f)=>{let y=0;for(let x=0;x<2;x++){let C=f[x].route,b=f[1-x].route,I=c[x].index;for(let v=I-1;v<=I+1;v++){let P=C[v],M=C[v+1],B=DY(P,l),T=DY(M,l)-B;if(T<=0||B>p||B+T<_)continue;let N=Math.max(0,(_-B)/T),D=Math.min(1,(p-B)/T),L=Math.max(1,Math.ceil(Gn(P,M)*(D-N)*16/h));for(let H=0;H<=L;H++){let V=N+(D-N)*H/L,O={x:P.x+(M.x-P.x)*V,y:P.y+(M.y-P.y)*V},U=1/0;for(let j=1;j<b.length;j++)U=Math.min(U,$k(O,[b[j-1],b[j]]));y=Math.max(y,U-r)}}}return y},A=n,g=m(n);for(let f=0;f<2;f++){if(!d[f])continue;let y=n.map((C,b)=>b===f?d[f]:C),x=m(y);if(x<g-0.0000001)A=y,g=x}return A}function UXr(e,t,n){let o=[...t],r=e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075;for(let i of e.differentialPairs??[]){let s=i.connectionNames.map((A)=>o.findIndex((g)=>g.connection_name===A)),a=s.map((A)=>o[A]);if(a.some((A)=>!A?.coupledSection))continue;let c=i.connectionNames.map((A)=>e.connections.find((g)=>g.name===A)),l=[...n,...o.filter((A,g)=>!s.includes(g)).flatMap(oi)],h=a[0].route[0].width,d=i.traceGap??r,u=OXr(e,c,a,l,h,d,r),_=JCn(e,c,u,l,h,r),p=GXr(e,c,_,l,h,d,r,hf),m=VXr(e,c,p,l,h,d,r,hf);s.forEach((A,g)=>{o[A]=m[g]})}return o}function WXr(e,t,n,o){let r=[...t],i=e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075;for(let s of e.differentialPairs??[]){let a=s.connectionNames.map((u)=>r.findIndex((_)=>_.connection_name===u)),c=a.map((u)=>r[u]);if(c.some((u)=>!u?.coupledSection))continue;let l=s.connectionNames.map((u)=>e.connections.find((_)=>_.name===u)),h=[...n,...r.filter((u,_)=>!a.includes(_)).flatMap(oi)],d=JCn(e,l,c,h,c[0].route[0].width,i,o);a.forEach((u,_)=>{r[u]=d[_]})}return r}function l2n(e,t){let n=e.map(()=>new Set),o=e.map(()=>0),r=(c,l)=>{if(!n[c].has(l))n[c].add(l),o[l]++};for(let c=0;c<e.length;c++){let l=e[c];if(Math.abs(l.to-l.from)<0.00000001)continue;for(let h=0;h<e.length;h++){if(c===h)continue;let d=e[h],u=(l.width+d.width)/2+t,_=(p)=>p>Math.min(l.from,l.to)-u+0.00000001&&p<Math.max(l.from,l.to)+u-0.00000001;if(_(d.from))r(h,c);if(_(d.to))r(c,h)}}let i=e.map(()=>0),s=o.flatMap((c,l)=>c===0?[l]:[]),a=0;for(let c=0;c<s.length;c++){let l=s[c];a++;for(let h of n[l])if(i[h]=Math.max(i[h],i[l]+(e[l].width+e[h].width)/2+t),--o[h]===0)s.push(h)}return a===e.length?i:null}function uue(e,t){let n=(e.curvedSegments??[]).flatMap((r)=>r>0&&r<e.route.length?[[e.route[r-1],e.route[r]]]:[]);if(!n.length)return[];let o=new Set(e.curvedSegments);return t.slice(1).flatMap((r,i)=>{let s=t[i];if(n.some(([l,h])=>Gn(s,l)<0.0000001&&Gn(r,h)<0.0000001))return[i+1];let a=e.route.findIndex((l)=>Gn(l,s)<0.0000001),c=e.route.findIndex((l)=>Gn(l,r)<0.0000001);if(a<0||c<=a)return[];for(let l=a+1;l<=c;l++)if(!o.has(l)||gx(e.route[l-1],s,r)>0.0000000001||gx(e.route[l],s,r)>0.0000000001)return[];return[i+1]})}function ZCn(e){return e.map((t)=>{let[n,o]=t.coupledSection,r=t.route.map((i,s)=>s).filter((i)=>{if(i<=n||i>=o||t.curvedSegments?.includes(i)||t.curvedSegments?.includes(i+1))return!0;let s=t.route[i-1],a=t.route[i],c=t.route[i+1],l=Gn(s,a),h=Gn(a,c);return l<0.00000001||h<0.00000001||Math.abs((a.x-s.x)/l-(c.x-a.x)/h)>0.0000001||Math.abs((a.y-s.y)/l-(c.y-a.y)/h)>0.0000001});return{...t,route:r.map((i)=>t.route[i]),coupledSection:[r.indexOf(n),r.indexOf(o)],curvedSegments:t.curvedSegments?.map((i)=>r.indexOf(i)).filter((i)=>i>0)}})}function XXr(e,t){e=ZCn(e);let n;for(let a=e[0].coupledSection[0];a<e[0].coupledSection[1];a++){let c=e[0].route[a],l=e[0].route[a+1],h=Gn(c,l);if(h<0.00000001||e[0].curvedSegments?.includes(a+1))continue;let d={x:(l.x-c.x)/h,y:(l.y-c.y)/h},u=(_)=>_.x*d.x+_.y*d.y;for(let _=e[1].coupledSection[0];_<e[1].coupledSection[1];_++){let p=e[1].route[_],m=e[1].route[_+1],A=Gn(p,m);if(A<0.00000001||e[1].curvedSegments?.includes(_+1))continue;if(Math.abs((m.x-p.x)/A-d.x)>0.0000001||Math.abs((m.y-p.y)/A-d.y)>0.0000001)continue;if(Math.abs(Math.abs((p.x-c.x)*d.y-(p.y-c.y)*d.x)-t)>0.0000001)continue;let g=Math.max(u(c),u(p)),f=Math.min(u(l),u(m));if(f-g>0.00000001&&(!n||f-g>n.high-n.low))n={indices:[a,_],low:g,high:f,direction:d}}}if(!n)return null;let{indices:o,low:r,high:i,direction:s}=n;return e.map((a,c)=>{let l=o[c],h=a.route[l],d=a.route[l+1],u=(y)=>{let x=y-h.x*s.x-h.y*s.y;return{...h,x:h.x+x*s.x,y:h.y+x*s.y}},_=u(r),p=u(i),m=a.route.slice(0,l),A=a.route.slice(l+2);if(Gn(h,_)>0.00000001)m.push(h);if(Gn(d,p)>0.00000001)A.unshift(d);let g=[...m,_,p,...A],f=g.length-a.route.length;return{...a,route:g,coupledSection:[m.length,m.length+1],curvedSegments:a.curvedSegments?.map((y)=>y>l+1?y+f:y)}})}function jXr(e,t,n,o){let r=new Map;for(let l of e.obstacles){let h=l.circuitJsonMetadata?.pcb_port_id;if(h&&l.componentId)r.set(h,l.componentId)}let i=(l,h)=>{let d=h?l.route.at(-1):l.route[0],u=e.connections.find((g)=>g.name===l.connection_name),_=u?.pointsToConnect.slice().sort((g,f)=>Gn(d,g)-Gn(d,f))[0],p=_?.pcb_port_id??d.pcb_port_id,m=p?r.get(p):void 0;if(m)return m;let A=new Set([l.connection_name,l.source_trace_id,u?.source_trace_id,_?.pointId,_?.pcb_port_id].filter((g)=>!!g));return e.obstacles.filter((g)=>g.componentId&&g.connectedTo.some((f)=>A.has(f))).sort((g,f)=>Gn(d,g.center)-Gn(d,f.center))[0]?.componentId},s=fa(e).filter((l)=>l.a.x===l.b.x&&l.a.y===l.b.y),a=(l)=>{let h=1/0,d=-1/0;for(let u of l){let _=e.obstacles.filter((x)=>x.componentId===u);if(!_.length)continue;let p=_.map((x)=>{let C=(x.ccwRotationDegrees??0)*Math.PI/180,b=Math.abs(Math.cos(C))*x.width+Math.abs(Math.sin(C))*x.height,I=Math.abs(Math.sin(C))*x.width+Math.abs(Math.cos(C))*x.height;return{left:x.center.x-b/2,right:x.center.x+b/2,bottom:x.center.y-I/2,top:x.center.y+I/2}}),m=Math.min(...p.map((x)=>x.left)),A=Math.max(...p.map((x)=>x.right)),g=Math.min(...p.map((x)=>x.bottom)),f=Math.max(...p.map((x)=>x.top)),y=Math.max(e.minViaPadDiameter??0.3,..._.flatMap((x)=>[x.width,x.height]))*2;for(let x of[m,A])for(let C of[g,f])h=Math.min(h,n({x,y:C})),d=Math.max(d,n({x,y:C}));for(let x of s){let C=x.a;if(C.x<m-y||C.x>A+y||C.y<g-y||C.y>f+y)continue;h=Math.min(h,n(C)-x.radius),d=Math.max(d,n(C)+x.radius)}}return{min:h,max:d}},c=(l)=>new Set(t.map((h)=>i(h,l)).filter((h)=>!!h));return{start:a(c(!1)).max+o,end:a(c(!0)).min-o}}function h2n(e,t){let n=[];for(let o=1;o<e.length;o++){let r=e[o-1],i=e[o];if(!(r.x<=t&&i.x>t))continue;let s={x:t,y:r.y+(i.y-r.y)*(t-r.x)/(i.x-r.x)};n.push({before:[...e.slice(0,o),s],after:[s,...e.slice(o)],point:s})}return n.length===1?n[0]:void 0}function KXr(e,t,n,o){let r=T1(e.filter((s,a)=>a===0||Gn(s,e[a-1])>0.00000001)),i=[r[0]];for(let s=1;s<r.length-1;s++){if(r[s].x<n-0.00000001||r[s].x>o+0.00000001){i.push(r[s]);continue}let a=r[s-1],c=r[s],l=r[s+1],h=Gn(a,c),d=Gn(c,l),u={x:(c.x-a.x)/h,y:(c.y-a.y)/h},_={x:(l.x-c.x)/d,y:(l.y-c.y)/d},p=u.x*_.x+u.y*_.y;if(p<-0.000001)return null;if(p<0.7){let m=Math.min(t,h*0.4,d*0.4);i.push({x:c.x-u.x*m,y:c.y-u.y*m},{x:c.x+_.x*m,y:c.y+_.y*m})}else i.push(c)}return[...i,r.at(-1)]}function XJ(e,t,n,o="dogleg",r=!1){let i=j8e(e,structuredClone(t)),s=e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075,a=new Set(e.buses?.flatMap((h)=>h.connectionNames)),c=r?GCn(e,t):new Set,l=new Set(i.filter((h)=>a.has(h.connection_name)).map((h)=>h.route[0].layer));for(let h of l){let d=i.filter((P)=>P.route[0].layer===h);if(d.length<3)continue;let u=d[0].route[0],_=d[0].route.at(-1),p=Math.abs(_.y-u.y)>=Math.abs(_.x-u.x),m=Math.sign(p?_.y-u.y:_.x-u.x)||1,A=(P)=>p?{x:P.y*m,y:-P.x*m}:{x:P.x*m,y:P.y*m},g=(P)=>p?{x:-P.y*m,y:P.x*m}:{x:P.x*m,y:P.y*m},f=[],y=new Set;for(let P of d){if(y.has(P.connection_name))continue;let M=e.differentialPairs?.find((T)=>T.connectionNames.includes(P.connection_name)&&T.connectionNames.every((N)=>d.some((D)=>D.connection_name===N))),B=M?.connectionNames.map((T)=>d.find((N)=>N.connection_name===T));if(B?.every((T)=>T.coupledSection)){B=ZCn(B);let T=B.map((H)=>H.route.slice(H.coupledSection[0],H.coupledSection[1]+1));if(!(T[0].length===T[1].length&&[0,T[0].length-1].every((H)=>{let V=T[0][H],O=T[1][H],U=T[0][H===0?1:H-1],j=Gn(V,U);return j>0.00000001&&Math.abs(((O.x-V.x)*(U.x-V.x)+(O.y-V.y)*(U.y-V.y))/j)<0.0000001})&&T[0].slice(1).every((H,V)=>{let O=T[0][V],U=T[1][V],j=T[1][V+1],Y=Gn(O,H),X=Gn(U,j);return Y>0.00000001&&X>0.00000001&&Math.abs((H.x-O.x)/Y-(j.x-U.x)/X)<0.0000001&&Math.abs((H.y-O.y)/Y-(j.y-U.y)/X)<0.0000001}))){let H=XXr(B,P.route[0].width+(M.traceGap??s));if(!H)return null;B=H}let D=B.map((H)=>H.route.slice(H.coupledSection[0],H.coupledSection[1]+1));if(D[0].length!==D[1].length)return null;let L=D[0].map((H,V)=>A({x:(H.x+D[1][V].x)/2,y:(H.y+D[1][V].y)/2}));f.push({traces:B,path:L,width:2*P.route[0].width+(M.traceGap??s)}),B.forEach((H)=>y.add(H.connection_name))}else f.push({traces:[P],path:P.route.map(A),width:P.route[0].width}),y.add(P.connection_name)}let x=Math.max(...d.map((P)=>P.route[0].width)),C=Math.max(...f.map((P)=>P.path[0].x))+x*2,b=Math.min(...f.map((P)=>P.path.at(-1).x))-x*2,I=jXr(e,d,(P)=>A(P).x,Math.max(...f.map((P)=>P.width))/2+s);if(C=Math.max(C,I.start),b=Math.min(b,I.end),b-C<n*2)return null;let v;e:for(let P of[0,0.05,0.1,0.2]){let M=C+(b-C)*P,B=b-(b-C)*P,T=f.map((j)=>({channel:j,a:h2n(j.path,M),b:h2n(j.path,B)}));if(T.some((j)=>!j.a||!j.b))continue;if(T.sort((j,Y)=>j.a.point.y-Y.a.point.y),T.some((j,Y)=>Y>0&&j.b.point.y<T[Y-1].b.point.y))continue;let N=Math.min(...T.flatMap((j)=>[j.a.point.y,j.b.point.y])),D=Math.max(...T.flatMap((j)=>[j.a.point.y,j.b.point.y])),L=(N+D)/2,H=Math.floor(T.length/2),V=T.map((j,Y)=>L+(Y-(T.length-1)/2)*n),O=o==="interior"?l2n(T.map((j,Y)=>({from:j.a.point.y,to:V[Y],width:j.channel.width})),s):null,U=o==="interior"?l2n(T.map((j,Y)=>({from:j.b.point.y,to:V[Y],width:j.channel.width})),s):null;if(o==="interior"&&(!O||!U))continue;for(let j of o==="interior"?[1]:[1,2,3]){let Y=Math.max((D-N)/2+n,Math.ceil(T.length/2)*n)+j*x,X=[];for(let[se,ne]of[[-1,T.slice(0,H).toReversed()],[1,T.slice(H)]]){let re=ne.map((ie,le)=>(ne.length-1-le)*n);for(let ie=ne.length-2;ie>=0;ie--){let le=ne[ie].channel,ue=ne[ie+1].channel,de=ue.traces.some((xe)=>a.has(xe.connection_name)),me=[le,ue].some((xe)=>xe.traces.some((Me)=>c.has(Me.connection_name))),Ae=r?Math.max((le.width+ue.width)/2+s+x*0.2,me?n*2:de?n:0):n;if(r)re[ie]=re[ie+1]+Ae}let Z=Math.max(r?re[0]+n:Y,...ne.map((ie,le)=>Math.max(se*(ie.a.point.y-L),se*(ie.b.point.y-L))+re[le]+x*2)),te=ne.map(()=>0);for(let ie=ne.length-2;ie>=0;ie--)te[ie]=te[ie+1]+(ne[ie].channel.width+ne[ie+1].channel.width)/2+s+x*1.2;for(let[ie,le]of ne.entries()){let ue=M+te[ie],de=B-te[ie];if(de-ue<n)continue;let me=T.indexOf(le),Ae=o!=="dogleg"?L+(me-(T.length-1)/2)*n:L+se*(Z-re[ie]),xe=Math.abs(Ae-le.a.point.y),Me=Math.abs(Ae-le.b.point.y),Re=M+(O?O[me]:(Ae>le.a.point.y?T.length-1-me:me)*(x+s)),we=B-(U?U[me]:(Ae>le.b.point.y?T.length-1-me:me)*(x+s));if(o==="diagonal"&&xe+Me>=we-Re-4*x)continue;let _e=[...le.a.before,{x:Re,y:le.a.point.y},{x:Re+xe,y:Ae},{x:we-Me,y:Ae},{x:we,y:le.b.point.y},...le.b.after],ye=KXr(o==="diagonal"?_e:[...le.a.before,{x:o==="interior"?Re:ue,y:le.a.point.y},{x:o==="interior"?Re:ue,y:Ae},{x:o==="interior"?we:de,y:Ae},{x:o==="interior"?we:de,y:le.b.point.y},...le.b.after],x*1.5,M,B);if(!ye)continue;let Se=le.channel;if(Se.traces.length===1){let Ne=Se.traces[0];X.push({...Ne,curvedSegments:uue(Ne,ye.map(g)),route:ye.map((ke)=>({...g(ke),route_type:"wire",layer:Ne.route[0].layer,width:Ne.route[0].width}))})}else{let Ne=ye.map(g),ke=Se.traces,nt=Se.width-ke[0].route[0].width,dt=[-nt/2,nt/2].sort((rt,mt)=>Gn(hf(Ne,rt)[0],ke[0].route[ke[0].coupledSection[0]])-Gn(hf(Ne,mt)[0],ke[0].route[ke[0].coupledSection[0]]));for(let[rt,mt]of ke.entries()){let[lt,Ct]=mt.coupledSection,Nt=hf(Ne,dt[rt]);if(Gn(Nt[0],mt.route[lt])>0.0000001||Gn(Nt.at(-1),mt.route[Ct])>0.0000001)continue;X.push({...mt,coupledSection:[lt,lt+Nt.length-1],curvedSegments:uue(mt,[...mt.route.slice(0,lt),...Nt,...mt.route.slice(Ct+1)]),route:[...mt.route.slice(0,lt),...Nt.map((Ht)=>({...Ht,route_type:"wire",layer:mt.route[0].layer,width:mt.route[0].width})),...mt.route.slice(Ct+1)]})}}}}if(X.length!==d.length)continue;let K=i.map((se)=>X.find((ne)=>ne.connection_name===se.connection_name)??se),J=[...fa(e),...K.flatMap(oi)];if(X.filter((se)=>!new Di(e,e.connections.find((ne)=>ne.name===se.connection_name),se.route[0].width,J).pathVisible(se.route)||!ml(se.route,se.route[0].width+s)).length)continue;v=K;break e}}if(!v)return null;i=v}return i}function*$Xr(e,t,n=[]){let o=t.x-e.x,r=t.y-e.y,i=Math.abs(o),s=Math.abs(r),a=Math.sign(o),c=Math.sign(r),l=new Set(Array.from({length:9},(h,d)=>Math.abs(i-s)*d/8));for(let h of n){let d=i>=s?(h.x-e.x)*a-(h.y-e.y)*c:(h.y-e.y)*c-(h.x-e.x)*a;if(d>=0&&d<=Math.abs(i-s))l.add(d)}for(let h of l)yield T1(i>=s?[e,{x:e.x+a*h,y:e.y},{x:e.x+a*(h+s),y:t.y},t]:[e,{x:e.x,y:e.y+c*h},{x:t.x,y:e.y+c*(h+i)},t])}var qXr=(e)=>e.slice(1,-1).every((t,n)=>{let o=e[n],r=e[n+2],i=Gn(o,t)*Gn(t,r);return i<0.000000000001||((t.x-o.x)*(r.x-t.x)+(t.y-o.y)*(r.y-t.y))/i>=Math.SQRT1_2-0.00000001});function ebn(e,t){let n=structuredClone(t),o=fa(e);for(let r of n){if(r.coupledSection)continue;let i=e.connections.find((h)=>h.name===r.connection_name),s=r.route[0].width,a=new Di(e,i,s,[...o,...n.flatMap(oi)]),c=()=>{let h=new Uint32Array(r.route.length);for(let d of new Set(r.curvedSegments))h[d]=1;for(let d=1;d<h.length;d++)h[d]+=h[d-1];return h},l=c();for(let h=0;h<3;h++){let d=!1;for(let u=0;u<r.route.length-3;u++)for(let _=Math.min(r.route.length-1,u+70);_>=u+3;_--){if(l[_]!==l[u])continue;let p=br(r.route.slice(u,_+1)),m=!1;for(let A of $Xr(r.route[u],r.route[_],r.route.slice(u,_+1))){if(A.length>=_-u+1||Math.abs(br(A)-p)>0.00000001||!a.pathVisible(A))continue;if(!qXr([...r.route.slice(Math.max(0,u-1),u),...A,...r.route.slice(_+1,_+2)]))continue;let g=r.route[u],f=[...r.route.slice(0,u),...A.map((x)=>({...x,route_type:"wire",layer:g.layer,width:s})),...r.route.slice(_+1)];if(!ml(f,s/2+a.margin))continue;let y=A.length-(_-u+1);r.route=f,r.curvedSegments=r.curvedSegments?.map((x)=>x>_?x+y:x),l=c(),d=m=!0;break}if(m)break}if(!d)break}}return n}function JXr(e,t,n,o,r,i,s){let a=Gn(e,t),c=s+n/2,l=2*r+1;if(!Number.isFinite(a+n+o+s)||n<0||o<=0||s<=0||!Number.isInteger(r)||r<1||r>64||i!==1&&i!==-1||a<(4*r+2)*c-0.000000001)return null;let h=(t.x-e.x)/a,d=(t.y-e.y)/a,u=(f)=>{let y=[{x:0,y:0}],x=0;for(let I=0;I<l;I++){let v=c+(a-2*c)*I/(l-1);y.push({x:v,y:x}),x=I===l-1?0:I%2?-f:f,y.push({x:v,y:x})}y.push({x:a,y:0});let C=[[],[]],b=(I,v,P,M)=>{for(let B=0;B<2;B++){let T=(B===0?1:-1)*n/2,N=I-i*M*T,D=i*v+P*T,L={x:e.x+h*N-d*D,y:e.y+d*N+h*D};if(!C[B].length||Gn(C[B].at(-1),L)>0.0000000001)C[B].push(L)}};b(0,0,1,0);for(let I=1;I<y.length-1;I++){let v=y[I-1],P=y[I],M=y[I+1],B=Gn(v,P),T=Gn(P,M),N={x:(P.x-v.x)/B,y:(P.y-v.y)/B},D={x:(M.x-P.x)/T,y:(M.y-P.y)/T},L={x:P.x-N.x*c,y:P.y-N.y*c},H={x:L.x+D.x*c,y:L.y+D.y*c},V=N.x*D.y-N.y*D.x,O=Math.atan2(L.y-H.y,L.x-H.x);for(let U=0;U<=18;U++){let j=O+V*Math.PI/2*U/18;b(H.x+c*Math.cos(j),H.y+c*Math.sin(j),-V*Math.sin(j),V*Math.cos(j))}}return b(a,0,1,0),C},_=(4*r+2)*c*(36*Math.sin(Math.PI/72)-2),p=2*c;if(4*r*p+_>o+0.00000001)return null;let A=Math.max(p,(o-_)/(4*r)),g=u(A);return A=Math.max(p,A+(o-Math.min(...g.map((f)=>br(f)-a)))/(4*r)),u(A)}function tbn(e,t,n={}){let o={...e,buses:[]},r=fZ(e,t,sL(o,t),n),i=0,s=fa(e),a=(c)=>br(c.route)+C2(e,c.connection_name);for(let c of e.differentialPairs??[]){let l=c.connectionNames.map((f)=>r.findIndex((y)=>y.connection_name===f)),h=l.map((f)=>r[f]);if(h.some((f)=>!f.coupledSection))continue;let d=sL(e,r),u=Math.max(...h.map((f)=>d.get(f.connection_name)-a(f)));if(u<0.00000001)continue;let _=h[0].route[0].width,p=c.traceGap??e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075,m=_+p,A=e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075,g;for(let f of n.packMeanders?[!1,!0]:[!1]){if(g)break;for(let y=h[0].coupledSection[0];y<h[0].coupledSection[1]&&!g;y++){let x=h[0].route[y],C=h[0].route[y+1],b=Gn(x,C);if(b<_*8)continue;let I=(C.x-x.x)/b,v=(C.y-x.y)/b;for(let P=h[1].coupledSection[0];P<h[1].coupledSection[1]&&!g;P++){let M=h[1].route[P],B=h[1].route[P+1],T=Gn(M,B);if(T<_*8||Math.abs((B.x-M.x)/T-I)>0.000001||Math.abs((B.y-M.y)/T-v)>0.000001)continue;let N=-(M.x-x.x)*v+(M.y-x.y)*I;if(Math.abs(Math.abs(N)-m)>0.000001)continue;let D=(U)=>(U.x-x.x)*I+(U.y-x.y)*v,L=Math.max(0,D(M))+_*2,H=Math.min(b,D(B))-_*2;if(H-L<_*8)continue;let V=(U)=>({x:x.x+I*U-v*N/2,y:x.y+v*U+I*N/2});function*O(){if(!f)for(let U of[0.9,0.65,0.4])for(let j of n.packMeanders?Array.from({length:Math.max(1,Math.floor((H-L)*U/(4*(Math.max(_*1.2,A)+m/2))))},(Y,X)=>X+1).reverse():Array.from({length:16},(Y,X)=>X+1))for(let Y of[1,-1])for(let X of[JXr,WCn,xXr])yield{fraction:U,lobes:j,createLobes:X,side:Y};if(f)for(let U of[1,2,3])for(let j of[0.9,0.65,0.4])for(let Y of[1,-1])yield{fraction:j,lobes:U,createLobes:UCn,side:Y}}e:for(let{fraction:U,lobes:j,createLobes:Y,side:X}of O()){if(++i>(n.maxCandidates??1/0))throw Error("Coupled tuning candidate budget exhausted");let K=(H-L)*(1-U)/2,J=Y(V(L+K),V(H-K),m,u,j,X,Math.max(_*1.2,A));if(!J)continue;let ee=N>0?J.toReversed():J,se=h.map((re,Z)=>{let te=Z===0?y:P,ie=[...re.route.slice(0,te+1),...ee[Z],...re.route.slice(te+1)],le=ie.length-re.route.length;return{...re,coupledSection:[re.coupledSection[0],re.coupledSection[1]+le],curvedSegments:ie.slice(1).flatMap((ue,de)=>{let me=Math.abs(ue.x-ie[de].x),Ae=Math.abs(ue.y-ie[de].y);return Math.min(me,Ae)>0.00000001&&Math.abs(me-Ae)>0.00000001?[de+1]:[]}),route:ie.map((ue)=>({...ue,route_type:"wire",layer:re.route[0].layer,width:_}))}}),ne=[...s,...r.filter((re,Z)=>!l.includes(Z)).flatMap(oi),...se.flatMap(oi)];if(se.some((re,Z)=>!new Di(e,e.connections.find((te)=>te.name===re.connection_name),_,ne).pathVisible(re.route)||!ml(re.route,_+A)||a(re)<d.get(re.connection_name)-0.000001))continue;if(Math.abs(a(se[0])-a(se[1]))>c.lengthTolerance+0.000001)continue;g=se;break e}}}}if(!g)throw Error(`No shared tuning corridor for ${c.connectionNames.join(", ")}`);l.forEach((f,y)=>{r[f]=g[y]})}return fZ(e,r,sL(e,r),n)}function ZXr(e,t){let n=pL(e,t),o=[...e.traces??[],...t],r=(i)=>o.filter((s)=>s.connection_name===i||s.source_trace_id===i).flatMap((s)=>s.route.slice(1).flatMap((a,c)=>{let l=s.route[c];return l.route_type==="wire"&&a.route_type==="wire"&&l.layer===a.layer?[{a:l,b:a}]:[]}));return(e.differentialPairs??[]).filter((i)=>i.traceGap!==void 0||i.maxUncoupledLength!==void 0).map((i)=>{let s=i.connectionNames.map(r),a=i.traceGap??e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075,c=Math.max(0.002,a*0.1),l=s.map((d)=>{let u=new Set(d.map((_)=>_.a.layer));return new Map([...u].map((_)=>[_,new t0e(d.filter((p)=>p.a.layer===_).map((p)=>({...p,radius:p.a.width/2,layer:_,owners:[]})))]))}),h=s.map((d,u)=>{let _=0,p=0;for(let{a:m,b:A}of d){let g=Gn(m,A),f=Math.max(1,Math.ceil(g/(c/2)));p+=g;let y=l[1-u].get(m.layer),x=(C)=>y?.distanceToPoint(C,(b)=>gx(C,b.a,b.b)-(m.width+b.radius*2)/2,m.width/2)??1/0;for(let C=0;C<f;C++){let b=(C+0.5)/f,I={x:m.x+(A.x-m.x)*b,y:m.y+(A.y-m.y)*b};if(Math.abs(x(I)-a)+g/(2*f)>c)_+=g/f}}return{name:i.connectionNames[u],totalLengthMm:p,uncoupledLengthMm:_,coupledFraction:p?1-_/p:0}});return{connectionNames:i.connectionNames,conductors:h,maxUncoupledLengthMm:i.maxUncoupledLength??null,matched:n.find((d)=>d.connectionNames===i.connectionNames).matched&&(i.maxUncoupledLength===void 0||h.every((d)=>d.uncoupledLengthMm<=i.maxUncoupledLength+0.00000001))}})}var d2n={"0":"M0.301025 0.257813 L0.206593 0.283385 L0.122042 0.361307 L0.075923 0.474441 L0.064942 0.642221 L0.091296 0.78289 L0.159376 0.899463 L0.257104 0.961214 L0.344948 0.961214 L0.442678 0.899463 L0.510757 0.78289 L0.537111 0.642221 L0.526131 0.474441 L0.480012 0.361307 L0.39546 0.283385 L0.301025 0.257813","1":"M0.220426 0.40845 L0.381626 0.270996 L0.381626 0.948966","2":"M0.110409 0.39212 L0.125621 0.342293 L0.170571 0.295823 L0.244237 0.26431 L0.291518 0.257813 L0.373319 0.263799 L0.434683 0.290705 L0.468239 0.331966 L0.480292 0.379913 L0.479492 0.411806 L0.465088 0.465192 L0.402571 0.568988 L0.245134 0.766438 L0.07959 0.948045 L0.522462 0.948045","3":"M0.081606 0.345073 L0.119154 0.315633 L0.178996 0.284091 L0.255265 0.257813 L0.349133 0.263062 L0.43127 0.289348 L0.48994 0.336662 L0.525141 0.394491 L0.513407 0.457577 L0.466472 0.504892 L0.384334 0.541692 L0.290464 0.56272 L0.20833 0.573235 L0.290464 0.583749 L0.384334 0.610035 L0.466472 0.652092 L0.519274 0.709922 L0.531007 0.773007 L0.50754 0.841351 L0.454738 0.899179 L0.3726 0.946494 L0.310412 0.961214 L0.209503 0.959111 L0.127367 0.946494 L0.071046 0.929671","4":"M0.418494 0.270996 L0.048828 0.724199 L0.553224 0.724199 M0.414181 0.578167 L0.414181 0.94897","5":"M0.074951 0.270996 L0.074951 0.614701 L0.267655 0.5695 L0.405247 0.586502 L0.460002 0.617189 L0.498028 0.660731 L0.527101 0.779401 L0.513352 0.841049 L0.477274 0.889568 L0.406378 0.93463 L0.324445 0.958337 L0.247399 0.962139 L0.182516 0.949767 L0.130068 0.925508 L0.074951 0.875607 M0.074951 0.270996 L0.527101 0.270996","6":"M0.428549 0.257813 L0.341433 0.285053 L0.26073 0.312099 L0.192188 0.360182 L0.138902 0.410969 L0.098219 0.500422 L0.070249 0.584267 L0.067264 0.670716 L0.065164 0.756863 L0.087163 0.820973 L0.108168 0.861042 L0.157916 0.913131 L0.210981 0.948192 L0.29279 0.961214 L0.384548 0.956206 L0.456409 0.924151 L0.507262 0.881077 L0.5349 0.821975 L0.537111 0.771889 L0.521634 0.718798 L0.498418 0.67372 L0.463042 0.636657 L0.414398 0.613617 L0.34696 0.598591 L0.28284 0.595587 L0.215403 0.605604 L0.145756 0.641665 L0.109274 0.678729 L0.064942 0.724006","7":"M0.071534 0.270996 L0.530519 0.270996 L0.495935 0.291702 L0.477752 0.305407 L0.435186 0.346112 L0.412067 0.374136 L0.388565 0.40796 L0.365315 0.448098 L0.342943 0.495062 L0.322081 0.549366 L0.303364 0.611524 L0.287416 0.68205 L0.270077 0.80465 L0.26253 0.94897","8":"M0.286761 0.257813 L0.210684 0.27162 L0.1414 0.305622 L0.092494 0.382125 L0.111513 0.450128 L0.16857 0.502193 L0.228345 0.539382 L0.377781 0.594635 L0.470161 0.645637 L0.52586 0.706203 L0.538087 0.792269 L0.506841 0.87621 L0.438915 0.927212 L0.339743 0.961214 L0.263666 0.959089 L0.174004 0.929337 L0.102003 0.881523 L0.063965 0.811395 L0.066682 0.741266 L0.102003 0.671139 L0.180797 0.608448 L0.259591 0.580822 L0.358762 0.548945 L0.456576 0.49688 L0.486463 0.446941 L0.487822 0.362999 L0.453859 0.302434 L0.384574 0.265245 L0.286761 0.257813","9":"M0.511026 0.437812 L0.491026 0.347812 L0.451026 0.297812 L0.391026 0.267812 L0.311026 0.257813 L0.231026 0.267812 L0.161026 0.297812 L0.111026 0.347812 L0.091026 0.417812 L0.111026 0.487812 L0.161026 0.537812 L0.231026 0.567812 L0.311026 0.577812 L0.391026 0.557812 L0.451026 0.517812 L0.491026 0.477812 L0.511026 0.437812 M0.510026 0.438812 L0.434026 0.636812 L0.381026 0.777812 L0.337026 0.879812 L0.301026 0.957812","!":"M0.301026 0.270996 L0.301026 0.749566 M0.251466 0.94897 L0.350587 0.94897",'"':"M0.16504 0.270996 L0.16504 0.523022 M0.437013 0.270996 L0.437013 0.523022","#":"M0.20958 0.282227 L0.146515 0.949754 M0.461844 0.282227 L0.398779 0.949754 M0.032999 0.526969 L0.600587 0.452796 M0.001465 0.82366 L0.569055 0.749486",$:"M0.307121 0.240234 L0.307121 1.083502 M0.490031 0.415915 L0.404676 0.328075 L0.23396 0.310507 L0.136407 0.398347 L0.099828 0.521324 L0.124213 0.591596 L0.197379 0.644299 L0.429061 0.697003 L0.502224 0.749708 L0.526613 0.837547 L0.477836 0.960526 L0.355897 1.013228 L0.197379 0.99566 L0.112021 0.942957 L0.07544 0.837547","'":"M0.301026 0.270996 L0.301026 0.523022","(":"M0.413087 0.241211 L0.372337 0.28347 L0.331589 0.334184 L0.290838 0.393349 L0.25009 0.460965 L0.219528 0.528584 L0.199153 0.5962 L0.188966 0.655364 L0.199153 0.714529 L0.219528 0.782146 L0.25009 0.849764 L0.290838 0.91738 L0.331589 0.976544 L0.372337 1.027258 L0.413087 1.069491",")":"M0.188966 0.241211 L0.229716 0.28347 L0.270466 0.334184 L0.311213 0.393349 L0.351964 0.460965 L0.382526 0.528584 L0.4029 0.5962 L0.413087 0.655364 L0.4029 0.714529 L0.382526 0.782146 L0.351964 0.849764 L0.311213 0.91738 L0.270466 0.976544 L0.229716 1.027258 L0.188966 1.069491","*":"M0.301026 0.458702 L0.301026 0.681942 M0.301026 0.458702 L0.520997 0.536834 M0.301026 0.458702 L0.439954 0.257813 M0.301026 0.458702 L0.162098 0.257813 M0.301026 0.458702 L0.081055 0.536834","+":"M0.042969 0.66845 L0.559083 0.66845 M0.301023 0.428223 L0.301023 0.908661",",":"M0.38672 0.852051 L0.215333 1.030661 L0.301025 1.119971","-":"M0.173829 0.686035 L0.428224 0.686035",".":"M0.362549 0.851074 L0.239503 0.851074","/":"M0.062501 1.035249 L0.539551 0.270996","<":"M0.559083 0.441895 L0.042969 0.66939 L0.042969 0.66939 L0.559083 0.896902","=":"M0.042969 0.545898 L0.559083 0.545898 M0.042969 0.80837 L0.559083 0.80837",">":"M0.042969 0.441895 L0.559083 0.66939 L0.559083 0.66939 L0.042969 0.896902",A:"M0.018067 0.94897 L0.290179 0.270996 L0.583986 0.94897 M0.155303 0.684521 L0.433548 0.684521",B:"M0.063965 0.94897 L0.063965 0.278953 L0.209356 0.270996 L0.342486 0.294394 L0.432179 0.37292 L0.418224 0.48773 L0.312686 0.549166 L0.084728 0.575531 L0.306377 0.589434 L0.468877 0.647456 L0.538087 0.736658 L0.5324 0.85202 L0.501247 0.902983 L0.42355 0.944398 L0.063965 0.94897",C:"M0.529054 0.419847 L0.498425 0.345196 L0.442238 0.292341 L0.33583 0.257813 L0.257199 0.268357 L0.187906 0.303748 L0.120243 0.385432 L0.072998 0.599844 L0.110073 0.815385 L0.165381 0.902183 L0.222883 0.942801 L0.334904 0.961214 L0.43253 0.937679 L0.504816 0.868999 L0.529054 0.772065",D:"M0.064454 0.94897 L0.071838 0.285078 L0.171217 0.270996 L0.247348 0.272633 L0.37101 0.306078 L0.462461 0.378304 L0.514748 0.475555 L0.535591 0.576392 L0.537599 0.652313 L0.528065 0.717381 L0.508562 0.772419 L0.445948 0.855695 L0.362356 0.90871 L0.225203 0.945862 L0.064454 0.94897",E:"M0.080078 0.270996 L0.080078 0.94897 M0.080078 0.270996 L0.521974 0.270996 M0.080078 0.609981 L0.389405 0.609981 M0.080078 0.94897 L0.521974 0.94897",F:"M0.086426 0.270996 L0.086426 0.94897 M0.091304 0.275607 L0.515626 0.275607 M0.091304 0.607677 L0.447344 0.607677",G:"M0.498034 0.284943 L0.374621 0.257813 L0.244219 0.268648 L0.160577 0.311997 L0.094556 0.398116 L0.056397 0.58404 L0.076752 0.785532 L0.120865 0.858197 L0.188947 0.916734 L0.271008 0.953591 L0.357069 0.961214 L0.43715 0.932047 L0.501262 0.858539 L0.545656 0.648611 L0.329595 0.648131",H:"M0.066895 0.270996 L0.066895 0.94897 M0.066895 0.595658 L0.530009 0.595658 M0.535157 0.270996 L0.535157 0.94897",I:"M0.301026 0.270996 L0.301026 0.94897",J:"M0.506839 0.270996 L0.507814 0.782193 L0.498468 0.846168 L0.480733 0.880789 L0.455864 0.90832 L0.426095 0.929408 L0.360746 0.954812 L0.302508 0.962139 L0.223573 0.953638 L0.16538 0.930312 L0.137072 0.907715 L0.116428 0.880312 L0.102822 0.848819 L0.095633 0.813947 L0.094239 0.776413",K:"M0.035401 0.270996 L0.035401 0.94897 M0.502258 0.316194 L0.035401 0.687823 M0.212484 0.582361 L0.566652 0.933903",L:"M0.07544 0.270996 L0.07544 0.94897 L0.526613 0.94897",M:"M0.042481 0.94897 L0.042481 0.270996 L0.301027 0.712492 L0.559571 0.270996 L0.559571 0.94897",N:"M0.067871 0.94897 L0.067871 0.270996 L0.534181 0.94897 L0.525031 0.270996",O:"M0.287293 0.961214 L0.19843 0.933567 L0.1172 0.849451 L0.057129 0.563945 L0.114348 0.350255 L0.18455 0.289392 L0.306101 0.257813 L0.42054 0.29572 L0.487543 0.365003 L0.544923 0.625294 L0.516366 0.789624 L0.465476 0.884596 L0.375084 0.949287 L0.287293 0.961214",P:"M0.070557 0.94897 L0.070557 0.28379 L0.20704 0.270996 L0.329134 0.278993 L0.408525 0.300514 L0.444022 0.317908 L0.500637 0.368929 L0.525796 0.423728 L0.531496 0.50384 L0.508934 0.554205 L0.473724 0.582043 L0.417577 0.604365 L0.336375 0.620372 L0.226014 0.629268 L0.082368 0.630258",Q:"M0.282435 1.050813 L0.195447 1.019646 L0.115933 0.924817 L0.057129 0.602943 L0.113139 0.362034 L0.18186 0.293418 L0.300844 0.257813 L0.412868 0.300553 L0.478457 0.37866 L0.534625 0.672103 L0.506671 0.857367 L0.456855 0.964437 L0.368371 1.037368 L0.282435 1.050813 M0.341225 0.815559 L0.544923 1.070653",R:"M0.034912 0.944112 L0.034912 0.288556 L0.227127 0.270996 L0.362038 0.276867 L0.443423 0.294907 L0.477644 0.309614 L0.505809 0.328757 L0.526616 0.352817 L0.544963 0.418061 L0.543241 0.475921 L0.524463 0.517817 L0.49076 0.546518 L0.444265 0.564799 L0.355195 0.578739 L0.047653 0.589627 M0.303054 0.617306 L0.56714 0.94897",S:"M0.483037 0.364333 L0.407613 0.267477 L0.22883 0.257813 L0.128623 0.327565 L0.087712 0.455539 L0.104656 0.518727 L0.168054 0.573307 L0.41928 0.617318 L0.503796 0.669342 L0.535157 0.759324 L0.493846 0.900055 L0.367668 0.961214 L0.205436 0.956661 L0.116711 0.907038 L0.066895 0.790334",T:"M0.022949 0.270996 L0.579103 0.270996 M0.309284 0.270996 L0.309284 0.94897",U:"M0.072022 0.270996 L0.07308 0.648875 L0.080372 0.75167 L0.099024 0.827813 L0.134786 0.885729 L0.181571 0.924023 L0.251464 0.95168 L0.339655 0.962139 L0.401553 0.951668 L0.45232 0.924086 L0.482701 0.891771 L0.495745 0.870529 L0.515699 0.81637 L0.525014 0.744626 L0.530031 0.272017",V:"M0.027832 0.270996 L0.320083 0.94897 L0.57422 0.270996",W:"M0 0.270996 L0.079799 0.940377 L0.285198 0.472884 L0.505255 0.94897 L0.602052 0.270996",X:"M0.009034 0.270996 L0.586805 0.94897 M0.593019 0.270996 L0.015246 0.94897",Y:"M0.018067 0.270996 L0.293132 0.574135 M0.583986 0.271959 L0.294954 0.57606 L0.305277 0.94897",Z:"M0.053711 0.270996 L0.548341 0.270996 L0.053711 0.94897 L0.548341 0.94897","[":"M0.404542 0.240234 L0.197511 0.240234 L0.197511 1.069424 L0.404542 1.069424","\\":"M0.062501 0.270996 L0.539551 1.035249","]":"M0.19751 0.240234 L0.404542 0.240234 L0.404542 1.069424 L0.19751 1.069424","^":"M0.035156 0.523931 L0.301024 0.270996 L0.566896 0.523931",_:"M0 1.160601 L0.602052 1.160601",a:"M0.527101 0.439941 L0.527101 0.973965 M0.527101 0.553824 L0.451366 0.477535 L0.376759 0.439941 L0.263722 0.439941 L0.187989 0.477535 L0.112255 0.553824 L0.074951 0.66881 L0.074951 0.745099 L0.112255 0.85898 L0.187989 0.93527 L0.263722 0.973965 L0.376759 0.973965 L0.451366 0.93527 L0.527101 0.85898",b:"M0.07666 0.240234 L0.07666 0.959985 M0.07666 0.582737 L0.151822 0.514237 L0.225865 0.480483 L0.338045 0.480483 L0.413211 0.514237 L0.488374 0.582737 L0.525392 0.685983 L0.525392 0.754485 L0.488374 0.856739 L0.413211 0.92524 L0.338045 0.959985 L0.225865 0.959985 L0.151822 0.92524 L0.07666 0.856739",c:"M0.512452 0.553823 L0.441624 0.477535 L0.371854 0.439941 L0.26614 0.439941 L0.195312 0.477535 L0.124486 0.553823 L0.0896 0.668808 L0.0896 0.745099 L0.124486 0.858979 L0.195312 0.93527 L0.26614 0.973965 L0.371854 0.973965 L0.441624 0.93527 L0.512452 0.858979",d:"M0.525392 0.240234 L0.525392 0.959985 M0.525392 0.582737 L0.450232 0.514237 L0.376189 0.480483 L0.264006 0.480483 L0.188844 0.514237 L0.11368 0.582737 L0.076661 0.685983 L0.076661 0.754485 L0.11368 0.856739 L0.188844 0.92524 L0.264006 0.959985 L0.376189 0.959985 L0.450232 0.92524 L0.525392 0.856739",e:"M0.059571 0.668808 L0.542482 0.668808 M0.542482 0.592521 L0.502641 0.516231 L0.461594 0.477535 L0.381914 0.439941 L0.261186 0.439941 L0.180299 0.477535 L0.099412 0.553823 L0.059571 0.668808 L0.059571 0.745099 L0.099412 0.858979 L0.180299 0.93527 L0.261186 0.973965 L0.381914 0.973965 L0.461594 0.93527 L0.542482 0.858979",f:"M0.512941 0.240234 L0.406984 0.240234 L0.301026 0.274346 L0.248047 0.374731 L0.248047 0.946817 M0.089112 0.476088 L0.459965 0.476088",g:"M0.525392 0.439941 L0.525392 0.989395 L0.488373 1.091918 L0.45023 1.126757 L0.376189 1.160601 L0.264004 1.160601 L0.188844 1.126757 L0.113681 1.058075 L0.076661 0.954555 M0.525392 0.542467 L0.45023 0.473786 L0.376189 0.439941 L0.264004 0.439941 L0.188844 0.473786 L0.113681 0.542467 L0.076661 0.645988 L0.076661 0.714669 L0.113681 0.817193 L0.188844 0.885875 L0.264004 0.920713 L0.376189 0.920713 L0.45023 0.885875 L0.525392 0.817193",h:"M0.092041 0.240234 L0.092041 0.946817 M0.092041 0.61058 L0.205937 0.509225 L0.282214 0.476086 L0.396109 0.476086 L0.47187 0.509225 L0.510011 0.61058 L0.510011 0.946817",i:"M0.261026 0.240234 L0.341026 0.240234 M0.300978 0.476089 L0.300978 0.946817",j:"M0.3853 0.240234 L0.447023 0.240234 M0.416159 0.465708 L0.416159 1.011689 L0.383887 1.108586 L0.252832 1.140264 L0.15503 1.108586",k:"M0.065186 0.240234 L0.065186 0.946817 M0.493824 0.476086 L0.065186 0.812323 M0.236758 0.677829 L0.536867 0.946817",l:"M0.301026 0.234863 L0.301026 0.946441",m:"M0.050538 0.439941 L0.050538 0.960796 M0.050538 0.588758 L0.114405 0.476607 L0.157178 0.439941 L0.236864 0.439941 L0.279637 0.476607 L0.32241 0.588758 L0.32241 0.960796 M0.32241 0.588758 L0.386281 0.476607 L0.428467 0.439941 L0.50874 0.439941 L0.551515 0.476607 L0.551515 0.960796",n:"M0.092041 0.439941 L0.092041 0.960796 M0.092041 0.588758 L0.205936 0.476607 L0.282216 0.439941 L0.396113 0.439941 L0.471871 0.476607 L0.510011 0.588758 L0.510011 0.960796",o:"M0.247175 0.439941 L0.175178 0.477535 L0.103186 0.553823 L0.066895 0.668808 L0.066895 0.745099 L0.103186 0.858979 L0.175178 0.93527 L0.247175 0.973965 L0.354874 0.973965 L0.426872 0.93527 L0.498866 0.858979 L0.535157 0.745099 L0.535157 0.668808 L0.498866 0.553823 L0.426872 0.477535 L0.354874 0.439941 L0.247175 0.439941",p:"M0.076904 0.439941 L0.076904 1.154244 M0.076904 0.541563 L0.151986 0.473487 L0.225944 0.439941 L0.338005 0.439941 L0.413087 0.473487 L0.488166 0.541563 L0.525148 0.644169 L0.525148 0.712246 L0.488166 0.813866 L0.413087 0.881942 L0.338005 0.916471 L0.225944 0.916471 L0.151986 0.881942 L0.076904 0.813866",q:"M0.525148 0.441895 L0.525148 1.156195 M0.525148 0.5435 L0.450067 0.47544 L0.376106 0.441895 L0.264042 0.441895 L0.188966 0.47544 L0.113885 0.5435 L0.076905 0.646108 L0.076905 0.714187 L0.113885 0.815809 L0.188966 0.883886 L0.264042 0.918418 L0.376106 0.918418 L0.450067 0.883886 L0.525148 0.815809",r:"M0.107422 0.439941 L0.107422 0.960796 M0.107422 0.663164 L0.155824 0.551014 L0.252626 0.476607 L0.349428 0.439941 L0.49463 0.439941",s:"M0.475556 0.477535 L0.400757 0.439941 L0.276092 0.439941 L0.176361 0.477535 L0.101563 0.553823 L0.101563 0.630112 L0.176361 0.668808 L0.301024 0.668808 L0.425688 0.745099 L0.50049 0.821387 L0.50049 0.897677 L0.425688 0.93527 L0.325956 0.973965 L0.201295 0.973965 L0.126496 0.93527 L0.101563 0.858979",t:"M0.246032 0.297852 L0.246032 0.826549 L0.301023 0.919323 L0.411011 0.950848 L0.520997 0.950848 M0.081055 0.515799 L0.466004 0.515799",u:"M0.092041 0.454102 L0.092041 0.826134 L0.13018 0.937211 L0.205936 0.974954 L0.319832 0.974954 L0.396113 0.937211 L0.510011 0.826134 M0.510011 0.454102 L0.510011 0.974954",v:"M0.048828 0.453125 L0.301026 0.961719 M0.553224 0.453125 L0.301026 0.961719",w:"M0 0.453125 L0.150512 0.961719 M0.301024 0.453125 L0.150512 0.961719 M0.301024 0.453125 L0.451539 0.961719 M0.602052 0.453125 L0.451539 0.961719",x:"M0.03711 0.453125 L0.564943 0.961719 M0.564943 0.453125 L0.03711 0.961719",y:"M0.084618 0.453125 L0.320232 0.921476 M0.55713 0.453125 L0.320232 0.921476 L0.242119 1.055289 L0.163369 1.122196 L0.084618 1.155166 L0.044922 1.155166",z:"M0.505373 0.452148 L0.09668 0.961651 M0.09668 0.452148 L0.505373 0.452148 M0.09668 0.961651 L0.505373 0.961651"},u2n={};for(let e in d2n){u2n[e]=[];let t=d2n[e].split("M").slice(1).map((n)=>n.split("L").map((o)=>o.trim().split(" ").map(parseFloat)));for(let n of t)for(let o=0;o<n.length-1;o++)u2n[e].push({x1:n[o][0],y1:1-n[o][1],x2:n[o+1][0],y2:1-n[o+1][1]})}var Joa=(()=>{let e=new Uint8Array(4),t=new Uint32Array(e.buffer);return!((t[0]=1)&e[0])})(),Zoa={int8:globalThis.Int8Array,uint8:globalThis.Uint8Array,int16:globalThis.Int16Array,uint16:globalThis.Uint16Array,int32:globalThis.Int32Array,uint32:globalThis.Uint32Array,uint64:globalThis.BigUint64Array,int64:globalThis.BigInt64Array,float32:globalThis.Float32Array,float64:globalThis.Float64Array},ejr=[];for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)if(t&1)t=3988292384^t>>>1;else t=t>>>1;ejr[e]=t}var tjr=new Uint16Array([255]),njr=new Uint8Array(tjr.buffer),era=njr[0]===255,ojr=new Uint16Array([255]),rjr=new Uint8Array(ojr.buffer),tra=rjr[0]===255,nra=new Uint8Array(0),ora=Uint8Array.of(137,80,78,71,13,10,26,10),rra=new TextDecoder("latin1"),{cos:ira,sin:sra,PI:ara}=Math,{tan:cra}=Math,lra=YZ(YCn(),1),nbn=class{MAX_ITERATIONS=1e5;solved=!1;failed=!1;iterations=0;progress=0;error=null;activeSubSolver;failedSubSolvers;timeToSolve;stats={};_setupDone=!1;getSolverName(){return this.constructor.name}setup(){if(this._setupDone)return;this._setup(),this._setupDone=!0}_setup(){}step(){if(!this._setupDone)this.setup();if(this.solved)return;if(this.failed)return;this.iterations++;try{this._step()}catch(e){throw this.error=`${this.getSolverName()} error: ${e}`,this.failed=!0,e}if(!this.solved&&this.iterations>=this.MAX_ITERATIONS)this.tryFinalAcceptance();if(!this.solved&&this.iterations>=this.MAX_ITERATIONS)this.error=`${this.getSolverName()} ran out of iterations`,this.failed=!0;if("computeProgress"in this)this.progress=this.computeProgress()}_step(){}getConstructorParams(){throw Error("getConstructorParams not implemented")}getOutput(){return null}solve(){let e=Date.now();while(!this.solved&&!this.failed)this.step();let t=Date.now();this.timeToSolve=t-e}visualize(){return{lines:[],points:[],rects:[],circles:[]}}tryFinalAcceptance(){}preview(){return{lines:[],points:[],rects:[],circles:[]}}};function ijr(e){if(!e.length)return[[]];let t=[],n=new Set,o=(l)=>{let h=l.map((d)=>d.name).join("\x00");if(!n.has(h))n.add(h),t.push(l)},r=e.reduce((l,h)=>({x:l.x+h.pointsToConnect[1].x-h.pointsToConnect[0].x,y:l.y+h.pointsToConnect[1].y-h.pointsToConnect[0].y}),{x:0,y:0}),i=(l)=>-r.y*l.pointsToConnect[0].x+r.x*l.pointsToConnect[0].y,s=[...e].sort((l,h)=>l.pointsToConnect[0].layer.localeCompare(h.pointsToConnect[0].layer)||i(l)-i(h)||l.name.localeCompare(h.name)),a=(l,h)=>Math.max(...e.map((d)=>d.pointsToConnect[l][h]))-Math.min(...e.map((d)=>d.pointsToConnect[l][h])),c=a(0,"x")<0.0000001&&a(1,"x")<0.0000001?"y":a(0,"y")<0.0000001&&a(1,"y")<0.0000001?"x":void 0;if(c){let l=e.reduce((h,d)=>h+d.pointsToConnect[1][c]-d.pointsToConnect[0][c],0);if(Math.abs(l)>0.0000001)o([...e].sort((h,d)=>h.pointsToConnect[0].layer.localeCompare(d.pointsToConnect[0].layer)||-Math.sign(l)*(h.pointsToConnect[0][c]-d.pointsToConnect[0][c])||h.name.localeCompare(d.name)))}o(s),o([...s].reverse()),o(e);for(let l of[1,0]){let h=e.reduce((_,p)=>({x:_.x+p.pointsToConnect[l].x/e.length,y:_.y+p.pointsToConnect[l].y/e.length}),{x:0,y:0}),d=(_)=>Math.atan2(_.pointsToConnect[l].y-h.y,_.pointsToConnect[l].x-h.x),u=[...e].sort((_,p)=>d(_)-d(p)||_.name.localeCompare(p.name));o(u),o([...u].reverse());for(let _ of["x","y"]){let p=_==="x"?"y":"x",m=[...e].sort((A,g)=>A.pointsToConnect[l][_]-g.pointsToConnect[l][_]||A.pointsToConnect[l][p]-g.pointsToConnect[l][p]);o(m),o([...m].reverse())}for(let _=1;_<u.length;_++){let p=[...u.slice(_),...u.slice(0,_)];o(p),o([...p].reverse())}}return t}function sjr(e,t,n){if(e.buses?.length&&ajr(e,t))return XJ(e,t,n);let o=t.reduce((u,_)=>u+_.route.at(-1).x-_.route[0].x,0),r=t.reduce((u,_)=>u+_.route.at(-1).y-_.route[0].y,0),i=Math.round(Math.atan2(r,o)/(Math.PI/4))*Math.PI/4,s=Math.cos(i),a=Math.sin(i),c=(u)=>({u:u.x*s+u.y*a,v:-u.x*a+u.y*s}),l=(u,_)=>({x:u*s-_*a,y:u*a+_*s}),h=[];for(let u of new Set(t.map((_)=>_.route[0].layer))){let _=t.filter((m)=>m.route[0].layer===u).sort((m,A)=>c(m.route[0]).v-c(A.route[0]).v),p=_.reduce((m,A)=>m+(c(A.route[0]).v+c(A.route.at(-1)).v)/2,0)/_.length;for(let[m,A]of _.entries()){let g=c(A.route[0]),f=c(A.route.at(-1)),y=p+(m-(_.length-1)/2)*n,x=Math.abs(y-g.v),C=Math.abs(y-f.v),b=f.u-g.u-x-C;if(b<1)return null;let I=b*0.15,v=T1([l(g.u,g.v),l(g.u+I,g.v),l(g.u+I+x,y),l(f.u-I-C,y),l(f.u-I,f.v),l(f.u,f.v)]);h.push({...A,route:v.map((P)=>({...P,route_type:"wire",layer:u,width:A.route[0].width}))})}}let d=[...fa(e),...h.flatMap(oi)];for(let u of h){let _=e.connections.find((p)=>p.name===u.connection_name);if(!new Di(e,_,u.route[0].width,d).pathVisible(u.route))return null}return t.map((u)=>h.find((_)=>_.connection_name===u.connection_name))}function ajr(e,t){let n=new Map;for(let r of e.obstacles){if(!r.componentId)continue;let i=(r.ccwRotationDegrees??0)*Math.PI/180,s=Math.abs(Math.cos(i))*r.width+Math.abs(Math.sin(i))*r.height,a=Math.abs(Math.sin(i))*r.width+Math.abs(Math.cos(i))*r.height,c=n.get(r.componentId)??{left:1/0,right:-1/0,bottom:1/0,top:-1/0,padSize:0};c.left=Math.min(c.left,r.center.x-s/2),c.right=Math.max(c.right,r.center.x+s/2),c.bottom=Math.min(c.bottom,r.center.y-a/2),c.top=Math.max(c.top,r.center.y+a/2),c.padSize=Math.max(c.padSize,r.width,r.height),n.set(r.componentId,c)}let o=e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075;return t.some((r)=>[r.route[0],r.route.at(-1)].some((i)=>[...n.values()].some((s)=>{let a=Math.max(e.minViaPadDiameter??0.3,s.padSize)/2+o;return i.x>=s.left-a&&i.x<=s.right+a&&i.y>=s.bottom-a&&i.y<=s.top+a})))}var cjr={top:"#dc2626",inner1:"#ca8a04",inner2:"#16a34a",inner3:"#0891b2",inner4:"#9333ea",inner5:"#ea580c",inner6:"#db2777",bottom:"#2563eb"},lde=(e)=>cjr[e]??"#64748b",A2=class e extends nbn{constructor(t,n={},o=new Map){super();this.terminalLayers=o,this.input=structuredClone(t),this.options=n,this.MAX_ITERATIONS=n.maxSearchIterations??200000}terminalLayers;input;options;phase="validate";failureCode=null;traces=[];widths=new Map;fixed=[];orders=[];attempt=0;lane=0;search;bestPartial=[];pairedTraces=[];pairIndex=0;congestionPass=0;conflictingLanes=0;independent;independentAttempted=!1;pairedNetwork;pairedNetworkAttempted=!1;negotiated;reservePackageExits;pairSearch;reportedRoutes;lengthStats;static forRefinement(t,n,o={}){let r=new e(t,o);if(r.initialize(),r.failed)return r;if(r.search instanceof Tl)r.search.cancel();return r.search=void 0,r.traces=structuredClone(n),r.phase="match",r}static forValidation(t,n,o={}){let r=e.forRefinement(t,n,o);if(!r.failed)r.phase="validate_output";return r}getConstructorParams(){return[this.input,this.options]}getOutput(){if(!this.solved)throw Error(this.error??"Bus lanes are not solved");return{...this.input,traces:[...this.input.traces??[],...this.traces]}}fail(t,n){if(this.failureCode=t,this.error=n,this.failed=!0,this.phase="failed",this.search instanceof Tl)this.search.cancel();this.pairedNetwork?.return(null),this.pairedNetwork=void 0,this.pairSearch?.return(null),this.negotiated?.return(null),this.pairSearch=void 0,this.negotiated=void 0}tryFinalAcceptance(){if(this.pairedNetwork?.return(null),this.pairedNetwork=void 0,this.independent?.return(null),this.independent=void 0,!this.solved)this.fail("search_budget_exhausted","Vector visibility search budget exhausted")}initialize(){let t=this.input;if(t.outline?.length){this.fail("unsupported_outline","Custom board outlines are unsupported");return}let n=new Set;for(let s of t.connections){if(n.has(s.name))throw Error(`Duplicate connection ${s.name}`);if(n.add(s.name),s.pointsToConnect.length!==2){this.fail("invalid_terminals",`${s.name}: exactly two terminals required`);return}let[a,c]=s.pointsToConnect;if(a.layers||c.layers||a.layer!==c.layer){this.fail("layer_change_required",`${s.name}: ${a.layer} → ${c.layer}; a common fixed layer is required; fanout handoff layers must agree`);return}if(t.allowedLayers&&!t.allowedLayers.includes(a.layer)){this.fail("forbidden_layer",`${s.name}: forbidden signal layer ${a.layer}`);return}if(![a.x,a.y,c.x,c.y].every(Number.isFinite))throw Error("Nonfinite terminal");this.widths.set(s.name,s.nominalTraceWidth??s.width??t.minTraceWidth)}for(let s of t.buses??[])if(s.maxLength!==void 0&&(!Number.isFinite(s.maxLength)||s.maxLength<0))throw Error("Invalid maximum bus length");for(let s of t.buses??[])if(s.minLength!==void 0&&(!Number.isFinite(s.minLength)||s.minLength<0||s.minLength>(s.maxLength??1/0)))throw Error("Invalid minimum bus length");for(let s of t.buses??[])if(s.maxLengthSkew!==void 0&&(!Number.isFinite(s.maxLengthSkew)||s.maxLengthSkew<0))throw Error("Invalid maximum length skew");for(let{names:s,tolerance:a}of hat(t)){if(!Number.isFinite(a)||a<0)throw Error("Invalid maximum length skew");if(s.length<1||new Set(s).size!==s.length||s.some((c)=>!n.has(c)))throw Error("Invalid length matching members")}let o=new Set;for(let s of t.buses??[])for(let a of s.connectionNames){let c=t.connections.find((d)=>d.name===a);if(!c||o.has(a))throw Error(`Missing or duplicated bus member ${a}`);o.add(a);let l=c.pointsToConnect[0].layer;if(s.allowedLayers&&!s.allowedLayers.includes(l))throw Error(`${s.busId}: forbidden layer ${l}`);let h=s.traceWidth;if(h!==void 0)this.widths.set(a,h)}for(let s of this.widths.values())if(!Number.isFinite(s)||s<=0||s<t.minTraceWidth)throw Error("Invalid trace width");this.fixed=fa(t);for(let s of t.connections)for(let a of s.pointsToConnect)this.fixed.push({a,b:a,layer:a.layer,radius:this.widths.get(s.name)/2,owners:[s.name]});let r=this.useNegotiation,i=new Set(r?[]:this.coupledPairs().flatMap((s)=>s.connectionNames));if(this.orders=ijr(t.connections.filter((s)=>!i.has(s.name))),!t.connections.length){this.solved=!0,this.phase="solved";return}if(!r&&this.coupledPairs().length){this.phase="coupled_pairs";return}this.phase="route",this.startLane()}get useNegotiation(){return this.options.denseSearch&&(this.input.connections.length>12||this.input.connections.some((t)=>(this.terminalLayers.get(t.name)?.length??0)>1))}coupledPairs(){return(this.input.differentialPairs??[]).filter((t)=>t.traceGap!==void 0||t.maxUncoupledLength!==void 0)}routePair(){let t=this.coupledPairs()[this.pairIndex];if(!t){this.pairedTraces=structuredClone(this.traces),this.phase="route",this.startLane();return}this.pairSearch??=CL(this.input,t,[...this.fixed,...this.traces.flatMap(oi)]);let n=this.pairSearch.next();if(!n.done)return;if(!n.value){this.fail("coupled_routing_failed","No legal coupled corridor and package approaches");return}this.traces.push(...n.value),this.pairSearch=void 0,this.pairIndex++}scene(t){return new Di(this.input,t,this.widths.get(t.name),[...this.fixed,...this.traces.flatMap(oi)])}startLane(){if(this.lane===this.orders[this.attempt].length){this.phase="match";return}let t=this.orders[this.attempt][this.lane],[n,o]=t.pointsToConnect;this.search=this.useNegotiation?new Tl(this.scene(t),n,o):new Sde(this.scene(t),n,o)}retry(){if(this.traces.length>this.bestPartial.length)this.bestPartial=structuredClone(this.traces);if(this.options.denseSearch&&this.attempt<300){let t=this.orders[this.attempt],n=t[this.lane];if(n){let o=[...t];o.splice(this.lane,1),o.splice(Math.max(0,this.lane-1-Math.floor(this.attempt/8)),0,n);let r=o.map((i)=>i.name).join("\x00");if(!this.orders.slice(0,this.attempt+1).some((i)=>i.map((s)=>s.name).join("\x00")===r))this.orders.splice(this.attempt+1,0,o)}}if(this.attempt++,this.attempt>=this.orders.length){this.traces=this.bestPartial,this.fail("no_planar_route","No collision-free routing found in the vector visibility graph");return}this.traces=structuredClone(this.pairedTraces),this.lane=0,this.startLane()}route(){if(this.useNegotiation){if(this.search instanceof Tl)this.search.cancel();if(this.search=void 0,!this.pairedNetworkAttempted){this.pairedNetworkAttempted=!0;let o=new Set([...(this.input.buses??[]).flatMap((r)=>r.connectionNames),...(this.input.differentialPairs??[]).flatMap((r)=>r.connectionNames)]);if(this.input.connections.some((r)=>!o.has(r.name))&&Jk(this.input))this.pairedNetwork=zXr(this.input,this.terminalLayers)}if(this.pairedNetwork){let o=this.pairedNetwork.next();if(!o.done)return;if(this.pairedNetwork=void 0,o.value){this.traces=o.value,this.phase="match";return}}if(!this.independentAttempted){this.independentAttempted=!0;let o=uat(this.input);if(o)this.independent=HXr(o,this.fixed,this.widths,(r,i)=>{let s=new e(r,this.options);if(s.step(),s.traces=i,s.phase="match",s.step(),!s.failed)s.step();return s.solved?s.traces:null})}if(this.independent){let o=this.independent.next();if(!o.done){this.traces=o.value,this.lane=this.traces.length;return}if(this.independent=void 0,o.value){this.traces=o.value,this.phase="validate_output";return}}this.reservePackageExits??=Jk(this.input),this.negotiated??=MG(this.input,this.orders[0],this.fixed,this.pairedTraces,this.widths,(o,r)=>{this.congestionPass=o,this.conflictingLanes=r},this.terminalLayers,()=>this.reservePackageExits);let n=this.negotiated.next();if(!n.done){this.traces=n.value,this.lane=this.traces.length-this.pairedTraces.length;return}if(!n.value){this.fail("no_planar_route","Negotiated lane search exhausted without a complete route");return}this.traces=n.value,this.phase="match";return}let t=this.search;if(t.step(),t.solved){let n=this.orders[this.attempt][this.lane];this.traces.push({type:"pcb_trace",pcb_trace_id:`bus_lane_${n.name}`,connection_name:n.name,source_trace_id:n.source_trace_id??n.name,route:b2(t.result,this.scene(n)).map((o)=>({route_type:"wire",x:o.x,y:o.y,layer:n.pointsToConnect[0].layer,width:this.widths.get(n.name)}))}),this.lane++,this.startLane()}else if(t.failed||t.expanded>=(this.options.maxLaneIterations??(t instanceof Tl?1e6:4000))){if(t instanceof Tl)t.cancel();this.retry()}}match(){let t=this.input,n=this.traces,o=this.fixed,r=new WeakSet,i=new WeakSet,s=new WeakSet,a=this.options.smoothTuning&&n.some((u)=>u.coupledSection);function*c(){if(yield n,a){let p=new Set(t.buses?.flatMap((m)=>m.connectionNames));if((t.allowedLayers?.length??t.layerCount)===2&&n.some((m)=>!p.has(m.connection_name))){let m=GCn(t,n).size>0;for(let A of m?[12,14,16,10,8]:[10,8,12,14,16]){let g=XJ(t,n,t.minTraceWidth*A,"dogleg",!0);if(g)r.add(g),i.add(g),yield g}}for(let m of(t.buses?.length??0)>1?[5,6,8,12,16,20]:[5,6,8,12]){let A=XJ(t,n,t.minTraceWidth*m,"interior");if(A){if(m<8)s.add(A);r.add(A),yield A}}for(let m of[8,12]){let A=XJ(t,n,t.minTraceWidth*m);if(A)r.add(A),yield A}}if(a)yield n;let u=$Cn(t,n,o);if(u.some((p,m)=>p!==n[m]))yield u;if(n.some((p)=>p.coupledSection)){for(let p of a?[20,16,6,4]:[20,16,12,8,6,4]){let m=XJ(t,n,t.minTraceWidth*p);if(m)yield m}for(let p of[8,12,6,16,4,20]){let m=XJ(t,n,t.minTraceWidth*p,"diagonal");if(m)yield m}return}let _=Math.max(...n.map((p)=>p.route[0].width));for(let p of[16,24,28,32]){let m=sjr(t,n,_*p);if(m)yield m}}let l,h=new Set,d=!1;for(let u of c()){let _=a&&u===n&&!d,p=_||s.has(u);if(u===n)d=!0;let m=function*(A,g){if(yield u,p)return;if(g)yield UXr(t,u,A);if(g&&u.some((f)=>f.coupledSection))for(let f of[2.75,2.5,2.25,2,3,1.5,1,0.5,0.25,0.125,0.0625,0.03125])yield WXr(t,u,A,f)};for(let A of m(this.fixed,this.options.smoothTuning))for(let g of this.options.smoothTuning?p?[1.5]:[1.5,0.75,0.375,0.1875,0.09375,0.046875,0.0234375]:[0]){let f=j8e(t,g?uL(t,A,this.fixed,g):A),y=JSON.stringify(f.map((x)=>[x.route,x.coupledSection,x.curvedSegments]));if(h.has(y))continue;if(h.add(y),this.options.smoothTuning&&!aG(f)){l=Error("No clear conventional approach corners");continue}if(pL(t,f).some((x)=>!x.matched)){l=Error("Pair approach refinement separated the shared rails");continue}try{let x=sL(t,f);if(mXr(t,x),this.traces=this.options.smoothTuning&&f.some((C)=>C.coupledSection)?tbn(t,f,{maxCandidates:u===n?t.buses?.some((C)=>C.maxLength!==void 0)?65536:512:i.has(u)?65536:16384,packMeanders:_||r.has(u)}):(this.options.smoothTuning?fZ:AXr)(t,f,x),this.options.smoothTuning)this.traces=ebn(t,this.traces);if(this.options.smoothTuning&&!aG(this.traces))throw Error("Length tuning introduced a sharp corner");if(pL(t,this.traces).some((C)=>!C.matched))throw Error("Length tuning separated the shared pair rails");this.phase="validate_output";return}catch(x){l=x}}}this.fail("length_matching_failed",String(l));return}validateOutput(){if(this.options.smoothTuning&&!aG(this.traces))throw Error("Final route has a nonconventional corner");for(let t of this.input.connections){let n=this.traces.find((r)=>r.connection_name===t.name);if(!n)throw Error("Missing lane");if(n.route.length<2||n.route.some((r)=>!Number.isFinite(r.x)||!Number.isFinite(r.y)||r.route_type!=="wire"||!Number.isFinite(r.width)||r.width<=0))throw Error("Invalid lane geometry");if(n.route.some((r)=>r.route_type!=="wire"||r.layer!==t.pointsToConnect[0].layer))throw Error("Carrier layer does not match its terminals");let o=this.scene(t);if(!ml(n.route,this.widths.get(t.name)/2+o.margin))throw Error("Final self-clearance violation");if(Gn(n.route[0],t.pointsToConnect[0])>0.00000001||Gn(n.route.at(-1),t.pointsToConnect[1])>0.00000001)throw Error("Broken lane endpoints");for(let r=1;r<n.route.length;r++){let i=n.route[r-1],s=n.route[r],a=Math.abs(i.x-s.x),c=Math.abs(i.y-s.y);if(i.route_type!=="wire"||s.route_type!=="wire"||i.layer!==s.layer)throw Error("Forbidden layer transition");if(Math.min(a,c)>0.00000001&&Math.abs(a-c)>0.00000001&&!n.curvedSegments?.includes(r))throw Error("Non-octilinear segment");if(!o.visible(i,s))throw Error("Final copper clearance violation")}}if([...NP(this.input,this.traces),...oit(this.input,this.traces)].some((t)=>t.toleranceMm!==null&&!t.matched))throw Error("Final bus length skew violation");if(NP(this.input,this.traces).some((t)=>!t.withinLengthLimit||!t.aboveMinimumLength))throw Error("Final absolute bus length violation");if(ZXr(this.input,this.traces).some((t)=>!t.matched))throw Error("Final pair spacing or uncoupled length violation");this.phase="solved",this.solved=!0}_step(){try{if(this.phase==="validate")this.initialize();else if(this.phase==="coupled_pairs")this.routePair();else if(this.phase==="route")this.route();else if(this.phase==="match")this.match();else if(this.phase==="validate_output")this.validateOutput()}catch(t){this.fail("constraint_error",String(t))}if(this.progress=this.lane/Math.max(1,this.input.connections.length),!this.reportedRoutes||this.reportedRoutes.length!==this.traces.length||this.reportedRoutes.some((t,n)=>t.trace!==this.traces[n]||t.route!==this.traces[n].route))this.reportedRoutes=this.traces.map((t)=>({trace:t,route:t.route})),this.lengthStats={busLengths:NP(this.input,this.traces),pairLengths:oit(this.input,this.traces),traceLengthsMm:this.traces.map((t)=>({name:t.connection_name,length:br(t.route)}))};this.stats={...this.lengthStats,phase:this.phase,algorithm:"octilinear_visibility",attempt:this.attempt,lane:this.lane,totalLanes:this.input.connections.length,congestionPass:this.congestionPass,conflictingLanes:this.conflictingLanes,vertices:(this.search instanceof Sde?this.search.vertices.length:0)??0,expandedVertices:this.search?.expanded??0,frontier:(this.search instanceof Sde?this.search.open.length:0)??0,failureCode:this.failureCode}}visualize(){let t=[],n=[],o=[],r=[];for(let i of fa(this.input)){if(i.rect){o.push({center:{x:(i.rect.minX+i.rect.maxX)/2,y:(i.rect.minY+i.rect.maxY)/2},width:i.rect.maxX-i.rect.minX,height:i.rect.maxY-i.rect.minY,layer:i.layer,fill:`${lde(i.layer)}30`,stroke:lde(i.layer)});continue}if(Gn(i.a,i.b)<0.000000001)r.push({center:i.a,radius:i.radius,layer:i.layer,fill:"transparent",stroke:lde(i.layer)});else t.push({points:[{x:i.a.x,y:i.a.y},{x:i.b.x,y:i.b.y}],strokeWidth:i.radius*2,strokeColor:lde(i.layer),layer:i.layer,label:`Fixed fanout [${i.layer}]`})}for(let i of this.traces)t.push({points:i.route.map(({x:s,y:a})=>({x:s,y:a})),strokeWidth:i.route[0].width,strokeColor:lde(i.route[0].layer),layer:i.route[0].layer,label:i.connection_name});for(let i of this.input.connections)for(let[s,a]of i.pointsToConnect.entries())n.push({...a,color:s?"#d97706":"#2563eb",label:`${i.name} ${s?"target":"source"} [${a.layer}]`});if(this.search instanceof Sde&&this.phase==="route"){let i=this.orders[this.attempt][this.lane]?.pointsToConnect[0].layer;for(let s of this.search.visibleEdges)t.push({points:s,strokeWidth:0.02,strokeColor:"#67e8f980",layer:i});for(let s of this.search.open.values().slice(0,80))n.push({...this.search.vertices[s.id],color:"#06b6d4",layer:i});t.push({points:this.search.currentPath(),strokeColor:"#f43f5e",strokeWidth:0.09,layer:i})}return{title:`Vector bus lanes · ${this.phase}`,lines:t,points:n,rects:o,circles:r}}};function ljr(e,t,n){let o=[];for(let s of n){let a=0,c=1;for(let[l,h,d]of[["x",s.minX,s.maxX],["y",s.minY,s.maxY]]){let u=t[l]-e[l];if(Math.abs(u)<0.000000000000001){if(e[l]<h||e[l]>d){a=1,c=0;break}}else{let _=(h-e[l])/u,p=(d-e[l])/u;a=Math.max(a,Math.min(_,p)),c=Math.min(c,Math.max(_,p))}}if(a<c)o.push([a,c])}o.sort((s,a)=>s[0]-a[0]);let r=[],i=0;for(let[s,a]of o){if(s>i)r.push([i,s]);i=Math.max(i,a)}if(i<1)r.push([i,1]);return r}function fP(e,t){let n=t.flatMap((o)=>{let r=o.route.flatMap((i,s)=>i.route_type==="via"?[s]:[]);return r.length===2?[{...o,route:o.route.slice(0,r[0]+2)},{...o,route:o.route.slice(r[1]-1).toReversed()}]:[]});return(e.differentialPairs??[]).map((o)=>{let r=o.connectionNames.map((g)=>t.find((f)=>f.connection_name===g||f.source_trace_id===g)),i=Math.max(...r.flatMap((g)=>g?.route.flatMap((f)=>f.route_type==="wire"?[f.width]:[])??[])),s=e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075,a=o.traceGap??s,c=EG({...e,traces:[...e.traces??[],...n]},i+a/2+s),l=[0,1].flatMap((g)=>{let f=c.find((y)=>r.every((x)=>x?.route.length&&_x(g?x.route.at(-1):x.route[0],y.copper)));return f?[f.copper]:[]}),h=(o.traceGap!==void 0||o.maxUncoupledLength!==void 0)&&l.length===2&&r.every((g)=>g?.route.length),d={connectionNames:o.connectionNames,applicable:h};if(!h)return{...d,matched:!0,maxExteriorEdgeGapMm:null,maxSamplingErrorMm:null,separatedExteriorLengthMm:null};let u=(g)=>g.route.slice(1).flatMap((f,y)=>{let x=g.route[y];return x.route_type==="wire"&&f.route_type==="wire"&&x.layer===f.layer?[{a:x,b:f,radius:x.width/2,layer:x.layer,owners:[]}]:[]}),_=-1/0,p=0,m=0,A=(i+a)/Math.cos(Math.PI/8)-i+0.002;for(let g=0;g<2;g++){let f=u(r[1-g]),y=new Map([...new Set(f.map((x)=>x.layer))].map((x)=>[x,new t0e(f.filter((C)=>C.layer===x))]));for(let{a:x,b:C}of u(r[g])){let b=Gn(x,C);for(let[I,v]of ljr(x,C,l)){let P=Math.max(1,Math.ceil((v-I)*b/0.002)),M=(v-I)*b/P;p=Math.max(p,M/2);for(let B=0;B<P;B++){let T=I+(v-I)*(B+0.5)/P,N={x:x.x+(C.x-x.x)*T,y:x.y+(C.y-x.y)*T},D=(y.get(x.layer)?.distanceToPoint(N,(L)=>gx(N,L.a,L.b)-L.radius)??1/0)-x.width/2;if(_=Math.max(_,D),D+M/2>A)m+=M}}}}return{...d,matched:m===0,maxExteriorEdgeGapMm:_===-1/0?null:_,maxSamplingErrorMm:p,separatedExteriorLengthMm:m}})}var p2n=(e)=>({...e,route:e.route.toReversed(),coupledSection:e.coupledSection?[e.route.length-1-e.coupledSection[1],e.route.length-1-e.coupledSection[0]]:void 0,curvedSegments:e.curvedSegments?.map((t)=>e.route.length-t)});function*hjr(e,t,n,o){let r=sL(e,t),i=new Set(e.differentialPairs?.flatMap((l)=>l.connectionNames)),s=new Set(n.map((l)=>l.pcb_trace_id)),a=t.filter((l)=>i.has(l.connection_name)&&l.coupledSection&&(r.get(l.connection_name)??0)>br(l.route)+C2(e,l.connection_name)+0.0000001),c=0;for(let l of a)for(let h of[0,1]){let d=h?p2n(l):l,u=d.connection_name,_=d.route[0].layer,p=e.traces?.find((H)=>s.has(H.pcb_trace_id)&&H.connection_name===u&&H.route.filter((V)=>V.route_type==="via").length===1&&Gn(H.route.at(-1),d.route[0])<0.0000001);if(!p)continue;let m=p.route[0],A=p.route.find((H)=>H.route_type==="via");if(m.layer!=="top"||A.from_layer!=="top")continue;let g=e.obstacles.find((H)=>H.componentId&&Gn(H.center,m)<0.0001);if(!g)continue;let f=e.obstacles.filter((H)=>H.componentId===g.componentId),y=Math.min(...f.map((H)=>Gn(H.center,m)).filter((H)=>H>0.0001));if(!Number.isFinite(y))continue;let x=Math.min(2,2.5*y),C=Math.min(...f.map((H)=>H.center.x-H.width/2)),b=Math.max(...f.map((H)=>H.center.x+H.width/2)),I=Math.min(...f.map((H)=>H.center.y-H.height/2)),v=Math.max(...f.map((H)=>H.center.y+H.height/2)),P=[{x:-1,y:0,d:m.x-C},{x:1,y:0,d:b-m.x},{x:0,y:-1,d:m.y-I},{x:0,y:1,d:v-m.y}].sort((H,V)=>H.d-V.d).slice(0,2),M=t.filter((H)=>H!==l),B=e.connections.find((H)=>H.name===u),T={...e,traces:e.traces.filter((H)=>H!==p)},N=[...fa(T),...M.flatMap(oi)],D=d.route[0].width;function*L(H,V,O,U){let j={...B,pointsToConnect:[{...H,layer:O},{...V,layer:O}]},Y=new Di(T,j,D,N),X=new Tl(Y,j.pointsToConnect[0],j.pointsToConnect[1],[],0,void 0,{maxLength:U,paretoLength:!0,checkReachability:!0});try{let K=0;while(!X.solved&&!X.failed&&K++<4000)X.step(),yield;return X.solved?b2(X.result,Y).map((J)=>({...J,route_type:"wire",layer:O,width:D})):null}finally{X.cancel()}}for(let H of P)for(let V of[1,0.875,1.125,1.25,1.5])for(let O of[1.125,1,0.875,0.75,1.25,1.375,1.5,0.625])for(let U of[-1,1]){if(++c>192)return null;let j={x:m.x+y*(H.x*V-H.y*O*U),y:m.y+y*(H.y*V+H.x*O*U)},Y={...A,...j,to_layer:_};if(Array.from({length:e.layerCount},(ie,le)=>le===0?"top":le===e.layerCount-1?"bottom":`inner${le}`).some((ie)=>!new Di(T,{...B,pointsToConnect:[{...j,layer:ie},{...j,layer:ie}]},Y.via_diameter??0.3,N).visible(j,j)))continue;let K=yield*L(m,j,"top",x),J=d.coupledSection[0],ee=yield*L(j,d.route[J],_,4*y);if(!K||!ee)continue;K=uL({...T,connections:[{...B,pointsToConnect:[m,{...j,layer:"top"}]}]},[{...p,route:K}],N)[0].route;let se={...p,route:[...K,Y,{...j,route_type:"wire",layer:_,width:D}]},ne=ee.length-1-J,re={...d,route:[...ee.slice(0,-1),...d.route.slice(J)],coupledSection:d.coupledSection.map((ie)=>ie+ne),curvedSegments:d.curvedSegments?.filter((ie)=>ie>J).map((ie)=>ie+ne)};if(h)re=p2n(re);let Z={...e,traces:e.traces.map((ie)=>ie===p?se:ie),connections:e.connections.map((ie)=>ie===B?{...ie,pointsToConnect:[re.route[0],re.route.at(-1)]}:ie)},te=br(re.route)+C2(Z,u);if(Math.abs(te-r.get(u))>1)continue;for(let ie of[0.75,0.375,1.5])try{let le=j8e(Z,uL(Z,t.map((me)=>me===l?re:me),void 0,ie)),ue=tbn(Z,le,{maxCandidates:65536,packMeanders:!0,packageOnlyPairTuning:!0});if(ue.some((me)=>!e0e(Z,me,{preserveExistingApproach:!1})(me.route)))continue;let de=A2.forValidation(Z,ue,o);try{while(!de.solved&&!de.failed)de.step(),yield;let me=fP(Z,ue);if(de.solved&&me.length===(e.differentialPairs?.length??0)&&me.every((Ae)=>Ae.applicable&&Ae.matched))return{input:Z,traces:ue,escapes:n.map((Ae)=>Ae.pcb_trace_id===p.pcb_trace_id?se:Ae)}}finally{if(!de.solved&&!de.failed)de.tryFinalAcceptance()}}catch{yield}}}return null}var djr=YZ(pXr(),1),z5=(e,t,n)=>e.matrix[Math.imul(t,e.width)+n],L5=(e,t,n,o)=>{e.matrix[Math.imul(t,e.width)+n]=o},uot=(e)=>(Symbol.iterator in e)&&typeof e[Symbol.iterator]==="function"?e:Object.entries(e),m2n=(e)=>e===!0?!0:e===!1?new Set:e instanceof Set?e:new Set(e),ujr=(e)=>{let{direction:t,objective:n,integers:o,binaries:r}=e,i=t==="minimize"?-1:1,s=uot(e.constraints),a=uot(e.variables),c=Array.isArray(a)?a:Array.from(a),l=[],h=[];if(o!=null||r!=null){let x=m2n(r),C=x===!0?!0:m2n(o);for(let b=1;b<=c.length;b++){let[I]=c[b-1];if(x===!0||x.has(I))l.push(b),h.push(b);else if(C===!0||C.has(I))h.push(b)}}let d=new Map;for(let[x,C]of s){let b=d.get(x)??{row:NaN,lower:-1/0,upper:1/0};if(b.lower=Math.max(b.lower,C.equal??C.min??-1/0),b.upper=Math.min(b.upper,C.equal??C.max??1/0),!d.has(x))d.set(x,b)}let u=1;for(let x of d.values())x.row=u,u+=(Number.isFinite(x.lower)?1:0)+(Number.isFinite(x.upper)?1:0);let _=c.length+1,p=u+l.length,m=_+p,A=new Float64Array(_*p),g=new Int32Array(m),f=new Int32Array(m),y={matrix:A,width:_,height:p,positionOfVariable:g,variableAtPosition:f};for(let x=0;x<m;x++)g[x]=x,f[x]=x;for(let x=1;x<_;x++)for(let[C,b]of uot(c[x-1][1])){if(C===n)L5(y,0,x,i*b);let I=d.get(C);if(I!=null){if(Number.isFinite(I.upper)){if(L5(y,I.row,x,b),Number.isFinite(I.lower))L5(y,I.row+1,x,-b)}else if(Number.isFinite(I.lower))L5(y,I.row,x,-b)}}for(let x of d.values())if(Number.isFinite(x.upper)){if(L5(y,x.row,0,x.upper),Number.isFinite(x.lower))L5(y,x.row+1,0,-x.lower)}else if(Number.isFinite(x.lower))L5(y,x.row,0,-x.lower);for(let x=0;x<l.length;x++){let C=u+x;L5(y,C,0,1),L5(y,C,l[x],1)}return{tableau:y,sign:i,variables:c,integers:h}},obn=(e,t)=>{let n=Math.round(1/t);return Math.round((e+Number.EPSILON)*n)/n},rbn=(e,t,n)=>{let o=z5(e,t,n),r=e.variableAtPosition[e.width+t],i=e.variableAtPosition[n];e.variableAtPosition[e.width+t]=i,e.variableAtPosition[n]=r,e.positionOfVariable[r]=n,e.positionOfVariable[i]=e.width+t;let s=[];for(let a=0;a<e.width;a++){let c=z5(e,t,a);if(Math.abs(c)>0.0000000000000001)L5(e,t,a,c/o),s.push(a);else L5(e,t,a,0)}L5(e,t,n,1/o);for(let a=0;a<e.height;a++){if(a===t)continue;let c=z5(e,a,n);if(Math.abs(c)>0.0000000000000001){for(let l=0;l<s.length;l++){let h=s[l];L5(e,a,h,z5(e,a,h)-c*z5(e,t,h))}L5(e,a,n,-c/o)}}},ibn=(e,t,n,o)=>{e.push([t.variableAtPosition[t.width+n],t.variableAtPosition[o]]);for(let r=6;r<=Math.trunc(e.length/2);r++){let i=!0;for(let s=0;s<r;s++){let a=e.length-1-s,[c,l]=e[a],[h,d]=e[a-r];if(c!==h||l!==d){i=!1;break}}if(i)return!0}return!1},pjr=(e,t)=>{let n=[],{precision:o,maxPivots:r,checkCycles:i}=t;for(let s=0;s<r;s++){let a=0,c=o;for(let d=1;d<e.width;d++){let u=z5(e,0,d);if(u>c)c=u,a=d}if(a===0)return["optimal",obn(z5(e,0,0),o)];let l=0,h=1/0;for(let d=1;d<e.height;d++){let u=z5(e,d,a);if(u<=o)continue;let p=z5(e,d,0)/u;if(p<h){if(l=d,h=p,p<=o)break}}if(l===0)return["unbounded",a];if(i&&ibn(n,e,l,a))return["cycled",NaN];rbn(e,l,a)}return["cycled",NaN]},sbn=(e,t)=>{let n=[],{precision:o,maxPivots:r,checkCycles:i}=t;for(let s=0;s<r;s++){let a=0,c=-o;for(let d=1;d<e.height;d++){let u=z5(e,d,0);if(u<c)c=u,a=d}if(a===0)return pjr(e,t);let l=0,h=-1/0;for(let d=1;d<e.width;d++){let u=z5(e,a,d);if(u<-o){let _=-z5(e,0,d)/u;if(_>h)h=_,l=d}}if(l===0)return["infeasible",NaN];if(i&&ibn(n,e,a,l))return["cycled",NaN];rbn(e,a,l)}return["cycled",NaN]},_2n=(e,t)=>({matrix:new Float64Array(e),positionOfVariable:new Int32Array(t),variableAtPosition:new Int32Array(t)}),mjr=(e,{matrix:t,positionOfVariable:n,variableAtPosition:o},r)=>{let{width:i,height:s}=e;t.set(e.matrix);for(let c=0;c<r.length;c++){let[l,h,d]=r[c],u=(s+c)*i,_=e.positionOfVariable[h];if(_<i)t[u]=l*d,t.fill(0,u+1,u+i),t[u+_]=l;else{let p=(_-i)*i;t[u]=l*(d-t[p]);for(let m=1;m<i;m++)t[u+m]=-l*t[p+m]}}n.set(e.positionOfVariable),o.set(e.variableAtPosition);let a=i+s+r.length;for(let c=i+s;c<a;c++)n[c]=c,o[c]=c;return{matrix:t.subarray(0,e.matrix.length+i*r.length),width:i,height:s+r.length,positionOfVariable:n.subarray(0,a),variableAtPosition:o.subarray(0,a)}},g2n=(e,t)=>{let n=0,o=0,r=0;for(let i=0;i<t.length;i++){let s=t[i],a=e.positionOfVariable[s]-e.width;if(a<0)continue;let c=z5(e,a,0),l=Math.abs(c-Math.round(c));if(l>n)n=l,o=s,r=c}return[o,r,n]},_jr=(e,t,n)=>{let{tableau:o,sign:r,integers:i}=e,{precision:s,maxIterations:a,tolerance:c,timeout:l}=n,[h,d,u]=g2n(o,i);if(u<=s)return[e,"optimal",t];let _=new djr.default((T,N)=>T[0]-N[0]);_.push([t,[[-1,h,Math.ceil(d)]]]),_.push([t,[[1,h,Math.floor(d)]]]);let p=i.length*2,m=o.matrix.length+p*o.width,A=o.positionOfVariable.length+p,g=_2n(m,A),f=_2n(m,A),y=t*(1-r*c),x=l+Date.now(),C=Date.now()>=x,b=!1,I=1/0,v=o,P=0;while(P<a&&!_.empty()&&I>=y&&!C){let[T,N]=_.pop();if(T>I)break;let D=mjr(o,g,N),[L,H]=sbn(D,n);if(L==="optimal"&&H<I){let[V,O,U]=g2n(D,i);if(U<=s){b=!0,I=H,v=D;let j=f;f=g,g=j}else{let j=[],Y=[];for(let X=0;X<N.length;X++){let K=N[X],[J,ee]=K;if(ee===V)if(J<0)Y.push(K);else j.push(K);else j.push(K),Y.push(K)}Y.push([1,V,Math.floor(O)]),j.push([-1,V,Math.ceil(O)]),_.push([H,j]),_.push([H,Y])}}C=Date.now()>=x,P++}let B=(C||P>=a)&&!_.empty()&&I>=y?"timedout":!b?"infeasible":"optimal";return[{...e,tableau:v},B,b?I:NaN]},A2n=({tableau:e,sign:t,variables:n},o,r,{precision:i,includeZeroVariables:s})=>{if(o==="optimal"||o==="timedout"&&!Number.isNaN(r)){let a=[];for(let c=0;c<n.length;c++){let[l]=n[c],h=e.positionOfVariable[c+1]-e.width,d=h>=0?z5(e,h,0):0;if(d>i)a.push([l,obn(d,i)]);else if(s)a.push([l,0])}return{status:o,result:-t*r,variables:a}}else if(o==="unbounded"){let a=e.variableAtPosition[r]-1;return{status:"unbounded",result:t*(1/0),variables:0<=a&&a<n.length?[[n[a][0],1/0]]:[]}}else return{status:o,result:NaN,variables:[]}},abn={precision:0.00000001,checkCycles:!1,maxPivots:8192,tolerance:0,timeout:1/0,maxIterations:32768,includeZeroVariables:!1},hra={...abn},gjr=(e,t)=>{let n=ujr(e),o={...abn,...t},[r,i]=sbn(n.tableau,o);if(n.integers.length===0||r!=="optimal")return A2n(n,r,i,o);else{let[s,a,c]=_jr(n,i,o);return A2n(s,a,c,o)}};function Ajr(e,t,n,o,r=!1){let i=0,s=new Set(e.differentialPairs?.flatMap((p)=>p.connectionNames)),a=t.map((p)=>{if(n&&(r||!s.has(p.connection_name))){let f=new Set(p.curvedSegments??[]),y=[];for(let v of[...f].sort((P,M)=>P-M)){if(!y.length||v-y.at(-1).at(-1)>4)y.push([]);y.at(-1).push(v)}let x=y.map((v,P)=>{let M=v[0]-1,B=v.at(-1),T=p.route[M],N=p.route[B],D=Gn(T,N),L=D>0.000001?{x:-(N.y-T.y)/D,y:(N.x-T.x)/D}:{x:0,y:1};return{first:M,last:B,n:L,bi:P}}),C=[];for(let v=0;v<p.route.length;v++)if(v>0&&f.has(v))C.at(-1).push(v);else C.push([v]);let b=new Map,I=new Map;for(let v of C){let P;if(!v.includes(0)&&!v.includes(p.route.length-1)){let M=x.find((N)=>v[0]>=N.first&&v.at(-1)<=N.last),B=M?v.map((N)=>p.route[N].x*M.n.x+p.route[N].y*M.n.y):[],T=M&&v.length>2?`${M.bi}:${Math.round(Math.min(...B)*1e6)}:${Math.round(Math.max(...B)*1e6)}`:`vertex${v[0]}`;if(P=I.get(T),P===void 0)P=i++,I.set(T,P)}for(let M of v)b.set(M,P)}return p.route.map((v,P)=>({...v,group:b.get(P)}))}let m=Math.min(...p.curvedSegments??[])-1,A=Math.max(...p.curvedSegments??[]),g=i++;return p.route.map((f,y)=>({...f,group:y===0||y===p.route.length-1||y>=m&&y<=A&&(m===0||A===p.route.length-1)?void 0:y>=m&&y<=A?g:i++}))}),c=new Set,l=fa(e).filter((p)=>!p.rect&&Gn(p.a,p.b)<0.00000001);for(let p=0;o&&p<t.length;p++)for(let m of l){if(!m.owners.includes(t[p].connection_name))continue;let A=a[p],g=m.radius+t[p].route[0].width/2+(e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075);for(let f=1;f<A.length;f++)if(sT([A[f-1],A[f]],[m.a,m.b])<=g+0.00000001){for(let y of[A[f-1],A[f]])if(y.group!==void 0)c.add(y.group)}}let h=Array.from({length:i},(p,m)=>m),d=(p)=>h[p]===p?p:h[p]=d(h[p]),u=new Set(c);for(let p of e.differentialPairs??[]){let m=t.findIndex((f)=>f.connection_name===p.connectionNames[0]),A=t.findIndex((f)=>f.connection_name===p.connectionNames[1]);if(m<0||A<0)continue;let g=(e.minTraceWidth+(p.traceGap??0.1))*1.6;for(let f of a[m])for(let y of a[A]){if(Gn(f,y)>g)continue;if(f.group===void 0&&y.group!==void 0)u.add(y.group);else if(y.group===void 0&&f.group!==void 0)u.add(f.group);else if(f.group!==void 0&&y.group!==void 0)h[d(f.group)]=d(y.group)}}let _=new Set([...u].map(d));for(let p of a)for(let m of p)if(m.group!==void 0)m.group=_.has(d(m.group))?void 0:d(m.group);return a}function f2n(e,t,n=!0){let o=new Map;for(let s of e)for(let a of s)if(a.group!==void 0)o.set(a.group,{x:(t.get(`${a.group}_x_1`)??0)-(t.get(`${a.group}_x_-1`)??0),y:(t.get(`${a.group}_y_1`)??0)-(t.get(`${a.group}_y_-1`)??0)});let r=new Map;for(let s of o.values()){let a={x:!n||Math.abs(s.x)>=0.0000001?1:0,y:!n||Math.abs(s.y)>=0.0000001?1:0};if(!a.x)s.x=0;if(!a.y)s.y=0;r.set(s,a)}let i=e.flatMap((s)=>s.slice(1).flatMap((a,c)=>{let l=s[c],h=Gn(l,a);if(l.group===a.group)return[];return(h<0.00000001?[{x:1,y:0},{x:0,y:1}]:[{x:-(a.y-l.y)/h,y:(a.x-l.x)/h}]).map((u)=>({a:o.get(l.group),b:o.get(a.group),n:u}))}));for(let s=0;s<20000;s++){let a=0;for(let{a:c,b:l,n:h}of i){let d=((l?.x??0)-(c?.x??0))*h.x+((l?.y??0)-(c?.y??0))*h.y;a=Math.max(a,Math.abs(d));let u=c?r.get(c):{x:0,y:0},_=l?r.get(l):{x:0,y:0},p=(u.x+_.x)*h.x*h.x+(u.y+_.y)*h.y*h.y;if(p<0.0000000000000001)continue;let m=d/p;if(c)c.x+=m*h.x*u.x,c.y+=m*h.y*u.y;if(l)l.x-=m*h.x*_.x,l.y-=m*h.y*_.y}if(a<0.00000000000001)break}return o}var fjr=class{constructor(e){this.motion=e}motion;pairs=new Map;add(e){let{a:t,b:n,n:o,min:r}=e;if(t.group===n.group)return;let i=t.group??-1,s=n.group??-1,a=o;if(i>s)[i,s]=[s,i],a={x:-o.x,y:-o.y};let c=`${i}:${s}`,l=i===-1?this.motion:this.motion*2,h=this.pairs.get(c)??{polygon:[{x:-l,y:-l},{x:l,y:-l},{x:l,y:l},{x:-l,y:l}],cuts:[]},d=[],u=h.polygon;for(let m=0;m<u.length;m++){let A=u[(m+u.length-1)%u.length],g=u[m],f=A.x*a.x+A.y*a.y-r,y=g.x*a.x+g.y*a.y-r;if(f<0!==y<0){let x=f/(f-y);d.push({x:A.x+(g.x-A.x)*x,y:A.y+(g.y-A.y)*x,cut:f>=0?g.cut:e})}if(y>=0)d.push(g)}let _=[],p=(m,A)=>Math.abs(m.x-A.x)<0.000000000001&&Math.abs(m.y-A.y)<0.000000000001;for(let m of d)if(!_.length||!p(_.at(-1),m))_.push(m);if(_.length>1&&p(_[0],_.at(-1)))_[0]={..._[0],cut:_.at(-1).cut},_.pop();h.polygon=_,h.cuts.push(e),this.pairs.set(c,h)}*active(){for(let{polygon:e,cuts:t}of this.pairs.values()){let n=e.reduce((o,r,i)=>{let s=e[(i+1)%e.length];return o+r.x*s.y-r.y*s.x},0);if(Math.abs(n)<0.000000000001)yield*t;else yield*new Set(e.map((o)=>o.cut).filter((o)=>!!o))}}};function*cbn(e,t,n="conservative"){let o={},r={};if(!t.length)return t;let i=0,s=0,a=(N,D)=>{let L=`c${i++}`;if(![...N.values()].some((H)=>Math.abs(H)>0.0000000001))return;r[L]=D;for(let[H,V]of N)if(Math.abs(V)>0.0000000001)(o[H]??={})[L]=V},c=(N,D,L,H=1)=>{if(D.group===void 0)return;for(let V of["x","y"])for(let O of[-1,1]){let U=`${D.group}_${V}_${O}`,j=H*L[V]*O;N.set(U,(N.get(U)??0)+j)}},l=n==="cohort"||n==="guarded-cohort",h=n==="guarded"||n==="guarded-cohort",d=n!=="conservative",u=n==="flexible"||n==="guarded"||l,_=u&&!l?4:2,p=d&&!l?12:24,m=h?96000000:64000000,A=new Set(e.differentialPairs?.flatMap((N)=>N.connectionNames)),g=d?Ajr(e,t,u,h,l):t.map((N)=>{let D=Math.min(...N.curvedSegments??[])-1,L=Math.max(...N.curvedSegments??[]),H=s++;return N.route.map((V,O)=>({...V,group:O===0||O===N.route.length-1||A.has(N.connection_name)||O>=D&&O<=L&&(D===0||L===N.route.length-1)?void 0:O>=D&&O<=L?H:s++}))});for(let N of g)for(let D of N)if(D.group!==void 0)for(let L of["x","y"])for(let H of[-1,1]){let V=`${D.group}_${L}_${H}`;if(o[V])continue;o[V]={objective:d?0.000001:0.0001},a(new Map([[V,1]]),{max:_})}let f=new Map;for(let[N,D]of g.entries()){let L=new Map;for(let H=1;H<D.length;H++){let V=D[H-1],O=D[H],U=Gn(V,O);if(V.group===O.group)continue;if(U<0.00000001){for(let J of[{x:1,y:0},{x:0,y:1}]){let ee=new Map;c(ee,O,J),c(ee,V,J,-1),a(ee,{equal:0})}continue}let j={x:(O.x-V.x)/U,y:(O.y-V.y)/U},Y={x:-j.y,y:j.x},X=new Map;c(X,O,Y),c(X,V,Y,-1),a(X,{equal:0});let K=new Map;c(K,O,j),c(K,V,j,-1),a(K,{min:Math.min(U,0.01)-U}),c(L,O,j),c(L,V,j,-1)}if(!d)a(L,e.buses?.some((H)=>H.maxLengthSkew!==void 0&&H.connectionNames.includes(t[N].connection_name))?{equal:0}:{max:0});else{let H=t[N].connection_name,V=br(t[N].route)+C2(e,H);f.set(H,{terms:L,total:V}),a(L,{max:0});for(let O of e.buses??[])if(O.connectionNames.includes(H)&&O.minLength!==void 0)a(L,{min:O.minLength-V})}}if(d)for(let[N,{names:D,tolerance:L}]of hat(e).entries()){let H=D.map((j)=>f.get(j)).filter((j)=>!!j);if(!H.length)continue;let V=Math.max(...H.map((j)=>j.total)),O=`bus_shrink_${N}`,U=l?Math.max(0,L-0.00001):Math.max(L+0.00000001,V-Math.min(...H.map((j)=>j.total))+0.000000001);o[O]={objective:0},a(new Map([[O,1]]),{max:V});for(let j of H){let Y=new Map(j.terms);Y.set(O,1),a(Y,{max:V-j.total,min:V-U-j.total})}}for(let N of["x","y"]){let D=Math.min(...g.flat().map((H)=>H[N])),L=Math.max(...g.flat().map((H)=>H[N]));for(let H of[-1,1]){let V=`bound_${N}_${H}`,O=d?1/Math.max(L-D,1):1,U=V+"_out";if(o[V]={objective:-O},d)o[U]={objective:O},a(new Map([[U,1]]),{max:_});a(new Map([[V,1]]),{max:L-D});let j=new Map;for(let Y of g.flat()){let X=String(Y.group),K=H===1?L-Y[N]:Y[N]-D;j.set(X,Math.min(j.get(X)??1/0,K))}for(let[Y,X]of j){let K=new Map([[V,1]]);if(d)K.set(U,-1);c(K,{x:0,y:0,group:Y==="undefined"?void 0:Number(Y)},N==="x"?{x:H,y:0}:{x:0,y:H}),a(K,{max:X})}}}let y=fa(e),x=e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075,C=g.flatMap((N,D)=>N.slice(1).map((L,H)=>({a:N[H],b:L,radius:t[D].route[H].width/2,layer:t[D].route[H].layer,owners:[t[D].connection_name,t[D].source_trace_id??""]}))),b=(N,D,L)=>{let H=L.x-D.x,V=L.y-D.y,O=Math.max(0,Math.min(1,((N.x-D.x)*H+(N.y-D.y)*V)/(H*H+V*V||1)));return{x:D.x+O*H,y:D.y+O*V}},I=new fjr(_),v=[],P=()=>{for(let N of v){delete r[N];for(let D of Object.values(o))delete D[N]}v.length=0;for(let N of I.active()){let D=new Map;c(D,N.a,N.n),c(D,N.b,N.n,-1);let L=`c${i}`;if(a(D,{min:N.min}),r[L])v.push(L)}},M=new Set,B=Object.keys(o).length,T=t;for(let N=0;N<p;N++){if(d)P();if((Object.values(r).reduce((ne,re)=>ne+(re.equal!==void 0||re.min!==void 0&&re.max!==void 0?2:1),0)+1)*(B+1)>m)return T;yield;let L=gjr({direction:"minimize",objective:"objective",variables:o,constraints:r},{precision:l?0.0000001:0.0000000001,maxPivots:4096,checkCycles:d});if(L.status!=="optimal")return T;let H=new Map(L.variables),V=l?f2n(g,H,!1):void 0;if(V&&[...V.values()].some((ne)=>!Number.isFinite(ne.x)||!Number.isFinite(ne.y)||Math.abs(ne.x)>_+0.000001||Math.abs(ne.y)>_+0.000001))return T;let O=(ne)=>({...ne,x:ne.x+(ne.group===void 0?0:V?V.get(ne.group).x:(H.get(`${ne.group}_x_1`)??0)-(H.get(`${ne.group}_x_-1`)??0)),y:ne.y+(ne.group===void 0?0:V?V.get(ne.group).y:(H.get(`${ne.group}_y_1`)??0)-(H.get(`${ne.group}_y_-1`)??0))}),U=l?f2n(g,H):void 0,j=(ne)=>U&&ne.group!==void 0?{x:ne.x+U.get(ne.group).x,y:ne.y+U.get(ne.group).y}:O(ne);if(d)T=t.map((ne,re)=>({...ne,route:ne.route.map((Z,te)=>({...Z,x:j(g[re][te]).x,y:j(g[re][te]).y}))}));let Y=C.map((ne)=>({...ne,a:O(ne.a),b:O(ne.b)})),X=new t0e([...y,...Y]),K=new Map(Y.map((ne,re)=>[ne,C[re]])),J=new Map([...y,...Y].map((ne,re)=>[ne,re])),ee=0,se=new Map;for(let ne=0;ne<Y.length;ne++){let re=Y[ne],Z=C[ne],te=[],ie=re.radius+x;X.some({minX:Math.min(re.a.x,re.b.x)-ie,maxX:Math.max(re.a.x,re.b.x)+ie,minY:Math.min(re.a.y,re.b.y)-ie,maxY:Math.max(re.a.y,re.b.y)+ie},(le)=>(te.push(le),!1));for(let le of te){if(re.layer!==le.layer)continue;let ue=K.get(le),de=le.owners.some((Ne)=>Ne&&re.owners.includes(Ne));if(de&&!ue)continue;let me=ue??le;if(de&&(Z.a===me.a||Z.a===me.b||Z.b===me.a||Z.b===me.b||Z.a.group===Z.b.group&&Z.a.group===me.a.group&&Z.a.group===me.b.group))continue;let Ae=de?Math.min(re.radius+x+me.radius,sT([Z.a,Z.b],[me.a,me.b])):re.radius+x+(me.rect?0:me.radius);if(n0e(re.a,re.b,le)>=Ae-(me.rect?0:me.radius)-0.000000001)continue;let xe=`${ne}:${J.get(le)}`,Me=`${Z.a.group}:${Z.b.group}:${me.a.group}:${me.b.group}:${K.has(le)?"moving":"f"+J.get(le)}`;if(M.has(xe)||!d&&(se.get(Me)??0)>=4)continue;se.set(Me,(se.get(Me)??0)+1),M.add(xe);let Re=me.rect?[{x:me.rect.minX,y:me.rect.minY},{x:me.rect.maxX,y:me.rect.minY},{x:me.rect.maxX,y:me.rect.maxY},{x:me.rect.minX,y:me.rect.maxY}]:[me.a,me.b],we=[{x:1,y:0},{x:0,y:1}];for(let Ne of[Z.a,Z.b])for(let ke=0;ke<Re.length;ke++){let nt=b(Ne,Re[ke],Re[(ke+1)%Re.length]);we.push({x:Ne.x-nt.x,y:Ne.y-nt.y})}for(let Ne of Re){let ke=b(Ne,Z.a,Z.b);we.push({x:ke.x-Ne.x,y:ke.y-Ne.y})}let _e,ye=-1/0;for(let Ne of we){let ke=Math.hypot(Ne.x,Ne.y);if(ke<0.0000000001)continue;for(let nt of[-1,1]){let dt={x:Ne.x/ke*nt,y:Ne.y/ke*nt},rt=Math.min(...[Z.a,Z.b].map((mt)=>mt.x*dt.x+mt.y*dt.y))-Math.max(...Re.map((mt)=>mt.x*dt.x+mt.y*dt.y));if(rt>ye)ye=rt,_e=dt}}if(!_e||ye<0)return t;let Se=Math.min(ye,Ae+0.000001);for(let Ne of[Z.a,Z.b])for(let ke of Re){if(d){I.add({a:Ne,b:ke,n:_e,min:Se-((Ne.x-ke.x)*_e.x+(Ne.y-ke.y)*_e.y)});continue}let nt=new Map;c(nt,Ne,_e),c(nt,ke,_e,-1),a(nt,{min:Se-((Ne.x-ke.x)*_e.x+(Ne.y-ke.y)*_e.y)})}ee++}}if(!ee||N===p-1)return t.map((ne,re)=>({...ne,route:ne.route.map((Z,te)=>({...Z,x:j(g[re][te]).x,y:j(g[re][te]).y}))}))}return t}function y2n(e,t){let n=t.map((s)=>{let a={start:0,end:0,length:0},c=0,l=0;for(let h=1;h<s.route.length;h++){let d=s.route[h-1],u=s.route[h];if(d.route_type!=="wire"||u.route_type!=="wire"||d.layer!==u.layer){c=h,l=0;continue}if(l+=Gn(d,u),l>a.length)a={start:c,end:h,length:l}}return a});if(n.some((s)=>s.end<=s.start))return null;let o=t.map((s,a)=>{let{start:c,end:l}=n[a];return{...s,route:s.route.slice(c,l+1),curvedSegments:s.curvedSegments?.filter((h)=>h>c&&h<=l).map((h)=>h-c),coupledSection:s.coupledSection?.map((h)=>h-c)}}),r=new Map(o.map((s)=>[s.connection_name,s]));if(e.connections.some((s)=>!r.has(s.name)))return null;return{input:{...e,connections:e.connections.map((s)=>{let a=r.get(s.name);return{...s,pointsToConnect:[a.route[0],a.route.at(-1)]}}),traces:[...e.traces??[],...t.flatMap((s,a)=>{let{start:c,end:l}=n[a];return[...c?[{...s,route:s.route.slice(0,c+1)}]:[],...l<s.route.length-1?[{...s,route:s.route.slice(l)}]:[]]})]},carriers:o,join:(s)=>t.map((a,c)=>({...a,route:[...a.route.slice(0,n[c].start),...s[c].route,...a.route.slice(n[c].end+1)]}))}}function E1(e){let t=1/0,n=-1/0,o=1/0,r=-1/0;for(let i of e)for(let s of i.route){let a=s.route_type==="wire"?s.width/2:(s.via_diameter??0.3)/2;t=Math.min(t,s.x-a),n=Math.max(n,s.x+a),o=Math.min(o,s.y-a),r=Math.max(r,s.y+a)}return{minX:t,maxX:n,minY:o,maxY:r,areaMm2:e.length?(n-t)*(r-o):0}}function yjr(e,t){let n=new Set([...e.buses?.flatMap((r)=>r.connectionNames)??[],...e.differentialPairs?.flatMap((r)=>r.connectionNames)??[]]),o=E1(t);return t.some((r)=>{if(!n.has(r.connection_name))return!1;let i=E1([r]);return["minX","minY","maxX","maxY"].some((s)=>Math.abs(i[s]-o[s])<0.00000001)})}function*xjr(e,t,n){let o=e.connections.map((s)=>new Set([s.name]));for(let s of[...e.buses??[],...e.differentialPairs??[]]){let a=o.filter((l)=>s.connectionNames.some((h)=>l.has(h))),c=new Set(a.flatMap((l)=>[...l]));for(let l of a)o.splice(o.indexOf(l),1);if(c.size)o.push(c)}o.sort((s,a)=>s.size-a.size);let r=t,i=e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075;for(let s=0;s<4;s++){let a=E1(r).areaMm2,c=!1;for(let l of o){let h=r.filter((p)=>l.has(p.connection_name)),d={...e,connections:e.connections.filter((p)=>l.has(p.name)),buses:e.buses?.filter((p)=>l.has(p.connectionNames[0])),differentialPairs:e.differentialPairs?.filter((p)=>l.has(p.connectionNames[0])),traces:[...e.traces??[],...r.filter((p)=>!l.has(p.connection_name))]},u=h.map((p)=>e0e(d,p)),_=!1;for(let p of["cohort","guarded-cohort"]){let m=yield*cbn(d,h,p);if(m===h)break;let A=!1;for(let g of[1,0.999,0.99,0.95,0.9,0.75,0.5,0.25,0.1]){let f=m.map((C,b)=>({...C,route:C.route.map((I,v)=>({...I,x:h[b].route[v].x+(I.x-h[b].route[v].x)*g,y:h[b].route[v].y+(I.y-h[b].route[v].y)*g}))})),y=E1(f).areaMm2;if(!Number.isFinite(y)||y>=E1(h).areaMm2-0.000001)continue;if(f.some((C,b)=>!u[b](C.route))){A=!0;continue}if(f.some((C)=>!ml(C.route,C.route[0].width+i)))continue;let x=A2.forValidation({...d,minTraceToPadEdgeClearance:i+0.0000000095},f,n);try{while(!x.solved&&!x.failed)x.step(),yield;if(!x.solved)continue;let C=new Map(f.map((I)=>[I.connection_name,I])),b=r.map((I)=>C.get(I.connection_name)??I);if(fP(e,b).some((I)=>!I.matched))continue;r=b,_=c=!0,yield r;break}finally{if(!x.solved&&!x.failed)x.tryFinalAcceptance()}}if(_||!A)break}}if(!c||a-E1(r).areaMm2<a*0.001)break}}var x2n=(e,t)=>e.x*t.y-e.y*t.x,GB=(e,t)=>({x:t.x-e.x,y:t.y-e.y}),pot=(e,t)=>e.x*t.x+e.y*t.y;function C2n(e,t,n,o){let r=x2n(t,o);if(Math.abs(r)<0.00000001)return null;let i=x2n(GB(e,n),o)/r;return{x:e.x+i*t.x,y:e.y+i*t.y}}function Cjr(e,t){if(!t.length)return t;let n=new Set([...e.buses?.flatMap((d)=>d.connectionNames)??[],...e.differentialPairs?.flatMap((d)=>d.connectionNames)??[]]),o=structuredClone(t),r=o.filter((d)=>!n.has(d.connection_name)&&!d.coupledSection&&!d.curvedSegments?.length&&d.route.every((u)=>u.route_type==="wire"&&u.layer===d.route[0].layer));if(!r.length)return t;let i=o.flatMap((d)=>[d.route[0],d.route.at(-1)]),s=o.reduce((d,u)=>({x:d.x+Math.abs(u.route[0].x-u.route.at(-1).x),y:d.y+Math.abs(u.route[0].y-u.route.at(-1).y)}),{x:0,y:0}),a=s.x>s.y?"y":"x",c=i.reduce((d,u)=>d+u[a],0)/i.length,l=(d)=>d.slice(1).reduce((u,_,p)=>u+Gn(d[p],_)*(Math.abs(d[p][a]-c)+Math.abs(_[a]-c))/2,0),h=fa(e);for(let d=0;d<8;d++){let u=!1;r.sort((_,p)=>l(_.route)-l(p.route));for(let _ of r){let p=e.connections.find((x)=>x.name===_.connection_name);if(!p)continue;let m=_.route[0].width,A=new Di(e,p,m,[...h,...o.flatMap(oi)]),g=_.route,f=l(g),y=br(g);for(let x=1;x<g.length-2;x++){let C=g[x-1],b=g[x],I=g[x+1],v=g[x+2],P=GB(b,I),M=Gn(b,I);if(M<m*2)continue;let B={x:-P.y/M,y:P.x/M},T=g;for(let N of[20,10,5,2.5,1,0.5,-20,-10,-5,-2.5,-1,-0.5]){let D={x:b.x+N*m*B.x,y:b.y+N*m*B.y},L=C2n(C,GB(C,b),D,P),H=C2n(v,GB(v,I),D,P);if(!L||!H||pot(GB(C,L),GB(C,b))<=0.00000001||pot(GB(v,H),GB(v,I))<=0.00000001||pot(GB(L,H),P)<=0.00000001)continue;if(["x","y"].some((j)=>{let Y=Math.min(...g.map((K)=>K[j])),X=Math.max(...g.map((K)=>K[j]));return[L,H].some((K)=>K[j]<Y-0.00000001||K[j]>X+0.00000001)}))continue;let V=[...g.slice(0,x),{...b,...L},{...I,...H},...g.slice(x+2)],O=l(V),U=br(V);if(O>=f-0.000001||U>y+0.00000001||!A.pathVisible([C,L,H,v])||!ml(V,m/2+A.margin))continue;T=V,f=O,y=U}if(T!==g)g=T,u=!0}_.route=g}if(!u)break}return o}var Zk=0.000000001;function pat(e){return e.shape==="circle"}function Uve(e,t){let n=-(t.ccwRotationDegrees??0)*Math.PI/180,o=e.x-t.center.x,r=e.y-t.center.y;return{x:o*Math.cos(n)-r*Math.sin(n),y:o*Math.sin(n)+r*Math.cos(n)}}function x6(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function vv(e,t,n){let o=n.x-t.x,r=n.y-t.y,i=o*o+r*r,s=i<Zk?0:((e.x-t.x)*o+(e.y-t.y)*r)/i,a=Math.max(0,Math.min(1,s));return Math.hypot(e.x-(t.x+a*o),e.y-(t.y+a*r))}function p9e(e,t,n){return(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x)}function bjr(e,t,n,o){let r=p9e(n,o,e),i=p9e(n,o,t),s=p9e(e,t,n),a=p9e(e,t,o);return(r>0&&i<0||r<0&&i>0)&&(s>0&&a<0||s<0&&a>0)}function lbn(e,t,n,o){if(bjr(e,t,n,o))return 0;return Math.min(vv(e,n,o),vv(t,n,o),vv(n,e,t),vv(o,e,t))}function Ijr(e,t,n=Zk){if(pat(t))return x6(e,t.center)<=t.width/2+n;let o=Uve(e,t);return Math.abs(o.x)<=t.width/2+n&&Math.abs(o.y)<=t.height/2+n}function hbn(e,t){if(pat(t))return Math.max(0,x6(e,t.center)-t.width/2);let n=Uve(e,t),o=Math.max(Math.abs(n.x)-t.width/2,0),r=Math.max(Math.abs(n.y)-t.height/2,0);return Math.hypot(o,r)}function vjr(e,t){if(pat(t))return Math.max(0,vv(t.center,e.start,e.end)-t.width/2);let n=Uve(e.start,t),o=Uve(e.end,t);if(Math.abs(n.x)<=t.width/2+Zk&&Math.abs(n.y)<=t.height/2+Zk)return 0;if(Math.abs(o.x)<=t.width/2+Zk&&Math.abs(o.y)<=t.height/2+Zk)return 0;let r=-t.width/2,i=t.width/2,s=-t.height/2,a=t.height/2,c=[{x:r,y:s},{x:i,y:s},{x:i,y:a},{x:r,y:a}],l=Number.POSITIVE_INFINITY;for(let h=0;h<c.length;h++)l=Math.min(l,lbn(n,o,c[h],c[(h+1)%c.length]));return l}function mat(e,t,n){if(e.layer!==t.layer)return!0;let o=(e.width+t.width)/2+n,r=o+Zk;if(Math.min(e.start.x,e.end.x)-Math.max(t.start.x,t.end.x)>r||Math.min(t.start.x,t.end.x)-Math.max(e.start.x,e.end.x)>r||Math.min(e.start.y,e.end.y)-Math.max(t.start.y,t.end.y)>r||Math.min(t.start.y,t.end.y)-Math.max(e.start.y,e.end.y)>r)return!0;return lbn(e.start,e.end,t.start,t.end)>=o-Zk}function o0e(e){if(!Number.isInteger(e)||e<1)throw Error(`FanoutSolver: layerCount must be a positive integer, received ${e}`);if(e===1)return["top"];if(e===2)return["top","bottom"];return["top",...Array.from({length:e-2},(t,n)=>`inner${n+1}`),"bottom"]}function Sjr(e,t,n){let o=n.indexOf(e),r=n.indexOf(t);if(o<0||r<0)throw Error(`FanoutSolver: cannot build via span from "${e}" to "${t}"`);let i=Math.min(o,r),s=Math.max(o,r);return n.slice(i,s+1)}function Pjr(e){let{fromLayer:t,toLayer:n,layerNames:o,allowBlindAndBuriedVias:r}=e,i=Sjr(t,n,o);return r?i:[...o]}var Ejr={topside_left:{direction:"left",preferredExit:"top-left",exitEdge:"top"},topside_center:{direction:"up",preferredExit:"top",exitEdge:"top"},topside_right:{direction:"right",preferredExit:"top-right",exitEdge:"top"},rightside_top:{direction:"up",preferredExit:"top-right",exitEdge:"right"},rightside_center:{direction:"right",preferredExit:"right",exitEdge:"right"},rightside_bottom:{direction:"down",preferredExit:"bottom-right",exitEdge:"right"},bottomside_right:{direction:"right",preferredExit:"bottom-right",exitEdge:"bottom"},bottomside_center:{direction:"down",preferredExit:"bottom",exitEdge:"bottom"},bottomside_left:{direction:"left",preferredExit:"bottom-left",exitEdge:"bottom"},leftside_bottom:{direction:"down",preferredExit:"bottom-left",exitEdge:"left"},leftside_center:{direction:"left",preferredExit:"left",exitEdge:"left"},leftside_top:{direction:"up",preferredExit:"top-left",exitEdge:"left"},center:{}};function Mjr(e){let t=Ejr[e];if(!t)throw Error(`Invalid fanout exit position "${e}"`);return t}function dbn(e,t){return e===t||e.includes(t)}function Wve(e,t){if(!e||!t?.includes("-"))return;if(!dbn(t,e))return;if(e==="left"||e==="right")return t.startsWith("top-")?"maximum":"minimum";return t.endsWith("-right")?"maximum":"minimum"}var S0=0.000000001,wjr=1e5;function ubn(e){for(let[n,o]of[["viaDiameter",e.viaDiameter],["traceWidth",e.traceWidth]])if(!Number.isFinite(o)||o<=0)throw Error(`FanoutSolver: dogbone ${n} must be a positive finite number, received ${o}`);if(!Number.isFinite(e.clearance)||e.clearance<0)throw Error(`FanoutSolver: dogbone clearance must be a non-negative finite number, received ${e.clearance}`);if(e.viaHoleDiameter!==void 0&&(!Number.isFinite(e.viaHoleDiameter)||e.viaHoleDiameter<=0))throw Error(`FanoutSolver: dogbone viaHoleDiameter must be a positive finite number, received ${e.viaHoleDiameter}`);if(e.holeToHoleClearance!==void 0&&(!Number.isFinite(e.holeToHoleClearance)||e.holeToHoleClearance<0))throw Error(`FanoutSolver: dogbone holeToHoleClearance must be a non-negative finite number, received ${e.holeToHoleClearance}`);if(e.holeToHoleClearance!==void 0&&e.viaHoleDiameter===void 0)throw Error("FanoutSolver: dogbone holeToHoleClearance requires viaHoleDiameter");let t=e.maximumSearchStates??wjr;if(!Number.isInteger(t)||t<1)throw Error(`FanoutSolver: dogbone maximumSearchStates must be a positive integer, received ${t}`);return t}function lit(e){let t=[];for(let n of e.toSorted((o,r)=>o-r)){if(!Number.isFinite(n))continue;if(t.length===0||Math.abs(t.at(-1)-n)>S0)t.push(n)}return t}function pbn(e){let t=new Map,n=new Map,o=new Map;for(let r of e){let i=t.get(r.componentId);if(!i)i={componentId:r.componentId,connections:[],obstacles:[],xCoordinates:[],yCoordinates:[],pitchX:Number.POSITIVE_INFINITY,pitchY:Number.POSITIVE_INFINITY},t.set(r.componentId,i),o.set(r.componentId,new Set);if(i.xCoordinates.push(...r.xCoordinates),i.yCoordinates.push(...r.yCoordinates),Number.isFinite(r.pitchX)&&r.pitchX>S0)i.pitchX=Math.min(i.pitchX,r.pitchX);if(Number.isFinite(r.pitchY)&&r.pitchY>S0)i.pitchY=Math.min(i.pitchY,r.pitchY);let s=o.get(r.componentId);for(let a of r.componentObstacles)if(!s.has(a))s.add(a),i.obstacles.push(a);for(let a of r.connections){let c=n.get(a.connectionIndex);if(c!==void 0){if(c!==r.componentId)throw Error(`FanoutSolver: connection index ${a.connectionIndex} belongs to multiple components`);continue}n.set(a.connectionIndex,r.componentId),i.connections.push({preparedConnection:a,busId:r.busId,direction:r.direction,terminationType:r.termination.type})}}return[...t.values()].map((r)=>({...r,connections:r.connections.toSorted((i,s)=>i.preparedConnection.connectionIndex-s.preparedConnection.connectionIndex),xCoordinates:lit(r.xCoordinates),yCoordinates:lit(r.yCoordinates)})).toSorted((r,i)=>r.componentId.localeCompare(i.componentId))}function Bjr(e){let{coordinates:t,pitch:n}=e;if(t.length===0||!Number.isFinite(n)||n<=S0)return[];let o=[t[0]-n/2];for(let r=1;r<t.length;r++)o.push((t[r-1]+t[r])/2);return o.push(t.at(-1)+n/2),lit(o)}function b2n(e){let{sourceCoordinate:t,coordinates:n,pitch:o}=e,r=Bjr({coordinates:n,pitch:o}),i=r.filter((a)=>a<t-S0).at(-1),s=r.find((a)=>a>t+S0);return[i,s].filter((a)=>a!==void 0)}function Tjr(e,t){let n=Math.abs(t.x-e.x),o=Math.abs(t.y-e.y);return n<=S0||o<=S0||Math.abs(n-o)<=S0}function Djr(e){let{source:t,site:n,direction:o}=e,r=o==="right"?n.x-t.x:o==="left"?t.x-n.x:o==="up"?n.y-t.y:t.y-n.y;return r>S0?0:Math.abs(r)<=S0?1:2}function Njr(e){let{point:t,obstacles:n,viaDiameter:o,clearance:r}=e,i=o/2+r;return n.every((s)=>hbn(t,s)>=i-S0)}function Rjr(e){let{segment:t,sourceObstacle:n,obstacles:o,clearance:r}=e,i=t.width/2+r;return o.every((s)=>s===n||vjr(t,s)>=i-S0)}function mbn(e){let{connection:t,component:n,rules:o}=e,{preparedConnection:r,direction:i}=t,s=o.additionalObstacles?[...new Set([...n.obstacles,...o.additionalObstacles])]:n.obstacles,a={x:r.sourcePoint.x,y:r.sourcePoint.y},c=b2n({sourceCoordinate:a.x,coordinates:n.xCoordinates,pitch:n.pitchX}),l=b2n({sourceCoordinate:a.y,coordinates:n.yCoordinates,pitch:n.pitchY}),h=[...c.map((I)=>({x:I,y:a.y})),...l.map((I)=>({x:a.x,y:I})),...c.flatMap((I)=>l.map((v)=>({x:I,y:v})))],d=[];for(let I of h)if(!d.some((v)=>x6(v,I)<=S0))d.push(I);let u=o.fixedViaPointsByConnectionIndex?.get(r.connectionIndex),_=u?[u]:d,p=[];for(let I of _){if(t.terminationType==="plane"&&!Tjr(a,I))continue;if(!Njr({point:I,obstacles:s,viaDiameter:o.viaDiameter,clearance:o.clearance}))continue;let v={start:a,end:I,width:o.traceWidth,layer:r.sourceLayer};if(!Rjr({segment:v,sourceObstacle:r.sourceObstacle,obstacles:s,clearance:o.clearance}))continue;if(!(o.blockingSegments??[]).every((B)=>{if(B.connectionIndex===r.connectionIndex)return!0;if(o.canShareCopper?.(r.connectionIndex,B.connectionIndex))return!0;let T=o.viaDiameter/2+B.segment.width/2+o.clearance;if(vv(I,B.segment.start,B.segment.end)<T-S0)return!1;return B.segment.layer!==v.layer||mat(v,B.segment,o.clearance)}))continue;if(!(o.blockingVias??[]).every((B)=>{if(B.connectionIndex===r.connectionIndex)return!0;if(x6(I,B.center)<(o.viaDiameter+B.diameter)/2+o.clearance-S0)return!1;if(B.spanLayers.includes(v.layer)&&vv(B.center,v.start,v.end)<B.diameter/2+v.width/2+o.clearance-S0)return!1;return!0}))continue;p.push({connectionIndex:r.connectionIndex,point:I,sourceSegment:v,outwardRank:Djr({source:a,site:I,direction:i})})}let m=i==="left"||i==="right"?n.yCoordinates:n.xCoordinates,A=i==="left"||i==="right"?a.y:a.x,g=m.findIndex((I)=>Math.abs(I-A)<=S0),f=g>=0?g%2===0?1:-1:void 0,y=t.terminationType==="boundary"?o.preferredBoundaryPerpendicularSideByBusId?.get(t.busId):o.preferPlaneCheckerboardSites&&t.terminationType==="plane"&&(i==="left"||i==="right")?f:void 0,x=t.terminationType==="boundary"?o.preferBoundaryOutwardByBusId?.get(t.busId)??!0:!0,C=o.preferredViaPointsByConnectionIndex?.get(r.connectionIndex),b=(I)=>{if(y===void 0)return 0;let v=i==="left"||i==="right"?I.point.y-a.y:I.point.x-a.x;return v*y>S0?0:Math.abs(v)<=S0?1:2};return p.toSorted((I,v)=>(C?Number(x6(I.point,C)>S0)-Number(x6(v.point,C)>S0):0)||(x?I.outwardRank-v.outwardRank:v.outwardRank-I.outwardRank)||b(I)-b(v)||x6(a,I.point)-x6(a,v.point)||I.point.x-v.point.x||I.point.y-v.point.y)}function Qjr(e){let{first:t,second:n,rules:o}=e,r=o.canShareCopper?.(t.connectionIndex,n.connectionIndex)??!1,i=o.viaHoleDiameter?o.viaHoleDiameter+(o.holeToHoleClearance??o.clearance):0,s=r?i:Math.max(o.viaDiameter+o.clearance,i);if(x6(t.point,n.point)<s-S0)return!1;let a=o.viaDiameter/2+o.traceWidth/2+o.clearance;if(!r){if(vv(t.point,n.sourceSegment.start,n.sourceSegment.end)<a-S0||vv(n.point,t.sourceSegment.start,t.sourceSegment.end)<a-S0)return!1}if(r)return!0;return mat(t.sourceSegment,n.sourceSegment,o.clearance)}function kjr(e){let{component:t,rules:n,consumeSearchState:o}=e,r=t.connections.map((_)=>({connection:_,candidates:mbn({connection:_,component:t,rules:n})}));if(r.some((_)=>_.candidates.length===0))return null;let i=new Map,s=(_,p)=>{let m=i.get(_)?.get(p);if(m!==void 0)return m;let A=Qjr({first:_,second:p,rules:n}),g=i.get(_)??new Map;g.set(p,A),i.set(_,g);let f=i.get(p)??new Map;return f.set(_,A),i.set(p,f),A},a=r.flatMap((_)=>_.candidates.length===1?[_.candidates[0]]:[]);for(let _=0;_<a.length;_++){let p=a[_];for(let m=0;m<_;m++)if(!s(p,a[m]))return null}let c=new Map(a.map((_)=>[_.connectionIndex,_])),l=new Set(r.flatMap((_)=>_.candidates.length>1?[_.connection.preparedConnection.connectionIndex]:[])),h=new Map(r.map((_)=>[_.connection.preparedConnection.connectionIndex,_]));if(l.size===0)return new Map([...c.entries()].map(([_,p])=>[_,{...p.point}]));let d=(_)=>_.candidates.filter((p)=>[...c.values()].every((m)=>s(p,m))),u=()=>{if(!o())return!1;if(l.size===0)return!0;let _,p=[];for(let A of[...l].toSorted((g,f)=>g-f)){let g=h.get(A),f=d(g);if(f.length===0)return!1;if(!_||f.length<p.length||f.length===p.length&&A<_.connection.preparedConnection.connectionIndex)_=g,p=f}let m=_.connection.preparedConnection.connectionIndex;l.delete(m);for(let A of p){if(c.set(m,A),u())return!0;c.delete(m)}return l.add(m),!1};if(!u())return null;return new Map([...c.entries()].toSorted(([_],[p])=>_-p).map(([_,p])=>[_,{...p.point}]))}function Ljr(e,t){let n=ubn(t);if(e.length===0)return new Map;let o=0,r=()=>(o++,o<=n),i=new Map;for(let s of pbn(e)){let a=kjr({component:s,rules:t,consumeSearchState:r});if(!a)return null;for(let[c,l]of a)i.set(c,l)}return i}function Hjr(e,t){return ubn(t),pbn(e).flatMap((n)=>n.connections.flatMap((o)=>mbn({connection:o,component:n,rules:t}).map((r)=>({connectionIndex:r.connectionIndex,point:{...r.point}}))))}var dra=YZ(lat(),1),ura=YZ(lat(),1),pra=YZ(lat(),1),{create:Fjr,defineProperty:hit,getOwnPropertyDescriptor:zjr,getOwnPropertyNames:_bn,getPrototypeOf:Ojr}=Object,Vjr=Object.prototype.hasOwnProperty,e_=(e,t)=>function(){return t||(0,e[_bn(e)[0]])((t={exports:{}}).exports,t),t.exports},gbn=(e,t)=>{for(var n in t)hit(e,n,{get:t[n],enumerable:!0})},dit=(e,t,n)=>(n=e!=null?Fjr(Ojr(e)):{},((o,r,i,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of _bn(r))Vjr.call(o,a)||a===i||hit(o,a,{get:()=>r[a],enumerable:!(s=zjr(r,a))||s.enumerable});return o})(!t&&e&&e.__esModule?n:hit(n,"default",{value:e,enumerable:!0}),e)),Yjr=e_({"node_modules/is-buffer/index.js"(e,t){function n(o){return!!o.constructor&&typeof o.constructor.isBuffer=="function"&&o.constructor.isBuffer(o)}t.exports=function(o){return o!=null&&(n(o)||function(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&n(r.slice(0,0))}(o)||!!o._isBuffer)}}}),Gjr=e_({"node_modules/kind-of/index.js"(e,t){var n=Yjr(),o=Object.prototype.toString;t.exports=function(r){if(r===void 0)return"undefined";if(r===null)return"null";if(r===!0||r===!1||r instanceof Boolean)return"boolean";if(typeof r=="string"||r instanceof String)return"string";if(typeof r=="number"||r instanceof Number)return"number";if(typeof r=="function"||r instanceof Function)return"function";if(Array.isArray!==void 0&&Array.isArray(r))return"array";if(r instanceof RegExp)return"regexp";if(r instanceof Date)return"date";var i=o.call(r);return i==="[object RegExp]"?"regexp":i==="[object Date]"?"date":i==="[object Arguments]"?"arguments":i==="[object Error]"?"error":n(r)?"buffer":i==="[object Set]"?"set":i==="[object WeakSet]"?"weakset":i==="[object Map]"?"map":i==="[object WeakMap]"?"weakmap":i==="[object Symbol]"?"symbol":i==="[object Int8Array]"?"int8array":i==="[object Uint8Array]"?"uint8array":i==="[object Uint8ClampedArray]"?"uint8clampedarray":i==="[object Int16Array]"?"int16array":i==="[object Uint16Array]"?"uint16array":i==="[object Int32Array]"?"int32array":i==="[object Uint32Array]"?"uint32array":i==="[object Float32Array]"?"float32array":i==="[object Float64Array]"?"float64array":"object"}}}),Ujr=e_({"node_modules/rename-keys/index.js"(e,t){(function(){function n(o,r){if(typeof r!="function")return o;var i={};for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(i[r(s,o[s])||s]=o[s]);return i}t!==void 0&&t.exports?t.exports=n:typeof define=="function"&&define.amd?define([],function(){return n}):window.rename=n})()}}),Wjr=e_({"node_modules/deep-rename-keys/index.js"(e,t){var n=Gjr(),o=Ujr();t.exports=function r(i,s){var a=n(i);if(a!=="object"&&a!=="array")throw Error("expected an object");var c=[];for(var l in a==="object"&&(i=o(i,s),c={}),i)if(i.hasOwnProperty(l)){var h=i[l];n(h)==="object"||n(h)==="array"?c[l]=r(h,s):c[l]=h}return c}}}),Xjr=e_({"node_modules/xml-reader/node_modules/eventemitter3/index.js"(e,t){var n=Object.prototype.hasOwnProperty,o="~";function r(){}function i(a,c,l){this.fn=a,this.context=c,this.once=l||!1}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(o=!1)),s.prototype.eventNames=function(){var a,c,l=[];if(this._eventsCount===0)return l;for(c in a=this._events)n.call(a,c)&&l.push(o?c.slice(1):c);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(a)):l},s.prototype.listeners=function(a,c){var l=o?o+a:a,h=this._events[l];if(c)return!!h;if(!h)return[];if(h.fn)return[h.fn];for(var d=0,u=h.length,_=Array(u);d<u;d++)_[d]=h[d].fn;return _},s.prototype.emit=function(a,c,l,h,d,u){var _=o?o+a:a;if(!this._events[_])return!1;var p,m,A=this._events[_],g=arguments.length;if(A.fn){switch(A.once&&this.removeListener(a,A.fn,void 0,!0),g){case 1:return A.fn.call(A.context),!0;case 2:return A.fn.call(A.context,c),!0;case 3:return A.fn.call(A.context,c,l),!0;case 4:return A.fn.call(A.context,c,l,h),!0;case 5:return A.fn.call(A.context,c,l,h,d),!0;case 6:return A.fn.call(A.context,c,l,h,d,u),!0}for(m=1,p=Array(g-1);m<g;m++)p[m-1]=arguments[m];A.fn.apply(A.context,p)}else{var f,y=A.length;for(m=0;m<y;m++)switch(A[m].once&&this.removeListener(a,A[m].fn,void 0,!0),g){case 1:A[m].fn.call(A[m].context);break;case 2:A[m].fn.call(A[m].context,c);break;case 3:A[m].fn.call(A[m].context,c,l);break;case 4:A[m].fn.call(A[m].context,c,l,h);break;default:if(!p)for(f=1,p=Array(g-1);f<g;f++)p[f-1]=arguments[f];A[m].fn.apply(A[m].context,p)}}return!0},s.prototype.on=function(a,c,l){var h=new i(c,l||this),d=o?o+a:a;return this._events[d]?this._events[d].fn?this._events[d]=[this._events[d],h]:this._events[d].push(h):(this._events[d]=h,this._eventsCount++),this},s.prototype.once=function(a,c,l){var h=new i(c,l||this,!0),d=o?o+a:a;return this._events[d]?this._events[d].fn?this._events[d]=[this._events[d],h]:this._events[d].push(h):(this._events[d]=h,this._eventsCount++),this},s.prototype.removeListener=function(a,c,l,h){var d=o?o+a:a;if(!this._events[d])return this;if(!c)return--this._eventsCount===0?this._events=new r:delete this._events[d],this;var u=this._events[d];if(u.fn)u.fn!==c||h&&!u.once||l&&u.context!==l||(--this._eventsCount===0?this._events=new r:delete this._events[d]);else{for(var _=0,p=[],m=u.length;_<m;_++)(u[_].fn!==c||h&&!u[_].once||l&&u[_].context!==l)&&p.push(u[_]);p.length?this._events[d]=p.length===1?p[0]:p:--this._eventsCount===0?this._events=new r:delete this._events[d]}return this},s.prototype.removeAllListeners=function(a){var c;return a?(c=o?o+a:a,this._events[c]&&(--this._eventsCount===0?this._events=new r:delete this._events[c])):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prototype.setMaxListeners=function(){return this},s.prefixed=o,s.EventEmitter=s,t!==void 0&&(t.exports=s)}});var jjr=e_({"node_modules/xml-lexer/node_modules/eventemitter3/index.js"(e,t){var n=Object.prototype.hasOwnProperty,o="~";function r(){}function i(a,c,l){this.fn=a,this.context=c,this.once=l||!1}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(o=!1)),s.prototype.eventNames=function(){var a,c,l=[];if(this._eventsCount===0)return l;for(c in a=this._events)n.call(a,c)&&l.push(o?c.slice(1):c);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(a)):l},s.prototype.listeners=function(a,c){var l=o?o+a:a,h=this._events[l];if(c)return!!h;if(!h)return[];if(h.fn)return[h.fn];for(var d=0,u=h.length,_=Array(u);d<u;d++)_[d]=h[d].fn;return _},s.prototype.emit=function(a,c,l,h,d,u){var _=o?o+a:a;if(!this._events[_])return!1;var p,m,A=this._events[_],g=arguments.length;if(A.fn){switch(A.once&&this.removeListener(a,A.fn,void 0,!0),g){case 1:return A.fn.call(A.context),!0;case 2:return A.fn.call(A.context,c),!0;case 3:return A.fn.call(A.context,c,l),!0;case 4:return A.fn.call(A.context,c,l,h),!0;case 5:return A.fn.call(A.context,c,l,h,d),!0;case 6:return A.fn.call(A.context,c,l,h,d,u),!0}for(m=1,p=Array(g-1);m<g;m++)p[m-1]=arguments[m];A.fn.apply(A.context,p)}else{var f,y=A.length;for(m=0;m<y;m++)switch(A[m].once&&this.removeListener(a,A[m].fn,void 0,!0),g){case 1:A[m].fn.call(A[m].context);break;case 2:A[m].fn.call(A[m].context,c);break;case 3:A[m].fn.call(A[m].context,c,l);break;case 4:A[m].fn.call(A[m].context,c,l,h);break;default:if(!p)for(f=1,p=Array(g-1);f<g;f++)p[f-1]=arguments[f];A[m].fn.apply(A[m].context,p)}}return!0},s.prototype.on=function(a,c,l){var h=new i(c,l||this),d=o?o+a:a;return this._events[d]?this._events[d].fn?this._events[d]=[this._events[d],h]:this._events[d].push(h):(this._events[d]=h,this._eventsCount++),this},s.prototype.once=function(a,c,l){var h=new i(c,l||this,!0),d=o?o+a:a;return this._events[d]?this._events[d].fn?this._events[d]=[this._events[d],h]:this._events[d].push(h):(this._events[d]=h,this._eventsCount++),this},s.prototype.removeListener=function(a,c,l,h){var d=o?o+a:a;if(!this._events[d])return this;if(!c)return--this._eventsCount===0?this._events=new r:delete this._events[d],this;var u=this._events[d];if(u.fn)u.fn!==c||h&&!u.once||l&&u.context!==l||(--this._eventsCount===0?this._events=new r:delete this._events[d]);else{for(var _=0,p=[],m=u.length;_<m;_++)(u[_].fn!==c||h&&!u[_].once||l&&u[_].context!==l)&&p.push(u[_]);p.length?this._events[d]=p.length===1?p[0]:p:--this._eventsCount===0?this._events=new r:delete this._events[d]}return this},s.prototype.removeAllListeners=function(a){var c;return a?(c=o?o+a:a,this._events[c]&&(--this._eventsCount===0?this._events=new r:delete this._events[c])):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prototype.setMaxListeners=function(){return this},s.prefixed=o,s.EventEmitter=s,t!==void 0&&(t.exports=s)}}),Kjr=e_({"node_modules/xml-lexer/dist/lexer.js"(e,t){function n(l,h,d){return h in l?Object.defineProperty(l,h,{value:d,enumerable:!0,configurable:!0,writable:!0}):l[h]=d,l}var o=jjr(),r=function(){},i={data:"state-data",cdata:"state-cdata",tagBegin:"state-tag-begin",tagName:"state-tag-name",tagEnd:"state-tag-end",attributeNameStart:"state-attribute-name-start",attributeName:"state-attribute-name",attributeNameEnd:"state-attribute-name-end",attributeValueBegin:"state-attribute-value-begin",attributeValue:"state-attribute-value"},s={lt:"action-lt",gt:"action-gt",space:"action-space",equal:"action-equal",quote:"action-quote",slash:"action-slash",char:"action-char",error:"action-error"},a={text:"text",openTag:"open-tag",closeTag:"close-tag",attributeName:"attribute-name",attributeValue:"attribute-value"},c={" ":s.space,"\t":s.space,"\n":s.space,"\r":s.space,"<":s.lt,">":s.gt,'"':s.quote,"'":s.quote,"=":s.equal,"/":s.slash};t.exports={State:i,Action:s,Type:a,create:function(l){var h,d,u,_,p,m,A,g,f,y;l=Object.assign({debug:!1},l);var x=new o,C=i.data,b="",I="",v="",P="",M="",B="",T=function(D,L){if(I[0]!=="?"&&I[0]!=="!"){var H={type:D,value:L};l.debug&&console.log("emit:",H),x.emit("data",H)}};x.stateMachine=(n(y={},i.data,(n(h={},s.lt,function(){b.trim()&&T(a.text,b),I="",M=!1,C=i.tagBegin}),n(h,s.char,function(D){b+=D}),h)),n(y,i.cdata,n({},s.char,function(D){(b+=D).substr(-3)==="]]>"&&(T(a.text,b.slice(0,-3)),b="",C=i.data)})),n(y,i.tagBegin,(n(d={},s.space,r),n(d,s.char,function(D){I=D,C=i.tagName}),n(d,s.slash,function(){I="",M=!0}),d)),n(y,i.tagName,(n(u={},s.space,function(){M?C=i.tagEnd:(C=i.attributeNameStart,T(a.openTag,I))}),n(u,s.gt,function(){T(M?a.closeTag:a.openTag,I),b="",C=i.data}),n(u,s.slash,function(){C=i.tagEnd,T(a.openTag,I)}),n(u,s.char,function(D){(I+=D)==="![CDATA["&&(C=i.cdata,b="",I="")}),u)),n(y,i.tagEnd,(n(_={},s.gt,function(){T(a.closeTag,I),b="",C=i.data}),n(_,s.char,r),_)),n(y,i.attributeNameStart,(n(p={},s.char,function(D){v=D,C=i.attributeName}),n(p,s.gt,function(){b="",C=i.data}),n(p,s.space,r),n(p,s.slash,function(){M=!0,C=i.tagEnd}),p)),n(y,i.attributeName,(n(m={},s.space,function(){C=i.attributeNameEnd}),n(m,s.equal,function(){T(a.attributeName,v),C=i.attributeValueBegin}),n(m,s.gt,function(){P="",T(a.attributeName,v),T(a.attributeValue,P),b="",C=i.data}),n(m,s.slash,function(){M=!0,P="",T(a.attributeName,v),T(a.attributeValue,P),C=i.tagEnd}),n(m,s.char,function(D){v+=D}),m)),n(y,i.attributeNameEnd,(n(A={},s.space,r),n(A,s.equal,function(){T(a.attributeName,v),C=i.attributeValueBegin}),n(A,s.gt,function(){P="",T(a.attributeName,v),T(a.attributeValue,P),b="",C=i.data}),n(A,s.char,function(D){P="",T(a.attributeName,v),T(a.attributeValue,P),v=D,C=i.attributeName}),A)),n(y,i.attributeValueBegin,(n(g={},s.space,r),n(g,s.quote,function(D){B=D,P="",C=i.attributeValue}),n(g,s.gt,function(){T(a.attributeValue,P=""),b="",C=i.data}),n(g,s.char,function(D){B="",P=D,C=i.attributeValue}),g)),n(y,i.attributeValue,(n(f={},s.space,function(D){B?P+=D:(T(a.attributeValue,P),C=i.attributeNameStart)}),n(f,s.quote,function(D){B===D?(T(a.attributeValue,P),C=i.attributeNameStart):P+=D}),n(f,s.gt,function(D){B?P+=D:(T(a.attributeValue,P),b="",C=i.data)}),n(f,s.slash,function(D){B?P+=D:(T(a.attributeValue,P),M=!0,C=i.tagEnd)}),n(f,s.char,function(D){P+=D}),f)),y);var N=function(D){l.debug&&console.log(C,D);var L=x.stateMachine[C],H=L[function(V){return c[V]||s.char}(D)]||L[s.error]||L[s.char];H(D)};return x.write=function(D){for(var L=D.length,H=0;H<L;H++)N(D[H])},x}}}}),$jr=e_({"node_modules/xml-reader/dist/reader.js"(e,t){var n=Xjr(),o=Kjr(),r=o.Type,i={element:"element",text:"text"},s=function(c){return Object.assign({name:"",type:i.element,value:"",parent:null,attributes:{},children:[]},c)},a=function(c){c=Object.assign({stream:!1,parentNodes:!0,doneEvent:"done",tagPrefix:"tag:",emitTopLevelOnly:!1,debug:!1},c);var l=void 0,h=void 0,d=void 0,u=void 0,_=new n,p=function(m){switch(m.type){case r.openTag:if(d===null)(d=h).name=m.value;else{var A=s({name:m.value,parent:d});d.children.push(A),d=A}break;case r.closeTag:var g=d.parent;if(c.parentNodes||(d.parent=null),d.name!==m.value)break;c.stream&&g===h&&(h.children=[],d.parent=null),c.emitTopLevelOnly&&g!==h||(_.emit(c.tagPrefix+d.name,d),_.emit("tag",d.name,d)),d===h&&(l.removeAllListeners("data"),_.emit(c.doneEvent,d),h=null),d=g;break;case r.text:d&&d.children.push(s({type:i.text,value:m.value,parent:c.parentNodes?d:null}));break;case r.attributeName:u=m.value,d.attributes[u]="";break;case r.attributeValue:d.attributes[u]=m.value}};return _.reset=function(){(l=o.create({debug:c.debug})).on("data",p),h=s(),d=null,u="",_.parse=l.write},_.reset(),_};t.exports={parseSync:function(c,l){l=Object.assign({},l,{stream:!1,tagPrefix:":"});var h=a(l),d=void 0;return h.on("done",function(u){d=u}),h.parse(c),d},create:a,NodeType:i}}}),K8e=e_({"node_modules/binary-search-bounds/search-bounds.js"(e,t){function n(c,l,h,d,u){for(var _=u+1;d<=u;){var p=d+u>>>1,m=c[p];(h!==void 0?h(m,l):m-l)>=0?(_=p,u=p-1):d=p+1}return _}function o(c,l,h,d,u){for(var _=u+1;d<=u;){var p=d+u>>>1,m=c[p];(h!==void 0?h(m,l):m-l)>0?(_=p,u=p-1):d=p+1}return _}function r(c,l,h,d,u){for(var _=d-1;d<=u;){var p=d+u>>>1,m=c[p];(h!==void 0?h(m,l):m-l)<0?(_=p,d=p+1):u=p-1}return _}function i(c,l,h,d,u){for(var _=d-1;d<=u;){var p=d+u>>>1,m=c[p];(h!==void 0?h(m,l):m-l)<=0?(_=p,d=p+1):u=p-1}return _}function s(c,l,h,d,u){for(;d<=u;){var _=d+u>>>1,p=c[_],m=h!==void 0?h(p,l):p-l;if(m===0)return _;m<=0?d=_+1:u=_-1}return-1}function a(c,l,h,d,u,_){return typeof h=="function"?_(c,l,h,d===void 0?0:0|d,u===void 0?c.length-1:0|u):_(c,l,void 0,h===void 0?0:0|h,d===void 0?c.length-1:0|d)}t.exports={ge:function(c,l,h,d,u){return a(c,l,h,d,u,n)},gt:function(c,l,h,d,u){return a(c,l,h,d,u,o)},lt:function(c,l,h,d,u){return a(c,l,h,d,u,r)},le:function(c,l,h,d,u){return a(c,l,h,d,u,i)},eq:function(c,l,h,d,u){return a(c,l,h,d,u,s)}}}}),_at=e_({"node_modules/two-product/two-product.js"(e,t){t.exports=function(o,r,i){var s=o*r,a=n*o,c=a-(a-o),l=o-c,h=n*r,d=h-(h-r),u=r-d,_=l*u-(s-c*d-l*d-c*u);if(i)return i[0]=_,i[1]=s,i;return[_,s]};var n=+(Math.pow(2,27)+1)}}),Abn=e_({"node_modules/robust-sum/robust-sum.js"(e,t){t.exports=function(n,o){var r=0|n.length,i=0|o.length;if(r===1&&i===1)return function(v,P){var M=v+P,B=M-v,T=M-B,N=P-B,D=v-T,L=D+N;if(L)return[L,M];return[M]}(n[0],o[0]);var s,a,c=Array(r+i),l=0,h=0,d=0,u=Math.abs,_=n[h],p=u(_),m=o[d],A=u(m);p<A?(a=_,(h+=1)<r&&(p=u(_=n[h]))):(a=m,(d+=1)<i&&(A=u(m=o[d]))),h<r&&p<A||d>=i?(s=_,(h+=1)<r&&(p=u(_=n[h]))):(s=m,(d+=1)<i&&(A=u(m=o[d])));var g,f,y=s+a,x=y-s,C=a-x,b=C,I=y;for(;h<r&&d<i;)p<A?(s=_,(h+=1)<r&&(p=u(_=n[h]))):(s=m,(d+=1)<i&&(A=u(m=o[d]))),(C=(a=b)-(x=(y=s+a)-s))&&(c[l++]=C),b=I-((g=I+y)-(f=g-I))+(y-f),I=g;for(;h<r;)(C=(a=b)-(x=(y=(s=_)+a)-s))&&(c[l++]=C),b=I-((g=I+y)-(f=g-I))+(y-f),I=g,(h+=1)<r&&(_=n[h]);for(;d<i;)(C=(a=b)-(x=(y=(s=m)+a)-s))&&(c[l++]=C),b=I-((g=I+y)-(f=g-I))+(y-f),I=g,(d+=1)<i&&(m=o[d]);return b&&(c[l++]=b),I&&(c[l++]=I),l||(c[l++]=0),c.length=l,c}}}),qjr=e_({"node_modules/two-sum/two-sum.js"(e,t){t.exports=function(n,o,r){var i=n+o,s=i-n,a=o-s,c=n-(i-s);if(r)return r[0]=c+a,r[1]=i,r;return[c+a,i]}}}),fbn=e_({"node_modules/robust-scale/robust-scale.js"(e,t){var n=_at(),o=qjr();t.exports=function(r,i){var s=r.length;if(s===1){var a=n(r[0],i);return a[0]?a:[a[1]]}var c=Array(2*s),l=[0.1,0.1],h=[0.1,0.1],d=0;n(r[0],i,l),l[0]&&(c[d++]=l[0]);for(var u=1;u<s;++u){n(r[u],i,h);var _=l[1];o(_,h[0],l),l[0]&&(c[d++]=l[0]);var p=h[1],m=l[1],A=p+m,g=m-(A-p);l[1]=A,g&&(c[d++]=g)}return l[1]&&(c[d++]=l[1]),d===0&&(c[d++]=0),c.length=d,c}}}),ybn=e_({"node_modules/robust-subtract/robust-diff.js"(e,t){t.exports=function(n,o){var r=0|n.length,i=0|o.length;if(r===1&&i===1)return function(v,P){var M=v+P,B=M-v,T=M-B,N=P-B,D=v-T,L=D+N;if(L)return[L,M];return[M]}(n[0],-o[0]);var s,a,c=Array(r+i),l=0,h=0,d=0,u=Math.abs,_=n[h],p=u(_),m=-o[d],A=u(m);p<A?(a=_,(h+=1)<r&&(p=u(_=n[h]))):(a=m,(d+=1)<i&&(A=u(m=-o[d]))),h<r&&p<A||d>=i?(s=_,(h+=1)<r&&(p=u(_=n[h]))):(s=m,(d+=1)<i&&(A=u(m=-o[d])));var g,f,y=s+a,x=y-s,C=a-x,b=C,I=y;for(;h<r&&d<i;)p<A?(s=_,(h+=1)<r&&(p=u(_=n[h]))):(s=m,(d+=1)<i&&(A=u(m=-o[d]))),(C=(a=b)-(x=(y=s+a)-s))&&(c[l++]=C),b=I-((g=I+y)-(f=g-I))+(y-f),I=g;for(;h<r;)(C=(a=b)-(x=(y=(s=_)+a)-s))&&(c[l++]=C),b=I-((g=I+y)-(f=g-I))+(y-f),I=g,(h+=1)<r&&(_=n[h]);for(;d<i;)(C=(a=b)-(x=(y=(s=m)+a)-s))&&(c[l++]=C),b=I-((g=I+y)-(f=g-I))+(y-f),I=g,(d+=1)<i&&(m=-o[d]);return b&&(c[l++]=b),I&&(c[l++]=I),l||(c[l++]=0),c.length=l,c}}}),Jjr=e_({"node_modules/robust-orientation/orientation.js"(e,t){var n=_at(),o=Abn(),r=fbn(),i=ybn();function s(m,A,g,f){return function(y,x,C){var b=m(m(A(x[1],C[0]),A(-C[1],x[0])),m(A(y[1],x[0]),A(-x[1],y[0]))),I=m(A(y[1],C[0]),A(-C[1],y[0])),v=f(b,I);return v[v.length-1]}}function a(m,A,g,f){return function(y,x,C,b){var I=m(m(g(m(A(C[1],b[0]),A(-b[1],C[0])),x[2]),m(g(m(A(x[1],b[0]),A(-b[1],x[0])),-C[2]),g(m(A(x[1],C[0]),A(-C[1],x[0])),b[2]))),m(g(m(A(x[1],b[0]),A(-b[1],x[0])),y[2]),m(g(m(A(y[1],b[0]),A(-b[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),b[2])))),v=m(m(g(m(A(C[1],b[0]),A(-b[1],C[0])),y[2]),m(g(m(A(y[1],b[0]),A(-b[1],y[0])),-C[2]),g(m(A(y[1],C[0]),A(-C[1],y[0])),b[2]))),m(g(m(A(x[1],C[0]),A(-C[1],x[0])),y[2]),m(g(m(A(y[1],C[0]),A(-C[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),C[2])))),P=f(I,v);return P[P.length-1]}}function c(m,A,g,f){return function(y,x,C,b,I){var v=m(m(m(g(m(g(m(A(b[1],I[0]),A(-I[1],b[0])),C[2]),m(g(m(A(C[1],I[0]),A(-I[1],C[0])),-b[2]),g(m(A(C[1],b[0]),A(-b[1],C[0])),I[2]))),x[3]),m(g(m(g(m(A(b[1],I[0]),A(-I[1],b[0])),x[2]),m(g(m(A(x[1],I[0]),A(-I[1],x[0])),-b[2]),g(m(A(x[1],b[0]),A(-b[1],x[0])),I[2]))),-C[3]),g(m(g(m(A(C[1],I[0]),A(-I[1],C[0])),x[2]),m(g(m(A(x[1],I[0]),A(-I[1],x[0])),-C[2]),g(m(A(x[1],C[0]),A(-C[1],x[0])),I[2]))),b[3]))),m(g(m(g(m(A(C[1],b[0]),A(-b[1],C[0])),x[2]),m(g(m(A(x[1],b[0]),A(-b[1],x[0])),-C[2]),g(m(A(x[1],C[0]),A(-C[1],x[0])),b[2]))),-I[3]),m(g(m(g(m(A(b[1],I[0]),A(-I[1],b[0])),x[2]),m(g(m(A(x[1],I[0]),A(-I[1],x[0])),-b[2]),g(m(A(x[1],b[0]),A(-b[1],x[0])),I[2]))),y[3]),g(m(g(m(A(b[1],I[0]),A(-I[1],b[0])),y[2]),m(g(m(A(y[1],I[0]),A(-I[1],y[0])),-b[2]),g(m(A(y[1],b[0]),A(-b[1],y[0])),I[2]))),-x[3])))),m(m(g(m(g(m(A(x[1],I[0]),A(-I[1],x[0])),y[2]),m(g(m(A(y[1],I[0]),A(-I[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),I[2]))),b[3]),m(g(m(g(m(A(x[1],b[0]),A(-b[1],x[0])),y[2]),m(g(m(A(y[1],b[0]),A(-b[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),b[2]))),-I[3]),g(m(g(m(A(C[1],b[0]),A(-b[1],C[0])),x[2]),m(g(m(A(x[1],b[0]),A(-b[1],x[0])),-C[2]),g(m(A(x[1],C[0]),A(-C[1],x[0])),b[2]))),y[3]))),m(g(m(g(m(A(C[1],b[0]),A(-b[1],C[0])),y[2]),m(g(m(A(y[1],b[0]),A(-b[1],y[0])),-C[2]),g(m(A(y[1],C[0]),A(-C[1],y[0])),b[2]))),-x[3]),m(g(m(g(m(A(x[1],b[0]),A(-b[1],x[0])),y[2]),m(g(m(A(y[1],b[0]),A(-b[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),b[2]))),C[3]),g(m(g(m(A(x[1],C[0]),A(-C[1],x[0])),y[2]),m(g(m(A(y[1],C[0]),A(-C[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),C[2]))),-b[3]))))),P=m(m(m(g(m(g(m(A(b[1],I[0]),A(-I[1],b[0])),C[2]),m(g(m(A(C[1],I[0]),A(-I[1],C[0])),-b[2]),g(m(A(C[1],b[0]),A(-b[1],C[0])),I[2]))),y[3]),g(m(g(m(A(b[1],I[0]),A(-I[1],b[0])),y[2]),m(g(m(A(y[1],I[0]),A(-I[1],y[0])),-b[2]),g(m(A(y[1],b[0]),A(-b[1],y[0])),I[2]))),-C[3])),m(g(m(g(m(A(C[1],I[0]),A(-I[1],C[0])),y[2]),m(g(m(A(y[1],I[0]),A(-I[1],y[0])),-C[2]),g(m(A(y[1],C[0]),A(-C[1],y[0])),I[2]))),b[3]),g(m(g(m(A(C[1],b[0]),A(-b[1],C[0])),y[2]),m(g(m(A(y[1],b[0]),A(-b[1],y[0])),-C[2]),g(m(A(y[1],C[0]),A(-C[1],y[0])),b[2]))),-I[3]))),m(m(g(m(g(m(A(C[1],I[0]),A(-I[1],C[0])),x[2]),m(g(m(A(x[1],I[0]),A(-I[1],x[0])),-C[2]),g(m(A(x[1],C[0]),A(-C[1],x[0])),I[2]))),y[3]),g(m(g(m(A(C[1],I[0]),A(-I[1],C[0])),y[2]),m(g(m(A(y[1],I[0]),A(-I[1],y[0])),-C[2]),g(m(A(y[1],C[0]),A(-C[1],y[0])),I[2]))),-x[3])),m(g(m(g(m(A(x[1],I[0]),A(-I[1],x[0])),y[2]),m(g(m(A(y[1],I[0]),A(-I[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),I[2]))),C[3]),g(m(g(m(A(x[1],C[0]),A(-C[1],x[0])),y[2]),m(g(m(A(y[1],C[0]),A(-C[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),C[2]))),-I[3])))),M=f(v,P);return M[M.length-1]}}function l(m){return(m===3?s:m===4?a:c)(o,n,r,i)}var h=l(3),d=l(4),u=[function(){return 0},function(){return 0},function(m,A){return A[0]-m[0]},function(m,A,g){var f,y=(m[1]-g[1])*(A[0]-g[0]),x=(m[0]-g[0])*(A[1]-g[1]),C=y-x;if(y>0){if(x<=0)return C;f=y+x}else{if(!(y<0))return C;if(x>=0)return C;f=-(y+x)}var b=0.00000000000000033306690738754716*f;return C>=b||C<=-b?C:h(m,A,g)},function(m,A,g,f){var y=m[0]-f[0],x=A[0]-f[0],C=g[0]-f[0],b=m[1]-f[1],I=A[1]-f[1],v=g[1]-f[1],P=m[2]-f[2],M=A[2]-f[2],B=g[2]-f[2],T=x*v,N=C*I,D=C*b,L=y*v,H=y*I,V=x*b,O=P*(T-N)+M*(D-L)+B*(H-V),U=0.0000000000000007771561172376103*((Math.abs(T)+Math.abs(N))*Math.abs(P)+(Math.abs(D)+Math.abs(L))*Math.abs(M)+(Math.abs(H)+Math.abs(V))*Math.abs(B));return O>U||-O>U?O:d(m,A,g,f)}];function _(m){var A=u[m.length];return A||(A=u[m.length]=l(m.length)),A.apply(void 0,m)}function p(m,A,g,f,y,x,C){return function(b,I,v,P,M){switch(arguments.length){case 0:case 1:return 0;case 2:return f(b,I);case 3:return y(b,I,v);case 4:return x(b,I,v,P);case 5:return C(b,I,v,P,M)}for(var B=Array(arguments.length),T=0;T<arguments.length;++T)B[T]=arguments[T];return m(B)}}(function(){for(;u.length<=5;)u.push(l(u.length));t.exports=p.apply(void 0,[_].concat(u));for(var m=0;m<=5;++m)t.exports[m]=u[m]})()}}),Zjr=e_({"node_modules/cdt2d/lib/monotone.js"(e,t){var n=K8e(),o=Jjr()[3];function r(u,_,p,m,A){this.a=u,this.b=_,this.idx=p,this.lowerIds=m,this.upperIds=A}function i(u,_,p,m){this.a=u,this.b=_,this.type=p,this.idx=m}function s(u,_){var p=u.a[0]-_.a[0]||u.a[1]-_.a[1]||u.type-_.type;return p||(u.type!==0&&(p=o(u.a,u.b,_.b))?p:u.idx-_.idx)}function a(u,_){return o(u.a,u.b,_)}function c(u,_,p,m,A){for(var g=n.lt(_,m,a),f=n.gt(_,m,a),y=g;y<f;++y){for(var x=_[y],C=x.lowerIds,b=C.length;b>1&&o(p[C[b-2]],p[C[b-1]],m)>0;)u.push([C[b-1],C[b-2],A]),b-=1;C.length=b,C.push(A);var I=x.upperIds;for(b=I.length;b>1&&o(p[I[b-2]],p[I[b-1]],m)<0;)u.push([I[b-2],I[b-1],A]),b-=1;I.length=b,I.push(A)}}function l(u,_){var p;return(p=u.a[0]<_.a[0]?o(u.a,u.b,_.a):o(_.b,_.a,u.a))?p:(p=_.b[0]<u.b[0]?o(u.a,u.b,_.b):o(_.b,_.a,u.b))||u.idx-_.idx}function h(u,_,p){var m=n.le(u,p,l),A=u[m],g=A.upperIds,f=g[g.length-1];A.upperIds=[f],u.splice(m+1,0,new r(p.a,p.b,p.idx,[f],g))}function d(u,_,p){var m=p.a;p.a=p.b,p.b=m;var A=n.eq(u,p,l),g=u[A];u[A-1].upperIds=g.upperIds,u.splice(A,1)}t.exports=function(u,_){for(var p=u.length,m=_.length,A=[],g=0;g<p;++g)A.push(new i(u[g],null,0,g));for(g=0;g<m;++g){var f=_[g],y=u[f[0]],x=u[f[1]];y[0]<x[0]?A.push(new i(y,x,2,g),new i(x,y,1,g)):y[0]>x[0]&&A.push(new i(x,y,2,g),new i(y,x,1,g))}A.sort(s);for(var C=A[0].a[0]-(1+Math.abs(A[0].a[0]))*Math.pow(2,-52),b=[new r([C,1],[C,0],-1,[],[],[],[])],I=[],v=(g=0,A.length);g<v;++g){var P=A[g],M=P.type;M===0?c(I,b,u,P.a,P.idx):M===2?h(b,u,P):d(b,u,P)}return I}}}),eKr=e_({"node_modules/cdt2d/lib/triangulation.js"(e,t){var n=K8e();function o(s,a){this.stars=s,this.edges=a}t.exports=function(s,a){for(var c=Array(s),l=0;l<s;++l)c[l]=[];return new o(c,a)};var r=o.prototype;function i(s,a,c){for(var l=1,h=s.length;l<h;l+=2)if(s[l-1]===a&&s[l]===c)return s[l-1]=s[h-2],s[l]=s[h-1],void(s.length=h-2)}r.isConstraint=function(){var s=[0,0];function a(c,l){return c[0]-l[0]||c[1]-l[1]}return function(c,l){return s[0]=Math.min(c,l),s[1]=Math.max(c,l),n.eq(this.edges,s,a)>=0}}(),r.removeTriangle=function(s,a,c){var l=this.stars;i(l[s],a,c),i(l[a],c,s),i(l[c],s,a)},r.addTriangle=function(s,a,c){var l=this.stars;l[s].push(a,c),l[a].push(c,s),l[c].push(s,a)},r.opposite=function(s,a){for(var c=this.stars[a],l=1,h=c.length;l<h;l+=2)if(c[l]===s)return c[l-1];return-1},r.flip=function(s,a){var c=this.opposite(s,a),l=this.opposite(a,s);this.removeTriangle(s,a,c),this.removeTriangle(a,s,l),this.addTriangle(s,l,c),this.addTriangle(a,c,l)},r.edges=function(){for(var s=this.stars,a=[],c=0,l=s.length;c<l;++c)for(var h=s[c],d=0,u=h.length;d<u;d+=2)a.push([h[d],h[d+1]]);return a},r.cells=function(){for(var s=this.stars,a=[],c=0,l=s.length;c<l;++c)for(var h=s[c],d=0,u=h.length;d<u;d+=2){var _=h[d],p=h[d+1];c<Math.min(_,p)&&a.push([c,_,p])}return a}}}),tKr=e_({"node_modules/robust-in-sphere/in-sphere.js"(e,t){var n=_at(),o=Abn(),r=ybn(),i=fbn();function s(p){return(p===3?a:p===4?c:p===5?l:h)(o,r,n,i)}function a(p,m,A,g){return function(f,y,x){var C=A(f[0],f[0]),b=g(C,y[0]),I=g(C,x[0]),v=A(y[0],y[0]),P=g(v,f[0]),M=g(v,x[0]),B=A(x[0],x[0]),T=g(B,f[0]),N=g(B,y[0]),D=p(m(N,M),m(P,b)),L=m(T,I),H=m(D,L);return H[H.length-1]}}function c(p,m,A,g){return function(f,y,x,C){var b=p(A(f[0],f[0]),A(f[1],f[1])),I=g(b,y[0]),v=g(b,x[0]),P=g(b,C[0]),M=p(A(y[0],y[0]),A(y[1],y[1])),B=g(M,f[0]),T=g(M,x[0]),N=g(M,C[0]),D=p(A(x[0],x[0]),A(x[1],x[1])),L=g(D,f[0]),H=g(D,y[0]),V=g(D,C[0]),O=p(A(C[0],C[0]),A(C[1],C[1])),U=g(O,f[0]),j=g(O,y[0]),Y=g(O,x[0]),X=p(p(g(m(Y,V),y[1]),p(g(m(j,N),-x[1]),g(m(H,T),C[1]))),p(g(m(j,N),f[1]),p(g(m(U,P),-y[1]),g(m(B,I),C[1])))),K=p(p(g(m(Y,V),f[1]),p(g(m(U,P),-x[1]),g(m(L,v),C[1]))),p(g(m(H,T),f[1]),p(g(m(L,v),-y[1]),g(m(B,I),x[1])))),J=m(X,K);return J[J.length-1]}}function l(p,m,A,g){return function(f,y,x,C,b){var I=p(A(f[0],f[0]),p(A(f[1],f[1]),A(f[2],f[2]))),v=g(I,y[0]),P=g(I,x[0]),M=g(I,C[0]),B=g(I,b[0]),T=p(A(y[0],y[0]),p(A(y[1],y[1]),A(y[2],y[2]))),N=g(T,f[0]),D=g(T,x[0]),L=g(T,C[0]),H=g(T,b[0]),V=p(A(x[0],x[0]),p(A(x[1],x[1]),A(x[2],x[2]))),O=g(V,f[0]),U=g(V,y[0]),j=g(V,C[0]),Y=g(V,b[0]),X=p(A(C[0],C[0]),p(A(C[1],C[1]),A(C[2],C[2]))),K=g(X,f[0]),J=g(X,y[0]),ee=g(X,x[0]),se=g(X,b[0]),ne=p(A(b[0],b[0]),p(A(b[1],b[1]),A(b[2],b[2]))),re=g(ne,f[0]),Z=g(ne,y[0]),te=g(ne,x[0]),ie=g(ne,C[0]),le=p(p(p(g(p(g(m(ie,se),x[1]),p(g(m(te,Y),-C[1]),g(m(ee,j),b[1]))),y[2]),p(g(p(g(m(ie,se),y[1]),p(g(m(Z,H),-C[1]),g(m(J,L),b[1]))),-x[2]),g(p(g(m(te,Y),y[1]),p(g(m(Z,H),-x[1]),g(m(U,D),b[1]))),C[2]))),p(g(p(g(m(ee,j),y[1]),p(g(m(J,L),-x[1]),g(m(U,D),C[1]))),-b[2]),p(g(p(g(m(ie,se),y[1]),p(g(m(Z,H),-C[1]),g(m(J,L),b[1]))),f[2]),g(p(g(m(ie,se),f[1]),p(g(m(re,B),-C[1]),g(m(K,M),b[1]))),-y[2])))),p(p(g(p(g(m(Z,H),f[1]),p(g(m(re,B),-y[1]),g(m(N,v),b[1]))),C[2]),p(g(p(g(m(J,L),f[1]),p(g(m(K,M),-y[1]),g(m(N,v),C[1]))),-b[2]),g(p(g(m(ee,j),y[1]),p(g(m(J,L),-x[1]),g(m(U,D),C[1]))),f[2]))),p(g(p(g(m(ee,j),f[1]),p(g(m(K,M),-x[1]),g(m(O,P),C[1]))),-y[2]),p(g(p(g(m(J,L),f[1]),p(g(m(K,M),-y[1]),g(m(N,v),C[1]))),x[2]),g(p(g(m(U,D),f[1]),p(g(m(O,P),-y[1]),g(m(N,v),x[1]))),-C[2]))))),ue=p(p(p(g(p(g(m(ie,se),x[1]),p(g(m(te,Y),-C[1]),g(m(ee,j),b[1]))),f[2]),g(p(g(m(ie,se),f[1]),p(g(m(re,B),-C[1]),g(m(K,M),b[1]))),-x[2])),p(g(p(g(m(te,Y),f[1]),p(g(m(re,B),-x[1]),g(m(O,P),b[1]))),C[2]),g(p(g(m(ee,j),f[1]),p(g(m(K,M),-x[1]),g(m(O,P),C[1]))),-b[2]))),p(p(g(p(g(m(te,Y),y[1]),p(g(m(Z,H),-x[1]),g(m(U,D),b[1]))),f[2]),g(p(g(m(te,Y),f[1]),p(g(m(re,B),-x[1]),g(m(O,P),b[1]))),-y[2])),p(g(p(g(m(Z,H),f[1]),p(g(m(re,B),-y[1]),g(m(N,v),b[1]))),x[2]),g(p(g(m(U,D),f[1]),p(g(m(O,P),-y[1]),g(m(N,v),x[1]))),-b[2])))),de=m(le,ue);return de[de.length-1]}}function h(p,m,A,g){return function(f,y,x,C,b,I){var v=p(p(A(f[0],f[0]),A(f[1],f[1])),p(A(f[2],f[2]),A(f[3],f[3]))),P=g(v,y[0]),M=g(v,x[0]),B=g(v,C[0]),T=g(v,b[0]),N=g(v,I[0]),D=p(p(A(y[0],y[0]),A(y[1],y[1])),p(A(y[2],y[2]),A(y[3],y[3]))),L=g(D,f[0]),H=g(D,x[0]),V=g(D,C[0]),O=g(D,b[0]),U=g(D,I[0]),j=p(p(A(x[0],x[0]),A(x[1],x[1])),p(A(x[2],x[2]),A(x[3],x[3]))),Y=g(j,f[0]),X=g(j,y[0]),K=g(j,C[0]),J=g(j,b[0]),ee=g(j,I[0]),se=p(p(A(C[0],C[0]),A(C[1],C[1])),p(A(C[2],C[2]),A(C[3],C[3]))),ne=g(se,f[0]),re=g(se,y[0]),Z=g(se,x[0]),te=g(se,b[0]),ie=g(se,I[0]),le=p(p(A(b[0],b[0]),A(b[1],b[1])),p(A(b[2],b[2]),A(b[3],b[3]))),ue=g(le,f[0]),de=g(le,y[0]),me=g(le,x[0]),Ae=g(le,C[0]),xe=g(le,I[0]),Me=p(p(A(I[0],I[0]),A(I[1],I[1])),p(A(I[2],I[2]),A(I[3],I[3]))),Re=g(Me,f[0]),we=g(Me,y[0]),_e=g(Me,x[0]),ye=g(Me,C[0]),Se=g(Me,b[0]),Ne=p(p(p(g(p(p(g(p(g(m(Se,xe),C[1]),p(g(m(ye,ie),-b[1]),g(m(Ae,te),I[1]))),x[2]),g(p(g(m(Se,xe),x[1]),p(g(m(_e,ee),-b[1]),g(m(me,J),I[1]))),-C[2])),p(g(p(g(m(ye,ie),x[1]),p(g(m(_e,ee),-C[1]),g(m(Z,K),I[1]))),b[2]),g(p(g(m(Ae,te),x[1]),p(g(m(me,J),-C[1]),g(m(Z,K),b[1]))),-I[2]))),y[3]),p(g(p(p(g(p(g(m(Se,xe),C[1]),p(g(m(ye,ie),-b[1]),g(m(Ae,te),I[1]))),y[2]),g(p(g(m(Se,xe),y[1]),p(g(m(we,U),-b[1]),g(m(de,O),I[1]))),-C[2])),p(g(p(g(m(ye,ie),y[1]),p(g(m(we,U),-C[1]),g(m(re,V),I[1]))),b[2]),g(p(g(m(Ae,te),y[1]),p(g(m(de,O),-C[1]),g(m(re,V),b[1]))),-I[2]))),-x[3]),g(p(p(g(p(g(m(Se,xe),x[1]),p(g(m(_e,ee),-b[1]),g(m(me,J),I[1]))),y[2]),g(p(g(m(Se,xe),y[1]),p(g(m(we,U),-b[1]),g(m(de,O),I[1]))),-x[2])),p(g(p(g(m(_e,ee),y[1]),p(g(m(we,U),-x[1]),g(m(X,H),I[1]))),b[2]),g(p(g(m(me,J),y[1]),p(g(m(de,O),-x[1]),g(m(X,H),b[1]))),-I[2]))),C[3]))),p(p(g(p(p(g(p(g(m(ye,ie),x[1]),p(g(m(_e,ee),-C[1]),g(m(Z,K),I[1]))),y[2]),g(p(g(m(ye,ie),y[1]),p(g(m(we,U),-C[1]),g(m(re,V),I[1]))),-x[2])),p(g(p(g(m(_e,ee),y[1]),p(g(m(we,U),-x[1]),g(m(X,H),I[1]))),C[2]),g(p(g(m(Z,K),y[1]),p(g(m(re,V),-x[1]),g(m(X,H),C[1]))),-I[2]))),-b[3]),g(p(p(g(p(g(m(Ae,te),x[1]),p(g(m(me,J),-C[1]),g(m(Z,K),b[1]))),y[2]),g(p(g(m(Ae,te),y[1]),p(g(m(de,O),-C[1]),g(m(re,V),b[1]))),-x[2])),p(g(p(g(m(me,J),y[1]),p(g(m(de,O),-x[1]),g(m(X,H),b[1]))),C[2]),g(p(g(m(Z,K),y[1]),p(g(m(re,V),-x[1]),g(m(X,H),C[1]))),-b[2]))),I[3])),p(g(p(p(g(p(g(m(Se,xe),C[1]),p(g(m(ye,ie),-b[1]),g(m(Ae,te),I[1]))),y[2]),g(p(g(m(Se,xe),y[1]),p(g(m(we,U),-b[1]),g(m(de,O),I[1]))),-C[2])),p(g(p(g(m(ye,ie),y[1]),p(g(m(we,U),-C[1]),g(m(re,V),I[1]))),b[2]),g(p(g(m(Ae,te),y[1]),p(g(m(de,O),-C[1]),g(m(re,V),b[1]))),-I[2]))),f[3]),g(p(p(g(p(g(m(Se,xe),C[1]),p(g(m(ye,ie),-b[1]),g(m(Ae,te),I[1]))),f[2]),g(p(g(m(Se,xe),f[1]),p(g(m(Re,N),-b[1]),g(m(ue,T),I[1]))),-C[2])),p(g(p(g(m(ye,ie),f[1]),p(g(m(Re,N),-C[1]),g(m(ne,B),I[1]))),b[2]),g(p(g(m(Ae,te),f[1]),p(g(m(ue,T),-C[1]),g(m(ne,B),b[1]))),-I[2]))),-y[3])))),p(p(p(g(p(p(g(p(g(m(Se,xe),y[1]),p(g(m(we,U),-b[1]),g(m(de,O),I[1]))),f[2]),g(p(g(m(Se,xe),f[1]),p(g(m(Re,N),-b[1]),g(m(ue,T),I[1]))),-y[2])),p(g(p(g(m(we,U),f[1]),p(g(m(Re,N),-y[1]),g(m(L,P),I[1]))),b[2]),g(p(g(m(de,O),f[1]),p(g(m(ue,T),-y[1]),g(m(L,P),b[1]))),-I[2]))),C[3]),g(p(p(g(p(g(m(ye,ie),y[1]),p(g(m(we,U),-C[1]),g(m(re,V),I[1]))),f[2]),g(p(g(m(ye,ie),f[1]),p(g(m(Re,N),-C[1]),g(m(ne,B),I[1]))),-y[2])),p(g(p(g(m(we,U),f[1]),p(g(m(Re,N),-y[1]),g(m(L,P),I[1]))),C[2]),g(p(g(m(re,V),f[1]),p(g(m(ne,B),-y[1]),g(m(L,P),C[1]))),-I[2]))),-b[3])),p(g(p(p(g(p(g(m(Ae,te),y[1]),p(g(m(de,O),-C[1]),g(m(re,V),b[1]))),f[2]),g(p(g(m(Ae,te),f[1]),p(g(m(ue,T),-C[1]),g(m(ne,B),b[1]))),-y[2])),p(g(p(g(m(de,O),f[1]),p(g(m(ue,T),-y[1]),g(m(L,P),b[1]))),C[2]),g(p(g(m(re,V),f[1]),p(g(m(ne,B),-y[1]),g(m(L,P),C[1]))),-b[2]))),I[3]),g(p(p(g(p(g(m(ye,ie),x[1]),p(g(m(_e,ee),-C[1]),g(m(Z,K),I[1]))),y[2]),g(p(g(m(ye,ie),y[1]),p(g(m(we,U),-C[1]),g(m(re,V),I[1]))),-x[2])),p(g(p(g(m(_e,ee),y[1]),p(g(m(we,U),-x[1]),g(m(X,H),I[1]))),C[2]),g(p(g(m(Z,K),y[1]),p(g(m(re,V),-x[1]),g(m(X,H),C[1]))),-I[2]))),f[3]))),p(p(g(p(p(g(p(g(m(ye,ie),x[1]),p(g(m(_e,ee),-C[1]),g(m(Z,K),I[1]))),f[2]),g(p(g(m(ye,ie),f[1]),p(g(m(Re,N),-C[1]),g(m(ne,B),I[1]))),-x[2])),p(g(p(g(m(_e,ee),f[1]),p(g(m(Re,N),-x[1]),g(m(Y,M),I[1]))),C[2]),g(p(g(m(Z,K),f[1]),p(g(m(ne,B),-x[1]),g(m(Y,M),C[1]))),-I[2]))),-y[3]),g(p(p(g(p(g(m(ye,ie),y[1]),p(g(m(we,U),-C[1]),g(m(re,V),I[1]))),f[2]),g(p(g(m(ye,ie),f[1]),p(g(m(Re,N),-C[1]),g(m(ne,B),I[1]))),-y[2])),p(g(p(g(m(we,U),f[1]),p(g(m(Re,N),-y[1]),g(m(L,P),I[1]))),C[2]),g(p(g(m(re,V),f[1]),p(g(m(ne,B),-y[1]),g(m(L,P),C[1]))),-I[2]))),x[3])),p(g(p(p(g(p(g(m(_e,ee),y[1]),p(g(m(we,U),-x[1]),g(m(X,H),I[1]))),f[2]),g(p(g(m(_e,ee),f[1]),p(g(m(Re,N),-x[1]),g(m(Y,M),I[1]))),-y[2])),p(g(p(g(m(we,U),f[1]),p(g(m(Re,N),-y[1]),g(m(L,P),I[1]))),x[2]),g(p(g(m(X,H),f[1]),p(g(m(Y,M),-y[1]),g(m(L,P),x[1]))),-I[2]))),-C[3]),g(p(p(g(p(g(m(Z,K),y[1]),p(g(m(re,V),-x[1]),g(m(X,H),C[1]))),f[2]),g(p(g(m(Z,K),f[1]),p(g(m(ne,B),-x[1]),g(m(Y,M),C[1]))),-y[2])),p(g(p(g(m(re,V),f[1]),p(g(m(ne,B),-y[1]),g(m(L,P),C[1]))),x[2]),g(p(g(m(X,H),f[1]),p(g(m(Y,M),-y[1]),g(m(L,P),x[1]))),-C[2]))),I[3]))))),ke=p(p(p(g(p(p(g(p(g(m(Se,xe),C[1]),p(g(m(ye,ie),-b[1]),g(m(Ae,te),I[1]))),x[2]),g(p(g(m(Se,xe),x[1]),p(g(m(_e,ee),-b[1]),g(m(me,J),I[1]))),-C[2])),p(g(p(g(m(ye,ie),x[1]),p(g(m(_e,ee),-C[1]),g(m(Z,K),I[1]))),b[2]),g(p(g(m(Ae,te),x[1]),p(g(m(me,J),-C[1]),g(m(Z,K),b[1]))),-I[2]))),f[3]),p(g(p(p(g(p(g(m(Se,xe),C[1]),p(g(m(ye,ie),-b[1]),g(m(Ae,te),I[1]))),f[2]),g(p(g(m(Se,xe),f[1]),p(g(m(Re,N),-b[1]),g(m(ue,T),I[1]))),-C[2])),p(g(p(g(m(ye,ie),f[1]),p(g(m(Re,N),-C[1]),g(m(ne,B),I[1]))),b[2]),g(p(g(m(Ae,te),f[1]),p(g(m(ue,T),-C[1]),g(m(ne,B),b[1]))),-I[2]))),-x[3]),g(p(p(g(p(g(m(Se,xe),x[1]),p(g(m(_e,ee),-b[1]),g(m(me,J),I[1]))),f[2]),g(p(g(m(Se,xe),f[1]),p(g(m(Re,N),-b[1]),g(m(ue,T),I[1]))),-x[2])),p(g(p(g(m(_e,ee),f[1]),p(g(m(Re,N),-x[1]),g(m(Y,M),I[1]))),b[2]),g(p(g(m(me,J),f[1]),p(g(m(ue,T),-x[1]),g(m(Y,M),b[1]))),-I[2]))),C[3]))),p(p(g(p(p(g(p(g(m(ye,ie),x[1]),p(g(m(_e,ee),-C[1]),g(m(Z,K),I[1]))),f[2]),g(p(g(m(ye,ie),f[1]),p(g(m(Re,N),-C[1]),g(m(ne,B),I[1]))),-x[2])),p(g(p(g(m(_e,ee),f[1]),p(g(m(Re,N),-x[1]),g(m(Y,M),I[1]))),C[2]),g(p(g(m(Z,K),f[1]),p(g(m(ne,B),-x[1]),g(m(Y,M),C[1]))),-I[2]))),-b[3]),g(p(p(g(p(g(m(Ae,te),x[1]),p(g(m(me,J),-C[1]),g(m(Z,K),b[1]))),f[2]),g(p(g(m(Ae,te),f[1]),p(g(m(ue,T),-C[1]),g(m(ne,B),b[1]))),-x[2])),p(g(p(g(m(me,J),f[1]),p(g(m(ue,T),-x[1]),g(m(Y,M),b[1]))),C[2]),g(p(g(m(Z,K),f[1]),p(g(m(ne,B),-x[1]),g(m(Y,M),C[1]))),-b[2]))),I[3])),p(g(p(p(g(p(g(m(Se,xe),x[1]),p(g(m(_e,ee),-b[1]),g(m(me,J),I[1]))),y[2]),g(p(g(m(Se,xe),y[1]),p(g(m(we,U),-b[1]),g(m(de,O),I[1]))),-x[2])),p(g(p(g(m(_e,ee),y[1]),p(g(m(we,U),-x[1]),g(m(X,H),I[1]))),b[2]),g(p(g(m(me,J),y[1]),p(g(m(de,O),-x[1]),g(m(X,H),b[1]))),-I[2]))),f[3]),g(p(p(g(p(g(m(Se,xe),x[1]),p(g(m(_e,ee),-b[1]),g(m(me,J),I[1]))),f[2]),g(p(g(m(Se,xe),f[1]),p(g(m(Re,N),-b[1]),g(m(ue,T),I[1]))),-x[2])),p(g(p(g(m(_e,ee),f[1]),p(g(m(Re,N),-x[1]),g(m(Y,M),I[1]))),b[2]),g(p(g(m(me,J),f[1]),p(g(m(ue,T),-x[1]),g(m(Y,M),b[1]))),-I[2]))),-y[3])))),p(p(p(g(p(p(g(p(g(m(Se,xe),y[1]),p(g(m(we,U),-b[1]),g(m(de,O),I[1]))),f[2]),g(p(g(m(Se,xe),f[1]),p(g(m(Re,N),-b[1]),g(m(ue,T),I[1]))),-y[2])),p(g(p(g(m(we,U),f[1]),p(g(m(Re,N),-y[1]),g(m(L,P),I[1]))),b[2]),g(p(g(m(de,O),f[1]),p(g(m(ue,T),-y[1]),g(m(L,P),b[1]))),-I[2]))),x[3]),g(p(p(g(p(g(m(_e,ee),y[1]),p(g(m(we,U),-x[1]),g(m(X,H),I[1]))),f[2]),g(p(g(m(_e,ee),f[1]),p(g(m(Re,N),-x[1]),g(m(Y,M),I[1]))),-y[2])),p(g(p(g(m(we,U),f[1]),p(g(m(Re,N),-y[1]),g(m(L,P),I[1]))),x[2]),g(p(g(m(X,H),f[1]),p(g(m(Y,M),-y[1]),g(m(L,P),x[1]))),-I[2]))),-b[3])),p(g(p(p(g(p(g(m(me,J),y[1]),p(g(m(de,O),-x[1]),g(m(X,H),b[1]))),f[2]),g(p(g(m(me,J),f[1]),p(g(m(ue,T),-x[1]),g(m(Y,M),b[1]))),-y[2])),p(g(p(g(m(de,O),f[1]),p(g(m(ue,T),-y[1]),g(m(L,P),b[1]))),x[2]),g(p(g(m(X,H),f[1]),p(g(m(Y,M),-y[1]),g(m(L,P),x[1]))),-b[2]))),I[3]),g(p(p(g(p(g(m(Ae,te),x[1]),p(g(m(me,J),-C[1]),g(m(Z,K),b[1]))),y[2]),g(p(g(m(Ae,te),y[1]),p(g(m(de,O),-C[1]),g(m(re,V),b[1]))),-x[2])),p(g(p(g(m(me,J),y[1]),p(g(m(de,O),-x[1]),g(m(X,H),b[1]))),C[2]),g(p(g(m(Z,K),y[1]),p(g(m(re,V),-x[1]),g(m(X,H),C[1]))),-b[2]))),f[3]))),p(p(g(p(p(g(p(g(m(Ae,te),x[1]),p(g(m(me,J),-C[1]),g(m(Z,K),b[1]))),f[2]),g(p(g(m(Ae,te),f[1]),p(g(m(ue,T),-C[1]),g(m(ne,B),b[1]))),-x[2])),p(g(p(g(m(me,J),f[1]),p(g(m(ue,T),-x[1]),g(m(Y,M),b[1]))),C[2]),g(p(g(m(Z,K),f[1]),p(g(m(ne,B),-x[1]),g(m(Y,M),C[1]))),-b[2]))),-y[3]),g(p(p(g(p(g(m(Ae,te),y[1]),p(g(m(de,O),-C[1]),g(m(re,V),b[1]))),f[2]),g(p(g(m(Ae,te),f[1]),p(g(m(ue,T),-C[1]),g(m(ne,B),b[1]))),-y[2])),p(g(p(g(m(de,O),f[1]),p(g(m(ue,T),-y[1]),g(m(L,P),b[1]))),C[2]),g(p(g(m(re,V),f[1]),p(g(m(ne,B),-y[1]),g(m(L,P),C[1]))),-b[2]))),x[3])),p(g(p(p(g(p(g(m(me,J),y[1]),p(g(m(de,O),-x[1]),g(m(X,H),b[1]))),f[2]),g(p(g(m(me,J),f[1]),p(g(m(ue,T),-x[1]),g(m(Y,M),b[1]))),-y[2])),p(g(p(g(m(de,O),f[1]),p(g(m(ue,T),-y[1]),g(m(L,P),b[1]))),x[2]),g(p(g(m(X,H),f[1]),p(g(m(Y,M),-y[1]),g(m(L,P),x[1]))),-b[2]))),-C[3]),g(p(p(g(p(g(m(Z,K),y[1]),p(g(m(re,V),-x[1]),g(m(X,H),C[1]))),f[2]),g(p(g(m(Z,K),f[1]),p(g(m(ne,B),-x[1]),g(m(Y,M),C[1]))),-y[2])),p(g(p(g(m(re,V),f[1]),p(g(m(ne,B),-y[1]),g(m(L,P),C[1]))),x[2]),g(p(g(m(X,H),f[1]),p(g(m(Y,M),-y[1]),g(m(L,P),x[1]))),-C[2]))),b[3]))))),nt=m(Ne,ke);return nt[nt.length-1]}}var d=[function(){return 0},function(){return 0},function(){return 0}];function u(p){var m=d[p.length];return m||(m=d[p.length]=s(p.length)),m.apply(void 0,p)}function _(p,m,A,g,f,y,x,C){return function(b,I,v,P,M,B){switch(arguments.length){case 0:case 1:return 0;case 2:return g(b,I);case 3:return f(b,I,v);case 4:return y(b,I,v,P);case 5:return x(b,I,v,P,M);case 6:return C(b,I,v,P,M,B)}for(var T=Array(arguments.length),N=0;N<arguments.length;++N)T[N]=arguments[N];return p(T)}}(function(){for(;d.length<=6;)d.push(s(d.length));t.exports=_.apply(void 0,[u].concat(d));for(var p=0;p<=6;++p)t.exports[p]=d[p]})()}}),nKr=e_({"node_modules/cdt2d/lib/delaunay.js"(e,t){var n=tKr()[4];K8e();function o(r,i,s,a,c,l){var h=i.opposite(a,c);if(!(h<0)){if(c<a){var d=a;a=c,c=d,d=l,l=h,h=d}i.isConstraint(a,c)||n(r[a],r[c],r[l],r[h])<0&&s.push(a,c)}}t.exports=function(r,i){for(var s=[],a=r.length,c=i.stars,l=0;l<a;++l)for(var h=c[l],d=1;d<h.length;d+=2)if(!((m=h[d])<l)&&!i.isConstraint(l,m)){for(var u=h[d-1],_=-1,p=1;p<h.length;p+=2)if(h[p-1]===m){_=h[p];break}_<0||n(r[l],r[m],r[u],r[_])<0&&s.push(l,m)}for(;s.length>0;){for(var m=s.pop(),A=(u=-1,_=-1,h=c[l=s.pop()],1);A<h.length;A+=2){var g=h[A-1],f=h[A];g===m?_=f:f===m&&(u=g)}u<0||_<0||(n(r[l],r[m],r[u],r[_])>=0||(i.flip(l,m),o(r,i,s,u,l,_),o(r,i,s,l,_,u),o(r,i,s,_,m,u),o(r,i,s,m,u,_)))}}}}),oKr=e_({"node_modules/cdt2d/lib/filter.js"(e,t){var n=K8e();function o(i,s,a,c,l,h,d){this.cells=i,this.neighbor=s,this.flags=c,this.constraint=a,this.active=l,this.next=h,this.boundary=d}function r(i,s){return i[0]-s[0]||i[1]-s[1]||i[2]-s[2]}t.exports=function(i,s,a){var c=function(C,b){for(var I=C.cells(),v=I.length,P=0;P<v;++P){var M=(j=I[P])[0],B=j[1],T=j[2];B<T?B<M&&(j[0]=B,j[1]=T,j[2]=M):T<M&&(j[0]=T,j[1]=M,j[2]=B)}I.sort(r);var N=Array(v);for(P=0;P<N.length;++P)N[P]=0;var D=[],L=[],H=Array(3*v),V=Array(3*v),O=null;b&&(O=[]);var U=new o(I,H,V,N,D,L,O);for(P=0;P<v;++P)for(var j=I[P],Y=0;Y<3;++Y){M=j[Y],B=j[(Y+1)%3];var X=H[3*P+Y]=U.locate(B,M,C.opposite(B,M)),K=V[3*P+Y]=C.isConstraint(M,B);X<0&&(K?L.push(P):(D.push(P),N[P]=1),b&&O.push([B,M,-1]))}return U}(i,a);if(s===0)return a?c.cells.concat(c.boundary):c.cells;var l=1,{active:h,next:d,flags:u,cells:_,constraint:p,neighbor:m}=c;for(;h.length>0||d.length>0;){for(;h.length>0;){var A=h.pop();if(u[A]!==-l){u[A]=l,_[A];for(var g=0;g<3;++g){var f=m[3*A+g];f>=0&&u[f]===0&&(p[3*A+g]?d.push(f):(h.push(f),u[f]=l))}}}var y=d;d=h,h=y,d.length=0,l=-l}var x=function(C,b,I){for(var v=0,P=0;P<C.length;++P)b[P]===I&&(C[v++]=C[P]);return C.length=v,C}(_,u,s);if(a)return x.concat(c.boundary);return x},o.prototype.locate=function(){var i=[0,0,0];return function(s,a,c){var l=s,h=a,d=c;return a<c?a<s&&(l=a,h=c,d=s):c<s&&(l=c,h=s,d=a),l<0?-1:(i[0]=l,i[1]=h,i[2]=d,n.eq(this.cells,i,r))}}()}}),rKr=e_({"node_modules/cdt2d/cdt2d.js"(e,t){var n=Zjr(),o=eKr(),r=nKr(),i=oKr();function s(l){return[Math.min(l[0],l[1]),Math.max(l[0],l[1])]}function a(l,h){return l[0]-h[0]||l[1]-h[1]}function c(l,h,d){return h in l?l[h]:d}t.exports=function(l,h,d){Array.isArray(h)?(d=d||{},h=h||[]):(d=h||{},h=[]);var u=!!c(d,"delaunay",!0),_=!!c(d,"interior",!0),p=!!c(d,"exterior",!0),m=!!c(d,"infinity",!1);if(!_&&!p||l.length===0)return[];var A=n(l,h);if(u||_!==p||m){for(var g=o(l.length,function(x){return x.map(s).sort(a)}(h)),f=0;f<A.length;++f){var y=A[f];g.addTriangle(y[0],y[1],y[2])}return u&&r(l,g),p?_?m?i(g,0,m):g.cells():i(g,1,m):i(g,-1)}return A}}}),I2n={0:"M0.301025 0.257813 L0.206593 0.283385 L0.122042 0.361307 L0.075923 0.474441 L0.064942 0.642221 L0.091296 0.78289 L0.159376 0.899463 L0.257104 0.961214 L0.344948 0.961214 L0.442678 0.899463 L0.510757 0.78289 L0.537111 0.642221 L0.526131 0.474441 L0.480012 0.361307 L0.39546 0.283385 L0.301025 0.257813",1:"M0.220426 0.40845 L0.381626 0.270996 L0.381626 0.948966",2:"M0.110409 0.39212 L0.125621 0.342293 L0.170571 0.295823 L0.244237 0.26431 L0.291518 0.257813 L0.373319 0.263799 L0.434683 0.290705 L0.468239 0.331966 L0.480292 0.379913 L0.479492 0.411806 L0.465088 0.465192 L0.402571 0.568988 L0.245134 0.766438 L0.07959 0.948045 L0.522462 0.948045",3:"M0.081606 0.345073 L0.119154 0.315633 L0.178996 0.284091 L0.255265 0.257813 L0.349133 0.263062 L0.43127 0.289348 L0.48994 0.336662 L0.525141 0.394491 L0.513407 0.457577 L0.466472 0.504892 L0.384334 0.541692 L0.290464 0.56272 L0.20833 0.573235 L0.290464 0.583749 L0.384334 0.610035 L0.466472 0.652092 L0.519274 0.709922 L0.531007 0.773007 L0.50754 0.841351 L0.454738 0.899179 L0.3726 0.946494 L0.310412 0.961214 L0.209503 0.959111 L0.127367 0.946494 L0.071046 0.929671",4:"M0.418494 0.270996 L0.048828 0.724199 L0.553224 0.724199 M0.414181 0.578167 L0.414181 0.94897",5:"M0.074951 0.270996 L0.074951 0.614701 L0.267655 0.5695 L0.405247 0.586502 L0.460002 0.617189 L0.498028 0.660731 L0.527101 0.779401 L0.513352 0.841049 L0.477274 0.889568 L0.406378 0.93463 L0.324445 0.958337 L0.247399 0.962139 L0.182516 0.949767 L0.130068 0.925508 L0.074951 0.875607 M0.074951 0.270996 L0.527101 0.270996",6:"M0.428549 0.257813 L0.341433 0.285053 L0.26073 0.312099 L0.192188 0.360182 L0.138902 0.410969 L0.098219 0.500422 L0.070249 0.584267 L0.067264 0.670716 L0.065164 0.756863 L0.087163 0.820973 L0.108168 0.861042 L0.157916 0.913131 L0.210981 0.948192 L0.29279 0.961214 L0.384548 0.956206 L0.456409 0.924151 L0.507262 0.881077 L0.5349 0.821975 L0.537111 0.771889 L0.521634 0.718798 L0.498418 0.67372 L0.463042 0.636657 L0.414398 0.613617 L0.34696 0.598591 L0.28284 0.595587 L0.215403 0.605604 L0.145756 0.641665 L0.109274 0.678729 L0.064942 0.724006",7:"M0.071534 0.270996 L0.530519 0.270996 L0.495935 0.291702 L0.477752 0.305407 L0.435186 0.346112 L0.412067 0.374136 L0.388565 0.40796 L0.365315 0.448098 L0.342943 0.495062 L0.322081 0.549366 L0.303364 0.611524 L0.287416 0.68205 L0.270077 0.80465 L0.26253 0.94897",8:"M0.286761 0.257813 L0.210684 0.27162 L0.1414 0.305622 L0.092494 0.382125 L0.111513 0.450128 L0.16857 0.502193 L0.228345 0.539382 L0.377781 0.594635 L0.470161 0.645637 L0.52586 0.706203 L0.538087 0.792269 L0.506841 0.87621 L0.438915 0.927212 L0.339743 0.961214 L0.263666 0.959089 L0.174004 0.929337 L0.102003 0.881523 L0.063965 0.811395 L0.066682 0.741266 L0.102003 0.671139 L0.180797 0.608448 L0.259591 0.580822 L0.358762 0.548945 L0.456576 0.49688 L0.486463 0.446941 L0.487822 0.362999 L0.453859 0.302434 L0.384574 0.265245 L0.286761 0.257813",9:"M0.511026 0.437812 L0.491026 0.347812 L0.451026 0.297812 L0.391026 0.267812 L0.311026 0.257813 L0.231026 0.267812 L0.161026 0.297812 L0.111026 0.347812 L0.091026 0.417812 L0.111026 0.487812 L0.161026 0.537812 L0.231026 0.567812 L0.311026 0.577812 L0.391026 0.557812 L0.451026 0.517812 L0.491026 0.477812 L0.511026 0.437812 M0.510026 0.438812 L0.434026 0.636812 L0.381026 0.777812 L0.337026 0.879812 L0.301026 0.957812","!":"M0.301026 0.270996 L0.301026 0.749566 M0.251466 0.94897 L0.350587 0.94897",'"':"M0.16504 0.270996 L0.16504 0.523022 M0.437013 0.270996 L0.437013 0.523022","#":"M0.20958 0.282227 L0.146515 0.949754 M0.461844 0.282227 L0.398779 0.949754 M0.032999 0.526969 L0.600587 0.452796 M0.001465 0.82366 L0.569055 0.749486",$:"M0.307121 0.240234 L0.307121 1.083502 M0.490031 0.415915 L0.404676 0.328075 L0.23396 0.310507 L0.136407 0.398347 L0.099828 0.521324 L0.124213 0.591596 L0.197379 0.644299 L0.429061 0.697003 L0.502224 0.749708 L0.526613 0.837547 L0.477836 0.960526 L0.355897 1.013228 L0.197379 0.99566 L0.112021 0.942957 L0.07544 0.837547","'":"M0.301026 0.270996 L0.301026 0.523022","(":"M0.413087 0.241211 L0.372337 0.28347 L0.331589 0.334184 L0.290838 0.393349 L0.25009 0.460965 L0.219528 0.528584 L0.199153 0.5962 L0.188966 0.655364 L0.199153 0.714529 L0.219528 0.782146 L0.25009 0.849764 L0.290838 0.91738 L0.331589 0.976544 L0.372337 1.027258 L0.413087 1.069491",")":"M0.188966 0.241211 L0.229716 0.28347 L0.270466 0.334184 L0.311213 0.393349 L0.351964 0.460965 L0.382526 0.528584 L0.4029 0.5962 L0.413087 0.655364 L0.4029 0.714529 L0.382526 0.782146 L0.351964 0.849764 L0.311213 0.91738 L0.270466 0.976544 L0.229716 1.027258 L0.188966 1.069491","*":"M0.301026 0.458702 L0.301026 0.681942 M0.301026 0.458702 L0.520997 0.536834 M0.301026 0.458702 L0.439954 0.257813 M0.301026 0.458702 L0.162098 0.257813 M0.301026 0.458702 L0.081055 0.536834","+":"M0.042969 0.66845 L0.559083 0.66845 M0.301023 0.428223 L0.301023 0.908661",",":"M0.38672 0.852051 L0.215333 1.030661 L0.301025 1.119971","-":"M0.173829 0.686035 L0.428224 0.686035",".":"M0.362549 0.851074 L0.239503 0.851074","/":"M0.062501 1.035249 L0.539551 0.270996","<":"M0.559083 0.441895 L0.042969 0.66939 L0.042969 0.66939 L0.559083 0.896902","=":"M0.042969 0.545898 L0.559083 0.545898 M0.042969 0.80837 L0.559083 0.80837",">":"M0.042969 0.441895 L0.559083 0.66939 L0.559083 0.66939 L0.042969 0.896902",A:"M0.018067 0.94897 L0.290179 0.270996 L0.583986 0.94897 M0.155303 0.684521 L0.433548 0.684521",B:"M0.063965 0.94897 L0.063965 0.278953 L0.209356 0.270996 L0.342486 0.294394 L0.432179 0.37292 L0.418224 0.48773 L0.312686 0.549166 L0.084728 0.575531 L0.306377 0.589434 L0.468877 0.647456 L0.538087 0.736658 L0.5324 0.85202 L0.501247 0.902983 L0.42355 0.944398 L0.063965 0.94897",C:"M0.529054 0.419847 L0.498425 0.345196 L0.442238 0.292341 L0.33583 0.257813 L0.257199 0.268357 L0.187906 0.303748 L0.120243 0.385432 L0.072998 0.599844 L0.110073 0.815385 L0.165381 0.902183 L0.222883 0.942801 L0.334904 0.961214 L0.43253 0.937679 L0.504816 0.868999 L0.529054 0.772065",D:"M0.064454 0.94897 L0.071838 0.285078 L0.171217 0.270996 L0.247348 0.272633 L0.37101 0.306078 L0.462461 0.378304 L0.514748 0.475555 L0.535591 0.576392 L0.537599 0.652313 L0.528065 0.717381 L0.508562 0.772419 L0.445948 0.855695 L0.362356 0.90871 L0.225203 0.945862 L0.064454 0.94897",E:"M0.080078 0.270996 L0.080078 0.94897 M0.080078 0.270996 L0.521974 0.270996 M0.080078 0.609981 L0.389405 0.609981 M0.080078 0.94897 L0.521974 0.94897",F:"M0.086426 0.270996 L0.086426 0.94897 M0.091304 0.275607 L0.515626 0.275607 M0.091304 0.607677 L0.447344 0.607677",G:"M0.498034 0.284943 L0.374621 0.257813 L0.244219 0.268648 L0.160577 0.311997 L0.094556 0.398116 L0.056397 0.58404 L0.076752 0.785532 L0.120865 0.858197 L0.188947 0.916734 L0.271008 0.953591 L0.357069 0.961214 L0.43715 0.932047 L0.501262 0.858539 L0.545656 0.648611 L0.329595 0.648131",H:"M0.066895 0.270996 L0.066895 0.94897 M0.066895 0.595658 L0.530009 0.595658 M0.535157 0.270996 L0.535157 0.94897",I:"M0.301026 0.270996 L0.301026 0.94897",J:"M0.506839 0.270996 L0.507814 0.782193 L0.498468 0.846168 L0.480733 0.880789 L0.455864 0.90832 L0.426095 0.929408 L0.360746 0.954812 L0.302508 0.962139 L0.223573 0.953638 L0.16538 0.930312 L0.137072 0.907715 L0.116428 0.880312 L0.102822 0.848819 L0.095633 0.813947 L0.094239 0.776413",K:"M0.035401 0.270996 L0.035401 0.94897 M0.502258 0.316194 L0.035401 0.687823 M0.212484 0.582361 L0.566652 0.933903",L:"M0.07544 0.270996 L0.07544 0.94897 L0.526613 0.94897",M:"M0.042481 0.94897 L0.042481 0.270996 L0.301027 0.712492 L0.559571 0.270996 L0.559571 0.94897",N:"M0.067871 0.94897 L0.067871 0.270996 L0.534181 0.94897 L0.525031 0.270996",O:"M0.287293 0.961214 L0.19843 0.933567 L0.1172 0.849451 L0.057129 0.563945 L0.114348 0.350255 L0.18455 0.289392 L0.306101 0.257813 L0.42054 0.29572 L0.487543 0.365003 L0.544923 0.625294 L0.516366 0.789624 L0.465476 0.884596 L0.375084 0.949287 L0.287293 0.961214",P:"M0.070557 0.94897 L0.070557 0.28379 L0.20704 0.270996 L0.329134 0.278993 L0.408525 0.300514 L0.444022 0.317908 L0.500637 0.368929 L0.525796 0.423728 L0.531496 0.50384 L0.508934 0.554205 L0.473724 0.582043 L0.417577 0.604365 L0.336375 0.620372 L0.226014 0.629268 L0.082368 0.630258",Q:"M0.282435 1.050813 L0.195447 1.019646 L0.115933 0.924817 L0.057129 0.602943 L0.113139 0.362034 L0.18186 0.293418 L0.300844 0.257813 L0.412868 0.300553 L0.478457 0.37866 L0.534625 0.672103 L0.506671 0.857367 L0.456855 0.964437 L0.368371 1.037368 L0.282435 1.050813 M0.341225 0.815559 L0.544923 1.070653",R:"M0.034912 0.944112 L0.034912 0.288556 L0.227127 0.270996 L0.362038 0.276867 L0.443423 0.294907 L0.477644 0.309614 L0.505809 0.328757 L0.526616 0.352817 L0.544963 0.418061 L0.543241 0.475921 L0.524463 0.517817 L0.49076 0.546518 L0.444265 0.564799 L0.355195 0.578739 L0.047653 0.589627 M0.303054 0.617306 L0.56714 0.94897",S:"M0.483037 0.364333 L0.407613 0.267477 L0.22883 0.257813 L0.128623 0.327565 L0.087712 0.455539 L0.104656 0.518727 L0.168054 0.573307 L0.41928 0.617318 L0.503796 0.669342 L0.535157 0.759324 L0.493846 0.900055 L0.367668 0.961214 L0.205436 0.956661 L0.116711 0.907038 L0.066895 0.790334",T:"M0.022949 0.270996 L0.579103 0.270996 M0.309284 0.270996 L0.309284 0.94897",U:"M0.072022 0.270996 L0.07308 0.648875 L0.080372 0.75167 L0.099024 0.827813 L0.134786 0.885729 L0.181571 0.924023 L0.251464 0.95168 L0.339655 0.962139 L0.401553 0.951668 L0.45232 0.924086 L0.482701 0.891771 L0.495745 0.870529 L0.515699 0.81637 L0.525014 0.744626 L0.530031 0.272017",V:"M0.027832 0.270996 L0.320083 0.94897 L0.57422 0.270996",W:"M0 0.270996 L0.079799 0.940377 L0.285198 0.472884 L0.505255 0.94897 L0.602052 0.270996",X:"M0.009034 0.270996 L0.586805 0.94897 M0.593019 0.270996 L0.015246 0.94897",Y:"M0.018067 0.270996 L0.293132 0.574135 M0.583986 0.271959 L0.294954 0.57606 L0.305277 0.94897",Z:"M0.053711 0.270996 L0.548341 0.270996 L0.053711 0.94897 L0.548341 0.94897","[":"M0.404542 0.240234 L0.197511 0.240234 L0.197511 1.069424 L0.404542 1.069424","\\":"M0.062501 0.270996 L0.539551 1.035249","]":"M0.19751 0.240234 L0.404542 0.240234 L0.404542 1.069424 L0.19751 1.069424","^":"M0.035156 0.523931 L0.301024 0.270996 L0.566896 0.523931",_:"M0 1.160601 L0.602052 1.160601",a:"M0.527101 0.439941 L0.527101 0.973965 M0.527101 0.553824 L0.451366 0.477535 L0.376759 0.439941 L0.263722 0.439941 L0.187989 0.477535 L0.112255 0.553824 L0.074951 0.66881 L0.074951 0.745099 L0.112255 0.85898 L0.187989 0.93527 L0.263722 0.973965 L0.376759 0.973965 L0.451366 0.93527 L0.527101 0.85898",b:"M0.07666 0.240234 L0.07666 0.959985 M0.07666 0.582737 L0.151822 0.514237 L0.225865 0.480483 L0.338045 0.480483 L0.413211 0.514237 L0.488374 0.582737 L0.525392 0.685983 L0.525392 0.754485 L0.488374 0.856739 L0.413211 0.92524 L0.338045 0.959985 L0.225865 0.959985 L0.151822 0.92524 L0.07666 0.856739",c:"M0.512452 0.553823 L0.441624 0.477535 L0.371854 0.439941 L0.26614 0.439941 L0.195312 0.477535 L0.124486 0.553823 L0.0896 0.668808 L0.0896 0.745099 L0.124486 0.858979 L0.195312 0.93527 L0.26614 0.973965 L0.371854 0.973965 L0.441624 0.93527 L0.512452 0.858979",d:"M0.525392 0.240234 L0.525392 0.959985 M0.525392 0.582737 L0.450232 0.514237 L0.376189 0.480483 L0.264006 0.480483 L0.188844 0.514237 L0.11368 0.582737 L0.076661 0.685983 L0.076661 0.754485 L0.11368 0.856739 L0.188844 0.92524 L0.264006 0.959985 L0.376189 0.959985 L0.450232 0.92524 L0.525392 0.856739",e:"M0.059571 0.668808 L0.542482 0.668808 M0.542482 0.592521 L0.502641 0.516231 L0.461594 0.477535 L0.381914 0.439941 L0.261186 0.439941 L0.180299 0.477535 L0.099412 0.553823 L0.059571 0.668808 L0.059571 0.745099 L0.099412 0.858979 L0.180299 0.93527 L0.261186 0.973965 L0.381914 0.973965 L0.461594 0.93527 L0.542482 0.858979",f:"M0.512941 0.240234 L0.406984 0.240234 L0.301026 0.274346 L0.248047 0.374731 L0.248047 0.946817 M0.089112 0.476088 L0.459965 0.476088",g:"M0.525392 0.439941 L0.525392 0.989395 L0.488373 1.091918 L0.45023 1.126757 L0.376189 1.160601 L0.264004 1.160601 L0.188844 1.126757 L0.113681 1.058075 L0.076661 0.954555 M0.525392 0.542467 L0.45023 0.473786 L0.376189 0.439941 L0.264004 0.439941 L0.188844 0.473786 L0.113681 0.542467 L0.076661 0.645988 L0.076661 0.714669 L0.113681 0.817193 L0.188844 0.885875 L0.264004 0.920713 L0.376189 0.920713 L0.45023 0.885875 L0.525392 0.817193",h:"M0.092041 0.240234 L0.092041 0.946817 M0.092041 0.61058 L0.205937 0.509225 L0.282214 0.476086 L0.396109 0.476086 L0.47187 0.509225 L0.510011 0.61058 L0.510011 0.946817",i:"M0.261026 0.240234 L0.341026 0.240234 M0.300978 0.476089 L0.300978 0.946817",j:"M0.3853 0.240234 L0.447023 0.240234 M0.416159 0.465708 L0.416159 1.011689 L0.383887 1.108586 L0.252832 1.140264 L0.15503 1.108586",k:"M0.065186 0.240234 L0.065186 0.946817 M0.493824 0.476086 L0.065186 0.812323 M0.236758 0.677829 L0.536867 0.946817",l:"M0.301026 0.234863 L0.301026 0.946441",m:"M0.050538 0.439941 L0.050538 0.960796 M0.050538 0.588758 L0.114405 0.476607 L0.157178 0.439941 L0.236864 0.439941 L0.279637 0.476607 L0.32241 0.588758 L0.32241 0.960796 M0.32241 0.588758 L0.386281 0.476607 L0.428467 0.439941 L0.50874 0.439941 L0.551515 0.476607 L0.551515 0.960796",n:"M0.092041 0.439941 L0.092041 0.960796 M0.092041 0.588758 L0.205936 0.476607 L0.282216 0.439941 L0.396113 0.439941 L0.471871 0.476607 L0.510011 0.588758 L0.510011 0.960796",o:"M0.247175 0.439941 L0.175178 0.477535 L0.103186 0.553823 L0.066895 0.668808 L0.066895 0.745099 L0.103186 0.858979 L0.175178 0.93527 L0.247175 0.973965 L0.354874 0.973965 L0.426872 0.93527 L0.498866 0.858979 L0.535157 0.745099 L0.535157 0.668808 L0.498866 0.553823 L0.426872 0.477535 L0.354874 0.439941 L0.247175 0.439941",p:"M0.076904 0.439941 L0.076904 1.154244 M0.076904 0.541563 L0.151986 0.473487 L0.225944 0.439941 L0.338005 0.439941 L0.413087 0.473487 L0.488166 0.541563 L0.525148 0.644169 L0.525148 0.712246 L0.488166 0.813866 L0.413087 0.881942 L0.338005 0.916471 L0.225944 0.916471 L0.151986 0.881942 L0.076904 0.813866",q:"M0.525148 0.441895 L0.525148 1.156195 M0.525148 0.5435 L0.450067 0.47544 L0.376106 0.441895 L0.264042 0.441895 L0.188966 0.47544 L0.113885 0.5435 L0.076905 0.646108 L0.076905 0.714187 L0.113885 0.815809 L0.188966 0.883886 L0.264042 0.918418 L0.376106 0.918418 L0.450067 0.883886 L0.525148 0.815809",r:"M0.107422 0.439941 L0.107422 0.960796 M0.107422 0.663164 L0.155824 0.551014 L0.252626 0.476607 L0.349428 0.439941 L0.49463 0.439941",s:"M0.475556 0.477535 L0.400757 0.439941 L0.276092 0.439941 L0.176361 0.477535 L0.101563 0.553823 L0.101563 0.630112 L0.176361 0.668808 L0.301024 0.668808 L0.425688 0.745099 L0.50049 0.821387 L0.50049 0.897677 L0.425688 0.93527 L0.325956 0.973965 L0.201295 0.973965 L0.126496 0.93527 L0.101563 0.858979",t:"M0.246032 0.297852 L0.246032 0.826549 L0.301023 0.919323 L0.411011 0.950848 L0.520997 0.950848 M0.081055 0.515799 L0.466004 0.515799",u:"M0.092041 0.454102 L0.092041 0.826134 L0.13018 0.937211 L0.205936 0.974954 L0.319832 0.974954 L0.396113 0.937211 L0.510011 0.826134 M0.510011 0.454102 L0.510011 0.974954",v:"M0.048828 0.453125 L0.301026 0.961719 M0.553224 0.453125 L0.301026 0.961719",w:"M0 0.453125 L0.150512 0.961719 M0.301024 0.453125 L0.150512 0.961719 M0.301024 0.453125 L0.451539 0.961719 M0.602052 0.453125 L0.451539 0.961719",x:"M0.03711 0.453125 L0.564943 0.961719 M0.564943 0.453125 L0.03711 0.961719",y:"M0.084618 0.453125 L0.320232 0.921476 M0.55713 0.453125 L0.320232 0.921476 L0.242119 1.055289 L0.163369 1.122196 L0.084618 1.155166 L0.044922 1.155166",z:"M0.505373 0.452148 L0.09668 0.961651 M0.09668 0.452148 L0.505373 0.452148 M0.09668 0.961651 L0.505373 0.961651"},v2n={};for(let e in I2n){v2n[e]=[];let t=I2n[e].split("M").slice(1).map((n)=>n.split("L").map((o)=>o.trim().split(" ").map(parseFloat)));for(let n of t)for(let o=0;o<n.length-1;o++)v2n[e].push({x1:n[o][0],y1:1-n[o][1],x2:n[o+1][0],y2:1-n[o+1][1]})}(()=>{let e=new Uint8Array(4);new Uint32Array(e.buffer)[0]=1,e[0]})(),globalThis.Int8Array,globalThis.Uint8Array,globalThis.Int16Array,globalThis.Uint16Array,globalThis.Int32Array,globalThis.Uint32Array,globalThis.BigUint64Array,globalThis.BigInt64Array,globalThis.Float32Array,globalThis.Float64Array;var iKr=[];for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)1&t?t=3988292384^t>>>1:t>>>=1;iKr[e]=t}var sKr=new Uint16Array([255]),aKr=(new Uint8Array(sKr.buffer)[0],new Uint16Array([255]));new Uint8Array(aKr.buffer)[0],new Uint8Array(0),Uint8Array.of(137,80,78,71,13,10,26,10),new TextDecoder("latin1");function U5(){return U5=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},U5.apply(null,arguments)}function Xve(e,t){return(Xve=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n})(e,t)}function xbn(e){return(xbn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(e)}function Cbn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Cbn=function(){return!!e})()}function uit(e){var t=typeof Map=="function"?new Map:void 0;return uit=function(n){if(n===null||!function(r){try{return Function.toString.call(r).indexOf("[native code]")!==-1}catch(i){return typeof r=="function"}}(n))return n;if(typeof n!="function")throw TypeError("Super expression must either be null or a function");if(t!==void 0){if(t.has(n))return t.get(n);t.set(n,o)}function o(){return function(r,i,s){if(Cbn())return Reflect.construct.apply(null,arguments);var a=[null];a.push.apply(a,i);var c=new(r.bind.apply(r,a));return s&&Xve(c,s.prototype),c}(n,arguments,xbn(this).constructor)}return o.prototype=Object.create(n.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),Xve(o,n)},uit(e)}var cKr={1:`Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }).

`,2:`Passed invalid arguments to hsla, please pass multiple numbers e.g. hsla(360, 0.75, 0.4, 0.7) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75, alpha: 0.7 }).

`,3:`Passed an incorrect argument to a color function, please pass a string representation of a color.

`,4:`Couldn't generate valid rgb string from %s, it returned %s.

`,5:`Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.

`,6:`Passed invalid arguments to rgb, please pass multiple numbers e.g. rgb(255, 205, 100) or an object e.g. rgb({ red: 255, green: 205, blue: 100 }).

`,7:`Passed invalid arguments to rgba, please pass multiple numbers e.g. rgb(255, 205, 100, 0.75) or an object e.g. rgb({ red: 255, green: 205, blue: 100, alpha: 0.75 }).

`,8:`Passed invalid argument to toColorString, please pass a RgbColor, RgbaColor, HslColor or HslaColor object.

`,9:`Please provide a number of steps to the modularScale helper.

`,10:`Please pass a number or one of the predefined scales to the modularScale helper as the ratio.

`,11:`Invalid value passed as base to modularScale, expected number or em string but got "%s"

`,12:`Expected a string ending in "px" or a number passed as the first argument to %s(), got "%s" instead.

`,13:`Expected a string ending in "px" or a number passed as the second argument to %s(), got "%s" instead.

`,14:`Passed invalid pixel value ("%s") to %s(), please pass a value like "12px" or 12.

`,15:`Passed invalid base value ("%s") to %s(), please pass a value like "12px" or 12.

`,16:`You must provide a template to this method.

`,17:`You passed an unsupported selector state to this method.

`,18:`minScreen and maxScreen must be provided as stringified numbers with the same units.

`,19:`fromSize and toSize must be provided as stringified numbers with the same units.

`,20:`expects either an array of objects or a single object with the properties prop, fromSize, and toSize.

`,21:"expects the objects in the first argument array to have the properties `prop`, `fromSize`, and `toSize`.\n\n",22:"expects the first argument object to have the properties `prop`, `fromSize`, and `toSize`.\n\n",23:`fontFace expects a name of a font-family.

`,24:`fontFace expects either the path to the font file(s) or a name of a local copy.

`,25:`fontFace expects localFonts to be an array.

`,26:`fontFace expects fileFormats to be an array.

`,27:`radialGradient requries at least 2 color-stops to properly render.

`,28:`Please supply a filename to retinaImage() as the first argument.

`,29:`Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.

`,30:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",31:`The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation

`,32:`To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])
To pass a single animation please supply them in simple values, e.g. animation('rotate', '2s')

`,33:`The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation

`,34:`borderRadius expects a radius value as a string or number as the second argument.

`,35:`borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.

`,36:`Property must be a string value.

`,37:`Syntax Error at %s.

`,38:`Formula contains a function that needs parentheses at %s.

`,39:`Formula is missing closing parenthesis at %s.

`,40:`Formula has too many closing parentheses at %s.

`,41:`All values in a formula must have the same unit or be unitless.

`,42:`Please provide a number of steps to the modularScale helper.

`,43:`Please pass a number or one of the predefined scales to the modularScale helper as the ratio.

`,44:`Invalid value passed as base to modularScale, expected number or em/rem string but got %s.

`,45:`Passed invalid argument to hslToColorString, please pass a HslColor or HslaColor object.

`,46:`Passed invalid argument to rgbToColorString, please pass a RgbColor or RgbaColor object.

`,47:`minScreen and maxScreen must be provided as stringified numbers with the same units.

`,48:`fromSize and toSize must be provided as stringified numbers with the same units.

`,49:`Expects either an array of objects or a single object with the properties prop, fromSize, and toSize.

`,50:`Expects the objects in the first argument array to have the properties prop, fromSize, and toSize.

`,51:`Expects the first argument object to have the properties prop, fromSize, and toSize.

`,52:`fontFace expects either the path to the font file(s) or a name of a local copy.

`,53:`fontFace expects localFonts to be an array.

`,54:`fontFace expects fileFormats to be an array.

`,55:`fontFace expects a name of a font-family.

`,56:`linearGradient requries at least 2 color-stops to properly render.

`,57:`radialGradient requries at least 2 color-stops to properly render.

`,58:`Please supply a filename to retinaImage() as the first argument.

`,59:`Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.

`,60:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",61:`Property must be a string value.

`,62:`borderRadius expects a radius value as a string or number as the second argument.

`,63:`borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.

`,64:`The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation.

`,65:`To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s').

`,66:`The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation.

`,67:`You must provide a template to this method.

`,68:`You passed an unsupported selector state to this method.

`,69:`Expected a string ending in "px" or a number passed as the first argument to %s(), got %s instead.

`,70:`Expected a string ending in "px" or a number passed as the second argument to %s(), got %s instead.

`,71:`Passed invalid pixel value %s to %s(), please pass a value like "12px" or 12.

`,72:`Passed invalid base value %s to %s(), please pass a value like "12px" or 12.

`,73:`Please provide a valid CSS variable.

`,74:`CSS variable not found and no default was provided.

`,75:`important requires a valid style object, got a %s instead.

`,76:`fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.

`,77:`remToPx expects a value in "rem" but you provided it in "%s".

`,78:`base must be set in "px" or "%" but you set it in "%s".
`};function lKr(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];var o,r=t[0],i=[];for(o=1;o<t.length;o+=1)i.push(t[o]);return i.forEach(function(s){r=r.replace(/%[a-z]/,s)}),r}var O5=function(e){var t,n;function o(r){var i;for(var s=arguments.length,a=Array(s>1?s-1:0),c=1;c<s;c++)a[c-1]=arguments[c];return i=e.call(this,lKr.apply(void 0,[cKr[r]].concat(a)))||this,function(l){if(l===void 0)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return l}(i)}return n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,Xve(t,n),o}(uit(Error));function S2n(e,t){return e.substr(-t.length)===t}var hKr=/^([+-]?(?:\d+|\d*\.\d+))([a-z]*|%)$/;function P2n(e){return typeof e!="string"?e:e.match(hKr)?parseFloat(e):e}var E2n=function(e){return function(t,n){n===void 0&&(n="16px");var o=t,r=n;if(typeof t=="string"){if(!S2n(t,"px"))throw new O5(69,e,t);o=P2n(t)}if(typeof n=="string"){if(!S2n(n,"px"))throw new O5(70,e,n);r=P2n(n)}if(typeof o=="string")throw new O5(71,t,e);if(typeof r=="string")throw new O5(72,n,e);return""+o/r+e}};E2n("em"),E2n("rem");function mot(e){return Math.round(255*e)}function dKr(e,t,n){return mot(e)+","+mot(t)+","+mot(n)}function pue(e,t,n,o){if(o===void 0&&(o=dKr),t===0)return o(n,n,n);var r=(e%360+360)%360/60,i=(1-Math.abs(2*n-1))*t,s=i*(1-Math.abs(r%2-1)),a=0,c=0,l=0;r>=0&&r<1?(a=i,c=s):r>=1&&r<2?(a=s,c=i):r>=2&&r<3?(c=i,l=s):r>=3&&r<4?(c=s,l=i):r>=4&&r<5?(a=s,l=i):r>=5&&r<6&&(a=i,l=s);var h=n-i/2;return o(a+h,c+h,l+h)}var M2n={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},uKr=/^#[a-fA-F0-9]{6}$/,pKr=/^#[a-fA-F0-9]{8}$/,mKr=/^#[a-fA-F0-9]{3}$/,_Kr=/^#[a-fA-F0-9]{4}$/,_ot=/^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i,gKr=/^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i,AKr=/^hsl\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i,fKr=/^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;function yZ(e){if(typeof e!="string")throw new O5(3);var t=function(u){if(typeof u!="string")return u;var _=u.toLowerCase();return M2n[_]?"#"+M2n[_]:u}(e);if(t.match(uKr))return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16)};if(t.match(pKr)){var n=parseFloat((parseInt(""+t[7]+t[8],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16),alpha:n}}if(t.match(mKr))return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16)};if(t.match(_Kr)){var o=parseFloat((parseInt(""+t[4]+t[4],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16),alpha:o}}var r=_ot.exec(t);if(r)return{red:parseInt(""+r[1],10),green:parseInt(""+r[2],10),blue:parseInt(""+r[3],10)};var i=gKr.exec(t.substring(0,50));if(i)return{red:parseInt(""+i[1],10),green:parseInt(""+i[2],10),blue:parseInt(""+i[3],10),alpha:parseFloat(""+i[4])>1?parseFloat(""+i[4])/100:parseFloat(""+i[4])};var s=AKr.exec(t);if(s){var a="rgb("+pue(parseInt(""+s[1],10),parseInt(""+s[2],10)/100,parseInt(""+s[3],10)/100)+")",c=_ot.exec(a);if(!c)throw new O5(4,t,a);return{red:parseInt(""+c[1],10),green:parseInt(""+c[2],10),blue:parseInt(""+c[3],10)}}var l=fKr.exec(t.substring(0,50));if(l){var h="rgb("+pue(parseInt(""+l[1],10),parseInt(""+l[2],10)/100,parseInt(""+l[3],10)/100)+")",d=_ot.exec(h);if(!d)throw new O5(4,t,h);return{red:parseInt(""+d[1],10),green:parseInt(""+d[2],10),blue:parseInt(""+d[3],10),alpha:parseFloat(""+l[4])>1?parseFloat(""+l[4])/100:parseFloat(""+l[4])}}throw new O5(5)}function bL(e){return function(t){var n,o=t.red/255,r=t.green/255,i=t.blue/255,s=Math.max(o,r,i),a=Math.min(o,r,i),c=(s+a)/2;if(s===a)return t.alpha!==void 0?{hue:0,saturation:0,lightness:c,alpha:t.alpha}:{hue:0,saturation:0,lightness:c};var l=s-a,h=c>0.5?l/(2-s-a):l/(s+a);switch(s){case o:n=(r-i)/l+(r<i?6:0);break;case r:n=(i-o)/l+2;break;default:n=(o-r)/l+4}return n*=60,t.alpha!==void 0?{hue:n,saturation:h,lightness:c,alpha:t.alpha}:{hue:n,saturation:h,lightness:c}}(yZ(e))}var pit=function(e){return e.length===7&&e[1]===e[2]&&e[3]===e[4]&&e[5]===e[6]?"#"+e[1]+e[3]+e[5]:e};function UY(e){var t=e.toString(16);return t.length===1?"0"+t:t}function got(e){return UY(Math.round(255*e))}function yKr(e,t,n){return pit("#"+got(e)+got(t)+got(n))}function m9e(e,t,n){return pue(e,t,n,yKr)}function mit(e,t,n){if(typeof e=="number"&&typeof t=="number"&&typeof n=="number")return pit("#"+UY(e)+UY(t)+UY(n));if(typeof e=="object"&&t===void 0&&n===void 0)return pit("#"+UY(e.red)+UY(e.green)+UY(e.blue));throw new O5(6)}function $8e(e,t,n,o){if(typeof e=="string"&&typeof t=="number"){var r=yZ(e);return"rgba("+r.red+","+r.green+","+r.blue+","+t+")"}if(typeof e=="number"&&typeof t=="number"&&typeof n=="number"&&typeof o=="number")return o>=1?mit(e,t,n):"rgba("+e+","+t+","+n+","+o+")";if(typeof e=="object"&&t===void 0&&n===void 0&&o===void 0)return e.alpha>=1?mit(e.red,e.green,e.blue):"rgba("+e.red+","+e.green+","+e.blue+","+e.alpha+")";throw new O5(7)}function IL(e){if(typeof e!="object")throw new O5(8);if(function(t){return typeof t.red=="number"&&typeof t.green=="number"&&typeof t.blue=="number"&&typeof t.alpha=="number"}(e))return $8e(e);if(function(t){return typeof t.red=="number"&&typeof t.green=="number"&&typeof t.blue=="number"&&(typeof t.alpha!="number"||t.alpha===void 0)}(e))return mit(e);if(function(t){return typeof t.hue=="number"&&typeof t.saturation=="number"&&typeof t.lightness=="number"&&typeof t.alpha=="number"}(e))return function(t,n,o,r){if(typeof t=="number"&&typeof n=="number"&&typeof o=="number"&&typeof r=="number")return r>=1?m9e(t,n,o):"rgba("+pue(t,n,o)+","+r+")";if(typeof t=="object"&&n===void 0&&o===void 0&&r===void 0)return t.alpha>=1?m9e(t.hue,t.saturation,t.lightness):"rgba("+pue(t.hue,t.saturation,t.lightness)+","+t.alpha+")";throw new O5(2)}(e);if(function(t){return typeof t.hue=="number"&&typeof t.saturation=="number"&&typeof t.lightness=="number"&&(typeof t.alpha!="number"||t.alpha===void 0)}(e))return function(t,n,o){if(typeof t=="number"&&typeof n=="number"&&typeof o=="number")return m9e(t,n,o);if(typeof t=="object"&&n===void 0&&o===void 0)return m9e(t.hue,t.saturation,t.lightness);throw new O5(1)}(e);throw new O5(8)}function bbn(e,t,n){return function(){var o=n.concat(Array.prototype.slice.call(arguments));return o.length>=t?e.apply(this,o):bbn(e,t,o)}}function Z3(e){return bbn(e,e.length,[])}Z3(function(e,t){if(t==="transparent")return t;var n=bL(t);return IL(U5({},n,{hue:n.hue+parseFloat(e)}))});function UZ(e,t,n){return Math.max(e,Math.min(t,n))}Z3(function(e,t){if(t==="transparent")return t;var n=bL(t);return IL(U5({},n,{lightness:UZ(0,1,n.lightness-parseFloat(e))}))});Z3(function(e,t){if(t==="transparent")return t;var n=bL(t);return IL(U5({},n,{saturation:UZ(0,1,n.saturation-parseFloat(e))}))});Z3(function(e,t){if(t==="transparent")return t;var n=bL(t);return IL(U5({},n,{lightness:UZ(0,1,n.lightness+parseFloat(e))}))});var Ibn=Z3(function(e,t,n){if(t==="transparent")return n;if(n==="transparent")return t;if(e===0)return n;var o=yZ(t),r=U5({},o,{alpha:typeof o.alpha=="number"?o.alpha:1}),i=yZ(n),s=U5({},i,{alpha:typeof i.alpha=="number"?i.alpha:1}),a=r.alpha-s.alpha,c=2*parseFloat(e)-1,l=((c*a===-1?c:c+a)/(1+c*a)+1)/2,h=1-l;return $8e({red:Math.floor(r.red*l+s.red*h),green:Math.floor(r.green*l+s.green*h),blue:Math.floor(r.blue*l+s.blue*h),alpha:r.alpha*parseFloat(e)+s.alpha*(1-parseFloat(e))})});Z3(function(e,t){if(t==="transparent")return t;var n=yZ(t);return $8e(U5({},n,{alpha:UZ(0,1,(100*(typeof n.alpha=="number"?n.alpha:1)+100*parseFloat(e))/100)}))});Z3(function(e,t){if(t==="transparent")return t;var n=bL(t);return IL(U5({},n,{saturation:UZ(0,1,n.saturation+parseFloat(e))}))});Z3(function(e,t){return t==="transparent"?t:IL(U5({},bL(t),{hue:parseFloat(e)}))});Z3(function(e,t){return t==="transparent"?t:IL(U5({},bL(t),{lightness:parseFloat(e)}))});Z3(function(e,t){return t==="transparent"?t:IL(U5({},bL(t),{saturation:parseFloat(e)}))});Z3(function(e,t){return t==="transparent"?t:Ibn(parseFloat(e),"rgb(0, 0, 0)",t)});Z3(function(e,t){return t==="transparent"?t:Ibn(parseFloat(e),"rgb(255, 255, 255)",t)});var mra=Z3(function(e,t){if(t==="transparent")return t;var n=yZ(t);return $8e(U5({},n,{alpha:UZ(0,1,+(100*(typeof n.alpha=="number"?n.alpha:1)-100*parseFloat(e)).toFixed(2)/100)}))}),{cos:_ra,sin:gra,PI:Ara}=Math,{tan:fra}=Math,yra=(dit(Wjr()),dit($jr()),(e,t)=>({...e,rects:[...e.rects??[],...t.rects??[]],points:[...e.points??[],...t.points??[]],lines:[...e.lines??[],...t.lines??[]],infiniteLines:[...e.infiniteLines??[],...t.infiniteLines??[]],polygons:[...e.polygons??[],...t.polygons??[]],circles:[...e.circles??[],...t.circles??[]],arrows:[...e.arrows??[],...t.arrows??[]],texts:[...e.texts??[],...t.texts??[]]}));function Aot(e,t){if(e.points)for(let n of e.points)n.step=t;if(e.lines)for(let n of e.lines)n.step=t;if(e.infiniteLines)for(let n of e.infiniteLines)n.step=t;if(e.polygons)for(let n of e.polygons)n.step=t;if(e.rects)for(let n of e.rects)n.step=t;if(e.circles)for(let n of e.circles)n.step=t;if(e.texts)for(let n of e.texts)n.step=t;if(e.arrows)for(let n of e.arrows)n.step=t;return e}var mT=class{MAX_ITERATIONS=1e5;solved=!1;failed=!1;iterations=0;progress=0;error=null;activeSubSolver;failedSubSolvers;timeToSolve;stats={};_setupDone=!1;getSolverName(){return this.constructor.name}setup(){this._setupDone||(this._setup(),this._setupDone=!0)}_setup(){}step(){if(this._setupDone||this.setup(),!this.solved&&!this.failed){this.iterations++;try{this._step()}catch(e){throw this.error=`${this.getSolverName()} error: ${e}`,this.failed=!0,e}!this.solved&&this.iterations>=this.MAX_ITERATIONS&&this.tryFinalAcceptance(),!this.solved&&this.iterations>=this.MAX_ITERATIONS&&(this.error=`${this.getSolverName()} ran out of iterations`,this.failed=!0),"computeProgress"in this&&(this.progress=this.computeProgress())}}_step(){}getConstructorParams(){throw Error("getConstructorParams not implemented")}getOutput(){return null}solve(){let e=Date.now();for(;!this.solved&&!this.failed;)this.step();let t=Date.now();this.timeToSolve=t-e}visualize(){return{lines:[],points:[],rects:[],circles:[]}}tryFinalAcceptance(){}preview(){return{lines:[],points:[],rects:[],circles:[]}}};function nZ(e,t,n,o={}){return{solverName:e,solverClass:t,getConstructorParams:n,onSolved:o.onSolved}}var vbn=class extends mT{startTimeOfStage={};endTimeOfStage={};timeSpentOnStage={};firstIterationOfStage={};currentPipelineStageIndex=0;inputProblem;pipelineOutputs={};constructor(e){super(),this.inputProblem=e,this.MAX_ITERATIONS=1e6}_step(){let e=this.pipelineDef[this.currentPipelineStageIndex];if(!e)return void(this.solved=!0);if(this.activeSubSolver){if(this.activeSubSolver.step(),this.activeSubSolver.solved){this.endTimeOfStage[e.solverName]=performance.now(),this.timeSpentOnStage[e.solverName]=this.endTimeOfStage[e.solverName]-this.startTimeOfStage[e.solverName];let n=this.activeSubSolver.getOutput();n!==null&&(this.pipelineOutputs[e.solverName]=n),e.onSolved?.(this),this.activeSubSolver=null,this.currentPipelineStageIndex++}else this.activeSubSolver.failed&&(this.error=this.activeSubSolver?.error,this.failed=!0,this.activeSubSolver=null);return}let t=e.getConstructorParams(this);this.activeSubSolver=new e.solverClass(...t),this[e.solverName]=this.activeSubSolver,this.timeSpentOnStage[e.solverName]=0,this.startTimeOfStage[e.solverName]=performance.now(),this.firstIterationOfStage[e.solverName]=this.iterations}solveUntilStage(e){for(;this.getCurrentStageName().toLowerCase()!==e.toLowerCase()&&(this.step(),!this.failed&&!this.solved););}getCurrentStageName(){return this.pipelineDef[this.currentPipelineStageIndex]?.solverName??"none"}getStageProgress(){let e=this.pipelineDef.length;if(e===0)return 1;let t=this.activeSubSolver?.progress??0;return(this.currentPipelineStageIndex+t)/e}getStageStats(){let e={};for(let t of this.pipelineDef){let n=this.timeSpentOnStage[t.solverName]||0,o=this.firstIterationOfStage[t.solverName]||0,r=this.iterations,i=t.solverName===this.getCurrentStageName()?r-o:0,s=this.currentPipelineStageIndex>this.pipelineDef.findIndex((a)=>a.solverName===t.solverName);e[t.solverName]={timeSpent:n,iterations:i,completed:s}}return e}initialVisualize(){return null}finalVisualize(){return null}visualize(){if(!this.solved&&this.activeSubSolver)return this.activeSubSolver.visualize();let e=0,t=this.initialVisualize();t&&(Aot(t,0),e=1);let n=null;this.solved&&(n=this.finalVisualize());let o=[t].filter(Boolean).concat(this.pipelineDef.map((r,i)=>{let s=this[r.solverName],a=s?.visualize();return a?(Aot(a,i+e),a):null}).filter(Boolean));return o.length===0?{points:[],rects:[],lines:[],circles:[],texts:[]}:(this.solved&&n&&(Aot(n,o.length+e+1),o.push(n)),o.length===1?o[0]:{points:o.flatMap((r)=>r.points||[]),rects:o.flatMap((r)=>r.rects||[]),lines:o.flatMap((r)=>r.lines||[]),circles:o.flatMap((r)=>r.circles||[]),texts:o.flatMap((r)=>r.texts||[])})}preview(){return this.activeSubSolver?this.activeSubSolver.preview():super.preview()}computeProgress(){return this.getStageProgress()}getStageOutput(e){return this.pipelineOutputs[e]}getAllOutputs(){return{...this.pipelineOutputs}}hasStageOutput(e){return e in this.pipelineOutputs}getSolver(e){return this[e]}},xKr=class{constructor(e=1/0,t=Float64Array,n=Uint32Array){let o=e!==1/0;this.ids=o?new n(e):[],this.values=o?new t(e):[],this.capacity=e,this.length=0}clear(){this.length=0}push(e,t){if(this.length===this.capacity)throw RangeError("Queue is at capacity.");let n=this.length++;for(;n>0;){let o=n-1>>1,r=this.values[o];if(t>=r)break;this.ids[n]=this.ids[o],this.values[n]=r,n=o}this.ids[n]=e,this.values[n]=t}pop(){if(this.length===0)return;let e=this.ids,t=this.values,n=e[0],o=--this.length;if(o>0){let r=e[o],i=t[o],s=0,a=o>>1;for(;s<a;){let c=1+(s<<1),l=c+1,h=c+(+(l<o)&+(t[l]<t[c]));if(t[h]>=i)break;e[s]=e[h],t[s]=t[h],s=h}e[s]=r,t[s]=i}return n}peek(){return this.length>0?this.ids[0]:void 0}peekValue(){return this.length>0?this.values[0]:void 0}shrink(){Array.isArray(this.ids)&&(this.ids.length=this.length),Array.isArray(this.values)&&(this.values.length=this.length)}},w2n=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],Sbn=class e{static from(t,n=0){if(n%8!=0)throw Error("byteOffset must be 8-byte aligned.");if(!t||t.byteLength===void 0||"buffer"in t)throw Error("Data must be an instance of ArrayBuffer or SharedArrayBuffer.");let[o,r]=new Uint8Array(t,n+0,2);if(o!==251)throw Error("Data does not appear to be in a Flatbush format.");let i=r>>4;if(i!==3)throw Error(`Got v${i} data when expected v3.`);let s=w2n[15&r];if(!s)throw Error("Unrecognized array type.");let[a]=new Uint16Array(t,n+2,1),[c]=new Uint32Array(t,n+4,1);return new e(c,a,s,void 0,t,n)}constructor(t,n=16,o=Float64Array,r=ArrayBuffer,i,s=0){if(t===void 0)throw Error("Missing required argument: numItems.");if(isNaN(t)||t<=0)throw Error(`Unexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+n,2),65535),this.byteOffset=s;let a=t,c=a;this._levelBounds=[4*a];do a=Math.ceil(a/this.nodeSize),c+=a,this._levelBounds.push(4*c);while(a!==1);this.ArrayType=o,this.IndexArrayType=c<16384?Uint16Array:Uint32Array;let l=w2n.indexOf(o),h=4*c*o.BYTES_PER_ELEMENT;if(l<0)throw Error(`Unexpected typed array class: ${o}.`);let d=o,u=this.IndexArrayType;if(i)this.data=i,this._boxes=new d(i,s+8,4*c),this._indices=new u(i,s+8+h,c),this._pos=4*c,this.minX=this._boxes[this._pos-4],this.minY=this._boxes[this._pos-3],this.maxX=this._boxes[this._pos-2],this.maxY=this._boxes[this._pos-1];else{let _=this.data=new r(8+h+c*this.IndexArrayType.BYTES_PER_ELEMENT);this._boxes=new d(_,8,4*c),this._indices=new u(_,8+h,c),this._pos=0,this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,new Uint8Array(_,0,2).set([251,48+l]),new Uint16Array(_,2,1)[0]=n,new Uint32Array(_,4,1)[0]=t}this._queue=new xKr}add(t,n,o=t,r=n){let i=this._pos,s=i>>2,a=this._boxes;return this._indices[s]=s,a[i]=t,a[i+1]=n,a[i+2]=o,a[i+3]=r,this._pos=i+4,t<this.minX&&(this.minX=t),n<this.minY&&(this.minY=n),o>this.maxX&&(this.maxX=o),r>this.maxY&&(this.maxY=r),s}finish(){if(this._pos>>2!==this.numItems)throw Error(`Added ${this._pos>>2} items when expected ${this.numItems}.`);let t=this._boxes;if(this.numItems<=this.nodeSize)return t[this._pos++]=this.minX,t[this._pos++]=this.minY,t[this._pos++]=this.maxX,void(t[this._pos++]=this.maxY);let{numItems:n,minX:o,minY:r,nodeSize:i,_indices:s,_levelBounds:a}=this,c=this.maxX-o||1,l=this.maxY-r||1,h=new Int32Array(n),d=65535/c,u=65535/l;for(let p=0,m=0;p<n;p++){let A=t[m++],g=t[m++],f=d*((A+t[m++])/2-o)|0,y=u*((g+t[m++])/2-r)|0;h[p]=IKr(f,y)}(function(p,m,A,g,f,y){let x=[g,f];for(;x.length;){let C=x.pop()||0,b=x.pop()||0;if(C-b<=y&&Math.floor(b/y)>=Math.floor(C/y))continue;let I=p[b],v=p[b+C>>1],P=p[C],M=I>v!=I>P?I:v<I!=v<P?v:P,B=b-1,T=C+1;for(;;){do B++;while(p[B]<M);do T--;while(p[T]>M);if(B>=T)break;bKr(p,m,A,B,T)}x.push(b,T,T+1,C)}})(h,t,s,0,n-1,i);let _=4*n;for(let p=0,m=0;p<a.length-1;p++){let A=a[p];for(;m<A;){let g=m,f=t[m++],y=t[m++],x=t[m++],C=t[m++];for(let b=1;b<i&&m<A;b++)f=Math.min(f,t[m++]),y=Math.min(y,t[m++]),x=Math.max(x,t[m++]),C=Math.max(C,t[m++]);s[_>>2]=g,t[_++]=f,t[_++]=y,t[_++]=x,t[_++]=C}}this._pos=_}search(t,n,o,r,i){if(this._pos!==this._boxes.length)throw Error("Data not yet indexed - call index.finish().");let{_boxes:s,_levelBounds:a,_indices:c,nodeSize:l}=this,h=4*this.numItems,d=s.length-4,u=a.length-1,_=[],p=[],m=!1;for(;d!==void 0;){let A=Math.min(d+4*l,a[u]),g=d>=h;if(m)this._collectContained(d,A,u,h,p,i);else for(let f=d;f<A;f+=4){let y=s[f];if(o<y)continue;let x=s[f+1];if(r<x)continue;let C=s[f+2];if(t>C)continue;let b=s[f+3];if(n>b)continue;let I=0|c[f>>2];if(g){let v=+(t<=y&&n<=x&&o>=C&&r>=b);_.push(I|v,u-1)}else(i===void 0||i(I,y,x,C,b))&&p.push(I)}u=_.pop(),d=_.pop(),d!==void 0&&(m=!(1&~d),d&=-2)}return p}_collectContained(t,n,o,r,i,s){let a=this._boxes,c=this._indices,l=t;for(let d=o;d>0;d--)l=c[l>>2];let h=Math.min(l+(n-t)*this.nodeSize**o,r);if(s===void 0)for(;l<h;l+=4)i.push(0|c[l>>2]);else for(;l<h;l+=4){let d=0|c[l>>2];s(d,a[l],a[l+1],a[l+2],a[l+3])&&i.push(d)}}neighbors(t,n,o=1/0,r=1/0,i){if(this._pos!==this._boxes.length)throw Error("Data not yet indexed - call index.finish().");let{_boxes:s,_levelBounds:a,_indices:c,_queue:l,nodeSize:h}=this,d=4*this.numItems,u=4*h,_=[],p=o===1,m=r*r;for(l.push(s.length-4<<1,0);l.length;){let A=l.ids[0];if(1&A){if(l.pop(),_.push(A>>1),_.length===o)break;continue}l.pop();let g=A>>1,f=g<d,y=Math.min(g+u,CKr(g,a));for(let x=g;x<y;x+=4){let C=s[x],b=s[x+1],I=s[x+2],v=s[x+3],P=Math.max(Math.max(C-t,t-I),0),M=Math.max(Math.max(b-n,n-v),0),B=P*P+M*M;if(B>m)continue;let T=0|c[x>>2];f?(i===void 0||i(T))&&(l.push(T<<1|1,B),p&&B<m&&(m=B)):l.push(T<<1,B)}}return l.clear(),_}};function CKr(e,t){let n=0,o=t.length-1;for(;n<o;){let r=n+o>>1;t[r]>e?o=r:n=r+1}return t[n]}function bKr(e,t,n,o,r){let i=e[o];e[o]=e[r],e[r]=i;let s=4*o,a=4*r,c=t[s],l=t[s+1],h=t[s+2],d=t[s+3];t[s]=t[a],t[s+1]=t[a+1],t[s+2]=t[a+2],t[s+3]=t[a+3],t[a]=c,t[a+1]=l,t[a+2]=h,t[a+3]=d;let u=n[o];n[o]=n[r],n[r]=u}function IKr(e,t){let n=e^t,o=65535^n,r=65535^(e|t),i=e&(65535^t),s=n|o>>1,a=n>>1^n,c=r^r>>1^o&i>>1,l=i^n&r>>1^i>>1;return n=s&s>>2^a&a>>2,o=s&a>>2^a&(s^a)>>2,r=c^s&c>>2^a&l>>2,i=l^a&c>>2^(s^a)&l>>2,s=n&n>>4^o&o>>4,a=n&o>>4^o&(n^o)>>4,c=r^n&r>>4^o&i>>4,l=i^o&r>>4^(n^o)&i>>4,r=c^s&c>>8^a&l>>8,i=l^a&c>>8^(s^a)&l>>8,r^=r>>1,i^=i>>1,n=e^t,o=i|65535^(n|r),n=16711935&(n|n<<8),n=252645135&(n|n<<4),n=858993459&(n|n<<2),n=1431655765&(n|n<<1),o=16711935&(o|o<<8),o=252645135&(o|o<<4),o=858993459&(o|o<<2),o=1431655765&(o|o<<1),((o<<1|n)>>>0)-2147483648}var _9e=[{facingDirection:"x-",dx:-1,dy:0,startX:-0.5,startY:0.5,endX:-0.5,endY:-0.5},{facingDirection:"x+",dx:1,dy:0,startX:0.5,startY:0.5,endX:0.5,endY:-0.5},{facingDirection:"y-",dx:0,dy:-1,startX:-0.5,startY:-0.5,endX:0.5,endY:-0.5},{facingDirection:"y+",dx:0,dy:1,startX:0.5,startY:0.5,endX:-0.5,endY:0.5}],xra={"x-":_9e.find((e)=>e.facingDirection==="x-"),"x+":_9e.find((e)=>e.facingDirection==="x+"),"y-":_9e.find((e)=>e.facingDirection==="y-"),"y+":_9e.find((e)=>e.facingDirection==="y+")};function vKr(e,t){let n=e.x-t.x,o=e.y-t.y;return Math.sqrt(n*n+o*o)}function ms(e){let t=e.width/2,n=e.height/2;return{minX:e.center.x-t,maxX:e.center.x+t,minY:e.center.y-n,maxY:e.center.y+n}}function B2n(e,t,n){return Math.max(t,Math.min(n,e))}function SKr(e,t){let n=t.width/2,o=t.height/2,r=t.center.x-n,i=t.center.x+n,s=t.center.y-o,a=t.center.y+o;if(e.x>=r&&e.x<=i&&e.y>=s&&e.y<=a)return 0;return vKr(e,{x:B2n(e.x,r,i),y:B2n(e.y,s,a)})}var q8e=(e,t)=>!(e.maxX<t.minX||t.maxX<e.minX||e.maxY<t.minY||t.maxY<e.minY),Jm=(e)=>{let{center:t,width:n,height:o}=e,r=n/2,i=o/2;return{minX:t.x-r,maxX:t.x+r,minY:t.y-i,maxY:t.y+i}},PKr=class{cacheHitsByPrefix={};cacheMissesByPrefix={};isSyncCache=!0;cacheHits=0;cacheMisses=0;cache=new Map;getCachedSolutionSync(e){let t=this.cache.get(e);if(t!==void 0){this.cacheHits++;let n=e.split(":")[0];return this.cacheHitsByPrefix[n]=(this.cacheHitsByPrefix[n]||0)+1,structuredClone(t)}{this.cacheMisses++;let n=e.split(":")[0];return void(this.cacheMissesByPrefix[n]=(this.cacheMissesByPrefix[n]||0)+1)}}async getCachedSolution(e){return this.getCachedSolutionSync(e)}setCachedSolutionSync(e,t){this.cache.set(e,structuredClone(t))}async setCachedSolution(e,t){this.setCachedSolutionSync(e,t)}clearCache(){this.cache.clear(),this.cacheHits=0,this.cacheMisses=0,this.cacheHitsByPrefix={},this.cacheMissesByPrefix={}}getAllCacheKeys(){return Array.from(this.cache.keys())}},fot="tscircuit_autorouter_cache_",EKr=class{isSyncCache=!0;cacheHits=0;cacheMisses=0;cacheHitsByPrefix={};cacheMissesByPrefix={};constructor(){}getKey(e){return`${fot}${e}`}getCachedSolutionSync(e){if(typeof localStorage>"u")return;let t=this.getKey(e);try{let n=localStorage.getItem(t);if(n!==null){let o=JSON.parse(n);this.cacheHits++;let r=e.split(":")[0];return this.cacheHitsByPrefix[r]=(this.cacheHitsByPrefix[r]||0)+1,o}{this.cacheMisses++;let o=e.split(":")[0];return void(this.cacheMissesByPrefix[o]=(this.cacheMissesByPrefix[o]||0)+1)}}catch(n){console.error(`Error getting cached solution sync for ${t}:`,n),this.cacheMisses++;let o=e.split(":")[0];return void(this.cacheMissesByPrefix[o]=(this.cacheMissesByPrefix[o]||0)+1)}}async getCachedSolution(e){return this.getCachedSolutionSync(e)}setCachedSolutionSync(e,t){if(typeof localStorage>"u")return;let n=this.getKey(e);try{let o=JSON.stringify(t);localStorage.setItem(n,o)}catch(o){console.error(`Error setting cached solution sync for ${n}:`,o),o instanceof DOMException&&(o.name==="QuotaExceededError"||o.name==="NS_ERROR_DOM_QUOTA_REACHED")&&console.warn(`LocalStorage quota exceeded. Failed to cache solution for ${n}. Consider clearing the cache.`)}}async setCachedSolution(e,t){this.setCachedSolutionSync(e,t)}clearCache(){if(typeof localStorage<"u")try{let e=[];for(let t=0;t<localStorage.length;t++){let n=localStorage.key(t);n?.startsWith(fot)&&e.push(n)}e.forEach((t)=>localStorage.removeItem(t)),console.log(`Cleared ${e.length} items from LocalStorage cache.`)}catch(e){console.error("Error clearing LocalStorage cache:",e)}finally{this.cacheHits=0,this.cacheMisses=0,this.cacheHitsByPrefix={},this.cacheMissesByPrefix={}}}getAllCacheKeys(){let e=[];for(let t=0;t<1e4;t++){let n=localStorage.key(t);if(!n)break;n.includes(fot)&&e.push(n)}return e}};function Pbn(){globalThis.TSCIRCUIT_AUTOROUTER_LOCAL_STORAGE_CACHE??=new EKr,globalThis.TSCIRCUIT_AUTOROUTER_IN_MEMORY_CACHE??=new PKr}function MKr(e){return"layers"in e&&Array.isArray(e.layers)}function wKr(e){return MKr(e)?e.layers:[e.layer]}var FP=(e,t)=>e==="top"?0:e==="bottom"?t-1:parseInt(e.slice(5));function Ebn(e,t){return[...new Set(e)].filter((n)=>Number.isInteger(n)&&n>=0&&n<t).sort((n,o)=>n-o)}function BKr(e,t){return Ebn(e.map((n)=>FP(n,t)),t)}var T2n=(...e)=>e.find((t)=>typeof t=="number"&&Number.isFinite(t)),J8e=(e)=>{let t=T2n(e.min_via_hole_diameter,e.minViaHoleDiameter),n=T2n(e.min_via_pad_diameter,e.minViaPadDiameter,e.minViaDiameter),o=Math.max(n??e.minViaDiameter??0.3,t??0);return{padDiameter:o,holeDiameter:t??0.5*o}};Pbn();var Cra=Array.from({length:6},(e,t)=>t);var hT=(e,t={})=>{let n=Math.min(...e.availableZ);return{center:!t.rectMargin||t.zOffset?{x:e.center.x+n*e.width*(t.zOffset??0.05),y:e.center.y-n*e.width*(t.zOffset??0.05)}:e.center,width:t.rectMargin?e.width-2*t.rectMargin:Math.max(e.width-0.5,0.8*e.width),height:t.rectMargin?e.height-2*t.rectMargin:Math.max(e.height-0.5,0.8*e.height),fill:e._containsObstacle?"rgba(255,0,0,0.1)":{"0,1":"rgba(0,0,0,0.1)",0:"rgba(0,200,200, 0.1)",1:"rgba(0,0,200, 0.1)"}[e.availableZ.join(",")]??"rgba(0,200,200,0.1)",layer:`z${e.availableZ.join(",")}`,label:[e.capacityMeshNodeId,`availableZ: ${e.availableZ.join(",")}`,e._containsTarget?"containsTarget":"",e._containsObstacle?"containsObstacle":""].filter(Boolean).join(`
`)}};Pbn();var{create:TKr,defineProperty:D2n,getOwnPropertyDescriptor:DKr,getOwnPropertyNames:Mbn,getPrototypeOf:NKr}=Object,RKr=Object.prototype.hasOwnProperty,wG=(e,t)=>function(){return t||(0,e[Mbn(e)[0]])((t={exports:{}}).exports,t),t.exports},N2n=(e,t,n)=>(n=e!=null?TKr(NKr(e)):{},((o,r,i,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of Mbn(r))RKr.call(o,a)||a===i||D2n(o,a,{get:()=>r[a],enumerable:!(s=DKr(r,a))||s.enumerable});return o})(!t&&e&&e.__esModule?n:D2n(n,"default",{value:e,enumerable:!0}),e)),QKr=wG({"node_modules/is-buffer/index.js"(e,t){function n(o){return!!o.constructor&&typeof o.constructor.isBuffer=="function"&&o.constructor.isBuffer(o)}t.exports=function(o){return o!=null&&(n(o)||function(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&n(r.slice(0,0))}(o)||!!o._isBuffer)}}}),kKr=wG({"node_modules/kind-of/index.js"(e,t){var n=QKr(),o=Object.prototype.toString;t.exports=function(r){if(r===void 0)return"undefined";if(r===null)return"null";if(r===!0||r===!1||r instanceof Boolean)return"boolean";if(typeof r=="string"||r instanceof String)return"string";if(typeof r=="number"||r instanceof Number)return"number";if(typeof r=="function"||r instanceof Function)return"function";if(Array.isArray!==void 0&&Array.isArray(r))return"array";if(r instanceof RegExp)return"regexp";if(r instanceof Date)return"date";var i=o.call(r);return i==="[object RegExp]"?"regexp":i==="[object Date]"?"date":i==="[object Arguments]"?"arguments":i==="[object Error]"?"error":n(r)?"buffer":i==="[object Set]"?"set":i==="[object WeakSet]"?"weakset":i==="[object Map]"?"map":i==="[object WeakMap]"?"weakmap":i==="[object Symbol]"?"symbol":i==="[object Int8Array]"?"int8array":i==="[object Uint8Array]"?"uint8array":i==="[object Uint8ClampedArray]"?"uint8clampedarray":i==="[object Int16Array]"?"int16array":i==="[object Uint16Array]"?"uint16array":i==="[object Int32Array]"?"int32array":i==="[object Uint32Array]"?"uint32array":i==="[object Float32Array]"?"float32array":i==="[object Float64Array]"?"float64array":"object"}}}),LKr=wG({"node_modules/rename-keys/index.js"(e,t){(function(){function n(o,r){if(typeof r!="function")return o;var i={};for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(i[r(s,o[s])||s]=o[s]);return i}t!==void 0&&t.exports?t.exports=n:typeof define=="function"&&define.amd?define([],function(){return n}):window.rename=n})()}}),HKr=wG({"node_modules/deep-rename-keys/index.js"(e,t){var n=kKr(),o=LKr();t.exports=function r(i,s){var a=n(i);if(a!=="object"&&a!=="array")throw Error("expected an object");var c=[];for(var l in a==="object"&&(i=o(i,s),c={}),i)if(i.hasOwnProperty(l)){var h=i[l];n(h)==="object"||n(h)==="array"?c[l]=r(h,s):c[l]=h}return c}}}),wbn=wG({"node_modules/eventemitter3/index.js"(e,t){var n=Object.prototype.hasOwnProperty,o="~";function r(){}function i(a,c,l){this.fn=a,this.context=c,this.once=l||!1}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(o=!1)),s.prototype.eventNames=function(){var a,c,l=[];if(this._eventsCount===0)return l;for(c in a=this._events)n.call(a,c)&&l.push(o?c.slice(1):c);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(a)):l},s.prototype.listeners=function(a,c){var l=o?o+a:a,h=this._events[l];if(c)return!!h;if(!h)return[];if(h.fn)return[h.fn];for(var d=0,u=h.length,_=Array(u);d<u;d++)_[d]=h[d].fn;return _},s.prototype.emit=function(a,c,l,h,d,u){var _=o?o+a:a;if(!this._events[_])return!1;var p,m,A=this._events[_],g=arguments.length;if(A.fn){switch(A.once&&this.removeListener(a,A.fn,void 0,!0),g){case 1:return A.fn.call(A.context),!0;case 2:return A.fn.call(A.context,c),!0;case 3:return A.fn.call(A.context,c,l),!0;case 4:return A.fn.call(A.context,c,l,h),!0;case 5:return A.fn.call(A.context,c,l,h,d),!0;case 6:return A.fn.call(A.context,c,l,h,d,u),!0}for(m=1,p=Array(g-1);m<g;m++)p[m-1]=arguments[m];A.fn.apply(A.context,p)}else{var f,y=A.length;for(m=0;m<y;m++)switch(A[m].once&&this.removeListener(a,A[m].fn,void 0,!0),g){case 1:A[m].fn.call(A[m].context);break;case 2:A[m].fn.call(A[m].context,c);break;case 3:A[m].fn.call(A[m].context,c,l);break;case 4:A[m].fn.call(A[m].context,c,l,h);break;default:if(!p)for(f=1,p=Array(g-1);f<g;f++)p[f-1]=arguments[f];A[m].fn.apply(A[m].context,p)}}return!0},s.prototype.on=function(a,c,l){var h=new i(c,l||this),d=o?o+a:a;return this._events[d]?this._events[d].fn?this._events[d]=[this._events[d],h]:this._events[d].push(h):(this._events[d]=h,this._eventsCount++),this},s.prototype.once=function(a,c,l){var h=new i(c,l||this,!0),d=o?o+a:a;return this._events[d]?this._events[d].fn?this._events[d]=[this._events[d],h]:this._events[d].push(h):(this._events[d]=h,this._eventsCount++),this},s.prototype.removeListener=function(a,c,l,h){var d=o?o+a:a;if(!this._events[d])return this;if(!c)return--this._eventsCount===0?this._events=new r:delete this._events[d],this;var u=this._events[d];if(u.fn)u.fn!==c||h&&!u.once||l&&u.context!==l||(--this._eventsCount===0?this._events=new r:delete this._events[d]);else{for(var _=0,p=[],m=u.length;_<m;_++)(u[_].fn!==c||h&&!u[_].once||l&&u[_].context!==l)&&p.push(u[_]);p.length?this._events[d]=p.length===1?p[0]:p:--this._eventsCount===0?this._events=new r:delete this._events[d]}return this},s.prototype.removeAllListeners=function(a){var c;return a?(c=o?o+a:a,this._events[c]&&(--this._eventsCount===0?this._events=new r:delete this._events[c])):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prototype.setMaxListeners=function(){return this},s.prefixed=o,s.EventEmitter=s,t!==void 0&&(t.exports=s)}}),FKr=wG({"node_modules/xml-lexer/dist/lexer.js"(e,t){function n(l,h,d){return h in l?Object.defineProperty(l,h,{value:d,enumerable:!0,configurable:!0,writable:!0}):l[h]=d,l}var o=wbn(),r=function(){},i={data:"state-data",cdata:"state-cdata",tagBegin:"state-tag-begin",tagName:"state-tag-name",tagEnd:"state-tag-end",attributeNameStart:"state-attribute-name-start",attributeName:"state-attribute-name",attributeNameEnd:"state-attribute-name-end",attributeValueBegin:"state-attribute-value-begin",attributeValue:"state-attribute-value"},s={lt:"action-lt",gt:"action-gt",space:"action-space",equal:"action-equal",quote:"action-quote",slash:"action-slash",char:"action-char",error:"action-error"},a={text:"text",openTag:"open-tag",closeTag:"close-tag",attributeName:"attribute-name",attributeValue:"attribute-value"},c={" ":s.space,"\t":s.space,"\n":s.space,"\r":s.space,"<":s.lt,">":s.gt,'"':s.quote,"'":s.quote,"=":s.equal,"/":s.slash};t.exports={State:i,Action:s,Type:a,create:function(l){var h,d,u,_,p,m,A,g,f,y;l=Object.assign({debug:!1},l);var x=new o,C=i.data,b="",I="",v="",P="",M="",B="",T=function(D,L){if(I[0]!=="?"&&I[0]!=="!"){var H={type:D,value:L};l.debug&&console.log("emit:",H),x.emit("data",H)}};x.stateMachine=(n(y={},i.data,(n(h={},s.lt,function(){b.trim()&&T(a.text,b),I="",M=!1,C=i.tagBegin}),n(h,s.char,function(D){b+=D}),h)),n(y,i.cdata,n({},s.char,function(D){(b+=D).substr(-3)==="]]>"&&(T(a.text,b.slice(0,-3)),b="",C=i.data)})),n(y,i.tagBegin,(n(d={},s.space,r),n(d,s.char,function(D){I=D,C=i.tagName}),n(d,s.slash,function(){I="",M=!0}),d)),n(y,i.tagName,(n(u={},s.space,function(){M?C=i.tagEnd:(C=i.attributeNameStart,T(a.openTag,I))}),n(u,s.gt,function(){T(M?a.closeTag:a.openTag,I),b="",C=i.data}),n(u,s.slash,function(){C=i.tagEnd,T(a.openTag,I)}),n(u,s.char,function(D){(I+=D)==="![CDATA["&&(C=i.cdata,b="",I="")}),u)),n(y,i.tagEnd,(n(_={},s.gt,function(){T(a.closeTag,I),b="",C=i.data}),n(_,s.char,r),_)),n(y,i.attributeNameStart,(n(p={},s.char,function(D){v=D,C=i.attributeName}),n(p,s.gt,function(){b="",C=i.data}),n(p,s.space,r),n(p,s.slash,function(){M=!0,C=i.tagEnd}),p)),n(y,i.attributeName,(n(m={},s.space,function(){C=i.attributeNameEnd}),n(m,s.equal,function(){T(a.attributeName,v),C=i.attributeValueBegin}),n(m,s.gt,function(){P="",T(a.attributeName,v),T(a.attributeValue,P),b="",C=i.data}),n(m,s.slash,function(){M=!0,P="",T(a.attributeName,v),T(a.attributeValue,P),C=i.tagEnd}),n(m,s.char,function(D){v+=D}),m)),n(y,i.attributeNameEnd,(n(A={},s.space,r),n(A,s.equal,function(){T(a.attributeName,v),C=i.attributeValueBegin}),n(A,s.gt,function(){P="",T(a.attributeName,v),T(a.attributeValue,P),b="",C=i.data}),n(A,s.char,function(D){P="",T(a.attributeName,v),T(a.attributeValue,P),v=D,C=i.attributeName}),A)),n(y,i.attributeValueBegin,(n(g={},s.space,r),n(g,s.quote,function(D){B=D,P="",C=i.attributeValue}),n(g,s.gt,function(){T(a.attributeValue,P=""),b="",C=i.data}),n(g,s.char,function(D){B="",P=D,C=i.attributeValue}),g)),n(y,i.attributeValue,(n(f={},s.space,function(D){B?P+=D:(T(a.attributeValue,P),C=i.attributeNameStart)}),n(f,s.quote,function(D){B===D?(T(a.attributeValue,P),C=i.attributeNameStart):P+=D}),n(f,s.gt,function(D){B?P+=D:(T(a.attributeValue,P),b="",C=i.data)}),n(f,s.slash,function(D){B?P+=D:(T(a.attributeValue,P),M=!0,C=i.tagEnd)}),n(f,s.char,function(D){P+=D}),f)),y);var N=function(D){l.debug&&console.log(C,D);var L=x.stateMachine[C],H=L[function(V){return c[V]||s.char}(D)]||L[s.error]||L[s.char];H(D)};return x.write=function(D){for(var L=D.length,H=0;H<L;H++)N(D[H])},x}}}}),zKr=wG({"node_modules/xml-reader/dist/reader.js"(e,t){var n=wbn(),o=FKr(),r=o.Type,i={element:"element",text:"text"},s=function(c){return Object.assign({name:"",type:i.element,value:"",parent:null,attributes:{},children:[]},c)},a=function(c){c=Object.assign({stream:!1,parentNodes:!0,doneEvent:"done",tagPrefix:"tag:",emitTopLevelOnly:!1,debug:!1},c);var l=void 0,h=void 0,d=void 0,u=void 0,_=new n,p=function(m){switch(m.type){case r.openTag:if(d===null)(d=h).name=m.value;else{var A=s({name:m.value,parent:d});d.children.push(A),d=A}break;case r.closeTag:var g=d.parent;if(c.parentNodes||(d.parent=null),d.name!==m.value)break;c.stream&&g===h&&(h.children=[],d.parent=null),c.emitTopLevelOnly&&g!==h||(_.emit(c.tagPrefix+d.name,d),_.emit("tag",d.name,d)),d===h&&(l.removeAllListeners("data"),_.emit(c.doneEvent,d),h=null),d=g;break;case r.text:d&&d.children.push(s({type:i.text,value:m.value,parent:c.parentNodes?d:null}));break;case r.attributeName:u=m.value,d.attributes[u]="";break;case r.attributeValue:d.attributes[u]=m.value}};return _.reset=function(){(l=o.create({debug:c.debug})).on("data",p),h=s(),d=null,u="",_.parse=l.write},_.reset(),_};t.exports={parseSync:function(c,l){l=Object.assign({},l,{stream:!1,tagPrefix:":"});var h=a(l),d=void 0;return h.on("done",function(u){d=u}),h.parse(c),d},create:a,NodeType:i}}}),{cos:bra,sin:Ira,PI:vra}=Math,{tan:Sra}=Math,Pra=(N2n(HKr()),N2n(zKr()),class{MAX_ITERATIONS=1e5;solved=!1;failed=!1;iterations=0;progress=0;error=null;activeSubSolver;failedSubSolvers;timeToSolve;stats={};_setupDone=!1;setup(){this._setupDone||(this._setup(),this._setupDone=!0)}_setup(){}step(){if(this._setupDone||this.setup(),!this.solved&&!this.failed){this.iterations++;try{this._step()}catch(e){throw this.error=`${this.constructor.name} error: ${e}`,this.failed=!0,e}!this.solved&&this.iterations>=this.MAX_ITERATIONS&&this.tryFinalAcceptance(),!this.solved&&this.iterations>=this.MAX_ITERATIONS&&(this.error=`${this.constructor.name} ran out of iterations`,this.failed=!0),"computeProgress"in this&&(this.progress=this.computeProgress())}}_step(){}getConstructorParams(){throw Error("getConstructorParams not implemented")}getOutput(){return null}solve(){let e=Date.now();for(;!this.solved&&!this.failed;)this.step();let t=Date.now();this.timeToSolve=t-e}visualize(){return{lines:[],points:[],rects:[],circles:[]}}tryFinalAcceptance(){}preview(){return{lines:[],points:[],rects:[],circles:[]}}}),{create:OKr,defineProperty:R2n,getOwnPropertyDescriptor:VKr,getOwnPropertyNames:Bbn,getPrototypeOf:YKr}=Object,GKr=Object.prototype.hasOwnProperty,eC=(e,t)=>function(){return t||(0,e[Bbn(e)[0]])((t={exports:{}}).exports,t),t.exports},Z8e=eC({"node_modules/binary-search-bounds/search-bounds.js"(e,t){function n(c,l,h,d,u){for(var _=u+1;d<=u;){var p=d+u>>>1,m=c[p];(h!==void 0?h(m,l):m-l)>=0?(_=p,u=p-1):d=p+1}return _}function o(c,l,h,d,u){for(var _=u+1;d<=u;){var p=d+u>>>1,m=c[p];(h!==void 0?h(m,l):m-l)>0?(_=p,u=p-1):d=p+1}return _}function r(c,l,h,d,u){for(var _=d-1;d<=u;){var p=d+u>>>1,m=c[p];(h!==void 0?h(m,l):m-l)<0?(_=p,d=p+1):u=p-1}return _}function i(c,l,h,d,u){for(var _=d-1;d<=u;){var p=d+u>>>1,m=c[p];(h!==void 0?h(m,l):m-l)<=0?(_=p,d=p+1):u=p-1}return _}function s(c,l,h,d,u){for(;d<=u;){var _=d+u>>>1,p=c[_],m=h!==void 0?h(p,l):p-l;if(m===0)return _;m<=0?d=_+1:u=_-1}return-1}function a(c,l,h,d,u,_){return typeof h=="function"?_(c,l,h,d===void 0?0:0|d,u===void 0?c.length-1:0|u):_(c,l,void 0,h===void 0?0:0|h,d===void 0?c.length-1:0|d)}t.exports={ge:function(c,l,h,d,u){return a(c,l,h,d,u,n)},gt:function(c,l,h,d,u){return a(c,l,h,d,u,o)},lt:function(c,l,h,d,u){return a(c,l,h,d,u,r)},le:function(c,l,h,d,u){return a(c,l,h,d,u,i)},eq:function(c,l,h,d,u){return a(c,l,h,d,u,s)}}}}),gat=eC({"node_modules/two-product/two-product.js"(e,t){t.exports=function(o,r,i){var s=o*r,a=n*o,c=a-(a-o),l=o-c,h=n*r,d=h-(h-r),u=r-d,_=l*u-(s-c*d-l*d-c*u);if(i)return i[0]=_,i[1]=s,i;return[_,s]};var n=+(Math.pow(2,27)+1)}}),Tbn=eC({"node_modules/robust-sum/robust-sum.js"(e,t){t.exports=function(n,o){var r=0|n.length,i=0|o.length;if(r===1&&i===1)return function(v,P){var M=v+P,B=M-v,T=M-B,N=P-B,D=v-T,L=D+N;if(L)return[L,M];return[M]}(n[0],o[0]);var s,a,c=Array(r+i),l=0,h=0,d=0,u=Math.abs,_=n[h],p=u(_),m=o[d],A=u(m);p<A?(a=_,(h+=1)<r&&(p=u(_=n[h]))):(a=m,(d+=1)<i&&(A=u(m=o[d]))),h<r&&p<A||d>=i?(s=_,(h+=1)<r&&(p=u(_=n[h]))):(s=m,(d+=1)<i&&(A=u(m=o[d])));var g,f,y=s+a,x=y-s,C=a-x,b=C,I=y;for(;h<r&&d<i;)p<A?(s=_,(h+=1)<r&&(p=u(_=n[h]))):(s=m,(d+=1)<i&&(A=u(m=o[d]))),(C=(a=b)-(x=(y=s+a)-s))&&(c[l++]=C),b=I-((g=I+y)-(f=g-I))+(y-f),I=g;for(;h<r;)(C=(a=b)-(x=(y=(s=_)+a)-s))&&(c[l++]=C),b=I-((g=I+y)-(f=g-I))+(y-f),I=g,(h+=1)<r&&(_=n[h]);for(;d<i;)(C=(a=b)-(x=(y=(s=m)+a)-s))&&(c[l++]=C),b=I-((g=I+y)-(f=g-I))+(y-f),I=g,(d+=1)<i&&(m=o[d]);return b&&(c[l++]=b),I&&(c[l++]=I),l||(c[l++]=0),c.length=l,c}}}),UKr=eC({"node_modules/two-sum/two-sum.js"(e,t){t.exports=function(n,o,r){var i=n+o,s=i-n,a=o-s,c=n-(i-s);if(r)return r[0]=c+a,r[1]=i,r;return[c+a,i]}}}),Dbn=eC({"node_modules/robust-scale/robust-scale.js"(e,t){var n=gat(),o=UKr();t.exports=function(r,i){var s=r.length;if(s===1){var a=n(r[0],i);return a[0]?a:[a[1]]}var c=Array(2*s),l=[0.1,0.1],h=[0.1,0.1],d=0;n(r[0],i,l),l[0]&&(c[d++]=l[0]);for(var u=1;u<s;++u){n(r[u],i,h);var _=l[1];o(_,h[0],l),l[0]&&(c[d++]=l[0]);var p=h[1],m=l[1],A=p+m,g=m-(A-p);l[1]=A,g&&(c[d++]=g)}return l[1]&&(c[d++]=l[1]),d===0&&(c[d++]=0),c.length=d,c}}}),Nbn=eC({"node_modules/robust-subtract/robust-diff.js"(e,t){t.exports=function(n,o){var r=0|n.length,i=0|o.length;if(r===1&&i===1)return function(v,P){var M=v+P,B=M-v,T=M-B,N=P-B,D=v-T,L=D+N;if(L)return[L,M];return[M]}(n[0],-o[0]);var s,a,c=Array(r+i),l=0,h=0,d=0,u=Math.abs,_=n[h],p=u(_),m=-o[d],A=u(m);p<A?(a=_,(h+=1)<r&&(p=u(_=n[h]))):(a=m,(d+=1)<i&&(A=u(m=-o[d]))),h<r&&p<A||d>=i?(s=_,(h+=1)<r&&(p=u(_=n[h]))):(s=m,(d+=1)<i&&(A=u(m=-o[d])));var g,f,y=s+a,x=y-s,C=a-x,b=C,I=y;for(;h<r&&d<i;)p<A?(s=_,(h+=1)<r&&(p=u(_=n[h]))):(s=m,(d+=1)<i&&(A=u(m=-o[d]))),(C=(a=b)-(x=(y=s+a)-s))&&(c[l++]=C),b=I-((g=I+y)-(f=g-I))+(y-f),I=g;for(;h<r;)(C=(a=b)-(x=(y=(s=_)+a)-s))&&(c[l++]=C),b=I-((g=I+y)-(f=g-I))+(y-f),I=g,(h+=1)<r&&(_=n[h]);for(;d<i;)(C=(a=b)-(x=(y=(s=m)+a)-s))&&(c[l++]=C),b=I-((g=I+y)-(f=g-I))+(y-f),I=g,(d+=1)<i&&(m=-o[d]);return b&&(c[l++]=b),I&&(c[l++]=I),l||(c[l++]=0),c.length=l,c}}}),WKr=eC({"node_modules/robust-orientation/orientation.js"(e,t){var n=gat(),o=Tbn(),r=Dbn(),i=Nbn();function s(m,A,g,f){return function(y,x,C){var b=m(m(A(x[1],C[0]),A(-C[1],x[0])),m(A(y[1],x[0]),A(-x[1],y[0]))),I=m(A(y[1],C[0]),A(-C[1],y[0])),v=f(b,I);return v[v.length-1]}}function a(m,A,g,f){return function(y,x,C,b){var I=m(m(g(m(A(C[1],b[0]),A(-b[1],C[0])),x[2]),m(g(m(A(x[1],b[0]),A(-b[1],x[0])),-C[2]),g(m(A(x[1],C[0]),A(-C[1],x[0])),b[2]))),m(g(m(A(x[1],b[0]),A(-b[1],x[0])),y[2]),m(g(m(A(y[1],b[0]),A(-b[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),b[2])))),v=m(m(g(m(A(C[1],b[0]),A(-b[1],C[0])),y[2]),m(g(m(A(y[1],b[0]),A(-b[1],y[0])),-C[2]),g(m(A(y[1],C[0]),A(-C[1],y[0])),b[2]))),m(g(m(A(x[1],C[0]),A(-C[1],x[0])),y[2]),m(g(m(A(y[1],C[0]),A(-C[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),C[2])))),P=f(I,v);return P[P.length-1]}}function c(m,A,g,f){return function(y,x,C,b,I){var v=m(m(m(g(m(g(m(A(b[1],I[0]),A(-I[1],b[0])),C[2]),m(g(m(A(C[1],I[0]),A(-I[1],C[0])),-b[2]),g(m(A(C[1],b[0]),A(-b[1],C[0])),I[2]))),x[3]),m(g(m(g(m(A(b[1],I[0]),A(-I[1],b[0])),x[2]),m(g(m(A(x[1],I[0]),A(-I[1],x[0])),-b[2]),g(m(A(x[1],b[0]),A(-b[1],x[0])),I[2]))),-C[3]),g(m(g(m(A(C[1],I[0]),A(-I[1],C[0])),x[2]),m(g(m(A(x[1],I[0]),A(-I[1],x[0])),-C[2]),g(m(A(x[1],C[0]),A(-C[1],x[0])),I[2]))),b[3]))),m(g(m(g(m(A(C[1],b[0]),A(-b[1],C[0])),x[2]),m(g(m(A(x[1],b[0]),A(-b[1],x[0])),-C[2]),g(m(A(x[1],C[0]),A(-C[1],x[0])),b[2]))),-I[3]),m(g(m(g(m(A(b[1],I[0]),A(-I[1],b[0])),x[2]),m(g(m(A(x[1],I[0]),A(-I[1],x[0])),-b[2]),g(m(A(x[1],b[0]),A(-b[1],x[0])),I[2]))),y[3]),g(m(g(m(A(b[1],I[0]),A(-I[1],b[0])),y[2]),m(g(m(A(y[1],I[0]),A(-I[1],y[0])),-b[2]),g(m(A(y[1],b[0]),A(-b[1],y[0])),I[2]))),-x[3])))),m(m(g(m(g(m(A(x[1],I[0]),A(-I[1],x[0])),y[2]),m(g(m(A(y[1],I[0]),A(-I[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),I[2]))),b[3]),m(g(m(g(m(A(x[1],b[0]),A(-b[1],x[0])),y[2]),m(g(m(A(y[1],b[0]),A(-b[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),b[2]))),-I[3]),g(m(g(m(A(C[1],b[0]),A(-b[1],C[0])),x[2]),m(g(m(A(x[1],b[0]),A(-b[1],x[0])),-C[2]),g(m(A(x[1],C[0]),A(-C[1],x[0])),b[2]))),y[3]))),m(g(m(g(m(A(C[1],b[0]),A(-b[1],C[0])),y[2]),m(g(m(A(y[1],b[0]),A(-b[1],y[0])),-C[2]),g(m(A(y[1],C[0]),A(-C[1],y[0])),b[2]))),-x[3]),m(g(m(g(m(A(x[1],b[0]),A(-b[1],x[0])),y[2]),m(g(m(A(y[1],b[0]),A(-b[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),b[2]))),C[3]),g(m(g(m(A(x[1],C[0]),A(-C[1],x[0])),y[2]),m(g(m(A(y[1],C[0]),A(-C[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),C[2]))),-b[3]))))),P=m(m(m(g(m(g(m(A(b[1],I[0]),A(-I[1],b[0])),C[2]),m(g(m(A(C[1],I[0]),A(-I[1],C[0])),-b[2]),g(m(A(C[1],b[0]),A(-b[1],C[0])),I[2]))),y[3]),g(m(g(m(A(b[1],I[0]),A(-I[1],b[0])),y[2]),m(g(m(A(y[1],I[0]),A(-I[1],y[0])),-b[2]),g(m(A(y[1],b[0]),A(-b[1],y[0])),I[2]))),-C[3])),m(g(m(g(m(A(C[1],I[0]),A(-I[1],C[0])),y[2]),m(g(m(A(y[1],I[0]),A(-I[1],y[0])),-C[2]),g(m(A(y[1],C[0]),A(-C[1],y[0])),I[2]))),b[3]),g(m(g(m(A(C[1],b[0]),A(-b[1],C[0])),y[2]),m(g(m(A(y[1],b[0]),A(-b[1],y[0])),-C[2]),g(m(A(y[1],C[0]),A(-C[1],y[0])),b[2]))),-I[3]))),m(m(g(m(g(m(A(C[1],I[0]),A(-I[1],C[0])),x[2]),m(g(m(A(x[1],I[0]),A(-I[1],x[0])),-C[2]),g(m(A(x[1],C[0]),A(-C[1],x[0])),I[2]))),y[3]),g(m(g(m(A(C[1],I[0]),A(-I[1],C[0])),y[2]),m(g(m(A(y[1],I[0]),A(-I[1],y[0])),-C[2]),g(m(A(y[1],C[0]),A(-C[1],y[0])),I[2]))),-x[3])),m(g(m(g(m(A(x[1],I[0]),A(-I[1],x[0])),y[2]),m(g(m(A(y[1],I[0]),A(-I[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),I[2]))),C[3]),g(m(g(m(A(x[1],C[0]),A(-C[1],x[0])),y[2]),m(g(m(A(y[1],C[0]),A(-C[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),C[2]))),-I[3])))),M=f(v,P);return M[M.length-1]}}function l(m){return(m===3?s:m===4?a:c)(o,n,r,i)}var h=l(3),d=l(4),u=[function(){return 0},function(){return 0},function(m,A){return A[0]-m[0]},function(m,A,g){var f,y=(m[1]-g[1])*(A[0]-g[0]),x=(m[0]-g[0])*(A[1]-g[1]),C=y-x;if(y>0){if(x<=0)return C;f=y+x}else{if(!(y<0))return C;if(x>=0)return C;f=-(y+x)}var b=0.00000000000000033306690738754716*f;return C>=b||C<=-b?C:h(m,A,g)},function(m,A,g,f){var y=m[0]-f[0],x=A[0]-f[0],C=g[0]-f[0],b=m[1]-f[1],I=A[1]-f[1],v=g[1]-f[1],P=m[2]-f[2],M=A[2]-f[2],B=g[2]-f[2],T=x*v,N=C*I,D=C*b,L=y*v,H=y*I,V=x*b,O=P*(T-N)+M*(D-L)+B*(H-V),U=0.0000000000000007771561172376103*((Math.abs(T)+Math.abs(N))*Math.abs(P)+(Math.abs(D)+Math.abs(L))*Math.abs(M)+(Math.abs(H)+Math.abs(V))*Math.abs(B));return O>U||-O>U?O:d(m,A,g,f)}];function _(m){var A=u[m.length];return A||(A=u[m.length]=l(m.length)),A.apply(void 0,m)}function p(m,A,g,f,y,x,C){return function(b,I,v,P,M){switch(arguments.length){case 0:case 1:return 0;case 2:return f(b,I);case 3:return y(b,I,v);case 4:return x(b,I,v,P);case 5:return C(b,I,v,P,M)}for(var B=Array(arguments.length),T=0;T<arguments.length;++T)B[T]=arguments[T];return m(B)}}(function(){for(;u.length<=5;)u.push(l(u.length));t.exports=p.apply(void 0,[_].concat(u));for(var m=0;m<=5;++m)t.exports[m]=u[m]})()}}),XKr=eC({"node_modules/cdt2d/lib/monotone.js"(e,t){var n=Z8e(),o=WKr()[3];function r(u,_,p,m,A){this.a=u,this.b=_,this.idx=p,this.lowerIds=m,this.upperIds=A}function i(u,_,p,m){this.a=u,this.b=_,this.type=p,this.idx=m}function s(u,_){var p=u.a[0]-_.a[0]||u.a[1]-_.a[1]||u.type-_.type;return p||(u.type!==0&&(p=o(u.a,u.b,_.b))?p:u.idx-_.idx)}function a(u,_){return o(u.a,u.b,_)}function c(u,_,p,m,A){for(var g=n.lt(_,m,a),f=n.gt(_,m,a),y=g;y<f;++y){for(var x=_[y],C=x.lowerIds,b=C.length;b>1&&o(p[C[b-2]],p[C[b-1]],m)>0;)u.push([C[b-1],C[b-2],A]),b-=1;C.length=b,C.push(A);var I=x.upperIds;for(b=I.length;b>1&&o(p[I[b-2]],p[I[b-1]],m)<0;)u.push([I[b-2],I[b-1],A]),b-=1;I.length=b,I.push(A)}}function l(u,_){var p;return(p=u.a[0]<_.a[0]?o(u.a,u.b,_.a):o(_.b,_.a,u.a))?p:(p=_.b[0]<u.b[0]?o(u.a,u.b,_.b):o(_.b,_.a,u.b))||u.idx-_.idx}function h(u,_,p){var m=n.le(u,p,l),A=u[m],g=A.upperIds,f=g[g.length-1];A.upperIds=[f],u.splice(m+1,0,new r(p.a,p.b,p.idx,[f],g))}function d(u,_,p){var m=p.a;p.a=p.b,p.b=m;var A=n.eq(u,p,l),g=u[A];u[A-1].upperIds=g.upperIds,u.splice(A,1)}t.exports=function(u,_){for(var p=u.length,m=_.length,A=[],g=0;g<p;++g)A.push(new i(u[g],null,0,g));for(g=0;g<m;++g){var f=_[g],y=u[f[0]],x=u[f[1]];y[0]<x[0]?A.push(new i(y,x,2,g),new i(x,y,1,g)):y[0]>x[0]&&A.push(new i(x,y,2,g),new i(y,x,1,g))}A.sort(s);for(var C=A[0].a[0]-(1+Math.abs(A[0].a[0]))*Math.pow(2,-52),b=[new r([C,1],[C,0],-1,[],[],[],[])],I=[],v=(g=0,A.length);g<v;++g){var P=A[g],M=P.type;M===0?c(I,b,u,P.a,P.idx):M===2?h(b,u,P):d(b,u,P)}return I}}}),jKr=eC({"node_modules/cdt2d/lib/triangulation.js"(e,t){var n=Z8e();function o(s,a){this.stars=s,this.edges=a}t.exports=function(s,a){for(var c=Array(s),l=0;l<s;++l)c[l]=[];return new o(c,a)};var r=o.prototype;function i(s,a,c){for(var l=1,h=s.length;l<h;l+=2)if(s[l-1]===a&&s[l]===c)return s[l-1]=s[h-2],s[l]=s[h-1],void(s.length=h-2)}r.isConstraint=function(){var s=[0,0];function a(c,l){return c[0]-l[0]||c[1]-l[1]}return function(c,l){return s[0]=Math.min(c,l),s[1]=Math.max(c,l),n.eq(this.edges,s,a)>=0}}(),r.removeTriangle=function(s,a,c){var l=this.stars;i(l[s],a,c),i(l[a],c,s),i(l[c],s,a)},r.addTriangle=function(s,a,c){var l=this.stars;l[s].push(a,c),l[a].push(c,s),l[c].push(s,a)},r.opposite=function(s,a){for(var c=this.stars[a],l=1,h=c.length;l<h;l+=2)if(c[l]===s)return c[l-1];return-1},r.flip=function(s,a){var c=this.opposite(s,a),l=this.opposite(a,s);this.removeTriangle(s,a,c),this.removeTriangle(a,s,l),this.addTriangle(s,l,c),this.addTriangle(a,c,l)},r.edges=function(){for(var s=this.stars,a=[],c=0,l=s.length;c<l;++c)for(var h=s[c],d=0,u=h.length;d<u;d+=2)a.push([h[d],h[d+1]]);return a},r.cells=function(){for(var s=this.stars,a=[],c=0,l=s.length;c<l;++c)for(var h=s[c],d=0,u=h.length;d<u;d+=2){var _=h[d],p=h[d+1];c<Math.min(_,p)&&a.push([c,_,p])}return a}}}),KKr=eC({"node_modules/robust-in-sphere/in-sphere.js"(e,t){var n=gat(),o=Tbn(),r=Nbn(),i=Dbn();function s(p){return(p===3?a:p===4?c:p===5?l:h)(o,r,n,i)}function a(p,m,A,g){return function(f,y,x){var C=A(f[0],f[0]),b=g(C,y[0]),I=g(C,x[0]),v=A(y[0],y[0]),P=g(v,f[0]),M=g(v,x[0]),B=A(x[0],x[0]),T=g(B,f[0]),N=g(B,y[0]),D=p(m(N,M),m(P,b)),L=m(T,I),H=m(D,L);return H[H.length-1]}}function c(p,m,A,g){return function(f,y,x,C){var b=p(A(f[0],f[0]),A(f[1],f[1])),I=g(b,y[0]),v=g(b,x[0]),P=g(b,C[0]),M=p(A(y[0],y[0]),A(y[1],y[1])),B=g(M,f[0]),T=g(M,x[0]),N=g(M,C[0]),D=p(A(x[0],x[0]),A(x[1],x[1])),L=g(D,f[0]),H=g(D,y[0]),V=g(D,C[0]),O=p(A(C[0],C[0]),A(C[1],C[1])),U=g(O,f[0]),j=g(O,y[0]),Y=g(O,x[0]),X=p(p(g(m(Y,V),y[1]),p(g(m(j,N),-x[1]),g(m(H,T),C[1]))),p(g(m(j,N),f[1]),p(g(m(U,P),-y[1]),g(m(B,I),C[1])))),K=p(p(g(m(Y,V),f[1]),p(g(m(U,P),-x[1]),g(m(L,v),C[1]))),p(g(m(H,T),f[1]),p(g(m(L,v),-y[1]),g(m(B,I),x[1])))),J=m(X,K);return J[J.length-1]}}function l(p,m,A,g){return function(f,y,x,C,b){var I=p(A(f[0],f[0]),p(A(f[1],f[1]),A(f[2],f[2]))),v=g(I,y[0]),P=g(I,x[0]),M=g(I,C[0]),B=g(I,b[0]),T=p(A(y[0],y[0]),p(A(y[1],y[1]),A(y[2],y[2]))),N=g(T,f[0]),D=g(T,x[0]),L=g(T,C[0]),H=g(T,b[0]),V=p(A(x[0],x[0]),p(A(x[1],x[1]),A(x[2],x[2]))),O=g(V,f[0]),U=g(V,y[0]),j=g(V,C[0]),Y=g(V,b[0]),X=p(A(C[0],C[0]),p(A(C[1],C[1]),A(C[2],C[2]))),K=g(X,f[0]),J=g(X,y[0]),ee=g(X,x[0]),se=g(X,b[0]),ne=p(A(b[0],b[0]),p(A(b[1],b[1]),A(b[2],b[2]))),re=g(ne,f[0]),Z=g(ne,y[0]),te=g(ne,x[0]),ie=g(ne,C[0]),le=p(p(p(g(p(g(m(ie,se),x[1]),p(g(m(te,Y),-C[1]),g(m(ee,j),b[1]))),y[2]),p(g(p(g(m(ie,se),y[1]),p(g(m(Z,H),-C[1]),g(m(J,L),b[1]))),-x[2]),g(p(g(m(te,Y),y[1]),p(g(m(Z,H),-x[1]),g(m(U,D),b[1]))),C[2]))),p(g(p(g(m(ee,j),y[1]),p(g(m(J,L),-x[1]),g(m(U,D),C[1]))),-b[2]),p(g(p(g(m(ie,se),y[1]),p(g(m(Z,H),-C[1]),g(m(J,L),b[1]))),f[2]),g(p(g(m(ie,se),f[1]),p(g(m(re,B),-C[1]),g(m(K,M),b[1]))),-y[2])))),p(p(g(p(g(m(Z,H),f[1]),p(g(m(re,B),-y[1]),g(m(N,v),b[1]))),C[2]),p(g(p(g(m(J,L),f[1]),p(g(m(K,M),-y[1]),g(m(N,v),C[1]))),-b[2]),g(p(g(m(ee,j),y[1]),p(g(m(J,L),-x[1]),g(m(U,D),C[1]))),f[2]))),p(g(p(g(m(ee,j),f[1]),p(g(m(K,M),-x[1]),g(m(O,P),C[1]))),-y[2]),p(g(p(g(m(J,L),f[1]),p(g(m(K,M),-y[1]),g(m(N,v),C[1]))),x[2]),g(p(g(m(U,D),f[1]),p(g(m(O,P),-y[1]),g(m(N,v),x[1]))),-C[2]))))),ue=p(p(p(g(p(g(m(ie,se),x[1]),p(g(m(te,Y),-C[1]),g(m(ee,j),b[1]))),f[2]),g(p(g(m(ie,se),f[1]),p(g(m(re,B),-C[1]),g(m(K,M),b[1]))),-x[2])),p(g(p(g(m(te,Y),f[1]),p(g(m(re,B),-x[1]),g(m(O,P),b[1]))),C[2]),g(p(g(m(ee,j),f[1]),p(g(m(K,M),-x[1]),g(m(O,P),C[1]))),-b[2]))),p(p(g(p(g(m(te,Y),y[1]),p(g(m(Z,H),-x[1]),g(m(U,D),b[1]))),f[2]),g(p(g(m(te,Y),f[1]),p(g(m(re,B),-x[1]),g(m(O,P),b[1]))),-y[2])),p(g(p(g(m(Z,H),f[1]),p(g(m(re,B),-y[1]),g(m(N,v),b[1]))),x[2]),g(p(g(m(U,D),f[1]),p(g(m(O,P),-y[1]),g(m(N,v),x[1]))),-b[2])))),de=m(le,ue);return de[de.length-1]}}function h(p,m,A,g){return function(f,y,x,C,b,I){var v=p(p(A(f[0],f[0]),A(f[1],f[1])),p(A(f[2],f[2]),A(f[3],f[3]))),P=g(v,y[0]),M=g(v,x[0]),B=g(v,C[0]),T=g(v,b[0]),N=g(v,I[0]),D=p(p(A(y[0],y[0]),A(y[1],y[1])),p(A(y[2],y[2]),A(y[3],y[3]))),L=g(D,f[0]),H=g(D,x[0]),V=g(D,C[0]),O=g(D,b[0]),U=g(D,I[0]),j=p(p(A(x[0],x[0]),A(x[1],x[1])),p(A(x[2],x[2]),A(x[3],x[3]))),Y=g(j,f[0]),X=g(j,y[0]),K=g(j,C[0]),J=g(j,b[0]),ee=g(j,I[0]),se=p(p(A(C[0],C[0]),A(C[1],C[1])),p(A(C[2],C[2]),A(C[3],C[3]))),ne=g(se,f[0]),re=g(se,y[0]),Z=g(se,x[0]),te=g(se,b[0]),ie=g(se,I[0]),le=p(p(A(b[0],b[0]),A(b[1],b[1])),p(A(b[2],b[2]),A(b[3],b[3]))),ue=g(le,f[0]),de=g(le,y[0]),me=g(le,x[0]),Ae=g(le,C[0]),xe=g(le,I[0]),Me=p(p(A(I[0],I[0]),A(I[1],I[1])),p(A(I[2],I[2]),A(I[3],I[3]))),Re=g(Me,f[0]),we=g(Me,y[0]),_e=g(Me,x[0]),ye=g(Me,C[0]),Se=g(Me,b[0]),Ne=p(p(p(g(p(p(g(p(g(m(Se,xe),C[1]),p(g(m(ye,ie),-b[1]),g(m(Ae,te),I[1]))),x[2]),g(p(g(m(Se,xe),x[1]),p(g(m(_e,ee),-b[1]),g(m(me,J),I[1]))),-C[2])),p(g(p(g(m(ye,ie),x[1]),p(g(m(_e,ee),-C[1]),g(m(Z,K),I[1]))),b[2]),g(p(g(m(Ae,te),x[1]),p(g(m(me,J),-C[1]),g(m(Z,K),b[1]))),-I[2]))),y[3]),p(g(p(p(g(p(g(m(Se,xe),C[1]),p(g(m(ye,ie),-b[1]),g(m(Ae,te),I[1]))),y[2]),g(p(g(m(Se,xe),y[1]),p(g(m(we,U),-b[1]),g(m(de,O),I[1]))),-C[2])),p(g(p(g(m(ye,ie),y[1]),p(g(m(we,U),-C[1]),g(m(re,V),I[1]))),b[2]),g(p(g(m(Ae,te),y[1]),p(g(m(de,O),-C[1]),g(m(re,V),b[1]))),-I[2]))),-x[3]),g(p(p(g(p(g(m(Se,xe),x[1]),p(g(m(_e,ee),-b[1]),g(m(me,J),I[1]))),y[2]),g(p(g(m(Se,xe),y[1]),p(g(m(we,U),-b[1]),g(m(de,O),I[1]))),-x[2])),p(g(p(g(m(_e,ee),y[1]),p(g(m(we,U),-x[1]),g(m(X,H),I[1]))),b[2]),g(p(g(m(me,J),y[1]),p(g(m(de,O),-x[1]),g(m(X,H),b[1]))),-I[2]))),C[3]))),p(p(g(p(p(g(p(g(m(ye,ie),x[1]),p(g(m(_e,ee),-C[1]),g(m(Z,K),I[1]))),y[2]),g(p(g(m(ye,ie),y[1]),p(g(m(we,U),-C[1]),g(m(re,V),I[1]))),-x[2])),p(g(p(g(m(_e,ee),y[1]),p(g(m(we,U),-x[1]),g(m(X,H),I[1]))),C[2]),g(p(g(m(Z,K),y[1]),p(g(m(re,V),-x[1]),g(m(X,H),C[1]))),-I[2]))),-b[3]),g(p(p(g(p(g(m(Ae,te),x[1]),p(g(m(me,J),-C[1]),g(m(Z,K),b[1]))),y[2]),g(p(g(m(Ae,te),y[1]),p(g(m(de,O),-C[1]),g(m(re,V),b[1]))),-x[2])),p(g(p(g(m(me,J),y[1]),p(g(m(de,O),-x[1]),g(m(X,H),b[1]))),C[2]),g(p(g(m(Z,K),y[1]),p(g(m(re,V),-x[1]),g(m(X,H),C[1]))),-b[2]))),I[3])),p(g(p(p(g(p(g(m(Se,xe),C[1]),p(g(m(ye,ie),-b[1]),g(m(Ae,te),I[1]))),y[2]),g(p(g(m(Se,xe),y[1]),p(g(m(we,U),-b[1]),g(m(de,O),I[1]))),-C[2])),p(g(p(g(m(ye,ie),y[1]),p(g(m(we,U),-C[1]),g(m(re,V),I[1]))),b[2]),g(p(g(m(Ae,te),y[1]),p(g(m(de,O),-C[1]),g(m(re,V),b[1]))),-I[2]))),f[3]),g(p(p(g(p(g(m(Se,xe),C[1]),p(g(m(ye,ie),-b[1]),g(m(Ae,te),I[1]))),f[2]),g(p(g(m(Se,xe),f[1]),p(g(m(Re,N),-b[1]),g(m(ue,T),I[1]))),-C[2])),p(g(p(g(m(ye,ie),f[1]),p(g(m(Re,N),-C[1]),g(m(ne,B),I[1]))),b[2]),g(p(g(m(Ae,te),f[1]),p(g(m(ue,T),-C[1]),g(m(ne,B),b[1]))),-I[2]))),-y[3])))),p(p(p(g(p(p(g(p(g(m(Se,xe),y[1]),p(g(m(we,U),-b[1]),g(m(de,O),I[1]))),f[2]),g(p(g(m(Se,xe),f[1]),p(g(m(Re,N),-b[1]),g(m(ue,T),I[1]))),-y[2])),p(g(p(g(m(we,U),f[1]),p(g(m(Re,N),-y[1]),g(m(L,P),I[1]))),b[2]),g(p(g(m(de,O),f[1]),p(g(m(ue,T),-y[1]),g(m(L,P),b[1]))),-I[2]))),C[3]),g(p(p(g(p(g(m(ye,ie),y[1]),p(g(m(we,U),-C[1]),g(m(re,V),I[1]))),f[2]),g(p(g(m(ye,ie),f[1]),p(g(m(Re,N),-C[1]),g(m(ne,B),I[1]))),-y[2])),p(g(p(g(m(we,U),f[1]),p(g(m(Re,N),-y[1]),g(m(L,P),I[1]))),C[2]),g(p(g(m(re,V),f[1]),p(g(m(ne,B),-y[1]),g(m(L,P),C[1]))),-I[2]))),-b[3])),p(g(p(p(g(p(g(m(Ae,te),y[1]),p(g(m(de,O),-C[1]),g(m(re,V),b[1]))),f[2]),g(p(g(m(Ae,te),f[1]),p(g(m(ue,T),-C[1]),g(m(ne,B),b[1]))),-y[2])),p(g(p(g(m(de,O),f[1]),p(g(m(ue,T),-y[1]),g(m(L,P),b[1]))),C[2]),g(p(g(m(re,V),f[1]),p(g(m(ne,B),-y[1]),g(m(L,P),C[1]))),-b[2]))),I[3]),g(p(p(g(p(g(m(ye,ie),x[1]),p(g(m(_e,ee),-C[1]),g(m(Z,K),I[1]))),y[2]),g(p(g(m(ye,ie),y[1]),p(g(m(we,U),-C[1]),g(m(re,V),I[1]))),-x[2])),p(g(p(g(m(_e,ee),y[1]),p(g(m(we,U),-x[1]),g(m(X,H),I[1]))),C[2]),g(p(g(m(Z,K),y[1]),p(g(m(re,V),-x[1]),g(m(X,H),C[1]))),-I[2]))),f[3]))),p(p(g(p(p(g(p(g(m(ye,ie),x[1]),p(g(m(_e,ee),-C[1]),g(m(Z,K),I[1]))),f[2]),g(p(g(m(ye,ie),f[1]),p(g(m(Re,N),-C[1]),g(m(ne,B),I[1]))),-x[2])),p(g(p(g(m(_e,ee),f[1]),p(g(m(Re,N),-x[1]),g(m(Y,M),I[1]))),C[2]),g(p(g(m(Z,K),f[1]),p(g(m(ne,B),-x[1]),g(m(Y,M),C[1]))),-I[2]))),-y[3]),g(p(p(g(p(g(m(ye,ie),y[1]),p(g(m(we,U),-C[1]),g(m(re,V),I[1]))),f[2]),g(p(g(m(ye,ie),f[1]),p(g(m(Re,N),-C[1]),g(m(ne,B),I[1]))),-y[2])),p(g(p(g(m(we,U),f[1]),p(g(m(Re,N),-y[1]),g(m(L,P),I[1]))),C[2]),g(p(g(m(re,V),f[1]),p(g(m(ne,B),-y[1]),g(m(L,P),C[1]))),-I[2]))),x[3])),p(g(p(p(g(p(g(m(_e,ee),y[1]),p(g(m(we,U),-x[1]),g(m(X,H),I[1]))),f[2]),g(p(g(m(_e,ee),f[1]),p(g(m(Re,N),-x[1]),g(m(Y,M),I[1]))),-y[2])),p(g(p(g(m(we,U),f[1]),p(g(m(Re,N),-y[1]),g(m(L,P),I[1]))),x[2]),g(p(g(m(X,H),f[1]),p(g(m(Y,M),-y[1]),g(m(L,P),x[1]))),-I[2]))),-C[3]),g(p(p(g(p(g(m(Z,K),y[1]),p(g(m(re,V),-x[1]),g(m(X,H),C[1]))),f[2]),g(p(g(m(Z,K),f[1]),p(g(m(ne,B),-x[1]),g(m(Y,M),C[1]))),-y[2])),p(g(p(g(m(re,V),f[1]),p(g(m(ne,B),-y[1]),g(m(L,P),C[1]))),x[2]),g(p(g(m(X,H),f[1]),p(g(m(Y,M),-y[1]),g(m(L,P),x[1]))),-C[2]))),I[3]))))),ke=p(p(p(g(p(p(g(p(g(m(Se,xe),C[1]),p(g(m(ye,ie),-b[1]),g(m(Ae,te),I[1]))),x[2]),g(p(g(m(Se,xe),x[1]),p(g(m(_e,ee),-b[1]),g(m(me,J),I[1]))),-C[2])),p(g(p(g(m(ye,ie),x[1]),p(g(m(_e,ee),-C[1]),g(m(Z,K),I[1]))),b[2]),g(p(g(m(Ae,te),x[1]),p(g(m(me,J),-C[1]),g(m(Z,K),b[1]))),-I[2]))),f[3]),p(g(p(p(g(p(g(m(Se,xe),C[1]),p(g(m(ye,ie),-b[1]),g(m(Ae,te),I[1]))),f[2]),g(p(g(m(Se,xe),f[1]),p(g(m(Re,N),-b[1]),g(m(ue,T),I[1]))),-C[2])),p(g(p(g(m(ye,ie),f[1]),p(g(m(Re,N),-C[1]),g(m(ne,B),I[1]))),b[2]),g(p(g(m(Ae,te),f[1]),p(g(m(ue,T),-C[1]),g(m(ne,B),b[1]))),-I[2]))),-x[3]),g(p(p(g(p(g(m(Se,xe),x[1]),p(g(m(_e,ee),-b[1]),g(m(me,J),I[1]))),f[2]),g(p(g(m(Se,xe),f[1]),p(g(m(Re,N),-b[1]),g(m(ue,T),I[1]))),-x[2])),p(g(p(g(m(_e,ee),f[1]),p(g(m(Re,N),-x[1]),g(m(Y,M),I[1]))),b[2]),g(p(g(m(me,J),f[1]),p(g(m(ue,T),-x[1]),g(m(Y,M),b[1]))),-I[2]))),C[3]))),p(p(g(p(p(g(p(g(m(ye,ie),x[1]),p(g(m(_e,ee),-C[1]),g(m(Z,K),I[1]))),f[2]),g(p(g(m(ye,ie),f[1]),p(g(m(Re,N),-C[1]),g(m(ne,B),I[1]))),-x[2])),p(g(p(g(m(_e,ee),f[1]),p(g(m(Re,N),-x[1]),g(m(Y,M),I[1]))),C[2]),g(p(g(m(Z,K),f[1]),p(g(m(ne,B),-x[1]),g(m(Y,M),C[1]))),-I[2]))),-b[3]),g(p(p(g(p(g(m(Ae,te),x[1]),p(g(m(me,J),-C[1]),g(m(Z,K),b[1]))),f[2]),g(p(g(m(Ae,te),f[1]),p(g(m(ue,T),-C[1]),g(m(ne,B),b[1]))),-x[2])),p(g(p(g(m(me,J),f[1]),p(g(m(ue,T),-x[1]),g(m(Y,M),b[1]))),C[2]),g(p(g(m(Z,K),f[1]),p(g(m(ne,B),-x[1]),g(m(Y,M),C[1]))),-b[2]))),I[3])),p(g(p(p(g(p(g(m(Se,xe),x[1]),p(g(m(_e,ee),-b[1]),g(m(me,J),I[1]))),y[2]),g(p(g(m(Se,xe),y[1]),p(g(m(we,U),-b[1]),g(m(de,O),I[1]))),-x[2])),p(g(p(g(m(_e,ee),y[1]),p(g(m(we,U),-x[1]),g(m(X,H),I[1]))),b[2]),g(p(g(m(me,J),y[1]),p(g(m(de,O),-x[1]),g(m(X,H),b[1]))),-I[2]))),f[3]),g(p(p(g(p(g(m(Se,xe),x[1]),p(g(m(_e,ee),-b[1]),g(m(me,J),I[1]))),f[2]),g(p(g(m(Se,xe),f[1]),p(g(m(Re,N),-b[1]),g(m(ue,T),I[1]))),-x[2])),p(g(p(g(m(_e,ee),f[1]),p(g(m(Re,N),-x[1]),g(m(Y,M),I[1]))),b[2]),g(p(g(m(me,J),f[1]),p(g(m(ue,T),-x[1]),g(m(Y,M),b[1]))),-I[2]))),-y[3])))),p(p(p(g(p(p(g(p(g(m(Se,xe),y[1]),p(g(m(we,U),-b[1]),g(m(de,O),I[1]))),f[2]),g(p(g(m(Se,xe),f[1]),p(g(m(Re,N),-b[1]),g(m(ue,T),I[1]))),-y[2])),p(g(p(g(m(we,U),f[1]),p(g(m(Re,N),-y[1]),g(m(L,P),I[1]))),b[2]),g(p(g(m(de,O),f[1]),p(g(m(ue,T),-y[1]),g(m(L,P),b[1]))),-I[2]))),x[3]),g(p(p(g(p(g(m(_e,ee),y[1]),p(g(m(we,U),-x[1]),g(m(X,H),I[1]))),f[2]),g(p(g(m(_e,ee),f[1]),p(g(m(Re,N),-x[1]),g(m(Y,M),I[1]))),-y[2])),p(g(p(g(m(we,U),f[1]),p(g(m(Re,N),-y[1]),g(m(L,P),I[1]))),x[2]),g(p(g(m(X,H),f[1]),p(g(m(Y,M),-y[1]),g(m(L,P),x[1]))),-I[2]))),-b[3])),p(g(p(p(g(p(g(m(me,J),y[1]),p(g(m(de,O),-x[1]),g(m(X,H),b[1]))),f[2]),g(p(g(m(me,J),f[1]),p(g(m(ue,T),-x[1]),g(m(Y,M),b[1]))),-y[2])),p(g(p(g(m(de,O),f[1]),p(g(m(ue,T),-y[1]),g(m(L,P),b[1]))),x[2]),g(p(g(m(X,H),f[1]),p(g(m(Y,M),-y[1]),g(m(L,P),x[1]))),-b[2]))),I[3]),g(p(p(g(p(g(m(Ae,te),x[1]),p(g(m(me,J),-C[1]),g(m(Z,K),b[1]))),y[2]),g(p(g(m(Ae,te),y[1]),p(g(m(de,O),-C[1]),g(m(re,V),b[1]))),-x[2])),p(g(p(g(m(me,J),y[1]),p(g(m(de,O),-x[1]),g(m(X,H),b[1]))),C[2]),g(p(g(m(Z,K),y[1]),p(g(m(re,V),-x[1]),g(m(X,H),C[1]))),-b[2]))),f[3]))),p(p(g(p(p(g(p(g(m(Ae,te),x[1]),p(g(m(me,J),-C[1]),g(m(Z,K),b[1]))),f[2]),g(p(g(m(Ae,te),f[1]),p(g(m(ue,T),-C[1]),g(m(ne,B),b[1]))),-x[2])),p(g(p(g(m(me,J),f[1]),p(g(m(ue,T),-x[1]),g(m(Y,M),b[1]))),C[2]),g(p(g(m(Z,K),f[1]),p(g(m(ne,B),-x[1]),g(m(Y,M),C[1]))),-b[2]))),-y[3]),g(p(p(g(p(g(m(Ae,te),y[1]),p(g(m(de,O),-C[1]),g(m(re,V),b[1]))),f[2]),g(p(g(m(Ae,te),f[1]),p(g(m(ue,T),-C[1]),g(m(ne,B),b[1]))),-y[2])),p(g(p(g(m(de,O),f[1]),p(g(m(ue,T),-y[1]),g(m(L,P),b[1]))),C[2]),g(p(g(m(re,V),f[1]),p(g(m(ne,B),-y[1]),g(m(L,P),C[1]))),-b[2]))),x[3])),p(g(p(p(g(p(g(m(me,J),y[1]),p(g(m(de,O),-x[1]),g(m(X,H),b[1]))),f[2]),g(p(g(m(me,J),f[1]),p(g(m(ue,T),-x[1]),g(m(Y,M),b[1]))),-y[2])),p(g(p(g(m(de,O),f[1]),p(g(m(ue,T),-y[1]),g(m(L,P),b[1]))),x[2]),g(p(g(m(X,H),f[1]),p(g(m(Y,M),-y[1]),g(m(L,P),x[1]))),-b[2]))),-C[3]),g(p(p(g(p(g(m(Z,K),y[1]),p(g(m(re,V),-x[1]),g(m(X,H),C[1]))),f[2]),g(p(g(m(Z,K),f[1]),p(g(m(ne,B),-x[1]),g(m(Y,M),C[1]))),-y[2])),p(g(p(g(m(re,V),f[1]),p(g(m(ne,B),-y[1]),g(m(L,P),C[1]))),x[2]),g(p(g(m(X,H),f[1]),p(g(m(Y,M),-y[1]),g(m(L,P),x[1]))),-C[2]))),b[3]))))),nt=m(Ne,ke);return nt[nt.length-1]}}var d=[function(){return 0},function(){return 0},function(){return 0}];function u(p){var m=d[p.length];return m||(m=d[p.length]=s(p.length)),m.apply(void 0,p)}function _(p,m,A,g,f,y,x,C){return function(b,I,v,P,M,B){switch(arguments.length){case 0:case 1:return 0;case 2:return g(b,I);case 3:return f(b,I,v);case 4:return y(b,I,v,P);case 5:return x(b,I,v,P,M);case 6:return C(b,I,v,P,M,B)}for(var T=Array(arguments.length),N=0;N<arguments.length;++N)T[N]=arguments[N];return p(T)}}(function(){for(;d.length<=6;)d.push(s(d.length));t.exports=_.apply(void 0,[u].concat(d));for(var p=0;p<=6;++p)t.exports[p]=d[p]})()}}),$Kr=eC({"node_modules/cdt2d/lib/delaunay.js"(e,t){var n=KKr()[4];Z8e();function o(r,i,s,a,c,l){var h=i.opposite(a,c);if(!(h<0)){if(c<a){var d=a;a=c,c=d,d=l,l=h,h=d}i.isConstraint(a,c)||n(r[a],r[c],r[l],r[h])<0&&s.push(a,c)}}t.exports=function(r,i){for(var s=[],a=r.length,c=i.stars,l=0;l<a;++l)for(var h=c[l],d=1;d<h.length;d+=2)if(!((m=h[d])<l)&&!i.isConstraint(l,m)){for(var u=h[d-1],_=-1,p=1;p<h.length;p+=2)if(h[p-1]===m){_=h[p];break}_<0||n(r[l],r[m],r[u],r[_])<0&&s.push(l,m)}for(;s.length>0;){for(var m=s.pop(),A=(u=-1,_=-1,h=c[l=s.pop()],1);A<h.length;A+=2){var g=h[A-1],f=h[A];g===m?_=f:f===m&&(u=g)}u<0||_<0||(n(r[l],r[m],r[u],r[_])>=0||(i.flip(l,m),o(r,i,s,u,l,_),o(r,i,s,l,_,u),o(r,i,s,_,m,u),o(r,i,s,m,u,_)))}}}}),qKr=eC({"node_modules/cdt2d/lib/filter.js"(e,t){var n=Z8e();function o(i,s,a,c,l,h,d){this.cells=i,this.neighbor=s,this.flags=c,this.constraint=a,this.active=l,this.next=h,this.boundary=d}function r(i,s){return i[0]-s[0]||i[1]-s[1]||i[2]-s[2]}t.exports=function(i,s,a){var c=function(C,b){for(var I=C.cells(),v=I.length,P=0;P<v;++P){var M=(j=I[P])[0],B=j[1],T=j[2];B<T?B<M&&(j[0]=B,j[1]=T,j[2]=M):T<M&&(j[0]=T,j[1]=M,j[2]=B)}I.sort(r);var N=Array(v);for(P=0;P<N.length;++P)N[P]=0;var D=[],L=[],H=Array(3*v),V=Array(3*v),O=null;b&&(O=[]);var U=new o(I,H,V,N,D,L,O);for(P=0;P<v;++P)for(var j=I[P],Y=0;Y<3;++Y){M=j[Y],B=j[(Y+1)%3];var X=H[3*P+Y]=U.locate(B,M,C.opposite(B,M)),K=V[3*P+Y]=C.isConstraint(M,B);X<0&&(K?L.push(P):(D.push(P),N[P]=1),b&&O.push([B,M,-1]))}return U}(i,a);if(s===0)return a?c.cells.concat(c.boundary):c.cells;var l=1,{active:h,next:d,flags:u,cells:_,constraint:p,neighbor:m}=c;for(;h.length>0||d.length>0;){for(;h.length>0;){var A=h.pop();if(u[A]!==-l){u[A]=l,_[A];for(var g=0;g<3;++g){var f=m[3*A+g];f>=0&&u[f]===0&&(p[3*A+g]?d.push(f):(h.push(f),u[f]=l))}}}var y=d;d=h,h=y,d.length=0,l=-l}var x=function(C,b,I){for(var v=0,P=0;P<C.length;++P)b[P]===I&&(C[v++]=C[P]);return C.length=v,C}(_,u,s);if(a)return x.concat(c.boundary);return x},o.prototype.locate=function(){var i=[0,0,0];return function(s,a,c){var l=s,h=a,d=c;return a<c?a<s&&(l=a,h=c,d=s):c<s&&(l=c,h=s,d=a),l<0?-1:(i[0]=l,i[1]=h,i[2]=d,n.eq(this.cells,i,r))}}()}}),JKr=eC({"node_modules/cdt2d/cdt2d.js"(e,t){var n=XKr(),o=jKr(),r=$Kr(),i=qKr();function s(l){return[Math.min(l[0],l[1]),Math.max(l[0],l[1])]}function a(l,h){return l[0]-h[0]||l[1]-h[1]}function c(l,h,d){return h in l?l[h]:d}t.exports=function(l,h,d){Array.isArray(h)?(d=d||{},h=h||[]):(d=h||{},h=[]);var u=!!c(d,"delaunay",!0),_=!!c(d,"interior",!0),p=!!c(d,"exterior",!0),m=!!c(d,"infinity",!1);if(!_&&!p||l.length===0)return[];var A=n(l,h);if(u||_!==p||m){for(var g=o(l.length,function(x){return x.map(s).sort(a)}(h)),f=0;f<A.length;++f){var y=A[f];g.addTriangle(y[0],y[1],y[2])}return u&&r(l,g),p?_?m?i(g,0,m):g.cells():i(g,1,m):i(g,-1)}return A}}}),{cos:Era,sin:Mra,PI:wra}=Math,{tan:Bra}=Math,Rbn=!0,Gde={CCW:-1,CW:1,NOT_ORIENTABLE:0},ZKr=2*Math.PI,jve=Object.freeze({__proto__:null,BOUNDARY:2,CCW:Rbn,CONTAINS:3,CW:!1,END_VERTEX:2,INSIDE:1,INTERLACE:4,NOT_VERTEX:0,ORIENTATION:Gde,OUTSIDE:0,OVERLAP_OPPOSITE:2,OVERLAP_SAME:1,PIx2:ZKr,START_VERTEX:1}),zP=0.000001;function Qbn(e){zP=e}function kbn(){return zP}function _it(e){return e<zP&&e>-zP}function gG(e,t){return e-t<zP&&e-t>-zP}function Lbn(e,t){return e-t>zP}function Hbn(e,t){return e-t<-zP}var Ue={Utils:Object.freeze({__proto__:null,DECIMALS:3,EQ:gG,EQ_0:_it,GE:function(e,t){return e-t>-zP},GT:Lbn,LE:function(e,t){return e-t<zP},LT:Hbn,getTolerance:kbn,setTolerance:Qbn}),Errors:void 0,Matrix:void 0,Planar_set:void 0,Point:void 0,Vector:void 0,Line:void 0,Circle:void 0,Segment:void 0,Arc:void 0,Box:void 0,Edge:void 0,Face:void 0,Ray:void 0,Ray_shooting:void 0,Multiline:void 0,Polygon:void 0,Distance:void 0,Inversion:void 0};for(let e in jve)Ue[e]=jve[e];Object.defineProperty(Ue,"DP_TOL",{get:function(){return kbn()},set:function(e){Qbn(e)}});var E0=class{static get ILLEGAL_PARAMETERS(){return ReferenceError("Illegal Parameters")}static get ZERO_DIVISION(){return Error("Zero division")}static get UNRESOLVED_BOUNDARY_CONFLICT(){return Error("Unresolved boundary conflict in boolean operation")}static get INFINITE_LOOP(){return Error("Infinite loop")}static get CANNOT_COMPLETE_BOOLEAN_OPERATION(){return Error("Cannot complete boolean operation")}static get CANNOT_INVOKE_ABSTRACT_METHOD(){return Error("Abstract method cannot be invoked")}static get OPERATION_IS_NOT_SUPPORTED(){return Error("Operation is not supported")}static get UNSUPPORTED_SHAPE_TYPE(){return Error("Unsupported shape type")}};Ue.Errors=E0;var Aat=class{constructor(e,t){this.first=e,this.last=t||this.first}[Symbol.iterator](){let e;return{next:()=>(e=e?e.next:this.first,{value:e,done:e===void 0})}}get size(){let e=0;for(let t of this)e++;return e}toArray(e=void 0,t=void 0){let n=[],o=e||this.first,r=t||this.last,i=o;if(i===void 0)return n;do n.push(i),i=i.next;while(i!==r.next);return n}append(e){return this.isEmpty()?this.first=e:(e.prev=this.last,this.last.next=e),this.last=e,this.last.next=void 0,this.first.prev=void 0,this}insert(e,t){if(this.isEmpty())this.first=e,this.last=e;else if(t==null)e.next=this.first,this.first.prev=e,this.first=e;else{let n=t.next;t.next=e,n&&(n.prev=e),e.prev=t,e.next=n,this.last===t&&(this.last=e)}return this.last.next=void 0,this.first.prev=void 0,this}remove(e){return e===this.first&&e===this.last?(this.first=void 0,this.last=void 0):(e.prev&&(e.prev.next=e.next),e.next&&(e.next.prev=e.prev),e===this.first&&(this.first=e.next),e===this.last&&(this.last=e.prev)),this}isEmpty(){return this.first===void 0}static testInfiniteLoop(e){let t=e,n=e;do{if(t!=e&&t===n)throw E0.INFINITE_LOOP;t=t.next,n=n.next.next}while(t!=e)}},Q2n={stroke:"black"},e$r=class{constructor(e=Q2n){for(let t in e)this[t]=e[t];this.stroke=e.stroke??Q2n.stroke}toAttributesString(){return Object.keys(this).reduce((e,t)=>e+(this[t]!==void 0?this.toAttrString(t,this[t]):""),"")}toAttrString(e,t){let n=e==="className"?"class":this.convertCamelToKebabCase(e);return t===null?`${n} `:`${n}="${t.toString()}" `}convertCamelToKebabCase(e){return e.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g).join("-").toLowerCase()}};function BG(e){return new e$r(e).toAttributesString()}function WZ(e,t){let n=[],[o,r,i]=e.standard,[s,a,c]=t.standard,l=o*a-r*s,h=i*a-r*c,d=o*c-i*s;if(!Ue.Utils.EQ_0(l)){let u,_;r===0?(u=i/o,_=d/l):a===0?(u=c/s,_=d/l):o===0?(u=h/l,_=i/r):s===0?(u=h/l,_=c/a):(u=h/l,_=d/l),n.push(new Ue.Point(u,_))}return n}function TG(e,t){let n=[],o=t.pc.projectionOn(e),r=t.pc.distanceTo(o)[0];if(Ue.Utils.EQ(r,t.r))n.push(o);else if(Ue.Utils.LT(r,t.r)){let i,s,a=Math.sqrt(t.r*t.r-r*r);i=e.norm.rotate90CCW().multiply(a),s=o.translate(i),n.push(s),i=e.norm.rotate90CW().multiply(a),s=o.translate(i),n.push(s)}return n}function xZ(e,t){let n=[];for(let o of t.toSegments()){let r=r0e(o,e);for(let i of r)Wbn(i,n)||n.push(i)}return n}function e7e(e,t){let n=[];if(xZ(e,t.box).length===0)return n;let o=TG(e,new Ue.Circle(t.pc,t.r));for(let r of o)r.on(t)&&n.push(r);return n}function r0e(e,t){let n=[];return e.ps.on(t)&&n.push(e.ps),e.pe.on(t)&&!e.isZeroLength()&&n.push(e.pe),n.length>0||e.isZeroLength()||e.ps.leftTo(t)&&e.pe.leftTo(t)||!e.ps.leftTo(t)&&!e.pe.leftTo(t)?n:WZ(new Ue.Line(e.ps,e.pe),t)}function Kve(e,t){let n=[];if(e.isZeroLength())return e.ps.on(t)&&n.push(e.ps),n;if(t.isZeroLength())return t.ps.on(e)&&n.push(t.ps),n;let o=new Ue.Line(e.ps,e.pe),r=new Ue.Line(t.ps,t.pe);if(o.incidentTo(r))e.ps.on(t)&&n.push(e.ps),e.pe.on(t)&&n.push(e.pe),!t.ps.on(e)||t.ps.equalTo(e.ps)||t.ps.equalTo(e.pe)||n.push(t.ps),!t.pe.on(e)||t.pe.equalTo(e.ps)||t.pe.equalTo(e.pe)||n.push(t.pe);else{let i=WZ(o,r);i.length>0&&k2n(i[0],e)&&k2n(i[0],t)&&n.push(i[0])}return n}function k2n(e,t){let n=t.box;return Ue.Utils.LE(e.x,n.xmax)&&Ue.Utils.GE(e.x,n.xmin)&&Ue.Utils.LE(e.y,n.ymax)&&Ue.Utils.GE(e.y,n.ymin)}function $ve(e,t){let n=[];if(e.isZeroLength()){let[r,i]=e.ps.distanceTo(t.pc);return Ue.Utils.EQ(r,t.r)&&n.push(e.ps),n}let o=TG(new Ue.Line(e.ps,e.pe),t);for(let r of o)r.on(e)&&n.push(r);return n}function CZ(e,t){let n=[];if(e.isZeroLength())return e.ps.on(t)&&n.push(e.ps),n;let o=TG(new Ue.Line(e.ps,e.pe),new Ue.Circle(t.pc,t.r));for(let r of o)r.on(e)&&r.on(t)&&n.push(r);return n}function Fbn(e,t){let n=[],o=new Ue.Vector(e.pc,t.pc),r=e.r,i=t.r;if(Ue.Utils.EQ_0(r)||Ue.Utils.EQ_0(i))return n;if(Ue.Utils.EQ_0(o.x)&&Ue.Utils.EQ_0(o.y)&&Ue.Utils.EQ(r,i))return n.push(e.pc.translate(-r,0)),n;let s,a=e.pc.distanceTo(t.pc)[0];if(Ue.Utils.GT(a,r+i))return n;if(Ue.Utils.LT(a,Math.abs(r-i)))return n;if(o.x/=a,o.y/=a,Ue.Utils.EQ(a,r+i)||Ue.Utils.EQ(a,Math.abs(r-i)))return s=e.pc.translate(r*o.x,r*o.y),n.push(s),n;let c=r*r/(2*a)-i*i/(2*a)+a/2,l=e.pc.translate(c*o.x,c*o.y),h=Math.sqrt(r*r-c*c);return s=l.translate(o.rotate90CCW().multiply(h)),n.push(s),s=l.translate(o.rotate90CW().multiply(h)),n.push(s),n}function zbn(e,t){let n=[];if(e.pc.equalTo(t.pc)&&Ue.Utils.EQ(e.r,t.r)){let s;return s=e.start,s.on(t)&&n.push(s),s=e.end,s.on(t)&&n.push(s),s=t.start,s.on(e)&&n.push(s),s=t.end,s.on(e)&&n.push(s),n}let o=new Ue.Circle(e.pc,e.r),r=new Ue.Circle(t.pc,t.r),i=o.intersect(r);for(let s of i)s.on(e)&&s.on(t)&&n.push(s);return n}function fat(e,t){let n=[];if(t.pc.equalTo(e.pc)&&Ue.Utils.EQ(t.r,e.r))return n.push(e.start),n.push(e.end),n;let o=Fbn(t,new Ue.Circle(e.pc,e.r));for(let r of o)r.on(e)&&n.push(r);return n}function Obn(e,t){return e.isSegment?Kve(e.shape,t):CZ(t,e.shape)}function Vbn(e,t){return e.isSegment?CZ(e.shape,t):zbn(e.shape,t)}function Ybn(e,t){return e.isSegment?r0e(e.shape,t):e7e(t,e.shape)}function t$r(e,t){return e.isSegment?$ve(e.shape,t):fat(e.shape,t)}function yat(e,t){let n=[];for(let o of t.edges)for(let r of Obn(o,e))n.push(r);return n}function xat(e,t){let n=[];for(let o of t.edges)for(let r of Vbn(o,e))n.push(r);return n}function i0e(e,t){let n=[];if(t.isEmpty())return n;for(let o of t.edges)for(let r of Ybn(o,e))Wbn(r,n)||n.push(r);return e.sortPoints(n)}function Gbn(e,t){let n=[];if(t.isEmpty())return n;for(let o of t.edges)for(let r of t$r(o,e))n.push(r);return n}function Ubn(e,t){return e.isSegment?Obn(t,e.shape):e.isArc?Vbn(t,e.shape):e.isLine?Ybn(t,e.shape):e.isRay?(n=t,o=e.shape,n.isSegment?Cat(o,n.shape):bat(o,n.shape)):[];var n,o}function L2n(e,t){let n=[];if(t.isEmpty()||e.shape.box.not_intersect(t.box))return n;let o=t.edges.search(e.shape.box);for(let r of o)n=[...n,...Ubn(e,r)];return n}function Wbn(e,t){return t.some((n)=>n.equalTo(e))}function aL(e){return new Ue.Line(e.start,e.norm)}function Cat(e,t){return r0e(t,aL(e)).filter((n)=>e.contains(n))}function bat(e,t){return e7e(aL(e),t).filter((n)=>e.contains(n))}function Xbn(e,t){return TG(aL(e),t).filter((n)=>e.contains(n))}function jbn(e,t){return WZ(aL(e),t).filter((n)=>e.contains(n))}function Kbn(e,t){return i0e(aL(e),t).filter((n)=>e.contains(n))}function $bn(e,t){if(e.intersect&&e.intersect instanceof Function)return e.intersect(t);throw E0.UNSUPPORTED_SHAPE_TYPE}function XZ(e,t){let n=[];for(let o of t)n=[...n,...$bn(e,o.shape)];return n}var cG=class e extends Aat{constructor(...t){if(super(),this.isInfinite=!1,t.length===1&&t[0]instanceof Array&&t[0].length>0){let n=t[0],o=n.length,r=(s)=>s instanceof Ue.Segment||s instanceof Ue.Arc||s instanceof Ue.Ray,i=(s)=>s instanceof Ue.Segment||s instanceof Ue.Arc;if(!(o===1&&((s)=>s instanceof Ue.Segment||s instanceof Ue.Arc||s instanceof Ue.Ray||s instanceof Ue.Line)(n[0])||o>1&&r(n[0])&&r(n[o-1])&&n.slice(1,o-1).every(i)))throw Ue.Errors.ILLEGAL_PARAMETERS;this.isInfinite=n.some((s)=>s instanceof Ue.Ray||s instanceof Ue.Line);for(let s of n){let a=new Ue.Edge(s);this.append(a)}this.setArcLength()}}get edges(){return[...this]}get box(){return this.edges.reduce((t,n)=>t.merge(n.box),new Ue.Box)}get vertices(){let t=this.edges.map((n)=>n.start);return t.push(this.last.end),t}get length(){if(this.isEmpty())return 0;if(this.isInfinite)return Number.POSITIVE_INFINITY;let t=0;for(let n of this)t+=n.length;return t}clone(){return new e(this.toShapes())}setArcLength(){for(let t of this)this.setOneEdgeArcLength(t)}setOneEdgeArcLength(t){t===this.first?t.arc_length=0:t.arc_length=t.prev.arc_length+t.prev.length}pointAtLength(t){if(t>this.length||t<0)return null;if(this.isInfinite)return null;let n=null;for(let o of this)if(t>=o.arc_length&&(o===this.last||t<o.next.arc_length)){n=o.pointAtLength(t-o.arc_length);break}return n}addVertex(t,n){let o=n.shape.split(t);if(o[0]===null)return n.prev;if(o[1]===null)return n;let r=new Ue.Edge(o[0]),i=n.prev;return this.insert(r,i),n.shape=o[1],r}getChain(t,n){let o=[];for(let r=t;r!==n.next;r=r.next)o.push(r);return o}split(t){for(let n of t){let o=this.findEdgeByPoint(n);this.addVertex(n,o)}return this}findEdgeByPoint(t){let n;for(let o of this)if(o.shape.contains(t)){n=o;break}return n}distanceTo(t){if(t instanceof Point){let[n,o]=Ue.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof Ue.Line){let[n,o]=Ue.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof Ue.Circle){let[n,o]=Ue.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof Ue.Segment){let[n,o]=Ue.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof Ue.Arc){let[n,o]=Ue.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof Ue.Multiline)return Ue.Distance.multiline2multiline(this,t);throw Ue.Errors.UNSUPPORTED_SHAPE_TYPE}intersect(t){return t instanceof Ue.Multiline?function(n,o){let r=[];for(let i of n)for(let s of o)r=[...r,...$bn(i.shape,s.shape)];return r}(this,t):XZ(t,this)}contains(t){if(t instanceof Ue.Point)return this.edges.some((n)=>n.shape.contains(t));throw Ue.Errors.UNSUPPORTED_SHAPE_TYPE}translate(t){return new e(this.edges.map((n)=>n.shape.translate(t)))}rotate(t=0,n=new Ue.Point){return new e(this.edges.map((o)=>o.shape.rotate(t,n)))}transform(t=new Ue.Matrix){return new e(this.edges.map((n)=>n.shape.transform(t)))}toShapes(){return this.edges.map((t)=>t.shape.clone())}toJSON(){return this.edges.map((t)=>t.toJSON())}svgPoints(){return this.vertices.map((t)=>`${t.x},${t.y}`).join(" ")}dpath(){let t=`M${this.first.start.x},${this.first.start.y}`;for(let n of this)t+=n.svg();return t}svg(t={}){let n=`
<path ${BG({fill:"none",...t})} d="`;n+=`
M${this.first.start.x},${this.first.start.y}`;for(let o of this)n+=o.svg();return n+=`" >
</path>`,n}};Ue.Multiline=cG;function bZ(e,t,n){let o=n.length,r=e.shape.split(t);if(r.length===0)return;let i=0;i=r[0]===null?0:r[1]===null?e.shape.length:r[0].length;let s,a=0;gG(i,0)&&(a|=1),gG(i,e.shape.length)&&(a|=2),s=i===1/0?r[0].coord(t):2&a&&e.next&&e.next.arc_length===0?0:e.arc_length+i,n.push({id:o,pt:t,arc_length:s,edge_before:e,edge_after:void 0,face:e.face,is_vertex:a})}function mue(e){e.int_points1_sorted=Gk(e.int_points1),e.int_points2_sorted=Gk(e.int_points2)}function Gk(e){let t=new Map,n=0;for(let o of e)t.has(o.face)||(t.set(o.face,n),n++);for(let o of e)o.faceId=t.get(o.face);return e.slice().sort(n$r)}function n$r(e,t){return e.faceId<t.faceId?-1:e.faceId>t.faceId?1:e.arc_length<t.arc_length?-1:e.arc_length>t.arc_length?1:0}function Iat(e){if(e.int_points1.length<2)return;let t,n,o,r,i=!1;for(let s=0;s<e.int_points1_sorted.length;s++)if(e.int_points1_sorted[s].id!==-1){t=e.int_points1_sorted[s],n=e.int_points2[t.id];for(let a=s+1;a<e.int_points1_sorted.length&&(o=e.int_points1_sorted[a],gG(o.arc_length,t.arc_length));a++)o.id!==-1&&(r=e.int_points2[o.id],r.id!==-1&&o.edge_before===t.edge_before&&o.edge_after===t.edge_after&&r.edge_before===n.edge_before&&r.edge_after===n.edge_after&&(o.id=-1,r.id=-1,i=!0))}n=e.int_points2_sorted[0],t=e.int_points1[n.id];for(let s=1;s<e.int_points2_sorted.length;s++){let a=e.int_points2_sorted[s];if(a.id===-1)continue;if(n.id===-1||!gG(a.arc_length,n.arc_length)){n=a,t=e.int_points1[n.id];continue}let c=e.int_points1[a.id];c.edge_before===t.edge_before&&c.edge_after===t.edge_after&&a.edge_before===n.edge_before&&a.edge_after===n.edge_after&&(c.id=-1,a.id=-1,i=!0)}i&&(e.int_points1=e.int_points1.filter((s)=>s.id>=0),e.int_points2=e.int_points2.filter((s)=>s.id>=0),e.int_points1.forEach((s,a)=>s.id=a),e.int_points2.forEach((s,a)=>s.id=a))}function git(e){for(let t of e)t.edge_before&&(t.edge_before.bvStart=void 0,t.edge_before.bvEnd=void 0,t.edge_before.bv=void 0,t.edge_before.overlap=void 0),t.edge_after&&(t.edge_after.bvStart=void 0,t.edge_after.bvEnd=void 0,t.edge_after.bv=void 0,t.edge_after.overlap=void 0);for(let t of e)t.edge_before&&(t.edge_before.bvEnd=2),t.edge_after&&(t.edge_after.bvStart=2)}function Ait(e,t){for(let n of e)n.edge_before&&n.edge_before.setInclusion(t),n.edge_after&&n.edge_after.setInclusion(t)}function IZ(e,t,n){let o,r,i=1;if(e.length===1)return 1;o=e[t];for(let s=t+1;s<e.length&&o.face===n&&(r=e[s],r.pt.equalTo(o.pt)&&r.edge_before===o.edge_before&&r.edge_after===o.edge_after);s++)i++;return i}function vZ(e,t){if(t){for(let n of t){let o=n.edge_before;if(n.is_vertex=0,o.shape.start&&o.shape.start.equalTo(n.pt)&&(n.is_vertex|=1),o.shape.end&&o.shape.end.equalTo(n.pt)&&(n.is_vertex|=2),1&n.is_vertex){n.edge_before=o.prev,o.prev&&(n.is_vertex=2);continue}if(2&n.is_vertex)continue;let r=e.addVertex(n.pt,o);n.edge_before=r}for(let n of t)n.edge_before?n.edge_after=n.edge_before.next:e instanceof cG&&1&n.is_vertex&&(n.edge_after=e.first)}}function H2n(e,t,n){let o=e.edge_before,r=t.edge_after,i=n.length;o.next=n[0],n[0].prev=o,n[i-1].next=r,r.prev=n[i-1]}Ue.multiline=(...e)=>new Ue.Multiline(...e);var{INSIDE:IP,OUTSIDE:vP,BOUNDARY:of,OVERLAP_SAME:o$r,OVERLAP_OPPOSITE:r$r}=jve,{NOT_VERTEX:Tra,START_VERTEX:F2n,END_VERTEX:z2n}=jve;function fit(e,t){let n=t.clone().reverse(),[o,r]=s0e(e,n,3,!0);return o}function qbn(e,t){let[n,o]=s0e(e,t,2,!0);return n}function Jbn(e,t){let[n,o]=s0e(e,t,2,!1),r=[];for(let s of n.faces)r=[...r,...[...s.edges].map((a)=>a.shape)];let i=[];for(let s of o.faces)i=[...i,...[...s.edges].map((a)=>a.shape)];return[r,i]}function yit(e,t){let[n,o]=s0e(e,t,3,!1),r=[];for(let i of n.faces)r=[...r,...[...i.edges].map((s)=>s.shape)];return r}function Zbn(e,t){let n=e.clone(),o=t.clone(),r=e6n(n,o);return mue(r),vZ(n,r.int_points1_sorted),vZ(o,r.int_points2_sorted),Iat(r),mue(r),[r.int_points1_sorted.map((i)=>i.pt),r.int_points2_sorted.map((i)=>i.pt)]}function i$r(e,t,n,o){let r=O2n(e,n.int_points1),i=O2n(t,n.int_points2);for(V2n(r,t),V2n(i,e),git(n.int_points1),git(n.int_points2),Ait(n.int_points1,t),Ait(n.int_points2,e);s$r(e,t,n.int_points1,n.int_points1_sorted,n.int_points2,n););(function(s){let a,c,l,h=s.int_points1.length;for(let d=0;d<h;d++){let u=s.int_points1_sorted[d];u.face!==a&&(c=d,a=u.face);let _,p=d,m=IZ(s.int_points1_sorted,d,a);_=p+m<h&&s.int_points1_sorted[p+m].face===a?p+m:c;let A=IZ(s.int_points1_sorted,_,a);l=null;for(let I=_;I<_+A;I++){let v=s.int_points1_sorted[I];if(v.face===a&&s.int_points2[v.id].face===s.int_points2[u.id].face){l=v;break}}if(l===null)continue;let g=u.edge_after,f=l.edge_before;if(g.bv!==2||f.bv!==2)continue;if(g!==f)continue;let y=s.int_points2[u.id],x=s.int_points2[l.id],C=y.edge_after,b=x.edge_before;C.bv===2&&b.bv===2&&C===b||(y=s.int_points2[l.id],x=s.int_points2[u.id],C=y.edge_after,b=x.edge_before),C.bv===2&&b.bv===2&&C===b&&g.setOverlap(C)}})(n),xit(e,o,n.int_points1_sorted,!0),xit(t,o,n.int_points2_sorted,!1),Y2n(e,r,o,!0),Y2n(t,i,o,!1)}function s0e(e,t,n,o){let r=e.clone(),i=t.clone(),s=e6n(r,i);return mue(s),vZ(r,s.int_points1_sorted),vZ(i,s.int_points2_sorted),Iat(s),mue(s),i$r(r,i,s,n),o&&function(a,c,l){(function(h,d,u,_){for(let p of d.faces){for(let m of p)h.edges.add(m);_.find((m)=>m.face===p)===void 0&&h.addFace(p.first,p.last)}})(a,c,0,l.int_points2),function(h,d,u){if(u.int_points1.length!==0)for(let _=0;_<u.int_points1.length;_++){let p=u.int_points1[_],m=u.int_points2[_];if(p.edge_before!==void 0&&p.edge_after===void 0&&m.edge_before===void 0&&m.edge_after!==void 0&&(p.edge_before.next=m.edge_after,m.edge_after.prev=p.edge_before,p.edge_after=m.edge_after,m.edge_before=p.edge_before),m.edge_before!==void 0&&m.edge_after===void 0&&p.edge_before===void 0&&p.edge_after!==void 0&&(m.edge_before.next=p.edge_after,p.edge_after.prev=m.edge_before,m.edge_after=p.edge_after,p.edge_before=m.edge_before),p.edge_before!==void 0&&p.edge_after===void 0)for(let A of u.int_points1_sorted)A!==p&&A.edge_before===void 0&&A.edge_after!==void 0&&A.pt.equalTo(p.pt)&&(p.edge_before.next=A.edge_after,A.edge_after.prev=p.edge_before,p.edge_after=A.edge_after,A.edge_before=p.edge_before);if(m.edge_before!==void 0&&m.edge_after===void 0)for(let A of u.int_points2_sorted)A!==m&&A.edge_before===void 0&&A.edge_after!==void 0&&A.pt.equalTo(m.pt)&&(m.edge_before.next=A.edge_after,A.edge_after.prev=m.edge_before,m.edge_after=A.edge_after,A.edge_before=m.edge_before)}}(0,0,l),Cit(a,l.int_points1),Cit(c,l.int_points2),bit(a,l.int_points1,l.int_points2),bit(a,l.int_points2,l.int_points1)}(r,i,s),[r,i]}function e6n(e,t){let n={int_points1:[],int_points2:[]};for(let o of e.edges){let r=t.edges.search(o.box);for(let i of r){let s=o.shape.intersect(i.shape);for(let a of s)bZ(o,a,n.int_points1),bZ(i,a,n.int_points2)}}return n}function O2n(e,t){let n=[];for(let o of e.faces)t.find((r)=>r.face===o)||n.push(o);return n}function V2n(e,t){for(let n of e)n.first.bv=n.first.bvStart=n.first.bvEnd=void 0,n.first.setInclusion(t)}function s$r(e,t,n,o,r,i){let s,a,c,l=o.length,h=!1;for(let d=0;d<l;d++){let u=o[d];u.face!==s&&(a=d,s=u.face);let _,p=d,m=IZ(o,d,s);_=p+m<l&&o[p+m].face===s?p+m:a;let A=IZ(o,_,s);c=null;for(let y=_;y<_+A;y++){let x=o[y];if(x.face===s&&r[x.id].face===r[u.id].face){c=x;break}}if(c===null)continue;let g=u.edge_after,f=c.edge_before;if(g.bv!==of||f.bv==of)if(g.bv==of||f.bv!==of){if(g.bv===of&&f.bv===of&&g!=f||g.bv===IP&&f.bv===vP||g.bv===vP&&f.bv===IP){let y=g.next;for(;y!=f;)y.bvStart=void 0,y.bvEnd=void 0,y.bv=void 0,y.setInclusion(t),y=y.next}if(g.bv===of&&f.bv===of&&g!=f){let y,x=g.next;for(;x!=f;){if(x.bv!=of){if(y===void 0)y=x.bv;else if(x.bv!=y)throw E0.UNRESOLVED_BOUNDARY_CONFLICT}x=x.next}y!=null&&(g.bv=y,f.bv=y);continue}if(g.bv===IP&&f.bv===vP||g.bv===vP&&f.bv===IP){let y=g;for(;y!=f;){if(y.bvStart===g.bv&&y.bvEnd===f.bv){let[x,C]=y.shape.distanceTo(t);if(x<10*Ue.DP_TOL){bZ(y,C.ps,n);let b=n[n.length-1];if(b.is_vertex&F2n)b.edge_after=y,b.edge_before=y.prev,y.bvStart=of,y.bv=void 0,y.setInclusion(t);else if(b.is_vertex&z2n)b.edge_after=y.next,y.bvEnd=of,y.bv=void 0,y.setInclusion(t);else{let P=t.addVertex(b.pt,y);b.edge_before=P,b.edge_after=P.next,P.setInclusion(t),P.next.bvStart=of,P.next.bvEnd=void 0,P.next.bv=void 0,P.next.setInclusion(t)}let I=t.findEdgeByPoint(C.pe);bZ(I,C.pe,r);let v=r[r.length-1];if(v.is_vertex&F2n)v.edge_after=I,v.edge_before=I.prev;else if(v.is_vertex&z2n)v.edge_after=I.next;else{let P=r.find((B)=>B.edge_after===I),M=t.addVertex(v.pt,I);v.edge_before=M,v.edge_after=M.next,P&&(P.edge_after=M),M.bvStart=void 0,M.bvEnd=of,M.bv=void 0,M.setInclusion(e),M.next.bvStart=of,M.next.bvEnd=void 0,M.next.bv=void 0,M.next.setInclusion(e)}mue(i),h=!0;break}}y=y.next}if(h)break;throw E0.UNRESOLVED_BOUNDARY_CONFLICT}}else f.bv=g.bv;else g.bv=f.bv}return h}function xit(e,t,n,o){if(!n)return;let r,i,s,a;for(let c=0;c<n.length;c++){if(s=n[c],s.face!==r&&(i=c,r=s.face),r.isEmpty())continue;let l,h=c,d=IZ(n,c,r);l=h+d<n.length&&n[h+d].face===s.face?h+d:i,a=n[l];let u=l,_=IZ(n,u,r),p=s.edge_after,m=a.edge_before;if(p.bv===IP&&m.bv===IP&&t===1||p.bv===vP&&m.bv===vP&&t===2||(p.bv===vP||m.bv===vP)&&t===3&&!o||(p.bv===IP||m.bv===IP)&&t===3&&o||p.bv===of&&m.bv===of&&p.overlap&o$r&&o||p.bv===of&&m.bv===of&&p.overlap&r$r){e.removeChain(r,p,m);for(let A=h;A<h+d;A++)n[A].edge_after=void 0;for(let A=u;A<u+_;A++)n[A].edge_before=void 0}c+=d-1}}function Cit(e,t){for(let n of t)e.faces.delete(n.face),n.face=void 0,n.edge_before&&(n.edge_before.face=void 0),n.edge_after&&(n.edge_after.face=void 0)}function bit(e,t,n){for(let o of t){if(o.edge_before===void 0||o.edge_after===void 0)continue;if(o.face)continue;if(o.edge_after.face||o.edge_before.face)continue;let{edge_after:r,edge_before:i}=o;try{Aat.testInfiniteLoop(r)}catch(a){throw E0.CANNOT_COMPLETE_BOOLEAN_OPERATION}let s=e.addFace(r,i);for(let a of t)a.edge_before&&a.edge_after&&a.edge_before.face===s&&a.edge_after.face===s&&(a.face=s);for(let a of n)a.edge_before&&a.edge_after&&a.edge_before.face===s&&a.edge_after.face===s&&(a.face=s)}}function Y2n(e,t,n,o){for(let r of t){let i=r.first.bv;(n===1&&i===IP||n===3&&i===IP&&o||n===3&&i===vP&&!o||n===2&&i===vP)&&e.deleteFace(r)}}var a$r=Object.freeze({__proto__:null,BOOLEAN_INTERSECT:2,BOOLEAN_SUBTRACT:3,BOOLEAN_UNION:1,calculateIntersections:Zbn,innerClip:Jbn,intersect:qbn,outerClip:yit,removeNotRelevantChains:xit,removeOldFaces:Cit,restoreFaces:bit,subtract:fit,unify:function(e,t){let[n,o]=s0e(e,t,1,!0);return n}}),c$r=RegExp("T.F..FFF.|T.F...F.."),l$r=RegExp("T........|.T.......|...T.....|....T...."),h$r=RegExp("FT.......|F..T.....|F...T...."),d$r=RegExp("T.F..F..."),u$r=RegExp("T.F..F...|.TF..F...|..FT.F...|..F.TF..."),oZ=class{constructor(){this.m=[,,,,,,,,,].fill(void 0)}get I2I(){return this.m[0]}set I2I(e){this.m[0]=e}get I2B(){return this.m[1]}set I2B(e){this.m[1]=e}get I2E(){return this.m[2]}set I2E(e){this.m[2]=e}get B2I(){return this.m[3]}set B2I(e){this.m[3]=e}get B2B(){return this.m[4]}set B2B(e){this.m[4]=e}get B2E(){return this.m[5]}set B2E(e){this.m[5]=e}get E2I(){return this.m[6]}set E2I(e){this.m[6]=e}get E2B(){return this.m[7]}set E2B(e){this.m[7]=e}get E2E(){return this.m[8]}set E2E(e){this.m[8]=e}toString(){return this.m.map((e)=>e instanceof Array&&e.length>0?"T":e instanceof Array&&e.length===0?"F":"*").join("")}equal(){return c$r.test(this.toString())}intersect(){return l$r.test(this.toString())}touch(){return h$r.test(this.toString())}inside(){return d$r.test(this.toString())}covered(){return u$r.test(this.toString())}};function Ude(e,t){let n,o=new Ue.Ray(t),r=new Ue.Line(o.pt,o.norm),i=new Ue.Box(o.box.xmin-Ue.DP_TOL,o.box.ymin-Ue.DP_TOL,o.box.xmax+Ue.DP_TOL,o.box.ymax+Ue.DP_TOL);if(e.box.not_intersect(i))return Ue.OUTSIDE;let s=e.edges.search(i);if(s.length===0)return Ue.OUTSIDE;for(let h of s)if(h.shape.contains(t))return Ue.BOUNDARY;let a=[...e.faces],c=[];for(let h of s)for(let d of o.intersect(h.shape)){if(d.equalTo(t))return Ue.BOUNDARY;c.push({pt:d,edge:h,face_index:a.indexOf(h.face)})}c.sort((h,d)=>Hbn(h.pt.x,d.pt.x)?-1:Lbn(h.pt.x,d.pt.x)?1:h.face_index<d.face_index?-1:h.face_index>d.face_index?1:h.edge.arc_length<d.edge.arc_length?-1:h.edge.arc_length>d.edge.arc_length?1:0);let l=0;for(let h=0;h<c.length;h++){let d=c[h];if(d.pt.equalTo(d.edge.shape.start)){if(h>0&&d.pt.equalTo(c[h-1].pt)&&d.face_index===c[h-1].face_index&&d.edge.prev===c[h-1].edge)continue;let u=d.edge.prev;for(;_it(u.length);)u=u.prev;let _=u.shape.tangentInEnd(),p=d.pt.translate(_),m=d.edge.shape.tangentInStart(),A=d.pt.translate(m),g=p.leftTo(r),f=A.leftTo(r);(g&&!f||!g&&f)&&l++}else if(d.pt.equalTo(d.edge.shape.end)){if(h>0&&d.pt.equalTo(c[h-1].pt)&&d.face_index===c[h-1].face_index&&d.edge.next===c[h-1].edge)continue;let u=d.edge.next;for(;_it(u.length);)u=u.next;let _=u.shape.tangentInStart(),p=d.pt.translate(_),m=d.edge.shape.tangentInEnd(),A=d.pt.translate(m),g=p.leftTo(r),f=A.leftTo(r);(g&&!f||!g&&f)&&l++}else if(d.edge.shape instanceof Ue.Segment)l++;else{let u=d.edge.shape.box;gG(d.pt.y,u.ymin)||gG(d.pt.y,u.ymax)||l++}}return n=l%2==1?1:0,n}function G2n(e,t){return dZ(e,t).intersect()}function U2n(e,t){return dZ(e,t).inside()}function t6n(e,t){return dZ(e,t).covered()}function n6n(e,t){return t6n(t,e)}function dZ(e,t){return e instanceof Ue.Line&&t instanceof Ue.Line?function(n,o){let r=new oZ,i=WZ(n,o);return i.length===0?n.contains(o.pt)&&o.contains(n.pt)?(r.I2I=[n],r.I2E=[],r.E2I=[]):(r.I2I=[],r.I2E=[n],r.E2I=[o]):(r.I2I=i,r.I2E=n.split(i),r.E2I=o.split(i)),r}(e,t):e instanceof Ue.Line&&t instanceof Ue.Circle?function(n,o){let r=new oZ,i=TG(n,o);if(i.length===0)r.I2I=[],r.I2B=[],r.I2E=[n],r.E2I=[o];else if(i.length===1)r.I2I=[],r.I2B=i,r.I2E=n.split(i),r.E2I=[o];else{let s=new cG([n]),a=n.sortPoints(i);s.split(a);let c=s.toShapes();r.I2I=[c[1]],r.I2B=a,r.I2E=[c[0],c[2]],r.E2I=new Ue.Polygon([o.toArc()]).cutWithLine(n)}return r}(e,t):e instanceof Ue.Line&&t instanceof Ue.Box?function(n,o){let r=new oZ,i=xZ(n,o);if(i.length===0)r.I2I=[],r.I2B=[],r.I2E=[n],r.E2I=[o];else if(i.length===1)r.I2I=[],r.I2B=i,r.I2E=n.split(i),r.E2I=[o];else{let s=new cG([n]),a=n.sortPoints(i);s.split(a);let c=s.toShapes();o.toSegments().some((l)=>l.contains(i[0])&&l.contains(i[1]))?(r.I2I=[],r.I2B=[c[1]],r.I2E=[c[0],c[2]],r.E2I=[o]):(r.I2I=[c[1]],r.I2B=a,r.I2E=[c[0],c[2]],r.E2I=new Ue.Polygon(o.toSegments()).cutWithLine(n))}return r}(e,t):e instanceof Ue.Line&&t instanceof Ue.Polygon?function(n,o){let r=new oZ,i=i0e(n,o),s=new cG([n]),a=i.length>0?i.slice():n.sortPoints(i);return s.split(a),[...s].forEach((c)=>c.setInclusion(o)),r.I2I=[...s].filter((c)=>c.bv===Ue.INSIDE).map((c)=>c.shape),r.I2B=[...s].slice(1).map((c)=>c.bv===Ue.BOUNDARY?c.shape:c.shape.start),r.I2E=[...s].filter((c)=>c.bv===Ue.OUTSIDE).map((c)=>c.shape),r.E2I=o.cutWithLine(n),r}(e,t):(e instanceof Ue.Segment||e instanceof Ue.Arc)&&t instanceof Ue.Polygon?W2n(e,t):(e instanceof Ue.Segment||e instanceof Ue.Arc)&&(t instanceof Ue.Circle||t instanceof Ue.Box)?W2n(e,new Ue.Polygon(t)):e instanceof Ue.Polygon&&t instanceof Ue.Polygon?g9e(e,t):(e instanceof Ue.Circle||e instanceof Ue.Box)&&(t instanceof Ue.Circle||t instanceof Ue.Box)?g9e(new Ue.Polygon(e),new Ue.Polygon(t)):(e instanceof Ue.Circle||e instanceof Ue.Box)&&t instanceof Ue.Polygon?g9e(new Ue.Polygon(e),t):e instanceof Ue.Polygon&&(t instanceof Ue.Circle||t instanceof Ue.Box)?g9e(e,new Ue.Polygon(t)):void 0}function W2n(e,t){let n=new oZ,o=function(s,a){return s instanceof Ue.Line?i0e(s,a):s instanceof Ue.Segment?yat(s,a):s instanceof Ue.Arc?xat(s,a):[]}(e,t),r=o.length>0?o.slice():e.sortPoints(o),i=new cG([e]);i.split(r),[...i].forEach((s)=>s.setInclusion(t)),n.I2I=[...i].filter((s)=>s.bv===Ue.INSIDE).map((s)=>s.shape),n.I2B=[...i].slice(1).map((s)=>s.bv===Ue.BOUNDARY?s.shape:s.shape.start),n.I2E=[...i].filter((s)=>s.bv===Ue.OUTSIDE).map((s)=>s.shape),n.B2I=[],n.B2B=[],n.B2E=[];for(let s of[e.start,e.end])switch(Ude(t,s)){case Ue.INSIDE:n.B2I.push(s);break;case Ue.BOUNDARY:n.B2B.push(s);break;case Ue.OUTSIDE:n.B2E.push(s)}return n}function g9e(e,t){let n=new oZ,[o,r]=Zbn(e,t),i=qbn(e,t),s=fit(e,t),a=fit(t,e),[c,l]=Jbn(e,t),h=yit(e,t),d=yit(t,e);return n.I2I=i.isEmpty()?[]:[i],n.I2B=l,n.I2E=s.isEmpty()?[]:[s],n.B2I=c,n.B2B=o,n.B2E=h,n.E2I=a.isEmpty()?[]:[a],n.E2B=d,n}var p$r=Object.freeze({__proto__:null,contain:function(e,t){return U2n(t,e)},cover:n6n,covered:t6n,disjoint:function(e,t){return!G2n(e,t)},equal:function(e,t){return dZ(e,t).equal()},inside:U2n,intersect:G2n,relate:dZ,touch:function(e,t){return dZ(e,t).touch()}}),Wde=class e{constructor(t=1,n=0,o=0,r=1,i=0,s=0){this.a=t,this.b=n,this.c=o,this.d=r,this.tx=i,this.ty=s}fromMatrix3x3(t){let[n,o,r]=t[0],[i,s,a]=t[1];return new e(n,i,o,s,r,a)}toMatrix3x3(){return[[this.a,this.c,this.tx],[this.b,this.d,this.ty],[0,0,1]]}clone(){return new e(this.a,this.b,this.c,this.d,this.tx,this.ty)}transform(t){return[t[0]*this.a+t[1]*this.c+this.tx,t[0]*this.b+t[1]*this.d+this.ty]}multiply(t){return new e(this.a*t.a+this.c*t.b,this.b*t.a+this.d*t.b,this.a*t.c+this.c*t.d,this.b*t.c+this.d*t.d,this.a*t.tx+this.c*t.ty+this.tx,this.b*t.tx+this.d*t.ty+this.ty)}translate(...t){let n,o;if(t.length!=1||isNaN(t[0].x)||isNaN(t[0].y)){if(t.length!==2||typeof t[0]!="number"||typeof t[1]!="number")throw E0.ILLEGAL_PARAMETERS;n=t[0],o=t[1]}else n=t[0].x,o=t[0].y;return this.multiply(new e(1,0,0,1,n,o))}rotate(t,n=0,o=0){let r=Math.cos(t),i=Math.sin(t);return this.translate(n,o).multiply(new e(r,i,-i,r,0,0)).translate(-n,-o)}scale(t,n){return this.multiply(new e(t,0,0,n,0,0))}equalTo(t){return!!Ue.Utils.EQ(this.tx,t.tx)&&(!!Ue.Utils.EQ(this.ty,t.ty)&&(!!Ue.Utils.EQ(this.a,t.a)&&(!!Ue.Utils.EQ(this.b,t.b)&&(!!Ue.Utils.EQ(this.c,t.c)&&!!Ue.Utils.EQ(this.d,t.d)))))}};Ue.Matrix=Wde;Ue.matrix=(...e)=>new Ue.Matrix(...e);var m$r=class{constructor(e,t){this.low=e,this.high=t}get max(){return this.clone()}less_than(e){return this.low<e.low||this.low===e.low&&this.high<e.high}equal_to(e){return this.low===e.low&&this.high===e.high}intersect(e){return!this.not_intersect(e)}not_intersect(e){return this.high<e.low||e.high<this.low}merge(e){let t=this.low===void 0?e.low:this.low<e.low?this.low:e.low,n=this.high===void 0?e.high:this.high>e.high?this.high:e.high,o=this.clone();return o.low=t,o.high=n,o}output(){return[this.low,this.high]}comparable_less_than(e,t){return e<t}},_$r=class e extends m$r{clone(){return new e(this.low,this.high)}},Bk=class{constructor(e,t,n=null,o=null,r=null,i=0){if(this.left=n,this.right=o,this.parent=r,this.color=i,this.item={key:void 0,values:[]},t!==void 0&&this.item.values.push(t),e!==void 0)if(Array.isArray(e)){let[s,a]=e;if(!Number.isNaN(s)&&!Number.isNaN(a)){let c=s,l=a;c>l&&([c,l]=[l,c]),this.item.key=new _$r(c,l)}}else this.item.key=e;this.max=this.item.key?this.item.key.max:void 0}isNil(){return this.item.key===void 0&&this.item.values.length===0&&this.left===null&&this.right===null&&this.color===0}requireKey(){if(!this.item.key)throw Error("Node key is undefined (nil/sentinel). Operation is not applicable.");return this.item.key}less_than(e){let t=this.requireKey(),n=e.requireKey();return t.less_than(n)}_value_equal(e){let t=this.item.values[0],n=e.item.values[0];return t&&n&&t.equal_to?t.equal_to(n):t===n}equal_to(e){let t=this.requireKey(),n=e.requireKey();return t.equal_to(n)}intersect(e){let t=this.requireKey(),n=e.requireKey();return t.intersect(n)}copy_data(e){this.item.key=e.item.key,this.item.values=e.item.values.slice()}update_max(){this.max=this.item.key?this.item.key.max:void 0,this.right&&this.right.max&&(this.max=this.max?this.max.merge(this.right.max):this.right.max),this.left&&this.left.max&&(this.max=this.max?this.max.merge(this.left.max):this.left.max)}not_intersect_left_subtree(e){if(!this.left)return!0;let t=this.left.max?this.left.max.high:this.left.item.key.high,n=this.requireKey(),o=e.requireKey();return n.comparable_less_than(t,o.low)}not_intersect_right_subtree(e){if(!this.right)return!0;let t=this.right.max?this.right.max.low:this.right.item.key.low,n=this.requireKey(),o=e.requireKey();return n.comparable_less_than(o.high,t)}},Iit=class e{constructor(){this.root=null,this.nil_node=new Bk}get size(){let t=0;return this.tree_walk(this.root,(n)=>t+=n.item.values.length),t}get keys(){let t=[];return this.tree_walk(this.root,(n)=>t.push(n.item.key.output())),t}get values(){let t=[];return this.tree_walk(this.root,(n)=>{for(let o of n.item.values)t.push(o)}),t}get items(){let t=[];return this.tree_walk(this.root,(n)=>{let o=n.item.key.output();for(let r of n.item.values)t.push({key:o,value:r})}),t}isEmpty(){return this.root==null||this.root===this.nil_node}clear(){this.root=null}insert(t,n=t){if(t===void 0)return;let o=this.tree_search(this.root,new Bk(t));if(o)return o.item.values.push(n),o;let r=new Bk(t,n,this.nil_node,this.nil_node,null,1);return this.tree_insert(r),this.recalc_max(r),r}exist(t,n=t){let o=this.tree_search(this.root,new Bk(t));return!!o&&(arguments.length<2||n===t||o.item.values.some((r)=>r&&r.equal_to?r.equal_to(n):r===n))}remove(t,n=t){let o=this.tree_search(this.root,new Bk(t));if(!o)return;if(arguments.length<2)return this.tree_delete(o),o;let r=o.item.values.findIndex((i)=>i&&i.equal_to?i.equal_to(n):i===n);return r>=0?(o.item.values.splice(r,1),o.item.values.length===0&&this.tree_delete(o),o):void 0}search(t,n=(o,r)=>o===r?r.output():o){let o=new Bk(t),r=[];this.tree_search_interval(this.root,o,r);let i=[];for(let s of r)for(let a of s.item.values)i.push(n(a,s.item.key));return i}intersect_any(t){let n=new Bk(t);return this.tree_find_any_interval(this.root,n)}forEach(t){this.tree_walk(this.root,(n)=>{for(let o of n.item.values)t(n.item.key,o)})}map(t){let n=new e;return this.tree_walk(this.root,(o)=>{for(let r of o.item.values)n.insert(o.item.key,t(r,o.item.key))}),n}*iterate(t,n=(o,r)=>o===r?r.output():o){let o=null;for(t?o=this.tree_search_nearest_forward(this.root,new Bk(t)):this.root&&(o=this.local_minimum(this.root));o;){for(let r of o.item.values)yield n(r,o.item.key);o=this.tree_successor(o)}}recalc_max(t){let n=t;for(;n.parent!=null;)n.parent.update_max(),n=n.parent}tree_insert(t){let n=this.root,o=null;if(this.root==null||this.root===this.nil_node)this.root=t;else{for(;n!==this.nil_node;)o=n,n=t.less_than(n)?n.left:n.right;t.parent=o,t.less_than(o)?o.left=t:o.right=t}this.insert_fixup(t)}insert_fixup(t){let n,o;for(n=t;n!==this.root&&n.parent.color===1;)n.parent===n.parent.parent.left?(o=n.parent.parent.right,o.color===1?(n.parent.color=0,o.color=0,n.parent.parent.color=1,n=n.parent.parent):(n===n.parent.right&&(n=n.parent,this.rotate_left(n)),n.parent.color=0,n.parent.parent.color=1,this.rotate_right(n.parent.parent))):(o=n.parent.parent.left,o.color===1?(n.parent.color=0,o.color=0,n.parent.parent.color=1,n=n.parent.parent):(n===n.parent.left&&(n=n.parent,this.rotate_right(n)),n.parent.color=0,n.parent.parent.color=1,this.rotate_left(n.parent.parent)));this.root.color=0}tree_delete(t){let n,o;n=t.left===this.nil_node||t.right===this.nil_node?t:this.tree_successor(t),o=n.left!==this.nil_node?n.left:n.right,o.parent=n.parent,n===this.root?this.root=o:(n===n.parent.left?n.parent.left=o:n.parent.right=o,n.parent.update_max()),this.recalc_max(o),n!==t&&(t.copy_data(n),t.update_max(),this.recalc_max(t)),n.color===0&&this.delete_fixup(o)}delete_fixup(t){let n,o=t;for(;o!==this.root&&o.parent!=null&&o.color===0;)o===o.parent.left?(n=o.parent.right,n.color===1&&(n.color=0,o.parent.color=1,this.rotate_left(o.parent),n=o.parent.right),n.left.color===0&&n.right.color===0?(n.color=1,o=o.parent):(n.right.color===0&&(n.color=1,n.left.color=0,this.rotate_right(n),n=o.parent.right),n.color=o.parent.color,o.parent.color=0,n.right.color=0,this.rotate_left(o.parent),o=this.root)):(n=o.parent.left,n.color===1&&(n.color=0,o.parent.color=1,this.rotate_right(o.parent),n=o.parent.left),n.left.color===0&&n.right.color===0?(n.color=1,o=o.parent):(n.left.color===0&&(n.color=1,n.right.color=0,this.rotate_left(n),n=o.parent.left),n.color=o.parent.color,o.parent.color=0,n.left.color=0,this.rotate_right(o.parent),o=this.root));o.color=0}tree_search(t,n){if(t!=null&&t!==this.nil_node)return n.equal_to(t)?t:n.less_than(t)?this.tree_search(t.left,n):this.tree_search(t.right,n)}tree_search_nearest_forward(t,n){let o=null,r=t;for(;r&&r!==this.nil_node;)r.less_than(n)?r.intersect(n)?(o=r,r=r.left):r=r.right:(o&&!r.less_than(o)||(o=r),r=r.left);return o||null}tree_search_interval(t,n,o){t!=null&&t!==this.nil_node&&(t.left===this.nil_node||t.not_intersect_left_subtree(n)||this.tree_search_interval(t.left,n,o),t.intersect(n)&&o.push(t),t.right===this.nil_node||t.not_intersect_right_subtree(n)||this.tree_search_interval(t.right,n,o))}tree_find_any_interval(t,n){let o=!1;return t!=null&&t!==this.nil_node&&(t.left===this.nil_node||t.not_intersect_left_subtree(n)||(o=this.tree_find_any_interval(t.left,n)),o||(o=t.intersect(n)),o||t.right===this.nil_node||t.not_intersect_right_subtree(n)||(o=this.tree_find_any_interval(t.right,n))),o}local_minimum(t){let n=t;for(;n.left!=null&&n.left!==this.nil_node;)n=n.left;return n}local_maximum(t){let n=t;for(;n.right!=null&&n.right!==this.nil_node;)n=n.right;return n}tree_successor(t){let n,o,r;if(t.right!==this.nil_node)n=this.local_minimum(t.right);else{for(o=t,r=t.parent;r!=null&&r.right===o;)o=r,r=r.parent;n=r}return n}rotate_left(t){let n=t.right;t.right=n.left,n.left!==this.nil_node&&(n.left.parent=t),n.parent=t.parent,t===this.root?this.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n.left=t,t.parent=n,t!==null&&t!==this.nil_node&&t.update_max(),n!=null&&n!==this.nil_node&&n.update_max()}rotate_right(t){let n=t.left;t.left=n.right,n.right!==this.nil_node&&(n.right.parent=t),n.parent=t.parent,t===this.root?this.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n.right=t,t.parent=n,t!==null&&t!==this.nil_node&&t.update_max(),n!=null&&n!==this.nil_node&&n.update_max()}tree_walk(t,n){t!=null&&t!==this.nil_node&&(this.tree_walk(t.left,n),n(t),this.tree_walk(t.right,n))}testRedBlackProperty(){let t=!0;return this.tree_walk(this.root,function(n){n.color===1&&(n.left.color===0&&n.right.color===0||(t=!1))}),t}testBlackHeightProperty(t){let n=0,o=0,r=0;if(t.color===0&&n++,o=t.left!==this.nil_node?this.testBlackHeightProperty(t.left):1,r=t.right!==this.nil_node?this.testBlackHeightProperty(t.right):1,o!==r)throw Error("Red-black height property violated");return n+=o,n}},g$r=class extends Set{constructor(e){super(e),this.index=new Iit,this.forEach((t)=>this.index.insert(t))}add(e){let t=this.size,{key:n,value:o}=e,r=n||e.box,i=o||e;return super.add(i),this.size>t&&this.index.insert(r,i),this}delete(e){let{key:t,value:n}=e,o=t||e.box,r=n||e,i=super.delete(r);return i&&this.index.remove(o,r),i}clear(){super.clear(),this.index=new Iit}search(e){return this.index.search(e)}hit(e){let t=new Ue.Box(e.x-1,e.y-1,e.x+1,e.y+1);return this.index.search(t).filter((n)=>e.on(n))}svg(){return[...this].reduce((e,t)=>e+t.svg(),"")}};Ue.PlanarSet=g$r;var vL=class{get name(){throw E0.CANNOT_INVOKE_ABSTRACT_METHOD}get box(){throw E0.CANNOT_INVOKE_ABSTRACT_METHOD}clone(){throw E0.CANNOT_INVOKE_ABSTRACT_METHOD}translate(...e){return this.transform(new Wde().translate(...e))}rotate(e,t=new Ue.Point){return this.transform(new Wde().rotate(e,t.x,t.y))}scale(e,t){return this.transform(new Wde().scale(e,t))}transform(...e){throw E0.CANNOT_INVOKE_ABSTRACT_METHOD}toJSON(){return Object.assign({},this,{name:this.name})}svg(e={}){throw E0.CANNOT_INVOKE_ABSTRACT_METHOD}};Ue.Point=class e extends vL{constructor(...t){if(super(),this.x=0,this.y=0,t.length!==0){if(t.length===1&&t[0]instanceof Array&&t[0].length===2){let n=t[0];if(typeof n[0]=="number"&&typeof n[1]=="number")return this.x=n[0],void(this.y=n[1])}if(t.length===1&&t[0]instanceof Object&&t[0].name==="point"){let{x:n,y:o}=t[0];return this.x=n,void(this.y=o)}if(t.length===2&&typeof t[0]=="number"&&typeof t[1]=="number")return this.x=t[0],void(this.y=t[1]);throw E0.ILLEGAL_PARAMETERS}}get box(){return new Ue.Box(this.x,this.y,this.x,this.y)}clone(){return new Ue.Point(this.x,this.y)}get vertices(){return[this.clone()]}equalTo(t){return Ue.Utils.EQ(this.x,t.x)&&Ue.Utils.EQ(this.y,t.y)}lessThan(t){return!!Ue.Utils.LT(this.y,t.y)||!(!Ue.Utils.EQ(this.y,t.y)||!Ue.Utils.LT(this.x,t.x))}transform(t){return new Ue.Point(t.transform([this.x,this.y]))}projectionOn(t){if(this.equalTo(t.pt))return this.clone();let n=new Ue.Vector(this,t.pt);if(Ue.Utils.EQ_0(n.cross(t.norm)))return t.pt.clone();let o=n.dot(t.norm),r=t.norm.multiply(o);return this.translate(r)}leftTo(t){let n=new Ue.Vector(t.pt,this);return Ue.Utils.GT(n.dot(t.norm),0)}distanceTo(t){if(t instanceof e){let n=t.x-this.x,o=t.y-this.y;return[Math.sqrt(n*n+o*o),new Ue.Segment(this,t)]}return t instanceof Ue.Line?Ue.Distance.point2line(this,t):t instanceof Ue.Circle?Ue.Distance.point2circle(this,t):t instanceof Ue.Segment?Ue.Distance.point2segment(this,t):t instanceof Ue.Arc?Ue.Distance.point2arc(this,t):t instanceof Ue.Polygon?Ue.Distance.point2polygon(this,t):t instanceof Ue.PlanarSet?Ue.Distance.shape2planarSet(this,t):t instanceof Ue.Multiline?Ue.Distance.shape2multiline(this,t):void 0}on(t){if(t instanceof Ue.Point)return this.equalTo(t);if(t.contains&&t.contains instanceof Function)return t.contains(this);throw Ue.Errors.UNSUPPORTED_SHAPE_TYPE}get name(){return"point"}svg(t={}){let n=t.r??3;return`
<circle cx="${this.x}" cy="${this.y}" r="${n}"
            ${BG({fill:"red",...t})} />`}};Ue.point=(...e)=>new Ue.Point(...e);Ue.Vector=class extends vL{constructor(...e){if(super(),this.x=0,this.y=0,e.length!==0){if(e.length===1&&e[0]instanceof Array&&e[0].length===2){let t=e[0];if(typeof t[0]=="number"&&typeof t[1]=="number")return this.x=t[0],void(this.y=t[1])}if(e.length===1&&e[0]instanceof Object&&e[0].name==="vector"){let{x:t,y:n}=e[0];return this.x=t,void(this.y=n)}if(e.length===1&&e[0]instanceof Object&&e[0].name==="segment"){let{start:t,end:n}=e[0];return this.x=n.x-t.x,void(this.y=n.y-t.y)}if(e.length===2){let t=e[0],n=e[1];if(typeof t=="number"&&typeof n=="number")return this.x=t,void(this.y=n);if(t instanceof Ue.Point&&n instanceof Ue.Point)return this.x=n.x-t.x,void(this.y=n.y-t.y)}throw E0.ILLEGAL_PARAMETERS}}clone(){return new Ue.Vector(this.x,this.y)}get slope(){let e=Math.atan2(this.y,this.x);return e<0&&(e=2*Math.PI+e),e}get length(){return Math.sqrt(this.dot(this))}isZeroLength(){return Ue.Utils.EQ_0(this.length)}equalTo(e){return Ue.Utils.EQ(this.x,e.x)&&Ue.Utils.EQ(this.y,e.y)}multiply(e){return new Ue.Vector(e*this.x,e*this.y)}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}normalize(){if(this.isZeroLength())throw E0.ZERO_DIVISION;return new Ue.Vector(this.x/this.length,this.y/this.length)}rotate(e,t=new Ue.Point){if(t.x===0&&t.y===0)return this.transform(new Wde().rotate(e));throw E0.OPERATION_IS_NOT_SUPPORTED}transform(e){return new Ue.Vector(e.transform([this.x,this.y]))}rotate90CCW(){return new Ue.Vector(-this.y,this.x)}rotate90CW(){return new Ue.Vector(this.y,-this.x)}invert(){return new Ue.Vector(-this.x,-this.y)}add(e){return new Ue.Vector(this.x+e.x,this.y+e.y)}subtract(e){return new Ue.Vector(this.x-e.x,this.y-e.y)}angleTo(e){let t=this.normalize(),n=e.normalize(),o=Math.atan2(t.cross(n),t.dot(n));return o<0&&(o+=2*Math.PI),o}projectionOn(e){let t=e.normalize(),n=this.dot(t);return t.multiply(n)}get name(){return"vector"}};var o6n=(...e)=>new Ue.Vector(...e);Ue.vector=o6n;Ue.Segment=class e extends vL{constructor(...t){if(super(),this.ps=new Ue.Point,this.pe=new Ue.Point,t.length!==0){if(t.length===1&&t[0]instanceof Array&&t[0].length===4){let n=t[0];return this.ps=new Ue.Point(n[0],n[1]),void(this.pe=new Ue.Point(n[2],n[3]))}if(t.length===1&&t[0]instanceof Object&&t[0].name==="segment"){let{ps:n,pe:o}=t[0];return this.ps=new Ue.Point(n.x,n.y),void(this.pe=new Ue.Point(o.x,o.y))}if(!(t.length===1&&t[0]instanceof Ue.Point)){if(t.length===2&&t[0]instanceof Ue.Point&&t[1]instanceof Ue.Point)return this.ps=t[0].clone(),void(this.pe=t[1].clone());if(t.length===4)return this.ps=new Ue.Point(t[0],t[1]),void(this.pe=new Ue.Point(t[2],t[3]));throw E0.ILLEGAL_PARAMETERS}this.ps=t[0].clone()}}clone(){return new Ue.Segment(this.start,this.end)}get start(){return this.ps}get end(){return this.pe}get vertices(){return[this.ps.clone(),this.pe.clone()]}get length(){return this.start.distanceTo(this.end)[0]}get slope(){return new Ue.Vector(this.start,this.end).slope}get box(){return new Ue.Box(Math.min(this.start.x,this.end.x),Math.min(this.start.y,this.end.y),Math.max(this.start.x,this.end.x),Math.max(this.start.y,this.end.y))}equalTo(t){return this.ps.equalTo(t.ps)&&this.pe.equalTo(t.pe)}contains(t){return Ue.Utils.EQ_0(this.distanceToPoint(t))}intersect(t){return t instanceof Ue.Point?this.contains(t)?[t]:[]:t instanceof Ue.Line?r0e(this,t):t instanceof Ue.Ray?Cat(t,this):t instanceof Ue.Segment?Kve(this,t):t instanceof Ue.Circle?$ve(this,t):t instanceof Ue.Box?function(n,o){let r=[];for(let i of o.toSegments()){let s=Kve(i,n);for(let a of s)r.push(a)}return r}(this,t):t instanceof Ue.Arc?CZ(this,t):t instanceof Ue.Polygon?yat(this,t):t instanceof Ue.Multiline?XZ(this,t):void 0}distanceTo(t){if(t instanceof Ue.Point){let[n,o]=Ue.Distance.point2segment(t,this);return o=o.reverse(),[n,o]}if(t instanceof Ue.Circle){let[n,o]=Ue.Distance.segment2circle(this,t);return[n,o]}if(t instanceof Ue.Line){let[n,o]=Ue.Distance.segment2line(this,t);return[n,o]}if(t instanceof Ue.Segment){let[n,o]=Ue.Distance.segment2segment(this,t);return[n,o]}if(t instanceof Ue.Arc){let[n,o]=Ue.Distance.segment2arc(this,t);return[n,o]}if(t instanceof Ue.Polygon){let[n,o]=Ue.Distance.shape2polygon(this,t);return[n,o]}if(t instanceof Ue.PlanarSet){let[n,o]=Ue.Distance.shape2planarSet(this,t);return[n,o]}if(t instanceof Ue.Multiline)return Ue.Distance.shape2multiline(this,t)}tangentInStart(){return new Ue.Vector(this.start,this.end).normalize()}tangentInEnd(){return new Ue.Vector(this.end,this.start).normalize()}reverse(){return new e(this.end,this.start)}split(t){return this.start.equalTo(t)?[null,this.clone()]:this.end.equalTo(t)?[this.clone(),null]:[new Ue.Segment(this.start,t),new Ue.Segment(t,this.end)]}middle(){return new Ue.Point((this.start.x+this.end.x)/2,(this.start.y+this.end.y)/2)}pointAtLength(t){if(t>this.length||t<0)return null;if(t==0)return this.start;if(t==this.length)return this.end;let n=t/this.length;return new Ue.Point((this.end.x-this.start.x)*n+this.start.x,(this.end.y-this.start.y)*n+this.start.y)}distanceToPoint(t){let[n,...o]=Ue.Distance.point2segment(t,this);return n}definiteIntegral(t=0){return(this.end.x-this.start.x)*(this.start.y-t+(this.end.y-t))/2}transform(t=new Ue.Matrix){return new e(this.ps.transform(t),this.pe.transform(t))}isZeroLength(){return this.ps.equalTo(this.pe)}sortPoints(t){return new Ue.Line(this.start,this.end).sortPoints(t)}get name(){return"segment"}svg(t={}){return`
<line x1="${this.start.x}" y1="${this.start.y}" x2="${this.end.x}" y2="${this.end.y}" ${BG(t)} />`}};Ue.segment=(...e)=>new Ue.Segment(...e);var{vector:hde}=Ue;Ue.Line=class e extends vL{constructor(...t){if(super(),this.pt=new Ue.Point,this.norm=new Ue.Vector(0,1),t.length!==0){if(t.length===1&&t[0]instanceof Object&&t[0].name==="line"){let{pt:n,norm:o}=t[0];return this.pt=new Ue.Point(n),void(this.norm=new Ue.Vector(o))}if(t.length===2){let n=t[0],o=t[1];if(n instanceof Ue.Point&&o instanceof Ue.Point)return this.pt=n,this.norm=e.points2norm(n,o),void(this.norm.dot(hde(this.pt.x,this.pt.y))>=0&&this.norm.invert());if(n instanceof Ue.Point&&o instanceof Ue.Vector){if(Ue.Utils.EQ_0(o.x)&&Ue.Utils.EQ_0(o.y))throw E0.ILLEGAL_PARAMETERS;return this.pt=n.clone(),this.norm=o.clone(),this.norm=this.norm.normalize(),void(this.norm.dot(hde(this.pt.x,this.pt.y))>=0&&this.norm.invert())}if(n instanceof Ue.Vector&&o instanceof Ue.Point){if(Ue.Utils.EQ_0(n.x)&&Ue.Utils.EQ_0(n.y))throw E0.ILLEGAL_PARAMETERS;return this.pt=o.clone(),this.norm=n.clone(),this.norm=this.norm.normalize(),void(this.norm.dot(hde(this.pt.x,this.pt.y))>=0&&this.norm.invert())}}throw E0.ILLEGAL_PARAMETERS}}clone(){return new Ue.Line(this.pt,this.norm)}get start(){}get end(){}get length(){return Number.POSITIVE_INFINITY}get box(){return new Ue.Box(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY)}get middle(){}get slope(){return new Ue.Vector(this.norm.y,-this.norm.x).slope}get standard(){return[this.norm.x,this.norm.y,this.norm.dot(hde(this.pt.x,this.pt.y))]}parallelTo(t){return Ue.Utils.EQ_0(this.norm.cross(t.norm))}incidentTo(t){return this.parallelTo(t)&&this.pt.on(t)}contains(t){if(this.pt.equalTo(t))return!0;let n=new Ue.Vector(this.pt,t);return Ue.Utils.EQ_0(this.norm.dot(n))}coord(t){return hde(t.x,t.y).cross(this.norm)}intersect(t){return t instanceof Ue.Point?this.contains(t)?[t]:[]:t instanceof Ue.Line?WZ(this,t):t instanceof Ue.Ray?jbn(t,this):t instanceof Ue.Circle?TG(this,t):t instanceof Ue.Box?xZ(this,t):t instanceof Ue.Segment?r0e(t,this):t instanceof Ue.Arc?e7e(this,t):t instanceof Ue.Polygon?i0e(this,t):t instanceof Ue.Multiline?XZ(this,t):void 0}distanceTo(t){if(t instanceof Ue.Point){let[n,o]=Ue.Distance.point2line(t,this);return o=o.reverse(),[n,o]}if(t instanceof Ue.Circle){let[n,o]=Ue.Distance.circle2line(t,this);return o=o.reverse(),[n,o]}if(t instanceof Ue.Segment){let[n,o]=Ue.Distance.segment2line(t,this);return[n,o.reverse()]}if(t instanceof Ue.Arc){let[n,o]=Ue.Distance.arc2line(t,this);return[n,o.reverse()]}if(t instanceof Ue.Polygon){let[n,o]=Ue.Distance.shape2polygon(this,t);return[n,o]}}split(t){if(t instanceof Ue.Point)return[new Ue.Ray(t,this.norm),new Ue.Ray(t,this.norm)];{let n=new Ue.Multiline([this]),o=this.sortPoints(t);return n.split(o),n.toShapes()}}rotate(t,n=new Ue.Point){return new Ue.Line(this.pt.rotate(t,n),this.norm.rotate(t))}transform(t){return new Ue.Line(this.pt.transform(t),this.norm.clone())}sortPoints(t){return t.slice().sort((n,o)=>this.coord(n)<this.coord(o)?-1:this.coord(n)>this.coord(o)?1:0)}get name(){return"line"}svg(t,n={}){let o=xZ(this,t);if(o.length===0)return"";let r=o[0],i=o.length===2?o[1]:o.find((s)=>!s.equalTo(r));return i===void 0&&(i=r),new Ue.Segment(r,i).svg(n)}static points2norm(t,n){if(t.equalTo(n))throw E0.ILLEGAL_PARAMETERS;return new Ue.Vector(t,n).normalize().rotate90CCW()}};Ue.line=(...e)=>new Ue.Line(...e);Ue.Circle=class extends vL{constructor(...e){if(super(),this.pc=new Ue.Point,this.r=1,e.length===1&&e[0]instanceof Object&&e[0].name==="circle"){let{pc:t,r:n}=e[0];this.pc=new Ue.Point(t),this.r=n}else{let[t,n]=[...e];t&&t instanceof Ue.Point&&(this.pc=t.clone()),n!==void 0&&(this.r=n)}}clone(){return new Ue.Circle(this.pc.clone(),this.r)}get center(){return this.pc}get box(){return new Ue.Box(this.pc.x-this.r,this.pc.y-this.r,this.pc.x+this.r,this.pc.y+this.r)}contains(e){return e instanceof Ue.Point?Ue.Utils.LE(e.distanceTo(this.center)[0],this.r):e instanceof Ue.Segment?Ue.Utils.LE(e.start.distanceTo(this.center)[0],this.r)&&Ue.Utils.LE(e.end.distanceTo(this.center)[0],this.r):e instanceof Ue.Arc?this.intersect(e).length===0&&Ue.Utils.LE(e.start.distanceTo(this.center)[0],this.r)&&Ue.Utils.LE(e.end.distanceTo(this.center)[0],this.r):e instanceof Ue.Circle?this.intersect(e).length===0&&Ue.Utils.LE(e.r,this.r)&&Ue.Utils.LE(e.center.distanceTo(this.center)[0],this.r):void 0}toArc(e=!0){return new Ue.Arc(this.center,this.r,Math.PI,-Math.PI,e)}scale(e,t){if(e!==t)throw E0.OPERATION_IS_NOT_SUPPORTED;if(this.pc.x!==0||this.pc.y!==0)throw E0.OPERATION_IS_NOT_SUPPORTED;return new Ue.Circle(this.pc,this.r*e)}transform(e=new Ue.Matrix){return new Ue.Circle(this.pc.transform(e),this.r)}intersect(e){return e instanceof Ue.Point?this.contains(e)?[e]:[]:e instanceof Ue.Line?TG(e,this):e instanceof Ue.Ray?Xbn(e,this):e instanceof Ue.Segment?$ve(e,this):e instanceof Ue.Circle?Fbn(e,this):e instanceof Ue.Box?function(t,n){let o=[];for(let r of n.toSegments()){let i=$ve(r,t);for(let s of i)o.push(s)}return o}(this,e):e instanceof Ue.Arc?fat(e,this):e instanceof Ue.Polygon?Gbn(this,e):e instanceof Ue.Multiline?XZ(this,e):void 0}distanceTo(e){if(e instanceof Ue.Point){let[t,n]=Ue.Distance.point2circle(e,this);return n=n.reverse(),[t,n]}if(e instanceof Ue.Circle){let[t,n]=Ue.Distance.circle2circle(this,e);return[t,n]}if(e instanceof Ue.Line){let[t,n]=Ue.Distance.circle2line(this,e);return[t,n]}if(e instanceof Ue.Segment){let[t,n]=Ue.Distance.segment2circle(e,this);return n=n.reverse(),[t,n]}if(e instanceof Ue.Arc){let[t,n]=Ue.Distance.arc2circle(e,this);return n=n.reverse(),[t,n]}if(e instanceof Ue.Polygon){let[t,n]=Ue.Distance.shape2polygon(this,e);return[t,n]}if(e instanceof Ue.PlanarSet){let[t,n]=Ue.Distance.shape2planarSet(this,e);return[t,n]}if(e instanceof Ue.Multiline){let[t,n]=Ue.Distance.shape2multiline(this,e);return[t,n]}}get name(){return"circle"}svg(e={}){return`
<circle cx="${this.pc.x}" cy="${this.pc.y}" r="${this.r}"
                ${BG({fill:"none",...e})} />`}};Ue.circle=(...e)=>new Ue.Circle(...e);Ue.Arc=class extends vL{constructor(...e){if(super(),this.pc=new Ue.Point,this.r=1,this.startAngle=0,this.endAngle=2*Math.PI,this.counterClockwise=!0,e.length!==0)if(e.length===1&&e[0]instanceof Object&&e[0].name==="arc"){let{pc:t,r:n,startAngle:o,endAngle:r,counterClockwise:i}=e[0];this.pc=new Ue.Point(t.x,t.y),this.r=n,this.startAngle=o,this.endAngle=r,this.counterClockwise=i}else{let[t,n,o,r,i]=[...e];t&&t instanceof Ue.Point&&(this.pc=t.clone()),n!==void 0&&(this.r=n),o!==void 0&&(this.startAngle=o),r!==void 0&&(this.endAngle=r),i!==void 0&&(this.counterClockwise=i)}}clone(){return new Ue.Arc(this.pc.clone(),this.r,this.startAngle,this.endAngle,this.counterClockwise)}get sweep(){let e=this.startAngle,t=this.endAngle;if(Ue.Utils.EQ(Math.abs(e-t),Ue.PIx2))return Ue.PIx2;Math.abs(e)>Ue.PIx2&&(e-=Math.trunc(e/Ue.PIx2)*Ue.PIx2),e<0&&(e+=Ue.PIx2),Math.abs(t)>Ue.PIx2&&(t-=Math.trunc(t/Ue.PIx2)*Ue.PIx2),t<0&&(t+=Ue.PIx2);let n=this.counterClockwise?t-e:e-t;return n<0&&(n+=Ue.PIx2),n}get start(){return new Ue.Point(this.pc.x+this.r,this.pc.y).rotate(this.startAngle,this.pc)}get end(){return new Ue.Point(this.pc.x+this.r,this.pc.y).rotate(this.endAngle,this.pc)}get center(){return this.pc.clone()}get vertices(){return[this.start.clone(),this.end.clone()]}get length(){return Math.abs(this.sweep*this.r)}get box(){let e=this.breakToFunctional().reduce((t,n)=>t.merge(n.start.box),new Ue.Box);return e=e.merge(this.end.box),e}contains(e){if(!Ue.Utils.EQ(this.pc.distanceTo(e)[0],this.r))return!1;if(e.equalTo(this.start))return!0;let t=new Ue.Vector(this.pc,e).slope,n=new Ue.Arc(this.pc,this.r,this.startAngle,t,this.counterClockwise);return Ue.Utils.LE(n.length,this.length)}split(e){if(this.start.equalTo(e))return[null,this.clone()];if(this.end.equalTo(e))return[this.clone(),null];let t=new Ue.Vector(this.pc,e).slope;return[new Ue.Arc(this.pc,this.r,this.startAngle,t,this.counterClockwise),new Ue.Arc(this.pc,this.r,t,this.endAngle,this.counterClockwise)]}middle(){let e=this.counterClockwise?this.startAngle+this.sweep/2:this.startAngle-this.sweep/2;return new Ue.Arc(this.pc,this.r,this.startAngle,e,this.counterClockwise).end}pointAtLength(e){if(e>this.length||e<0)return null;if(e===0)return this.start;if(e===this.length)return this.end;let t=e/this.length,n=this.counterClockwise?this.startAngle+this.sweep*t:this.startAngle-this.sweep*t;return new Ue.Arc(this.pc,this.r,this.startAngle,n,this.counterClockwise).end}chordHeight(){return(1-Math.cos(Math.abs(this.sweep/2)))*this.r}intersect(e){return e instanceof Ue.Point?this.contains(e)?[e]:[]:e instanceof Ue.Line?e7e(e,this):e instanceof Ue.Ray?bat(e,this):e instanceof Ue.Circle?fat(this,e):e instanceof Ue.Segment?CZ(e,this):e instanceof Ue.Box?function(t,n){let o=[];for(let r of n.toSegments()){let i=CZ(r,t);for(let s of i)o.push(s)}return o}(this,e):e instanceof Ue.Arc?zbn(this,e):e instanceof Ue.Polygon?xat(this,e):e instanceof Ue.Multiline?XZ(this,e):void 0}distanceTo(e){if(e instanceof Ue.Point){let[t,n]=Ue.Distance.point2arc(e,this);return n=n.reverse(),[t,n]}if(e instanceof Ue.Circle){let[t,n]=Ue.Distance.arc2circle(this,e);return[t,n]}if(e instanceof Ue.Line){let[t,n]=Ue.Distance.arc2line(this,e);return[t,n]}if(e instanceof Ue.Segment){let[t,n]=Ue.Distance.segment2arc(e,this);return n=n.reverse(),[t,n]}if(e instanceof Ue.Arc){let[t,n]=Ue.Distance.arc2arc(this,e);return[t,n]}if(e instanceof Ue.Polygon){let[t,n]=Ue.Distance.shape2polygon(this,e);return[t,n]}if(e instanceof Ue.PlanarSet){let[t,n]=Ue.Distance.shape2planarSet(this,e);return[t,n]}if(e instanceof Ue.Multiline)return Ue.Distance.shape2multiline(this,e)}breakToFunctional(){let e=[],t=[0,Math.PI/2,Math.PI,3*Math.PI/2],n=this.startAngle,o=this.endAngle;Ue.Utils.EQ(Math.abs(n-o),Ue.PIx2)&&(o=n),Math.abs(n)>Ue.PIx2&&(n-=Math.trunc(n/Ue.PIx2)*Ue.PIx2),n<0&&(n+=Ue.PIx2),Math.abs(o)>Ue.PIx2&&(o-=Math.trunc(o/Ue.PIx2)*Ue.PIx2),o<0&&(o+=Ue.PIx2);let r,i,s,a=n;this.counterClockwise?(i=Math.ceil(n/(Math.PI/2))%4,s=1):(i=Math.floor(n/(Math.PI/2))%4,s=-1);for(let c=0,l=i;c<4;c++,l=(l+s+4)%4){if(r=t[l],r===a)continue;let h=this.counterClockwise?r-n:n-r;if(h<0&&(h+=Ue.PIx2),h>this.sweep)break;e.push(new Ue.Arc(this.pc,this.r,a,r,this.counterClockwise)),a=r}return e.length===0?(e.push(this),e):(r=o,a!==r&&e.push(new Ue.Arc(this.pc,this.r,a,r,this.counterClockwise)),e)}tangentInStart(){let e=new Ue.Vector(this.pc,this.start),t=this.counterClockwise?Math.PI/2:-Math.PI/2;return e.rotate(t).normalize()}tangentInEnd(){let e=new Ue.Vector(this.pc,this.end),t=this.counterClockwise?-Math.PI/2:Math.PI/2;return e.rotate(t).normalize()}reverse(){return new Ue.Arc(this.pc,this.r,this.endAngle,this.startAngle,!this.counterClockwise)}transform(e=new Ue.Matrix){let t=this.start.transform(e),n=this.end.transform(e),o=this.pc.transform(e),r=this.counterClockwise;return e.a*e.d<0&&(r=!r),Ue.Arc.arcSE(o,t,n,r)}static arcSE(e,t,n,o){let{vector:r}=Ue,i=r(e,t).slope,s=r(e,n).slope;Ue.Utils.EQ(i,s)&&(s+=2*Math.PI,o=!0);let a=r(e,t).length;return new Ue.Arc(e,a,i,s,o)}definiteIntegral(e=0){return this.breakToFunctional().reduce((t,n)=>t+n.circularSegmentDefiniteIntegral(e),0)}circularSegmentDefiniteIntegral(e){let t=new Ue.Segment(this.start,this.end).definiteIntegral(e),n=Ue.Utils.EQ(this.sweep,Ue.PIx2)?0:this.circularSegmentArea();return this.counterClockwise?t-n:t+n}circularSegmentArea(){return 0.5*this.r*this.r*(this.sweep-Math.sin(this.sweep))}sortPoints(e){let{vector:t}=Ue;return e.slice().sort((n,o)=>{let r=t(this.pc,n).slope,i=t(this.pc,o).slope;return r<i?-1:r>i?1:0})}get name(){return"arc"}svg(e={}){let t=this.sweep<=Math.PI?"0":"1",n=this.counterClockwise?"1":"0";if(Ue.Utils.EQ(this.sweep,2*Math.PI))return new Ue.Circle(this.pc,this.r).svg(e);return`
<path d="M${this.start.x},${this.start.y}
                             A${this.r},${this.r} 0 ${t},${n} ${this.end.x},${this.end.y}"
                    ${BG({fill:"none",...e})} />`}};Ue.arc=(...e)=>new Ue.Arc(...e);Ue.Box=class e extends vL{constructor(t=void 0,n=void 0,o=void 0,r=void 0){super(),this.xmin=t,this.ymin=n,this.xmax=o,this.ymax=r}clone(){return new e(this.xmin,this.ymin,this.xmax,this.ymax)}get low(){return new Ue.Point(this.xmin,this.ymin)}get high(){return new Ue.Point(this.xmax,this.ymax)}get max(){return this.clone()}get center(){return new Ue.Point((this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)}get width(){return Math.abs(this.xmax-this.xmin)}get height(){return Math.abs(this.ymax-this.ymin)}get box(){return this.clone()}not_intersect(t){return this.xmax<t.xmin||this.xmin>t.xmax||this.ymax<t.ymin||this.ymin>t.ymax}intersect(t){return!this.not_intersect(t)}merge(t){return new e(this.xmin===void 0?t.xmin:Math.min(this.xmin,t.xmin),this.ymin===void 0?t.ymin:Math.min(this.ymin,t.ymin),this.xmax===void 0?t.xmax:Math.max(this.xmax,t.xmax),this.ymax===void 0?t.ymax:Math.max(this.ymax,t.ymax))}less_than(t){return!!this.low.lessThan(t.low)||!(!this.low.equalTo(t.low)||!this.high.lessThan(t.high))}equal_to(t){return this.low.equalTo(t.low)&&this.high.equalTo(t.high)}output(){return this.clone()}comparable_less_than(t,n){return t.lessThan(n)}set(t,n,o,r){this.xmin=t,this.ymin=n,this.xmax=o,this.ymax=r}extend(t){return t<=0?this.clone():new e(this.xmin-t,this.ymin-t,this.xmax+t,this.ymax+t)}toPoints(){return[new Ue.Point(this.xmin,this.ymin),new Ue.Point(this.xmax,this.ymin),new Ue.Point(this.xmax,this.ymax),new Ue.Point(this.xmin,this.ymax)]}toSegments(){let t=this.toPoints();return[new Ue.Segment(t[0],t[1]),new Ue.Segment(t[1],t[2]),new Ue.Segment(t[2],t[3]),new Ue.Segment(t[3],t[0])]}rotate(t,n=new Ue.Point){throw E0.OPERATION_IS_NOT_SUPPORTED}transform(t=new Ue.Matrix){return this.toPoints().map((n)=>n.transform(t)).reduce((n,o)=>n.merge(o.box),new e)}contains(t){return t instanceof Ue.Point?t.x>=this.xmin&&t.x<=this.xmax&&t.y>=this.ymin&&t.y<=this.ymax:t instanceof Ue.Segment?t.vertices.every((n)=>this.contains(n)):t instanceof Ue.Box?t.toSegments().every((n)=>this.contains(n)):t instanceof Ue.Circle?this.contains(t.box):t instanceof Ue.Arc?t.vertices.every((n)=>this.contains(n))&&this.toSegments().every((n)=>CZ(n,t).length===0):!(t instanceof Ue.Line||t instanceof Ue.Ray)&&(t instanceof Ue.Multiline?t.toShapes().every((n)=>this.contains(n)):t instanceof Ue.Polygon?this.contains(t.box):void 0)}distanceTo(t){let n=this.toSegments().map((r)=>r.distanceTo(t)),o=[Number.MAX_SAFE_INTEGER,null];return n.forEach((r)=>{r[0]<o[0]&&(o=r)}),o}get name(){return"box"}svg(t={}){let n=this.xmax-this.xmin,o=this.ymax-this.ymin;return`
<rect x="${this.xmin}" y="${this.ymin}" width="${n}" height="${o}"
                ${BG({fill:"none",...t})} />`}};Ue.box=(...e)=>new Ue.Box(...e);Ue.Edge=class{constructor(e){this.shape=e,this.next=void 0,this.prev=void 0,this.face=void 0,this.arc_length=0,this.bvStart=void 0,this.bvEnd=void 0,this.bv=void 0,this.overlap=void 0}get start(){return this.shape.start}get end(){return this.shape.end}get length(){return this.shape.length}get box(){return this.shape.box}get isSegment(){return this.shape instanceof Ue.Segment}get isArc(){return this.shape instanceof Ue.Arc}get isLine(){return this.shape instanceof Ue.Line}get isRay(){return this.shape instanceof Ue.Ray}middle(){return this.shape.middle()}pointAtLength(e){return this.shape.pointAtLength(e)}contains(e){return this.shape.contains(e)}setInclusion(e){if(this.bv!==void 0)return this.bv;if(this.shape instanceof Ue.Line||this.shape instanceof Ue.Ray)return this.bv=Ue.OUTSIDE,this.bv;if(this.bvStart===void 0&&(this.bvStart=Ude(e,this.start)),this.bvEnd===void 0&&(this.bvEnd=Ude(e,this.end)),this.bvStart===Ue.OUTSIDE||this.bvEnd==Ue.OUTSIDE)this.bv=Ue.OUTSIDE;else if(this.bvStart===Ue.INSIDE||this.bvEnd==Ue.INSIDE)this.bv=Ue.INSIDE;else{let t=Ude(e,this.middle());this.bv=t}return this.bv}setOverlap(e){let t,n=this.shape,o=e.shape;n instanceof Ue.Segment&&o instanceof Ue.Segment?n.start.equalTo(o.start)&&n.end.equalTo(o.end)?t=Ue.OVERLAP_SAME:n.start.equalTo(o.end)&&n.end.equalTo(o.start)&&(t=Ue.OVERLAP_OPPOSITE):(n instanceof Ue.Arc&&o instanceof Ue.Arc||n instanceof Ue.Segment&&o instanceof Ue.Arc||n instanceof Ue.Arc&&o instanceof Ue.Segment)&&(n.start.equalTo(o.start)&&n.end.equalTo(o.end)&&n.middle().equalTo(o.middle())?t=Ue.OVERLAP_SAME:n.start.equalTo(o.end)&&n.end.equalTo(o.start)&&n.middle().equalTo(o.middle())&&(t=Ue.OVERLAP_OPPOSITE)),this.overlap===void 0&&(this.overlap=t),e.overlap===void 0&&(e.overlap=t)}svg(){if(this.shape instanceof Ue.Segment)return` L${this.shape.end.x},${this.shape.end.y}`;if(this.shape instanceof Ue.Arc){let e,t=this.shape,n=t.counterClockwise?"1":"0";if(Ue.Utils.EQ(t.sweep,2*Math.PI)){let o=t.counterClockwise?1:-1,r=new Ue.Arc(t.pc,t.r,t.startAngle,t.startAngle+o*Math.PI,t.counterClockwise),i=new Ue.Arc(t.pc,t.r,t.startAngle+o*Math.PI,t.endAngle,t.counterClockwise);return e="0",` A${r.r},${r.r} 0 ${e},${n} ${r.end.x},${r.end.y}
                    A${i.r},${i.r} 0 ${e},${n} ${i.end.x},${i.end.y}`}return e=t.sweep<=Math.PI?"0":"1",` A${t.r},${t.r} 0 ${e},${n} ${t.end.x},${t.end.y}`}}toJSON(){return this.shape.toJSON()}};var A$r=class extends Aat{constructor(e,t){super(e,t),this.setCircularLinks()}setCircularLinks(){this.isEmpty()||(this.last.next=this.first,this.first.prev=this.last)}[Symbol.iterator](){let e;return{next:()=>{let t=e||this.first,n=!this.first||!!e&&e===this.first;return e=t?t.next:void 0,{value:t,done:n}}}}append(e){return super.append(e),this.setCircularLinks(),this}insert(e,t){return super.insert(e,t),this.setCircularLinks(),this}remove(e){return super.remove(e),this}};Ue.Face=class e extends A$r{constructor(t,...n){if(super(),this._box=void 0,this._orientation=void 0,n.length!==0){if(n.length===1){if(n[0]instanceof Array){let o=n[0];if(o.length===0)return;if(o.every((r)=>r instanceof Ue.Point)){let r=e.points2segments(o);this.shapes2face(t.edges,r)}else if(o.every((r)=>r instanceof Array&&r.length===2)){let r=o.map((s)=>new Ue.Point(s[0],s[1])),i=e.points2segments(r);this.shapes2face(t.edges,i)}else if(o.every((r)=>r instanceof Ue.Segment||r instanceof Ue.Arc))this.shapes2face(t.edges,o);else if(o.every((r)=>r.name==="segment"||r.name==="arc")){let r=[];for(let i of o){let s;s=i.name==="segment"?new Ue.Segment(i):new Ue.Arc(i),r.push(s)}this.shapes2face(t.edges,r)}}else if(n[0]instanceof e){let o=n[0];this.first=o.first,this.last=o.last;for(let r of o)t.edges.add(r)}else if(n[0]instanceof Ue.Circle)this.shapes2face(t.edges,[n[0].toArc(Rbn)]);else if(n[0]instanceof Ue.Box){let o=n[0];this.shapes2face(t.edges,[new Ue.Segment(new Ue.Point(o.xmin,o.ymin),new Ue.Point(o.xmax,o.ymin)),new Ue.Segment(new Ue.Point(o.xmax,o.ymin),new Ue.Point(o.xmax,o.ymax)),new Ue.Segment(new Ue.Point(o.xmax,o.ymax),new Ue.Point(o.xmin,o.ymax)),new Ue.Segment(new Ue.Point(o.xmin,o.ymax),new Ue.Point(o.xmin,o.ymin))])}}n.length===2&&n[0]instanceof Ue.Edge&&n[1]instanceof Ue.Edge&&(this.first=n[0],this.last=n[1],this.last.next=this.first,this.first.prev=this.last,this.setArcLength())}}get edges(){return this.toArray()}get vertices(){return this.edges.map((t)=>t.shape.start.clone())}get shapes(){return this.edges.map((t)=>t.shape.clone())}get box(){if(this._box===void 0){let t=new Ue.Box;for(let n of this)t=t.merge(n.box);this._box=t}return this._box}get perimeter(){return this.last.arc_length+this.last.length}pointAtLength(t){if(t>this.perimeter||t<0)return null;let n=null;for(let o of this)if(t>=o.arc_length&&(o===this.last||t<o.next.arc_length)){n=o.pointAtLength(t-o.arc_length);break}return n}static points2segments(t){let n=[];for(let o=0;o<t.length;o++)t[o].equalTo(t[(o+1)%t.length])||n.push(new Ue.Segment(t[o],t[(o+1)%t.length]));return n}shapes2face(t,n){for(let o of n){let r=new Ue.Edge(o);this.append(r),t.add(r)}}append(t){return super.append(t),this.setOneEdgeArcLength(t),t.face=this,this}insert(t,n){return super.insert(t,n),this.setOneEdgeArcLength(t),t.face=this,this}remove(t){return super.remove(t),this.setArcLength(),this}merge_with_next_edge(t){return t.shape.end.x=t.next.shape.end.x,t.shape.end.y=t.next.shape.end.y,this.remove(t.next),this}reverse(){let t=[],n=this.last;do n.shape=n.shape.reverse(),t.push(n),n=n.prev;while(n!==this.last);this.first=void 0,this.last=void 0;for(let o of t)this.first===void 0?(o.prev=o,o.next=o,this.first=o,this.last=o):(o.prev=this.last,this.last.next=o,this.last=o,this.last.next=this.first,this.first.prev=this.last),this.setOneEdgeArcLength(o);this._orientation!==void 0&&(this._orientation=void 0,this._orientation=this.orientation())}setArcLength(){for(let t of this)this.setOneEdgeArcLength(t),t.face=this}setOneEdgeArcLength(t){t===this.first?t.arc_length=0:t.arc_length=t.prev.arc_length+t.prev.length}area(){return Math.abs(this.signedArea())}signedArea(){let t=0,n=this.box.ymin;for(let o of this)t+=o.shape.definiteIntegral(n);return t}orientation(){if(this._orientation===void 0){let t=this.signedArea();Ue.Utils.EQ_0(t)?this._orientation=Gde.NOT_ORIENTABLE:Ue.Utils.LT(t,0)?this._orientation=Gde.CCW:this._orientation=Gde.CW}return this._orientation}isSimple(t){return e.getSelfIntersections(this,t,!0).length===0}static getSelfIntersections(t,n,o=!1){let r=[];for(let i of t){let s=n.search(i.box);for(let a of s){if(i===a)continue;if(a.face!==t)continue;if(i.shape instanceof Ue.Segment&&a.shape instanceof Ue.Segment&&(i.next===a||i.prev===a))continue;let c=i.shape.intersect(a.shape);for(let l of c)if((!l.equalTo(i.start)||!l.equalTo(a.end)||a!==i.prev)&&(!l.equalTo(i.end)||!l.equalTo(a.start)||a!==i.next)&&(r.push(l),o))break;if(r.length>0&&o)break}if(r.length>0&&o)break}return r}findEdgeByPoint(t){let n;for(let o of this)if(!t.equalTo(o.shape.start)&&(t.equalTo(o.shape.end)||o.shape.contains(t))){n=o;break}return n}toPolygon(){return new Ue.Polygon(this.shapes)}toJSON(){return this.edges.map((t)=>t.toJSON())}svg(){let t=`M${this.first.start.x},${this.first.start.y}`;for(let n of this)t+=n.svg();return t+=" z",t}};Ue.Ray=class e extends vL{constructor(...t){if(super(),this.pt=new Ue.Point,this.norm=new Ue.Vector(0,1),t.length!==0&&(t.length>=1&&t[0]instanceof Ue.Point&&(this.pt=t[0].clone()),t.length!==1)){if(!(t.length===2&&t[1]instanceof Ue.Vector))throw E0.ILLEGAL_PARAMETERS;this.norm=t[1].clone()}}clone(){return new e(this.pt,this.norm)}get slope(){return new Ue.Vector(this.norm.y,-this.norm.x).slope}get box(){let t=this.slope;return new Ue.Box(t>Math.PI/2&&t<3*Math.PI/2?Number.NEGATIVE_INFINITY:this.pt.x,t>=0&&t<=Math.PI?this.pt.y:Number.NEGATIVE_INFINITY,t>=Math.PI/2&&t<=3*Math.PI/2?this.pt.x:Number.POSITIVE_INFINITY,t>=Math.PI&&t<=2*Math.PI||t===0?this.pt.y:Number.POSITIVE_INFINITY)}get start(){return this.pt}get end(){}get length(){return Number.POSITIVE_INFINITY}contains(t){if(this.pt.equalTo(t))return!0;let n=new Ue.Vector(this.pt,t);return Ue.Utils.EQ_0(this.norm.dot(n))&&Ue.Utils.GE(n.cross(this.norm),0)}coord(t){return o6n(t.x,t.y).cross(this.norm)}split(t){return this.contains(t)?this.pt.equalTo(t)?[this]:[new Ue.Segment(this.pt,t),new Ue.Ray(t,this.norm)]:[]}intersect(t){return t instanceof Ue.Point?this.contains(t)?[t]:[]:t instanceof Ue.Segment?Cat(this,t):t instanceof Ue.Arc?bat(this,t):t instanceof Ue.Line?jbn(this,t):t instanceof Ue.Ray?(o=t,WZ(aL(n=this),aL(o)).filter((r)=>n.contains(r)).filter((r)=>o.contains(r))):t instanceof Ue.Circle?Xbn(this,t):t instanceof Ue.Box?function(r,i){return xZ(aL(r),i).filter((s)=>r.contains(s))}(this,t):t instanceof Ue.Polygon?Kbn(this,t):t instanceof Ue.Multiline?XZ(this,t):void 0;var n,o}rotate(t,n=new Ue.Point){return new Ue.Ray(this.pt.rotate(t,n),this.norm.rotate(t))}transform(t){return new Ue.Ray(this.pt.transform(t),this.norm.clone())}get name(){return"ray"}svg(t,n={}){let o=xZ(new Ue.Line(this.pt,this.norm),t);return o=o.filter((r)=>this.contains(r)),o.length===0||o.length===2?"":new Ue.Segment(this.pt,o[0]).svg(n)}};Ue.ray=(...e)=>new Ue.Ray(...e);Ue.Polygon=class e{constructor(){this.faces=new Ue.PlanarSet,this.edges=new Ue.PlanarSet;let t=[...arguments];if(t.length===1&&(t[0]instanceof Array&&t[0].length>0||t[0]instanceof Ue.Circle||t[0]instanceof Ue.Box)){let n=t[0];if(t[0]instanceof Array&&t[0].every((o)=>o instanceof Array))if(n.every((o)=>o instanceof Array&&o.length===2&&typeof o[0]=="number"&&typeof o[1]=="number"))this.faces.add(new Ue.Face(this,n));else for(let o of n)if(o instanceof Array&&o[0]instanceof Array&&o[0].every((r)=>r instanceof Array&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"))for(let r of o)this.faces.add(new Ue.Face(this,r));else this.faces.add(new Ue.Face(this,o));else this.faces.add(new Ue.Face(this,n))}}get box(){return[...this.faces].reduce((t,n)=>t.merge(n.box),new Ue.Box)}get vertices(){return[...this.faces].flatMap((t)=>t.vertices)}clone(){let t=new e;for(let n of this.faces)t.addFace(n.shapes);return t}createFromArray(t){let n=new e;return t.forEach((o)=>[...o.faces].forEach((r)=>n.addFace(r.shapes))),n}isEmpty(){return this.edges.size===0||this.faces.size===0}isValid(){let t=!0;for(let n of this.faces)if(!n.isSimple(this.edges)){t=!1;break}return t}area(){let t=[...this.faces].reduce((n,o)=>n+o.signedArea(),0);return Math.abs(t)}addFace(...t){let n=new Ue.Face(this,...t);return this.faces.add(n),n}deleteFace(t){for(let n of t)this.edges.delete(n);return this.faces.delete(t)}recreateFaces(){this.faces.clear();for(let o of this.edges)o.face=null;let t,n=!0;for(;n;){n=!1;for(let o of this.edges)if(o.face===null){t=o,n=!0;break}if(n){let o=t;do o=o.next;while(o.next!==t);this.addFace(t,o)}}}removeChain(t,n,o){if(o.next!==n){for(let r=n;r!==o.next;r=r.next)if(t.remove(r),this.edges.delete(r),t.isEmpty()){this.deleteFace(t);break}}else this.deleteFace(t)}addVertex(t,n){let o=n.shape.split(t);if(o[0]===null)return n.prev;if(o[1]===null)return n;let r=new Ue.Edge(o[0]),i=n.prev;return n.face.insert(r,i),this.edges.delete(n),this.edges.add(r),n.shape=o[1],this.edges.add(n),r}removeEndVertex(t){let n=t.next;n!==t&&(t.face.merge_with_next_edge(t),this.edges.delete(n))}cut(t){let n=this.splitToIslands().flatMap((o)=>o._cutSingleIsland(t)).filter((o)=>o.isValid()&&o.isEmpty()===!1);return this.createFromArray(n)}_cutSingleIsland(t){let n=this.clone(),o=t.clone(),r,i,s={int_points1:[],int_points2:[],int_points1_sorted:[],int_points2_sorted:[]};for(let a of o.edges)for(let c of n.edges){let l=Ubn(a,c);for(let h of l)bZ(a,h,s.int_points1),bZ(c,h,s.int_points2)}if(s.int_points1.length===0)return n;s.int_points1_sorted=Gk(s.int_points1),s.int_points2_sorted=Gk(s.int_points2),vZ(o,s.int_points1_sorted),vZ(n,s.int_points2_sorted),Iat(s),s.int_points1_sorted=Gk(s.int_points1),s.int_points2_sorted=Gk(s.int_points2),git(s.int_points1),Ait(s.int_points1,n);for(let a of s.int_points1_sorted)a.edge_before&&a.edge_after&&a.edge_before.bv===a.edge_after.bv&&(s.int_points2[a.id]=-1,a.id=-1);if(s.int_points1=s.int_points1.filter((a)=>a.id>=0),s.int_points2=s.int_points2.filter((a)=>a.id>=0),s.int_points1.forEach((a,c)=>{a.id=c}),s.int_points2.forEach((a,c)=>{a.id=c}),s.int_points1.length===0)return n;s.int_points1_sorted=Gk(s.int_points1),s.int_points2_sorted=Gk(s.int_points2);for(let a=1;a<s.int_points1_sorted.length;a++)if(i=s.int_points1_sorted[a],r=s.int_points1_sorted[a-1],i.edge_before&&i.edge_before.bv===1){let c=r.edge_after,l=i.edge_before,h=o.getChain(c,l);H2n(s.int_points2[r.id],s.int_points2[i.id],h),h.forEach((d)=>n.edges.add(d)),h=h.reverse().map((d)=>new Ue.Edge(d.shape.reverse()));for(let d=0;d<h.length-1;d++)h[d].next=h[d+1],h[d+1].prev=h[d];H2n(s.int_points2[i.id],s.int_points2[r.id],h),h.forEach((d)=>n.edges.add(d))}return n.recreateFaces(),n}cutWithLine(t){let n=new cG([t]);return this.cut(n)}findEdgeByPoint(t){let n;for(let o of this.faces)if(n=o.findEdgeByPoint(t),n!==void 0)break;return n}splitToIslands(){if(this.isEmpty())return[];let t=this.toArray();t.sort((r,i)=>i.area()-r.area());let n=[...t[0].faces][0].orientation(),o=t.filter((r)=>[...r.faces][0].orientation()===n);for(let r of t){let i=[...r.faces][0];if(i.orientation()!==n){for(let s of o)if(i.shapes.every((a)=>s.contains(a))){s.addFace(i.shapes);break}}}return o}rearrange(){if(this.faces.size<=1)return this.clone();let t=this.splitToIslands(),n=new e;return t.forEach((o)=>{o.faces.forEach((r)=>n.addFace(r.shapes))}),n}orientation(){return this.isEmpty()?Gde.NOT_ORIENTABLE:[...this.faces][0].orientation()}isOuter(t){return t.orientation()===this.orientation()}isMultiPolygon(){let t=0;return this.faces.forEach((n)=>{this.isOuter(n)&&t++}),t>1}reverse(){for(let t of this.faces)t.reverse();return this}contains(t){if(t instanceof Ue.Point){let n=Ude(this,t);return n===1||n===2}return n6n(this,t)}distanceTo(t){if(t instanceof Ue.Point){let[n,o]=Ue.Distance.point2polygon(t,this);return o=o.reverse(),[n,o]}if(t instanceof Ue.Circle||t instanceof Ue.Line||t instanceof Ue.Segment||t instanceof Ue.Arc){let[n,o]=Ue.Distance.shape2polygon(t,this);return o=o.reverse(),[n,o]}if(t instanceof Ue.Polygon){let n,o,r=[Number.POSITIVE_INFINITY,new Ue.Segment];for(let i of this.edges){let s=r[0];[n,o]=Ue.Distance.shape2planarSet(i.shape,t.edges,s),Ue.Utils.LT(n,s)&&(r=[n,o])}return r}}intersect(t){return t instanceof Ue.Point?this.contains(t)?[t]:[]:t instanceof Ue.Line?i0e(t,this):t instanceof Ue.Ray?Kbn(t,this):t instanceof Ue.Circle?Gbn(t,this):t instanceof Ue.Segment?yat(t,this):t instanceof Ue.Arc?xat(t,this):t instanceof Ue.Polygon?function(n,o){let r=[];if(n.isEmpty()||o.isEmpty())return r;if(n.box.not_intersect(o.box))return r;for(let i of n.edges)r=[...r,...L2n(i,o)];return r}(t,this):t instanceof Ue.Multiline?function(n,o){let r=[];if(o.isEmpty()||n.size===0)return r;for(let i of n)r=[...r,...L2n(i,o)];return r}(t,this):void 0}translate(t){let n=new e;for(let o of this.faces)n.addFace(o.shapes.map((r)=>r.translate(t)));return n}rotate(t=0,n=new Ue.Point){let o=new e;for(let r of this.faces)o.addFace(r.shapes.map((i)=>i.rotate(t,n)));return o}scale(t,n){let o=new e;for(let r of this.faces)o.addFace(r.shapes.map((i)=>i.scale(t,n)));return o}transform(t=new Ue.Matrix){let n=new e;for(let o of this.faces)n.addFace(o.shapes.map((r)=>r.transform(t)));return n}toJSON(){return[...this.faces].map((t)=>t.toJSON())}toArray(){return[...this.faces].map((t)=>t.toPolygon())}dpath(){return[...this.faces].reduce((t,n)=>t+n.svg(),"")}svg(t={}){let n=`
<path ${BG({fillRule:"evenodd",fill:"lightcyan",...t})} d="`;for(let o of this.faces)n+=`
${o.svg()}`;return n+=`" >
</path>`,n}};Ue.polygon=(...e)=>new Ue.Polygon(...e);var{Circle:yot,Line:X2n,Point:j2n,Vector:A9e,Utils:xot}=Ue;Ue.Inversion=class e{constructor(t){this.circle=t}get inversion_circle(){return this.circle}static inversePoint(t,n){let o=new A9e(t.pc,n),r=t.r*t.r,i=o.dot(o);return xot.EQ_0(i)?new j2n(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY):t.pc.translate(o.multiply(r/i))}static inverseCircle(t,n){let o=t.pc.distanceTo(n.pc)[0];if(xot.EQ(o,n.r)){let r=t.r*t.r/(2*n.r),i=new A9e(t.pc,n.pc);i=i.normalize();let s=t.pc.translate(i.multiply(r));return new X2n(s,i)}{let r=new A9e(t.pc,n.pc),i=t.r*t.r/(r.dot(r)-n.r*n.r),s=t.pc.translate(r.multiply(i)),a=Math.abs(i)*n.r;return new yot(s,a)}}static inverseLine(t,n){let[o,r]=t.pc.distanceTo(n);if(xot.EQ_0(o))return n.clone();{let i=t.r*t.r/(2*o),s=new A9e(t.pc,r.end);return s=s.multiply(i/o),new yot(t.pc.translate(s),i)}}inverse(t){return t instanceof j2n?e.inversePoint(this.circle,t):t instanceof yot?e.inverseCircle(this.circle,t):t instanceof X2n?e.inverseLine(this.circle,t):void 0}};Ue.inversion=(e)=>new Ue.Inversion(e);Ue.Distance=class e{static point2point(t,n){return t.distanceTo(n)}static point2line(t,n){let o=t.projectionOn(n);return[new Ue.Vector(t,o).length,new Ue.Segment(t,o)]}static point2circle(t,n){let[o,r]=t.distanceTo(n.center);if(Ue.Utils.EQ_0(o))return[n.r,new Ue.Segment(t,n.toArc().start)];{let i=Math.abs(o-n.r),s=new Ue.Vector(n.pc,t).normalize().multiply(n.r),a=n.pc.translate(s);return[i,new Ue.Segment(t,a)]}}static point2segment(t,n){if(n.start.equalTo(n.end))return e.point2point(t,n.start);let o,r,i=new Ue.Vector(n.start,n.end),s=new Ue.Vector(n.start,t),a=new Ue.Vector(n.end,t),c=i.dot(s),l=-i.dot(a);if(Ue.Utils.GE(c,0)&&Ue.Utils.GE(l,0)){let h=n.tangentInStart();return o=Math.abs(h.cross(s)),r=n.start.translate(h.multiply(h.dot(s))),[o,new Ue.Segment(t,r)]}return c<0?t.distanceTo(n.start):t.distanceTo(n.end)}static point2arc(t,n){let o,r,i=new Ue.Circle(n.pc,n.r),s=[];return[o,r]=e.point2circle(t,i),r.end.on(n)&&s.push(e.point2circle(t,i)),s.push(e.point2point(t,n.start)),s.push(e.point2point(t,n.end)),e.sort(s),s[0]}static point2edge(t,n){return n.shape instanceof Ue.Segment?e.point2segment(t,n.shape):e.point2arc(t,n.shape)}static segment2line(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Ue.Segment(o[0],o[0])];let r=[];return r.push(e.point2line(t.start,n)),r.push(e.point2line(t.end,n)),e.sort(r),r[0]}static segment2segment(t,n){let o=Kve(t,n);if(o.length>0)return[0,new Ue.Segment(o[0],o[0])];let r,i,s=[];return[r,i]=e.point2segment(n.start,t),s.push([r,i.reverse()]),[r,i]=e.point2segment(n.end,t),s.push([r,i.reverse()]),s.push(e.point2segment(t.start,n)),s.push(e.point2segment(t.end,n)),e.sort(s),s[0]}static segment2circle(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Ue.Segment(o[0],o[0])];let r=new Ue.Line(t.ps,t.pe),[i,s]=e.point2line(n.center,r);if(Ue.Utils.GE(i,n.r)&&s.end.on(t))return e.point2circle(s.end,n);{let[a,c]=e.point2circle(t.start,n),[l,h]=e.point2circle(t.end,n);return Ue.Utils.LT(a,l)?[a,c]:[l,h]}}static segment2arc(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Ue.Segment(o[0],o[0])];let r=new Ue.Line(t.ps,t.pe),i=new Ue.Circle(n.pc,n.r),[s,a]=e.point2line(i.center,r);if(Ue.Utils.GE(s,i.r)&&a.end.on(t)){let[d,u]=e.point2circle(a.end,i);if(u.end.on(n))return[d,u]}let c,l,h=[];return h.push(e.point2arc(t.start,n)),h.push(e.point2arc(t.end,n)),[c,l]=e.point2segment(n.start,t),h.push([c,l.reverse()]),[c,l]=e.point2segment(n.end,t),h.push([c,l.reverse()]),e.sort(h),h[0]}static circle2circle(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Ue.Segment(o[0],o[0])];if(t.center.equalTo(n.center)){let r=t.toArc(),i=n.toArc();return e.point2point(r.start,i.start)}{let r=new Ue.Line(t.center,n.center),i=r.intersect(t),s=r.intersect(n),a=[];return a.push(e.point2point(i[0],s[0])),a.push(e.point2point(i[0],s[1])),a.push(e.point2point(i[1],s[0])),a.push(e.point2point(i[1],s[1])),e.sort(a),a[0]}}static circle2line(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Ue.Segment(o[0],o[0])];let[r,i]=e.point2line(t.center,n),[s,a]=e.point2circle(i.end,t);return a=a.reverse(),[s,a]}static arc2line(t,n){let o=n.intersect(t);if(o.length>0)return[0,new Ue.Segment(o[0],o[0])];let r=new Ue.Circle(t.center,t.r),[i,s]=e.point2line(r.center,n);if(!Ue.Utils.GE(i,r.r)){let a=[];return a.push(e.point2line(t.start,n)),a.push(e.point2line(t.end,n)),e.sort(a),a[0]}{let[a,c]=e.point2circle(s.end,r);if(c.end.on(t))return[a,c]}}static arc2circle(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Ue.Segment(o[0],o[0])];let r=new Ue.Circle(t.center,t.r),[i,s]=e.circle2circle(r,n);if(s.start.on(t))return[i,s];{let a=[];return a.push(e.point2circle(t.start,n)),a.push(e.point2circle(t.end,n)),e.sort(a),a[0]}}static arc2arc(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Ue.Segment(o[0],o[0])];let r=new Ue.Circle(t.center,t.r),i=new Ue.Circle(n.center,n.r),[s,a]=e.circle2circle(r,i);if(a.start.on(t)&&a.end.on(n))return[s,a];{let c,l,h=[];return[c,l]=e.point2arc(t.start,n),l.end.on(n)&&h.push([c,l]),[c,l]=e.point2arc(t.end,n),l.end.on(n)&&h.push([c,l]),[c,l]=e.point2arc(n.start,t),l.end.on(t)&&h.push([c,l.reverse()]),[c,l]=e.point2arc(n.end,t),l.end.on(t)&&h.push([c,l.reverse()]),[c,l]=e.point2point(t.start,n.start),h.push([c,l]),[c,l]=e.point2point(t.start,n.end),h.push([c,l]),[c,l]=e.point2point(t.end,n.start),h.push([c,l]),[c,l]=e.point2point(t.end,n.end),h.push([c,l]),e.sort(h),h[0]}}static point2polygon(t,n){let o=[Number.POSITIVE_INFINITY,new Ue.Segment];for(let r of n.edges){let[i,s]=e.point2edge(t,r);Ue.Utils.LT(i,o[0])&&(o=[i,s])}return o}static shape2polygon(t,n){let o=[Number.POSITIVE_INFINITY,new Ue.Segment];for(let r of n.edges){let[i,s]=t.distanceTo(r.shape);Ue.Utils.LT(i,o[0])&&(o=[i,s])}return o}static polygon2polygon(t,n){let o=[Number.POSITIVE_INFINITY,new Ue.Segment];for(let r of t.edges)for(let i of n.edges){let[s,a]=r.shape.distanceTo(i.shape);Ue.Utils.LT(s,o[0])&&(o=[s,a])}return o}static box2box_minmax(t,n){let o=Math.max(Math.max(t.xmin-n.xmax,0),Math.max(n.xmin-t.xmax,0)),r=Math.max(Math.max(t.ymin-n.ymax,0),Math.max(n.ymin-t.ymax,0)),i=o*o+r*r,s=t.merge(n),a=s.xmax-s.xmin,c=s.ymax-s.ymin;return[i,a*a+c*c]}static minmax_tree_process_level(t,n,o,r){let i,s;for(let c of n){[i,s]=e.box2box_minmax(t.box,c.item.key);for(let l of c.item.values)l instanceof Ue.Edge?r.insert([i,s],l.shape):r.insert([i,s],l);Ue.Utils.LT(s,o)&&(o=s)}if(n.length===0)return o;let a=[...n.map((c)=>c.left.isNil()?void 0:c.left).filter((c)=>c!==void 0),...n.map((c)=>c.right.isNil()?void 0:c.right).filter((c)=>c!==void 0)].filter((c)=>{let[l,h]=e.box2box_minmax(t.box,c.max);return Ue.Utils.LE(l,o)});return o=e.minmax_tree_process_level(t,a,o,r)}static minmax_tree(t,n,o){let r=new Iit,i=[n.index.root],s=o<Number.POSITIVE_INFINITY?o*o:Number.POSITIVE_INFINITY;return s=e.minmax_tree_process_level(t,i,s,r),r}static minmax_tree_calc_distance(t,n,o){let r,i;if(n!=null&&!n.isNil()){if([r,i]=e.minmax_tree_calc_distance(t,n.left,o),i)return[r,i];if(Ue.Utils.LT(r[0],Math.sqrt(n.item.key.low)))return[r,!0];let[s,a]=e.distanceToArray(t,n.item.values);return Ue.Utils.LT(s,r[0])&&(r=[s,a]),[r,i]=e.minmax_tree_calc_distance(t,n.right,r),[r,i]}return[o,!1]}static shape2planarSet(t,n,o=Number.POSITIVE_INFINITY){let r=[o,new Ue.Segment],i=!1;if(n instanceof Ue.PlanarSet){let s=e.minmax_tree(t,n,o);[r,i]=e.minmax_tree_calc_distance(t,s.root,r)}return r}static sort(t){t.sort((n,o)=>Ue.Utils.LT(n[0],o[0])?-1:Ue.Utils.GT(n[0],o[0])?1:0)}static distance(t,n){return t.distanceTo(n)}static distanceToArray(t,n){let o=[Number.POSITIVE_INFINITY,new Ue.Segment];for(let r of n){let[i,s]=t.distanceTo(r);Ue.Utils.LT(i,o[0])&&(o=[i,s])}return o}static shape2multiline(t,n){let o=[Number.POSITIVE_INFINITY,new Ue.Segment];for(let r of n){let[i,s]=e.distance(t,r.shape);Ue.Utils.LT(i,o[0])&&(o=[i,s])}return o}static multiline2multiline(t,n){let o=[Number.POSITIVE_INFINITY,new Ue.Segment];for(let r of t)for(let i of n){let[s,a]=e.distance(r.shape,i.shape);Ue.Utils.LT(s,o[0])&&(o=[s,a])}return o}};var{Multiline:f$r,Point:r6n,Segment:y$r,Polygon:i6n}=Ue;function vit(e){return new r6n(e.split(" ").map(Number))}function s6n(e){return e.split(", ").map(vit)}function Cot(e){let t=s6n(e),n=[];for(let o=0;o<t.length-1;o++)n.push(new y$r(t[o],t[o+1]));return new f$r(n)}function K2n(e){let t=e.replace(/\(\(/,"").replace(/\)\)$/,"").split("), ("),n=new i6n,o;return t.forEach((r,i)=>{let s=r.split(", ").map((c)=>new r6n(c.split(" ").map(Number))),a=n.addFace(s);i===0?o=a.orientation():a.orientation()===o&&a.reverse()}),n}function x$r(e){if(e.startsWith("POLYGON"))return K2n(e.replace(/^POLYGON /,""));return function(t){let n=t.split(/\)\), \(\(/).map((r)=>"(("+r+"))").map(K2n),o=new i6n;return n.reduce((r,i)=>[...r,...i?.faces],[]).forEach((r)=>o.addFace([...r?.shapes])),o}(e.replace(/^MULTIPOLYGON \(\(\((.*)\)\)\)$/,"$1"))}function $2n(e){return e.split(`
`)?.every((t)=>t.includes("POINT"))}function q2n(e){return e.split(`
`)?.every((t)=>t.includes("LINESTRING"))}Ue.isWktString=function(e){return e.startsWith("POINT")||$2n(e)||e.startsWith("LINESTRING")||q2n(e)||e.startsWith("MULTILINESTRING")||e.startsWith("POLYGON")||e.startsWith("MULTIPOINT")||e.startsWith("MULTIPOLYGON")||e.startsWith("GEOMETRYCOLLECTION")},Ue.parseWKT=function e(t){if(t.startsWith("POINT"))return vit(t.replace(/^POINT \(/,"").replace(/\)$/,""));if(t.startsWith("MULTIPOINT"))return s6n(t.replace(/^MULTIPOINT \(/,"").replace(/\)$/,""));if(t.startsWith("LINESTRING"))return Cot(t.replace(/^LINESTRING \(/,"").replace(/\)$/,""));if(t.startsWith("MULTILINESTRING"))return function(n){return n.replace(/\(\(/,"").replace(/\)\)$/,"").split("), (").map(Cot)}(t.replace(/^MULTILINESTRING /,""));if(t.startsWith("POLYGON")||t.startsWith("MULTIPOLYGON"))return x$r(t);if(t.startsWith("GEOMETRYCOLLECTION")){let n=/(?<type>POINT|LINESTRING|POLYGON|MULTIPOINT|MULTILINESTRING|MULTIPOLYGON) \((?:[^\(\)]|\([^\)]*\))*\)/g,o=t.match(n);return o[0].startsWith("GEOMETRYCOLLECTION")&&(o[0]=o[0].replace("GEOMETRYCOLLECTION (","")),o.map(e).map((r)=>r instanceof Array?r:[r]).reduce((r,i)=>[...r,...i],[])}return $2n(t)?function(n){return n.split(`
`).map((o)=>o.match(/\(([^)]+)\)/)[1]).map(vit)}(t):q2n(t)?function(n){return n.split(`
`).map((o)=>o.match(/\(([^)]+)\)/)[1]).map(Cot).reduce((o,r)=>[...o,...r],[])}(t):[]},Ue.BooleanOperations=a$r,Ue.Relations=p$r;NY=JKr(),J2n=1,bot=NY!=null?OKr(YKr(NY)):{},((e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Bbn(t))GKr.call(e,r)||r===n||R2n(e,r,{get:()=>t[r],enumerable:!(o=VKr(t,r))||o.enumerable})})(!J2n&&NY&&NY.__esModule?bot:R2n(bot,"default",{value:NY,enumerable:!0}),NY);var NY,J2n,bot,{create:C$r,defineProperty:Z2n,getOwnPropertyDescriptor:b$r,getOwnPropertyNames:a6n,getPrototypeOf:I$r}=Object,v$r=Object.prototype.hasOwnProperty,DG=(e,t)=>function(){return t||(0,e[a6n(e)[0]])((t={exports:{}}).exports,t),t.exports},e1n=(e,t,n)=>(n=e!=null?C$r(I$r(e)):{},((o,r,i,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of a6n(r))v$r.call(o,a)||a===i||Z2n(o,a,{get:()=>r[a],enumerable:!(s=b$r(r,a))||s.enumerable});return o})(!t&&e&&e.__esModule?n:Z2n(n,"default",{value:e,enumerable:!0}),e)),S$r=DG({"node_modules/is-buffer/index.js"(e,t){function n(o){return!!o.constructor&&typeof o.constructor.isBuffer=="function"&&o.constructor.isBuffer(o)}t.exports=function(o){return o!=null&&(n(o)||function(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&n(r.slice(0,0))}(o)||!!o._isBuffer)}}}),P$r=DG({"node_modules/kind-of/index.js"(e,t){var n=S$r(),o=Object.prototype.toString;t.exports=function(r){if(r===void 0)return"undefined";if(r===null)return"null";if(r===!0||r===!1||r instanceof Boolean)return"boolean";if(typeof r=="string"||r instanceof String)return"string";if(typeof r=="number"||r instanceof Number)return"number";if(typeof r=="function"||r instanceof Function)return"function";if(Array.isArray!==void 0&&Array.isArray(r))return"array";if(r instanceof RegExp)return"regexp";if(r instanceof Date)return"date";var i=o.call(r);return i==="[object RegExp]"?"regexp":i==="[object Date]"?"date":i==="[object Arguments]"?"arguments":i==="[object Error]"?"error":n(r)?"buffer":i==="[object Set]"?"set":i==="[object WeakSet]"?"weakset":i==="[object Map]"?"map":i==="[object WeakMap]"?"weakmap":i==="[object Symbol]"?"symbol":i==="[object Int8Array]"?"int8array":i==="[object Uint8Array]"?"uint8array":i==="[object Uint8ClampedArray]"?"uint8clampedarray":i==="[object Int16Array]"?"int16array":i==="[object Uint16Array]"?"uint16array":i==="[object Int32Array]"?"int32array":i==="[object Uint32Array]"?"uint32array":i==="[object Float32Array]"?"float32array":i==="[object Float64Array]"?"float64array":"object"}}}),E$r=DG({"node_modules/rename-keys/index.js"(e,t){(function(){function n(o,r){if(typeof r!="function")return o;var i={};for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(i[r(s,o[s])||s]=o[s]);return i}t!==void 0&&t.exports?t.exports=n:typeof define=="function"&&define.amd?define([],function(){return n}):window.rename=n})()}}),M$r=DG({"node_modules/deep-rename-keys/index.js"(e,t){var n=P$r(),o=E$r();t.exports=function r(i,s){var a=n(i);if(a!=="object"&&a!=="array")throw Error("expected an object");var c=[];for(var l in a==="object"&&(i=o(i,s),c={}),i)if(i.hasOwnProperty(l)){var h=i[l];n(h)==="object"||n(h)==="array"?c[l]=r(h,s):c[l]=h}return c}}}),c6n=DG({"node_modules/eventemitter3/index.js"(e,t){var n=Object.prototype.hasOwnProperty,o="~";function r(){}function i(a,c,l){this.fn=a,this.context=c,this.once=l||!1}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(o=!1)),s.prototype.eventNames=function(){var a,c,l=[];if(this._eventsCount===0)return l;for(c in a=this._events)n.call(a,c)&&l.push(o?c.slice(1):c);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(a)):l},s.prototype.listeners=function(a,c){var l=o?o+a:a,h=this._events[l];if(c)return!!h;if(!h)return[];if(h.fn)return[h.fn];for(var d=0,u=h.length,_=Array(u);d<u;d++)_[d]=h[d].fn;return _},s.prototype.emit=function(a,c,l,h,d,u){var _=o?o+a:a;if(!this._events[_])return!1;var p,m,A=this._events[_],g=arguments.length;if(A.fn){switch(A.once&&this.removeListener(a,A.fn,void 0,!0),g){case 1:return A.fn.call(A.context),!0;case 2:return A.fn.call(A.context,c),!0;case 3:return A.fn.call(A.context,c,l),!0;case 4:return A.fn.call(A.context,c,l,h),!0;case 5:return A.fn.call(A.context,c,l,h,d),!0;case 6:return A.fn.call(A.context,c,l,h,d,u),!0}for(m=1,p=Array(g-1);m<g;m++)p[m-1]=arguments[m];A.fn.apply(A.context,p)}else{var f,y=A.length;for(m=0;m<y;m++)switch(A[m].once&&this.removeListener(a,A[m].fn,void 0,!0),g){case 1:A[m].fn.call(A[m].context);break;case 2:A[m].fn.call(A[m].context,c);break;case 3:A[m].fn.call(A[m].context,c,l);break;case 4:A[m].fn.call(A[m].context,c,l,h);break;default:if(!p)for(f=1,p=Array(g-1);f<g;f++)p[f-1]=arguments[f];A[m].fn.apply(A[m].context,p)}}return!0},s.prototype.on=function(a,c,l){var h=new i(c,l||this),d=o?o+a:a;return this._events[d]?this._events[d].fn?this._events[d]=[this._events[d],h]:this._events[d].push(h):(this._events[d]=h,this._eventsCount++),this},s.prototype.once=function(a,c,l){var h=new i(c,l||this,!0),d=o?o+a:a;return this._events[d]?this._events[d].fn?this._events[d]=[this._events[d],h]:this._events[d].push(h):(this._events[d]=h,this._eventsCount++),this},s.prototype.removeListener=function(a,c,l,h){var d=o?o+a:a;if(!this._events[d])return this;if(!c)return--this._eventsCount===0?this._events=new r:delete this._events[d],this;var u=this._events[d];if(u.fn)u.fn!==c||h&&!u.once||l&&u.context!==l||(--this._eventsCount===0?this._events=new r:delete this._events[d]);else{for(var _=0,p=[],m=u.length;_<m;_++)(u[_].fn!==c||h&&!u[_].once||l&&u[_].context!==l)&&p.push(u[_]);p.length?this._events[d]=p.length===1?p[0]:p:--this._eventsCount===0?this._events=new r:delete this._events[d]}return this},s.prototype.removeAllListeners=function(a){var c;return a?(c=o?o+a:a,this._events[c]&&(--this._eventsCount===0?this._events=new r:delete this._events[c])):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prototype.setMaxListeners=function(){return this},s.prefixed=o,s.EventEmitter=s,t!==void 0&&(t.exports=s)}}),w$r=DG({"node_modules/xml-lexer/dist/lexer.js"(e,t){function n(l,h,d){return h in l?Object.defineProperty(l,h,{value:d,enumerable:!0,configurable:!0,writable:!0}):l[h]=d,l}var o=c6n(),r=function(){},i={data:"state-data",cdata:"state-cdata",tagBegin:"state-tag-begin",tagName:"state-tag-name",tagEnd:"state-tag-end",attributeNameStart:"state-attribute-name-start",attributeName:"state-attribute-name",attributeNameEnd:"state-attribute-name-end",attributeValueBegin:"state-attribute-value-begin",attributeValue:"state-attribute-value"},s={lt:"action-lt",gt:"action-gt",space:"action-space",equal:"action-equal",quote:"action-quote",slash:"action-slash",char:"action-char",error:"action-error"},a={text:"text",openTag:"open-tag",closeTag:"close-tag",attributeName:"attribute-name",attributeValue:"attribute-value"},c={" ":s.space,"\t":s.space,"\n":s.space,"\r":s.space,"<":s.lt,">":s.gt,'"':s.quote,"'":s.quote,"=":s.equal,"/":s.slash};t.exports={State:i,Action:s,Type:a,create:function(l){var h,d,u,_,p,m,A,g,f,y;l=Object.assign({debug:!1},l);var x=new o,C=i.data,b="",I="",v="",P="",M="",B="",T=function(D,L){if(I[0]!=="?"&&I[0]!=="!"){var H={type:D,value:L};l.debug&&console.log("emit:",H),x.emit("data",H)}};x.stateMachine=(n(y={},i.data,(n(h={},s.lt,function(){b.trim()&&T(a.text,b),I="",M=!1,C=i.tagBegin}),n(h,s.char,function(D){b+=D}),h)),n(y,i.cdata,n({},s.char,function(D){(b+=D).substr(-3)==="]]>"&&(T(a.text,b.slice(0,-3)),b="",C=i.data)})),n(y,i.tagBegin,(n(d={},s.space,r),n(d,s.char,function(D){I=D,C=i.tagName}),n(d,s.slash,function(){I="",M=!0}),d)),n(y,i.tagName,(n(u={},s.space,function(){M?C=i.tagEnd:(C=i.attributeNameStart,T(a.openTag,I))}),n(u,s.gt,function(){T(M?a.closeTag:a.openTag,I),b="",C=i.data}),n(u,s.slash,function(){C=i.tagEnd,T(a.openTag,I)}),n(u,s.char,function(D){(I+=D)==="![CDATA["&&(C=i.cdata,b="",I="")}),u)),n(y,i.tagEnd,(n(_={},s.gt,function(){T(a.closeTag,I),b="",C=i.data}),n(_,s.char,r),_)),n(y,i.attributeNameStart,(n(p={},s.char,function(D){v=D,C=i.attributeName}),n(p,s.gt,function(){b="",C=i.data}),n(p,s.space,r),n(p,s.slash,function(){M=!0,C=i.tagEnd}),p)),n(y,i.attributeName,(n(m={},s.space,function(){C=i.attributeNameEnd}),n(m,s.equal,function(){T(a.attributeName,v),C=i.attributeValueBegin}),n(m,s.gt,function(){P="",T(a.attributeName,v),T(a.attributeValue,P),b="",C=i.data}),n(m,s.slash,function(){M=!0,P="",T(a.attributeName,v),T(a.attributeValue,P),C=i.tagEnd}),n(m,s.char,function(D){v+=D}),m)),n(y,i.attributeNameEnd,(n(A={},s.space,r),n(A,s.equal,function(){T(a.attributeName,v),C=i.attributeValueBegin}),n(A,s.gt,function(){P="",T(a.attributeName,v),T(a.attributeValue,P),b="",C=i.data}),n(A,s.char,function(D){P="",T(a.attributeName,v),T(a.attributeValue,P),v=D,C=i.attributeName}),A)),n(y,i.attributeValueBegin,(n(g={},s.space,r),n(g,s.quote,function(D){B=D,P="",C=i.attributeValue}),n(g,s.gt,function(){T(a.attributeValue,P=""),b="",C=i.data}),n(g,s.char,function(D){B="",P=D,C=i.attributeValue}),g)),n(y,i.attributeValue,(n(f={},s.space,function(D){B?P+=D:(T(a.attributeValue,P),C=i.attributeNameStart)}),n(f,s.quote,function(D){B===D?(T(a.attributeValue,P),C=i.attributeNameStart):P+=D}),n(f,s.gt,function(D){B?P+=D:(T(a.attributeValue,P),b="",C=i.data)}),n(f,s.slash,function(D){B?P+=D:(T(a.attributeValue,P),M=!0,C=i.tagEnd)}),n(f,s.char,function(D){P+=D}),f)),y);var N=function(D){l.debug&&console.log(C,D);var L=x.stateMachine[C],H=L[function(V){return c[V]||s.char}(D)]||L[s.error]||L[s.char];H(D)};return x.write=function(D){for(var L=D.length,H=0;H<L;H++)N(D[H])},x}}}}),B$r=DG({"node_modules/xml-reader/dist/reader.js"(e,t){var n=c6n(),o=w$r(),r=o.Type,i={element:"element",text:"text"},s=function(c){return Object.assign({name:"",type:i.element,value:"",parent:null,attributes:{},children:[]},c)},a=function(c){c=Object.assign({stream:!1,parentNodes:!0,doneEvent:"done",tagPrefix:"tag:",emitTopLevelOnly:!1,debug:!1},c);var l=void 0,h=void 0,d=void 0,u=void 0,_=new n,p=function(m){switch(m.type){case r.openTag:if(d===null)(d=h).name=m.value;else{var A=s({name:m.value,parent:d});d.children.push(A),d=A}break;case r.closeTag:var g=d.parent;if(c.parentNodes||(d.parent=null),d.name!==m.value)break;c.stream&&g===h&&(h.children=[],d.parent=null),c.emitTopLevelOnly&&g!==h||(_.emit(c.tagPrefix+d.name,d),_.emit("tag",d.name,d)),d===h&&(l.removeAllListeners("data"),_.emit(c.doneEvent,d),h=null),d=g;break;case r.text:d&&d.children.push(s({type:i.text,value:m.value,parent:c.parentNodes?d:null}));break;case r.attributeName:u=m.value,d.attributes[u]="";break;case r.attributeValue:d.attributes[u]=m.value}};return _.reset=function(){(l=o.create({debug:c.debug})).on("data",p),h=s(),d=null,u="",_.parse=l.write},_.reset(),_};t.exports={parseSync:function(c,l){l=Object.assign({},l,{stream:!1,tagPrefix:":"});var h=a(l),d=void 0;return h.on("done",function(u){d=u}),h.parse(c),d},create:a,NodeType:i}}}),{cos:Dra,sin:Nra,PI:Rra}=Math,{tan:Qra}=Math,T$r=(e1n(M$r()),e1n(B$r()),Object.create),{defineProperty:t1n,getOwnPropertyDescriptor:D$r,getOwnPropertyNames:l6n,getPrototypeOf:N$r}=Object,R$r=Object.prototype.hasOwnProperty,NG=(e,t)=>function(){return t||(0,e[l6n(e)[0]])((t={exports:{}}).exports,t),t.exports},n1n=(e,t,n)=>(n=e!=null?T$r(N$r(e)):{},((o,r,i,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of l6n(r))R$r.call(o,a)||a===i||t1n(o,a,{get:()=>r[a],enumerable:!(s=D$r(r,a))||s.enumerable});return o})(!t&&e&&e.__esModule?n:t1n(n,"default",{value:e,enumerable:!0}),e)),Q$r=NG({"node_modules/is-buffer/index.js"(e,t){function n(o){return!!o.constructor&&typeof o.constructor.isBuffer=="function"&&o.constructor.isBuffer(o)}t.exports=function(o){return o!=null&&(n(o)||function(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&n(r.slice(0,0))}(o)||!!o._isBuffer)}}}),k$r=NG({"node_modules/kind-of/index.js"(e,t){var n=Q$r(),o=Object.prototype.toString;t.exports=function(r){if(r===void 0)return"undefined";if(r===null)return"null";if(r===!0||r===!1||r instanceof Boolean)return"boolean";if(typeof r=="string"||r instanceof String)return"string";if(typeof r=="number"||r instanceof Number)return"number";if(typeof r=="function"||r instanceof Function)return"function";if(Array.isArray!==void 0&&Array.isArray(r))return"array";if(r instanceof RegExp)return"regexp";if(r instanceof Date)return"date";var i=o.call(r);return i==="[object RegExp]"?"regexp":i==="[object Date]"?"date":i==="[object Arguments]"?"arguments":i==="[object Error]"?"error":n(r)?"buffer":i==="[object Set]"?"set":i==="[object WeakSet]"?"weakset":i==="[object Map]"?"map":i==="[object WeakMap]"?"weakmap":i==="[object Symbol]"?"symbol":i==="[object Int8Array]"?"int8array":i==="[object Uint8Array]"?"uint8array":i==="[object Uint8ClampedArray]"?"uint8clampedarray":i==="[object Int16Array]"?"int16array":i==="[object Uint16Array]"?"uint16array":i==="[object Int32Array]"?"int32array":i==="[object Uint32Array]"?"uint32array":i==="[object Float32Array]"?"float32array":i==="[object Float64Array]"?"float64array":"object"}}}),L$r=NG({"node_modules/rename-keys/index.js"(e,t){(function(){function n(o,r){if(typeof r!="function")return o;var i={};for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(i[r(s,o[s])||s]=o[s]);return i}t!==void 0&&t.exports?t.exports=n:typeof define=="function"&&define.amd?define([],function(){return n}):window.rename=n})()}}),H$r=NG({"node_modules/deep-rename-keys/index.js"(e,t){var n=k$r(),o=L$r();t.exports=function r(i,s){var a=n(i);if(a!=="object"&&a!=="array")throw Error("expected an object");var c=[];for(var l in a==="object"&&(i=o(i,s),c={}),i)if(i.hasOwnProperty(l)){var h=i[l];n(h)==="object"||n(h)==="array"?c[l]=r(h,s):c[l]=h}return c}}}),h6n=NG({"node_modules/eventemitter3/index.js"(e,t){var n=Object.prototype.hasOwnProperty,o="~";function r(){}function i(a,c,l){this.fn=a,this.context=c,this.once=l||!1}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(o=!1)),s.prototype.eventNames=function(){var a,c,l=[];if(this._eventsCount===0)return l;for(c in a=this._events)n.call(a,c)&&l.push(o?c.slice(1):c);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(a)):l},s.prototype.listeners=function(a,c){var l=o?o+a:a,h=this._events[l];if(c)return!!h;if(!h)return[];if(h.fn)return[h.fn];for(var d=0,u=h.length,_=Array(u);d<u;d++)_[d]=h[d].fn;return _},s.prototype.emit=function(a,c,l,h,d,u){var _=o?o+a:a;if(!this._events[_])return!1;var p,m,A=this._events[_],g=arguments.length;if(A.fn){switch(A.once&&this.removeListener(a,A.fn,void 0,!0),g){case 1:return A.fn.call(A.context),!0;case 2:return A.fn.call(A.context,c),!0;case 3:return A.fn.call(A.context,c,l),!0;case 4:return A.fn.call(A.context,c,l,h),!0;case 5:return A.fn.call(A.context,c,l,h,d),!0;case 6:return A.fn.call(A.context,c,l,h,d,u),!0}for(m=1,p=Array(g-1);m<g;m++)p[m-1]=arguments[m];A.fn.apply(A.context,p)}else{var f,y=A.length;for(m=0;m<y;m++)switch(A[m].once&&this.removeListener(a,A[m].fn,void 0,!0),g){case 1:A[m].fn.call(A[m].context);break;case 2:A[m].fn.call(A[m].context,c);break;case 3:A[m].fn.call(A[m].context,c,l);break;case 4:A[m].fn.call(A[m].context,c,l,h);break;default:if(!p)for(f=1,p=Array(g-1);f<g;f++)p[f-1]=arguments[f];A[m].fn.apply(A[m].context,p)}}return!0},s.prototype.on=function(a,c,l){var h=new i(c,l||this),d=o?o+a:a;return this._events[d]?this._events[d].fn?this._events[d]=[this._events[d],h]:this._events[d].push(h):(this._events[d]=h,this._eventsCount++),this},s.prototype.once=function(a,c,l){var h=new i(c,l||this,!0),d=o?o+a:a;return this._events[d]?this._events[d].fn?this._events[d]=[this._events[d],h]:this._events[d].push(h):(this._events[d]=h,this._eventsCount++),this},s.prototype.removeListener=function(a,c,l,h){var d=o?o+a:a;if(!this._events[d])return this;if(!c)return--this._eventsCount===0?this._events=new r:delete this._events[d],this;var u=this._events[d];if(u.fn)u.fn!==c||h&&!u.once||l&&u.context!==l||(--this._eventsCount===0?this._events=new r:delete this._events[d]);else{for(var _=0,p=[],m=u.length;_<m;_++)(u[_].fn!==c||h&&!u[_].once||l&&u[_].context!==l)&&p.push(u[_]);p.length?this._events[d]=p.length===1?p[0]:p:--this._eventsCount===0?this._events=new r:delete this._events[d]}return this},s.prototype.removeAllListeners=function(a){var c;return a?(c=o?o+a:a,this._events[c]&&(--this._eventsCount===0?this._events=new r:delete this._events[c])):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prototype.setMaxListeners=function(){return this},s.prefixed=o,s.EventEmitter=s,t!==void 0&&(t.exports=s)}}),F$r=NG({"node_modules/xml-lexer/dist/lexer.js"(e,t){function n(l,h,d){return h in l?Object.defineProperty(l,h,{value:d,enumerable:!0,configurable:!0,writable:!0}):l[h]=d,l}var o=h6n(),r=function(){},i={data:"state-data",cdata:"state-cdata",tagBegin:"state-tag-begin",tagName:"state-tag-name",tagEnd:"state-tag-end",attributeNameStart:"state-attribute-name-start",attributeName:"state-attribute-name",attributeNameEnd:"state-attribute-name-end",attributeValueBegin:"state-attribute-value-begin",attributeValue:"state-attribute-value"},s={lt:"action-lt",gt:"action-gt",space:"action-space",equal:"action-equal",quote:"action-quote",slash:"action-slash",char:"action-char",error:"action-error"},a={text:"text",openTag:"open-tag",closeTag:"close-tag",attributeName:"attribute-name",attributeValue:"attribute-value"},c={" ":s.space,"\t":s.space,"\n":s.space,"\r":s.space,"<":s.lt,">":s.gt,'"':s.quote,"'":s.quote,"=":s.equal,"/":s.slash};t.exports={State:i,Action:s,Type:a,create:function(l){var h,d,u,_,p,m,A,g,f,y;l=Object.assign({debug:!1},l);var x=new o,C=i.data,b="",I="",v="",P="",M="",B="",T=function(D,L){if(I[0]!=="?"&&I[0]!=="!"){var H={type:D,value:L};l.debug&&console.log("emit:",H),x.emit("data",H)}};x.stateMachine=(n(y={},i.data,(n(h={},s.lt,function(){b.trim()&&T(a.text,b),I="",M=!1,C=i.tagBegin}),n(h,s.char,function(D){b+=D}),h)),n(y,i.cdata,n({},s.char,function(D){(b+=D).substr(-3)==="]]>"&&(T(a.text,b.slice(0,-3)),b="",C=i.data)})),n(y,i.tagBegin,(n(d={},s.space,r),n(d,s.char,function(D){I=D,C=i.tagName}),n(d,s.slash,function(){I="",M=!0}),d)),n(y,i.tagName,(n(u={},s.space,function(){M?C=i.tagEnd:(C=i.attributeNameStart,T(a.openTag,I))}),n(u,s.gt,function(){T(M?a.closeTag:a.openTag,I),b="",C=i.data}),n(u,s.slash,function(){C=i.tagEnd,T(a.openTag,I)}),n(u,s.char,function(D){(I+=D)==="![CDATA["&&(C=i.cdata,b="",I="")}),u)),n(y,i.tagEnd,(n(_={},s.gt,function(){T(a.closeTag,I),b="",C=i.data}),n(_,s.char,r),_)),n(y,i.attributeNameStart,(n(p={},s.char,function(D){v=D,C=i.attributeName}),n(p,s.gt,function(){b="",C=i.data}),n(p,s.space,r),n(p,s.slash,function(){M=!0,C=i.tagEnd}),p)),n(y,i.attributeName,(n(m={},s.space,function(){C=i.attributeNameEnd}),n(m,s.equal,function(){T(a.attributeName,v),C=i.attributeValueBegin}),n(m,s.gt,function(){P="",T(a.attributeName,v),T(a.attributeValue,P),b="",C=i.data}),n(m,s.slash,function(){M=!0,P="",T(a.attributeName,v),T(a.attributeValue,P),C=i.tagEnd}),n(m,s.char,function(D){v+=D}),m)),n(y,i.attributeNameEnd,(n(A={},s.space,r),n(A,s.equal,function(){T(a.attributeName,v),C=i.attributeValueBegin}),n(A,s.gt,function(){P="",T(a.attributeName,v),T(a.attributeValue,P),b="",C=i.data}),n(A,s.char,function(D){P="",T(a.attributeName,v),T(a.attributeValue,P),v=D,C=i.attributeName}),A)),n(y,i.attributeValueBegin,(n(g={},s.space,r),n(g,s.quote,function(D){B=D,P="",C=i.attributeValue}),n(g,s.gt,function(){T(a.attributeValue,P=""),b="",C=i.data}),n(g,s.char,function(D){B="",P=D,C=i.attributeValue}),g)),n(y,i.attributeValue,(n(f={},s.space,function(D){B?P+=D:(T(a.attributeValue,P),C=i.attributeNameStart)}),n(f,s.quote,function(D){B===D?(T(a.attributeValue,P),C=i.attributeNameStart):P+=D}),n(f,s.gt,function(D){B?P+=D:(T(a.attributeValue,P),b="",C=i.data)}),n(f,s.slash,function(D){B?P+=D:(T(a.attributeValue,P),M=!0,C=i.tagEnd)}),n(f,s.char,function(D){P+=D}),f)),y);var N=function(D){l.debug&&console.log(C,D);var L=x.stateMachine[C],H=L[function(V){return c[V]||s.char}(D)]||L[s.error]||L[s.char];H(D)};return x.write=function(D){for(var L=D.length,H=0;H<L;H++)N(D[H])},x}}}}),z$r=NG({"node_modules/xml-reader/dist/reader.js"(e,t){var n=h6n(),o=F$r(),r=o.Type,i={element:"element",text:"text"},s=function(c){return Object.assign({name:"",type:i.element,value:"",parent:null,attributes:{},children:[]},c)},a=function(c){c=Object.assign({stream:!1,parentNodes:!0,doneEvent:"done",tagPrefix:"tag:",emitTopLevelOnly:!1,debug:!1},c);var l=void 0,h=void 0,d=void 0,u=void 0,_=new n,p=function(m){switch(m.type){case r.openTag:if(d===null)(d=h).name=m.value;else{var A=s({name:m.value,parent:d});d.children.push(A),d=A}break;case r.closeTag:var g=d.parent;if(c.parentNodes||(d.parent=null),d.name!==m.value)break;c.stream&&g===h&&(h.children=[],d.parent=null),c.emitTopLevelOnly&&g!==h||(_.emit(c.tagPrefix+d.name,d),_.emit("tag",d.name,d)),d===h&&(l.removeAllListeners("data"),_.emit(c.doneEvent,d),h=null),d=g;break;case r.text:d&&d.children.push(s({type:i.text,value:m.value,parent:c.parentNodes?d:null}));break;case r.attributeName:u=m.value,d.attributes[u]="";break;case r.attributeValue:d.attributes[u]=m.value}};return _.reset=function(){(l=o.create({debug:c.debug})).on("data",p),h=s(),d=null,u="",_.parse=l.write},_.reset(),_};t.exports={parseSync:function(c,l){l=Object.assign({},l,{stream:!1,tagPrefix:":"});var h=a(l),d=void 0;return h.on("done",function(u){d=u}),h.parse(c),d},create:a,NodeType:i}}}),{cos:kra,sin:Lra,PI:Hra}=Math,{tan:Fra}=Math;n1n(H$r()),n1n(z$r());var qve={};gbn(qve,{all_layers:()=>cIn,any_circuit_element:()=>jvn,any_soup_element:()=>s8e,any_source_component:()=>Z6n,asset:()=>Mat,base_circuit_json_error:()=>rh,battery_capacity:()=>E6n,brep_shape:()=>tct,cadModelDefaultDirectionMap:()=>PJr,cad_component:()=>wvn,cad_model_axis_directions:()=>Mvn,cad_model_formats:()=>SJr,capacitance:()=>Pat,circuit_json_footprint_load_error:()=>nvn,current:()=>wZ,distance:()=>On,duration_ms:()=>jZ,experiment_type:()=>kvn,external_footprint_load_error:()=>tvn,frequency:()=>RG,getZodPrefixedIdWithDefault:()=>ao,inductance:()=>S6n,kicadAt:()=>n7e,kicadEffects:()=>M6n,kicadFont:()=>wat,kicadFootprintAttributes:()=>B6n,kicadFootprintMetadata:()=>N6n,kicadFootprintModel:()=>D6n,kicadFootprintPad:()=>T6n,kicadFootprintProperties:()=>w6n,kicadProperty:()=>Pde,kicadSymbolEffects:()=>k6n,kicadSymbolMetadata:()=>H6n,kicadSymbolPinNames:()=>Q6n,kicadSymbolPinNumbers:()=>R6n,kicadSymbolProperties:()=>L6n,kicadSymbolProperty:()=>Fk,layer_ref:()=>uc,layer_string:()=>wit,length:()=>sr,manufacturing_drc_properties:()=>jIn,ms:()=>eA,ninePointAnchor:()=>_T,parseAndConvertSiUnit:()=>I6,pcbRenderLayer:()=>Zqr,pcb_autorouting_error:()=>rvn,pcb_board:()=>b9n,pcb_breakout_point:()=>cvn,pcb_component:()=>KIn,pcb_component_invalid_layer_error:()=>fvn,pcb_component_not_on_board_edge_error:()=>Avn,pcb_component_outside_board_error:()=>gvn,pcb_connector_not_in_accessible_orientation_warning:()=>svn,pcb_copper_pour:()=>_vn,pcb_copper_pour_brep:()=>pvn,pcb_copper_pour_polygon:()=>mvn,pcb_copper_pour_rect:()=>uvn,pcb_copper_text:()=>B9n,pcb_courtyard_circle:()=>Pvn,pcb_courtyard_outline:()=>vvn,pcb_courtyard_overlap_error:()=>X9n,pcb_courtyard_pill:()=>Evn,pcb_courtyard_polygon:()=>Svn,pcb_courtyard_rect:()=>Ivn,pcb_cutout:()=>Z9n,pcb_cutout_circle:()=>$9n,pcb_cutout_path:()=>J9n,pcb_cutout_polygon:()=>q9n,pcb_cutout_rect:()=>K9n,pcb_fabrication_note_dimension:()=>z9n,pcb_fabrication_note_path:()=>H9n,pcb_fabrication_note_rect:()=>F9n,pcb_fabrication_note_text:()=>L9n,pcb_footprint_overlap_error:()=>W9n,pcb_ground_plane:()=>lvn,pcb_ground_plane_region:()=>hvn,pcb_group:()=>ovn,pcb_hole:()=>n9n,pcb_hole_circle_or_square_shape:()=>iJr,pcb_hole_circle_shape:()=>oJr,pcb_hole_oval_shape:()=>sJr,pcb_hole_pill_shape:()=>aJr,pcb_hole_rect_shape:()=>rJr,pcb_hole_rotated_pill_shape:()=>cJr,pcb_keepout:()=>j9n,pcb_manual_edit_conflict_warning:()=>ivn,pcb_missing_footprint_error:()=>evn,pcb_net:()=>x9n,pcb_note_dimension:()=>U9n,pcb_note_line:()=>G9n,pcb_note_path:()=>Y9n,pcb_note_rect:()=>V9n,pcb_note_text:()=>O9n,pcb_pad_pad_clearance_error:()=>Cvn,pcb_pad_trace_clearance_error:()=>bvn,pcb_panel:()=>I9n,pcb_panelization_placement_error:()=>S9n,pcb_placement_error:()=>v9n,pcb_plated_hole:()=>o9n,pcb_port:()=>r9n,pcb_port_not_connected_error:()=>y9n,pcb_port_not_matched_error:()=>f9n,pcb_route_hint:()=>WIn,pcb_route_hints:()=>nJr,pcb_silkscreen_circle:()=>D9n,pcb_silkscreen_graphic:()=>Q9n,pcb_silkscreen_graphic_brep:()=>R9n,pcb_silkscreen_line:()=>E9n,pcb_silkscreen_oval:()=>N9n,pcb_silkscreen_path:()=>M9n,pcb_silkscreen_pill:()=>k9n,pcb_silkscreen_rect:()=>T9n,pcb_silkscreen_text:()=>w9n,pcb_smtpad:()=>s9n,pcb_smtpad_pill:()=>i9n,pcb_solder_paste:()=>a9n,pcb_text:()=>c9n,pcb_thermal_spoke:()=>dvn,pcb_trace:()=>p9n,pcb_trace_error:()=>g9n,pcb_trace_hint:()=>P9n,pcb_trace_missing_error:()=>A9n,pcb_trace_route_point:()=>u9n,pcb_trace_route_point_through_pad:()=>d9n,pcb_trace_route_point_via:()=>h9n,pcb_trace_route_point_wire:()=>l9n,pcb_trace_too_long_warning:()=>_9n,pcb_trace_warning:()=>m9n,pcb_via:()=>C9n,pcb_via_clearance_error:()=>yvn,pcb_via_trace_clearance_error:()=>xvn,point:()=>Hr,point3:()=>tT,point_with_bulge:()=>UIn,port_arrangement:()=>bIn,position:()=>qqr,position3:()=>Jqr,resistance:()=>t7e,ring:()=>Bit,rotation:()=>Zm,route_hint_point:()=>XIn,schematic_arc:()=>MIn,schematic_box:()=>AIn,schematic_circle:()=>EIn,schematic_component:()=>IIn,schematic_component_port_arrangement_by_sides:()=>CIn,schematic_component_port_arrangement_by_size:()=>xIn,schematic_debug_line:()=>kIn,schematic_debug_object:()=>HIn,schematic_debug_object_base:()=>i7e,schematic_debug_point:()=>LIn,schematic_debug_rect:()=>QIn,schematic_error:()=>NIn,schematic_group:()=>OIn,schematic_layout_error:()=>RIn,schematic_line:()=>SIn,schematic_manual_edit_conflict_warning:()=>zIn,schematic_net_label:()=>DIn,schematic_path:()=>fIn,schematic_pin_styles:()=>yIn,schematic_port:()=>TIn,schematic_rect:()=>PIn,schematic_sheet:()=>GIn,schematic_symbol:()=>vIn,schematic_table:()=>VIn,schematic_table_cell:()=>YIn,schematic_text:()=>BIn,schematic_trace:()=>wIn,schematic_voltage_probe:()=>FIn,simulation_ac_current_source:()=>Rvn,simulation_ac_voltage_source:()=>Tvn,simulation_current_probe:()=>Yvn,simulation_current_source:()=>Qvn,simulation_dc_current_source:()=>Nvn,simulation_dc_voltage_source:()=>Bvn,simulation_experiment:()=>Hvn,simulation_op_amp:()=>Uvn,simulation_oscilloscope_trace:()=>Xvn,simulation_spice_subcircuit:()=>Wvn,simulation_switch:()=>Ovn,simulation_transient_current_graph:()=>zvn,simulation_transient_voltage_graph:()=>Fvn,simulation_unknown_experiment_error:()=>Gvn,simulation_voltage_probe:()=>Vvn,simulation_voltage_source:()=>Dvn,size:()=>Eat,source_ambiguous_port_reference:()=>sIn,source_board:()=>iIn,source_component_base:()=>Bd,source_component_internal_connection:()=>tIn,source_component_misconfigured_error:()=>ect,source_component_pins_underspecified_warning:()=>pIn,source_failed_to_create_component_error:()=>j6n,source_group:()=>oIn,source_i2c_misconfigured_error:()=>Zat,source_interconnect:()=>q6n,source_invalid_component_property_error:()=>jat,source_manually_placed_via:()=>lIn,source_missing_manufacturer_part_number_warning:()=>qat,source_missing_property_error:()=>X6n,source_net:()=>rIn,source_no_ground_pin_defined_warning:()=>uIn,source_no_power_pin_defined_warning:()=>dIn,source_part_not_found_warning:()=>gIn,source_pcb_ground_plane:()=>aIn,source_pin_attributes:()=>G6n,source_pin_missing_trace_warning:()=>$at,source_pin_must_be_connected_error:()=>mIn,source_port:()=>eIn,source_project_metadata:()=>Xat,source_property_ignored_warning:()=>K6n,source_refdes_convention_warning:()=>Jat,source_simple_ammeter:()=>Y6n,source_simple_battery:()=>Qat,source_simple_capacitor:()=>Bat,source_simple_chip:()=>Nat,source_simple_connector:()=>W6n,source_simple_crystal:()=>U6n,source_simple_current_source:()=>O6n,source_simple_diode:()=>r7e,source_simple_fiducial:()=>F6n,source_simple_fuse:()=>V6n,source_simple_ground:()=>z6n,source_simple_inductor:()=>kat,source_simple_led:()=>Dat,source_simple_mosfet:()=>Gat,source_simple_op_amp:()=>Uat,source_simple_pin_header:()=>Fat,source_simple_pinout:()=>zat,source_simple_potentiometer:()=>Hat,source_simple_power_source:()=>Rat,source_simple_push_button:()=>Lat,source_simple_resistor:()=>Tat,source_simple_resonator:()=>Oat,source_simple_switch:()=>Wat,source_simple_test_point:()=>Yat,source_simple_transistor:()=>Vat,source_simple_voltage_probe:()=>$6n,source_simple_voltage_source:()=>J6n,source_trace:()=>nIn,source_trace_not_connected_error:()=>Kat,source_unnamed_trace_warning:()=>hIn,spice_simulation_options:()=>Lvn,supplier_footprint_mismatch_warning:()=>avn,supplier_name:()=>o7e,time:()=>$qr,timestamp:()=>P6n,unknown_error_finding_part:()=>_In,visible_layer:()=>nA,voltage:()=>dT,wave_shape:()=>oct});var d6n=new Map([["T",1000000000000],["G",1e9],["M",1e6],["K",1000],["k",1000],["",1],["m",0.001],["µ",0.000001],["u",0.000001],["n",0.000000001],["p",0.000000000001],["f",0.000000000000001]]),O$r=[...d6n.keys()];function o1n(e){return d6n.get(e)}var u6n={Hz:{baseUnit:"Hz",variants:{MHz:1e6,kHz:1000,Hz:1}},g:{baseUnit:"g",variants:{kg:1000,g:1}},"Ω":{baseUnit:"Ω",variants:{"mΩ":0.001,mohm:0.001,mOhm:0.001,milliohm:0.001,"Ω":1,ohm:1,Ohm:1,"kΩ":1000,"KΩ":1000,kohm:1000,kOhm:1000,KOhm:1000,Kohm:1000,"MΩ":1e6,Mohm:1e6,MOhm:1e6,megohm:1e6,Megohm:1e6,"GΩ":1e9,Gohm:1e9,GOhm:1e9,"TΩ":1000000000000,Tohm:1000000000000,TOhm:1000000000000}},V:{baseUnit:"V",variants:{mV:0.001,V:1,kV:1000,KV:1000,MV:1e6,GV:1e9,TV:1000000000000}},A:{baseUnit:"A",variants:{"µA":0.000001,mA:0.001,ma:0.001,A:1,kA:1000,MA:1e6}},F:{baseUnit:"F",variants:{pF:0.000000000001,nF:0.000000001,"µF":0.000001,uF:0.000001,mF:0.001,F:1,kF:1000,KF:1000,MF:1e6}},H:{baseUnit:"H",variants:{pH:0.000000000001,nH:0.000000001,"µH":0.000001,uH:0.000001,mH:0.001,H:1,kH:1000,KH:1000,MH:1e6}},ml:{baseUnit:"ml",variants:{ml:1,mL:1,l:1000,L:1000}},deg:{baseUnit:"deg",variants:{rad:180/Math.PI}},ms:{baseUnit:"ms",variants:{fs:0.000000000001,ps:0.000000001,ns:0.000001,us:0.001,"µs":0.001,ms:1,s:1000}},mm:{baseUnit:"mm",variants:{nm:0.000001,"µm":0.001,um:0.001,mm:1,cm:10,dm:100,m:1000,km:1e6,in:25.4,ft:304.8,IN:25.4,FT:304.8,yd:914.4,mi:1609344,mil:0.0254}}},Sit=new Set;for(let[e,t]of Object.entries(u6n)){Sit.add(e);for(let n of Object.keys(t.variants))Sit.add(n)}function I6(e,t){if(e==null)return{parsedUnit:null,unitOfValue:null,value:null};if(typeof e=="string"&&e.match(/^-?[\d.]+$/))return{value:Number.parseFloat(e),parsedUnit:null,unitOfValue:null};if(typeof e=="number")return{value:e,parsedUnit:null,unitOfValue:null};if(typeof e=="object"&&"x"in e&&"y"in e){let l=I6(e.x,t),h=I6(e.x,t),d=I6(e.y,t);return h.value===null||d.value===null?{parsedUnit:null,unitOfValue:null,value:null}:{parsedUnit:l.parsedUnit,unitOfValue:l.unitOfValue,value:{x:h.value,y:d.value}}}let n=e.toString().split("").reverse().join(""),o=n.match(/[^\d\s]+/)?.[0];if(!o)throw Error(`Could not determine unit: "${e}"`);let r=o.split("").reverse().join(""),i=e.slice(0,-r.length),s=o1n(r);if(t&&s!=null)return{parsedUnit:null,unitOfValue:t,value:Number.parseFloat(i)*s};if(s!=null&&!Sit.has(r))return{parsedUnit:null,unitOfValue:null,value:Number.parseFloat(i)*s};let{baseUnit:a,conversionFactor:c}=function(l){for(let h of Object.values(u6n)){if(l in h.variants)return{baseUnit:h.baseUnit,conversionFactor:h.variants[l]};for(let[d,u]of Object.entries(h.variants)){if(!l.endsWith(d))continue;let _=o1n(l.slice(0,-d.length));if(_!=null)return{baseUnit:h.baseUnit,conversionFactor:_*u}}}return{baseUnit:l,conversionFactor:1}}(r);return{parsedUnit:r,unitOfValue:a,value:c*Number.parseFloat(i)}}var Dl,R5,Iot,V$r=O$r.filter((e)=>e!=="").sort((e,t)=>t.length-e.length).map((e)=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),F=(new RegExp(`^([+-]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+-]?\\d+)?)(?:(${V$r}))?$`),{});gbn(F,{BRAND:()=>uqr,DIRTY:()=>e8e,EMPTY_PATH:()=>U$r,INVALID:()=>xs,NEVER:()=>Kqr,OK:()=>xx,ParseStatus:()=>W5,Schema:()=>dc,ZodAny:()=>EZ,ZodArray:()=>fG,ZodBigInt:()=>Aue,ZodBoolean:()=>fue,ZodBranded:()=>vat,ZodCatch:()=>Mue,ZodDate:()=>yue,ZodDefault:()=>Eue,ZodDiscriminatedUnion:()=>A6n,ZodEffects:()=>Sv,ZodEnum:()=>a0e,ZodError:()=>wv,ZodFirstPartyTypeKind:()=>Ds,ZodFunction:()=>y6n,ZodIntersection:()=>Iue,ZodIssueCode:()=>Uo,ZodLazy:()=>vue,ZodLiteral:()=>Sue,ZodMap:()=>o8e,ZodNaN:()=>i8e,ZodNativeEnum:()=>Pue,ZodNever:()=>aT,ZodNull:()=>Cue,ZodNullable:()=>_L,ZodNumber:()=>gue,ZodObject:()=>C6,ZodOptional:()=>RP,ZodParsedType:()=>$r,ZodPipeline:()=>Sat,ZodPromise:()=>MZ,ZodReadonly:()=>wue,ZodRecord:()=>f6n,ZodSchema:()=>dc,ZodSet:()=>r8e,ZodString:()=>PZ,ZodSymbol:()=>t8e,ZodTransformer:()=>Sv,ZodTuple:()=>mL,ZodType:()=>dc,ZodUndefined:()=>xue,ZodUnion:()=>bue,ZodUnknown:()=>lG,ZodVoid:()=>n8e,addIssueToContext:()=>Br,any:()=>Cqr,array:()=>Sqr,bigint:()=>gqr,boolean:()=>v6n,coerce:()=>jqr,custom:()=>C6n,date:()=>Aqr,datetimeRegex:()=>g6n,defaultErrorMap:()=>SZ,discriminatedUnion:()=>wqr,effect:()=>a1n,enum:()=>Hqr,function:()=>Qqr,getErrorMap:()=>Jve,getParsedType:()=>XB,instanceof:()=>mqr,intersection:()=>Bqr,isAborted:()=>Pit,isAsync:()=>_ue,isDirty:()=>Eit,isValid:()=>AG,late:()=>pqr,lazy:()=>kqr,literal:()=>Lqr,makeIssue:()=>Zve,map:()=>Nqr,nan:()=>_qr,nativeEnum:()=>Fqr,never:()=>Iqr,null:()=>xqr,nullable:()=>Vqr,number:()=>I6n,object:()=>Pqr,objectUtil:()=>Iot,oboolean:()=>Xqr,onumber:()=>Wqr,optional:()=>Oqr,ostring:()=>Uqr,pipeline:()=>Gqr,preprocess:()=>Yqr,promise:()=>zqr,quotelessJson:()=>Y$r,record:()=>Dqr,set:()=>Rqr,setErrorMap:()=>G$r,strictObject:()=>Eqr,string:()=>b6n,symbol:()=>fqr,transformer:()=>a1n,tuple:()=>Tqr,undefined:()=>yqr,union:()=>Mqr,unknown:()=>bqr,util:()=>Dl,void:()=>vqr}),(R5=Dl||(Dl={})).assertEqual=(e)=>{},R5.assertIs=function(e){},R5.assertNever=function(e){throw Error()},R5.arrayToEnum=(e)=>{let t={};for(let n of e)t[n]=n;return t},R5.getValidEnumValues=(e)=>{let t=R5.objectKeys(e).filter((o)=>typeof e[e[o]]!="number"),n={};for(let o of t)n[o]=e[o];return R5.objectValues(n)},R5.objectValues=(e)=>R5.objectKeys(e).map(function(t){return e[t]}),R5.objectKeys=typeof Object.keys=="function"?(e)=>Object.keys(e):(e)=>{let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},R5.find=(e,t)=>{for(let n of e)if(t(n))return n},R5.isInteger=typeof Number.isInteger=="function"?(e)=>Number.isInteger(e):(e)=>typeof e=="number"&&Number.isFinite(e)&&Math.floor(e)===e,R5.joinValues=function(e,t=" | "){return e.map((n)=>typeof n=="string"?`'${n}'`:n).join(t)},R5.jsonStringifyReplacer=(e,t)=>typeof t=="bigint"?t.toString():t,(Iot||(Iot={})).mergeShapes=(e,t)=>({...e,...t});var $r=Dl.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),XB=(e)=>{switch(typeof e){case"undefined":return $r.undefined;case"string":return $r.string;case"number":return Number.isNaN(e)?$r.nan:$r.number;case"boolean":return $r.boolean;case"function":return $r.function;case"bigint":return $r.bigint;case"symbol":return $r.symbol;case"object":return Array.isArray(e)?$r.array:e===null?$r.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?$r.promise:typeof Map<"u"&&e instanceof Map?$r.map:typeof Set<"u"&&e instanceof Set?$r.set:typeof Date<"u"&&e instanceof Date?$r.date:$r.object;default:return $r.unknown}},Uo=Dl.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Y$r=(e)=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),wv=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=(o)=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){let n=t||function(i){return i.message},o={_errors:[]},r=(i)=>{for(let s of i.issues)if(s.code==="invalid_union")s.unionErrors.map(r);else if(s.code==="invalid_return_type")r(s.returnTypeError);else if(s.code==="invalid_arguments")r(s.argumentsError);else if(s.path.length===0)o._errors.push(n(s));else{let a=o,c=0;for(;c<s.path.length;){let l=s.path[c];c===s.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(n(s))):a[l]=a[l]||{_errors:[]},a=a[l],c++}}};return r(this),o}static assert(t){if(!(t instanceof e))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Dl.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=(n)=>n.message){let n={},o=[];for(let r of this.issues)if(r.path.length>0){let i=r.path[0];n[i]=n[i]||[],n[i].push(t(r))}else o.push(t(r));return{formErrors:o,fieldErrors:n}}get formErrors(){return this.flatten()}};wv.create=(e)=>new wv(e);var SZ=(e,t)=>{let n;switch(e.code){case Uo.invalid_type:n=e.received===$r.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case Uo.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Dl.jsonStringifyReplacer)}`;break;case Uo.unrecognized_keys:n=`Unrecognized key(s) in object: ${Dl.joinValues(e.keys,", ")}`;break;case Uo.invalid_union:n="Invalid input";break;case Uo.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Dl.joinValues(e.options)}`;break;case Uo.invalid_enum_value:n=`Invalid enum value. Expected ${Dl.joinValues(e.options)}, received '${e.received}'`;break;case Uo.invalid_arguments:n="Invalid function arguments";break;case Uo.invalid_return_type:n="Invalid function return type";break;case Uo.invalid_date:n="Invalid date";break;case Uo.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):("startsWith"in e.validation)?n=`Invalid input: must start with "${e.validation.startsWith}"`:("endsWith"in e.validation)?n=`Invalid input: must end with "${e.validation.endsWith}"`:Dl.assertNever(e.validation):n=e.validation!=="regex"?`Invalid ${e.validation}`:"Invalid";break;case Uo.too_small:n=e.type==="array"?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"||e.type==="bigint"?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case Uo.too_big:n=e.type==="array"?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case Uo.custom:n="Invalid input";break;case Uo.invalid_intersection_types:n="Intersection results could not be merged";break;case Uo.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Uo.not_finite:n="Number must be finite";break;default:n=t.defaultError,Dl.assertNever(e)}return{message:n}},p6n=SZ;function G$r(e){p6n=e}function Jve(){return p6n}var Zve=(e)=>{let{data:t,path:n,errorMaps:o,issueData:r}=e,i=[...n,...r.path||[]],s={...r,path:i};if(r.message!==void 0)return{...r,path:i,message:r.message};let a="",c=o.filter((l)=>!!l).slice().reverse();for(let l of c)a=l(s,{data:t,defaultError:a}).message;return{...r,path:i,message:a}},U$r=[];function Br(e,t){let n=Jve(),o=Zve({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===SZ?void 0:SZ].filter((r)=>!!r)});e.common.issues.push(o)}var Si,r1n,W5=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){let o=[];for(let r of n){if(r.status==="aborted")return xs;r.status==="dirty"&&t.dirty(),o.push(r.value)}return{status:t.value,value:o}}static async mergeObjectAsync(t,n){let o=[];for(let r of n){let i=await r.key,s=await r.value;o.push({key:i,value:s})}return e.mergeObjectSync(t,o)}static mergeObjectSync(t,n){let o={};for(let r of n){let{key:i,value:s}=r;if(i.status==="aborted")return xs;if(s.status==="aborted")return xs;i.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),i.value==="__proto__"||s.value===void 0&&!r.alwaysSet||(o[i.value]=s.value)}return{status:t.value,value:o}}},xs=Object.freeze({status:"aborted"}),e8e=(e)=>({status:"dirty",value:e}),xx=(e)=>({status:"valid",value:e}),Pit=(e)=>e.status==="aborted",Eit=(e)=>e.status==="dirty",AG=(e)=>e.status==="valid",_ue=(e)=>typeof Promise<"u"&&e instanceof Promise;(r1n=Si||(Si={})).errToObj=(e)=>typeof e=="string"?{message:e}:e||{},r1n.toString=(e)=>typeof e=="string"?e:e?.message;var OP=class{constructor(e,t,n,o){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},i1n=(e,t)=>{if(AG(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new wv(e.common.issues);return this._error=n,this._error}}};function Xa(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:o,description:r}=e;if(t&&(n||o))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(t)return{errorMap:t,description:r};return{errorMap:(i,s)=>{let{message:a}=e;return i.code==="invalid_enum_value"?{message:a??s.defaultError}:s.data===void 0?{message:a??o??s.defaultError}:i.code!=="invalid_type"?{message:s.defaultError}:{message:a??n??s.defaultError}},description:r}}var vot,dc=class{get description(){return this._def.description}_getType(e){return XB(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:XB(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new W5,ctx:{common:e.parent.common,data:e.data,parsedType:XB(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(_ue(t))throw Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:XB(e)},o=this._parseSync({data:e,path:n.path,parent:n});return i1n(n,o)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:XB(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:t});return AG(n)?{value:n.value}:{issues:t.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then((n)=>AG(n)?{value:n.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:XB(e)},o=this._parse({data:e,path:n.path,parent:n}),r=await(_ue(o)?o:Promise.resolve(o));return i1n(n,r)}refine(e,t){let n=(o)=>typeof t=="string"||t===void 0?{message:t}:typeof t=="function"?t(o):t;return this._refinement((o,r)=>{let i=e(o),s=()=>r.addIssue({code:Uo.custom,...n(o)});return typeof Promise<"u"&&i instanceof Promise?i.then((a)=>!!a||(s(),!1)):!!i||(s(),!1)})}refinement(e,t){return this._refinement((n,o)=>!!e(n)||(o.addIssue(typeof t=="function"?t(n,o):t),!1))}_refinement(e){return new Sv({schema:this,typeName:Ds.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(t)=>this["~validate"](t)}}optional(){return RP.create(this,this._def)}nullable(){return _L.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return fG.create(this)}promise(){return MZ.create(this,this._def)}or(e){return bue.create([this,e],this._def)}and(e){return Iue.create(this,e,this._def)}transform(e){return new Sv({...Xa(this._def),schema:this,typeName:Ds.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e=="function"?e:()=>e;return new Eue({...Xa(this._def),innerType:this,defaultValue:t,typeName:Ds.ZodDefault})}brand(){return new vat({typeName:Ds.ZodBranded,type:this,...Xa(this._def)})}catch(e){let t=typeof e=="function"?e:()=>e;return new Mue({...Xa(this._def),innerType:this,catchValue:t,typeName:Ds.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return Sat.create(this,e)}readonly(){return wue.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},W$r=/^c[^\s-]{8,}$/i,X$r=/^[0-9a-z]+$/,j$r=/^[0-9A-HJKMNP-TV-Z]{26}$/i,K$r=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,$$r=/^[a-z0-9_-]{21}$/i,q$r=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,J$r=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Z$r=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,eqr=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,tqr=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,nqr=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,oqr=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,rqr=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,iqr=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,m6n="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",sqr=new RegExp(`^${m6n}$`);function _6n(e){let t="[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e.precision?"+":"?"}`}function aqr(e){return new RegExp(`^${_6n(e)}$`)}function g6n(e){let t=`${m6n}T${_6n(e)}`,n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function cqr(e,t){return!(t!=="v4"&&t||!eqr.test(e))||!(t!=="v6"&&t||!nqr.test(e))}function lqr(e,t){if(!q$r.test(e))return!1;try{let[n]=e.split(".");if(!n)return!1;let o=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),r=JSON.parse(atob(o));return typeof r=="object"&&r!==null&&((!("typ"in r)||r?.typ==="JWT")&&(!!r.alg&&(!t||r.alg===t)))}catch{return!1}}function hqr(e,t){return!(t!=="v4"&&t||!tqr.test(e))||!(t!=="v6"&&t||!oqr.test(e))}var PZ=class e extends dc{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==$r.string){let r=this._getOrReturnCtx(t);return Br(r,{code:Uo.invalid_type,expected:$r.string,received:r.parsedType}),xs}let n=new W5,o;for(let r of this._def.checks)if(r.kind==="min")t.data.length<r.value&&(o=this._getOrReturnCtx(t,o),Br(o,{code:Uo.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),n.dirty());else if(r.kind==="max")t.data.length>r.value&&(o=this._getOrReturnCtx(t,o),Br(o,{code:Uo.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),n.dirty());else if(r.kind==="length"){let i=t.data.length>r.value,s=t.data.length<r.value;(i||s)&&(o=this._getOrReturnCtx(t,o),i?Br(o,{code:Uo.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}):s&&Br(o,{code:Uo.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}),n.dirty())}else if(r.kind==="email")Z$r.test(t.data)||(o=this._getOrReturnCtx(t,o),Br(o,{validation:"email",code:Uo.invalid_string,message:r.message}),n.dirty());else if(r.kind==="emoji")vot||(vot=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),vot.test(t.data)||(o=this._getOrReturnCtx(t,o),Br(o,{validation:"emoji",code:Uo.invalid_string,message:r.message}),n.dirty());else if(r.kind==="uuid")K$r.test(t.data)||(o=this._getOrReturnCtx(t,o),Br(o,{validation:"uuid",code:Uo.invalid_string,message:r.message}),n.dirty());else if(r.kind==="nanoid")$$r.test(t.data)||(o=this._getOrReturnCtx(t,o),Br(o,{validation:"nanoid",code:Uo.invalid_string,message:r.message}),n.dirty());else if(r.kind==="cuid")W$r.test(t.data)||(o=this._getOrReturnCtx(t,o),Br(o,{validation:"cuid",code:Uo.invalid_string,message:r.message}),n.dirty());else if(r.kind==="cuid2")X$r.test(t.data)||(o=this._getOrReturnCtx(t,o),Br(o,{validation:"cuid2",code:Uo.invalid_string,message:r.message}),n.dirty());else if(r.kind==="ulid")j$r.test(t.data)||(o=this._getOrReturnCtx(t,o),Br(o,{validation:"ulid",code:Uo.invalid_string,message:r.message}),n.dirty());else if(r.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),Br(o,{validation:"url",code:Uo.invalid_string,message:r.message}),n.dirty()}else if(r.kind==="regex")r.regex.lastIndex=0,r.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),Br(o,{validation:"regex",code:Uo.invalid_string,message:r.message}),n.dirty());else if(r.kind==="trim")t.data=t.data.trim();else if(r.kind==="includes")t.data.includes(r.value,r.position)||(o=this._getOrReturnCtx(t,o),Br(o,{code:Uo.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),n.dirty());else if(r.kind==="toLowerCase")t.data=t.data.toLowerCase();else if(r.kind==="toUpperCase")t.data=t.data.toUpperCase();else if(r.kind==="startsWith")t.data.startsWith(r.value)||(o=this._getOrReturnCtx(t,o),Br(o,{code:Uo.invalid_string,validation:{startsWith:r.value},message:r.message}),n.dirty());else if(r.kind==="endsWith")t.data.endsWith(r.value)||(o=this._getOrReturnCtx(t,o),Br(o,{code:Uo.invalid_string,validation:{endsWith:r.value},message:r.message}),n.dirty());else if(r.kind==="datetime")g6n(r).test(t.data)||(o=this._getOrReturnCtx(t,o),Br(o,{code:Uo.invalid_string,validation:"datetime",message:r.message}),n.dirty());else if(r.kind==="date")sqr.test(t.data)||(o=this._getOrReturnCtx(t,o),Br(o,{code:Uo.invalid_string,validation:"date",message:r.message}),n.dirty());else if(r.kind==="time")aqr(r).test(t.data)||(o=this._getOrReturnCtx(t,o),Br(o,{code:Uo.invalid_string,validation:"time",message:r.message}),n.dirty());else r.kind==="duration"?J$r.test(t.data)||(o=this._getOrReturnCtx(t,o),Br(o,{validation:"duration",code:Uo.invalid_string,message:r.message}),n.dirty()):r.kind==="ip"?cqr(t.data,r.version)||(o=this._getOrReturnCtx(t,o),Br(o,{validation:"ip",code:Uo.invalid_string,message:r.message}),n.dirty()):r.kind==="jwt"?lqr(t.data,r.alg)||(o=this._getOrReturnCtx(t,o),Br(o,{validation:"jwt",code:Uo.invalid_string,message:r.message}),n.dirty()):r.kind==="cidr"?hqr(t.data,r.version)||(o=this._getOrReturnCtx(t,o),Br(o,{validation:"cidr",code:Uo.invalid_string,message:r.message}),n.dirty()):r.kind==="base64"?rqr.test(t.data)||(o=this._getOrReturnCtx(t,o),Br(o,{validation:"base64",code:Uo.invalid_string,message:r.message}),n.dirty()):r.kind==="base64url"?iqr.test(t.data)||(o=this._getOrReturnCtx(t,o),Br(o,{validation:"base64url",code:Uo.invalid_string,message:r.message}),n.dirty()):Dl.assertNever(r);return{status:n.value,value:t.data}}_regex(t,n,o){return this.refinement((r)=>t.test(r),{validation:n,code:Uo.invalid_string,...Si.errToObj(o)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Si.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Si.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Si.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Si.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Si.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Si.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Si.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Si.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Si.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...Si.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...Si.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Si.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...Si.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:t?.precision===void 0?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...Si.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:t?.precision===void 0?null:t?.precision,...Si.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...Si.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Si.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...Si.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Si.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Si.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Si.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Si.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Si.errToObj(n)})}nonempty(t){return this.min(1,Si.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((t)=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find((t)=>t.kind==="date")}get isTime(){return!!this._def.checks.find((t)=>t.kind==="time")}get isDuration(){return!!this._def.checks.find((t)=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find((t)=>t.kind==="email")}get isURL(){return!!this._def.checks.find((t)=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find((t)=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find((t)=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((t)=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((t)=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((t)=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find((t)=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find((t)=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find((t)=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find((t)=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find((t)=>t.kind==="base64url")}get minLength(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};function dqr(e,t){let n=(e.toString().split(".")[1]||"").length,o=(t.toString().split(".")[1]||"").length,r=n>o?n:o;return Number.parseInt(e.toFixed(r).replace(".",""))%Number.parseInt(t.toFixed(r).replace(".",""))/10**r}PZ.create=(e)=>new PZ({checks:[],typeName:Ds.ZodString,coerce:e?.coerce??!1,...Xa(e)});var gue=class e extends dc{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==$r.number){let r=this._getOrReturnCtx(t);return Br(r,{code:Uo.invalid_type,expected:$r.number,received:r.parsedType}),xs}let n,o=new W5;for(let r of this._def.checks)if(r.kind==="int")Dl.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),Br(n,{code:Uo.invalid_type,expected:"integer",received:"float",message:r.message}),o.dirty());else if(r.kind==="min")(r.inclusive?t.data<r.value:t.data<=r.value)&&(n=this._getOrReturnCtx(t,n),Br(n,{code:Uo.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),o.dirty());else if(r.kind==="max")(r.inclusive?t.data>r.value:t.data>=r.value)&&(n=this._getOrReturnCtx(t,n),Br(n,{code:Uo.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),o.dirty());else r.kind==="multipleOf"?dqr(t.data,r.value)!==0&&(n=this._getOrReturnCtx(t,n),Br(n,{code:Uo.not_multiple_of,multipleOf:r.value,message:r.message}),o.dirty()):r.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),Br(n,{code:Uo.not_finite,message:r.message}),o.dirty()):Dl.assertNever(r);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Si.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Si.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Si.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Si.toString(n))}setLimit(t,n,o,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:o,message:Si.toString(r)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Si.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Si.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Si.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Si.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Si.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Si.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Si.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Si.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Si.toString(t)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find((t)=>t.kind==="int"||t.kind==="multipleOf"&&Dl.isInteger(t.value))}get isFinite(){let t=null,n=null;for(let o of this._def.checks){if(o.kind==="finite"||o.kind==="int"||o.kind==="multipleOf")return!0;o.kind==="min"?(n===null||o.value>n)&&(n=o.value):o.kind==="max"&&(t===null||o.value<t)&&(t=o.value)}return Number.isFinite(n)&&Number.isFinite(t)}};gue.create=(e)=>new gue({checks:[],typeName:Ds.ZodNumber,coerce:e?.coerce||!1,...Xa(e)});var Aue=class e extends dc{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==$r.bigint)return this._getInvalidInput(t);let n,o=new W5;for(let r of this._def.checks)if(r.kind==="min")(r.inclusive?t.data<r.value:t.data<=r.value)&&(n=this._getOrReturnCtx(t,n),Br(n,{code:Uo.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),o.dirty());else if(r.kind==="max")(r.inclusive?t.data>r.value:t.data>=r.value)&&(n=this._getOrReturnCtx(t,n),Br(n,{code:Uo.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),o.dirty());else r.kind==="multipleOf"?t.data%r.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),Br(n,{code:Uo.not_multiple_of,multipleOf:r.value,message:r.message}),o.dirty()):Dl.assertNever(r);return{status:o.value,value:t.data}}_getInvalidInput(t){let n=this._getOrReturnCtx(t);return Br(n,{code:Uo.invalid_type,expected:$r.bigint,received:n.parsedType}),xs}gte(t,n){return this.setLimit("min",t,!0,Si.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Si.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Si.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Si.toString(n))}setLimit(t,n,o,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:o,message:Si.toString(r)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Si.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Si.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Si.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Si.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Si.toString(n)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};Aue.create=(e)=>new Aue({checks:[],typeName:Ds.ZodBigInt,coerce:e?.coerce??!1,...Xa(e)});var fue=class extends dc{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==$r.boolean){let t=this._getOrReturnCtx(e);return Br(t,{code:Uo.invalid_type,expected:$r.boolean,received:t.parsedType}),xs}return xx(e.data)}};fue.create=(e)=>new fue({typeName:Ds.ZodBoolean,coerce:e?.coerce||!1,...Xa(e)});var yue=class e extends dc{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==$r.date){let r=this._getOrReturnCtx(t);return Br(r,{code:Uo.invalid_type,expected:$r.date,received:r.parsedType}),xs}if(Number.isNaN(t.data.getTime()))return Br(this._getOrReturnCtx(t),{code:Uo.invalid_date}),xs;let n=new W5,o;for(let r of this._def.checks)r.kind==="min"?t.data.getTime()<r.value&&(o=this._getOrReturnCtx(t,o),Br(o,{code:Uo.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),n.dirty()):r.kind==="max"?t.data.getTime()>r.value&&(o=this._getOrReturnCtx(t,o),Br(o,{code:Uo.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),n.dirty()):Dl.assertNever(r);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Si.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Si.toString(n)})}get minDate(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}};yue.create=(e)=>new yue({checks:[],coerce:e?.coerce||!1,typeName:Ds.ZodDate,...Xa(e)});var t8e=class extends dc{_parse(e){if(this._getType(e)!==$r.symbol){let t=this._getOrReturnCtx(e);return Br(t,{code:Uo.invalid_type,expected:$r.symbol,received:t.parsedType}),xs}return xx(e.data)}};t8e.create=(e)=>new t8e({typeName:Ds.ZodSymbol,...Xa(e)});var xue=class extends dc{_parse(e){if(this._getType(e)!==$r.undefined){let t=this._getOrReturnCtx(e);return Br(t,{code:Uo.invalid_type,expected:$r.undefined,received:t.parsedType}),xs}return xx(e.data)}};xue.create=(e)=>new xue({typeName:Ds.ZodUndefined,...Xa(e)});var Cue=class extends dc{_parse(e){if(this._getType(e)!==$r.null){let t=this._getOrReturnCtx(e);return Br(t,{code:Uo.invalid_type,expected:$r.null,received:t.parsedType}),xs}return xx(e.data)}};Cue.create=(e)=>new Cue({typeName:Ds.ZodNull,...Xa(e)});var EZ=class extends dc{constructor(){super(...arguments),this._any=!0}_parse(e){return xx(e.data)}};EZ.create=(e)=>new EZ({typeName:Ds.ZodAny,...Xa(e)});var lG=class extends dc{constructor(){super(...arguments),this._unknown=!0}_parse(e){return xx(e.data)}};lG.create=(e)=>new lG({typeName:Ds.ZodUnknown,...Xa(e)});var aT=class extends dc{_parse(e){let t=this._getOrReturnCtx(e);return Br(t,{code:Uo.invalid_type,expected:$r.never,received:t.parsedType}),xs}};aT.create=(e)=>new aT({typeName:Ds.ZodNever,...Xa(e)});var n8e=class extends dc{_parse(e){if(this._getType(e)!==$r.undefined){let t=this._getOrReturnCtx(e);return Br(t,{code:Uo.invalid_type,expected:$r.void,received:t.parsedType}),xs}return xx(e.data)}};n8e.create=(e)=>new n8e({typeName:Ds.ZodVoid,...Xa(e)});var fG=class e extends dc{_parse(t){let{ctx:n,status:o}=this._processInputParams(t),r=this._def;if(n.parsedType!==$r.array)return Br(n,{code:Uo.invalid_type,expected:$r.array,received:n.parsedType}),xs;if(r.exactLength!==null){let s=n.data.length>r.exactLength.value,a=n.data.length<r.exactLength.value;(s||a)&&(Br(n,{code:s?Uo.too_big:Uo.too_small,minimum:a?r.exactLength.value:void 0,maximum:s?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),o.dirty())}if(r.minLength!==null&&n.data.length<r.minLength.value&&(Br(n,{code:Uo.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),o.dirty()),r.maxLength!==null&&n.data.length>r.maxLength.value&&(Br(n,{code:Uo.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),o.dirty()),n.common.async)return Promise.all([...n.data].map((s,a)=>r.type._parseAsync(new OP(n,s,n.path,a)))).then((s)=>W5.mergeArray(o,s));let i=[...n.data].map((s,a)=>r.type._parseSync(new OP(n,s,n.path,a)));return W5.mergeArray(o,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:Si.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:Si.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:Si.toString(n)}})}nonempty(t){return this.min(1,t)}};function jJ(e){if(e instanceof C6){let t={};for(let n in e.shape){let o=e.shape[n];t[n]=RP.create(jJ(o))}return new C6({...e._def,shape:()=>t})}return e instanceof fG?new fG({...e._def,type:jJ(e.element)}):e instanceof RP?RP.create(jJ(e.unwrap())):e instanceof _L?_L.create(jJ(e.unwrap())):e instanceof mL?mL.create(e.items.map((t)=>jJ(t))):e}fG.create=(e,t)=>new fG({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ds.ZodArray,...Xa(t)});var C6=class e extends dc{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),n=Dl.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==$r.object){let c=this._getOrReturnCtx(t);return Br(c,{code:Uo.invalid_type,expected:$r.object,received:c.parsedType}),xs}let{status:n,ctx:o}=this._processInputParams(t),{shape:r,keys:i}=this._getCached(),s=[];if(!(this._def.catchall instanceof aT&&this._def.unknownKeys==="strip"))for(let c in o.data)i.includes(c)||s.push(c);let a=[];for(let c of i){let l=r[c],h=o.data[c];a.push({key:{status:"valid",value:c},value:l._parse(new OP(o,h,o.path,c)),alwaysSet:c in o.data})}if(this._def.catchall instanceof aT){let c=this._def.unknownKeys;if(c==="passthrough")for(let l of s)a.push({key:{status:"valid",value:l},value:{status:"valid",value:o.data[l]}});else if(c==="strict")s.length>0&&(Br(o,{code:Uo.unrecognized_keys,keys:s}),n.dirty());else if(c!=="strip")throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let l of s){let h=o.data[l];a.push({key:{status:"valid",value:l},value:c._parse(new OP(o,h,o.path,l)),alwaysSet:l in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let c=[];for(let l of a){let h=await l.key,d=await l.value;c.push({key:h,value:d,alwaysSet:l.alwaysSet})}return c}).then((c)=>W5.mergeObjectSync(n,c)):W5.mergeObjectSync(n,a)}get shape(){return this._def.shape()}strict(t){return Si.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,o)=>{let r=this._def.errorMap?.(n,o).message??o.defaultError;return n.code==="unrecognized_keys"?{message:Si.errToObj(t).message??r}:{message:r}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Ds.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let o of Dl.objectKeys(t))t[o]&&this.shape[o]&&(n[o]=this.shape[o]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let o of Dl.objectKeys(this.shape))t[o]||(n[o]=this.shape[o]);return new e({...this._def,shape:()=>n})}deepPartial(){return jJ(this)}partial(t){let n={};for(let o of Dl.objectKeys(this.shape)){let r=this.shape[o];t&&!t[o]?n[o]=r:n[o]=r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let o of Dl.objectKeys(this.shape))if(t&&!t[o])n[o]=this.shape[o];else{let r=this.shape[o];for(;r instanceof RP;)r=r._def.innerType;n[o]=r}return new e({...this._def,shape:()=>n})}keyof(){return x6n(Dl.objectKeys(this.shape))}};C6.create=(e,t)=>new C6({shape:()=>e,unknownKeys:"strip",catchall:aT.create(),typeName:Ds.ZodObject,...Xa(t)}),C6.strictCreate=(e,t)=>new C6({shape:()=>e,unknownKeys:"strict",catchall:aT.create(),typeName:Ds.ZodObject,...Xa(t)}),C6.lazycreate=(e,t)=>new C6({shape:e,unknownKeys:"strip",catchall:aT.create(),typeName:Ds.ZodObject,...Xa(t)});var bue=class extends dc{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;if(t.common.async)return Promise.all(n.map(async(o)=>{let r={...t,common:{...t.common,issues:[]},parent:null};return{result:await o._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}})).then(function(o){for(let i of o)if(i.result.status==="valid")return i.result;for(let i of o)if(i.result.status==="dirty")return t.common.issues.push(...i.ctx.common.issues),i.result;let r=o.map((i)=>new wv(i.ctx.common.issues));return Br(t,{code:Uo.invalid_union,unionErrors:r}),xs});{let o,r=[];for(let s of n){let a={...t,common:{...t.common,issues:[]},parent:null},c=s._parseSync({data:t.data,path:t.path,parent:a});if(c.status==="valid")return c;c.status!=="dirty"||o||(o={result:c,ctx:a}),a.common.issues.length&&r.push(a.common.issues)}if(o)return t.common.issues.push(...o.ctx.common.issues),o.result;let i=r.map((s)=>new wv(s));return Br(t,{code:Uo.invalid_union,unionErrors:i}),xs}}get options(){return this._def.options}};bue.create=(e,t)=>new bue({options:e,typeName:Ds.ZodUnion,...Xa(t)});var Hk=(e)=>e instanceof vue?Hk(e.schema):e instanceof Sv?Hk(e.innerType()):e instanceof Sue?[e.value]:e instanceof a0e?e.options:e instanceof Pue?Dl.objectValues(e.enum):e instanceof Eue?Hk(e._def.innerType):e instanceof xue?[void 0]:e instanceof Cue?[null]:e instanceof RP?[void 0,...Hk(e.unwrap())]:e instanceof _L?[null,...Hk(e.unwrap())]:e instanceof vat||e instanceof wue?Hk(e.unwrap()):e instanceof Mue?Hk(e._def.innerType):[],A6n=class e extends dc{_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==$r.object)return Br(n,{code:Uo.invalid_type,expected:$r.object,received:n.parsedType}),xs;let o=this.discriminator,r=n.data[o],i=this.optionsMap.get(r);return i?n.common.async?i._parseAsync({data:n.data,path:n.path,parent:n}):i._parseSync({data:n.data,path:n.path,parent:n}):(Br(n,{code:Uo.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),xs)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,o){let r=new Map;for(let i of n){let s=Hk(i.shape[t]);if(!s.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let a of s){if(r.has(a))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);r.set(a,i)}}return new e({typeName:Ds.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:r,...Xa(o)})}};function Mit(e,t){let n=XB(e),o=XB(t);if(e===t)return{valid:!0,data:e};if(n===$r.object&&o===$r.object){let r=Dl.objectKeys(t),i=Dl.objectKeys(e).filter((a)=>r.indexOf(a)!==-1),s={...e,...t};for(let a of i){let c=Mit(e[a],t[a]);if(!c.valid)return{valid:!1};s[a]=c.data}return{valid:!0,data:s}}if(n===$r.array&&o===$r.array){if(e.length!==t.length)return{valid:!1};let r=[];for(let i=0;i<e.length;i++){let s=Mit(e[i],t[i]);if(!s.valid)return{valid:!1};r.push(s.data)}return{valid:!0,data:r}}return n===$r.date&&o===$r.date&&+e===+t?{valid:!0,data:e}:{valid:!1}}var Iue=class extends dc{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),o=(r,i)=>{if(Pit(r)||Pit(i))return xs;let s=Mit(r.value,i.value);return s.valid?((Eit(r)||Eit(i))&&t.dirty(),{status:t.value,value:s.data}):(Br(n,{code:Uo.invalid_intersection_types}),xs)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([r,i])=>o(r,i)):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};Iue.create=(e,t,n)=>new Iue({left:e,right:t,typeName:Ds.ZodIntersection,...Xa(n)});var mL=class e extends dc{_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==$r.array)return Br(o,{code:Uo.invalid_type,expected:$r.array,received:o.parsedType}),xs;if(o.data.length<this._def.items.length)return Br(o,{code:Uo.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),xs;!this._def.rest&&o.data.length>this._def.items.length&&(Br(o,{code:Uo.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let r=[...o.data].map((i,s)=>{let a=this._def.items[s]||this._def.rest;return a?a._parse(new OP(o,i,o.path,s)):null}).filter((i)=>!!i);return o.common.async?Promise.all(r).then((i)=>W5.mergeArray(n,i)):W5.mergeArray(n,r)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};mL.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new mL({items:e,typeName:Ds.ZodTuple,rest:null,...Xa(t)})};var f6n=class e extends dc{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==$r.object)return Br(o,{code:Uo.invalid_type,expected:$r.object,received:o.parsedType}),xs;let r=[],i=this._def.keyType,s=this._def.valueType;for(let a in o.data)r.push({key:i._parse(new OP(o,a,o.path,a)),value:s._parse(new OP(o,o.data[a],o.path,a)),alwaysSet:a in o.data});return o.common.async?W5.mergeObjectAsync(n,r):W5.mergeObjectSync(n,r)}get element(){return this._def.valueType}static create(t,n,o){return new e(n instanceof dc?{keyType:t,valueType:n,typeName:Ds.ZodRecord,...Xa(o)}:{keyType:PZ.create(),valueType:t,typeName:Ds.ZodRecord,...Xa(n)})}},o8e=class extends dc{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==$r.map)return Br(n,{code:Uo.invalid_type,expected:$r.map,received:n.parsedType}),xs;let o=this._def.keyType,r=this._def.valueType,i=[...n.data.entries()].map(([s,a],c)=>({key:o._parse(new OP(n,s,n.path,[c,"key"])),value:r._parse(new OP(n,a,n.path,[c,"value"]))}));if(n.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let a of i){let c=await a.key,l=await a.value;if(c.status==="aborted"||l.status==="aborted")return xs;c.status!=="dirty"&&l.status!=="dirty"||t.dirty(),s.set(c.value,l.value)}return{status:t.value,value:s}})}{let s=new Map;for(let a of i){let{key:c,value:l}=a;if(c.status==="aborted"||l.status==="aborted")return xs;c.status!=="dirty"&&l.status!=="dirty"||t.dirty(),s.set(c.value,l.value)}return{status:t.value,value:s}}}};o8e.create=(e,t,n)=>new o8e({valueType:t,keyType:e,typeName:Ds.ZodMap,...Xa(n)});var r8e=class e extends dc{_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==$r.set)return Br(o,{code:Uo.invalid_type,expected:$r.set,received:o.parsedType}),xs;let r=this._def;r.minSize!==null&&o.data.size<r.minSize.value&&(Br(o,{code:Uo.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),n.dirty()),r.maxSize!==null&&o.data.size>r.maxSize.value&&(Br(o,{code:Uo.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),n.dirty());let i=this._def.valueType;function s(c){let l=new Set;for(let h of c){if(h.status==="aborted")return xs;h.status==="dirty"&&n.dirty(),l.add(h.value)}return{status:n.value,value:l}}let a=[...o.data.values()].map((c,l)=>i._parse(new OP(o,c,o.path,l)));return o.common.async?Promise.all(a).then((c)=>s(c)):s(a)}min(t,n){return new e({...this._def,minSize:{value:t,message:Si.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:Si.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}};r8e.create=(e,t)=>new r8e({valueType:e,minSize:null,maxSize:null,typeName:Ds.ZodSet,...Xa(t)});var y6n=class e extends dc{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==$r.function)return Br(n,{code:Uo.invalid_type,expected:$r.function,received:n.parsedType}),xs;function o(a,c){return Zve({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Jve(),SZ].filter((l)=>!!l),issueData:{code:Uo.invalid_arguments,argumentsError:c}})}function r(a,c){return Zve({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Jve(),SZ].filter((l)=>!!l),issueData:{code:Uo.invalid_return_type,returnTypeError:c}})}let i={errorMap:n.common.contextualErrorMap},s=n.data;if(this._def.returns instanceof MZ){let a=this;return xx(async function(...c){let l=new wv([]),h=await a._def.args.parseAsync(c,i).catch((u)=>{throw l.addIssue(o(c,u)),l}),d=await Reflect.apply(s,this,h);return await a._def.returns._def.type.parseAsync(d,i).catch((u)=>{throw l.addIssue(r(d,u)),l})})}{let a=this;return xx(function(...c){let l=a._def.args.safeParse(c,i);if(!l.success)throw new wv([o(c,l.error)]);let h=Reflect.apply(s,this,l.data),d=a._def.returns.safeParse(h,i);if(!d.success)throw new wv([r(h,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:mL.create(t).rest(lG.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,o){return new e({args:t||mL.create([]).rest(lG.create()),returns:n||lG.create(),typeName:Ds.ZodFunction,...Xa(o)})}},vue=class extends dc{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};vue.create=(e,t)=>new vue({getter:e,typeName:Ds.ZodLazy,...Xa(t)});var Sue=class extends dc{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return Br(t,{received:t.data,code:Uo.invalid_literal,expected:this._def.value}),xs}return{status:"valid",value:e.data}}get value(){return this._def.value}};function x6n(e,t){return new a0e({values:e,typeName:Ds.ZodEnum,...Xa(t)})}Sue.create=(e,t)=>new Sue({value:e,typeName:Ds.ZodLiteral,...Xa(t)});var a0e=class e extends dc{_parse(t){if(typeof t.data!="string"){let n=this._getOrReturnCtx(t),o=this._def.values;return Br(n,{expected:Dl.joinValues(o),received:n.parsedType,code:Uo.invalid_type}),xs}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let n=this._getOrReturnCtx(t),o=this._def.values;return Br(n,{received:n.data,code:Uo.invalid_enum_value,options:o}),xs}return xx(t.data)}get options(){return this._def.values}get enum(){let t={};for(let n of this._def.values)t[n]=n;return t}get Values(){let t={};for(let n of this._def.values)t[n]=n;return t}get Enum(){let t={};for(let n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter((o)=>!t.includes(o)),{...this._def,...n})}};a0e.create=x6n;var Pue=class extends dc{_parse(e){let t=Dl.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==$r.string&&n.parsedType!==$r.number){let o=Dl.objectValues(t);return Br(n,{expected:Dl.joinValues(o),received:n.parsedType,code:Uo.invalid_type}),xs}if(this._cache||(this._cache=new Set(Dl.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let o=Dl.objectValues(t);return Br(n,{received:n.data,code:Uo.invalid_enum_value,options:o}),xs}return xx(e.data)}get enum(){return this._def.values}};Pue.create=(e,t)=>new Pue({values:e,typeName:Ds.ZodNativeEnum,...Xa(t)});var MZ=class extends dc{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==$r.promise&&t.common.async===!1)return Br(t,{code:Uo.invalid_type,expected:$r.promise,received:t.parsedType}),xs;let n=t.parsedType===$r.promise?t.data:Promise.resolve(t.data);return xx(n.then((o)=>this._def.type.parseAsync(o,{path:t.path,errorMap:t.common.contextualErrorMap})))}};MZ.create=(e,t)=>new MZ({type:e,typeName:Ds.ZodPromise,...Xa(t)});var Sv=class extends dc{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ds.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),o=this._def.effect||null,r={addIssue:(i)=>{Br(n,i),i.fatal?t.abort():t.dirty()},get path(){return n.path}};if(r.addIssue=r.addIssue.bind(r),o.type==="preprocess"){let i=o.transform(n.data,r);if(n.common.async)return Promise.resolve(i).then(async(s)=>{if(t.value==="aborted")return xs;let a=await this._def.schema._parseAsync({data:s,path:n.path,parent:n});return a.status==="aborted"?xs:a.status==="dirty"||t.value==="dirty"?e8e(a.value):a});{if(t.value==="aborted")return xs;let s=this._def.schema._parseSync({data:i,path:n.path,parent:n});return s.status==="aborted"?xs:s.status==="dirty"||t.value==="dirty"?e8e(s.value):s}}if(o.type==="refinement"){let i=(s)=>{let a=o.refinement(s,r);if(n.common.async)return Promise.resolve(a);if(a instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?xs:(s.status==="dirty"&&t.dirty(),i(s.value),{status:t.value,value:s.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((s)=>s.status==="aborted"?xs:(s.status==="dirty"&&t.dirty(),i(s.value).then(()=>({status:t.value,value:s.value}))))}if(o.type==="transform"){if(n.common.async===!1){let i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!AG(i))return xs;let s=o.transform(i.value,r);if(s instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:s}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((i)=>AG(i)?Promise.resolve(o.transform(i.value,r)).then((s)=>({status:t.value,value:s})):xs)}Dl.assertNever(o)}};Sv.create=(e,t,n)=>new Sv({schema:e,typeName:Ds.ZodEffects,effect:t,...Xa(n)}),Sv.createWithPreprocess=(e,t,n)=>new Sv({schema:t,effect:{type:"preprocess",transform:e},typeName:Ds.ZodEffects,...Xa(n)});var RP=class extends dc{_parse(e){return this._getType(e)===$r.undefined?xx(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};RP.create=(e,t)=>new RP({innerType:e,typeName:Ds.ZodOptional,...Xa(t)});var _L=class extends dc{_parse(e){return this._getType(e)===$r.null?xx(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};_L.create=(e,t)=>new _L({innerType:e,typeName:Ds.ZodNullable,...Xa(t)});var Eue=class extends dc{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===$r.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};Eue.create=(e,t)=>new Eue({innerType:e,typeName:Ds.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Xa(t)});var Mue=class extends dc{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},o=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return _ue(o)?o.then((r)=>({status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new wv(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new wv(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Mue.create=(e,t)=>new Mue({innerType:e,typeName:Ds.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Xa(t)});var i8e=class extends dc{_parse(e){if(this._getType(e)!==$r.nan){let t=this._getOrReturnCtx(e);return Br(t,{code:Uo.invalid_type,expected:$r.nan,received:t.parsedType}),xs}return{status:"valid",value:e.data}}};i8e.create=(e)=>new i8e({typeName:Ds.ZodNaN,...Xa(e)});var uqr=Symbol("zod_brand"),vat=class extends dc{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},Sat=class e extends dc{_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.common.async)return(async()=>{let r=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});return r.status==="aborted"?xs:r.status==="dirty"?(n.dirty(),e8e(r.value)):this._def.out._parseAsync({data:r.value,path:o.path,parent:o})})();{let r=this._def.in._parseSync({data:o.data,path:o.path,parent:o});return r.status==="aborted"?xs:r.status==="dirty"?(n.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:o.path,parent:o})}}static create(t,n){return new e({in:t,out:n,typeName:Ds.ZodPipeline})}},wue=class extends dc{_parse(e){let t=this._def.innerType._parse(e),n=(o)=>(AG(o)&&(o.value=Object.freeze(o.value)),o);return _ue(t)?t.then((o)=>n(o)):n(t)}unwrap(){return this._def.innerType}};function s1n(e,t){let n=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof n=="string"?{message:n}:n}function C6n(e,t={},n){return e?EZ.create().superRefine((o,r)=>{let i=e(o);if(i instanceof Promise)return i.then((s)=>{if(!s){let a=s1n(t,o),c=a.fatal??n??!0;r.addIssue({code:"custom",...a,fatal:c})}});if(!i){let s=s1n(t,o),a=s.fatal??n??!0;r.addIssue({code:"custom",...s,fatal:a})}}):EZ.create()}wue.create=(e,t)=>new wue({innerType:e,typeName:Ds.ZodReadonly,...Xa(t)});var Ds,nl,pqr={object:C6.lazycreate};(nl=Ds||(Ds={})).ZodString="ZodString",nl.ZodNumber="ZodNumber",nl.ZodNaN="ZodNaN",nl.ZodBigInt="ZodBigInt",nl.ZodBoolean="ZodBoolean",nl.ZodDate="ZodDate",nl.ZodSymbol="ZodSymbol",nl.ZodUndefined="ZodUndefined",nl.ZodNull="ZodNull",nl.ZodAny="ZodAny",nl.ZodUnknown="ZodUnknown",nl.ZodNever="ZodNever",nl.ZodVoid="ZodVoid",nl.ZodArray="ZodArray",nl.ZodObject="ZodObject",nl.ZodUnion="ZodUnion",nl.ZodDiscriminatedUnion="ZodDiscriminatedUnion",nl.ZodIntersection="ZodIntersection",nl.ZodTuple="ZodTuple",nl.ZodRecord="ZodRecord",nl.ZodMap="ZodMap",nl.ZodSet="ZodSet",nl.ZodFunction="ZodFunction",nl.ZodLazy="ZodLazy",nl.ZodLiteral="ZodLiteral",nl.ZodEnum="ZodEnum",nl.ZodEffects="ZodEffects",nl.ZodNativeEnum="ZodNativeEnum",nl.ZodOptional="ZodOptional",nl.ZodNullable="ZodNullable",nl.ZodDefault="ZodDefault",nl.ZodCatch="ZodCatch",nl.ZodPromise="ZodPromise",nl.ZodBranded="ZodBranded",nl.ZodPipeline="ZodPipeline",nl.ZodReadonly="ZodReadonly";var mqr=(e,t={message:`Input not instance of ${e.name}`})=>C6n((n)=>n instanceof e,t),b6n=PZ.create,I6n=gue.create,_qr=i8e.create,gqr=Aue.create,v6n=fue.create,Aqr=yue.create,fqr=t8e.create,yqr=xue.create,xqr=Cue.create,Cqr=EZ.create,bqr=lG.create,Iqr=aT.create,vqr=n8e.create,Sqr=fG.create,{create:Pqr,strictCreate:Eqr}=C6,Mqr=bue.create,wqr=A6n.create,Bqr=Iue.create,Tqr=mL.create,Dqr=f6n.create,Nqr=o8e.create,Rqr=r8e.create,Qqr=y6n.create,kqr=vue.create,Lqr=Sue.create,Hqr=a0e.create,Fqr=Pue.create,zqr=MZ.create,a1n=Sv.create,Oqr=RP.create,Vqr=_L.create,Yqr=Sv.createWithPreprocess,Gqr=Sat.create,Uqr=()=>b6n().optional(),Wqr=()=>I6n().optional(),Xqr=()=>v6n().optional(),jqr={string:(e)=>PZ.create({...e,coerce:!0}),number:(e)=>gue.create({...e,coerce:!0}),boolean:(e)=>fue.create({...e,coerce:!0}),bigint:(e)=>Aue.create({...e,coerce:!0}),date:(e)=>yue.create({...e,coerce:!0})},Kqr=xs,t7e=F.string().or(F.number()).transform((e)=>I6(e,"Ω").value),Pat=F.string().or(F.number()).transform((e)=>I6(e,"F").value).transform((e)=>Number.parseFloat(e.toPrecision(12))),S6n=F.string().or(F.number()).transform((e)=>I6(e,"H").value),dT=F.string().or(F.number()).transform((e)=>I6(e,"V").value),sr=F.string().or(F.number()).transform((e)=>I6(e).value),RG=F.string().or(F.number()).transform((e)=>I6(e,"Hz").value),On=sr,wZ=F.string().or(F.number()).transform((e)=>I6(e,"A").value),jZ=F.string().or(F.number()).transform((e)=>I6(e).value),$qr=jZ,eA=jZ,P6n=F.string().datetime(),Zm=F.string().or(F.number()).transform((e)=>typeof e=="number"?e:e.endsWith("deg")?Number.parseFloat(e.split("deg")[0]):e.endsWith("rad")?180*Number.parseFloat(e.split("rad")[0])/Math.PI:Number.parseFloat(e)),E6n=F.number().or(F.string().endsWith("mAh")).transform((e)=>{if(typeof e=="string"){let t=e.replace("mAh",""),n=Number.parseFloat(t);if(Number.isNaN(n))throw Error("Invalid capacity");return n}return e}).describe("Battery capacity in mAh"),Hr=F.object({x:On,y:On}),qqr=Hr,tT=F.object({x:On,y:On,z:On}),Jqr=tT,Eat=F.object({width:F.number(),height:F.number()}),ao=(e)=>F.string().optional().default(()=>`${e}_${((t)=>Array.from({length:t},()=>"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[Math.floor(62*Math.random())]).join(""))(10)}`),_T=F.enum(["top_left","top_center","top_right","center_left","center","center_right","bottom_left","bottom_center","bottom_right"]),Zqr=F.enum(["top_silkscreen","bottom_silkscreen","top_copper","bottom_copper","top_soldermask","bottom_soldermask","top_fabrication_note","bottom_fabrication_note","top_user_note","bottom_user_note","top_courtyard","bottom_courtyard","inner1_copper","inner2_copper","inner3_copper","inner4_copper","inner5_copper","inner6_copper","inner7_copper","inner8_copper","edge_cuts","drill"]),Mat=F.object({project_relative_path:F.string(),url:F.string(),mimetype:F.string()}),n7e=Hr.extend({rotation:Zm.optional()}),wat=F.object({size:Hr.optional(),thickness:On.optional()}),M6n=F.object({font:wat.optional()}),Pde=F.object({value:F.string(),at:n7e.optional(),layer:F.string().optional(),uuid:F.string().optional(),hide:F.boolean().optional(),effects:M6n.optional()}),w6n=F.object({Reference:Pde.optional(),Value:Pde.optional(),Datasheet:Pde.optional(),Description:Pde.optional()}),B6n=F.object({through_hole:F.boolean().optional(),smd:F.boolean().optional(),exclude_from_pos_files:F.boolean().optional(),exclude_from_bom:F.boolean().optional()}),T6n=F.object({name:F.string(),type:F.string(),shape:F.string().optional(),at:n7e.optional(),size:Hr.optional(),drill:On.optional(),layers:F.array(F.string()).optional(),removeUnusedLayers:F.boolean().optional(),uuid:F.string().optional()}),D6n=F.object({path:F.string(),offset:tT.optional(),scale:tT.optional(),rotate:tT.optional()}),N6n=F.object({footprintName:F.string().optional(),version:F.union([F.number(),F.string()]).optional(),generator:F.string().optional(),generatorVersion:F.union([F.number(),F.string()]).optional(),layer:F.string().optional(),properties:w6n.optional(),attributes:B6n.optional(),pads:F.array(T6n).optional(),embeddedFonts:F.boolean().optional(),model:D6n.optional()}),R6n=F.object({hide:F.boolean().optional()}),Q6n=F.object({offset:On.optional(),hide:F.boolean().optional()}),k6n=F.object({font:wat.optional(),justify:F.union([F.string(),F.array(F.string())]).optional(),hide:F.boolean().optional()}),Fk=F.object({value:F.string(),id:F.union([F.number(),F.string()]).optional(),at:n7e.optional(),effects:k6n.optional()}),L6n=F.object({Reference:Fk.optional(),Value:Fk.optional(),Footprint:Fk.optional(),Datasheet:Fk.optional(),Description:Fk.optional(),ki_keywords:Fk.optional(),ki_fp_filters:Fk.optional()}),H6n=F.object({symbolName:F.string().optional(),extends:F.string().optional(),pinNumbers:R6n.optional(),pinNames:Q6n.optional(),excludeFromSim:F.boolean().optional(),inBom:F.boolean().optional(),onBoard:F.boolean().optional(),properties:L6n.optional(),embeddedFonts:F.boolean().optional()}),rh=F.object({error_type:F.string(),message:F.string(),is_fatal:F.boolean().optional()}),o7e=F.enum(["jlcpcb","macrofab","pcbway","digikey","mouser","lcsc"]),Bd=F.object({type:F.literal("source_component"),ftype:F.string().optional(),source_component_id:F.string(),name:F.string(),manufacturer_part_number:F.string().optional(),supplier_part_numbers:F.record(o7e,F.array(F.string())).optional(),display_value:F.string().optional(),display_name:F.string().optional(),are_pins_interchangeable:F.boolean().optional(),internally_connected_source_port_ids:F.array(F.array(F.string())).optional(),source_group_id:F.string().optional(),subcircuit_id:F.string().optional()}),Bat=Bd.extend({ftype:F.literal("simple_capacitor"),capacitance:Pat,max_voltage_rating:dT.optional(),display_capacitance:F.string().optional(),max_decoupling_trace_length:On.optional()}),Tat=Bd.extend({ftype:F.literal("simple_resistor"),resistance:t7e,display_resistance:F.string().optional()}),r7e=Bd.extend({ftype:F.literal("simple_diode")}),F6n=Bd.extend({ftype:F.literal("simple_fiducial")}),Dat=r7e.extend({ftype:F.literal("simple_led"),color:F.string().optional(),wavelength:F.string().optional()}),z6n=Bd.extend({ftype:F.literal("simple_ground")}),Nat=Bd.extend({ftype:F.literal("simple_chip")}),Rat=Bd.extend({ftype:F.literal("simple_power_source"),voltage:dT}),O6n=Bd.extend({ftype:F.literal("simple_current_source"),current:wZ,frequency:RG.optional(),peak_to_peak_current:wZ.optional(),wave_shape:F.enum(["sine","square","triangle","sawtooth","dc"]).optional().default("dc"),phase:F.number().optional(),duty_cycle:F.number().min(0).max(1).optional()}),V6n=Bd.extend({ftype:F.literal("simple_fuse"),current_rating_amps:F.number().describe("Nominal current in amps the fuse is rated for"),voltage_rating_volts:F.number().describe("Voltage rating in volts, e.g. ±5V would be 5")}),Y6n=Bd.extend({ftype:F.literal("simple_ammeter")}),G6n=F.object({must_be_connected:F.boolean().optional(),provides_power:F.boolean().optional(),requires_power:F.boolean().optional(),provides_ground:F.boolean().optional(),requires_ground:F.boolean().optional(),provides_voltage:F.union([F.string(),F.number()]).optional(),requires_voltage:F.union([F.string(),F.number()]).optional(),do_not_connect:F.boolean().optional(),include_in_board_pinout:F.boolean().optional(),can_use_internal_pullup:F.boolean().optional(),is_using_internal_pullup:F.boolean().optional(),needs_external_pullup:F.boolean().optional(),can_use_internal_pulldown:F.boolean().optional(),is_using_internal_pulldown:F.boolean().optional(),needs_external_pulldown:F.boolean().optional(),can_use_open_drain:F.boolean().optional(),is_using_open_drain:F.boolean().optional(),can_use_push_pull:F.boolean().optional(),is_using_push_pull:F.boolean().optional(),should_have_decoupling_capacitor:F.boolean().optional(),recommended_decoupling_capacitor_capacitance:F.union([F.string(),F.number()]).optional(),is_configured_for_i2c_sda:F.boolean().optional(),is_configured_for_i2c_scl:F.boolean().optional(),is_configured_for_spi_mosi:F.boolean().optional(),is_configured_for_spi_miso:F.boolean().optional(),is_configured_for_spi_sck:F.boolean().optional(),is_configured_for_spi_cs:F.boolean().optional(),is_configured_for_uart_tx:F.boolean().optional(),is_configured_for_uart_rx:F.boolean().optional(),supports_i2c_sda:F.boolean().optional(),supports_i2c_scl:F.boolean().optional(),supports_spi_mosi:F.boolean().optional(),supports_spi_miso:F.boolean().optional(),supports_spi_sck:F.boolean().optional(),supports_spi_cs:F.boolean().optional(),supports_uart_tx:F.boolean().optional(),supports_uart_rx:F.boolean().optional()}),Qat=Bd.extend({ftype:F.literal("simple_battery"),capacity:E6n}),kat=Bd.extend({ftype:F.literal("simple_inductor"),inductance:S6n,display_inductance:F.string().optional(),max_current_rating:F.number().optional()}),Lat=Bd.extend({ftype:F.literal("simple_push_button")}),Hat=Bd.extend({ftype:F.literal("simple_potentiometer"),max_resistance:t7e,display_max_resistance:F.string().optional()}),U6n=Bd.extend({ftype:F.literal("simple_crystal"),frequency:F.number().describe("Frequency in Hz"),load_capacitance:F.number().optional().describe("Load capacitance in pF"),pin_variant:F.enum(["two_pin","four_pin"]).optional()}),Fat=Bd.extend({ftype:F.literal("simple_pin_header"),pin_count:F.number(),gender:F.enum(["male","female"]).optional().default("male")}),W6n=Bd.extend({ftype:F.literal("simple_connector"),standard:F.enum(["usb_c","m2"]).optional()}),zat=Bd.extend({ftype:F.literal("simple_pinout")}),Oat=Bd.extend({ftype:F.literal("simple_resonator"),load_capacitance:Pat,equivalent_series_resistance:t7e.optional(),frequency:RG}),Vat=Bd.extend({ftype:F.literal("simple_transistor"),transistor_type:F.enum(["npn","pnp"])}),Yat=Bd.extend({ftype:F.literal("simple_test_point"),footprint_variant:F.enum(["pad","through_hole"]).optional(),pad_shape:F.enum(["rect","circle"]).optional(),pad_diameter:F.union([F.number(),F.string()]).optional(),hole_diameter:F.union([F.number(),F.string()]).optional(),width:F.union([F.number(),F.string()]).optional(),height:F.union([F.number(),F.string()]).optional()}),Gat=Bd.extend({ftype:F.literal("simple_mosfet"),channel_type:F.enum(["n","p"]),mosfet_mode:F.enum(["enhancement","depletion"])}),Uat=Bd.extend({ftype:F.literal("simple_op_amp")}),Wat=Bd.extend({ftype:F.literal("simple_switch")}),Xat=F.object({type:F.literal("source_project_metadata"),name:F.string().optional(),software_used_string:F.string().optional(),project_url:F.string().optional(),source_filesystem_md5_hash:F.string().optional(),created_at:P6n.optional()}),X6n=rh.extend({type:F.literal("source_missing_property_error"),source_missing_property_error_id:ao("source_missing_property_error"),source_component_id:F.string(),property_name:F.string(),subcircuit_id:F.string().optional(),error_type:F.literal("source_missing_property_error").default("source_missing_property_error")}).describe("The source code is missing a property"),j6n=rh.extend({type:F.literal("source_failed_to_create_component_error"),source_failed_to_create_component_error_id:ao("source_failed_to_create_component_error"),error_type:F.literal("source_failed_to_create_component_error").default("source_failed_to_create_component_error"),component_name:F.string().optional(),subcircuit_id:F.string().optional(),parent_source_component_id:F.string().optional(),pcb_center:F.object({x:F.number().optional(),y:F.number().optional()}).optional(),schematic_center:F.object({x:F.number().optional(),y:F.number().optional()}).optional()}).describe("Error emitted when a component fails to be constructed"),jat=rh.extend({type:F.literal("source_invalid_component_property_error"),source_invalid_component_property_error_id:ao("source_invalid_component_property_error"),source_component_id:F.string(),property_name:F.string(),property_value:F.unknown().optional(),expected_format:F.string().optional(),subcircuit_id:F.string().optional(),error_type:F.literal("source_invalid_component_property_error").default("source_invalid_component_property_error")}).describe("The source component property is invalid"),Kat=rh.extend({type:F.literal("source_trace_not_connected_error"),source_trace_not_connected_error_id:ao("source_trace_not_connected_error"),error_type:F.literal("source_trace_not_connected_error").default("source_trace_not_connected_error"),subcircuit_id:F.string().optional(),source_group_id:F.string().optional(),source_trace_id:F.string().optional(),connected_source_port_ids:F.array(F.string()).optional(),selectors_not_found:F.array(F.string()).optional()}).describe("Occurs when a source trace selector does not match any ports"),K6n=F.object({type:F.literal("source_property_ignored_warning"),source_property_ignored_warning_id:ao("source_property_ignored_warning"),source_component_id:F.string(),property_name:F.string(),subcircuit_id:F.string().optional(),error_type:F.literal("source_property_ignored_warning").default("source_property_ignored_warning"),message:F.string()}).describe("The source property was ignored"),$at=F.object({type:F.literal("source_pin_missing_trace_warning"),source_pin_missing_trace_warning_id:ao("source_pin_missing_trace_warning"),warning_type:F.literal("source_pin_missing_trace_warning").default("source_pin_missing_trace_warning"),message:F.string(),source_component_id:F.string(),source_port_id:F.string(),subcircuit_id:F.string().optional()}).describe("Warning emitted when a source component pin is missing a trace connection"),qat=F.object({type:F.literal("source_missing_manufacturer_part_number_warning"),source_missing_manufacturer_part_number_warning_id:ao("source_missing_manufacturer_part_number_warning"),warning_type:F.literal("source_missing_manufacturer_part_number_warning").default("source_missing_manufacturer_part_number_warning"),message:F.string(),source_component_id:F.string(),standard:F.string(),subcircuit_id:F.string().optional()}).describe("Warning emitted when a standard connector is missing manufacturer part number"),Jat=F.object({type:F.literal("source_refdes_convention_warning"),source_refdes_convention_warning_id:ao("source_refdes_convention_warning"),warning_type:F.literal("source_refdes_convention_warning").default("source_refdes_convention_warning"),message:F.string(),source_component_id:F.string(),refdes:F.string(),source_component_ftype:F.string(),expected_prefixes:F.array(F.string()),actual_prefix:F.string().optional(),subcircuit_id:F.string().optional()}).describe("Warning emitted when a source component reference designator does not match the component type convention"),$6n=Bd.extend({ftype:F.literal("simple_voltage_probe")}),q6n=Bd.extend({ftype:F.literal("interconnect")}),Zat=rh.extend({type:F.literal("source_i2c_misconfigured_error"),source_i2c_misconfigured_error_id:ao("source_i2c_misconfigured_error"),error_type:F.literal("source_i2c_misconfigured_error").default("source_i2c_misconfigured_error"),source_port_ids:F.array(F.string())}).describe("Error emitted when incompatible I2C pins (e.g. SDA and SCL) are connected to the same net"),ect=rh.extend({type:F.literal("source_component_misconfigured_error"),source_component_misconfigured_error_id:ao("source_component_misconfigured_error"),error_type:F.literal("source_component_misconfigured_error").default("source_component_misconfigured_error"),source_component_ids:F.array(F.string()),source_port_ids:F.array(F.string()).optional()}).describe("Error emitted when one or more source components have an invalid or conflicting configuration"),J6n=Bd.extend({ftype:F.literal("simple_voltage_source"),voltage:dT,frequency:RG.optional(),peak_to_peak_voltage:dT.optional(),wave_shape:F.enum(["sinewave","square","triangle","sawtooth"]).optional(),phase:Zm.optional(),duty_cycle:F.number().optional().describe("Duty cycle as a fraction (0 to 1)"),pulse_delay:eA.optional(),rise_time:eA.optional(),fall_time:eA.optional(),pulse_width:eA.optional(),period:eA.optional()}),Z6n=F.union([Tat,Bat,r7e,F6n,Dat,z6n,Nat,Rat,O6n,Y6n,Qat,kat,Lat,Hat,U6n,Fat,W6n,zat,Oat,Wat,Vat,Yat,Gat,Uat,V6n,$6n,q6n,J6n,Xat,X6n,jat,j6n,Kat,K6n,$at,qat,Jat,Zat,ect]),eIn=F.object({type:F.literal("source_port"),pin_number:F.number().optional(),port_hints:F.array(F.string()).optional(),name:F.string(),source_port_id:F.string(),source_component_id:F.string().optional(),source_group_id:F.string().optional(),most_frequently_referenced_by_name:F.string().optional(),subcircuit_id:F.string().optional(),subcircuit_connectivity_map_key:F.string().optional()}).merge(G6n),tIn=F.object({type:F.literal("source_component_internal_connection"),source_component_internal_connection_id:F.string(),source_component_id:F.string(),source_port_ids:F.array(F.string()),subcircuit_id:F.string().optional()}),nIn=F.object({type:F.literal("source_trace"),source_trace_id:F.string(),connected_source_port_ids:F.array(F.string()),connected_source_net_ids:F.array(F.string()),subcircuit_id:F.string().optional(),subcircuit_connectivity_map_key:F.string().optional(),max_length:F.number().optional(),name:F.string().optional(),min_trace_thickness:F.number().optional(),display_name:F.string().optional()}),oIn=F.object({type:F.literal("source_group"),source_group_id:F.string(),subcircuit_id:F.string().optional(),parent_subcircuit_id:F.string().optional(),parent_source_group_id:F.string().optional(),is_subcircuit:F.boolean().optional(),show_as_schematic_box:F.boolean().optional(),name:F.string().optional(),was_automatically_named:F.boolean().optional()}),rIn=F.object({type:F.literal("source_net"),source_net_id:F.string(),name:F.string(),member_source_group_ids:F.array(F.string()),is_power:F.boolean().optional(),is_ground:F.boolean().optional(),is_digital_signal:F.boolean().optional(),is_analog_signal:F.boolean().optional(),is_positive_voltage_source:F.boolean().optional(),trace_width:F.number().optional(),subcircuit_id:F.string().optional(),subcircuit_connectivity_map_key:F.string().optional()}),iIn=F.object({type:F.literal("source_board"),source_board_id:F.string(),source_group_id:F.string(),title:F.string().optional()}).describe("Defines a board in the source domain"),sIn=rh.extend({type:F.literal("source_ambiguous_port_reference"),source_ambiguous_port_reference_id:ao("source_ambiguous_port_reference"),error_type:F.literal("source_ambiguous_port_reference").default("source_ambiguous_port_reference"),source_port_id:F.string().optional(),source_component_id:F.string().optional()}).describe("Error emitted when a port hint matches multiple non-overlapping pads, making the port reference ambiguous"),aIn=F.object({type:F.literal("source_pcb_ground_plane"),source_pcb_ground_plane_id:F.string(),source_group_id:F.string(),source_net_id:F.string(),subcircuit_id:F.string().optional()}).describe("Defines a ground plane in the source domain"),cIn=["top","bottom","inner1","inner2","inner3","inner4","inner5","inner6","inner7","inner8"],wit=F.enum(cIn),uc=wit.or(F.object({name:wit})).transform((e)=>typeof e=="string"?e:e.name),nA=F.enum(["top","bottom"]),lIn=F.object({type:F.literal("source_manually_placed_via"),source_manually_placed_via_id:F.string(),source_group_id:F.string(),source_net_id:F.string(),subcircuit_id:F.string().optional(),source_trace_id:F.string().optional()}).describe("Defines a via that is manually placed in the source domain"),hIn=F.object({type:F.literal("source_unnamed_trace_warning"),source_unnamed_trace_warning_id:ao("source_unnamed_trace_warning"),warning_type:F.literal("source_unnamed_trace_warning").default("source_unnamed_trace_warning"),message:F.string(),source_trace_id:F.string(),subcircuit_id:F.string().optional()}).describe("Warning emitted when a source trace is missing a name"),dIn=F.object({type:F.literal("source_no_power_pin_defined_warning"),source_no_power_pin_defined_warning_id:ao("source_no_power_pin_defined_warning"),warning_type:F.literal("source_no_power_pin_defined_warning").default("source_no_power_pin_defined_warning"),message:F.string(),source_component_id:F.string(),source_port_ids:F.array(F.string()),subcircuit_id:F.string().optional()}).describe("Warning emitted when a chip has no source ports with requires_power=true"),uIn=F.object({type:F.literal("source_no_ground_pin_defined_warning"),source_no_ground_pin_defined_warning_id:ao("source_no_ground_pin_defined_warning"),warning_type:F.literal("source_no_ground_pin_defined_warning").default("source_no_ground_pin_defined_warning"),message:F.string(),source_component_id:F.string(),source_port_ids:F.array(F.string()),subcircuit_id:F.string().optional()}).describe("Warning emitted when a chip has no source ports marked as ground pins"),pIn=F.object({type:F.literal("source_component_pins_underspecified_warning"),source_component_pins_underspecified_warning_id:ao("source_component_pins_underspecified_warning"),warning_type:F.literal("source_component_pins_underspecified_warning").default("source_component_pins_underspecified_warning"),message:F.string(),source_component_id:F.string(),source_port_ids:F.array(F.string()),subcircuit_id:F.string().optional()}).describe("Warning emitted when all ports on a source component are underspecified"),mIn=rh.extend({type:F.literal("source_pin_must_be_connected_error"),source_pin_must_be_connected_error_id:ao("source_pin_must_be_connected_error"),error_type:F.literal("source_pin_must_be_connected_error").default("source_pin_must_be_connected_error"),source_component_id:F.string(),source_port_id:F.string(),subcircuit_id:F.string().optional()}).describe("Error emitted when a pin with mustBeConnected attribute is not connected to any trace"),_In=rh.extend({type:F.literal("unknown_error_finding_part"),unknown_error_finding_part_id:ao("unknown_error_finding_part"),error_type:F.literal("unknown_error_finding_part").default("unknown_error_finding_part"),source_component_id:F.string().optional(),subcircuit_id:F.string().optional()}).describe("Error emitted when an unexpected error occurs while finding a part"),gIn=F.object({type:F.literal("source_part_not_found_warning"),source_part_not_found_warning_id:ao("source_part_not_found_warning"),warning_type:F.literal("source_part_not_found_warning").default("source_part_not_found_warning"),message:F.string(),source_component_id:F.string().optional(),subcircuit_id:F.string().optional(),supplier_name:o7e.optional(),manufacturer_part_number:F.string().optional(),supplier_part_number:F.string().optional(),part_name:F.string().optional()}).describe("Warning emitted when a requested part can not be found"),AIn=F.object({type:F.literal("schematic_box"),schematic_sheet_id:F.string().optional(),schematic_component_id:F.string().optional(),schematic_symbol_id:F.string().optional(),width:On,height:On,is_dashed:F.boolean().default(!1),x:On,y:On,subcircuit_id:F.string().optional()}).describe("Draws a box on the schematic"),fIn=F.object({type:F.literal("schematic_path"),schematic_path_id:ao("schematic_path"),schematic_sheet_id:F.string().optional(),schematic_component_id:F.string().optional(),schematic_symbol_id:F.string().optional(),fill_color:F.string().optional(),is_filled:F.boolean().optional(),is_dashed:F.boolean().default(!1),stroke_width:On.nullable().optional(),stroke_color:F.string().optional(),dash_length:On.optional(),dash_gap:On.optional(),points:F.array(Hr),subcircuit_id:F.string().optional()}),yIn=F.record(F.object({left_margin:sr.optional(),right_margin:sr.optional(),top_margin:sr.optional(),bottom_margin:sr.optional()})),xIn=F.object({left_size:F.number(),right_size:F.number(),top_size:F.number().optional(),bottom_size:F.number().optional()}),CIn=F.object({left_side:F.object({pins:F.array(F.number()),direction:F.enum(["top-to-bottom","bottom-to-top"]).optional()}).optional(),right_side:F.object({pins:F.array(F.number()),direction:F.enum(["top-to-bottom","bottom-to-top"]).optional()}).optional(),top_side:F.object({pins:F.array(F.number()),direction:F.enum(["left-to-right","right-to-left"]).optional()}).optional(),bottom_side:F.object({pins:F.array(F.number()),direction:F.enum(["left-to-right","right-to-left"]).optional()}).optional()}),bIn=F.union([xIn,CIn]),IIn=F.object({type:F.literal("schematic_component"),size:Eat,center:Hr,source_component_id:F.string().optional(),schematic_component_id:F.string(),schematic_sheet_id:F.string().optional(),schematic_symbol_id:F.string().optional(),pin_spacing:sr.optional(),pin_styles:yIn.optional(),box_width:sr.optional(),symbol_name:F.string().optional(),port_arrangement:bIn.optional(),port_labels:F.record(F.string()).optional(),symbol_display_value:F.string().optional(),subcircuit_id:F.string().optional(),schematic_group_id:F.string().optional(),is_schematic_group:F.boolean().optional(),source_group_id:F.string().optional(),is_box_with_pins:F.boolean().optional().default(!0)}),eJr=F.object({kicad_symbol:H6n.optional()}).catchall(F.unknown()),vIn=F.object({type:F.literal("schematic_symbol"),schematic_symbol_id:F.string(),name:F.string().optional(),metadata:eJr.optional()}).describe("Defines a named schematic symbol that can be referenced by components."),SIn=F.object({type:F.literal("schematic_line"),schematic_line_id:ao("schematic_line"),schematic_sheet_id:F.string().optional(),schematic_component_id:F.string().optional(),schematic_symbol_id:F.string().optional(),x1:On,y1:On,x2:On,y2:On,stroke_width:On.nullable().optional(),color:F.string().default("#000000"),is_dashed:F.boolean().default(!1),dash_length:On.optional(),dash_gap:On.optional(),subcircuit_id:F.string().optional()}).describe("Draws a styled line on the schematic"),PIn=F.object({type:F.literal("schematic_rect"),schematic_rect_id:ao("schematic_rect"),schematic_sheet_id:F.string().optional(),schematic_component_id:F.string().optional(),schematic_symbol_id:F.string().optional(),center:Hr,width:On,height:On,rotation:Zm.default(0),stroke_width:On.nullable().optional(),color:F.string().default("#000000"),is_filled:F.boolean().default(!1),fill_color:F.string().optional(),is_dashed:F.boolean().default(!1),subcircuit_id:F.string().optional()}).describe("Draws a styled rectangle on the schematic"),EIn=F.object({type:F.literal("schematic_circle"),schematic_circle_id:ao("schematic_circle"),schematic_sheet_id:F.string().optional(),schematic_component_id:F.string().optional(),schematic_symbol_id:F.string().optional(),center:Hr,radius:On,stroke_width:On.nullable().optional(),color:F.string().default("#000000"),is_filled:F.boolean().default(!1),fill_color:F.string().optional(),is_dashed:F.boolean().default(!1),subcircuit_id:F.string().optional()}).describe("Draws a styled circle on the schematic"),MIn=F.object({type:F.literal("schematic_arc"),schematic_arc_id:ao("schematic_arc"),schematic_sheet_id:F.string().optional(),schematic_component_id:F.string().optional(),schematic_symbol_id:F.string().optional(),center:Hr,radius:On,start_angle_degrees:Zm,end_angle_degrees:Zm,direction:F.enum(["clockwise","counterclockwise"]).default("counterclockwise"),stroke_width:On.nullable().optional(),color:F.string().default("#000000"),is_dashed:F.boolean().default(!1),subcircuit_id:F.string().optional()}).describe("Draws a styled arc on the schematic"),wIn=F.object({type:F.literal("schematic_trace"),schematic_trace_id:F.string(),schematic_sheet_id:F.string().optional(),source_trace_id:F.string().optional(),junctions:F.array(F.object({x:F.number(),y:F.number()})),edges:F.array(F.object({from:F.object({x:F.number(),y:F.number()}),to:F.object({x:F.number(),y:F.number()}),is_crossing:F.boolean().optional(),from_schematic_port_id:F.string().optional(),to_schematic_port_id:F.string().optional()})),subcircuit_id:F.string().optional(),subcircuit_connectivity_map_key:F.string().optional()}),tJr=F.enum(["center","left","right","top","bottom"]),BIn=F.object({type:F.literal("schematic_text"),schematic_sheet_id:F.string().optional(),schematic_component_id:F.string().optional(),schematic_symbol_id:F.string().optional(),schematic_text_id:F.string(),text:F.string(),font_size:F.number().default(0.18),position:F.object({x:On,y:On}),rotation:F.number().default(0),anchor:F.union([tJr.describe("legacy"),_T]).default("center"),color:F.string().default("#000000"),subcircuit_id:F.string().optional()}),TIn=F.object({type:F.literal("schematic_port"),schematic_port_id:F.string(),source_port_id:F.string(),schematic_sheet_id:F.string().optional(),schematic_component_id:F.string().optional(),center:Hr,facing_direction:F.enum(["up","down","left","right"]).optional(),distance_from_component_edge:F.number().optional(),side_of_component:F.enum(["top","bottom","left","right"]).optional(),true_ccw_index:F.number().optional(),pin_number:F.number().optional(),display_pin_label:F.string().optional(),subcircuit_id:F.string().optional(),is_connected:F.boolean().optional(),has_input_arrow:F.boolean().optional(),has_output_arrow:F.boolean().optional(),is_drawn_with_inversion_circle:F.boolean().optional()}).describe("Defines a port on a schematic component"),DIn=F.object({type:F.literal("schematic_net_label"),schematic_net_label_id:ao("schematic_net_label"),schematic_sheet_id:F.string().optional(),schematic_trace_id:F.string().optional(),source_trace_id:F.string().optional(),source_net_id:F.string(),center:Hr,anchor_position:Hr.optional(),anchor_side:F.enum(["top","bottom","left","right"]),text:F.string(),symbol_name:F.string().optional(),is_movable:F.boolean().optional(),subcircuit_id:F.string().optional()}),NIn=rh.extend({type:F.literal("schematic_error"),schematic_error_id:F.string(),error_type:F.literal("schematic_port_not_found").default("schematic_port_not_found"),subcircuit_id:F.string().optional()}).describe("Defines a schematic error on the schematic"),RIn=rh.extend({type:F.literal("schematic_layout_error"),schematic_layout_error_id:ao("schematic_layout_error"),error_type:F.literal("schematic_layout_error").default("schematic_layout_error"),source_group_id:F.string(),schematic_group_id:F.string(),subcircuit_id:F.string().optional()}).describe("Error emitted when schematic layout fails for a group"),i7e=F.object({type:F.literal("schematic_debug_object"),label:F.string().optional(),subcircuit_id:F.string().optional()}),QIn=i7e.extend({shape:F.literal("rect"),center:Hr,size:Eat}),kIn=i7e.extend({shape:F.literal("line"),start:Hr,end:Hr}),LIn=i7e.extend({shape:F.literal("point"),center:Hr}),HIn=F.discriminatedUnion("shape",[QIn,kIn,LIn]),FIn=F.object({type:F.literal("schematic_voltage_probe"),schematic_voltage_probe_id:F.string(),schematic_sheet_id:F.string().optional(),source_component_id:F.string().optional(),name:F.string().optional(),position:Hr,schematic_trace_id:F.string(),voltage:dT.optional(),subcircuit_id:F.string().optional(),color:F.string().optional(),label_alignment:_T.optional()}).describe("Defines a voltage probe measurement point on a schematic trace"),zIn=F.object({type:F.literal("schematic_manual_edit_conflict_warning"),schematic_manual_edit_conflict_warning_id:ao("schematic_manual_edit_conflict_warning"),warning_type:F.literal("schematic_manual_edit_conflict_warning").default("schematic_manual_edit_conflict_warning"),message:F.string(),schematic_component_id:F.string(),schematic_group_id:F.string().optional(),subcircuit_id:F.string().optional(),source_component_id:F.string()}).describe("Warning emitted when a component has both manual placement and explicit schX/schY coordinates"),OIn=F.object({type:F.literal("schematic_group"),schematic_group_id:ao("schematic_group"),schematic_sheet_id:F.string().optional(),source_group_id:F.string(),is_subcircuit:F.boolean().optional(),subcircuit_id:F.string().optional(),width:sr,height:sr,center:Hr,schematic_component_ids:F.array(F.string()),show_as_schematic_box:F.boolean().optional(),name:F.string().optional(),description:F.string().optional()}).describe("Defines a group of components on the schematic"),VIn=F.object({type:F.literal("schematic_table"),schematic_table_id:ao("schematic_table"),schematic_sheet_id:F.string().optional(),anchor_position:Hr,column_widths:F.array(On),row_heights:F.array(On),cell_padding:On.optional(),border_width:On.optional(),subcircuit_id:F.string().optional(),schematic_component_id:F.string().optional(),anchor:_T.optional()}).describe("Defines a table on the schematic"),YIn=F.object({type:F.literal("schematic_table_cell"),schematic_table_cell_id:ao("schematic_table_cell"),schematic_sheet_id:F.string().optional(),schematic_table_id:F.string(),start_row_index:F.number(),end_row_index:F.number(),start_column_index:F.number(),end_column_index:F.number(),text:F.string().optional(),center:Hr,width:On,height:On,horizontal_align:F.enum(["left","center","right"]).optional(),vertical_align:F.enum(["top","middle","bottom"]).optional(),font_size:On.optional(),subcircuit_id:F.string().optional()}).describe("Defines a cell within a schematic_table"),GIn=F.object({type:F.literal("schematic_sheet"),schematic_sheet_id:ao("schematic_sheet"),name:F.string().optional(),sheet_index:F.number().optional(),subcircuit_id:F.string().optional(),outline_color:F.string().optional()}).describe("Defines a schematic sheet or page that components can be placed on"),UIn=F.object({x:On,y:On,bulge:F.number().optional()}),Bit=F.object({vertices:F.array(UIn)}),tct=F.object({outer_ring:Bit,inner_rings:F.array(Bit).default([])}),WIn=F.object({x:On,y:On,via:F.boolean().optional(),via_to_layer:uc.optional()}),nJr=F.array(WIn),XIn=F.object({x:On,y:On,via:F.boolean().optional(),to_layer:uc.optional(),trace_width:On.optional()}),jIn=F.object({min_trace_width:sr.optional(),min_board_edge_clearance:sr.optional(),min_via_hole_edge_to_via_hole_edge_clearance:sr.optional(),min_plated_hole_drill_edge_to_drill_edge_clearance:sr.optional(),min_trace_to_pad_edge_clearance:sr.optional(),min_pad_edge_to_pad_edge_clearance:sr.optional(),min_same_net_trace_edge_to_trace_edge_clearance:sr.optional(),min_different_net_trace_edge_to_trace_edge_clearance:sr.optional(),min_via_edge_to_pad_edge_clearance:sr.optional(),min_via_hole_diameter:sr.optional(),min_via_pad_diameter:sr.optional()}),KIn=F.object({type:F.literal("pcb_component"),pcb_component_id:ao("pcb_component"),source_component_id:F.string(),center:Hr,layer:uc,rotation:Zm,display_offset_x:F.string().optional().describe("How to display the x offset for this part, usually corresponding with how the user specified it"),display_offset_y:F.string().optional().describe("How to display the y offset for this part, usually corresponding with how the user specified it"),width:sr,height:sr,do_not_place:F.boolean().optional(),is_allowed_to_be_off_board:F.boolean().optional(),subcircuit_id:F.string().optional(),pcb_group_id:F.string().optional(),position_mode:F.enum(["packed","relative_to_group_anchor","relative_to_another_component","none"]).optional(),anchor_position:Hr.optional(),anchor_alignment:_T.optional(),positioned_relative_to_pcb_group_id:F.string().optional(),positioned_relative_to_pcb_board_id:F.string().optional(),cable_insertion_center:Hr.optional(),insertion_direction:F.enum(["from_above","from_left","from_right","from_front","from_back"]).optional(),metadata:F.object({kicad_footprint:N6n.optional()}).optional(),obstructs_within_bounds:F.boolean().default(!0).describe("Does this component take up all the space within its bounds on a layer. This is generally true except for when separated pin headers are being represented by a single component (in which case, chips can be placed between the pin headers) or for tall modules where chips fit underneath")}).describe("Defines a component on the PCB"),$In=F.object({type:F.literal("pcb_hole"),pcb_hole_id:ao("pcb_hole"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),pcb_component_id:F.string().optional(),hole_shape:F.literal("circle"),hole_diameter:F.number(),x:On,y:On,is_covered_with_solder_mask:F.boolean().optional(),soldermask_margin:F.number().optional()}),oJr=$In.describe("Defines a circular hole on the PCB"),qIn=F.object({type:F.literal("pcb_hole"),pcb_hole_id:ao("pcb_hole"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),pcb_component_id:F.string().optional(),hole_shape:F.literal("rect"),hole_width:F.number(),hole_height:F.number(),x:On,y:On,is_covered_with_solder_mask:F.boolean().optional(),soldermask_margin:F.number().optional()}),rJr=qIn.describe("Defines a rectangular (square-capable) hole on the PCB. Use equal width/height for square."),JIn=F.object({type:F.literal("pcb_hole"),pcb_hole_id:ao("pcb_hole"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),pcb_component_id:F.string().optional(),hole_shape:F.enum(["circle","square"]),hole_diameter:F.number(),x:On,y:On,is_covered_with_solder_mask:F.boolean().optional(),soldermask_margin:F.number().optional()}),iJr=JIn.describe("Defines a circular or square hole on the PCB"),ZIn=F.object({type:F.literal("pcb_hole"),pcb_hole_id:ao("pcb_hole"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),pcb_component_id:F.string().optional(),hole_shape:F.literal("oval"),hole_width:F.number(),hole_height:F.number(),x:On,y:On,is_covered_with_solder_mask:F.boolean().optional(),soldermask_margin:F.number().optional()}),sJr=ZIn.describe("Defines an oval hole on the PCB"),e9n=F.object({type:F.literal("pcb_hole"),pcb_hole_id:ao("pcb_hole"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),pcb_component_id:F.string().optional(),hole_shape:F.literal("pill"),hole_width:F.number(),hole_height:F.number(),x:On,y:On,is_covered_with_solder_mask:F.boolean().optional(),soldermask_margin:F.number().optional()});var aJr=e9n.describe("Defines a pill-shaped hole on the PCB"),t9n=F.object({type:F.literal("pcb_hole"),pcb_hole_id:ao("pcb_hole"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),pcb_component_id:F.string().optional(),hole_shape:F.literal("rotated_pill"),hole_width:F.number(),hole_height:F.number(),x:On,y:On,ccw_rotation:Zm,is_covered_with_solder_mask:F.boolean().optional(),soldermask_margin:F.number().optional()}),cJr=t9n.describe("Defines a rotated pill-shaped hole on the PCB"),n9n=JIn.or(ZIn).or(e9n).or(t9n).or($In).or(qIn),lJr=F.object({type:F.literal("pcb_plated_hole"),shape:F.literal("circle"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),outer_diameter:F.number(),hole_diameter:F.number(),is_covered_with_solder_mask:F.boolean().optional(),x:On,y:On,layers:F.array(uc),port_hints:F.array(F.string()).optional(),pcb_component_id:F.string().optional(),pcb_port_id:F.string().optional(),pcb_plated_hole_id:ao("pcb_plated_hole"),soldermask_margin:F.number().optional()}),hJr=F.object({type:F.literal("pcb_plated_hole"),shape:F.enum(["oval","pill"]),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),outer_width:F.number(),outer_height:F.number(),hole_width:F.number(),hole_height:F.number(),is_covered_with_solder_mask:F.boolean().optional(),x:On,y:On,ccw_rotation:Zm,layers:F.array(uc),port_hints:F.array(F.string()).optional(),pcb_component_id:F.string().optional(),pcb_port_id:F.string().optional(),pcb_plated_hole_id:ao("pcb_plated_hole"),soldermask_margin:F.number().optional()}),dJr=F.object({type:F.literal("pcb_plated_hole"),shape:F.literal("circular_hole_with_rect_pad"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),hole_shape:F.literal("circle"),pad_shape:F.literal("rect"),hole_diameter:F.number(),rect_pad_width:F.number(),rect_pad_height:F.number(),rect_border_radius:F.number().optional(),hole_offset_x:On.default(0),hole_offset_y:On.default(0),is_covered_with_solder_mask:F.boolean().optional(),x:On,y:On,layers:F.array(uc),port_hints:F.array(F.string()).optional(),pcb_component_id:F.string().optional(),pcb_port_id:F.string().optional(),pcb_plated_hole_id:ao("pcb_plated_hole"),soldermask_margin:F.number().optional(),rect_ccw_rotation:Zm.optional()}),uJr=F.object({type:F.literal("pcb_plated_hole"),shape:F.literal("pill_hole_with_rect_pad"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),hole_shape:F.literal("pill"),pad_shape:F.literal("rect"),hole_width:F.number(),hole_height:F.number(),rect_pad_width:F.number(),rect_pad_height:F.number(),rect_border_radius:F.number().optional(),hole_offset_x:On.default(0),hole_offset_y:On.default(0),is_covered_with_solder_mask:F.boolean().optional(),x:On,y:On,layers:F.array(uc),port_hints:F.array(F.string()).optional(),pcb_component_id:F.string().optional(),pcb_port_id:F.string().optional(),pcb_plated_hole_id:ao("pcb_plated_hole"),soldermask_margin:F.number().optional()}),pJr=F.object({type:F.literal("pcb_plated_hole"),shape:F.literal("rotated_pill_hole_with_rect_pad"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),hole_shape:F.literal("rotated_pill"),pad_shape:F.literal("rect"),hole_width:F.number(),hole_height:F.number(),hole_ccw_rotation:Zm,rect_pad_width:F.number(),rect_pad_height:F.number(),rect_border_radius:F.number().optional(),rect_ccw_rotation:Zm,hole_offset_x:On.default(0),hole_offset_y:On.default(0),is_covered_with_solder_mask:F.boolean().optional(),x:On,y:On,layers:F.array(uc),port_hints:F.array(F.string()).optional(),pcb_component_id:F.string().optional(),pcb_port_id:F.string().optional(),pcb_plated_hole_id:ao("pcb_plated_hole"),soldermask_margin:F.number().optional()}),mJr=F.object({type:F.literal("pcb_plated_hole"),shape:F.literal("hole_with_polygon_pad"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),hole_shape:F.enum(["circle","oval","pill","rotated_pill"]),hole_diameter:F.number().optional(),hole_width:F.number().optional(),hole_height:F.number().optional(),pad_outline:F.array(F.object({x:On,y:On})).min(3),hole_offset_x:On.default(0),hole_offset_y:On.default(0),is_covered_with_solder_mask:F.boolean().optional(),x:On,y:On,layers:F.array(uc),port_hints:F.array(F.string()).optional(),pcb_component_id:F.string().optional(),pcb_port_id:F.string().optional(),pcb_plated_hole_id:ao("pcb_plated_hole"),soldermask_margin:F.number().optional(),ccw_rotation:Zm.optional()}),o9n=F.union([lJr,hJr,dJr,uJr,pJr,mJr]),r9n=F.object({type:F.literal("pcb_port"),pcb_port_id:ao("pcb_port"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),source_port_id:F.string(),pcb_component_id:F.string().optional(),x:On,y:On,layers:F.array(uc),is_board_pinout:F.boolean().optional()}).describe("Defines a port on the PCB"),_Jr=F.object({type:F.literal("pcb_smtpad"),shape:F.literal("circle"),pcb_smtpad_id:ao("pcb_smtpad"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),x:On,y:On,radius:F.number(),layer:uc,port_hints:F.array(F.string()).optional(),pcb_component_id:F.string().optional(),pcb_port_id:F.string().optional(),is_covered_with_solder_mask:F.boolean().optional(),soldermask_margin:F.number().optional()}),gJr=F.object({type:F.literal("pcb_smtpad"),shape:F.literal("rect"),pcb_smtpad_id:ao("pcb_smtpad"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),x:On,y:On,width:F.number(),height:F.number(),rect_border_radius:F.number().optional(),corner_radius:F.number().optional(),layer:uc,port_hints:F.array(F.string()).optional(),pcb_component_id:F.string().optional(),pcb_port_id:F.string().optional(),is_covered_with_solder_mask:F.boolean().optional(),soldermask_margin:F.number().optional(),soldermask_margin_left:F.number().optional(),soldermask_margin_top:F.number().optional(),soldermask_margin_right:F.number().optional(),soldermask_margin_bottom:F.number().optional()}),AJr=F.object({type:F.literal("pcb_smtpad"),shape:F.literal("rotated_rect"),pcb_smtpad_id:ao("pcb_smtpad"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),x:On,y:On,width:F.number(),height:F.number(),rect_border_radius:F.number().optional(),corner_radius:F.number().optional(),ccw_rotation:Zm,layer:uc,port_hints:F.array(F.string()).optional(),pcb_component_id:F.string().optional(),pcb_port_id:F.string().optional(),is_covered_with_solder_mask:F.boolean().optional(),soldermask_margin:F.number().optional(),soldermask_margin_left:F.number().optional(),soldermask_margin_top:F.number().optional(),soldermask_margin_right:F.number().optional(),soldermask_margin_bottom:F.number().optional()}),i9n=F.object({type:F.literal("pcb_smtpad"),shape:F.literal("pill"),pcb_smtpad_id:ao("pcb_smtpad"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),x:On,y:On,width:F.number(),height:F.number(),radius:F.number(),layer:uc,port_hints:F.array(F.string()).optional(),pcb_component_id:F.string().optional(),pcb_port_id:F.string().optional(),is_covered_with_solder_mask:F.boolean().optional(),soldermask_margin:F.number().optional()}),fJr=F.object({type:F.literal("pcb_smtpad"),shape:F.literal("rotated_pill"),pcb_smtpad_id:ao("pcb_smtpad"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),x:On,y:On,width:F.number(),height:F.number(),radius:F.number(),ccw_rotation:Zm,layer:uc,port_hints:F.array(F.string()).optional(),pcb_component_id:F.string().optional(),pcb_port_id:F.string().optional(),is_covered_with_solder_mask:F.boolean().optional(),soldermask_margin:F.number().optional()}),yJr=F.object({type:F.literal("pcb_smtpad"),shape:F.literal("polygon"),pcb_smtpad_id:ao("pcb_smtpad"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),points:F.array(Hr),layer:uc,port_hints:F.array(F.string()).optional(),pcb_component_id:F.string().optional(),pcb_port_id:F.string().optional(),is_covered_with_solder_mask:F.boolean().optional(),soldermask_margin:F.number().optional()}),s9n=F.discriminatedUnion("shape",[_Jr,gJr,AJr,fJr,i9n,yJr]).describe("Defines an SMT pad on the PCB"),xJr=F.object({type:F.literal("pcb_solder_paste"),shape:F.literal("circle"),pcb_solder_paste_id:ao("pcb_solder_paste"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),x:On,y:On,radius:F.number(),layer:uc,pcb_component_id:F.string().optional(),pcb_smtpad_id:F.string().optional()}),CJr=F.object({type:F.literal("pcb_solder_paste"),shape:F.literal("rect"),pcb_solder_paste_id:ao("pcb_solder_paste"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),x:On,y:On,width:F.number(),height:F.number(),layer:uc,pcb_component_id:F.string().optional(),pcb_smtpad_id:F.string().optional()}),bJr=F.object({type:F.literal("pcb_solder_paste"),shape:F.literal("pill"),pcb_solder_paste_id:ao("pcb_solder_paste"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),x:On,y:On,width:F.number(),height:F.number(),radius:F.number(),layer:uc,pcb_component_id:F.string().optional(),pcb_smtpad_id:F.string().optional()}),IJr=F.object({type:F.literal("pcb_solder_paste"),shape:F.literal("rotated_rect"),pcb_solder_paste_id:ao("pcb_solder_paste"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),x:On,y:On,width:F.number(),height:F.number(),ccw_rotation:On,layer:uc,pcb_component_id:F.string().optional(),pcb_smtpad_id:F.string().optional()}),vJr=F.object({type:F.literal("pcb_solder_paste"),shape:F.literal("oval"),pcb_solder_paste_id:ao("pcb_solder_paste"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),x:On,y:On,width:F.number(),height:F.number(),layer:uc,pcb_component_id:F.string().optional(),pcb_smtpad_id:F.string().optional()}),a9n=F.union([xJr,CJr,bJr,IJr,vJr]).describe("Defines solderpaste on the PCB"),c9n=F.object({type:F.literal("pcb_text"),pcb_text_id:ao("pcb_text"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),text:F.string(),center:Hr,layer:uc,width:sr,height:sr,lines:F.number(),align:F.enum(["bottom-left"])}).describe("Defines text on the PCB"),l9n=F.object({route_type:F.literal("wire"),x:On,y:On,width:On,copper_pour_id:F.string().optional(),is_inside_copper_pour:F.boolean().optional(),start_pcb_port_id:F.string().optional(),end_pcb_port_id:F.string().optional(),layer:uc}),h9n=F.object({route_type:F.literal("via"),x:On,y:On,copper_pour_id:F.string().optional(),is_inside_copper_pour:F.boolean().optional(),hole_diameter:On.optional(),outer_diameter:On.optional(),from_layer:uc,to_layer:uc}),d9n=F.object({route_type:F.literal("through_pad"),start:Hr,end:Hr,width:On,start_layer:uc,end_layer:uc,pcb_smtpad_id:F.string().optional(),pcb_plated_hole_id:F.string().optional()}),u9n=F.union([l9n,h9n,d9n]),p9n=F.object({type:F.literal("pcb_trace"),source_trace_id:F.string().optional(),pcb_component_id:F.string().optional(),pcb_trace_id:ao("pcb_trace"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),route_thickness_mode:F.enum(["constant","interpolated"]).default("constant").optional(),route_order_index:F.number().optional(),should_round_corners:F.boolean().optional(),trace_length:F.number().optional(),highlight_color:F.string().optional(),route:F.array(u9n)}).describe("Defines a trace on the PCB"),m9n=F.object({type:F.literal("pcb_trace_warning"),pcb_trace_warning_id:ao("pcb_trace_warning"),warning_type:F.literal("pcb_trace_warning").default("pcb_trace_warning"),message:F.string(),center:Hr.optional(),pcb_trace_id:F.string(),source_trace_id:F.string(),pcb_component_ids:F.array(F.string()),pcb_port_ids:F.array(F.string()),subcircuit_id:F.string().optional()}).describe("Defines a trace warning on the PCB"),_9n=F.object({type:F.literal("pcb_trace_too_long_warning"),pcb_trace_too_long_warning_id:ao("pcb_trace_too_long_warning"),warning_type:F.literal("pcb_trace_too_long_warning").default("pcb_trace_too_long_warning"),message:F.string(),pcb_trace_id:F.string(),source_net_id:F.string().optional(),source_trace_id:F.string().optional(),actual_trace_length:On,maximum_trace_length:On,subcircuit_id:F.string().optional()}).describe("Warning emitted when a PCB trace is longer than its maximum allowed length"),g9n=rh.extend({type:F.literal("pcb_trace_error"),pcb_trace_error_id:ao("pcb_trace_error"),error_type:F.literal("pcb_trace_error").default("pcb_trace_error"),center:Hr.optional(),pcb_trace_id:F.string(),source_trace_id:F.string(),pcb_component_ids:F.array(F.string()),pcb_port_ids:F.array(F.string()),subcircuit_id:F.string().optional()}).describe("Defines a trace error on the PCB"),A9n=rh.extend({type:F.literal("pcb_trace_missing_error"),pcb_trace_missing_error_id:ao("pcb_trace_missing_error"),error_type:F.literal("pcb_trace_missing_error").default("pcb_trace_missing_error"),center:Hr.optional(),source_trace_id:F.string(),pcb_component_ids:F.array(F.string()),pcb_port_ids:F.array(F.string()),subcircuit_id:F.string().optional()}).describe("Defines an error when a source trace has no corresponding PCB trace"),f9n=rh.extend({type:F.literal("pcb_port_not_matched_error"),pcb_error_id:ao("pcb_error"),error_type:F.literal("pcb_port_not_matched_error").default("pcb_port_not_matched_error"),pcb_component_ids:F.array(F.string()),subcircuit_id:F.string().optional()}).describe("Defines a trace error on the PCB where a port is not matched"),y9n=rh.extend({type:F.literal("pcb_port_not_connected_error"),pcb_port_not_connected_error_id:ao("pcb_port_not_connected_error"),error_type:F.literal("pcb_port_not_connected_error").default("pcb_port_not_connected_error"),pcb_port_ids:F.array(F.string()),pcb_component_ids:F.array(F.string()),subcircuit_id:F.string().optional()}).describe("Defines an error when a pcb port is not connected to any trace"),x9n=F.object({type:F.literal("pcb_net"),pcb_net_id:ao("pcb_net"),source_net_id:F.string().optional(),highlight_color:F.string().optional()}).describe("Defines a net on the PCB"),C9n=F.object({type:F.literal("pcb_via"),pcb_via_id:ao("pcb_via"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),subcircuit_connectivity_map_key:F.string().optional(),x:On,y:On,outer_diameter:On.default("0.6mm"),hole_diameter:On.default("0.25mm"),from_layer:uc.optional(),to_layer:uc.optional(),layers:F.array(uc),pcb_trace_id:F.string().optional(),net_is_assignable:F.boolean().optional(),net_assigned:F.boolean().optional(),is_tented:F.boolean().optional()}).describe("Defines a via on the PCB"),b9n=F.object({type:F.literal("pcb_board"),pcb_board_id:ao("pcb_board"),pcb_panel_id:F.string().optional(),carrier_pcb_board_id:F.string().optional(),is_subcircuit:F.boolean().optional(),subcircuit_id:F.string().optional(),is_mounted_to_carrier_board:F.boolean().optional(),width:sr.optional(),height:sr.optional(),center:Hr,display_offset_x:F.string().optional().describe("How to display the x offset for this board, usually corresponding with how the user specified it"),display_offset_y:F.string().optional().describe("How to display the y offset for this board, usually corresponding with how the user specified it"),thickness:sr.optional().default(1.4),num_layers:F.number().optional().default(4),outline:F.array(Hr).optional(),shape:F.enum(["rect","polygon"]).optional(),material:F.enum(["fr4","fr1"]).default("fr4"),solder_mask_color:F.string().optional(),silkscreen_color:F.string().optional(),anchor_position:Hr.optional(),anchor_alignment:_T.optional(),position_mode:F.enum(["relative_to_panel_anchor","none"]).optional()}).merge(jIn).describe("Defines the board outline of the PCB"),I9n=F.object({type:F.literal("pcb_panel"),pcb_panel_id:ao("pcb_panel"),width:sr,height:sr,center:Hr,thickness:sr.optional().default(1.4),covered_with_solder_mask:F.boolean().optional().default(!0)}).describe("Defines a PCB panel that can contain multiple boards"),v9n=rh.extend({type:F.literal("pcb_placement_error"),pcb_placement_error_id:ao("pcb_placement_error"),error_type:F.literal("pcb_placement_error").default("pcb_placement_error"),subcircuit_id:F.string().optional()}).describe("Defines a placement error on the PCB"),S9n=rh.extend({type:F.literal("pcb_panelization_placement_error"),pcb_panelization_placement_error_id:ao("pcb_panelization_placement_error"),error_type:F.literal("pcb_panelization_placement_error").default("pcb_panelization_placement_error"),pcb_panel_id:F.string().optional(),pcb_board_id:F.string().optional(),subcircuit_id:F.string().optional()}).describe("Defines a panelization placement error on the PCB"),P9n=F.object({type:F.literal("pcb_trace_hint"),pcb_trace_hint_id:ao("pcb_trace_hint"),pcb_port_id:F.string(),pcb_component_id:F.string(),route:F.array(XIn),subcircuit_id:F.string().optional()}).describe("A hint that can be used during generation of a PCB trace"),E9n=F.object({type:F.literal("pcb_silkscreen_line"),pcb_silkscreen_line_id:ao("pcb_silkscreen_line"),pcb_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),stroke_width:On.default("0.1mm"),x1:On,y1:On,x2:On,y2:On,layer:nA}).describe("Defines a silkscreen line on the PCB"),M9n=F.object({type:F.literal("pcb_silkscreen_path"),pcb_silkscreen_path_id:ao("pcb_silkscreen_path"),pcb_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),layer:nA,route:F.array(Hr),stroke_width:sr}).describe("Defines a silkscreen path on the PCB"),w9n=F.object({type:F.literal("pcb_silkscreen_text"),pcb_silkscreen_text_id:ao("pcb_silkscreen_text"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),font:F.literal("tscircuit2024").default("tscircuit2024"),font_size:On.default("0.2mm"),pcb_component_id:F.string(),text:F.string(),is_knockout:F.boolean().default(!1).optional(),knockout_padding:F.object({left:sr,top:sr,bottom:sr,right:sr}).default({left:"0.2mm",top:"0.2mm",bottom:"0.2mm",right:"0.2mm"}).optional(),ccw_rotation:F.number().optional(),layer:uc,is_mirrored:F.boolean().default(!1).optional(),anchor_position:Hr.default({x:0,y:0}),anchor_alignment:_T.default("center")}).describe("Defines silkscreen text on the PCB"),B9n=F.object({type:F.literal("pcb_copper_text"),pcb_copper_text_id:ao("pcb_copper_text"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),font:F.literal("tscircuit2024").default("tscircuit2024"),font_size:On.default("0.2mm"),pcb_component_id:F.string(),text:F.string(),is_knockout:F.boolean().default(!1).optional(),knockout_padding:F.object({left:sr,top:sr,bottom:sr,right:sr}).default({left:"0.2mm",top:"0.2mm",bottom:"0.2mm",right:"0.2mm"}).optional(),ccw_rotation:F.number().optional(),layer:uc,is_mirrored:F.boolean().default(!1).optional(),anchor_position:Hr.default({x:0,y:0}),anchor_alignment:_T.default("center")}).describe("Defines copper text on the PCB"),T9n=F.object({type:F.literal("pcb_silkscreen_rect"),pcb_silkscreen_rect_id:ao("pcb_silkscreen_rect"),pcb_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),center:Hr,width:sr,height:sr,layer:uc,stroke_width:sr.default("1mm"),corner_radius:sr.optional(),is_filled:F.boolean().default(!0).optional(),has_stroke:F.boolean().optional(),is_stroke_dashed:F.boolean().optional(),ccw_rotation:F.number().optional()}).describe("Defines a silkscreen rect on the PCB"),D9n=F.object({type:F.literal("pcb_silkscreen_circle"),pcb_silkscreen_circle_id:ao("pcb_silkscreen_circle"),pcb_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),center:Hr,radius:sr,layer:nA,stroke_width:sr.default("1mm"),is_filled:F.boolean().optional()}).describe("Defines a silkscreen circle on the PCB"),N9n=F.object({type:F.literal("pcb_silkscreen_oval"),pcb_silkscreen_oval_id:ao("pcb_silkscreen_oval"),pcb_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),center:Hr,radius_x:On,radius_y:On,layer:nA,ccw_rotation:Zm.optional()}).describe("Defines a silkscreen oval on the PCB"),R9n=F.object({type:F.literal("pcb_silkscreen_graphic"),pcb_silkscreen_graphic_id:ao("pcb_silkscreen_graphic"),pcb_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),layer:nA,image_asset:Mat.optional()}).extend({shape:F.literal("brep"),brep_shape:tct}).describe("Defines a BRep silkscreen graphic on the PCB"),Q9n=F.discriminatedUnion("shape",[R9n]).describe("Defines a silkscreen graphic on the PCB"),k9n=F.object({type:F.literal("pcb_silkscreen_pill"),pcb_silkscreen_pill_id:ao("pcb_silkscreen_pill"),pcb_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),center:Hr,width:sr,height:sr,layer:uc,ccw_rotation:F.number().optional()}).describe("Defines a silkscreen pill on the PCB"),L9n=F.object({type:F.literal("pcb_fabrication_note_text"),pcb_fabrication_note_text_id:ao("pcb_fabrication_note_text"),subcircuit_id:F.string().optional(),pcb_group_id:F.string().optional(),font:F.literal("tscircuit2024").default("tscircuit2024"),font_size:On.default("1mm"),pcb_component_id:F.string(),text:F.string(),ccw_rotation:F.number().optional(),layer:nA,anchor_position:Hr.default({x:0,y:0}),anchor_alignment:F.enum(["center","top_left","top_right","bottom_left","bottom_right"]).default("center"),color:F.string().optional()}).describe("Defines a fabrication note in text on the PCB, useful for leaving notes for assemblers or fabricators"),H9n=F.object({type:F.literal("pcb_fabrication_note_path"),pcb_fabrication_note_path_id:ao("pcb_fabrication_note_path"),pcb_component_id:F.string(),subcircuit_id:F.string().optional(),layer:uc,route:F.array(Hr),stroke_width:sr,color:F.string().optional()}).describe("Defines a fabrication path on the PCB for fabricators or assemblers"),F9n=F.object({type:F.literal("pcb_fabrication_note_rect"),pcb_fabrication_note_rect_id:ao("pcb_fabrication_note_rect"),pcb_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),center:Hr,width:sr,height:sr,layer:nA,stroke_width:sr.default("0.1mm"),corner_radius:sr.optional(),is_filled:F.boolean().optional(),has_stroke:F.boolean().optional(),is_stroke_dashed:F.boolean().optional(),color:F.string().optional()}).describe("Defines a fabrication note rectangle on the PCB"),z9n=F.object({type:F.literal("pcb_fabrication_note_dimension"),pcb_fabrication_note_dimension_id:ao("pcb_fabrication_note_dimension"),pcb_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),layer:nA,from:Hr,to:Hr,text:F.string().optional(),text_ccw_rotation:F.number().optional(),offset:sr.optional(),offset_distance:sr.optional(),offset_direction:F.object({x:F.number(),y:F.number()}).optional(),font:F.literal("tscircuit2024").default("tscircuit2024"),font_size:sr.default("1mm"),color:F.string().optional(),arrow_size:sr.default("1mm")}).describe("Defines a measurement annotation within PCB fabrication notes"),O9n=F.object({type:F.literal("pcb_note_text"),pcb_note_text_id:ao("pcb_note_text"),pcb_component_id:F.string().optional(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),name:F.string().optional(),font:F.literal("tscircuit2024").default("tscircuit2024"),font_size:On.default("1mm"),text:F.string().optional(),anchor_position:Hr.default({x:0,y:0}),anchor_alignment:F.enum(["center","top_left","top_right","bottom_left","bottom_right"]).default("center"),layer:nA.default("top"),is_mirrored_from_top_view:F.boolean().optional(),color:F.string().optional()}).describe("Defines a documentation note in text on the PCB"),V9n=F.object({type:F.literal("pcb_note_rect"),pcb_note_rect_id:ao("pcb_note_rect"),pcb_component_id:F.string().optional(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),name:F.string().optional(),text:F.string().optional(),center:Hr,width:sr,height:sr,layer:nA.default("top"),stroke_width:sr.default("0.1mm"),corner_radius:sr.optional(),is_filled:F.boolean().optional(),has_stroke:F.boolean().optional(),is_stroke_dashed:F.boolean().optional(),color:F.string().optional()}).describe("Defines a rectangular documentation note on the PCB"),Y9n=F.object({type:F.literal("pcb_note_path"),pcb_note_path_id:ao("pcb_note_path"),pcb_component_id:F.string().optional(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),name:F.string().optional(),text:F.string().optional(),route:F.array(Hr),layer:nA.default("top"),stroke_width:sr.default("0.1mm"),color:F.string().optional()}).describe("Defines a polyline documentation note on the PCB"),G9n=F.object({type:F.literal("pcb_note_line"),pcb_note_line_id:ao("pcb_note_line"),pcb_component_id:F.string().optional(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),name:F.string().optional(),text:F.string().optional(),x1:On,y1:On,x2:On,y2:On,layer:nA.default("top"),stroke_width:On.default("0.1mm"),color:F.string().optional(),is_dashed:F.boolean().optional()}).describe("Defines a straight documentation note line on the PCB"),U9n=F.object({type:F.literal("pcb_note_dimension"),pcb_note_dimension_id:ao("pcb_note_dimension"),pcb_component_id:F.string().optional(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),name:F.string().optional(),from:Hr,to:Hr,text:F.string().optional(),text_ccw_rotation:F.number().optional(),offset_distance:sr.optional(),offset_direction:F.object({x:F.number(),y:F.number()}).optional(),font:F.literal("tscircuit2024").default("tscircuit2024"),font_size:sr.default("1mm"),layer:nA.default("top"),color:F.string().optional(),arrow_size:sr.default("1mm")}).describe("Defines a measurement annotation within PCB documentation notes"),W9n=rh.extend({type:F.literal("pcb_footprint_overlap_error"),pcb_error_id:ao("pcb_error"),error_type:F.literal("pcb_footprint_overlap_error").default("pcb_footprint_overlap_error"),pcb_smtpad_ids:F.array(F.string()).optional(),pcb_plated_hole_ids:F.array(F.string()).optional(),pcb_hole_ids:F.array(F.string()).optional(),pcb_keepout_ids:F.array(F.string()).optional()}).describe("Error emitted when a pcb footprint overlaps with another element"),X9n=rh.extend({type:F.literal("pcb_courtyard_overlap_error"),pcb_error_id:ao("pcb_error"),error_type:F.literal("pcb_courtyard_overlap_error").default("pcb_courtyard_overlap_error"),pcb_component_ids:F.tuple([F.string(),F.string()])}).describe("Error emitted when the courtyard (CrtYd) of one PCB component overlaps with the courtyard of another"),j9n=F.object({type:F.literal("pcb_keepout"),shape:F.literal("rect"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),center:Hr,width:On,height:On,pcb_keepout_id:F.string(),layers:F.array(F.string()),description:F.string().optional()}).or(F.object({type:F.literal("pcb_keepout"),shape:F.literal("circle"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),center:Hr,radius:On,pcb_keepout_id:F.string(),layers:F.array(F.string()),description:F.string().optional()})),s7e=F.object({type:F.literal("pcb_cutout"),pcb_cutout_id:ao("pcb_cutout"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),pcb_board_id:F.string().optional(),pcb_panel_id:F.string().optional()}),K9n=s7e.extend({shape:F.literal("rect"),center:Hr,width:sr,height:sr,rotation:Zm.optional(),corner_radius:sr.optional()}),$9n=s7e.extend({shape:F.literal("circle"),center:Hr,radius:sr}),q9n=s7e.extend({shape:F.literal("polygon"),points:F.array(Hr)}),J9n=s7e.extend({shape:F.literal("path"),route:F.array(Hr),slot_width:sr,slot_length:sr.optional(),space_between_slots:sr.optional(),slot_corner_radius:sr.optional()}),Z9n=F.discriminatedUnion("shape",[K9n,$9n,q9n,J9n]).describe("Defines a cutout on the PCB, removing board material."),evn=rh.extend({type:F.literal("pcb_missing_footprint_error"),pcb_missing_footprint_error_id:ao("pcb_missing_footprint_error"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),error_type:F.literal("pcb_missing_footprint_error").default("pcb_missing_footprint_error"),source_component_id:F.string()}).describe("Defines a missing footprint error on the PCB"),tvn=rh.extend({type:F.literal("external_footprint_load_error"),external_footprint_load_error_id:ao("external_footprint_load_error"),pcb_component_id:F.string(),source_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),footprinter_string:F.string().optional(),error_type:F.literal("external_footprint_load_error").default("external_footprint_load_error")}).describe("Defines an error when an external footprint fails to load"),nvn=rh.extend({type:F.literal("circuit_json_footprint_load_error"),circuit_json_footprint_load_error_id:ao("circuit_json_footprint_load_error"),pcb_component_id:F.string(),source_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),error_type:F.literal("circuit_json_footprint_load_error").default("circuit_json_footprint_load_error"),circuit_json:F.array(F.any()).optional()}).describe("Defines an error when a circuit JSON footprint fails to load"),ovn=F.object({type:F.literal("pcb_group"),pcb_group_id:ao("pcb_group"),source_group_id:F.string(),is_subcircuit:F.boolean().optional(),subcircuit_id:F.string().optional(),width:sr.optional(),height:sr.optional(),center:Hr,display_offset_x:F.string().optional().describe("How to display the x offset for this group, usually corresponding with how the user specified it"),display_offset_y:F.string().optional().describe("How to display the y offset for this group, usually corresponding with how the user specified it"),outline:F.array(Hr).optional(),anchor_position:Hr.optional(),anchor_alignment:_T.default("center"),position_mode:F.enum(["packed","relative_to_group_anchor","none"]).optional(),positioned_relative_to_pcb_group_id:F.string().optional(),positioned_relative_to_pcb_board_id:F.string().optional(),pcb_component_ids:F.array(F.string()),child_layout_mode:F.enum(["packed","none"]).optional(),name:F.string().optional(),description:F.string().optional(),layout_mode:F.string().optional(),autorouter_configuration:F.object({trace_clearance:sr}).optional(),autorouter_used_string:F.string().optional()}).describe("Defines a group of components on the PCB"),rvn=rh.extend({type:F.literal("pcb_autorouting_error"),pcb_error_id:ao("pcb_autorouting_error"),error_type:F.literal("pcb_autorouting_error").default("pcb_autorouting_error"),subcircuit_id:F.string().optional()}).describe("The autorouting has failed to route a portion of the board"),ivn=F.object({type:F.literal("pcb_manual_edit_conflict_warning"),pcb_manual_edit_conflict_warning_id:ao("pcb_manual_edit_conflict_warning"),warning_type:F.literal("pcb_manual_edit_conflict_warning").default("pcb_manual_edit_conflict_warning"),message:F.string(),pcb_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),source_component_id:F.string()}).describe("Warning emitted when a component has both manual placement and explicit pcbX/pcbY coordinates"),c1n=F.enum(["x-","x+","y+","y-"]),svn=F.object({type:F.literal("pcb_connector_not_in_accessible_orientation_warning"),pcb_connector_not_in_accessible_orientation_warning_id:ao("pcb_connector_not_in_accessible_orientation_warning"),warning_type:F.literal("pcb_connector_not_in_accessible_orientation_warning").default("pcb_connector_not_in_accessible_orientation_warning"),message:F.string(),pcb_component_id:F.string(),source_component_id:F.string().optional(),pcb_board_id:F.string().optional(),facing_direction:c1n,recommended_facing_direction:c1n,subcircuit_id:F.string().optional()}).describe("Warning emitted when a connector PCB component is facing inward toward the board and should be reoriented to an outward-facing direction"),avn=F.object({type:F.literal("supplier_footprint_mismatch_warning"),supplier_footprint_mismatch_warning_id:ao("supplier_footprint_mismatch_warning"),warning_type:F.literal("supplier_footprint_mismatch_warning").default("supplier_footprint_mismatch_warning"),message:F.string(),source_component_id:F.string(),pcb_component_id:F.string().optional(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),supplier_name:o7e.optional(),supplier_part_number:F.string().optional(),supplier_footprint_url:F.string().optional(),footprint_copper_intersection_over_union:F.number()}).describe("Warning emitted when a supplier part footprint does not match the expected footprint"),cvn=F.object({type:F.literal("pcb_breakout_point"),pcb_breakout_point_id:ao("pcb_breakout_point"),pcb_group_id:F.string(),subcircuit_id:F.string().optional(),source_trace_id:F.string().optional(),source_port_id:F.string().optional(),source_net_id:F.string().optional(),x:On,y:On}).describe("Defines a routing target within a pcb_group for a source_trace or source_net"),lvn=F.object({type:F.literal("pcb_ground_plane"),pcb_ground_plane_id:ao("pcb_ground_plane"),source_pcb_ground_plane_id:F.string(),source_net_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional()}).describe("Defines a ground plane on the PCB"),hvn=F.object({type:F.literal("pcb_ground_plane_region"),pcb_ground_plane_region_id:ao("pcb_ground_plane_region"),pcb_ground_plane_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),layer:uc,points:F.array(Hr)}).describe("Defines a polygon region of a ground plane"),dvn=F.object({type:F.literal("pcb_thermal_spoke"),pcb_thermal_spoke_id:ao("pcb_thermal_spoke"),pcb_ground_plane_id:F.string(),shape:F.string(),spoke_count:F.number(),spoke_thickness:On,spoke_inner_diameter:On,spoke_outer_diameter:On,pcb_plated_hole_id:F.string().optional(),subcircuit_id:F.string().optional()}).describe("Pattern for connecting a ground plane to a plated hole"),nct=F.object({type:F.literal("pcb_copper_pour"),pcb_copper_pour_id:ao("pcb_copper_pour"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),layer:uc,source_net_id:F.string().optional(),covered_with_solder_mask:F.boolean().optional().default(!0)}),uvn=nct.extend({shape:F.literal("rect"),center:Hr,width:sr,height:sr,rotation:Zm.optional()}),pvn=nct.extend({shape:F.literal("brep"),brep_shape:tct}),mvn=nct.extend({shape:F.literal("polygon"),points:F.array(Hr)}),_vn=F.discriminatedUnion("shape",[uvn,pvn,mvn]).describe("Defines a copper pour on the PCB."),gvn=rh.extend({type:F.literal("pcb_component_outside_board_error"),pcb_component_outside_board_error_id:ao("pcb_component_outside_board_error"),error_type:F.literal("pcb_component_outside_board_error").default("pcb_component_outside_board_error"),pcb_component_id:F.string(),pcb_board_id:F.string(),component_center:Hr,component_bounds:F.object({min_x:F.number(),max_x:F.number(),min_y:F.number(),max_y:F.number()}),subcircuit_id:F.string().optional(),source_component_id:F.string().optional()}).describe("Error emitted when a PCB component is placed outside the board boundaries"),Avn=rh.extend({type:F.literal("pcb_component_not_on_board_edge_error"),pcb_component_not_on_board_edge_error_id:ao("pcb_component_not_on_board_edge_error"),error_type:F.literal("pcb_component_not_on_board_edge_error").default("pcb_component_not_on_board_edge_error"),pcb_component_id:F.string(),pcb_board_id:F.string(),component_center:Hr,pad_to_nearest_board_edge_distance:F.number(),source_component_id:F.string().optional(),subcircuit_id:F.string().optional()}).describe("Error emitted when a component that must be placed on the board edge is centered away from the edge"),fvn=rh.extend({type:F.literal("pcb_component_invalid_layer_error"),pcb_component_invalid_layer_error_id:ao("pcb_component_invalid_layer_error"),error_type:F.literal("pcb_component_invalid_layer_error").default("pcb_component_invalid_layer_error"),pcb_component_id:F.string().optional(),source_component_id:F.string(),layer:uc,subcircuit_id:F.string().optional()}).describe("Error emitted when a component is placed on an invalid layer (components can only be on 'top' or 'bottom' layers)"),yvn=rh.extend({type:F.literal("pcb_via_clearance_error"),pcb_error_id:ao("pcb_error"),error_type:F.literal("pcb_via_clearance_error").default("pcb_via_clearance_error"),pcb_via_ids:F.array(F.string()).min(2),minimum_clearance:On.optional(),actual_clearance:On.optional(),pcb_center:F.object({x:F.number().optional(),y:F.number().optional()}).optional(),subcircuit_id:F.string().optional()}).describe("Error emitted when vias are closer than the allowed clearance"),xvn=rh.extend({type:F.literal("pcb_via_trace_clearance_error"),pcb_via_trace_clearance_error_id:ao("pcb_via_trace_clearance_error"),error_type:F.literal("pcb_via_trace_clearance_error").default("pcb_via_trace_clearance_error"),pcb_via_id:F.string(),pcb_trace_id:F.string(),minimum_clearance:On.optional(),actual_clearance:On.optional(),center:F.object({x:F.number().optional(),y:F.number().optional()}).optional(),subcircuit_id:F.string().optional()}).describe("Error emitted when a via and trace are closer than the allowed clearance"),Cvn=rh.extend({type:F.literal("pcb_pad_pad_clearance_error"),pcb_pad_pad_clearance_error_id:ao("pcb_pad_pad_clearance_error"),error_type:F.literal("pcb_pad_pad_clearance_error").default("pcb_pad_pad_clearance_error"),pcb_pad_ids:F.array(F.string()).min(2),minimum_clearance:On.optional(),actual_clearance:On.optional(),center:F.object({x:F.number().optional(),y:F.number().optional()}).optional(),subcircuit_id:F.string().optional()}).describe("Error emitted when pads are closer than the allowed clearance"),bvn=rh.extend({type:F.literal("pcb_pad_trace_clearance_error"),pcb_pad_trace_clearance_error_id:ao("pcb_pad_trace_clearance_error"),error_type:F.literal("pcb_pad_trace_clearance_error").default("pcb_pad_trace_clearance_error"),pcb_pad_id:F.string(),pcb_trace_id:F.string(),minimum_clearance:On.optional(),actual_clearance:On.optional(),center:F.object({x:F.number().optional(),y:F.number().optional()}).optional(),subcircuit_id:F.string().optional()}).describe("Error emitted when a pad and trace are closer than allowed clearance"),Ivn=F.object({type:F.literal("pcb_courtyard_rect"),pcb_courtyard_rect_id:ao("pcb_courtyard_rect"),pcb_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),center:Hr,width:sr,height:sr,layer:nA,ccw_rotation:Zm.optional(),color:F.string().optional()}).describe("Defines a courtyard rectangle on the PCB"),vvn=F.object({type:F.literal("pcb_courtyard_outline"),pcb_courtyard_outline_id:ao("pcb_courtyard_outline"),pcb_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),layer:nA,outline:F.array(Hr).min(2)}).describe("Defines a courtyard outline on the PCB"),Svn=F.object({type:F.literal("pcb_courtyard_polygon"),pcb_courtyard_polygon_id:ao("pcb_courtyard_polygon"),pcb_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),layer:nA,points:F.array(Hr).min(3),color:F.string().optional()}).describe("Defines a courtyard polygon on the PCB"),Pvn=F.object({type:F.literal("pcb_courtyard_circle"),pcb_courtyard_circle_id:ao("pcb_courtyard_circle"),pcb_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),center:Hr,radius:sr,layer:nA,color:F.string().optional()}).describe("Defines a courtyard circle on the PCB"),Evn=F.object({type:F.literal("pcb_courtyard_pill"),pcb_courtyard_pill_id:ao("pcb_courtyard_pill"),pcb_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),center:Hr,width:sr,height:sr,radius:sr,layer:nA,color:F.string().optional()}).describe("Defines a courtyard pill on the PCB"),SJr=["obj","stl","3mf","gltf","glb","step","wrl"],Mvn=["x+","x-","y+","y-","z+","z-"],PJr={obj:"z+",stl:"z+","3mf":"z+",gltf:"y+",glb:"y+",step:"z+",wrl:"y+"},wvn=F.object({type:F.literal("cad_component"),cad_component_id:F.string(),pcb_component_id:F.string(),source_component_id:F.string(),position:tT,rotation:tT.optional(),size:tT.optional(),layer:uc.optional(),subcircuit_id:F.string().optional(),footprinter_string:F.string().optional(),model_obj_url:F.string().optional(),model_stl_url:F.string().optional(),model_3mf_url:F.string().optional(),model_gltf_url:F.string().optional(),model_glb_url:F.string().optional(),model_step_url:F.string().optional(),model_wrl_url:F.string().optional(),model_asset:Mat.optional(),model_unit_to_mm_scale_factor:F.number().optional(),model_board_normal_direction:F.enum(Mvn).optional().describe(`The direction in the model's coordinate space that is considered "up" or "coming out of the board surface"`),model_origin_position:tT.optional(),model_origin_alignment:F.enum(["unknown","center","center_of_component_on_board_surface","bottom_center_of_component"]).optional(),model_object_fit:F.enum(["contain_within_bounds","fill_bounds"]).optional().default("contain_within_bounds"),model_jscad:F.any().optional(),show_as_translucent_model:F.boolean().optional(),show_as_bounding_box:F.boolean().optional(),anchor_alignment:F.enum(["center","center_of_component_on_board_surface"]).optional().default("center")}).describe("Defines a component on the PCB"),oct=F.enum(["sinewave","square","triangle","sawtooth"]),EJr=F.union([F.string(),F.number()]).transform((e)=>typeof e=="string"?e.endsWith("%")?parseFloat(e.slice(0,-1))/100:parseFloat(e):e).pipe(F.number().min(0,"Duty cycle must be non-negative").max(1,"Duty cycle cannot be greater than 100%")),Bvn=F.object({type:F.literal("simulation_voltage_source"),simulation_voltage_source_id:ao("simulation_voltage_source"),is_dc_source:F.literal(!0).optional().default(!0),positive_source_port_id:F.string().optional(),negative_source_port_id:F.string().optional(),positive_source_net_id:F.string().optional(),negative_source_net_id:F.string().optional(),voltage:dT}).describe("Defines a DC voltage source for simulation"),Tvn=F.object({type:F.literal("simulation_voltage_source"),simulation_voltage_source_id:ao("simulation_voltage_source"),is_dc_source:F.literal(!1),terminal1_source_port_id:F.string().optional(),terminal2_source_port_id:F.string().optional(),terminal1_source_net_id:F.string().optional(),terminal2_source_net_id:F.string().optional(),voltage:dT.optional(),frequency:RG.optional(),peak_to_peak_voltage:dT.optional(),wave_shape:oct.optional(),phase:Zm.optional(),duty_cycle:EJr.optional(),pulse_delay:eA.optional(),rise_time:eA.optional(),fall_time:eA.optional(),pulse_width:eA.optional(),period:eA.optional()}).describe("Defines an AC voltage source for simulation"),Dvn=F.union([Bvn,Tvn]).describe("Defines a voltage source for simulation"),MJr=F.union([F.string(),F.number()]).transform((e)=>typeof e=="string"?e.endsWith("%")?parseFloat(e.slice(0,-1))/100:parseFloat(e):e).pipe(F.number().min(0,"Duty cycle must be non-negative").max(1,"Duty cycle cannot be greater than 100%")),Nvn=F.object({type:F.literal("simulation_current_source"),simulation_current_source_id:ao("simulation_current_source"),is_dc_source:F.literal(!0).optional().default(!0),positive_source_port_id:F.string().optional(),negative_source_port_id:F.string().optional(),positive_source_net_id:F.string().optional(),negative_source_net_id:F.string().optional(),current:wZ}).describe("Defines a DC current source for simulation"),Rvn=F.object({type:F.literal("simulation_current_source"),simulation_current_source_id:ao("simulation_current_source"),is_dc_source:F.literal(!1),terminal1_source_port_id:F.string().optional(),terminal2_source_port_id:F.string().optional(),terminal1_source_net_id:F.string().optional(),terminal2_source_net_id:F.string().optional(),current:wZ.optional(),frequency:RG.optional(),peak_to_peak_current:wZ.optional(),wave_shape:oct.optional(),phase:Zm.optional(),duty_cycle:MJr.optional()}).describe("Defines an AC current source for simulation"),Qvn=F.union([Nvn,Rvn]).describe("Defines a current source for simulation"),kvn=F.union([F.literal("spice_dc_sweep"),F.literal("spice_dc_operating_point"),F.literal("spice_transient_analysis"),F.literal("spice_ac_analysis")]),Lvn=F.object({method:F.enum(["trap","gear"]).optional(),reltol:F.union([F.number(),F.string()]).optional(),abstol:F.union([F.number(),F.string()]).optional(),vntol:F.union([F.number(),F.string()]).optional()}).describe("SPICE solver options for a simulation experiment"),Hvn=F.object({type:F.literal("simulation_experiment"),simulation_experiment_id:ao("simulation_experiment"),name:F.string(),experiment_type:kvn,time_per_step:jZ.optional(),start_time_ms:eA.optional(),end_time_ms:eA.optional(),spice_options:Lvn.optional()}).describe("Defines a simulation experiment configuration"),Fvn=F.object({type:F.literal("simulation_transient_voltage_graph"),simulation_transient_voltage_graph_id:ao("simulation_transient_voltage_graph"),simulation_experiment_id:F.string(),timestamps_ms:F.array(F.number()).optional(),voltage_levels:F.array(F.number()),source_component_id:F.string().optional(),subcircuit_connectivity_map_key:F.string().optional(),time_per_step:jZ,start_time_ms:eA,end_time_ms:eA,name:F.string().optional(),color:F.string().optional()}).describe("Stores voltage measurements over time for a simulation"),zvn=F.object({type:F.literal("simulation_transient_current_graph"),simulation_transient_current_graph_id:ao("simulation_transient_current_graph"),simulation_experiment_id:F.string(),timestamps_ms:F.array(F.number()).optional(),current_levels:F.array(F.number()),source_component_id:F.string().optional(),subcircuit_connectivity_map_key:F.string().optional(),time_per_step:jZ,start_time_ms:eA,end_time_ms:eA,name:F.string().optional(),color:F.string().optional()}).describe("Stores current measurements over time for a simulation"),Ovn=F.object({type:F.literal("simulation_switch"),simulation_switch_id:ao("simulation_switch"),source_component_id:F.string().optional(),closes_at:eA.optional(),opens_at:eA.optional(),starts_closed:F.boolean().optional(),switching_frequency:RG.optional()}).describe("Defines a switch for simulation timing control"),Vvn=F.object({type:F.literal("simulation_voltage_probe"),simulation_voltage_probe_id:ao("simulation_voltage_probe"),source_component_id:F.string().optional(),name:F.string().optional(),signal_input_source_port_id:F.string().optional(),signal_input_source_net_id:F.string().optional(),reference_input_source_port_id:F.string().optional(),reference_input_source_net_id:F.string().optional(),subcircuit_id:F.string().optional(),color:F.string().optional()}).describe("Defines a voltage probe for simulation. If a reference input is not provided, it measures against ground. If a reference input is provided, it measures the differential voltage between two points.").superRefine((e,t)=>{if(e.reference_input_source_port_id||e.reference_input_source_net_id){let n=!!e.signal_input_source_port_id||!!e.reference_input_source_port_id,o=!!e.signal_input_source_net_id||!!e.reference_input_source_net_id;n&&o?t.addIssue({code:F.ZodIssueCode.custom,message:"Cannot mix port and net connections in a differential probe."}):n?e.signal_input_source_port_id&&e.reference_input_source_port_id||t.addIssue({code:F.ZodIssueCode.custom,message:"Differential port probe requires both signal_input_source_port_id and reference_input_source_port_id."}):o&&(e.signal_input_source_net_id&&e.reference_input_source_net_id||t.addIssue({code:F.ZodIssueCode.custom,message:"Differential net probe requires both signal_input_source_net_id and reference_input_source_net_id."}))}else!!e.signal_input_source_port_id==!!e.signal_input_source_net_id&&t.addIssue({code:F.ZodIssueCode.custom,message:"A voltage probe must have exactly one of signal_input_source_port_id or signal_input_source_net_id."})}),Yvn=F.object({type:F.literal("simulation_current_probe"),simulation_current_probe_id:ao("simulation_current_probe"),source_component_id:F.string().optional(),name:F.string().optional(),positive_source_port_id:F.string().optional(),negative_source_port_id:F.string().optional(),positive_source_net_id:F.string().optional(),negative_source_net_id:F.string().optional(),subcircuit_id:F.string().optional(),color:F.string().optional()}).describe("Defines a current probe for simulation. It measures current flowing from the positive endpoint to the negative endpoint.").superRefine((e,t)=>{let n=!!e.positive_source_port_id,o=!!e.negative_source_port_id,r=!!e.positive_source_net_id,i=!!e.negative_source_net_id,s=n||o,a=r||i;s&&a?t.addIssue({code:F.ZodIssueCode.custom,message:"Cannot mix port and net connections in a current probe."}):s?n&&o||t.addIssue({code:F.ZodIssueCode.custom,message:"Current probe using source ports requires both positive_source_port_id and negative_source_port_id."}):a?r&&i||t.addIssue({code:F.ZodIssueCode.custom,message:"Current probe using source nets requires both positive_source_net_id and negative_source_net_id."}):t.addIssue({code:F.ZodIssueCode.custom,message:"A current probe must have either positive/negative source port ids or positive/negative source net ids."})}),Gvn=rh.extend({type:F.literal("simulation_unknown_experiment_error"),simulation_unknown_experiment_error_id:ao("simulation_unknown_experiment_error"),error_type:F.literal("simulation_unknown_experiment_error").default("simulation_unknown_experiment_error"),simulation_experiment_id:F.string().optional(),subcircuit_id:F.string().optional()}).describe("An unknown error occurred during the simulation experiment."),Uvn=F.object({type:F.literal("simulation_op_amp"),simulation_op_amp_id:ao("simulation_op_amp"),source_component_id:F.string().optional(),inverting_input_source_port_id:F.string(),non_inverting_input_source_port_id:F.string(),output_source_port_id:F.string(),positive_supply_source_port_id:F.string(),negative_supply_source_port_id:F.string()}).describe("Defines a simple ideal operational amplifier for simulation"),Wvn=F.object({type:F.literal("simulation_spice_subcircuit"),simulation_spice_subcircuit_id:ao("simulation_spice_subcircuit"),source_component_id:F.string(),spice_pin_to_source_port_map:F.record(F.string(),F.string()),subcircuit_source:F.string()}).describe("Defines a custom SPICE subcircuit model for simulation"),l1n=(e)=>e!==void 0,Xvn=F.object({type:F.literal("simulation_oscilloscope_trace"),simulation_oscilloscope_trace_id:ao("simulation_oscilloscope_trace"),simulation_transient_voltage_graph_id:F.string().optional(),simulation_transient_current_graph_id:F.string().optional(),simulation_voltage_probe_id:F.string().optional(),simulation_current_probe_id:F.string().optional(),display_name:F.string().optional(),color:F.string().optional(),display_center_value:F.number().optional(),display_center_offset_divs:F.number().optional(),volts_per_div:F.number().positive().optional(),amps_per_div:F.number().positive().optional()}).describe("Defines how a simulation measurement is rendered as an oscilloscope-style trace.").superRefine((e,t)=>{let n=[e.simulation_transient_voltage_graph_id,e.simulation_voltage_probe_id].filter(l1n).length,o=[e.simulation_transient_current_graph_id,e.simulation_current_probe_id].filter(l1n).length;n+o!==1&&t.addIssue({code:F.ZodIssueCode.custom,message:"An oscilloscope trace must reference exactly one voltage graph, current graph, voltage probe, or current probe."}),n>0&&e.amps_per_div!==void 0&&t.addIssue({code:F.ZodIssueCode.custom,message:"Voltage oscilloscope traces must use volts_per_div, not amps_per_div."}),o>0&&e.volts_per_div!==void 0&&t.addIssue({code:F.ZodIssueCode.custom,message:"Current oscilloscope traces must use amps_per_div, not volts_per_div."})}),jvn=F.union([nIn,eIn,tIn,Z6n,rIn,oIn,Nat,Bat,r7e,Dat,Tat,Rat,Qat,kat,Fat,zat,Oat,Wat,Vat,Yat,Gat,Uat,Hat,Lat,aIn,lIn,iIn,Xat,jat,Kat,$at,hIn,qat,Jat,dIn,uIn,pIn,mIn,_In,gIn,Zat,ect,sIn,KIn,n9n,evn,tvn,nvn,ivn,svn,avn,o9n,j9n,r9n,x9n,c9n,p9n,m9n,_9n,C9n,s9n,a9n,b9n,I9n,ovn,P9n,E9n,M9n,w9n,k9n,B9n,T9n,D9n,N9n,Q9n,g9n,A9n,v9n,S9n,f9n,y9n,yvn,xvn,Cvn,bvn,H9n,L9n,F9n,z9n,O9n,V9n,Y9n,G9n,U9n,rvn,W9n,X9n,cvn,Z9n,lvn,hvn,dvn,_vn,gvn,Avn,fvn,Ivn,vvn,Svn,Pvn,Evn,AIn,BIn,SIn,PIn,EIn,MIn,IIn,vIn,TIn,wIn,fIn,NIn,RIn,DIn,HIn,FIn,zIn,OIn,GIn,VIn,YIn,wvn,Dvn,Qvn,Hvn,Fvn,zvn,Ovn,Vvn,Yvn,Xvn,Gvn,Uvn,Wvn]),s8e=jvn;function h1n(e,t,n){if(!t||!n)return;let o=e.get(t);o||(o=new Set,e.set(t,o)),o.add(n);let r=e.get(n);r||(r=new Set,e.set(n,r)),r.add(t)}var Tit=(e,t={})=>{let n=e,o=n._internal_store;if(!o){o={counts:{},editCount:0},n._internal_store=o;for(let i of n){let s=i.type,a=i[`${s}_id`];if(!a)continue;let c=Number.parseInt(a.split("_").pop());Number.isNaN(c)||(o.counts[s]=Math.max(o.counts[s]??0,c))}}let r=new Proxy({},{get:(i,s)=>{if(s==="toArray")return()=>(n.editCount=o.editCount,n);if(s==="editCount")return o.editCount;if(s==="subtree")return(c)=>Tit(function(l,h){if(!h.subcircuit_id&&!h.source_group_id)return[...l];let d=h;if(h.subcircuit_id){let A=new Set([h.subcircuit_id]),g=new Map,f=new Map;for(let x of l)if(x.type==="source_group"){let{source_group_id:C,subcircuit_id:b}=x;b&&f.set(C,b);let I=x.parent_source_group_id;I&&(g.has(I)||g.set(I,[]),g.get(I).push(C))}let y;for(let[x,C]of f)if(C===h.subcircuit_id){y=x;break}if(y){let x=(C)=>{let b=g.get(C)||[];for(let I of b){let v=f.get(I);v&&A.add(v),x(I)}};x(y),d={...h,subcircuit_ids:Array.from(A)}}}let u=new Map;for(let A of l){let g=A[`${A.type}_id`];typeof g=="string"&&u.set(g,A)}let _=new Map;for(let A of l){let g=Object.entries(A);for(let[f,y]of g)if(f!=="parent_source_group_id"){if(f.endsWith("_id")&&typeof y=="string")h1n(_,A,u.get(y));else if(f.endsWith("_ids")&&Array.isArray(y))for(let x of y)typeof x=="string"&&h1n(_,A,u.get(x))}}let p=[],m=new Set;for(let A of l){let g=!1;(d.subcircuit_id&&("subcircuit_id"in A)&&A.subcircuit_id===d.subcircuit_id||d.subcircuit_ids&&("subcircuit_id"in A)&&A.subcircuit_id&&d.subcircuit_ids.includes(A.subcircuit_id)||d.source_group_id&&("source_group_id"in A)&&A.source_group_id===d.source_group_id||d.source_group_id&&("member_source_group_ids"in A)&&Array.isArray(A.member_source_group_ids)&&A.member_source_group_ids.includes(d.source_group_id))&&(g=!0),g&&(p.push(A),m.add(A))}for(;p.length>0;){let A=p.shift(),g=_.get(A);if(g)for(let f of g)m.has(f)||(m.add(f),p.push(f))}return l.filter((A)=>m.has(A))}(n,c),t);if(s==="insert")return(c)=>{let l=c.type;if(!l)throw Error("insert requires an element with a type");o.counts[l]??=-1,o.counts[l]++;let h=o.counts[l],d={...c,type:l,[`${l}_id`]:`${l}_${h}`};if(t.validateInserts)(qve[l]??s8e).parse(d);return n.push(d),o.editCount++,d};if(s==="insertAll")return(c)=>c.map((l)=>r.insert(l));let a=s;return{get:(c)=>n.find((l)=>l.type===a&&l[`${a}_id`]===c),getUsing:(c)=>{let l=Object.keys(c);if(l.length!==1)throw Error("getUsing requires exactly one key, e.g. { pcb_component_id }");let h=l[0],d=h.replace("_id",""),u=n.find((_)=>_.type===d&&_[h]===c[h]);return u?n.find((_)=>_.type===a&&_[`${a}_id`]===u[`${a}_id`]):null},getWhere:(c)=>{let l=Object.keys(c);return n.find((h)=>h.type===a&&l.every((d)=>h[d]===c[d]))},list:(c)=>{let l=c?Object.keys(c):[];return n.filter((h)=>h.type===a&&l.every((d)=>h[d]===c[d]))},insert:(c)=>{o.counts[a]??=-1,o.counts[a]++;let l=o.counts[a],h={type:a,[`${a}_id`]:`${a}_${l}`,...c};if(t.validateInserts)(qve[a]??s8e).parse(h);return n.push(h),o.editCount++,h},delete:(c)=>{let l=n.find((h)=>h[`${a}_id`]===c);l&&(n.splice(n.indexOf(l),1),o.editCount++)},update:(c,l)=>{let h=n.find((d)=>d.type===a&&d[`${a}_id`]===c);return h?(Object.assign(h,l),o.editCount++,h):null},select:(c)=>{if(a==="source_component")return n.find((l)=>l.type==="source_component"&&l.name===c.replace(/\./g,""));if(a==="pcb_port"||a==="source_port"||a==="schematic_port"){let[l,h]=c.replace(/\./g,"").split(/[\s\>]+/),d=n.find((_)=>_.type==="source_component"&&_.name===l);if(!d)return null;let u=n.find((_)=>_.type==="source_port"&&_.source_component_id===d.source_component_id&&(_.name===h||(_.port_hints??[]).includes(h)));if(!u)return null;if(a==="source_port")return u;if(a==="pcb_port")return n.find((_)=>_.type==="pcb_port"&&_.source_port_id===u.source_port_id);if(a==="schematic_port")return n.find((_)=>_.type==="schematic_port"&&_.source_port_id===u.source_port_id)}}}}});return r};Tit.unparsed=Tit;function Sot(e){let t=e.type;return`${t}:${e[`${t}_id`]}`}var d1n=(e,t={})=>{let n=e._internal_store_indexed;if(!n){n={counts:{},editCount:0,indexes:{}};for(let i of e){let s=i.type,a=i[`${s}_id`];if(!a)continue;let c=Number.parseInt(a.split("_").pop()||"");Number.isNaN(c)||(n.counts[s]=Math.max(n.counts[s]??0,c))}let o=t.indexConfig||{},r=n.indexes;if(o.byId&&(r.byId=new Map),o.byType&&(r.byType=new Map),o.byRelation&&(r.byRelation=new Map),o.bySubcircuit&&(r.bySubcircuit=new Map),o.byCustomField&&o.byCustomField.length>0){r.byCustomField=new Map;for(let i of o.byCustomField)r.byCustomField.set(i,new Map)}for(let i of e){if(o.byId){let s=Sot(i);r.byId.set(s,i)}if(o.byType){let s=r.byType.get(i.type)||[];s.push(i),r.byType.set(i.type,s)}if(o.byRelation){let s=Object.entries(i);for(let[a,c]of s)if(a.endsWith("_id")&&a!==`${i.type}_id`&&typeof c=="string"){let l=r.byRelation.get(a)||new Map,h=l.get(c)||[];h.push(i),l.set(c,h),r.byRelation.set(a,l)}}if(o.bySubcircuit&&"subcircuit_id"in i){let s=i.subcircuit_id;if(s&&typeof s=="string"){let a=r.bySubcircuit.get(s)||[];a.push(i),r.bySubcircuit.set(s,a)}}if(o.byCustomField&&r.byCustomField){for(let s of o.byCustomField)if(s in i){let a=i[s];if(a!==void 0&&(typeof a=="string"||typeof a=="number")){let c=String(a),l=r.byCustomField.get(s),h=l.get(c)||[];h.push(i),l.set(c,h)}}}}e._internal_store_indexed=n}return new Proxy({},{get:(o,r)=>{if(r==="toArray")return()=>(e.editCount=n.editCount,e);if(r==="editCount")return n.editCount;let i=r;return{get:(s)=>{let a=t.indexConfig||{};if(a.byId&&n.indexes.byId)return n.indexes.byId.get(`${i}:${s}`)||null;if(a.byType&&n.indexes.byType)return(n.indexes.byType.get(i)||[]).find((c)=>c[`${i}_id`]===s)||null;return e.find((c)=>c.type===i&&c[`${i}_id`]===s)||null},getUsing:(s)=>{let a=t.indexConfig||{},c=Object.keys(s);if(c.length!==1)throw Error("getUsing requires exactly one key, e.g. { pcb_component_id }");let l=c[0],h=l.replace("_id","");if(a.byRelation&&n.indexes.byRelation){let u=n.indexes.byRelation.get(l);if(u){let _=(u.get(s[l])||[]).find((m)=>m.type===h);if(!_)return null;let p=_[`${i}_id`];if(a.byId&&n.indexes.byId)return n.indexes.byId.get(`${i}:${p}`)||null;if(a.byType&&n.indexes.byType)return(n.indexes.byType.get(i)||[]).find((m)=>m[`${i}_id`]===p)||null;return e.find((m)=>m.type===i&&m[`${i}_id`]===p)||null}}let d=e.find((u)=>u.type===h&&u[l]===s[l]);return d&&e.find((u)=>u.type===i&&u[`${i}_id`]===d[`${i}_id`])||null},getWhere:(s)=>{let a=t.indexConfig||{},c=Object.keys(s);if(c.length===1&&a.byCustomField&&n.indexes.byCustomField){let l=c[0],h=n.indexes.byCustomField.get(l);if(h){let d=String(s[l]);return(h.get(d)||[]).find((u)=>u.type===i)||null}}if("subcircuit_id"in s&&a.bySubcircuit&&n.indexes.bySubcircuit){let l=s.subcircuit_id;return(n.indexes.bySubcircuit.get(l)||[]).find((h)=>h.type===i&&c.every((d)=>h[d]===s[d]))||null}if(a.byType&&n.indexes.byType)return(n.indexes.byType.get(i)||[]).find((l)=>c.every((h)=>l[h]===s[h]))||null;return e.find((l)=>l.type===i&&c.every((h)=>l[h]===s[h]))||null},list:(s)=>{let a=t.indexConfig||{},c=s?Object.keys(s):[];if(c.length===0&&a.byType&&n.indexes.byType)return n.indexes.byType.get(i)||[];if(c.length===1&&c[0]==="subcircuit_id"&&a.bySubcircuit&&n.indexes.bySubcircuit){let h=s.subcircuit_id;return(n.indexes.bySubcircuit.get(h)||[]).filter((d)=>d.type===i)}let l;return l=a.byType&&n.indexes.byType?n.indexes.byType.get(i)||[]:e.filter((h)=>h.type===i),c.length>0?l.filter((h)=>c.every((d)=>h[d]===s[d])):l},insert:(s)=>{n.counts[i]??=-1,n.counts[i]++;let a=n.counts[i],c={type:i,[`${i}_id`]:`${i}_${a}`,...s};if(t.validateInserts)(qve[i]??s8e).parse(c);e.push(c),n.editCount++;let l=t.indexConfig||{};if(l.byId&&n.indexes.byId){let h=Sot(c);n.indexes.byId.set(h,c)}if(l.byType&&n.indexes.byType){let h=n.indexes.byType.get(i)||[];h.push(c),n.indexes.byType.set(i,h)}if(l.byRelation&&n.indexes.byRelation){let h=Object.entries(c);for(let[d,u]of h)if(d.endsWith("_id")&&d!==`${c.type}_id`&&typeof u=="string"){let _=n.indexes.byRelation.get(d)||new Map,p=_.get(u)||[];p.push(c),_.set(u,p),n.indexes.byRelation.set(d,_)}}if(l.bySubcircuit&&n.indexes.bySubcircuit&&"subcircuit_id"in c){let h=c.subcircuit_id;if(h&&typeof h=="string"){let d=n.indexes.bySubcircuit.get(h)||[];d.push(c),n.indexes.bySubcircuit.set(h,d)}}if(l.byCustomField&&n.indexes.byCustomField){for(let h of l.byCustomField)if(h in c){let d=c[h];if(d!==void 0&&(typeof d=="string"||typeof d=="number")){let u=String(d),_=n.indexes.byCustomField.get(h),p=_.get(u)||[];p.push(c),_.set(u,p)}}}return c},delete:(s)=>{let a=t.indexConfig||{},c;if(a.byId&&n.indexes.byId)c=n.indexes.byId.get(`${i}:${s}`);else if(a.byType&&n.indexes.byType)c=(n.indexes.byType.get(i)||[]).find((d)=>d[`${i}_id`]===s);else c=e.find((h)=>h[`${i}_id`]===s);if(!c)return;let l=e.indexOf(c);if(l>=0&&(e.splice(l,1),n.editCount++),a.byId&&n.indexes.byId){let h=Sot(c);n.indexes.byId.delete(h)}if(a.byType&&n.indexes.byType){let h=(n.indexes.byType.get(i)||[]).filter((d)=>d[`${i}_id`]!==s);n.indexes.byType.set(i,h)}if(a.byRelation&&n.indexes.byRelation)for(let[h,d]of n.indexes.byRelation.entries())for(let[u,_]of d.entries()){let p=_.filter((m)=>m!==c);p.length===0?d.delete(u):d.set(u,p)}if(a.bySubcircuit&&n.indexes.bySubcircuit&&"subcircuit_id"in c){let h=c.subcircuit_id;if(h){let d=(n.indexes.bySubcircuit.get(h)||[]).filter((u)=>u!==c);d.length===0?n.indexes.bySubcircuit.delete(h):n.indexes.bySubcircuit.set(h,d)}}if(a.byCustomField&&n.indexes.byCustomField)for(let h of n.indexes.byCustomField.values())for(let[d,u]of h.entries()){let _=u.filter((p)=>p!==c);_.length===0?h.delete(d):h.set(d,_)}},update:(s,a)=>{let c=t.indexConfig||{},l;if(c.byId&&n.indexes.byId)l=n.indexes.byId.get(`${i}:${s}`);else if(c.byType&&n.indexes.byType)l=(n.indexes.byType.get(i)||[]).find((d)=>d[`${i}_id`]===s);else l=e.find((h)=>h.type===i&&h[`${i}_id`]===s);if(!l)return null;if(c.byRelation&&n.indexes.byRelation){let h=Object.entries(l);for(let[d,u]of h)if(d.endsWith("_id")&&d!==`${l.type}_id`&&typeof u=="string"&&d in a&&a[d]!==u){let _=n.indexes.byRelation.get(d);if(_){let p=(_.get(u)||[]).filter((m)=>m!==l);p.length===0?_.delete(u):_.set(u,p)}}}if(c.bySubcircuit&&n.indexes.bySubcircuit&&"subcircuit_id"in l&&"subcircuit_id"in a){let h=l.subcircuit_id;if(h!==a.subcircuit_id){let d=(n.indexes.bySubcircuit.get(h)||[]).filter((u)=>u!==l);d.length===0?n.indexes.bySubcircuit.delete(h):n.indexes.bySubcircuit.set(h,d)}}if(c.byCustomField&&n.indexes.byCustomField){for(let h of c.byCustomField)if(h in l&&h in a&&l[h]!==a[h]){let d=n.indexes.byCustomField.get(h);if(d){let u=String(l[h]),_=(d.get(u)||[]).filter((p)=>p!==l);_.length===0?d.delete(u):d.set(u,_)}}}if(Object.assign(l,a),n.editCount++,c.byRelation&&n.indexes.byRelation){let h=Object.entries(l);for(let[d,u]of h)if(d.endsWith("_id")&&d!==`${l.type}_id`&&typeof u=="string"&&d in a){let _=n.indexes.byRelation.get(d)||new Map,p=_.get(u)||[];p.includes(l)||(p.push(l),_.set(u,p),n.indexes.byRelation.set(d,_))}}if(c.bySubcircuit&&n.indexes.bySubcircuit&&"subcircuit_id"in l&&"subcircuit_id"in a){let h=l.subcircuit_id;if(h&&typeof h=="string"){let d=n.indexes.bySubcircuit.get(h)||[];d.includes(l)||(d.push(l),n.indexes.bySubcircuit.set(h,d))}}if(c.byCustomField&&n.indexes.byCustomField){for(let h of c.byCustomField)if(h in l&&h in a){let d=l[h];if(d!==void 0&&(typeof d=="string"||typeof d=="number")){let u=String(d),_=n.indexes.byCustomField.get(h),p=_.get(u)||[];p.includes(l)||(p.push(l),_.set(u,p))}}}return l},select:(s)=>{if(i==="source_component")return e.find((a)=>a.type==="source_component"&&a.name===s.replace(/\./g,""))||null;if(i==="pcb_port"||i==="source_port"||i==="schematic_port"){let[a,c]=s.replace(/\./g,"").split(/[\s\>]+/),l=e.find((d)=>d.type==="source_component"&&d.name===a);if(!l)return null;let h=e.find((d)=>d.type==="source_port"&&d.source_component_id===l.source_component_id&&(d.name===c||(d.port_hints??[]).includes(c)));if(!h)return null;if(i==="source_port")return h;if(i==="pcb_port")return e.find((d)=>d.type==="pcb_port"&&d.source_port_id===h.source_port_id)||null;if(i==="schematic_port")return e.find((d)=>d.type==="schematic_port"&&d.source_port_id===h.source_port_id)||null}return null}}}})};d1n.unparsed=d1n;var Kvn={Hz:{baseUnit:"Hz",variants:{MHz:1e6,kHz:1000,Hz:1}},g:{baseUnit:"g",variants:{kg:1000,g:1}},"Ω":{baseUnit:"Ω",variants:{"mΩ":0.001,"Ω":1,"kΩ":1000,"KΩ":1000,kohm:1000,"MΩ":1e6,"GΩ":1e9,"TΩ":1000000000000}},V:{baseUnit:"V",variants:{mV:0.001,V:1,kV:1000,KV:1000,MV:1e6,GV:1e9,TV:1000000000000}},A:{baseUnit:"A",variants:{"µA":0.000001,mA:0.001,ma:0.001,A:1,kA:1000,MA:1e6}},F:{baseUnit:"F",variants:{pF:0.000000000001,nF:0.000000001,"µF":0.000001,uF:0.000001,mF:0.001,F:1}},ml:{baseUnit:"ml",variants:{ml:1,mL:1,l:1000,L:1000}},deg:{baseUnit:"deg",variants:{rad:180/Math.PI}},ms:{baseUnit:"ms",variants:{fs:0.000000000001,ps:0.000000001,ns:0.000001,us:0.001,"µs":0.001,ms:1,s:1000}},mm:{baseUnit:"mm",variants:{nm:0.000001,"µm":0.001,um:0.001,mm:1,cm:10,dm:100,m:1000,km:1e6,in:25.4,ft:304.8,IN:25.4,FT:304.8,yd:914.4,mi:1609344,mil:0.0254}}},Dit=new Set;for(let[e,t]of Object.entries(Kvn)){Dit.add(e);for(let n of Object.keys(t.variants))Dit.add(n)}var u1n={tera:1000000000000,T:1000000000000,giga:1e9,G:1e9,mega:1e6,M:1e6,kilo:1000,k:1000,deci:0.1,d:0.1,centi:0.01,c:0.01,milli:0.001,m:0.001,micro:0.000001,u:0.000001,"µ":0.000001,nano:0.000000001,n:0.000000001,pico:0.000000000001,p:0.000000000001};function Bv(e){if(e==null)return{parsedUnit:null,unitOfValue:null,value:null};if(typeof e=="string"&&e.match(/^-?[\d\.]+$/))return{value:Number.parseFloat(e),parsedUnit:null,unitOfValue:null};if(typeof e=="number")return{value:e,parsedUnit:null,unitOfValue:null};if(typeof e=="object"&&"x"in e&&"y"in e){let{parsedUnit:a,unitOfValue:c}=Bv(e.x),l=Bv(e.x),h=Bv(e.y);return l.value===null||h.value===null?{parsedUnit:null,unitOfValue:null,value:null}:{parsedUnit:a,unitOfValue:c,value:{x:l.value,y:h.value}}}let t=e.toString().split("").reverse().join(""),n=t.match(/[^\d\s]+/)?.[0];if(!n)throw Error(`Could not determine unit: "${e}"`);let o=n.split("").reverse().join(""),r=e.slice(0,-o.length);if(o in u1n&&!Dit.has(o)){let a=u1n[o];return{parsedUnit:null,unitOfValue:null,value:Number.parseFloat(r)*a}}let{baseUnit:i,conversionFactor:s}=function(a){for(let[c,l]of Object.entries(Kvn))if(a in l.variants)return{baseUnit:l.baseUnit,conversionFactor:l.variants[a]};return{baseUnit:a,conversionFactor:1}}(o);return{parsedUnit:o,unitOfValue:i,value:s*Number.parseFloat(r)}}var rct=F.string().or(F.number()).transform((e)=>Bv(e).value),$vn=F.string().or(F.number()).transform((e)=>Bv(e).value).transform((e)=>Number.parseFloat(e.toPrecision(12))),wJr=F.string().or(F.number()).transform((e)=>Bv(e).value),gL=F.string().or(F.number()).transform((e)=>Bv(e).value),gr=F.string().or(F.number()).transform((e)=>Bv(e).value),KZ=F.string().or(F.number()).transform((e)=>Bv(e).value),eo=gr,Bue=F.string().or(F.number()).transform((e)=>Bv(e).value),ict=F.string().or(F.number()).transform((e)=>Bv(e).value),BZ=ict,BJr=F.string().datetime(),Y_=F.string().or(F.number()).transform((e)=>typeof e=="number"?e:e.endsWith("deg")?Number.parseFloat(e.split("deg")[0]):e.endsWith("rad")?180*Number.parseFloat(e.split("rad")[0])/Math.PI:Number.parseFloat(e)),TJr=F.number().or(F.string().endsWith("mAh")).transform((e)=>{if(typeof e=="string"){let t=e.replace("mAh",""),n=Number.parseFloat(t);if(Number.isNaN(n))throw Error("Invalid capacity");return n}return e}).describe("Battery capacity in mAh"),ni=F.object({x:eo,y:eo}),eG=F.object({x:eo,y:eo,z:eo}),qvn=F.object({width:F.number(),height:F.number()}),Co=(e)=>F.string().optional().default(()=>`${e}_${((t)=>Array.from({length:t},()=>"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[Math.floor(62*Math.random())]).join(""))(10)}`),SL=F.enum(["top_left","top_center","top_right","center_left","center","center_right","bottom_left","bottom_center","bottom_right"]),DJr=(F.enum(["top_silkscreen","bottom_silkscreen","top_copper","bottom_copper","top_soldermask","bottom_soldermask","top_fabrication_note","bottom_fabrication_note","top_user_note","bottom_user_note","top_courtyard","bottom_courtyard","inner1_copper","inner2_copper","inner3_copper","inner4_copper","inner5_copper","inner6_copper","edge_cuts","drill"]),F.object({project_relative_path:F.string(),url:F.string(),mimetype:F.string()})),sct=ni.extend({rotation:Y_.optional()}),Jvn=F.object({size:ni.optional(),thickness:eo.optional()}),NJr=F.object({font:Jvn.optional()}),f9e=F.object({value:F.string(),at:sct.optional(),layer:F.string().optional(),uuid:F.string().optional(),hide:F.boolean().optional(),effects:NJr.optional()}),RJr=F.object({Reference:f9e.optional(),Value:f9e.optional(),Datasheet:f9e.optional(),Description:f9e.optional()}),QJr=F.object({through_hole:F.boolean().optional(),smd:F.boolean().optional(),exclude_from_pos_files:F.boolean().optional(),exclude_from_bom:F.boolean().optional()}),kJr=F.object({name:F.string(),type:F.string(),shape:F.string().optional(),at:sct.optional(),size:ni.optional(),drill:eo.optional(),layers:F.array(F.string()).optional(),removeUnusedLayers:F.boolean().optional(),uuid:F.string().optional()}),LJr=F.object({path:F.string(),offset:eG.optional(),scale:eG.optional(),rotate:eG.optional()}),HJr=F.object({footprintName:F.string().optional(),version:F.union([F.number(),F.string()]).optional(),generator:F.string().optional(),generatorVersion:F.union([F.number(),F.string()]).optional(),layer:F.string().optional(),properties:RJr.optional(),attributes:QJr.optional(),pads:F.array(kJr).optional(),embeddedFonts:F.boolean().optional(),model:LJr.optional()}),FJr=F.object({hide:F.boolean().optional()}),zJr=F.object({offset:eo.optional(),hide:F.boolean().optional()}),OJr=F.object({font:Jvn.optional(),justify:F.union([F.string(),F.array(F.string())]).optional(),hide:F.boolean().optional()}),RY=F.object({value:F.string(),id:F.union([F.number(),F.string()]).optional(),at:sct.optional(),effects:OJr.optional()}),VJr=F.object({Reference:RY.optional(),Value:RY.optional(),Footprint:RY.optional(),Datasheet:RY.optional(),Description:RY.optional(),ki_keywords:RY.optional(),ki_fp_filters:RY.optional()}),YJr=F.object({symbolName:F.string().optional(),extends:F.string().optional(),pinNumbers:FJr.optional(),pinNames:zJr.optional(),excludeFromSim:F.boolean().optional(),inBom:F.boolean().optional(),onBoard:F.boolean().optional(),properties:VJr.optional(),embeddedFonts:F.boolean().optional()}),Yh=F.object({error_type:F.string(),message:F.string(),is_fatal:F.boolean().optional()}),Zvn=F.enum(["jlcpcb","macrofab","pcbway","digikey","mouser","lcsc"]),Yu=F.object({type:F.literal("source_component"),ftype:F.string().optional(),source_component_id:F.string(),name:F.string(),manufacturer_part_number:F.string().optional(),supplier_part_numbers:F.record(Zvn,F.array(F.string())).optional(),display_value:F.string().optional(),display_name:F.string().optional(),are_pins_interchangeable:F.boolean().optional(),internally_connected_source_port_ids:F.array(F.array(F.string())).optional(),source_group_id:F.string().optional(),subcircuit_id:F.string().optional()}),e8n=Yu.extend({ftype:F.literal("simple_capacitor"),capacitance:$vn,max_voltage_rating:gL.optional(),display_capacitance:F.string().optional(),max_decoupling_trace_length:eo.optional()}),t8n=Yu.extend({ftype:F.literal("simple_resistor"),resistance:rct,display_resistance:F.string().optional()}),act=Yu.extend({ftype:F.literal("simple_diode")}),GJr=Yu.extend({ftype:F.literal("simple_fiducial")}),n8n=act.extend({ftype:F.literal("simple_led"),color:F.string().optional(),wavelength:F.string().optional()}),UJr=Yu.extend({ftype:F.literal("simple_ground")}),o8n=Yu.extend({ftype:F.literal("simple_chip")}),r8n=Yu.extend({ftype:F.literal("simple_power_source"),voltage:gL}),WJr=Yu.extend({ftype:F.literal("simple_current_source"),current:Bue,frequency:KZ.optional(),peak_to_peak_current:Bue.optional(),wave_shape:F.enum(["sine","square","triangle","sawtooth","dc"]).optional().default("dc"),phase:F.number().optional(),duty_cycle:F.number().min(0).max(1).optional()}),XJr=F.object({must_be_connected:F.boolean().optional(),provides_power:F.boolean().optional(),requires_power:F.boolean().optional(),provides_ground:F.boolean().optional(),requires_ground:F.boolean().optional(),provides_voltage:F.union([F.string(),F.number()]).optional(),requires_voltage:F.union([F.string(),F.number()]).optional(),do_not_connect:F.boolean().optional(),include_in_board_pinout:F.boolean().optional(),can_use_internal_pullup:F.boolean().optional(),is_using_internal_pullup:F.boolean().optional(),needs_external_pullup:F.boolean().optional(),can_use_internal_pulldown:F.boolean().optional(),is_using_internal_pulldown:F.boolean().optional(),needs_external_pulldown:F.boolean().optional(),can_use_open_drain:F.boolean().optional(),is_using_open_drain:F.boolean().optional(),can_use_push_pull:F.boolean().optional(),is_using_push_pull:F.boolean().optional(),should_have_decoupling_capacitor:F.boolean().optional(),recommended_decoupling_capacitor_capacitance:F.union([F.string(),F.number()]).optional(),is_configured_for_i2c_sda:F.boolean().optional(),is_configured_for_i2c_scl:F.boolean().optional(),is_configured_for_spi_mosi:F.boolean().optional(),is_configured_for_spi_miso:F.boolean().optional(),is_configured_for_spi_sck:F.boolean().optional(),is_configured_for_spi_cs:F.boolean().optional(),is_configured_for_uart_tx:F.boolean().optional(),is_configured_for_uart_rx:F.boolean().optional(),supports_i2c_sda:F.boolean().optional(),supports_i2c_scl:F.boolean().optional(),supports_spi_mosi:F.boolean().optional(),supports_spi_miso:F.boolean().optional(),supports_spi_sck:F.boolean().optional(),supports_spi_cs:F.boolean().optional(),supports_uart_tx:F.boolean().optional(),supports_uart_rx:F.boolean().optional()}),jJr=Yu.extend({ftype:F.literal("simple_fuse"),current_rating_amps:F.number().describe("Nominal current in amps the fuse is rated for"),voltage_rating_volts:F.number().describe("Voltage rating in volts, e.g. ±5V would be 5")}),i8n=Yu.extend({ftype:F.literal("simple_battery"),capacity:TJr}),s8n=Yu.extend({ftype:F.literal("simple_inductor"),inductance:wJr,display_inductance:F.string().optional(),max_current_rating:F.number().optional()}),a8n=Yu.extend({ftype:F.literal("simple_push_button")}),c8n=Yu.extend({ftype:F.literal("simple_potentiometer"),max_resistance:rct,display_max_resistance:F.string().optional()}),KJr=Yu.extend({ftype:F.literal("simple_crystal"),frequency:F.number().describe("Frequency in Hz"),load_capacitance:F.number().optional().describe("Load capacitance in pF"),pin_variant:F.enum(["two_pin","four_pin"]).optional()}),l8n=Yu.extend({ftype:F.literal("simple_pin_header"),pin_count:F.number(),gender:F.enum(["male","female"]).optional().default("male")}),$Jr=Yu.extend({ftype:F.literal("simple_connector"),standard:F.enum(["usb_c","m2"]).optional()}),h8n=Yu.extend({ftype:F.literal("simple_pinout")}),d8n=Yu.extend({ftype:F.literal("simple_resonator"),load_capacitance:$vn,equivalent_series_resistance:rct.optional(),frequency:KZ}),u8n=Yu.extend({ftype:F.literal("simple_transistor"),transistor_type:F.enum(["npn","pnp"])}),p8n=Yu.extend({ftype:F.literal("simple_test_point"),footprint_variant:F.enum(["pad","through_hole"]).optional(),pad_shape:F.enum(["rect","circle"]).optional(),pad_diameter:F.union([F.number(),F.string()]).optional(),hole_diameter:F.union([F.number(),F.string()]).optional(),width:F.union([F.number(),F.string()]).optional(),height:F.union([F.number(),F.string()]).optional()}),m8n=Yu.extend({ftype:F.literal("simple_mosfet"),channel_type:F.enum(["n","p"]),mosfet_mode:F.enum(["enhancement","depletion"])}),_8n=Yu.extend({ftype:F.literal("simple_op_amp")}),g8n=Yu.extend({ftype:F.literal("simple_switch")}),A8n=F.object({type:F.literal("source_project_metadata"),name:F.string().optional(),software_used_string:F.string().optional(),project_url:F.string().optional(),created_at:BJr.optional()}),qJr=Yh.extend({type:F.literal("source_missing_property_error"),source_missing_property_error_id:Co("source_missing_property_error"),source_component_id:F.string(),property_name:F.string(),subcircuit_id:F.string().optional(),error_type:F.literal("source_missing_property_error").default("source_missing_property_error")}).describe("The source code is missing a property"),JJr=Yh.extend({type:F.literal("source_failed_to_create_component_error"),source_failed_to_create_component_error_id:Co("source_failed_to_create_component_error"),error_type:F.literal("source_failed_to_create_component_error").default("source_failed_to_create_component_error"),component_name:F.string().optional(),subcircuit_id:F.string().optional(),parent_source_component_id:F.string().optional(),pcb_center:F.object({x:F.number().optional(),y:F.number().optional()}).optional(),schematic_center:F.object({x:F.number().optional(),y:F.number().optional()}).optional()}).describe("Error emitted when a component fails to be constructed"),f8n=Yh.extend({type:F.literal("source_invalid_component_property_error"),source_invalid_component_property_error_id:Co("source_invalid_component_property_error"),source_component_id:F.string(),property_name:F.string(),property_value:F.unknown().optional(),expected_format:F.string().optional(),subcircuit_id:F.string().optional(),error_type:F.literal("source_invalid_component_property_error").default("source_invalid_component_property_error")}).describe("The source component property is invalid"),y8n=Yh.extend({type:F.literal("source_trace_not_connected_error"),source_trace_not_connected_error_id:Co("source_trace_not_connected_error"),error_type:F.literal("source_trace_not_connected_error").default("source_trace_not_connected_error"),subcircuit_id:F.string().optional(),source_group_id:F.string().optional(),source_trace_id:F.string().optional(),connected_source_port_ids:F.array(F.string()).optional(),selectors_not_found:F.array(F.string()).optional()}).describe("Occurs when a source trace selector does not match any ports"),ZJr=F.object({type:F.literal("source_property_ignored_warning"),source_property_ignored_warning_id:Co("source_property_ignored_warning"),source_component_id:F.string(),property_name:F.string(),subcircuit_id:F.string().optional(),error_type:F.literal("source_property_ignored_warning").default("source_property_ignored_warning"),message:F.string()}).describe("The source property was ignored"),x8n=F.object({type:F.literal("source_pin_missing_trace_warning"),source_pin_missing_trace_warning_id:Co("source_pin_missing_trace_warning"),warning_type:F.literal("source_pin_missing_trace_warning").default("source_pin_missing_trace_warning"),message:F.string(),source_component_id:F.string(),source_port_id:F.string(),subcircuit_id:F.string().optional()}).describe("Warning emitted when a source component pin is missing a trace connection"),C8n=F.object({type:F.literal("source_missing_manufacturer_part_number_warning"),source_missing_manufacturer_part_number_warning_id:Co("source_missing_manufacturer_part_number_warning"),warning_type:F.literal("source_missing_manufacturer_part_number_warning").default("source_missing_manufacturer_part_number_warning"),message:F.string(),source_component_id:F.string(),standard:F.string(),subcircuit_id:F.string().optional()}).describe("Warning emitted when a standard connector is missing manufacturer part number"),eZr=Yu.extend({ftype:F.literal("simple_voltage_probe")}),tZr=Yu.extend({ftype:F.literal("interconnect")}),b8n=Yh.extend({type:F.literal("source_i2c_misconfigured_error"),source_i2c_misconfigured_error_id:Co("source_i2c_misconfigured_error"),error_type:F.literal("source_i2c_misconfigured_error").default("source_i2c_misconfigured_error"),source_port_ids:F.array(F.string())}).describe("Error emitted when incompatible I2C pins (e.g. SDA and SCL) are connected to the same net"),nZr=Yu.extend({ftype:F.literal("simple_voltage_source"),voltage:gL,frequency:KZ.optional(),peak_to_peak_voltage:gL.optional(),wave_shape:F.enum(["sinewave","square","triangle","sawtooth"]).optional(),phase:Y_.optional(),duty_cycle:F.number().optional().describe("Duty cycle as a fraction (0 to 1)")}),oZr=F.union([t8n,e8n,act,GJr,n8n,UJr,o8n,r8n,WJr,i8n,s8n,a8n,c8n,KJr,l8n,$Jr,h8n,d8n,g8n,u8n,p8n,m8n,_8n,jJr,eZr,tZr,nZr,A8n,qJr,f8n,JJr,y8n,ZJr,x8n,C8n,b8n]),rZr=F.object({type:F.literal("source_port"),pin_number:F.number().optional(),port_hints:F.array(F.string()).optional(),name:F.string(),source_port_id:F.string(),source_component_id:F.string().optional(),source_group_id:F.string().optional(),most_frequently_referenced_by_name:F.string().optional(),subcircuit_id:F.string().optional(),subcircuit_connectivity_map_key:F.string().optional()}).merge(XJr),iZr=F.object({type:F.literal("source_component_internal_connection"),source_component_internal_connection_id:F.string(),source_component_id:F.string(),source_port_ids:F.array(F.string()),subcircuit_id:F.string().optional()}),sZr=F.object({type:F.literal("source_trace"),source_trace_id:F.string(),connected_source_port_ids:F.array(F.string()),connected_source_net_ids:F.array(F.string()),subcircuit_id:F.string().optional(),subcircuit_connectivity_map_key:F.string().optional(),max_length:F.number().optional(),min_trace_thickness:F.number().optional(),display_name:F.string().optional()}),aZr=F.object({type:F.literal("source_group"),source_group_id:F.string(),subcircuit_id:F.string().optional(),parent_subcircuit_id:F.string().optional(),parent_source_group_id:F.string().optional(),is_subcircuit:F.boolean().optional(),show_as_schematic_box:F.boolean().optional(),name:F.string().optional(),was_automatically_named:F.boolean().optional()}),cZr=F.object({type:F.literal("source_net"),source_net_id:F.string(),name:F.string(),member_source_group_ids:F.array(F.string()),is_power:F.boolean().optional(),is_ground:F.boolean().optional(),is_digital_signal:F.boolean().optional(),is_analog_signal:F.boolean().optional(),is_positive_voltage_source:F.boolean().optional(),trace_width:F.number().optional(),subcircuit_id:F.string().optional(),subcircuit_connectivity_map_key:F.string().optional()}),lZr=F.object({type:F.literal("source_board"),source_board_id:F.string(),source_group_id:F.string(),title:F.string().optional()}).describe("Defines a board in the source domain"),hZr=Yh.extend({type:F.literal("source_ambiguous_port_reference"),source_ambiguous_port_reference_id:Co("source_ambiguous_port_reference"),error_type:F.literal("source_ambiguous_port_reference").default("source_ambiguous_port_reference"),source_port_id:F.string().optional(),source_component_id:F.string().optional()}).describe("Error emitted when a port hint matches multiple non-overlapping pads, making the port reference ambiguous"),dZr=F.object({type:F.literal("source_pcb_ground_plane"),source_pcb_ground_plane_id:F.string(),source_group_id:F.string(),source_net_id:F.string(),subcircuit_id:F.string().optional()}).describe("Defines a ground plane in the source domain"),uZr=["top","bottom","inner1","inner2","inner3","inner4","inner5","inner6"],p1n=F.enum(uZr),Yc=p1n.or(F.object({name:p1n})).transform((e)=>typeof e=="string"?e:e.name),N1=F.enum(["top","bottom"]),pZr=F.object({type:F.literal("source_manually_placed_via"),source_manually_placed_via_id:F.string(),source_group_id:F.string(),source_net_id:F.string(),subcircuit_id:F.string().optional(),source_trace_id:F.string().optional()}).describe("Defines a via that is manually placed in the source domain"),mZr=F.object({type:F.literal("source_no_power_pin_defined_warning"),source_no_power_pin_defined_warning_id:Co("source_no_power_pin_defined_warning"),warning_type:F.literal("source_no_power_pin_defined_warning").default("source_no_power_pin_defined_warning"),message:F.string(),source_component_id:F.string(),source_port_ids:F.array(F.string()),subcircuit_id:F.string().optional()}).describe("Warning emitted when a chip has no source ports with requires_power=true"),_Zr=F.object({type:F.literal("source_no_ground_pin_defined_warning"),source_no_ground_pin_defined_warning_id:Co("source_no_ground_pin_defined_warning"),warning_type:F.literal("source_no_ground_pin_defined_warning").default("source_no_ground_pin_defined_warning"),message:F.string(),source_component_id:F.string(),source_port_ids:F.array(F.string()),subcircuit_id:F.string().optional()}).describe("Warning emitted when a chip has no source ports marked as ground pins"),gZr=F.object({type:F.literal("source_component_pins_underspecified_warning"),source_component_pins_underspecified_warning_id:Co("source_component_pins_underspecified_warning"),warning_type:F.literal("source_component_pins_underspecified_warning").default("source_component_pins_underspecified_warning"),message:F.string(),source_component_id:F.string(),source_port_ids:F.array(F.string()),subcircuit_id:F.string().optional()}).describe("Warning emitted when all ports on a source component are underspecified"),AZr=Yh.extend({type:F.literal("source_pin_must_be_connected_error"),source_pin_must_be_connected_error_id:Co("source_pin_must_be_connected_error"),error_type:F.literal("source_pin_must_be_connected_error").default("source_pin_must_be_connected_error"),source_component_id:F.string(),source_port_id:F.string(),subcircuit_id:F.string().optional()}).describe("Error emitted when a pin with mustBeConnected attribute is not connected to any trace"),fZr=Yh.extend({type:F.literal("unknown_error_finding_part"),unknown_error_finding_part_id:Co("unknown_error_finding_part"),error_type:F.literal("unknown_error_finding_part").default("unknown_error_finding_part"),source_component_id:F.string().optional(),subcircuit_id:F.string().optional()}).describe("Error emitted when an unexpected error occurs while finding a part"),yZr=F.object({type:F.literal("schematic_box"),schematic_component_id:F.string().optional(),schematic_symbol_id:F.string().optional(),width:eo,height:eo,is_dashed:F.boolean().default(!1),x:eo,y:eo,subcircuit_id:F.string().optional()}).describe("Draws a box on the schematic"),xZr=F.object({type:F.literal("schematic_path"),schematic_path_id:Co("schematic_path"),schematic_component_id:F.string().optional(),schematic_symbol_id:F.string().optional(),fill_color:F.string().optional(),is_filled:F.boolean().optional(),stroke_width:eo.nullable().optional(),stroke_color:F.string().optional(),points:F.array(ni),subcircuit_id:F.string().optional()}),CZr=F.record(F.object({left_margin:gr.optional(),right_margin:gr.optional(),top_margin:gr.optional(),bottom_margin:gr.optional()})),bZr=F.object({left_size:F.number(),right_size:F.number(),top_size:F.number().optional(),bottom_size:F.number().optional()}),IZr=F.object({left_side:F.object({pins:F.array(F.number()),direction:F.enum(["top-to-bottom","bottom-to-top"]).optional()}).optional(),right_side:F.object({pins:F.array(F.number()),direction:F.enum(["top-to-bottom","bottom-to-top"]).optional()}).optional(),top_side:F.object({pins:F.array(F.number()),direction:F.enum(["left-to-right","right-to-left"]).optional()}).optional(),bottom_side:F.object({pins:F.array(F.number()),direction:F.enum(["left-to-right","right-to-left"]).optional()}).optional()}),vZr=F.union([bZr,IZr]),SZr=F.object({type:F.literal("schematic_component"),size:qvn,center:ni,source_component_id:F.string().optional(),schematic_component_id:F.string(),schematic_symbol_id:F.string().optional(),pin_spacing:gr.optional(),pin_styles:CZr.optional(),box_width:gr.optional(),symbol_name:F.string().optional(),port_arrangement:vZr.optional(),port_labels:F.record(F.string()).optional(),symbol_display_value:F.string().optional(),subcircuit_id:F.string().optional(),schematic_group_id:F.string().optional(),is_schematic_group:F.boolean().optional(),source_group_id:F.string().optional(),is_box_with_pins:F.boolean().optional().default(!0)}),PZr=F.object({kicad_symbol:YJr.optional()}).catchall(F.unknown()),EZr=F.object({type:F.literal("schematic_symbol"),schematic_symbol_id:F.string(),name:F.string().optional(),metadata:PZr.optional()}).describe("Defines a named schematic symbol that can be referenced by components."),MZr=F.object({type:F.literal("schematic_line"),schematic_line_id:Co("schematic_line"),schematic_component_id:F.string().optional(),schematic_symbol_id:F.string().optional(),x1:eo,y1:eo,x2:eo,y2:eo,stroke_width:eo.nullable().optional(),color:F.string().default("#000000"),is_dashed:F.boolean().default(!1),subcircuit_id:F.string().optional()}).describe("Draws a styled line on the schematic"),wZr=F.object({type:F.literal("schematic_rect"),schematic_rect_id:Co("schematic_rect"),schematic_component_id:F.string().optional(),schematic_symbol_id:F.string().optional(),center:ni,width:eo,height:eo,rotation:Y_.default(0),stroke_width:eo.nullable().optional(),color:F.string().default("#000000"),is_filled:F.boolean().default(!1),fill_color:F.string().optional(),is_dashed:F.boolean().default(!1),subcircuit_id:F.string().optional()}).describe("Draws a styled rectangle on the schematic"),BZr=F.object({type:F.literal("schematic_circle"),schematic_circle_id:Co("schematic_circle"),schematic_component_id:F.string().optional(),schematic_symbol_id:F.string().optional(),center:ni,radius:eo,stroke_width:eo.nullable().optional(),color:F.string().default("#000000"),is_filled:F.boolean().default(!1),fill_color:F.string().optional(),is_dashed:F.boolean().default(!1),subcircuit_id:F.string().optional()}).describe("Draws a styled circle on the schematic"),TZr=F.object({type:F.literal("schematic_arc"),schematic_arc_id:Co("schematic_arc"),schematic_component_id:F.string().optional(),schematic_symbol_id:F.string().optional(),center:ni,radius:eo,start_angle_degrees:Y_,end_angle_degrees:Y_,direction:F.enum(["clockwise","counterclockwise"]).default("counterclockwise"),stroke_width:eo.nullable().optional(),color:F.string().default("#000000"),is_dashed:F.boolean().default(!1),subcircuit_id:F.string().optional()}).describe("Draws a styled arc on the schematic"),DZr=F.object({type:F.literal("schematic_trace"),schematic_trace_id:F.string(),source_trace_id:F.string().optional(),junctions:F.array(F.object({x:F.number(),y:F.number()})),edges:F.array(F.object({from:F.object({x:F.number(),y:F.number()}),to:F.object({x:F.number(),y:F.number()}),is_crossing:F.boolean().optional(),from_schematic_port_id:F.string().optional(),to_schematic_port_id:F.string().optional()})),subcircuit_id:F.string().optional(),subcircuit_connectivity_map_key:F.string().optional()}),NZr=F.enum(["center","left","right","top","bottom"]),RZr=F.object({type:F.literal("schematic_text"),schematic_component_id:F.string().optional(),schematic_symbol_id:F.string().optional(),schematic_text_id:F.string(),text:F.string(),font_size:F.number().default(0.18),position:F.object({x:eo,y:eo}),rotation:F.number().default(0),anchor:F.union([NZr.describe("legacy"),SL]).default("center"),color:F.string().default("#000000"),subcircuit_id:F.string().optional()}),QZr=F.object({type:F.literal("schematic_port"),schematic_port_id:F.string(),source_port_id:F.string(),schematic_component_id:F.string().optional(),center:ni,facing_direction:F.enum(["up","down","left","right"]).optional(),distance_from_component_edge:F.number().optional(),side_of_component:F.enum(["top","bottom","left","right"]).optional(),true_ccw_index:F.number().optional(),pin_number:F.number().optional(),display_pin_label:F.string().optional(),subcircuit_id:F.string().optional(),is_connected:F.boolean().optional(),has_input_arrow:F.boolean().optional(),has_output_arrow:F.boolean().optional(),is_drawn_with_inversion_circle:F.boolean().optional()}).describe("Defines a port on a schematic component"),kZr=F.object({type:F.literal("schematic_net_label"),schematic_net_label_id:Co("schematic_net_label"),schematic_trace_id:F.string().optional(),source_trace_id:F.string().optional(),source_net_id:F.string(),center:ni,anchor_position:ni.optional(),anchor_side:F.enum(["top","bottom","left","right"]),text:F.string(),symbol_name:F.string().optional(),is_movable:F.boolean().optional(),subcircuit_id:F.string().optional()}),LZr=Yh.extend({type:F.literal("schematic_error"),schematic_error_id:F.string(),error_type:F.literal("schematic_port_not_found").default("schematic_port_not_found"),subcircuit_id:F.string().optional()}).describe("Defines a schematic error on the schematic"),HZr=Yh.extend({type:F.literal("schematic_layout_error"),schematic_layout_error_id:Co("schematic_layout_error"),error_type:F.literal("schematic_layout_error").default("schematic_layout_error"),source_group_id:F.string(),schematic_group_id:F.string(),subcircuit_id:F.string().optional()}).describe("Error emitted when schematic layout fails for a group"),cct=F.object({type:F.literal("schematic_debug_object"),label:F.string().optional(),subcircuit_id:F.string().optional()}),FZr=cct.extend({shape:F.literal("rect"),center:ni,size:qvn}),zZr=cct.extend({shape:F.literal("line"),start:ni,end:ni}),OZr=cct.extend({shape:F.literal("point"),center:ni}),VZr=F.discriminatedUnion("shape",[FZr,zZr,OZr]),YZr=F.object({type:F.literal("schematic_voltage_probe"),schematic_voltage_probe_id:F.string(),source_component_id:F.string().optional(),name:F.string().optional(),position:ni,schematic_trace_id:F.string(),voltage:gL.optional(),subcircuit_id:F.string().optional(),color:F.string().optional(),label_alignment:SL.optional()}).describe("Defines a voltage probe measurement point on a schematic trace"),GZr=F.object({type:F.literal("schematic_manual_edit_conflict_warning"),schematic_manual_edit_conflict_warning_id:Co("schematic_manual_edit_conflict_warning"),warning_type:F.literal("schematic_manual_edit_conflict_warning").default("schematic_manual_edit_conflict_warning"),message:F.string(),schematic_component_id:F.string(),schematic_group_id:F.string().optional(),subcircuit_id:F.string().optional(),source_component_id:F.string()}).describe("Warning emitted when a component has both manual placement and explicit schX/schY coordinates"),UZr=F.object({type:F.literal("schematic_group"),schematic_group_id:Co("schematic_group"),source_group_id:F.string(),is_subcircuit:F.boolean().optional(),subcircuit_id:F.string().optional(),width:gr,height:gr,center:ni,schematic_component_ids:F.array(F.string()),show_as_schematic_box:F.boolean().optional(),name:F.string().optional(),description:F.string().optional()}).describe("Defines a group of components on the schematic"),WZr=F.object({type:F.literal("schematic_table"),schematic_table_id:Co("schematic_table"),anchor_position:ni,column_widths:F.array(eo),row_heights:F.array(eo),cell_padding:eo.optional(),border_width:eo.optional(),subcircuit_id:F.string().optional(),schematic_component_id:F.string().optional(),anchor:SL.optional()}).describe("Defines a table on the schematic"),XZr=F.object({type:F.literal("schematic_table_cell"),schematic_table_cell_id:Co("schematic_table_cell"),schematic_table_id:F.string(),start_row_index:F.number(),end_row_index:F.number(),start_column_index:F.number(),end_column_index:F.number(),text:F.string().optional(),center:ni,width:eo,height:eo,horizontal_align:F.enum(["left","center","right"]).optional(),vertical_align:F.enum(["top","middle","bottom"]).optional(),font_size:eo.optional(),subcircuit_id:F.string().optional()}).describe("Defines a cell within a schematic_table"),jZr=F.object({type:F.literal("schematic_sheet"),schematic_sheet_id:Co("schematic_sheet"),name:F.string().optional(),subcircuit_id:F.string().optional()}).describe("Defines a schematic sheet or page that components can be placed on"),KZr=F.object({x:eo,y:eo,bulge:F.number().optional()}),m1n=F.object({vertices:F.array(KZr)}),$Zr=F.object({outer_ring:m1n,inner_rings:F.array(m1n).default([])}),qZr=F.object({x:eo,y:eo,via:F.boolean().optional(),via_to_layer:Yc.optional()}),JZr=(F.array(qZr),F.object({x:eo,y:eo,via:F.boolean().optional(),to_layer:Yc.optional(),trace_width:eo.optional()})),ZZr=F.object({min_trace_width:gr.optional(),min_board_edge_clearance:gr.optional(),min_via_hole_edge_to_via_hole_edge_clearance:gr.optional(),min_plated_hole_drill_edge_to_drill_edge_clearance:gr.optional(),min_trace_to_pad_edge_clearance:gr.optional(),min_pad_edge_to_pad_edge_clearance:gr.optional(),min_same_net_trace_edge_to_trace_edge_clearance:gr.optional(),min_different_net_trace_edge_to_trace_edge_clearance:gr.optional(),min_via_hole_diameter:gr.optional(),min_via_pad_diameter:gr.optional()}),eei=F.object({type:F.literal("pcb_component"),pcb_component_id:Co("pcb_component"),source_component_id:F.string(),center:ni,layer:Yc,rotation:Y_,display_offset_x:F.string().optional().describe("How to display the x offset for this part, usually corresponding with how the user specified it"),display_offset_y:F.string().optional().describe("How to display the y offset for this part, usually corresponding with how the user specified it"),width:gr,height:gr,do_not_place:F.boolean().optional(),is_allowed_to_be_off_board:F.boolean().optional(),subcircuit_id:F.string().optional(),pcb_group_id:F.string().optional(),position_mode:F.enum(["packed","relative_to_group_anchor","relative_to_another_component","none"]).optional(),anchor_position:ni.optional(),anchor_alignment:SL.optional(),positioned_relative_to_pcb_group_id:F.string().optional(),positioned_relative_to_pcb_board_id:F.string().optional(),cable_insertion_center:ni.optional(),insertion_direction:F.enum(["from_above","from_left","from_right","from_front","from_back"]).optional(),metadata:F.object({kicad_footprint:HJr.optional()}).optional(),obstructs_within_bounds:F.boolean().default(!0).describe("Does this component take up all the space within its bounds on a layer. This is generally true except for when separated pin headers are being represented by a single component (in which case, chips can be placed between the pin headers) or for tall modules where chips fit underneath")}).describe("Defines a component on the PCB"),I8n=F.object({type:F.literal("pcb_hole"),pcb_hole_id:Co("pcb_hole"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),pcb_component_id:F.string().optional(),hole_shape:F.literal("circle"),hole_diameter:F.number(),x:eo,y:eo,is_covered_with_solder_mask:F.boolean().optional(),soldermask_margin:F.number().optional()}),v8n=(I8n.describe("Defines a circular hole on the PCB"),F.object({type:F.literal("pcb_hole"),pcb_hole_id:Co("pcb_hole"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),pcb_component_id:F.string().optional(),hole_shape:F.literal("rect"),hole_width:F.number(),hole_height:F.number(),x:eo,y:eo,is_covered_with_solder_mask:F.boolean().optional(),soldermask_margin:F.number().optional()})),S8n=(v8n.describe("Defines a rectangular (square-capable) hole on the PCB. Use equal width/height for square."),F.object({type:F.literal("pcb_hole"),pcb_hole_id:Co("pcb_hole"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),pcb_component_id:F.string().optional(),hole_shape:F.enum(["circle","square"]),hole_diameter:F.number(),x:eo,y:eo,is_covered_with_solder_mask:F.boolean().optional(),soldermask_margin:F.number().optional()})),P8n=(S8n.describe("Defines a circular or square hole on the PCB"),F.object({type:F.literal("pcb_hole"),pcb_hole_id:Co("pcb_hole"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),pcb_component_id:F.string().optional(),hole_shape:F.literal("oval"),hole_width:F.number(),hole_height:F.number(),x:eo,y:eo,is_covered_with_solder_mask:F.boolean().optional(),soldermask_margin:F.number().optional()})),E8n=(P8n.describe("Defines an oval hole on the PCB"),F.object({type:F.literal("pcb_hole"),pcb_hole_id:Co("pcb_hole"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),pcb_component_id:F.string().optional(),hole_shape:F.literal("pill"),hole_width:F.number(),hole_height:F.number(),x:eo,y:eo,is_covered_with_solder_mask:F.boolean().optional(),soldermask_margin:F.number().optional()})),_1n=(E8n.describe("Defines a pill-shaped hole on the PCB"),F.object({type:F.literal("pcb_hole"),pcb_hole_id:Co("pcb_hole"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),pcb_component_id:F.string().optional(),hole_shape:F.literal("rotated_pill"),hole_width:F.number(),hole_height:F.number(),x:eo,y:eo,ccw_rotation:Y_,is_covered_with_solder_mask:F.boolean().optional(),soldermask_margin:F.number().optional()})),tei=(_1n.describe("Defines a rotated pill-shaped hole on the PCB"),S8n.or(P8n).or(E8n).or(_1n).or(I8n).or(v8n)),nei=F.object({type:F.literal("pcb_plated_hole"),shape:F.literal("circle"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),outer_diameter:F.number(),hole_diameter:F.number(),is_covered_with_solder_mask:F.boolean().optional(),x:eo,y:eo,layers:F.array(Yc),port_hints:F.array(F.string()).optional(),pcb_component_id:F.string().optional(),pcb_port_id:F.string().optional(),pcb_plated_hole_id:Co("pcb_plated_hole"),soldermask_margin:F.number().optional()}),oei=F.object({type:F.literal("pcb_plated_hole"),shape:F.enum(["oval","pill"]),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),outer_width:F.number(),outer_height:F.number(),hole_width:F.number(),hole_height:F.number(),is_covered_with_solder_mask:F.boolean().optional(),x:eo,y:eo,ccw_rotation:Y_,layers:F.array(Yc),port_hints:F.array(F.string()).optional(),pcb_component_id:F.string().optional(),pcb_port_id:F.string().optional(),pcb_plated_hole_id:Co("pcb_plated_hole"),soldermask_margin:F.number().optional()}),rei=F.object({type:F.literal("pcb_plated_hole"),shape:F.literal("circular_hole_with_rect_pad"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),hole_shape:F.literal("circle"),pad_shape:F.literal("rect"),hole_diameter:F.number(),rect_pad_width:F.number(),rect_pad_height:F.number(),rect_border_radius:F.number().optional(),hole_offset_x:eo.default(0),hole_offset_y:eo.default(0),is_covered_with_solder_mask:F.boolean().optional(),x:eo,y:eo,layers:F.array(Yc),port_hints:F.array(F.string()).optional(),pcb_component_id:F.string().optional(),pcb_port_id:F.string().optional(),pcb_plated_hole_id:Co("pcb_plated_hole"),soldermask_margin:F.number().optional(),rect_ccw_rotation:Y_.optional()}),iei=F.object({type:F.literal("pcb_plated_hole"),shape:F.literal("pill_hole_with_rect_pad"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),hole_shape:F.literal("pill"),pad_shape:F.literal("rect"),hole_width:F.number(),hole_height:F.number(),rect_pad_width:F.number(),rect_pad_height:F.number(),rect_border_radius:F.number().optional(),hole_offset_x:eo.default(0),hole_offset_y:eo.default(0),is_covered_with_solder_mask:F.boolean().optional(),x:eo,y:eo,layers:F.array(Yc),port_hints:F.array(F.string()).optional(),pcb_component_id:F.string().optional(),pcb_port_id:F.string().optional(),pcb_plated_hole_id:Co("pcb_plated_hole"),soldermask_margin:F.number().optional()}),sei=F.object({type:F.literal("pcb_plated_hole"),shape:F.literal("rotated_pill_hole_with_rect_pad"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),hole_shape:F.literal("rotated_pill"),pad_shape:F.literal("rect"),hole_width:F.number(),hole_height:F.number(),hole_ccw_rotation:Y_,rect_pad_width:F.number(),rect_pad_height:F.number(),rect_border_radius:F.number().optional(),rect_ccw_rotation:Y_,hole_offset_x:eo.default(0),hole_offset_y:eo.default(0),is_covered_with_solder_mask:F.boolean().optional(),x:eo,y:eo,layers:F.array(Yc),port_hints:F.array(F.string()).optional(),pcb_component_id:F.string().optional(),pcb_port_id:F.string().optional(),pcb_plated_hole_id:Co("pcb_plated_hole"),soldermask_margin:F.number().optional()}),aei=F.object({type:F.literal("pcb_plated_hole"),shape:F.literal("hole_with_polygon_pad"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),hole_shape:F.enum(["circle","oval","pill","rotated_pill"]),hole_diameter:F.number().optional(),hole_width:F.number().optional(),hole_height:F.number().optional(),pad_outline:F.array(F.object({x:eo,y:eo})).min(3),hole_offset_x:eo.default(0),hole_offset_y:eo.default(0),is_covered_with_solder_mask:F.boolean().optional(),x:eo,y:eo,layers:F.array(Yc),port_hints:F.array(F.string()).optional(),pcb_component_id:F.string().optional(),pcb_port_id:F.string().optional(),pcb_plated_hole_id:Co("pcb_plated_hole"),soldermask_margin:F.number().optional(),ccw_rotation:Y_.optional()}),cei=F.union([nei,oei,rei,iei,sei,aei]),lei=F.object({type:F.literal("pcb_port"),pcb_port_id:Co("pcb_port"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),source_port_id:F.string(),pcb_component_id:F.string().optional(),x:eo,y:eo,layers:F.array(Yc),is_board_pinout:F.boolean().optional()}).describe("Defines a port on the PCB"),hei=F.object({type:F.literal("pcb_smtpad"),shape:F.literal("circle"),pcb_smtpad_id:Co("pcb_smtpad"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),x:eo,y:eo,radius:F.number(),layer:Yc,port_hints:F.array(F.string()).optional(),pcb_component_id:F.string().optional(),pcb_port_id:F.string().optional(),is_covered_with_solder_mask:F.boolean().optional(),soldermask_margin:F.number().optional()}),dei=F.object({type:F.literal("pcb_smtpad"),shape:F.literal("rect"),pcb_smtpad_id:Co("pcb_smtpad"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),x:eo,y:eo,width:F.number(),height:F.number(),rect_border_radius:F.number().optional(),corner_radius:F.number().optional(),layer:Yc,port_hints:F.array(F.string()).optional(),pcb_component_id:F.string().optional(),pcb_port_id:F.string().optional(),is_covered_with_solder_mask:F.boolean().optional(),soldermask_margin:F.number().optional(),soldermask_margin_left:F.number().optional(),soldermask_margin_top:F.number().optional(),soldermask_margin_right:F.number().optional(),soldermask_margin_bottom:F.number().optional()}),uei=F.object({type:F.literal("pcb_smtpad"),shape:F.literal("rotated_rect"),pcb_smtpad_id:Co("pcb_smtpad"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),x:eo,y:eo,width:F.number(),height:F.number(),rect_border_radius:F.number().optional(),corner_radius:F.number().optional(),ccw_rotation:Y_,layer:Yc,port_hints:F.array(F.string()).optional(),pcb_component_id:F.string().optional(),pcb_port_id:F.string().optional(),is_covered_with_solder_mask:F.boolean().optional(),soldermask_margin:F.number().optional(),soldermask_margin_left:F.number().optional(),soldermask_margin_top:F.number().optional(),soldermask_margin_right:F.number().optional(),soldermask_margin_bottom:F.number().optional()}),pei=F.object({type:F.literal("pcb_smtpad"),shape:F.literal("pill"),pcb_smtpad_id:Co("pcb_smtpad"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),x:eo,y:eo,width:F.number(),height:F.number(),radius:F.number(),layer:Yc,port_hints:F.array(F.string()).optional(),pcb_component_id:F.string().optional(),pcb_port_id:F.string().optional(),is_covered_with_solder_mask:F.boolean().optional(),soldermask_margin:F.number().optional()}),mei=F.object({type:F.literal("pcb_smtpad"),shape:F.literal("rotated_pill"),pcb_smtpad_id:Co("pcb_smtpad"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),x:eo,y:eo,width:F.number(),height:F.number(),radius:F.number(),ccw_rotation:Y_,layer:Yc,port_hints:F.array(F.string()).optional(),pcb_component_id:F.string().optional(),pcb_port_id:F.string().optional(),is_covered_with_solder_mask:F.boolean().optional(),soldermask_margin:F.number().optional()}),_ei=F.object({type:F.literal("pcb_smtpad"),shape:F.literal("polygon"),pcb_smtpad_id:Co("pcb_smtpad"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),points:F.array(ni),layer:Yc,port_hints:F.array(F.string()).optional(),pcb_component_id:F.string().optional(),pcb_port_id:F.string().optional(),is_covered_with_solder_mask:F.boolean().optional(),soldermask_margin:F.number().optional()}),gei=F.discriminatedUnion("shape",[hei,dei,uei,mei,pei,_ei]).describe("Defines an SMT pad on the PCB"),Aei=F.object({type:F.literal("pcb_solder_paste"),shape:F.literal("circle"),pcb_solder_paste_id:Co("pcb_solder_paste"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),x:eo,y:eo,radius:F.number(),layer:Yc,pcb_component_id:F.string().optional(),pcb_smtpad_id:F.string().optional()}),fei=F.object({type:F.literal("pcb_solder_paste"),shape:F.literal("rect"),pcb_solder_paste_id:Co("pcb_solder_paste"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),x:eo,y:eo,width:F.number(),height:F.number(),layer:Yc,pcb_component_id:F.string().optional(),pcb_smtpad_id:F.string().optional()}),yei=F.object({type:F.literal("pcb_solder_paste"),shape:F.literal("pill"),pcb_solder_paste_id:Co("pcb_solder_paste"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),x:eo,y:eo,width:F.number(),height:F.number(),radius:F.number(),layer:Yc,pcb_component_id:F.string().optional(),pcb_smtpad_id:F.string().optional()}),xei=F.object({type:F.literal("pcb_solder_paste"),shape:F.literal("rotated_rect"),pcb_solder_paste_id:Co("pcb_solder_paste"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),x:eo,y:eo,width:F.number(),height:F.number(),ccw_rotation:eo,layer:Yc,pcb_component_id:F.string().optional(),pcb_smtpad_id:F.string().optional()}),Cei=F.object({type:F.literal("pcb_solder_paste"),shape:F.literal("oval"),pcb_solder_paste_id:Co("pcb_solder_paste"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),x:eo,y:eo,width:F.number(),height:F.number(),layer:Yc,pcb_component_id:F.string().optional(),pcb_smtpad_id:F.string().optional()}),bei=F.union([Aei,fei,yei,xei,Cei]).describe("Defines solderpaste on the PCB"),Iei=F.object({type:F.literal("pcb_text"),pcb_text_id:Co("pcb_text"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),text:F.string(),center:ni,layer:Yc,width:gr,height:gr,lines:F.number(),align:F.enum(["bottom-left"])}).describe("Defines text on the PCB"),vei=F.object({route_type:F.literal("wire"),x:eo,y:eo,width:eo,copper_pour_id:F.string().optional(),is_inside_copper_pour:F.boolean().optional(),start_pcb_port_id:F.string().optional(),end_pcb_port_id:F.string().optional(),layer:Yc}),Sei=F.object({route_type:F.literal("via"),x:eo,y:eo,copper_pour_id:F.string().optional(),is_inside_copper_pour:F.boolean().optional(),hole_diameter:eo.optional(),outer_diameter:eo.optional(),from_layer:Yc,to_layer:Yc}),Pei=F.union([vei,Sei]),Eei=F.object({type:F.literal("pcb_trace"),source_trace_id:F.string().optional(),pcb_component_id:F.string().optional(),pcb_trace_id:Co("pcb_trace"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),route_thickness_mode:F.enum(["constant","interpolated"]).default("constant").optional(),route_order_index:F.number().optional(),should_round_corners:F.boolean().optional(),trace_length:F.number().optional(),highlight_color:F.string().optional(),route:F.array(Pei)}).describe("Defines a trace on the PCB"),Mei=F.object({type:F.literal("pcb_trace_warning"),pcb_trace_warning_id:Co("pcb_trace_warning"),warning_type:F.literal("pcb_trace_warning").default("pcb_trace_warning"),message:F.string(),center:ni.optional(),pcb_trace_id:F.string(),source_trace_id:F.string(),pcb_component_ids:F.array(F.string()),pcb_port_ids:F.array(F.string()),subcircuit_id:F.string().optional()}).describe("Defines a trace warning on the PCB"),wei=Yh.extend({type:F.literal("pcb_trace_error"),pcb_trace_error_id:Co("pcb_trace_error"),error_type:F.literal("pcb_trace_error").default("pcb_trace_error"),center:ni.optional(),pcb_trace_id:F.string(),source_trace_id:F.string(),pcb_component_ids:F.array(F.string()),pcb_port_ids:F.array(F.string()),subcircuit_id:F.string().optional()}).describe("Defines a trace error on the PCB"),Bei=Yh.extend({type:F.literal("pcb_trace_missing_error"),pcb_trace_missing_error_id:Co("pcb_trace_missing_error"),error_type:F.literal("pcb_trace_missing_error").default("pcb_trace_missing_error"),center:ni.optional(),source_trace_id:F.string(),pcb_component_ids:F.array(F.string()),pcb_port_ids:F.array(F.string()),subcircuit_id:F.string().optional()}).describe("Defines an error when a source trace has no corresponding PCB trace"),Tei=Yh.extend({type:F.literal("pcb_port_not_matched_error"),pcb_error_id:Co("pcb_error"),error_type:F.literal("pcb_port_not_matched_error").default("pcb_port_not_matched_error"),pcb_component_ids:F.array(F.string()),subcircuit_id:F.string().optional()}).describe("Defines a trace error on the PCB where a port is not matched"),Dei=Yh.extend({type:F.literal("pcb_port_not_connected_error"),pcb_port_not_connected_error_id:Co("pcb_port_not_connected_error"),error_type:F.literal("pcb_port_not_connected_error").default("pcb_port_not_connected_error"),pcb_port_ids:F.array(F.string()),pcb_component_ids:F.array(F.string()),subcircuit_id:F.string().optional()}).describe("Defines an error when a pcb port is not connected to any trace"),Nei=F.object({type:F.literal("pcb_net"),pcb_net_id:Co("pcb_net"),source_net_id:F.string().optional(),highlight_color:F.string().optional()}).describe("Defines a net on the PCB"),Rei=F.object({type:F.literal("pcb_via"),pcb_via_id:Co("pcb_via"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),subcircuit_connectivity_map_key:F.string().optional(),x:eo,y:eo,outer_diameter:eo.default("0.6mm"),hole_diameter:eo.default("0.25mm"),from_layer:Yc.optional(),to_layer:Yc.optional(),layers:F.array(Yc),pcb_trace_id:F.string().optional(),net_is_assignable:F.boolean().optional(),net_assigned:F.boolean().optional(),is_tented:F.boolean().optional()}).describe("Defines a via on the PCB"),Qei=F.object({type:F.literal("pcb_board"),pcb_board_id:Co("pcb_board"),pcb_panel_id:F.string().optional(),carrier_pcb_board_id:F.string().optional(),is_subcircuit:F.boolean().optional(),subcircuit_id:F.string().optional(),is_mounted_to_carrier_board:F.boolean().optional(),width:gr.optional(),height:gr.optional(),center:ni,display_offset_x:F.string().optional().describe("How to display the x offset for this board, usually corresponding with how the user specified it"),display_offset_y:F.string().optional().describe("How to display the y offset for this board, usually corresponding with how the user specified it"),thickness:gr.optional().default(1.4),num_layers:F.number().optional().default(4),outline:F.array(ni).optional(),shape:F.enum(["rect","polygon"]).optional(),material:F.enum(["fr4","fr1"]).default("fr4"),anchor_position:ni.optional(),anchor_alignment:SL.optional(),position_mode:F.enum(["relative_to_panel_anchor","none"]).optional()}).merge(ZZr).describe("Defines the board outline of the PCB");var kei=F.object({type:F.literal("pcb_panel"),pcb_panel_id:Co("pcb_panel"),width:gr,height:gr,center:ni,thickness:gr.optional().default(1.4),covered_with_solder_mask:F.boolean().optional().default(!0)}).describe("Defines a PCB panel that can contain multiple boards"),Lei=Yh.extend({type:F.literal("pcb_placement_error"),pcb_placement_error_id:Co("pcb_placement_error"),error_type:F.literal("pcb_placement_error").default("pcb_placement_error"),subcircuit_id:F.string().optional()}).describe("Defines a placement error on the PCB"),Hei=Yh.extend({type:F.literal("pcb_panelization_placement_error"),pcb_panelization_placement_error_id:Co("pcb_panelization_placement_error"),error_type:F.literal("pcb_panelization_placement_error").default("pcb_panelization_placement_error"),pcb_panel_id:F.string().optional(),pcb_board_id:F.string().optional(),subcircuit_id:F.string().optional()}).describe("Defines a panelization placement error on the PCB"),Fei=F.object({type:F.literal("pcb_trace_hint"),pcb_trace_hint_id:Co("pcb_trace_hint"),pcb_port_id:F.string(),pcb_component_id:F.string(),route:F.array(JZr),subcircuit_id:F.string().optional()}).describe("A hint that can be used during generation of a PCB trace"),zei=F.object({type:F.literal("pcb_silkscreen_line"),pcb_silkscreen_line_id:Co("pcb_silkscreen_line"),pcb_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),stroke_width:eo.default("0.1mm"),x1:eo,y1:eo,x2:eo,y2:eo,layer:N1}).describe("Defines a silkscreen line on the PCB"),Oei=F.object({type:F.literal("pcb_silkscreen_path"),pcb_silkscreen_path_id:Co("pcb_silkscreen_path"),pcb_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),layer:N1,route:F.array(ni),stroke_width:gr}).describe("Defines a silkscreen path on the PCB"),Vei=F.object({type:F.literal("pcb_silkscreen_text"),pcb_silkscreen_text_id:Co("pcb_silkscreen_text"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),font:F.literal("tscircuit2024").default("tscircuit2024"),font_size:eo.default("0.2mm"),pcb_component_id:F.string(),text:F.string(),is_knockout:F.boolean().default(!1).optional(),knockout_padding:F.object({left:gr,top:gr,bottom:gr,right:gr}).default({left:"0.2mm",top:"0.2mm",bottom:"0.2mm",right:"0.2mm"}).optional(),ccw_rotation:F.number().optional(),layer:Yc,is_mirrored:F.boolean().default(!1).optional(),anchor_position:ni.default({x:0,y:0}),anchor_alignment:SL.default("center")}).describe("Defines silkscreen text on the PCB"),Yei=F.object({type:F.literal("pcb_copper_text"),pcb_copper_text_id:Co("pcb_copper_text"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),font:F.literal("tscircuit2024").default("tscircuit2024"),font_size:eo.default("0.2mm"),pcb_component_id:F.string(),text:F.string(),is_knockout:F.boolean().default(!1).optional(),knockout_padding:F.object({left:gr,top:gr,bottom:gr,right:gr}).default({left:"0.2mm",top:"0.2mm",bottom:"0.2mm",right:"0.2mm"}).optional(),ccw_rotation:F.number().optional(),layer:Yc,is_mirrored:F.boolean().default(!1).optional(),anchor_position:ni.default({x:0,y:0}),anchor_alignment:SL.default("center")}).describe("Defines copper text on the PCB"),Gei=F.object({type:F.literal("pcb_silkscreen_rect"),pcb_silkscreen_rect_id:Co("pcb_silkscreen_rect"),pcb_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),center:ni,width:gr,height:gr,layer:Yc,stroke_width:gr.default("1mm"),corner_radius:gr.optional(),is_filled:F.boolean().default(!0).optional(),has_stroke:F.boolean().optional(),is_stroke_dashed:F.boolean().optional(),ccw_rotation:F.number().optional()}).describe("Defines a silkscreen rect on the PCB"),Uei=F.object({type:F.literal("pcb_silkscreen_circle"),pcb_silkscreen_circle_id:Co("pcb_silkscreen_circle"),pcb_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),center:ni,radius:gr,layer:N1,stroke_width:gr.default("1mm"),is_filled:F.boolean().optional()}).describe("Defines a silkscreen circle on the PCB"),Wei=F.object({type:F.literal("pcb_silkscreen_oval"),pcb_silkscreen_oval_id:Co("pcb_silkscreen_oval"),pcb_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),center:ni,radius_x:eo,radius_y:eo,layer:N1,ccw_rotation:Y_.optional()}).describe("Defines a silkscreen oval on the PCB"),Xei=F.object({type:F.literal("pcb_silkscreen_pill"),pcb_silkscreen_pill_id:Co("pcb_silkscreen_pill"),pcb_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),center:ni,width:gr,height:gr,layer:Yc,ccw_rotation:F.number().optional()}).describe("Defines a silkscreen pill on the PCB"),jei=F.object({type:F.literal("pcb_fabrication_note_text"),pcb_fabrication_note_text_id:Co("pcb_fabrication_note_text"),subcircuit_id:F.string().optional(),pcb_group_id:F.string().optional(),font:F.literal("tscircuit2024").default("tscircuit2024"),font_size:eo.default("1mm"),pcb_component_id:F.string(),text:F.string(),layer:N1,anchor_position:ni.default({x:0,y:0}),anchor_alignment:F.enum(["center","top_left","top_right","bottom_left","bottom_right"]).default("center"),color:F.string().optional()}).describe("Defines a fabrication note in text on the PCB, useful for leaving notes for assemblers or fabricators"),Kei=F.object({type:F.literal("pcb_fabrication_note_path"),pcb_fabrication_note_path_id:Co("pcb_fabrication_note_path"),pcb_component_id:F.string(),subcircuit_id:F.string().optional(),layer:Yc,route:F.array(ni),stroke_width:gr,color:F.string().optional()}).describe("Defines a fabrication path on the PCB for fabricators or assemblers"),$ei=F.object({type:F.literal("pcb_fabrication_note_rect"),pcb_fabrication_note_rect_id:Co("pcb_fabrication_note_rect"),pcb_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),center:ni,width:gr,height:gr,layer:N1,stroke_width:gr.default("0.1mm"),corner_radius:gr.optional(),is_filled:F.boolean().optional(),has_stroke:F.boolean().optional(),is_stroke_dashed:F.boolean().optional(),color:F.string().optional()}).describe("Defines a fabrication note rectangle on the PCB"),qei=F.object({type:F.literal("pcb_fabrication_note_dimension"),pcb_fabrication_note_dimension_id:Co("pcb_fabrication_note_dimension"),pcb_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),layer:N1,from:ni,to:ni,text:F.string().optional(),text_ccw_rotation:F.number().optional(),offset:gr.optional(),offset_distance:gr.optional(),offset_direction:F.object({x:F.number(),y:F.number()}).optional(),font:F.literal("tscircuit2024").default("tscircuit2024"),font_size:gr.default("1mm"),color:F.string().optional(),arrow_size:gr.default("1mm")}).describe("Defines a measurement annotation within PCB fabrication notes"),Jei=F.object({type:F.literal("pcb_note_text"),pcb_note_text_id:Co("pcb_note_text"),pcb_component_id:F.string().optional(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),name:F.string().optional(),font:F.literal("tscircuit2024").default("tscircuit2024"),font_size:eo.default("1mm"),text:F.string().optional(),anchor_position:ni.default({x:0,y:0}),anchor_alignment:F.enum(["center","top_left","top_right","bottom_left","bottom_right"]).default("center"),layer:N1.default("top"),is_mirrored_from_top_view:F.boolean().optional(),color:F.string().optional()}).describe("Defines a documentation note in text on the PCB"),Zei=F.object({type:F.literal("pcb_note_rect"),pcb_note_rect_id:Co("pcb_note_rect"),pcb_component_id:F.string().optional(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),name:F.string().optional(),text:F.string().optional(),center:ni,width:gr,height:gr,layer:N1.default("top"),stroke_width:gr.default("0.1mm"),corner_radius:gr.optional(),is_filled:F.boolean().optional(),has_stroke:F.boolean().optional(),is_stroke_dashed:F.boolean().optional(),color:F.string().optional()}).describe("Defines a rectangular documentation note on the PCB"),eti=F.object({type:F.literal("pcb_note_path"),pcb_note_path_id:Co("pcb_note_path"),pcb_component_id:F.string().optional(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),name:F.string().optional(),text:F.string().optional(),route:F.array(ni),layer:N1.default("top"),stroke_width:gr.default("0.1mm"),color:F.string().optional()}).describe("Defines a polyline documentation note on the PCB"),tti=F.object({type:F.literal("pcb_note_line"),pcb_note_line_id:Co("pcb_note_line"),pcb_component_id:F.string().optional(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),name:F.string().optional(),text:F.string().optional(),x1:eo,y1:eo,x2:eo,y2:eo,layer:N1.default("top"),stroke_width:eo.default("0.1mm"),color:F.string().optional(),is_dashed:F.boolean().optional()}).describe("Defines a straight documentation note line on the PCB"),nti=F.object({type:F.literal("pcb_note_dimension"),pcb_note_dimension_id:Co("pcb_note_dimension"),pcb_component_id:F.string().optional(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),name:F.string().optional(),from:ni,to:ni,text:F.string().optional(),text_ccw_rotation:F.number().optional(),offset_distance:gr.optional(),offset_direction:F.object({x:F.number(),y:F.number()}).optional(),font:F.literal("tscircuit2024").default("tscircuit2024"),font_size:gr.default("1mm"),layer:N1.default("top"),color:F.string().optional(),arrow_size:gr.default("1mm")}).describe("Defines a measurement annotation within PCB documentation notes"),oti=Yh.extend({type:F.literal("pcb_footprint_overlap_error"),pcb_error_id:Co("pcb_error"),error_type:F.literal("pcb_footprint_overlap_error").default("pcb_footprint_overlap_error"),pcb_smtpad_ids:F.array(F.string()).optional(),pcb_plated_hole_ids:F.array(F.string()).optional(),pcb_hole_ids:F.array(F.string()).optional(),pcb_keepout_ids:F.array(F.string()).optional()}).describe("Error emitted when a pcb footprint overlaps with another element"),rti=Yh.extend({type:F.literal("pcb_courtyard_overlap_error"),pcb_error_id:Co("pcb_error"),error_type:F.literal("pcb_courtyard_overlap_error").default("pcb_courtyard_overlap_error"),pcb_component_ids:F.tuple([F.string(),F.string()])}).describe("Error emitted when the courtyard (CrtYd) of one PCB component overlaps with the courtyard of another"),iti=F.object({type:F.literal("pcb_keepout"),shape:F.literal("rect"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),center:ni,width:eo,height:eo,pcb_keepout_id:F.string(),layers:F.array(F.string()),description:F.string().optional()}).or(F.object({type:F.literal("pcb_keepout"),shape:F.literal("circle"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),center:ni,radius:eo,pcb_keepout_id:F.string(),layers:F.array(F.string()),description:F.string().optional()})),a7e=F.object({type:F.literal("pcb_cutout"),pcb_cutout_id:Co("pcb_cutout"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),pcb_board_id:F.string().optional(),pcb_panel_id:F.string().optional()}),sti=a7e.extend({shape:F.literal("rect"),center:ni,width:gr,height:gr,rotation:Y_.optional(),corner_radius:gr.optional()}),ati=a7e.extend({shape:F.literal("circle"),center:ni,radius:gr}),cti=a7e.extend({shape:F.literal("polygon"),points:F.array(ni)}),lti=a7e.extend({shape:F.literal("path"),route:F.array(ni),slot_width:gr,slot_length:gr.optional(),space_between_slots:gr.optional(),slot_corner_radius:gr.optional()}),hti=F.discriminatedUnion("shape",[sti,ati,cti,lti]).describe("Defines a cutout on the PCB, removing board material."),dti=Yh.extend({type:F.literal("pcb_missing_footprint_error"),pcb_missing_footprint_error_id:Co("pcb_missing_footprint_error"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),error_type:F.literal("pcb_missing_footprint_error").default("pcb_missing_footprint_error"),source_component_id:F.string()}).describe("Defines a missing footprint error on the PCB"),uti=Yh.extend({type:F.literal("external_footprint_load_error"),external_footprint_load_error_id:Co("external_footprint_load_error"),pcb_component_id:F.string(),source_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),footprinter_string:F.string().optional(),error_type:F.literal("external_footprint_load_error").default("external_footprint_load_error")}).describe("Defines an error when an external footprint fails to load"),pti=Yh.extend({type:F.literal("circuit_json_footprint_load_error"),circuit_json_footprint_load_error_id:Co("circuit_json_footprint_load_error"),pcb_component_id:F.string(),source_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),error_type:F.literal("circuit_json_footprint_load_error").default("circuit_json_footprint_load_error"),circuit_json:F.array(F.any()).optional()}).describe("Defines an error when a circuit JSON footprint fails to load"),mti=F.object({type:F.literal("pcb_group"),pcb_group_id:Co("pcb_group"),source_group_id:F.string(),is_subcircuit:F.boolean().optional(),subcircuit_id:F.string().optional(),width:gr.optional(),height:gr.optional(),center:ni,display_offset_x:F.string().optional().describe("How to display the x offset for this group, usually corresponding with how the user specified it"),display_offset_y:F.string().optional().describe("How to display the y offset for this group, usually corresponding with how the user specified it"),outline:F.array(ni).optional(),anchor_position:ni.optional(),anchor_alignment:SL.default("center"),position_mode:F.enum(["packed","relative_to_group_anchor","none"]).optional(),positioned_relative_to_pcb_group_id:F.string().optional(),positioned_relative_to_pcb_board_id:F.string().optional(),pcb_component_ids:F.array(F.string()),child_layout_mode:F.enum(["packed","none"]).optional(),name:F.string().optional(),description:F.string().optional(),layout_mode:F.string().optional(),autorouter_configuration:F.object({trace_clearance:gr}).optional(),autorouter_used_string:F.string().optional()}).describe("Defines a group of components on the PCB"),_ti=Yh.extend({type:F.literal("pcb_autorouting_error"),pcb_error_id:Co("pcb_autorouting_error"),error_type:F.literal("pcb_autorouting_error").default("pcb_autorouting_error"),subcircuit_id:F.string().optional()}).describe("The autorouting has failed to route a portion of the board"),gti=F.object({type:F.literal("pcb_manual_edit_conflict_warning"),pcb_manual_edit_conflict_warning_id:Co("pcb_manual_edit_conflict_warning"),warning_type:F.literal("pcb_manual_edit_conflict_warning").default("pcb_manual_edit_conflict_warning"),message:F.string(),pcb_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),source_component_id:F.string()}).describe("Warning emitted when a component has both manual placement and explicit pcbX/pcbY coordinates"),g1n=F.enum(["x-","x+","y+","y-"]),Ati=F.object({type:F.literal("pcb_connector_not_in_accessible_orientation_warning"),pcb_connector_not_in_accessible_orientation_warning_id:Co("pcb_connector_not_in_accessible_orientation_warning"),warning_type:F.literal("pcb_connector_not_in_accessible_orientation_warning").default("pcb_connector_not_in_accessible_orientation_warning"),message:F.string(),pcb_component_id:F.string(),source_component_id:F.string().optional(),pcb_board_id:F.string().optional(),facing_direction:g1n,recommended_facing_direction:g1n,subcircuit_id:F.string().optional()}).describe("Warning emitted when a connector PCB component is facing inward toward the board and should be reoriented to an outward-facing direction"),fti=F.object({type:F.literal("supplier_footprint_mismatch_warning"),supplier_footprint_mismatch_warning_id:Co("supplier_footprint_mismatch_warning"),warning_type:F.literal("supplier_footprint_mismatch_warning").default("supplier_footprint_mismatch_warning"),message:F.string(),source_component_id:F.string(),pcb_component_id:F.string().optional(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),supplier_name:Zvn.optional(),supplier_part_number:F.string().optional(),supplier_footprint_url:F.string().optional(),footprint_copper_intersection_over_union:F.number()}).describe("Warning emitted when a supplier part footprint does not match the expected footprint"),yti=F.object({type:F.literal("pcb_breakout_point"),pcb_breakout_point_id:Co("pcb_breakout_point"),pcb_group_id:F.string(),subcircuit_id:F.string().optional(),source_trace_id:F.string().optional(),source_port_id:F.string().optional(),source_net_id:F.string().optional(),x:eo,y:eo}).describe("Defines a routing target within a pcb_group for a source_trace or source_net"),xti=F.object({type:F.literal("pcb_ground_plane"),pcb_ground_plane_id:Co("pcb_ground_plane"),source_pcb_ground_plane_id:F.string(),source_net_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional()}).describe("Defines a ground plane on the PCB"),Cti=F.object({type:F.literal("pcb_ground_plane_region"),pcb_ground_plane_region_id:Co("pcb_ground_plane_region"),pcb_ground_plane_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),layer:Yc,points:F.array(ni)}).describe("Defines a polygon region of a ground plane"),bti=F.object({type:F.literal("pcb_thermal_spoke"),pcb_thermal_spoke_id:Co("pcb_thermal_spoke"),pcb_ground_plane_id:F.string(),shape:F.string(),spoke_count:F.number(),spoke_thickness:eo,spoke_inner_diameter:eo,spoke_outer_diameter:eo,pcb_plated_hole_id:F.string().optional(),subcircuit_id:F.string().optional()}).describe("Pattern for connecting a ground plane to a plated hole"),lct=F.object({type:F.literal("pcb_copper_pour"),pcb_copper_pour_id:Co("pcb_copper_pour"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),layer:Yc,source_net_id:F.string().optional(),covered_with_solder_mask:F.boolean().optional().default(!0)}),Iti=lct.extend({shape:F.literal("rect"),center:ni,width:gr,height:gr,rotation:Y_.optional()}),vti=lct.extend({shape:F.literal("brep"),brep_shape:$Zr}),Sti=lct.extend({shape:F.literal("polygon"),points:F.array(ni)}),Pti=F.discriminatedUnion("shape",[Iti,vti,Sti]).describe("Defines a copper pour on the PCB."),Eti=Yh.extend({type:F.literal("pcb_component_outside_board_error"),pcb_component_outside_board_error_id:Co("pcb_component_outside_board_error"),error_type:F.literal("pcb_component_outside_board_error").default("pcb_component_outside_board_error"),pcb_component_id:F.string(),pcb_board_id:F.string(),component_center:ni,component_bounds:F.object({min_x:F.number(),max_x:F.number(),min_y:F.number(),max_y:F.number()}),subcircuit_id:F.string().optional(),source_component_id:F.string().optional()}).describe("Error emitted when a PCB component is placed outside the board boundaries"),Mti=Yh.extend({type:F.literal("pcb_component_not_on_board_edge_error"),pcb_component_not_on_board_edge_error_id:Co("pcb_component_not_on_board_edge_error"),error_type:F.literal("pcb_component_not_on_board_edge_error").default("pcb_component_not_on_board_edge_error"),pcb_component_id:F.string(),pcb_board_id:F.string(),component_center:ni,pad_to_nearest_board_edge_distance:F.number(),source_component_id:F.string().optional(),subcircuit_id:F.string().optional()}).describe("Error emitted when a component that must be placed on the board edge is centered away from the edge"),wti=Yh.extend({type:F.literal("pcb_component_invalid_layer_error"),pcb_component_invalid_layer_error_id:Co("pcb_component_invalid_layer_error"),error_type:F.literal("pcb_component_invalid_layer_error").default("pcb_component_invalid_layer_error"),pcb_component_id:F.string().optional(),source_component_id:F.string(),layer:Yc,subcircuit_id:F.string().optional()}).describe("Error emitted when a component is placed on an invalid layer (components can only be on 'top' or 'bottom' layers)"),Bti=Yh.extend({type:F.literal("pcb_via_clearance_error"),pcb_error_id:Co("pcb_error"),error_type:F.literal("pcb_via_clearance_error").default("pcb_via_clearance_error"),pcb_via_ids:F.array(F.string()).min(2),minimum_clearance:eo.optional(),actual_clearance:eo.optional(),pcb_center:F.object({x:F.number().optional(),y:F.number().optional()}).optional(),subcircuit_id:F.string().optional()}).describe("Error emitted when vias are closer than the allowed clearance"),Tti=Yh.extend({type:F.literal("pcb_via_trace_clearance_error"),pcb_via_trace_clearance_error_id:Co("pcb_via_trace_clearance_error"),error_type:F.literal("pcb_via_trace_clearance_error").default("pcb_via_trace_clearance_error"),pcb_via_id:F.string(),pcb_trace_id:F.string(),minimum_clearance:eo.optional(),actual_clearance:eo.optional(),center:F.object({x:F.number().optional(),y:F.number().optional()}).optional(),subcircuit_id:F.string().optional()}).describe("Error emitted when a via and trace are closer than the allowed clearance"),Dti=Yh.extend({type:F.literal("pcb_pad_pad_clearance_error"),pcb_pad_pad_clearance_error_id:Co("pcb_pad_pad_clearance_error"),error_type:F.literal("pcb_pad_pad_clearance_error").default("pcb_pad_pad_clearance_error"),pcb_pad_ids:F.array(F.string()).min(2),minimum_clearance:eo.optional(),actual_clearance:eo.optional(),center:F.object({x:F.number().optional(),y:F.number().optional()}).optional(),subcircuit_id:F.string().optional()}).describe("Error emitted when pads are closer than the allowed clearance"),Nti=Yh.extend({type:F.literal("pcb_pad_trace_clearance_error"),pcb_pad_trace_clearance_error_id:Co("pcb_pad_trace_clearance_error"),error_type:F.literal("pcb_pad_trace_clearance_error").default("pcb_pad_trace_clearance_error"),pcb_pad_id:F.string(),pcb_trace_id:F.string(),minimum_clearance:eo.optional(),actual_clearance:eo.optional(),center:F.object({x:F.number().optional(),y:F.number().optional()}).optional(),subcircuit_id:F.string().optional()}).describe("Error emitted when a pad and trace are closer than allowed clearance"),Rti=F.object({type:F.literal("pcb_courtyard_rect"),pcb_courtyard_rect_id:Co("pcb_courtyard_rect"),pcb_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),center:ni,width:gr,height:gr,layer:N1,ccw_rotation:Y_.optional(),color:F.string().optional()}).describe("Defines a courtyard rectangle on the PCB"),Qti=F.object({type:F.literal("pcb_courtyard_outline"),pcb_courtyard_outline_id:Co("pcb_courtyard_outline"),pcb_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),layer:N1,outline:F.array(ni).min(2)}).describe("Defines a courtyard outline on the PCB"),kti=F.object({type:F.literal("pcb_courtyard_polygon"),pcb_courtyard_polygon_id:Co("pcb_courtyard_polygon"),pcb_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),layer:N1,points:F.array(ni).min(3),color:F.string().optional()}).describe("Defines a courtyard polygon on the PCB"),Lti=F.object({type:F.literal("pcb_courtyard_circle"),pcb_courtyard_circle_id:Co("pcb_courtyard_circle"),pcb_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),center:ni,radius:gr,layer:N1,color:F.string().optional()}).describe("Defines a courtyard circle on the PCB"),Hti=F.object({type:F.literal("cad_component"),cad_component_id:F.string(),pcb_component_id:F.string(),source_component_id:F.string(),position:eG,rotation:eG.optional(),size:eG.optional(),layer:Yc.optional(),subcircuit_id:F.string().optional(),footprinter_string:F.string().optional(),model_obj_url:F.string().optional(),model_stl_url:F.string().optional(),model_3mf_url:F.string().optional(),model_gltf_url:F.string().optional(),model_glb_url:F.string().optional(),model_step_url:F.string().optional(),model_wrl_url:F.string().optional(),model_asset:DJr.optional(),model_unit_to_mm_scale_factor:F.number().optional(),model_board_normal_direction:F.enum(["x+","x-","y+","y-","z+","z-"]).optional().describe(`The direction in the model's coordinate space that is considered "up" or "coming out of the board surface"`),model_origin_position:eG.optional(),model_origin_alignment:F.enum(["unknown","center","center_of_component_on_board_surface","bottom_center_of_component"]).optional(),model_object_fit:F.enum(["contain_within_bounds","fill_bounds"]).optional().default("contain_within_bounds"),model_jscad:F.any().optional(),show_as_translucent_model:F.boolean().optional(),anchor_alignment:F.enum(["center","center_of_component_on_board_surface"]).optional().default("center")}).describe("Defines a component on the PCB"),M8n=F.enum(["sinewave","square","triangle","sawtooth"]),Fti=F.union([F.string(),F.number()]).transform((e)=>typeof e=="string"?e.endsWith("%")?parseFloat(e.slice(0,-1))/100:parseFloat(e):e).pipe(F.number().min(0,"Duty cycle must be non-negative").max(1,"Duty cycle cannot be greater than 100%")),zti=F.object({type:F.literal("simulation_voltage_source"),simulation_voltage_source_id:Co("simulation_voltage_source"),is_dc_source:F.literal(!0).optional().default(!0),positive_source_port_id:F.string().optional(),negative_source_port_id:F.string().optional(),positive_source_net_id:F.string().optional(),negative_source_net_id:F.string().optional(),voltage:gL}).describe("Defines a DC voltage source for simulation"),Oti=F.object({type:F.literal("simulation_voltage_source"),simulation_voltage_source_id:Co("simulation_voltage_source"),is_dc_source:F.literal(!1),terminal1_source_port_id:F.string().optional(),terminal2_source_port_id:F.string().optional(),terminal1_source_net_id:F.string().optional(),terminal2_source_net_id:F.string().optional(),voltage:gL.optional(),frequency:KZ.optional(),peak_to_peak_voltage:gL.optional(),wave_shape:M8n.optional(),phase:Y_.optional(),duty_cycle:Fti.optional()}).describe("Defines an AC voltage source for simulation"),Vti=F.union([zti,Oti]).describe("Defines a voltage source for simulation"),Yti=F.union([F.string(),F.number()]).transform((e)=>typeof e=="string"?e.endsWith("%")?parseFloat(e.slice(0,-1))/100:parseFloat(e):e).pipe(F.number().min(0,"Duty cycle must be non-negative").max(1,"Duty cycle cannot be greater than 100%")),Gti=F.object({type:F.literal("simulation_current_source"),simulation_current_source_id:Co("simulation_current_source"),is_dc_source:F.literal(!0).optional().default(!0),positive_source_port_id:F.string().optional(),negative_source_port_id:F.string().optional(),positive_source_net_id:F.string().optional(),negative_source_net_id:F.string().optional(),current:Bue}).describe("Defines a DC current source for simulation"),Uti=F.object({type:F.literal("simulation_current_source"),simulation_current_source_id:Co("simulation_current_source"),is_dc_source:F.literal(!1),terminal1_source_port_id:F.string().optional(),terminal2_source_port_id:F.string().optional(),terminal1_source_net_id:F.string().optional(),terminal2_source_net_id:F.string().optional(),current:Bue.optional(),frequency:KZ.optional(),peak_to_peak_current:Bue.optional(),wave_shape:M8n.optional(),phase:Y_.optional(),duty_cycle:Yti.optional()}).describe("Defines an AC current source for simulation"),Wti=F.union([Gti,Uti]).describe("Defines a current source for simulation"),Xti=F.union([F.literal("spice_dc_sweep"),F.literal("spice_dc_operating_point"),F.literal("spice_transient_analysis"),F.literal("spice_ac_analysis")]),jti=F.object({type:F.literal("simulation_experiment"),simulation_experiment_id:Co("simulation_experiment"),name:F.string(),experiment_type:Xti,time_per_step:ict.optional(),start_time_ms:BZ.optional(),end_time_ms:BZ.optional()}).describe("Defines a simulation experiment configuration"),Kti=F.object({type:F.literal("simulation_transient_voltage_graph"),simulation_transient_voltage_graph_id:Co("simulation_transient_voltage_graph"),simulation_experiment_id:F.string(),timestamps_ms:F.array(F.number()).optional(),voltage_levels:F.array(F.number()),source_component_id:F.string().optional(),subcircuit_connectivity_map_key:F.string().optional(),time_per_step:ict,start_time_ms:BZ,end_time_ms:BZ,name:F.string().optional(),color:F.string().optional()}).describe("Stores voltage measurements over time for a simulation"),$ti=F.object({type:F.literal("simulation_switch"),simulation_switch_id:Co("simulation_switch"),source_component_id:F.string().optional(),closes_at:BZ.optional(),opens_at:BZ.optional(),starts_closed:F.boolean().optional(),switching_frequency:KZ.optional()}).describe("Defines a switch for simulation timing control"),qti=F.object({type:F.literal("simulation_voltage_probe"),simulation_voltage_probe_id:Co("simulation_voltage_probe"),source_component_id:F.string().optional(),name:F.string().optional(),signal_input_source_port_id:F.string().optional(),signal_input_source_net_id:F.string().optional(),reference_input_source_port_id:F.string().optional(),reference_input_source_net_id:F.string().optional(),subcircuit_id:F.string().optional(),color:F.string().optional()}).describe("Defines a voltage probe for simulation. If a reference input is not provided, it measures against ground. If a reference input is provided, it measures the differential voltage between two points.").superRefine((e,t)=>{if(e.reference_input_source_port_id||e.reference_input_source_net_id){let n=!!e.signal_input_source_port_id||!!e.reference_input_source_port_id,o=!!e.signal_input_source_net_id||!!e.reference_input_source_net_id;n&&o?t.addIssue({code:F.ZodIssueCode.custom,message:"Cannot mix port and net connections in a differential probe."}):n?e.signal_input_source_port_id&&e.reference_input_source_port_id||t.addIssue({code:F.ZodIssueCode.custom,message:"Differential port probe requires both signal_input_source_port_id and reference_input_source_port_id."}):o&&(e.signal_input_source_net_id&&e.reference_input_source_net_id||t.addIssue({code:F.ZodIssueCode.custom,message:"Differential net probe requires both signal_input_source_net_id and reference_input_source_net_id."}))}else!!e.signal_input_source_port_id==!!e.signal_input_source_net_id&&t.addIssue({code:F.ZodIssueCode.custom,message:"A voltage probe must have exactly one of signal_input_source_port_id or signal_input_source_net_id."})}),Jti=Yh.extend({type:F.literal("simulation_unknown_experiment_error"),simulation_unknown_experiment_error_id:Co("simulation_unknown_experiment_error"),error_type:F.literal("simulation_unknown_experiment_error").default("simulation_unknown_experiment_error"),simulation_experiment_id:F.string().optional(),subcircuit_id:F.string().optional()}).describe("An unknown error occurred during the simulation experiment."),Zti=F.object({type:F.literal("simulation_op_amp"),simulation_op_amp_id:Co("simulation_op_amp"),source_component_id:F.string().optional(),inverting_input_source_port_id:F.string(),non_inverting_input_source_port_id:F.string(),output_source_port_id:F.string(),positive_supply_source_port_id:F.string(),negative_supply_source_port_id:F.string()}).describe("Defines a simple ideal operational amplifier for simulation"),w8n=(F.union([sZr,rZr,iZr,oZr,cZr,aZr,o8n,e8n,act,n8n,t8n,r8n,i8n,s8n,l8n,h8n,d8n,g8n,u8n,p8n,m8n,_8n,c8n,a8n,dZr,pZr,lZr,A8n,f8n,y8n,x8n,C8n,mZr,_Zr,gZr,AZr,fZr,b8n,hZr,eei,tei,dti,uti,pti,gti,Ati,fti,cei,iti,lei,Nei,Iei,Eei,Mei,Rei,gei,bei,Qei,kei,mti,Fei,zei,Oei,Vei,Xei,Yei,Gei,Uei,Wei,wei,Bei,Lei,Hei,Tei,Dei,Bti,Tti,Dti,Nti,Kei,jei,$ei,qei,Jei,Zei,eti,tti,nti,_ti,oti,rti,yti,hti,xti,Cti,bti,Pti,Eti,Mti,wti,Rti,Qti,kti,Lti,yZr,RZr,MZr,wZr,BZr,TZr,SZr,EZr,QZr,DZr,xZr,LZr,HZr,kZr,VZr,YZr,GZr,UZr,jZr,WZr,XZr,Hti,Vti,Wti,jti,Kti,$ti,qti,Jti,Zti]),!0),Xde={CCW:-1,CW:1,NOT_ORIENTABLE:0},eni=2*Math.PI,a8e=Object.freeze({__proto__:null,BOUNDARY:2,CCW:w8n,CONTAINS:3,CW:!1,END_VERTEX:2,INSIDE:1,INTERLACE:4,NOT_VERTEX:0,ORIENTATION:Xde,OUTSIDE:0,OVERLAP_OPPOSITE:2,OVERLAP_SAME:1,PIx2:eni,START_VERTEX:1}),VP=0.000001;function B8n(e){VP=e}function T8n(){return VP}function Nit(e){return e<VP&&e>-VP}function yG(e,t){return e-t<VP&&e-t>-VP}function D8n(e,t){return e-t>VP}function N8n(e,t){return e-t<-VP}var Ye={Utils:Object.freeze({__proto__:null,DECIMALS:3,EQ:yG,EQ_0:Nit,GE:function(e,t){return e-t>-VP},GT:D8n,LE:function(e,t){return e-t<VP},LT:N8n,getTolerance:T8n,setTolerance:B8n}),Errors:void 0,Matrix:void 0,Planar_set:void 0,Point:void 0,Vector:void 0,Line:void 0,Circle:void 0,Segment:void 0,Arc:void 0,Box:void 0,Edge:void 0,Face:void 0,Ray:void 0,Ray_shooting:void 0,Multiline:void 0,Polygon:void 0,Distance:void 0,Inversion:void 0};for(let e in a8e)Ye[e]=a8e[e];Object.defineProperty(Ye,"DP_TOL",{get:function(){return T8n()},set:function(e){B8n(e)}});var M0=class{static get ILLEGAL_PARAMETERS(){return ReferenceError("Illegal Parameters")}static get ZERO_DIVISION(){return Error("Zero division")}static get UNRESOLVED_BOUNDARY_CONFLICT(){return Error("Unresolved boundary conflict in boolean operation")}static get INFINITE_LOOP(){return Error("Infinite loop")}static get CANNOT_COMPLETE_BOOLEAN_OPERATION(){return Error("Cannot complete boolean operation")}static get CANNOT_INVOKE_ABSTRACT_METHOD(){return Error("Abstract method cannot be invoked")}static get OPERATION_IS_NOT_SUPPORTED(){return Error("Operation is not supported")}static get UNSUPPORTED_SHAPE_TYPE(){return Error("Unsupported shape type")}};Ye.Errors=M0;var hct=class{constructor(e,t){this.first=e,this.last=t||this.first}[Symbol.iterator](){let e;return{next:()=>(e=e?e.next:this.first,{value:e,done:e===void 0})}}get size(){let e=0;for(let t of this)e++;return e}toArray(e=void 0,t=void 0){let n=[],o=e||this.first,r=t||this.last,i=o;if(i===void 0)return n;do n.push(i),i=i.next;while(i!==r.next);return n}append(e){return this.isEmpty()?this.first=e:(e.prev=this.last,this.last.next=e),this.last=e,this.last.next=void 0,this.first.prev=void 0,this}insert(e,t){if(this.isEmpty())this.first=e,this.last=e;else if(t==null)e.next=this.first,this.first.prev=e,this.first=e;else{let n=t.next;t.next=e,n&&(n.prev=e),e.prev=t,e.next=n,this.last===t&&(this.last=e)}return this.last.next=void 0,this.first.prev=void 0,this}remove(e){return e===this.first&&e===this.last?(this.first=void 0,this.last=void 0):(e.prev&&(e.prev.next=e.next),e.next&&(e.next.prev=e.prev),e===this.first&&(this.first=e.next),e===this.last&&(this.last=e.prev)),this}isEmpty(){return this.first===void 0}static testInfiniteLoop(e){let t=e,n=e;do{if(t!=e&&t===n)throw M0.INFINITE_LOOP;t=t.next,n=n.next.next}while(t!=e)}},A1n={stroke:"black"},tni=class{constructor(e=A1n){for(let t in e)this[t]=e[t];this.stroke=e.stroke??A1n.stroke}toAttributesString(){return Object.keys(this).reduce((e,t)=>e+(this[t]!==void 0?this.toAttrString(t,this[t]):""),"")}toAttrString(e,t){let n=e==="className"?"class":this.convertCamelToKebabCase(e);return t===null?`${n} `:`${n}="${t.toString()}" `}convertCamelToKebabCase(e){return e.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g).join("-").toLowerCase()}};function QG(e){return new tni(e).toAttributesString()}function $Z(e,t){let n=[],[o,r,i]=e.standard,[s,a,c]=t.standard,l=o*a-r*s,h=i*a-r*c,d=o*c-i*s;if(!Ye.Utils.EQ_0(l)){let u,_;r===0?(u=i/o,_=d/l):a===0?(u=c/s,_=d/l):o===0?(u=h/l,_=i/r):s===0?(u=h/l,_=c/a):(u=h/l,_=d/l),n.push(new Ye.Point(u,_))}return n}function kG(e,t){let n=[],o=t.pc.projectionOn(e),r=t.pc.distanceTo(o)[0];if(Ye.Utils.EQ(r,t.r))n.push(o);else if(Ye.Utils.LT(r,t.r)){let i,s,a=Math.sqrt(t.r*t.r-r*r);i=e.norm.rotate90CCW().multiply(a),s=o.translate(i),n.push(s),i=e.norm.rotate90CW().multiply(a),s=o.translate(i),n.push(s)}return n}function TZ(e,t){let n=[];for(let o of t.toSegments()){let r=c0e(o,e);for(let i of r)O8n(i,n)||n.push(i)}return n}function c7e(e,t){let n=[];if(TZ(e,t.box).length===0)return n;let o=kG(e,new Ye.Circle(t.pc,t.r));for(let r of o)r.on(t)&&n.push(r);return n}function c0e(e,t){let n=[];return e.ps.on(t)&&n.push(e.ps),e.pe.on(t)&&!e.isZeroLength()&&n.push(e.pe),n.length>0||e.isZeroLength()||e.ps.leftTo(t)&&e.pe.leftTo(t)||!e.ps.leftTo(t)&&!e.pe.leftTo(t)?n:$Z(new Ye.Line(e.ps,e.pe),t)}function c8e(e,t){let n=[];if(e.isZeroLength())return e.ps.on(t)&&n.push(e.ps),n;if(t.isZeroLength())return t.ps.on(e)&&n.push(t.ps),n;let o=new Ye.Line(e.ps,e.pe),r=new Ye.Line(t.ps,t.pe);if(o.incidentTo(r))e.ps.on(t)&&n.push(e.ps),e.pe.on(t)&&n.push(e.pe),!t.ps.on(e)||t.ps.equalTo(e.ps)||t.ps.equalTo(e.pe)||n.push(t.ps),!t.pe.on(e)||t.pe.equalTo(e.ps)||t.pe.equalTo(e.pe)||n.push(t.pe);else if(o.parallelTo(r)){let i=new Ye.Vector(e.ps,e.pe),s=new Ye.Vector(t.ps,t.pe),a=new Ye.Vector(e.ps,t.ps),c=i.cross(s);if(!Ye.Utils.EQ_0(c)){let l=a.cross(s)/c,h=a.cross(i)/c;Ye.Utils.GE(l,0)&&Ye.Utils.LE(l,1)&&Ye.Utils.GE(h,0)&&Ye.Utils.LE(h,1)&&n.push(f1n(e.ps.translate(i.multiply(l)),e,t))}}else{let i=$Z(o,r);i.length>0&&y1n(i[0],e)&&y1n(i[0],t)&&n.push(f1n(i[0],e,t))}return n}function f1n(e,t,n){for(let o of[t.ps,t.pe,n.ps,n.pe])if(e.equalTo(o))return o;return e}function y1n(e,t){let n=t.box;return Ye.Utils.LE(e.x,n.xmax)&&Ye.Utils.GE(e.x,n.xmin)&&Ye.Utils.LE(e.y,n.ymax)&&Ye.Utils.GE(e.y,n.ymin)}function l8e(e,t){let n=[];if(e.isZeroLength()){let[r,i]=e.ps.distanceTo(t.pc);return Ye.Utils.EQ(r,t.r)&&n.push(e.ps),n}let o=kG(new Ye.Line(e.ps,e.pe),t);for(let r of o)r.on(e)&&n.push(r);return n}function DZ(e,t){let n=[];if(e.isZeroLength())return e.ps.on(t)&&n.push(e.ps),n;let o=kG(new Ye.Line(e.ps,e.pe),new Ye.Circle(t.pc,t.r));for(let r of o)r.on(e)&&r.on(t)&&n.push(r);return n}function R8n(e,t){let n=[],o=new Ye.Vector(e.pc,t.pc),r=e.r,i=t.r;if(Ye.Utils.EQ_0(r)||Ye.Utils.EQ_0(i))return n;if(Ye.Utils.EQ_0(o.x)&&Ye.Utils.EQ_0(o.y)&&Ye.Utils.EQ(r,i))return n.push(e.pc.translate(-r,0)),n;let s,a=e.pc.distanceTo(t.pc)[0];if(Ye.Utils.GT(a,r+i))return n;if(Ye.Utils.LT(a,Math.abs(r-i)))return n;if(o.x/=a,o.y/=a,Ye.Utils.EQ(a,r+i)||Ye.Utils.EQ(a,Math.abs(r-i)))return s=e.pc.translate(r*o.x,r*o.y),n.push(s),n;let c=r*r/(2*a)-i*i/(2*a)+a/2,l=e.pc.translate(c*o.x,c*o.y),h=Math.sqrt(r*r-c*c);return s=l.translate(o.rotate90CCW().multiply(h)),n.push(s),s=l.translate(o.rotate90CW().multiply(h)),n.push(s),n}function Q8n(e,t){let n=[];if(e.pc.equalTo(t.pc)&&Ye.Utils.EQ(e.r,t.r)){let s;return s=e.start,s.on(t)&&n.push(s),s=e.end,s.on(t)&&n.push(s),s=t.start,s.on(e)&&n.push(s),s=t.end,s.on(e)&&n.push(s),n}let o=new Ye.Circle(e.pc,e.r),r=new Ye.Circle(t.pc,t.r),i=o.intersect(r);for(let s of i)s.on(e)&&s.on(t)&&n.push(s);return n}function dct(e,t){let n=[];if(t.pc.equalTo(e.pc)&&Ye.Utils.EQ(t.r,e.r))return n.push(e.start),n.push(e.end),n;let o=R8n(t,new Ye.Circle(e.pc,e.r));for(let r of o)r.on(e)&&n.push(r);return n}function k8n(e,t){return e.isSegment?c8e(e.shape,t):DZ(t,e.shape)}function L8n(e,t){return e.isSegment?DZ(e.shape,t):Q8n(e.shape,t)}function H8n(e,t){return e.isSegment?c0e(e.shape,t):c7e(t,e.shape)}function nni(e,t){return e.isSegment?l8e(e.shape,t):dct(e.shape,t)}function uct(e,t){let n=[];for(let o of t.edges)for(let r of k8n(o,e))n.push(r);return n}function pct(e,t){let n=[];for(let o of t.edges)for(let r of L8n(o,e))n.push(r);return n}function l0e(e,t){let n=[];if(t.isEmpty())return n;for(let o of t.edges)for(let r of H8n(o,e))O8n(r,n)||n.push(r);return e.sortPoints(n)}function F8n(e,t){let n=[];if(t.isEmpty())return n;for(let o of t.edges)for(let r of nni(o,e))n.push(r);return n}function z8n(e,t){return e.isSegment?k8n(t,e.shape):e.isArc?L8n(t,e.shape):e.isLine?H8n(t,e.shape):e.isRay?(n=t,o=e.shape,n.isSegment?mct(o,n.shape):_ct(o,n.shape)):[];var n,o}function x1n(e,t){let n=[];if(t.isEmpty()||e.shape.box.not_intersect(t.box))return n;let o=t.edges.search(e.shape.box);for(let r of o)n=[...n,...z8n(e,r)];return n}function O8n(e,t){return t.some((n)=>n.equalTo(e))}function cL(e){return new Ye.Line(e.start,e.norm)}function mct(e,t){return c0e(t,cL(e)).filter((n)=>e.contains(n))}function _ct(e,t){return c7e(cL(e),t).filter((n)=>e.contains(n))}function V8n(e,t){return kG(cL(e),t).filter((n)=>e.contains(n))}function Y8n(e,t){return $Z(cL(e),t).filter((n)=>e.contains(n))}function G8n(e,t){return l0e(cL(e),t).filter((n)=>e.contains(n))}function U8n(e,t){if(e.intersect&&e.intersect instanceof Function)return e.intersect(t);throw M0.UNSUPPORTED_SHAPE_TYPE}function qZ(e,t){let n=[];for(let o of t)n=[...n,...U8n(e,o.shape)];return n}var hG=class e extends hct{constructor(...t){if(super(),this.isInfinite=!1,t.length===1&&t[0]instanceof Array&&t[0].length>0){let n=t[0],o=n.length,r=(s)=>s instanceof Ye.Segment||s instanceof Ye.Arc||s instanceof Ye.Ray,i=(s)=>s instanceof Ye.Segment||s instanceof Ye.Arc;if(!(o===1&&((s)=>s instanceof Ye.Segment||s instanceof Ye.Arc||s instanceof Ye.Ray||s instanceof Ye.Line)(n[0])||o>1&&r(n[0])&&r(n[o-1])&&n.slice(1,o-1).every(i)))throw Ye.Errors.ILLEGAL_PARAMETERS;this.isInfinite=n.some((s)=>s instanceof Ye.Ray||s instanceof Ye.Line);for(let s of n){let a=new Ye.Edge(s);this.append(a)}this.setArcLength()}}get edges(){return[...this]}get box(){return this.edges.reduce((t,n)=>t.merge(n.box),new Ye.Box)}get vertices(){let t=this.edges.map((n)=>n.start);return t.push(this.last.end),t}get length(){if(this.isEmpty())return 0;if(this.isInfinite)return Number.POSITIVE_INFINITY;let t=0;for(let n of this)t+=n.length;return t}clone(){return new e(this.toShapes())}setArcLength(){for(let t of this)this.setOneEdgeArcLength(t)}setOneEdgeArcLength(t){t===this.first?t.arc_length=0:t.arc_length=t.prev.arc_length+t.prev.length}pointAtLength(t){if(t>this.length||t<0)return null;if(this.isInfinite)return null;let n=null;for(let o of this)if(t>=o.arc_length&&(o===this.last||t<o.next.arc_length)){n=o.pointAtLength(t-o.arc_length);break}return n}addVertex(t,n){let o=n.shape.split(t);if(o[0]===null)return n.prev;if(o[1]===null)return n;let r=new Ye.Edge(o[0]),i=n.prev;return this.insert(r,i),n.shape=o[1],r}getChain(t,n){let o=[];for(let r=t;r!==n.next;r=r.next)o.push(r);return o}split(t){for(let n of t){let o=this.findEdgeByPoint(n);this.addVertex(n,o)}return this}findEdgeByPoint(t){let n;for(let o of this)if(o.shape.contains(t)){n=o;break}return n}distanceTo(t){if(t instanceof Point){let[n,o]=Ye.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof Ye.Line){let[n,o]=Ye.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof Ye.Circle){let[n,o]=Ye.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof Ye.Segment){let[n,o]=Ye.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof Ye.Arc){let[n,o]=Ye.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof Ye.Multiline)return Ye.Distance.multiline2multiline(this,t);throw Ye.Errors.UNSUPPORTED_SHAPE_TYPE}intersect(t){return t instanceof Ye.Multiline?function(n,o){let r=[];for(let i of n)for(let s of o)r=[...r,...U8n(i.shape,s.shape)];return r}(this,t):qZ(t,this)}contains(t){if(t instanceof Ye.Point)return this.edges.some((n)=>n.shape.contains(t));throw Ye.Errors.UNSUPPORTED_SHAPE_TYPE}translate(t){return new e(this.edges.map((n)=>n.shape.translate(t)))}rotate(t=0,n=new Ye.Point){return new e(this.edges.map((o)=>o.shape.rotate(t,n)))}transform(t=new Ye.Matrix){return new e(this.edges.map((n)=>n.shape.transform(t)))}toShapes(){return this.edges.map((t)=>t.shape.clone())}toJSON(){return this.edges.map((t)=>t.toJSON())}svgPoints(){return this.vertices.map((t)=>`${t.x},${t.y}`).join(" ")}dpath(){let t=`M${this.first.start.x},${this.first.start.y}`;for(let n of this)t+=n.svg();return t}svg(t={}){let n=`
<path ${QG({fill:"none",...t})} d="`;n+=`
M${this.first.start.x},${this.first.start.y}`;for(let o of this)n+=o.svg();return n+=`" >
</path>`,n}};Ye.Multiline=hG;function NZ(e,t,n){let o=n.length,r=e.shape.split(t);if(r.length===0)return;let i=0;i=r[0]===null?0:r[1]===null?e.shape.length:r[0].length;let s,a=0;yG(i,0)&&(a|=1),yG(i,e.shape.length)&&(a|=2),s=i===1/0?r[0].coord(t):2&a&&e.next&&e.next.arc_length===0?0:e.arc_length+i,n.push({id:o,pt:t,arc_length:s,edge_before:e,edge_after:void 0,face:e.face,is_vertex:a})}function Tue(e){e.int_points1_sorted=Uk(e.int_points1),e.int_points2_sorted=Uk(e.int_points2)}function Uk(e){let t=new Map,n=0;for(let o of e)t.has(o.face)||(t.set(o.face,n),n++);for(let o of e)o.faceId=t.get(o.face);return e.slice().sort(oni)}function oni(e,t){return e.faceId<t.faceId?-1:e.faceId>t.faceId?1:e.arc_length<t.arc_length?-1:e.arc_length>t.arc_length?1:0}function gct(e){if(e.int_points1.length<2)return;let t,n,o,r,i=!1;for(let s=0;s<e.int_points1_sorted.length;s++)if(e.int_points1_sorted[s].id!==-1){t=e.int_points1_sorted[s],n=e.int_points2[t.id];for(let a=s+1;a<e.int_points1_sorted.length&&(o=e.int_points1_sorted[a],yG(o.arc_length,t.arc_length));a++)o.id!==-1&&(r=e.int_points2[o.id],r.id!==-1&&o.edge_before===t.edge_before&&o.edge_after===t.edge_after&&r.edge_before===n.edge_before&&r.edge_after===n.edge_after&&(o.id=-1,r.id=-1,i=!0))}n=e.int_points2_sorted[0],t=e.int_points1[n.id];for(let s=1;s<e.int_points2_sorted.length;s++){let a=e.int_points2_sorted[s];if(a.id===-1)continue;if(n.id===-1||!yG(a.arc_length,n.arc_length)){n=a,t=e.int_points1[n.id];continue}let c=e.int_points1[a.id];c.edge_before===t.edge_before&&c.edge_after===t.edge_after&&a.edge_before===n.edge_before&&a.edge_after===n.edge_after&&(c.id=-1,a.id=-1,i=!0)}i&&(e.int_points1=e.int_points1.filter((s)=>s.id>=0),e.int_points2=e.int_points2.filter((s)=>s.id>=0),e.int_points1.forEach((s,a)=>s.id=a),e.int_points2.forEach((s,a)=>s.id=a))}function Rit(e){for(let t of e)t.edge_before&&(t.edge_before.bvStart=void 0,t.edge_before.bvEnd=void 0,t.edge_before.bv=void 0,t.edge_before.overlap=void 0),t.edge_after&&(t.edge_after.bvStart=void 0,t.edge_after.bvEnd=void 0,t.edge_after.bv=void 0,t.edge_after.overlap=void 0);for(let t of e)t.edge_before&&(t.edge_before.bvEnd=2),t.edge_after&&(t.edge_after.bvStart=2)}function Qit(e,t){for(let n of e)n.edge_before&&n.edge_before.setInclusion(t),n.edge_after&&n.edge_after.setInclusion(t)}function RZ(e,t,n){let o,r,i=1;if(e.length===1)return 1;o=e[t];for(let s=t+1;s<e.length&&o.face===n&&(r=e[s],r.pt.equalTo(o.pt)&&r.edge_before===o.edge_before&&r.edge_after===o.edge_after);s++)i++;return i}function QZ(e,t){if(t){for(let n of t){let o=n.edge_before;if(n.is_vertex=0,o.shape.start&&o.shape.start.equalTo(n.pt)&&(n.is_vertex|=1),o.shape.end&&o.shape.end.equalTo(n.pt)&&(n.is_vertex|=2),1&n.is_vertex){n.edge_before=o.prev,o.prev&&(n.is_vertex=2);continue}if(2&n.is_vertex)continue;let r=e.addVertex(n.pt,o);n.edge_before=r}for(let n of t)n.edge_before?n.edge_after=n.edge_before.next:e instanceof hG&&1&n.is_vertex&&(n.edge_after=e.first)}}function C1n(e,t,n){let o=e.edge_before,r=t.edge_after,i=n.length;o.next=n[0],n[0].prev=o,n[i-1].next=r,r.prev=n[i-1]}Ye.multiline=(...e)=>new Ye.Multiline(...e);var{INSIDE:SP,OUTSIDE:PP,BOUNDARY:rf,OVERLAP_SAME:rni,OVERLAP_OPPOSITE:ini}=a8e,{NOT_VERTEX:zra,START_VERTEX:b1n,END_VERTEX:I1n}=a8e;function kit(e,t){let n=t.clone().reverse(),[o,r]=h0e(e,n,3,!0);return o}function W8n(e,t){let[n,o]=h0e(e,t,2,!0);return n}function X8n(e,t){let[n,o]=h0e(e,t,2,!1),r=[];for(let s of n.faces)r=[...r,...[...s.edges].map((a)=>a.shape)];let i=[];for(let s of o.faces)i=[...i,...[...s.edges].map((a)=>a.shape)];return[r,i]}function Lit(e,t){let[n,o]=h0e(e,t,3,!1),r=[];for(let i of n.faces)r=[...r,...[...i.edges].map((s)=>s.shape)];return r}function j8n(e,t){let n=e.clone(),o=t.clone(),r=K8n(n,o);return Tue(r),QZ(n,r.int_points1_sorted),QZ(o,r.int_points2_sorted),gct(r),Tue(r),[r.int_points1_sorted.map((i)=>i.pt),r.int_points2_sorted.map((i)=>i.pt)]}function sni(e,t,n,o){let r=v1n(e,n.int_points1),i=v1n(t,n.int_points2);for(S1n(r,t),S1n(i,e),Rit(n.int_points1),Rit(n.int_points2),Qit(n.int_points1,t),Qit(n.int_points2,e);ani(e,t,n.int_points1,n.int_points1_sorted,n.int_points2,n););(function(s){let a,c,l,h=s.int_points1.length;for(let d=0;d<h;d++){let u=s.int_points1_sorted[d];u.face!==a&&(c=d,a=u.face);let _,p=d,m=RZ(s.int_points1_sorted,d,a);_=p+m<h&&s.int_points1_sorted[p+m].face===a?p+m:c;let A=RZ(s.int_points1_sorted,_,a);l=null;for(let I=_;I<_+A;I++){let v=s.int_points1_sorted[I];if(v.face===a&&s.int_points2[v.id].face===s.int_points2[u.id].face){l=v;break}}if(l===null)continue;let g=u.edge_after,f=l.edge_before;if(g.bv!==2||f.bv!==2)continue;if(g!==f)continue;let y=s.int_points2[u.id],x=s.int_points2[l.id],C=y.edge_after,b=x.edge_before;C.bv===2&&b.bv===2&&C===b||(y=s.int_points2[l.id],x=s.int_points2[u.id],C=y.edge_after,b=x.edge_before),C.bv===2&&b.bv===2&&C===b&&g.setOverlap(C)}})(n),Hit(e,o,n.int_points1_sorted,!0),Hit(t,o,n.int_points2_sorted,!1),P1n(e,r,o,!0),P1n(t,i,o,!1)}function h0e(e,t,n,o){let r=e.clone(),i=t.clone(),s=K8n(r,i);return Tue(s),QZ(r,s.int_points1_sorted),QZ(i,s.int_points2_sorted),gct(s),Tue(s),sni(r,i,s,n),o&&function(a,c,l){(function(h,d,u,_){for(let p of d.faces){for(let m of p)h.edges.add(m);_.find((m)=>m.face===p)===void 0&&h.addFace(p.first,p.last)}})(a,c,0,l.int_points2),function(h,d,u){if(u.int_points1.length!==0)for(let _=0;_<u.int_points1.length;_++){let p=u.int_points1[_],m=u.int_points2[_];if(p.edge_before!==void 0&&p.edge_after===void 0&&m.edge_before===void 0&&m.edge_after!==void 0&&(p.edge_before.next=m.edge_after,m.edge_after.prev=p.edge_before,p.edge_after=m.edge_after,m.edge_before=p.edge_before),m.edge_before!==void 0&&m.edge_after===void 0&&p.edge_before===void 0&&p.edge_after!==void 0&&(m.edge_before.next=p.edge_after,p.edge_after.prev=m.edge_before,m.edge_after=p.edge_after,p.edge_before=m.edge_before),p.edge_before!==void 0&&p.edge_after===void 0)for(let A of u.int_points1_sorted)A!==p&&A.edge_before===void 0&&A.edge_after!==void 0&&A.pt.equalTo(p.pt)&&(p.edge_before.next=A.edge_after,A.edge_after.prev=p.edge_before,p.edge_after=A.edge_after,A.edge_before=p.edge_before);if(m.edge_before!==void 0&&m.edge_after===void 0)for(let A of u.int_points2_sorted)A!==m&&A.edge_before===void 0&&A.edge_after!==void 0&&A.pt.equalTo(m.pt)&&(m.edge_before.next=A.edge_after,A.edge_after.prev=m.edge_before,m.edge_after=A.edge_after,A.edge_before=m.edge_before)}}(0,0,l),Fit(a,l.int_points1),Fit(c,l.int_points2),zit(a,l.int_points1,l.int_points2),zit(a,l.int_points2,l.int_points1),E1n(a),E1n(c)}(r,i,s),[r,i]}function K8n(e,t){let n={int_points1:[],int_points2:[]};for(let o of e.edges){let r=t.edges.search(o.box);for(let i of r){let s=o.shape.intersect(i.shape);for(let a of s)NZ(o,a,n.int_points1),NZ(i,a,n.int_points2)}}return n}function v1n(e,t){let n=[];for(let o of e.faces)t.find((r)=>r.face===o)||n.push(o);return n}function S1n(e,t){for(let n of e)n.first.bv=n.first.bvStart=n.first.bvEnd=void 0,n.first.setInclusion(t)}function ani(e,t,n,o,r,i){let s,a,c,l=o.length,h=!1;for(let d=0;d<l;d++){let u=o[d];u.face!==s&&(a=d,s=u.face);let _,p=d,m=RZ(o,d,s);_=p+m<l&&o[p+m].face===s?p+m:a;let A=RZ(o,_,s);c=null;for(let y=_;y<_+A;y++){let x=o[y];if(x.face===s&&r[x.id].face===r[u.id].face){c=x;break}}if(c===null)continue;let g=u.edge_after,f=c.edge_before;if(g.bv!==rf||f.bv==rf)if(g.bv==rf||f.bv!==rf){if(g.bv===rf&&f.bv===rf&&g!=f||g.bv===SP&&f.bv===PP||g.bv===PP&&f.bv===SP){let y=g.next;for(;y!=f;)y.bvStart=void 0,y.bvEnd=void 0,y.bv=void 0,y.setInclusion(t),y=y.next}if(g.bv===rf&&f.bv===rf&&g!=f){let y,x=g.next;for(;x!=f;){if(x.bv!=rf){if(y===void 0)y=x.bv;else if(x.bv!=y)throw M0.UNRESOLVED_BOUNDARY_CONFLICT}x=x.next}y!=null&&(g.bv=y,f.bv=y);continue}if(g.bv===SP&&f.bv===PP||g.bv===PP&&f.bv===SP){let y=g;for(;y!=f;){if(y.bvStart===g.bv&&y.bvEnd===f.bv){let[x,C]=y.shape.distanceTo(t);if(x<10*Ye.DP_TOL){NZ(y,C.ps,n);let b=n[n.length-1];if(b.is_vertex&b1n)b.edge_after=y,b.edge_before=y.prev,y.bvStart=rf,y.bv=void 0,y.setInclusion(t);else if(b.is_vertex&I1n)b.edge_after=y.next,y.bvEnd=rf,y.bv=void 0,y.setInclusion(t);else{let P=t.addVertex(b.pt,y);b.edge_before=P,b.edge_after=P.next,P.setInclusion(t),P.next.bvStart=rf,P.next.bvEnd=void 0,P.next.bv=void 0,P.next.setInclusion(t)}let I=t.findEdgeByPoint(C.pe);NZ(I,C.pe,r);let v=r[r.length-1];if(v.is_vertex&b1n)v.edge_after=I,v.edge_before=I.prev;else if(v.is_vertex&I1n)v.edge_after=I.next;else{let P=r.find((B)=>B.edge_after===I),M=t.addVertex(v.pt,I);v.edge_before=M,v.edge_after=M.next,P&&(P.edge_after=M),M.bvStart=void 0,M.bvEnd=rf,M.bv=void 0,M.setInclusion(e),M.next.bvStart=rf,M.next.bvEnd=void 0,M.next.bv=void 0,M.next.setInclusion(e)}Tue(i),h=!0;break}}y=y.next}if(h)break;throw M0.UNRESOLVED_BOUNDARY_CONFLICT}}else f.bv=g.bv;else g.bv=f.bv}return h}function Hit(e,t,n,o){if(!n)return;let r,i,s,a;for(let c=0;c<n.length;c++){if(s=n[c],s.face!==r&&(i=c,r=s.face),r.isEmpty())continue;let l,h=c,d=RZ(n,c,r);l=h+d<n.length&&n[h+d].face===s.face?h+d:i,a=n[l];let u=l,_=RZ(n,u,r),p=s.edge_after,m=a.edge_before;if(p.bv===SP&&m.bv===SP&&t===1||p.bv===PP&&m.bv===PP&&t===2||(p.bv===PP||m.bv===PP)&&t===3&&!o||(p.bv===SP||m.bv===SP)&&t===3&&o||p.bv===rf&&m.bv===rf&&p.overlap&rni&&o||p.bv===rf&&m.bv===rf&&p.overlap&ini){e.removeChain(r,p,m);for(let A=h;A<h+d;A++)n[A].edge_after=void 0;for(let A=u;A<u+_;A++)n[A].edge_before=void 0}c+=d-1}}function Fit(e,t){for(let n of t)e.faces.delete(n.face),n.face=void 0,n.edge_before&&(n.edge_before.face=void 0),n.edge_after&&(n.edge_after.face=void 0)}function zit(e,t,n){for(let o of t){if(o.edge_before===void 0||o.edge_after===void 0)continue;if(o.face)continue;if(o.edge_after.face||o.edge_before.face)continue;let{edge_after:r,edge_before:i}=o;try{hct.testInfiniteLoop(r)}catch(a){throw M0.CANNOT_COMPLETE_BOOLEAN_OPERATION}let s=e.addFace(r,i);for(let a of t)a.edge_before&&a.edge_after&&a.edge_before.face===s&&a.edge_after.face===s&&(a.face=s);for(let a of n)a.edge_before&&a.edge_after&&a.edge_before.face===s&&a.edge_after.face===s&&(a.face=s)}}function P1n(e,t,n,o){for(let r of t){let i=r.first.bv;(n===1&&i===SP||n===3&&i===SP&&o||n===3&&i===PP&&!o||n===2&&i===PP)&&e.deleteFace(r)}}function E1n(e){let t=[];for(let n of e.edges)n.face&&e.faces.has(n.face)||t.push(n);for(let n of t)e.edges.delete(n)}var cni=Object.freeze({__proto__:null,BOOLEAN_INTERSECT:2,BOOLEAN_SUBTRACT:3,BOOLEAN_UNION:1,calculateIntersections:j8n,innerClip:X8n,intersect:W8n,outerClip:Lit,removeNotRelevantChains:Hit,removeOldFaces:Fit,restoreFaces:zit,subtract:kit,unify:function(e,t){let[n,o]=h0e(e,t,1,!0);return n}}),lni=RegExp("T.F..FFF.|T.F...F.."),hni=RegExp("T........|.T.......|...T.....|....T...."),dni=RegExp("FT.......|F..T.....|F...T...."),uni=RegExp("T.F..F..."),pni=RegExp("T.F..F...|.TF..F...|..FT.F...|..F.TF..."),rZ=class{constructor(){this.m=[,,,,,,,,,].fill(void 0)}get I2I(){return this.m[0]}set I2I(e){this.m[0]=e}get I2B(){return this.m[1]}set I2B(e){this.m[1]=e}get I2E(){return this.m[2]}set I2E(e){this.m[2]=e}get B2I(){return this.m[3]}set B2I(e){this.m[3]=e}get B2B(){return this.m[4]}set B2B(e){this.m[4]=e}get B2E(){return this.m[5]}set B2E(e){this.m[5]=e}get E2I(){return this.m[6]}set E2I(e){this.m[6]=e}get E2B(){return this.m[7]}set E2B(e){this.m[7]=e}get E2E(){return this.m[8]}set E2E(e){this.m[8]=e}toString(){return this.m.map((e)=>e instanceof Array&&e.length>0?"T":e instanceof Array&&e.length===0?"F":"*").join("")}equal(){return lni.test(this.toString())}intersect(){return hni.test(this.toString())}touch(){return dni.test(this.toString())}inside(){return uni.test(this.toString())}covered(){return pni.test(this.toString())}};function jde(e,t){let n,o=new Ye.Ray(t),r=new Ye.Line(o.pt,o.norm),i=new Ye.Box(o.box.xmin-Ye.DP_TOL,o.box.ymin-Ye.DP_TOL,o.box.xmax+Ye.DP_TOL,o.box.ymax+Ye.DP_TOL);if(e.box.not_intersect(i))return Ye.OUTSIDE;let s=e.edges.search(i);if(s.length===0)return Ye.OUTSIDE;for(let h of s)if(h.shape.contains(t))return Ye.BOUNDARY;let a=[...e.faces],c=[];for(let h of s)for(let d of o.intersect(h.shape)){if(d.equalTo(t))return Ye.BOUNDARY;c.push({pt:d,edge:h,face_index:a.indexOf(h.face)})}c.sort((h,d)=>N8n(h.pt.x,d.pt.x)?-1:D8n(h.pt.x,d.pt.x)?1:h.face_index<d.face_index?-1:h.face_index>d.face_index?1:h.edge.arc_length<d.edge.arc_length?-1:h.edge.arc_length>d.edge.arc_length?1:0);let l=0;for(let h=0;h<c.length;h++){let d=c[h];if(d.pt.equalTo(d.edge.shape.start)){if(h>0&&d.pt.equalTo(c[h-1].pt)&&d.face_index===c[h-1].face_index&&d.edge.prev===c[h-1].edge)continue;let u=d.edge.prev;for(;Nit(u.length);)u=u.prev;let _=u.shape.tangentInEnd(),p=d.pt.translate(_),m=d.edge.shape.tangentInStart(),A=d.pt.translate(m),g=p.leftTo(r),f=A.leftTo(r);(g&&!f||!g&&f)&&l++}else if(d.pt.equalTo(d.edge.shape.end)){if(h>0&&d.pt.equalTo(c[h-1].pt)&&d.face_index===c[h-1].face_index&&d.edge.next===c[h-1].edge)continue;let u=d.edge.next;for(;Nit(u.length);)u=u.next;let _=u.shape.tangentInStart(),p=d.pt.translate(_),m=d.edge.shape.tangentInEnd(),A=d.pt.translate(m),g=p.leftTo(r),f=A.leftTo(r);(g&&!f||!g&&f)&&l++}else if(d.edge.shape instanceof Ye.Segment)l++;else{let u=d.edge.shape.box;yG(d.pt.y,u.ymin)||yG(d.pt.y,u.ymax)||l++}}return n=l%2==1?1:0,n}function M1n(e,t){return uZ(e,t).intersect()}function w1n(e,t){return uZ(e,t).inside()}function $8n(e,t){return uZ(e,t).covered()}function q8n(e,t){return $8n(t,e)}function uZ(e,t){return e instanceof Ye.Line&&t instanceof Ye.Line?function(n,o){let r=new rZ,i=$Z(n,o);return i.length===0?n.contains(o.pt)&&o.contains(n.pt)?(r.I2I=[n],r.I2E=[],r.E2I=[]):(r.I2I=[],r.I2E=[n],r.E2I=[o]):(r.I2I=i,r.I2E=n.split(i),r.E2I=o.split(i)),r}(e,t):e instanceof Ye.Line&&t instanceof Ye.Circle?function(n,o){let r=new rZ,i=kG(n,o);if(i.length===0)r.I2I=[],r.I2B=[],r.I2E=[n],r.E2I=[o];else if(i.length===1)r.I2I=[],r.I2B=i,r.I2E=n.split(i),r.E2I=[o];else{let s=new hG([n]),a=n.sortPoints(i);s.split(a);let c=s.toShapes();r.I2I=[c[1]],r.I2B=a,r.I2E=[c[0],c[2]],r.E2I=new Ye.Polygon([o.toArc()]).cutWithLine(n)}return r}(e,t):e instanceof Ye.Line&&t instanceof Ye.Box?function(n,o){let r=new rZ,i=TZ(n,o);if(i.length===0)r.I2I=[],r.I2B=[],r.I2E=[n],r.E2I=[o];else if(i.length===1)r.I2I=[],r.I2B=i,r.I2E=n.split(i),r.E2I=[o];else{let s=new hG([n]),a=n.sortPoints(i);s.split(a);let c=s.toShapes();o.toSegments().some((l)=>l.contains(i[0])&&l.contains(i[1]))?(r.I2I=[],r.I2B=[c[1]],r.I2E=[c[0],c[2]],r.E2I=[o]):(r.I2I=[c[1]],r.I2B=a,r.I2E=[c[0],c[2]],r.E2I=new Ye.Polygon(o.toSegments()).cutWithLine(n))}return r}(e,t):e instanceof Ye.Line&&t instanceof Ye.Polygon?function(n,o){let r=new rZ,i=l0e(n,o),s=new hG([n]),a=i.length>0?i.slice():n.sortPoints(i);return s.split(a),[...s].forEach((c)=>c.setInclusion(o)),r.I2I=[...s].filter((c)=>c.bv===Ye.INSIDE).map((c)=>c.shape),r.I2B=[...s].slice(1).map((c)=>c.bv===Ye.BOUNDARY?c.shape:c.shape.start),r.I2E=[...s].filter((c)=>c.bv===Ye.OUTSIDE).map((c)=>c.shape),r.E2I=o.cutWithLine(n),r}(e,t):(e instanceof Ye.Segment||e instanceof Ye.Arc)&&t instanceof Ye.Polygon?B1n(e,t):(e instanceof Ye.Segment||e instanceof Ye.Arc)&&(t instanceof Ye.Circle||t instanceof Ye.Box)?B1n(e,new Ye.Polygon(t)):e instanceof Ye.Polygon&&t instanceof Ye.Polygon?y9e(e,t):(e instanceof Ye.Circle||e instanceof Ye.Box)&&(t instanceof Ye.Circle||t instanceof Ye.Box)?y9e(new Ye.Polygon(e),new Ye.Polygon(t)):(e instanceof Ye.Circle||e instanceof Ye.Box)&&t instanceof Ye.Polygon?y9e(new Ye.Polygon(e),t):e instanceof Ye.Polygon&&(t instanceof Ye.Circle||t instanceof Ye.Box)?y9e(e,new Ye.Polygon(t)):void 0}function B1n(e,t){let n=new rZ,o=function(s,a){return s instanceof Ye.Line?l0e(s,a):s instanceof Ye.Segment?uct(s,a):s instanceof Ye.Arc?pct(s,a):[]}(e,t),r=o.length>0?o.slice():e.sortPoints(o),i=new hG([e]);i.split(r),[...i].forEach((s)=>s.setInclusion(t)),n.I2I=[...i].filter((s)=>s.bv===Ye.INSIDE).map((s)=>s.shape),n.I2B=[...i].slice(1).map((s)=>s.bv===Ye.BOUNDARY?s.shape:s.shape.start),n.I2E=[...i].filter((s)=>s.bv===Ye.OUTSIDE).map((s)=>s.shape),n.B2I=[],n.B2B=[],n.B2E=[];for(let s of[e.start,e.end])switch(jde(t,s)){case Ye.INSIDE:n.B2I.push(s);break;case Ye.BOUNDARY:n.B2B.push(s);break;case Ye.OUTSIDE:n.B2E.push(s)}return n}function y9e(e,t){let n=new rZ,[o,r]=j8n(e,t),i=W8n(e,t),s=kit(e,t),a=kit(t,e),[c,l]=X8n(e,t),h=Lit(e,t),d=Lit(t,e);return n.I2I=i.isEmpty()?[]:[i],n.I2B=l,n.I2E=s.isEmpty()?[]:[s],n.B2I=c,n.B2B=o,n.B2E=h,n.E2I=a.isEmpty()?[]:[a],n.E2B=d,n}var mni=Object.freeze({__proto__:null,contain:function(e,t){return w1n(t,e)},cover:q8n,covered:$8n,disjoint:function(e,t){return!M1n(e,t)},equal:function(e,t){return uZ(e,t).equal()},inside:w1n,intersect:M1n,relate:uZ,touch:function(e,t){return uZ(e,t).touch()}}),Kde=class e{constructor(t=1,n=0,o=0,r=1,i=0,s=0){this.a=t,this.b=n,this.c=o,this.d=r,this.tx=i,this.ty=s}fromMatrix3x3(t){let[n,o,r]=t[0],[i,s,a]=t[1];return new e(n,i,o,s,r,a)}toMatrix3x3(){return[[this.a,this.c,this.tx],[this.b,this.d,this.ty],[0,0,1]]}clone(){return new e(this.a,this.b,this.c,this.d,this.tx,this.ty)}transform(t){return[t[0]*this.a+t[1]*this.c+this.tx,t[0]*this.b+t[1]*this.d+this.ty]}multiply(t){return new e(this.a*t.a+this.c*t.b,this.b*t.a+this.d*t.b,this.a*t.c+this.c*t.d,this.b*t.c+this.d*t.d,this.a*t.tx+this.c*t.ty+this.tx,this.b*t.tx+this.d*t.ty+this.ty)}translate(...t){let n,o;if(t.length!=1||isNaN(t[0].x)||isNaN(t[0].y)){if(t.length!==2||typeof t[0]!="number"||typeof t[1]!="number")throw M0.ILLEGAL_PARAMETERS;n=t[0],o=t[1]}else n=t[0].x,o=t[0].y;return this.multiply(new e(1,0,0,1,n,o))}rotate(t,n=0,o=0){let r=Math.cos(t),i=Math.sin(t);return this.translate(n,o).multiply(new e(r,i,-i,r,0,0)).translate(-n,-o)}scale(t,n){return this.multiply(new e(t,0,0,n,0,0))}equalTo(t){return!!Ye.Utils.EQ(this.tx,t.tx)&&(!!Ye.Utils.EQ(this.ty,t.ty)&&(!!Ye.Utils.EQ(this.a,t.a)&&(!!Ye.Utils.EQ(this.b,t.b)&&(!!Ye.Utils.EQ(this.c,t.c)&&!!Ye.Utils.EQ(this.d,t.d)))))}};Ye.Matrix=Kde;Ye.matrix=(...e)=>new Ye.Matrix(...e);var _ni=class{constructor(e,t){this.low=e,this.high=t}get max(){return this.clone()}less_than(e){return this.low<e.low||this.low===e.low&&this.high<e.high}equal_to(e){return this.low===e.low&&this.high===e.high}intersect(e){return!this.not_intersect(e)}not_intersect(e){return this.high<e.low||e.high<this.low}merge(e){let t=this.low===void 0?e.low:this.low<e.low?this.low:e.low,n=this.high===void 0?e.high:this.high>e.high?this.high:e.high,o=this.clone();return o.low=t,o.high=n,o}output(){return[this.low,this.high]}comparable_less_than(e,t){return e<t}},gni=class e extends _ni{clone(){return new e(this.low,this.high)}},Tk=class{constructor(e,t,n=null,o=null,r=null,i=0){if(this.left=n,this.right=o,this.parent=r,this.color=i,this.item={key:void 0,values:[]},t!==void 0&&this.item.values.push(t),e!==void 0)if(Array.isArray(e)){let[s,a]=e;if(!Number.isNaN(s)&&!Number.isNaN(a)){let c=s,l=a;c>l&&([c,l]=[l,c]),this.item.key=new gni(c,l)}}else this.item.key=e;this.max=this.item.key?this.item.key.max:void 0}isNil(){return this.item.key===void 0&&this.item.values.length===0&&this.left===null&&this.right===null&&this.color===0}requireKey(){if(!this.item.key)throw Error("Node key is undefined (nil/sentinel). Operation is not applicable.");return this.item.key}less_than(e){let t=this.requireKey(),n=e.requireKey();return t.less_than(n)}_value_equal(e){let t=this.item.values[0],n=e.item.values[0];return t&&n&&t.equal_to?t.equal_to(n):t===n}equal_to(e){let t=this.requireKey(),n=e.requireKey();return t.equal_to(n)}intersect(e){let t=this.requireKey(),n=e.requireKey();return t.intersect(n)}copy_data(e){this.item.key=e.item.key,this.item.values=e.item.values.slice()}update_max(){this.max=this.item.key?this.item.key.max:void 0,this.right&&this.right.max&&(this.max=this.max?this.max.merge(this.right.max):this.right.max),this.left&&this.left.max&&(this.max=this.max?this.max.merge(this.left.max):this.left.max)}not_intersect_left_subtree(e){if(!this.left)return!0;let t=this.left.max?this.left.max.high:this.left.item.key.high,n=this.requireKey(),o=e.requireKey();return n.comparable_less_than(t,o.low)}not_intersect_right_subtree(e){if(!this.right)return!0;let t=this.right.max?this.right.max.low:this.right.item.key.low,n=this.requireKey(),o=e.requireKey();return n.comparable_less_than(o.high,t)}},Oit=class e{constructor(){this.root=null,this.nil_node=new Tk}get size(){let t=0;return this.tree_walk(this.root,(n)=>t+=n.item.values.length),t}get keys(){let t=[];return this.tree_walk(this.root,(n)=>t.push(n.item.key.output())),t}get values(){let t=[];return this.tree_walk(this.root,(n)=>{for(let o of n.item.values)t.push(o)}),t}get items(){let t=[];return this.tree_walk(this.root,(n)=>{let o=n.item.key.output();for(let r of n.item.values)t.push({key:o,value:r})}),t}isEmpty(){return this.root==null||this.root===this.nil_node}clear(){this.root=null}insert(t,n=t){if(t===void 0)return;let o=this.tree_search(this.root,new Tk(t));if(o)return o.item.values.push(n),o;let r=new Tk(t,n,this.nil_node,this.nil_node,null,1);return this.tree_insert(r),this.recalc_max(r),r}exist(t,n=t){let o=this.tree_search(this.root,new Tk(t));return!!o&&(arguments.length<2||n===t||o.item.values.some((r)=>r&&r.equal_to?r.equal_to(n):r===n))}remove(t,n=t){let o=this.tree_search(this.root,new Tk(t));if(!o)return;if(arguments.length<2)return this.tree_delete(o),o;let r=o.item.values.findIndex((i)=>i&&i.equal_to?i.equal_to(n):i===n);return r>=0?(o.item.values.splice(r,1),o.item.values.length===0&&this.tree_delete(o),o):void 0}search(t,n=(o,r)=>o===r?r.output():o){let o=new Tk(t),r=[];this.tree_search_interval(this.root,o,r);let i=[];for(let s of r)for(let a of s.item.values)i.push(n(a,s.item.key));return i}intersect_any(t){let n=new Tk(t);return this.tree_find_any_interval(this.root,n)}forEach(t){this.tree_walk(this.root,(n)=>{for(let o of n.item.values)t(n.item.key,o)})}map(t){let n=new e;return this.tree_walk(this.root,(o)=>{for(let r of o.item.values)n.insert(o.item.key,t(r,o.item.key))}),n}*iterate(t,n=(o,r)=>o===r?r.output():o){let o=null;for(t?o=this.tree_search_nearest_forward(this.root,new Tk(t)):this.root&&(o=this.local_minimum(this.root));o;){for(let r of o.item.values)yield n(r,o.item.key);o=this.tree_successor(o)}}recalc_max(t){let n=t;for(;n.parent!=null;)n.parent.update_max(),n=n.parent}tree_insert(t){let n=this.root,o=null;if(this.root==null||this.root===this.nil_node)this.root=t;else{for(;n!==this.nil_node;)o=n,n=t.less_than(n)?n.left:n.right;t.parent=o,t.less_than(o)?o.left=t:o.right=t}this.insert_fixup(t)}insert_fixup(t){let n,o;for(n=t;n!==this.root&&n.parent.color===1;)n.parent===n.parent.parent.left?(o=n.parent.parent.right,o.color===1?(n.parent.color=0,o.color=0,n.parent.parent.color=1,n=n.parent.parent):(n===n.parent.right&&(n=n.parent,this.rotate_left(n)),n.parent.color=0,n.parent.parent.color=1,this.rotate_right(n.parent.parent))):(o=n.parent.parent.left,o.color===1?(n.parent.color=0,o.color=0,n.parent.parent.color=1,n=n.parent.parent):(n===n.parent.left&&(n=n.parent,this.rotate_right(n)),n.parent.color=0,n.parent.parent.color=1,this.rotate_left(n.parent.parent)));this.root.color=0}tree_delete(t){let n,o;n=t.left===this.nil_node||t.right===this.nil_node?t:this.tree_successor(t),o=n.left!==this.nil_node?n.left:n.right,o.parent=n.parent,n===this.root?this.root=o:(n===n.parent.left?n.parent.left=o:n.parent.right=o,n.parent.update_max()),this.recalc_max(o),n!==t&&(t.copy_data(n),t.update_max(),this.recalc_max(t)),n.color===0&&this.delete_fixup(o)}delete_fixup(t){let n,o=t;for(;o!==this.root&&o.parent!=null&&o.color===0;)o===o.parent.left?(n=o.parent.right,n.color===1&&(n.color=0,o.parent.color=1,this.rotate_left(o.parent),n=o.parent.right),n.left.color===0&&n.right.color===0?(n.color=1,o=o.parent):(n.right.color===0&&(n.color=1,n.left.color=0,this.rotate_right(n),n=o.parent.right),n.color=o.parent.color,o.parent.color=0,n.right.color=0,this.rotate_left(o.parent),o=this.root)):(n=o.parent.left,n.color===1&&(n.color=0,o.parent.color=1,this.rotate_right(o.parent),n=o.parent.left),n.left.color===0&&n.right.color===0?(n.color=1,o=o.parent):(n.left.color===0&&(n.color=1,n.right.color=0,this.rotate_left(n),n=o.parent.left),n.color=o.parent.color,o.parent.color=0,n.left.color=0,this.rotate_right(o.parent),o=this.root));o.color=0}tree_search(t,n){if(t!=null&&t!==this.nil_node)return n.equal_to(t)?t:n.less_than(t)?this.tree_search(t.left,n):this.tree_search(t.right,n)}tree_search_nearest_forward(t,n){let o=null,r=t;for(;r&&r!==this.nil_node;)r.less_than(n)?r.intersect(n)?(o=r,r=r.left):r=r.right:(o&&!r.less_than(o)||(o=r),r=r.left);return o||null}tree_search_interval(t,n,o){t!=null&&t!==this.nil_node&&(t.left===this.nil_node||t.not_intersect_left_subtree(n)||this.tree_search_interval(t.left,n,o),t.intersect(n)&&o.push(t),t.right===this.nil_node||t.not_intersect_right_subtree(n)||this.tree_search_interval(t.right,n,o))}tree_find_any_interval(t,n){let o=!1;return t!=null&&t!==this.nil_node&&(t.left===this.nil_node||t.not_intersect_left_subtree(n)||(o=this.tree_find_any_interval(t.left,n)),o||(o=t.intersect(n)),o||t.right===this.nil_node||t.not_intersect_right_subtree(n)||(o=this.tree_find_any_interval(t.right,n))),o}local_minimum(t){let n=t;for(;n.left!=null&&n.left!==this.nil_node;)n=n.left;return n}local_maximum(t){let n=t;for(;n.right!=null&&n.right!==this.nil_node;)n=n.right;return n}tree_successor(t){let n,o,r;if(t.right!==this.nil_node)n=this.local_minimum(t.right);else{for(o=t,r=t.parent;r!=null&&r.right===o;)o=r,r=r.parent;n=r}return n}rotate_left(t){let n=t.right;t.right=n.left,n.left!==this.nil_node&&(n.left.parent=t),n.parent=t.parent,t===this.root?this.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n.left=t,t.parent=n,t!==null&&t!==this.nil_node&&t.update_max(),n!=null&&n!==this.nil_node&&n.update_max()}rotate_right(t){let n=t.left;t.left=n.right,n.right!==this.nil_node&&(n.right.parent=t),n.parent=t.parent,t===this.root?this.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n.right=t,t.parent=n,t!==null&&t!==this.nil_node&&t.update_max(),n!=null&&n!==this.nil_node&&n.update_max()}tree_walk(t,n){t!=null&&t!==this.nil_node&&(this.tree_walk(t.left,n),n(t),this.tree_walk(t.right,n))}testRedBlackProperty(){let t=!0;return this.tree_walk(this.root,function(n){n.color===1&&(n.left.color===0&&n.right.color===0||(t=!1))}),t}testBlackHeightProperty(t){let n=0,o=0,r=0;if(t.color===0&&n++,o=t.left!==this.nil_node?this.testBlackHeightProperty(t.left):1,r=t.right!==this.nil_node?this.testBlackHeightProperty(t.right):1,o!==r)throw Error("Red-black height property violated");return n+=o,n}},Ani=class extends Set{constructor(e){super(e),this.index=new Oit,this.forEach((t)=>this.index.insert(t))}add(e){let t=this.size,{key:n,value:o}=e,r=n||e.box,i=o||e;return super.add(i),this.size>t&&this.index.insert(r,i),this}delete(e){let{key:t,value:n}=e,o=t||e.box,r=n||e,i=super.delete(r);return i&&this.index.remove(o,r),i}clear(){super.clear(),this.index=new Oit}search(e){return this.index.search(e)}hit(e){let t=new Ye.Box(e.x-1,e.y-1,e.x+1,e.y+1);return this.index.search(t).filter((n)=>e.on(n))}svg(){return[...this].reduce((e,t)=>e+t.svg(),"")}};Ye.PlanarSet=Ani;var PL=class{get name(){throw M0.CANNOT_INVOKE_ABSTRACT_METHOD}get box(){throw M0.CANNOT_INVOKE_ABSTRACT_METHOD}clone(){throw M0.CANNOT_INVOKE_ABSTRACT_METHOD}translate(...e){return this.transform(new Kde().translate(...e))}rotate(e,t=new Ye.Point){return this.transform(new Kde().rotate(e,t.x,t.y))}scale(e,t){return this.transform(new Kde().scale(e,t))}transform(...e){throw M0.CANNOT_INVOKE_ABSTRACT_METHOD}toJSON(){return Object.assign({},this,{name:this.name})}svg(e={}){throw M0.CANNOT_INVOKE_ABSTRACT_METHOD}};Ye.Point=class e extends PL{constructor(...t){if(super(),this.x=0,this.y=0,t.length!==0){if(t.length===1&&t[0]instanceof Array&&t[0].length===2){let n=t[0];if(typeof n[0]=="number"&&typeof n[1]=="number")return this.x=n[0],void(this.y=n[1])}if(t.length===1&&t[0]instanceof Object&&t[0].name==="point"){let{x:n,y:o}=t[0];return this.x=n,void(this.y=o)}if(t.length===2&&typeof t[0]=="number"&&typeof t[1]=="number")return this.x=t[0],void(this.y=t[1]);throw M0.ILLEGAL_PARAMETERS}}get box(){return new Ye.Box(this.x,this.y,this.x,this.y)}clone(){return new Ye.Point(this.x,this.y)}get vertices(){return[this.clone()]}equalTo(t){return Ye.Utils.EQ(this.x,t.x)&&Ye.Utils.EQ(this.y,t.y)}lessThan(t){return!!Ye.Utils.LT(this.y,t.y)||!(!Ye.Utils.EQ(this.y,t.y)||!Ye.Utils.LT(this.x,t.x))}transform(t){return new Ye.Point(t.transform([this.x,this.y]))}projectionOn(t){if(this.equalTo(t.pt))return this.clone();let n=new Ye.Vector(this,t.pt);if(Ye.Utils.EQ_0(n.cross(t.norm)))return t.pt.clone();let o=n.dot(t.norm),r=t.norm.multiply(o);return this.translate(r)}leftTo(t){let n=new Ye.Vector(t.pt,this);return Ye.Utils.GT(n.dot(t.norm),0)}distanceTo(t){if(t instanceof e){let n=t.x-this.x,o=t.y-this.y;return[Math.sqrt(n*n+o*o),new Ye.Segment(this,t)]}return t instanceof Ye.Line?Ye.Distance.point2line(this,t):t instanceof Ye.Circle?Ye.Distance.point2circle(this,t):t instanceof Ye.Segment?Ye.Distance.point2segment(this,t):t instanceof Ye.Arc?Ye.Distance.point2arc(this,t):t instanceof Ye.Polygon?Ye.Distance.point2polygon(this,t):t instanceof Ye.PlanarSet?Ye.Distance.shape2planarSet(this,t):t instanceof Ye.Multiline?Ye.Distance.shape2multiline(this,t):void 0}on(t){if(t instanceof Ye.Point)return this.equalTo(t);if(t.contains&&t.contains instanceof Function)return t.contains(this);throw Ye.Errors.UNSUPPORTED_SHAPE_TYPE}get name(){return"point"}svg(t={}){let n=t.r??3;return`
<circle cx="${this.x}" cy="${this.y}" r="${n}"
            ${QG({fill:"red",...t})} />`}};var fni=(...e)=>new Ye.Point(...e);Ye.point=fni;Ye.Vector=class extends PL{constructor(...e){if(super(),this.x=0,this.y=0,e.length!==0){if(e.length===1&&e[0]instanceof Array&&e[0].length===2){let t=e[0];if(typeof t[0]=="number"&&typeof t[1]=="number")return this.x=t[0],void(this.y=t[1])}if(e.length===1&&e[0]instanceof Object&&e[0].name==="vector"){let{x:t,y:n}=e[0];return this.x=t,void(this.y=n)}if(e.length===1&&e[0]instanceof Object&&e[0].name==="segment"){let{start:t,end:n}=e[0];return this.x=n.x-t.x,void(this.y=n.y-t.y)}if(e.length===2){let t=e[0],n=e[1];if(typeof t=="number"&&typeof n=="number")return this.x=t,void(this.y=n);if(t instanceof Ye.Point&&n instanceof Ye.Point)return this.x=n.x-t.x,void(this.y=n.y-t.y)}throw M0.ILLEGAL_PARAMETERS}}clone(){return new Ye.Vector(this.x,this.y)}get slope(){let e=Math.atan2(this.y,this.x);return e<0&&(e=2*Math.PI+e),e}get length(){return Math.sqrt(this.dot(this))}isZeroLength(){return Ye.Utils.EQ_0(this.length)}equalTo(e){return Ye.Utils.EQ(this.x,e.x)&&Ye.Utils.EQ(this.y,e.y)}multiply(e){return new Ye.Vector(e*this.x,e*this.y)}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}normalize(){if(this.isZeroLength())throw M0.ZERO_DIVISION;return new Ye.Vector(this.x/this.length,this.y/this.length)}rotate(e,t=new Ye.Point){if(t.x===0&&t.y===0)return this.transform(new Kde().rotate(e));throw M0.OPERATION_IS_NOT_SUPPORTED}transform(e){return new Ye.Vector(e.transform([this.x,this.y]))}rotate90CCW(){return new Ye.Vector(-this.y,this.x)}rotate90CW(){return new Ye.Vector(this.y,-this.x)}invert(){return new Ye.Vector(-this.x,-this.y)}add(e){return new Ye.Vector(this.x+e.x,this.y+e.y)}subtract(e){return new Ye.Vector(this.x-e.x,this.y-e.y)}angleTo(e){let t=this.normalize(),n=e.normalize(),o=Math.atan2(t.cross(n),t.dot(n));return o<0&&(o+=2*Math.PI),o}projectionOn(e){let t=e.normalize(),n=this.dot(t);return t.multiply(n)}get name(){return"vector"}};var J8n=(...e)=>new Ye.Vector(...e);Ye.vector=J8n;Ye.Segment=class e extends PL{constructor(...t){if(super(),this.ps=new Ye.Point,this.pe=new Ye.Point,t.length!==0){if(t.length===1&&t[0]instanceof Array&&t[0].length===4){let n=t[0];return this.ps=new Ye.Point(n[0],n[1]),void(this.pe=new Ye.Point(n[2],n[3]))}if(t.length===1&&t[0]instanceof Object&&t[0].name==="segment"){let{ps:n,pe:o}=t[0];return this.ps=new Ye.Point(n.x,n.y),void(this.pe=new Ye.Point(o.x,o.y))}if(!(t.length===1&&t[0]instanceof Ye.Point)){if(t.length===2&&t[0]instanceof Ye.Point&&t[1]instanceof Ye.Point)return this.ps=t[0].clone(),void(this.pe=t[1].clone());if(t.length===4)return this.ps=new Ye.Point(t[0],t[1]),void(this.pe=new Ye.Point(t[2],t[3]));throw M0.ILLEGAL_PARAMETERS}this.ps=t[0].clone()}}clone(){return new Ye.Segment(this.start,this.end)}get start(){return this.ps}get end(){return this.pe}get vertices(){return[this.ps.clone(),this.pe.clone()]}get length(){return this.start.distanceTo(this.end)[0]}get slope(){return new Ye.Vector(this.start,this.end).slope}get box(){return new Ye.Box(Math.min(this.start.x,this.end.x),Math.min(this.start.y,this.end.y),Math.max(this.start.x,this.end.x),Math.max(this.start.y,this.end.y))}equalTo(t){return this.ps.equalTo(t.ps)&&this.pe.equalTo(t.pe)}contains(t){return Ye.Utils.EQ_0(this.distanceToPoint(t))}intersect(t){return t instanceof Ye.Point?this.contains(t)?[t]:[]:t instanceof Ye.Line?c0e(this,t):t instanceof Ye.Ray?mct(t,this):t instanceof Ye.Segment?c8e(this,t):t instanceof Ye.Circle?l8e(this,t):t instanceof Ye.Box?function(n,o){let r=[];for(let i of o.toSegments()){let s=c8e(i,n);for(let a of s)r.push(a)}return r}(this,t):t instanceof Ye.Arc?DZ(this,t):t instanceof Ye.Polygon?uct(this,t):t instanceof Ye.Multiline?qZ(this,t):void 0}distanceTo(t){if(t instanceof Ye.Point){let[n,o]=Ye.Distance.point2segment(t,this);return o=o.reverse(),[n,o]}if(t instanceof Ye.Circle){let[n,o]=Ye.Distance.segment2circle(this,t);return[n,o]}if(t instanceof Ye.Line){let[n,o]=Ye.Distance.segment2line(this,t);return[n,o]}if(t instanceof Ye.Segment){let[n,o]=Ye.Distance.segment2segment(this,t);return[n,o]}if(t instanceof Ye.Arc){let[n,o]=Ye.Distance.segment2arc(this,t);return[n,o]}if(t instanceof Ye.Polygon){let[n,o]=Ye.Distance.shape2polygon(this,t);return[n,o]}if(t instanceof Ye.PlanarSet){let[n,o]=Ye.Distance.shape2planarSet(this,t);return[n,o]}if(t instanceof Ye.Multiline)return Ye.Distance.shape2multiline(this,t)}tangentInStart(){return new Ye.Vector(this.start,this.end).normalize()}tangentInEnd(){return new Ye.Vector(this.end,this.start).normalize()}reverse(){return new e(this.end,this.start)}split(t){return this.start.equalTo(t)?[null,this.clone()]:this.end.equalTo(t)?[this.clone(),null]:[new Ye.Segment(this.start,t),new Ye.Segment(t,this.end)]}middle(){return new Ye.Point((this.start.x+this.end.x)/2,(this.start.y+this.end.y)/2)}pointAtLength(t){if(t>this.length||t<0)return null;if(t==0)return this.start;if(t==this.length)return this.end;let n=t/this.length;return new Ye.Point((this.end.x-this.start.x)*n+this.start.x,(this.end.y-this.start.y)*n+this.start.y)}distanceToPoint(t){let[n,...o]=Ye.Distance.point2segment(t,this);return n}definiteIntegral(t=0){return(this.end.x-this.start.x)*(this.start.y-t+(this.end.y-t))/2}transform(t=new Ye.Matrix){return new e(this.ps.transform(t),this.pe.transform(t))}isZeroLength(){return this.ps.equalTo(this.pe)}sortPoints(t){return new Ye.Line(this.start,this.end).sortPoints(t)}get name(){return"segment"}svg(t={}){return`
<line x1="${this.start.x}" y1="${this.start.y}" x2="${this.end.x}" y2="${this.end.y}" ${QG(t)} />`}};var yni=(...e)=>new Ye.Segment(...e);Ye.segment=yni;var{vector:dde}=Ye;Ye.Line=class e extends PL{constructor(...t){if(super(),this.pt=new Ye.Point,this.norm=new Ye.Vector(0,1),t.length!==0){if(t.length===1&&t[0]instanceof Object&&t[0].name==="line"){let{pt:n,norm:o}=t[0];return this.pt=new Ye.Point(n),void(this.norm=new Ye.Vector(o))}if(t.length===2){let n=t[0],o=t[1];if(n instanceof Ye.Point&&o instanceof Ye.Point)return this.pt=n,this.norm=e.points2norm(n,o),void(this.norm.dot(dde(this.pt.x,this.pt.y))>=0&&this.norm.invert());if(n instanceof Ye.Point&&o instanceof Ye.Vector){if(Ye.Utils.EQ_0(o.x)&&Ye.Utils.EQ_0(o.y))throw M0.ILLEGAL_PARAMETERS;return this.pt=n.clone(),this.norm=o.clone(),this.norm=this.norm.normalize(),void(this.norm.dot(dde(this.pt.x,this.pt.y))>=0&&this.norm.invert())}if(n instanceof Ye.Vector&&o instanceof Ye.Point){if(Ye.Utils.EQ_0(n.x)&&Ye.Utils.EQ_0(n.y))throw M0.ILLEGAL_PARAMETERS;return this.pt=o.clone(),this.norm=n.clone(),this.norm=this.norm.normalize(),void(this.norm.dot(dde(this.pt.x,this.pt.y))>=0&&this.norm.invert())}}throw M0.ILLEGAL_PARAMETERS}}clone(){return new Ye.Line(this.pt,this.norm)}get start(){}get end(){}get length(){return Number.POSITIVE_INFINITY}get box(){return new Ye.Box(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY)}get middle(){}get slope(){return new Ye.Vector(this.norm.y,-this.norm.x).slope}get standard(){return[this.norm.x,this.norm.y,this.norm.dot(dde(this.pt.x,this.pt.y))]}parallelTo(t){return Ye.Utils.EQ_0(this.norm.cross(t.norm))}incidentTo(t){return this.parallelTo(t)&&this.pt.on(t)}contains(t){if(this.pt.equalTo(t))return!0;let n=new Ye.Vector(this.pt,t);return Ye.Utils.EQ_0(this.norm.dot(n))}coord(t){return dde(t.x,t.y).cross(this.norm)}intersect(t){return t instanceof Ye.Point?this.contains(t)?[t]:[]:t instanceof Ye.Line?$Z(this,t):t instanceof Ye.Ray?Y8n(t,this):t instanceof Ye.Circle?kG(this,t):t instanceof Ye.Box?TZ(this,t):t instanceof Ye.Segment?c0e(t,this):t instanceof Ye.Arc?c7e(this,t):t instanceof Ye.Polygon?l0e(this,t):t instanceof Ye.Multiline?qZ(this,t):void 0}distanceTo(t){if(t instanceof Ye.Point){let[n,o]=Ye.Distance.point2line(t,this);return o=o.reverse(),[n,o]}if(t instanceof Ye.Circle){let[n,o]=Ye.Distance.circle2line(t,this);return o=o.reverse(),[n,o]}if(t instanceof Ye.Segment){let[n,o]=Ye.Distance.segment2line(t,this);return[n,o.reverse()]}if(t instanceof Ye.Arc){let[n,o]=Ye.Distance.arc2line(t,this);return[n,o.reverse()]}if(t instanceof Ye.Polygon){let[n,o]=Ye.Distance.shape2polygon(this,t);return[n,o]}}split(t){if(t instanceof Ye.Point)return[new Ye.Ray(t,this.norm),new Ye.Ray(t,this.norm)];{let n=new Ye.Multiline([this]),o=this.sortPoints(t);return n.split(o),n.toShapes()}}rotate(t,n=new Ye.Point){return new Ye.Line(this.pt.rotate(t,n),this.norm.rotate(t))}transform(t){return new Ye.Line(this.pt.transform(t),this.norm.clone())}sortPoints(t){return t.slice().sort((n,o)=>this.coord(n)<this.coord(o)?-1:this.coord(n)>this.coord(o)?1:0)}get name(){return"line"}svg(t,n={}){let o=TZ(this,t);if(o.length===0)return"";let r=o[0],i=o.length===2?o[1]:o.find((s)=>!s.equalTo(r));return i===void 0&&(i=r),new Ye.Segment(r,i).svg(n)}static points2norm(t,n){if(t.equalTo(n))throw M0.ILLEGAL_PARAMETERS;return new Ye.Vector(t,n).normalize().rotate90CCW()}};var xni=(...e)=>new Ye.Line(...e);Ye.line=xni;Ye.Circle=class extends PL{constructor(...e){if(super(),this.pc=new Ye.Point,this.r=1,e.length===1&&e[0]instanceof Object&&e[0].name==="circle"){let{pc:t,r:n}=e[0];this.pc=new Ye.Point(t),this.r=n}else{let[t,n]=[...e];t&&t instanceof Ye.Point&&(this.pc=t.clone()),n!==void 0&&(this.r=n)}}clone(){return new Ye.Circle(this.pc.clone(),this.r)}get center(){return this.pc}get box(){return new Ye.Box(this.pc.x-this.r,this.pc.y-this.r,this.pc.x+this.r,this.pc.y+this.r)}contains(e){return e instanceof Ye.Point?Ye.Utils.LE(e.distanceTo(this.center)[0],this.r):e instanceof Ye.Segment?Ye.Utils.LE(e.start.distanceTo(this.center)[0],this.r)&&Ye.Utils.LE(e.end.distanceTo(this.center)[0],this.r):e instanceof Ye.Arc?this.intersect(e).length===0&&Ye.Utils.LE(e.start.distanceTo(this.center)[0],this.r)&&Ye.Utils.LE(e.end.distanceTo(this.center)[0],this.r):e instanceof Ye.Circle?this.intersect(e).length===0&&Ye.Utils.LE(e.r,this.r)&&Ye.Utils.LE(e.center.distanceTo(this.center)[0],this.r):void 0}toArc(e=!0){return new Ye.Arc(this.center,this.r,Math.PI,-Math.PI,e)}scale(e,t){if(e!==t)throw M0.OPERATION_IS_NOT_SUPPORTED;if(this.pc.x!==0||this.pc.y!==0)throw M0.OPERATION_IS_NOT_SUPPORTED;return new Ye.Circle(this.pc,this.r*e)}transform(e=new Ye.Matrix){return new Ye.Circle(this.pc.transform(e),this.r)}intersect(e){return e instanceof Ye.Point?this.contains(e)?[e]:[]:e instanceof Ye.Line?kG(e,this):e instanceof Ye.Ray?V8n(e,this):e instanceof Ye.Segment?l8e(e,this):e instanceof Ye.Circle?R8n(e,this):e instanceof Ye.Box?function(t,n){let o=[];for(let r of n.toSegments()){let i=l8e(r,t);for(let s of i)o.push(s)}return o}(this,e):e instanceof Ye.Arc?dct(e,this):e instanceof Ye.Polygon?F8n(this,e):e instanceof Ye.Multiline?qZ(this,e):void 0}distanceTo(e){if(e instanceof Ye.Point){let[t,n]=Ye.Distance.point2circle(e,this);return n=n.reverse(),[t,n]}if(e instanceof Ye.Circle){let[t,n]=Ye.Distance.circle2circle(this,e);return[t,n]}if(e instanceof Ye.Line){let[t,n]=Ye.Distance.circle2line(this,e);return[t,n]}if(e instanceof Ye.Segment){let[t,n]=Ye.Distance.segment2circle(e,this);return n=n.reverse(),[t,n]}if(e instanceof Ye.Arc){let[t,n]=Ye.Distance.arc2circle(e,this);return n=n.reverse(),[t,n]}if(e instanceof Ye.Polygon){let[t,n]=Ye.Distance.shape2polygon(this,e);return[t,n]}if(e instanceof Ye.PlanarSet){let[t,n]=Ye.Distance.shape2planarSet(this,e);return[t,n]}if(e instanceof Ye.Multiline){let[t,n]=Ye.Distance.shape2multiline(this,e);return[t,n]}}get name(){return"circle"}svg(e={}){return`
<circle cx="${this.pc.x}" cy="${this.pc.y}" r="${this.r}"
                ${QG({fill:"none",...e})} />`}};Ye.circle=(...e)=>new Ye.Circle(...e);Ye.Arc=class extends PL{constructor(...e){if(super(),this.pc=new Ye.Point,this.r=1,this.startAngle=0,this.endAngle=2*Math.PI,this.counterClockwise=!0,e.length!==0)if(e.length===1&&e[0]instanceof Object&&e[0].name==="arc"){let{pc:t,r:n,startAngle:o,endAngle:r,counterClockwise:i}=e[0];this.pc=new Ye.Point(t.x,t.y),this.r=n,this.startAngle=o,this.endAngle=r,this.counterClockwise=i}else{let[t,n,o,r,i]=[...e];t&&t instanceof Ye.Point&&(this.pc=t.clone()),n!==void 0&&(this.r=n),o!==void 0&&(this.startAngle=o),r!==void 0&&(this.endAngle=r),i!==void 0&&(this.counterClockwise=i)}}clone(){return new Ye.Arc(this.pc.clone(),this.r,this.startAngle,this.endAngle,this.counterClockwise)}get sweep(){let e=this.startAngle,t=this.endAngle;if(Ye.Utils.EQ(Math.abs(e-t),Ye.PIx2))return Ye.PIx2;Math.abs(e)>Ye.PIx2&&(e-=Math.trunc(e/Ye.PIx2)*Ye.PIx2),e<0&&(e+=Ye.PIx2),Math.abs(t)>Ye.PIx2&&(t-=Math.trunc(t/Ye.PIx2)*Ye.PIx2),t<0&&(t+=Ye.PIx2);let n=this.counterClockwise?t-e:e-t;return n<0&&(n+=Ye.PIx2),n}get start(){return new Ye.Point(this.pc.x+this.r,this.pc.y).rotate(this.startAngle,this.pc)}get end(){return new Ye.Point(this.pc.x+this.r,this.pc.y).rotate(this.endAngle,this.pc)}get center(){return this.pc.clone()}get vertices(){return[this.start.clone(),this.end.clone()]}get length(){return Math.abs(this.sweep*this.r)}get box(){let e=this.breakToFunctional().reduce((t,n)=>t.merge(n.start.box),new Ye.Box);return e=e.merge(this.end.box),e}contains(e){if(!Ye.Utils.EQ(this.pc.distanceTo(e)[0],this.r))return!1;if(e.equalTo(this.start))return!0;let t=new Ye.Vector(this.pc,e).slope,n=new Ye.Arc(this.pc,this.r,this.startAngle,t,this.counterClockwise);return Ye.Utils.LE(n.length,this.length)}split(e){if(this.start.equalTo(e))return[null,this.clone()];if(this.end.equalTo(e))return[this.clone(),null];let t=new Ye.Vector(this.pc,e).slope;return[new Ye.Arc(this.pc,this.r,this.startAngle,t,this.counterClockwise),new Ye.Arc(this.pc,this.r,t,this.endAngle,this.counterClockwise)]}middle(){let e=this.counterClockwise?this.startAngle+this.sweep/2:this.startAngle-this.sweep/2;return new Ye.Arc(this.pc,this.r,this.startAngle,e,this.counterClockwise).end}pointAtLength(e){if(e>this.length||e<0)return null;if(e===0)return this.start;if(e===this.length)return this.end;let t=e/this.length,n=this.counterClockwise?this.startAngle+this.sweep*t:this.startAngle-this.sweep*t;return new Ye.Arc(this.pc,this.r,this.startAngle,n,this.counterClockwise).end}chordHeight(){return(1-Math.cos(Math.abs(this.sweep/2)))*this.r}intersect(e){return e instanceof Ye.Point?this.contains(e)?[e]:[]:e instanceof Ye.Line?c7e(e,this):e instanceof Ye.Ray?_ct(e,this):e instanceof Ye.Circle?dct(this,e):e instanceof Ye.Segment?DZ(e,this):e instanceof Ye.Box?function(t,n){let o=[];for(let r of n.toSegments()){let i=DZ(r,t);for(let s of i)o.push(s)}return o}(this,e):e instanceof Ye.Arc?Q8n(this,e):e instanceof Ye.Polygon?pct(this,e):e instanceof Ye.Multiline?qZ(this,e):void 0}distanceTo(e){if(e instanceof Ye.Point){let[t,n]=Ye.Distance.point2arc(e,this);return n=n.reverse(),[t,n]}if(e instanceof Ye.Circle){let[t,n]=Ye.Distance.arc2circle(this,e);return[t,n]}if(e instanceof Ye.Line){let[t,n]=Ye.Distance.arc2line(this,e);return[t,n]}if(e instanceof Ye.Segment){let[t,n]=Ye.Distance.segment2arc(e,this);return n=n.reverse(),[t,n]}if(e instanceof Ye.Arc){let[t,n]=Ye.Distance.arc2arc(this,e);return[t,n]}if(e instanceof Ye.Polygon){let[t,n]=Ye.Distance.shape2polygon(this,e);return[t,n]}if(e instanceof Ye.PlanarSet){let[t,n]=Ye.Distance.shape2planarSet(this,e);return[t,n]}if(e instanceof Ye.Multiline)return Ye.Distance.shape2multiline(this,e)}breakToFunctional(){let e=[],t=[0,Math.PI/2,Math.PI,3*Math.PI/2],n=this.startAngle,o=this.endAngle;Ye.Utils.EQ(Math.abs(n-o),Ye.PIx2)&&(o=n),Math.abs(n)>Ye.PIx2&&(n-=Math.trunc(n/Ye.PIx2)*Ye.PIx2),n<0&&(n+=Ye.PIx2),Math.abs(o)>Ye.PIx2&&(o-=Math.trunc(o/Ye.PIx2)*Ye.PIx2),o<0&&(o+=Ye.PIx2);let r,i,s,a=n;this.counterClockwise?(i=Math.ceil(n/(Math.PI/2))%4,s=1):(i=Math.floor(n/(Math.PI/2))%4,s=-1);for(let c=0,l=i;c<4;c++,l=(l+s+4)%4){if(r=t[l],r===a)continue;let h=this.counterClockwise?r-n:n-r;if(h<0&&(h+=Ye.PIx2),h>this.sweep)break;e.push(new Ye.Arc(this.pc,this.r,a,r,this.counterClockwise)),a=r}return e.length===0?(e.push(this),e):(r=o,a!==r&&e.push(new Ye.Arc(this.pc,this.r,a,r,this.counterClockwise)),e)}tangentInStart(){let e=new Ye.Vector(this.pc,this.start),t=this.counterClockwise?Math.PI/2:-Math.PI/2;return e.rotate(t).normalize()}tangentInEnd(){let e=new Ye.Vector(this.pc,this.end),t=this.counterClockwise?-Math.PI/2:Math.PI/2;return e.rotate(t).normalize()}reverse(){return new Ye.Arc(this.pc,this.r,this.endAngle,this.startAngle,!this.counterClockwise)}transform(e=new Ye.Matrix){let t=this.start.transform(e),n=this.end.transform(e),o=this.pc.transform(e),r=this.counterClockwise;return e.a*e.d<0&&(r=!r),Ye.Arc.arcSE(o,t,n,r)}static arcSE(e,t,n,o){let{vector:r}=Ye,i=r(e,t).slope,s=r(e,n).slope;Ye.Utils.EQ(i,s)&&(s+=2*Math.PI,o=!0);let a=r(e,t).length;return new Ye.Arc(e,a,i,s,o)}definiteIntegral(e=0){return this.breakToFunctional().reduce((t,n)=>t+n.circularSegmentDefiniteIntegral(e),0)}circularSegmentDefiniteIntegral(e){let t=new Ye.Segment(this.start,this.end).definiteIntegral(e),n=Ye.Utils.EQ(this.sweep,Ye.PIx2)?0:this.circularSegmentArea();return this.counterClockwise?t-n:t+n}circularSegmentArea(){return 0.5*this.r*this.r*(this.sweep-Math.sin(this.sweep))}sortPoints(e){let{vector:t}=Ye;return e.slice().sort((n,o)=>{let r=t(this.pc,n).slope,i=t(this.pc,o).slope;return r<i?-1:r>i?1:0})}get name(){return"arc"}svg(e={}){let t=this.sweep<=Math.PI?"0":"1",n=this.counterClockwise?"1":"0";if(Ye.Utils.EQ(this.sweep,2*Math.PI))return new Ye.Circle(this.pc,this.r).svg(e);return`
<path d="M${this.start.x},${this.start.y}
                             A${this.r},${this.r} 0 ${t},${n} ${this.end.x},${this.end.y}"
                    ${QG({fill:"none",...e})} />`}};Ye.arc=(...e)=>new Ye.Arc(...e);Ye.Box=class e extends PL{constructor(t=void 0,n=void 0,o=void 0,r=void 0){super(),this.xmin=t,this.ymin=n,this.xmax=o,this.ymax=r}clone(){return new e(this.xmin,this.ymin,this.xmax,this.ymax)}get low(){return new Ye.Point(this.xmin,this.ymin)}get high(){return new Ye.Point(this.xmax,this.ymax)}get max(){return this.clone()}get center(){return new Ye.Point((this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)}get width(){return Math.abs(this.xmax-this.xmin)}get height(){return Math.abs(this.ymax-this.ymin)}get box(){return this.clone()}not_intersect(t){return this.xmax<t.xmin||this.xmin>t.xmax||this.ymax<t.ymin||this.ymin>t.ymax}intersect(t){return!this.not_intersect(t)}merge(t){return new e(this.xmin===void 0?t.xmin:Math.min(this.xmin,t.xmin),this.ymin===void 0?t.ymin:Math.min(this.ymin,t.ymin),this.xmax===void 0?t.xmax:Math.max(this.xmax,t.xmax),this.ymax===void 0?t.ymax:Math.max(this.ymax,t.ymax))}less_than(t){return!!this.low.lessThan(t.low)||!(!this.low.equalTo(t.low)||!this.high.lessThan(t.high))}equal_to(t){return this.low.equalTo(t.low)&&this.high.equalTo(t.high)}output(){return this.clone()}comparable_less_than(t,n){return t.lessThan(n)}set(t,n,o,r){this.xmin=t,this.ymin=n,this.xmax=o,this.ymax=r}extend(t){return t<=0?this.clone():new e(this.xmin-t,this.ymin-t,this.xmax+t,this.ymax+t)}toPoints(){return[new Ye.Point(this.xmin,this.ymin),new Ye.Point(this.xmax,this.ymin),new Ye.Point(this.xmax,this.ymax),new Ye.Point(this.xmin,this.ymax)]}toSegments(){let t=this.toPoints();return[new Ye.Segment(t[0],t[1]),new Ye.Segment(t[1],t[2]),new Ye.Segment(t[2],t[3]),new Ye.Segment(t[3],t[0])]}rotate(t,n=new Ye.Point){throw M0.OPERATION_IS_NOT_SUPPORTED}transform(t=new Ye.Matrix){return this.toPoints().map((n)=>n.transform(t)).reduce((n,o)=>n.merge(o.box),new e)}contains(t){return t instanceof Ye.Point?t.x>=this.xmin&&t.x<=this.xmax&&t.y>=this.ymin&&t.y<=this.ymax:t instanceof Ye.Segment?t.vertices.every((n)=>this.contains(n)):t instanceof Ye.Box?t.toSegments().every((n)=>this.contains(n)):t instanceof Ye.Circle?this.contains(t.box):t instanceof Ye.Arc?t.vertices.every((n)=>this.contains(n))&&this.toSegments().every((n)=>DZ(n,t).length===0):!(t instanceof Ye.Line||t instanceof Ye.Ray)&&(t instanceof Ye.Multiline?t.toShapes().every((n)=>this.contains(n)):t instanceof Ye.Polygon?this.contains(t.box):void 0)}distanceTo(t){let n=this.toSegments().map((r)=>r.distanceTo(t)),o=[Number.MAX_SAFE_INTEGER,null];return n.forEach((r)=>{r[0]<o[0]&&(o=r)}),o}get name(){return"box"}svg(t={}){let n=this.xmax-this.xmin,o=this.ymax-this.ymin;return`
<rect x="${this.xmin}" y="${this.ymin}" width="${n}" height="${o}"
                ${QG({fill:"none",...t})} />`}};Ye.box=(...e)=>new Ye.Box(...e);Ye.Edge=class{constructor(e){this.shape=e,this.next=void 0,this.prev=void 0,this.face=void 0,this.arc_length=0,this.bvStart=void 0,this.bvEnd=void 0,this.bv=void 0,this.overlap=void 0}get start(){return this.shape.start}get end(){return this.shape.end}get length(){return this.shape.length}get box(){return this.shape.box}get isSegment(){return this.shape instanceof Ye.Segment}get isArc(){return this.shape instanceof Ye.Arc}get isLine(){return this.shape instanceof Ye.Line}get isRay(){return this.shape instanceof Ye.Ray}middle(){return this.shape.middle()}pointAtLength(e){return this.shape.pointAtLength(e)}contains(e){return this.shape.contains(e)}setInclusion(e){if(this.bv!==void 0)return this.bv;if(this.shape instanceof Ye.Line||this.shape instanceof Ye.Ray)return this.bv=Ye.OUTSIDE,this.bv;if(this.bvStart===void 0&&(this.bvStart=jde(e,this.start)),this.bvEnd===void 0&&(this.bvEnd=jde(e,this.end)),this.bvStart===Ye.OUTSIDE||this.bvEnd==Ye.OUTSIDE)this.bv=Ye.OUTSIDE;else if(this.bvStart===Ye.INSIDE||this.bvEnd==Ye.INSIDE)this.bv=Ye.INSIDE;else{let t=jde(e,this.middle());this.bv=t}return this.bv}setOverlap(e){let t,n=this.shape,o=e.shape;n instanceof Ye.Segment&&o instanceof Ye.Segment?n.start.equalTo(o.start)&&n.end.equalTo(o.end)?t=Ye.OVERLAP_SAME:n.start.equalTo(o.end)&&n.end.equalTo(o.start)&&(t=Ye.OVERLAP_OPPOSITE):(n instanceof Ye.Arc&&o instanceof Ye.Arc||n instanceof Ye.Segment&&o instanceof Ye.Arc||n instanceof Ye.Arc&&o instanceof Ye.Segment)&&(n.start.equalTo(o.start)&&n.end.equalTo(o.end)&&n.middle().equalTo(o.middle())?t=Ye.OVERLAP_SAME:n.start.equalTo(o.end)&&n.end.equalTo(o.start)&&n.middle().equalTo(o.middle())&&(t=Ye.OVERLAP_OPPOSITE)),this.overlap===void 0&&(this.overlap=t),e.overlap===void 0&&(e.overlap=t)}svg(){if(this.shape instanceof Ye.Segment)return` L${this.shape.end.x},${this.shape.end.y}`;if(this.shape instanceof Ye.Arc){let e,t=this.shape,n=t.counterClockwise?"1":"0";if(Ye.Utils.EQ(t.sweep,2*Math.PI)){let o=t.counterClockwise?1:-1,r=new Ye.Arc(t.pc,t.r,t.startAngle,t.startAngle+o*Math.PI,t.counterClockwise),i=new Ye.Arc(t.pc,t.r,t.startAngle+o*Math.PI,t.endAngle,t.counterClockwise);return e="0",` A${r.r},${r.r} 0 ${e},${n} ${r.end.x},${r.end.y}
                    A${i.r},${i.r} 0 ${e},${n} ${i.end.x},${i.end.y}`}return e=t.sweep<=Math.PI?"0":"1",` A${t.r},${t.r} 0 ${e},${n} ${t.end.x},${t.end.y}`}}toJSON(){return this.shape.toJSON()}};var Cni=class extends hct{constructor(e,t){super(e,t),this.setCircularLinks()}setCircularLinks(){this.isEmpty()||(this.last.next=this.first,this.first.prev=this.last)}[Symbol.iterator](){let e;return{next:()=>{let t=e||this.first,n=!this.first||!!e&&e===this.first;return e=t?t.next:void 0,{value:t,done:n}}}}append(e){return super.append(e),this.setCircularLinks(),this}insert(e,t){return super.insert(e,t),this.setCircularLinks(),this}remove(e){return super.remove(e),this}};Ye.Face=class e extends Cni{constructor(t,...n){if(super(),this._box=void 0,this._orientation=void 0,n.length!==0){if(n.length===1){if(n[0]instanceof Array){let o=n[0];if(o.length===0)return;if(o.every((r)=>r instanceof Ye.Point)){let r=e.points2segments(o);this.shapes2face(t.edges,r)}else if(o.every((r)=>r instanceof Array&&r.length===2)){let r=o.map((s)=>new Ye.Point(s[0],s[1])),i=e.points2segments(r);this.shapes2face(t.edges,i)}else if(o.every((r)=>r instanceof Ye.Segment||r instanceof Ye.Arc))this.shapes2face(t.edges,o);else if(o.every((r)=>r.name==="segment"||r.name==="arc")){let r=[];for(let i of o){let s;s=i.name==="segment"?new Ye.Segment(i):new Ye.Arc(i),r.push(s)}this.shapes2face(t.edges,r)}}else if(n[0]instanceof e){let o=n[0];this.first=o.first,this.last=o.last;for(let r of o)t.edges.add(r)}else if(n[0]instanceof Ye.Circle)this.shapes2face(t.edges,[n[0].toArc(w8n)]);else if(n[0]instanceof Ye.Box){let o=n[0];this.shapes2face(t.edges,[new Ye.Segment(new Ye.Point(o.xmin,o.ymin),new Ye.Point(o.xmax,o.ymin)),new Ye.Segment(new Ye.Point(o.xmax,o.ymin),new Ye.Point(o.xmax,o.ymax)),new Ye.Segment(new Ye.Point(o.xmax,o.ymax),new Ye.Point(o.xmin,o.ymax)),new Ye.Segment(new Ye.Point(o.xmin,o.ymax),new Ye.Point(o.xmin,o.ymin))])}}n.length===2&&n[0]instanceof Ye.Edge&&n[1]instanceof Ye.Edge&&(this.first=n[0],this.last=n[1],this.last.next=this.first,this.first.prev=this.last,this.setArcLength())}}get edges(){return this.toArray()}get vertices(){return this.edges.map((t)=>t.shape.start.clone())}get shapes(){return this.edges.map((t)=>t.shape.clone())}get box(){if(this._box===void 0){let t=new Ye.Box;for(let n of this)t=t.merge(n.box);this._box=t}return this._box}get perimeter(){return this.last.arc_length+this.last.length}pointAtLength(t){if(t>this.perimeter||t<0)return null;let n=null;for(let o of this)if(t>=o.arc_length&&(o===this.last||t<o.next.arc_length)){n=o.pointAtLength(t-o.arc_length);break}return n}static points2segments(t){let n=[];for(let o=0;o<t.length;o++)t[o].equalTo(t[(o+1)%t.length])||n.push(new Ye.Segment(t[o],t[(o+1)%t.length]));return n}shapes2face(t,n){for(let o of n){let r=new Ye.Edge(o);this.append(r),t.add(r)}}append(t){return super.append(t),this.setOneEdgeArcLength(t),t.face=this,this}insert(t,n){return super.insert(t,n),this.setOneEdgeArcLength(t),t.face=this,this}remove(t){return super.remove(t),this.setArcLength(),this}merge_with_next_edge(t){return t.shape.end.x=t.next.shape.end.x,t.shape.end.y=t.next.shape.end.y,this.remove(t.next),this}reverse(){let t=[],n=this.last;do n.shape=n.shape.reverse(),t.push(n),n=n.prev;while(n!==this.last);this.first=void 0,this.last=void 0;for(let o of t)this.first===void 0?(o.prev=o,o.next=o,this.first=o,this.last=o):(o.prev=this.last,this.last.next=o,this.last=o,this.last.next=this.first,this.first.prev=this.last),this.setOneEdgeArcLength(o);this._orientation!==void 0&&(this._orientation=void 0,this._orientation=this.orientation())}setArcLength(){for(let t of this)this.setOneEdgeArcLength(t),t.face=this}setOneEdgeArcLength(t){t===this.first?t.arc_length=0:t.arc_length=t.prev.arc_length+t.prev.length}area(){return Math.abs(this.signedArea())}signedArea(){let t=0,n=this.box.ymin;for(let o of this)t+=o.shape.definiteIntegral(n);return t}orientation(){if(this._orientation===void 0){let t=this.signedArea();Ye.Utils.EQ_0(t)?this._orientation=Xde.NOT_ORIENTABLE:Ye.Utils.LT(t,0)?this._orientation=Xde.CCW:this._orientation=Xde.CW}return this._orientation}isSimple(t){return e.getSelfIntersections(this,t,!0).length===0}static getSelfIntersections(t,n,o=!1){let r=[];for(let i of t){let s=n.search(i.box);for(let a of s){if(i===a)continue;if(a.face!==t)continue;if(i.shape instanceof Ye.Segment&&a.shape instanceof Ye.Segment&&(i.next===a||i.prev===a))continue;let c=i.shape.intersect(a.shape);for(let l of c)if((!l.equalTo(i.start)||!l.equalTo(a.end)||a!==i.prev)&&(!l.equalTo(i.end)||!l.equalTo(a.start)||a!==i.next)&&(r.push(l),o))break;if(r.length>0&&o)break}if(r.length>0&&o)break}return r}findEdgeByPoint(t){let n;for(let o of this)if(!t.equalTo(o.shape.start)&&(t.equalTo(o.shape.end)||o.shape.contains(t))){n=o;break}return n}toPolygon(){return new Ye.Polygon(this.shapes)}toJSON(){return this.edges.map((t)=>t.toJSON())}svg(){let t=`M${this.first.start.x},${this.first.start.y}`;for(let n of this)t+=n.svg();return t+=" z",t}};Ye.Ray=class e extends PL{constructor(...t){if(super(),this.pt=new Ye.Point,this.norm=new Ye.Vector(0,1),t.length!==0&&(t.length>=1&&t[0]instanceof Ye.Point&&(this.pt=t[0].clone()),t.length!==1)){if(!(t.length===2&&t[1]instanceof Ye.Vector))throw M0.ILLEGAL_PARAMETERS;this.norm=t[1].clone()}}clone(){return new e(this.pt,this.norm)}get slope(){return new Ye.Vector(this.norm.y,-this.norm.x).slope}get box(){let t=this.slope;return new Ye.Box(t>Math.PI/2&&t<3*Math.PI/2?Number.NEGATIVE_INFINITY:this.pt.x,t>=0&&t<=Math.PI?this.pt.y:Number.NEGATIVE_INFINITY,t>=Math.PI/2&&t<=3*Math.PI/2?this.pt.x:Number.POSITIVE_INFINITY,t>=Math.PI&&t<=2*Math.PI||t===0?this.pt.y:Number.POSITIVE_INFINITY)}get start(){return this.pt}get end(){}get length(){return Number.POSITIVE_INFINITY}contains(t){if(this.pt.equalTo(t))return!0;let n=new Ye.Vector(this.pt,t);return Ye.Utils.EQ_0(this.norm.dot(n))&&Ye.Utils.GE(n.cross(this.norm),0)}coord(t){return J8n(t.x,t.y).cross(this.norm)}split(t){return this.contains(t)?this.pt.equalTo(t)?[this]:[new Ye.Segment(this.pt,t),new Ye.Ray(t,this.norm)]:[]}intersect(t){return t instanceof Ye.Point?this.contains(t)?[t]:[]:t instanceof Ye.Segment?mct(this,t):t instanceof Ye.Arc?_ct(this,t):t instanceof Ye.Line?Y8n(this,t):t instanceof Ye.Ray?(o=t,$Z(cL(n=this),cL(o)).filter((s)=>n.contains(s)).filter((s)=>o.contains(s))):t instanceof Ye.Circle?V8n(this,t):t instanceof Ye.Box?(i=t,TZ(cL(r=this),i).filter((s)=>r.contains(s))):t instanceof Ye.Polygon?G8n(this,t):t instanceof Ye.Multiline?qZ(this,t):void 0;var n,o,r,i}rotate(t,n=new Ye.Point){return new Ye.Ray(this.pt.rotate(t,n),this.norm.rotate(t))}transform(t){return new Ye.Ray(this.pt.transform(t),this.norm.clone())}get name(){return"ray"}svg(t,n={}){let o=TZ(new Ye.Line(this.pt,this.norm),t);return o=o.filter((r)=>this.contains(r)),o.length===0||o.length===2?"":new Ye.Segment(this.pt,o[0]).svg(n)}};Ye.ray=(...e)=>new Ye.Ray(...e);var bni=class e{constructor(){this.faces=new Ye.PlanarSet,this.edges=new Ye.PlanarSet;let t=[...arguments];if(t.length===1&&(t[0]instanceof Array&&t[0].length>0||t[0]instanceof Ye.Circle||t[0]instanceof Ye.Box)){let n=t[0];if(t[0]instanceof Array&&t[0].every((o)=>o instanceof Array))if(n.every((o)=>o instanceof Array&&o.length===2&&typeof o[0]=="number"&&typeof o[1]=="number"))this.faces.add(new Ye.Face(this,n));else for(let o of n)if(o instanceof Array&&o[0]instanceof Array&&o[0].every((r)=>r instanceof Array&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"))for(let r of o)this.faces.add(new Ye.Face(this,r));else this.faces.add(new Ye.Face(this,o));else this.faces.add(new Ye.Face(this,n))}}get box(){return[...this.faces].reduce((t,n)=>t.merge(n.box),new Ye.Box)}get vertices(){return[...this.faces].flatMap((t)=>t.vertices)}clone(){let t=new e;for(let n of this.faces)t.addFace(n.shapes);return t}createFromArray(t){let n=new e;return t.forEach((o)=>[...o.faces].forEach((r)=>n.addFace(r.shapes))),n}isEmpty(){return this.edges.size===0||this.faces.size===0}isValid(){let t=!0;for(let n of this.faces)if(!n.isSimple(this.edges)){t=!1;break}return t}area(){let t=[...this.faces].reduce((n,o)=>n+o.signedArea(),0);return Math.abs(t)}addFace(...t){let n=new Ye.Face(this,...t);return this.faces.add(n),n}deleteFace(t){for(let n of t)this.edges.delete(n);return this.faces.delete(t)}recreateFaces(){this.faces.clear();for(let o of this.edges)o.face=null;let t,n=!0;for(;n;){n=!1;for(let o of this.edges)if(o.face===null){t=o,n=!0;break}if(n){let o=t;do o=o.next;while(o.next!==t);this.addFace(t,o)}}}removeChain(t,n,o){if(o.next!==n){for(let r=n;r!==o.next;r=r.next)if(t.remove(r),this.edges.delete(r),t.isEmpty()){this.deleteFace(t);break}}else this.deleteFace(t)}addVertex(t,n){let o=n.shape.split(t);if(o[0]===null)return n.prev;if(o[1]===null)return n;let r=new Ye.Edge(o[0]),i=n.prev;return n.face.insert(r,i),this.edges.delete(n),this.edges.add(r),n.shape=o[1],this.edges.add(n),r}removeEndVertex(t){let n=t.next;n!==t&&(t.face.merge_with_next_edge(t),this.edges.delete(n))}cut(t){let n=this.splitToIslands().flatMap((o)=>o._cutSingleIsland(t)).filter((o)=>o.isValid()&&o.isEmpty()===!1);return this.createFromArray(n)}_cutSingleIsland(t){let n=this.clone(),o=t.clone(),r,i,s={int_points1:[],int_points2:[],int_points1_sorted:[],int_points2_sorted:[]};for(let a of o.edges)for(let c of n.edges){let l=z8n(a,c);for(let h of l)NZ(a,h,s.int_points1),NZ(c,h,s.int_points2)}if(s.int_points1.length===0)return n;s.int_points1_sorted=Uk(s.int_points1),s.int_points2_sorted=Uk(s.int_points2),QZ(o,s.int_points1_sorted),QZ(n,s.int_points2_sorted),gct(s),s.int_points1_sorted=Uk(s.int_points1),s.int_points2_sorted=Uk(s.int_points2),Rit(s.int_points1),Qit(s.int_points1,n);for(let a of s.int_points1_sorted)a.edge_before&&a.edge_after&&a.edge_before.bv===a.edge_after.bv&&(s.int_points2[a.id]=-1,a.id=-1);if(s.int_points1=s.int_points1.filter((a)=>a.id>=0),s.int_points2=s.int_points2.filter((a)=>a.id>=0),s.int_points1.forEach((a,c)=>{a.id=c}),s.int_points2.forEach((a,c)=>{a.id=c}),s.int_points1.length===0)return n;s.int_points1_sorted=Uk(s.int_points1),s.int_points2_sorted=Uk(s.int_points2);for(let a=1;a<s.int_points1_sorted.length;a++)if(i=s.int_points1_sorted[a],r=s.int_points1_sorted[a-1],i.edge_before&&i.edge_before.bv===1){let c=r.edge_after,l=i.edge_before,h=o.getChain(c,l);C1n(s.int_points2[r.id],s.int_points2[i.id],h),h.forEach((d)=>n.edges.add(d)),h=h.reverse().map((d)=>new Ye.Edge(d.shape.reverse()));for(let d=0;d<h.length-1;d++)h[d].next=h[d+1],h[d+1].prev=h[d];C1n(s.int_points2[i.id],s.int_points2[r.id],h),h.forEach((d)=>n.edges.add(d))}return n.recreateFaces(),n}cutWithLine(t){let n=new hG([t]);return this.cut(n)}findEdgeByPoint(t){let n;for(let o of this.faces)if(n=o.findEdgeByPoint(t),n!==void 0)break;return n}splitToIslands(){if(this.isEmpty())return[];let t=this.toArray();t.sort((r,i)=>i.area()-r.area());let n=[...t[0].faces][0].orientation(),o=t.filter((r)=>[...r.faces][0].orientation()===n);for(let r of t){let i=[...r.faces][0];if(i.orientation()!==n){for(let s of o)if(i.shapes.every((a)=>s.contains(a))){s.addFace(i.shapes);break}}}return o}rearrange(){if(this.faces.size<=1)return this.clone();let t=this.splitToIslands(),n=new e;return t.forEach((o)=>{o.faces.forEach((r)=>n.addFace(r.shapes))}),n}orientation(){return this.isEmpty()?Xde.NOT_ORIENTABLE:[...this.faces][0].orientation()}isOuter(t){return t.orientation()===this.orientation()}isMultiPolygon(){let t=0;return this.faces.forEach((n)=>{this.isOuter(n)&&t++}),t>1}reverse(){for(let t of this.faces)t.reverse();return this}contains(t){if(t instanceof Ye.Point){let n=jde(this,t);return n===1||n===2}return q8n(this,t)}distanceTo(t){if(t instanceof Ye.Point){let[n,o]=Ye.Distance.point2polygon(t,this);return o=o.reverse(),[n,o]}if(t instanceof Ye.Circle||t instanceof Ye.Line||t instanceof Ye.Segment||t instanceof Ye.Arc){let[n,o]=Ye.Distance.shape2polygon(t,this);return o=o.reverse(),[n,o]}if(t instanceof Ye.Polygon){let n,o,r=[Number.POSITIVE_INFINITY,new Ye.Segment];for(let i of this.edges){let s=r[0];[n,o]=Ye.Distance.shape2planarSet(i.shape,t.edges,s),Ye.Utils.LT(n,s)&&(r=[n,o])}return r}}intersect(t){return t instanceof Ye.Point?this.contains(t)?[t]:[]:t instanceof Ye.Line?l0e(t,this):t instanceof Ye.Ray?G8n(t,this):t instanceof Ye.Circle?F8n(t,this):t instanceof Ye.Segment?uct(t,this):t instanceof Ye.Arc?pct(t,this):t instanceof Ye.Polygon?function(n,o){let r=[];if(n.isEmpty()||o.isEmpty())return r;if(n.box.not_intersect(o.box))return r;for(let i of n.edges)r=[...r,...x1n(i,o)];return r}(t,this):t instanceof Ye.Multiline?function(n,o){let r=[];if(o.isEmpty()||n.size===0)return r;for(let i of n)r=[...r,...x1n(i,o)];return r}(t,this):void 0}translate(t){let n=new e;for(let o of this.faces)n.addFace(o.shapes.map((r)=>r.translate(t)));return n}rotate(t=0,n=new Ye.Point){let o=new e;for(let r of this.faces)o.addFace(r.shapes.map((i)=>i.rotate(t,n)));return o}scale(t,n){let o=new e;for(let r of this.faces)o.addFace(r.shapes.map((i)=>i.scale(t,n)));return o}transform(t=new Ye.Matrix){let n=new e;for(let o of this.faces)n.addFace(o.shapes.map((r)=>r.transform(t)));return n}toJSON(){return[...this.faces].map((t)=>t.toJSON())}toArray(){return[...this.faces].map((t)=>t.toPolygon())}dpath(){return[...this.faces].reduce((t,n)=>t+n.svg(),"")}svg(t={}){let n=`
<path ${QG({fillRule:"evenodd",fill:"lightcyan",...t})} d="`;for(let o of this.faces)n+=`
${o.svg()}`;return n+=`" >
</path>`,n}};Ye.Polygon=bni;Ye.polygon=(...e)=>new Ye.Polygon(...e);var{Circle:Pot,Line:T1n,Point:D1n,Vector:x9e,Utils:Eot}=Ye;Ye.Inversion=class e{constructor(t){this.circle=t}get inversion_circle(){return this.circle}static inversePoint(t,n){let o=new x9e(t.pc,n),r=t.r*t.r,i=o.dot(o);return Eot.EQ_0(i)?new D1n(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY):t.pc.translate(o.multiply(r/i))}static inverseCircle(t,n){let o=t.pc.distanceTo(n.pc)[0];if(Eot.EQ(o,n.r)){let r=t.r*t.r/(2*n.r),i=new x9e(t.pc,n.pc);i=i.normalize();let s=t.pc.translate(i.multiply(r));return new T1n(s,i)}{let r=new x9e(t.pc,n.pc),i=t.r*t.r/(r.dot(r)-n.r*n.r),s=t.pc.translate(r.multiply(i)),a=Math.abs(i)*n.r;return new Pot(s,a)}}static inverseLine(t,n){let[o,r]=t.pc.distanceTo(n);if(Eot.EQ_0(o))return n.clone();{let i=t.r*t.r/(2*o),s=new x9e(t.pc,r.end);return s=s.multiply(i/o),new Pot(t.pc.translate(s),i)}}inverse(t){return t instanceof D1n?e.inversePoint(this.circle,t):t instanceof Pot?e.inverseCircle(this.circle,t):t instanceof T1n?e.inverseLine(this.circle,t):void 0}};Ye.inversion=(e)=>new Ye.Inversion(e);Ye.Distance=class e{static point2point(t,n){return t.distanceTo(n)}static point2line(t,n){let o=t.projectionOn(n);return[new Ye.Vector(t,o).length,new Ye.Segment(t,o)]}static point2circle(t,n){let[o,r]=t.distanceTo(n.center);if(Ye.Utils.EQ_0(o))return[n.r,new Ye.Segment(t,n.toArc().start)];{let i=Math.abs(o-n.r),s=new Ye.Vector(n.pc,t).normalize().multiply(n.r),a=n.pc.translate(s);return[i,new Ye.Segment(t,a)]}}static point2segment(t,n){if(n.start.equalTo(n.end))return e.point2point(t,n.start);let o,r,i=new Ye.Vector(n.start,n.end),s=new Ye.Vector(n.start,t),a=new Ye.Vector(n.end,t),c=i.dot(s),l=-i.dot(a);if(Ye.Utils.GE(c,0)&&Ye.Utils.GE(l,0)){let h=n.tangentInStart();return o=Math.abs(h.cross(s)),r=n.start.translate(h.multiply(h.dot(s))),[o,new Ye.Segment(t,r)]}return c<0?t.distanceTo(n.start):t.distanceTo(n.end)}static point2arc(t,n){let o,r,i=new Ye.Circle(n.pc,n.r),s=[];return[o,r]=e.point2circle(t,i),r.end.on(n)&&s.push(e.point2circle(t,i)),s.push(e.point2point(t,n.start)),s.push(e.point2point(t,n.end)),e.sort(s),s[0]}static point2edge(t,n){return n.shape instanceof Ye.Segment?e.point2segment(t,n.shape):e.point2arc(t,n.shape)}static segment2line(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Ye.Segment(o[0],o[0])];let r=[];return r.push(e.point2line(t.start,n)),r.push(e.point2line(t.end,n)),e.sort(r),r[0]}static segment2segment(t,n){let o=c8e(t,n);if(o.length>0)return[0,new Ye.Segment(o[0],o[0])];let r,i,s=[];return[r,i]=e.point2segment(n.start,t),s.push([r,i.reverse()]),[r,i]=e.point2segment(n.end,t),s.push([r,i.reverse()]),s.push(e.point2segment(t.start,n)),s.push(e.point2segment(t.end,n)),e.sort(s),s[0]}static segment2circle(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Ye.Segment(o[0],o[0])];let r=new Ye.Line(t.ps,t.pe),[i,s]=e.point2line(n.center,r);if(Ye.Utils.GE(i,n.r)&&s.end.on(t))return e.point2circle(s.end,n);{let[a,c]=e.point2circle(t.start,n),[l,h]=e.point2circle(t.end,n);return Ye.Utils.LT(a,l)?[a,c]:[l,h]}}static segment2arc(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Ye.Segment(o[0],o[0])];let r=new Ye.Line(t.ps,t.pe),i=new Ye.Circle(n.pc,n.r),[s,a]=e.point2line(i.center,r);if(Ye.Utils.GE(s,i.r)&&a.end.on(t)){let[d,u]=e.point2circle(a.end,i);if(u.end.on(n))return[d,u]}let c,l,h=[];return h.push(e.point2arc(t.start,n)),h.push(e.point2arc(t.end,n)),[c,l]=e.point2segment(n.start,t),h.push([c,l.reverse()]),[c,l]=e.point2segment(n.end,t),h.push([c,l.reverse()]),e.sort(h),h[0]}static circle2circle(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Ye.Segment(o[0],o[0])];if(t.center.equalTo(n.center)){let r=t.toArc(),i=n.toArc();return e.point2point(r.start,i.start)}{let r=new Ye.Line(t.center,n.center),i=r.intersect(t),s=r.intersect(n),a=[];return a.push(e.point2point(i[0],s[0])),a.push(e.point2point(i[0],s[1])),a.push(e.point2point(i[1],s[0])),a.push(e.point2point(i[1],s[1])),e.sort(a),a[0]}}static circle2line(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Ye.Segment(o[0],o[0])];let[r,i]=e.point2line(t.center,n),[s,a]=e.point2circle(i.end,t);return a=a.reverse(),[s,a]}static arc2line(t,n){let o=n.intersect(t);if(o.length>0)return[0,new Ye.Segment(o[0],o[0])];let r=new Ye.Circle(t.center,t.r),[i,s]=e.point2line(r.center,n);if(!Ye.Utils.GE(i,r.r)){let a=[];return a.push(e.point2line(t.start,n)),a.push(e.point2line(t.end,n)),e.sort(a),a[0]}{let[a,c]=e.point2circle(s.end,r);if(c.end.on(t))return[a,c]}}static arc2circle(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Ye.Segment(o[0],o[0])];let r=new Ye.Circle(t.center,t.r),[i,s]=e.circle2circle(r,n);if(s.start.on(t))return[i,s];{let a=[];return a.push(e.point2circle(t.start,n)),a.push(e.point2circle(t.end,n)),e.sort(a),a[0]}}static arc2arc(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Ye.Segment(o[0],o[0])];let r=new Ye.Circle(t.center,t.r),i=new Ye.Circle(n.center,n.r),[s,a]=e.circle2circle(r,i);if(a.start.on(t)&&a.end.on(n))return[s,a];{let c,l,h=[];return[c,l]=e.point2arc(t.start,n),l.end.on(n)&&h.push([c,l]),[c,l]=e.point2arc(t.end,n),l.end.on(n)&&h.push([c,l]),[c,l]=e.point2arc(n.start,t),l.end.on(t)&&h.push([c,l.reverse()]),[c,l]=e.point2arc(n.end,t),l.end.on(t)&&h.push([c,l.reverse()]),[c,l]=e.point2point(t.start,n.start),h.push([c,l]),[c,l]=e.point2point(t.start,n.end),h.push([c,l]),[c,l]=e.point2point(t.end,n.start),h.push([c,l]),[c,l]=e.point2point(t.end,n.end),h.push([c,l]),e.sort(h),h[0]}}static point2polygon(t,n){let o=[Number.POSITIVE_INFINITY,new Ye.Segment];for(let r of n.edges){let[i,s]=e.point2edge(t,r);Ye.Utils.LT(i,o[0])&&(o=[i,s])}return o}static shape2polygon(t,n){let o=[Number.POSITIVE_INFINITY,new Ye.Segment];for(let r of n.edges){let[i,s]=t.distanceTo(r.shape);Ye.Utils.LT(i,o[0])&&(o=[i,s])}return o}static polygon2polygon(t,n){let o=[Number.POSITIVE_INFINITY,new Ye.Segment];for(let r of t.edges)for(let i of n.edges){let[s,a]=r.shape.distanceTo(i.shape);Ye.Utils.LT(s,o[0])&&(o=[s,a])}return o}static box2box_minmax(t,n){let o=Math.max(Math.max(t.xmin-n.xmax,0),Math.max(n.xmin-t.xmax,0)),r=Math.max(Math.max(t.ymin-n.ymax,0),Math.max(n.ymin-t.ymax,0)),i=o*o+r*r,s=t.merge(n),a=s.xmax-s.xmin,c=s.ymax-s.ymin;return[i,a*a+c*c]}static minmax_tree_process_level(t,n,o,r){let i,s;for(let c of n){[i,s]=e.box2box_minmax(t.box,c.item.key);for(let l of c.item.values)l instanceof Ye.Edge?r.insert([i,s],l.shape):r.insert([i,s],l);Ye.Utils.LT(s,o)&&(o=s)}if(n.length===0)return o;let a=[...n.map((c)=>c.left.isNil()?void 0:c.left).filter((c)=>c!==void 0),...n.map((c)=>c.right.isNil()?void 0:c.right).filter((c)=>c!==void 0)].filter((c)=>{let[l,h]=e.box2box_minmax(t.box,c.max);return Ye.Utils.LE(l,o)});return o=e.minmax_tree_process_level(t,a,o,r)}static minmax_tree(t,n,o){let r=new Oit,i=[n.index.root],s=o<Number.POSITIVE_INFINITY?o*o:Number.POSITIVE_INFINITY;return s=e.minmax_tree_process_level(t,i,s,r),r}static minmax_tree_calc_distance(t,n,o){let r,i;if(n!=null&&!n.isNil()){if([r,i]=e.minmax_tree_calc_distance(t,n.left,o),i)return[r,i];if(Ye.Utils.LT(r[0],Math.sqrt(n.item.key.low)))return[r,!0];let[s,a]=e.distanceToArray(t,n.item.values);return Ye.Utils.LT(s,r[0])&&(r=[s,a]),[r,i]=e.minmax_tree_calc_distance(t,n.right,r),[r,i]}return[o,!1]}static shape2planarSet(t,n,o=Number.POSITIVE_INFINITY){let r=[o,new Ye.Segment],i=!1;if(n instanceof Ye.PlanarSet){let s=e.minmax_tree(t,n,o);[r,i]=e.minmax_tree_calc_distance(t,s.root,r)}return r}static sort(t){t.sort((n,o)=>Ye.Utils.LT(n[0],o[0])?-1:Ye.Utils.GT(n[0],o[0])?1:0)}static distance(t,n){return t.distanceTo(n)}static distanceToArray(t,n){let o=[Number.POSITIVE_INFINITY,new Ye.Segment];for(let r of n){let[i,s]=t.distanceTo(r);Ye.Utils.LT(i,o[0])&&(o=[i,s])}return o}static shape2multiline(t,n){let o=[Number.POSITIVE_INFINITY,new Ye.Segment];for(let r of n){let[i,s]=e.distance(t,r.shape);Ye.Utils.LT(i,o[0])&&(o=[i,s])}return o}static multiline2multiline(t,n){let o=[Number.POSITIVE_INFINITY,new Ye.Segment];for(let r of t)for(let i of n){let[s,a]=e.distance(r.shape,i.shape);Ye.Utils.LT(s,o[0])&&(o=[s,a])}return o}};var{Multiline:Ini,Point:Z8n,Segment:vni,Polygon:e7n}=Ye;function Vit(e){return new Z8n(e.split(" ").map(Number))}function t7n(e){return e.split(", ").map(Vit)}function Mot(e){let t=t7n(e),n=[];for(let o=0;o<t.length-1;o++)n.push(new vni(t[o],t[o+1]));return new Ini(n)}function N1n(e){let t=e.replace(/\(\(/,"").replace(/\)\)$/,"").split("), ("),n=new e7n,o;return t.forEach((r,i)=>{let s=r.split(", ").map((c)=>new Z8n(c.split(" ").map(Number))),a=n.addFace(s);i===0?o=a.orientation():a.orientation()===o&&a.reverse()}),n}function Sni(e){if(e.startsWith("POLYGON"))return N1n(e.replace(/^POLYGON /,""));return function(t){let n=t.split(/\)\), \(\(/).map((r)=>"(("+r+"))").map(N1n),o=new e7n;return n.reduce((r,i)=>[...r,...i?.faces],[]).forEach((r)=>o.addFace([...r?.shapes])),o}(e.replace(/^MULTIPOLYGON \(\(\((.*)\)\)\)$/,"$1"))}function R1n(e){return e.split(`
`)?.every((t)=>t.includes("POINT"))}function Q1n(e){return e.split(`
`)?.every((t)=>t.includes("LINESTRING"))}Ye.isWktString=function(e){return e.startsWith("POINT")||R1n(e)||e.startsWith("LINESTRING")||Q1n(e)||e.startsWith("MULTILINESTRING")||e.startsWith("POLYGON")||e.startsWith("MULTIPOINT")||e.startsWith("MULTIPOLYGON")||e.startsWith("GEOMETRYCOLLECTION")},Ye.parseWKT=function e(t){if(t.startsWith("POINT"))return Vit(t.replace(/^POINT \(/,"").replace(/\)$/,""));if(t.startsWith("MULTIPOINT"))return t7n(t.replace(/^MULTIPOINT \(/,"").replace(/\)$/,""));if(t.startsWith("LINESTRING"))return Mot(t.replace(/^LINESTRING \(/,"").replace(/\)$/,""));if(t.startsWith("MULTILINESTRING"))return function(n){return n.replace(/\(\(/,"").replace(/\)\)$/,"").split("), (").map(Mot)}(t.replace(/^MULTILINESTRING /,""));if(t.startsWith("POLYGON")||t.startsWith("MULTIPOLYGON"))return Sni(t);if(t.startsWith("GEOMETRYCOLLECTION")){let n=/(?<type>POINT|LINESTRING|POLYGON|MULTIPOINT|MULTILINESTRING|MULTIPOLYGON) \((?:[^\(\)]|\([^\)]*\))*\)/g,o=t.match(n);return o[0].startsWith("GEOMETRYCOLLECTION")&&(o[0]=o[0].replace("GEOMETRYCOLLECTION (","")),o.map(e).map((r)=>r instanceof Array?r:[r]).reduce((r,i)=>[...r,...i],[])}return R1n(t)?function(n){return n.split(`
`).map((o)=>o.match(/\(([^)]+)\)/)[1]).map(Vit)}(t):Q1n(t)?function(n){return n.split(`
`).map((o)=>o.match(/\(([^)]+)\)/)[1]).map(Mot).reduce((o,r)=>[...o,...r],[])}(t):[]},Ye.BooleanOperations=cni,Ye.Relations=mni;var Ora={DISTANCE_TO_COST:0.05,RIP_THRESHOLD_RAMP_ATTEMPTS:16,RIP_CONGESTION_REGION_COST_FACTOR:0.1,MAX_ITERATIONS:50000,MAX_RIPS_WITHOUT_MAX_REGION_COST_IMPROVEMENT:6,EXTRA_RIPS_AFTER_BEATING_BASELINE_MAX_REGION_COST:Number.POSITIVE_INFINITY};new Int32Array(0);var Vra={DISTANCE_TO_COST:0.05,RIP_THRESHOLD_START:0.05,RIP_THRESHOLD_END:0.8,RIP_CONGESTION_REGION_COST_FACTOR:0.1,ACCEPT_BEST_SOLUTION_ON_TIMEOUT:!0,GREEDY_FINAL_ROUTE_ITERS:4,MAX_RIPS_WITHOUT_MAX_REGION_COST_IMPROVEMENT:6,EXTRA_RIPS_AFTER_BEATING_BASELINE_MAX_REGION_COST:Number.POSITIVE_INFINITY},Yra=Math.PI/2,Pni=0.1,Eni=0.15,Mni=Pni+Eni,Gra=3*Mni/4,Ura=dit(rKr(),1),Wra=(Number.POSITIVE_INFINITY,0.000000001),Xra=(new Int32Array(0),(e)=>(e.ccwRotationDegrees??0)*Math.PI/180),l7e=class e{static generators=new Map;static register(t){e.generators.set(t.componentKind,t)}static create(t){let n=t.detectedComponent.componentKind,o=e.generators.get(n);if(!o)throw Error(`No topology generator registered for component kind "${n}"`);return new o(t)}},Due=(e)=>[e.obstacle.obstacleId??e.obstacle.componentId??"obstacle",e.start.x.toFixed(4),e.start.y.toFixed(4),e.end.x.toFixed(4),e.end.y.toFixed(4),e.expansionDirection.x,e.expansionDirection.y].join(":"),n7n=(e)=>{let t=0;for(let n of e)t=31*t+n.charCodeAt(0)>>>0;return t},F_=(e,t)=>`hsla(${n7n(Due(e))%360},72%,36%,${t})`,Nue=(e)=>{let t=e.expansionDirection;return t.x<0?"left":t.x>0?"right":t.y<0?"bottom":"top"},QP=(e)=>({x:(e.start.x+e.end.x)/2,y:(e.start.y+e.end.y)/2}),Yit=(e)=>{let t=/^bga-gapfill-(\d+)-/.exec(e.capacityMeshNodeId);return t?Number.parseInt(t[1],10):null},k1n=(e,t)=>{let n=QP(e),o=QP(t),r=n.y-o.y;if(Math.abs(r)>0.000001)return r;let i=n.x-o.x;return Math.abs(i)>0.000001?i:Due(e).localeCompare(Due(t))},h8e=(e)=>{let t=[...e].sort(k1n),n=[],o=t.shift();for(;o&&(n.push(o),t.length!==0);){let r=QP(o),i=0,s=Number.POSITIVE_INFINITY;for(let a=0;a<t.length;a++){let c=t[a],l=QP(c),h=(l.x-r.x)**2+(l.y-r.y)**2;h<s-0.000000001?(s=h,i=a):Math.abs(h-s)<=0.000000001&&k1n(c,t[i])<0&&(i=a)}o=t.splice(i,1)[0]}return n},Pv=(e,t)=>{let n=Due(e),o=t.findIndex((r)=>Due(r)===n);return o>=0?`E${o+1}`:`E${n7n(n).toString(36).slice(0,4)}`},Git=(e)=>e.flatMap((t)=>{let n=Jm(t);return[{obstacle:t,start:{x:n.minX,y:n.minY},end:{x:n.minX,y:n.maxY},expansionDirection:{x:-1,y:0}},{obstacle:t,start:{x:n.maxX,y:n.minY},end:{x:n.maxX,y:n.maxY},expansionDirection:{x:1,y:0}},{obstacle:t,start:{x:n.minX,y:n.minY},end:{x:n.maxX,y:n.minY},expansionDirection:{x:0,y:-1}},{obstacle:t,start:{x:n.minX,y:n.maxY},end:{x:n.maxX,y:n.maxY},expansionDirection:{x:0,y:1}}]}),QY=0.001,C9e=0.001,wni=class extends mT{constructor(e){super(),this.inputProblem=e}inputProblem;meshIndex;allEdges=[];queueEdges=[];disconnectedEdges=[];currentEdge=null;lastSearchBounds=null;lastCandidateMeshNodes=[];lastMatchedMeshNode=null;_setup(){let e=Math.max(this.inputProblem.meshNodes.length,1);this.meshIndex=new Sbn(e);for(let n of this.inputProblem.meshNodes){let o=Jm(n);this.meshIndex.add(o.minX,o.minY,o.maxX,o.maxY)}this.meshIndex.finish();let t=Git(this.inputProblem.unmarkedComponentObstacles);this.queueEdges=t,this.allEdges=h8e(t),this.currentEdge=null,this.lastSearchBounds=null,this.lastCandidateMeshNodes=[],this.lastMatchedMeshNode=null}_step(){let e=this.queueEdges.shift();if(!e)return this.currentEdge=null,this.lastSearchBounds=null,this.lastCandidateMeshNodes=[],this.lastMatchedMeshNode=null,void(this.solved=!0);this.currentEdge=e,this.lastMatchedMeshNode=null;let t=Math.abs(e.start.x-e.end.x)<=QY,n=t?{minX:e.start.x-C9e,maxX:e.start.x+C9e,minY:Math.min(e.start.y,e.end.y),maxY:Math.max(e.start.y,e.end.y)}:{minX:Math.min(e.start.x,e.end.x),maxX:Math.max(e.start.x,e.end.x),minY:e.start.y-C9e,maxY:e.start.y+C9e};this.lastSearchBounds=n;let o=this.meshIndex.search(n.minX,n.minY,n.maxX,n.maxY);this.lastCandidateMeshNodes=o.map((i)=>this.inputProblem.meshNodes[i]);let r=!1;for(let i of o){let s=this.inputProblem.meshNodes[i],a=Jm(s);if(t){if(!(Math.min(a.maxY,Math.max(e.start.y,e.end.y))-Math.max(a.minY,Math.min(e.start.y,e.end.y))>QY))continue;if(e.expansionDirection.x===-1&&Math.abs(a.maxX-e.start.x)<=QY){r=!0,this.lastMatchedMeshNode=s;break}if(e.expansionDirection.x===1&&Math.abs(a.minX-e.start.x)<=QY){r=!0,this.lastMatchedMeshNode=s;break}continue}if(Math.min(a.maxX,Math.max(e.start.x,e.end.x))-Math.max(a.minX,Math.min(e.start.x,e.end.x))>QY){if(e.expansionDirection.y===-1&&Math.abs(a.maxY-e.start.y)<=QY){r=!0,this.lastMatchedMeshNode=s;break}if(e.expansionDirection.y===1&&Math.abs(a.minY-e.start.y)<=QY){r=!0,this.lastMatchedMeshNode=s;break}}}r||this.disconnectedEdges.push(e)}getOutput(){return this.disconnectedEdges}visualize(){let e=this.disconnectedEdges,t=this.allEdges.length>0?this.allEdges:[...e,...this.currentEdge?[this.currentEdge]:[]],n=this.currentEdge?F_(this.currentEdge,0.88):"rgba(40,40,40,0.4)",o=this.inputProblem.meshNodes.map((d)=>({...hT(d,{rectMargin:0.01}),fill:d._containsObstacle?"rgba(120,120,120,0.18)":"rgba(120,120,120,0.08)",stroke:d._containsObstacle?"rgba(120,120,120,0.42)":"rgba(120,120,120,0.24)"})),r=this.lastSearchBounds&&this.currentEdge?[{center:(i=this.lastSearchBounds,{x:(i.minX+i.maxX)/2,y:(i.minY+i.maxY)/2}),width:this.lastSearchBounds.maxX-this.lastSearchBounds.minX,height:this.lastSearchBounds.maxY-this.lastSearchBounds.minY,fill:F_(this.currentEdge,0.1),stroke:F_(this.currentEdge,0.36),label:[Pv(this.currentEdge,t),"search band"].join(" ")}]:[];var i;let s=this.lastCandidateMeshNodes.map((d)=>({...hT(d,{rectMargin:0.018}),fill:d===this.lastMatchedMeshNode?"rgba(0,180,90,0.24)":this.currentEdge?F_(this.currentEdge,0.16):"rgba(80,120,160,0.16)",stroke:d===this.lastMatchedMeshNode?"rgba(0,150,80,0.88)":n,label:[d===this.lastMatchedMeshNode?"matched":"candidate",d.capacityMeshNodeId,`z:${d.availableZ.join(",")}`].join(`
`)})),a=this.inputProblem.unmarkedComponentObstacles.map((d)=>({center:d.center,width:d.width,height:d.height,fill:"rgba(160,160,160,0.10)",stroke:"rgba(160,160,160,0.40)",label:d.obstacleId??d.componentId??"obstacle"})),c=e.map((d)=>({points:[d.start,d.end],strokeColor:F_(d,0.14),strokeWidth:0.01,strokeDash:"5 4",label:[Pv(d,t),Nue(d),"disconnected"].join(" ")})),l=[],h=[];if(this.currentEdge){let d=QP(this.currentEdge);l.push({points:[this.currentEdge.start,this.currentEdge.end],strokeColor:F_(this.currentEdge,1),strokeWidth:0.06,label:[Pv(this.currentEdge,t),Nue(this.currentEdge),"checking"].join(" ")},{points:[d,{x:d.x+0.16*this.currentEdge.expansionDirection.x,y:d.y+0.16*this.currentEdge.expansionDirection.y}],strokeColor:F_(this.currentEdge,0.82),strokeWidth:0.02,strokeDash:"3 3"}),h.push({...d,color:F_(this.currentEdge,1),label:Pv(this.currentEdge,t)})}return{rects:[...o,...r,...s,...a],lines:[...c,...l],points:h}}},Dk=0.001,Nk=0.001,b9e=0.000001,Bni=class extends mT{constructor(e){super(),this.inputProblem=e}inputProblem;meshIndex;meshBounds;expandedNodes=[];_setup(){let e=Math.max(this.inputProblem.meshNodes.length,1);this.meshIndex=new Sbn(e);let{POSITIVE_INFINITY:t,NEGATIVE_INFINITY:n,POSITIVE_INFINITY:o,NEGATIVE_INFINITY:r}=Number;for(let i of this.inputProblem.meshNodes){let s=Jm(i);this.meshIndex.add(s.minX,s.minY,s.maxX,s.maxY),t=Math.min(t,s.minX),n=Math.max(n,s.maxX),o=Math.min(o,s.minY),r=Math.max(r,s.maxY)}this.meshIndex.finish(),this.meshBounds=this.inputProblem.meshNodes.length?{minX:t,maxX:n,minY:o,maxY:r}:{minX:0,maxX:0,minY:0,maxY:0}}getObstacleAvailableZ(e){return e.__zLayers??e.layers.map((t)=>FP(t,this.inputProblem.layerCount))}getSharedOverlapArea(e,t){if(!e.availableZ.some((s)=>t.availableZ.includes(s)))return 0;let n=Jm(e),o=Jm(t),r=Math.min(n.maxX,o.maxX)-Math.max(n.minX,o.minX),i=Math.min(n.maxY,o.maxY)-Math.max(n.minY,o.minY);return r<=b9e||i<=b9e?0:r*i}getNodeObstacleOverlapArea(e,t){let n=this.getObstacleAvailableZ(t);if(!e.availableZ.some((a)=>n.includes(a)))return 0;let o=Jm(e),r=Jm(t),i=Math.min(o.maxX,r.maxX)-Math.max(o.minX,r.minX),s=Math.min(o.maxY,r.maxY)-Math.max(o.minY,r.minY);return i<=b9e||s<=b9e?0:i*s}getClosestMeshNode(e,t){let n=Math.abs(e.start.x-e.end.x)<=Dk,o=this.getObstacleAvailableZ(e.obstacle),r=n?e.expansionDirection.x<0?{minX:this.meshBounds.minX,maxX:e.start.x,minY:Math.min(e.start.y,e.end.y)-Nk,maxY:Math.max(e.start.y,e.end.y)+Nk}:{minX:e.start.x,maxX:this.meshBounds.maxX,minY:Math.min(e.start.y,e.end.y)-Nk,maxY:Math.max(e.start.y,e.end.y)+Nk}:e.expansionDirection.y<0?{minX:Math.min(e.start.x,e.end.x)-Nk,maxX:Math.max(e.start.x,e.end.x)+Nk,minY:this.meshBounds.minY,maxY:e.start.y}:{minX:Math.min(e.start.x,e.end.x)-Nk,maxX:Math.max(e.start.x,e.end.x)+Nk,minY:e.start.y,maxY:this.meshBounds.maxY},i=this.meshIndex.search(r.minX,r.minY,r.maxX,r.maxY),s=null,a=Number.POSITIVE_INFINITY,c=[...i.map((l)=>this.inputProblem.meshNodes[l]),...t];for(let l of c){if(l._containsObstacle)continue;if(!l.availableZ.some((u)=>o.includes(u)))continue;let h=Jm(l);if((n?Math.min(Math.max(e.start.y,e.end.y),h.maxY)-Math.max(Math.min(e.start.y,e.end.y),h.minY):Math.min(Math.max(e.start.x,e.end.x),h.maxX)-Math.max(Math.min(e.start.x,e.end.x),h.minX))<=Dk)continue;let d=n?e.expansionDirection.x<0?e.start.x-h.maxX:h.minX-e.start.x:e.expansionDirection.y<0?e.start.y-h.maxY:h.minY-e.start.y;d<Dk||(d>=a||(a=d,s=l))}return s}createExpandedNode(e,t,n){let o=Jm(t),r=this.getObstacleAvailableZ(e.obstacle);if(Math.abs(e.start.x-e.end.x)<=Dk){let l=Math.max(Math.min(e.start.y,e.end.y),o.minY),h=Math.min(Math.max(e.start.y,e.end.y),o.maxY),d=e.expansionDirection.x<0?o.maxX:e.start.x,u=e.expansionDirection.x<0?e.start.x:o.minX;return u-d<=Dk||h-l<=Dk?null:{capacityMeshNodeId:`bga-gapfill-${n}-${e.obstacle.obstacleId??"no-obstacle"}-${t.capacityMeshNodeId}`,center:{x:(d+u)/2,y:(l+h)/2},width:u-d,height:h-l,layer:`z${r.join(",")}`,availableZ:r}}let i=Math.max(Math.min(e.start.x,e.end.x),o.minX),s=Math.min(Math.max(e.start.x,e.end.x),o.maxX),a=e.expansionDirection.y<0?o.maxY:e.start.y,c=e.expansionDirection.y<0?e.start.y:o.minY;return s-i<=Dk||c-a<=Dk?null:{capacityMeshNodeId:`bga-gapfill-${n}-${e.obstacle.obstacleId??"no-obstacle"}-${t.capacityMeshNodeId}`,center:{x:(i+s)/2,y:(a+c)/2},width:s-i,height:c-a,layer:`z${r.join(",")}`,availableZ:r}}overlapsExistingGeometry(e,t){for(let n of this.inputProblem.meshNodes)if(this.getSharedOverlapArea(e,n)>0)return!0;for(let n of t)if(this.getSharedOverlapArea(e,n)>0)return!0;for(let n of this.inputProblem.edgesWithObstacle)if(this.getNodeObstacleOverlapArea(e,n.obstacle)>0)return!0;return!1}_step(){let e=[];for(let[t,n]of this.inputProblem.edgesWithObstacle.entries()){let o=this.getClosestMeshNode(n,e);if(!o)continue;let r=this.createExpandedNode(n,o,t);r&&(this.overlapsExistingGeometry(r,e)||e.push(r))}this.expandedNodes=e,this.solved=!0}getOutput(){return this.expandedNodes}visualize(){let e=this.inputProblem.edgesWithObstacle,t=h8e(e);return{rects:[...this.inputProblem.meshNodes.map((n)=>({...hT(n,{rectMargin:0.01}),fill:n._containsObstacle?"rgba(255,0,0,0.16)":"rgba(0,120,255,0.08)",stroke:n._containsObstacle?"rgba(255,0,0,0.35)":"rgba(0,120,255,0.28)"})),...this.expandedNodes.map((n)=>{let o=Yit(n),r=o===null?null:e[o]??null;return{...hT(n,{rectMargin:0.012,zOffset:0.01}),fill:r?F_(r,0.24):"rgba(0,160,100,0.24)",stroke:r?F_(r,0.72):"rgba(0,160,100,0.68)",label:[r?Pv(r,t):"E?","expanded",n.capacityMeshNodeId,`z:${n.availableZ.join(",")}`].join(`
`)}})],lines:[...this.inputProblem.edgesWithObstacle.map((n)=>({points:[n.start,n.end],strokeColor:F_(n,0.9),strokeWidth:0.034,label:[Pv(n,t),Nue(n)].join(" ")})),...this.inputProblem.edgesWithObstacle.map((n)=>{let o=QP(n);return{points:[o,{x:o.x+0.16*n.expansionDirection.x,y:o.y+0.16*n.expansionDirection.y}],strokeColor:F_(n,0.7),strokeWidth:0.016,strokeDash:"3 3"}})],points:this.inputProblem.edgesWithObstacle.map((n)=>({...QP(n),color:F_(n,0.95),label:Pv(n,t)}))}}},kY=0.001,Tni=class extends vbn{constructor(e){super(e),this.inputProblem=e}inputProblem;detectEdgesNotConnectedToMesh;expandUnconnectedEdgesToMesh;pipelineDef=[nZ("detectEdgesNotConnectedToMesh",wni,(e)=>[e.inputProblem]),nZ("expandUnconnectedEdgesToMesh",Bni,(e)=>[{meshNodes:e.inputProblem.meshNodes,edgesWithObstacle:e.detectEdgesNotConnectedToMesh.getOutput(),layerCount:e.inputProblem.layerCount}])];getOutput(){return[...this.inputProblem.meshNodes,...this.expandUnconnectedEdgesToMesh.getOutput()]}getExpandedNodes(){return this.expandUnconnectedEdgesToMesh.getOutput()}getObstacleLayer(e){return`z${(e.obstacle.__zLayers??e.obstacle.layers.map((t)=>FP(t,this.inputProblem.layerCount))).join(",")}`}getObstacleRects(){return this.inputProblem.unmarkedComponentObstacles.map((e)=>{let t=e.__zLayers??e.layers.map((n)=>FP(n,this.inputProblem.layerCount));return{center:e.center,width:e.width,height:e.height,fill:"rgba(150,150,150,0.08)",stroke:"rgba(90,90,90,0.42)",label:e.obstacleId??e.componentId??"bga obstacle",layer:`z${t.join(",")}`}})}getBaseMeshRects(){return this.inputProblem.meshNodes.map((e)=>({...hT(e,{rectMargin:0.025,zOffset:0.01}),fill:e._containsObstacle?"rgba(210,60,60,0.14)":"rgba(80,120,160,0.08)",stroke:e._containsObstacle?"rgba(190,40,40,0.42)":"rgba(80,120,160,0.28)",label:`mesh ${e.capacityMeshNodeId}
z:${e.availableZ.join(",")}`}))}initialVisualize(){let e=Git(this.inputProblem.unmarkedComponentObstacles),t=h8e(e),n=[...e.map((o)=>({points:[o.start,o.end],strokeColor:F_(o,0.72),strokeWidth:0.018,strokeDash:"0.05 0.035",layer:this.getObstacleLayer(o),label:[Pv(o,t),Nue(o)].join(" ")})),...e.map((o)=>{let r=QP(o);return{points:[r,{x:r.x+0.18*o.expansionDirection.x,y:r.y+0.18*o.expansionDirection.y}],strokeColor:F_(o,0.64),strokeWidth:0.012,strokeDash:"0.035 0.025",layer:this.getObstacleLayer(o)}})];return{title:"BGA GapFill: candidate obstacle edges",rects:[...this.getBaseMeshRects(),...this.getObstacleRects()],lines:n}}finalVisualize(){let e=this.getStageOutput("detectEdgesNotConnectedToMesh")??[],t=this.getStageOutput("expandUnconnectedEdgesToMesh")??[],n=h8e(Git(this.inputProblem.unmarkedComponentObstacles)),o=new Map;for(let c of t){let l=Yit(c);l!==null&&o.set(l,c)}let r=t.map((c)=>{let l=Yit(c),h=l===null?null:e[l]??null,d=h?(({expandedNode:p,edge:m,meshNodes:A})=>{let g=Jm(p),f=Math.abs(m.start.x-m.end.x)<=kY;return A.filter((y)=>{if(y._containsObstacle)return!1;if(!p.availableZ.some((C)=>y.availableZ.includes(C)))return!1;let x=Jm(y);return f?!(Math.min(g.maxY,x.maxY)-Math.max(g.minY,x.minY)<=kY)&&(m.expansionDirection.x<0?Math.abs(x.maxX-g.minX)<=kY:Math.abs(x.minX-g.maxX)<=kY):!(Math.min(g.maxX,x.maxX)-Math.max(g.minX,x.minX)<=kY)&&(m.expansionDirection.y<0?Math.abs(x.maxY-g.minY)<=kY:Math.abs(x.minY-g.maxY)<=kY)}).map((y)=>y.capacityMeshNodeId)})({expandedNode:c,edge:h,meshNodes:this.inputProblem.meshNodes}):[],u=h?Pv(h,n):"E?",_=h===null?"rgba(0,160,100,0.72)":F_(h,0.72);return{...hT(c,{rectMargin:0.012,zOffset:0.01}),fill:h===null?"rgba(0,160,100,0.24)":F_(h,0.16),stroke:_,label:[`${u} gap fill`,d.length>0?`to ${d.join(",")}`:"target mesh not adjacent",`z:${c.availableZ.join(",")}`].join(`
`)}}),i=e.map((c,l)=>{let h=o.get(l);return{points:[c.start,c.end],strokeColor:h?F_(c,0.68):"rgba(80,80,80,0.14)",strokeWidth:h?0.026:0.008,...h?{}:{strokeDash:"5 4"},layer:this.getObstacleLayer(c),label:[[Pv(c,n),Nue(c)].join(" "),h?"filled":"no fill created"].join(`
`)}}),s=e.flatMap((c,l)=>{let h=QP(c),d=o.get(l);return d?[{points:[h,d.center],strokeColor:F_(c,0.42),strokeWidth:0.012,strokeDash:"0.035 0.025",layer:this.getObstacleLayer(c)}]:[]}),a=e.flatMap((c,l)=>o.has(l)?[{...QP(c),color:F_(c,0.82),label:Pv(c,n),layer:this.getObstacleLayer(c)}]:[]);return{title:"BGA GapFill: disconnected edges and created mesh",rects:[...this.getBaseMeshRects(),...this.getObstacleRects(),...r],lines:[...i,...s],points:a}}};function L1n(e,t){let n=[];for(let o=0;o<e.length;o++){let r=e[o];n.push(r);let i=e[o+1];if(i===void 0)continue;let s=Math.round((i-r)/t);if(!(s<=1))for(let a=1;a<s;a++){let c=a/s;n.push(Number((r+(i-r)*c).toFixed(6)))}}return n}var KJ=0.001;function H1n(e){let t=[];for(let i=1;i<e.length;i++){let s=e[i]-e[i-1];s>KJ&&t.push(s)}if(t.length===0)return null;let n=Math.min(...t),o=t.filter((i)=>i<=1.5*n).sort((i,s)=>i-s),r=Math.floor(o.length/2);return o.length%2==0?(o[r-1]+o[r])/2:o[r]}function F1n(e){return[...new Set(e)].sort((t,n)=>t-n)}function I9e(e){return Number(e.toFixed(6))}var Dni=class e{static fromObstacles(t){if(t.length===0)return null;let n=F1n(t.map((s)=>s.center.x)),o=F1n(t.map((s)=>s.center.y)),r=H1n(n),i=H1n(o);return r===null||i===null?null:new e({obstacles:t,xCoordinates:L1n(n,r),yCoordinates:L1n(o,i),pitchX:r,pitchY:i})}xCoordinates;yCoordinates;pitchX;pitchY;originX;originY;rowCount;colCount;padWidth;padHeight;slots=new Map;constructor(t){this.xCoordinates=t.xCoordinates,this.yCoordinates=t.yCoordinates,this.pitchX=t.pitchX,this.pitchY=t.pitchY,this.originX=this.xCoordinates[0],this.originY=this.yCoordinates[0],this.colCount=this.xCoordinates.length,this.rowCount=this.yCoordinates.length,this.padWidth=t.obstacles[0].width,this.padHeight=t.obstacles[0].height;for(let n of t.obstacles){let o=this.getSlotForObstacle(n);o&&this.slots.set(this.getSlotKey(o.row,o.col),{...o,obstacle:n})}}getSlotKey(t,n){return`${t}:${n}`}getAxisIndex(t,n){let o=-1,r=Number.POSITIVE_INFINITY;for(let i=0;i<t.length;i++){let s=Math.abs(t[i]-n);s<r&&(r=s,o=i)}return r<=KJ?o:null}getAxisCoordinate(t,n){return t[n]}hasPadAt(t,n){return this.slots.has(this.getSlotKey(t,n))}getSlotForObstacle(t){let n=this.getAxisIndex(this.yCoordinates,t.center.y),o=this.getAxisIndex(this.xCoordinates,t.center.x);return n===null||o===null||n<0||n>=this.rowCount||o<0||o>=this.colCount?null:{row:n,col:o}}getSlotCenter(t,n){return{x:this.getAxisCoordinate(this.xCoordinates,n),y:this.getAxisCoordinate(this.yCoordinates,t)}}getHorizontalGap(t,n){let o=this.getSlotCenter(t,n),r=this.getSlotCenter(t,n+1),i=Math.abs(r.x-o.x);return{orientation:"horizontal",row:t,col:n,center:{x:I9e((o.x+r.x)/2),y:o.y},width:i-this.padWidth,height:this.padHeight,isBetweenTwoPads:this.hasPadAt(t,n)&&this.hasPadAt(t,n+1)}}getVerticalGap(t,n){let o=this.getSlotCenter(t,n),r=this.getSlotCenter(t+1,n),i=Math.abs(r.y-o.y);return{orientation:"vertical",row:t,col:n,center:{x:o.x,y:I9e((o.y+r.y)/2)},width:this.padWidth,height:i-this.padHeight,isBetweenTwoPads:this.hasPadAt(t,n)&&this.hasPadAt(t+1,n)}}getDiagonalGap(t,n){let o=this.getSlotCenter(t,n),r=this.getSlotCenter(t+1,n+1),i=Math.abs(r.x-o.x),s=Math.abs(r.y-o.y);return{orientation:"diagonal",row:t,col:n,center:{x:I9e((o.x+r.x)/2),y:I9e((o.y+r.y)/2)},width:i-this.padWidth,height:s-this.padHeight,isBetweenTwoPads:this.hasPadAt(t,n)&&this.hasPadAt(t+1,n+1)}}getDiagonalGaps(){let t=[];for(let n=0;n<this.rowCount-1;n++)for(let o=0;o<this.colCount-1;o++)t.push(this.getDiagonalGap(n,o));return t.filter((n)=>n.width>KJ&&n.height>KJ)}getAxisGaps(){let t=[];for(let n=0;n<this.rowCount;n++)for(let o=0;o<this.colCount-1;o++)t.push(this.getHorizontalGap(n,o));for(let n=0;n<this.rowCount-1;n++)for(let o=0;o<this.colCount;o++)t.push(this.getVerticalGap(n,o));return t.filter((n)=>n.width>KJ&&n.height>KJ)}getMissingSlots(){let t=[];for(let n=0;n<this.rowCount;n++)for(let o=0;o<this.colCount;o++)this.hasPadAt(n,o)||t.push({row:n,col:o,center:this.getSlotCenter(n,o),width:this.padWidth,height:this.padHeight});return t}};function Nni(e){if([e.point.pointId,e.point.pcb_port_id].filter((o)=>typeof o=="string").some((o)=>e.obstacle.connectedTo.includes(o)))return!0;if(e.obstacle.connectedTo.length===0)return!1;if(SKr(e.point,e.obstacle)>0.001)return!1;let t=wKr(e.point).map((o)=>FP(o,e.layerCount)),n=e.obstacle.layers.map((o)=>FP(o,e.layerCount));return t.some((o)=>n.includes(o))}function o7n(e){return e.obstacleId??[e.componentId??"no-component",e.center.x,e.center.y,e.width,e.height,e.layers.join(",")].join(":")}function r7n({componentId:e,orientationKey:t,row:n,col:o,center:r,width:i,height:s}){return["cmn",t,e,n,o,r.x,r.y,i,s].join("_")}function z1n(e){let{componentId:t,bgaGap:n,freeLayers:o,multiLayerThreshold:r}=e,i=n.width>r&&n.height>r,s="d";n.orientation==="horizontal"&&(s="h"),n.orientation==="vertical"&&(s="v");let a=r7n({componentId:t,orientationKey:s,row:n.row,col:n.col,center:n.center,width:n.width,height:n.height});return n.orientation==="diagonal"&&i||!n.isBetweenTwoPads&&i?[{center:n.center,width:n.width,height:n.height,availableZ:[...o],capacityMeshNodeId:`${a}_all`,layer:""}]:o.map((c)=>({center:n.center,width:n.width,height:n.height,availableZ:[c],capacityMeshNodeId:`${a}_${c}`,layer:""}))}function Rni(e){let{componentId:t,obstacle:n,freeLayers:o,layerCount:r}=e,i=n.layers.map((c)=>FP(c,r)),s=o.filter((c)=>!i.includes(c)),a=o7n(n);return s.map((c)=>({capacityMeshNodeId:`free-${t}-${a}-${c}`,center:n.center,width:n.width,height:n.height,layer:`z${c}`,availableZ:[c]}))}function O1n(e,t,n){let o=t.layers.map((s)=>FP(s,n.layerCount)),r=o7n(t),i=function(s){for(let a of s.srj.connections)for(let c of a.pointsToConnect)if(Nni({point:c,obstacle:s.obstacle,layerCount:s.srj.layerCount}))return a.__rootConnectionNames?.[0]??a.name}({obstacle:t,srj:n});return{capacityMeshNodeId:`obstacle-${e}-${r}-${o.join(",")}-${t.center.x}-${t.center.y}`,_containsObstacle:!0,...i?{_containsTarget:!0,_targetConnectionName:i}:{},center:t.center,width:t.width,height:t.height,layer:`z${o.join(",")}`,availableZ:o}}var Qni=class extends mT{constructor(e){super(),this.inputProblem=e}inputProblem;componentObstacles=[];meshNodes=[];getConstructorParams(){return[this.inputProblem]}_step(){let{srj:e,componentBounds:t,componentId:n,markedComponentObstacles:o,unmarkedComponentObstacles:r}=this.inputProblem,i=e.obstacles.filter((u)=>u.isCopperPour===!0).filter((u)=>q8e(Jm(u),t)).flatMap((u)=>u.layers.map((_)=>FP(_,e.layerCount))),s=Array.from({length:e.layerCount},(u,_)=>_).filter((u)=>!i.includes(u));if(this.componentObstacles=o,o.length===0||s.length===0)return void(this.solved=!0);let a=Dni.fromObstacles(o);if(!a)return void(this.solved=!0);let c=a.getAxisGaps(),l=a.getDiagonalGaps(),h=a.getMissingSlots(),d=1.2*(this.inputProblem.viaDiameter??J8e(e).padDiameter);this.meshNodes=[...c.flatMap((u)=>z1n({componentId:n,bgaGap:u,freeLayers:s,multiLayerThreshold:d})),...l.flatMap((u)=>z1n({componentId:n,bgaGap:u,freeLayers:s,multiLayerThreshold:d})),...h.flatMap((u)=>function(_){let{componentId:p,missingBgaSlot:m,freeLayers:A,multiLayerThreshold:g}=_,f=r7n({componentId:p,orientationKey:"missing",row:m.row,col:m.col,center:m.center,width:m.width,height:m.height});return m.width>g&&m.height>g?[{center:m.center,width:m.width,height:m.height,availableZ:[...A],capacityMeshNodeId:`${f}_all`,layer:""}]:A.map((y)=>({center:m.center,width:m.width,height:m.height,availableZ:[y],capacityMeshNodeId:`${f}_${y}`,layer:""}))}({componentId:n,missingBgaSlot:u,freeLayers:s,multiLayerThreshold:d})),...o.flatMap((u)=>[...Rni({componentId:n,obstacle:u,freeLayers:s,layerCount:e.layerCount}),O1n(n,u,e)]),...r.flatMap((u)=>[O1n(n,u,e)])],this.meshNodes=function(u){let _=new Map;return u.map((p)=>{let m=_.get(p.capacityMeshNodeId)??0;return _.set(p.capacityMeshNodeId,m+1),m===0?p:{...p,capacityMeshNodeId:`${p.capacityMeshNodeId}__dup${m}`}})}(this.meshNodes),this.solved=!0}getOutput(){return this.meshNodes}visualize(){return{rects:[{center:{x:(this.inputProblem.componentBounds.minX+this.inputProblem.componentBounds.maxX)/2,y:(this.inputProblem.componentBounds.minY+this.inputProblem.componentBounds.maxY)/2},width:this.inputProblem.componentBounds.maxX-this.inputProblem.componentBounds.minX,height:this.inputProblem.componentBounds.maxY-this.inputProblem.componentBounds.minY,fill:"rgba(0,0,0,0)",stroke:"rgba(30,30,30,0.65)",label:`component ${this.inputProblem.componentId}`},...this.inputProblem.markedComponentObstacles.map((e)=>({center:e.center,width:e.width,height:e.height,fill:"rgba(255,0,0,0.18)",stroke:"rgba(255,0,0,0.52)",label:`pad ${e.obstacleId??"obstacle"}`})),...this.inputProblem.unmarkedComponentObstacles.map((e)=>({center:e.center,width:e.width,height:e.height,fill:"rgba(255,140,0,0.14)",stroke:"rgba(255,140,0,0.42)",label:`foreign ${e.obstacleId??"obstacle"}`})),...this.meshNodes.map((e)=>({...hT(e,{rectMargin:0.01}),fill:e._containsObstacle?"rgba(255,0,0,0.14)":e.capacityMeshNodeId.includes("missing")?"rgba(0,200,120,0.18)":"rgba(0,120,255,0.12)",stroke:e._containsObstacle?"rgba(255,0,0,0.36)":e.capacityMeshNodeId.includes("missing")?"rgba(0,200,120,0.52)":"rgba(0,120,255,0.38)"}))]}}};function wot(e){return e.capacityMeshNodeId.startsWith("bga-gapfill-")}function kni(e){return JSON.stringify({availableZ:[...e.availableZ].sort((t,n)=>t-n),_containsTarget:e._containsTarget??!1,_targetConnectionName:e._targetConnectionName??null,_depth:e._depth??null,_strawNode:e._strawNode??!1,_strawParentCapacityMeshNodeId:e._strawParentCapacityMeshNodeId??null,_qfpRegionType:e._qfpRegionType??null,_isNarrowQfpPadGap:e._isNarrowQfpPadGap??!1,_soicRegionType:e._soicRegionType??null,_offBoardConnectionId:e._offBoardConnectionId??null,_offboardNetName:e._offboardNetName??null,_isVirtualOffboard:e._isVirtualOffboard??!1,_containsObstacle:e._containsObstacle??!1})}function Lni(e,t){let n=Jm(e);for(let o of t){if(!e.availableZ.some((i)=>o.availableZ.includes(i)))continue;let r=Jm(o);if(q8e(n,r))return!0}return!1}function Hni(e){let t=e[0];if(!t)throw Error("createMergedNode requires at least one source node");let{POSITIVE_INFINITY:n,NEGATIVE_INFINITY:o,POSITIVE_INFINITY:r,NEGATIVE_INFINITY:i}=Number;for(let s of e){let a=Jm(s);n=Math.min(n,a.minX),o=Math.max(o,a.maxX),r=Math.min(r,a.minY),i=Math.max(i,a.maxY)}return{...t,capacityMeshNodeId:`merge:${e.map((s)=>s.capacityMeshNodeId).join(":")}`,center:{x:(n+o)/2,y:(r+i)/2},width:o-n,height:i-r}}function ude(e,t,n){return{center:e.center,width:e.width,height:e.height,fill:t,stroke:t,label:n}}var Fni=class extends mT{constructor(e){super(),this.inputProblem=e}inputProblem;obstacleNodes=[];passthroughNodes=[];mergedNodes=[];pendingGroups=[];totalGroupCount=0;processedGroupCount=0;debugFilteredNodes=[];debugMergeEvents=[];currentGroupKey=null;currentRootNodeId=null;lastMergedNodeId=null;_setup(){this.obstacleNodes=this.inputProblem.meshNodes.filter((t)=>t._containsObstacle===!0),this.passthroughNodes=[],this.mergedNodes=[],this.pendingGroups=[],this.totalGroupCount=0,this.processedGroupCount=0,this.debugFilteredNodes=[],this.debugMergeEvents=[],this.currentGroupKey=null,this.currentRootNodeId=null,this.lastMergedNodeId=null;let e=new Map;for(let t of this.inputProblem.meshNodes){if(t._containsObstacle===!0){this.passthroughNodes.push(t),this.debugFilteredNodes.push({type:"preserved-obstacle",node:t,reason:"contains-obstacle"});continue}if(wot(t)){this.passthroughNodes.push(t);continue}if(t.availableZ.length!==this.inputProblem.layerCount){this.passthroughNodes.push(t);continue}let n=!1;for(let i=0;i<this.inputProblem.layerCount;i+=1)if(!t.availableZ.includes(i)){n=!0;break}if(n){this.passthroughNodes.push(t);continue}if(Lni(t,this.obstacleNodes)){this.passthroughNodes.push(t),this.debugFilteredNodes.push({type:"preserved-overlap",node:t,reason:"overlaps-obstacle"});continue}let o=kni(t),r=e.get(o);r?r.push(t):e.set(o,[t])}for(let[t,n]of e.entries())n.length<=1?this.passthroughNodes.push(...n):this.pendingGroups.push({groupKey:t,nodes:n});this.pendingGroups.sort((t,n)=>n.nodes.length-t.nodes.length),this.totalGroupCount=this.pendingGroups.length,this.updateStats("setup")}_step(){let e=this.pendingGroups.shift();if(!e)return this.currentGroupKey=null,this.currentRootNodeId=null,this.solved=!0,void this.updateStats("done");let t=e.nodes[0];this.currentGroupKey=e.groupKey,this.currentRootNodeId=t?t.capacityMeshNodeId:null;let n=function(r){if(!r.nodes[0])return{outputNodes:[],mergeEvents:[]};let{POSITIVE_INFINITY:i,POSITIVE_INFINITY:s,POSITIVE_INFINITY:a,POSITIVE_INFINITY:c}=Number;for(let p of r.nodes){i=Math.min(i,p.width),s=Math.min(s,p.height);let m=Jm(p);a=Math.min(a,m.minX),c=Math.min(c,m.minY)}let l=new Map,h=[];for(let p of r.nodes){let m=Jm(p),A=Math.round((m.minX-a)/i),g=Math.round((m.minY-c)/s),f=Math.max(1,Math.round(p.width/i)),y=Math.max(1,Math.round(p.height/s));for(let x=0;x<y;x+=1)for(let C=0;C<f;C+=1)l.set(`${A+C},${g+x}`,p);h.push({col:A,row:g})}h.sort((p,m)=>p.row-m.row||p.col-m.col);let d=new Set,u=[],_=[];for(let p of h){let m=`${p.col},${p.row}`;if(d.has(m))continue;let A=0;for(;;){let v=`${p.col+A},${p.row}`;if(!l.has(v))break;if(d.has(v))break;A+=1}let g=A,f=1,y=1,x=1;for(let v=1;;v+=1){let P=p.row+v-1,M=0;for(;M<g;){let B=`${p.col+M},${P}`;if(!l.has(B))break;if(d.has(B))break;M+=1}if(M===0)break;g=Math.min(g,M);for(let B=g;B>=1;B-=1){let T=B*i,N=v*s,D=Math.min(T,N);if((D<=0.000001?Number.POSITIVE_INFINITY:Math.max(T,N)/D)>4)continue;let L=B*v;L>x&&(x=L,f=B,y=v);break}}let C=new Map;for(let v=0;v<y;v+=1)for(let P=0;P<f;P+=1){let M=`${p.col+P},${p.row+v}`,B=l.get(M);B&&(d.add(M),C.set(B.capacityMeshNodeId,B))}let b=[...C.values()];if(b.length<=1){let v=b[0];v&&u.push(v);continue}let I=Hni(b);u.push(I),_.push({type:"merge",groupKey:r.groupKey,sourceNodes:b,mergedNode:I})}return{outputNodes:u,mergeEvents:_}}(e);this.mergedNodes.push(...n.outputNodes),this.processedGroupCount+=1,this.debugMergeEvents.push(...n.mergeEvents);let o=n.mergeEvents[n.mergeEvents.length-1];o&&(this.lastMergedNodeId=o.mergedNode.capacityMeshNodeId),this.updateStats(n.mergeEvents.length>0?"merged-group":"passthrough-group")}computeProgress(){return this.totalGroupCount===0?1:this.processedGroupCount/this.totalGroupCount}updateStats(e){let t=new Set(this.debugMergeEvents.map((o)=>o.groupKey)),n={lastAction:e,totalGroupCount:this.totalGroupCount,processedGroupCount:this.processedGroupCount,pendingGroupCount:this.pendingGroups.length,mergedNodeCount:this.mergedNodes.length,passthroughNodeCount:this.passthroughNodes.length,gapFillNodeCount:this.passthroughNodes.filter(wot).length,preservedObstacleNodeCount:this.debugFilteredNodes.filter((o)=>o.type==="preserved-obstacle").length,preservedOverlapNodeCount:this.debugFilteredNodes.filter((o)=>o.type==="preserved-overlap").length,mergeCount:this.debugMergeEvents.length,mergedGroupCount:t.size,currentGroupKey:this.currentGroupKey,currentRootNodeId:this.currentRootNodeId,lastMergedNodeId:this.lastMergedNodeId};this.stats=n}getConstructorParams(){return[this.inputProblem]}getOutput(){return[...this.mergedNodes,...this.passthroughNodes]}visualize(){let e=this.getOutput(),t=this.currentRootNodeId?e.find((o)=>o.capacityMeshNodeId===this.currentRootNodeId)??null:null,n=this.lastMergedNodeId?e.find((o)=>o.capacityMeshNodeId===this.lastMergedNodeId)??null:null;return{rects:[...this.debugFilteredNodes.map((o)=>ude(o.node,o.type==="preserved-obstacle"?"rgba(255,64,64,0.35)":"rgba(255,160,64,0.35)",o.reason)),...this.passthroughNodes.map((o)=>ude(o,o._containsObstacle?"rgba(255,0,0,0.35)":wot(o)?"rgba(0,120,255,0.18)":"rgba(160,160,160,0.12)")),...this.mergedNodes.map((o)=>ude(o,"rgba(120,120,120,0.14)")),...t?[ude(t,"rgba(255,215,0,0.35)","active-group")]:[],...n?[ude(n,"rgba(0,200,120,0.28)","merged")]:[]]}}},zni=class extends mT{constructor(e){super(),this.inputProblem=e}inputProblem;obstacleQueue=[];obstacleQueueIndex=0;meshNodes=[];_setup(){this.obstacleQueue=this.inputProblem.obstacles,this.obstacleQueueIndex=0,this.meshNodes=[...this.inputProblem.meshNodes]}_step(){if(this.obstacleQueueIndex>=this.obstacleQueue.length)return void(this.solved=!0);let e=this.obstacleQueue[this.obstacleQueueIndex],t=e.layers.map((o)=>FP(o,this.inputProblem.layerCount)),n=[];for(let o of this.meshNodes){if(o._containsObstacle){n.push(o);continue}if(!t.some((i)=>o.availableZ.includes(i))){n.push(o);continue}if(!q8e(Jm(o),Jm(e))){n.push(o);continue}if(o.availableZ.length===1)continue;let r=o.availableZ.filter((i)=>!t.includes(i));for(let i of r){let s={...o,capacityMeshNodeId:`${o.capacityMeshNodeId}:z${i}`,availableZ:[i],layer:`z${i}`};n.push(s)}}this.meshNodes=n,this.obstacleQueueIndex+=1,this.stats={obstaclesProcessed:this.obstacleQueueIndex,obstacleCount:this.obstacleQueue.length,meshNodeCount:this.meshNodes.length}}computeProgress(){return this.obstacleQueue.length===0?1:this.obstacleQueueIndex/this.obstacleQueue.length}getConstructorParams(){return[this.inputProblem]}getOutput(){return this.meshNodes}visualize(){let e=this.obstacleQueueIndex<this.obstacleQueue.length?this.obstacleQueue[this.obstacleQueueIndex]??null:null,t=this.obstacleQueue.slice(0,this.obstacleQueueIndex),n=e?this.obstacleQueue.slice(this.obstacleQueueIndex+1):[];return{rects:[...t.map((o)=>({center:o.center,width:o.width,height:o.height,fill:"rgba(160,160,160,0.10)",stroke:"rgba(160,160,160,0.35)",label:`processed ${o.obstacleId??"obstacle"}`})),...e?[{center:e.center,width:e.width,height:e.height,fill:"rgba(255,140,0,0.22)",stroke:"rgba(255,140,0,0.75)",label:`active ${e.obstacleId??"obstacle"}`}]:[],...n.map((o)=>({center:o.center,width:o.width,height:o.height,fill:"rgba(255,0,0,0.05)",stroke:"rgba(255,0,0,0.22)",label:`pending ${o.obstacleId??"obstacle"}`})),...this.meshNodes.map((o)=>({...hT(o,{rectMargin:0.01}),fill:o._containsObstacle?"rgba(255,0,0,0.18)":"rgba(0,120,255,0.12)",stroke:o._containsObstacle?"rgba(255,0,0,0.45)":"rgba(0,120,255,0.45)"}))]}}};l7e.register(class extends vbn{constructor(e){super(e),this.inputProblem=e}inputProblem;static componentKind="bga";initialTopologySolver;removeMeshNodeOverlappingWithUnmarkedObstacle;gapfillDueToNodeRemoval;mergeMeshNodes;markedComponentObstacles=[];unmarkedComponentObstacles=[];pipelineDef=[nZ("initialTopologySolver",Qni,(e)=>[{srj:e.inputProblem.inputSrj,componentBounds:e.inputProblem.detectedComponent.bounds,componentId:e.inputProblem.detectedComponent.componentId,markedComponentObstacles:e.markedComponentObstacles,unmarkedComponentObstacles:e.unmarkedComponentObstacles,viaDiameter:e.inputProblem.viaDiameter}]),nZ("removeMeshNodeOverlappingWithUnmarkedObstacle",zni,(e)=>[{meshNodes:e.initialTopologySolver.getOutput(),obstacles:e.unmarkedComponentObstacles,layerCount:e.inputProblem.inputSrj.layerCount}]),nZ("gapfillDueToNodeRemoval",Tni,(e)=>[{meshNodes:e.removeMeshNodeOverlappingWithUnmarkedObstacle.getOutput(),unmarkedComponentObstacles:e.unmarkedComponentObstacles,layerCount:e.inputProblem.inputSrj.layerCount}]),nZ("mergeMeshNodes",Fni,(e)=>[{meshNodes:e.gapfillDueToNodeRemoval.getOutput(),layerCount:e.inputProblem.inputSrj.layerCount}])];_setup(){let e=this.inputProblem.detectedComponent.bounds,t=this.inputProblem.detectedComponent.componentId,n=[],o=[];for(let r of this.inputProblem.inputSrj.obstacles){let i=Jm(r);q8e(e,i)&&(r.componentId!==t?o.push(r):n.push(r))}this.markedComponentObstacles=n,this.unmarkedComponentObstacles=o}getConstructorParams(){return[this.inputProblem]}getOutput(){return{routingRegions:this.mergeMeshNodes?.getOutput()??this.gapfillDueToNodeRemoval?.getOutput()??this.removeMeshNodeOverlappingWithUnmarkedObstacle?.getOutput()??[]}}initialVisualize(){return{rects:[{center:{x:(this.inputProblem.detectedComponent.bounds.minX+this.inputProblem.detectedComponent.bounds.maxX)/2,y:(this.inputProblem.detectedComponent.bounds.minY+this.inputProblem.detectedComponent.bounds.maxY)/2},width:this.inputProblem.detectedComponent.bounds.maxX-this.inputProblem.detectedComponent.bounds.minX,height:this.inputProblem.detectedComponent.bounds.maxY-this.inputProblem.detectedComponent.bounds.minY,fill:"rgba(0,0,0,0)",stroke:"rgba(30,30,30,0.65)",label:`bga ${this.inputProblem.detectedComponent.componentId}`},...this.markedComponentObstacles.map((e)=>({center:e.center,width:e.width,height:e.height,fill:"rgba(255,0,0,0.18)",stroke:"rgba(255,0,0,0.52)",label:`pad ${e.obstacleId??"obstacle"}`})),...this.unmarkedComponentObstacles.map((e)=>({center:e.center,width:e.width,height:e.height,fill:"rgba(255,140,0,0.14)",stroke:"rgba(255,140,0,0.42)",label:`foreign ${e.obstacleId??"obstacle"}`}))]}}finalVisualize(){return{rects:this.getOutput().routingRegions.map((e)=>({...hT(e,{rectMargin:0.01}),fill:e._containsObstacle?"rgba(255,0,0,0.16)":"rgba(0,120,255,0.12)",stroke:e._containsObstacle?"rgba(255,0,0,0.36)":"rgba(0,120,255,0.42)"}))}}});var V1n=0.000001;function h7e(e,t){return e.__zLayers&&e.__zLayers.length>0?Ebn(e.__zLayers,t):BKr(e.layers,t)}function v9e(e){let t=[...e].sort((i,s)=>i-s),n=[];for(let i=1;i<t.length;i++){let s=t[i]-t[i-1];s>V1n&&n.push(s)}let o=n.length>0?Math.max(V1n,Math.min(...n)/4):0.001,r=[];for(let i of t){let s=r[r.length-1];(s===void 0||Math.abs(i-s)>o)&&r.push(i)}return r}function Act(e){return Array.from({length:Math.max(0,e)},(t,n)=>n)}var Y1n=0.000001;function i7n(e){return e.maxX-e.minX>Y1n&&e.maxY-e.minY>Y1n}function G1n(e){return function(t){let n=Math.min(t.width,t.height),o=Math.max(t.width,t.height);return n<=0?0:o/n}(e)>=1.5}function Oni(e,t){let n=[{side:"top",distance:Math.abs(e.center.y-t.minY)},{side:"right",distance:Math.abs(t.maxX-e.center.x)},{side:"bottom",distance:Math.abs(t.maxY-e.center.y)},{side:"left",distance:Math.abs(e.center.x-t.minX)}];return n.sort((o,r)=>o.distance-r.distance),n[0].side}function Vni(e,t){return e.map((n,o)=>({key:`pad:${n.obstacleId??o}`,bounds:ms(n),regionType:"pad",obstacleZ:h7e(n,t)}))}function Yni(e,t){return e.map((n,o)=>({key:`thermal-pad:${n.obstacleId??o}`,bounds:ms(n),regionType:"pad",obstacleZ:h7e(n,t)}))}function s7n(e,t){return!!i7n(e)&&Math.min(e.maxX-e.minX,e.maxY-e.minY)<=t}function S9e({side:e,sideObstacles:t,bounds:n,innerBounds:o,narrowThreshold:r}){let i=[];for(let s=0;s<t.length-1;s++){let a=ms(t[s]),c=ms(t[s+1]),l;l=e==="top"?{minX:a.maxX,maxX:c.minX,minY:n.minY,maxY:o.minY}:e==="right"?{minX:o.maxX,maxX:n.maxX,minY:a.maxY,maxY:c.minY}:e==="bottom"?{minX:a.maxX,maxX:c.minX,minY:o.maxY,maxY:n.maxY}:{minX:n.minX,maxX:o.minX,minY:a.maxY,maxY:c.minY},i.push({key:`${e}-gap-${s}`,bounds:l,regionType:"pad-gap",isNarrowPadGap:s7n(l,r)})}return i}function P9e({side:e,sideObstacles:t,thermalPadBounds:n,narrowThreshold:o}){let r=[];for(let i=0;i<t.length;i++){let s=ms(t[i]),a=t[i-1]?ms(t[i-1]):null,c=t[i+1]?ms(t[i+1]):null,l;l=e==="top"?{minX:a?(a.maxX+s.minX)/2:s.minX,maxX:c?(s.maxX+c.minX)/2:s.maxX,minY:s.maxY,maxY:n.minY}:e==="right"?{minX:n.maxX,maxX:s.minX,minY:a?(a.maxY+s.minY)/2:s.minY,maxY:c?(s.maxY+c.minY)/2:s.maxY}:e==="bottom"?{minX:a?(a.maxX+s.minX)/2:s.minX,maxX:c?(s.maxX+c.minX)/2:s.maxX,minY:n.maxY,maxY:s.minY}:{minX:s.maxX,maxX:n.minX,minY:a?(a.maxY+s.minY)/2:s.minY,maxY:c?(s.maxY+c.minY)/2:s.maxY},r.push({key:`inner-${e}-pad-${i}`,bounds:l,regionType:"pad-gap",isNarrowPadGap:s7n(l,o)})}return r}function Gni({bounds:e,innerBounds:t,sideGroups:n}){let o=n.top[0]?ms(n.top[0]):null,r=n.top.at(-1)?ms(n.top.at(-1)):null,i=n.right[0]?ms(n.right[0]):null,s=n.right.at(-1)?ms(n.right.at(-1)):null,a=n.bottom[0]?ms(n.bottom[0]):null,c=n.bottom.at(-1)?ms(n.bottom.at(-1)):null,l=n.left[0]?ms(n.left[0]):null,h=n.left.at(-1)?ms(n.left.at(-1)):null;return[{key:"corner-nw-outer",regionType:"corner",bounds:{minX:e.minX,maxX:t.minX,minY:e.minY,maxY:t.minY}},{key:"corner-nw-top",regionType:"corner",bounds:{minX:t.minX,maxX:o?.minX??t.minX,minY:e.minY,maxY:t.minY}},{key:"corner-nw-left",regionType:"corner",bounds:{minX:e.minX,maxX:t.minX,minY:t.minY,maxY:l?.minY??t.minY}},{key:"corner-ne-outer",regionType:"corner",bounds:{minX:t.maxX,maxX:e.maxX,minY:e.minY,maxY:t.minY}},{key:"corner-ne-top",regionType:"corner",bounds:{minX:r?.maxX??t.maxX,maxX:t.maxX,minY:e.minY,maxY:t.minY}},{key:"corner-ne-right",regionType:"corner",bounds:{minX:t.maxX,maxX:e.maxX,minY:t.minY,maxY:i?.minY??t.minY}},{key:"corner-se-outer",regionType:"corner",bounds:{minX:t.maxX,maxX:e.maxX,minY:t.maxY,maxY:e.maxY}},{key:"corner-se-right",regionType:"corner",bounds:{minX:t.maxX,maxX:e.maxX,minY:s?.maxY??t.maxY,maxY:t.maxY}},{key:"corner-se-bottom",regionType:"corner",bounds:{minX:c?.maxX??t.maxX,maxX:t.maxX,minY:t.maxY,maxY:e.maxY}},{key:"corner-sw-outer",regionType:"corner",bounds:{minX:e.minX,maxX:t.minX,minY:t.maxY,maxY:e.maxY}},{key:"corner-sw-bottom",regionType:"corner",bounds:{minX:t.minX,maxX:a?.minX??t.minX,minY:t.maxY,maxY:e.maxY}},{key:"corner-sw-left",regionType:"corner",bounds:{minX:e.minX,maxX:t.minX,minY:h?.maxY??t.maxY,maxY:t.maxY}}]}function Uni({innerBounds:e,thermalPadBounds:t,sideGroups:n}){let o=n.top[0]?ms(n.top[0]):null,r=n.top.at(-1)?ms(n.top.at(-1)):null,i=n.right[0]?ms(n.right[0]):null,s=n.right.at(-1)?ms(n.right.at(-1)):null,a=n.bottom[0]?ms(n.bottom[0]):null,c=n.bottom.at(-1)?ms(n.bottom.at(-1)):null,l=n.left[0]?ms(n.left[0]):null,h=n.left.at(-1)?ms(n.left.at(-1)):null;return[{key:"inner-corner-nw-core",regionType:"corner",bounds:{minX:e.minX,maxX:t.minX,minY:e.minY,maxY:t.minY}},{key:"inner-corner-nw-top",regionType:"corner",bounds:{minX:t.minX,maxX:o?.minX??t.minX,minY:e.minY,maxY:t.minY}},{key:"inner-corner-nw-left",regionType:"corner",bounds:{minX:e.minX,maxX:t.minX,minY:t.minY,maxY:l?.minY??t.minY}},{key:"inner-corner-ne-core",regionType:"corner",bounds:{minX:t.maxX,maxX:e.maxX,minY:e.minY,maxY:t.minY}},{key:"inner-corner-ne-top",regionType:"corner",bounds:{minX:r?.maxX??t.maxX,maxX:t.maxX,minY:e.minY,maxY:t.minY}},{key:"inner-corner-ne-right",regionType:"corner",bounds:{minX:t.maxX,maxX:e.maxX,minY:t.minY,maxY:i?.minY??t.minY}},{key:"inner-corner-se-core",regionType:"corner",bounds:{minX:t.maxX,maxX:e.maxX,minY:t.maxY,maxY:e.maxY}},{key:"inner-corner-se-right",regionType:"corner",bounds:{minX:t.maxX,maxX:e.maxX,minY:s?.maxY??t.maxY,maxY:t.maxY}},{key:"inner-corner-se-bottom",regionType:"corner",bounds:{minX:c?.maxX??t.maxX,maxX:t.maxX,minY:t.maxY,maxY:e.maxY}},{key:"inner-corner-sw-core",regionType:"corner",bounds:{minX:e.minX,maxX:t.minX,minY:t.maxY,maxY:e.maxY}},{key:"inner-corner-sw-bottom",regionType:"corner",bounds:{minX:t.minX,maxX:a?.minX??t.minX,minY:t.maxY,maxY:e.maxY}},{key:"inner-corner-sw-left",regionType:"corner",bounds:{minX:e.minX,maxX:t.minX,minY:h?.maxY??t.maxY,maxY:t.maxY}}]}l7e.register(class extends mT{constructor(e){super(),this.inputProblem=e}inputProblem;static componentKind="qfp_thermalpad";output=null;getConstructorParams(){return[this.inputProblem]}_step(){if(this.output)return void(this.solved=!0);let{layerCount:e,obstacles:t}=this.inputProblem.inputSrj,{bounds:n,componentId:o}=this.inputProblem.detectedComponent,r=Act(e),i=t.filter((f)=>f.componentId===o),s=i.length>0?i:t,{padRingObstacles:a,thermalPadObstacles:c}=function(f){return{padRingObstacles:f.filter(G1n),thermalPadObstacles:f.filter((y)=>!G1n(y))}}(s),l=function(f,y){let x={top:[],right:[],bottom:[],left:[]};for(let C of f)x[Oni(C,y)].push(C);return x.top.sort((C,b)=>C.center.x-b.center.x),x.bottom.sort((C,b)=>C.center.x-b.center.x),x.left.sort((C,b)=>C.center.y-b.center.y),x.right.sort((C,b)=>C.center.y-b.center.y),x}(a,n),h=function({bounds:f,sideGroups:y}){return{minX:y.left.length>0?Math.max(...y.left.map((x)=>ms(x).maxX)):f.minX,maxX:y.right.length>0?Math.min(...y.right.map((x)=>ms(x).minX)):f.maxX,minY:y.top.length>0?Math.max(...y.top.map((x)=>ms(x).maxY)):f.minY,maxY:y.bottom.length>0?Math.min(...y.bottom.map((x)=>ms(x).minY)):f.maxY}}({bounds:n,sideGroups:l}),d=function(f){return f.length===0?null:f.reduce((y,x)=>{let C=ms(x);return{minX:Math.min(y.minX,C.minX),maxX:Math.max(y.maxX,C.maxX),minY:Math.min(y.minY,C.minY),maxY:Math.max(y.maxY,C.maxY)}},ms(f[0]))}(c);if(!d)return this.failed=!0,void(this.error="QfpThermalPadTopologyGeneratorSolver requires a thermal pad");let u=o,_=this.inputProblem.viaDiameter??J8e(this.inputProblem.inputSrj).padDiameter,p=this.inputProblem.obstacleMargin??this.inputProblem.inputSrj.defaultObstacleMargin??0.15,m=_+2*p,A=this.inputProblem.inputSrj.minTraceWidth+2*p,g=[...Vni(a,e),...Yni(c,e),...S9e({side:"top",sideObstacles:l.top,bounds:n,innerBounds:h,narrowThreshold:A}),...S9e({side:"right",sideObstacles:l.right,bounds:n,innerBounds:h,narrowThreshold:A}),...S9e({side:"bottom",sideObstacles:l.bottom,bounds:n,innerBounds:h,narrowThreshold:A}),...S9e({side:"left",sideObstacles:l.left,bounds:n,innerBounds:h,narrowThreshold:A}),...P9e({side:"top",sideObstacles:l.top,thermalPadBounds:d,narrowThreshold:A}),...P9e({side:"right",sideObstacles:l.right,thermalPadBounds:d,narrowThreshold:A}),...P9e({side:"bottom",sideObstacles:l.bottom,thermalPadBounds:d,narrowThreshold:A}),...P9e({side:"left",sideObstacles:l.left,thermalPadBounds:d,narrowThreshold:A}),...Uni({innerBounds:h,thermalPadBounds:d,sideGroups:l}),...Gni({bounds:n,innerBounds:h,sideGroups:l})].flatMap((f)=>function({nodeId:y,bounds:x,availableZ:C,multiLayerThreshold:b,regionType:I,isNarrowPadGap:v=!1,obstacleZ:P=[]}){if(!i7n(x))return[];let M=function(N){return{center:{x:(N.minX+N.maxX)/2,y:(N.minY+N.maxY)/2},width:N.maxX-N.minX,height:N.maxY-N.minY}}(x),B=Math.min(M.width,M.height)>b,T=B?[{availableZ:C.filter((N)=>!P.includes(N)),containsObstacle:!1},{availableZ:C.filter((N)=>P.includes(N)),containsObstacle:!0}].filter((N)=>N.availableZ.length>0):C.map((N)=>({availableZ:[N],containsObstacle:P.includes(N)}));return T.map((N)=>({capacityMeshNodeId:T.length===1?y:B?`${y}:${N.containsObstacle?"obstacle":"free"}`:`${y}:z${N.availableZ[0]}`,center:M.center,width:M.width,height:M.height,layer:`z${N.availableZ.join(",")}`,availableZ:N.availableZ,_qfpRegionType:I,_isNarrowQfpPadGap:v,_containsObstacle:N.containsObstacle}))}({nodeId:`qfp_thermalpad:${u}:${f.key}`,bounds:f.bounds,availableZ:r,multiLayerThreshold:m,regionType:f.regionType,isNarrowPadGap:f.isNarrowPadGap,obstacleZ:f.obstacleZ}));this.output={routingRegions:g},this.stats={componentId:o,layerCount:e,viaDiameter:_,obstacleMargin:p,multiLayerThreshold:m,narrowPadGapThreshold:A,thermalPadCount:c.length,perimeterPadCount:a.length,innerCornerRectCount:g.filter((f)=>f.capacityMeshNodeId.includes(":inner-corner-")).length,narrowPadGapNodeCount:g.filter((f)=>f._isNarrowQfpPadGap).length,topPadCount:l.top.length,rightPadCount:l.right.length,bottomPadCount:l.bottom.length,leftPadCount:l.left.length,multiLayerNodeCount:g.filter((f)=>f.availableZ.length>1).length,totalMeshNodeCount:g.length},this.solved=!0}getOutput(){if(!this.output)throw Error("QfpThermalPadTopologyGeneratorSolver has not solved yet");return this.output}});var U1n=0.000001;function a7n(e){return e.maxX-e.minX>U1n&&e.maxY-e.minY>U1n}function Wni(e,t){let n=[{side:"top",distance:Math.abs(e.center.y-t.minY)},{side:"right",distance:Math.abs(t.maxX-e.center.x)},{side:"bottom",distance:Math.abs(t.maxY-e.center.y)},{side:"left",distance:Math.abs(e.center.x-t.minX)}];return n.sort((o,r)=>o.distance-r.distance),n[0].side}function Xni(e,t){return e.map((n,o)=>({key:`pad:${n.obstacleId??o}`,bounds:ms(n),regionType:"pad",obstacleZ:h7e(n,t),connectedTo:[...n.connectedTo]}))}function jni(e,t){return!!a7n(e)&&Math.min(e.maxX-e.minX,e.maxY-e.minY)<=t}function E9e({side:e,sideObstacles:t,bounds:n,centralBounds:o,narrowThreshold:r}){let i=[];for(let s=0;s<t.length-1;s++){let a=ms(t[s]),c=ms(t[s+1]),l;l=e==="top"?{minX:a.maxX,maxX:c.minX,minY:n.minY,maxY:o.minY}:e==="right"?{minX:o.maxX,maxX:n.maxX,minY:a.maxY,maxY:c.minY}:e==="bottom"?{minX:a.maxX,maxX:c.minX,minY:o.maxY,maxY:n.maxY}:{minX:n.minX,maxX:o.minX,minY:a.maxY,maxY:c.minY},i.push({key:`${e}-gap-${s}`,bounds:l,regionType:"pad-gap",isNarrowPadGap:jni(l,r)})}return i}function Kni({bounds:e,centralBounds:t,sideGroups:n}){let o=n.top[0]?ms(n.top[0]):null,r=n.top.at(-1)?ms(n.top.at(-1)):null,i=n.right[0]?ms(n.right[0]):null,s=n.right.at(-1)?ms(n.right.at(-1)):null,a=n.bottom[0]?ms(n.bottom[0]):null,c=n.bottom.at(-1)?ms(n.bottom.at(-1)):null,l=n.left[0]?ms(n.left[0]):null,h=n.left.at(-1)?ms(n.left.at(-1)):null;return[{key:"corner-nw-outer",regionType:"corner",bounds:{minX:e.minX,maxX:t.minX,minY:e.minY,maxY:t.minY}},{key:"corner-nw-top",regionType:"corner",bounds:{minX:t.minX,maxX:o?.minX??t.minX,minY:e.minY,maxY:t.minY}},{key:"corner-nw-left",regionType:"corner",bounds:{minX:e.minX,maxX:t.minX,minY:t.minY,maxY:l?.minY??t.minY}},{key:"corner-ne-outer",regionType:"corner",bounds:{minX:t.maxX,maxX:e.maxX,minY:e.minY,maxY:t.minY}},{key:"corner-ne-top",regionType:"corner",bounds:{minX:r?.maxX??t.maxX,maxX:t.maxX,minY:e.minY,maxY:t.minY}},{key:"corner-ne-right",regionType:"corner",bounds:{minX:t.maxX,maxX:e.maxX,minY:t.minY,maxY:i?.minY??t.minY}},{key:"corner-se-outer",regionType:"corner",bounds:{minX:t.maxX,maxX:e.maxX,minY:t.maxY,maxY:e.maxY}},{key:"corner-se-right",regionType:"corner",bounds:{minX:t.maxX,maxX:e.maxX,minY:s?.maxY??t.maxY,maxY:t.maxY}},{key:"corner-se-bottom",regionType:"corner",bounds:{minX:c?.maxX??t.maxX,maxX:t.maxX,minY:t.maxY,maxY:e.maxY}},{key:"corner-sw-outer",regionType:"corner",bounds:{minX:e.minX,maxX:t.minX,minY:t.maxY,maxY:e.maxY}},{key:"corner-sw-bottom",regionType:"corner",bounds:{minX:t.minX,maxX:a?.minX??t.minX,minY:t.maxY,maxY:e.maxY}},{key:"corner-sw-left",regionType:"corner",bounds:{minX:e.minX,maxX:t.minX,minY:h?.maxY??t.maxY,maxY:t.maxY}}]}l7e.register(class extends mT{constructor(e){super(),this.inputProblem=e}inputProblem;static componentKind="qfp";output=null;getConstructorParams(){return[this.inputProblem]}_step(){if(this.output)return void(this.solved=!0);let{layerCount:e,obstacles:t}=this.inputProblem.inputSrj,{bounds:n,componentId:o}=this.inputProblem.detectedComponent,r=Act(e),i=t.filter((m)=>m.componentId===o),s=i.length>0?i:t,a=function(m,A){let g={top:[],right:[],bottom:[],left:[]};for(let f of m)g[Wni(f,A)].push(f);return g.top.sort((f,y)=>f.center.x-y.center.x),g.bottom.sort((f,y)=>f.center.x-y.center.x),g.left.sort((f,y)=>f.center.y-y.center.y),g.right.sort((f,y)=>f.center.y-y.center.y),g}(s,n),c=function({bounds:m,sideGroups:A}){return{minX:A.left.length>0?Math.max(...A.left.map((g)=>ms(g).maxX)):m.minX,maxX:A.right.length>0?Math.min(...A.right.map((g)=>ms(g).minX)):m.maxX,minY:A.top.length>0?Math.max(...A.top.map((g)=>ms(g).maxY)):m.minY,maxY:A.bottom.length>0?Math.min(...A.bottom.map((g)=>ms(g).minY)):m.maxY}}({bounds:n,sideGroups:a}),l=o,h=this.inputProblem.viaDiameter??J8e(this.inputProblem.inputSrj).padDiameter,d=this.inputProblem.obstacleMargin??this.inputProblem.inputSrj.defaultObstacleMargin??0.15,u=h+2*d,_=this.inputProblem.inputSrj.minTraceWidth+2*d,p=[{key:"center",bounds:c,regionType:"center"},...Xni(s,e),...E9e({side:"top",sideObstacles:a.top,bounds:n,centralBounds:c,narrowThreshold:_}),...E9e({side:"right",sideObstacles:a.right,bounds:n,centralBounds:c,narrowThreshold:_}),...E9e({side:"bottom",sideObstacles:a.bottom,bounds:n,centralBounds:c,narrowThreshold:_}),...E9e({side:"left",sideObstacles:a.left,bounds:n,centralBounds:c,narrowThreshold:_}),...Kni({bounds:n,centralBounds:c,sideGroups:a})].flatMap((m)=>function({nodeId:A,bounds:g,availableZ:f,multiLayerThreshold:y,regionType:x,isNarrowPadGap:C=!1,obstacleZ:b=[],connectedTo:I}){if(!a7n(g))return[];let v=function(B){return{center:{x:(B.minX+B.maxX)/2,y:(B.minY+B.maxY)/2},width:B.maxX-B.minX,height:B.maxY-B.minY}}(g),P=Math.min(v.width,v.height)>y,M=P?[{availableZ:f.filter((B)=>!b.includes(B)),containsObstacle:!1},{availableZ:f.filter((B)=>b.includes(B)),containsObstacle:!0}].filter((B)=>B.availableZ.length>0):f.map((B)=>({availableZ:[B],containsObstacle:b.includes(B)}));return M.map((B)=>({capacityMeshNodeId:M.length===1?A:P?`${A}:${B.containsObstacle?"obstacle":"free"}`:`${A}:z${B.availableZ[0]}`,center:v.center,width:v.width,height:v.height,layer:`z${B.availableZ.join(",")}`,availableZ:B.availableZ,_qfpRegionType:x,_isNarrowQfpPadGap:C,_containsObstacle:B.containsObstacle,_connectedTo:B.containsObstacle?I:void 0}))}({nodeId:`qfp:${l}:${m.key}`,bounds:m.bounds,availableZ:r,multiLayerThreshold:u,regionType:m.regionType,isNarrowPadGap:m.isNarrowPadGap,obstacleZ:m.obstacleZ,connectedTo:m.connectedTo}));this.output={routingRegions:p},this.stats={componentId:o,layerCount:e,viaDiameter:h,obstacleMargin:d,multiLayerThreshold:u,narrowPadGapThreshold:_,narrowPadGapNodeCount:p.filter((m)=>m._isNarrowQfpPadGap).length,topPadCount:a.top.length,rightPadCount:a.right.length,bottomPadCount:a.bottom.length,leftPadCount:a.left.length,multiLayerNodeCount:p.filter((m)=>m.availableZ.length>1).length,totalMeshNodeCount:p.length},this.solved=!0}getOutput(){if(!this.output)throw Error("QfpTopologyGeneratorSolver has not solved yet");return this.output}});var W1n=0.000001;function $ni({nodeId:e,bounds:t,availableZ:n,multiLayerThreshold:o,regionType:r,obstacleZ:i=[],connectedTo:s}){if(!function(h){return h.maxX-h.minX>W1n&&h.maxY-h.minY>W1n}(t))return[];let a=function(h){return{center:{x:(h.minX+h.maxX)/2,y:(h.minY+h.maxY)/2},width:h.maxX-h.minX,height:h.maxY-h.minY}}(t),c=Math.min(a.width,a.height)>o,l=c?[{availableZ:n.filter((h)=>!i.includes(h)),containsObstacle:!1},{availableZ:n.filter((h)=>i.includes(h)),containsObstacle:!0}].filter((h)=>h.availableZ.length>0):n.map((h)=>({availableZ:[h],containsObstacle:i.includes(h)}));return l.map((h)=>({capacityMeshNodeId:l.length===1?e:c?`${e}:${h.containsObstacle?"obstacle":"free"}`:`${e}:z${h.availableZ[0]}`,center:a.center,width:a.width,height:a.height,layer:`z${h.availableZ.join(",")}`,availableZ:h.availableZ,_soicRegionType:r,_containsObstacle:h.containsObstacle,_connectedTo:h.containsObstacle?s:void 0}))}function X1n(e,t){let n=0,o=Number.POSITIVE_INFINITY;for(let r=0;r<t.length;r++){let i=Math.abs(e-t[r]);i<o&&(n=r,o=i)}return n}function qni(e,t){return e.map((n,o)=>({key:`pad:${n.obstacleId??o}`,bounds:ms(n),regionType:"pad",obstacleZ:h7e(n,t),connectedTo:[...n.connectedTo]}))}l7e.register(class extends mT{constructor(e){super(),this.inputProblem=e}inputProblem;static componentKind="soic";output=null;getConstructorParams(){return[this.inputProblem]}_step(){if(this.output)return void(this.solved=!0);let{layerCount:e,obstacles:t}=this.inputProblem.inputSrj,{bounds:n,componentId:o}=this.inputProblem.detectedComponent,r=Act(e),i=t.filter((g)=>g.componentId===o),s=i.length>0?i:t,a=function(g){let f=v9e(g.map((y)=>y.center.y)).length;return v9e(g.map((y)=>y.center.x)).length===2&&f!==2?"vertical-columns":"horizontal-rows"}(s),c=function({obstacles:g,orientation:f}){let y={left:[],right:[],top:[],bottom:[]};if(f==="vertical-columns"){let C=v9e(g.map((b)=>b.center.x));for(let b of g)y[X1n(b.center.x,C)===0?"left":"right"].push(b);return y.left.sort((b,I)=>b.center.y-I.center.y),y.right.sort((b,I)=>b.center.y-I.center.y),y}let x=v9e(g.map((C)=>C.center.y));for(let C of g)y[X1n(C.center.y,x)===0?"top":"bottom"].push(C);return y.top.sort((C,b)=>C.center.x-b.center.x),y.bottom.sort((C,b)=>C.center.x-b.center.x),y}({obstacles:s,orientation:a}),l=function({bounds:g,orientation:f,sideGroups:y}){return f==="vertical-columns"?{minX:Math.max(...y.left.map((x)=>ms(x).maxX)),maxX:Math.min(...y.right.map((x)=>ms(x).minX)),minY:g.minY,maxY:g.maxY}:{minX:g.minX,maxX:g.maxX,minY:Math.max(...y.top.map((x)=>ms(x).maxY)),maxY:Math.min(...y.bottom.map((x)=>ms(x).minY))}}({bounds:n,orientation:a,sideGroups:c}),h=o,d=this.inputProblem.viaDiameter??J8e(this.inputProblem.inputSrj).padDiameter,u=this.inputProblem.obstacleMargin??this.inputProblem.inputSrj.defaultObstacleMargin??0.15,_=2*(d+u),p=a==="vertical-columns"?["left","right"]:["top","bottom"],m=[{key:"center",bounds:l,regionType:"center"},...qni(s,e),...p.flatMap((g)=>function({side:f,sideObstacles:y,bounds:x,centralBounds:C}){let b=[];for(let I=0;I<y.length-1;I++){let v=ms(y[I]),P=ms(y[I+1]),M;M=f==="left"?{minX:x.minX,maxX:C.minX,minY:v.maxY,maxY:P.minY}:f==="right"?{minX:C.maxX,maxX:x.maxX,minY:v.maxY,maxY:P.minY}:f==="top"?{minX:v.maxX,maxX:P.minX,minY:x.minY,maxY:C.minY}:{minX:v.maxX,maxX:P.minX,minY:C.maxY,maxY:x.maxY},b.push({key:`${f}-gap-${I}`,bounds:M,regionType:"pad-gap"})}return b}({side:g,sideObstacles:c[g],bounds:n,centralBounds:l}))],A=m.flatMap((g)=>$ni({nodeId:`soic:${h}:${g.key}`,bounds:g.bounds,availableZ:r,multiLayerThreshold:_,regionType:g.regionType,obstacleZ:g.obstacleZ,connectedTo:g.connectedTo}));this.output={routingRegions:A},this.stats={componentId:o,layerCount:e,orientation:a,viaDiameter:d,obstacleMargin:u,multiLayerThreshold:_,firstSidePadCount:c[p[0]].length,secondSidePadCount:c[p[1]].length,multiLayerNodeCount:A.filter((g)=>g.availableZ.length>1).length,totalMeshNodeCount:A.length},this.solved=!0}getOutput(){if(!this.output)throw Error("SoicTopologyGeneratorSolver has not solved yet");return this.output}});var jra=YZ(YCn(),1),Jni=new Set(["left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]),Zni=new Set(["left","right","top","bottom"]),eoi={top_left:{direction:"up",preferredExit:"top-left",exitEdge:"top"},top_middle:{direction:"up",preferredExit:"top",exitEdge:"top"},top_right:{direction:"up",preferredExit:"top-right",exitEdge:"top"},right_top:{direction:"right",preferredExit:"top-right",exitEdge:"right"},right_middle:{direction:"right",preferredExit:"right",exitEdge:"right"},right_bottom:{direction:"right",preferredExit:"bottom-right",exitEdge:"right"},bottom_right:{direction:"down",preferredExit:"bottom-right",exitEdge:"bottom"},bottom_middle:{direction:"down",preferredExit:"bottom",exitEdge:"bottom"},bottom_left:{direction:"down",preferredExit:"bottom-left",exitEdge:"bottom"},left_bottom:{direction:"left",preferredExit:"bottom-left",exitEdge:"left"},left_middle:{direction:"left",preferredExit:"left",exitEdge:"left"},left_top:{direction:"left",preferredExit:"top-left",exitEdge:"left"},top:{direction:"up",preferredExit:"top",exitEdge:"top"},right:{direction:"right",preferredExit:"right",exitEdge:"right"},bottom:{direction:"down",preferredExit:"bottom",exitEdge:"bottom"},left:{direction:"left",preferredExit:"left",exitEdge:"left"}};function j1n(e){let t=[...e].sort((o,r)=>o-r),n=[];for(let o of t)if(n.length===0||Math.abs(n[n.length-1]-o)>0.000001)n.push(o);return n}function K1n(e){let t=Number.POSITIVE_INFINITY;for(let n=1;n<e.length;n++){let o=e[n]-e[n-1];if(o>0.000001)t=Math.min(t,o)}return t}function $1n(e,t){let n=t==="x"?"y":"x",o=Number.POSITIVE_INFINITY;for(let r=0;r<e.length;r++){let i=e[r];for(let s=r+1;s<e.length;s++){let a=e[s];if(Math.abs(i.center[n]-a.center[n])>0.000001)continue;let c=Math.abs(i.center[t]-a.center[t]);if(c>0.000001)o=Math.min(o,c)}}return o}function toi(e){return{minX:Math.min(...e.map((t)=>t.center.x-t.width/2)),maxX:Math.max(...e.map((t)=>t.center.x+t.width/2)),minY:Math.min(...e.map((t)=>t.center.y-t.height/2)),maxY:Math.max(...e.map((t)=>t.center.y+t.height/2))}}function c7n(e,t){let n=t.componentBounds?.[e.componentId];if(!n){let r=e.pitchX*2.25,i=e.pitchY*2.25;return{minX:e.bounds.minX-r,maxX:e.bounds.maxX+r,minY:e.bounds.minY-i,maxY:e.bounds.maxY+i}}if([n.minX,n.maxX,n.minY,n.maxY].some((r)=>!Number.isFinite(r))||n.minX>=n.maxX||n.minY>=n.maxY)throw Error(`FanoutSolver: componentBounds for "${e.componentId}" must contain finite, increasing bounds`);if(n.minX>e.bounds.minX+0.000001||n.maxX<e.bounds.maxX-0.000001||n.minY>e.bounds.minY+0.000001||n.maxY<e.bounds.maxY-0.000001)throw Error(`FanoutSolver: componentBounds for "${e.componentId}" must contain every component pad`);return{...n}}function q1n(e,t){if([e.minX,e.maxX,e.minY,e.maxY].some((o)=>!Number.isFinite(o))||e.minX>=e.maxX||e.minY>=e.maxY)throw Error("FanoutSolver: sharedBoundary must contain finite, increasing bounds");for(let o of t)if(e.minX>o.bounds.minX+0.000001||e.maxX<o.bounds.maxX-0.000001||e.minY>o.bounds.minY+0.000001||e.maxY<o.bounds.maxY-0.000001)throw Error(`FanoutSolver: sharedBoundary must contain every pad of component "${o.componentId}"`);return{...e}}function noi(e,t){if(t.sharedBoundary)return q1n(t.sharedBoundary,e);let n=e.map((i)=>c7n(i,t)),r=Math.max(...e.flatMap((i)=>[i.pitchX,i.pitchY]))*2.25;return q1n({minX:Math.min(...n.map((i)=>i.minX))-r,maxX:Math.max(...n.map((i)=>i.maxX))+r,minY:Math.min(...n.map((i)=>i.minY))-r,maxY:Math.max(...n.map((i)=>i.maxY))+r},e)}function ooi(e){let t=new Map;for(let o of e){if(!o.componentId||o.isCopperPour)continue;let r=t.get(o.componentId)??[];r.push(o),t.set(o.componentId,r)}let n=[];for(let[o,r]of t){let i=j1n(r.map((A)=>A.center.x)),s=j1n(r.map((A)=>A.center.y)),a=$1n(r,"x"),c=$1n(r,"y"),l=K1n(i),h=K1n(s),d=Math.min(...[a,c,l,h].filter(Number.isFinite)),u=Math.max(...r.flatMap((A)=>[A.width,A.height])),_=Number.isFinite(d)?d:u,p=Number.isFinite(a)?a:Number.isFinite(l)?l:_,m=Number.isFinite(c)?c:Number.isFinite(h)?h:_;n.push({componentId:o,obstacles:r,xCoordinates:i,yCoordinates:s,pitchX:p,pitchY:m,bounds:toi(r)})}return n}function l7n(e){return"layer"in e?[e.layer]:e.layers}function h7n(e){let{point:t,connection:n,componentGrids:o}=e,r=l7n(t),i=[];for(let s of o){let a=s.obstacles.filter((c)=>c.layers.some((l)=>r.includes(l))).filter((c)=>Ijr(t,c,0.00001)).sort((c,l)=>{let h=c.connectedTo.includes(n.name)||c.connectedTo.includes(t.pointId??"")||c.connectedTo.includes(t.pcb_port_id??""),d=l.connectedTo.includes(n.name)||l.connectedTo.includes(t.pointId??"")||l.connectedTo.includes(t.pcb_port_id??"");if(h!==d)return h?-1:1;return c.width*c.height-l.width*l.height});if(a[0])i.push({grid:s,obstacle:a[0]})}return i}function roi(e){for(let n of e.pointsToConnect)if("layers"in n&&n.busId)return n.busId;return/^BUS[_:-]([^_:-]+)(?:[_:-]\d+)?$/i.exec(e.name)?.[1]??null}function $de(e,t){if(t===void 0)return;if(!Jni.has(t))throw Error(`FanoutSolver: bus "${e}" has invalid preferredExit "${t}"`);return t}function ioi(e,t){if(t===void 0)return;if(!Zni.has(t))throw Error(`FanoutSolver: bus "${e}" has invalid exitEdge "${t}"`);return t}function soi(e,t){if(t===void 0)return;try{return Mjr(t)}catch{throw Error(`FanoutSolver: bus "${e}" has invalid exitPosition "${t}"`)}}function Bot(e){let{busId:t,exitPosition:n,fieldName:o,expected:r,actual:i,sourceName:s}=e;if(i===void 0||i===r)return;throw Error(`FanoutSolver: bus "${t}" exitPosition "${n}" conflicts with ${s} ${o} "${i}"`)}function aoi(e){let{busId:t,requestedBus:n,options:o}=e,r=n.exitPosition,i=soi(t,r),s=$de(t,n.preferredExit),a=$de(t,o.busExitPreferences?.[t]),c=ioi(t,n.exitEdge);if(i&&r){for(let[d,u]of[[n.direction,"bus"],[o.busDirections?.[t],"busDirections"]])Bot({busId:t,exitPosition:r,fieldName:"direction",expected:i.direction,actual:d,sourceName:u});for(let[d,u]of[[s,"bus"],[a,"busExitPreferences"]])Bot({busId:t,exitPosition:r,fieldName:"preferredExit",expected:i.preferredExit,actual:d,sourceName:u});return Bot({busId:t,exitPosition:r,fieldName:"exitEdge",expected:i.exitEdge,actual:c,sourceName:"bus"}),{exitPosition:r,...i.direction?{direction:i.direction}:{},...i.preferredExit?{preferredExit:i.preferredExit}:{},...i.exitEdge?{exitEdge:i.exitEdge}:{}}}let l=o.busDirections?.[t]??n.direction??o.defaultDirection,h=$de(t,a??s??o.defaultPreferredExit);return{...l?{direction:l}:{},...h?{preferredExit:h}:{},...c?{exitEdge:c}:{}}}function coi(e,t){if(t===void 0)return;if(t.length===0)throw Error(`FanoutSolver: bus "${e}" must allow at least one layer`);for(let n of t)if(typeof n!=="string"||n.length===0)throw Error(`FanoutSolver: bus "${e}" has an invalid allowed layer`);return[...new Set(t)]}function loi(e,t){if(t===void 0)return;if(!Number.isFinite(t)||t<0)throw Error(`FanoutSolver: bus "${e}" maxLengthSkew must be a finite non-negative number`);return t}function hoi(e){if(e===void 0)return;if(e.length===0)throw Error("FanoutSolver: availableCornersAndSides must contain at least one boundary region");let t=[],n=new Set;for(let o of e){let r=eoi[o];if(!r)throw Error(`FanoutSolver: invalid availableCornersAndSides value "${o}"`);let i=`${r.exitEdge}:${r.direction}:${r.preferredExit}`;if(n.has(i))continue;n.add(i),t.push(r)}return t}function doi(e,t){if(t===void 0||t.type==="boundary")return{type:"boundary"};if(t.type!=="plane"||typeof t.layer!=="string"||t.layer.length===0)throw Error(`FanoutSolver: bus "${e}" has an invalid termination target`);return{type:"plane",layer:t.layer}}function uoi(e,t){let n=t.buses??e.buses,o=new Map,r=new Set,i=new Set(e.connections.map((s)=>s.name));for(let s of n??[]){if(o.has(s.busId))throw Error(`FanoutSolver: duplicate bus id "${s.busId}"`);for(let d of s.connectionNames){if(!i.has(d))throw Error(`FanoutSolver: bus "${s.busId}" references unknown connection "${d}"`);if(r.has(d))throw Error(`FanoutSolver: connection "${d}" belongs to more than one bus`);r.add(d)}let a=doi(s.busId,s.termination),c=aoi({busId:s.busId,requestedBus:s,options:t}),l=coi(s.busId,s.allowedLayers),h=loi(s.busId,s.maxLengthSkew);if(a.type==="plane"&&h!==void 0)throw Error(`FanoutSolver: plane-terminated bus "${s.busId}" cannot specify maxLengthSkew`);if(a.type==="plane"&&c.preferredExit!==void 0)throw Error(`FanoutSolver: plane-terminated bus "${s.busId}" cannot also specify preferredExit`);o.set(s.busId,{...s,sourceComponentId:s.sourceComponentId??t.sourceComponentId,...c,...l===void 0?{}:{allowedLayers:l},...h===void 0?{}:{maxLengthSkew:h},termination:a})}for(let s of e.connections){if(r.has(s.name))continue;let a=roi(s);if(a){let c=o.get(a);if(c)o.set(a,{...c,connectionNames:[...c.connectionNames,s.name]});else o.set(a,{busId:a,connectionNames:[s.name],direction:t.busDirections?.[a]??t.defaultDirection,sourceComponentId:t.sourceComponentId,preferredExit:$de(a,t.busExitPreferences?.[a]??t.defaultPreferredExit),termination:{type:"boundary"}})}else{let c=`connection:${s.name}`;o.set(c,{busId:c,connectionNames:[s.name],sourceComponentId:t.sourceComponentId,direction:t.busDirections?.[c]??t.defaultDirection,preferredExit:$de(c,t.busExitPreferences?.[c]??t.defaultPreferredExit),termination:{type:"boundary"}})}}return[...o.values()]}function poi(e){let{busSpec:t,connections:n,componentGrids:o}=e,r=new Map;for(let l of n){let h=new Set;for(let d of l.pointsToConnect)for(let u of h7n({point:d,connection:l,componentGrids:o}))h.add(u.grid.componentId);for(let d of h)r.set(d,(r.get(d)??0)+1)}let i=[...o].sort((l,h)=>{let d=(r.get(h.componentId)??0)-(r.get(l.componentId)??0);if(d!==0)return d;return h.obstacles.length-l.obstacles.length})[0],s=t.sourceComponentId?o.find((l)=>l.componentId===t.sourceComponentId):void 0;if(t.sourceComponentId&&!s)throw Error(`FanoutSolver: source component "${t.sourceComponentId}" for bus "${t.busId}" was not found`);let a=s??i,c=a?r.get(a.componentId)??0:0;if(!a||c!==n.length)throw Error(t.sourceComponentId?`FanoutSolver: source component "${t.sourceComponentId}" is not an endpoint on every connection in bus "${t.busId}"`:`FanoutSolver: bus "${t.busId}" does not have one component endpoint on every connection`);return a}function moi(e,t,n,o){let i=t.pointsToConnect.filter((s,a)=>a!==n).sort((s,a)=>x6(e,a)-x6(e,s))[0];if(!i&&o.type==="plane")return e;if(!i)throw Error(`FanoutSolver: connection "${t.name}" has no target beyond its BGA pad`);return i}function _oi(e){let{connection:t,connectionIndex:n,sourceGrid:o,componentGrids:r,termination:i,exitTargetPoint:s}=e;for(let a=0;a<t.pointsToConnect.length;a++){let c=t.pointsToConnect[a],l=h7n({point:c,connection:t,componentGrids:r}).find((u)=>u.grid.componentId===o.componentId);if(!l)continue;let h=l7n(c).find((u)=>l.obstacle.layers.includes(u));if(!h)throw Error(`FanoutSolver: connection "${t.name}" has no source layer shared with its BGA pad`);let d=moi(c,t,a,i);return{connection:t,connectionIndex:n,sourcePoint:c,sourcePointIndex:a,sourceLayer:h,sourceObstacle:l.obstacle,targetPoint:d,exitTargetPoint:s??{x:d.x,y:d.y},hasExplicitLayeredExitTarget:s?.layer!==void 0}}throw Error(`FanoutSolver: connection "${t.name}" does not touch component "${o.componentId}"`)}function Uit(e,t){let n=0,o=0;for(let r of t){let i=r.exitTargetPoint??r.targetPoint;n+=i.x-r.sourcePoint.x,o+=i.y-r.sourcePoint.y}if(Math.abs(n)<0.000000001&&Math.abs(o)<0.000000001)throw Error(`FanoutSolver: cannot infer an escape direction for bus "${e}"`);if(Math.abs(n)>=Math.abs(o))return n>=0?"right":"left";return o>=0?"up":"down"}function goi(e){switch(e){case"left":return["left"];case"right":return["right"];case"top":return["up"];case"bottom":return["down"];case"top-left":return["up","left"];case"top-right":return["up","right"];case"bottom-left":return["down","left"];case"bottom-right":return["down","right"]}}function d7n(e){return{x:e.reduce((t,n)=>t+n.sourcePoint.x,0)/e.length,y:e.reduce((t,n)=>t+n.sourcePoint.y,0)/e.length}}function d8e(e,t,n){switch(t){case"left":return e.x-n.minX;case"right":return n.maxX-e.x;case"up":return n.maxY-e.y;case"down":return e.y-n.minY}}function J1n(e,t){if(e.direction==="up"||e.direction==="down"){if(e.preferredExit.endsWith("left"))return t.minX;if(e.preferredExit.endsWith("right"))return t.maxX;return(t.minX+t.maxX)/2}if(e.preferredExit.startsWith("top"))return t.maxY;if(e.preferredExit.startsWith("bottom"))return t.minY;return(t.minY+t.maxY)/2}function Z1n(e,t){return t==="up"||t==="down"?e.x:e.y}function Aoi(e,t){try{return Uit(e,t)}catch{return}}function foi(e){let{busId:t,explicitDirection:n,preferredExit:o,connections:r,sharedBoundary:i,availableRegions:s}=e,a=s.filter((u)=>(n===void 0||u.direction===n)&&(o===void 0||u.preferredExit===o));if(a.length===0)throw Error(`FanoutSolver: bus "${t}" cannot use its requested exit with availableCornersAndSides`);let c=n?void 0:Aoi(t,r),l=c?a.filter((u)=>u.direction===c):[],h=l.length>0?l:a,d=d7n(r);return[...h].toSorted((u,_)=>d8e(d,u.direction,i)-d8e(d,_.direction,i)||Math.abs(Z1n(d,u.direction)-J1n(u,i))-Math.abs(Z1n(d,_.direction)-J1n(_,i))||u.preferredExit.localeCompare(_.preferredExit))[0]}function yoi(e){let{busId:t,exitEdge:n,preferredExit:o,availableRegions:r}=e,i=Wve(n,o);if(!r.some((a)=>a.exitEdge===n&&Wve(a.exitEdge,a.preferredExit)===i))throw Error(`FanoutSolver: bus "${t}" cannot use its requested exit with availableCornersAndSides`)}function xoi(e){let{busId:t,explicitDirection:n,preferredExit:o,connections:r,sharedBoundary:i,availableRegions:s}=e;if(s)return foi({busId:t,explicitDirection:n,preferredExit:o,connections:r,sharedBoundary:i,availableRegions:s});if(!o)return{direction:n??Uit(t,r)};let a=goi(o);if(n){if(!a.includes(n))throw Error(`FanoutSolver: bus "${t}" direction "${n}" is incompatible with preferredExit "${o}"`);return{direction:n,preferredExit:o}}if(a.length===1)return{direction:a[0],preferredExit:o};let c;try{c=Uit(t,r)}catch{c=void 0}if(c&&a.includes(c))return{direction:c,preferredExit:o};let l=d7n(r);return{direction:a.toSorted((h,d)=>d8e(l,h,i)-d8e(l,d,i)||h.localeCompare(d))[0],preferredExit:o}}function Coi(e,t){let n=ooi(e.obstacles);if(n.length===0&&e.connections.length>0)throw Error("FanoutSolver: no componentId-tagged pad footprint was found");let o=new Map(e.connections.map((h,d)=>[h.name,d])),r=uoi(e,t).map((h)=>{for(let[p,m]of Object.entries(h.connectionExitTargets??{})){if(!h.connectionNames.includes(p))throw Error(`FanoutSolver: connectionExitTargets contains connection "${p}" outside bus "${h.busId}"`);if(!Number.isFinite(m.x)||!Number.isFinite(m.y))throw Error(`FanoutSolver: connectionExitTargets for connection "${p}" must contain finite x and y coordinates`)}let d=h.connectionNames.map((p)=>{let m=o.get(p);if(m===void 0)throw Error(`FanoutSolver: connection "${p}" is missing from the input`);return e.connections[m]}),u=poi({busSpec:h,connections:d,componentGrids:n}),_=d.map((p)=>_oi({connection:p,connectionIndex:o.get(p.name),sourceGrid:u,componentGrids:n,termination:h.termination??{type:"boundary"},exitTargetPoint:h.connectionExitTargets?.[p.name]}));return{busSpec:h,sourceGrid:u,preparedConnections:_}}),i=[...new Map(r.map(({sourceGrid:h})=>[h.componentId,h])).values()],s=noi(i,t),a=hoi(t.availableCornersAndSides),c=[];for(let{busSpec:h,sourceGrid:d,preparedConnections:u}of r){if(h.exitEdge&&!h.preferredExit)throw Error(`FanoutSolver: bus "${h.busId}" exitEdge requires preferredExit`);if(h.exitEdge&&h.preferredExit&&!dbn(h.preferredExit,h.exitEdge))throw Error(`FanoutSolver: bus "${h.busId}" exitEdge "${h.exitEdge}" is incompatible with preferredExit "${h.preferredExit}"`);let _=xoi({busId:h.busId,explicitDirection:h.direction??t.busDirections?.[h.busId],preferredExit:h.preferredExit,connections:u,sharedBoundary:s,availableRegions:h.termination?.type==="plane"||h.exitEdge?void 0:a});if(h.termination?.type!=="plane"&&h.exitEdge&&_.preferredExit&&a)yoi({busId:h.busId,exitEdge:h.exitEdge,preferredExit:_.preferredExit,availableRegions:a});c.push({busId:h.busId,...h.maxLengthSkew===void 0?{}:{maxLengthSkew:h.maxLengthSkew},direction:_.direction,preferredExit:_.preferredExit,...h.exitEdge?{exitEdge:h.exitEdge}:{},cornerBandConnectionCount:0,allowedLayers:h.allowedLayers,termination:h.termination??{type:"boundary"},connections:u,componentId:d.componentId,componentObstacles:d.obstacles,componentBounds:c7n(d,t),sharedBoundary:s,xCoordinates:[...d.xCoordinates],yCoordinates:[...d.yCoordinates],pitchX:d.pitchX,pitchY:d.pitchY})}let l=new Map;for(let h of c){let d=Wve(h.exitEdge,h.preferredExit);if(!h.exitEdge||!d)continue;let u=`${h.exitEdge}:${d}`;l.set(u,(l.get(u)??0)+h.connections.length)}for(let h of c){let d=Wve(h.exitEdge,h.preferredExit);if(!h.exitEdge||!d)continue;h.cornerBandConnectionCount=l.get(`${h.exitEdge}:${d}`)??h.connections.length}return c}var Kra=Math.PI*2,$ra=globalThis.process?.env?.FANOUT_FLOW_DEBUG==="1",boi=(e)=>e.process??{env:{}},qra=boi(globalThis);function eyn(e,t){if(e.length<2)return null;let n=(e.at(-1)-e[0])/(e.length-1),o=Number(n.toPrecision(3));if(!(o>0)||Math.abs(o-n)>t)return null;let r=e.reduce((c,l,h)=>c+l-h*o,0)/e.length,i=10**(Math.floor(Math.log10(o))-2),s=Math.round(r/i)*i,a=e.map((c,l)=>s+l*o);if(a.some((c,l)=>Math.abs(c-e[l])>t))return null;return{coordinates:a,pitch:o}}function fct(e,t){let n=structuredClone(e.connections),o=[],r=[],i=[],s=o0e(e.layerCount);for(let[A,g]of n.entries()){let f=t.targetLayers.get(g.name);if(!f||!s.includes(f))throw Error(`Missing or invalid target layer for ${g.name}`);if(g.pointsToConnect.length!==2)throw Error(`${g.name}: two terminals required`);for(let[y,x]of g.pointsToConnect.entries()){if(("layer"in x?[x.layer]:x.layers).includes(f)){let{layers:v,...P}=x;g.pointsToConnect[y]={...P,layer:f};continue}let b=e.obstacles.find((v)=>v.componentId&&hbn(x,v)<0.00000001&&v.connectedTo.some((P)=>P===x.pcb_port_id||P===x.pointId||P===g.name));if(!b?.componentId)throw Error(`${g.name}: local dogbone requires a component pad terminal`);let I=`dogbone_endpoint_${o.length}`;o.push({connectionIndex:A,pointIndex:y}),r.push({...g,name:I,pointsToConnect:[x,g.pointsToConnect[1-y]]}),i.push({busId:I,connectionNames:[I],sourceComponentId:b.componentId})}}if(!o.length)return{connections:n,traces:[]};let a=Coi({...e,connections:r,buses:[]},{buses:i});for(let A of a){let g=Math.min(...A.componentObstacles.flatMap((I)=>[I.width,I.height]))/100,f=(I)=>{let v=[];for(let P of[...I].sort((M,B)=>M-B))if(v.length&&P-v.at(-1)[0]<g)v.at(-1).push(P);else v.push([P]);return v.map((P)=>P.reduce((M,B)=>M+B,0)/P.length)};A.xCoordinates=f(A.xCoordinates),A.yCoordinates=f(A.yCoordinates);let y=(I,v)=>I.length>1?Math.min(...I.slice(1).map((P,M)=>P-I[M])):v;A.pitchX=y(A.xCoordinates,A.pitchX),A.pitchY=y(A.yCoordinates,A.pitchY);let x=(I,v)=>I.flatMap((P,M)=>{if(M===I.length-1)return[P];let B=I[M+1]-P,T=Math.max(1,Math.round(B/v));if(Math.abs(B/T-v)>g)return[P];return Array.from({length:T},(N,D)=>P+B*D/T)});A.xCoordinates=x(A.xCoordinates,A.pitchX),A.yCoordinates=x(A.yCoordinates,A.pitchY);let C=eyn(A.xCoordinates,g),b=eyn(A.yCoordinates,g);if(C)A.xCoordinates=C.coordinates,A.pitchX=C.pitch;if(b)A.yCoordinates=b.coordinates,A.pitchY=b.pitch}let c=[],l=[];for(let A of e.traces??[])for(let[g,f]of A.route.entries())if(f.route_type==="via"){l.push({connectionIndex:-1,center:f,diameter:f.via_diameter??t.viaDiameter,spanLayers:s});let y=A.route[g+1];if(y?.route_type==="wire")c.push({connectionIndex:-1,segment:{start:f,end:y,layer:y.layer,width:y.width}})}else if(f.route_type==="wire"){let y=A.route[g+1];if(y?.route_type==="wire")c.push({connectionIndex:-1,segment:{start:f,end:y,layer:f.layer,width:f.width}});else if(y?.route_type==="via")c.push({connectionIndex:-1,segment:{start:f,end:y,layer:f.layer,width:f.width}})}else throw Error("Unsupported fixed copper primitive for local dogbones");let h={viaDiameter:t.viaDiameter,viaHoleDiameter:t.viaHoleDiameter,traceWidth:t.traceWidth,clearance:t.clearance,holeToHoleClearance:t.holeToHoleClearance,additionalObstacles:e.obstacles,blockingSegments:c,blockingVias:l},d=Hjr(a,h),u=new Map;for(let A of a.flatMap((g)=>g.connections)){let g=d.filter((x)=>x.connectionIndex===A.connectionIndex),f=A.sourcePoint,y=(x)=>Number(x.x<f.x)*2+Number(x.y>f.y)*2+Math.hypot(x.x-f.x,x.y-f.y);if(g.sort((x,C)=>y(x.point)-y(C.point)),g[0])u.set(A.connectionIndex,g[0].point)}let _=Ljr(a,{...h,preferredViaPointsByConnectionIndex:u});if(!_)throw Error("No collision-free local dogbone assignment");let p=a.flatMap((A)=>A.connections);for(let A=0;A<p.length;A++)for(let g=0;g<A;g++){let f=p[A],y=p[g],x=_.get(f.connectionIndex),C=_.get(y.connectionIndex),b={start:f.sourcePoint,end:x,layer:f.sourceLayer,width:t.traceWidth},I={start:y.sourcePoint,end:C,layer:y.sourceLayer,width:t.traceWidth},v=Math.max(t.viaDiameter+t.clearance,t.viaHoleDiameter+(t.holeToHoleClearance??t.clearance)),P=t.viaDiameter/2+t.traceWidth/2+t.clearance;if(x6(x,C)<v-0.000000001||vv(x,I.start,I.end)<P-0.000000001||vv(C,b.start,b.end)<P-0.000000001||f.sourceLayer===y.sourceLayer&&!mat(b,I,t.clearance))throw Error("Local dogbones collide between components")}let m=[];for(let[A,g]of o.entries()){let f=n[g.connectionIndex],y=f.pointsToConnect[g.pointIndex],C=a.flatMap((M)=>M.connections).find((M)=>M.connectionIndex===A).sourceLayer,b=t.targetLayers.get(f.name),I=_.get(A),v=t.viaDiameter/2+(t.boardEdgeClearance??0);if(I.x<e.bounds.minX+v||I.x>e.bounds.maxX-v||I.y<e.bounds.minY+v||I.y>e.bounds.maxY-v)throw Error(`${f.name}: dogbone outside board bounds`);let P=Pjr({fromLayer:C,toLayer:b,layerNames:s,allowBlindAndBuriedVias:t.allowBlindAndBuriedVias??!1});m.push({type:"pcb_trace",pcb_trace_id:`local_dogbone_${f.name}_${g.pointIndex}`,connection_name:f.name,route:[{route_type:"wire",x:y.x,y:y.y,layer:C,width:t.traceWidth},{route_type:"wire",...I,layer:C,width:t.traceWidth},{route_type:"via",...I,from_layer:C,to_layer:b,layers:P,via_diameter:t.viaDiameter,via_hole_diameter:t.viaHoleDiameter},{route_type:"wire",...I,layer:b,width:t.traceWidth}]}),f.pointsToConnect[g.pointIndex]={...I,layer:b}}return{connections:n,traces:m}}function d0e(e,t,n){let o=e.connections.reduce((_,p)=>({x:_.x+p.pointsToConnect[1].x-p.pointsToConnect[0].x,y:_.y+p.pointsToConnect[1].y-p.pointsToConnect[0].y}),{x:0,y:0}),r=Math.abs(o.x)>Math.abs(o.y)?o.x>0?3:1:0,i=new Set((e.buses??[]).flatMap((_)=>_.connectionNames)),s=Jk({...e,connections:e.connections.filter((_)=>i.has(_.name))}),a=e.traces?.length?[0,...[0,1,2,3].map((_)=>(r+_)%4).filter((_)=>_!==0)]:[3,0,1,2].map((_)=>(r+_)%4),c=s?(r+n)%4:a[n%4],l=(_,p)=>{let{x:m,y:A}=_;for(let g=0;g<p;g++)[m,A]=[-A,m];return{..._,x:m,y:A}},h=[{x:e.bounds.minX,y:e.bounds.minY},{x:e.bounds.maxX,y:e.bounds.maxY}].map((_)=>l(_,c)),d={...e,bounds:{minX:Math.min(...h.map((_)=>_.x)),maxX:Math.max(...h.map((_)=>_.x)),minY:Math.min(...h.map((_)=>_.y)),maxY:Math.max(...h.map((_)=>_.y))},connections:e.connections.map((_)=>({..._,pointsToConnect:_.pointsToConnect.map((p)=>l(p,c))})),obstacles:e.obstacles.map((_)=>({..._,center:l(_.center,c),ccwRotationDegrees:(_.ccwRotationDegrees??0)+90*c})),traces:e.traces?.map((_)=>({..._,route:_.route.map((p)=>l(p,c))}))},u=fct(d,t);return{connections:u.connections.map((_)=>({..._,pointsToConnect:_.pointsToConnect.map((p)=>l(p,(4-c)%4))})),traces:u.traces.map((_)=>({..._,route:_.route.map((p)=>{if(!("x"in p))throw Error("Unexpected dogbone primitive");return l(p,(4-c)%4)})}))}}function*tG(e,t){let n=e.next(),o=0;try{while(!n.done&&o++<t)yield,n=e.next();return n.done?n.value:null}finally{if(!n.done)e.return(null)}}function v6(e,t){return e.buses?.find((n)=>n.connectionNames.includes(t.name))?.traceWidth??t.nominalTraceWidth??t.width??e.minTraceWidth}function u0e(e,t){return{targetLayers:t,viaDiameter:e.minViaPadDiameter??0.6,viaHoleDiameter:e.minViaHoleDiameter??0.3,traceWidth:Math.max(e.minTraceWidth,...e.connections.map((n)=>v6(e,n))),clearance:e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075,boardEdgeClearance:e.minBoardEdgeClearance,holeToHoleClearance:e.minViaHoleEdgeToViaHoleEdgeClearance,allowBlindAndBuriedVias:e.allowBlindAndBuriedVias??!1}}function p0e(e,t){return t.map((n)=>({...n,source_trace_id:e.connections.find((o)=>o.name===n.connection_name)?.source_trace_id??n.connection_name}))}function*Ioi(e,t,n,o){let r=structuredClone(t),i=n,s=o,a=new Map(e.connections.map((d)=>[d.name,v6(e,d)])),c=r.connections.filter((d)=>!i.some((u)=>u.connection_name===d.name));if(!c.length)return{input:r,traces:i,escapes:s};if(c.length>3||c.some((d)=>!r.buses?.some((u)=>u.connectionNames.includes(d.name))))return null;let l=(d)=>c.filter((u)=>d.includes(u.name)).length,h=(r.buses??[]).filter((d)=>l(d.connectionNames)).sort((d,u)=>l(u.connectionNames)-l(d.connectionNames));for(let d of h){let u=new Set(d.connectionNames),_=e.connections.filter((x)=>u.has(x.name)),p=i.filter((x)=>!u.has(x.connection_name)),m=r.differentialPairs?.find((x)=>x.connectionNames.every((C)=>u.has(C)));if(!m||_.length!==u.size)return null;let A=r.connections.find((x)=>u.has(x.name)).pointsToConnect[0].layer,g=l(d.connectionNames)>1,f=g?[1,0,3,5,2,4]:[2,1,0,3,5,4],y=!1;for(let x=0;x<4&&!y;x++){let C=((g?1:0)+x)%4,b={...e,connections:_,traces:[...e.traces??[],...s.filter((T)=>!u.has(T.connection_name)),...p]},I;try{I=d0e(b,u0e(b,new Map(_.map((T)=>[T.name,A]))),C)}catch{yield;continue}let v=p0e(e,I.traces),P={...r,connections:I.connections,buses:[d],differentialPairs:[m],traces:[...b.traces,...v]},M=fa(P),B=P.connections.filter((T)=>!m.connectionNames.includes(T.name));for(let T of f){let N=yield*tG(CL(P,m,M,{copper:[],penalty:0,variant:T}),6000);if(!N)continue;let D=MG(P,B,M,N,a,void 0,new Map,()=>!1,!0),L=D.next(),H=0,V=0,O=null;try{while(!L.done&&H++<1e4){if(L.value.length>V){if(V=L.value.length,V>=P.connections.length-1){let U=yield*tG(tZ({...P,connections:B},L.value.filter((j)=>!m.connectionNames.includes(j.connection_name)),[...M,...N.flatMap(oi)],a,new Map,{maxSearches:200}),20000);if(U){O=[...N,...U];break}}}yield,L=D.next()}if(L.done)O=L.value}finally{if(!L.done)D.return(null)}if(!O)continue;i=[...p,...O],s=[...s.filter((U)=>!u.has(U.connection_name)),...v],r={...r,connections:r.connections.map((U)=>P.connections.find((j)=>j.name===U.name)??U),traces:[...e.traces??[],...s]},y=!0;break}}if(!y)return null}return i.length===r.connections.length?{input:r,traces:i,escapes:s}:null}function*voi(e,t,n,o={}){let r=e.connections,i=fa(e),s=new GZ,a=e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075,c=(f)=>{let y=[];for(let x=0;x<f.length;x++)for(let C=0;C<x;C++)if(f[x].route[0].layer===f[C].route[0].layer&&s.firstConflict(f[x].route,f[C].route,(f[x].route[0].width+f[C].route[0].width)/2+a-0.00000001))y.push([x,C]);return y};function*l(f,y,x){let C=[];for(let b of n.get(f.name)??[f.pointsToConnect[0].layer]){let I={...f,pointsToConnect:f.pointsToConnect.map((B)=>({...B,layer:b}))},v=new Di(e,I,v6(e,f),[...i,...y.flatMap(oi)]),P=new Tl(v,...I.pointsToConnect,x.flatMap(oi),10,void 0,{maxLength:Math.min(Ax(e,f.name),(o.lengthTargets?.get(f.name)??1/0)-C2(e,f.name)),paretoLength:!0,checkReachability:!0}),M=0;try{while(!P.solved&&!P.failed&&M++<4000)P.step(),yield;if(P.solved){let B={type:"pcb_trace",pcb_trace_id:`bus_lane_${f.name}`,connection_name:f.name,source_trace_id:f.source_trace_id??f.name,route:P.result.map((N)=>({...N,route_type:"wire",layer:b,width:v6(e,f)}))},T=o.lengthTargets?.get(f.name);if(T===void 0)C.push(B);else try{C.push(fZ({...e,connections:[I],traces:[...e.traces??[],...y],buses:[],differentialPairs:[]},uL({...e,connections:[I]},[B],[...i,...y.flatMap(oi)],1.5),new Map([[f.name,T]]),{maxCandidates:65536,packMeanders:!0})[0])}catch{}}}finally{P.cancel()}}return C}let h=t.filter((f)=>{let y=r.find((I)=>I.name===f.connection_name);if(!y||br(f.route)>Ax(e,y.name)+0.0000001)return!1;let x=o.lengthTargets?.get(y.name);if(x!==void 0&&Math.abs(br(f.route)+C2(e,y.name)-x)>0.0000001)return!1;if(y.pointsToConnect.some((I)=>![f.route[0],f.route.at(-1)].some((v)=>Math.hypot(I.x-v.x,I.y-v.y)<0.0000001)))return!1;let C=f.route[0].layer,b={...y,pointsToConnect:y.pointsToConnect.map((I)=>({...I,layer:C}))};return new Di(e,b,v6(e,y),i).pathVisible(f.route)});for(let f of r.filter((y)=>!h.some((x)=>x.connection_name===y.name))){let y=yield*l(f,[],h);if(!y.length)return o.onBlockedConnection?.(f.name),null;y.sort((x,C)=>c([...h,x]).length-c([...h,C]).length||br(x.route)-br(C.route)),h.push(y[0])}let d=(f,y,x)=>({routes:f,constraints:y,depth:x,collisions:c(f),cost:f.reduce((C,b)=>C+br(b.route),0)}),u=[d(h,new Map,0)],_=new Set,p=1/0,m=new WeakMap,A=0,g=(f)=>{if(!m.has(f))m.set(f,A++);return m.get(f)};for(let f=0;u.length&&f<(o.maxNodes??2000);f++){u.sort((b,I)=>b.collisions.length-I.collisions.length||b.depth-I.depth||b.cost-I.cost);let y=u.shift();if(!y.collisions.length)return y.routes;if(y.collisions.length<p||f%20===0){if(y.collisions.length<p)o.onBestCandidate?.(y.routes,y.collisions.map(([b,I])=>[y.routes[b].connection_name,y.routes[I].connection_name]));p=Math.min(p,y.collisions.length),o.onProgress?.({nodes:f,collisions:y.collisions.length,queue:u.length})}let x=new Map;for(let b of y.collisions)for(let I of b)x.set(I,(x.get(I)??0)+1);y.collisions.sort((b,I)=>x.get(b[0])+x.get(b[1])-(x.get(I[0])+x.get(I[1])));let C=y.collisions[0];for(let[b,I]of[C,[C[1],C[0]]]){let v=y.routes[b].connection_name,P=r.find((N)=>N.name===v),M=new Map(y.constraints);M.set(v,[...M.get(v)??[],y.routes[I]]);let B=r.map((N)=>`${N.name}:${(M.get(N.name)??[]).map(g).sort((D,L)=>D-L).join(",")}`).join(";");if(_.has(B))continue;_.add(B);let T=y.routes.filter((N,D)=>D!==b);for(let N of yield*l(P,M.get(v),T)){let D=y.routes.map((L,H)=>H===b?N:L);u.push(d(D,M,y.depth+1))}}if(u.length>256)u.sort((b,I)=>b.collisions.length-I.collisions.length||b.depth-I.depth||b.cost-I.cost),u.length=256;yield}return null}function Soi(e,t){let n=e.connections.find((m)=>m.name===t.connectionNames[0]).pointsToConnect[0].layer,o=e.buses?.find((m)=>t.connectionNames.some((A)=>m.connectionNames.includes(A))),r=o?[o]:(e.buses??[]).filter((m)=>e.connections.some((A)=>m.connectionNames.includes(A.name)&&A.pointsToConnect[0].layer===n));if(!r.length)return[];let i=r[0],s=new Set(r.flatMap((m)=>m.connectionNames)),a=e.connections.filter((m)=>s.has(m.name)),c=EG(e,0),l=a[0].pointsToConnect[0].layer,h=i.traceWidth??e.minTraceWidth,d=e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075,u=Math.max(0,a.length-2)*(h+d),_=new Map;for(let m of a)for(let A of m.pointsToConnect){let g=c.map((b,I)=>({box:b.pads,index:I,distance:Math.hypot(A.x-(b.pads.minX+b.pads.maxX)/2,A.y-(b.pads.minY+b.pads.maxY)/2)})).sort((b,I)=>b.distance-I.distance)[0];if(!g)continue;let{box:f}=g,y=[{side:"left",d:A.x-f.minX,x:-1,y:0},{side:"right",d:f.maxX-A.x,x:1,y:0},{side:"bottom",d:A.y-f.minY,x:0,y:-1},{side:"top",d:f.maxY-A.y,x:0,y:1}].sort((b,I)=>b.d-I.d)[0],x=`${g.index}:${y.side}`,C=_.get(x);if(!C)_.set(x,C=[]);C.push({point:A,edge:y,name:m.name})}let p=[];for(let m of _.values()){let A=Math.min(...m.map((g)=>g.edge.d));for(let{point:g,edge:f,name:y}of m){if(t.connectionNames.includes(y)||f.d>A+h/2)continue;p.push({a:g,b:{x:g.x+f.x*u,y:g.y+f.y*u},radius:h/2,layer:l,owners:[y]})}}return p}function*u7n(e,t,n=!1){let o=e.differentialPairs??[],r=e.buses?.some((m)=>m.maxLength!==void 0),i=o.map(()=>[]),s=o.map(()=>new Set),a=new Set,c=fa(e),l=new GZ,h=e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075,d=new Map,u=0,_=(m,A)=>m.layer===A.layer&&m.traces.some((g)=>A.traces.some((f)=>l.firstConflict(g.route,f.route,(g.route[0].width+f.route[0].width)/2+h-0.00000001))),p=n?[100,2,3,0,1,101,102,103,4,104,5,105,6,106,7,107]:[1,2,[0,1],[1,0],0,[0,2],[2,0],3,[1,2],[2,1],4,5,6,7];for(let m of p){for(let[C,b]of o.entries()){let I=b.connectionNames.map((P)=>e.connections.find((M)=>M.name===P)),v=t.get(I[0].name)?.filter((P)=>I.every((M)=>t.get(M.name)?.includes(P)))??[I[0].pointsToConnect[0].layer];for(let P of v.filter((M)=>!e.allowedLayers||e.allowedLayers.includes(M))){let M=typeof m==="number"&&m>=100,B=JSON.stringify([C,P,M]),T=d.get(B)??{...e,connections:e.connections.map((H)=>b.connectionNames.includes(H.name)?{...H,pointsToConnect:H.pointsToConnect.map((V)=>({...V,layer:P}))}:H)};d.set(B,T);let N=tG(CL(T,b,M?[...c,...Soi(T,b)]:c,{copper:[],penalty:0,...typeof m==="number"?{variant:M?m-100:m}:{handoffOffsets:m}}),6000),D=N.next();try{while(!D.done)yield void 0,D=N.next()}finally{if(!D.done)N.return(null)}if(!D.value)continue;if(r&&D.value.some((H)=>br(H.route)>Ax(e,H.connection_name)+0.0000001))continue;let L=JSON.stringify(D.value.map((H)=>H.route));if(s[C].has(L))continue;s[C].add(L),i[C].push({id:u++,layer:P,traces:D.value,length:D.value.reduce((H,V)=>H+br(V.route),0)})}}if(r)for(let C of i)C.sort((b,I)=>b.length-I.length);let A=[],g=(C,b)=>{if(A.length>=256)return;if(b===i.length){let I=C.map((v)=>v.id).join(",");if(!a.has(I))A.push(C);return}for(let I of i[b])if(!C.some((v)=>_(I,v)))g([...C,I],b+1)};g([],0);let f=new Set(e.buses?.flatMap((C)=>C.connectionNames)),y=new Set(o.flatMap((C)=>C.connectionNames)),x=new Map(A.map((C)=>[C,n?e.connections.filter((b)=>f.has(b.name)&&!y.has(b.name)).reduce((b,I)=>b+C.filter((v)=>v.layer===I.pointsToConnect[0].layer).flatMap((v)=>v.traces).filter((v)=>l.firstConflict(I.pointsToConnect,v.route,(v.route[0].width+e.minTraceWidth)/2+h-0.00000001)).length,0):0]));A.sort((C,b)=>x.get(C)-x.get(b)||C.reduce((I,v)=>I+v.length,0)-b.reduce((I,v)=>I+v.length,0));for(let C of A)a.add(C.map((b)=>b.id).join(",")),yield C.flatMap((b)=>b.traces)}}var u8e=(e,t)=>Gn(e,t)<0.00000001;function Poi(e,t,n){let o=[[],[]],r={...e,connections:[t]};for(let i=0;i<2;i++){let s=[];for(let a=0;a<8;a++)try{let c=fct({...r,obstacles:[...r.obstacles,...s]},n),l=c.connections[0].pointsToConnect[i];if(o[i].some((d)=>u8e(d.point,l)))break;let h=p0e(e,c.traces).find((d)=>u8e(d.route[0],t.pointsToConnect[i]));if(!h)break;o[i].push({point:l,escape:h,copper:fa({...e,obstacles:[],traces:[h]})}),s.push({type:"rect",center:{x:l.x,y:l.y},width:0.000001,height:0.000001,layers:o0e(e.layerCount),connectedTo:[]})}catch{break}o[i].sort((a,c)=>a.point.x-c.point.x||a.point.y-c.point.y)}return o}function*Eoi(e,t,n,o=!1){let r=[],i=fa(e);for(let[d,u]of e.connections.entries()){let _=Poi(e,u,t);if(_.some((m)=>!m.length))return null;let p;for(let m of n.get(u.name)??[]){let A=(C)=>C.escape.route.some((b)=>b.route_type==="via"&&b.layers?.includes(m)),g=_[0].filter(A).map((C)=>({...C.point,layer:m})),f=_[1].filter(A).map((C)=>({...C.point,layer:m}));if(!g.length||!f.length)continue;let y={...u,pointsToConnect:[g[0],f[0]]},x=new Tl(new Di(e,y,t.traceWidth,i),g[0],f[0],[],0,void 0,{starts:g,ends:f,nearestTerminalAttachments:o,checkReachability:!0});try{let C=0;while(!x.solved&&!x.failed&&C++<4000)x.step(),yield;if(x.solved){let b=br(x.result);if(!p||b<p.cost)p={cost:b,start:x.result[0],end:x.result.at(-1)}}}finally{x.cancel()}}if(!p)return null;for(let m=0;m<2;m++){let A=u.pointsToConnect[m],g=u.pointsToConnect[1-m],f=m?p.end:p.start,y=g.x-A.x,x=g.y-A.y,C=(v)=>{let P=Math.abs(y)>=Math.abs(x)?Math.sign(y)*(v.x-A.x):Math.sign(x)*(v.y-A.y);return P>0.000000001?0:Math.abs(P)<=0.000000001?1:2};_[m].sort((v,P)=>{let M=Gn(A,v.point)-Gn(A,P.point);return Number(!u8e(v.point,f))-Number(!u8e(P.point,f))||C(v.point)-C(P.point)||(Math.abs(M)<0.00000001?0:M)||v.point.x-P.point.x||v.point.y-P.point.y});let b=[u.name,A.pcb_port_id,A.pointId],I=e.obstacles.filter((v)=>v.componentId&&v.connectedTo.some((P)=>b.includes(P))).sort((v,P)=>Gn(v.center,A)-Gn(P.center,A))[0];if(!I?.componentId)return null;r.push({connectionIndex:d,pointIndex:m,component:I.componentId,sites:_[m]})}}let s=new Map,a=(d,u)=>{if(d.copper.some((m)=>u.copper.some((A)=>m.layer===A.layer&&n0e(m.a,m.b,A)<m.radius+t.clearance-0.00000001)))return!1;let _=d.escape.route.find((m)=>m.route_type==="via"),p=u.escape.route.find((m)=>m.route_type==="via");return Gn(_,p)>=t.viaHoleDiameter+(t.holeToHoleClearance??t.clearance)-0.00000001},c=0;for(let d of new Set(r.map((u)=>u.component))){let u=(_)=>{if(++c>1e5)return!1;if(!_.length)return!0;let p=_.map((g)=>({endpoint:g,sites:g.sites.filter((f)=>[...s.values()].every((y)=>a(f,y)))})).sort((g,f)=>g.sites.length-f.sites.length||g.endpoint.connectionIndex-f.endpoint.connectionIndex||g.endpoint.pointIndex-f.endpoint.pointIndex),{endpoint:m,sites:A}=p[0];for(let g of A){if(s.set(m,g),u(_.filter((f)=>f!==m)))return!0;s.delete(m)}return!1};if(!u(r.filter((_)=>_.component===d)))return null;yield}let l=structuredClone(e.connections),h=[];for(let d of r){let u=s.get(d),_=l[d.connectionIndex];_.pointsToConnect[d.pointIndex]={...u.point,layer:t.targetLayers.get(_.name)},h.push(u.escape)}return{connections:l,traces:h}}function m0e(e,t){return(e.allowedLayers??o0e(e.layerCount)).filter((n)=>!t.pointsToConnect.some((o)=>o.layer===n)&&(e.buses??[]).every((o)=>!o.connectionNames.includes(t.name)||!o.allowedLayers||o.allowedLayers.includes(n)))}function p7n(e,t,n,o){let r=v6(e,t);return{type:"pcb_trace",pcb_trace_id:`bus_lane_${t.name}`,connection_name:t.name,source_trace_id:t.source_trace_id??t.name,route:n.map((i)=>({...i,route_type:"wire",layer:o,width:r}))}}var m7n=class{geometry=new WeakMap;prepare(e){let t=this.geometry.get(e);if(t)return t;let n=new Float64Array(e.length*4),o=1/0,r=-1/0,i=1/0,s=-1/0;for(let c=0;c<e.length;c++){let l=e[c],h=c*4;if(n[h]=Math.min(l.a.x,l.b.x)-l.radius,n[h+1]=Math.max(l.a.x,l.b.x)+l.radius,n[h+2]=Math.min(l.a.y,l.b.y)-l.radius,n[h+3]=Math.max(l.a.y,l.b.y)+l.radius,l.rect)n[h]=Math.min(n[h],l.rect.minX),n[h+1]=Math.max(n[h+1],l.rect.maxX),n[h+2]=Math.min(n[h+2],l.rect.minY),n[h+3]=Math.max(n[h+3],l.rect.maxY);o=Math.min(o,n[h]),r=Math.max(r,n[h+1]),i=Math.min(i,n[h+2]),s=Math.max(s,n[h+3])}let a={copper:e,bounds:n,minX:o,maxX:r,minY:i,maxY:s};return this.geometry.set(e,a),a}firstConflict(e,t,n){let o=this.prepare(e),r=this.prepare(t);if(o.maxX+n<r.minX||r.maxX+n<o.minX||o.maxY+n<r.minY||r.maxY+n<o.minY)return;for(let i=0;i<e.length;i++){let s=e[i],a=i*4;for(let c=0;c<t.length;c++){let l=t[c],h=c*4;if(s.layer!==l.layer||o.bounds[a+1]+n<r.bounds[h]||r.bounds[h+1]+n<o.bounds[a]||o.bounds[a+3]+n<r.bounds[h+2]||r.bounds[h+3]+n<o.bounds[a+2])continue;if(n0e(s.a,s.b,l)<s.radius+n)return[s,l]}}}};function*Moi(e){let{native:t,pending:n,retained:o,traces:r}=e,i=fa(n),s=new GZ,a=new Set,c=t.minTraceToPadEdgeClearance??t.defaultObstacleMargin??0.075,l=function*(u,_,p=n,m=r){let A=[],g=t.connections.find((y)=>y.name===u.name),f=v6(t,g);for(let y of m0e(t,g)){let x={...u,pointsToConnect:u.pointsToConnect.map((b)=>({...b,layer:y}))},C=new Tl(new Di(p,x,f,_),x.pointsToConnect[0],x.pointsToConnect[1],m.flatMap(oi),100,void 0,{checkReachability:!0,maxLength:Ax(p,x.name),paretoLength:Number.isFinite(Ax(p,x.name))});try{let b=0;while(!C.solved&&!C.failed&&b++<3000)C.step(),yield;if(C.solved)A.push({layer:y,blockers:m.filter((I)=>I.route[0].layer===y&&s.firstConflict(C.result,I.route,(f+I.route[0].width)/2+c-0.00000001))})}finally{C.cancel()}}return A};for(let u of n.connections.filter((_)=>!r.some((p)=>p.connection_name===_.name))){let _=(yield*l(u,i)).sort((p,m)=>p.blockers.length-m.blockers.length)[0];a.add(u.name);for(let p of _?.blockers??[])a.add(p.connection_name)}let h=new Set,d=r.filter((u)=>!a.has(u.connection_name));for(let u of n.connections.filter((_)=>a.has(_.name))){let _={...n,traces:[...t.traces??[],...e.escapes.filter((A)=>!a.has(A.connection_name)),...o]},p=yield*l(u,fa(_),_,d);for(let A of p)if(A.blockers.length<=3)for(let g of A.blockers)h.add(g.connection_name);let m=p.sort((A,g)=>A.blockers.length-g.blockers.length)[0];for(let A of m?.blockers??[])h.add(A.connection_name)}for(let u of h)a.add(u);return a}function*woi(e){let{native:t}=e,n=[...e.retained,...e.traces],o=new Set(t.differentialPairs?.flatMap((l)=>l.connectionNames)),r=new Set,i=t.minTraceToPadEdgeClearance??t.defaultObstacleMargin??0.075,s=[...e.escapes,...n].map((l)=>({name:l.connection_name,copper:fa({...t,obstacles:[],traces:[l]})})),a=new m7n,c=(l)=>new Set(s.filter((h)=>a.firstConflict(l,h.copper,i-0.00000001)).map((h)=>h.name));for(let l of t.connections.filter((h)=>!n.some((d)=>d.connection_name===h.name))){let h=m0e(t,l);if(!h.length)return new Set;let d={...t,connections:[l]},u=[[],[]];for(let p=0;p<4;p++){try{let m=d0e(d,u0e(d,new Map([[l.name,h[0]]])),p);for(let A=0;A<2;A++){let g=m.connections[0].pointsToConnect[A];if(u[A].some((y)=>Math.hypot(y.point.x-g.x,y.point.y-g.y)<0.000001))continue;let f=p0e(t,m.traces).find((y)=>Math.hypot(y.route[0].x-l.pointsToConnect[A].x,y.route[0].y-l.pointsToConnect[A].y)<0.000001);if(f)u[A].push({point:g,escape:f})}}catch{}yield}let _;for(let p of u[0])for(let m of u[1]){let A=fa({...t,obstacles:[],traces:[p.escape,m.escape]}),g=c(A);if([...g].some((x)=>o.has(x)))continue;let f={...t,connections:[l],traces:[...t.traces??[],...e.escapes.filter((x)=>!g.has(x.connection_name)),...n.filter((x)=>o.has(x.connection_name))]},y=fa(f);for(let x of h){let C={...l,pointsToConnect:[p.point,m.point].map((I)=>({...I,layer:x}))},b=new Tl(new Di(f,C,v6(t,l),y),C.pointsToConnect[0],C.pointsToConnect[1],n.filter((I)=>!o.has(I.connection_name)).flatMap(oi),100,void 0,{checkReachability:!0,maxLength:Ax(t,l.name)-br(p.escape.route)-br(m.escape.route)});try{let I=0;while(!b.solved&&!b.failed&&I++<4000)b.step(),yield;if(b.solved){let v=p7n(t,l,b.result,x),P=c([...A,...oi(v)]),M=P.size*1000+br(v.route);if(![...P].some((B)=>o.has(B))&&(!_||M<_.cost))_={cost:M,names:P}}}finally{b.cancel()}}}r.add(l.name);for(let p of _?.names??[])r.add(p)}return r}function*tyn(e,t,n=!1){if(!t.size)return null;let{native:o}=e,r=[...e.retained,...e.traces],i=r.filter((T)=>!t.has(T.connection_name)),s=e.escapes.filter((T)=>!t.has(T.connection_name)),a=new Map([...e.pending.connections.map((T)=>[T.name,T.pointsToConnect[0].layer]),...r.map((T)=>[T.connection_name,T.route[0].layer])]),c={...o,connections:o.connections.filter((T)=>t.has(T.name)),traces:[...o.traces??[],...s,...i]};if(!c.connections.length)return null;let l=fa(c),h=new Map,d=new Map,u=new Map,_=o.minTraceToPadEdgeClearance??o.defaultObstacleMargin??0.075;for(let T of c.connections){let N={...c,connections:[T]},D=[[],[]];for(let H=0;H<4;H++){try{let V=d0e(N,u0e(N,a),H);for(let O=0;O<2;O++){let U=V.connections[0].pointsToConnect[O];if(D[O].some((Y)=>Math.hypot(Y.point.x-U.x,Y.point.y-U.y)<0.000001))continue;let j=p0e(o,V.traces).find((Y)=>Math.hypot(Y.route[0].x-T.pointsToConnect[O].x,Y.route[0].y-T.pointsToConnect[O].y)<0.000001);if(j)D[O].push({point:U,escape:j})}}catch{}yield}let L=[];for(let H of D[0])for(let V of D[1])for(let O of m0e(o,T)){let U={...T,pointsToConnect:[H.point,V.point].map((ee)=>({...ee,layer:O}))},j=[H.escape,V.escape];if(j.some((ee)=>!ee.route.some((se)=>se.route_type==="via"&&se.layers?.includes(O))))continue;let Y=Ax({...o,traces:[...o.traces??[],...j]},T.name),X=fa({...c,obstacles:[],traces:j}),K=new Di(c,U,v6(o,T),l),J=new Tl(K,U.pointsToConnect[0],U.pointsToConnect[1],[],0,void 0,{checkReachability:!0,maxLength:Y});try{let ee=0;while(!J.solved&&!J.failed&&ee++<3000)J.step(),yield;if(J.solved)L.push({connection:U,escapes:j,escapeCopper:X,scene:K,layer:O,length:br(J.result),maxLength:Y})}finally{J.cancel()}}if(L.sort((H,V)=>H.length-V.length),!L.length)return null;h.set(T.name,L)}let p=new m7n,m=(T,N)=>p.firstConflict(T,N,_-0.00000001),A=new GZ,g=new Map,f=new Map,y=new Map,x=0,C=(T,N)=>{let D=T.id<N.id?`${T.id},${N.id}`:`${N.id},${T.id}`,L=y.get(D);if(L!==void 0)return L;let H=(T.trace.route[0].width+N.trace.route[0].width)/2+_,V=T.layer===N.layer&&A.firstConflict(T.trace.route,N.trace.route,H-0.00000001)||m(T.escapeCopper,N.copper)||m(N.escapeCopper,T.copper);return y.set(D,!V),!V},b=(T)=>{let N=T.connection.name,D=JSON.stringify([T.escapes.map((V)=>V.route),T.trace.route]),L=f.get(N);if(!L)f.set(N,L=new Set);if(L.has(D))return;L.add(D);let H=g.get(N);if(!H)g.set(N,H=[]);if(H.push(T),H.length>48)H.splice(8,1)},I=()=>{if(c.connections.some((L)=>!g.get(L.name)?.length))return;let T=0,N,D=(L,H)=>{if(++T>4000)return;if(!H.length){N=L;return}H.sort((V,O)=>V.length-O.length);for(let V of H[0]){let O=H.slice(1).map((U)=>U.filter((j)=>C(V,j)));if(O.some((U)=>!U.length))continue;if(D([...L,V],O),N)return}};return D([],c.connections.map((L)=>[...g.get(L.name)].reverse())),N},v=new Map,P=[...c.connections].sort((T,N)=>h.get(T.name).length-h.get(N.name).length),M=new Map,B=()=>{let T=[...v.values()],N=[...s,...T.flatMap((L)=>L.escapes)],D=c.connections.map((L)=>v.get(L.name)?.connection??h.get(L.name)[0].connection);return{native:o,pending:{...c,connections:D,traces:[...o.traces??[],...N,...i]},escapes:N,retained:i,traces:T.map((L)=>L.trace)}};for(let T=0;P.length&&T<1200;T++){let N=P.shift(),D=h.get(N.name),L=M.get(N.name)??0;M.set(N.name,L+1),v.delete(N.name);let H=[...v.values()],V=H.flatMap((U)=>U.copper),O;for(let U=0;U<Math.min(D.length,4);U++){let j=D[(L*4+U)%D.length],{scene:Y,connection:X,layer:K}=j;if(n&&O){let[ee,se]=X.pointsToConnect,ne=H.filter((re)=>m(j.escapeCopper,re.copper)).length;if(Math.hypot(ee.x-se.x,ee.y-se.y)+100*ne>O.score+0.0000001)continue}if(!u.has(K)){let ee=new dat(Y);u.set(K,ee),d.set(K,new Float32Array(ee.cellCount))}let J=new Tl(Y,X.pointsToConnect[0],X.pointsToConnect[1],V,10+T,d.get(K),{checkReachability:!0,maxLength:j.maxLength,paretoLength:Number.isFinite(j.maxLength)});try{let ee=0;while(!J.solved&&!J.failed&&ee++<3000)J.step(),yield;if(J.solved){let se=p7n(o,N,J.result,K),ne=[...j.escapeCopper,...oi(se)],re=H.filter((ie)=>m(ne,ie.copper)),Z=br(se.route)+re.length*100,te={...j,id:x++,trace:se,copper:ne,hits:re,score:Z};if(!n)b(te);if(!O||Z<O.score)O=te}}finally{J.cancel()}}if(!O){P.push(N);continue}for(let U of O.hits){let j=m(O.copper,U.copper);if(j){let[Y,X]=j;u.get(Y.layer)?.penalizeIntersection(d.get(Y.layer),Y.a,Y.b,X.a,X.b,Y.radius+X.radius+_,!0)}if(v.delete(U.connection.name),!P.some((Y)=>Y.name===U.connection.name))P.push(c.connections.find((Y)=>Y.name===U.connection.name))}if(v.set(N.name,O),n&&v.size>=c.connections.length-1)return B();if(!n&&T%8===0&&v.size>=c.connections.length-3){let U=I();if(U){for(let j of U)v.set(j.connection.name,j);P.length=0}}yield}return v.size===c.connections.length?B():null}function*Boi(e,t,n,o,r){let i=new Set(e.differentialPairs?.flatMap((p)=>p.connectionNames)),s=new Set(e.buses?.flatMap((p)=>p.connectionNames)),a=new Map;for(let p of t.buses??[]){let m=new Set(t.connections.filter((A)=>p.connectionNames.includes(A.name)).map((A)=>A.pointsToConnect[0].layer));for(let A of m)a.set(A,(a.get(A)??0)+1)}let c=[...a.values()].some((p)=>p>1),l=n.filter((p)=>i.has(p.connection_name)),h=new Map(t.connections.map((p)=>[p.name,p.pointsToConnect[0].layer])),d=new Map(e.connections.map((p)=>[p.name,m0e(e,p)])),u=e.connections.reduce((p,m)=>({x:p.x+m.pointsToConnect[1].x-m.pointsToConnect[0].x,y:p.y+m.pointsToConnect[1].y-m.pointsToConnect[0].y}),{x:0,y:0}),_=Math.abs(u.x)>Math.abs(u.y);for(let p of u7n(t,e.buses?.some((m)=>m.maxLength!==void 0)?d:o,!0)){if(!p){yield;continue}if(fP(t,p).some((M)=>s.has(M.connectionNames[0])&&(M.separatedExteriorLengthMm??0)>0.05*br(p.find((B)=>B.connection_name===M.connectionNames[0]).route)))continue;let m={...e,connections:e.connections.filter((M)=>!i.has(M.name)),traces:[...e.traces??[],...l,...p]},A=yield*Eoi(m,u0e(m,h),d,_);if(!A)continue;let g=[...l,...A.traces],f={...e,connections:A.connections,buses:e.buses?.some((M)=>M.maxLength!==void 0)?e.buses.map((M)=>({...M,connectionNames:M.connectionNames.filter((B)=>A.connections.some((T)=>T.name===B))})).filter((M)=>M.connectionNames.length):[],differentialPairs:[],traces:[...e.traces??[],...g,...p]},y=new Map(f.connections.map((M)=>[M.name,v6(e,M)])),x=MG(f,f.connections,fa(f),[],y,void 0,d,()=>!1,!0,!0),C;try{let M=x.next(),B=0,T=0,N=0;while(!M.done&&B++<300000){if(N=Math.max(N,M.value.length),e.buses?.some((D)=>D.maxLength!==void 0)&&B>60000&&N<f.connections.length-3)break;if(M.value.length>=Math.max(1,f.connections.length-(e.buses?.some((D)=>D.maxLength!==void 0)?4:2))&&(!C||M.value.length>C.traces.length))T=B,C={native:e,pending:structuredClone(f),escapes:g,retained:p,traces:M.value};if(C&&!c)break;if(M.value.length===f.connections.length)break;if(C&&B-T>=(e.buses?.some((D)=>D.maxLength!==void 0)?12000:60000))break;yield,M=x.next()}if(M.done&&M.value)C={native:e,pending:f,escapes:g,retained:p,traces:M.value}}finally{x.return(null)}if(!C)continue;if(e.buses?.some((M)=>M.maxLength!==void 0)&&C.traces.length<C.pending.connections.length){let M=yield*voi(C.pending,C.traces,d,{maxNodes:256});if(M)C={...C,traces:M}}if(C.retained.length+C.traces.length<e.connections.length){let M=yield*Moi(C);if(C=(yield*tyn(C,M,!0))??void 0,!C)continue}if(C.retained.length+C.traces.length<e.connections.length){let M=yield*woi(C);if(C=(yield*tyn(C,M))??void 0,!C)continue}let b=[...C.retained,...C.traces];if(b.length!==e.connections.length)continue;let I={...e,connections:e.connections.map((M)=>{let B=b.find((T)=>T.connection_name===M.name);return{...M,pointsToConnect:[B.route[0],B.route.at(-1)]}}),traces:[...e.traces??[],...C.escapes]},v=fa(I);for(let M=0;M<3;M++){for(let B=0;B<b.length;B++){let T=b[B];if(T.coupledSection)continue;let N=T.route[0].width,D=T.route[0].layer,L=I.connections.find((H)=>H.name===T.connection_name);b[B]={...T,route:b2(T.route,new Di(I,L,N,[...v,...b.flatMap(oi)])).map((H)=>({...H,route_type:"wire",layer:D,width:N}))}}b=uL(I,b),yield}let P=A2.forRefinement(I,b,r);try{while(!P.solved&&!P.failed)P.step(),yield;if(P.solved)return{input:I,traces:P.traces,escapes:C.escapes}}finally{if(!P.solved&&!P.failed)P.tryFinalAcceptance()}}return null}function Ede(e,t,n){let o=new Set([t.name,t.source_trace_id,n.pointId,n.pcb_port_id].filter((s)=>!!s)),r=n.layers??[n.layer];if(!e.obstacles.find((s)=>{if(!s.componentId||!s.connectedTo.some((u)=>o.has(u))||!s.layers.some((u)=>r.includes(u)))return!1;let a=-(s.ccwRotationDegrees??0)*Math.PI/180,c=n.x-s.center.x,l=n.y-s.center.y;if(s.shape==="circle")return Math.hypot(c,l)<=s.width/2+0.00000001;let h=c*Math.cos(a)-l*Math.sin(a),d=c*Math.sin(a)+l*Math.cos(a);return Math.abs(h)<=s.width/2+0.00000001&&Math.abs(d)<=s.height/2+0.00000001}))return!1;return!fa({...e,obstacles:[]}).some((s)=>r.includes(s.layer)&&s.owners.some((a)=>o.has(a))&&n0e(n,n,s)<=0.00000001)}function*Wit(e,t,n,o,r,i=t.pointsToConnect[1],s){let a={...t,pointsToConnect:t.pointsToConnect.map((l,h)=>({...h?i:l,layer:r}))},c=new Tl(new Di(e,a,o,n),a.pointsToConnect[0],a.pointsToConnect[1],[],0,void 0,s?{bounds:s}:void 0);try{while(!c.solved&&!c.failed)c.step(),yield;return c.solved}finally{if(!c.solved&&!c.failed)c.cancel()}}function Toi(e,t,n){let o=t.pointsToConnect[n],r=new Set([t.name,t.source_trace_id,o.pcb_port_id,o.pointId].filter(Boolean)),i=e.obstacles.filter((c)=>c.componentId&&c.connectedTo.some((l)=>r.has(l))).sort((c,l)=>Gn(c.center,o)-Gn(l.center,o))[0];if(!i)return;let a=e.obstacles.filter((c)=>c.componentId===i.componentId).map((c)=>{let l=(c.ccwRotationDegrees??0)*Math.PI/180;return{center:c.center,width:Math.abs(Math.cos(l))*c.width+Math.abs(Math.sin(l))*c.height,height:Math.abs(Math.sin(l))*c.width+Math.abs(Math.cos(l))*c.height}});return{minX:Math.min(...a.map((c)=>c.center.x-c.width/2)),maxX:Math.max(...a.map((c)=>c.center.x+c.width/2)),minY:Math.min(...a.map((c)=>c.center.y-c.height/2)),maxY:Math.max(...a.map((c)=>c.center.y+c.height/2))}}function*nyn(e,t,n,o,r,i){let s=[],a=e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075,c=3*(r+a);for(let l of[0,1]){let h=Toi(e,t,l);if(!h)continue;let d=n.pointsToConnect[l],u=r/2+(e.minBoardEdgeClearance??0),_={minX:Math.max(e.bounds.minX+u,h.minX-2*c),maxX:Math.min(e.bounds.maxX-u,h.maxX+2*c),minY:Math.max(e.bounds.minY+u,h.minY-2*c),maxY:Math.min(e.bounds.maxY-u,h.maxY+2*c)},p=[{...d,x:Math.max(_.minX,h.minX-c)},{...d,x:Math.min(_.maxX,h.maxX+c)},{...d,y:Math.max(_.minY,h.minY-c)},{...d,y:Math.min(_.maxY,h.maxY+c)}].filter((A)=>A.x<h.minX||A.x>h.maxX||A.y<h.minY||A.y>h.maxY).sort((A,g)=>Gn(d,A)-Gn(d,g)),m=!1;for(let A of i){let g={...n,pointsToConnect:[d,d]};for(let f of p)if(yield*Wit(e,g,o,r,A,f,_)){m=!0;break}if(m)break}if(p.length&&!m)s.push(l)}return s}function*_7n(e,t,n,o,r,i){let s={connections:structuredClone(t.connections),escapes:[...o]},a=o0e(e.layerCount);for(let[c,l]of s.connections.entries()){let h=e.connections.find((v)=>v.name===l.name),d=s.escapes.filter((v)=>v.connection_name===l.name),u=d.map((v)=>v.route.find((P)=>P.route_type==="via"));if(!h||d.length!==2||u.some((v)=>!v)||h.pointsToConnect.some((v)=>!Ede(e,h,v)))continue;let _=(r.get(l.name)??[l.pointsToConnect[0].layer]).filter((v)=>v!=="top"&&a.includes(v));if(!_.length)continue;let p=l.nominalTraceWidth??l.width??e.minTraceWidth,m={...t,connections:s.connections,traces:[...e.traces??[],...s.escapes,...n]},A=fa(m),g=[],f=0;for(let v of _)if(yield*Wit(m,l,A,p,v))f++;else g.push(v);if(i?.set(l.name,_.filter((v)=>!g.includes(v))),f>=Math.min(2,_.length))continue;let y=!1,x=yield*nyn(m,h,l,A,p,g);if(!x.length&&f===0)x.push(0,1);if(!x.length)continue;let C={...e,connections:[h],traces:[...e.traces??[],...s.escapes.filter((v)=>v.connection_name!==l.name),...n]},b=x.map((v)=>[u[v]]),I=new Set([JSON.stringify(l.pointsToConnect.map(({x:v,y:P})=>[v,P]))]);for(let v=0;v<16&&b.length;v++){let P=b.shift(),M={...C,obstacles:[...C.obstacles,...P.map((U)=>({shape:"circle",center:{x:U.x,y:U.y},width:0.000001,height:0.000001,layers:a,connectedTo:[]}))]},B;try{B=fct(M,{targetLayers:new Map([[l.name,l.pointsToConnect[0].layer]]),viaDiameter:Math.max(...u.map((U)=>U.via_diameter??e.minViaPadDiameter??0.6)),viaHoleDiameter:Math.max(...u.map((U)=>U.via_hole_diameter??e.minViaHoleDiameter??0.3)),traceWidth:Math.max(...d.flatMap((U)=>U.route.flatMap((j)=>j.route_type==="wire"?[j.width]:[]))),clearance:e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075,holeToHoleClearance:e.minViaHoleEdgeToViaHoleEdgeClearance,boardEdgeClearance:e.minBoardEdgeClearance,allowBlindAndBuriedVias:e.allowBlindAndBuriedVias??!1})}catch{yield;continue}yield;let T={...l,pointsToConnect:B.connections[0].pointsToConnect},N=JSON.stringify(T.pointsToConnect.map(({x:U,y:j})=>[U,j]));if(I.has(N))continue;I.add(N);let D=B.traces.map((U)=>({...U,source_trace_id:h.source_trace_id??l.name})),L={...m,traces:[...C.traces,...D]},H=fa(L),V=0,O=[];for(let U of _)if(yield*Wit(L,T,H,p,U))V++,O.push(U);if(y=V>f,y){i?.set(l.name,O),s.connections[c]=T,s.escapes=[...s.escapes.filter((U)=>U.connection_name!==l.name),...D];break}for(let U of yield*nyn(L,h,T,H,p,g)){let j=T.pointsToConnect[U];if(!P.some((Y)=>Gn(Y,j)<0.00000001))b.push([...P,j])}}}return s}function*Doi(e,t,n,o,r){let i=new Set(t.buses?.flatMap((A)=>A.connectionNames)),s=new Set(t.differentialPairs?.flatMap((A)=>A.connectionNames)),a=new Set([...i,...s]),c=new Map(t.connections.map((A)=>[A.name,v6(t,A)])),l=new Map,h=new WeakMap,d=0,u=fa(t),_=t.buses?.some((A)=>A.maxLength!==void 0),p=_?new Map(e.connections.map((A)=>[A.name,m0e(e,A)])):o,m=u7n(t,p);for(let A of m){if(!A){yield;continue}let g=structuredClone(t);for(let L of g.connections){let H=A.find((V)=>V.connection_name===L.name);if(H)for(let V of L.pointsToConnect)V.layer=H.route[0].layer}let f={...g,connections:g.connections.filter((L)=>a.has(L.name))},y=f.connections.filter((L)=>!s.has(L.name)),x=!0,C=A.flatMap(oi),b=new Map;for(let L of y){let H=[];for(let V of _?p.get(L.name):[L.pointsToConnect[0].layer]){let O=JSON.stringify([L.name,V,A.filter((j)=>j.route[0].layer===V).map((j)=>{if(!h.has(j))h.set(j,d++);return h.get(j)})]),U=l.get(O);if(U===void 0){let j={...L,pointsToConnect:L.pointsToConnect.map((X)=>({...X,layer:V}))},Y=new Tl(new Di(f,j,c.get(L.name),[...u,...C]),j.pointsToConnect[0],j.pointsToConnect[1],[],0,void 0,_?{checkReachability:!0,maxLength:Ax(f,L.name)}:void 0);try{let X=0;while(!Y.solved&&!Y.failed&&X++<4000)Y.step(),yield;if(Y.solved||Y.failed)U=Y.solved,l.set(O,U)}finally{Y.cancel()}}if(U!==!1)H.push(V)}if(!H.length){x=!1;break}b.set(L.name,H)}if(!x)continue;let I=MG(f,y,fa(g),A,c,void 0,_?b:new Map,()=>!_,!0),v=I.next(),P=0;try{while(!v.done&&P++<(_?300000:16000))yield,v=I.next()}finally{if(!v.done)I.return(null)}if(!v.done||!v.value)continue;let M=v.value,B=!0,T=!1;if(_){let L=A2.forRefinement(f,M,r);try{while(!L.solved&&!L.failed)L.step(),yield;if(L.solved)M=L.traces,T=!0}finally{if(!L.solved&&!L.failed)L.tryFinalAcceptance()}}for(let L of T?[]:g.buses??[]){let H=new Set(L.connectionNames),V={...g,connections:g.connections.filter((U)=>H.has(U.name)),buses:[L],differentialPairs:g.differentialPairs?.filter((U)=>U.connectionNames.every((j)=>H.has(j))),traces:[...g.traces??[],...M.filter((U)=>!H.has(U.connection_name))]},O=A2.forRefinement(V,M.filter((U)=>H.has(U.connection_name)),r);try{while(!O.solved&&!O.failed)O.step(),yield;if(!O.solved){B=!1;break}M=[...M.filter((U)=>!H.has(U.connection_name)),...O.traces]}finally{if(!O.solved&&!O.failed)O.tryFinalAcceptance()}}if(!B)continue;let N={...g,connections:g.connections.filter((L)=>!a.has(L.name)),buses:[],differentialPairs:[]},D={connections:N.connections,escapes:n};for(let L=0;L<2;L++){if(L){let O=new Map(o);if(D=yield*_7n(e,N,M,n,o,O),N.connections.some((U)=>O.get(U.name)?.length===0)||D.escapes.every((U,j)=>U===n[j]))break}let H={...N,connections:D.connections,traces:[...e.traces??[],...D.escapes,...M]},V=new A2(H,{...r,maxSearchIterations:Math.min(r.maxSearchIterations??200000,200000)},o);try{while(!V.solved&&!V.failed)V.step(),yield;if(!V.solved)continue;let O=[...M,...V.traces];return{escapes:D.escapes,traces:O,input:{...g,connections:g.connections.map((U)=>{let j=O.find((Y)=>Y.connection_name===U.name);return{...U,pointsToConnect:[j.route[0],j.route.at(-1)]}}),traces:[...e.traces??[],...D.escapes]}}}finally{if(!V.solved&&!V.failed)V.tryFinalAcceptance()}}}return null}var oyn=(e)=>({...e,route:e.route.toReversed(),coupledSection:e.coupledSection?[e.route.length-1-e.coupledSection[1],e.route.length-1-e.coupledSection[0]]:void 0,curvedSegments:e.curvedSegments?.map((t)=>e.route.length-t)}),Xit=(e,t)=>e.findIndex((n)=>Gn(n,t)<0.0000001),ryn=(e,t)=>{if(Xit(e,t)>=0)return e;let n=e.findIndex((o,r)=>r>0&&gx(t,e[r-1],o)<0.00000001);return n<0?e:[...e.slice(0,n),t,...e.slice(n)]};function*jit(e,t,n={}){let o=t,r=fa(e),i=e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075,s=2000;for(let a of e.differentialPairs??[])for(let c of[!1,!0])for(let l of[0,1]){if(s<=0)return o;let h=a.connectionNames.map((J)=>o.find((ee)=>ee.connection_name===J));if(h.some((J)=>!J?.coupledSection))continue;let d=h.map((J)=>c?oyn(J):J),u=d[l],_=d[1-l],[p,m]=u.coupledSection,[A,g]=_.coupledSection,f=_.route[0].width,y=f+(a.traceGap??i);if(m<1||g<1||Gn(u.route[m-1],u.route[m])<0.0000001)continue;let C=EG(e,f/2+i).find((J)=>_x(u.route.at(-1),J.copper)&&_x(_.route.at(-1),J.copper));if(!C||_x(u.route[m],C.copper))continue;let b=m+1;while(b<u.route.length&&!_x(u.route[b],C.copper))b++;if(b===u.route.length||u.curvedSegments?.some((J)=>J>=m&&J<=b))continue;let I=u.route[b-1],v=u.route[b],P=0,M=1;for(let J=0;J<40;J++){let ee=(P+M)/2;if(_x({x:I.x+(v.x-I.x)*ee,y:I.y+(v.y-I.y)*ee},C.copper))M=ee;else P=ee}let B={x:I.x+(v.x-I.x)*M,y:I.y+(v.y-I.y)*M},T={x:(u.route[m-1].x+u.route[m].x)/2,y:(u.route[m-1].y+u.route[m].y)/2},N=T1([T,...u.route.slice(m,b),B]),D;try{D=[y,-y].map((J)=>hf(N,J))}catch{continue}let L=D.find((J)=>gx(J[0],_.route[g-1],_.route[g])<0.0000001);if(!L)continue;let H=(J)=>({...J,route_type:"wire",width:f,layer:_.route[0].layer}),V=[{...u,route:N.map(H),curvedSegments:[],coupledSection:[0,N.length-1]},{..._,route:L.map(H),curvedSegments:[],coupledSection:[0,L.length-1]}],O=KCn(e,[...o.filter((J)=>!a.connectionNames.includes(J.connection_name)),...V]);N=O.find((J)=>J.connection_name===u.connection_name).route,L=O.find((J)=>J.connection_name===_.connection_name).route;let U=[...u.route.slice(0,m),...N,...u.route.slice(b)].map(H),j=e.connections.find((J)=>J.name===_.connection_name),Y=new Di(e,j,f,[...r,...o.filter((J)=>J.connection_name!==u.connection_name).flatMap(oi),...oi({...u,route:U})]);if(!Y.pathVisible(L))continue;let X=g+1;while(X<_.route.length&&!_x(_.route[X],C.copper))X++;if(X===_.route.length)continue;let K=!1;for(;X<_.route.length;X++){if(!_x(_.route[X],C.copper))continue;let J=new Tl(Y,L.at(-1),_.route[X]);try{let te=0;while(!J.solved&&!J.failed&&te++<256&&s-- >0)J.step(),yield;if(!J.solved)continue}finally{J.cancel()}let ee=(te)=>({...te,route_type:"wire",layer:_.route[0].layer,width:f}),se=ryn(ryn(T1([..._.route.slice(0,g),...L,...b2(J.result,Y).slice(1),..._.route.slice(X+1)]).map(ee),ee(_.route[A])),ee(L.at(-1)));if(!Y.pathVisible(se)||!ml(se,f+i))continue;let ne=[{...u,route:U,curvedSegments:uue(u,U),coupledSection:[p,m+N.length-1]},{..._,route:se,curvedSegments:uue(_,se),coupledSection:[Xit(se,_.route[A]),Xit(se,L.at(-1))]}].map((te)=>c?oyn(te):te),re=o.filter((te)=>!a.connectionNames.includes(te.connection_name)),Z=[...r,...re.flatMap(oi)];for(let te of[1.8,1.5,0.75,0.375,0.1875,0.09375,0.046875,0.0234375]){let ie=uL(e,o.filter((de)=>a.connectionNames.includes(de.connection_name)).map((de)=>ne.find((me)=>me.connection_name===de.connection_name)),Z,te),le=o.map((de)=>ie.find((me)=>me.connection_name===de.connection_name)??de);if(!aG(ie)||n.preserveMatching!==!1&&[...NP(e,le),...oit(e,le)].some((de)=>!de.withinLengthLimit||!de.aboveMinimumLength||de.toleranceMm!==null&&!de.matched)||pL(e,le).some((de)=>!de.matched))continue;let ue=[...Z,...ie.flatMap(oi)];if(ie.some((de)=>{let me=de.route[0].width;return!ml(de.route,me+i)||!new Di(e,e.connections.find((Ae)=>Ae.name===de.connection_name),me,ue).pathVisible(de.route)}))continue;o=le,K=!0;break}if(K)break}}return o}function Noi(e){let t=new Set(e.buses?.flatMap((o)=>o.connectionNames));return(uat({...e,connections:e.connections.filter((o)=>t.has(o.name))})??[]).map((o)=>{let r=o.differentialPairs?.[0];if(!r)return 0;let i=r.connectionNames.map((h)=>o.connections.find((d)=>d.name===h)),s=[0,1].map((h)=>({x:(i[0].pointsToConnect[h].x+i[1].pointsToConnect[h].x)/2,y:(i[0].pointsToConnect[h].y+i[1].pointsToConnect[h].y)/2})),a=Math.abs(s[1].x-s[0].x),c=Math.abs(s[1].y-s[0].y),l=v6(e,i[0])+(r.traceGap??e.minTraceToPadEdgeClearance??0.075);return Math.min(a,c)<=4*l?3:0})}function*iyn(e,t,n){let o=A2.forRefinement(e,t,n);try{while(!o.solved&&!o.failed)o.step(),yield;return o.solved?o.traces:null}finally{if(!o.solved&&!o.failed)o.tryFinalAcceptance()}}function*Roi(e,t,n,o){let r=new Map(t.connections.map((U)=>[U.name,U.pointsToConnect[0].layer])),i=[0,2].map((U)=>d0e(e,u0e(e,r),U)),s=e.connections.map((U,j)=>({...U,pointsToConnect:[i[0].connections[j].pointsToConnect[0],i[1].connections[j].pointsToConnect[1]]})),a=p0e(e,i.flatMap((U,j)=>U.traces.filter((Y)=>{let K=e.connections.find((ee)=>ee.name===Y.connection_name).pointsToConnect[j],J=Y.route[0];return J.route_type==="wire"&&Math.hypot(J.x-K.x,J.y-K.y)<0.00000001}))),c={...e,connections:s,traces:[...e.traces??[],...a]},l=(c.differentialPairs??[]).filter((U)=>!c.buses?.some((j)=>U.connectionNames.some((Y)=>j.connectionNames.includes(Y)))),h=new Set(l.flatMap((U)=>U.connectionNames)),d={...c,connections:c.connections.filter((U)=>!h.has(U.name)),differentialPairs:c.differentialPairs?.filter((U)=>!U.connectionNames.some((j)=>h.has(j)))},u=yield*tG(jCn(d,n,Noi(d)),60000);if(!u)return null;let _=d.minTraceToPadEdgeClearance??d.defaultObstacleMargin??0.075,p=EG(d,Math.max(...u.transforms.map((U)=>U.envelope/2))+_),m=u.transforms.filter((U)=>p.some((j)=>_x(U.center[0],j.copper))),A=new Set(m.flatMap((U)=>[U.connection.name,...U.approaches.map((j)=>j.name)])),g=m.flatMap((U)=>U.rails);u.local={...u.local,connections:u.local.connections.filter((U)=>!A.has(U.name)),traces:[...(u.local.traces??[]).filter((U)=>!m.some((j)=>U.connection_name===j.connection.name)),...g],buses:u.local.buses?.map((U)=>({...U,connectionNames:U.connectionNames.filter((j)=>!A.has(j))}))},u.transforms=u.transforms.filter((U)=>!m.includes(U)),u.copper=fa(u.local);let f=MG(u.local,u.local.connections,u.copper,[],u.widths,void 0,n,()=>!1,!0),y=new Set(d.connections.map((U)=>U.name)),x=new Set(d.buses?.flatMap((U)=>U.connectionNames)),C=new WeakMap,b=new Set,I=0,v=null,P=f.next(),M=0;try{while(!P.done&&M++<200000){let U=P.value,j=u.local.connections.filter((Y)=>!U.some((X)=>X.connection_name===Y.name));if(j.length<=3&&j.every((Y)=>y.has(Y.name)&&x.has(Y.name))){let Y=P.value.map((X)=>{if(!C.has(X))C.set(X,I++);return C.get(X)}).join(",");if(!b.has(Y)&&b.size<24){if(b.add(Y),v=yield*tG(cit(u,[...P.value,...g],{allowPartial:!0}),12000),v)break}}yield,P=f.next()}if(P.done&&P.value)v=yield*tG(cit(u,[...P.value,...g]),12000)}finally{if(!P.done)f.return(null)}if(!v)return null;let B=yield*Ioi(e,d,v,a);if(!B)return null;let T={...c,connections:c.connections.map((U)=>B.input.connections.find((j)=>j.name===U.name)??U),traces:B.input.traces},N=B.traces;for(let U of N)for(let j of T.connections.find((Y)=>Y.name===U.connection_name).pointsToConnect)j.layer=U.route[0].route_type==="wire"?U.route[0].layer:j.layer;for(let U of l){let j=T.connections.filter((K)=>U.connectionNames.includes(K.name)),Y=[...new Set([j[0].pointsToConnect[0].layer,...(n.get(j[0].name)??[]).filter((K)=>j.every((J)=>n.get(J.name)?.includes(K)))])].filter((K)=>K!=="top"),X=null;for(let K of Y){for(let J of j)for(let ee of J.pointsToConnect)ee.layer=K;for(let J=0;J<6&&!X;J++)X=yield*tG(CL(T,U,[...fa(T),...N.flatMap(oi)],{copper:[],penalty:0,variant:J}),12000);if(X)break}if(!X)return null;N=[...N,...X]}let D=yield*qCn({...u,input:T,transforms:[]},N);if(!D)return null;let L=yield*iyn(T,D,o);if(!L)return null;let H=yield*jit(T,L,{preserveMatching:!1});if(fP(T,H).some((U)=>!U.matched))return null;let V=yield*iyn(T,H,o);if(!V||fP(T,V).some((U)=>!U.matched))return null;let O=new Map(NP(T,L).map((U)=>[U.busId,Math.max(...U.lengths.map((j)=>j.totalLengthMm??1/0))]));if(NP(T,V).some((U)=>Math.max(...U.lengths.map((j)=>j.totalLengthMm??1/0))>O.get(U.busId)+0.000001))return null;return{input:T,traces:V,escapes:B.escapes}}function Qoi(e,t){let n=[...t],o=fa(e);for(let r=0;r<n.length;r++){let i=n[r];if(!i.coupledSection)continue;let[s,a]=i.coupledSection,c=i.route[0],l=new Di(e,e.connections.find((m)=>m.name===i.connection_name),c.width,[...o,...n.flatMap(oi)]),h=EG(e,c.width+(e.differentialPairs?.find((m)=>m.connectionNames.includes(i.connection_name))?.traceGap??0.1)/2+(e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075)),d=(m,A)=>{let g=h.find((y)=>_x(i.route[m===0?0:i.route.length-1],y.copper));return(i.curvedSegments??[]).some((y)=>y>m&&y<=A&&(!g||!_x(i.route[y-1],g.copper)||!_x(i.route[y],g.copper)))?b2(i.route.slice(m,A+1),l):i.route.slice(m,A+1)},u=d(0,s),_=d(a,i.route.length-1),p=[...u.slice(0,-1),...i.route.slice(s,a+1),..._.slice(1)].map((m)=>({...m,route_type:"wire",layer:c.layer,width:c.width}));n[r]={...i,route:p,curvedSegments:uue(i,p),coupledSection:[u.length-1,u.length+a-s-1]}}return n}var g7n=class extends nbn{input;options;phase="resolve_layers";traces=[];failureCode=null;acceptedTraces;envelopeOptimization;*optimizeEnvelope(){if(!this.options.smoothTuning)return;let e=E1(this.acceptedTraces),t=performance.now();this.stats={...this.stats,envelopeOptimization:{beforeAreaMm2:e.areaMm2,afterAreaMm2:e.areaMm2,milliseconds:0}};let n,o=!1,r=this.acceptedTraces;try{for(let i of["conservative","coordinated","flexible","guarded"]){if(i!=="conservative"&&E1(this.acceptedTraces).areaMm2<=E1(r).areaMm2*0.95)break;if(i==="flexible"&&o)continue;if(i==="guarded"&&!o)continue;let s=i==="conservative"?this.acceptedTraces:r;for(let a=0;a<(i==="guarded"?1:2);a++){let c=s,l=!1,h=!1,d=E1(c),u=y2n(this.input,c);if(!u)return;let _=u.carriers.map((m)=>e0e(u.input,m)),p=yield*cbn(u.input,u.carriers,i);if(p===u.carriers)break;for(let m of[1,0.999,0.99,0.95,0.9,0.75,0.5,0.25,0.1]){let A=p.map((x,C)=>({...x,route:x.route.map((b,I)=>({...b,x:u.carriers[C].route[I].x+(b.x-u.carriers[C].route[I].x)*m,y:u.carriers[C].route[I].y+(b.y-u.carriers[C].route[I].y)*m}))}));if(A.some((x,C)=>!_[C](x.route))){l=!0;continue}let g=u.join(A),f=E1(g);if(!Number.isFinite(f.areaMm2)||f.areaMm2>=d.areaMm2-0.000001||i==="conservative"&&(f.minX<d.minX-0.00000001||f.maxX>d.maxX+0.00000001||f.minY<d.minY-0.00000001||f.maxY>d.maxY+0.00000001))continue;let y=A2.forValidation(u.input,A,this.options);try{while(!y.solved&&!y.failed)y.step(),yield;if(!y.solved||fP(u.input,A).some((x)=>!x.matched))continue;if(s=g,f.areaMm2<E1(this.acceptedTraces).areaMm2-0.000001)h=!0,this.acceptedTraces=structuredClone(g),this.stats={...this.stats,envelopeOptimization:{beforeAreaMm2:e.areaMm2,afterAreaMm2:f.areaMm2,milliseconds:performance.now()-t}};break}finally{if(!y.solved&&!y.failed)y.tryFinalAcceptance()}}if(s===c){if(i!=="conservative"&&a===0&&l)o=!0;break}if(i!=="conservative"&&!h)break;if(i!=="conservative"&&d.areaMm2-E1(s).areaMm2<d.areaMm2*0.00001)break}if(i==="conservative")r=this.acceptedTraces}if(this.input.allowedLayers?.length&&this.input.allowedLayers.every((i)=>i!=="top"&&i!=="bottom")&&yjr(this.input,this.acceptedTraces)){let i=y2n(this.input,this.acceptedTraces);if(i){n=performance.now(),this.stats={...this.stats,envelopeOptimization:{...this.stats.envelopeOptimization,cohortBeforeAreaMm2:E1(this.acceptedTraces).areaMm2}};for(let s of xjr(i.input,i.carriers,this.options)){if(s){let a=i.join(s),c=E1(a).areaMm2;if(c<E1(this.acceptedTraces).areaMm2-0.000001&&fP(this.input,a).every((l)=>l.matched)){let l=A2.forValidation(i.input,s,this.options);try{while(!l.solved&&!l.failed)l.step(),yield;if(!l.solved)continue}finally{if(!l.solved&&!l.failed)l.tryFinalAcceptance()}this.acceptedTraces=structuredClone(a),this.stats={...this.stats,envelopeOptimization:{...this.stats.envelopeOptimization,beforeAreaMm2:e.areaMm2,afterAreaMm2:c,milliseconds:performance.now()-t}}}}yield}}}}finally{this.stats={...this.stats,envelopeOptimization:{...this.stats.envelopeOptimization,milliseconds:performance.now()-t,...n===void 0?{}:{cohortMilliseconds:performance.now()-n}}}}}finishAccepted(e){let t=this.envelopeOptimization;this.envelopeOptimization=void 0;try{t?.return()}catch(n){this.stats={...this.stats,optimizationCleanupError:String(n)}}this.traces=structuredClone(this.acceptedTraces),this.solved=!0,this.failed=!1,this.error=null,this.failureCode=null,this.phase="solved",this.progress=1,this.stats={...this.stats,optimizationStoppedEarly:e}}sharedPackages;backwardPackages;child;escapes=[];attempt=0;completedLanes=[];remainingInput;followingInput;siteRematch;packageCoupling;terminalLayers=new Map;constructor(e,t={}){super();this.input=structuredClone(e),this.options={smoothTuning:!0,denseSearch:!0,...t},this.MAX_ITERATIONS=(t.maxSearchIterations??200000)*Math.max(1,e.layerCount)}getConstructorParams(){return[this.input,this.options]}getOutput(){if(!this.solved)throw Error(this.error??"Bus lane pipeline is not solved");return{...this.input,traces:[...this.input.traces??[],...this.traces]}}tryFinalAcceptance(){if(this.solved)return;if(this.acceptedTraces){this.finishAccepted(!0);return}this.sharedPackages?.return(null),this.sharedPackages=void 0,this.backwardPackages?.return(null),this.backwardPackages=void 0,this.packageCoupling?.return([]),this.packageCoupling=void 0,this.siteRematch?.return({connections:[],escapes:[]}),this.siteRematch=void 0,this.child?.tryFinalAcceptance(),this.failureCode="search_budget_exhausted",this.traces=[]}childOptions(e=!1){let t=Math.max(1,this.MAX_ITERATIONS-this.iterations),n=e?Math.min(200000,Math.floor(t/4)):0;return{...this.options,maxSearchIterations:this.options.maxSearchIterations??Math.max(1,t-n)}}*finishPackageCoupling(e,t){let n=yield*jit(e,t);if(fP(e,n).every((r)=>r.matched))return n;if(n=yield*jit(e,Qoi(e,n),{preserveMatching:!1}),fP(e,n).some((r)=>!r.matched))throw Error("Pair approaches still separate outside native package fanouts");if(e.buses?.some((r)=>r.maxLength!==void 0)){let r=yield*hjr(e,n,this.escapes,this.options);if(r)return this.escapes=r.escapes,r.traces}let o=A2.forRefinement(e,n,this.options);try{while(!o.solved&&!o.failed)o.step(),yield;if(!o.solved)throw Error(o.error??"Package approach length matching failed");let r=new Map(NP(e,t).map((i)=>[i.busId,Math.max(...i.lengths.map((s)=>s.totalLengthMm??Number.POSITIVE_INFINITY))]));if(NP(e,o.traces).some((i)=>Math.max(...i.lengths.map((s)=>s.totalLengthMm??Number.POSITIVE_INFINITY))>r.get(i.busId)+0.000001))throw Error("Package refinement increased the bus length target");if(fP(e,o.traces).some((i)=>!i.matched))throw Error("Package approach matching separated the pair");return o.traces}finally{if(!o.solved&&!o.failed)o.tryFinalAcceptance()}}prepare(){if(this.options.fanout==="none"){this.child=new A2(this.input,this.options);return}let e=o0e(this.input.layerCount);if(this.input.allowedLayers?.some((C)=>!e.includes(C)))throw Error("Allowed signal layer is not in the physical stack");let t=e.filter((C)=>!this.input.allowedLayers||this.input.allowedLayers.includes(C));if(!t.length)throw Error("No allowed signal layers");let n=new Set(this.input.connections.map((C)=>C.name));for(let C of this.input.buses??[])if(C.connectionNames.some((b)=>!n.has(b)))throw Error("Unknown bus member");let o=this.input.connections.map((C)=>new Set([C.name]));for(let C of[...(this.input.differentialPairs??[]).map((b)=>b.connectionNames)]){let b=o.filter((v)=>C.some((P)=>v.has(P)));if(C.some((v)=>!b.some((P)=>P.has(v))))throw Error("Unknown bus or differential pair member");let I=new Set(b.flatMap((v)=>[...v]));for(let v of b)o.splice(o.indexOf(v),1);o.push(I)}let r=Math.ceil(this.input.connections.length/t.length),i=this.attempt===0&&(this.input.buses??[]).every((C)=>C.connectionNames.length<=r);for(let C of i?this.input.buses??[]:[]){let b=o.filter((M)=>C.connectionNames.some((B)=>M.has(B))),I=new Set(b.flatMap((M)=>[...M]));if(I.size>r)continue;let v=(this.input.buses??[]).filter((M)=>M.connectionNames.some((B)=>I.has(B))),P=this.input.connections.filter((M)=>I.has(M.name));if(!t.some((M)=>v.every((B)=>!B.allowedLayers||B.allowedLayers.includes(M))&&P.every((B)=>B.pointsToConnect.every((T)=>(T.layers??[T.layer]).includes(M)||Ede(this.input,B,T)))))continue;for(let M of b)o.splice(o.indexOf(M),1);o.push(I)}o.sort((C,b)=>b.size-C.size);let s=new Map(t.map((C)=>[C,0])),a=new Map;for(let C of o){let b=(this.input.buses??[]).filter((L)=>L.connectionNames.some((H)=>C.has(H))),I=this.input.connections.filter((L)=>C.has(L.name)),v=t.filter((L)=>b.every((H)=>!H.allowedLayers||H.allowedLayers.includes(L))&&I.every((H)=>H.pointsToConnect.every((V)=>(V.layers??[V.layer]).includes(L)||Ede(this.input,H,V))));if(!v.length)throw Error("Bus/pair has no common allowed signal layer; existing fanout handoffs cannot be dogboned again");let P=b.flatMap((L)=>[L.preferredLayer,...L.preferredLayers??[]]).filter((L)=>!!L),M=(L)=>I.flatMap((H)=>H.pointsToConnect).filter((H)=>!(H.layers??[H.layer]).includes(L)).length,B=(L)=>P.includes(L)?P.indexOf(L):P.length,T=new Map(v.map((L)=>[L,M(L)+this.input.obstacles.filter((H)=>H.componentId&&H.layers.includes(L)).length/8])),N=new Map(v.map((L)=>{let H=v.filter((V)=>B(V)===B(L)&&T.get(V)===T.get(L));return[L,(H.indexOf(L)-this.attempt%H.length+H.length)%H.length]}));v.sort((L,H)=>{let V=T.get(L)-T.get(H),O=(U)=>{let j=(X,K,J)=>(K.x-X.x)*(J.y-X.y)-(K.y-X.y)*(J.x-X.x),Y=0;for(let X of I)for(let K of this.input.connections){if(a.get(K.name)!==U)continue;let[J,ee]=X.pointsToConnect,[se,ne]=K.pointsToConnect;if(j(J,ee,se)*j(J,ee,ne)<0&&j(se,ne,J)*j(se,ne,ee)<0)Y++}return Y*(this.attempt===1?0:4)+s.get(U)};return(C.size>2?B(L)-B(H)||V||O(L)-O(H):V||4*(B(L)-B(H))+O(L)-O(H))||N.get(L)-N.get(H)});let D=v[0];for(let L of C)a.set(L,D);s.set(D,s.get(D)+C.size)}let c=this.input.connections.map((C)=>(this.input.buses??[]).find((b)=>b.connectionNames.includes(C.name))?.traceWidth??C.nominalTraceWidth??C.width??this.input.minTraceWidth),l=d0e(this.input,{targetLayers:a,viaDiameter:this.input.minViaPadDiameter??0.6,viaHoleDiameter:this.input.minViaHoleDiameter??0.3,traceWidth:Math.max(this.input.minTraceWidth,...c),clearance:this.input.minTraceToPadEdgeClearance??this.input.defaultObstacleMargin??0.075,boardEdgeClearance:this.input.minBoardEdgeClearance,holeToHoleClearance:this.input.minViaHoleEdgeToViaHoleEdgeClearance,allowBlindAndBuriedVias:this.input.allowBlindAndBuriedVias??!1},this.attempt);this.escapes=l.traces.map((C)=>({...C,source_trace_id:this.input.connections.find((b)=>b.name===C.connection_name)?.source_trace_id??C.connection_name}));let h=new Map;for(let C of this.input.connections){if(o.some((v)=>v.size>2&&v.has(C.name)))continue;let b=this.escapes.filter((v)=>v.connection_name===C.name).flatMap((v)=>v.route.filter((P)=>P.route_type==="via"));if(b.length!==2)continue;let I=t.filter((v)=>(this.input.buses??[]).every((P)=>!P.connectionNames.includes(C.name)||!P.allowedLayers||P.allowedLayers.includes(v))&&b.every((P)=>v!==P.from_layer&&(P.layers??e.slice(Math.min(e.indexOf(P.from_layer),e.indexOf(P.to_layer)),Math.max(e.indexOf(P.from_layer),e.indexOf(P.to_layer))+1)).includes(v)));if(I.length>1)h.set(C.name,I)}this.terminalLayers=h;let d={...this.input,connections:l.connections,traces:[...this.input.traces??[],...this.escapes]},u=new Set(d.buses?.flatMap((C)=>C.connectionNames)),_=(d.buses??[]).some((C)=>new Set(d.connections.filter((b)=>C.connectionNames.includes(b.name)).map((b)=>b.pointsToConnect[0].layer)).size>1),p=new Map;for(let C of d.differentialPairs??[]){let b=d.connections.find((I)=>I.name===C.connectionNames[0]).pointsToConnect[0].layer;p.set(b,(p.get(b)??0)+1)}let m=[...p.values()].some((C)=>C>1),A=new Set([...u,...(d.differentialPairs??[]).filter((C)=>!m||C.connectionNames.some((b)=>u.has(b))).flatMap((C)=>C.connectionNames)]),g=d.connections.filter((C)=>A.has(C.name)),f=d.connections.filter((C)=>!A.has(C.name)),y=d.connections.filter((C)=>u.has(C.name)).reduce((C,b)=>({x:C.x+b.pointsToConnect[1].x-b.pointsToConnect[0].x,y:C.y+b.pointsToConnect[1].y-b.pointsToConnect[0].y}),{x:0,y:0});if(!_&&this.attempt===0&&m&&(d.buses?.length??0)>1&&this.options.smoothTuning&&this.options.denseSearch&&(this.input.buses?.some((C)=>C.maxLength!==void 0)||Math.abs(y.x)>Math.abs(y.y)||Jk({...this.input,connections:this.input.connections.filter((C)=>u.has(C.name))}))){let C=t.length===2&&!this.input.allowBlindAndBuriedVias&&this.escapes.length===2*this.input.connections.length&&Jk({...this.input,connections:this.input.connections.filter((b)=>u.has(b.name))})&&this.input.connections.every((b)=>b.pointsToConnect.length===2&&b.pointsToConnect.every((I)=>Ede(this.input,b,I)));this.sharedPackages=(C?Boi:Doi)(this.input,d,this.escapes,h,this.childOptions());return}if(!_&&this.attempt===0&&this.options.smoothTuning&&this.options.denseSearch&&Math.abs(y.y)>=Math.abs(y.x)&&Jk({...this.input,connections:this.input.connections.filter((C)=>u.has(C.name))})&&this.input.connections.every((C)=>C.pointsToConnect.length===2&&C.pointsToConnect.every((b)=>Ede(this.input,C,b)))){this.backwardPackages=Roi(this.input,d,h,this.childOptions());return}let x=!_&&(this.attempt>0||Math.abs(y.x)>Math.abs(y.y))&&Jk({...this.input,connections:this.input.connections.filter((C)=>u.has(C.name))});if(g.length&&f.length&&!x){if(this.remainingInput={...d,connections:f,buses:[],differentialPairs:(d.differentialPairs??[]).filter((C)=>C.connectionNames.every((b)=>!A.has(b)))},m){let C=new Set(this.remainingInput.differentialPairs?.flatMap((v)=>v.connectionNames)),b=f.filter((v)=>C.has(v.name)),I=f.filter((v)=>!C.has(v.name));if(b.length&&I.length)this.followingInput={...this.remainingInput,connections:I,differentialPairs:[]},this.remainingInput={...this.remainingInput,connections:b}}this.child=new A2({...d,connections:g,differentialPairs:(d.differentialPairs??[]).filter((C)=>C.connectionNames.every((b)=>A.has(b)))},this.childOptions(!0),h)}else this.child=new A2(d,this.childOptions(),h)}_step(){try{if(this.envelopeOptimization){if(this.envelopeOptimization.next().done)this.finishAccepted(!1);return}if(this.siteRematch){let e=this.siteRematch.next();if(this.phase="resolve_control_sites",this.stats={...this.stats,routingStage:"control_sites"},!e.done)return;this.escapes=e.value.escapes,this.child=new A2({...this.remainingInput,connections:e.value.connections,traces:[...this.input.traces??[],...this.escapes,...this.completedLanes]},this.childOptions(),this.terminalLayers),this.remainingInput=void 0,this.siteRematch=void 0;return}if(!this.child&&!this.backwardPackages&&!this.sharedPackages)this.prepare();if(this.sharedPackages){this.phase="route_shared_layers";let e=this.sharedPackages.next();if(!e.done)return;if(this.sharedPackages=void 0,!e.value)throw Error("Shared-layer bus routing exhausted");this.escapes=e.value.escapes,this.child=A2.forValidation(e.value.input,e.value.traces,this.childOptions())}if(this.backwardPackages){this.phase="route_backward_packages";let e=this.backwardPackages.next();if(!e.done)return;if(this.backwardPackages=void 0,!e.value)throw Error("Backward package bus routing failed");this.escapes=e.value.escapes,this.child=A2.forRefinement(e.value.input,e.value.traces,this.childOptions())}if(this.child.step(),this.phase=`lanes_${this.child.phase}`,this.stats={...this.child.stats,layerAttempt:this.attempt,dogbones:this.escapes.length,routingStage:this.completedLanes.length?"remaining_signals":this.remainingInput?"matched_buses":"all_signals"},this.progress=this.child.progress,this.child.failed)throw Error(this.child.error??"Bus lanes failed");if(this.child.solved&&!this.remainingInput&&this.followingInput)this.remainingInput=this.followingInput,this.followingInput=void 0;if(this.child.solved&&this.remainingInput){this.completedLanes.push(...this.child.traces),this.siteRematch=_7n(this.input,this.remainingInput,this.completedLanes,this.escapes,this.terminalLayers);return}if(this.child.solved){let e=[...this.completedLanes,...this.child.traces],t=e;if(this.options.smoothTuning&&this.input.differentialPairs?.length){this.packageCoupling??=this.finishPackageCoupling({...this.input,traces:[...this.input.traces??[],...this.escapes],connections:this.input.connections.map((o)=>{let r=e.find((i)=>i.connection_name===o.name);return{...o,pointsToConnect:[r.route[0],r.route.at(-1)]}})},e);let n=this.packageCoupling.next();if(!n.done){this.phase="extend_package_coupling";return}t=n.value,this.packageCoupling=void 0}if(this.options.smoothTuning)t=ebn({...this.input,traces:[...this.input.traces??[],...this.escapes],connections:this.input.connections.map((n)=>{let o=t.find((r)=>r.connection_name===n.name);return{...n,pointsToConnect:[o.route[0],o.route.at(-1)]}})},t);if(this.options.smoothTuning&&(this.input.allowedLayers?.length??this.input.layerCount)===2)t=Cjr({...this.input,traces:[...this.input.traces??[],...this.escapes],connections:this.input.connections.map((n)=>{let o=t.find((r)=>r.connection_name===n.name);return{...n,pointsToConnect:[o.route[0],o.route.at(-1)]}})},t);if(this.traces=t.map((n)=>{let o=n.route.find((u)=>u.route_type==="wire").layer,r=this.escapes.filter((u)=>u.connection_name===n.connection_name).map((u)=>{let _=u.route.find((p)=>p.route_type==="via");return{...u,route:u.route.map((p)=>p.route_type==="via"?{...p,to_layer:o}:p.layer===_.to_layer?{...p,layer:o}:p)}}),i=(u,_)=>Math.hypot(u.x-_.x,u.y-_.y)<0.00000001,s=r.find((u)=>i(u.route.at(-1),n.route[0])),a=r.find((u)=>u!==s&&i(u.route.at(-1),n.route.at(-1))),c=s?.route,h=a?.route?.toReversed().map((u)=>u.route_type==="via"?{...u,from_layer:u.to_layer,to_layer:u.from_layer}:u)??[],d=(s?.route.length??1)-1;return{...n,coupledSection:n.coupledSection?.map((u)=>u+d),curvedSegments:n.curvedSegments?.map((u)=>u+d),route:[...c?.slice(0,-1)??[],...n.route,...h.slice(1)]}}),NP(this.input,this.traces).some((n)=>!n.withinLengthLimit||!n.aboveMinimumLength))throw Error("Final absolute bus length violation");this.acceptedTraces=structuredClone(this.traces),this.phase="optimize_envelope",this.envelopeOptimization=this.optimizeEnvelope()}}catch(e){if(this.acceptedTraces){this.stats={...this.stats,optimizationError:String(e)},this.finishAccepted(!0);return}if(this.sharedPackages?.return(null),this.sharedPackages=void 0,this.backwardPackages?.return(null),this.backwardPackages=void 0,this.packageCoupling?.return([]),this.packageCoupling=void 0,this.siteRematch?.return({connections:[],escapes:[]}),this.siteRematch=void 0,this.attempt++,this.options.fanout!=="none"&&this.attempt<this.input.layerCount){this.child=void 0,this.escapes=[],this.completedLanes=[],this.remainingInput=void 0,this.followingInput=void 0,this.phase="retry_layers";return}this.failureCode=this.child?.failureCode??"local_dogbone_failed",this.error=e instanceof Error?e.message:String(e),this.failed=!0,this.phase="failed",this.traces=[]}}visualize(){return this.child?.visualize()??{points:[],lines:[]}}};var koi=class{constructor(e){this.input=e,this.solver=new g7n(e)}input;isRouting=!1;solver;cancelScheduledTick;listeners=[];on(e,t){this.listeners.push({event:e,callback:t})}emit(e){for(let t of this.listeners)if(t.event===e.type)t.callback(e)}start(){if(this.isRouting)return;this.isRouting=!0;let e=()=>{if(!this.isRouting)return;try{for(let t=0;t<200&&!this.solver.solved&&!this.solver.failed;t++)this.solver.step();if(this.solver.failed){this.isRouting=!1,this.emit({type:"error",error:Error(this.solver.error??"Bus lanes routing failed")});return}if(this.solver.solved){this.isRouting=!1,this.emit({type:"complete",traces:this.solver.traces});return}this.emit({type:"progress",steps:this.solver.iterations,progress:this.solver.progress,phase:this.solver.phase,debugGraphics:this.solver.visualize()}),this.scheduleTick(e)}catch(t){this.isRouting=!1,this.emit({type:"error",error:t instanceof Error?t:Error(String(t))})}};this.scheduleTick(e)}scheduleTick(e){if(typeof globalThis.setImmediate==="function"){let t=globalThis.setImmediate(e);this.cancelScheduledTick=()=>globalThis.clearImmediate(t)}else{let t=setTimeout(e,0);this.cancelScheduledTick=()=>clearTimeout(t)}}stop(){this.isRouting=!1,this.cancelScheduledTick?.()}solveSync(){if(this.solver.solve(),this.solver.failed)throw Error(this.solver.error??"Bus lanes routing failed");return this.solver.traces}},syn=new WeakMap,A7n=(e)=>{let t=syn.get(e);if(t)return t;let n={toLocal:Hi(Hb(-e.rotation),Ii(-e.x,-e.y)),toWorld:Hi(Ii(e.x,e.y),Hb(e.rotation))};return syn.set(e,n),n},Loi=(e,t)=>{if(Db(e,t))return 0;let n=Number.POSITIVE_INFINITY;for(let o=0;o<t.length;o++){let r=t[o],i=t[(o+1)%t.length];n=Math.min(n,ga(e,r,i))}return n},f7n=(e,t,n)=>{let o={x:t,y:n};if(e.kind==="circle")return Math.max(Jl(o,e)-e.radius,0);if(e.kind==="segment")return Math.max(ga(o,{x:e.x1,y:e.y1},{x:e.x2,y:e.y2})-e.halfWidth,0);if(e.kind==="polygon")return Loi(o,e.points);let{toLocal:r}=A7n(e);return oHe(_o(r,o),{center:{x:0,y:0},width:e.halfWidth*2,height:e.halfHeight*2})},Hoi=(e,t)=>{if(f7n(e,t.x,t.y)===0)return t;if(e.kind==="circle"){let i={x:e.x,y:e.y},s=Lj(i,t);return{x:e.x+s.x*e.radius,y:e.y+s.y*e.radius}}if(e.kind==="segment"){let i=Ly(t,{x:e.x1,y:e.y1},{x:e.x2,y:e.y2}),s=Lj(i,t);return{x:i.x+s.x*e.halfWidth,y:i.y+s.y*e.halfWidth}}if(e.kind==="polygon"){let i=e.points[0],s=Number.POSITIVE_INFINITY;for(let a=0;a<e.points.length;a++){let c=e.points[a],l=e.points[(a+1)%e.points.length],h=Ly(t,c,l),d=Jl(t,h);if(d<s)s=d,i=h}return i}let{toLocal:n,toWorld:o}=A7n(e),r=_o(n,t);return _o(o,{x:td(r.x,-e.halfWidth,e.halfWidth),y:td(r.y,-e.halfHeight,e.halfHeight)})},y7n=({start:e,end:t,trace:n,clearance:o=0})=>{let r=n.halfWidth+o,i=Hs([e,t]),s={minX:i.minX-r,minY:i.minY-r,maxX:i.maxX+r,maxY:i.maxY+r},a={x:n.x1,y:n.y1},c={x:n.x2,y:n.y2},l=Hs([a,c]);if(!qp(l,s))return!1;return c5(e,t,a,c)<=r},x7n=(e,t)=>{let n=new Set(e),o=new Map,r=(s,a,c,l)=>{let h=`${s},${a}`,d=o.get(h)??[];d.push([c,l]),o.set(h,d)};for(let s of e){let a=s%t,c=Math.floor(s/t);if(c===0||!n.has(s-t))r(a,c,a+1,c);if(a===t-1||!n.has(s+1))r(a+1,c,a+1,c+1);if(!n.has(s+t))r(a+1,c+1,a,c+1);if(a===0||!n.has(s-1))r(a,c+1,a,c)}let i=[];for(let[s,a]of o)while(a.length>0){let[c,l]=s.split(",").map(Number),h=[[c,l]],d=a.pop();while(d[0]!==c||d[1]!==l){h.push(d);let _=o.get(`${d[0]},${d[1]}`);if(!_||_.length===0)break;d=_.pop()}let u=h.filter((_,p)=>{let m=h[(p+h.length-1)%h.length],A=h[(p+1)%h.length],g=m[0]===_[0]&&_[0]===A[0],f=m[1]===_[1]&&_[1]===A[1];return!g&&!f});if(u.length>=3)i.push(u)}return i},Foi=2,Tot=9,Dot=(e,{nx:t,ny:n})=>{let o=e%t,r=Math.floor(e/t),i=[];if(o>0)i.push(e-1);if(o<t-1)i.push(e+1);if(r>0)i.push(e-t);if(r<n-1)i.push(e+t);return i},zoi=(e,t)=>{let n=new Uint8Array(t.labels.length*2);return(o,r)=>{let i=Math.min(o,r)*2+(Math.abs(o-r)===t.nx?1:0),s=n[i];if(s!==0)return s===1;let a=t.gridCells[o].center,c=t.gridCells[r].center,l=dO(a,c),h=a.y===c.y,d=h?{minX:l.x,minY:l.y-t.gridPitch/2,maxX:l.x,maxY:l.y+t.gridPitch/2}:{minX:l.x-t.gridPitch/2,minY:l.y,maxX:l.x+t.gridPitch/2,maxY:l.y},u=0,_=(1<<Tot)-1;for(let p of t.traceBarriers){if(p.netIndex===e||p.maxX<d.minX||p.minX>d.maxX||p.maxY<d.minY||p.minY>d.maxY)continue;for(let m=0;m<Tot;m++){let A=1<<m;if((u&A)!==0)continue;let g=-t.gridPitch/2+t.gridPitch*m/(Tot-1),f=h?{x:l.x,y:l.y+g}:{x:l.x+g,y:l.y},y=Ly(f,p.start,p.end);if(Hj(f,y)<=p.radiusSquared)u|=A}if(u===_)return n[i]=2,!1}return n[i]=1,!0}},Not=(e,t)=>{let n=t.canCrossGridEdgeByNetIndex.get(e);if(!n)n=zoi(e,t),t.canCrossGridEdgeByNetIndex.set(e,n);return n},Ooi=({labeledLayer:e,insideCells:t,connectivitySeedNetIndices:n,traceBarriers:o,gridCells:r,traceClearance:i,gridPitch:s})=>{if(i===0)return;let{labels:a,nx:c,ny:l}=e,h=o.map((g)=>{let f=g.halfWidth+i,y={x:g.x1,y:g.y1},x={x:g.x2,y:g.y2},C=Hs([y,x]);return{netIndex:g.netIndex,start:y,end:x,radiusSquared:f**2,minX:C.minX-f,minY:C.minY-f,maxX:C.maxX+f,maxY:C.maxY+f}}),d={labels:a,nx:c,traceBarriers:h,gridCells:r,gridPitch:s,canCrossGridEdgeByNetIndex:new Map},u=new Uint8Array(a.length),_=[];for(let g=0;g<a.length;g++){if(t[g]!==1||n[g]!==a[g])continue;u[g]=1,_.push(g)}let p=0;while(p<_.length){let g=_[p++],f=a[g];for(let y of Dot(g,e)){if(t[y]!==1||u[y]===1||a[y]!==f||!Not(f,d)(g,y))continue;u[y]=1,_.push(y)}}let m=new Uint8Array(a.length),A=[];for(let g=0;g<a.length;g++){if(t[g]!==1||a[g]<0||u[g]===1||m[g]===1)continue;let f=a[g],y=[],x=[g];m[g]=1;while(x.length>0){let I=x.pop();y.push(I);for(let v of Dot(I,e)){if(t[v]!==1||m[v]===1||u[v]===1||a[v]!==f||!Not(f,d)(I,v))continue;m[v]=1,x.push(v)}}let C=new Map;for(let I of y)for(let v of Dot(I,e)){let P=a[v];if(u[v]!==1||P<0||P===f||!Not(P,d)(I,v))continue;C.set(P,(C.get(P)??0)+1)}let b=[...C.entries()].sort((I,v)=>v[1]-I[1])[0]?.[0];if(b!==void 0)A.push({cells:y,netIndex:b});else A.push({cells:y,netIndex:-1})}for(let g of A)for(let f of g.cells)a[f]=g.netIndex},Voi=({labeledLayer:e,insideCells:t,visibleCells:n,traceBarriers:o,gridCells:r,traceClearance:i})=>{let{labels:s,nx:a,ny:c}=e,l=new Set;for(let u=0;u<s.length;u++)if(n[u]===1&&s[u]>=0)l.add(s[u]);let h=new Map;for(let u of l){let _=new Int8Array(s.length).fill(-1),p=[];for(let A=0;A<s.length;A++){if(n[A]!==1||s[A]!==u)continue;_[A]=0,p.push(A)}let m=0;while(m<p.length){let A=p[m++];if(_[A]>=Foi)continue;let g=A%a,f=Math.floor(A/a),y=[];if(g>0)y.push(A-1);if(g<a-1)y.push(A+1);if(f>0)y.push(A-a);if(f<c-1)y.push(A+a);let x=r[A].center;for(let C of y){if(t[C]!==1||_[C]>=0||n[C]===1&&s[C]!==u)continue;let b=r[C].center;if(o.some((v)=>v.netIndex!==u&&y7n({start:x,end:b,trace:v,clearance:i})))continue;_[C]=_[A]+1,p.push(C)}}h.set(u,_)}let d=[];for(let u=0;u<s.length;u++){let _=s[u];if(t[u]!==1||_<0||n[u]===1)continue;let p=h.get(_)?.[u]??-1,m=Array.from(h.entries()).map(([A,g])=>({netIndex:A,distance:g[u]})).filter((A)=>A.netIndex!==_&&A.distance>=0&&(p<0||A.distance<p)).sort((A,g)=>A.distance-g.distance)[0];if(m)d.push({cell:u,netIndex:m.netIndex})}for(let u of d)s[u.cell]=u.netIndex},Yoi=(e)=>{let{bounds:t,boardOutline:n,gridPitch:o,regionNormalizationArea:r,traceClearance:i}=e,s=Math.max(1,Math.round((t.maxX-t.minX)/o)),a=Math.max(1,Math.round((t.maxY-t.minY)/o)),c=Math.max(1,Math.round(r/o**2)),l=nHe({rows:a,cols:s,xSpacing:o,ySpacing:o,offsetX:t.minX,offsetY:t.minY,yDirection:"up-is-negative",centered:!1}),h=[];for(let d of e.layers){let u=e.primitives.filter((C)=>C.layers.includes(d)&&e.nets[C.netIndex]?.isPower),_=e.primitives.filter((C)=>C.kind==="segment"&&C.isTrace===!0&&C.layers.includes(d)),p=new Int32Array(s*a).fill(-1),m=new Uint8Array(s*a),A=new Uint8Array(s*a),g=new Uint8Array(s*a),f=new Int32Array(s*a).fill(-1),y=o*Math.SQRT2/2;for(let{index:C,center:b}of l){if(!Db(b,n))continue;A[C]=1;let I=u.map((T)=>({primitive:T,distance:f7n(T,b.x,b.y)})).sort((T,N)=>T.distance-N.distance),v=I[0]?.primitive.netIndex??-1,P=I[0]?.distance??Number.POSITIVE_INFINITY,M=!1,B=!1;for(let T of I){if(T.distance===0){v=T.primitive.netIndex,P=T.distance,M=!0,B=!0;break}let N=Hoi(T.primitive,b);if(!_.some((L)=>L.netIndex!==T.primitive.netIndex&&y7n({start:b,end:N,trace:L,clearance:i}))){v=T.primitive.netIndex,P=T.distance,B=!0;break}}if(p[C]=v,M)m[C]=1;if(B)g[C]=1;if(B&&P<=y)f[C]=v}let x={layer:d,labels:p,nx:s,ny:a};Voi({labeledLayer:x,insideCells:A,visibleCells:g,traceBarriers:_,gridCells:l,traceClearance:i}),Ooi({labeledLayer:x,insideCells:A,connectivitySeedNetIndices:f,traceBarriers:_,gridCells:l,traceClearance:i,gridPitch:o}),Uoi(x,m,c),h.push(x)}return{...e,labeledLayers:h}},C7n=(e)=>{let{labels:t,nx:n,ny:o}=e,r=new Int32Array(n*o).fill(-1),i=[],s=[];for(let a=0;a<n*o;a++){if(r[a]!==-1||t[a]<0)continue;let c=t[a],l=[];r[a]=i.length,s.push(a);while(s.length>0){let h=s.pop();l.push(h);let d=h%n,u=Math.floor(h/n),_=[];if(d>0)_.push(h-1);if(d<n-1)_.push(h+1);if(u>0)_.push(h-n);if(u<o-1)_.push(h+n);for(let p of _)if(r[p]===-1&&t[p]===c)r[p]=i.length,s.push(p)}i.push({netIndex:c,cells:l})}return{component:r,regions:i}},Goi=(e)=>C7n(e).regions,Uoi=(e,t,n)=>{if(n<=1)return;while(!0){let{component:o,regions:r}=C7n(e),i=[];for(let s of r){if(s.cells.length>=n||s.cells.some((l)=>t[l]===1))continue;let a=new Map;for(let l of s.cells){let h=l%e.nx,d=Math.floor(l/e.nx),u=[];if(h>0)u.push(l-1);if(h<e.nx-1)u.push(l+1);if(d>0)u.push(l-e.nx);if(d<e.ny-1)u.push(l+e.nx);for(let _ of u){let p=o[_];if(p<0||r[p]===s)continue;a.set(p,(a.get(p)??0)+1)}}let c=[...a.entries()].map(([l,h])=>({region:r[l],sharedEdges:h})).filter((l)=>l.region.cells.length>s.cells.length).sort((l,h)=>h.sharedEdges-l.sharedEdges||h.region.cells.length-l.region.cells.length)[0]?.region;if(c)i.push({cells:s.cells,netIndex:c.netIndex})}if(i.length===0)return;for(let s of i)for(let a of s.cells)e.labels[a]=s.netIndex}},Woi=(e,t)=>{let n=new Set(e),o=[],r=[];while(n.size>0){let i=n.values().next().value,s=[];n.delete(i),r.push(i);while(r.length>0){let a=r.pop();s.push(a);let c=a%t,l=[a-t,a+t];if(c>0)l.push(a-1);if(c<t-1)l.push(a+1);for(let h of l){if(!n.has(h))continue;n.delete(h),r.push(h)}}o.push(s)}return o},ayn=(e)=>Math.abs(e.reduce((t,n,o)=>{let r=e[(o+1)%e.length];return t+n[0]*r[1]-r[0]*n[1]},0)/2),Xoi=(e,t)=>{let n=[e],o=[];while(n.length>0){let r=n.pop(),i=x7n(r,t);if(i.length<=1){o.push(r);continue}let s=i.reduce((_,p,m)=>ayn(p)>ayn(i[_])?m:_,0),c=i.find((_,p)=>p!==s).map((_)=>_[1]),l=Math.round((Math.min(...c)+Math.max(...c))/2),h=r.filter((_)=>Math.floor(_/t)<l),d=r.filter((_)=>Math.floor(_/t)>=l),u=[h,d].filter((_)=>_.length>0).flatMap((_)=>Woi(_,t));if(u.length<2||u.some((_)=>_.length===r.length))throw Error("Unable to split an implicit copper region around a hole");n.push(...u)}return o},cyn=(e)=>e.replace(/[^a-zA-Z0-9_]+/g,"_"),joi=(e)=>{let t=[],n=Math.max(1,Math.round(e.minRegionArea/e.gridPitch**2)),o=Hi(Ii(e.bounds.minX,e.bounds.minY),Fb(e.gridPitch));for(let r of e.labeledLayers){let i=Goi(r);for(let[s,a]of i.entries()){let c=e.nets[a.netIndex];if(!c?.isPower||a.cells.length<n)continue;let l=Xoi(a.cells,r.nx);for(let[h,d]of l.entries()){let u=x7n(d,r.nx);if(u.length!==1)throw Error("Implicit copper region part must have one outline");let p=u[0].map(([m,A])=>{let g=_o(o,{x:m,y:A});return{x:td(g.x,e.bounds.minX,e.bounds.maxX),y:td(g.y,e.bounds.minY,e.bounds.maxY)}});t.push({type:"pcb_copper_pour",pcb_copper_pour_id:`pcb_copper_pour_${cyn(r.layer)}_${cyn(c.sourceNet.source_net_id)}_${s}_${h}`,shape:"polygon",layer:r.layer,source_net_id:c.sourceNet.source_net_id,covered_with_solder_mask:e.coveredWithSolderMask,subcircuit_id:c.sourceNet.subcircuit_id,points:p})}}}return t},b7n=(e)=>e==="top"?"#c2453a":e==="bottom"?"#5b7fd8":"#c58b43",Koi=0.25,$oi=0.2,qoi=0,Joi=0.5,Zoi=(e)=>{if(e.outline&&e.outline.length>=3)return e.outline;if(e.width===void 0||e.height===void 0)throw Error("pcb_board must provide an outline or width and height");let t=Pd({center:e.center,width:e.width,height:e.height});return[{x:t.minX,y:t.minY},{x:t.maxX,y:t.minY},{x:t.maxX,y:t.maxY},{x:t.minX,y:t.maxY}]},I7n=(e,t)=>{let{layers:n,netIndex:o,x:r,y:i,width:s,height:a,rotation:c}=t,l=Math.min(s,a)/2,d=(Math.max(s,a)-l*2)/2,u=Hi(Ii(r,i),Hb(c+(a>s?90:0))),[_,p]=Qwt(u,[{x:-d,y:0},{x:d,y:0}]);e.push({kind:"segment",layers:n,netIndex:o,x1:_.x,y1:_.y,x2:p.x,y2:p.y,halfWidth:l})},eri=(e,t,n)=>{let o=[t.layer];if(t.shape==="circle")e.push({kind:"circle",layers:o,netIndex:n,x:t.x,y:t.y,radius:t.radius});else if(t.shape==="rect"||t.shape==="rotated_rect")e.push({kind:"rect",layers:o,netIndex:n,x:t.x,y:t.y,halfWidth:t.width/2,halfHeight:t.height/2,rotation:t.shape==="rotated_rect"?t.ccw_rotation:0});else if(t.shape==="polygon")e.push({kind:"polygon",layers:o,netIndex:n,points:t.points});else I7n(e,{layers:o,netIndex:n,x:t.x,y:t.y,width:t.width,height:t.height,rotation:t.shape==="rotated_pill"?t.ccw_rotation:0})},tri=(e,t,n)=>{let o=t.layers;if(t.shape==="circle")e.push({kind:"circle",layers:o,netIndex:n,x:t.x,y:t.y,radius:t.outer_diameter/2});else if(t.shape==="oval"||t.shape==="pill")I7n(e,{layers:o,netIndex:n,x:t.x,y:t.y,width:t.outer_width,height:t.outer_height,rotation:t.ccw_rotation});else if(t.shape==="hole_with_polygon_pad")e.push({kind:"polygon",layers:o,netIndex:n,points:t.pad_outline});else if("rect_pad_width"in t&&"rect_pad_height"in t){let r=t.shape==="circular_hole_with_rect_pad"?t.rect_ccw_rotation??0:t.shape==="rotated_pill_hole_with_rect_pad"?t.rect_ccw_rotation:0;e.push({kind:"rect",layers:o,netIndex:n,x:t.x,y:t.y,halfWidth:t.rect_pad_width/2,halfHeight:t.rect_pad_height/2,rotation:r})}},nri=(e,t,n)=>{let o=null;for(let r of t.route){if(r.route_type!=="wire"){if(o=null,r.route_type==="via")e.push({kind:"circle",layers:[r.from_layer,r.to_layer],netIndex:n,x:r.x,y:r.y,radius:0.3});continue}if(o&&o.layer===r.layer)e.push({kind:"segment",layers:[r.layer],netIndex:n,isTrace:!0,x1:o.x,y1:o.y,x2:r.x,y2:r.y,halfWidth:r.width/2});o=r}},v7n=(e)=>{let t=e.gridPitch??Koi,n=e.traceClearance??$oi,o=e.edgeSimplificationTolerance??t,r=e.minRegionArea??qoi,i=e.regionNormalizationArea??Joi;if(!(t>0))throw Error("gridPitch must be greater than zero");if(!Number.isFinite(n)||n<0)throw Error("traceClearance must be zero or greater");if(!Number.isFinite(o)||o<0)throw Error("edgeSimplificationTolerance must be zero or greater");if(!(r>=0))throw Error("minRegionArea must be zero or greater");if(!(i>=0))throw Error("regionNormalizationArea must be zero or greater");let s=e.circuitJson.find((I)=>I.type==="pcb_board");if(!s)throw Error("No pcb_board found in Circuit JSON");let a=Zoi(s),c=Hs(a),l=e.circuitJson.filter((I)=>I.type==="source_net"),h=l.map((I)=>({sourceNet:I,isPower:Boolean(I.is_power||I.is_ground||I.is_positive_voltage_source)})),d=new Map,u=new Map;for(let[I,v]of l.entries())if(d.set(v.source_net_id,I),v.subcircuit_connectivity_map_key)u.set(v.subcircuit_connectivity_map_key,I);let _=new Map,p=(I,v=I)=>{let P=_.get(I);if(P!==void 0)return P;let M=`source_net_implicit_${I.replace(/[^a-zA-Z0-9_]+/g,"_")}`,B=M,T=1;while(d.has(B))B=`${M}_${T++}`;let N={type:"source_net",source_net_id:B,name:v,member_source_group_ids:[],is_ground:!1,is_power:!1,is_positive_voltage_source:!1},D=h.length;return h.push({sourceNet:N,isPower:!1}),d.set(B,D),_.set(I,D),D},m=(I)=>{let v=I.subcircuit_connectivity_map_key;if(!v)return;let P=u.get(v);if(P!==void 0)return P;let M=p(`connectivity:${v}`,v);return u.set(v,M),M},A=eS(e.circuitJson),g=Object.values(A.netMap);for(let I of e.circuitJson){if(I.type==="source_trace"){g.push([I.source_trace_id,...I.connected_source_port_ids,...I.connected_source_net_ids]);continue}if(I.type==="pcb_port"){g.push([I.pcb_port_id,I.source_port_id]);continue}if(I.type==="pcb_smtpad"&&I.pcb_port_id){g.push([I.pcb_smtpad_id,I.pcb_port_id]);continue}if(I.type==="pcb_plated_hole"&&I.pcb_port_id){g.push([I.pcb_plated_hole_id,I.pcb_port_id]);continue}if(I.type==="pcb_trace"){let v=Array.from(new Set(I.route.flatMap((B)=>B.route_type==="wire"?[B.start_pcb_port_id,B.end_pcb_port_id].filter((T)=>Boolean(T)):[]))),P=I.source_net_id,M=[...P?[P]:[],...v.length>0?v:I.source_trace_id?[I.source_trace_id]:[]];if(M.length>0)g.push([I.pcb_trace_id,...M]);continue}if(I.type==="pcb_via"){let v=I,P=v.source_net_id??v.pcb_trace_id??v.source_trace_id;if(P)g.push([v.pcb_via_id,P])}}let f=new l5(Mw(g)),y=new Map,x=(I)=>{let v=cO(I),P=f.getNetConnectedToId(v);if(P){let M=l.flatMap((N,D)=>f.areIdsConnected(v,N.source_net_id)?[D]:[]);if(M.length>1){let N=M.map((D)=>l[D].source_net_id);throw Error(`Circuit JSON connectivity assigns ${v} to multiple source nets: ${N.join(", ")}`)}if(M[0]!==void 0)return y.set(P,M[0]),M[0];let B=y.get(P);if(B!==void 0)return B;let T=m(I)??p(`connectivity-network:${P}`,P);return y.set(P,T),T}return m(I)},C=(I)=>{let v=I.source_net_id;if(v)return d.get(v)??p(`source-net-id:${v}`,v);let P=x(I);if(P!==void 0)return P;let M=cO(I);return p(`${I.type}:${M}`,M)},b=[];for(let I of e.circuitJson){if(I.type!=="pcb_smtpad"&&I.type!=="pcb_plated_hole"&&I.type!=="pcb_via"&&I.type!=="pcb_trace")continue;let v=C(I);if(v===void 0)continue;if(I.type==="pcb_smtpad")eri(b,I,v);else if(I.type==="pcb_plated_hole")tri(b,I,v);else if(I.type==="pcb_via"){let P=I;b.push({kind:"circle",layers:P.layers,netIndex:v,x:P.x,y:P.y,radius:P.outer_diameter/2})}else if(I.type==="pcb_trace")nri(b,I,v)}return{bounds:c,boardOutline:a,layers:e.layers??["top","bottom"],nets:h,primitives:b,gridPitch:t,traceClearance:n,minRegionArea:r,regionNormalizationArea:i,coveredWithSolderMask:e.coveredWithSolderMask??!0}},AL=(e,t)=>e.x===t.x&&e.y===t.y,ori=(e,t)=>{if(e.length<=2)return[...e];let n=new Uint8Array(e.length);n[0]=1,n[e.length-1]=1;let o=[[0,e.length-1]];while(o.length>0){let[r,i]=o.pop(),s=e[r],a=e[i],c=-1,l=t;for(let h=r+1;h<i;h++){let d=ga(e[h],s,a);if(d>l)l=d,c=h}if(c!==-1)n[c]=1,o.push([r,c],[c,i])}return e.filter((r,i)=>n[i]===1)},lyn=(e)=>{let t=0;for(let n=0;n<e.length;n++){let o=e[n],r=e[(n+1)%e.length];t+=o.x*r.y-r.x*o.y}return t/2},S7n=(e,t,n)=>(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x),Kit=(e,t)=>{if(e.length<=2)return[...e];let n=e.map((i,s)=>{if(s===0||s===e.length-1)return 0;return Math.sign(S7n(e[s-1],e[s],e[s+1]))}),o=[0];for(let i=1;i<e.length-1;i++){let s=n[i];if(s===0)continue;let a=s===n[i-1]||s===n[i+1],c=e[i-1],l=e[i],h=e[i+1],d=Math.min(Jl(l,c),Jl(h,l));if(a||d>t)o.push(i)}o.push(e.length-1);let r=[];for(let i=0;i<o.length-1;i++){let s=o[i],a=o[i+1],c=ori(e.slice(s,a+1),t);r.push(...i===0?c:c.slice(1))}return r},rri=(e)=>{for(let t=0;t<e.length;t++){let n=(t+1)%e.length;for(let o=t+1;o<e.length;o++){let r=(o+1)%e.length;if(t===o||t===r||n===o||n===r)continue;if(GA(e[t],e[n],e[o],e[r]))return!1}}return!0},P7n=(e)=>{let t=e.filter((n,o)=>o===0||!AL(n,e[o-1]));if(t.length>1&&AL(t[0],t[t.length-1]))t.pop();return t},iri=(e,t,n)=>{if(AL(e,t)||AL(e,n))return!1;let o=S7n(t,n,e);if(Math.abs(o)>0.000000001)return!1;return hO(t,e,n)},sri=(e,t)=>{let n=[];for(let o=0;o<e.length;o++){let r=e[o],i=e[(o+1)%e.length],s=i.x-r.x,a=i.y-r.y,c=t.filter((l)=>iri(l,r,i)).map((l)=>({point:l,position:Math.abs(s)>=Math.abs(a)?(l.x-r.x)/s:(l.y-r.y)/a})).sort((l,h)=>l.position-h.position);n.push(r);for(let{point:l}of c)if(!AL(n[n.length-1],l))n.push(l)}return n},E7n=(e,t)=>{if(t.length<3)return!1;let n=lyn(e),o=lyn(t);return n!==0&&o!==0&&Math.sign(n)===Math.sign(o)&&rri(t)},ari=(e,t)=>{let n=P7n(e);if(n.length<4||t<=0)return n;let o=[...n,n[0]],r=Kit(o,t);if(AL(r[0],r[r.length-1]))r.pop();if(!E7n(n,r))return n;return r},$it=(e)=>`${e.x},${e.y}`,cri=(e,t)=>{let n=$it(e),o=$it(t);return n<o?`${n}|${o}`:`${o}|${n}`},hyn=(e)=>e.map($it).join("|"),lri=(e)=>{let t=hyn(e),n=[...e].reverse(),o=hyn(n);return t<=o?{points:[...e],reversed:!1,key:t}:{points:n,reversed:!0,key:o}},hri=(e)=>{let t=new Map;for(let[o,r]of e.entries())for(let i=0;i<r.length;i++){let s=cri(r[i],r[(i+1)%r.length]),a=t.get(s)??[];a.push({polygonIndex:o,edgeIndex:i}),t.set(s,a)}let n=e.map((o,r)=>o.map(()=>`outer:${r}`));for(let o of t.values()){if(o.length!==2||o[0].polygonIndex===o[1].polygonIndex)continue;let r=o[0].polygonIndex,i=o[1].polygonIndex,s=r<i?`${r}:${i}`:`${i}:${r}`;for(let a of o)n[a.polygonIndex][a.edgeIndex]=`shared:${s}`}return n},dri=(e,t,n)=>{let o=[e[t]],r=t;while(r!==n)o.push(e[(r+1)%e.length]),r=(r+1)%e.length;return o},uri=(e,t)=>{let n=[];for(let o of e.chains){let r=t.get(o.arcKey),i=r.disabled?r.original:r.simplified,s=o.reversed?[...i].reverse():i;if(n.length===0)n.push(...s);else if(AL(n[n.length-1],s[0]))n.push(...s.slice(1));else return[]}if(n.length>1&&AL(n[0],n[n.length-1]))n.pop();return n},pri=(e,t)=>{let n=e.map(P7n),o=n.flat(),r=n.map((l)=>sri(l,o));if(t<=0||r.length===0)return r;let i=hri(r),s=new Map,a=[];for(let[l,h]of r.entries()){if(h.length<4){a.push({original:h,mode:"fixed"});continue}let d=i[l],u=d.flatMap((p,m)=>d[(m+h.length-1)%h.length]===p?[]:[m]);if(u.length===0){if(d[0]?.startsWith("shared:"))a.push({original:h,mode:"fixed"});else a.push({original:h,mode:"standalone",simplified:ari(h,t)});continue}let _=[];for(let p=0;p<u.length;p++){let m=u[p],A=u[(p+1)%u.length],g=dri(h,m,A),f=d[m];if(f.startsWith("shared:")){let y=lri(g),x=`${f}:${y.key}`;if(!s.has(x))s.set(x,{original:y.points,simplified:Kit(y.points,t),disabled:!1});_.push({arcKey:x,reversed:y.reversed})}else{let y=`outer:${l}:${p}`;s.set(y,{original:g,simplified:Kit(g,t),disabled:!1}),_.push({arcKey:y,reversed:!1})}}a.push({original:h,mode:"chains",chains:_})}let c=r;for(let l=0;l<=s.size;l++){c=a.map((u)=>{if(u.mode==="fixed")return u.original;if(u.mode==="standalone")return u.simplified;return uri(u,s)});let h=c.flatMap((u,_)=>E7n(a[_].original,u)?[]:[_]);if(h.length===0)return c;let d=!1;for(let u of h){let _=a[u];if(_.mode!=="chains")continue;for(let p of _.chains){let m=s.get(p.arcKey);if(!m.disabled)m.disabled=!0,d=!0}}if(!d)return c.map((u,_)=>h.includes(_)?a[_].original:u)}return r},mri="#555a66",_ri="red",M7n="blue",gri="rgba(255, 0, 0, 0.5)",Ari="rgba(0, 0, 255, 0.5)",fri=0.35,dyn=["#ed9148","#d93bd0","#b6df38","#438bd9","#e5485f","#43d16d","#8b48df","#e6b93f","#43ced2","#cf3d99"],yri=(e,t)=>{let n=Number.parseInt(e.slice(1,3),16),o=Number.parseInt(e.slice(3,5),16),r=Number.parseInt(e.slice(5,7),16);return`rgba(${n}, ${o}, ${r}, ${t})`},w7n=(e)=>{let t=e.map((n)=>n==="top"?0:n==="bottom"?1:null).filter((n)=>n!==null);return`z${Array.from(new Set(t)).join(",")}`},xri=(e)=>e.includes("top")?_ri:M7n,Cri=(e)=>e.includes("top")?gri:Ari,bri=(e,t,n)=>{let o=e.nets[t]?.sourceNet;return`${o?.name??o?.source_net_id??"unknown net"} ${n}`},Iri=(e)=>{let t={coordinateSystem:"cartesian",title:"Circuit JSON copper obstacles",points:[],rects:[],circles:[],lines:[{points:[...e.boardOutline,e.boardOutline[0]],strokeColor:mri,strokeWidth:0.08,label:"PCB outline"}],polygons:[],texts:[]};for(let n of e.primitives){let o=xri(n.layers),r=Cri(n.layers),i=w7n(n.layers),s=bri(e,n.netIndex,n.kind);if(n.kind==="rect"){t.rects.push({center:{x:n.x,y:n.y},width:n.halfWidth*2,height:n.halfHeight*2,ccwRotationDegrees:n.rotation,fill:r,layer:i,label:s});continue}if(n.kind==="segment"){let c=n.layers.includes("top");t.lines.push({points:[{x:n.x1,y:n.y1},{x:n.x2,y:n.y2}],strokeColor:c?o:"rgba(0, 0, 255, 0.5)",strokeWidth:n.halfWidth*2,...c?{}:{strokeDash:[0.2,0.2]},layer:i,label:s});continue}if(n.kind==="polygon"){t.polygons.push({points:n.points,fill:r,stroke:o,strokeWidth:0.04,layer:i,label:s});continue}let a=n.layers.includes("top")&&n.layers.includes("bottom");t.circles.push({center:{x:n.x,y:n.y},radius:n.radius,fill:a?M7n:r,stroke:"none",layer:i,label:s})}return t},vri=(e,t)=>({coordinateSystem:"cartesian",title:"Power-net copper pour polygons",points:[],rects:[],circles:[],lines:[],polygons:t.flatMap((n)=>{if(n.shape!=="polygon")return[];let o=e.nets.findIndex(({sourceNet:s})=>s.source_net_id===n.source_net_id),r=dyn[Math.max(0,o)%dyn.length],i=e.nets[o]?.sourceNet;return[{points:n.points,fill:yri(r,fri),stroke:r,strokeWidth:0.06,layer:w7n([n.layer]),label:`${i?.name??n.source_net_id??"power net"} ${n.layer} pour`}]}),texts:[]}),Sri=(e,t)=>({coordinateSystem:"cartesian",title:t.polygons?.length?t.title:e.title,polygons:[...t.polygons??[],...e.polygons??[]],rects:[...e.rects??[],...t.rects??[]],lines:[...e.lines??[],...t.lines??[]],circles:[...e.circles??[],...t.circles??[]],points:[...e.points??[],...t.points??[]],texts:[...e.texts??[],...t.texts??[]]}),Pri=class extends po{constructor(e){super();this.input=e}input;output;_step(){this.output=v7n(this.input),this.solved=!0}getOutput(){if(!this.output)throw Error("Circuit JSON has not been prepared");return this.output}},Eri=class extends po{constructor(e){super();this.input=e}input;output;_step(){this.output=Yoi(this.input),this.stats={layers:this.output.labeledLayers.length,samples:this.output.labeledLayers.reduce((e,t)=>e+t.nx*t.ny,0)},this.solved=!0}getOutput(){if(!this.output)throw Error("Grid cells have not been assigned");return this.output}},Mri=class extends po{constructor(e){super();this.input=e}input;output;_step(){this.output=joi(this.input),this.stats={polygons:this.output.length},this.solved=!0}getOutput(){if(!this.output)throw Error("Power polygons have not been traced");return this.output}visualize(){return{points:[],rects:[],circles:[],texts:[],lines:(this.output??[]).flatMap((e)=>{if(e.shape!=="polygon")return[];return[{points:[...e.points,e.points[0]],strokeColor:b7n(e.layer),strokeWidth:0.08,label:e.source_net_id}]})}}},wri=class extends po{constructor(e){super();this.input=e}input;output;_step(){let e=0,t=0,n=[...this.input.pours],o=new Map;for(let[r,i]of this.input.pours.entries()){if(i.shape!=="polygon")continue;e+=i.points.length;let s=o.get(i.layer)??[];s.push(r),o.set(i.layer,s)}for(let r of o.values()){let i=pri(r.map((s)=>{let a=this.input.pours[s];if(a.shape!=="polygon")return[];return a.points}),this.input.tolerance);for(let[s,a]of i.entries()){let c=r[s],l=this.input.pours[c];if(l.shape!=="polygon")continue;n[c]={...l,points:a},t+=a.length}}this.output=n,this.stats={polygons:this.output.length,inputPoints:e,outputPoints:t,pointsRemoved:e-t},this.solved=!0}getOutput(){if(!this.output)throw Error("Polygon edges have not been simplified");return this.output}visualize(){return{points:[],rects:[],circles:[],texts:[],lines:(this.output??[]).flatMap((e)=>{if(e.shape!=="polygon")return[];return[{points:[...e.points,e.points[0]],strokeColor:b7n(e.layer),strokeWidth:0.08,label:e.source_net_id}]})}}},Bri=class extends Rb{initialPreparedProblem;pipelineDef=[Pi("prepareCircuitJson",Pri,(e)=>[e.inputProblem]),Pi("assignGridCells",Eri,(e)=>[e.getStageOutput("prepareCircuitJson")]),Pi("tracePowerPolygons",Mri,(e)=>[e.getStageOutput("assignGridCells")]),Pi("simplifyPolygonEdges",wri,(e)=>{let t=e.getStageOutput("prepareCircuitJson");return[{pours:e.getStageOutput("tracePowerPolygons"),tolerance:e.inputProblem.edgeSimplificationTolerance??t.gridPitch}]})];getSolverName(){return"ImplicitCopperPourPipelineSolver"}getConstructorParams(){return[this.inputProblem]}getOutput(){return this.getStageOutput("simplifyPolygonEdges")??[]}visualize(){let e=this.getStageOutput("prepareCircuitJson")??(this.initialPreparedProblem??=v7n(this.inputProblem)),t=Iri(e),n=this.getStageOutput("simplifyPolygonEdges")??this.getStageOutput("tracePowerPolygons")??[];return Sri(t,vri(e,n))}},{create:Tri,defineProperty:B7n,getOwnPropertyDescriptor:Dri,getOwnPropertyNames:T7n,getPrototypeOf:Nri}=Object,Rri=Object.prototype.hasOwnProperty,Qri=(e,t)=>function(){return t||(0,e[T7n(e)[0]])((t={exports:{}}).exports,t),t.exports},kri=(e,t,n,o)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let r of T7n(t))if(!Rri.call(e,r)&&r!==n)B7n(e,r,{get:()=>t[r],enumerable:!(o=Dri(t,r))||o.enumerable})}return e},Lri=(e,t,n)=>(n=e!=null?Tri(Nri(e)):{},kri(t||!e||!e.__esModule?B7n(n,"default",{value:e,enumerable:!0}):n,e)),Hri=Qri({"node_modules/svgson/dist/svgson.umd.js"(e,t){(function(n,o){typeof e==="object"&&typeof t<"u"?t.exports=o():typeof define==="function"&&define.amd?define(o):(n=typeof globalThis<"u"?globalThis:n||self,n.svgson=o())})(e,function(){var n=function(Y){return Y!=null&&(o(Y)||r(Y)||!!Y._isBuffer)};function o(Y){return!!Y.constructor&&typeof Y.constructor.isBuffer==="function"&&Y.constructor.isBuffer(Y)}function r(Y){return typeof Y.readFloatLE==="function"&&typeof Y.slice==="function"&&o(Y.slice(0,0))}var i=Object.prototype.toString,s=function(X){if(typeof X>"u")return"undefined";if(X===null)return"null";if(X===!0||X===!1||X instanceof Boolean)return"boolean";if(typeof X==="string"||X instanceof String)return"string";if(typeof X==="number"||X instanceof Number)return"number";if(typeof X==="function"||X instanceof Function)return"function";if(typeof Array.isArray<"u"&&Array.isArray(X))return"array";if(X instanceof RegExp)return"regexp";if(X instanceof Date)return"date";var K=i.call(X);if(K==="[object RegExp]")return"regexp";if(K==="[object Date]")return"date";if(K==="[object Arguments]")return"arguments";if(K==="[object Error]")return"error";if(n(X))return"buffer";if(K==="[object Set]")return"set";if(K==="[object WeakSet]")return"weakset";if(K==="[object Map]")return"map";if(K==="[object WeakMap]")return"weakmap";if(K==="[object Symbol]")return"symbol";if(K==="[object Int8Array]")return"int8array";if(K==="[object Uint8Array]")return"uint8array";if(K==="[object Uint8ClampedArray]")return"uint8clampedarray";if(K==="[object Int16Array]")return"int16array";if(K==="[object Uint16Array]")return"uint16array";if(K==="[object Int32Array]")return"int32array";if(K==="[object Uint32Array]")return"uint32array";if(K==="[object Float32Array]")return"float32array";if(K==="[object Float64Array]")return"float64array";return"object"};function a(Y,X){return X={exports:{}},Y(X,X.exports),X.exports}var c=a(function(Y){(function(){function X(K,J){if(typeof J!=="function")return K;var ee={};for(var se in K)if(Object.prototype.hasOwnProperty.call(K,se))ee[J(se,K[se])||se]=K[se];return ee}if(Y.exports)Y.exports=X;else window.rename=X})()}),l=function Y(X,K){var J=s(X);if(J!=="object"&&J!=="array")throw Error("expected an object");var ee=[];if(J==="object")X=c(X,K),ee={};for(var se in X)if(X.hasOwnProperty(se)){var ne=X[se];if(s(ne)==="object"||s(ne)==="array")ee[se]=Y(ne,K);else ee[se]=ne}return ee},h=a(function(Y){var X=Object.prototype.hasOwnProperty,K="~";function J(){}if(Object.create){if(J.prototype=Object.create(null),!new J().__proto__)K=!1}function ee(ne,re,Z){this.fn=ne,this.context=re,this.once=Z||!1}function se(){this._events=new J,this._eventsCount=0}se.prototype.eventNames=function(){var re=[],Z,te;if(this._eventsCount===0)return re;for(te in Z=this._events)if(X.call(Z,te))re.push(K?te.slice(1):te);if(Object.getOwnPropertySymbols)return re.concat(Object.getOwnPropertySymbols(Z));return re},se.prototype.listeners=function(re,Z){var te=K?K+re:re,ie=this._events[te];if(Z)return!!ie;if(!ie)return[];if(ie.fn)return[ie.fn];for(var le=0,ue=ie.length,de=Array(ue);le<ue;le++)de[le]=ie[le].fn;return de},se.prototype.emit=function(re,Z,te,ie,le,ue){var de=K?K+re:re;if(!this._events[de])return!1;var me=this._events[de],Ae=arguments.length,xe,Me;if(me.fn){if(me.once)this.removeListener(re,me.fn,void 0,!0);switch(Ae){case 1:return me.fn.call(me.context),!0;case 2:return me.fn.call(me.context,Z),!0;case 3:return me.fn.call(me.context,Z,te),!0;case 4:return me.fn.call(me.context,Z,te,ie),!0;case 5:return me.fn.call(me.context,Z,te,ie,le),!0;case 6:return me.fn.call(me.context,Z,te,ie,le,ue),!0}for(Me=1,xe=Array(Ae-1);Me<Ae;Me++)xe[Me-1]=arguments[Me];me.fn.apply(me.context,xe)}else{var Re=me.length,we;for(Me=0;Me<Re;Me++){if(me[Me].once)this.removeListener(re,me[Me].fn,void 0,!0);switch(Ae){case 1:me[Me].fn.call(me[Me].context);break;case 2:me[Me].fn.call(me[Me].context,Z);break;case 3:me[Me].fn.call(me[Me].context,Z,te);break;case 4:me[Me].fn.call(me[Me].context,Z,te,ie);break;default:if(!xe)for(we=1,xe=Array(Ae-1);we<Ae;we++)xe[we-1]=arguments[we];me[Me].fn.apply(me[Me].context,xe)}}}return!0},se.prototype.on=function(re,Z,te){var ie=new ee(Z,te||this),le=K?K+re:re;if(!this._events[le])this._events[le]=ie,this._eventsCount++;else if(!this._events[le].fn)this._events[le].push(ie);else this._events[le]=[this._events[le],ie];return this},se.prototype.once=function(re,Z,te){var ie=new ee(Z,te||this,!0),le=K?K+re:re;if(!this._events[le])this._events[le]=ie,this._eventsCount++;else if(!this._events[le].fn)this._events[le].push(ie);else this._events[le]=[this._events[le],ie];return this},se.prototype.removeListener=function(re,Z,te,ie){var le=K?K+re:re;if(!this._events[le])return this;if(!Z){if(--this._eventsCount===0)this._events=new J;else delete this._events[le];return this}var ue=this._events[le];if(ue.fn){if(ue.fn===Z&&(!ie||ue.once)&&(!te||ue.context===te))if(--this._eventsCount===0)this._events=new J;else delete this._events[le]}else{for(var de=0,me=[],Ae=ue.length;de<Ae;de++)if(ue[de].fn!==Z||ie&&!ue[de].once||te&&ue[de].context!==te)me.push(ue[de]);if(me.length)this._events[le]=me.length===1?me[0]:me;else if(--this._eventsCount===0)this._events=new J;else delete this._events[le]}return this},se.prototype.removeAllListeners=function(re){var Z;if(re){if(Z=K?K+re:re,this._events[Z])if(--this._eventsCount===0)this._events=new J;else delete this._events[Z]}else this._events=new J,this._eventsCount=0;return this},se.prototype.off=se.prototype.removeListener,se.prototype.addListener=se.prototype.on,se.prototype.setMaxListeners=function(){return this},se.prefixed=K,se.EventEmitter=se,Y.exports=se});function d(Y,X,K){if(X in Y)Object.defineProperty(Y,X,{value:K,enumerable:!0,configurable:!0,writable:!0});else Y[X]=K;return Y}var u=function(){},_={data:"state-data",cdata:"state-cdata",tagBegin:"state-tag-begin",tagName:"state-tag-name",tagEnd:"state-tag-end",attributeNameStart:"state-attribute-name-start",attributeName:"state-attribute-name",attributeNameEnd:"state-attribute-name-end",attributeValueBegin:"state-attribute-value-begin",attributeValue:"state-attribute-value"},p={lt:"action-lt",gt:"action-gt",space:"action-space",equal:"action-equal",quote:"action-quote",slash:"action-slash",char:"action-char",error:"action-error"},m={text:"text",openTag:"open-tag",closeTag:"close-tag",attributeName:"attribute-name",attributeValue:"attribute-value"},A={" ":p.space,"\t":p.space,"\n":p.space,"\r":p.space,"<":p.lt,">":p.gt,'"':p.quote,"'":p.quote,"=":p.equal,"/":p.slash},g=function(X){return A[X]||p.char},f=function(X){var K,J,ee,se,ne,re,Z,te,ie,le;X=Object.assign({debug:!1},X);var ue=new h,de=_.data,me="",Ae="",xe="",Me="",Re="",we="",_e=function(Ne,ke){if(Ae[0]==="?"||Ae[0]==="!")return;var nt={type:Ne,value:ke};if(X.debug)console.log("emit:",nt);ue.emit("data",nt)};ue.stateMachine=(le={},d(le,_.data,(K={},d(K,p.lt,function(){if(me.trim())_e(m.text,me);Ae="",Re=!1,de=_.tagBegin}),d(K,p.char,function(Se){me+=Se}),K)),d(le,_.cdata,d({},p.char,function(Se){if(me+=Se,me.substr(-3)==="]]>")_e(m.text,me.slice(0,-3)),me="",de=_.data})),d(le,_.tagBegin,(J={},d(J,p.space,u),d(J,p.char,function(Se){Ae=Se,de=_.tagName}),d(J,p.slash,function(){Ae="",Re=!0}),J)),d(le,_.tagName,(ee={},d(ee,p.space,function(){if(Re)de=_.tagEnd;else de=_.attributeNameStart,_e(m.openTag,Ae)}),d(ee,p.gt,function(){if(Re)_e(m.closeTag,Ae);else _e(m.openTag,Ae);me="",de=_.data}),d(ee,p.slash,function(){de=_.tagEnd,_e(m.openTag,Ae)}),d(ee,p.char,function(Se){if(Ae+=Se,Ae==="![CDATA[")de=_.cdata,me="",Ae=""}),ee)),d(le,_.tagEnd,(se={},d(se,p.gt,function(){_e(m.closeTag,Ae),me="",de=_.data}),d(se,p.char,u),se)),d(le,_.attributeNameStart,(ne={},d(ne,p.char,function(Se){xe=Se,de=_.attributeName}),d(ne,p.gt,function(){me="",de=_.data}),d(ne,p.space,u),d(ne,p.slash,function(){Re=!0,de=_.tagEnd}),ne)),d(le,_.attributeName,(re={},d(re,p.space,function(){de=_.attributeNameEnd}),d(re,p.equal,function(){_e(m.attributeName,xe),de=_.attributeValueBegin}),d(re,p.gt,function(){Me="",_e(m.attributeName,xe),_e(m.attributeValue,Me),me="",de=_.data}),d(re,p.slash,function(){Re=!0,Me="",_e(m.attributeName,xe),_e(m.attributeValue,Me),de=_.tagEnd}),d(re,p.char,function(Se){xe+=Se}),re)),d(le,_.attributeNameEnd,(Z={},d(Z,p.space,u),d(Z,p.equal,function(){_e(m.attributeName,xe),de=_.attributeValueBegin}),d(Z,p.gt,function(){Me="",_e(m.attributeName,xe),_e(m.attributeValue,Me),me="",de=_.data}),d(Z,p.char,function(Se){Me="",_e(m.attributeName,xe),_e(m.attributeValue,Me),xe=Se,de=_.attributeName}),Z)),d(le,_.attributeValueBegin,(te={},d(te,p.space,u),d(te,p.quote,function(Se){we=Se,Me="",de=_.attributeValue}),d(te,p.gt,function(){Me="",_e(m.attributeValue,Me),me="",de=_.data}),d(te,p.char,function(Se){we="",Me=Se,de=_.attributeValue}),te)),d(le,_.attributeValue,(ie={},d(ie,p.space,function(Se){if(we)Me+=Se;else _e(m.attributeValue,Me),de=_.attributeNameStart}),d(ie,p.quote,function(Se){if(we===Se)_e(m.attributeValue,Me),de=_.attributeNameStart;else Me+=Se}),d(ie,p.gt,function(Se){if(we)Me+=Se;else _e(m.attributeValue,Me),me="",de=_.data}),d(ie,p.slash,function(Se){if(we)Me+=Se;else _e(m.attributeValue,Me),Re=!0,de=_.tagEnd}),d(ie,p.char,function(Se){Me+=Se}),ie)),le);var ye=function(Ne){if(X.debug)console.log(de,Ne);var ke=ue.stateMachine[de],nt=ke[g(Ne)]||ke[p.error]||ke[p.char];nt(Ne)};return ue.write=function(Se){var Ne=Se.length;for(var ke=0;ke<Ne;ke++)ye(Se[ke])},ue},y={State:_,Action:p,Type:m,create:f},x=y.Type,C={element:"element",text:"text"},b=function(X){return Object.assign({name:"",type:C.element,value:"",parent:null,attributes:{},children:[]},X)},I=function(X){X=Object.assign({stream:!1,parentNodes:!0,doneEvent:"done",tagPrefix:"tag:",emitTopLevelOnly:!1,debug:!1},X);var K=void 0,J=void 0,ee=void 0,se=void 0,ne=new h,re=function(te){switch(te.type){case x.openTag:if(ee===null)ee=J,ee.name=te.value;else{var ie=b({name:te.value,parent:ee});ee.children.push(ie),ee=ie}break;case x.closeTag:var le=ee.parent;if(!X.parentNodes)ee.parent=null;if(ee.name!==te.value)break;if(X.stream&&le===J)J.children=[],ee.parent=null;if(!X.emitTopLevelOnly||le===J)ne.emit(X.tagPrefix+ee.name,ee),ne.emit("tag",ee.name,ee);if(ee===J)K.removeAllListeners("data"),ne.emit(X.doneEvent,ee),J=null;ee=le;break;case x.text:if(ee)ee.children.push(b({type:C.text,value:te.value,parent:X.parentNodes?ee:null}));break;case x.attributeName:se=te.value,ee.attributes[se]="";break;case x.attributeValue:ee.attributes[se]=te.value;break}};return ne.reset=function(){K=y.create({debug:X.debug}),K.on("data",re),J=b(),ee=null,se="",ne.parse=K.write},ne.reset(),ne},v=function(X,K){K=Object.assign({},K,{stream:!1,tagPrefix:":"});var J=I(K),ee=void 0;return J.on("done",function(se){ee=se}),J.parse(X),ee},P={parseSync:v,create:I,NodeType:C},M=P.parseSync,B=function(X){var K=M("<root>".concat(X,"</root>"),{parentNodes:!1}),J=K.children&&K.children.length>0&&K.children.every(function(ee){return ee.name==="svg"});if(J)return K.children.length===1?K.children[0]:K.children;else throw Error("nothing to parse")},T=function(X){return l(X,function(K){if(!D(K))return N(K);return K})},N=function(X){return X.replace(/[-|:]([a-z])/gi,function(K,J){return J.toUpperCase()})},D=function(X){return/^(data|aria)(-\w+)/.test(X)},L=function(X){if(X){var K=String(X);return/[&<>]/.test(K)?"<![CDATA[".concat(K.replace(/]]>/,"]]]]><![CDATA[>"),"]]>"):K}return""},H=function(X){return String(X).replace(/&/g,"&amp;").replace(/'/g,"&apos;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},V=function(X){var K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},J=K.transformNode,ee=J===void 0?function(Z){return Z}:J,se=K.camelcase,ne=se===void 0?!1:se,re=function(te){var ie=ee(te);if(ne)ie=T(ie);return ie};return re(B(X))};function O(){for(var Y=arguments.length,X=Array(Y),K=0;K<Y;K++)X[K]=arguments[K];return new Promise(function(J,ee){try{var se=V.apply(void 0,X);J(se)}catch(ne){ee(ne)}})}var U=function Y(X){var K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},J=K.transformAttr,ee=J===void 0?function(de,me,Ae){return"".concat(de,'="').concat(Ae(me),'"')}:J,se=K.transformNode,ne=se===void 0?function(de){return de}:se,re=K.selfClose,Z=re===void 0?!0:re;if(Array.isArray(X))return X.map(function(de){return Y(de,{transformAttr:ee,selfClose:Z,transformNode:ne})}).join("");var te=ne(X);if(te.type==="text")return L(te.value);var ie="";for(var le in te.attributes){var ue=ee(le,te.attributes[le],H,te.name);ie+=ue?" ".concat(ue):""}return te.children&&te.children.length>0||!Z?"<".concat(te.name).concat(ie,">").concat(Y(te.children,{transformAttr:ee,transformNode:ne,selfClose:Z}),"</").concat(te.name,">"):"<".concat(te.name).concat(ie,"/>")},j=Object.assign({},{parse:O,parseSync:V,stringify:U});return j})}}),Gu=class{MAX_ITERATIONS=1e5;solved=!1;failed=!1;iterations=0;progress=0;error=null;activeSubSolver;failedSubSolvers;timeToSolve;stats={};step(){if(this.solved)return;if(this.failed)return;this.iterations++;try{this._step()}catch(e){throw this.error=`${this.constructor.name} error: ${e}`,this.failed=!0,e}if(!this.solved&&this.iterations>this.MAX_ITERATIONS)this.tryFinalAcceptance();if(!this.solved&&this.iterations>this.MAX_ITERATIONS)this.error=`${this.constructor.name} ran out of iterations`,this.failed=!0;if("computeProgress"in this)this.progress=this.computeProgress()}_step(){}getConstructorParams(){throw Error("getConstructorParams not implemented")}solve(){let e=Date.now();while(!this.solved&&!this.failed)this.step();let t=Date.now();this.timeToSolve=t-e}visualize(){return{lines:[],points:[],rects:[],circles:[]}}tryFinalAcceptance(){}preview(){return{lines:[],points:[],rects:[],circles:[]}}};function K3(e,t,n,o){let r=M9e(e,t,n),i=M9e(e,t,o),s=M9e(n,o,e),a=M9e(n,o,t);if(r!==i&&s!==a)return!0;if(r===0&&w9e(e,n,t))return!0;if(i===0&&w9e(e,o,t))return!0;if(s===0&&w9e(n,e,o))return!0;if(a===0&&w9e(n,t,o))return!0;return!1}function M9e(e,t,n){let o=(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y);if(o===0)return 0;return o>0?1:2}function w9e(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function B9e(e,t,n){let o=(n.x-t.x)**2+(n.y-t.y)**2;if(o===0)return Dv(e,t);let r=((e.x-t.x)*(n.x-t.x)+(e.y-t.y)*(n.y-t.y))/o;r=Math.max(0,Math.min(1,r));let i={x:t.x+r*(n.x-t.x),y:t.y+r*(n.y-t.y)};return Dv(e,i)}function Dv(e,t){let n=e.x-t.x,o=e.y-t.y;return Math.sqrt(n*n+o*o)}function XP(e,t,n,o){let r=t.x-e.x,i=t.y-e.y,s=o.x-n.x,a=o.y-n.y,c=e.x-n.x,l=e.y-n.y,h=r*a-i*s;if(Math.abs(h)<0.0000000001)return null;let d=(l*s-c*a)/h,u=(r*l-i*c)/h,_=0.000000001;if(d>=-_&&d<=1+_&&u>=-_&&u<=1+_){let p=e.x+d*r,m=e.y+d*i;return{x:p,y:m}}return null}function Fri(e,t,n){let o=(c)=>c.x>=n.minX&&c.x<=n.maxX&&c.y>=n.minY&&c.y<=n.maxY;if(o(e)||o(t))return!0;let r={x:n.minX,y:n.minY},i={x:n.maxX,y:n.minY},s={x:n.minX,y:n.maxY},a={x:n.maxX,y:n.maxY};return K3(e,t,r,i)||K3(e,t,i,a)||K3(e,t,a,s)||K3(e,t,s,r)}function T9e(e,t,n){return Math.max(t,Math.min(n,e))}function zri(e,t,n){let o={x:n.minX,y:n.minY},r={x:n.maxX,y:n.minY},i={x:n.minX,y:n.maxY},s={x:n.maxX,y:n.maxY};if(K3(e,t,o,r)||K3(e,t,r,s)||K3(e,t,s,i)||K3(e,t,i,o))return 0;if(e.x>=n.minX&&e.x<=n.maxX&&e.y>=n.minY&&e.y<=n.maxY&&t.x>=n.minX&&t.x<=n.maxX&&t.y>=n.minY&&t.y<=n.maxY)return 0;let a=[B9e(o,e,t),B9e(r,e,t),B9e(i,e,t),B9e(s,e,t)];if(e.x>=n.minX&&e.x<=n.maxX&&e.y>=n.minY&&e.y<=n.maxY)return 0;if(t.x>=n.minX&&t.x<=n.maxX&&t.y>=n.minY&&t.y<=n.maxY)return 0;if(e.x<n.minX||e.x>n.maxX||e.y<n.minY||e.y>n.maxY){let c=T9e(e.x,n.minX,n.maxX),l=T9e(e.y,n.minY,n.maxY);a.push(Dv(e,{x:c,y:l}))}if(t.x<n.minX||t.x>n.maxX||t.y<n.minY||t.y>n.maxY){let c=T9e(t.x,n.minX,n.maxX),l=T9e(t.y,n.minY,n.maxY);a.push(Dv(t,{x:c,y:l}))}return Math.min(...a)}function Ori(e,t,n){let o=n.width/2,r=n.height/2,i={minX:n.center.x-o,maxX:n.center.x+o,minY:n.center.y-r,maxY:n.center.y+r};return zri(e,t,i)}var Vri=(e,t)=>{let n=e.maxX<t.minX?t.minX-e.maxX:t.maxX<e.minX?e.minX-t.maxX:0,o=e.maxY<t.minY?t.minY-e.maxY:t.maxY<e.minY?e.minY-t.maxY:0;return Math.sqrt(n*n+o*o)},D7n=(e,t)=>{let n=Math.max(e.minX,t.minX),o=Math.max(e.minY,t.minY),r=Math.min(e.maxX,t.maxX),i=Math.min(e.maxY,t.maxY);if(n>r||o>i)return null;return{minX:n,minY:o,maxX:r,maxY:i}},Yri=(e)=>{let{center:t,width:n,height:o}=e,r=n/2,i=o/2;return{minX:t.x-r,maxX:t.x+r,minY:t.y-i,maxY:t.y+i}},Vc=(e,t=1)=>`hsl(${e.split("").reduce((o,r)=>o*31+r.charCodeAt(0),0)%360}, 100%, 50%, ${t})`,uyn=(e,t,n)=>{if(n.chipId){let o=e.get(n.chipId);if(o)return o}return t.get(n.pinId)},lL=(e,t,n)=>{let o=new Map,r=new Map;for(let a of e.chips){if(!a.sectionId)continue;o.set(a.chipId,a.sectionId);for(let c of a.pins)r.set(c.pinId,a.sectionId)}if(o.size===0)return!1;let i=uyn(o,r,t),s=uyn(o,r,n);return i!==s},yct=(e,t,n)=>{let{x:o,y:r}=e,{center:i,width:s,height:a}=t,c=i.y+a/2,l=i.y-a/2,h=i.x+s/2,d=i.x-s/2,u=c-r,_=r-l,p=h-o,m=o-d,A=Math.min(u,_,p,m),g=A===u?"y+":A===_?"y-":A===p?"x+":"x-",f=[{direction:"y+",distance:u},{direction:"y-",distance:_},{direction:"x+",distance:p},{direction:"x-",distance:m}].filter(({distance:I})=>Math.abs(I-A)<=0.000000001).map(({direction:I})=>I),y=[g,...f.filter((I)=>I!==g)];if(!n||y.length<=1)return y;let x=n.x-e.x,C=n.y-e.y,b=Math.abs(x)>=Math.abs(C)?x>=0?"x+":"x-":C>=0?"y+":"y-";if(!y.includes(b))return y;return[b,...y.filter((I)=>I!==b)]},E6=(e,t,n)=>yct(e,t,n)[0],Bp=(e,t={})=>{let{connectionAlpha:n=0.8,chipAlpha:o=0.8,hideRatsNet:r=e._hideRatsNet??!1}=t,i={lines:[],points:[],rects:[]},s=new Map;for(let a of e.chips)for(let c of a.pins)s.set(c.pinId,c);for(let a of e.chips){i.rects.push({label:a.chipId,center:a.center,width:a.width,height:a.height,fill:Vc(a.chipId,o)});for(let c of a.pins)i.points.push({label:`${c.displayName??c.pinId}
${c._facingDirection??E6(c,a)}`,x:c.x,y:c.y,color:Vc(c.pinId,0.8)})}for(let a of e.textBoxes??[])i.rects.push({label:a.text??"schematic_text",center:a.center,width:a.width,height:a.height,fill:"rgba(160, 0, 220, 0.14)",strokeColor:"rgba(160, 0, 220, 0.9)"});if(!r){for(let a of e.directConnections){let[c,l]=a.pinIds,h=s.get(c),d=s.get(l);if(lL(e,h,d))continue;i.lines.push({points:[{x:h.x,y:h.y},{x:d.x,y:d.y}],strokeColor:Vc(a.netId??`${c}-${l}`,n)})}for(let a of e.netConnections){let c=a.pinIds.map((l)=>s.get(l));for(let l=0;l<c.length-1;l++)for(let h=l+1;h<c.length;h++){let d=c[l],u=c[h];if(lL(e,d,u))continue;i.lines.push({points:[{x:d.x,y:d.y},{x:u.x,y:u.y}],strokeColor:Vc(a.netId,n),strokeDash:"4 2"})}}}return i},Gri=(e)=>{let{pins:t,inputProblem:n,pinIdMap:o,chipMap:r}=e,i=(u)=>{let _=new Set,p=[u];_.add(u);let m=n.directConnections||[];while(p.length){let A=p.shift();for(let g of m)if(g.pinIds.includes(A)){for(let f of g.pinIds)if(!_.has(f))_.add(f),p.push(f)}}return _},s=t[0].pinId,a=t[1].pinId,c=new Set([...i(s),...i(a)]),l=new Map,h=new Map,d=new Set(t.map((u)=>u.chipId));for(let u of c){let _=o.get(u);if(!_)continue;let p=r[_.chipId];if(!p)continue;let m=_._facingDirection??E6(_,p),A=h.get(p.chipId);if(!A){A={center:p.center};let g={xPos:0,xNeg:0,yPos:0,yNeg:0};for(let f of p.pins){let y=f._facingDirection??E6(f,p);if(y==="x+")g.xPos++;if(y==="x-")g.xNeg++;if(y==="y+")g.yPos++;if(y==="y-")g.yNeg++}A.counts=g,h.set(p.chipId,A)}if(m==="x+")A.hasXPos=!0;if(m==="x-")A.hasXNeg=!0;if(m==="y+")A.hasYPos=!0;if(m==="y-")A.hasYNeg=!0}for(let[u,_]of h){let p=new Set,m={axes:p},A=_.counts;if(!(!(A&&(A.xPos>1||A.xNeg>1||A.yPos>1||A.yNeg>1))&&d.has(u))){if(_.hasXPos&&_.hasXNeg)m.x=_.center.x,p.add("x");if(_.hasYPos&&_.hasYNeg)m.y=_.center.y,p.add("y")}if(p.size>0)l.set(u,m)}return l},qde=(e)=>{let{inputProblem:t,chipMap:n,pinIdMap:o,p1:r,p2:i}=e,s=Gri({pins:[r,i],inputProblem:t,pinIdMap:o,chipMap:n});if(s.size===0)return!1;let a=0.000000001,c=(_,p)=>{for(let[,m]of s){if(m.axes.has("x")&&typeof m.x==="number"){if((_.x-m.x)*(p.x-m.x)<-a)return!0}if(m.axes.has("y")&&typeof m.y==="number"){if((_.y-m.y)*(p.y-m.y)<-a)return!0}}return!1};if(Math.abs(r.x-i.x)<a||Math.abs(r.y-i.y)<a)return c({x:r.x,y:r.y},{x:i.x,y:i.y});let l={x:i.x,y:r.y},h={x:r.x,y:i.y},d=c({x:r.x,y:r.y},l)||c(l,{x:i.x,y:i.y}),u=c({x:r.x,y:r.y},h)||c(h,{x:i.x,y:i.y});return d&&u},p8e=class{netMap;idToNetMap;constructor(e){this.netMap=e,this.idToNetMap={};for(let[t,n]of Object.entries(e))for(let o of n)this.idToNetMap[o]=t}addConnections(e){for(let t of e){let n=new Set;for(let r of t){let i=this.idToNetMap[r];if(i)n.add(i)}let o;if(n.size===0)o=`connectivity_net${Object.keys(this.netMap).length}`,this.netMap[o]=[];else if(n.size===1)o=n.values().next().value??`connectivity_net${Object.keys(this.netMap).length}`;else{o=n.values().next().value??`connectivity_net${Object.keys(this.netMap).length}`;for(let r of n)if(r!==o){let i=this.netMap[o],s=this.netMap[r];if(i&&s){i.push(...s),this.netMap[r]=i;for(let a of i)this.idToNetMap[a]=o}}}for(let r of t){let i=this.netMap[o];if(i&&!i.includes(r))i.push(r);this.idToNetMap[r]=o}}}getIdsConnectedToNet(e){return this.netMap[e]||[]}getNetConnectedToId(e){return this.idToNetMap[e]}areIdsConnected(e,t){if(e===t)return!0;let n=this.getNetConnectedToId(e);if(!n)return!1;let o=this.getNetConnectedToId(t);if(!o)return!1;return n===o||o===e||o===e}areAllIdsConnected(e){if(e.length===0)return!0;let t=this.getNetConnectedToId(e[0]);if(!t)return!1;for(let n of e){let o=this.getNetConnectedToId(n);if(o===void 0)return!1;if(o!==t)return!1}return!0}},S6=(e)=>{let t=new p8e({});for(let o of e.directConnections)t.addConnections([o.netId?[o.netId,...o.pinIds]:o.pinIds]);let n=new p8e(t.netMap);for(let o of e.netConnections)n.addConnections([[o.netId,...o.pinIds]]);return{directConnMap:t,netConnMap:n}},Uri=1,N7n=(e)=>{let{netConnMap:t}=S6(e),n=t.getNetConnectedToId("GND"),o=new p8e({}),r=new Set;for(let h of e.directConnections){o.addConnections([h.pinIds]);let d=t.getNetConnectedToId(h.pinIds[0]),u=e.netConnections.some((_)=>_.isGround&&t.getNetConnectedToId(_.netId)===d);if(d&&u)r.add(d)}let i=new Map(e.chips.flatMap((h)=>h.pins.map((d)=>[d.pinId,{pin:d,chip:h}]))),s=[...i.values()].filter(({pin:h,chip:d})=>d.pins.length===2&&t.getNetConnectedToId(h.pinId)===n&&(h._facingDirection??E6(h,d))==="y-"),a=s.some(({pin:h})=>{let d=o.getNetConnectedToId(h.pinId);return d!==void 0&&s.some(({pin:u})=>h.pinId!==u.pinId&&Math.abs(h.y-u.y)<0.000001&&Math.abs(h.x-u.x)>0.000001&&o.getNetConnectedToId(u.pinId)===d)}),c=(h,d)=>{let u=i.get(h)?.chip.chipId,_=i.get(d)?.chip.chipId;if(u!==void 0&&u===_&&!o.getNetConnectedToId(h)&&!o.getNetConnectedToId(d))return!1;let m=t.getNetConnectedToId(h),A=t.getNetConnectedToId(d);if(!m||m!==A||!r.has(m))return!1;let g=o.getNetConnectedToId(h)??`pin:${h}`,f=o.getNetConnectedToId(d)??`pin:${d}`;return g!==f};if(!a)return(h,d)=>!c(h,d);let l=(h)=>{let d=i.get(h);return d?.chip.pins.length===2&&!o.getNetConnectedToId(h)&&(d.pin._facingDirection??E6(d.pin,d.chip))==="y-"};return(h,d)=>{let u=t.getNetConnectedToId(h),_=t.getNetConnectedToId(d);if(c(h,d))return!1;if(!n||u!==n||_!==n)return!0;if(!l(h)&&!l(d))return!0;let p=i.get(h)?.pin,m=i.get(d)?.pin;return!p||!m||Math.abs(p.y-m.y)<=Uri+0.000001}};function Wri(e,t={}){let n=e.length,o=t?.maxDistance??Number.POSITIVE_INFINITY;if(n<=1)return[];{let h=new Set;for(let d of e){if(h.has(d.pinId))throw Error(`Duplicate pinId detected: "${d.pinId}"`);h.add(d.pinId)}}let r=(h,d)=>Math.abs(h.x-d.x)+Math.abs(h.y-d.y),i=Array(n).fill(!1),s=Array(n).fill(Number.POSITIVE_INFINITY),a=Array(n).fill(-1),c=0;for(let h=1;h<n;h++)if(e[h].pinId<e[c].pinId)c=h;s[c]=0;let l=[];for(let h=0;h<n;h++){let d=-1,u=Number.POSITIVE_INFINITY,_="";for(let p=0;p<n;p++)if(!i[p]){let m=s[p];if(m<u||m===u&&(_===""||e[p].pinId<_))u=m,_=e[p].pinId,d=p}if(i[d]=!0,a[d]!==-1)l.push([e[d].pinId,e[a[d]].pinId]);for(let p=0;p<n;p++)if(!i[p]){let m=r(e[d],e[p]),A=t?.forbidEdge?.(e[d],e[p])??!1,g=m>o||A?Number.POSITIVE_INFINITY:m;if(g<s[p]||g===s[p]&&e[d].pinId<e[a[p]]?.pinId)s[p]=g,a[p]=d}}return l}var Xri=0.45,xct=0.2;function bv(e){let{orientation:t,netLabelWidth:n,netLabelHeight:o}=e,r=typeof n==="number"?n:Xri,i=typeof o==="number"?o:xct;if(t==="y+"||t==="y-")return{width:i,height:r};return{width:r,height:i}}function x2(e,t,n,o){switch(t){case"x+":return{x:e.x+n/2,y:e.y};case"x-":return{x:e.x-n/2,y:e.y};case"y+":return{x:e.x,y:e.y+o/2};case"y-":return{x:e.x,y:e.y-o/2}}}function Ui(e,t,n){return{minX:e.x-t/2,minY:e.y-n/2,maxX:e.x+t/2,maxY:e.y+n/2}}var R7n=({inputProblem:e,chipMap:t,pins:n})=>{let[o,r]=n,i=e.directConnections.find((f)=>f.pinIds.includes(o.pinId)&&f.pinIds.includes(r.pinId));if(i?.netLabelWidth===void 0)return null;let s=t[o.chipId],a=t[r.chipId];if(!s||!a)return null;let c=o._facingDirection;if(!c)c=E6(o,s);let l=r._facingDirection;if(!l)l=E6(r,a);if(!(c==="x-"&&l==="x+"||c==="x+"&&l==="x-"))return null;if(s.pins.length===1||a.pins.length===1)return"single-pin-peripheral";if(!(s.sectionId&&s.sectionId===a.sectionId?s.sectionId:null))return null;let p=o.x<=r.x?c==="x+"&&l==="x-":c==="x-"&&l==="x+",m=Math.abs(o.x-r.x)<i.netLabelWidth*2,A=Math.abs(o.y-r.y)<xct;return p&&m&&A?"overlapping-fallback-labels":null},jri=(e)=>R7n(e)!==null,Q7n=0.000001,Kri=3;function pyn({pin:e,netPins:t}){let n=t.filter((r)=>Math.abs(r.y-e.y)<=Q7n);return new Set(n.map((r)=>r.chipId)).size>=Kri}function $ri({netConnection:e,netPins:t,pin1:n,pin2:o}){if(!e?.isGround||n.chipId===o.chipId)return!1;if(Math.abs(n.y-o.y)<=Q7n)return!1;return pyn({pin:n,netPins:t})&&pyn({pin:o,netPins:t})}var VB=0.000001,qri=4,myn=2,mve=(e,t)=>JSON.stringify([e,t].sort()),k7n=(e,t,n)=>{let o=new Set,r=new Set,i=new Set;for(let h of e.netConnections){for(let u of h.pinIds)r.add(u);let d=t.getNetConnectedToId(h.netId);if(d&&h.isGround)o.add(d)}for(let h of e.directConnections){let d=h.netLabelWidth===void 0?i:r;for(let u of h.pinIds)d.add(u)}let s=[];for(let h of e.chips){if(h.pins.length!==2||h.symbolName&&!h.symbolName.startsWith("capacitor")||!h.pins.every((m)=>r.has(m.pinId))||h.pins.some((m)=>i.has(m.pinId)))continue;let d=h.pins.map((m)=>t.getNetConnectedToId(m.pinId));if(!d[0]||!d[1]||d[0]===d[1]||o.has(d[0])===o.has(d[1]))continue;let u=h.pins.map((m)=>m._facingDirection??E6(m,h));if(u[0][0]!==u[1][0]||u[0]===u[1])continue;let _=u[0][0],p=_==="x"?"y":"x";if(Math.abs(h.pins[0][p]-h.pins[1][p])>VB)continue;for(let[m,A]of h.pins.entries()){let g=u[m],f=s.find((y)=>y.sectionId===h.sectionId&&y.direction===g&&Math.abs(y.coordinate-A[_])<=VB);if(!f)f={sectionId:h.sectionId,direction:g,coordinate:A[_],axis:_,pins:[]},s.push(f);f.pins.push({...A,chipId:h.chipId,oppositeCoordinate:h.pins[1-m][_]})}}let a=new Set,c=new Set,l=new Set;for(let h of s){let d=h.axis==="x"?"y":"x";h.pins.sort((u,_)=>u[d]-_[d]||u.pinId.localeCompare(_.pinId));for(let u=1;u<h.pins.length;u++){let _=h.pins[u-1],p=h.pins[u],m=p[d]-_[d],A=[_[d]-(h.pins[u-2]?.[d]??_[d]),(h.pins[u+1]?.[d]??p[d])-p[d]].filter((x)=>x>VB),g=Math.max(myn*n,myn*(A.length?Math.min(...A):0),qri*Math.max(Math.abs(_[h.axis]-_.oppositeCoordinate),Math.abs(p[h.axis]-p.oppositeCoordinate)));if(m<=VB||t.getNetConnectedToId(_.pinId)!==t.getNetConnectedToId(p.pinId))continue;if(m>g+VB){l.add(_.pinId),l.add(p.pinId);continue}let f=Math.min(_[h.axis],p[h.axis],_.oppositeCoordinate,p.oppositeCoordinate),y=Math.max(_[h.axis],p[h.axis],_.oppositeCoordinate,p.oppositeCoordinate);if(e.chips.some((x)=>{if(x.chipId===_.chipId||x.chipId===p.chipId)return!1;let C=h.axis==="x"?x.width:x.height,b=d==="x"?x.width:x.height;return x.center[h.axis]+C/2>=f-VB&&x.center[h.axis]-C/2<=y+VB&&x.center[d]+b/2>_[d]+VB&&x.center[d]-b/2<p[d]-VB}))continue;if(a.add(mve(_.pinId,p.pinId)),m>n)c.add(_.pinId),c.add(p.pinId)}}return{pairKeys:a,extendedRailPinIds:c,separatedRailPinIds:l}};var _0e=1,_yn=(e)=>[...e].sort().join("::"),Jri=class extends Gu{inputProblem;mspConnectionPairs=[];mspConnectionPairIds=new Set;dcConnMap;globalConnMap;queuedDcNetIds;chipMap;maxMspPairDistance;pinMap;userNetIdByPinId;directConnectionPinPairKeys;canRouteGroundPair;parallelRailPairKeys;constructor({inputProblem:e}){super();this.inputProblem=e,this.canRouteGroundPair=N7n(e),this.maxMspPairDistance=e.maxMspPairDistance??_0e;let{directConnMap:t,netConnMap:n}=S6(e);this.dcConnMap=t,this.globalConnMap=n,this.parallelRailPairKeys=k7n(e,n,this.maxMspPairDistance).pairKeys,this.pinMap={};for(let o of e.chips)for(let r of o.pins)this.pinMap[r.pinId]={...r,chipId:o.chipId};this.chipMap={};for(let o of e.chips)this.chipMap[o.chipId]=o;this.userNetIdByPinId={},this.directConnectionPinPairKeys=new Set;for(let o of e.directConnections)if(this.directConnectionPinPairKeys.add(_yn(o.pinIds)),o.netId){let[r,i]=o.pinIds;this.userNetIdByPinId[r]=o.netId,this.userNetIdByPinId[i]=o.netId}for(let o of e.netConnections)for(let r of o.pinIds)this.userNetIdByPinId[r]=o.netId;this.queuedDcNetIds=Object.keys(n.netMap)}getConstructorParams(){return{inputProblem:this.inputProblem}}addMspConnectionPair(e){if(this.mspConnectionPairIds.has(e.mspPairId))return;this.mspConnectionPairIds.add(e.mspPairId),this.mspConnectionPairs.push(e)}_step(){if(this.queuedDcNetIds.length===0){this.solved=!0;return}let e=this.queuedDcNetIds.shift(),n=this.globalConnMap.getIdsConnectedToNet(e).filter((c)=>!!this.pinMap[c]);if(n.length<=1)return;if(n.length===2){let[c,l]=n,h=this.pinMap[c],d=this.pinMap[l];if(!this.canRouteGroundPair(c,l))return;let u=_yn([c,l]),_=Math.abs(h.x-d.x)+Math.abs(h.y-d.y);if(this.directConnectionPinPairKeys.has(u))_=Dv(h,d);let p=R7n({inputProblem:this.inputProblem,chipMap:this.chipMap,pins:[h,d]});if(_>this.maxMspPairDistance&&!this.parallelRailPairKeys.has(mve(c,l))&&!p)return;if(lL(this.inputProblem,h,d))return;let m=new Map(Object.entries(this.pinMap));if(qde({inputProblem:this.inputProblem,chipMap:this.chipMap,pinIdMap:m,p1:h,p2:d}))return;let A=this.globalConnMap.getNetConnectedToId(c),g=this.userNetIdByPinId[c]??this.userNetIdByPinId[l],f=_>this.maxMspPairDistance&&p==="overlapping-fallback-labels";this.addMspConnectionPair({mspPairId:`${c}-${l}`,dcConnNetId:e,globalConnNetId:A,userNetId:g,suppressNetLabel:f,pins:[h,d]});return}let o=new Map(Object.entries(this.pinMap)),r=this.userNetIdByPinId[n[0]],i=this.inputProblem.netConnections.find((c)=>c.netId===r),s=n.map((c)=>this.pinMap[c]),a=Wri(s,{forbidEdge:(c,l)=>Math.abs(c.x-l.x)+Math.abs(c.y-l.y)>this.maxMspPairDistance&&!this.parallelRailPairKeys.has(mve(c.pinId,l.pinId))||!this.canRouteGroundPair(c.pinId,l.pinId)||$ri({netConnection:i,netPins:s,pin1:c,pin2:l})||lL(this.inputProblem,c,l)||qde({inputProblem:this.inputProblem,chipMap:this.chipMap,pinIdMap:o,p1:c,p2:l})});for(let[c,l]of a){if(this.parallelRailPairKeys.has(mve(c,l))&&Math.abs(this.pinMap[c].x-this.pinMap[l].x)+Math.abs(this.pinMap[c].y-this.pinMap[l].y)>this.maxMspPairDistance&&n.indexOf(c)>n.indexOf(l))[c,l]=[l,c];let h=this.pinMap[c],d=this.pinMap[l];if(lL(this.inputProblem,h,d))continue;if(qde({inputProblem:this.inputProblem,chipMap:this.chipMap,pinIdMap:o,p1:h,p2:d}))continue;let u=this.globalConnMap.getNetConnectedToId(c),_=this.userNetIdByPinId[c]??this.userNetIdByPinId[l];this.addMspConnectionPair({mspPairId:`${c}-${l}`,dcConnNetId:e,globalConnNetId:u,userNetId:_,pins:[h,d]})}}visualize(){let e=Bp(this.inputProblem,{chipAlpha:0.1,connectionAlpha:0.1});for(let t of this.mspConnectionPairs)e.lines.push({points:[{x:t.pins[0].x,y:t.pins[0].y},{x:t.pins[1].x,y:t.pins[1].y}],strokeColor:Vc(t.mspPairId,0.75)});return e}},{cos:pia,sin:mia,PI:_ia}=Math,{tan:gia}=Math,Aia=Lri(Hri(),1);var fia=(()=>{let e=new Uint8Array(4),t=new Uint32Array(e.buffer);return!((t[0]=1)&e[0])})(),yia={int8:globalThis.Int8Array,uint8:globalThis.Uint8Array,int16:globalThis.Int16Array,uint16:globalThis.Uint16Array,int32:globalThis.Int32Array,uint32:globalThis.Uint32Array,uint64:globalThis.BigUint64Array,int64:globalThis.BigInt64Array,float32:globalThis.Float32Array,float64:globalThis.Float64Array},Zri=[];for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)if(t&1)t=3988292384^t>>>1;else t=t>>>1;Zri[e]=t}var eii=new Uint16Array([255]),tii=new Uint8Array(eii.buffer),xia=tii[0]===255,nii=new Uint16Array([255]),oii=new Uint8Array(nii.buffer),Cia=oii[0]===255,bia=new Uint8Array(0),Iia=Uint8Array.of(137,80,78,71,13,10,26,10),via=new TextDecoder("latin1"),gyn={"0":"M0.301025 0.257813 L0.206593 0.283385 L0.122042 0.361307 L0.075923 0.474441 L0.064942 0.642221 L0.091296 0.78289 L0.159376 0.899463 L0.257104 0.961214 L0.344948 0.961214 L0.442678 0.899463 L0.510757 0.78289 L0.537111 0.642221 L0.526131 0.474441 L0.480012 0.361307 L0.39546 0.283385 L0.301025 0.257813","1":"M0.220426 0.40845 L0.381626 0.270996 L0.381626 0.948966","2":"M0.110409 0.39212 L0.125621 0.342293 L0.170571 0.295823 L0.244237 0.26431 L0.291518 0.257813 L0.373319 0.263799 L0.434683 0.290705 L0.468239 0.331966 L0.480292 0.379913 L0.479492 0.411806 L0.465088 0.465192 L0.402571 0.568988 L0.245134 0.766438 L0.07959 0.948045 L0.522462 0.948045","3":"M0.081606 0.345073 L0.119154 0.315633 L0.178996 0.284091 L0.255265 0.257813 L0.349133 0.263062 L0.43127 0.289348 L0.48994 0.336662 L0.525141 0.394491 L0.513407 0.457577 L0.466472 0.504892 L0.384334 0.541692 L0.290464 0.56272 L0.20833 0.573235 L0.290464 0.583749 L0.384334 0.610035 L0.466472 0.652092 L0.519274 0.709922 L0.531007 0.773007 L0.50754 0.841351 L0.454738 0.899179 L0.3726 0.946494 L0.310412 0.961214 L0.209503 0.959111 L0.127367 0.946494 L0.071046 0.929671","4":"M0.418494 0.270996 L0.048828 0.724199 L0.553224 0.724199 M0.414181 0.578167 L0.414181 0.94897","5":"M0.074951 0.270996 L0.074951 0.614701 L0.267655 0.5695 L0.405247 0.586502 L0.460002 0.617189 L0.498028 0.660731 L0.527101 0.779401 L0.513352 0.841049 L0.477274 0.889568 L0.406378 0.93463 L0.324445 0.958337 L0.247399 0.962139 L0.182516 0.949767 L0.130068 0.925508 L0.074951 0.875607 M0.074951 0.270996 L0.527101 0.270996","6":"M0.428549 0.257813 L0.341433 0.285053 L0.26073 0.312099 L0.192188 0.360182 L0.138902 0.410969 L0.098219 0.500422 L0.070249 0.584267 L0.067264 0.670716 L0.065164 0.756863 L0.087163 0.820973 L0.108168 0.861042 L0.157916 0.913131 L0.210981 0.948192 L0.29279 0.961214 L0.384548 0.956206 L0.456409 0.924151 L0.507262 0.881077 L0.5349 0.821975 L0.537111 0.771889 L0.521634 0.718798 L0.498418 0.67372 L0.463042 0.636657 L0.414398 0.613617 L0.34696 0.598591 L0.28284 0.595587 L0.215403 0.605604 L0.145756 0.641665 L0.109274 0.678729 L0.064942 0.724006","7":"M0.071534 0.270996 L0.530519 0.270996 L0.495935 0.291702 L0.477752 0.305407 L0.435186 0.346112 L0.412067 0.374136 L0.388565 0.40796 L0.365315 0.448098 L0.342943 0.495062 L0.322081 0.549366 L0.303364 0.611524 L0.287416 0.68205 L0.270077 0.80465 L0.26253 0.94897","8":"M0.286761 0.257813 L0.210684 0.27162 L0.1414 0.305622 L0.092494 0.382125 L0.111513 0.450128 L0.16857 0.502193 L0.228345 0.539382 L0.377781 0.594635 L0.470161 0.645637 L0.52586 0.706203 L0.538087 0.792269 L0.506841 0.87621 L0.438915 0.927212 L0.339743 0.961214 L0.263666 0.959089 L0.174004 0.929337 L0.102003 0.881523 L0.063965 0.811395 L0.066682 0.741266 L0.102003 0.671139 L0.180797 0.608448 L0.259591 0.580822 L0.358762 0.548945 L0.456576 0.49688 L0.486463 0.446941 L0.487822 0.362999 L0.453859 0.302434 L0.384574 0.265245 L0.286761 0.257813","9":"M0.511026 0.437812 L0.491026 0.347812 L0.451026 0.297812 L0.391026 0.267812 L0.311026 0.257813 L0.231026 0.267812 L0.161026 0.297812 L0.111026 0.347812 L0.091026 0.417812 L0.111026 0.487812 L0.161026 0.537812 L0.231026 0.567812 L0.311026 0.577812 L0.391026 0.557812 L0.451026 0.517812 L0.491026 0.477812 L0.511026 0.437812 M0.510026 0.438812 L0.434026 0.636812 L0.381026 0.777812 L0.337026 0.879812 L0.301026 0.957812","!":"M0.301026 0.270996 L0.301026 0.749566 M0.251466 0.94897 L0.350587 0.94897",'"':"M0.16504 0.270996 L0.16504 0.523022 M0.437013 0.270996 L0.437013 0.523022","#":"M0.20958 0.282227 L0.146515 0.949754 M0.461844 0.282227 L0.398779 0.949754 M0.032999 0.526969 L0.600587 0.452796 M0.001465 0.82366 L0.569055 0.749486",$:"M0.307121 0.240234 L0.307121 1.083502 M0.490031 0.415915 L0.404676 0.328075 L0.23396 0.310507 L0.136407 0.398347 L0.099828 0.521324 L0.124213 0.591596 L0.197379 0.644299 L0.429061 0.697003 L0.502224 0.749708 L0.526613 0.837547 L0.477836 0.960526 L0.355897 1.013228 L0.197379 0.99566 L0.112021 0.942957 L0.07544 0.837547","'":"M0.301026 0.270996 L0.301026 0.523022","(":"M0.413087 0.241211 L0.372337 0.28347 L0.331589 0.334184 L0.290838 0.393349 L0.25009 0.460965 L0.219528 0.528584 L0.199153 0.5962 L0.188966 0.655364 L0.199153 0.714529 L0.219528 0.782146 L0.25009 0.849764 L0.290838 0.91738 L0.331589 0.976544 L0.372337 1.027258 L0.413087 1.069491",")":"M0.188966 0.241211 L0.229716 0.28347 L0.270466 0.334184 L0.311213 0.393349 L0.351964 0.460965 L0.382526 0.528584 L0.4029 0.5962 L0.413087 0.655364 L0.4029 0.714529 L0.382526 0.782146 L0.351964 0.849764 L0.311213 0.91738 L0.270466 0.976544 L0.229716 1.027258 L0.188966 1.069491","*":"M0.301026 0.458702 L0.301026 0.681942 M0.301026 0.458702 L0.520997 0.536834 M0.301026 0.458702 L0.439954 0.257813 M0.301026 0.458702 L0.162098 0.257813 M0.301026 0.458702 L0.081055 0.536834","+":"M0.042969 0.66845 L0.559083 0.66845 M0.301023 0.428223 L0.301023 0.908661",",":"M0.38672 0.852051 L0.215333 1.030661 L0.301025 1.119971","-":"M0.173829 0.686035 L0.428224 0.686035",".":"M0.362549 0.851074 L0.239503 0.851074","/":"M0.062501 1.035249 L0.539551 0.270996","<":"M0.559083 0.441895 L0.042969 0.66939 L0.042969 0.66939 L0.559083 0.896902","=":"M0.042969 0.545898 L0.559083 0.545898 M0.042969 0.80837 L0.559083 0.80837",">":"M0.042969 0.441895 L0.559083 0.66939 L0.559083 0.66939 L0.042969 0.896902",A:"M0.018067 0.94897 L0.290179 0.270996 L0.583986 0.94897 M0.155303 0.684521 L0.433548 0.684521",B:"M0.063965 0.94897 L0.063965 0.278953 L0.209356 0.270996 L0.342486 0.294394 L0.432179 0.37292 L0.418224 0.48773 L0.312686 0.549166 L0.084728 0.575531 L0.306377 0.589434 L0.468877 0.647456 L0.538087 0.736658 L0.5324 0.85202 L0.501247 0.902983 L0.42355 0.944398 L0.063965 0.94897",C:"M0.529054 0.419847 L0.498425 0.345196 L0.442238 0.292341 L0.33583 0.257813 L0.257199 0.268357 L0.187906 0.303748 L0.120243 0.385432 L0.072998 0.599844 L0.110073 0.815385 L0.165381 0.902183 L0.222883 0.942801 L0.334904 0.961214 L0.43253 0.937679 L0.504816 0.868999 L0.529054 0.772065",D:"M0.064454 0.94897 L0.071838 0.285078 L0.171217 0.270996 L0.247348 0.272633 L0.37101 0.306078 L0.462461 0.378304 L0.514748 0.475555 L0.535591 0.576392 L0.537599 0.652313 L0.528065 0.717381 L0.508562 0.772419 L0.445948 0.855695 L0.362356 0.90871 L0.225203 0.945862 L0.064454 0.94897",E:"M0.080078 0.270996 L0.080078 0.94897 M0.080078 0.270996 L0.521974 0.270996 M0.080078 0.609981 L0.389405 0.609981 M0.080078 0.94897 L0.521974 0.94897",F:"M0.086426 0.270996 L0.086426 0.94897 M0.091304 0.275607 L0.515626 0.275607 M0.091304 0.607677 L0.447344 0.607677",G:"M0.498034 0.284943 L0.374621 0.257813 L0.244219 0.268648 L0.160577 0.311997 L0.094556 0.398116 L0.056397 0.58404 L0.076752 0.785532 L0.120865 0.858197 L0.188947 0.916734 L0.271008 0.953591 L0.357069 0.961214 L0.43715 0.932047 L0.501262 0.858539 L0.545656 0.648611 L0.329595 0.648131",H:"M0.066895 0.270996 L0.066895 0.94897 M0.066895 0.595658 L0.530009 0.595658 M0.535157 0.270996 L0.535157 0.94897",I:"M0.301026 0.270996 L0.301026 0.94897",J:"M0.506839 0.270996 L0.507814 0.782193 L0.498468 0.846168 L0.480733 0.880789 L0.455864 0.90832 L0.426095 0.929408 L0.360746 0.954812 L0.302508 0.962139 L0.223573 0.953638 L0.16538 0.930312 L0.137072 0.907715 L0.116428 0.880312 L0.102822 0.848819 L0.095633 0.813947 L0.094239 0.776413",K:"M0.035401 0.270996 L0.035401 0.94897 M0.502258 0.316194 L0.035401 0.687823 M0.212484 0.582361 L0.566652 0.933903",L:"M0.07544 0.270996 L0.07544 0.94897 L0.526613 0.94897",M:"M0.042481 0.94897 L0.042481 0.270996 L0.301027 0.712492 L0.559571 0.270996 L0.559571 0.94897",N:"M0.067871 0.94897 L0.067871 0.270996 L0.534181 0.94897 L0.525031 0.270996",O:"M0.287293 0.961214 L0.19843 0.933567 L0.1172 0.849451 L0.057129 0.563945 L0.114348 0.350255 L0.18455 0.289392 L0.306101 0.257813 L0.42054 0.29572 L0.487543 0.365003 L0.544923 0.625294 L0.516366 0.789624 L0.465476 0.884596 L0.375084 0.949287 L0.287293 0.961214",P:"M0.070557 0.94897 L0.070557 0.28379 L0.20704 0.270996 L0.329134 0.278993 L0.408525 0.300514 L0.444022 0.317908 L0.500637 0.368929 L0.525796 0.423728 L0.531496 0.50384 L0.508934 0.554205 L0.473724 0.582043 L0.417577 0.604365 L0.336375 0.620372 L0.226014 0.629268 L0.082368 0.630258",Q:"M0.282435 1.050813 L0.195447 1.019646 L0.115933 0.924817 L0.057129 0.602943 L0.113139 0.362034 L0.18186 0.293418 L0.300844 0.257813 L0.412868 0.300553 L0.478457 0.37866 L0.534625 0.672103 L0.506671 0.857367 L0.456855 0.964437 L0.368371 1.037368 L0.282435 1.050813 M0.341225 0.815559 L0.544923 1.070653",R:"M0.034912 0.944112 L0.034912 0.288556 L0.227127 0.270996 L0.362038 0.276867 L0.443423 0.294907 L0.477644 0.309614 L0.505809 0.328757 L0.526616 0.352817 L0.544963 0.418061 L0.543241 0.475921 L0.524463 0.517817 L0.49076 0.546518 L0.444265 0.564799 L0.355195 0.578739 L0.047653 0.589627 M0.303054 0.617306 L0.56714 0.94897",S:"M0.483037 0.364333 L0.407613 0.267477 L0.22883 0.257813 L0.128623 0.327565 L0.087712 0.455539 L0.104656 0.518727 L0.168054 0.573307 L0.41928 0.617318 L0.503796 0.669342 L0.535157 0.759324 L0.493846 0.900055 L0.367668 0.961214 L0.205436 0.956661 L0.116711 0.907038 L0.066895 0.790334",T:"M0.022949 0.270996 L0.579103 0.270996 M0.309284 0.270996 L0.309284 0.94897",U:"M0.072022 0.270996 L0.07308 0.648875 L0.080372 0.75167 L0.099024 0.827813 L0.134786 0.885729 L0.181571 0.924023 L0.251464 0.95168 L0.339655 0.962139 L0.401553 0.951668 L0.45232 0.924086 L0.482701 0.891771 L0.495745 0.870529 L0.515699 0.81637 L0.525014 0.744626 L0.530031 0.272017",V:"M0.027832 0.270996 L0.320083 0.94897 L0.57422 0.270996",W:"M0 0.270996 L0.079799 0.940377 L0.285198 0.472884 L0.505255 0.94897 L0.602052 0.270996",X:"M0.009034 0.270996 L0.586805 0.94897 M0.593019 0.270996 L0.015246 0.94897",Y:"M0.018067 0.270996 L0.293132 0.574135 M0.583986 0.271959 L0.294954 0.57606 L0.305277 0.94897",Z:"M0.053711 0.270996 L0.548341 0.270996 L0.053711 0.94897 L0.548341 0.94897","[":"M0.404542 0.240234 L0.197511 0.240234 L0.197511 1.069424 L0.404542 1.069424","\\":"M0.062501 0.270996 L0.539551 1.035249","]":"M0.19751 0.240234 L0.404542 0.240234 L0.404542 1.069424 L0.19751 1.069424","^":"M0.035156 0.523931 L0.301024 0.270996 L0.566896 0.523931",_:"M0 1.160601 L0.602052 1.160601",a:"M0.527101 0.439941 L0.527101 0.973965 M0.527101 0.553824 L0.451366 0.477535 L0.376759 0.439941 L0.263722 0.439941 L0.187989 0.477535 L0.112255 0.553824 L0.074951 0.66881 L0.074951 0.745099 L0.112255 0.85898 L0.187989 0.93527 L0.263722 0.973965 L0.376759 0.973965 L0.451366 0.93527 L0.527101 0.85898",b:"M0.07666 0.240234 L0.07666 0.959985 M0.07666 0.582737 L0.151822 0.514237 L0.225865 0.480483 L0.338045 0.480483 L0.413211 0.514237 L0.488374 0.582737 L0.525392 0.685983 L0.525392 0.754485 L0.488374 0.856739 L0.413211 0.92524 L0.338045 0.959985 L0.225865 0.959985 L0.151822 0.92524 L0.07666 0.856739",c:"M0.512452 0.553823 L0.441624 0.477535 L0.371854 0.439941 L0.26614 0.439941 L0.195312 0.477535 L0.124486 0.553823 L0.0896 0.668808 L0.0896 0.745099 L0.124486 0.858979 L0.195312 0.93527 L0.26614 0.973965 L0.371854 0.973965 L0.441624 0.93527 L0.512452 0.858979",d:"M0.525392 0.240234 L0.525392 0.959985 M0.525392 0.582737 L0.450232 0.514237 L0.376189 0.480483 L0.264006 0.480483 L0.188844 0.514237 L0.11368 0.582737 L0.076661 0.685983 L0.076661 0.754485 L0.11368 0.856739 L0.188844 0.92524 L0.264006 0.959985 L0.376189 0.959985 L0.450232 0.92524 L0.525392 0.856739",e:"M0.059571 0.668808 L0.542482 0.668808 M0.542482 0.592521 L0.502641 0.516231 L0.461594 0.477535 L0.381914 0.439941 L0.261186 0.439941 L0.180299 0.477535 L0.099412 0.553823 L0.059571 0.668808 L0.059571 0.745099 L0.099412 0.858979 L0.180299 0.93527 L0.261186 0.973965 L0.381914 0.973965 L0.461594 0.93527 L0.542482 0.858979",f:"M0.512941 0.240234 L0.406984 0.240234 L0.301026 0.274346 L0.248047 0.374731 L0.248047 0.946817 M0.089112 0.476088 L0.459965 0.476088",g:"M0.525392 0.439941 L0.525392 0.989395 L0.488373 1.091918 L0.45023 1.126757 L0.376189 1.160601 L0.264004 1.160601 L0.188844 1.126757 L0.113681 1.058075 L0.076661 0.954555 M0.525392 0.542467 L0.45023 0.473786 L0.376189 0.439941 L0.264004 0.439941 L0.188844 0.473786 L0.113681 0.542467 L0.076661 0.645988 L0.076661 0.714669 L0.113681 0.817193 L0.188844 0.885875 L0.264004 0.920713 L0.376189 0.920713 L0.45023 0.885875 L0.525392 0.817193",h:"M0.092041 0.240234 L0.092041 0.946817 M0.092041 0.61058 L0.205937 0.509225 L0.282214 0.476086 L0.396109 0.476086 L0.47187 0.509225 L0.510011 0.61058 L0.510011 0.946817",i:"M0.261026 0.240234 L0.341026 0.240234 M0.300978 0.476089 L0.300978 0.946817",j:"M0.3853 0.240234 L0.447023 0.240234 M0.416159 0.465708 L0.416159 1.011689 L0.383887 1.108586 L0.252832 1.140264 L0.15503 1.108586",k:"M0.065186 0.240234 L0.065186 0.946817 M0.493824 0.476086 L0.065186 0.812323 M0.236758 0.677829 L0.536867 0.946817",l:"M0.301026 0.234863 L0.301026 0.946441",m:"M0.050538 0.439941 L0.050538 0.960796 M0.050538 0.588758 L0.114405 0.476607 L0.157178 0.439941 L0.236864 0.439941 L0.279637 0.476607 L0.32241 0.588758 L0.32241 0.960796 M0.32241 0.588758 L0.386281 0.476607 L0.428467 0.439941 L0.50874 0.439941 L0.551515 0.476607 L0.551515 0.960796",n:"M0.092041 0.439941 L0.092041 0.960796 M0.092041 0.588758 L0.205936 0.476607 L0.282216 0.439941 L0.396113 0.439941 L0.471871 0.476607 L0.510011 0.588758 L0.510011 0.960796",o:"M0.247175 0.439941 L0.175178 0.477535 L0.103186 0.553823 L0.066895 0.668808 L0.066895 0.745099 L0.103186 0.858979 L0.175178 0.93527 L0.247175 0.973965 L0.354874 0.973965 L0.426872 0.93527 L0.498866 0.858979 L0.535157 0.745099 L0.535157 0.668808 L0.498866 0.553823 L0.426872 0.477535 L0.354874 0.439941 L0.247175 0.439941",p:"M0.076904 0.439941 L0.076904 1.154244 M0.076904 0.541563 L0.151986 0.473487 L0.225944 0.439941 L0.338005 0.439941 L0.413087 0.473487 L0.488166 0.541563 L0.525148 0.644169 L0.525148 0.712246 L0.488166 0.813866 L0.413087 0.881942 L0.338005 0.916471 L0.225944 0.916471 L0.151986 0.881942 L0.076904 0.813866",q:"M0.525148 0.441895 L0.525148 1.156195 M0.525148 0.5435 L0.450067 0.47544 L0.376106 0.441895 L0.264042 0.441895 L0.188966 0.47544 L0.113885 0.5435 L0.076905 0.646108 L0.076905 0.714187 L0.113885 0.815809 L0.188966 0.883886 L0.264042 0.918418 L0.376106 0.918418 L0.450067 0.883886 L0.525148 0.815809",r:"M0.107422 0.439941 L0.107422 0.960796 M0.107422 0.663164 L0.155824 0.551014 L0.252626 0.476607 L0.349428 0.439941 L0.49463 0.439941",s:"M0.475556 0.477535 L0.400757 0.439941 L0.276092 0.439941 L0.176361 0.477535 L0.101563 0.553823 L0.101563 0.630112 L0.176361 0.668808 L0.301024 0.668808 L0.425688 0.745099 L0.50049 0.821387 L0.50049 0.897677 L0.425688 0.93527 L0.325956 0.973965 L0.201295 0.973965 L0.126496 0.93527 L0.101563 0.858979",t:"M0.246032 0.297852 L0.246032 0.826549 L0.301023 0.919323 L0.411011 0.950848 L0.520997 0.950848 M0.081055 0.515799 L0.466004 0.515799",u:"M0.092041 0.454102 L0.092041 0.826134 L0.13018 0.937211 L0.205936 0.974954 L0.319832 0.974954 L0.396113 0.937211 L0.510011 0.826134 M0.510011 0.454102 L0.510011 0.974954",v:"M0.048828 0.453125 L0.301026 0.961719 M0.553224 0.453125 L0.301026 0.961719",w:"M0 0.453125 L0.150512 0.961719 M0.301024 0.453125 L0.150512 0.961719 M0.301024 0.453125 L0.451539 0.961719 M0.602052 0.453125 L0.451539 0.961719",x:"M0.03711 0.453125 L0.564943 0.961719 M0.564943 0.453125 L0.03711 0.961719",y:"M0.084618 0.453125 L0.320232 0.921476 M0.55713 0.453125 L0.320232 0.921476 L0.242119 1.055289 L0.163369 1.122196 L0.084618 1.155166 L0.044922 1.155166",z:"M0.505373 0.452148 L0.09668 0.961651 M0.09668 0.452148 L0.505373 0.452148 M0.09668 0.961651 L0.505373 0.961651"},Ayn={};for(let e in gyn){Ayn[e]=[];let t=gyn[e].split("M").slice(1).map((n)=>n.split("L").map((o)=>o.trim().split(" ").map(parseFloat)));for(let n of t)for(let o=0;o<n.length-1;o++)Ayn[e].push({x1:n[o][0],y1:1-n[o][1],x2:n[o+1][0],y2:1-n[o+1][1]})}var rii=(e,t,n)=>{let o=[{x:e.x,y:e.y}],r=(e.x+t.x)/2,i=(e.y+t.y)/2,s={x:t.x,y:t.y};switch(t.facingDirection){case"x+":s.x+=n;break;case"x-":s.x-=n;break;case"y+":s.y+=n;break;case"y-":s.y-=n;break}let a=e.facingDirection??"none",c=t.facingDirection??"none",l=(u)=>{let _=o[o.length-1];if(_.x!==u.x||_.y!==u.y)o.push(u)},h=Math.abs(e.y-t.y)<=Math.max(0.000001,n*0.1),d=Math.abs(e.x-t.x)<=Math.max(0.000001,n*0.1);if(a==="none"&&c==="none")l({x:r,y:e.y}),l({x:r,y:t.y});else if(a==="x+"&&c==="y+")if(e.x>t.x&&e.y<t.y)l({x:e.x+n,y:e.y}),l({x:e.x+n,y:t.y+n}),l({x:t.x,y:t.y+n});else if(!d&&!h&&e.x<t.x&&e.y>t.y)l({x:t.x,y:e.y});else if(d)l({x:e.x+n,y:e.y}),l({x:e.x+n,y:t.y+n}),l({x:t.x,y:t.y+n});else if(e.x<t.x)l({x:r,y:e.y}),l({x:r,y:s.y}),l({x:t.x,y:s.y});else if(e.y<=t.y+n)l({x:e.x+n,y:e.y}),l({x:e.x+n,y:e.y+n}),l({x:t.x,y:e.y+n}),l({x:t.x,y:t.y});else l({x:e.x+n,y:e.y}),l({x:e.x+n,y:(e.y+t.y)/2}),l({x:t.x,y:(e.y+t.y)/2});else if(a==="x+"&&c==="x+"&&!h){let u=Math.max(e.x+n,s.x);l({x:u,y:e.y}),l({x:u,y:t.y})}else if(a==="x+"&&c==="x+"&&h)l({x:e.x+n,y:e.y}),l({x:e.x+n,y:e.y+n}),l({x:t.x+n,y:e.y+n}),l({x:t.x+n,y:t.y});else if(a==="x+"&&c==="y-")if(d&&e.y<=t.y)l({x:e.x+n,y:e.y}),l({x:e.x+n,y:i}),l({x:t.x,y:i});else if(d&&e.y>t.y)l({x:e.x+n,y:e.y}),l({x:e.x+n,y:t.y-n}),l({x:t.x,y:t.y-n});else if(e.x<t.x&&e.y<t.y)l({x:t.x,y:e.y});else if(e.x>t.x&&e.y<t.y){let u=e.x+n;l({x:u,y:e.y}),l({x:u,y:i}),l({x:t.x,y:i})}else if(e.x>t.x&&e.y>t.y){let u=e.x+n;l({x:u,y:e.y}),l({x:u,y:s.y}),l({x:t.x,y:s.y})}else if(e.y===t.y)l({x:e.x+n,y:e.y}),l({x:e.x+n,y:e.y-n}),l({x:t.x,y:e.y-n});else l({x:r,y:e.y}),l({x:r,y:s.y}),l({x:t.x,y:s.y});else if(a==="x+"&&c==="x-"&&e.x+n>=t.x-n&&!h){let u=e.x+n;l({x:u,y:e.y}),l({x:u,y:i}),l({x:s.x,y:i}),l({x:s.x,y:s.y})}else if(a==="x+"&&c==="x-"&&h&&t.x>e.x);else if(a==="x+"&&c==="x-"&&h)l({x:e.x+n,y:e.y}),l({x:e.x+n,y:e.y+n}),l({x:t.x-n,y:e.y+n}),l({x:t.x-n,y:e.y});else{if(a==="x+")l({x:e.x+n,y:e.y});l({x:r,y:o[o.length-1].y}),l({x:r,y:s.y}),l({x:s.x,y:s.y})}return l({x:t.x,y:t.y}),o},Cct=(e,t,n={})=>{let o=e,r=t,i=!1;if(o.x>r.x||o.x===r.x&&o.y>r.y)i=!0,[o,r]=[r,o];let s=o.facingDirection==="x-",a=o.facingDirection==="y-",c=(f)=>{let y=s?o.x-(f.x-o.x):f.x,x=a?o.y-(f.y-o.y):f.y,C=f.facingDirection;if(s){if(C==="x+")C="x-";else if(C==="x-")C="x+"}if(a){if(C==="y+")C="y-";else if(C==="y-")C="y+"}return{x:y,y:x,facingDirection:C}},l=(f,y)=>{let x=f.x-y.x,C=f.y-y.y,b=y.x+C,I=y.y-x,v=f.facingDirection;switch(v){case"x+":v="y-";break;case"y-":v="x-";break;case"x-":v="y+";break;case"y+":v="x+";break}return{x:b,y:I,facingDirection:v}},h=(f,y)=>{let x=f.x-y.x,C=f.y-y.y;return{x:y.x-C,y:y.y+x}},d=s||a?c(o):o,u=s||a?c(r):r,_=d,p=u,m=!1;if(d.facingDirection==="y+")m=!0,_={...d,facingDirection:"x+"},p=l(u,d);let A=n?.overshoot??0.1*Math.max(Math.abs(_.x-p.x),Math.abs(_.y-p.y)),g=rii(_,p,A);if(m)g=g.map((f)=>h(f,_));if(s||a)g=g.map(({x:f,y})=>({x:s?o.x-(f-o.x):f,y:a?o.y-(y-o.y):y}));return i?g.reverse():g},fyn=(e,t)=>{let n=e.find((o)=>o?.netLabelWidth!==void 0)?.netLabelWidth;if(n!==void 0||!t)return n;return e.find((o)=>o?.anchoredNetLabelWidth!==void 0)?.anchoredNetLabelWidth},gP=({inputProblem:e,netId:t,pinIds:n,isPortOnlyLabel:o})=>{if(t){let r=fyn([e.netConnections.find((i)=>i.netId===t),e.directConnections.find((i)=>i.netId===t)],o);if(r!==void 0)return r}return fyn([e.directConnections.find((r)=>r.pinIds.some((i)=>n.includes(i))),e.netConnections.find((r)=>r.pinIds.some((i)=>n.includes(i)))],o)};function Nv(e,t={}){return{minX:e.center.x-e.width/2-(t.minX??0),minY:e.center.y-e.height/2-(t.minY??0),maxX:e.center.x+e.width/2+(t.maxX??0),maxY:e.center.y+e.height/2+(t.maxY??0)}}function Qc(e,t,n=0.000000001){return e.minX<t.maxX-n&&e.maxX>t.minX+n&&e.minY<t.maxY-n&&e.maxY>t.minY+n}function JZ(e,t){for(let n of t.textBoxes??[])if(Qc(e,Nv(n)))return!0;return!1}var L7n=0.15,Mde=L7n/7.5,iii=0.2;function m8e(e,t){if(t.x>e.x)return"x+";if(t.x<e.x)return"x-";if(t.y>e.y)return"y+";if(t.y<e.y)return"y-";return null}function bct({path:e,pin1:t,pin2:n}){let o=m8e(e[0],e[1]),r=m8e(e[e.length-1],e[e.length-2]);return o===t._facingDirection&&r===n._facingDirection}function sii(e,t){if(e.x===t.x||e.y===t.y)return null;let n=e._facingDirection,o=t._facingDirection,r={x:e.x,y:e.y},i={x:t.x,y:t.y},s=null;if(n?.startsWith("y")&&o?.startsWith("x")){let a=-Mde;if(n==="y+")a=Mde;let c=r.y+a,l=(r.x+i.x)/2;s=[r,{x:r.x,y:c},{x:l,y:c},{x:l,y:i.y},i]}else if(n?.startsWith("x")&&o?.startsWith("y")){let a=-Mde;if(n==="x+")a=Mde;let c=r.x+a,l=(r.y+i.y)/2;s=[r,{x:c,y:r.y},{x:c,y:l},{x:i.x,y:l},i]}if(!s)return null;if(bct({path:s,pin1:e,pin2:t}))return s;return null}function aii(e,t){let n=Math.abs(e.x-t.x)+Math.abs(e.y-t.y);if(n>L7n)return null;let o={x:e.x,y:e.y},r={x:t.x,y:t.y},i=sii(e,t);if(i)return i;let s=[];if(e.x!==t.x&&e.y!==t.y)s=[[o,{x:t.x,y:e.y},r],[o,{x:e.x,y:t.y},r]];else s=[[o,r]];for(let a of s)if(bct({path:a,pin1:e,pin2:t}))return a;return Cct({x:e.x,y:e.y,facingDirection:e._facingDirection},{x:t.x,y:t.y,facingDirection:t._facingDirection},{overshoot:Math.min(iii,Math.max(Mde,n/4))})}var d7e=0.000000001,lf=(e,t,n=d7e)=>Math.abs(e.x-t.x)<n,tA=(e,t,n=d7e)=>Math.abs(e.y-t.y)<n,D1=(e,t,n,o=d7e)=>{let r=lf(e,t,o),i=tA(e,t,o);if(!r&&!i)return!1;if(r){let s=e.x;if(s<n.minX-o||s>n.maxX+o)return!1;let a=Math.min(e.y,t.y),c=Math.max(e.y,t.y);return Math.min(c,n.maxY)-Math.max(a,n.minY)>o}else{let s=e.y;if(s<n.minY-o||s>n.maxY+o)return!1;let a=Math.min(e.x,t.x),c=Math.max(e.x,t.x);return Math.min(c,n.maxX)-Math.max(a,n.minX)>o}},_8e=(e,t,n,o=d7e)=>{if(lf(e,t,o)){if(!(Math.abs(e.x-n.minX)<=o||Math.abs(e.x-n.maxX)<=o))return!1;return Math.min(Math.max(e.y,t.y),n.maxY)-Math.max(Math.min(e.y,t.y),n.minY)>o}if(tA(e,t,o)){if(!(Math.abs(e.y-n.minY)<=o||Math.abs(e.y-n.maxY)<=o))return!1;return Math.min(Math.max(e.x,t.x),n.maxX)-Math.max(Math.min(e.x,t.x),n.minX)>o}return!1},uT=(e,t,n={})=>{for(let o=0;o<e.length-1;o++){let r=e[o],i=e[o+1],s=n.excludeRectsForSegment?.(o)??new Set;for(let a of t){if(s.has(a))continue;if(D1(r,i,a))return{segIndex:o,rect:a}}}return null},ZZ=(e,t)=>{for(let n=0;n<e.length-1;n++)for(let o of t)if(D1(e[n],e[n+1],o))return!0;return!1},H7n=0.000000001,eL=0.2,cii=(e,t)=>({minX:Math.min(e.x,t.x),maxX:Math.max(e.x,t.x),minY:Math.min(e.y,t.y),maxY:Math.max(e.y,t.y)}),tL=(e,t,n,o=H7n)=>{if(e==="x"){if(t.x<n.minX-o)return[(t.x+n.minX)/2];if(t.x>n.maxX+o)return[(t.x+n.maxX)/2];return[n.minX-eL,n.maxX+eL]}else{if(t.y<n.minY-o)return[(t.y+n.minY)/2];if(t.y>n.maxY+o)return[(t.y+n.maxY)/2];return[n.minY-eL,n.maxY+eL]}},yyn=(e,t,n,o,r={})=>{let{allowOpenSideCandidates:i=!1,eps:s=H7n}=r,a=[...n];if(e==="x"){let c=[o.minX,...a.map((_)=>_.maxX)].filter((_)=>_<t.minX-s),l=[o.maxX,...a.map((_)=>_.minX)].filter((_)=>_>t.maxX+s),h=c.length>0?Math.max(...c):void 0,d=l.length>0?Math.min(...l):void 0,u=[];if(h!==void 0)u.push((h+t.minX)/2);else if(i)u.push(t.minX-eL);if(d!==void 0)u.push((t.maxX+d)/2);else if(i)u.push(t.maxX+eL);return u}else{let c=[o.minY,...a.map((_)=>_.maxY)].filter((_)=>_<t.minY-s),l=[o.maxY,...a.map((_)=>_.minY)].filter((_)=>_>t.maxY+s),h=c.length>0?Math.max(...c):void 0,d=l.length>0?Math.min(...l):void 0,u=[];if(h!==void 0)u.push((h+t.minY)/2);else if(i)u.push(t.minY-eL);if(d!==void 0)u.push((t.maxY+d)/2);else if(i)u.push(t.maxY+eL);return u}},lii=0.000000001,F7n=(e)=>e.every((t,n)=>{let o=e[n+1];if(!o)return!0;if(!tA(t,o)&&!lf(t,o))return!1;return Math.abs(t.x-o.x)+Math.abs(t.y-o.y)>0}),Ict=(e,t,n,o,r=lii)=>{if(t<0||t>=e.length-1)return null;let i=e[t],s=e[t+1],a=lf(i,s,r),c=tA(i,s,r);if(!a&&!c)return null;if(a&&n!=="x")return null;if(c&&n!=="y")return null;let l=e.map((h)=>({...h}));if(n==="x"){if(Math.abs(i.x-o)<r&&Math.abs(s.x-o)<r)return null;l[t]={...l[t],x:o},l[t+1]={...l[t+1],x:o}}else{if(Math.abs(i.y-o)<r&&Math.abs(s.y-o)<r)return null;l[t]={...l[t],y:o},l[t+1]={...l[t+1],y:o}}if(t-1>=0){let h=l[t-1],d=l[t];if(Math.abs(h.x-d.x)+Math.abs(h.y-d.y)<r)return null}if(t+2<=l.length-1){let h=l[t+1],d=l[t+2];if(Math.abs(h.x-d.x)+Math.abs(h.y-d.y)<r)return null}for(let h=0;h<l.length-1;h++){let d=l[h],u=l[h+1];if(!tA(d,u,r)&&!lf(d,u,r))return null}return l},Rot=(e,t=6)=>e.map((o)=>`${o.x.toFixed(t)},${o.y.toFixed(t)}`).join("|"),xyn=(e,t)=>{if(lf(e,t))return"x";if(tA(e,t))return"y";return null},hii=({path:e,collidingSegmentIndex:t,obstacle:n})=>{if(e.length<3||e.length>4)return[];let o=e.length-2;if(t!==0&&t!==o)return[];let r=t===o,i=r?[...e].reverse():e,[s,a,c]=i,l=xyn(s,a),h=xyn(a,c);if(!l||!h)return[];if(l===h)return[];let d=[...tL(h,s,n),...tL(h,c,n)],u=[...tL(l,s,n),...tL(l,c,n)],_=[];for(let p of[...new Set(d)])for(let m of[...new Set(u)]){let g=[...l==="y"?[s,{x:p,y:s.y},{x:p,y:m},{x:c.x,y:m},c]:[s,{x:s.x,y:p},{x:m,y:p},{x:m,y:c.y},c],...i.slice(3)],f=r?g.reverse():g;if(F7n(f))_.push(f)}return _},Cyn=0.000000001,dii=0.2,D9e=(e,t,n)=>e>Math.min(t,n)+Cyn&&e<Math.max(t,n)-Cyn,uii=({path:e,collidingSegmentIndex:t,obstacle:n,clearance:o=dii})=>{if(t<=0||t>=e.length-2)return[];let r=e[t],i=e[t+1],s=[];if(tA(r,i)){let a=r.x<i.x,c=a?n.minX-o:n.maxX+o,l=a?n.maxX+o:n.minX-o;if(!D9e(c,r.x,i.x)||!D9e(l,r.x,i.x))return[];for(let h of[n.minY-o,n.maxY+o])s.push([{x:c,y:r.y},{x:c,y:h},{x:l,y:h},{x:l,y:i.y}])}else if(lf(r,i)){let a=r.y<i.y,c=a?n.minY-o:n.maxY+o,l=a?n.maxY+o:n.minY-o;if(!D9e(c,r.y,i.y)||!D9e(l,r.y,i.y))return[];for(let h of[n.minX-o,n.maxX+o])s.push([{x:r.x,y:c},{x:h,y:c},{x:h,y:l},{x:i.x,y:l}])}return s.map((a)=>[...e.slice(0,t+1),...a,...e.slice(t+1)]).filter(F7n)};function vct(e){let t=e.width/2,n=e.height/2;return{minX:e.center.x-t,maxX:e.center.x+t,minY:e.center.y-n,maxY:e.center.y+n}}var pii=0.05,byn=(e)=>e.kind==="text_box",mii=(e)=>{let t=vct(e);return{kind:"chip",chipId:e.chipId,...t}},Cx=(e,t={})=>{let n=e.chips.map(mii),o=(e.textBoxes??[]).map((r)=>{let i=Nv(r,t.textBoxPadding),s=n.find((l)=>l.chipId===r.chipId),a=s?Vri(i,s):Number.POSITIVE_INFINITY,c=s&&a>0&&a<pii?{minX:Math.min(i.minX,s.maxX),maxX:Math.max(i.maxX,s.minX),minY:Math.min(i.minY,s.maxY),maxY:Math.max(i.maxY,s.minY)}:i;return{kind:"text_box",textBox:r,...c}});return[...n,...o]},Iyn=({pin1:e,pin2:t,overshoot:n})=>Cct({x:e.x,y:e.y,facingDirection:e._facingDirection},{x:t.x,y:t.y,facingDirection:t._facingDirection},{overshoot:n}),_ii=({pin1:e,pin2:t})=>{let n=t.x-e.x,o=t.y-e.y;if(Math.abs(n)>=Math.abs(o))return n>0?e._facingDirection==="x+"&&t._facingDirection==="x-":e._facingDirection==="x-"&&t._facingDirection==="x+";return o>0?e._facingDirection==="y+"&&t._facingDirection==="y-":e._facingDirection==="y-"&&t._facingDirection==="y+"},Jde=(e)=>{let t=0;for(let n=0;n<e.length-1;n++)t+=Math.abs(e[n+1].x-e[n].x)+Math.abs(e[n+1].y-e[n].y);return t},gii=({pins:e,obstacles:t})=>{let[n,o]=e,r=aii(n,o),i=Iyn({pin1:n,pin2:o,overshoot:0.2}),s=Math.abs(n.x-o.x)+Math.abs(n.y-o.y),a=Iyn({pin1:n,pin2:o,overshoot:Math.min(0.2,Math.max(0.02,s/4))}),c=Jde(a)<Jde(i),l=Jde(i)>s+0.000000001,h=uT(a,t)===null&&(_ii({pin1:n,pin2:o})&&l&&c||uT(i,t)!==null);return{path:r??(h?a:i),isDirectShortPath:r!==null}},kZ=class extends Gu{pins;connectionPair;inputProblem;chipMap;obstacles;textObstacles;endpointTextObstacles;aabb;baseElbow;preferExteriorDetours;reserveNetLabelClearance;solvedTracePath=null;queue=[];visited=new Set;inferredPinIndexes=new Set;hasAmbiguousPinDirections=!1;constructor(e){super();this.pins=e.pins,this.connectionPair=e.connectionPair,this.inputProblem=e.inputProblem,this.chipMap=e.chipMap,this.preferExteriorDetours=e.preferExteriorDetours??!0,this.reserveNetLabelClearance=e.reserveNetLabelClearance??!0,this.obstacles=Cx(this.inputProblem,{textBoxPadding:this.reserveNetLabelClearance?this.getTextBoxPaddingForConnectionPair():void 0}),this.textObstacles=new Set(this.obstacles.filter(byn));let t=new Set(this.pins.map((c)=>c.chipId));this.endpointTextObstacles=new Set(this.obstacles.filter(byn).filter((c)=>c.textBox.chipId!==void 0&&t.has(c.textBox.chipId)));let n=this.pins.map((c,l)=>{if(c._facingDirection)return[c._facingDirection];this.inferredPinIndexes.add(l);let h=this.pins[l===0?1:0];return yct(c,this.chipMap[c.chipId],h)}),o=n[0].flatMap((c,l)=>n[1].map((h,d)=>({directions:[c,h],preferenceIndex:l+d})));this.hasAmbiguousPinDirections=n.some((c)=>c.length>1);let r=o.map(({directions:c,preferenceIndex:l})=>{let h=this.pins.map((u,_)=>({...u,_facingDirection:c[_]})),d=gii({pins:h,obstacles:this.obstacles});return{directions:c,baseElbow:d.path,isDirectShortPath:d.isDirectShortPath,preferenceIndex:l,collisionCount:uT(d.path,this.obstacles)===null?0:1,pathLength:Jde(d.path)}}).sort((c,l)=>c.collisionCount-l.collisionCount||c.pathLength-l.pathLength||c.preferenceIndex-l.preferenceIndex),i=r[0];for(let[c,l]of this.pins.entries())l._facingDirection=i.directions[c];let[s,a]=this.pins;if(this.baseElbow=i.baseElbow,i.isDirectShortPath)this.solvedTracePath=i.baseElbow;this.aabb=cii({x:s.x,y:s.y},{x:a.x,y:a.y});for(let c of r){let l=Rot(c.baseElbow);if(this.visited.has(l))continue;this.visited.add(l),this.queue.push({path:c.baseElbow,collisionRects:new Set,directions:c.directions})}}getConstructorParams(){return{chipMap:this.chipMap,pins:this.pins,connectionPair:this.connectionPair,inputProblem:this.inputProblem,preferExteriorDetours:this.preferExteriorDetours,reserveNetLabelClearance:this.reserveNetLabelClearance}}getTextBoxPaddingForConnectionPair(){if(!this.inputProblem.textBoxes?.length)return{};let e=this.connectionPair?.userNetId;if(!e)return{};let t=this.inputProblem.availableNetLabelOrientations[e]??["x+","x-","y+","y-"],n=gP({inputProblem:this.inputProblem,netId:e,pinIds:this.pins.map((i)=>i.pinId),isPortOnlyLabel:!1}),o=this.getNetLabelHeightForConnectionPair(e),r={minX:0,minY:0,maxX:0,maxY:0};for(let i of t){let{width:s,height:a}=bv({orientation:i,netLabelWidth:n,netLabelHeight:o});if(i==="y+"||i==="y-")if(r.minX=Math.max(r.minX,s/2),r.maxX=Math.max(r.maxX,s/2),i==="y+")r.minY=Math.max(r.minY,a);else r.maxY=Math.max(r.maxY,a);else if(r.minY=Math.max(r.minY,a/2),r.maxY=Math.max(r.maxY,a/2),i==="x+")r.minX=Math.max(r.minX,s);else r.maxX=Math.max(r.maxX,s)}return r}getNetLabelHeightForConnectionPair(e){let t=this.inputProblem.netConnections.find((o)=>o.netId===e)?.netLabelHeight;if(t!==void 0)return t;let n=this.pins.map((o)=>o.pinId);return this.inputProblem.netConnections.find((o)=>o.pinIds.some((r)=>n.includes(r)))?.netLabelHeight}axisOfSegment(e,t){if(lf(e,t))return"x";if(tA(e,t))return"y";return null}pathLength(e){return Jde(e)}getPinBandPenalty(e){let t=0;for(let n=1;n<e.length-2;n++){let o=e[n],r=e[n+1];if(tA(o,r)&&o.y>this.aabb.minY&&o.y<this.aabb.maxY)t+=10;else if(lf(o,r)&&o.x>this.aabb.minX&&o.x<this.aabb.maxX)t+=10}return t}isSegmentOutsidePinBand(e,t){if(tA(e,t))return e.y<=this.aabb.minY||e.y>=this.aabb.maxY;if(lf(e,t))return e.x<=this.aabb.minX||e.x>=this.aabb.maxX;return!1}_step(){if(this.solvedTracePath){this.solved=!0;return}let e=this.queue.shift();if(!e){this.failed=!0,this.error="No collision-free path found";return}let{path:t,collisionRects:n,directions:o}=e,[r,i]=this.pins,s=uT(t,this.obstacles,{excludeRectsForSegment:(v)=>{let P=t.length-2,M=new Set,B=t[v],T=t[v+1],N=v===0?i:v===P?r:null;if(N)for(let V of this.textObstacles){let O=Nv(V.textBox);if(V.textBox.chipId!==N.chipId||!D1(B,T,O))M.add(V)}let D=0.000000001,L=(V)=>[B,T].some((O)=>Math.abs(O.x-V.x)<=D&&Math.abs(O.y-V.y)<=D);for(let V of this.pins){if(!L(V))continue;let O=this.obstacles.find((U)=>U.kind==="chip"&&U.chipId===V.chipId);if(O&&_8e(B,T,O))M.add(O)}let H=v===1?2:v===P-1?P-2:null;if(H!==null&&H>=0&&H<P&&this.isSegmentOutsidePinBand(t[H],t[H+1]))for(let V of this.endpointTextObstacles){let O=Nv(V.textBox);if(!D1(B,T,O))M.add(V)}return M}});if(!s){let v=t[0],P=t[t.length-1],M=0.000000001,B=(T,N)=>Math.abs(T.x-N.x)<0.000000001&&Math.abs(T.y-N.y)<0.000000001;if(B(v,{x:r.x,y:r.y})&&B(P,{x:i.x,y:i.y})&&(!this.hasAmbiguousPinDirections||bct({path:t,pin1:{...r,_facingDirection:o[0]},pin2:{...i,_facingDirection:o[1]}}))){for(let T of this.inferredPinIndexes){let N=T===0?m8e(t[0],t[1]):m8e(t.at(-1),t.at(-2));if(N)this.pins[T]._facingDirection=N}this.solvedTracePath=t,this.solved=!0}return}let a=s.segIndex,{segIndex:c,rect:l}=s,h=c===0,d=c===t.length-2,u=l.kind==="chip"&&this.pins.some((v)=>v.chipId===l.chipId);if((t.length===3||t.length===4&&this.connectionPair!==void 0&&!u)&&(h||d)){let v=hii({path:t,collidingSegmentIndex:c,obstacle:l}).filter((P)=>{let M=Rot(P);if(this.visited.has(M))return!1;return this.visited.add(M),!0}).sort((P,M)=>{if(t.length===4&&this.preferExteriorDetours)return this.getPinBandPenalty(P)-this.getPinBandPenalty(M)||this.pathLength(P)-this.pathLength(M);return this.pathLength(P)-this.pathLength(M)||this.getPinBandPenalty(P)-this.getPinBandPenalty(M)});for(let P of v){let M=new Set(n);M.add(l),this.queue.push({path:P,collisionRects:M,directions:o})}return}if(h){if(t.length<3)return;c=1}else if(d){if(t.length<3)return;c=t.length-3}let p=t[c],m=t[c+1],A=this.axisOfSegment(p,m);if(!A)return;let g=[],f={allowOpenSideCandidates:this.connectionPair!==void 0};if(n.size===0){let v=tL(A,{x:r.x,y:r.y},l),P=tL(A,{x:i.x,y:i.y},l),M=[...v,...P],B=[...new Set(M)];g.push(...B)}else{let v=yyn(A,l,n,this.aabb,f);g.push(...v)}let y=[],x=(v)=>{let P=Rot(v);if(this.visited.has(P))return;this.visited.add(P);let M=new Set(n);M.add(l),y.push({path:v,collisionRects:M,length:this.pathLength(v),pinBandPenalty:this.getPinBandPenalty(v)})},C=(v,P,M)=>{let B=Ict(t,v,P,M);if(B)x(B)},b=t.length-2;if(this.connectionPair===void 0&&l.kind==="text_box"&&this.endpointTextObstacles.has(l)&&!n.has(l)&&a>0&&a<b)for(let v of uii({path:t,collidingSegmentIndex:a,obstacle:l}))x(v);for(let v of g)C(c,A,v);let I=a===1?[2]:a===b-1?[b-2]:[];for(let v of I){if(v<0||v>=b)continue;let P=this.axisOfSegment(t[v],t[v+1]);if(!P||P===A)continue;let M=[...tL(P,{x:r.x,y:r.y},l),...tL(P,{x:i.x,y:i.y},l)];if(n.size>0)M.push(...yyn(P,l,n,this.aabb,f));for(let B of[...new Set(M)])C(v,P,B)}y.sort((v,P)=>v.length-P.length||v.pinBandPenalty-P.pinBandPenalty);for(let v of y)this.queue.push({path:v.path,collisionRects:v.collisionRects,directions:o})}visualize(){let e=Bp(this.inputProblem,{chipAlpha:0.1,connectionAlpha:0.1});e.lines.push({points:this.baseElbow,strokeColor:"red",strokeDash:"4 4"});let[t,n]=this.pins;e.lines.push({points:[{x:t.x,y:t.y},{x:n.x,y:n.y}],strokeColor:"blue",strokeDash:"5 5"});for(let{path:o}of this.queue)e.lines.push({points:o,strokeColor:"teal",strokeDash:"2 2"});if(this.solvedTracePath)e.lines.push({points:this.solvedTracePath,strokeColor:"green"});else if(this.queue.length>0)e.lines.push({points:this.queue[0].path,strokeColor:"orange"});return e}},vyn=({connectionPair:e,allConnectionPairs:t,inputProblem:n})=>{let[o,r]=e.pins;if(n.netConnections.some((s)=>s.pinIds.includes(o.pinId)&&s.pinIds.includes(r.pinId)))return!0;return t.some((s)=>{if(s===e)return!1;let[a,c]=s.pins;if(o.chipId===a.chipId&&r.chipId===c.chipId)return!0;return o.chipId===c.chipId&&r.chipId===a.chipId})},Aii=class extends Gu{inputProblem;mspConnectionPairs;dcConnMap;globalConnMap;queuedConnectionPairs;chipMap;currentConnectionPair=null;retryingWithoutNetLabelClearance=!1;solvedTracePaths=[];failedConnectionPairs=[];constructor(e){super();this.inputProblem=e.inputProblem,this.mspConnectionPairs=e.mspConnectionPairs,this.dcConnMap=e.dcConnMap,this.globalConnMap=e.globalConnMap,this.chipMap=e.chipMap,this.queuedConnectionPairs=[...this.mspConnectionPairs]}getConstructorParams(){return{inputProblem:this.inputProblem,chipMap:this.chipMap,mspConnectionPairs:this.mspConnectionPairs,dcConnMap:this.dcConnMap,globalConnMap:this.globalConnMap}}_step(){if(this.activeSubSolver?.solved)this.solvedTracePaths.push({...this.currentConnectionPair,pins:this.activeSubSolver.pins,tracePath:this.activeSubSolver.solvedTracePath,mspConnectionPairIds:[this.currentConnectionPair.mspPairId],pinIds:[this.currentConnectionPair.pins[0].pinId,this.currentConnectionPair.pins[1].pinId]}),this.activeSubSolver=null,this.currentConnectionPair=null,this.retryingWithoutNetLabelClearance=!1;if(this.activeSubSolver?.failed){if(this.currentConnectionPair&&!this.retryingWithoutNetLabelClearance&&this.activeSubSolver.hasAmbiguousPinDirections){let o=this.currentConnectionPair;this.retryingWithoutNetLabelClearance=!0,this.activeSubSolver=new kZ({inputProblem:this.inputProblem,pins:o.pins.map((r)=>({...r})),connectionPair:o,chipMap:this.chipMap,preferExteriorDetours:vyn({connectionPair:o,allConnectionPairs:this.mspConnectionPairs,inputProblem:this.inputProblem}),reserveNetLabelClearance:!1});return}if(this.currentConnectionPair)this.failedConnectionPairs.push({...this.currentConnectionPair,error:this.activeSubSolver.error||void 0});this.activeSubSolver=null,this.currentConnectionPair=null,this.retryingWithoutNetLabelClearance=!1}if(this.activeSubSolver){this.activeSubSolver.step();return}let e=this.queuedConnectionPairs.shift();if(!e){this.solved=!0;return}this.currentConnectionPair=e,this.retryingWithoutNetLabelClearance=!1;let n=e.pins.some((o)=>{if(o._facingDirection)return!1;let r=this.chipMap[o.chipId];return r&&yct(o,r).length>1})?e.pins.map((o)=>({...o})):e.pins;this.activeSubSolver=new kZ({inputProblem:this.inputProblem,pins:n,connectionPair:e,chipMap:this.chipMap,preferExteriorDetours:vyn({connectionPair:e,allConnectionPairs:this.mspConnectionPairs,inputProblem:this.inputProblem})})}visualize(){if(this.activeSubSolver)return this.activeSubSolver.visualize();let e=Bp(this.inputProblem,{chipAlpha:0.1,connectionAlpha:0.1});for(let{mspPairId:t,tracePath:n}of this.solvedTracePaths)e.lines.push({points:n,strokeColor:"green"});for(let t of this.failedConnectionPairs)e.lines.push({points:[{x:t.pins[0].x,y:t.pins[0].y},{x:t.pins[1].x,y:t.pins[1].y}],strokeColor:"red",strokeDash:"4 2"});return e}},fii=({pts:e,segmentIndex:t,offset:n,JOG_SIZE:o,EPS:r=0.000001})=>{if(t!==0&&t!==e.length-2)return;let i=e[t],s=e[t+1],a=Math.abs(i.x-s.x)<r,c=Math.abs(i.y-s.y)<r;if(!a&&!c)return;let l=a?s.y>i.y?1:-1:s.x>i.x?1:-1;if(e.length===2){if(a){let h=i.y+l*o,d=s.y-l*o;e.splice(1,0,{x:i.x,y:h},{x:i.x+n,y:h},{x:s.x+n,y:d},{x:s.x,y:d})}else{let h=i.x+l*o,d=s.x-l*o;e.splice(1,0,{x:h,y:i.y},{x:h,y:i.y+n},{x:d,y:s.y+n},{x:d,y:s.y})}return}if(t===0)if(a){let h=i.y+l*o;e.splice(1,1,{x:i.x,y:h},{x:i.x+n,y:h},{x:s.x+n,y:s.y})}else{let h=i.x+l*o;e.splice(1,1,{x:h,y:i.y},{x:h,y:i.y+n},{x:s.x,y:s.y+n})}else if(a){let h=s.y-l*o;e.splice(t,1,{x:i.x+n,y:i.y},{x:s.x+n,y:h},{x:s.x,y:h})}else{let h=s.x-l*o;e.splice(t,1,{x:i.x,y:i.y+n},{x:h,y:s.y+n},{x:h,y:s.y})}},lP=0.000001,yii=class extends Gu{overlappingTraceSegments;interactionKind;traceNetIslands;traceIdsToShift;obstacleRects;SHIFT_DISTANCE=0.1;correctedTraceMap={};constructor(e){super();this.overlappingTraceSegments=e.overlappingTraceSegments,this.interactionKind=e.interactionKind,this.traceNetIslands=e.traceNetIslands,this.traceIdsToShift=e.traceIdsToShift,this.obstacleRects=Cx(e.inputProblem);for(let{connNetId:t,pathsWithOverlap:n}of this.overlappingTraceSegments)for(let{solvedTracePathIndex:o,traceSegmentIndex:r}of n){let i=this.traceNetIslands[t][o].mspPairId;this.correctedTraceMap[i]=this.traceNetIslands[t][o]}}_step(){let e=(c)=>c.pathsWithOverlap.some(({solvedTracePathIndex:l})=>this.traceNetIslands[c.connNetId][l].tracePath.length===2),t=this.overlappingTraceSegments.map((c)=>{if(!this.traceIdsToShift)return e(c);return c.pathsWithOverlap.every(({solvedTracePathIndex:l})=>{let h=this.traceNetIslands[c.connNetId][l];return!this.traceIdsToShift.has(h.mspPairId)})}),n=t.some((c)=>!c),o=(c)=>this.overlappingTraceSegments.map((l,h)=>{if(n&&t[h])return 0;let d=Math.floor(h/2)+1,u=h%2===0?c:-c;return this.getObstacleAwareOffset({group:l,offset:u*d*this.SHIFT_DISTANCE})}),r=o(-1);if(this.interactionKind==="overlap"&&this.overlappingTraceSegments.some((c)=>c.pathsWithOverlap.length>1)){this.correctedTraceMap=this.applyOffsets(r),this.solved=!0;return}let s=this.interactionKind==="overlap"?[r,o(1)]:[];if(this.interactionKind==="point_contact"){let c=this.overlappingTraceSegments.map((l,h)=>h).filter((l)=>!n||!t[l]).reverse();for(let l of c){let h=this.overlappingTraceSegments[l];for(let d of[-1,1]){let u=this.overlappingTraceSegments.map(()=>0);u[l]=this.getObstacleAwareOffset({group:h,offset:d*this.SHIFT_DISTANCE}),s.push(u)}}}let a=s.map((c)=>{let l=this.applyOffsets(c);return{correctedTraceMap:l,intersectionCount:this.countDifferentNetIntersections(l),totalDisplacement:c.reduce((h,d)=>h+Math.abs(d),0)}});a.sort((c,l)=>c.intersectionCount-l.intersectionCount||c.totalDisplacement-l.totalDisplacement),this.correctedTraceMap=a[0].correctedTraceMap,this.solved=!0}applyOffsets(e){let t={...this.correctedTraceMap},n=(r,i)=>Math.abs(r-i)<lP,o=(r,i)=>!!r&&!!i&&n(r.x,i.x)&&n(r.y,i.y);return this.overlappingTraceSegments.forEach((r,i)=>{let s=e[i];if(s===0)return;let a=new Map;for(let c of r.pathsWithOverlap){if(!a.has(c.solvedTracePathIndex))a.set(c.solvedTracePathIndex,new Set);a.get(c.solvedTracePathIndex).add(c.traceSegmentIndex)}for(let[c,l]of a){let h=this.traceNetIslands[r.connNetId][c],d=t[h.mspPairId]??h,u=d.tracePath.map((y)=>({...y})),_=Array.from(l).sort((y,x)=>y-x).reverse(),p=new Map;for(let y of _){let x=u[y],C=u[y+1];if(!x||!C)continue;if(Math.abs(x.x-C.x)<lP)p.set(y,"vertical");else if(Math.abs(x.y-C.y)<lP)p.set(y,"horizontal")}let m=new Set,A=new Set,g=this.SHIFT_DISTANCE;for(let y of _){if(y<0||y>=u.length-1)continue;if(y===0||y===u.length-2)fii({pts:u,segmentIndex:y,offset:s,JOG_SIZE:g,EPS:lP});else{let x=u[y],C=u[y+1],b=p.get(y);if(b==="vertical"){if(!m.has(y))x.x+=s,m.add(y);if(!m.has(y+1))C.x+=s,m.add(y+1)}else if(b==="horizontal"){if(!A.has(y))x.y+=s,A.add(y);if(!A.has(y+1))C.y+=s,A.add(y+1)}}}let f=[];for(let y of u)if(f.length===0||!o(f[f.length-1],y))f.push(y);t[h.mspPairId]={...d,tracePath:f}}}),t}countDifferentNetIntersections(e){let t=Object.values(this.traceNetIslands).flatMap((o)=>o.map((r)=>e[r.mspPairId]??r)),n=0;for(let o=0;o<t.length;o++){let r=t[o];for(let i=o+1;i<t.length;i++){let s=t[i];if(r.globalConnNetId===s.globalConnNetId)continue;for(let a=0;a<r.tracePath.length-1;a++)for(let c=0;c<s.tracePath.length-1;c++)if(K3(r.tracePath[a],r.tracePath[a+1],s.tracePath[c],s.tracePath[c+1]))n++}}return n}getObstacleAwareOffset({group:e,offset:t}){let n=this.getBlockingCollisions({group:e,offset:t});if(n.length===0)return t;let o=(a)=>n.some(({start:c,isVertical:l,obstacle:h})=>{let d,u,_;if(l)d=c.x,u=h.minX,_=h.maxX;else d=c.y,u=h.minY,_=h.maxY;let p=d+a;return d<=u+lP&&p>=_-lP||d>=_-lP&&p<=u+lP}),r=n.map(({start:a,isVertical:c,obstacle:l})=>{if(c)return{coord:a.x,lowEdge:l.minX,highEdge:l.maxX};return{coord:a.y,lowEdge:l.minY,highEdge:l.maxY}}),i=(a)=>r.flatMap(({coord:l,lowEdge:h,highEdge:d})=>[h-l-a,d-l+a]).filter((l)=>!o(l)).filter((l)=>this.getBlockingCollisions({group:e,offset:l}).length===0).sort((l,h)=>Math.abs(l-t)-Math.abs(h-t))[0],s=this.SHIFT_DISTANCE/10;return i(this.SHIFT_DISTANCE)??i(s)??t}getBlockingCollisions({group:e,offset:t}){let n=[];for(let{solvedTracePathIndex:o,traceSegmentIndex:r}of e.pathsWithOverlap){let i=this.traceNetIslands[e.connNetId][o],s=i.tracePath[r],a=i.tracePath[r+1];if(!s||!a)continue;let c=Math.abs(s.x-a.x)<lP,l=Math.abs(s.y-a.y)<lP;if(!c&&!l)continue;let h=c?[{...s,x:s.x+t},{...a,x:a.x+t}]:[{...s,y:s.y+t},{...a,y:a.y+t}],d=uT(h,this.obstacleRects);if(d)n.push({start:s,isVertical:c,obstacle:d.rect})}return n}visualize(){let e={lines:[],points:[],rects:[],circles:[]};for(let t of this.overlappingTraceSegments)for(let{solvedTracePathIndex:n,traceSegmentIndex:o}of t.pathsWithOverlap){let r=this.traceNetIslands[t.connNetId][n],i=r.tracePath[o],s=r.tracePath[o+1];e.lines.push({points:[i,s],strokeColor:"red"})}for(let t of Object.values(this.correctedTraceMap))e.lines.push({points:t.tracePath,strokeColor:"blue",strokeDash:"4 2"});return e}},Syn=0.000001,Pyn=class extends Gu{inputProblem;inputTracePaths;globalConnMap;traceIdsToShift;traceNetIslands={};correctedTraceMap={};recentTraceStates=[];cleanupPhase=null;constructor(e){super();this.inputProblem=e.inputProblem,this.inputTracePaths=e.inputTracePaths,this.globalConnMap=e.globalConnMap,this.traceIdsToShift=e.traceIdsToShift;for(let t of this.inputTracePaths){let{mspPairId:n}=t;this.correctedTraceMap[n]=t}this.rememberTraceState(this.correctedTraceMap),this.traceNetIslands=this.computeTraceNetIslands()}getConstructorParams(){return{inputProblem:this.inputProblem,inputTracePaths:this.inputTracePaths,globalConnMap:this.globalConnMap,traceIdsToShift:this.traceIdsToShift}}computeTraceNetIslands(){let e={};for(let t of this.inputTracePaths){let n=this.correctedTraceMap[t.mspPairId]??t,o=n.globalConnNetId;if(!e[o])e[o]=[];e[o].push(n)}return e}findNextOverlapIssue(){let t=Object.keys(this.traceNetIslands);for(let n=0;n<t.length;n++)for(let o=n+1;o<t.length;o++){let r=t[n],i=t[o],s=this.traceNetIslands[r]||[],a=this.traceNetIslands[i]||[],c=[],l=[],h=[],d=new Set,u=new Set,_=(A,g,f,y)=>{let x=Math.min(A,g),C=Math.max(A,g),b=Math.min(f,y),I=Math.max(f,y);return Math.min(C,I)-Math.max(x,b)},p=({pathAIndex:A,segmentAIndex:g,pathBIndex:f,segmentBIndex:y,rangeOverlap:x})=>{if(x>0.002){let T=`${A}:${g}`,N=`${f}:${y}`;if(!d.has(T))c.push({solvedTracePathIndex:A,traceSegmentIndex:g}),d.add(T);if(!u.has(N))l.push({solvedTracePathIndex:f,traceSegmentIndex:y}),u.add(N);return}if(x<-0.002)return;let C=s[A].tracePath,b=a[f].tracePath,I=C[g],v=C[g+1],P=b[y],M=b[y+1];if(g===0||g===C.length-2||y===0||y===b.length-2)return;h.push({pathAIndex:A,segmentAIndex:g,pathBIndex:f,segmentBIndex:y,combinedLength:Math.abs(I.x-v.x)+Math.abs(I.y-v.y)+Math.abs(P.x-M.x)+Math.abs(P.y-M.y)})};for(let A=0;A<s.length;A++){let g=s[A],f=g.tracePath;for(let y=0;y<f.length-1;y++){let x=f[y],C=f[y+1],b=Math.abs(x.x-C.x)<0.002,I=Math.abs(x.y-C.y)<0.002;if(!b&&!I)continue;for(let v=0;v<a.length;v++){let P=a[v];if(this.traceIdsToShift&&!this.traceIdsToShift.has(g.mspPairId)&&!this.traceIdsToShift.has(P.mspPairId))continue;let M=P.tracePath;for(let B=0;B<M.length-1;B++){let T=M[B],N=M[B+1],D=Math.abs(T.x-N.x)<0.002,L=Math.abs(T.y-N.y)<0.002;if(!D&&!L)continue;if(b&&D){if(Math.abs(x.x-T.x)<0.002)p({pathAIndex:A,segmentAIndex:y,pathBIndex:v,segmentBIndex:B,rangeOverlap:_(x.y,C.y,T.y,N.y)})}else if(I&&L){if(Math.abs(x.y-T.y)<0.002)p({pathAIndex:A,segmentAIndex:y,pathBIndex:v,segmentBIndex:B,rangeOverlap:_(x.x,C.x,T.x,N.x)})}}}}}if(c.length>0&&l.length>0)return{interactionKind:"overlap",overlappingTraceSegments:[{connNetId:r,pathsWithOverlap:c},{connNetId:i,pathsWithOverlap:l}]};let m=h.sort((A,g)=>g.combinedLength-A.combinedLength)[0];if(m)return{interactionKind:"point_contact",overlappingTraceSegments:[{connNetId:r,pathsWithOverlap:[{solvedTracePathIndex:m.pathAIndex,traceSegmentIndex:m.segmentAIndex}]},{connNetId:i,pathsWithOverlap:[{solvedTracePathIndex:m.pathBIndex,traceSegmentIndex:m.segmentBIndex}]}]}}return null}findNextDiagonalSegment(){for(let t in this.correctedTraceMap){let n=this.correctedTraceMap[t].tracePath;for(let o=0;o<n.length-1;o++){let r=n[o],i=n[o+1],s=Math.abs(r.y-i.y)<0.002,a=Math.abs(r.x-i.x)<0.002;if(!s&&!a)return{mspPairId:t,tracePath:n,i:o,p1:r,p2:i}}}return null}findAndFixNextDiagonalSegment(){let e=this.findNextDiagonalSegment();if(!e)return!1;let{mspPairId:t,tracePath:n,i:o,p1:r,p2:i}=e,s=0.002,a=o>0?n[o-1]:null,c=o+2<n.length?n[o+2]:null,l=a?Math.abs(a.x-r.x)<s:!1,h=a?Math.abs(a.y-r.y)<s:!1,d=c?Math.abs(i.x-c.x)<s:!1,u=c?Math.abs(i.y-c.y)<s:!1,_={x:r.x,y:i.y},p={x:i.x,y:r.y},m=0;if(l)m++;if(u)m++;let A=0;if(h)A++;if(d)A++;let g=m<A?_:p;return n.splice(o+1,0,g),!0}_step(){if(this.activeSubSolver?.solved){let o={...this.correctedTraceMap,...this.activeSubSolver.correctedTraceMap};if(this.returnsToPreviousTraceState(o)){this.activeSubSolver=null,this.solved=!0;return}this.correctedTraceMap=o,this.rememberTraceState(o),this.activeSubSolver=null,this.traceNetIslands=this.computeTraceNetIslands()}if(this.activeSubSolver){this.activeSubSolver.step();return}let e=this.findNextOverlapIssue();if(e===null){if(this.cleanupPhase===null)this.cleanupPhase="diagonals";if(this.cleanupPhase==="diagonals"){if(!this.findAndFixNextDiagonalSegment())this.cleanupPhase="done",this.solved=!0;return}this.solved=!0;return}let{interactionKind:t,overlappingTraceSegments:n}=e;this.activeSubSolver=new yii({inputProblem:this.inputProblem,interactionKind:t,overlappingTraceSegments:n,traceNetIslands:this.traceNetIslands,traceIdsToShift:this.traceIdsToShift})}rememberTraceState(e){if(this.recentTraceStates.push({...e}),this.recentTraceStates.length>2)this.recentTraceStates.shift()}returnsToPreviousTraceState(e){if(this.recentTraceStates.length<2)return!1;let t=this.recentTraceStates[0],n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let o of n){let r=e[o],i=t[o];if(!r||!i)return!1;if(r.tracePath.length!==i.tracePath.length)return!1;for(let s=0;s<r.tracePath.length;s++){let a=r.tracePath[s],c=i.tracePath[s];if(Math.abs(a.x-c.x)>Syn||Math.abs(a.y-c.y)>Syn)return!1}}return!0}visualize(){if(this.activeSubSolver)return this.activeSubSolver.visualize();let e=Bp(this.inputProblem);e.circles=e.circles||[];for(let t of Object.values(this.correctedTraceMap))e.lines.push({points:t.tracePath,strokeColor:"purple"});if(this.cleanupPhase==="diagonals"){let t=this.findNextDiagonalSegment();if(t)e.lines.push({points:[t.p1,t.p2],strokeColor:"red",strokeWidth:0.05})}return e}},xii=class{constructor(e=1/0,t=Float64Array,n=Uint32Array){let o=e!==1/0;this.ids=o?new n(e):[],this.values=o?new t(e):[],this.capacity=e,this.length=0}clear(){this.length=0}push(e,t){if(this.length===this.capacity)throw RangeError("Queue is at capacity.");let n=this.length++;while(n>0){let o=n-1>>1,r=this.values[o];if(t>=r)break;this.ids[n]=this.ids[o],this.values[n]=r,n=o}this.ids[n]=e,this.values[n]=t}pop(){if(this.length===0)return;let e=this.ids,t=this.values,n=e[0],o=--this.length;if(o>0){let r=e[o],i=t[o],s=0,a=o>>1;while(s<a){let c=(s<<1)+1,l=c+1,h=c+(+(l<o)&+(t[l]<t[c]));if(t[h]>=i)break;e[s]=e[h],t[s]=t[h],s=h}e[s]=r,t[s]=i}return n}peek(){return this.length>0?this.ids[0]:void 0}peekValue(){return this.length>0?this.values[0]:void 0}shrink(){if(Array.isArray(this.ids))this.ids.length=this.length;if(Array.isArray(this.values))this.values.length=this.length}},Eyn=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],Qot=3,qit=class e{static from(t,n=0){if(n%8!==0)throw Error("byteOffset must be 8-byte aligned.");if(!t||t.byteLength===void 0||"buffer"in t)throw Error("Data must be an instance of ArrayBuffer or SharedArrayBuffer.");let[o,r]=new Uint8Array(t,n+0,2);if(o!==251)throw Error("Data does not appear to be in a Flatbush format.");let i=r>>4;if(i!==Qot)throw Error(`Got v${i} data when expected v${Qot}.`);let s=Eyn[r&15];if(!s)throw Error("Unrecognized array type.");let[a]=new Uint16Array(t,n+2,1),[c]=new Uint32Array(t,n+4,1);return new e(c,a,s,void 0,t,n)}constructor(t,n=16,o=Float64Array,r=ArrayBuffer,i,s=0){if(t===void 0)throw Error("Missing required argument: numItems.");if(isNaN(t)||t<=0)throw Error(`Unexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+n,2),65535),this.byteOffset=s;let a=t,c=a;this._levelBounds=[a*4];do a=Math.ceil(a/this.nodeSize),c+=a,this._levelBounds.push(c*4);while(a!==1);this.ArrayType=o,this.IndexArrayType=c<16384?Uint16Array:Uint32Array;let l=Eyn.indexOf(o),h=c*4*o.BYTES_PER_ELEMENT;if(l<0)throw Error(`Unexpected typed array class: ${o}.`);let d=o,u=this.IndexArrayType;if(i)this.data=i,this._boxes=new d(i,s+8,c*4),this._indices=new u(i,s+8+h,c),this._pos=c*4,this.minX=this._boxes[this._pos-4],this.minY=this._boxes[this._pos-3],this.maxX=this._boxes[this._pos-2],this.maxY=this._boxes[this._pos-1];else{let _=this.data=new r(8+h+c*this.IndexArrayType.BYTES_PER_ELEMENT);this._boxes=new d(_,8,c*4),this._indices=new u(_,8+h,c),this._pos=0,this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,new Uint8Array(_,0,2).set([251,(Qot<<4)+l]),new Uint16Array(_,2,1)[0]=n,new Uint32Array(_,4,1)[0]=t}this._queue=new xii}add(t,n,o=t,r=n){let i=this._pos,s=i>>2,a=this._boxes;if(this._indices[s]=s,a[i]=t,a[i+1]=n,a[i+2]=o,a[i+3]=r,this._pos=i+4,t<this.minX)this.minX=t;if(n<this.minY)this.minY=n;if(o>this.maxX)this.maxX=o;if(r>this.maxY)this.maxY=r;return s}finish(){if(this._pos>>2!==this.numItems)throw Error(`Added ${this._pos>>2} items when expected ${this.numItems}.`);let t=this._boxes;if(this.numItems<=this.nodeSize){t[this._pos++]=this.minX,t[this._pos++]=this.minY,t[this._pos++]=this.maxX,t[this._pos++]=this.maxY;return}let{numItems:n,minX:o,minY:r,nodeSize:i,_indices:s,_levelBounds:a}=this,c=this.maxX-o||1,l=this.maxY-r||1,h=new Int32Array(n),d=65535,u=d/c,_=d/l;for(let m=0,A=0;m<n;m++){let g=t[A++],f=t[A++],y=t[A++],x=t[A++],C=u*((g+y)/2-o)|0,b=_*((f+x)/2-r)|0;h[m]=vii(C,b)}bii(h,t,s,0,n-1,i);let p=n*4;for(let m=0,A=0;m<a.length-1;m++){let g=a[m];while(A<g){let f=A,y=t[A++],x=t[A++],C=t[A++],b=t[A++];for(let I=1;I<i&&A<g;I++)y=Math.min(y,t[A++]),x=Math.min(x,t[A++]),C=Math.max(C,t[A++]),b=Math.max(b,t[A++]);s[p>>2]=f,t[p++]=y,t[p++]=x,t[p++]=C,t[p++]=b}}this._pos=p}search(t,n,o,r,i){if(this._pos!==this._boxes.length)throw Error("Data not yet indexed - call index.finish().");let{_boxes:s,_levelBounds:a,_indices:c,nodeSize:l}=this,h=this.numItems*4,d=s.length-4,u=a.length-1,_=[],p=[],m=!1;while(d!==void 0){let A=Math.min(d+l*4,a[u]),g=d>=h;if(m)this._collectContained(d,A,u,h,p,i);else for(let f=d;f<A;f+=4){let y=s[f];if(o<y)continue;let x=s[f+1];if(r<x)continue;let C=s[f+2];if(t>C)continue;let b=s[f+3];if(n>b)continue;let I=c[f>>2]|0;if(g){let v=+(t<=y&&n<=x&&o>=C&&r>=b);_.push(I|v,u-1)}else if(i===void 0||i(I,y,x,C,b))p.push(I)}if(u=_.pop(),d=_.pop(),d!==void 0)m=(d&1)===1,d&=-2}return p}_collectContained(t,n,o,r,i,s){let a=this._boxes,c=this._indices,l=t;for(let d=o;d>0;d--)l=c[l>>2];let h=Math.min(l+(n-t)*this.nodeSize**o,r);if(s===void 0)for(;l<h;l+=4)i.push(c[l>>2]|0);else for(;l<h;l+=4){let d=c[l>>2]|0;if(s(d,a[l],a[l+1],a[l+2],a[l+3]))i.push(d)}}neighbors(t,n,o=1/0,r=1/0,i){if(this._pos!==this._boxes.length)throw Error("Data not yet indexed - call index.finish().");let{_boxes:s,_levelBounds:a,_indices:c,_queue:l,nodeSize:h}=this,d=this.numItems*4,u=h*4,_=[],p=r*r,m=o===1,A=p;l.push(s.length-4<<1,0);while(l.length){let g=l.ids[0];if(g&1){if(l.pop(),_.push(g>>1),_.length===o)break;continue}l.pop();let f=g>>1,y=f<d,x=Math.min(f+u,Cii(f,a));for(let C=f;C<x;C+=4){let b=s[C],I=s[C+1],v=s[C+2],P=s[C+3],M=Math.max(Math.max(b-t,t-v),0),B=Math.max(Math.max(I-n,n-P),0),T=M*M+B*B;if(T>A)continue;let N=c[C>>2]|0;if(y){if(i===void 0||i(N)){if(l.push(N<<1|1,T),m&&T<A)A=T}}else l.push(N<<1,T)}}return l.clear(),_}};function Cii(e,t){let n=0,o=t.length-1;while(n<o){let r=n+o>>1;if(t[r]>e)o=r;else n=r+1}return t[n]}function bii(e,t,n,o,r,i){let s=[o,r];while(s.length){let a=s.pop()||0,c=s.pop()||0;if(a-c<=i&&Math.floor(c/i)>=Math.floor(a/i))continue;let l=e[c],h=e[c+a>>1],d=e[a],u=l>h!==l>d?l:h<l!==h<d?h:d,_=c-1,p=a+1;while(!0){do _++;while(e[_]<u);do p--;while(e[p]>u);if(_>=p)break;Iii(e,t,n,_,p)}s.push(c,p,p+1,a)}}function Iii(e,t,n,o,r){let i=e[o];e[o]=e[r],e[r]=i;let s=4*o,a=4*r,c=t[s],l=t[s+1],h=t[s+2],d=t[s+3];t[s]=t[a],t[s+1]=t[a+1],t[s+2]=t[a+2],t[s+3]=t[a+3],t[a]=c,t[a+1]=l,t[a+2]=h,t[a+3]=d;let u=n[o];n[o]=n[r],n[r]=u}function vii(e,t){let n=e^t,o=65535^n,r=65535^(e|t),i=e&(t^65535),s=n|o>>1,a=n>>1^n,c=r^(r>>1^o&i>>1),l=i^(n&r>>1^i>>1);return n=s&s>>2^a&a>>2,o=s&a>>2^a&(s^a)>>2,r=c^(s&c>>2^a&l>>2),i=l^(a&c>>2^(s^a)&l>>2),s=n&n>>4^o&o>>4,a=n&o>>4^o&(n^o)>>4,c=r^(n&r>>4^o&i>>4),l=i^(o&r>>4^(n^o)&i>>4),r=c^(s&c>>8^a&l>>8),i=l^(a&c>>8^(s^a)&l>>8),r^=r>>1,i^=i>>1,n=e^t,o=i|65535^(n|r),n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,o=(o|o<<8)&16711935,o=(o|o<<4)&252645135,o=(o|o<<2)&858993459,o=(o|o<<1)&1431655765,((o<<1|n)>>>0)-2147483648}var u7e=class{chips;spatialIndex;spatialIndexIdToChip;constructor(e){this.chips=e.map((t)=>({...t,bounds:vct(t),spatialIndexId:null})),this.spatialIndexIdToChip=new Map,this.spatialIndex=new qit(e.length);for(let t of this.chips)t.spatialIndexId=this.spatialIndex.add(t.bounds.minX,t.bounds.minY,t.bounds.maxX,t.bounds.maxY),this.spatialIndexIdToChip.set(t.spatialIndexId,t);this.spatialIndex.finish()}getChipsInBounds(e){return this.spatialIndex.search(e.minX,e.minY,e.maxX,e.maxY).map((n)=>this.spatialIndexIdToChip.get(n))}doesOrthogonalLineIntersectChip(e,t={}){let n=t.excludeChipIds??[],[o,r]=e,{x:i,y:s}=o,{x:a,y:c}=r;return this.getChipsInBounds({minX:Math.min(i,a),minY:Math.min(s,c),maxX:Math.max(i,a),maxY:Math.max(s,c)}).filter((h)=>!n.includes(h.chipId)).length>0}};function Rv(e,t,n,o=0.000000001){let r=Math.abs(e.x-t.x)<o,i=Math.abs(e.y-t.y)<o;if(!r&&!i)return!1;if(r){let s=e.x;if(s<n.minX-o||s>n.maxX+o)return!1;let a=Math.min(e.y,t.y),c=Math.max(e.y,t.y);return Math.min(c,n.maxY)-Math.max(a,n.minY)>o}else{let s=e.y;if(s<n.minY-o||s>n.maxY+o)return!1;let a=Math.min(e.x,t.x),c=Math.max(e.x,t.x);return Math.min(c,n.maxX)-Math.max(a,n.minX)>o}}function Sct(e,t,n,o){for(let[r,i]of Object.entries(t)){let s=i.tracePath;for(let a=0;a<s.length-1;a++){if(r===n&&a===o)continue;if(Rv(s[a],s[a+1],e))return{hasIntersection:!0,mspPairId:r,segIndex:a}}}return{hasIntersection:!1}}function Myn(e){let t=0,n=e.tracePath;for(let o=0;o<n.length-1;o++)t+=Math.abs(n[o+1].x-n[o].x)+Math.abs(n[o+1].y-n[o].y);return t}function z7n(e){let{inputProblem:t,inputTraceMap:n,globalConnNetId:o,fallbackTrace:r,mspConnectionPairIds:i}=e,s=Object.fromEntries(t.chips.map((u)=>[u.chipId,u])),a=Object.values(n).filter((u)=>u.globalConnNetId===o);if(i&&i.length>0){let u=new Set(i);a=a.filter((_)=>_.mspConnectionPairIds.some((p)=>u.has(p)))}let c=new Set;for(let u of a)c.add(u.pins[0].chipId),c.add(u.pins[1].chipId);let l=null,h=-1;for(let u of c){let p=s[u]?.pins?.length??0;if(p>h)h=p,l=u}let d=l==null?[]:a.filter((u)=>u.pins[0].chipId===l||u.pins[1].chipId===l);if(d.length>0)return d.reduce((u,_)=>Myn(u)>=Myn(_)?u:_);return r}function Sii(e,t){return[{x:e.x,y:e.y},{x:(e.x+t.x)/2,y:(e.y+t.y)/2},{x:t.x,y:t.y}]}function Pii(e){let{inputProblem:t,inputTraceMap:n,chipObstacleSpatialIndex:o,overlappingSameNetTraceGroup:r,availableOrientations:i,netLabelWidth:s,netLabelHeight:a}=e,c=r.portOnlyPinId;if(!c)return{placement:null,testedCandidates:[],error:"No portOnlyPinId provided"};let l=null,h=null;for(let I of t.chips){let v=I.pins.find((P)=>P.pinId===c);if(v){l={x:v.x,y:v.y},h=v._facingDirection||E6(v,I);break}}if(!l||!h)return{placement:null,testedCandidates:[],error:`Port-only pin not found: ${c}`};let d=i.length>0?i:["x+","x-","y+","y-"],u={x:l.x,y:l.y},_=(I)=>I==="x+"?{x:1,y:0}:I==="x-"?{x:-1,y:0}:I==="y+"?{x:0,y:1}:{x:0,y:-1},p=[];for(let I of d){let{width:v,height:P}=bv({orientation:I,netLabelWidth:s,netLabelHeight:a}),M=x2(u,I,v,P),B=_(I),T=0.001,N={x:M.x+B.x*0.001,y:M.y+B.y*0.001},D=Ui(N,v,P);if(o.getChipsInBounds(D).length>0){p.push({center:N,width:v,height:P,bounds:D,anchor:u,orientation:I,status:"chip-collision",hostSegIndex:-1});continue}if(JZ(D,t)){p.push({center:N,width:v,height:P,bounds:D,anchor:u,orientation:I,status:"text-collision",hostSegIndex:-1});continue}if(Sct(D,n,"",-1).hasIntersection){p.push({center:N,width:v,height:P,bounds:D,anchor:u,orientation:I,status:"trace-collision",hostSegIndex:-1});continue}return p.push({center:N,width:v,height:P,bounds:D,anchor:u,orientation:I,status:"ok",hostSegIndex:-1}),{placement:{globalConnNetId:r.globalConnNetId,dcConnNetId:void 0,netId:r.netId,netLabelText:r.netLabelText,mspConnectionPairIds:[],pinIds:[c],orientation:I,anchorPoint:u,width:v,height:P,center:N},testedCandidates:p}}let m=h,{width:A,height:g}=bv({orientation:m,netLabelWidth:s}),f=x2(u,m,A,g),y=_(m),x=0.001,C={x:f.x+y.x*x,y:f.y+y.y*x};return{placement:{globalConnNetId:r.globalConnNetId,dcConnNetId:void 0,netId:r.netId,netLabelText:r.netLabelText,mspConnectionPairIds:[],pinIds:[c],orientation:m,anchorPoint:u,width:A,height:g,center:C},testedCandidates:p}}function Eii(e){let t=Bp(e.inputProblem),n=e.overlappingSameNetTraceGroup.globalConnNetId,o=z7n({inputProblem:e.inputProblem,inputTraceMap:e.inputTraceMap,globalConnNetId:n,fallbackTrace:e.overlappingSameNetTraceGroup.overlappingTraces}),r=Vc(n,0.9),i=Vc(n,0.5);for(let s of Object.values(e.inputTraceMap)){let a=o?s.mspPairId===o.mspPairId:!1;t.lines.push({points:s.tracePath})}for(let s of e.testedCandidates){let a=s.status==="ok"?"rgba(0, 180, 0, 0.25)":s.status==="chip-collision"?"rgba(220, 0, 0, 0.25)":s.status==="trace-collision"?"rgba(220, 140, 0, 0.25)":s.status==="text-collision"?"rgba(160, 0, 220, 0.2)":"rgba(120, 120, 120, 0.15)",c=s.status==="ok"?"green":s.status==="chip-collision"?"red":s.status==="trace-collision"?"orange":s.status==="text-collision"?"purple":"gray",l=s.status==="ok"?"status: ok(valid net label candidate)":s.status==="chip-collision"?"status: chip-collision":s.status==="trace-collision"?"status: trace-collision":s.status==="text-collision"?"status: text-collision":"status: parallel-to-segment";t.rects.push({center:{x:(s.bounds.minX+s.bounds.maxX)/2,y:(s.bounds.minY+s.bounds.maxY)/2},width:s.width,height:s.height,fill:a,strokeColor:c,label:`${l}
orientation: ${s.orientation}`}),t.points.push({x:s.anchor.x,y:s.anchor.y,color:c,label:`anchor
orientation: ${s.orientation}`})}if(e.netLabelPlacement){let s=e.netLabelPlacement;t.rects.push({center:s.center,width:s.width,height:s.height,fill:"rgba(0, 128, 255, 0.35)",strokeColor:"blue",label:`netId: ${s.netId}
globalConnNetId: ${s.globalConnNetId}`}),t.points.push({x:s.anchorPoint.x,y:s.anchorPoint.y,color:"blue",label:`anchor
orientation: ${s.orientation}`})}return t}var wyn=class extends Gu{inputProblem;inputTraceMap;overlappingSameNetTraceGroup;availableOrientations;chipObstacleSpatialIndex;netLabelWidth;netLabelHeight;netLabelPlacement=null;testedCandidates=[];constructor(e){super();this.inputProblem=e.inputProblem,this.inputTraceMap=e.inputTraceMap,this.overlappingSameNetTraceGroup=e.overlappingSameNetTraceGroup,this.availableOrientations=e.availableOrientations,this.netLabelWidth=e.netLabelWidth,this.netLabelHeight=e.netLabelHeight,this.chipObstacleSpatialIndex=e.inputProblem._chipObstacleSpatialIndex??new u7e(e.inputProblem.chips)}getConstructorParams(){return{inputProblem:this.inputProblem,inputTraceMap:this.inputTraceMap,overlappingSameNetTraceGroup:this.overlappingSameNetTraceGroup,availableOrientations:this.availableOrientations,netLabelWidth:this.netLabelWidth,netLabelHeight:this.netLabelHeight}}_step(){if(this.netLabelPlacement){this.solved=!0;return}if(this.overlappingSameNetTraceGroup.portOnlyPinId){let d=Pii({inputProblem:this.inputProblem,inputTraceMap:this.inputTraceMap,chipObstacleSpatialIndex:this.chipObstacleSpatialIndex,overlappingSameNetTraceGroup:this.overlappingSameNetTraceGroup,availableOrientations:this.availableOrientations,netLabelWidth:this.netLabelWidth,netLabelHeight:this.netLabelHeight});if(this.testedCandidates.push(...d.testedCandidates),d.placement){this.netLabelPlacement=d.placement,this.solved=!0;return}this.failed=!0,this.error=d.error??"Could not place net label at port without collisions";return}let e=this.overlappingSameNetTraceGroup.globalConnNetId,t=z7n({inputProblem:this.inputProblem,inputTraceMap:this.inputTraceMap,globalConnNetId:e,fallbackTrace:this.overlappingSameNetTraceGroup.overlappingTraces,mspConnectionPairIds:this.overlappingSameNetTraceGroup.mspConnectionPairIds});if(!t){this.failed=!0,this.error="No host trace found for net label placement";return}let n=new Set(this.overlappingSameNetTraceGroup.mspConnectionPairIds??[]),o=Object.values(this.inputTraceMap).filter((d)=>d.globalConnNetId===e&&(n.size===0||d.mspConnectionPairIds.some((u)=>n.has(u)))),r=this.availableOrientations.length===1?[t,...o.filter((d)=>d.mspPairId!==t.mspPairId)]:[t],i=this.availableOrientations.length>0?this.availableOrientations:["x+","x-","y+","y-"],s=this.availableOrientations.length===1,a=(d,u)=>{switch(d){case"y+":return u.y;case"y-":return-u.y;case"x+":return u.x;case"x-":return-u.x}},c=null,l=-1/0,h=0.000001;for(let d of r){let u=d.tracePath.slice();for(let _=0;_<u.length-1;_++){let p=u[_],m=u[_+1],A=Math.abs(p.y-m.y)<h,g=Math.abs(p.x-m.x)<h;if(!A&&!g)continue;let f=A?["y+","y-"]:["x+","x-"],y=i.filter((C)=>f.includes(C));if(y.length===0)continue;let x=Sii(p,m);for(let C of x)for(let b of y){let{width:I,height:v}=bv({orientation:b,netLabelWidth:this.netLabelWidth,netLabelHeight:this.netLabelHeight}),P=x2(C,b,I,v),M=b==="x+"?{x:1,y:0}:b==="x-"?{x:-1,y:0}:b==="y+"?{x:0,y:1}:{x:0,y:-1},B=0.0001,T={x:P.x+M.x*0.0001,y:P.y+M.y*0.0001},N=Ui(T,I,v);if(this.chipObstacleSpatialIndex.getChipsInBounds(N).length>0){this.testedCandidates.push({center:T,width:I,height:v,bounds:N,anchor:C,orientation:b,status:"chip-collision",hostSegIndex:_});continue}if(JZ(N,this.inputProblem)){this.testedCandidates.push({center:T,width:I,height:v,bounds:N,anchor:C,orientation:b,status:"text-collision",hostSegIndex:_});continue}if(Sct(N,this.inputTraceMap,d.mspPairId,_).hasIntersection){this.testedCandidates.push({center:T,width:I,height:v,bounds:N,anchor:C,orientation:b,status:"trace-collision",hostSegIndex:_});continue}if(this.testedCandidates.push({center:T,width:I,height:v,bounds:N,anchor:C,orientation:b,status:"ok",hostSegIndex:_}),s){let H=a(b,C);if(H>l+0.000000001)l=H,c={anchor:C,orientation:b,width:I,height:v,center:P,hostSegIndex:_,dcConnNetId:d.dcConnNetId,mspPairId:d.mspPairId,pinIds:[d.pins[0].pinId,d.pins[1].pinId]};continue}this.netLabelPlacement={globalConnNetId:this.overlappingSameNetTraceGroup.globalConnNetId,dcConnNetId:d.dcConnNetId,netId:this.overlappingSameNetTraceGroup.netId,netLabelText:this.overlappingSameNetTraceGroup.netLabelText,mspConnectionPairIds:[d.mspPairId],pinIds:[d.pins[0].pinId,d.pins[1].pinId],orientation:b,anchorPoint:C,width:I,height:v,center:P},this.solved=!0;return}}}if(s&&c){this.netLabelPlacement={globalConnNetId:this.overlappingSameNetTraceGroup.globalConnNetId,dcConnNetId:c.dcConnNetId,netId:this.overlappingSameNetTraceGroup.netId,netLabelText:this.overlappingSameNetTraceGroup.netLabelText,mspConnectionPairIds:[c.mspPairId],pinIds:c.pinIds,orientation:c.orientation,anchorPoint:c.anchor,width:c.width,height:c.height,center:c.center},this.solved=!0;return}this.failed=!0,this.error="Could not place net label without collisions"}visualize(){return Eii(this)}};var g8e=({pinIds:e,traces:t})=>{let n=new Map;for(let s of e)n.set(s,new Set);let o=t.filter((s)=>{if(s.pins.length!==2)return!1;let[a,c]=s.pins;return n.has(a.pinId)&&n.has(c.pinId)});for(let s of o){let[a,c]=s.pins;n.get(a.pinId).add(c.pinId),n.get(c.pinId).add(a.pinId)}let r=[],i=new Set;for(let s of e){if(i.has(s))continue;let a=[],c=[s];i.add(s);while(c.length>0){let h=c.pop();a.push(h);for(let d of n.get(h)??[]){if(i.has(d))continue;i.add(d),c.push(d)}}let l=new Set(a);r.push({pinIds:a,traces:o.filter((h)=>h.pins.every((d)=>l.has(d.pinId)))})}return r},Byn=class extends Gu{inputProblem;inputTraceMap;overlappingSameNetTraceGroups;queuedOverlappingSameNetTraceGroups;netLabelPlacements=[];failedGroups=[];currentGroup=null;triedAnyOrientationFallbackForCurrentGroup=!1;constructor(e){super();this.inputProblem=e.inputProblem,this.inputTraceMap=e.inputTraceMap,this.overlappingSameNetTraceGroups=this.computeOverlappingSameNetTraceGroups(),this.queuedOverlappingSameNetTraceGroups=[...this.overlappingSameNetTraceGroups]}computeOverlappingSameNetTraceGroups(){let e={};for(let c of Object.values(this.inputTraceMap)){let l=c.globalConnNetId;if(!e[l])e[l]=[];e[l].push(c)}let{netConnMap:t}=S6(this.inputProblem),n=new Map;for(let c of this.inputProblem.chips)for(let l of c.pins)n.set(l.pinId,l);let o={},r={};for(let c of this.inputProblem.directConnections){if(c.netId){let[h,d]=c.pinIds;o[h]=c.netId,o[d]=c.netId}let l=c.netLabelText?.trim();if(l){let[h,d]=c.pinIds;r[h]=l,r[d]=l}}for(let c of this.inputProblem.netConnections)for(let l of c.pinIds){o[l]=c.netId;let h=c.netLabelText?.trim();if(h)r[l]=h}let i=[],s=this.inputProblem.chips.flatMap((c)=>c.pins.map((l)=>l.pinId)),a=new Set;for(let c of s){let l=t.getNetConnectedToId(c);if(l)a.add(l)}for(let c of a){let h=t.getIdsConnectedToNet(c).filter((d)=>n.has(d));for(let d of g8e({pinIds:h,traces:e[c]??[]})){let u=new Set(d.pinIds),_=d.traces;if(_.length>0){if(_.some((x)=>x.suppressNetLabel))continue;let p=(x)=>{let C=0,b=x.tracePath;for(let I=0;I<b.length-1;I++)C+=Math.abs(b[I+1].x-b[I].x)+Math.abs(b[I+1].y-b[I].y);return C},m=_[0],A=p(m);for(let x=1;x<_.length;x++){let C=p(_[x]);if(C>A)m=_[x],A=C}let g=_.find((x)=>x.userNetId!=null)?.userNetId;if(!g){for(let x of u)if(o[x]){g=o[x];break}}let f=Array.from(new Set(_.flatMap((x)=>x.mspConnectionPairIds??[x.mspPairId]))),y={globalConnNetId:c,netId:g,netLabelText:[...u].map((x)=>r[x]).find((x)=>Boolean(x)),overlappingTraces:m,mspConnectionPairIds:f};i.push(y)}else for(let p of u){let m=o[p];if(!m)continue;i.push({globalConnNetId:c,netId:m,netLabelText:r[p],portOnlyPinId:p})}}}return i}getNetLabelWidthForGroup(e){let t=e.overlappingTraces?.pins.map((n)=>n.pinId)??[];if(e.portOnlyPinId)t.push(e.portOnlyPinId);return gP({inputProblem:this.inputProblem,netId:e.netId,pinIds:t,isPortOnlyLabel:e.portOnlyPinId!==void 0})}getNetLabelHeightForGroup(e){if(e.netId){let n=this.inputProblem.netConnections.find((o)=>o.netId===e.netId)?.netLabelHeight;if(n!==void 0)return n}let t=e.overlappingTraces?.pins.map((n)=>n.pinId)??[];if(e.portOnlyPinId)t.push(e.portOnlyPinId);return this.inputProblem.netConnections.find((n)=>n.pinIds.some((o)=>t.includes(o)))?.netLabelHeight}_step(){if(this.activeSubSolver?.solved){this.netLabelPlacements.push(this.activeSubSolver.netLabelPlacement),this.activeSubSolver=null,this.currentGroup=null,this.triedAnyOrientationFallbackForCurrentGroup=!1;return}if(this.activeSubSolver?.failed){let r=["x+","x-","y+","y-"],i=this.activeSubSolver.availableOrientations,s=i.length===4&&r.every((a)=>i.includes(a));if(!this.triedAnyOrientationFallbackForCurrentGroup&&!s&&this.currentGroup){this.triedAnyOrientationFallbackForCurrentGroup=!0;let a=this.getNetLabelWidthForGroup(this.currentGroup),c=this.getNetLabelHeightForGroup(this.currentGroup);this.activeSubSolver=new wyn({inputProblem:this.inputProblem,inputTraceMap:this.inputTraceMap,overlappingSameNetTraceGroup:this.currentGroup,availableOrientations:r,netLabelWidth:a,netLabelHeight:c});return}if(this.currentGroup)this.failedGroups.push(this.currentGroup);this.activeSubSolver=null,this.currentGroup=null,this.triedAnyOrientationFallbackForCurrentGroup=!1;return}if(this.activeSubSolver){this.activeSubSolver.step();return}let e=this.queuedOverlappingSameNetTraceGroups.shift();if(!e){this.solved=!0;return}let t=e.netId??e.globalConnNetId;this.currentGroup=e,this.triedAnyOrientationFallbackForCurrentGroup=!1;let n=this.getNetLabelWidthForGroup(this.currentGroup),o=this.getNetLabelHeightForGroup(this.currentGroup);this.activeSubSolver=new wyn({inputProblem:this.inputProblem,inputTraceMap:this.inputTraceMap,overlappingSameNetTraceGroup:e,availableOrientations:this.inputProblem.availableNetLabelOrientations[t]??["x+","x-","y+","y-"],netLabelWidth:n,netLabelHeight:o})}visualize(){if(this.activeSubSolver)return this.activeSubSolver.visualize();let e=Bp(this.inputProblem);for(let t of Object.values(this.inputTraceMap))e.lines.push({points:t.tracePath,strokeColor:"purple"});for(let t of this.netLabelPlacements)e.rects.push({center:t.center,width:t.width,height:t.height,fill:Vc(t.globalConnNetId,0.35),strokeColor:Vc(t.globalConnNetId,0.9),label:`netId: ${t.netId}
globalConnNetId: ${t.globalConnNetId}`}),e.points.push({x:t.anchorPoint.x,y:t.anchorPoint.y,color:Vc(t.globalConnNetId,0.9),label:`anchorPoint
orientation: ${t.orientation}`});return e}},Mii="#ef4444",wii="#000000",Bii="66",Tii=(e,t)=>{let n=t.availableNetLabelOrientations;if(!n)return;for(let o of e.rects??[]){let r=Dii(o.label,n);if(!r)continue;let i=r.includes("y+"),s=r.includes("y-");if(i===s)continue;let a=i?Mii:wii;o.fill=`${a}${Bii}`,o.stroke=a,o.color=a}},Dii=(e,t)=>{for(let n of Nii(e))if(Object.hasOwn(t,n))return t[n];return},Nii=(e)=>{if(!e)return[];return[e.match(/^netId: (.+)$/m)?.[1],e.match(/^globalConnNetId: (.+)$/m)?.[1]].filter((t)=>Boolean(t&&t!=="undefined"))},Rii=({labels:e,chips:t})=>{let n={},o=new Map(t.flatMap((r)=>r.pins.map((i)=>[i.pinId,r.chipId])));for(let r of e){if(r.pinIds.length===0)continue;let i=r.pinIds[0],a=(i.includes(".")?i.split(".")[0]:void 0)??o.get(i);if(!a)continue;let c=`${a}-${r.orientation}`;if(!n[c])n[c]=[];n[c].push(r)}return n},Qii=(e,t)=>{if(e.length===0)throw Error("Cannot merge an empty group of labels.");let n=1/0,o=1/0,r=-1/0,i=-1/0,s=new Set,a=new Set,c=new Set;for(let m of e){let A=Ui(m.center,m.width,m.height);n=Math.min(n,A.minX),o=Math.min(o,A.minY),r=Math.max(r,A.maxX),i=Math.max(i,A.maxY),m.pinIds.forEach((g)=>s.add(g)),m.mspConnectionPairIds.forEach((g)=>a.add(g)),c.add(m.globalConnNetId)}let l=r-n,h=i-o,d={x:n+l/2,y:o+h/2},u=e[0],_=`merged-group-${t}`;return{mergedLabel:{...u,globalConnNetId:_,center:d,width:l,height:h,pinIds:Array.from(s),mspConnectionPairIds:Array.from(a)},originalNetIds:c}},kii=({labels:e,traces:t,distanceThreshold:n=0.5})=>{let o=new Map;if(!t)throw Error("No traces provided to filterLabelsAtTraceEdges");for(let i of t){if(!i.globalConnNetId)continue;if(!o.has(i.globalConnNetId))o.set(i.globalConnNetId,[]);o.get(i.globalConnNetId).push(i)}let r=[];for(let i of e){if(i.mspConnectionPairIds.length===0){r.push(i);continue}let s=o.get(i.globalConnNetId),a=!1;if(!s||s.length===0)continue;for(let c of s){if(c.tracePath.length===0)continue;let l=c.tracePath[0],h=c.tracePath[c.tracePath.length-1],d=Dv(i.center,l),u=Dv(i.center,h);if(d<=n||u<=n){a=!0;break}}if(a)r.push(i)}return r},Tyn=class extends Gu{input;output;inputProblem;traces;pipelineStep="filtering_labels";filteredLabels=[];labelGroups={};groupKeysToProcess=[];finalPlacements=[];mergedLabelNetIdMap={};activeMergingGroupKey=null;constructor(e){super();this.input=e,this.inputProblem=e.inputProblem,this.traces=e.traces,this.output={netLabelPlacements:e.netLabelPlacements,mergedLabelNetIdMap:{}}}_step(){switch(this.pipelineStep){case"filtering_labels":this.filteredLabels=kii({labels:this.input.netLabelPlacements,traces:this.traces}),this.pipelineStep="grouping_labels";break;case"grouping_labels":this.labelGroups=Rii({labels:this.filteredLabels,chips:this.inputProblem.chips}),this.groupKeysToProcess=Object.keys(this.labelGroups),this.pipelineStep="merging_groups";break;case"merging_groups":if(this.groupKeysToProcess.length===0){this.pipelineStep="finalizing",this.activeMergingGroupKey=null;break}let e=this.groupKeysToProcess.pop();this.activeMergingGroupKey=e;let t=this.labelGroups[e];if(t.length>1){let{mergedLabel:r,originalNetIds:i}=Qii(t,e);this.finalPlacements.push(r),this.mergedLabelNetIdMap[r.globalConnNetId]=i}else this.finalPlacements.push(...t);break;case"finalizing":let n=new Set(this.finalPlacements.flatMap((r)=>this.mergedLabelNetIdMap[r.globalConnNetId]?[...this.mergedLabelNetIdMap[r.globalConnNetId]]:[r.globalConnNetId])),o=this.input.netLabelPlacements.filter((r)=>!n.has(r.globalConnNetId));this.output={netLabelPlacements:[...this.finalPlacements,...o],mergedLabelNetIdMap:this.mergedLabelNetIdMap},this.solved=!0;break}}getOutput(){return this.output}visualize(){let e=Bp(this.inputProblem,{chipAlpha:0.1,connectionAlpha:0.1});if(!e.rects)e.rects=[];if(!e.lines)e.lines=[];if(!e.points)e.points=[];if(!e.texts)e.texts=[];let t=new Map;for(let n of this.input.netLabelPlacements)t.set(n.globalConnNetId,n);for(let n of this.traces){let o={points:n.tracePath.map((r)=>({x:r.x,y:r.y})),strokeColor:"blue"};e.lines.push(o)}if(this.activeMergingGroupKey&&this.labelGroups[this.activeMergingGroupKey]){let n=this.labelGroups[this.activeMergingGroupKey];for(let o of n)e.rects.push({center:o.center,width:o.width,height:o.height,fill:"rgba(255, 165, 0, 0.5)",stroke:"orange"})}for(let n of this.output.netLabelPlacements){let o=n.globalConnNetId.startsWith("merged-group-"),r=Vc(n.globalConnNetId);if(o){e.rects.push({center:n.center,width:n.width,height:n.height,fill:r.replace(/, 1\)/,", 0.2)"),stroke:r,label:n.globalConnNetId});let i=this.output.mergedLabelNetIdMap[n.globalConnNetId];if(i)for(let s of i){let a=t.get(s);if(a){let c=Ui(a.center,a.width,a.height),l={x:c.minX,y:c.minY},h={x:c.maxX,y:c.minY},d={x:c.maxX,y:c.maxY},u={x:c.minX,y:c.maxY};e.lines.push({points:[l,h,d,u,l],strokeColor:r,strokeDash:"4 4"}),e.lines.push({points:[a.center,n.center],strokeColor:r,strokeDash:"2 2"})}}}else e.rects.push({center:n.center,width:n.width,height:n.height,stroke:r,label:n.globalConnNetId})}return e}},Mp=({traces:e,netLabels:t=[]})=>{let n=[];for(let o of e)for(let r of t){let i=Ui(r.center,r.width,r.height);for(let s=0;s<o.tracePath.length-1;s++){let a=o.tracePath[s],c=o.tracePath[s+1];if(Rv(a,c,i)){if(o.globalConnNetId===r.globalConnNetId)break;n.push({trace:o,label:r});break}}}return n},Lii=({path:e,labelBounds:t,paddedBounds:n=t})=>{let o=-1,r=-1;for(let c=0;c<e.length-1;c++)if(Rv(e[c],e[c+1],t)){if(o===-1)o=c;r=c}if(o===-1)return{firstInsideIndex:-1,lastInsideIndex:-1};let i=(c)=>c.x>n.minX&&c.x<n.maxX&&c.y>n.minY&&c.y<n.maxY,s=o;while(s>0&&i(e[s]))s--;let a=r+1;while(a<e.length-1&&i(e[a]))a++;return{firstInsideIndex:s+1,lastInsideIndex:a-1}},Hii=({initialTrace:e,firstInsideIndex:t,lastInsideIndex:n,labelBounds:o,paddingBuffer:r,detourCount:i})=>{if(t<=0||n>=e.tracePath.length-1)return[];let s=e.tracePath[t-1],a=e.tracePath[n+1],c=e.tracePath.slice(0,t),l=e.tracePath.slice(n+1),h=[];if(s.x!==a.x&&s.y!==a.y)h.push([{x:a.x,y:s.y}]),h.push([{x:s.x,y:a.y}]);else if(s.x===a.x||s.y===a.y)h.push([]);let d=r+i*r,u=o.minX-d,_=o.maxX+d,p=o.maxY+d,m=o.minY-d;if((s.x<=o.minX||a.x<=o.minX)&&s.x<o.maxX&&a.x<o.maxX)h.push([{x:u,y:s.y},{x:u,y:a.y}]);if((s.x>=o.maxX||a.x>=o.maxX)&&s.x>o.minX&&a.x>o.minX)h.push([{x:_,y:s.y},{x:_,y:a.y}]);if((s.y>=o.maxY||a.y>=o.maxY)&&s.y>o.minY&&a.y>o.minY)h.push([{x:s.x,y:p},{x:a.x,y:p}]);if((s.y<=o.minY||a.y<=o.minY)&&s.y<o.maxY&&a.y<o.maxY)h.push([{x:s.x,y:m},{x:a.x,y:m}]);return h.map((A)=>[...c,...A,...l])},Fii=({initialTrace:e,label:t,labelBounds:n,paddingBuffer:o,detourCount:r})=>{let i=t.globalConnNetId.startsWith("merged-group-"),s=o+r*o,a={minX:n.minX-s,maxX:n.maxX+s,minY:n.minY-s,maxY:n.maxY+s},c,l,h,d,u=(A)=>A.x>=a.minX&&A.x<=a.maxX&&A.y>=a.minY&&A.y<=a.maxY;if(i){let A=-1;for(let f=0;f<e.tracePath.length;f++)if(u(e.tracePath[f])){A=f;break}if(A===-1)return[];h=Math.max(0,A-1),c=e.tracePath[h];let g=-1;for(let f=A;f<e.tracePath.length;f++)if(!u(e.tracePath[f])){g=f;break}if(g===-1)d=e.tracePath.length-1;else d=g;l=e.tracePath[d]}else{let A=-1,g=-1;for(let f=0;f<e.tracePath.length-1;f++)if(D1(e.tracePath[f],e.tracePath[f+1],{...n,chipId:"temp-obstacle"})){if(A===-1)A=f;g=f}if(A===-1)return[];h=A,d=g+1,c=e.tracePath[h],l=e.tracePath[d]}if(!c||!l||h>=d)return[];let _=[],p=l.x-c.x,m=l.y-c.y;if(Math.abs(p)>Math.abs(m)){let A=[a.maxY,a.minY];for(let g of A)_.push(p>0?[{x:a.minX,y:c.y},{x:a.minX,y:g},{x:a.maxX,y:g},{x:a.maxX,y:l.y}]:[{x:a.maxX,y:c.y},{x:a.maxX,y:g},{x:a.minX,y:g},{x:a.minX,y:l.y}])}else{let A=[a.maxX,a.minX];for(let g of A)_.push(m>0?[{x:c.x,y:a.minY},{x:g,y:a.minY},{x:g,y:a.maxY},{x:l.x,y:a.maxY}]:[{x:c.x,y:a.maxY},{x:g,y:a.maxY},{x:g,y:a.minY},{x:l.x,y:a.minY}])}return _.map((A)=>[...e.tracePath.slice(0,h),c,...A,l,...e.tracePath.slice(d+1)])},Mi=(e)=>{if(e.length<3)return e;let t=[e[0]];for(let o=1;o<e.length-1;o++){let r=t[t.length-1],i=e[o],s=e[o+1];if(lf(r,i)&&lf(i,s)||tA(r,i)&&tA(i,s))continue;t.push(i)}if(t.push(e[e.length-1]),t.length<3)return t;let n=[t[0]];for(let o=1;o<t.length-1;o++){let r=n[n.length-1],i=t[o],s=t[o+1];if(lf(r,i)&&lf(i,s)||tA(r,i)&&tA(i,s))continue;n.push(i)}return n.push(t[t.length-1]),n},O7n=({trace:e,label:t,paddingBuffer:n,detourCount:o})=>{let r={...e,tracePath:Mi(e.tracePath)};if(e.globalConnNetId===t.globalConnNetId)return[r.tracePath];let i=Ui(t.center,t.width,t.height),s={minX:i.minX,minY:i.minY,maxX:i.maxX,maxY:i.maxY,chipId:`netlabel-${t.netId}`},a=Fii({initialTrace:r,label:t,labelBounds:s,paddingBuffer:n,detourCount:o}),c=n+o*n,l={minX:s.minX-c,maxX:s.maxX+c,minY:s.minY-c,maxY:s.maxY+c},{firstInsideIndex:h,lastInsideIndex:d}=Lii({path:r.tracePath,labelBounds:s,paddedBounds:l}),u=Hii({initialTrace:r,firstInsideIndex:h,lastInsideIndex:d,labelBounds:s,paddingBuffer:n,detourCount:o});return[...a,...u]},yP=0.002,zii=0.000001,V7n=0.02,Y7n=V7n+zii,Oii=V7n*3,fL=(e,t)=>G7n(e,t.map((n)=>n.tracePath)),G7n=(e,t)=>{let n=(o,r,i,s)=>Math.min(Math.max(o,r),Math.max(i,s))-Math.max(Math.min(o,r),Math.min(i,s))>yP;for(let o=0;o<e.length-1;o++){let r=e[o],i=e[o+1],s=Math.abs(r.x-i.x)<yP,a=Math.abs(r.y-i.y)<yP;if(!s&&!a)continue;let c=s?"x":"y",l=s?"y":"x";for(let h of t)for(let d=0;d<h.length-1;d++){let u=h[d],_=h[d+1];if(!(Math.abs(u[c]-_[c])<yP))continue;if(!(Math.abs(r[c]-u[c])<yP))continue;if(n(r[l],i[l],u[l],_[l]))return!0}}return!1},U7n=(e,t)=>{let n=Y7n/2,o=(r,i,s)=>s?{minX:r.x-n,maxX:r.x+n,minY:Math.min(r.y,i.y),maxY:Math.max(r.y,i.y)}:{minX:Math.min(r.x,i.x),maxX:Math.max(r.x,i.x),minY:r.y-n,maxY:r.y+n};for(let r=0;r<e.length-1;r++){let i=e[r],s=e[r+1],a=Math.abs(i.x-s.x)<yP,c=Math.abs(i.y-s.y)<yP;if(!a&&!c)continue;let l=o(i,s,a);for(let h of t)for(let d=0;d<h.tracePath.length-1;d++){let u=h.tracePath[d],_=h.tracePath[d+1];if(!(a?Math.abs(u.x-_.x)<yP:Math.abs(u.y-_.y)<yP))continue;let m=D7n(l,o(u,_,a));if(!m)continue;if((a?m.maxY-m.minY:m.maxX-m.minX)>yP)return!0}}return!1},Vii=5,Yii=0.000000001,Dyn=(e)=>{let t=0;for(let n=0;n<e.length-1;n++){let o=e[n],r=e[n+1];t+=Math.abs(r.x-o.x)+Math.abs(r.y-o.y)}return t},_ve=class extends Gu{queuedCandidatePaths;solvedTracePath=null;initialTrace;problem;obstacles;label;tracesToAvoidOverlapping;netLabelPlacements;detourCount;_tried=0;constructor(e){super();this.initialTrace=e.trace,this.problem=e.problem,this.label=e.label,this.detourCount=e.detourCount,this.tracesToAvoidOverlapping=(e.tracesToAvoidOverlapping??[]).filter((i)=>i.globalConnNetId!==e.trace.globalConnNetId),this.netLabelPlacements=e.netLabelPlacements??[e.label],this.obstacles=Cx(this.problem);let t=e.paddingBuffer+e.detourCount*e.paddingBuffer,n=O7n({...e,paddingBuffer:t}),o=(i)=>Mp({traces:[{...this.initialTrace,tracePath:i}],netLabels:this.netLabelPlacements}).length,r=new Map;for(let i of n){let s=Mi(i);r.set(s.map((a)=>`${a.x},${a.y}`).join(";"),s)}this.queuedCandidatePaths=[...r.values()].sort((i,s)=>{let a=Dyn(i)-Dyn(s);if(Math.abs(a)>=Yii)return a;let c=o(i)-o(s);if(c!==0)return c;return i.length-s.length})}_step(){if(this.queuedCandidatePaths.length===0||this._tried>=Vii){this.failed=!0;return}this._tried++;let e=this.queuedCandidatePaths.shift(),t=Mi(e),n=Mp({traces:[{...this.initialTrace,tracePath:t}],netLabels:[this.label]}).length>0,o=Mi(this.initialTrace.tracePath),r=Mp({traces:[{...this.initialTrace,tracePath:o}],netLabels:this.netLabelPlacements}),i=Mp({traces:[{...this.initialTrace,tracePath:t}],netLabels:this.netLabelPlacements});if(!n&&i.length<=r.length&&!ZZ(t,this.obstacles)&&!fL(t,this.tracesToAvoidOverlapping))this.solvedTracePath=t,this.solved=!0}visualize(){let e=Bp(this.problem,{chipAlpha:0.1,connectionAlpha:0.1});if(!e.lines)e.lines=[];if(!e.rects)e.rects=[];if(e.lines.push({points:this.initialTrace.tracePath,strokeColor:"red",strokeDash:"4 4"}),e.rects.push({center:this.label.center,width:this.label.width,height:this.label.height,fill:"rgba(255, 0, 0, 0.2)"}),!this.solvedTracePath&&this.queuedCandidatePaths.length>0)e.lines.push({points:this.queuedCandidatePaths[0],strokeColor:"orange"});if(this.solvedTracePath)e.lines.push({points:this.solvedTracePath,strokeColor:"green"});return e}},Gii=({trace:e,label:t})=>{if(e.tracePath.length<2)return!1;let n={...e,tracePath:[e.tracePath[0],e.tracePath[1]]};if(Mp({traces:[n],netLabels:[t]}).length>0)return!0;if(e.tracePath.length>2){let r=e.tracePath[e.tracePath.length-1],i=e.tracePath[e.tracePath.length-2],s={...e,tracePath:[i,r]};if(Mp({traces:[s],netLabels:[t]}).length>0)return!0}return!1},Uii=(e)=>{let{decomposedChildLabels:t,collidingTrace:n,mergedLabel:o,graphics:r}=e;if(!r.rects)r.rects=[];if(!r.texts)r.texts=[];for(let i of t){let s=i.globalConnNetId===n.globalConnNetId;r.rects.push({center:i.center,width:i.width,height:i.height,fill:s?"green":"red"})}return r.texts.push({x:o.center.x,y:o.center.y+o.height/2+0.5,text:`DECOMPOSITION: Trace ${n.mspPairId} vs Merged Label ${o.globalConnNetId}`,fontSize:0.3,color:"blue"}),r},Wii=class extends Gu{inputProblem;initialNetLabelPlacements;mergedNetLabelPlacements;mergedLabelNetIdMap;allTraces;tracesToAvoidOverlapping;modifiedTraces=[];completedReroutes=[];PADDING_BUFFER=0.1;detourCounts=new Map;activeSubSolver=null;overlapQueue=[];activeOverlap=null;recentlyFailed=new Set;currentlyProcessingOverlap=null;decomposedChildLabels=null;constructor(e){super();this.inputProblem=e.inputProblem,this.initialNetLabelPlacements=e.initialNetLabelPlacements,this.mergedNetLabelPlacements=e.mergedNetLabelPlacements,this.mergedLabelNetIdMap=e.mergedLabelNetIdMap,this.allTraces=[...e.traces],this.tracesToAvoidOverlapping=e.tracesToAvoidOverlapping??[],this.detourCounts=e.detourCounts}_step(){if(this.currentlyProcessingOverlap=null,this.decomposedChildLabels=null,this.activeSubSolver){if(this.activeSubSolver.step(),this.activeSubSolver.solved){let o=this.activeSubSolver.solvedTracePath;if(o){this.completedReroutes.push({initialTrace:{...this.activeSubSolver.initialTrace,tracePath:this.activeSubSolver.initialTrace.tracePath.map((i)=>({...i}))},reroutedTracePath:o.map((i)=>({...i})),label:this.activeSubSolver.label,detourCount:this.activeSubSolver.detourCount});let r=this.allTraces.findIndex((i)=>i.mspPairId===this.activeSubSolver.initialTrace.mspPairId);if(r!==-1)this.allTraces[r].tracePath=o,this.modifiedTraces.push(this.allTraces[r])}this.activeSubSolver=null,this.activeOverlap=null,this.recentlyFailed.clear()}else if(this.activeSubSolver.failed){let o=`${this.activeOverlap.trace.mspPairId}-${this.activeOverlap.label.globalConnNetId}`;this.recentlyFailed.add(o),this.activeSubSolver=null,this.activeOverlap=null}return}let e=Mp({traces:this.allTraces,netLabels:this.mergedNetLabelPlacements});if(e.length===0){this.solved=!0;return}let t=e.filter((o)=>{let r=`${o.trace.mspPairId}-${o.label.globalConnNetId}`;return!this.recentlyFailed.has(r)});if(t.length===0){this.solved=!0;return}this.overlapQueue=t;let n=this.overlapQueue.shift();if(this.currentlyProcessingOverlap=n??null,n){let o=this.allTraces.find((c)=>c.mspPairId===n.trace.mspPairId),r=n.label,i=this.mergedLabelNetIdMap[r.globalConnNetId];if(i?.has(o.globalConnNetId)){let c=this.initialNetLabelPlacements.filter((h)=>i.has(h.globalConnNetId));this.decomposedChildLabels=c;let l=null;for(let h of c)if(Mp({traces:[o],netLabels:[h]}).length>0){l=h;break}if(l){let h=this.detourCounts.get(l.globalConnNetId)??0;this.detourCounts.set(l.globalConnNetId,h+1),this.activeOverlap=n,this.activeSubSolver=new _ve({trace:o,label:l,problem:this.inputProblem,paddingBuffer:this.PADDING_BUFFER,detourCount:h,tracesToAvoidOverlapping:this.tracesToAvoidOverlapping,netLabelPlacements:this.initialNetLabelPlacements})}else{let h=`${o.mspPairId}-${r.globalConnNetId}`;this.recentlyFailed.add(h)}return}if(i&&Gii({trace:o,label:r})){let c=this.initialNetLabelPlacements.filter((h)=>i.has(h.globalConnNetId));this.decomposedChildLabels=c;let l=null;for(let h of c)if(Mp({traces:[o],netLabels:[h]}).length>0){l=h;break}if(l){let h=this.detourCounts.get(l.globalConnNetId)??0;this.detourCounts.set(l.globalConnNetId,h+1),this.activeOverlap=n,this.activeSubSolver=new _ve({trace:o,label:l,problem:this.inputProblem,paddingBuffer:this.PADDING_BUFFER,detourCount:h,tracesToAvoidOverlapping:this.tracesToAvoidOverlapping,netLabelPlacements:this.initialNetLabelPlacements})}else{let h=`${o.mspPairId}-${r.globalConnNetId}`;this.recentlyFailed.add(h)}return}let a=this.detourCounts.get(r.globalConnNetId)??0;this.detourCounts.set(r.globalConnNetId,a+1),this.activeOverlap=n,this.activeSubSolver=new _ve({trace:o,label:r,problem:this.inputProblem,paddingBuffer:this.PADDING_BUFFER,detourCount:a,tracesToAvoidOverlapping:this.tracesToAvoidOverlapping,netLabelPlacements:this.initialNetLabelPlacements})}}getOutput(){return{allTraces:this.allTraces,modifiedTraces:this.modifiedTraces,detourCounts:this.detourCounts}}visualize(){if(this.activeSubSolver)return this.activeSubSolver.visualize();let e=Bp(this.inputProblem);if(!e.lines)e.lines=[];for(let t of this.allTraces)e.lines.push({points:t.tracePath,strokeColor:"purple"});if(this.currentlyProcessingOverlap){let{trace:t,label:n}=this.currentlyProcessingOverlap;if(e.lines.push({points:t.tracePath,strokeColor:"red"}),this.decomposedChildLabels)Uii({decomposedChildLabels:this.decomposedChildLabels,collidingTrace:t,mergedLabel:n,graphics:e});else{if(!e.rects)e.rects=[];if(e.rects.push({center:n.center,width:n.width,height:n.height,fill:"yellow"}),!e.texts)e.texts=[];e.texts.push({x:n.center.x,y:n.center.y+n.height/2+0.5,text:`COLLISION: Trace ${t.mspPairId} vs Label ${n.globalConnNetId}`,fontSize:0.3,color:"red"})}}return e}},Xii=class extends Gu{inputProblem;netLabelPlacements;unprocessedTraces=[];cleanTraces=[];subSolvers=[];phase="searching_for_overlaps";detourCounts=new Map;labelMergingSolver;allInputTraces;constructor(e){super();this.inputProblem=e.inputProblem,this.unprocessedTraces=[...e.traces],this.allInputTraces=e.traces,this.netLabelPlacements=e.netLabelPlacements,this.cleanTraces=[],this.subSolvers=[]}_step(){if(this.phase==="searching_for_overlaps"){if(this.unprocessedTraces.length===0){this.phase="fixing_overlaps";return}let e=this.unprocessedTraces.shift(),t=Mp({traces:[e],netLabels:this.netLabelPlacements});if(t.length===0)this.cleanTraces.push(e);else{let n=t.map((s)=>s.label),o=new Tyn({netLabelPlacements:n,inputProblem:this.inputProblem,traces:[e]});o.solve();let r=o.getOutput(),i=new Wii({inputProblem:this.inputProblem,traces:[e],initialNetLabelPlacements:this.netLabelPlacements,mergedNetLabelPlacements:r.netLabelPlacements,mergedLabelNetIdMap:r.mergedLabelNetIdMap,detourCounts:this.detourCounts,tracesToAvoidOverlapping:this.allInputTraces.filter((s)=>s.mspPairId!==e.mspPairId)});this.subSolvers.push(i)}}else if(this.phase==="fixing_overlaps"){if(this.subSolvers.every((e)=>e.solved||e.failed)){if(!this.labelMergingSolver)this.labelMergingSolver=new Tyn({netLabelPlacements:this.netLabelPlacements,inputProblem:this.inputProblem,traces:this.getOutput().traces}),this.labelMergingSolver.solve();this.solved=!0;return}for(let e of this.subSolvers)if(!e.solved&&!e.failed)e.step()}}getOutput(){let e=this.subSolvers.flatMap((t)=>t.getOutput().allTraces);return{traces:[...this.cleanTraces,...e],completedReroutes:this.subSolvers.flatMap((t)=>t.completedReroutes),netLabelPlacements:this.labelMergingSolver?.getOutput().netLabelPlacements??this.netLabelPlacements}}visualize(){let e=Bp(this.inputProblem);if(!e.lines)e.lines=[];if(!e.rects)e.rects=[];for(let t of this.cleanTraces)e.lines.push({points:t.tracePath,strokeColor:"purple"});for(let t of this.subSolvers){let n=t.visualize();e.lines.push(...n.lines??[]),e.rects.push(...n.rects??[]),e.points.push(...n.points??[])}for(let t of this.netLabelPlacements){let n=Vc(t.globalConnNetId,0.3);e.rects.push({center:t.center,width:t.width,height:t.height,fill:n,stroke:n.replace("0.3","1"),label:t.globalConnNetId})}return e}},jii=(e)=>{for(let t of e.chips){let n=vct(t);for(let o of t.pins){if(!(o.x>n.minX&&o.x<n.maxX&&o.y>n.minY&&o.y<n.maxY))continue;if(o._facingDirection){if(o._facingDirection==="x-")o.x=n.minX;else if(o._facingDirection==="x+")o.x=n.maxX;else if(o._facingDirection==="y-")o.y=n.minY;else o.y=n.maxY;continue}let i=o.x-n.minX,s=n.maxX-o.x,a=o.y-n.minY,c=n.maxY-o.y,l=Math.min(i,s,a,c);if(l===i)o.x=n.minX;else if(l===s)o.x=n.maxX;else if(l===a)o.y=n.minY;else o.y=n.maxY;o._facingDirection=void 0}}};function Kii(e,t){for(let n=0;n<e.length-1;n++){let o=e[n],r=e[n+1];for(let i of t)for(let s=0;s<i.tracePath.length-1;s++){let a=i.tracePath[s],c=i.tracePath[s+1];if(K3(o,r,a,c))return!0}}return!1}var W7n=(e,t,n)=>{let o=e.maxMspPairDistance??_0e,{extendedRailPinIds:r,separatedRailPinIds:i}=k7n(e,t,o),s=new Set,a=new Set;for(let d of e.netConnections){let u=t.getNetConnectedToId(d.netId);if(!u)continue;for(let _ of d.pinIds)a.add(_);if(d.isGround)s.add(u)}let c=new Map;for(let d of e.chips){if(d.pins.length!==2||!d.pins.every((A)=>a.has(A.pinId))||d.pins.some((A)=>n.has(A.pinId)&&!r.has(A.pinId)))continue;let[u,_]=d.pins.map((A)=>t.getNetConnectedToId(A.pinId));if(!u||!_||u===_||s.has(u)===s.has(_))continue;let p=JSON.stringify([d.sectionId??null,...[u,_].sort()]),m=c.get(p)??[];m.push(d.pins.map((A)=>A.pinId)),c.set(p,m)}let l=new Set([...c.values()].filter((d)=>d.length>1).flat(2));for(let d of[...r,...i])l.add(d);let h=new p8e({});for(let d of e.directConnections)if(d.netLabelWidth===void 0)h.addConnections([d.pinIds]);return(d,u)=>{if(!l.has(d.pinId)&&!l.has(u.pinId))return!0;if(Math.abs(d.x-u.x)+Math.abs(d.y-u.y)<=o)return!0;let _=h.getNetConnectedToId(d.pinId);return _!==void 0&&_===h.getNetConnectedToId(u.pinId)}},$ii=0.000001,qii=({connection:e,sourcePin:t,targetPin:n,chipMap:o,directConnMap:r})=>{let i=o[t.chipId],s=o[n.chipId];return e.isGround===!0&&t.chipId!==n.chipId&&Math.abs(i.center.y-s.center.y)>(i.height+s.height)/2+$ii&&i.pins.length>2&&s.pins.length>2&&!r.areIdsConnected(t.pinId,n.pinId)},Jii=3,gve=(e,t)=>Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)),Zii=(e,t)=>Math.abs(e.x-t.x)+Math.abs(e.y-t.y),Cv=0.000000001,N9e=(e,t,n)=>e>=Math.min(t,n)-Cv&&e<=Math.max(t,n)+Cv,esi=(e,t,n,o)=>{let r=Math.abs(e.y-t.y)<=Cv,i=Math.abs(e.x-t.x)<=Cv,s=Math.abs(n.y-o.y)<=Cv,a=Math.abs(n.x-o.x)<=Cv;if(r&&a){let c={x:n.x,y:e.y};return N9e(c.x,e.x,t.x)&&N9e(c.y,n.y,o.y)?c:null}if(i&&s){let c={x:e.x,y:n.y};return N9e(c.y,e.y,t.y)&&N9e(c.x,n.x,o.x)?c:null}if(r&&s&&Math.abs(e.y-n.y)<=Cv){let c=Math.max(Math.min(e.x,t.x),Math.min(n.x,o.x)),l=Math.min(Math.max(e.x,t.x),Math.max(n.x,o.x));if(c>l+Cv)return null;return{x:Math.max(c,Math.min(e.x,l)),y:e.y}}if(i&&a&&Math.abs(e.x-n.x)<=Cv){let c=Math.max(Math.min(e.y,t.y),Math.min(n.y,o.y)),l=Math.min(Math.max(e.y,t.y),Math.max(n.y,o.y));if(c>l+Cv)return null;return{x:e.x,y:Math.max(c,Math.min(e.y,l))}}return null},tsi=(e,t)=>{for(let n=0;n<e.length-1;n++){let o=e[n],r=e[n+1],i=t.flatMap((c)=>c.tracePath.slice(0,-1).flatMap((l,h)=>{let d=esi(o,r,l,c.tracePath[h+1]);return d?[d]:[]}));i.sort((c,l)=>gve(o,c)-gve(o,l));let s=i[0];if(!s)continue;let a=e.slice(0,n+1);if(gve(a.at(-1),s)>Cv)a.push(s);return a}return null},nsi=class extends Gu{constructor(e){super();this.params=e;let{inputProblem:t,primaryMspConnectionPairs:n,alreadySolvedTraces:o}=this.params,r=N7n(t);this.inputProblem=t,this.allSolvedTraces=[...o],this.maxMspPairDistance=t.maxMspPairDistance??_0e;let i=new Set;for(let u of n)i.add(u.pins[0].pinId),i.add(u.pins[1].pinId);let{netConnMap:s,directConnMap:a}=S6(t);this.netConnMap=s;let c=W7n(t,s,i),l=new Map;for(let u of t.chips){this.chipMap[u.chipId]=u;for(let _ of u.pins)l.set(_.pinId,{..._,chipId:u.chipId})}this.queuedFailedConnectionPairs=this.params.failedConnectionPairs.filter((u)=>r(u.pins[0].pinId,u.pins[1].pinId)&&jri({inputProblem:this.inputProblem,chipMap:this.chipMap,pins:u.pins}));let h=[],d=new Set;for(let u of Object.keys(s.netMap)){let _=s.getIdsConnectedToNet(u);if(_.length<2)continue;let p=_.filter((m)=>!i.has(m));for(let m of p){let A=l.get(m);if(!A)continue;let g=_.filter((f)=>f!==m).flatMap((f)=>{let y=l.get(f);if(!y)return[];if(!r(A.pinId,y.pinId))return[];if(!c(A,y))return[];if(t.netConnections.some((C)=>(C.pinIds.length===2||qii({connection:C,sourcePin:A,targetPin:y,chipMap:this.chipMap,directConnMap:a}))&&C.pinIds.includes(A.pinId)&&C.pinIds.includes(y.pinId))&&Zii(A,y)>this.maxMspPairDistance)return[];return[{pin:y,distance:gve(A,y)}]}).sort((f,y)=>f.distance-y.distance).slice(0,Jii);for(let f of g){let y=[A,f.pin];if(lL(t,y[0],y[1]))continue;let x=y.map((C)=>C.pinId).sort().join("--");if(!d.has(x))h.push(y),d.add(x)}}}this.queuedCandidatePairs=h}params;solvedLongDistanceTraces=[];queuedCandidatePairs=[];currentCandidatePair=null;queuedFailedConnectionPairs=[];currentFailedConnectionPair=null;subSolver=null;chipMap={};inputProblem;netConnMap;newlyConnectedPinIds=new Set;allSolvedTraces=[];maxMspPairDistance;getConstructorParams(){return this.params}acceptFailedConnectionPair(e){let t=this.currentFailedConnectionPair;if(!t)return;let n={...t,tracePath:e,mspConnectionPairIds:[t.mspPairId],pinIds:t.pins.map((o)=>o.pinId)};this.solvedLongDistanceTraces.push(n),this.allSolvedTraces.push(n);for(let o of t.pins)this.newlyConnectedPinIds.add(o.pinId)}_step(){if(this.subSolver?.solved&&this.currentFailedConnectionPair){let t=this.subSolver.solvedTracePath;if(t)this.acceptFailedConnectionPair(t);this.subSolver=null,this.currentCandidatePair=null,this.currentFailedConnectionPair=null}else if(this.subSolver?.solved){let t=this.subSolver.solvedTracePath;if(t&&this.currentCandidatePair){let[n,o]=this.currentCandidatePair,r=this.netConnMap.getNetConnectedToId(n.pinId),i=this.allSolvedTraces.filter((p)=>p.globalConnNetId===r),s=this.inputProblem.netConnections.find((p)=>p.pinIds.length===3&&p.pinIds.includes(n.pinId)&&p.pinIds.includes(o.pinId)),a=this.chipMap[n.chipId],c=i.find((p)=>p.pinIds.includes(o.pinId)&&p.pins.every((m)=>m.chipId===o.chipId)),h=s!==void 0&&a?.pins.length===2&&c!==void 0?tsi(t,i):null,d=h??t,u=h?this.allSolvedTraces.filter((p)=>p.globalConnNetId!==r):this.allSolvedTraces;if(!Kii(d,u)){let p=`${n.pinId}-${o.pinId}`,m={mspPairId:p,dcConnNetId:r,globalConnNetId:r,pins:[n,o],tracePath:d,mspConnectionPairIds:[p],pinIds:[n.pinId,o.pinId]};this.solvedLongDistanceTraces.push(m),this.allSolvedTraces.push(m),this.newlyConnectedPinIds.add(n.pinId),this.newlyConnectedPinIds.add(o.pinId)}}this.subSolver=null,this.currentCandidatePair=null}else if(this.subSolver?.failed)this.subSolver=null,this.currentCandidatePair=null,this.currentFailedConnectionPair=null;if(this.subSolver){this.subSolver.step();return}let e=this.queuedFailedConnectionPairs.shift();if(e){this.currentFailedConnectionPair=e,this.currentCandidatePair=e.pins,this.subSolver=new kZ({inputProblem:this.params.inputProblem,pins:e.pins,chipMap:this.chipMap});return}while(this.queuedCandidatePairs.length>0){let t=this.queuedCandidatePairs.shift(),[n,o]=t;if(this.newlyConnectedPinIds.has(n.pinId)||this.newlyConnectedPinIds.has(o.pinId))continue;this.currentCandidatePair=t,this.subSolver=new kZ({inputProblem:this.params.inputProblem,pins:this.currentCandidatePair,chipMap:this.chipMap});return}this.solved=!0}visualize(){if(this.subSolver)return this.subSolver.visualize();let e=Bp(this.inputProblem);for(let t of this.solvedLongDistanceTraces)e.lines.push({points:t.tracePath,strokeColor:"purple"});for(let[t,n]of this.queuedCandidatePairs)e.lines.push({points:[t,n],strokeColor:"gray",strokeDash:"4 4"});return e}getOutput(){if(!this.solved)return{newTraces:[],allTracesMerged:this.params.alreadySolvedTraces};return{newTraces:this.solvedLongDistanceTraces,allTracesMerged:[...this.params.alreadySolvedTraces,...this.solvedLongDistanceTraces]}}},kot=(e,t)=>{for(let n=0;n<e.length-1;n++){let o=e[n],r=e[n+1];for(let i of t){let s={center:{x:i.minX+(i.maxX-i.minX)/2,y:i.minY+(i.maxY-i.minY)/2},width:i.maxX-i.minX,height:i.maxY-i.minY};if(Ori(o,r,s)<=0)return!0}}return!1},y2=(e)=>{let t=0;for(let n=1;n<e.length-1;n++){let o=e[n-1],r=e[n],i=e[n+1],s=o.x===r.x,a=r.x===i.x;if(s!==a)t++}return t},Jit=(e,t)=>{let n=[];if(e.x===t.x||e.y===t.y)n.push([e,t]);else n.push([e,{x:t.x,y:e.y},t]),n.push([e,{x:e.x,y:t.y},t]);return n},px=0.000000001,Nyn=(e,t,n,o)=>t>=n-px&&o>=e-px&&Math.min(t,o)-Math.max(e,n)<=px,Ryn=(e,t)=>Math.abs(e.x-t.x)<=px&&Math.abs(e.y-t.y)<=px,osi=({start:e,end:t,label:n,originalPath:o})=>{let r=Math.abs(e.x-t.x)<=px,i=Math.abs(e.y-t.y)<=px;if(!(r?Math.abs(e.x-n.minX)<=px||Math.abs(e.x-n.maxX)<=px:i?Math.abs(e.y-n.minY)<=px||Math.abs(e.y-n.maxY)<=px:!1))return!1;for(let a=0;a<o.length-1;a++){if(!(a===0||a===o.length-2))continue;let l=o[a],h=o[a+1],d=a===0?h:l;if(!Ryn(e,d)&&!Ryn(t,d))continue;if(!D1(l,h,n))continue;if(r&&Math.abs(l.x-h.x)<=px&&Math.abs(l.x-e.x)<=px&&Nyn(Math.min(e.y,t.y),Math.max(e.y,t.y),Math.min(l.y,h.y),Math.max(l.y,h.y)))return!0;if(i&&Math.abs(l.y-h.y)<=px&&Math.abs(l.y-e.y)<=px&&Nyn(Math.min(e.x,t.x),Math.max(e.x,t.x),Math.min(l.x,h.x),Math.max(l.x,h.x)))return!0}return!1},Ave=(e,t,n={})=>{for(let o=0;o<e.length-1;o++){let r=e[o],i=e[o+1];for(let s of t)if(D1(r,i,s)){if(n.originalPath&&osi({start:r,end:i,label:s,originalPath:n.originalPath}))continue;return!0}}return!1},rsi=(e,t)=>{if(t>=e.length-3)return-1;let n=t,o=!0;for(let r=t;r<e.length-2&&r<t+10;r++){if(r+2>=e.length)break;let i=e[r],s=e[r+1],a=e[r+2],c=i.x===s.x,l=s.x===a.x;if(c===l)break;let h=c?Math.sign(s.y-i.y):Math.sign(s.x-i.x);if(r>t){let d=e[r-1],u=d.x===i.x,_=u?Math.sign(i.y-d.y):Math.sign(i.x-d.x);if(c&&u&&h!==_||!c&&!u&&h!==_){o=!1;break}}n=r+2}return o&&n-t>=3?n:-1},HJ=(e,t,n)=>{if(n.length<2)return!1;let o=n[0],r=n[n.length-1];if(e.x===o.x&&e.y===o.y&&t.x===n[1].x&&t.y===n[1].y)return!0;if(e.x===n[n.length-2].x&&e.y===n[n.length-2].y&&t.x===r.x&&t.y===r.y)return!0;return!1},Qyn=({path:e,obstacles:t,labelBounds:n,originalPath:o,allowLabelBoundaryExtension:r=!1})=>{if(e.length<=2)return e;let i=[...e],s=y2(i),a=!0;while(a){a=!1;for(let l=0;l<i.length-3;l++){let h=rsi(i,l);if(h>0){if(HJ(i[l],i[l+1],o)||HJ(i[h-1],i[h],o))continue;let d=i[l],u=i[h],_=Jit(d,u);for(let p of _){let m=[...i.slice(0,l+1),...p.slice(1,-1),...i.slice(h)],A=kot(p,t),g=Ave(p,n,r?{originalPath:o}:{});if(!A&&!g){let f=y2(m);i=m,s=f,a=!0;break}}if(a)break}}if(!a)for(let l=0;l<i.length-2;l++){let h=Math.min(i.length-l-2,i.length-2);for(let d=1;d<=h;d++){let u=l+d+1;if(u>=i.length)continue;if(HJ(i[l],i[l+1],o)||HJ(i[u-1],i[u],o))continue;let _=i[l],p=i[u],m=Jit(_,p);for(let A of m){let g=[...i.slice(0,l+1),...A.slice(1,-1),...i.slice(u)],f=A,y=kot(f,t),x=Ave(f,n,r?{originalPath:o}:{});if(!y&&!x){let C=y2(g);if(C<s||C===s&&g.length<i.length){i=g,s=C,a=!0;break}}}if(a)break}if(a)break}if(!a)for(let l=0;l<i.length-2;l++){let h=i[l],d=i[l+1],u=i[l+2];if(HJ(h,d,o)||HJ(d,u,o))continue;let _=h.x===d.x&&d.x===u.x,p=h.y===d.y&&d.y===u.y;if(_||p){let m=[...i.slice(0,l+1),...i.slice(l+2)],A=kot([h,u],t),g=Ave([h,u],n,r?{originalPath:o}:{});if(!A&&!g){i=m,a=!0;break}}}}return Mi(i)},B1=0.002,cs=(e,t)=>Math.abs(e-t)<B1,J3=(e,t)=>cs(e.y,t.y),M1=(e,t)=>cs(e.x,t.x),isi=(e,t)=>Math.abs(e.x-t.x)>=B1||Math.abs(e.y-t.y)>=B1,hL=(e,t)=>{if(!isi(e,t))return null;if(M1(e,t))return"vertical";if(J3(e,t))return"horizontal";return null},X7n=(e,t)=>Math.min(e.maxAlong,t.maxAlong)-Math.max(e.minAlong,t.minAlong)>=-B1,pT=(e,t)=>cs(e.x,t.x)&&cs(e.y,t.y),Pct=(e)=>{let t=[];for(let n of e)if(!t.some((o)=>cs(o,n)))t.push(n);return t},kyn=(e)=>{let t=[];for(let n of e){let o=t.find((r)=>cs(r[0].coordinate,n.coordinate));if(o)o.push(n);else t.push([n])}return t.reduce((n,o)=>{let r=[...o].sort((l,h)=>l.min-h.min),i=0,s=1,a=r[0].min,c=r[0].max;for(let l of r.slice(1))if(l.min<=c+B1)c=Math.max(c,l.max);else i+=c-a,s++,a=l.min,c=l.max;return{length:n.length+i+c-a,segmentCount:n.segmentCount+s}},{length:0,segmentCount:0})},j7n=(e)=>{let t=[],n=[];for(let i of e)for(let s=0;s<i.tracePath.length-1;s++){let a=i.tracePath[s],c=i.tracePath[s+1];if(J3(a,c))t.push({coordinate:a.y,min:Math.min(a.x,c.x),max:Math.max(a.x,c.x)});else if(M1(a,c))n.push({coordinate:a.x,min:Math.min(a.y,c.y),max:Math.max(a.y,c.y)})}let o=kyn(t),r=kyn(n);return{length:o.length+r.length,segmentCount:o.segmentCount+r.segmentCount}},EP=(e)=>j7n(e).length,A8e=(e)=>j7n(e).segmentCount,ssi=2.5,Lyn=(e)=>{let t=0;for(let n=1;n<e.length;n++){let o=e[n-1],r=e[n];t+=Math.abs(r.x-o.x)+Math.abs(r.y-o.y)}return t},asi=({inputProblem:e,trace:t})=>{let n=e.directConnections.find((a)=>a.pinIds.every((c)=>t.pinIds.includes(c)));if(!n)return t;let o={};for(let a of e.chips)o[a.chipId]=a;let r=new kZ({pins:t.pins,connectionPair:t,inputProblem:{...e,directConnections:[n,...e.directConnections.filter((a)=>a!==n)]},chipMap:o});if(r.solve(),!r.solvedTracePath)return t;let i=Lyn(t.tracePath),s=Lyn(r.solvedTracePath);if(i<=s*ssi)return t;return{...t,tracePath:r.solvedTracePath}},csi=0.000000001,Hyn=(e)=>e.slice(1).reduce((t,n,o)=>{let r=e[o];return t+Math.abs(n.x-r.x)+Math.abs(n.y-r.y)},0),lsi=({strictPath:e,boundaryPath:t})=>{let n=y2(t)<=y2(e),o=Math.abs(Hyn(t)-Hyn(e))<=csi;return n&&o?t:e},K7n=({targetMspConnectionPairId:e,traces:t,inputProblem:n,allLabelPlacements:o,mergedLabelNetIdMap:r,paddingBuffer:i})=>{let s=t.find((B)=>B.mspPairId===e);if(!s)throw Error(`Target trace ${e} not found`);let a=asi({inputProblem:n,trace:s}),c=new Set(a.pinIds),l=t.filter((B)=>B.mspPairId!==e),h=l.filter((B)=>{let T=B.pinIds.some((N)=>c.has(N));return B.globalConnNetId!==a.globalConnNetId||!T}),d=0.01,u=(B)=>B.flatMap((T,N)=>T.tracePath.slice(0,-1).map((D,L)=>{let H=T.tracePath[L+1];return{chipId:`trace-obstacle-${N}-${L}`,minX:Math.min(D.x,H.x)-d/2,minY:Math.min(D.y,H.y)-d/2,maxX:Math.max(D.x,H.x)+d/2,maxY:Math.max(D.y,H.y)+d/2}})),_=Cx(n),p=0.01,m=_.map((B)=>({...B,minX:B.minX-p,minY:B.minY-p,maxX:B.maxX+p,maxY:B.maxY+p})),A=a.tracePath,f=o.filter((B)=>{let T=r[B.globalConnNetId];if(T)return!T.has(a.globalConnNetId);return B.globalConnNetId!==a.globalConnNetId}).map((B)=>({minX:B.center.x-B.width/2-i,maxX:B.center.x+B.width/2+i,minY:B.center.y-B.height/2-i,maxY:B.center.y+B.height/2+i})),y=(B)=>{let T=Qyn({path:A,obstacles:B,labelBounds:f,originalPath:A}),N=Qyn({path:A,obstacles:B,labelBounds:f,originalPath:A,allowLabelBoundaryExtension:!0});return lsi({strictPath:T,boundaryPath:N})},x=y([...m,...u(l)]),C=y([...m,...u(h)]),b=l.filter((B)=>B.globalConnNetId===a.globalConnNetId),I=(B)=>{let T=[...b,{...a,tracePath:B}];return{segmentCount:A8e(T),visibleLength:EP(T)}},v=y2(x),P=y2(C),M=x;if(P<v)M=C;else if(P===v){let B=I(x),T=I(C);if(T.segmentCount<B.segmentCount||T.segmentCount===B.segmentCount&&T.visibleLength<B.visibleLength-B1)M=C}return{...a,tracePath:M}},hsi=({targetMspConnectionPairId:e,traces:t,inputProblem:n,allLabelPlacements:o,mergedLabelNetIdMap:r,paddingBuffer:i})=>{let s=t.find((y)=>y.mspPairId===e);if(!s)throw Error(`Target trace ${e} not found`);let a=0.00001,c=(y,x)=>Math.abs(y-x)<a,l=t.filter((y)=>y.mspPairId!==e),h=0.01,d=l.flatMap((y,x)=>y.tracePath.slice(0,-1).map((C,b)=>{let I=y.tracePath[b+1];return{chipId:`trace-obstacle-${x}-${b}`,minX:Math.min(C.x,I.x)-h/2,minY:Math.min(C.y,I.y)-h/2,maxX:Math.max(C.x,I.x)+h/2,maxY:Math.max(C.y,I.y)+h/2}})),_=[...Cx(n).map((y)=>({...y,minX:y.minX+a,maxX:y.maxX-a,minY:y.minY+a,maxY:y.maxY-a})),...d],p=(y,x,C)=>{for(let b of C)if(D1(y,x,b))return!0;return!1},A=o.filter((y)=>{let x=r[y.globalConnNetId];if(x)return!x.has(s.globalConnNetId);return y.globalConnNetId!==s.globalConnNetId}).map((y)=>({minX:y.center.x-y.width/2+a,maxX:y.center.x+y.width/2-a,minY:y.center.y-y.height/2+a,maxY:y.center.y+y.height/2-a})),g=[...s.tracePath];if(g.length<4)return{...s};if(g.length===4){let[y,x,C,b]=g,I,v,P=c(y.y,x.y)&&c(x.x,C.x)&&c(C.y,b.y),M=c(y.x,x.x)&&c(x.y,C.y)&&c(C.x,b.x),B=P?Math.sign(x.x-y.x)===Math.sign(b.x-C.x):Math.sign(x.y-y.y)===Math.sign(b.y-C.y);if(!(P||M)||!B)return{...s};if(P){let N=(y.x+b.x)/2;I={x:N,y:x.y},v={x:N,y:C.y}}else{let N=(y.y+b.y)/2;I={x:x.x,y:N},v={x:C.x,y:N}}if(!(p(y,I,_)||p(I,v,_)||p(v,b,_)||p(y,I,A)||p(I,v,A)||p(v,b,A)))g[1]=I,g[2]=v;return{...s,tracePath:Mi(g)}}for(let y=1;y<g.length-4;y++){let x=g[y],C=g[y+1],b=g[y+2],I=g[y+3],v=c(x.y,C.y)&&c(C.x,b.x)&&c(b.y,I.y),P=c(x.x,C.x)&&c(C.y,b.y)&&c(b.x,I.x),M=c(x.y,C.y)&&c(C.y,b.y)&&c(b.y,I.y),B=c(x.x,C.x)&&c(C.x,b.x)&&c(b.x,I.x),T=M||B,N=!1;if(v)N=Math.sign(C.x-x.x)===Math.sign(I.x-b.x);else if(P)N=Math.sign(C.y-x.y)===Math.sign(I.y-b.y);if(!((v||P)&&!T&&N))continue;let L,H,V=v?Math.abs(x.x-C.x):Math.abs(x.y-C.y),O=v?Math.abs(b.x-I.x):Math.abs(b.y-I.y);if(Math.abs(V-O)<0.001)continue;if(v){let j=(x.x+I.x)/2;L={x:j,y:C.y},H={x:j,y:b.y}}else{let j=(x.y+I.y)/2;L={x:C.x,y:j},H={x:b.x,y:j}}if(!(p(x,L,_)||p(L,H,_)||p(H,I,_)||p(x,L,A)||p(L,H,A)||p(H,I,A)))g[y+1]=L,g[y+2]=H,y=0}let f=Mi(g);return{...s,tracePath:f}},$m=0.05,Fyn=2000,G3=0.001,Qr=0.000000001,R9e=G3+Qr,dsi="blue",$7n="red",au=(e)=>e==="y+"||e==="y-",FJ=(e)=>e==="x+"||e==="x-",wde=(e,t)=>Math.min(e.maxX,t.maxX)-Math.max(e.minX,t.minX)>Qr&&Math.min(e.maxY,t.maxY)-Math.max(e.minY,t.minY)>Qr,f8e=(e,t,n,o)=>Math.min(t,o)-Math.max(e,n)>Qr,Zde=(e,t)=>{for(let n of Object.values(t)){let o=n.tracePath;for(let r=0;r<o.length-1;r++)if(Rue(o[r],o[r+1],e))return!0}return!1},Rue=(e,t,n)=>{let o={minX:n.minX+R9e,minY:n.minY+R9e,maxX:n.maxX-R9e,maxY:n.maxY-R9e};if(o.minX>=o.maxX||o.minY>=o.maxY)return!1;if(y8e(e,t)){if(e.x<=o.minX+Qr||e.x>=o.maxX-Qr)return!1;return f8e(Math.min(e.y,t.y),Math.max(e.y,t.y),o.minY,o.maxY)}if(x8e(e,t)){if(e.y<=o.minY+Qr||e.y>=o.maxY-Qr)return!1;return f8e(Math.min(e.x,t.x),Math.max(e.x,t.x),o.minX,o.maxX)}return!1},usi=(e,t)=>{for(let n=0;n<e.length-1;n++)if(Rue(e[n],e[n+1],t))return!0;return!1},Lot=(e,t)=>{for(let n=0;n<e.length-1;n++)if(Rv(e[n],e[n+1],t))return!0;return!1},zyn=(e,t)=>[["left",Math.abs(e.x-t.minX)],["right",Math.abs(e.x-t.maxX)],["bottom",Math.abs(e.y-t.minY)],["top",Math.abs(e.y-t.maxY)]],Hot=(e,t,n)=>Zit(au(n)?[e,{x:t.x,y:e.y},t]:[e,{x:e.x,y:t.y},t]),Zit=(e)=>{let t=e.filter((o,r)=>r===0||!psi(o,e[r-1]));if(t.length<3)return t;let n=[t[0]];for(let o=1;o<t.length-1;o++){let r=n[n.length-1],i=t[o],s=t[o+1];if(y8e(r,i)&&y8e(i,s)||x8e(r,i)&&x8e(i,s))continue;n.push(i)}return n.push(t[t.length-1]),n},psi=(e,t)=>y8e(e,t)&&x8e(e,t),y8e=(e,t)=>Math.abs(e.x-t.x)<=Qr,x8e=(e,t)=>Math.abs(e.y-t.y)<=Qr,q7n=(e)=>Math.max(...e.chips.map((n)=>n.width),1)*3,Ou=0.000001,J7n=(e)=>msi(e.pinIds)>=2,Ev=(e,t)=>Math.min(e.maxX,t.maxX)-Math.max(e.minX,t.minX)>Ou&&Math.min(e.maxY,t.maxY)-Math.max(e.minY,t.minY)>Ou,zk=(e)=>{let t=[];for(let n=1;n<e.length-1;n++){let o=e[n-1],r=e[n],i=e[n+1];if(_si(o,r,i))t.push(r)}return t},Vs=(e,t)=>{for(let n=0;n<e.length-1;n++)if(gsi(t,e[n],e[n+1]))return!0;return!1},nT=(e,t)=>Math.abs(e.x-t.x)+Math.abs(e.y-t.y),msi=(e)=>new Set(e).size,_si=(e,t,n)=>est(e,t)!==est(t,n),gsi=(e,t,n)=>{if(est(t,n)==="horizontal")return Math.abs(e.y-t.y)<=Ou&&e.x>=Math.min(t.x,n.x)-Ou&&e.x<=Math.max(t.x,n.x)+Ou;return Math.abs(e.x-t.x)<=Ou&&e.y>=Math.min(t.y,n.y)-Ou&&e.y<=Math.max(t.y,n.y)+Ou},est=(e,t)=>Math.abs(e.y-t.y)<=Ou?"horizontal":"vertical",Z7n=(e,t)=>{let n=new Set;for(let o of e.netConnections){if(!o.isGround)continue;let r=t.getNetConnectedToId(o.netId);if(r)n.add(r)}return n},eSn=({inputProblem:e,traces:t,netLabelPlacements:n})=>{let{netConnMap:o}=S6(e),r=Z7n(e,o);if(r.size===0)return n;let i=new Map(e.chips.map((l)=>[l.chipId,l])),s=Object.fromEntries(t.map((l)=>[l.mspPairId,l])),a=Cx(e),c=[...n];for(let l of t){if(!r.has(l.globalConnNetId))continue;let[h,d]=l.pins;if(h.chipId===d.chipId||!cs(h.y,d.y)||![h,d].every((_)=>_._facingDirection==="y-"&&i.get(_.chipId)?.pins.length===2))continue;let u=Mi(l.tracePath);if(u.length!==4||!M1(u[0],u[1])||!J3(u[1],u[2])||!M1(u[2],u[3])||u[1].y>=h.y)continue;for(let _ of t){if(_.globalConnNetId!==l.globalConnNetId)continue;let p=_.pins.find((f)=>l.pinIds.includes(f.pinId)),m=_.pins.find((f)=>!l.pinIds.includes(f.pinId)&&(i.get(f.chipId)?.pins.length??0)>2);if(!p||!m||!cs(m.y,u[1].y))continue;let A=p.pinId===h.pinId?d:h;if(Math.abs(A.x-m.x)<=Math.abs(p.x-m.x))continue;let g={x:A.x,y:u[1].y};if(!Vs(l.tracePath,g))continue;for(let f=0;f<c.length;f++){let y=c[f];if(y.globalConnNetId!==l.globalConnNetId||y.orientation!=="y-"||!y.mspConnectionPairIds.some((b)=>b===_.mspPairId||b===l.mspPairId)||!Vs(_.tracePath,y.anchorPoint)&&!Vs(l.tracePath,y.anchorPoint))continue;let x=x2(g,y.orientation,y.width,y.height),C=Ui(x,y.width,y.height);if(a.some((b)=>Ev(C,b))||Zde(C,s)||c.some((b,I)=>I!==f&&Ev(C,Ui(b.center,b.width,b.height))))continue;c[f]={...y,anchorPoint:g,center:x,mspConnectionPairIds:[l.mspPairId],pinIds:[...l.pinIds]}}}}for(let l=0;l<c.length;l++){let h=c[l];if(h.orientation!=="y-"||!r.has(h.globalConnNetId))continue;if(!e.netConnections.some((g)=>g.pinIds.length>2&&o.getNetConnectedToId(g.netId)===h.globalConnNetId))continue;let u=t.filter((g)=>g.globalConnNetId===h.globalConnNetId).flatMap((g)=>g.tracePath.slice(1).flatMap((f,y)=>{let x=g.tracePath[y];return cs(x.x,h.anchorPoint.x)&&cs(f.x,h.anchorPoint.x)?[{minY:Math.min(x.y,f.y),maxY:Math.max(x.y,f.y)}]:[]})).sort((g,f)=>f.maxY-g.maxY),_=h.anchorPoint.y;for(let g of u)if(g.maxY+B1>=_&&g.minY<_)_=g.minY;if(cs(_,h.anchorPoint.y))continue;let p={x:h.anchorPoint.x,y:_},m=x2(p,h.orientation,h.width,h.height),A=Ui(m,h.width,h.height);if(a.some((g)=>Ev(A,g))||Zde(A,s)||c.some((g,f)=>f!==l&&Ev(A,Ui(g.center,g.width,g.height))))continue;c[l]={...h,anchorPoint:p,center:m}}return c},Oyn=(e,t,n)=>e==="vertical"?{minX:0,maxX:0,minY:t,maxY:n}:{minX:t,maxX:n,minY:0,maxY:0},Asi=(e,t,n)=>{let o=D7n(t,n);if(!o)return!1;return(e==="vertical"?o.maxY-o.minY:o.maxX-o.minX)>B1},fsi=({group:e,originalCoordinates:t,otherNetTraces:n})=>{let o=e[0].orientation,r=e.map((a)=>Oyn(o,a.minAlong,a.maxAlong)),i=Oii,s=[];for(let a of n)for(let c=0;c<a.tracePath.length-1;c++){let l=a.tracePath[c],h=a.tracePath[c+1];if(hL(l,h)!==o)continue;let d=o==="vertical"?Math.min(l.y,h.y):Math.min(l.x,h.x),u=o==="vertical"?Math.max(l.y,h.y):Math.max(l.x,h.x),_=Oyn(o,d,u);if(!r.some((A)=>Asi(o,A,_)))continue;let p=o==="vertical"?l.x:l.y;if(!t.some((A)=>Math.abs(A-p)<=Y7n))continue;s.push(p-i,p+i)}return Pct(s)},ysi=(e,t,n)=>[t.tracePath.slice(0,e.segmentIndex+1).reverse(),t.tracePath.slice(e.segmentIndex+1)].some((r)=>{let[i,s,a]=Mi(r);if(!i||!s||!a)return!1;let c=hL(i,s);return c!==null&&c!==e.orientation&&hL(s,a)===e.orientation&&Vs([i,s],n)}),xsi=(e,t)=>{let n=e[0].globalConnNetId,o=t.filter((s)=>s.globalConnNetId===n),r=new Set(e.map((s)=>s.traceId)),i=new Set(o.filter((s)=>r.has(s.mspPairId)).flatMap((s)=>s.pinIds));for(let s=!0;s;){s=!1;for(let a of o){if(r.has(a.mspPairId))continue;if(!a.pinIds.some((c)=>i.has(c)))continue;r.add(a.mspPairId);for(let c of a.pinIds)i.add(c);s=!0}}return r},Csi=(e,t,n)=>{let o=xsi(e,n);return t.filter((r)=>r.mspConnectionPairIds.some((i)=>o.has(i)))},tSn=(e,t,n)=>{let o=new Map(n.map((m)=>[m.mspPairId,m])),i=[...new Set(e.map((m)=>m.traceId))].every((m)=>o.get(m)?.pins.every((A)=>A.chipId===e[0].componentId)===!0),s=e[0].orientation,a=Csi(e,t,n),c=new Set(a.filter((m)=>s==="vertical"&&(m.orientation==="y+"||m.orientation==="y-")||s==="horizontal"&&(m.orientation==="x+"||m.orientation==="x-"))),l=a.filter((m)=>{if(m.orientation!==e[0].componentFacingDirection&&(!i||!c.has(m)))return!1;return m.mspConnectionPairIds.some((A)=>{let g=o.get(A);return g&&Vs(g.tracePath,m.anchorPoint)})}),h=Pct(l.flatMap((m)=>{let A=i&&c.has(m)?e.filter((g)=>{let f=o.get(g.traceId);return f&&m.mspConnectionPairIds.includes(g.traceId)&&ysi(g,f,m.anchorPoint)}):[];if(A.length>0)return A.map((g)=>g.coordinate);return[s==="vertical"?m.anchorPoint.x:m.anchorPoint.y]}));if(h.length!==1)return null;let d=h[0],u=e.find((m)=>Math.abs(m.coordinate-d)<=B1)?.coordinate??d;if(e.some((m)=>o.get(m.traceId)?.tracePath.length!==4&&!cs(m.coordinate,u)))return null;if(l.some((m)=>m.mspConnectionPairIds.some((A)=>(o.get(A)?.tracePath.length??0)>4)))return u;if(l.some((m)=>c.has(m))){let m=Math.max(...e.map((g)=>g.maxAlong))-Math.min(...e.map((g)=>g.minAlong));if(e.every((g)=>Math.abs(g.coordinate-u)<=m+B1))return u;return null}if(e.every((m)=>{let A=o.get(m.traceId);if(!A)return!1;return Math.abs(m.coordinate-u)<=Dv(A.pins[0],A.pins[1])+B1}))return u;return null},bsi=(e,t,n)=>{let o=new Set;for(let s of t){if(cs(s.coordinate,n))continue;o.add(s.segmentIndex),o.add(s.segmentIndex+1)}let r=t[0].orientation,i=Mi(e.tracePath.map((s,a)=>{if(!o.has(a))return s;return r==="vertical"?{...s,x:n}:{...s,y:n}}));return{...e,tracePath:i}},Vyn=(e,t)=>new Set(t.filter((n)=>n.globalConnNetId===e.globalConnNetId&&Vs(n.tracePath,e.anchorPoint)).map((n)=>n.mspPairId)),Que=(e,t,n)=>e.every((o)=>{let r=Vyn(o,t);if(r.size===0)return!0;let i=Vyn(o,n);return[...r].every((s)=>i.has(s))}),Vu=0.000000001,Ect=(e,t,n)=>{let o=Math.abs(e.x-t.x)<Vu,r=Math.abs(e.y-t.y)<Vu;if(o)return Math.abs(e.x-n.minX)<Vu||Math.abs(e.x-n.maxX)<Vu;if(r)return Math.abs(e.y-n.minY)<Vu||Math.abs(e.y-n.maxY)<Vu;return!1},Isi=(e)=>e.map((t)=>`${t.x},${t.y}`).join(";"),V5=(e)=>{let t=0;for(let n=0;n<e.length-1;n++)t+=Math.abs(e[n+1].x-e[n].x)+Math.abs(e[n+1].y-e[n].y);return t},nSn=(e,t)=>Math.abs(e.x-t.x)+Math.abs(e.y-t.y),oSn=(e,t)=>Math.abs(e.x-t.x)<Vu||Math.abs(e.y-t.y)<Vu,rSn=(e,t)=>Math.abs(e.y-t.y)<Vu?"horizontal":"vertical",Mct=(e,t,n)=>{if(Math.abs(t.x-n.x)<Vu)return{x:t.x,y:Math.min(Math.max(e.y,Math.min(t.y,n.y)),Math.max(t.y,n.y))};if(Math.abs(t.y-n.y)<Vu)return{x:Math.min(Math.max(e.x,Math.min(t.x,n.x)),Math.max(t.x,n.x)),y:t.y};return t},vsi=(e,t,n)=>nSn(e,Mct(e,t,n)),Ssi=(e)=>{let t=[];for(let n=0;n<e.length-1;n++){let o=e[n],r=e[n+1];if(!oSn(o,r))continue;t.push({start:o,end:r,orientation:rSn(o,r)})}return t},Psi=(e,t)=>{for(let n=0;n<e.length-1;n++){let o=e[n],r=e[n+1];if(!oSn(o,r))continue;if(vsi(t,o,r)>0.000001)continue;return{index:n,start:o,end:r,orientation:rSn(o,r)}}return null},Esi=(e,t)=>{if(t.orientation==="horizontal")return e.x>=Math.min(t.start.x,t.end.x)-Vu&&e.x<=Math.max(t.start.x,t.end.x)+Vu;return e.y>=Math.min(t.start.y,t.end.y)-Vu&&e.y<=Math.max(t.start.y,t.end.y)+Vu},Msi=(e,t,n,o,r)=>{let i=Ssi(e).filter((l)=>l.orientation===o);if(i.length===0)return null;let s=i.filter((l)=>Esi(r,l)),a=s.length>0?s:i;return t<n/2?a[0]:a[a.length-1]},wsi=(e,t)=>{let n=null,o=Number.POSITIVE_INFINITY;for(let r=0;r<t.length-1;r++){let i=Mct(e,t[r],t[r+1]),s=nSn(e,i);if(s<o)n=i,o=s}return n},iSn=(e,t,n,o)=>{let r=Math.abs(e.x-t.x)<Vu,i=Math.abs(n.x-o.x)<Vu,s=(d,u,_)=>d>=Math.min(u,_)-Vu&&d<=Math.max(u,_)+Vu;if(r&&i){if(Math.abs(e.x-n.x)>Vu)return!1;return Math.min(Math.max(e.y,t.y),Math.max(n.y,o.y))-Math.max(Math.min(e.y,t.y),Math.min(n.y,o.y))>Vu}if(!r&&!i){if(Math.abs(e.y-n.y)>Vu)return!1;return Math.min(Math.max(e.x,t.x),Math.max(n.x,o.x))-Math.max(Math.min(e.x,t.x),Math.min(n.x,o.x))>Vu}let a=r?e:n,c=r?t:o,l=r?n:e,h=r?o:t;return s(a.x,l.x,h.x)&&s(l.y,a.y,c.y)},YP=(e,t)=>{let n=0;for(let o=0;o<e.length-1;o++)for(let r=0;r<t.length-1;r++)if(iSn(e[o],e[o+1],t[r],t[r+1]))n++;return n},sSn=(e,t)=>{for(let n=0;n<e.length-1;n++){let o=e[n],r=e[n+1];for(let i of t){if(!D1(o,r,i))continue;if(Ect(o,r,i))continue;return!0}}return!1},Bsi=(e,t)=>{let n=0;for(let o of e)for(let r of t){if(o.globalConnNetId===r.globalConnNetId)continue;n+=YP(o.tracePath,r.tracePath)}return n},Yyn=(e,t)=>({turnCount:e.reduce((n,o)=>n+y2(o.tracePath),0),visibleLength:EP(e),pathLength:e.reduce((n,o)=>n+V5(o.tracePath),0),otherNetCrossings:Bsi(e,t)}),Tsi=(e,t)=>{if(e.turnCount!==t.turnCount)return e.turnCount<t.turnCount;if(!cs(e.visibleLength,t.visibleLength))return e.visibleLength<t.visibleLength;if(!cs(e.pathLength,t.pathLength))return e.pathLength<t.pathLength;if(e.otherNetCrossings!==t.otherNetCrossings)return e.otherNetCrossings<t.otherNetCrossings;if(!cs(e.displacement,t.displacement))return e.displacement<t.displacement;return e.coordinate<t.coordinate},Dsi=(e,t)=>e.turnCount<=t.turnCount&&(e.turnCount<t.turnCount||e.visibleLength<=t.visibleLength+B1),Nsi=(e,t)=>e.tracePath.length!==t.tracePath.length||t.tracePath.some((n,o)=>!pT(n,e.tracePath[o])),Rsi=({inputProblem:e,group:t,traces:n,netLabelPlacements:o,obstacles:r,eligibleTraceIds:i})=>{let s=new Set(t.map((f)=>f.traceId)),a=n.filter((f)=>s.has(f.mspPairId)),c=Yyn(a,n),l=Pct(t.map((f)=>f.coordinate)),h=tSn(t,o,n),d=n.filter((f)=>f.globalConnNetId!==t[0].globalConnNetId),{netConnMap:u}=S6(e),_=Z7n(e,u),p=o.flatMap((f,y)=>f.globalConnNetId===t[0].globalConnNetId&&_.has(f.globalConnNetId)?[y]:[]),m=n.filter((f)=>f.globalConnNetId===t[0].globalConnNetId&&!i.has(f.mspPairId)),A=(f,y)=>{let x=null;for(let C of f){let b=new Map;for(let H of a){let V=bsi(H,t.filter((O)=>O.traceId===H.mspPairId),C);b.set(H.mspPairId,V)}let I=[...b.values()],v=n.map((H)=>b.get(H.mspPairId)??H),P=p.length?eSn({inputProblem:e,traces:v,netLabelPlacements:o}):o,M=p.map((H)=>{let V=P[H];return Ui(V.center,V.width,V.height)});if(!I.every((H)=>!ZZ(H.tracePath,r)&&Mp({traces:[H],netLabels:o}).length===0&&!M.some((V)=>usi(H.tracePath,V))&&!U7n(H.tracePath,d)&&!fL(H.tracePath,m.filter((V)=>V.mspPairId!==H.mspPairId))))continue;if(!Que(o,n,v))continue;let T=Yyn(I,v);if(T.otherNetCrossings>c.otherNetCrossings)continue;if(y?.coordinateIsFixedByLabel?T.turnCount>c.turnCount:!Dsi(T,c))continue;let N={...T,displacement:t.reduce((H,V)=>H+Math.abs(V.coordinate-C),0),coordinate:C},D=I.filter((H)=>{let V=n.find((O)=>O.mspPairId===H.mspPairId);return Nsi(V,H)}).map((H)=>H.mspPairId);if(D.length===0)continue;let L={traces:v,changedTraceIds:D,score:N};if(!x||Tsi(L.score,x.score))x=L}return x},g=A(h===null?l:[h],{coordinateIsFixedByLabel:h!==null});if(g)return g;if(h!==null)return null;return A(fsi({group:t,originalCoordinates:l,otherNetTraces:d}))},Qsi=(e)=>{let t=[],n=e.tracePath;for(let o=1;o<n.length-2;o++){let r=n[o-1],i=n[o],s=n[o+1],a=n[o+2],c=hL(i,s);if(!c)continue;let l=hL(r,i),h=hL(s,a);if(!l||!h)continue;if(l===c||h===c)continue;let d=c==="vertical"?[i.y,s.y]:[i.x,s.x];t.push({traceId:e.mspPairId,segmentIndex:o,globalConnNetId:e.globalConnNetId,orientation:c,coordinate:c==="vertical"?i.x:i.y,minAlong:Math.min(...d),maxAlong:Math.max(...d)})}return t},ksi=(e,t,n)=>{let o=t.center.x-t.width/2,r=t.center.x+t.width/2,i=t.center.y-t.height/2,s=t.center.y+t.height/2;switch(n){case"x-":return e.orientation==="vertical"&&e.coordinate<=o+B1;case"x+":return e.orientation==="vertical"&&e.coordinate>=r-B1;case"y+":return e.orientation==="horizontal"&&e.coordinate>=s-B1;case"y-":return e.orientation==="horizontal"&&e.coordinate<=i+B1}},Gyn=(e,t,n)=>{let o=[],r=Dv(e.pins[0],e.pins[1])<=(n?.maxMspPairDistance??_0e);for(let i of Qsi(e)){let s=e.pins.flatMap((l,h)=>{let d=t.get(l.chipId);if(!d)return[];let u=l._facingDirection??E6(l,d);if(!ksi(i,d,u))return[];return[{componentId:d.chipId,componentFacingDirection:u,distanceFromEndpoint:h===0?i.segmentIndex:e.tracePath.length-2-i.segmentIndex}]});s.sort((l,h)=>l.distanceFromEndpoint-h.distanceFromEndpoint);let a=s[0]?.distanceFromEndpoint,c=new Set;for(let l of s){if(c.size>0&&(!n?.includeTiedEndpointAssociations||!r))break;if(l.distanceFromEndpoint!==a)continue;let h=`${l.componentId}:${l.componentFacingDirection}`;if(c.has(h))continue;c.add(h),o.push({...i,...l})}}return o};var Lsi=(e,t)=>{let n=Math.max(e.minAlong,t.minAlong),o=Math.min(e.maxAlong,t.maxAlong),r=(n+o)/2;return e.orientation==="vertical"?[{x:e.coordinate,y:r},{x:t.coordinate,y:r}]:[{x:r,y:e.coordinate},{x:r,y:t.coordinate}]},Hsi=(e,t,n)=>{if(!X7n(e,t))return!0;let[o,r]=Lsi(e,t);return!n.some((i)=>D1(o,r,i))},Fsi=(e,t,n)=>{if(e.traceId===t.traceId)return!0;let o=new Set(n.get(e.traceId).pins.map((r)=>r.pinId));return n.get(t.traceId).pins.some((r)=>o.has(r.pinId))},zsi=(e,t,n,o,r)=>n.globalConnNetId===e.globalConnNetId&&n.orientation===e.orientation&&n.componentId===e.componentId&&n.componentFacingDirection===e.componentFacingDirection&&(X7n(t,n)||Fsi(t,n,o))&&Hsi(t,n,r),Osi=(e,t,n,o,r)=>{let i=new Map(n.chips.map((m)=>[m.chipId,m])),s=new Map(e.map((m)=>[m.mspPairId,m])),a=e.filter((m)=>t.has(m.mspPairId)),c=(m)=>{let A=new Set,g=[];for(let f=0;f<m.length;f++){if(A.has(f))continue;let y=m[f],x=[f],C=[];A.add(f);for(let b=0;b<x.length;b++){let I=m[x[b]];C.push(I);for(let v=0;v<m.length;v++){if(A.has(v))continue;let P=m[v];if(!zsi(y,I,P,s,o))continue;A.add(v),x.push(v)}}g.push(C)}return g},l=(m)=>[m[0].componentId,m[0].componentFacingDirection,m[0].orientation,...m.map((A)=>`${A.traceId}:${A.segmentIndex}`).sort()].join("|"),h=[],d=new Set,u=(m,A)=>{if(new Set(m.map((b)=>b.traceId)).size<2)return;let f=tSn(m,r,e);if(A?.requireFixedLabel&&f===null)return;let y=m.some((b)=>!cs(b.coordinate,m[0].coordinate)),x=f!==null&&!cs(f,m[0].coordinate);if(!y&&!x)return;let C=l(m);if(d.has(C))return;d.add(C),h.push(m)},_=a.flatMap((m)=>Gyn(m,i));for(let m of c(_))u(m);let p=a.flatMap((m)=>Gyn(m,i,{includeTiedEndpointAssociations:!0,maxMspPairDistance:n.maxMspPairDistance}));for(let m of c(p))u(m,{requireFixedLabel:!0});return h},Uyn=(e)=>JSON.stringify(e.map((t)=>({mspPairId:t.mspPairId,tracePath:t.tracePath}))),Vsi=({inputProblem:e,traces:t,netLabelPlacements:n,eligibleTraceIds:o})=>{let r=[...t],i=new Set([Uyn(r)]),s=Cx(e),a=new Set,c=0,l=Math.max(1,t.reduce((h,d)=>h+d.tracePath.length,0));for(let h=0;h<l;h++){let d=Osi(r,o,e,s,n),u=null;for(let m of d)if(u=Rsi({inputProblem:e,group:m,traces:r,netLabelPlacements:n,obstacles:s,eligibleTraceIds:o}),u)break;if(!u)break;let _=Uyn(u.traces),p=i.has(_);if(!p)i.add(_);r=u.traces,c++;for(let m of u.changedTraceIds)a.add(m);if(p)break}return{traces:r,alignedRailGroupCount:c,alignedTraceCount:a.size}},Ysi=(e)=>{let t=[];if(e.length<3)return t;for(let n=0;n<e.length-2;n++){let o=e[n],r=e[n+1],i=e[n+2],s=r.x-o.x,a=r.y-o.y,c=i.x-r.x,l=i.y-r.y;if((s===0&&l===0&&a!==0&&c!==0||a===0&&c===0&&s!==0&&l!==0)&&s*s+a*a>=0.25&&c*c+l*l>=0.25)t.push({p1:o,p2:r,p3:i})}return t},Gsi=(e,t)=>{let n=[];for(let o of e)if(o.mspPairId!==t)n.push({points:o.tracePath});return n},C8e=0.000001,Wyn=(e,t,n)=>{let o=[];for(let r of n){let i=r.points;for(let s=0;s<i.length-1;s++){let a=i[s],c=i[s+1];if(!a||!c)continue;let l=XP(e,t,a,c);if(l)o.push(l)}}return o},Usi=(e,t)=>Math.abs(e.x-t.x)<C8e&&Math.abs(e.y-t.y)<C8e,xG=(e,t,n={})=>{let o=[],r=n.includeTerminalSegments?0:1,i=n.includeTerminalSegments?e.length-1:e.length-2,s=n.includeTerminalSegments?0:1,a=n.includeTerminalSegments?t.length-1:t.length-2;for(let c=r;c<i;c++){let l=e[c],h=e[c+1],d=Math.abs(l.x-h.x)<C8e;for(let u=s;u<a;u++){let _=t[u],p=t[u+1],m=Math.abs(_.x-p.x)<C8e;if(d===m)continue;let A=XP(l,h,_,p);if(!A||[l,h,_,p].some((g)=>Usi(g,A)))continue;o.push({pathSegmentIndex:c,otherPathSegmentIndex:u})}}return o},pP=0.000001,Rk=(e,t,n=pP)=>Math.abs(e.x-t.x)<n,Wsi=({lShape:e,rectangle:t,padding:n=0.5,interactionPoint1:o,interactionPoint2:r})=>{let{p1:i,p2:s,p3:a}=e,{x:c,y:l,width:h,height:d}=t,u,_=o,p=r;if(Math.abs(s.x-c)<pP&&Math.abs(s.y-(l+d))<pP){if(u={x:c+h+n,y:l-n},Rk(i,s))_={x:o.x,y:o.y-n};else _={x:o.x+n,y:o.y};if(Rk(s,a))p={x:r.x,y:r.y-n};else p={x:r.x+n,y:r.y}}else if(Math.abs(s.x-(c+h))<pP&&Math.abs(s.y-(l+d))<pP){if(u={x:c-n,y:l-n},Rk(i,s))_={x:o.x,y:o.y-n};else _={x:o.x-n,y:o.y};if(Rk(s,a))p={x:r.x,y:r.y-n};else p={x:r.x-n,y:r.y}}else if(Math.abs(s.x-c)<pP&&Math.abs(s.y-l)<pP){if(u={x:c+h+n,y:l+d+n},Rk(i,s))_={x:o.x,y:o.y+n};else _={x:o.x+n,y:o.y};if(Rk(s,a))p={x:r.x,y:r.y+n};else p={x:r.x+n,y:r.y}}else if(Math.abs(s.x-(c+h))<pP&&Math.abs(s.y-l)<pP){if(u={x:c-n,y:l+d+n},Rk(i,s))_={x:o.x,y:o.y+n};else _={x:o.x-n,y:o.y};if(Rk(s,a))p={x:r.x,y:r.y+n};else p={x:r.x-n,y:r.y}}else return[];return[[_,u,p]]},Xyn=({trace:e,chipBounds:t,clearance:n})=>{if(e.tracePath.length<4||t.length===0)return[];let o=e.tracePath[0],r=e.tracePath[1],i=e.tracePath.at(-2),s=e.tracePath.at(-1),a=Math.min(...t.map((u)=>u.minX))-n,c=Math.max(...t.map((u)=>u.maxX))+n,l=Math.min(...t.map((u)=>u.minY))-n,h=Math.max(...t.map((u)=>u.maxY))+n,d=[];for(let u of[a,c])for(let _ of[l,h])d.push({traceId:e.mspPairId,path:Mi([o,r,{x:r.x,y:_},{x:u,y:_},{x:u,y:i.y},i,s])}),d.push({traceId:e.mspPairId,path:Mi([o,r,{x:u,y:r.y},{x:u,y:_},{x:i.x,y:_},i,s])});return d},tst=({trace:e,segmentIndex:t,obstacleStart:n,obstacleEnd:o,obstacleBounds:r,chipBounds:i,clearance:s})=>{let a=(h,d)=>{let u=h[d],_=h[d+1],p=Math.abs(u.x-_.x)<pP?"y":"x",m=p==="x"?"y":"x",A=r??{minX:Math.min(n.x,o.x),minY:Math.min(n.y,o.y),maxX:Math.max(n.x,o.x),maxY:Math.max(n.y,o.y)},g=p==="x"?"minX":"minY",f=p==="x"?"maxX":"maxY",y=n[p]+Math.sign(u[p]-n[p])*s;if(r){let T=u[p]<(A[g]+A[f])/2?-1:1;y=A[T<0?g:f]+T*s}let x=m==="x"?"minX":"minY",C=m==="x"?"maxX":"maxY",b=A[x]-s,I=A[C]+s,v=r?h[d+2]:void 0,M=[v?v[m]<b?(v[m]+b)/2:v[m]>I?(v[m]+I)/2:void 0:void 0,b,I,...i.flatMap((T)=>[T[x]-s,T[C]+s])].filter((T)=>T!==void 0),B=h.slice(d+2);if(B.length===0)B.push(_);return[...new Set(M)].map((T)=>Mi([...h.slice(0,d+1),{...u,[p]:y},{...u,[p]:y,[m]:T},{..._,[m]:T},...B]))},c=[...e.tracePath].reverse(),l=e.tracePath.length-2-t;return[...a(e.tracePath,t),...a(c,l).map((h)=>h.reverse())].map((h)=>({traceId:e.mspPairId,path:h}))},fve=(e,t,n)=>{if(e.length<2)return{isColliding:!1};for(let o=0;o<e.length-1;o++){let r=e[o],i=e[o+1];for(let s of t){if(s.mspPairId===n)continue;for(let a=0;a<s.tracePath.length-1;a++){let c=s.tracePath[a],l=s.tracePath[a+1],h=XP(r,i,c,l);if(h)return{isColliding:!0,collidingTraceId:s.mspPairId,collisionPoint:h}}}}return{isColliding:!1}},Xsi=(e,t)=>{let n=[];for(let o of e)for(let r of t){let i=Math.min(o.x,r.x),s=Math.min(o.y,r.y),a=Math.max(o.x,r.x),c=Math.max(o.y,r.y),l=a-i,h=c-s;if(l>0.000001&&h>0.000001)n.push({rect:{x:i,y:s,width:l,height:h},i1:o,i2:r})}return n},Q9e=(e)=>{let t={circles:[],lines:[]},n=Array.isArray(e)?e:[e];for(let o of n)t.circles.push({center:{x:o.p2.x,y:o.p2.y},radius:0.01,fill:"blue"}),t.lines.push({points:[o.p1,o.p2,o.p3],strokeColor:"lightblue"});return t},jyn=(e,t="red")=>{let n={circles:[]};for(let o of e)n.circles.push({center:{x:o.x,y:o.y},radius:0.01,fill:t});return n},Kyn=(e)=>{let t={rects:[]};return t.rects.push({center:{x:e.x+e.width/2,y:e.y+e.height/2},width:e.width,height:e.height,stroke:"green"}),t},jsi=(e,t="gray",n=[])=>{let o={lines:[],circles:[]};for(let r of e)o.lines.push({points:r,strokeColor:t});for(let r of n)o.circles.push({center:r,radius:0.01,fill:"green"});return o},Fot=(e)=>{let t={lines:[],points:[],rects:[],circles:[],texts:[]};for(let n of e){if(!n)continue;if(n.lines)t.lines.push(...n.lines);if(n.points)t.points.push(...n.points);if(n.rects)t.rects.push(...n.rects);if(n.circles)t.circles.push(...n.circles);if(n.texts)t.texts.push(...n.texts)}return t},Ksi=(e)=>{let t={circles:[]};if(e?.isColliding&&e.collisionPoint)t.circles.push({center:e.collisionPoint,radius:0.01,fill:"red"});return t},$si=class extends Gu{input;chipObstacleSpatialIndex;lShapesToProcess=[];ignoredCrossings=new Set;reroutedTraceIds=new Set;processingCrossings=!0;visualizationMode="l_shapes";currentLShape=null;intersectionPoints=[];tightRectangle=null;candidates=[];bestRoute=null;lastCollision=null;collidingCandidate=null;rectangleCandidates=[];currentRectangleIndex=0;isInitialStep=!0;currentCandidateIndex=0;lShapeProcessingStep="idle";lShapeJustProcessed=!1;bestRouteFound=null;constructor(e){super();if(this.input=e,this.visualizationMode="l_shapes",this.chipObstacleSpatialIndex=this.input.inputProblem._chipObstacleSpatialIndex??new u7e(this.input.inputProblem.chips),!this.input.inputProblem._chipObstacleSpatialIndex)this.input.inputProblem._chipObstacleSpatialIndex=this.chipObstacleSpatialIndex}_step(){if(this.isInitialStep){this.isInitialStep=!1;return}if(this.processingCrossings){let e=this._findCrossing();if(e){if(!this._resolveCrossing(e))this.ignoredCrossings.add(this._crossingKey(e));return}this.processingCrossings=!1,this._initializeLShapes();return}if(this.lShapeJustProcessed){this._resetAfterLShapProcessing();return}if(this.lShapesToProcess.length===0&&this.currentLShape===null){this.solved=!0;return}switch(this.lShapeProcessingStep){case"idle":this._handleIdleStep();break;case"intersections":this._handleIntersectionsStep();break;case"rectangle_selection":this._handleRectangleSelectionStep();break;case"candidate_evaluation":this._handleCandidateEvaluationStep();break}}_initializeLShapes(){for(let e of this.input.allTraces)this.lShapesToProcess.push(...Ysi(e.tracePath).map((t)=>({...t,traceId:e.mspPairId})))}_crossingKey(e){return`${e.trace.mspPairId}:${e.segmentIndex}:${e.otherTrace.mspPairId}:${e.otherSegmentIndex}`}_isTraceBundle(e,t){let n=(o)=>o.pins.map((r)=>r.chipId).sort().join(":");if(n(e)!==n(t))return!1;return Object.values(this.input.mergedLabelNetIdMap).some((o)=>o.has(e.globalConnNetId)&&o.has(t.globalConnNetId))}_findCrossing(){let e=this.input.allTraces;for(let t=0;t<e.length;t++){let n=e[t];for(let o=t+1;o<e.length;o++){let r=e[o];if(n.globalConnNetId===r.globalConnNetId)continue;let i=this._isTraceBundle(n,r),s=this.input.eligibleTraceIds?.has(n.mspPairId)===!0||this.input.eligibleTraceIds?.has(r.mspPairId)===!0;if(!i&&!s&&!this.reroutedTraceIds.has(n.mspPairId)&&!this.reroutedTraceIds.has(r.mspPairId))continue;let a=xG(n.tracePath,r.tracePath);for(let{pathSegmentIndex:c,otherPathSegmentIndex:l}of a){let h={trace:n,segmentIndex:c,otherTrace:r,otherSegmentIndex:l,isInitialBundleCrossing:i};if(!this.ignoredCrossings.has(this._crossingKey(h)))return h}}}return null}_resolveCrossing(e){let t=this.chipObstacleSpatialIndex.chips.map((a)=>a.bounds),n=[...tst({trace:e.trace,segmentIndex:e.segmentIndex,obstacleStart:e.otherTrace.tracePath[e.otherSegmentIndex],obstacleEnd:e.otherTrace.tracePath[e.otherSegmentIndex+1],chipBounds:t,clearance:this.input.paddingBuffer}),...tst({trace:e.otherTrace,segmentIndex:e.otherSegmentIndex,obstacleStart:e.trace.tracePath[e.segmentIndex],obstacleEnd:e.trace.tracePath[e.segmentIndex+1],chipBounds:t,clearance:this.input.paddingBuffer}),...Xyn({trace:e.trace,chipBounds:t,clearance:this.input.paddingBuffer}),...Xyn({trace:e.otherTrace,chipBounds:t,clearance:this.input.paddingBuffer})],o=Cx(this.input.inputProblem).filter((a)=>a.kind==="chip"),i=n.map((a)=>({...a,collision:fve(a.path,this.input.allTraces,a.traceId)})).filter((a)=>!sSn(a.path,o)&&!fve(a.path,[e.trace,e.otherTrace],a.traceId).isColliding&&(e.isInitialBundleCrossing||!a.collision.isColliding)).sort((a,c)=>Number(a.collision.isColliding)-Number(c.collision.isColliding)||V5(a.path)-V5(c.path))[0];if(!i)return!1;let s=this.input.allTraces.findIndex((a)=>a.mspPairId===i.traceId);return this.input.allTraces[s]={...this.input.allTraces[s],tracePath:i.path},this.reroutedTraceIds.add(i.traceId),!0}_resetAfterLShapProcessing(){this.lShapeProcessingStep="idle",this.currentLShape=null,this.currentCandidateIndex=0,this.lShapeJustProcessed=!1,this.visualizationMode="l_shapes",this.intersectionPoints=[],this.tightRectangle=null,this.candidates=[],this.bestRoute=null,this.lastCollision=null,this.collidingCandidate=null}_handleIdleStep(){if(this.currentLShape=this.lShapesToProcess.shift(),!this.currentLShape){this.solved=!0;return}this.lShapeProcessingStep="intersections",this.visualizationMode="l_shapes"}_handleIntersectionsStep(){if(!this.currentLShape.traceId){this.lShapeProcessingStep="idle";return}let e=Gsi(this.input.allTraces,this.currentLShape.traceId),t=Wyn(this.currentLShape.p1,this.currentLShape.p2,e),n=Wyn(this.currentLShape.p2,this.currentLShape.p3,e);if(this.intersectionPoints=[...t,...n],t.length===0||n.length===0){this.lShapeProcessingStep="idle";return}this.rectangleCandidates=Xsi(t,n),this.currentRectangleIndex=0,this.lShapeProcessingStep="rectangle_selection"}_handleRectangleSelectionStep(){if(this.currentRectangleIndex>=this.rectangleCandidates.length){this.lShapeProcessingStep="idle";return}let{rect:e,i1:t,i2:n}=this.rectangleCandidates[this.currentRectangleIndex];this.tightRectangle=e,this.candidates=Wsi({lShape:this.currentLShape,rectangle:this.tightRectangle,padding:2*this.input.paddingBuffer,interactionPoint1:t,interactionPoint2:n}),this.currentCandidateIndex=0,this.lastCollision=null,this.collidingCandidate=null,this.visualizationMode="candidates",this.lShapeProcessingStep="candidate_evaluation"}_handleCandidateEvaluationStep(){if(this.visualizationMode="candidates",this.bestRouteFound){this._applyBestRoute(this.bestRouteFound),this.bestRouteFound=null;return}if(this.currentCandidateIndex>=this.candidates.length){this.currentRectangleIndex++,this.lShapeProcessingStep="rectangle_selection";return}let e=this.candidates[this.currentCandidateIndex],t=fve(e,this.input.allTraces,this.currentLShape.traceId);if(!t?.isColliding&&this._doesCandidateCrossChip(e)){this.lastCollision=null,this.collidingCandidate=e,this.currentCandidateIndex++;return}if(!t?.isColliding)this.bestRouteFound=e,this.lastCollision=null,this.collidingCandidate=null;else this.lastCollision=t,this.collidingCandidate=e,this.currentCandidateIndex++}_doesCandidateCrossChip(e){for(let t=0;t<e.length-1;t++)if(this.chipObstacleSpatialIndex.doesOrthogonalLineIntersectChip([e[t],e[t+1]]))return!0;return!1}_applyBestRoute(e){this.bestRoute=e,this.collidingCandidate=null,this.lastCollision=null;let t=this.input.allTraces.findIndex((n)=>n.mspPairId===this.currentLShape.traceId);if(t!==-1){let n=this.input.allTraces[t],o=n.tracePath.findIndex((r)=>r.x===this.currentLShape.p2.x&&r.y===this.currentLShape.p2.y);if(o!==-1){let r=[...n.tracePath.slice(0,o),...e,...n.tracePath.slice(o+1)];this.input.allTraces[t]={...n,tracePath:r},this.lShapesToProcess=this.lShapesToProcess.filter((i)=>i.traceId!==this.currentLShape.traceId)}}this.lShapeJustProcessed=!0}getOutput(){return{traces:this.input.allTraces}}visualize(){switch(this.visualizationMode){case"l_shapes":return Q9e(this.lShapesToProcess);case"intersection_points":return Fot([this.currentLShape?Q9e(this.currentLShape):void 0,jyn(this.intersectionPoints)]);case"tight_rectangle":return Fot([this.currentLShape?Q9e(this.currentLShape):void 0,jyn(this.intersectionPoints),this.tightRectangle?Kyn(this.tightRectangle):void 0]);case"candidates":{if(this.lShapeJustProcessed){let n={lines:[]};for(let o of this.input.allTraces){let r=o.mspPairId===this.currentLShape?.traceId;for(let i=0;i<o.tracePath.length-1;i++)n.lines.push({points:[o.tracePath[i],o.tracePath[i+1]],strokeColor:r?"green":"#ccc"})}return n}let e={lines:[]};for(let n of this.input.allTraces)for(let o=0;o<n.tracePath.length-1;o++)e.lines.push({points:[n.tracePath[o],n.tracePath[o+1]],strokeColor:"#ccc"});let t;if(this.bestRouteFound)t=this.bestRouteFound;else if(this.lastCollision?.isColliding)t=this.collidingCandidate??void 0;else if(this.currentCandidateIndex<this.candidates.length)t=this.candidates[this.currentCandidateIndex];return Fot([e,this.currentLShape?Q9e(this.currentLShape):void 0,this.tightRectangle?Kyn(this.tightRectangle):void 0,t?jsi([t],this.bestRouteFound?"green":"blue",this.intersectionPoints):void 0,this.lastCollision?Ksi(this.lastCollision):void 0])}default:return{}}}},aSn=0.000001,k9e=(e,t)=>Math.abs(e.x-t.x)<=aSn,L9e=(e,t)=>Math.abs(e.y-t.y)<=aSn,qsi=(e)=>{if(e.length!==4)return!1;let[t,n,o,r]=e,i=L9e(t,n)&&k9e(n,o)&&L9e(o,r)&&k9e(t,r),s=k9e(t,n)&&L9e(n,o)&&k9e(o,r)&&L9e(t,r);return i||s},cSn=(e)=>{let t=[e];for(let n=1;n<e.length-3;n++)for(let o=n+2;o<e.length-1;o++)for(let r of Jit(e[n],e[o])){let i=Mi([...e.slice(0,n),...r,...e.slice(o+1)]);if([[0,1],[-1,-2]].every(([a,c])=>{let l=e.at(a),h=e.at(c),d=i.at(c);return(h.x-l.x)*(d.x-l.x)+(h.y-l.y)*(d.y-l.y)>0}))t.push(i)}return t},$yn=0.000001,Jsi=(e,t,n)=>{let o=e.tracePath[t],r=e.tracePath[t+1],i={minX:Math.min(o.x,r.x),minY:Math.min(o.y,r.y),maxX:Math.max(o.x,r.x),maxY:Math.max(o.y,r.y)};for(let s of n){if(s.globalConnNetId!==e.globalConnNetId)continue;if(!s.pinIds.every((c)=>e.pinIds.includes(c)))continue;if(!Vs(e.tracePath,s.anchorPoint))continue;let a=Ui(s.center,s.width,s.height);i.minX=Math.min(i.minX,a.minX),i.minY=Math.min(i.minY,a.minY),i.maxX=Math.max(i.maxX,a.maxX),i.maxY=Math.max(i.maxY,a.maxY)}return i},Zsi=(e,t,n)=>{let o=[];for(let r of e){if(!t.has(r.mspPairId))continue;for(let i=0;i<e.length;i++){let s=e[i];if(s.mspPairId===r.mspPairId)continue;if(t.has(s.mspPairId))continue;if(s.globalConnNetId===r.globalConnNetId)continue;if(n&&!n.has(s.mspPairId))continue;for(let a of xG(s.tracePath,r.tracePath,{includeTerminalSegments:!0}))o.push({traceIndex:i,connector:r,connectorSegmentIndex:a.otherPathSegmentIndex,traceSegmentIndex:a.pathSegmentIndex})}}return o},eai=({inputProblem:e,traces:t,netLabelPlacements:n,mergedLabelNetIdMap:o,clearance:r,eligibleTraceIds:i,connectorTraceIds:s})=>{let a=[...t],c=Cx(e).filter((h)=>h.kind==="chip"||h.kind==="text_box"),l=0;while(!0){let h=Zsi(a,s,i).flatMap((u)=>{let _=a[u.traceIndex],p=Jsi(u.connector,u.connectorSegmentIndex,n),m=a.filter((g)=>g.mspPairId!==_.mspPairId&&g.globalConnNetId!==_.globalConnNetId),A=n.filter((g)=>{let f=o[g.globalConnNetId];return f?!f.has(_.globalConnNetId):g.globalConnNetId!==_.globalConnNetId}).map((g)=>Ui(g.center,g.width,g.height));return tst({trace:_,segmentIndex:u.traceSegmentIndex,obstacleStart:u.connector.tracePath[u.connectorSegmentIndex],obstacleEnd:u.connector.tracePath[u.connectorSegmentIndex+1],obstacleBounds:p,chipBounds:[],clearance:r}).flatMap((g)=>cSn(g.path).map((f)=>({...g,path:f}))).filter((g)=>V5(g.path)<=V5(_.tracePath)+$yn&&y2(g.path)<=y2(_.tracePath)+2&&!ZZ(g.path,c)&&!Ave(g.path,A)&&!fve(g.path,m,_.mspPairId).isColliding&&!fL(g.path,m)).map((g)=>({...g,traceIndex:u.traceIndex}))});h.sort((u,_)=>{let p=V5(u.path)-V5(_.path);return Math.abs(p)>$yn?p:y2(u.path)-y2(_.path)});let d=h[0];if(!d)break;a[d.traceIndex]={...a[d.traceIndex],tracePath:d.path},l++}return{traces:a,reroutedTraceCount:l}},tai=["untangling_traces","minimizing_turns","balancing_l_shapes"],qyn=class extends Gu{input;outputTraces;traceIdQueue;tracesMap;operations;operationIndex=0;pipelineStep;activeTraceId=null;activeSubSolver=null;constructor(e){super();this.input=e,this.outputTraces=[...e.allTraces],this.tracesMap=new Map(this.outputTraces.map((t)=>[t.mspPairId,t])),this.operations=e.operations??tai,this.pipelineStep=this.operations[0]??null,this.traceIdQueue=Array.from(e.allTraces.map((t)=>t.mspPairId))}_step(){if(this.activeSubSolver){if(this.activeSubSolver.step(),this.activeSubSolver.solved){let e=this.activeSubSolver.getOutput();this.outputTraces=e.traces,this.tracesMap=new Map(this.outputTraces.map((t)=>[t.mspPairId,t])),this.activeSubSolver=null,this._advancePipeline()}else if(this.activeSubSolver.failed)this.activeSubSolver=null,this._advancePipeline();return}if(!this.pipelineStep){this.solved=!0;return}switch(this.pipelineStep){case"untangling_traces":this._runUntangleTracesStep();break;case"rerouting_generated_net_label_connector_crossings":this._runGeneratedNetLabelConnectorCrossingRerouteStep();break;case"minimizing_turns":this._runMinimizeTurnsStep();break;case"balancing_l_shapes":this._runBalanceLShapesStep();break;case"aligning_same_net_rails":this._runAlignSameNetRailsStep();break}}_advancePipeline(){if(this.operationIndex++,this.pipelineStep=this.operations[this.operationIndex]??null,this.traceIdQueue=this.outputTraces.map((e)=>e.mspPairId),this.pipelineStep)this.activeTraceId=null}_runUntangleTracesStep(){this.activeSubSolver=new $si({...this.input,allTraces:Array.from(this.tracesMap.values())})}_runGeneratedNetLabelConnectorCrossingRerouteStep(){let e=eai({inputProblem:this.input.inputProblem,traces:this.outputTraces,netLabelPlacements:this.input.allLabelPlacements,mergedLabelNetIdMap:this.input.mergedLabelNetIdMap,clearance:this.input.paddingBuffer,eligibleTraceIds:this.input.eligibleTraceIds,connectorTraceIds:this.input.netLabelConnectorTraceIds??new Set});this.outputTraces=e.traces,this.tracesMap=new Map(this.outputTraces.map((t)=>[t.mspPairId,t])),this.stats.reroutedGeneratedConnectorCrossingTraceCount=e.reroutedTraceCount,this._advancePipeline()}_runMinimizeTurnsStep(){if(this.traceIdQueue.length===0){this._advancePipeline();return}this._processTrace("minimizing_turns")}_runBalanceLShapesStep(){if(this.traceIdQueue.length===0){this._advancePipeline();return}this._processTrace("balancing_l_shapes")}_processTrace(e){let t=this.traceIdQueue.shift();this.activeTraceId=t;let n=this.tracesMap.get(t);if(qsi(n.tracePath))return;let o=Array.from(this.tracesMap.values()),r;if(e==="minimizing_turns")r=K7n({...this.input,targetMspConnectionPairId:t,traces:o});else r=hsi({...this.input,targetMspConnectionPairId:t,traces:o});this.tracesMap.set(t,r),this.outputTraces=Array.from(this.tracesMap.values())}_runAlignSameNetRailsStep(){let e=Vsi({inputProblem:this.input.inputProblem,traces:this.outputTraces,netLabelPlacements:this.input.allLabelPlacements,eligibleTraceIds:this.input.eligibleTraceIds??new Set(this.outputTraces.map((t)=>t.mspPairId))});this.outputTraces=e.traces,this.tracesMap=new Map(this.outputTraces.map((t)=>[t.mspPairId,t])),this.stats.alignedRailGroupCount=e.alignedRailGroupCount,this.stats.alignedTraceCount=e.alignedTraceCount,this._advancePipeline()}getOutput(){return{traces:this.outputTraces}}visualize(){if(this.activeSubSolver)return this.activeSubSolver.visualize();let e=Bp(this.input.inputProblem,{chipAlpha:0.1,connectionAlpha:0.1});if(!e.lines)e.lines=[];if(!e.points)e.points=[];if(!e.rects)e.rects=[];if(!e.circles)e.circles=[];if(!e.texts)e.texts=[];for(let t of this.outputTraces){let n={points:t.tracePath.map((o)=>({x:o.x,y:o.y})),strokeColor:t.mspPairId===this.activeTraceId?"red":"blue"};e.lines.push(n)}return e}},nai=({tracePath:e,sourcePoint:t,extensionEndPoint:n})=>{let o=e.findIndex((s)=>pT(s,t));if(o<=0||o>=e.length-1)return null;let r=n.y-t.y,i=[o-1,o+1].find((s)=>{let a=e[s];return M1(a,t)&&(a.y-t.y)*r<0});if(i===void 0)return null;return e.toSpliced(Math.max(o,i),0,n)},wct=(e)=>{let t={};for(let n of e.chips)for(let o of n.pins)t[o.pinId]={...o,chipId:n.chipId};return t},Bct=(e,t)=>{let n=e.pinIds.flatMap((r)=>{let i=t[r];return i?[i]:[]});if(n.length>=2)return[n[0],n[1]];if(n.length===1)return[n[0],n[0]];let o={pinId:`${e.globalConnNetId}-netlabel-anchor`,x:e.anchorPoint.x,y:e.anchorPoint.y,chipId:"available-net-orientation"};return[o,o]},oai=(e)=>({orientation:e.orientation,anchorPoint:e.anchorPoint,center:e.center,width:e.width,height:e.height}),Pp=(e)=>{switch(e){case"x+":return{x:1,y:0};case"x-":return{x:-1,y:0};case"y+":return{x:0,y:1};case"y-":return{x:0,y:-1}}throw Error(`Invalid facing direction: ${e}`)},Tct=(e,t,n)=>{let o=Psi(t,e);if(!o)return null;let r=Msi(n,o.index,t.length-1,o.orientation,e);if(!r)return wsi(e,n);return Mct(e,r.start,r.end)},lSn=(e,t)=>e.globalConnNetId===t.globalConnNetId||e.mspConnectionPairIds.includes(t.mspPairId),eee=({trace:e,originalTracePath:t,reroutedTracePath:n,netLabelPlacements:o})=>o.map((r)=>{if(!lSn(r,e))return r;let i=Tct(r.anchorPoint,t,n);if(!i)return r;let s={x:i.x-r.anchorPoint.x,y:i.y-r.anchorPoint.y};return{...r,anchorPoint:i,center:{x:r.center.x+s.x,y:r.center.y+s.y}}}),rai=({originalTraces:e,reroutedTraces:t,netLabelPlacements:n})=>{let o=[...t],r=new Map(t.map((s)=>[s.mspPairId,s])),i=n.map((s)=>{let a=e.find((m)=>{if(!s.mspConnectionPairIds.includes(m.mspPairId))return!1;let A=r.get(m.mspPairId);if(!A)return!1;return A.tracePath!==m.tracePath});if(!a)return s;let c=r.get(a.mspPairId),l=e.findIndex((m)=>{if(m.mspPairId===a.mspPairId)return!1;if(m.globalConnNetId!==s.globalConnNetId)return!1;if(!Vs(m.tracePath,s.anchorPoint))return!1;return s.pinIds.every((A)=>m.pinIds.includes(A))});if(l<0)return s;let h=e[l],d=h.tracePath.find((m)=>Vs(a.tracePath,m));if(!d)return s;let u=Tct(d,a.tracePath,c.tracePath);if(!u)return s;let _={x:u.x-d.x,y:u.y-d.y},p={...h,tracePath:h.tracePath.map((m)=>({x:m.x+_.x,y:m.y+_.y}))};return o[l]=p,eee({trace:h,originalTracePath:h.tracePath,reroutedTracePath:p.tracePath,netLabelPlacements:[s]})[0]});return{traces:o,netLabelPlacements:i}},iai=(e,t)=>{for(let n=0;n<e.length-1;n++){let o=e[n],r=e[n+1];for(let i of t){if(!Ect(o,r,i))continue;if(hSn(o,r,i)>Vu)return!0}}return!1},sai=(e,t)=>{let n=0;for(let o=0;o<e.length-1;o++){let r=e[o],i=e[o+1];for(let s of t){if(!Ect(r,i,s))continue;let a=hSn(r,i,s);if(a>Vu)n+=a}}return n},hSn=(e,t,n)=>{if(Math.abs(e.x-t.x)<Vu)return Math.min(Math.max(e.y,t.y),n.maxY)-Math.max(Math.min(e.y,t.y),n.minY);return Math.min(Math.max(e.x,t.x),n.maxX)-Math.max(Math.min(e.x,t.x),n.minX)},$3=0.1,aai=16,cai=({x:e,lowY:t,highY:n,outputTraces:o,netId:r})=>{for(let i of o){if(i.globalConnNetId===r)continue;let s=i.tracePath;for(let a=0;a+1<s.length;a++){let c=s[a],l=s[a+1];if(Math.abs(c.x-l.x)>=0.000000001)continue;if(Math.abs(c.x-e)>=$3/2)continue;let h=Math.min(c.y,l.y),d=Math.max(c.y,l.y);if(Math.min(n,d)-Math.max(t,h)>0.000001)return!0}}return!1},lai=({trace:e,obstacleLabel:t,inputProblem:n,outputTraces:o,outputNetLabelPlacements:r,chipObstacles:i})=>{let s=hai({trace:e,label:t,inputProblem:n,outputTraces:o,outputNetLabelPlacements:r,chipObstacles:i}),a=pai({trace:e,obstacleLabel:t,outputTraces:o,outputNetLabelPlacements:r,candidateResults:s,chipObstacles:i});return _ai(s,a),{bestPath:a,candidateResults:s}},hai=({trace:e,label:t,inputProblem:n,outputTraces:o,outputNetLabelPlacements:r,chipObstacles:i})=>{let s=new Set,a=[],c=mai({trace:e,label:t,outputTraces:o});if(c)a.push(Jyn({trace:e,obstacleLabel:t,path:c,seen:s,outputTraces:o,outputNetLabelPlacements:r,chipObstacles:i,usesHorizontalSegmentPush:!0}));let l=[...uai(e,t),...O7n({trace:e,label:t,problem:n,paddingBuffer:$3,detourCount:0}),...dai(e,t)];for(let h of l)a.push(Jyn({trace:e,obstacleLabel:t,path:Mi(h),seen:s,outputTraces:o,outputNetLabelPlacements:r,chipObstacles:i}));return a},Jyn=({trace:e,obstacleLabel:t,path:n,seen:o,outputTraces:r,outputNetLabelPlacements:i,chipObstacles:s,usesHorizontalSegmentPush:a})=>{let c=Isi(n);if(o.has(c))return{path:n,status:"duplicate",usesHorizontalSegmentPush:a,selected:!1};if(o.add(c),sSn(n,s))return{path:n,status:"chip-collision",usesHorizontalSegmentPush:a,selected:!1};return{path:n,score:dSn({trace:e,tracePath:n,obstacleLabel:t,outputTraces:r,outputNetLabelPlacements:i,chipObstacles:s}),status:"valid",usesHorizontalSegmentPush:a,selected:!1}},dai=(e,t)=>{let n=e.tracePath[0],o=e.tracePath[e.tracePath.length-1];if(!n||!o)return[];let r=e.tracePath[1]??n,i=e.tracePath[e.tracePath.length-2]??o,s=Ui(t.center,t.width,t.height),a=$3,c=Pp(t.orientation),l=c.x<0?s.minX-a:s.maxX+a,h=c.x<0?s.maxX+a:s.minX-a,d=s.maxY+a,u=s.minY-a,_=[];for(let p of[l,h])_.push([n,r,{x:r.x,y:d},{x:p,y:d},{x:p,y:u},{x:i.x,y:u},i,o],[n,r,{x:r.x,y:u},{x:p,y:u},{x:p,y:d},{x:i.x,y:d},i,o]);return _},uai=(e,t)=>{let n=e.tracePath[0],o=e.tracePath[e.tracePath.length-1];if(!n||!o)return[];let r=e.tracePath[1]??n,i=e.tracePath[e.tracePath.length-2]??o,s=Pp(t.orientation);if(s.x===0)return[];let a=Ui(t.center,t.width,t.height),c=s.x<0?a.minX-$3:a.maxX+$3,l=a.maxY+$3,h=a.minY-$3,d=r.y>=i.y,u=d?l:h,_=d?h:l;return[[n,r,{x:r.x,y:u},{x:c,y:u},{x:c,y:_},{x:i.x,y:_},i,o],[n,r,{x:r.x,y:_},{x:c,y:_},{x:c,y:u},{x:i.x,y:u},i,o]]},pai=({trace:e,obstacleLabel:t,outputTraces:n,outputNetLabelPlacements:o,candidateResults:r,chipObstacles:i})=>{for(let c of r){if(!c.usesHorizontalSegmentPush)continue;if(c.status!=="valid")continue;if(!c.score)continue;return c.path}let s=null,a=dSn({trace:e,tracePath:e.tracePath,obstacleLabel:t,outputTraces:n,outputNetLabelPlacements:o,chipObstacles:i});for(let c of r){if(c.status!=="valid"||!c.score)continue;if(!Aai(c.score,a))continue;a=c.score,s=c.path}return s},mai=({trace:e,label:t,outputTraces:n})=>{let o=Pp(t.orientation);if(o.x===0)return null;let r=e.tracePath,i=Ui(t.center,t.width,t.height),s=r.findIndex((f,y)=>{let x=r[y+1];if(!x)return!1;if(Math.abs(f.x-x.x)>=0.000000001)return!1;return Rv(f,x,i)});if(s<=0||s>=r.length-2)return null;let a=r[s-1],c=r[s],l=r[s+1],h=r[s+2];if(Math.abs(a.y-c.y)>=0.000000001||Math.abs(l.y-h.y)>=0.000000001)return null;let d=i.minX-$3;if(o.x>0)d=i.maxX+$3;let u=o.x>0?$3:-$3,_=Math.min(c.y,l.y),p=Math.max(c.y,l.y);for(let f=0;f<aai;f++){if(!cai({x:d,lowY:_,highY:p,outputTraces:n,netId:e.globalConnNetId}))break;d+=u}let m=Zyn({start:a,end:{x:d,y:c.y},labelBounds:i}),A=Zyn({start:{x:d,y:l.y},end:h,labelBounds:i}),g=[...r.slice(0,s-1),a];if(Math.abs(a.y-m)>=0.000000001)g.push({x:a.x,y:m});if(g.push({x:d,y:m}),g.push({x:d,y:A}),Math.abs(h.y-A)>=0.000000001)g.push({x:h.x,y:A});return g.push(h,...r.slice(s+3)),Mi(g)},Zyn=({start:e,end:t,labelBounds:n})=>{if(!Rv(e,t,n))return e.y;let o=(n.minY+n.maxY)/2;if(e.y>=o)return n.maxY+$3;return n.minY-$3},_ai=(e,t)=>{if(!t)return;for(let n of e)n.selected=n.path===t},dSn=({trace:e,tracePath:t,obstacleLabel:n,outputTraces:o,outputNetLabelPlacements:r,chipObstacles:i})=>{let s={...e,tracePath:t};return{labelIntersections:Mp({traces:[s],netLabels:r}).length,labelHugDistance:fai(t,n),traceIntersections:gai(s,o),chipBoundaryOverlap:sai(t,i),pathLength:V5(t)}},gai=(e,t)=>{let n=0;for(let o of t){if(o.mspPairId===e.mspPairId)continue;n+=YP(e.tracePath,o.tracePath)}return n},Aai=(e,t)=>{let n=e.labelIntersections>0,o=t.labelIntersections>0;if(n!==o)return!n;if(e.chipBoundaryOverlap!==t.chipBoundaryOverlap)return e.chipBoundaryOverlap<t.chipBoundaryOverlap;if(e.labelIntersections!==t.labelIntersections)return e.labelIntersections<t.labelIntersections;if(e.labelHugDistance!==t.labelHugDistance)return e.labelHugDistance<t.labelHugDistance;if(e.traceIntersections!==t.traceIntersections)return e.traceIntersections<t.traceIntersections;return e.pathLength<t.pathLength},fai=(e,t)=>{let n=Ui(t.center,t.width,t.height),o=0;for(let r of e)o+=yai(r,n);return o},yai=(e,t)=>{let n=Math.max(t.minX-e.x,0,e.x-t.maxX),o=Math.max(t.minY-e.y,0,e.y-t.maxY);return n+o},xai=(e)=>{let{trace:t,outputTraces:n}=e,o=0;for(let r of n){if(r.mspPairId===t.mspPairId)continue;if(r.globalConnNetId===t.globalConnNetId)continue;o+=YP(t.tracePath,r.tracePath)}return o},exn=(e)=>{let{traces:t,outputTraces:n,chipObstacles:o}=e,r=0,i=0;for(let s of t){if(iai(s.tracePath,o))r+=1;i+=xai({trace:s,outputTraces:n})}return{chipEdgeRuns:r,traceCrossings:i}},Cai="blue",uSn="red",bai=(e)=>{let t=Bp(e.inputProblem);if(Iai(t,e),vai(t,e),!e.solved)Sai(t,e.currentCandidateResults),Pai(t,e);return t},Iai=(e,t)=>{for(let n of t.outputTraces)e.lines.push({points:n.tracePath,strokeColor:"purple"})},vai=(e,t)=>{for(let n of t.outputNetLabelPlacements){let o=Vc(n.globalConnNetId,0.35);e.rects.push({center:n.center,width:n.width,height:n.height,fill:o,strokeColor:Vc(n.globalConnNetId,0.9),label:`netId: ${n.netId}
globalConnNetId: ${n.globalConnNetId}`}),e.points.push({...n.anchorPoint,color:Vc(n.globalConnNetId,0.9),label:`anchorPoint
orientation: ${n.orientation}`})}},Sai=(e,t)=>{for(let n of t){let o=n.score?`
label intersections: ${n.score.labelIntersections}
trace intersections: ${n.score.traceIntersections}`:"";e.lines.push({points:n.path,strokeColor:n.selected?Cai:uSn,strokeDash:n.selected?void 0:"4 2",label:`${n.selected?"selected":n.status} reroute${o}`})}},Pai=(e,t)=>{if(!t.currentOverlap)return;let n=t.currentOverlap.label;e.rects.push({center:n.center,width:n.width,height:n.height,fill:"rgba(255, 0, 0, 0.2)",strokeColor:uSn,label:`overlap target
${n.netId??n.globalConnNetId}`})},Eai=0.1,Mai=10,txn=0.1,wai=(e,t)=>{if(!e)return!1;if(e.chipEdgeRuns!==t.chipEdgeRuns)return e.chipEdgeRuns<t.chipEdgeRuns;return e.traceCrossings<t.traceCrossings},Bai=class extends Gu{inputProblem;traces;netLabelPlacements;outputTraces;outputNetLabelPlacements;queuedOverlaps=[];currentOverlap=null;currentCandidateResults=[];chipObstacles;pinMap;constructor(e){super();this.inputProblem=e.inputProblem,this.traces=e.traces,this.netLabelPlacements=e.netLabelPlacements,this.outputTraces=[...e.traces],this.outputNetLabelPlacements=[...e.netLabelPlacements],this.chipObstacles=Cx(e.inputProblem),this.pinMap=wct(e.inputProblem),this.initializeQueuedOverlaps(),this.currentOverlap=this.queuedOverlaps[0]??null}getConstructorParams(){return{inputProblem:this.inputProblem,traces:this.traces,netLabelPlacements:this.netLabelPlacements}}_step(){let e=this.queuedOverlaps.shift();if(!e){this.finish();return}if(!this.isOverlapStillPresent(e)){this.currentOverlap=e,this.currentCandidateResults=[];return}this.rerouteOverlappingTrace(e)}finish(){this.currentOverlap=null,this.currentCandidateResults=[],this.solved=!0}initializeQueuedOverlaps(){let e=[],t=new Set;for(let n of this.getTraceLabelOverlaps()){if(!this.shouldRerouteOverlap(n))continue;let o=this.getOverlapKey(n);if(t.has(o))continue;t.add(o),e.push(n)}this.queuedOverlaps=e}getTraceLabelOverlaps(){return Mp({traces:this.outputTraces,netLabels:this.outputNetLabelPlacements})}shouldRerouteOverlap(e){return this.isXFacingLabel(e.label)&&!this.hasExplicitOrientationConstraint(e.label)}isXFacingLabel(e){return e.orientation==="x+"||e.orientation==="x-"}hasExplicitOrientationConstraint(e){let t=e.netId??e.globalConnNetId;return Object.hasOwn(this.inputProblem.availableNetLabelOrientations,t)}getOverlapKey(e){let t=e.label.netId??e.label.globalConnNetId;return`${e.trace.mspPairId}:${t}:${e.label.anchorPoint.x}:${e.label.anchorPoint.y}`}isOverlapStillPresent(e){let t=this.getCurrentTrace(e.trace);if(!t)return!1;return Mp({traces:[t],netLabels:[e.label]}).length>0}getCurrentTrace(e){return this.outputTraces.find((t)=>t.mspPairId===e.mspPairId)}rerouteOverlappingTrace(e){this.currentOverlap=e,this.currentCandidateResults=[];let t=this.outputTraces.findIndex((a)=>a.mspPairId===e.trace.mspPairId);if(t===-1)return;let n=this.outputTraces[t],o=this.tryMoveLabelOutward(e.label),r=lai({trace:n,obstacleLabel:e.label,inputProblem:this.inputProblem,outputTraces:this.outputTraces,outputNetLabelPlacements:this.outputNetLabelPlacements,chipObstacles:this.chipObstacles});this.currentCandidateResults=r.candidateResults;let i=null;if(r.bestPath)i=exn({traces:[{...n,tracePath:r.bestPath}],outputTraces:this.outputTraces,chipObstacles:this.chipObstacles});if(o){let a=exn({traces:[o.connectorTrace,n],outputTraces:this.outputTraces,chipObstacles:this.chipObstacles});if(!wai(i,a)){this.outputNetLabelPlacements[o.labelIndex]=o.movedLabel,this.outputTraces.push(o.connectorTrace);return}}if(!r.bestPath)return;let s=n.tracePath;this.outputTraces[t]={...n,tracePath:r.bestPath},this.outputNetLabelPlacements=eee({trace:n,originalTracePath:s,reroutedTracePath:r.bestPath,netLabelPlacements:this.outputNetLabelPlacements})}tryMoveLabelOutward(e){let t=this.outputNetLabelPlacements.findIndex((r)=>r.globalConnNetId===e.globalConnNetId&&r.anchorPoint.x===e.anchorPoint.x&&r.anchorPoint.y===e.anchorPoint.y&&r.pinIds.join(",")===e.pinIds.join(","));if(t===-1)return null;let n=this.outputNetLabelPlacements[t];if(n.mspConnectionPairIds.length>0)return null;if(n.pinIds.length!==1)return null;if(this.outputNetLabelPlacements.filter((r)=>r.globalConnNetId===n.globalConnNetId).length!==1)return null;let o=Pp(n.orientation);if(o.x===0&&o.y===0)return null;for(let r=1;r<=Mai;r++){let i=r*Eai,s={...n,anchorPoint:{x:n.anchorPoint.x+o.x*i,y:n.anchorPoint.y+o.y*i},center:{x:n.center.x+o.x*i,y:n.center.y+o.y*i}},a={...s,width:s.width+txn*2,height:s.height+txn*2};if(Mp({traces:this.outputTraces,netLabels:[a]}).length>0)continue;let c=Dai({label:n,movedLabel:s,pinMap:this.pinMap});if(Mp({traces:[c],netLabels:this.outputNetLabelPlacements}).length>0)continue;return{labelIndex:t,movedLabel:s,connectorTrace:c}}return null}visualize(){return bai({inputProblem:this.inputProblem,outputTraces:this.outputTraces,outputNetLabelPlacements:this.outputNetLabelPlacements,solved:this.solved,currentOverlap:this.currentOverlap,currentCandidateResults:this.currentCandidateResults})}},Tai=(e)=>`port-only-label-connector-${e.globalConnNetId}-${e.pinIds[0]}`,Dai=({label:e,movedLabel:t,pinMap:n})=>{let o=Tai(e);return{mspPairId:o,dcConnNetId:e.dcConnNetId??e.globalConnNetId,globalConnNetId:e.globalConnNetId,userNetId:e.netId,pins:Bct(e,n),tracePath:[e.anchorPoint,t.anchorPoint],mspConnectionPairIds:[o],pinIds:e.pinIds}},nxn=(e)=>e.mspConnectionPairIds.length===0,Nai=({labelIndices:e,netLabelPlacements:t})=>{let n=[...e];for(let o of e){let r=t[o];if(nxn(r))continue;let i=Ui(r.center,r.width,r.height),s=n.findIndex((c)=>{let l=t[c];if(!nxn(l))return!1;if(l.globalConnNetId===r.globalConnNetId)return!1;let h=Ui(l.center,l.width,l.height);return wde(i,h)}),a=n.indexOf(o);if(s===-1||s>a)continue;n.splice(a,1),n.splice(s,0,o)}return n},Rai=(e)=>{let t=Bp(e.inputProblem);return Fai(t),Qai(t,e.traces),kai(t,e.outputNetLabelPlacements),Lai(t,e.currentLabel,e.solved),Hai(t,e.currentCandidateResults,e.solved),t},Qai=(e,t)=>{for(let n of t)e.lines.push({points:n.tracePath,strokeColor:"purple"})},kai=(e,t)=>{for(let n of t)e.rects.push({center:n.center,width:n.width,height:n.height,fill:Vc(n.globalConnNetId,0.35),strokeColor:Vc(n.globalConnNetId,0.9),label:`netId: ${n.netId}
globalConnNetId: ${n.globalConnNetId}`}),e.points.push({x:n.anchorPoint.x,y:n.anchorPoint.y,color:Vc(n.globalConnNetId,0.9),label:`anchorPoint
orientation: ${n.orientation}`})},Lai=(e,t,n)=>{if(!t||n)return;e.rects.push({center:t.center,width:t.width,height:t.height,fill:"rgba(255, 0, 0, 0.2)",strokeColor:$7n,label:`available orientation target
${t.netId??t.globalConnNetId}`})},Hai=(e,t,n)=>{if(n)return;for(let o of t){let r=o.selected?dsi:$7n,i=o.distance===void 0?"":`
distance: ${o.distance.toFixed(3)}`,s=o.outwardDistance===void 0||o.outwardDistance===0?"":`
outward distance: ${o.outwardDistance.toFixed(3)}`;e.rects.push({center:o.center,width:o.width,height:o.height,fill:o.selected?"rgba(0, 0, 255, 0.2)":"rgba(255, 0, 0, 0.15)",strokeColor:r,strokeDash:o.selected?void 0:"4 2",label:`${o.selected?"selected":o.status} available orientation
phase: ${o.phase}
orientation: ${o.orientation}${i}${s}`}),e.points.push({x:o.anchorPoint.x,y:o.anchorPoint.y,color:r,label:`candidate anchor
${o.phase}
${o.orientation}`})}},Fai=(e)=>{if(!e.lines)e.lines=[];if(!e.points)e.points=[];if(!e.rects)e.rects=[];if(!e.circles)e.circles=[];if(!e.texts)e.texts=[]},zai=class{chipObstacleSpatialIndex;labelIndex=null;traceSegmentIndex=null;traceSegments=[];constructor(e){this.chipObstacleSpatialIndex=e.chipObstacleSpatialIndex,this.rebuild(e)}rebuild(e){this.labelIndex=this.buildLabelIndex(e.netLabelPlacements),this.traceSegments=this.getTraceSegments(e.traces),this.traceSegmentIndex=this.buildTraceSegmentIndex(this.traceSegments)}getLabelIndicesInBounds(e){if(!this.labelIndex)return[];return this.labelIndex.search(e.minX,e.minY,e.maxX,e.maxY)}getTraceSegmentsInBounds(e){if(!this.traceSegmentIndex)return[];let t=zot(e,Qr);return this.traceSegmentIndex.search(t.minX,t.minY,t.maxX,t.maxY).map((n)=>this.traceSegments[n])}getLabelIndicesNearTracePath(e){let t=new Set;for(let n=0;n<e.length-1;n++){let o=zot(oxn(e[n],e[n+1]),Qr);for(let r of this.getLabelIndicesInBounds(o))t.add(r)}return[...t].sort((n,o)=>n-o)}doesTracePathCrossChip(e){for(let t=0;t<e.length-1;t++){let n=e[t],o=e[t+1],r=this.chipObstacleSpatialIndex.getChipsInBounds(zot(oxn(n,o),Qr));for(let i of r)if(Rue(n,o,i.bounds))return!0}return!1}doesTraceCrossBoundsInterior(e){for(let t of this.getTraceSegmentsInBounds(e))if(Rue(t.start,t.end,e))return!0;return!1}doesTraceIntersectBounds(e){for(let t of this.getTraceSegmentsInBounds(e.bounds)){if(t.trace.globalConnNetId===e.excludedGlobalConnNetId)continue;if(Rv(t.start,t.end,e.bounds))return!0}return!1}buildLabelIndex(e){if(e.length===0)return null;let t=new qit(e.length);for(let n of e)t.add(n.center.x-n.width/2,n.center.y-n.height/2,n.center.x+n.width/2,n.center.y+n.height/2);return t.finish(),t}getTraceSegments(e){let t=[];for(let n of e)for(let o=0;o<n.tracePath.length-1;o++)t.push({trace:n,start:n.tracePath[o],end:n.tracePath[o+1]});return t}buildTraceSegmentIndex(e){if(e.length===0)return null;let t=new qit(e.length);for(let n of e)t.add(Math.min(n.start.x,n.end.x),Math.min(n.start.y,n.end.y),Math.max(n.start.x,n.end.x),Math.max(n.start.y,n.end.y));return t.finish(),t}};function oxn(e,t){return{minX:Math.min(e.x,t.x),minY:Math.min(e.y,t.y),maxX:Math.max(e.x,t.x),maxY:Math.max(e.y,t.y)}}function zot(e,t){return{minX:e.minX-t,minY:e.minY-t,maxX:e.maxX+t,maxY:e.maxY+t}}var pde=0.1,Oai=0.2,rxn=0.1,Vai=class extends Gu{inputProblem;traces;netLabelPlacements;netLabelConnectorTraceIds=new Set;outputNetLabelPlacements;queuedLabelIndices=[];currentLabelIndex=null;currentLabel=null;currentCandidateResults=[];crowdedPortOnlyLabelIndices=new Set;blockedStandaloneLabelIndex=null;blockedStandaloneLabelTargetAnchorX=null;traceMap;chipObstacleSpatialIndex;maxSearchDistance;pinMap;obstacleIndex;constructor(e){super();this.inputProblem=e.inputProblem,this.traces=[...e.traces],this.netLabelPlacements=e.netLabelPlacements,this.outputNetLabelPlacements=[...e.netLabelPlacements],this.traceMap=Object.fromEntries(this.traces.map((t)=>[t.mspPairId,t])),this.pinMap=wct(e.inputProblem),this.chipObstacleSpatialIndex=e.inputProblem._chipObstacleSpatialIndex??new u7e(e.inputProblem.chips),this.maxSearchDistance=q7n(e.inputProblem),this.obstacleIndex=new zai({chipObstacleSpatialIndex:this.chipObstacleSpatialIndex,netLabelPlacements:this.outputNetLabelPlacements,traces:this.traces}),this.crowdedPortOnlyLabelIndices=this.getCrowdedPortOnlyLabelIndices(),this.queuedLabelIndices=this.getProcessableLabelIndices(),this.setCurrentLabel(this.queuedLabelIndices[0]??null)}getConstructorParams(){return{inputProblem:this.inputProblem,traces:this.traces,netLabelPlacements:this.netLabelPlacements}}_step(){let e=this.queuedLabelIndices.shift();if(e===void 0){this.finish();return}this.processLabel(e)}getOutput(){return{traces:this.traces,netLabelPlacements:this.outputNetLabelPlacements,netLabelConnectorTraceIds:this.netLabelConnectorTraceIds}}getProcessableLabelIndices(){let e=[];for(let h=0;h<this.outputNetLabelPlacements.length;h++)if(this.shouldProcessLabel(this.outputNetLabelPlacements[h],h))e.push(h);this.sortCrowdedTopBankByPin(e);let t=Nai({labelIndices:e,netLabelPlacements:this.outputNetLabelPlacements}),n=t.find((h)=>{let d=this.outputNetLabelPlacements[h],u=this.getAvailableOrientations(d);return this.isPortOnlyLabel(d)&&this.isStandaloneSinglePinNetLabel(d)&&u.length===1&&au(u[0])&&this.labelIntersectsDifferentNetTrace(d)});if(n===void 0)return t;this.blockedStandaloneLabelIndex=n,this.blockedStandaloneLabelTargetAnchorX=null;let o=this.outputNetLabelPlacements[n],r=this.getAvailableOrientations(o)[0],i=this.getChipSideForPoint(o.anchorPoint),s=[],a=[];for(let h=0;h<t.length;h++){let d=t[h],u=this.outputNetLabelPlacements[d],_=this.getAvailableOrientations(u);if(this.getChipSideForPoint(u.anchorPoint)===i&&_.length===1&&_[0]===r)s.push(h),a.push(d)}a.sort((h,d)=>{let u=this.outputNetLabelPlacements[h].anchorPoint.y,_=this.outputNetLabelPlacements[d].anchorPoint.y;return r==="y+"?_-u:u-_});let c=gP({inputProblem:this.inputProblem,netId:o.netId,pinIds:o.pinIds,isPortOnlyLabel:this.isPortOnlyLabel(o)}),l;if(c!==void 0)l=a.find((h)=>{if(h===n)return!1;let d=this.outputNetLabelPlacements[h];return gP({inputProblem:this.inputProblem,netId:d.netId,pinIds:d.pinIds,isPortOnlyLabel:this.isPortOnlyLabel(d)})===c});if(l!==void 0){let h=this.outputNetLabelPlacements[l];this.blockedStandaloneLabelTargetAnchorX=this.getSearchStartAnchor(h,r).x}for(let h=0;h<s.length;h++)t[s[h]]=a[h];return t}sortCrowdedTopBankByPin(e){let t=new Map;for(let n=0;n<e.length;n++){let o=e[n];if(!this.crowdedPortOnlyLabelIndices.has(o))continue;let r=this.outputNetLabelPlacements[o];if(this.getChipSideForPoint(r.anchorPoint)!=="top")continue;let i=this.pinMap[r.pinIds[0]];if(!i)continue;let s=t.get(i.chipId)??[];s.push(n),t.set(i.chipId,s)}for(let n of t.values()){let o=n.map((r)=>e[r]).sort((r,i)=>{let s=this.pinMap[this.outputNetLabelPlacements[r].pinIds[0]],a=this.pinMap[this.outputNetLabelPlacements[i].pinIds[0]];return s.x-a.x});for(let r=0;r<n.length;r++)e[n[r]]=o[r]}}shouldProcessLabel(e,t){let n=this.getAvailableOrientations(e);if(n.length===0)return!1;if(!n.includes(e.orientation))return!0;if(this.getTextBlockedMultiPinRailTraces(e,n[0]))return!0;if(n.length===1&&au(n[0])&&this.isGroundLabel(e)){let i=Ui(e.center,e.width,e.height);if(this.outputNetLabelPlacements.some((a,c)=>{if(c===t)return!1;if(a.globalConnNetId===e.globalConnNetId)return!1;let l=this.getHorizontalConstraintMismatchBounds(a);return l?wde(i,l):!1}))return!0}if(!this.crowdedPortOnlyLabelIndices.has(t))return!1;let r=Ui(e.center,e.width,e.height);return this.outputNetLabelPlacements.some((i,s)=>{if(s===t)return!1;if(i.globalConnNetId===e.globalConnNetId)return!1;return wde(r,Ui(i.center,i.width,i.height))})}getCrowdedPortOnlyLabelIndices(){let e=new Map;for(let n=0;n<this.outputNetLabelPlacements.length;n++){let o=this.outputNetLabelPlacements[n];if(!this.isPortOnlyLabel(o))continue;if(!this.isStandaloneSinglePinNetLabel(o))continue;if(this.getAvailableOrientations(o).length===0)continue;let r=this.pinMap[o.pinIds[0]];if(!r)continue;let i=this.getChipSideForPoint(o.anchorPoint);if(!i)continue;let s=e.get(r.chipId)??new Map,a=s.get(i)??[];a.push(n),s.set(i,a),e.set(r.chipId,s)}let t=new Set;for(let n of e.values())for(let o of n.values()){let r=o.some((s)=>{let a=this.outputNetLabelPlacements[s];return!this.getAvailableOrientations(a).includes(a.orientation)}),i=o.some((s,a)=>{let c=this.outputNetLabelPlacements[s],l=Ui(c.center,c.width,c.height);return o.slice(a+1).some((h)=>{let d=this.outputNetLabelPlacements[h];return wde(l,Ui(d.center,d.width,d.height))})});if(!r||!i)continue;for(let s of o)t.add(s)}return t}processLabel(e){let t=this.outputNetLabelPlacements[e];this.setCurrentLabel(e),this.currentCandidateResults=[];let n=this.findCorrectedCandidate(t,e);if(!n)return;this.applyCandidate(t,n,e)}applyCandidate(e,t,n){this.outputNetLabelPlacements[n]={...e,...oai(t)},this.addConnectorTrace(e,t,n),this.obstacleIndex.rebuild({netLabelPlacements:this.outputNetLabelPlacements,traces:this.traces})}addConnectorTrace(e,t,n){if(t.phase==="trace-anchor")return;if(t.phase==="downward-ground-rail-extension")for(let s of e.mspConnectionPairIds){let a=this.traceMap[s];if(!a)continue;let c=nai({tracePath:a.tracePath,sourcePoint:e.anchorPoint,extensionEndPoint:t.anchorPoint});if(!c)continue;a.tracePath=c;return}let o=this.getCandidateConnectorTrace(e,t,n);if(o.length<2)return;let r=`available-net-orientation-${n}-${e.netId??e.globalConnNetId}`,i={mspPairId:r,dcConnNetId:e.dcConnNetId??e.globalConnNetId,globalConnNetId:e.globalConnNetId,userNetId:e.netId,pins:Bct(e,this.pinMap),tracePath:o,mspConnectionPairIds:[r],pinIds:e.pinIds};this.traces.push(i),this.traceMap[r]=i,this.netLabelConnectorTraceIds.add(r)}finish(){this.currentLabelIndex=null,this.currentLabel=null,this.currentCandidateResults=[],this.solved=!0}setCurrentLabel(e){this.currentLabelIndex=e,this.currentLabel=e===null?null:this.outputNetLabelPlacements[e]}findCorrectedCandidate(e,t){let n=this.getAvailableOrientations(e),o=n[0];if(this.crowdedPortOnlyLabelIndices.has(t)&&this.getChipSideForPoint(e.anchorPoint)==="top"&&au(o)){let p=this.findValidCrowdedTopVerticalFanoutCandidate(e,t,o);if(p)return p}let r=this.inputProblem.netConnections.find((p)=>p.netId===e.netId),i=r?.pinIds.length===2,s=r?.isGround&&FJ(e.orientation)&&n.length===1&&o==="y-"&&this.hasTraceContinuingInOrientation(e,"y+"),a=(r?.pinIds.length??0)>2&&au(o)&&this.hasPortOnlyLabelOnSameNet(e),c=this.getTextBlockedMultiPinRailTraces(e,o),l=au(o)&&this.hasOppositeVerticalRailOnSameChipSide(e,o);if(c){let p=this.findValidNearbyRailCandidate(e,o,t,c);if(p)return p}if(n.length===1&&au(o)&&this.isOutwardHorizontalFallback(e)&&this.hasTraceContinuingInOrientation(e,o)&&(a||l)){let p=this.findValidTraceAnchorCandidate(e,o,t);if(p){if(this.canPlaceVerticalLabelOnHostRail(p,e))return p;p.selected=!1}let m=this.findValidOutwardTraceAnchorCandidate(e,o,t);if(m)return m}if(i&&n.length===1&&au(o)&&this.hasTraceContinuingInOrientation(e,o)){let p=this.findValidCandidateInShiftColumn({label:e,labelIndex:t,orientation:o,direction:Pp(o),baseAnchor:this.getWickOffsetAnchor(e.anchorPoint,o),maxSearchDistance:this.maxSearchDistance,outwardDistance:0,stopOnTraceCollision:!1});if(p)return p}let h=this.findValidRotatedCandidate(e,t,n),d=h!==null&&Math.abs(h.anchorPoint.x-e.anchorPoint.x)>Qr;if(s&&d){let p=this.findValidCandidateInShiftColumn({label:e,labelIndex:t,orientation:o,direction:Pp(o),baseAnchor:e.anchorPoint,maxSearchDistance:this.getSearchDistanceLimit(e,o),outwardDistance:0,phase:"downward-ground-rail-extension",stopOnTraceCollision:!1,connectorSource:e.anchorPoint,startDistance:Oai});if(p)return p}if(h)return h;let u=this.findValidTraceAnchorCandidate(e,n[0],t);if(u)return u;let _=this.findValidShiftedCandidate(e,n[0],t);if(_)return _;return this.findValidLateralShiftedCandidate(e,n[0],t)}findValidCrowdedTopVerticalFanoutCandidate(e,t,n){let o=this.pinMap[e.pinIds[0]],r=o?this.chipObstacleSpatialIndex.chips.find((A)=>A.chipId===o.chipId):void 0;if(!r)return null;let{width:i,height:s}=bv({orientation:n,netLabelWidth:gP({inputProblem:this.inputProblem,netId:e.netId,pinIds:e.pinIds,isPortOnlyLabel:this.isPortOnlyLabel(e)}),netLabelHeight:this.getNetLabelHeight(e)}),a=this.outputNetLabelPlacements.map((A,g)=>({index:g,pin:this.pinMap[A.pinIds[0]]})).filter(({index:A,pin:g})=>this.crowdedPortOnlyLabelIndices.has(A)&&g?.chipId===o.chipId&&g.x>o.x+Qr).sort((A,g)=>A.pin.x-g.pin.x)[0]?.pin;if(n==="y-"&&a)return null;let c=n==="y-"?Math.max(e.anchorPoint.x+$m,r.bounds.maxX+i/2+pde):Math.min(e.anchorPoint.x,(a?.x??r.bounds.maxX)-$m-i/2),l=r.bounds.maxY,{POSITIVE_INFINITY:h,NEGATIVE_INFINITY:d}=Number;for(let A=0;A<this.outputNetLabelPlacements.length;A++){if(A===t)continue;if(!this.crowdedPortOnlyLabelIndices.has(A))continue;if(this.queuedLabelIndices.includes(A))continue;let g=this.outputNetLabelPlacements[A],f=Ui(g.center,g.width,g.height);if(l=Math.max(l,f.maxY),g.orientation!=="y+")continue;h=Math.min(h,f.minY),d=Math.max(d,f.maxY)}let u=l+$m+(n==="y-"?s:0),p=Number.isFinite(h)&&Number.isFinite(d)?(h+d)/2:u,m=n==="y-"?[p,u]:[u];for(let A of m){if(A-e.anchorPoint.y>this.maxSearchDistance+Qr)continue;let g=this.createCandidate(e,{x:c,y:A},n),f=this.evaluateCandidate(g,e,t,"lateral-shift",A-e.anchorPoint.y,c-e.anchorPoint.x);if(this.recordCandidateResult(f),f.status!=="valid")continue;return f.selected=!0,f}return null}hasTraceContinuingInOrientation(e,t){let n=Pp(t);return Object.values(this.traceMap).some((o)=>{if(o.globalConnNetId!==e.globalConnNetId)return!1;let r=o.tracePath;return r.some((i,s)=>{if(Math.abs(i.x-e.anchorPoint.x)>Qr||Math.abs(i.y-e.anchorPoint.y)>Qr)return!1;return[r[s-1],r[s+1]].some((a)=>a&&Math.abs(a.x-i.x)<=Qr&&(a.y-i.y)*n.y>Qr)})})}findValidRotatedCandidate(e,t,n){for(let o of n){let r=this.createCandidate(e,this.getSearchStartAnchor(e,o),o),i=this.evaluateCandidate(r,e,t,"rotate");if(this.recordCandidateResult(i),i.status==="valid")return i.selected=!0,i}return null}findValidTraceAnchorCandidate(e,t,n){let o=Pp(t),{points:r}=this.getTraceAnchorCandidates(e,t),i=r.sort((s,a)=>{let c=s.x*o.x+s.y*o.y;return a.x*o.x+a.y*o.y-c});for(let s of i){let a=this.createCandidate(e,s,t),c=this.evaluateCandidate(a,e,n,"trace-anchor");if(this.recordCandidateResult(c),c.status==="valid")return c.selected=!0,c}return null}findValidOutwardTraceAnchorCandidate(e,t,n){let o=Pp(t),r=this.getSearchStartAnchor(e,t),{points:i,preferNearestBendOnOutwardRow:s}=this.getTraceAnchorCandidates(e,t),a=i.sort((c,l)=>{let h=c.x*o.x+c.y*o.y,d=l.x*o.x+l.y*o.y;if(!s)return d-h;let u=au(t)?Math.abs(c.x-r.x):Math.abs(c.y-r.y),_=au(t)?Math.abs(l.x-r.x):Math.abs(l.y-r.y);return d-h||u-_});for(let c of a){let l=this.createCandidate(e,{x:r.x,y:c.y},t,c),h=this.evaluateCandidate(l,e,n,"outward-trace-anchor");if(this.recordCandidateResult(h),h.status==="valid")return h.selected=!0,h;let d=this.getPerpendicularOutwardDirection(c,t);if(d.x===0&&d.y===0)continue;for(let u=$m;u<=this.maxSearchDistance+Qr;u+=$m){let _={x:c.x+d.x*u,y:c.y+d.y*u},p=this.createCandidate(e,_,t,c),m=this.evaluateCandidate(p,e,n,"outward-trace-anchor",u);if(this.recordCandidateResult(m),m.status==="valid")return m.selected=!0,m}}return null}getTraceAnchorCandidates(e,t){let n=new Set,o=[],r=new Set(e.mspConnectionPairIds??[]),i=new Set(r);if(au(t)){let d=new Set;for(let _ of i)for(let p of this.traceMap[_]?.pinIds??[])d.add(p);let u=!0;while(u){u=!1;for(let _ of Object.values(this.traceMap)){if(i.has(_.mspPairId))continue;if(this.netLabelConnectorTraceIds.has(_.mspPairId))continue;if(_.globalConnNetId!==e.globalConnNetId)continue;if(!_.pinIds.some((m)=>d.has(m)))continue;let p=[...i].flatMap((m)=>{let A=this.traceMap[m];return A?[A]:[]});if(!this.sharesVerticalRailWithAny(_,p))continue;i.add(_.mspPairId);for(let m of _.pinIds)d.add(m);u=!0}}}for(let d of i){let u=this.traceMap[d];if(!u)continue;for(let _ of u.tracePath){let p=`${_.x.toFixed(9)},${_.y.toFixed(9)}`;if(n.has(p))continue;n.add(p),o.push(_)}}let s=Pp(t),a=Math.max(...o.map((d)=>d.x*s.x+d.y*s.y)),c=o.filter((d)=>Math.abs(d.x*s.x+d.y*s.y-a)<=Qr),l=new Set([...r].flatMap((d)=>this.traceMap[d]?.pinIds??[])),h=[...i].flatMap((d)=>{if(r.has(d))return[];let u=this.traceMap[d];if(!u?.pinIds.some((_)=>l.has(_)))return[];return[u]});return{points:o,preferNearestBendOnOutwardRow:h.some((d)=>c.some((u)=>d.tracePath.some((_)=>Math.abs(_.x-u.x)<=Qr&&Math.abs(_.y-u.y)<=Qr)))}}sharesVerticalRailWithAny(e,t){let n=new Set;for(let o of t)for(let r=0;r<o.tracePath.length-1;r++){let i=o.tracePath[r],s=o.tracePath[r+1];if(Math.abs(i.x-s.x)<=Qr&&Math.abs(i.y-s.y)>Qr)n.add(i.x)}for(let o=0;o<e.tracePath.length-1;o++){let r=e.tracePath[o],i=e.tracePath[o+1];if(Math.abs(r.x-i.x)<=Qr&&Math.abs(r.y-i.y)>Qr&&[...n].some((s)=>Math.abs(s-r.x)<=Qr))return!0}return!1}getAvailableOrientations(e){let t=e.netId??e.globalConnNetId;return this.inputProblem.availableNetLabelOrientations[t]??[]}findValidShiftedCandidate(e,t,n){let o=Pp(t),r=this.getSearchStartAnchor(e,t),i=this.getPerpendicularOutwardDirection(e.anchorPoint,t),s=this.getSearchDistanceLimit(e,t),a=i.x===0&&i.y===0?0:this.maxSearchDistance;for(let c=0;c<=a+Qr;c+=$m){let l={x:r.x+i.x*c,y:r.y+i.y*c},h=this.findValidCandidateInShiftColumn({label:e,labelIndex:n,orientation:t,direction:o,baseAnchor:l,maxSearchDistance:s,outwardDistance:c});if(h)return h}return null}findValidLateralShiftedCandidate(e,t,n){let o=Pp(t),r=this.getSearchStartAnchor(e,t),i={x:au(t)?1:0,y:FJ(t)?1:0},s=Math.ceil(this.maxSearchDistance/$m);for(let a=1;a<=s;a++)for(let c of[-1,1]){let l=c*a*$m,h={x:r.x+i.x*l,y:r.y+i.y*l},d=this.getLateralColumnMaxDistance(e,t,h),u=this.findValidCandidateInShiftColumn({label:e,labelIndex:n,orientation:t,direction:o,baseAnchor:h,maxSearchDistance:d,outwardDistance:l,phase:"lateral-shift"});if(u)return u}return null}findValidCandidateInShiftColumn(e){let{label:t,labelIndex:n,orientation:o,direction:r,baseAnchor:i,maxSearchDistance:s,outwardDistance:a,phase:c="shift",stopOnTraceCollision:l=!0,connectorSource:h,startDistance:d=$m}=e;for(let u=d;u<=s+Qr;u+=$m){let _={x:i.x+r.x*u,y:i.y+r.y*u},p=h??(c==="lateral-shift"?this.findProjectedConnectorSourceOnHostTrace(t,_,o):void 0),m=this.createCandidate(t,_,o,p),A=this.evaluateCandidate(m,t,n,c,u,a);if(this.recordCandidateResult(A),A.status==="valid")return A.selected=!0,A;if(l&&A.status==="trace-collision"&&(!p||o!=="y-"||!this.isGroundLabel(t)))break}return null}evaluateCandidate(e,t,n,o,r,i){return{...e,phase:o,distance:r,outwardDistance:i,selected:!1,status:this.getCandidateStatus({candidate:e,label:t,labelIndex:n,phase:o})}}recordCandidateResult(e){if(this.stats.candidateEvaluations=(this.stats.candidateEvaluations??0)+1,this.currentCandidateResults.length<Fyn)this.currentCandidateResults.push(e);else if(e.status==="valid")this.currentCandidateResults[Fyn-1]=e;this.stats.maxRecordedCandidates=Math.max(this.stats.maxRecordedCandidates??0,this.currentCandidateResults.length)}getCandidateConnectorTrace(e,t,n){if(this.crowdedPortOnlyLabelIndices.has(n)&&this.getChipSideForPoint(e.anchorPoint)==="top"&&au(t.orientation))return Zit([e.anchorPoint,{x:e.anchorPoint.x,y:t.anchorPoint.y},t.anchorPoint]);if(t.connectorSource)return Hot(t.connectorSource,t.anchorPoint,t.orientation);if(t.phase==="lateral-shift"){let o=this.crowdedPortOnlyLabelIndices.has(n)?this.getChipOutwardDirection(e.anchorPoint):(()=>{let i=Pp(t.orientation);return{x:-i.x,y:-i.y}})(),r={x:e.anchorPoint.x+o.x*$m,y:e.anchorPoint.y+o.y*$m};return Zit([e.anchorPoint,...Hot(r,t.anchorPoint,t.orientation)])}return Hot(e.anchorPoint,t.anchorPoint,t.orientation)}findProjectedConnectorSourceOnHostTrace(e,t,n){let o=Pp(n),r=[];for(let i of e.mspConnectionPairIds){let s=this.traceMap[i];if(!s)continue;for(let a=0;a<s.tracePath.length-1;a++){let c=s.tracePath[a],l=s.tracePath[a+1];if(!(au(n)?Math.abs(c.y-l.y)<=Qr:Math.abs(c.x-l.x)<=Qr))continue;let d=au(n)?{x:t.x,y:c.y}:{x:c.x,y:t.y};if(!Vs([c,l],e.anchorPoint)||!Vs([c,l],d))continue;if((t.x-d.x)*o.x+(t.y-d.y)*o.y>=-Qr)r.push(d)}}return r.sort((i,s)=>Math.abs(i.x-t.x)+Math.abs(i.y-t.y)-(Math.abs(s.x-t.x)+Math.abs(s.y-t.y)))[0]}isStandaloneSinglePinNetLabel(e){return this.inputProblem.netConnections.some((t)=>t.netId===e.netId&&t.pinIds.length===1&&t.pinIds[0]===e.pinIds[0])}labelIntersectsDifferentNetTrace(e){let{width:t,height:n}=bv({orientation:e.orientation,netLabelWidth:gP({inputProblem:this.inputProblem,netId:e.netId,pinIds:e.pinIds,isPortOnlyLabel:this.isPortOnlyLabel(e)}),netLabelHeight:this.getNetLabelHeight(e)}),o=x2(e.anchorPoint,e.orientation,t,n),r=Ui(o,t,n);return Object.values(this.traceMap).some((i)=>i.globalConnNetId!==e.globalConnNetId&&Lot(i.tracePath,r))}getSearchStartAnchor(e,t){let n=this.getWickOffsetAnchor(e.anchorPoint,t),{width:o,height:r}=bv({orientation:t,netLabelWidth:gP({inputProblem:this.inputProblem,netId:e.netId,pinIds:e.pinIds,isPortOnlyLabel:this.isPortOnlyLabel(e)}),netLabelHeight:this.getNetLabelHeight(e)}),i=this.getSideOffsetAnchor({anchorPoint:n,labelAnchorPoint:e.anchorPoint,orientation:t,width:o,height:r});if(this.blockedStandaloneLabelIndex!==null&&e===this.outputNetLabelPlacements[this.blockedStandaloneLabelIndex]&&au(t)&&this.blockedStandaloneLabelTargetAnchorX!==null)i.x=this.blockedStandaloneLabelTargetAnchorX;return i}getWickOffsetAnchor(e,t){let n=Pp(t);return{x:e.x+n.x*G3,y:e.y+n.y*G3}}getSideOffsetAnchor(e){let{anchorPoint:t,labelAnchorPoint:n,orientation:o,width:r,height:i}=e,s=this.getChipSideForPoint(n),a=this.getContainingChipSide(n)?G3:$m;if(au(o)&&s==="left")return{x:t.x-r/2-a,y:t.y};if(au(o)&&s==="right")return{x:t.x+r/2+a,y:t.y};if(FJ(o)&&s==="bottom")return{x:t.x,y:t.y-i/2-a};if(FJ(o)&&s==="top")return{x:t.x,y:t.y+i/2+a};return t}getSearchDistanceLimit(e,t){let{width:n,height:o}=bv({orientation:t,netLabelWidth:gP({inputProblem:this.inputProblem,netId:e.netId,pinIds:e.pinIds,isPortOnlyLabel:this.isPortOnlyLabel(e)}),netLabelHeight:this.getNetLabelHeight(e)}),r=t==="y+"||t==="y-"?o:n;return Math.min(this.maxSearchDistance,r*2)}getLateralColumnMaxDistance(e,t,n){let o=this.getAvailableOrientations(e),r=o.length===1&&au(o[0]),i=new Set(e.pinIds.map((h)=>this.pinMap[h]?.chipId).filter((h)=>Boolean(h))),s=this.chipObstacleSpatialIndex.chips.filter((h)=>i.has(h.chipId)),a=e.pinIds.map((h)=>this.pinMap[h]?.chipId).find(Boolean),c=s.find((h)=>h.chipId===a),l=r?s:c?[c]:[];if(l.length>0){if(t==="y-")return Math.max(0,...l.map((h)=>n.y-h.bounds.minY));if(t==="y+")return Math.max(0,...l.map((h)=>h.bounds.maxY-n.y));if(t==="x-")return Math.max(0,...l.map((h)=>n.x-h.bounds.minX));if(t==="x+")return Math.max(0,...l.map((h)=>h.bounds.maxX-n.x))}return this.getSearchDistanceLimit(e,t)}createCandidate(e,t,n,o){let{width:r,height:i}=bv({orientation:n,netLabelWidth:gP({inputProblem:this.inputProblem,netId:e.netId,pinIds:e.pinIds,isPortOnlyLabel:this.isPortOnlyLabel(e)}),netLabelHeight:this.getNetLabelHeight(e)});return{orientation:n,anchorPoint:t,connectorSource:o,width:r,height:i,center:x2(t,n,r,i)}}getNetLabelHeight(e){if(e.netId){let t=this.inputProblem.netConnections.find((n)=>n.netId===e.netId)?.netLabelHeight;if(t!==void 0)return t}return this.inputProblem.netConnections.find((t)=>t.pinIds.some((n)=>e.pinIds.includes(n)))?.netLabelHeight}getCandidateStatus(e){let{candidate:t,label:n,labelIndex:o,phase:r}=e,i=Ui(t.center,t.width,t.height),s=this.getBoundsStatus({bounds:i,labelIndex:o,label:n});if(s!=="valid"){if(!(r==="trace-anchor"||r==="connected-rail-shift"||r==="downward-ground-rail-extension")||s!=="chip-collision"||!this.isAcceptableConnectedChipBoundaryOverlap(t,n,i)||r==="connected-rail-shift"&&!this.staysOutsideConnectedPinRow({candidate:t,label:n,bounds:i}))return s;let h=this.getBoundsStatus({bounds:i,labelIndex:o,label:n,ignoreChipCollisions:!0});if(h!=="valid")return h}let a=this.getCandidateConnectorTrace(n,{anchorPoint:t.anchorPoint,connectorSource:r==="lateral-shift"?t.connectorSource:void 0,orientation:t.orientation,phase:r},o);if(this.obstacleIndex.doesTracePathCrossChip(a))return"chip-collision";for(let l of this.inputProblem.textBoxes??[])if(Lot(a,Nv(l)))return"text-collision";let c=this.includeHorizontalConstraintMismatches(this.obstacleIndex.getLabelIndicesNearTracePath(a),this.isGroundLabel(n));for(let l of c){if(l===o)continue;if(this.shouldIgnorePendingCrowdedLabel(o,l))continue;let h=this.outputNetLabelPlacements[l];if(Lot(a,this.getLabelBoundsForCollisionWithGround(h,n)))return"netlabel-collision"}return"valid"}isAcceptableConnectedChipBoundaryOverlap(e,t,n){let o=this.chipObstacleSpatialIndex.getChipsInBounds(n);if(o.length===0)return!1;let r=new Set(t.pinIds.map((i)=>this.pinMap[i]?.chipId).filter((i)=>Boolean(i)));return o.every((i)=>{if(!r.has(i.chipId))return!1;let{anchorPoint:s,orientation:a}=e,c=i.bounds;if(au(a))return s.x<c.minX-Qr||s.x>c.maxX+Qr;return s.y<c.minY-Qr||s.y>c.maxY+Qr})}staysOutsideConnectedPinRow(e){let{candidate:t,label:n,bounds:o}=e,r=this.pinMap[n.pinIds[0]];if(!r||!au(t.orientation))return!1;if(t.anchorPoint.x<r.x)return o.maxX<=r.x+rxn+Qr;return o.minX>=r.x-rxn-Qr}getBoundsStatus(e){let{bounds:t,labelIndex:n,label:o,ignoreChipCollisions:r}=e;if(!r){if(this.chipObstacleSpatialIndex.getChipsInBounds(t).length>0)return"chip-collision";if(this.sharesChipBoundary(t))return"chip-collision"}if(JZ(t,this.inputProblem))return"text-collision";if(this.obstacleIndex.doesTraceCrossBoundsInterior(t))return"trace-collision";if(this.isTraceTooCloseToLabel(t,o))return"trace-clearance-violation";if(this.intersectsAnyOtherNetLabel(t,n,o))return"netlabel-collision";return"valid"}isTraceTooCloseToLabel(e,t){if(!this.shouldCheckTraceClearanceForLabel(t))return!1;let n=this.getLabelTraceClearanceBounds(e);return this.obstacleIndex.doesTraceIntersectBounds({bounds:n,excludedGlobalConnNetId:t.globalConnNetId})}getLabelTraceClearanceBounds(e){return{minX:e.minX-pde,minY:e.minY-pde,maxX:e.maxX+pde,maxY:e.maxY+pde}}shouldCheckTraceClearanceForLabel(e){if(!this.isPortOnlyLabel(e))return!1;if(!this.hasRoutedLabelOnSameNet(e))return!1;return this.getAvailableOrientations(e).length===1}hasRoutedLabelOnSameNet(e){for(let t of this.outputNetLabelPlacements){if(t.globalConnNetId!==e.globalConnNetId)continue;if(t.mspConnectionPairIds.length>0)return!0}return!1}isOutwardHorizontalFallback(e){let t=this.getChipSideForPoint(e.anchorPoint);return t==="left"&&e.orientation==="x-"||t==="right"&&e.orientation==="x+"}canPlaceVerticalLabelOnHostRail(e,t){if(!t.mspConnectionPairIds.some((s)=>{let a=this.traceMap[s];return a&&Vs(a.tracePath,e.anchorPoint)}))return!1;let o=this.pinMap[t.pinIds[0]];if(!o)return!1;if(t.pinIds.some((s)=>this.pinMap[s]?.chipId!==o.chipId))return!1;let r=this.chipObstacleSpatialIndex.chips.find((s)=>s.chipId===o.chipId);if(!r)return!1;let i=Ui(e.center,e.width,e.height);if(i.minY<r.bounds.minY-Qr||i.maxY>r.bounds.maxY+Qr)return!1;if(e.anchorPoint.x>=r.bounds.minX-Qr&&e.anchorPoint.x<=r.bounds.maxX+Qr)return!1;return r.pins.every((s)=>t.pinIds.includes(s.pinId)||s.y<=i.minY+Qr||s.y>=i.maxY-Qr)}getTextBlockedMultiPinRailTraces(e,t){if(!au(t))return null;let n=this.pinMap[e.pinIds[0]]?.chipId,o=Object.values(this.traceMap).filter((p)=>p.globalConnNetId===e.globalConnNetId&&p.pins.every((m)=>m.chipId===n)),r=new Set(e.pinIds),i=new Set;for(let p=!0;p;){p=!1;for(let m of o){if(i.has(m))continue;if(!m.pinIds.some((A)=>r.has(A)))continue;i.add(m);for(let A of m.pinIds)r.add(A);p=!0}}if(r.size<3||r.size===3&&!this.hasPortOnlyLabelOnSameNet(e))return null;let s=[...r].map((p)=>this.pinMap[p]),a=Pp(t),c=s[0].x;if(s.some((p)=>Math.abs(p.x-c)>Qr))return null;let l=this.inputProblem.chips.find((p)=>p.chipId===n).pins.filter((p)=>Math.abs(p.x-c)<=Qr),h=Math.min(...s.map((p)=>p.y)),d=Math.max(...s.map((p)=>p.y));if(l.some((p)=>p.y>=h-Qr&&p.y<=d+Qr&&!r.has(p.pinId))||t==="y-"&&h>Math.min(...l.map((p)=>p.y))+Qr||t==="y+"&&d<Math.max(...l.map((p)=>p.y))-Qr)return null;let u=Math.max(...s.map((p)=>p.x*a.x+p.y*a.y));return(this.inputProblem.textBoxes??[]).some((p)=>p.chipId===n&&p.center.x*a.x+p.center.y*a.y>u+Qr)?[...i]:null}findValidNearbyRailCandidate(e,t,n,o){if(!au(t))return null;let r=Pp(t),i=[...new Set(o.flatMap((c)=>c.pinIds))].map((c)=>this.pinMap[c]).sort((c,l)=>l.y*r.y-c.y*r.y)[0]?.y;if(i===void 0)return null;let s=this.pinMap[e.pinIds[0]].x,a=[...new Set(o.flatMap((c)=>c.tracePath.map((l)=>l.x)))].filter((c)=>Math.abs(c-s)>Qr).sort((c,l)=>Math.abs(c-s)-Math.abs(l-s));for(let c of a){let l={x:c,y:i};if(!Object.values(this.traceMap).some((d)=>d.globalConnNetId===e.globalConnNetId&&Vs(d.tracePath,l)))continue;let h=this.findValidCandidateInShiftColumn({label:e,labelIndex:n,orientation:t,direction:r,baseAnchor:l,maxSearchDistance:this.getSearchDistanceLimit(e,t),outwardDistance:0,phase:"connected-rail-shift",stopOnTraceCollision:!1,connectorSource:l,startDistance:0});if(h)return h}return null}hasPortOnlyLabelOnSameNet(e){return this.outputNetLabelPlacements.some((t)=>t!==e&&t.globalConnNetId===e.globalConnNetId&&this.isPortOnlyLabel(t))}hasOppositeVerticalRailOnSameChipSide(e,t){let n=this.inputProblem.netConnections.find((i)=>i.netId===e.netId);if(!n)return!1;let o=this.getSingleChipSideForNetConnection(n);if(!o)return!1;let r=t==="y+"?"y-":"y+";return this.inputProblem.netConnections.some((i)=>{if(i===n||i.pinIds.length<2)return!1;let s=this.inputProblem.availableNetLabelOrientations[i.netId]??[];if(s.length!==1||s[0]!==r)return!1;let a=this.getSingleChipSideForNetConnection(i);return a?.chipId===o.chipId&&a.side===o.side})}getSingleChipSideForNetConnection(e){if(e.pinIds.length<2)return null;let t=e.pinIds.map((s)=>this.pinMap[s]);if(t.some((s)=>!s))return null;if(new Set(t.map((s)=>s.chipId)).size!==1)return null;let o=t[0].chipId,r=this.chipObstacleSpatialIndex.chips.find((s)=>s.chipId===o);if(!r)return null;let i=new Set(t.map((s)=>{if(Math.abs(s.x-r.bounds.minX)<=Qr)return"left";if(Math.abs(s.x-r.bounds.maxX)<=Qr)return"right";return null}));if(i.size!==1||i.has(null))return null;return{chipId:o,side:[...i][0]}}isPortOnlyLabel(e){return e.mspConnectionPairIds.length===0}getNetConnectionForLabel(e){return e.netId?this.inputProblem.netConnections.find((t)=>t.netId===e.netId):this.inputProblem.netConnections.find((t)=>t.pinIds.some((n)=>e.pinIds.includes(n)))}isGroundLabel(e){return this.getNetConnectionForLabel(e)?.isGround===!0}getHorizontalConstraintMismatchBounds(e){if(!this.isPortOnlyLabel(e))return null;if(e.orientation!=="x+"&&e.orientation!=="x-")return null;let t=e.netId??e.globalConnNetId,n=this.inputProblem.availableNetLabelOrientations[t]??[];if(n.length===0||n.some((s)=>!au(s)))return null;let o=this.getNetConnectionForLabel(e)?.netLabelHeight;if(o===void 0||o<=e.width+e.height+Qr)return null;let r=x2(e.anchorPoint,e.orientation,e.width,e.height),i=x2(e.anchorPoint,e.orientation,o,e.height);return Ui({x:i.x+e.center.x-r.x,y:i.y+e.center.y-r.y},o,e.height)}includeHorizontalConstraintMismatches(e,t){if(!t)return[...e].sort((o,r)=>o-r);let n=new Set(e);for(let o=0;o<this.outputNetLabelPlacements.length;o++)if(this.getHorizontalConstraintMismatchBounds(this.outputNetLabelPlacements[o]))n.add(o);return[...n].sort((o,r)=>o-r)}getLabelBoundsForCollisionWithGround(e,t){if(this.isGroundLabel(t)){let n=this.getHorizontalConstraintMismatchBounds(e);if(n)return n}return Ui(e.center,e.width,e.height)}shouldIgnorePendingCrowdedLabel(e,t){return this.crowdedPortOnlyLabelIndices.has(e)&&this.crowdedPortOnlyLabelIndices.has(t)&&this.queuedLabelIndices.includes(t)}intersectsAnyOtherNetLabel(e,t,n){let o={minX:e.minX-$m,minY:e.minY-$m,maxX:e.maxX+$m,maxY:e.maxY+$m},r=this.includeHorizontalConstraintMismatches(this.obstacleIndex.getLabelIndicesInBounds(o),this.isGroundLabel(n));for(let i of r){if(i===t)continue;if(this.shouldIgnorePendingCrowdedLabel(t,i))continue;let s=this.outputNetLabelPlacements[i],a=this.getLabelBoundsForCollisionWithGround(s,n);if(i===this.blockedStandaloneLabelIndex&&au(s.orientation))a.minX-=$m,a.maxX+=$m;if(wde(e,a))return!0}return!1}sharesChipBoundary(e){let t={minX:e.minX-G3-Qr,minY:e.minY-G3-Qr,maxX:e.maxX+G3+Qr,maxY:e.maxY+G3+Qr},n=this.chipObstacleSpatialIndex.getChipsInBounds(t);for(let o of n){let r=o.bounds,i=Math.abs(e.minX-r.maxX)<=G3+Qr||Math.abs(e.maxX-r.minX)<=G3+Qr,s=Math.abs(e.minY-r.maxY)<=G3+Qr||Math.abs(e.maxY-r.minY)<=G3+Qr;if(i&&f8e(e.minY,e.maxY,r.minY,r.maxY))return!0;if(s&&f8e(e.minX,e.maxX,r.minX,r.maxX))return!0}return!1}getChipSideForPoint(e){let t=this.getContainingChipSide(e);if(t)return t;let n=this.getOutsideChipSide(e);if(n)return n;return this.getNearestChipSide(e)}getPerpendicularOutwardDirection(e,t){let n=this.getChipSideForPoint(e);if(au(t)&&n==="left")return{x:-1,y:0};if(au(t)&&n==="right")return{x:1,y:0};if(FJ(t)&&n==="bottom")return{x:0,y:-1};if(FJ(t)&&n==="top")return{x:0,y:1};return{x:0,y:0}}getChipOutwardDirection(e){switch(this.getChipSideForPoint(e)){case"left":return{x:-1,y:0};case"right":return{x:1,y:0};case"bottom":return{x:0,y:-1};case"top":return{x:0,y:1};default:return{x:0,y:0}}}getContainingChipSide(e){let t=null,n=Number.POSITIVE_INFINITY;for(let o of this.chipObstacleSpatialIndex.chips){let r=o.bounds;if(e.x<r.minX-Qr||e.x>r.maxX+Qr||e.y<r.minY-Qr||e.y>r.maxY+Qr)continue;for(let[i,s]of zyn(e,r))if(s<n)t=i,n=s}return t}getOutsideChipSide(e){let t=null,n=Number.POSITIVE_INFINITY;for(let o of this.chipObstacleSpatialIndex.chips){let r=o.bounds,i=e.x<r.minX-Qr?r.minX-e.x:e.x>r.maxX+Qr?e.x-r.maxX:0,s=e.y<r.minY-Qr?r.minY-e.y:e.y>r.maxY+Qr?e.y-r.maxY:0;if(i===0&&s===0)continue;let a=i**2+s**2;if(a>=n)continue;if(n=a,i>0)t=e.x<r.minX?"left":"right";else t=e.y<r.minY?"bottom":"top"}return t}getNearestChipSide(e){let t=null,n=Number.POSITIVE_INFINITY;for(let o of this.chipObstacleSpatialIndex.chips)for(let[r,i]of zyn(e,o.bounds))if(i<n)t=r,n=i;return t}visualize(){return Rai({inputProblem:this.inputProblem,traces:this.traces,outputNetLabelPlacements:this.outputNetLabelPlacements,currentLabel:this.currentLabel,currentCandidateResults:this.currentCandidateResults,solved:this.solved})}};var Yai="blue",pSn="red",Gai=(e)=>{let t=Bp(e.inputProblem);if(Kai(t),Uai(t,e.traces),Wai(t,e.outputNetLabelPlacements),!e.solved)Xai(t,e.currentLabel),jai(t,e.currentCandidateResults);return t},Uai=(e,t)=>{for(let n of t)e.lines.push({points:n.tracePath,strokeColor:"purple"})},Wai=(e,t)=>{for(let n of t)e.rects.push({center:n.center,width:n.width,height:n.height,fill:Vc(n.globalConnNetId,0.35),strokeColor:Vc(n.globalConnNetId,0.9),label:`netId: ${n.netId}
globalConnNetId: ${n.globalConnNetId}`}),e.points.push({x:n.anchorPoint.x,y:n.anchorPoint.y,color:Vc(n.globalConnNetId,0.9),label:`anchorPoint
orientation: ${n.orientation}`})},Xai=(e,t)=>{if(!t)return;e.rects.push({center:t.center,width:t.width,height:t.height,fill:"rgba(255, 0, 0, 0.2)",strokeColor:pSn,label:`trace-line VCC target
${t.netId??t.globalConnNetId}`})},jai=(e,t)=>{for(let n of t){let o=n.selected?Yai:pSn;e.rects.push({center:n.center,width:n.width,height:n.height,fill:n.selected?"rgba(0, 0, 255, 0.2)":"rgba(255, 0, 0, 0.15)",strokeColor:o,strokeDash:n.selected?void 0:"4 2",label:`${n.selected?"selected":n.status} trace corner
trace: ${n.traceId}
distance: ${n.distance.toFixed(3)}`}),e.points.push({...n.anchorPoint,color:o,label:`candidate anchor
${n.status}`})}},Kai=(e)=>{if(!e.lines)e.lines=[];if(!e.points)e.points=[];if(!e.rects)e.rects=[];if(!e.circles)e.circles=[];if(!e.texts)e.texts=[]},Dct=(e,t)=>t.filter((n)=>n.mspPairId!==e.mspPairId&&n.globalConnNetId===e.globalConnNetId).flatMap((n)=>[...n.tracePath.filter((o)=>Vs(e.tracePath,o)),...e.tracePath.slice(1).flatMap((o,r)=>n.tracePath.slice(1).flatMap((i,s)=>{let a=XP(e.tracePath[r],o,n.tracePath[s],i);return a?[a]:[]}))]),mSn=({label:e,traces:t,rails:n,netLabelPlacements:o,netLabelConnectorTraceIds:r,inputProblem:i})=>{let s=[];for(let a of t){if(!r.has(a.mspPairId))continue;if(a.globalConnNetId!==e.globalConnNetId)continue;let c=[a.tracePath[0],a.tracePath.at(-1)];if(!c[0]||!c[1])continue;let l=c.findIndex((_)=>nT(_,e.anchorPoint)<=Ou);if(l===-1)continue;let h=c[1-l],d=o.filter((_)=>_!==e);if(d.some((_)=>_.mspConnectionPairIds.includes(a.mspPairId)))continue;let u=[...Dct(a,t),...i.chips.flatMap((_)=>_.pins),...d.map((_)=>_.anchorPoint)].filter((_)=>Vs(a.tracePath,_));for(let _ of n){if(r.has(_.mspPairId)||!J7n(_))continue;if(_.globalConnNetId!==e.globalConnNetId)continue;if(e.mspConnectionPairIds.length>0&&!e.mspConnectionPairIds.includes(_.mspPairId))continue;if(!Vs(_.tracePath,h))continue;if(!u.every((p)=>Vs(_.tracePath,p)))continue;s.push({connector:a,rail:_})}}return s},$ai=({label:e,traces:t,netLabelPlacements:n,netLabelConnectorTraceIds:o,inputProblem:r})=>{if(e.pinIds.length!==1||e.orientation!=="y+"&&e.orientation!=="y-")return;let i=r.chips.flatMap((a)=>a.pins),s=i.find((a)=>a.pinId===e.pinIds[0]);if(!s)return;for(let a of t){if(!o.has(a.mspPairId)||a.globalConnNetId!==e.globalConnNetId||a.pinIds.length!==1||a.pinIds[0]!==s.pinId)continue;let c=Mi(a.tracePath);if(c.length<4)continue;if(nT(c.at(-1),s)<=Ou)c.reverse();if(nT(c[0],s)>Ou||nT(c.at(-1),e.anchorPoint)>Ou||Math.abs(c[1].y-s.y)>Ou)continue;let l={x:e.anchorPoint.x,y:s.y};if((l.x-s.x)*(c[1].x-s.x)<=Ou)continue;let h=[c[0],l];if(![...Dct(a,t),...i,...n.filter((u)=>u!==e).map((u)=>u.anchorPoint)].filter((u)=>Vs(c,u)).every((u)=>Vs(h,u)))continue;if(t.some((u)=>u.globalConnNetId!==a.globalConnNetId&&YP(h,u.tracePath)>YP(c,u.tracePath)))continue;return{anchorPoint:l,traceId:a.mspPairId,distance:nT(l,e.anchorPoint),pinAligned:!0,reroutedTracePath:h}}},qai=(e)=>{let{label:t,traces:n}=e;if(t.orientation!=="y+"&&t.orientation!=="y-")return[];let o=t.orientation==="y+"?1:-1,r=[],i=mSn({...e,rails:n});for(let{connector:s,rail:a}of i){let c=Mi(s.tracePath);if(y2(c)<2)continue;for(let l of zk(Mi(a.tracePath))){let h=t.anchorPoint;if((h.y-l.y)*o<-Ou)continue;let d=Mi([l,{x:h.x,y:l.y},h]);if(y2(d)>=y2(c)||V5(d)>V5(c)+Ou)continue;if(n.some((u)=>u.globalConnNetId!==s.globalConnNetId&&YP(d,u.tracePath)>YP(c,u.tracePath)))continue;r.push({anchorPoint:h,traceId:s.mspPairId,distance:0,pinAligned:!0,reroutedTracePath:d})}}return r.sort((s,a)=>V5(s.reroutedTracePath)-V5(a.reroutedTracePath)||y2(s.reroutedTracePath)-y2(a.reroutedTracePath))},H9e=0.1,ixn=class extends Gu{inputProblem;traces;netLabelPlacements;outputNetLabelPlacements;queuedLabelIndices=[];currentLabelIndex=null;currentLabel=null;currentCandidateResults=[];queuedCornerCandidates=[];shouldAdvanceToNextLabel=!1;traceMap;netLabelConnectorTraceIds;originalTraces;onlyOverlappingLabels;constructor(e){super();this.inputProblem=e.inputProblem,this.traces=e.traces,this.netLabelPlacements=e.netLabelPlacements,this.outputNetLabelPlacements=[...e.netLabelPlacements],this.traceMap=Object.fromEntries(e.traces.map((t)=>[t.mspPairId,t])),this.netLabelConnectorTraceIds=e.netLabelConnectorTraceIds??new Set,this.originalTraces=e.originalTraces,this.onlyOverlappingLabels=e.onlyOverlappingLabels??!1,this.queuedLabelIndices=this.getProcessableLabelIndices(),this.prepareNextLabel()}getConstructorParams(){return{inputProblem:this.inputProblem,traces:this.traces,netLabelPlacements:this.netLabelPlacements,netLabelConnectorTraceIds:this.netLabelConnectorTraceIds,originalTraces:this.originalTraces,onlyOverlappingLabels:this.onlyOverlappingLabels}}_step(){if(this.shouldAdvanceToNextLabel){this.advanceToNextLabel();return}let e=this.currentLabel,t=this.currentLabelIndex;if(e===null||t===null){this.finish();return}let n=this.queuedCornerCandidates.shift();if(!n){this.shouldAdvanceToNextLabel=!0;return}let o=this.evaluateCornerCandidate(e,t,n);if(this.currentCandidateResults.push(o),o.status!=="valid")return;o.selected=!0,this.applyCandidate(t,e,o),this.shouldAdvanceToNextLabel=!0}getOutput(){return{traces:this.traces,netLabelPlacements:this.outputNetLabelPlacements}}getProcessableLabelIndices(){let e=[];for(let t=0;t<this.outputNetLabelPlacements.length;t++){let n=this.outputNetLabelPlacements[t];if(!this.shouldProcessLabel(n))continue;e.push(t)}return e}prepareNextLabel(){let e=this.queuedLabelIndices.shift();if(e===void 0)return this.clearCurrentLabel(),!1;let t=this.outputNetLabelPlacements[e];return this.currentLabelIndex=e,this.currentLabel=t,this.currentCandidateResults=[],this.queuedCornerCandidates=[...this.getSimplifiedConnectorCandidates(t),...this.getCornerCandidatesForLabel(t)],!0}advanceToNextLabel(){if(this.shouldAdvanceToNextLabel=!1,!this.prepareNextLabel())this.finish()}clearCurrentLabel(){this.currentLabelIndex=null,this.currentLabel=null,this.currentCandidateResults=[],this.queuedCornerCandidates=[]}finish(){this.clearCurrentLabel(),this.solved=!0}evaluateCornerCandidate(e,t,n){let o=x2(n.anchorPoint,e.orientation,e.width,e.height),r=Ui(o,e.width,e.height);return{...n,center:o,width:e.width,height:e.height,status:this.getCandidateStatus(r,t,n),selected:!1}}getCandidateStatus(e,t,n){if(this.intersectsAnyChip(e))return"chip-collision";if(JZ(e,this.inputProblem))return"text-collision";let o=n.obsoleteConnectorTraceId?Object.fromEntries(Object.entries(this.traceMap).filter(([i])=>i!==n.obsoleteConnectorTraceId)):this.traceMap,r=n.reroutedTracePath?{...o,[n.traceId]:{...this.traceMap[n.traceId],tracePath:n.reroutedTracePath}}:o;if(Zde(e,r))return"trace-collision";if(n.reroutedTracePath&&!this.isReroutedTraceClear(n,t))return"trace-collision";if(this.intersectsAnyOtherNetLabel(e,t))return"netlabel-collision";return"valid"}applyCandidate(e,t,n){if(n.reroutedTracePath){let o=this.traceMap[n.traceId],r={...o,tracePath:n.reroutedTracePath};this.traces=this.traces.map((i)=>i.mspPairId===n.traceId?r:i),this.traceMap[n.traceId]=r,this.outputNetLabelPlacements=eee({trace:o,originalTracePath:o.tracePath,reroutedTracePath:n.reroutedTracePath,netLabelPlacements:this.outputNetLabelPlacements})}if(n.obsoleteConnectorTraceId)this.traces=this.traces.filter((o)=>o.mspPairId!==n.obsoleteConnectorTraceId),delete this.traceMap[n.obsoleteConnectorTraceId];this.outputNetLabelPlacements[e]={...t,...n.obsoleteConnectorTraceId||!this.pointsEqual(t.anchorPoint,n.anchorPoint)&&!t.mspConnectionPairIds.includes(n.traceId)?{mspConnectionPairIds:[n.traceId],pinIds:[...this.traceMap[n.traceId].pinIds]}:{},anchorPoint:n.anchorPoint,center:n.center}}shouldProcessLabel(e){if(this.originalTraces||this.onlyOverlappingLabels){let n=this.originalTraces&&this.hasMovedCorner(e),o=this.onlyOverlappingLabels&&this.isLabelCrossedByTrace(e),r=this.getNewRailCornerCandidates(e).length>0,i=this.getSimplifiedConnectorCandidates(e).length>0;if(!n&&!o&&!r&&!i)return!1}return(e.orientation==="y+"||e.orientation==="y-")&&(this.getSimplifiedConnectorCandidates(e).length>0||this.getCornerCandidatesForLabel(e).length>0)}hasMovedCorner(e){return this.originalTraces.some((t)=>{if(!this.isTraceForLabel(t,e))return!1;if(!zk(t.tracePath).some((o)=>this.pointsEqual(o,e.anchorPoint)))return!1;let n=this.traceMap[t.mspPairId];return n!==void 0&&!zk(n.tracePath).some((o)=>this.pointsEqual(o,e.anchorPoint))})}intersectsAnyChip(e){return this.inputProblem.chips.some((t)=>Ev(e,Ui(t.center,t.width,t.height)))}intersectsAnyOtherNetLabel(e,t){return this.outputNetLabelPlacements.some((n,o)=>{if(o===t)return!1;return Ev(e,Ui(n.center,n.width,n.height))})}getCornerCandidatesForLabel(e){let t=[],n=this.getNewRailCornerCandidates(e),o=this.getTraceLinesForLabel(e),r=this.isConfiguredRailLabel(e)&&(this.isLabelCrossedByTrace(e)||!o.some((i)=>zk(i.tracePath).some((s)=>this.pointsEqual(s,e.anchorPoint))));for(let i of o){let s=i.tracePath,a=[s[0],s[s.length-1]];for(let c of zk(s)){let l=s.indexOf(c),h=a.some((_)=>Math.abs(_.x-c.x)<=Ou),d=h||r&&this.isPinAlignedCorner(s,l);if(!d)continue;(h?t:n).push({anchorPoint:c,traceId:i.mspPairId,distance:nT(c,e.anchorPoint),pinAligned:d},...this.getClearanceShiftedCornerCandidates({label:e,trace:i,cornerIndex:l,pinAligned:d}))}}return[...t.sort((i,s)=>i.distance-s.distance),...n.sort((i,s)=>i.distance-s.distance)]}getNewRailCornerCandidates(e){if(!this.originalTraces||!this.isConfiguredRailLabel(e))return[];let t=new Map,n=this.traces.filter((r)=>{if(this.netLabelConnectorTraceIds.has(r.mspPairId))return!1;if(r.globalConnNetId!==e.globalConnNetId)return!1;if(e.mspConnectionPairIds.length>0&&!e.mspConnectionPairIds.includes(r.mspPairId))return!1;let i=this.originalTraces.find((c)=>c.mspPairId===r.mspPairId);if(!i)return!1;let s=zk(i.tracePath),a=zk(r.tracePath).filter((c)=>!s.some((l)=>this.pointsEqual(l,c))&&this.isPinAlignedCorner(r.tracePath,r.tracePath.indexOf(c)));if(a.length===0)return!1;return t.set(r.mspPairId,a),!0});if(n.length===0)return[];return mSn({label:e,traces:this.traces,rails:n,netLabelPlacements:this.outputNetLabelPlacements,netLabelConnectorTraceIds:this.netLabelConnectorTraceIds,inputProblem:this.inputProblem}).flatMap(({connector:r,rail:i})=>t.get(i.mspPairId).map((s)=>({anchorPoint:s,traceId:i.mspPairId,distance:nT(s,e.anchorPoint),pinAligned:!0,obsoleteConnectorTraceId:r.mspPairId})))}getSimplifiedConnectorCandidates(e){return[...this.originalTraces?qai({label:e,traces:this.traces,netLabelPlacements:this.outputNetLabelPlacements,netLabelConnectorTraceIds:this.netLabelConnectorTraceIds,inputProblem:this.inputProblem}):[],...this.getStraightConnectorCandidates(e)]}getStraightConnectorCandidates(e){let t=this.originalTraces?$ai({label:e,traces:this.traces,netLabelPlacements:this.outputNetLabelPlacements,netLabelConnectorTraceIds:this.netLabelConnectorTraceIds,inputProblem:this.inputProblem}):void 0;if(t)return[t];if(e.pinIds.length!==2||!this.isConfiguredRailLabel(e))return[];let n=this.inputProblem.chips.flatMap((l)=>l.pins).filter((l)=>e.pinIds.includes(l.pinId));if(n.length!==2||n[0]._facingDirection!==n[1]._facingDirection||n[0]._facingDirection!=="x+"&&n[0]._facingDirection!=="x-"||Math.abs(n[0].y-n[1].y)>Ou)return[];let o=this.inputProblem.availableNetLabelOrientations[e.netId];if(o?.length!==1||o[0]!==e.orientation)return[];if(this.inputProblem.netConnections.find((l)=>l.netId===e.netId)?.isGround)return[];let i=this.traces.find((l)=>this.netLabelConnectorTraceIds.has(l.mspPairId)&&l.globalConnNetId===e.globalConnNetId&&e.pinIds.every((h)=>l.pinIds.includes(h))&&l.tracePath.length>=2&&(this.pointsEqual(l.tracePath[0],e.anchorPoint)||this.pointsEqual(l.tracePath.at(-1),e.anchorPoint)));if(!i)return[];let s=this.pointsEqual(i.tracePath[0],e.anchorPoint)?i.tracePath.at(-1):i.tracePath[0];if(!this.isComponentAdjacentCorner(e,s))return[];let a=e.orientation==="y+"?1:-1,c=Math.min(q7n(this.inputProblem),e.height*2);for(let l=G3+$m;l<=c+Ou;l+=$m){let h={x:s.x,y:s.y+a*l},d=x2(h,e.orientation,e.width,e.height);if(this.intersectsAnyChip(Ui(d,e.width,e.height)))continue;return[{anchorPoint:h,traceId:i.mspPairId,distance:nT(h,e.anchorPoint),pinAligned:!0,reroutedTracePath:[s,h]}]}return[]}isComponentAdjacentCorner(e,t){return e.mspConnectionPairIds.some((n)=>{let o=this.traceMap[n];if(!o||o.tracePath.length<2)return!1;return[{point:o.tracePath[0],neighbor:o.tracePath[1]},{point:o.tracePath.at(-1),neighbor:o.tracePath.at(-2)}].some(({point:r,neighbor:i})=>this.pointsEqual(i,t)&&o.pins.some((s)=>this.pointsEqual(s,r)))})}isConfiguredRailLabel(e){if(!e.netId)return!1;return this.inputProblem.availableNetLabelOrientations[e.netId]?.some((t)=>t==="y+"||t==="y-")}isLabelCrossedByTrace(e){let t=Ui(e.center,e.width,e.height);return Zde(t,this.traceMap)}pointsEqual(e,t){return Math.abs(e.x-t.x)<=Ou&&Math.abs(e.y-t.y)<=Ou}getVerticalSegmentPointIndices(e,t){let n=e[t],o=Math.abs(e[t-1].x-n.x)<=Ou,r=Math.abs(e[t+1].x-n.x)<=Ou;if(o===r)return null;return o?[t-1,t]:[t,t+1]}isPinAlignedCorner(e,t){let n=this.getVerticalSegmentPointIndices(e,t);if(!n)return!1;let[o,r]=n;return o<=1||r>=e.length-2}getClearanceShiftedCornerCandidates({label:e,trace:t,cornerIndex:n,pinAligned:o}){if(e.orientation!=="y+"&&e.orientation!=="y-")return[];let r=t.tracePath,i=r[n],s=this.getVerticalSegmentPointIndices(r,n);if(!s||s.includes(0)||s.includes(r.length-1))return[];let a=x2(i,e.orientation,e.width,e.height),c=Ui(a,e.width,e.height),l=this.inputProblem.chips.map((d)=>Ui(d.center,d.width,d.height)).filter((d)=>Ev(c,d)),h=new Set;for(let d of l)h.add(d.minX-e.width/2),h.add(d.maxX+e.width/2);for(let d of this.traces){if(d.globalConnNetId===e.globalConnNetId)continue;for(let u=0;u<d.tracePath.length-1;u++){let _=d.tracePath[u],p=d.tracePath[u+1];if(!Rue(_,p,c))continue;let m=e.width/2;if(Math.abs(_.x-p.x)<=Ou)h.add(_.x-m-H9e),h.add(_.x+m+H9e);else h.add(Math.min(_.x,p.x)-m-H9e),h.add(Math.max(_.x,p.x)+m+H9e)}}return[...h].flatMap((d)=>{if(Math.abs(d-i.x)<=Ou)return[];let u=Mi(r.map((m,A)=>s.includes(A)?{...m,x:d}:m)),_={x:d,y:i.y};if(!zk(u).some((m)=>this.pointsEqual(m,_)))return[];return[{anchorPoint:_,traceId:t.mspPairId,distance:nT(_,e.anchorPoint),pinAligned:o,reroutedTracePath:u}]})}isReroutedTraceClear(e,t){let n=e.reroutedTracePath;if(ZZ(n,Cx(this.inputProblem)))return!1;let o=this.traceMap[e.traceId],r=this.traces.filter((s)=>s.mspPairId!==e.traceId&&s.globalConnNetId!==o.globalConnNetId);if(U7n(n,r))return!1;let i={[e.traceId]:{...o,tracePath:n}};return this.outputNetLabelPlacements.every((s,a)=>{if(a===t)return!0;return!Zde(Ui(s.center,s.width,s.height),i)})}getTraceLinesForLabel(e){return this.traces.filter((t)=>J7n(t)&&this.isTraceForLabel(t,e))}isTraceForLabel(e,t){if(!Vs(e.tracePath,t.anchorPoint))return!1;if(e.globalConnNetId===t.globalConnNetId&&this.isLabelCrossedByTrace(t))return!0;let n=new Set(t.mspConnectionPairIds);if(n.size>0)return n.has(e.mspPairId);return e.globalConnNetId===t.globalConnNetId}visualize(){return Gai({inputProblem:this.inputProblem,traces:this.traces,outputNetLabelPlacements:this.outputNetLabelPlacements,currentLabel:this.currentLabel,currentCandidateResults:this.currentCandidateResults,solved:this.solved})}},Nct=(e)=>[...new Set(e)],Jai=(e)=>[...new Set(e.filter((t)=>t!==void 0))],Zai=(e,t)=>Jai([t.netId,t.globalConnNetId,...e.netConnections.filter((n)=>t.pinIds.some((o)=>n.pinIds.includes(o))).map((n)=>n.netId)]),eci=(e)=>{switch(e){case"x+":case"+x":return"x+";case"x-":case"-x":return"x-";case"y+":case"+y":return"y+";case"y-":case"-y":return"y-"}},tci=(e,t)=>{let n=e.availableNetLabelOrientations??{};for(let o of Zai(e,t))if(Object.hasOwn(n,o))return Nct((n[o]??[]).map(eci).filter((r)=>r!==void 0));return null},P0=0.000001,F9e=0.000001,mde=(e)=>Ui(e.center,e.width,e.height),sxn=(e,t)=>Math.min(e.maxX,t.maxX)-Math.max(e.minX,t.minX)>P0&&Math.min(e.maxY,t.maxY)-Math.max(e.minY,t.minY)>P0,nci=(e,t)=>Math.min(e.maxX,t.maxX)-Math.max(e.minX,t.minX)>=-P0&&Math.min(e.maxY,t.maxY)-Math.max(e.minY,t.minY)>=-P0,axn=(e,t)=>t.tracePath.slice(1).some((n,o)=>Rv(t.tracePath[o],n,e)),oci=(e,t)=>{for(let n of t){let o=n.tracePath;for(let r=0;r<o.length-1;r++)if(aci(o[r],o[r+1],e))return!0}return!1},cxn=(e,t)=>{let n=[];for(let o of t){if(hci(o.pinIds)<2)continue;let r=0;for(let i=0;i<o.tracePath.length-1;i++){let s=o.tracePath[i],a=o.tracePath[i+1],c=LZ(s,a);if(cci(e,s,a))n.push({trace:o,distance:r+LZ(s,e)});r+=c}}return n},rci=(e)=>{let t=0;for(let n=0;n<e.tracePath.length-1;n++)t+=LZ(e.tracePath[n],e.tracePath[n+1]);return t},ici=(e,t)=>{let n=0;for(let o=0;o<e.tracePath.length-1;o++){let r=e.tracePath[o],i=e.tracePath[o+1],s=LZ(r,i),a=n+s;if(t<=a+P0){let c=Math.max(0,Math.min(s,t-n)),l=lci(r,i);return{x:r.x+l.x*c,y:r.y+l.y*c}}n=a}return e.tracePath[e.tracePath.length-1]},sci=(e)=>{let t=[],n=0;for(let o=0;o<e.tracePath.length;o++){t.push(n);let r=e.tracePath[o+1];if(r)n+=LZ(e.tracePath[o],r)}return t},LZ=(e,t)=>Math.abs(e.x-t.x)+Math.abs(e.y-t.y),aci=(e,t,n)=>{let o={minX:n.minX+F9e,minY:n.minY+F9e,maxX:n.maxX-F9e,maxY:n.maxY-F9e};if(o.minX>=o.maxX||o.minY>=o.maxY)return!1;if(Qct(e,t)){if(e.x<=o.minX+P0||e.x>=o.maxX-P0)return!1;return lxn(Math.min(e.y,t.y),Math.max(e.y,t.y),o.minY,o.maxY)}if(Rct(e,t)){if(e.y<=o.minY+P0||e.y>=o.maxY-P0)return!1;return lxn(Math.min(e.x,t.x),Math.max(e.x,t.x),o.minX,o.maxX)}return!1},cci=(e,t,n)=>{if(Rct(t,n))return Math.abs(e.y-t.y)<=P0&&e.x>=Math.min(t.x,n.x)-P0&&e.x<=Math.max(t.x,n.x)+P0;if(Qct(t,n))return Math.abs(e.x-t.x)<=P0&&e.y>=Math.min(t.y,n.y)-P0&&e.y<=Math.max(t.y,n.y)+P0;return!1},lci=(e,t)=>({x:Qct(e,t)?0:Math.sign(t.x-e.x),y:Rct(e,t)?0:Math.sign(t.y-e.y)}),Rct=(e,t)=>Math.abs(e.y-t.y)<=P0,Qct=(e,t)=>Math.abs(e.x-t.x)<=P0,lxn=(e,t,n,o)=>Math.min(t,o)-Math.max(e,n)>P0,hci=(e)=>new Set(e).size,hxn=0.1,dci=(e)=>{let{inputProblem:t,label:n,traceLocation:o}=e,r=rci(o.trace),i=tci(t,n),s=uci(r,sci(o.trace)),a=Ici(t,n),c=vci(t,n),l=[],h=new Set;for(let d of s){let u=ici(o.trace,d),_=pci({inputProblem:t,label:n,point:u,orientationConstraint:i});for(let p of _){if(Sci(n,u,p))continue;let m=[u.x.toFixed(6),u.y.toFixed(6),p].join(":");if(h.has(m))continue;h.add(m),l.push(mci({point:u,orientation:p,netLabelWidth:a,netLabelHeight:c,traceLocation:o,pathDistance:d,label:n}))}}return l},uci=(e,t)=>{let n=new Set,o=Math.ceil(e/hxn);for(let r=0;r<=o;r++){let i=Math.min(e,r*hxn);n.add(uxn(i))}for(let r of t)n.add(uxn(r));return[...n].filter((r)=>r>=-P0&&r<=e+P0).sort((r,i)=>r-i)},pci=(e)=>{let{inputProblem:t,label:n,point:o,orientationConstraint:r}=e;if(r)return r;return _ci({label:n,inputProblem:t,point:o})},mci=(e)=>{let{point:t,orientation:n,netLabelWidth:o,netLabelHeight:r,traceLocation:i,pathDistance:s,label:a}=e,{width:c,height:l}=bv({orientation:n,netLabelWidth:o,netLabelHeight:r});return{anchorPoint:t,center:x2(t,n,c,l),width:c,height:l,orientation:n,traceId:i.trace.mspPairId,pathDistance:s,distanceFromOriginal:LZ(t,a.anchorPoint),status:"valid",selected:!1}},_ci=(e)=>{let{label:t,inputProblem:n,point:o}=e;return Nct([...gci(t),...Aci({inputProblem:n,point:o}),...xci])},gci=(e)=>[e.orientation,Cci(e.orientation)],Aci=(e)=>{let{inputProblem:t,point:n}=e,o=bci(t);return Nct(fci(n,o).sort((r,i)=>i.outwardScore-r.outwardScore).map(({orientation:r})=>r))},fci=(e,t)=>{let n=[];return n.push(dxn({value:e.y,min:t.minY,max:t.maxY,center:t.centerY,positiveOrientation:"y+",negativeOrientation:"y-"})),n.push(dxn({value:e.x,min:t.minX,max:t.maxX,center:t.centerX,positiveOrientation:"x+",negativeOrientation:"x-"})),n},dxn=(e)=>{let{value:t,min:n,max:o,center:r,positiveOrientation:i,negativeOrientation:s}=e;if(t>o+P0)return{orientation:i,outwardScore:1+t-o};if(t<n-P0)return{orientation:s,outwardScore:1+n-t};return{orientation:t>=r?i:s,outwardScore:yci(t,r,o-n)}},yci=(e,t,n)=>Math.abs(e-t)/Math.max(P0,n/2),xci=["x+","x-","y+","y-"],Cci=(e)=>{switch(e){case"x+":return"x-";case"x-":return"x+";case"y+":return"y-";case"y-":return"y+"}},bci=(e)=>{if(e.chips.length===0)return{minX:0,minY:0,maxX:0,maxY:0,centerX:0,centerY:0};let t=e.chips.reduce((n,o)=>({minX:Math.min(n.minX,o.center.x-o.width/2),minY:Math.min(n.minY,o.center.y-o.height/2),maxX:Math.max(n.maxX,o.center.x+o.width/2),maxY:Math.max(n.maxY,o.center.y+o.height/2)}),{minX:Number.POSITIVE_INFINITY,minY:Number.POSITIVE_INFINITY,maxX:Number.NEGATIVE_INFINITY,maxY:Number.NEGATIVE_INFINITY});return{...t,centerX:(t.minX+t.maxX)/2,centerY:(t.minY+t.maxY)/2}},Ici=(e,t)=>{let n=gP({inputProblem:e,netId:t.netId,pinIds:t.pinIds,isPortOnlyLabel:t.mspConnectionPairIds.length===0});if(n!==void 0)return n;if(t.orientation==="y+"||t.orientation==="y-")return t.height;return t.width},vci=(e,t)=>{let n=e.netConnections.find((o)=>o.netId===t.netId)?.netLabelHeight;if(n!==void 0)return n;return e.netConnections.find((o)=>o.pinIds.some((r)=>t.pinIds.includes(r)))?.netLabelHeight},uxn=(e)=>Number(e.toFixed(6)),Sci=(e,t,n)=>Math.abs(t.x-e.anchorPoint.x)<=P0&&Math.abs(t.y-e.anchorPoint.y)<=P0&&n===e.orientation,Pci="blue",_Sn="red",Eci=(e)=>{let t=Bp(e.inputProblem);if(Dci(t),Mci(t,e.traces),wci(t,e.inputProblem,e.outputNetLabelPlacements),!e.solved)Bci(t,e),Tci(t,e.currentCandidateResults);return t},Mci=(e,t)=>{for(let n of t)e.lines.push({points:n.tracePath,strokeColor:"purple"})},wci=(e,t,n)=>{for(let o of n)e.rects.push({center:o.center,width:o.width,height:o.height,fill:Vc(o.globalConnNetId,0.35),strokeColor:Vc(o.globalConnNetId,0.9),label:Nci(t,o)}),e.points.push({x:o.anchorPoint.x,y:o.anchorPoint.y,color:Vc(o.globalConnNetId,0.9),label:`anchorPoint
orientation: ${o.orientation}`})},Bci=(e,t)=>{if(!t.currentOverlap)return;let n=t.currentOverlap.type==="trace"?[t.currentOverlap.labelIndex]:[t.currentOverlap.firstLabelIndex,t.currentOverlap.secondLabelIndex];for(let o of n){let r=t.outputNetLabelPlacements[o];if(!r)continue;e.rects.push({center:r.center,width:r.width,height:r.height,fill:"rgba(255, 0, 0, 0.2)",strokeColor:_Sn,label:`netlabel overlap target
${r.netId??r.globalConnNetId}
${gSn(t.inputProblem,r)}`})}},Tci=(e,t)=>{for(let n of t){let o=n.selected?Pci:_Sn;e.rects.push({center:n.center,width:n.width,height:n.height,fill:n.selected?"rgba(0, 0, 255, 0.2)":"rgba(255, 0, 0, 0.15)",strokeColor:o,strokeDash:n.selected?void 0:"4 2",label:`${n.selected?"selected":n.status} netlabel overlap candidate
trace: ${n.traceId}
path distance: ${n.pathDistance.toFixed(3)}
orientation: ${n.orientation}
distance from original: ${n.distanceFromOriginal.toFixed(3)}`}),e.points.push({...n.anchorPoint,color:o,label:`candidate anchor
${n.status}`})}},Dci=(e)=>{if(!e.lines)e.lines=[];if(!e.points)e.points=[];if(!e.rects)e.rects=[];if(!e.circles)e.circles=[];if(!e.texts)e.texts=[]},gSn=(e,t)=>`available orientations: ${Rci(e,t)?.join(", ")??"any"}`,Nci=(e,t)=>[`netId: ${t.netId}`,`globalConnNetId: ${t.globalConnNetId}`,gSn(e,t)].join(`
`),Rci=(e,t)=>{let n=e.availableNetLabelOrientations??{};for(let o of[t.netId,t.globalConnNetId])if(o&&Object.hasOwn(n,o))return n[o];return},pxn=class extends Gu{inputProblem;traces;netLabelPlacements;outputNetLabelPlacements;currentOverlap=null;currentCandidateResults=[];activeSearch=null;skippedOverlapKeys=new Set;overlapMode;netLabelConnectorTraceIds;constructor(e){super();this.overlapMode=e.overlapMode??"labels",this.netLabelConnectorTraceIds=e.netLabelConnectorTraceIds??new Set,this.inputProblem=e.inputProblem,this.traces=e.traces,this.netLabelPlacements=e.netLabelPlacements,this.outputNetLabelPlacements=[...e.netLabelPlacements]}getConstructorParams(){return{overlapMode:this.overlapMode,netLabelConnectorTraceIds:this.netLabelConnectorTraceIds,inputProblem:this.inputProblem,traces:this.traces,netLabelPlacements:this.netLabelPlacements}}_step(){if(this.activeSearch?.completed)this.clearActiveSearch();let e=this.getNextSearchWithCandidates();if(!e){this.finish();return}this.evaluateNextCandidate(e)}getOutput(){return{netLabelPlacements:this.outputNetLabelPlacements}}findNextOverlap(){if(this.overlapMode==="traces")return this.findNextTraceOverlap();for(let e=0;e<this.outputNetLabelPlacements.length;e++)for(let t=e+1;t<this.outputNetLabelPlacements.length;t++){if(!this.isLabelEligible(e)&&!this.isLabelEligible(t))continue;let n={type:"labels",firstLabelIndex:e,secondLabelIndex:t};if(this.skippedOverlapKeys.has(this.getOverlapKey(n)))continue;if(this.labelsOverlap(n))return n}return null}findNextTraceOverlap(){for(let e=0;e<this.outputNetLabelPlacements.length;e++){if(!this.isLabelEligible(e))continue;let t=this.outputNetLabelPlacements[e],n=mde(t);for(let o of this.traces){if(o.globalConnNetId===t.globalConnNetId)continue;let r={type:"trace",labelIndex:e,traceId:o.mspPairId};if(this.skippedOverlapKeys.has(this.getOverlapKey(r)))continue;if(axn(n,o))return r}}return null}isLabelEligible(e){return this.getTraceLocationsForLabel(e).length>0}labelsOverlap(e){let t=this.outputNetLabelPlacements[e.firstLabelIndex],n=this.outputNetLabelPlacements[e.secondLabelIndex];if(!t||!n)return!1;return sxn(mde(t),mde(n))}startNextOverlapSearch(){let e=this.findNextOverlap();if(!e)return null;let t={overlap:e,queuedLabelIndices:this.getMoveLabelIndices(e),labelIndex:null,candidates:[],candidateIndex:0,candidateResults:[],completed:!1};return this.setActiveSearch(t),t}getMoveLabelIndices(e){if(e.type==="trace")return[e.labelIndex];let t=[];if(this.isLabelEligible(e.secondLabelIndex))t.push(e.secondLabelIndex);if(this.isLabelEligible(e.firstLabelIndex))t.push(e.firstLabelIndex);return t}getNextSearchWithCandidates(){while(!0){let e=this.activeSearch??this.startNextOverlapSearch();if(!e)return null;if(this.activateNextLabelSearch(e))return e;this.skipSearch(e)}}activateNextLabelSearch(e){if(e.labelIndex!==null&&e.candidateIndex<e.candidates.length)return!0;while(e.queuedLabelIndices.length>0){let t=e.queuedLabelIndices.shift(),n=this.outputNetLabelPlacements[t];if(!n)continue;if(e.labelIndex=t,e.candidates=this.getCandidatesForLabel(n),e.candidateIndex=0,e.candidates.length>0)return!0}return e.labelIndex=null,e.candidates=[],e.candidateIndex=0,!1}skipSearch(e){this.skippedOverlapKeys.add(this.getOverlapKey(e.overlap)),this.clearActiveSearch()}evaluateNextCandidate(e){let t=e.labelIndex;if(t===null)return;let n=this.outputNetLabelPlacements[t],o=e.candidates[e.candidateIndex];if(!n||!o)return;e.candidateIndex+=1;let r={...o,status:this.getCandidateStatus(o,t)};if(e.candidateResults.push(r),r.status!=="valid")return;r.selected=!0,this.applyCandidate(t,n,r),e.completed=!0}getCandidatesForLabel(e){let t=[];for(let n of cxn(e.anchorPoint,this.traces).filter(({trace:o})=>this.isHostTraceForLabel(o,e)))t.push(...dci({inputProblem:this.inputProblem,label:e,traceLocation:n}));return t}getCandidateStatus(e,t){let n=mde(e);if(this.intersectsAnyChip(n))return"chip-collision";if(JZ(n,this.inputProblem))return"text-collision";if(oci(n,this.traces))return"trace-collision";if(this.overlapMode==="traces"&&this.traces.some((o)=>o.globalConnNetId!==this.outputNetLabelPlacements[t].globalConnNetId&&axn(n,o)))return"trace-collision";if(this.intersectsAnyOtherLabel(n,t))return"netlabel-collision";return"valid"}applyCandidate(e,t,n){this.outputNetLabelPlacements[e]={...t,anchorPoint:n.anchorPoint,center:n.center,width:n.width,height:n.height,orientation:n.orientation}}intersectsAnyChip(e){return this.inputProblem.chips.some((t)=>nci(e,Ui(t.center,t.width,t.height)))}intersectsAnyOtherLabel(e,t){return this.outputNetLabelPlacements.some((n,o)=>{if(o===t)return!1;return sxn(e,mde(n))})}getTraceLocationsForLabel(e){let t=this.outputNetLabelPlacements[e];if(!t)return[];return cxn(t.anchorPoint,this.traces).filter(({trace:n})=>this.isHostTraceForLabel(n,t))}isHostTraceForLabel(e,t){if(this.netLabelConnectorTraceIds.has(e.mspPairId))return!1;if(t.mspConnectionPairIds.includes(e.mspPairId))return!0;if(t.netId!==void 0&&t.netId===e.userNetId)return!0;return t.globalConnNetId===e.globalConnNetId}getOverlapKey(e){if(e.type==="trace"){let o=this.outputNetLabelPlacements[e.labelIndex];return["trace",e.traceId,e.labelIndex,o.anchorPoint.x,o.anchorPoint.y,o.orientation].join(":")}let t=this.outputNetLabelPlacements[e.firstLabelIndex],n=this.outputNetLabelPlacements[e.secondLabelIndex];return[e.firstLabelIndex,e.secondLabelIndex,t?.anchorPoint.x,t?.anchorPoint.y,n?.anchorPoint.x,n?.anchorPoint.y].join(":")}finish(){this.clearActiveSearch(),this.solved=!0}setActiveSearch(e){this.activeSearch=e,this.currentOverlap=e.overlap,this.currentCandidateResults=e.candidateResults}clearActiveSearch(){this.activeSearch=null,this.currentOverlap=null,this.currentCandidateResults=[]}visualize(){return Eci({inputProblem:this.inputProblem,traces:this.traces,outputNetLabelPlacements:this.outputNetLabelPlacements,currentOverlap:this.currentOverlap,currentCandidateResults:this.currentCandidateResults,solved:this.solved})}},Qci=0.000001;function kci(e){let{point:t,segmentStart:n,segmentEnd:o}=e,r=o.x-n.x,i=o.y-n.y,s=r*r+i*i;if(s===0)return{x:n.x,y:n.y};let a=((t.x-n.x)*r+(t.y-n.y)*i)/s,c=Math.max(0,Math.min(1,a));return{x:n.x+c*r,y:n.y+c*i}}function ASn(e,t){let n=t[0],o=1/0;for(let r=0;r<t.length-1;r++){let i=kci({point:e,segmentStart:t[r],segmentEnd:t[r+1]}),s=i.x-e.x,a=i.y-e.y,c=s*s+a*a;if(c<o)o=c,n=i}return n}function mxn(e,t){let n=ASn(e,t);return Math.hypot(n.x-e.x,n.y-e.y)<Qci}function Lci(e,t){let o=(m)=>Ui(m.center,m.width,m.height),r=(m,A)=>{let g=o(m),f=o(A);return g.minX<=f.maxX+0.01&&g.maxX>=f.minX-0.01&&g.minY<=f.maxY+0.01&&g.maxY>=f.minY-0.01},i=new Set([e]),s=!0;while(s){s=!1;for(let m of t){if(i.has(m))continue;if([...i].some((A)=>r(A,m)))i.add(m),s=!0}}let a=1/0,c=1/0,l=-1/0,h=-1/0;for(let m of i){let A=o(m);if(A.minX<a)a=A.minX;if(A.minY<c)c=A.minY;if(A.maxX>l)l=A.maxX;if(A.maxY>h)h=A.maxY}let d=(a+l)/2,u=(c+h)/2,_=l-a,p=h-c;return{...e,center:{x:d,y:u},width:_,height:p}}function Hci(e,t){let n=[];for(let o of e)for(let r of t){if(o.globalConnNetId===r.globalConnNetId)continue;let i=Ui(r.center,r.width,r.height),s=o.tracePath;for(let a=0;a<s.length-1;a++)if(Rv(s[a],s[a+1],i)){n.push({trace:o,label:r});break}}return n}var Fci=0.1,zci=3,_xn=class extends Gu{inputProblem;traces;netLabelPlacements;outputTraces;outputNetLabelPlacements;completedReroutes=[];activeSubSolver=null;recentlyFailed=new Set;detourCounts=new Map;currentOverlap=null;constructor(e){super();this.inputProblem=e.inputProblem,this.traces=e.traces,this.netLabelPlacements=e.netLabelPlacements,this.outputTraces=[...e.traces],this.outputNetLabelPlacements=[...e.netLabelPlacements]}getConstructorParams(){return{inputProblem:this.inputProblem,traces:this.traces,netLabelPlacements:this.netLabelPlacements}}_step(){if(this.activeSubSolver){if(this.activeSubSolver.step(),this.activeSubSolver.solved){let a=this.activeSubSolver.solvedTracePath;if(a){this.completedReroutes.push({initialTrace:{...this.activeSubSolver.initialTrace,tracePath:this.activeSubSolver.initialTrace.tracePath.map((l)=>({...l}))},reroutedTracePath:a.map((l)=>({...l})),label:this.activeSubSolver.label,detourCount:this.activeSubSolver.detourCount});let c=this.outputTraces.findIndex((l)=>l.mspPairId===this.activeSubSolver.initialTrace.mspPairId);if(c!==-1){let l=this.outputTraces[c].tracePath;this.outputTraces[c]={...this.outputTraces[c],tracePath:a},this.reanchorLabelsOnMovedTrace(this.outputTraces[c],l)}}this.activeSubSolver=null,this.currentOverlap=null}else if(this.activeSubSolver.failed){let a=this.getOverlapKey(this.activeSubSolver.initialTrace,this.activeSubSolver.label);this.recentlyFailed.add(a),this.activeSubSolver=null,this.currentOverlap=null}return}let t=Hci(this.outputTraces,this.outputNetLabelPlacements).filter((a)=>{let c=this.getOverlapKey(a.trace,a.label);return!this.recentlyFailed.has(c)});if(t.length===0){this.solved=!0;return}let n=t[0],o=this.outputTraces.find((a)=>a.mspPairId===n.trace.mspPairId);this.currentOverlap=n;let r=Lci(n.label,this.outputNetLabelPlacements.filter((a)=>a.globalConnNetId!==o.globalConnNetId)),i=`${n.trace.mspPairId}::merged::${r.center.x},${r.center.y},${r.width},${r.height}`,s=this.detourCounts.get(i)??0;if(s>=zci){this.recentlyFailed.add(this.getOverlapKey(n.trace,n.label)),this.currentOverlap=null;return}this.detourCounts.set(i,s+1),this.activeSubSolver=new _ve({trace:o,label:r,problem:this.inputProblem,paddingBuffer:Fci,detourCount:s,tracesToAvoidOverlapping:this.outputTraces,netLabelPlacements:this.outputNetLabelPlacements})}reanchorLabelsOnMovedTrace(e,t){for(let n=0;n<this.outputNetLabelPlacements.length;n++){let o=this.outputNetLabelPlacements[n];if(o.globalConnNetId!==e.globalConnNetId)continue;if(mxn(o.anchorPoint,e.tracePath))continue;if(!mxn(o.anchorPoint,t))continue;let r=ASn(o.anchorPoint,e.tracePath);this.outputNetLabelPlacements[n]={...o,anchorPoint:r,center:x2(r,o.orientation,o.width,o.height)}}}getOutput(){return{traces:this.outputTraces,completedReroutes:this.completedReroutes,netLabelPlacements:this.outputNetLabelPlacements}}getOverlapKey(e,t){return`${e.mspPairId}::${t.globalConnNetId}`}visualize(){if(this.activeSubSolver)return this.activeSubSolver.visualize();let e=Bp(this.inputProblem);if(!e.lines)e.lines=[];if(!e.rects)e.rects=[];if(!e.points)e.points=[];for(let t of this.outputTraces)e.lines.push({points:t.tracePath,strokeColor:"purple"});for(let t of this.outputNetLabelPlacements)e.rects.push({center:t.center,width:t.width,height:t.height,fill:Vc(t.globalConnNetId,0.35),strokeColor:Vc(t.globalConnNetId,0.9),label:`netId: ${t.netId}
globalConnNetId: ${t.globalConnNetId}`}),e.points.push({x:t.anchorPoint.x,y:t.anchorPoint.y,color:Vc(t.globalConnNetId,0.9)});if(this.currentOverlap)e.lines.push({points:this.currentOverlap.trace.tracePath,strokeColor:"red"}),e.rects.push({center:this.currentOverlap.label.center,width:this.currentOverlap.label.width,height:this.currentOverlap.label.height,fill:"rgba(255,0,0,0.3)",strokeColor:"red"});return e}},np=(e)=>{if(e.orientation!=="x-"&&e.orientation!=="x+"){if(e.netLabelText&&e.width>e.height){let{height:r,width:i}=e,s=x2(e.anchorPoint,e.orientation,r,i);return Ui(s,r,i)}return Ui(e.center,e.width,e.height)}let t=Math.max(e.width,e.height),n=xct,o=x2(e.anchorPoint,e.orientation,t,n);return Ui(o,t,n)},gxn=0.0001,Oot=0.000001,Oci=0.1,Vci={"x+":{x:1,y:0},"x-":{x:-1,y:0},"y+":{x:0,y:1},"y-":{x:0,y:-1}},Yci={ok:"green","label-collision":"orange","trace-collision":"darkorange","chip-collision":"red","text-collision":"purple"},Gci={ok:"rgba(0, 200, 0, 0.25)","label-collision":"rgba(255, 160, 0, 0.2)","trace-collision":"rgba(200, 80, 0, 0.2)","chip-collision":"rgba(220, 0, 0, 0.15)","text-collision":"rgba(128, 0, 128, 0.15)"};function Axn(e,t){return e.minX<t.maxX-0.000000001&&e.maxX>t.minX+0.000000001&&e.minY<t.maxY-0.000000001&&e.maxY>t.minY+0.000000001}function Uci(e,t){let n=t.x-e.x,o=t.y-e.y,r=Math.sqrt(n*n+o*o),i=Math.max(1,Math.round(r/Oci)),s=[];for(let a=0;a<=i;a++){let c=a/i;s.push({x:e.x+c*n,y:e.y+c*o})}return s}var kct=class extends Gu{constructor(e){super();this.params=e,this.inputProblem=e.inputProblem,this.traces=e.traces,this.netLabelPlacements=e.netLabelPlacements,this.outputNetLabelPlacements=[...e.netLabelPlacements],this.chipIndex=e.inputProblem._chipObstacleSpatialIndex??(e.inputProblem.chips.length>0?new u7e(e.inputProblem.chips):void 0),this.traceMap=Object.fromEntries(e.traces.map((t)=>[t.mspPairId,t]))}params;inputProblem;traces;netLabelPlacements;outputNetLabelPlacements;currentCollision=null;currentLabelToMove=null;candidateResults=[];chipIndex;traceMap;skippedCollisionKeys=new Set;labelsToTry=[];candidateQueue=[];candidateIndex=0;getConstructorParams(){return{inputProblem:this.inputProblem,traces:this.traces,netLabelPlacements:this.netLabelPlacements,fixedNetLabelPlacements:this.params.fixedNetLabelPlacements,useRenderedLabelBounds:this.params.useRenderedLabelBounds,preserveNonInlineLabelsAgainstInlineEligibleCollisions:this.params.preserveNonInlineLabelsAgainstInlineEligibleCollisions}}getOutput(){return{netLabelPlacements:this.outputNetLabelPlacements}}labelBounds(e){if(!this.params.useRenderedLabelBounds||this.params.fixedNetLabelPlacements?.includes(e))return Ui(e.center,e.width,e.height);return np(e)}collisionKey(e,t){return[e.globalConnNetId,t.globalConnNetId].sort().join("::")}isSingleTerminalInlineEligible(e){if(!e.netId)return!1;return[...this.inputProblem.netConnections,...this.inputProblem.directConnections].some((t)=>t.allowInlineNetLabel&&t.pinIds.length===1&&t.netId===e.netId&&e.pinIds.every((n)=>t.pinIds.includes(n)))}hasSatisfiedSingleOrientation(e){if(!e.netId)return!1;let t=this.inputProblem.availableNetLabelOrientations[e.netId];return t?.length===1&&t[0]===e.orientation}isAlignedWithHostTrace(e){let t=e.orientation.startsWith("x")?"x":"y";return e.mspConnectionPairIds.some((n)=>{let o=this.traceMap[n];return o?.tracePath.slice(1).some((r,i)=>{let s=o.tracePath[i];if(!Vs([s,r],e.anchorPoint))return!1;return(Math.abs(s.x-r.x)<Oot?"y":"x")===t})})}isProtectedAgainstTemporaryInlineCollision(e){return!this.isSingleTerminalInlineEligible(e)&&this.hasSatisfiedSingleOrientation(e)&&this.isAlignedWithHostTrace(e)}findNextCollidingPair(){let e=[...this.outputNetLabelPlacements,...this.params.fixedNetLabelPlacements??[]];for(let t=0;t<this.outputNetLabelPlacements.length;t++)for(let n=t+1;n<e.length;n++){let o=e[t],r=e[n];if(o.globalConnNetId===r.globalConnNetId&&!this.params.fixedNetLabelPlacements?.includes(r))continue;if(this.skippedCollisionKeys.has(this.collisionKey(o,r)))continue;if(Axn(this.labelBounds(o),this.labelBounds(r)))return[o,r]}return null}netLabelWidthOf(e){if(e.orientation==="x+"||e.orientation==="x-")return e.width;return e.height}netLabelHeightOf(e){if(e.orientation==="x+"||e.orientation==="x-")return e.height;return e.width}buildCandidatesForLabel(e){let t=this.netLabelWidthOf(e),n=this.netLabelHeightOf(e),o=[],r=(c,l,h,d)=>{let{width:u,height:_}=bv({orientation:c,netLabelWidth:t,netLabelHeight:n}),p=x2(l,c,u,_),m=Vci[c],A={x:p.x+m.x*gxn,y:p.y+m.y*gxn};return{orientation:c,anchor:l,center:A,width:u,height:_,bounds:this.params.useRenderedLabelBounds?np({...e,orientation:c,anchorPoint:l,center:A,width:u,height:_}):Ui(A,u,_),hostPairId:h,hostSegIndex:d,status:null}},i=e.mspConnectionPairIds.some((c)=>{let l=this.traceMap[c];return l&&Vs(l.tracePath,e.anchorPoint)}),s=this.traces.some((c)=>(this.params.netLabelConnectorTraceIds?.has(c.mspPairId)||!i&&!e.mspConnectionPairIds.includes(c.mspPairId))&&c.globalConnNetId===e.globalConnNetId&&Vs(c.tracePath,e.anchorPoint));if(e.mspConnectionPairIds.length===0||s){let c=["x+","x-","y+","y-"],l=[e.orientation,...c.filter((h)=>h!==e.orientation)];for(let h of l)o.push(r(h,e.anchorPoint))}else for(let c of e.mspConnectionPairIds){let l=this.traceMap[c];if(!l)continue;let h=l.tracePath;for(let d=0;d<h.length-1;d++){let u=h[d],_=h[d+1],p=Math.abs(u.y-_.y)<Oot,m=Math.abs(u.x-_.x)<Oot;if(!p&&!m)continue;let A;if(p)A=["y+","y-"];else A=["x+","x-"];for(let g of Uci(u,_))for(let f of A)o.push(r(f,g,c,d))}}let a=e.netId?this.inputProblem.availableNetLabelOrientations[e.netId]:void 0;return s&&a?.length?o.filter((c)=>a.includes(c.orientation)):o}checkCandidate(e,t,n){let{bounds:o,hostPairId:r,hostSegIndex:i}=e;if((this.chipIndex?.getChipsInBounds(o).length??0)>0)return"chip-collision";if(JZ(o,this.inputProblem))return"text-collision";if(Sct(o,this.traceMap,r,i).hasIntersection)return"trace-collision";for(let s of n){if(s.globalConnNetId===t&&!this.params.fixedNetLabelPlacements?.includes(s))continue;if(Axn(o,this.labelBounds(s)))return"label-collision"}return"ok"}beginSearchForLabel(e){this.currentLabelToMove=e,this.candidateQueue=this.buildCandidatesForLabel(e),this.candidateIndex=0,this.candidateResults=[]}getNearbyValidPlacements(e,t){let n=(r)=>Math.hypot(r.anchor.x-e.anchorPoint.x,r.anchor.y-e.anchorPoint.y),o=[...this.outputNetLabelPlacements.filter((r)=>r!==e),...this.params.fixedNetLabelPlacements??[]];return this.buildCandidatesForLabel(e).filter((r)=>n(r)<=t&&this.checkCandidate(r,e.globalConnNetId,o)==="ok").sort((r,i)=>n(r)-n(i)).map((r)=>({...e,orientation:r.orientation,anchorPoint:r.anchor,center:r.center,width:r.width,height:r.height}))}clearActiveSearch(){this.currentCollision=null,this.currentLabelToMove=null,this.labelsToTry=[],this.candidateQueue=[],this.candidateIndex=0,this.candidateResults=[]}_step(){if(!this.currentCollision){let s=this.findNextCollidingPair();if(!s){this.solved=!0;return}if(this.currentCollision=s,this.labelsToTry=[s[1],s[0]].filter((a)=>!(this.params.fixedNetLabelPlacements??[]).includes(a)),this.params.preserveNonInlineLabelsAgainstInlineEligibleCollisions&&s.some((a)=>this.isSingleTerminalInlineEligible(a))&&s.some((a)=>this.isProtectedAgainstTemporaryInlineCollision(a)))this.labelsToTry=this.labelsToTry.filter((a)=>this.isSingleTerminalInlineEligible(a)||!this.isProtectedAgainstTemporaryInlineCollision(a));if(this.labelsToTry.length===0){this.skippedCollisionKeys.add(this.collisionKey(s[0],s[1])),this.clearActiveSearch();return}this.beginSearchForLabel(this.labelsToTry.shift());return}if(this.candidateIndex>=this.candidateQueue.length){if(this.labelsToTry.length>0)this.beginSearchForLabel(this.labelsToTry.shift());else this.skippedCollisionKeys.add(this.collisionKey(this.currentCollision[0],this.currentCollision[1])),this.clearActiveSearch();return}let e=this.candidateQueue[this.candidateIndex++],[t,n]=this.currentCollision,o;if(this.currentLabelToMove===n)o=t;else o=n;let r=[...[...this.outputNetLabelPlacements,...this.params.fixedNetLabelPlacements??[]].filter((s)=>s!==t&&s!==n),o],i=this.checkCandidate(e,this.currentLabelToMove.globalConnNetId,r);if(e.status=i,this.candidateResults.push({...e}),i==="ok"){let s=this.outputNetLabelPlacements.indexOf(this.currentLabelToMove);if(s!==-1)this.outputNetLabelPlacements[s]={...this.currentLabelToMove,orientation:e.orientation,anchorPoint:e.anchor,width:e.width,height:e.height,center:e.center};this.clearActiveSearch()}}visualize(){let e=Bp(this.inputProblem);if(!e.lines)e.lines=[];if(!e.rects)e.rects=[];if(!e.points)e.points=[];for(let n of this.traces)e.lines.push({points:n.tracePath,strokeColor:"purple"});for(let n of this.outputNetLabelPlacements){let o=this.currentCollision!=null&&(n===this.currentCollision[0]||n===this.currentCollision[1]),r,i,s,a;if(o)r="rgba(255, 0, 0, 0.2)",i="red",s=`netId: ${n.netId}
globalConnNetId: ${n.globalConnNetId}
⚠ COLLIDING`,a="red";else r=Vc(n.globalConnNetId,0.35),i=Vc(n.globalConnNetId,0.9),s=`netId: ${n.netId}
globalConnNetId: ${n.globalConnNetId}`,a=Vc(n.globalConnNetId,0.9);e.rects.push({center:n.center,width:n.width,height:n.height,fill:r,strokeColor:i,label:s}),e.points.push({x:n.anchorPoint.x,y:n.anchorPoint.y,color:a,label:`anchorPoint
orientation: ${n.orientation}`})}let t=this.currentLabelToMove?this.currentLabelToMove.netId:"?";for(let n of this.candidateResults){let o=Yci[n.status],r=Gci[n.status],i;if(n.status!=="ok")i="4 2";e.rects.push({center:n.center,width:n.width,height:n.height,fill:r,strokeColor:o,strokeDash:i,label:`candidate: ${n.status}
orientation: ${n.orientation}
moving: ${t}`}),e.points.push({x:n.anchor.x,y:n.anchor.y,color:o,label:`candidate anchor
${n.status}`})}return e}},f2=0.2,kue=0.000000001,Wci="GND",nG=(e,t)=>Math.abs(e.x-t.x)<=kue&&Math.abs(e.y-t.y)<=kue,iZ=(e)=>{let t=[];for(let n of e){let o=t.at(-1);if(!o||!nG(o,n))t.push(n)}return t},nL=(e)=>{let t=0;for(let n=0;n<e.length-1;n++){let o=e[n],r=e[n+1];t+=Math.abs(r.x-o.x)+Math.abs(r.y-o.y)}return t},nst=({pin:e,facingDirection:t})=>{let n={x:e.x,y:e.y};if(t==="x+")n.x+=f2;if(t==="x-")n.x-=f2;if(t==="y+")n.y+=f2;if(t==="y-")n.y-=f2;return n},fSn=(e)=>({minX:Math.min(...e.map((t)=>t.minX)),minY:Math.min(...e.map((t)=>t.minY)),maxX:Math.max(...e.map((t)=>t.maxX)),maxY:Math.max(...e.map((t)=>t.maxY))}),fxn=({connectionPair:e,obstacles:t,channelObstacles:n=t})=>{let[o,r]=e.pins,i=nst({pin:o,facingDirection:o._facingDirection}),s=nst({pin:r,facingDirection:r._facingDirection}),a=fSn(t),c=[a.minY-f2,a.maxY+f2,...n.flatMap((d)=>[d.minY-f2,d.maxY+f2])],l=[a.minX-f2,a.maxX+f2,...n.flatMap((d)=>[d.minX-f2,d.maxX+f2])],h=[Cct({...o,facingDirection:o._facingDirection},{...r,facingDirection:r._facingDirection},{overshoot:f2})];for(let d of new Set(c))h.push(iZ([o,i,{x:i.x,y:d},{x:s.x,y:d},s,r]));for(let d of new Set(l))h.push(iZ([o,i,{x:d,y:i.y},{x:d,y:s.y},s,r]));return h.sort((d,u)=>nL(d)-nL(u))},Xci=(e,t)=>({x:(e.x+t.x)/2,y:(e.y+t.y)/2}),jci=(e)=>{let t=[];for(let n of e){for(let r=0;r<n.tracePath.length-1;r++){let i=n.tracePath[r],s=n.tracePath[r+1];t.push(i),t.push(Xci(i,s))}let o=n.tracePath.at(-1);if(o)t.push(o)}return t},Kci=({connectionPair:e,sameNetTraces:t})=>{let n=new Set(t.flatMap((o)=>o.pinIds));return e.pins.filter((o)=>!n.has(o.pinId))},$ci=(e,t)=>{for(let n=0;n<e.length-1;n++)for(let o=0;o<t.length-1;o++)if(K3(e[n],e[n+1],t[o],t[o+1]))return!0;return!1},qci=({connectionPair:e,sameNetTraces:t})=>{let[n,o]=e.pins,r=new Set(t.flatMap((s,a)=>s.pinIds.includes(n.pinId)?[a]:[])),i=-1;while(r.size!==i){i=r.size;for(let s=0;s<t.length;s++){if(r.has(s))continue;let a=t[s];if([...r].some((l)=>{let h=t[l];return a.pinIds.some((d)=>h.pinIds.includes(d))||$ci(a.tracePath,h.tracePath)}))r.add(s)}}return[...r].some((s)=>t[s].pinIds.includes(o.pinId))},Jci=({connectionPair:e,sameNetTraces:t,obstacles:n,maxConnectionDistance:o})=>{let r=fSn(n),i=[r.minY-f2,r.maxY+f2],s=[r.minX-f2,r.maxX+f2],a=[],c=jci(t),l=Kci({connectionPair:e,sameNetTraces:t});for(let h of l){let d=nst({pin:h,facingDirection:h._facingDirection});for(let u of c){if(Dv(h,u)>o)continue;a.push(iZ([h,d,{x:d.x,y:u.y},u])),a.push(iZ([h,d,{x:u.x,y:d.y},u]));for(let _ of i)a.push(iZ([h,d,{x:d.x,y:_},{x:u.x,y:_},u]));for(let _ of s)a.push(iZ([h,d,{x:_,y:d.y},{x:_,y:u.y},u]))}}return a.sort((h,d)=>nL(h)-nL(d))},Zci=({path:e,obstacles:t,connectionPair:n,rejectComponentBoundaryTravel:o})=>{let r=e[0],i=e.at(-1),s=n.pins.find((u)=>nG(u,r)),a=n.pins.find((u)=>nG(u,i));for(let[u,_]of[[s,e[1]],[a,e[e.length-2]]]){if(!u?._facingDirection)continue;let p=Pp(u._facingDirection);if((_.x-u.x)*p.x+(_.y-u.y)*p.y<-kue)return!0}let c=s!==void 0&&a!==void 0,l=t.find((u)=>u.kind==="chip"&&u.chipId===s?.chipId),h=t.find((u)=>u.kind==="chip"&&u.chipId===a?.chipId);if(o&&l&&_8e(e[0],e[1],l))return!0;if(o&&h&&_8e(e[e.length-2],e[e.length-1],h))return!0;return uT(e,t,{excludeRectsForSegment:(u)=>{let _=new Set;if(u===0&&l)_.add(l);if(c&&u===e.length-2&&h)_.add(h);return _}})!==null},eli=({connectionPair:e,failedConnectionPairs:t})=>{let n=new Set(e.pins.map((o)=>o.chipId));return t.some((o)=>{if(o.mspPairId===e.mspPairId)return!1;return o.pins.every((r)=>n.has(r.chipId))})},tli=({firstStart:e,firstEnd:t,secondStart:n,secondEnd:o})=>{if(tA(e,t)&&tA(n,o))return Math.min(Math.max(e.x,t.x),Math.max(n.x,o.x))-Math.max(Math.min(e.x,t.x),Math.min(n.x,o.x))>kue;if(lf(e,t)&&lf(n,o))return Math.min(Math.max(e.y,t.y),Math.max(n.y,o.y))-Math.max(Math.min(e.y,t.y),Math.min(n.y,o.y))>kue;return!1},nli=({connectionPair:e,existingTrace:t})=>{let n=new Set(t.pinIds);return e.pins.filter((o)=>n.has(o.pinId))},oli=({path:e,connectionPair:t,existingTraces:n})=>{for(let o of n){if(o.globalConnNetId===t.globalConnNetId)continue;let r=nli({connectionPair:t,existingTrace:o});for(let i=0;i<e.length-1;i++){let s=e[i],a=e[i+1];for(let c=0;c<o.tracePath.length-1;c++){let l=o.tracePath[c],h=o.tracePath[c+1];if(!K3(s,a,l,h))continue;if(r.some((u)=>(nG(s,u)||nG(a,u))&&(nG(l,u)||nG(h,u)))&&!tli({firstStart:s,firstEnd:a,secondStart:l,secondEnd:h}))continue;return!0}}}return!1},rli=class extends Gu{constructor(e){super();this.params=e,this.inputProblem=e.inputProblem,this.alreadySolvedTraces=e.alreadySolvedTraces,this.failedConnectionPairs=e.failedConnectionPairs,this.queuedConnectionPairs=[...e.failedConnectionPairs],this.maxConnectionDistance=this.inputProblem.maxMspPairDistance??_0e;let{netConnMap:t}=S6(this.inputProblem);this.groundGlobalConnNetId=t.getNetConnectedToId(Wci)??void 0}params;inputProblem;alreadySolvedTraces;failedConnectionPairs;queuedConnectionPairs;maxConnectionDistance;groundGlobalConnNetId;solvedUnroutedTraces=[];getConstructorParams(){return this.params}_step(){let e=this.queuedConnectionPairs.shift();if(!e){this.solved=!0;return}if(e.globalConnNetId===this.groundGlobalConnNetId)return;if(Dv(e.pins[0],e.pins[1])>this.maxConnectionDistance)return;let t=Cx(this.inputProblem),n=[...this.alreadySolvedTraces,...this.solvedUnroutedTraces],o=n.filter((l)=>l.globalConnNetId===e.globalConnNetId);if(qci({connectionPair:e,sameNetTraces:o}))return;let r=Jci({connectionPair:e,sameNetTraces:o,obstacles:t,maxConnectionDistance:this.maxConnectionDistance}),i=fxn({connectionPair:e,obstacles:t,channelObstacles:[]}),s=[...r,...i].sort((l,h)=>nL(l)-nL(h)),a=eli({connectionPair:e,failedConnectionPairs:this.failedConnectionPairs}),c;for(let l of s){if(c&&nL(l)>=nL(c))continue;if(Zci({path:l,obstacles:t,connectionPair:e,rejectComponentBoundaryTravel:a}))continue;if(oli({path:l,connectionPair:e,existingTraces:n}))continue;if(!c)s.push(...fxn({connectionPair:e,obstacles:t}));c=l}if(c)this.solvedUnroutedTraces.push({...e,tracePath:c,mspConnectionPairIds:[e.mspPairId],pinIds:e.pins.map((l)=>l.pinId)})}getOutput(){return{newTraces:this.solvedUnroutedTraces,allTracesMerged:[...this.alreadySolvedTraces,...this.solvedUnroutedTraces]}}visualize(){let e=Bp(this.inputProblem);for(let t of this.solvedUnroutedTraces)e.lines.push({points:t.tracePath,strokeColor:"blue"});return e}},z9e=0.000001,yve=({path:e,netLabelPlacements:t})=>{for(let n of t){let o=Ui(n.center,n.width,n.height);for(let r=0;r<e.length-1;r++)if(Rv(e[r],e[r+1],o))return!0}return!1},ySn=({path:e,netLabelPlacements:t})=>{for(let n of t){let o=Ui(n.center,n.width,n.height),r={minX:o.minX+z9e,minY:o.minY+z9e,maxX:o.maxX-z9e,maxY:o.maxY-z9e};for(let i=0;i<e.length-1;i++)if(Rv(e[i],e[i+1],r))return!0}return!1},Lue=(e)=>{if(!e._facingDirection)return null;return Pp(e._facingDirection).x===0?"y":"x"},b8e=({coordinate:e,axis:t,pin:n})=>{if(!n._facingDirection)return!1;let o=Pp(n._facingDirection);return(e-n[t])*o[t]>0},ili=(e,t)=>{if(J3(e,t))return"x";if(M1(e,t))return"y";return null},yxn=(e)=>{let t=[];for(let n=0;n<e.length-1;n++){let o=e[n],r=e[n+1],i=ili(o,r);if(!i)continue;let s=i==="x"?"y":"x";t.push({start:o,end:r,axis:i,coordinate:o[s]})}return t},xxn=({pin:e,departureAxis:t,railCoordinate:n})=>t==="x"?{x:n,y:e.y}:{x:e.x,y:n},sli=({donorPath:e,branchDepartureSegment:t,sharedPin:n,adjacentPin:o})=>{let r=Lue(n);if(!r)return null;let i=r==="x"?"y":"x",s=yxn(t)[0];if(!s||s.axis!==r)return null;let a=null,c=Number.POSITIVE_INFINITY;for(let l of yxn(e)){if(l.axis!==i)continue;if(!b8e({coordinate:l.coordinate,axis:r,pin:n}))continue;let h=xxn({pin:n,departureAxis:r,railCoordinate:l.coordinate}),d=xxn({pin:o,departureAxis:r,railCoordinate:l.coordinate});if(!Vs([l.start,l.end],h)||!Vs([l.start,l.end],d)||!Vs([s.start,s.end],h))continue;let u=Math.abs(l.coordinate-n[r]);if(u>=c)continue;a={segment:l,sharedPinExit:h},c=u}return a},LG=({donorTrace:e,branchTrace:t})=>{let n=new Set(t.pins.map((o)=>o.pinId));return e.pins.find((o)=>n.has(o.pinId))??null},O9e=(e,t)=>{if(cs(e.x,t.x))return"y";if(cs(e.y,t.y))return"x";return null},Cxn=({trace:e,sharedPinId:t})=>{let n=Mi(e.tracePath),o=e.pins.find((i)=>i.pinId===t);if(!o)return null;let r=e.pins[0]?.pinId===t?n:n.reverse();return pT(r[0],o)?r:null},V9e=({trace:e,sharedPrefix:t,netLabelPlacements:n})=>!n.some((o)=>o.mspConnectionPairIds.includes(e.mspPairId)&&Vs(t,o.anchorPoint)),bxn=({trace:e,pathFromSharedPin:t,sharedPinId:n,branchPoint:o})=>{let r=t.findIndex((a,c)=>{let l=t[c+1];if(!l)return!1;return Vs([a,l],o)});if(r<0)return null;let i=Mi([o,...t.slice(r+1)]),s=i;if(e.pins[0]?.pinId!==n)s=i.reverse();return{...e,tracePath:s}},ali=({traces:e,netLabelPlacements:t,netLabelConnectorTraceIds:n,multiPinNetPinIds:o})=>{let r=[...e];for(let i=0;i<r.length;i++){if(n.has(r[i].mspPairId))continue;for(let s=i+1;s<r.length;s++){let a=r[i],c=r[s];if(n.has(c.mspPairId)||a.globalConnNetId!==c.globalConnNetId)continue;let l=LG({donorTrace:a,branchTrace:c});if(!l||!o.has(l.pinId))continue;let h=Cxn({trace:a,sharedPinId:l.pinId}),d=Cxn({trace:c,sharedPinId:l.pinId});if(!h||!d)continue;if(h.length<2||d.length<2)continue;let u=O9e(h[0],h[1]),_=O9e(d[0],d[1]);if(!u||u!==_)continue;let p=h[1][u]-h[0][u],m=d[1][u]-d[0][u];if(!pT(h[1],d[1])&&Math.sign(p)===Math.sign(m)){let T=s,N=c,D=d;if(Math.abs(p)<Math.abs(m))T=i,N=a,D=h;let L=D[1];if(!V9e({trace:N,sharedPrefix:[D[0],L],netLabelPlacements:t}))if(T===i)T=s,N=c,D=d;else T=i,N=a,D=h;if(!V9e({trace:N,sharedPrefix:[D[0],L],netLabelPlacements:t}))continue;let H=bxn({trace:N,pathFromSharedPin:D,sharedPinId:l.pinId,branchPoint:L});if(!H)continue;r[T]=H;continue}if(h.length<3||d.length<3)continue;if(!pT(h[1],d[1]))continue;let A=O9e(h[1],h[2]),g=O9e(d[1],d[2]);if(!A||A!==g||A===u)continue;let f=h[2][A]-h[1][A],y=d[2][A]-d[1][A],x=Math.sign(f)===Math.sign(y),C=h.slice(0,2);if(!x&&!cs(Math.abs(f),Math.abs(y))&&t.some((T)=>T.globalConnNetId===a.globalConnNetId&&Vs(C,T.anchorPoint)))continue;let b=s,I=c,v=d,P=h[1];if(x&&Math.abs(f)<Math.abs(y))b=i,I=a,v=h,P=h[2];else if(x)P=d[2];let M=[v[0],v[1],P];if(!V9e({trace:I,sharedPrefix:M,netLabelPlacements:t}))if(b===i)b=s,I=c,v=d;else b=i,I=a,v=h;if(!V9e({trace:I,sharedPrefix:[v[0],v[1],P],netLabelPlacements:t}))continue;let B=bxn({trace:I,pathFromSharedPin:v,sharedPinId:l.pinId,branchPoint:P});if(!B)continue;r[b]=B}}return r},ost=0.000001,Ixn=(e,t)=>{let n=e.tracePath[0],o=e.tracePath.at(-1);if(!n||!o)return null;if(pT(n,t))return e.tracePath;if(pT(o,t))return[...e.tracePath].reverse();return null},cli=(e,t)=>{let n=[],o=e[0];for(let r=0;r<e.length-1;r++){let i=e[r],s=e[r+1],a=hL(i,s);if(!a)continue;for(let c=0;c<t.length-1;c++){let l=t[c],h=t[c+1],d=hL(l,h);if(!d||d===a)continue;let u=XP(i,s,l,h);if(!u||pT(u,o))continue;n.push({intersectionPoint:u,targetSegmentIndex:r,donorSegmentIndex:c})}}return n},lli=(e,t,n)=>{let o=XP(e[t],e[t+1],e[n],e[n+1]);if(!o)return e;return Mi([...e.slice(0,t+1),o,...e.slice(n+1)])},hli=({targetTrace:e,targetPath:t,donorPath:n,crossing:o})=>{let r=Mi([...n.slice(0,o.donorSegmentIndex+1),o.intersectionPoint,...t.slice(o.targetSegmentIndex+1)]);if(pT(e.tracePath[0],t[0]))return r;return r.reverse()},dli=({targetTrace:e,tracePath:t,netLabelPlacements:n})=>{let o=eee({trace:e,originalTracePath:e.tracePath,reroutedTracePath:t,netLabelPlacements:n});for(let s=0;s<n.length;s++){let a=n[s];if(a.globalConnNetId!==e.globalConnNetId)continue;if(!Vs(e.tracePath,a.anchorPoint))continue;let c=o[s];if(!Vs(t,c.anchorPoint))return null}let r=o.filter((s)=>s.globalConnNetId!==e.globalConnNetId);if(yve({path:t,netLabelPlacements:r}))return null;let i=o.filter((s)=>s.globalConnNetId===e.globalConnNetId);if(ySn({path:t,netLabelPlacements:i}))return null;return o},uli=(e,t)=>{if(!t)return!0;let n=e.netVisibleLength-t.netVisibleLength;if(Math.abs(n)>ost)return n<0;return e.netVisibleSegmentCount<t.netVisibleSegmentCount},pli=({targetTrace:e,traces:t,netLabelPlacements:n})=>{let o=t.filter((l)=>l.globalConnNetId===e.globalConnNetId),r=EP(o),i=EP([e]),s=null,a=(l)=>{let h={...e,tracePath:l};if(EP([h])>i+ost)return;let u=dli({targetTrace:e,tracePath:l,netLabelPlacements:n});if(!u)return;let _=o.map((A)=>{if(A.mspPairId===e.mspPairId)return h;return A}),p=EP(_);if(p>=r-ost)return;let m={tracePath:l,netLabelPlacements:u,netVisibleLength:p,netVisibleSegmentCount:A8e(_)};if(uli(m,s))s=m},c=xG(e.tracePath,e.tracePath,{includeTerminalSegments:!0}).filter(({pathSegmentIndex:l,otherPathSegmentIndex:h})=>l<h);for(let l of c)a(lli(e.tracePath,l.pathSegmentIndex,l.otherPathSegmentIndex));for(let l of o){if(l.mspPairId===e.mspPairId)continue;let h=LG({donorTrace:l,branchTrace:e});if(!h)continue;let d=Ixn(e,h),u=Ixn(l,h);if(!d||!u)continue;let _=cli(d,u);for(let p of _){let m=hli({targetTrace:e,targetPath:d,donorPath:u,crossing:p});a(m)}}return s},mli=({traces:e,netLabelPlacements:t})=>{let n=[...e],o=[...t],r=0,i=0;while(i<n.length){let s=n[i],a=pli({targetTrace:s,traces:n,netLabelPlacements:o});if(!a){i++;continue}n[i]={...s,tracePath:a.tracePath},o=a.netLabelPlacements,r++,i=0}return{traces:n,netLabelPlacements:o,collapsedCycleCount:r}},rst=0.2,_li=0.2,gli=0.05,xSn=0.8,Ali=0.05,fli=(e)=>{let{netConnMap:t}=S6(e),n=new Set(e.chips.flatMap((o)=>o.pins.map((r)=>r.pinId)));return new Set([...n].filter((o)=>{let r=t.getNetConnectedToId(o);if(!r)return!1;return t.getIdsConnectedToNet(r).filter((i)=>n.has(i)).length>2}))},sf=(e,t)=>{if(J3(e,t))return"x";if(M1(e,t))return"y";return null},GP=({trace:e,sharedPin:t})=>e.pins.find((n)=>n.pinId!==t.pinId)??null,Hue=(e)=>{let t=null;for(let n=0;n<e.tracePath.length-1;n++){let o=e.tracePath[n],r=e.tracePath[n+1];if(!J3(o,r))continue;if(!t||Math.abs(r.x-o.x)>Math.abs(t.end.x-t.start.x))t={start:o,end:r}}return t},yli=({segment:e,sharedPin:t})=>{let n=Math.abs(e.start.x-t.x),o=Math.abs(e.end.x-t.x);if(n<=o)return e.start;return e.end},eue=({railY:e,pin:t})=>{if(t._facingDirection==="y+")return e>t.y;if(t._facingDirection==="y-")return e<t.y;return!1},xli=({railY:e,pin:t})=>{if(t._facingDirection==="y+")return e>t.y;if(t._facingDirection==="y-")return e<t.y;return!1},Cli=({branchTrace:e,sharedPin:t,otherPin:n})=>{if(n._facingDirection!=="x-"&&n._facingDirection!=="x+")return null;let r=(e.pins[0].pinId===t.pinId?e.tracePath:[...e.tracePath].reverse()).at(-2);if(!r||!cs(r.y,n.y))return null;return(n._facingDirection==="x-"?r.x<n.x:r.x>n.x)?r:null},vxn=(e,t)=>t.flatMap((n,o)=>{if(lSn(n,e)&&Vs(e.tracePath,n.anchorPoint))return[o];return[]}),bli=({trace:e,reroutedTracePath:t,netLabelPlacements:n,attachedLabelIndexes:o})=>{let r=o.map((a)=>n[a]),i=eee({trace:e,originalTracePath:e.tracePath,reroutedTracePath:t,netLabelPlacements:r}),s=new Map(o.map((a,c)=>[a,i[c]]));return n.map((a,c)=>s.get(c)??a)},Ili=({donorTrace:e,branchTrace:t})=>{let n=LG({donorTrace:e,branchTrace:t});if(!n)return null;let o=GP({trace:e,sharedPin:n});if(!o)return null;let r=GP({trace:t,sharedPin:n});if(!r)return null;if(Math.abs(n.y-r.y)>rst)return null;let i=Hue(e);if(!i)return null;let s=Hue(t);if(s&&cs(s.start.y,i.start.y))return null;if(o.chipId!==n.chipId&&r.chipId===n.chipId&&r._facingDirection===n._facingDirection&&s&&Math.abs(s.start.y-n.y)<Math.abs(i.start.y-n.y))return null;let a=eue({railY:i.start.y,pin:r}),c=xli({railY:i.start.y,pin:n})&&Math.abs(i.start.y-n.y)<=gli;if(!a&&!c)return null;let l=yli({segment:i,sharedPin:n});if(!(o.x<l.x&&r.x>l.x||o.x>l.x&&r.x<l.x))return null;let d;if(!a&&c){let u=Cli({branchTrace:t,sharedPin:n,otherPin:r});if(!u)return null;d=Mi([{x:n.x,y:n.y},{x:l.x,y:n.y},{x:l.x,y:l.y},{x:u.x,y:l.y},{x:u.x,y:r.y},{x:r.x,y:r.y}])}else d=Mi([{x:n.x,y:n.y},{x:l.x,y:n.y},{x:l.x,y:l.y},{x:r.x,y:l.y},{x:r.x,y:r.y}]);if(t.pins[0].pinId===n.pinId)return d;return[...d].reverse()},vli=({donorTrace:e,branchTrace:t})=>{let n=LG({donorTrace:e,branchTrace:t});if(!n)return null;let o=GP({trace:e,sharedPin:n}),r=GP({trace:t,sharedPin:n});if(!o||!r)return null;let i=n._facingDirection,s=Lue(n);if(!i||!s)return null;let a=s==="x"?"y":"x";if(o.chipId!==n.chipId||o._facingDirection!==i||!cs(o[s],n[s])||Lue(r)!==a)return null;let c=Math.abs(o[a]-n[a]);if(c>rst&&!cs(c,rst))return null;let l=t.pins[0].pinId===n.pinId,h=Mi(t.tracePath);if(!l)h.reverse();if(h.length<2)return null;let d=[h[0],h[1]],u=sli({donorPath:e.tracePath,branchDepartureSegment:d,sharedPin:n,adjacentPin:o});if(!u)return null;let _=o[a];if(!b8e({coordinate:_,axis:a,pin:r}))return null;let p={...u.sharedPinExit,[a]:_},m={x:r.x,y:r.y,[a]:_},A=Mi([{x:n.x,y:n.y},u.sharedPinExit,p,m,{x:r.x,y:r.y}]);return l?A:A.reverse()},Vot=({donorTrace:e,branchTrace:t,netLabelConnectorTraceIds:n,compactPinBankOnly:o=!1,outwardPinBankOnly:r=!1,traces:i})=>{if(n.has(e.mspPairId)||n.has(t.mspPairId))return null;let s=LG({donorTrace:e,branchTrace:t});if(!s)return null;let a=(O)=>{let U=Mi(O.tracePath);return O.pins[0].pinId===s.pinId?U:[...U].reverse()},c=a(e),l=a(t);if(c.length<3||l.length<4)return null;let h=sf(c[0],c[1]),d=sf(l[0],l[1]);if(!h||!d)return null;if(h!==d){if(!cs(c[0].x,l[0].x)||!cs(c[0].y,l[0].y))return null;let O=sf(l[1],l[2]),U=sf(c[1],c[2]);if(O!==h||U!==d||Lue(s)!==d||!b8e({coordinate:l[1][d],axis:d,pin:s}))return null;let j=c[1][h]-c[0][h],Y=l[2][O]-l[1][O];if(Math.sign(j)===Math.sign(Y))return null;let X=O==="x"?"y":"x",K=Mi([l[0],{...l[2],[X]:c[0][X]},...l.slice(3)]);return t.pins[0].pinId===s.pinId?K:K.reverse()}let u=c[1][h]-c[0][h],_=l[1][d]-l[0][d];if(Math.sign(u)!==Math.sign(_))return null;let p=1,m=sf(c[1],c[2]),A=sf(l[1],l[2]);if(!m||m!==A||m===h)return null;let g=m==="x"&&cs(c[1].y,l[1].y)||m==="y"&&cs(c[1].x,l[1].x),f=GP({trace:e,sharedPin:s}),y=GP({trace:t,sharedPin:s}),x=y!==null&&!i.some((O)=>O.mspPairId!==t.mspPairId&&!n.has(O.mspPairId)&&O.pinIds.includes(y.pinId)),C=Math.abs(u)>Math.abs(_),b=f!==null&&Vs([l[1],l[2]],{x:f.x,y:f.y,[h]:l[1][h]});if(x&&C&&b)return null;if(g){if(p++,!c[p+2]||!l[p+2])return null;if(m=sf(c[p],c[p+1]),A=sf(l[p],l[p+1]),!m||m!==A)return null}let I=0;for(let O=1;O<l.length-2;O++)if(sf(l[O],l[O+1])===A)I++;if(I!==1)return null;let v=m==="x"?"y":"x",P=c[p][v],M=l[p][v],B=Math.abs(P-M),T=[...e.pins,...t.pins],N=p===1&&Lue(s)===v&&T.every((O)=>O.chipId===s.chipId&&O._facingDirection===s._facingDirection&&cs(O[v],s[v]))&&b8e({coordinate:P,axis:v,pin:s});if(o&&(!N||Math.abs(P-s[v])>=Math.abs(M-s[v])))return null;if(r&&(!N||Math.abs(P-s[v])<=Math.abs(M-s[v])))return null;if(cs(P,M)||B>xSn&&!N)return null;let D=[c[p][m],c[p+1][m]].sort((O,U)=>O-U),L=[l[p][A],l[p+1][A]].sort((O,U)=>O-U);if(!(Math.min(D[1],L[1])>=Math.max(D[0],L[0])-0.000001))return null;let V=Mi(l.map((O,U)=>U===p||U===p+1?{...O,[v]:P}:O));return t.pins[0].pinId===s.pinId?V:V.reverse()};var Sli=({donorTrace:e,connectorTrace:t,netLabelConnectorTraceIds:n})=>{if(n.has(e.mspPairId)||!n.has(t.mspPairId))return null;let o=(a)=>{if(a.length<3)return null;let c=a[0],l=a[1],h=a[2],d=sf(c,l),u=sf(l,h);if(!d||!u||d===u)return null;let _=e.tracePath.findIndex((C,b,I)=>{let v=I[b+1];return v&&sf(C,v)===d&&Vs([C,v],c)&&Vs([C,v],l)});if(_<0)return null;let p=e.tracePath[_],m=e.tracePath[_+1];if(cs(c.x,p.x)&&cs(c.y,p.y)||cs(c.x,m.x)&&cs(c.y,m.y))return null;let A=[_>0?[e.tracePath[_-1],p]:null,_+2<e.tracePath.length?[m,e.tracePath[_+2]]:null].flatMap((C)=>C&&sf(C[0],C[1])===u?[C]:[]);if(A.length===0)return null;let g=u==="x"?"y":"x",f=l[g],y=[l[u],h[u]].sort((C,b)=>C-b),x=A.map((C)=>({segment:C,coordinate:C[0][g],offset:Math.abs(C[0][g]-f)})).filter(({segment:C,offset:b})=>{if(b>xSn)return!1;let I=[C[0][u],C[1][u]].sort((M,B)=>M-B),v=Math.max(I[0],y[0]),P=Math.min(I[1],y[1]);return P>=v-0.000001&&Math.abs(P-v)<=0.000001}).sort((C,b)=>C.offset-b.offset)[0];if(!x||cs(x.offset,0))return null;return Mi(a.map((C,b)=>b===1||b===2?{...C,[g]:x.coordinate}:C))},r=Mi(t.tracePath),i=o(r);if(i)return i;let s=o([...r].reverse());return s?s.reverse():null},Yot=(e,t)=>{if(e.some((n)=>Vs(t,n))||t.some((n)=>Vs(e,n)))return!0;for(let n=1;n<e.length;n++)for(let o=1;o<t.length;o++)if(XP(e[n-1],e[n],t[o-1],t[o]))return!0;return!1},Pli=({originalTrace:e,candidateTrace:t,traces:n,preserveRemovedStems:o=!1})=>{let r=n.map((i)=>i.mspPairId===e.mspPairId?t:i);for(let i of n){if(i.mspPairId===e.mspPairId||i.globalConnNetId!==e.globalConnNetId||!Yot(e.tracePath,i.tracePath)||Yot(t.tracePath,i.tracePath))continue;let s=[0,i.tracePath.length-1].find((p)=>Vs(e.tracePath,i.tracePath[p]));if(s===void 0)return null;let a=i.tracePath[s];if(i.pins.some((p)=>cs(p.x,a.x)&&cs(p.y,a.y)))return null;let c=Tct(a,e.tracePath,t.tracePath);if(!c)return null;let l=s===0?1:s-1,h=i.tracePath[l];if(!h)return null;let d=sf(a,h)===sf(c,h),u=o&&sf(a,c)!==null&&e.tracePath.some((p,m)=>{let A=e.tracePath[m+1];return A&&Vs([p,A],a)&&Vs([p,A],c)});if(!d&&!u)return null;let _={...i,tracePath:u?Mi(s===0?[c,...i.tracePath]:[...i.tracePath,c]):i.tracePath.map((p,m)=>m===s?c:p)};if(!Yot(t.tracePath,_.tracePath))return null;r=r.map((p)=>p.mspPairId===i.mspPairId?_:p)}return r},Sxn=({trace:e,endpointPin:t})=>{let n=GP({trace:e,sharedPin:t});if(!n)return null;let o=e.pins[0].pinId===t.pinId,r=Mi(e.tracePath);if(!o)r.reverse();if(r.length!==3)return null;let[i,s,a]=r,c=t._facingDirection;if(c==="y+"||c==="y-"){if(n._facingDirection!=="x+"&&n._facingDirection!=="x-")return null;if(!M1(i,s)||!J3(s,a)||!eue({railY:s.y,pin:t}))return null;return(n._facingDirection==="x-"?s.x<n.x:s.x>n.x)?{railCoordinate:s.y}:null}if(c!=="x+"&&c!=="x-")return null;if(n._facingDirection!=="y+"&&n._facingDirection!=="y-")return null;if(!J3(i,s)||!M1(s,a))return null;let l=c==="x+"?s.x>t.x:s.x<t.x,h=n._facingDirection==="y+"?s.y>n.y:s.y<n.y;return l&&h?{railCoordinate:s.x}:null},Eli=({donorTrace:e,branchTrace:t,traces:n})=>{let o=LG({donorTrace:e,branchTrace:t});if(!o)return null;let r=GP({trace:t,sharedPin:o});if(!r)return null;let i=(f)=>n.filter((y)=>y.mspPairId!==t.mspPairId&&y.globalConnNetId===t.globalConnNetId&&y.pinIds.includes(f.pinId)),s=i(o),a=i(r);if(s.length!==1||s[0].mspPairId!==e.mspPairId||a.length!==1)return null;let c=Sxn({trace:e,endpointPin:o});if(!c)return null;let l=o._facingDirection,h=l==="y+"||l==="y-";if(!h&&!(l==="x+"||l==="x-"))return null;if(h!==(r._facingDirection==="y+"||r._facingDirection==="y-"))return null;let u=t.pins[0].pinId===o.pinId,_=Mi(t.tracePath);if(!u)_.reverse();if(_.length!==6)return null;let p=h?["V","H","V","H","V"]:["H","V","H","V","H"];if(_.slice(1).map((f,y)=>J3(_[y],f)?"H":M1(_[y],f)?"V":"D").some((f,y)=>f!==p[y]))return null;let A=Sxn({trace:a[0],endpointPin:r});if(!A)return null;let g=h?Mi([{x:o.x,y:o.y},{x:o.x,y:c.railCoordinate},{x:_[2].x,y:c.railCoordinate},{x:_[3].x,y:A.railCoordinate},{x:r.x,y:A.railCoordinate},{x:r.x,y:r.y}]):Mi([{x:o.x,y:o.y},{x:c.railCoordinate,y:o.y},{x:c.railCoordinate,y:_[2].y},{x:A.railCoordinate,y:_[3].y},{x:A.railCoordinate,y:r.y},{x:r.x,y:r.y}]);return u?g:g.reverse()},Got=({trace:e,obstacles:t})=>uT(e.tracePath,t,{excludeRectsForSegment:(n)=>new Set(t.filter((o)=>o.kind==="chip"&&e.pins.some((r)=>o.chipId===r.chipId&&[e.tracePath[n],e.tracePath[n+1]].some((i)=>cs(i.x,r.x)&&cs(i.y,r.y)))&&_8e(e.tracePath[n],e.tracePath[n+1],o)))})!==null,Pxn=({path:e,rect:t})=>e.slice(1).reduce((n,o,r)=>{let i=e[r];if(cs(i.x,o.x)){if(i.x<t.minX||i.x>t.maxX)return n;return n+Math.max(0,Math.min(Math.max(i.y,o.y),t.maxY)-Math.max(Math.min(i.y,o.y),t.minY))}if(cs(i.y,o.y)){if(i.y<t.minY||i.y>t.maxY)return n;return n+Math.max(0,Math.min(Math.max(i.x,o.x),t.maxX)-Math.max(Math.min(i.x,o.x),t.minX))}return n},0),Exn=({candidateTrace:e,originalTrace:t,traces:n,inputProblem:o,originalNetLabelPlacements:r,candidateNetLabelPlacements:i,attachedLabelIndexes:s,preserveExistingObstacleContact:a=!1})=>{let c=Cx(o);if(!a&&Got({trace:e,obstacles:c}))return!1;for(let m of a?c:[]){if(!Got({trace:e,obstacles:[m]}))continue;if(!Got({trace:t,obstacles:[m]})||Pxn({path:e.tracePath,rect:m})>Pxn({path:t.tracePath,rect:m})+0.000001)return!1}let l=n.filter((m)=>m.globalConnNetId!==e.globalConnNetId);if(fL(e.tracePath,l))return!1;for(let m of l){let A=(g)=>{let f=new Set;for(let y=1;y<g.length;y++)for(let x=1;x<m.tracePath.length;x++){let C=XP(g[y-1],g[y],m.tracePath[x-1],m.tracePath[x]);if(C)f.add(`${C.x.toFixed(6)},${C.y.toFixed(6)}`)}return f.size};if(A(e.tracePath)>A(t.tracePath))return!1}if(!s.every((m)=>Vs(e.tracePath,i[m].anchorPoint)))return!1;let h=(m,A)=>yve({path:A.tracePath,netLabelPlacements:[m]});for(let m of s){let A=r[m],g=i[m],f=Ui(A.center,A.width,A.height),y=Ui(g.center,g.width,g.height);for(let x of n){if(x.globalConnNetId===g.globalConnNetId)continue;if(h(g,x)&&!h(A,x))return!1}for(let x of c)if(Ev(y,x)&&!Ev(f,x))return!1;for(let x=0;x<i.length;x++){if(x===m)continue;let C=r[x],b=i[x],I=Ui(C.center,C.width,C.height),v=Ui(b.center,b.width,b.height);if(Ev(y,v)&&!Ev(f,I))return!1}}let d=i.filter((m)=>m.globalConnNetId!==e.globalConnNetId);if(yve({path:e.tracePath,netLabelPlacements:d}))return!1;let u=i.filter((m)=>m.globalConnNetId===e.globalConnNetId);if(!yve({path:e.tracePath,netLabelPlacements:u}))return!0;if(ySn({path:e.tracePath,netLabelPlacements:u}))return!1;let _=Hue(t),p=Hue(e);if(!_||!p)return!1;return Math.abs(_.start.y-p.start.y)<=_li},Mli=({donorTrace:e,branchTrace:t,returnStemScale:n=1})=>{let o=LG({donorTrace:e,branchTrace:t});if(!o)return null;let r=GP({trace:e,sharedPin:o}),i=GP({trace:t,sharedPin:o});if(!r||!i)return null;let s=o._facingDirection;if(s!=="y+"&&s!=="y-")return null;if(r._facingDirection!==s||i._facingDirection!==s)return null;if(!cs(o.y,r.y))return null;let a=Mi(e.tracePath);if(a.length!==4)return null;let c=Hue(e);if(!c||!eue({railY:c.start.y,pin:o}))return null;if(!M1(a[0],a[1])||!M1(a[2],a[3]))return null;let l=t.pins[0].pinId===o.pinId,h=Mi(l?t.tracePath:[...t.tracePath].reverse());if(h.length!==6)return null;if(!M1(h[0],h[1])||!J3(h[1],h[2])||!M1(h[2],h[3])||!J3(h[3],h[4])||!M1(h[4],h[5]))return null;if(!eue({railY:h[1].y,pin:o})||!eue({railY:h[4].y,pin:i}))return null;if((s==="y+"?1:-1)*(i.y-c.start.y)<=0)return null;let u=Math.min(o.x,r.x),_=Math.max(o.x,r.x);if(h[2].x<u||h[2].x>_)return null;if(cs(h[2].x,r.x)&&cs(h[1].y,c.start.y))return null;let p=i.y+(h[4].y-i.y)*n;if(Math.abs(p-i.y)<Ali-0.000001)return null;let m=Mi([{x:o.x,y:o.y},{x:o.x,y:c.start.y},{x:r.x,y:c.start.y},{x:r.x,y:p},{x:i.x,y:p},{x:i.x,y:i.y}]);return l?m:m.reverse()},wli=({inputProblem:e,traces:t,netLabelPlacements:n,netLabelConnectorTraceIds:o})=>{let r=[...t],i=[...n],s=0,a=new Set;for(let l of["compact-pin-banks","loads","returns","established-pin-bank-rails"]){let h=l==="compact-pin-banks",d=l==="returns",u=l==="established-pin-bank-rails",_=t.map((m)=>m.mspPairId),p=new Set(_);for(let m=0;m<_.length;m++){let A=_[m];p.delete(A);let g=r.find((f)=>f.mspPairId===A);for(let f of r){if(!u&&a.has(f.mspPairId))continue;if(g.mspPairId===f.mspPairId)continue;if(g.globalConnNetId!==f.globalConnNetId)continue;let y=o.has(g.mspPairId),x=o.has(f.mspPairId),C=Mi(g.tracePath),b=C[1]&&C[2]?sf(C[1],C[2]):null,I=b==="x"?"y":"x",v=Boolean(u&&b&&r.some((M)=>{if(M.mspPairId===g.mspPairId||M.mspPairId===f.mspPairId||M.globalConnNetId!==g.globalConnNetId||!M.pins.every((T)=>g.pins.every((N)=>T.chipId===N.chipId&&T._facingDirection===N._facingDirection)))return!1;let B=Mi(M.tracePath);return B.some((T,N)=>N<B.length-1&&sf(T,B[N+1])===b&&cs(T[I],C[1][I]))})),P=u?y||x||!v?[]:[Vot({donorTrace:g,branchTrace:f,netLabelConnectorTraceIds:o,outwardPinBankOnly:!0,traces:r})]:h?y||x?[]:[Vot({donorTrace:g,branchTrace:f,netLabelConnectorTraceIds:o,compactPinBankOnly:!0,traces:r})]:x?d&&!y?[Sli({donorTrace:g,connectorTrace:f,netLabelConnectorTraceIds:o})]:[]:y?[]:d?[...[1,0.5,0.25].map((M)=>Mli({donorTrace:g,branchTrace:f,returnStemScale:M})),Eli({donorTrace:g,branchTrace:f,traces:r}),Vot({donorTrace:g,branchTrace:f,netLabelConnectorTraceIds:o,traces:r})]:[Ili({donorTrace:g,branchTrace:f}),vli({donorTrace:g,branchTrace:f})];for(let M of P){if(!M)continue;let B={...f,tracePath:M},T=[g,f],N=[g,B],D=A8e(N)<A8e(T),L=EP(N)<EP(T)&&!cs(EP(N),EP(T));if(!u&&!D&&!L)continue;let H=vxn(f,i),V=bli({trace:f,reroutedTracePath:M,netLabelPlacements:i,attachedLabelIndexes:H});if(u)V=V.map((j,Y)=>{if(!H.includes(Y))return j;let X=f.tracePath.findIndex((J,ee)=>ee>0&&ee<f.tracePath.length-1&&cs(J.x,j.anchorPoint.x)&&cs(J.y,j.anchorPoint.y)),K=M[X];if(X<0||!K||!cs(j.anchorPoint.x,i[Y].anchorPoint.x)||!cs(j.anchorPoint.y,i[Y].anchorPoint.y))return j;return{...j,anchorPoint:K,center:{x:j.center.x+K.x-j.anchorPoint.x,y:j.center.y+K.y-j.anchorPoint.y}}});let O=Pli({originalTrace:f,candidateTrace:B,traces:r,preserveRemovedStems:h});if(!O)continue;if(!Exn({candidateTrace:B,originalTrace:f,traces:O,inputProblem:e,originalNetLabelPlacements:i,candidateNetLabelPlacements:V,attachedLabelIndexes:H,preserveExistingObstacleContact:u}))continue;if(!O.every((j)=>{if(j.mspPairId===f.mspPairId)return!0;let Y=r.find((X)=>X.mspPairId===j.mspPairId);if(Y.tracePath===j.tracePath)return!0;return Exn({candidateTrace:j,originalTrace:Y,traces:O,inputProblem:e,originalNetLabelPlacements:i,candidateNetLabelPlacements:V,attachedLabelIndexes:vxn(Y,i)})}))continue;if(r=O,i=V,a.add(f.mspPairId),s++,!p.has(f.mspPairId))_.push(f.mspPairId),p.add(f.mspPairId);break}}}}let c=mli({traces:r,netLabelPlacements:i});return r=ali({traces:c.traces,netLabelPlacements:c.netLabelPlacements,netLabelConnectorTraceIds:o,multiPinNetPinIds:fli(e)}),i=c.netLabelPlacements,{traces:r,netLabelPlacements:i,alignedJunctionCount:s,collapsedCycleCount:c.collapsedCycleCount}},Bli=0.5,Tli=1,Dli=({traces:e,netLabelPlacements:t})=>e.map((n)=>{let o=n.tracePath,r=o[0],i=o.at(-1);if(!r||!i||!cs(r.x,i.x))return n;let s=o.findIndex((d,u)=>u>0&&u<o.length-2&&J3(o[u-1],d)&&M1(d,o[u+1])&&J3(o[u+1],o[u+2]));if(s<0)return n;let a=o[s],c=o[s+1],l=Math.abs(a.x-r.x),h=t.find(({anchorPoint:d,orientation:u,mspConnectionPairIds:_})=>_.includes(n.mspPairId)&&(u==="y-"&&d.y<Math.min(r.y,i.y)||u==="y+"&&d.y>Math.max(r.y,i.y))&&d.x>=Math.min(r.x,a.x)&&d.x<=Math.max(r.x,a.x)&&Math.abs(d.x-r.x)<l&&Math.abs(d.x-a.x)<=Bli&&l>=Tli);if(!h)return n;return{...n,tracePath:o.map((d,u)=>u===s||u===s+1?{...d,x:h.anchorPoint.x}:d)}}),Nli=class extends Gu{input;outputTraces;outputNetLabelPlacements;constructor(e){super();this.input=e,this.outputTraces=e.traces,this.outputNetLabelPlacements=e.netLabelPlacements}_step(){let e=wli(this.input);this.outputTraces=Dli({traces:e.traces,netLabelPlacements:e.netLabelPlacements}),this.outputNetLabelPlacements=eSn({inputProblem:this.input.inputProblem,traces:this.outputTraces,netLabelPlacements:e.netLabelPlacements}),this.stats.alignedJunctionCount=e.alignedJunctionCount,this.stats.collapsedCycleCount=e.collapsedCycleCount,this.solved=!0}getOutput(){return{traces:this.outputTraces,netLabelPlacements:this.outputNetLabelPlacements}}visualize(){let e=Bp(this.input.inputProblem);e.lines??=[],e.rects??=[],e.points??=[];for(let t of this.outputTraces)e.lines.push({points:t.tracePath,strokeColor:"purple"});for(let t of this.outputNetLabelPlacements){let n={center:t.center,width:t.width,height:t.height,fill:Vc(t.globalConnNetId,0.35),strokeColor:Vc(t.globalConnNetId,0.9),label:`netId: ${t.netId}
globalConnNetId: ${t.globalConnNetId}`};e.rects.push(n),e.points.push({x:t.anchorPoint.x,y:t.anchorPoint.y,color:Vc(t.globalConnNetId,0.9),label:`anchorPoint
orientation: ${t.orientation}`})}return e}},CSn=(e)=>{let t=Mi(e);if(t.length!==6)return!1;let n=t.slice(0,-1).map((o,r)=>tA(o,t[r+1]));return n.every((o,r)=>r===0||o!==n[r-1])},Rli=({trace:e,label:t,paddingBuffer:n,detourCount:o})=>{if(e.globalConnNetId===t.globalConnNetId)return[];let r=Mi(e.tracePath);if(!CSn(r))return[];let i=Ui(t.center,t.width,t.height),s=n+o*n,a={minX:i.minX-s,maxX:i.maxX+s,minY:i.minY-s,maxY:i.maxY+s},c=[];for(let l=1;l<r.length-2;l++){let h=r[l],d=r[l+1];if(!D1(h,d,i))continue;let u=tA(h,d),_=lf(h,d);if(!u&&!_)continue;let p=u?"y":"x",m=u?[a.minY,a.maxY]:[a.minX,a.maxX];for(let A of m){let g=Ict(r,l,p,A);if(g)c.push(g)}}return c},Qli=({trace:e,label:t,paddingBuffer:n,detourCount:o})=>{let r=Mi(e.tracePath);if(!CSn(r))return[];let i=Ui(t.center,t.width,t.height),s=n+o*n,a={minX:i.minX-s,maxX:i.maxX+s,minY:i.minY-s,maxY:i.maxY+s},c=r[0],l=r[r.length-1],h=2,d=[];for(let u=0;u<r.length-1;u++){let _=r[u],p=r[u+1];if(!D1(_,p,i))continue;if(Math.abs(u-h)!==1)continue;let m=tA(_,p),A=lf(_,p);if(!m&&!A)continue;let g=m?"x":"y",f=m?a.minX:a.minY,y=m?a.maxX:a.maxY,x=m?c.x:c.y,C=m?l.x:l.y,b=[];if(x<f)b.push((x+f)/2);else if(x>y)b.push((x+y)/2);if(C<f)b.push((C+f)/2);else if(C>y)b.push((C+y)/2);for(let I of new Set(b)){let v=Ict(r,h,g,I);if(v)d.push(v)}}return d},kli=({trace:e,label:t,netLabelPlacements:n,paddingBuffer:o,detourCount:r})=>Qli({trace:e,label:t,paddingBuffer:o,detourCount:r}).flatMap((s)=>{let a={...e,tracePath:s};return Mp({traces:[a],netLabels:n}).flatMap(({label:l})=>Rli({trace:a,label:l,paddingBuffer:o,detourCount:r}))}),Y9e=0.000000001,Qk=(e)=>e.slice(1).reduce((t,n,o)=>{let r=e[o];return t+Math.abs(n.x-r.x)+Math.abs(n.y-r.y)},0),Uot=class extends Gu{input;outputTraces;traceIdQueue;obstacles;constructor(e){super();this.input=e,this.outputTraces=[...e.traces];let t=new Set(e.completedReroutes.map((n)=>n.initialTrace.mspPairId));this.traceIdQueue=e.traces.map((n)=>n.mspPairId).filter((n)=>t.has(n)),this.obstacles=Cx(e.inputProblem)}_step(){let e=this.traceIdQueue.shift();if(!e){this.solved=!0;return}let t=this.outputTraces.findIndex((p)=>p.mspPairId===e),n=this.outputTraces[t],o=Mi(n.tracePath),r=Mp({traces:[{...n,tracePath:o}],netLabels:this.input.netLabelPlacements}),i=this.outputTraces.filter((p)=>p.mspPairId!==n.mspPairId&&p.globalConnNetId!==n.globalConnNetId),s=Qk(o),a=Dct(n,this.outputTraces),c=new Map;for(let p of cSn(o)){if(this.input.allowShorterPaths?Qk(p)>s+Y9e:Math.abs(Qk(p)-s)>Y9e)continue;c.set(p.map((m)=>`${m.x},${m.y}`).join(";"),p)}let l=this.input.completedReroutes.filter((p)=>p.initialTrace.mspPairId===n.mspPairId);for(let p of l){let m=Mi(p.initialTrace.tracePath),A=Mi(p.reroutedTracePath),g=Mp({traces:[{...p.initialTrace,tracePath:m}],netLabels:this.input.netLabelPlacements}).length,f=kli({trace:p.initialTrace,label:p.label,netLabelPlacements:this.input.netLabelPlacements,paddingBuffer:this.input.paddingBuffer,detourCount:p.detourCount});for(let y of f){let x=Mi(y),C={...p.initialTrace,tracePath:x};if(Mp({traces:[C],netLabels:this.input.netLabelPlacements}).length<g&&Math.abs(Qk(x)-Qk(A))<Y9e&&x.length<A.length&&Que(this.input.netLabelPlacements,[p.initialTrace],[C]))c.set(x.map((v)=>`${v.x},${v.y}`).join(";"),x)}}let h=new Set(r.map(({label:p})=>`${p.globalConnNetId}:${p.netId}`)),d=[...c.values()].filter((p)=>{let m={...n,tracePath:p},A=Mp({traces:[m],netLabels:this.input.netLabelPlacements}),g=A.every(({label:x})=>h.has(`${x.globalConnNetId}:${x.netId}`)),f=A.length<r.length,y=A.length===r.length&&Qk(p)<=s+Y9e&&p.length<o.length;return g&&(f||y)&&Que(this.input.netLabelPlacements,[n],[m])&&a.every((x)=>Vs(p,x))&&!ZZ(p,this.obstacles)&&!fL(p,i)&&i.every((x)=>YP(p,x.tracePath)<=YP(o,x.tracePath))}),u=(p)=>Mp({traces:[{...n,tracePath:p}],netLabels:this.input.netLabelPlacements}).length;d.sort((p,m)=>{let A=u(p)-u(m);if(A!==0)return A;return Qk(p)-Qk(m)||p.length-m.length});let _=d[0];if(!_)return;if(this.outputTraces[t]={...n,tracePath:_},this.stats.simplifiedTraceCount=(this.stats.simplifiedTraceCount??0)+1,this.input.allowShorterPaths)this.traceIdQueue.push(e)}getOutput(){return{traces:this.outputTraces,netLabelPlacements:this.input.netLabelPlacements}}visualize(){let e=Bp(this.input.inputProblem);e.lines??=[];for(let t of this.outputTraces)e.lines.push({points:t.tracePath,strokeColor:"purple"});return e}},bSn=(e)=>{if(!e.stubTracePath)return null;let t=0.000001;return{minX:Math.min(...e.stubTracePath.map((n)=>n.x))-t,maxX:Math.max(...e.stubTracePath.map((n)=>n.x))+t,minY:Math.min(...e.stubTracePath.map((n)=>n.y))-t,maxY:Math.max(...e.stubTracePath.map((n)=>n.y))+t}},ist=(e,t)=>{let n=t.map((r)=>({globalConnNetId:r.globalConnNetId,netId:r.netId,pinIds:r.pinIds,mspConnectionPairIds:[],anchorPoint:r.anchorPoint,orientation:"y+",center:r.center,width:r.axis==="x"?r.width:r.height,height:r.axis==="x"?r.height:r.width})),o=t.flatMap((r)=>{if(!r.stubTracePath)return[];let i=e.chips.find((c)=>c.pins.some((l)=>r.pinIds.includes(l.pinId))),s=i?.pins.find((c)=>r.pinIds.includes(c.pinId));if(!i||!s)return[];let a=JSON.stringify(["inline-terminal",r.globalConnNetId,[...r.pinIds].sort()]);return[{mspPairId:a,mspConnectionPairIds:[a],globalConnNetId:r.globalConnNetId,dcConnNetId:r.globalConnNetId,pinIds:r.pinIds,pins:[{...s,chipId:i.chipId},{...s,...r.stubTracePath[1],chipId:i.chipId}],tracePath:r.stubTracePath}]});return{fixedLabels:n,terminalTraces:o}},v1=0.000001,Y3=0.05,LY=(e,t)=>e.slice(1).some((n,o)=>D1(e[o],n,t)),Mxn=(e,t)=>Math.hypot(e.x-t.x,e.y-t.y)<v1,HY=(e,t,n)=>({...e,[t]:e[t]+n}),Wot=(e,t)=>e.slice(1).flatMap((n,o)=>t.slice(1).flatMap((r,i)=>{let s=XP(e[o],n,t[i],r);return s?[s]:[]}));function*wxn(e,t,n=[]){let o=[...t.inlineNetLabelPlacements,...n],{fixedLabels:r,terminalTraces:i}=ist(e,o),s=o.flatMap((d)=>{let u=bSn(d);return u?[{label:d,bounds:u}]:[]}),a=[...e.chips.map((d)=>({minX:d.center.x-d.width/2,maxX:d.center.x+d.width/2,minY:d.center.y-d.height/2,maxY:d.center.y+d.height/2})),...(e.textBoxes??[]).map((d)=>Nv(d))],c=r.map((d)=>({minX:d.center.x-d.width/2,maxX:d.center.x+d.width/2,minY:d.center.y-d.height/2,maxY:d.center.y+d.height/2})),l=t.netLabelPlacements.filter((d)=>n.some((u)=>u.globalConnNetId===d.globalConnNetId&&u.pinIds.length===d.pinIds.length&&u.pinIds.every((_)=>d.pinIds.includes(_)))).map(np),h=[...e.chips.flatMap((d)=>d.pins),...t.traces.flatMap((d)=>d.pins)];for(let d of t.traces){let u=Mi(d.tracePath);for(let _=0;_<u.length-1;_++){let p=u[_],m=u[_+1],A=Math.abs(p.x-m.x)<v1?"x":"y",g=A==="x"?"y":"x";if(Math.abs(p[A]-m[A])>v1||Mxn(p,m))continue;let f=[...t.netLabelPlacements.filter((D)=>D.globalConnNetId!==d.globalConnNetId).map(np),...c,...s.filter(({label:D})=>!d.pinIds.some((L)=>D.pinIds.includes(L))).map(({bounds:D})=>D)],y=t.netLabelPlacements.filter((D)=>D.globalConnNetId===d.globalConnNetId&&D.netId!=null&&e.availableNetLabelOrientations[D.netId]?.length===1&&e.availableNetLabelOrientations[D.netId]?.[0]===D.orientation&&(A==="x"?D.orientation==="y+"||D.orientation==="y-":D.orientation==="x+"||D.orientation==="x-")&&Vs([p,m],D.anchorPoint)).map(np),x=[...f.filter((D)=>D1(p,m,D)),...l.filter((D)=>y.some((L)=>Qc(L,D)))];if(!x.length)continue;let C=Math.min(p[g],m[g]),b=Math.max(p[g],m[g]),I=!0;while(I){I=!1;for(let D of t.traces){if(D.globalConnNetId!==d.globalConnNetId)continue;for(let L=1;L<D.tracePath.length;L++){let H=D.tracePath[L-1],V=D.tracePath[L];if(Math.abs(H[A]-p[A])>v1||Math.abs(V[A]-p[A])>v1)continue;let O=Math.min(H[g],V[g]),U=Math.max(H[g],V[g]);if(U<C-v1||O>b+v1)continue;if(O<C||U>b)I=!0;C=Math.min(C,O),b=Math.max(b,U)}}}let v=(D)=>Math.abs(D[A]-p[A])<v1&&D[g]>=C-v1&&D[g]<=b+v1;if(h.some(v))continue;let P=A==="x"?"minX":"minY",M=A==="x"?"maxX":"maxY",B=Math.max(...x.map((D)=>D[M]-D[P])),T=t.netLabelPlacements.filter((D)=>D.globalConnNetId===d.globalConnNetId&&v(D.anchorPoint)).map(np),N=[...new Set(x.flatMap((D)=>[D[P]-Y3,D[M]+Y3,...T.filter((L)=>Qc(L,D)).flatMap((L)=>[p[A]+D[P]-Y3-L[M],p[A]+D[M]+Y3-L[P]])]))].sort((D,L)=>Math.abs(D-p[A])-Math.abs(L-p[A]));for(let D of N){let L=D-p[A];if(Math.abs(L)>B+2*Y3)continue;let H=t.traces.map((Y)=>{if(Y.globalConnNetId!==d.globalConnNetId||!Y.tracePath.some(v))return Y;return{...Y,tracePath:Y.tracePath.map((X)=>v(X)?HY(X,A,L):X)}}),V=H.filter((Y,X)=>Y!==t.traces[X]).map((Y)=>Y.tracePath),O=t.netLabelPlacements.map((Y)=>{if(Y.globalConnNetId!==d.globalConnNetId||!v(Y.anchorPoint))return Y;return{...Y,anchorPoint:HY(Y.anchorPoint,A,L),center:HY(Y.center,A,L)}}),U=!1,j=O.flatMap((Y,X)=>Y!==t.netLabelPlacements[X]?[np(Y)]:[]);for(let[Y,X]of O.entries()){if(X.globalConnNetId===d.globalConnNetId)continue;let K=np(X),J=j.filter((le)=>Qc(le,K)).map((le)=>le[L>0?M:P]);if(V.some((le)=>LY(le,K))&&!t.traces.some((le)=>le.globalConnNetId===d.globalConnNetId&&LY(le.tracePath,K)))J.push(D);if(!J.length)continue;let ee=H.findIndex((le)=>le.globalConnNetId===X.globalConnNetId&&le.pinIds.length===1&&le.tracePath.length===3&&Mxn(le.tracePath.at(-1),X.anchorPoint)),se=H[ee];if(!se){let ue=new kct({inputProblem:e,traces:[...H,...i],netLabelPlacements:O,fixedNetLabelPlacements:r,useRenderedLabelBounds:!0}).getNearbyValidPlacements(X,B+Math.max(X.width,X.height))[0];if(!ue){U=!0;break}O[Y]=ue;continue}let[ne,re,Z]=se.tracePath;if(Math.abs(re[A]-Z[A])>v1||Math.abs(ne[g]-re[g])>v1){U=!0;break}let te=L>0?Math.max(...J)+Y3-K[P]:Math.min(...J)-Y3-K[M];if(Math.abs(te)>B+K[M]-K[P]+2*Y3){U=!0;break}let ie={...X,anchorPoint:HY(X.anchorPoint,A,te),center:HY(X.center,A,te)};O[Y]=ie,H[ee]={...se,tracePath:[ne,HY(re,A,te),ie.anchorPoint]}}if(U)continue;for(let[Y,X]of H.entries()){if(X.globalConnNetId===d.globalConnNetId||Mi(X.tracePath).length<=4||!V.some((J)=>fL(J,[X])))continue;let K=K7n({inputProblem:e,traces:[...H,...i],targetMspConnectionPairId:X.mspPairId,allLabelPlacements:[...O,...r],mergedLabelNetIdMap:{},paddingBuffer:Y3});if(Mi(K.tracePath).length<Mi(X.tracePath).length&&Que(O,[X],[K]))H[Y]=K}for(let[Y,X]of H.entries()){let K=t.traces[Y];if(X===K)continue;let J=X.tracePath,ee=K.tracePath;if(J.slice(1).some((re,Z)=>Math.abs(re.x-J[Z].x)>v1&&Math.abs(re.y-J[Z].y)>v1)){U=!0;break}let se=(re,Z,te,ie)=>(Z.x-re.x)*(ie.x-te.x)+(Z.y-re.y)*(ie.y-te.y);if(se(ee[0],ee[1],J[0],J[1])<=v1||se(ee.at(-1),ee.at(-2),J.at(-1),J.at(-2))<=v1){U=!0;break}for(let[re,Z]of t.traces.entries()){if(Z===K||Z.globalConnNetId!==K.globalConnNetId)continue;let te=[...Z.tracePath,...Wot(ee,Z.tracePath)].filter((ie)=>Vs(ee,ie));for(let ie of te){if(K.globalConnNetId===d.globalConnNetId&&v(ie))ie=HY(ie,A,L);if(!Vs(J,ie)||!Vs(H[re].tracePath,ie)){U=!0;break}}if(U)break}if(U)break;if(h.filter((re)=>Vs(ee,re)).some((re)=>!Vs(J,re))||h.some((re)=>{let Z={minX:re.x-Y3,maxX:re.x+Y3,minY:re.y-Y3,maxY:re.y+Y3};return LY(J,Z)&&!LY(ee,Z)})||a.some((re)=>LY(J,re)&&!LY(ee,re))){U=!0;break}for(let re of[...H,...i]){if(re.mspPairId===X.mspPairId||re.globalConnNetId===X.globalConnNetId)continue;let Z=t.traces.find((te)=>te.mspPairId===re.mspPairId)??re;if(fL(J,[re])||Wot(J,re.tracePath).length>Wot(ee,Z.tracePath).length){U=!0;break}}if(U)break}if(U)continue;for(let[Y,X]of O.entries()){if(X===t.netLabelPlacements[Y])continue;let K=np(X);if(a.some((J)=>Qc(K,J))||c.some((J)=>Qc(K,J))){U=!0;break}if(O.some((J,ee)=>Y!==ee&&Qc(K,np(J)))){U=!0;break}if([...H,...i].some((J)=>J.globalConnNetId!==X.globalConnNetId&&LY(J.tracePath,K))){U=!0;break}}if(!U)yield{...t,traces:H,netLabelPlacements:O}}}}}var zJ=(e,t)=>{let n=[...e.pinIds].sort(),o=[...t.pinIds].sort();return e.globalConnNetId===t.globalConnNetId&&n.length===o.length&&n.every((r,i)=>r===o[i])},ISn=(e,t)=>{if(e.kind==="label-label"&&t.kind==="label-label")return zJ(e.labels[0],t.labels[0])&&zJ(e.labels[1],t.labels[1])||zJ(e.labels[0],t.labels[1])&&zJ(e.labels[1],t.labels[0]);if(e.kind!=="trace-label"||t.kind!=="trace-label")return!1;return(e.trace.kind==="routed"&&t.trace.kind==="routed"?e.trace.id===t.trace.id:e.trace.kind==="terminal"&&t.trace.kind==="terminal"&&zJ(e.trace.label,t.trace.label))&&e.target===t.target&&zJ(e.label,t.label)},Bxn=(e)=>{let t=[...e.netLabelPlacements,...e.inlineNetLabelPlacements].map((i)=>({label:i,bounds:"axis"in i?{minX:i.center.x-(i.axis==="x"?i.width:i.height)/2,maxX:i.center.x+(i.axis==="x"?i.width:i.height)/2,minY:i.center.y-(i.axis==="x"?i.height:i.width)/2,maxY:i.center.y+(i.axis==="x"?i.height:i.width)/2}:np(i)})),n=[],o=(i)=>{if(!n.some((s)=>ISn(i,s)))n.push(i)};for(let i=0;i<t.length;i++)for(let s of t.slice(i+1))if(Qc(t[i].bounds,s.bounds))o({kind:"label-label",labels:[t[i].label,s.label]});let r=[...e.traces.map((i)=>({...i,identity:{kind:"routed",id:i.mspPairId}})),...e.inlineNetLabelPlacements.flatMap((i)=>i.stubTracePath?[{identity:{kind:"terminal",label:i},globalConnNetId:i.globalConnNetId,tracePath:i.stubTracePath}]:[])];for(let i of r)for(let{label:s,bounds:a}of t)if((("axis"in s)||s.globalConnNetId!==i.globalConnNetId)&&i.tracePath.slice(1).some((c,l)=>D1(i.tracePath[l],c,a)))o({kind:"trace-label",trace:i.identity,label:s,target:"text"});for(let i of e.inlineNetLabelPlacements){let s=bSn(i);if(!s)continue;for(let a of e.traces){if(a.pinIds.some((c)=>i.pinIds.includes(c)))continue;if(a.tracePath.slice(1).some((c,l)=>D1(a.tracePath[l],c,s)))o({kind:"trace-label",trace:{kind:"routed",id:a.mspPairId},label:i,target:"terminal"})}}return n},sst=(e,t)=>e.pinIds.length>0&&e.pinIds.every((n)=>t.some((o)=>o.globalConnNetId===e.globalConnNetId&&o.pinIds.includes(n))),Lli=(e)=>{let[t,n]=e;if(Math.abs(n.x-t.x)>=Math.abs(n.y-t.y))return n.x>=t.x?"x+":"x-";return n.y>=t.y?"y+":"y-"},Hli=(e)=>{let[t,n]=e;return Math.abs(n.x-t.x)+Math.abs(n.y-t.y)},G9e=(e)=>{let t=e.axis==="y",n=t?e.height:e.width,o=t?e.width:e.height;return{minX:e.center.x-n/2,maxX:e.center.x+n/2,minY:e.center.y-o/2,maxY:e.center.y+o/2}},vSn=(e)=>({minX:Math.min(...e.map((t)=>t.x)),maxX:Math.max(...e.map((t)=>t.x)),minY:Math.min(...e.map((t)=>t.y)),maxY:Math.max(...e.map((t)=>t.y))}),_de=(e,t)=>{for(let n=0;n<e.length-1;n++){let o=vSn([e[n],e[n+1]]);if(Qc(o,t))return!0}return!1},Fli=(e,t,n)=>{let[o]=e.stubTracePath,r=t==="x+"?{x:o.x+n,y:o.y}:t==="x-"?{x:o.x-n,y:o.y}:t==="y+"?{x:o.x,y:o.y+n}:{x:o.x,y:o.y-n},i={x:(o.x+r.x)/2,y:(o.y+r.y)/2};return{...e,stubTracePath:[o,r],anchorPoint:i,center:e.center}},zli=({placements:e,inputProblem:t,traces:n,netLabelPlacements:o})=>{let r=new Map;for(let c of t.chips)for(let l of c.pins)r.set(l.pinId,c.chipId);let i=new Map;for(let[c,l]of e.entries()){if(!l.stubTracePath||l.pinIds.length!==1)continue;let h=Lli(l.stubTracePath);if(!h)continue;let d=r.get(l.pinIds[0]),u=`${d??l.pinIds[0]}::${h}`,_=i.get(u)??[];_.push({placementIndex:c,placement:l,direction:h,ownerChipId:d}),i.set(u,_)}let s=[...e],a=o.filter((c)=>!sst(c,e)).map(G9e);for(let c of i.values()){if(c.length<2)continue;let l=Math.max(...c.map(({placement:p})=>Hli(p.stubTracePath))),h=c.map(({placement:p,direction:m})=>Fli(p,m,l)),d=new Set(c.map(({placementIndex:p})=>p)),u=e.filter((p,m)=>!d.has(m));if(h.some((p,m)=>{let A=G9e(p),g=p.stubTracePath,f=vSn(g),y=c[m].ownerChipId;for(let x of t.chips){let C={minX:x.center.x-x.width/2,maxX:x.center.x+x.width/2,minY:x.center.y-x.height/2,maxY:x.center.y+x.height/2};if(Qc(A,C))return!0;if(x.chipId!==y&&Qc(f,C))return!0}for(let x of t.textBoxes??[]){let C=Nv(x);if(Qc(A,C)||Qc(f,C))return!0}for(let x of n){if(x.globalConnNetId===p.globalConnNetId)continue;if(_de(x.tracePath,A)||_de(x.tracePath,f))return!0}if(a.some((x)=>Qc(A,x)||Qc(f,x)))return!0;for(let x of u){let C=G9e(x);if(Qc(A,C)||Qc(f,C))return!0;if(x.stubTracePath&&(_de(x.stubTracePath,A)||_de(g,C)))return!0}for(let[x,C]of h.entries()){if(x===m)continue;let b=G9e(C);if(Qc(A,b))return!0;if(_de(g,b))return!0}return!1}))continue;for(let[p,{placementIndex:m}]of c.entries())s[m]=h[p]}return s},Txn=(e,t=0.000001)=>{let n=[],o=null,r=null,i=0,s=(a)=>{if(o&&r){let c=r==="x"?Math.abs(a.x-o.x):Math.abs(a.y-o.y);if(c>t)n.push({start:o,end:a,axis:r,length:c})}o=null,r=null,i=0};for(let a=0;a<e.length-1;a++){let c=e[a],l=e[a+1],h=l.x-c.x,d=l.y-c.y;if(Math.abs(h)<=t&&Math.abs(d)<=t)continue;let u=Math.abs(d)<=t?"x":Math.abs(h)<=t?"y":null;if(!u){s(c);continue}let _=Math.sign(u==="x"?h:d);if(o&&r===u&&i===_)continue;s(c),o=c,r=u,i=_}if(e.length>=2)s(e[e.length-1]);return n.sort((a,c)=>c.length-a.length)},f6=0.05,H5=0.000001,Oli=0.01,Dxn=5,Vli=(e)=>{let t=e.axis==="y"?e.height:e.width,n=e.axis==="y"?e.width:e.height;return{minX:e.center.x-t/2,maxX:e.center.x+t/2,minY:e.center.y-n/2,maxY:e.center.y+n/2}},Fue=(e,t)=>Math.abs(e.x-t.x)<=H5&&Math.abs(e.y-t.y)<=H5,gde=(e,t)=>{for(let n=0;n<e.length-1;n++){let o=e[n],r=e[n+1],i={minX:Math.min(o.x,r.x),maxX:Math.max(o.x,r.x),minY:Math.min(o.y,r.y),maxY:Math.max(o.y,r.y)};if(Qc(i,t))return!0}return!1},Yli=(e,t)=>{for(let n=0;n<t.length-1;n++){let o=t[n],r=t[n+1],i=Math.min(o.x,r.x)-H5,s=Math.max(o.x,r.x)+H5,a=Math.min(o.y,r.y)-H5,c=Math.max(o.y,r.y)+H5,l=Math.abs(o.y-r.y)<=H5,h=Math.abs(o.x-r.x)<=H5;if((l&&Math.abs(e.y-o.y)<=H5||h&&Math.abs(e.x-o.x)<=H5)&&e.x>=i&&e.x<=s&&e.y>=a&&e.y<=c)return!0}return!1},Gli=(e,t)=>{let n=0;for(let o=0;o<t.length;o++){let r=np(xve(e,e.orientation,n)),i=e.orientation==="x-"||e.orientation==="x+",s=t.filter((a)=>Qc(r,{minX:a.minX-(i?f6:0),maxX:a.maxX+(i?f6:0),minY:a.minY-(i?0:f6),maxY:a.maxY+(i?0:f6)}));if(s.length===0)break;switch(e.orientation){case"x-":n+=r.maxX-Math.min(...s.map((a)=>a.minX))+f6;break;case"x+":n+=Math.max(...s.map((a)=>a.maxX))-r.minX+f6;break;case"y-":n+=r.maxY-Math.min(...s.map((a)=>a.minY))+f6;break;case"y+":n+=Math.max(...s.map((a)=>a.maxY))-r.minY+f6;break}}return n},xve=(e,t,n)=>{let o=Pp(t);return{...e,anchorPoint:{x:e.anchorPoint.x+o.x*n,y:e.anchorPoint.y+o.y*n},center:{x:e.center.x+o.x*n,y:e.center.y+o.y*n}}},Uli=(e,t,n)=>{switch(n){case"x-":return e.maxX-t.minX+f6;case"x+":return t.maxX-e.minX+f6;case"y-":return e.maxY-t.minY+f6;case"y+":return t.maxY-e.minY+f6}},Wli=(e,t,n)=>{if(n==="x-"||n==="x+")return Math.max(0,e.minY-t.maxY,t.minY-e.maxY);return Math.max(0,e.minX-t.maxX,t.minX-e.maxX)},SSn=(e,t,n)=>e.pinIds.some((o)=>t.has(n.get(o)??"")),Nxn=(e,t,n)=>t.findIndex((o)=>{if(o.globalConnNetId!==e.globalConnNetId)return!1;if(!n.has(o.mspPairId))return!1;let r=o.tracePath[0],i=o.tracePath.at(-1);return Boolean(r&&Fue(r,e.anchorPoint)||i&&Fue(i,e.anchorPoint))}),Rxn=(e,t,n)=>{if(e.pinIds.some((o)=>{let r=n[o];return r&&Fue(r,e.anchorPoint)}))return!0;return t.some((o)=>o.globalConnNetId===e.globalConnNetId&&Yli(e.anchorPoint,o.tracePath))},Xli=(e,t,n)=>{let o=e.tracePath.map((r)=>({...r}));if(Fue(o[0],t))o[0]=n;if(Fue(o.at(-1),t))o[o.length-1]=n;return{...e,tracePath:o}},jli=({label:e,labelIndex:t,newAnchor:n,pinMap:o})=>{let r=`inline-net-label-clearance-${t}-${e.netId??e.globalConnNetId}`;return{mspPairId:r,dcConnNetId:e.dcConnNetId??e.globalConnNetId,globalConnNetId:e.globalConnNetId,userNetId:e.netId,pins:Bct(e,o),tracePath:[e.anchorPoint,n],mspConnectionPairIds:[r],pinIds:e.pinIds}},Kli=({triggerIndex:e,labels:t,chipIdByPinId:n})=>{let o=t[e],r=new Set(o.pinIds.flatMap((c)=>{let l=n.get(c);return l?[l]:[]})),i=t.map((c,l)=>({label:c,labelIndex:l})).filter(({label:c})=>c.orientation===o.orientation&&c.mspConnectionPairIds.length===0&&SSn(c,r,n)),s=new Set([e]),a=!0;while(a){a=!1;for(let{label:c,labelIndex:l}of i){if(s.has(l))continue;if([...s].some((h)=>Wli(np(t[h]),np(c),o.orientation)<=Oli))s.add(l),a=!0}}return{group:s,ownerChipIds:r}},$li=({inputProblem:e,traces:t,netLabelPlacements:n,inlineNetLabelPlacements:o,netLabelConnectorTraceIds:r=new Set})=>{let i=new Set(r),s=t.map((u)=>({...u,tracePath:u.tracePath.map((_)=>({..._}))})),a=n.map((u)=>({...u})),c=o.map(Vli),l=wct(e),h=new Map;for(let u of e.chips)for(let _ of u.pins)h.set(_.pinId,u.chipId);let d=new Set;for(let u=0;u<a.length;u++){let _=a[u],p=Gli(_,c);if(p<=H5||p>Dxn)continue;let{group:m,ownerChipIds:A}=Kli({triggerIndex:u,labels:a,chipIdByPinId:h}),g=new Map([...m].map((b)=>[b,p])),f=!1;for(let b=0;b<a.length;b++){let I=!1;for(let[v,P]of g){let M=np(xve(a[v],_.orientation,P));for(let B=0;B<a.length;B++){if(B===v||m.has(B))continue;let T=a[B],N=g.get(B)??0,D=np(xve(T,_.orientation,N));if(!Qc(M,D))continue;if(!SSn(T,A,h)||Nxn(T,s,i)===-1&&!Rxn(T,s,l)){f=!0;break}let L=Uli(np(T),M,_.orientation);if(L>Dxn||L<=N+H5){f=!0;break}g.set(B,L),I=!0}if(f)break}if(f||!I)break}if(f)continue;let y=new Map;for(let[b,I]of g)y.set(b,xve(a[b],_.orientation,I));let x=(b)=>y.get(b)??a[b];for(let[b,I]of y){let v=np(I);if(c.some((P)=>Qc(v,P))){f=!0;break}if(e.chips.some((P)=>Qc(v,{minX:P.center.x-P.width/2,maxX:P.center.x+P.width/2,minY:P.center.y-P.height/2,maxY:P.center.y+P.height/2}))||(e.textBoxes??[]).some((P)=>Qc(v,Nv(P)))){f=!0;break}if(a.some((P,M)=>M!==b&&Qc(v,np(x(M))))){f=!0;break}if(s.some((P)=>P.globalConnNetId!==I.globalConnNetId&&gde(P.tracePath,v))){f=!0;break}}if(f)continue;let C=[];for(let[b,I]of y){let v=a[b],P=Nxn(v,s,i);if(P===-1&&!Rxn(v,s,l)){f=!0;break}let M=P===-1?jli({label:v,labelIndex:b,newAnchor:I.anchorPoint,pinMap:l}):Xli(s[P],v.anchorPoint,I.anchorPoint);if(M.tracePath.slice(1).some((T,N)=>{let D=M.tracePath[N];return Math.abs(T.x-D.x)>H5&&Math.abs(T.y-D.y)>H5})||s.some((T)=>T.globalConnNetId!==M.globalConnNetId&&xG(M.tracePath,T.tracePath,{includeTerminalSegments:!0}).length>0)||c.some((T)=>gde(M.tracePath,T))||e.chips.some((T)=>!A.has(T.chipId)&&gde(M.tracePath,{minX:T.center.x-T.width/2,maxX:T.center.x+T.width/2,minY:T.center.y-T.height/2,maxY:T.center.y+T.height/2}))||(e.textBoxes??[]).some((T)=>gde(M.tracePath,Nv(T)))||a.some((T,N)=>N!==b&&gde(M.tracePath,np(x(N))))){f=!0;break}C.push({labelIndex:b,connectorIndex:P,trace:M})}if(f)continue;for(let[b,I]of y)a[b]=I,d.add(b);for(let b of C)if(i.add(b.trace.mspPairId),b.connectorIndex===-1)s.push(b.trace);else s[b.connectorIndex]=b.trace}return{traces:s,netLabelPlacements:a,movedLabelCount:d.size,netLabelConnectorTraceIds:i}},U9e=0.05,qli=5,Jli=(e)=>{let[t,n]=e;if(Math.abs(n.x-t.x)>=Math.abs(n.y-t.y))return n.x>=t.x?"x+":"x-";return n.y>=t.y?"y+":"y-"},Xot=(e)=>{let t=e.axis==="y"?e.height:e.width,n=e.axis==="y"?e.width:e.height;return{minX:e.center.x-t/2,maxX:e.center.x+t/2,minY:e.center.y-n/2,maxY:e.center.y+n/2}},PSn=(e)=>({minX:Math.min(...e.map((t)=>t.x)),maxX:Math.max(...e.map((t)=>t.x)),minY:Math.min(...e.map((t)=>t.y)),maxY:Math.max(...e.map((t)=>t.y))}),FY=(e,t)=>{for(let n=0;n<e.length-1;n++)if(Qc(PSn([e[n],e[n+1]]),t))return!0;return!1},jot=(e,t,n)=>{switch(t){case"x+":return{x:e.x+n,y:e.y};case"x-":return{x:e.x-n,y:e.y};case"y+":return{x:e.x,y:e.y+n};case"y-":return{x:e.x,y:e.y-n}}},Qxn=(e,t,n)=>{let[o,r]=e.stubTracePath,i=jot(r,t,n);return{...e,stubTracePath:[o,i],anchorPoint:jot(e.anchorPoint,t,n),center:jot(e.center,t,n)}},Zli=(e,t,n)=>{switch(n){case"x+":return t.maxX-e.minX+U9e;case"x-":return e.maxX-t.minX+U9e;case"y+":return t.maxY-e.minY+U9e;case"y-":return e.maxY-t.minY+U9e}},ehi=({inputProblem:e,traces:t,anchoredNetLabelPlacements:n,inlineNetLabelPlacements:o})=>{let r=new Map;for(let c of e.chips)for(let l of c.pins)r.set(l.pinId,c.chipId);let i=new Map;for(let[c,l]of o.entries()){if(!l.stubTracePath||l.pinIds.length!==1)continue;let h=Jli(l.stubTracePath),d=r.get(l.pinIds[0]),u=`${d??l.pinIds[0]}::${h}`,_=i.get(u)??[];_.push({placementIndex:c,placement:l,direction:h,ownerChipId:d}),i.set(u,_)}let s=[...o],a=0;for(let c of i.values()){let l=new Set(c.map(({placementIndex:m})=>m)),h=s.filter((m,A)=>!l.has(A)),d=c[0].direction,u=0;for(let m=0;m<=n.length;m++){let A=0;for(let{placement:g}of c){let f=Qxn(g,d,u),y=Xot(f);for(let x of n){if(x.globalConnNetId===g.globalConnNetId)continue;let C=np(x);if(!Qc(y,C))continue;A=Math.max(A,Zli(y,C,d))}}if(A<=0)break;u+=A}if(u<=0||u>qli)continue;let _=c.map(({placement:m})=>Qxn(m,d,u));if(_.some((m,A)=>{let f=c[A].placement.stubTracePath[1],y=m.stubTracePath[1],x=[f,y],C=Xot(m),b=c[A].ownerChipId;if(n.some((I)=>{if(I.globalConnNetId===m.globalConnNetId)return!1;let v=np(I);return Qc(C,v)||FY(x,v)}))return!0;for(let I of e.chips){if(I.chipId===b)continue;let v={minX:I.center.x-I.width/2,maxX:I.center.x+I.width/2,minY:I.center.y-I.height/2,maxY:I.center.y+I.height/2};if(Qc(C,v)||FY(x,v))return!0}for(let I of e.textBoxes??[]){let v=Nv(I);if(Qc(C,v)||FY(x,v))return!0}for(let I of t){if(I.globalConnNetId===m.globalConnNetId)continue;if(FY(I.tracePath,C)||FY(I.tracePath,PSn(x)))return!0}for(let I of h){let v=Xot(I);if(Qc(C,v)||FY(x,v)||I.stubTracePath&&FY(I.stubTracePath,C))return!0}return!1}))continue;for(let[m,{placementIndex:A}]of c.entries())s[A]=_[m];a++}return{inlineNetLabelPlacements:s,movedGroupCount:a}},ast=(e,t)=>{let{width:n,height:o}=t;if("axis"in t&&t.axis==="y")n=t.height,o=t.width;let r=Yri({center:t.center,width:n,height:o});for(let i=0;i<e.length-1;i++)if(Fri(e[i],e[i+1],r))return!0;return!1},cst=0.000001,kxn=(e)=>e.slice(1).reduce((t,n,o)=>{let r=e[o];return t+Math.abs(n.x-r.x)+Math.abs(n.y-r.y)},0),thi=(e,t)=>e.length===t.length&&e.every((n,o)=>Math.abs(n.x-t[o].x)<=cst&&Math.abs(n.y-t[o].y)<=cst),nhi=(e,t)=>e.length<t.length&&kxn(e)<=kxn(t)+cst,Lxn=(e,t)=>{let n=new Set;for(let o=0;o<e.length-1;o++)for(let r=0;r<t.length-1;r++){let i=XP(e[o],e[o+1],t[r],t[r+1]);if(i)n.add(`${i.x.toFixed(6)},${i.y.toFixed(6)}`)}return n},Hxn=(e,t,n)=>n.some((o)=>{let r=Lxn(t,o);return[...Lxn(e,o)].some((s)=>!r.has(s))}),ohi=({inputProblem:e,traces:t,netLabelPlacements:n,inlineNetLabelPlacements:o,completedReroutes:r})=>{let i=[...t],s=new Set(o.map((l)=>l.globalConnNetId)),a=Cx(e),c=0;for(let l of[...r].reverse()){if(!s.has(l.label.globalConnNetId))continue;let h=i.findIndex((y)=>y.mspPairId===l.initialTrace.mspPairId);if(h<0)continue;let d=i[h],u=Mi(d.tracePath),_=Mi(l.reroutedTracePath);if(!thi(u,_))continue;let p=Mi(l.initialTrace.tracePath);if(!nhi(p,u))continue;let m={...d,tracePath:p},A=i.filter((y)=>y.mspPairId!==d.mspPairId&&y.globalConnNetId!==d.globalConnNetId),g=o.filter((y)=>y.globalConnNetId!==d.globalConnNetId),f=g.flatMap((y)=>y.stubTracePath?[[...y.stubTracePath]]:[]);if(ZZ(p,a)||Mp({traces:[m],netLabels:n}).length>0||g.some((y)=>ast(p,y))||fL(p,A)||G7n(p,f)||Hxn(p,u,A.map((y)=>y.tracePath))||Hxn(p,u,f)||!Que(n,[d],[m]))continue;i[h]=m,c++}return{traces:i,restoredTraceCount:c}},lst=0.18,Kot=0.05,Cve=0.05,rhi=0.4,Fxn=(e)=>JSON.stringify([...e].sort()),zxn=(e)=>{let t=0;for(let n=0;n<e.tracePath.length-1;n++){let o=e.tracePath[n],r=e.tracePath[n+1];t+=Math.abs(r.x-o.x)+Math.abs(r.y-o.y)}return t},ihi=(e,t)=>e.size===t.size&&[...e].every((n)=>t.has(n)),$ot=(e)=>{let t=e.axis==="y"?e.height:e.width,n=e.axis==="y"?e.width:e.height;return{minX:e.center.x-t/2,maxX:e.center.x+t/2,minY:e.center.y-n/2,maxY:e.center.y+n/2}},hP=(e)=>JSON.stringify([e.globalConnNetId,[...e.pinIds].sort(),e.mspPairId??null]),shi=(e,t)=>{let n=Cve-Q5,o={minX:Math.min(e[0].x,e[1].x)-n,maxX:Math.max(e[0].x,e[1].x)+n,minY:Math.min(e[0].y,e[1].y)-n,maxY:Math.max(e[0].y,e[1].y)+n};return $J(t.tracePath,o)},ahi=class e extends Gu{constructor(t){super();this.input=t,this.netLabelConnectorTraceIds=t.netLabelConnectorTraceIds??new Set,this.inputProblem=t.inputProblem,this.traces=t.traces,this.inputNetLabelPlacements=t.netLabelPlacements,this.completedReroutes=t.completedReroutes??[],this.globalConnMap=S6(this.inputProblem).netConnMap,this.queuedConnections=[...this.inputProblem.directConnections.filter((n)=>n.allowInlineNetLabel&&n.netId&&!this.inputProblem.netConnections.some((o)=>o.allowInlineNetLabel&&o.netId&&n.pinIds.every((r)=>o.pinIds.includes(r)))).map((n)=>({kind:"direct_connection",connection:n})),...this.inputProblem.netConnections.filter((n)=>n.allowInlineNetLabel&&n.pinIds.length>=1&&n.netId).map((n)=>({kind:"net_connection",connection:n}))],this.tracesByPinPairKey=new Map;for(let n of this.traces){if(this.netLabelConnectorTraceIds.has(n.mspPairId))continue;let o=Fxn(n.pins.map((i)=>i.pinId)),r=this.tracesByPinPairKey.get(o);if(r)r.push(n);else this.tracesByPinPairKey.set(o,[n])}}input;inputProblem;traces;inputNetLabelPlacements;completedReroutes;inlineNetLabelPlacements=[];queuedConnections;netLabelConnectorTraceIds;tracesByPinPairKey;globalConnMap;inlineConversions=[];hasAlignedPortOnlyStubs=!1;postProcessedOutput;refinementComplete=!1;refinement;currentProposal;getConstructorParams(){return[{inputProblem:this.inputProblem,traces:this.traces,netLabelPlacements:this.inputNetLabelPlacements,completedReroutes:this.completedReroutes,resolveTraceCollisions:this.input.resolveTraceCollisions,netLabelConnectorTraceIds:this.netLabelConnectorTraceIds}]}_step(){let t=this.queuedConnections.shift();if(t){if(t.kind==="net_connection"&&t.connection.pinIds.length>2){let r=[t.connection,...this.queuedConnections.filter((i)=>i.kind==="net_connection"&&i.connection.pinIds.length>2).map((i)=>i.connection)];this.queuedConnections=this.queuedConnections.filter((i)=>i.kind!=="net_connection"||i.connection.pinIds.length<=2);for(let i of this.computeNetConnectionInlineConversions(r))this.inlineNetLabelPlacements.push(...i.placements),this.inlineConversions.push(i);return}let{connection:n}=t,o=n.pinIds.length===2?this.tracesByPinPairKey.get(Fxn(n.pinIds))??[]:[];if(o.length>0){let r=this.computeInlinePlacement({connection:n,trace:o[0],pinIds:n.pinIds});if(r)this.inlineNetLabelPlacements.push(r)}else for(let r of n.pinIds){let i=this.computeTerminalInlinePlacement(n,r);if(i)this.inlineNetLabelPlacements.push(i)}return}if(!this.hasAlignedPortOnlyStubs){this.inlineNetLabelPlacements=zli({placements:this.inlineNetLabelPlacements,inputProblem:this.inputProblem,traces:this.traces,netLabelPlacements:this.inputNetLabelPlacements}),this.hasAlignedPortOnlyStubs=!0;return}if(!this.postProcessedOutput){this.postProcessedOutput=this.buildPostProcessedOutput();return}if(this.input.resolveTraceCollisions&&!this.refinementComplete){this.stepTraceRefinement();return}this.solved=!0,this.stats.inlineNetLabelCount=this.inlineNetLabelPlacements.length}computeNetConnectionInlineConversions(t){let n=new Map;for(let r of t){let i=new Set;for(let s of this.getNetConnectionComponents(r)){if(s.traces.length===0)continue;if(!s.traces.some((c)=>Boolean(this.computeInlinePlacement({connection:r,trace:c,pinIds:s.pinIds}))))for(let c of s.traces)i.add(c.mspPairId)}n.set(r,i)}let o=new Set([...n.values()].flatMap((r)=>[...r]));while(!0){let r=t.map((s)=>({connection:s,conversion:this.computeNetConnectionInlinePlacements(s,o,n.get(s)??new Set)})),i=new Set(r.flatMap(({conversion:s})=>s.flatMap((a)=>[...a.supersededTraceIds])));if(ihi(o,i))return r.flatMap(({conversion:s})=>s);o=i}}getNetConnectionComponents(t){let n=t.pinIds[0];if(!n)return[];let o=this.globalConnMap.getNetConnectedToId(n);if(!o)return[];let r=new Set(this.inputProblem.chips.flatMap((a)=>a.pins.map((c)=>c.pinId))),i=this.globalConnMap.getIdsConnectedToNet(o).filter((a)=>r.has(a)),s=new Set(t.pinIds);return g8e({pinIds:i,traces:this.traces.filter((a)=>!this.netLabelConnectorTraceIds.has(a.mspPairId))}).map((a)=>({pinIds:a.pinIds,labeledPinIds:a.pinIds.filter((c)=>s.has(c)),traces:a.traces.sort((c,l)=>zxn(l)-zxn(c))})).filter((a)=>a.labeledPinIds.length>0)}getGlobalConnNetId(t){let n=t.pinIds[0];if(!n)return;let o=new Set(t.pinIds);return this.traces.find((r)=>r.pins.some((i)=>o.has(i.pinId)))?.globalConnNetId??this.inputNetLabelPlacements.find((r)=>r.netId===t.netId)?.globalConnNetId??this.globalConnMap.getNetConnectedToId(n)??void 0}computeNetConnectionInlinePlacements(t,n,o){let r=this.getNetConnectionComponents(t),i=this.getGlobalConnNetId(t);if(!i)return[];let s=[];for(let a of r){let c=a.traces.some((d)=>o.has(d.mspPairId)),l=null;if(!c){for(let d of a.traces)if(l=this.computeInlinePlacement({connection:t,trace:d,pinIds:a.pinIds,ignoredTraceIds:n}),l)break}if(l){s.push({globalConnNetId:i,placements:[l],supersededTraceIds:new Set});continue}if(a.traces.length>0&&!c)continue;if(a.labeledPinIds.length!==a.pinIds.length)continue;let h=a.pinIds.map((d)=>this.computeTerminalInlinePlacement(t,d,i,n));if(h.some((d)=>d===null))continue;s.push({globalConnNetId:i,placements:h,supersededTraceIds:new Set(a.traces.map((d)=>d.mspPairId))})}return s}getInlineOffsets(t,n,o,r,i,s,a){let c=i/2+Kot,l=n==="x"?"y":"x",h=o==="x+"||o==="y+"?1:-1,d=1/0;for(let u of s){if(a.has(u.mspPairId))continue;for(let _ of Txn(u.tracePath)){if(_.axis!==n)continue;if(Math.max(_.start[n],_.end[n])<=t[n]-r/2||Math.min(_.start[n],_.end[n])>=t[n]+r/2)continue;let p=h*(_.start[l]-t[l]);if(p>Q5)d=Math.min(d,p)}}return d>i+Q5&&d/2<c-Q5?[c,d/2]:[c]}computeTerminalInlinePlacement(t,n,o,r=new Set,i){if(!t.netId)return null;let s=this.inputNetLabelPlacements.find((C)=>C.netId===t.netId&&C.pinIds.length===1&&C.pinIds[0]===n),a=o??s?.globalConnNetId;if(!a)return null;let c=this.inputProblem.chips.find((C)=>C.pins.some((b)=>b.pinId===n)),l=c?.pins.find((C)=>C.pinId===n),h=t.inlineNetLabelHeight??lst,d=t.netLabelText?.trim()||void 0,u=t.inlineNetLabelWidth??t.netLabelWidth??Oxn(d??t.netId,h),_=Math.max(u+0.2,0.6);if(!l&&!s)return null;let p=l?{x:l.x,y:l.y}:s.anchorPoint,m=l&&c?l._facingDirection??E6(l,c):s.orientation,A=m==="x+"?{x:p.x+_,y:p.y}:m==="x-"?{x:p.x-_,y:p.y}:m==="y+"?{x:p.x,y:p.y+_}:{x:p.x,y:p.y-_},g=lhi({start:p,intendedEnd:A,minimumLength:u+2*Kot,traces:i?.traces??this.traces,ownGlobalConnNetId:a,ignoredTraceIds:r});if(!g)return null;let f=m==="x+"||m==="x-"?"x":"y",y={x:(p.x+g.x)/2,y:(p.y+g.y)/2},x=f==="x"?["y+","y-"]:["x-","x+"];for(let C of x)for(let b of this.getInlineOffsets(y,f,C,u,h,i?.traces??this.traces,r)){let I=C==="y+"?{x:y.x,y:y.y+b}:C==="y-"?{x:y.x,y:y.y-b}:C==="x-"?{x:y.x-b,y:y.y}:{x:y.x+b,y:y.y},v=u/2,P=h/2,M=f==="x"?{minX:I.x-v,maxX:I.x+v,minY:I.y-P,maxY:I.y+P}:{minX:I.x-P,maxX:I.x+P,minY:I.y-v,maxY:I.y+v};if(this.isObstructed(M,{ownGlobalConnNetId:a,ignoredTraceIds:r,obstacles:i}))continue;return{globalConnNetId:a,netId:t.netId,netLabelText:d,pinIds:[n],stubTracePath:[p,g],axis:f,anchorPoint:y,center:I,width:u,height:h,side:C}}return null}computeInlinePlacement({connection:t,trace:n,pinIds:o,ignoredTraceIds:r=new Set}){let i=Txn(n.tracePath);if(i.length===0)return null;let s=t.inlineNetLabelHeight??lst,a=t.netLabelText?.trim()||void 0,c=t.inlineNetLabelWidth??t.netLabelWidth??Oxn(a??t.netId,s),l=s/2+Kot,h=i.filter((u)=>u.length>=c).sort((u,_)=>_.length-u.length);for(let u of h){let _=u.axis==="x"?["y+","y-"]:["x-","x+"];for(let p of _)for(let m of chi(u,c))for(let A of this.getInlineOffsets(m,u.axis,p,c,s,this.traces,r)){let g=p==="y+"?{x:m.x,y:m.y+A}:p==="y-"?{x:m.x,y:m.y-A}:p==="x-"?{x:m.x-A,y:m.y}:{x:m.x+A,y:m.y},f=c/2,y=s/2,x=u.axis==="x"?{minX:g.x-f,maxX:g.x+f,minY:g.y-y,maxY:g.y+y}:{minX:g.x-y,maxX:g.x+y,minY:g.y-f,maxY:g.y+f};if(this.isObstructed(x,{ownTrace:n,ownGlobalConnNetId:n.globalConnNetId,ignoredTraceIds:r}))continue;return{globalConnNetId:n.globalConnNetId,netId:t.netId,netLabelText:a,mspPairId:n.mspPairId,pinIds:[...o],axis:u.axis,anchorPoint:m,center:g,width:c,height:s,side:p}}}let d=this.computeSpanPlacement({trace:n,connection:t,netLabelText:a,width:c,height:s,offset:l,pinIds:o,ignoredTraceIds:r});if(d)return d;return null}computeSpanPlacement({trace:t,connection:n,netLabelText:o,width:r,height:i,offset:s,pinIds:a,ignoredTraceIds:c}){let l=t.tracePath;if(l.length<2)return null;let h=1/0,d=-1/0,u=1/0,_=-1/0;for(let P of l)h=Math.min(h,P.x),d=Math.max(d,P.x),u=Math.min(u,P.y),_=Math.max(_,P.y);let p=d-h,m=_-u,A=p>=m?"x":"y",g=A==="x"?p:m;if((A==="x"?m:p)>rhi)return null;if(g<r)return null;let C=((A==="x"?h:u)+(A==="x"?d:_))/2,b=(g-r)/2,I=[0];for(let P=0.1;P<=b+0.000000001;P+=0.1)I.push(P,-P);I.push(b,-b);let v=A==="x"?["y+","y-"]:["x-","x+"];for(let P of v)for(let M of I){let B=C+M,T=P==="y+"?{x:B,y:_+s}:P==="y-"?{x:B,y:u-s}:P==="x-"?{x:h-s,y:B}:{x:d+s,y:B},N=r/2,D=i/2,L=A==="x"?{minX:T.x-N,maxX:T.x+N,minY:T.y-D,maxY:T.y+D}:{minX:T.x-D,maxX:T.x+D,minY:T.y-N,maxY:T.y+N};if(this.isObstructed(L,{ownTrace:t,ownGlobalConnNetId:t.globalConnNetId,ignoredTraceIds:c}))continue;let H=A==="x"?{x:B,y:P==="y+"?_:u}:{x:P==="x-"?h:d,y:B};return{globalConnNetId:t.globalConnNetId,netId:n.netId,netLabelText:o,mspPairId:t.mspPairId,pinIds:[...a],axis:A,anchorPoint:H,center:T,width:r,height:i,side:P}}return null}isObstructed(t,{ownTrace:n,ownGlobalConnNetId:o,ignoredTraceIds:r=new Set,obstacles:i}){for(let s of this.inputProblem.chips){let a={minX:s.center.x-s.width/2,maxX:s.center.x+s.width/2,minY:s.center.y-s.height/2,maxY:s.center.y+s.height/2};if(Qc(t,a))return!0}for(let s of this.inputProblem.textBoxes??[])if(Qc(t,Nv(s)))return!0;for(let s of i?.traces??this.traces){if(r.has(s.mspPairId))continue;if(n&&s.mspPairId===n.mspPairId)continue;if(s.globalConnNetId===o)continue;if($J(s.tracePath,t))return!0}if(i?.anchored.some((s)=>Qc(t,np(s))))return!0;if(i?.inline.some((s)=>Qc(t,$ot(s))||s.stubTracePath&&s.globalConnNetId!==o&&$J(s.stubTracePath,t)))return!0;return!1}getOutputTraces(t){let n=new Set(t.map(hP)),o=new Set(this.inlineConversions.filter((r)=>r.placements.every((i)=>n.has(hP(i)))).flatMap((r)=>[...r.supersededTraceIds]));return this.traces.filter((r)=>!o.has(r.mspPairId)&&!(this.netLabelConnectorTraceIds.has(r.mspPairId)&&sst(r,t)))}getBlockedInlinePlacements({inlineNetLabelPlacements:t,anchoredNetLabelPlacements:n,traces:o}){let r=new Set;for(let i of t){let s=$ot(i),a=n.some((d)=>{let u=np(d);return Qc(s,u)||i.stubTracePath&&$J(i.stubTracePath,u)}),c=o.some((d)=>d.globalConnNetId!==i.globalConnNetId&&($J(d.tracePath,s)||i.stubTracePath&&shi(i.stubTracePath,d))),l=t.some((d)=>d!==i&&d.globalConnNetId!==i.globalConnNetId&&d.stubTracePath&&$J(d.stubTracePath,s)),h=t.some((d)=>d!==i&&Qc(s,$ot(d)));if(a||c||l||h)r.add(hP(i))}for(let i of this.inlineConversions)if(i.placements.some((s)=>r.has(hP(s))))for(let s of i.placements)r.add(hP(s));return r}buildPostProcessedOutput(){let t=this.inlineNetLabelPlacements;while(!0){let n=this.inputNetLabelPlacements.filter((l)=>!sst(l,t)),o=this.getOutputTraces(t),{fixedLabels:r,terminalTraces:i}=ist(this.inputProblem,t),s=new kct({inputProblem:this.inputProblem,traces:[...o,...i],netLabelPlacements:n,fixedNetLabelPlacements:r,netLabelConnectorTraceIds:this.netLabelConnectorTraceIds,useRenderedLabelBounds:t.length>0,preserveNonInlineLabelsAgainstInlineEligibleCollisions:!0});if(t.length>0)s.solve();let a=$li({inputProblem:this.inputProblem,traces:o,netLabelPlacements:s.solved&&!s.failed?s.getOutput().netLabelPlacements:n,inlineNetLabelPlacements:t,netLabelConnectorTraceIds:this.netLabelConnectorTraceIds}),c=this.getBlockedInlinePlacements({inlineNetLabelPlacements:t,anchoredNetLabelPlacements:a.netLabelPlacements,traces:a.traces});if(c.size>0){let l=ehi({inputProblem:this.inputProblem,traces:a.traces,anchoredNetLabelPlacements:a.netLabelPlacements,inlineNetLabelPlacements:t});if(l.movedGroupCount>0){t=l.inlineNetLabelPlacements;continue}let{terminalTraces:h}=ist(this.inputProblem,t),d=t.filter((p)=>!p.stubTracePath),u=t.filter((p)=>p.stubTracePath).sort((p,m)=>Number(c.has(hP(m)))-Number(c.has(hP(p))));for(let p of u){let m=[...this.inputProblem.netConnections,...this.inputProblem.directConnections].find((g)=>g.netId===p.netId&&g.allowInlineNetLabel),A=m?this.computeTerminalInlinePlacement(m,p.pinIds[0],p.globalConnNetId,new Set,{traces:[...a.traces,...h],anchored:a.netLabelPlacements,inline:d}):null;d.push(A??p)}let _=new Map(d.map((p)=>[hP(p),p]));t=t.map((p)=>_.get(hP(p))??p),c=this.getBlockedInlinePlacements({inlineNetLabelPlacements:t,anchoredNetLabelPlacements:a.netLabelPlacements,traces:a.traces})}if(c.size===0){this.inlineNetLabelPlacements=t,this.stats.pushedAnchoredNetLabelCount=a.movedLabelCount;let l=ohi({inputProblem:this.inputProblem,traces:a.traces,netLabelPlacements:a.netLabelPlacements,inlineNetLabelPlacements:t,completedReroutes:this.completedReroutes});this.stats.restoredSupersededLabelRerouteCount=l.restoredTraceCount;let h={traces:l.traces,netLabelConnectorTraceIds:a.netLabelConnectorTraceIds,netLabelPlacements:a.netLabelPlacements,inlineNetLabelPlacements:t};return this.inlineNetLabelPlacements=h.inlineNetLabelPlacements,h}t=t.filter((l)=>!c.has(hP(l)))}}*getTraceRefinementProposals(t){yield*wxn(this.inputProblem,t);for(let n of t.netLabelPlacements){if(n.pinIds.length!==1)continue;let o=[...this.inputProblem.netConnections,...this.inputProblem.directConnections].find((i)=>i.allowInlineNetLabel&&i.netId===n.netId&&i.pinIds.includes(n.pinIds[0]));if(!o)continue;let r=this.computeTerminalInlinePlacement(o,n.pinIds[0],n.globalConnNetId,new Set,{traces:[],anchored:[],inline:[]});if(r)yield*wxn(this.inputProblem,t,[r])}}createRefinementCandidate(t){let n=new Map(t.traces.map((s)=>[s.mspPairId,s])),o=(s)=>JSON.stringify([s.globalConnNetId,[...s.pinIds].sort()]),r=new Map(t.netLabelPlacements.map((s)=>[o(s),s])),i=new Set(this.traces.map((s)=>s.mspPairId));return new e({inputProblem:this.inputProblem,traces:[...this.traces.map((s)=>n.get(s.mspPairId)??s),...t.traces.filter((s)=>!i.has(s.mspPairId))],netLabelPlacements:this.inputNetLabelPlacements.map((s)=>r.get(o(s))??s),completedReroutes:this.completedReroutes,netLabelConnectorTraceIds:t.netLabelConnectorTraceIds})}acceptRefinementCandidate(t,n){let o=this.postProcessedOutput,r=this.refinement.before,i=Bxn(n);if(i.some((a)=>!r.some((c)=>ISn(a,c))))return!1;let s=new Set(t.traces.filter((a,c)=>a!==o.traces[c]).map((a)=>a.mspPairId));if(i.some((a)=>a.kind==="trace-label"&&a.trace.kind==="routed"&&s.has(a.trace.id)))return!1;if(i.length>=r.length&&n.inlineNetLabelPlacements.length<=o.inlineNetLabelPlacements.length)return!1;return this.postProcessedOutput=n,this.inlineNetLabelPlacements=n.inlineNetLabelPlacements,!0}stepTraceRefinement(){if(this.activeSubSolver){if(this.activeSubSolver.step(),!this.activeSubSolver.solved&&!this.activeSubSolver.failed)return;if(this.activeSubSolver.solved&&!this.activeSubSolver.failed&&this.acceptRefinementCandidate(this.currentProposal,this.activeSubSolver.getOutput()))this.refinement=void 0;this.activeSubSolver=null,this.currentProposal=void 0;return}let t=this.postProcessedOutput;if(!this.refinement)this.refinement={proposals:this.getTraceRefinementProposals(t),queue:[],collecting:!0,before:Bxn(t)};let n=this.refinement;if(n.collecting){let r=n.proposals.next();if(!r.done){let i=r.value.traces.reduce((s,a,c)=>s+a.tracePath.reduce((l,h,d)=>{let u=t.traces[c].tracePath[d];return l+Math.abs(h.x-u.x)+Math.abs(h.y-u.y)},0),0);n.queue.push({output:r.value,distance:i})}else n.queue.sort((i,s)=>i.distance-s.distance),n.collecting=!1;return}let o=n.queue.shift();if(!o){this.refinementComplete=!0;return}this.currentProposal=o.output,this.activeSubSolver=this.createRefinementCandidate(o.output)}getOutput(){if(this.postProcessedOutput)return this.postProcessedOutput;return this.buildPostProcessedOutput()}visualize(){return ESn({inputProblem:this.inputProblem,...this.getOutput()})}};var ESn=({inputProblem:e,traces:t,netLabelPlacements:n,inlineNetLabelPlacements:o})=>{let r=Bp(e);r.lines??=[],r.rects??=[],r.points??=[],r.texts??=[];for(let i of t)r.lines.push({points:i.tracePath,strokeColor:"purple"});for(let i of n)r.rects.push({center:i.center,width:i.width,height:i.height,fill:Vc(i.globalConnNetId,0.35),strokeColor:Vc(i.globalConnNetId,0.9),label:`netId: ${i.netId}
globalConnNetId: ${i.globalConnNetId}`}),r.points.push({x:i.anchorPoint.x,y:i.anchorPoint.y,color:Vc(i.globalConnNetId,0.9),label:`anchorPoint
orientation: ${i.orientation}`});for(let i of o){if(i.stubTracePath)r.lines.push({points:i.stubTracePath,strokeColor:"purple"});let s=i.axis==="x",{width:a,height:c}=i;if(!s)a=i.height,c=i.width;r.rects.push({center:i.center,width:a,height:c,fill:Vc(i.globalConnNetId,0.35),strokeColor:"green",label:[`INLINE netId: ${i.netId}`,`axis: ${i.axis}`,`side: ${i.side}`].join(`
`)});let l=i.center.x,h=i.center.y,d="center",u;if(i.stubTracePath){let _=i.stubTracePath[0],p=i.stubTracePath[1],m=i.width/2;if(p[i.axis]>_[i.axis])m=-i.width/2,d="center_left";else d="center_right";if(i.axis==="x")l+=m;else h+=m}if(i.axis==="y")u=90;r.texts.push({x:l,y:h,text:i.netLabelText??i.netId??"",color:"green",fontSize:i.height,anchorSide:d,rotation:u}),r.points.push({x:i.anchorPoint.x,y:i.anchorPoint.y,color:"green",label:`inline anchor
${i.netLabelText??i.netId}`})}return r},Oxn=(e,t=lst)=>{let n=t/0.18;return e.length*0.12*n+0.12*n},chi=(e,t,n=0.1)=>{let o=e.axis==="x"?"x":"y",r=e.start[o],i=e.end[o],s=(r+i)/2,a=Math.sign(i-r)||1,c=(d)=>e.axis==="x"?{x:d,y:e.start.y}:{x:e.start.x,y:e.start.y+(d-r)},l=e.length-t;if(l<=0)return[c(s)];let h=[0];for(let d=n;d<=l/2+0.000000001;d+=n)h.push(d,-d);return h.push(l/2,-l/2),h.map((d)=>c(s+d*a))},$J=(e,t)=>{for(let n=0;n<e.length-1;n++){let o=e[n],r=e[n+1],i={minX:Math.min(o.x,r.x),maxX:Math.max(o.x,r.x),minY:Math.min(o.y,r.y),maxY:Math.max(o.y,r.y)};if(Qc(i,t))return!0}return!1},Q5=0.000001,lhi=({start:e,intendedEnd:t,minimumLength:n,traces:o,ownGlobalConnNetId:r,ignoredTraceIds:i})=>{let s=Math.abs(t.x-e.x)>=Math.abs(t.y-e.y),a=s?"x":"y",c=s?"y":"x",l=Math.sign(t[a]-e[a])||1,h=Math.abs(t[a]-e[a]),d=h;for(let u of o){if(i.has(u.mspPairId))continue;if(u.globalConnNetId===r)continue;for(let _=0;_<u.tracePath.length-1;_++){let p=u.tracePath[_],m=u.tracePath[_+1],A=(p[a]-e[a])*l,g=(m[a]-e[a])*l,f=p[c]-e[c],y=m[c]-e[c],x=Math.min(A,g),C=Math.max(A,g),b=Math.min(f,y),I=Math.max(f,y),v;if(Math.abs(f)<=Q5&&Math.abs(y)<=Q5&&C>=-Q5&&x<=h+Cve+Q5)v=Math.max(0,x);else{let M=b<=Q5&&I>=-Q5,B=(A+g)/2;if(M&&Math.abs(A-g)<=Q5&&B>=-Q5&&B<=h+Cve+Q5)v=Math.max(0,B)}if(v!==void 0)d=Math.min(d,v-Cve)}}if(d+Q5<n)return null;return s?{x:e.x+l*d,y:e.y}:{x:e.x,y:e.y+l*d}},sZ=0.000001,Vxn=({coordinate:e,segmentStartCoordinate:t,segmentEndCoordinate:n})=>e>Math.min(t,n)+sZ&&e<Math.max(t,n)-sZ,hhi=({firstSegmentStart:e,firstSegmentEnd:t,secondSegmentStart:n,secondSegmentEnd:o})=>{let r=Math.abs(e.y-t.y)<=sZ,i=Math.abs(e.x-t.x)<=sZ,s=Math.abs(n.y-o.y)<=sZ,a=Math.abs(n.x-o.x)<=sZ,c,l;if(r)c=e,l=t;else if(s)c=n,l=o;else return!1;let h,d;if(i)h=e,d=t;else if(a)h=n,d=o;else return!1;return Vxn({coordinate:h.x,segmentStartCoordinate:c.x,segmentEndCoordinate:l.x})&&Vxn({coordinate:c.y,segmentStartCoordinate:h.y,segmentEndCoordinate:d.y})},Yxn=(e,t)=>{for(let n=0;n<e.length-1;n++){let o=e[n],r=e[n+1];for(let i of t)for(let s=0;s<i.tracePath.length-1;s++){let a=i.tracePath[s],c=i.tracePath[s+1];if(!K3(o,r,a,c))continue;if(hhi({firstSegmentStart:o,firstSegmentEnd:r,secondSegmentStart:a,secondSegmentEnd:c}))continue;return!0}}return!1},dhi=(e)=>{let t={},n=new Map;for(let o of e.chips){t[o.chipId]=o;for(let r of o.pins)n.set(r.pinId,{...r,chipId:o.chipId,_facingDirection:r._facingDirection??E6(r,o)})}return{chipMap:t,pinMap:n}},Gxn=(e,t)=>{let n=Pp(e._facingDirection),o=Pp(t._facingDirection),r=t.x-e.x,i=t.y-e.y;if((n.x?Math.abs(i)<=0.000001:Math.abs(r)<=0.000001)&&n.x===-o.x&&n.y===-o.y&&r*n.x+i*n.y>0.000001)return[{x:e.x,y:e.y},{x:t.x,y:t.y}];if(n.x*o.x||n.y*o.y)return;let a=n.x?{x:t.x,y:e.y}:{x:e.x,y:t.y};for(let[c,l]of[[e,n],[t,o]])if((a.x-c.x)*l.x+(a.y-c.y)*l.y<=0.000001)return;return[{x:e.x,y:e.y},a,{x:t.x,y:t.y}]},zue=0.000000001,bve=(e,t)=>Math.abs(e.y-t.y)<zue,Ive=(e,t)=>Math.abs(e.x-t.x)<zue,uhi=(e)=>e.filter((t,n)=>{let o=e[n-1];return!o||Math.abs(t.x-o.x)>=zue||Math.abs(t.y-o.y)>=zue}),phi=(e)=>{if(e.length<2||!e.every((t,n)=>{let o=e[n+1];if(!o)return!0;return bve(t,o)||Ive(t,o)}))return!1;for(let t=0;t<e.length-1;t++)for(let n=t+2;n<e.length-1;n++)if(iSn(e[t],e[t+1],e[n],e[n+1]))return!1;return!0},mhi=(e)=>{let t=[];for(let n=2;n<=e.length-4;n++){let o=e[n-1],r=e[n],i=e[n+1],s=e[n+2],a=Ive(r,i),c=bve(r,i);if(!a&&!c||a&&(!bve(o,r)||!bve(i,s))||c&&(!Ive(o,r)||!Ive(i,s)))continue;let l=a?[o.x,s.x]:[o.y,s.y];for(let h of l){if(Math.abs(h-(a?r.x:r.y))<zue)continue;let d=e.map((_)=>({..._}));if(a)d[n].x=h,d[n+1].x=h;else d[n].y=h,d[n+1].y=h;let u=uhi(d);if(phi(u))t.push(u)}}return t},Uxn=({tracePath:e,globalConnNetId:t,otherTraces:n})=>n.reduce((o,r)=>o+(r.globalConnNetId===t?0:YP(e,r.tracePath)),0),_hi=({tracePath:e,globalConnNetId:t,otherTraces:n,isCandidateValid:o})=>{let r=e,i=Uxn({tracePath:e,globalConnNetId:t,otherTraces:n}),s=V5(e);for(let a of mhi(e)){if(!o(a))continue;let c=Uxn({tracePath:a,globalConnNetId:t,otherTraces:n}),l=V5(a);if(c<i||c===i&&l<s)r=a,i=c,s=l}return r},ghi="net-label-to-trace-",Ahi=0.05,qot=0.25,Wxn=(e,t)=>[e,t].sort().join("--"),Jot=(e,t)=>{let n=Math.abs(e.x-t.x),o=Math.abs(e.y-t.y);if(n>=o)return o;return n},fhi=(e,t)=>{if(e._facingDirection!==t._facingDirection)return!1;let n=Math.abs(e.x-t.x),o=Math.abs(e.y-t.y);if(n>=o)return e._facingDirection==="x+"||e._facingDirection==="x-";return e._facingDirection==="y+"||e._facingDirection==="y-"},Xxn=class extends Gu{constructor(e,t={}){super();this.input=e,this.options=t,this.inputProblem=e.inputProblem,this.outputTraces=[...e.traces],this.outputNetLabelPlacements=[...e.netLabelPlacements];let{chipMap:n,pinMap:o}=dhi(this.inputProblem);this.chipMap=n,this.pinMap=o,this.canRecoverParallelPair=W7n(this.inputProblem,S6(this.inputProblem).netConnMap,new Set(e.traces.filter((r)=>r.pinIds.length>1).flatMap((r)=>r.pinIds))),this.queuedCandidates=this.buildCandidatePairs(),this.stats.candidateCount=this.queuedCandidates.length,this.stats.recoveredTraceCount=0}input;options;inputProblem;outputTraces;outputNetLabelPlacements;recoveredTraceIds=new Set;chipMap;pinMap;canRecoverParallelPair;queuedCandidates;currentCandidate=null;getConstructorParams(){return[this.input,this.options]}isPortOnlyFallbackLabel(e,t){return!(e.pinIds.length!==1||e.mspConnectionPairIds.length!==0||!e.netId||t.has(e.globalConnNetId))}isDirectConnectionLabel(e){if(!e.netId||e.pinIds.length!==1)return!1;let t=e.pinIds[0];return this.inputProblem.directConnections.some((n)=>n.netId===e.netId&&n.pinIds.includes(t))}getMultiPinNetConnection(e){if(!e.netId||e.pinIds.length!==1)return;let t=e.pinIds[0];return this.inputProblem.netConnections.find((n)=>n.isGround===!1&&n.pinIds.length>2&&n.netId===e.netId&&n.pinIds.includes(t))}getTwoPinNetConnection(e){return this.inputProblem.netConnections.find((t)=>!t.isGround&&t.pinIds.length===2&&t.netId===e.netId&&t.pinIds.includes(e.pinIds[0]))}buildCandidatePairs(){let{netConnMap:e}=S6(this.inputProblem),t=new Set;for(let i of this.inputProblem.netConnections){if(!i.isGround)continue;let s=e.getNetConnectedToId(i.netId);if(s)t.add(s)}let n=new Map;for(let i of this.input.netLabelPlacements){if(!this.isPortOnlyFallbackLabel(i,t)||!this.isDirectConnectionLabel(i)&&!this.getMultiPinNetConnection(i)&&!this.getTwoPinNetConnection(i))continue;let s=n.get(i.globalConnNetId)??[];s.push(i),n.set(i.globalConnNetId,s)}let o=[];for(let i of n.values())for(let s=0;s<i.length;s++)for(let a=s+1;a<i.length;a++){let c=i[s],l=i[a],h=this.pinMap.get(c.pinIds[0]),d=this.pinMap.get(l.pinIds[0]);if(!h||!d)continue;if(!this.canRecoverParallelPair(h,d))continue;let u=Jot(h,d),_=this.isDirectConnectionLabel(c)&&this.isDirectConnectionLabel(l),p=this.getMultiPinNetConnection(c),m=this.getMultiPinNetConnection(l),A=this.getTwoPinNetConnection(c),g=!_&&A&&h.chipId!==d.chipId&&A===this.getTwoPinNetConnection(l)?Gxn(h,d):void 0;if(!g&&!_&&(!p||p!==m||u>Ahi))continue;if(lL(this.inputProblem,h,d))continue;if(qde({inputProblem:this.inputProblem,chipMap:this.chipMap,pinIdMap:this.pinMap,p1:h,p2:d}))continue;o.push({firstLabel:c,secondLabel:l,pins:[h,d],perpendicularOffset:u,routeDistance:Math.abs(h.x-d.x)+Math.abs(h.y-d.y),key:Wxn(h.pinId,d.pinId),recoveryMode:"fallback_labels",simpleConnectionPath:g})}o.push(...this.buildRoutedComponentCandidates(t));let r=this.options.onlyInlineDirectConnections||this.options.onlyInlineConnections?o.filter((i)=>this.options.onlyInlineConnections&&i.simpleConnectionPath?.length===2&&this.inputProblem.netConnections.some((s)=>s.allowInlineNetLabel&&!s.isGround&&s.pinIds.length===2&&i.pins.every((a)=>s.pinIds.includes(a.pinId)))||this.inputProblem.directConnections.some((s)=>i.pins.every((a)=>s.pinIds.includes(a.pinId))&&(s.allowInlineNetLabel||this.inputProblem.netConnections.some((a)=>a.allowInlineNetLabel&&i.pins.every((c)=>a.pinIds.includes(c.pinId)))))):o;return r.sort((i,s)=>i.perpendicularOffset-s.perpendicularOffset||i.routeDistance-s.routeDistance||i.key.localeCompare(s.key)),r}buildRoutedComponentCandidates(e){let{netConnMap:t}=S6(this.inputProblem),n=[],o=new Set(this.inputProblem.directConnections);for(let r of[...this.inputProblem.netConnections.filter((i)=>i.pinIds.length>2&&i.isGround===!1),...this.inputProblem.directConnections]){let i=o.has(r),s=i&&(this.options.onlyInlineDirectConnections||this.options.onlyInlineConnections),a=t.getNetConnectedToId(r.pinIds[0]);if(!a||i&&e.has(a))continue;let c=r.pinIds;if(i)c=[...this.pinMap.keys()].filter((h)=>t.getNetConnectedToId(h)===a);let l=g8e({pinIds:c,traces:this.outputTraces.filter((h)=>h.globalConnNetId===a)}).filter((h)=>h.traces.length>0);for(let h=0;h<l.length;h++)for(let d=h+1;d<l.length;d++){let u=l[h],_=l[d];if(i&&!(u.pinIds.includes(r.pinIds[0])&&_.pinIds.includes(r.pinIds[1])||u.pinIds.includes(r.pinIds[1])&&_.pinIds.includes(r.pinIds[0])))continue;let p=this.input.netLabelPlacements.find((x)=>x.globalConnNetId===a&&x.mspConnectionPairIds.length>0&&x.pinIds.some((C)=>u.pinIds.includes(C))),m=this.input.netLabelPlacements.find((x)=>x.globalConnNetId===a&&x.mspConnectionPairIds.length>0&&x.pinIds.some((C)=>_.pinIds.includes(C)));if(!p||!m||p===m)continue;let A=Jot(p.anchorPoint,m.anchorPoint)<=qot;if(!A&&!s)continue;let g,f=u.pinIds,y=_.pinIds;if(i)f=r.pinIds.filter((x)=>u.pinIds.includes(x)),y=r.pinIds.filter((x)=>_.pinIds.includes(x));for(let x of f)for(let C of y){let b=this.pinMap.get(x),I=this.pinMap.get(C);if(!b||!I)continue;if(!this.canRecoverParallelPair(b,I))continue;if(i&&b.chipId===I.chipId)continue;let v=Jot(b,I),P=s&&(!A||v>qot)?Gxn(b,I):void 0;if((!A||v>qot)&&!P||fhi(b,I)||lL(this.inputProblem,b,I)||qde({inputProblem:this.inputProblem,chipMap:this.chipMap,pinIdMap:this.pinMap,p1:b,p2:I}))continue;let M=Math.abs(b.x-I.x)+Math.abs(b.y-I.y),B="routed_components";if(i)B="routed_direct_connection";let T={firstLabel:p,secondLabel:m,pins:[b,I],perpendicularOffset:v,routeDistance:M,key:Wxn(b.pinId,I.pinId),recoveryMode:B,netConnectionPinIds:c,simpleConnectionPath:P};if(!g||T.routeDistance<g.routeDistance||T.routeDistance===g.routeDistance&&(T.perpendicularOffset<g.perpendicularOffset||T.perpendicularOffset===g.perpendicularOffset&&T.key.localeCompare(g.key)<0))g=T}if(g)n.push(g)}}return n}isSupersededConnectorTrace(e,t){if(!this.input.netLabelConnectorTraceIds?.has(e.mspPairId))return!1;if(e.pinIds.length!==1)return!1;return t.pins.some((n)=>n.pinId===e.pinIds[0])}routeIntersectsRemainingLabels(e,t){for(let n of this.outputNetLabelPlacements){if(n===t.firstLabel||n===t.secondLabel)continue;if(ast(e,n))return!0}return this.input.inlineNetLabelPlacements.some((n)=>ast(e,n))}tryAcceptCurrentRoute(){let e=this.currentCandidate,t=this.activeSubSolver?.solvedTracePath;if(!e||!t)return;let n=this.outputTraces.filter((c)=>!this.isSupersededConnectorTrace(c,e)),o=n;if(e.recoveryMode!=="fallback_labels")o=n.filter((c)=>c.globalConnNetId!==e.firstLabel.globalConnNetId);if(e.simpleConnectionPath){if(t=e.simpleConnectionPath,uT(t,this.activeSubSolver.obstacles)||o.reduce((c,l)=>c+xG(t,l.tracePath,{includeTerminalSegments:!0}).length,0)>1)return}if(Yxn(t,o)||this.routeIntersectsRemainingLabels(t,e))return;t=_hi({tracePath:t,globalConnNetId:e.firstLabel.globalConnNetId,otherTraces:o,isCandidateValid:(c)=>uT(c,this.activeSubSolver.obstacles)===null&&!Yxn(c,o)&&!this.routeIntersectsRemainingLabels(c,e)});let[r,i]=e.pins,s=`${ghi}${e.key}`,a={mspPairId:s,dcConnNetId:e.firstLabel.globalConnNetId,globalConnNetId:e.firstLabel.globalConnNetId,pins:[r,i],tracePath:t,mspConnectionPairIds:[s],pinIds:[r.pinId,i.pinId]};if(this.recoveredTraceIds.add(s),this.outputTraces=[...n,a],e.recoveryMode!=="routed_components")this.outputNetLabelPlacements=this.outputNetLabelPlacements.filter((c)=>c!==e.firstLabel&&c!==e.secondLabel);this.stats.recoveredTraceCount++}areCandidatePinsAlreadyConnected(e){if(!e.netConnectionPinIds)return!1;return g8e({pinIds:e.netConnectionPinIds,traces:this.outputTraces}).some((t)=>t.pinIds.includes(e.pins[0].pinId)&&t.pinIds.includes(e.pins[1].pinId))}_step(){if(this.activeSubSolver){if(this.activeSubSolver.step(),this.activeSubSolver.solved)this.tryAcceptCurrentRoute(),this.activeSubSolver=null,this.currentCandidate=null;else if(this.activeSubSolver.failed)this.activeSubSolver=null,this.currentCandidate=null;return}let e=this.queuedCandidates.shift();while(e&&(!this.outputNetLabelPlacements.includes(e.firstLabel)||!this.outputNetLabelPlacements.includes(e.secondLabel)||this.areCandidatePinsAlreadyConnected(e)))e=this.queuedCandidates.shift();if(!e){this.solved=!0;return}this.currentCandidate=e,this.activeSubSolver=new kZ({inputProblem:this.inputProblem,pins:e.pins,chipMap:this.chipMap})}getOutput(){return{traces:this.outputTraces,netLabelPlacements:this.outputNetLabelPlacements,inlineNetLabelPlacements:this.input.inlineNetLabelPlacements}}visualize(){if(this.activeSubSolver)return this.activeSubSolver.visualize();let e=ESn({inputProblem:this.inputProblem,...this.getOutput()});for(let t of this.outputTraces){if(!this.recoveredTraceIds.has(t.mspPairId))continue;e.lines.push({points:t.tracePath,strokeColor:"green",label:`recovered from net labels: ${t.pinIds.join(" -> ")}`})}return e}};function su(e,t,n,o={}){return{solverName:e,solverClass:t,getConstructorParams:n,onSolved:o.onSolved,shouldSkip:o.shouldSkip}}var MSn=class extends Gu{getSolverName(){return"SchematicTracePipelineSolver"}mspConnectionPairSolver;schematicTraceLinesSolver;longDistancePairSolver;unroutedTraceRecoverySolver;traceOverlapShiftSolver;netLabelPlacementSolver;labelMergingSolver;traceLabelOverlapAvoidanceSolver;traceCleanupSolver;example28Solver;availableNetOrientationSolver;postLabelTraceOverlapShiftSolver;railNetLabelCornerPlacementSolver;traceAnchoredNetLabelOverlapSolver;finalTraceAnchoredNetLabelOverlapSolver;preAlignmentNetLabelTraceCollisionSolver;netLabelTraceCollisionSolver;traceCleanupSolver2;netLabelNetLabelCollisionSolver;finalRailNetLabelCornerPlacementSolver;traceElbowTransitionSimplificationSolver;preAlignmentTraceElbowTransitionSimplificationSolver;finalTraceElbowTransitionSimplificationSolver;sameNetJunctionAlignmentSolver;inlineDirectTraceRecoverySolver;inlineNetLabelSolver;netLabelToTraceSolver;startTimeOfPhase;endTimeOfPhase;timeSpentOnPhase;firstIterationOfPhase;inputProblem;hideRatsNet;pipelineDef=[su("mspConnectionPairSolver",Jri,()=>[{inputProblem:this.inputProblem}],{onSolved:(e)=>{}}),su("schematicTraceLinesSolver",Aii,()=>[{mspConnectionPairs:this.mspConnectionPairSolver.mspConnectionPairs,dcConnMap:this.mspConnectionPairSolver.dcConnMap,globalConnMap:this.mspConnectionPairSolver.globalConnMap,inputProblem:this.inputProblem,chipMap:this.mspConnectionPairSolver.chipMap}]),su("longDistancePairSolver",nsi,(e)=>[{inputProblem:e.inputProblem,primaryMspConnectionPairs:e.mspConnectionPairSolver.mspConnectionPairs,alreadySolvedTraces:e.schematicTraceLinesSolver.solvedTracePaths,failedConnectionPairs:e.schematicTraceLinesSolver.failedConnectionPairs}],{onSolved:(e)=>{}}),su("unroutedTraceRecoverySolver",rli,(e)=>[{inputProblem:e.inputProblem,failedConnectionPairs:e.schematicTraceLinesSolver.failedConnectionPairs,alreadySolvedTraces:e.longDistancePairSolver.getOutput().allTracesMerged}]),su("traceOverlapShiftSolver",Pyn,()=>[{inputProblem:this.inputProblem,inputTracePaths:this.unroutedTraceRecoverySolver?.getOutput().allTracesMerged,globalConnMap:this.mspConnectionPairSolver.globalConnMap}],{onSolved:(e)=>{}}),su("netLabelPlacementSolver",Byn,()=>[{inputProblem:this.inputProblem,inputTraceMap:this.traceOverlapShiftSolver?.correctedTraceMap??Object.fromEntries(this.unroutedTraceRecoverySolver.getOutput().allTracesMerged.map((e)=>[e.mspPairId,e]))}],{onSolved:(e)=>{}}),su("traceLabelOverlapAvoidanceSolver",Xii,(e)=>{let t=e.traceOverlapShiftSolver?.correctedTraceMap??Object.fromEntries(e.unroutedTraceRecoverySolver.getOutput().allTracesMerged.map((r)=>[r.mspPairId,r])),n=Object.values(t),o=e.netLabelPlacementSolver.netLabelPlacements;return[{inputProblem:e.inputProblem,traces:n,netLabelPlacements:o}]}),su("traceElbowTransitionSimplificationSolver",Uot,(e)=>{let t=e.traceLabelOverlapAvoidanceSolver.getOutput();return[{inputProblem:e.inputProblem,traces:t.traces,completedReroutes:t.completedReroutes,netLabelPlacements:e.traceLabelOverlapAvoidanceSolver.netLabelPlacements,paddingBuffer:0.1}]}),su("traceCleanupSolver",qyn,(e)=>{let n=e.traceElbowTransitionSimplificationSolver.getOutput().traces,o=e.traceOverlapShiftSolver,r=new Set([...e.inputProblem.directConnections,...e.inputProblem.netConnections].filter((a)=>a.allowInlineNetLabel).map((a)=>a.netId)),i=new Set;for(let a=0;a<o.inputTracePaths.length;a++){let c=o.inputTracePaths[a],l=o.correctedTraceMap[c.mspPairId];for(let h=a+1;h<o.inputTracePaths.length;h++){let d=o.inputTracePaths[h];if(c.globalConnNetId===d.globalConnNetId)continue;if(!r.has(c.userNetId??"")&&!r.has(d.userNetId??""))continue;let u=o.correctedTraceMap[d.mspPairId],_=xG(c.tracePath,d.tracePath).length;if(xG(l.tracePath,u.tracePath).length>_)i.add(c.mspPairId),i.add(d.mspPairId)}}let s=e.traceLabelOverlapAvoidanceSolver.labelMergingSolver.getOutput();return[{inputProblem:e.inputProblem,allTraces:n,allLabelPlacements:s.netLabelPlacements,mergedLabelNetIdMap:s.mergedLabelNetIdMap,paddingBuffer:0.1,eligibleTraceIds:i}]}),su("netLabelPlacementSolver",Byn,(e)=>{let t=e.traceCleanupSolver?.getOutput().traces??e.traceLabelOverlapAvoidanceSolver.getOutput().traces;return[{inputProblem:e.inputProblem,inputTraceMap:Object.fromEntries(t.map((n)=>[n.mspPairId,n]))}]}),su("example28Solver",Bai,(e)=>{let t=e.traceCleanupSolver?.getOutput().traces??e.traceLabelOverlapAvoidanceSolver.getOutput().traces;return[{inputProblem:e.inputProblem,traces:t,netLabelPlacements:e.netLabelPlacementSolver.netLabelPlacements}]}),su("availableNetOrientationSolver",Vai,(e)=>[{inputProblem:e.inputProblem,traces:e.example28Solver.outputTraces,netLabelPlacements:e.example28Solver.outputNetLabelPlacements}]),su("postLabelTraceOverlapShiftSolver",Pyn,(e)=>[{inputProblem:e.inputProblem,inputTracePaths:e.availableNetOrientationSolver.traces,globalConnMap:e.mspConnectionPairSolver.globalConnMap,traceIdsToShift:new Set(e.availableNetOrientationSolver.netLabelConnectorTraceIds)}]),su("railNetLabelCornerPlacementSolver",ixn,(e)=>[{inputProblem:e.inputProblem,traces:Object.values(e.postLabelTraceOverlapShiftSolver.correctedTraceMap),netLabelPlacements:e.availableNetOrientationSolver.outputNetLabelPlacements,netLabelConnectorTraceIds:e.availableNetOrientationSolver.netLabelConnectorTraceIds}]),su("traceAnchoredNetLabelOverlapSolver",pxn,(e)=>[{inputProblem:e.inputProblem,netLabelConnectorTraceIds:e.availableNetOrientationSolver.netLabelConnectorTraceIds,traces:e.railNetLabelCornerPlacementSolver.getOutput().traces,netLabelPlacements:e.railNetLabelCornerPlacementSolver.outputNetLabelPlacements}]),su("preAlignmentNetLabelTraceCollisionSolver",_xn,(e)=>[{inputProblem:e.inputProblem,traces:e.railNetLabelCornerPlacementSolver.getOutput().traces,netLabelPlacements:e.traceAnchoredNetLabelOverlapSolver.outputNetLabelPlacements}]),su("preAlignmentTraceElbowTransitionSimplificationSolver",Uot,(e)=>{let t=e.preAlignmentNetLabelTraceCollisionSolver.getOutput();return[{inputProblem:e.inputProblem,traces:t.traces,completedReroutes:t.completedReroutes,netLabelPlacements:t.netLabelPlacements,paddingBuffer:0.1,allowShorterPaths:!0}]}),su("traceCleanupSolver2",qyn,(e)=>{let t=e.preAlignmentTraceElbowTransitionSimplificationSolver.getOutput(),n=e.traceLabelOverlapAvoidanceSolver.labelMergingSolver.getOutput();return[{inputProblem:e.inputProblem,allTraces:t.traces,allLabelPlacements:t.netLabelPlacements,mergedLabelNetIdMap:n.mergedLabelNetIdMap,paddingBuffer:0.1,operations:["rerouting_generated_net_label_connector_crossings","aligning_same_net_rails"],eligibleTraceIds:new Set(e.traceCleanupSolver.getOutput().traces.map((o)=>o.mspPairId)),netLabelConnectorTraceIds:e.availableNetOrientationSolver.netLabelConnectorTraceIds}]}),su("netLabelTraceCollisionSolver",_xn,(e)=>{let t=e.preAlignmentNetLabelTraceCollisionSolver.getOutput(),n=e.traceCleanupSolver2.getOutput(),o=rai({originalTraces:t.traces,reroutedTraces:n.traces,netLabelPlacements:t.netLabelPlacements}),r=new Map(t.traces.map((s)=>[s.mspPairId,s])),i=o.netLabelPlacements;for(let s of o.traces){let a=r.get(s.mspPairId);if(!a||a.tracePath===s.tracePath)continue;let c=i;i=eee({trace:a,originalTracePath:a.tracePath,reroutedTracePath:s.tracePath,netLabelPlacements:c}).map((h,d)=>{let u=c[d];return u.orientation==="y+"||u.orientation==="y-"?h:u})}return[{inputProblem:e.inputProblem,traces:o.traces,netLabelPlacements:i}]}),su("finalTraceElbowTransitionSimplificationSolver",Uot,(e)=>{let t=e.netLabelTraceCollisionSolver.getOutput(),n=[...e.traceLabelOverlapAvoidanceSolver.getOutput().completedReroutes,...e.preAlignmentNetLabelTraceCollisionSolver.getOutput().completedReroutes,...t.completedReroutes];return[{inputProblem:e.inputProblem,traces:t.traces,completedReroutes:n,netLabelPlacements:t.netLabelPlacements,paddingBuffer:0.1,allowShorterPaths:!0}]}),su("finalRailNetLabelCornerPlacementSolver",ixn,(e)=>[{inputProblem:e.inputProblem,...e.finalTraceElbowTransitionSimplificationSolver.getOutput(),originalTraces:e.railNetLabelCornerPlacementSolver.getOutput().traces,netLabelConnectorTraceIds:e.availableNetOrientationSolver.netLabelConnectorTraceIds,onlyOverlappingLabels:!0}]),su("netLabelNetLabelCollisionSolver",kct,(e)=>{let t=e.finalRailNetLabelCornerPlacementSolver.getOutput();return[{inputProblem:e.inputProblem,traces:t.traces,netLabelPlacements:t.netLabelPlacements,preserveNonInlineLabelsAgainstInlineEligibleCollisions:!0}]}),su("finalTraceAnchoredNetLabelOverlapSolver",pxn,(e)=>[{inputProblem:e.inputProblem,netLabelConnectorTraceIds:e.availableNetOrientationSolver.netLabelConnectorTraceIds,traces:e.netLabelNetLabelCollisionSolver.traces,netLabelPlacements:e.netLabelNetLabelCollisionSolver.getOutput().netLabelPlacements,overlapMode:"traces"}]),su("sameNetJunctionAlignmentSolver",Nli,(e)=>{let t=e.finalTraceAnchoredNetLabelOverlapSolver.getOutput();return[{inputProblem:e.inputProblem,traces:e.netLabelNetLabelCollisionSolver.traces,netLabelPlacements:t.netLabelPlacements,netLabelConnectorTraceIds:e.availableNetOrientationSolver.netLabelConnectorTraceIds}]}),su("inlineDirectTraceRecoverySolver",Xxn,(e)=>[{inputProblem:e.inputProblem,...e.sameNetJunctionAlignmentSolver.getOutput(),inlineNetLabelPlacements:[],netLabelConnectorTraceIds:e.availableNetOrientationSolver.netLabelConnectorTraceIds},{onlyInlineConnections:!0}]),su("inlineNetLabelSolver",ahi,(e)=>{let t=e.inlineDirectTraceRecoverySolver.getOutput(),n=[...e.traceLabelOverlapAvoidanceSolver.getOutput().completedReroutes,...e.preAlignmentNetLabelTraceCollisionSolver.getOutput().completedReroutes,...e.netLabelTraceCollisionSolver.getOutput().completedReroutes];return[{inputProblem:e.inputProblem,traces:t.traces,netLabelPlacements:t.netLabelPlacements,completedReroutes:n,resolveTraceCollisions:!0,netLabelConnectorTraceIds:e.availableNetOrientationSolver.netLabelConnectorTraceIds}]}),su("netLabelToTraceSolver",Xxn,(e)=>{let t=e.inlineNetLabelSolver.getOutput();return[{inputProblem:e.inputProblem,...t}]})];constructor(e,t){super();this.hideRatsNet=t?.hideRatsNet??!1,this.inputProblem=this.cloneAndCorrectInputProblem(e),this.MAX_ITERATIONS=1e6,this.startTimeOfPhase={},this.endTimeOfPhase={},this.timeSpentOnPhase={},this.firstIterationOfPhase={}}getConstructorParams(){return[this.inputProblem,{hideRatsNet:this.hideRatsNet}]}currentPipelineStepIndex=0;cloneAndCorrectInputProblem(e){let t=structuredClone({...e,_chipObstacleSpatialIndex:void 0,_hideRatsNet:this.hideRatsNet});return jii(t),t}_step(){let e=this.pipelineDef[this.currentPipelineStepIndex];if(!e){this.solved=!0;return}if(this.activeSubSolver){if(this.activeSubSolver.step(),this.activeSubSolver.solved)this.endTimeOfPhase[e.solverName]=performance.now(),this.timeSpentOnPhase[e.solverName]=this.endTimeOfPhase[e.solverName]-this.startTimeOfPhase[e.solverName],e.onSolved?.(this),this.activeSubSolver=null,this.currentPipelineStepIndex++;else if(this.activeSubSolver.failed)this.error=this.activeSubSolver?.error,this.failed=!0,this.activeSubSolver=null;return}let t=e.getConstructorParams(this);this.activeSubSolver=new e.solverClass(...t),this[e.solverName]=this.activeSubSolver,this.timeSpentOnPhase[e.solverName]=0,this.startTimeOfPhase[e.solverName]=performance.now(),this.firstIterationOfPhase[e.solverName]=this.iterations}solveUntilPhase(e){while(this.getCurrentPhase().toLowerCase()!==e.toLowerCase())this.step()}getCurrentPhase(){return this.pipelineDef[this.currentPipelineStepIndex]?.solverName??"none"}visualize(){if(!this.solved&&this.activeSubSolver)return this.activeSubSolver.visualize();let e=[Bp(this.inputProblem,{hideRatsNet:this.hideRatsNet}),...this.pipelineDef.map((n)=>this[n.solverName]?.visualize()).filter(Boolean).map((n,o)=>{for(let r of n.rects??[])r.step=o;for(let r of n.points??[])r.step=o;for(let r of n.circles??[])r.step=o;for(let r of n.texts??[])r.step=o;for(let r of n.lines??[])r.step=o;return n})];if(e.length===1)return e[0];let t={points:e.flatMap((n)=>n.points||[]),rects:e.flatMap((n)=>n.rects||[]),lines:e.flatMap((n)=>n.lines||[]),circles:e.flatMap((n)=>n.circles||[]),texts:e.flatMap((n)=>n.texts||[])};return Tii(t,this.inputProblem),t}preview(){if(this.activeSubSolver)return this.activeSubSolver.preview();return super.preview()}},Zot=0.00000001,yhi=(e,t,n)=>{let o=(e.y-t.y)*(n.x-t.x)-(e.x-t.x)*(n.y-t.y);if(Math.abs(o)>Zot)return!1;let r=(e.x-t.x)*(n.x-t.x)+(e.y-t.y)*(n.y-t.y);if(r<-Zot)return!1;let i=(n.x-t.x)**2+(n.y-t.y)**2;return r<=i+Zot},jxn=(e,t)=>{let n=!1;for(let o=0,r=t.vertices.length-1;o<t.vertices.length;r=o++){let i=t.vertices[o],s=t.vertices[r];if(yhi(e,s,i))return!0;if(i.y>e.y!==s.y>e.y&&e.x<(s.x-i.x)*(e.y-i.y)/(s.y-i.y)+i.x)n=!n}return n},xhi=(e,t)=>jxn(e,t.outer_ring)&&!t.inner_rings.some((n)=>jxn(e,n)),Chi=(e,t)=>t.some((n)=>xhi(e,n)),Kxn=(e)=>{let t=e.flatMap((n)=>n.outer_ring.vertices);if(t.length===0)return;return{minX:Math.min(...t.map((n)=>n.x)),maxX:Math.max(...t.map((n)=>n.x)),minY:Math.min(...t.map((n)=>n.y)),maxY:Math.max(...t.map((n)=>n.y))}},$xn=({center:e,radius:t,shapes:n})=>{let o=[e];for(let r=0;r<32;r++){let i=r/32*Math.PI*2;o.push({x:e.x+Math.cos(i)*t,y:e.y+Math.sin(i)*t})}return o.every((r)=>Chi(r,n))},ert=(e,t)=>t.some((n)=>String(n)===String(e)),bhi=(e)=>{if(e.do_not_place||!e.obstructs_within_bounds)return;return{kind:"rect",center:e.center,width:e.width,height:e.height,ccwRotation:e.rotation}},Ihi=(e)=>{if(e.shape==="circle")return{kind:"circle",center:{x:e.x,y:e.y},radius:e.radius};if(e.shape==="polygon")return{kind:"polygon",points:e.points};return{kind:"rect",center:{x:e.x,y:e.y},width:e.width,height:e.height,ccwRotation:e.shape==="rotated_rect"||e.shape==="rotated_pill"?e.ccw_rotation:0}},vhi=(e)=>{if(e.shape==="circle")return{kind:"circle",center:{x:e.x,y:e.y},radius:e.outer_diameter/2};if("outer_width"in e)return{kind:"rect",center:{x:e.x,y:e.y},width:e.outer_width,height:e.outer_height,ccwRotation:e.ccw_rotation};if(e.shape==="hole_with_polygon_pad"){let t=(e.ccw_rotation??0)*Math.PI/180,n=Math.cos(t),o=Math.sin(t);return{kind:"polygon",points:e.pad_outline.map((r)=>({x:e.x+r.x*n-r.y*o,y:e.y+r.x*o+r.y*n}))}}return{kind:"rect",center:{x:e.x,y:e.y},width:e.rect_pad_width,height:e.rect_pad_height,ccwRotation:"rect_ccw_rotation"in e?e.rect_ccw_rotation??0:0}},Shi=(e)=>{if("hole_diameter"in e){if(e.hole_shape==="circle")return{kind:"circle",center:{x:e.x,y:e.y},radius:e.hole_diameter/2};return{kind:"rect",center:{x:e.x,y:e.y},width:e.hole_diameter,height:e.hole_diameter,ccwRotation:0}}return{kind:"rect",center:{x:e.x,y:e.y},width:e.hole_width,height:e.hole_height,ccwRotation:e.hole_shape==="rotated_pill"?e.ccw_rotation:0}},Phi=(e,t,n)=>{let o=n.x-t.x,r=n.y-t.y,i=o**2+r**2;if(i===0)return Math.hypot(e.x-t.x,e.y-t.y);let s=Math.max(0,Math.min(1,((e.x-t.x)*o+(e.y-t.y)*r)/i));return Math.hypot(e.x-(t.x+s*o),e.y-(t.y+s*r))},Ehi=(e,t)=>{let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o],s=t[r];if(i.y>e.y!==s.y>e.y&&e.x<(s.x-i.x)*(e.y-i.y)/(s.y-i.y)+i.x)n=!n}return n},Mhi=(e,t,n)=>{if(n.kind==="circle")return Math.hypot(e.x-n.center.x,e.y-n.center.y)<t+n.radius;if(n.kind==="polygon"){if(Ehi(e,n.points))return!0;return n.points.some((h,d)=>Boolean(Phi(e,h,n.points[(d+1)%n.points.length])<t))}let o=-n.ccwRotation*Math.PI/180,r=e.x-n.center.x,i=e.y-n.center.y,s=r*Math.cos(o)-i*Math.sin(o),a=r*Math.sin(o)+i*Math.cos(o),c=Math.max(Math.abs(s)-n.width/2,0),l=Math.max(Math.abs(a)-n.height/2,0);return Math.hypot(c,l)<t},whi=(e,t)=>e.flatMap((n)=>{if(n.type==="pcb_component"&&ert(n.layer,t)){let o=bhi(n);return o?[o]:[]}if(n.type==="pcb_smtpad"&&ert(n.layer,t))return[Ihi(n)];if(n.type==="pcb_plated_hole"&&n.layers.some((o)=>ert(o,t)))return[vhi(n)];if(n.type==="pcb_hole")return[Shi(n)];return[]}),Bhi=({center:e,radius:t,obstacles:n})=>n.some((o)=>Mhi(e,t,o)),Thi=(e={})=>{let t={sourceNetIds:e.sourceNetIds?new Set(e.sourceNetIds):void 0,layers:e.layers??["top","bottom"],viaStitchPitch:e.viaStitchPitch??1,viaHoleDiameter:e.viaHoleDiameter??0.3,viaOuterDiameter:e.viaOuterDiameter??0.6,pourEdgeClearance:e.pourEdgeClearance??0.2,obstacleClearance:e.obstacleClearance??0.2,minimumViaSeparation:e.minimumViaSeparation??Math.max(e.viaOuterDiameter??0.6,0.8),gridOrigin:e.gridOrigin??{x:0,y:0},isTented:e.isTented??!0};for(let[n,o]of[["viaStitchPitch",t.viaStitchPitch],["viaHoleDiameter",t.viaHoleDiameter],["viaOuterDiameter",t.viaOuterDiameter],["minimumViaSeparation",t.minimumViaSeparation]])if(!Number.isFinite(o)||o<=0)throw Error(`${n} must be a finite number greater than zero`);if(!Number.isFinite(t.pourEdgeClearance)||t.pourEdgeClearance<0)throw Error("pourEdgeClearance must be a finite non-negative number");if(!Number.isFinite(t.obstacleClearance)||t.obstacleClearance<0)throw Error("obstacleClearance must be a finite non-negative number");if(!Number.isFinite(t.gridOrigin.x)||!Number.isFinite(t.gridOrigin.y))throw Error("gridOrigin coordinates must be finite numbers");if(t.viaHoleDiameter>=t.viaOuterDiameter)throw Error("viaHoleDiameter must be smaller than viaOuterDiameter");if(String(t.layers[0])===String(t.layers[1]))throw Error("layers must contain two distinct PCB layers");return t},Dhi=(e)=>e.type==="pcb_copper_pour"&&e.shape==="brep",Nhi=(e,t)=>{let n=new Map(e.circuitJson.filter((a)=>a.type==="source_net").map((a)=>[a.source_net_id,a])),o=new Map;for(let a of e.circuitJson){if(!Dhi(a)||!a.source_net_id)continue;if(t.sourceNetIds&&!t.sourceNetIds.has(a.source_net_id))continue;let c=o.get(a.source_net_id)??[];c.push(a),o.set(a.source_net_id,c)}let[r,i]=t.layers,s=[];for(let[a,c]of o){let l=c.filter((d)=>String(d.layer)===String(r)),h=c.filter((d)=>String(d.layer)===String(i));if(l.length===0||h.length===0)continue;s.push({sourceNetId:a,sourceNet:n.get(a),fromLayerPours:l,toLayerPours:h})}return s},Rhi=(e,t)=>(e.outer_diameter??t*2)/2,Qhi=({center:e,radius:t,occupiedVias:n,minimumViaSeparation:o})=>n.some((r)=>Math.hypot(e.x-r.center.x,e.y-r.center.y)<Math.max(o,t+r.radius)),qxn=({minimum:e,maximum:t,origin:n,pitch:o})=>{let r=[],i=Math.ceil((e-n)/o),s=Math.floor((t-n)/o);for(let a=i;a<=s;a++)r.push(n+a*o);return r},wSn=class extends po{constructor(e){super();this.input=e,this.options=Thi(e.options),this.copperPourPairContexts=Nhi(e,this.options),this.stitchingObstacles=whi(e.circuitJson,this.options.layers);let t=this.options.viaOuterDiameter/2;for(let n of e.circuitJson)if(n.type==="pcb_via"){let o=n;this.existingPcbViaIds.add(o.pcb_via_id),this.occupiedVias.push({center:{x:o.x,y:o.y},radius:o.outer_diameter/2})}else if(n.type==="pcb_trace")for(let o of n.route){if(o.route_type!=="via")continue;this.occupiedVias.push({center:{x:o.x,y:o.y},radius:Rhi(o,t)})}}input;options;copperPourPairContexts;pcbVias=[];occupiedVias=[];existingPcbViaIds=new Set;stitchingObstacles;nextCopperPourPairIndex=0;nextViaId=0;_step(){let e=this.copperPourPairContexts[this.nextCopperPourPairIndex];if(!e){this.solved=!0,this.progress=1;return}this.processCopperPourPair(e),this.nextCopperPourPairIndex+=1,this.progress=this.copperPourPairContexts.length===0?1:this.nextCopperPourPairIndex/this.copperPourPairContexts.length,this.solved=this.nextCopperPourPairIndex===this.copperPourPairContexts.length}processCopperPourPair(e){let[t,n]=this.options.layers,o=e.fromLayerPours.map((_)=>_.brep_shape),r=e.toLayerPours.map((_)=>_.brep_shape),i=Kxn(o),s=Kxn(r);if(!i||!s)return;let a={minX:Math.max(i.minX,s.minX),maxX:Math.min(i.maxX,s.maxX),minY:Math.max(i.minY,s.minY),maxY:Math.min(i.maxY,s.maxY)};if(a.minX>a.maxX||a.minY>a.maxY)return;let c=this.options.viaOuterDiameter/2,l=c+this.options.pourEdgeClearance,h=c+this.options.obstacleClearance,d=qxn({minimum:a.minX+l,maximum:a.maxX-l,origin:this.options.gridOrigin.x,pitch:this.options.viaStitchPitch}),u=qxn({minimum:a.minY+l,maximum:a.maxY-l,origin:this.options.gridOrigin.y,pitch:this.options.viaStitchPitch});for(let _ of u)for(let p of d){let m={x:p,y:_};if(Qhi({center:m,radius:c,occupiedVias:this.occupiedVias,minimumViaSeparation:this.options.minimumViaSeparation})||Bhi({center:m,radius:h,obstacles:this.stitchingObstacles})||!$xn({center:m,radius:l,shapes:o})||!$xn({center:m,radius:l,shapes:r}))continue;let A=`via_stitch_via_${this.nextViaId++}`;while(this.existingPcbViaIds.has(A))A=`via_stitch_via_${this.nextViaId++}`;let g=e.fromLayerPours[0],f={type:"pcb_via",pcb_via_id:A,x:p,y:_,hole_diameter:this.options.viaHoleDiameter,outer_diameter:this.options.viaOuterDiameter,layers:[t,n],from_layer:t,to_layer:n,source_net_id:e.sourceNetId,subcircuit_id:g.subcircuit_id,pcb_group_id:g.pcb_group_id,subcircuit_connectivity_map_key:e.sourceNet?.subcircuit_connectivity_map_key,is_tented:this.options.isTented};this.pcbVias.push(f),this.existingPcbViaIds.add(A),this.occupiedVias.push({center:m,radius:c})}}getOutput(){return{processedCopperPourPairCount:this.copperPourPairContexts.length,pcbVias:this.pcbVias}}},khi={DogboneFanoutSolver:zCn,BusLanesSolver:A2,BusLanesPipelineSolver:g7n,PackSolver2:BB,LayoutPipelineSolver:N6e,AutoroutingPipelineSolver:ehe,AssignableAutoroutingPipeline2:cin,AssignableAutoroutingPipeline3:rsn,AutoroutingPipeline1_OriginalUnravel:rin,AutoroutingPipelineSolver3_HgPortPointPathing:asn,AutoroutingPipelineSolver4:jZe,AutoroutingPipelineSolver5:can,AutoroutingPipelineSolver7_MultiGraph:zan,AutoroutingPipelineSolver8:Oan,AutoroutingPipelineSolver9_PreloadedTraceGraph:ehe,AutoroutingPipelineSolver9_Networked:c6e,AutoroutingPipelineSolver11_Simplification:hcn,CopperPourPipelineSolver:u6e,CreateFdmEnclosureSolver:_6e,FanoutSolver:pve,ImplicitCopperPourPipelineSolver:Bri,SchematicTracePipelineSolver:MSn,ViaStitchSolver:wSn},Lhi="capacity-autorouter:",Jxn=new WeakMap;function trt(e){return typeof e==="object"&&e!==null&&"then"in e&&typeof e.then==="function"}function Zxn(e){return e.constructor.name==="AsyncFunction"}var Hhi=class{constructor(e){this.localCacheEngine=e,this.isSyncCache=!Zxn(e.getItem)&&!Zxn(e.setItem)}localCacheEngine;isSyncCache;cacheHits=0;cacheMisses=0;cacheHitsByPrefix={};cacheMissesByPrefix={};knownCacheKeys=new Set;getCachedSolutionSync(e){if(!this.isSyncCache)return;this.knownCacheKeys.add(e);try{let t=this.localCacheEngine.getItem(this.getLocalCacheEngineKey(e));if(trt(t)){this.isSyncCache=!1,Promise.resolve(t).catch(()=>{}),this.recordCacheMiss(e);return}return this.parseCachedItem(e,t)}catch{this.recordCacheMiss(e);return}}async getCachedSolution(e){this.knownCacheKeys.add(e);try{let t=await this.localCacheEngine.getItem(this.getLocalCacheEngineKey(e));return this.parseCachedItem(e,t)}catch{this.recordCacheMiss(e);return}}setCachedSolutionSync(e,t){if(!this.isSyncCache)return;this.knownCacheKeys.add(e);try{let n=JSON.stringify(t);if(n===void 0)return;let o=this.localCacheEngine.setItem(this.getLocalCacheEngineKey(e),n);if(trt(o))this.isSyncCache=!1,Promise.resolve(o).catch(()=>{})}catch{}}async setCachedSolution(e,t){this.knownCacheKeys.add(e);try{let n=JSON.stringify(t);if(n===void 0)return;await this.localCacheEngine.setItem(this.getLocalCacheEngineKey(e),n)}catch{}}getAllCacheKeys(){return[...this.knownCacheKeys]}clearCache(){for(let e of this.knownCacheKeys){let t=this.getLocalCacheEngineKey(e);try{let n=this.localCacheEngine.removeItem?this.localCacheEngine.removeItem(t):this.localCacheEngine.setItem(t,"null");if(trt(n))Promise.resolve(n).catch(()=>{})}catch{}}this.knownCacheKeys.clear(),this.cacheHits=0,this.cacheMisses=0,this.cacheHitsByPrefix={},this.cacheMissesByPrefix={}}getLocalCacheEngineKey(e){return`${Lhi}${e}`}parseCachedItem(e,t){if(t===null){this.recordCacheMiss(e);return}try{let n=JSON.parse(t);if(n===null){this.recordCacheMiss(e);return}return this.recordCacheHit(e),n}catch{this.recordCacheMiss(e);return}}recordCacheHit(e){this.cacheHits++;let t=e.split(":")[0];this.cacheHitsByPrefix[t]=(this.cacheHitsByPrefix[t]??0)+1}recordCacheMiss(e){this.cacheMisses++;let t=e.split(":")[0];this.cacheMissesByPrefix[t]=(this.cacheMissesByPrefix[t]??0)+1}};function Fhi(e){let t=Jxn.get(e);if(!t)t=new Hhi(e),Jxn.set(e,t);return t}var BSn=({useAssignableSolver:e=!1,useAutoJumperSolver:t=!1,autorouterVersion:n,useLaserPrefabSolver:o=!1,useTraceSimplificationSolver:r=!1,platformConfig:i,effort:s})=>{let a=i?.useCloudAutorouter&&(s===void 0||s===1)?"AutoroutingPipelineSolver9_Networked":"AutoroutingPipelineSolver9_PreloadedTraceGraph";if(r)return"AutoroutingPipelineSolver11_Simplification";if(n==="beta_pipeline1")return"AutoroutingPipeline1_OriginalUnravel";if(n==="beta_pipeline3")return"AutoroutingPipelineSolver3_HgPortPointPathing";if(n==="beta_pipeline4")return"AutoroutingPipelineSolver4";if(n==="beta_pipeline5")return"AutoroutingPipelineSolver5";if(n==="beta_pipeline7")return"AutoroutingPipelineSolver7_MultiGraph";if(n==="beta_pipeline9"||n==="latest")return a;if(o)return"AutoroutingPipelineSolver8";if(t)return"AssignableAutoroutingPipeline3";if(e)return"AssignableAutoroutingPipeline2";return a};function zhi(e){if(!e?.localCacheEngine)return null;return Fhi(e.localCacheEngine)}var Ohi=class{input;isRouting=!1;solver;eventHandlers={complete:[],error:[],progress:[]};cycleCount=0;stepDelay;timeoutId;constructor(e,t={}){this.input=e;let{capacityDepth:n,targetMinCapacity:o,stepDelay:r=0,useAssignableSolver:i=!1,useAutoJumperSolver:s=!1,autorouterVersion:a,useLaserPrefabSolver:c=!1,useTraceSimplificationSolver:l=!1,effort:h,platformConfig:d,onSolverStarted:u}=t,_=BSn({useAssignableSolver:i,useAutoJumperSolver:s,autorouterVersion:a,useLaserPrefabSolver:c,useTraceSimplificationSolver:l,platformConfig:d,effort:h}),p=zhi(d),m={capacityDepth:n,targetMinCapacity:o,cacheProvider:p,effort:h};this.solver=_==="AutoroutingPipelineSolver9_Networked"?new c6e(e,{...m,effort:1}):new khi[_](e,m),u?.({solverName:_,solverParams:{input:e,options:{capacityDepth:n,targetMinCapacity:o,cacheProvider:p,effort:h}}}),this.stepDelay=r}start(){if(this.isRouting)return;this.isRouting=!0,this.cycleCount=0,this.runCycleAndQueueNextCycle()}async stepSolver(){if("stepAsync"in this.solver&&typeof this.solver.stepAsync==="function"){await this.solver.stepAsync();return}this.solver.step()}async runCycleAndQueueNextCycle(){if(!this.isRouting)return;try{if(this.solver.solved||this.solver.failed){if(this.solver.failed)this.emitEvent({type:"error",error:new Ide(this.solver.error||"Routing failed")});else this.emitEvent({type:"complete",traces:this.solver.getOutputSimplifiedPcbTraces()});this.isRouting=!1;return}let e=Date.now(),t=this.solver.iterations;while(Date.now()-e<250&&!this.solver.failed&&!this.solver.solved)await this.stepSolver();let n=(this.solver.iterations-t)/(Date.now()-e)*1000;this.cycleCount++;let o=this.solver?.preview()||void 0,r=this.solver.progress;if(this.emitEvent({type:"progress",steps:this.cycleCount,iterationsPerSecond:n,progress:r,phase:"getCurrentPhase"in this.solver?this.solver.getCurrentPhase():this.solver.activeSubSolver?.getSolverName()??this.solver.getSolverName(),debugGraphics:o}),this.stepDelay>0)this.timeoutId=setTimeout(()=>void this.runCycleAndQueueNextCycle(),this.stepDelay);else this.timeoutId=setTimeout(()=>void this.runCycleAndQueueNextCycle(),0)}catch(e){this.emitEvent({type:"error",error:e instanceof Error?new Ide(e.message):new Ide(String(e))}),this.isRouting=!1}}stop(){if(!this.isRouting)return;if(this.isRouting=!1,this.timeoutId!==void 0)clearTimeout(this.timeoutId),this.timeoutId=void 0}on(e,t){if(e==="complete")this.eventHandlers.complete.push(t);else if(e==="error")this.eventHandlers.error.push(t);else if(e==="progress")this.eventHandlers.progress.push(t)}emitEvent(e){if(e.type==="complete")for(let t of this.eventHandlers.complete)t(e);else if(e.type==="error")for(let t of this.eventHandlers.error)t(e);else if(e.type==="progress")for(let t of this.eventHandlers.progress)t(e)}solveSync(){if(this.solver.solve(),this.solver.failed)throw new Ide(this.solver.error||"Routing failed");return this.solver.getOutputSimplifiedPcbTraces()}getConnectedOffboardObstacles(){if("getConnectedOffboardObstacles"in this.solver)return this.solver.getConnectedOffboardObstacles();return{}}},TSn=(e,t)=>({name:e,cacheable:!0,getSolverName:(n)=>BSn({...n,...t}),create:({simpleRouteJson:n,commonAutorouterOptions:o,onSolverStarted:r})=>new Ohi(n,{...o,...t,onSolverStarted:(i)=>r?.({...i,solverConstructorArgs:[i.solverParams]})})}),Vhi=TSn("tscircuit",{}),Yhi=TSn("tscircuit_simplify",{useTraceSimplificationSolver:!0}),e5n=(e)=>({name:e,cacheable:!1,followUpAutorouter:"default",getSolverName:()=>"FanoutSolver",create:({simpleRouteJson:t,busFanoutDirections:n,fanoutBounds:o,fanoutRoutingLayers:r,allowBlindAndBuriedVias:i,componentNamesById:s,onSolverStarted:a})=>new eit(t,{mode:e,busFanoutDirections:n,fanoutBounds:o,fanoutRoutingLayers:r,allowBlindAndBuriedVias:i,componentNamesById:s,onSolverStarted:a})}),Ghi=new Map([["single_layer_fanout",e5n("single_layer_fanout")],["fanout",e5n("fanout")],["dogbone",{name:"dogbone",preserveOutputTraces:!0,followUpAutorouter:"default",cacheable:!1,getSolverName:()=>"DogboneFanoutSolver",create:({simpleRouteJson:e,fanoutRoutingLayers:t,onSolverStarted:n,onSolverEnded:o})=>new sXr({input:e,fanoutRoutingLayers:t},{onSolverStarted:n,onSolverEnded:o})}],["bus_lanes",{name:"bus_lanes",preserveOutputTraces:!0,cacheable:!1,getSolverName:()=>"BusLanesPipelineSolver",create:({simpleRouteJson:e,onSolverStarted:t})=>(t?.({solverName:"BusLanesPipelineSolver",solverParams:e,solverConstructorArgs:[e]}),new koi(e))}],["simplify",Yhi]]),t5n=(e)=>Ghi.get(e??"")??Vhi,Uhi=(e,t)=>{let n=t5n(e.preset),o=[{autorouterConfig:e,strategy:n,usesPreviousStageOutput:!1}];if(n.followUpAutorouter&&!e.algorithmFn){let r=Yde(n.followUpAutorouter,t);o.push({autorouterConfig:r,strategy:t5n(r.preset),usesPreviousStageOutput:!0})}return o};var Lct=({bus:e,busSourceTraces:t,traceNameOrPortSelector:n})=>{let o=t.filter((c)=>c.name===n),i=(o.length===0?e.getSubcircuit().selectOne(n,{type:"port"}):null)?.source_port_id??void 0,s=i?t.filter((c)=>c.connected_source_port_ids.includes(i)):o;if(s.length===0)throw Error(`Could not find source trace for trace name or port selector "${n}" in bus "${e.name}"`);if(s.length>1)throw Error(`Trace name or port selector "${n}" matches multiple source traces in bus "${e.name}"`);return s[0].source_trace_id},Whi=({bus:e,busSourceTraces:t})=>{let n=e._parsedProps.targetLength;if(n===void 0||typeof n==="number")return n;return{reference:n.reference,offset:n.offset,source_trace_ids:n.of?.map((o)=>Lct({bus:e,busSourceTraces:t,traceNameOrPortSelector:o}))}},Xhi=class extends lr{source_bus_id;get config(){return{componentName:"Bus",zodProps:KSt}}doInitialSourceAddConnectivityMapKey(){let{db:e}=this.root,t=this.getSubcircuit().subcircuit_id,n=e.source_trace.list().filter((i)=>i.subcircuit_id===t),o=this._parsedProps.connections.map((i)=>Lct({bus:this,busSourceTraces:n,traceNameOrPortSelector:i}));if(new Set(o).size!==o.length)throw Error(`Bus "${this.name}" resolves multiple entries to one trace`);let r=e.source_bus.insert({name:this._parsedProps.name,source_trace_ids:o,max_length_skew:this._parsedProps.maxLengthSkew,target_length:Whi({bus:this,busSourceTraces:n}),length_tolerance:this._parsedProps.lengthTolerance,subcircuit_id:t});this.source_bus_id=r.source_bus_id}},jhi=(e,t)=>{let{db:n}=e.root,o=e.getSubcircuit(),r=n.source_trace.list().filter((l)=>l.subcircuit_id===o.subcircuit_id),i=r.filter((l)=>l.name===t),s=new Set;if(i.length>0){for(let l of i)if(l.subcircuit_connectivity_map_key)s.add(l.subcircuit_connectivity_map_key)}else{let l=o.selectOne(t,{type:"port"});if(l?.source_port_id){let h=n.source_port.get(l.source_port_id);if(h?.subcircuit_connectivity_map_key)s.add(h.subcircuit_connectivity_map_key)}}if(s.size!==1)return;let a=s.values().next().value;if(!a)return;let c=n.source_port.list().filter((l)=>l.subcircuit_connectivity_map_key===a);return{sourceTraceIds:r.filter((l)=>l.subcircuit_connectivity_map_key===a).map((l)=>l.source_trace_id),sourcePorts:c,sourceTraceName:i.length>0?t:void 0}},Khi=(e)=>{if(e.length<=1)return e.join("");if(e.length===2)return`${e[0]} and ${e[1]}`;return`${e.slice(0,-1).join(", ")}, and ${e.at(-1)}`},$hi=(e,t)=>{let n;if(e.source_component_id)n=t.get(e.source_component_id);if(!n?.name)return e.source_port_id;let o=e.most_frequently_referenced_by_name??e.name;return`.${n.name} > .${o}`},qhi=({differentialPairName:e,connectionPolarity:t,connectionSelector:n,sourceTraceName:o,terminalPinSelectors:r})=>{let i=Khi(r),s=i?`: ${i}`:"";if(o&&r.length>2)return`Differential pair "${e}" ${t}Connection uses the ambiguous trace name "${o}": its connection has more than 2 terminal pins${s}.`;return`Differential pair "${e}" ${t}Connection="${n}" is not point-to-point: expected exactly 2 terminal pins, found ${r.length}${s}.`},Jhi=(e)=>{let{db:t}=e.root,n=new Map;for(let i of t.source_component.list())n.set(i.source_component_id,{name:i.name});let o=[],r=0;for(let i of["positive","negative"]){let s=e._parsedProps.negativeConnection;if(i==="positive")s=e._parsedProps.positiveConnection;let a=jhi(e,s);if(!a)continue;r++,o.push(...a.sourceTraceIds);let c=a.sourcePorts;if(c.length===2)continue;let l="",h=c[0];if(h){if(!h.source_component_id)throw Error(`Differential pair "${e.name}" resolved terminal port "${h.source_port_id}" without a source_component_id`);l=h.source_component_id}let d=c.map((u)=>$hi(u,n)).sort((u,_)=>u.localeCompare(_));t.source_property_ignored_warning.insert({source_component_id:l,property_name:`${i}Connection`,error_type:"source_property_ignored_warning",message:qhi({differentialPairName:e.name,connectionPolarity:i,connectionSelector:s,sourceTraceName:a.sourceTraceName,terminalPinSelectors:d}),subcircuit_id:e.getSubcircuit().subcircuit_id??void 0})}if(r===2&&o.length>0)t.source_bus.insert({name:e.name,source_trace_ids:[...new Set(o)],max_length_skew:e._parsedProps.maxLengthSkew,subcircuit_id:e.getSubcircuit().subcircuit_id??void 0})},Zhi=class extends lr{get config(){return{componentName:"DifferentialPair",zodProps:$St}}doInitialSourceDesignRuleChecks(){Jhi(this)}},DSn=(e)=>{let t={...e.bounds};for(let n of e.connections){if(n.isOffBoard)continue;for(let o of n.pointsToConnect)t.minX=Math.min(t.minX,o.x),t.maxX=Math.max(t.maxX,o.x),t.minY=Math.min(t.minY,o.y),t.maxY=Math.max(t.maxY,o.y)}return t},NSn=({bounds:e,outline:t},n)=>{if(t)return t;if(e.minX===n.minX&&e.maxX===n.maxX&&e.minY===n.minY&&e.maxY===n.maxY)return;return new YA(e.minX,e.minY,e.maxX,e.maxY).toPoints().map(({x:o,y:r})=>({x:o,y:r}))},edi=(e)=>{if(!e.source_bus_id)return{};let{db:t}=e.root,n=t.source_bus.get(e.source_bus_id);if(n.target_length===void 0)return{};let o=n.length_tolerance;if(o===void 0)throw Error(`Bus "${e.name}" requires lengthTolerance with targetLength`);let r;if(typeof n.target_length==="number")r=n.target_length;else{let i=n.target_length,a=(i.source_trace_ids??n.source_trace_ids).map((c)=>{let l=t.source_trace.get(c),h=t.pcb_port.list().filter((d)=>l.connected_source_port_ids.includes(d.source_port_id));if(h.length!==2)throw Error(`Bus "${e.name}" targetLength requires two placed endpoint pads per reference trace`);return Math.abs(h[0].x-h[1].x)+Math.abs(h[0].y-h[1].y)});r=Math.max(...a)+(i.offset??0)}return{minLength:Math.max(0,r-o),maxLength:r+o}},tdi=({srjConnections:e,bus:t,sourceTraceId:n,traceNameOrPortSelector:o,busSourceTraces:r})=>{let i=e.filter((h)=>h.source_trace_id===n);if(i.length>0)return i.map((h)=>h.name);let s=r.find((h)=>h.source_trace_id===n),a=r.filter((h)=>h.source_trace_id===n||s.subcircuit_connectivity_map_key!==void 0&&h.subcircuit_connectivity_map_key===s.subcircuit_connectivity_map_key),c=new Set(a.flatMap((h)=>h.connected_source_net_ids??[])),l=e.filter((h)=>c.has(h.name));if(l.length===0)throw Error(`Could not find an SRJ connection for "${o}" in bus "${t.name}"`);return l.map((h)=>h.name)},ndi=(e)=>e.trim().replace(/^net\./,"").replace(/^\./,""),odi=({fanoutPourNetMap:e,sourceNets:t,sourceTraces:n,subcircuitId:o})=>{let r=new Map;if(!e)return r;let i=new Map;for(let[s,a]of Object.entries(e)){let c=Array.isArray(a)?a:[a];for(let l of c){let h=ndi(l);for(let d of t){if(d.name!==h)continue;let u=i.get(d.source_net_id);if(u&&u!==s)throw Error(`Fanout plane net "${h}" maps to multiple layers ("${u}" and "${s}"); use fanoutPourNetMap to select one`);i.set(d.source_net_id,s)}}}for(let s of n){if(o&&s.subcircuit_id!==o)continue;if(s.connected_source_port_ids.length!==1)continue;let a=new Set((s.connected_source_net_ids??[]).map((l)=>i.get(l)).filter((l)=>l!==void 0));if(a.size>1)throw Error(`Source trace "${s.name??s.source_trace_id}" connects to fanout planes on multiple layers`);let c=a.values().next().value;if(c)r.set(s.source_trace_id,c)}return r},rdi=({srjConnections:e,buses:t,sourceTraces:n,subcircuitId:o,planeTerminatedSourceTraceLayers:r,preservedSourceTraceIds:i})=>{let s=[];for(let l of t){let h=l.getSubcircuit().subcircuit_id;if(o&&h!==o)continue;let d=n.filter((_)=>_.subcircuit_id===h),u=l._parsedProps.connections.flatMap((_)=>{let p=Lct({bus:l,busSourceTraces:d,traceNameOrPortSelector:_});if(i?.has(p))return[];return tdi({srjConnections:e,bus:l,sourceTraceId:p,traceNameOrPortSelector:_,busSourceTraces:d})});if(new Set(u).size!==u.length)throw Error(`Bus "${l.name}" resolves multiple entries to one trace`);if(u.length===0)continue;s.push({busId:l.name,name:l.name,connectionNames:u,...edi(l),...l._parsedProps.maxLengthSkew!==void 0?{maxLengthSkew:l._parsedProps.maxLengthSkew}:{},...l._parsedProps.pcbTraceWidth!==void 0?{traceWidth:l._parsedProps.pcbTraceWidth}:{},...l._parsedProps.pcbAllowedLayers!==void 0?{allowedLayers:l._parsedProps.pcbAllowedLayers}:{},...l._parsedProps.preferredLayer!==void 0?{preferredLayer:l._parsedProps.preferredLayer}:{},...l._parsedProps.preferredLayers!==void 0?{preferredLayers:l._parsedProps.preferredLayers}:{}})}let a=[];for(let[l,h]of r??[]){let d=n.find((p)=>p.source_trace_id===l),u=e.find((p)=>p.source_trace_id===l);if(!d||!u)continue;let _=d.name??d.source_trace_id;if([...s,...a].some((p)=>p.busId===_))throw Error(`Fanout plane trace "${_}" conflicts with an existing bus name`);a.push({busId:_,name:_,connectionNames:[u.name],termination:{type:"plane",layer:h}})}let c=[...a,...s];return c.length>0?c:void 0},idi=(e,t)=>e.filter((n)=>n.name===t),sdi=(e,t)=>e.filter((n)=>n.connected_source_port_ids.includes(t)),n5n=({differentialPair:e,differentialPairSourceTraces:t,traceNameOrPortSelector:n})=>{let o=e.getSubcircuit(),r=idi(t,n),s=(r.length===0?o.selectOne(n,{type:"port"}):null)?.source_port_id??void 0,a=s?sdi(t,s):r;if(a.length===0)throw Error(`Could not find source trace for trace name or port selector "${n}" in differential pair "${e.name}"`);if(a.length>1)throw Error(`Trace name or port selector "${n}" matches multiple source traces for differential pair "${e.name}"`);let c=a[0];if(!c)throw Error(`Expected one source trace for trace name or port selector "${n}" in differential pair "${e.name}"`);let l=c.subcircuit_connectivity_map_key;if(!l)throw Error(`Source trace "${c.source_trace_id}" does not have a subcircuit connectivity map key for differential pair "${e.name}"`);return l},o5n=({srjConnections:e,differentialPairName:t,differentialPairSourceTraces:n,traceSubcircuitConnectivityMapKey:o,traceNameOrPortSelector:r})=>{let i=[],s=new Set;for(let l of n)if(l.subcircuit_connectivity_map_key===o){i.push(l.source_trace_id);for(let h of l.connected_source_net_ids??[])s.add(h)}let a=[];for(let l of e)if(s.has(l.name)||l.source_trace_id&&i.includes(l.source_trace_id))a.push(l);if(a.length===0)throw Error(`Could not find an SRJ connection for trace name or port selector "${r}" in differential pair "${t}"`);let c=new Map;for(let l of a){let h=l.routingPcbGroupId;if(c.has(h)){let d=h===void 0?"the global routing cohort":`routing PCB group "${h}"`;throw Error(`Subcircuit connectivity map key "${o}" matches multiple SRJ connections in ${d} for differential pair "${t}"`)}c.set(h,l.name)}return c},r5n=(e)=>e===void 0?"the global routing cohort":`routing PCB group "${e}"`,adi=({srjConnections:e,differentialPairs:t,sourceTraces:n,subcircuitId:o})=>{let r=[];for(let i of t){let s=i.getSubcircuit().subcircuit_id;if(o&&s!==o)continue;let a=n.filter((m)=>m.subcircuit_id===s),c=i._parsedProps.positiveConnection,l=i._parsedProps.negativeConnection,h=n5n({differentialPair:i,differentialPairSourceTraces:a,traceNameOrPortSelector:c}),d=n5n({differentialPair:i,differentialPairSourceTraces:a,traceNameOrPortSelector:l}),u=o5n({srjConnections:e,differentialPairName:i.name,differentialPairSourceTraces:a,traceSubcircuitConnectivityMapKey:h,traceNameOrPortSelector:c}),_=o5n({srjConnections:e,differentialPairName:i.name,differentialPairSourceTraces:a,traceSubcircuitConnectivityMapKey:d,traceNameOrPortSelector:l}),p=i._parsedProps.maxLengthSkew??0.1;for(let m of u.keys()){if(_.has(m))continue;throw Error(`Differential pair "${i.name}" has a positive SRJ connection in ${r5n(m)} without a matching negative SRJ connection`)}for(let m of _.keys()){if(u.has(m))continue;throw Error(`Differential pair "${i.name}" has a negative SRJ connection in ${r5n(m)} without a matching positive SRJ connection`)}for(let[m,A]of u){let g=_.get(m);r.push({connectionNames:[A,g],lengthTolerance:p,...i._parsedProps.pcbTraceGap!==void 0?{traceGap:i._parsedProps.pcbTraceGap}:{},...i._parsedProps.maxUncoupledLength!==void 0?{maxUncoupledLength:i._parsedProps.maxUncoupledLength}:{}})}}return r.length>0?r:void 0},Ade=(e)=>typeof e==="string"?e:e.name,cdi=(e)=>e.source_trace_id??e.connection_name??e.pcb_trace_id,ldi=(e)=>{let t=new Set(e.connectsTo??[]);for(let n of e.route){if(n.route_type!=="wire")continue;for(let o of[n.start_pcb_port_id,n.end_pcb_port_id])if(o)t.add(o)}return Array.from(t)},hdi=(e)=>e.route.map((t)=>{if(t.route_type==="wire")return{route_type:"wire",x:t.x,y:t.y,width:t.width,layer:Ade(t.layer)};if(t.route_type==="via"){let n=t,o=n.outer_diameter??n.via_diameter,r=n.hole_diameter??n.via_hole_diameter;return{route_type:"via",x:t.x,y:t.y,from_layer:Ade(t.from_layer),to_layer:Ade(t.to_layer),...o!==void 0?{via_diameter:o}:{},...r!==void 0?{via_hole_diameter:r}:{}}}return{route_type:"through_obstacle",start:t.start,end:t.end,from_layer:Ade(t.start_layer),to_layer:Ade(t.end_layer),width:t.width}}),ddi=({scopedDb:e,relevantSubcircuitIds:t})=>e.pcb_trace.list().filter((n)=>{if(!n.subcircuit_id)return!1;if(n.pcb_component_id&&!n.source_trace_id)return!1;return t===null||t.has(n.subcircuit_id)}).map((n)=>{let o=n,r=cdi(o);return{type:"pcb_trace",pcb_trace_id:n.pcb_trace_id,source_trace_id:n.source_trace_id,connection_name:r,connectsTo:ldi(o),route:hdi(o)}}).filter((n)=>n.route.length>=2),udi=0.5,pdi=(e)=>Array.from(new Set(e.filter((t)=>Boolean(t)))),mdi=(e)=>typeof e==="string"?e:e.name,i5n=({layer:e,connectedTo:t,center:n,width:o,height:r})=>({type:"rect",layers:[e],center:n,width:o,height:r,connectedTo:t,isCopperPour:!0}),_di=({outline:e,group:t,board:n})=>{if(e&&e.length>=3)return e;if(t?.outline&&t.outline.length>=3)return t.outline;if(n?.outline&&n.outline.length>=3)return n.outline;return null},gdi=({group:e,board:t})=>{if(e?.width&&e.height)return{center:e.center,width:e.width,height:e.height};if(t?.width&&t.height)return{center:t.center,width:t.width,height:t.height};return null},Adi=(e,t)=>pdi([e.source_net_id,e.subcircuit_connectivity_map_key,e.source_net_id?t.getNetConnectedToId(e.source_net_id):null]),fdi=({connMap:e,subcircuitComponent:t,board:n,group:o})=>{if(!t)return[];let r=[],i=t.selectAll("copperpour");for(let s of i){let a=s._parsedProps;if(!a.unbroken)continue;let c=s.getSubcircuit().selectOne(a.connectsTo);if(!c?.source_net_id)continue;let l=mdi(a.layer),h=Adi(c,e);if(h.length===0)continue;let d=_di({outline:a.outline,group:o,board:n});if(d){let _=Srt(d,{rectHeight:udi});if(_.length>0){r.push(..._.map((p)=>i5n({layer:l,connectedTo:h,center:p.center,width:p.width,height:p.height})));continue}}let u=gdi({group:o,board:n});if(!u)continue;r.push(i5n({layer:l,connectedTo:h,center:u.center,width:u.width,height:u.height}))}return r},s5n=(e,t)=>{let n=new Map(e.map((o)=>[o.pcb_port_id,o]));return t.flatMap((o)=>{let r=n.get(o.pcb_port_id);if(!r)return[];let i=r.layers?.[0]??"top";return o.route.map((s)=>({x:s.x,y:s.y,layer:i}))})},ydi=(e,t)=>{let n=new Set,o=t,r=!0;while(o&&!n.has(o)){n.add(o);let i=e.source_group.getWhere({subcircuit_id:o}),s=i?e.source_board.getWhere({source_group_id:i.source_group_id}):void 0;if(s)return{board:e.pcb_board.getWhere({source_board_id:s.source_board_id})??null,subcircuitIsBoard:r};o=i?.parent_subcircuit_id??null,r=!1}return{board:null,subcircuitIsBoard:!1}},nrt=({db:e,circuitJson:t,subcircuit_id:n,minTraceWidth:o,minTraceToPadEdgeClearance:r,minTraceToHoleEdgeClearance:i,minViaEdgeToPadEdgeClearance:s,minViaHoleEdgeToViaHoleEdgeClearance:a,minPlatedHoleDrillEdgeToDrillEdgeClearance:c,minPadEdgeToPadEdgeClearance:l,minBoardEdgeClearance:h,minViaHoleDiameter:d,minViaPadDiameter:u,nominalTraceWidth:_,subcircuitComponent:p,routingPcbGroupId:m,fanoutPourNetMap:A,ignoreExistingTopLevelPcbRouteState:g=!1})=>{if(!e&&t)e=Vo(t);if(!e)throw Error("db or circuitJson is required");let f=e.pcb_trace_hint.list(),y=n?new Set([n]):null;if(n){let $e=Gst(e,n);for(let qe of $e)y.add(qe)}let x=t??e.toArray(),C=new Map(x.flatMap(($e)=>$e.type==="source_trace"?[[$e.source_trace_id,$e]]:[])),I=x.map(($e)=>{if(g||$e.type!=="pcb_trace"||$e.subcircuit_id||!$e.source_trace_id)return $e;let qe=C.get($e.source_trace_id)?.subcircuit_id;return qe?{...$e,subcircuit_id:qe}:$e}).filter(($e)=>!n||("subcircuit_id"in $e)&&y.has($e.subcircuit_id)),v=null,P=!1;if(n){let $e=ydi(e,n);v=$e.board,P=$e.subcircuitIsBoard&&v!==null}if(!v)v=e.pcb_board.list()[0];e=Vo(I);let M=($e)=>{if(!$e?.source_component_id)return;let qe=e.source_component.get($e.source_component_id);if(!qe?.name)return;return`${qe.name}.${$e.name}`},B=m?e.pcb_group.get(m):n?e.pcb_group.getWhere({subcircuit_id:n}):void 0,T=p?.pcb_group_id;if(T==null&&!P)T=B?.pcb_group_id;let N=Aa(I),D=e.pcb_breakout_point.list().filter(($e)=>!n||y?.has($e.subcircuit_id)),L=($e)=>$e.subcircuit_id===n&&(T?$e.pcb_group_id===T:!P),H=ddi({scopedDb:e,relevantSubcircuitIds:y}),V=new Map(H.map(($e)=>[$e.pcb_trace_id,$e])),O=($e)=>{if(!$e.pcb_trace_id)return!1;let qe=V.get($e.pcb_trace_id);if(!qe)return!1;let ft=new Set($e.layers);return qe.route.some((It)=>{if(It.route_type!=="via"||It.x!==$e.x||It.y!==$e.y)return!1;let ze=new Set(kP({fromLayer:It.from_layer,toLayer:It.to_layer,layerCount:v?.num_layers??2}));return ze.size===ft.size&&[...ze].every((Xe)=>ft.has(Xe))})},U=H4n([...v?[v]:[],...e.source_component.list(),...e.source_port.list(),...e.pcb_port.list(),...e.pcb_component.list(),...e.pcb_smtpad.list(),...e.pcb_plated_hole.list(),...e.pcb_hole.list(),...e.pcb_trace.list().filter(($e)=>!$e.source_trace_id),...e.pcb_via.list().filter(($e)=>(!g||Boolean($e.subcircuit_id))&&!O($e)),...e.pcb_keepout.list(),...e.pcb_cutout.list()].filter(($e)=>$e.type==="pcb_board"||!n||y?.has($e.subcircuit_id)),N);U.push(...fdi({connMap:N,subcircuitComponent:p,board:v,group:B}));for(let $e of U){let qe=$e.connectedTo.flatMap((ft)=>N.getIdsConnectedToNet(ft));$e.connectedTo=[...new Set([...$e.connectedTo,...qe])]}let j=e.source_component_internal_connection.list(),Y=new Map;for(let $e of j)for(let qe of $e.source_port_ids)Y.set(qe,$e.source_component_internal_connection_id);let X=new Map;for(let $e of e.pcb_port.list())if($e.source_port_id){let qe=e.pcb_smtpad.getWhere({pcb_port_id:$e.pcb_port_id});if(qe)X.set(qe.pcb_smtpad_id,$e.source_port_id);let ft=e.pcb_plated_hole.getWhere({pcb_port_id:$e.pcb_port_id});if(ft)X.set(ft.pcb_plated_hole_id,$e.source_port_id)}for(let $e of U)for(let qe of $e.connectedTo){let ft=X.get(qe);if(ft){let It=Y.get(ft);if(It){$e.offBoardConnectsTo=[It],$e.netIsAssignable=!0;break}}}let K=U.flatMap(($e)=>[{x:$e.center.x-$e.width/2,y:$e.center.y-$e.height/2},{x:$e.center.x+$e.width/2,y:$e.center.y+$e.height/2}]).concat(v?.outline??[]),J=v&&!v.outline?{minX:v.center.x-v.width/2,maxX:v.center.x+v.width/2,minY:v.center.y-v.height/2,maxY:v.center.y+v.height/2}:void 0,ee,se=!!(B?.width&&B.height&&n&&!P);if(se)ee={minX:B.center.x-B.width/2,maxX:B.center.x+B.width/2,minY:B.center.y-B.height/2,maxY:B.center.y+B.height/2};else if(J)ee=J;else ee={minX:Math.min(...K.map(($e)=>$e.x))-1,maxX:Math.max(...K.map(($e)=>$e.x))+1,minY:Math.min(...K.map(($e)=>$e.y))-1,maxY:Math.max(...K.map(($e)=>$e.y))+1};if(B?.width&&B.height&&!se){let $e={minX:B.center.x-B.width/2,maxX:B.center.x+B.width/2,minY:B.center.y-B.height/2,maxY:B.center.y+B.height/2};ee={minX:Math.min(ee.minX,$e.minX),maxX:Math.max(ee.maxX,$e.maxX),minY:Math.min(ee.minY,$e.minY),maxY:Math.max(ee.maxY,$e.maxY)}}let ne=new Set(e.pcb_trace.list().filter(($e)=>{if(!$e.source_trace_id)return!1;if(n)return $e.subcircuit_id===n;if(!$e.subcircuit_id)return!1;return e.source_trace.get($e.source_trace_id)?.subcircuit_id===$e.subcircuit_id}).map(($e)=>$e.source_trace_id).filter(($e)=>Boolean($e))),re=new Map;for(let $e of D){let qe=$e.source_port_id;if(qe)re.set(qe,$e)}let Z=($e)=>{let qe=$e.layers?.[0]??"top",ft=re.get($e.source_port_id),It=M(e.source_port.get($e.source_port_id));if(ft&&!L(ft))return{x:ft.x,y:ft.y,layer:ft.layer??qe,pointId:ft.pcb_breakout_point_id,port_selector:It};return{x:$e.x,y:$e.y,layer:qe,pointId:$e.pcb_port_id,pcb_port_id:$e.pcb_port_id,port_selector:It}},te=e.source_trace.list(),ie=odi({fanoutPourNetMap:A,sourceNets:e.source_net.list(),sourceTraces:te,subcircuitId:n}),le=te.filter(($e)=>!ne.has($e.source_trace_id)).filter(($e)=>!n||$e.subcircuit_id===n).filter(($e)=>$e.connected_source_net_ids.length===0||ie.has($e.source_trace_id)).map(($e)=>{let qe=$e.connected_source_port_ids.map((St)=>e.pcb_port.getWhere({source_port_id:St})).filter((St)=>St!==null),ft=ie.has($e.source_trace_id);if(qe.length<2&&!(ft&&qe.length===1))return null;for(let St of qe)if(St.x===void 0||St.y===void 0)return console.error(`(source_port_id: ${St.source_port_id}) for trace ${$e.source_trace_id} does not have x/y coordinates. Skipping this trace.`),null;let It=s5n(qe,f),ze=qe.map((St)=>Z(St)),[Xe,...it]=ze;return{name:$e.source_trace_id??N.getNetConnectedToId($e.source_trace_id)??"",source_trace_id:$e.source_trace_id,nominalTraceWidth:$e.min_trace_thickness,width:$e.min_trace_thickness,pointsToConnect:[Xe,...It,...it]}}).filter(($e)=>$e!==null),ue=e.source_net.list().filter(($e)=>!n||$e.subcircuit_id===n),de=[],me=new Map,Ae=new Set,xe=new Set(ue.map(($e)=>$e.source_net_id)),Me=e.source_trace.list().filter(($e)=>!n||$e.subcircuit_id===n),Re=new Set((p?.selectAll("trace")??[]).flatMap(($e)=>{let qe=$e;return qe._exposesSubcircuitConnection&&qe.source_trace_id?[qe.source_trace_id]:[]})),we=new Set;for(let $e of Me){if(!Re.has($e.source_trace_id))continue;for(let qe of $e.connected_source_net_ids??[])if(!xe.has(qe))we.add(qe)}let _e=new Set(n?e.pcb_trace.list().filter(($e)=>$e.subcircuit_id&&$e.subcircuit_id!==n&&y?.has($e.subcircuit_id)).map(($e)=>$e.source_trace_id).filter(($e)=>Boolean($e)):[]),ye=e.source_trace.list().filter(($e)=>!ie.has($e.source_trace_id)).filter(($e)=>!ne.has($e.source_trace_id)||n!=null&&$e.subcircuit_id===n).filter(($e)=>!n||$e.subcircuit_id===n||($e.connected_source_net_ids?.some((qe)=>xe.has(qe))??!1)||($e.connected_source_net_ids?.some((qe)=>we.has(qe))??!1)&&!_e.has($e.source_trace_id)),Se=($e)=>$e?N.getNetConnectedToId($e)??$e:null;for(let $e of ue){let qe=Se($e.source_net_id);if(!qe||Ae.has(qe))continue;Ae.add(qe);let ft=ue.filter((Wt)=>Se(Wt.source_net_id)===qe),It=ft.map((Wt)=>Wt.source_net_id),ze=ye.filter((Wt)=>[Wt.source_trace_id,...Wt.connected_source_net_ids??[]].some((bn)=>Se(bn)===qe)),Xe;for(let Wt of ft){if(Wt.trace_width===void 0)continue;Xe=Math.max(Xe??0,Wt.trace_width)}for(let Wt of ze){if(Wt.min_trace_thickness===void 0)continue;Xe=Math.max(Xe??0,Wt.min_trace_thickness)}let it=[],St=new Set,kt=[];for(let Wt of ze){let bn=e.pcb_port.list().filter((pn)=>Wt.connected_source_port_ids.includes(pn.source_port_id));for(let pn of bn){let wn=Z(pn);if(St.has(wn.pointId))continue;St.add(wn.pointId),kt.push(pn),it.push(wn)}}it.push(...s5n(kt,f));let Lt={name:$e.source_net_id??N.getNetConnectedToId($e.source_net_id),nominalTraceWidth:Xe,width:Xe,pointsToConnect:it};if(it.length===0)continue;de.push(Lt);for(let Wt of It)me.set(Wt,Lt)}let Ne=[];for(let $e of D){let qe=$e.source_port_id,ft={x:$e.x,y:$e.y,layer:$e.layer??"top",pointId:$e.pcb_breakout_point_id};if(qe){let It=e.pcb_port.getWhere({source_port_id:qe});if(!It)continue;let ze={x:It.x,y:It.y,layer:It.layers?.[0]??"top",pointId:It.pcb_port_id,pcb_port_id:It.pcb_port_id,port_selector:M(e.source_port.get(It.source_port_id))},Xe=L($e),it=!Xe&&$e.subcircuit_id===n;if(Xe||it){Ne.push({name:it?`breakout:${$e.pcb_breakout_point_id}`:qe,source_trace_id:$e.source_trace_id,routingPcbGroupId:it?$e.pcb_group_id:void 0,pointsToConnect:[ze,ft]});continue}if(!$e.source_trace_id)Ne.push({name:qe,pointsToConnect:[ze,ft]});continue}if($e.source_net_id){let It=me.get($e.source_net_id);if(It)It.pointsToConnect.push(ft);else Ne.push({name:$e.source_net_id,pointsToConnect:[ft]})}}let ke=de.filter(($e)=>$e.pointsToConnect.length>=2),nt=[...le,...ke,...Ne],dt=o??v?.min_trace_width??0.1;for(let $e of nt)$e.nominalTraceWidth??=_??dt,$e.width??=_??dt;ee=DSn({bounds:ee,connections:nt});let rt=p?.selectAll("differentialpair")??[],mt=p?.selectAll("bus")??[],lt=adi({srjConnections:nt,differentialPairs:rt,sourceTraces:e.source_trace.list(),subcircuitId:n}),Ct=rdi({srjConnections:nt,buses:mt,sourceTraces:e.source_trace.list(),subcircuitId:n,planeTerminatedSourceTraceLayers:ie,preservedSourceTraceIds:ne});if(n){let $e=new Map;for(let ft of nt)for(let It of ft.pointsToConnect)if(It.pointId)$e.set(It.pointId,ft);let qe=e.pcb_trace.list().filter((ft)=>y?.has(ft.subcircuit_id));for(let ft of qe){let It=new Set;for(let it of ft.route){if(it.start_pcb_port_id)It.add(it.start_pcb_port_id);if(it.end_pcb_port_id)It.add(it.end_pcb_port_id)}if(It.size<2)continue;let ze=It.values().next().value;if(!ze)continue;let Xe=$e.get(ze);if(!Xe)continue;if(![...It].every((it)=>$e.get(it)===Xe))continue;Xe.externallyConnectedPointIds??=[],Xe.externallyConnectedPointIds.push([...It])}}let Nt=d??v?.min_via_hole_diameter,Ht=u??v?.min_via_pad_diameter,Tt=i??v?.min_trace_to_hole_edge_clearance,et=r??v?.min_trace_to_pad_edge_clearance,vt=s??v?.min_via_edge_to_pad_edge_clearance,ht=a??v?.min_via_hole_edge_to_via_hole_edge_clearance,We=c??v?.min_plated_hole_drill_edge_to_drill_edge_clearance,Le=l??v?.min_pad_edge_to_pad_edge_clearance,Ze=h??v?.min_board_edge_clearance;return{simpleRouteJson:{bounds:ee,obstacles:U,connections:nt,differentialPairs:lt,...Ct?{buses:Ct}:{},traces:H.length>0?H:void 0,layerCount:v?.num_layers??2,allowBlindAndBuriedVias:v?.allow_blind_and_buried_vias??!1,allowViaInPad:v?.is_via_in_pad_allowed??!1,minTraceWidth:Math.min(dt,...nt.map(($e)=>$e.width)),minViaDiameter:Ht,minViaHoleDiameter:Nt,minViaPadDiameter:Ht,min_via_hole_diameter:Nt,min_via_pad_diameter:Ht,minTraceToPadEdgeClearance:et,minTraceToHoleEdgeClearance:Tt,minViaEdgeToPadEdgeClearance:vt,minViaHoleEdgeToViaHoleEdgeClearance:ht,minPlatedHoleDrillEdgeToDrillEdgeClearance:We,minPadEdgeToPadEdgeClearance:Le,minBoardEdgeClearance:Ze,nominalTraceWidth:_,outline:NSn({bounds:J??ee,outline:v?.outline?.map(($e)=>({...$e}))},ee)},connMap:N}};var RSn=class extends lr{matchedPort=null;get config(){return{componentName:"TraceHint",zodProps:uEt}}doInitialPortMatching(){let{db:e}=this.root,{_parsedProps:t,parent:n}=this;if(!n)return;if(n.componentName==="Trace"){this.renderError(`Port inference inside trace is not yet supported (${this})`);return}if(!n)throw Error("TraceHint has no parent");if(!t.for){this.renderError(`TraceHint has no for property (${this})`);return}let o=n.selectOne(t.for,{type:"port"});if(!o)this.renderError(`${this} could not find port for selector "${t.for}"`);this.matchedPort=o,o.registerMatch(this)}getPcbRouteHints(){let{_parsedProps:e}=this,t=e.offset?[e.offset]:e.offsets;if(!t)return[];let n=this._computePcbGlobalTransformBeforeLayout();return t.map((o)=>({..._o(n,o),via:o.via,to_layer:o.to_layer,trace_width:o.trace_width}))}doInitialPcbTraceHintRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this;e.pcb_trace_hint.insert({pcb_component_id:this.matchedPort?.pcb_component_id,pcb_port_id:this.matchedPort?.pcb_port_id,route:this.getPcbRouteHints()})}};function xdi({anchor:e,x:t,y:n,width:o,height:r,isInside:i}){switch(e){case"top_left":return{x:t,y:n+r,textAnchor:i?"top_left":"bottom_left"};case"top_center":return{x:t+o/2,y:n+r,textAnchor:i?"top_center":"bottom_center"};case"top_right":return{x:t+o,y:n+r,textAnchor:i?"top_right":"bottom_right"};case"center_left":return{x:t,y:n+r/2,textAnchor:i?"center_left":"center_right"};case"center":return{x:t+o/2,y:n+r/2,textAnchor:"center"};case"center_right":return{x:t+o,y:n+r/2,textAnchor:i?"center_right":"center_left"};case"bottom_left":return{x:t,y:n,textAnchor:i?"bottom_left":"top_left"};case"bottom_center":return{x:t+o/2,y:n,textAnchor:i?"bottom_center":"top_center"};case"bottom_right":return{x:t+o,y:n,textAnchor:i?"bottom_right":"top_right"};default:return{x:t+o/2,y:n+r,textAnchor:"center"}}}var QSn=(e)=>{if(!e)return[];return Object.entries(bde(e)).map(([t,n])=>{let o=jB(t);if(o===null)throw Error(`Invalid schematicbox pinLabels key "${t}". Expected pin<number>.`);let r=typeof n==="string"?[n]:[...n];return{pinNumber:o,displayPinLabel:r[0]??t,pinAliases:r}})},Cdi=({referencedChip:e,schematicBoxPins:t})=>{let n=oue(e._parsedProps.schPinStyle,e._parsedProps.pinLabels);if(!n)return;let o={};for(let{pinNumber:r,referencedSourcePort:i}of t){if(i.pin_number===void 0)continue;let s=n[`pin${i.pin_number}`];if(s)o[`pin${r}`]=s}return Object.keys(o).length>0?o:void 0},bdi=({inheritedPinStyle:e,overridePinStyle:t})=>{if(!e&&!t)return;let n={...e};for(let[o,r]of Object.entries(t??{}))n[o]={...n[o],...r};return Object.keys(n).length>0?n:void 0},Idi=(e)=>{if(e.root?.schematicDisabled)return;let{db:t}=e.root,n=e._parsedProps;if(!n.chipRef)return;let o=e.getSubcircuit().selectOne(n.chipRef);if(!o?.source_component_id)throw Error(`Could not resolve chipRef "${n.chipRef}" for ${e.getString()}`);let r=QSn(n.pinLabels),i=Object.fromEntries(r.map(({pinNumber:f,displayPinLabel:y})=>[`pin${f}`,y])),s=t.source_port.list({source_component_id:o.source_component_id}),a=r.map((f)=>{let y=s.find((x)=>f.pinAliases.some((C)=>x.name===C||x.port_hints?.includes(C)));if(!y)throw Error(`Could not find pin "${f.displayPinLabel}" on chipRef "${n.chipRef}"`);return{...f,referencedSourcePort:y}}),c=Cdi({referencedChip:o,schematicBoxPins:a}),l=bdi({inheritedPinStyle:c,overridePinStyle:oue(n.schPinStyle,n.pinLabels)}),h=Fst({schWidth:n.width,schHeight:n.height,schPinSpacing:0.2,pinCount:r.length,schPortArrangement:n.schPinArrangement,numericSchPinStyle:oue(l),pinLabels:i}),d=e._getGlobalSchematicPositionBeforeLayout(),u=h.getSize(),_=e._resolveSchematicSheetId(),p=Object.fromEntries(r.map(({pinNumber:f,displayPinLabel:y})=>[String(f),y])),m=t.schematic_component.insert({center:d,size:u,source_component_id:o.source_component_id,is_box_with_pins:!0,port_arrangement:Qst(n.schPinArrangement),port_labels:p,pin_spacing:0.2,pin_styles:Rst(l),schematic_sheet_id:_});e.schematic_component_id=m.schematic_component_id;for(let{pinNumber:f,displayPinLabel:y,referencedSourcePort:x}of a){let C=h.getPortPositionByPinNumber(f);if(!C)throw Error(`Could not determine schematic position for ${e.getString()} pin${f}`);let b={left:"left",right:"right",top:"up",bottom:"down"}[C.side];t.schematic_port.insert({schematic_component_id:m.schematic_component_id,center:{x:d.x+C.x,y:d.y+C.y},source_port_id:x.source_port_id,facing_direction:b,distance_from_component_edge:0.4,side_of_component:C.side,pin_number:f,true_ccw_index:C.trueIndex,display_pin_label:y,is_connected:!1,schematic_sheet_id:_})}let A=n.name??n.chipRef;t.schematic_text.insert({text:A,schematic_component_id:m.schematic_component_id,anchor:"left",rotation:0,position:{x:d.x-u.width/2,y:d.y+u.height/2+0.13},color:"#006464",font_size:0.18,schematic_sheet_id:_});let g=t.source_component.get(o.source_component_id);t.schematic_text.insert({text:g?.manufacturer_part_number??"",schematic_component_id:m.schematic_component_id,anchor:"left",rotation:0,position:{x:d.x-u.width/2,y:d.y-u.height/2-0.13},color:"#006464",font_size:0.18,schematic_sheet_id:_})},kSn=class extends lr{isSchematicPrimitive=!0;get config(){return{componentName:"SchematicBox",zodProps:WPt,shouldRenderAsSchematicBox:!0}}doInitialSchematicComponentRender(){Idi(this)}doInitialSchematicPrimitiveRender(){if(this.root?.schematicDisabled)return;if(this.getCollapsedSchematicBoxAncestor())return;let{db:e}=this.root,{_parsedProps:t}=this;if(t.chipRef)return;let n=0.6,o=typeof t.padding==="number"?t.padding:0,r=typeof t.paddingTop==="number"?t.paddingTop:o,i=typeof t.paddingBottom==="number"?t.paddingBottom:o,s=typeof t.paddingLeft==="number"?t.paddingLeft:o,a=typeof t.paddingRight==="number"?t.paddingRight:o,c=t.overlay&&t.overlay.length>0,l=typeof t.width==="number"&&typeof t.height==="number",h,d,u,_,p,m;if(c){let g=t.overlay.map((j)=>({selector:j,port:this.getSubcircuit().selectOne(j,{type:"port"})})).filter(({port:j})=>j!=null).map(({port:j})=>({position:j._getGlobalSchematicPositionAfterLayout()}));if(g.length===0)return;let f=g.map((j)=>j.position.x),y=g.map((j)=>j.position.y),x=Math.min(...f),C=Math.max(...f),b=Math.min(...y),I=Math.max(...y),v=C-x,P=I-b,M=v===0?n:0,B=P===0?n:0,T=s+M/2,N=a+M/2,D=r+B/2,L=i+B/2,H=x-T,V=C+N,O=b-L,U=I+D;h=V-H,d=U-O,u=H+(t.schX??0),_=O+(t.schY??0),p=u+h/2,m=_+d/2}else if(l){h=t.width,d=t.height;let A=this._getGlobalSchematicPositionBeforeLayout();p=A.x,m=A.y,u=p-h/2,_=m-d/2}else return;if(e.schematic_box.insert({height:d,width:h,x:u,y:_,is_dashed:t.strokeStyle==="dashed",schematic_sheet_id:this._resolveSchematicSheetId()}),t.title){let A=t.titleInside,g=0.1,f=t.titleAlignment,y=xdi({anchor:f,x:u,y:_,width:h,height:d,isInside:A}),x,C,b=y.textAnchor;if(A)x=f.includes("top")?-0.1:f.includes("bottom")?0.1:0,C=f.includes("left")?0.1:f.includes("right")?-0.1:0;else x=f.includes("top")?0.1:f.includes("bottom")?-0.1:0,C=f.includes("center_left")?-0.1:f.includes("center_right")?0.1:0;let I=y.x+C,v=y.y+x;e.schematic_text.insert({anchor:b,text:t.title,font_size:t.titleFontSize??0.18,color:t.titleColor??"#000000",position:{x:I,y:v},rotation:0,schematic_sheet_id:this._resolveSchematicSheetId()})}}},vdi=(e)=>{if(!e.isSubcircuit||e.root?.schematicDisabled)return;let{db:t}=e.root,n=new Map,o=new Set,r=e.getDescendants().filter((s)=>s instanceof kSn&&s.getSubcircuit()===e);for(let s of r){let{chipRef:a,pinLabels:c}=s._parsedProps,l=s._resolveSchematicSheetId();if(!a||!l)continue;let h=s.getSubcircuit().selectOne(a);if(!(h instanceof Xl))continue;if(!h.source_component_id)continue;o.add(h.source_component_id);let d=t.source_port.list({source_component_id:h.source_component_id});for(let{pinAliases:u}of QSn(c)){let p=d.find((A)=>u.some((g)=>A.name===g||A.port_hints?.includes(g)))?.subcircuit_connectivity_map_key;if(!p)continue;let m=n.get(p)??new Set;m.add(l),n.set(p,m)}}let i=e.getDescendants().filter((s)=>s instanceof Xl&&s.getSubcircuit()===e);for(let s of i){if(!s.source_component_id)continue;if(o.has(s.source_component_id))continue;if(s._resolveSchematicSheetId())continue;let a=new Set,c=t.source_port.list({source_component_id:s.source_component_id});for(let h of c){let d=h.subcircuit_connectivity_map_key;if(!d)continue;let u=n.get(d);if(!u)continue;for(let _ of u)a.add(_)}if(a.size!==1)continue;let[l]=a;if(!l)continue;s.schematic_sheet_id=l}},Sdi=new Set(["x","y","minx","maxx","miny","maxy","width","height"]);function Pdi(e){if(e.root?.pcbDisabled)return;if(!e.isSubcircuit)return;let{db:t}=e.root,n=e.getNormalComponentNameMap?.()??new Map,o=Edi(e);if(!o.some(a5n))return;let r={};for(let d of o)c5n(d,r);let i=new Map,s=new Map,a=new Map;for(let d of o){if(!a5n(d))continue;let u=Mdi(d);if(!d.name)throw Error(`Invalid pcb position expression for ${d.getString()}: component-relative calc requires the component to have a name`);i.set(d.name,{component:d,refs:u}),s.set(d.name,0)}for(let[d,u]of i.entries()){let _=new Set;for(let p of u.refs){let{referencePath:m,field:A}=wdi(p);if(!Sdi.has(A))throw Error(`Invalid pcb position expression for ${u.component.getString()}: unsupported component field "${A}" in "${p}"`);let g=Bdi({token:p,referencePath:m,candidate:u,normalComponentNameMap:n});if(i.has(g)&&g!==d)_.add(g)}for(let p of _){if(s.set(d,(s.get(d)??0)+1),!a.has(p))a.set(p,new Set);a.get(p).add(d)}}let c=[...s.entries()].filter(([,d])=>d===0).map(([d])=>d),l=0;while(c.length>0){let d=c.shift(),u=i.get(d);if(!u)continue;h(u.component,r),l++;for(let _ of a.get(d)??[]){let p=(s.get(_)??0)-1;if(s.set(_,p),p===0)c.push(_)}}if(l<i.size){let d=[...i.keys()].filter((u)=>(s.get(u)??0)>0);throw Error(`Circular pcb position calc references detected among: ${d.join(", ")}`)}function h(d,u){if(!d.pcb_component_id)return;let _=t.pcb_component.get(d.pcb_component_id);if(!_)return;let p=d._parsedProps.pcbX,m=d._parsedProps.pcbY,A=d.props,g=d._parsedProps.pcbLeftEdgeX??A.pcbLeftEdgeX,f=d._parsedProps.pcbRightEdgeX??A.pcbRightEdgeX,y=d._parsedProps.pcbTopEdgeY??A.pcbTopEdgeY,x=d._parsedProps.pcbBottomEdgeY??A.pcbBottomEdgeY;if(g!==void 0&&f!==void 0)throw Error(`${d.componentName} cannot set both pcbLeftEdgeX and pcbRightEdgeX`);if(y!==void 0&&x!==void 0)throw Error(`${d.componentName} cannot set both pcbTopEdgeY and pcbBottomEdgeY`);let C=_.width??0,b=_.height??0,I={x:_.center.x,y:_.center.y};if(p!==void 0){let v=d.resolvePcbCoordinate({rawValue:p,axis:"pcbX",allowComponentVariables:!0,componentVariables:u});d._resolvedPcbCalcOffsetX=v,I.x=v}else if(g!==void 0){let P=d.resolvePcbCoordinate({rawValue:g,axis:"pcbX",allowComponentVariables:!0,componentVariables:u,propertyName:"pcbLeftEdgeX"})+C/2;d._resolvedPcbCalcOffsetX=P,I.x=P}else if(f!==void 0){let P=d.resolvePcbCoordinate({rawValue:f,axis:"pcbX",allowComponentVariables:!0,componentVariables:u,propertyName:"pcbRightEdgeX"})-C/2;d._resolvedPcbCalcOffsetX=P,I.x=P}if(m!==void 0){let v=d.resolvePcbCoordinate({rawValue:m,axis:"pcbY",allowComponentVariables:!0,componentVariables:u});d._resolvedPcbCalcOffsetY=v,I.y=v}else if(y!==void 0){let P=d.resolvePcbCoordinate({rawValue:y,axis:"pcbY",allowComponentVariables:!0,componentVariables:u,propertyName:"pcbTopEdgeY"})-b/2;d._resolvedPcbCalcOffsetY=P,I.y=P}else if(x!==void 0){let P=d.resolvePcbCoordinate({rawValue:x,axis:"pcbY",allowComponentVariables:!0,componentVariables:u,propertyName:"pcbBottomEdgeY"})+b/2;d._resolvedPcbCalcOffsetY=P,I.y=P}d._repositionOnPcb(I),c5n(d,u)}}function a5n(e){let{_parsedProps:t,props:n}=e,{pcbX:o,pcbY:r}=t,i=t.pcbLeftEdgeX??n.pcbLeftEdgeX,s=t.pcbRightEdgeX??n.pcbRightEdgeX,a=t.pcbTopEdgeY??n.pcbTopEdgeY,c=t.pcbBottomEdgeY??n.pcbBottomEdgeY;if(i!==void 0||s!==void 0||a!==void 0||c!==void 0)return!0;return typeof o==="string"||typeof r==="string"}function Edi(e){let t=[],n=(o)=>{if(o._isNormalComponent)t.push(o);for(let r of o.children)if(!r.isSubcircuit)n(r)};for(let o of e.children)if(!o.isSubcircuit)n(o);return t}function Mdi(e){let t=new Set,n=e._parsedProps.pcbX,o=e._parsedProps.pcbY,r=e.props,i=e._parsedProps.pcbLeftEdgeX??r.pcbLeftEdgeX,s=e._parsedProps.pcbRightEdgeX??r.pcbRightEdgeX,a=e._parsedProps.pcbTopEdgeY??r.pcbTopEdgeY,c=e._parsedProps.pcbBottomEdgeY??r.pcbBottomEdgeY,l=(h)=>{if(typeof h!=="string")return;let d=brt(h);for(let u of d)if(!u.startsWith("board."))t.add(u)};return l(n),l(o),l(i),l(s),l(a),l(c),t}function wdi(e){let t=e.lastIndexOf(".");if(t<=0||t===e.length-1)throw Error(`Invalid component reference token: "${e}"`);return{referencePath:e.slice(0,t),field:e.slice(t+1).toLowerCase()}}function Bdi(e){let{token:t,referencePath:n,candidate:o,normalComponentNameMap:r}=e,i=r.get(n);if(i&&i.length>0){if(i.length>1)throw Error(`Invalid pcb position expression for ${o.component.getString()}: ambiguous component reference "${n}" in "${t}"`);return n}let s=null;for(let a of r.keys()){if(!n.startsWith(`${a}.`))continue;if(!s||a.length>s.length)s=a}if(!s)throw Error(`Invalid pcb position expression for ${o.component.getString()}: unknown component reference "${n}" in "${t}"`);return s}function c5n(e,t){if(!e.name||!e.pcb_component_id||!e.root)return;let n=e.root.db.pcb_component.get(e.pcb_component_id);if(!n)return;let o=n.width??0,r=n.height??0,i=n.center.x,s=n.center.y;Q4n({vars:t,componentName:e.name,position:{x:i,y:s},size:{width:o,height:r}});let a=Tdi(e);for(let[c,l]of a.entries()){let h=ky(l),{minX:d,maxX:u,minY:_,maxY:p}=h;t[`${c}.x`]=(d+u)/2,t[`${c}.y`]=(_+p)/2,t[`${c}.width`]=u-d,t[`${c}.height`]=p-_,t[`${c}.minX`]=d,t[`${c}.maxX`]=u,t[`${c}.minY`]=_,t[`${c}.maxY`]=p}}function Tdi(e){let t=new Map;if(!e.name||!e.pcb_component_id||!e.root)return t;let{db:n}=e.root,o=[...n.pcb_smtpad.list({pcb_component_id:e.pcb_component_id}),...n.pcb_plated_hole.list({pcb_component_id:e.pcb_component_id})];for(let r of o){let i=new Set;for(let a of r.port_hints??[])if(typeof a==="string"&&a.length>0)i.add(a);let s=r.pcb_port_id;if(s){let a=n.pcb_port.get(s),c=a?.source_port_id?n.source_port.get(a.source_port_id):null;if(c?.name)i.add(c.name);if(c?.pin_number!=null)i.add(`pin${c.pin_number}`)}for(let a of i){let c=`${e.name}.${a}`;if(!t.has(c))t.set(c,[]);t.get(c).push(r)}}return t}function Ddi(e){if(e.root?.pcbDisabled)return;if(!e.pcb_group_id)return;let t=e._parsedProps?.pcbPositionAnchor;if(!t)return;let n=e._getGlobalPcbPositionBeforeLayout(),{pcbX:o,pcbY:r}=e._parsedProps;if(o===void 0&&r===void 0)return;let{db:i}=e.root,s=i.pcb_group.get(e.pcb_group_id);if(!s)return;let{width:a,height:c}=s,{center:l}=s;if(s.outline&&s.outline.length>0){let m=Hs(s.outline);if(m)a=m.maxX-m.minX,c=m.maxY-m.minY}if(!a||!c)return;let h={left:l.x-a/2,right:l.x+a/2,top:l.y+c/2,bottom:l.y-c/2},d={...l},u=null;if(new Set(["center","top_left","top_center","top_right","center_left","center_right","bottom_left","bottom_center","bottom_right"]).has(t))switch(t){case"center":u=d;break;case"top_left":u={x:h.left,y:h.top};break;case"top_center":u={x:d.x,y:h.top};break;case"top_right":u={x:h.right,y:h.top};break;case"center_left":u={x:h.left,y:d.y};break;case"center_right":u={x:h.right,y:d.y};break;case"bottom_left":u={x:h.left,y:h.bottom};break;case"bottom_center":u={x:d.x,y:h.bottom};break;case"bottom_right":u={x:h.right,y:h.bottom};break}if(!u)return;let p={...d};if(n.x!==void 0)p.x+=n.x-u.x;if(n.y!==void 0)p.y+=n.y-u.y;if(Math.abs(p.x-d.x)>0.000001||Math.abs(p.y-d.y)>0.000001)e._repositionOnPcb(p),i.pcb_group.update(e.pcb_group_id,{center:p});i.pcb_group.update(e.pcb_group_id,{anchor_position:n,anchor_alignment:t,display_offset_x:o,display_offset_y:r})}var Ndi=(e)=>{let{db:t}=e.root,{_parsedProps:n}=e,o=e.children.filter((C)=>C.pcb_component_id||C.pcb_group_id);if(o.some((C)=>{let b=C._parsedProps;return b?.pcbX!==void 0||b?.pcbY!==void 0}))return;let i=n.pcbJustifyContent??n.justifyContent,s=n.pcbAlignItems??n.alignItems,a=n.pcbFlexGap??n.pcbGap??n.gap,c=n.pcbFlexDirection??"row",l={start:"flex-start",end:"flex-end","flex-start":"flex-start","flex-end":"flex-end",stretch:"space-between","space-between":"space-between","space-around":"space-around","space-evenly":"space-evenly",center:"center"}[i??"space-between"],h={start:"flex-start",end:"flex-end","flex-start":"flex-start","flex-end":"flex-end",stretch:"stretch",center:"center"}[s??"center"];if(!l)throw Error(`Invalid justifyContent value: "${i}"`);if(!h)throw Error(`Invalid alignItems value: "${s}"`);let d=0,u=0;if(typeof a==="object")d=a.y??0,u=a.x??0;else if(typeof a==="number")d=a,u=a;else if(typeof a==="string")d=ve.parse(a),u=ve.parse(a);let _,p=n.width??n.pcbWidth??void 0,m=n.height??n.pcbHeight??void 0;if(Boolean(p===void 0||m===void 0))_=s2e(o.map((C)=>C._getMinimumFlexContainerSize()).filter((C)=>C!==null),{alignItems:h,justifyContent:l,direction:c,rowGap:d,columnGap:u}),p=_.width,m=_.height;let g=new R6e(p,m,{alignItems:h,justifyContent:l,direction:c,rowGap:d,columnGap:u});for(let C of o){let b=C._getMinimumFlexContainerSize();g.addChild({metadata:C,width:b?.width??0,height:b?.height??0,flexBasis:!b?void 0:c==="row"?b.width:b.height})}g.build();let f={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0,width:0,height:0};for(let C of g.children)f.minX=Math.min(f.minX,C.position.x),f.minY=Math.min(f.minY,C.position.y),f.maxX=Math.max(f.maxX,C.position.x+C.size.width),f.maxY=Math.max(f.maxY,C.position.y+C.size.height);f.width=f.maxX-f.minX,f.height=f.maxY-f.minY;let y=e._getGlobalPcbPositionBeforeLayout(),x={x:y.x-(f.maxX+f.minX)/2,y:y.y-(f.maxY+f.minY)/2};for(let C of g.children)C.metadata._repositionOnPcb({x:C.position.x+C.size.width/2+x.x,y:C.position.y+C.size.height/2+x.y});t.pcb_group.update(e.pcb_group_id,{width:f.width,height:f.height,center:y})},ort=1;function Rdi(e){let{db:t}=e.root,n=e._parsedProps,o=Qdi(e);if(o.length===0)return;let r=kdi({db:t,pcbChildren:o}),i=Ldi(n),s=Hdi({props:n,pcbChildren:o,childDimensions:r,gridConfig:i}),a=Odi({pcbChildren:o,childDimensions:r,gridLayout:s,gridConfig:i}),{itemCoordinates:c}=a.layout();Vdi({db:t,group:e,pcbChildren:o,itemCoordinates:c,gridLayout:s}),Ydi({db:t,group:e,props:n,gridLayout:s})}function Qdi(e){return e.children.filter((t)=>t.pcb_component_id||t.pcb_group_id)}function kdi(e){let{db:t,pcbChildren:n}=e,o=0,r=0;for(let i of n){let s=0,a=0;if(i.pcb_group_id){let c=t.pcb_group.get(i.pcb_group_id);s=c?.width??0,a=c?.height??0}else if(i.pcb_component_id){let c=t.pcb_component.get(i.pcb_component_id);s=c?.width??0,a=c?.height??0}o=Math.max(o,s),r=Math.max(r,a)}return{width:o,height:r}}function Ldi(e){let t=e.pcbGridCols??e.gridCols??e.pcbLayout?.grid?.cols,n=e.pcbGridRows??e.pcbLayout?.grid?.rows,{pcbGridTemplateColumns:o,pcbGridTemplateRows:r}=e,i=(d)=>{if(d===void 0)return ort;return typeof d==="number"?d:ve.parse(d)},s=e.pcbGridGap??e.gridGap??e.pcbLayout?.gridGap,a=e.pcbGridRowGap??e.gridRowGap??e.pcbLayout?.gridRowGap,c=e.pcbGridColumnGap??e.gridColumnGap??e.pcbLayout?.gridColumnGap,l=ort,h=ort;if(a!==void 0||c!==void 0){let d=typeof s==="object"?s?.x:s,u=typeof s==="object"?s?.y:s;l=i(c??d),h=i(a??u)}else if(typeof s==="object"&&s!==null)l=i(s.x),h=i(s.y);else{let d=i(s);l=d,h=d}return{cols:t,rows:n,gapX:l,gapY:h,templateColumns:o,templateRows:r}}function Hdi(e){let{props:t,pcbChildren:n,childDimensions:o,gridConfig:r}=e;if(t.pcbGridTemplateColumns||t.pcbGridTemplateRows)return Fdi({props:t,gridConfig:r,pcbChildren:n,childDimensions:o});return zdi({gridConfig:r,pcbChildren:n,childDimensions:o})}function Fdi(e){let{props:t,gridConfig:n,pcbChildren:o,childDimensions:r}=e,i=t.pcbGridTemplateColumns??"",s=t.pcbGridTemplateRows??"",a=(u)=>{let _=u.match(/repeat\((\d+),/);return _?parseInt(_[1]):Math.ceil(Math.sqrt(o.length))},c=t.pcbGridTemplateColumns?a(i):Math.ceil(Math.sqrt(o.length)),l=t.pcbGridTemplateRows?a(s):Math.ceil(o.length/c),h=c*r.width+Math.max(0,c-1)*n.gapX,d=l*r.height+Math.max(0,l-1)*n.gapY;return{gridTemplateColumns:i,gridTemplateRows:s,containerWidth:h,containerHeight:d}}function zdi(e){let{gridConfig:t,pcbChildren:n,childDimensions:o}=e,r,i;if(t.cols!==void 0&&t.rows!==void 0)r=t.cols,i=t.rows;else if(t.cols!==void 0)r=t.cols,i=Math.ceil(n.length/r);else if(t.rows!==void 0)i=t.rows,r=Math.ceil(n.length/i);else r=Math.ceil(Math.sqrt(n.length)),i=Math.ceil(n.length/r);r=Math.max(1,r),i=Math.max(1,i);let s=r*o.width+Math.max(0,r-1)*t.gapX,a=i*o.height+Math.max(0,i-1)*t.gapY,c=`repeat(${r}, ${o.width}px)`,l=`repeat(${i}, ${o.height}px)`;return{gridTemplateColumns:c,gridTemplateRows:l,containerWidth:s,containerHeight:a}}function Odi(e){let{pcbChildren:t,childDimensions:n,gridLayout:o,gridConfig:r}=e,i=t.map((s,a)=>({key:s.getString()||`child-${a}`,contentWidth:n.width,contentHeight:n.height}));return new thn({containerWidth:o.containerWidth,containerHeight:o.containerHeight,gridTemplateColumns:o.gridTemplateColumns,gridTemplateRows:o.gridTemplateRows,gap:[r.gapY,r.gapX],children:i})}function Vdi(e){let{db:t,group:n,pcbChildren:o,itemCoordinates:r,gridLayout:i}=e,s=n._getGlobalPcbPositionBeforeLayout(),a=t.toArray();for(let c=0;c<o.length;c++){let l=o[c],h=l.getString()||`child-${c}`,d=r[h];if(!d){console.warn(`PCB grid layout: No coordinates found for child ${h}`);continue}let u=s.x-i.containerWidth/2+d.x+d.width/2,_=s.y+i.containerHeight/2-d.y-d.height/2;if(l.pcb_component_id)r2e(a,l.pcb_component_id,{x:u,y:_});else{let p=l;if(p.pcb_group_id&&p.source_group_id)i2e(a,p.source_group_id,{x:u,y:_})}}}function Ydi(e){let{db:t,group:n,props:o,gridLayout:r}=e;if(n.pcb_group_id){let i=n._getGlobalPcbPositionBeforeLayout();t.pcb_group.update(n.pcb_group_id,{width:o.width??r.containerWidth,height:o.height??r.containerHeight,center:i})}}var Gdi=(e,t,n=()=>performance.now())=>{if(t===void 0||!Number.isFinite(t)||t<=0)return e.solve(),{elapsedMs:0,timedOut:!1};let o=n(),r=0;while(!e.solved&&!e.failed){if(e.step(),e.solved||e.failed)break;if(r=n()-o,r>=t)return{elapsedMs:r,timedOut:!0}}return{elapsedMs:r,timedOut:!1}},Udi=(e,t)=>{let n=e.children.filter((d)=>d.componentName==="Constraint"&&d._parsedProps.pcb),o=new Map,r={},i=(d)=>{if(r[d]!==d)r[d]=i(r[d]);return r[d]},s=(d,u)=>{let _=i(d),p=i(u);if(_!==p)r[p]=_},a=(d)=>{if(!(d in r))r[d]=d},c=(d)=>{let u=d.startsWith(".")?d.slice(1):d;return e.children.find((p)=>p.name===u)?.pcb_component_id??void 0};for(let d of n){let u=d._parsedProps;if("left"in u&&"right"in u){let _=c(u.left),p=c(u.right);if(_&&p)a(_),a(p),s(_,p)}else if("top"in u&&"bottom"in u){let _=c(u.top),p=c(u.bottom);if(_&&p)a(_),a(p),s(_,p)}else if("for"in u&&Array.isArray(u.for)){let _=u.for.map((p)=>c(p)).filter((p)=>!!p);for(let p of _)a(p);for(let p=1;p<_.length;p++)s(_[0],_[p])}}for(let d of Object.keys(r)){let u=i(d);if(!o.has(u))o.set(u,{componentIds:[],constraints:[]});o.get(u).componentIds.push(d)}for(let d of n){let u=d._parsedProps,_;if("left"in u)_=c(u.left);else if("top"in u)_=c(u.top);else if("for"in u)_=c(u.for[0]);if(!_)continue;let p=i(_);o.get(p)?.constraints.push(d)}let l={},h=Object.fromEntries(t.components.map((d)=>[d.componentId,d]));for(let[d,u]of o.entries()){if(u.componentIds.length<=1)continue;let _=new fae,p={},m=(P,M)=>{let B=`${P}_${M}`;if(!p[B])p[B]=new sQ(B);return p[B]},A=u.componentIds[0];_.addConstraint(new XA(m(A,"x"),tm.Eq,0,Oh.required)),_.addConstraint(new XA(m(A,"y"),tm.Eq,0,Oh.required));for(let P of u.constraints){let M=P._parsedProps;if("xDist"in M){let B=c(M.left),T=c(M.right);if(B&&T)_.addConstraint(new XA(new Md(m(T,"x"),[-1,m(B,"x")]),tm.Eq,M.xDist,Oh.required))}else if("yDist"in M){let B=c(M.top),T=c(M.bottom);if(B&&T)_.addConstraint(new XA(new Md(m(B,"y"),[-1,m(T,"y")]),tm.Eq,M.yDist,Oh.required))}else if("sameX"in M&&Array.isArray(M.for)){let B=M.for.map((T)=>c(T)).filter((T)=>!!T);if(B.length>1){let T=m(B[0],"x");for(let N=1;N<B.length;N++)_.addConstraint(new XA(new Md(m(B[N],"x"),[-1,T]),tm.Eq,0,Oh.required))}}else if("sameY"in M&&Array.isArray(M.for)){let B=M.for.map((T)=>c(T)).filter((T)=>!!T);if(B.length>1){let T=m(B[0],"y");for(let N=1;N<B.length;N++)_.addConstraint(new XA(new Md(m(B[N],"y"),[-1,T]),tm.Eq,0,Oh.required))}}}_.updateVariables();let g={};for(let P of u.componentIds)g[P]={x:m(P,"x").value(),y:m(P,"y").value()};let f=1/0,y=1/0,x=-1/0,C=-1/0;for(let P of u.componentIds){let M=h[P],B=g[P];if(!M)continue;for(let T of M.pads){let N=B.x+T.offset.x,D=B.y+T.offset.y;f=Math.min(f,N-T.size.x/2),x=Math.max(x,N+T.size.x/2),y=Math.min(y,D-T.size.y/2),C=Math.max(C,D+T.size.y/2)}}let b={x:(f+x)/2,y:(y+C)/2},I=[],v={};for(let P of u.componentIds){let M=h[P],B=g[P];if(!M)continue;v[P]={x:B.x-b.x,y:B.y-b.y};for(let T of M.pads)I.push({padId:T.padId,networkId:T.networkId,type:T.type,size:T.size,offset:{x:B.x+T.offset.x-b.x,y:B.y+T.offset.y-b.y}})}t.components=t.components.filter((P)=>!u.componentIds.includes(P.componentId)),t.components.push({componentId:u.componentIds[0],pads:I,availableRotationDegrees:[0]}),u.relativeCenters=v,l[u.componentIds[0]]=u}return l},l5n=({db:e,pcbComponentId:t,rotationDegrees:n,layer:o})=>{if(n==null)return;if(!e?.cad_component?.list)return;let r=e.cad_component.getWhere({pcb_component_id:t});if(!r)return;let i=o?.toLowerCase?.()==="bottom"?-n:n,s=r.rotation?.z??0,a={...r.rotation??{x:0,y:0,z:0},z:Bu(s+i)};e.cad_component.update(r.cad_component_id,{rotation:a}),r.rotation=a},Bde=(e,t,n)=>{if(t===n)return!0;let o=e.source_group.get(t);if(!o||!o.parent_source_group_id)return!1;return Bde(e,o.parent_source_group_id,n)},Wdi=(e,t,n,o)=>{let{db:r}=e.root;for(let i of t.components){if(i.isStatic)continue;let{center:s,componentId:a,ccwRotationOffset:c,ccwRotationDegrees:l}=i,h=n[a];if(h){let f=l??c??0,y=f*Math.PI/180;for(let x of h.componentIds){let C=h.relativeCenters[x];if(!C)continue;r.pcb_component.update(x,{position_mode:"packed"});let b={x:C.x*Math.cos(y)-C.y*Math.sin(y),y:C.x*Math.sin(y)+C.y*Math.cos(y)},I=r.pcb_component.get(x);if(!I)continue;let v=I.center,P=Hi(e._computePcbGlobalTransformBeforeLayout(),Ii(s.x+b.x,s.y+b.y),Yg(y),Ii(-v.x,-v.y)),M=r.toArray().filter((B)=>("pcb_component_id"in B)&&B.pcb_component_id===x);TR(M,P),l5n({db:r,pcbComponentId:x,rotationDegrees:f,layer:I.layer})}continue}let d=r.pcb_component.get(a);if(d){r.pcb_component.update(a,{position_mode:"packed"});let f=e.source_group_id,x=r.source_component.get(d.source_component_id)?.source_group_id;if(x!==void 0&&!Bde(r,x,f))continue;let C=d.center,b=l??c??0,I=Hi(e._computePcbGlobalTransformBeforeLayout(),Ii(s.x,s.y),Yg(b*Math.PI/180),Ii(-C.x,-C.y)),v=r.toArray().filter((P)=>("pcb_component_id"in P)&&P.pcb_component_id===a);TR(v,I),l5n({db:r,pcbComponentId:a,rotationDegrees:b,layer:d.layer});continue}let u=r.pcb_group.list().find((f)=>f.source_group_id===a);if(!u)continue;let p=o.components.find((f)=>f.componentId===a)?.center??u.center,m=l??c??0,A=Hi(e._computePcbGlobalTransformBeforeLayout(),Ii(s.x,s.y),Yg(m*Math.PI/180),Ii(-p.x,-p.y)),g=r.toArray().filter((f)=>{if("source_group_id"in f&&f.source_group_id){if(f.source_group_id===a)return!0;if(Bde(r,f.source_group_id,a))return!0}if("source_component_id"in f&&f.source_component_id){let y=r.source_component.get(f.source_component_id);if(y?.source_group_id){if(y.source_group_id===a)return!0;if(Bde(r,y.source_group_id,a))return!0}}if("pcb_component_id"in f&&f.pcb_component_id){let y=r.pcb_component.get(f.pcb_component_id);if(y?.source_component_id){let x=r.source_component.get(y.source_component_id);if(x?.source_group_id){if(x.source_group_id===a)return!0;if(Bde(r,x.source_group_id,a))return!0}}}return!1});for(let f of g)if(f.type==="pcb_component")r.pcb_component.update(f.pcb_component_id,{position_mode:"packed"});TR(g,A),r.pcb_group.update(u.pcb_group_id,{center:s})}if(e.pcb_group_id){let i=r.pcb_component.list({pcb_group_id:e.pcb_group_id});e.calculatePcbGroupBounds(o2e(i))}},h5n=(e)=>(e??"top").toLowerCase(),HSn=(e,t)=>{let n=new Set,o=t.pcb_component.get(e.componentId);if(o)n.add(h5n(o.layer));for(let r of e.pads){let i=t.pcb_via.get(r.padId),s=t.pcb_smtpad.get(r.padId)?.pcb_component_id??t.pcb_plated_hole.get(r.padId)?.pcb_component_id??i?.pcb_component_id;if(!s)continue;let a=t.pcb_component.get(s);if(a)n.add(h5n(a.layer))}return n.size===1?n.values().next().value:void 0},Xdi=(e,t)=>{let n=new Map;for(let r of e.components){let i=HSn(r,t);if(!i)return[e];let s=n.get(i)??[];s.push(r),n.set(i,s)}if(n.size<=1)return[e];let o=(r)=>{if(r==="top")return 0;if(r==="bottom")return 1;return 2};return Array.from(n.entries()).sort(([r],[i])=>o(r)-o(i)||r.localeCompare(i)).map(([,r])=>({...e,components:r}))},jdi="1mm",d5n=LSn.default("Group_doInitialPcbLayoutPack"),u5n=(e)=>{if(e.courtyard&&e.center)return{obstacleId:e.componentId,absoluteCenter:{x:e.center.x+e.courtyard.offsetFromCenter.x,y:e.center.y+e.courtyard.offsetFromCenter.y},width:e.courtyard.width,height:e.courtyard.height};if(e.pads.length===0)return;let t=1/0,n=1/0,o=-1/0,r=-1/0;for(let i of e.pads){let s=i.absoluteCenter??(e.center?{x:e.center.x+i.offset.x,y:e.center.y+i.offset.y}:i.offset);t=Math.min(t,s.x-i.size.x/2),n=Math.min(n,s.y-i.size.y/2),o=Math.max(o,s.x+i.size.x/2),r=Math.max(r,s.y+i.size.y/2)}return{obstacleId:e.componentId,absoluteCenter:{x:(t+o)/2,y:(n+r)/2},width:o-t,height:r-n}},Kdi=({components:e,targetLayer:t,db:n})=>e.flatMap((o)=>o.pads.flatMap((r)=>{let i=n.pcb_plated_hole.get(r.padId),s=n.pcb_via.get(r.padId);if(!(i?.layers??s?.layers)?.includes(t))return[];let c=r.absoluteCenter??(o.center?{x:o.center.x+r.offset.x,y:o.center.y+r.offset.y}:r.offset);return[{obstacleId:`cross_layer_${t}_${r.padId}`,absoluteCenter:c,width:r.size.x,height:r.size.y}]})),$di=(e)=>{let{db:t}=e.root,{_parsedProps:n}=e;e.root?.emit("packing:start",{subcircuit_id:e.subcircuit_id,componentDisplayName:e.getString()});let{packOrderStrategy:o,packPlacementStrategy:r,gap:i,pcbGap:s,pcbPackGap:a}=n,c=a??s??i,l=ve.parse(c??jdi),h={},d=new Set,u=(v)=>{if(v?.pcb_component_id&&v?._parsedProps){let P=v._parsedProps,M=ve.parse(P.pcbMarginLeft??P.pcbMarginX??0),B=ve.parse(P.pcbMarginRight??P.pcbMarginX??0),T=ve.parse(P.pcbMarginTop??P.pcbMarginY??0),N=ve.parse(P.pcbMarginBottom??P.pcbMarginY??0);if(M||B||T||N)h[v.pcb_component_id]={left:M,right:B,top:T,bottom:N}}if(v?.children)v.children.forEach(u)};u(e);let _=new Set;for(let v of e.children){let P=v;if(P._isNormalComponent&&P.isRelativelyPositioned?.()){if(P.pcb_component_id)d.add(P.pcb_component_id);if(P.pcb_group_id)_.add(P.pcb_group_id)}}let p=(v,P,M)=>{if(P===M)return!0;let B=v.source_group.get(P);if(!B||!B.parent_source_group_id)return!1;return p(v,B.parent_source_group_id,M)};if(_.size>0)for(let v of t.toArray()){if(v.type!=="pcb_component")continue;let P=t.source_component.get(v.source_component_id);if(!P?.source_group_id)continue;for(let M of _)if(p(t,P.source_group_id,M))d.add(v.pcb_component_id)}let m=t.toArray(),A;if(n.width!==void 0&&n.height!==void 0){let v=ve.parse(n.width),P=ve.parse(n.height);A={minX:-v/2,maxX:v/2,minY:-P/2,maxY:P/2}}let g=Jcn(m,{source_group_id:e.source_group_id,chipMarginsMap:h,staticPcbComponentIds:Array.from(d)}),f={...Zcn(g),packOrderStrategy:o??"largest_to_smallest",packPlacementStrategy:r??"minimum_sum_squared_distance_to_network",minGap:l,bounds:A},y=Udi(e,f);if(d5n.enabled)e.root?.emit("debug:logOutput",{type:"debug:logOutput",name:`packInput-circuitjson-${e.name}`,content:JSON.stringify(t.toArray())}),e.root?.emit("debug:logOutput",{type:"debug:logOutput",name:`packInput-${e.name}`,content:f});let x=Xdi(f,t),C={...f,components:[]},b=!1,I=(v)=>{let P=`Unable to pack all PCB components within the layout bounds: ${v}`;t.pcb_packing_error.insert({error_type:"pcb_packing_error",message:P,pcb_group_id:e.pcb_group_id??void 0,subcircuit_id:e.subcircuit_id??void 0}),e.root?.emit("packing:error",{subcircuit_id:e.subcircuit_id,componentDisplayName:e.getString(),error:{message:P}})};try{for(let v of x){let P=HSn(v.components[0],t),M=new Set(v.components.map((J)=>J.componentId)),B=v.components.flatMap((J)=>{if(!J.isStatic)return[];let ee=u5n(J);return ee?[ee]:[]}),T=v.components.every((J)=>Boolean(t.pcb_component.get(J.componentId))&&!y[J.componentId]),N=f.components.filter((J)=>J.isStatic&&!M.has(J.componentId)),D=T?[]:N.flatMap((J)=>{let ee=u5n(J);return ee?[ee]:[]}),L=new Set([...v.components.filter((J)=>J.isStatic),...T?[]:N].flatMap((J)=>J.pads.map((ee)=>ee.padId))),H=new Map([...C.components.map((J)=>[J.componentId,{component:J,courtyardSize:Number.EPSILON}]),...T?N.map((J)=>[J.componentId,{component:J,courtyardSize:0.000001}]):[]]),V=Array.from(H.values(),({component:J,courtyardSize:ee})=>({...J,componentId:`network_reference_${J.componentId}`,isStatic:!0,courtyard:{offsetFromCenter:{x:0,y:0},width:ee,height:ee}})),O=P?Kdi({components:Array.from(H.values(),({component:J})=>J),targetLayer:P,db:t}):[],U={...v,weightedConnections:v.weightedConnections?.filter((J)=>J.padIds.every((ee)=>!L.has(ee))),obstacles:[...v.obstacles??[],...B,...D,...O],components:[...V,...v.components.filter((J)=>!J.isStatic)]},j=new BB(U),Y=j.getConstructorParams();e.root?.emit("solver:started",{type:"solver:started",solverName:"PackSolver2",solverParams:Y,solverConstructorArgs:[Y],componentName:e.getString()});let X=e.root?.platform?.pcbPackSolverTimeoutMs,{timedOut:K}=Gdi(j,X);if(K)b=!0,I(`PackSolver2 timed out after ${X}ms`);if(j.failed){b=!0;let J=j.error??j.activeSubSolver?.error??"No valid packing solution found";I(J)}if(C.components.push(...j.packedComponents.filter((J)=>M.has(J.componentId))),K)break}}catch(v){throw I(v instanceof Error?v.message:String(v)),v}if(d5n.enabled&&global?.debugGraphics){let v=bet(C);v.title=`packOutput-${e.name}`,global.debugGraphics?.push(v)}if(Wdi(e,C,y,g),b)return;e.root?.emit("packing:end",{subcircuit_id:e.subcircuit_id,componentDisplayName:e.getString()})},qdi=(e)=>{if(!e)return null;let t=e.match(/^pin(\d+)$/i)??e.match(/^(\d+)$/);if(!t)return null;let n=Number(t[1]);return Number.isFinite(n)&&n>0?n:null},FSn=(e)=>e.children.filter((t)=>t.componentName==="Port"),Jdi=(e)=>{let{db:t}=e.root,n=FSn(e);for(let i of n){if(i._parsedProps.pinNumber!==void 0)continue;let s=qdi(i._parsedProps.name);if(s===null)continue;i._parsedProps.pinNumber=s}let o=new Set(n.map((i)=>i._parsedProps.pinNumber).filter((i)=>i!==void 0)),r=1;for(let i of n){if(i._parsedProps.pinNumber===void 0){while(o.has(r))r++;i._parsedProps.pinNumber=r,o.add(r)}if(i.source_port_id)t.source_port.update(i.source_port_id,{pin_number:i._parsedProps.pinNumber,port_hints:i.getNameAndAliases()})}},Zdi=(e)=>{let t={};for(let n of FSn(e)){let o=n._parsedProps.pinNumber,r=n._parsedProps.name;if(o===void 0||!r)continue;if(r===`pin${o}`||r===String(o))continue;t[`pin${o}`]=r}return t},eui=(e)=>{if(e.root?.schematicDisabled)return;let{db:t}=e.root,n=e._parsedProps;if(n.schPinSpacing!==void 0)t.source_property_ignored_warning.insert({source_component_id:e.source_group_id??"",property_name:"schPinSpacing",error_type:"source_property_ignored_warning",message:"schPinSpacing is deprecated and will be ignored. Pin spacing is always 0.2."});Jdi(e);let o=e._getSchematicBoxDimensions();if(!o)return;let r=e._getGlobalSchematicPositionBeforeLayout(),i=o.getSize(),s=e._getPinLabelsFromPorts(),a=e._getSchematicPortArrangement(),c=t.schematic_component.insert({center:r,size:i,source_group_id:e.source_group_id,schematic_group_id:e.schematic_group_id??void 0,subcircuit_id:e.subcircuit_id??e.getSubcircuit()?.subcircuit_id??void 0,is_schematic_group:!0,is_box_with_pins:!0,port_arrangement:Qst(a),pin_spacing:0.2,pin_styles:Rst(n.schPinStyle,s),port_labels:s,schematic_sheet_id:e._resolveSchematicSheetId()});if(e.schematic_component_id=c.schematic_component_id,e.schematic_group_id)t.schematic_group.update(e.schematic_group_id,{center:r,width:i.width,height:i.height,schematic_component_ids:[c.schematic_component_id]});let l=n.schTitle??n.name;if(l)t.schematic_text.insert({text:l,schematic_component_id:c.schematic_component_id,anchor:"left",rotation:0,position:{x:r.x-i.width/2,y:r.y+i.height/2+0.13},color:"#006464",font_size:0.18,schematic_sheet_id:e._resolveSchematicSheetId()})},p5n=(e,t)=>{let{sourceComponent:n,sourceGroup:o}=t;if(t.nodeType==="component"){let r=e.schematic_component.getWhere({source_component_id:n?.source_component_id});if(!r?.size)return null;return{width:r.size.width,height:r.size.height}}if(t.nodeType==="group"){let r=e.schematic_group.getWhere({source_group_id:o?.source_group_id});if(r?.width&&r?.height)return{width:r.width,height:r.height};let i=e.schematic_component.list({schematic_group_id:r?.schematic_group_id}),s=1/0,a=-1/0,c=1/0,l=-1/0;for(let u of i)if(u.center&&u.size){let _=u.size.width/2,p=u.size.height/2;s=Math.min(s,u.center.x-_),a=Math.max(a,u.center.x+_),c=Math.min(c,u.center.y-p),l=Math.max(l,u.center.y+p)}let h=a-s,d=l-c;return{width:h,height:d}}return null},tui=(e)=>{let{db:t}=e.root,n=e._parsedProps,o=Pw(t.toArray(),{source_group_id:e.source_group_id}),r=n.schJustifyContent??n.justifyContent,i=n.schAlignItems??n.alignItems,s=n.schFlexGap??n.schGap??n.gap,a=n.schFlexDirection??"row",c={start:"flex-start",end:"flex-end","flex-start":"flex-start","flex-end":"flex-end",stretch:"space-between","space-between":"space-between","space-around":"space-around","space-evenly":"space-evenly",center:"center"}[r??"space-between"],l={start:"flex-start",end:"flex-end","flex-start":"flex-start","flex-end":"flex-end",stretch:"stretch",center:"center"}[i??"center"];if(!c)throw Error(`Invalid justifyContent value: "${r}"`);if(!l)throw Error(`Invalid alignItems value: "${i}"`);let h=0,d=0;if(typeof s==="object")h=s.y??0,d=s.x??0;else if(typeof s==="number")h=s,d=s;else if(typeof s==="string")h=ve.parse(s),d=ve.parse(s);let u,_=n.width??n.schWidth??void 0,p=n.height??n.schHeight??void 0;if(Boolean(_===void 0||p===void 0))u=s2e(o.childNodes.map((x)=>p5n(t,x)).filter((x)=>x!==null),{alignItems:l,justifyContent:c,direction:a,rowGap:h,columnGap:d}),_=u.width,p=u.height;let A=new R6e(_,p,{alignItems:l,justifyContent:c,direction:a,rowGap:h,columnGap:d});for(let x of o.childNodes){let C=p5n(t,x);A.addChild({metadata:x,width:C?.width??0,height:C?.height??0,flexBasis:!C?void 0:a==="row"?C.width:C.height})}A.build();let g={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0,width:0,height:0};for(let x of A.children)g.minX=Math.min(g.minX,x.position.x),g.minY=Math.min(g.minY,x.position.y),g.maxX=Math.max(g.maxX,x.position.x+x.size.width),g.maxY=Math.max(g.maxY,x.position.y+x.size.height);g.width=g.maxX-g.minX,g.height=g.maxY-g.minY;let f={x:-(g.maxX+g.minX)/2,y:-(g.maxY+g.minY)/2},y=t.toArray();for(let x of A.children){let{sourceComponent:C,sourceGroup:b}=x.metadata;if(C){let I=t.schematic_component.getWhere({source_component_id:C.source_component_id});if(!I)continue;tvt(y,I.schematic_component_id,{x:x.position.x+x.size.width/2+f.x,y:x.position.y+x.size.height/2+f.y})}if(b){if(!t.schematic_group.getWhere({source_group_id:b.source_group_id}))continue;rvt(y,b.source_group_id,{x:x.position.x+x.size.width/2+f.x,y:x.position.y+x.size.height/2+f.y})}}if(e.schematic_group_id)t.schematic_group.update(e.schematic_group_id,{width:g.width,height:g.height})};function HZ({db:e,schematicComponentId:t,deltaX:n,deltaY:o}){let r=e.schematic_rect.list({schematic_component_id:t});for(let l of r)l.center.x+=n,l.center.y+=o;let i=e.schematic_line.list({schematic_component_id:t});for(let l of i)l.x1+=n,l.y1+=o,l.x2+=n,l.y2+=o;let s=e.schematic_circle.list({schematic_component_id:t});for(let l of s)l.center.x+=n,l.center.y+=o;let a=e.schematic_arc.list({schematic_component_id:t});for(let l of a)l.center.x+=n,l.center.y+=o;let c=e.schematic_path.list({schematic_component_id:t});for(let l of c)for(let h of l.points)h.x+=n,h.y+=o}function nui(e){let{db:t}=e.root,n=e._parsedProps,o=e.children.filter((C)=>{let b=C._parsedProps?.schX!==void 0||C._parsedProps?.schY!==void 0;return C.schematic_component_id&&!b});if(o.length===0)return;let r=0,i=0;for(let C of o){let b=t.schematic_component.get(C.schematic_component_id);if(b?.size)r=Math.max(r,b.size.width),i=Math.max(i,b.size.height)}if(r===0&&o.length>0)r=1;if(i===0&&o.length>0)i=1;let s=n.gridCols,a=void 0,{gridGap:c,gridRowGap:l,gridColumnGap:h}=n;if(n.schLayout?.grid)s=n.schLayout.grid.cols??s,a=n.schLayout.grid.rows,c=n.schLayout.gridGap??c,l=n.schLayout.gridRowGap??l,h=n.schLayout.gridColumnGap??h;let d,u;if(s!==void 0&&a!==void 0)d=s,u=a;else if(s!==void 0)d=s,u=Math.ceil(o.length/d);else if(a!==void 0)u=a,d=Math.ceil(o.length/u);else d=Math.ceil(Math.sqrt(o.length)),u=Math.ceil(o.length/d);if(d===0&&o.length>0)d=1;if(u===0&&o.length>0)u=o.length;let _,p,m=(C)=>{if(C===void 0)return;return typeof C==="number"?C:ve.parse(C)};if(l!==void 0||h!==void 0){let C=typeof c==="object"&&c!==null?c.x:c,b=typeof c==="object"&&c!==null?c.y:c;_=m(h??C)??1,p=m(l??b)??1}else if(typeof c==="number")_=c,p=c;else if(typeof c==="string"){let C=ve.parse(c);_=C,p=C}else if(typeof c==="object"&&c!==null){let C=c.x,b=c.y;_=typeof C==="number"?C:ve.parse(C??"0mm"),p=typeof b==="number"?b:ve.parse(b??"0mm")}else _=1,p=1;let A=d*r+Math.max(0,d-1)*_,g=u*i+Math.max(0,u-1)*p,f=e._getGlobalSchematicPositionBeforeLayout(),y=f.x-A/2+r/2,x=f.y+g/2-i/2;for(let C=0;C<o.length;C++){let b=o[C];if(!b.schematic_component_id)continue;let I=Math.floor(C/d),v=C%d;if(I>=u||v>=d){console.warn(`Schematic grid layout: Child ${b.getString()} at index ${C} (row ${I}, col ${v}) exceeds specified grid dimensions (${u}x${d}). Skipping placement.`);continue}let P=y+v*(r+_),M=x-I*(i+p),B=t.schematic_component.get(b.schematic_component_id);if(B){let T=B.center,N={x:P,y:M};t.schematic_component.update(b.schematic_component_id,{center:N});let D=N.x-T.x,L=N.y-T.y,H=t.schematic_port.list({schematic_component_id:b.schematic_component_id});for(let O of H)t.schematic_port.update(O.schematic_port_id,{center:{x:O.center.x+D,y:O.center.y+L}});let V=t.schematic_text.list({schematic_component_id:b.schematic_component_id});for(let O of V)t.schematic_text.update(O.schematic_text_id,{position:{x:O.position.x+D,y:O.position.y+L}});HZ({db:t,schematicComponentId:b.schematic_component_id,deltaX:D,deltaY:L})}}if(e.schematic_group_id)t.schematic_group.update(e.schematic_group_id,{width:A,height:g,center:f})}var m5n=zSn.default("Group_doInitialSchematicLayoutMatchAdapt");function oui(e){let{db:t}=e.root,n=Rj(t.toArray(),{source_group_id:e.source_group_id});if(n.filter((c)=>c.type==="source_component").length<=1)return;let r=ihn(n);if(m5n.enabled&&global?.debugGraphics)global.debugGraphics?.push(pk(r,{title:`floatingBpcGraph-${e.name}`}));let i={boxes:r.boxes,pins:r.pins.map((c)=>({...c,color:c.color.replace("not_connected","normal")}))},{result:s}=_hn([{variantName:"default",floatingGraph:r},{variantName:"noNotConnected",floatingGraph:i}],{singletonKeys:["vcc/2","gnd/2"],centerPinColors:["netlabel_center","component_center"],floatingBoxIdsWithMutablePinOffsets:new Set(r.boxes.filter((c)=>{if(r.pins.filter((d)=>d.boxId===c.boxId).filter((d)=>!d.color.includes("center")).length<=2)return!0;return!1}).map((c)=>c.boxId)),corpus:{}});if(m5n.enabled&&global?.debugGraphics)global.debugGraphics?.push(pk(s,{title:`laidOutBpcGraph-${e.name}`}));let a=e._getGlobalSchematicPositionBeforeLayout();for(let c of s.boxes){if(!c.center)continue;let l=t.schematic_component.get(c.boxId);if(l){let d={x:c.center.x+a.x,y:c.center.y+a.y},u=t.schematic_port.list({schematic_component_id:l.schematic_component_id}),_=t.schematic_text.list({schematic_component_id:l.schematic_component_id}),p={x:d.x-l.center.x,y:d.y-l.center.y};for(let m of u)m.center.x+=p.x,m.center.y+=p.y;for(let m of _)m.position.x+=p.x,m.position.y+=p.y;HZ({db:t,schematicComponentId:l.schematic_component_id,deltaX:p.x,deltaY:p.y}),l.center=d;continue}let h=t.schematic_net_label.get(c.boxId);if(h){let d=s.pins.find((_)=>_.boxId===c.boxId&&_.color==="netlabel_center");if(!d)throw Error(`No pin found for net label: ${c.boxId}`);let u={x:c.center.x+a.x,y:c.center.y+a.y};h.center=u,h.anchor_position={x:u.x+d.offset.x,y:u.y+d.offset.y};continue}console.error(`No schematic element found for box: ${c.boxId}. This is a bug in the matchAdapt binding with @tscircuit/core`)}}function VSn({text:e,fontSize:t}){let o=0.12*(t/0.18);return e.length*o}var rui=0.18,iui=new Set(["simple_resistor","simple_capacitor","simple_inductor","simple_crystal","simple_resonator","simple_potentiometer","simple_fuse","simple_diode","simple_led","simple_transistor","simple_mosfet","simple_op_amp","simple_voltage_source","simple_test_point"]);function YSn({text:e,position:t,anchor:n,fontSize:o}){let r=VSn({text:e,fontSize:o}),i=o,s,a;if(n.includes("left"))s=0,a=r;else if(n.includes("right"))s=-r,a=0;else s=-r/2,a=r/2;let c,l;if(n.includes("top"))c=-i,l=0;else if(n.includes("bottom"))c=0,l=i;else c=-i/2,l=i/2;return{minX:t.x+s,maxX:t.x+a,minY:t.y+c,maxY:t.y+l}}function sui({schematicComponent:e,sourceComponent:t}){if(!e.symbol_name)return[];let n=zs[e.symbol_name];if(!n?.primitives||!n.center)return[];let o=[];for(let r of n.primitives){if(r.type!=="text")continue;let i;if(r.text==="{REF}")i=t?.display_name??t?.name??"";else if(r.text==="{VAL}")i=e.symbol_display_value??"";else i=r.text??"";if(!i)continue;o.push(YSn({text:i,position:{x:r.x-n.center.x+e.center.x,y:r.y-n.center.y+e.center.y},anchor:r.anchor??"center",fontSize:rui}))}return o}function GSn(e){return Pd({center:e.center,width:e.size.width,height:e.size.height})}function aui(e,t){if(!t.center||!t.size)return null;let n=t.source_component_id?e.source_component.get(t.source_component_id):void 0;if(!n||!iui.has(n.ftype))return null;let o=sui({schematicComponent:t,sourceComponent:n});if(o.length===0)return null;let r=GSn(t),i={...r};for(let s of o)i.minX=Math.min(i.minX,s.minX),i.maxX=Math.max(i.maxX,s.maxX),i.minY=Math.min(i.minY,s.minY),i.maxY=Math.max(i.maxY,s.maxY);if(i.minX===r.minX&&i.maxX===r.maxX&&i.minY===r.minY&&i.maxY===r.maxY)return null;return i}function cui(e,t){let n=e.size;if(n)n=vrt(n,t);return{...e,symbol_name:Est(e.symbol_name,t),size:n}}function p7e({db:e,schematicComponent:t,ccwRotationDegrees:n=0}){let o=cui(t,n),r=aui(e,o);if(!r)return null;let i=GSn(o);if(o.size.height>o.size.width)return r;let a=Math.max(0,i.minX-r.minX),c=Math.max(0,r.maxX-i.maxX),l=Math.max(0,r.maxY-i.maxY),h=Math.max(0,i.minY-r.minY),d=a,u=c;if(a>0&&c>0)d=Math.max(a,c),u=d;let _=l,p=h;if(l>0&&h>0)_=Math.max(l,h),p=_;return{minX:i.minX-d,maxX:i.maxX+u,minY:i.minY-p,maxY:i.maxY+_}}var ps=OSn.default("Group_doInitialSchematicLayoutMatchpack"),_5n=[0,90,180,270],lui={"y+":0,"x+":90,"y-":180,"x-":270};function hst(e){switch(e){case"up":return"y+";case"down":return"y-";case"left":return"x-";case"right":return"x+";default:return"y+"}}function hui(e,t){if(t.length!==2)return null;let n=new Set;for(let o of t){let i=e.source_port.get(o.source_port_id)?.subcircuit_connectivity_map_key;if(!i)continue;let s=e.source_net.getWhere({subcircuit_connectivity_map_key:i});if(!s)continue;let a=s.is_ground??!1,c=s.is_power===!0||s.is_positive_voltage_source===!0;if(c===a)continue;let l=lui[hst(o.facing_direction)],h=c?l:(l+180)%360;n.add(h)}return n.size===1?n.values().next().value:null}function g5n({db:e,schematicComponent:t,component:n,ccwRotationDegrees:o}){let r=t.size;if(r)r=vrt(r,o);let i=p7e({db:e,schematicComponent:t,ccwRotationDegrees:o}),s=0,a=0,c=0,l=0;if(i&&t.center){let A=(r?.width??0)/2,g=(r?.height??0)/2;s=t.center.x-A-i.minX,a=i.maxX-(t.center.x+A),c=i.maxY-(t.center.y+g),l=t.center.y-g-i.minY}let h=(n?._parsedProps?.schMarginLeft??n?._parsedProps?.schMarginX??0)+s,d=(n?._parsedProps?.schMarginRight??n?._parsedProps?.schMarginX??0)+a,u=(n?._parsedProps?.schMarginTop??n?._parsedProps?.schMarginY??0)+c,_=(n?._parsedProps?.schMarginBottom??n?._parsedProps?.schMarginY??0)+l;if(n?.config.shouldRenderAsSchematicBox)u+=0.4,_+=0.4;let p={width:(r?.width||1)+h+d,height:(r?.height||1)+u+_},m=vrt(p,o);return{x:m.width,y:m.height}}function dui({db:e,schematicComponent:t,component:n,ccwRotationDegrees:o,chipGap:r}){let i=g5n({db:e,schematicComponent:t,component:n,ccwRotationDegrees:0});if(!Mst(o))return i;let s=g5n({db:e,schematicComponent:t,component:n,ccwRotationDegrees:o});return s.x-i.x>=r||s.y-i.y>=r?s:i}function uui({db:e,schematicGroup:t,groupComponents:n,groupInstance:o}){let r=1/0,i=-1/0,s=1/0,a=-1/0,c=!1;for(let p of n){if(!p.center||!p.size)continue;c=!0;let m=p7e({db:e,schematicComponent:p})??Pd({center:p.center,width:p.size.width,height:p.size.height});r=Math.min(r,m.minX),i=Math.max(i,m.maxX),s=Math.min(s,m.minY),a=Math.max(a,m.maxY)}let l=o?._parsedProps?.schMarginLeft??o?._parsedProps?.schMarginX??0,h=o?._parsedProps?.schMarginRight??o?._parsedProps?.schMarginX??0,d=o?._parsedProps?.schMarginTop??o?._parsedProps?.schMarginY??0,u=o?._parsedProps?.schMarginBottom??o?._parsedProps?.schMarginY??0,_=c?{x:(r+i)/2,y:(s+a)/2}:t.center??{x:0,y:0};return{center:{x:_.x+(h-l)/2,y:_.y+(d-u)/2},size:{x:(c?i-r:2)+l+h,y:(c?a-s:2)+d+u}}}function pui(e,t){if(e.nodeType==="component"&&e.sourceComponent){let n=t.children.find((o)=>o.source_component_id===e.sourceComponent?.source_component_id);return n?._parsedProps?.schX!==void 0||n?._parsedProps?.schY!==void 0}if(e.nodeType==="group"&&e.sourceGroup){let n=t.children.find((o)=>o.source_group_id===e.sourceGroup?.source_group_id);return n?._parsedProps?.schX!==void 0||n?._parsedProps?.schY!==void 0}return!1}function aZ(e,t){if(e.nodeType==="component"&&e.sourceComponent)return e.sourceComponent.name||`chip_${t}`;if(e.nodeType==="group"&&e.sourceGroup)return e.sourceGroup.name||`group_${t}`;return null}var USn=({db:e,sourceComponentId:t,schematicSheetId:n})=>e.schematic_component.getWhere({source_component_id:t,...n?{schematic_sheet_id:n}:{}});function mui(e,t,n,o={}){let r={chipMap:{},chipPinMap:{},netMap:{},pinStrongConnMap:{},netConnMap:{},chipGap:0.6,decouplingCapsGap:0.4,partitionGap:1.2},i={},s=n._getGlobalSchematicPositionBeforeLayout();ps(`[${n.name}] Processing ${e.childNodes.length} child nodes for input problem`),e.childNodes.forEach((c,l)=>{let h=pui(c,n);if(h)ps(`[${n.name}] Child ${l} explicitly positioned, including as fixed chip`);else ps(`[${n.name}] Processing child ${l}: nodeType=${c.nodeType}`);if(c.nodeType==="component")ps(`[${n.name}] - Component: ${c.sourceComponent?.name}`);else if(c.nodeType==="group")ps(`[${n.name}] - Group: ${c.sourceGroup?.name}`);if(c.nodeType==="component"&&c.sourceComponent){let d=aZ(c,l),u=USn({db:t,sourceComponentId:c.sourceComponent.source_component_id,schematicSheetId:o.schematicSheetId});if(!u)return;let _=n.children.find((g)=>g.source_component_id===c.sourceComponent?.source_component_id),p=t.schematic_port.list({schematic_component_id:u.schematic_component_id}),m=[..._5n];if(_?._parsedProps?.schOrientation)m=[0];if(_?._parsedProps?.schRotation!==void 0)m=[0];if(_?._parsedProps?.facingDirection)m=[0];if(_?._parsedProps?.schFacingDirection)m=[0];if(_?.componentName==="Chip")m=[0];if(m.length===_5n.length){let g=hui(t,p);if(g!==null)m=[g]}let A=m.length===1?m[0]:0;r.chipMap[d]={chipId:d,pins:[],size:dui({db:t,schematicComponent:u,component:_,ccwRotationDegrees:A,chipGap:r.chipGap}),isCapacitor:c.sourceComponent.ftype==="simple_capacitor",isCrystal:c.sourceComponent.ftype==="simple_crystal",isResistor:c.sourceComponent.ftype==="simple_resistor",isTestPoint:c.sourceComponent.ftype==="simple_test_point",availableRotations:m,...h&&{fixedPosition:{x:u.center.x-s.x,y:u.center.y-s.y}}};for(let g of p){let f=t.source_port.get(g.source_port_id);if(!f)continue;let y=`${d}.${f.pin_number||f.name||g.schematic_port_id}`;r.chipMap[d].pins.push(y);let x=hst(g.facing_direction);r.chipPinMap[y]={pinId:y,offset:{x:(g.center?.x||0)-(u.center.x||0),y:(g.center?.y||0)-(u.center.y||0)},side:x}}}else if(c.nodeType==="group"&&c.sourceGroup){let d=aZ(c,l);ps(`[${n.name}] Processing nested group: ${d}`);let u=t.schematic_group?.getWhere?.({source_group_id:c.sourceGroup.source_group_id}),_=n.children.find((p)=>p.source_group_id===c.sourceGroup?.source_group_id);if(ps(`[${n.name}] Found schematic_group for ${d}:`,u),u){ps(`[${n.name}] Treating group ${d} as composite chip`);let p=t.schematic_component.list({schematic_group_id:u.schematic_group_id});ps(`[${n.name}] Group ${d} has ${p.length} components:`,p.map((g)=>g.source_component_id));let m=uui({db:t,schematicGroup:u,groupComponents:p,groupInstance:_});i[d]=m,ps(`[${n.name}] Group ${d} computed proxy: ${m.size.x} x ${m.size.y} centered at (${m.center.x}, ${m.center.y})`);let A=[];for(let g of p){let f=t.schematic_port.list({schematic_component_id:g.schematic_component_id});for(let y of f){let x=t.source_port.get(y.source_port_id);if(!x)continue;let C=`${d}.${x.pin_number||x.name||y.schematic_port_id}`;A.push(C);let b=hst(y.facing_direction);r.chipPinMap[C]={pinId:C,offset:{x:(y.center?.x||0)-m.center.x,y:(y.center?.y||0)-m.center.y},side:b}}}ps(`[${n.name}] Group ${d} has ${A.length} pins:`,A),r.chipMap[d]={chipId:d,pins:A,size:m.size},ps(`[${n.name}] Added group ${d} to chipMap`)}else ps(`[${n.name}] Warning: No schematic_group found for group ${d}`)}}),ps(`[${n.name}] Creating connections using connectivity keys`);let a=new Map;for(let[c,l]of Object.entries(r.chipMap))for(let h of l.pins){let d=h.split(".").pop(),u=e.childNodes.find((_)=>aZ(_,e.childNodes.indexOf(_))===c);if(u?.nodeType==="group"&&u.sourceGroup){let _=t.schematic_group?.getWhere?.({source_group_id:u.sourceGroup.source_group_id});if(_){let p=t.schematic_component.list({schematic_group_id:_.schematic_group_id});for(let m of p){let A=t.source_port.list({source_component_id:m.source_component_id});for(let g of A){let f=g.pin_number||g.name;if(String(f)===String(d))if(g.subcircuit_connectivity_map_key){let y=g.subcircuit_connectivity_map_key;if(!a.has(y))a.set(y,[]);a.get(y).push(h),ps(`[${n.name}] ✓ Pin ${h} has connectivity key: ${y}`)}else ps(`[${n.name}] Pin ${h} has no connectivity key`)}}}}else if(u?.nodeType==="component"&&u.sourceComponent){let _=t.source_port.list({source_component_id:u.sourceComponent.source_component_id});for(let p of _){let m=p.pin_number||p.name;if(String(m)===String(d)&&p.subcircuit_connectivity_map_key){let A=p.subcircuit_connectivity_map_key;if(!a.has(A))a.set(A,[]);a.get(A).push(h),ps(`[${n.name}] Pin ${h} has connectivity key: ${A}`)}}}}ps(`[${n.name}] Found ${a.size} connectivity groups:`,Array.from(a.entries()).map(([c,l])=>({key:c,pins:l})));for(let[c,l]of a){let h=t.source_trace.list().filter((_)=>_.subcircuit_connectivity_map_key===c),d=h.some((_)=>_.connected_source_net_ids&&_.connected_source_net_ids.length>0),u=h.some((_)=>_.connected_source_port_ids&&_.connected_source_port_ids.length>=2);if(ps(`[${n.name}] Connectivity ${c}: hasNetConnections=${d}, hasDirectConnections=${u}`),l.length>=2){if(u){for(let _ of h)if(_.connected_source_port_ids&&_.connected_source_port_ids.length>=2){let p=[];for(let m of _.connected_source_port_ids)for(let A of l){let g=A.split(".").pop(),f=t.source_port.get(m);if(f&&String(f.pin_number||f.name)===String(g)){let y=A.split(".")[0],x=e.childNodes.find((C)=>aZ(C,e.childNodes.indexOf(C))===y);if(x?.nodeType==="component"&&x.sourceComponent){if(t.source_port.list({source_component_id:x.sourceComponent.source_component_id}).some((b)=>b.source_port_id===m))p.push(A)}}}for(let m=0;m<p.length;m++)for(let A=m+1;A<p.length;A++){let g=p[m],f=p[A];r.pinStrongConnMap[`${g}-${f}`]=!0,r.pinStrongConnMap[`${f}-${g}`]=!0,ps(`[${n.name}] Created strong connection: ${g} <-> ${f}`)}}}}if(d){let _=t.source_net.getWhere({subcircuit_connectivity_map_key:c}),p=_?.is_ground??!1,m=_?.is_power===!0||_?.is_positive_voltage_source===!0;r.netMap[c]={netId:c,isGround:p,isPositiveVoltageSource:m};for(let A of l)r.netConnMap[`${A}-${c}`]=!0;ps(`[${n.name}] Created net ${c} with ${l.length} pins:`,l)}}return{inputProblem:r,nestedGroupMatchpackProxyMap:i}}function WSn(e,t,n={}){let{db:o}=e.root;if(ps(`[${e.name}] Starting matchpack layout with ${t.childNodes.length} children`),ps(`[${e.name}] Tree structure:`,JSON.stringify(t,null,2)),t.childNodes.length<=1){ps(`[${e.name}] Only ${t.childNodes.length} children, skipping layout`);return}ps("Converting circuit tree to InputProblem...");let{inputProblem:r,nestedGroupMatchpackProxyMap:i}=mui(t,o,e,n);if(ps.enabled)e.root?.emit("debug:logOutput",{type:"debug:logOutput",name:`matchpack-input-problem-${e.name}`,content:JSON.stringify(r,null,2)});let s=new N6e(r);if(e.root?.emit("solver:started",{type:"solver:started",solverName:"LayoutPipelineSolver",solverParams:r,solverConstructorArgs:[r],componentName:e.getString()}),ps("Starting LayoutPipelineSolver..."),ps.enabled&&global?.debugGraphics){let h=s.visualize();global.debugGraphics.push({...h,title:`matchpack-initial-${e.name}`})}if(s.solve(),e.root?.emit("solver:ended",{type:"solver:ended",solverName:"LayoutPipelineSolver",componentName:e.getString(),solved:s.solved,failed:s.failed,iterations:s.iterations,error:s.error}),ps(`Solver completed in ${s.iterations} iterations`),ps(`Solved: ${s.solved}, Failed: ${s.failed}`),s.failed){let h=s.error??"Unknown Matchpack failure";ps(`Solver failed with error: ${h}`),o.schematic_layout_error.insert({error_type:"schematic_layout_error",message:`Matchpack layout solver failed: ${h}`,is_fatal:!1,source_group_id:e.source_group_id,schematic_group_id:e.schematic_group_id,subcircuit_id:e.subcircuit_id??void 0});return}let a=s.getOutputLayout();if(ps("OutputLayout:",JSON.stringify(a,null,2)),ps("Solver completed successfully:",!s.failed),ps.enabled&&global?.debugGraphics){let h=s.visualize();global.debugGraphics.push({...h,title:`matchpack-final-${e.name}`})}let c=s.checkForOverlaps(a);if(c.length>0){ps(`Warning: Found ${c.length} overlapping components:`);for(let h of c)ps(`  ${h.chip1} overlaps ${h.chip2} (area: ${h.overlapArea})`)}let l=e._getGlobalSchematicPositionBeforeLayout();ps(`Group offset: x=${l.x}, y=${l.y}`),ps(`Applying layout results for ${Object.keys(a.chipPlacements).length} chip placements`);for(let[h,d]of Object.entries(a.chipPlacements)){ps(`Processing placement for chip: ${h} at (${d.x}, ${d.y})`);let u=t.childNodes.find((p)=>{let m=aZ(p,t.childNodes.indexOf(p)),A=m===h;return ps(`  Checking child ${m}: matches=${A}`),A});if(!u){ps(`Warning: No tree node found for chip: ${h}`),ps("Available tree nodes:",t.childNodes.map((p,m)=>({type:p.nodeType,name:p.nodeType==="component"?p.sourceComponent?.name:p.sourceGroup?.name,expectedChipId:aZ(p,m)})));continue}let _={x:d.x+l.x,y:d.y+l.y};if(u.nodeType==="component"&&u.sourceComponent){let p=e.children.find((A)=>A.source_component_id===u.sourceComponent?.source_component_id);if(p?._parsedProps?.schX!==void 0||p?._parsedProps?.schY!==void 0){ps(`Skipping position update for fixed chip ${h}`);continue}let m=USn({db:o,sourceComponentId:u.sourceComponent.source_component_id,schematicSheetId:n.schematicSheetId});if(m){ps(`Moving component ${h} to (${_.x}, ${_.y})`);let A=o.schematic_port.list({schematic_component_id:m.schematic_component_id}),g=o.schematic_text.list({schematic_component_id:m.schematic_component_id}),f={x:_.x-m.center.x,y:_.y-m.center.y};for(let y of A)y.center.x+=f.x,y.center.y+=f.y;for(let y of g)y.position.x+=f.x,y.position.y+=f.y;if(HZ({db:o,schematicComponentId:m.schematic_component_id,deltaX:f.x,deltaY:f.y}),m.center=_,d.ccwRotationDegrees!==0){ps(`Component ${h} has rotation: ${d.ccwRotationDegrees}°`);let y=(Math.round(d.ccwRotationDegrees)%360+360)%360;if((y===90||y===270)&&m.size){let I=m.size.width;m.size.width=m.size.height,m.size.height=I}let x=d.ccwRotationDegrees*Math.PI/180,C=Math.cos(x),b=Math.sin(x);for(let I of A){let v=I.center.x-_.x,P=I.center.y-_.y,M=v*C-P*b,B=v*b+P*C;I.center.x=_.x+M,I.center.y=_.y+B;let T=I.facing_direction||"right";I.facing_direction=Pst(T,d.ccwRotationDegrees),I.side_of_component=(I.facing_direction==="up"?"top":I.facing_direction==="down"?"bottom":I.facing_direction)||I.side_of_component}for(let I of g){let v=I.position.x-_.x,P=I.position.y-_.y,M=v*C-P*b,B=v*b+P*C;I.position.x=_.x+M,I.position.y=_.y+B}if(m.symbol_name)m.symbol_name=Est(m.symbol_name,d.ccwRotationDegrees)}}}else if(u.nodeType==="group"&&u.sourceGroup){let p=o.schematic_group?.getWhere?.({source_group_id:u.sourceGroup.source_group_id});if(p){ps(`Moving group ${h} to (${_.x}, ${_.y}) from (${p.center?.x}, ${p.center?.y})`);let m=o.schematic_component.list({schematic_group_id:p.schematic_group_id});ps(`Group ${h} has ${m.length} components to move`);let A=i[h],g=A?.center??p.center??{x:0,y:0},f={x:_.x-g.x,y:_.y-g.y};ps(`Position delta for group ${h}: (${f.x}, ${f.y})`);for(let y of m)if(y.center){let x={...y.center};y.center.x+=f.x,y.center.y+=f.y,ps(`Moved component ${y.source_component_id} from (${x.x}, ${x.y}) to (${y.center.x}, ${y.center.y})`);let C=o.schematic_port.list({schematic_component_id:y.schematic_component_id}),b=o.schematic_text.list({schematic_component_id:y.schematic_component_id});for(let I of C)if(I.center)I.center.x+=f.x,I.center.y+=f.y;for(let I of b)if(I.position)I.position.x+=f.x,I.position.y+=f.y;HZ({db:o,schematicComponentId:y.schematic_component_id,deltaX:f.x,deltaY:f.y})}if(p.center=_,A)p.width=A.size.x,p.height=A.size.y;ps(`Updated group ${h} center to (${_.x}, ${_.y})`)}}}ps("Matchpack layout completed successfully")}function _ui({circuitJson:e,schematicSheetIdsBySourceComponentId:t}){let n=new Map;for(let r of e)if(r.type==="source_group")n.set(r.source_group_id,r.parent_source_group_id);let o=new Map;for(let r of e){if(r.type!=="source_component")continue;if(!r.source_group_id)continue;let i=t.get(r.source_component_id);if(i===void 0)continue;for(let s of i){let a=r.source_group_id,c=new Set;while(a&&!c.has(a)){c.add(a);let l=o.get(a)??new Set;l.add(s),o.set(a,l),a=n.get(a)}}}return o}function gui({circuitJson:e,schematicSheetId:t,rootSourceGroupId:n,schematicSheetIdsBySourceComponentId:o,schematicSheetIdsBySourceGroupId:r}){let i=(s)=>s===n||r.get(s)?.has(t)===!0;return e.filter((s)=>{if(s.type==="source_group")return i(s.source_group_id);if(s.type==="source_component"){if(o.get(s.source_component_id)?.has(t)!==!0)return!1;return s.source_group_id?i(s.source_group_id):!0}return!0})}function Aui(e,t){let{source_group_id:n}=t,o=new Map;for(let s of e){if(s.type!=="schematic_component")continue;if(!s.source_component_id)continue;if(!s.schematic_sheet_id)continue;let a=o.get(s.source_component_id)??new Set;a.add(s.schematic_sheet_id),o.set(s.source_component_id,a)}let r=new Set;for(let s of o.values())for(let a of s)r.add(a);if(r.size<=1)return[{tree:Pw(e,{source_group_id:n}),schematicSheetId:r.values().next().value}];let i=_ui({circuitJson:e,schematicSheetIdsBySourceComponentId:o});return Array.from(r).map((s)=>({tree:Pw(gui({circuitJson:e,schematicSheetId:s,rootSourceGroupId:n,schematicSheetIdsBySourceComponentId:o,schematicSheetIdsBySourceGroupId:i}),{source_group_id:n}),schematicSheetId:s}))}function fui(e){let{db:t}=e.root,n=Aui(t.toArray(),{source_group_id:e.source_group_id});for(let{tree:o,schematicSheetId:r}of n)WSn(e,o,{schematicSheetId:r})}var rrt=1,W9e=1.5;function yui({sectionBlocks:e,groupSchPositionBeforeLayout:t}){let n=e.reduce((l,h)=>{let d=Math.max(h.size.x,0.5)+W9e*2,u=Math.max(h.size.y,0.5)+W9e*2;return l+d*u},0),o=Math.sqrt(n)*2,r=[],i=[],s=0;for(let l of e){let h=Math.max(l.size.x,0.5)+W9e*2,d=Math.max(l.size.y,0.5)+W9e*2,u=s>0?s+rrt+h:h;if(i.length>0&&u>o)r.push(i),i=[],s=0;let _=s>0?s+rrt:0;i.push({sectionName:l.sectionName,rowOffset:_,width:h,height:d}),s=_+h}if(i.length>0)r.push(i);let a=new Map,c=0;for(let l of r){let h=Math.max(...l.map((_)=>_.height)),u=-(l[l.length-1].rowOffset+l[l.length-1].width)/2;for(let _ of l)a.set(_.sectionName,{x:u+_.rowOffset+_.width/2+t.x,y:c-h/2+t.y});c-=h+rrt}return a}var xui=XSn.default("Group_doInitialSchematicLayoutSections");function Cui(e){let{db:t}=e.root,n=new Set,o=!1;for(let l of e.children){if(!l.source_component_id)continue;let h=l.getSchematicSectionName();if(h!==null)n.add(h);else o=!0}let r=Array.from(n);if(o)r.push(null);if(r.length===0)return;for(let l of r){let h=Pw(t.toArray(),{source_group_id:e.source_group_id});h.childNodes=h.childNodes.filter((d)=>{if(d.nodeType!=="component"||!d.sourceComponent)return!1;return(e.children.find((p)=>p.source_component_id===d.sourceComponent?.source_component_id)?.getSchematicSectionName()??null)===l}),WSn(e,h)}if(r.length<=1)return;let i=new Map;for(let l of r){let h=1/0,d=-1/0,u=1/0,_=-1/0,p=new Set;for(let m of e.children){let A=m.source_component_id;if(!A)continue;if(m.getSchematicSectionName()!==l)continue;let f=t.schematic_component.getWhere({source_component_id:A});if(!f)continue;p.add(A);let y=f.size.width/2,x=f.size.height/2;h=Math.min(h,f.center.x-y),d=Math.max(d,f.center.x+y),u=Math.min(u,f.center.y-x),_=Math.max(_,f.center.y+x)}if(!Number.isFinite(h)||p.size===0)continue;i.set(l,{sectionName:l,center:{x:(h+d)/2,y:(u+_)/2},size:{x:d-h,y:_-u},sourceCompIds:p})}if(i.size<=1)return;let s=new Set;for(let l of e.children){if(!l.source_component_id)continue;let h=l._parsedProps;if(h?.schX!==void 0||h?.schY!==void 0)s.add(l.getSchematicSectionName())}let a=e._getGlobalSchematicPositionBeforeLayout(),c=yui({sectionBlocks:Array.from(i.values()).map((l)=>({sectionName:l.sectionName,size:l.size})),groupSchPositionBeforeLayout:a});for(let[l,h]of c){let d=i.get(l);if(!d)continue;if(s.has(l)){xui(`[${e.name}] Section "${l}" anchored by manual position, skipping shift`);continue}let u={x:h.x-d.center.x,y:h.y-d.center.y};for(let _ of d.sourceCompIds){let p=t.schematic_component.getWhere({source_component_id:_});if(!p)continue;let m=t.schematic_port.list({schematic_component_id:p.schematic_component_id}),A=t.schematic_text.list({schematic_component_id:p.schematic_component_id});for(let g of m)g.center.x+=u.x,g.center.y+=u.y;for(let g of A)g.position.x+=u.x,g.position.y+=u.y;HZ({db:t,schematicComponentId:p.schematic_component_id,deltaX:u.x,deltaY:u.y}),p.center={x:p.center.x+u.x,y:p.center.y+u.y}}}}var bui=({db:e,schematicDisabled:t})=>{let n=e.schematic_missing_sheet_warning.list()[0],o=e.schematic_component.list().length>0;if(!(!t&&o&&e.schematic_sheet.list().length===0)){if(n)e.schematic_missing_sheet_warning.delete(n.schematic_missing_sheet_warning_id);return}if(n)return;e.schematic_missing_sheet_warning.insert({warning_type:"schematic_missing_sheet_warning",message:"No <schematicsheet> was found. Add a <schematicsheet> to define the schematic drawing area."})},jSn=(e)=>{let t=e.root;if(!t?.isRootCircuit)return;let n=t.firstChild===e,o=Lve(t.firstChild)&&e.parent===t.firstChild;if(!n&&!o)return;bui({db:t.db,schematicDisabled:t.schematicDisabled})},Iui=(e)=>{jSn(e)},vui=class extends lr{source_net_label_id;schematic_net_label_id;get config(){return{componentName:"NetLabel",zodProps:nPt}}_getAnchorSide(){let{_parsedProps:e}=this;if(e.anchorSide)return e.anchorSide;if(!this._resolveConnectsTo())return"right";let n=this.getSubcircuit().selectOne(`net.${this._getNetName()}`),o;if(n?.source_net_id)o=this.root?.db.source_net.get(n.source_net_id);if(o?.is_ground)return"top";if(o?.is_power)return"bottom";let r=this._getGlobalSchematicPositionBeforeLayout(),i=this._getConnectedPorts();if(i.length===0)return"right";let s=i[0];if(s.facingDirection)return mZ(s.facingDirection);let a=s._getGlobalSchematicPositionBeforeLayout(),c=a.x-r.x,l=a.y-r.y;if(Math.abs(c)>Math.abs(l)){if(c>0)return"right";if(c<0)return"left"}else{if(l>0)return"top";if(l<0)return"bottom"}return"right"}_getConnectedPorts(){let e=this._resolveConnectsTo();if(!e)return[];let t=[];for(let n of e){let o=this.getSubcircuit().selectOne(n);if(o)t.push(o)}return t}computeSchematicPropsTransform(){let{_parsedProps:e}=this;if(e.schX===void 0&&e.schY===void 0){let t=this._getConnectedPorts();if(t.length>0){let n=t[0]._getGlobalSchematicPositionBeforeLayout(),o=_o(this.parent?.computeSchematicGlobalTransform?.()??fh(),{x:0,y:0});return Ii(n.x-o.x,n.y-o.y)}}return super.computeSchematicPropsTransform()}doInitialSchematicPrimitiveRender(){if(this.root?.schematicDisabled)return;if(this.getCollapsedSchematicBoxAncestor())return;let{db:e}=this.root,{_parsedProps:t}=this;if(t.inline&&this.root?._featureMspSchematicTraceRouting&&this._getConnectedPorts().length>0)return;let n=this._getGlobalSchematicPositionBeforeLayout(),o=this.getSubcircuit().selectOne(`net.${this._getNetName()}`),r=this._getAnchorSide(),i=wP({anchor_position:n,anchor_side:r,text:t.net}),s=e.schematic_net_label.insert({text:t.net,source_net_id:o.source_net_id,anchor_position:n,center:i,anchor_side:r,schematic_sheet_id:this._resolveSchematicSheetId()});this.source_net_label_id=s.source_net_id,this.schematic_net_label_id=s.schematic_net_label_id}_resolveConnectsTo(){let{_parsedProps:e}=this,t=e.connectsTo??e.connection;if(Array.isArray(t))return t;if(typeof t==="string")return[t];return}_getNetName(){let{_parsedProps:e}=this;return e.net}doInitialCreateNetsFromProps(){let{_parsedProps:e}=this;if(e.net)Gue(this,[`net.${e.net}`])}doInitialCreateTracesFromNetLabels(){let e=this._resolveConnectsTo();if(!e)return;for(let t of e)this.add(new O_({from:t,to:`net.${this._getNetName()}`}))}doInitialSchematicTraceRender(){if(!this.root?._featureMspSchematicTraceRouting)return;if(this.root?.schematicDisabled)return;if(this.getCollapsedSchematicBoxAncestor())return;if(this._parsedProps.inline)return;let{schX:e,schY:t}=this._parsedProps;if(e===void 0&&t===void 0)return;let{db:n}=this.root,o=this._resolveConnectsTo();if(!o||o.length===0)return;let r=this._getGlobalSchematicPositionBeforeLayout(),i=this._getAnchorSide(),a={left:"x-",right:"x+",top:"y+",bottom:"y-"}[i],c=this.getSubcircuit().selectOne(`net.${this._getNetName()}`);for(let l of o){let h=this.getSubcircuit().selectOne(l,{type:"port"});if(!h||!h.schematic_port_id)continue;let d=!1;if(c?.source_net_id){let f=n.source_trace.list().find((y)=>y.connected_source_net_ids?.includes(c.source_net_id)&&y.connected_source_port_ids?.includes(h.source_port_id??""));if(f)d=n.schematic_trace.list().some((y)=>y.source_trace_id===f.source_trace_id);if(d)continue}let u=h._getGlobalSchematicPositionAfterLayout(),_=Rve(h.facingDirection??"right")??"x+",p=FO({x:u.x,y:u.y,facingDirection:_},{x:r.x,y:r.y,facingDirection:a});if(!Array.isArray(p)||p.length<2)continue;let m=[];for(let f=0;f<p.length-1;f++)m.push({from:{x:p[f].x,y:p[f].y},to:{x:p[f+1].x,y:p[f+1].y}});let A,g;if(c?.source_net_id&&h.source_port_id){let f=n.source_trace.list().find((y)=>y.connected_source_net_ids?.includes(c.source_net_id)&&y.connected_source_port_ids?.includes(h.source_port_id));A=f?.source_trace_id,g=f?.subcircuit_connectivity_map_key||n.source_net.get(c.source_net_id)?.subcircuit_connectivity_map_key}n.schematic_trace.insert({source_trace_id:A,edges:m,junctions:[],subcircuit_connectivity_map_key:g,schematic_sheet_id:this._resolveSchematicSheetId()}),n.schematic_port.update(h.schematic_port_id,{is_connected:!0})}}},Hct=(e)=>{let t=[...new Set(e.flatMap((s)=>s._getDirectlyConnectedTraces()))],n=t.find((s)=>s._parsedProps.schDisplayLabel)?._parsedProps.schDisplayLabel??t.find((s)=>s._parsedProps.displayName)?._parsedProps.displayName??t.find((s)=>s._parsedProps.name)?._parsedProps.name;if(n)return{name:n,wasAssignedDisplayLabel:!0};let o=e.find((s)=>s.root)?.root?.db,r=e.map((s)=>s.source_port_id).filter((s)=>Boolean(s));return{name:(o?Dst(o,r):e.map((s)=>s._getNetLabelText()).filter((s)=>Boolean(s)).sort((s,a)=>s.localeCompare(a,void 0,{numeric:!0,sensitivity:"base"}))[0])??"",wasAssignedDisplayLabel:!1}},A5n=(e,t,n)=>{let o=e.get(t);if(o)o.push(n);else e.set(t,[n])},Fct=(e)=>{let{db:t}=e.root,n=new Map,o=new Map,r=new Map,i=new Map;for(let s of t.source_net.list())if(s.subcircuit_connectivity_map_key)n.set(s.subcircuit_connectivity_map_key,s);for(let s of e.selectAll("port")){let a=s._getSubcircuitConnectivityKey();if(a)A5n(o,a,s)}for(let s of t.source_port.list())if(s.subcircuit_connectivity_map_key)A5n(r,s.subcircuit_connectivity_map_key,s.source_port_id);return({subcircuitConnectivityMapKey:s})=>{let a=i.get(s);if(a)return a;let c=n.get(s);if(c?.name){let d={name:c.name,wasAssignedDisplayLabel:!0};return i.set(s,d),d}let l=Hct(o.get(s)??[]);if(l.name)return i.set(s,l),l;let h={name:Dst(t,r.get(s)??[])??"",wasAssignedDisplayLabel:!1};return i.set(s,h),h}},Ep=(e)=>e,qJ=(e)=>e,Sui=$Sn.default("Group_doInitialSchematicTraceRender"),Pui="rgb(132, 0, 0)",Eui=-90;function Mui(e){let{group:t,solver:n,userNetIdToConnKey:o,sourceTraceIdByPinPairKey:r,crossScopeSourceTraceIdBySchematicPortIdAndNetId:i}=e,{db:s}=t.root,a=n.inlineNetLabelSolver?.getOutput().inlineNetLabelPlacements??[];if(a.length===0)return;let c=Fct(t),l=n.mspConnectionPairSolver.globalConnMap;for(let h of a){let d=h.pinIds.map(Ep),u=l.getIdsConnectedToNet(h.globalConnNetId).find((P)=>o.has(P)),_=d.length===1?i.get(d[0])?.get(h.netId??h.globalConnNetId):void 0,p=(_?s.source_trace.get(_)?.subcircuit_connectivity_map_key:void 0)??(u?o.get(u):void 0),m=h.netLabelText??(p?c({subcircuitConnectivityMapKey:p}).name:h.netId??h.globalConnNetId);if(!m){Sui(`skipping inline net label for "${h.netId}" REASON:no resolvable text`);continue}let A=_??r.get([...d].sort().join("::"));if(!A&&p){let P=d.flatMap((M)=>{let B=s.schematic_port.get(M)?.source_port_id;return B?[B]:[]});A=s.source_trace.list().find((M)=>M.subcircuit_connectivity_map_key===p&&P.some((B)=>M.connected_source_port_ids.includes(B)))?.source_trace_id}let g=t._resolveSchematicSheetId(),f=s.schematic_port.get(d[0]);if(f?.schematic_sheet_id)g=f.schematic_sheet_id;let y={x:0,y:0},x=h.stubTracePath?.map((P)=>({...P}));if(x&&d.length===1){let P=s.schematic_port.get(d[0])?.center;if(P)y={x:P.x-x[0].x,y:P.y-x[0].y},x=x.map((M)=>({x:M.x+y.x,y:M.y+y.y}))}let C={x:h.anchorPoint.x+y.x,y:h.anchorPoint.y+y.y},b={x:h.center.x+y.x,y:h.center.y+y.y},I="center",v=h.height/2;switch(h.side){case"y+":b.y=C.y+v;break;case"y-":b.y=C.y-v;break;case"x+":b.x=C.x+v;break;case"x-":b.x=C.x-v;break}if(x&&x.length===2){let[P,M]=x;if(h.axis==="x"){let B=M.x>P.x;I=B?"left":"right",b.x+=B?-h.width/2:h.width/2}else{let B=M.y>P.y;I=B?"left":"right",b.y+=B?-h.width/2:h.width/2}}if(x&&x.length===2)s.schematic_trace.insert({source_trace_id:A,edges:[{from:x[0],to:x[1]}],junctions:[],subcircuit_connectivity_map_key:p,schematic_sheet_id:g}),s.schematic_port.update(d[0],{is_connected:!0});s.schematic_text.insert({text:m,source_trace_id:A,anchor:I,position:b,rotation:h.axis==="y"?Eui:0,font_size:h.height,color:Pui,schematic_sheet_id:g})}}var wui=0.18,JSn=({center:e,text:t})=>{let o=$B({text:t})/2,r=wui/2;return{minX:e.x-o,maxX:e.x+o,minY:e.y-r,maxY:e.y+r}},Bui=(e)=>{switch(e){case"x+":return"left";case"x-":return"right";case"y+":return"bottom";case"y-":return"top";case"left":return"right";case"top":return"bottom";case"right":return"left";case"bottom":return"top"}},fde=qSn.default("Group_doInitialSchematicTraceRender"),ZSn=(e,t)=>e.schematicNetLabel.source_net_id!=null&&e.schematicNetLabel.source_net_id===t.source_net_id,Tui=(e,t)=>{if(!ZSn(e,t.sourceNet))return!1;if(e.schematicPortIds.some((n)=>t.schematicPortIds.has(n)))return!0;if(!e.schematicNetLabel.center)return!1;return qp(JSn({center:e.schematicNetLabel.center,text:e.schematicNetLabel.text}),t.bounds)};function Dui(e){let{group:t,routedSchematicPortIdBySchematicPortId:n,solver:o,connKeyToSourceNet:r,userNetIdToConnKey:i,crossScopeSourceTraceIdBySchematicPortIdAndNetId:s,sourceTraceIdByPortOnlyLabelSchematicPortId:a,connKeysWithExplicitPortNetTraces:c,schematicPortIdsWithPreExistingNetLabels:l,schematicPortIdsWithRoutedTraces:h,netLabels:d}=e,{db:u}=t.root,_=Fct(t),p=o.inlineNetLabelSolver?.getOutput().netLabelPlacements??o.netLabelNetLabelCollisionSolver?.getOutput().netLabelPlacements??o.netLabelTraceCollisionSolver?.getOutput().netLabelPlacements??o.netLabelPlacementSolver?.netLabelPlacements??o.traceLabelOverlapAvoidanceSolver?.getOutput().netLabelPlacements??[],m=[],A=new Set;for(let b of p){let I=[...b.pinIds??[]].sort(),v=`${b.globalConnNetId}|${I.join("::")}|${b.netId??""}`;if(A.has(v)){fde(`skipping duplicate placement for "${b.netId}" REASON:identical net label placement`);continue}A.add(v),m.push(b)}let g=new Map,f=new Map,y=new Set;for(let b of m){if(g.set(b.globalConnNetId,(g.get(b.globalConnNetId)??0)+1),(b.pinIds?.length??0)>1){if(!f.has(b.globalConnNetId))f.set(b.globalConnNetId,new Set);f.get(b.globalConnNetId).add(b.pinIds.slice().sort().join("::"))}if((b.pinIds?.length??0)<=1)y.add(b.globalConnNetId)}let x=o.mspConnectionPairSolver.globalConnMap,C=d.map((b)=>{if(!b.schematic_net_label_id)return null;let I=u.schematic_net_label.get(b.schematic_net_label_id);if(!I)return null;return{schematicNetLabel:I,schematicPortIds:b._getConnectedPorts().map((v)=>v.schematic_port_id).filter((v)=>Boolean(v)).map((v)=>n.get(v)??v),shouldUseSchematicTraceSolver:b._parsedProps.schX===void 0&&b._parsedProps.schY===void 0}}).filter((b)=>b!==null);for(let b of m){fde(`processing placement: ${b.netId}`);let I=b.pinIds.map(Ep),P=(I.length===1?s.get(I[0])?.get(b.netId??b.globalConnNetId):void 0)??(I.length===1?a.get(I[0]):void 0),M=P?u.source_trace.get(P):void 0,B=x.getIdsConnectedToNet(b.globalConnNetId).find((ne)=>i.get(ne)),T=M?.subcircuit_connectivity_map_key??i.get(B),N=b.orientation,D=Bui(N),L;if(T)L=r.get(T);let H=T?_({subcircuitConnectivityMapKey:T}):{name:b.netId??b.globalConnNetId,wasAssignedDisplayLabel:!1},V=b.netLabelText?{name:b.netLabelText,wasAssignedDisplayLabel:!0}:H,O=t._resolveSchematicSheetId(),U=u.schematic_port.get(I[0]);if(U?.schematic_sheet_id)O=U.schematic_sheet_id;let j=b.anchorPoint;if(I.length===1&&I[0]){let ne=u.schematic_port.get(I[0]);if(ne?.center&&!ne.is_connected)j=ne.center}if(I.some((ne)=>l.has(ne))){fde(`skipping net label placement for "${b.netId}" REASON:schematic port has pre-existing net label`);continue}if(L){let ne=L.is_ground||L.is_power,re=c.has(T),Z=I.some((Ae)=>h.has(Ae)),te=(g.get(b.globalConnNetId)??0)<=1;if(!re&&!ne&&Z&&te){fde(`skipping net label placement for "${b.netId}" REASON:schematic port has routed trace`);continue}let le=V.name,ue=wP({anchor_position:j,anchor_side:D,text:le}),de=C.find((Ae)=>Ae.shouldUseSchematicTraceSolver&&ZSn(Ae,L)&&Ae.schematicPortIds.some((xe)=>I.includes(xe)));if(de){u.schematic_net_label.update(de.schematicNetLabel.schematic_net_label_id,{anchor_position:j,center:ue,anchor_side:D,schematic_sheet_id:O,source_trace_id:P});continue}if(!ne){let Ae={sourceNet:L,text:le,schematicPortIds:new Set(I),bounds:JSn({center:ue,text:le})};if(C.some((xe)=>Tui(xe,Ae)))continue}let me={text:le,source_net_id:L.source_net_id,anchor_position:j,center:ue,anchor_side:D,schematic_sheet_id:O,source_trace_id:P};u.schematic_net_label.insert(me);continue}let{name:Y,wasAssignedDisplayLabel:X}=V,J=(b.pinIds?.length??0)>1&&(y.has(b.globalConnNetId)||(f.get(b.globalConnNetId)?.size??0)>1);if(!X&&!J&&I.some((ne)=>h.has(ne))){fde(`skipping net label placement for "${b.netId}" REASON:schematic port has routed traces and no display label`);continue}let ee=wP({anchor_position:j,anchor_side:D,text:Y}),se={text:Y,source_net_id:T??b.netId??b.globalConnNetId,anchor_position:j,center:ee,anchor_side:D,schematic_sheet_id:O,source_trace_id:P};u.schematic_net_label.insert(se)}}var X9e=(e,t,n,o)=>e*o-t*n;function zct(e,t,n,o,r){let i={x:t.x-e.x,y:t.y-e.y},s={x:o.x-n.x,y:o.y-n.y},a=X9e(i.x,i.y,s.x,s.y),c={x:n.x-e.x,y:n.y-e.y},l=X9e(c.x,c.y,i.x,i.y);if(Math.abs(a)<r&&Math.abs(l)<r)return null;if(Math.abs(a)<r&&Math.abs(l)>=r)return null;let h=X9e(c.x,c.y,s.x,s.y)/a,d=X9e(c.x,c.y,i.x,i.y)/a;if(h<-r||h>1+r||d<-r||d>1+r)return null;return{x:e.x+h*i.x,y:e.y+h*i.y}}var Wk=0.000001;function f5n(e){let t=Math.abs(e.to.x-e.from.x),n=Math.abs(e.to.y-e.from.y);return t>=n}function CG(e,t){return Math.hypot(t.x-e.x,t.y-e.y)}function jY(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function cZ(e,t,n){let o=CG(e,t);if(o<Wk)return 0;let r=((n.x-e.x)*(t.x-e.x)+(n.y-e.y)*(t.y-e.y))/((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y));return Math.max(0,Math.min(1,r))*o}function nPn(e,t=Wk){if(e.length===0)return e;e.sort((r,i)=>r.start-i.start);let n=[],o={...e[0]};for(let r=1;r<e.length;r++){let i=e[r];if(i.start<=o.end+t)o.end=Math.max(o.end,i.end);else n.push(o),o={...i}}return n.push(o),n}function Nui(e,t,n){let o=CG(e.from,e.to);if(o<Wk||t.length===0)return[e];let r=n/2,i=t.map((d)=>({start:Math.max(0,d-r),end:Math.min(o,d+r)})).filter((d)=>d.end-d.start>Wk),s=nPn(i),a=[],c=0,l={x:e.to.x-e.from.x,y:e.to.y-e.from.y},h=(d,u,_)=>{if(u-d<=Wk)return;let p=d/o,m=u/o;a.push({from:jY(e.from,e.to,p),to:jY(e.from,e.to,m),..._?{is_crossing:!0}:{}})};for(let d of s){if(d.start-c>Wk)h(c,d.start,!1);h(d.start,d.end,!0),c=d.end}if(o-c>Wk)h(c,o,!1);return a.length>0?a:[e]}function Rui(e,t={}){let n=t.crossSegmentLength??0.075,o=t.tolerance??Wk,r=new Map,i=(c)=>`${c.traceIdx}:${c.edgeIdx}`,s=(c)=>e[c.traceIdx].edges[c.edgeIdx];for(let c=0;c<e.length;c++){let l=e[c];for(let h=0;h<l.edges.length;h++){let d=l.edges[h];for(let u=c;u<e.length;u++){let _=e[u];for(let p=u===c?h+1:0;p<_.edges.length;p++){let m=_.edges[p];if(l.connectivity_key!==void 0&&l.connectivity_key===_.connectivity_key)continue;let A=zct(d.from,d.to,m.from,m.to,o);if(!A)continue;let g=CG(d.from,d.to),f=CG(m.from,m.to);if(g<o||f<o)continue;let y=cZ(d.from,d.to,A),x=cZ(m.from,m.to,A),C=y<=o||Math.abs(g-y)<=o||Number.isNaN(y),b=x<=o||Math.abs(f-x)<=o||Number.isNaN(x);if(!C&&!b){let I=f5n(d),v=f5n(m),P;if(I!==v)P=I;else{let T=Math.abs(d.to.x-d.from.x),N=Math.abs(d.to.y-d.from.y),D=Math.abs(m.to.x-m.from.x),L=Math.abs(m.to.y-m.from.y),H=T-N,V=D-L;P=H===V?!0:H>V}let M=i({traceIdx:P?c:u,edgeIdx:P?h:p}),B=r.get(M)??[];B.push(P?y:x),r.set(M,B)}}}}}let a=e.map((c)=>({...c,edges:[]}));for(let c=0;c<e.length;c++){let l=e[c];for(let h=0;h<l.edges.length;h++){let d=i({traceIdx:c,edgeIdx:h}),u=r.get(d)??[];if(u.length===0){a[c].edges.push(l.edges[h]);continue}let _=Array.from(new Set(u.map((m)=>Number(m.toFixed(6))))).sort((m,A)=>m-A),p=Nui(l.edges[h],_,n);a[c].edges.push(...p)}}return a}var Qv=0.000001;function I8e(e,t,n=Qv){return Math.abs(e-t)<=n}function yL(e,t,n=Qv){return I8e(e.x,t.x,n)&&I8e(e.y,t.y,n)}function y5n(e,t,n,o=Qv){let r=Math.min(t.x,n.x)-o,i=Math.max(t.x,n.x)+o,s=Math.min(t.y,n.y)-o,a=Math.max(t.y,n.y)+o;if(e.x<r||e.x>i||e.y<s||e.y>a)return!1;return Math.abs((n.x-t.x)*(e.y-t.y)-(n.y-t.y)*(e.x-t.x))<=o}function x5n(e,t=Qv){let n=new Map;for(let o of e){let r=`${o.x.toFixed(6)},${o.y.toFixed(6)}`;if(!n.has(r))n.set(r,o)}return Array.from(n.values())}function C5n(e){return{x:e.to.x-e.from.x,y:e.to.y-e.from.y}}function b5n(e,t,n=Qv){return yL(e,t.from,n)||yL(e,t.to,n)}function irt(e,t,n=Qv){let o=C5n(e),r=C5n(t),i=Math.hypot(o.x,o.y),s=Math.hypot(r.x,r.y);if(i<n||s<n)return!0;let a=o.x*r.y-o.y*r.x;return Math.abs(a)<=n*i*s}function Tde(e,t,n=Qv){return e.edges.filter((o)=>yL(o.from,t,n)||yL(o.to,t,n))}function I5n(e,t,n=Qv){for(let o of e.edges){if(yL(o.from,t,n))return o.from;if(yL(o.to,t,n))return o.to}return null}function Qui(e,t,n=Qv){let o=yL(e.from,t,n)||I8e(e.from.x,t.x,n)&&I8e(e.from.y,t.y,n)?e.to:e.from,r=o.x-t.x,i=o.y-t.y;if(Math.abs(r)<n&&Math.abs(i)<n)return null;if(Math.abs(r)>=Math.abs(i))return r>=0?"right":"left";return i>=0?"up":"down"}function OJ(e,t,n=Qv){let o=Tde(e,t,n);if(o.length<2)return null;let r=o.map((d)=>Qui(d,t,n)),i=r.includes("up"),s=r.includes("down"),a=r.includes("left"),c=r.includes("right"),l=i?"up":s?"down":null,h=c?"right":a?"left":null;if(l&&h)return`${l}-${h}`;return null}function kui(e,t={}){let n=t.tolerance??Qv,o={};for(let i of e)o[i.source_trace_id]=[];let r=e.map((i)=>{let s=[];for(let a of i.edges)s.push(a.from,a.to);return x5n(s,n)});for(let i=0;i<e.length;i++){let s=e[i],a=r[i];for(let c=i+1;c<e.length;c++){let l=e[c],h=r[c];if(!(s.connectivity_key!==void 0&&s.connectivity_key===l.connectivity_key))continue;for(let u of s.edges)for(let _ of l.edges){let p=zct(u.from,u.to,_.from,_.to,n);if(!p)continue;if(b5n(p,u,n)||b5n(p,_,n))continue;if(o[s.source_trace_id].push(p),s.source_trace_id!==l.source_trace_id)o[l.source_trace_id].push(p)}for(let u of a)for(let _ of h)if(yL(u,_,n)){let p=Tde(s,u,n),m=Tde(l,_,n),A=p.some((x)=>m.some((C)=>!irt(x,C,n))),g=OJ(s,u,n),f=OJ(l,_,n);if(A&&!(g!==null&&f!==null&&g===f)){if(o[s.source_trace_id].push(u),s.source_trace_id!==l.source_trace_id)o[l.source_trace_id].push(_)}}for(let u of a)for(let _ of l.edges)if(y5n(u,_.from,_.to,n)){let m=Tde(s,u,n).some((x)=>!irt(x,_,n)),A=OJ(s,u,n),g=I5n(l,u,n*1000),f=g?OJ(l,g,n):null;if(m&&!(A!==null&&f!==null&&A===f)){if(o[s.source_trace_id].push(u),s.source_trace_id!==l.source_trace_id)o[l.source_trace_id].push(u)}}for(let u of h)for(let _ of s.edges)if(y5n(u,_.from,_.to,n)){let m=Tde(l,u,n).some((x)=>!irt(_,x,n)),A=OJ(l,u,n),g=I5n(s,u,n*1000),f=g?OJ(s,g,n):null;if(m&&!(f!==null&&A!==null&&f===A)){if(o[l.source_trace_id].push(u),s.source_trace_id!==l.source_trace_id)o[s.source_trace_id].push(u)}}}}for(let i of Object.keys(o))o[i]=x5n(o[i],n);return o}var oL=0.000001;function Lui(e,t,n=oL){let o=e.to.x-e.from.x,r=e.to.y-e.from.y,i=t.to.x-t.from.x,s=t.to.y-t.from.y,a=Math.hypot(o,r),c=Math.hypot(i,s);if(a<=n||c<=n)return!1;let l=o*s-r*i;if(Math.abs(l)>n*a*c)return!1;let h=o*(t.from.y-e.from.y)-r*(t.from.x-e.from.x);return Math.abs(h)<=n*a}function Hui(e,t){let n=nPn(t);if(n.length===0)return[e];let o=CG(e.from,e.to);if(o<=oL)return[e];let r=[],i=0;for(let s of n){if(s.start-i>oL)r.push({from:jY(e.from,e.to,i/o),to:jY(e.from,e.to,s.start/o)});if(s.end-s.start>oL)r.push({from:jY(e.from,e.to,s.start/o),to:jY(e.from,e.to,s.end/o),is_crossing:!0});i=Math.max(i,s.end)}if(o-i>oL)r.push({from:jY(e.from,e.to,i/o),to:e.to});return r}function Fui(e){let t=new Map;for(let n=0;n<e.length;n++){let o=e[n];if(!o.connectivity_key)continue;for(let r of o.edges){if(!r.is_crossing||CG(r.from,r.to)<=oL)continue;for(let i=0;i<e.length;i++){let s=e[i];if(i===n||s.connectivity_key!==o.connectivity_key)continue;for(let a=0;a<s.edges.length;a++){let c=s.edges[a],l=CG(c.from,c.to);if(c.is_crossing||l<=oL)continue;if(!Lui(c,r))continue;let h=Math.max(0,Math.min(cZ(c.from,c.to,r.from),cZ(c.from,c.to,r.to))),d=Math.min(l,Math.max(cZ(c.from,c.to,r.from),cZ(c.from,c.to,r.to)));if(d-h<=oL)continue;let u=`${i}:${a}`,_=t.get(u)??[];_.push({start:h,end:d}),t.set(u,_)}}}}if(t.size===0)return e;return e.map((n,o)=>({...n,edges:n.edges.flatMap((r,i)=>{let s=t.get(`${o}:${i}`);return s?Hui(r,s):[r]})}))}var j9e=0.000001;function zui({traces:e,existingTraces:t,netLabelTerminals:n,terminals:o,inlineNetLabelTraces:r=new Set}){let i=new Map;for(let s of new Set(n.map((a)=>a.connectivityKey))){let a=[],c=(p)=>{let m=a.find((A)=>Jl(A.position,p)<=j9e);if(!m)m={position:p,segments:[],distanceToLabel:1/0},a.push(m);return m},l=[...t.filter((p)=>p.subcircuit_connectivity_map_key===s).flatMap((p)=>p.edges.map((m)=>({edge:m,isPreserved:!0}))),...e.filter((p)=>p.subcircuit_connectivity_map_key===s).flatMap((p)=>p.edges.map((m)=>({edge:m,isPreserved:r.has(p)})))];for(let{edge:p}of l)c(p.from),c(p.to);for(let p=0;p<l.length;p++)for(let m=p+1;m<l.length;m++){let A=l[p].edge,g=l[m].edge,f=zct(A.from,A.to,g.from,g.to,j9e);if(f)c(f)}let h=o.filter((p)=>p.connectivityKey===s).map((p)=>c(p.position));for(let p of n)if(p.connectivityKey===s)c(p.position).distanceToLabel=0;let d=new Map;for(let{edge:p,isPreserved:m}of l){let A=a.filter((f)=>ga(f.position,p.from,p.to)<=j9e).sort((f,y)=>Jl(p.from,f.position)-Jl(p.from,y.position)),g=[];for(let f=1;f<A.length;f++){let y=A[f-1],x=A[f],C={from:y,to:x,cost:m?0:Jl(y.position,x.position)};y.segments.push(C),x.segments.push(C),g.push(C)}if(!m)d.set(p,g)}let u=new Set(a);while(u.size>0){let p;for(let m of u)if(m.distanceToLabel<(p?.distanceToLabel??1/0))p=m;if(!p)break;u.delete(p);for(let m of p.segments){let A=m.from===p?m.to:m.from,g=p.distanceToLabel+m.cost;if(u.has(A)&&g<A.distanceToLabel)A.distanceToLabel=g,A.pathToLabel={node:p,segment:m}}}let _=new Set;for(let p of h)while(p.pathToLabel){let{segment:m,node:A}=p.pathToLabel;if(_.has(m))break;_.add(m),p=A}for(let[p,m]of d){let A=[];for(let g of m){if(!_.has(g)&&Number.isFinite(g.from.distanceToLabel))continue;let f=A.at(-1);if(f&&Jl(f.to,g.from.position)<=j9e)f.to=g.to.position;else A.push({...p,from:g.from.position,to:g.to.position})}i.set(p,A)}}return e.map((s)=>({...s,edges:s.edges.flatMap((a)=>i.get(a)??[a])})).filter((s)=>s.edges.length>0)}var srt=ePn.default("Group_doInitialSchematicTraceRender"),Oui=1.5;function Vui(e,t){let{points:n,schematicPortIds:o,componentBoundsByPortId:r}=e,i=o.map((_)=>{let p=t.schematic_port.get(_)?.center,m=r.get(_);if(!p||!m)return null;return{center:p,bounds:m}}).filter((_)=>Boolean(_));if(i.length===0)return n;let s=n.map((_)=>({x:_.x,y:_.y})),a=(_,p)=>(_.x-p.x)**2+(_.y-p.y)**2,c=new Set;for(let _=0;_<i.length;_++)if(s.some((p)=>a(i[_].center,p)<=0.000000000001))c.add(_);let l=0.001,h=["start","end"],d=[];for(let _ of h){let p=_==="start"?s[0]:s[s.length-1];for(let m=0;m<i.length;m++){if(c.has(m))continue;let{center:A,bounds:g}=i[m],f=a(A,p);if(Math.abs(A.x-p.x)>l&&Math.abs(A.y-p.y)>l)continue;if(f>Oui**2&&rHe(p,g)>l)continue;d.push({endpoint:_,centerIndex:m,dist:f})}}d.sort((_,p)=>_.dist-p.dist);let u=new Set;for(let{endpoint:_,centerIndex:p,dist:m}of d){if(u.has(_)||c.has(p))continue;if(c.add(p),u.add(_),m<=0.000000000001)continue;let A=i[p].center;if(_==="start")s.unshift({x:A.x,y:A.y});else s.push({x:A.x,y:A.y})}return s}function Yui(e){let{group:t,solver:n,userNetIdToConnKey:o,schematicPortIdsWithPreExistingNetLabels:r,schematicSheetId:i}=e,{db:s}=t.root,a=new Map(n.inputProblem.chips.flatMap((v)=>v.pins.map((P)=>[Ep(P.pinId),P]))),c=new Set(t.selectAll("port").filter((v)=>{if(!v._getSymbolAncestor())return!1;let P=v.getParentNormalComponent()?._parsedProps.symbol;return tPn.isValidElement(P)||Qrt(P)}).map((v)=>v.schematic_port_id).filter((v)=>v!==null&&v!==void 0).map(Ep)),l=new Map;for(let v of s.schematic_component.list()){let P=p7e({db:s,schematicComponent:v}),M=Pd({center:v.center,width:v.size.width,height:v.size.height});for(let B of s.schematic_port.list({schematic_component_id:v.schematic_component_id})){let T=B.center.x>M.minX&&B.center.x<M.maxX&&B.center.y>M.minY&&B.center.y<M.maxY,N=Ep(B.schematic_port_id);if(!P&&!c.has(N))continue;if(!P&&T)continue;l.set(N,P??M)}}let h=n.inlineNetLabelSolver?.getOutput().traces??n.sameNetJunctionAlignmentSolver?.getOutput().traces??n.netLabelTraceCollisionSolver?.getOutput().traces??n.traceCleanupSolver?.getOutput().traces??n.traceLabelOverlapAvoidanceSolver?.getOutput().traces??n.schematicTraceLinesSolver?.solvedTracePaths,d=[],u=[],_=[];srt(`Traces inside SchematicTraceSolver output: ${(h??[]).length}`);for(let v of h??[]){let M=Array.from(new Set(v.pinIds??[])).map(Ep),B=v?.tracePath;if(!Array.isArray(B)||B.length<2){srt(`Skipping trace ${v?.pinIds.join(",")} because it has less than 2 points`);continue}let T=Vui({points:B,schematicPortIds:M,componentBoundsByPortId:l},s),N=[];for(let O=0;O<T.length-1;O++)N.push({from:{x:T[O].x,y:T[O].y},to:{x:T[O+1].x,y:T[O+1].y}});let D=String(v?.mspPairId),L;if(Array.isArray(v?.pins)&&v.pins.length===2){let O=v.pins[0]?.pinId,U=v.pins[1]?.pinId,j=O?Ep(O):void 0,Y=U?Ep(U):void 0;if(j&&Y){let X=new Set([j,Y]);for(let K of X)s.schematic_port.update(K,{is_connected:!0});L=o.get(String(v.userNetId))}}if(!L)L=o.get(String(v.userNetId));if(!L){let O=M.map((j)=>{let X=s.schematic_port.get(j)?.source_port_id;if(!X)return;return s.source_port.get(X)?.subcircuit_connectivity_map_key}).filter((j)=>Boolean(j));if(new Set(O).size===1)L=O[0]}if(L)for(let O of M){let U=s.schematic_port.get(O);if(!U)continue;let j={position:U.center,connectivityKey:L};u.push(j);let Y=a.get(O);if(Y)u.push({position:{x:Y.x,y:Y.y},connectivityKey:L});if(r.has(O))_.push(j)}let H=new Set(M.map((O)=>s.schematic_port.get(O)?.schematic_sheet_id).filter((O)=>Boolean(O))),V;if(H.size===1)V=H.values().next().value;else if(H.size===0)V=t._resolveSchematicSheetId();d.push({source_trace_id:D,edges:N,subcircuit_connectivity_map_key:L,schematic_sheet_id:V})}srt(`Applying ${d.length} traces from SchematicTraceSolver output`);let p=s.schematic_trace.list().filter((v)=>v.schematic_sheet_id===i),m=n.inlineNetLabelSolver?.getOutput().netLabelPlacements??n.netLabelNetLabelCollisionSolver?.getOutput().netLabelPlacements??n.netLabelTraceCollisionSolver?.getOutput().netLabelPlacements??n.netLabelPlacementSolver?.netLabelPlacements??n.traceLabelOverlapAvoidanceSolver?.getOutput().netLabelPlacements??[];for(let v of m){if(v.pinIds.some((B)=>r.has(Ep(B))))continue;let P=n.mspConnectionPairSolver.globalConnMap.getIdsConnectedToNet(v.globalConnNetId).find((B)=>o.has(B)),M=P?o.get(P):void 0;if(M)u.push({position:v.anchorPoint,connectivityKey:M})}let A=new Set((n.inlineNetLabelSolver?.getOutput().inlineNetLabelPlacements??[]).flatMap((v)=>v.mspPairId?[v.mspPairId]:[])),g=zui({traces:d,existingTraces:p,netLabelTerminals:_,terminals:u,inlineNetLabelTraces:new Set(d.filter((v)=>A.has(v.source_trace_id)))}),f=[];for(let v of p){if(v.edges.length===0)continue;let P=v.source_trace_id?s.source_trace.get(v.source_trace_id):void 0;f.push({schematic_trace_id:v.schematic_trace_id,source_trace_id:v.source_trace_id??v.schematic_trace_id,edges:v.edges,connectivity_key:v.subcircuit_connectivity_map_key??P?.subcircuit_connectivity_map_key})}let y=Rui([...g.map((v)=>({source_trace_id:v.source_trace_id,edges:v.edges,connectivity_key:v.subcircuit_connectivity_map_key})),...f]),x=Fui(y),C=x.slice(0,g.length),b=x.slice(g.length);for(let v of b){if(!v.schematic_trace_id)continue;s.schematic_trace.update(v.schematic_trace_id,{edges:v.edges})}let I=kui([...C,...b]);for(let v of C){let P=d.find((B)=>B.source_trace_id===v.source_trace_id),M=i;if(P?.schematic_sheet_id)M=P.schematic_sheet_id;s.schematic_trace.insert({source_trace_id:v.source_trace_id,edges:v.edges,junctions:I[v.source_trace_id]??[],subcircuit_connectivity_map_key:P?.subcircuit_connectivity_map_key,schematic_sheet_id:M})}}var v5n=0.12,S5n=(e,t)=>{e.anchoredNetLabelWidth??=Number($B({text:t}).toFixed(2)),e.allowInlineNetLabel=!0,e.inlineNetLabelHeight=v5n,e.inlineNetLabelWidth=Number($B({text:t,font_size:v5n}).toFixed(2))},Gui=({directConnections:e,netConnections:t,connKeyToSchematicPortIds:n,connKeyToSourceNet:o,connKeysWithExplicitPortNetTraces:r,schematicPortIdsWithExplicitNetLabels:i,schematicPortIdsWithInlineNetLabels:s,areSchematicPortsOnDifferentComponents:a,resolveCanonicalNetLabelText:c})=>{for(let l of e){let{connKey:h}=l;if(!h)continue;if(n.get(h)?.length!==2)continue;let u=o.get(h);if(u?.is_power||u?.is_ground)continue;let{name:_,wasAssignedDisplayLabel:p}=c({subcircuitConnectivityMapKey:h});if(!_||!p)continue;S5n(l,_)}for(let l of t){let{schematicPortIds:h}=l,{isSameSheetCrossSectionConnection:d}=l,u=h.some((x)=>s.has(x)),_=h.length===1,p=h[0],m=p!==void 0&&h.slice(1).some((x)=>a([p,x]));if(!u&&!d&&!_&&!m)continue;if(!u&&h.some((x)=>i.has(x)))continue;let{connKey:A}=l;if(!A&&!d)continue;if(A&&!d&&!r.has(A))continue;let g=A?o.get(A):void 0;if(!u&&(l.isPowerOrGroundConnection||g?.is_power||g?.is_ground))continue;let f=l.netLabelText??"",y=Boolean(f);if(!d){if(!A)continue;let x=c({subcircuitConnectivityMapKey:A});f=x.name,y=x.wasAssignedDisplayLabel}if(!f||!u&&!y)continue;S5n(l,f)}},Uui=(e)=>{let{schX:t,schY:n}=e._parsedProps;if(t!==void 0&&n!==void 0)return e;if(!e.getParentNormalComponent()?.getSchematicSymbol())return e;let o=e._getPortsInternallyConnectedToThisPort(),r=e.schematicSymbolPortDef??o.find((i)=>i.schematicSymbolPortDef)?.schematicSymbolPortDef;if(!r)return e;return o.find((i)=>i.schematicSymbolPortDef===r)??e};function Wui(e){let{db:t}=e.root,n=new Map;for(let o of e.selectAll("port")){if(!o.schematic_port_id)continue;let r=t.schematic_port.get(o.schematic_port_id),i=Uui(o),s=i.schematic_port_id?t.schematic_port.get(i.schematic_port_id):void 0;if(!r||!s||r.schematic_component_id!==s.schematic_component_id||r.schematic_sheet_id!==s.schematic_sheet_id)continue;n.set(Ep(r.schematic_port_id),Ep(s.schematic_port_id))}return n}var oPn=({db:e,sourcePortId:t,otherSourcePortId:n,sourcePortIdsInSchematicScope:o,schematicSheetId:r})=>{if(o.has(n))return!1;let i=e.source_port.get(t),s=e.source_port.get(n);if(!i||!s)return!1;if(i.subcircuit_id!==s.subcircuit_id)return!0;if(!r)return!1;let a=e.schematic_port.list({source_port_id:n});if(a.some((l)=>l.schematic_sheet_id===r))return!1;return a.some((l)=>l.schematic_sheet_id!==void 0)},rPn=({db:e,sourcePortId:t,sourcePortIdsInSchematicScope:n,schematicSheetId:o})=>{if(!e.source_port.get(t))return;for(let r of e.source_trace.list()){let i=(r.connected_source_port_ids??[]).map(qJ);if(i.length!==2)continue;if((r.connected_source_net_ids??[]).length>0)continue;if(!i.includes(t))continue;let s=i.find((a)=>a!==t);if(!s)continue;if(!oPn({db:e,sourcePortId:t,otherSourcePortId:s,sourcePortIdsInSchematicScope:n,schematicSheetId:o}))continue;return s}},iPn=({group:e,sourcePortId:t,connectedSourcePortIdsForKey:n,sourcePortIdsInSchematicScope:o,schematicSheetId:r,connKey:i,sourceNet:s})=>{let{db:a}=e.root,c=e.selectAll("port").filter((A)=>A._getSubcircuitConnectivityKey()===i),{name:l,wasAssignedDisplayLabel:h}=Hct(c),d=h?l:void 0,u=h?void 0:l||void 0,_=Dst(a,n),p=rPn({db:a,sourcePortId:t,sourcePortIdsInSchematicScope:o,schematicSheetId:r}),m=p?O4n(a,p):void 0;return{text:s?.name||s?.source_net_id||d||m||u||_||i,wasAssignedDisplayLabel:h,directConnectionOutsideSchematicScopeSourcePortId:p}},Xui=[28,28,35,56,56,89,67,19,33,33,39,58,28,33,28,28,56,56,56,56,56,56,56,56,56,56,28,28,58,58,58,56,102,67,67,72,72,67,61,78,72,28,50,67,56,83,72,78,67,78,72,67,61,72,67,94,67,67,61,28,28,28,47,56,33,56,56,50,56,56,28,56,56,22,22,50,22,83,56,56,56,56,33,50,28,56,50,72,50,50,50,33,26,33,58];function jui({text:e,fontSize:t}){let n=0;for(let o of e){let r=Xui[o.charCodeAt(0)-32];if(r===void 0)return VSn({text:e,fontSize:t});n+=r}return n*(t/100)}var Kui=0.18;function $ui(e){let t=e.font_size??Kui,n=jui({text:e.text??"",fontSize:t}),o=t,r=e.anchor??"center",i,s;if(r.includes("left"))i=0,s=n;else if(r.includes("right"))i=-n,s=0;else i=-n/2,s=n/2;let a,c;if(r.includes("top"))a=-o,c=0;else if(r.includes("bottom"))a=0,c=o;else a=-o/2,c=o/2;let l=(e.rotation??0)*Math.PI/180,h=Math.cos(l),d=Math.sin(l),u=[{x:i,y:a},{x:i,y:c},{x:s,y:a},{x:s,y:c}].map((_)=>({x:e.position.x+_.x*h-_.y*d,y:e.position.y+_.x*d+_.y*h}));return Hs(u)}var qui=0.01,art=0.06;function Jui(e,t){if(!t)return!1;return e.text===t.display_name||e.text===t.name}function Zui(e,t={}){if(!e.text)return null;let n=$ui(e);if(Jui(e,t.sourceComponent)&&t.schematicComponent?.center&&t.schematicComponent?.size){let o=Pd({center:t.schematicComponent.center,width:t.schematicComponent.size.width,height:t.schematicComponent.size.height}),r=n.maxY-n.minY;if(n.minY>o.maxY)n.minX-=art,n.maxX+=art,n.minY=o.maxY-qui,n.maxY=o.maxY+r+art}return{chipId:e.schematic_component_id,center:m3(n),width:n.maxX-n.minX,height:n.maxY-n.minY,text:e.text}}var P5n=2.4,e0i=0.42;function t0i(e,t={}){let{db:n}=e.root,o=Wui(e),r=(Ae)=>o.get(Ae)??Ae,i=eS(n.toArray()),s=(Ae)=>{let xe=[...i.getIdsConnectedToNet(Ae)].sort()[0];return xe?`source_connectivity_${xe}`:`source_${Ae}`},a=(Ae)=>{let xe=[...Ae.connected_source_port_ids,...Ae.connected_source_net_ids].map((Me)=>i.getNetConnectedToId(Me)).find((Me)=>Boolean(Me));return xe?s(xe):Ae.subcircuit_connectivity_map_key??Ae.source_trace_id},c=new Set;for(let Ae of n.source_net.list()){if(!Ae.is_power&&!Ae.is_ground)continue;let xe=i.getNetConnectedToId(Ae.source_net_id);if(xe)c.add(s(xe))}let l=new Map,h=[],d=[...e.children].reverse();while(d.length>0){let Ae=d.pop();if(Ae instanceof UP){if(Ae.isSubcircuit){if(Ae._parsedProps.showAsSchematicBox)h.push(Ae);continue}h.push(Ae)}d.push(...[...Ae.children].reverse())}let u=[e.schematic_group_id,...h.map((Ae)=>Ae.schematic_group_id)],_=n.schematic_component.list().filter((Ae)=>u.includes(Ae.schematic_group_id)).filter((Ae)=>t.schematicSheetId===void 0||Ae.schematic_sheet_id===t.schematicSheetId),p=new Set(_.map((Ae)=>Ae.schematic_component_id)),m=new Map(_.map((Ae)=>[Ae.schematic_component_id,Ae])),A=n.schematic_text.list().filter((Ae)=>Ae.schematic_component_id&&p.has(Ae.schematic_component_id)).map((Ae)=>{let xe=m.get(Ae.schematic_component_id);if(!xe)return;let Me=n.source_component.get(xe.source_component_id);return Zui(Ae,{schematicComponent:xe,sourceComponent:Me})}).filter((Ae)=>Boolean(Ae)),g=new Map,f=e._getBoard()?.getDescendants()??[];for(let Ae of f){let xe=Ae.schematic_component_id,Me=Ae.getSchematicSectionName();if(xe&&Me)g.set(xe,Me)}let y=[];for(let Ae of _){let xe=Ae.schematic_component_id,Me=n.schematic_port.list({schematic_component_id:Ae.schematic_component_id}),Re=Me.filter((ye)=>{let Se=Ep(ye.schematic_port_id);return r(Se)===Se}).map((ye)=>{let Se=Ep(ye.schematic_port_id),Ne=ye.source_port_id?n.source_port.get(ye.source_port_id):void 0;return{pinId:Se,displayName:ye.display_pin_label??ye.pin_number?.toString()??Ne?.name,x:ye.center.x,y:ye.center.y,_facingDirection:Rve(ye.facing_direction??null)}}),we=g.get(Ae.schematic_component_id),_e=(Ae.is_box_with_pins===!1?void 0:p7e({db:n,schematicComponent:Ae}))??Pd({center:Ae.center,width:Ae.size.width,height:Ae.size.height});for(let ye of Me)_e.minX=Math.min(_e.minX,ye.center.x),_e.maxX=Math.max(_e.maxX,ye.center.x),_e.minY=Math.min(_e.minY,ye.center.y),_e.maxY=Math.max(_e.maxY,ye.center.y);y.push({chipId:xe,center:m3(_e),width:_e.maxX-_e.minX,height:_e.maxY-_e.minY,pins:Re,sectionId:we})}let x=new Set,C=new Map,b=new Map,I=new Map,v=new Map(e.selectAll("port").filter((Ae)=>Ae.schematic_port_id).map((Ae)=>[Ep(Ae.schematic_port_id),Ae])),P=Fct(e);for(let Ae of _){let xe=n.schematic_port.list({schematic_component_id:Ae.schematic_component_id});for(let Me of xe){let Re=Ep(Me.schematic_port_id);if(x.add(Re),Me.source_port_id){let we=qJ(Me.source_port_id);C.set(Re,we),b.set(we,Re)}}}let M=new Set(b.keys()),B=(t.netLabels??[]).filter((Ae)=>Ae._getConnectedPorts().some((xe)=>{if(!xe.schematic_port_id)return!1;return x.has(Ep(xe.schematic_port_id))})),T=new Set(B.filter((Ae)=>!Ae._parsedProps.inline).flatMap((Ae)=>Ae._getConnectedPorts()).map((Ae)=>Ae.schematic_port_id).filter((Ae)=>Ae!==null&&Ae!==void 0).map(Ep).map(r)),N=new Set(B.filter((Ae)=>Ae._parsedProps.inline||Ae._parsedProps.schX===void 0&&Ae._parsedProps.schY===void 0).flatMap((Ae)=>Ae._getConnectedPorts()).map((Ae)=>Ae.schematic_port_id).filter((Ae)=>Ae!==null&&Ae!==void 0).map(Ep).map(r)),D=new Set(B.filter((Ae)=>Ae._parsedProps.inline).flatMap((Ae)=>Ae._getConnectedPorts()).map((Ae)=>Ae.schematic_port_id).filter((Ae)=>Ae!==null&&Ae!==void 0).map(Ep).map(r)),L=new Set;if(e.subcircuit_id)L.add(e.subcircuit_id);for(let Ae of h)if(Ae.subcircuit_id)L.add(Ae.subcircuit_id);let H=n.source_trace.list().filter((Ae)=>{if(Ae.subcircuit_id===e.subcircuit_id)return!0;for(let xe of Ae.connected_source_port_ids)if(b.has(qJ(xe)))return!0;return!1}),V=new Set;for(let Ae of H){if(Ae.subcircuit_id===e.subcircuit_id)continue;if(Ae.connected_source_net_ids.length===0)continue;for(let xe of Ae.connected_source_port_ids){let Me=qJ(xe),Re=b.get(Me);if(!Re)continue;if(N.has(Re))continue;if(!n.schematic_port.list({source_port_id:xe}).some((_e)=>{if(_e.schematic_port_id===Re)return!1;return(_e.schematic_component_id?n.schematic_component.get(_e.schematic_component_id):void 0)?.schematic_sheet_id===t.schematicSheetId}))continue;V.add(Re)}}let O=H.flatMap((Ae)=>Ae.connected_source_net_ids);for(let Ae of O){let xe=n.source_net.get(Ae);if(xe?.subcircuit_id)L.add(xe.subcircuit_id)}for(let Ae of n.source_net.list().filter((xe)=>!xe.subcircuit_id||L.has(xe.subcircuit_id)))if(Ae.subcircuit_connectivity_map_key)l.set(Ae.subcircuit_connectivity_map_key,Ae);let U=[],j=[],Y=new Set,X=new Map,K=new Map,J=({schematicPortId:Ae,netId:xe,sourceTraceId:Me,replaceExisting:Re=!1})=>{let we=X.get(Ae)??new Map;if(we.has(xe)&&!Re)return!1;return we.set(xe,Me),X.set(Ae,we),!0},ee=({sourceConnectivityNetId:Ae,schematicPortId:xe,text:Me,sourceTraceId:Re,connKey:we,preferInScopeTraceMetadata:_e=!1})=>{let ye=Ae;if(J({schematicPortId:xe,netId:ye,sourceTraceId:Re,replaceExisting:_e}),T.has(xe))return;let Se=K.get(Ae);if(!Se)Se={netId:ye,netLabelText:Me,schematicPortIds:[],netLabelWidth:Number($B({text:Me}).toFixed(2)),connKey:we,isSameSheetCrossSectionConnection:!0,isPowerOrGroundConnection:c.has(ye)},K.set(Ae,Se),j.push(Se);else if(_e)Se.netLabelText=Me,Se.netLabelWidth=Number($B({text:Me}).toFixed(2)),Se.connKey=we??Se.connKey;if(!Se.schematicPortIds.includes(xe))Se.schematicPortIds.push(xe)},se=new Map,ne=new Map,re=new Set;for(let Ae of H)if(Ae?.subcircuit_connectivity_map_key&&(Ae.connected_source_port_ids?.length??0)>0&&(Ae.connected_source_net_ids?.length??0)>0)re.add(Ae.subcircuit_connectivity_map_key);let Z=(Ae,xe)=>{let Me=n.schematic_port.get(Ae),Re=n.schematic_port.get(xe);if(!Me||!Re)return!1;if(Me.schematic_sheet_id!==Re.schematic_sheet_id)return!1;let _e=Me.schematic_component_id?g.get(Me.schematic_component_id):void 0,ye=Re.schematic_component_id?g.get(Re.schematic_component_id):void 0;return _e!==ye&&(_e!==void 0||ye!==void 0)},te=({schematicPortId:Ae,otherSourcePortId:xe})=>n.schematic_port.list({source_port_id:xe}).some((Me)=>Z(Ae,Ep(Me.schematic_port_id)));for(let Ae of H){let xe=Array.from(new Set((Ae.connected_source_port_ids??[]).map((ye)=>b.get(qJ(ye))).filter((ye)=>Boolean(ye)&&x.has(ye)).map(r))),Me=xe.length===1?C.get(xe[0]):void 0,Re=Me?Ae.connected_source_port_ids.map(qJ).find((ye)=>ye!==Me):void 0,we=Boolean(Me&&Re&&oPn({db:n,sourcePortId:Me,otherSourcePortId:Re,sourcePortIdsInSchematicScope:M,schematicSheetId:t.schematicSheetId})),_e=Boolean(xe.length===1&&Re&&te({schematicPortId:xe[0],otherSourcePortId:Re}));if(xe.length===1&&Ae.connected_source_port_ids.length===2&&we&&Ae.connected_source_net_ids.length===0&&Ae.subcircuit_connectivity_map_key){let ye=xe[0],Se=C.get(ye);if(Se){let Ne=Ae.subcircuit_connectivity_map_key,ke=n.source_port.get(Se)?.subcircuit_connectivity_map_key,nt=n.source_net.list().find((lt)=>lt.subcircuit_id===e.subcircuit_id&&i.areIdsConnected(lt.source_net_id,Se)),dt=l.get(Ne)??(ke?l.get(ke):void 0)??nt,rt=Array.from(x).map((lt)=>C.get(lt)).filter((lt)=>{if(!lt)return!1;return n.source_port.get(lt)?.subcircuit_connectivity_map_key===Ne}),{text:mt}=iPn({group:e,sourcePortId:Se,connectedSourcePortIdsForKey:rt,sourcePortIdsInSchematicScope:M,schematicSheetId:t.schematicSheetId,connKey:Ne,sourceNet:dt});if(mt){let lt=a(Ae);if(!I.has(lt))I.set(lt,Ne);if(_e)ee({sourceConnectivityNetId:lt,schematicPortId:ye,text:mt,sourceTraceId:Ae.source_trace_id,connKey:Ne});else if(J({schematicPortId:ye,netId:lt,sourceTraceId:Ae.source_trace_id}))j.push({netId:lt,netLabelText:mt,schematicPortIds:[ye],netLabelWidth:Number($B({text:mt}).toFixed(2)),connKey:Ne})}}}else if(xe.length>=2){for(let lt of xe){let Ct=se.get(lt)??new Set;Ct.add(Ae.source_trace_id),se.set(lt,Ct)}let ye=Ae.name??Ae.display_name,Se=ye??Ae.source_trace_id;if(Ae.subcircuit_connectivity_map_key)I.set(Se,Ae.subcircuit_connectivity_map_key);let Ne=e._parsedProps.schMaxTraceDistance??P5n,ke=xe.map((lt)=>v.get(lt)).filter((lt)=>Boolean(lt)),nt=Ae.subcircuit_connectivity_map_key?P({subcircuitConnectivityMapKey:Ae.subcircuit_connectivity_map_key}).name:Hct(ke).name||ye,dt=xe.slice(1).some((lt,Ct)=>{let Nt=xe[Ct],Ht=n.schematic_port.get(Nt),Tt=n.schematic_port.get(lt);if(!Ht||!Tt)return!1;return Math.sqrt((Ht.center.x-Tt.center.x)**2+(Ht.center.y-Tt.center.y)**2)>Ne}),rt=nt&&dt?Number($B({text:nt}).toFixed(2)):void 0,mt=nt;for(let lt=0;lt<xe.length-1;lt++){let Ct=xe[lt],Nt=xe[lt+1],Ht=[Ct,Nt].sort().join("::");if(Y.has(Ht))continue;if(Y.add(Ht),mt&&Z(Ct,Nt)){let Tt=a(Ae);if(Ae.subcircuit_connectivity_map_key)I.set(Tt,Ae.subcircuit_connectivity_map_key);ee({sourceConnectivityNetId:Tt,schematicPortId:Ct,text:mt,sourceTraceId:Ae.source_trace_id,connKey:Ae.subcircuit_connectivity_map_key,preferInScopeTraceMetadata:!0}),ee({sourceConnectivityNetId:Tt,schematicPortId:Nt,text:mt,sourceTraceId:Ae.source_trace_id,connKey:Ae.subcircuit_connectivity_map_key,preferInScopeTraceMetadata:!0});continue}ne.set(Ht,Ae.source_trace_id),U.push({schematicPortIds:[Ct,Nt],netId:Se,netLabelWidth:rt,connKey:Ae.subcircuit_connectivity_map_key})}}}let ie=[...j],le=new Map;for(let[Ae,xe]of C){if(V.has(Ae))continue;let Me=n.source_port.get(xe);if(!Me?.subcircuit_connectivity_map_key)continue;let Re=Me.subcircuit_connectivity_map_key;if(!le.has(Re))le.set(Re,[]);let we=r(Ae),_e=le.get(Re);if(!_e.includes(we))_e.push(we)}for(let[Ae,xe]of le){let Me=l.get(Ae);if(Me&&xe.length>=1){let Re=String(Me.name||Me.source_net_id||Ae);I.set(Re,Ae);let we=Number($B({text:String(Re)}).toFixed(2)),_e=we,ye;if(Me.is_ground||Me.is_power)_e=e0i,ye=we;ie.push({netId:Re,schematicPortIds:xe,isGround:Me.is_ground,netLabelWidth:_e,netLabelHeight:ye,connKey:Ae})}}Gui({directConnections:U,netConnections:ie,connKeyToSchematicPortIds:le,connKeyToSourceNet:l,connKeysWithExplicitPortNetTraces:re,schematicPortIdsWithExplicitNetLabels:T,schematicPortIdsWithInlineNetLabels:D,areSchematicPortsOnDifferentComponents:(Ae)=>{let xe=Ae.map((Me)=>n.schematic_port.get(Me)?.schematic_component_id);return xe.every((Me)=>Boolean(Me))&&xe[0]!==xe[1]},resolveCanonicalNetLabelText:P});let ue=(()=>{let Ae={},xe=new Set(ie.map((Me)=>Me.netId));for(let Me of n.source_net.list().filter((Re)=>!Re.subcircuit_id||L.has(Re.subcircuit_id))){if(!Me.name)continue;if(!xe.has(Me.name))continue;if(Me.is_ground)Ae[Me.name]=["y-"];else if(Me.is_power)Ae[Me.name]=["y+"];else Ae[Me.name]=["x-","x+"]}for(let{netId:Me}of j)Ae[Me]??=["x-","x+"];return Ae})(),de={chips:y,directConnections:U.map(({schematicPortIds:Ae,connKey:xe,...Me})=>({...Me,pinIds:Ae})),netConnections:ie.map(({schematicPortIds:Ae,connKey:xe,isSameSheetCrossSectionConnection:Me,isPowerOrGroundConnection:Re,...we})=>({...we,pinIds:Ae})),textBoxes:A,availableNetLabelOrientations:ue,maxMspPairDistance:e._parsedProps.schMaxTraceDistance??P5n},me=new Map(Array.from(se).flatMap(([Ae,xe])=>{if(xe.size!==1)return[];return[[Ae,xe.values().next().value]]}));return{inputProblem:de,routedSchematicPortIdBySchematicPortId:o,connKeyToSourceNet:l,userNetIdToConnKey:I,crossScopeSourceTraceIdBySchematicPortIdAndNetId:X,sourceTraceIdByPortOnlyLabelSchematicPortId:me,connKeysWithExplicitPortNetTraces:re,schematicPortIdsInScope:x,schematicPortIdsWithExternallyRoutedRepresentations:V,schPortIdToSourcePortId:C,netLabelsInScope:B,sourceTraceIdByPinPairKey:ne}}var n0i=(e,t)=>{let n=new Set;for(let o of e){let{inline:r,schX:i,schY:s}=o._parsedProps;if(r)continue;if(i===void 0&&s===void 0)continue;let a=o._getConnectedPorts();for(let c of a){if(!c.schematic_port_id)continue;n.add(t.get(Ep(c.schematic_port_id))??Ep(c.schematic_port_id))}}return n},o0i=({solver:e})=>{let t=e.traceCleanupSolver?.getOutput().traces??e.traceLabelOverlapAvoidanceSolver?.getOutput().traces??e.schematicTraceLinesSolver?.solvedTracePaths??[],n=new Set;for(let o of t){let r=o?.tracePath;if(!Array.isArray(r)||r.length<2)continue;let i=Array.isArray(o.pins)?o.pins.map((s)=>s.pinId):o.pinIds;for(let s of i){let a=Ep(s);if(a)n.add(a)}}return n},E5n=0.5,K9e=0.1,M5n=(e)=>{let{nl:t,connKey:n,sourceNet:o,text:r}=e;if(o?.source_net_id&&t.source_net_id)return t.source_net_id===o.source_net_id;if(t.source_net_id)return t.source_net_id===n;return t.text===r},w5n=({schematicPortIdsInScope:e,schematicPortIdsWithExternallyRoutedRepresentations:t,group:n,schPortIdToSourcePortId:o,connKeyToSourceNet:r})=>{let{db:i}=n.root,s=new Set(Array.from(e).map((a)=>o.get(a)).filter((a)=>a!==void 0));for(let a of e){if(t.has(a))continue;let c=i.schematic_port.get(a);if(!c)continue;if(c.is_connected)continue;let l=o.get(a);if(!l)continue;let h=i.source_port.get(l);if(n._parsedProps.showAsSchematicBox&&h?.subcircuit_id===n.subcircuit_id&&!h.source_component_id&&rPn({db:i,sourcePortId:l,sourcePortIdsInSchematicScope:s,schematicSheetId:c.schematic_sheet_id}))continue;let d=h?.subcircuit_connectivity_map_key;if(!d)continue;let u=r.get(d),_=c.schematic_component_id?i.schematic_component.get(c.schematic_component_id):void 0,p=_?.schematic_sheet_id??n._resolveSchematicSheetId(),m=Array.from(e).map((L)=>o.get(L)).filter((L)=>{if(!L)return!1;return i.source_port.get(L)?.subcircuit_connectivity_map_key===d}),{text:A,wasAssignedDisplayLabel:g,directConnectionOutsideSchematicScopeSourcePortId:f}=iPn({group:n,sourcePortId:l,connectedSourcePortIdsForKey:m,sourcePortIdsInSchematicScope:s,schematicSheetId:c.schematic_sheet_id,connKey:d,sourceNet:u}),x=f?i.schematic_port.list({source_port_id:f}).some((L)=>!L.is_connected):!1,C=_?.is_box_with_pins&&h&&!h.source_component_id,b=i.source_trace.list().some((L)=>L.connected_source_port_ids.includes(l)&&L.subcircuit_id!==h?.subcircuit_id),I=Boolean(u||g);if(C&&!b&&!I)continue;let v=Array.from(e).filter((L)=>{let H=o.get(L);if(!H)return!1;return i.source_port.get(H)?.subcircuit_connectivity_map_key===d}).length,P=u?.is_ground??!1,M=!P&&(u?.is_power??!1),B;if(P)B="top";else if(M)B="bottom";else B=mZ(c.facing_direction||"right")||"right";let T=wP({anchor_position:c.center,anchor_side:B,text:A}),N=i.schematic_net_label.list().find((L)=>{if(L.schematic_sheet_id!==p)return!1;return M5n({nl:L,connKey:d,sourceNet:u,text:A})});if(N&&v<=1&&!x){i.schematic_net_label.update(N.schematic_net_label_id,{text:A,anchor_position:c.center,center:T,anchor_side:B});continue}if(N){let L=N.anchor_position.x-c.center.x,H=N.anchor_position.y-c.center.y;if(L*L+H*H<E5n*E5n){if(P){let U=N.anchor_side??B;i.schematic_net_label.update(N.schematic_net_label_id,{text:A,anchor_position:c.center,center:wP({anchor_position:c.center,anchor_side:U,text:A}),anchor_side:U})}else if(!M&&N.text===A){let U=N.anchor_side??B;i.schematic_net_label.update(N.schematic_net_label_id,{text:A,anchor_position:c.center,center:wP({anchor_position:c.center,anchor_side:U,text:A}),anchor_side:U})}continue}if(i.schematic_net_label.list().some((U)=>{if(U.schematic_sheet_id!==p)return!1;let j=U.anchor_position.x-c.center.x,Y=U.anchor_position.y-c.center.y;if(j*j+Y*Y>=K9e*K9e)return!1;return M5n({nl:U,connKey:d,sourceNet:u,text:A})}))continue}if(!u&&!x)for(let L of i.schematic_net_label.list()){if(L.source_net_id!==d)continue;if(L.schematic_sheet_id!==p)continue;if(!m.some((V)=>{let O=Array.from(o.entries()).find(([,X])=>X===V)?.[0],U;if(O)U=i.schematic_port.get(O);if(!U?.center||!L.anchor_position)return!1;let j=L.anchor_position.x-U.center.x,Y=L.anchor_position.y-U.center.y;return j*j+Y*Y<K9e*K9e}))i.schematic_net_label.delete(L.schematic_net_label_id)}let D={text:A,source_net_id:u?.source_net_id??d,anchor_position:c.center,center:T,anchor_side:B,schematic_sheet_id:p};i.schematic_net_label.insert(D)}},r0i=KSn.default("Group_doInitialSchematicTraceRender"),B5n=({group:e,schematicSheetId:t,netLabels:n})=>{let{inputProblem:o,routedSchematicPortIdBySchematicPortId:r,connKeyToSourceNet:i,schematicPortIdsInScope:s,schematicPortIdsWithExternallyRoutedRepresentations:a,schPortIdToSourcePortId:c,userNetIdToConnKey:l,crossScopeSourceTraceIdBySchematicPortIdAndNetId:h,sourceTraceIdByPortOnlyLabelSchematicPortId:d,connKeysWithExplicitPortNetTraces:u,netLabelsInScope:_,sourceTraceIdByPinPairKey:p}=t0i(e,{schematicSheetId:t,netLabels:n});if(o.chips.length===0)return;let m=n0i(_,r);if(!(o.directConnections.length>0||o.netConnections.length>0)){w5n({group:e,schematicPortIdsInScope:s,schematicPortIdsWithExternallyRoutedRepresentations:a,schPortIdToSourcePortId:c,connKeyToSourceNet:i});return}if(r0i.enabled)e.root?.emit("debug:logOutput",{type:"debug:logOutput",name:"group-trace-render-input-problem",content:JSON.stringify(o,null,2)});let g=new MSn(o),f=g.getConstructorParams();e.root?.emit("solver:started",{type:"solver:started",solverName:"SchematicTracePipelineSolver",solverParams:f[0],solverConstructorArgs:f,componentName:e.getString()}),g.solve();let y=o0i({solver:g});Yui({group:e,solver:g,userNetIdToConnKey:l,schematicPortIdsWithPreExistingNetLabels:m,schematicSheetId:t}),Dui({group:e,routedSchematicPortIdBySchematicPortId:r,solver:g,connKeyToSourceNet:i,userNetIdToConnKey:l,crossScopeSourceTraceIdBySchematicPortIdAndNetId:h,sourceTraceIdByPortOnlyLabelSchematicPortId:d,connKeysWithExplicitPortNetTraces:u,schematicPortIdsWithPreExistingNetLabels:m,schematicPortIdsWithRoutedTraces:y,netLabels:_}),Mui({group:e,solver:g,userNetIdToConnKey:l,sourceTraceIdByPinPairKey:p,crossScopeSourceTraceIdBySchematicPortIdAndNetId:h});let{db:x}=e.root;for(let[C,b]of r)if(x.schematic_port.get(b)?.is_connected)x.schematic_port.update(C,{is_connected:!0});w5n({group:e,schematicPortIdsInScope:s,schematicPortIdsWithExternallyRoutedRepresentations:a,schPortIdToSourcePortId:c,connKeyToSourceNet:i})};var i0i=(e)=>{if(!e.root?._featureMspSchematicTraceRouting)return;if(!e.isSubcircuit)return;if(e.root?.schematicDisabled)return;let t=new Set,n=e._getBoard(),o=e;while(o){if(o instanceof UP)for(let a of o.selectAll("netlabel"))t.add(a);if(o===n)break;o=o.parent}let r=[...t],i=new Set([e,...e.getDescendants().filter((a)=>a instanceof UP)].map((a)=>a.schematic_group_id).filter((a)=>Boolean(a))),s=new Set(e.root.db.schematic_component.list().filter((a)=>i.has(a.schematic_group_id)).map((a)=>a.schematic_sheet_id).filter((a)=>Boolean(a)));if(s.size===0){B5n({group:e,netLabels:r});return}for(let a of s)B5n({group:e,schematicSheetId:a,netLabels:r})};function s0i(e){let t=[];for(let n of e.printStatements){let o=n.match(/^\.PRINT\s+TRAN\s+(.+)$/i);if(!o)continue;for(let r of o[1].match(/V\(([^)]+)\)/g)??[]){let i=r.slice(2,-1);t.push(i.replace(",","-"))}}return t}var T5n=["rgb(0, 150, 0)","rgb(0, 0, 220)","rgb(220, 0, 0)","rgb(0, 160, 160)","rgb(180, 0, 180)","rgb(170, 140, 0)","rgb(220, 120, 0)","rgb(128, 128, 128)","rgb(100, 0, 180)","rgb(140, 70, 0)","rgb(220, 80, 120)","rgb(0, 120, 220)","rgb(0, 120, 120)","rgb(120, 0, 0)","rgb(0, 0, 132)","rgb(80, 80, 80)"],vve=new Map,Sve=0;function a0i(e){if(vve.has(e))return vve.get(e);let t=T5n[Sve];return Sve=(Sve+1)%T5n.length,vve.set(e,t),t}function c0i(){vve.clear(),Sve=0}var l0i=()=>({async simulate(e){let{circuit:n,tran:o}=Ahn(e);return{simulationResultCircuitJson:fhn(o,n,"spice-experiment-1")}}}),dst=(e)=>e.type==="simulation_transient_current_graph",aPn=(e)=>e.type==="simulation_dc_operating_point_current"||e.type==="simulation_dc_sweep_current_graph"||e.type==="simulation_ac_sweep_current_graph",cPn=(e)=>e.type==="simulation_dc_operating_point_voltage"||e.type==="simulation_dc_sweep_voltage_graph"||e.type==="simulation_ac_sweep_voltage_graph",ust=(e)=>e.type==="simulation_transient_voltage_graph",h0i=(e)=>ust(e)||dst(e)||cPn(e)||aPn(e),d0i=({simulationResult:e,simulationParameterSweepCoordinate:t})=>{if(!t||!h0i(e))return e;let n={...e},o=`${n.type}_id`;return Reflect.deleteProperty(n,o),n.simulation_parameter_sweep_coordinate=t,n},crt=({circuitJson:e,sourceComponentId:t,isMatchingSourceComponent:n})=>{let o=e.find((r)=>n(r)&&r.source_component_id===t);if(!o)throw Error(`Parameter sweep target ${t} was not found`);return o},u0i=({circuitJson:e,parameterSweep:t,simulationParameterSweepCoordinate:n})=>{let o=structuredClone(e),r=n.parameter_value;if(t.parameter_type==="resistance"){let i=crt({circuitJson:o,sourceComponentId:t.resistor_source_component_id,isMatchingSourceComponent:(s)=>s.type==="source_component"&&s.ftype==="simple_resistor"});return i.resistance=r,o}if(t.parameter_type==="capacitance"){let i=crt({circuitJson:o,sourceComponentId:t.capacitor_source_component_id,isMatchingSourceComponent:(s)=>s.type==="source_component"&&s.ftype==="simple_capacitor"});return i.capacitance=r,o}if(t.parameter_type==="inductance"){let i=crt({circuitJson:o,sourceComponentId:t.inductor_source_component_id,isMatchingSourceComponent:(s)=>s.type==="source_component"&&s.ftype==="simple_inductor"});return i.inductance=r,o}if(t.parameter_type==="voltage"){let i=o.find((a)=>a.type==="source_net"&&a.name.toUpperCase()==="GND");if(!i||i.type!=="source_net")throw Error("A voltage parameter sweep requires a GND net");let s={type:"simulation_voltage_source",simulation_voltage_source_id:`simulation_voltage_source_${n.simulation_parameter_sweep_id}_${n.sweep_index}`,is_dc_source:!0,positive_source_net_id:t.source_net_id,negative_source_net_id:i.source_net_id,voltage:r};return o.push(s),o}if(t.parameter_type==="current"){let i=new Set(o.filter((a)=>a.type==="source_port"&&a.source_component_id===t.current_source_component_id).map((a)=>a.source_port_id)),s=o.find((a)=>a.type==="simulation_current_source"&&(a.is_dc_source?Boolean(a.positive_source_port_id&&i.has(a.positive_source_port_id)):Boolean(a.terminal1_source_port_id&&i.has(a.terminal1_source_port_id))));if(!s)throw Error(`Current sweep target ${t.current_source_component_id} has no simulation source`);return s.current=r,o}throw Error("Parameter sweep target is incomplete")},D5n=({circuitJson:e,simulationParameterSweepCoordinate:t})=>{let n=Fhn(e);return{spiceNetlist:n,spiceString:n.toSpiceString(),simulationParameterSweepCoordinate:t}},p0i=({circuitJson:e,simulationExperimentId:t})=>{let n=e.find((o)=>o.type==="simulation_parameter_sweep"&&o.simulation_experiment_id===t);if(!n)return[D5n({circuitJson:e})];return n.parameter_values.map((o,r)=>{let i={simulation_parameter_sweep_id:n.simulation_parameter_sweep_id,sweep_index:r,parameter_value:o,parameter_unit:n.parameter_unit};return D5n({circuitJson:u0i({circuitJson:e,parameterSweep:n,simulationParameterSweepCoordinate:i}),simulationParameterSweepCoordinate:i})})},m0i={p:0.000000000001,n:0.000000001,u:0.000001,µ:0.000001,m:0.001,"":1,k:1000,K:1000,M:1e6,G:1e9},xL=(e)=>{if(e===void 0)return;if(typeof e==="number")return e;let n=e.trim().match(/^([+-]?(?:\d+(?:\.\d*)?|\.\d+))\s*([pnumµkKMG]?)/);if(!n)return;let o=Number(n[1]);if(!Number.isFinite(o))return;return o*(m0i[n[2]??""]??1)},_0i=(e)=>{let{graphDisplayName:t,graphCenter:n,graphVerticalOffset:o,graphVoltagePerDiv:r}=e._parsedProps;return{displayName:t,color:e.color??void 0,center:n,verticalOffset:xL(o),valuePerDiv:xL(r)}},g0i=(e)=>{let{color:t,graphDisplayName:n,graphCenter:o,graphVerticalOffset:r,graphCurrentPerDiv:i}=e._parsedProps;return{displayName:n,color:t,center:o,verticalOffset:xL(r),valuePerDiv:xL(i)}},A0i=(e)=>{let{POSITIVE_INFINITY:t,NEGATIVE_INFINITY:n}=Number;for(let o of e){if(!Number.isFinite(o))continue;t=Math.min(t,o),n=Math.max(n,o)}if(t===Number.POSITIVE_INFINITY||n===Number.NEGATIVE_INFINITY)return null;return{min:t,max:n}},f0i=(e)=>e.type==="simulation_transient_current_graph"?e.current_levels:e.voltage_levels,N5n=2,y0i=0.8,x0i=({graph:e,index:t,graphCount:n})=>{let o=A0i(f0i(e));if(!o)return null;let r=(o.min+o.max)/2,i=o.max-o.min,s=i>0?i/(N5n*y0i):Math.max(Math.abs(r)/10,Number.EPSILON);return{display_center_value:r,display_center_offset_divs:((n-1)/2-t)*N5n,value_per_div:s}},C0i=(e)=>e!==void 0,b0i=(e)=>{let t=new Map;for(let n of e)if(n.simulation_voltage_probe_id)t.set(n.simulation_voltage_probe_id,n);return t},I0i=(e)=>{let t=new Map;for(let n of e)if(n.simulation_current_probe_id)t.set(n.simulation_current_probe_id,n);return t},v0i=({db:e,graphs:t,graphDisplayOverridesByProbeId:n})=>{if(t.length===0)return;let o=e.simulation_oscilloscope_trace.list(),r=b0i(o),i=I0i(o),s=new Set(o.flatMap((a)=>[a.simulation_transient_voltage_graph_id,a.simulation_transient_current_graph_id]).filter(C0i));for(let[a,{type:c,graph:l}]of t.entries()){let h=x0i({graph:l,index:a,graphCount:t.length});if(!h)continue;let d=c==="voltage"?l.simulation_transient_voltage_graph_id:l.simulation_transient_current_graph_id;if(s.has(d))continue;let u=l.source_probe_id??void 0,_=u===void 0?void 0:c==="voltage"?r.get(u):i.get(u),p=u===void 0?void 0:n?.get(u),m=p?.valuePerDiv??h.value_per_div,A=p?.center??h.display_center_value,g=p?.verticalOffset!==void 0&&m!==0?p.verticalOffset/m:_?.display_center_offset_divs??h.display_center_offset_divs;e.simulation_oscilloscope_trace.insert({...c==="voltage"?{simulation_transient_voltage_graph_id:l.simulation_transient_voltage_graph_id,volts_per_div:m}:{simulation_transient_current_graph_id:l.simulation_transient_current_graph_id,amps_per_div:m},display_name:p?.displayName??_?.display_name,color:p?.color??_?.color??l.color,display_center_value:A,display_center_offset_divs:g})}},S0i=(e)=>Boolean(e&&typeof e==="object"&&"type"in e),fv=sPn.default("tscircuit:core:Group_doInitialSimulationSpiceEngineRender"),P0i=({circuitJson:e,simulationExperimentId:t,voltageProbes:n,ammeters:o})=>{let r=new Set(n.map((s)=>s.simulation_voltage_probe_id).filter((s)=>Boolean(s))),i=new Set(o.map((s)=>s.simulation_current_probe_id).filter((s)=>Boolean(s)));return e.filter((s)=>{if(s.type==="simulation_experiment")return s.simulation_experiment_id===t;if(s.type==="simulation_voltage_probe")return r.has(s.simulation_voltage_probe_id);if(s.type==="simulation_current_probe")return i.has(s.simulation_current_probe_id);if(s.type==="simulation_parameter_sweep")return s.simulation_experiment_id===t;if(s.type==="simulation_oscilloscope_trace"){if(s.simulation_voltage_probe_id)return r.has(s.simulation_voltage_probe_id);if(s.simulation_current_probe_id)return i.has(s.simulation_current_probe_id)}if(s.type==="simulation_transient_voltage_graph"||s.type==="simulation_transient_current_graph"||s.type==="simulation_dc_operating_point_voltage"||s.type==="simulation_dc_operating_point_current"||s.type==="simulation_dc_sweep_voltage_graph"||s.type==="simulation_dc_sweep_current_graph"||s.type==="simulation_ac_sweep_voltage_graph"||s.type==="simulation_ac_sweep_current_graph"||s.type==="simulation_unknown_experiment_error")return!1;return!0})};function E0i(e){if(e.getInheritedProperty("analogSimulationDisabled"))return;if(!e.isSubcircuit)return;let{root:t}=e;if(!t)return;let n=[...e.selectAll("analogsimulation"),...e.selectAll("analogtransientsimulation"),...e.selectAll("analogdcoperatingpointsimulation"),...e.selectAll("analogdcsweepsimulation"),...e.selectAll("analogacsweepsimulation")];if(n.length===0)return;c0i();let o={...t.platform?.spiceEngineMap};if(!o.spicey)o.spicey=l0i();for(let r of n){let i=r.simulation_experiment_id;if(!i){fv("No simulation experiment id found, skipping simulation");continue}let s=t.db.simulation_experiment.get(i);if(!s){fv("No simulation experiment found, skipping simulation");continue}let a=r.getGroup()??e,c=a.selectAll("voltageprobe"),l=a.selectAll("ammeter"),h=P0i({circuitJson:t.db.toArray(),simulationExperimentId:i,voltageProbes:c,ammeters:l}),d;try{d=p0i({circuitJson:h,simulationExperimentId:i}),fv(`Generated ${d.length} SPICE run(s):
${d.map((v)=>v.spiceString).join(`
`)}`)}catch(v){fv(`Failed to convert circuit JSON to SPICE: ${v}`),t.db.simulation_unknown_experiment_error.insert({simulation_experiment_id:i,error_type:"simulation_unknown_experiment_error",message:v instanceof Error?v.message:String(v)});continue}let u=new Map,_=new Map,p=new Map;for(let v of c){if(v.finalProbeName)u.set(v.finalProbeName,v);if(v.simulation_voltage_probe_id)_.set(v.simulation_voltage_probe_id,v),p.set(v.simulation_voltage_probe_id,_0i(v))}for(let v of l)if(v.simulation_current_probe_id)p.set(v.simulation_current_probe_id,g0i(v));let m=new Set(l.map((v)=>v.simulation_current_probe_id).filter((v)=>Boolean(v))),A=new Map,g=new Map;for(let v of t.db.simulation_current_probe.list().filter((P)=>m.has(P.simulation_current_probe_id)))if(A.set(v.simulation_current_probe_id,v),v.name!==void 0)g.set(v.name,v);let f=t.db.simulation_voltage_probe.list().filter((v)=>_.has(v.simulation_voltage_probe_id)),y=d[0]?.spiceNetlist,x=y?s0i(y):[];if(x.length===f.length)for(let[v,P]of f.entries()){let M=_.get(P.simulation_voltage_probe_id),B=x[v];if(M&&B)u.set(B,M)}else fv(`Skipping probe-to-graph order mapping because counts differ: probes=${f.length} graphNames=${x.length}`);let C=r.getSpiceEngineName()??"spicey",b=o[C];if(!b)throw Error(`SPICE engine "${C}" not found in platform config. Available engines: ${JSON.stringify(Object.keys(o).filter((v)=>v!=="spicey"))}`);let I=`spice-simulation-${C}-${i}`;fv(`Queueing simulation for spice engine: ${C} (id: ${I})`),e._queueAsyncEffect(I,async()=>{try{let v=[],P=[];for(let M of d){fv(`Running simulation with engine: ${C}`);let B=await b.simulate(M.spiceString);fv(`Simulation completed, received ${B.simulationResultCircuitJson.length} elements`);for(let T of B.simulationResultCircuitJson){if(!S0i(T)){fv("Skipping invalid simulation result element");continue}let N=d0i({simulationResult:T,simulationParameterSweepCoordinate:M.simulationParameterSweepCoordinate});if(ust(N)){N.simulation_experiment_id=s.simulation_experiment_id;let L=N.name?u.get(N.name):void 0;if(L)N.color=L.color??void 0,N.source_probe_id=L.simulation_voltage_probe_id??void 0}else if(cPn(N)){N.simulation_experiment_id=s.simulation_experiment_id;let L=_.get(N.simulation_voltage_probe_id)??(N.name?u.get(N.name):void 0);if(L?.simulation_voltage_probe_id)N.color=L.color??void 0,N.simulation_voltage_probe_id=L.simulation_voltage_probe_id}if(dst(N)){N.simulation_experiment_id=s.simulation_experiment_id;let L=(N.source_probe_id?A.get(N.source_probe_id):void 0)??(N.name?g.get(N.name):void 0);if(L)N.color=L.color,N.source_probe_id=L.simulation_current_probe_id}else if(aPn(N)){N.simulation_experiment_id=s.simulation_experiment_id;let L=A.get(N.simulation_current_probe_id)??(N.name?g.get(N.name):void 0);if(L)N.color=L.color,N.simulation_current_probe_id=L.simulation_current_probe_id}let D=t.db.insert(N);if(ust(D))v.push({type:"voltage",graph:D});if(dst(D))P.push({type:"current",graph:D});fv(`Inserted ${N.type} into database`)}}if(r.usesIndependentGraphAxes())v0i({db:t.db,graphs:[...v,...P],graphDisplayOverridesByProbeId:p});e._markDirty("SimulationSpiceEngineRender")}catch(v){fv(`Simulation failed for engine ${C}: ${v}`),t.db.simulation_unknown_experiment_error.insert({simulation_experiment_id:i,error_type:"simulation_unknown_experiment_error",message:v instanceof Error?v.message:String(v)})}})}}function M0i(e){if(!e.isSubcircuit)return;let{db:t}=e.root,n=e.selectAll("trace"),o=e.selectAll("via"),r=e.selectAll("net"),i=new l5({});i.addConnections(n.map((h)=>{let d=t.source_trace.get(h.source_trace_id);if(!d)return null;return[d.source_trace_id,...d.connected_source_port_ids,...d.connected_source_net_ids]}).filter((h)=>h!==null));let s=t.source_net.list().filter((h)=>h.subcircuit_id===e.subcircuit_id);for(let h of s)i.addConnections([[h.source_net_id]]);let{name:a}=e._parsedProps;for(let h of n){if(!h.source_trace_id)continue;let d=i.getNetConnectedToId(h.source_trace_id);if(!d)continue;h.subcircuit_connectivity_map_key=`${a??`unnamedsubcircuit${e.subcircuit_id??e.source_group_id??e._renderId}`}_${d}`,t.source_trace.update(h.source_trace_id,{subcircuit_connectivity_map_key:h.subcircuit_connectivity_map_key})}let c=new Set;for(let h of n){if(!h.source_trace_id)continue;let d=t.source_trace.get(h.source_trace_id);if(!d)continue;for(let u of d.connected_source_port_ids)c.add(u)}for(let h of c){let d=i.getNetConnectedToId(h);if(!d)continue;let u=`${a??`unnamedsubcircuit${e.subcircuit_id??e.source_group_id??e._renderId}`}_${d}`;t.source_port.update(h,{subcircuit_connectivity_map_key:u})}let l=new Set;for(let h of n){if(!h.source_trace_id)continue;let d=t.source_trace.get(h.source_trace_id);if(!d)continue;for(let u of d.connected_source_net_ids)l.add(u)}for(let h of s)l.add(h.source_net_id);for(let h of l){let d=i.getNetConnectedToId(h);if(!d)continue;let u=`${a??`unnamedsubcircuit${e.subcircuit_id??e.source_group_id??e._renderId}`}_${d}`;t.source_net.update(h,{subcircuit_connectivity_map_key:u});let _=r.find((p)=>p.source_net_id===h);if(_)_.subcircuit_connectivity_map_key=u}for(let h of o){let d=h._getConnectedNetOrTrace();if(!d)continue;if(d.subcircuit_connectivity_map_key)h.subcircuit_connectivity_map_key=d.subcircuit_connectivity_map_key}}var w0i=(e)=>{let t=e.root?.firstChild===e;if(!e.isSubcircuit||!t||e._getBoard())return;let n=e.root?.pcbRoutingDisabled||e.getInheritedProperty("routingDisabled"),o=e.root?.platform?.drcChecksDisabled??e.getInheritedProperty("drcChecksDisabled"),r=e.root?.platform?.routingDrcChecksDisabled??e.getInheritedProperty("routingDrcChecksDisabled");if(e.root?.pcbDisabled||n||o||r)return;if(e._hasIncompleteAsyncEffectsInSubtreeForPhase("PcbTraceRender"))return;if(e._hasTracesToRoute()&&!e._areChildSubcircuitsRouted())return;if(e._standaloneSubcircuitDrcChecksComplete||e._standaloneSubcircuitDrcChecksInProgress)return;let{db:i}=e.root,s=i.subtree({subcircuit_id:e.subcircuit_id}).toArray();e._standaloneSubcircuitDrcChecksInProgress=!0,e._queueAsyncEffect("standalone-subcircuit:routing-drc-checks",async()=>{try{let a=await Z2e(s);i.insertAll($2e(a)),e._standaloneSubcircuitDrcChecksComplete=!0}finally{e._standaloneSubcircuitDrcChecksInProgress=!1}})},R5n=(e,t)=>{for(let[n,o]of Object.entries(t)){if(!o)continue;let r=Array.isArray(o)?o:[o],i=e.get(n)??new Set;for(let s of r)i.add(s);e.set(n,i)}},Q5n=(e)=>Object.fromEntries(Array.from(e,([t,n])=>[t,n.size===1?Array.from(n)[0]:Array.from(n)])),B0i=(e,t)=>{let n=t.map((i)=>i.fanoutPourNetMap).filter((i)=>i!==void 0),o=new Map;if(n.length>0){for(let i of n)R5n(o,i);return Q5n(o)}let r=e;while(r){if(r.isSubcircuit){let i=r,s=i.selectAll("copperpour");for(let a of s){if(a.getSubcircuit()!==i)continue;let{layer:c,connectsTo:l}=a._parsedProps;R5n(o,{[c]:l})}}r=r.parent}return o.size>0?Q5n(o):void 0},T0i=Fs.omit({pcbRotation:!0,layer:!0}),lPn=class extends lr{pcb_breakout_point_id=null;matchedPort=null;matchedNet=null;matchedSourceTraceId=null;isPcbPrimitive=!0;_getSourceTraceIdForPort(e){let{db:t}=this.root;return t.source_trace.list().find((o)=>o.connected_source_port_ids.includes(e.source_port_id))?.source_trace_id}_getSourceNetIdForPort(e){let{db:t}=this.root;return t.source_trace.list().find((o)=>o.connected_source_port_ids.includes(e.source_port_id))?.connected_source_net_ids[0]}_renderPcbBreakoutPoint({layer:e}={}){if(this.pcb_breakout_point_id)return;if(this.root?.pcbDisabled)return;let{db:t}=this.root,n=this._getGlobalPcbPositionBeforeLayout(),o=this.parent?.getGroup(),r=this.getSubcircuit();if(!o||!o.pcb_group_id)return;let i=t.pcb_breakout_point.insert({pcb_group_id:o.pcb_group_id,subcircuit_id:r?.subcircuit_id??void 0,source_port_id:this.matchedPort?.source_port_id??void 0,source_trace_id:this.matchedPort?this.matchedSourceTraceId??this._getSourceTraceIdForPort(this.matchedPort):void 0,source_net_id:this.matchedNet?this.matchedNet.source_net_id:this.matchedPort?this._getSourceNetIdForPort(this.matchedPort):void 0,layer:e,x:n.x,y:n.y});this.pcb_breakout_point_id=i.pcb_breakout_point_id}_getPcbCircuitJsonBounds(){let e=this._getGlobalPcbPositionBeforeLayout();return{center:{x:e.x,y:e.y},bounds:{left:e.x,top:e.y,right:e.x,bottom:e.y},width:0,height:0}}_setPositionFromLayout(e){let{db:t}=this.root;if(!this.pcb_breakout_point_id)return;let n={x:e.x,y:e.y};if(this.matchedSourceTraceId)n.source_trace_id=this.matchedSourceTraceId;t.pcb_breakout_point.update(this.pcb_breakout_point_id,n)}_moveCircuitJsonElements({deltaX:e,deltaY:t}){if(this.root?.pcbDisabled)return;let{db:n}=this.root;if(!this.pcb_breakout_point_id)return;let o=n.pcb_breakout_point.get(this.pcb_breakout_point_id);if(o)n.pcb_breakout_point.update(this.pcb_breakout_point_id,{x:o.x+e,y:o.y+t})}getPcbSize(){return{width:0,height:0}}},bG=class extends lPn{get config(){return{componentName:"BreakoutPoint",zodProps:TPt}}_matchConnection(){if(this.matchedPort)return;let{connection:e}=this._parsedProps,t=this.getSubcircuit();if(!t)return;if(this.matchedPort=t.selectOne(e,{type:"port"}),!this.matchedPort)this.matchedNet=t.selectOne(e,{type:"net"});if(!this.matchedPort&&!this.matchedNet)this.renderError(`Could not find connection target "${e}"`)}doInitialPcbPrimitiveRender(){this._matchConnection(),this._renderPcbBreakoutPoint()}},hPn=class extends bG{exitLayer="top";doInitialPcbPrimitiveRender(){this._matchConnection(),this._renderPcbBreakoutPoint({layer:this.exitLayer})}};function D0i(e,t){let{db:n}=e.root,o=vG(t.layerCount),r=new Set,i=e.children.filter((c)=>c instanceof hPn),s=(e._parsedProps.pcbTracePaths??[]).map((c,l)=>{for(let M of c.route)if((M.route_type==="wire"?[M.layer]:[M.from_layer,M.to_layer]).some((T)=>!o.includes(T)))throw Error(`Saved fanout path "${c.connection}" uses a layer unavailable on this board`);let h=i[l],d=h.matchedPort,u=t.connections.find((M)=>M.pointsToConnect.some((B)=>B.pcb_port_id===d.pcb_port_id));if(!u)throw Error(`No fanout connection for saved path "${c.connection}"`);let _=n.pcb_breakout_point.get(h.pcb_breakout_point_id),p=c.route.at(-1),m=Hi(h._computePcbGlobalTransformBeforeLayout(),Ii(-p.x,-p.y)),A=_o(m,p),g=W4n(c.route).map((M)=>{let B=_o(m,M);return{...M,x:B.x+_.x-A.x,y:B.y+_.y-A.y}}),f=g[0],y=f.route_type==="wire"?f.layer:f.from_layer,x=d._getGlobalPcbPositionAfterLayout();if(Math.hypot(f.x-x.x,f.y-x.y)>0.0001||!d.getAvailablePcbLayers().includes(y))throw Error(`Saved fanout path "${c.connection}" must start at its PCB port on an available layer`);if(f.route_type==="via"&&!t.allowViaInPad)throw Error(`Saved fanout path "${c.connection}" starts with a via at a pad; enable allowViaInPad`);let C=g.at(-1),b=C.route_type==="wire"?C.layer:C.to_layer,I=[{...f,layer:y},{...C,layer:b}];if(u.pointsToConnect.some((M)=>!I.some((B)=>Math.hypot(M.x-B.x,M.y-B.y)<0.0001&&M.layer===B.layer)))throw Error(`Saved fanout path "${c.connection}" does not cover its connection endpoints`);let v=nue(g,0,t.minTraceWidth),P=nue(g,g.length-1,t.minTraceWidth);if(f.route_type==="via")g.splice(1,0,{route_type:"wire",x:f.x,y:f.y,layer:f.to_layer,width:v.toWidth}),g.unshift({route_type:"wire",x:f.x,y:f.y,layer:f.from_layer,width:v.fromWidth});if(C.route_type==="via")g.splice(g.length-1,0,{route_type:"wire",x:C.x,y:C.y,layer:C.from_layer,width:P.fromWidth}),g.push({route_type:"wire",x:C.x,y:C.y,layer:C.to_layer,width:P.toWidth});if(C.route_type==="via")g.push({route_type:"wire",x:C.x,y:C.y,layer:C.to_layer,width:P.toWidth});return r.add(u),{type:"pcb_trace",pcb_trace_id:`saved_fanout_${e.pcb_group_id}_${l}`,connection_name:u.name,source_trace_id:u.source_trace_id,connectsTo:[u.source_trace_id,...u.pointsToConnect.map((M)=>M.pointId)].filter((M)=>Boolean(M)),route:g}}),a=t.connections.filter((c)=>!r.has(c));if(a.length)throw Error(`pcbTracePaths must cover every fanout connection; missing: ${a.map((c)=>c.name).join(", ")}`);return s}function k5n(e){return e===null?Number.POSITIVE_INFINITY:e}function N0i(e,t){return k5n(e.routingPhaseIndex)-k5n(t.routingPhaseIndex)}function $9e(e,t){let n=e.get(t);if(!n)n={routingPhaseIndex:t,nets:[],traces:[]},e.set(t,n);return n}function dPn(e){return e.props.routingPhaseIndex??null}function R0i(e,t=[]){let n=new Set;for(let a of t){if(a._parsedProps.routingPhaseIndex===void 0)continue;if(a._parsedProps.connections.some((l)=>l===e.name||Oct(e,v8e(l))))n.add(a._parsedProps.routingPhaseIndex)}if(n.size>1)throw Error(`Trace "${e.name}" belongs to buses with different routing phases`);let o=n.values().next().value;if(o!==void 0)return o;let r=e.props.routingPhaseIndex;if(r!==void 0)return r;let i=null,s=e._findConnectedNets().nets;for(let a of s){let c=dPn(a);if(typeof c==="number"){if(i===null||c<i)i=c}}return i}function v8e(e){return e.trim().replace(/\s*>\s*/g,".").replace(/\s+/g,".").replace(/^\./,"").replace(/\.\./g,".")}function Dde(e){if(e.connection===void 0&&e.connections===void 0)return e.pcbTracePaths?.map((t)=>t.connection)??[];return[...e.connection?[e.connection]:[],...e.connections??[]]}function Oct(e,t){let n=v8e(t);if(e.getTracePortPathSelectors().some((r)=>v8e(r)===n))return!0;let o=e.getSubcircuit().selectOne(t,{type:"port"});return o!==null&&(e._findConnectedPorts().ports?.includes(o)??!1)}function Q0i(e,t,n){let o=new Set,r=n.name??"unnamed phase";for(let i of Dde(n)){let s=i.trim(),a=s.startsWith("trace."),c=a?e.selectAll(s).filter((d)=>t.includes(d)):t.filter((d)=>d.name===s),l=a?[]:t.filter((d)=>Oct(d,s));if(c.length>1||c.length>0&&l.length>0)throw Error(`Autorouting phase "${r}": connection "${i}" is ambiguous. Use a unique trace name qualified as "trace.DDR_D0" or a port such as ".U1 > .A1".`);let h=c.length>0?c:l;if(h.length===0)throw Error(`Autorouting phase "${r}": connection "${i}" matched no trace or endpoint. Use a trace name such as "DDR_D0" or a port such as ".U1 > .A1".`);for(let d of h)o.add(d)}return o}function k0i(e){let t=e.selectAll("autoroutingphase"),n=new Map;for(let o of t){let{phaseIndex:r,autorouter:i}=o._parsedProps;if(i===void 0)continue;n.set(r??null,i)}return n}function L0i(e){let t=e.selectAll("autoroutingphase"),n=new Map;for(let o of t){let r=o._parsedProps;n.set(r.phaseIndex??null,r)}return n}function dP(e){if(e===void 0)return;return Number(e)}function H0i(e){let{minTraceWidth:t,minViaHoleEdgeToViaHoleEdgeClearance:n,minPlatedHoleDrillEdgeToDrillEdgeClearance:o,minTraceToPadEdgeClearance:r,minTraceToHoleEdgeClearance:i,minPadEdgeToPadEdgeClearance:s,minBoardEdgeClearance:a,minViaEdgeToPadEdgeClearance:c,minViaHoleDiameter:l,minViaPadDiameter:h}=e;if(t===void 0&&n===void 0&&o===void 0&&r===void 0&&i===void 0&&s===void 0&&a===void 0&&c===void 0&&l===void 0&&h===void 0)return;return{minTraceWidth:dP(t),minViaHoleEdgeToViaHoleEdgeClearance:dP(n),minPlatedHoleDrillEdgeToDrillEdgeClearance:dP(o),minTraceToPadEdgeClearance:dP(r),minTraceToHoleEdgeClearance:dP(i),minPadEdgeToPadEdgeClearance:dP(s),minBoardEdgeClearance:dP(a),minViaEdgeToPadEdgeClearance:dP(c),minViaHoleDiameter:dP(l),minViaPadDiameter:dP(h)}}function F0i(e){let t=e.selectAll("trace"),n=e.selectAll("net"),o=e.selectAll("bus"),r=e.selectAll("group").filter((x)=>x.isRoutingDirective),i=new Map,s=new Map;for(let x of t){let C=x.parent;while(C&&C!==e){if(C.isRoutingDirective){i.set(x,C);break}C=C.parent}}for(let x of n)if(x.parent?.isRoutingDirective&&r.includes(x.parent))s.set(x,x.parent);let a=new Map,c=k0i(e),l=L0i(e),h=new Map(Array.from(l,([x,C])=>[x,Q0i(e,t,C)])),d=e._parsedProps,u=e.getInheritedProperty("routeRemaining")!==!1,_=l.get(null),p=u||_!==void 0&&!_.reroute&&Dde(_).length===0,m=t.length>0||n.length>0,A=Array.from(l.values()).some((x)=>x.reroute),g=Array.from(l.values()).some((x)=>Dde(x).length>0);if(!m&&!A&&!g&&r.length===0)return[];for(let x of n){if(s.has(x))continue;let C=dPn(x);if(C===null&&!p)continue;$9e(a,C).nets.push(x)}for(let x of t){if(i.has(x))continue;let C=R0i(x,o);if(C===null&&!p)continue;$9e(a,C).traces.push(x)}for(let[x,C]of l){let b=Dde(C);if(b.length>0){let I=$9e(a,x);I.connectionSelectors=b;for(let v of t){if(i.has(v))continue;if(h.get(x).has(v)){if(!C.reroute)for(let P of a.values()){if(P===I)continue;P.traces=P.traces.filter((M)=>M!==v)}if(I.traces.includes(v))continue;I.traces.push(v)}}}if(C.reroute||C.pcbTracePaths!==void 0)$9e(a,x)}let f=Array.from(a.values()).sort(N0i);for(let x of f){x.autorouter=c.get(x.routingPhaseIndex);let C=l.get(x.routingPhaseIndex);x.algorithmFn=C?.algorithmFn,x.isImplicitRemainingPhase=x.routingPhaseIndex===null&&C===void 0,x.phaseName=C?.name,x.reroute=C?.reroute,x.region=C?.region,x.connectionSelectors=C?Dde(C):void 0,x.busFanoutDirections=C?.busFanoutDirections??d.busFanoutDirections,x.fanoutBoundaryPadding=C?.fanoutBoundaryPadding??d.fanoutBoundaryPadding;let b=C?.fanoutRoutingLayers??d.fanoutRoutingLayers;x.fanoutRoutingLayers=b?.map((I)=>typeof I==="string"?I:I.name),x.fanoutPourNetMap=C?.fanoutPourNetMap??d.fanoutPourNetMap,x.drcTolerances=C?H0i(C):void 0}for(let x of e.selectAll("autoroutingphase")){let C=a.get(x._parsedProps.phaseIndex??null);if(!C)continue;if(C.autoroutingPhase=x,x._parsedProps.pcbTracePaths===void 0)continue;let b=C.autorouter!==void 0?Yde(C.autorouter,e.root?.platform):e._getAutorouterConfig(),I=["fanout","single_layer_fanout"].includes(b.preset??"");C.getPrecomputedRoutingResult=(v)=>mVr(x,v,I)}let y=[];for(let x of r){let C=x._parsedProps,I=x.children.some((U)=>U instanceof bG)&&x.props.autorouter===void 0,v=t.filter((U)=>i.get(U)===x),P=v.filter((U)=>!U.pcb_trace_id),M=x.pcb_group_id?x.root?.db.pcb_group.get(x.pcb_group_id):null,B=M?.outline?Hs(M.outline):null,T=M?.width??(B?B.maxX-B.minX:void 0),N=M?.height??(B?B.maxY-B.minY:void 0),D=M&&T&&N?{minX:M.center.x-T/2,maxX:M.center.x+T/2,minY:M.center.y-N/2,maxY:M.center.y+N/2}:void 0,L=x.props,H=L.width!==void 0||L.height!==void 0||Boolean(L.outline?.length),V=L.fanoutBoundaryPadding!==void 0,O={routingPhaseIndex:null,routingPcbGroupId:x.pcb_group_id??void 0,fanoutRegionPcbGroupId:x.pcb_group_id??void 0,routingBounds:D,fanoutBounds:H?D:V?void 0:D,autorouter:C.autorouter??"fanout",busFanoutDirections:C.busFanoutDirections,fanoutBoundaryPadding:C.fanoutBoundaryPadding,fanoutRoutingLayers:C.fanoutRoutingLayers?.map((U)=>typeof U==="string"?U:U.name),fanoutPourNetMap:C.fanoutPourNetMap,nets:n.filter((U)=>s.get(U)===x),traces:v};if(x.isDogboneFanout&&C.pcbTracePaths===void 0){y.push({...O,routingBounds:void 0,fanoutBounds:D});continue}if(x._parsedProps.pcbTracePaths!==void 0){y.push({...O,autorouter:{local:!0,groupMode:"subcircuit",allowViaInPad:(typeof C.autorouter==="object"?C.autorouter.allowViaInPad:void 0)??e._getAutorouterConfig().allowViaInPad},getPrecomputedRoutingResult:(U)=>({traces:D0i(x,U)})});continue}if(!I){y.push(O);continue}if(y.push({...O,autorouter:"default",traces:[]}),P.length>0){let U=new Set(o.filter((Y)=>P.some((X)=>Y._parsedProps.connections.some((K)=>K===X.name||Oct(X,v8e(K))))).map((Y)=>Y.name));for(let Y of P)if(Y.name)U.add(Y.name);let j=C.busFanoutDirections?Object.fromEntries(Object.entries(C.busFanoutDirections).filter(([Y])=>U.has(Y))):void 0;y.push({...O,routingPcbGroupId:void 0,busFanoutDirections:j,traces:P})}}if(u&&m&&l.size===1&&_?.reroute&&f.length===1&&f[0]?.routingPhaseIndex===null){let x=f[0];return[...y,{routingPhaseIndex:null,isImplicitRemainingPhase:!0,nets:[...x.nets],traces:[...x.traces]},x]}return[...y,...f]}var uPn=class extends Error{},pPn={name:"@tscircuit/core",type:"module",version:"0.0.2179",types:"dist/index.d.ts",main:"dist/index.js",module:"dist/index.js",exports:{".":{import:"./dist/index.js",types:"./dist/index.d.ts"}},files:["dist"],repository:{type:"git",url:"https://github.com/tscircuit/core"},scripts:{build:"tsup-node",format:"biome format . --write","measure-bundle":"howfat -r table .","pkg-pr-new-release":"bunx pkg-pr-new publish --comment=off --peerDeps","smoke-test:dist":"bun run scripts/smoke-tests/test-dist-simple-circuit.tsx && bun run scripts/smoke-tests/check-dist-bundled-schematic-solver.ts","build:benchmarking":"bun build --experimental-html ./benchmarking/website/index.html --outdir ./benchmarking-dist","build:benchmarking:watch":`chokidar "./{benchmarking,lib}/**/*.{ts,tsx}" -c 'bun build --experimental-html ./benchmarking/website/index.html --outdir ./benchmarking-dist'`,"start:benchmarking":'concurrently "bun run build:benchmarking:watch" "live-server ./benchmarking-dist"',"generate-test-plan":"bun run scripts/generate-test-plan.ts"},devDependencies:{"@biomejs/biome":"^1.8.3","@jscad/modeling":"^2.13.0","@resvg/resvg-js":"^2.6.2","@tsci/tscircuit.ti":"github:tscircuit/ti#57e314be4b2b06bc546d4def7453e619604d1157","@tscircuit/alphabet":"0.0.25","@tscircuit/bga-fanout-solver":"github:tscircuit/bga-fanout-solver#247c835cb8d69b65e53891dcf869731079415b39","@tscircuit/bus-lanes-solver":"https://jscdn.tscircuit.com/@tscircuit/bus-lanes-solver/0.0.21.tgz","@tscircuit/cableprinter":"^0.0.6","@tscircuit/capacity-autorouter":"^0.0.988","@tscircuit/checks":"^0.0.258","@tscircuit/circuit-json-util":"^0.0.123","@tscircuit/common":"^0.0.20","@tscircuit/copper-pour-solver":"^0.0.67","@tscircuit/create-fdm-enclosure":"0.0.4","@tscircuit/dogbone-solver":"https://jscdn.tscircuit.com/@tscircuit/dogbone-solver/0.0.1.tgz","@tscircuit/fanout-solver":"0.0.81","@tscircuit/flex-utils":"https://jscdn.tscircuit.com/@tscircuit/flex-utils/0.0.8.tgz","@tscircuit/footprinter":"^0.0.442","@tscircuit/image-utils":"^0.0.8","@tscircuit/implicit-copper-pour-solver":"github:tscircuit/implicit-copper-pour-solver#a5cbbda0cd65fd4707c5c1af25779837c25aba92","@tscircuit/infer-cable-insertion-point":"^0.0.4","@tscircuit/infgrid-ijump-astar":"^0.0.35","@tscircuit/jlcpcb-manufacturing-specs":"git+https://github.com/tscircuit/jlcpcb-manufacturing-specs#23260504fceffff2d64bf11720f74e974d1d9321","@tscircuit/krt-wasm":"^0.1.1","@tscircuit/log-soup":"^1.0.2","@tscircuit/matchpack":"^0.0.97","@tscircuit/math-utils":"^0.0.36","@tscircuit/miniflex":"^0.0.4","@tscircuit/modelprinter":"^0.0.18","@tscircuit/ngspice-spice-engine":"^0.0.20","@tscircuit/props":"^0.0.704","@tscircuit/schematic-match-adapt":"^0.0.18","@tscircuit/schematic-trace-solver":"https://jscdn.tscircuit.com/@tscircuit/schematic-trace-solver/0.0.230.tgz","@tscircuit/solver-utils":"^0.0.16","@tscircuit/soup-util":"^0.0.41","@tscircuit/via-stitch-solver":"github:tscircuit/via-stitch-solver#64f2ac7781b795bdc0d74ba411988e60767fa653","@tscircuit/winding-breakout-point-solver":"github:tscircuit/winding-breakout-point-solver#202dbe9eb0088633b6fa094120dba6f2f41f8803","@types/bun":"^1.2.16","@types/debug":"^4.1.12","@types/react":"^19.1.8","@types/react-dom":"^19.1.6","@types/react-reconciler":"^0.28.9","bpc-graph":"^0.0.57","bun-match-svg":"0.0.12","calculate-elbow":"^0.0.12","chokidar-cli":"^3.0.0","circuit-json":"^0.0.528","circuit-json-to-bpc":"^0.0.13","circuit-json-to-connectivity-map":"^0.0.33","circuit-json-to-gltf":"^0.0.151","circuit-json-to-spice":"^0.0.45","circuit-to-svg":"^0.0.450",concurrently:"^9.1.2","connectivity-map":"^1.0.1",debug:"^4.3.6",flatbush:"^4.5.0","graphics-debug":"^0.0.95",howfat:"^0.3.8","kicad-to-circuit-json":"^0.0.142",kicadts:"^0.0.53","live-server":"^1.2.2",minicssgrid:"^0.0.9","pkg-pr-new":"^0.0.37",poppygl:"0.0.34",react:"^19.1.0","react-dom":"^19.1.0","schematic-symbols":"^0.0.248",spicets:"^0.0.4",spicey:"^0.0.14","stack-svgs":"^0.0.1","ts-expect":"^1.3.0",tsup:"^8.2.4"},peerDependencies:{"@tscircuit/capacity-autorouter":"*","@tscircuit/checks":"*","@tscircuit/circuit-json-util":"*","@tscircuit/create-fdm-enclosure":"*","@tscircuit/footprinter":"*","@tscircuit/infgrid-ijump-astar":"*","@tscircuit/math-utils":"*","@tscircuit/modelprinter":"*","@tscircuit/props":"*","@tscircuit/schematic-match-adapt":"*","circuit-json-to-bpc":"*","bpc-graph":"*","@tscircuit/matchpack":"*","circuit-json":"*","circuit-json-to-connectivity-map":"*","circuit-json-to-spice":"*","schematic-symbols":"*",spicets:"*",typescript:"^5.0.0","@tscircuit/cableprinter":"*"},dependencies:{"@flatten-js/core":"^1.6.2","@lume/kiwi":"^0.4.3","calculate-cell-boundaries":"^0.0.25","calculate-packing":"^0.0.90","css-select":"5.1.0","format-si-unit":"^0.0.12","gl-matrix":"^3.4.4",nanoid:"^5.0.7","performance-now":"^2.1.0","react-reconciler":"^0.32.0","svg-path-commander":"^2.1.11","transformation-matrix":"^2.16.1",zod:"^3.25.67","jscad-planner":"^0.0.18","jscad-fiber":"^0.0.88"},overrides:{"@tscircuit/props":"^0.0.704","circuit-json":"^0.0.528","@tscircuit/cableprinter":"^0.0.6"}},L5n=(e)=>{let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0},H5n=(e)=>{let t=JSON.stringify(e),n=L5n(t),o=L5n(`${t}${n}`);return`${n.toString(16).padStart(8,"0")}${o.toString(16).padStart(8,"0")}`},z0i=(e,t)=>`routes:core@${pPn.version}:solver:${H5n(t)}:srj:${H5n(e)}`,O0i=async({cacheEngine:e,cacheKey:t})=>{if(!e)return null;try{let n=await e.getItem(t);if(!n)return null;let o=JSON.parse(n);if(!o||!Array.isArray(o.traces))return null;return o}catch{return null}},V0i=async({cacheEngine:e,cacheKey:t,result:n})=>{if(!e)return;try{await e.setItem(t,JSON.stringify(n))}catch{}},F5n=0.000001,mPn=(e,t)=>e.pointId!==void 0&&t.pointId!==void 0&&e.pointId===t.pointId,_Pn=(e,t)=>Math.abs(e.x-t.x)<=F5n&&Math.abs(e.y-t.y)<=F5n&&e.layer===t.layer,Oue=(e,t)=>e.pointId!==void 0&&t.pointId!==void 0?mPn(e,t):_Pn(e,t),Y0i=(e,t)=>{let n=e.connections.find((r)=>r.routingPcbGroupId!==t.routingPcbGroupId&&r.source_trace_id===t.source_trace_id&&r.pointsToConnect.some((i)=>t.pointsToConnect.some((s)=>Oue(i,s))));if(!n)return;let o=n.pointsToConnect.filter((r)=>!t.pointsToConnect.some((i)=>Oue(r,i)));return o.length===1?o[0]:void 0},G0i=(e,t)=>{if(!t.routingPcbGroupId||!t.source_trace_id)return;let n=Y0i(e,t);if(!n)return;if(!e.connections.some((r)=>r.routingPcbGroupId!==void 0&&r.routingPcbGroupId!==t.routingPcbGroupId&&r.source_trace_id===t.source_trace_id&&r.pointsToConnect.some((i)=>Oue(i,n))))return;return{x:n.x,y:n.y,layer:n.layer}};function gPn(e,t){if(e.routingPcbGroupId)return e.routingPcbGroupId===t.routingPcbGroupId;for(let n of t.traces){if(!n.source_trace_id)continue;if(e.source_trace_id===n.source_trace_id)return!0;if(e.name===n.source_trace_id)return!0;if(e.rootConnectionName===n.source_trace_id)return!0;if(e.mergedConnectionNames?.includes(n.source_trace_id))return!0}for(let n of t.nets){if(!n.source_net_id)continue;if(e.name===n.source_net_id)return!0}return!1}function U0i(e){for(let t of e){if(t.routingPcbGroupId)return!0;if(t.routingPhaseIndex!==null)return!0}return!1}function q9e(e,t){let n=[];for(let c of e.connections)if(gPn(c,t))n.push(c);let o=new Set;for(let c of n)o.add(c.name);let r=[];for(let c of e.differentialPairs??[]){let l=o.has(c.connectionNames[0]),h=o.has(c.connectionNames[1]);if(l!==h)throw Error(`Differential pair "${c.connectionNames.join("/")}" cannot be split across autorouting phases`);if(l)r.push(c)}let i=new Map(e.connections.map((c)=>[c.name,c])),s=(e.buses??[]).map((c)=>{let l=c.connectionNames.filter((u)=>o.has(u)),h=c.connectionNames.filter((u)=>i.get(u)?.routingPcbGroupId===t.routingPcbGroupId);if(c.maxLengthSkew!==void 0&&l.length>0&&l.length!==h.length)throw new uPn(`Length-matched bus "${c.name||"unnamed bus"}" cannot be split across autorouting phases. Assign the complete bus to one routingPhaseIndex.`);let d=Object.fromEntries(l.flatMap((u)=>{let _=i.get(u);if(!_)return[];let p=G0i(e,_);return p?[[u,p]]:[]}));return{...c,connectionNames:l,...Object.keys(d).length>0?{connectionExitTargets:d}:{}}}).filter((c)=>c.connectionNames.length>0),a=DSn({bounds:t.routingBounds??e.bounds,connections:n});return{...e,bounds:a,outline:NSn(e,a),connections:n,differentialPairs:r.length>0?r:void 0,buses:s.length>0?s:void 0}}function W0i(e){if(!e)return!1;return Object.values(e).some((t)=>t!==void 0)}function X0i(e,t){if(t===void 0)return e;return e.map((n)=>({...n,nominalTraceWidth:Math.max(n.nominalTraceWidth??t,t),width:Math.max(n.width??t,t)}))}function z5n(e,t){if(!W0i(t))return e;let n=t.minTraceWidth??e.minTraceWidth,o=t.minViaHoleDiameter??e.minViaHoleDiameter,r=t.minViaPadDiameter??e.minViaPadDiameter,i=t.minTraceToHoleEdgeClearance??e.minTraceToHoleEdgeClearance,s=t.minTraceToPadEdgeClearance??e.minTraceToPadEdgeClearance,a=t.minViaEdgeToPadEdgeClearance??e.minViaEdgeToPadEdgeClearance,c=t.minViaHoleEdgeToViaHoleEdgeClearance??e.minViaHoleEdgeToViaHoleEdgeClearance,l=t.minPlatedHoleDrillEdgeToDrillEdgeClearance??e.minPlatedHoleDrillEdgeToDrillEdgeClearance,h=t.minPadEdgeToPadEdgeClearance??e.minPadEdgeToPadEdgeClearance,d=t.minBoardEdgeClearance??e.minBoardEdgeClearance;return{...e,connections:X0i(e.connections,t.minTraceWidth),minTraceWidth:n,minViaDiameter:r,minViaHoleDiameter:o,minViaPadDiameter:r,min_via_hole_diameter:o,min_via_pad_diameter:r,minTraceToPadEdgeClearance:s,minTraceToHoleEdgeClearance:i,minViaEdgeToPadEdgeClearance:a,minViaHoleEdgeToViaHoleEdgeClearance:c,minPlatedHoleDrillEdgeToDrillEdgeClearance:l,minPadEdgeToPadEdgeClearance:h,minBoardEdgeClearance:d}}var j0i=(e,t)=>{let n=e.connections.filter((s)=>s.routingPcbGroupId!==t),o=new Set(n.map((s)=>s.name)),r=[];for(let s of e.differentialPairs??[]){let a=o.has(s.connectionNames[0]),c=o.has(s.connectionNames[1]);if(a!==c)throw Error(`Differential pair "${s.connectionNames.join("/")}" cannot be split at a breakout boundary`);if(a)r.push(s)}let i=(e.buses??[]).map((s)=>({...s,connectionNames:s.connectionNames.filter((a)=>o.has(a))})).filter((s)=>s.connectionNames.length>0);return{...e,connections:n,differentialPairs:r.length>0?r:void 0,buses:i.length>0?i:void 0}},K0i=(e,t)=>({...e,traces:e.traces?.map((n)=>{let o=t.get(n.connection_name??"");if(!o)return n;return{...n,connectsTo:[...new Set([...n.connectsTo??[],o])]}})});function $0i({fanoutInputSimpleRouteJson:e,fanoutOutputSimpleRouteJson:t,baseSimpleRouteJson:n,routingPhasePlan:o}){let r=o.routingPcbGroupId;if(!r)return{downstreamSimpleRouteJson:t,baseSimpleRouteJson:n,synchronizedBreakoutPoints:[]};let i=new Map(t.connections.map((u)=>[u.name,u])),s=n.connections.map((u)=>({...u,pointsToConnect:u.pointsToConnect.map((_)=>({..._}))})),a=[],c=new Map;for(let u of e.connections){if(u.routingPcbGroupId!==r||!u.source_trace_id)continue;let _=i.get(u.name);if(!_)continue;let m=s.filter((f)=>{if(f.routingPcbGroupId===r)return!1;let y=f.source_trace_id===u.source_trace_id,x=f.pointsToConnect.some((C)=>u.pointsToConnect.some((b)=>mPn(C,b)));if(!y&&!x)return!1;return f.pointsToConnect.some((C)=>u.pointsToConnect.some((b)=>Oue(C,b)))}).flatMap((f)=>f.pointsToConnect.flatMap((y,x)=>u.pointsToConnect.some((C)=>Oue(y,C))?[{globalConnection:f,pointIndex:x,previousPoint:y}]:[])),A=_.pointsToConnect.findIndex((f,y)=>{let x=u.pointsToConnect[y];return x!==void 0&&!_Pn(f,x)});if(A<0)continue;let g=_.pointsToConnect[A];if(m.length===0)a.push({sourceTraceId:u.source_trace_id,routingPcbGroupId:r,previousPoint:u.pointsToConnect[A],fanoutExitPoint:g});for(let{globalConnection:f,pointIndex:y,previousPoint:x}of m){let{terminalVia:C,...b}=x,I={...b,x:g.x,y:g.y,layer:g.layer,...g.terminalVia?{terminalVia:{...g.terminalVia}}:{}};if(f.pointsToConnect[y]=I,x.pointId)c.set(u.name,x.pointId);a.push({sourceTraceId:u.source_trace_id,routingPcbGroupId:r,previousPoint:x,fanoutExitPoint:g})}}let l=t.obstacles.filter((u)=>u.isFanoutSourceKeepout===!0&&u.componentId!==void 0),h=new Set(l.flatMap((u)=>u.componentId===void 0?[]:[u.componentId])),d=n.obstacles.filter((u)=>!u.componentId||!h.has(u.componentId));return{downstreamSimpleRouteJson:j0i(K0i(t,c),r),baseSimpleRouteJson:{...n,connections:s,obstacles:[...d,...l]},synchronizedBreakoutPoints:a}}function q0i(e){let t=[],n=new Set(e.source_component.list().filter((i)=>i.name?.startsWith("__autoplaced_jumper")).map((i)=>i.source_component_id));if(n.size===0)return t;let o=new Set(e.pcb_component.list().filter((i)=>n.has(i.source_component_id)).map((i)=>i.pcb_component_id)),r=e.pcb_smtpad.list().filter((i)=>o.has(i.pcb_component_id));for(let i of r){if(i.shape==="polygon")continue;if(!i.pcb_port_id)continue;if(i.shape==="rect"||i.shape==="rotated_rect"){let s=i.width/2,a=i.height/2;t.push({pcb_port_id:i.pcb_port_id,x:i.x,y:i.y,minX:i.x-s,maxX:i.x+s,minY:i.y-a,maxY:i.y+a})}else if(i.shape==="circle"){let s=i.radius;t.push({pcb_port_id:i.pcb_port_id,x:i.x,y:i.y,minX:i.x-s,maxX:i.x+s,minY:i.y-s,maxY:i.y+s})}}return t}function O5n(e,t,n,o=0.01){for(let r of e)if(Math.abs(r.x-t)<o&&Math.abs(r.y-n)<o)return r.pcb_port_id;return}function J0i(e,t,n){for(let o of e)if(t>=o.minX&&t<=o.maxX&&n>=o.minY&&n<=o.maxY)return o;return}function Z0i(e,t){if(e.length===0||t.length===0)return[e];let n=[],o=[];for(let r=0;r<e.length;r++){let i=e[r];if(o.push(i),i.route_type==="wire"&&r>0&&r<e.length-1){let s=J0i(t,i.x,i.y);if(s){if(!i.end_pcb_port_id)i.end_pcb_port_id=s.pcb_port_id;n.push(o);let a={...i};if(delete a.end_pcb_port_id,!a.start_pcb_port_id)a.start_pcb_port_id=s.pcb_port_id;o=[a]}}}if(o.length>0)n.push(o);return n}function epi(e,t){if(t.length===0)return e;let n=[];for(let o of e){let r=Z0i(o,t);for(let i of r)if(i.length>0){let s=i[0],a=i[i.length-1];if(s.route_type==="wire"&&!s.start_pcb_port_id){let c=O5n(t,s.x,s.y);if(c)s.start_pcb_port_id=c}if(a.route_type==="wire"&&!a.end_pcb_port_id){let c=O5n(t,a.x,a.y);if(c)a.end_pcb_port_id=c}n.push(i)}}return n}var V5n=({db:e,pcbTrace:t,routeWithSrjMetadata:n})=>{for(let o of n){if(o.route_type!=="through_pad")continue;let r=o.circuitJsonMetadata?.pcb_via_id;if(!r)continue;let i=e.pcb_via.get(r);if(!i?.net_is_assignable||i.net_assigned&&i.pcb_trace_id!==t.pcb_trace_id)continue;e.pcb_via.update(i.pcb_via_id,{pcb_trace_id:t.pcb_trace_id,net_assigned:!0})}},Y5n=(e,t,n,o)=>Math.max(n-t,e-o),tpi=(e)=>{for(let t=0;t<e.length;t++){let n=e[t];for(let o=t+1;o<e.length;o++){let r=e[o];if(n.regionId&&n.regionId===r.regionId)continue;let i=Y5n(n.bounds.minX,n.bounds.maxX,r.bounds.minX,r.bounds.maxX),s=Y5n(n.bounds.minY,n.bounds.maxY,r.bounds.minY,r.bounds.maxY),a=Math.max(i,s),c=n.boundaryKeepaway+r.boundaryKeepaway;if(a+0.000001<c)return{firstRegion:n,secondRegion:r,availableGap:a,requiredGap:c}}}return};function zY({accumulatedPcbTraces:e,stageOutputPcbTraces:t}){let n=new Set(t.flatMap((o)=>[o.pcb_trace_id,...o.__replaces_pcb_trace_id?[o.__replaces_pcb_trace_id]:[]]));return[...e.filter((o)=>!n.has(o.pcb_trace_id)),...t]}var npi=0.000001;function opi({point:e,segmentStart:t,segmentEnd:n}){if(e.layer&&(t.layer!==e.layer||n.layer!==e.layer))return!1;return ga(e,t,n)<=npi}function rpi({point:e,pad:t,traceWidth:n=0}){if(t.shape==="rect"||t.shape==="rotated_rect"){let o=t.shape==="rotated_rect"?_o(Hb(-t.ccw_rotation,t.x,t.y),e):e;return Math.abs(o.x-t.x)<=t.width/2+n/2&&Math.abs(o.y-t.y)<=t.height/2+n/2}if(t.shape==="circle")return Jl(e,t)<=t.radius+n/2;return!1}function ipi({point:e,hole:t,traceWidth:n=0}){return Jl(e,t)<=(t.outer_diameter??t.hole_diameter??0)/2+n/2}function spi(e,t){let n=new Set,o=t.route,r=[o[0],o[o.length-1]].filter((i)=>Boolean(i)&&i.route_type==="wire"&&i.x!==void 0&&i.y!==void 0);for(let i of r){let s=new Set;for(let a of e.pcb_port.list()){if(!a.source_port_id)continue;if(i.layer&&a.layers&&!a.layers.includes(i.layer))continue;if(Jl(i,a)<=0.01)s.add(a.source_port_id)}if(s.size>0){for(let a of s)n.add(a);continue}for(let a of e.pcb_smtpad.list()){if(!a.pcb_port_id)continue;if(i.layer&&a.layer!==i.layer)continue;if(!rpi({point:i,pad:a,traceWidth:i.width}))continue;let c=e.pcb_port.get(a.pcb_port_id)?.source_port_id;if(c)n.add(c)}for(let a of e.pcb_plated_hole.list()){if(!a.pcb_port_id)continue;if(!ipi({point:i,hole:a,traceWidth:i.width}))continue;let c=e.pcb_port.get(a.pcb_port_id)?.source_port_id;if(c)n.add(c)}}return[...n]}function api(e){let t=e.route.filter((n)=>n.route_type==="wire"&&n.x!==void 0&&n.y!==void 0);return[t[0],t[t.length-1]].filter((n)=>Boolean(n))}function cpi(e,t){let n=new Set,o=api(t);if(o.length===0)return[];for(let r of e.pcb_trace.list()){if(!r.source_trace_id)continue;if(r.pcb_trace_id===t.pcb_trace_id)continue;if(!e.source_trace.get(r.source_trace_id)&&!e.source_net.get(r.source_trace_id))continue;let i=r.route.filter((s)=>s.route_type==="wire");for(let s=0;s<i.length-1;s++){let a=i[s],c=i[s+1];if(!a||!c)continue;for(let l of o)if(opi({point:l,segmentStart:a,segmentEnd:c}))n.add(r.source_trace_id)}}return[...n]}function lpi(e,t){let n=new Set;for(let o of t.route)for(let r of[o.start_pcb_port_id,o.end_pcb_port_id]){if(!r)continue;let i=e.pcb_port.get(r)?.source_port_id;if(i)n.add(i)}if(n.size>0)return[...n];return spi(e,t)}function hpi(e){let t=new l5({});return t.addConnections(e.map((n)=>[n.source_trace_id,...n.connected_source_port_ids,...n.connected_source_net_ids])),t}function lrt({db:e,trace:t,subcircuit_id:n}){if(t.source_trace_id&&(e.source_trace.get(t.source_trace_id)??e.source_net.get(t.source_trace_id)))return t.source_trace_id;let o=lpi(e,t);if(o.length===0)return cpi(e,t)[0];let r=e.source_trace.list(),i=hpi(r),s=o.map((d)=>i.getNetConnectedToId(d)).filter((d)=>Boolean(d)),a=o.length>=2?r.find((d)=>o.every((u)=>d.connected_source_port_ids.includes(u))):void 0;if(a)return a.source_trace_id;let c=r.filter((d)=>{let u=i.getNetConnectedToId(d.source_trace_id);return s.some((_)=>_===u)}),l=c.filter((d)=>d.connected_source_port_ids.some((u)=>o.includes(u))),h=l.length>0?l:c;if(h.length===0)return;return(h.find((d)=>d.subcircuit_id===n)??h[0])?.source_trace_id}function dpi(e,t){let o=[];for(let r of e){let i=t==="vertical"?r.center.y:r.center.x,s=!1;for(let a of o){let c=t==="vertical"?a[0].center.y:a[0].center.x;if(Math.abs(i-c)<0.01){a.push(r),s=!0;break}}if(!s)o.push([r])}return o.filter((r)=>r.length>=2)}function upi(e){let{db:t,output_jumpers:n,subcircuit_id:o}=e;for(let r=0;r<n.length;r++){let i=n[r],s=t.source_component.insert({ftype:"simple_chip",name:`__autoplaced_jumper_${r}`,supplier_part_numbers:{}}),a=i.orientation==="horizontal"?0:90,c=i.pads[0]?.layer||i.pads[0]?.layers?.[0]||"top",l=t.pcb_component.insert({source_component_id:s.source_component_id,center:i.center,rotation:a,layer:c,width:i.width||0,height:i.height||0,obstructs_within_bounds:!1}),h=[];for(let u=0;u<i.pads.length;u++){let _=i.pads[u],p=u+1,m=t.source_port.insert({source_component_id:s.source_component_id,name:`pin${p}`,pin_number:p}),A=_.layer||_.layers?.[0]||"top",g=t.pcb_port.insert({pcb_component_id:l.pcb_component_id,source_port_id:m.source_port_id,x:_.center.x,y:_.center.y,layers:[A]}),f=t.pcb_smtpad.insert({pcb_component_id:l.pcb_component_id,pcb_port_id:g.pcb_port_id,shape:"rect",x:_.center.x,y:_.center.y,width:_.width,height:_.height,layer:A});h.push({pad:_,sourcePortId:m.source_port_id,pcbSmtpadId:f.pcb_smtpad_id})}let d=dpi(i.pads,i.orientation);for(let u of d){let _=[];for(let p of u){let m=h.find((A)=>Math.abs(A.pad.center.x-p.center.x)<0.01&&Math.abs(A.pad.center.y-p.center.y)<0.01);if(m)_.push(m.sourcePortId)}if(_.length>=2)t.source_component_internal_connection.insert({source_component_id:s.source_component_id,subcircuit_id:o??void 0,source_port_ids:_})}}}function ppi(e){return{...e,type:"pcb_trace",pcb_trace_id:e.pcb_trace_id,connection_name:e.connection_name??e.source_trace_id??e.pcb_trace_id,route:e.route.map((t)=>({...t}))}}function mpi(e){let t=new Set;if(!e.subcircuit_id)return t;t.add(e.subcircuit_id);let n=e.root?.db;if(!n)return t;for(let o of Gst(n,e.subcircuit_id))t.add(o);return t}function Vct(e){let t=e.root?.db;if(!t)return[];let n=mpi(e);return t.pcb_trace.list().filter((o)=>{if(!o.route||o.route.length<2)return!1;if(!e.subcircuit_id)return!0;return Boolean(o.subcircuit_id&&n.has(o.subcircuit_id))})}function pst(e){if(typeof e!=="string"||e.length===0)return[];return e.split("__").flatMap((t)=>{if(t.length===0)return[];let n=[t],o=t.indexOf("_reroute_");if(o>0)n.push(t.slice(0,o));return n})}function hrt(e,t){if(typeof t!=="string"||t.length===0)return;e.add(t);for(let n of pst(t))e.add(n)}function _pi({group:e,outputPcbTraces:t,pcbTraceIdsToReplace:n=[]}){let o=e.root?.db;if(!o)return;let r=new Set(n),i=new Set;for(let c of t){if(c.type!=="pcb_trace")continue;let l=c;r.add(l.pcb_trace_id),hrt(i,l.source_trace_id),hrt(i,l.connection_name),hrt(i,l.rootConnectionName)}if(r.size===0&&i.size===0)return;let s=Vct(e).filter((c)=>r.has(c.pcb_trace_id)||Boolean(c.source_trace_id&&c.subcircuit_id===e.subcircuit_id&&i.has(c.source_trace_id)));if(s.length===0)return;let a=new Set(s.map((c)=>c.pcb_trace_id));for(let c of o.pcb_via.list())if(c.pcb_trace_id&&a.has(c.pcb_trace_id))o.pcb_via.delete(c.pcb_via_id);for(let c of s)o.pcb_trace.delete(c.pcb_trace_id)}function gpi(e){return Vct(e).map(ppi)}function Api(e){let t=e.filter((s)=>s.route_type==="jumper"),n=e.filter((s)=>s.route_type!=="jumper");if(t.length===0)return null;let o=[];for(let s of t){let{start:a,end:c}=s,l=-1,h=-1,d=1/0,u=1/0;for(let _=0;_<n.length;_++){let p=n[_];if(p.route_type!=="wire")continue;let m=Math.hypot(p.x-a.x,p.y-a.y),A=Math.hypot(p.x-c.x,p.y-c.y);if(m<d)d=m,l=_;if(A<u)u=A,h=_}if(l>h)[l,h]=[h,l];if(l>=0&&h>=0&&l!==h)o.push({startIdx:l,endIdx:h})}o.sort((s,a)=>s.startIdx-a.startIdx);let r=[],i=0;for(let s of o){if(i<s.startIdx)r.push(n.slice(i,s.startIdx+1));i=s.endIdx}if(i<n.length)r.push(n.slice(i));return r}function G5n(e,t){let{width:n,height:o,pcbAnchorAlignment:r}=t;if(!r)return e;let i=r;if(typeof n!=="number"||typeof o!=="number")return e;let{x:s,y:a}=e;switch(i){case"top_left":return{x:s+n/2,y:a-o/2};case"top_center":return{x:s,y:a-o/2};case"top_right":return{x:s-n/2,y:a-o/2};case"center_left":return{x:s+n/2,y:a};case"center_right":return{x:s-n/2,y:a};case"bottom_left":return{x:s+n/2,y:a+o/2};case"bottom_center":return{x:s,y:a+o/2};case"bottom_right":return{x:s-n/2,y:a+o/2};default:return e}}var U5n=(e,t)=>{let n=Xk(e);return Math.hypot(n.x-t.x,n.y-t.y)},APn=(e)=>{let t=e.root?.platform;return t!==void 0&&"allowLegacyAutorouters"in t&&t.allowLegacyAutorouters===!0},fPn=(e)=>{if(APn(e))return null;let t=e._parsedProps.autorouter??e.getInheritedProperty("autorouter");return kCn(t)},W5n=(e)=>{if(APn(e))return null;let t=fPn(e);if(t)return t;let n=e.selectAll("autoroutingphase").map((o)=>o._parsedProps.autorouter);for(let o of n){let r=kCn(o);if(r)return r}return null},fpi=({db:e,route:t,routeThicknessMode:n,sourceTraceId:o})=>{if(!o||t.length<2)return t;let i=e.source_trace.get(o)?.connected_source_port_ids[0];if(!i)return t;let s=e.pcb_port.list().find((l)=>l.source_port_id===i);if(!s)return t;let a=t[0],c=t[t.length-1];return U5n(c,s)<U5n(a,s)?Mve(t,n):t},UP=class extends Xl{pcb_group_id=null;schematic_group_id=null;subcircuit_id=null;_hasStartedAsyncAutorouting=!1;_pcbPlacementDrcErrorCount=null;_pcbPlacementDrcCheckError=null;_pcbPlacementDrcChecksPending=!1;_standaloneSubcircuitDrcChecksComplete=!1;_standaloneSubcircuitDrcChecksInProgress=!1;_isInflatedFromCircuitJson=!1;_isolatedCircuitJson=null;get _isIsolatedSubcircuit(){return Boolean(this.getInheritedProperty("_subcircuitCachingEnabled"))}_normalComponentNameMap=null;getNormalComponentNameMap(){if(this._normalComponentNameMap)return this._normalComponentNameMap;let e=new Map,t=(n)=>{if(n._isNormalComponent&&n.name){let o=e.get(n.name);if(o)o.push(n);else e.set(n.name,[n])}for(let o of n.children)if(!o.isSubcircuit)t(o)};for(let n of this.children)if(!n.isSubcircuit)t(n);return this._normalComponentNameMap=e,e}_asyncAutoroutingResult=null;get config(){return{zodProps:mSt,componentName:"Group"}}initPorts(e={}){let t=this._getSchematicPortArrangement();if(this._parsedProps?.showAsSchematicBox&&!this._parsedProps.pinLabels&&t&&ave(t).some((o)=>typeof o==="string"))return;super.initPorts(e)}_getSchematicPortArrangementFromPortDirections(){if(!this._parsedProps?.showAsSchematicBox)return null;let e={leftSide:[],rightSide:[],topSide:[],bottomSide:[]};for(let n of this.children){if(n.componentName!=="Port")continue;let o=n._parsedProps.direction;if(!o)continue;let r=n._parsedProps.pinNumber??n._parsedProps.name??void 0;if(r===void 0)continue;e[o==="left"?"leftSide":o==="right"?"rightSide":o==="up"?"topSide":"bottomSide"].push(r)}if(e.leftSide.length===0&&e.rightSide.length===0&&e.topSide.length===0&&e.bottomSide.length===0)return null;let t={};if(e.leftSide.length>0)t.leftSide={pins:e.leftSide,direction:"top-to-bottom"};if(e.rightSide.length>0)t.rightSide={pins:e.rightSide,direction:"top-to-bottom"};if(e.topSide.length>0)t.topSide={pins:e.topSide,direction:"left-to-right"};if(e.bottomSide.length>0)t.bottomSide={pins:e.bottomSide,direction:"left-to-right"};return t}_getSchematicPortArrangement(){return super._getSchematicPortArrangement()??this._getSchematicPortArrangementFromPortDirections()}_ensureSchematicBoxPortsFromConnections(){if(!this._parsedProps?.showAsSchematicBox)return;if(!this._parsedProps?.connections)return;for(let[e,t]of Object.entries(this._parsedProps.connections)){if(this.children.find((i)=>i.componentName==="Port"&&i.isMatchingAnyOf([e])))continue;let o=e.match(/^pin(\d+)$/i)??e.match(/^(\d+)$/),r=o?Number(o[1]):void 0;this.add(new sd({name:e,pinNumber:r,connectsTo:t}))}}doInitialInitializePortsFromChildren(){super.doInitialInitializePortsFromChildren(),this._ensureSchematicBoxPortsFromConnections()}updateInitializePortsFromChildren(){super.updateInitializePortsFromChildren(),this._ensureSchematicBoxPortsFromConnections()}_getPrimaryPinCount(){let e=super._getPrimaryPinCount();if(!this._parsedProps?.showAsSchematicBox)return e;let t=this.children.filter((n)=>n.componentName==="Port").map((n)=>n._parsedProps.pinNumber).filter((n)=>n!==void 0);if(t.length===0)return e;return Math.max(e,...t)}_getPinLabelsFromPorts(){if(!this._parsedProps?.showAsSchematicBox)return super._getPinLabelsFromPorts();return Zdi(this)}doInitialSourceGroupRender(){let{db:e}=this.root,t=typeof this._parsedProps.name==="string"&&this._parsedProps.name.length>0,n=e.source_group.insert({name:this.name,is_subcircuit:this.isSubcircuit,was_automatically_named:!t});if(this.source_group_id=n.source_group_id,this.isSubcircuit)this.subcircuit_id=`subcircuit_${n.source_group_id}`,e.source_group.update(n.source_group_id,{subcircuit_id:this.subcircuit_id})}doInitialSourceRender(){let{db:e}=this.root;for(let n of this.getDescendants()){if(n.getGroup()?.source_group_id!==this.source_group_id)continue;e.source_component.update(n.source_component_id,{source_group_id:this.source_group_id})}if(!this.isSubcircuit)return;let t=W5n(this);if(!t)return;e.source_invalid_component_property_error.insert({source_component_id:this.source_component_id??"",property_name:"autorouter",error_type:"source_invalid_component_property_error",message:`The "${t}" autorouter is deprecated and is not enabled by this platform. Use the default autorouter and introduce <autoroutingphase /> or <fanout /> elements as needed.`})}doInitialSourceParentAttachment(){let{db:e}=this.root,t=this.parent?.getGroup?.();if(t?.source_group_id)e.source_group.update(this.source_group_id,{parent_source_group_id:t.source_group_id});if(!this.isSubcircuit)return;if(Lve(this.parent))return;let n=this.parent?.getSubcircuit?.()?.subcircuit_id;if(!n)return;e.source_group.update(this.source_group_id,{parent_subcircuit_id:n})}doInitialPcbComponentRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,n=t,o=n.outline&&n.outline.length>0,r=o?n.outline.map((l)=>({x:Ke.parse(l.x),y:Ke.parse(l.y)})):void 0,i=this.props,s=this._getGlobalPcbPositionBeforeLayout(),a=G5n(s,i),c=e.pcb_group.insert({is_subcircuit:this.isSubcircuit,subcircuit_id:this.subcircuit_id??this.getSubcircuit()?.subcircuit_id,name:this.name,anchor_position:s,center:a,...o?{outline:r}:{width:0,height:0},pcb_component_ids:[],source_group_id:this.source_group_id,autorouter_configuration:t.autorouter?{trace_clearance:t.autorouter.traceClearance}:void 0,anchor_alignment:t.pcbAnchorAlignment??null});this.pcb_group_id=c.pcb_group_id;for(let l of this.children)e.pcb_component.update(l.pcb_component_id,{pcb_group_id:c.pcb_group_id})}doInitialPcbPrimitiveRender(){this.calculatePcbGroupBounds()}calculatePcbGroupBounds(e){if(!this.pcb_group_id)return;if(this.root?.pcbDisabled)return;let{db:t}=this.root,n=this._parsedProps,o=n.outline&&n.outline.length>0,r=this._parsedProps.pcbX!==void 0||this._parsedProps.pcbY!==void 0;if(o){let A=n.outline.map((C)=>({x:Ke.parse(C.x),y:Ke.parse(C.y)})),g=Hs(A);if(!g)return;let f=(g.minX+g.maxX)/2,y=(g.minY+g.maxY)/2,x=r?t.pcb_group.get(this.pcb_group_id)?.center??{x:f,y}:{x:f,y};t.pcb_group.update(this.pcb_group_id,{center:x});return}let i=e;if(!i){let A=T8e(this.children);i={center:{x:(A.minX+A.maxX)/2,y:(A.minY+A.maxY)/2},width:A.width,height:A.height}}let{width:s,height:a}=i,{x:c,y:l}=i.center;if(this.isSubcircuit||this.isRoutingDirective){let{padLeft:A,padRight:g,padTop:f,padBottom:y}=this._resolvePcbPadding();s+=A+g,a+=f+y,c+=(g-A)/2,l+=(f-y)/2}let h=Number(n.width??s),d=Number(n.height??a),_=t.pcb_group.get(this.pcb_group_id)?.center??{x:c,y:l},p=this.isSubcircuit||this.isRoutingDirective||e!==void 0,m=r?p?{x:n.width===void 0?c:_.x,y:n.height===void 0?l:_.y}:_:{x:c,y:l};if(r&&n.pcbAnchorAlignment){let A=this._getGlobalPcbPositionBeforeLayout(),g=G5n(A,{...this.props,width:h,height:d});if(Math.abs(g.x-m.x)>0.000001||Math.abs(g.y-m.y)>0.000001)this._repositionOnPcb(g);m=g}t.pcb_group.update(this.pcb_group_id,{width:h,height:d,center:m})}updatePcbPrimitiveRender(){this.calculatePcbGroupBounds()}unnamedElementCounter={};getNextAvailableName(e){return this.unnamedElementCounter[e.lowercaseComponentName]??=1,`unnamed_${e.lowercaseComponentName}${this.unnamedElementCounter[e.lowercaseComponentName]++}`}_resolvePcbPadding(){let e=this._parsedProps,t=e.pcbLayout,n=(h)=>{let d=t?.[h],u=e[h];if(typeof d==="number")return d;if(typeof u==="number")return u;return},o=n("padding")??0,r=n("paddingX"),i=n("paddingY"),s=n("paddingLeft")??r??o,a=n("paddingRight")??r??o,c=n("paddingTop")??i??o,l=n("paddingBottom")??i??o;return{padLeft:s,padRight:a,padTop:c,padBottom:l}}doInitialCreateTraceHintsFromProps(){let{_parsedProps:e}=this,{db:t}=this.root,n=e;if(!this.isSubcircuit)return;let o=n.manualEdits?.manual_trace_hints;if(!o)return;for(let r of o)this.add(new RSn({for:r.pcb_port_selector,offsets:r.offsets}))}doInitialSourceAddConnectivityMapKey(){M0i(this),vdi(this)}_areChildSubcircuitsRouted(){let e=this._findDirectChildSubcircuits();for(let t of e){if(t._isInflatedFromCircuitJson)continue;if(!t._hasTracesToRoute())continue;if(t._shouldRouteAsync()&&!t._asyncAutoroutingResult)return!1}return!0}_findDirectChildSubcircuits(){let e=[],t=(n)=>{for(let o of n)if(o.isSubcircuit&&o!==this)e.push(o);else t(o.children)};return t(this.children),e}_shouldRouteAsync(){if(this._isLegacyAutorouterDisabled())return!1;let e=this._getAutorouterConfig();if(e.groupMode==="sequential-trace")return!1;if(e.local&&e.groupMode==="subcircuit")return!0;if(!e.local)return!0;return!1}_getRoutingPhasePlans(){return F0i(this)}_hasTracesToRoute(){let e=GJ.default("tscircuit:core:_hasTracesToRoute"),t=this._getRoutingPhasePlans(),n=0,o=!1;for(let r of t){n+=r.traces.length;let i=r.autorouter?Yde(r.autorouter,this.root?.platform):void 0;o||=Boolean(r.reroute&&(r.region||i?.preset==="simplify"))}if(e(`[${this.getString()}] has ${n} traces to route`),n>0)return!0;if(o){let r=Vct(this).length;return e(`[${this.getString()}] has ${r} existing pcb traces available for reroute`),r>0}return!1}async _runEffectMakeHttpAutoroutingRequest(){let{db:e}=this.root,t=GJ.default("tscircuit:core:_runEffectMakeHttpAutoroutingRequest"),n=this._parsedProps,o=this._getAutorouterConfig(),{serverUrl:r,serverMode:i}=o,s=(l,h)=>{if(t("fetching",l),h.headers)h.headers["Tscircuit-Core-Version"]=this.root?.getCoreVersion();return fetch(l,h)},a=this.root.db.toArray().filter((l)=>l.type.startsWith("source_")||l.type.startsWith("pcb_"));if(i==="solve-endpoint"){if(this.props.autorouter?.inputFormat==="simplified"){let h=n.defaultTraceWidth??n.nominalTraceWidth,{simpleRouteJson:d}=nrt({db:e,minTraceWidth:Number(n.minTraceWidth??0.15),nominalTraceWidth:h!=null?Number(h):void 0,subcircuit_id:this.subcircuit_id,subcircuitComponent:this});d.allowViaInPad=o.allowViaInPad??d.allowViaInPad;let{autorouting_result:u}=await s(`${r}/autorouting/solve`,{method:"POST",body:JSON.stringify({input_simple_route_json:d,subcircuit_id:this.subcircuit_id}),headers:{"Content-Type":"application/json"}}).then((_)=>_.json());this._asyncAutoroutingResult=u,this._markDirty("PcbTraceRender");return}let{autorouting_result:l}=await s(`${r}/autorouting/solve`,{method:"POST",body:JSON.stringify({input_circuit_json:a,subcircuit_id:this.subcircuit_id}),headers:{"Content-Type":"application/json"}}).then((h)=>h.json());this._asyncAutoroutingResult=l,this._markDirty("PcbTraceRender");return}let{autorouting_job:c}=await s(`${r}/autorouting/jobs/create`,{method:"POST",body:JSON.stringify({input_circuit_json:a,provider:"freerouting",autostart:!0,display_name:this.root?.name,subcircuit_id:this.subcircuit_id,server_cache_enabled:o.serverCacheEnabled}),headers:{"Content-Type":"application/json"}}).then((l)=>l.json());while(!0){let{autorouting_job:l}=await s(`${r}/autorouting/jobs/get`,{method:"POST",body:JSON.stringify({autorouting_job_id:c.autorouting_job_id}),headers:{"Content-Type":"application/json"}}).then((h)=>h.json());if(l.is_finished){let{autorouting_job_output:h}=await s(`${r}/autorouting/jobs/get_output`,{method:"POST",body:JSON.stringify({autorouting_job_id:c.autorouting_job_id}),headers:{"Content-Type":"application/json"}}).then((d)=>d.json());this._asyncAutoroutingResult={output_pcb_traces:h.output_pcb_traces},this._markDirty("PcbTraceRender");break}if(l.has_error){let h=new Ide(`Autorouting job failed: ${JSON.stringify(l.error)}`);throw e.pcb_autorouting_error.insert({pcb_error_id:c.autorouting_job_id,error_type:"pcb_autorouting_error",message:h.message}),h}await new Promise((h)=>setTimeout(h,100))}}async _runLocalAutorouting(){let{db:e}=this.root,t=this._parsedProps,n=GJ.default("tscircuit:core:_runLocalAutorouting");n(`[${this.getString()}] starting local autorouting`);let o=this._getAutorouterConfig(),r=this._isLaserPrefabAutorouter(o),i=this._isAutoJumperAutorouter(o),s=this._getSubcircuitLayerCount()===1,a=Number(t.minTraceWidth??0.15),c=Number(t.defaultTraceWidth??t.nominalTraceWidth??a),l=this._getRoutingPhasePlans(),h=this.getInheritedProperty("routeRemaining")===!1||U0i(l),d=l.length>1,u=new Map;if(d){for(let O of e.pcb_debug_object.list())if(O.subcircuit_id===this.subcircuit_id&&(O.label?.startsWith("Autorouting phase: ")||O.label?.startsWith("autorouting phase ")))e.pcb_debug_object.delete(O.pcb_debug_object_id)}let _=(O,U)=>{if(!d)return;let j=u.get(O),Y=O.phaseName?.trim();e.pcb_debug_object.insert({shape:"rect",center:{x:(U.minX+U.maxX)/2,y:(U.minY+U.maxY)/2},size:{width:U.maxX-U.minX,height:U.maxY-U.minY},label:`autorouting phase ${j}${Y?` ${Y}`:""}`,subcircuit_id:this.subcircuit_id??void 0})},p=l.flatMap((O)=>{let U=O.autorouter?Yde(O.autorouter,this.root?.platform):o,j=U.preset,Y=O.reroute?j==="simplify"?"simplify":"reroute":O.fanoutRegionPcbGroupId?O.autorouter==="default"&&!O.getPrecomputedRoutingResult?"breakout":"fanout":j&&j!=="default"?j.replaceAll("_"," "):"default";u.set(O,O.routingPhaseIndex?.toString()??Y);let X=O.getPrecomputedRoutingResult?{...U,allowViaInPad:(typeof O.autorouter==="object"?O.autorouter.allowViaInPad:void 0)??o.allowViaInPad}:U,K=Uhi(O.algorithmFn?{...X,algorithmFn:O.algorithmFn}:X,this.root?.platform);return K.map((J,ee)=>({...J,routingPhasePlan:O,phaseStageIndex:ee,phaseStageCount:K.length}))}),m=new Map;for(let O of l){if(O.routingPhaseIndex!==null)continue;let U=u.get(O);m.set(U,(m.get(U)??0)+1)}let A=new Map;for(let O of l){if(O.routingPhaseIndex!==null)continue;let U=u.get(O);if(m.get(U)<=1)continue;let j=(A.get(U)??0)+1;A.set(U,j),u.set(O,`${U} ${j}`)}let f=p.some(({autorouterConfig:O})=>["fanout","single_layer_fanout","dogbone"].includes(O.preset??""))?B0i(this,l):void 0,{simpleRouteJson:y}=nrt({db:e,minTraceWidth:a,nominalTraceWidth:c,subcircuit_id:this.subcircuit_id,subcircuitComponent:this,fanoutPourNetMap:f}),x=(O)=>{let U=O.fanoutRegionPcbGroupId;if(!U)return;let j=e.pcb_group.get(U),Y=e.pcb_component.list().find((J)=>J.pcb_group_id===U)?.source_component_id;if(!Y)return;let X=`${j?.name??"Breakout"} defines conflicting fanout bounds with explicit breakout geometry and fanoutBoundaryPadding. Explicit breakout geometry takes precedence, so fanoutBoundaryPadding is ignored.`;if(e.source_property_ignored_warning.list().some((J)=>J.source_component_id===Y&&J.property_name==="fanoutBoundaryPadding"&&J.message===X))return;e.source_property_ignored_warning.insert({source_component_id:Y,property_name:"fanoutBoundaryPadding",message:X,error_type:"source_property_ignored_warning",subcircuit_id:j?.subcircuit_id})},C=new Map;for(let O of p){let U=O.autorouterConfig.preset;if((U==="fanout"||U==="single_layer_fanout")&&!C.has(O.routingPhasePlan))C.set(O.routingPhasePlan,O.autorouterConfig)}let b=[];for(let[O,U]of C){let j=O.fanoutRegionPcbGroupId;if(!j)continue;let Y=q9e(y,O);if(Y.connections.length===0)continue;Y=z5n(Y,O.drcTolerances);let X=e.pcb_breakout_point.list().filter((Z)=>Z.pcb_group_id===j).map((Z)=>({x:Z.x,y:Z.y})),K=U.preset,J=eit.resolveFanoutBounds(Y,{mode:K,busFanoutDirections:O.busFanoutDirections,fanoutBounds:O.fanoutBounds,fanoutBoundaryPadding:O.fanoutBoundaryPadding,fanoutRoutingLayers:O.fanoutRoutingLayers,allowBlindAndBuriedVias:Y.allowBlindAndBuriedVias,breakoutPoints:X,onFanoutBoundsConflict:()=>x(O)});if(O.fanoutBounds=J,!J)continue;let ee=e.pcb_group.get(j),se=Math.max(Y.minTraceWidth,...Y.connections.map((Z)=>Z.nominalTraceWidth??Z.width??Y.minTraceWidth)),ne=Y.minViaPadDiameter??Y.min_via_pad_diameter??Y.minViaDiameter,re=Y.minTraceToPadEdgeClearance??Y.defaultObstacleMargin??se;b.push({regionId:j,name:ee?.name??O.phaseName??j,bounds:J,boundaryKeepaway:QCn({traceWidth:se,traceToPadClearance:re,viaPadDiameter:ne})/2})}let I=tpi(b);if(I){let{firstRegion:O,secondRegion:U,availableGap:j,requiredGap:Y}=I,X=j<0?`overlap by ${Math.abs(j).toFixed(3)}mm`:`are only ${j.toFixed(3)}mm apart`,K=`Fanout regions "${O.name}" and "${U.name}" ${X}, but at least ${Y.toFixed(3)}mm of separation is required for a via-safe routing channel. Move the components farther apart or reduce their facing fanout padding.`;throw e.pcb_autorouting_error.insert({pcb_error_id:`pcb_autorouter_error_subcircuit_${this.subcircuit_id}`,error_type:"pcb_autorouting_error",message:K}),this.root?.emit("autorouting:error",{subcircuit_id:this.subcircuit_id,componentDisplayName:this.getString(),error:{message:K},simpleRouteJson:y}),Error(K)}for(let{regionId:O,bounds:U}of b)e.pcb_group.update(O,{center:{x:(U.minX+U.maxX)/2,y:(U.minY+U.maxY)/2},width:U.maxX-U.minX,height:U.maxY-U.minY});let v=[],P=[],M=new Set,B=gpi(this),T=(O,U)=>{let j=O.connection_name??O.pcb_trace_id,Y=new Set([j,O.pcb_trace_id,...pst(j),...pst(O.pcb_trace_id)]);return y.connections.some((X)=>{if(!gPn(X,U))return!1;return Y.has(X.name)||(X.source_trace_id?Y.has(X.source_trace_id):!1)||(X.rootConnectionName?Y.has(X.rootConnectionName):!1)||X.mergedConnectionNames?.some((K)=>Y.has(K))})},N=new Set(this.getDescendants().filter((O)=>O instanceof O_&&!O.getSubcircuit()._isInflatedFromCircuitJson&&Boolean(O._parsedProps.pcbPath?.length)).map((O)=>O.source_trace_id)),D=new Set(e.pcb_trace.list().filter((O)=>O.source_trace_id&&N.has(O.source_trace_id)).map((O)=>O.pcb_trace_id)),L=new Set(D),H,V=new Set;for(let[O,{routingPhasePlan:U,autorouterConfig:j,strategy:Y,usesPreviousStageOutput:X,phaseStageIndex:K,phaseStageCount:J}]of p.entries()){if(V.has(U))continue;if(!X)H=void 0;if(X&&H===void 0)throw Error("Autorouting follow-up stage is missing the preceding stage output");let ee=H??y,se=Boolean(U.reroute&&j.preset==="simplify"),ne=Boolean(U.reroute&&U.region&&!se),re=Boolean(U.reroute&&!se&&!U.region&&U.traces.length>0),Z=ne||re||se,te=ne?{...y,traces:[...B,...v]}:null;if(!X&&se)ee={...q9e(y,U),traces:zY({accumulatedPcbTraces:B,stageOutputPcbTraces:v})};else if(!X&&ne&&te)ee=dcn(te,{shape:"rect",...U.region});else if(!X&&re){let lt=q9e(y,U);ee={...lt,traces:[...lt.traces??[],...v.filter((Ct)=>!T(Ct,U))]}}else if(!X&&h){let lt=q9e(y,U),Ct=U.routingPcbGroupId;if(Ct){let Ht=nrt({db:e,minTraceWidth:a,nominalTraceWidth:c,subcircuit_id:this.subcircuit_id,subcircuitComponent:this,routingPcbGroupId:Ct,fanoutPourNetMap:f}).simpleRouteJson.obstacles.filter((et)=>et.isCopperPour),Tt=lt.obstacles.filter((et)=>!et.isCopperPour);lt.obstacles=Tt.concat(Ht)}ee={...lt,traces:zY({accumulatedPcbTraces:lt.traces??[],stageOutputPcbTraces:v})}}if(j.preset!=="bus_lanes"){let lt=!j.algorithmFn&&(j.preset==="fanout"||j.preset==="single_layer_fanout");ee=gVr(ee,lt?new Set([...L].filter((Ct)=>!D.has(Ct))):L)}ee=z5n(ee,U.drcTolerances),ee.allowViaInPad=j.allowViaInPad??ee.allowViaInPad;let ie=X?void 0:U.getPrecomputedRoutingResult,le=this.getInheritedProperty("preflightRoutingCheckPolicy")??"basic";if(U.isImplicitRemainingPhase&&K===0&&this.getInheritedProperty("routeRemaining")===void 0&&(le==="basic"||le==="conservative")&&ee.connections.length>50){V.add(U),e.pcb_autorouting_error.insert({pcb_error_id:`pcb_autorouting_error_remaining_routes_${this.subcircuit_id}`,subcircuit_id:this.subcircuit_id??void 0,error_type:"pcb_autorouting_error",message:`Remaining routes left unrouted (over 50 traces remaining and preflightRoutingCheckPolicy="${le}"). Set <board routeRemaining={true} /> or create <autoroutingphase /> elements for specific connections in the order you'd like to route them. The autorouter may hang unless you create autorouting phases incrementally.`});continue}let ue=Boolean(se&&ee.traces?.length===0);if((h||Z||X)&&(ee.connections.length===0&&!se&&!ie||ue)){if(K===0)_(U,ee.bounds);H=ee;continue}let de=U.autorouter!==void 0?this._isAutoJumperAutorouter(j):i,me=U.autorouter!==void 0?this._isLaserPrefabAutorouter(j):r;if(de){if(ee.allowJumpers=!0,j.availableJumperTypes)ee.availableJumperTypes=j.availableJumperTypes}let Ae=j.preset;if((Ae==="fanout"||Ae==="single_layer_fanout")&&!U.fanoutRegionPcbGroupId&&!ie)U.fanoutBounds=eit.resolveFanoutBounds(ee,{mode:Ae,busFanoutDirections:U.busFanoutDirections,fanoutBounds:U.fanoutBounds,fanoutBoundaryPadding:U.fanoutBoundaryPadding,fanoutRoutingLayers:U.fanoutRoutingLayers,allowBlindAndBuriedVias:ee.allowBlindAndBuriedVias});if(K===0)_(U,U.fanoutBounds??ee.bounds);if(n.enabled)global.debugOutputArray?.push({name:`simpleroutejson-${this.props.name}.json`,obj:ee});if(n.enabled){let lt=rx(ee);lt.title=`autorouting-${this.props.name}`,global.debugGraphics?.push(lt)}let xe=j.autorouterVersion??this.props.autorouterVersion,Me=this.props.autorouterEffortLevel,Re=Me?Number.parseInt(Me.replace("x",""),10):void 0,we={capacityDepth:j.capacityDepth,targetMinCapacity:j.targetMinCapacity,platformConfig:this.root?.platform,useAssignableSolver:me||s,useAutoJumperSolver:de,useLaserPrefabSolver:me,autorouterVersion:xe,effort:Re},_e=ie?"precomputed":j.algorithmFn?"custom":Y.name,ye=ie||j.algorithmFn?void 0:Y.getSolverName(we),Se={autorouterName:_e,solverName:ye,capacityDepth:we.capacityDepth,targetMinCapacity:we.targetMinCapacity,useAssignableSolver:we.useAssignableSolver,useAutoJumperSolver:we.useAutoJumperSolver,useLaserPrefabSolver:we.useLaserPrefabSolver,useTraceSimplificationSolver:j.preset==="simplify",autorouterVersion:we.autorouterVersion,effort:we.effort},Ne=ie||j.algorithmFn||!Y.cacheable?void 0:this.root?.platform?.localCacheEngine,ke=Ne?z0i(ee,Se):void 0,nt=ke?await O0i({cacheEngine:Ne,cacheKey:ke}):null,dt=ie?"precomputed":j.algorithmFn?"custom_algorithm":!Y.cacheable?"strategy_not_cacheable":!Ne?"no_cache_engine":void 0,rt={routingPhaseIndex:U.routingPhaseIndex,_actualRoutingPhaseOrderIndex:O,phaseOrdinal:O+1,phaseCount:p.length,connectionCount:ee.connections.length,obstacleCount:ee.obstacles.length,previousTraceCount:ee.traces?.length??0,isReroutePhase:Z,autorouterName:_e,autorouterVersion:xe,solverName:ye,effort:Re,cacheStatus:Ne?nt?"hit":"miss":"disabled",cacheKey:ke,cacheDisabledReason:dt};this.root?.emit("autorouting:start",{type:"autorouting:start",subcircuit_id:this.subcircuit_id,componentDisplayName:this.getString(),...U.phaseName!==void 0?{phaseName:U.phaseName,phaseStageIndex:K,phaseStageCount:J}:{},...rt,simpleRouteJson:ee});let mt;try{let lt,Ct;if(ie){let We=ie(ee);lt=We.traces,Ct=We.outputSimpleRouteJson;for(let Le of lt)L.add(Le.pcb_trace_id)}else if(nt)n(`[${this.getString()}] using cached local autorouting result`),lt=nt.traces;else{if(j.algorithmFn)mt=await j.algorithmFn(ee);else mt=Y.create({simpleRouteJson:ee,onSolverEnded:(Ze)=>this.root?.emit("solver:ended",{...Ze,type:"solver:ended",componentName:this.getString()}),commonAutorouterOptions:we,busFanoutDirections:U.busFanoutDirections,fanoutBounds:U.fanoutBounds,fanoutRoutingLayers:U.fanoutRoutingLayers,allowBlindAndBuriedVias:ee.allowBlindAndBuriedVias,componentNamesById:VWr(e),onSolverStarted:({solverName:Ze,solverParams:$e,solverConstructorArgs:qe})=>this.root?.emit("solver:started",{type:"solver:started",solverName:Ze,solverParams:$e,solverConstructorArgs:qe,componentName:this.getString()})});if(!mt)throw Error("Failed to create local autorouter");let We=mt,Le=new Promise((Ze,$e)=>{We.on("complete",(qe)=>{n(`[${this.getString()}] local autorouting complete`),Ze(qe.traces)}),We.on("error",(qe)=>{n(`[${this.getString()}] local autorouting error: ${qe.error.message}`),$e(qe.error)})});We.on("progress",(Ze)=>{this.root?.emit("autorouting:progress",{subcircuit_id:this.subcircuit_id,componentDisplayName:this.getString(),...U.phaseName!==void 0?{phaseName:U.phaseName,phaseStageIndex:K,phaseStageCount:J}:{},...rt,...Ze,type:"autorouting:progress"})}),We.start(),lt=await Le}let Nt=Ct??mt?.getOutputSimpleRouteJson?.();if(Y.preserveOutputTraces&&Nt?.traces)Nt={...Nt,traces:zY({accumulatedPcbTraces:ee.traces??[],stageOutputPcbTraces:Nt.traces})};if(Nt&&!X&&["fanout","single_layer_fanout","dogbone"].includes(j.preset??"")&&U.routingPcbGroupId){let We=$0i({fanoutInputSimpleRouteJson:ee,fanoutOutputSimpleRouteJson:Nt,baseSimpleRouteJson:y,routingPhasePlan:U});y=We.baseSimpleRouteJson,Nt=We.downstreamSimpleRouteJson;for(let Le of We.synchronizedBreakoutPoints){let Ze=e.pcb_breakout_point.list().find(($e)=>$e.pcb_group_id===Le.routingPcbGroupId&&$e.source_trace_id===Le.sourceTraceId&&Math.abs($e.x-Le.previousPoint.x)<=0.000001&&Math.abs($e.y-Le.previousPoint.y)<=0.000001);if(!Ze)continue;e.pcb_breakout_point.update(Ze.pcb_breakout_point_id,{x:Le.fanoutExitPoint.x,y:Le.fanoutExitPoint.y,layer:Le.fanoutExitPoint.layer})}}if(Y.preserveOutputTraces)for(let We of lt)L.add(We.pcb_trace_id);let Ht=lt;if(Nt?.traces)Ht=Nt.traces;else if(X)Ht=zY({accumulatedPcbTraces:ee.traces??[],stageOutputPcbTraces:lt});let Tt=Ht;if(!Nt&&!X&&U.routingPhaseIndex!==null)Tt=zY({accumulatedPcbTraces:ee.traces??[],stageOutputPcbTraces:lt});let et={...Nt??ee,traces:Tt};if(H=Nt?et:void 0,!nt&&ke)await V0i({cacheEngine:Ne,cacheKey:ke,result:{...ee,traces:lt}});let vt=_Vr({group:this.selectAll("group").find((We)=>We.pcb_group_id===U.fanoutRegionPcbGroupId)??U.autoroutingPhase?.getGroup()??this,subcircuit:this,input:ee,traces:lt,isFanout:["fanout","single_layer_fanout","dogbone"].includes(j.preset??"")});if(this.root?.emit("autorouting:end",{...vt,type:"autorouting:end",subcircuit_id:this.subcircuit_id,componentDisplayName:this.getString(),...U.phaseName!==void 0?{phaseName:U.phaseName,phaseStageIndex:K,phaseStageCount:J}:{},...rt,simpleRouteJson:et}),mt?.getConnectedOffboardObstacles){let We=mt.getConnectedOffboardObstacles();OWr({db:e,connectedOffboardObstacles:We,simpleRouteJson:ee,subcircuit_id:this.subcircuit_id})}let ht=mt?.solver;if(ht?.getOutputJumpers)P.push(...ht.getOutputJumpers()||[]);if(ne&&te){for(let Le of te.traces??[])if(Le.type==="pcb_trace")M.add(Le.pcb_trace_id);let We=ucn(te,{...ee,traces:[...ee.traces??[],...lt]});v.splice(0,v.length,...We.traces??[])}else if(re){let We=v.filter((Le)=>!T(Le,U));v.splice(0,v.length,...zY({accumulatedPcbTraces:We,stageOutputPcbTraces:Ht}))}else{if(se)for(let We of B){if(L.has(We.pcb_trace_id))continue;M.add(We.pcb_trace_id)}v.splice(0,v.length,...zY({accumulatedPcbTraces:v,stageOutputPcbTraces:Ht}))}}catch(lt){let{db:Ct}=this.root;throw Ct.pcb_autorouting_error.insert({pcb_error_id:`pcb_autorouter_error_subcircuit_${this.subcircuit_id}`,error_type:"pcb_autorouting_error",message:lt instanceof Error?lt.message:String(lt)}),this.root?.emit("autorouting:error",{type:"autorouting:error",subcircuit_id:this.subcircuit_id,componentDisplayName:this.getString(),...U.phaseName!==void 0?{phaseName:U.phaseName,phaseStageIndex:K,phaseStageCount:J}:{},...rt,error:{message:lt instanceof Error?lt.message:String(lt)},simpleRouteJson:ee}),lt}finally{mt?.stop()}}this._asyncAutoroutingResult={output_pcb_traces:v,output_jumpers:P,pcb_trace_ids_to_be_replaced:[...M]},this._markDirty("PcbTraceRender")}_startAsyncAutorouting(){if(this._hasStartedAsyncAutorouting)return;if(this._hasStartedAsyncAutorouting=!0,this._getAutorouterConfig().local)this._queueAsyncEffect("autorouting",async()=>{try{await this._runLocalAutorouting()}catch(e){if(!(e instanceof uPn))throw e;let{db:t}=this.root,n=`pcb_autorouter_error_subcircuit_${this.subcircuit_id}`;if(!t.pcb_autorouting_error.list().some((r)=>r.pcb_error_id===n&&r.message===e.message))t.pcb_autorouting_error.insert({pcb_error_id:n,error_type:"pcb_autorouting_error",message:e.message,subcircuit_id:this.subcircuit_id??void 0}),this.root?.emit("autorouting:error",{type:"autorouting:error",subcircuit_id:this.subcircuit_id,componentDisplayName:this.getString(),error:{message:e.message}});throw e}});else this._queueAsyncEffect("make-http-autorouting-request",async()=>this._runEffectMakeHttpAutoroutingRequest())}doInitialPcbTraceRender(){let e=GJ.default("tscircuit:core:doInitialPcbTraceRender");if(!this.isSubcircuit)return;if(this.root?.pcbDisabled)return;if(this.root?.pcbRoutingDisabled||this.getInheritedProperty("routingDisabled"))return;if(this._isInflatedFromCircuitJson)return;if(this._isLegacyAutorouterDisabled())return;if(this._shouldUseTraceByTraceRouting())return;if(!this._areChildSubcircuitsRouted()){e(`[${this.getString()}] child subcircuits are not routed, skipping async autorouting until subcircuits routed`);return}if(e(`[${this.getString()}] no child subcircuits to wait for, initiating async routing`),!this._hasTracesToRoute())return;let t=Brt({component:this,subcircuit:this}),n=Trt({component:this,subcircuit:this});if(t||n)return;this._startAsyncAutorouting()}doInitialSchematicTraceRender(){if(this._parsedProps.showAsSchematicBox)return;i0i(this)}doInitialSchematicSheetRender(){jSn(this)}updateSchematicSheetRender(){Iui(this)}updatePcbTraceRender(){let e=GJ.default("tscircuit:core:updatePcbTraceRender");if(e(`[${this.getString()}] updating...`),!this.isSubcircuit)return;if(this.root?.pcbDisabled)return;if(this.root?.pcbRoutingDisabled||this.getInheritedProperty("routingDisabled"))return;if(this._isInflatedFromCircuitJson)return;if(this._isLegacyAutorouterDisabled())return;if(this._shouldRouteAsync()&&this._hasTracesToRoute()&&!this._hasStartedAsyncAutorouting){if(this._areChildSubcircuitsRouted()){let n=Brt({component:this,subcircuit:this}),o=Trt({component:this,subcircuit:this});if(n||o)return;e(`[${this.getString()}] child subcircuits are now routed, starting async autorouting`),this._startAsyncAutorouting()}return}if(!this._asyncAutoroutingResult)return;if(this._shouldUseTraceByTraceRouting())return;let{db:t}=this.root;if(this._asyncAutoroutingResult.output_simple_route_json){e(`[${this.getString()}] updating PCB traces from simple route json (${this._asyncAutoroutingResult.output_simple_route_json.traces?.length} traces)`),this._updatePcbTraceRenderFromSimpleRouteJson();return}if(this._asyncAutoroutingResult.output_pcb_traces){e(`[${this.getString()}] updating PCB traces from ${this._asyncAutoroutingResult.output_pcb_traces.length} traces`),this._updatePcbTraceRenderFromPcbTraces();return}}_updatePcbTraceRenderFromSimpleRouteJson(){let{db:e}=this.root,{traces:t}=this._asyncAutoroutingResult.output_simple_route_json;if(!t)return;for(let n of t){let o=n.route.map((i)=>{if(i.route_type!=="through_obstacle")return i;return{route_type:"through_pad",start:i.start,end:i.end,start_layer:i.from_layer,end_layer:i.to_layer,width:i.width,circuitJsonMetadata:i.circuitJsonMetadata}}),r=e.pcb_trace.insert({subcircuit_id:this.subcircuit_id,route:wrt(o)});V5n({db:e,pcbTrace:r,routeWithSrjMetadata:o})}}_updatePcbTraceRenderFromPcbTraces(){let{output_pcb_traces:e,output_jumpers:t,pcb_trace_ids_to_be_replaced:n}=this._asyncAutoroutingResult;if(!e)return;let{db:o}=this.root,r=this.getInheritedMergedProperty("pcbStyle"),{holeDiameter:i,padDiameter:s}=cT(r),a=this._getBoard(),c=a?.pcb_board_id?o.pcb_board.get(a.pcb_board_id):o.pcb_board.list()[0],l=c?.min_via_hole_diameter??i,h=c?.min_via_pad_diameter??s;if(t&&t.length>0)upi({db:o,output_jumpers:t,subcircuit_id:this.subcircuit_id});_pi({group:this,outputPcbTraces:e,pcbTraceIdsToReplace:n});let d=o.pcb_via.list(),u=q0i(o);for(let _ of e){if(_.type!=="pcb_trace")continue;_.subcircuit_id??=this.subcircuit_id;let p=_.route.map((f)=>{if(f.route_type!=="through_obstacle")return f;return{route_type:"through_pad",start:f.start,end:f.end,start_layer:f.from_layer,end_layer:f.to_layer,width:f.width,circuitJsonMetadata:f.circuitJsonMetadata}}),m=lrt({db:o,trace:{..._,route:p},subcircuit_id:this.subcircuit_id});p=fpi({db:o,route:p,routeThicknessMode:_.route_thickness_mode,sourceTraceId:m}),_.route=p;let A=Api(p);if(A===null)A=[p];let g=epi(A,u);for(let f of g)if(f.length>0){let y=wrt(f),x=lrt({db:o,trace:{..._,route:y},subcircuit_id:this.subcircuit_id}),C=o.pcb_trace.insert({..._,source_trace_id:x,route:y});V5n({db:o,pcbTrace:C,routeWithSrjMetadata:f})}}for(let _ of e){if(_.type==="pcb_via")continue;if(_.type==="pcb_trace"){let p=lrt({db:o,trace:_,subcircuit_id:this.subcircuit_id}),{connection_name:m}=_,A;if(p)A=o.source_trace.get(p)?.subcircuit_connectivity_map_key;if(!A&&m){let g=o.source_net.get(m);if(g)A=g.subcircuit_connectivity_map_key}for(let g of _.route)if(g.route_type==="via"){let f=g,{from_layer:y,to_layer:x}=g,C={pcb_trace_id:_.pcb_trace_id,x:g.x,y:g.y,hole_diameter:f.via_hole_diameter??f.hole_diameter??l,outer_diameter:f.via_diameter??f.outer_diameter??h,layers:L4n({fromLayer:y,toLayer:x,layerCount:this._getSubcircuitLayerCount(),allowBlindAndBuriedVias:c?.allow_blind_and_buried_vias??!1,physicalLayers:f.layers}),from_layer:y,to_layer:x,subcircuit_id:this.subcircuit_id,pcb_group_id:this.pcb_group_id??void 0,subcircuit_connectivity_map_key:A};if(d.some((b)=>zWr(b,C)))continue;d.push(o.pcb_via.insert(C))}}}}doInitialSchematicComponentRender(){if(this.root?.schematicDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,n=e.schematic_group.insert({is_subcircuit:this.isSubcircuit,subcircuit_id:this.subcircuit_id,name:this.name,center:this._getGlobalSchematicPositionBeforeLayout(),width:0,height:0,schematic_component_ids:[],source_group_id:this.source_group_id,show_as_schematic_box:t.showAsSchematicBox??!1});if(this.schematic_group_id=n.schematic_group_id,t.showAsSchematicBox)eui(this);for(let o of this.getDescendants()){if(o.getGroup()?.source_group_id!==this.source_group_id)continue;if(o._parsedProps?.showAsSchematicBox)continue;if(o.schematic_component_id)e.schematic_component.update(o.schematic_component_id,{schematic_group_id:n.schematic_group_id})}}_getSchematicLayoutMode(){let e=this._parsedProps,t=e.schAutoLayoutEnabled??!1;if(e.schLayout?.layoutMode==="none")return"relative";if(e.schLayout?.layoutMode==="relative")return"relative";if(e.schLayout?.matchAdapt)return"match-adapt";if(e.schLayout?.flex)return"flex";if(e.schLayout?.grid)return"grid";if(e.schMatchAdapt)return"match-adapt";if(e.schFlex)return"flex";if(e.schGrid)return"grid";if(e.matchAdapt)return"match-adapt";if(e.flex)return"flex";if(e.grid)return"grid";if(e.relative)return"relative";if(e.schRelative)return"relative";let n=this.children.some((r)=>{let i=r._parsedProps;return(r.source_component_id!==null||r.source_group_id!==null)&&(i?.schX!==void 0||i?.schY!==void 0)}),o=(e.manualEdits?.schematic_placements?.length??0)>0;if(t&&!o)return"match-adapt";if(!n&&!o)return"match-adapt";return"relative"}doInitialSchematicLayout(){if(this._parsedProps.showAsSchematicBox){this._insertSchematicBorder();return}if(this.children.some((o)=>o.source_component_id!==null&&o._parsedProps?.schSectionName!==void 0)){this._doInitialSchematicLayoutSections(),this._insertSchematicBorder();return}let n=this._getSchematicLayoutMode();if(n==="match-adapt")this._doInitialSchematicLayoutMatchpack();if(n==="grid")this._doInitialSchematicLayoutGrid();if(n==="flex")this._doInitialSchematicLayoutFlex();this._insertSchematicBorder()}_doInitialSchematicLayoutSections(){Cui(this)}_doInitialSchematicLayoutMatchAdapt(){oui(this)}_doInitialSchematicLayoutMatchpack(){fui(this)}_doInitialSchematicLayoutGrid(){nui(this)}_doInitialSchematicLayoutFlex(){tui(this)}_getPcbLayoutMode(){let e=this._parsedProps,t=this.props;if(this._isInflatedFromCircuitJson)return"none";if(e.pcbRelative)return"none";if(e.pcbLayout?.matchAdapt)return"match-adapt";if(e.pcbLayout?.flex)return"flex";if(e.pcbLayout?.grid)return"grid";if(e.pcbLayout?.pack)return"pack";if(e.pcbFlex)return"flex";if(e.pcbGrid)return"grid";if(e.pcbPack)return"pack";if(e.pack)return"pack";if(e.matchAdapt)return"match-adapt";if(e.flex)return"flex";if(e.grid)return"grid";let n=e.pcbX!==void 0||e.pcbY!==void 0||e.pcbLeftEdgeX!==void 0||e.pcbRightEdgeX!==void 0||e.pcbTopEdgeY!==void 0||e.pcbBottomEdgeY!==void 0||t.pcbLeftEdgeX!==void 0||t.pcbRightEdgeX!==void 0||t.pcbTopEdgeY!==void 0||t.pcbBottomEdgeY!==void 0,o=(e.manualEdits?.pcb_placements?.length??0)>0,r=this.children.reduce((i,s)=>{if(!s.pcb_component_id&&!s.pcb_group_id)return i;let{_parsedProps:a,props:c}=s,l=a?.pcbX!==void 0||a?.pcbY!==void 0||a?.pcbLeftEdgeX!==void 0||a?.pcbRightEdgeX!==void 0||a?.pcbTopEdgeY!==void 0||a?.pcbBottomEdgeY!==void 0||c?.pcbLeftEdgeX!==void 0||c?.pcbRightEdgeX!==void 0||c?.pcbTopEdgeY!==void 0||c?.pcbBottomEdgeY!==void 0;return i+(l?0:1)},0);if(!o&&r>1)return"pack";return"none"}doInitialPcbLayout(){if(this.root?.pcbDisabled)return;if(this.pcb_group_id){let{db:t}=this.root,n=this._parsedProps;if(n.pcbX!==void 0||n.pcbY!==void 0){let r=this.parent?.getGroup?.(),i=r?.pcb_group_id?t.pcb_group.get(r.pcb_group_id)?.pcb_group_id:void 0,s=!i?this._getBoard()?.pcb_board_id??void 0:void 0;t.pcb_group.update(this.pcb_group_id,{position_mode:"relative_to_group_anchor",positioned_relative_to_pcb_group_id:i,positioned_relative_to_pcb_board_id:s,display_offset_x:n.pcbX,display_offset_y:n.pcbY})}}let e=this._getPcbLayoutMode();if(e==="grid")this._doInitialPcbLayoutGrid();else if(e==="pack")this._doInitialPcbLayoutPack();else if(e==="flex")this._doInitialPcbLayoutFlex()}_doInitialPcbLayoutGrid(){Rdi(this)}_doInitialPcbLayoutPack(){$di(this)}_doInitialPcbLayoutFlex(){Ndi(this)}_insertSchematicBorder(){if(this.root?.schematicDisabled)return;let{db:e}=this.root,t=this._parsedProps;if(!t.border)return;let n=typeof t.schWidth==="number"?t.schWidth:void 0,o=typeof t.schHeight==="number"?t.schHeight:void 0,r=typeof t.schPadding==="number"?t.schPadding:0,i=typeof t.schPaddingLeft==="number"?t.schPaddingLeft:r,s=typeof t.schPaddingRight==="number"?t.schPaddingRight:r,a=typeof t.schPaddingTop==="number"?t.schPaddingTop:r,c=typeof t.schPaddingBottom==="number"?t.schPaddingBottom:r,l=this.schematic_group_id?e.schematic_group.get(this.schematic_group_id):null;if(l){if(n===void 0&&typeof l.width==="number")n=l.width;if(o===void 0&&typeof l.height==="number")o=l.height}if(n===void 0||o===void 0)return;let h=l?.center??this._getGlobalSchematicPositionBeforeLayout(),d=h.x-n/2-i,u=h.y-o/2-c,_=n+i+s,p=o+a+c;e.schematic_box.insert({width:_,height:p,x:d,y:u,is_dashed:t.border?.dashed??!1})}_determineSideFromPosition(e,t){if(!e.center||!t.center)return"left";let n=e.center.x-t.center.x,o=e.center.y-t.center.y;if(Math.abs(n)>Math.abs(o))return n>0?"right":"left";return o>0?"bottom":"top"}_calculateSchematicBounds(e){if(e.length===0)return{minX:0,maxX:0,minY:0,maxY:0};let t=1/0,n=-1/0,o=1/0,r=-1/0;for(let s of e)t=Math.min(t,s.centerX),n=Math.max(n,s.centerX),o=Math.min(o,s.centerY),r=Math.max(r,s.centerY);let i=2;return{minX:t-i,maxX:n+i,minY:o-i,maxY:r+i}}_getAutorouterConfig(){let e=this._parsedProps.autorouter||this.getInheritedProperty("autorouter");return Yde(e,this.root?.platform)}_isLegacyAutorouterDisabled(){return W5n(this)!==null}_isLaserPrefabAutorouter(e=this._getAutorouterConfig()){let t=this.props.autorouter,n=(o)=>o?.replace(/-/g,"_")??o;if(e.preset==="laser_prefab")return!0;if(typeof t==="string")return n(t)==="laser_prefab";if(typeof t==="object"&&t)return n(t.preset)==="laser_prefab";return!1}_isAutoJumperAutorouter(e=this._getAutorouterConfig()){let t=this.props.autorouter,n=(o)=>o?.replace(/-/g,"_")??o;if(e.preset==="auto_jumper")return!0;if(typeof t==="string")return n(t)==="auto_jumper";if(typeof t==="object"&&t)return n(t.preset)==="auto_jumper";return!1}_getSubcircuitLayerCount(){let e=this.getInheritedProperty("layers");return typeof e==="number"?e:2}_shouldUseTraceByTraceRouting(){if(fPn(this))return!1;return this._getAutorouterConfig().groupMode==="sequential-trace"}doInitialPcbDesignRuleChecks(){if(this.root?.pcbDisabled)return;if(this._isLegacyAutorouterDisabled())return;if(this.root?.pcbRoutingDisabled||this.getInheritedProperty("routingDisabled"))return;let{db:e}=this.root;if(this.isSubcircuit){let t=new Map;for(let n of this.children){if(n.isSubcircuit)continue;if(n._parsedProps.name){let o=t.get(n._parsedProps.name)||[];o.push(n),t.set(n._parsedProps.name,o)}}for(let[n,o]of t.entries()){if(o.length<=1)continue;let r=o.filter((c)=>c instanceof O_),i=r.length===o.length,s=r.map((c)=>c.subcircuit_connectivity_map_key),a=i&&s.every(Boolean)&&new Set(s).size===1;if(!i||!a){let c=this.name||"unnamed",l=i?`Trace "${n}" in subcircuit "${c}" shares a name with another trace, but the traces are not mutually connected. Same-named traces must have the same subcircuit connectivity map key.`:`Multiple immediate children found with name "${n}" in subcircuit "${c}". Names must be unique.`;e.pcb_trace_error.insert({error_type:"pcb_trace_error",message:l,source_trace_id:"",pcb_trace_id:"",pcb_component_ids:o.map((h)=>h.pcb_component_id).filter(Boolean),pcb_port_ids:[]})}}}w0i(this)}doInitialSchematicLabelNetsWithConflictingNames(){if(this.root?.schematicDisabled)return;if(this.getTopLevelRenderable()!==this)return;AVr(this.root.db)}updateSchematicLabelNetsWithConflictingNames(){this.doInitialSchematicLabelNetsWithConflictingNames()}doInitialSchematicReplaceNetLabelsWithSymbols(){if(this.root?.schematicDisabled)return;if(!this.isSubcircuit)return;let{db:e}=this.root,t=e;for(let n of t.schematic_net_label.list()){let o=t.source_net.get(n.source_net_id),r=n.text||o?.name||"",i=o?.is_ground||Yue.test(r),s=o?.is_power||wst.test(r);if(n.anchor_side==="top"&&i){t.schematic_net_label.update(n.schematic_net_label_id,{symbol_name:"rail_down"});continue}if(n.anchor_side==="bottom"&&s)t.schematic_net_label.update(n.schematic_net_label_id,{symbol_name:"rail_up"})}}doInitialSimulationSpiceEngineRender(){E0i(this)}doInitialPcbComponentAnchorAlignment(){Ddi(this)}updatePcbComponentAnchorAlignment(){this.doInitialPcbComponentAnchorAlignment()}doInitialPcbCalcPlacementResolution(){Pdi(this)}updatePcbCalcPlacementResolution(){this.doInitialPcbCalcPlacementResolution()}_getMinimumFlexContainerSize(){return super._getMinimumFlexContainerSize()}_repositionOnPcb(e){return super._repositionOnPcb(e)}};function ypi(e,t){let{injectionDb:n,subcircuit:o,groupsMap:r}=t,i=n.pcb_group.getWhere({source_group_id:e.source_group_id}),s={name:e.name??`inflated_group_${e.source_group_id}`};if(i?.position_mode==="relative_to_group_anchor"&&i.anchor_position){let c={x:0,y:0};if(e.parent_source_group_id){let l=n.pcb_group.getWhere({source_group_id:e.parent_source_group_id});if(l?.anchor_position)c=l.anchor_position}s.pcbX=i.anchor_position.x-c.x,s.pcbY=i.anchor_position.y-c.y}if(i?.anchor_alignment)s.pcbAnchorAlignment=i.anchor_alignment;let a=new UP(s);if(a._isInflatedFromCircuitJson=!0,a.source_group_id=e.source_group_id,r)r.set(e.source_group_id,a);if(e.parent_source_group_id&&r?.has(e.parent_source_group_id))r.get(e.parent_source_group_id).add(a);else o.add(a);return a}var yPn=class extends Xl{_adjustSilkscreenTextAutomatically=!0;get config(){return{componentName:"Inductor",schematicSymbolName:this.props.symbolName??"inductor",zodProps:xPt,sourceFtype:LP.simple_inductor}}_getSchematicSymbolDisplayValue(){return`${vd(this._parsedProps.inductance)}H`}initPorts(){super.initPorts({additionalAliases:{pin1:["anode","pos","left"],pin2:["cathode","neg","right"]}})}doInitialSourceRender(){let{db:e}=this.root,{_parsedProps:t}=this,n=e.source_component.insert({name:this.name,ftype:LP.simple_inductor,inductance:this.props.inductance,max_current_rating:t.maxCurrentRating===void 0?void 0:Ta(t.maxCurrentRating,"A").value,display_inductance:this._getSchematicSymbolDisplayValue(),supplier_part_numbers:t.supplierPartNumbers,manufacturer_part_number:hi(t),are_pins_interchangeable:!0,display_name:t.displayName});this.source_component_id=n.source_component_id}};function xpi(e,t){let{injectionDb:n,subcircuit:o,groupsMap:r}=t,i=n.pcb_component.getWhere({source_component_id:e.source_component_id}),s=n.cad_component.getWhere({source_component_id:e.source_component_id}),{pcbX:a,pcbY:c}=w6({pcbComponent:i,sourceGroupId:e.source_group_id,inflatorContext:t}),l=new yPn({name:e.name,inductance:e.inductance,layer:i?.layer,pcbX:a,pcbY:c,pcbRotation:i?.rotation,doNotPlace:i?.do_not_place,obstructsWithinBounds:i?.obstructs_within_bounds});if(i){let h=M6(i,{...t,normalComponent:l});if(h)l.add(h)}if(e.source_group_id&&r?.has(e.source_group_id))r.get(e.source_group_id).add(l);else o.add(l)}var drt=new WeakMap,X5n=(e)=>{let t=[e.name,...e.port_hints??[]].map((r)=>r.toLowerCase().replace(/[^a-z0-9+-]/g,"")),n=t.some((r)=>["a","anode","pos","positive","+"].includes(r)),o=t.some((r)=>["k","c","cathode","neg","negative","-"].includes(r));if(n===o)return null;return n?"anode":"cathode"},Cpi=(e)=>{let t=e.root;if(!t)return;let{db:n}=t,o=drt.get(e);for(let C of o??[])n.pcb_fabrication_note_path.delete(C.pcb_fabrication_note_path_id);if(drt.delete(e),t.pcbDisabled||!e.pcb_component_id)return;let r=n.pcb_component.get(e.pcb_component_id);if(!r||r.layer!=="top"&&r.layer!=="bottom")return;let i=n.source_port.list({source_component_id:e.source_component_id}),s=i.filter((C)=>X5n(C)==="anode"),a=i.filter((C)=>X5n(C)==="cathode");if(s.length!==1||a.length!==1)return;let c=s[0],l=a[0],h=n.pcb_port.getWhere({source_port_id:c.source_port_id}),d=n.pcb_port.getWhere({source_port_id:l.source_port_id});if(!h||!d)return;let u=Math.hypot(d.x-h.x,d.y-h.y);if(u<0.000001)return;let _=Math.atan2(d.y-h.y,d.x-h.x),p=Hi(Ii((h.x+d.x)/2,(h.y+d.y)/2),Yg(_)),m=(C,b)=>_o(p,{x:C,y:b}),A={pcb_component_id:r.pcb_component_id,subcircuit_id:e.getSubcircuit()?.subcircuit_id??void 0,layer:r.layer},g=[];drt.set(e,g);let f=Math.min(u*0.2,0.4),y=f*0.75,x=[[m(-u/2,0),m(-f,0)],[m(-f,-y),m(f,0),m(-f,y),m(-f,-y)],[m(f,-y),m(f,y)],[m(f,0),m(u/2,0)]];for(let C of x)g.push(n.pcb_fabrication_note_path.insert({...A,route:C,stroke_width:0.08}))},xPn=class extends Xl{get config(){let e={laser:"laser_diode"},t=this.props.laser?"laser":null,n=t?e[t]:this.props.symbolName??"led",o=this.props.schSize==="sm"||this.props.schSize==="xs"?this.props.schSize:void 0,r=o&&n==="led"?`led_${o}`:void 0;return{schematicSymbolName:r&&`${r}_right`in zs?r:n,componentName:"Led",zodProps:IPt,sourceFtype:"simple_led"}}initPorts(){let e=this.children.some((r)=>r.componentName==="Footprint"),t=this.resolveFootprint(),n=Boolean(this._resolvePinLabels()),o=!n&&!e&&(!t||Y3n(t));super.initPorts({pinCount:2,ignoreSymbolPorts:!n&&!o,additionalAliases:{pin1:o?["anode","pos","left"]:[],pin2:o?["cathode","neg","right"]:[]}})}_getSchematicSymbolDisplayValue(){return this._parsedProps.schDisplayValue||this._parsedProps.color||void 0}getFootprinterString(){let e=super.getFootprinterString();if(e&&this.props.color)return`${e}_color(${this.props.color})`;return e}doInitialSourceRender(){let{db:e}=this.root,{_parsedProps:t}=this,n=e.source_component.insert({ftype:"simple_led",name:this.name,wave_length:t.wavelength,color:t.color,symbol_display_value:this._getSchematicSymbolDisplayValue(),manufacturer_part_number:hi(t),supplier_part_numbers:t.supplierPartNumbers,are_pins_interchangeable:!1,display_name:t.displayName});this.source_component_id=n.source_component_id}get pos(){return this.portMap.pos}doInitialPcbComponentSizeCalculation(){super.doInitialPcbComponentSizeCalculation(),Cpi(this)}get anode(){return this.portMap.anode}get neg(){return this.portMap.neg}get cathode(){return this.portMap.cathode}};function bpi(e,t){let{injectionDb:n,subcircuit:o,groupsMap:r}=t,i=n.pcb_component.getWhere({source_component_id:e.source_component_id}),s=n.cad_component.getWhere({source_component_id:e.source_component_id}),{pcbX:a,pcbY:c}=w6({pcbComponent:i,sourceGroupId:e.source_group_id,inflatorContext:t}),l=new xPn({name:e.name,color:e.color,wavelength:e.wavelength??e.wave_length,layer:i?.layer,pcbX:a,pcbY:c,pcbRotation:i?.rotation,doNotPlace:i?.do_not_place,obstructsWithinBounds:i?.obstructs_within_bounds});if(i){let h=M6(i,{...t,normalComponent:l});if(h)l.add(h)}if(e.source_group_id&&r?.has(e.source_group_id))r.get(e.source_group_id).add(l);else o.add(l)}var Ipi=[{gate:"left",drain:"top",source:"bottom"},{gate:"left",drain:"bottom",source:"top"},{gate:"right",drain:"top",source:"bottom"},{gate:"right",drain:"bottom",source:"top"},{gate:"top",drain:"left",source:"right"},{gate:"top",drain:"right",source:"left"},{gate:"bottom",drain:"left",source:"right"},{gate:"bottom",drain:"right",source:"left"}],vpi=(e)=>{let t=(e%360+360)%360;if(t%90!==0)throw Error(`Schematic rotation ${e} is not supported for Mosfet`);return[{gate:"left",drain:"top",source:"bottom"},{gate:"top",drain:"right",source:"left"},{gate:"right",drain:"bottom",source:"top"},{gate:"bottom",drain:"left",source:"right"}][t/90]},Spi=(e)=>{let t={drain:e.symbolDrainSide,source:e.symbolSourceSide,gate:e.symbolGateSide},n=vpi(Number(e.schRotation??0)),o=Ipi.filter((r)=>Object.keys(t).every((i)=>t[i]===void 0||t[i]===r[i]));if(o.length===0){let r=Object.entries(t).filter(([,i])=>i!==void 0).map(([i,s])=>`${i}=${s}`).join(", ");throw Error(`Invalid MOSFET symbol port side combination (${r}). The gate must be perpendicular to the drain and source, and the drain and source must be opposite.`)}return o.sort((r,i)=>{let s=(a)=>Object.keys(n).filter((c)=>a[c]!==n[c]).length;return s(r)-s(i)})[0]},Ppi=(e)=>{let t=e.mosfetMode==="depletion"?"d":"e",n=`${e.channelType}_channel_${t}_mosfet_transistor`;if(!(e.symbolDrainSide!==void 0||e.symbolSourceSide!==void 0||e.symbolGateSide!==void 0))return n;let{gate:r,drain:i}=Spi(e);return`${n}_gate_${r}_drain_${i}`},CPn=class extends Xl{get config(){return{componentName:"Mosfet",schematicSymbolName:this.props.symbolName??Ppi(this.props),zodProps:fPt,shouldRenderAsSchematicBox:!1}}doInitialSourceRender(){let{db:e}=this.root,{_parsedProps:t}=this,n=e.source_component.insert({ftype:"simple_mosfet",name:this.name,manufacturer_part_number:hi(t),supplier_part_numbers:t.supplierPartNumbers,mosfet_mode:t.mosfetMode,channel_type:t.channelType,display_name:t.displayName});this.source_component_id=n.source_component_id}};function Epi(e,t){let{injectionDb:n,subcircuit:o,groupsMap:r}=t,i=n.pcb_component.getWhere({source_component_id:e.source_component_id}),{pcbX:s,pcbY:a}=w6({pcbComponent:i,sourceGroupId:e.source_group_id,inflatorContext:t}),c=new CPn({name:e.name,channelType:e.channel_type,mosfetMode:e.mosfet_mode,manufacturerPartNumber:e.manufacturer_part_number,supplierPartNumbers:e.supplier_part_numbers??void 0,displayName:e.display_name,layer:i?.layer,pcbX:s,pcbY:a,pcbRotation:i?.rotation,doNotPlace:i?.do_not_place,obstructsWithinBounds:i?.obstructs_within_bounds});if(i){let l=M6(i,{...t,normalComponent:c});if(l)c.add(l)}if(e.source_group_id&&r?.has(e.source_group_id))r.get(e.source_group_id).add(c);else o.add(c)}function Mpi(e,t){let{injectionDb:n,subcircuit:o}=t;if(e.source_component_id!==null)return;let r=n.pcb_port.getWhere({source_port_id:e.source_port_id}),i=new sd({name:e.name,pinNumber:e.pin_number});o.add(i),i.source_port_id=e.source_port_id;let s=o.root;if(s&&r){let{db:a}=s,c=a.pcb_port.insert({pcb_component_id:void 0,layers:r.layers,subcircuit_id:o.subcircuit_id??void 0,pcb_group_id:o.getGroup()?.pcb_group_id??void 0,x:r.x,y:r.y,source_port_id:e.source_port_id,is_board_pinout:!1});i.pcb_port_id=c.pcb_port_id}}var bPn=class extends Xl{get config(){return{componentName:"PushButton",schematicSymbolName:this.props.symbolName??"push_button_normally_open_momentary",zodProps:oPt,sourceFtype:LP.simple_push_button}}get defaultInternallyConnectedPinNames(){return[]}initPorts(){super.initPorts({pinCount:2,ignoreSymbolPorts:!0});let e=zs[this._getSchematicSymbolNameOrThrow()],t=e.ports.find((a)=>a.labels.includes("1")),n=e.ports.find((a)=>a.labels.includes("2")),o=this.selectAll("port"),r=o.find((a)=>a.props.pinNumber===1);r.schematicSymbolPortDef=t;let i=new Set(r._getPortsInternallyConnectedToThisPort()),s=o.filter((a)=>a!==r&&!i.has(a)).sort((a,c)=>(a.props.pinNumber??0)-(c.props.pinNumber??0))[0];if(s)s.schematicSymbolPortDef=n}doInitialSourceRender(){let{db:e}=this.root,{_parsedProps:t}=this,n=e.source_component.insert({name:this.name,ftype:LP.simple_push_button,supplier_part_numbers:t.supplierPartNumbers,manufacturer_part_number:hi(t),are_pins_interchangeable:!0,display_name:t.displayName});this.source_component_id=n.source_component_id}};function wpi(e,t){let{injectionDb:n,subcircuit:o,groupsMap:r}=t,i=n.pcb_component.getWhere({source_component_id:e.source_component_id}),s=n.cad_component.getWhere({source_component_id:e.source_component_id}),{pcbX:a,pcbY:c}=w6({pcbComponent:i,sourceGroupId:e.source_group_id,inflatorContext:t}),l=new bPn({name:e.name,layer:i?.layer,pcbX:a,pcbY:c,pcbRotation:i?.rotation,doNotPlace:i?.do_not_place,obstructsWithinBounds:i?.obstructs_within_bounds});if(i){let h=M6(i,{...t,normalComponent:l});if(h)l.add(h)}if(e.source_group_id&&r?.has(e.source_group_id))r.get(e.source_group_id).add(l);else o.add(l)}var IPn=class extends Xl{_adjustSilkscreenTextAutomatically=!0;get config(){let e=this.props.symbolName??"boxresistor",t=this.props.schSize==="sm"||this.props.schSize==="xs"?this.props.schSize:void 0,n=t&&(e==="boxresistor"||e==="resistor")?`${e}_${t}`:void 0;return{componentName:"Resistor",schematicSymbolName:n&&`${n}_right`in zs?n:e,zodProps:wSt,sourceFtype:"simple_resistor"}}initPorts(){super.initPorts({additionalAliases:{pin1:["anode","pos","left"],pin2:["cathode","neg","right"]}})}_getSchematicSymbolDisplayValue(){return`${vd(this._parsedProps.resistance)}Ω`}doInitialCreateNetsFromProps(){this._createNetsFromProps([this.props.pullupFor,this.props.pullupTo,this.props.pulldownFor,this.props.pulldownTo,...this._getNetsFromConnectionsProp()])}doInitialCreateTracesFromProps(){if(this.props.pullupFor&&this.props.pullupTo)this.add(new O_({from:`${this.getSubcircuitSelector()} > port.1`,to:this.props.pullupFor})),this.add(new O_({from:`${this.getSubcircuitSelector()} > port.2`,to:this.props.pullupTo}));if(this.props.pulldownFor&&this.props.pulldownTo)this.add(new O_({from:`${this.getSubcircuitSelector()} > port.1`,to:this.props.pulldownFor})),this.add(new O_({from:`${this.getSubcircuitSelector()} > port.2`,to:this.props.pulldownTo}));this._createTracesFromConnectionsProp()}doInitialSourceRender(){let{db:e}=this.root,{_parsedProps:t}=this,n=e.source_component.insert({ftype:"simple_resistor",name:this.name,manufacturer_part_number:hi(t),supplier_part_numbers:t.supplierPartNumbers,resistance:t.resistance,display_resistance:this._getSchematicSymbolDisplayValue(),are_pins_interchangeable:!0,display_name:t.displayName});this.source_component_id=n.source_component_id}};function Bpi(e,t){let{injectionDb:n,subcircuit:o,groupsMap:r}=t,i=n.pcb_component.getWhere({source_component_id:e.source_component_id}),s=n.cad_component.getWhere({source_component_id:e.source_component_id}),{pcbX:a,pcbY:c}=w6({pcbComponent:i,sourceGroupId:e.source_group_id,inflatorContext:t}),l=new IPn({name:e.name,resistance:e.resistance,layer:i?.layer,pcbX:a,pcbY:c,pcbRotation:i?.rotation,doNotPlace:i?.do_not_place,obstructsWithinBounds:i?.obstructs_within_bounds});if(i){let h=M6(i,{...t,normalComponent:l});if(h)l.add(h)}if(e.source_group_id&&r?.has(e.source_group_id))r.get(e.source_group_id).add(l);else o.add(l)}function Tpi(e){return e.simSwitchFrequency!==void 0||e.simCloseAt!==void 0||e.simOpenAt!==void 0||e.simStartClosed!==void 0||e.simStartOpen!==void 0}var vPn=class extends Xl{_getSwitchType(){let e=this._parsedProps;if(!e)return"spst";if(e.dpdt)return"dpdt";if(e.spst)return"spst";if(e.spdt)return"spdt";if(e.dpst)return"dpst";return e.type??"spst"}get config(){let e=this._getSwitchType(),t=this._parsedProps?.isNormallyClosed??!1,n={spst:t?"spst_normally_closed_switch":"spst_switch",spdt:t?"spdt_normally_closed_switch":"spdt_switch",dpst:t?"dpst_normally_closed_switch":"dpst_switch",dpdt:t?"dpdt_normally_closed_switch":"dpdt_switch"};return{componentName:"Switch",schematicSymbolName:this.props.symbolName??n[e],zodProps:SPt,shouldRenderAsSchematicBox:!1}}doInitialSourceRender(){let{db:e}=this.root,t=this._parsedProps??{},n=e.source_component.insert({ftype:"simple_switch",name:this.name,manufacturer_part_number:hi(t),supplier_part_numbers:t.supplierPartNumbers,are_pins_interchangeable:this._getSwitchType()==="spst",display_name:t?.displayName});this.source_component_id=n.source_component_id}doInitialSimulationRender(){let{_parsedProps:e}=this;if(!Tpi(e))return;let{db:t}=this.root,n={type:"simulation_switch",source_component_id:this.source_component_id||""};if(e.simSwitchFrequency!==void 0)n.switching_frequency=Xp.parse(e.simSwitchFrequency);if(e.simCloseAt!==void 0)n.closes_at=wc.parse(e.simCloseAt);if(e.simOpenAt!==void 0)n.opens_at=wc.parse(e.simOpenAt);if(e.simStartOpen!==void 0)n.starts_closed=!e.simStartOpen;if(e.simStartClosed!==void 0)n.starts_closed=e.simStartClosed;t.simulation_switch.insert(n)}},Dpi=(e,t)=>{let n=t.injectionDb.source_port.list().filter((s)=>s.source_component_id===e.source_component_id),o={},r=0;for(let s of n){let a=s.pin_number;if(a===void 0||a===null)continue;r=Math.max(r,a);let c=Array.from(new Set([s.name,...s.port_hints??[]].filter((l)=>typeof l==="string"&&l.length>0)));if(c.length>0)o[`pin${a}`]=c}let i="spst";if(r>=5)i="dpdt";else if(r===4)i="dpst";else if(r===3)i="spdt";return{type:i,pinLabels:Object.keys(o).length>0?o:void 0}};function Npi(e,t){let{injectionDb:n,subcircuit:o,groupsMap:r}=t,i=n.pcb_component.getWhere({source_component_id:e.source_component_id}),{pcbX:s,pcbY:a}=w6({pcbComponent:i,sourceGroupId:e.source_group_id,inflatorContext:t}),c=Dpi(e,t),l=new vPn({name:e.name,displayName:e.display_name,...c,layer:i?.layer,pcbX:s,pcbY:a,pcbRotation:i?.rotation,doNotPlace:i?.do_not_place,obstructsWithinBounds:i?.obstructs_within_bounds});if(i){let h=M6(i,{...t,normalComponent:l});if(h)l.add(h)}if(e.source_group_id&&r?.has(e.source_group_id))r.get(e.source_group_id).add(l);else o.add(l)}function Rpi(e){if(e.length<=2)return[];let t=e[0],n=e[e.length-1];return e.slice(1,-1).filter((o)=>{let r=Xk(o),i=Xk(t),s=Xk(n),a=r.x===i.x&&r.y===i.y,c=r.x===s.x&&r.y===s.y;return!a&&!c}).map((o)=>{if(o.route_type==="via")return{x:o.x,y:o.y,via:!0,fromLayer:o.from_layer,toLayer:o.to_layer};let r=Xk(o);return{x:r.x,y:r.y}})}var Qpi=(e,t)=>{let{injectionDb:n,subcircuit:o,groupsMap:r}=t,i=[],s=e.source_group_id;while(s&&s!==o.source_group_id){let a=n.source_group.get(s),c=r?.get(s);if(!a||!c)break;let l=c.props.name??c.fallbackUnassignedName;i.unshift(`.${l}`),s=a.parent_source_group_id}return i.push(`.${e.name}`),i.join(" > ")};function kpi(e,t){let{injectionDb:n,subcircuit:o}=t,r=[];for(let d of e.connected_source_port_ids){let u=n.source_port.get(d);if(!u)continue;let _;if(u.source_component_id){let p=n.source_component.get(u.source_component_id);if(p)_=`${Qpi({name:p.name,source_group_id:p.source_group_id},t)} > .${u.name}`}else _=`.${u.name}`;if(_)r.push(_)}for(let d of e.connected_source_net_ids){let u=n.source_net.get(d);if(u)r.push(`net.${u.name}`)}if(r.length<2)return;let i=n.pcb_trace.list().filter((d)=>d.source_trace_id===e.source_trace_id),s=i[0],a;if(s)a=Rpi(s.route);let c=e.min_trace_thickness;if(!c&&s?.route){let d=s.route.find((u)=>u.route_type==="wire");if(d&&d.route_type==="wire")c=d.width}let l={path:r};if(c!==void 0)l.thickness=c;if(a&&a.length>0)l.pcbPath=a;else if(!s&&e.connected_source_port_ids.length===2&&e.connected_source_net_ids.length===0)l.pcbStraightLine=!0;let h=new O_(l);h._inflatedPcbTraces=i.length>0?i:void 0,h._inflatedPcbVias=s?n.pcb_via.list().filter((d)=>i.some((u)=>d.pcb_trace_id===u.pcb_trace_id)):void 0,o.add(h)}var Lpi={collector:["c"],base:["b"],emitter:["e"]},SPn=class extends Xl{get config(){let e=this.props.type==="npn"?"npn_bipolar_transistor":"pnp_bipolar_transistor";return{componentName:"Transistor",schematicSymbolName:this.props.symbolName??e,zodProps:APt,sourceFtype:"simple_transistor",shouldRenderAsSchematicBox:!1}}initPorts(){let e={},t=this.getSchematicSymbol();for(let n of t?.ports??[]){let o=D8e(n.labels);if(!o)continue;for(let r of n.labels){let i=Lpi[r];if(i)e[`pin${o}`]=i}}super.initPorts({pinCount:3,additionalAliases:e})}get collector(){return this.portMap.collector}get base(){return this.portMap.base}get emitter(){return this.portMap.emitter}doInitialCreateNetsFromProps(){this._createNetsFromProps([...this._getNetsFromConnectionsProp()])}doInitialCreateTracesFromProps(){this._createTracesFromConnectionsProp()}doInitialSourceRender(){let{db:e}=this.root,{_parsedProps:t}=this,n=e.source_component.insert({ftype:"simple_transistor",name:this.name,manufacturer_part_number:hi(t),supplier_part_numbers:t.supplierPartNumbers,transistor_type:t.type,display_name:t.displayName});this.source_component_id=n.source_component_id}};function Hpi(e,t){let{injectionDb:n,subcircuit:o,groupsMap:r}=t,i=n.pcb_component.getWhere({source_component_id:e.source_component_id}),s=n.cad_component.getWhere({source_component_id:e.source_component_id}),{pcbX:a,pcbY:c}=w6({pcbComponent:i,sourceGroupId:e.source_group_id,inflatorContext:t}),l=new SPn({name:e.name,type:e.transistor_type,layer:i?.layer,pcbX:a,pcbY:c,pcbRotation:i?.rotation,doNotPlace:i?.do_not_place,obstructsWithinBounds:i?.obstructs_within_bounds});if(i){let h=M6(i,{...t,normalComponent:l});if(h)l.add(h)}if(e.source_group_id&&r?.has(e.source_group_id))r.get(e.source_group_id).add(l);else o.add(l)}function Fpi(e){let{injectionDb:t,subcircuit:n,groupsMap:o}=e,r=["pcb_silkscreen_rect","pcb_silkscreen_circle","pcb_silkscreen_line","pcb_silkscreen_path","pcb_silkscreen_text","pcb_fabrication_note_text","pcb_fabrication_note_path","pcb_fabrication_note_rect","pcb_note_text","pcb_note_rect","pcb_note_path","pcb_note_line","pcb_via","pcb_hole","pcb_plated_hole","pcb_cutout","pcb_soldermask_opening","pcb_solder_paste"],i=t.toArray().filter((a)=>{if(!r.includes(a.type))return!1;if(a.type==="pcb_via"){if(!a.pcb_trace_id)return!0;let c=t.pcb_trace.get(a.pcb_trace_id),l=c?.source_trace_id;return!(l&&t.source_trace.get(l)&&c?.route.some((d)=>d.route_type==="via"&&Math.abs(d.x-a.x)<0.0001&&Math.abs(d.y-a.y)<0.0001))}if(a.type==="pcb_cutout")return!0;if(a.type==="pcb_solder_paste")return a.pcb_component_id===void 0&&!a.pcb_smtpad_id;if(a.type==="pcb_soldermask_opening")return a.pcb_component_id===void 0;return"pcb_component_id"in a&&(a.pcb_component_id===null||a.pcb_component_id===void 0)});if(i.length===0)return;let s=JB({componentName:"",componentRotation:"0deg"},i);for(let a of s)n.add(a)}var S8e=(e,t,n)=>{if(!t)return;let o=Ps(t);if(t&&n?.length>0)throw Error("Component cannot have both circuitJson and children");let i={injectionDb:o,subcircuit:e,groupsMap:new Map},s=o.source_group.list(),a=new Set,c=[...s];while(c.length>0){let _=c.findIndex((m)=>!m.parent_source_group_id||a.has(m.parent_source_group_id));if(_===-1){let m=c.map((A)=>A.source_group_id).join(", ");throw Error(`Cannot inflate source_groups: cyclic dependency or missing parent detected. Remaining groups: ${m}`)}let p=c[_];ypi(p,i),a.add(p.source_group_id),c.splice(_,1)}let l=o.pcb_board.list();for(let _ of l)LOr(_,i);let h=o.source_component.list();for(let _ of h)switch(_.ftype){case"simple_resistor":Bpi(_,i);break;case"simple_capacitor":GOr(_,i);break;case"simple_inductor":xpi(_,i);break;case"simple_diode":dVr(_,i);break;case"simple_fiducial":pVr(_,i);break;case"simple_led":bpi(_,i);break;case"simple_chip":XOr(_,i);break;case"simple_connector":cVr(_,i);break;case"simple_transistor":Hpi(_,i);break;case"simple_mosfet":Epi(_,i);break;case"simple_push_button":wpi(_,i);break;case"simple_switch":Npi(_,i);break;default:throw Error(`No inflator implemented for source component ftype: "${_.ftype}"`)}let d=o.source_port.list();for(let _ of d)Mpi(_,i);let u=o.source_trace.list();for(let _ of u)kpi(_,i);Fpi(i)},PPn=(e)=>{if(Dzr(e)){uG(e);return}let{mountedTo:t,mountRotation:n,mountRotationAnchor:o,mountOrientation:r}=e._parsedProps;if(!t){if(n||o||r)throw Error(`board "${e.name}" mounting alignment requires mountedTo`);return}let i=t.lastIndexOf("."),s=t.slice(0,i),a=t.slice(i+1);if(i<1||a!=="backface")throw Error(`board "${e.name}" mountedTo "${t}" must name a motor backface, e.g. "NEMA17.backface"`);let c=SG(e).filter((d)=>d.componentName==="AssemblyMotor"&&jue(d,s));if(c.length!==1)throw Error(`board "${e.name}" mountedTo "${t}" matched ${c.length} motors; expected exactly one in the assembly device`);let l=c[0];if(l._parsedProps.mountedTo){uG(e);return}let h=l._parsedProps.shaftFacingDirection;if(h!=="z+"&&h!=="z-")throw Error(`board "${e.name}" cannot mount to motor "${s}" facing ${h}: rotated PCB boards are not yet supported; use shaftFacingDirection="z+" or "z-"`);if(o&&!n)throw Error(`board "${e.name}" mountRotationAnchor requires mountRotation`);if(l.props.shaftFacingDirection&&r){if(r!==(h==="z+"?"top_layer_toward_mount_face":"bottom_layer_toward_mount_face"))throw Error(`board "${e.name}" mountOrientation "${r}" conflicts with motor "${s}" shaftFacingDirection "${h}"`)}return l},EPn=(e)=>{let t=SG(e).filter((n)=>n.componentName==="Board").filter((n)=>PPn(n)===e);if(t.length>1)throw Error(`assembly.motor "${e.name}" has multiple mounted boards; only one board may determine its placement`);return t[0]};function zpi(){if(typeof KLe!=="function")return Ps([]);let e=KLe([],{indexConfig:{byId:!0,byType:!0}});if(typeof e.insert!=="function"||typeof e.insertAll!=="function"||typeof e.subtree!=="function")return Ps([]);return e}var wPn=class{firstChild=null;children;db;root=null;isRootCircuit=!1;cachedSubcircuits;pendingSubcircuitRenders;_schematicDisabledOverride;get schematicDisabled(){if(this._schematicDisabledOverride!==void 0)return this._schematicDisabledOverride;if(this.platform?.schematicDisabled!==void 0)return this.platform.schematicDisabled;return this._getBoard()?._parsedProps?.schematicDisabled??!1}set schematicDisabled(e){this._schematicDisabledOverride=e}pcbDisabled=!1;pcbRoutingDisabled=!1;_featureMspSchematicTraceRouting=!0;_featurePcbViaStitching=!0;name;platform;projectUrl;_hasRenderedAtleastOnce=!1;_asyncEffectIdsByPhase=new Map;_asyncEffectPhaseById=new Map;_hasUnrenderedUpdatesFromAsyncEffects=!1;_runningAsyncEffectsById=new Map;constructor({platform:e,projectUrl:t,cachedSubcircuits:n,pendingSubcircuitRenders:o}={}){this.children=[],this.db=zpi(),this.platform=e,this.projectUrl=t,this.pcbDisabled=e?.pcbDisabled??!1,this.pcbRoutingDisabled=e?.routingDisabled??!1,this.cachedSubcircuits=n,this.pendingSubcircuitRenders=o,this.root=this}add(e){let t;if(MPn.isValidElement(e))t=Wue(e);else t=e;this.children.push(t)}setPlatform(e){if(this.platform={...this.platform,...e},e.pcbDisabled!==void 0)this.pcbDisabled=e.pcbDisabled;if(e.routingDisabled!==void 0)this.pcbRoutingDisabled=e.routingDisabled}_getBoard(){let e=(t)=>{for(let n of t){if(n.componentName==="Board")return n;if(Lve(n)){let o=e(n.children);if(o)return o}}return};return e(this.children)}_guessRootComponent(){if(this.firstChild)return;if(this.children.length===0)throw Error("Not able to guess root component: IsolatedCircuit has no children (use circuit.add(...))");let e=this.children.filter((n)=>n.lowercaseComponentName==="panel");if(e.length>1)throw Error("Only one <panel> is allowed per circuit");if(e.length===1){if(this.children.length!==1)throw Error("<panel> must be the root element of the circuit");this.firstChild=e[0];return}if(this.children.length===1&&(this.children[0].isGroup||Lve(this.children[0]))){this.firstChild=this.children[0];return}let t=new UP({subcircuit:!0});t.parent=this,t.addAll(this.children),this.children=[t],this.firstChild=t}render(){if(!this.firstChild)this._guessRootComponent();let{firstChild:e,db:t}=this;if(!e)throw Error("IsolatedCircuit has no root component");e.parent=this,e.runRenderCycle(),this._hasUnrenderedUpdatesFromAsyncEffects=!1,this._hasRenderedAtleastOnce=!0}async renderUntilSettled(){if(!this.db.source_project_metadata.list()?.[0])this.db.source_project_metadata.insert({software_used_string:`@tscircuit/core@${this.getCoreVersion()}`,...this.projectUrl?{project_url:this.projectUrl}:{}});this.render();while(!this.isDoneRendering())if(await new Promise((t)=>{let n=()=>{clearTimeout(o),this.removeListener("asyncEffect:end",n),t()},o=setTimeout(n,100);if(this.on("asyncEffect:end",n),this._hasUnrenderedUpdatesFromAsyncEffects)n()}),this._hasUnrenderedUpdatesFromAsyncEffects||this._asyncEffectPhaseById.size===0)this.render();this.emit("renderComplete")}isDoneRendering(){return this._hasRenderedAtleastOnce&&!this._hasIncompleteAsyncEffects()}_hasIncompleteAsyncEffects(){if(this._asyncEffectPhaseById.size>0)return!0;if(this._hasUnrenderedUpdatesFromAsyncEffects)return!0;return this.children.some((e)=>e._hasIncompleteAsyncEffects())}_hasIncompleteAsyncEffectsForPhase(e){return(this._asyncEffectIdsByPhase.get(e)?.size??0)>0}getRunningAsyncEffects(){return Array.from(this._runningAsyncEffectsById.values())}getCircuitJson(){if(!this._hasRenderedAtleastOnce)this.render();return this.db.toArray()}toJson(){return this.getCircuitJson()}async getSvg(e){let t=await Promise.resolve().then(() => (fAn(),AAn)).catch((n)=>{throw Error(`To use circuit.getSvg, you must install the "circuit-to-svg" package.

"${n.message}"`)});if(e.view==="pcb")return t.convertCircuitJsonToPcbSvg(this.getCircuitJson());if(e.view==="schematic")return t.convertCircuitJsonToSchematicSvg(this.getCircuitJson());throw Error(`Invalid view: ${e.view}`)}getCoreVersion(){let[e,t,n]=pPn.version.split(".").map(Number);return`${e}.${t}.${n+1}`}async preview(e){let t=typeof e==="object"?e:{previewName:e};throw Error("project.preview is not yet implemented")}computeSchematicGlobalTransform(){return fh()}_computePcbGlobalTransformBeforeLayout(){return fh()}selectAll(e){return this._guessRootComponent(),this.firstChild?.selectAll(e)??[]}selectOne(e,t){return this._guessRootComponent(),this.firstChild?.selectOne(e,t)??null}_hasRenderLifecycleListeners=!1;_eventListeners={};emit(e,...t){if(e==="asyncEffect:start")this._registerAsyncEffectStart(t[0]);else if(e==="asyncEffect:end")this._registerAsyncEffectEnd(t[0]);if(!this._eventListeners[e])return;for(let n of this._eventListeners[e])n(...t)}hasEventListener(e){return(this._eventListeners[e]?.length??0)>0}on(e,t){if(!this._eventListeners[e])this._eventListeners[e]=[];if(this._eventListeners[e].push(t),e.startsWith("renderable:renderLifecycle:"))this._hasRenderLifecycleListeners=!0}removeListener(e,t){if(!this._eventListeners[e])return;if(this._eventListeners[e]=this._eventListeners[e].filter((n)=>n!==t),e.startsWith("renderable:renderLifecycle:"))this._hasRenderLifecycleListeners=Object.entries(this._eventListeners).some(([n,o])=>n.startsWith("renderable:renderLifecycle:")&&o.length>0)}enableDebug(e){if(typeof e==="string")mst.default.enable(e);else if(e===null||e===!1)mst.default.disable()}getClientOrigin(){if(typeof window<"u"&&window.location)return window.location.origin;if(typeof self<"u"&&self.location)return self.location.origin;return""}_registerAsyncEffectStart(e){if(!e?.asyncEffectId||!e.phase)return;let{asyncEffectId:t,phase:n}=e,o=this._asyncEffectPhaseById.get(t);if(o&&o!==n)this._asyncEffectIdsByPhase.get(o)?.delete(t);if(!this._asyncEffectIdsByPhase.has(n))this._asyncEffectIdsByPhase.set(n,new Set);this._asyncEffectIdsByPhase.get(n).add(t),this._asyncEffectPhaseById.set(t,n),this._runningAsyncEffectsById.set(t,{asyncEffectId:t,effectName:e.effectName,componentDisplayName:e.componentDisplayName,phase:n,error:e.error})}_registerAsyncEffectEnd(e){if(!e?.asyncEffectId)return;let{asyncEffectId:t}=e,n=this._asyncEffectPhaseById.get(t)??e.phase;if(n){let o=this._asyncEffectIdsByPhase.get(n);if(o?.delete(t),o&&o.size===0)this._asyncEffectIdsByPhase.delete(n)}this._asyncEffectPhaseById.delete(t),this._runningAsyncEffectsById.delete(t),this._hasUnrenderedUpdatesFromAsyncEffects=!0}};function BPn(e){if(!e._isIsolatedSubcircuit)return;if(e._isolatedCircuitJson)return;if(!e.getSubcircuitPropHash)return;let t=e.getSubcircuitPropHash(),n=e.root?.cachedSubcircuits,o=e.root?.pendingSubcircuitRenders,r=n?.get(t);if(r){e._isolatedCircuitJson=r,e.children=[],e._normalComponentNameMap=null;return}let i=[...e.children];e.children=[],e._normalComponentNameMap=null;let s=e.root;e._queueAsyncEffect("render-isolated-subcircuit",async()=>{let a=n?.get(t);if(a){e._isolatedCircuitJson=a;return}let c=o?.get(t);if(c){e._isolatedCircuitJson=await c;return}let l,h,d=new Promise((u,_)=>{l=u,h=_});o?.set(t,d);try{let u=new wPn({platform:{...s.platform,pcbDisabled:s.pcbDisabled,schematicDisabled:s.schematicDisabled},cachedSubcircuits:n,pendingSubcircuitRenders:o});for(let p of i)u.add(p);await u.renderUntilSettled();let _=u.getCircuitJson();n?.set(t,_),e._isolatedCircuitJson=_,l(_)}catch(u){throw h(u instanceof Error?u:Error(String(u))),u}finally{o?.delete(t)}})}var Opi=new Set(["name","key","pcbX","pcbY","schX","schY","pcbLeftEdgeX","pcbRightEdgeX","pcbTopEdgeY","pcbBottomEdgeY","pcbRotation","schRotation"]);function Pve(e,t=new WeakSet){if(e===null)return"null";if(e===void 0)return"undefined";let n=typeof e;if(n==="string")return`"${e}"`;if(n==="number"||n==="boolean")return String(e);if(n==="function")return"[function]";if(n==="symbol")return"[symbol]";if(n==="object"){if(t.has(e))return"[circular]";if(t.add(e),e.$$typeof!==void 0){let i=typeof e.type==="string"?e.type:e.type?.name||"[component]",s=e.props?Pve(e.props,t):"{}";return`ReactElement(${i},${s})`}if(Array.isArray(e))return`[${e.map((s)=>Pve(s,t)).join(",")}]`;return`{${Object.keys(e).sort().map((i)=>`${i}:${Pve(e[i],t)}`).join(",")}}`}return String(e)}function TPn(e){let t={},n=Object.keys(e).sort();for(let o of n)if(!Opi.has(o)&&e[o]!==void 0)t[o]=e[o];return t}function DPn(e){return e.map((t)=>({componentName:t.componentName,props:TPn(t.props??{}),children:DPn(t.children)}))}function j5n(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0}function Vpi(e){let t=Pve(e),n=j5n(t),o=j5n(t+n.toString());return n.toString(16).padStart(8,"0")+o.toString(16).padStart(8,"0")}function NPn(e){let t={props:TPn(e.props??{}),children:DPn(e.children)};return Vpi(t)}var Ypi=(e)=>{let{db:t}=e.root,n=e.root?.pcbRoutingDisabled||e.getInheritedProperty("routingDisabled"),o=e.root?.pcbDisabled,r=e.root?.schematicDisabled,i=e.root?.platform?.drcChecksDisabled??e.getInheritedProperty("drcChecksDisabled");if(i){e._drcChecksComplete=!0;return}let s=e.root?.platform?.netlistDrcChecksDisabled??e.getInheritedProperty("netlistDrcChecksDisabled"),a=e.root?.platform?.placementDrcChecksDisabled??e.getInheritedProperty("placementDrcChecksDisabled"),c=e.root?.platform?.routingDrcChecksDisabled??e.getInheritedProperty("routingDrcChecksDisabled"),l=!i&&!s,h=!i&&!r,d=!i&&!o&&!a,u=!i&&!o&&!n&&!c,_=e.root?.platform?.fabricatorEngine,p=e._parsedProps.fabricatorPreset,m=!i&&!o&&!!_&&!!p;if((u||m)&&e._hasIncompleteAsyncEffectsInSubtreeForPhase("PcbTraceRender"))return;let A=e._hasTracesToRoute();if((u||m)&&A&&!e._areChildSubcircuitsRouted())return;if(e._drcChecksComplete||e._drcChecksInProgress)return;let g=async(x)=>{let C=[],b=(P,M)=>{C.push(Promise.resolve().then(M).catch((B)=>{let T=B instanceof Error?B.message:String(B);return t.source_runtime_error.insert({error_type:"source_runtime_error",phase_name:"PcbDesignRuleChecks",message:`DRC could not complete (${P}): ${T}`}),[]}))},I=e.pcb_board_id;if(m&&_&&p&&I)b("fabricator",()=>_.runDrcChecks({circuitJson:x,fabricatorPreset:p,pcbBoardId:I}));if(u)b("routing",()=>Z2e(x).then((P)=>P.filter((M)=>!e._isExpectedCastellatedHoleDrcError(M))));if(d){let P=t.toArray();b("placement",()=>J2e(x,{consolidateOverlaps:!1}).then((M)=>oK(x,M.filter((B)=>!e._isExpectedCastellatedHoleDrcError(B))).filter((B)=>!P.some((T)=>T.type===B.type&&("message"in T)&&T.message===B.message))))}if(l)b("netlist",()=>P7t(x));if(h)b("schematic",()=>E7t(x));if(!i)for(let P of e.selectAll("drccheck"))b(P.getString(),()=>P.runCustomDrcCheck(x));let v=await Promise.all(C);t.insertAll(oK(x,$2e(v.flat())))},y=t.subtree({subcircuit_id:e.subcircuit_id}).toArray();e._drcChecksInProgress=!0,e._queueAsyncEffect("board:drc-checks",async()=>{try{await g(y),e._drcChecksComplete=!0}finally{e._drcChecksInProgress=!1}})},_st=1e6,yde=0.0000001*_st,K5n=(e,t)=>{if(e.route_type==="wire")return{point:e,layer:e.layer};if(e.route_type==="via")return{point:e,layer:t==="start"?e.from_layer:e.to_layer};return{point:e[t],layer:t==="start"?e.start_layer:e.end_layer}},Gpi=(e,t=new Set)=>{let n=Aa(e),o=e.filter((f)=>f.type==="pcb_copper_pour"),r=new Set(o.flatMap((f)=>f.source_net_id?[n.getNetConnectedToId(f.source_net_id)??f.source_net_id]:[])),i=[],s=(f)=>{if(r.has(f.netId)&&!f.polygon.isEmpty())i.push({...f,polygon:f.polygon.scale(_st,_st)})},a=new Map(e.filter((f)=>f.type==="pcb_component").map((f)=>[f.pcb_component_id,f])),c=e.filter((f)=>f.type==="pcb_via"),l=e.find((f)=>f.type==="pcb_board");for(let f of o){if(!f.source_net_id)continue;s({polygon:DR(f),layers:[f.layer],netId:n.getNetConnectedToId(f.source_net_id)??f.source_net_id,isTerminal:!1,pourId:f.pcb_copper_pour_id})}for(let f of e)if(f.type==="pcb_smtpad"){let y=n.getNetConnectedToId(f.pcb_smtpad_id);if(y&&r.has(y))s({polygon:kj(f),layers:[f.layer],netId:y,isTerminal:!!f.pcb_port_id})}else if(f.type==="pcb_plated_hole"){let y=n.getNetConnectedToId(f.pcb_plated_hole_id);if(y&&r.has(y))s({polygon:RR(f,f.pcb_component_id?a.get(f.pcb_component_id)?.rotation:0),layers:f.layers,netId:y,isTerminal:!!f.pcb_port_id})}else if(f.type==="pcb_via"){let y=n.getNetConnectedToId(f.pcb_via_id);if(y&&r.has(y))s({polygon:NR(f,f.outer_diameter,f.hole_diameter),layers:f.layers,netId:y,isTerminal:!t.has(f.pcb_via_id),viaId:f.pcb_via_id})}else if(f.type==="pcb_trace"){let y=n.getNetConnectedToId(f.pcb_trace_id);if(!y||!r.has(y))continue;for(let x=0;x<f.route.length;x++){let C=f.route[x];if(C.route_type==="via"){let B=c.find((T)=>T.x===C.x&&T.y===C.y&&T.layers.includes(C.from_layer)&&T.layers.includes(C.to_layer));s({polygon:NR(C,B?.outer_diameter??C.outer_diameter??l?.min_via_pad_diameter??0.3,B?.hole_diameter??C.hole_diameter??l?.min_via_hole_diameter??0.2),layers:B?.layers??kP({fromLayer:C.from_layer,toLayer:C.to_layer,layerCount:l?.num_layers??2}),netId:y,isTerminal:!1})}let b=f.route[x+1];if(!b)continue;let I=K5n(C,"end"),v=K5n(b,"start");if(I.layer!==v.layer)continue;let P=C.route_type==="via"?b.route_type==="via"?void 0:b.width:C.width;if(P===void 0)continue;let M=f.route_thickness_mode==="interpolated"&&b.route_type!=="via"?b.width:P;s({polygon:lO(I.point,v.point,P,M),layers:[I.layer],netId:y,isTerminal:!1})}}let h=new Set,d=new Set;if(i.length===0)return{floatingPourIds:h,floatingViaIds:d};let u=i.map((f,y)=>y),_=(f)=>{while(u[f]!==f)u[f]=u[u[f]],f=u[f];return f},p=i.map((f)=>f.polygon.box),m=new _3(i.length);for(let f of p)m.add(f.xmin,f.ymin,f.xmax,f.ymax);m.finish();for(let[f,y]of i.entries()){let x=p[f];for(let C of m.search(x.xmin-yde,x.ymin-yde,x.xmax+yde,x.ymax+yde)){if(C<=f||_(f)===_(C))continue;let b=i[C];if(y.netId!==b.netId||!y.layers.some((I)=>b.layers.includes(I)))continue;if(avt(y.polygon,b.polygon,yde))u[_(C)]=_(f)}}let A=new Set(i.flatMap((f)=>f.isTerminal?[f.netId]:[])),g=new Set(i.flatMap((f,y)=>f.isTerminal?[_(y)]:[]));for(let[f,y]of i.entries()){if(!A.has(y.netId)||g.has(_(f)))continue;if(y.pourId)h.add(y.pourId);if(y.viaId)d.add(y.viaId)}return{floatingPourIds:h,floatingViaIds:d}},Upi=(e)=>{if(!e.root||e.root.pcbDisabled)return;let{db:t}=e.root;if(t.pcb_copper_pour.list().length===0)return;let n=t.subtree({subcircuit_id:e.subcircuit_id}).toArray();if(t.pcb_autorouting_error.list().length>0)return;if(!n.some((i)=>i.type==="pcb_copper_pour"))return;let{floatingPourIds:o,floatingViaIds:r}=Gpi(n,e._generatedStitchingViaIds);for(let i of o)t.pcb_copper_pour.delete(i);for(let i of r)if(e._generatedStitchingViaIds.has(i))t.pcb_via.delete(i);for(let i of t.pcb_trace.list()){if(!i.route.some((s)=>("copper_pour_id"in s)&&s.copper_pour_id&&o.has(s.copper_pour_id)))continue;t.pcb_trace.update(i.pcb_trace_id,{route:i.route.map((s)=>{if(!("copper_pour_id"in s)||!s.copper_pour_id||!o.has(s.copper_pour_id))return s;let{copper_pour_id:a,is_inside_copper_pour:c,...l}=s;return l})})}},RPn=(e)=>{if(e._pcbTraceRenderWaitingForPlacementChecks)e.renderPhaseStates.PcbTraceRender.initialized=!1,e.renderPhaseStates.PcbTraceRender.dirty=!1,e._pcbTraceRenderWaitingForPlacementChecks=!1;for(let t of e.children)RPn(t)},Wpi=(e)=>{if(e.root?.pcbDisabled)return;let t=e.root?.platform?.placementDrcChecksDisabled??e.getInheritedProperty("placementDrcChecksDisabled"),n=e.root?.platform?.drcChecksDisabled??e.getInheritedProperty("drcChecksDisabled");if(e._pcbPlacementDrcErrorCount=null,e._pcbPlacementDrcCheckError=null,e._pcbPlacementDrcChecksPending=!1,t||n){e._pcbPlacementDrcErrorCount=0;return}let{db:o}=e.root,r=o.subtree({subcircuit_id:e.subcircuit_id}).toArray(),i=o.toArray();e._pcbPlacementDrcChecksPending=!0,e._queueAsyncEffect("board:pre-route-placement-checks",async()=>{try{let s=await J2e(r,{consolidateOverlaps:!1}),a=oK(r,s.filter((l)=>!e._isExpectedCastellatedHoleDrcError(l))),c=a.filter((l)=>!i.some((h)=>h.type===l.type&&("message"in h)&&h.message===l.message));o.insertAll(c),e._pcbPlacementDrcErrorCount=a.filter((l)=>l.type.endsWith("_error")).length}catch(s){e._pcbPlacementDrcCheckError=s instanceof Error?s.message:String(s)}finally{e._pcbPlacementDrcChecksPending=!1,RPn(e)}})},Xpi=0.000001,jpi=(e)=>{if(!e)return[];return Array.isArray(e)?e:[e]},Kpi=class e extends UB{outlinePointIndex;holeDiameter;padDiameter;port;trace;static fromBoardOutline(t){return(t??[]).flatMap((n,o)=>n.isCastellatedHole?[new e(n,o)]:[])}constructor(t,n){let o=`castellated_hole_${n+1}`,r=jpi(t.connectsTo),i=Ke.parse(t.holeDiameter),s=Ke.parse(t.padDiameter);super({shape:"circle",holeDiameter:i,outerDiameter:s,portHints:[o]});this.outlinePointIndex=n,this.holeDiameter=i,this.padDiameter=s,this.port=r.length>0?new sd({name:o}):null,this.trace=this.port?new O_({path:[`port.${o}`,...r],displayName:`Castellated hole ${n+1} connectivity`}):null}_getParentBoard(){if(this.parent?.componentName!=="Board")throw Error("A board castellated hole must be a direct board child");return this.parent}_getPositionFromBoardOutline(){let t=this._getParentBoard(),o=(t.pcb_board_id?t.root?.db.pcb_board.get(t.pcb_board_id):null)?.outline?.[this.outlinePointIndex];if(!o)throw Error(`Missing emitted board outline point ${this.outlinePointIndex}`);return o}_getGlobalPcbPositionBeforeLayout(){return this._getPositionFromBoardOutline()}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let{db:t}=this.root,n=this._getPositionFromBoardOutline(),o=t.pcb_plated_hole.insert({shape:"circle",outer_diameter:this.padDiameter,hole_diameter:this.holeDiameter,...n,layers:this.getAvailablePcbLayers(),port_hints:this.getNameAndAliases(),subcircuit_id:this.getSubcircuit()?.subcircuit_id??void 0});this.pcb_plated_hole_id=o.pcb_plated_hole_id}syncPositionToBoardOutline(){if(!this.pcb_plated_hole_id)return;this._setPositionFromLayout(this._getPositionFromBoardOutline())}removePcbPrimitiveRender(){let{db:t}=this.root;if(this.pcb_plated_hole_id)t.pcb_plated_hole.delete(this.pcb_plated_hole_id),this.pcb_plated_hole_id=null;if(this.matchedPort?.pcb_port_id)t.pcb_port.delete(this.matchedPort.pcb_port_id),this.matchedPort.pcb_port_id=null}isExpectedBoardEdgeDrcError(t){if(!this.pcb_plated_hole_id)return!1;if(t.type==="pcb_placement_error")return t.pcb_placement_error_id===`copper_too_close_to_board_edge_${this.pcb_plated_hole_id}`;if(t.type!=="pcb_trace_error"||!t.pcb_trace_error_id.startsWith("trace_too_close_to_board_"))return!1;let n=t.pcb_trace_error_id.match(/_segment_(\d+)$/);if(!n)return!1;let o=this.root?.db.pcb_trace.get(t.pcb_trace_id),r=Number(n[1]),i=[o?.route[r],o?.route[r+1]].flatMap((a)=>a&&("x"in a)&&("y"in a)?[{x:a.x,y:a.y}]:[]),s=this.root?.db.pcb_plated_hole.get(this.pcb_plated_hole_id);if(!s)return!1;return i.some((a)=>Math.hypot(a.x-s.x,a.y-s.y)<=Xpi)}},$pi=0.01,qpi=0.15,$5n=(e,t,n)=>{let o=e/2,r=t/2,i=Math.min(n,o,r);if(i<$pi)return[{x:-o,y:-r},{x:o,y:-r},{x:o,y:r},{x:-o,y:r}];let s=0.1,a=Math.max(1,Math.ceil(Math.PI/2*i/s)),c=Math.PI/2/a,l=[];l.push({x:-o+i,y:-r}),l.push({x:o-i,y:-r});for(let h=1;h<=a;h++){let d=-Math.PI/2+h*c;l.push({x:o-i+i*Math.cos(d),y:-r+i+i*Math.sin(d)})}l.push({x:o,y:r-i});for(let h=1;h<=a;h++){let d=0+h*c;l.push({x:o-i+i*Math.cos(d),y:r-i+i*Math.sin(d)})}l.push({x:-o+i,y:r});for(let h=1;h<=a;h++){let d=Math.PI/2+h*c;l.push({x:-o+i+i*Math.cos(d),y:r-i+i*Math.sin(d)})}l.push({x:-o,y:-r+i});for(let h=1;h<=a;h++){let d=Math.PI+h*c;l.push({x:-o+i+i*Math.cos(d),y:-r+i+i*Math.sin(d)})}return l},Iv=class extends UP{pcbFold;pcb_board_id=null;source_board_id=null;_drcChecksComplete=!1;_drcChecksInProgress=!1;_connectedSchematicPortPairs=new Set;_panelPositionOffset=null;_castellatedHoles;doInitialCadModelRender(){if(this.root?.pcbDisabled)return;PPn(this),super.doInitialCadModelRender()}constructor(e){super(e);this._castellatedHoles=Kpi.fromBoardOutline(this._parsedProps.outline);for(let t of this._castellatedHoles){if(t.port)this.add(t.port);if(this.add(t),t.trace)this.add(t.trace)}}doInitialPcbFlexRender(){if(!this.pcb_board_id)return;let e=this.root.db.pcb_bend.list().filter((o)=>o.pcb_board_id===this.pcb_board_id);if(this.pcbFold=void 0,!e.length)return;let t=this.root.db.pcb_board.get(this.pcb_board_id),n=AHr(e,this.boardThickness,{outline:t.outline?.map((o)=>({x:o.x-t.center.x,y:o.y-t.center.y}))});if(n.ok)this.pcbFold=n.value;else this.root.db.pcb_placement_error.insert({error_type:"pcb_placement_error",subcircuit_id:this.subcircuit_id??void 0,message:`Unable to fold PCB board ${this._parsedProps.name??"unnamed board"}; CAD remains flat: ${S4n(n.issue,e)}`})}get isSubcircuit(){return!0}get isGroup(){return!0}get config(){return{componentName:"Board",zodProps:dze}}get boardThickness(){return this._parsedProps.thickness??1.4}get allLayers(){return Bst(this._parsedProps.layers??2)}_getSubcircuitLayerCount(){return this._parsedProps.layers??2}_computePcbGlobalTransformBeforeLayout(){if(this._panelPositionOffset){let e=this.parent?._computePcbGlobalTransformBeforeLayout?.()??{a:1,b:0,c:0,d:1,e:0,f:0};return Hi(e,Ii(this._panelPositionOffset.x,this._panelPositionOffset.y))}return super._computePcbGlobalTransformBeforeLayout()}_getBoardCalcVariables(){let{_parsedProps:e}=this;if((e.width==null||e.height==null)&&!e.outline)return{};let n=this.pcb_board_id?this.root?.db.pcb_board.get(this.pcb_board_id):null,o=n?.width??e.width,r=n?.height??e.height;if((o==null||r==null)&&e.outline?.length){let h=Hs(e.outline);if(h)o??=h.maxX-h.minX,r??=h.maxY-h.minY}let{pcbX:i,pcbY:s}=this.getResolvedPcbPositionProp(),a=n?.center??{x:i+(e.outlineOffsetX??0),y:s+(e.outlineOffsetY??0)},c=o??0,l=r??0;return{"board.minX":a.x-c/2,"board.maxX":a.x+c/2,"board.minY":a.y-l/2,"board.maxY":a.y+l/2}}doInitialPcbBoardAutoSize(){if(this.root?.pcbDisabled)return;if(!this.pcb_board_id)return;let{db:e}=this.root,{_parsedProps:t}=this,n=this._getGlobalPcbPositionBeforeLayout(),o=e.pcb_board.get(this.pcb_board_id);if(o?.width&&o?.height||o?.outline&&o.outline.length>0)return;let r=1/0,i=1/0,s=-1/0,a=-1/0,c=Gst(e,this.subcircuit_id),l=new Set([this.subcircuit_id,...c]),h=e.pcb_component.list().filter((b)=>b.subcircuit_id&&l.has(b.subcircuit_id)),d=e.pcb_group.list().filter((b)=>b.subcircuit_id&&l.has(b.subcircuit_id)),u=!1,_=(b,I,v)=>{if(I===0||v===0)return;u=!0,r=Math.min(r,b.x-I/2),i=Math.min(i,b.y-v/2),s=Math.max(s,b.x+I/2),a=Math.max(a,b.y+v/2)};for(let b of h)_(b.center,b.width,b.height);for(let b of d){let I=b.width??0,v=b.height??0;if(b.outline&&b.outline.length>0){let P=Hs(b.outline);if(P)I=P.maxX-P.minX,v=P.maxY-P.minY}_(b.center,I,v)}if(t.boardAnchorPosition){let{x:b,y:I}=t.boardAnchorPosition;r=Math.min(r,b),i=Math.min(i,I),s=Math.max(s,b),a=Math.max(a,I)}let p=2,m=u?s-r+p*2:0,A=u?a-i+p*2:0,g={x:u?(r+s)/2+(t.outlineOffsetX??0):(t.outlineOffsetX??0)+n.x,y:u?(i+a)/2+(t.outlineOffsetY??0):(t.outlineOffsetY??0)+n.y},f=t.width??m,y=t.height??A,x=t.outline;if(!x&&t.borderRadius!=null&&f>0&&y>0)x=$5n(f,y,t.borderRadius).map((b)=>({x:b.x+g.x,y:b.y+g.y}));let C={width:f,height:y,center:g};if(x)C.outline=t.outline?x.map((b)=>({x:b.x+(t.outlineOffsetX??0),y:b.y+(t.outlineOffsetY??0)})):x;e.pcb_board.update(this.pcb_board_id,C)}updatePcbBoardAutoSize(){this.doInitialPcbBoardAutoSize()}_addBoardInformationToSilkscreen(){let e=this.root?.platform;if(!e?.printBoardInformationToSilkscreen)return;let t=this.root.db.pcb_board.get(this.pcb_board_id);if(!t)return;let n=[];if(e.projectName)n.push(e.projectName);if(e.version)n.push(`v${e.version}`);if(e.url)n.push(e.url);if(n.length===0)return;let o=n.join(`
`),r=0.25,i=1,s={x:t.center.x+t.width/2-r,y:t.center.y-t.height/2+i};this.root.db.pcb_silkscreen_text.insert({pcb_component_id:this.pcb_board_id,layer:"top",font:"tscircuit2024",font_size:0.45,text:o,ccw_rotation:0,anchor_alignment:"bottom_right",anchor_position:s})}doInitialSourceRender(){let e=this.getDescendants().find((o)=>o.lowercaseComponentName==="board");if(e)throw Error(`Nested boards are not supported: found board "${e.name}" inside board "${this.name}"`);super.doInitialSourceRender();let{db:t}=this.root,n=t.source_board.insert({source_group_id:this.source_group_id,title:this.props.title||this.props.name});this.source_board_id=n.source_board_id}getSubcircuitPropHash(){return NPn(this)}doInitialRenderIsolatedSubcircuits(){BPn(this)}doInitialInflateSubcircuitCircuitJson(){let e=this._isolatedCircuitJson;if(e){this._isInflatedFromCircuitJson=!0,this._isolatedCircuitJson=null,S8e(this,e,[]);return}let{circuitJson:t,children:n}=this._parsedProps;if(t)this._isInflatedFromCircuitJson=!0;S8e(this,t,n)}doInitialPcbComponentRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,o=t.circuitJson?.find((I)=>I.type==="pcb_board"),r=Tst(t.defaultViaTenting),i=this.props,s=i.isViaInPadAllowed??o?.is_via_in_pad_allowed,a=i.allowBlindAndBuriedVias??o?.allow_blind_and_buried_vias,c=t.width??o?.width??0,l=t.height??o?.height??0,h=this._getGlobalPcbPositionBeforeLayout(),d={x:h.x+(t.outlineOffsetX??0),y:h.y+(t.outlineOffsetY??0)},{boardAnchorPosition:u,boardAnchorAlignment:_}=t;if(u)d=kOr({boardAnchorPosition:u,boardAnchorAlignment:_??"center",width:c,height:l});if(t.outline){let I=t.outline.map((N)=>N.x),v=t.outline.map((N)=>N.y),P=Math.min(...I),M=Math.max(...I),B=Math.min(...v),T=Math.max(...v);c=M-P,l=T-B}let p=t.outline;if(!p&&t.borderRadius!=null&&c>0&&l>0)p=$5n(c,l,t.borderRadius).map((I)=>({x:I.x+d.x,y:I.y+d.y}));let m={x:0,y:0};if(t.outline&&p&&p.length>0&&(this.parent?.lowercaseComponentName==="panel"||this.parent?.lowercaseComponentName==="subpanel")){let I=Hs(p);if(I){let v=(I.minX+I.maxX)/2,P=(I.minY+I.maxY)/2;m={x:d.x-v,y:d.y-P}}}let A=this.getSubcircuit()._parsedProps,g=this.getInheritedMergedProperty("pcbStyle"),f=cT(g),y=A.minViaHoleDiameter??(g?.viaHoleDiameter!==void 0?f.holeDiameter:void 0),x=y??g6.min_via_hole_diameter,C=A.minViaPadDiameter??(g?.viaPadDiameter!==void 0?f.padDiameter:y!==void 0?y+qpi:g6.min_via_pad_diameter),b=e.pcb_board.insert({source_board_id:this.source_board_id,subcircuit_id:this.subcircuit_id??void 0,center:d,default_via_tented_on_top:r.tented_on_top??o?.default_via_tented_on_top,default_via_tented_on_bottom:r.tented_on_bottom??o?.default_via_tented_on_bottom,thickness:this.boardThickness,num_layers:this.allLayers.length,width:c,height:l,outline:t.outline?p?.map((I)=>({x:I.x+(t.outlineOffsetX??0)+m.x,y:I.y+(t.outlineOffsetY??0)+m.y})):p,material:t.material,...s!==void 0&&{is_via_in_pad_allowed:s},...a!==void 0&&{allow_blind_and_buried_vias:a},...t.solderMaskColor!==void 0&&{solder_mask_color:t.solderMaskColor},...t.silkscreenColor!==void 0&&{silkscreen_color:t.silkscreenColor},min_trace_width:A.minTraceWidth??g6.min_trace_width,min_via_hole_diameter:x,min_via_pad_diameter:C,min_via_hole_edge_to_via_hole_edge_clearance:A.minViaHoleEdgeToViaHoleEdgeClearance??g6.min_via_hole_edge_to_via_hole_edge_clearance,min_via_edge_to_pad_edge_clearance:A.minViaEdgeToPadEdgeClearance??g6.min_via_edge_to_pad_edge_clearance,min_trace_to_hole_edge_clearance:A.minTraceToHoleEdgeClearance??g6.min_trace_to_hole_edge_clearance,min_trace_to_pad_edge_clearance:A.minTraceToPadEdgeClearance??g6.min_trace_to_pad_edge_clearance,min_pad_edge_to_pad_edge_clearance:A.minPadEdgeToPadEdgeClearance??g6.min_pad_edge_to_pad_edge_clearance,min_plated_hole_drill_edge_to_drill_edge_clearance:A.minPlatedHoleDrillEdgeToDrillEdgeClearance??g6.min_plated_hole_drill_edge_to_drill_edge_clearance,min_board_edge_clearance:A.minBoardEdgeClearance??g6.min_board_edge_clearance});this.pcb_board_id=b.pcb_board_id,this._addBoardInformationToSilkscreen()}removePcbComponentRender(){let{db:e}=this.root;if(!this.pcb_board_id)return;e.pcb_board.delete(this.pcb_board_id),this.pcb_board_id=null}doInitialPcbDesignRuleChecks(){super.doInitialPcbDesignRuleChecks(),this.updatePcbDesignRuleChecks()}doInitialPcbPlacementDesignRuleChecks(){Wpi(this)}_generatedStitchingViaIds=new Set;doInitialPcbCopperPourCleanup(){Upi(this)}updatePcbDesignRuleChecks(){Ypi(this)}runRenderPhaseForChildren(e){this.root?.emit("board:renderPhaseStarted",{renderId:this._renderId,phase:e}),super.runRenderPhaseForChildren(e)}_repositionOnPcb(e){let{db:t}=this.root,n=this.pcb_board_id?t.pcb_board.get(this.pcb_board_id):null,o=n?.center;if(!o){if(this.pcb_board_id)t.pcb_board.update(this.pcb_board_id,{center:e});return}let r=e.x-o.x,i=e.y-o.y;if(Math.abs(r)<0.000001&&Math.abs(i)<0.000001)return;if(this.pcb_board_id){if(t.pcb_board.update(this.pcb_board_id,{center:e}),n?.outline){let s=Hs(n.outline);if(s){let a={x:(s.minX+s.maxX)/2,y:(s.minY+s.maxY)/2},c=e.x-a.x,l=e.y-a.y,h=n.outline.map((d)=>({x:d.x+c,y:d.y+l}));t.pcb_board.update(this.pcb_board_id,{outline:h});for(let d of this._castellatedHoles)d.syncPositionToBoardOutline()}}}}_isExpectedCastellatedHoleDrcError(e){return this._castellatedHoles.some((t)=>t.isExpectedBoardEdgeDrcError(e))}},QPn=class extends UP{constructor(e){super({...e,subcircuit:!0})}getSubcircuitPropHash(){return NPn(this)}doInitialRenderIsolatedSubcircuits(){BPn(this)}doInitialCreateNetsFromProps(){super.doInitialCreateNetsFromProps(),this._createTracesForExposedConnections()}_createTracesForExposedConnections(){let e=this._getNetNamesToExpose();if(!e?.length)return;let t=this.parent?.getSubcircuit?.();if(!t)return;if(!this.name)return;for(let n of e){let o=Jpi(n),r=`> net.${o}`,i=`.${this.name} > net.${o}`;if(!t.children.find((l)=>l instanceof oT&&l._parsedProps.name===o))t.add(new oT({name:o}));if(t.children.find((l)=>{if(!(l instanceof O_))return!1;if(!l._exposesSubcircuitConnection)return!1;let h=l._parsedProps;return h.from===i&&h.to===r}))continue;let c=new O_({from:i,to:r,displayName:o});c._exposesSubcircuitConnection=!0,t.add(c)}}_getNetNamesToExpose(){let e=this._parsedProps.exposedNets??[];if(!this._parsedProps.exposeNets)return e;let t=this.selectAll("net").filter((n)=>n instanceof oT&&n.getSubcircuit()===this).map((n)=>n._parsedProps.name);return Array.from(new Set([...e,...t]))}doInitialInflateSubcircuitCircuitJson(){let e=this._isolatedCircuitJson;if(e){this._isInflatedFromCircuitJson=!0,this._isolatedCircuitJson=null,S8e(this,e,[]);return}let{circuitJson:t,children:n}=this._parsedProps;if(t)this._isInflatedFromCircuitJson=!0;S8e(this,t,n)}},Jpi=(e)=>e.startsWith("net.")?e.slice(4):e,Zpi=class extends QPn{pcb_board_id=null;get config(){return{componentName:"MountedBoard",zodProps:ePt}}get boardThickness(){return 1.4}get allLayers(){return["top","bottom"]}_connectedSchematicPortPairs=new Set;_getBoardCalcVariables(){return this._findCarrierBoard()?._getBoardCalcVariables()??{}}_findCarrierBoard(){let e=this.parent;while(e){if(e instanceof Iv)return e;e=e.parent}return null}doInitialPcbComponentRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,n=this._getGlobalPcbPositionBeforeLayout(),o=e.pcb_board.insert({center:{x:n.x,y:n.y},width:t.width??0,height:t.height??0,is_mounted_to_carrier_board:!0});this.pcb_board_id=o.pcb_board_id}doInitialPcbBoardAutoSize(){if(!this.pcb_board_id||!this.root)return;let e=this._findCarrierBoard();if(e?.pcb_board_id)this.root.db.pcb_board.update(this.pcb_board_id,{carrier_pcb_board_id:e.pcb_board_id})}},kPn=5,gst=2,LPn=(e,t)=>{let{gapLength:n,cutoutWidth:o,mouseBites:r,mouseBiteHoleDiameter:i,mouseBiteHoleSpacing:s}=t,a=[],c=[];if(e.length<2)return{tabCutouts:a,mouseBiteHoles:c};let l=new El(e.map((d)=>P_(d.x,d.y))),h;if(e.length>2){let d=P_(e[0].x,e[0].y),u=P_(e[1].x,e[1].y),_=iO(d,u).normalize(),p=_.rotate(Math.PI/2),A=d.translate(_.multiply(Jfe(d,u).length/2)).translate(p.multiply(0.01));h=l.contains(A)}else h=l.area()>0;for(let d=0;d<e.length;d++){let u=e[d],_=e[(d+1)%e.length];if(!u||!_)continue;let p=P_(u.x,u.y),m=P_(_.x,_.y),A=Jfe(p,m),g=A.length;if(g<0.000001)continue;let f=iO(p,m),y=f.normalize(),x=y.rotate(Math.PI/2),b=A.middle().translate(x.multiply(0.01));if(l.contains(b))x=x.multiply(-1);let I=2,v=I*i+(I-1)*s,P;if(r)P=v;else P=n;P=Math.min(P,g*0.9);let M=(g-P)/2,B=M+P;if(r){let O=i+s;if(P>=v&&O>0){let U=(P-v)/2+i/2,j=M+U;for(let Y=0;Y<I;Y++){let X=j+Y*O,K=p.translate(y.multiply(X));c.push({x:K.x,y:K.y})}}}let T=e[(d-1+e.length)%e.length],N=e[(d+2)%e.length],D=0,L=0;if(T&&N){let O=iO(P_(T.x,T.y),p),U=O.cross(f),j=h?U>0.000000001:U<-0.000000001,Y=iO(m,P_(N.x,N.y)),X=f.cross(Y),K=h?X>0.000000001:X<-0.000000001;if(j){let J=O.angleTo(f);if(J>Math.PI)J=2*Math.PI-J;D=o*Math.tan(J/2)}else D=0;if(K){let J=f.angleTo(Y);if(J>Math.PI)J=2*Math.PI-J;L=o*Math.tan(J/2)}else L=0}let H=P<0.000001?[{start:0-D,end:g+L}]:[{start:0-D,end:M},{start:B,end:g+L}],V=x.multiply(o);for(let O of H){let U=O.end-O.start;if(U<0.000001)continue;let Y=p.translate(y.multiply(O.start+U/2)).translate(V.multiply(0.5)),X=U,K=o,J=y.slope*180/Math.PI;a.push({type:"pcb_cutout",shape:"rect",center:{x:Y.x,y:Y.y},width:X,height:K,rotation:J,corner_radius:o/2})}}return{tabCutouts:a,mouseBiteHoles:c}};function emi(e,t){let n=[],o=[],{tabWidth:r,tabLength:i,mouseBites:s}=t,a=[];for(let u of e)if(u.width&&u.height)a.push(Math.min(u.width,u.height));else if(u.outline&&u.outline.length>0){let _=new El(u.outline.map((m)=>P_(m.x,m.y))),p=Math.abs(_.area());if(p>0)a.push(Math.sqrt(p))}if(a.length>0){let _=Math.min(...a)/20;r=Math.min(r,gst*Math.max(_,0.3)),i=Math.min(i,kPn*Math.max(_,0.3))}let c=e.map((u)=>{if((!u.outline||u.outline.length===0)&&u.width&&u.height){let _=u.width/2,p=u.height/2;return{...u,outline:[{x:u.center.x-_,y:u.center.y-p},{x:u.center.x+_,y:u.center.y-p},{x:u.center.x+_,y:u.center.y+p},{x:u.center.x-_,y:u.center.y+p}]}}return u});for(let u of c)if(u.outline&&u.outline.length>0){let _=r*0.45,p=_*0.1,m=LPn(u.outline,{gapLength:i,cutoutWidth:r,mouseBites:s,mouseBiteHoleDiameter:_,mouseBiteHoleSpacing:p});n.push(...m.tabCutouts),o.push(...m.mouseBiteHoles)}let l=n.map((u,_)=>({...u,pcb_cutout_id:`panel_tab_${_}`})),h=r*0.45,d=o.map((u,_)=>({type:"pcb_hole",pcb_hole_id:`panel_mouse_bite_${_}`,hole_shape:"circle",hole_diameter:h,x:u.x,y:u.y}));return{tabCutouts:l,mouseBiteHoles:d}}function tmi(e,t){return e.map((r)=>{if((!r.outline||r.outline.length===0)&&r.width&&r.height){let i=r.width/2,s=r.height/2;return{...r,outline:[{x:r.center.x-i,y:r.center.y-s},{x:r.center.x+i,y:r.center.y-s},{x:r.center.x+i,y:r.center.y+s},{x:r.center.x-i,y:r.center.y+s}]}}return r}).flatMap((r)=>{if(!r.outline||r.outline.length===0)return[];let{tabCutouts:i}=LPn(r.outline,{gapLength:0,cutoutWidth:t.cutoutWidth,mouseBites:!1,mouseBiteHoleDiameter:0,mouseBiteHoleSpacing:0});return i.map((s)=>({...s,pcb_board_id:r.pcb_board_id}))}).map((r,i)=>({...r,pcb_cutout_id:`panel_outline_routing_cutout_${i}`}))}var J9e=(e)=>{let t=e._parsedProps,n=t.width!=null?Ke.parse(t.width):void 0,o=t.height!=null?Ke.parse(t.height):void 0;if((n===void 0||o===void 0)&&t.outline?.length){let r=Hs(t.outline);if(r)n??=r.maxX-r.minX,o??=r.maxY-r.minY}if((n===void 0||o===void 0)&&t.circuitJson?.length){let r=t.circuitJson.find((i)=>i.type==="pcb_board");if(r)n??=r.width,o??=r.height}return{width:n??0,height:o??0}};function nmi({items:e,db:t,row:n,col:o,cellWidth:r,cellHeight:i,boardGap:s,availablePanelWidth:a,availablePanelHeight:c}){let l=e.map((I)=>{let v=omi(I,t);return{item:I,width:v.width,height:v.height}}).filter((I)=>!(I.width===0&&I.height===0));if(l.length===0)return{positions:[],gridWidth:0,gridHeight:0};let h,d,u=r?Ke.parse(r):0,_=i?Ke.parse(i):0;if(o!==void 0)h=o,d=n??Math.ceil(l.length/h);else if(n!==void 0)d=n,h=Math.ceil(l.length/d);else if(a!==void 0&&c!==void 0){let I=Math.max(...l.map((B)=>B.width),u),v=Math.max(...l.map((B)=>B.height),_),P=Math.max(1,Math.floor((a+s)/(I+s))),M=Math.max(1,Math.floor((c+s)/(v+s)));if(h=P,d=Math.ceil(l.length/h),d>M){if(d=M,h=Math.ceil(l.length/d),h>P)h=P,d=Math.ceil(l.length/h)}h=Math.max(1,h),d=Math.max(1,d)}else h=Math.ceil(Math.sqrt(l.length)),d=Math.ceil(l.length/h);let p=Array(h).fill(0),m=Array(d).fill(0);l.forEach((I,v)=>{let P=v%h,M=Math.floor(v/h);if(M<m.length&&I.height>m[M])m[M]=I.height;if(P<p.length&&I.width>p[P])p[P]=I.width});for(let I=0;I<p.length;I++)p[I]=Math.max(p[I],u);for(let I=0;I<m.length;I++)m[I]=Math.max(m[I],_);let A=p.reduce((I,v)=>I+v,0)+(h>1?(h-1)*s:0),g=m.reduce((I,v)=>I+v,0)+(d>1?(d-1)*s:0),f=-A/2,y=-g/2,x=[f];for(let I=1;I<h;I++)x.push(x[I-1]+p[I-1]+s);let C=[y];for(let I=1;I<d;I++)C.push(C[I-1]+m[I-1]+s);let b=[];return l.forEach((I,v)=>{let P=v%h,M=Math.floor(v/h);if(M>=C.length||P>=x.length)return;let B=x[P]+p[P]/2,T=C[M]+m[M]/2;b.push({item:I.item,pos:{x:B,y:T}})}),{positions:b,gridWidth:A,gridHeight:g}}function omi(e,t){if(e.componentName==="Board"){let n=e;if(t&&n.pcb_board_id){let o=t.pcb_board.get(n.pcb_board_id);if(o?.width!==void 0&&o?.height!==void 0)return{width:o.width,height:o.height}}return J9e(n)}if(e.componentName==="Subpanel"){let n=e,o=n._parsedProps;if(o.width!==void 0&&o.height!==void 0)return{width:Ke.parse(o.width),height:Ke.parse(o.height)};let r=n._getDirectBoardChildren();if(r.length===0){let a=n._getAllBoardInstances();if(a.length===0)return{width:0,height:0};let c=1/0,l=1/0,h=-1/0,d=-1/0;for(let u of a){let _=J9e(u);if(_.width===0||_.height===0)continue;let p=u._panelPositionOffset??{x:0,y:0};c=Math.min(c,p.x-_.width/2),h=Math.max(h,p.x+_.width/2),l=Math.min(l,p.y-_.height/2),d=Math.max(d,p.y+_.height/2)}if(c===1/0)return{width:0,height:0};return{width:h-c,height:d-l}}if(r.length===1)return J9e(r[0]);if(n._cachedGridWidth>0&&n._cachedGridHeight>0){let a=Ke.parse(o.edgePadding??5);return{width:n._cachedGridWidth+a*2,height:n._cachedGridHeight+a*2}}let i=0,s=0;for(let a of r){let c=J9e(a);i=Math.max(i,c.width),s=Math.max(s,c.height)}return{width:i,height:s}}return{width:0,height:0}}var HPn=class e extends UP{pcb_panel_id=null;_panelizationFeaturesGenerated=!1;get config(){return{componentName:"Subpanel",zodProps:fSt}}get _errorComponentName(){return this.componentName.toLowerCase()}get isGroup(){return!0}get isSubcircuit(){return!0}_getPcbLayoutMode(){return"none"}doInitialSchematicComponentRender(){}doInitialSchematicLayout(){}doInitialSchematicTraceRender(){}add(t){if(t.lowercaseComponentName!=="board"&&t.lowercaseComponentName!=="subpanel")throw Error(`<${this._errorComponentName}> can only contain <board> or <subpanel> elements`);super.add(t)}_cachedGridWidth=0;_cachedGridHeight=0;_panelPositionOffset=null;_computePcbGlobalTransformBeforeLayout(){if(this._panelPositionOffset){let t=this.parent?._computePcbGlobalTransformBeforeLayout?.()??fh();return Hi(t,Ii(this._panelPositionOffset.x,this._panelPositionOffset.y))}return super._computePcbGlobalTransformBeforeLayout()}_getAllBoardInstances(){let t=[];for(let n of this.children)if(n instanceof Iv)t.push(n);else if(n instanceof e)t.push(...n._getAllBoardInstances());return t}_containsBoards(){for(let t of this.children){if(t.componentName==="Board")return!0;if(t.componentName==="Subpanel"&&"_containsBoards"in t){if(t._containsBoards())return!0}}return!1}_getDirectBoardChildren(){return this.children.filter((t)=>t instanceof Iv)}doInitialPanelBoardLayout(){if(this.root?.pcbDisabled)return;let t=this._parsedProps.layoutMode??"none",n=this.children.filter((_)=>_ instanceof Iv||_ instanceof e);if(t!=="none")for(let _ of n){if(!(_ instanceof Iv))continue;if(_._hasUserDefinedPcbPosition())this.root.db.source_property_ignored_warning.insert({source_component_id:_.source_component_id,property_name:"pcbX/pcbY",message:`Board has manual positioning but ${this._errorComponentName} layout mode is "${t}". Manual positioning will be ignored.`,error_type:"source_property_ignored_warning"})}if(t==="none"&&n.length>1){if(n.filter((p)=>!p._hasUserDefinedPcbPosition()).length>1)this.root.db.pcb_placement_error.insert({error_type:"pcb_placement_error",message:`Multiple boards/subpanels in ${this._errorComponentName} without positions. When layoutMode="none", each item must have explicit positioning. Use layoutMode="grid" for automatic positioning.`})}if(t!=="grid")return;let o=this._parsedProps.tabWidth??gst,r=this._parsedProps.boardGap??o,i,s,a=this._parsedProps.row!==void 0||this._parsedProps.col!==void 0,c=this._parsedProps.width!==void 0,l=this._parsedProps.height!==void 0;if(!a&&c&&l){let{edgePadding:_,edgePaddingLeft:p,edgePaddingRight:m,edgePaddingTop:A,edgePaddingBottom:g}=this._parsedProps,f=Ke.parse(_??5),y=Ke.parse(p??f),x=Ke.parse(m??f),C=Ke.parse(A??f),b=Ke.parse(g??f),I=Ke.parse(this._parsedProps.width),v=Ke.parse(this._parsedProps.height);i=I-y-x,s=v-C-b}let{positions:h,gridWidth:d,gridHeight:u}=nmi({items:n,row:this._parsedProps.row,col:this._parsedProps.col,cellWidth:this._parsedProps.cellWidth,cellHeight:this._parsedProps.cellHeight,boardGap:r,availablePanelHeight:s,availablePanelWidth:i});this._cachedGridWidth=d,this._cachedGridHeight=u;for(let{item:_,pos:p}of h)_._panelPositionOffset=p}doInitialPanelLayout(){if(this.root?.pcbDisabled)return;let{db:t}=this.root;if((this._parsedProps.layoutMode??"none")==="grid"){for(let o of this.children)if(o instanceof Iv){if(!o.pcb_board_id||!o._panelPositionOffset)continue;t.pcb_board.update(o.pcb_board_id,{position_mode:"relative_to_panel_anchor",display_offset_x:`${o._panelPositionOffset.x}mm`,display_offset_y:`${o._panelPositionOffset.y}mm`})}else if(o instanceof e&&o._panelPositionOffset)for(let r of o._getAllBoardInstances()){if(!r.pcb_board_id)continue;let i=r._panelPositionOffset??{x:0,y:0};t.pcb_board.update(r.pcb_board_id,{position_mode:"relative_to_panel_anchor",display_offset_x:`${o._panelPositionOffset.x+i.x}mm`,display_offset_y:`${o._panelPositionOffset.y+i.y}mm`})}this._updatePanelDimensions()}else{let o=this._getGlobalPcbPositionBeforeLayout();for(let r of this._getDirectBoardChildren()){if(!r.pcb_board_id)continue;let i=t.pcb_board.get(r.pcb_board_id);if(!i)continue;let s=i.center.x-o.x,a=i.center.y-o.y;t.pcb_board.update(r.pcb_board_id,{position_mode:"relative_to_panel_anchor",display_offset_x:`${s}mm`,display_offset_y:`${a}mm`})}}this._generatePanelizationFeatures()}_updatePanelDimensions(){let{db:t}=this.root,n=this._parsedProps.width!==void 0,o=this._parsedProps.height!==void 0,r=this._cachedGridWidth,i=this._cachedGridHeight;if(!this.pcb_group_id)return;if(n&&o)t.pcb_group.update(this.pcb_group_id,{width:Ke.parse(this._parsedProps.width),height:Ke.parse(this._parsedProps.height)});else if(r>0||i>0){let{edgePadding:s,edgePaddingLeft:a,edgePaddingRight:c,edgePaddingTop:l,edgePaddingBottom:h}=this._parsedProps,d=Ke.parse(s??5),u=Ke.parse(a??d),_=Ke.parse(c??d),p=Ke.parse(l??d),m=Ke.parse(h??d);t.pcb_group.update(this.pcb_group_id,{width:n?Ke.parse(this._parsedProps.width):r+u+_,height:o?Ke.parse(this._parsedProps.height):i+p+m})}}_generatePanelizationFeatures(){if(this._panelizationFeaturesGenerated)return;let{db:t}=this.root,n=this._parsedProps,o=n.panelizationMethod??"none",r=this._getAllBoardInstances();if(o!=="none"){let i=r.map((c)=>c.pcb_board_id).filter((c)=>!!c),s=t.pcb_board.list().filter((c)=>i.includes(c.pcb_board_id));if(s.length===0)return;let a=n.tabWidth??gst;if(o==="outline_routing"){let c=tmi(s,{cutoutWidth:a});for(let l of c)t.pcb_cutout.insert({...l,pcb_group_id:this.pcb_group_id??void 0,pcb_panel_id:this.pcb_panel_id??void 0})}else{let c=n.boardGap??a,{tabCutouts:l,mouseBiteHoles:h}=emi(s,{boardGap:c,tabWidth:a,tabLength:n.tabLength??kPn,mouseBites:n.mouseBites??!0});for(let d of l)t.pcb_cutout.insert(d);for(let d of h)t.pcb_hole.insert(d)}}this._panelizationFeaturesGenerated=!0}doInitialPcbComponentRender(){if(this.root?.pcbDisabled)return;if(!this._containsBoards())throw Error(`<${this._errorComponentName}> must contain at least one <board>`);super.doInitialPcbComponentRender()}};var rmi=class extends HPn{get config(){return{componentName:"Panel",zodProps:uze}}doInitialPcbComponentRender(){if(this.root?.pcbDisabled)return;if(!this._containsBoards())throw Error(`<${this._errorComponentName}> must contain at least one <board>`);let{db:e}=this.root,t=this._parsedProps,n=e.pcb_panel.insert({width:t.width!==void 0?Ke.parse(t.width):0,height:t.height!==void 0?Ke.parse(t.height):0,thickness:1.6,center:this._getGlobalPcbPositionBeforeLayout(),covered_with_solder_mask:!(t.noSolderMask??!1)});this.pcb_panel_id=n.pcb_panel_id}_updatePanelDimensions(){let{db:e}=this.root,t=this._parsedProps.width!==void 0,n=this._parsedProps.height!==void 0,o=this._cachedGridWidth,r=this._cachedGridHeight;if(!this.pcb_panel_id)return;if(t&&n)e.pcb_panel.update(this.pcb_panel_id,{width:Ke.parse(this._parsedProps.width),height:Ke.parse(this._parsedProps.height)});else if(o>0||r>0){let{edgePadding:i,edgePaddingLeft:s,edgePaddingRight:a,edgePaddingTop:c,edgePaddingBottom:l}=this._parsedProps,h=Ke.parse(i??5),d=Ke.parse(s??h),u=Ke.parse(a??h),_=Ke.parse(c??h),p=Ke.parse(l??h);e.pcb_panel.update(this.pcb_panel_id,{width:t?Ke.parse(this._parsedProps.width):o+d+u,height:n?Ke.parse(this._parsedProps.height):r+_+p})}}updatePcbComponentRender(){if(this.root?.pcbDisabled)return;if(!this.pcb_panel_id)return;let{db:e}=this.root,t=this._parsedProps,n=e.pcb_panel.get(this.pcb_panel_id);e.pcb_panel.update(this.pcb_panel_id,{width:t.width!==void 0?Ke.parse(t.width):n?.width,height:t.height!==void 0?Ke.parse(t.height):n?.height,center:this._getGlobalPcbPositionBeforeLayout(),covered_with_solder_mask:!(t.noSolderMask??!1)})}removePcbComponentRender(){if(!this.pcb_panel_id)return;this.root?.db.pcb_panel.delete(this.pcb_panel_id),this.pcb_panel_id=null}},imi=1,Z9e=1,smi=(e)=>{let t=e.route.map((m)=>m.x),n=e.route.map((m)=>m.y),o=e.traceWidth/2+imi,r=Math.min(...t)-o,i=Math.max(...t)+o,s=Math.min(...n)-o,a=Math.max(...n)+o,c=[e.feedPoint,...e.secondaryPort?[e.secondaryPort.point]:[]],l=Math.min(...c.map((m)=>m.x))-Z9e,h=Math.max(...c.map((m)=>m.x))+Z9e,d=Math.min(...c.map((m)=>m.y))-Z9e,u=Math.max(...c.map((m)=>m.y))+Z9e,_=[],p=(m,A,g,f)=>{if(A<=m||f<=g)return;_.push({center:{x:(m+A)/2,y:(g+f)/2},width:A-m,height:f-g})};if(e.feedKeepoutOpeningDirection==="left")p(r,i,u,a),p(r,i,s,d),p(h,i,d,u);else p(r,l,s,u),p(h,i,s,u),p(r,i,u,a);return _},ami=(e)=>{switch(e){case"2.4ghz_quarter_wave_monopole":return{traceWidth:0.6,feedPoint:{x:0,y:0},feedKeepoutOpeningDirection:"left",route:[{x:0,y:0},{x:31,y:0}]};case"2.4ghz_meandered_monopole":return{traceWidth:0.5,feedPoint:{x:0,y:0},feedKeepoutOpeningDirection:"bottom",route:[{x:0,y:0},{x:0,y:6},{x:3,y:6},{x:3,y:1.5},{x:6,y:1.5},{x:6,y:6},{x:9,y:6},{x:9,y:1.5},{x:12,y:1.5},{x:12,y:6},{x:15,y:6}]};case"2.4ghz_inverted_f":return{traceWidth:0.8,feedPoint:{x:0,y:0},feedKeepoutOpeningDirection:"bottom",secondaryPort:{point:{x:-4,y:0},role:"ground"},groundViaPoint:{x:-4,y:0},route:[{x:-4,y:0},{x:-4,y:3},{x:0,y:3},{x:0,y:0},{x:0,y:3},{x:-4,y:3},{x:-4,y:8},{x:22,y:8}]};case"2.4ghz_meandered_inverted_f":return{traceWidth:0.5,feedPoint:{x:0,y:0},feedKeepoutOpeningDirection:"bottom",secondaryPort:{point:{x:-1.7,y:0},role:"ground"},groundViaPoint:{x:-1.7,y:0},route:[{x:-1.7,y:0},{x:-1.7,y:4.9},{x:0,y:4.9},{x:0,y:0},{x:0,y:4.9},{x:-1.7,y:4.9},{x:2.3,y:4.9},{x:2.3,y:1.4},{x:5.3,y:1.4},{x:5.3,y:4.9},{x:8.3,y:4.9},{x:8.3,y:1.4},{x:11.3,y:1.4},{x:11.3,y:4.9},{x:13.3,y:4.9}]};case"2.4ghz_folded_dipole":return{traceWidth:0.9,feedPoint:{x:0,y:0},feedKeepoutOpeningDirection:"bottom",secondaryPort:{point:{x:1.2,y:0},role:"feed2"},route:[{x:0,y:0},{x:-22.4,y:0},{x:-22.4,y:9},{x:23.6,y:9},{x:23.6,y:0},{x:1.2,y:0}]}}},cmi=class extends Xl{get config(){return{componentName:"Antenna",zodProps:YSt,sourceFtype:LP.simple_chip,shouldRenderAsSchematicBox:!0}}getRefDesPrefixes(){return["ANT"]}initPorts(){let{antennaShape:e,pcbPath:t}=this._parsedProps,n=t?void 0:e==="2.4ghz_inverted_f"||e==="2.4ghz_meandered_inverted_f"?"ground":e==="2.4ghz_folded_dipole"?"feed2":void 0;super.initPorts({pinCount:n?2:1,additionalAliases:{pin1:n==="feed2"?["feed","feed1"]:["feed"],...n==="ground"?{pin2:["ground","gnd"]}:n==="feed2"?{pin2:["feed2"]}:{}}})}doInitialReactSubtreesRender(){super.doInitialReactSubtreesRender();let{antennaShape:e,pcbPath:t}=this._parsedProps;if(!e)return;let n=this.children.some((i)=>i.componentName==="Footprint");if(t&&n)return;let o=t?void 0:ami(e),r=new R8e({name:`${this.name}_generated_antenna`});if(!n)r.add(new WB({shape:"rect",width:0.8,height:0.8,pcbX:o?.feedPoint.x??0,pcbY:o?.feedPoint.y??0,layer:"top",portHints:["pin1"],coveredWithSolderMask:!0}));if(o){let i=smi(o);for(let a of i)r.add(new kve({shape:"rect",pcbX:a.center.x,pcbY:a.center.y,width:a.width,height:a.height,layers:[...this.root?._getBoard()?.allLayers??["top","bottom"]],excludeRefs:[this.getSubcircuitSelector()]}));let s=new kst({route:o.route.map((a)=>({route_type:"wire",...a,width:o.traceWidth,layer:"top"}))});if(s.isAntennaTrace=!0,r.add(s),o.secondaryPort&&!o.groundViaPoint&&!n)r.add(new WB({shape:"rect",width:0.8,height:0.8,pcbX:o.secondaryPort.point.x,pcbY:o.secondaryPort.point.y,layer:"top",portHints:["pin2"],coveredWithSolderMask:!0}));if(o.groundViaPoint)r.add(new UB({shape:"circle",pcbX:o.groundViaPoint.x,pcbY:o.groundViaPoint.y,holeDiameter:0.3,outerDiameter:0.7,portHints:["pin2"],coveredWithSolderMask:!0}))}this.add(r)}doInitialCreateTracesFromProps(){super.doInitialCreateTracesFromProps();let{pcbPath:e}=this._parsedProps;if(!e)return;let t=new O_({name:`${this.name}_pcb_path`,path:[`${this.getSubcircuitSelector()} > port.pin1`],pcbPath:e});t.isAntennaTrace=!0,this.add(t)}},lmi=class extends $ue{constructor(e){super(e)}get config(){return{...super.config,componentName:"Pinout",zodProps:ISt}}doInitialSourceRender(){let{db:e}=this.root,{_parsedProps:t}=this,n=e.source_component.insert({ftype:"simple_pinout",name:this.name,manufacturer_part_number:hi(t),supplier_part_numbers:t.supplierPartNumbers,display_name:t.displayName});this.source_component_id=n.source_component_id}},hmi=class extends Xl{get config(){return{componentName:"fuse",schematicSymbolName:this.props.symbolName??"fuse",zodProps:ESt,sourceFtype:LP.simple_fuse}}_getSchematicSymbolDisplayValue(){if(this._parsedProps.schShowRatings===!1)return"";let e=this._parsedProps.currentRating,t=this._parsedProps.voltageRating,n=Ta(e,"A").value,o=Ta(t,"V").value;return`${vd(n)}A / ${vd(o)}V`}doInitialSourceRender(){let{db:e}=this.root,{_parsedProps:t}=this,n=Ta(t.currentRating,"A").value,o=Ta(t.voltageRating,"V").value,r,i;if(t.schShowRatings!==!1)r=`${vd(n)}A`,i=`${vd(o)}V`;let s=e.source_component.insert({name:this.name,ftype:LP.simple_fuse,manufacturer_part_number:hi(t),supplier_part_numbers:t.supplierPartNumbers,...n!=null?{current_rating_amps:n}:{},...o!=null?{voltage_rating_volts:o}:{},display_current_rating:r,display_voltage_rating:i,display_name:t.displayName});this.source_component_id=s.source_component_id}},dmi=class extends Xl{schematicDimensions=null;get config(){return{schematicSymbolName:void 0,componentName:"Jumper",zodProps:_ze,shouldRenderAsSchematicBox:!0}}_getSchematicPortArrangement(){let e=super._getSchematicPortArrangement();if(e&&Object.keys(e).length>0)return e;let t=this._parsedProps.pinCount??(Array.isArray(this._parsedProps.pinLabels)?this._parsedProps.pinLabels.length:this._parsedProps.pinLabels?Object.keys(this._parsedProps.pinLabels).length:this.getPortsFromFootprint().length),n=this._parsedProps.schDirection??"right";return{leftSize:n==="left"?t:0,rightSize:n==="right"?t:0}}doInitialSourceRender(){let{db:e}=this.root,{_parsedProps:t}=this,{pcbX:n,pcbY:o}=this.getResolvedPcbPositionProp(),r=e.source_component.insert({ftype:"simple_chip",name:this.name,manufacturer_part_number:hi(t),supplier_part_numbers:t.supplierPartNumbers,are_pins_interchangeable:!0,display_name:t.displayName});this.source_component_id=r.source_component_id}doInitialPcbComponentRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,{pcbX:n,pcbY:o}=this.getResolvedPcbPositionProp(),r=this.getGlobalTransformRotation(),i=e.pcb_component.insert({center:{x:n,y:o},width:2,height:3,layer:t.layer??"top",rotation:Bu(r),insertion_direction:this._getPcbComponentInsertionDirection(t.layer??"top",r),source_component_id:this.source_component_id,subcircuit_id:this.getSubcircuit().subcircuit_id??void 0,do_not_place:t.doNotPlace??!1,obstructs_within_bounds:t.obstructsWithinBounds??!0,is_allowed_to_be_off_board:t.allowOffBoard??!1,metadata:t.kicadFootprintMetadata?{kicad_footprint:t.kicadFootprintMetadata}:void 0});this.pcb_component_id=i.pcb_component_id}doInitialPcbPortAttachment(){let{db:e}=this.root,t=e.pcb_port.list({pcb_component_id:this.pcb_component_id}),n={};for(let i=0;i<t.length;i++){let s=t[i],a=e.source_port.get(s.source_port_id),c="";if(typeof a?.pin_number==="number")c=a.pin_number.toString();else if(Array.isArray(a?.port_hints)){let l=a.port_hints.find((h)=>/^(pin)?\d+$/.test(h));if(l)if(/^pin\d+$/.test(l))c=l.replace(/^pin/,"");else c=l}n[c]=s.pcb_port_id}let o=e.pcb_trace.list({pcb_component_id:this.pcb_component_id}),r=(i)=>{if(i&&typeof i==="string"&&i.startsWith("{PIN")){let s=i.replace("{PIN","").replace("}","");return n[s]||i}return i};for(let i of o){if(!i.route)continue;for(let s of i.route){if(s.route_type!=="wire")continue;s.start_pcb_port_id=r(s.start_pcb_port_id),s.end_pcb_port_id=r(s.end_pcb_port_id)}}}},q5n={"0402":"0402","0603":"0603","0805":"0805","1206":"1206"},umi=class extends Xl{get config(){return{componentName:"Interconnect",zodProps:PSt,shouldRenderAsSchematicBox:!0,sourceFtype:"interconnect"}}get defaultInternallyConnectedPinNames(){let{standard:e}=this._parsedProps;if(e&&q5n[e])return[["pin1","pin2"]];return[]}_getImpliedFootprintString(){let{standard:e}=this._parsedProps;if(!e)return null;return q5n[e]??null}doInitialSourceRender(){let{db:e}=this.root,{_parsedProps:t}=this,n=e.source_component.insert({ftype:"interconnect",name:this.name,manufacturer_part_number:hi(t),supplier_part_numbers:t.supplierPartNumbers,are_pins_interchangeable:!0,display_name:t.displayName});this.source_component_id=n.source_component_id}doInitialSourceParentAttachment(){let{db:e}=this.root,t=this._getInternallyConnectedPins();for(let n of t){let o=n.map((r)=>r.source_port_id).filter((r)=>r!==null);if(o.length>=2)e.source_component_internal_connection.insert({source_component_id:this.source_component_id,subcircuit_id:this.getSubcircuit()?.subcircuit_id,source_port_ids:o})}}},pmi=class extends Xl{schematicDimensions=null;_getPinCountFromFootprintString(e){let t=e.match(/^solderjumper([23])(?:_|$)/);if(!t)return null;return Number(t[1])}_getPinNumberFromBridgedPinsProp(e){let t=e.match(/^(?:pin)?(\d+)$/i);if(t)return Number(t[1]);let n=this._parsedProps.pinLabels??this.props.pinLabels;if(Array.isArray(n)){let o=n.findIndex((r)=>r===e);return o>=0?o+1:null}if(n&&typeof n==="object")for(let[o,r]of Object.entries(n)){if(!(Array.isArray(r)?r:[r]).includes(e))continue;let s=o.match(/^(?:pin)?(\d+)$/i);return s?Number(s[1]):null}return null}_getBridgedPinNumbersForFootprint(e){let t=this._parsedProps??this.props;if(Array.isArray(t.bridgedPins)&&t.bridgedPins.length>0)return Array.from(new Set(t.bridgedPins.flat().map((n)=>this._getPinNumberFromBridgedPinsProp(n)).filter((n)=>n!==null&&n>=1&&n<=e))).sort((n,o)=>n-o);if(!t.bridged)return[];return Array.from({length:e},(n,o)=>o+1)}resolveFootprint(){let e=super.resolveFootprint();if(typeof e!=="string")return e;let t=this._getPinCountFromFootprintString(e);if(!t)return e;if(/_bridged\d+/.test(e))return e;let n=this._getBridgedPinNumbersForFootprint(t);if(n.length===0)return e;return e.replace(/^solderjumper[23]/,`solderjumper${t}_bridged${n.join("")}`)}_getPinNumberFromBridgedPinName(e){return this.selectOne(`port.${e}`,{type:"port"})?._parsedProps.pinNumber??null}get defaultInternallyConnectedPinNames(){if(this._parsedProps.bridged){let e=this.children.filter((t)=>t.componentName==="Port").map((t)=>t.name);return e.length>0?[e]:[]}return this._parsedProps.bridgedPins??[]}get config(){let e=this._parsedProps??this.props,t=e.pinCount;if(e.pinCount==null&&!e.footprint)t=2;if(e.pinCount==null){let r=(e.bridgedPins??[]).flat().map((c)=>this._getPinNumberFromBridgedPinName(c)).filter((c)=>c!==null),i=r.length>0?Math.max(...r):0,s=e.pinLabels?Object.keys(e.pinLabels).length:0,a=Math.max(i,s);if(a===2||a===3)t=a;if(t==null&&e.footprint&&[2,3].includes(this.getPortsFromFootprint().length))t=this.getPortsFromFootprint().length}let n="";if(t)n+=`solderjumper${t}`;else n="solderjumper";let o=[];if(Array.isArray(e.bridgedPins)&&e.bridgedPins.length>0)o=Array.from(new Set(e.bridgedPins.flat().map((r)=>this._getPinNumberFromBridgedPinName(r)).filter((r)=>r!==null))).sort((r,i)=>r-i);else if(e.bridged&&t)o=Array.from({length:t},(r,i)=>i+1);if(o.length>0)n+=`_bridged${o.join("")}`;return{schematicSymbolName:e.symbolName??n,componentName:"SolderJumper",zodProps:vSt,shouldRenderAsSchematicBox:!0}}_getSchematicPortArrangement(){let e=super._getSchematicPortArrangement();if(e&&Object.keys(e).length>0)return e;let t=this._parsedProps.pinCount??(Array.isArray(this._parsedProps.pinLabels)?this._parsedProps.pinLabels.length:this._parsedProps.pinLabels?Object.keys(this._parsedProps.pinLabels).length:this.getPortsFromFootprint().length);if(t==null&&!this._parsedProps.footprint)t=2;let n=this._parsedProps.schDirection??"right";return{leftSize:n==="left"?t:0,rightSize:n==="right"?t:0}}doInitialSourceRender(){let{db:e}=this.root,{_parsedProps:t}=this,{pcbX:n,pcbY:o}=this.getResolvedPcbPositionProp(),r=e.source_component.insert({ftype:"simple_chip",name:this.name,manufacturer_part_number:hi(t),supplier_part_numbers:t.supplierPartNumbers,are_pins_interchangeable:!0,display_name:t.displayName});this.source_component_id=r.source_component_id}doInitialPcbComponentRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,{pcbX:n,pcbY:o}=this.getResolvedPcbPositionProp(),r=this.getGlobalTransformRotation(),i=e.pcb_component.insert({center:{x:n,y:o},width:2,height:3,layer:t.layer??"top",rotation:Bu(r),insertion_direction:this._getPcbComponentInsertionDirection(t.layer??"top",r),source_component_id:this.source_component_id,subcircuit_id:this.getSubcircuit().subcircuit_id??void 0,do_not_place:t.doNotPlace??!1,obstructs_within_bounds:t.obstructsWithinBounds??!0,is_allowed_to_be_off_board:t.allowOffBoard??!1,metadata:t.kicadFootprintMetadata?{kicad_footprint:t.kicadFootprintMetadata}:void 0});this.pcb_component_id=i.pcb_component_id}doInitialPcbPortAttachment(){let{db:e}=this.root,t=e.pcb_port.list({pcb_component_id:this.pcb_component_id}),n={};for(let i=0;i<t.length;i++){let s=t[i],a=e.source_port.get(s.source_port_id),c="";if(typeof a?.pin_number==="number")c=a.pin_number.toString();else if(Array.isArray(a?.port_hints)){let l=a.port_hints.find((h)=>/^(pin)?\d+$/.test(h));if(l)if(/^pin\d+$/.test(l))c=l.replace(/^pin/,"");else c=l}n[c]=s.pcb_port_id}let o=e.pcb_trace.list({pcb_component_id:this.pcb_component_id}),r=(i)=>{if(i&&typeof i==="string"&&i.startsWith("{PIN")){let s=i.replace("{PIN","").replace("}","");return n[s]||i}return i};for(let i of o){if(!i.route)continue;for(let s of i.route){if(s.route_type!=="wire")continue;s.start_pcb_port_id=r(s.start_pcb_port_id),s.end_pcb_port_id=r(s.end_pcb_port_id)}}}},mmi=class extends Xl{get config(){return{schematicSymbolName:this.props.symbolName??"power_factor_meter_horz",componentName:"PowerSource",zodProps:zPt,sourceFtype:"simple_power_source"}}initPorts(){this.add(new sd({name:"pin1",pinNumber:1,aliases:["positive","pos"]})),this.add(new sd({name:"pin2",pinNumber:2,aliases:["negative","neg"]}))}doInitialSourceRender(){let{db:e}=this.root,{_parsedProps:t}=this,n=e.source_component.insert({ftype:"simple_power_source",name:this.name,voltage:t.voltage,supplier_part_numbers:t.supplierPartNumbers,manufacturer_part_number:hi(t),are_pins_interchangeable:!1,display_name:t.displayName});this.source_component_id=n.source_component_id}pos=this.portMap.pin1;positive=this.portMap.pin1;neg=this.portMap.pin2;negative=this.portMap.pin2},FPn=class extends Xl{simulation_voltage_source_id=null;get config(){return{componentName:"VoltageSource",schematicSymbolName:this.props.waveShape==="square"?"square_wave":"ac_voltmeter",zodProps:OPt,sourceFtype:"simple_voltage_source"}}runRenderPhaseForChildren(e){if(e.startsWith("Pcb"))return;for(let t of this.children)t.runRenderPhaseForChildren(e),t.runRenderPhase(e)}doInitialPcbComponentRender(){let e=this._hasUserDefinedPcbPosition();if(!this._parsedProps.footprint){if(!e)return;throw Error("VoltageSource requires a footprint when pcbX/pcbY or pcb edge position props are used")}super.doInitialPcbComponentRender()}initPorts(){super.initPorts({additionalAliases:{pin1:["terminal1"],pin2:["terminal2"]}})}_getSchematicSymbolDisplayValue(){let{voltage:e,frequency:t}=this._parsedProps,n=[];if(e!==void 0)n.push(`${vd(e)}V`);if(t!==void 0)n.push(`${vd(t)}Hz`);return n.length>0?n.join(" "):void 0}doInitialSourceRender(){let{db:e}=this.root,{_parsedProps:t}=this,n=e.source_component.insert({ftype:"simple_voltage_source",name:this.name,voltage:t.voltage,frequency:t.frequency,peak_to_peak_voltage:t.peakToPeakVoltage,wave_shape:t.waveShape,phase:t.phase,duty_cycle:t.dutyCycle,pulse_delay:t.pulseDelay,rise_time:t.riseTime,fall_time:t.fallTime,pulse_width:t.pulseWidth,period:t.period,supplier_part_numbers:t.supplierPartNumbers,manufacturer_part_number:hi(t),are_pins_interchangeable:!0,display_name:t.displayName});this.source_component_id=n.source_component_id}doInitialSimulationRender(){let{db:e}=this.root,{_parsedProps:t}=this,n=this.portMap.terminal1,o=this.portMap.terminal2,r=e.simulation_voltage_source.insert({is_dc_source:!1,terminal1_source_port_id:n.source_port_id??void 0,terminal2_source_port_id:o.source_port_id??void 0,voltage:t.voltage,frequency:t.frequency,peak_to_peak_voltage:t.peakToPeakVoltage,wave_shape:t.waveShape,phase:t.phase,duty_cycle:t.dutyCycle,pulse_delay:t.pulseDelay,rise_time:t.riseTime,fall_time:t.fallTime,pulse_width:t.pulseWidth,period:t.period,ac_magnitude:t.acMagnitude,ac_phase:t.acPhase});this.simulation_voltage_source_id=r.simulation_voltage_source_id}terminal1=this.portMap.terminal1;terminal2=this.portMap.terminal2},zPn=class extends Xl{simulation_current_source_id=null;get config(){return{componentName:"CurrentSource",schematicSymbolName:"current_source",zodProps:VPt,sourceFtype:"simple_current_source"}}runRenderPhaseForChildren(e){if(e.startsWith("Pcb"))return;for(let t of this.children)t.runRenderPhaseForChildren(e),t.runRenderPhase(e)}doInitialPcbComponentRender(){let e=this._hasUserDefinedPcbPosition();if(!this._parsedProps.footprint){if(!e)return;throw Error("CurrentSource requires a footprint when pcbX/pcbY or pcb edge position props are used")}super.doInitialPcbComponentRender()}initPorts(){super.initPorts({additionalAliases:{pin1:["pos"],pin2:["neg"]}})}_getSchematicSymbolDisplayValue(){let{current:e,frequency:t,peakToPeakCurrent:n}=this._parsedProps,o=[];if(e!==void 0)o.push(`${vd(e)}A`);if(n!==void 0)o.push(`${vd(n)}A p-p`);if(t!==void 0)o.push(`${vd(t)}Hz`);return o.length>0?o.join(" "):void 0}doInitialSourceRender(){let{db:e}=this.root,{_parsedProps:t}=this,n=e.source_component.insert({ftype:"simple_current_source",name:this.name,current:t.current,frequency:t.frequency,peak_to_peak_current:t.peakToPeakCurrent,wave_shape:t.waveShape,phase:t.phase,duty_cycle:t.dutyCycle,supplier_part_numbers:t.supplierPartNumbers,manufacturer_part_number:hi(t),are_pins_interchangeable:!0,display_name:t.displayName});this.source_component_id=n.source_component_id}doInitialSimulationRender(){let{db:e}=this.root,{_parsedProps:t}=this,n=t.frequency!==void 0||t.peakToPeakCurrent!==void 0||t.waveShape!==void 0||t.acMagnitude!==void 0||t.acPhase!==void 0,o=this.portMap.pos,r=this.portMap.neg;if(n){let i=e.simulation_current_source.insert({is_dc_source:!1,terminal1_source_port_id:o.source_port_id??void 0,terminal2_source_port_id:r.source_port_id??void 0,current:t.current,frequency:t.frequency,peak_to_peak_current:t.peakToPeakCurrent,wave_shape:t.waveShape,phase:t.phase,duty_cycle:t.dutyCycle,ac_magnitude:t.acMagnitude,ac_phase:t.acPhase});this.simulation_current_source_id=i.simulation_current_source_id}else{if(t.current===void 0)return;let i=e.simulation_current_source.insert({is_dc_source:!0,positive_source_port_id:o.source_port_id??void 0,negative_source_port_id:r.source_port_id??void 0,current:t.current,ac_magnitude:t.acMagnitude,ac_phase:t.acPhase});this.simulation_current_source_id=i.simulation_current_source_id}}pos=this.portMap.pos;neg=this.portMap.neg},P8e=0.25,J5n=(e,t)=>({left:e.center.x-e.size.width/2-t,right:e.center.x+e.size.width/2+t,bottom:e.center.y-e.size.height/2-t,top:e.center.y+e.size.height/2+t}),_mi=(e,t)=>e.left<t.right&&e.right>t.left&&e.bottom<t.top&&e.top>t.bottom,gmi=({baseCenter:e,size:t})=>{let n=t.width+P8e*2,o=t.height+P8e*2;return[e,{x:e.x,y:e.y+o},{x:e.x,y:e.y-o},{x:e.x+n,y:e.y},{x:e.x-n,y:e.y},{x:e.x+n,y:e.y+o},{x:e.x-n,y:e.y+o},{x:e.x+n,y:e.y-o},{x:e.x-n,y:e.y-o},{x:e.x,y:e.y+o*2},{x:e.x,y:e.y-o*2}]},Ami=({ammeterSourcePortId:e,schematicPorts:t,sourceTraces:n})=>{for(let o of n){if(!o.connected_source_port_ids.includes(e))continue;let r=o.connected_source_port_ids.find((s)=>s!==e);if(r===void 0)continue;let i=t.find((s)=>s.source_port_id===r);if(i)return i}return null},fmi=(e)=>({x:e.reduce((t,n)=>t+n.center.x,0)/e.length,y:e.reduce((t,n)=>t+n.center.y,0)/e.length}),ymi=({ammeter:e,db:t,oldCenter:n,newCenter:o})=>{let r=e.schematic_component_id;if(!r)return;let i=o.x-n.x,s=o.y-n.y;if(i===0&&s===0)return;t.schematic_component.update(r,{center:o});for(let a of t.schematic_port.list({schematic_component_id:r}))t.schematic_port.update(a.schematic_port_id,{center:{x:a.center.x+i,y:a.center.y+s}});for(let a of t.schematic_text.list({schematic_component_id:r}))t.schematic_text.update(a.schematic_text_id,{position:{x:a.position.x+i,y:a.position.y+s}});HZ({db:t,schematicComponentId:r,deltaX:i,deltaY:s})},xmi=(e)=>{let{root:t}=e;if(!t||t.schematicDisabled)return;if(!e.schematic_component_id)return;if(e._parsedProps.schX!==void 0||e._parsedProps.schY!==void 0)return;if(e.getGroup()?._getSchematicLayoutMode()!=="relative")return;let{db:n}=t,o=n.schematic_component.get(e.schematic_component_id);if(!o)return;let r=[e.portMap.pos.source_port_id,e.portMap.neg.source_port_id].filter((d)=>typeof d==="string");if(r.length===0)return;let i=n.schematic_port.list(),s=n.source_trace.list(),a=r.map((d)=>Ami({ammeterSourcePortId:d,schematicPorts:i,sourceTraces:s})).filter((d)=>d!==null);if(a.length===0)return;let c=fmi(a),l=n.schematic_component.list().filter((d)=>d.schematic_component_id!==o.schematic_component_id&&!d.is_schematic_group&&d.schematic_sheet_id===o.schematic_sheet_id).map((d)=>J5n(d,P8e)),h=gmi({baseCenter:c,size:o.size}).find((d)=>{let u=J5n({...o,center:d},P8e);return!l.some((_)=>_mi(u,_))})??c;ymi({ammeter:e,db:n,oldCenter:o.center,newCenter:h})},Cmi=class extends Xl{simulation_current_probe_id=null;get config(){return{componentName:"Ammeter",schematicSymbolName:"dc_ammeter",zodProps:GPt,sourceFtype:"simple_ammeter"}}runRenderPhaseForChildren(e){if(e.startsWith("Pcb"))return;for(let t of this.children)t.runRenderPhaseForChildren(e),t.runRenderPhase(e)}doInitialPcbComponentRender(){let e=this._hasUserDefinedPcbPosition();if(!this._parsedProps.footprint){if(!e)return;throw Error("Ammeter requires a footprint when pcbX/pcbY or pcb edge position props are used")}super.doInitialPcbComponentRender()}initPorts(){super.initPorts({ignoreSymbolPorts:!0,pinCount:2,additionalAliases:{pin1:["pos"],pin2:["neg"]}});let e=zs[this._getSchematicSymbolNameOrThrow()];this.portMap.pos.schematicSymbolPortDef=e.ports.find((t)=>t.labels.includes("1"))??null,this.portMap.neg.schematicSymbolPortDef=e.ports.find((t)=>t.labels.includes("2"))??null}doInitialSourceRender(){let{db:e}=this.root,{supplierPartNumbers:t,displayName:n}=this._parsedProps,o=e.source_component.insert({ftype:"simple_ammeter",name:this.name,supplier_part_numbers:t,manufacturer_part_number:hi(this._parsedProps),display_name:n});this.source_component_id=o.source_component_id}doInitialSimulationRender(){let{db:e}=this.root,{color:t,graphDisplayName:n,graphCenter:o,graphVerticalOffset:r,graphCurrentPerDiv:i}=this._parsedProps,s=this.portMap.pos,a=this.portMap.neg,{simulation_current_probe_id:c}=e.simulation_current_probe.insert({type:"simulation_current_probe",name:this.name,source_component_id:this.source_component_id,positive_source_port_id:s.source_port_id,negative_source_port_id:a.source_port_id,subcircuit_id:this.getSubcircuit()?.subcircuit_id??void 0,color:t});if(this.simulation_current_probe_id=c,n!==void 0||o!==void 0||r!==void 0||i!==void 0){let h=xL(i),d=xL(r);e.simulation_oscilloscope_trace.insert({simulation_current_probe_id:c,display_name:n,color:t,display_center_value:o,amps_per_div:h,display_center_offset_divs:d!==void 0&&h!==void 0&&h!==0?d/h:void 0})}}doInitialSchematicLayout(){xmi(this)}pos=this.portMap.pos;neg=this.portMap.neg},bmi=["leftedge","rightedge","topedge","bottomedge","center"],Imi=class extends lr{get config(){return{componentName:"Constraint",zodProps:LSt}}constructor(e){super(e);if("xdist"in e||"ydist"in e){if(!("edgeToEdge"in e)&&!("centerToCenter"in e))throw Error(`edgeToEdge, centerToCenter must be set for xDist or yDist for ${this}`)}if("for"in e&&e.for.length<2)throw Error(`"for" must have at least two selectors for ${this}`)}_getAllReferencedComponents(){let e=[],t=this.getPrimitiveContainer();function n(o){let r=o.split(" ").pop(),i=bmi.includes(r)?r:void 0,s=i?o.replace(` ${i}`,""):o,a=t.selectOne(s,{pcbPrimitive:!0});if(a)e.push({selector:o,component:a,componentSelector:s,edge:i})}for(let o of["left","right","top","bottom"])if(o in this._parsedProps)n(this._parsedProps[o]);if("for"in this._parsedProps)for(let o of this._parsedProps.for)n(o);return{componentsWithSelectors:e}}},vmi=(e)=>{if(!e||typeof e!=="object")return!1;return typeof e.getSourcePort==="function"},Smi=(e)=>{if(!e||typeof e!=="object")return!1;return typeof e.getSourceNet==="function"},Pmi=(e)=>{if(!e||typeof e!=="object")return!1;return typeof e.getPorts==="function"},Emi=(e)=>{if(!e||typeof e!=="object")return!1;return typeof e.type==="string"},xde=(e)=>typeof e==="string"&&e.length>0,Ast=class{constructor(e){this.port=e}port;getPcbPort(){let e=this.port.pcb_port_id;if(!e)return null;return this.port.root?.db.pcb_port.get(e)??null}getSourcePort(){let e=this.port.source_port_id;if(!e)return null;return this.port.root?.db.source_port.get(e)??null}},Mmi=class{constructor(e){this.net=e}net;getSourceNet(){let e=this.net.source_net_id;if(!e)return null;return this.net.root?.db.source_net.get(e)??null}},wmi=class{constructor(e){this.component=e}component;getPort(e){let t=this.component.selectOne(`port.${e}`,{type:"port"})??this.component.selectOne(`.${e}`,{type:"port"});if(!t)return null;return new Ast(t)}getPorts(){return this.component.selectAll("port").map((e)=>new Ast(e))}getPcbComponent(){let e=this.component.pcb_component_id;if(!e)return null;return this.component.root?.db.pcb_component.get(e)??null}getSourceComponent(){let e=this.component.source_component_id;if(!e)return null;return this.component.root?.db.source_component.get(e)??null}},Bmi=class extends lr{get config(){return{componentName:"DrcCheck",zodProps:FSt}}constructor(e){super(e)}async runCustomDrcCheck(e){let t=await this._parsedProps.checkFn(this.createCustomDrcCheckContext(e)),n=[];if(Array.isArray(t))n=t;else if(t)n=[t];return n.map((o,r)=>this.createCircuitJsonDiagnostic(o,r)).filter((o)=>!!o)}createCustomDrcCheckContext(e){return{select:this.selectCustomDrcElement.bind(this),selectAll:this.selectAllCustomDrcElements.bind(this),isConnected:(t,n)=>this.isConnected(t,n,e),isPulledUp:(t)=>this.isConnected(t,"net.VCC",e)||this.isConnected(t,"net.VDD",e)||this.getResistanceBetween(t,"net.VCC",e)!==null||this.getResistanceBetween(t,"net.VDD",e)!==null,isPulledDown:(t)=>this.isConnected(t,"net.GND",e)||this.getResistanceBetween(t,"net.GND",e)!==null,getResistanceBetween:(t,n)=>this.getResistanceBetween(t,n,e)}}selectCustomDrcElement(e){return this.wrapSelectionResult(this.getSubcircuit().selectOne(e))}selectAllCustomDrcElements(e){let t=[];for(let n of this.getSubcircuit().selectAll(e)){let o=this.wrapSelectionResult(n);if(o)t.push(o)}return t}wrapSelectionResult(e){if(!e)return null;if(e instanceof sd)return new Ast(e);if(e instanceof oT)return new Mmi(e);return new wmi(e)}createCircuitJsonDiagnostic(e,t){let n=e,o="source_component_misconfigured_error";if(typeof n.error_type==="string")o=n.error_type;else if(typeof n.warning_type==="string")o=n.warning_type;let r={...e};if(typeof n.type==="string")r.type=n.type;else r.type=o;if(typeof n.warning_type!=="string")if(typeof n.error_type==="string")r.error_type=n.error_type;else r.error_type=o;let i=`${o}_id`;if(n[i])r[i]=n[i];else r[i]=`${o}_${this._renderId}_${t}`;return zfe.parse(r)}isConnected(e,t,n){let o=this.getConnectivityKeys(e,n),r=this.getConnectivityKeys(t,n);return o.some((i)=>r.includes(i))}getResistanceBetween(e,t,n){if(this.isConnected(e,t,n))return 0;let o=this.getConnectivityKeys(e,n),r=this.getConnectivityKeys(t,n);if(o.length===0||r.length===0)return null;let i=n.filter((a)=>a.type==="source_component"&&a.ftype==="simple_resistor"),s=this.root;if(!s)return null;for(let a of i){let c=s.db.source_port.list({source_component_id:a.source_component_id});if(c.length!==2)continue;let l=c.map((u)=>u.subcircuit_connectivity_map_key),h=l.some((u)=>u&&o.includes(u)),d=l.some((u)=>u&&r.includes(u));if(h&&d)return a.resistance}return null}getConnectivityKeys(e,t){if(!e)return[];if(typeof e==="string"){let n=this.selectCustomDrcElement(e);if(n)return this.getConnectivityKeys(n,t);return[]}if(vmi(e))return[e.getSourcePort()?.subcircuit_connectivity_map_key].filter(xde);if(Smi(e))return[e.getSourceNet()?.subcircuit_connectivity_map_key].filter(xde);if(Pmi(e))return e.getPorts().flatMap((n)=>this.getConnectivityKeys(n,t));if(Emi(e))return this.getCircuitJsonElementConnectivityKeys(e,t);return[]}getCircuitJsonElementConnectivityKeys(e,t){if(!e)return[];if(e.type==="source_port")return[e.subcircuit_connectivity_map_key].filter(xde);if(e.type==="source_net")return[e.subcircuit_connectivity_map_key].filter(xde);if(e.type==="pcb_port")return this.getConnectivityKeys(e.source_port_id,t);if(e.type==="source_component"){let n=this.root;if(!n)return[];return n.db.source_port.list({source_component_id:e.source_component_id}).map((o)=>o.subcircuit_connectivity_map_key).filter(xde)}return[]}},Tmi=class extends lr{get config(){return{componentName:"AutoroutingPhase",zodProps:_Pt}}add(e){throw Error("<autoroutingphase> cannot contain children")}},OPn=({from:e,offset:t,offsetDirection:n,to:o,transform:r})=>{if(n)return _o({...r,e:0,f:0},n);let i=o.x-e.x,s=o.y-e.y,a=Math.hypot(i,s);if(t===void 0||a===0)return;return{x:-s/a,y:i/a}},Dmi=class extends lr{fabrication_note_dimension_id=null;isPcbPrimitive=!0;get config(){return{componentName:"FabricationNoteDimension",zodProps:wPt}}_resolvePoint(e,t){if(typeof e==="string"){let r=this.getSubcircuit().selectOne(e);if(!r)return this.renderError(`FabricationNoteDimension could not find selector "${e}"`),_o(t,{x:0,y:0});return r._getGlobalPcbPositionBeforeLayout()}let n=typeof e.x==="string"?parseFloat(e.x):e.x,o=typeof e.y==="string"?parseFloat(e.y):e.y;return _o(t,{x:n,y:o})}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,n=this._computePcbGlobalTransformBeforeLayout(),o=this._resolvePoint(t.from,n),r=this._resolvePoint(t.to,n),i=this.getSubcircuit(),s=this.getGroup(),{maybeFlipLayer:a}=this._getPcbPrimitiveFlippedHelpers(),c=a(t.layer??"top");if(c!=="top"&&c!=="bottom")throw Error(`Invalid layer "${c}" for FabricationNoteDimension. Must be "top" or "bottom".`);let l=this.parent?.pcb_component_id??this.getPrimitiveContainer()?.pcb_component_id,h=t.text??this._formatDistanceText({from:o,to:r,units:t.units??"mm"}),d=OPn({from:o,offset:t.offset,offsetDirection:t.offsetDirection,to:r,transform:n}),u=e.pcb_fabrication_note_dimension.insert({pcb_component_id:l,subcircuit_id:i?.subcircuit_id??void 0,pcb_group_id:s?.pcb_group_id??void 0,layer:c,from:o,to:r,text:h,offset:t.offset,offset_distance:t.offset,offset_direction:d,font:t.font??"tscircuit2024",font_size:t.fontSize??1,color:t.color,arrow_size:t.arrowSize??1});this.fabrication_note_dimension_id=u.pcb_fabrication_note_dimension_id}_moveCircuitJsonElements({deltaX:e,deltaY:t}){if(this.root?.pcbDisabled)return;let{db:n}=this.root;if(!this.fabrication_note_dimension_id)return;let o=n.pcb_fabrication_note_dimension.get(this.fabrication_note_dimension_id);if(o)n.pcb_fabrication_note_dimension.update(this.fabrication_note_dimension_id,{from:{x:o.from.x+e,y:o.from.y+t},to:{x:o.to.x+e,y:o.to.y+t}})}getPcbSize(){let e=this._computePcbGlobalTransformBeforeLayout(),t=this._resolvePoint(this._parsedProps.from,e),n=this._resolvePoint(this._parsedProps.to,e);return{width:Math.abs(n.x-t.x),height:Math.abs(n.y-t.y)}}_formatDistanceText({from:e,to:t,units:n}){let o=t.x-e.x,r=t.y-e.y,i=Math.sqrt(o*o+r*r),s=n==="in"?i/25.4:i,a=Math.round(s);if(Math.abs(s-a)<0.000000001)return`${a}${n}`;let l=n==="in"?3:2;return`${n==="in"?Number(s.toFixed(l)).toString():s.toFixed(l)}${n}`}},Nmi=class extends lr{pcb_note_dimension_id=null;isPcbPrimitive=!0;get config(){return{componentName:"PcbNoteDimension",zodProps:fEt}}_resolvePoint(e,t){if(typeof e==="string"){let r=this.getSubcircuit().selectOne(`.${e}`);if(!r)return this.renderError(`PcbNoteDimension could not find selector "${e}"`),_o(t,{x:0,y:0});let i=r.pcb_component_id,s=this.root;if(i&&s){let a=s.db.pcb_component.get(i);if(a?.center)return{x:a.center.x,y:a.center.y}}return r._getGlobalPcbPositionBeforeLayout()}let n=typeof e.x==="string"?parseFloat(e.x):e.x,o=typeof e.y==="string"?parseFloat(e.y):e.y;return _o(t,{x:n,y:o})}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,n=this._computePcbGlobalTransformBeforeLayout(),o=this._resolvePoint(t.from,n),r=this._resolvePoint(t.to,n),i=this.getSubcircuit(),s=this.getGroup(),a=this.parent?.pcb_component_id??this.getPrimitiveContainer()?.pcb_component_id??void 0,c=t.text??this._formatDistanceText({from:o,to:r,units:t.units??"mm"}),l=OPn({from:o,offset:t.offset,offsetDirection:t.offsetDirection,to:r,transform:n}),h=e.pcb_note_dimension.insert({pcb_component_id:a,subcircuit_id:i?.subcircuit_id??void 0,pcb_group_id:s?.pcb_group_id??void 0,from:o,to:r,text:c,offset_distance:t.offset,offset_direction:l,font:t.font??"tscircuit2024",font_size:t.fontSize??1,layer:t.layer==="bottom"?"bottom":"top",color:t.color,arrow_size:t.arrowSize??1});this.pcb_note_dimension_id=h.pcb_note_dimension_id}doInitialPcbLayout(){let e=this.root;if(!e||e.pcbDisabled)return;if(!this.pcb_note_dimension_id)return;let{db:t}=e,n=this._computePcbGlobalTransformBeforeLayout(),o=this._resolvePoint(this._parsedProps.from,n),r=this._resolvePoint(this._parsedProps.to,n);t.pcb_note_dimension.update(this.pcb_note_dimension_id,{from:o,to:r})}getPcbSize(){let e=this._computePcbGlobalTransformBeforeLayout(),t=this._resolvePoint(this._parsedProps.from,e),n=this._resolvePoint(this._parsedProps.to,e);return{width:Math.abs(n.x-t.x),height:Math.abs(n.y-t.y)}}_formatDistanceText({from:e,to:t,units:n}){let o=t.x-e.x,r=t.y-e.y,i=Math.sqrt(o*o+r*r),s=n==="in"?i/25.4:i,a=Math.round(s);if(Math.abs(s-a)<0.000000001)return`${a}${n}`;let l=n==="in"?3:2;return`${n==="in"?Number(s.toFixed(l)).toString():s.toFixed(l)}${n}`}_moveCircuitJsonElements({deltaX:e,deltaY:t}){if(this.root?.pcbDisabled)return;let{db:n}=this.root;if(!this.pcb_note_dimension_id)return;let o=n.pcb_note_dimension.get(this.pcb_note_dimension_id);if(o)n.pcb_note_dimension.update(this.pcb_note_dimension_id,{from:{x:o.from.x+e,y:o.from.y+t},to:{x:o.to.x+e,y:o.to.y+t}})}},tue=class extends lPn{get config(){return{componentName:"AutoplacedBreakoutPoint",zodProps:T0i}}_applySolvedBreakoutPoint({sourceTraceId:e,layer:t,position:n}){this.matchedSourceTraceId=e,this._renderPcbBreakoutPoint({layer:Lo.parse(t)}),this._setPositionFromLayout(n)}},VPn=[{id:"DQ0",layer:"inner3",soc:{x:-6,y:-3},ram:{x:3.941917,y:-3.650917}},{id:"DQ1",layer:"inner6",fullLayer:"inner2",soc:{x:-5.5,y:-3},ram:{x:4.591917,y:-3.650917}},{id:"DQ2",layer:"inner5",fullLayer:"inner4",soc:{x:-4.5,y:-3},ram:{x:5.891917,y:-3.650917}},{id:"DQ3",layer:"inner2",fullLayer:"inner6",soc:{x:-4.5,y:-3.5},ram:{x:6.541917,y:-3.650917}},{id:"DQ4",layer:"inner3",fullLayer:"inner2",soc:{x:-6,y:-2.5},ram:{x:6.541917,y:-2.050917}},{id:"DQ5",layer:"inner2",fullLayer:"inner5",soc:{x:-6,y:-2},ram:{x:5.891917,y:-2.050917}},{id:"DQ6",layer:"inner5",fullLayer:"inner4",soc:{x:-5,y:-2},ram:{x:4.591917,y:-2.050917}},{id:"DQ7",layer:"inner4",fullLayer:"inner6",soc:{x:-5.5,y:-2},ram:{x:3.941917,y:-2.050917}},{id:"DM0",layer:"inner4",fullLayer:"inner5",soc:{x:-5,y:-3},ram:{x:4.591917,y:-2.850917}},{id:"DQS0",layer:"inner1",differentialPairId:"DQS0",soc:{x:-4.5,y:-2.5},ram:{x:5.241917,y:-2.850917}},{id:"DQS0_n",layer:"inner1",differentialPairId:"DQS0",soc:{x:-5,y:-2.5},ram:{x:5.891917,y:-2.850917}}],YPn=[{id:"DQ8",layer:"inner6",fullLayer:"inner4",soc:{x:-6,y:3},ram:{x:3.941917,y:3.549083}},{id:"DQ9",layer:"inner3",fullLayer:"inner4",soc:{x:-5.5,y:2},ram:{x:4.591917,y:3.549083}},{id:"DQ10",layer:"inner3",fullLayer:"inner2",soc:{x:-4.5,y:2},ram:{x:5.891917,y:3.549083}},{id:"DQ11",layer:"inner6",fullLayer:"inner5",soc:{x:-4.5,y:2.5},ram:{x:6.541917,y:3.549083}},{id:"DQ12",layer:"inner5",fullLayer:"inner1",soc:{x:-6,y:2.5},ram:{x:6.541917,y:1.949083}},{id:"DQ13",layer:"inner2",fullLayer:"inner3",soc:{x:-6.5,y:3},ram:{x:5.891917,y:1.949083}},{id:"DQ14",layer:"inner5",fullLayer:"inner6",soc:{x:-5,y:2.5},ram:{x:4.591917,y:1.949083}},{id:"DQ15",layer:"inner4",fullLayer:"inner1",soc:{x:-4.5,y:3.5},ram:{x:3.941917,y:1.949083}},{id:"DM1",layer:"inner4",fullLayer:"inner5",soc:{x:-5,y:3.5},ram:{x:4.591917,y:2.749083}},{id:"DQS1",layer:"inner1",fullLayer:"bottom",differentialPairId:"DQS1",soc:{x:-4.5,y:3},ram:{x:5.241917,y:2.749083}},{id:"DQS1_n",layer:"inner1",fullLayer:"bottom",differentialPairId:"DQS1",soc:{x:-5,y:3},ram:{x:5.891917,y:2.749083}}],GPn=[{id:"A0",layer:"bottom",soc:{x:-6.5,y:-0.5},ram:{x:7.841917,y:-3.650917}},{id:"A1",layer:"inner3",soc:{x:-7,y:-2},ram:{x:8.491917,y:-3.650917}},{id:"A2",layer:"inner3",soc:{x:-7,y:-0.5},ram:{x:7.841917,y:1.949083}},{id:"A3",layer:"inner6",soc:{x:-5,y:-1},ram:{x:7.841917,y:2.749083}},{id:"A4",layer:"inner4",soc:{x:-4.5,y:-1.5},ram:{x:7.841917,y:3.549083}},{id:"A5",layer:"inner2",soc:{x:-6.5,y:-2},ram:{x:8.491917,y:3.549083}},{id:"CS0_n",layer:"inner5",soc:{x:-5.5,y:-0.5},ram:{x:7.841917,y:-2.050917}},{id:"CKE0",layer:"inner1",soc:{x:-4.5,y:-1},ram:{x:8.491917,y:-2.050917}},{id:"CK0",layer:"bottom",differentialPairId:"CK0",soc:{x:-4.5,y:1},ram:{x:8.491917,y:1.149083}},{id:"CK0_n",layer:"bottom",differentialPairId:"CK0",soc:{x:-5,y:1},ram:{x:8.491917,y:1.949083}},{id:"DDR_LINK_RESET0_n",layer:"inner6",soc:{x:-5,y:-1.5},ram:{x:13.041917,y:3.549083}}],m7e=(e)=>{let t=e.buses.flatMap((s)=>s.ports),n=new Set,o=(s)=>[{regionId:"soc",position:s.soc},{regionId:"ram",position:s.ram}],r=[];for(let s of t){if(!s.differentialPairId){r.push({id:s.id,endpoints:o(s)});continue}if(n.has(s.differentialPairId))continue;n.add(s.differentialPairId);let a=t.filter((h)=>h.differentialPairId===s.differentialPairId);if(a.length!==2)throw Error(`Differential pair ${s.differentialPairId} must have two members`);let[c,l]=a;r.push({type:"differential",connections:[{id:c.id,endpoints:o(c)},{id:l.id,endpoints:o(l)}]})}let i=e.buses.map((s)=>{let a={id:s.id,connectionIds:s.ports.map((c)=>c.id)};if(s.preferredLayer!==void 0)a={...a,preferredLayer:s.preferredLayer};if(s.preferredLayers!==void 0)a={...a,preferredLayers:s.preferredLayers};return a});return{regions:[{id:"soc",bounds:{minX:-16.62808,maxX:-2.37192,minY:-10.62808,maxY:10.62808},edge:"right"},{id:"ram",bounds:{minX:1.091917,maxX:18.141917,minY:-9.650917,maxY:9.549083},edge:"left"}],connections:r,buses:i,boundaryPointSpacing:0.48}},Faa=m7e({buses:[{id:"DDR_BYTE0",ports:VPn,preferredLayers:["inner1","inner4"]}]}),zaa=m7e({buses:[{id:"DDR_BYTE1",ports:YPn,preferredLayers:["inner2","inner5"]}]}),Oaa=m7e({buses:[{id:"DDR_BYTE0",ports:VPn,preferredLayers:["inner1","inner4"]},{id:"DDR_BYTE1",ports:YPn,preferredLayers:["inner2","inner5"]},{id:"DDR_ADDR_CTRL",ports:GPn,preferredLayers:["inner3","inner6"]}]}),Vaa=m7e({buses:[{id:"DDR_ADDR_CTRL",ports:GPn,preferredLayers:["inner3","inner6"]}]}),Rmi=class extends Error{name="WindingBreakoutInputError"},UPn=class extends Error{name="WindingBreakoutInfeasibleError"},Yct=class extends Error{name="WindingBreakoutInvariantError"},Qmi=class extends Error{name="WindingBreakoutOutputUnavailableError"},_7e=(e)=>{let t=[];for(let n of e.connections)if("type"in n)t.push(...n.connections);else t.push(n);return t},Gct=(e)=>{if(e.preferredLayer!==void 0)return[e.preferredLayer];if(e.preferredLayers!==void 0)return[...new Set(e.preferredLayers)];return["top"]},Uct=(e)=>{let t=new Map;for(let n of e.buses){let o=Gct(n);for(let r of n.connectionIds)t.set(r,o)}return Object.fromEntries(_7e(e).map((n)=>[n.id,t.get(n.id)??["top"]]))},Vh=(e)=>{throw new Rmi(`WindingBreakoutSolver: ${e}`)},kmi=(e)=>typeof e==="object"&&e!==null&&!Array.isArray(e),KY=(e,t)=>{if(!kmi(e))Vh(`${t} must be an object`)},OY=(e,t)=>{if(typeof e!=="string"||e.trim().length===0)Vh(`${t} must be a non-empty string`)},oG=(e,t)=>{if(typeof e!=="number"||!Number.isFinite(e))Vh(`${t} must be finite`)},Lmi=(e,t)=>{if(oG(e,t),e<=0)Vh(`${t} must be positive`)},Cde=(e,t)=>{if(Array.isArray(e))return e;return Vh(t)},Hmi=(e,t)=>(KY(e,t),oG(e.x,`${t}.x`),oG(e.y,`${t}.y`),e),Fmi=(e,t)=>{if(KY(e,t),oG(e.minX,`${t}.minX`),oG(e.maxX,`${t}.maxX`),oG(e.minY,`${t}.minY`),oG(e.maxY,`${t}.maxY`),e.minX>=e.maxX||e.minY>=e.maxY)Vh(`${t} must have positive width and height`);return{minX:e.minX,maxX:e.maxX,minY:e.minY,maxY:e.maxY}},zmi=(e,t)=>e.x>=t.minX&&e.x<=t.maxX&&e.y>=t.minY&&e.y<=t.maxY,Omi=(e)=>{if(!Array.isArray(e.regions)||e.regions.length===0)Vh("at least one region is required");Lmi(e.boundaryPointSpacing,"boundaryPointSpacing");let t=new Set,n=e.regions.map((p,m)=>{if(KY(p,`regions[${m}]`),OY(p.id,`regions[${m}].id`),t.has(p.id))Vh(`duplicate region id "${p.id}"`);t.add(p.id);let A=Fmi(p.bounds,`region "${p.id}" bounds`);if(typeof p.edge!=="string"||!new Set(["left","right","bottom","top"]).has(p.edge))Vh(`region "${p.id}" has invalid edge`);return{id:p.id,bounds:A,edge:p.edge,center:{x:(A.minX+A.maxX)/2,y:(A.minY+A.maxY)/2}}}),o=n.every((p)=>p.edge==="left"||p.edge==="right"),r=n.every((p)=>p.edge==="bottom"||p.edge==="top");if(!o&&!r)Vh("all coordinated region edges must be parallel");if(!Array.isArray(e.connections)||e.connections.length===0)Vh("at least one connection is required");let i=[],s=new Set,a=[],c=(p,m)=>{if(KY(p,m),OY(p.id,`${m}.id`),s.has(p.id))Vh(`duplicate connection id "${p.id}"`);if("layer"in p)Vh(`${m}.layer is not accepted; declare layer preferences on a bus`);let A=Cde(p.endpoints,`${m}.endpoints must be an array`),g=new Set,f=A.map((y,x)=>{let C=`${m}.endpoints[${x}]`;if(KY(y,C),OY(y.regionId,`${C}.regionId`),!t.has(y.regionId))Vh(`${C} references unknown region "${y.regionId}"`);if(g.has(y.regionId))Vh(`${m} has duplicate endpoint for region "${y.regionId}"`);g.add(y.regionId);let b=Hmi(y.position,`${C}.position`),I=n.find((v)=>v.id===y.regionId);if(!zmi(b,I.bounds))Vh(`${m} endpoint for region "${I.id}" is outside its bounds`);return{regionId:y.regionId,position:b}});for(let y of n)if(!g.has(y.id))Vh(`${m} is missing endpoint for region "${y.id}"`);if(f.length!==n.length)Vh(`${m} must contain exactly one endpoint for every region`);return s.add(p.id),{id:p.id,endpoints:f}};for(let[p,m]of e.connections.entries()){let A=`connections[${p}]`;if(KY(m,A),"type"in m||"connections"in m){if(m.type!=="differential")Vh(`${A} has invalid differential-pair type`);if("layer"in m)Vh(`${A}.layer is not accepted; declare layer preferences on a bus`);let g=Cde(m.connections,`${A}.connections must contain exactly two members`);if(g.length!==2)Vh(`${A}.connections must contain exactly two members`);let f=c(g[0],`${A}.connections[0]`),y=c(g[1],`${A}.connections[1]`);if(f.id===y.id)Vh(`${A} members must have distinct connection ids`);i.push(f,y),a.push([f.id,y.id])}else i.push(c(m,A))}let l=Cde(e.buses,"buses must be an array"),h=new Set,d=new Map,u=l.map((p,m)=>{let A=`buses[${m}]`;KY(p,A),OY(p.id,`${A}.id`);let g=p.id;if(h.has(g))Vh(`duplicate bus id "${g}"`);h.add(g);let f=Cde(p.connectionIds,`${A}.connectionIds must be a non-empty array`);if(f.length===0)Vh(`${A}.connectionIds must be a non-empty array`);let y=new Set,x=f.map((v,P)=>{if(OY(v,`${A}.connectionIds[${P}]`),!s.has(v))Vh(`${A} references unknown connection "${v}"`);if(y.has(v))Vh(`${A} contains duplicate connection "${v}"`);y.add(v);let M=d.get(v);if(M!==void 0)Vh(`connection "${v}" belongs to multiple buses "${M}" and "${p.id}"`);return d.set(v,g),v}),C;if(p.preferredLayer!==void 0)OY(p.preferredLayer,`${A}.preferredLayer`),C=p.preferredLayer;let b;if(p.preferredLayers!==void 0){let v=Cde(p.preferredLayers,`${A}.preferredLayers must be a non-empty array`);if(v.length===0)Vh(`${A}.preferredLayers must be a non-empty array`);let P=new Set;b=v.map((M,B)=>{if(OY(M,`${A}.preferredLayers[${B}]`),P.has(M))Vh(`${A}.preferredLayers contains duplicate layer "${M}"`);return P.add(M),M})}let I={id:g,connectionIds:x};if(C!==void 0)I={...I,preferredLayer:C};if(b!==void 0)I={...I,preferredLayers:b};return I});for(let[p,m]of a){let A=d.get(p),g=d.get(m);if(A!==g)Vh(`differential pair "${p}/${m}" must belong to the same bus`)}let _=[...new Set([...u.flatMap((p)=>Gct(p)),...i.filter((p)=>!d.has(p.id)).map(()=>"top")])].sort((p,m)=>p.localeCompare(m));return{regions:n,connections:i,buses:u,layerNames:_,atomicConnectionGroups:a}},Vmi=0.000000001,Ymi=(e)=>e==="left"||e==="right",Gmi=(e,t)=>{if(t)return e.bounds.minY;return e.bounds.minX},Umi=(e,t)=>{if(t)return e.bounds.maxY;return e.bounds.maxX},Wmi=(e,t)=>{if(t)return e.y;return e.x},Xmi=(e,t)=>{let n=t/2;return Object.fromEntries(e.map((o,r)=>[o,(r-(e.length-1)/2)*n]))},jmi=({referenceOrder:e,layer:t,layerByConnection:n,atomicGroups:o})=>{let r=e.filter((c)=>n[c]===t),i=new Map(o.flatMap((c)=>c.map((l)=>[l,c]))),s=new Set,a=[];for(let c of r){let l=i.get(c);if(!l){a.push(c);continue}if(s.has(l))continue;s.add(l),a.push(...r.filter((h)=>l.includes(h)))}return a},Kmi=({regions:e,connections:t,spacing:n,count:o,layerOffsets:r})=>{let i=e.every((_)=>Ymi(_.edge)),s=Math.max(...e.map((_)=>Gmi(_,i))),a=Math.min(...e.map((_)=>Umi(_,i))),c=Math.min(...Object.values(r)),l=Math.max(...Object.values(r)),h=n*Math.max(0,o-1)+l-c;if(a-s+Vmi<h)throw new UPn(`WindingBreakoutSolver: declared breakout edges need ${h.toFixed(2)}mm but expose only ${(a-s).toFixed(2)}mm`);let d=e.reduce((_,p)=>{let m=t.map((A)=>A.endpoints.find((g)=>g.regionId===p.id).position);return _+m.reduce((A,g)=>A+Wmi(g,i),0)/m.length},0)/e.length,u=Math.max(s-c,Math.min(a-n*Math.max(0,o-1)-l,d-n*Math.max(0,o-1)/2));return{vertical:i,axes:Array.from({length:o},(_,p)=>u+p*n)}},$mi=(e,t,n)=>{if(n){let r=e.bounds.maxX;if(e.edge==="left")r=e.bounds.minX;return{x:r,y:t}}let o=e.bounds.maxY;if(e.edge==="bottom")o=e.bounds.minY;return{x:t,y:o}},qmi=({regions:e,connections:t,referenceOrder:n,layerNames:o,layerByConnection:r,boundaryPointSpacing:i,atomicGroups:s})=>{let a=Xmi(o,i),c=Object.fromEntries(o.map((_)=>[_,jmi({referenceOrder:n,layer:_,layerByConnection:r,atomicGroups:s})])),l=Math.max(...o.map((_)=>t.filter((p)=>r[p.id]===_).length)),{vertical:h,axes:d}=Kmi({regions:e,connections:t,spacing:i,count:l,layerOffsets:a});return{breakoutPoints:e.flatMap((_)=>o.flatMap((p)=>c[p].map((m,A)=>({regionId:_.id,connectionId:m,layer:p,...$mi(_,d[A]+a[p],h)}))))}},Jmi=(e,t)=>{let n=new Set(e),o=new Map(t.flatMap((s)=>s.map((a)=>[a,s]))),r=new Set,i=[];for(let s of e){let a=o.get(s);if(!a){i.push([s]);continue}if(r.has(a))continue;r.add(a),i.push(a.filter((c)=>n.has(c)))}return i},Zmi=({validated:e,referenceOrder:t})=>{let n=new Map;for(let i of e.buses){let s=new Set(i.connectionIds),a=t.filter((h)=>s.has(h)),c=Gct(i),l=Jmi(a,e.atomicConnectionGroups);for(let[h,d]of l.entries()){let u=c[h%c.length];for(let _ of d)n.set(_,u)}}for(let i of t)if(!n.has(i))n.set(i,"top");let o=Object.fromEntries(t.map((i)=>[i,n.get(i)])),r=[...new Set(Object.values(o))].sort((i,s)=>i.localeCompare(s));return{layerByConnection:o,layerNames:r}},Wct=(e)=>[...new Set(Object.values(Uct(e)).flat())].sort((t,n)=>t.localeCompare(n)),Z5n=["#2563eb","#dc2626","#059669","#7c3aed","#d97706","#0891b2","#db2777","#4f46e5","#65a30d","#c2410c","#0f766e","#9333ea"],E8e=(e)=>{let t=2166136261;for(let n of e)t^=n.charCodeAt(0),t=Math.imul(t,16777619);return Z5n[(t>>>0)%Z5n.length]},dL=(e,t)=>{let n=Wct(e),o=[...new Set(t)].map((r)=>{let i=n.indexOf(r);if(i<0)throw Error(`Cannot visualize unknown signal layer "${r}"`);return i});if(o.length===0)throw Error("Cannot create graphics metadata without a signal layer");return o.sort((r,i)=>r-i),`z${o.join(",")}`},e_i=(e,t)=>{let n={circles:[],rects:[],texts:[]},r=Wct(e);if(t)r=[t];let i=dL(e,r),s=_7e(e),a=Uct(e),c=Math.min(0.12,e.boundaryPointSpacing/4);for(let l of e.regions){let h={x:(l.bounds.minX+l.bounds.maxX)/2,y:(l.bounds.minY+l.bounds.maxY)/2};n.rects.push({center:h,width:l.bounds.maxX-l.bounds.minX,height:l.bounds.maxY-l.bounds.minY,fill:"rgba(226, 232, 240, 0.035)",stroke:"rgba(71, 85, 105, 0.55)",layer:i});for(let d of s){let u=a[d.id];if(t&&!u.includes(t))continue;let _=d.endpoints.find((m)=>m.regionId===l.id);if(!_)continue;let p=E8e(d.id);n.circles.push({center:_.position,radius:c,fill:`${p}70`,stroke:p,layer:dL(e,u)})}n.texts.push({x:h.x,y:l.bounds.maxY+0.35,text:l.id,anchorSide:"bottom_center",color:"#334155",fontSize:0.34,layer:i})}return n},t_i=(e,t,n)=>{let o=_7e(e),r=t.breakoutPoints.filter((a)=>!n||a.layer===n),i=new Map;for(let a of t.breakoutPoints){let c=`${a.regionId}:${a.x.toFixed(9)}:${a.y.toFixed(9)}`,l=i.get(c)??{x:a.x,y:a.y,layers:new Set};l.layers.add(a.layer),i.set(c,l)}return{lines:t.referenceOrder.flatMap((a)=>{let c=o.find((u)=>u.id===a);if(!c)return[];let l=r.filter((u)=>u.connectionId===a),h=l[0]?.layer;if(!h||n&&h!==n)return[];if(l.length!==e.regions.length)return[];let d=e.regions.flatMap((u,_)=>{let p=c.endpoints.find((A)=>A.regionId===u.id),m=l.find((A)=>A.regionId===u.id);if(!p||!m)return[];if(_===0)return[p.position,m];return[m,p.position]});if(d.length<2)return[];return[{points:d,strokeColor:`${E8e(a)}55`,strokeWidth:0.012,strokeDash:[0.025,0.07],layer:dL(e,[h])}]}),circles:[...i.values()].flatMap((a)=>{let c=[...a.layers].filter((l)=>!n||l===n);if(c.length===0)return[];return[{center:a,radius:0.11,fill:"rgba(15, 23, 42, 0.06)",stroke:"#475569",layer:dL(e,c)}]}),points:r.map((a)=>({x:a.x,y:a.y,color:E8e(a.connectionId),label:`${a.connectionId} · ${a.layer}`,layer:dL(e,[a.layer])}))}},M8e=({input:e,phase:t,detail:n,activeLayer:o,referenceOrder:r,referenceRegionId:i,showReferenceNumbers:s=!1,state:a})=>{let c=e_i(e,o),l;if(a)l=t_i(e,a,o);let h=Wct(e);if(o)h=[o];let d=dL(e,h),u=Math.max(...e.regions.map((g)=>g.bounds.maxY)),_=Math.min(...e.regions.map((g)=>g.bounds.minX)),p=[...c.texts??[],...l?.texts??[],{x:_,y:u+1.05,text:t,anchorSide:"bottom_left",color:"#0f172a",fontSize:0.42,layer:d},{x:_,y:u+0.68,text:n,anchorSide:"bottom_left",color:"#475569",fontSize:0.25,layer:d}],m=[],A=[];if(s&&r){let g=e.regions.find((b)=>b.id===i)??e.regions[0],f=_7e(e),y=Uct(e),x=[];for(let[b,I]of r.entries()){let v=f.find((B)=>B.id===I),P=y[I];if(!v||!P||o&&!P.includes(o))continue;let M=v.endpoints.find((B)=>B.regionId===g.id);if(!M)continue;x.push(M.position),p.push({x:M.position.x+0.18,y:M.position.y+0.18,text:`${b+1} · ${I}`,anchorSide:"bottom_left",color:E8e(I),fontSize:0.21,layer:dL(e,P)})}let C={x:(g.bounds.minX+g.bounds.maxX)/2,y:(g.bounds.minY+g.bounds.maxY)/2};if(m.push(...x.map((b)=>({points:[C,b],strokeColor:"rgba(100, 116, 139, 0.35)",strokeWidth:0.01,strokeDash:[0.03,0.05],layer:d}))),x.length>1)m.push({points:x,strokeColor:"rgba(15, 23, 42, 0.65)",strokeWidth:0.018,strokeDash:[0.04,0.04],label:`${g.id} angular winding order`,layer:d});A.push({center:C,radius:0.07,fill:"#0f172a",stroke:"#ffffff",label:`${g.id} angular reference center`,layer:d})}return{title:t,coordinateSystem:"cartesian",rects:c.rects,polygons:c.polygons,lines:[...l?.lines??[],...m],circles:[...c.circles??[],...l?.circles??[],...A],points:l?.points,texts:p}},e4n=(e)=>new Set(e.map((t)=>`${t.regionId}:${t.x.toFixed(9)}:${t.y.toFixed(9)}`)).size,n_i=class extends po{constructor(e){super();this.params=e,this.visualizationLayer=e.visualizationLayer;let t=Zmi({validated:e.validated,referenceOrder:e.ordering.referenceOrder});this.layerByConnection=t.layerByConnection,this.placementBatches=e.validated.regions.flatMap((n)=>t.layerNames.map((o)=>({regionId:n.id,layer:o}))),this.MAX_ITERATIONS=this.placementBatches.length+2}params;batchIndex=0;output;plannedPlacement;placementBatches;visibleBreakoutPoints=[];layerByConnection;visualizationLayer;setVisualizationLayer(e){this.visualizationLayer=e}_step(){if(!this.plannedPlacement){this.plannedPlacement=qmi({regions:this.params.validated.regions,connections:this.params.validated.connections,referenceOrder:this.params.ordering.referenceOrder,layerNames:[...new Set(Object.values(this.layerByConnection))].sort((t,n)=>t.localeCompare(n)),layerByConnection:this.layerByConnection,boundaryPointSpacing:this.params.input.boundaryPointSpacing,atomicGroups:this.params.validated.atomicConnectionGroups}),this.stats={phase:"plan-gate-grid",regionLayerBatches:this.placementBatches.length,placedBreakpoints:0};return}let e=this.placementBatches[this.batchIndex];if(e){this.visibleBreakoutPoints.push(...this.plannedPlacement.breakoutPoints.filter((t)=>t.regionId===e.regionId&&t.layer===e.layer)),this.batchIndex+=1,this.stats={phase:"place-region-layer-batch",regionId:e.regionId,layer:e.layer,completedBatches:this.batchIndex,totalBatches:this.placementBatches.length,placedBreakpoints:this.visibleBreakoutPoints.length};return}this.output=this.plannedPlacement,this.stats={phase:"finalize-shared-gate-slots",placedBreakpoints:this.output.breakoutPoints.length,sharedGateSlots:e4n(this.output.breakoutPoints)},this.solved=!0}computeProgress(){let e=this.batchIndex;if(this.plannedPlacement)e+=1;if(this.output)e+=1;return e/this.MAX_ITERATIONS}getConstructorParams(){return[this.params]}getOutput(){if(!this.solved||!this.output)throw new Yct("WindingBreakoutSolver: gate placement requested before placement completed");return this.output}visualize(){let e="Next microstep: derive layer offsets, atomic gate orders, and the common boundary slot grid";if(this.plannedPlacement&&this.batchIndex===0)e=`Gate grid planned · ${this.placementBatches.length} region/layer batches remain`;else if(this.plannedPlacement&&!this.output){let r=this.placementBatches[this.batchIndex-1];e=`Placed region “${r.regionId}” on layer “${r.layer}” · ${this.batchIndex}/${this.placementBatches.length} batches`}else if(this.output){let r=e4n(this.output.breakoutPoints);e=`${this.output.breakoutPoints.length} gates placed; coincident layer positions form ${r} shared slots`}let t;if(this.plannedPlacement){let r=this.visibleBreakoutPoints;if(this.output)r=this.output.breakoutPoints;t={referenceOrder:this.params.ordering.referenceOrder,breakoutPoints:r}}let n=M8e({input:this.params.input,activeLayer:this.visualizationLayer,phase:"Step 2 · Place boundary gates",detail:e,state:t}),o=(this.plannedPlacement?.breakoutPoints??[]).filter((r)=>!this.visualizationLayer||r.layer===this.visualizationLayer).map((r)=>({center:r,radius:0.065,fill:"rgba(255, 255, 255, 0.75)",stroke:"rgba(100, 116, 139, 0.5)",label:`planned slot ${r.regionId} · ${r.layer}`,layer:dL(this.params.input,[r.layer])}));return{...n,circles:[...n.circles??[],...o]}}},o_i=(e,t)=>t.map((n)=>{let o=n.endpoints.find((r)=>r.regionId===e.id).position;return{id:n.id,angle:Math.atan2(o.y-e.center.y,o.x-e.center.x),radius:Math.hypot(o.x-e.center.x,o.y-e.center.y)}}).sort((n,o)=>n.angle-o.angle||o.radius-n.radius||n.id.localeCompare(o.id)).map((n)=>n.id),r_i=(e,t,n)=>{let o=new Map(t.flatMap((l)=>l.map((h)=>[h,l]))),r=new Set,i=[];for(let l of e){let h=o.get(l);if(!h){i.push(l);continue}if(r.has(h))continue;r.add(h),i.push(...e.filter((d)=>h.includes(d)))}let s=new Map(n.flatMap((l)=>l.connectionIds.map((h)=>[h,l]))),a=new Set,c=[];for(let l of i){let h=s.get(l);if(!h){c.push(l);continue}if(a.has(h))continue;a.add(h);let d=new Set(h.connectionIds);c.push(...i.filter((u)=>d.has(u)))}return c},i_i=class extends po{constructor(e){super();this.params=e,this.visualizationLayer=e.visualizationLayer,this.MAX_ITERATIONS=e.validated.regions.length+1}params;naturalOrderByRegion={};currentRegionIndex=0;output;visualizedOrder;visualizedRegionId;visualizationLayer;setVisualizationLayer(e){this.visualizationLayer=e}_step(){let e=this.params.validated.regions[this.currentRegionIndex];if(e){let o=o_i(e,this.params.validated.connections);this.naturalOrderByRegion[e.id]=o,this.visualizedRegionId=e.id,this.visualizedOrder=o,this.currentRegionIndex+=1,this.stats={phase:"derive-natural-order",regionId:e.id,completedRegions:this.currentRegionIndex,totalRegions:this.params.validated.regions.length,naturalOrder:o};return}let t=this.params.validated.regions[0],n=r_i(this.naturalOrderByRegion[t.id],this.params.validated.atomicConnectionGroups,this.params.validated.buses);this.output={naturalOrderByRegion:this.naturalOrderByRegion,referenceOrder:n},this.visualizedRegionId=t.id,this.visualizedOrder=n,this.stats={phase:"atomicize-reference-order",referenceRegion:t.id,referenceOrder:n},this.solved=!0}computeProgress(){let e=this.currentRegionIndex;if(this.output)e+=1;return e/this.MAX_ITERATIONS}getConstructorParams(){return[this.params]}getOutput(){if(!this.solved||!this.output)throw new Yct("WindingBreakoutSolver: reference order requested before ordering completed");return this.output}visualize(){let e=this.params.validated.regions[0].id,t=`Next microstep: derive natural order for region “${e}”`;if(this.visualizedRegionId&&!this.output)t=`Natural order for region “${this.visualizedRegionId}” · ${this.currentRegionIndex}/${this.params.validated.regions.length} regions processed`;if(this.output)t=`Reference region “${e}” finalized; buses are contiguous and differential pairs are atomic`;return M8e({input:this.params.input,activeLayer:this.visualizationLayer,phase:"Step 1 · Derive reference order",detail:t,referenceOrder:this.visualizedOrder,referenceRegionId:this.visualizedRegionId,showReferenceNumbers:!0})}},s_i=({points:e,connectionIds:t,regions:n,atomicGroups:o})=>{let r=n.map((d)=>d.id),i=new Map,s=new Map,a=!0;for(let d of e){let u=`${d.regionId}:${d.connectionId}`;i.set(u,(i.get(u)??0)+1);let _=s.get(d.connectionId);if(_!==void 0&&_!==d.layer)a=!1;s.set(d.connectionId,d.layer)}let c=r.flatMap((d)=>t.map((u)=>`${d}:${u}`)),l=i.size===c.length&&c.every((d)=>i.get(d)===1),h=o.every((d)=>{let u=s.get(d[0]);if(!u)return!1;if(d.some((_)=>s.get(_)!==u))return!1;return n.every((_)=>{let p=e.filter((y)=>y.regionId===_.id&&y.layer===u),m=_.edge==="left"||_.edge==="right",A=[...p].sort((y,x)=>m?y.y-x.y:y.x-x.x).map((y)=>y.connectionId),g=A.indexOf(d[0]),f=A.indexOf(d[1]);return g!==-1&&f!==-1&&Math.abs(g-f)===1})});return l&&a&&h},a_i=({validated:e,placement:t})=>{if(!s_i({points:t.breakoutPoints,connectionIds:e.connections.map((o)=>o.id),regions:e.regions,atomicGroups:e.atomicConnectionGroups}))throw new Yct("WindingBreakoutSolver: generated invalid breakout points");return{breakoutPoints:t.breakoutPoints}},c_i=["referenceOrdering","gatePlacement"],l_i=class extends Rb{validatedInput;output;visualizationLayer;pipelineDef=[Pi("referenceOrdering",i_i,(e)=>[{input:e.inputProblem,validated:e.getValidatedInput(),visualizationLayer:e.visualizationLayer}]),Pi("gatePlacement",n_i,(e)=>[{input:e.inputProblem,validated:e.getValidatedInput(),ordering:e.getRequiredStageOutput("referenceOrdering"),visualizationLayer:e.visualizationLayer}])];constructor(e){super(e)}_setup(){this.validatedInput=Omi(this.inputProblem),this.stats={phase:"setup-input-validation",regionCount:this.validatedInput.regions.length,connectionCount:this.validatedInput.connections.length,layerCount:this.validatedInput.layerNames.length}}getValidatedInput(){if(!this.validatedInput)throw Error("WindingBreakoutSolver: input has not been validated");return this.validatedInput}_step(){if(super._step(),!this.output&&!this.activeSubSolver&&this.currentPipelineStageIndex>=this.pipelineDef.length)this.output=a_i({validated:this.getValidatedInput(),placement:this.getRequiredStageOutput("gatePlacement")}),this.solved=!0;if(this.stats={phase:this.getCurrentStageName(),completedStages:this.currentPipelineStageIndex,totalStages:this.pipelineDef.length},this.solved)this.stats.phase="finalize-output-validation";if(this.output)this.stats.valid=!0,this.stats.breakoutPointCount=this.output.breakoutPoints.length}getRequiredStageOutput(e){let t=this.getStageOutput(e);if(t===void 0)throw Error(`WindingBreakoutSolver: pipeline stage “${e}” has no output`);return t}setVisualizationLayer(e){this.visualizationLayer=e;for(let t of c_i){let n=this.getSolver(t);if(n&&"setVisualizationLayer"in n)n.setVisualizationLayer(e)}}getConstructorParams(){return[this.inputProblem]}getOutput(){if(!this.solved||!this.output)throw new Qmi("WindingBreakoutSolver: getOutput() called before successful completion");return this.output}initialVisualize(){return M8e({input:this.inputProblem,activeLayer:this.visualizationLayer,phase:"Input · Validated during setup",detail:"Region bounds, breakout edges, bus layer preferences, and canonical endpoints"})}finalVisualize(){if(!this.output)return null;let e=this.getRequiredStageOutput("referenceOrdering");return M8e({input:this.inputProblem,activeLayer:this.visualizationLayer,phase:"Output · Validated after gate placement",detail:"Valid: one bus-constrained breakout point per connection and region; pairs are adjacent",state:{referenceOrder:e.referenceOrder,breakoutPoints:this.output.breakoutPoints}})}visualize(){return{...super.visualize(),title:"Winding breakout solver · step-by-step pipeline",coordinateSystem:"cartesian"}}},t4n=(e)=>({id:e.connectionId,endpoints:e.endpoints}),h_i=(e)=>{let t={regions:e.regions.map((o)=>({id:o.regionId,bounds:o.bounds,edge:o.edge})),connections:e.connections.map((o)=>("type"in o)?{type:"differential",connections:o.connections.map(t4n)}:t4n(o)),buses:e.buses.map((o)=>({id:o.busId,connectionIds:o.connectionIds,preferredLayers:o.targetLayers})),boundaryPointSpacing:e.boundaryPointSpacing},n=new l_i(t);return n.solve(),n.getOutput()},n4n=(e)=>{let t=e.outline?Hs(e.outline):null,n=e.width??(t?t.maxX-t.minX:void 0),o=e.height??(t?t.maxY-t.minY:void 0);if(n===void 0||o===void 0)return null;return{minX:e.center.x-n/2,maxX:e.center.x+n/2,minY:e.center.y-o/2,maxY:e.center.y+o/2}},o4n=(e,t,n,o)=>Math.max(e-o,n-t,0),d_i=(e)=>{if(e.root?.pcbDisabled||!e.pcb_group_id)return;let t=e.root;if(!t)return;let n=e.parent?.children.filter((a)=>a instanceof e.constructor);if(!n)return;let o=n.indexOf(e);if(o<0)return;let{db:r}=t,i=r.pcb_group.get(e.pcb_group_id);if(!i)return;let s=n4n(i);if(!s)return;for(let a of n.slice(o+1)){if(!a.pcb_group_id)continue;let c=r.pcb_group.get(a.pcb_group_id);if(!c)continue;let l=n4n(c);if(!l)continue;let h=e._parsedProps.fanoutMargin,d=a._parsedProps.fanoutMargin,u=Math.max(typeof h==="number"?h:0,typeof d==="number"?d:0),_=o4n(s.minX,s.maxX,l.minX,l.maxX),p=o4n(s.minY,s.maxY,l.minY,l.maxY),m=Math.min(s.maxX,l.maxX)-Math.max(s.minX,l.minX),A=Math.min(s.maxY,l.maxY)-Math.max(s.minY,l.minY),g=m>0&&A>0,f=u>0&&_<u&&p<u;if(!g&&!f)continue;let y=g?`Fanout boundaries "${e.name}" and "${a.name}" overlap. Fanout boundaries may not overlap.`:`Fanout boundaries "${e.name}" and "${a.name}" do not maintain the required ${u}mm fanoutMargin.`;if(r.pcb_placement_error.list().some((C)=>C.message===y))continue;r.pcb_placement_error.insert({error_type:"pcb_placement_error",message:y,subcircuit_id:e.subcircuit_id??void 0})}},u_i=(e,t)=>{if(!(t instanceof UPn))return!1;if(!e.root||!e.pcb_group_id)return!1;let n=e.root.db.pcb_component.list().filter((o)=>o.pcb_group_id===e.pcb_group_id).map((o)=>o.source_component_id?e.root.db.source_component.get(o.source_component_id)?.name:void 0).filter((o)=>Boolean(o));return e.root.db.pcb_autorouting_error.insert({pcb_error_id:`pcb_autorouting_error_winding_breakout_${e.pcb_group_id}`,error_type:"pcb_autorouting_error",message:`Winding fanout failed for ${n.join(", ")||e.name}: ${t.message}. The connections could not escape to the breakout boundary. Give the fanout more room by increasing the breakout's padding, or by extending the breakout to include the parts crowding it (decoupling capacitors, series resistors).`}),!0};var p_i=(e)=>{let t=e.parent;if(!t?.selectAll)throw Error(`Automatic breakout "${e.name}" has no coordinated routing scope`);return t},m_i=(e,t)=>{let n=[];for(let i of e.selectAll("group")){if(!i.isRoutingDirective||i.parent!==e)continue;let s=i;if(s.children.some((c)=>c instanceof tue))n.push(s)}let o=(i)=>new Set(WPn(i).endpointBySourceTraceId.keys()),r=o(t);return n.filter((i)=>{let s=o(i);return s.size===r.size&&[...r].every((a)=>s.has(a))})},WPn=(e)=>{if(!e.root||!e.pcb_group_id)throw Error(`Automatic breakout "${e.name}" has no PCB region`);let t=e.root.db.pcb_group.get(e.pcb_group_id);if(!t||!t.width||!t.height)throw Error(`Automatic breakout "${e.name}" has invalid PCB region bounds`);let n={minX:t.center.x-t.width/2,maxX:t.center.x+t.width/2,minY:t.center.y-t.height/2,maxY:t.center.y+t.height/2},o={x:(n.minX+n.maxX)/2,y:(n.minY+n.maxY)/2},r=new Map,i=new Map;for(let s of e.children.filter((a)=>a instanceof tue)){let a=s.matchedPort;if(!a?.pcb_port_id||!a.source_port_id)throw Error(`Automatic breakout "${e.name}" is missing a PCB endpoint`);let c=s.matchedSourceTraceId;if(!c){let h=e.root.db.source_trace.list().filter((_)=>_.connected_source_port_ids.includes(a.source_port_id));if(h.length===0)throw Error(`Automatic breakout "${e.name}" has a point without a source trace identity`);let d=h.filter((_)=>_.connected_source_port_ids.some((p)=>{if(p===a.source_port_id)return!1;let m=e.root.db.pcb_port.getWhere({source_port_id:p});if(!m||m.pcb_group_id===e.pcb_group_id)return!1;return!(m.x>=n.minX&&m.x<=n.maxX&&m.y>=n.minY&&m.y<=n.maxY)}));c=(d.length>0?d:h).slice().sort((_,p)=>_.source_trace_id.localeCompare(p.source_trace_id))[0].source_trace_id,s.matchedSourceTraceId=c}if(r.has(c))throw Error(`Connection "${c}" has duplicate endpoint for region "${e.pcb_group_id}"`);let l=e.root.db.pcb_port.get(a.pcb_port_id);if(!l)throw Error(`Connection "${c}" references unknown PCB endpoint "${a.pcb_port_id}"`);if(l.pcb_group_id!==e.pcb_group_id)throw Error(`Connection "${c}" endpoint references unknown region "${l.pcb_group_id??"unassigned"}" instead of "${e.pcb_group_id}"`);if(l.x===void 0||l.y===void 0)throw Error(`Connection "${c}" is missing endpoint coordinates for region "${e.pcb_group_id}"`);r.set(c,{regionId:e.pcb_group_id,position:{x:l.x,y:l.y}}),i.set(c,a.source_port_id)}return{breakout:e,pcbGroupId:e.pcb_group_id,bounds:n,center:o,endpointBySourceTraceId:r,sourcePortIdBySourceTraceId:i}},__i=(e)=>{let t=e.map((s)=>s.center.x),n=e.map((s)=>s.center.y),o=Math.max(...t)-Math.min(...t),r=Math.max(...n)-Math.min(...n),i=o>=r;return e.sort((s,a)=>{if(i){let c=s.center.x-a.center.x;if(c!==0)return c;let l=s.center.y-a.center.y;if(l!==0)return l}else{let c=s.center.y-a.center.y;if(c!==0)return c;let l=s.center.x-a.center.x;if(l!==0)return l}return s.breakout.name.localeCompare(a.breakout.name)}),{regions:e,horizontalPlacement:i}},g_i=({region:e,regionIndex:t,regions:n,horizontalPlacement:o,singleRegionPreferredEdge:r})=>{if(n.length===1&&r)return r;let i=n.filter((a)=>a!==e),s=i.reduce((a,c)=>({x:a.x+c.center.x/i.length,y:a.y+c.center.y/i.length}),{x:0,y:0});if(o){if(s.x>e.center.x)return"right";if(s.x<e.center.x)return"left";if(t<n.length/2)return"right";return"left"}if(s.y>e.center.y)return"top";if(s.y<e.center.y)return"bottom";if(t<n.length/2)return"top";return"bottom"},A_i=({region:e,sourceTraces:t})=>{let n=e.breakout.root;if(!n)return;let o=new Set(e.sourcePortIdBySourceTraceId.values()),r=new Map;for(let a of t){if(!a.connected_source_port_ids.some((c)=>o.has(c)))continue;for(let c of a.connected_source_port_ids){if(o.has(c))continue;let l=n.db.pcb_port.getWhere({source_port_id:c});if(!l?.pcb_port_id||l.x===void 0||l.y===void 0)continue;if(l.x>=e.bounds.minX&&l.x<=e.bounds.maxX&&l.y>=e.bounds.minY&&l.y<=e.bounds.maxY)continue;r.set(l.pcb_port_id,{x:l.x,y:l.y})}}if(r.size===0)return;let i=(a,c)=>{let l=c==="left"||c==="right"?{x:c==="left"?e.bounds.minX:e.bounds.maxX,y:Math.max(e.bounds.minY,Math.min(e.bounds.maxY,a.y))}:{x:Math.max(e.bounds.minX,Math.min(e.bounds.maxX,a.x)),y:c==="bottom"?e.bounds.minY:e.bounds.maxY};return Math.hypot(a.x-l.x,a.y-l.y)},s=["right","left","top","bottom"];return s.reduce((a,c)=>{let l=[...r.values()].reduce((d,u)=>d+i(u,a),0);return[...r.values()].reduce((d,u)=>d+i(u,c),0)<l?c:a},s[0])},fst=({connectionOwner:e,connectionOwnerLabel:t,connectionSelector:n,sourceTraces:o})=>{let i=o.filter((s)=>s.name===n);if(i.length===0){let s=e.getSubcircuit().selectOne(n,{type:"port"});if(s?.source_port_id)i=o.filter((a)=>a.connected_source_port_ids.includes(s.source_port_id))}if(i.length===0)throw Error(`Could not resolve "${n}" in ${t}`);if(i.length>1)throw Error(`Connection "${n}" resolves to multiple source traces in ${t}`);return i[0]},f_i=({routingScope:e,sourceTraces:t,coordinatedSourceTraceIds:n,availableLayers:o})=>{let r=[],i=e.getSubcircuit().subcircuit_id;for(let s of e.selectAll("bus")){if(s.getSubcircuit().subcircuit_id!==i)continue;let a=[];for(let l of s._parsedProps.connections){let h=fst({connectionOwner:s,connectionOwnerLabel:`bus "${s.name}"`,connectionSelector:l,sourceTraces:t});if(n.has(h.source_trace_id))a.push(h.source_trace_id)}if(a.length===0)continue;let c={busId:s.name,connectionIds:a};if(s._parsedProps.preferredLayer!==void 0)c={...c,targetLayers:[s._parsedProps.preferredLayer]};else if(s._parsedProps.preferredLayers!==void 0)c={...c,targetLayers:s._parsedProps.preferredLayers};else{let l=s._parsedProps.pcbAllowedLayers??o;c={...c,targetLayers:[...new Set(l)]}}r.push(c)}return r},y_i=({routingScope:e,sourceTraces:t})=>{let n=e.getSubcircuit().subcircuit_id,o=[];for(let r of e.selectAll("differentialpair")){if(r.getSubcircuit().subcircuit_id!==n)continue;let i=fst({connectionOwner:r,connectionOwnerLabel:`differential pair "${r.name}"`,connectionSelector:r._parsedProps.positiveConnection,sourceTraces:t}),s=fst({connectionOwner:r,connectionOwnerLabel:`differential pair "${r.name}"`,connectionSelector:r._parsedProps.negativeConnection,sourceTraces:t});o.push({differentialPair:r,positiveSourceTraceId:i.source_trace_id,negativeSourceTraceId:s.source_trace_id})}return o},x_i=(e)=>{let t=e.root?.db.pcb_board.list()[0],n=t?.min_trace_width??0.15,o=t?.min_trace_to_pad_edge_clearance??0.2,r=t?.min_via_pad_diameter??0.3;return QCn({traceWidth:n,traceToPadClearance:o,viaPadDiameter:r})},C_i=({routingScope:e,automaticBreakouts:t})=>{let n=Bst(e._getSubcircuitLayerCount());for(let o of t){let r=o._parsedProps.fanoutRoutingLayers?.map(String);if(!r)continue;let i=new Set(r);n=n.filter((s)=>i.has(s))}if(n.length===0)throw Error(`Automatic breakouts in routing scope "${e.name}" have no shared fanout routing layer`);return n},b_i=(e)=>{if(!e.root)throw Error(`Automatic breakout "${e.name}" has no circuit root`);let t=p_i(e),n=m_i(t,e),o=new Set,r=n.map((y)=>{let x=WPn(y);if(o.has(x.pcbGroupId))throw Error(`Duplicate automatic breakout region "${x.pcbGroupId}"`);return o.add(x.pcbGroupId),x}),{regions:i,horizontalPlacement:s}=__i(r),a=new Set;for(let y of i)for(let x of y.endpointBySourceTraceId.keys())a.add(x);let c=e.root.db.source_trace.list().filter((y)=>y.subcircuit_id===t.getSubcircuit().subcircuit_id),l=new Map;for(let y of c){if(l.has(y.source_trace_id))throw Error(`Duplicate connection identity "${y.source_trace_id}"`);l.set(y.source_trace_id,y)}let h=[...a].sort((y,x)=>{let C=l.get(y)?.name??y,b=l.get(x)?.name??x,I=C.localeCompare(b);if(I!==0)return I;return y.localeCompare(x)});for(let y of h){if(!l.has(y))throw Error(`Unknown connection identity "${y}"`);for(let x of i)if(!x.endpointBySourceTraceId.has(y))throw Error(`Connection "${y}" is missing endpoint for region "${x.pcbGroupId}"`)}let d=f_i({routingScope:t,sourceTraces:c,coordinatedSourceTraceIds:a,availableLayers:C_i({routingScope:t,automaticBreakouts:n})}),u=new Map;for(let y of h)u.set(y,i.map((x)=>x.endpointBySourceTraceId.get(y)));let _=new Map;for(let y of y_i({routingScope:t,sourceTraces:c})){let x=a.has(y.positiveSourceTraceId),C=a.has(y.negativeSourceTraceId);if(x!==C)throw Error(`Differential pair "${y.differentialPair.name}" is missing one coordinated member`);if(!x)continue;if(_.has(y.positiveSourceTraceId)||_.has(y.negativeSourceTraceId))throw Error("A connection belongs to multiple differential pairs");_.set(y.positiveSourceTraceId,y),_.set(y.negativeSourceTraceId,y)}let p=[],m=new Set;for(let y of h){let x=_.get(y);if(!x){p.push({connectionId:y,endpoints:u.get(y)});continue}if(m.has(x.differentialPair))continue;m.add(x.differentialPair),p.push({type:"differential",connections:[{connectionId:x.positiveSourceTraceId,endpoints:u.get(x.positiveSourceTraceId)},{connectionId:x.negativeSourceTraceId,endpoints:u.get(x.negativeSourceTraceId)}]})}let A=new Map,g=i.length===1?A_i({region:i[0],sourceTraces:c}):void 0;return{input:{regions:i.map((y,x)=>(A.set(y.pcbGroupId,y.sourcePortIdBySourceTraceId),{regionId:y.pcbGroupId,bounds:y.bounds,edge:g_i({region:y,regionIndex:x,regions:i,horizontalPlacement:s,singleRegionPreferredEdge:g})})),connections:p,buses:d,boundaryPointSpacing:x_i(e)},sourcePortIdByConnectionIdByRegionId:A}},r4n=new WeakMap,I_i=(e,t)=>{let n=b_i(e),o=t(n.input);if(o instanceof Promise)throw Error("Implicit breakout point solvers must return synchronously during PCB layout");let r=0;for(let a of n.input.connections){if("type"in a){r+=a.connections.length;continue}r+=1}let i=new Map,s=new Set;for(let a of n.input.regions)i.set(a.regionId,[]);for(let a of o.breakoutPoints){let c=i.get(a.regionId);if(!c)throw Error(`Implicit breakout point solver returned unknown region "${a.regionId}"`);let l=`${a.regionId}:${a.connectionId}`;if(s.has(l))throw Error(`Implicit breakout point solver returned duplicate endpoint for connection "${a.connectionId}" in region "${a.regionId}"`);s.add(l);let h=n.sourcePortIdByConnectionIdByRegionId.get(a.regionId)?.get(a.connectionId);if(!h)throw Error(`Implicit breakout point solver returned unknown connection "${a.connectionId}" for region "${a.regionId}"`);c.push({sourcePortId:h,sourceTraceId:a.connectionId,layer:a.layer,x:a.x,y:a.y})}for(let[a,c]of i)if(c.length!==r)throw Error(`Implicit breakout point solver output is missing endpoints for region "${a}"`);return{breakoutPointsByRegionId:i}},v_i=(e,t)=>{let n=e.parent;if(!n||!e.pcb_group_id)throw Error(`Automatic breakout "${e.name}" has no coordinated PCB region`);let o=r4n.get(n);if(!o||o.solverFn!==t)o={solverFn:t,solutions:[]},r4n.set(n,o);let r=o.solutions.find((s)=>s.breakoutPointsByRegionId.has(e.pcb_group_id));if(!r)r=I_i(e,t),o.solutions.push(r);let i=r.breakoutPointsByRegionId.get(e.pcb_group_id);if(!i)throw Error(`Automatic breakout "${e.name}" references unknown implicit-breakout region "${e.pcb_group_id}"`);return i},yst=class extends UP{get isDogboneFanout(){let e=this._parsedProps.autorouter;return(typeof e==="string"?e:e?.preset)==="dogbone"}get isRoutingDirective(){return!0}get config(){return{...super.config,zodProps:xSt}}doInitialCreateAutoplacedBreakoutPoints(){for(let s of this._parsedProps.pcbTracePaths??[]){let a=s.route.at(-1),c=new hPn({connection:s.connection,pcbX:a.x,pcbY:a.y});if(c.exitLayer=a.route_type==="wire"?a.layer:a.to_layer,this.add(c),c._matchConnection(),!c.matchedPort||!this.selectAll("port").includes(c.matchedPort))throw Error(`Fanout trace path "${s.connection}" must select a port inside the fanout`);if(this.children.some((h)=>{if(!(h instanceof bG)||h===c)return!1;return h._matchConnection(),h.matchedPort===c.matchedPort}))throw Error(`Duplicate fanout exit for "${s.connection}"`)}let e=this.selectAll("port"),t=new Set(e),n=this.children.filter((s)=>s instanceof bG),o=new Set(n.map((s)=>(s._matchConnection(),s.matchedPort)).filter(Boolean)),r=this.getSubcircuit().selectAll("trace"),i=new Set;for(let s of r){let a=s._findConnectedPorts();if(!a.allPortsFound||!a.ports)continue;for(let c of a.ports){let l=t.has(c),h=a.ports.some((u)=>!t.has(u));if(!l||!h&&!this.isDogboneFanout)continue;if(o.has(c))continue;if(i.has(c))continue;i.add(c);let d=new tue({});d.matchedPort=c,d.matchedSourceTraceId=s.source_trace_id,this.add(d)}}}doInitialPcbAutoplaceBreakoutPoints(){if(this.root?.pcbDisabled)return;if(this.isDogboneFanout&&this._parsedProps.pcbTracePaths===void 0){for(let l of this.children){if(!(l instanceof tue))continue;let h=this.root.db.pcb_port.get(l.matchedPort.pcb_port_id);l._applySolvedBreakoutPoint({sourceTraceId:l.matchedSourceTraceId,layer:h.layers[0],position:h})}return}let e=this.props.autorouter,t=e===void 0?this.parent?.getInheritedProperty("autorouter"):void 0,n=typeof e==="object"?e.implicitBreakoutPointSolverFn:typeof t==="object"?t.implicitBreakoutPointSolverFn:void 0,o=this.children.filter((l)=>l instanceof tue);if(o.length===0)return;if(!this.root||!this.pcb_group_id)return;let r=this.root.db.pcb_group.get(this.pcb_group_id);if(!r?.width||!r.height)return;let i={minX:r.center.x-r.width/2,maxX:r.center.x+r.width/2,minY:r.center.y-r.height/2,maxY:r.center.y+r.height/2},s;try{s=v_i(this,n??h_i)}catch(l){if(n||!u_i(this,l))throw l;return}let a=0.0001,c=(l,h)=>({x:Math.max(i.minX+a,Math.min(i.maxX-a,l)),y:Math.max(i.minY+a,Math.min(i.maxY-a,h))});for(let l of s){let h=o.find((d)=>d.matchedPort?.source_port_id===l.sourcePortId);if(h){let d=c(l.x,l.y);h._applySolvedBreakoutPoint({sourceTraceId:l.sourceTraceId,layer:l.layer,position:d})}}}doInitialPcbPrimitiveRender(){super.doInitialPcbPrimitiveRender()}doInitialPcbPlacementDesignRuleChecks(){d_i(this)}},S_i=class extends lr{pcb_silkscreen_graphic_id=null;pcb_silkscreen_graphic_ids=[];pcb_silkscreen_path_ids=[];isPcbPrimitive=!0;get config(){return{componentName:"SilkscreenGraphic",zodProps:dEt}}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;this._queueAsyncEffect("SilkscreenGraphicRender",async()=>{if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,{maybeFlipLayer:n}=this._getPcbPrimitiveFlippedHelpers(),o=n(t.layer??"top");if(o!=="top"&&o!=="bottom")throw Error(`Invalid layer "${o}" for SilkscreenGraphic. Must be "top" or "bottom".`);let r=await $6e(t.imageUrl);if(r.mimetype!==dv&&r.mimetype!==ttt)throw Error(`Unsupported imageUrl for SilkscreenGraphic: "${t.imageUrl}". Expected an SVG or PNG image.`);let i={project_relative_path:r.projectRelativePath,url:r.dataUrl,mimetype:r.mimetype},s=r.mimetype===dv?Whn({svg:r.text,width:t.width,height:t.height,transform:this._computePcbGlobalTransformBeforeLayout()}):[this.getPlacementBoxBRepShape()],a=this.parent?.pcb_component_id??this.getPrimitiveContainer()?.pcb_component_id??"";for(let c of s){let l=e.insert({type:"pcb_silkscreen_graphic",pcb_component_id:a,pcb_group_id:this.getGroup()?.pcb_group_id??void 0,subcircuit_id:this.getSubcircuit()?.subcircuit_id??void 0,layer:o,shape:"brep",brep_shape:c,image_asset:i});this.pcb_silkscreen_graphic_ids.push(l.pcb_silkscreen_graphic_id)}if(this.pcb_silkscreen_graphic_id=this.pcb_silkscreen_graphic_ids[0]??null,r.mimetype===dv)this.insertRenderableSilkscreenPaths(r.text,o)})}insertRenderableSilkscreenPaths(e,t){let{db:n}=this.root,{_parsedProps:o}=this,r=this._computePcbGlobalTransformBeforeLayout(),i=this.parent?.pcb_component_id??this.getPrimitiveContainer()?.pcb_component_id??"";for(let s of ntt({svg:e,width:o.width,height:o.height,transform:r})){if(s.length<2)continue;let a=n.pcb_silkscreen_path.insert({pcb_component_id:i,layer:t,route:s,stroke_width:Math.max(Math.min(o.width,o.height)/60,0.05),subcircuit_id:this.getSubcircuit()?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0});this.pcb_silkscreen_path_ids.push(a.pcb_silkscreen_path_id)}}getPcbSize(){let{_parsedProps:e}=this;return{width:e.width,height:e.height}}getPlacementBoxBRepShape(){let{_parsedProps:e}=this,t=e.width/2,n=e.height/2,o=this._computePcbGlobalTransformBeforeLayout();return{outer_ring:{vertices:ott([{x:-t,y:n},{x:t,y:n},{x:t,y:-n},{x:-t,y:-n}]).map((r)=>_o(o,r))},inner_rings:[]}}_moveCircuitJsonElements({deltaX:e,deltaY:t}){if(this.root?.pcbDisabled)return;let{db:n}=this.root,o=(r)=>({...r,x:r.x+e,y:r.y+t});for(let r of this.pcb_silkscreen_graphic_ids){let i=n.pcb_silkscreen_graphic.get(r);if(!i)continue;n.pcb_silkscreen_graphic.update(r,{brep_shape:{outer_ring:{vertices:i.brep_shape.outer_ring.vertices.map(o)},inner_rings:i.brep_shape.inner_rings.map((s)=>({vertices:s.vertices.map(o)}))}})}for(let r of this.pcb_silkscreen_path_ids){let i=n.pcb_silkscreen_path.get(r);if(!i)continue;n.pcb_silkscreen_path.update(r,{route:i.route.map((s)=>({...s,x:s.x+e,y:s.y+t}))})}}},P_i=class extends lr{pcb_smtpad_id=null;isPcbPrimitive=!0;get config(){return{componentName:"Fiducial",zodProps:d1e,sourceFtype:"simple_fiducial"}}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,n=this._getGlobalPcbPositionBeforeLayout(),{maybeFlipLayer:o}=this._getPcbPrimitiveFlippedHelpers(),r=this.parent?.pcb_component_id??this.getPrimitiveContainer()?.pcb_component_id,i=e.pcb_smtpad.insert({pcb_component_id:r,layer:o(t.layer||"top"),shape:"circle",x:n.x,y:n.y,radius:Ke.parse(t.padDiameter)/2,soldermask_margin:t.soldermaskPullback?Ke.parse(t.soldermaskPullback):Ke.parse(t.padDiameter)/2,is_covered_with_solder_mask:!0});this.pcb_smtpad_id=i.pcb_smtpad_id}getPcbSize(){let{_parsedProps:e}=this,t=Ke.parse(e.padDiameter);return{width:t,height:t}}_setPositionFromLayout(e){if(!this.pcb_smtpad_id)return;let{db:t}=this.root;t.pcb_smtpad.update(this.pcb_smtpad_id,{x:e.x,y:e.y})}_moveCircuitJsonElements({deltaX:e,deltaY:t}){if(this.root?.pcbDisabled)return;let{db:n}=this.root;if(!this.pcb_smtpad_id)return;let o=n.pcb_smtpad.get(this.pcb_smtpad_id);if(!o)return;if(o.shape==="rect"||o.shape==="circle"||o.shape==="rotated_rect"||o.shape==="pill")this._setPositionFromLayout({x:o.x+e,y:o.y+t});else if(o.shape==="polygon")n.pcb_smtpad.update(this.pcb_smtpad_id,{points:o.points.map((r)=>({x:r.x+e,y:r.y+t}))})}},pZ=0.000000001,i4n=(e)=>e.route_type==="wire",E_i=(e,t,n)=>{let o=(e.y-t.y)*(n.x-t.x)-(e.x-t.x)*(n.y-t.y);if(Math.abs(o)>pZ)return!1;let r=(e.x-t.x)*(n.x-t.x)+(e.y-t.y)*(n.y-t.y);if(r<-pZ)return!1;let i=(n.x-t.x)**2+(n.y-t.y)**2;if(r-i>pZ)return!1;return!0},s4n=(e,t)=>{if(t.length<3)return!1;let n=!1,o=t[t.length-1];for(let r of t){if(E_i(e,o,r))return!0;if(r.y>e.y!==o.y>e.y&&e.x<(o.x-r.x)*(e.y-r.y)/(o.y-r.y)+r.x)n=!n;o=r}return n},M_i=(e,t)=>{let{center:n,width:o,height:r}=t,i=(t.rotation??0)*Math.PI/180,s=Math.cos(-i),a=Math.sin(-i),c=e.x-n.x,l=e.y-n.y,h=c*s-l*a,d=c*a+l*s;return Math.abs(h)<=o/2+pZ&&Math.abs(d)<=r/2+pZ},w_i=(e,t)=>{let n=t.brep_shape.outer_ring.vertices.map((o)=>({x:o.x,y:o.y}));if(!s4n(e,n))return!1;for(let o of t.brep_shape.inner_rings){let r=o.vertices.map((i)=>({x:i.x,y:i.y}));if(s4n(e,r))return!1}return!0},B_i=(e,t)=>{if(t.shape==="rect")return M_i(e,t);if(t.shape==="brep")return w_i(e,t);return!1},T_i=(e,t,n)=>{if(e.source_trace_id===t)return!0;if(!e.source_trace_id)return!1;let o=n.get(e.source_trace_id);if(!o)return!1;return o.connected_source_net_ids.includes(t)},D_i=(e,t,n)=>{let o=t.x-e.x,r=t.y-e.y;if(Math.hypot(o,r)<=pZ)return!1;return[0,0.25,0.5,0.75,1].every((a)=>B_i({x:e.x+o*a,y:e.y+r*a},n))},N_i=({db:e,copperPour:t})=>{if(!t.source_net_id)return;let n=new Map(e.source_trace.list().map((o)=>[o.source_trace_id,o]));for(let o of e.pcb_trace.list()){if(!T_i(o,t.source_net_id,n))continue;let r=!1,i=o.route.map((s)=>({...s}));for(let s=0;s<i.length-1;s++){let a=i[s],c=i[s+1];if(!a||!c)continue;if(!i4n(a)||!i4n(c))continue;if(a.layer!==t.layer||c.layer!==t.layer)continue;if(D_i({x:a.x,y:a.y},{x:c.x,y:c.y},t))a.is_inside_copper_pour=!0,a.copper_pour_id=t.pcb_copper_pour_id,c.is_inside_copper_pour=!0,c.copper_pour_id=t.pcb_copper_pour_id,r=!0}if(r)e.pcb_trace.update(o.pcb_trace_id,{route:i})}},urt=new WeakMap,R_i=0.3,Q_i=async(e)=>{if(!e.root)return;let{db:t}=e.root,n=e.selectAll("copperpour").filter((d)=>d.getSubcircuit()===e),o=[];for(let d of n){let{_parsedProps:u}=d,p=e.selectOne(u.connectsTo)?.source_net_id;if(!p){d.renderError(`Net "${u.connectsTo}" not found for copper pour`);continue}o.push({copperPour:d,sourceNetId:p})}if(o.length===0)return;let r=t.toArray(),i=e._getBoard(),s=i?.pcb_board_id?t.pcb_board.get(i.pcb_board_id):void 0,a=s?.outline?.length?s.outline:void 0;if(!a&&s?.width!==void 0&&s.height!==void 0){let{center:d,width:u,height:_}=s;a=[{x:d.x-u/2,y:d.y-_/2},{x:d.x+u/2,y:d.y-_/2},{x:d.x+u/2,y:d.y+_/2},{x:d.x-u/2,y:d.y+_/2}]}let c=uet(r,o.map(({copperPour:d,sourceNetId:u})=>{let{_parsedProps:_}=d,p=_.clearance??0.2;return{layer:_.layer,crosshatch:_.crosshatch,crosshatchPitch:_.crosshatchPitch,crosshatchWidth:_.crosshatchWidth,subcircuit_id:e.subcircuit_id??void 0,source_net_id:u,pad_margin:_.padMargin??p,trace_margin:_.traceMargin??p,pour_margin:p,board_edge_margin:_.boardEdgeMargin??p,board_edge_outline:d._isImplicitCopperPour?a:void 0,cutout_margin:_.cutoutMargin??p,..._.useThermalReliefs?{use_thermal_reliefs:!0,thermal_relief_spoke_width:R_i}:{},outline:_.outline??a}}));await bcn();let l=new u6e(c);e.root.emit("solver:started",{type:"solver:started",solverName:"CopperPourPipelineSolver",solverParams:c,solverConstructorArgs:[c],componentName:e.getString()});let{brep_shapes_by_region:h}=l.getOutput();for(let[d,{copperPour:u,sourceNetId:_}]of o.entries()){let{_parsedProps:p}=u,m=p.coveredWithSolderMask??!1;for(let A of h[d]??[]){let g=t.pcb_copper_pour.insert({shape:"brep",layer:p.layer,brep_shape:A,source_net_id:_,subcircuit_id:e.subcircuit_id??void 0,covered_with_solder_mask:m});N_i({db:t,copperPour:g})}}};function k_i(e){if(e.root?.pcbDisabled)return;e._queueAsyncEffect("PcbCopperPourRender",async()=>{let t=e.getSubcircuit(),n=urt.get(t);if(n){await n;return}let o=Q_i(t);urt.set(t,o);try{await o}finally{urt.delete(t)}})}var L_i=(e)=>{let t=e.getSubcircuit();if(!t.root)return;let n=t.selectAll("copperpour").filter((u)=>u.getSubcircuit()===t);if(n[0]!==e)return;let o=n.flatMap((u)=>{let _=t.selectOne(u._parsedProps.connectsTo);return _?.source_net_id?[_.source_net_id]:[]});if(o.length===0)return;let{db:r}=t.root,i=e.getInheritedMergedProperty("pcbStyle"),{holeDiameter:s,padDiameter:a}=cT(i),c=e._getBoard(),l=c?.pcb_board_id?r.pcb_board.get(c.pcb_board_id):void 0,h={circuitJson:r.toArray(),options:{sourceNetIds:[...new Set(o)],viaHoleDiameter:l?.min_via_hole_diameter??s,viaOuterDiameter:l?.min_via_pad_diameter??a,viaStitchPitch:c?._parsedProps.viaStitchPitch}},d=new wSn(h);if(t.root.emit("solver:started",{type:"solver:started",solverName:"ViaStitchSolver",solverParams:h,solverConstructorArgs:[h],componentName:t.getString()}),d.solve(),d.failed)throw Error(d.error??"Via stitching solver failed");for(let u of d.getOutput().pcbVias){let{pcb_via_id:_,...p}=vR.parse(u),m=r.pcb_via.insert({...p,tented_on_top:void 0,tented_on_bottom:void 0});c?._generatedStitchingViaIds?.add(m.pcb_via_id)}};function H_i(e){if(e.root?.pcbDisabled||!e.root?._featurePcbViaStitching)return;if(!e._getBoard()?._parsedProps.enableViaStitching)return;e._queueAsyncEffect("PcbViaStitchRender",async()=>{L_i(e)})}var F_i=class extends lr{isPcbPrimitive=!0;_isImplicitCopperPour=!1;get config(){return{componentName:"CopperPour",zodProps:kPt}}getPcbSize(){return{width:0,height:0}}doInitialCreateNetsFromProps(){let{_parsedProps:e}=this;Gue(this,[e.connectsTo])}doInitialPcbCopperPourRender(){k_i(this)}doInitialPcbViaStitchRender(){H_i(this)}},tee=(e)=>{if(e.model!==void 0){if(/^https?:\/\//i.test(e.model))return Frt(e.model);return{glbUrl:`https://modelcdn.tscircuit.com/jscad_models/${encodeURIComponent(e.model)}.glb`}}if(e.modelUrl!==void 0)return Frt(e.modelUrl);return},XPn=class extends lr{isAssemblyDeviceContainer=!0;get config(){return{componentName:"AssemblyDevice",zodProps:J7t}}doInitialAssignNameToUnnamedComponents(){}computeSchematicGlobalTransform(){return fh()}_computePcbGlobalTransformBeforeLayout(){return fh()}doInitialSourceRender(){if(this._parsedProps.modelUrl===void 0&&this._parsedProps.model===void 0||!this.root)return;this.source_component_id=this.root.db.source_component.insert({ftype:"subassembly",name:this.name}).source_component_id}doInitialCadModelRender(){let e=tee(this._parsedProps);if(!this.root||this.root.pcbDisabled||!this.source_component_id||!e)return;this.cad_component_id=lT(this,e,{position:{x:0,y:0,z:0},pcbRotation:0,layer:"top"})}},z_i=(e)=>{let t=e._parsedProps.mountRotationAnchor??"rightedge",n=e._computePcbGlobalTransformBeforeLayout();switch(t){case"rightedge":return[n.a,n.b,0];case"leftedge":return[-n.a,-n.b,0];case"topedge":return[n.c,n.d,0];case"bottomedge":return[-n.c,-n.d,0]}let o=e.getDescendants().filter((l)=>jue(l,t));if(o.length!==1)throw Error(`board "${e.name}" mountRotationAnchor "${t}" matched ${o.length} components; expected exactly one on this board`);let r=o[0],i=r.pcb_component_id&&e.root.db.pcb_component.get(r.pcb_component_id);if(!i)throw Error(`board "${e.name}" mountRotationAnchor "${t}" has no PCB component geometry`);let s=e.root.db.pcb_board.get(e.pcb_board_id),a=i.center.x-s.center.x,c=i.center.y-s.center.y;if(Math.hypot(a,c)<0.000001)throw Error(`board "${e.name}" mountRotationAnchor "${t}" is on the mounting axis and has no direction`);return[a,c,0]},eve=(e)=>e*Math.PI/180,prt=(e)=>Bu(e*180/Math.PI),O_i=(e)=>{switch(e){case"x+":return{x:0,y:90,z:0};case"x-":return{x:0,y:270,z:0};case"y+":return{x:270,y:0,z:0};case"y-":return{x:90,y:0,z:0};default:return{x:0,y:0,z:0}}},jPn=(e,t)=>{let n=O_i(e._parsedProps.shaftFacingDirection),o=EPn(e),r=o?._parsedProps.mountRotation;if(!o||!r)return n;let i=t.layer==="bottom",s=i?-1:1,a=qm.mat4.create();qm.mat4.rotateX(a,a,eve(n.x)),qm.mat4.rotateY(a,a,eve(n.y+(i?180:0))),qm.mat4.rotateZ(a,a,eve(s*t.pcbRotation));let c=r.startsWith("calc(")?r.match(/^calc\(\s*(.*?)\s*(?:([+-])\s*((?:\d+(?:\.\d*)?|\.\d+))\s*(degcw|degccw))?\s*\)$/):[r,r],l=c[1],h=l.lastIndexOf("."),d=l.slice(0,h),u=l.slice(h+1);if(!jue(e,d))throw Error(`board "${o.name}" mountRotation "${r}" must reference its mounted motor "${e.name}"`);let _=Object.entries(e.motorReferencePoints).find(([P])=>P===u)?.[1];if(!_)throw Error(`assembly.motor "${e.name}" has no ${u} reference`);if(Math.abs(_.direction.z)>0.000001)throw Error(`board "${o.name}" mountRotation "${r}" must reference a direction in the mounting face, e.g. "${d}.wireside"`);let p=eve((c[2]==="-"?-1:1)*Number(c[3]??0)*(c[4]==="degccw"?-1:1)),m=qm.vec3.normalize(qm.vec3.create(),z_i(o)),A=qm.vec3.transformMat4(qm.vec3.create(),[0,0,1],a),g=qm.mat4.fromRotation(qm.mat4.create(),-p,A),f=qm.vec3.transformMat4(qm.vec3.create(),m,g),y=qm.vec3.transformMat4(qm.vec3.create(),[_.direction.x,_.direction.y,_.direction.z],a),x=Math.atan2(qm.vec3.dot(A,qm.vec3.cross(qm.vec3.create(),y,f)),qm.vec3.dot(y,f));qm.mat4.rotateZ(a,a,x);let C=Math.asin(Math.max(-1,Math.min(1,a[8]))),b=Math.abs(a[8])<0.999999,I=b?Math.atan2(-a[9],a[10]):Math.atan2(a[6],a[5]),v=b?Math.atan2(-a[4],a[0]):0;return{x:prt(I),y:prt(C)-(i?180:0),z:s*prt(v)-t.pcbRotation}},KPn=(e)=>{let t=Tzr(e);if(t)return t;let n=EPn(e),o=n?._parsedProps.mountOrientation,r=o?o==="bottom_layer_toward_mount_face"?"bottom":"top":e._parsedProps.shaftFacingDirection==="z-"?"bottom":"top";if(!n)return{position:{x:0,y:0,z:0},pcbRotation:0,layer:r};let i=n.root.db.pcb_board.get(n.pcb_board_id);if(!i)throw Error(`Mounted board "${n.name}" has no PCB geometry`);let s=r==="bottom"?-1:1,a=n._computePcbGlobalTransformBeforeLayout();return{position:{...i.center,z:s*(-e.motorReferencePoints.backface.position.z+(n._parsedProps.mountGap??0)+i.thickness/2)},pcbRotation:Bu(Math.atan2(a.b,a.a)*180/Math.PI),layer:r,subcircuit_id:i.subcircuit_id}},$Pn=(e)=>{if(!SG(e).some((d)=>d.componentName==="AssemblyMotor"&&d._parsedProps.mountedTo))return;let{transforms:t,roots:n,motorMountRoots:o,subcircuitId:r}=uG(e);if(!o.has(n.get(e)))return;let i=t.get(e),s=Math.asin(Math.max(-1,Math.min(1,i[8]))),a=Math.abs(i[8])<0.999999,c=a?Math.atan2(-i[9],i[10]):Math.atan2(i[6],i[5]),l=a?Math.atan2(-i[4],i[0]):0,h=(d)=>Bu(d*180/Math.PI);return{position:{x:i[12],y:i[13],z:i[14]},rotation:{x:h(c),y:h(s),z:h(l)},subcircuit_id:r}},qPn=class extends lr{get config(){return{componentName:"AssemblyMotor",zodProps:nSt}}get motorModelString(){let e=this._parsedProps.model??this._parsedProps.standard,t=this._parsedProps.wireConnection;if(t===void 0)return e;return`${e}_${t}`}get motorModel(){let e=(()=>{try{return mpn(this.motorModelString)}catch(t){throw Error(`assembly.motor "${this.name}" requires a NEMA modelprinter model: ${t instanceof Error?t.message:t}`,{cause:t})}})();if(e.fn!=="nema")throw Error(`assembly.motor "${this.name}" requires a NEMA modelprinter model`);return e}get motorReferencePoints(){let{fn:e,...t}=this.motorModel;return ppn(t)}doInitialSourceRender(){this.motorModel,this.source_component_id=this.root.db.source_component.insert({ftype:"motor",name:this.name}).source_component_id}doInitialCadModelRender(){if(!this.root||this.root.pcbDisabled||!this.source_component_id)return;let e=tee({model:this.motorModelString}),t=$Pn(this);if(t){this.cad_component_id=lT(this,{...e,rotationOffset:t.rotation},{...t,pcbRotation:0,layer:"top"});return}let n=KPn(this);this.cad_component_id=lT(this,{...e,rotationOffset:jPn(this,n)},n)}},a4n=(e)=>Number(e.toFixed(6)).toString(),V_i=(e)=>{let{width:t,height:n}=e._parsedProps;if(t===void 0||n===void 0)throw Error(`assembly.screen "${e.name}" requires both width and height when cadModel is omitted`);return`flexscreen_w${a4n(t)}mm_h${a4n(n)}mm`},Y_i=(e)=>{if(!e.root||e.root.pcbDisabled||!e.source_component_id)return;let t=zZ(e);e.cad_component_id=lT(e,tee(e._parsedProps)??e._parsedProps.cadModel??V_i(e),t)},JPn=class extends lr{isAssemblyDeviceContainer=!0;get config(){return{componentName:"AssemblyScreen",zodProps:oSt}}doInitialAssignNameToUnnamedComponents(){if(this._parsedProps.name)return;throw Error("assembly.screen requires a non-empty name")}doInitialSourceRender(){let e=this.root.db.source_component.insert({ftype:"subassembly",name:this.name});this.source_component_id=e.source_component_id}doInitialCadModelRender(){Y_i(this)}},xst=class extends lr{isAssemblyDeviceContainer=!0;get config(){return{componentName:"AssemblySubassembly",zodProps:$7t}}doInitialAssignNameToUnnamedComponents(){if(this._parsedProps.name)return;throw Error("assembly.subassembly requires a non-empty name")}doInitialReactSubtreesRender(){if(ZPn.isValidElement(this.props.cadModel))this.add(Wue(this.props.cadModel))}doInitialSourceRender(){let e=this.root.db.source_component.insert({ftype:"subassembly",name:this.name});this.source_component_id=e.source_component_id}doInitialCadModelRender(){if(!this.root||this.root.pcbDisabled||!this.source_component_id)return;let e=zZ(this),t=tee(this._parsedProps)??this._parsedProps.cadModel;if(t&&!(typeof t==="object"&&("type"in t)))this.cad_component_id=lT(this,t,e)}},tEn=(e)=>{let t=N8e(e);if(!t.length)return;let{transforms:n,subcircuitId:o}=uG(e),r=n.get(e),i=k5.mat3.fromMat4(k5.mat3.create(),r),s=(a)=>({x:a[0],y:a[1],z:a[2]});for(let a of t){let c=e.children.find((l)=>l.componentName==="AssemblyReferenceSurface"&&l.name===a.name);e.root.db.cad_reference_surface.insert({source_component_id:e.source_component_id,name:a.name,shape:"rect",center:s(k5.vec3.transformMat4(k5.vec3.create(),a.origin,r)),normal:s(k5.vec3.normalize(k5.vec3.create(),k5.vec3.transformMat3(k5.vec3.create(),a.normal,i))),x_axis:s(k5.vec3.normalize(k5.vec3.create(),k5.vec3.transformMat3(k5.vec3.create(),a.xAxis,i))),width:c?._parsedProps.width,height:c?._parsedProps.height,subcircuit_id:o})}},nEn=class extends lr{isAssemblyDeviceContainer=!0;get config(){return{componentName:"AssemblyPart",zodProps:sze}}doInitialReactSubtreesRender(){if(eEn.isValidElement(this.props.cadModel))this.add(Wue(this.props.cadModel))}doInitialSourceRender(){N8e(this),this.source_component_id=this.root.db.source_component.insert({ftype:"subassembly",name:this.name,display_name:this._parsedProps.displayName}).source_component_id}doInitialCadModelRender(){if(!this.root||this.root.pcbDisabled||!this.source_component_id)return;tEn(this);let e=tee(this._parsedProps)??this._parsedProps.cadModel;if(e&&!(typeof e==="object"&&("type"in e)))this.cad_component_id=lT(this,e,zZ(this))}},oEn=class extends lr{get config(){return{componentName:"AssemblyReferenceSurface",zodProps:Z7t}}doInitialSourceRender(){if(this.parent?.componentName!=="AssemblyPart"&&this.parent?.componentName!=="AssemblyPrintedPart")throw Error(`Reference surface "${this.name}" must be a child of assembly.part or assembly.printedpart`)}get referenceFrame(){let{name:e,plane:t,normalDirection:n,centerXOffset:o,centerYOffset:r,centerZOffset:i}=this._parsedProps,s=n.endsWith("-")?-1:1;return{name:e,origin:[o,r,i],normal:t==="xy"?[0,0,s]:t==="xz"?[0,s,0]:[s,0,0],xAxis:t==="yz"?[0,1,0]:[1,0,0]}}},G_i=({cad:e,authoredModel:t})=>{let n=e.model_bounds??t?.modelBounds,o=e.model_origin_position??t?.modelOriginPosition;if(!n?.min||!n?.max||!o)return;let r=e.model_board_normal_direction??t?.modelBoardNormalDirection??"z+",i=r[0];if(i!=="x"&&i!=="y"&&i!=="z")return;let s=n.min[i],a=n.max[i],c=o[i];if(s===void 0||a===void 0||c===void 0)return;let l=r.endsWith("-")?c-s:a-c;return Number.isFinite(l)&&l>=0?l:void 0},U_i=({owner:e,pcbComponent:t,cadComponent:n,boardSurfaceZ:o})=>{let r=e?._parsedProps?.cadModel,i=r&&typeof r==="object"?r:void 0,s=n?.size??i?.size,a=s?.x,c=s?.y,l=s?.z,h=n?G_i({cad:n,authoredModel:i}):void 0,d=n?.position?.z,u=h!==void 0&&d!==void 0?h+Math.abs(d-o):void 0;return{size:a!==void 0&&c!==void 0?{x:a,y:c,z:l}:void 0,aboveBoardHeight:u,rotation:n?.rotation?.z??t.rotation??0,footprint:{width:t.width,height:t.height}}},W_i=({point:e,board:t})=>{let n=(t.width??0)/2,o=(t.height??0)/2,r=[["x_neg",Math.abs(e.x-(t.center.x-n))],["x_pos",Math.abs(e.x-(t.center.x+n))],["y_neg",Math.abs(e.y-(t.center.y-o))],["y_pos",Math.abs(e.y-(t.center.y+o))]];return r.sort((i,s)=>i[1]-s[1]),r[0][0]},X_i=(e)=>e,j_i={from_top:"y_pos",from_bottom:"y_neg",from_left:"x_neg",from_right:"x_pos"},K_i=(e,{board:t,pcbBoard:n})=>{let o=e.parent;while(o&&o!==t&&!o.pcb_component_id)o=o.parent;let r=o?.pcb_component_id?e.root?.db.pcb_component.get(o.pcb_component_id):null;if(!r)throw Error("<enclosure.cutoutaperture /> must be nested inside a component with a PCB footprint");let i=e._parsedProps,a=o?._getEnclosureApertureAxisDirection?.(r.layer,r.rotation??0),c=a?a.z!==0?a.z>0?"from_above":"from_below":Math.abs(a.x)>=Math.abs(a.y)?a.x>=0?"from_right":"from_left":a.y>=0?"from_top":"from_bottom":r.insertion_direction,l=c==="from_above"?"z_pos":c==="from_below"?"z_neg":void 0,h=r.layer==="bottom"?"bottom":"top",d,u;if(l)d=l,u={x:r.center.x-n.center.x,y:r.center.y-n.center.y};else{let g=r.cable_insertion_center??r.center,f=j_i[c]??W_i({point:g,board:n}),y=r.cable_insertion_center?{x:r.cable_insertion_center.x-r.center.x,y:r.cable_insertion_center.y-r.center.y}:null,x=y!=null&&(f==="x_neg"||f==="x_pos"?Math.abs(y.x)>=Math.abs(y.y):Math.abs(y.y)>=Math.abs(y.x)),C=a?r.center:x?g:r.center;d=X_i(f),u={x:C.x-n.center.x,y:C.y-n.center.y}}let _=e.root?.db.cad_component.getWhere({pcb_component_id:r.pcb_component_id})??null,p=(h==="bottom"?-1:1)*((n.thickness??t.boardThickness)/2),m=U_i({owner:o,pcbComponent:r,cadComponent:_,boardSurfaceZ:p}),A={face:d,center:u,boardSide:h,apertureAxisDirection:a,rotation:r.rotation??void 0,depth:i.depth,componentBody:m,widthDimensionOffset:i.widthDimensionOffset,heightDimensionOffset:i.heightDimensionOffset,margin:i.margin};switch(i.shape){case"pill":case"rect":return{...A,shape:i.shape,width:i.width,height:i.height};case"circle":return{...A,shape:"circle",radius:i.radius}}},Xct=class extends lr{get config(){return{componentName:"EnclosureCutoutAperture",zodProps:iSt}}getFdmEnclosureSolverInput(e){return K_i(this,e)}},rEn=(e,t)=>{let n=e.root?.firstChild,o=n?gK(t,n,{adapter:FZ}):null,r=o instanceof Iv?o:[n,...n?.getDescendants()??[]].find((i)=>i instanceof Iv&&i.isMatchingNameOrAlias(t));if(!(r instanceof Iv))throw Error(`Could not find a <board /> matching enclosure boardRef "${t}"`);return r},$_i=(e)=>{let t=e.root;if(!t||t.pcbDisabled||!e.source_component_id||!e.pcb_component_id)return;let{db:n}=t,o=e._parsedProps,r=rEn(e,o.boardRef),i=r.pcb_board_id?n.pcb_board.get(r.pcb_board_id):null;if(!i?.width||!i.height)throw Error(`Could not resolve dimensions for boardRef "${o.boardRef}"`);let s=i.thickness??r.boardThickness,a={board:{width:i.width,height:i.height,thickness:s},width:o.width,height:o.height,depth:o.depth,wallThickness:o.wallThickness,floorThickness:o.floorThickness,lidThickness:o.lidThickness,boardClearance:o.boardClearance,standoffHeight:o.standoffHeight,topHeadroom:o.topHeadroom,lidLipDepth:o.lidLipDepth,apertures:o.disableCutouts?[]:r.getDescendants().filter((_)=>_ instanceof Xct).map((_)=>_.getFdmEnclosureSolverInput({board:r,pcbBoard:i}))},c=new _6e(a),l=c.getConstructorParams();if(t.emit("solver:started",{type:"solver:started",solverName:"CreateFdmEnclosureSolver",solverParams:l[0],solverConstructorArgs:l,componentName:e.getString()}),c.solve(),c.failed)throw Error(c.error??"Failed to create FDM enclosure");let h=c.getOutput();n.pcb_component.update(e.pcb_component_id,{center:i.center,width:h.dimensions.width,height:h.dimensions.height});let d={x:i.center.x,y:i.center.y,z:-s/2-h.dimensions.floorThickness-h.dimensions.standoffHeight},u=h.parts.map((_)=>n.cad_component.insert({position:d,rotation:{x:0,y:0,z:0},pcb_component_id:e.pcb_component_id,source_component_id:e.source_component_id,model_jscad:_.jscadPlan,model_unit_to_mm_scale_factor:1,model_object_fit:"contain_within_bounds",model_origin_alignment:"bottom_center_of_component",anchor_alignment:"center",show_as_translucent_model:!1,show_hidden_edges:o.showHiddenEdges}));e.cad_component_id=u[0]?.cad_component_id??null},iEn=class e extends lr{get config(){return{componentName:"EnclosureFdmBox",zodProps:sSt}}doInitialAssignNameToUnnamedComponents(){if(this._parsedProps.name)return;let t=this;while(t.parent instanceof lr)t=t.parent;let o=[t,...t.getDescendants()].filter((r)=>r instanceof e).indexOf(this);this.fallbackUnassignedName=`unnamed_enclosure_fdm_box_${o===-1?0:o+1}`}doInitialSourceRender(){let t=this.root.db.source_component.insert({ftype:"simple_chip",name:this.name});this.source_component_id=t.source_component_id}doInitialPcbComponentRender(){let t=this.root;if(!t||t.pcbDisabled||!this.source_component_id)return;let n=rEn(this,this._parsedProps.boardRef),r=(n.pcb_board_id?t.db.pcb_board.get(n.pcb_board_id):null)?.center??n._getGlobalPcbPositionBeforeLayout(),i=t.db.pcb_component.insert({center:r,width:0,height:0,layer:"top",rotation:0,source_component_id:this.source_component_id,obstructs_within_bounds:!1,do_not_place:!0,is_allowed_to_be_off_board:!0});this.pcb_component_id=i.pcb_component_id}doInitialCadModelRender(){$_i(this)}},q_i=class extends Xl{get config(){return{componentName:"Battery",schematicSymbolName:this.props.symbolName??"battery",zodProps:ZSt,sourceFtype:"simple_power_source"}}initPorts(){super.initPorts({additionalAliases:{pin1:["anode","pos","left"],pin2:["cathode","neg","right"]}})}doInitialSourceRender(){let{db:e}=this.root,{_parsedProps:t}=this,n=e.source_component.insert({name:this.name,ftype:"simple_power_source",capacity:t.capacity,supplier_part_numbers:t.supplierPartNumbers,manufacturer_part_number:hi(t),are_pins_interchangeable:!1,display_name:t.displayName});this.source_component_id=n.source_component_id}},J_i=class extends Xl{_getPcbRotationBeforeLayout(){let e=this.props.pcbOrientation==="vertical"?-90:0;return(super._getPcbRotationBeforeLayout()??0)+e}get config(){return{componentName:"PinHeader",zodProps:tPt,shouldRenderAsSchematicBox:!0}}_getImpliedFootprintString(){let e=this._parsedProps.pinCount??(Array.isArray(this._parsedProps.pinLabels)?this._parsedProps.pinLabels.length:this._parsedProps.pinLabels?Object.keys(this._parsedProps.pinLabels).length:0),t=this._parsedProps.holeDiameter,n=this._parsedProps.platedDiameter,o=this._parsedProps.pitch,r=this._parsedProps.showSilkscreenPinLabels,i=this._parsedProps.doubleRow?2:1,s=this._parsedProps.gender;if(e>0){let a;if(o)if(!t&&!n)a=`pinrow${e}_p${o}`;else a=`pinrow${e}_p${o}_id${t}_od${n}`;else if(!t&&!n)a=`pinrow${e}`;else return null;if(r!==!0)a+="_nopinlabels";if(s==="female")a+="_female";if(i>1)a+=`_rows${i}`;return a}return null}initPorts(){let e=this._parsedProps.pinCount??(Array.isArray(this._parsedProps.pinLabels)?this._parsedProps.pinLabels.length:this._parsedProps.pinLabels?Object.keys(this._parsedProps.pinLabels).length:1);for(let t=1;t<=e;t++){let n=Array.isArray(this._parsedProps.pinLabels)?this._parsedProps.pinLabels[t-1]:this._parsedProps.pinLabels?.[`pin${t}`];if(n){let o=Array.isArray(n)?n[0]:n,r=Array.isArray(n)?n.slice(1):[];this.add(new sd({pinNumber:t,name:o,aliases:[`pin${t}`,...r]}))}else this.add(new sd({pinNumber:t,name:`pin${t}`}))}}_getSchematicPortArrangement(){let e=this._parsedProps.pinCount??1,t=this._parsedProps.schFacingDirection??this._parsedProps.facingDirection??"right",n=this._parsedProps.schPinArrangement,o=Array.from({length:e},(r,i)=>`pin${i+1}`);if(t==="left")return{leftSide:{direction:n?.leftSide?.direction??"top-to-bottom",pins:n?.leftSide?.pins??o}};if(t==="up")return{topSide:{direction:n?.topSide?.direction??"left-to-right",pins:n?.topSide?.pins??o}};if(t==="down")return{bottomSide:{direction:n?.bottomSide?.direction??"left-to-right",pins:n?.bottomSide?.pins??o}};return{rightSide:{direction:n?.rightSide?.direction??"top-to-bottom",pins:n?.rightSide?.pins??o}}}doInitialSourceRender(){let{db:e}=this.root,{_parsedProps:t}=this,n=e.source_component.insert({ftype:"simple_pin_header",name:this.name,supplier_part_numbers:t.supplierPartNumbers,manufacturer_part_number:hi(t),pin_count:t.pinCount,gender:t.gender,are_pins_interchangeable:!0,display_name:t.displayName});this.source_component_id=n.source_component_id}};function Z_i(e){switch(e){case"two_ground_pins":return"crystal_4pin";case"ground_pin":return"resonator";case"no_ground":return"crystal";default:return"crystal"}}var egi=class extends Xl{get config(){return{componentName:"Resonator",schematicSymbolName:this.props.symbolName??Z_i(this.props.pinVariant),zodProps:NSt,shouldRenderAsSchematicBox:!1}}doInitialSourceRender(){let{db:e}=this.root,{_parsedProps:t}=this,n=t.pinVariant||"no_ground",o=e.source_component.insert({ftype:"simple_resonator",name:this.name,manufacturer_part_number:hi(t),frequency:t.frequency,load_capacitance:t.loadCapacitance,supplier_part_numbers:t.supplierPartNumbers,pin_variant:n,are_pins_interchangeable:n==="no_ground"||n==="ground_pin",display_name:t.displayName});this.source_component_id=o.source_component_id}_getSchematicSymbolDisplayValue(){let e=`${vd(this._parsedProps.frequency)}Hz`;if(this._parsedProps.loadCapacitance)return`${e} / ${vd(this._parsedProps.loadCapacitance)}F`;return e}};function tgi(e){switch(e){case"three_pin":return"potentiometer3";case"two_pin":return"potentiometer2";default:return"potentiometer2"}}var ngi=class extends Xl{get config(){return{componentName:"Potentiometer",schematicSymbolName:this.props.symbolName??tgi(this.props.pinVariant),zodProps:TSt,shouldRenderAsSchematicBox:!1}}_getSchematicSymbolDisplayValue(){return`${vd(this._parsedProps.maxResistance)}Ω`}doInitialSourceRender(){let{db:e}=this.root,{_parsedProps:t}=this,n=t.pinVariant||"two_pin",o=e.source_component.insert({ftype:"simple_potentiometer",name:this.name,manufacturer_part_number:hi(t),supplier_part_numbers:t.supplierPartNumbers,max_resistance:t.maxResistance,pin_variant:n,are_pins_interchangeable:n==="two_pin",display_name:t.displayName,display_max_resistance:this._getSchematicSymbolDisplayValue()});this.source_component_id=o.source_component_id}},ogi=10,c4n=0,rgi=class extends Xl{get config(){return{schematicSymbolName:this.props.symbolName??(this.props.pinVariant==="four_pin"?"crystal_4pin":"crystal"),componentName:"Crystal",zodProps:DSt,sourceFtype:"simple_crystal"}}initPorts(){let e=this.props.pinVariant==="four_pin"?{pin1:["left1","1","X1"],pin2:["top1","2","gnd1"],pin3:["right1","3","X2"],pin4:["bottom1","4","gnd2"]}:{pin1:["pos","left","X1"],pin2:["neg","right","X2"]};super.initPorts({additionalAliases:e})}_getSchematicSymbolDisplayValue(){let e=`${vd(this._parsedProps.frequency)}Hz`;if(this._parsedProps.loadCapacitance)return`${e} / ${vd(this._parsedProps.loadCapacitance)}F`;return e}doInitialSourceRender(){let{db:e}=this.root,{_parsedProps:t}=this,n=e.source_component.insert({name:this.name,ftype:"simple_crystal",manufacturer_part_number:hi(t),supplier_part_numbers:t.supplierPartNumbers,frequency:t.frequency,load_capacitance:t.loadCapacitance,pin_variant:t.pinVariant||"two_pin",are_pins_interchangeable:(t.pinVariant||"two_pin")==="two_pin",display_name:t.displayName});this.source_component_id=n.source_component_id}doInitialSourceDesignRuleChecks(){if(super.doInitialSourceDesignRuleChecks(),!this.source_component_id)return;let{db:e}=this.root,t=this._parsedProps.maxTraceLength??ogi,n=new Set,o=new Set;for(let r of[this.portMap.X1,this.portMap.X2]){if(!r.source_port_id)continue;let i=e.source_port.get(r.source_port_id);if(!i)continue;if(n.add(r.source_port_id),i.subcircuit_connectivity_map_key)o.add(i.subcircuit_connectivity_map_key)}for(let r of e.source_trace.list()){let i=r.connected_source_port_ids.some((l)=>n.has(l)),s=r.subcircuit_connectivity_map_key!==void 0&&o.has(r.subcircuit_connectivity_map_key);if(!i&&!s)continue;let a=typeof r.max_length!=="number"||r.max_length>t,c=r.max_via_count!==c4n;if(!a&&!c)continue;e.source_trace.update(r.source_trace_id,{...a?{max_length:t}:{},...c?{max_via_count:c4n}:{}})}}},igi=class extends Xl{getSchematicSymbolName(){if(this.props.symbolName)return this.props.symbolName;if(this.props.connections?.positive_supply||this.props.connections?.negative_supply)return"opamp_with_power";return"opamp_no_power"}get config(){return{componentName:"OpAmp",schematicSymbolName:this.getSchematicSymbolName(),zodProps:yPt,sourceFtype:"simple_op_amp"}}initPorts(){let e={pin1:["non_inverting_input"],pin2:["inverting_input"]};if(this.getSchematicSymbolName()==="opamp_with_power")Object.assign(e,{pin4:["output"],pin5:["positive_supply","vcc","vdd"],pin3:["negative_supply","vee","vss","gnd"]});else Object.assign(e,{pin3:["output"],pin4:["positive_supply","vcc","vdd"],pin5:["negative_supply","vee","vss","gnd"]});super.initPorts({pinCount:5,additionalAliases:e})}doInitialSourceRender(){let{db:e}=this.root,{_parsedProps:t}=this,n=e.source_component.insert({ftype:"simple_op_amp",name:this.name,supplier_part_numbers:t.supplierPartNumbers,manufacturer_part_number:hi(t),display_name:t.displayName});this.source_component_id=n.source_component_id}doInitialSimulationRender(){let{db:e}=this.root,t=this.portMap.inverting_input,n=this.portMap.non_inverting_input,o=this.portMap.output,r=this.portMap.positive_supply,i=this.portMap.negative_supply;if(!t?.source_port_id||!n?.source_port_id||!o?.source_port_id||!r?.source_port_id||!i?.source_port_id)return;e.simulation_op_amp.insert({type:"simulation_op_amp",source_component_id:this.source_component_id,inverting_input_source_port_id:t.source_port_id,non_inverting_input_source_port_id:n.source_port_id,output_source_port_id:o.source_port_id,positive_supply_source_port_id:r.source_port_id,negative_supply_source_port_id:i.source_port_id})}inverting_input=this.portMap.inverting_input;non_inverting_input=this.portMap.non_inverting_input;output=this.portMap.output;positive_supply=this.portMap.positive_supply;negative_supply=this.portMap.negative_supply},mrt={HOLE_DIAMETER:0.5,SMT_CIRCLE_DIAMETER:1.2,SMT_RECT_SIZE:2},sgi=class extends Xl{get config(){return{componentName:"TestPoint",schematicSymbolName:this.props.symbolName??"testpoint",zodProps:BPt,sourceFtype:LP.simple_test_point}}_getPropsWithDefaults(){let{padShape:e,holeDiameter:t,footprintVariant:n,padDiameter:o,width:r,height:i}=this._parsedProps;if(!n&&t)n="through_hole";if(n??="through_hole",e??="circle",n==="pad"){if(e==="circle")o??=mrt.SMT_CIRCLE_DIAMETER;else if(e==="rect")r??=mrt.SMT_RECT_SIZE,i??=r}else if(n==="through_hole")t??=mrt.HOLE_DIAMETER;return{padShape:e,holeDiameter:t,footprintVariant:n,padDiameter:o,width:r,height:i}}_getImpliedFootprintString(){let{padShape:e,holeDiameter:t,footprintVariant:n,padDiameter:o,width:r,height:i}=this._getPropsWithDefaults();if(n==="through_hole")return`platedhole_d${t}`;if(n==="pad"){if(e==="circle")return`smtpad_circle_d${o}`;if(e==="rect")return`smtpad_rect_w${r}_h${i}`}throw Error(`Footprint variant "${n}" with pad shape "${e}" not implemented`)}doInitialSourceRender(){let{db:e}=this.root,{_parsedProps:t}=this,{padShape:n,holeDiameter:o,footprintVariant:r,padDiameter:i,width:s,height:a}=this._getPropsWithDefaults(),c=e.source_component.insert({ftype:LP.simple_test_point,name:this.name,supplier_part_numbers:t.supplierPartNumbers,manufacturer_part_number:hi(t),footprint_variant:r,pad_shape:n,pad_diameter:i,hole_diameter:o,width:s,height:a,are_pins_interchangeable:!0,display_name:t.displayName});this.source_component_id=c.source_component_id}},agi=(e)=>{if(e.root?.schematicDisabled)return;if(e.getCollapsedSchematicBoxAncestor())return;let{db:t}=e.root,n=e._getSchematicSymbolNameOrThrow(),o=zs[n];if(!o)throw Error(`No schematic symbol found for "${n}"`);let r=e._getGlobalSchematicPositionBeforeLayout(),i=e._resolveSchematicSheetId(),s=e.getSubcircuit().subcircuit_id??void 0,a=t.schematic_component.insert({center:r,size:{...o.size},is_box_with_pins:!0,symbol_name:n,source_component_id:e.source_component_id??void 0,schematic_sheet_id:i});e.schematic_component_id=a.schematic_component_id;for(let c of o.ports){let l=e.getPortForSymbolPort(c);if(!l?.source_port_id)throw Error(`Missing source port for schematic symbol port "${c.labels.join("/")}" on ${e.getString()}`);let h={x:r.x+c.x-o.center.x,y:r.y+c.y-o.center.y},d=t.schematic_port.insert({schematic_component_id:a.schematic_component_id,center:h,source_port_id:l.source_port_id,facing_direction:F4n(r,h),distance_from_component_edge:0.4,pin_number:l._parsedProps.pinNumber,display_pin_label:l._parsedProps.aliases?.[0],is_connected:!1,schematic_sheet_id:i,subcircuit_id:s});l.schematic_port_id=d.schematic_port_id}},cgi=(e,t)=>{let n=Array.isArray(t)?t:[t];if(n.length!==1)throw Error(`SchematicSymbol connection "${e}" must select exactly one physical port`);return n[0]},lgi=(e)=>{let{db:t}=e.root,{chipRef:n,connections:o}=e._parsedProps;if(n&&!o){t.source_property_ignored_warning.insert({source_component_id:e.source_component_id,property_name:"chipRef",message:`${e.getString()} has chipRef "${n}" without connections. chipRef will be ignored.`,error_type:"source_property_ignored_warning",subcircuit_id:e.getSubcircuit().subcircuit_id??void 0});return}if(o&&!n){t.source_property_ignored_warning.insert({source_component_id:e.source_component_id,property_name:"connections",message:`${e.getString()} has connections without chipRef. connections will be ignored.`,error_type:"source_property_ignored_warning",subcircuit_id:e.getSubcircuit().subcircuit_id??void 0});return}if(!n||!o)return;let r=e.getSubcircuit().selectOne(n);if(!r?.source_component_id)throw Error(`Could not resolve chipRef "${n}" for ${e.getString()}`);let i=new Set;for(let a of e.ports){let c=a.schematicSymbolPortDef,l=Object.entries(o).filter(([m])=>a.isMatchingAnyOf([m]));if(l.length===0)throw Error(`${e.getString()} is missing an explicit connection for symbol port "${c.labels.join("/")}"`);if(l.length>1)throw Error(`${e.getString()} has multiple connections for symbol port "${c.labels.join("/")}"`);let[h,d]=l[0];i.add(h);let u=cgi(h,d),_=e.getSubcircuit().selectOne(u,{type:"port"});if(!_?.source_port_id)throw Error(`Could not resolve connection "${h}" target "${u}" for ${e.getString()}`);if(t.source_port.get(_.source_port_id)?.source_component_id!==r.source_component_id)throw Error(`Connection "${h}" target "${u}" does not belong to chipRef "${n}"`);a.source_port_id=_.source_port_id,a.source_component_id=_.source_component_id}let s=Object.keys(o).filter((a)=>!i.has(a));if(s.length>0)throw Error(`${e.getString()} has connections that do not match symbol ports: ${s.join(", ")}`)},hgi=class extends lr{isSchematicPrimitive=!0;isPrimitiveContainer=!0;get config(){return{componentName:"SchematicSymbol",schematicSymbolName:this.props.symbolName,zodProps:XPt}}initPorts(){let e=zs[this._getSchematicSymbolNameOrThrow()],t=!(this._parsedProps.chipRef&&this._parsedProps.connections);for(let n of e.ports){let o=D8e(n.labels);if(!o)throw Error(`Schematic symbol port must have a numeric pin label: ${n.labels.join("/")}`);let r=this.ports.find((a)=>a._parsedProps.pinNumber===o);if(r){r.schematicSymbolPortDef=n;continue}let i=n.labels.filter((a)=>a!==o.toString()&&a!==`pin${o}`),s=new sd({pinNumber:o,aliases:i},{shouldCreateSourcePort:t});s.schematicSymbolPortDef=n,this.add(s)}}doInitialInitializePortsFromChildren(){this.initPorts()}updateInitializePortsFromChildren(){this.initPorts()}get ports(){return this.children.filter((e)=>e instanceof sd)}getPortForSymbolPort(e){return this.ports.find((t)=>t.schematicSymbolPortDef===e)??null}doInitialSourceRender(){let e=this.root.db.source_component.insert({ftype:"simple_chip",name:this.name,display_name:this._parsedProps.displayName,are_pins_interchangeable:!1});this.source_component_id=e.source_component_id}doInitialPortMatching(){lgi(this)}doInitialSchematicComponentRender(){agi(this)}},dgi=class e extends lr{isSchematicPrimitive=!0;get config(){return{componentName:"SchematicSection",zodProps:nEt}}_computeSectionBounds(t,n,o){let{db:r}=this.root,i=t.getDescendants().filter((a)=>a.getSchematicSectionName()===n);if(i.length===0)return null;let s=[];for(let a of i){let c=a.schematic_component_id;if(!c)continue;let l=r.schematic_component.get(c);if(!l)continue;if(l.schematic_sheet_id!==o)continue;let h=l.size.width/2,d=l.size.height/2;s.push({minX:l.center.x-h,maxX:l.center.x+h,minY:l.center.y-d,maxY:l.center.y+d});for(let u of r.schematic_text.list({schematic_component_id:c}))s.push(YSn({text:u.text,position:u.position,anchor:u.anchor,fontSize:u.font_size}))}if(s.length===0)return null;return pIe(s)}doInitialSchematicSectionRender(){if(this.root?.schematicDisabled)return;let t=this.root?._getBoard();if(!t)return;let n=this._resolveSchematicSheetId(),o=t.getDescendants().filter((g)=>g instanceof e&&g._resolveSchematicSheetId()===n);if(o[0]!==this)return;let{db:r}=this.root,i=0.5,s=0.2,a=0.02,c=0.001,l=o.map((g)=>{let f=g._computeSectionBounds(t,g._parsedProps.name,n);if(!f)return null;return{displayName:g._parsedProps.displayName,sectionTitleFontSize:g._parsedProps.sectionTitleFontSize,rawBounds:f,cell:{minX:f.minX-i,maxX:f.maxX+i,minY:f.minY-i,maxY:f.maxY+i}}}).filter((g)=>g!==null),h=this._computeSectionBounds(t,null,n),d=[...l];if(h)d.push({displayName:void 0,sectionTitleFontSize:void 0,rawBounds:h,cell:{minX:h.minX-i,maxX:h.maxX+i,minY:h.minY-i,maxY:h.maxY+i}});if(d.length===0)return;let u=d.map((g)=>g.cell),_=pIe(u),p=zpn(d.map((g)=>g.rawBounds),{cellMargin:1});for(let g of p)r.schematic_line.insert({x1:g.start.x,y1:g.start.y,x2:g.end.x,y2:g.end.y,stroke_width:a,color:"#000000",is_dashed:!0,schematic_sheet_id:n});let m=p.filter((g)=>Math.abs(g.start.y-g.end.y)<c),A=p.filter((g)=>Math.abs(g.start.x-g.end.x)<c);for(let g of d){let{displayName:f,sectionTitleFontSize:y,rawBounds:x,cell:C}=g;if(!f)continue;let b=d.some((T)=>T!==g&&qp(T.rawBounds,x)),I=m.map((T)=>T.start.y).filter((T)=>T>x.maxY),v=I.length>0?Math.min(...I):_.maxY,P=A.map((T)=>T.start.x).filter((T)=>T<x.minX),M=_.minX;if(b)M=C.minX;if(P.length>0)M=Math.max(...P);let B=y??0.18;r.schematic_text.insert({anchor:"top_left",text:f,font_size:B,color:"#000000",position:{x:M+s,y:Math.max(v-s,x.maxY+s+B)},rotation:0,schematic_sheet_id:n})}}},ugi=(e)=>Sfe.parse(e.toLowerCase()),pgi={a4:{width:297,height:210},ansi_b:{width:431.8,height:279.4}},_rt=({sheetSize:e,sheetWidth:t,sheetHeight:n})=>{let o=ugi(e),r=pgi[o];return{sheetSize:o,sheetWidth:t??r.width,sheetHeight:n??r.height}},Cst=9.236363636363636,tve=5/Cst,nve=0.000001,mgi=(e)=>{switch(e.type){case"schematic_component":return e.schematic_component_id;case"schematic_net_label":return e.schematic_net_label_id;case"schematic_trace":return e.schematic_trace_id}},l4n=({db:e,schematicSheetId:t,schematicSheetName:n,schematicSheetCenter:o,sheetWidth:r,sheetHeight:i})=>{let s=r/Cst,a=i/Cst,c={minX:o.x-s/2+tve,maxX:o.x+s/2-tve,minY:o.y-a/2+tve,maxY:o.y+a/2-tve},l=[...e.schematic_component.list(),...e.schematic_net_label.list(),...e.schematic_trace.list()].filter((h)=>h.schematic_sheet_id===t);for(let h of l){let d=$9t(h);if(!d)continue;if(!(d.minX<c.minX-nve||d.maxX>c.maxX+nve||d.minY<c.minY-nve||d.maxY>c.maxY+nve))continue;let _=mgi(h);e.schematic_element_outside_sheet_warning.insert({warning_type:"schematic_element_outside_sheet_warning",message:`${h.type} ${_} extends outside the drawing area of schematic sheet "${n}"`,schematic_sheet_id:t,schematic_element_type:h.type,schematic_element_id:_})}},_gi=class extends lr{isSchematicPrimitive=!0;resolvedSchematicSheetDisplayName="Schematic Sheet";get config(){return{componentName:"SchematicSheet",zodProps:oEt}}doInitialSourceGroupRender(){if(this.root?.schematicDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,n=new Set(this.root.children.flatMap((d)=>[d,...d.getDescendants()]).filter((d)=>d.componentName==="SchematicSheet").map((d)=>d._parsedProps.sheetIndex).filter((d)=>d!==void 0)),o=new Set([...n,...e.schematic_sheet.list().map((d)=>d.sheet_index).filter((d)=>d!==void 0)]),r=0;while(o.has(r))r+=1;let i=t.sheetIndex??r,s=t.name??t.displayName??`Sheet ${i+1}`,a=t.displayName??s;this.resolvedSchematicSheetDisplayName=a;let c=_rt(t),l=e.schematic_sheet.insert({name:s,display_name:a,sheet_index:i,sheet_size:c.sheetSize,sheet_width:c.sheetWidth,sheet_height:c.sheetHeight,subcircuit_id:this.getSubcircuit().subcircuit_id??void 0});this.schematic_sheet_id=l.schematic_sheet_id;let h=_rt({sheetSize:"A4"});if(c.sheetSize!==h.sheetSize||c.sheetWidth!==h.sheetWidth||c.sheetHeight!==h.sheetHeight)e.schematic_sheet_styling_warning.insert({warning_type:"schematic_sheet_styling_warning",styling_issue_type:"non_default_sheet_size",schematic_sheet_id:this.schematic_sheet_id,subcircuit_id:l.subcircuit_id,message:`Schematic sheet "${a}" uses a non-default size (${c.sheetWidth} × ${c.sheetHeight} mm). Prefer the default A4 sheet size (297 × 210 mm) for consistent schematic styling.`})}doInitialSchematicSheetRender(){if(this.root?.schematicDisabled)return;if(!this.schematic_sheet_id)return;let{db:e}=this.root,t=_rt(this._parsedProps);if(this._parsedProps.sheetWidth!==void 0||this._parsedProps.sheetHeight!==void 0){l4n({db:e,schematicSheetId:this.schematic_sheet_id,schematicSheetName:this.resolvedSchematicSheetDisplayName,schematicSheetCenter:{x:0,y:0},sheetWidth:t.sheetWidth,sheetHeight:t.sheetHeight});return}let o=[...e.schematic_component.list(),...e.schematic_port.list(),...e.schematic_text.list(),...e.schematic_line.list(),...e.schematic_rect.list(),...e.schematic_circle.list(),...e.schematic_arc.list(),...e.schematic_path.list()].filter((i)=>i.schematic_sheet_id===this.schematic_sheet_id),r={x:0,y:0};if(o.length>0){let i=Uue(o);if(Number.isFinite(i.minX)&&Number.isFinite(i.maxX)&&Number.isFinite(i.minY)&&Number.isFinite(i.maxY))r={x:(i.minX+i.maxX)/2,y:(i.minY+i.maxY)/2},e.schematic_sheet.update(this.schematic_sheet_id,{center:r})}l4n({db:e,schematicSheetId:this.schematic_sheet_id,schematicSheetName:this.resolvedSchematicSheetDisplayName,schematicSheetCenter:r,sheetWidth:t.sheetWidth,sheetHeight:t.sheetHeight})}},ggi=class extends lr{isSchematicPrimitive=!0;schematic_graphic_id;get config(){return{componentName:"SchematicGraphic",zodProps:rEt}}doInitialSchematicPrimitiveRender(){if(this.root?.schematicDisabled)return;if(this.getCollapsedSchematicBoxAncestor())return;let{db:e}=this.root,{imageUrl:t,svgContent:n,width:o,height:r}=this._parsedProps;if(t!==void 0){this._queueAsyncEffect("SchematicGraphicRender",async()=>{if(this.root?.schematicDisabled)return;let i=await R3n(t,this.root?.platform),s=await $6e(i).catch((h)=>{if(n===void 0||i.startsWith("data:"))throw h;return null});if(s===null){let h={project_relative_path:t.startsWith("data:")?"inline":t,url:i,mimetype:dv},d=this.root.db.schematic_graphic.insert({asset:h,schematic_sheet_id:this._resolveSchematicSheetId(),svg_content:n,...o===void 0?{}:{width:o},...r===void 0?{}:{height:r}});this.schematic_graphic_id=d.schematic_graphic_id;return}if(s.mimetype!==dv)throw Error(`Unsupported imageUrl for SchematicGraphic: "${t}". Expected an SVG image.`);let a={project_relative_path:t.startsWith("data:")?s.projectRelativePath:t,url:s.dataUrl,mimetype:s.mimetype},c=s.dataUrl.startsWith("data:")?n:s.text,l=this.root.db.schematic_graphic.insert({asset:a,schematic_sheet_id:this._resolveSchematicSheetId(),...c===void 0?{}:{svg_content:c},...o===void 0?{}:{width:o},...r===void 0?{}:{height:r}});this.schematic_graphic_id=l.schematic_graphic_id});return}if(n!==void 0){let i={project_relative_path:"inline",url:`data:image/svg+xml,${encodeURIComponent(n)}`,mimetype:dv},s=e.schematic_graphic.insert({asset:i,schematic_sheet_id:this._resolveSchematicSheetId(),...o===void 0?{}:{width:o},...r===void 0?{}:{height:r}});this.schematic_graphic_id=s.schematic_graphic_id}}},Agi=class extends lr{isSchematicPrimitive=!0;schematic_table_id=null;get config(){return{componentName:"SchematicTable",zodProps:ZPt}}doInitialSchematicPrimitiveRender(){if(this.root?.schematicDisabled)return;if(this.getCollapsedSchematicBoxAncestor())return;let{db:e}=this.root,{_parsedProps:t}=this,n=this.children.filter((d)=>d.componentName==="SchematicRow");if(n.length===0)return;let o=[],r=0;for(let d of n){let u=d.children.filter((_)=>_.componentName==="SchematicCell");r=Math.max(r,u.length)}for(let d=0;d<n.length;d++)o[d]=[];for(let d=0;d<n.length;d++){let _=n[d].children.filter((m)=>m.componentName==="SchematicCell"),p=0;for(let m=0;m<_.length;m++){while(o[d][p])p++;let A=_[m],g=A._parsedProps.colSpan??1,f=A._parsedProps.rowSpan??1;for(let y=0;y<f;y++)for(let x=0;x<g;x++){if(!o[d+y])o[d+y]=[];o[d+y][p+x]=A}p+=g}}r=Math.max(0,...o.map((d)=>d.length));let i=n.map((d,u)=>d._parsedProps.height??1),s=Array.from({length:r},(d,u)=>{let _=0;for(let p=0;p<n.length;p++){let m=o[p]?.[u];if(m){let A=m._parsedProps.text??m._parsedProps.children,g=m._parsedProps.width??(A?.length??2)*0.5;if(g>_)_=g}}return _||10}),a=this._getGlobalSchematicPositionBeforeLayout(),c=e.schematic_table.insert({anchor_position:a,column_widths:s,row_heights:i,cell_padding:t.cellPadding,border_width:t.borderWidth,anchor:t.anchor,subcircuit_id:this.getSubcircuit()?.subcircuit_id||"",schematic_component_id:this.parent?.schematic_component_id||"",schematic_sheet_id:this._resolveSchematicSheetId()});this.schematic_table_id=c.schematic_table_id;let l=new Set,h=0;for(let d=0;d<n.length;d++){let u=0;for(let _=0;_<r;_++){let p=o[d]?.[_];if(p&&!l.has(p)){l.add(p);let m=p._parsedProps,A=m.rowSpan??1,g=m.colSpan??1,f=0;for(let x=0;x<g;x++)f+=s[_+x];let y=0;for(let x=0;x<A;x++)y+=i[d+x];e.schematic_table_cell.insert({schematic_table_id:this.schematic_table_id,start_row_index:d,end_row_index:d+A-1,start_column_index:_,end_column_index:_+g-1,text:m.text??m.children,center:{x:a.x+u+f/2,y:a.y-h-y/2},width:f,height:y,horizontal_align:m.horizontalAlign,vertical_align:m.verticalAlign,font_size:m.fontSize??t.fontSize,subcircuit_id:this.getSubcircuit()?.subcircuit_id||""})}if(s[_])u+=s[_]}h+=i[d]}}};var fgi=class extends lr{isSchematicPrimitive=!0;get config(){return{componentName:"SchematicRow",zodProps:eEt}}},ygi=class extends lr{isSchematicPrimitive=!0;canHaveTextChildren=!0;get config(){return{componentName:"SchematicCell",zodProps:tEt}}},xgi=class extends lr{simulation_experiment_id=null;get config(){return{componentName:"AnalogSimulation",zodProps:sPt}}getSpiceEngineName(){return this._parsedProps.spiceEngine}usesIndependentGraphAxes(){return this._parsedProps.graphIndependentAxes===!0}doInitialSimulationRender(){let{db:e}=this.root,{duration:t,name:n,startTime:o,timePerStep:r,spiceOptions:i}=this._parsedProps,s=t||10,a=r||0.01,c=e.simulation_experiment.insert({name:n??"spice_transient_analysis",experiment_type:"spice_transient_analysis",end_time_ms:s,start_time_ms:o,time_per_step:a,spice_options:i});this.simulation_experiment_id=c.simulation_experiment_id}},nee=class extends lr{simulation_experiment_id=null;getSpiceEngineName(){return typeof this.props.spiceEngine==="string"?this.props.spiceEngine:void 0}usesIndependentGraphAxes(){return this.props.graphIndependentAxes===!0}getOrCreateSimulationExperiment(){if(this.simulation_experiment_id)return this.root?.db.simulation_experiment.get(this.simulation_experiment_id)??null;if(this.children.filter((n)=>n.componentName==="AnalogSweepParameter").length>1)return this.renderError("An analog simulation can contain at most one sweep parameter."),null;let t=this.insertSimulationExperiment();return this.simulation_experiment_id=t?.simulation_experiment_id??null,t}doInitialSimulationRender(){this.getOrCreateSimulationExperiment()}},Cgi=class extends nee{get config(){return{componentName:"AnalogTransientSimulation",zodProps:aPt}}insertSimulationExperiment(){let{db:e}=this.root,{duration:t,name:n,startTime:o,timePerStep:r,spiceOptions:i}=this._parsedProps;return e.simulation_experiment.insert({name:n??"spice_transient_analysis",experiment_type:"spice_transient_analysis",end_time_ms:t,start_time_ms:o,time_per_step:r,spice_options:i})}},bgi=class extends nee{get config(){return{componentName:"AnalogDcOperatingPointSimulation",zodProps:cPt}}insertSimulationExperiment(){let{name:e,spiceOptions:t}=this._parsedProps;return this.root.db.simulation_experiment.insert({name:e??"spice_dc_operating_point",experiment_type:"spice_dc_operating_point",spice_options:t})}},Igi=class extends nee{get config(){return{componentName:"AnalogDcSweepSimulation",zodProps:lPt}}insertSimulationExperiment(){let{name:e,spiceOptions:t,sweepSource:n,sweepStart:o,sweepStop:r,sweepStep:i}=this._parsedProps,a=(this.getGroup()??this.getSubcircuit())?.selectOne(n),c;if(a instanceof FPn){a.runRenderPhase("SimulationRender");let l=a.simulation_voltage_source_id;if(!l)return this.renderError(`DC sweep source "${n}" must resolve to one voltage or current source.`),null;c={dc_sweep_voltage_source_id:l,dc_sweep_unit:"V"}}else if(a instanceof zPn){a.runRenderPhase("SimulationRender");let l=a.simulation_current_source_id;if(!l)return this.renderError(`DC sweep source "${n}" must resolve to one voltage or current source.`),null;c={dc_sweep_current_source_id:l,dc_sweep_unit:"A"}}else return this.renderError(`DC sweep source "${n}" must resolve to one voltage or current source.`),null;return this.root.db.simulation_experiment.insert({name:e??"spice_dc_sweep",experiment_type:"spice_dc_sweep",spice_options:t,...c,dc_sweep_start:o,dc_sweep_stop:r,dc_sweep_step:i})}},vgi=class extends nee{get config(){return{componentName:"AnalogAcSweepSimulation",zodProps:hPt}}insertSimulationExperiment(){let{name:e,spiceOptions:t,sweepType:n,samplesPerInterval:o,sampleCount:r,startFrequency:i,stopFrequency:s}=this._parsedProps;return this.root.db.simulation_experiment.insert({name:e??"spice_ac_analysis",experiment_type:"spice_ac_analysis",spice_options:t,ac_sweep_type:n,ac_samples_per_interval:o,ac_sample_count:r,ac_start_frequency_hz:i,ac_stop_frequency_hz:s})}},Sgi={resistance:"Ω",capacitance:"F",inductance:"H",voltage:"V",current:"A"},Pgi=({parameterSweepCoordinate:e,stop:t,step:n})=>{let o=Math.abs(n)*0.000000001;return n>0?e<=t+o:e>=t-o},Egi=({start:e,stop:t,step:n})=>{let o=[];for(let r=e;Pgi({parameterSweepCoordinate:r,stop:t,step:n});r=e+o.length*n)if(o.push(r),o.length>1e6)throw Error("Parameter sweep exceeds 1,000,000 points");return o},Mgi=(e)=>{if(e.parameterType==="resistance")return e.resistorRef;if(e.parameterType==="capacitance")return e.capacitorRef;if(e.parameterType==="inductance")return e.inductorRef;if(e.parameterType==="voltage")return e.net;return e.currentSourceRef},wgi=(e)=>{if(!(e.parent instanceof nee)){e.renderError("analog.sweepparameter must be nested directly in an analog simulation.");return}let t=e.parent.getOrCreateSimulationExperiment();if(!t)return;let n=e._parsedProps,o=n.values??Egi({start:n.start,stop:n.stop,step:n.step}),r=e.parent.getGroup()??e.parent.getSubcircuit(),i=Mgi(n),s=Sgi[n.parameterType],a=e.root.db.simulation_parameter_sweep,c={simulation_experiment_id:t.simulation_experiment_id,name:n.name,parameter_type:n.parameterType,parameter_values:o,parameter_unit:s},l;if(n.parameterType==="voltage"){let h=r?.selectOne(i,{type:"net"});if(!h?.source_net_id){e.renderError(`Voltage sweep net "${i}" could not be resolved.`);return}l=a.insert({...c,parameter_type:"voltage",source_net_id:h.source_net_id}).simulation_parameter_sweep_id}else{let d=r?.selectOne(i)?.source_component_id;if(!d){e.renderError(`Parameter sweep target "${i}" could not be resolved.`);return}if(n.parameterType==="resistance")l=a.insert({...c,parameter_type:"resistance",resistor_source_component_id:d}).simulation_parameter_sweep_id;else if(n.parameterType==="capacitance")l=a.insert({...c,parameter_type:"capacitance",capacitor_source_component_id:d}).simulation_parameter_sweep_id;else if(n.parameterType==="inductance")l=a.insert({...c,parameter_type:"inductance",inductor_source_component_id:d}).simulation_parameter_sweep_id;else l=a.insert({...c,parameter_type:"current",current_source_component_id:d}).simulation_parameter_sweep_id}e.simulation_parameter_sweep_id=l},Bgi=class extends lr{simulation_parameter_sweep_id=null;get config(){return{componentName:"AnalogSweepParameter",zodProps:mPt}}doInitialSimulationRender(){wgi(this)}},Tgi=class extends lr{simulation_experiment_id=null;get config(){return{componentName:"PcbReturnCurrentSimulation",zodProps:pPt}}doInitialSimulationRender(){if(this.root?.pcbDisabled)return;if(this.parent?.componentName==="PcbReturnCurrentSimulation")this.renderError("A PCB return-current simulation cannot contain another simulation.");if(this.children.some((t)=>t.componentName!=="PcbReturnCurrentExcitation"))this.renderError("A PCB return-current simulation can contain only return-current excitations.");let e=this.root.db.simulation_experiment.insert({name:this._parsedProps.name??"PCB return current",experiment_type:"pcb_return_current"});this.simulation_experiment_id=e.simulation_experiment_id}updateSimulationRender(){if(!this.simulation_experiment_id)return;this.root.db.simulation_experiment.update(this.simulation_experiment_id,{name:this._parsedProps.name??"PCB return current"})}removeSimulationRender(){if(!this.simulation_experiment_id)return;this.root.db.simulation_experiment.delete(this.simulation_experiment_id),this.simulation_experiment_id=null}},h4n=0.000001;function Dgi(e){if(e.root?.pcbDisabled)return;let{db:t}=e.root,{_parsedProps:n,parent:o}=e;if(o?.componentName!=="PcbReturnCurrentSimulation"){e.renderError("A PCB return-current excitation must be directly inside a PCB return-current simulation.");return}if(!o.simulation_experiment_id){e.renderError("The PCB return-current simulation has not been declared.");return}let r=e.getSubcircuit(),i=(C,b)=>{let I=r.selectAll(C).filter((B)=>B.componentName==="Port");if(I.length!==1)e.renderError(`${b} selector "${C}" must identify exactly one physical PCB port.`);let v=I[0],P=v?.pcb_port_id?t.pcb_port.get(v.pcb_port_id):null,M=P&&(t.pcb_smtpad.list({pcb_port_id:P.pcb_port_id}).length>0||t.pcb_plated_hole.list({pcb_port_id:P.pcb_port_id}).length>0);if(!P||!M)e.renderError(`${b} selector "${C}" needs a physical PCB pad or plated-hole port.`);return P},s=i(n.source,"Signal source"),a=i(n.load,"Signal load"),c=i(n.returnSource,"Return source (load-side ground)"),l=i(n.returnSink,"Return sink (driver-side ground)");if(new Set([s.pcb_port_id,a.pcb_port_id,c.pcb_port_id,l.pcb_port_id]).size!==4)e.renderError("Signal source, signal load, return source and return sink must be four distinct physical PCB ports.");let h=r.selectAll(n.ground.startsWith("net.")?"net":n.ground).filter((C)=>C.componentName==="Net"&&(!n.ground.startsWith("net.")||C.getPortSelector()===n.ground));if(h.length!==1||!h[0].source_net_id)e.renderError(`Ground selector "${n.ground}" must identify exactly one source net.`);let d=t.source_net.get(h[0].source_net_id),u=d.subcircuit_connectivity_map_key;for(let[C,b]of[[s,n.source],[a,n.load]])if(u&&t.source_port.get(C.source_port_id)?.subcircuit_connectivity_map_key===u)e.renderError(`Signal terminal "${b}" is electrically connected to ground net "${d.name}".`);for(let[C,b]of[[c,n.returnSource],[l,n.returnSink]]){let I=t.source_port.get(C.source_port_id);if(!u||I?.subcircuit_connectivity_map_key!==u)e.renderError(`Return contact "${b}" is not electrically connected to ground net "${d.name}".`)}let _=(C,b,I,v)=>{let P=[...new Set(C.layers)];if(!I&&P.length!==1)e.renderError(`${v} "${b}" spans multiple layers; specify ${v==="Return source"?"returnSourceLayer":"returnSinkLayer"}.`);let M=I??P[0];if(!P.includes(M))e.renderError(`${v} "${b}" has no physical port on layer "${M}".`);return{contact_type:"pcb_port",pcb_port_id:C.pcb_port_id,x:C.x,y:C.y,layer:M}},p=_(c,n.returnSource,n.returnSourceLayer,"Return source"),m=_(l,n.returnSink,n.returnSinkLayer,"Return sink");for(let[C,b]of[[s,m],[a,p]])if(Math.hypot(C.x-b.x,C.y-b.y)<=h4n&&C.layers.includes(b.layer))e.renderError("A signal terminal and its ground reference must occupy different physical PCB locations on the same layer.");let A;if(n.trace){let C=r.selectAll(n.trace).filter((b)=>b.componentName==="Trace");if(C.length!==1||!C[0].source_trace_id)e.renderError(`Trace selector "${n.trace}" must identify exactly one routed source trace.`);A=C[0].source_trace_id}let g=(C,b,I)=>C?.route_type==="wire"&&Math.hypot(C.x-b.x,C.y-b.y)<=h4n&&b.layers.includes(C.layer)&&(!C[`${I}_pcb_port_id`]||C[`${I}_pcb_port_id`]===b.pcb_port_id),f=t.pcb_trace.list().filter((C)=>{if(C.subcircuit_id!==r.subcircuit_id)return!1;if(A&&C.source_trace_id!==A)return!1;let b=C.source_trace_id?t.source_trace.get(C.source_trace_id):null;if(!b||b.connected_source_port_ids.length!==2||!b.connected_source_port_ids.includes(s.source_port_id)||!b.connected_source_port_ids.includes(a.source_port_id))return!1;let I=C.route[0],v=C.route.at(-1);return g(I,s,"start")&&g(v,a,"end")||g(I,a,"start")&&g(v,s,"end")});if(f.length!==1)e.renderError(`The connection from "${n.source}" to "${n.load}" must have exactly one complete routed PCB trace${n.trace?` selected by "${n.trace}"`:"; use trace to disambiguate multiple routes"}. Split or branched routes are not supported.`);let y=t.simulation_return_current_excitation.list({simulation_experiment_id:o.simulation_experiment_id});if(y.some((C)=>C.pcb_trace_id===f[0].pcb_trace_id))e.renderError("A PCB return-current simulation can excite each signal trace only once. Use separate experiments to compare different currents or directions.");if(y.some((C)=>C.ground_source_net_id!==d.source_net_id))e.renderError("All excitations in a PCB return-current simulation must use the same ground net. Use separate experiments for different ground nets.");let x=t.simulation_return_current_excitation.insert({simulation_experiment_id:o.simulation_experiment_id,pcb_trace_id:f[0].pcb_trace_id,ground_source_net_id:d.source_net_id,current:n.current,return_source:p,return_sink:m,source_port:{signal_pcb_port_id:s.pcb_port_id,reference_pcb_port_id:l.pcb_port_id,reference_layer:m.layer,resistance:n.sourceImpedance},load_port:{signal_pcb_port_id:a.pcb_port_id,reference_pcb_port_id:c.pcb_port_id,reference_layer:p.layer,resistance:n.loadImpedance}});e.simulation_return_current_excitation_id=x.simulation_return_current_excitation_id}var Ngi=class extends lr{simulation_return_current_excitation_id=null;get config(){return{componentName:"PcbReturnCurrentExcitation",zodProps:uPt}}doInitialPcbSimulationRender(){Dgi(this)}updatePcbSimulationRender(){this.removePcbSimulationRender(),this.doInitialPcbSimulationRender()}removePcbSimulationRender(){if(!this.simulation_return_current_excitation_id)return;this.root.db.simulation_return_current_excitation.delete(this.simulation_return_current_excitation_id),this.simulation_return_current_excitation_id=null}};function Rgi(e,t,n,o=0.3){let i=Math.max(t.length*0.1,0.3),s=0.25,a=0.45,{x:c,y:l}=e,h=o+i/2;if(n.includes("top"))l+=h;else if(n.includes("bottom"))l-=h;if(n.includes("right"))c+=h;else if(n.includes("left"))c-=h;let d,u,_,p;if(n.includes("left"))d=c,u=c+i;else if(n.includes("right"))d=c-i,u=c;else d=c-i/2,u=c+i/2;if(n.includes("top"))_=l-0.45,p=l;else if(n.includes("bottom"))_=l,p=l+0.45;else _=l-0.225,p=l+0.225;return{minX:d,maxX:u,minY:_,maxY:p}}function Qgi(e){let t,n,o,r;if(e.type==="schematic_component")t=e.center?.x,n=e.center?.y,o=e.size?.width,r=e.size?.height;else if(e.type==="schematic_text")t=e.position?.x,n=e.position?.y,o=(e.text?.length??0)*0.1,r=0.2;else return null;if(typeof t==="number"&&typeof n==="number"&&typeof o==="number"&&typeof r==="number")return{minX:t-o/2,maxX:t+o/2,minY:n-r/2,maxY:n+r/2};return null}function kgi(e,t){if(!qp(e,t))return 0;let n=Math.min(e.maxX,t.maxX)-Math.max(e.minX,t.minX),o=Math.min(e.maxY,t.maxY)-Math.max(e.minY,t.minY);return n*o}function Lgi({probePosition:e,labelText:t,schematicElements:n,defaultAlignment:o="top_right"}){let i=[o,...["top_right","top_left","bottom_right","bottom_left","top_center","bottom_center","center_right","center_left"].filter((c)=>c!==o)],s=o,a=1/0;for(let c of i){let l=Rgi(e,t,c),h=0;for(let d of n){let u=Qgi(d);if(u)h+=kgi(l,u)}if(h===0)return c;if(h<a)a=h,s=c}return s}var Hgi=class extends lr{simulation_voltage_probe_id=null;schematic_voltage_probe_id=null;finalProbeName=null;color=null;get config(){return{componentName:"VoltageProbe",zodProps:YPt}}doInitialSimulationRender(){let{db:e}=this.root,{connectsTo:t,name:n,referenceTo:o,color:r,graphDisplayName:i,graphCenter:s,graphVerticalOffset:a,graphVoltagePerDiv:c}=this._parsedProps,l=this.getSubcircuit();if(!l){this.renderError("VoltageProbe must be inside a subcircuit");return}let h=Array.isArray(t)?t:[t];if(h.length!==1){this.renderError("VoltageProbe must connect to exactly one port or net");return}let d=h[0],u=l.selectOne(d,{type:"port"}),_=!u?l.selectOne(d,{type:"net"}):null;if(_&&_.componentName!=="Net"){this.renderError(`VoltageProbe connection target "${d}" resolved to a non-net component "${_.componentName}".`);return}if(!u&&!_){this.renderError(`VoltageProbe could not find connection target "${d}"`);return}let p=u?.source_port_id??_?.source_net_id;if(!p){this.renderError("Could not identify connected source for VoltageProbe");return}let m=null,A=null;if(o){let x=Array.isArray(o)?o:[o];if(x.length!==1){this.renderError("VoltageProbe must reference exactly one port or net");return}let C=x[0];if(m=l.selectOne(C,{type:"port"}),A=!m?l.selectOne(C,{type:"net"}):null,A&&A.componentName!=="Net"){this.renderError(`VoltageProbe reference target "${C}" resolved to a non-net component "${A.componentName}".`);return}if(!m&&!A){this.renderError(`VoltageProbe could not find reference target "${C}"`);return}}this.color=r??a0i(p);let g=n;if(!g)g=h[0].split(" > ").map((x)=>x.replace(/^\./,"")).join(".");this.finalProbeName=g??null;let{simulation_voltage_probe_id:f}=e.simulation_voltage_probe.insert({name:g,signal_input_source_port_id:u?.source_port_id??void 0,signal_input_source_net_id:_?.source_net_id??void 0,reference_input_source_port_id:m?.source_port_id??void 0,reference_input_source_net_id:A?.source_net_id??void 0,subcircuit_id:l.subcircuit_id||void 0,color:this.color});if(this.simulation_voltage_probe_id=f,i!==void 0||s!==void 0||a!==void 0||c!==void 0){let x=xL(c),C=xL(a);e.simulation_oscilloscope_trace.insert({simulation_voltage_probe_id:f,display_name:i,color:r??void 0,display_center_value:s,volts_per_div:x,display_center_offset_divs:C!==void 0&&x!==void 0&&x!==0?C/x:void 0})}}doInitialSchematicReplaceNetLabelsWithSymbols(){if(this.root?.schematicDisabled)return;let{db:e}=this.root,{connectsTo:t,name:n}=this._parsedProps,o=this.getSubcircuit();if(!o)return;let r=Array.isArray(t)?t:[t];if(r.length!==1)return;let i=r[0],s=o.selectOne(i,{type:"port"});if(!s)return;if(!s.schematic_port_id)return;let a=s._getGlobalSchematicPositionAfterLayout(),c=null;for(let u of e.schematic_trace.list()){for(let _ of u.edges)if(Math.abs(_.from.x-a.x)<0.000001&&Math.abs(_.from.y-a.y)<0.000001||Math.abs(_.to.x-a.x)<0.000001&&Math.abs(_.to.y-a.y)<0.000001){c=u.schematic_trace_id;break}if(c)break}if(!c)return;let l=this.finalProbeName,h=Lgi({probePosition:a,labelText:l,schematicElements:[...e.schematic_component.list(),...e.schematic_text.list()],defaultAlignment:"top_right"}),d=e.schematic_voltage_probe.insert({name:l,position:a,schematic_trace_id:c,subcircuit_id:o.subcircuit_id||void 0,color:this.color??void 0,label_alignment:h});this.schematic_voltage_probe_id=d.schematic_voltage_probe_id}},Fgi=class extends lr{get config(){return{componentName:"SpiceModel",zodProps:gPt}}doInitialSimulationRender(){if(this.getInheritedProperty("analogSimulationDisabled"))return;let e=this.parent;if(!e)return;let t=e.source_component_id;if(!t){this._insertSpiceModelError("spicemodel must be attached to a source component.",this._parsedProps);return}let{source:n,spicePinMapping:o}=this._parsedProps,r=Rhn(n).subckts[0]??null,i=r?.pins.map((l)=>l.name);if(!r||!i||i.length===0){this._insertSpiceModelError("spicemodel source must contain a .subckt declaration with a model name and pins.",n);return}let s=o??{};for(let l of Object.keys(s))if(!i.includes(l)){this._insertSpiceModelError(`spicePinMapping references SPICE pin "${l}", but it is not present in .subckt ${r.name}.`,s);return}let a={},c=new Set;for(let l of i){let h=s[l]??l,d=e.selectAll("port").filter((_)=>_ instanceof sd&&_.isMatchingAnyOf([h]));if(d.length!==1||!d[0].source_port_id){this._insertSpiceModelError(`Could not resolve SPICE pin "${l}" to exactly one component port using "${h}".`,s);return}let u=d[0].source_port_id;if(c.has(u)){this._insertSpiceModelError(`spicePinMapping maps more than one SPICE pin to component port "${h}".`,s);return}c.add(u),a[l]=u}this.root.db.simulation_spice_subcircuit.insert({source_component_id:t,spice_pin_to_source_port_map:a,subcircuit_source:n})}_insertSpiceModelError(e,t){this.root.db.source_invalid_component_property_error.insert({source_component_id:this.parent?.source_component_id||"",property_name:"spiceModel",property_value:t,message:e,error_type:"source_invalid_component_property_error"})}};function sEn(e){let t=e._getBoard()?.pcb_board_id,n=t?e.root.db.pcb_board.get(t):null;if(!n)throw Error(`${e.componentName} must be inside a board`);let o=Hi(Ii(-n.center.x,-n.center.y),e._computePcbGlobalTransformBeforeLayout());return{board:n,transform:o}}var zgi=class extends lr{pcb_bend_id=null;tearReliefCutoutIds=[];get config(){return{componentName:"PcbBend",zodProps:_St}}doInitialPcbFlexRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,t=this._parsedProps,{board:n,transform:o}=sEn(this),r=e.pcb_bend.insert({pcb_board_id:n.pcb_board_id,pcb_group_id:this.getGroup()?.pcb_group_id??void 0,subcircuit_id:this.getSubcircuit().subcircuit_id??void 0,name:t.name,start:_o(o,{x:t.x1,y:t.y1}),end:_o(o,{x:t.x2,y:t.y2}),bend_angle:t.bendAngle,bend_radius:t.bendRadius,bend_side:t.bendSide});if(this.pcb_bend_id=r.pcb_bend_id,t.tearReliefRadius!==void 0)for(let i of[r.start,r.end]){let s=e.pcb_cutout.insert({shape:"circle",center:{x:i.x+n.center.x,y:i.y+n.center.y},radius:t.tearReliefRadius,pcb_board_id:n.pcb_board_id,pcb_group_id:r.pcb_group_id,subcircuit_id:r.subcircuit_id});this.tearReliefCutoutIds.push(s.pcb_cutout_id)}}removePcbFlexRender(){for(let e of this.tearReliefCutoutIds)this.root.db.pcb_cutout.delete(e);if(this.tearReliefCutoutIds=[],!this.pcb_bend_id)return;this.root.db.pcb_bend.delete(this.pcb_bend_id),this.pcb_bend_id=null}},Ogi=class extends lr{pcb_stiffener_id=null;get config(){return{componentName:"PcbStiffener",zodProps:ASt}}doInitialPcbFlexRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,t=this._parsedProps,{board:n,transform:o}=sEn(this),r={pcb_board_id:n.pcb_board_id,pcb_group_id:this.getGroup()?.pcb_group_id??void 0,subcircuit_id:this.getSubcircuit().subcircuit_id??void 0,name:t.name,layer:t.layer,material:t.material,thickness:t.thickness,adhesive_thickness:t.adhesiveThickness},i=t.shape==="rect"?{shape:"rect",center:_o(o,{x:0,y:0}),rotation:Zd(o).rotation.angle*180/Math.PI,width:t.width,height:t.height}:{shape:"polygon",outline:t.outline.map((s)=>_o(o,s))};this.pcb_stiffener_id=e.pcb_stiffener.insert({...r,...i}).pcb_stiffener_id}doRemovePcbFlexRender(){if(!this.pcb_stiffener_id)return;this.root.db.pcb_stiffener.delete(this.pcb_stiffener_id),this.pcb_stiffener_id=null}},cEn=class extends lr{isAssemblyDeviceContainer=!0;compiledJscadInput;compiledJscad;get config(){return{componentName:"AssemblyPrintedPart",zodProps:tSt}}get printedPartPlan(){if(!this._parsedProps.jscad)return;if(!this.compiledJscad||this.compiledJscadInput!==this._parsedProps.jscad){let{geometry:e,referencePlanes:t}=bst.resolveReferencePlanes(Ltt(this._parsedProps.jscad));if(!e)throw Error(`assembly.printedpart "${this.name}" needs solid geometry in addition to references`);this.compiledJscad={geometry:e,referencePlanes:t},this.compiledJscadInput=this._parsedProps.jscad}return this.compiledJscad}doInitialReactSubtreesRender(){if(aEn.isValidElement(this.props.cadModel))this.add(Wue(this.props.cadModel))}doInitialSourceRender(){this.printedPartPlan,N8e(this),this.source_component_id=this.root.db.source_component.insert({ftype:"printedpart",name:this.name,color:this._parsedProps.color,material:this._parsedProps.material}).source_component_id}doInitialCadModelRender(){if(!this.root||this.root.pcbDisabled||!this.source_component_id)return;tEn(this);let e=this.printedPartPlan;if(!e){let i=tee(this._parsedProps)??this._parsedProps.cadModel,s=zZ(this);if(!i||typeof i==="object"&&"type"in i)return;if(typeof i==="object"&&"jscad"in i){let{geometry:a}=bst.resolveReferencePlanes(i.jscad);if(!a)throw Error(`assembly.printedpart "${this.name}" needs solid geometry in addition to references`);i={...i,jscad:a}}this.cad_component_id=lT(this,i,s);return}let{transforms:t,subcircuitId:n}=uG(this),o=t.get(this),r=P3n(o);this.cad_component_id=lT(this,{jscad:{type:"rotate",angles:r,shape:e.geometry}},{position:{x:o[12],y:o[13],z:o[14]},pcbRotation:0,layer:"top",subcircuit_id:n})}},Vue=an([ce(2),ce(3),ce(3.5),ce(4),ce(5),ce(5.5),ce(6),ce(8)]),d4n=bt(["male","female"]);function u4n({diameter:e,gender:t,pinCount:n=1,pitch:o=e+2}){let r=e*2,i=e+(t==="female"?1:0.6);return{kind:t==="male"?"bullet_male":"bullet_female",diameter:e,contactDepth:r,pinCount:n,pitch:o,bodyWidth:i+(n-1)*o,bodyHeight:i,bodyDepth:r+e*1.5}}var Vgi=bt(["usb_c","jst_sh","jst_ph","us_mains","bullet","adaptercable"]),W3=ge().finite().positive(),p4n=k().regex(/^#[0-9a-fA-F]{6}$/),VY={bodyWidth:W3,bodyHeight:W3,bodyDepth:W3},w8e=ss("kind",[Ee({kind:ce("bullet_male"),...VY,diameter:Vue,pinCount:ge().int().min(1).max(16).default(1),pitch:W3,contactDepth:W3}).strict(),Ee({kind:ce("bullet_female"),...VY,diameter:Vue,pinCount:ge().int().min(1).max(16).default(1),pitch:W3,contactDepth:W3}).strict(),Ee({kind:ce("usb_c_plug"),...VY,shellWidth:W3,shellHeight:W3,shellDepth:W3}).strict(),Ee({kind:ce("jst_sh_housing"),...VY,pinCount:ge().int().min(2).max(15),pitch:ce(1)}).strict(),Ee({kind:ce("jst_ph_housing"),...VY,pinCount:ge().int().min(2).max(16),pitch:ce(2)}).strict(),Ee({kind:ce("nema_5_15p"),...VY}).strict(),Ee({kind:ce("iec_c13"),...VY}).strict()]),lEn=ss("kind",[Ee({kind:ce("round_jacket"),diameter:W3,color:p4n}).strict(),Ee({kind:ce("wire_bundle"),wires:st(Ee({diameter:W3,color:p4n}).strict()).min(2),wirePitch:W3}).strict()]),Nde=Ee({standard:Vgi,connectorA:w8e,connectorB:w8e,crossSection:lEn}).strict().superRefine((e,t)=>{let{connectorA:n,connectorB:o,crossSection:r}=e,i={usb_c:["usb_c_plug","usb_c_plug"],jst_sh:["jst_sh_housing","jst_sh_housing"],jst_ph:["jst_ph_housing","jst_ph_housing"],us_mains:["nema_5_15p","iec_c13"],bullet:[n.kind,o.kind],adaptercable:[n.kind,o.kind]}[e.standard];if(n.kind!==i[0]||o.kind!==i[1])t.addIssue({code:Gt.custom,message:"Connector kinds must match the cable standard"});if(e.standard==="bullet"){if(!("diameter"in n)||!("diameter"in o)||n.diameter!==o.diameter||"pinCount"in n&&"pinCount"in o&&n.pinCount!==o.pinCount)t.addIssue({code:Gt.custom,message:"Bullet connectors require supported nominal diameters and matching contact counts"});if("pinCount"in n&&(n.pinCount===1&&r.kind!=="round_jacket"||n.pinCount>1&&r.kind!=="wire_bundle"))t.addIssue({code:Gt.custom,message:"Bullet cables require one insulated wire per contact"});for(let s of[n,o])if("diameter"in s&&(s.bodyHeight<=s.diameter||s.pitch<s.bodyHeight||Math.abs(s.bodyWidth-(s.bodyHeight+(s.pinCount-1)*s.pitch))>0.000001||r.kind==="wire_bundle"&&(r.wirePitch!==s.pitch||r.wires.some((a)=>a.diameter>s.bodyHeight))||s.contactDepth>=s.bodyDepth||r.kind==="round_jacket"&&r.diameter>s.bodyHeight))t.addIssue({code:Gt.custom,message:"Bullet contact, body, and wire dimensions must fit"})}else if(e.standard!=="adaptercable"&&(("diameter"in n)||("diameter"in o)))t.addIssue({code:Gt.custom,message:"Bullet connectors require the bullet cable standard"});if(e.standard==="adaptercable"){if("pinCount"in n&&"pinCount"in o&&n.pinCount!==o.pinCount)t.addIssue({code:Gt.custom,message:"Adapter connector pin counts must match"});if("pinCount"in n&&"pinCount"in o&&n.pinCount>1&&r.kind!=="wire_bundle")t.addIssue({code:Gt.custom,message:"Adapter cables require one wire per explicit contact"});for(let s of[n,o])if("diameter"in s&&(s.bodyHeight<=s.diameter||s.pitch<s.bodyHeight||Math.abs(s.bodyWidth-(s.bodyHeight+(s.pinCount-1)*s.pitch))>0.000001||s.contactDepth>=s.bodyDepth||s.pinCount===1&&(r.kind!=="round_jacket"||r.diameter>s.bodyHeight)||s.pinCount>1&&(r.kind!=="wire_bundle"||r.wires.some((a)=>a.diameter>s.bodyHeight))))t.addIssue({code:Gt.custom,message:"Bullet contact, body, and wire dimensions must fit"})}if(r.kind==="wire_bundle"){for(let s of[n,o]){if(!("pinCount"in s)||s.pinCount!==r.wires.length)t.addIssue({code:Gt.custom,message:"Bundle wire count must match each connector pin count"});if("pitch"in s&&r.wires.some((a)=>a.diameter>s.pitch))t.addIssue({code:Gt.custom,message:"Insulated wires must fit each connector pitch"})}if(r.wires.some((s)=>s.diameter>r.wirePitch))t.addIssue({code:Gt.custom,message:"Bundle wires must not overlap in the cross section"})}else if(e.standard==="jst_sh"||e.standard==="jst_ph")t.addIssue({code:Gt.custom,message:"JST cables require a wire bundle"})}),hEn=Ee({standard:ce("adaptercable"),connectorA:w8e,connectorB:w8e,crossSection:lEn.optional()}).strict(),dEn=k().regex(/^#[0-9a-fA-F]{6}$/),grt={jacketDiameter:ge().finite().positive().default(4),color:dEn.default("#263449")},Ygi=ss("standard",[Ee({standard:ce("bullet"),diameter:Vue,pinCount:ge().int().min(1).max(16).default(1),genderA:d4n.default("male"),genderB:d4n.default("female"),wireDiameter:ge().finite().positive().default(2),color:dEn.default("#263449")}).strict(),Ee({standard:ce("usb_c"),...grt}).strict(),Ee({standard:ce("jst_sh"),pinCount:ge().int().min(2).max(15).default(4),wireDiameter:ge().finite().min(0.4).max(0.8).default(0.6)}).strict(),Ee({standard:ce("jst_ph"),pinCount:ge().int().min(2).max(16).default(2),wireDiameter:ge().finite().min(0.8).max(1.5).default(1.2)}).strict(),Ee({standard:ce("us_mains"),...grt,jacketDiameter:grt.jacketDiameter.default(6.2)}).strict(),hEn]),m4n=["#df4049","#263449","#e1b13c","#347dc9","#27a782","#af62bd"];function uEn(e){let t=hEn.parse({standard:"adaptercable",...e}),{connectorA:n,connectorB:o}=t,r="pinCount"in n&&"pinCount"in o&&n.pinCount>1,i=[n,o].flatMap((a)=>("pitch"in a)?[a.pitch]:[]),s=Math.min(2,...i.map((a)=>a*0.6));return Nde.parse({...t,crossSection:t.crossSection??(r?{kind:"wire_bundle",wirePitch:Math.max(...i),wires:Array.from({length:n.pinCount},(a,c)=>({diameter:s,color:m4n[c%m4n.length]}))}:{kind:"round_jacket",diameter:Math.min(4,n.bodyHeight,o.bodyHeight,...i.map((a)=>Math.min(2,a*0.6))),color:"#263449"})})}var ove=["#df4049","#263449","#e1b13c","#347dc9","#27a782","#af62bd"];function xP(e){let t=Ygi.parse(e);if(t.standard==="adaptercable")return uEn(t);if(t.standard==="bullet"){let r=t.diameter+2;return Nde.parse({standard:"bullet",connectorA:u4n({diameter:t.diameter,gender:t.genderA,pinCount:t.pinCount,pitch:r}),connectorB:u4n({diameter:t.diameter,gender:t.genderB,pinCount:t.pinCount,pitch:r}),crossSection:t.pinCount===1?{kind:"round_jacket",diameter:t.wireDiameter,color:t.color}:{kind:"wire_bundle",wirePitch:r,wires:Array.from({length:t.pinCount},(i,s)=>({diameter:t.wireDiameter,color:ove[s%ove.length]}))}})}if(t.standard==="usb_c"){let r={kind:"usb_c_plug",bodyWidth:12,bodyHeight:6,bodyDepth:18,shellWidth:8.25,shellHeight:2.4,shellDepth:6.5};return Nde.parse({standard:t.standard,connectorA:r,connectorB:{...r},crossSection:{kind:"round_jacket",diameter:t.jacketDiameter,color:t.color}})}if(t.standard==="us_mains")return Nde.parse({standard:t.standard,connectorA:{kind:"nema_5_15p",bodyWidth:32,bodyHeight:28,bodyDepth:35},connectorB:{kind:"iec_c13",bodyWidth:24,bodyHeight:18,bodyDepth:30},crossSection:{kind:"round_jacket",diameter:t.jacketDiameter,color:t.color}});let n=t.standard==="jst_sh",o={kind:n?"jst_sh_housing":"jst_ph_housing",pinCount:t.pinCount,pitch:n?1:2,bodyWidth:n?t.pinCount+1:(t.pinCount-1)*2+3.8,bodyHeight:n?2.8:4.5,bodyDepth:n?5:6.85};return Nde.parse({standard:t.standard,connectorA:o,connectorB:{...o},crossSection:{kind:"wire_bundle",wirePitch:o.pitch,wires:Array.from({length:t.pinCount},(r,i)=>({diameter:t.wireDiameter,color:ove[i%ove.length]}))}})}function _4n(e){let t=e.trim().toLowerCase(),n=/^bullet([1-9][0-9]*)?_(.+)$/.exec(t);if(n){let r,i,s=new Set;for(let a of n[2].split("_")){let c=/^d([0-9]+(?:\.[0-9]+)?)mm$/.exec(a)??/^g(male|female)$/.exec(a),l=a[0];if(!c||s.has(l))throw Error(`Invalid or duplicate connector parameter: "${a}"`);if(s.add(l),l==="d")r=Number(c[1]);else i=c[1]}if(r===void 0||i===void 0)throw Error("Bullet connector strings require dNmm and gmale or gfemale");return xP({standard:"bullet",diameter:Vue.parse(r),pinCount:n[1]?Number(n[1]):1,genderA:i}).connectorA}let o=/^(jst_sh|jst_ph)(?:_pins([0-9]+))?$/.exec(t);if(o)return xP({standard:o[1],...o[2]?{pinCount:Number(o[2])}:{}}).connectorA;if(t==="usb_c")return xP({standard:"usb_c"}).connectorA;if(t==="nema_5_15p")return xP({standard:"us_mains"}).connectorA;if(t==="iec_c13")return xP({standard:"us_mains"}).connectorB;throw Error(`Unsupported connector string: "${e}"`)}function Ggi(e){let t=e.trim().toLowerCase();if(t.startsWith("adaptercable")){let r=/^adaptercable_(a|b)\(([^()]+)\)_(a|b)\(([^()]+)\)$/.exec(t);if(!r||r[1]===r[3])throw Error("Adapter cables require exactly one named a(CONNECTOR) and b(CONNECTOR)");let i=_4n(r[2]),s=_4n(r[4]);return uEn({connectorA:r[1]==="a"?i:s,connectorB:r[1]==="b"?i:s})}if(t==="usb_c"||t==="us_mains")return xP({standard:t});let n=/^bullet([1-9][0-9]*)?_(.+)$/.exec(t);if(n){let r,i,s,a=new Set;for(let c of n[2].split("_")){let l=/^d([0-9]+(?:\.[0-9]+)?)mm$/.exec(c)??/^(a|b)(male|female)$/.exec(c),h=c[0];if(!l||a.has(h))throw Error(`Invalid or duplicate bullet parameter: "${c}"`);if(a.add(h),h==="d")r=Number(l[1]);else if(h==="a")i=l[2];else s=l[2]}if(r===void 0)throw Error("Bullet cables require dNmm");return xP({standard:"bullet",diameter:Vue.parse(r),pinCount:n[1]?Number(n[1]):1,genderA:i??"male",genderB:s??"female"})}let o=/^(jst_sh|jst_ph)(?:_pins([0-9]+))?$/.exec(t);if(o)return xP({standard:o[1],...o[2]?{pinCount:Number(o[2])}:{}});throw Error(`Unsupported cable string: "${e}". Expected usb_c, jst_sh[_pinsN], jst_ph[_pinsN], us_mains, bullet[CONTACTS]_dNmm[_amale][_bfemale], or adaptercable_a(CONNECTOR)_b(CONNECTOR).`)}function Ugi(e,t,n,o){let r=e.root.db,i=r.source_port.list().flatMap((h)=>{if(h.source_component_id!==t.source_component_id)return[];let d=r.pcb_port.list().find((p)=>p.source_port_id===h.source_port_id&&p.pcb_component_id===t.pcb_component_id);if(!d)return[];let u=[h.name,...h.port_hints??[]].find((p)=>/^(?:pin)?\d+$/.test(p)),_=h.pin_number??(u?Number(u.replace(/^pin/,"")):void 0);return[{position:d,pin:_}]}),s=i.find(({pin:h})=>h===1)?.position;if(!s||i.length<2)return;let a=i.reduce((h,{position:d})=>({x:h.x+d.x/i.length,y:h.y+d.y/i.length}),{x:0,y:0}),c=WY.vec3.fromValues(s.x-a.x,s.y-a.y,0),l=WY.vec3.normalize(WY.vec3.create(),[o.x,o.y,o.z]);if(WY.vec3.scaleAndAdd(c,c,l,-WY.vec3.dot(c,l)),WY.vec3.length(c)<0.000001)return;return{x:n.x+c[0],y:n.y+c[1],z:n.z+c[2]}}function g4n(e,t,n){let o=SG(e),r=t.match(/^(.+)\.wireside$/);if(r){let y=o.filter((H)=>H.componentName==="AssemblyMotor"&&H.name===r[1]);if(y.length!==1)throw Error(`assembly.cable "${e.name}" endpoint "${t}" must match exactly one motor in its assembly device`);let x=y[0],C=tIe(x.motorModel.wireConnection);if(!C)throw Error(`assembly.cable "${e.name}" requires motor "${x.name}" to have a JST PH or SH wireConnection, e.g. "jst4_ph" or "jst4_sh", for its connector endpoint`);let b=$Pn(x),I=b?{position:b.position,pcbRotation:0,layer:"top"}:KPn(x),v=b?.rotation??jPn(x,I),P=mx.mat4.create(),M=I.layer==="bottom";mx.mat4.rotateX(P,P,v.x*Math.PI/180),mx.mat4.rotateY(P,P,(v.y+(M?180:0))*Math.PI/180),mx.mat4.rotateZ(P,P,(M?-1:1)*(I.pcbRotation+v.z)*Math.PI/180);let B=x.motorReferencePoints.wireside,T=mx.vec3.transformMat4(mx.vec3.create(),[B.direction.x,B.direction.y,B.direction.z],P),N=mx.vec3.transformMat4(mx.vec3.create(),[B.position.x,B.position.y,B.position.z],P),D=(C.pinCount-1)*C.pitch/2,L=mx.vec3.transformMat4(mx.vec3.create(),[B.direction.y*D,-B.direction.x*D,0],P);return{sourceComponentId:x.source_component_id,position:{x:N[0]+I.position.x+T[0]*C.matingDepth,y:N[1]+I.position.y+T[1]*C.matingDepth,z:N[2]+I.position.z+T[2]*C.matingDepth},pin1Position:{x:N[0]+I.position.x+T[0]*C.matingDepth+L[0],y:N[1]+I.position.y+T[1]*C.matingDepth+L[1],z:N[2]+I.position.z+T[2]*C.matingDepth+L[2]},direction:{x:T[0],y:T[1],z:T[2]},cableInput:{standard:C.standard,pinCount:C.pinCount}}}let i=Lrt(e),s=RO(wve(t,e),i,{adapter:FZ}).filter((y)=>o.includes(y));if(s.length!==1)throw Error(`assembly.cable "${e.name}" endpoint "${t}" matched ${s.length} components; expected exactly one in its assembly device`);let a=s[0];if(!(a instanceof Xl)||a.componentName!=="Connector"||!a.pcb_component_id||!a.source_component_id)throw Error(`assembly.cable "${e.name}" endpoint "${t}" must name a PCB connector or MOTOR.wireside`);let c=a._parsedProps;if(!n&&c.standard!=="usb_c"&&c.standard!=="jst_sh"&&c.standard!=="jst_ph")throw Error(`assembly.cable "${e.name}" cannot infer endpoint "${t}"; use a connector with standard="usb_c", "jst_sh", or "jst_ph"`);let l=e.root.db.pcb_component.get(a.pcb_component_id),h=a._getBoard(),d=l.layer==="bottom"?"bottom":"top",u=l.cable_insertion_center??l.center,_=mx.vec3.normalize(mx.vec3.create(),[u.x-l.center.x,u.y-l.center.y,0]),p=a._getPcbComponentInsertionAxisDirection(d,l.rotation)??(c.standard==="usb_c"&&mx.vec3.length(_)>0?{x:_[0],y:_[1],z:0}:{x:0,y:0,z:d==="bottom"?-1:1}),m=Math.abs(p.z)>0.5?l.center:u,A=d==="bottom"?-1:1,g=!c.standard&&n?Math.abs(p.z)>0.5?n.bodyDepth:n.bodyHeight/2:Math.abs(p.z)>0.5?c.standard==="jst_ph"?6:c.standard==="jst_sh"?4.25:1.5:c.standard==="usb_c"?1.5:c.standard==="jst_sh"?1.4:2.25,f={x:m.x,y:m.y,z:A*(h.boardThickness/2+g)};return{sourceComponentId:a.source_component_id,position:f,pin1Position:Ugi(e,a,f,p),direction:p,cableInput:c.standard==="usb_c"?{standard:"usb_c"}:c.standard==="jst_sh"||c.standard==="jst_ph"?{standard:c.standard,pinCount:c.pinCount}:void 0}}function Wgi({from:e,to:t,fromDirection:n,toDirection:o}){let r=Math.hypot(t.x-e.x,t.y-e.y,t.z-e.z);if(r<0.000001)throw Error("Cable wire exits must be at different positions");let i=yv.vec3.fromValues(t.x-e.x,t.y-e.y,t.z-e.z),s=yv.vec3.cross(yv.vec3.create(),i,[n.x,n.y,n.z]);if(yv.vec3.length(s)<0.000001)yv.vec3.cross(s,i,Math.abs(i[2])/r>0.95?[0,1,0]:[0,0,1]);let a=yv.vec3.normalize(yv.vec3.create(),yv.vec3.cross(yv.vec3.create(),s,i)),c=e.z<0&&t.z<0?-1:1;if(a[2]*c<0)yv.vec3.scale(a,a,-1);let l=Math.min(25,Math.max(8,r/3)),h={x:e.x+n.x*l,y:e.y+n.y*l,z:e.z+n.z*l},d={x:t.x+o.x*l,y:t.y+o.y*l,z:t.z+o.z*l},u=[e,{x:e.x+n.x*0.1,y:e.y+n.y*0.1,z:e.z+n.z*0.1}];for(let _=1;_<48;_++){let p=_/48,m=1-p,A=Math.sin(Math.PI*p)**2*Math.min(12,r*0.15);u.push({x:m**3*e.x+3*m**2*p*h.x+3*m*p**2*d.x+p**3*t.x+a[0]*A,y:m**3*e.y+3*m**2*p*h.y+3*m*p**2*d.y+p**3*t.y+a[1]*A,z:m**3*e.z+3*m**2*p*h.z+3*m*p**2*d.z+p**3*t.z+a[2]*A})}return u.push({x:t.x+o.x*0.1,y:t.y+o.y*0.1,z:t.z+o.z*0.1},t),u}var A4n=(e)=>e.bodyDepth+(e.kind==="usb_c_plug"?e.shellDepth:0);function f4n(e){let t=e._parsedProps.model,n=t?Ggi(t):void 0,o=g4n(e,e._parsedProps.from,n?.connectorA),r=g4n(e,e._parsedProps.to,n?.connectorB),i=n??xP(o.cableInput),s=n??xP(r.cableInput);if(o.sourceComponentId===r.sourceComponentId)throw Error(`assembly.cable "${e.name}" must connect two different endpoints`);if(!n&&(i.standard!==s.standard||i.connectorA.kind!==s.connectorA.kind||("pinCount"in i.connectorA)&&("pinCount"in s.connectorA)&&i.connectorA.pinCount!==s.connectorA.pinCount))throw Error(`assembly.cable "${e.name}" endpoints "${e._parsedProps.from}" and "${e._parsedProps.to}" have incompatible connector standards or pin counts`);if(e._parsedProps.standard&&e._parsedProps.standard!==i.standard)throw Error(`assembly.cable "${e.name}" standard="${e._parsedProps.standard}" conflicts with its endpoints`);let a=i,c=(d,u,_)=>{let p=Ist.vec3.scaleAndAdd(Ist.vec3.create(),[d.x,d.y,d.z],[u.x,u.y,u.z],_);return{x:p[0],y:p[1],z:p[2]}},l=c(o.position,o.direction,A4n(a.connectorA)),h=c(r.position,r.direction,A4n(a.connectorB));return{name:e.name,from_source_component_id:o.sourceComponentId,to_source_component_id:r.sourceComponentId,from_connector_pin1_position:o.pin1Position,to_connector_pin1_position:r.pin1Position,cableprinter_string:t??("pinCount"in a.connectorA?`${a.standard}_pins${a.connectorA.pinCount}`:a.standard),path:Wgi({from:l,to:h,fromDirection:o.direction,toDirection:r.direction})}}var pEn=class extends lr{cadCableId;get config(){return{componentName:"AssemblyCable",zodProps:q7t}}doInitialCadModelRender(){if(!this.root||this.root.pcbDisabled)return;let e=f4n(this);this.cadCableId=this.root.db.cad_cable.insert(e).cad_cable_id}updateCadModelRender(){if(!this.root||this.root.pcbDisabled||!this.cadCableId)return;this.root.db.cad_cable.update(this.cadCableId,f4n(this))}},af=(e)=>{let t=(n)=>mEn.createElement(e,n);return t.displayName=e,t},ula={transientsimulation:af("analogtransientsimulation"),dcoperatingpointsimulation:af("analogdcoperatingpointsimulation"),dcsweepsimulation:af("analogdcsweepsimulation"),acsweepsimulation:af("analogacsweepsimulation"),sweepparameter:af("analogsweepparameter")},pla={referencesurface:af("assembly.referencesurface"),part:af("assembly.part"),cable:af("assembly.cable"),printedpart:af("assembly.printedpart"),motor:af("assembly.motor"),subassembly:af("assembly.subassembly"),cadassembly:af("assembly.cadassembly"),device:af("assembly.device"),screen:af("assembly.screen")},y4n=af("enclosure.fdm.box"),mla={cutoutaperture:af("enclosure.cutoutaperture"),fdm:{box:y4n,Box:y4n}},_la={pcbreturncurrentsimulation:af("pcbreturncurrentsimulation"),pcbreturncurrentexcitation:af("pcbreturncurrentexcitation")},Xgi=class extends wPn{isRootCircuit=!0;constructor({platform:e,projectUrl:t}={}){super({platform:e,projectUrl:t,cachedSubcircuits:new Map,pendingSubcircuitRenders:new Map});this.root=this}};var _En=Xgi;var g7e=(e,t)=>(n,o)=>{let r=[];if(Array.isArray(t))r.push(...t.flat());else if(typeof t==="object")r.push(...Object.values(t).flat(),...Object.keys(t));let i=(s)=>{if(s?.name&&s.name!==n)throw Error(`Component name mismatch. Hook name: ${n}, Component prop name: ${s.name}`);let a={...o,...s,name:n},c=[];for(let l of r)if(a[l]){let h=`.${n} > .${l}`,d=a[l];c.push({from:h,to:d}),delete a[l]}return IG.jsxs(IG.Fragment,{children:[IG.jsx(e,{...a}),c.map((l,h)=>IG.jsx("trace",{...l},h))]})};for(let s of r)i[s]=`.${n} > .${s}`;return i},yla=g7e((e)=>gEn.jsx("capacitor",{...e}),QSt);var Cla=g7e((e)=>AEn.jsx("diode",{...e}),Aze),Ila=g7e((e)=>fEn.jsx("led",{...e}),vPt),Sla=g7e((e)=>yEn.jsx("resistor",{...e}),BSt),Pla=new Proxy((e)=>new Proxy({},{get:(t,n)=>`.${e} > .${n}`}),{get:(e,t)=>new Proxy((...o)=>{let r=o[0];return new Proxy({},{get:(i,s)=>`.${t} > .${s}`})},{get:(o,r)=>{if(t==="net")return`net.${r}`;if(t==="subcircuit")return new Proxy({},{get:(i,s)=>new Proxy({},{get:(a,c)=>`subcircuit.${r} > .${s} > .${c}`})});return`.${t} > .${r}`},apply:(o,r,i)=>{if(t==="net")return new Proxy({},{get:(s,a)=>`net.${a}`});return new Proxy({},{get:(s,a)=>{let c=`.${t} > .${a}`;if(["U","J","CN"].some((h)=>t.startsWith(h)))return c;return new Proxy(new String(c),{get:(h,d)=>{if(typeof d==="symbol"||d==="toString")return()=>c;return`.${t} > .${a} > .${d}`}})}})}})});j4n(x4n);j4n({"assembly.cable":pEn,"assembly.device":XPn,"assembly.motor":qPn,"assembly.part":nEn,"assembly.referencesurface":oEn,"assembly.printedpart":cEn,"assembly.screen":JPn,"assembly.subassembly":xst,"assembly.cadassembly":xst,Bug:$ue,"enclosure.cutoutaperture":Xct,"enclosure.fdm.box":iEn,Fanout:yst,FanoutPoint:bG});/*! Bundled license information:

@tscircuit/bus-lanes-solver/dist/index.js:
  (*! Bundled license information:
  
  svgson/dist/svgson.umd.js:
    (*!
     * Determine if an object is a Buffer
     *
     * @author   Feross Aboukhadijeh <https://feross.org>
     * @license  MIT
     *)
  
  @tscircuit/capacity-autorouter/dist/index.js:
    (*! Bundled license information:
    
    is-buffer/index.js:
      (*!
       * Determine if an object is a Buffer
       *
       * @author   Feross Aboukhadijeh <https://feross.org>
       * @license  MIT
       *)
    
    deep-rename-keys/index.js:
      (*!
       * deep-rename-keys <https://github.com/jonschlinkert/deep-rename-keys>
       *
       * Copyright (c) 2015 Jon Schlinkert, contributors.
       * Licensed under the MIT license.
       *)
    
    @tscircuit/curvy-trace-solver/dist/index.js:
    @tscircuit/find-convex-regions/dist/index.js:
      (*! Bundled license information:
      
      is-buffer/index.js:
        (*!
         * Determine if an object is a Buffer
         *
         * @author   Feross Aboukhadijeh <https://feross.org>
         * @license  MIT
         *)
      
      deep-rename-keys/index.js:
        (*!
         * deep-rename-keys <https://github.com/jonschlinkert/deep-rename-keys>
         *
         * Copyright (c) 2015 Jon Schlinkert, contributors.
         * Licensed under the MIT license.
         *)
      *)
    
    @tscircuit/hypergraph/dist/index.js:
      (*! Bundled license information:
      
      @tscircuit/find-convex-regions/dist/index.js:
        (*! Bundled license information:
        
        is-buffer/index.js:
          (*!
           * Determine if an object is a Buffer
           *
           * @author   Feross Aboukhadijeh <https://feross.org>
           * @license  MIT
           *)
        
        deep-rename-keys/index.js:
          (*!
           * deep-rename-keys <https://github.com/jonschlinkert/deep-rename-keys>
           *
           * Copyright (c) 2015 Jon Schlinkert, contributors.
           * Licensed under the MIT license.
           *)
        *)
      *)
    *)
  *)

@tscircuit/schematic-trace-solver/dist/index.js:
  (*! Bundled license information:
  
  svgson/dist/svgson.umd.js:
    (*!
     * Determine if an object is a Buffer
     *
     * @author   Feross Aboukhadijeh <https://feross.org>
     * @license  MIT
     *)
  *)
*/er();er();er();var Reo=at(ln(),1),BT=at(ln(),1),gf=at(ln(),1),Kv=at(ln(),1),Qeo=at(lo(),1),Leo=at(ln(),1),Yte=at(ln(),1),Feo=at(z7(),1);be();be();var xEn={in:25.4,inch:25.4,mil:0.0254,mm:1,m:1000,cm:10,ft:304.8,feet:304.8},Opa=new Intl.NumberFormat("en-US",{useGrouping:!1,notation:"standard",maximumFractionDigits:12}),CEn=(e)=>{let t=typeof e==="number"?"mm":e.replace(/^[^a-zA-Z]+/g,"").toLowerCase();if(!t)t="mm";let n=typeof e==="number"?e:Number.parseFloat(e.split(t)[0]);if(t in xEn)return n*xEn[t];throw Error(`Unsupported unit: ${t}`)};be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();function jEn(e){if(!/^nema(?:8|17|23)(?:_|$)/i.test(e))return e;return e.replace(/(^|_)jst([0-9]+)_(ph|sh)(?=_|$)/gi,"$1jst$3$2").replace(/(^|_)jst[_-](ph|sh)[_-]([0-9]+)(?=_|$)/gi,"$1jst$2$3").replace(/(^|_)none(?=_|$)/gi,"$1nowires").replace(/(^|_)stubs(?=_|$)/gi,"$1wirestubs")}function t_(e){let t=[],n=0,o=0;for(let r=0;r<e.length;r++){let i=e[r];if(i==="(")n++;if(i===")")n--;if(n<0||n>1)throw Error("Invalid feature parentheses");if(i==="_"&&n===0)t.push(e.slice(o,r)),o=r+1}if(n!==0)throw Error("Unclosed feature parentheses");if(t.push(e.slice(o)),t.some((r)=>!r))throw Error("Model strings cannot contain empty tokens");return t}var bEn=(e)=>{let t=e.match(/^([a-zA-Z]+)([\(\d\.\+\-].*)?$/);if(!t?.[1])return;return{fn:t[1].toLowerCase(),value:t[2]}},nlt=(e)=>{let t=jEn(e.trim());if(!t)throw Error("Model string cannot be empty");let n=t_(t),o=n[0],r=bEn(o),i={},s=r?.fn??o.toLowerCase();if(i[s]=!0,i.fn=s,r?.value){let a=Number.parseFloat(r.value);if(Number.isFinite(a))i.num_pins=a}for(let a of n.slice(1)){if(!a)throw Error("Model strings cannot contain empty tokens");let c=bEn(a);if(!c)throw Error(`Invalid model string token "${a}"`);i[c.fn]=c.value??!0}return i.string=t,i};function Uu(e){return e}var qgi=class{models=new Map;register(e){if(typeof e.name!=="string"||!/^[a-z]+$/.test(e.name))throw Error("Model names must contain only lowercase letters");if(this.models.has(e.name))throw Error(`Modelprinter function "${e.name}" is already registered`);if(e.normalizeString!==void 0&&typeof e.normalizeString!=="function")throw Error("Model string normalizer must be a function");this.models.set(e.name,{name:e.name,schema:e.schema,parse:e.parse,normalizeString:e.normalizeString})}getModelNames(){return[...this.models.keys()]}normalize(e){let t=this.models.get(e.fn);if(!t?.normalizeString)return e;let n=t.normalizeString(e.string);if(typeof n!=="string")throw Error(`Normalizer for "${t.name}" must return a string`);if(n===e.string)return e;let o=nlt(n);if(o.fn!==t.name)throw Error(`Normalizer for "${t.name}" must preserve the model name`);return o}parse(e){let t=this.models.get(e.fn);if(!t)throw Error(`Unsupported modelprinter function "${e.fn}"`);let n=t.parse(e);if(n===null||typeof n!=="object"||Array.isArray(n)||n.fn!==t.name)throw Error(`Parser for "${t.name}" must return a model with fn "${t.name}"`);return n}},cd=an([ge(),k()]).transform((e,t)=>{try{let n=CEn(e);if(!Number.isFinite(n))throw Error("Length is not finite");return n}catch{return t.addIssue({code:"custom",message:`Invalid model length: ${String(e)}`}),Cie}}),Ns=cd.refine((e)=>e>0,"Length must be greater than zero"),bx=cd.refine((e)=>e>=0,"Length cannot be negative"),kv=an([ge(),k().regex(/^(?:\d+(?:\.\d+)?|\.\d+)(?:mm|cm|m|in|inch)?$/i).transform((e)=>e.toLowerCase())]).pipe(cd).refine((e)=>e>0,"Length must be positive"),olt={M3:{diameter:3,threadPitch:0.5,headAcrossFlats:5.5,headHeight:2,underHeadRadius:0.1,headChamferAngle:30,tipChamferAngle:45,threadFlankAngle:60,tipChamfer:0.25,threadRootDiameter:2.3865653389860224,threadPitchDiameter:2.6752404735808355,headCornerDiameter:6.3508529610858835,headChamferDiameter:5.5},M4:{diameter:4,threadPitch:0.7,headAcrossFlats:7,headHeight:2.8,underHeadRadius:0.2,headChamferAngle:30,tipChamferAngle:45,threadFlankAngle:60,tipChamfer:0.35,threadRootDiameter:3.141191474580432,threadPitchDiameter:3.5453366630131695,headCornerDiameter:8.082903768654761,headChamferDiameter:7},M5:{diameter:5,threadPitch:0.8,headAcrossFlats:8,headHeight:3.5,underHeadRadius:0.2,headChamferAngle:30,tipChamferAngle:45,threadFlankAngle:60,tipChamfer:0.4,threadRootDiameter:4.018504542377636,threadPitchDiameter:4.480384757729337,headCornerDiameter:9.237604307034013,headChamferDiameter:8},M6:{diameter:6,threadPitch:1,headAcrossFlats:10,headHeight:4,underHeadRadius:0.25,headChamferAngle:30,tipChamferAngle:45,threadFlankAngle:60,tipChamfer:0.5,threadRootDiameter:4.773130677972045,threadPitchDiameter:5.350480947161671,headCornerDiameter:11.547005383792516,headChamferDiameter:10}},Jgi=bt(["M3","M4","M5","M6"]),Zgi=bt(["iso4017","iso4017:2014"]).default("iso4017").transform(()=>"iso4017:2014"),KEn={standard:Zgi,metricSize:Jgi,length:kv,thread:ce("full").default("full"),drive:ce("hex").default("hex"),threadHand:bt(["right","left"]).default("right"),threadClass:ce("6g").default("6g"),threadGender:ce("male").default("male"),showThreads:Be().default(!0),diameter:kv.optional(),threadPitch:kv.optional(),headAcrossFlats:kv.optional(),headHeight:kv.optional(),underHeadRadius:kv.optional(),headChamferAngle:ge().finite().positive().optional(),tipChamferAngle:ge().finite().positive().optional(),threadFlankAngle:ge().finite().positive().optional(),tipChamfer:kv.optional(),threadRootDiameter:kv.optional(),threadPitchDiameter:kv.optional(),headCornerDiameter:kv.optional(),headChamferDiameter:kv.optional()},$En=(e,t)=>{let n=olt[e.metricSize];for(let o of Object.keys(n))if(e[o]!==void 0&&Math.abs(e[o]-n[o])>0.000000001)t.addIssue({code:"custom",path:[o],message:`Dimension ${o} contradicts ${e.standard} ${e.metricSize}`});if(e.length<=n.underHeadRadius+n.tipChamfer)t.addIssue({code:"custom",path:["length"],message:"Length must separate the under-head fillet and fixed tip chamfer"})},qEn=Ee(KEn).strict().superRefine($En).transform((e)=>({...e,...olt[e.metricSize]})),y7e=Ee({fn:ce("hexbolt"),...KEn}).strict().superRefine($En).transform((e)=>({...e,...olt[e.metricSize]})),eAi={m:"metricSize",metricsize:"metricSize",l:"length",length:"length",standard:"standard",thread:"thread",drive:"drive",threadhand:"threadHand",threadclass:"threadClass",threadgender:"threadGender",diameter:"diameter",threadpitch:"threadPitch",headacrossflats:"headAcrossFlats",headheight:"headHeight",underheadradius:"underHeadRadius",headchamferangle:"headChamferAngle",tipchamferangle:"tipChamferAngle",threadflankangle:"threadFlankAngle",tipchamfer:"tipChamfer",threadrootdiameter:"threadRootDiameter",threadpitchdiameter:"threadPitchDiameter",headcornerdiameter:"headCornerDiameter",headchamferdiameter:"headChamferDiameter",d:"diameter",headh:"headHeight",af:"headAcrossFlats"},tAi=new Set(["standard","thread","drive","threadHand","threadClass","threadGender"]),nAi=(e)=>{if(e.fn!=="hexbolt")throw Error(`Expected hexbolt params, got "${e.fn}"`);let[t,...n]=t_(e.string);if(t?.toLowerCase()!=="hexbolt")throw Error("The hexbolt function does not accept an inline value");let o={};for(let r of n){let i=r.match(/^([a-z]+)(.*)$/i),s=i?.[1]?.toLowerCase(),a=i?.[2],c,l;if(s==="threads"||s==="nothreads"){if(a!=="")throw Error(`Token "${s}" does not accept a value`);c="showThreads",l=s==="threads"}else{if(c=s?eAi[s]??"":"",!c||!a)throw Error(`Unknown or missing hexbolt token "${r}"`);if(tAi.has(c)){let h=a.match(/^\(([^()]+)\)$/)?.[1];if(!h)throw Error(`Token "${s}" requires a parenthesized selector`);l=h.toLowerCase()}else if(c==="metricSize"){let h=s==="m"?a:a.match(/^\((m\d+)\)$/i)?.[1]?.slice(1);if(!h||!/^\d+$/.test(h))throw Error("Invalid metric size");l=`M${h}`}else{if(!/^(?:\d+(?:\.\d+)?|\.\d+)(?:mm|cm|m|in|inch)?$/i.test(a))throw Error(`Invalid dimension token "${r}"`);l=["headChamferAngle","tipChamferAngle","threadFlankAngle"].includes(c)?Number(a):a}}if(c in o)throw Error(`Property "${c}" is set more than once`);o[c]=l}return y7e.parse({fn:"hexbolt",...o})},JEn=Uu({name:"hexbolt",schema:y7e,parse:nAi});function oAi(e){e.register(JEn)}var ZEn=an([ge(),k().regex(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:mm|cm|m|in|inch|mil|ft|feet)?$/i,"Length must be a complete number with an optional supported unit").transform((e)=>e.toLowerCase())]),w0=ZEn.pipe(cd).refine((e)=>e>0,"Length must be greater than zero"),Lv=ZEn.pipe(cd).refine((e)=>e>=0,"Length cannot be negative"),eMn=ge().finite().gt(0).lt(90);function HG(e,t){if(!/^\d+$/.test(e))throw Error(`${t} requires a unitless integer`);return Number(e)}function x7e(e,t){if(!/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:deg)?$/i.test(e))throw Error(`${t} requires a numeric angle in degrees`);return Number(e.replace(/deg$/i,""))}function iee(e){let t=e.match(/^([a-z]+)(.*)$/i);if(!t)throw Error(`Invalid gear token "${e}"`);return[t[1].toLowerCase(),t[2]]}var tMn={toothCount:ge().int().min(6).max(512).default(24),module:w0.default(1),faceWidth:w0.default(5),pressureAngle:eMn.default(20),backlash:Lv.default(0),clearance:Lv.default(0.25),boreDiameter:Lv.default(0),hubDiameter:Lv.default(0),hubLength:Lv.default(0),phase:ge().finite().default(0),segmentsPerTooth:ge().int().min(4).max(64).default(12)};function nMn(e){let t=e.module*e.toothCount;return{pitchDiameter:t,baseDiameter:t*Math.cos(e.pressureAngle*Math.PI/180),outsideDiameter:t+2*e.module,rootDiameter:t-2*(e.module+e.clearance),circularPitch:Math.PI*e.module,toothThickness:Math.PI*e.module/2-e.backlash}}var A7e=(e)=>Math.tan(e)-e;function oMn(e,t){let n=(c,l)=>t.addIssue({code:"custom",message:c,path:l?[l]:[]}),o=nMn(e);if(Object.values(o).some((c)=>!Number.isFinite(c))||!Number.isFinite(e.faceWidth+e.hubLength)){n("Derived gear dimensions must be finite");return}if(o.rootDiameter<=0){n("Dedendum must leave a positive root diameter","clearance");return}if(e.boreDiameter>=o.rootDiameter)n("Bore diameter must be smaller than the root diameter","boreDiameter");if(e.hubDiameter===0!==(e.hubLength===0))n("Hub diameter and length must both be zero or both be positive");if(e.hubDiameter>0){if(e.hubDiameter>=o.rootDiameter)n("Hub diameter must be smaller than the root diameter","hubDiameter");if(e.boreDiameter>=e.hubDiameter)n("Hub diameter must exceed the bore diameter","hubDiameter")}let r=e.pressureAngle*Math.PI/180,i=o.toothThickness/o.pitchDiameter,s=i+A7e(r)-A7e(Math.acos(o.baseDiameter/o.outsideDiameter));if(!Number.isFinite(s)||s<=0)n("Tooth tip must have positive angular thickness","backlash");let a=i+A7e(r)-A7e(Math.acos(o.baseDiameter/Math.max(o.rootDiameter,o.baseDiameter)));if(!Number.isFinite(a)||a>=Math.PI/e.toothCount)n("Adjacent teeth must leave a positive root gap","pressureAngle")}var y0e=Ee(tMn).strict().superRefine(oMn),C7e=Ee({fn:ce("spurgear"),...tMn}).strict().superRefine(oMn),rlt=(e={})=>nMn(y0e.parse(e)),rMn={...y0e.innerType().shape,helixAngle:ge().finite().min(0).lt(90).default(20),handedness:bt(["right","left"]).default("right"),segmentsPerTurn:ge().int().min(12).max(128).default(32)};function iMn(e){let{helixAngle:t,handedness:n,segmentsPerTurn:o,...r}=e,i=rlt(r),s=t*Math.PI/180;return{...i,normalModule:e.module*Math.cos(s),normalPressureAngle:Math.atan(Math.tan(e.pressureAngle*Math.PI/180)*Math.cos(s))*180/Math.PI,normalPitch:i.circularPitch*Math.cos(s),twistAngle:t===0?0:(n==="right"?1:-1)*(2*e.faceWidth/i.pitchDiameter*Math.tan(s)*180)/Math.PI}}function sMn(e,t){let{fn:n,helixAngle:o,handedness:r,segmentsPerTurn:i,...s}=e,a=y0e.safeParse(s);if(!a.success){for(let c of a.error.issues)t.addIssue(c);return}if(Object.values(iMn({...a.data,helixAngle:o,handedness:r,segmentsPerTurn:i})).some((c)=>!Number.isFinite(c)))t.addIssue({code:"custom",message:"Derived helical gear dimensions must be finite"})}var ilt=Ee(rMn).strict().superRefine(sMn),b7e=Ee({fn:ce("helicalgear"),...rMn}).strict().superRefine(sMn),aMn=(e={})=>iMn(ilt.parse(e)),IEn={m:"module",module:"module",w:"faceWidth",width:"faceWidth",facewidth:"faceWidth",bore:"boreDiameter",borediameter:"boreDiameter",backlash:"backlash",clearance:"clearance",hubdiameter:"hubDiameter",hublength:"hubLength"};function rAi(e){let t=e.string.split("_"),n=t[0]?.match(/^helicalgear(\d+)?$/i);if(!n||e.fn!=="helicalgear")throw Error("Expected helicalgear with an optional inline tooth count");let o={fn:"helicalgear"};if(n[1])o.toothCount=HG(n[1],"toothCount");for(let r of t.slice(1)){let[i,s]=iee(r),a,c;if(i in IEn)a=IEn[i],c=s;else if(i==="teeth"||i==="segments"||i==="turnsegments")a=i==="teeth"?"toothCount":i==="segments"?"segmentsPerTooth":"segmentsPerTurn",c=HG(s,a);else if(i==="pa"||i==="pressureangle"||i==="phase"||i==="ha"||i==="helixangle")a=i==="phase"?"phase":i==="ha"||i==="helixangle"?"helixAngle":"pressureAngle",c=x7e(s,a);else if(i==="right"||i==="left"){if(s)throw Error(`Helical flag "${i}" does not accept a value`);a="handedness",c=i}else throw Error(`Unknown helical gear token "${r}"`);if(a in o)throw Error(`Helical gear property "${a}" is set more than once`);o[a]=c}return b7e.parse(o)}var cMn=Uu({name:"helicalgear",schema:b7e,parse:rAi});function iAi(e){e.register(cMn)}function I7e(e){let t=/^jst-(ph|sh)-([1-9][0-9]*)$/.exec(e);if(!t)return;let n=Number(t[2]),o=t[1]==="ph";return{standard:o?"jst_ph":"jst_sh",pinCount:n,maxPinCount:o?16:15,pitch:o?2:1,bodyWidth:o?(n-1)*2+3.9:n+3,bodyHeight:o?4.5:2.9,matingDepth:o?6:4.25}}var sAi=k().refine((e)=>{let t=I7e(e);return t!==void 0&&t.pinCount>=2&&t.pinCount<=t.maxPinCount},"Expected jst-ph-N (2–16 pins) or jst-sh-N (2–15 pins)"),j5={M2:{diameter:2,threadPitch:0.4,headDiameter:3.8,headHeight:2,socketWidth:1.5,socketDepth:1},"M2.5":{diameter:2.5,threadPitch:0.45,headDiameter:4.5,headHeight:2.5,socketWidth:2,socketDepth:1.1},M3:{diameter:3,threadPitch:0.5,headDiameter:5.5,headHeight:3,socketWidth:2.5,socketDepth:1.3},M4:{diameter:4,threadPitch:0.7,headDiameter:7,headHeight:4,socketWidth:3,socketDepth:2},M5:{diameter:5,threadPitch:0.8,headDiameter:8.5,headHeight:5,socketWidth:4,socketDepth:2.5},M6:{diameter:6,threadPitch:1,headDiameter:10,headHeight:6,socketWidth:5,socketDepth:3},M8:{diameter:8,threadPitch:1.25,headDiameter:13,headHeight:8,socketWidth:6,socketDepth:4},M10:{diameter:10,threadPitch:1.5,headDiameter:16,headHeight:10,socketWidth:8,socketDepth:5},M12:{diameter:12,threadPitch:1.75,headDiameter:18,headHeight:12,socketWidth:10,socketDepth:6}},x0e=bt(["M2","M2.5","M3","M4","M5","M6","M8","M10","M12"]),lMn={metricSize:x0e,length:Ns,showThreads:Be().default(!0)},hMn=Ee(lMn).strict(),v7e=Ee({fn:ce("hexsocketbolt"),...lMn}).strict(),aAi=an([ce(8),ce(17),ce(23)]),cAi={8:{backFaceScrewSize:"M2",backFaceHoleDepth:2,bodyWidth:20.3,bodyLength:33,mountingHoleSpacing:16,mountingHoleDiameter:2,mountingHoleDepth:2,mountingHoleThrough:!1,pilotDiameter:15,pilotLength:1.5,shaftDiameter:4,shaftLength:15,shaftShape:"round",shaftFlatDepth:0.5,shaftFlatLength:10,shaftFlatAngle:0,frontCapLength:3.5,rearCapLength:3.5,faceCornerChamfer:0.5,bodyCornerChamfer:3},17:{backFaceScrewSize:"M3",backFaceHoleDepth:4.5,bodyWidth:42.3,bodyLength:38,mountingHoleSpacing:31,mountingHoleDiameter:3,mountingHoleDepth:4.5,mountingHoleThrough:!1,pilotDiameter:22,pilotLength:2,shaftDiameter:5,shaftLength:24,shaftShape:"d",shaftFlatDepth:0.5,shaftFlatLength:15,shaftFlatAngle:0,frontCapLength:5,rearCapLength:5,faceCornerChamfer:3,bodyCornerChamfer:6},23:{backFaceScrewSize:"M4",backFaceHoleDepth:4.5,bodyWidth:56.4,bodyLength:51,mountingHoleSpacing:47.14,mountingHoleDiameter:5,mountingHoleDepth:5,mountingHoleThrough:!0,pilotDiameter:38.1,pilotLength:1.6,shaftDiameter:6.35,shaftLength:20.6,shaftShape:"d",shaftFlatDepth:0.5,shaftFlatLength:15,shaftFlatAngle:0,frontCapLength:5,rearCapLength:5,faceCornerChamfer:2,bodyCornerChamfer:15}},dMn={nemaSize:aAi,backFace:bt(["plain","holes","screws"]).optional(),backFaceHoleSpacing:Ns.optional(),backFaceHoleDiameter:Ns.optional(),backFaceHoleDepth:Ns.optional(),backFaceScrewSize:x0e.optional(),wireConnection:an([bt(["none","stubs"]),sAi]).optional(),wireSideAngle:ge().finite().optional(),wireLength:Ns.optional(),wireDiameter:Ns.optional(),wireCount:ge().int().min(2).max(8).optional(),bodyWidth:Ns.optional(),bodyLength:Ns.optional(),mountingHoleSpacing:Ns.optional(),mountingHoleDiameter:Ns.optional(),mountingHoleDepth:Ns.optional(),mountingHoleThrough:Be().optional(),pilotDiameter:Ns.optional(),pilotLength:Ns.optional(),shaftLength:Ns.optional(),shaftDiameter:Ns.optional(),shaftShape:bt(["round","d"]).optional(),shaftFlatDepth:bx.optional(),shaftFlatLength:bx.optional(),shaftFlatAngle:ge().finite().optional(),frontCapLength:Ns.optional(),rearCapLength:Ns.optional(),faceCornerChamfer:bx.optional(),bodyCornerChamfer:bx.optional()},uMn=(e)=>{let t=cAi[e.nemaSize],n=e.backFaceScrewSize??t.backFaceScrewSize,o=j5[n];return{nemaSize:e.nemaSize,wireConnection:e.wireConnection??"stubs",wireSideAngle:((e.wireSideAngle??0)%360+360)%360,wireLength:e.wireLength??6,wireDiameter:e.wireDiameter??1.2,wireCount:e.wireCount??4,backFace:e.backFace??"screws",backFaceHoleSpacing:e.backFaceHoleSpacing??e.mountingHoleSpacing??t.mountingHoleSpacing,backFaceHoleDiameter:e.backFaceHoleDiameter??o.diameter,backFaceHoleDepth:e.backFaceHoleDepth??t.backFaceHoleDepth,backFaceScrewSize:n,bodyWidth:e.bodyWidth??t.bodyWidth,bodyLength:e.bodyLength??t.bodyLength,mountingHoleSpacing:e.mountingHoleSpacing??t.mountingHoleSpacing,mountingHoleDiameter:e.mountingHoleDiameter??t.mountingHoleDiameter,mountingHoleDepth:e.mountingHoleDepth??t.mountingHoleDepth,mountingHoleThrough:e.mountingHoleThrough??t.mountingHoleThrough,pilotDiameter:e.pilotDiameter??t.pilotDiameter,pilotLength:e.pilotLength??t.pilotLength,shaftDiameter:e.shaftDiameter??t.shaftDiameter,shaftLength:e.shaftLength??t.shaftLength,shaftShape:e.shaftShape??t.shaftShape,shaftFlatDepth:e.shaftFlatDepth??t.shaftFlatDepth,shaftFlatLength:e.shaftFlatLength??t.shaftFlatLength,shaftFlatAngle:e.shaftFlatAngle??t.shaftFlatAngle,frontCapLength:e.frontCapLength??t.frontCapLength,rearCapLength:e.rearCapLength??t.rearCapLength,faceCornerChamfer:e.faceCornerChamfer??t.faceCornerChamfer,bodyCornerChamfer:e.bodyCornerChamfer??t.bodyCornerChamfer}},pMn=(e,t)=>{let n=(i)=>t.addIssue({code:"custom",message:i});if(e.backFace!=="plain"){let i=j5[e.backFaceScrewSize],s=(e.backFace==="screws"?Math.max(e.backFaceHoleDiameter,i.headDiameter):e.backFaceHoleDiameter)/2;if(e.backFaceHoleSpacing<=2*s)n("Rear holes and screw heads must not overlap each other");if(e.backFaceHoleSpacing+2*s>=e.bodyWidth||e.bodyWidth-e.faceCornerChamfer-e.backFaceHoleSpacing<=s*Math.SQRT2)n("Rear holes and screw heads must fit entirely inside the rear face");if(e.backFaceHoleDepth>=e.rearCapLength)n("Rear hole depth must be less than the rear cap length");if(e.backFace==="screws"&&e.backFaceHoleDiameter<i.diameter)n("Rear holes must accommodate the screw diameter")}if(e.wireConnection==="stubs"){if(e.wireDiameter*e.wireCount*1.5>e.bodyWidth-2*e.faceCornerChamfer)n("Wire bundle must fit on the cap side");if(e.wireDiameter>=e.rearCapLength)n("Wire diameter must fit within the rear cap")}let o=I7e(e.wireConnection);if(o&&e.bodyWidth-2*e.faceCornerChamfer<o.bodyWidth)n("JST header must fit on the motor side");let r=e.mountingHoleDiameter/2;if(e.frontCapLength+e.rearCapLength>=e.bodyLength)n("End caps must leave a positive body length");if(e.faceCornerChamfer>=e.bodyWidth/2||e.bodyCornerChamfer>=e.bodyWidth/2)n("Chamfer must be smaller than half the body width");if(e.mountingHoleSpacing+2*r>=e.bodyWidth||e.bodyWidth-e.faceCornerChamfer-e.mountingHoleSpacing<=r*Math.SQRT2)n("Mounting holes must fit entirely inside the front face");if(e.pilotDiameter>=e.bodyWidth||e.pilotDiameter<=e.shaftDiameter)n("Pilot diameter must exceed the shaft diameter and fit inside the face");if(e.mountingHoleSpacing/Math.SQRT2<=e.pilotDiameter/2+r)n("Mounting holes must clear the pilot");if(!e.mountingHoleThrough&&e.mountingHoleDepth>=e.frontCapLength)n("Blind mounting hole depth must be less than the front cap length");if(e.mountingHoleThrough&&e.bodyWidth-e.bodyCornerChamfer-e.mountingHoleSpacing>=-r*Math.SQRT2)n("Body must clear through front mounting holes");if(e.shaftLength<=e.pilotLength)n("Shaft tip must extend beyond the pilot");if(e.shaftShape==="d"&&(e.shaftFlatDepth<=0||e.shaftFlatDepth>=e.shaftDiameter/2||e.shaftFlatLength<=0||e.shaftFlatLength>e.shaftLength-e.pilotLength))n("D flat must have positive depth less than the shaft radius and fit above the pilot")},S7e=Ee(dMn).strict().transform(uMn).superRefine(pMn),P7e=Ee({fn:ce("nema"),...dMn}).strict().transform(({fn:e,...t})=>({fn:e,...uMn(t)})).superRefine(pMn),vEn={wirelength:"wireLength",wirediameter:"wireDiameter",l:"bodyLength",length:"bodyLength",bodylength:"bodyLength",bodywidth:"bodyWidth",backholespacing:"backFaceHoleSpacing",backholediameter:"backFaceHoleDiameter",backholedepth:"backFaceHoleDepth",shaftlength:"shaftLength",shaftdiameter:"shaftDiameter",flatdepth:"shaftFlatDepth",flatlength:"shaftFlatLength",holespacing:"mountingHoleSpacing",holediameter:"mountingHoleDiameter",holedepth:"mountingHoleDepth",pilotdiameter:"pilotDiameter",pilotlength:"pilotLength",frontcap:"frontCapLength",rearcap:"rearCapLength",facechamfer:"faceCornerChamfer",bodychamfer:"bodyCornerChamfer"};function lAi(e){let t=jEn(e.string).split("_"),n=t[0]?.match(/^nema(8|17|23)$/i);if(!n)throw Error("Expected nema8, nema17 or nema23");let o={fn:"nema",nemaSize:Number(n[1])};for(let r of t.slice(1)){let i=r.match(/^([a-z]+)(.*)$/i);if(!i)throw Error(`Invalid NEMA token "${r}"`);let s=i[1].toLowerCase(),a=i[2],c,l;if(s in vEn)c=vEn[s],l=a;else if(["backfaceholes","backfacescrews","plainbackface"].includes(s)){if(a)throw Error(`NEMA flag "${s}" does not accept a value`);c="backFace",l=s==="backfaceholes"?"holes":s==="backfacescrews"?"screws":"plain"}else if(["wirestubs","nowires","jstph","jstsh"].includes(s)){let h=s==="jstph"||s==="jstsh";if(h&&!/^[1-9][0-9]*$/.test(a)||!h&&a)throw Error(`Invalid wire connection token "${r}"`);c="wireConnection",l=h?`jst-${s.slice(3)}-${a}`:s==="nowires"?"none":"stubs"}else if(s==="wirecount"){if(c="wireCount",!/^\d+$/.test(a))throw Error("wirecount requires an integer");l=Number(a)}else if(s==="backscrewm")c="backFaceScrewSize",l=`M${a}`;else if(s==="flatangle"||s==="wireangle"){if(c=s==="flatangle"?"shaftFlatAngle":"wireSideAngle",!/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:deg)?$/i.test(a))throw Error(`${s} requires a numeric angle in degrees`);l=Number(a.replace(/deg$/i,""))}else if(["round","dshaft","throughholes","blindholes"].includes(s)){if(a)throw Error(`NEMA flag "${s}" does not accept a value`);c=s==="round"||s==="dshaft"?"shaftShape":"mountingHoleThrough",l=s==="round"?"round":s==="dshaft"?"d":s==="throughholes"}else throw Error(`Unknown NEMA motor token "${r}"`);if(c in o)throw Error(`NEMA property "${c}" is set more than once`);o[c]=l}return P7e.parse(o)}var mMn=Uu({name:"nema",schema:P7e,parse:lAi});function hAi(e){e.register(mMn)}var SEn={panel:bt(["base","left","right"]),u:cd,v:cd},tlt=ss("shape",[Ee({...SEn,shape:ce("round"),diameter:Ns}).strict(),Ee({...SEn,shape:ce("slot"),length:Ns,width:Ns,axis:bt(["u","v"]).default("v")}).strict()]),_Mn={profile:bt(["plate","angle","channel"]).default("plate"),width:Ns,baseLength:Ns,flangeHeight:Ns.default(12),thickness:Ns.default(1),insideBendRadius:Ns.default(1),holes:st(tlt).max(100).default([])},gMn=Ee(_Mn).strict(),E7e=Ee({fn:ce("sheetmetal"),..._Mn}).strict();function dAi(e,t){let n=e.match(/^(hole|slot)[1-9]\d*\(([^()]+)\)$/);if(!n)throw Error(`Invalid sheet metal feature "${e}"`);let o=n[1],r={};for(let m of n[2].split("_")){let A=m.match(/^(leftofcenter|rightofcenter|abovecenter|belowcenter|r|d|l|w)([0-9.].*)$/),g=A?.[1]??m;if(g in r)throw Error(`Duplicate ${g} in ${e}`);r[g]=A?.[2]??""}let i=new Set(["bottomface","angledface","leftface","rightface","leftofcenter","rightofcenter","abovecenter","belowcenter",...o==="hole"?["r","d"]:["l","w","horizontal","vertical"]]);for(let m of Object.keys(r))if(!i.has(m))throw Error(`Unknown ${m} in ${e}`);let s=["bottomface","angledface","leftface","rightface"].filter((m)=>(m in r));if(s.length!==1)throw Error(`Specify exactly one face in ${e}`);let a=s[0];if(a==="angledface"&&t!=="angle"||["leftface","rightface"].includes(a)&&t!=="channel")throw Error(`No ${a} on ${t}`);for(let[m,A]of[["leftofcenter","rightofcenter"],["abovecenter","belowcenter"],["horizontal","vertical"],["r","d"]])if(m in r&&A in r)throw Error(`Conflicting ${m} and ${A} in ${e}`);let c=(m)=>(m in r)?Ns.parse(r[m]):0,l=c("rightofcenter")-c("leftofcenter"),h=c("abovecenter")-c("belowcenter"),d=a==="bottomface"?"base":a==="leftface"?"left":"right",u={panel:d,u:d==="base"?l:h,v:d==="base"?h:l*(d==="left"?-1:1)};if(o==="hole"){if(!("r"in r)&&!("d"in r))throw Error(`Hole requires r or d in ${e}`);return tlt.parse({...u,shape:"round",diameter:"r"in r?2*c("r"):c("d")})}if(!("l"in r)||!("w"in r))throw Error(`Slot requires l and w in ${e}`);let _=c("l"),p=c("w");if(_<p)throw Error("Slot length must be at least its width");return tlt.parse({...u,shape:"slot",length:_,width:p,axis:d==="base"===!("vertical"in r)?"u":"v"})}var uAi={w:"width",l:"baseLength",h:"flangeHeight",t:"thickness",r:"insideBendRadius"};function pAi(e){let t={},n=t_(e.string);if(n[0]!=="sheetmetal")throw Error("Expected sheetmetal");let o=[],r=new Set;for(let s of n.slice(1)){if(/^(hole|slot)[1-9]\d*\(/.test(s)){let c=s.slice(0,s.indexOf("("));if(r.has(c))throw Error(`Duplicate feature "${c}"`);r.add(c),o.push(s);continue}if(["plate","angle","channel"].includes(s)){if(t.profile)throw Error("Duplicate sheet metal profile");t.profile=s;continue}let a=uAi[s[0]];if(!a||s.length<2)throw Error(`Unknown sheet metal token "${s}"`);if(a in t)throw Error(`Duplicate sheet metal property "${a}"`);t[a]=s.slice(1)}let i=E7e.parse({fn:"sheetmetal",...t});return i.holes=o.map((s)=>dAi(s,i.profile)),i}var AMn=Uu({name:"sheetmetal",schema:E7e,parse:pAi});function mAi(e){e.register(AMn)}var _Ai=bt(["sitsFlat","sitsFlatBelowBoard","foldedToFaceAboveBoard","foldedToFaceBelowBoard","foldedToRightAngleAboveBoard","foldedToRightAngleBelowBoard"]),jct=ge().finite().positive(),gAi=k().refine((e)=>{let t=e.split(":");if(t.length!==2)return!1;let n=Number(t[0]),o=Number(t[1]);return Number.isFinite(n)&&Number.isFinite(o)&&n>0&&o>0},'Aspect ratio must look like "16:9"').transform((e)=>e),PEn=an([jct,gAi,c1([jct,jct])]),EEn=Ee({x:cd.optional(),y:cd.optional(),z:cd.optional()}).strict(),Kct=an([ge().finite(),k().min(1)]),MEn=c1([Kct,Kct,Kct]),AAi=["sitsFlat","sitsFlatBelowBoard","foldedToFaceAboveBoard","foldedToFaceBelowBoard","foldsAboveBoard","foldsBelowBoard","foldedToRightAngleAboveBoard","foldedToRightAngleBelowBoard"],fMn={width:Ns.optional(),height:Ns.optional(),diagonal:Ns.optional(),aspectRatio:PEn.optional(),ratio:PEn.optional(),defaultDiagonal:Ns.optional(),orientation:_Ai.optional(),sitsFlat:Be().optional(),sitsFlatBelowBoard:Be().optional(),foldedToFaceAboveBoard:Be().optional(),foldedToFaceBelowBoard:Be().optional(),foldsAboveBoard:Be().optional(),foldsBelowBoard:Be().optional(),foldedToRightAngleAboveBoard:Be().optional(),foldedToRightAngleBelowBoard:Be().optional(),screenThickness:Ns.optional(),bezelInset:bx.optional(),bezelDepth:Ns.optional(),activeAreaWidth:Ns.optional(),activeAreaHeight:Ns.optional(),screenColor:k().min(1).optional(),bezelColor:k().min(1).optional(),showScreen:Be().optional(),flexCableLength:Ns.optional(),flexCableWidth:Ns.optional(),flexCableThickness:Ns.optional(),flexCableColor:k().min(1).optional(),pinCount:ge().int().positive().optional(),pitch:Ns.optional(),padWidth:Ns.optional(),padLength:bx.optional(),tailLength:Ns.optional(),taperLength:Ns.optional(),conductorCount:ge().int().positive().optional(),conductorPitch:Ns.optional(),conductorWidth:Ns.optional(),conductorThickness:Ns.optional(),conductorColor:k().min(1).optional(),cableEdgeMargin:bx.optional(),exposedContactLength:bx.optional(),showConductors:Be().optional(),showFlexCable:Be().optional(),showStiffeners:Be().optional(),stiffenerLength:bx.optional(),stiffenerThickness:Ns.optional(),stiffenerColor:k().min(1).optional(),bendRadius:Ns.optional(),bendSegments:ge().int().min(2).optional(),rightAngleVerticalLead:bx.optional(),distanceAboveBoard:bx.optional(),distanceBelowBoard:bx.optional(),foldDistanceFromConnector:bx.optional(),foldOutset:Ns.optional(),foldSegments:ge().int().min(4).optional(),screenGap:bx.optional(),boardTopZ:cd.optional(),boardThickness:Ns.optional(),boardClearance:bx.optional(),cableStartX:cd.optional(),cableStartY:cd.optional(),cableStartZ:cd.optional(),cableLateralOffset:cd.optional(),screenOffset:EEn.optional(),screenRotation:MEn.optional(),rotation:MEn.optional(),offset:EEn.optional()},yMn=(e,t)=>{let n=AAi.filter((o)=>e[o]===!0);if(n.length>1)t(n[1])},xMn=(e,t)=>{if(e.flexCableLength===void 0)return;if(e.tailLength!==void 0&&e.tailLength>=e.flexCableLength)t.addIssue({code:"custom",message:"tailLength must be shorter than flexCableLength",path:["tailLength"]});if((e.tailLength??0)+(e.taperLength??0)>e.flexCableLength)t.addIssue({code:"custom",message:"tailLength and taperLength must fit within flexCableLength",path:["taperLength"]})},tma=Ee(fMn).strict().superRefine((e,t)=>{xMn(e,t),yMn(e,(n)=>{t.addIssue({code:"custom",message:"Only one FlexScreen orientation shortcut can be true",path:[n]})})}),M7e=Ee({fn:ce("flexscreen"),...fMn}).strict().superRefine((e,t)=>{xMn(e,t),yMn(e,(n)=>{t.addIssue({code:"custom",message:"Only one FlexScreen orientation shortcut can be true",path:[n]})})}),fAi={sitsflat:"sitsFlat",sitsflatbelow:"sitsFlatBelowBoard",sitsflatbelowboard:"sitsFlatBelowBoard",foldsabove:"foldedToFaceAboveBoard",foldsaboveboard:"foldedToFaceAboveBoard",foldedtofaceaboveboard:"foldedToFaceAboveBoard",foldsbelow:"foldedToFaceBelowBoard",foldsbelowboard:"foldedToFaceBelowBoard",foldedtofacebelowboard:"foldedToFaceBelowBoard",rightangleabove:"foldedToRightAngleAboveBoard",rightangleaboveboard:"foldedToRightAngleAboveBoard",foldedtorightangleaboveboard:"foldedToRightAngleAboveBoard",rightanglebelow:"foldedToRightAngleBelowBoard",rightanglebelowboard:"foldedToRightAngleBelowBoard",foldedtorightanglebelowboard:"foldedToRightAngleBelowBoard"},yAi={width:["width","w"],height:["height","h"],diagonal:["diagonal","diag","d"],defaultDiagonal:["defaultdiagonal","defaultdiag"],screenThickness:["screenthickness"],bezelInset:["bezelinset"],bezelDepth:["bezeldepth"],activeAreaWidth:["activeareawidth","activew"],activeAreaHeight:["activeareaheight","activeh"],flexCableLength:["flexcablelength","flexlength","flex"],flexCableWidth:["flexcablewidth","flexwidth"],flexCableThickness:["flexcablethickness","flexthickness"],pitch:["pitch","p"],padWidth:["padwidth","pw"],padLength:["padlength","pl"],tailLength:["taillength","tail"],taperLength:["taperlength","taper"],conductorPitch:["conductorpitch"],conductorWidth:["conductorwidth"],conductorThickness:["conductorthickness"],cableEdgeMargin:["cableedgemargin","edgemargin"],exposedContactLength:["exposedcontactlength","contactlength"],stiffenerLength:["stiffenerlength"],stiffenerThickness:["stiffenerthickness"],bendRadius:["bendradius"],rightAngleVerticalLead:["rightangleverticallead","verticallead"],distanceAboveBoard:["distanceaboveboard","distanceabove"],distanceBelowBoard:["distancebelowboard","distancebelow"],foldDistanceFromConnector:["folddistancefromconnector","folddistance","foldstart"],foldOutset:["foldoutset","outset"],screenGap:["screengap"],boardTopZ:["boardtopz"],boardThickness:["boardthickness"],boardClearance:["boardclearance"],cableStartX:["cablestartx"],cableStartY:["cablestarty"],cableStartZ:["cablestartz"],cableLateralOffset:["cablelateraloffset","lateraloffset"]},xAi=Object.fromEntries(Object.entries(yAi).flatMap(([e,t])=>t.map((n)=>[n,e]))),CAi={num_pins:"pinCount",pincount:"pinCount",conductorcount:"conductorCount",conductors:"conductorCount",bendsegments:"bendSegments",foldsegments:"foldSegments"},wEn={showscreen:["showScreen",!0],hidescreen:["showScreen",!1],showflex:["showFlexCable",!0],hideflex:["showFlexCable",!1],showconductors:["showConductors",!0],hideconductors:["showConductors",!1],showstiffeners:["showStiffeners",!0],hidestiffeners:["showStiffeners",!1]},bAi={screencolor:"screenColor",bezelcolor:"bezelColor",flexcolor:"flexCableColor",conductorcolor:"conductorColor",stiffenercolor:"stiffenerColor"},IAi=(e)=>{let t=String(e).toLowerCase().replace("x",":");if(t.includes(":")){let[o,r,i]=t.split(":"),s=Number(o),a=Number(r);if(i!==void 0||!Number.isFinite(s)||!Number.isFinite(a)||s<=0||a<=0)throw Error(`Invalid FlexScreen aspect ratio "${String(e)}"`);return`${s}:${a}`}let n=Number(t);if(!Number.isFinite(n)||n<=0)throw Error(`Invalid FlexScreen aspect ratio "${String(e)}"`);return n},vAi=(e,t)=>{if(typeof e!=="string"||!/^\(.+\)$/.test(e))throw Error(`FlexScreen token "${t}" requires a value in (...)`);return e.slice(1,-1)},BEn=(e,t)=>{if(e!==!0)throw Error(`FlexScreen token "${t}" does not accept a value`)},SAi=(e)=>{if(e.fn!=="flexscreen")throw Error(`Expected FlexScreen params, got "${e.fn}"`);let t={},n,o;for(let[r,i]of Object.entries(e)){if(r==="fn"||r==="string"||r==="flexscreen")continue;let s=fAi[r];if(s){if(BEn(i,r),n&&n!==s)throw Error("A FlexScreen model string can only set one orientation");n=s,t.orientation=s;continue}if(r in wEn){BEn(i,r);let[h,d]=wEn[r];t[h]=d;continue}let a=bAi[r];if(a){t[a]=vAi(i,r);continue}if(r==="ratio"){t.aspectRatio=IAi(i);continue}let c=xAi[r];if(c){t[c]=i;continue}if(r==="distance"){o=i;continue}let l=CAi[r];if(l){let h=Number(i);if(!Number.isInteger(h)||h<1)throw Error(`Invalid positive integer in FlexScreen token "${r}${String(i)}"`);t[l]=h;continue}throw Error(`Unknown FlexScreen model token "${r}${String(i)}"`)}if(o!==void 0)if(n==="foldedToFaceAboveBoard")t.distanceAboveBoard=o;else if(n==="foldedToFaceBelowBoard")t.distanceBelowBoard=o;else throw Error('The "distance" token requires foldsabove or foldsbelow; use distanceabove or distancebelow for an explicit side');return M7e.parse({fn:"flexscreen",...t})},CMn=Uu({name:"flexscreen",schema:M7e,parse:SAi});function PAi(e){e.register(CMn)}var EAi=(e)=>{if(e.fn!=="hexsocketbolt")throw Error(`Expected hexsocketbolt params, got "${e.fn}"`);let t=e.string.split("_");if(t[0]?.toLowerCase()!=="hexsocketbolt")throw Error("The hexsocketbolt function does not accept an inline value");let n=new Set;for(let r of t.slice(1)){let i=r.match(/^[a-z]+/i)?.[0]?.toLowerCase();if(i&&n.has(i))throw Error(`Duplicate bolt token "${i}"`);if(i)n.add(i)}let o={};for(let[r,i]of Object.entries(e)){if(["fn","string","hexsocketbolt"].includes(r))continue;let s,a=i;if(r==="m")s="metricSize",a=`M${String(i)}`;else if(r==="l"||r==="length")s="length";else if(r==="threads"||r==="nothreads"){if(i!==!0)throw Error(`Bolt token "${r}" does not accept a value`);s="showThreads",a=r==="threads"}else throw Error(`Unknown hex socket bolt model token "${r}${String(i)}"`);if(s in o)throw Error(`Bolt property "${s}" is set more than once`);o[s]=a}return v7e.parse({fn:"hexsocketbolt",...o})},bMn=Uu({name:"hexsocketbolt",schema:v7e,parse:EAi});function MAi(e){e.register(bMn)}var TEn={m:"module",module:"module",w:"faceWidth",width:"faceWidth",facewidth:"faceWidth",bore:"boreDiameter",borediameter:"boreDiameter",backlash:"backlash",clearance:"clearance",hubdiameter:"hubDiameter",hublength:"hubLength"};function wAi(e){let t=e.string.split("_"),n=t[0]?.match(/^spurgear(\d+)?$/i);if(!n||e.fn!=="spurgear")throw Error("Expected spurgear with an optional inline tooth count");let o={fn:"spurgear"};if(n[1])o.toothCount=HG(n[1],"toothCount");for(let r of t.slice(1)){let[i,s]=iee(r),a,c;if(i in TEn)a=TEn[i],c=s;else if(i==="teeth"||i==="segments")a=i==="teeth"?"toothCount":"segmentsPerTooth",c=HG(s,a);else if(i==="pa"||i==="pressureangle"||i==="phase")a=i==="phase"?"phase":"pressureAngle",c=x7e(s,a);else throw Error(`Unknown spur gear token "${r}"`);if(a in o)throw Error(`Spur gear property "${a}" is set more than once`);o[a]=c}return C7e.parse(o)}var IMn=Uu({name:"spurgear",schema:C7e,parse:wAi});function BAi(e){e.register(IMn)}var vMn={module:w0.default(1),pitchDiameter:w0.default(10),length:w0.default(20),starts:ge().int().min(1).max(8).default(1),pressureAngle:eMn.default(20),backlash:Lv.default(0),clearance:Lv.default(0.25),boreDiameter:Lv.default(0),handedness:bt(["right","left"]).default("right"),phase:ge().finite().default(0),radialSegments:ge().int().min(24).max(256).refine((e)=>e%4===0,"Radial segments must be divisible by four").default(96),segmentsPerTurn:ge().int().min(12).max(128).default(32)};function SMn(e){let t=Math.PI*e.module,n=e.starts*t;return{pitchDiameter:e.pitchDiameter,outsideDiameter:e.pitchDiameter+2*e.module,rootDiameter:e.pitchDiameter-2*(e.module+e.clearance),axialPitch:t,lead:n,leadAngle:Math.atan(n/(Math.PI*e.pitchDiameter))*180/Math.PI,toothThickness:t/2-e.backlash}}function PMn(e,t){let n=(a,c)=>t.addIssue({code:"custom",message:a,path:c?[c]:[]}),o=SMn(e);if(Object.values(o).some((a)=>!Number.isFinite(a))){n("Derived worm dimensions must be finite");return}if(o.rootDiameter<=0){n("Dedendum must leave a positive root diameter","pitchDiameter");return}if(e.boreDiameter>=o.rootDiameter)n("Bore diameter must be smaller than the root diameter","boreDiameter");let r=Math.tan(e.pressureAngle*Math.PI/180),i=o.toothThickness-2*e.module*r,s=o.toothThickness+2*(e.module+e.clearance)*r;if(!Number.isFinite(i)||i<=0)n("Axial tooth tip must have positive thickness","backlash");if(!Number.isFinite(s)||s>=o.axialPitch)n("Adjacent threads must leave a positive root gap","pressureAngle")}var slt=Ee(vMn).strict().superRefine(PMn),w7e=Ee({fn:ce("wormgear"),...vMn}).strict().superRefine(PMn),EMn=(e={})=>SMn(slt.parse(e)),DEn={m:"module",module:"module",d:"pitchDiameter",pitchdiameter:"pitchDiameter",l:"length",length:"length",bore:"boreDiameter",borediameter:"boreDiameter",backlash:"backlash",clearance:"clearance"};function TAi(e){let t=e.string.split("_");if(t[0]?.toLowerCase()!=="wormgear"||e.fn!=="wormgear")throw Error("The wormgear function does not accept an inline value");let n={fn:"wormgear"};for(let o of t.slice(1)){let[r,i]=iee(o),s,a;if(r in DEn)s=DEn[r],a=i;else if(["starts","segments","turnsegments"].includes(r))s=r==="starts"?"starts":r==="segments"?"radialSegments":"segmentsPerTurn",a=HG(i,s);else if(r==="pa"||r==="pressureangle"||r==="phase")s=r==="phase"?"phase":"pressureAngle",a=x7e(i,s);else if(r==="right"||r==="left"){if(i)throw Error(`Worm flag "${r}" does not accept a value`);s="handedness",a=r}else throw Error(`Unknown worm gear token "${o}"`);if(s in n)throw Error(`Worm gear property "${s}" is set more than once`);n[s]=a}return w7e.parse(n)}var MMn=Uu({name:"wormgear",schema:w7e,parse:TAi});function DAi(e){e.register(MMn)}var wMn={"608":{innerDiameter:8,outerDiameter:22,width:7},"625":{innerDiameter:5,outerDiameter:16,width:5},"624":{innerDiameter:4,outerDiameter:13,width:5},"6000":{innerDiameter:10,outerDiameter:26,width:8},"6001":{innerDiameter:12,outerDiameter:28,width:8},"6002":{innerDiameter:15,outerDiameter:32,width:9}},NAi={innerDiameter:8,outerDiameter:22,width:7},RAi=bt(["608","625","624","6000","6001","6002"]),$ct=an([ge(),k().regex(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:mm|cm|m|in|inch|mil|ft|feet)?$/i).transform((e)=>e.toLowerCase())]).pipe(cd).refine((e)=>e>0,"Length must be positive"),BMn={innerDiameter:$ct.optional(),outerDiameter:$ct.optional(),width:$ct.optional(),code:RAi.optional(),bothSidesOpen:Be().optional(),bothSidesShielded:Be().optional(),bothSidesSealed:Be().optional(),topSideOpen:Be().optional(),topSideShielded:Be().optional(),topSideSealed:Be().optional(),bottomSideOpen:Be().optional(),bottomSideShielded:Be().optional(),bottomSideSealed:Be().optional()};function TMn(e,t){let n=e.code===void 0?NAi:wMn[e.code],o=["Open","Shielded","Sealed"],r=o.filter((l)=>e[`bothSides${l}`]===!0);if(r.length>1)t.addIssue({code:"custom",message:"Both-side flags conflict"});let i=(l)=>{let h=o.filter((u)=>e[`${l}Side${u}`]===!0),d=o.some((u)=>e[`${l}Side${u}`]!==void 0);if(h.length>1||d&&h.length===0)t.addIssue({code:"custom",message:`${l} face must select exactly one flag`});return h[0]??r[0]??"Open"},s=i("top"),a=i("bottom"),c={innerDiameter:e.innerDiameter??n.innerDiameter,outerDiameter:e.outerDiameter??n.outerDiameter,width:e.width??n.width,topSideOpen:s==="Open",topSideShielded:s==="Shielded",topSideSealed:s==="Sealed",bottomSideOpen:a==="Open",bottomSideShielded:a==="Shielded",bottomSideSealed:a==="Sealed"};if(e.code!==void 0){for(let l of["innerDiameter","outerDiameter","width"])if(Math.abs(c[l]-n[l])>0.000000001)t.addIssue({code:"custom",path:[l],message:`Dimension conflicts with bearing designation ${e.code}`})}if(c.innerDiameter>=c.outerDiameter)t.addIssue({code:"custom",path:["innerDiameter"],message:"Inner diameter must be smaller than outer diameter"});return c}var QAi=Ee(BMn).strict().transform(TMn),B7e=Ee({fn:ce("ballbearing"),...BMn}).strict().transform((e,t)=>({fn:e.fn,...TMn(e,t)}));function DMn(e={}){let t=QAi.parse(e),n=t.innerDiameter/2,o=t.outerDiameter/2,r=(n+o)/2,i=8,s=Math.min((o-n)*0.28,t.width*0.3,r*Math.sin(Math.PI/8)*0.85),a=r-0.9*s,c=r+0.9*s,l=1.03*s;return{...t,boreRadius:n,outerRadius:o,pitchRadius:r,ballCount:8,ballRadius:s,innerRaceOuterRadius:a,outerRaceInnerRadius:c,grooveRadius:l,grooveHalfWidth:s*Math.sqrt(0.2508999999999999),rimChamfer:Math.min(t.width*0.035,(a-n)*0.1,(o-c)*0.1),closureThickness:t.width*0.1,cageInnerRadius:r-0.16*s,cageOuterRadius:r+0.16*s,cageSeparatorHalfAngle:Math.PI/8-Math.asin(1.1*s/r),midZ:t.width/2}}var NEn={id:"innerDiameter",innerdiameter:"innerDiameter",od:"outerDiameter",outerdiameter:"outerDiameter",w:"width",width:"width"},REn={open:"bothSidesOpen",bothsidesopen:"bothSidesOpen",shielded:"bothSidesShielded",bothsidesshielded:"bothSidesShielded",sealed:"bothSidesSealed",bothsidessealed:"bothSidesSealed",topsideopen:"topSideOpen",topsideshielded:"topSideShielded",topsidesealed:"topSideSealed",bottomsideopen:"bottomSideOpen",bottomsideshielded:"bottomSideShielded",bottomsidesealed:"bottomSideSealed"},kAi=["","z","zz","2z","rs","2rs"];function NMn(e){let t=t_(e.string),n=t[0]?.toLowerCase()??"";if(e.fn!=="ballbearing")throw Error("Expected ballbearing");let o={fn:"ballbearing"},r="";if(n!=="ballbearing"){let s=n.slice(11),a=Object.keys(wMn).sort((c,l)=>l.length-c.length).find((c)=>s.startsWith(c)&&kAi.some((l)=>s===c+l));if(!n.startsWith("ballbearing")||!a)throw Error(`Unsupported ballbearing designation "${n}"`);o.code=a,r=s.slice(a.length)}let i=new Set;for(let s of t.slice(1)){let a=s.toLowerCase();if(Object.hasOwn(REn,a)){let u=REn[a],_=u.startsWith("both")?"both":u.startsWith("top")?"top":"bottom";if(i.has(_))throw Error(`ballbearing ${_} face flags are repeated or conflict`);i.add(_),o[u]=!0;continue}let c=s.match(/^([a-z]+)(.*)$/i);if(!c)throw Error(`Invalid ballbearing token "${s}"`);let l=c[1].toLowerCase(),h=c[2],d;if(Object.hasOwn(NEn,l))d=NEn[l];else if(l==="code"){if(d="code",!/^\d+$/.test(h))throw Error("Bearing code must be a complete numeric designation")}else throw Error(`Unknown ballbearing token "${s}"`);if(Object.hasOwn(o,d))throw Error(`ballbearing property "${d}" is set more than once`);o[d]=h}if(!i.has("both")){let s=r==="zz"||r==="2z"?"Shielded":r==="2rs"?"Sealed":"Open";if(o[`bothSides${s}`]=!0,!i.has("bottom")&&(r==="z"||r==="rs"))o[r==="z"?"bottomSideShielded":"bottomSideSealed"]=!0}return B7e.parse(o)}function qct(e){let t=String(e);if(!t.includes("e"))return t;let[n,o]=t.split("e"),[r,i=""]=n.split("."),s=r+i,a=r.length+Number(o);if(a<=0)return`0.${"0".repeat(-a)}${s}`;if(a>=s.length)return s+"0".repeat(a-s.length);return`${s.slice(0,a)}.${s.slice(a)}`}function LAi(e){let t=NMn(nlt(e)),n=t.topSideOpen?"open":t.topSideShielded?"shielded":"sealed",o=t.bottomSideOpen?"open":t.bottomSideShielded?"shielded":"sealed",r=n===o?`bothsides${n}`:`topside${n}_bottomside${o}`;return`ballbearing_id${qct(t.innerDiameter)}mm_od${qct(t.outerDiameter)}mm_w${qct(t.width)}mm_${r}`}var RMn=Uu({name:"ballbearing",schema:B7e,parse:NMn,normalizeString:LAi});function HAi(e){e.register(RMn)}var alt={M3:{diameter:3,threadPitch:0.5,headDiameter:5.7,headHeight:1.65,crownFlatDiameter:2.6,crownRadius:3.5,socketWidth:2,socketDepth:1.04,underHeadRadius:0.3,referenceThreadLength:18},M4:{diameter:4,threadPitch:0.7,headDiameter:7.6,headHeight:2.2,crownFlatDiameter:3.8,crownRadius:4.4,socketWidth:2.5,socketDepth:1.3,underHeadRadius:0.4,referenceThreadLength:20},M5:{diameter:5,threadPitch:0.8,headDiameter:9.5,headHeight:2.75,crownFlatDiameter:5,crownRadius:5.5,socketWidth:3,socketDepth:1.56,underHeadRadius:0.45,referenceThreadLength:22},M6:{diameter:6,threadPitch:1,headDiameter:10.5,headHeight:3.3,crownFlatDiameter:6,crownRadius:5.9,socketWidth:4,socketDepth:2.08,underHeadRadius:0.5,referenceThreadLength:24}},QEn=an([ge(),k().regex(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:mm|cm|m|in|inch|mil|ft|feet)?$/i).transform((e)=>e.toLowerCase())]).pipe(cd).refine((e)=>e>0,"Length must be positive"),FAi=bt(["M3","M4","M5","M6"]),QMn={standard:bt(["iso7380-1","iso7380-1:2022"]).default("iso7380-1").transform(()=>"iso7380-1:2022"),metricSize:FAi,length:QEn,drive:ce("hexsocket").default("hexsocket"),thread:ce("full").default("full"),threadPitch:QEn.optional(),threadHand:ce("right").default("right"),threadClass:ce("6g").default("6g"),showThreads:Be().default(!0)};function kMn(e,t){let n=alt[e.metricSize];if(e.threadPitch!==void 0&&Math.abs(e.threadPitch-n.threadPitch)>0.000000001)t.addIssue({code:"custom",path:["threadPitch"],message:"ISO 7380-1 requires the tabulated coarse pitch"});if(e.length>n.referenceThreadLength)t.addIssue({code:"custom",path:["length"],message:"This family supports only lengths at or below the reference full-thread length"});if(e.length<2*n.threadPitch)t.addIssue({code:"custom",path:["length"],message:"Length must allow the fixed thread runout and tip chamfer"})}function LMn(e){return{...e,threadPitch:alt[e.metricSize].threadPitch}}var clt=Ee(QMn).strict().superRefine(kMn).transform(LMn),T7e=Ee({fn:ce("buttonscrew"),...QMn}).strict().superRefine(kMn).transform(LMn);function HMn(e){let t=clt.parse(e),n=alt[t.metricSize],o=n.crownFlatDiameter/2-n.headDiameter/2,r=n.headHeight,i=Math.hypot(o,r),s=Math.sqrt(n.crownRadius**2-i**2/4);return{...n,length:t.length,overallLength:t.length+n.headHeight,crownArcCenterR:(n.headDiameter+n.crownFlatDiameter)/4-s*r/i,crownArcCenterZ:r/2+s*o/i,threadMinorDiameter:n.diameter-5*Math.sqrt(3)/8*n.threadPitch,threadPitchDiameter:n.diameter-3*Math.sqrt(3)/8*n.threadPitch,threadRunoutLength:n.threadPitch,tipChamfer:n.threadPitch/2,bearingZ:0,tipZ:-t.length,topZ:n.headHeight}}function zAi(e){let t=t_(e.string);if(e.fn!=="buttonscrew"||t[0]?.toLowerCase()!=="buttonscrew")throw Error("Expected buttonscrew without an inline argument");let n={fn:"buttonscrew"},o={l:"length",length:"length",threadpitch:"threadPitch"},r={standard:"standard",drive:"drive",thread:"thread",threadhand:"threadHand",threadclass:"threadClass"};for(let i of t.slice(1)){let s=i.match(/^([a-z]+)(.*)$/i);if(!s)throw Error(`Invalid button screw token "${i}"`);let a=s[1].toLowerCase(),c=s[2],l,h=c;if(a==="m")l="metricSize",h=`M${c}`;else if(a in o)l=o[a];else if(a in r){if(l=r[a],!/^\([^()]+\)$/.test(c))throw Error(`Expected a parenthesized ${a}`);h=c.slice(1,-1).toLowerCase()}else if(a==="threads"||a==="nothreads"){if(c)throw Error("Thread visibility flags cannot have a value");l="showThreads",h=a==="threads"}else throw Error(`Unknown button screw token "${i}"`);if(l in n)throw Error(`Duplicate button screw property "${l}"`);n[l]=h}return T7e.parse(n)}var FMn=Uu({name:"buttonscrew",schema:T7e,parse:zAi});function OAi(e){e.register(FMn)}var oee=an([ge(),k().regex(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:mm|cm|m|in|inch|mil|ft|feet)?$/i,"Expected a complete numeric length with an optional unit")]).pipe(Ns),zMn={panelHoleDiameter:oee,innerDiameter:oee,outerDiameter:oee,height:oee,grooveWidth:oee,grooveDepth:oee,shape:ce("symmetricring").default("symmetricring")};function OMn(e,t){if(e.innerDiameter>=e.panelHoleDiameter||e.panelHoleDiameter>=e.outerDiameter)t.addIssue({code:"custom",path:["panelHoleDiameter"],message:"Diameters must satisfy ID < panel hole < OD"});if(e.grooveWidth>=e.height)t.addIssue({code:"custom",path:["grooveWidth"],message:"Groove width must leave two positive-thickness flanges"});let n=e.outerDiameter-2*e.grooveDepth,o=0.000000001*e.outerDiameter;if(!Number.isFinite(n)||Math.abs(n-e.panelHoleDiameter)>o)t.addIssue({code:"custom",path:["grooveDepth"],message:"Panel hole must equal OD minus twice the radial groove depth"});if((n-e.innerDiameter)/2<=0||(e.height-e.grooveWidth)/2<=0)t.addIssue({code:"custom",message:"Derived root wall and flange thicknesses must be positive"})}var llt=Ee(zMn).strict().superRefine(OMn),D7e=Ee({fn:ce("cablegrommet"),...zMn}).strict().superRefine(OMn);function VMn(e){let t=llt.parse(e),n=t.outerDiameter-2*t.grooveDepth;return{grooveRootDiameter:n,flangeThickness:(t.height-t.grooveWidth)/2,minimumWallThickness:(n-t.innerDiameter)/2,grooveStartZ:-t.grooveWidth/2,grooveEndZ:t.grooveWidth/2}}var kEn={panelhole:"panelHoleDiameter",panelholediameter:"panelHoleDiameter",id:"innerDiameter",innerdiameter:"innerDiameter",od:"outerDiameter",outerdiameter:"outerDiameter",h:"height",height:"height",groovew:"grooveWidth",groovewidth:"grooveWidth",grooved:"grooveDepth",groovedepth:"grooveDepth"};function VAi(e){let t=t_(e.string);if(e.fn!=="cablegrommet"||!/^cablegrommet$/i.test(t[0]))throw Error("Expected cablegrommet without an inline value");let n={fn:"cablegrommet"};for(let o of t.slice(1)){let r=o.match(/^([a-z]+)(.*)$/i),i=r?.[1]?.toLowerCase(),s=r?.[2];if(!i||!s)throw Error(`Invalid grommet token "${o}"`);let a,c=s;if(i in kEn)a=kEn[i];else if(i==="shape"){a="shape";let l=s.match(/^\(([a-z]+)\)$/i);if(!l)throw Error("Grommet shape requires parentheses");c=l[1].toLowerCase()}else throw Error(`Unknown grommet token "${o}"`);if(a in n)throw Error(`Grommet property "${a}" is set more than once`);n[a]=c}return D7e.parse(n)}var YMn=Uu({name:"cablegrommet",schema:D7e,parse:VAi});function YAi(e){e.register(YMn)}var GMn=an([ge().finite(),k().regex(/^[+]?(?:\d+(?:\.\d*)?|\.\d+)(?:mm|cm|m|in|inch|mil|ft|feet)?$/i,"Expected a complete length with a supported unit").transform((e)=>e.toLowerCase())]).pipe(cd),EL=GMn.refine((e)=>e>0,"Length must be positive"),GAi=GMn.refine((e)=>e>=0,"Length cannot be negative"),UMn={boreDiameter:EL,outerDiameter:EL,width:EL,screwZ:EL.optional(),splitWidth:EL,clampX:EL.optional(),clearanceHoleDiameter:EL.optional(),mount:ce("singleclamp").default("singleclamp"),metricSize:x0e,threadPitch:EL.optional(),threadHand:bt(["right","left"]).default("right"),threadClass:ce("6H").default("6H"),chamfer:GAi.default(0)};function hlt(e){let t=j5[e.metricSize].diameter,n=e.threadPitch??j5[e.metricSize].threadPitch;return{...e,threadPitch:n,screwZ:e.screwZ??e.width/2,clampX:e.clampX??(e.outerDiameter+e.boreDiameter)/4,clearanceHoleDiameter:e.clearanceHoleDiameter??t+0.5}}function WMn(e,t){let n=hlt(e),o=(c)=>t.addIssue({code:"custom",message:c}),r=j5[n.metricSize].diameter;if(!Number.isFinite(n.outerDiameter**2))o("Derived dimensions must be finite");let i=(n.outerDiameter-n.boreDiameter)/2;if(i<=0)o("Outer diameter must exceed the bore diameter");if(n.threadPitch>=r)o("Thread pitch must be smaller than its nominal diameter");if(n.splitWidth>=n.boreDiameter)o("Split width must be smaller than the shaft bore");if(n.clearanceHoleDiameter<=r)o("Clearance hole diameter must exceed the thread diameter");let s=n.clearanceHoleDiameter/2;if(n.clampX-s<=n.boreDiameter/2||n.clampX+s>=n.outerDiameter/2)o("Clamp hole must fit within the radial wall without intersecting the shaft bore");if(n.screwZ-s<=n.chamfer||n.screwZ+s>=n.width-n.chamfer)o("Clamp hole must clear both end faces and chamfers");if(n.chamfer>=i/2||n.chamfer>=n.width/2)o("Chamfer must leave material between the bore and exterior");let a=n.outerDiameter/2;if(n.clampX+s<a&&n.splitWidth/2>=Math.sqrt(a**2-(n.clampX+s)**2))o("Split must leave material around both sides of the clamping bore")}var dlt=Ee(UMn).strict().superRefine(WMn).transform(hlt),N7e=Ee({fn:ce("clampingshaftcollar"),...UMn}).strict().superRefine(WMn).transform((e)=>({fn:e.fn,...hlt(e)}));function XMn(e){let t=dlt.parse(e),n=j5[t.metricSize].diameter,o=t.outerDiameter/2,r=Math.sqrt(o**2-(t.clampX-t.clearanceHoleDiameter/2)**2),i=Math.sqrt(o**2-(t.clampX-n/2)**2);return{threadDiameter:n,split:{xMin:0,xMax:o,yMin:-t.splitWidth/2,yMax:t.splitWidth/2,zMin:0,zMax:t.width},clearanceHole:{start:[t.clampX,-r,t.screwZ],direction:[0,1,0],diameter:t.clearanceHoleDiameter,depth:r-t.splitWidth/2},threadedHole:{start:[t.clampX,t.splitWidth/2,t.screwZ],direction:[0,1,0],diameter:n,depth:i-t.splitWidth/2,threadPitch:t.threadPitch,threadHand:t.threadHand,threadGender:"female",threadClass:t.threadClass}}}var UAi={bore:"boreDiameter",od:"outerDiameter",mount:"mount",m:"metricSize",threadpitch:"threadPitch",threadhand:"threadHand",threadclass:"threadClass",chamfer:"chamfer",w:"width",width:"width",screwz:"screwZ",split:"splitWidth",clampx:"clampX",clearance:"clearanceHoleDiameter"};function WAi(e){let t=t_(e.string);if(e.fn!=="clampingshaftcollar"||t[0]?.toLowerCase()!=="clampingshaftcollar")throw Error("Expected an unadorned clampingshaftcollar function");let n={};for(let o of t.slice(1)){let r=o.match(/^([a-z]+)(.*)$/i),i=r?.[1]?.toLowerCase()??"",s=UAi[i];if(!s)throw Error(`Unknown clampingshaftcollar token "${o}"`);if(s in n)throw Error(`Duplicate clampingshaftcollar property "${s}"`);let a=r[2];if(!a)throw Error(`Token "${i}" requires a value`);if(["mount","threadHand","threadClass"].includes(s)){let c=a.match(/^\(([^()]+)\)$/);if(!c)throw Error(`Token "${i}" requires one parenthesized argument`);n[s]=s==="threadClass"?c[1].toUpperCase():c[1].toLowerCase()}else if(s==="metricSize"){if(!/^\d+(?:\.\d+)?$/.test(a))throw Error("m requires a unitless metric designation");n[s]=`M${a}`}else n[s]=a}return N7e.parse({fn:"clampingshaftcollar",...n})}var jMn=Uu({name:"clampingshaftcollar",schema:N7e,parse:WAi});function XAi(e){e.register(jMn)}var Jct=an([ge(),k().regex(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:mm|cm|m|in|inch|mil|ft|feet)?$/i).transform((e)=>e.toLowerCase())]).pipe(cd).refine((e)=>e>0,"Length must be positive"),LEn=ge().int().min(1).max(Number.MAX_SAFE_INTEGER),KMn={spec:ce("custom").default("custom"),outerDiameter:Jct,wireDiameter:Jct,freeLength:Jct,totalTurns:LEn.min(3),activeTurns:LEn.optional(),ends:ce("closedground").default("closedground"),hand:bt(["right","left"]).default("right"),state:ce("free").default("free")};function $Mn(e,t){if(e.outerDiameter<=2*e.wireDiameter)t.addIssue({code:"custom",path:["outerDiameter"],message:"Outer diameter must exceed twice the wire diameter to leave a positive bore"});if(e.activeTurns!==void 0&&e.activeTurns!==e.totalTurns-2)t.addIssue({code:"custom",path:["activeTurns"],message:"Closed-ground ends require totalTurns = activeTurns + 2"});let n=e.totalTurns*e.wireDiameter;if(!Number.isFinite(n)||e.freeLength<=n)t.addIssue({code:"custom",path:["freeLength"],message:"Free length must exceed the finite solid height totalTurns * wireDiameter"})}function qMn(e){return{...e,activeTurns:e.activeTurns??e.totalTurns-2}}var R7e=Ee(KMn).strict().superRefine($Mn).transform(qMn),Q7e=Ee({fn:ce("compressionspring"),...KMn}).strict().superRefine($Mn).transform(qMn);function JMn(e){let t=R7e.parse(e);return{outerDiameter:t.outerDiameter,wireDiameter:t.wireDiameter,insideDiameter:t.outerDiameter-2*t.wireDiameter,meanDiameter:t.outerDiameter-t.wireDiameter,freeLength:t.freeLength,totalTurns:t.totalTurns,activeTurns:t.activeTurns,endTurns:1,endPitch:t.wireDiameter,activePitch:(t.freeLength-2*t.wireDiameter)/t.activeTurns,solidHeight:t.totalTurns*t.wireDiameter,availableTravel:t.freeLength-t.totalTurns*t.wireDiameter,lowerBearingZ:0,upperBearingZ:t.freeLength}}function ZMn(e,t){let n=R7e.parse(e);if(!Number.isFinite(t)||t<0||t>n.totalTurns)throw Error("Turn coordinate must be finite and within [0,totalTurns]");let o=(n.outerDiameter-n.wireDiameter)/2,r=(n.freeLength-2*n.wireDiameter)/n.activeTurns,i=(n.hand==="right"?1:-1)*2*Math.PI*(t%1),s=t<=1?n.wireDiameter*t:t>=n.totalTurns-1?n.freeLength-n.wireDiameter*(n.totalTurns-t):n.wireDiameter+r*(t-1);return{x:o*Math.cos(i),y:o*Math.sin(i),z:s}}function jAi(e){let t=t_(e.string);if(e.fn!=="compressionspring"||t[0]?.toLowerCase()!=="compressionspring")throw Error("Expected compressionspring without an inline argument");let n={fn:"compressionspring"},o={od:"outerDiameter",wire:"wireDiameter",l:"freeLength",length:"freeLength",freelength:"freeLength"},r={spec:"spec",ends:"ends",hand:"hand",state:"state"};for(let i of t.slice(1)){let s=i.match(/^([a-z]+)(.*)$/i);if(!s)throw Error(`Invalid compression spring token "${i}"`);let a=s[1].toLowerCase(),c=s[2],l,h=c;if(a in o)l=o[a];else if(a==="turns"||a==="active"){if(l=a==="turns"?"totalTurns":"activeTurns",!/^\d+$/.test(c))throw Error(`${a} requires a unitless integer`);h=Number(c)}else if(a in r){if(l=r[a],!/^\([^()]+\)$/.test(c))throw Error(`Expected a parenthesized ${a}`);h=c.slice(1,-1).toLowerCase()}else throw Error(`Unknown compression spring token "${i}"`);if(l in n)throw Error(`Duplicate compression spring property "${l}"`);n[l]=h}return Q7e.parse(n)}var ewn=Uu({name:"compressionspring",schema:Q7e,parse:jAi});function KAi(e){e.register(ewn)}var g0e=an([ge(),k().regex(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:mm|cm|m|in|inch|mil|ft|feet)?$/i).transform((e)=>e.toLowerCase())]).pipe(cd).refine((e)=>e>0),twn={innerDiameter:g0e,outerDiameter:g0e,flangeDiameter:g0e,length:g0e,flangeThickness:g0e,style:ce("plainclosed").default("plainclosed")};function nwn(e,t){if(e.outerDiameter<=e.innerDiameter)t.addIssue({code:"custom",path:["outerDiameter"],message:"Sleeve outside diameter must exceed the bore diameter"});if(e.flangeDiameter<=e.outerDiameter)t.addIssue({code:"custom",path:["flangeDiameter"],message:"Flange diameter must exceed the sleeve outside diameter"});if(e.flangeThickness>=e.length)t.addIssue({code:"custom",path:["flangeThickness"],message:"Flange thickness must leave a positive projecting sleeve length"})}var ult=Ee(twn).strict().superRefine(nwn),k7e=Ee({fn:ce("flangedbushing"),...twn}).strict().superRefine(nwn);function own(e){let t=ult.parse(e);return{innerDiameter:t.innerDiameter,outerDiameter:t.outerDiameter,flangeDiameter:t.flangeDiameter,length:t.length,flangeThickness:t.flangeThickness,sleeveLength:t.length-t.flangeThickness,wallThickness:(t.outerDiameter-t.innerDiameter)/2,flangeProjection:(t.flangeDiameter-t.outerDiameter)/2,shoulderZ:t.flangeThickness}}var HEn={id:"innerDiameter",innerdiameter:"innerDiameter",od:"outerDiameter",outerdiameter:"outerDiameter",flangeod:"flangeDiameter",flangediameter:"flangeDiameter",l:"length",length:"length",flangethickness:"flangeThickness"};function $Ai(e){let t=t_(e.string);if(e.fn!=="flangedbushing"||t[0]?.toLowerCase()!=="flangedbushing")throw Error("Expected flangedbushing without an inline value");let n={fn:"flangedbushing"};for(let o of t.slice(1)){let r=o.match(/^([a-z]+)(.*)$/i);if(!r)throw Error(`Invalid flanged bushing token "${o}"`);let i=r[1].toLowerCase(),s=r[2],a,c;if(Object.hasOwn(HEn,i))a=HEn[i],c=s;else if(i==="style"){a="style";let l=s.match(/^\(([a-z]+)\)$/i);if(!l)throw Error("Style requires a parenthesized value");c=l[1].toLowerCase()}else throw Error(`Unknown flanged bushing token "${o}"`);if(Object.hasOwn(n,a))throw Error(`Flanged bushing property "${a}" is set more than once`);n[a]=c}return k7e.parse(n)}var rwn=Uu({name:"flangedbushing",schema:k7e,parse:$Ai});function qAi(e){e.register(rwn)}var T6=an([ge(),k().regex(/^(?:\d+(?:\.\d+)?|\.\d+)(?:mm|cm|m|in|inch)?$/i).transform((e)=>e.toLowerCase())]).pipe(cd).refine((e)=>e>0,"Length must be positive"),plt={M3:{diameter:3,threadPitch:0.5,headDiameter:6.72,headHeight:1.86,socketAcrossFlats:2,socketDepth:1.1,underHeadRadius:0.1,maximumThreadLength:18,headAngle:90,tipChamferAngle:45,threadFlankAngle:60,tipChamfer:0.25,threadRootDiameter:2.3865653389860224,threadPitchDiameter:2.6752404735808355},M4:{diameter:4,threadPitch:0.7,headDiameter:8.96,headHeight:2.48,socketAcrossFlats:2.5,socketDepth:1.5,underHeadRadius:0.2,maximumThreadLength:20,headAngle:90,tipChamferAngle:45,threadFlankAngle:60,tipChamfer:0.35,threadRootDiameter:3.141191474580432,threadPitchDiameter:3.5453366630131695},M5:{diameter:5,threadPitch:0.8,headDiameter:11.2,headHeight:3.1,socketAcrossFlats:3,socketDepth:1.9,underHeadRadius:0.2,maximumThreadLength:22,headAngle:90,tipChamferAngle:45,threadFlankAngle:60,tipChamfer:0.4,threadRootDiameter:4.018504542377636,threadPitchDiameter:4.480384757729337},M6:{diameter:6,threadPitch:1,headDiameter:13.44,headHeight:3.72,socketAcrossFlats:4,socketDepth:2.2,underHeadRadius:0.25,maximumThreadLength:24,headAngle:90,tipChamferAngle:45,threadFlankAngle:60,tipChamfer:0.5,threadRootDiameter:4.773130677972045,threadPitchDiameter:5.350480947161671}},JAi=bt(["M3","M4","M5","M6"]),ZAi=bt(["iso10642","iso10642:2019"]).default("iso10642").transform(()=>"iso10642:2019"),iwn={standard:ZAi,metricSize:JAi,length:T6,thread:ce("full").default("full"),drive:ce("hexsocket").default("hexsocket"),threadHand:bt(["right","left"]).default("right"),threadClass:ce("6g").default("6g"),threadGender:ce("male").default("male"),showThreads:Be().default(!0),diameter:T6.optional(),threadPitch:T6.optional(),headDiameter:T6.optional(),headHeight:T6.optional(),socketAcrossFlats:T6.optional(),socketDepth:T6.optional(),underHeadRadius:T6.optional(),maximumThreadLength:T6.optional(),headAngle:ge().finite().positive().optional(),tipChamferAngle:ge().finite().positive().optional(),threadFlankAngle:ge().finite().positive().optional(),tipChamfer:T6.optional(),threadRootDiameter:T6.optional(),threadPitchDiameter:T6.optional()},swn=(e,t)=>{let n=plt[e.metricSize];for(let o of Object.keys(n))if(e[o]!==void 0&&Math.abs(e[o]-n[o])>0.000000001)t.addIssue({code:"custom",path:[o],message:`Dimension ${o} contradicts ${e.standard} ${e.metricSize}`});if(e.length<=n.tipChamfer)t.addIssue({code:"custom",path:["length"],message:"Length must exceed the fixed tip chamfer"});if(e.length<=n.headHeight+n.underHeadRadius+n.tipChamfer)t.addIssue({code:"custom",path:["length"],message:"Overall length must leave a shank beyond the countersunk head, under-head fillet and tip chamfer"});if(e.length-n.headHeight>n.maximumThreadLength+0.000000001)t.addIssue({code:"custom",path:["length"],message:"This contract supports full-thread screws only; length exceeds the pinned thread-length range"})},awn=Ee(iwn).strict().superRefine(swn).transform((e)=>({...e,...plt[e.metricSize]})),L7e=Ee({fn:ce("flatheadscrew"),...iwn}).strict().superRefine(swn).transform((e)=>({...e,...plt[e.metricSize]})),efi={m:"metricSize",metricsize:"metricSize",l:"length",length:"length",standard:"standard",thread:"thread",drive:"drive",threadhand:"threadHand",threadclass:"threadClass",threadgender:"threadGender",diameter:"diameter",threadpitch:"threadPitch",headdiameter:"headDiameter",headheight:"headHeight",socketacrossflats:"socketAcrossFlats",socketdepth:"socketDepth",underheadradius:"underHeadRadius",maximumthreadlength:"maximumThreadLength",headangle:"headAngle",tipchamferangle:"tipChamferAngle",threadflankangle:"threadFlankAngle",tipchamfer:"tipChamfer",threadrootdiameter:"threadRootDiameter",threadpitchdiameter:"threadPitchDiameter",d:"diameter",headh:"headHeight",headd:"headDiameter",socketaf:"socketAcrossFlats",socketh:"socketDepth"},tfi=new Set(["standard","thread","drive","threadHand","threadClass","threadGender"]),nfi=(e)=>{if(e.fn!=="flatheadscrew")throw Error(`Expected flatheadscrew params, got "${e.fn}"`);let[t,...n]=t_(e.string);if(t?.toLowerCase()!=="flatheadscrew")throw Error("The flatheadscrew function does not accept an inline value");let o={};for(let r of n){let i=r.match(/^([a-z]+)(.*)$/i),s=i?.[1]?.toLowerCase(),a=i?.[2],c,l;if(s==="threads"||s==="nothreads"){if(a!=="")throw Error(`Token "${s}" does not accept a value`);c="showThreads",l=s==="threads"}else{if(c=s?efi[s]??"":"",!c||!a)throw Error(`Unknown or missing flatheadscrew token "${r}"`);if(tfi.has(c)){let h=a.match(/^\(([^()]+)\)$/)?.[1];if(!h)throw Error(`Token "${s}" requires a parenthesized selector`);l=h.toLowerCase()}else if(c==="metricSize"){let h=s==="m"?a:a.match(/^\((m\d+)\)$/i)?.[1]?.slice(1);if(!h||!/^\d+$/.test(h))throw Error("Invalid metric size");l=`M${h}`}else{if(!/^(?:\d+(?:\.\d+)?|\.\d+)(?:mm|cm|m|in|inch)?$/i.test(a))throw Error(`Invalid dimension token "${r}"`);l=["headAngle","tipChamferAngle","threadFlankAngle"].includes(c)?Number(a):a}}if(c in o)throw Error(`Property "${c}" is set more than once`);o[c]=l}return L7e.parse({fn:"flatheadscrew",...o})},cwn=Uu({name:"flatheadscrew",schema:L7e,parse:nfi});function ofi(e){e.register(cwn)}var mlt={M5:{diameter:5,threadPitch:0.8,acrossFlats:8,height:4.7,mouthDiameter:5.75},M6:{diameter:6,threadPitch:1,acrossFlats:10,height:5.2,mouthDiameter:6.75},M8:{diameter:8,threadPitch:1.25,acrossFlats:13,height:6.8,mouthDiameter:8.75},M10:{diameter:10,threadPitch:1.5,acrossFlats:16,height:8.4,mouthDiameter:10.8},M12:{diameter:12,threadPitch:1.75,acrossFlats:18,height:10.8,mouthDiameter:12.96}},rfi=bt(["M5","M6","M8","M10","M12"]),ifi=an([ge(),k().regex(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:mm|cm|m|in|inch|mil|ft|feet)?$/i).transform((e)=>e.toLowerCase())]).pipe(cd).refine((e)=>e>0,"Length must be positive"),lwn={standard:bt(["iso4032","iso4032:2023"]).default("iso4032").transform(()=>"iso4032:2023"),metricSize:rfi,threadPitch:ifi.optional(),threadHand:ce("right").default("right"),threadClass:ce("6H").default("6H"),showThreads:Be().default(!0)};function hwn(e,t){if(e.threadPitch!==void 0&&Math.abs(e.threadPitch-mlt[e.metricSize].threadPitch)>0.000000001)t.addIssue({code:"custom",path:["threadPitch"],message:"ISO 4032 requires the tabulated coarse pitch"})}function dwn(e){return{...e,threadPitch:mlt[e.metricSize].threadPitch}}var _lt=Ee(lwn).strict().superRefine(hwn).transform(dwn),H7e=Ee({fn:ce("hexnut"),...lwn}).strict().superRefine(hwn).transform(dwn);function uwn(e){let t=_lt.parse(e),n=mlt[t.metricSize],o=2*n.acrossFlats/Math.sqrt(3),r=n.diameter-5*Math.sqrt(3)/8*n.threadPitch;return{...n,acrossCorners:o,boreMinorDiameter:r,faceDiameter:n.acrossFlats,outerChamferAngle:30,outerChamferDepth:(o-n.acrossFlats)/2/Math.sqrt(3),boreChamferAngle:90,boreChamferDepth:(n.mouthDiameter-r)/2,bearingZ:0,topZ:n.height,threadDepth:n.height}}function sfi(e){let t=t_(e.string);if(e.fn!=="hexnut"||t[0]?.toLowerCase()!=="hexnut")throw Error("Expected hexnut without an inline argument");let n={fn:"hexnut"},o={standard:"standard",threadhand:"threadHand",threadclass:"threadClass"};for(let r of t.slice(1)){let i=r.match(/^([a-z]+)(.*)$/i);if(!i)throw Error(`Invalid hex nut token "${r}"`);let s=i[1].toLowerCase(),a=i[2],c,l=a;if(s==="m")c="metricSize",l=`M${a}`;else if(s==="threadpitch")c="threadPitch";else if(s in o){if(c=o[s],!/^\([^()]+\)$/.test(a))throw Error(`Expected a parenthesized ${s}`);if(l=a.slice(1,-1).toLowerCase(),c==="threadClass"&&l==="6h")l="6H"}else if(s==="threads"||s==="nothreads"){if(a)throw Error("Thread visibility flags cannot have a value");c="showThreads",l=s==="threads"}else throw Error(`Unknown hex nut token "${r}"`);if(c in n)throw Error(`Duplicate hex nut property "${c}"`);n[c]=l}return H7e.parse(n)}var pwn=Uu({name:"hexnut",schema:H7e,parse:sfi});function afi(e){e.register(pwn)}var mwn=an([ge(),k().regex(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:mm|cm|m|in|inch|mil|ft|feet)?$/i).transform((e)=>e.toLowerCase())]).pipe(cd),f7e=mwn.refine((e)=>e>0,"Length must be positive"),Zct=mwn.refine((e)=>e>=0,"Length cannot be negative"),_wn={outerDiameter:f7e.default(6),innerDiameter:f7e.default(4),startLength:Zct.default(38),endLength:Zct.default(112),bendRadius:f7e.default(60),bendAngle:ge().finite().min(0).max(180).default(90),ribPitch:f7e.default(2.25),ribDepth:Zct.default(0.25)};function gwn(e,t){if(e.outerDiameter-2*e.ribDepth<=e.innerDiameter)t.addIssue({code:"custom",path:["ribDepth"],message:"Rib roots must leave a positive wall outside the bore"});if(e.bendAngle>0&&e.bendRadius<=e.outerDiameter/2)t.addIssue({code:"custom",path:["bendRadius"],message:"Bend radius must exceed half the outside diameter"});let n=e.startLength+e.bendRadius*(e.bendAngle*Math.PI/180)+e.endLength;if(!Number.isFinite(n)||n<=0)t.addIssue({code:"custom",message:"Centerline length must be finite and positive"})}var F7e=Ee(_wn).strict().superRefine(gwn),z7e=Ee({fn:ce("hollowpositioningarmtube"),..._wn}).strict().superRefine(gwn);function glt(e){let t=F7e.parse(e),n=t.bendRadius*(t.bendAngle*Math.PI/180),o=t.outerDiameter-2*t.ribDepth;return{bendLength:n,totalLength:t.startLength+n+t.endLength,rootDiameter:o,minimumWallThickness:(o-t.innerDiameter)/2}}function Awn(e,t){let n=F7e.parse(e),{bendLength:o,totalLength:r}=glt(n);if(!Number.isFinite(t)||t<0||t>r)throw Error("Centerline distance must be within [0,totalLength]");let s=Math.min(o,Math.max(0,t-n.startLength))/n.bendRadius,a=Math.sin(s),c=Math.cos(s),l=Math.max(0,t-n.startLength-o),h=[n.bendRadius*(1-c)+l*a,0,Math.min(t,n.startLength)+n.bendRadius*a+l*c],d=[a,0,c],u=[c,0,-a];return{position:h,tangent:d,normal:u}}var FEn={od:"outerDiameter",id:"innerDiameter",start:"startLength",end:"endLength",radius:"bendRadius",pitch:"ribPitch",depth:"ribDepth"};function cfi(e){let t=t_(e.string);if(e.fn!=="hollowpositioningarmtube"||!/^hollowpositioningarmtube$/i.test(t[0]))throw Error("Expected hollowpositioningarmtube without an inline value");let n={fn:"hollowpositioningarmtube"};for(let o of t.slice(1)){let r=o.match(/^([a-z]+)(.*)$/i),i=r?.[1]?.toLowerCase(),s=r?.[2];if(!i||!s)throw Error(`Invalid hollowpositioningarmtube token "${o}"`);let a,c=s;if(i in FEn)a=FEn[i];else if(i==="angle"){if(a="bendAngle",!/^[+]?(?:\d+(?:\.\d*)?|\.\d+)$/.test(s))throw Error("Hollow positioning arm tube angle requires a unitless degree value");c=Number(s)}else throw Error(`Unknown hollowpositioningarmtube token "${o}"`);if(a in n)throw Error(`Duplicate hollowpositioningarmtube property "${a}"`);n[a]=c}return z7e.parse(n)}var fwn=Uu({name:"hollowpositioningarmtube",schema:z7e,parse:cfi});function lfi(e){e.register(fwn)}var G_=an([ge(),k().regex(/^(?:\d+(?:\.\d+)?|\.\d+)(?:mm|cm|m|in|inch)?$/i).transform((e)=>e.toLowerCase())]).pipe(cd).refine((e)=>e>0,"Length must be positive"),Alt={M3:{diameter:3,threadPitch:0.5,headDiameter:5.6,headHeight:2.4,crownRadius:5,underHeadRadius:0.1,recessNumber:1,recessReferenceDiameter:3,recessPenetration:1.4,maximumThreadLength:25,tipChamferAngle:45,threadFlankAngle:60,tipChamfer:0.25,threadRootDiameter:2.3865653389860224,threadPitchDiameter:2.6752404735808355,recessB:0.97,recessE:0.435,recessG:1.27,recessF:0.535,recessRadius:0.5,recessT1:0.34,recessAlpha:138,recessBeta:7,recessOuterWingAngle:26.5,recessInnerWingAngle:28,recessReferencePlaneHeight:2.169696007084728},M4:{diameter:4,threadPitch:0.7,headDiameter:8,headHeight:3.1,crownRadius:6.5,underHeadRadius:0.2,recessNumber:2,recessReferenceDiameter:4.4,recessPenetration:1.9,maximumThreadLength:38,tipChamferAngle:45,threadFlankAngle:60,tipChamfer:0.35,threadRootDiameter:3.141191474580432,threadPitchDiameter:3.5453366630131695,recessB:1.47,recessE:0.815,recessG:2.29,recessF:0.7,recessRadius:0.6,recessT1:0.61,recessAlpha:140,recessBeta:5.75,recessOuterWingAngle:26.5,recessInnerWingAngle:28,recessReferencePlaneHeight:2.7163714733492106},M5:{diameter:5,threadPitch:0.8,headDiameter:9.5,headHeight:3.7,crownRadius:8,underHeadRadius:0.2,recessNumber:2,recessReferenceDiameter:4.9,recessPenetration:2.4,maximumThreadLength:38,tipChamferAngle:45,threadFlankAngle:60,tipChamfer:0.4,threadRootDiameter:4.018504542377636,threadPitchDiameter:4.480384757729337,recessB:1.47,recessE:0.815,recessG:2.29,recessF:0.7,recessRadius:0.6,recessT1:0.61,recessAlpha:140,recessBeta:5.75,recessOuterWingAngle:26.5,recessInnerWingAngle:28,recessReferencePlaneHeight:3.315608971054121},M6:{diameter:6,threadPitch:1,headDiameter:12,headHeight:4.6,crownRadius:10,underHeadRadius:0.25,recessNumber:3,recessReferenceDiameter:6.9,recessPenetration:3.1,maximumThreadLength:38,tipChamferAngle:45,threadFlankAngle:60,tipChamfer:0.5,threadRootDiameter:4.773130677972045,threadPitchDiameter:5.350480947161671,recessB:2.41,recessE:2.005,recessG:3.81,recessF:0.825,recessRadius:0.8,recessT1:1.01,recessAlpha:146,recessBeta:5.75,recessOuterWingAngle:26.5,recessInnerWingAngle:28,recessReferencePlaneHeight:3.986026848459362}},hfi=bt(["M3","M4","M5","M6"]),dfi=bt(["iso7045","iso7045:2011"]).default("iso7045").transform(()=>"iso7045:2011"),ywn={standard:dfi,metricSize:hfi,length:G_,thread:ce("full").default("full"),drive:ce("phillips").default("phillips"),threadHand:bt(["right","left"]).default("right"),threadClass:ce("6g").default("6g"),threadGender:ce("male").default("male"),showThreads:Be().default(!0),recessStandard:ce("iso4757:1983").default("iso4757:1983"),recessType:ce("H").default("H"),diameter:G_.optional(),threadPitch:G_.optional(),headDiameter:G_.optional(),headHeight:G_.optional(),crownRadius:G_.optional(),underHeadRadius:G_.optional(),recessNumber:ge().finite().positive().optional(),recessReferenceDiameter:G_.optional(),recessPenetration:G_.optional(),maximumThreadLength:G_.optional(),tipChamferAngle:ge().finite().positive().optional(),threadFlankAngle:ge().finite().positive().optional(),tipChamfer:G_.optional(),threadRootDiameter:G_.optional(),threadPitchDiameter:G_.optional(),recessB:G_.optional(),recessE:G_.optional(),recessG:G_.optional(),recessF:G_.optional(),recessRadius:G_.optional(),recessT1:G_.optional(),recessAlpha:ge().finite().positive().optional(),recessBeta:ge().finite().positive().optional(),recessOuterWingAngle:ge().finite().positive().optional(),recessInnerWingAngle:ge().finite().positive().optional(),recessReferencePlaneHeight:G_.optional()},xwn=(e,t)=>{let n=Alt[e.metricSize];for(let o of Object.keys(n))if(e[o]!==void 0&&Math.abs(e[o]-n[o])>0.000000001)t.addIssue({code:"custom",path:[o],message:`Dimension ${o} contradicts ${e.standard} ${e.metricSize}`});if(e.length<=n.underHeadRadius+n.tipChamfer)t.addIssue({code:"custom",path:["length"],message:"Length must separate the under-head fillet and fixed tip chamfer"});if(e.length>n.maximumThreadLength+0.000000001)t.addIssue({code:"custom",path:["length"],message:"This contract supports full-thread screws only; length exceeds the pinned thread-length range"})},Cwn=Ee(ywn).strict().superRefine(xwn).transform((e)=>({...e,...Alt[e.metricSize]})),O7e=Ee({fn:ce("panscrew"),...ywn}).strict().superRefine(xwn).transform((e)=>({...e,...Alt[e.metricSize]})),ufi={m:"metricSize",metricsize:"metricSize",l:"length",length:"length",standard:"standard",thread:"thread",drive:"drive",threadhand:"threadHand",threadclass:"threadClass",threadgender:"threadGender",diameter:"diameter",threadpitch:"threadPitch",headdiameter:"headDiameter",headheight:"headHeight",crownradius:"crownRadius",underheadradius:"underHeadRadius",recessnumber:"recessNumber",recessreferencediameter:"recessReferenceDiameter",recesspenetration:"recessPenetration",maximumthreadlength:"maximumThreadLength",tipchamferangle:"tipChamferAngle",threadflankangle:"threadFlankAngle",tipchamfer:"tipChamfer",threadrootdiameter:"threadRootDiameter",threadpitchdiameter:"threadPitchDiameter",recessb:"recessB",recesse:"recessE",recessg:"recessG",recessf:"recessF",recessradius:"recessRadius",recesst1:"recessT1",recessalpha:"recessAlpha",recessbeta:"recessBeta",recessouterwingangle:"recessOuterWingAngle",recessinnerwingangle:"recessInnerWingAngle",recessreferenceplaneheight:"recessReferencePlaneHeight",d:"diameter",headh:"headHeight",headd:"headDiameter"},pfi=new Set(["standard","thread","drive","threadHand","threadClass","threadGender"]),mfi=(e)=>{if(e.fn!=="panscrew")throw Error(`Expected panscrew params, got "${e.fn}"`);let[t,...n]=t_(e.string);if(t?.toLowerCase()!=="panscrew")throw Error("The panscrew function does not accept an inline value");let o={};for(let r of n){let i=r.match(/^(recesst1)(.*)$/i)??r.match(/^([a-z]+)(.*)$/i),s=i?.[1]?.toLowerCase(),a=i?.[2],c,l;if(s==="threads"||s==="nothreads"){if(a!=="")throw Error(`Token "${s}" does not accept a value`);c="showThreads",l=s==="threads"}else{if(c=s?ufi[s]??"":"",!c||!a)throw Error(`Unknown or missing panscrew token "${r}"`);if(pfi.has(c)){let h=a.match(/^\(([^()]+)\)$/)?.[1];if(!h)throw Error(`Token "${s}" requires a parenthesized selector`);l=h.toLowerCase()}else if(c==="metricSize"){let h=s==="m"?a:a.match(/^\((m\d+)\)$/i)?.[1]?.slice(1);if(!h||!/^\d+$/.test(h))throw Error("Invalid metric size");l=`M${h}`}else{if(!/^(?:\d+(?:\.\d+)?|\.\d+)(?:mm|cm|m|in|inch)?$/i.test(a))throw Error(`Invalid dimension token "${r}"`);l=["recessNumber","tipChamferAngle","threadFlankAngle","recessAlpha","recessBeta","recessOuterWingAngle","recessInnerWingAngle"].includes(c)?Number(a):a}}if(c in o)throw Error(`Property "${c}" is set more than once`);o[c]=l}return O7e.parse({fn:"panscrew",...o})},bwn=Uu({name:"panscrew",schema:O7e,parse:mfi});function _fi(e){e.register(bwn)}var Iwn=an([ge(),k().regex(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:mm|cm|m|in|inch|mil|ft|feet)?$/i).transform((e)=>e.toLowerCase())]).pipe(cd),elt=Iwn.refine((e)=>e>0),vwn={innerDiameter:elt,outerDiameter:elt,length:elt,style:ce("plainclosed").default("plainclosed"),edgeChamfer:Iwn.refine((e)=>e>=0).default(0)};function Swn(e,t){if(e.outerDiameter<=e.innerDiameter)t.addIssue({code:"custom",path:["outerDiameter"],message:"Outside diameter must exceed the bore diameter"});else if(e.edgeChamfer>=(e.outerDiameter-e.innerDiameter)/4)t.addIssue({code:"custom",path:["edgeChamfer"],message:"Inner and outer rim chamfers must leave an annular end face"});if(e.edgeChamfer>=e.length/2)t.addIssue({code:"custom",path:["edgeChamfer"],message:"The two end chamfers must leave positive straight bore length"})}var flt=Ee(vwn).strict().superRefine(Swn),V7e=Ee({fn:ce("plainbushing"),...vwn}).strict().superRefine(Swn);function Pwn(e){let t=flt.parse(e);return{innerDiameter:t.innerDiameter,outerDiameter:t.outerDiameter,length:t.length,wallThickness:(t.outerDiameter-t.innerDiameter)/2,endInnerDiameter:t.innerDiameter+2*t.edgeChamfer,endOuterDiameter:t.outerDiameter-2*t.edgeChamfer,straightLength:t.length-2*t.edgeChamfer}}var zEn={id:"innerDiameter",innerdiameter:"innerDiameter",od:"outerDiameter",outerdiameter:"outerDiameter",l:"length",length:"length",edgechamfer:"edgeChamfer"};function gfi(e){let t=t_(e.string);if(e.fn!=="plainbushing"||t[0]?.toLowerCase()!=="plainbushing")throw Error("Expected plainbushing without an inline value");let n={fn:"plainbushing"};for(let o of t.slice(1)){let r=o.match(/^([a-z]+)(.*)$/i);if(!r)throw Error(`Invalid plain bushing token "${o}"`);let i=r[1].toLowerCase(),s=r[2],a,c;if(Object.hasOwn(zEn,i))a=zEn[i],c=s;else if(i==="style"){a="style";let l=s.match(/^\(([a-z]+)\)$/i);if(!l)throw Error("Style requires a parenthesized value");c=l[1].toLowerCase()}else throw Error(`Unknown plain bushing token "${o}"`);if(Object.hasOwn(n,a))throw Error(`Plain bushing property "${a}" is set more than once`);n[a]=c}return V7e.parse(n)}var Ewn=Uu({name:"plainbushing",schema:V7e,parse:gfi});function Afi(e){e.register(Ewn)}var Mwn=an([ge().finite(),k().regex(/^[+]?(?:\d+(?:\.\d*)?|\.\d+)(?:mm|cm|m|in|inch|mil|ft|feet)?$/i,"Expected a complete length with a supported unit").transform((e)=>e.toLowerCase())]).pipe(cd),ree=Mwn.refine((e)=>e>0,"Length must be positive"),ffi=Mwn.refine((e)=>e>=0,"Length cannot be negative"),wwn={boreDiameter:ree,outerDiameter:ree,boreBDiameter:ree.optional(),length:ree,screwCount:ce(4).default(4),screwEndOffset:ree.optional(),screwAngle:ge().finite().default(0),mount:ce("setscrew").default("setscrew"),metricSize:x0e,threadPitch:ree.optional(),threadHand:bt(["right","left"]).default("right"),threadClass:ce("6H").default("6H"),chamfer:ffi.default(0)};function ylt(e){let t=e.threadPitch??j5[e.metricSize].threadPitch;return{...e,threadPitch:t,boreBDiameter:e.boreBDiameter??e.boreDiameter,screwEndOffset:e.screwEndOffset??e.length/4,screwAngle:(e.screwAngle%360+360)%360}}function Bwn(e,t){let n=ylt(e),o=(a)=>t.addIssue({code:"custom",message:a}),r=j5[n.metricSize].diameter;if(!Number.isFinite(n.outerDiameter**2))o("Derived dimensions must be finite");if((n.outerDiameter-n.boreDiameter)/2<=0)o("Outer diameter must exceed the bore diameter");if(n.threadPitch>=r)o("Thread pitch must be smaller than its nominal diameter");let s=(n.outerDiameter-Math.max(n.boreDiameter,n.boreBDiameter))/2;if(s<=0)o("Both bores must be smaller than the outer diameter");if(Math.SQRT2*r>=Math.min(n.boreDiameter,n.boreBDiameter))o("Both bores must separate the perpendicular screw holes with material");if(n.chamfer>=s/2||n.chamfer>=n.length/2)o("Chamfer must leave material between the bore and exterior");if(n.screwEndOffset-r/2<=n.chamfer)o("Screw holes must clear the end chamfers");if(n.length-2*n.screwEndOffset<=r)o("Each end must have a separate, nonintersecting screw-hole plane")}var xlt=Ee(wwn).strict().superRefine(Bwn).transform(ylt),Y7e=Ee({fn:ce("rigidcoupler"),...wwn}).strict().superRefine(Bwn).transform((e)=>({fn:e.fn,...ylt(e)}));function Twn(e){let t=xlt.parse(e),n=j5[t.metricSize].diameter,o=t.outerDiameter/2,r=[{bore:t.boreDiameter,z:t.screwEndOffset,angle:t.screwAngle},{bore:t.boreDiameter,z:t.screwEndOffset,angle:t.screwAngle+90},{bore:t.boreBDiameter,z:t.length-t.screwEndOffset,angle:t.screwAngle},{bore:t.boreBDiameter,z:t.length-t.screwEndOffset,angle:t.screwAngle+90}].map((i)=>{let s=i.angle*Math.PI/180;return{start:[o*Math.cos(s),o*Math.sin(s),i.z],direction:[-Math.cos(s),-Math.sin(s),0],diameter:n,depth:o-Math.sqrt((i.bore/2)**2-(n/2)**2),threadPitch:t.threadPitch,threadHand:t.threadHand,threadGender:"female",threadClass:t.threadClass}});return{threadDiameter:n,boreADepth:t.length/2,boreBDepth:t.length/2,screwHoles:r}}var yfi={bore:"boreDiameter",od:"outerDiameter",mount:"mount",m:"metricSize",threadpitch:"threadPitch",threadhand:"threadHand",threadclass:"threadClass",chamfer:"chamfer",boreb:"boreBDiameter",l:"length",length:"length",screwcount:"screwCount",screwendoffset:"screwEndOffset",screwangle:"screwAngle"};function xfi(e){let t=t_(e.string);if(e.fn!=="rigidcoupler"||t[0]?.toLowerCase()!=="rigidcoupler")throw Error("Expected an unadorned rigidcoupler function");let n={};for(let o of t.slice(1)){let r=o.match(/^([a-z]+)(.*)$/i),i=r?.[1]?.toLowerCase()??"",s=yfi[i];if(!s)throw Error(`Unknown rigidcoupler token "${o}"`);if(s in n)throw Error(`Duplicate rigidcoupler property "${s}"`);let a=r[2];if(!a)throw Error(`Token "${i}" requires a value`);if(["mount","threadHand","threadClass"].includes(s)){let c=a.match(/^\(([^()]+)\)$/);if(!c)throw Error(`Token "${i}" requires one parenthesized argument`);n[s]=s==="threadClass"?c[1].toUpperCase():c[1].toLowerCase()}else if(s==="metricSize"){if(!/^\d+(?:\.\d+)?$/.test(a))throw Error("m requires a unitless metric designation");n[s]=`M${a}`}else if(s==="screwCount"){if(!/^\d+$/.test(a))throw Error("screwcount requires a unitless integer");n[s]=Number(a)}else if(s==="screwAngle"){if(!/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:deg)?$/i.test(a))throw Error("screwangle requires an angle in degrees");n[s]=Number(a.replace(/deg$/i,""))}else n[s]=a}return Y7e.parse({fn:"rigidcoupler",...n})}var Dwn=Uu({name:"rigidcoupler",schema:Y7e,parse:xfi});function Cfi(e){e.register(Dwn)}var Nwn=an([ge().finite(),k().regex(/^[+]?(?:\d+(?:\.\d*)?|\.\d+)(?:mm|cm|m|in|inch|mil|ft|feet)?$/i,"Expected a complete length with a supported unit").transform((e)=>e.toLowerCase())]).pipe(cd),A0e=Nwn.refine((e)=>e>0,"Length must be positive"),bfi=Nwn.refine((e)=>e>=0,"Length cannot be negative"),Rwn={boreDiameter:A0e,outerDiameter:A0e,width:A0e,screwZ:A0e.optional(),screwAngle:ge().finite().default(0),mount:ce("setscrew").default("setscrew"),metricSize:x0e,threadPitch:A0e.optional(),threadHand:bt(["right","left"]).default("right"),threadClass:ce("6H").default("6H"),chamfer:bfi.default(0)};function Clt(e){let t=e.threadPitch??j5[e.metricSize].threadPitch;return{...e,threadPitch:t,screwZ:e.screwZ??e.width/2,screwAngle:(e.screwAngle%360+360)%360}}function Qwn(e,t){let n=Clt(e),o=(s)=>t.addIssue({code:"custom",message:s}),r=j5[n.metricSize].diameter;if(!Number.isFinite(n.outerDiameter**2))o("Derived dimensions must be finite");let i=(n.outerDiameter-n.boreDiameter)/2;if(i<=0)o("Outer diameter must exceed the bore diameter");if(n.threadPitch>=r)o("Thread pitch must be smaller than its nominal diameter");if(r>=n.boreDiameter)o("Thread diameter must be smaller than the shaft bore");if(n.chamfer>=i/2||n.chamfer>=n.width/2)o("Chamfer must leave material between the bore and exterior");if(n.screwZ-r/2<=n.chamfer||n.screwZ+r/2>=n.width-n.chamfer)o("Screw hole must clear both end faces and chamfers")}var blt=Ee(Rwn).strict().superRefine(Qwn).transform(Clt),G7e=Ee({fn:ce("shaftcollar"),...Rwn}).strict().superRefine(Qwn).transform((e)=>({fn:e.fn,...Clt(e)}));function kwn(e){let t=blt.parse(e),n=j5[t.metricSize].diameter,o=t.outerDiameter/2,r=t.screwAngle*Math.PI/180;return{threadDiameter:n,wallThickness:(t.outerDiameter-t.boreDiameter)/2,screwHole:{start:[o*Math.cos(r),o*Math.sin(r),t.screwZ],direction:[-Math.cos(r),-Math.sin(r),0],diameter:n,depth:o-Math.sqrt((t.boreDiameter/2)**2-(n/2)**2),threadPitch:t.threadPitch,threadHand:t.threadHand,threadGender:"female",threadClass:t.threadClass}}}var Ifi={bore:"boreDiameter",od:"outerDiameter",mount:"mount",m:"metricSize",threadpitch:"threadPitch",threadhand:"threadHand",threadclass:"threadClass",chamfer:"chamfer",w:"width",width:"width",screwz:"screwZ",screwangle:"screwAngle"};function vfi(e){let t=t_(e.string);if(e.fn!=="shaftcollar"||t[0]?.toLowerCase()!=="shaftcollar")throw Error("Expected an unadorned shaftcollar function");let n={};for(let o of t.slice(1)){let r=o.match(/^([a-z]+)(.*)$/i),i=r?.[1]?.toLowerCase()??"",s=Ifi[i];if(!s)throw Error(`Unknown shaftcollar token "${o}"`);if(s in n)throw Error(`Duplicate shaftcollar property "${s}"`);let a=r[2];if(!a)throw Error(`Token "${i}" requires a value`);if(["mount","threadHand","threadClass"].includes(s)){let c=a.match(/^\(([^()]+)\)$/);if(!c)throw Error(`Token "${i}" requires one parenthesized argument`);n[s]=s==="threadClass"?c[1].toUpperCase():c[1].toLowerCase()}else if(s==="metricSize"){if(!/^\d+(?:\.\d+)?$/.test(a))throw Error("m requires a unitless metric designation");n[s]=`M${a}`}else if(s==="screwAngle"){if(!/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:deg)?$/i.test(a))throw Error("screwangle requires an angle in degrees");n[s]=Number(a.replace(/deg$/i,""))}else n[s]=a}return G7e.parse({fn:"shaftcollar",...n})}var Lwn=Uu({name:"shaftcollar",schema:G7e,parse:vfi});function Sfi(e){e.register(Lwn)}var Hwn=an([ge(),k().regex(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:mm|cm|m|in|inch|mil|ft|feet)?$/i).transform((e)=>e.toLowerCase())]).pipe(cd),OEn=Hwn.refine((e)=>e>0),Pfi=Hwn.refine((e)=>e>=0),Efi={M2:0.4,"M2.5":0.45,M3:0.5,M4:0.7,M5:0.8,M6:1,M8:1.25,M10:1.5,M12:1.75,M16:2,M20:2.5},Mfi=bt(["M2","M2.5","M3","M4","M5","M6","M8","M10","M12","M16","M20"]),Fwn={spec:ce("custom").default("custom"),metricSize:Mfi,length:OEn,thread:ce("full").default("full"),ends:ce("flat").default("flat"),chamfer:Pfi.default(0),threadPitch:OEn.optional(),threadHand:bt(["right","left"]).default("right")};function Ilt(e){return{...e,threadPitch:e.threadPitch??Efi[e.metricSize]}}function zwn(e,t){let n=Number(e.metricSize.slice(1)),o=Ilt(e).threadPitch;if(n-1.226869*o<=0)t.addIssue({code:"custom",path:["threadPitch"],message:"Thread pitch must leave a positive external-thread root diameter"});if(e.chamfer>=Math.min(n/2,e.length/2))t.addIssue({code:"custom",path:["chamfer"],message:"Chamfer must leave flat end faces and separate end chamfers"})}var vlt=Ee(Fwn).strict().superRefine(zwn).transform(Ilt),U7e=Ee({fn:ce("threadedrod"),...Fwn}).strict().superRefine(zwn).transform((e)=>({fn:e.fn,...Ilt(e)}));function Own(e){let t=vlt.parse(e),n=Number(t.metricSize.slice(1));return{diameter:n,length:t.length,threadPitch:t.threadPitch,pitchDiameter:n-0.649519*t.threadPitch,minorDiameter:n-1.226869*t.threadPitch,endDiameter:n-2*t.chamfer}}var VEn={l:"length",length:"length",chamfer:"chamfer",threadpitch:"threadPitch"},YEn={spec:"spec",thread:"thread",ends:"ends",threadhand:"threadHand"};function wfi(e){let t=t_(e.string);if(e.fn!=="threadedrod"||t[0]?.toLowerCase()!=="threadedrod")throw Error("Expected threadedrod without an inline value");let n={fn:"threadedrod"};for(let o of t.slice(1)){let r=o.match(/^([a-z]+)(.*)$/i);if(!r)throw Error(`Invalid threaded rod token "${o}"`);let i=r[1].toLowerCase(),s=r[2],a,c;if(i==="m"){if(a="metricSize",!/^\d+(?:\.\d+)?$/.test(s))throw Error("Metric size must be a unitless diameter");c=`M${s}`}else if(Object.hasOwn(VEn,i))a=VEn[i],c=s;else if(Object.hasOwn(YEn,i)){a=YEn[i];let l=s.match(/^\(([a-z]+)\)$/i);if(!l)throw Error(`Token "${i}" requires a parenthesized value`);c=l[1].toLowerCase()}else throw Error(`Unknown threaded rod token "${o}"`);if(Object.hasOwn(n,a))throw Error(`Threaded rod property "${a}" is set more than once`);n[a]=c}return U7e.parse(n)}var Vwn=Uu({name:"threadedrod",schema:U7e,parse:wfi});function Bfi(e){e.register(Vwn)}var Tfi=an([ge(),k().regex(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:mm|cm|m|in|inch|mil|ft|feet)?$/i).transform((e)=>e.toLowerCase())]).pipe(cd),f0e=Tfi.refine((e)=>e>0,"Length must be positive"),Ywn={outerDiameter:f0e.default(8),wireDiameter:f0e.default(0.8),turns:ge().finite().min(1).max(128).default(3.25),pitch:f0e.optional(),startLegLength:f0e.default(10),endLegLength:f0e.default(14),leftHand:Be().default(!1)};function Gwn(e){return{...e,pitch:e.pitch??e.wireDiameter*1.25}}function Uwn(e,t){if(e.outerDiameter<3*e.wireDiameter)t.addIssue({code:"custom",path:["outerDiameter"],message:"Outer diameter must be at least three wire diameters"});let n=e.pitch??e.wireDiameter*1.25;if(n<1.1*e.wireDiameter)t.addIssue({code:"custom",path:["pitch"],message:"Open coils require pitch at least 1.1 times wire diameter"});if(!Number.isFinite(Math.hypot(Math.PI*(e.outerDiameter-e.wireDiameter),n)*e.turns+e.startLegLength+e.endLegLength))t.addIssue({code:"custom",message:"Spring dimensions must remain finite"})}var W7e=Ee(Ywn).strict().superRefine(Uwn).transform(Gwn),X7e=Ee({fn:ce("torsionspring"),...Ywn}).strict().superRefine(Uwn).transform((e)=>({...Gwn(e),fn:e.fn}));function Slt(e){let t=W7e.parse(e),n=(t.outerDiameter-t.wireDiameter)/2,o=Math.hypot(2*Math.PI*n,t.pitch),r=o*t.turns;return{meanRadius:n,insideDiameter:t.outerDiameter-2*t.wireDiameter,axialAdvance:t.pitch*t.turns,lengthPerTurn:o,coilLength:r,centerlineLength:t.startLegLength+r+t.endLegLength,endPhaseDegrees:(t.leftHand?-1:1)*360*(t.turns%1),pitch:t.pitch}}function j7e(e,t){let n=W7e.parse(e),o=Slt(n);if(!Number.isFinite(t)||t<0||t>o.centerlineLength)throw Error("Distance must be within the wire centerline");let r=Math.max(0,Math.min(o.coilLength,t-n.startLegLength)),i=r/o.lengthPerTurn,s=n.leftHand?-1:1,a=s*2*Math.PI*(i%1),c=Math.cos(a),l=Math.sin(a),h=[-s*2*Math.PI*o.meanRadius*l/o.lengthPerTurn,s*2*Math.PI*o.meanRadius*c/o.lengthPerTurn,n.pitch/o.lengthPerTurn],d=[c,l,0],u=[-h[2]*l,h[2]*c,h[0]*l-h[1]*c],_=t-n.startLegLength-r;return{position:[o.meanRadius*c+_*h[0],o.meanRadius*l+_*h[1],i*n.pitch+_*h[2]],tangent:h,normal:d,binormal:u}}var GEn={od:"outerDiameter",wire:"wireDiameter",pitch:"pitch",start:"startLegLength",end:"endLegLength"};function Dfi(e){let t=t_(e.string);if(e.fn!=="torsionspring"||t[0]?.toLowerCase()!=="torsionspring")throw Error("Expected torsionspring without an inline value");let n={fn:"torsionspring"};for(let o of t.slice(1)){let r=o.toLowerCase();if(r==="left"||r==="right"){if("leftHand"in n)throw Error("Duplicate or conflicting spring handedness");n.leftHand=r==="left";continue}let i=o.match(/^([a-z]+)(.*)$/i),s=i?.[1]?.toLowerCase(),a=i?.[2];if(!s||!a)throw Error(`Invalid torsion spring token "${o}"`);let c,l=a;if(s in GEn)c=GEn[s];else if(s==="turns"){if(c="turns",!/^[+]?(?:\d+(?:\.\d*)?|\.\d+)$/.test(a))throw Error("Turns requires a unitless number");l=Number(a)}else throw Error(`Unknown torsion spring token "${o}"`);if(c in n)throw Error(`Duplicate torsion spring property "${c}"`);n[c]=l}return X7e.parse(n)}var Wwn=Uu({name:"torsionspring",schema:X7e,parse:Dfi});function Nfi(e){e.register(Wwn)}var Xwn={width:w0.default(20),height:w0.default(20),length:w0.default(100),profile:ce("fourtsolid").default("fourtsolid"),slotWidth:w0.default(6),pocketWidth:w0.default(10),pocketDepth:w0.default(2),lipThickness:w0.default(2),boreDiameter:Lv.default(0),cornerRadius:Lv.default(0)};function jwn(e,t){let n=(i,s)=>t.addIssue({code:"custom",message:i,path:[s]}),o=Math.min(e.width,e.height)/2,r=e.lipThickness+e.pocketDepth;if(!Number.isFinite(r)){n("Total groove depth must be finite","pocketDepth");return}if(e.pocketWidth<=e.slotWidth)n("A T pocket must be wider than its slot opening","pocketWidth");if(e.cornerRadius>=o)n("Corner radius must be smaller than half the section","cornerRadius");if(e.pocketWidth/2+e.cornerRadius>=o)n("Grooves must leave material before the rounded corners","pocketWidth");if(r+e.pocketWidth/2>=o)n("Adjacent perpendicular T pockets must remain separate","pocketDepth");if(e.boreDiameter/2+r>=o)n("The axial bore must remain separate from every T pocket","boreDiameter")}var Kwn=Ee(Xwn).strict().superRefine(jwn),K7e=Ee({fn:ce("tslotextrusion"),...Xwn}).strict().superRefine(jwn);var UEn={w:"width",width:"width",h:"height",height:"height",l:"length",length:"length",slot:"slotWidth",slotwidth:"slotWidth",pocket:"pocketWidth",pocketwidth:"pocketWidth",pocketd:"pocketDepth",pocketdepth:"pocketDepth",lip:"lipThickness",lipthickness:"lipThickness",bore:"boreDiameter",borediameter:"boreDiameter",corner:"cornerRadius",cornerradius:"cornerRadius"};function Rfi(e){let t=t_(e.string);if(e.fn!=="tslotextrusion"||t[0]?.toLowerCase()!==e.fn)throw Error("Expected tslotextrusion without an inline value");let n={fn:"tslotextrusion"};for(let o of t.slice(1)){let[r,i]=iee(o),s,a=i;if(r in UEn)s=UEn[r];else if(r==="profile"){s="profile";let c=i.match(/^\(([a-z]+)\)$/i);if(!c)throw Error("Profile requires one parenthesized identity");a=c[1].toLowerCase()}else throw Error(`Unknown T-slot extrusion token "${o}"`);if(s in n)throw Error(`T-slot extrusion property "${s}" is repeated`);n[s]=a}return K7e.parse(n)}var $wn=Uu({name:"tslotextrusion",schema:K7e,parse:Rfi});function Qfi(e){e.register($wn)}var qwn={width:w0.default(40),height:w0.default(40),thickness:w0.default(4),shape:ce("righttriangle").default("righttriangle"),slotCount:ce(2).default(2),slot:c1([w0,w0]).default([5,12]),centers:c1([w0,w0]).default([12,28]),edgeMargin:w0.default(1)};function Jwn(e,t){let n=(A,g)=>t.addIssue({code:"custom",message:A,path:[g]}),[o,r]=e.slot;if(r<o){n("Slot length must be at least its width","slot");return}let i=o/2,s=(r-o)/2,a=e.edgeMargin+i,[c,l]=e.centers;if(!Number.isFinite(a)){n("Derived slot centers must be finite","edgeMargin");return}if(c<=r/2||l<=r/2)n("Slots must leave material at the right-angle corner","centers");let h=Math.min(e.width,e.height)/Math.max(e.width,e.height),d=i/Math.min(e.width,e.height)*Math.hypot(1,h),u=c/e.width+a/e.height+s/e.width+d,_=a/e.width+l/e.height+s/e.height+d;if(!Number.isFinite(u)||!Number.isFinite(_)||u>=1||_>=1)n("Both complete slots must remain inside the triangular plate","centers");let p=Math.max(c-s-a,a-c-s,0),m=Math.max(l-s-a,a-l-s,0);if(Math.hypot(p,m)<=o)n("The two slots must retain a positive separating ligament","centers")}var Plt=Ee(qwn).strict().superRefine(Jwn),$7e=Ee({fn:ce("tslotgusset"),...qwn}).strict().superRefine(Jwn);function Zwn(e={}){let t=Plt.parse(e),[n,o]=t.slot,r=t.edgeMargin+n/2;return[{center:{x:t.centers[0],y:r,z:0},orientation:0,width:n,length:o,depth:t.thickness,direction:{x:0,y:0,z:1}},{center:{x:r,y:t.centers[1],z:0},orientation:90,width:n,length:o,depth:t.thickness,direction:{x:0,y:0,z:1}}]}var WEn={w:"width",width:"width",h:"height",height:"height",t:"thickness",thickness:"thickness",edgemargin:"edgeMargin"};function kfi(e){let t=t_(e.string);if(e.fn!=="tslotgusset"||t[0]?.toLowerCase()!==e.fn)throw Error("Expected tslotgusset without an inline value");let n={fn:"tslotgusset"};for(let o of t.slice(1)){let[r,i]=iee(o),s,a=i;if(r in WEn)s=WEn[r];else if(r==="slots"||r==="slotcount")s="slotCount",a=HG(i,"slotCount");else if(r==="shape"){s="shape";let c=i.match(/^\(([a-z]+)\)$/i);if(!c)throw Error("Shape requires one parenthesized identity");a=c[1].toLowerCase()}else if(r==="slot"||r==="centers"){s=r;let c=i.match(/^\(([^(),]+),([^(),]+)\)$/);if(!c)throw Error(`${r} requires two parenthesized lengths`);a=[c[1].trim(),c[2].trim()]}else throw Error(`Unknown T-slot gusset token "${o}"`);if(s in n)throw Error(`T-slot gusset property "${s}" is repeated`);n[s]=a}return $7e.parse(n)}var eBn=Uu({name:"tslotgusset",schema:$7e,parse:kfi});function Lfi(e){e.register(eBn)}var tBn={width:w0.default(20),legLength:w0.default(40),thickness:w0.default(4),angle:ce(90).default(90),holeCount:ce(2).default(2),holeDiameter:w0.default(5),holeOffset:w0.default(20),bendRadius:Lv.default(0)};function nBn(e,t){let n=(r,i)=>t.addIssue({code:"custom",message:r,path:[i]});if(!Number.isFinite(e.bendRadius+e.thickness)){n("Outside bend radius must be finite","bendRadius");return}if(e.thickness>=e.legLength)n("Thickness must be smaller than the leg length","thickness");if(e.bendRadius>=e.legLength)n("Bend radius must leave a straight portion of each leg","bendRadius");let o=e.holeDiameter/2;if(e.holeDiameter>=e.width)n("Holes must leave material at both width edges","holeDiameter");if(e.holeOffset-o<=e.bendRadius)n("Holes must lie wholly beyond the bend tangent","holeOffset");if(e.holeOffset+o>=e.legLength)n("Holes must leave material at the free leg ends","holeOffset")}var oBn=Ee(tBn).strict().superRefine(nBn),q7e=Ee({fn:ce("tslotinsidecorner"),...tBn}).strict().superRefine(nBn);var XEn={w:"width",width:"width",leg:"legLength",leglength:"legLength",t:"thickness",thickness:"thickness",hole:"holeDiameter",holediameter:"holeDiameter",offset:"holeOffset",holeoffset:"holeOffset",bendr:"bendRadius",bendradius:"bendRadius"};function Hfi(e){let t=t_(e.string);if(e.fn!=="tslotinsidecorner"||t[0]?.toLowerCase()!==e.fn)throw Error("Expected tslotinsidecorner without an inline value");let n={fn:"tslotinsidecorner"};for(let o of t.slice(1)){let[r,i]=iee(o),s,a=i;if(r in XEn)s=XEn[r];else if(r==="holes"||r==="holecount")s="holeCount",a=HG(i,"holeCount");else if(r==="angle")s="angle",a=x7e(i,"angle");else throw Error(`Unknown T-slot inside corner token "${o}"`);if(s in n)throw Error(`T-slot inside corner property "${s}" is repeated`);n[s]=a}return q7e.parse(n)}var rBn=Uu({name:"tslotinsidecorner",schema:q7e,parse:Hfi});function Ffi(e){e.register(rBn)}function iBn(e){let t=S7e.parse(e),n=t.wireSideAngle*Math.PI/180,o=Math.cos(n),r=Math.sin(n),i=Math.min(t.bodyWidth/2/Math.max(Math.abs(o),Math.abs(r)),(t.bodyWidth-t.faceCornerChamfer)/(Math.abs(o)+Math.abs(r))),s=t.shaftFlatAngle*Math.PI/180;return{frontface:{position:{x:0,y:0,z:0},direction:{x:0,y:0,z:1}},backface:{position:{x:0,y:0,z:-t.bodyLength},direction:{x:0,y:0,z:-1}},shafttip:{position:{x:0,y:0,z:t.shaftLength},direction:{x:0,y:0,z:1}},wireside:{position:{x:i*o,y:i*r,z:-t.bodyLength+t.rearCapLength/2},direction:{x:o,y:r,z:0}},shaftflat:t.shaftShape==="d"?{position:{x:(t.shaftDiameter/2-t.shaftFlatDepth)*Math.cos(s),y:(t.shaftDiameter/2-t.shaftFlatDepth)*Math.sin(s),z:t.shaftLength-t.shaftFlatLength/2},direction:{x:Math.cos(s),y:Math.sin(s),z:0}}:void 0}}var Cma=an([JEn.schema,mMn.schema,AMn.schema,CMn.schema,bMn.schema,cMn.schema,IMn.schema,MMn.schema,RMn.schema,FMn.schema,YMn.schema,jMn.schema,ewn.schema,rwn.schema,cwn.schema,pwn.schema,fwn.schema,bwn.schema,Ewn.schema,Dwn.schema,Lwn.schema,Vwn.schema,Wwn.schema,$wn.schema,eBn.schema,rBn.schema]);function zfi(e){oAi(e),iAi(e),hAi(e),mAi(e),PAi(e),MAi(e),BAi(e),DAi(e),HAi(e),OAi(e),YAi(e),XAi(e),KAi(e),qAi(e),ofi(e),afi(e),lfi(e),_fi(e),Afi(e),Cfi(e),Sfi(e),Bfi(e),Nfi(e),Qfi(e),Lfi(e),Ffi(e)}var J7e=new qgi;zfi(J7e);var Ofi=(e)=>J7e.parse(e),Vfi=(e)=>{let t=J7e.normalize(nlt(e));return{params:()=>t,json:()=>Ofi(t)}};var Yfi={string:Vfi,getModelNames:()=>J7e.getModelNames()},see=Yfi;var PWn=at(n4(),1);var EWn=at(n4(),1);var $0e=at(n4(),1);var CT=at(n4(),1),sE=at(n4(),1);var kxa=at(n4(),1);var Fxa=at(n4(),1);var SWn=Symbol("Fragment");function Xdt(e,t,...n){let o=n.length?n:t?.children!==void 0?[t.children]:[],r=[],i=(Array.isArray(o)?o:[o]).flat(1/0);for(let s of i){if(s==null||s===!1)continue;if(Array.isArray(s))r.push(...s);else r.push(s)}return{type:e,props:(t&&t.children!==void 0?{...t,children:void 0}:t)||{},children:r}}var Fr={moldedPlastic:{metalness:0,roughness:0.7},rubber:{metalness:0,roughness:0.9},sleeve:{metalness:0,roughness:0.45},tinnedLead:{metalness:0.8,roughness:0.55},goldContact:{metalness:1,roughness:0.25},copper:{metalness:1,roughness:0.35},brushedMetal:{metalness:1,roughness:0.4},steel:{metalness:1,roughness:0.25}},Ft=Symbol("Cuboid"),UUn=Symbol("Cube"),Ki=Symbol("Cylinder"),ate=Symbol("Sphere"),oA=Symbol("RoundedCuboid"),go=Symbol("Translate"),Ic=Symbol("Rotate"),rp=Symbol("Union"),jl=Symbol("Subtract"),oc=Symbol("Hull"),Kn=Symbol("Colorize"),cte=Symbol("Polygon"),lte=Symbol("ExtrudeLinear"),Ix=Symbol("RoundedCylinder"),Nd=Symbol("Custom"),$o=SWn,Pe=(e,t,n)=>Xdt(e,t),gn=(e,t,n)=>Xdt(e,t);var jdt=({hole:e,isPin1:t})=>{let n=t?"#00ff00":"#b87333";if(e.shape==="circle")return Pe(Kn,{color:n,material:Fr.copper,children:Pe(go,{offset:[e.x,e.y,-0.005],children:gn(jl,{children:[Pe(Ki,{radius:e.outer_diameter/2,height:0.01}),Pe(Ki,{radius:e.hole_diameter/2,height:0.01})]})})});if(e.shape==="circular_hole_with_rect_pad")return Pe(Kn,{color:n,material:Fr.copper,children:Pe(go,{offset:[e.x,e.y,0],children:gn(jl,{children:[Pe(Ft,{size:[e.rect_pad_width,e.rect_pad_height,0.01],center:[0,0,0]}),Pe(Ki,{radius:e.hole_diameter/2,height:0.01})]})})});if(e.shape==="pill"){let{outer_width:o,outer_height:r}=e,i=Math.min(o,r)/2,s=o>r,a=e.hole_width??0.8,c=e.hole_height??0.8;return Pe(Kn,{color:n,material:Fr.copper,children:Pe(go,{offset:[e.x,e.y,0],children:gn(jl,{children:[gn(oc,{children:[Pe(Ki,{radius:i,height:0.01,center:[s?-(o/2-i):0,s?0:-(r/2-i),0]}),Pe(Ki,{radius:i,height:0.01,center:[s?o/2-i:0,s?0:r/2-i,0]})]}),a===c?Pe(Ki,{radius:a/2,height:0.01}):gn(oc,{children:[Pe(Ki,{radius:Math.min(a,c)/2,height:0.01,center:[a>c?-(a/2-c/2):0,a>c?0:-(c/2-a/2),0]}),Pe(Ki,{radius:Math.min(a,c)/2,height:0.01,center:[a>c?a/2-c/2:0,a>c?0:c/2-a/2,0]})]})]})})})}throw Error("Shape not supported: "+e.shape)};function ju(e){return e}var bSi=class{models=new Map;register(e){if(typeof e.name!=="string"||!/^[a-z]+$/.test(e.name))throw Error("Model renderer names must contain only lowercase letters");if(this.models.has(e.name))throw Error(`Model renderer "${e.name}" is already registered`);if(e.pads!=="none"&&e.pads!=="footprinter")throw Error('Model renderer pads must be "none" or "footprinter"');let{name:t,schema:n,render:o,pads:r}=e;this.models.set(t,{name:t,schema:n,pads:r,render:(i)=>{if(!i||i.fn!==t)throw Error(`Renderer for "${t}" requires a model with fn "${t}"`);return o(i)}})}get(e){return this.models.get(e)}getModelNames(){return[...this.models.keys()]}render(e){return this.models.get(e.fn)?.render(e)}};function Ku(e){let t=[];for(let n=0;n<e.indices.length;n+=3)t.push(e.indices.slice(n,n+3).map((o)=>[e.positions[o*3],e.positions[o*3+1],e.positions[o*3+2]]));return PWn.default.geometries.geom3.fromPoints(t)}function ISi(e={},t={}){let n=DMn(e),o=vSi(t.segments);SSi([n.outerDiameter,n.boreRadius,n.width,n.outerRadius-n.boreRadius,n.ballRadius]);let{rimChamfer:r,midZ:i,grooveHalfWidth:s}=n,a=[[n.innerRaceOuterRadius-r,0],[n.innerRaceOuterRadius,r]];for(let h=0;h<=24;h++){let d=i-s+2*s*h/24;a.push([n.pitchRadius-Math.sqrt(Math.max(0,n.grooveRadius**2-(d-i)**2)),d])}a.push([n.innerRaceOuterRadius,n.width-r],[n.innerRaceOuterRadius-r,n.width],[n.boreRadius+r,n.width],[n.boreRadius,n.width-r],[n.boreRadius,r],[n.boreRadius+r,0]);let c=[[n.outerRadius-r,0],[n.outerRadius,r],[n.outerRadius,n.width-r],[n.outerRadius-r,n.width],[n.outerRaceInnerRadius+r,n.width],[n.outerRaceInnerRadius,n.width-r]];for(let h=0;h<=24;h++){let d=i+s-2*s*h/24;c.push([n.pitchRadius+Math.sqrt(Math.max(0,n.grooveRadius**2-(d-i)**2)),d])}c.push([n.outerRaceInnerRadius,r],[n.outerRaceInnerRadius+r,0]);let l=[{name:"inner race",color:"#9da4ac",mesh:zEe(a,o)},{name:"outer race",color:"#9da4ac",mesh:zEe(c,o)}];for(let h=0;h<n.ballCount;h++){let d=h*Math.PI*2/n.ballCount,u=[n.pitchRadius*Math.cos(d),n.pitchRadius*Math.sin(d),i];l.push({name:`ball ${h+1}`,color:"#d5d9df",mesh:ESi(u,n.ballRadius),center:u,radius:n.ballRadius});let _=(h+0.5)*Math.PI*2/n.ballCount;l.push({name:`cage separator ${h+1}`,color:"#b89b58",mesh:PSi(n.cageInnerRadius,n.cageOuterRadius,i-1.1*n.ballRadius,i+1.1*n.ballRadius,_-n.cageSeparatorHalfAngle,_+n.cageSeparatorHalfAngle,o)})}for(let h of[-1,1]){let d=i+(h===-1?-1.25:1.1)*n.ballRadius,u=i+(h===-1?-1.1:1.25)*n.ballRadius;l.push({name:`cage ${h<0?"lower":"upper"} band`,color:"#b89b58",mesh:zEe([[n.cageOuterRadius,d],[n.cageOuterRadius,u],[n.cageInnerRadius,u],[n.cageInnerRadius,d]],o)})}for(let h of[-1,1]){let d=h<0?n.bottomSideShielded?"shielded":n.bottomSideSealed?"sealed":"open":n.topSideShielded?"shielded":n.topSideSealed?"sealed":"open";if(d==="open")continue;let{closureThickness:u,innerRaceOuterRadius:_,outerRaceInnerRadius:p}=n,m=d==="shielded"?[[p,0],[p,u*0.45],[_,u*0.45],[_,0]]:[[p,0],[p,u],[_,u],[_,0],[_+0.15*(p-_),0.5*u],[p-0.15*(p-_),0.5*u]],A=h===-1?m:m.map(([g,f])=>[g,n.width-f]).reverse();l.push({name:`${d} ${h<0?"lower":"upper"}`,color:d==="sealed"?"#252a30":"#b5bbc3",mesh:zEe(A,o)})}return{...MSi(l),parts:l}}function vSi(e=96){if(!Number.isInteger(e)||e<96||e>192||e%24!==0)throw Error("Segments must be a multiple of 24 from 96 to 192");return e}function SSi(e){let t=Math.max(...e);if(!e.every(Number.isFinite)||t>1e6||Math.min(...e)<Math.max(0.00001,t*0.0000001))throw Error("Bearing dimensions exceed the renderer's numerical resolution")}function zEe(e,t){let n=[],o=[];for(let[r,i]of e)for(let s=0;s<t;s++){let a=s*Math.PI*2/t,c=typeof r==="number"?r:r(a);n.push(c*Math.cos(a),c*Math.sin(a),i)}for(let r=0;r<e.length;r++)for(let i=0;i<t;i++){let s=r*t+i,a=r*t+(i+1)%t,c=(r+1)%e.length*t+(i+1)%t,l=(r+1)%e.length*t+i;o.push(s,a,c,s,c,l)}return{positions:n,indices:o}}function PSi(e,t,n,o,r,i,s){let a=Math.max(2,Math.ceil((i-r)/(2*Math.PI)*s)),c=a+1,l=[[t,n],[t,o],[e,o],[e,n]],h=[],d=[];for(let[A,g]of l)for(let f=0;f<=a;f++){let y=r+(i-r)*f/a;h.push(A*Math.cos(y),A*Math.sin(y),g)}for(let A=0;A<4;A++)for(let g=0;g<a;g++){let f=A*c+g,y=f+1,x=(A+1)%4*c+g+1,C=(A+1)%4*c+g;d.push(f,y,x,f,x,C)}d.push(0,c,2*c,0,2*c,3*c);let u=a,_=c+a,p=2*c+a,m=3*c+a;return d.push(u,p,_,u,m,p),{positions:h,indices:d}}function ESi(e,t){let r=[e[0],e[1],e[2]+t],i=[];for(let a=1;a<12;a++){let c=a*Math.PI/12;for(let l=0;l<24;l++){let h=l*Math.PI*2/24;r.push(e[0]+t*Math.sin(c)*Math.cos(h),e[1]+t*Math.sin(c)*Math.sin(h),e[2]+t*Math.cos(c))}}let s=r.length/3;r.push(e[0],e[1],e[2]-t);for(let a=0;a<24;a++){let c=(a+1)%24;i.push(0,1+a,1+c);for(let h=0;h<10;h++){let d=1+h*24+a,u=1+(h+1)*24+a,_=1+(h+1)*24+c,p=1+h*24+c;i.push(d,u,_,d,_,p)}let l=241;i.push(s,l+c,l+a)}return{positions:r,indices:i}}function MSi(e){let t=[],n=[];for(let{mesh:o}of e){let r=t.length/3;t.push(...o.positions),n.push(...o.indices.map((i)=>i+r))}return{positions:t,indices:n}}function wSi({color:e,...t}){let{parts:n}=ISi(t);return Pe($o,{children:n.map((o)=>Pe(Kn,{color:e??o.color,children:Pe(Nd,{geometry:Ku(o.mesh)})},o.name))})}var BSi=ju({name:"ballbearing",schema:B7e,render:({fn:e,...t})=>Pe(wSi,{...t}),pads:"none"});function TSi(e){e.register(BSi)}function DSi(e){let t=e.radialSegments??96,n=e.segmentsPerPitch??32;if(!Number.isInteger(t)||t<24||t>192||t%12!==0||!Number.isInteger(n)||n<8||n>64)throw Error("Mesh resolution limit: radial segments must be a multiple of 12 in [24,192], pitch segments an integer in [8,64]");return{radial:t,axial:n}}function NSi(e){let t=[],n=[];return{positions:t,indices:n,ring:(s,a)=>{let c=t.length/3;for(let l=0;l<e;l++){let h=l*2*Math.PI/e,d=a(h);t.push(d*Math.cos(h),d*Math.sin(h),s)}return c},connect:(s,a)=>{for(let c=0;c<e;c++){let l=(c+1)%e;n.push(s+c,s+l,a+l,s+c,a+l,a+c)}},cap:(s,a,c)=>{let l=t.length/3;t.push(0,0,a);for(let h=0;h<e;h++){let d=(h+1)%e;n.push(l,s+(c?h:d),s+(c?d:h))}}}}function WUn(e,t){let n=Math.PI/3,o=((e-Math.PI/2+n/2)%n+n)%n-n/2;return t/2/Math.cos(o)}function RSi(e,t,n,o=1){let r=((e/n-o*t/(2*Math.PI))%1+1)%1;return Math.min(r,1-r)}function QSi(e,t={}){let n=clt.parse(e),o=HMn(e),{radial:r,axial:i}=DSi(t),s=Math.max(2,Math.ceil(n.length/o.threadPitch*i));if(s>24000||!Number.isFinite(s))throw Error("Mesh resolution limit: too many thread turns");let a=NSi(r),c=o.diameter/2,l=(o.diameter-o.threadMinorDiameter)/2,h=o.underHeadRadius,d=new Set(n.showThreads?Array.from({length:s+1},(m,A)=>-n.length+n.length*A/s):[-n.length,0]);d.add(-n.length+o.tipChamfer),d.add(-o.threadPitch);for(let m=0;m<=16;m++)d.add(-h+h*Math.sin(m*Math.PI/32));let u=-1,_=[...d].sort((m,A)=>m-A).filter((m,A,g)=>A===0||m-g[A-1]>0.0000000001);for(let m of _){let A=a.ring(m,(g)=>{let f=m>=-h?c+h-Math.sqrt(Math.max(0,h**2-(m+h)**2)):c,y=Math.min(l,Math.max(0,(RSi(m+n.length,g,o.threadPitch)-0.0625)*o.threadPitch*Math.sqrt(3))),x=f-(n.showThreads?y*Math.min(1,-m/o.threadPitch):0),C=m+n.length<o.tipChamfer?c-(o.tipChamfer-(m+n.length)):1/0;return Math.min(x,C)});if(u<0)a.cap(A,m,!1);else a.connect(u,A);u=A}let p=(m,A)=>{let g=a.ring(m,A);a.connect(u,g),u=g};p(0,()=>o.headDiameter/2);for(let m=1;m<=24;m++){let A=o.headHeight*m/24;p(A,()=>o.crownArcCenterR+Math.sqrt(Math.max(0,o.crownRadius**2-(A-o.crownArcCenterZ)**2)))}return p(o.topZ,(m)=>WUn(m,o.socketWidth)),p(o.topZ-o.socketDepth,(m)=>WUn(m,o.socketWidth)),a.cap(u,o.topZ-o.socketDepth,!0),{positions:a.positions,indices:a.indices}}function kSi(e,t){return Ku(QSi(e,t))}function LSi({color:e="#737e8f",...t}){return Pe(Kn,{color:e,children:Pe(Nd,{geometry:kSi(t)})})}var HSi=ju({name:"buttonscrew",schema:T7e,render:({fn:e,...t})=>Pe(LSi,{...t}),pads:"none"});function FSi(e){e.register(HSi)}function zSi(e,t={}){let n=llt.parse(e),o=VMn(n),r=n.innerDiameter/2,i=o.grooveRootDiameter/2,s=n.outerDiameter/2,a=t.radialSegments??96;if(!Number.isInteger(a)||a<12||a>4096||a%4!==0)throw Error("Grommet radial segments must be a multiple of four in [12,4096]");let c=Math.acos((r+i)/(2*i)),l=Math.max(a,4*Math.ceil(Math.PI/c/4));if(!Number.isFinite(l)||l>4096)throw Error("Grommet wall exceeds mesh resolution limit (4096 segments)");let h=[[r,-n.height/2],[s,-n.height/2],[s,o.grooveStartZ],[i,o.grooveStartZ],[i,o.grooveEndZ],[s,o.grooveEndZ],[s,n.height/2],[r,n.height/2]],d=[],u=[];for(let[_,p]of h)for(let m=0;m<l;m++){let A=m*2*Math.PI/l;d.push(_*Math.cos(A),_*Math.sin(A),p)}for(let _=0;_<h.length;_++){let p=_*l,m=(_+1)%h.length*l;for(let A=0;A<l;A++){let g=(A+1)%l;u.push(p+A,p+g,m+g,p+A,m+g,m+A)}}return{positions:d,indices:u}}function OSi(e){return Ku(zSi(e))}function VSi({color:e="#343943",...t}){return Pe(Kn,{color:e,children:Pe(Nd,{geometry:OSi(t)})})}var YSi=ju({name:"cablegrommet",schema:D7e,render:({fn:e,...t})=>Pe(VSi,{...t}),pads:"none"});function GSi(e){e.register(YSi)}var xT=64,MWn=24,wWn=12;function XEe(e){let t=0;for(let n of e){let o=n.threadPitch?Math.ceil(n.depth/n.threadPitch*wWn):1;if(!Number.isFinite(o)||o>768)throw Error("Shaft mount exceeds mesh resolution limit (64 thread turns per hole)");t+=(o+1)*MWn*2}if(t>1e5)throw Error("Shaft mount exceeds total mesh resolution limit")}function Kdt({outerRadius:e,boreARadius:t,boreBRadius:n=t,length:o,chamfer:r,stepZ:i=o/2}){let s=Math.PI/xT,a=Math.cos(s);if((Math.max(t,n)+r)/a>=(e-r)*a-0.000001)throw Error("Shaft mount wall/chamfer ligament exceeds mesh resolution limit");let c=[[0,e-r,!1],[r,e,!1],[o-r,e,!1],[o,e-r,!1],[o,n+r,!0],[o-r,n,!0],[i,n,!0],[i,t,!0],[r,t,!0],[0,t+r,!0]],l=c.filter(([u,_],p)=>p===0||u!==c[p-1][0]||_!==c[p-1][1]),h=[],d=[];for(let[u,_,p]of l)for(let m=0;m<xT;m++){let A=(m+(p?0.5:0))*Math.PI*2/xT,g=p?_/a:_;h.push(g*Math.cos(A),g*Math.sin(A),u)}for(let u=0;u<l.length;u++)for(let _=0;_<xT;_++){let p=(_+1)%xT,m=u*xT+_,A=u*xT+p,g=(u+1)%l.length*xT+p,f=(u+1)%l.length*xT+_;d.push(m,A,g,m,g,f)}return Ku({positions:h,indices:d})}function WEe(e){XEe([e]);let t=e.threadPitch,n=t?Math.max(2,Math.ceil(e.depth/t*wWn)):1,o=t?MWn:48,r=0.0001,i=e.diameter/2,s=t?Math.min(t*0.541266,i*0.8):0,a=e.threadHand==="left"?-1:1,c=[],l=[],[h,d,u]=e.direction;if(Math.abs(u)>0.0000000001||Math.abs(Math.hypot(h,d)-1)>0.0000000001)throw Error("Expected a horizontal unit hole axis");let _=(p,m,A)=>{c.push(e.start[0]+m*d+A*h,e.start[1]-m*h+A*d,e.start[2]+p)};for(let p=0;p<=n;p++){let m=-r+(e.depth+2*r)*p/n;for(let A=0;A<o;A++){let g=A*Math.PI*2/o,f=t?((m/t-a*g/(Math.PI*2))%1+1)%1:0,y=Math.min(f,1-f),x=i-Math.min(s,Math.max(0,(y-0.125)*(t??0)*Math.sqrt(3)));_(x*Math.cos(g),x*Math.sin(g),m)}}for(let p=0;p<n;p++)for(let m=0;m<o;m++){let A=(m+1)%o,g=p*o+m,f=p*o+A,y=(p+1)*o+A,x=(p+1)*o+m;l.push(g,f,y,g,y,x)}for(let p of[0,n]){let m=c.length/3;_(0,0,p===0?-r:e.depth+r);for(let A=0;A<o;A++){let g=p*o+A,f=p*o+(A+1)%o;l.push(m,p===0?f:g,p===0?g:f)}}return Ku({positions:c,indices:l})}function $dt(e,...t){let o=[e,...t].map((i)=>$0e.default.transforms.scale([100,100,100],i)),r=$0e.default.booleans.subtract(o[0],...o.slice(1));return $0e.default.transforms.scale([0.01,0.01,0.01],r)}function qdt(e){let t=[],n=new Map,o=0.000001,r=(p)=>{let m=p.map((f)=>Math.floor(f/0.000001));for(let f=-1;f<=1;f++)for(let y=-1;y<=1;y++)for(let x=-1;x<=1;x++){let C=n.get([m[0]+f,m[1]+y,m[2]+x].join(","))??[];for(let b of C)if(Math.hypot(...p.map((I,v)=>I-t[b*3+v]))<0.000001)return b}let A=t.length/3;t.push(...p);let g=m.join(",");return n.set(g,[...n.get(g)??[],A]),A},i=$0e.default.geometries.geom3.toPolygons(e).map((p)=>p.vertices.map(r).filter((m,A,g)=>m!==g[(A+g.length-1)%g.length])).map((p)=>[...new Set(p)]).filter((p)=>p.length>=3).filter((p)=>{let m=0,A=[],g=[];for(let f=0;f<p.length;f++)for(let y=f+1;y<p.length;y++){let x=t.slice(p[f]*3,p[f]*3+3),C=t.slice(p[y]*3,p[y]*3+3).map((I,v)=>I-x[v]),b=C.reduce((I,v)=>I+v*v,0);if(b>m)m=b,A=x,g=C}return p.some((f)=>{let y=t.slice(f*3,f*3+3).map((C,b)=>C-A[b]),x=y.reduce((C,b,I)=>C+b*g[I],0)/m;return Math.hypot(...y.map((C,b)=>C-x*g[b]))>=0.000001})}),s=(p,m)=>`${Math.min(p,m)},${Math.max(p,m)}`,a=new Map;for(let p of i)for(let m=0;m<p.length;m++){let A=p[m],g=p[(m+1)%p.length],f=s(A,g),y=a.get(f)??{a:A,b:g,count:0};y.count++,a.set(f,y)}let c=[...a.values()].filter((p)=>p.count===1),l=[...new Set(c.flatMap((p)=>[p.a,p.b]))],h=new Map;for(let{a:p,b:m}of c){let A=t.slice(p*3,p*3+3),g=t.slice(m*3,m*3+3).map((x,C)=>x-A[C]),f=g.reduce((x,C)=>x+C*C,0),y=[];for(let x of l){if(x===p||x===m)continue;let C=t.slice(x*3,x*3+3).map((v,P)=>v-A[P]),b=C.reduce((v,P,M)=>v+P*g[M],0)/f;if(b<=0||b>=1)continue;if(Math.hypot(...C.map((v,P)=>v-b*g[P]))<0.000001)y.push({id:x,t:b})}y.sort((x,C)=>x.t-C.t),h.set(`${p},${m}`,y.map((x)=>x.id)),h.set(`${m},${p}`,y.map((x)=>x.id).reverse())}let d=[];for(let p of i){let m=p.flatMap((f,y)=>[f,...(h.get(`${f},${p[(y+1)%p.length]}`)??[]).filter((x)=>!p.includes(x))]),A=m.filter((f,y)=>f!==m[(y+m.length-1)%m.length]);if(A.length===3){d.push(...A);continue}let g=t.length/3;t.push(...[0,1,2].map((f)=>A.reduce((y,x)=>y+t[x*3+f],0)/A.length));for(let f=0;f<A.length;f++)d.push(g,A[f],A[(f+1)%A.length])}let u=[],_=new Map;return{positions:u,indices:d.map((p)=>{let m=_.get(p);if(m===void 0)m=u.length/3,_.set(p,m),u.push(...t.slice(p*3,p*3+3));return m})}}function USi(e){let t=dlt.parse(e),n=XMn(t);XEe([n.threadedHole]);let o=Kdt({outerRadius:t.outerDiameter/2,boreARadius:t.boreDiameter/2,length:t.width,chamfer:t.chamfer}),r=n.split,i=0.0001,s=EWn.default.primitives.cuboid({size:[r.xMax-r.xMin+i,r.yMax-r.yMin,r.zMax-r.zMin+2*i],center:[(r.xMax+r.xMin+i)/2,(r.yMax+r.yMin)/2,(r.zMax+r.zMin)/2]});return qdt($dt(o,s,WEe(n.clearanceHole),WEe(n.threadedHole)))}function WSi(e){return Ku(USi(e))}function XSi({color:e="#737e8f",...t}){return Pe(Kn,{color:e,children:Pe(Nd,{geometry:WSi(t)})})}var jSi=ju({name:"clampingshaftcollar",schema:N7e,render:({fn:e,...t})=>Pe(XSi,{...t}),pads:"none"});function KSi(e){e.register(jSi)}function $Si(e,t,n){let o=[],r=32*Number.EPSILON*(n-t);for(let m=0;m<e.positions.length/3;m++)o.push({key:`v${m}`,coordinates:[e.positions[m*3],e.positions[m*3+1],Math.abs(e.positions[m*3+2]-t)<=r?t:Math.abs(e.positions[m*3+2]-n)<=r?n:e.positions[m*3+2]]});let i=new Map,s=(m,A,g)=>{if(m.coordinates[2]===g)return m;if(A.coordinates[2]===g)return A;let[f,y]=m.key<A.key?[m,A]:[A,m],x=`${g}:${f.key}:${y.key}`,C=i.get(x);if(!C){let b=(g-f.coordinates[2])/(y.coordinates[2]-f.coordinates[2]);C={key:x,coordinates:[f.coordinates[0]+b*(y.coordinates[0]-f.coordinates[0]),f.coordinates[1]+b*(y.coordinates[1]-f.coordinates[1]),g]},i.set(x,C)}return C},a=(m,A,g)=>{let f=[],y=(x)=>g?x.coordinates[2]>=A:x.coordinates[2]<=A;for(let x=0;x<m.length;x++){let C=m[x],b=m[(x+1)%m.length];if(y(C))f.push(C);if(y(C)!==y(b))f.push(s(C,b,A))}return f.filter((x,C)=>x.key!==f[(C+f.length-1)%f.length]?.key)},c=[],l=[],h=new Map,d=(m)=>{let A=h.get(m.key);if(A===void 0)A=c.length/3,c.push(...m.coordinates),h.set(m.key,A);return A};for(let m=0;m<e.indices.length;m+=3){let A=e.indices.slice(m,m+3).map((f)=>o[f]),g=a(a(A,t,!0),n,!1);for(let f=1;f+1<g.length;f++){let y=[g[0],g[f],g[f+1]];if(new Set(y.map((x)=>x.key)).size===3)l.push(...y.map(d))}}let u=new Map;for(let m=0;m<l.length;m+=3)for(let A=0;A<3;A++){let g=l[m+A],f=l[m+(A+1)%3],y=`${Math.min(g,f)},${Math.max(g,f)}`,x=u.get(y);if(x)x.count++;else u.set(y,{from:g,to:f,count:1})}let _=[...u.values()].filter((m)=>m.count===1),p=new Map(_.map(({from:m,to:A})=>[m,A]));if(p.size!==_.length)throw Error("Ground clipping produced an ambiguous boundary");while(p.size>0){let m=p.keys().next().value,A=[],g=m;do{A.push(g);let C=p.get(g);if(C===void 0)throw Error("Ground clipping produced an open boundary");p.delete(g),g=C}while(g!==m);let f=c[3*m+2];if(f!==t&&f!==n||A.some((C)=>c[3*C+2]!==f))throw Error("Ground clipping boundary must lie on an end plane");let y=A.flatMap((C)=>[c[3*C],c[3*C+1]]),x=V9(y);for(let C=0;C<x.length;C+=3){let b=A[x[C]],I=A[x[C+1]],v=A[x[C+2]],P=(c[I*3]-c[b*3])*(c[v*3+1]-c[b*3+1])-(c[I*3+1]-c[b*3+1])*(c[v*3]-c[b*3]);if(f===t&&P>0||f===n&&P<0)[I,v]=[v,I];l.push(b,I,v)}}return{positions:c,indices:l}}function qSi(e,t={}){let n=R7e.parse(e),o=JMn(n),r=t.segmentsPerTurn??64,i=t.wireSegments??24;for(let[u,_,p,m]of[["segmentsPerTurn",r,16,256],["wireSegments",i,8,64]])if(!Number.isInteger(_)||_<p||_>m||_%4!==0)throw Error(`${u} must be a multiple of four in [${p},${m}]`);let s=n.totalTurns*r;if(!Number.isSafeInteger(s)||(s+1)*i>250000)throw Error("Spring exceeds mesh resolution limit (250000 vertices)");let a=Math.max(n.outerDiameter,n.freeLength);if(o.activePitch-n.wireDiameter<=a*0.0000000001||n.wireDiameter<=a*0.0000000001||o.insideDiameter<=a*0.0000000001)throw Error("Spring clearance exceeds mesh resolution limit");let c=[],l=[],h=n.wireDiameter/2;for(let u=0;u<=s;u++){let _=ZMn(n,u/r),p=Math.hypot(_.x,_.y);for(let m=0;m<i;m++){let A=m*2*Math.PI/i,g=m===i/4||m===3*i/4?0:Math.cos(A),f=m===0||m===i/2?0:Math.sin(A),y=h*g;c.push(_.x+y*_.x/p,_.y+y*_.y/p,_.z+h*f)}}let d=(u,_,p)=>{if(n.hand==="left")l.push(u,p,_);else l.push(u,_,p)};for(let u=0;u<s;u++)for(let _=0;_<i;_++){let p=(_+1)%i,m=u*i,A=(u+1)*i;d(m+_,A+_,A+p),d(m+_,A+p,m+p)}for(let u=1;u+1<i;u++){d(0,u,u+1);let _=s*i;d(_,_+u+1,_+u)}return $Si({positions:c,indices:l},o.lowerBearingZ,o.upperBearingZ)}function JSi(e){return Ku(qSi(e))}function ZSi({color:e="#737e8f",...t}){return Pe(Kn,{color:e,children:Pe(Nd,{geometry:JSi(t)})})}var ePi=ju({name:"compressionspring",schema:Q7e,render:({fn:e,...t})=>Pe(ZSi,{...t}),pads:"none"});function tPi(e){e.register(ePi)}function nPi(e){let t=ult.parse(e),n=own(t),o=n.innerDiameter/2,r=n.outerDiameter/2,i=n.flangeDiameter/2,s=[[i,0],[i,n.shoulderZ],[r,n.shoulderZ],[r,n.length],[o,n.length],[o,0]],a=96,c=[],l=[];for(let[h,d]of s)for(let u=0;u<96;u++){let _=u*Math.PI*2/96;c.push(h*Math.cos(_),h*Math.sin(_),d)}for(let h=0;h<s.length;h++){let d=h*96,u=(h+1)%s.length*96;for(let _=0;_<96;_++){let p=(_+1)%96;l.push(d+_,d+p,u+p,d+_,u+p,u+_)}}return{positions:c,indices:l}}function oPi(e){return Ku(nPi(e))}function rPi({color:e="#a18450",...t}){return Pe(Kn,{color:e,children:Pe(Nd,{geometry:oPi(t)})})}var iPi=ju({name:"flangedbushing",schema:k7e,render:({fn:e,...t})=>Pe(rPi,{...t}),pads:"none"});function sPi(e){e.register(iPi)}function aPi(e,t={}){let n=awn.parse(e),o=t.radialSegments??96,r=t.threadStepsPerTurn??24;if(!Number.isInteger(o)||o<24||o>192||o%24!==0||!Number.isInteger(r)||r<24||r>96)throw Error("Screw mesh resolution requires 24..192 radial segments divisible by 24 and 24..96 thread steps");let i=[],s=[],a=new Map,c=(v,P,M)=>{let B=[v,P,M].map((D)=>Math.round(D*10000000000)).join(":"),T=a.get(B);if(T!==void 0)return T;let N=i.length/3;return i.push(v,P,M),a.set(B,N),N},l=(v,P,M)=>{if(v===P||P===M||M===v)return;let B=(O)=>i.slice(3*O,3*O+3),T=B(v),N=B(P),D=B(M),L=N.map((O,U)=>O-T[U]),H=D.map((O,U)=>O-T[U]);if(Math.hypot(L[1]*H[2]-L[2]*H[1],L[2]*H[0]-L[0]*H[2],L[0]*H[1]-L[1]*H[0])>0.000000000001)s.push(v,P,M)},h=(v,P)=>Array.from({length:o},(M,B)=>{let T=B*2*Math.PI/o,N=v(T);return c(N*Math.cos(T),N*Math.sin(T),typeof P==="number"?P:P(T))}),d=(v,P)=>{for(let M=0;M<o;M++){let B=(M+1)%o;l(v[M],v[B],P[B]),l(v[M],P[B],P[M])}},u=(v,P,M)=>{let B=c(0,0,P);for(let T=0;T<o;T++){let N=(T+1)%o;M?l(B,v[T],v[N]):l(B,v[N],v[T])}},_=[],p=(v,P)=>{let M=h(v,P);if(_.length)d(_,M);return _=M,M},m=n.diameter/2,A=n.threadRootDiameter/2,g=n.threadPitch,f=-n.headHeight-n.underHeadRadius*(Math.sqrt(2)-1),y=n.showThreads?Math.ceil((f+n.length)/g*r):1;if((y+100)*o>400000)throw Error("Screw exceeds mesh resolution limit");let x=new Set([-n.length,-n.length+n.tipChamfer,f]);if(n.showThreads)for(let v=0;v<=y;v++)x.add(-n.length+(f+n.length)*v/y);for(let v of[...x].sort((P,M)=>P-M)){let P=p((M)=>{let B=(((v+n.length)/g-(n.threadHand==="right"?1:-1)*M/(2*Math.PI))%1+1)%1,T=Math.min(B,1-B),N=Math.min(m-A,Math.max(0,(T-0.0625)*g*Math.sqrt(3))),D=n.showThreads?m-N:m;return Math.min(D,m-Math.max(0,n.tipChamfer-(v+n.length)))},v);if(v===-n.length)u(P,v,!1)}p(()=>m,f);let C=m+n.underHeadRadius,b=f;for(let v=1;v<=16;v++){let P=Math.PI-(Math.PI-3*Math.PI/4)*v/16;p(()=>C+n.underHeadRadius*Math.cos(P),b+n.underHeadRadius*Math.sin(P))}let I=(v)=>n.socketAcrossFlats/2/Math.max(Math.abs(Math.sin(v)),Math.abs(Math.sin(v+2*Math.PI/3)),Math.abs(Math.sin(v+4*Math.PI/3)));return p(()=>n.headDiameter/2,0),p(I,0),p(I,-n.socketDepth),u(_,-n.socketDepth,!0),{positions:i,indices:s}}function cPi(e,t){return Ku(aPi(e,t))}function lPi({color:e="#737e8f",...t}){return Pe(Kn,{color:e,children:Pe(Nd,{geometry:cPi(t)})})}var hPi=ju({name:"flatheadscrew",schema:L7e,render:({fn:e,...t})=>Pe(lPi,{...t}),pads:"none"});function dPi(e){e.register(hPi)}var BWn=({width:e=30,height:t=22,thickness:n=1,bezelInset:o=2,bezelDepth:r=1,screenColor:i="#001414",bezelColor:s="#0f1116",screenWidth:a,screenHeight:c,offset:l})=>{let h=e,d=t,u=Math.max(n,0.4),_=Math.max(Math.min(r,u),0.2),p=Math.max(u-_,0),m=Math.max(o,0),A=Math.max(a??h-m*2,2),g=Math.max(c??d-m*2,2),f=Math.min(Math.max(_*0.6,0.2),_),y=l?.x??0,x=l?.y??0,C=l?.z??0;return gn(go,{offset:{x:y,y:x,z:C},children:[p>0&&Pe(Kn,{color:s,children:Pe(Ft,{size:[h,d,p],offset:[0,0,p/2]})}),Pe(Kn,{color:s,children:gn(jl,{children:[Pe(Ft,{size:[h,d,_],offset:[0,0,p+_/2]}),Pe(Ft,{size:[A,g,_+0.02],offset:[0,0,p+_/2]})]})}),Pe(Kn,{color:i,children:Pe(Ft,{size:[A,g,f],offset:[0,0,p+f/2]})})]})},uPi=1.7777777777777777,pPi=40,aE=0.000001,n_=(e,t)=>{if(!Number.isFinite(t)||t<=0)throw Error(`${e} must be a finite number greater than zero`)},mPi=(e)=>{if(e===void 0)return uPi;if(typeof e==="number")return n_("aspectRatio",e),e;if(typeof e!=="string"){let[r,i]=e;return n_("aspectRatio width",r),n_("aspectRatio height",i),r/i}let t=e.split(":");if(t.length!==2)throw Error('aspectRatio must look like "16:9"');let n=Number(t[0]),o=Number(t[1]);return n_("aspectRatio width",n),n_("aspectRatio height",o),n/o},_Pi=({width:e,height:t,diagonal:n,aspectRatio:o,ratio:r,defaultDiagonal:i=pPi})=>{let s=mPi(o??r);if(e!==void 0)n_("width",e);if(t!==void 0)n_("height",t);if(n!==void 0)n_("diagonal",n);n_("defaultDiagonal",i);let a,c;if(e!==void 0&&t!==void 0)a=e,c=t;else if(n!==void 0&&e!==void 0){if(e>=n)throw Error("width must be smaller than diagonal");a=e,c=Math.sqrt(n**2-e**2)}else if(n!==void 0&&t!==void 0){if(t>=n)throw Error("height must be smaller than diagonal");a=Math.sqrt(n**2-t**2),c=t}else if(e!==void 0)a=e,c=e/s;else if(t!==void 0)a=t*s,c=t;else c=(n??i)/Math.sqrt(s**2+1),a=c*s;return{width:a,height:c,diagonal:Math.hypot(a,c),aspectRatio:a/c}},gPi=(e)=>{let t=[["sitsFlat",e.sitsFlat],["sitsFlatBelowBoard",e.sitsFlatBelowBoard],["foldedToFaceAboveBoard",e.foldedToFaceAboveBoard],["foldedToFaceBelowBoard",e.foldedToFaceBelowBoard],["foldedToFaceAboveBoard",e.foldsAboveBoard],["foldedToFaceBelowBoard",e.foldsBelowBoard],["foldedToRightAngleAboveBoard",e.foldedToRightAngleAboveBoard],["foldedToRightAngleBelowBoard",e.foldedToRightAngleBelowBoard]].filter((n)=>n[1]);if(t.length>1)throw Error("Only one FlexScreen boolean orientation shortcut can be true");return t[0]?.[0]??e.orientation??"sitsFlat"},APi=(e,t)=>Math.hypot(t[0]-e[0],t[1]-e[1],t[2]-e[2]),fPi=(e,t,n)=>[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n,e[2]+(t[2]-e[2])*n],jEe=(e)=>{let t=[0];for(let n=1;n<e.length;n+=1)t.push(t[n-1]+APi(e[n-1],e[n]));return t},XUn=(e,t,n)=>{if(n<=0)return e[0];let o=t.at(-1);if(n>=o)return e.at(-1);for(let r=1;r<e.length;r+=1)if(t[r]>=n){let i=t[r-1],s=t[r]-i;return fPi(e[r-1],e[r],(n-i)/s)}return e.at(-1)},YG=(e,t,n)=>{let o=jEe(e),r=o.at(-1),i=Math.max(0,Math.min(t,r)),s=Math.max(i,Math.min(n,r)),a=[XUn(e,o,i)];for(let c=1;c<e.length-1;c+=1)if(o[c]>i&&o[c]<s)a.push(e[c]);return a.push(XUn(e,o,s)),a},yPi=(e,t)=>[e,[e[0],e[1]+t,e[2]]],xPi=({start:e,endZ:t,flexCableLength:n,foldDistanceFromConnector:o,foldOutset:r,foldSegments:i})=>{let s=[e],a=[e[0],e[1]+o,e[2]];if(o>aE)s.push(a);for(let h=1;h<=i;h+=1){let d=Math.PI*h/i;s.push([e[0],a[1]+r*Math.sin(d),e[2]+(t-e[2])*(1-Math.cos(d))/2])}let c=jEe(s).at(-1);if(c>n+aE)throw Error(`flexCableLength must be at least ${c.toFixed(2)} for this 180-degree fold`);let l=Math.max(0,n-c);if(l>aE){let h=s.at(-1);s.push([h[0],h[1]-l,h[2]])}return s},CPi=({start:e,flexCableLength:t,bendRadius:n,bendSegments:o,verticalLead:r,direction:i})=>{let s=2*o*Math.sin(Math.PI/(4*o)),a=Math.min(n,t/s),c=a*s,l=Math.max(0,t-c),h=Math.min(r,l*0.45),d=l-h,u=[e];if(d>aE)u.push([e[0],e[1]+d,e[2]]);for(let _=1;_<=o;_+=1){let p=Math.PI/2*_/o;u.push([e[0],e[1]+d+a*Math.sin(p),e[2]+i*a*(1-Math.cos(p))])}if(h>aE){let _=u.at(-1);u.push([_[0],_[1],_[2]+i*h])}return u},z0e=({points:e,width:t,thickness:n,color:o,acrossOffset:r=0,normalOffset:i=0,overlap:s=0.03,widthAtDistance:a,startDistance:c=0})=>{let l=jEe(e);return Pe(Kn,{color:o,children:e.slice(1).map((h,d)=>{let u=e[d],_=h[0]-u[0],p=h[1]-u[1],m=h[2]-u[2],A=Math.hypot(_,p,m);if(A<aE)return null;let g=Math.asin(m/A),f=Math.atan2(-_,p),y=[(u[0]+h[0])/2,(u[1]+h[1])/2,(u[2]+h[2])/2],x=Math.max(0.001,Math.min(t,n,A)/2-0.001),C=a?.(c+l[d])??t,b=a?.(c+l[d+1])??t;return Pe(go,{offset:y,children:Pe(Ic,{rotation:[g,0,f],children:a?gn(oc,{children:[Pe(Ft,{size:[C,s,n],center:[r,-A/2,i]}),Pe(Ft,{size:[b,s,n],center:[r,A/2,i]})]}):Pe(oA,{size:[t,A+s,n],center:[r,0,i],roundRadius:x})})},`${d}:${y.join(":")}`)})})},bPi=(e)=>{let{width:t,height:n,diagonal:o,aspectRatio:r,ratio:i,defaultDiagonal:s,screenThickness:a=1.2,bezelInset:c=2,bezelDepth:l=0.65,activeAreaWidth:h,activeAreaHeight:d,screenColor:u="#071b24",bezelColor:_="#15181d",showScreen:p=!0,flexCableLength:m=28,flexCableThickness:A=0.18,flexCableColor:g="#d79528",pinCount:f=e.conductorCount??8,pitch:y=e.conductorPitch,padWidth:x=e.conductorWidth,conductorThickness:C=0.035,conductorColor:b="#8c4a18",cableEdgeMargin:I=0.6,padLength:v=e.exposedContactLength??2.4,tailLength:P,taperLength:M,showConductors:B=!0,showFlexCable:T=!0,showStiffeners:N=!0,stiffenerLength:D=3,stiffenerThickness:L=0.16,stiffenerColor:H="#416bb3",bendRadius:V=3,bendSegments:O=10,rightAngleVerticalLead:U=3,distanceAboveBoard:j=7,distanceBelowBoard:Y=7,foldDistanceFromConnector:X=7,foldOutset:K=4,foldSegments:J=18,screenGap:ee=0.08,boardTopZ:se=0,boardThickness:ne=1.6,boardClearance:re=0.15,cableStartX:Z=0,cableStartY:te=0,cableStartZ:ie,cableLateralOffset:le=0,screenOffset:ue,screenRotation:de,rotation:me=[0,0,0],offset:Ae}=e,xe=_Pi({width:t,height:n,diagonal:o,aspectRatio:r,ratio:i,defaultDiagonal:s}),Me=gPi(e),Re=Me==="sitsFlatBelowBoard"||Me==="foldedToFaceBelowBoard"||Me==="foldedToRightAngleBelowBoard",we=Me==="foldedToFaceAboveBoard"||Me==="foldedToFaceBelowBoard",_e=Me==="foldedToRightAngleAboveBoard"||Me==="foldedToRightAngleBelowBoard";if(n_("screenThickness",a),n_("flexCableLength",m),n_("flexCableThickness",A),n_("conductorThickness",C),n_("bendRadius",V),n_("foldOutset",K),n_("boardThickness",ne),N)n_("stiffenerThickness",L);if(!Number.isFinite(v)||v<0)throw Error("padLength must be a finite nonnegative length");if(!Number.isInteger(f)||f<1)throw Error("pinCount must be a positive integer");if(!Number.isInteger(O)||O<2)throw Error("bendSegments must be an integer of at least 2");if(!Number.isInteger(J)||J<4)throw Error("foldSegments must be an integer of at least 4");if(re<0||ee<0||I<0||v<0||D<0||U<0||j<0||Y<0||X<0)throw Error("clearances, margins, contact lengths, and lead lengths cannot be negative");let ye=e.flexCableWidth??Math.min(12,Math.max(5,xe.width*0.3));n_("flexCableWidth",ye);let Se=ye-I*2;if(Se<=0)throw Error("cableEdgeMargin leaves no usable flex cable width");let Ne=y??(f===1?0:Se/f);if((y!==void 0||f>1)&&(!Number.isFinite(Ne)||Ne<=0))throw Error("pitch must be greater than zero");let ke=x??(f===1?Math.min(Se,ye*0.45):Ne*0.48);n_("padWidth",ke);let nt=(f-1)*Ne+ke,dt=Math.max(ye,nt+I*2),rt=dt>ye+aE,mt=rt?f===1?0:Se/f:Ne,lt=rt?Math.min(ke,f===1?Se:mt*0.48):ke,Nt=Re&&!we?se-ne-re-A/2:se+re+A/2,Ht=[Z+le,te,ie??Nt],Tt=Re?-1:1,et=Me==="foldedToFaceAboveBoard"?se+j:se-ne-Y,vt=Me==="foldedToFaceAboveBoard"?et-ee-A/2:et+ee+A/2,ht=we?xPi({start:Ht,endZ:vt,flexCableLength:m,foldDistanceFromConnector:X,foldOutset:K,foldSegments:J}):_e?CPi({start:Ht,flexCableLength:m,bendRadius:V,bendSegments:O,verticalLead:U,direction:Tt}):yPi(Ht,m),We=jEe(ht).at(-1);if(P!==void 0){if(n_("tailLength",P),P>=We)throw Error("tailLength must be shorter than flexCableLength")}if(M!==void 0)n_("taperLength",M);let Le=Math.min(Math.max(0,v),We/2,P??1/0),Ze=Math.min(Math.max(0,D),We/2,P??1/0),$e=P??Math.max(Le,Ze);if(M!==void 0&&$e+M>We+aE)throw Error("tailLength and taperLength must fit within flexCableLength");let qe=Math.min(We,$e+(M??Math.max(3,(dt-ye)/2))),ft=(_n)=>{if(_n<=$e)return dt;let no=Math.min(1,(_n-$e)/(qe-$e));return dt+(ye-dt)*no},It=rt?[...YG(ht,0,$e),...YG(ht,$e,qe).slice(1),...YG(ht,qe,We).slice(1)]:ht,ze=rt?ft:void 0,Xe=YG(ht,0,Le),it=YG(ht,We-Le,We),St=YG(It,0,Ze),kt=YG(It,We-Ze,We),Lt=ht.at(-1),Wt,bn;if(Me==="sitsFlat")Wt=[0,0,0],bn=[Lt[0],Lt[1]+xe.height/2,Lt[2]+A/2+ee];else if(Me==="sitsFlatBelowBoard")Wt=[0,Math.PI,0],bn=[Lt[0],Lt[1]+xe.height/2,Lt[2]-A/2-ee];else if(Me==="foldedToFaceAboveBoard")Wt=[0,0,0],bn=[Lt[0],Lt[1]-xe.height/2,et];else if(Me==="foldedToFaceBelowBoard")Wt=[0,Math.PI,0],bn=[Lt[0],Lt[1]-xe.height/2,et];else if(Me==="foldedToRightAngleAboveBoard")Wt=[Math.PI/2,0,0],bn=[Lt[0],Lt[1]-A/2-ee,Lt[2]+xe.height/2];else Wt=[-Math.PI/2,0,0],bn=[Lt[0],Lt[1]+A/2+ee,Lt[2]-xe.height/2];bn=[bn[0]+(ue?.x??0),bn[1]+(ue?.y??0),bn[2]+(ue?.z??0)];let pn=Array.from({length:f},(_n,no)=>(no-(f-1)/2)*Ne),wn=(A+C)/2,Fn=-(A+L)/2,mn=gn($o,{children:[T&&Pe(z0e,{points:It,width:ye,widthAtDistance:ze,thickness:A,color:g}),T&&N&&Ze>aE&&gn($o,{children:[Pe(z0e,{points:St,width:dt,thickness:L,color:H,normalOffset:Fn}),Pe(z0e,{points:kt,width:ye,widthAtDistance:ze,startDistance:We-Ze,thickness:L,color:H,normalOffset:Fn})]}),T&&B&&Le>aE&&pn.map((_n,no)=>gn($o,{children:[Pe(z0e,{points:Xe,width:ke,thickness:C,color:b,acrossOffset:_n,normalOffset:wn}),Pe(z0e,{points:it,width:lt,thickness:C,color:b,acrossOffset:(no-(f-1)/2)*mt,normalOffset:wn})]},`conductor:${no}`)),p&&Pe(go,{offset:bn,children:Pe(Ic,{rotation:de??Wt,children:Pe(BWn,{width:xe.width,height:xe.height,thickness:a,bezelInset:c,bezelDepth:l,screenWidth:h,screenHeight:d,screenColor:u,bezelColor:_})})})]});return Pe(go,{offset:{x:Ae?.x??0,y:Ae?.y??0,z:Ae?.z??0},children:Pe(go,{offset:Ht,children:Pe(Ic,{rotation:me,children:Pe(go,{offset:[-Ht[0],-Ht[1],-Ht[2]],children:mn})})})})},IPi=ju({name:"flexscreen",schema:M7e,render:({fn:e,...t})=>Pe(bPi,{...t}),pads:"footprinter"});function vPi(e){e.register(IPi)}function SPi(e){return TWn(e)}function TWn(e,t=0,n=32){let o=y0e.parse(e),r=rlt(o),i=r.pitchDiameter/2,s=r.baseDiameter/2,a=r.outsideDiameter/2,c=r.rootDiameter/2,l=o.pressureAngle*Math.PI/180,h=Math.PI*2/o.toothCount,d=(o.phase%360+360)%360*(Math.PI/180),u=r.toothThickness/(2*i)+Math.tan(l)-l,_=Math.max(s,c),p=Math.sqrt(Math.max(0,(_/s)**2-1)),m=Math.sqrt((a/s)**2-1),A=(Z)=>u-(Z-Math.atan(Z)),g=A(p),f=A(m),y=Math.max(2,Math.ceil(o.segmentsPerTooth/2)),x=Math.max(1,Math.ceil(o.segmentsPerTooth/4)),C=h-2*g,b=Math.max(o.boreDiameter,o.hubDiameter)/2,I=b>0?(t===0?1.8:0.8)*Math.acos(b/c):Math.PI,v=Math.max(x,Math.ceil(C/I)),P=Math.min(h/16,2*Math.PI/n,I),M=Math.max(1,Math.ceil(Math.abs(t)/P)),B=2*y+x+v+(c<s?2:0);if(!Number.isFinite(v)||!Number.isFinite(M)||(M+1)*o.toothCount*B+1024>1e6)throw Error("Involute gear exceeds mesh resolution limit (1 million vertices); reduce twist or resolution, or increase bore/hub wall thickness");let T=[],N=(Z,te)=>{T.push([Z*Math.cos(te),Z*Math.sin(te)])};for(let Z=0;Z<o.toothCount;Z++){let te=d+Z*h;if(N(c,te-g),c<s)N(s,te-u);for(let ie=1;ie<=y;ie++){let le=p+(m-p)*ie/y;N(s*Math.sqrt(1+le*le),te-A(le))}for(let ie=1;ie<=x;ie++)N(a,te-f+2*f*ie/x);for(let ie=y-1;ie>=0;ie--){let le=p+(m-p)*ie/y;N(s*Math.sqrt(1+le*le),te+A(le))}if(c<s)N(c,te+u);for(let ie=1;ie<v;ie++)N(c,te+g+C*ie/v)}let D=[],L=[],H=(Z,te)=>{let ie=D.length/3;for(let[le,ue]of Z)D.push(le,ue,te);return ie},V=Math.max(48,Math.min(256,o.toothCount*4)),O=(Z)=>Array.from({length:V},(te,ie)=>{let le=d+ie*Math.PI*2/V;return[Z*Math.cos(le),Z*Math.sin(le)]}),U=(Z,te,ie,le=!1)=>{for(let ue=0;ue<ie;ue++){let de=(ue+1)%ie;if(le)L.push(Z+ue,te+de,Z+de,Z+ue,te+ue,te+de);else L.push(Z+ue,Z+de,te+de,Z+ue,te+de,te+ue)}},j=(Z,te,ie,le)=>{let ue=le?[...Z,...le.points]:Z,de=V9(ue.flatMap(([Ae,xe])=>[Ae,xe]),le?[Z.length]:[]),me=(Ae)=>Ae<Z.length?te+Ae:le.start+Ae-Z.length;for(let Ae=0;Ae<de.length;Ae+=3){let xe=de[Ae],Me=de[Ae+1],Re=de[Ae+2],we=ue[xe],_e=ue[Me],ye=ue[Re];if((_e[0]-we[0])*(ye[1]-we[1])-(_e[1]-we[1])*(ye[0]-we[0])>0===ie)L.push(me(xe),me(Me),me(Re));else L.push(me(xe),me(Re),me(Me))}},Y=H(T,0),X=Y,K=T;for(let Z=1;Z<=M;Z++){let te=t*(Z/M);K=t===0?T:T.map(([le,ue])=>[le*Math.cos(te)-ue*Math.sin(te),le*Math.sin(te)+ue*Math.cos(te)]);let ie=H(K,o.faceWidth*(Z/M));U(X,ie,T.length),X=ie}let J=o.hubDiameter>0&&o.hubLength>0,ee=o.faceWidth+(J?o.hubLength:0),se=o.boreDiameter>0?O(o.boreDiameter/2):void 0,ne=se?H(se,0):void 0,re=se?H(se,ee):void 0;if(se)U(ne,re,se.length,!0);if(j(T,Y,!1,se?{points:se,start:ne}:void 0),J){let Z=O(o.hubDiameter/2),te=H(Z,o.faceWidth),ie=H(Z,ee);if(j(K,X,!0,{points:Z,start:te}),U(te,ie,Z.length),se)U(ie,re,Z.length);else j(Z,ie,!0)}else j(K,X,!0,se?{points:se,start:re}:void 0);return{positions:D,indices:L}}function PPi(e){let t=ilt.parse(e),{twistAngle:n}=aMn(t),{helixAngle:o,handedness:r,segmentsPerTurn:i,...s}=t;return TWn(s,n*Math.PI/180,i)}function EPi(e){return Ku(PPi(e))}function MPi({color:e="#737e8f",...t}){return Pe(Kn,{color:e,children:Pe(Nd,{geometry:EPi(t)})})}var wPi=ju({name:"helicalgear",schema:b7e,render:({fn:e,...t})=>Pe(MPi,{...t}),pads:"none"});function BPi(e){e.register(wPi)}function TPi(e,t={}){let n=qEn.parse(e),o=t.radialSegments??96,r=t.threadStepsPerTurn??24;if(!Number.isInteger(o)||o<24||o>192||o%24!==0||!Number.isInteger(r)||r<24||r>96)throw Error("Screw mesh resolution requires 24..192 radial segments divisible by 24 and 24..96 thread steps");let i=[],s=[],a=new Map,c=(M,B,T)=>{let N=[M,B,T].map((H)=>Math.round(H*10000000000)).join(":"),D=a.get(N);if(D!==void 0)return D;let L=i.length/3;return i.push(M,B,T),a.set(N,L),L},l=(M,B,T)=>{if(M===B||B===T||T===M)return;let N=(j)=>i.slice(3*j,3*j+3),D=N(M),L=N(B),H=N(T),V=L.map((j,Y)=>j-D[Y]),O=H.map((j,Y)=>j-D[Y]);if(Math.hypot(V[1]*O[2]-V[2]*O[1],V[2]*O[0]-V[0]*O[2],V[0]*O[1]-V[1]*O[0])>0.000000000001)s.push(M,B,T)},h=(M,B)=>Array.from({length:o},(T,N)=>{let D=N*2*Math.PI/o,L=M(D);return c(L*Math.cos(D),L*Math.sin(D),typeof B==="number"?B:B(D))}),d=(M,B)=>{for(let T=0;T<o;T++){let N=(T+1)%o;l(M[T],M[N],B[N]),l(M[T],B[N],B[T])}},u=(M,B,T)=>{let N=c(0,0,B);for(let D=0;D<o;D++){let L=(D+1)%o;T?l(N,M[D],M[L]):l(N,M[L],M[D])}},_=[],p=(M,B)=>{let T=h(M,B);if(_.length)d(_,T);return _=T,T},m=n.diameter/2,A=n.threadRootDiameter/2,g=n.threadPitch,f=-n.underHeadRadius,y=n.showThreads?Math.ceil((f+n.length)/g*r):1;if((y+100)*o>400000)throw Error("Screw exceeds mesh resolution limit");let x=new Set([-n.length,-n.length+n.tipChamfer,f]);if(n.showThreads)for(let M=0;M<=y;M++)x.add(-n.length+(f+n.length)*M/y);for(let M of[...x].sort((B,T)=>B-T)){let B=p((T)=>{let N=(((M+n.length)/g-(n.threadHand==="right"?1:-1)*T/(2*Math.PI))%1+1)%1,D=Math.min(N,1-N),L=Math.min(m-A,Math.max(0,(D-0.0625)*g*Math.sqrt(3))),H=n.showThreads?m-L:m;return Math.min(H,m-Math.max(0,n.tipChamfer-(M+n.length)))},M);if(M===-n.length)u(B,M,!1)}p(()=>m,f);let C=m+n.underHeadRadius,b=f;for(let M=1;M<=16;M++){let B=Math.PI-(Math.PI-Math.PI/2)*M/16;p(()=>C+n.underHeadRadius*Math.cos(B),b+n.underHeadRadius*Math.sin(B))}let I=(M)=>n.headAcrossFlats/2/Math.max(Math.abs(Math.sin(M)),Math.abs(Math.sin(M+2*Math.PI/3)),Math.abs(Math.sin(M+4*Math.PI/3)));p(I,0);let v=Math.tan(n.headChamferAngle*Math.PI/180),P=n.headHeight-(n.headCornerDiameter-n.headChamferDiameter)/2*v;p(I,P);for(let M=1;M<=12;M++){let B=P+(n.headHeight-P)*M/12;p((T)=>Math.min(I(T),n.headChamferDiameter/2+(n.headHeight-B)/v),B)}return u(_,n.headHeight,!0),{positions:i,indices:s}}function DPi(e,t){return Ku(TPi(e,t))}function NPi({color:e="#737e8f",...t}){return Pe(Kn,{color:e,children:Pe(Nd,{geometry:DPi(t)})})}var RPi=ju({name:"hexbolt",schema:y7e,render:({fn:e,...t})=>Pe(NPi,{...t}),pads:"none"});function QPi(e){e.register(RPi)}function kPi(e){let t=e.radialSegments??96,n=e.segmentsPerPitch??32;if(!Number.isInteger(t)||t<24||t>192||t%12!==0||!Number.isInteger(n)||n<8||n>64)throw Error("Mesh resolution limit: radial segments must be a multiple of 12 in [24,192], pitch segments an integer in [8,64]");return{radial:t,axial:n}}function LPi(e){let t=[],n=[];return{positions:t,indices:n,ring:(s,a)=>{let c=t.length/3;for(let l=0;l<e;l++){let h=l*2*Math.PI/e,d=a(h);t.push(d*Math.cos(h),d*Math.sin(h),s)}return c},connect:(s,a)=>{for(let c=0;c<e;c++){let l=(c+1)%e;n.push(s+c,s+l,a+l,s+c,a+l,a+c)}},cap:(s,a,c)=>{let l=t.length/3;t.push(0,0,a);for(let h=0;h<e;h++){let d=(h+1)%e;n.push(l,s+(c?h:d),s+(c?d:h))}}}}function jUn(e,t){let n=Math.PI/3,o=((e-Math.PI/2+n/2)%n+n)%n-n/2;return t/2/Math.cos(o)}function HPi(e,t,n,o=1){let r=((e/n-o*t/(2*Math.PI))%1+1)%1;return Math.min(r,1-r)}function FPi(e,t={}){let n=_lt.parse(e),o=uwn(e),{radial:r,axial:i}=kPi(t),s=Math.max(2,Math.ceil(o.height/o.threadPitch*i));if(s>24000||!Number.isFinite(s))throw Error("Mesh resolution limit: too many thread turns");let a=LPi(r),c=(A,g)=>Math.min(jUn(g,o.acrossFlats),o.faceDiameter/2+Math.min(A,o.height-A)*Math.sqrt(3)),l=[0,o.outerChamferDepth,o.height-o.outerChamferDepth,o.height];for(let A=0;A<r;A++){let g=A*2*Math.PI/r,f=(jUn(g,o.acrossFlats)-o.faceDiameter/2)/Math.sqrt(3);if(f>0.000000001&&f<o.outerChamferDepth-0.000000001)l.push(f,o.height-f)}let h=l.sort((A,g)=>A-g).filter((A,g,f)=>g===0||A-f[g-1]>0.0000000001),d=a.ring(0,(A)=>c(0,A)),u=d;for(let A of h.slice(1)){let g=a.ring(A,(f)=>c(A,f));a.connect(u,g),u=g}let _=new Set(n.showThreads?Array.from({length:s+1},(A,g)=>o.height*g/s):[0,o.height]);_.add(o.boreChamferDepth),_.add(o.height-o.boreChamferDepth);let p=o.boreMinorDiameter/2,m=(o.diameter-o.boreMinorDiameter)/2;for(let A of[..._].sort((g,f)=>f-g)){let g=a.ring(A,(f)=>{let y=Math.min(m,Math.max(0,(HPi(A,f,o.threadPitch)-0.125)*o.threadPitch*Math.sqrt(3))),x=p+(n.showThreads?y:0);return Math.max(x,o.mouthDiameter/2-Math.min(A,o.height-A))});a.connect(u,g),u=g}return a.connect(u,d),{positions:a.positions,indices:a.indices}}function zPi(e,t){return Ku(FPi(e,t))}function OPi({color:e="#737e8f",...t}){return Pe(Kn,{color:e,children:Pe(Nd,{geometry:zPi(t)})})}var VPi=ju({name:"hexnut",schema:H7e,render:({fn:e,...t})=>Pe(OPi,{...t}),pads:"none"});function YPi(e){e.register(VPi)}var GPi=(e)=>{let t=hMn.parse(e),{diameter:n,threadPitch:o,headDiameter:r,headHeight:i,socketWidth:s,socketDepth:a}=j5[t.metricSize],{length:c,showThreads:l}=t,h=96,d=l?Math.max(2,Math.ceil(c/o*24)):2;if(d>24000)throw Error("Bolt length exceeds mesh resolution limit (1000 thread turns)");let u=[],_=[],p=n/2,m=o*0.61343,A=Math.min(0.2,i*0.08),g=Math.min(o*0.6,c/3),f=(P,M)=>{let B=u.length/3;for(let T=0;T<96;T++){let N=T*Math.PI*2/96,D=M(N);u.push(D*Math.cos(N),D*Math.sin(N),P)}return B},y=(P,M)=>{for(let B=0;B<96;B++){let T=(B+1)%96;_.push(P+B,P+T,M+T,P+B,M+T,M+B)}},x=(P,M,B)=>{let T=u.length/3;u.push(0,0,M);for(let N=0;N<96;N++){let D=P+N,L=P+(N+1)%96;_.push(T,B?D:L,B?L:D)}},C=-1,b=l?Array.from({length:d+1},(P,M)=>-c+c*M/d):[-c,-c+g,0];for(let P of b){let M=f(P,(B)=>{let T=((P/o-B/(2*Math.PI))%1+1)%1,N=Math.min(T,1-T),D=Math.min(m,Math.max(0,(N-0.0625)*o*Math.sqrt(3))),L=Math.min(1,(P+c)/g,-P/Math.min(o/2,c/3)),H=g*Math.max(0,1-(P+c)/g);return p-(l?D*L:0)-H});if(C<0)x(M,P,!1);else y(C,M);C=M}let I=(P,M)=>{let B=f(P,M);y(C,B),C=B};I(0,()=>r/2-A),I(A,()=>r/2),I(i-A,()=>r/2),I(i,()=>r/2-A);let v=(P,M)=>M/2/Math.cos((P+Math.PI/6)%(Math.PI/3)-Math.PI/6);return I(i,(P)=>v(P,s+A)),I(i-A/2,(P)=>v(P,s)),I(i-a,(P)=>v(P,s)),x(C,i-a,!0),{positions:u,indices:_}};function DWn(e){return Ku(GPi(e))}function UPi({color:e="#737e8f",...t}){return Pe(Kn,{color:e,material:Fr.steel,children:Pe(Nd,{geometry:DWn(t)})})}var WPi=ju({name:"hexsocketbolt",schema:v7e,render:({fn:e,...t})=>Pe(UPi,{...t}),pads:"none"});function XPi(e){e.register(WPi)}function jPi(e,t={}){let n=F7e.parse(e),o=glt(n),r=t.radialSegments??24,i=t.segmentsPerRib??4;for(let[I,v,P,M]of[["radialSegments",r,12,128],["segmentsPerRib",i,4,32]])if(!Number.isInteger(v)||v<P||v>M||v%4!==0)throw Error(`${I} must be a multiple of four in [${P},${M}]`);let{totalLength:s,bendLength:a,minimumWallThickness:c}=o,l=n.innerDiameter/2,d=Math.max(s,n.outerDiameter)*0.0000000001;if(Math.min(l,c,s)<=d)throw Error("Hollow positioning arm tube wall, bore or length exceeds mesh resolution limit");let u=Math.min(l,c)*0.02,_=Math.min(Math.PI/36,2*Math.acos(1-Math.min(u/n.bendRadius,1))),p=n.bendAngle===0?0:Math.ceil(n.bendAngle*Math.PI/180/_),m=n.ribDepth===0?0:Math.ceil(s/n.ribPitch*i),A=Math.floor(250000/(2*r));if(!Number.isSafeInteger(p+m)||p+m+5>A)throw Error("Hollow positioning arm tube exceeds mesh resolution limit (250000 vertices)");let g=[0,n.startLength,n.startLength+a,s];for(let I=1;I<p;I++)g.push(n.startLength+a*I/p);for(let I=1;I<m;I++)g.push(I*n.ribPitch/i);g.sort((I,v)=>I-v);let f=g.filter((I,v)=>v===0||I-g[v-1]>d);if(s-f[f.length-1]<=d)f[f.length-1]=s;let y=[],x=[],C=r*2;for(let I of f){let{position:v,normal:P}=Awn(n,I),M=n.outerDiameter/2-(n.ribDepth===0?0:n.ribDepth/2*(1+Math.cos(2*Math.PI*(I/n.ribPitch%1))));for(let B of[M,l])for(let T=0;T<r;T++){let N=T*2*Math.PI/r,D=T===r/4||T===3*r/4?0:Math.cos(N),L=T===0||T===r/2?0:Math.sin(N);y.push(v[0]+B*D*P[0],B*L,v[2]+B*D*P[2])}}let b=(I,v,P,M)=>{x.push(I,v,P,I,P,M)};for(let I=0;I+1<f.length;I++)for(let v=0;v<r;v++){let P=(v+1)%r,M=I*C,B=(I+1)*C;b(M+v,M+P,B+P,B+v),b(M+r+v,B+r+v,B+r+P,M+r+P)}for(let I=0;I<r;I++){let v=(I+1)%r;b(I,r+I,r+v,v);let P=(f.length-1)*C;b(P+I,P+v,P+r+v,P+r+I)}return{positions:y,indices:x}}function KPi(e){return Ku(jPi(e))}function $Pi({color:e="#343943",...t}){return Pe(Kn,{color:e,children:Pe(Nd,{geometry:KPi(t)})})}var qPi=ju({name:"hollowpositioningarmtube",schema:z7e,render:({fn:e,...t})=>Pe($Pi,{...t}),pads:"none"});function JPi(e){e.register(qPi)}var Jdt=S7e.parse.bind(S7e);function ZPi(e){let t=Jdt(e);if(t.wireConnection==="none")return[];let{position:n}=iBn(t).wireside,o=t.wireSideAngle*Math.PI/180,r=(m)=>sE.default.transforms.translate([n.x,n.y,n.z],sE.default.transforms.rotateZ(o,m));if(t.wireConnection==="stubs"){let m=["#d53f3f","#2463af","#3b934b","#252830","#e5d049","#eeeeee","#ce7432","#803e91"];return Array.from({length:t.wireCount},(A,g)=>({color:m[g],geometry:r(sE.default.transforms.translate([(t.wireLength-0.15)/2,(g-(t.wireCount-1)/2)*t.wireDiameter*1.5,0],sE.default.transforms.rotateY(Math.PI/2,sE.default.primitives.cylinder({height:t.wireLength+0.15,radius:t.wireDiameter/2,segments:24}))))}))}let i=I7e(t.wireConnection),{pinCount:s,pitch:a,bodyWidth:c,bodyHeight:l,matingDepth:h}=i,d=a===2?0.6:0.3,u=a===2?3.4:2.4,_=a===2?0.5:0.3,p=sE.default.booleans.subtract(sE.default.primitives.cuboid({size:[h+0.1,c,l],center:[(h-0.1)/2,0,0]}),sE.default.primitives.cuboid({size:[h-0.5,c-2*d,l-2*d],center:[h/2+0.55,0,0]}));return[{color:"#eeeeea",geometry:r(p)},...Array.from({length:s},(m,A)=>({color:"#b8bec6",geometry:r(sE.default.primitives.cuboid({size:[u,_,_],center:[u/2,(A-(s-1)/2)*a,0]}))}))]}var OEe=(e,t=0,n=0)=>Array.from({length:96},(o,r)=>[t+e*Math.cos(r*Math.PI/48),n+e*Math.sin(r*Math.PI/48)]),KUn=(e,t)=>{let n=e/2,o=t;if(o===0)return[[-n,-n],[n,-n],[n,n],[-n,n]];return[[-n+o,-n],[n-o,-n],[n,-n+o],[n,n-o],[n-o,n],[-n+o,n],[-n,n-o],[-n,-n+o]]};function eEi(e){let t=Jdt(e),n=[],o=(u,_,p,m,A=[])=>{if(m>p)n.push({name:u,outline:_,holes:A,zMin:p,zMax:m})},r=KUn(t.bodyWidth,t.faceCornerChamfer),i=KUn(t.bodyWidth,t.bodyCornerChamfer),s=t.mountingHoleSpacing/2,c=[[-s,-s],[s,-s],[s,s],[-s,s]].map(([u,_])=>OEe(t.mountingHoleDiameter/2,u,_)),l=t.mountingHoleThrough?t.frontCapLength:t.mountingHoleDepth;if(o("frontCap",r,-l,0,c),o("frontCap",r,-t.frontCapLength,-l),o("body",i,-t.bodyLength+t.rearCapLength,-t.frontCapLength),t.backFace==="plain")o("rearCap",t.mountingHoleThrough?i:r,-t.bodyLength,-t.bodyLength+t.rearCapLength);else{let u=t.backFaceHoleSpacing/2,_=[-u,u].flatMap((p)=>[-u,u].map((m)=>OEe(t.backFaceHoleDiameter/2,p,m)));o("rearCap",r,-t.bodyLength,-t.bodyLength+t.backFaceHoleDepth,_),o("rearCap",r,-t.bodyLength+t.backFaceHoleDepth,-t.bodyLength+t.rearCapLength)}o("pilot",OEe(t.pilotDiameter/2),0,t.pilotLength);let h=t.shaftDiameter/2,d=OEe(h);if(t.shaftShape==="round")o("shaft",d,t.pilotLength,t.shaftLength);else{let u=h-t.shaftFlatDepth,_=Math.acos(u/h),p=Array.from({length:97},(g,f)=>{let y=_+(2*Math.PI-2*_)*f/96;return[h*Math.cos(y),h*Math.sin(y)]}),m=t.shaftFlatAngle*Math.PI/180,A=p.map(([g,f])=>[g*Math.cos(m)-f*Math.sin(m),g*Math.sin(m)+f*Math.cos(m)]);o("shaft",d,t.pilotLength,t.shaftLength-t.shaftFlatLength),o("shaft",A,t.shaftLength-t.shaftFlatLength,t.shaftLength)}return n}var Pdt=CT.default.modifiers.generalize;function tEi({bodyColor:e="#242830",capColor:t="#aeb5bd",shaftColor:n="#b8bec6",screwColor:o="#626b78",...r}){let i=Jdt(r),s=i.backFace==="screws"?CT.default.transforms.rotateX(Math.PI,DWn({metricSize:i.backFaceScrewSize,length:i.backFaceHoleDepth,showThreads:!1})):void 0,a=i.backFaceHoleSpacing/2;return gn($o,{children:[eEi(i).map((c,l)=>{let h=CT.default.geometries.geom2.fromPoints(c.outline),d=c.holes.length?CT.default.booleans.subtract(h,...c.holes.map((_)=>CT.default.geometries.geom2.fromPoints(_))):h,u=CT.default.transforms.translate([0,0,c.zMin],CT.default.extrusions.extrudeLinear({height:c.zMax-c.zMin},d));return Pe(Kn,{material:c.name==="body"?Fr.moldedPlastic:c.name==="shaft"?Fr.steel:Fr.brushedMetal,color:c.name==="body"?e:c.name==="shaft"?n:t,children:Pe(Nd,{geometry:Pdt({simplify:!0},u)})},`${c.name}-${l}`)}),ZPi(i).map(({geometry:c,color:l},h)=>Pe(Kn,{material:Fr.rubber,color:l,children:Pe(Nd,{geometry:Pdt({simplify:!0},c)})},`wire-${h}`)),s&&[-a,a].flatMap((c)=>[-a,a].map((l)=>Pe(Kn,{material:Fr.steel,color:o,children:Pe(Nd,{geometry:CT.default.transforms.translate([c,l,-i.bodyLength],Pdt({simplify:!0},s))})},`rear-screw-${c}-${l}`)))]})}var nEi=ju({name:"nema",schema:P7e,render:({fn:e,...t})=>Pe(tEi,{...t}),pads:"none"});function oEi(e){e.register(nEi)}function rEi(e,t={}){let n=Cwn.parse(e),o=t.radialSegments??96,r=t.threadStepsPerTurn??24;if(!Number.isInteger(o)||o<24||o>192||o%24!==0||!Number.isInteger(r)||r<24||r>96)throw Error("Screw mesh resolution requires 24..192 radial segments divisible by 24 and 24..96 thread steps");let i=[],s=[],a=new Map,c=(xe,Me,Re)=>{let we=[xe,Me,Re].map((Se)=>Math.round(Se*10000000000)).join(":"),_e=a.get(we);if(_e!==void 0)return _e;let ye=i.length/3;return i.push(xe,Me,Re),a.set(we,ye),ye},l=(xe,Me,Re)=>{if(xe===Me||Me===Re||Re===xe)return;let we=(dt)=>i.slice(3*dt,3*dt+3),_e=we(xe),ye=we(Me),Se=we(Re),Ne=ye.map((dt,rt)=>dt-_e[rt]),ke=Se.map((dt,rt)=>dt-_e[rt]);if(Math.hypot(Ne[1]*ke[2]-Ne[2]*ke[1],Ne[2]*ke[0]-Ne[0]*ke[2],Ne[0]*ke[1]-Ne[1]*ke[0])>0.000000000001)s.push(xe,Me,Re)},h=(xe,Me)=>Array.from({length:o},(Re,we)=>{let _e=we*2*Math.PI/o,ye=xe(_e);return c(ye*Math.cos(_e),ye*Math.sin(_e),typeof Me==="number"?Me:Me(_e))}),d=(xe,Me)=>{for(let Re=0;Re<o;Re++){let we=(Re+1)%o;l(xe[Re],xe[we],Me[we]),l(xe[Re],Me[we],Me[Re])}},u=(xe,Me,Re)=>{let we=c(0,0,Me);for(let _e=0;_e<o;_e++){let ye=(_e+1)%o;Re?l(we,xe[_e],xe[ye]):l(we,xe[ye],xe[_e])}},_=[],p=(xe,Me)=>{let Re=h(xe,Me);if(_.length)d(_,Re);return _=Re,Re},m=n.diameter/2,A=n.threadRootDiameter/2,g=n.threadPitch,f=-n.underHeadRadius,y=n.showThreads?Math.ceil((f+n.length)/g*r):1;if((y+160)*o>400000)throw Error("Screw exceeds mesh resolution limit");let x=new Set([-n.length,-n.length+n.tipChamfer,f]);if(n.showThreads)for(let xe=0;xe<=y;xe++)x.add(-n.length+(f+n.length)*xe/y);for(let xe of[...x].sort((Me,Re)=>Me-Re)){let Me=p((Re)=>{let we=(((xe+n.length)/g-(n.threadHand==="right"?1:-1)*Re/(2*Math.PI))%1+1)%1,_e=Math.min(we,1-we),ye=Math.min(m-A,Math.max(0,(_e-0.0625)*g*Math.sqrt(3))),Se=n.showThreads?m-ye:m;return Math.min(Se,m-Math.max(0,n.tipChamfer-(xe+n.length)))},xe);if(xe===-n.length)u(Me,xe,!1)}p(()=>m,f);let C=m+n.underHeadRadius,b=f;for(let xe=1;xe<=16;xe++){let Me=Math.PI-(Math.PI-Math.PI/2)*xe/16;p(()=>C+n.underHeadRadius*Math.cos(Me),b+n.underHeadRadius*Math.sin(Me))}let I=(xe)=>n.headHeight-n.crownRadius+Math.sqrt(n.crownRadius*n.crownRadius-xe*xe),v=n.recessOuterWingAngle*Math.PI/180,P=n.recessInnerWingAngle*Math.PI/180,M=(n.recessReferenceDiameter-n.recessG)/2/Math.tan(v),B=M+n.recessG/2*Math.tan(P),T=M+(n.recessG-n.recessB)/2*Math.tan(P),N=n.recessBeta*Math.PI/180,D=Math.atan(Math.tan(n.recessAlpha*Math.PI/360)/Math.cos(N)),L=Math.atan(Math.tan(46*Math.PI/180)/Math.cos(N)),H=n.recessE/2/Math.tan(D),V=(xe,Me)=>{let Re=n.recessReferencePlaneHeight-xe,we=n.recessB/2-(Re-T)*Math.tan(N),_e=Math.abs((Me-Math.PI/4+Math.PI/4+4*Math.PI)%(Math.PI/2)-Math.PI/4),ye=Math.cos(_e),Se=Math.sin(_e),Ne=Math.tan(D),ke=Math.tan(L),nt=Ne*we/(Ne*ye-Se),dt=nt*ye<=we+H?nt:(ke*(we+H)-n.recessE/2)/(ke*ye-Se);return Math.max(0,dt)},O=(xe,Me)=>{let Re=n.recessReferencePlaneHeight-xe,we=Re<=M?n.recessReferenceDiameter/2-Re*Math.tan(v):(B-Re)/Math.tan(P);return Math.max(0,Math.min(we,V(xe,Me)))},U=n.recessRadius,j=n.headHeight-n.crownRadius,Y=Math.tan(v),X=n.recessReferenceDiameter/2-Y*n.recessReferencePlaneHeight+U/Math.cos(v),K=Y*j+X,J=n.crownRadius-U,ee=(-Y*K+Math.sqrt((1+Y*Y)*J**2-K**2))/(1+Y*Y),se=j+ee,ne=Y*se+X,re=Math.atan2(ee,ne),Z=Math.PI-v,te=ne+U*Math.cos(re),ie=se+U*Math.sin(Z);p(()=>n.headDiameter/2,0),p(()=>n.headDiameter/2,I(n.headDiameter/2));let le=Array.from({length:o},(xe,Me)=>{let Re=Me*2*Math.PI/o,we=0,_e=te;for(let ye=0;ye<48;ye++){let Se=(we+_e)/2;if(Se<V(I(Se),Re))we=Se;else _e=Se}return(we+_e)/2});for(let xe=1;xe<=20;xe++){let Me=(Re)=>{let we=Math.round(Re*o/(2*Math.PI))%o;return n.headDiameter/2+(le[we]-n.headDiameter/2)*xe/20};p(Me,(Re)=>I(Me(Re)))}let ue=Array.from({length:o},(xe,Me)=>{let Re=Me*2*Math.PI/o,we=(ke)=>({r:ne+U*Math.cos(ke),z:se+U*Math.sin(ke)}),_e=(ke)=>{let nt=we(ke);return nt.r>V(nt.z,Re)};if(!_e(re))return{angle:re,...we(re)};if(_e(Z))return{angle:Z,r:V(ie,Re),z:ie};let ye=re,Se=Z;for(let ke=0;ke<48;ke++){let nt=(ye+Se)/2;if(_e(nt))ye=nt;else Se=nt}let Ne=(ye+Se)/2;return{angle:Ne,...we(Ne)}});for(let xe=0;xe<=24;xe++){let Me=re+(Z-re)*xe/24,Re=ne+U*Math.cos(Me),we=se+U*Math.sin(Me),_e=(ye)=>ue[Math.round(ye*o/(2*Math.PI))%o];p((ye)=>Me<=_e(ye).angle?_e(ye).r:Re,(ye)=>Me<=_e(ye).angle?_e(ye).z:we)}let de=n.recessReferencePlaneHeight-B,me=new Set([n.recessReferencePlaneHeight-M]);for(let xe=1;xe<48;xe++)me.add(ie+(de-ie)*xe/48);for(let xe of[...me].filter((Me)=>Me<ie&&Me>de).sort((Me,Re)=>Re-Me))p((Me)=>O(xe,Me),xe);let Ae=c(0,0,de);for(let xe=0;xe<o;xe++)l(Ae,_[xe],_[(xe+1)%o]);return{positions:i,indices:s}}function iEi(e,t){return Ku(rEi(e,t))}function sEi({color:e="#737e8f",...t}){return Pe(Kn,{color:e,children:Pe(Nd,{geometry:iEi(t)})})}var aEi=ju({name:"panscrew",schema:O7e,render:({fn:e,...t})=>Pe(sEi,{...t}),pads:"none"});function cEi(e){e.register(aEi)}function lEi(e){let t=flt.parse(e),n=Pwn(t),o=n.innerDiameter/2,r=n.outerDiameter/2,i=t.edgeChamfer,s=i>0?[[n.endOuterDiameter/2,0],[r,i],[r,n.length-i],[n.endOuterDiameter/2,n.length],[n.endInnerDiameter/2,n.length],[o,n.length-i],[o,i],[n.endInnerDiameter/2,0]]:[[r,0],[r,n.length],[o,n.length],[o,0]],a=96,c=[],l=[];for(let[h,d]of s)for(let u=0;u<96;u++){let _=u*Math.PI*2/96;c.push(h*Math.cos(_),h*Math.sin(_),d)}for(let h=0;h<s.length;h++){let d=h*96,u=(h+1)%s.length*96;for(let _=0;_<96;_++){let p=(_+1)%96;l.push(d+_,d+p,u+p,d+_,u+p,u+_)}}return{positions:c,indices:l}}function hEi(e){return Ku(lEi(e))}function dEi({color:e="#a18450",...t}){return Pe(Kn,{color:e,children:Pe(Nd,{geometry:hEi(t)})})}var uEi=ju({name:"plainbushing",schema:V7e,render:({fn:e,...t})=>Pe(dEi,{...t}),pads:"none"});function pEi(e){e.register(uEi)}function mEi(e){let t=xlt.parse(e),n=Twn(t);XEe(n.screwHoles);let o=Kdt({outerRadius:t.outerDiameter/2,boreARadius:t.boreDiameter/2,boreBRadius:t.boreBDiameter/2,length:t.length,chamfer:t.chamfer,stepZ:n.boreADepth});return qdt($dt(o,...n.screwHoles.map(WEe)))}function _Ei(e){return Ku(mEi(e))}function gEi({color:e="#737e8f",...t}){return Pe(Kn,{color:e,children:Pe(Nd,{geometry:_Ei(t)})})}var AEi=ju({name:"rigidcoupler",schema:Y7e,render:({fn:e,...t})=>Pe(gEi,{...t}),pads:"none"});function fEi(e){e.register(AEi)}function yEi(e){let t=blt.parse(e),n=kwn(t);XEe([n.screwHole]);let o=Kdt({outerRadius:t.outerDiameter/2,boreARadius:t.boreDiameter/2,length:t.width,chamfer:t.chamfer});return qdt($dt(o,WEe(n.screwHole)))}function xEi(e){return Ku(yEi(e))}function CEi({color:e="#737e8f",...t}){return Pe(Kn,{color:e,children:Pe(Nd,{geometry:xEi(t)})})}var bEi=ju({name:"shaftcollar",schema:G7e,render:({fn:e,...t})=>Pe(CEi,{...t}),pads:"none"});function IEi(e){e.register(bEi)}function vEi(e){let t=(e.shape==="round"?e.diameter:e.width)/2,n=e.shape==="slot"?(e.length-e.width)/2:0;if(n<0)throw Error("Slot length must be at least its width");return Array.from({length:64},(o,r)=>{if(e.shape==="round"){let l=r*Math.PI/32;return{u:e.u+t*Math.cos(l),v:e.v+t*Math.sin(l)}}let i=r<32?1:-1,s=-Math.PI/2+(r<32?r:r-32)*Math.PI/31+(r<32?0:Math.PI),a=i*n+t*Math.cos(s),c=t*Math.sin(s);return e.shape==="slot"&&e.axis==="v"?{u:e.u-c,v:e.v+a}:{u:e.u+a,v:e.v+c}})}function SEi(e){let t=gMn.parse(e),{width:n,baseLength:o,flangeHeight:r,thickness:i,profile:s}=t,a=t.insideBendRadius+i/2,c=[],l=[],h=(p,m=!1)=>{let A=c.length/3;for(let g of p)c.push(...g);l.push(A,A+(m?2:1),A+(m?1:2))},d=(p,m=!1)=>{h([p[0],p[1],p[2]],m),h([p[0],p[2],p[3]],m)},u=s==="plate"?["base"]:s==="angle"?["base","right"]:["base","left","right"];for(let p of t.holes)if(!u.includes(p.panel))throw Error(`No ${p.panel} panel on ${s}`);for(let p of u){let m=p==="base"?o:r,A=t.holes.filter((P)=>P.panel===p).map(vEi),g=A.map((P)=>({minU:Math.min(...P.map((M)=>M.u)),maxU:Math.max(...P.map((M)=>M.u)),minV:Math.min(...P.map((M)=>M.v)),maxV:Math.max(...P.map((M)=>M.v))}));for(let[P,M]of g.entries()){if(M.minU<=-m/2||M.maxU>=m/2||M.minV<=-n/2||M.maxV>=n/2)throw Error(`Hole crosses ${p} panel edge or bend tangent`);for(let B of g.slice(0,P))if(M.minU<=B.maxU&&M.maxU>=B.minU&&M.minV<=B.maxV&&M.maxV>=B.minV)throw Error("Hole bounding boxes must not overlap")}let y=[[{u:-m/2,v:-n/2},{u:m/2,v:-n/2},{u:m/2,v:n/2},{u:-m/2,v:n/2}],...A.map((P)=>[...P].reverse())],x=y.flat(),C=A.map((P,M)=>4+M*64),b=V9(x.flatMap((P)=>[P.u,P.v]),C),I=(P,M)=>p==="base"?[P.u,P.v,M]:[(p==="left"?-1:1)*(o/2+a-M),P.v,a+r/2+P.u],v=p==="left";for(let P=0;P<b.length;P+=3){let M=b.slice(P,P+3).map((B)=>x[B]);h(M.map((B)=>I(B,i/2)),v),h(M.map((B)=>I(B,-i/2)),!v)}for(let[P,M]of y.entries())for(let B=0;B<M.length;B++){let T=M[B],N=M[(B+1)%M.length];if(P===0&&T.u===N.u&&(p==="base"&&(T.u>0&&s!=="plate"||T.u<0&&s==="channel")||p!=="base"&&T.u<0))continue;d([I(T,-i/2),I(N,-i/2),I(N,i/2),I(T,i/2)],v)}}let _=s==="plate"?[]:s==="angle"?[1]:[-1,1];for(let p of _){let m=(A,g)=>{let f=a-g.offset;return[p*(o/2+f*Math.sin(A)),g.y,a-f*Math.cos(A)]};for(let A=0;A<32;A++){let g=A*Math.PI/64,f=(A+1)*Math.PI/64;for(let y of[-i/2,i/2])d([m(g,{y:-n/2,offset:y}),m(f,{y:-n/2,offset:y}),m(f,{y:n/2,offset:y}),m(g,{y:n/2,offset:y})],y<0!==p<0);for(let y of[-n/2,n/2])d([m(g,{y,offset:-i/2}),m(f,{y,offset:-i/2}),m(f,{y,offset:i/2}),m(g,{y,offset:i/2})],y>0!==p<0)}}return{positions:c,indices:l}}function PEi(e){return Ku(SEi(e))}function EEi({color:e="#737e8f",...t}){return Pe(Kn,{color:e,material:Fr.brushedMetal,children:Pe(Nd,{geometry:PEi(t)})})}var MEi=ju({name:"sheetmetal",schema:E7e,render:({fn:e,...t})=>Pe(EEi,{...t}),pads:"none"});function wEi(e){e.register(MEi)}function BEi(e){return Ku(SPi(e))}function TEi({color:e="#737e8f",...t}){return Pe(Kn,{color:e,children:Pe(Nd,{geometry:BEi(t)})})}var DEi=ju({name:"spurgear",schema:C7e,render:({fn:e,...t})=>Pe(TEi,{...t}),pads:"none"});function NEi(e){e.register(DEi)}function REi(e){let t=e.radialSegments??96,n=e.segmentsPerPitch??32;if(!Number.isInteger(t)||t<24||t>192||t%12!==0||!Number.isInteger(n)||n<8||n>64)throw Error("Mesh resolution limit: radial segments must be a multiple of 12 in [24,192], pitch segments an integer in [8,64]");return{radial:t,axial:n}}function QEi(e){let t=[],n=[];return{positions:t,indices:n,ring:(s,a)=>{let c=t.length/3;for(let l=0;l<e;l++){let h=l*2*Math.PI/e,d=a(h);t.push(d*Math.cos(h),d*Math.sin(h),s)}return c},connect:(s,a)=>{for(let c=0;c<e;c++){let l=(c+1)%e;n.push(s+c,s+l,a+l,s+c,a+l,a+c)}},cap:(s,a,c)=>{let l=t.length/3;t.push(0,0,a);for(let h=0;h<e;h++){let d=(h+1)%e;n.push(l,s+(c?h:d),s+(c?d:h))}}}}function kEi(e,t,n,o=1){let r=((e/n-o*t/(2*Math.PI))%1+1)%1;return Math.min(r,1-r)}function LEi(e,t={}){let n=vlt.parse(e),o=Own(e),{radial:r,axial:i}=REi(t),s=Math.max(2,Math.ceil(o.length/o.threadPitch*i));if(s>24000||!Number.isFinite(s)||Math.min(o.minorDiameter,o.endDiameter)<o.diameter*0.00000001)throw Error("Mesh resolution limit: excessive turns or vanishing end/root radius");let a=QEi(r),c=new Set(Array.from({length:s+1},(u,_)=>o.length*_/s));c.add(n.chamfer),c.add(o.length-n.chamfer);let l=o.diameter/2,h=(o.diameter-o.minorDiameter)/2,d=-1;for(let u of[...c].sort((_,p)=>_-p)){let _=a.ring(u,(p)=>{let m=Math.min(h,Math.max(0,(kEi(u,p,o.threadPitch,n.threadHand==="right"?1:-1)-0.0625)*o.threadPitch*Math.sqrt(3))),A=l-Math.max(0,n.chamfer-Math.min(u,o.length-u));return Math.min(l-m,A)});if(d<0)a.cap(_,u,!1);else a.connect(d,_);d=_}return a.cap(d,o.length,!0),{positions:a.positions,indices:a.indices}}function HEi(e,t){return Ku(LEi(e,t))}function FEi({color:e="#737e8f",...t}){return Pe(Kn,{color:e,children:Pe(Nd,{geometry:HEi(t)})})}var zEi=ju({name:"threadedrod",schema:U7e,render:({fn:e,...t})=>Pe(FEi,{...t}),pads:"none"});function OEi(e){e.register(zEi)}function VEi(e,t={}){let n=W7e.parse(e),o=Slt(n),r=t.segmentsPerTurn??64,i=t.wireSegments??24;for(let[p,m,A,g]of[["segmentsPerTurn",r,16,256],["wireSegments",i,8,64]])if(!Number.isInteger(m)||m<A||m>g||m%4!==0)throw Error(`${p} must be a multiple of four in [${A},${g}]`);let s=Math.ceil(n.turns*r);if((s+3)*i+2>250000)throw Error("Spring exceeds mesh resolution limit (250000 vertices)");let a=Math.max(n.outerDiameter,o.axialAdvance,n.startLegLength,n.endLegLength);if(Math.min(n.wireDiameter,n.startLegLength,n.endLegLength,o.insideDiameter,n.pitch-n.wireDiameter)<=a*0.0000000001)throw Error("Spring clearance exceeds mesh resolution limits");let c=[0,...Array.from({length:s+1},(p,m)=>n.startLegLength+o.coilLength*m/s),o.centerlineLength],l={...n,leftHand:!1},h=[],d=[];for(let p of c){let m=j7e(l,p);for(let A=0;A<i;A++){let g=2*Math.PI*A/i,f=A===i/4||A===3*i/4?0:Math.cos(g),y=A===0||A===i/2?0:Math.sin(g);for(let x=0;x<3;x++)h.push(m.position[x]+n.wireDiameter/2*(m.normal[x]*f+m.binormal[x]*y))}}for(let p=0;p<c.length-1;p++)for(let m=0;m<i;m++){let A=(m+1)%i,g=p*i,f=(p+1)*i;d.push(g+m,g+A,f+m,g+A,f+A,f+m)}let u=h.length/3;h.push(...j7e(l,0).position,...j7e(l,o.centerlineLength).position);let _=(c.length-1)*i;for(let p=0;p<i;p++){let m=(p+1)%i;d.push(u,m,p,u+1,_+p,_+m)}if(n.leftHand){for(let p=1;p<h.length;p+=3)h[p]=-h[p];for(let p=0;p<d.length;p+=3)[d[p+1],d[p+2]]=[d[p+2],d[p+1]]}return{positions:h,indices:d}}function YEi(e){return Ku(VEi(e))}function GEi({color:e="#929ba6",...t}){return Pe(Kn,{color:e,children:Pe(Nd,{geometry:YEi(t)})})}var UEi=ju({name:"torsionspring",schema:X7e,render:({fn:e,...t})=>Pe(GEi,{...t}),pads:"none"});function WEi(e){e.register(UEi)}function q0e({outer:e,holes:t=[],start:n,end:o,project:r=(a,c,l)=>[a,c,l],reverse:i=!1,skipWall:s=()=>!1}){let a=(A,g)=>{A=A.filter((y,x)=>{let C=A[(x+A.length-1)%A.length];return y[0]!==C[0]||y[1]!==C[1]});let f=A.reduce((y,x,C)=>{let b=A[(C+1)%A.length];return y+x[0]*b[1]-x[1]*b[0]},0);if(!Number.isFinite(f)||f===0)throw Error("Profile exceeds mesh resolution limits");return f<0===g?A:[...A].reverse()},c=[a(e,!1),...t.map((A)=>a(A,!0))],l=c.flat(),h=[],d=c[0].length;for(let A of c.slice(1))h.push(d),d+=A.length;let u=V9(l.flat(),h),_=[n,o].flatMap((A)=>l.flatMap(([g,f])=>r(g,f,A))),p=[];for(let A=0;A<u.length;A+=3){let[g,f,y]=u.slice(A,A+3);p.push(g,y,f,g+d,f+d,y+d)}let m=0;for(let[A,g]of c.entries()){for(let f=0;f<g.length;f++){let y=(f+1)%g.length;if(A===0&&s(g[f],g[y]))continue;let x=m+f,C=m+y;p.push(x,C,C+d,x,C+d,x+d)}m+=g.length}if(i)for(let A=0;A<p.length;A+=3)[p[A+1],p[A+2]]=[p[A+2],p[A+1]];return{positions:_,indices:p}}function XEi(e){let t=[],n=[],o=new Map;for(let r of e)for(let i of r.indices){let s=r.positions.slice(i*3,i*3+3),a=s.map((l)=>l.toFixed(12)).join(","),c=o.get(a);if(c===void 0)c=t.length/3,o.set(a,c),t.push(...s);n.push(c)}return{positions:t,indices:n}}function Zdt(e,t,n,o=96){return Array.from({length:o},(r,i)=>{let s=i*2*Math.PI/o;return[e+n*Math.cos(s),t+n*Math.sin(s)]})}function jEi(e={}){let t=Kwn.parse(e),{width:n,height:o,length:r,cornerRadius:i,lipThickness:s,pocketDepth:a}=t,c=t.slotWidth/2,l=t.pocketWidth/2,h=s+a,d=[];for(let u=0;u<4;u++){let _=(u%2===0?n:o)/2,p=(u%2===0?o:n)/2,m=[[-_+i,-p],[-c,-p],[-c,-p+s],[-l,-p+s],[-l,-p+h],[l,-p+h],[l,-p+s],[c,-p+s],[c,-p],[_-i,-p]];if(i>0)for(let A=1;A<24;A++){let g=-Math.PI/2+A*Math.PI/48;m.push([_-i+i*Math.cos(g),-p+i+i*Math.sin(g)])}for(let[A,g]of m)d.push(u===0?[A,g]:u===1?[-g,A]:u===2?[-A,-g]:[g,-A])}return q0e({outer:d,holes:t.boreDiameter>0?[Zdt(0,0,t.boreDiameter/2)]:[],start:0,end:r})}function KEi(e={}){return Ku(jEi(e))}function $Ei({color:e="#8995a3",...t}){return Pe(Kn,{color:e,children:Pe(Nd,{geometry:KEi(t)})})}var qEi=ju({name:"tslotextrusion",schema:K7e,render:({fn:e,...t})=>Pe($Ei,{...t}),pads:"none"});function JEi(e){e.register(qEi)}function ZEi(e={}){let t=Plt.parse(e),n=Zwn(t).map((o)=>{let r=o.width/2,i=(o.length-o.width)/2,s=(c,l)=>o.orientation===0?[o.center.x+c,o.center.y+l]:[o.center.x-l,o.center.y+c];if(i===0)return Zdt(0,0,r).map(([c,l])=>s(c,l));let a=[];for(let c of[1,-1])for(let l=0;l<=48;l++){let h=-Math.PI/2+l*Math.PI/48+(c<0?Math.PI:0);a.push(s(c*i+r*Math.cos(h),r*Math.sin(h)))}return a});return q0e({outer:[[0,0],[t.width,0],[0,t.height]],holes:n,start:0,end:t.thickness})}function eMi(e={}){return Ku(ZEi(e))}function tMi({color:e="#8995a3",...t}){return Pe(Kn,{color:e,children:Pe(Nd,{geometry:eMi(t)})})}var nMi=ju({name:"tslotgusset",schema:$7e,render:({fn:e,...t})=>Pe(tMi,{...t}),pads:"none"});function oMi(e){e.register(nMi)}function rMi(e={}){let t=oBn.parse(e),{width:n,legLength:o,thickness:r,bendRadius:i,holeOffset:s,holeDiameter:a}=t,c=i,l=c+r,h=[[c,-n/2],[o,-n/2],[o,n/2],[c,n/2]],d=[Zdt(s,0,a/2)],u=[];if(c===0)u.push([0,0]);else for(let _=0;_<=48;_++){let p=-Math.PI/2-_*Math.PI/96;u.push(_===0?[c,0]:_===48?[0,c]:[c+c*Math.cos(p),c+c*Math.sin(p)])}for(let _=0;_<=48;_++){let p=-Math.PI+_*Math.PI/96;u.push(_===0?[-r,c]:_===48?[c,-r]:[c+l*Math.cos(p),c+l*Math.sin(p)])}return XEi([q0e({outer:h,holes:d,start:-r,end:0,skipWall:(_,p)=>_[0]===c&&p[0]===c}),q0e({outer:h,holes:d,start:-r,end:0,project:(_,p,m)=>[m,p,_],reverse:!0,skipWall:(_,p)=>_[0]===c&&p[0]===c}),q0e({outer:u,start:-n/2,end:n/2,project:(_,p,m)=>[_,m,p],reverse:!0,skipWall:(_,p)=>_[0]===c&&p[0]===c||_[1]===c&&p[1]===c})])}function iMi(e={}){return Ku(rMi(e))}function sMi({color:e="#8995a3",...t}){return Pe(Kn,{color:e,children:Pe(Nd,{geometry:iMi(t)})})}var aMi=ju({name:"tslotinsidecorner",schema:q7e,render:({fn:e,...t})=>Pe(sMi,{...t}),pads:"none"});function cMi(e){e.register(aMi)}var lMi=(e)=>{let t=slt.parse(e),{outsideDiameter:n,rootDiameter:o,axialPitch:r,lead:i,toothThickness:s}=EMn(t),a=n/2,c=o/2,l=t.pitchDiameter/2,h=Math.tan(t.pressureAngle*Math.PI/180),d=s/2-t.module*h,u=s/2+(t.module+t.clearance)*h,_=t.boreDiameter/2,p=_>0?Math.acos(_/c)*0.8:1/0,m=Math.max(Math.ceil(t.radialSegments/t.starts),Math.ceil(Math.PI*2/(t.starts*p))),A=Math.max(t.segmentsPerTurn,t.radialSegments,t.starts*12,Math.ceil(Math.PI*2/p)),g=Math.max(1,Math.ceil(t.length/i*A)),f=_>0?t.radialSegments*2:2;if(!Number.isFinite(m)||!Number.isFinite(g)||(g+1)*(m+6)*t.starts+f>1e6)throw Error("Worm gear exceeds mesh resolution limit (1000000 vertices); reduce length or resolution, or increase module or bore wall thickness");let y=[0,d/r,s/(2*r),u/r,1-u/r,1-s/(2*r),1-d/r,1],x=[];for(let H=0;H<y.length-1;H++){let V=y[H],O=y[H+1]-V,U=Math.max(1,Math.ceil(O*m));for(let j=0;j<U;j++){let Y=V+O*j/U;if(x.length===0||Y-x[x.length-1]>0.000000000001)x.push(Y)}}let C=[];for(let H=0;H<t.starts;H++)for(let V of x){let O=Math.min(V,1-V)*r;C.push({angle:(H+V)*Math.PI*2/t.starts,radius:O<=d?a:O>=u?c:l+(s/2-O)/h})}let b=C.length,I=[],v=[],P=t.phase%360*Math.PI/180,M=t.handedness==="right"?1:-1,B=(H)=>{let V=I.length/3,O=P+M*(H/i)*Math.PI*2;for(let U of C){let j=U.angle+O;I.push(U.radius*Math.cos(j),U.radius*Math.sin(j),H)}return V},T=(H,V)=>{for(let O=0;O<b;O++){let U=(O+1)%b;v.push(H+O,H+U,V+U,H+O,V+U,V+O)}},N=B(0),D=N;for(let H=1;H<=g;H++){let V=B(t.length*(H/g));T(D,V),D=V}let L=D;if(t.boreDiameter===0){let H=(V,O,U)=>{let j=I.length/3;I.push(0,0,O);for(let Y=0;Y<b;Y++){let X=(Y+1)%b;v.push(j,V+(U?Y:X),V+(U?X:Y))}};H(N,0,!1),H(L,t.length,!0)}else{let H=t.radialSegments,V=(Y)=>{let X=I.length/3;for(let K=0;K<H;K++){let J=P+K*Math.PI*2/H;I.push(_*Math.cos(J),_*Math.sin(J),Y)}return X},O=V(0),U=V(t.length);for(let Y=0;Y<H;Y++){let X=(Y+1)%H;v.push(O+Y,U+X,O+X,O+Y,U+Y,U+X)}let j=(Y,X,K)=>{let J=Array.from({length:b},(ne,re)=>Y+re);J.push(...Array.from({length:H},(ne,re)=>X+re));let ee=J.flatMap((ne)=>[I[ne*3],I[ne*3+1]]),se=V9(ee,[b],2);for(let ne=0;ne<se.length;ne+=3){let re=J[se[ne]],Z=J[se[ne+1]],te=J[se[ne+2]],ie=(I[Z*3]-I[re*3])*(I[te*3+1]-I[re*3+1])-(I[Z*3+1]-I[re*3+1])*(I[te*3]-I[re*3]);v.push(re,ie>0===K?Z:te,ie>0===K?te:Z)}};j(N,O,!1),j(L,U,!0)}return{positions:I,indices:v}};function hMi(e){return Ku(lMi(e))}function dMi({color:e="#737e8f",...t}){return Pe(Kn,{color:e,children:Pe(Nd,{geometry:hMi(t)})})}var uMi=ju({name:"wormgear",schema:w7e,render:({fn:e,...t})=>Pe(dMi,{...t}),pads:"none"});function pMi(e){e.register(uMi)}function mMi(e){TSi(e),FSi(e),GSi(e),KSi(e),tPi(e),sPi(e),dPi(e),vPi(e),BPi(e),QPi(e),YPi(e),XPi(e),JPi(e),oEi(e),cEi(e),pEi(e),fEi(e),IEi(e),wEi(e),NEi(e),OEi(e),WEi(e),JEi(e),oMi(e),cMi(e),pMi(e)}var NWn=new bSi;mMi(NWn);function _Mi(e){for(let o of["bodyWidth","bodyLength","bodyHeight","pitch","landWidth","landLength","landThickness"])if(!Number.isFinite(e[o])||e[o]<=0)throw Error(`${o} must be finite and positive`);for(let o of["landsPerSideX","landsPerSideY"])if(!Number.isInteger(e[o])||e[o]<0)throw Error(`${o} must be a nonnegative integer`);if(!Number.isFinite(e.edgeInset)||e.edgeInset<0||e.landThickness>=e.bodyHeight||e.landWidth>=e.pitch||e.landsPerSideX+e.landsPerSideY<1)throw Error("Invalid land layout or thickness");let t=[{count:e.landsPerSideX,across:e.bodyWidth,along:e.bodyLength,horizontal:!0},{count:e.landsPerSideY,across:e.bodyLength,along:e.bodyWidth,horizontal:!1}];for(let o of t){if(o.count===0)continue;let r=(o.count-1)*e.pitch+e.landWidth;if(r>=o.along-2*e.edgeInset||2*(e.edgeInset+e.landLength)>=o.across)throw Error("Lands must fit below the body without opposite-row overlap");let i=o.horizontal?e.landsPerSideY:e.landsPerSideX;if(i>0&&r>=o.along-2*(e.edgeInset+e.landLength)&&(i-1)*e.pitch+e.landWidth>=o.across-2*(e.edgeInset+e.landLength))throw Error("Adjacent land rows overlap at corners")}let n=Math.min(e.bodyWidth,e.bodyLength)*0.035;return gn($o,{children:[Pe(Kn,{color:"#353535",children:gn(jl,{children:[Pe(go,{z:(e.bodyHeight+e.landThickness/2)/2,children:Pe(Ft,{size:[e.bodyWidth,e.bodyLength,e.bodyHeight-e.landThickness/2]})}),Pe(go,{offset:[-e.bodyWidth/2+2*n,e.bodyLength/2-2*n,e.bodyHeight],children:Pe(Ki,{radius:n,height:Math.min(0.04,e.bodyHeight/10)})})]})}),Pe(Kn,{color:"#c5b987",children:t.flatMap((o)=>[-1,1].flatMap((r)=>Array.from({length:o.count},(i,s)=>{let a=r*(o.across/2-e.edgeInset-e.landLength/2),c=((o.count-1)/2-s)*e.pitch;return Pe(go,{offset:[o.horizontal?a:c,o.horizontal?c:a,e.landThickness/2],children:Pe(Ft,{size:o.horizontal?[e.landLength,e.landWidth,e.landThickness]:[e.landWidth,e.landLength,e.landThickness]})},`${o.horizontal}-${r}-${s}`)})))})]})}function KEe(e){let{pinCount:t,pitch:n,bodyWidth:o,bodyLength:r,bodyHeight:i,standoff:s,leadSpan:a,leadWidth:c,leadThickness:l,contactLength:h,taperInset:d,exposedPadWidth:u=0,exposedPadLength:_=0}=e;for(let I of["pitch","bodyWidth","bodyLength","bodyHeight","leadSpan","leadWidth","leadThickness","contactLength"])if(!Number.isFinite(e[I])||e[I]<=0)throw Error(`${I} must be finite and positive`);for(let[I,v]of Object.entries({standoff:s,taperInset:d,exposedPadWidth:u,exposedPadLength:_}))if(!Number.isFinite(v)||v<0)throw Error(`${I} must be finite and nonnegative`);if(!Number.isInteger(t)||t<4||t%2)throw Error("pinCount must be even and at least 4");let p=i-s,m=(a-o)/2,A=(t/2-1)*n+c;if(p<=l*2||c>=n||A>=r-2*d||d*2>=Math.min(o,r)||h>=m)throw Error("Invalid mold, lead spacing, or terminal reach");if(u===0!==(_===0)||u>=o-2*d||_>=r-2*d)throw Error("Exposed pad must fit inside the bottom mold face");let g=s+p/2,f=Math.min(0.002,p/100),y=gn(oc,{children:[Pe(go,{z:s+f/2,children:Pe(Ft,{size:[o-2*d,r-2*d,f]})}),Pe(go,{z:g,children:Pe(Ft,{size:[o,r,f]})}),Pe(go,{z:i-f/2,children:Pe(Ft,{size:[o-2*d,r-2*d,f]})})]}),x=Math.min(o,r)*0.045,C=Math.min(0.04,p/10),b=(I,v)=>{let P=a/2,M=o/2-Math.min(o/8,0.15),B=P-h,T=o/2+Math.min(0.08,(m-h)/4),N=[[P-f/2,l/2],[B,l/2]];for(let L=1;L<=12;L++){let H=L/12;N.push([B+(T-B)*H,l/2+(g-l/2)*H*H*(3-2*H)])}N.push([M,g]);let D=([L,H])=>Pe(go,{offset:{x:I*L,y:v,z:H},children:Pe(Ft,{size:[f,c,l]})});return Pe(rp,{children:N.slice(1).map((L,H)=>gn(oc,{children:[D(N[H]),D(L)]},H))})};return gn($o,{children:[Pe(Kn,{color:"#353535",children:gn(jl,{children:[y,Pe(go,{offset:{x:-o/2+d+x*2,y:r/2-d-x*2,z:i},children:Pe(Ki,{radius:x,height:C*2})})]})}),Pe(Kn,{color:"#bfc1c4",children:Array.from({length:t},(I,v)=>b(v<t/2?-1:1,((t/2-1)/2-v%(t/2))*n))}),u>0&&Pe(Kn,{color:"#bfc1c4",children:Pe(go,{z:(s+l)/2,children:Pe(Ft,{size:[u,_,s+l]})})})]})}var gMi=(e)=>KEe(e);function AMi(e){if(e.bodywidth===void 0&&e.bodyheight===void 0&&e.bodythickness===void 0)return null;if(e.fn==="ssop"){let t=e.bodywidth??e.w*0.55,n=e.bodyheight??(e.num_pins/2-1)*e.p+e.pw+0.4,o=e.bodythickness??1,r=Math.min(e.pw,e.p*0.5),i=(e.num_pins/2-1)*e.p+r;if(n<=i)throw Error("SSOP bodyheight must contain the lead row");let s=Math.max(e.w+0.2+e.pl/2,t+e.p),a=Math.min(0.1,o/10);return Pe(gMi,{pinCount:e.num_pins,pitch:e.p,bodyWidth:t,bodyLength:n,bodyHeight:o+a,standoff:a,leadSpan:s,leadWidth:r,leadThickness:Math.min(0.15,o/4),contactLength:Math.min(e.pl/2,(s-t)/4),taperInset:Math.min(0.12,(n-i)/4,t/8)})}if(e.fn==="lga"){let t=e.bodywidth??e.w,n=e.bodyheight??e.h,o=e.bodythickness??1,r=e.grid,i=Math.min(e.pw,e.p/2),s=t-((r.y-1)*e.p+i),a=n-((r.x-1)*e.p+i),c=Math.min(e.pl/2,t/8,n/8,s/4,a/4);return Pe(_Mi,{bodyWidth:t,bodyLength:n,bodyHeight:o,landsPerSideX:r.x,landsPerSideY:r.y,pitch:e.p,landWidth:i,landLength:c,edgeInset:0,landThickness:Math.min(0.015,o/10)})}return null}var hu=({center:e,width:t,length:n,height:o,heightAboveSurface:r=0.15,color:i="#555",taperRatio:s=0.12,faceRatio:a=0.75,straightHeightRatio:c=0.5,includeNotch:l=!0,notchRadius:h,notchPosition:d,notchRotation:u=[0,0,0],notchLength:_=0.5,notchWidth:p=0.25,chamferSize:m=0})=>{let A=o*c,g=o-A,f=Math.min(t,n)*s,y=Math.max(t-f,t*a),x=Math.max(n-f,n*a),C=Math.min(t,n)*0.12,b=h??C,I={x:0,y:n/2-b*0.25,z:o},v=d??I,P=gn(rp,{children:[gn(oc,{children:[Pe(go,{z:0.005,children:Pe(Ft,{size:[y,x,0.01]})}),Pe(go,{z:A,children:Pe(Ft,{size:[t,n,0.01]})})]}),gn(oc,{children:[Pe(go,{z:A,children:Pe(Ft,{size:[t,n,0.01]})}),Pe(go,{z:A+g,children:Pe(Ft,{size:[y,x,0.01]})})]})]}),M=(T,N)=>Pe(go,{offset:{x:T,y:N,z:0},children:Pe(Ic,{rotation:[0,0,Math.PI/4],children:Pe(Ft,{size:[m*Math.SQRT2,m*Math.SQRT2,o*3]})})}),B=P;if(m>0){let T=t/2,N=n/2;B=gn(jl,{children:[P,M(T,N),M(-T,N),M(T,-N),M(-T,-N)]})}return Pe(Kn,{color:i,material:Fr.moldedPlastic,children:Pe(go,{offset:e,children:Pe(go,{offset:{x:0,y:0,z:r},children:l?gn(jl,{children:[B,Pe(go,{offset:v,children:Pe(Ic,{rotation:u,children:Pe(Ki,{radius:b,height:p})})})]}):B})})})},fMi=(e)=>Array.from({length:e},(t,n)=>n);function eut(e,t){if(e.length<2)throw Error("Stroke must have at least two points");let n=Array.isArray(e[0])?e.map(([h,d])=>({x:h,y:d})):e,o=t/2,r=[],i=[];function s(h,d){let u=d.x-h.x,_=d.y-h.y,p=Math.sqrt(u*u+_*_);return{x:-_/p,y:u/p}}function a(h,d,u){let _={x:h.x+d.x*o*u,y:h.y+d.y*o*u};if(u>0)r.push(_);else i.unshift(_)}let c=s(n[0],n[1]);a(n[0],c,1),a(n[0],c,-1);for(let h=1;h<n.length-1;h++){let d=n[h-1],u=n[h],_=n[h+1],p=s(d,u),m=s(u,_),A=p.x+m.x,g=p.y+m.y,f=Math.sqrt(A*A+g*g),y=2;if(f/2>2*o)a(u,p,1),a(u,m,1),a(u,p,-1),a(u,m,-1);else{let x=1/f;a(u,{x:A*x,y:g*x},1),a(u,{x:A*x,y:g*x},-1)}}let l=s(n[n.length-2],n[n.length-1]);return a(n[n.length-1],l,1),a(n[n.length-1],l,-1),[...r,...i]}var yMi=(e)=>{let t=Math.min(...e.map((a)=>a.x)),n=Math.max(...e.map((a)=>a.x)),o=Math.min(...e.map((a)=>a.y)),s=5.47/(Math.max(...e.map((a)=>a.y))-o);return e.map((a)=>({x:(a.x-t-(n-t)/2)*s,y:(a.y-o)*s}))},xMi=yMi([{x:20,y:105},{x:20,y:109},{x:20,y:102},{x:26,y:102},{x:26,y:109},{x:24,y:111},{x:24,y:118},{x:22,y:118},{x:22,y:111},{x:20,y:109}]),$Un=5.47,VEe=0.5,CMi=({x:e,y:t,z:n})=>{let o=e>0;return gn($o,{children:[Pe(go,{material:Fr.tinnedLead,offset:{x:e+0.125,y:t,z:n},children:Pe(Ic,{rotation:["-90deg",0,"90deg"],children:Pe(lte,{height:0.25,children:Pe(cte,{points:xMi.slice().reverse().map((r)=>[r.x,r.y])})})})}),Pe(go,{offset:{x:e,y:t+(o?1:-1),z:n},children:Pe(Ic,{rotation:["-90deg","90deg",o?"180deg":"0deg"],children:Pe(lte,{height:2,children:Pe(cte,{points:eut([[0,0],[-1,0],[-1,-1]],0.25).map((r)=>[r.x,r.y])})})})})]})},bMi=({numPins:e=8,pitch:t=2.54,bodyWidth:n=6.4,rowSpacing:o})=>{let r=Math.floor(e/2),i=o??(n>=7?n:n+1.22),s=n>=7?i-1.22:n;return gn($o,{children:[fMi(e).map((a)=>{let c=a%r,l=(Math.floor(a/r)-0.5)*2;return Pe(CMi,{x:l*i/2,y:c*t-(r-1)/2*t,z:$Un/2+VEe},a)}),Pe(hu,{width:s,length:r*t+0.5,height:$Un-VEe,heightAboveSurface:VEe,center:{x:0,y:0,z:VEe}})]})};function IMi(e,{height:t,padContactLength:n,curveLength:o,bodyDistance:r,steepness:i=10}){if(!o)o=r*0.3;let s=r-n-o;if(s<0)o+=s,s=0;let a=n*0.75,c=n+o+(r-n-o)*0.25;if(e<=a)return 0;if(e>=c)return t;let l=(e-a)/(c-a);return t/(1+Math.exp(-i*(l-0.5)))}var xi=(e)=>{let{thickness:t,width:n,padContactLength:o,bodyDistance:r,height:i,rotation:s}=e,a=15,c=Array.from({length:15}).map((h,d)=>d/14*r).map((h)=>[h,IMi(h,e)]),l=eut(c,t);return Pe(Kn,{color:"#c4c7ca",material:Fr.tinnedLead,children:Pe(go,{offset:{z:0,y:0,x:0,...e.position},children:Pe(Ic,{rotation:["90deg",0,s??0],children:Pe(go,{offset:{x:0,y:0,z:-n/2},children:Pe(lte,{height:n,children:Pe(cte,{points:l.map((h)=>[h.x,h.y])})})})})})})},vMi=({pinCount:e,leadLength:t,leadWidth:n,pitch:o,bodyWidth:r})=>{let i=Math.ceil(e/2),s=i<=4,a=(i-1)*o/2,c=o*Math.max(i-1,0)+(s?1.5:1.15),l=r-(s?0.66:0.58),h=0.15,d=0.8,u=1.22,_=0.24,p=t*0.5,m=p+Math.max(0.22,Math.min(0.4,t*0.65)),A=r/2+t/2,g=m*0.1,f=Math.min(Math.min(l,c)*0.18,1),y=Math.min(Math.min(l,c)*0.12,0.45);return gn($o,{children:[Array.from({length:i}).map((x,C)=>Pe(xi,{position:{x:-A,y:C*o-a,z:0.075},width:n,thickness:0.15,padContactLength:p,bodyDistance:m,curveLength:g,height:0.8},`left-${C}`)),Array.from({length:i}).map((x,C)=>Pe(xi,{rotation:Math.PI,position:{x:A,y:C*o-a,z:0.075},width:n,thickness:0.15,padContactLength:p,bodyDistance:m,curveLength:g,height:0.8},`right-${C}`)),Pe(hu,{center:{x:0,y:0,z:0},width:l,length:c,height:1.22,notchPosition:{x:-(l/2-f-0.2),y:c/2-f-0.2,z:1.22},notchRadius:y})]})},SMi=(e)=>("leadSpan"in e)?KEe(e):vMi(e),PMi=({pinCount:e,padContactLength:t=0.4,leadWidth:n=0.2,pitch:o=0.65,bodyWidth:r=3})=>{let i=Math.ceil(e/2),s=(i-1)*o/2,a=0.2;return gn($o,{children:[Array.from({length:i}).map((c,l)=>Pe(xi,{position:{x:-r/2-t-0.3,y:l*o-s,z:0.1},width:n,thickness:0.2,padContactLength:t,bodyDistance:t+0.4,height:0.6},l)),Array.from({length:i}).map((c,l)=>Pe(xi,{rotation:Math.PI,position:{x:r/2+t+0.3,y:l*o-s,z:0.1},width:n,thickness:0.2,padContactLength:t,bodyDistance:t+0.4,height:0.6},l)),Pe(hu,{center:{x:0,y:0,z:0.1},width:r,length:r,height:1.1,notchRadius:0.35,heightAboveSurface:0.1,taperRatio:0.09})]})},EMi=(e)=>("leadSpan"in e)?KEe(e):PMi(e),Hdt=1,Edt=0.5,$ee=0.5,V0e=0.2,MMi=Hdt-V0e*2,qUn=({color:e="#333"})=>gn($o,{children:[Pe(Ft,{size:[MMi,Edt,$ee],offset:[0,0,$ee/2],material:Fr.moldedPlastic,color:e}),Pe(Ft,{size:[V0e,$ee,Edt],offset:[Hdt/2-V0e/2,0,$ee/2],material:Fr.tinnedLead,color:"#ccc"}),Pe(Ft,{size:[V0e,$ee,Edt],offset:[-Hdt/2+V0e/2,0,$ee/2],material:Fr.tinnedLead,color:"#ccc"})]}),Fdt=1.6,wMi=Fdt-0.6,YEe=0.3,Mdt=0.85,qee=0.6,JUn=({color:e="#333"})=>gn($o,{children:[Pe(Ft,{size:[wMi,Mdt,qee],offset:[0,0,qee/2],material:Fr.moldedPlastic,color:e}),Pe(Ft,{size:[YEe,Mdt,qee],offset:[Fdt/2-YEe/2,0,qee/2],material:Fr.tinnedLead,color:"#ccc"}),Pe(Ft,{size:[YEe,Mdt,qee],offset:[-Fdt/2+YEe/2,0,qee/2],material:Fr.tinnedLead,color:"#ccc"})]}),BMi={"0402":{length:1,width:0.5,height:0.5,terminalLength:0.2},"0603":{length:1.62,width:0.8,height:0.615,terminalLength:0.21},"0805":{length:2,width:1.25,height:0.75,terminalLength:0.35}};function TMi({footprint:e,color:t="#ffe8a0"}){let n=BMi[e];if(e==="0603")return gn($o,{children:[Pe(Kn,{color:"#f0eee7",children:Pe(oA,{size:[1.2,0.79,0.6],roundRadius:0.02,center:[0,0,0.31]})}),Pe(Kn,{color:"#c7c9ca",children:[-1,1].map((i)=>Pe(Ft,{size:[0.21,0.8,0.22],center:[i*0.705,0,0.11]},i))}),Pe(Kn,{color:t,children:Pe(Ft,{size:[0.72,0.52,0.01],center:[0,0,0.61]})})]});let o=Math.min(0.1,n.height/4),r=0.02;return gn($o,{children:[Pe(Kn,{color:"#f0eee7",children:Pe(go,{z:(n.height+o-r)/2,children:Pe(Ft,{size:[n.length,n.width,n.height-o-r]})})}),Pe(Kn,{color:"#c7c9ca",children:[-1,1].map((i)=>Pe(go,{offset:[i*(n.length-n.terminalLength)/2,0,o/2],children:Pe(Ft,{size:[n.terminalLength,n.width,o]})},i))}),Pe(Kn,{color:t,children:Pe(go,{z:n.height-r/2,children:Pe(Ft,{size:[n.length*0.45,n.width*0.65,r]})})})]})}var zdt=2,wdt=1.25,Jee=0.55,Y0e=0.5,DMi=zdt-Y0e*2,ZUn=({color:e="#333"})=>gn($o,{children:[Pe(Ft,{size:[DMi,wdt,Jee],offset:[0,0,Jee/2],material:Fr.moldedPlastic,color:e}),Pe(Ft,{size:[Y0e,wdt,Jee],offset:[zdt/2-Y0e/2,0,Jee/2],material:Fr.tinnedLead,color:"#ccc"}),Pe(Ft,{size:[Y0e,wdt,Jee],offset:[-zdt/2+Y0e/2,0,Jee/2],material:Fr.tinnedLead,color:"#ccc"})]}),eWn=({pinCount:e,pitch:t,leadWidth:n,padContactLength:o,bodyWidth:r})=>{let i=e/4;if(!t)t=NMi(e,r);if(!o)o=RMi(e);if(!n)n=QMi(e,r);if(!r)r=t*(i+4);let s=o,a=r,c=(i-1)*t/2,l=s*0.5,h=a+2*l,d=h,u=0.8,_=0.15,p=l,m=l*0.5,A=l*0.18;return gn($o,{children:[Array.from({length:i}).map((g,f)=>Pe(xi,{position:{x:-d/2,y:f*t-c,z:_/2},width:n,thickness:_,padContactLength:m,bodyDistance:p,curveLength:A,height:u},`left-${f}`)),Array.from({length:i}).map((g,f)=>Pe(xi,{rotation:Math.PI,position:{x:d/2,y:f*t-c,z:_/2},width:n,thickness:_,padContactLength:m,bodyDistance:p,curveLength:A,height:u},`right-${f}`)),Array.from({length:i}).map((g,f)=>Pe(xi,{rotation:Math.PI/2,position:{x:f*t-c,y:-h/2,z:_/2},width:n,thickness:_,padContactLength:m,bodyDistance:p,curveLength:A,height:u},`bottom-${f}`)),Array.from({length:i}).map((g,f)=>Pe(xi,{rotation:-Math.PI/2,position:{x:f*t-c,y:h/2,z:_/2},width:n,thickness:_,padContactLength:m,bodyDistance:p,curveLength:A,height:u},`top-${f}`)),Pe(hu,{center:{x:0,y:0,z:0},width:r,length:a,height:1.5,taperRatio:0.03,chamferSize:0.7,notchPosition:{x:-(a/2-1.5),y:r/2-1.5,z:1.5},notchRadius:0.75})]})},NMi=(e,t)=>{switch(e){case 44:case 64:return 0.8;case 52:return t===14?1:0.65;case 208:return 0.5;default:return 0.5}},RMi=(e)=>{switch(e){case 32:return 0.6;case 40:return 0.6;case 52:case 64:return 0.65;case 208:return 1.65;default:return 0.6}},QMi=(e,t)=>{switch(e){case 44:case 64:return 0.5;case 52:return t===14?0.45:0.55;case 208:return 0.3;default:return 0.25}},Zee="#c0c0c0",RWn=({x:e,y:t,pinThickness:n,shortSidePinLength:o,longSidePinLength:r,bodyHeight:i,bodyLength:s=2.54,bodyWidth:a=2.54,flipZ:c,smd:l,rightangle:h})=>gn($o,{children:[Pe(go,{y:h?-3:0,children:Pe(Ft,{color:"#222",material:Fr.moldedPlastic,size:[s,a,i],center:[e,t,c(i/2)]})}),Pe(Kn,{color:Zee,material:Fr.goldContact,children:l?Pe(xi,{rotation:-Math.PI/2,position:{x:e,y:t+1,z:n/2},thickness:n,width:n,height:n,padContactLength:2,bodyDistance:3}):gn(oc,{children:[Pe(Ft,{color:Zee,size:[n,n,o*0.9],center:[e,t,c(i*0.9+i/2)]}),Pe(Ft,{color:Zee,size:[n/1.8,n/1.8,o],center:[e,t,c(i+i/2)]})]})}),Pe(Kn,{color:Zee,material:Fr.goldContact,children:Pe(go,{y:h?-3.9:0,z:h?1:0,children:Pe(Ic,{rotation:h?[-Math.PI/2,0,0]:[0,0,0],children:gn(oc,{children:[Pe(Ft,{color:Zee,size:[n,n,r*0.9],center:[e,t,c(-r/2*0.9)]}),Pe(Ft,{color:Zee,size:[n/1.8,n/1.8,r],center:[e,t,c(-r/2)]})]})})})})]}),tWn=({numberOfPins:e,pitch:t=2.54,longSidePinLength:n=6,invert:o,rows:r=1,smd:i,rightangle:s})=>{let l=Math.ceil(e/r),h=2.54,d=3,u=-((l-1)/2)*t,p=!i&&!s?!o:Boolean(o),m=(A)=>p?-A+2:A;return Pe($o,{children:Array.from({length:e},(A,g)=>{let f=Math.floor(g/l),y=g%l,x=u+y*t,C=((r-1)/2-f)*2.54;return Pe(RWn,{x,y:C,pinThickness:0.63,shortSidePinLength:3,longSidePinLength:n,bodyHeight:2,flipZ:m,smd:i,rightangle:s},g)})})};function kMi(e){let{num_pins:t,bodyWidth:n,bodyLength:o,bodyHeight:r,standoff:i,terminalSpanX:s,terminalSpanY:a,terminalThickness:c,padWidth:l,padLength:h,pitch:d,exposedPadWidth:u,exposedPadLength:_}=e;for(let g of["bodyWidth","bodyLength","bodyHeight","terminalSpanX","terminalSpanY","terminalThickness","padWidth","padLength","pitch","exposedPadWidth","exposedPadLength"])if(!Number.isFinite(e[g])||e[g]<=0)throw Error(`${g} must be finite and positive`);if(!Number.isInteger(t)||t<8||t%4)throw Error("num_pins must be divisible by four and at least eight");if(!Number.isFinite(i)||i<0)throw Error("standoff must be finite and nonnegative");let p=(t/4-1)*d+l;if(c<=i||c>=r||l>=d||p>=Math.min(n,o))throw Error("Invalid mold, terminal thickness or spacing");if(s<n||a<o||s/2-h>=n/2||a/2-h>=o/2||u>=Math.min(n,s-2*h)||_>=Math.min(o,a-2*h)||p>=Math.min(s,a)-2*h)throw Error("Terminals must enter the mold and clear the exposed pad and corners");let m=Pe(go,{z:(r+i)/2,children:Pe(Ft,{size:[n,o,r-i]})}),A=Math.min(n,o)*0.035;return gn($o,{children:[Pe(Kn,{color:"#353535",children:gn(jl,{children:[m,Pe(go,{offset:{x:-n/2+A*2,y:o/2-A*2,z:r},children:Pe(Ki,{radius:A,height:Math.min(0.06,(r-i)/5)})})]})}),Pe(Kn,{color:"#bfc1c4",children:Array.from({length:t},(g,f)=>{let y=Math.floor(f/(t/4)),x=((t/4-1)/2-f%(t/4))*d,C=y%2===0,b=y<2?-1:1,I=((C?s:a)-h)/2*b;return Pe(go,{offset:{x:C?I:x,y:C?x:I,z:c/2},children:Pe(Ft,{size:C?[h,l,c]:[l,h,c]})},f)})}),Pe(Kn,{color:"#bfc1c4",children:Pe(go,{z:c/2,children:Pe(Ft,{size:[u,_,c]})})})]})}var LMi=(e)=>{let t=["left","bottom","right","top"],{pin_count:n,pn:o,w:r,h:i,p:s,pl:a,legsoutside:c}=e,l=n/4,h=t[Math.floor((o-1)/l)],d=(o-1)%l,u=s*(l-1),_=s*(l-1),p=c?a/2:-a/2;switch(h){case"left":return{x:-r/2-p,y:_/2-d*s,o:"vert"};case"bottom":return{x:-u/2+d*s,y:-i/2-p,o:"horz"};case"right":return{x:r/2+p,y:-_/2+d*s,o:"vert"};case"top":return{x:u/2-d*s,y:i/2+p,o:"horz"};default:throw Error("Invalid pin number")}},HMi=({num_pins:e,cw:t,ccw:n,startingpin:o})=>{let r=[],i=e/4,s=1,a={};for(let c of o??[])a[c]=!0;if(!a.leftside&&!a.topside&&!a.rightside&&!a.bottomside)a.leftside=!0;if(!a.bottompin&&!a.leftpin&&!a.rightpin&&!a.toppin){if(a.leftside)a.toppin=!0;else if(a.topside)a.rightpin=!0;else if(a.rightside)a.bottompin=!0;else if(a.bottomside)a.leftpin=!0}if(a.leftside&&a.toppin)s=1;else if(a.leftside&&a.bottompin)s=i;else if(a.bottomside&&a.leftpin)s=i+1;else if(a.bottomside&&a.rightpin)s=i*2;else if(a.rightside&&a.bottompin)s=i*2+1;else if(a.rightside&&a.toppin)s=i*3;else if(a.topside&&a.rightpin)s=i*3+1;else if(a.topside&&a.leftpin)s=i*4;r.push(-1);for(let c=0;c<e;c++)if(r[s]=c+1,n||!t){if(s++,s>e)s=1}else if(s--,s<1)s=e;return r},FMi=({num_pins:e=16,bodyWidth:t=9,bodyLength:n=9,bodyThickness:o=0.8,thermalPadSize:r,padWidth:i=0.25,padLength:s=0.25,pitch:a=0.5,thermalPadThickness:c=0.05})=>{let l=HMi({num_pins:e,cw:!0,ccw:!0}),h=[],d=e/4;for(let u=0;u<e;u++){let{x:_,y:p,o:m}=LMi({pin_count:e,pn:u+1,w:t,h:n,p:a,pl:s,legsoutside:!1}),A=i,g=s;if(m==="vert")[A,g]=[g,A];let f=l[u+1];h.push({pn:f,x:_,y:p,pw:A,pl:g})}return gn($o,{children:[Pe(Kn,{material:Fr.tinnedLead,color:"grey",children:Pe(Ft,{center:[0,0,o/2],size:[t,n,o]})}),h.map((u,_)=>Pe(Ft,{center:[u.x,u.y,c/2],size:[u.pw,u.pl,c]},_)),r?.length!==void 0&&r?.width!==void 0&&Pe(Ft,{center:[0,0,c/2],size:[r.width,r.length,c]})]})},zMi=(e)=>("bodyHeight"in e)?kMi(e):FMi(e),nWn=zMi,OMi=()=>gn($o,{children:[Pe(xi,{rotation:Math.PI,position:{x:1.6999999999999997,y:-1,z:0.075},width:0.4,thickness:0.15,padContactLength:0.5,bodyDistance:1.1999999999999997,height:0.95},1),Pe(xi,{rotation:Math.PI,position:{x:1.6999999999999997,y:1,z:0.075},width:0.4,thickness:0.15,padContactLength:0.5,bodyDistance:1.1999999999999997,height:0.95},2),Pe(xi,{position:{x:-1.6999999999999997,y:0,z:0.075},width:0.4,thickness:0.15,padContactLength:0.5,bodyDistance:1.1999999999999997,height:0.95},3),Pe(xi,{position:{x:-1.6999999999999997,y:-1,z:0.075},width:0.4,thickness:0.15,padContactLength:0.5,bodyDistance:1.1999999999999997,height:0.95},1),Pe(xi,{position:{x:-1.6999999999999997,y:1,z:0.075},width:0.4,thickness:0.15,padContactLength:0.5,bodyDistance:1.1999999999999997,height:0.95},2),Pe(hu,{center:{x:0,y:0,z:0},width:1.6,length:2.9,height:1.2})]}),oWn=OMi,VMi=({fullWidth:e=2.9,fullLength:t=2.8,color:n}={})=>{let d=(e-1.3)/2+0.3;return gn($o,{children:[Pe(xi,{position:{x:-e/2,y:0.95,z:0.075},width:0.4,thickness:0.15,padContactLength:0.4,bodyDistance:d,height:0.95},1),Pe(xi,{position:{x:-e/2,y:-0.95,z:0.075},width:0.4,thickness:0.15,padContactLength:0.4,bodyDistance:d,height:0.95},2),Pe(xi,{rotation:Math.PI,position:{x:e/2,y:0,z:0.075},width:0.4,thickness:0.15,padContactLength:0.4,bodyDistance:d,height:0.95},3),Pe(hu,{center:{x:0,y:0,z:0},width:1.3,length:2.9,height:1.1,color:n})]})},YMi=({fullWidth:e=2.9,fullLength:t=2.8})=>{let h=(e-1.92)/2+0.3;return gn($o,{children:[Pe(xi,{rotation:Math.PI,position:{x:e/2,y:0,z:0.075},width:0.4,thickness:0.15,padContactLength:0.25,bodyDistance:h,height:0.45},1),Pe(xi,{position:{x:-e/2,y:-0.95,z:0.075},width:0.4,thickness:0.15,padContactLength:0.25,bodyDistance:h,height:0.45},2),Pe(xi,{position:{x:-e/2,y:0.95,z:0.075},width:0.4,thickness:0.15,padContactLength:0.25,bodyDistance:h,height:0.45},3),Pe(hu,{center:{x:0,y:0,z:0},width:1.92,length:2.9,height:1.1,straightHeightRatio:0.45,heightAboveSurface:0.05})]})},Odt=0.6,Bdt=0.3,ete=0.33,G0e=0.1,GMi=Odt-G0e*2,rWn=({color:e="#333"})=>gn($o,{children:[Pe(Ft,{size:[GMi,Bdt,ete],offset:[0,0,ete/2],material:Fr.moldedPlastic,color:e}),Pe(Ft,{size:[G0e,Bdt,ete],offset:[Odt/2-G0e/2,0,ete/2],material:Fr.tinnedLead,color:"#ccc"}),Pe(Ft,{size:[G0e,Bdt,ete],offset:[-Odt/2+G0e/2,0,ete/2],material:Fr.tinnedLead,color:"#ccc"})]}),Vdt=0.4,Tdt=0.2,tte=0.13,U0e=0.07,UMi=Vdt-U0e*2,iWn=({color:e="#333"})=>gn($o,{children:[Pe(Ft,{size:[UMi,Tdt,tte],offset:[0,0,tte/2],material:Fr.moldedPlastic,color:e}),Pe(Ft,{size:[U0e,Tdt,tte],offset:[Vdt/2-U0e/2,0,tte/2],material:Fr.tinnedLead,color:"#ccc"}),Pe(Ft,{size:[U0e,Tdt,tte],offset:[-Vdt/2+U0e/2,0,tte/2],material:Fr.tinnedLead,color:"#ccc"})]}),Ydt=3.2,Ddt=1.6,nte=0.9,W0e=0.5,WMi=Ydt-W0e*2,sWn=({color:e="#333"})=>gn($o,{children:[Pe(Ft,{size:[WMi,Ddt,nte],offset:[0,0,nte/2],material:Fr.moldedPlastic,color:e}),Pe(Ft,{size:[W0e,Ddt,nte],offset:[Ydt/2-W0e/2,0,nte/2],material:Fr.tinnedLead,color:"#ccc"}),Pe(Ft,{size:[W0e,Ddt,nte],offset:[-Ydt/2+W0e/2,0,nte/2],material:Fr.tinnedLead,color:"#ccc"})]}),Gdt=3.2,Ndt=2.5,ote=1,X0e=0.6,XMi=Gdt-X0e*2,aWn=({color:e="#333"})=>gn($o,{children:[Pe(Ft,{size:[XMi,Ndt,ote],offset:[0,0,ote/2],material:Fr.moldedPlastic,color:e}),Pe(Ft,{size:[X0e,Ndt,ote],offset:[Gdt/2-X0e/2,0,ote/2],material:Fr.tinnedLead,color:"#ccc"}),Pe(Ft,{size:[X0e,Ndt,ote],offset:[-Gdt/2+X0e/2,0,ote/2],material:Fr.tinnedLead,color:"#ccc"})]}),Udt=5,Rdt=2.5,rte=1.4,j0e=0.6,jMi=Udt-j0e*2,cWn=({color:e="#333"})=>gn($o,{children:[Pe(Ft,{size:[jMi,Rdt,rte],offset:[0,0,rte/2],material:Fr.moldedPlastic,color:e}),Pe(Ft,{size:[j0e,Rdt,rte],offset:[Udt/2-j0e/2,0,rte/2],material:Fr.tinnedLead,color:"#ccc"}),Pe(Ft,{size:[j0e,Rdt,rte],offset:[-Udt/2+j0e/2,0,rte/2],material:Fr.tinnedLead,color:"#ccc"})]}),Wdt=6.3,Qdt=3.2,ite=1.8,K0e=0.8,KMi=Wdt-K0e*2,lWn=({color:e="#333"})=>gn($o,{children:[Pe(Ft,{size:[KMi,Qdt,ite],offset:[0,0,ite/2],material:Fr.moldedPlastic,color:e}),Pe(Ft,{size:[K0e,Qdt,ite],offset:[Wdt/2-K0e/2,0,ite/2],material:Fr.tinnedLead,color:"#ccc"}),Pe(Ft,{size:[K0e,Qdt,ite],offset:[-Wdt/2+K0e/2,0,ite/2],material:Fr.tinnedLead,color:"#ccc"})]}),QWn=({x:e,y:t,z:n=0,pitch:o=2.54,legsLength:r=3,innerDiameter:i=0.945,bodyHeight:s=5,bodyLength:a=o,bodyWidth:c=o,flipZ:l})=>{let h=i||0.945,d=h/1.5,u=h,_=u*1.8,p=Math.min(s*0.18,o*0.24),m=s+0.1,A=l(n+m/2),g=n+s-p,f=d*1.6;return gn($o,{children:[Pe(Kn,{color:"#1a1a1a",children:gn(jl,{children:[Pe(Ft,{color:"#000",size:[a,c,s],center:[e,t,l(n+s/2)]}),Pe(Ft,{size:[u,u,m],center:[e,t,A]}),gn(oc,{children:[Pe(Ft,{size:[u,u,0.01],center:[e,t,l(g)]}),Pe(Ft,{size:[_,_,0.01],center:[e,t,l(n+s)]})]})]})}),gn(Kn,{color:"silver",children:[gn(oc,{children:[Pe(Ft,{color:"silver",size:[d,d,r*0.9],center:[e,t,l(n+-r/2*0.9)]}),Pe(Ft,{color:"silver",size:[d/1.8,d/1.8,r],center:[e,t,l(n+-r/2)]})]}),Pe(Ft,{color:"silver",size:[f,f,f*0.5],center:[e,t,l(n+f/2*0.5)]})]})]})},$Mi=({numberOfPins:e,pitch:t=2.54,legsLength:n=3,innerDiameter:o=0.945,rows:r=1,invert:i})=>{let a=Math.ceil(e/r),c=2.54,l=-((a-1)/2)*t,h=(d)=>i?-d+5:d;return Pe($o,{children:Array.from({length:e},(d,u)=>{let _=Math.floor(u/a),p=u%a,m=l+p*t,A=((r-1)/2-_)*2.54;return Pe(QWn,{x:m,y:A,pitch:t,legsLength:n,innerDiameter:o,flipZ:h},u)})})},qMi=({width:e,length:t,innerDiameter:n=1})=>{let o=e,r=t,i=e*0.7,s=n/2.5;return gn($o,{children:[Pe(oA,{color:"#1a1a1f",center:[0,0,i/2],size:[r,r,i],roundRadius:0.3}),Pe(oA,{color:"#f2f2f2",center:[0,0,i+i*0.1/2.5],size:[r,r,i*0.1],roundRadius:0.14}),Pe(Ki,{color:"#1a1a1f",height:i*0.8,radius:o/3,center:[0,0,i+i*0.8/2]}),Pe(Ki,{color:"#1a1a1f",height:i*0.2,radius:n/2,center:[r/3,r/3,i+i*0.1/2]}),Pe(Ki,{color:"#1a1a1f",height:i*0.2,radius:n/2,center:[-r/3,-r/3,i+i*0.1/2]}),Pe(Ki,{color:"#1a1a1f",height:i*0.2,radius:n/2,center:[-r/3,r/3,i+i*0.1/2]}),Pe(Ki,{color:"#1a1a1f",height:i*0.2,radius:n/2,center:[r/3,-r/3,i+i*0.1/2]}),Pe(GEe,{thickness:n/3,width:s,horizontalLength:r*0.8,verticalLength:i/2,position:{x:-o/2,y:-r/2,z:-i*1.2}}),Pe(GEe,{thickness:n/3,width:s,horizontalLength:r*0.8,verticalLength:i/2,position:{x:-o/2,y:r/2,z:-i*1.2},rotation:Math.PI}),Pe(GEe,{thickness:n/3,width:s,horizontalLength:r*0.8,verticalLength:i/2,position:{x:o/2,y:r/2,z:-i*1.2},rotation:Math.PI}),Pe(GEe,{thickness:n/3,width:s,horizontalLength:r*0.8,verticalLength:i/2,position:{x:o/2+n/3.6,y:-r/2,z:-i*1.2}})]})},GEe=(e)=>{let{thickness:t,width:n,horizontalLength:o,verticalLength:r,rotation:i=0,position:s}=e,a=[[0,o],[-r/3,o/3],[-r/5,o/4],[0,0]],c=eut(a,t);return Pe(Kn,{color:"#f2f2f2",children:Pe(go,{offset:{x:s?.x||0,y:s?.y||0,z:s?.z||0},children:Pe(Ic,{rotation:[0,55,i],children:Pe(lte,{height:n,children:Pe(cte,{points:c.map((l)=>[l.y,l.x])})})})})})},JMi=({pinCount:e,leadLength:t,leadWidth:n,pitch:o,bodyWidth:r})=>{let i=Math.ceil(e/2),s=(i-1)*o/2,a=0.25,c=1,l=0.8,h=t*0,d=o*(i-1)+n+0.2,u=r*0.55;return gn($o,{children:[Array.from({length:i}).map((_,p)=>Pe(xi,{position:{x:-r/2-h,y:p*o-s,z:0.125},width:n,thickness:0.25,padContactLength:t/2,bodyDistance:t+0.3,height:0.8},p)),Array.from({length:i}).map((_,p)=>Pe(xi,{rotation:Math.PI,position:{x:r/2+h,y:p*o-s,z:0.125},width:n,thickness:0.25,padContactLength:t/2,bodyDistance:t+0.3,height:0.8},p)),Pe(hu,{center:{x:0,y:0,z:0.125},width:u,length:d,height:1})]})},ZMi=(e)=>("leadSpan"in e)?KEe(e):JMi(e),ewi=({pinCount:e,pitch:t,leadWidth:n,leadLength:o,bodyWidth:r,bodyLength:i})=>{let s=e===8?{pitch:0.65,leadWidth:0.3,leadLength:1.6}:{pitch:0.5,leadWidth:0.225,leadLength:1.45},a=!isNaN(parseFloat(t))?parseFloat(t):s.pitch,c=!isNaN(parseFloat(n))?parseFloat(n)*0.8:s.leadWidth,l=!isNaN(parseFloat(o))?parseFloat(o):s.leadLength,h=!isNaN(parseFloat(r))?parseFloat(r)*0.8:2.6,d=!isNaN(parseFloat(i))?parseFloat(i):2+Number(a)*1.4,u=e/2,_=(u-1)*a/2,p=0.15,m=0.8,A=4.5,g=(4.5-h)/2,f=g*0.5;return gn($o,{children:[Array.from({length:u}).map((y,x)=>Pe(xi,{position:{x:-2.25,y:_-x*a,z:0.075},width:c,thickness:0.15,padContactLength:f+0.05,bodyDistance:g+0.1,height:0.8},`left-${x}`)),Array.from({length:u}).map((y,x)=>Pe(xi,{rotation:Math.PI,position:{x:2.25,y:_-x*a,z:0.075},width:c,thickness:0.15,padContactLength:f+0.05,bodyDistance:g+0.1,height:0.8},`right-${x}`)),Pe(hu,{center:{x:0,y:0,z:0.075},width:h,length:d,height:1})]})},twi=()=>gn($o,{children:[Pe(Ft,{color:"#ccc",size:[0.5,0.6,0.12],center:[-0.725,0,0.06]}),Pe(Ft,{color:"#ccc",size:[0.5,0.6,0.12],center:[0.725,0,0.06]}),Pe(Kn,{color:"#222",children:gn(rp,{children:[Pe(go,{z:0.15,children:Pe(Ft,{size:[1.65,0.8,0.3]})}),gn(oc,{children:[Pe(go,{z:0.3,children:Pe(Ft,{size:[1.65,0.8,0.01]})}),Pe(go,{z:0.6,children:Pe(Ft,{size:[1.45,0.6000000000000001,0.01]})})]})]})})]}),hWn=()=>gn($o,{children:[Pe(Ft,{color:"#ccc",size:[0.26,0.51,0.12],center:[-0.325,0,0.06]}),Pe(Ft,{color:"#ccc",size:[0.26,0.51,0.12],center:[0.325,0,0.06]}),Pe(Kn,{color:"#222",children:Pe(go,{z:0.255,children:Pe(Ft,{size:[0.98,0.58,0.47]})})}),Pe(Ft,{color:"#ccc",size:[0.981,0.13,0.065],center:[0,0.13,0.1175]}),Pe(Ft,{color:"#ccc",size:[0.981,0.13,0.065],center:[0,-0.13,0.1175]}),Pe(Ft,{color:"#ccc",size:[0.17333333333333334,0.581,0.065],center:[0.325,0,0.1175]}),Pe(Ft,{color:"#ccc",size:[0.17333333333333334,0.581,0.065],center:[-0.325,0,0.1175]})]}),nwi=()=>{let l=Pe(Kn,{color:"#1a1a1a",children:gn(rp,{children:[gn(oc,{children:[Pe(go,{z:0.13,children:Pe(Ft,{size:[4,3,0.03]})}),Pe(go,{z:1.15,children:Pe(Ft,{size:[4.4,3.4,0.01]})})]}),gn(oc,{children:[Pe(go,{z:1.15,children:Pe(Ft,{size:[4.4,3.4,0.01]})}),Pe(go,{z:2.3,children:Pe(Ft,{size:[4,3,0.01]})})]})]})}),h=({xDir:d})=>{let p=d*1.78,m=d*2.5999999999999996,A=d*1.5999999999999999,g=Math.abs(A-m),f=(m+A)/2;return Pe(Kn,{color:"#c0c0c0",children:gn(rp,{children:[Pe(Ft,{size:[1.8399999999999999,1.45,0.2],center:[p,0,0.1]}),Pe(Ft,{size:[0.2,1.45,1.14],center:[m,0,0.77]}),Pe(Ft,{size:[g,1.45,0.2],center:[f,0,1.24]})]})})};return gn($o,{children:[Pe(h,{xDir:1}),Pe(h,{xDir:-1}),l]})},dWn=()=>{let l=Pe(Kn,{color:"#1a1a1a",children:gn(rp,{children:[gn(oc,{children:[Pe(go,{z:0.13,children:Pe(Ft,{size:[4.199999999999999,3.6,0.03]})}),Pe(go,{z:1.15,children:Pe(Ft,{size:[4.6,4,0.01]})})]}),gn(oc,{children:[Pe(go,{z:1.15,children:Pe(Ft,{size:[4.6,4,0.01]})}),Pe(go,{z:2.3,children:Pe(Ft,{size:[4.199999999999999,3.6,0.01]})})]})]})}),h=({xDir:d})=>{let p=d*2.08,m=d*2.9,A=d*1.9,g=Math.abs(A-m),f=(m+A)/2;return Pe(Kn,{color:"#c0c0c0",children:gn(rp,{children:[Pe(Ft,{size:[1.8399999999999999,1.45,0.2],center:[p,0,0.1]}),Pe(Ft,{size:[0.2,1.45,1.14],center:[m,0,0.77]}),Pe(Ft,{size:[g,1.45,0.2],center:[f,0,1.24]})]})})};return gn($o,{children:[Pe(h,{xDir:1}),Pe(h,{xDir:-1}),l]})},owi=()=>{let l=Pe(Kn,{color:"#1a1a1a",children:gn(rp,{children:[gn(oc,{children:[Pe(go,{z:0.21000000000000002,children:Pe(Ft,{size:[6.3999999999999995,5.6,0.03]})}),Pe(go,{z:1.15,children:Pe(Ft,{size:[6.8,6,0.01]})})]}),gn(oc,{children:[Pe(go,{z:1.15,children:Pe(Ft,{size:[6.8,6,0.01]})}),Pe(go,{z:2.3,children:Pe(Ft,{size:[6.3999999999999995,5.6,0.01]})})]})]})}),h=({xDir:d})=>{let p=d*3.08,m=d*3.9,A=d*2.9,g=Math.abs(A-m),f=(m+A)/2;return Pe(Kn,{color:"#c0c0c0",children:gn(rp,{children:[Pe(Ft,{size:[1.8399999999999999,2.95,0.2],center:[p,0,0.1]}),Pe(Ft,{size:[0.2,2.95,1.14],center:[m,0,0.77]}),Pe(Ft,{size:[g,2.95,0.2],center:[f,0,1.24]})]})})};return gn($o,{children:[Pe(h,{xDir:1}),Pe(h,{xDir:-1}),l]})},rwi=()=>gn($o,{children:[Pe(Ft,{color:"#ccc",size:[1,1.2,0.25],center:[-1.3,0,0.125]}),Pe(Ft,{color:"#ccc",size:[1,1.2,0.25],center:[1.3,0,0.125]}),Pe(Kn,{color:"#222",children:gn(rp,{children:[Pe(go,{z:0.27,children:Pe(Ft,{size:[2.9,1.9,0.54]})}),gn(oc,{children:[Pe(go,{z:0.54,children:Pe(Ft,{size:[2.9,1.9,0.01]})}),Pe(go,{z:1.08,children:Pe(Ft,{size:[2.6999999999999997,1.7,0.01]})})]})]})})]}),iwi=()=>gn($o,{children:[Pe(Ft,{color:"#ccc",size:[1,0.6,0.12],center:[-1.3,0,0.06]}),Pe(Ft,{color:"#ccc",size:[1,0.6,0.12],center:[1.3,0,0.06]}),Pe(Kn,{color:"#222",children:gn(rp,{children:[Pe(go,{z:0.275,children:Pe(Ft,{size:[2.7,1.6,0.55]})}),gn(oc,{children:[Pe(go,{z:0.55,children:Pe(Ft,{size:[2.7,1.6,0.01]})}),Pe(go,{z:1.1,children:Pe(Ft,{size:[2.5,1.4000000000000001,0.01]})})]})]})})]}),swi=()=>gn($o,{children:[Pe(Ft,{color:"#ccc",size:[1,0.9,0.2],center:[-1.3,0,0.1]}),Pe(Ft,{color:"#ccc",size:[1,0.9,0.2],center:[1.3,0,0.1]}),Pe(Kn,{color:"#222",children:gn(rp,{children:[Pe(go,{z:0.1,children:Pe(Ft,{size:[2.75,1.8,0.2]})}),gn(oc,{children:[Pe(go,{z:0.2,children:Pe(Ft,{size:[2.75,1.8,0.01]})}),Pe(go,{z:1,children:Pe(Ft,{size:[2.35,1.4,0.01]})})]})]})}),Pe(Ft,{color:"#777",size:[0.2,1.4,0.01],center:[-0.9,0,1]})]}),uWn=({bodyWidth:e=2.6,bodyLength:t=1.7,bodyHeight:n=1}={})=>{let o=e,r=t*0.53,i=e*0.35,s=0.2,a=-(o/2-0.075),c=o/2-0.075,l=0.4,h=0.1,d=n*0.2;return gn($o,{children:[Pe(Ft,{color:"#ccc",size:[i,r,0.2],center:[a,0,0.1]}),Pe(Ft,{color:"#ccc",size:[i,r,0.2],center:[c,0,0.1]}),Pe(Kn,{color:"#222",children:gn(rp,{children:[gn(oc,{children:[Pe(go,{z:d,children:Pe(Ft,{size:[o-0.05,t-0.05,0.01]})}),Pe(go,{z:0.01,children:Pe(Ft,{size:[o-0.1,t-0.1,0.01]})})]}),gn(oc,{children:[Pe(go,{z:d,children:Pe(Ft,{size:[o,t,0.01]})}),Pe(go,{z:n,children:Pe(Ft,{size:[o-0.4,t-0.4,0.01]})})]})]})}),Pe(Ft,{color:"#777",size:[0.54,t-0.4,0.02],center:[a+0.4,0,n]})]})},awi=({fullWidth:e=3.7,fullLength:t=1.55}={})=>{let n=e-1,o=t,r=1.175,i=0.1,s=1.075,a=0.55,c=0.12,l=0.35,h=(e-n)/2,d=0.25,u=0.2;return gn($o,{children:[Pe(xi,{position:{x:-e/2,y:0,z:0.06},width:0.55,thickness:0.12,padContactLength:0.25,bodyDistance:h,curveLength:0.2,height:0.35}),Pe(xi,{rotation:Math.PI,position:{x:e/2,y:0,z:0.06},width:0.55,thickness:0.12,padContactLength:0.25,bodyDistance:h,curveLength:0.2,height:0.35}),Pe(hu,{center:{x:0,y:0,z:0},width:n,length:o,height:1.075,heightAboveSurface:0.1,includeNotch:!1,color:"#222",taperRatio:0.06,straightHeightRatio:0.6}),Pe(Ft,{color:"#777",size:[0.45,o-0.15,0.02],center:[-n/4,0,1.175]})]})},cwi=()=>gn($o,{children:[Pe(Ft,{color:"#ccc",size:[0.9,1.75,0.2],center:[-1.825,0,0.1]}),Pe(Ft,{color:"#ccc",size:[0.9,1.75,0.2],center:[1.825,0,0.1]}),Pe(Kn,{color:"#222",children:gn(rp,{children:[gn(oc,{children:[Pe(go,{z:0.2,children:Pe(Ft,{size:[3.775,2.475,0.01]})}),Pe(go,{z:0.01,children:Pe(Ft,{size:[3.75,2.45,0.01]})})]}),gn(oc,{children:[Pe(go,{z:0.2,children:Pe(Ft,{size:[3.8,2.5,0.01]})}),Pe(go,{z:1,children:Pe(Ft,{size:[3.4,2.1,0.01]})})]})]})}),Pe(Ft,{color:"#777",size:[0.54,2.1,0.02],center:[-1.4249999999999998,0,1]})]}),lwi=()=>gn($o,{children:[Pe(Ft,{color:"#ccc",size:[0.4,0.25,0.14],center:[-0.4,0,0.07]}),Pe(Ft,{color:"#ccc",size:[0.4,0.25,0.14],center:[0.4,0,0.07]}),Pe(Kn,{color:"#222",children:gn(rp,{children:[Pe(go,{z:0.07,children:Pe(Ft,{size:[0.8,0.6,0.14]})}),gn(oc,{children:[Pe(go,{z:0.14,children:Pe(Ft,{size:[0.8,0.6,0.01]})}),Pe(go,{z:0.37,children:Pe(Ft,{size:[0.7000000000000001,0.5,0.01]})})]})]})})]}),pWn=({fullWidth:e=6.6,bodyWidth:t=3.5,bodyLength:n=6.5,bodyHeight:o=1.7,leadWidth:r=0.7,tabLeadWidth:i=3,padPitch:s=2.3,leadHeight:a=0.75}={})=>{let c=i,l=0.25,h=0.5,d=e-t;return gn($o,{children:[Pe(xi,{rotation:Math.PI,position:{x:e/2+d/4,y:0,z:0.125},width:c,thickness:0.25,padContactLength:0.5,bodyDistance:d,height:a},4),Pe(xi,{position:{x:-e/2-d/4,y:0,z:0.125},width:r,thickness:0.25,padContactLength:0.5,bodyDistance:d,height:a},3),Pe(xi,{position:{x:-e/2-d/4,y:-s,z:0.125},width:r,thickness:0.25,padContactLength:0.5,bodyDistance:d,height:a},1),Pe(xi,{position:{x:-e/2-d/4,y:s,z:0.125},width:r,thickness:0.25,padContactLength:0.5,bodyDistance:d,height:a},2),Pe(hu,{center:{x:0,y:0,z:0},width:t,length:n,height:o,includeNotch:!1,taperRatio:0.06,straightHeightRatio:0.45})]})},hwi=()=>gn($o,{children:[Array.from({length:16}).map((_,p)=>Pe(xi,{position:{x:-5.25,y:p*0.5-3.75,z:0.125},width:0.2,thickness:0.25,padContactLength:0.45,bodyDistance:0.95,height:0.65},`left-${p}`)),Array.from({length:16}).map((_,p)=>Pe(xi,{rotation:Math.PI,position:{x:5.25,y:p*0.5-3.75,z:0.125},width:0.2,thickness:0.25,padContactLength:0.45,bodyDistance:0.95,height:0.65},`right-${p}`)),Array.from({length:16}).map((_,p)=>Pe(xi,{rotation:Math.PI/2,position:{x:p*0.5-3.75,y:-5.25,z:0.125},width:0.2,thickness:0.25,padContactLength:0.45,bodyDistance:0.95,height:0.65},`bottom-${p}`)),Array.from({length:16}).map((_,p)=>Pe(xi,{rotation:-Math.PI/2,position:{x:p*0.5-3.75,y:5.25,z:0.125},width:0.2,thickness:0.25,padContactLength:0.45,bodyDistance:0.95,height:0.65},`top-${p}`)),Pe(hu,{center:{x:0,y:0,z:0},width:9,length:9,height:1.2,chamferSize:0.7,taperRatio:0.05,notchPosition:{x:-3.5,y:3.5,z:1.2},notchRadius:0.6})]}),dwi=hwi,uwi=()=>gn($o,{children:[Pe(xi,{rotation:Math.PI,position:{x:1.2249999999999999,y:0,z:0.09},width:0.3,thickness:0.18,padContactLength:0.2,bodyDistance:0.7999999999999998,height:0.65},4),Pe(xi,{position:{x:-1.2249999999999999,y:-0.65,z:0.09},width:0.3,thickness:0.18,padContactLength:0.2,bodyDistance:0.7999999999999998,height:0.65},1),Pe(xi,{position:{x:-1.2249999999999999,y:0.65,z:0.09},width:0.3,thickness:0.18,padContactLength:0.2,bodyDistance:0.7999999999999998,height:0.65},2),Pe(hu,{center:{x:0,y:0,z:0},width:1.25,length:2,height:0.9,includeNotch:!1,taperRatio:0.06,straightHeightRatio:0.7,heightAboveSurface:0.05})]});function pwi(e){let{pinCount:t,pitch:n,bodyWidth:o,bodyLength:r,bodyHeight:i,standoff:s,leadSpanX:a,leadSpanY:c,leadWidth:l,leadThickness:h,contactLength:d,taperInset:u}=e;for(let b of["pitch","bodyWidth","bodyLength","bodyHeight","leadSpanX","leadSpanY","leadWidth","leadThickness","contactLength"])if(!Number.isFinite(e[b])||e[b]<=0)throw Error(`${b} must be finite and positive`);for(let[b,I]of Object.entries({standoff:s,taperInset:u}))if(!Number.isFinite(I)||I<0)throw Error(`${b} must be finite and nonnegative`);if(!Number.isInteger(t)||t<8||t%4)throw Error("pinCount must be divisible by four and at least eight");let _=i-s,p=Math.min(a-o,c-r)/2,m=(t/4-1)*n+l;if(_<=h*2||l>=n||m>=Math.min(o,r)-2*u||u*2>=Math.min(o,r)||d>=p)throw Error("Invalid mold, lead spacing, or terminal reach");let A=s+_/2,g=Math.min(0.002,_/100),f=gn(oc,{children:[Pe(go,{z:s+g/2,children:Pe(Ft,{size:[o-2*u,r-2*u,g]})}),Pe(go,{z:A,children:Pe(Ft,{size:[o,r,g]})}),Pe(go,{z:i-g/2,children:Pe(Ft,{size:[o-2*u,r-2*u,g]})})]}),y=Math.min(o,r)*0.045,x=Math.min(0.04,_/10),C=(b,I)=>{let v=b%2===0,P=b<2?-1:1,M=v?o:r,B=(v?a:c)/2,T=M/2-Math.min(M/8,0.15),N=B-d,D=M/2+Math.min(0.08,(p-d)/4),L=[[B-g/2,h/2],[N,h/2]];for(let V=1;V<=12;V++){let O=V/12;L.push([N+(D-N)*O,h/2+(A-h/2)*O*O*(3-2*O)])}L.push([T,A]);let H=([V,O])=>Pe(go,{offset:{x:v?P*V:I,y:v?I:P*V,z:O},children:Pe(Ft,{size:v?[g,l,h]:[l,g,h]})});return Pe(rp,{children:L.slice(1).map((V,O)=>gn(oc,{children:[H(L[O]),H(V)]},O))})};return gn($o,{children:[Pe(Kn,{color:"#353535",children:gn(jl,{children:[f,Pe(go,{offset:{x:-o/2+u+y*2,y:r/2-u-y*2,z:i},children:Pe(Ki,{radius:y,height:x*2})})]})}),Pe(Kn,{color:"#bfc1c4",children:Array.from({length:t},(b,I)=>C(Math.floor(I/(t/4)),((t/4-1)/2-I%(t/4))*n))})]})}var mwi=({pinCount:e,pitch:t,leadWidth:n,padContactLength:o,bodyWidth:r})=>{let i=e/4;if(i!==Math.floor(i))throw Error(`LQFP pinCount must be divisible by 4, got ${e}`);if(!t)t=0.5;if(!o)o=0.6;if(!n)n=0.22;if(!r)r=t*(i+4);let s=r,a=(i-1)*t/2,c=s+3.3*o,l=c,h=0.8,d=0.2,u=(l-r)/2+0.4;return gn($o,{children:[Array.from({length:i}).map((_,p)=>Pe(xi,{position:{x:-l/2-0.36,y:p*t-a,z:d/2},width:n,thickness:d,padContactLength:o,bodyDistance:u,height:h},`left-${p}`)),Array.from({length:i}).map((_,p)=>Pe(xi,{rotation:Math.PI,position:{x:l/2+0.36,y:p*t-a,z:d/2},width:n,thickness:d,padContactLength:o,bodyDistance:u,height:h},`right-${p}`)),Array.from({length:i}).map((_,p)=>Pe(xi,{rotation:Math.PI/2,position:{x:p*t-a,y:-c/2-0.36,z:d/2},width:n,thickness:d,padContactLength:o,bodyDistance:u,height:h},`bottom-${p}`)),Array.from({length:i}).map((_,p)=>Pe(xi,{rotation:-Math.PI/2,position:{x:p*t-a,y:c/2+0.36,z:d/2},width:n,thickness:d,padContactLength:o,bodyDistance:u,height:h},`top-${p}`)),Pe(hu,{center:{x:0,y:0,z:0},width:r,length:s,height:1.5,heightAboveSurface:0.1,taperRatio:0.04,chamferSize:0.7,notchPosition:{x:-(s/2-1.5),y:s/2-1.5,z:1.5},notchRadius:0.75})]})},_wi=(e)=>("leadSpanX"in e)?pwi(e):mwi(e),gwi=()=>gn($o,{children:[Pe(Kn,{color:"#222",children:gn(rp,{children:[Pe(Ft,{size:[0.85,1.2,0.20900000000000002],center:[0,0,0.10450000000000001]}),gn(oc,{children:[Pe(go,{z:0.20900000000000002,children:Pe(Ft,{size:[0.85,1.2,0.01]})}),Pe(go,{z:0.38,children:Pe(Ft,{size:[0.75,1.0999999999999999,0.01]})})]})]})}),Pe(Ft,{color:"#ccc",size:[0.3,0.25,0.1],center:[0.55,0,0.05]}),Pe(Ft,{color:"#ccc",size:[0.3,0.2,0.1],center:[-0.55,0.4,0.05]}),Pe(Ft,{color:"#ccc",size:[0.3,0.2,0.1],center:[-0.55,-0.4,0.05]})]}),mWn=({num_pins:e,bodyWidth:t=5.3,bodyLength:n=5.3,bodyThickness:o=1,thermalPadSize:r,padWidth:i=n/5.3*0.6,padLength:s=n/5.3*1,pitch:a=0.5,thermalPadThickness:c=0.2,bodyStyle:l="chamfered",standoff:h=0,terminalInset:d=0,terminalThickness:u=c,pin1TerminalChamfer:_=0,pin1MarkWidth:p=0})=>{if(l==="rectangular"){if(!Number.isInteger(e)||e<2||e%2!==0)throw Error("DFN requires an even pin count of at least two");for(let f of[t,n,o,i,s,a,u])if(!Number.isFinite(f)||f<=0)throw Error("DFN dimensions must be finite and positive");for(let f of[h,d,_,p])if(!Number.isFinite(f)||f<0)throw Error("DFN offsets must be finite and nonnegative");if(u<=h||u>h+o||d+s>=t/2||(e/2-1)*a+i>n||e>2&&i>=a||_>=Math.min(s,i/2)||p>=t/4)throw Error("DFN dimensions leave disconnected or overlapping terminals")}let m=[],A=Math.floor(e/2),g=a*(A-1);for(let f=0;f<e;f++){let y=f<A?"left":"right",x=f%A,C=g/2-x*a,b=s,I=i,v=y==="left"?-t/2+b/2+d:t/2-b/2-d,P=f+1;m.push({pinNumber:P,x:v,y:C,padSizeX:b,padSizeY:I})}if(l==="rectangular"){let f=h+o,y=Math.min(o,n)/100,x=Pe(Ft,{size:[p,n*0.8,y],center:[-t/2+p*1.5,0,f-y/2]}),C=Pe(Ft,{size:[t,n,o],center:[0,0,h+o/2]});return gn($o,{children:[Pe(Kn,{material:Fr.moldedPlastic,color:"#25272a",children:p>0?gn(jl,{children:[C,x]}):C}),Pe(Kn,{material:Fr.tinnedLead,color:"#c7c9cd",children:m.map((b)=>b.pinNumber===1&&_>0?gn(oc,{children:[Pe(Ft,{size:[s-_,i,u],center:[b.x+_/2,b.y,u/2]}),Pe(Ft,{size:[s,i-2*_,u],center:[b.x,b.y,u/2]})]},b.pinNumber):Pe(Ft,{size:[b.padSizeX,b.padSizeY,u],center:[b.x,b.y,u/2]},b.pinNumber))}),r&&Pe(Ft,{material:Fr.tinnedLead,color:"#c7c9cd",size:[r.width,r.length,c],center:[0,0,c/2]}),p>0&&Pe(Kn,{color:"#969997",children:x})]})}return gn($o,{children:[Pe(hu,{center:{x:0,y:0,z:0},width:t,length:n,height:o,heightAboveSurface:0,color:"grey",chamferSize:0.2,taperRatio:0,notchPosition:{x:-(t/2-s),y:n/2-s,z:o}}),m.map((f,y)=>Pe(Ft,{center:[f.x,f.y,c/2],size:[f.padSizeX,f.padSizeY,c]},y)),r?.length!==void 0&&r?.width!==void 0&&Pe(Ft,{center:[0,0,c/2],size:[r.width,r.length,c]})]})},Awi=({bodyLength:e=10.2,bodyWidth:t=4.65,bodyHeight:n=13.46,leadSpacing:o=5,leadDiameter:r=0.8,leadLength:i=12.7,color:s="#ddd",leadColor:a="#b87333"})=>{let c=e/2,l=t/2,h=c-l,d=o/2,u=0.85;return gn($o,{children:[gn(Kn,{color:s,children:[gn(oc,{children:[Pe(Ix,{height:n,roundRadius:0.5,radius:l,center:[-h,0,n]}),Pe(Ix,{height:n,roundRadius:0.5,radius:l,center:[h,0,n]})]}),gn(oc,{children:[Pe(Ix,{height:0.85,roundRadius:0.1,radius:l+0.85,center:[-h,0,n/2+0.425]}),Pe(Ix,{height:0.85,roundRadius:0.1,radius:l+0.85,center:[h,0,n/2+0.425]})]})]}),gn(Kn,{color:a,children:[Pe(Ki,{height:i+n/2,radius:r/2,center:[-d+0.06,0,-(i/2)+n/2]}),Pe(Ki,{height:i+n/2,radius:r/2,center:[d-0.06,0,-(i/2)+n/2]})]})]})},fwi=({bodyLength:e=1.4,bodyDiameter:t=1.1,color:n="#3a3a3aff",contactColor:o="#c6c6c6",cathodeIdentification:r="#111"})=>gn($o,{children:[Pe(Kn,{color:n,children:gn(Ic,{rotation:[0,"90deg",0],children:[Pe(oA,{size:[t,t,e-0.2],roundRadius:0.2,center:[-t/2,0,0.05]}),Pe(Ki,{height:0.1,radius:t/2-0.2,center:[-t/2,0,-e/2+0.1]})]})}),Pe(Kn,{color:r,children:Pe(Ic,{rotation:[0,"90deg",0],children:Pe(oA,{size:[t*1.01,t*1.01,e/3],roundRadius:0.2,center:[-t/2,0,-e/4+0.1]})})}),Pe(Kn,{color:o,children:Pe(Ic,{rotation:[0,"90deg",0],children:Pe(Ix,{height:0.2,radius:t/2,roundRadius:0.06666666666666667,center:[-t/2,0,-e/2]})})}),Pe(Kn,{color:o,children:Pe(Ic,{rotation:[0,"90deg",0],children:Pe(Ix,{height:0.2,radius:t/2,roundRadius:0.06666666666666667,center:[-t/2,0,e/2]})})})]}),_Wn=({bodyLength:e=3.5,bodyDiameter:t=1.5,color:n="#202020",contactColor:o="#c6c6c6",bandColor:r="#f2f2f2"})=>{let s=e-0.8+0.04,a=(e-0.4)/2,c=t/2+0.02,l=0.14,h=-e/2+0.4+0.35;return gn($o,{children:[Pe(Kn,{color:n,children:Pe(Ic,{rotation:[0,"90deg",0],children:Pe(Ix,{height:s,radius:t/2,roundRadius:0.05,center:[-t/2,0,0]})})}),Pe(Kn,{color:r,children:Pe(Ic,{rotation:[0,"90deg",0],children:Pe(Ki,{height:0.14,radius:t/2+0.002,center:[-t/2,0,h]})})}),Pe(Kn,{color:o,children:Pe(Ic,{rotation:[0,"90deg",0],children:Pe(Ix,{height:0.4,radius:c,roundRadius:0.04,center:[-t/2,0,-a]})})}),Pe(Kn,{color:o,children:Pe(Ic,{rotation:[0,"90deg",0],children:Pe(Ix,{height:0.4,radius:c,roundRadius:0.04,center:[-t/2,0,a]})})})]})},ywi=({bodyLength:e=3.9,bodyDiameter:t=2.5,color:n="#3a3a3aff",contactColor:o="#c6c6c6"})=>gn($o,{children:[Pe(Kn,{color:n,children:Pe(Ic,{rotation:[0,"90deg",0],children:Pe(Ix,{height:e,radius:t/2,roundRadius:0.3,center:[-t/2,0,0]})})}),Pe(Kn,{color:o,children:Pe(Ic,{rotation:[0,"90deg",0],children:Pe(Ix,{height:0.55,radius:t/2,roundRadius:0.2,center:[-t/2,0,-e/2]})})}),Pe(Kn,{color:o,children:Pe(Ic,{rotation:[0,"90deg",0],children:Pe(Ix,{height:0.55,radius:t/2,roundRadius:0.2,center:[-t/2,0,e/2]})})})]}),xwi=({pinCount:e,padContactLength:t=0.6,leadWidth:n=0.41,pitch:o=1.27})=>{if(e%2!==0)throw Error("MS012 pinCount must be even");let r=e/2,i=4.9,s=3.9,a=(r-1)*o/2,c=0.2;return gn($o,{children:[Array.from({length:r}).map((l,h)=>Pe(xi,{position:{x:-s/2-t-0.3,y:h*o-a,z:c/2},width:n,thickness:c,padContactLength:t,bodyDistance:t+0.4,height:0.85},h)),Array.from({length:r}).map((l,h)=>Pe(xi,{rotation:Math.PI,position:{x:s/2+t+0.3,y:h*o-a,z:c/2},width:n,thickness:c,padContactLength:t,bodyDistance:t+0.4,height:0.85},`right-${h}`)),Pe(hu,{center:{x:0,y:0,z:c/2},width:s,length:i,height:1.55,notchPosition:{x:-(s/2-1),y:i/2-1,z:1.55},heightAboveSurface:0.17,taperRatio:0.09})]})},Cwi=({pinCount:e=16,padContactLength:t=0.6,leadWidth:n=0.41,pitch:o=1.27})=>{if(e!==16)throw Error("MS013 only supports 16 pins");let r=e/2,i=7.5,s=10.3,a=(r-1)*o/2,c=0.2;return gn($o,{children:[Array.from({length:r}).map((l,h)=>Pe(xi,{position:{x:-i/2-t-0.3,y:h*o-a,z:c/2},width:n,thickness:c,padContactLength:t,bodyDistance:t+0.4,height:0.85},h)),Array.from({length:r}).map((l,h)=>Pe(xi,{rotation:Math.PI,position:{x:i/2+t+0.3,y:h*o-a,z:c/2},width:n,thickness:c,padContactLength:t,bodyDistance:t+0.4,height:0.85},`right-${h}`)),Pe(hu,{center:{x:0,y:0,z:c/2},width:i,length:s,height:1.1,notchPosition:{x:-(i/2-1.5),y:s/2-1.5,z:1.1},heightAboveSurface:0.17,taperRatio:0.05})]})},bwi=[{x:-2.54,y:-1},{x:0,y:-1},{x:2.54,y:-1}],gWn=({mouldedTab:e=!1,leads:t=bwi,bodyWidth:n=10,bodyThickness:o=4.5,bodyHeight:r=9.2,tabHeight:i=6.4,tabThickness:s=1.4,mountingHoleDiameter:a=3.6,standoff:c=3,leadLength:l=3,bodyColor:h="#222",tabColor:d="#ccc",leadColor:u="#d4b106"}={})=>{let _=t.reduce((b,I)=>b+I.x,0)/t.length,p=t.reduce((b,I)=>b+I.y,0)/t.length,m=c,A=m+r,g=A+i,f=p+(o-s)/2,y=g-Math.max(a*0.8,2.6),x=0.8,C=0.5;return gn($o,{children:[Pe(Kn,{color:h,children:Pe(Ft,{size:[n,o,r],center:[_,p,m+r/2]})}),Pe(Kn,{color:e?h:d,children:gn(jl,{children:[Pe(Ft,{size:[n,s,i],center:[_,f,A+i/2]}),Pe(Ic,{rotation:["90deg",0,0],children:Pe(go,{center:[_,y,-f],children:Pe(Ki,{radius:a/2,height:s*3})})})]})}),t.map((b)=>Pe(Kn,{color:u,children:Pe(Ft,{size:[0.8,0.5,c+l],center:[b.x,b.y,(c-l)/2]})},`lead-${b.x}-${b.y}`))]})},Iwi=()=>gn($o,{children:[Pe(xi,{rotation:Math.PI,position:{x:1.6999999999999997,y:-0.95,z:0.075},width:0.4,thickness:0.15,padContactLength:0.5,bodyDistance:1.1999999999999997,height:0.95},1),Pe(xi,{rotation:Math.PI,position:{x:1.6999999999999997,y:0,z:0.075},width:0.4,thickness:0.15,padContactLength:0.5,bodyDistance:1.1999999999999997,height:0.95},2),Pe(xi,{rotation:Math.PI,position:{x:1.6999999999999997,y:0.95,z:0.075},width:0.4,thickness:0.15,padContactLength:0.5,bodyDistance:1.1999999999999997,height:0.95},3),Pe(xi,{position:{x:-1.6999999999999997,y:0,z:0.075},width:0.4,thickness:0.15,padContactLength:0.5,bodyDistance:1.1999999999999997,height:0.95},3),Pe(xi,{position:{x:-1.6999999999999997,y:-0.95,z:0.075},width:0.4,thickness:0.15,padContactLength:0.5,bodyDistance:1.1999999999999997,height:0.95},1),Pe(xi,{position:{x:-1.6999999999999997,y:0.95,z:0.075},width:0.4,thickness:0.15,padContactLength:0.5,bodyDistance:1.1999999999999997,height:0.95},2),Pe(hu,{center:{x:0,y:0,z:0},width:1.6,length:2.9,height:1.2,straightHeightRatio:0.6,notchPosition:{x:-0.4,y:1,z:1.25},notchRadius:0.1})]}),vwi=()=>gn($o,{children:[Pe(hu,{center:{x:0,y:0,z:0},width:0.8,length:1,height:0.37,heightAboveSurface:0,color:"#1a1a1a",taperRatio:0.15,straightHeightRatio:0,notchPosition:{x:-0.2,y:0.3181818181818181,z:0.47}}),[0,1,2].map((l)=>{let h=-0.35+l*0.35;return Pe(Ft,{center:[-0.405,h,0.06],size:[0.19,0.15,0.12]},`left-${l}`)}),[0,1,2].map((l)=>{let h=-0.35+l*0.35;return Pe(Ft,{center:[0.405,h,0.06],size:[0.19,0.15,0.12]},`right-${l}`)})]});var Swi=[{x:-1.27,y:0.98},{x:0,y:2.25},{x:1.27,y:0.98}],Pwi=(e)=>{let t=[e[0],e[e.length-1]],n=-1;for(let o=0;o<e.length;o++)for(let r=o+1;r<e.length;r++){let i=Math.hypot(e[o].x-e[r].x,e[o].y-e[r].y);if(i>n)n=i,t=[e[o],e[r]]}return{outer:t,separation:n}},AWn=({bodyDiameter:e=4.8,bodyHeight:t=4.5,flatCut:n=1.1,leads:o=Swi,standoff:r=1.5,leadLength:i=3,bodyColor:s="#222"}={})=>{let a=e/2,c=0.4,l=0.25,{outer:h,separation:d}=Pwi(o),[u,_]=h,p={x:(u.x+_.x)/2,y:(u.y+_.y)/2},m=Math.max(d,0.001),A={x:(_.x-u.x)/m,y:(_.y-u.y)/m},g=d/2,f=(x)=>{let C=(x-(o.length-1)/2)*g;return{x:p.x+A.x*C,y:p.y+A.y*C}},y=[0.25,0.4,0.25];return gn($o,{children:[Pe(Kn,{color:s,children:gn(jl,{children:[Pe(go,{center:[p.x,p.y,r+t/2],children:Pe(Ki,{radius:a,height:t})}),Pe(go,{center:[p.x,p.y-(a-n/2),r+t/2],children:Pe(Ft,{size:[a*2,n,t+0.2]})})]})}),o.map((x,C)=>{let b=f(C);return gn(go,{center:[0,0,0],children:[gn(oc,{children:[Pe(go,{center:[x.x,x.y,0],children:Pe(Ft,{size:y})}),Pe(go,{center:[b.x,b.y,r],children:Pe(Ft,{size:y})})]}),Pe(go,{center:[x.x,x.y,-i/2],children:Pe(Ft,{size:[0.25,0.4,i]})})]},`lead-${x.x}-${x.y}`)})]})},Ewi=()=>gn($o,{children:[Pe(xi,{rotation:Math.PI,position:{x:1.1875,y:-0.65,z:0.075},width:0.25,thickness:0.15,padContactLength:0.3,bodyDistance:0.75,height:0.85},1),Pe(xi,{rotation:Math.PI,position:{x:1.1875,y:0,z:0.075},width:0.25,thickness:0.15,padContactLength:0.3,bodyDistance:0.75,height:0.85},2),Pe(xi,{rotation:Math.PI,position:{x:1.1875,y:0.65,z:0.075},width:0.25,thickness:0.15,padContactLength:0.3,bodyDistance:0.75,height:0.85},3),Pe(xi,{position:{x:-1.1875,y:0,z:0.075},width:0.25,thickness:0.15,padContactLength:0.3,bodyDistance:0.75,height:0.85},3),Pe(xi,{position:{x:-1.1875,y:-0.65,z:0.075},width:0.25,thickness:0.15,padContactLength:0.3,bodyDistance:0.75,height:0.85},1),Pe(xi,{position:{x:-1.1875,y:0.65,z:0.075},width:0.25,thickness:0.15,padContactLength:0.3,bodyDistance:0.75,height:0.85},2),Pe(hu,{center:{x:0,y:0,z:0},width:1.25,length:2,height:1.1,straightHeightRatio:0.6,notchPosition:{x:-0.375,y:0.75,z:1.1},heightAboveSurface:0.1})]}),Mwi=Ewi,wwi=()=>gn($o,{children:[Pe(hu,{center:{x:0,y:0,z:0.05},width:1,length:1.45,height:0.5,heightAboveSurface:0,color:"#1a1a1a",taperRatio:0,includeNotch:!1}),[0,1,2].map((l)=>{let h=-0.5+l*0.5;return Pe(Ft,{center:[-0.35,h,0.025],size:[0.3,0.2,0.05]},`left-${l}`)}),[0,1,2].map((l)=>{let h=-0.5+l*0.5;return Pe(Ft,{center:[0.35,h,0.025],size:[0.3,0.2,0.05]},`right-${l}`)})]}),fWn=()=>gn($o,{children:[Pe(xi,{position:{x:-1.25,y:0,z:0.0875},width:0.3,thickness:0.175,padContactLength:0.3,bodyDistance:0.45,height:0.7},1),Pe(xi,{rotation:Math.PI,position:{x:1.25,y:0,z:0.0875},width:0.3,thickness:0.175,padContactLength:0.3,bodyDistance:0.45,height:0.7},1),Pe(Kn,{color:"#222",children:Pe(hu,{center:{x:0,y:0,z:0},width:1.8,length:1.4,height:0.95,includeNotch:!1,taperRatio:0.06,straightHeightRatio:0.7,heightAboveSurface:0.05})}),Pe(Ft,{color:"#777",size:[0.6,1.325,0.02],center:[-0.565,0,1]})]}),Bwi=()=>gn($o,{children:[Pe(Ft,{color:"#ccc",size:[0.4,0.325,0.175],center:[-1.05,0,0.0875]}),Pe(Ft,{color:"#ccc",size:[0.4,0.325,0.175],center:[1.05,0,0.0875]}),Pe(Kn,{color:"#222",children:gn(rp,{children:[Pe(go,{z:0.0875,children:Pe(Ft,{size:[1.7,1.25,0.175]})}),gn(oc,{children:[Pe(go,{z:0.175,children:Pe(Ft,{size:[1.7,1.25,0.01]})}),Pe(go,{z:0.725,children:Pe(Ft,{size:[1.5,1.05,0.01]})})]})]})}),Pe(Ft,{color:"#777",size:[0.5666666666666667,1.05,0.02],center:[-0.4636363636363638,0,0.725]})]}),Twi=()=>gn($o,{children:[Pe(Ft,{color:"#ccc",size:[0.4,0.325,0.13],center:[-1.0474999999999999,0,0.065]}),Pe(Ft,{color:"#ccc",size:[0.4,0.325,0.13],center:[1.0474999999999999,0,0.065]}),Pe(Kn,{color:"#222",children:Pe(hu,{width:1.775,length:1.25,height:0.725,center:{x:0,y:0,z:0},heightAboveSurface:0,straightHeightRatio:0.7,taperRatio:0.06,includeNotch:!1})}),Pe(Ft,{color:"#777",size:[0.5916666666666667,1.2,0.02],center:[-0.44409090909090904,0,0.725]})]}),Dwi=({pitch:e=10})=>gn($o,{children:[Pe(Ki,{height:4,radius:0.5,center:[-e/2,0,0.5]}),Pe(ate,{radius:0.5,center:[-e/2,0,2.5]}),Pe(go,{x:-2.5,y:0,z:2.5,children:gn(Ic,{rotation:[0,Math.PI/2,0],children:[Pe(Ki,{height:e,radius:0.5,center:[0,0,2.5]}),Pe(Kn,{color:"#d2b48c",children:Pe(Ki,{height:5,radius:1.3,center:[0,0,2.5]})})]})}),Pe(Ki,{height:4,radius:0.5,center:[e/2,0,0.5]}),Pe(ate,{radius:0.5,center:[e/2,0,2.5]})]}),Nwi=({bodyWidth:e=21,boardThickness:t=0.5,leadWidth:n=1.6,leadLength:o=2.4,leadsPitch:r=2.54,leadsLeft:i,leadsRight:s,leadsTop:a,leadsBottom:c,innerHoles:l=!0,innerHoleEdgeDistance:h=1.61,innerHoleDiameter:d=1})=>{let u=e/2,_=t/2,p=t*1.05,m=d/2,A=Math.max(i||0,s||0,a||0,c||0)*r||51,g=[],f=[];if(s){let b=-((s-1)/2)*r;for(let I=0;I<s;I++){let v=b+I*r;if(g.push({x:u-o/2,y:-v,pl:o,pw:n}),l)f.push({x:u,y:-v},{x:u-h,y:-v})}}if(i){let b=-((i-1)/2)*r;for(let I=0;I<i;I++){let v=b+I*r;if(g.push({x:-u+o/2,y:-v,pl:o,pw:n}),l)f.push({x:-u,y:-v},{x:-u+h,y:-v})}}if(a){let b=-((a-1)/2)*r;for(let I=0;I<a;I++){let v=b+I*r;if(g.push({x:-v,y:A/2-o/2,pl:n,pw:o}),l)f.push({x:-v,y:A/2},{x:-v,y:A/2-h})}}if(c){let b=-((c-1)/2)*r;for(let I=0;I<c;I++){let v=b+I*r;if(g.push({x:-v,y:-A/2+o/2,pl:n,pw:o}),l)f.push({x:-v,y:-A/2},{x:-v,y:-A/2+h})}}let y=Pe(Kn,{color:"#051a0a",children:gn(jl,{children:[Pe(Ft,{center:[0,0,_],size:[e,A,t]}),g.map((b,I)=>Pe(Ft,{center:[b.x,b.y,_],size:[b.pl+0.01,b.pw+0.01,p]},I))]})}),x=l&&f.map((b,I)=>Pe(Ki,{color:"black",center:[b.x,b.y,_],radius:m,height:t*1.07},I)),C=g.map((b,I)=>Pe(Ft,{center:[b.x,b.y,_],size:[b.pl+0.01,b.pw+0.01,p]},I));return gn($o,{children:[y,Pe(Kn,{color:"#FFD700",children:l?gn(jl,{children:[Pe(rp,{children:g.map((b,I)=>Pe(Ft,{center:[b.x,b.y,_],size:[b.pl+0.01,b.pw+0.01,p]},I))}),x]}):C})]})},Rwi=({numPins:e=5,rows:t=1,p:n=2.54,id:o=1,od:r=1.5,boardThickness:i=1.6,width:s,height:a,pinRowSide:c="left",holes:l=[],holeInset:h=1,pinRowHoleEdgeToEdgeDist:d=2,female:u,nopin:_,screen:p,screenWidth:m,screenHeight:A,screenCenterOffsetX:g,screenCenterOffsetY:f})=>{let y=p??!1,x=i/2,C=Math.ceil(e/t),b,I;if(c==="left"||c==="right")b=(t-1)*n+2*d,I=(C-1)*n+2*d;else I=(t-1)*n+2*d,b=(C-1)*n+2*d;if(e===0)b=10,I=10;let v=Number(s??b),P=Number(a??I),M=[],B=0,T=0,N=0,D=0,L=0,H=0;if(c==="left"||c==="right")B=c==="left"?-v/2+d:v/2-d,T=-((C-1)/2)*n,N=0,D=n,L=c==="left"?n:-n,H=0;else B=-((C-1)/2)*n,T=c==="top"?P/2-d:-P/2+d,N=n,D=0,L=0,H=c==="top"?-n:n;let V=0;for(let Z=0;Z<t&&V<e;Z++)for(let te=0;te<C&&V<e;te++){let ie=B+te*N+Z*L,le=T+te*D+Z*H;M.push({x:ie,y:le}),V++}let O=[];if(l)for(let Z of l){let te=0,ie=0;if(Z==="topleft")te=-v/2+h,ie=P/2-h;else if(Z==="topright")te=v/2-h,ie=P/2-h;else if(Z==="bottomleft")te=-v/2+h,ie=-P/2+h;else if(Z==="bottomright")te=v/2-h,ie=-P/2+h;else if(Z==="center")te=0,ie=0;O.push({x:te,y:ie})}let U=0.63,j=2,Y=6,X=3,K=_||u?0:j,J=K+i,ee=Pe(Kn,{color:"#008080",children:gn(jl,{children:[Pe(Ft,{center:[0,0,x+K],size:[v,P,i]}),O.map((Z,te)=>Pe(Ki,{center:[Z.x,Z.y,x+K],radius:r/2,height:i},`hole-${te}`)),M.map((Z,te)=>Pe(Ki,{center:[Z.x,Z.y,x+K],radius:r/2,height:i},`pin-hole-${te}`))]})}),se=M.map((Z,te)=>Pe(Kn,{color:"#FFD700",children:gn(jl,{children:[Pe(Ki,{center:[Z.x,Z.y,i/2+K],radius:r/2,height:i}),Pe(Ki,{center:[Z.x,Z.y,i/2+K],radius:o/2,height:i})]})},`pin-${te}`)),ne=M.map((Z,te)=>Pe(RWn,{x:Z.x,y:Z.y,pinThickness:U,shortSidePinLength:X,longSidePinLength:Y,bodyHeight:j,flipZ:(ie)=>ie},`pin-3d-${te}`)),re=M.map((Z,te)=>Pe(QWn,{x:Z.x,y:Z.y,flipZ:(ie)=>-ie},`female-pin-3d-${te}`));return gn($o,{children:[ee,se,!u&&!_&&ne,u&&re,y&&Pe(BWn,{width:m??v*0.8,height:A??P*0.6,offset:{x:g??0,y:f??0,z:J}})]})},Qwi=()=>gn($o,{children:[Pe(Ft,{color:"#ccc",size:[0.5,0.28,0.12],center:[-0.35,0,0.06]}),Pe(Ft,{color:"#ccc",size:[0.5,0.28,0.12],center:[0.35,0,0.06]}),Pe(Kn,{color:"#222",children:gn(rp,{children:[Pe(go,{z:0.06,children:Pe(Ft,{size:[0.8999999999999999,0.6,0.12]})}),gn(oc,{children:[Pe(go,{z:0.12,children:Pe(Ft,{size:[0.8999999999999999,0.6,0.01]})}),Pe(go,{z:0.5,children:Pe(Ft,{size:[0.7,0.39999999999999997,0.01]})})]})]})}),Pe(Ft,{color:"#777",size:[0.2333333333333333,0.39999999999999997,0.02],center:[-0.22499999999999998,0,0.5]})]}),kwi=Qwi,Lwi=({numPins:e=7,showPins:t=!0,showFootprint:n=!0,bodyColor:o="#f5f5f5",pinColor:r="#635959"})=>{let d=(e-1)*1.5+4,u=-((e-1)*1.5)/2;return gn($o,{children:[Pe(go,{offset:[0,0,6],children:Pe(Ic,{angles:[Math.PI,0,0],children:Pe(Kn,{material:Fr.moldedPlastic,color:o,children:gn(jl,{children:[Pe(Ft,{size:[d,3.5,6],center:[0,0,3]}),Pe(Ft,{size:[d-1,2.5,3.5999999999999996],center:[0,0,1.7999999999999998]}),Pe(Ft,{size:[d,1.1666666666666667,3.5999999999999996],center:[0,0,0.6]}),Pe(Ft,{size:[d-1,0.25,3.5999999999999996],center:[0,1.625,1.7999999999999998]}),Pe(Ft,{size:[d-1,0.25,3.5999999999999996],center:[0,-1.625,1.7999999999999998]}),Pe(Ft,{size:[1,2.5,1],center:[-d/4,1.75,3]}),Pe(Ft,{size:[1,3.5,1],center:[d/4,1.75,3]}),Pe(Ft,{size:[1,2.5,1],center:[-d/4,-1.75,3]}),Pe(Ft,{size:[1,3.5,1],center:[d/4,-1.75,3]})]})})})}),t&&Array.from({length:e}).map((_,p)=>Pe(Kn,{material:Fr.tinnedLead,color:r,children:Pe(Ki,{height:6,radius:0.35,center:[u+p*1.5,0,2.5]})},p)),n&&Array.from({length:e}).map((_,p)=>{let m=p===0,A=m?{type:"pcb_plated_hole",pcb_plated_hole_id:`jstzh_${p}`,shape:"circular_hole_with_rect_pad",x:u+p*1.5,y:0,hole_diameter:0.73,rect_pad_width:1.03,rect_pad_height:1.73,hole_shape:"circle",pad_shape:"rect",layers:["top","bottom"],port_hints:[`${p+1}`]}:{type:"pcb_plated_hole",pcb_plated_hole_id:`jstzh_${p}`,shape:"pill",x:u+p*1.5,y:0,hole_height:0.73,hole_width:0.73,outer_height:1.73,outer_width:1.03,layers:["top","bottom"],port_hints:[`${p+1}`]};return Pe(jdt,{hole:A,isPin1:m},`footprint_${p}`)})]})},Hwi=({numPins:e=2,showPins:t=!0,showFootprint:n=!0,bodyColor:o="#f5f5f5",pinColor:r="#635959"})=>{let p=(e-1)*2+3.9,m=-((e-1)*2)/2,A=1,g=1.8,f=0.7,y=0.8,x=0.65;return gn($o,{children:[Pe(go,{offset:[0,0,6],children:Pe(Ic,{angles:[Math.PI,0,0],children:Pe(Kn,{color:o,material:Fr.moldedPlastic,children:gn(jl,{children:[Pe(Ft,{size:[p,4.5,6],center:[0,0,3]}),Pe(Ft,{size:[p-1,3.5,3.5999999999999996],center:[0,0,1.7999999999999998]}),Pe(Ft,{size:[p,1.5,3.5999999999999996],center:[0,0,0.6]}),Pe(Ft,{size:[p-1,0.25,3.5999999999999996],center:[0,2.125,1.7999999999999998]}),Pe(Ft,{size:[p-1,0.25,3.5999999999999996],center:[0,-2.125,1.7999999999999998]}),Pe(Ft,{size:[1,5,1.8],center:[-p/2+0.7,0,3]}),Pe(Ft,{size:[1,5,1.8],center:[p/2-0.7,0,3]}),Pe(Ft,{size:[1.5,0.8,0.65],center:[-p/2,0,0.325]}),Pe(go,{offset:[-p/2,0,0.65],children:Pe(Ic,{angles:[0,Math.PI/2,0],children:Pe(Ki,{height:1.5,radius:0.4})})}),Pe(Ft,{size:[1.5,0.8,0.65],center:[p/2,0,0.325]}),Pe(go,{offset:[p/2,0,0.65],children:Pe(Ic,{angles:[0,Math.PI/2,0],children:Pe(Ki,{height:1.5,radius:0.4})})})]})})})}),t&&Array.from({length:e}).map((C,b)=>Pe(Kn,{color:r,material:Fr.tinnedLead,children:Pe(Ft,{size:[0.5,0.5,8.9],center:[m+b*2,0,1.05]})},b)),n&&Array.from({length:e}).map((C,b)=>{let I=b===0,v=I?{type:"pcb_plated_hole",pcb_plated_hole_id:`jstph_${b}`,shape:"circular_hole_with_rect_pad",x:m+b*2,y:0,hole_diameter:0.73,rect_pad_width:1.2,rect_pad_height:1.2,hole_shape:"circle",pad_shape:"rect",layers:["top","bottom"],port_hints:[`${b+1}`]}:{type:"pcb_plated_hole",pcb_plated_hole_id:`jstph_${b}`,shape:"pill",x:m+b*2,y:0,hole_height:0.73,hole_width:0.73,outer_height:1.2,outer_width:1.2,layers:["top","bottom"],port_hints:[`${b+1}`]};return Pe(jdt,{hole:v,isPin1:I},`footprint_${b}`)})]})},Fwi=({numPins:e=4,showPins:t=!0,showFootprint:n=!0,bodyColor:o="#f8fafc",pinColor:r="#635959"})=>{let u=(e-1)*2.5+4.9,_=-((e-1)*2.5)/2,p=0.8,m=1.05,A=3.5,g=u/2-1.3,f=Math.min(u-3.4,Math.max(3,(e-1)*2.5*0.4+2.2)),y=2.4;return gn($o,{children:[Pe(go,{offset:[0,0,3.5],children:Pe(Kn,{material:Fr.moldedPlastic,color:o,children:gn(jl,{children:[Pe(Ft,{size:[u,5.75,7]}),Pe(go,{offset:[0,0,0.9250000000000002],children:Pe(Ft,{size:[u-1.7,4.05,5.55]})}),Pe(go,{offset:[0,-2.45,2.4],children:Pe(Ft,{size:[f,1.05,2.6]})}),Pe(go,{offset:[-g,-2.45,1.85],children:Pe(Ft,{size:[0.8,1.05,3.7]})}),Pe(go,{offset:[g,-2.45,1.85],children:Pe(Ft,{size:[0.8,1.05,3.7]})}),Array.from({length:e}).map((x,C)=>Pe(go,{offset:[_+C*2.5,-2.575,-3.25],children:Pe(Ft,{size:[1,0.8,0.5]})},`vent_${C}`))]})})}),t&&Array.from({length:e}).map((x,C)=>Pe(Kn,{material:Fr.tinnedLead,color:r,children:Pe(go,{offset:[_+C*2.5,0,0.9750000000000001],children:Pe(Ft,{size:[0.64,0.64,8.75]})})},C)),n&&(()=>{try{return Ah.string(`jst${e}_xh`).circuitJson().filter((b)=>b.type==="pcb_plated_hole").map((b,I)=>Pe(jdt,{hole:b,isPin1:I===0},`footprint_${I}`))}catch{return null}})()]})};function kWn(e){let t=Ah.string(e).json();if(t.fn!=="jst")return!1;return Boolean(t.sh||t.smd&&Math.abs(ki(t.p)-1)<0.01&&Math.abs(ki(t.mpx??0)-(t.num_pins-1+2.6))<0.15&&Math.abs(ki(t.mpy??0)-2.525)<0.15)}var zwi=({footprint:e="jst6_sh"})=>{if(!kWn(e))throw Error("JstSh requires a named SH or matching 1mm SH top-entry footprint");let t=e.replace(/_pin1location\([^)]*\)/g,""),n=Ah.string(t).json(),o=Ah.string(t).circuitJson().filter((g)=>g.type==="pcb_smtpad"&&g.shape==="rect"),r=Ah.string(e).circuitJson().filter((g)=>g.type==="pcb_smtpad"&&(g.shape==="rect"||g.shape==="rotated_rect")),i=n.num_pins;if(!Number.isInteger(i)||i<2||i>20||o.length!==i+2)throw Error("JstSh requires 2–20 contacts and two hold-down pads");let s=o.slice(0,i),a=o.slice(i),c=Math.atan2(r[1].y-r[0].y,r[1].x-r[0].x)-Math.atan2(o[1].y-o[0].y,o[1].x-o[0].x),l=s.reduce((g,f)=>g+f.x,0)/i,h=s[0].y,d=a[0].y>h?1:-1,u=h+d*1.8,_=i+2,p=2.9,m=4.2,A=u-d*0.25;return gn(Ic,{rotation:[0,0,c],children:[Pe(Kn,{material:Fr.moldedPlastic,color:"#e4e1d6",children:gn(jl,{children:[Pe(Ft,{size:[_,p,m],center:[l,u,m/2+0.05]}),Pe(Ft,{size:[_-1.3,1.8,m],center:[l,u,m/2+0.8]}),a.map((g,f)=>Pe(Ft,{size:[0.7,g.height*0.8,1.5],center:[g.x,g.y,0.75]},`recess-${f}`)),[-1,1].map((g)=>Pe(Ft,{size:[0.55,0.6,1],center:[l+g*(_/2-0.9),u+d*p/2,4]},g))]})}),gn(Kn,{material:Fr.tinnedLead,color:"#c6c7c9",children:[s.map((g,f)=>{let y=g.y-d*g.height*0.4;return gn(rp,{children:[Pe(Ft,{size:[0.2,Math.abs(A-y)+0.1,0.2],center:[g.x,(A+y)/2,0.1]}),Pe(Ft,{size:[0.2,0.2,3.45],center:[g.x,A,1.725]})]},f)}),a.map((g,f)=>gn(rp,{children:[Pe(Ft,{size:[0.7,g.height*0.75,0.2],center:[g.x,g.y,0.1]}),Pe(Ft,{size:[0.2,g.height*0.6,1.35],center:[g.x,g.y,0.675]})]},`mount-${f}`))]})]})},Owi=([e,t],n,o,r,i)=>{let s=Math.sign(e),a=Math.sign(t),c=n/2,l=o/2,h=i?Math.min(0.32,o*0.36):0,d=Math.min(r,c,l),u=[[-c,-l],[c,-l],[c,l-d],[c-d,l],[-c,l]];if(h)u[0]=[-c+h,-l],u.push([-c,-l+h]);let _=u.map(([p,m])=>[e+p*s,t+m*a]);return s*a<0?_.reverse():_},kdt=({width:e,length:t,radius:n,height:o,z:r})=>{let i=e/2-n,s=t/2-n;return[[-i,-s],[i,-s],[i,s],[-i,s]].map(([a,c],l)=>Pe(Ki,{center:[a,c,r+o/2],height:o,radius:n},`${r}-${l}`))},Vwi=({horizontalPadPitch:e=2.2,verticalPadPitch:t=1.7,padWidth:n=1.4,padHeight:o=1.2,bodyHeight:r=0.7})=>{let i=e+n*0.7142857142857143,s=t+o*0.6666666666666666,a=Math.min(0.01,r*0.02),c=n*0.7142857142857143,l=o*0.75,h=r*0.7142857142857143,d=h-a,u=r*0.05714285714285714,_=i*0.95,p=s*0.94,m=i*0.905,A=s*0.9,g=i*0.83,f=s*0.82,y=h+u,x=Math.min(0.01,r*0.015),C=Math.min(0.12,s*0.05),b=(i-c)/2,I=(s-l)/2,v=[[-b,-I],[b,-I],[b,I],[-b,I]],P=kdt({width:_,length:p,radius:Math.min(0.13,p*0.08),height:u,z:h}),M=[...kdt({width:m,length:A,radius:Math.min(0.14,A*0.08),height:x,z:y}),...kdt({width:g,length:f,radius:Math.min(0.15,f*0.09),height:x,z:r-x})];return gn($o,{children:[v.map((B,T)=>Pe(Kn,{color:"#d6a258",material:Fr.goldContact,children:Pe(lte,{height:a,children:Pe(cte,{points:Owi(B,c,l,C,T===0)})})},T)),Pe(hu,{center:{x:0,y:0,z:a},width:i,length:s,height:d-0.005,heightAboveSurface:0,color:"#34343d",taperRatio:0,straightHeightRatio:1,includeNotch:!1,chamferSize:C}),Pe(Kn,{color:"#d2a057",material:Fr.goldContact,children:Pe(oc,{children:P})}),Pe(Kn,{color:"#b9bec2",material:Fr.brushedMetal,children:Pe(oc,{children:M})})]})},Ywi="#303339",UEe="#1f2227",yWn="#eee8d8",xWn="#f8f3e7",Ldt="#b7bdc2",Gwi="#d2d6d9",Uwi="#767d82",Wwi="#9ba1a5",Xwi=({pinCount:e=12,pitch:t=0.5,padWidth:n=0.3,padLength:o=1.25,staggered:r=!1,reverse:i=!1,rowPitch:s=2.4,topPadLength:a=o,bottomPadLength:c=o,mountPadPitchX:l,mountPadOffsetY:h=2.575,mountTop:d=!1,mountPadWidth:u=2,mountPadLength:_=2.5})=>{let p=Math.max((e-1)*t,t),m=-p/2,A=l??p+(r?3.5:3.38),g=h===0?0:(d?1:-1)*h,f=Array.from({length:e},(Se,Ne)=>{let ke=r&&Ne%2===1!==i,nt=r?ke?s/2:-s/2:0,dt=ke?a:c;return{index:Ne,x:m+Ne*t,y:nt,length:dt}}),y=Math.max(...f.map((Se)=>Se.y+Se.length/2)),x=Math.min(...f.map((Se)=>Se.y-Se.length/2)),C=g-_/2,b=g+_/2,I=d?x:y,v=d?Math.max(b,y)+0.67:Math.min(C,x)-0.67,P=d?-1:1,M=I-P*Math.max(o*0.86,1.05),B=v+P*0.22,T=Math.abs(M-B),N=(M+B)/2,D=B-P*0.01,L=Math.max(p+4.9,A+u*0.76),H=Math.min(L-2.3,p+1.1),V=0.3,O=1.42,U=2,j=Math.min(0.92,T*0.28),Y=D+P*(j/2-0.04),X=1.6,K=1.1,J=Math.max(T-0.78,1.5),ee=D+P*(J/2+0.68),se=L-0.72,ne=0.34,re=1.83,Z=D+P*Math.min(0.68,T*0.22),te=1.48,ie=Math.max(n*0.82,0.15),le=I,ue=Math.abs(le-M),de=(le+M)/2,me=Math.max(j*0.8,0.5),Ae=D+P*(me/2+0.08),xe=A/2,Me=0.75,Re=L/2-0.04,we=L/2-0.23,_e=L/2-0.32,ye=0.68;return gn($o,{children:[[-1,1].map((Se)=>Pe(Ft,{color:Ldt,center:[Se*xe,g,0.07],size:[u,_,0.14]},`mount-pad:${Se}`)),f.map((Se)=>Pe(Ft,{color:Ldt,center:[Se.x,de,0.065],size:[ie,ue,0.13]},`terminal:${Se.index}`)),Pe(oA,{color:UEe,center:[0,N,0.15],size:[L,T,0.3],roundRadius:0.1}),Pe(Kn,{color:Ywi,children:gn(jl,{children:[Pe(oA,{center:[0,N,1.01],size:[L-0.2,T-0.12,1.42],roundRadius:0.14}),Pe(Ft,{center:[0,Y,1.1],size:[H,j,1.6]}),Pe(Ft,{center:[0,ee,1.7551999999999999],size:[se-0.32,J-0.16,0.34]})]})}),f.map((Se)=>Pe(oA,{color:Gwi,center:[Se.x,Ae,1.1199999999999999],size:[ie*0.82,me,0.14],roundRadius:0.035},`spring:${Se.index}`)),f.map((Se)=>Pe(Ft,{color:Ldt,center:[Se.x,M-P*0.03,0.62],size:[ie,0.13,0.62]},`terminal-rise:${Se.index}`)),Pe(Ft,{color:UEe,center:[0,D+P*0.1,1.01],size:[H+0.18,0.16,0.8]}),Pe(oA,{color:yWn,center:[0,ee,1.83],size:[se,J,0.34],roundRadius:0.11}),Pe(Ft,{color:xWn,center:[0,ee-P*(J/2-0.12),1.965],size:[se-0.36,0.24,0.07]}),[-1,1].map((Se)=>Pe(oA,{color:yWn,center:[Se*_e,Z,1.48],size:[0.68,0.92,0.72],roundRadius:0.1},`actuator-ear:${Se}`)),[-1,1].map((Se)=>Pe(go,{x:Se*_e,y:Z,z:1.48,children:Pe(Ic,{rotation:[0,Math.PI/2,0],children:Pe(Ki,{color:xWn,height:0.8,radius:0.24})})},`hinge:${Se}`)),[-1,1].map((Se)=>Pe(oA,{color:Uwi,center:[Se*Re,g,0.375],size:[0.17,Math.min(_*0.3,0.7),0.75],roundRadius:0.04},`hold-down-wall:${Se}`)),[-1,1].map((Se)=>Pe(oA,{color:Wwi,center:[Se*we,g,0.7],size:[0.42,Math.min(_*0.3,0.7),0.1],roundRadius:0.035},`hold-down-cap:${Se}`)),Pe(Ft,{color:UEe,center:[0,N,0.025],size:[H+0.7,T*0.58,0.05]}),Pe(Ft,{color:UEe,center:[0,M-P*0.06,1.1199999999999999],size:[H+0.4,0.15,0.92]})]})},jwi=({numberOfPins:e,pitch:t=2.54,pinThickness:n=0.64,bodyWidth:o=2.5,bodyHeight:r=2.54,standoffHeight:i=1.27,matingPinLength:s=5.8,tailSpan:a=5.08})=>{let c=-((e-1)*t)/2,l=i+r,h=a/2,d=n*0.35;return Pe($o,{children:Array.from({length:e},(u,_)=>{let p=c+_*t,m=_%2===0?1:-1,A=s-d,g=i-n/2;return gn(go,{x:p,children:[Pe(Ft,{color:"#222",size:[t,o,r],center:[0,0,i+r/2]}),gn(Kn,{color:"#d4af37",children:[Pe(Ft,{size:[n,h,n],center:[0,m*(h/2),n/2]}),Pe(Ft,{size:[n,n,g],center:[0,0,n/2+g/2]}),Pe(Ft,{size:[n,n,A],center:[0,0,l+A/2]}),gn(oc,{children:[Pe(Ft,{size:[n,n,0.01],center:[0,0,l+A]}),Pe(Ft,{size:[n*0.65,n*0.65,0.01],center:[0,0,l+s]})]})]})]},_)})})},O0e=(e)=>Ah.string(e).circuitJson().filter((n)=>n.type==="pcb_plated_hole"&&Number.isFinite(n.x)&&Number.isFinite(n.y)).map((n)=>({x:n.x,y:n.y,pin:n.port_hints?.[0]})),CWn=(e)=>Ah.string(e).circuitJson().filter((n)=>n.type==="pcb_smtpad"&&n.shape==="rect"&&Number.isFinite(n.x)&&Number.isFinite(n.y)).map((n)=>({x:n.x,y:n.y,width:n.width??0.4,height:n.height??0.4,pin:n.port_hints?.[0]})),Kwi=({bodyWidth:e,bodyLength:t,bodyHeight:n=1,pads:o,leadThickness:r=0.15,leadHeightRatio:i=0.75})=>{let s=o.reduce((l,h)=>l+h.x,0)/(o.length||1),a=o.reduce((l,h)=>l+h.y,0)/(o.length||1),c=n*i;return gn($o,{children:[Pe(hu,{center:{x:s,y:a,z:0},width:e,length:t,height:n}),o.map((l)=>{let h=l.width??0.4,d=l.height??0.4,u=l.x>=s?1:-1,_=l.x+u*h/2,p=Math.max(Math.abs(_-s)-e/2,0.1),m=Math.min(0.15,e*0.15);return Pe(xi,{rotation:u>0?Math.PI:0,position:{x:_,y:l.y,z:r/2},width:d,thickness:r,padContactLength:h*0.6,bodyDistance:p+m,height:c},`lead-${l.x}-${l.y}`)})]})},$wi=({padPitch:e,padHeight:t,color:n="#333"})=>{let o=e,r=t*0.85,i=r,s=o*0.2,a=o-s*2;return gn($o,{children:[Pe(Ft,{size:[a,r,i],offset:[0,0,i/2],material:Fr.moldedPlastic,color:n}),Pe(Ft,{size:[s,i,r],offset:[o/2-s/2,0,i/2],material:Fr.tinnedLead,color:"#ccc"}),Pe(Ft,{size:[s,i,r],offset:[-o/2+s/2,0,i/2],material:Fr.tinnedLead,color:"#ccc"})]})},qwi=({color:e="#ffff00",bodyColor:t="#ffffff",leadColor:n="#dedede"})=>{let A=[-1.7,0,1.7],g=[-1,1];return gn($o,{children:[A.flatMap((f)=>g.map((y)=>Pe(Ft,{color:n,size:[1.4,1,0.2],center:[y*2,f,0.1]},`${y}-${f}`))),Pe(Kn,{color:t,children:gn(jl,{children:[Pe(hu,{width:5,length:5,height:1.3,heightAboveSurface:0.2,center:{x:0,y:0,z:0},color:t,taperRatio:0.036,straightHeightRatio:0.01,includeNotch:!1}),Pe(Ki,{radius:2,height:0.25,center:[0,0,1.375]}),Pe(go,{offset:[-2.5,2.5,1.355],children:Pe(Ic,{rotation:[0,0,Math.PI/4],children:Pe(Ft,{size:[0.9,0.9,0.31]})})})]})}),Pe(Ki,{color:e,radius:2,height:0.25,center:[0,0,1.425]})]})},Jwi=({bodyWidth:e=3.5,bodyLength:t=2.8,bodyHeight:n=0.8,color:o="#ffe08a",bodyColor:r="#f2f2f2",padColor:i="#cccccc",pad1X:s=-0.9,pad1Width:a=2.2,pad2X:c=1.375,pad2Width:l=1.25,padLength:h=2.2}={})=>{let _=(s+c)/2,p=e*0.55,m=t*0.55;return gn($o,{children:[[{x:s,w:a,key:"pad-1"},{x:c,w:l,key:"pad-2"}].map(({x:A,w:g,key:f})=>Pe(Kn,{color:i,children:Pe(Ft,{size:[g,h,0.1],center:[A,0,0.05]})},f)),Pe(Kn,{color:r,children:Pe(Ft,{size:[e,t,n],center:[_,0,0.1+n/2]})}),Pe(Kn,{color:o,children:Pe(Ft,{size:[p,m,0.15],center:[_,0,0.1+n+0.075-0.05]})})]})},bWn=(e)=>Array.from({length:e},(t,n)=>n),Zwi=({bodyWidth:e=16.26,bodyDepth:t=15.88,bodyHeight:n=13.5,bodyCenterY:o=-0.96,ledPins:r=!1,firstPinLeft:i=!1,firstPinTop:s=!1,signalPitch:a=1.02,signalRowPitch:c=1.78,signalHoleDiameter:l=0.9144,shieldPinX:h=8.13,shieldPinY:d=0.13,shieldHoleDiameter:u=1.8,locatorHoleX:_=6.35,locatorHoleY:p=-3.43,locatorHoleDiameter:m=3.25,ledPinX:A=4.57,ledPinPitch:g=2.29,ledPinY:f=5.7,openingDirection:y,shellColor:x="#b7bdc2",housingColor:C="#20242a",contactColor:b="#d6a928"})=>{let I=y??(o>0?1:-1),v=o+I*t/2,P=Math.min(0.38,e*0.024),M=Math.max(e-2.5,e*0.72),B=Math.min(n-2.4,9.6),T=1.3+B/2,N=Math.min(4.4,t*0.34),D=v-I*N/2,L=v-I*(N+P*0.7),H=Math.max(0.22,Math.min(l*0.36,0.38)),V=bWn(8).map((K)=>{let J=(3.5-K)*a,ee=K%2===0?-c/2:c/2;return{x:i?-J:J,y:s?-ee:ee}}),O=[-A-g,-A,A,A+g],U=M/10,j=v-I*Math.max(N*0.48,1.2),Y=T+B*0.18,X=v+I*P*0.2;return gn($o,{children:[gn(Kn,{color:x,children:[gn(jl,{children:[Pe(Ft,{center:[0,o,n/2],size:[e,t,n]}),Pe(Ft,{center:[0,D,T],size:[M,N+P*2,B]})]}),Pe(Ft,{center:[0,X,0.72],size:[M+0.5,P*1.25,1.05]}),[-1,1].map((K)=>Pe(Ft,{center:[K*h,d,0.25],size:[Math.max(u*0.46,0.65),Math.max(u*0.72,1.1),3.4]},`shield-tab:${K}`)),[-1,1].map((K)=>Pe(Ft,{center:[K*e*0.24,o-I*t*0.08,n+0.04],size:[e*0.22,t*0.42,0.1]},`top-seam:${K}`))]}),gn(Kn,{color:C,children:[gn(jl,{children:[Pe(oA,{center:[0,D,T],size:[M-0.2,N+P*0.5,B-0.2],roundRadius:0.22}),Pe(Ft,{center:[0,D-I*P*0.2,T-0.05],size:[M-1.25,N+P,B-1.35]})]}),Pe(Ft,{center:[0,L,T],size:[M-1.15,P,B-1.25]}),Pe(oA,{center:[0,v-I*N*0.28,1.55],size:[M-2.6,N*0.5,1.15],roundRadius:0.16}),[-1,1].map((K)=>Pe(Ki,{center:[K*_,p,-0.25],radius:Math.max(m*0.41,0.65),height:2.7},`locator:${K}`))]}),gn(Kn,{color:b,children:[V.map(({x:K,y:J},ee)=>Pe(Ki,{center:[K,J,0.15],radius:H,height:3.1},`signal-lead:${ee}`)),bWn(8).map((K)=>Pe(go,{offset:[(K-3.5)*U,j,Y+(K%2===0?0.03:-0.03)],children:Pe(Ic,{rotation:[I*0.2,0,0],children:Pe(oA,{size:[Math.max(U*0.28,0.28),3.25,0.16],roundRadius:0.05})})},`socket-contact:${K}`)),r&&O.map((K,J)=>Pe(Ki,{center:[K,f,0.15],radius:H,height:3.1},`led-lead:${J}`))]}),r&&gn($o,{children:[Pe(oA,{color:"#73b744",center:[-e/2+2.05,v+I*P*0.35,n-2.05],size:[2.15,P*1.55,1.45],roundRadius:0.18}),Pe(oA,{color:"#e0aa35",center:[e/2-2.05,v+I*P*0.35,n-2.05],size:[2.15,P*1.55,1.45],roundRadius:0.18})]})]})},eBi=({bodyWidth:e=6.1,bodyLength:t=6.5,bodyHeight:n=2.3,tabWidth:o=6.2,tabLength:r=5.8,span:i=6.85,pitch:s=2.29,leadWidth:a=0.9,leadContactLength:c=1.5,color:l="#222",tabColor:h="#cccccc",leadColor:d="#cccccc"})=>{let _=i/2,p=-i/2,m=_+(o-e)/2,A=m-e/2,g=0.25,f=0.4;return gn($o,{children:[Pe(Kn,{material:Fr.tinnedLead,color:h,children:Pe(Ft,{size:[o,r,0.5],center:[_,0,0.25]})}),Pe(Kn,{material:Fr.moldedPlastic,color:l,children:Pe(Ft,{size:[e,t,n],center:[m,0,0.5+n/2]})}),[-1,1].map((y)=>gn(Kn,{material:Fr.tinnedLead,color:d,children:[Pe(Ft,{size:[c,a,0.4],center:[p+c/2,y*s,0.2]}),gn(oc,{children:[Pe(Ft,{size:[0.1,a,0.4],center:[p+c,y*s,0.2]}),Pe(Ft,{size:[0.1,a,0.4],center:[A,y*s,0.5]})]})]},`lead-${y}`))]})},tBi=({diameter:e=6.3,heightToDiameterRatio:t=1.4,height:n=e*t,leadPitch:o=2.5,leadDiameter:r=0.6,leadLength:i=3,sleeveColor:s="#1b2a6b",baseColor:a="#1a1a1a"})=>{let c=e/2,l=Math.min(1,e*0.12),h=Math.max(n-l,0.1),d=l,u=d+h,_=Math.max(e*0.06,0.2),p=0.3;return gn($o,{children:[Pe(Kn,{color:a,material:Fr.rubber,children:Pe(Ki,{radius:c-0.05,height:l,center:[0,0,l/2]})}),Pe(Kn,{color:s,material:Fr.sleeve,children:gn(jl,{children:[Pe(Ix,{radius:c,height:h,roundRadius:Math.min(0.3,c*0.15),center:[0,0,d+h/2]}),Pe(Ft,{size:[e,_,0.6],center:[0,0,u]}),Pe(Ft,{size:[_,e,0.6],center:[0,0,u]})]})}),[-1,1].map((m)=>Pe(Kn,{material:Fr.tinnedLead,color:"#c0c0c0",children:Pe(Ki,{radius:r/2,height:i+l,center:[m*o/2,0,(l-i)/2]})},`lead-${m}`))]})},nBi=({bodyWidth:e=5.35,bodyLength:t=14,bodyHeight:n=4,bodyCenterX:o=e/2,adjusterDiameter:r=Math.min(e,t)*0.55,shaftDiameter:i=0,shaftHeight:s=0,leads:a=[],leadDiameter:c=0.6,leadLength:l=3,bodyColor:h="#1f4fa3",adjusterColor:d="#d8d8d8"})=>{let _=n+0.4,p=Math.max(r*0.16,0.3);return gn($o,{children:[Pe(Kn,{color:h,children:Pe(Ft,{size:[e,t,n],center:[o,0,n/2]})}),Pe(Kn,{color:d,children:gn(jl,{children:[Pe(Ki,{radius:r/2,height:0.8,center:[o,0,_]}),Pe(Ft,{size:[r,p,0.48],center:[o,0,_+0.4]})]})}),s>0&&i>0?Pe(Kn,{color:d,children:Pe(Ki,{radius:i/2,height:s,center:[o,0,n+s/2]})}):null,a.map((m)=>Pe(Kn,{color:"#c0c0c0",children:Pe(Ki,{radius:c/2,height:n/2+l,center:[m.x,m.y,(n/2-l)/2]})},`lead-${m.x}-${m.y}`))]})},oBi=({bodyWidth:e=2.9,bodyLength:t=3,bodyHeight:n=1.4,actuatorDiameter:o=1.5,actuatorHeight:r=0.5,padSpanX:i=4.2,padSpanY:s=2.15,padWidth:a=1.05,padLength:c=0.7,bodyColor:l="#2b2b2b",actuatorColor:h="#d9d9d9",leadColor:d="#cccccc"})=>gn($o,{children:[Pe(Kn,{color:l,children:Pe(Ft,{size:[e,t,n],center:[0,0,n/2]})}),Pe(Kn,{color:h,children:Pe(Ki,{radius:o/2,height:r,center:[0,0,n+r/2]})}),[-1,1].flatMap((_)=>[-1,1].map((p)=>Pe(Kn,{color:d,children:Pe(Ft,{size:[a,c,0.15],center:[_*i/2,p*s/2,0.075]})},`lead-${_}-${p}`)))]}),rBi=({footprint:e="smdslideswitch7",position:t=0})=>{let n=e.replace(/_pin1location\([^)]*\)/g,""),o=Ah.string(n).json(),r=Ah.string(n).circuitJson(),i=r.filter((u)=>u.type==="pcb_smtpad"&&u.shape==="rect"),s=Ah.string(e).circuitJson().filter((u)=>u.type==="pcb_smtpad"&&(u.shape==="rect"||u.shape==="rotated_rect"));if(i.length<7||!Number.isFinite(o.mpx)||o.mpx<3)throw Error("SmdSlideSwitch needs signal pads and four mounting pads");let a=Math.atan2(s[1].y-s[0].y,s[1].x-s[0].x)-Math.atan2(i[1].y-i[0].y,i[1].x-i[0].x),c=o.mpx-0.5,l=2.7,h=o.mpx>6?1.5:1.4,d=o.mounty;return gn(Ic,{rotation:[0,0,a],children:[Pe(Kn,{color:"#aeb4ba",children:gn(jl,{children:[Pe(Ft,{size:[c,l,h],center:[0,d,h/2]}),Pe(Ft,{size:[c-0.3,l-0.3,h],center:[0,d,h/2-0.15]}),Pe(Ft,{size:[2.7,0.5,0.9],center:[0,d-l/2,0.65]})]})}),gn(Kn,{color:"#28292c",children:[Pe(Ft,{size:[c-0.32,l-0.32,0.35],center:[0,d,0.175]}),Pe(Ft,{size:[1,2.25,0.65],center:[t===0?-0.5:0.5,d-1.5,0.65]}),r.filter((u)=>u.type==="pcb_hole").map((u,_)=>("hole_diameter"in u)&&("x"in u)?Pe(Ki,{radius:u.hole_diameter*0.42,height:0.6,center:[u.x,u.y,-0.2]},_):null)]}),Pe(Kn,{color:"#c6c7c9",children:i.map((u,_)=>{let p=_<i.length-4,m=u.y+u.height*0.4,A=Math.min(u.y-u.height*0.4,d+l/2-0.2);return Pe(Ft,{size:[u.width*0.8,p?m-A:u.height*0.8,0.18],center:[u.x,p?(m+A)/2:u.y,0.09]},_)})})]})},iBi=({fullWidth:e=1.94,fullLength:t=1.6})=>gn($o,{children:[Pe(Ic,{rotation:[45*Math.PI,0,0],children:Pe(go,{center:[0,0,-0.4],children:Pe(Kn,{color:"grey",children:Pe(Ft,{size:[1.2,1.6,0.55]})})})}),[-1,0,1].flatMap((h,d)=>[Pe(go,{center:[-0.63,h*0.5,0.065],children:Pe(Ft,{size:[0.67,0.3,0.13]})},`left-${d}`),Pe(go,{center:[0.63,h*0.5,0.065],children:Pe(Ft,{size:[0.67,0.3,0.13]})},`right-${d}`)])]}),sBi=({packageWidth:e=10,packageLength:t=10,packageHeight:n=1.2,standoffHeight:o=0.2,ballPitch:r=0.8,ballDiameter:i=0.5,ballRows:s=8,ballColumns:a=8,missingBalls:c=[],footprintString:l})=>{let h=n-o,d=o+h/2,u=Math.max(o/2,i/2),_=l?Ah.string(l).circuitJson():null;return gn($o,{children:[Pe(go,{z:d,children:Pe(Kn,{color:"#555",children:Pe(Ft,{size:[e,t,h]})})}),!l&&Array.from({length:s*a}).map((p,m)=>{if(c.includes(m+1))return null;let A=Math.floor(m/a),f=(m%a-(a-1)/2)*r,y=(A-(s-1)/2)*r;return Pe(go,{x:f,y,z:u,children:Pe(ate,{radius:i/2})},m)}),_&&_.map((p,m)=>{if(p.type==="pcb_smtpad")return Pe(go,{x:p.x,y:p.y,z:u,children:Pe(ate,{radius:i/2})},m);return null})]})},IWn=({width:e,height:t,depth:n})=>Pe(oc,{children:[-1,1].map((o)=>Pe(go,{offset:[o*(e-t)/2,0,0],children:Pe(Ic,{rotation:[Math.PI/2,0,0],children:Pe(Ki,{radius:t/2,height:n})})},o))}),aBi=({footprint:e="usbcmidmount16"})=>{let t=e.replace(/_pin1location\([^)]*\)/g,""),n=Ah.string(t).json(),o=Ah.string(t).circuitJson(),r=o.filter((x)=>x.type==="pcb_smtpad"&&x.shape==="rect"),i=o.filter((x)=>x.type==="pcb_plated_hole"),s=o.filter((x)=>x.type==="pcb_hole"),a=Ah.string(e).circuitJson().find((x)=>x.type==="pcb_plated_hole"),c=i[0],l=c&&a&&"x"in a?Math.atan2(a.y,a.x)-Math.atan2(c.y,c.x):0,h=8.94,d=3.2,u=0.22,_=n.rowy+0.23,p=-n.bodybottom,m=_-p,A=(_+p)/2,g=1.65;if(!Number.isFinite(m)||m<3||i.length!==4)throw Error("UsbCMidmount requires four mounting slots and a positive body depth");let f=-0.9,y=1.75;return gn(Ic,{rotation:[0,0,l],children:[Pe(Kn,{color:"#b8bdc4",material:Fr.brushedMetal,children:Pe(go,{offset:[0,A,1.65],children:gn(jl,{children:[Pe(IWn,{width:8.94,height:3.2,depth:m}),Pe(IWn,{width:8.5,height:2.7600000000000002,depth:m+0.2})]})})}),gn(Kn,{color:"#242529",material:Fr.moldedPlastic,children:[Pe(Ft,{size:[6.65,m-1.1,0.7],center:[0,A+0.3,1.65]}),Pe(Ft,{size:[7.6,1,2.45],center:[0,_-0.65,1.65]}),s.map((x,C)=>("x"in x)&&("hole_diameter"in x)?Pe(Ki,{radius:x.hole_diameter*0.42,height:0.8,center:[x.x,x.y,-0.3]},C):null)]}),gn(Kn,{color:"#d3ad57",material:Fr.goldContact,children:[[-1,1].flatMap((x)=>[-2.75,-2.25,-1.25,-0.25,0.25,1.25,2.25,2.75].map((C)=>Pe(Ft,{size:[0.24,m-2,0.04],center:[C,A+0.1,1.65+x*0.365]},`${x}-${C}`))),r.map((x,C)=>Pe(Ft,{size:[Math.min(x.width*0.7,0.35),x.height*0.8+0.35,0.15],center:[x.x,x.y-0.175,0.075]},C))]}),Pe(Kn,{color:"#b8bdc4",material:Fr.brushedMetal,children:i.map((x,C)=>Pe(Ft,{size:[0.4,"hole_height"in x?Math.max(0.3,x.hole_height-0.2):1,y-f],center:[x.x,x.y,(y+f)/2]},C))})]})},vWn=(e)=>Ah.string(e).circuitJson().filter((t)=>t.type==="pcb_smtpad"&&(t.shape==="rect"||t.shape==="rotated_rect")).map((t)=>({x:t.x,y:t.y,pin:t.port_hints?.[0]})),cBi=({footprint:e="sot143"})=>{let t=vWn(e);if(t.length!==4)throw Error("SOT143 requires four signal pads");let n=vWn("sot143"),o=Ah.string(e).json(),r=n[1],i=t.find((c)=>c.pin==="2"),s=o.pin1location?Math.round((Math.atan2(i.y,i.x)-Math.atan2(r.y,r.x))/(Math.PI/2))*(Math.PI/2):0,a=t.map((c)=>({...c,x:c.x*Math.cos(s)+c.y*Math.sin(s),y:-c.x*Math.sin(s)+c.y*Math.cos(s)}));return gn(Ic,{rotation:[0,0,s],children:[Pe(hu,{width:2.9,length:1.3,height:0.95,heightAboveSurface:0.05,center:{x:0,y:0,z:0},includeNotch:!1,taperRatio:0.06}),a.map((c)=>{let l=c.y<0?-1:1,h=c.pin==="1"?0.83:0.43;return Pe(xi,{width:h,thickness:0.12,height:0.45,padContactLength:0.3,bodyDistance:0.6,rotation:l<0?Math.PI/2:-Math.PI/2,position:{x:c.x,y:l*1.15,z:0.06}},c.pin)})]})},lBi=({footprint:e})=>{let t=see.string(e.split("_",1)[0]).params().fn;if(see.getModelNames().includes(t)){let c=see.string(e).json(),l=NWn.get(c.fn);if(l)return l.render(c)}let n=e;if(e.startsWith("jstzh1_5mm")){let c=e.match(/jstzh1_5mm(\d+)?/);n=`zh${c&&c[1]?c[1]:"7"}`}else if(e.startsWith("jstph2_0mm")){let c=e.match(/jstph2_0mm(\d+)?/);n=`jst${c&&c[1]?c[1]:"2"}_ph`}else if(e.startsWith("jstxh2_5mm")){let c=e.match(/jstxh2_5mm(\d+)?/);n=`jst${c&&c[1]?c[1]:"2"}_xh`}let o=Ah.string(n).json(),r=e.match(/_color\(([^)]+)\)/),i=r?r[1]:void 0,s=(c,l)=>{if(c===void 0||c===null)return l;let h=ki(c);return Number.isFinite(h)?h:l},a=AMi(o);if(a)return a;switch(o.fn){case"crystal":return Pe(Vwi,{horizontalPadPitch:o.px,verticalPadPitch:o.py,padWidth:o.pw,padHeight:o.ph});case"dip":return Pe(bMi,{numPins:o.num_pins,pitch:o.p,bodyWidth:o.w});case"axial":return Pe(Dwi,{pitch:o.p});case"tssop":return Pe(SMi,{pinCount:o.num_pins,leadLength:o.pl,leadWidth:o.pw,pitch:o.p,bodyWidth:o.w});case"msop":return Pe(EMi,{pinCount:o.num_pins,padContactLength:o.pl,leadWidth:o.pw,pitch:o.p,bodyWidth:o.w});case"vssop":return Pe(ewi,{pinCount:o.num_pins,leadLength:o.pl,leadWidth:o.pw,pitch:o.p,bodyWidth:o.w,bodyLength:o.h});case"qfp":return Pe(eWn,{pinCount:o.num_pins,pitch:o.p,leadWidth:o.pw,padContactLength:o.pl,bodyWidth:o.w});case"tqfp":return Pe(dwi,{});case"lqfp":return Pe(_wi,{pinCount:o.num_pins});case"qfn":{let c=typeof o.thermalpad?.x==="number"&&typeof o.thermalpad?.y==="number";return Pe(nWn,{num_pins:o.num_pins,bodyWidth:o.w,bodyLength:o.h,pitch:o.p,padLength:o.pl,padWidth:o.pw,thermalPadSize:c?{width:o.thermalpad.x,length:o.thermalpad.y}:void 0})}case"dfn":{let c=typeof o.thermalpad?.x==="number"&&typeof o.thermalpad?.y==="number";return Pe(mWn,{num_pins:o.num_pins,bodyWidth:o.w,bodyLength:o.h,pitch:o.p,padLength:o.pl,padWidth:o.pw,thermalPadSize:c?{width:o.thermalpad.x,length:o.thermalpad.y}:void 0})}case"pinrow":case"headermodule":{let c=e.match(/_rows(\d+)/),l=c&&c[1]?parseInt(c[1],10):1;if(o.male)return Pe(tWn,{numberOfPins:o.num_pins,pitch:o.p,invert:o.invert,rows:l,smd:o.smd||o.surface_mount,rightangle:o.rightangle});if(o.female)return Pe($Mi,{numberOfPins:o.num_pins,pitch:o.p,rows:l})}case"smdpinheader":return Pe(jwi,{numberOfPins:o.num_pins,pitch:o.p,bodyWidth:o.bh});case"led5050":return Pe(qwi,{color:i});case"led":{let c=String(o.imperial);if(c==="0402"||c==="0603"||c==="0805")return Pe(TMi,{footprint:c,color:i});break}case"cap":{switch(o.imperial){case"0402":return Pe(qUn,{color:"#856c4d"});case"0603":return Pe(JUn,{color:"#856c4d"});case"0805":return Pe(ZUn,{color:"#856c4d"});case"0201":return Pe(rWn,{color:"#856c4d"});case"01005":return Pe(iWn,{color:"#856c4d"});case"1206":return Pe(sWn,{color:"#856c4d"});case"1210":return Pe(aWn,{color:"#856c4d"});case"2010":return Pe(cWn,{color:"#856c4d"});case"2512":return Pe(lWn,{color:"#856c4d"})}break}case"sot23":switch(o.num_pins){case 3:return Pe(VMi,{color:i});case 5:return Pe(oWn,{})}break;case"sot25":return Pe(oWn,{});case"sot":case"sot343":{let c=o.fn==="sot343";return Pe(Kwi,{pads:CWn(n),bodyWidth:c?1.25:1.6,bodyLength:c?2:2.9,bodyHeight:c?1.1:1.3})}case"sot563":return Pe(iBi,{});case"sot89":{let c=s(o.w,4.2);return Pe(pWn,{fullWidth:c,bodyWidth:c*0.6,bodyLength:s(o.h,4.8)*0.94,bodyHeight:1.5,leadWidth:s(o.pw,0.48),tabLeadWidth:s(o.pw,0.48)*2,padPitch:s(o.p,1.5),leadHeight:0.66})}case"sot457":return Pe(Iwi,{});case"smdslideswitch":return Pe(rBi,{footprint:n});case"usbcmidmount":return Pe(aBi,{footprint:n});case"sot143":return Pe(cBi,{footprint:n});case"sot223":return Pe(pWn,{});case"sot23w":return Pe(YMi,{});case"sot323":return Pe(uwi,{});case"sod323f":return Pe(Bwi,{});case"sod323fl":return Pe(Twi,{});case"sot363":return Pe(Mwi,{});case"sot886":return Pe(wwi,{});case"sot963":return Pe(vwi,{});case"pushbutton":return Pe(qMi,{width:o.w,length:o.h,innerDiameter:o.id});case"jst":if(kWn(n))return Pe(zwi,{footprint:n});if(o.zh)return Pe(Lwi,{numPins:o.num_pins});if(o.ph)return Pe(Hwi,{numPins:o.num_pins});if(o.xh)return Pe(Fwi,{numPins:o.num_pins});break;case"fpc":return Pe(Xwi,{pinCount:o.num_pins,pitch:o.p,padWidth:o.pw,padLength:o.pl,staggered:o.staggered,reverse:o.reverse,rowPitch:o.py,topPadLength:o.toppl,bottomPadLength:o.bottompl,mountPadPitchX:o.mpx,mountPadOffsetY:o.mpy,mountTop:o.mounttop,mountPadWidth:o.mpw,mountPadLength:o.mpl});case"rj45":return Pe(Zwi,{bodyWidth:o.w,bodyDepth:o.h,bodyCenterY:o.bodyy,ledPins:o.ledpins||o.num_pins===14,firstPinLeft:o.firstpinleft,firstPinTop:o.firstpintop,signalPitch:o.p,signalRowPitch:o.py,signalHoleDiameter:o.id,shieldPinX:o.shieldx,shieldPinY:o.shieldy,shieldHoleDiameter:o.shieldid,locatorHoleX:o.holex,locatorHoleY:o.holey,locatorHoleDiameter:o.holed,ledPinX:o.ledx,ledPinPitch:o.ledp,ledPinY:o.ledy});case"soic":case"sop8":case"ssop":return Pe(ZMi,{pinCount:o.num_pins,leadLength:o.pl,leadWidth:o.pw,pitch:o.p,bodyWidth:o.w});case"son":case"wson":case"vson":{let c=o.fn==="vson"?s(o.grid?.x,3):s(o.w,3),l=o.fn==="vson"?s(o.grid?.y,3):s(o.h,3),h=s(o.epw,0),d=s(o.eph,0),u=o.pl!==void 0?s(o.pl,0):void 0,_=o.pw!==void 0?s(o.pw,0):void 0,p=CWn(n).filter((f)=>Number(f.pin??0)<=o.num_pins),m=(f)=>new Set(f.map((y)=>y.toFixed(3))).size,A=p.length>2&&m(p.map((f)=>f.y))===2&&m(p.map((f)=>f.x))>2,g=Pe(mWn,{num_pins:o.num_pins,bodyWidth:A?l:c,bodyLength:A?c:l,pitch:s(o.p,0.5),padLength:u,padWidth:_,thermalPadSize:o.ep&&h>0&&d>0?{width:A?d:h,length:A?h:d}:void 0});return A?Pe(Ic,{rotation:[0,0,"90deg"],children:g}):g}case"mlp":case"lga":case"quad":{if(o.legsoutside)return Pe(eWn,{pinCount:o.num_pins,pitch:s(o.p,0.5),leadWidth:s(o.pw,0.25),padContactLength:s(o.pl,0.25),bodyWidth:s(o.w,6)});return Pe(nWn,{num_pins:o.num_pins,bodyWidth:s(o.w,6),bodyLength:s(o.h,6),pitch:s(o.p,0.5),padLength:s(o.pl,0.25),padWidth:s(o.pw,0.25)})}case"bga":{let c=s(o.p,0.8),l=o.grid?.x??8,h=o.grid?.y??8;return Pe(sBi,{ballPitch:c,ballColumns:l,ballRows:h,ballDiameter:c*0.625,packageWidth:l*c,packageLength:h*c})}case"sod523":return Pe(twi,{});case"sod723":return Pe(kwi,{});case"sod882":return Pe(hWn,{});case"sma":return Pe(nwi,{});case"smb":return Pe(dWn,{});case"smc":return Pe(owi,{});case"smf":return Pe(rwi,{});case"sod123":return Pe(awi,{});case"sod123f":return Pe(iwi,{});case"sod123fl":return Pe(swi,{});case"sod123w":return Pe(uWn,{});case"sod110":return Pe(uWn,{bodyWidth:2.1,bodyLength:1.4});case"sod128":return Pe(cwi,{});case"sod323":return Pe(fWn,{});case"sod323w":return Pe(fWn,{});case"sod80":return Pe(_Wn,{});case"sod882d":return Pe(hWn,{});case"smbf":return Pe(dWn,{});case"led2835":return Pe(Jwi,{color:i,bodyWidth:s(o.w,3.5),bodyLength:s(o.h,2.8),pad1X:s(o.p1x,-0.9),pad1Width:s(o.p1w,2.2),pad2X:s(o.p2x,1.375),pad2Width:s(o.p2w,1.25),padLength:s(o.ph,2.2)});case"electrolytic":case"radial":{let c=s(o.p,2.5),l=e.match(/_d([\d.]+)/),h=o.d!==void 0?s(o.d,c*2):l?Number(l[1]):c*2;return Pe(tBi,{diameter:h,leadPitch:c})}case"potentiometer":return Pe(nBi,{bodyWidth:s(o.w,5.35),bodyLength:s(o.ca,14),bodyHeight:s(o.h,4),leads:O0e(n)});case"smdpushbutton":return Pe(oBi,{padSpanX:s(o.px,4.2),padSpanY:s(o.py,2.15),padWidth:s(o.pw,1.05),padLength:s(o.ph,0.7)});case"breakoutheaders":{let c=s(o.p,2.54),l=s(o.w,10)/2,h=[{x:-l,pins:o.left??0,key:"left"},{x:l,pins:o.right??0,key:"right"}];return Pe($o,{children:h.filter(({pins:d})=>d>0).map(({x:d,pins:u,key:_})=>Pe(go,{center:[d,0,0],children:Pe(Ic,{rotation:[0,0,"90deg"],children:Pe(tWn,{numberOfPins:u,pitch:c})})},_))})}case"sod923":return Pe(lwi,{});case"hc49":return Pe(Awi,{});case"micromelf":return Pe(fwi,{});case"minimelf":return Pe(_Wn,{});case"melf":return Pe(ywi,{});case"ms012":return Pe(xwi,{pinCount:o.num_pins,padContactLength:o.pl,leadWidth:o.pw,pitch:o.p});case"ms013":return Pe(Cwi,{pinCount:o.num_pins,padContactLength:o.pl,leadWidth:o.pw,pitch:o.p});case"sot723":return Pe(gwi,{});case"to220":return Pe(gWn,{leads:O0e(n)});case"to220f":return Pe(gWn,{mouldedTab:!0,leads:O0e(n)});case"to92":return Pe(AWn,{leads:O0e(n)});case"to92l":case"to92s":{let c=s(o.w,4.8),l=s(o.h,4),h=Math.max(c,l);return Pe(AWn,{bodyDiameter:h,flatCut:Math.max(h-Math.min(c,l),0.4),leads:O0e(n)})}case"to252":case"dpak":case"to263":case"d2pak":{let c=o.fn==="to263"||o.fn==="d2pak",l=s(o.tabw,c?8.38:6.2),h=Math.min(s(o.tabh,c?10:5.8),c?10:6.5);return Pe(eBi,{bodyWidth:l,bodyLength:s(o.w,c?10.1:6.6),bodyHeight:c?4.4:2.3,tabWidth:l,tabLength:h,span:s(o.span,c?10.21:6.85),pitch:s(o.p,c?2.54:2.29),leadWidth:s(o.pw,1.5),leadContactLength:s(o.pl,3)})}case"stampboard":case"stampreceiver":return Pe(Nwi,{bodyWidth:o.w,leadsLeft:o.left,leadsRight:o.right,leadsTop:o.top,leadsBottom:o.bottom,leadsPitch:o.p,leadWidth:o.pw,leadLength:o.pl,innerHoles:o.innerhole,innerHoleEdgeDistance:o.innerholeedgedistance});case"mountedpcbmodule":{let c=o.rows??1,l=o.pinRowSide??"left",{holeInset:h,width:d,height:u,pinrow:_,pinRowHoleEdgeToEdgeDist:p}=o,m=Array.isArray(o.holes)?o.holes:[];return Pe(Rwi,{numPins:_,rows:c,p:o.p,id:o.id,od:o.od,width:d,height:u,pinRowSide:l,holes:m,holeInset:h,pinRowHoleEdgeToEdgeDist:p,nopin:o.nopin,female:o.female,screen:o.screen,screenWidth:o.screenwidth,screenHeight:o.screenheight,screenCenterOffsetX:o.screencenteroffsetx,screenCenterOffsetY:o.screencenteroffsety})}}switch(o.imperial){case"0402":return Pe(qUn,{color:i});case"0603":return Pe(JUn,{color:i});case"0805":return Pe(ZUn,{color:i});case"0201":return Pe(rWn,{color:i});case"01005":return Pe(iWn,{color:i});case"1206":return Pe(sWn,{color:i});case"1210":return Pe(aWn,{color:i});case"2010":return Pe(cWn,{color:i});case"2512":return Pe(lWn,{color:i})}if((o.fn==="res"||o.fn==="cap")&&o.p!==void 0&&o.ph!==void 0){let c=ki(o.p),l=ki(o.ph);if(Number.isFinite(c)&&Number.isFinite(l))return Pe($wi,{padPitch:c,padHeight:l,color:i??(o.fn==="cap"?"#856c4d":void 0)})}return null},hBi=(e)=>e&&typeof e==="object"&&("type"in e),ste=(e)=>{if(typeof e==="number")return e;if(typeof e==="string"){let t=/^(-?\d+(?:\.\d+)?)\s*deg$/i.exec(e);if(t)return parseFloat(t[1])*Math.PI/180;let n=Number(e);if(!Number.isNaN(n))return n}return 0},dBi=(e)=>{if(Array.isArray(e))return[Number(e[0])||0,Number(e[1])||0,Number(e[2])||0];if(typeof e==="object"&&e)return[Number(e.x)||0,Number(e.y)||0,Number(e.z)||0];return[0,0,0]};function Fv(e,t,n){let{jscad:{primitives:o,booleans:r,hulls:i,geometries:s,extrusions:a,transforms:c}}=n;if(e==null||e===!1)return[];if(Array.isArray(e))return e.flatMap((u)=>Fv(u,t,n));if(!hBi(e))return[];let{type:l,props:h,children:d}=e;if(h?.material){let{material:u,..._}=h;return Fv({...e,props:_},t,n).map((p)=>({...p,material:{...u},geom:{...p.geom,material:{...u}}}))}if(l===SWn)return(d??[]).flatMap((u)=>Fv(u,t,n));if(l===Kn){let u=h?.color;return(d??[]).flatMap((_)=>Fv(_,u??t,n))}if(l===go){let u=dBi(h?.offset??h?.center??{x:h?.x,y:h?.y,z:h?.z});return(d??[]).flatMap((p)=>Fv(p,t,n)).map(({geom:p,color:m,material:A})=>({material:A,geom:c.translate(u,p),color:m??t}))}if(l===Ic){let u=h?.angles??h?.rotation,_=Array.isArray(u)?[ste(u[0]),ste(u[1]),ste(u[2])]:[ste(h?.x??0),ste(h?.y??0),ste(h?.z??0)];return(d??[]).flatMap((m)=>Fv(m,t,n)).map(({geom:m,color:A,material:g})=>({material:g,geom:c.rotateZ(_[2],c.rotateY(_[1],c.rotateX(_[0],m))),color:A}))}if(l===rp||l===jl||l===oc){let u=(d??[]).flatMap((m)=>Fv(m,t,n)),_=u.map((m)=>m.geom);if(_.length===0)return[];let p;if(l===rp)p=r.union(_);else if(l===jl)p=r.subtract(_[0],_.slice(1));else p=i.hull(_);return[{geom:p,color:t,material:l===jl?u[0]?.material:void 0}]}if(l===Nd)return[{geom:h.geometry,color:t}];if(l===cte){let u=h?.points??[];return[{geom:s.geom2.fromPoints(u),color:t??h?.color}]}if(l===lte){let u=(d??[]).flatMap((g)=>Fv(g,t,n)),_=u.map((g)=>g.geom);if(_.length===0)return[];let p=_.length>1?r.union(_):_[0],m=h?.height??h?.h??1,A=a.extrudeLinear({height:m},p);if(A.polygons)for(let g of A.polygons){if(!g.plane||!g.vertices||g.vertices.length<3)continue;g.vertices.reverse()}return[{geom:A,color:t??h?.color,material:u.length===1?u[0]?.material:void 0}]}if(l===Ft||l===UUn||l===Ki||l===ate||l===oA||l===Ix){let u;if(l===Ft){let _=h?.size??[1,1,1],p=h?.offset,m=h?.center??(p?[p[0],p[1],p[2]]:[0,0,0]);u=o.cuboid({size:_,center:m})}else if(l===UUn){let _=h?.size??1,p=h?.offset,m=h?.center??(p?[p[0],p[1],p[2]]:[0,0,0]);u=o.cube({size:_,center:m})}else if(l===Ki){let _=h?.height??1,p=h?.radius??1,m=h?.center??[0,0,0];u=o.cylinder({height:_,radius:p,center:m})}else if(l===ate){let _=h?.radius??1,p=h?.center??[0,0,0];u=o.sphere({radius:_,center:p})}else if(l===Ix){let _=h?.height??1,p=h?.radius??1,m=h?.roundRadius??0.1,A=h?.center??[0,0,0];u=o.roundedCylinder({height:_,radius:p,roundRadius:m,center:A})}else{let _=h?.size??[1,1,1],p=h?.roundRadius??0.1,m=h?.center??[0,0,0];u=o.roundedCuboid({size:_,roundRadius:p,center:m})}return[{geom:u,color:t??h?.color}]}if(typeof l==="function"){let u=l(h??{});return Fv(u,t,n)}return(d??[]).flatMap((u)=>Fv(u,t,n))}function uBi(e,t){return{geometries:Fv(e,void 0,{jscad:t}).map((o)=>o.material?{...o,geom:{...o.geom,material:o.material}}:o)}}function J0e(e){if(e.polygons){let t=[],n=[],o=[],r=0;for(let s of e.polygons){for(let c of s.vertices){if(c.index=r,t.push(c[0],c[1],c[2]),e.color&&e.color.length>=3)o.push(e.color[0],e.color[1],e.color[2]);else o.push(1,1,1);r++}let a=s.vertices[0].index;for(let c=2;c<s.vertices.length;c++){let l=s.vertices[c-1].index,h=s.vertices[c].index;n.push(a,l,h)}}let i=new js;if(i.setAttribute("position",new Pl(new Float32Array(t),3)),i.setIndex(n),o.length>0)i.setAttribute("color",new Pl(new Float32Array(o),3));if(e.transforms){let s=new Gi;s.fromArray(e.transforms),i.applyMatrix4(s)}return i.computeVertexNormals(),i}if(e.sides){let t=[],n=[];for(let r of e.sides)if(t.push(r[0][0],r[0][1],0),e.color&&e.color.length>=3)n.push(e.color[0],e.color[1],e.color[2]);else n.push(1,1,1);let o=new js;if(o.setAttribute("position",new Pl(new Float32Array(t),3)),n.length>0)o.setAttribute("color",new Pl(new Float32Array(n),3));if(e.transforms){let r=new Gi;r.fromArray(e.transforms),o.applyMatrix4(r)}return o}return console.error("Invalid CSG object: neither polygons nor sides found"),new js}function tut(e,t){let n=Xdt(lBi,{footprint:e});return uBi(n,t)}var Tte=at(ln(),1);var Oeo=at(ln(),1),tg=at(ln(),1);var Veo=at(lo(),1),Owe=at(lo(),1);var Geo=at(lo(),1),oU=at(ln(),1);var $Ee=(()=>parseInt(Jxt.replace(/\D+/g,"")))();var pBi=Object.defineProperty,mBi=(e,t,n)=>(t in e)?pBi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_Bi=(e,t,n)=>(mBi(e,typeof t!=="symbol"?t+"":t,n),n);async function LWn(e){let t=await e.arrayBuffer(),n=btoa(String.fromCharCode(...new Uint8Array(t)));return`data:${e.type||""};base64,${n}`}var qEe,nut,hte,JEe;function out(e,t=1/0,n=null){if(!nut)nut=new i1(2,2,1,1);if(!hte)hte=new l3({uniforms:{blitTexture:new nfe(e)},vertexShader:`
        varying vec2 vUv;
        void main(){
            vUv = uv;
            gl_Position = vec4(position.xy * 1.0,0.,.999999);
        }
      `,fragmentShader:`
          uniform sampler2D blitTexture; 
          varying vec2 vUv;

          void main(){ 
              gl_FragColor = vec4(vUv.xy, 0, 1);
              
              #ifdef IS_SRGB
              gl_FragColor = LinearTosRGB( texture2D( blitTexture, vUv) );
              #else
              gl_FragColor = texture2D( blitTexture, vUv);
              #endif
          }
      `});if(hte.uniforms.blitTexture.value=e,hte.defines.IS_SRGB="colorSpace"in e?e.colorSpace==="srgb":e.encoding===3001,hte.needsUpdate=!0,!JEe)JEe=new Mo(nut,hte),JEe.frustrumCulled=!1;let o=new Pc,r=new Dy;if(r.add(JEe),!n)n=qEe=new d3({antialias:!1});n.setSize(Math.min(e.image.width,t),Math.min(e.image.height,t)),n.clear(),n.render(r,o);let i=new vl(n.domElement);if(i.minFilter=e.minFilter,i.magFilter=e.magFilter,i.wrapS=e.wrapS,i.wrapT=e.wrapT,i.name=e.name,qEe)qEe.dispose(),qEe=null;return i}var HWn={POSITION:["byte","byte normalized","unsigned byte","unsigned byte normalized","short","short normalized","unsigned short","unsigned short normalized"],NORMAL:["byte normalized","short normalized"],TANGENT:["byte normalized","short normalized"],TEXCOORD:["byte","byte normalized","unsigned byte","short","short normalized","unsigned short"]},dte=(()=>{class e{constructor(){this.pluginCallbacks=[],this.register(function(t){return new WWn(t)}),this.register(function(t){return new XWn(t)}),this.register(function(t){return new $Wn(t)}),this.register(function(t){return new qWn(t)}),this.register(function(t){return new JWn(t)}),this.register(function(t){return new ZWn(t)}),this.register(function(t){return new jWn(t)}),this.register(function(t){return new KWn(t)}),this.register(function(t){return new eXn(t)}),this.register(function(t){return new tXn(t)}),this.register(function(t){return new nXn(t)})}register(t){if(this.pluginCallbacks.indexOf(t)===-1)this.pluginCallbacks.push(t);return this}unregister(t){if(this.pluginCallbacks.indexOf(t)!==-1)this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(t),1);return this}parse(t,n,o,r){let i=new UWn,s=[];for(let a=0,c=this.pluginCallbacks.length;a<c;a++)s.push(this.pluginCallbacks[a](i));i.setPlugins(s),i.write(t,n,r).catch(o)}parseAsync(t,n){let o=this;return new Promise(function(r,i){o.parse(t,r,i,n)})}}return _Bi(e,"Utils",{insertKeyframe:function(t,n){let r=t.getValueSize(),i=new t.TimeBufferType(t.times.length+1),s=new t.ValueBufferType(t.values.length+r),a=t.createInterpolant(new t.ValueBufferType(r)),c;if(t.times.length===0){i[0]=n;for(let l=0;l<r;l++)s[l]=0;c=0}else if(n<t.times[0]){if(Math.abs(t.times[0]-n)<0.001)return 0;i[0]=n,i.set(t.times,1),s.set(a.evaluate(n),0),s.set(t.values,r),c=0}else if(n>t.times[t.times.length-1]){if(Math.abs(t.times[t.times.length-1]-n)<0.001)return t.times.length-1;i[i.length-1]=n,i.set(t.times,0),s.set(t.values,0),s.set(a.evaluate(n),t.values.length),c=i.length-1}else for(let l=0;l<t.times.length;l++){if(Math.abs(t.times[l]-n)<0.001)return l;if(t.times[l]<n&&t.times[l+1]>n){i.set(t.times.slice(0,l+1),0),i[l+1]=n,i.set(t.times.slice(l+1),l+2),s.set(t.values.slice(0,(l+1)*r),0),s.set(a.evaluate(n),(l+1)*r),s.set(t.values.slice((l+1)*r),(l+2)*r),c=l+1;break}}return t.times=i,t.values=s,c},mergeMorphTargetTracks:function(t,n){let o=[],r={},i=t.tracks;for(let s=0;s<i.length;++s){let a=i[s],c=dl.parseTrackName(a.name),l=dl.findNode(n,c.nodeName);if(c.propertyName!=="morphTargetInfluences"||c.propertyIndex===void 0){o.push(a);continue}if(a.createInterpolant!==a.InterpolantFactoryMethodDiscrete&&a.createInterpolant!==a.InterpolantFactoryMethodLinear){if(a.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline)throw Error("THREE.GLTFExporter: Cannot merge tracks with glTF CUBICSPLINE interpolation.");console.warn("THREE.GLTFExporter: Morph target interpolation mode not yet supported. Using LINEAR instead."),a=a.clone(),a.setInterpolation(Wre)}let h=l.morphTargetInfluences.length,d=l.morphTargetDictionary[c.propertyIndex];if(d===void 0)throw Error("THREE.GLTFExporter: Morph target name not found: "+c.propertyIndex);let u;if(r[l.uuid]===void 0){u=a.clone();let p=new u.ValueBufferType(h*u.times.length);for(let m=0;m<u.times.length;m++)p[m*h+d]=u.values[m];u.name=(c.nodeName||"")+".morphTargetInfluences",u.values=p,r[l.uuid]=u,o.push(u);continue}let _=a.createInterpolant(new a.ValueBufferType(1));u=r[l.uuid];for(let p=0;p<u.times.length;p++)u.values[p*h+d]=_.evaluate(u.times[p]);for(let p=0;p<a.times.length;p++){let m=this.insertKeyframe(u,a.times[p]);u.values[m*h+d]=a.values[p]}}return t.tracks=o,t}}),e})(),Gc={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,REPEAT:10497},rut="KHR_mesh_quantization",nC={};nC[RAe]=Gc.NEAREST;nC[QAe]=Gc.NEAREST_MIPMAP_NEAREST;nC[kAe]=Gc.NEAREST_MIPMAP_LINEAR;nC[Ec]=Gc.LINEAR;nC[LAe]=Gc.LINEAR_MIPMAP_NEAREST;nC[Jd]=Gc.LINEAR_MIPMAP_LINEAR;nC[Bb]=Gc.CLAMP_TO_EDGE;nC[h3]=Gc.REPEAT;nC[NAe]=Gc.MIRRORED_REPEAT;var FWn={scale:"scale",position:"translation",quaternion:"rotation",morphTargetInfluences:"weights"},gBi=new No,zWn=12,ABi=1179937895,fBi=2,OWn=8,yBi=1313821514,xBi=5130562;function Z0e(e,t){return e.length===t.length&&e.every(function(n,o){return n===t[o]})}function CBi(e){return new TextEncoder().encode(e).buffer}function bBi(e){return Z0e(e.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}function IBi(e,t,n){let o={min:Array(e.itemSize).fill(Number.POSITIVE_INFINITY),max:Array(e.itemSize).fill(Number.NEGATIVE_INFINITY)};for(let r=t;r<t+n;r++)for(let i=0;i<e.itemSize;i++){let s;if(e.itemSize>4)s=e.array[r*e.itemSize+i];else{if(i===0)s=e.getX(r);else if(i===1)s=e.getY(r);else if(i===2)s=e.getZ(r);else if(i===3)s=e.getW(r);if(e.normalized===!0)s=t2.normalize(s,e.array)}o.min[i]=Math.min(o.min[i],s),o.max[i]=Math.max(o.max[i],s)}return o}function GWn(e){return Math.ceil(e/4)*4}function iut(e,t=0){let n=GWn(e.byteLength);if(n!==e.byteLength){let o=new Uint8Array(n);if(o.set(new Uint8Array(e)),t!==0)for(let r=e.byteLength;r<n;r++)o[r]=t;return o.buffer}return e}function VWn(){if(typeof document>"u"&&typeof OffscreenCanvas<"u")return new OffscreenCanvas(1,1);return document.createElement("canvas")}function YWn(e,t){if(e.toBlob!==void 0)return new Promise((o)=>e.toBlob(o,t));let n;if(t==="image/jpeg")n=0.92;else if(t==="image/webp")n=0.8;return e.convertToBlob({type:t,quality:n})}class UWn{constructor(){this.plugins=[],this.options={},this.pending=[],this.buffers=[],this.byteOffset=0,this.buffers=[],this.nodeMap=new Map,this.skins=[],this.extensionsUsed={},this.extensionsRequired={},this.uids=new Map,this.uid=0,this.json={asset:{version:"2.0",generator:"THREE.GLTFExporter"}},this.cache={meshes:new Map,attributes:new Map,attributesNormalized:new Map,materials:new Map,textures:new Map,images:new Map}}setPlugins(e){this.plugins=e}async write(e,t,n={}){if(this.options=Object.assign({binary:!1,trs:!1,onlyVisible:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},n),this.options.animations.length>0)this.options.trs=!0;this.processInput(e),await Promise.all(this.pending);let o=this,{buffers:r,json:i}=o;n=o.options;let{extensionsUsed:s,extensionsRequired:a}=o,c=new Blob(r,{type:"application/octet-stream"}),l=Object.keys(s),h=Object.keys(a);if(l.length>0)i.extensionsUsed=l;if(h.length>0)i.extensionsRequired=h;if(i.buffers&&i.buffers.length>0)i.buffers[0].byteLength=c.size;if(n.binary===!0)c.arrayBuffer().then((d)=>{let u=iut(d),_=new DataView(new ArrayBuffer(OWn));_.setUint32(0,u.byteLength,!0),_.setUint32(4,xBi,!0);let p=iut(CBi(JSON.stringify(i)),32),m=new DataView(new ArrayBuffer(OWn));m.setUint32(0,p.byteLength,!0),m.setUint32(4,yBi,!0);let A=new ArrayBuffer(zWn),g=new DataView(A);g.setUint32(0,ABi,!0),g.setUint32(4,fBi,!0);let f=zWn+m.byteLength+p.byteLength+_.byteLength+u.byteLength;g.setUint32(8,f,!0),new Blob([A,m,p,_,u],{type:"application/octet-stream"}).arrayBuffer().then(t)});else if(i.buffers&&i.buffers.length>0)LWn(c).then((d)=>{i.buffers[0].uri=d,t(i)});else t(i)}serializeUserData(e,t){if(Object.keys(e.userData).length===0)return;let n=this.options,o=this.extensionsUsed;try{let r=JSON.parse(JSON.stringify(e.userData));if(n.includeCustomExtensions&&r.gltfExtensions){if(t.extensions===void 0)t.extensions={};for(let i in r.gltfExtensions)t.extensions[i]=r.gltfExtensions[i],o[i]=!0;delete r.gltfExtensions}if(Object.keys(r).length>0)t.extras=r}catch(r){console.warn("THREE.GLTFExporter: userData of '"+e.name+"' won't be serialized because of JSON.stringify error - "+r.message)}}getUID(e,t=!1){if(this.uids.has(e)===!1){let o=new Map;o.set(!0,this.uid++),o.set(!1,this.uid++),this.uids.set(e,o)}return this.uids.get(e).get(t)}isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;let n=new Et;for(let o=0,r=e.count;o<r;o++)if(Math.abs(n.fromBufferAttribute(e,o).length()-1)>0.0005)return!1;return!0}createNormalizedNormalAttribute(e){let t=this.cache;if(t.attributesNormalized.has(e))return t.attributesNormalized.get(e);let n=e.clone(),o=new Et;for(let r=0,i=n.count;r<i;r++){if(o.fromBufferAttribute(n,r),o.x===0&&o.y===0&&o.z===0)o.setX(1);else o.normalize();n.setXYZ(r,o.x,o.y,o.z)}return t.attributesNormalized.set(e,n),n}applyTextureTransform(e,t){let n=!1,o={};if(t.offset.x!==0||t.offset.y!==0)o.offset=t.offset.toArray(),n=!0;if(t.rotation!==0)o.rotation=t.rotation,n=!0;if(t.repeat.x!==1||t.repeat.y!==1)o.scale=t.repeat.toArray(),n=!0;if(n)e.extensions=e.extensions||{},e.extensions.KHR_texture_transform=o,this.extensionsUsed.KHR_texture_transform=!0}buildMetalRoughTexture(e,t){if(e===t)return e;function n(u){if("colorSpace"in u?u.colorSpace==="srgb":u.encoding===3001)return function(p){return p<0.04045?p*0.0773993808:Math.pow(p*0.9478672986+0.0521327014,2.4)};return function(p){return p}}if(console.warn("THREE.GLTFExporter: Merged metalnessMap and roughnessMap textures."),e instanceof Jre)e=out(e);if(t instanceof Jre)t=out(t);let o=e?e.image:null,r=t?t.image:null,i=Math.max(o?o.width:0,r?r.width:0),s=Math.max(o?o.height:0,r?r.height:0),a=VWn();a.width=i,a.height=s;let c=a.getContext("2d");c.fillStyle="#00ffff",c.fillRect(0,0,i,s);let l=c.getImageData(0,0,i,s);if(o){c.drawImage(o,0,0,i,s);let u=n(e),_=c.getImageData(0,0,i,s).data;for(let p=2;p<_.length;p+=4)l.data[p]=u(_[p]/256)*256}if(r){c.drawImage(r,0,0,i,s);let u=n(t),_=c.getImageData(0,0,i,s).data;for(let p=1;p<_.length;p+=4)l.data[p]=u(_[p]/256)*256}c.putImageData(l,0,0);let d=(e||t).clone();if(d.source=new vl(a).source,"colorSpace"in d)d.colorSpace="";else d.encoding=3000;if(d.channel=(e||t).channel,e&&t&&e.channel!==t.channel)console.warn("THREE.GLTFExporter: UV channels for metalnessMap and roughnessMap textures must match.");return d}processBuffer(e){let t=this.json,n=this.buffers;if(!t.buffers)t.buffers=[{byteLength:0}];return n.push(e),0}processBufferView(e,t,n,o,r){let i=this.json;if(!i.bufferViews)i.bufferViews=[];let s;switch(t){case Gc.BYTE:case Gc.UNSIGNED_BYTE:s=1;break;case Gc.SHORT:case Gc.UNSIGNED_SHORT:s=2;break;default:s=4}let a=e.itemSize*s;if(r===Gc.ARRAY_BUFFER)a=Math.ceil(a/4)*4;let c=GWn(o*a),l=new DataView(new ArrayBuffer(c)),h=0;for(let _=n;_<n+o;_++){for(let p=0;p<e.itemSize;p++){let m;if(e.itemSize>4)m=e.array[_*e.itemSize+p];else{if(p===0)m=e.getX(_);else if(p===1)m=e.getY(_);else if(p===2)m=e.getZ(_);else if(p===3)m=e.getW(_);if(e.normalized===!0)m=t2.normalize(m,e.array)}if(t===Gc.FLOAT)l.setFloat32(h,m,!0);else if(t===Gc.INT)l.setInt32(h,m,!0);else if(t===Gc.UNSIGNED_INT)l.setUint32(h,m,!0);else if(t===Gc.SHORT)l.setInt16(h,m,!0);else if(t===Gc.UNSIGNED_SHORT)l.setUint16(h,m,!0);else if(t===Gc.BYTE)l.setInt8(h,m);else if(t===Gc.UNSIGNED_BYTE)l.setUint8(h,m);h+=s}if(h%a!==0)h+=a-h%a}let d={buffer:this.processBuffer(l.buffer),byteOffset:this.byteOffset,byteLength:c};if(r!==void 0)d.target=r;if(r===Gc.ARRAY_BUFFER)d.byteStride=a;return this.byteOffset+=c,i.bufferViews.push(d),{id:i.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){let t=this,n=t.json;if(!n.bufferViews)n.bufferViews=[];return e.arrayBuffer().then((o)=>{let r=iut(o),i={buffer:t.processBuffer(r),byteOffset:t.byteOffset,byteLength:r.byteLength};return t.byteOffset+=r.byteLength,n.bufferViews.push(i)-1})}processAccessor(e,t,n,o){let r=this.json,i={1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",9:"MAT3",16:"MAT4"},s;if(e.array.constructor===Float32Array)s=Gc.FLOAT;else if(e.array.constructor===Int32Array)s=Gc.INT;else if(e.array.constructor===Uint32Array)s=Gc.UNSIGNED_INT;else if(e.array.constructor===Int16Array)s=Gc.SHORT;else if(e.array.constructor===Uint16Array)s=Gc.UNSIGNED_SHORT;else if(e.array.constructor===Int8Array)s=Gc.BYTE;else if(e.array.constructor===Uint8Array)s=Gc.UNSIGNED_BYTE;else throw Error("THREE.GLTFExporter: Unsupported bufferAttribute component type: "+e.array.constructor.name);if(n===void 0)n=0;if(o===void 0)o=e.count;if(o===0)return null;let a=IBi(e,n,o),c;if(t!==void 0)c=e===t.index?Gc.ELEMENT_ARRAY_BUFFER:Gc.ARRAY_BUFFER;let l=this.processBufferView(e,s,n,o,c),h={bufferView:l.id,byteOffset:l.byteOffset,componentType:s,count:o,max:a.max,min:a.min,type:i[e.itemSize]};if(e.normalized===!0)h.normalized=!0;if(!r.accessors)r.accessors=[];return r.accessors.push(h)-1}processImage(e,t,n,o="image/png"){if(e!==null){let r=this,{cache:i,json:s,options:a,pending:c}=r;if(!i.images.has(e))i.images.set(e,{});let l=i.images.get(e),h=o+":flipY/"+n.toString();if(l[h]!==void 0)return l[h];if(!s.images)s.images=[];let d={mimeType:o},u=VWn();u.width=Math.min(e.width,a.maxTextureSize),u.height=Math.min(e.height,a.maxTextureSize);let _=u.getContext("2d");if(n===!0)_.translate(0,u.height),_.scale(1,-1);if(e.data!==void 0){if(t!==pQe)console.error("GLTFExporter: Only RGBAFormat is supported.",t);if(e.width>a.maxTextureSize||e.height>a.maxTextureSize)console.warn("GLTFExporter: Image size is bigger than maxTextureSize",e);let m=new Uint8ClampedArray(e.height*e.width*4);for(let A=0;A<m.length;A+=4)m[A+0]=e.data[A+0],m[A+1]=e.data[A+1],m[A+2]=e.data[A+2],m[A+3]=e.data[A+3];_.putImageData(new ImageData(m,e.width,e.height),0,0)}else _.drawImage(e,0,0,u.width,u.height);if(a.binary===!0)c.push(YWn(u,o).then((m)=>r.processBufferViewImage(m)).then((m)=>{d.bufferView=m}));else if(u.toDataURL!==void 0)d.uri=u.toDataURL(o);else c.push(YWn(u,o).then(LWn).then((m)=>{d.uri=m}));let p=s.images.push(d)-1;return l[h]=p,p}else throw Error("THREE.GLTFExporter: No valid image data found. Unable to process texture.")}processSampler(e){let t=this.json;if(!t.samplers)t.samplers=[];let n={magFilter:nC[e.magFilter],minFilter:nC[e.minFilter],wrapS:nC[e.wrapS],wrapT:nC[e.wrapT]};return t.samplers.push(n)-1}processTexture(e){let n=this.options,o=this.cache,r=this.json;if(o.textures.has(e))return o.textures.get(e);if(!r.textures)r.textures=[];if(e instanceof Jre)e=out(e,n.maxTextureSize);let i=e.userData.mimeType;if(i==="image/webp")i="image/png";let s={sampler:this.processSampler(e),source:this.processImage(e.image,e.format,e.flipY,i)};if(e.name)s.name=e.name;this._invokeAll(function(c){c.writeTexture&&c.writeTexture(e,s)});let a=r.textures.push(s)-1;return o.textures.set(e,a),a}processMaterial(e){let t=this.cache,n=this.json;if(t.materials.has(e))return t.materials.get(e);if(e.isShaderMaterial)return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."),null;if(!n.materials)n.materials=[];let o={pbrMetallicRoughness:{}};if(e.isMeshStandardMaterial!==!0&&e.isMeshBasicMaterial!==!0)console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");let r=e.color.toArray().concat([e.opacity]);if(!Z0e(r,[1,1,1,1]))o.pbrMetallicRoughness.baseColorFactor=r;if(e.isMeshStandardMaterial)o.pbrMetallicRoughness.metallicFactor=e.metalness,o.pbrMetallicRoughness.roughnessFactor=e.roughness;else o.pbrMetallicRoughness.metallicFactor=0.5,o.pbrMetallicRoughness.roughnessFactor=0.5;if(e.metalnessMap||e.roughnessMap){let s=this.buildMetalRoughTexture(e.metalnessMap,e.roughnessMap),a={index:this.processTexture(s),channel:s.channel};this.applyTextureTransform(a,s),o.pbrMetallicRoughness.metallicRoughnessTexture=a}if(e.map){let s={index:this.processTexture(e.map),texCoord:e.map.channel};this.applyTextureTransform(s,e.map),o.pbrMetallicRoughness.baseColorTexture=s}if(e.emissive){let s=e.emissive;if(Math.max(s.r,s.g,s.b)>0)o.emissiveFactor=e.emissive.toArray();if(e.emissiveMap){let c={index:this.processTexture(e.emissiveMap),texCoord:e.emissiveMap.channel};this.applyTextureTransform(c,e.emissiveMap),o.emissiveTexture=c}}if(e.normalMap){let s={index:this.processTexture(e.normalMap),texCoord:e.normalMap.channel};if(e.normalScale&&e.normalScale.x!==1)s.scale=e.normalScale.x;this.applyTextureTransform(s,e.normalMap),o.normalTexture=s}if(e.aoMap){let s={index:this.processTexture(e.aoMap),texCoord:e.aoMap.channel};if(e.aoMapIntensity!==1)s.strength=e.aoMapIntensity;this.applyTextureTransform(s,e.aoMap),o.occlusionTexture=s}if(e.transparent)o.alphaMode="BLEND";else if(e.alphaTest>0)o.alphaMode="MASK",o.alphaCutoff=e.alphaTest;if(e.side===bd)o.doubleSided=!0;if(e.name!=="")o.name=e.name;this.serializeUserData(e,o),this._invokeAll(function(s){s.writeMaterial&&s.writeMaterial(e,o)});let i=n.materials.push(o)-1;return t.materials.set(e,i),i}processMesh(e){let t=this.cache,n=this.json,o=[e.geometry.uuid];if(Array.isArray(e.material))for(let f=0,y=e.material.length;f<y;f++)o.push(e.material[f].uuid);else o.push(e.material.uuid);let r=o.join(":");if(t.meshes.has(r))return t.meshes.get(r);let i=e.geometry,s;if(e.isLineSegments)s=Gc.LINES;else if(e.isLineLoop)s=Gc.LINE_LOOP;else if(e.isLine)s=Gc.LINE_STRIP;else if(e.isPoints)s=Gc.POINTS;else s=e.material.wireframe?Gc.LINES:Gc.TRIANGLES;let a={},c={},l=[],h=[],d={...$Ee>=152?{uv:"TEXCOORD_0",uv1:"TEXCOORD_1",uv2:"TEXCOORD_2",uv3:"TEXCOORD_3"}:{uv:"TEXCOORD_0",uv2:"TEXCOORD_1"},color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},u=i.getAttribute("normal");if(u!==void 0&&!this.isNormalizedNormalAttribute(u))console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),i.setAttribute("normal",this.createNormalizedNormalAttribute(u));let _=null;for(let f in i.attributes){if(f.slice(0,5)==="morph")continue;let y=i.attributes[f];if(f=d[f]||f.toUpperCase(),!/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(f))f="_"+f;if(t.attributes.has(this.getUID(y))){c[f]=t.attributes.get(this.getUID(y));continue}_=null;let C=y.array;if(f==="JOINTS_0"&&!(C instanceof Uint16Array)&&!(C instanceof Uint8Array))console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),_=new Pl(new Uint16Array(C),y.itemSize,y.normalized);let b=this.processAccessor(_||y,i);if(b!==null){if(!f.startsWith("_"))this.detectMeshQuantization(f,y);c[f]=b,t.attributes.set(this.getUID(y),b)}}if(u!==void 0)i.setAttribute("normal",u);if(Object.keys(c).length===0)return null;if(e.morphTargetInfluences!==void 0&&e.morphTargetInfluences.length>0){let f=[],y=[],x={};if(e.morphTargetDictionary!==void 0)for(let C in e.morphTargetDictionary)x[e.morphTargetDictionary[C]]=C;for(let C=0;C<e.morphTargetInfluences.length;++C){let b={},I=!1;for(let v in i.morphAttributes){if(v!=="position"&&v!=="normal"){if(!I)console.warn("GLTFExporter: Only POSITION and NORMAL morph are supported."),I=!0;continue}let P=i.morphAttributes[v][C],M=v.toUpperCase(),B=i.attributes[v];if(t.attributes.has(this.getUID(P,!0))){b[M]=t.attributes.get(this.getUID(P,!0));continue}let T=P.clone();if(!i.morphTargetsRelative)for(let N=0,D=P.count;N<D;N++)for(let L=0;L<P.itemSize;L++){if(L===0)T.setX(N,P.getX(N)-B.getX(N));if(L===1)T.setY(N,P.getY(N)-B.getY(N));if(L===2)T.setZ(N,P.getZ(N)-B.getZ(N));if(L===3)T.setW(N,P.getW(N)-B.getW(N))}b[M]=this.processAccessor(T,i),t.attributes.set(this.getUID(B,!0),b[M])}if(h.push(b),f.push(e.morphTargetInfluences[C]),e.morphTargetDictionary!==void 0)y.push(x[C])}if(a.weights=f,y.length>0)a.extras={},a.extras.targetNames=y}let p=Array.isArray(e.material);if(p&&i.groups.length===0)return null;let m=p?e.material:[e.material],A=p?i.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let f=0,y=A.length;f<y;f++){let x={mode:s,attributes:c};if(this.serializeUserData(i,x),h.length>0)x.targets=h;if(i.index!==null){let b=this.getUID(i.index);if(A[f].start!==void 0||A[f].count!==void 0)b+=":"+A[f].start+":"+A[f].count;if(t.attributes.has(b))x.indices=t.attributes.get(b);else x.indices=this.processAccessor(i.index,i,A[f].start,A[f].count),t.attributes.set(b,x.indices);if(x.indices===null)delete x.indices}let C=this.processMaterial(m[A[f].materialIndex]);if(C!==null)x.material=C;l.push(x)}if(a.primitives=l,!n.meshes)n.meshes=[];this._invokeAll(function(f){f.writeMesh&&f.writeMesh(e,a)});let g=n.meshes.push(a)-1;return t.meshes.set(r,g),g}detectMeshQuantization(e,t){if(this.extensionsUsed[rut])return;let n=void 0;switch(t.array.constructor){case Int8Array:n="byte";break;case Uint8Array:n="unsigned byte";break;case Int16Array:n="short";break;case Uint16Array:n="unsigned short";break;default:return}if(t.normalized)n+=" normalized";let o=e.split("_",1)[0];if(HWn[o]&&HWn[o].includes(n))this.extensionsUsed[rut]=!0,this.extensionsRequired[rut]=!0}processCamera(e){let t=this.json;if(!t.cameras)t.cameras=[];let n=e.isOrthographicCamera,o={type:n?"orthographic":"perspective"};if(n)o.orthographic={xmag:e.right*2,ymag:e.top*2,zfar:e.far<=0?0.001:e.far,znear:e.near<0?0:e.near};else o.perspective={aspectRatio:e.aspect,yfov:t2.degToRad(e.fov),zfar:e.far<=0?0.001:e.far,znear:e.near<0?0:e.near};if(e.name!=="")o.name=e.type;return t.cameras.push(o)-1}processAnimation(e,t){let n=this.json,o=this.nodeMap;if(!n.animations)n.animations=[];e=dte.Utils.mergeMorphTargetTracks(e.clone(),t);let r=e.tracks,i=[],s=[];for(let a=0;a<r.length;++a){let c=r[a],l=dl.parseTrackName(c.name),h=dl.findNode(t,l.nodeName),d=FWn[l.propertyName];if(l.objectName==="bones")if(h.isSkinnedMesh===!0)h=h.skeleton.getBoneByName(l.objectIndex);else h=void 0;if(!h||!d)return console.warn('THREE.GLTFExporter: Could not export animation track "%s".',c.name),null;let u=1,_=c.values.length/c.times.length;if(d===FWn.morphTargetInfluences)_/=h.morphTargetInfluences.length;let p;if(c.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline===!0)p="CUBICSPLINE",_/=3;else if(c.getInterpolation()===HAe)p="STEP";else p="LINEAR";s.push({input:this.processAccessor(new Pl(c.times,u)),output:this.processAccessor(new Pl(c.values,_)),interpolation:p}),i.push({sampler:s.length-1,target:{node:o.get(h),path:d}})}return n.animations.push({name:e.name||"clip_"+n.animations.length,samplers:s,channels:i}),n.animations.length-1}processSkin(e){let t=this.json,n=this.nodeMap,o=t.nodes[n.get(e)],r=e.skeleton;if(r===void 0)return null;let i=e.skeleton.bones[0];if(i===void 0)return null;let s=[],a=new Float32Array(r.bones.length*16),c=new Gi;for(let h=0;h<r.bones.length;++h)s.push(n.get(r.bones[h])),c.copy(r.boneInverses[h]),c.multiply(e.bindMatrix).toArray(a,h*16);if(t.skins===void 0)t.skins=[];return t.skins.push({inverseBindMatrices:this.processAccessor(new Pl(a,16)),joints:s,skeleton:n.get(i)}),o.skin=t.skins.length-1}processNode(e){let t=this.json,n=this.options,o=this.nodeMap;if(!t.nodes)t.nodes=[];let r={};if(n.trs){let s=e.quaternion.toArray(),a=e.position.toArray(),c=e.scale.toArray();if(!Z0e(s,[0,0,0,1]))r.rotation=s;if(!Z0e(a,[0,0,0]))r.translation=a;if(!Z0e(c,[1,1,1]))r.scale=c}else{if(e.matrixAutoUpdate)e.updateMatrix();if(bBi(e.matrix)===!1)r.matrix=e.matrix.elements}if(e.name!=="")r.name=String(e.name);if(this.serializeUserData(e,r),e.isMesh||e.isLine||e.isPoints){let s=this.processMesh(e);if(s!==null)r.mesh=s}else if(e.isCamera)r.camera=this.processCamera(e);if(e.isSkinnedMesh)this.skins.push(e);if(e.children.length>0){let s=[];for(let a=0,c=e.children.length;a<c;a++){let l=e.children[a];if(l.visible||n.onlyVisible===!1){let h=this.processNode(l);if(h!==null)s.push(h)}}if(s.length>0)r.children=s}this._invokeAll(function(s){s.writeNode&&s.writeNode(e,r)});let i=t.nodes.push(r)-1;return o.set(e,i),i}processScene(e){let t=this.json,n=this.options;if(!t.scenes)t.scenes=[],t.scene=0;let o={};if(e.name!=="")o.name=e.name;t.scenes.push(o);let r=[];for(let i=0,s=e.children.length;i<s;i++){let a=e.children[i];if(a.visible||n.onlyVisible===!1){let c=this.processNode(a);if(c!==null)r.push(c)}}if(r.length>0)o.nodes=r;this.serializeUserData(e,o)}processObjects(e){let t=new Dy;t.name="AuxScene";for(let n=0;n<e.length;n++)t.children.push(e[n]);this.processScene(t)}processInput(e){let t=this.options;e=e instanceof Array?e:[e],this._invokeAll(function(o){o.beforeParse&&o.beforeParse(e)});let n=[];for(let o=0;o<e.length;o++)if(e[o]instanceof Dy)this.processScene(e[o]);else n.push(e[o]);if(n.length>0)this.processObjects(n);for(let o=0;o<this.skins.length;++o)this.processSkin(this.skins[o]);for(let o=0;o<t.animations.length;++o)this.processAnimation(t.animations[o],e[0]);this._invokeAll(function(o){o.afterParse&&o.afterParse(e)})}_invokeAll(e){for(let t=0,n=this.plugins.length;t<n;t++)e(this.plugins[t])}}class WWn{constructor(e){this.writer=e,this.name="KHR_lights_punctual"}writeNode(e,t){if(!e.isLight)return;if(!e.isDirectionalLight&&!e.isPointLight&&!e.isSpotLight){console.warn("THREE.GLTFExporter: Only directional, point, and spot lights are supported.",e);return}let n=this.writer,{json:o,extensionsUsed:r}=n,i={};if(e.name)i.name=e.name;if(i.color=e.color.toArray(),i.intensity=e.intensity,e.isDirectionalLight)i.type="directional";else if(e.isPointLight){if(i.type="point",e.distance>0)i.range=e.distance}else if(e.isSpotLight){if(i.type="spot",e.distance>0)i.range=e.distance;i.spot={},i.spot.innerConeAngle=(e.penumbra-1)*e.angle*-1,i.spot.outerConeAngle=e.angle}if(e.decay!==void 0&&e.decay!==2)console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2.");if(e.target&&(e.target.parent!==e||e.target.position.x!==0||e.target.position.y!==0||e.target.position.z!==-1))console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1.");if(!r[this.name])o.extensions=o.extensions||{},o.extensions[this.name]={lights:[]},r[this.name]=!0;let s=o.extensions[this.name].lights;s.push(i),t.extensions=t.extensions||{},t.extensions[this.name]={light:s.length-1}}}class XWn{constructor(e){this.writer=e,this.name="KHR_materials_unlit"}writeMaterial(e,t){if(!e.isMeshBasicMaterial)return;let o=this.writer.extensionsUsed;t.extensions=t.extensions||{},t.extensions[this.name]={},o[this.name]=!0,t.pbrMetallicRoughness.metallicFactor=0,t.pbrMetallicRoughness.roughnessFactor=0.9}}class jWn{constructor(e){this.writer=e,this.name="KHR_materials_clearcoat"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.clearcoat===0)return;let n=this.writer,o=n.extensionsUsed,r={};if(r.clearcoatFactor=e.clearcoat,e.clearcoatMap){let i={index:n.processTexture(e.clearcoatMap),texCoord:e.clearcoatMap.channel};n.applyTextureTransform(i,e.clearcoatMap),r.clearcoatTexture=i}if(r.clearcoatRoughnessFactor=e.clearcoatRoughness,e.clearcoatRoughnessMap){let i={index:n.processTexture(e.clearcoatRoughnessMap),texCoord:e.clearcoatRoughnessMap.channel};n.applyTextureTransform(i,e.clearcoatRoughnessMap),r.clearcoatRoughnessTexture=i}if(e.clearcoatNormalMap){let i={index:n.processTexture(e.clearcoatNormalMap),texCoord:e.clearcoatNormalMap.channel};n.applyTextureTransform(i,e.clearcoatNormalMap),r.clearcoatNormalTexture=i}t.extensions=t.extensions||{},t.extensions[this.name]=r,o[this.name]=!0}}class KWn{constructor(e){this.writer=e,this.name="KHR_materials_iridescence"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.iridescence===0)return;let n=this.writer,o=n.extensionsUsed,r={};if(r.iridescenceFactor=e.iridescence,e.iridescenceMap){let i={index:n.processTexture(e.iridescenceMap),texCoord:e.iridescenceMap.channel};n.applyTextureTransform(i,e.iridescenceMap),r.iridescenceTexture=i}if(r.iridescenceIor=e.iridescenceIOR,r.iridescenceThicknessMinimum=e.iridescenceThicknessRange[0],r.iridescenceThicknessMaximum=e.iridescenceThicknessRange[1],e.iridescenceThicknessMap){let i={index:n.processTexture(e.iridescenceThicknessMap),texCoord:e.iridescenceThicknessMap.channel};n.applyTextureTransform(i,e.iridescenceThicknessMap),r.iridescenceThicknessTexture=i}t.extensions=t.extensions||{},t.extensions[this.name]=r,o[this.name]=!0}}class $Wn{constructor(e){this.writer=e,this.name="KHR_materials_transmission"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;let n=this.writer,o=n.extensionsUsed,r={};if(r.transmissionFactor=e.transmission,e.transmissionMap){let i={index:n.processTexture(e.transmissionMap),texCoord:e.transmissionMap.channel};n.applyTextureTransform(i,e.transmissionMap),r.transmissionTexture=i}t.extensions=t.extensions||{},t.extensions[this.name]=r,o[this.name]=!0}}class qWn{constructor(e){this.writer=e,this.name="KHR_materials_volume"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;let n=this.writer,o=n.extensionsUsed,r={};if(r.thicknessFactor=e.thickness,e.thicknessMap){let i={index:n.processTexture(e.thicknessMap),texCoord:e.thicknessMap.channel};n.applyTextureTransform(i,e.thicknessMap),r.thicknessTexture=i}r.attenuationDistance=e.attenuationDistance,r.attenuationColor=e.attenuationColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=r,o[this.name]=!0}}class JWn{constructor(e){this.writer=e,this.name="KHR_materials_ior"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.ior===1.5)return;let o=this.writer.extensionsUsed,r={};r.ior=e.ior,t.extensions=t.extensions||{},t.extensions[this.name]=r,o[this.name]=!0}}class ZWn{constructor(e){this.writer=e,this.name="KHR_materials_specular"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.specularIntensity===1&&e.specularColor.equals(gBi)&&!e.specularIntensityMap&&!e.specularColorTexture)return;let n=this.writer,o=n.extensionsUsed,r={};if(e.specularIntensityMap){let i={index:n.processTexture(e.specularIntensityMap),texCoord:e.specularIntensityMap.channel};n.applyTextureTransform(i,e.specularIntensityMap),r.specularTexture=i}if(e.specularColorMap){let i={index:n.processTexture(e.specularColorMap),texCoord:e.specularColorMap.channel};n.applyTextureTransform(i,e.specularColorMap),r.specularColorTexture=i}r.specularFactor=e.specularIntensity,r.specularColorFactor=e.specularColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=r,o[this.name]=!0}}class eXn{constructor(e){this.writer=e,this.name="KHR_materials_sheen"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.sheen==0)return;let n=this.writer,o=n.extensionsUsed,r={};if(e.sheenRoughnessMap){let i={index:n.processTexture(e.sheenRoughnessMap),texCoord:e.sheenRoughnessMap.channel};n.applyTextureTransform(i,e.sheenRoughnessMap),r.sheenRoughnessTexture=i}if(e.sheenColorMap){let i={index:n.processTexture(e.sheenColorMap),texCoord:e.sheenColorMap.channel};n.applyTextureTransform(i,e.sheenColorMap),r.sheenColorTexture=i}r.sheenRoughnessFactor=e.sheenRoughness,r.sheenColorFactor=e.sheenColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=r,o[this.name]=!0}}class tXn{constructor(e){this.writer=e,this.name="KHR_materials_anisotropy"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.anisotropy==0)return;let n=this.writer,o=n.extensionsUsed,r={};if(e.anisotropyMap){let i={index:n.processTexture(e.anisotropyMap)};n.applyTextureTransform(i,e.anisotropyMap),r.anisotropyTexture=i}r.anisotropyStrength=e.anisotropy,r.anisotropyRotation=e.anisotropyRotation,t.extensions=t.extensions||{},t.extensions[this.name]=r,o[this.name]=!0}}class nXn{constructor(e){this.writer=e,this.name="KHR_materials_emissive_strength"}writeMaterial(e,t){if(!e.isMeshStandardMaterial||e.emissiveIntensity===1)return;let o=this.writer.extensionsUsed,r={};r.emissiveStrength=e.emissiveIntensity,t.extensions=t.extensions||{},t.extensions[this.name]=r,o[this.name]=!0}}function sut(){let e=new Dy,t=new S_;t.deleteAttribute("uv");let n=new vs({side:Ure}),o=new vs,r=new tie(16777215,5,28,2);r.position.set(0.418,16.199,0.3),e.add(r);let i=new Mo(t,n);i.position.set(-0.757,13.219,0.717),i.scale.set(31.713,28.305,28.591),e.add(i);let s=new Mo(t,o);s.position.set(-10.906,2.009,1.846),s.rotation.set(0,-0.195,0),s.scale.set(2.328,7.905,4.651),e.add(s);let a=new Mo(t,o);a.position.set(-5.607,-0.754,-0.758),a.rotation.set(0,0.994,0),a.scale.set(1.97,1.534,3.955),e.add(a);let c=new Mo(t,o);c.position.set(6.167,0.857,7.803),c.rotation.set(0,0.561,0),c.scale.set(3.927,6.285,3.687),e.add(c);let l=new Mo(t,o);l.position.set(-2.017,0.018,6.124),l.rotation.set(0,0.333,0),l.scale.set(2.002,4.566,2.064),e.add(l);let h=new Mo(t,o);h.position.set(2.291,-0.756,-2.621),h.rotation.set(0,-0.286,0),h.scale.set(1.546,1.552,1.496),e.add(h);let d=new Mo(t,o);d.position.set(-2.193,-0.369,-5.547),d.rotation.set(0,0.516,0),d.scale.set(3.875,3.487,2.986),e.add(d);let u=new Mo(t,f(50));u.position.set(-16.116,14.37,8.208),u.scale.set(0.1,2.428,2.739),e.add(u);let _=new Mo(t,f(50));_.position.set(-16.109,18.021,-8.207),_.scale.set(0.1,2.425,2.751),e.add(_);let p=new Mo(t,f(17));p.position.set(14.904,12.198,-1.832),p.scale.set(0.15,4.265,6.331),e.add(p);let m=new Mo(t,f(43));m.position.set(-0.462,8.89,14.52),m.scale.set(4.38,5.441,0.088),e.add(m);let A=new Mo(t,f(20));A.position.set(3.235,11.486,-12.541),A.scale.set(2.5,2,0.1),e.add(A);let g=new Mo(t,f(100));g.position.set(0,20,0),g.scale.set(1,0.1,1),e.add(g);function f(y){let x=new Up;return x.color.setScalar(y),x}return e}var vBi=Object.defineProperty,SBi=(e,t,n)=>(t in e)?vBi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,PBi=(e,t,n)=>(SBi(e,typeof t!=="symbol"?t+"":t,n),n);class aut{constructor(){PBi(this,"_listeners")}addEventListener(e,t){if(this._listeners===void 0)this._listeners={};let n=this._listeners;if(n[e]===void 0)n[e]=[];if(n[e].indexOf(t)===-1)n[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;let n=this._listeners;return n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;let o=this._listeners[e];if(o!==void 0){let r=o.indexOf(t);if(r!==-1)o.splice(r,1)}}dispatchEvent(e){if(this._listeners===void 0)return;let n=this._listeners[e.type];if(n!==void 0){e.target=this;let o=n.slice(0);for(let r=0,i=o.length;r<i;r++)o[r].call(this,e);e.target=null}}}var EBi=Object.defineProperty,MBi=(e,t,n)=>(t in e)?EBi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ls=(e,t,n)=>(MBi(e,typeof t!=="symbol"?t+"":t,n),n),ZEe=new V7,oXn=new Mb,wBi=Math.cos(70*(Math.PI/180)),rXn=(e,t)=>(e%t+t)%t;class eMe extends aut{constructor(e,t){super();ls(this,"object"),ls(this,"domElement"),ls(this,"enabled",!0),ls(this,"target",new Et),ls(this,"minDistance",0),ls(this,"maxDistance",1/0),ls(this,"minZoom",0),ls(this,"maxZoom",1/0),ls(this,"minPolarAngle",0),ls(this,"maxPolarAngle",Math.PI),ls(this,"minAzimuthAngle",-1/0),ls(this,"maxAzimuthAngle",1/0),ls(this,"enableDamping",!1),ls(this,"dampingFactor",0.05),ls(this,"enableZoom",!0),ls(this,"zoomSpeed",1),ls(this,"enableRotate",!0),ls(this,"rotateSpeed",1),ls(this,"enablePan",!0),ls(this,"panSpeed",1),ls(this,"screenSpacePanning",!0),ls(this,"keyPanSpeed",7),ls(this,"zoomToCursor",!1),ls(this,"autoRotate",!1),ls(this,"autoRotateSpeed",2),ls(this,"reverseOrbit",!1),ls(this,"reverseHorizontalOrbit",!1),ls(this,"reverseVerticalOrbit",!1),ls(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),ls(this,"mouseButtons",{LEFT:e2.ROTATE,MIDDLE:e2.DOLLY,RIGHT:e2.PAN}),ls(this,"touches",{ONE:o5.ROTATE,TWO:o5.DOLLY_PAN}),ls(this,"target0"),ls(this,"position0"),ls(this,"zoom0"),ls(this,"_domElementKeyEvents",null),ls(this,"getPolarAngle"),ls(this,"getAzimuthalAngle"),ls(this,"setPolarAngle"),ls(this,"setAzimuthalAngle"),ls(this,"getDistance"),ls(this,"getZoomScale"),ls(this,"listenToKeyEvents"),ls(this,"stopListenToKeyEvents"),ls(this,"saveState"),ls(this,"reset"),ls(this,"update"),ls(this,"connect"),ls(this,"dispose"),ls(this,"dollyIn"),ls(this,"dollyOut"),ls(this,"getScale"),ls(this,"setScale"),this.object=e,this.domElement=t,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=()=>l.phi,this.getAzimuthalAngle=()=>l.theta,this.setPolarAngle=(et)=>{let vt=rXn(et,2*Math.PI),ht=l.phi;if(ht<0)ht+=2*Math.PI;if(vt<0)vt+=2*Math.PI;let We=Math.abs(vt-ht);if(2*Math.PI-We<We)if(vt<ht)vt+=2*Math.PI;else ht+=2*Math.PI;h.phi=vt-ht,n.update()},this.setAzimuthalAngle=(et)=>{let vt=rXn(et,2*Math.PI),ht=l.theta;if(ht<0)ht+=2*Math.PI;if(vt<0)vt+=2*Math.PI;let We=Math.abs(vt-ht);if(2*Math.PI-We<We)if(vt<ht)vt+=2*Math.PI;else ht+=2*Math.PI;h.theta=vt-ht,n.update()},this.getDistance=()=>n.object.position.distanceTo(n.target),this.listenToKeyEvents=(et)=>{et.addEventListener("keydown",dt),this._domElementKeyEvents=et},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener("keydown",dt),this._domElementKeyEvents=null},this.saveState=()=>{n.target0.copy(n.target),n.position0.copy(n.object.position),n.zoom0=n.object.zoom},this.reset=()=>{n.target.copy(n.target0),n.object.position.copy(n.position0),n.object.zoom=n.zoom0,n.object.updateProjectionMatrix(),n.dispatchEvent(o),n.update(),a=s.NONE},this.update=(()=>{let et=new Et,vt=new Et(0,1,0),ht=new Eu().setFromUnitVectors(e.up,vt),We=ht.clone().invert(),Le=new Et,Ze=new Eu,$e=2*Math.PI;return function(){let ft=n.object.position;if(ht.setFromUnitVectors(e.up,vt),We.copy(ht).invert(),et.copy(ft).sub(n.target),et.applyQuaternion(ht),l.setFromVector3(et),n.autoRotate&&a===s.NONE)N(B());if(n.enableDamping)l.theta+=h.theta*n.dampingFactor,l.phi+=h.phi*n.dampingFactor;else l.theta+=h.theta,l.phi+=h.phi;let{minAzimuthAngle:It,maxAzimuthAngle:ze}=n;if(isFinite(It)&&isFinite(ze)){if(It<-Math.PI)It+=$e;else if(It>Math.PI)It-=$e;if(ze<-Math.PI)ze+=$e;else if(ze>Math.PI)ze-=$e;if(It<=ze)l.theta=Math.max(It,Math.min(ze,l.theta));else l.theta=l.theta>(It+ze)/2?Math.max(It,l.theta):Math.min(ze,l.theta)}if(l.phi=Math.max(n.minPolarAngle,Math.min(n.maxPolarAngle,l.phi)),l.makeSafe(),n.enableDamping===!0)n.target.addScaledVector(u,n.dampingFactor);else n.target.add(u);if(n.zoomToCursor&&v||n.object.isOrthographicCamera)l.radius=X(l.radius);else l.radius=X(l.radius*d);if(et.setFromSpherical(l),et.applyQuaternion(We),ft.copy(n.target).add(et),!n.object.matrixAutoUpdate)n.object.updateMatrix();if(n.object.lookAt(n.target),n.enableDamping===!0)h.theta*=1-n.dampingFactor,h.phi*=1-n.dampingFactor,u.multiplyScalar(1-n.dampingFactor);else h.set(0,0,0),u.set(0,0,0);let Xe=!1;if(n.zoomToCursor&&v){let it=null;if(n.object instanceof Pc&&n.object.isPerspectiveCamera){let St=et.length();it=X(St*d);let kt=St-it;n.object.position.addScaledVector(b,kt),n.object.updateMatrixWorld()}else if(n.object.isOrthographicCamera){let St=new Et(I.x,I.y,0);St.unproject(n.object),n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/d)),n.object.updateProjectionMatrix(),Xe=!0;let kt=new Et(I.x,I.y,0);kt.unproject(n.object),n.object.position.sub(kt).add(St),n.object.updateMatrixWorld(),it=et.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),n.zoomToCursor=!1;if(it!==null)if(n.screenSpacePanning)n.target.set(0,0,-1).transformDirection(n.object.matrix).multiplyScalar(it).add(n.object.position);else if(ZEe.origin.copy(n.object.position),ZEe.direction.set(0,0,-1).transformDirection(n.object.matrix),Math.abs(n.object.up.dot(ZEe.direction))<wBi)e.lookAt(n.target);else oXn.setFromNormalAndCoplanarPoint(n.object.up,n.target),ZEe.intersectPlane(oXn,n.target)}else if(n.object instanceof r5&&n.object.isOrthographicCamera){if(Xe=d!==1,Xe)n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/d)),n.object.updateProjectionMatrix()}if(d=1,v=!1,Xe||Le.distanceToSquared(n.object.position)>c||8*(1-Ze.dot(n.object.quaternion))>c)return n.dispatchEvent(o),Le.copy(n.object.position),Ze.copy(n.object.quaternion),Xe=!1,!0;return!1}})(),this.connect=(et)=>{n.domElement=et,n.domElement.style.touchAction="none",n.domElement.addEventListener("contextmenu",lt),n.domElement.addEventListener("pointerdown",_e),n.domElement.addEventListener("pointercancel",Se),n.domElement.addEventListener("wheel",nt)},this.dispose=()=>{var et,vt,ht,We,Le,Ze;if(n.domElement)n.domElement.style.touchAction="auto";if((et=n.domElement)==null||et.removeEventListener("contextmenu",lt),(vt=n.domElement)==null||vt.removeEventListener("pointerdown",_e),(ht=n.domElement)==null||ht.removeEventListener("pointercancel",Se),(We=n.domElement)==null||We.removeEventListener("wheel",nt),(Le=n.domElement)==null||Le.ownerDocument.removeEventListener("pointermove",ye),(Ze=n.domElement)==null||Ze.ownerDocument.removeEventListener("pointerup",Se),n._domElementKeyEvents!==null)n._domElementKeyEvents.removeEventListener("keydown",dt)};let n=this,o={type:"change"},r={type:"start"},i={type:"end"},s={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},a=s.NONE,c=0.000001,l=new gw,h=new gw,d=1,u=new Et,_=new ro,p=new ro,m=new ro,A=new ro,g=new ro,f=new ro,y=new ro,x=new ro,C=new ro,b=new Et,I=new ro,v=!1,P=[],M={};function B(){return 2*Math.PI/60/60*n.autoRotateSpeed}function T(){return Math.pow(0.95,n.zoomSpeed)}function N(et){if(n.reverseOrbit||n.reverseHorizontalOrbit)h.theta+=et;else h.theta-=et}function D(et){if(n.reverseOrbit||n.reverseVerticalOrbit)h.phi+=et;else h.phi-=et}let L=(()=>{let et=new Et;return function(ht,We){et.setFromMatrixColumn(We,0),et.multiplyScalar(-ht),u.add(et)}})(),H=(()=>{let et=new Et;return function(ht,We){if(n.screenSpacePanning===!0)et.setFromMatrixColumn(We,1);else et.setFromMatrixColumn(We,0),et.crossVectors(n.object.up,et);et.multiplyScalar(ht),u.add(et)}})(),V=(()=>{let et=new Et;return function(ht,We){let Le=n.domElement;if(Le&&n.object instanceof Pc&&n.object.isPerspectiveCamera){let Ze=n.object.position;et.copy(Ze).sub(n.target);let $e=et.length();$e*=Math.tan(n.object.fov/2*Math.PI/180),L(2*ht*$e/Le.clientHeight,n.object.matrix),H(2*We*$e/Le.clientHeight,n.object.matrix)}else if(Le&&n.object instanceof r5&&n.object.isOrthographicCamera)L(ht*(n.object.right-n.object.left)/n.object.zoom/Le.clientWidth,n.object.matrix),H(We*(n.object.top-n.object.bottom)/n.object.zoom/Le.clientHeight,n.object.matrix);else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),n.enablePan=!1}})();function O(et){if(n.object instanceof Pc&&n.object.isPerspectiveCamera||n.object instanceof r5&&n.object.isOrthographicCamera)d=et;else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1}function U(et){O(d/et)}function j(et){O(d*et)}function Y(et){if(!n.zoomToCursor||!n.domElement)return;v=!0;let vt=n.domElement.getBoundingClientRect(),ht=et.clientX-vt.left,We=et.clientY-vt.top,{width:Le,height:Ze}=vt;I.x=ht/Le*2-1,I.y=-(We/Ze)*2+1,b.set(I.x,I.y,1).unproject(n.object).sub(n.object.position).normalize()}function X(et){return Math.max(n.minDistance,Math.min(n.maxDistance,et))}function K(et){_.set(et.clientX,et.clientY)}function J(et){Y(et),y.set(et.clientX,et.clientY)}function ee(et){A.set(et.clientX,et.clientY)}function se(et){p.set(et.clientX,et.clientY),m.subVectors(p,_).multiplyScalar(n.rotateSpeed);let vt=n.domElement;if(vt)N(2*Math.PI*m.x/vt.clientHeight),D(2*Math.PI*m.y/vt.clientHeight);_.copy(p),n.update()}function ne(et){if(x.set(et.clientX,et.clientY),C.subVectors(x,y),C.y>0)U(T());else if(C.y<0)j(T());y.copy(x),n.update()}function re(et){g.set(et.clientX,et.clientY),f.subVectors(g,A).multiplyScalar(n.panSpeed),V(f.x,f.y),A.copy(g),n.update()}function Z(et){if(Y(et),et.deltaY<0)j(T());else if(et.deltaY>0)U(T());n.update()}function te(et){let vt=!1;switch(et.code){case n.keys.UP:V(0,n.keyPanSpeed),vt=!0;break;case n.keys.BOTTOM:V(0,-n.keyPanSpeed),vt=!0;break;case n.keys.LEFT:V(n.keyPanSpeed,0),vt=!0;break;case n.keys.RIGHT:V(-n.keyPanSpeed,0),vt=!0;break}if(vt)et.preventDefault(),n.update()}function ie(){if(P.length==1)_.set(P[0].pageX,P[0].pageY);else{let et=0.5*(P[0].pageX+P[1].pageX),vt=0.5*(P[0].pageY+P[1].pageY);_.set(et,vt)}}function le(){if(P.length==1)A.set(P[0].pageX,P[0].pageY);else{let et=0.5*(P[0].pageX+P[1].pageX),vt=0.5*(P[0].pageY+P[1].pageY);A.set(et,vt)}}function ue(){let et=P[0].pageX-P[1].pageX,vt=P[0].pageY-P[1].pageY,ht=Math.sqrt(et*et+vt*vt);y.set(0,ht)}function de(){if(n.enableZoom)ue();if(n.enablePan)le()}function me(){if(n.enableZoom)ue();if(n.enableRotate)ie()}function Ae(et){if(P.length==1)p.set(et.pageX,et.pageY);else{let ht=Tt(et),We=0.5*(et.pageX+ht.x),Le=0.5*(et.pageY+ht.y);p.set(We,Le)}m.subVectors(p,_).multiplyScalar(n.rotateSpeed);let vt=n.domElement;if(vt)N(2*Math.PI*m.x/vt.clientHeight),D(2*Math.PI*m.y/vt.clientHeight);_.copy(p)}function xe(et){if(P.length==1)g.set(et.pageX,et.pageY);else{let vt=Tt(et),ht=0.5*(et.pageX+vt.x),We=0.5*(et.pageY+vt.y);g.set(ht,We)}f.subVectors(g,A).multiplyScalar(n.panSpeed),V(f.x,f.y),A.copy(g)}function Me(et){let vt=Tt(et),ht=et.pageX-vt.x,We=et.pageY-vt.y,Le=Math.sqrt(ht*ht+We*We);x.set(0,Le),C.set(0,Math.pow(x.y/y.y,n.zoomSpeed)),U(C.y),y.copy(x)}function Re(et){if(n.enableZoom)Me(et);if(n.enablePan)xe(et)}function we(et){if(n.enableZoom)Me(et);if(n.enableRotate)Ae(et)}function _e(et){var vt,ht;if(n.enabled===!1)return;if(P.length===0)(vt=n.domElement)==null||vt.ownerDocument.addEventListener("pointermove",ye),(ht=n.domElement)==null||ht.ownerDocument.addEventListener("pointerup",Se);if(Ct(et),et.pointerType==="touch")rt(et);else Ne(et)}function ye(et){if(n.enabled===!1)return;if(et.pointerType==="touch")mt(et);else ke(et)}function Se(et){var vt,ht,We;if(Nt(et),P.length===0)(vt=n.domElement)==null||vt.releasePointerCapture(et.pointerId),(ht=n.domElement)==null||ht.ownerDocument.removeEventListener("pointermove",ye),(We=n.domElement)==null||We.ownerDocument.removeEventListener("pointerup",Se);n.dispatchEvent(i),a=s.NONE}function Ne(et){let vt;switch(et.button){case 0:vt=n.mouseButtons.LEFT;break;case 1:vt=n.mouseButtons.MIDDLE;break;case 2:vt=n.mouseButtons.RIGHT;break;default:vt=-1}switch(vt){case e2.DOLLY:if(n.enableZoom===!1)return;J(et),a=s.DOLLY;break;case e2.ROTATE:if(et.ctrlKey||et.metaKey||et.shiftKey){if(n.enablePan===!1)return;ee(et),a=s.PAN}else{if(n.enableRotate===!1)return;K(et),a=s.ROTATE}break;case e2.PAN:if(et.ctrlKey||et.metaKey||et.shiftKey){if(n.enableRotate===!1)return;K(et),a=s.ROTATE}else{if(n.enablePan===!1)return;ee(et),a=s.PAN}break;default:a=s.NONE}if(a!==s.NONE)n.dispatchEvent(r)}function ke(et){if(n.enabled===!1)return;switch(a){case s.ROTATE:if(n.enableRotate===!1)return;se(et);break;case s.DOLLY:if(n.enableZoom===!1)return;ne(et);break;case s.PAN:if(n.enablePan===!1)return;re(et);break}}function nt(et){if(n.enabled===!1||n.enableZoom===!1||a!==s.NONE&&a!==s.ROTATE)return;et.preventDefault(),n.dispatchEvent(r),Z(et),n.dispatchEvent(i)}function dt(et){if(n.enabled===!1||n.enablePan===!1)return;te(et)}function rt(et){switch(Ht(et),P.length){case 1:switch(n.touches.ONE){case o5.ROTATE:if(n.enableRotate===!1)return;ie(),a=s.TOUCH_ROTATE;break;case o5.PAN:if(n.enablePan===!1)return;le(),a=s.TOUCH_PAN;break;default:a=s.NONE}break;case 2:switch(n.touches.TWO){case o5.DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;de(),a=s.TOUCH_DOLLY_PAN;break;case o5.DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;me(),a=s.TOUCH_DOLLY_ROTATE;break;default:a=s.NONE}break;default:a=s.NONE}if(a!==s.NONE)n.dispatchEvent(r)}function mt(et){switch(Ht(et),a){case s.TOUCH_ROTATE:if(n.enableRotate===!1)return;Ae(et),n.update();break;case s.TOUCH_PAN:if(n.enablePan===!1)return;xe(et),n.update();break;case s.TOUCH_DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;Re(et),n.update();break;case s.TOUCH_DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;we(et),n.update();break;default:a=s.NONE}}function lt(et){if(n.enabled===!1)return;et.preventDefault()}function Ct(et){P.push(et)}function Nt(et){delete M[et.pointerId];for(let vt=0;vt<P.length;vt++)if(P[vt].pointerId==et.pointerId){P.splice(vt,1);return}}function Ht(et){let vt=M[et.pointerId];if(vt===void 0)vt=new ro,M[et.pointerId]=vt;vt.set(et.pageX,et.pageY)}function Tt(et){let vt=et.pointerId===P[0].pointerId?P[1]:P[0];return M[vt.pointerId]}if(this.dollyIn=(et=T())=>{j(et),n.update()},this.dollyOut=(et=T())=>{U(et),n.update()},this.getScale=()=>d,this.setScale=(et)=>{O(et),n.update()},this.getZoomScale=()=>T(),t!==void 0)this.connect(t);this.update()}}function GG(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let n=0,o=e.length;n<o;n++)t+=String.fromCharCode(e[n]);try{return decodeURIComponent(escape(t))}catch(n){return t}}class tMe extends s1{constructor(e){super(e)}load(e,t,n,o){let r=this,i=new Tb(this.manager);i.setPath(this.path),i.setResponseType("arraybuffer"),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials),i.load(e,function(s){try{t(r.parse(s))}catch(a){if(o)o(a);else console.error(a);r.manager.itemError(e)}},n,o)}parse(e){function t(c){let l=new DataView(c),h=50;if(84+l.getUint32(80,!0)*50===l.byteLength)return!0;let _=[115,111,108,105,100];for(let p=0;p<5;p++)if(n(_,l,p))return!1;return!0}function n(c,l,h){for(let d=0,u=c.length;d<u;d++)if(c[d]!==l.getUint8(h+d,!1))return!1;return!0}function o(c){let l=new DataView(c),h=l.getUint32(80,!0),d,u,_,p=!1,m,A,g,f,y;for(let P=0;P<70;P++)if(l.getUint32(P,!1)==1129270351&&l.getUint8(P+4)==82&&l.getUint8(P+5)==61)p=!0,m=new Float32Array(h*3*3),A=l.getUint8(P+6)/255,g=l.getUint8(P+7)/255,f=l.getUint8(P+8)/255,y=l.getUint8(P+9)/255;let x=84,C=50,b=new js,I=new Float32Array(h*3*3),v=new Float32Array(h*3*3);for(let P=0;P<h;P++){let M=x+P*C,B=l.getFloat32(M,!0),T=l.getFloat32(M+4,!0),N=l.getFloat32(M+8,!0);if(p){let D=l.getUint16(M+48,!0);if((D&32768)===0)d=(D&31)/31,u=(D>>5&31)/31,_=(D>>10&31)/31;else d=A,u=g,_=f}for(let D=1;D<=3;D++){let L=M+D*12,H=P*3*3+(D-1)*3;if(I[H]=l.getFloat32(L,!0),I[H+1]=l.getFloat32(L+4,!0),I[H+2]=l.getFloat32(L+8,!0),v[H]=B,v[H+1]=T,v[H+2]=N,p)m[H]=d,m[H+1]=u,m[H+2]=_}}if(b.setAttribute("position",new Pl(I,3)),b.setAttribute("normal",new Pl(v,3)),p)b.setAttribute("color",new Pl(m,3)),b.hasColors=!0,b.alpha=y;return b}function r(c){let l=new js,h=/solid([\s\S]*?)endsolid/g,d=/facet([\s\S]*?)endfacet/g,u=0,_=/[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source,p=new RegExp("vertex"+_+_+_,"g"),m=new RegExp("normal"+_+_+_,"g"),A=[],g=[],f=new Et,y,x=0,C=0,b=0;while((y=h.exec(c))!==null){C=b;let I=y[0];while((y=d.exec(I))!==null){let M=0,B=0,T=y[0];while((y=m.exec(T))!==null)f.x=parseFloat(y[1]),f.y=parseFloat(y[2]),f.z=parseFloat(y[3]),B++;while((y=p.exec(T))!==null)A.push(parseFloat(y[1]),parseFloat(y[2]),parseFloat(y[3])),g.push(f.x,f.y,f.z),M++,b++;if(B!==1)console.error("THREE.STLLoader: Something isn't right with the normal of face number "+u);if(M!==3)console.error("THREE.STLLoader: Something isn't right with the vertices of face number "+u);u++}let v=C,P=b-C;l.addGroup(v,P,x),x++}return l.setAttribute("position",new Wr(A,3)),l.setAttribute("normal",new Wr(g,3)),l}function i(c){if(typeof c!=="string")return GG(new Uint8Array(c));return c}function s(c){if(typeof c==="string"){let l=new Uint8Array(c.length);for(let h=0;h<c.length;h++)l[h]=c.charCodeAt(h)&255;return l.buffer||l}else return c}let a=s(e);return t(a)?o(a):r(i(e))}}class nMe extends s1{constructor(e){super(e)}load(e,t,n,o){let r=this,i=this.path===""?R9.extractUrlBase(e):this.path,s=new Tb(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,function(a){try{t(r.parse(a,i))}catch(c){if(o)o(c);else console.error(c);r.manager.itemError(e)}},n,o)}setMaterialOptions(e){return this.materialOptions=e,this}parse(e,t){let n=e.split(`
`),o={},r=/\s+/,i={};for(let a=0;a<n.length;a++){let c=n[a];if(c=c.trim(),c.length===0||c.charAt(0)==="#")continue;let l=c.indexOf(" "),h=l>=0?c.substring(0,l):c;h=h.toLowerCase();let d=l>=0?c.substring(l+1):"";if(d=d.trim(),h==="newmtl")o={name:d},i[d]=o;else if(h==="ka"||h==="kd"||h==="ks"||h==="ke"){let u=d.split(r,3);o[h]=[parseFloat(u[0]),parseFloat(u[1]),parseFloat(u[2])]}else o[h]=d}let s=new iXn(this.resourcePath||t,this.materialOptions);return s.setCrossOrigin(this.crossOrigin),s.setManager(this.manager),s.setMaterials(i),s}}class iXn{constructor(e="",t={}){this.baseUrl=e,this.options=t,this.materialsInfo={},this.materials={},this.materialsArray=[],this.nameLookup={},this.crossOrigin="anonymous",this.side=this.options.side!==void 0?this.options.side:O7,this.wrap=this.options.wrap!==void 0?this.options.wrap:h3}setCrossOrigin(e){return this.crossOrigin=e,this}setManager(e){this.manager=e}setMaterials(e){this.materialsInfo=this.convert(e),this.materials={},this.materialsArray=[],this.nameLookup={}}convert(e){if(!this.options)return e;let t={};for(let n in e){let o=e[n],r={};t[n]=r;for(let i in o){let s=!0,a=o[i],c=i.toLowerCase();switch(c){case"kd":case"ka":case"ks":if(this.options&&this.options.normalizeRGB)a=[a[0]/255,a[1]/255,a[2]/255];if(this.options&&this.options.ignoreZeroRGBs){if(a[0]===0&&a[1]===0&&a[2]===0)s=!1}break}if(s)r[c]=a}}return t}preload(){for(let e in this.materialsInfo)this.create(e)}getIndex(e){return this.nameLookup[e]}getAsArray(){let e=0;for(let t in this.materialsInfo)this.materialsArray[e]=this.create(t),this.nameLookup[t]=e,e++;return this.materialsArray}create(e){if(this.materials[e]===void 0)this.createMaterial_(e);return this.materials[e]}createMaterial_(e){let t=this,n=this.materialsInfo[e],o={name:e,side:this.side};function r(s,a){if(typeof a!=="string"||a==="")return"";if(/^https?:\/\//i.test(a))return a;return s+a}function i(s,a){if(o[s])return;let c=t.getTextureParams(a,o),l=t.loadTexture(r(t.baseUrl,c.url));l.repeat.copy(c.scale),l.offset.copy(c.offset),l.wrapS=t.wrap,l.wrapT=t.wrap,o[s]=l}for(let s in n){let a=n[s],c;if(a==="")continue;switch(s.toLowerCase()){case"kd":o.color=new No().fromArray(a);break;case"ks":o.specular=new No().fromArray(a);break;case"ke":o.emissive=new No().fromArray(a);break;case"map_kd":i("map",a);break;case"map_ks":i("specularMap",a);break;case"map_ke":i("emissiveMap",a);break;case"norm":i("normalMap",a);break;case"map_bump":case"bump":i("bumpMap",a);break;case"map_d":i("alphaMap",a),o.transparent=!0;break;case"ns":o.shininess=parseFloat(a);break;case"d":if(c=parseFloat(a),c<1)o.opacity=c,o.transparent=!0;break;case"tr":if(c=parseFloat(a),this.options&&this.options.invertTrProperty)c=1-c;if(c>0)o.opacity=1-c,o.transparent=!0;break}}return this.materials[e]=new Bz(o),this.materials[e]}getTextureParams(e,t){let n={scale:new ro(1,1),offset:new ro(0,0)},o=e.split(/\s+/),r;if(r=o.indexOf("-bm"),r>=0)t.bumpScale=parseFloat(o[r+1]),o.splice(r,2);if(r=o.indexOf("-s"),r>=0)n.scale.set(parseFloat(o[r+1]),parseFloat(o[r+2])),o.splice(r,4);if(r=o.indexOf("-o"),r>=0)n.offset.set(parseFloat(o[r+1]),parseFloat(o[r+2])),o.splice(r,4);return n.url=o.join(" ").trim(),n}loadTexture(e,t,n,o,r){let i=this.manager!==void 0?this.manager:NQe,s=i.getHandler(e);if(s===null)s=new Rz(i);if(s.setCrossOrigin)s.setCrossOrigin(this.crossOrigin);let a=s.load(e,n,o,r);if(t!==void 0)a.mapping=t;return a}}var{CstParser:cut,Lexer:epe,createToken:um}=(()=>{var e=typeof global=="object"&&global&&global.Object===Object&&global;let t=e;var n=typeof self=="object"&&self&&self.Object===Object&&self,o=t||n||Function("return this")();let r=o;var i=r.Symbol;let s=i;var a=Object.prototype,{hasOwnProperty:c,toString:l}=a,h=s?s.toStringTag:void 0;function d(G){var he=c.call(G,h),fe=G[h];try{G[h]=void 0;var Fe=!0}catch(yt){}var tt=l.call(G);if(Fe)if(he)G[h]=fe;else delete G[h];return tt}var u=Object.prototype,_=u.toString;function p(G){return _.call(G)}var m="[object Null]",A="[object Undefined]",g=s?s.toStringTag:void 0;function f(G){if(G==null)return G===void 0?A:m;return g&&g in Object(G)?d(G):p(G)}function y(G){return G!=null&&typeof G=="object"}var x="[object Symbol]";function C(G){return typeof G=="symbol"||y(G)&&f(G)==x}function b(G,he){var fe=-1,Fe=G==null?0:G.length,tt=Array(Fe);while(++fe<Fe)tt[fe]=he(G[fe],fe,G);return tt}var I=Array.isArray;let v=I;var P=1/0,M=s?s.prototype:void 0,B=M?M.toString:void 0;function T(G){if(typeof G=="string")return G;if(v(G))return b(G,T)+"";if(C(G))return B?B.call(G):"";var he=G+"";return he=="0"&&1/G==-P?"-0":he}var N=/\s/;function D(G){var he=G.length;while(he--&&N.test(G.charAt(he)));return he}var L=/^\s+/;function H(G){return G?G.slice(0,D(G)+1).replace(L,""):G}function V(G){var he=typeof G;return G!=null&&(he=="object"||he=="function")}var O=NaN,U=/^[-+]0x[0-9a-f]+$/i,j=/^0b[01]+$/i,Y=/^0o[0-7]+$/i,X=parseInt;function K(G){if(typeof G=="number")return G;if(C(G))return O;if(V(G)){var he=typeof G.valueOf=="function"?G.valueOf():G;G=V(he)?he+"":he}if(typeof G!="string")return G===0?G:+G;G=H(G);var fe=j.test(G);return fe||Y.test(G)?X(G.slice(2),fe?2:8):U.test(G)?O:+G}var J=1/0,ee=179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000;function se(G){if(!G)return G===0?G:0;if(G=K(G),G===J||G===-J){var he=G<0?-1:1;return he*ee}return G===G?G:0}function ne(G){var he=se(G),fe=he%1;return he===he?fe?he-fe:he:0}function re(G){return G}var Z="[object AsyncFunction]",te="[object Function]",ie="[object GeneratorFunction]",le="[object Proxy]";function ue(G){if(!V(G))return!1;var he=f(G);return he==te||he==ie||he==Z||he==le}var de=r["__core-js_shared__"];let me=de;var Ae=function(){var G=/[^.]+$/.exec(me&&me.keys&&me.keys.IE_PROTO||"");return G?"Symbol(src)_1."+G:""}();function xe(G){return!!Ae&&Ae in G}var Me=Function.prototype,Re=Me.toString;function we(G){if(G!=null){try{return Re.call(G)}catch(he){}try{return G+""}catch(he){}}return""}var _e=/[\\^$.*+?()[\]{}|]/g,ye=/^\[object .+?Constructor\]$/,Se=Function.prototype,Ne=Object.prototype,ke=Se.toString,nt=Ne.hasOwnProperty,dt=RegExp("^"+ke.call(nt).replace(_e,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function rt(G){if(!V(G)||xe(G))return!1;var he=ue(G)?dt:ye;return he.test(we(G))}function mt(G,he){return G==null?void 0:G[he]}function lt(G,he){var fe=mt(G,he);return rt(fe)?fe:void 0}var Ct=lt(r,"WeakMap");let Nt=Ct;var Ht=Object.create,Tt=function(){function G(){}return function(he){if(!V(he))return{};if(Ht)return Ht(he);G.prototype=he;var fe=new G;return G.prototype=void 0,fe}}();let et=Tt;function vt(G,he,fe){switch(fe.length){case 0:return G.call(he);case 1:return G.call(he,fe[0]);case 2:return G.call(he,fe[0],fe[1]);case 3:return G.call(he,fe[0],fe[1],fe[2])}return G.apply(he,fe)}function ht(){}function We(G,he){var fe=-1,Fe=G.length;he||(he=Array(Fe));while(++fe<Fe)he[fe]=G[fe];return he}var Le=800,Ze=16,$e=Date.now;function qe(G){var he=0,fe=0;return function(){var Fe=$e(),tt=Ze-(Fe-fe);if(fe=Fe,tt>0){if(++he>=Le)return arguments[0]}else he=0;return G.apply(void 0,arguments)}}function ft(G){return function(){return G}}var It=function(){try{var G=lt(Object,"defineProperty");return G({},"",{}),G}catch(he){}}();let ze=It;var Xe=!ze?re:function(G,he){return ze(G,"toString",{configurable:!0,enumerable:!1,value:ft(he),writable:!0})},St=qe(Xe);let kt=St;function Lt(G,he){var fe=-1,Fe=G==null?0:G.length;while(++fe<Fe)if(he(G[fe],fe,G)===!1)break;return G}function Wt(G,he,fe,Fe){var tt=G.length,yt=fe+(Fe?1:-1);while(Fe?yt--:++yt<tt)if(he(G[yt],yt,G))return yt;return-1}function bn(G){return G!==G}function pn(G,he,fe){var Fe=fe-1,tt=G.length;while(++Fe<tt)if(G[Fe]===he)return Fe;return-1}function wn(G,he,fe){return he===he?pn(G,he,fe):Wt(G,bn,fe)}function Fn(G,he){var fe=G==null?0:G.length;return!!fe&&wn(G,he,0)>-1}var mn=9007199254740991,_n=/^(?:0|[1-9]\d*)$/;function no(G,he){var fe=typeof G;return he=he==null?mn:he,!!he&&(fe=="number"||fe!="symbol"&&_n.test(G))&&G>-1&&G%1==0&&G<he}function To(G,he,fe){if(he=="__proto__"&&ze)ze(G,he,{configurable:!0,enumerable:!0,value:fe,writable:!0});else G[he]=fe}function ir(G,he){return G===he||G!==G&&he!==he}var xt=Object.prototype,gt=xt.hasOwnProperty;function Ot(G,he,fe){var Fe=G[he];if(!(gt.call(G,he)&&ir(Fe,fe))||fe===void 0&&!(he in G))To(G,he,fe)}function Zt(G,he,fe,Fe){var tt=!fe;fe||(fe={});var yt=-1,Bt=he.length;while(++yt<Bt){var Rt=he[yt],Xt=Fe?Fe(fe[Rt],G[Rt],Rt,fe,G):void 0;if(Xt===void 0)Xt=G[Rt];if(tt)To(fe,Rt,Xt);else Ot(fe,Rt,Xt)}return fe}var je=Math.max;function Mt(G,he,fe){return he=je(he===void 0?G.length-1:he,0),function(){var Fe=arguments,tt=-1,yt=je(Fe.length-he,0),Bt=Array(yt);while(++tt<yt)Bt[tt]=Fe[he+tt];tt=-1;var Rt=Array(he+1);while(++tt<he)Rt[tt]=Fe[tt];return Rt[he]=fe(Bt),vt(G,this,Rt)}}function Kt(G,he){return kt(Mt(G,he,re),G+"")}var nn=9007199254740991;function Zn(G){return typeof G=="number"&&G>-1&&G%1==0&&G<=nn}function Vn(G){return G!=null&&Zn(G.length)&&!ue(G)}function Rn(G,he,fe){if(!V(fe))return!1;var Fe=typeof he;if(Fe=="number"?Vn(fe)&&no(he,fe.length):Fe=="string"&&(he in fe))return ir(fe[he],G);return!1}function Bn(G){return Kt(function(he,fe){var Fe=-1,tt=fe.length,yt=tt>1?fe[tt-1]:void 0,Bt=tt>2?fe[2]:void 0;if(yt=G.length>3&&typeof yt=="function"?(tt--,yt):void 0,Bt&&Rn(fe[0],fe[1],Bt))yt=tt<3?void 0:yt,tt=1;he=Object(he);while(++Fe<tt){var Rt=fe[Fe];if(Rt)G(he,Rt,Fe,yt)}return he})}var ho=Object.prototype;function Qo(G){var he=G&&G.constructor,fe=typeof he=="function"&&he.prototype||ho;return G===fe}function Nn(G,he){var fe=-1,Fe=Array(G);while(++fe<G)Fe[fe]=he(fe);return Fe}var mo="[object Arguments]";function Io(G){return y(G)&&f(G)==mo}var io=Object.prototype,{hasOwnProperty:Wo,propertyIsEnumerable:rr}=io,xr=Io(function(){return arguments}())?Io:function(G){return y(G)&&Wo.call(G,"callee")&&!rr.call(G,"callee")};let Ci=xr;function ea(){return!1}var ya=typeof cE=="object"&&cE&&!cE.nodeType&&cE,Oo=ya&&typeof V6=="object"&&V6&&!V6.nodeType&&V6,$i=Oo&&Oo.exports===ya,Ei=$i?r.Buffer:void 0,hs=Ei?Ei.isBuffer:void 0,il=hs||ea;let kl=il;var Xc="[object Arguments]",Od="[object Array]",cp="[object Boolean]",or="[object Date]",Gr="[object Error]",ti="[object Function]",$l="[object Map]",Ll="[object Number]",Vd="[object Object]",$1="[object RegExp]",fm="[object Set]",xa="[object String]",k0="[object WeakMap]",ym="[object ArrayBuffer]",_u="[object DataView]",o0="[object Float32Array]",Zi="[object Float64Array]",Hl="[object Int8Array]",da="[object Int16Array]",zc="[object Int32Array]",ua="[object Uint8Array]",ri="[object Uint8ClampedArray]",ic="[object Uint16Array]",wh="[object Uint32Array]",Qs={};Qs[o0]=Qs[Zi]=Qs[Hl]=Qs[da]=Qs[zc]=Qs[ua]=Qs[ri]=Qs[ic]=Qs[wh]=!0,Qs[Xc]=Qs[Od]=Qs[ym]=Qs[cp]=Qs[_u]=Qs[or]=Qs[Gr]=Qs[ti]=Qs[$l]=Qs[Ll]=Qs[Vd]=Qs[$1]=Qs[fm]=Qs[xa]=Qs[k0]=!1;function Yd(G){return y(G)&&Zn(G.length)&&!!Qs[f(G)]}function Bh(G){return function(he){return G(he)}}var Gd=typeof cE=="object"&&cE&&!cE.nodeType&&cE,gA=Gd&&typeof V6=="object"&&V6&&!V6.nodeType&&V6,r0=gA&&gA.exports===Gd,q1=r0&&t.process,Tf=function(){try{var G=gA&&gA.require&&gA.require("util").types;if(G)return G;return q1&&q1.binding&&q1.binding("util")}catch(he){}}();let lp=Tf;var fg=lp&&lp.isTypedArray,gu=fg?Bh(fg):Yd;let a_=gu;var Kh=Object.prototype,Nx=Kh.hasOwnProperty;function c_(G,he){var fe=v(G),Fe=!fe&&Ci(G),tt=!fe&&!Fe&&kl(G),yt=!fe&&!Fe&&!tt&&a_(G),Bt=fe||Fe||tt||yt,Rt=Bt?Nn(G.length,String):[],Xt=Rt.length;for(var Hn in G)if((he||Nx.call(G,Hn))&&!(Bt&&(Hn=="length"||tt&&(Hn=="offset"||Hn=="parent")||yt&&(Hn=="buffer"||Hn=="byteLength"||Hn=="byteOffset")||no(Hn,Xt))))Rt.push(Hn);return Rt}function N2(G,he){return function(fe){return G(he(fe))}}var J1=N2(Object.keys,Object);let hI=J1;var L0=Object.prototype,dI=L0.hasOwnProperty;function Z1(G){if(!Qo(G))return hI(G);var he=[];for(var fe in Object(G))if(dI.call(G,fe)&&fe!="constructor")he.push(fe);return he}function Ud(G){return Vn(G)?c_(G):Z1(G)}var Us=Object.prototype,Bo=Us.hasOwnProperty,_d=Bn(function(G,he){if(Qo(he)||Vn(he)){Zt(he,Ud(he),G);return}for(var fe in he)if(Bo.call(he,fe))Ot(G,fe,he[fe])});let sl=_d;function Sa(G){var he=[];if(G!=null)for(var fe in Object(G))he.push(fe);return he}var AA=Object.prototype,MC=AA.hasOwnProperty;function dD(G){if(!V(G))return Sa(G);var he=Qo(G),fe=[];for(var Fe in G)if(!(Fe=="constructor"&&(he||!MC.call(G,Fe))))fe.push(Fe);return fe}function wC(G){return Vn(G)?c_(G,!0):dD(G)}var YH=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,b4=/^\w*$/;function I4(G,he){if(v(G))return!1;var fe=typeof G;if(fe=="number"||fe=="symbol"||fe=="boolean"||G==null||C(G))return!0;return b4.test(G)||!YH.test(G)||he!=null&&G in Object(he)}var A8=lt(Object,"create");let i0=A8;function jc(){this.__data__=i0?i0(null):{},this.size=0}function f8(G){var he=this.has(G)&&delete this.__data__[G];return this.size-=he?1:0,he}var yg="__lodash_hash_undefined__",ey=Object.prototype,xm=ey.hasOwnProperty;function hp(G){var he=this.__data__;if(i0){var fe=he[G];return fe===yg?void 0:fe}return xm.call(he,G)?he[G]:void 0}var Cm=Object.prototype,bm=Cm.hasOwnProperty;function y8(G){var he=this.__data__;return i0?he[G]!==void 0:bm.call(he,G)}var l_="__lodash_hash_undefined__";function KE(G,he){var fe=this.__data__;return this.size+=this.has(G)?0:1,fe[G]=i0&&he===void 0?l_:he,this}function H0(G){var he=-1,fe=G==null?0:G.length;this.clear();while(++he<fe){var Fe=G[he];this.set(Fe[0],Fe[1])}}H0.prototype.clear=jc,H0.prototype.delete=f8,H0.prototype.get=hp,H0.prototype.has=y8,H0.prototype.set=KE;function Df(){this.__data__=[],this.size=0}function Fp(G,he){var fe=G.length;while(fe--)if(ir(G[fe][0],he))return fe;return-1}var uI=Array.prototype,lh=uI.splice;function Nf(G){var he=this.__data__,fe=Fp(he,G);if(fe<0)return!1;var Fe=he.length-1;if(fe==Fe)he.pop();else lh.call(he,fe,1);return--this.size,!0}function BC(G){var he=this.__data__,fe=Fp(he,G);return fe<0?void 0:he[fe][1]}function ty(G){return Fp(this.__data__,G)>-1}function ny(G,he){var fe=this.__data__,Fe=Fp(fe,G);if(Fe<0)++this.size,fe.push([G,he]);else fe[Fe][1]=he;return this}function s0(G){var he=-1,fe=G==null?0:G.length;this.clear();while(++he<fe){var Fe=G[he];this.set(Fe[0],Fe[1])}}s0.prototype.clear=Df,s0.prototype.delete=Nf,s0.prototype.get=BC,s0.prototype.has=ty,s0.prototype.set=ny;var $E=lt(r,"Map");let v4=$E;function qE(){this.size=0,this.__data__={hash:new H0,map:new(v4||s0),string:new H0}}function S4(G){var he=typeof G;return he=="string"||he=="number"||he=="symbol"||he=="boolean"?G!=="__proto__":G===null}function Je(G,he){var fe=G.__data__;return S4(he)?fe[typeof he=="string"?"string":"hash"]:fe.map}function ct(G){var he=Je(this,G).delete(G);return this.size-=he?1:0,he}function Dt(G){return Je(this,G).get(G)}function tn(G){return Je(this,G).has(G)}function xn(G,he){var fe=Je(this,G),Fe=fe.size;return fe.set(G,he),this.size+=fe.size==Fe?0:1,this}function Mn(G){var he=-1,fe=G==null?0:G.length;this.clear();while(++he<fe){var Fe=G[he];this.set(Fe[0],Fe[1])}}Mn.prototype.clear=qE,Mn.prototype.delete=ct,Mn.prototype.get=Dt,Mn.prototype.has=tn,Mn.prototype.set=xn;var Ln="Expected a function";function uo(G,he){if(typeof G!="function"||he!=null&&typeof he!="function")throw TypeError(Ln);var fe=function(){var Fe=arguments,tt=he?he.apply(this,Fe):Fe[0],yt=fe.cache;if(yt.has(tt))return yt.get(tt);var Bt=G.apply(this,Fe);return fe.cache=yt.set(tt,Bt)||yt,Bt};return fe.cache=new(uo.Cache||Mn),fe}uo.Cache=Mn;var ko=500;function tr(G){var he=uo(G,function(Fe){if(fe.size===ko)fe.clear();return Fe}),fe=he.cache;return he}var Dr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ta=/\\(\\)?/g,Pa=tr(function(G){var he=[];if(G.charCodeAt(0)===46)he.push("");return G.replace(Dr,function(fe,Fe,tt,yt){he.push(tt?yt.replace(ta,"$1"):Fe||fe)}),he});let Ws=Pa;function na(G){return G==null?"":T(G)}function vc(G,he){if(v(G))return G;return I4(G,he)?[G]:Ws(na(G))}var zp=1/0;function jt(G){if(typeof G=="string"||C(G))return G;var he=G+"";return he=="0"&&1/G==-zp?"-0":he}function vn(G,he){he=vc(he,G);var fe=0,Fe=he.length;while(G!=null&&fe<Fe)G=G[jt(he[fe++])];return fe&&fe==Fe?G:void 0}function oo(G,he,fe){var Fe=G==null?void 0:vn(G,he);return Fe===void 0?fe:Fe}function vo(G,he){var fe=-1,Fe=he.length,tt=G.length;while(++fe<Fe)G[tt+fe]=he[fe];return G}var pi=s?s.isConcatSpreadable:void 0;function oa(G){return v(G)||Ci(G)||!!(pi&&G&&G[pi])}function ds(G,he,fe,Fe,tt){var yt=-1,Bt=G.length;fe||(fe=oa),tt||(tt=[]);while(++yt<Bt){var Rt=G[yt];if(he>0&&fe(Rt))if(he>1)ds(Rt,he-1,fe,Fe,tt);else vo(tt,Rt);else if(!Fe)tt[tt.length]=Rt}return tt}function Ea(G){var he=G==null?0:G.length;return he?ds(G,1):[]}var Th=N2(Object.getPrototypeOf,Object);let xg=Th;function Cg(G,he,fe){var Fe=-1,tt=G.length;if(he<0)he=-he>tt?0:tt+he;if(fe=fe>tt?tt:fe,fe<0)fe+=tt;tt=he>fe?0:fe-he>>>0,he>>>=0;var yt=Array(tt);while(++Fe<tt)yt[Fe]=G[Fe+he];return yt}function Fl(G,he,fe,Fe){var tt=-1,yt=G==null?0:G.length;if(Fe&&yt)fe=G[++tt];while(++tt<yt)fe=he(fe,G[tt],tt,G);return fe}function JE(){this.__data__=new s0,this.size=0}function P4(G){var he=this.__data__,fe=he.delete(G);return this.size=he.size,fe}function E4(G){return this.__data__.get(G)}function GH(G){return this.__data__.has(G)}var ZE=200;function fA(G,he){var fe=this.__data__;if(fe instanceof s0){var Fe=fe.__data__;if(!v4||Fe.length<ZE-1)return Fe.push([G,he]),this.size=++fe.size,this;fe=this.__data__=new Mn(Fe)}return fe.set(G,he),this.size=fe.size,this}function Rf(G){var he=this.__data__=new s0(G);this.size=he.size}Rf.prototype.clear=JE,Rf.prototype.delete=P4,Rf.prototype.get=E4,Rf.prototype.has=GH,Rf.prototype.set=fA;function x8(G,he){return G&&Zt(he,Ud(he),G)}function C8(G,he){return G&&Zt(he,wC(he),G)}var TC=typeof cE=="object"&&cE&&!cE.nodeType&&cE,eM=TC&&typeof V6=="object"&&V6&&!V6.nodeType&&V6,M4=eM&&eM.exports===TC,b8=M4?r.Buffer:void 0,DC=b8?b8.allocUnsafe:void 0;function w4(G,he){if(he)return G.slice();var fe=G.length,Fe=DC?DC(fe):new G.constructor(fe);return G.copy(Fe),Fe}function R2(G,he){var fe=-1,Fe=G==null?0:G.length,tt=0,yt=[];while(++fe<Fe){var Bt=G[fe];if(he(Bt,fe,G))yt[tt++]=Bt}return yt}function a0(){return[]}var I8=Object.prototype,Rx=I8.propertyIsEnumerable,B4=Object.getOwnPropertySymbols,Qx=!B4?a0:function(G){if(G==null)return[];return G=Object(G),R2(B4(G),function(he){return Rx.call(G,he)})};let fl=Qx;function pI(G,he){return Zt(G,fl(G),he)}var UH=Object.getOwnPropertySymbols,kx=!UH?a0:function(G){var he=[];while(G)vo(he,fl(G)),G=xg(G);return he};let T4=kx;function Q2(G,he){return Zt(G,T4(G),he)}function oy(G,he,fe){var Fe=he(G);return v(G)?Fe:vo(Fe,fe(G))}function v8(G){return oy(G,Ud,fl)}function Qf(G){return oy(G,wC,T4)}var WH=lt(r,"DataView");let k2=WH;var tM=lt(r,"Promise");let kf=tM;var mI=lt(r,"Set");let dp=mI;var h_="[object Map]",L2="[object Object]",Lf="[object Promise]",ry="[object Set]",hh="[object WeakMap]",nM="[object DataView]",uD=we(k2),XH=we(v4),iy=we(kf),jH=we(dp),Hf=we(Nt),Ff=f;if(k2&&Ff(new k2(new ArrayBuffer(1)))!=nM||v4&&Ff(new v4)!=h_||kf&&Ff(kf.resolve())!=Lf||dp&&Ff(new dp)!=ry||Nt&&Ff(new Nt)!=hh)Ff=function(G){var he=f(G),fe=he==L2?G.constructor:void 0,Fe=fe?we(fe):"";if(Fe)switch(Fe){case uD:return nM;case XH:return h_;case iy:return Lf;case jH:return ry;case Hf:return hh}return he};let _I=Ff;var KH=Object.prototype,ZU=KH.hasOwnProperty;function oM(G){var he=G.length,fe=new G.constructor(he);if(he&&typeof G[0]=="string"&&ZU.call(G,"index"))fe.index=G.index,fe.input=G.input;return fe}var S8=r.Uint8Array;let gI=S8;function rM(G){var he=new G.constructor(G.byteLength);return new gI(he).set(new gI(G)),he}function pD(G,he){var fe=he?rM(G.buffer):G.buffer;return new G.constructor(fe,G.byteOffset,G.byteLength)}var iM=/\w*$/;function Lx(G){var he=new G.constructor(G.source,iM.exec(G));return he.lastIndex=G.lastIndex,he}var mD=s?s.prototype:void 0,_D=mD?mD.valueOf:void 0;function gD(G){return _D?Object(_D.call(G)):{}}function d_(G,he){var fe=he?rM(G.buffer):G.buffer;return new G.constructor(fe,G.byteOffset,G.length)}var sy="[object Boolean]",P8="[object Date]",AD="[object Map]",Hx="[object Number]",yA="[object RegExp]",sM="[object Set]",fD="[object String]",aM="[object Symbol]",$H="[object ArrayBuffer]",E8="[object DataView]",yD="[object Float32Array]",qH="[object Float64Array]",M8="[object Int8Array]",AI="[object Int16Array]",al="[object Int32Array]",NC="[object Uint8Array]",cM="[object Uint8ClampedArray]",lM="[object Uint16Array]",xA="[object Uint32Array]";function w8(G,he,fe){var Fe=G.constructor;switch(he){case $H:return rM(G);case sy:case P8:return new Fe(+G);case E8:return pD(G,fe);case yD:case qH:case M8:case AI:case al:case NC:case cM:case lM:case xA:return d_(G,fe);case AD:return new Fe;case Hx:case fD:return new Fe(G);case yA:return Lx(G);case sM:return new Fe;case aM:return gD(G)}}function xD(G){return typeof G.constructor=="function"&&!Qo(G)?et(xg(G)):{}}var hM="[object Map]";function fI(G){return y(G)&&_I(G)==hM}var CD=lp&&lp.isMap,dM=CD?Bh(CD):fI;let bD=dM;var RC="[object Set]";function JH(G){return y(G)&&_I(G)==RC}var ID=lp&&lp.isSet,QC=ID?Bh(ID):JH;let Im=QC;var CA=1,vD=2,SD=4,ra="[object Arguments]",Do="[object Array]",yI="[object Boolean]",B8="[object Date]",gd="[object Error]",xI="[object Function]",ZH="[object GeneratorFunction]",eF="[object Map]",PD="[object Number]",eW="[object Object]",ED="[object RegExp]",MD="[object Set]",zf="[object String]",vm="[object Symbol]",cl="[object WeakMap]",wD="[object ArrayBuffer]",CI="[object DataView]",Au="[object Float32Array]",kC="[object Float64Array]",Ad="[object Int8Array]",BD="[object Int16Array]",bA="[object Int32Array]",TD="[object Uint8Array]",ay="[object Uint8ClampedArray]",DD="[object Uint16Array]",H2="[object Uint32Array]",zl={};zl[ra]=zl[Do]=zl[wD]=zl[CI]=zl[yI]=zl[B8]=zl[Au]=zl[kC]=zl[Ad]=zl[BD]=zl[bA]=zl[eF]=zl[PD]=zl[eW]=zl[ED]=zl[MD]=zl[zf]=zl[vm]=zl[TD]=zl[ay]=zl[DD]=zl[H2]=!0,zl[gd]=zl[xI]=zl[cl]=!1;function bI(G,he,fe,Fe,tt,yt){var Bt,Rt=he&CA,Xt=he&vD,Hn=he&SD;if(fe)Bt=tt?fe(G,Fe,tt,yt):fe(G);if(Bt!==void 0)return Bt;if(!V(G))return G;var so=v(G);if(so){if(Bt=oM(G),!Rt)return We(G,Bt)}else{var So=_I(G),nr=So==xI||So==ZH;if(kl(G))return w4(G,Rt);if(So==eW||So==ra||nr&&!tt){if(Bt=Xt||nr?{}:xD(G),!Rt)return Xt?Q2(G,C8(Bt,G)):pI(G,x8(Bt,G))}else{if(!zl[So])return tt?G:{};Bt=w8(G,So,Rt)}}yt||(yt=new Rf);var Rr=yt.get(G);if(Rr)return Rr;if(yt.set(G,Bt),Im(G))G.forEach(function(zr){Bt.add(bI(zr,he,fe,zr,G,yt))});else if(bD(G))G.forEach(function(zr,Pr){Bt.set(Pr,bI(zr,he,fe,Pr,G,yt))});var Yi=Hn?Xt?Qf:v8:Xt?wC:Ud,li=so?void 0:Yi(G);return Lt(li||G,function(zr,Pr){if(li)Pr=zr,zr=G[Pr];Ot(Bt,Pr,bI(zr,he,fe,Pr,G,yt))}),Bt}var cy=4;function up(G){return bI(G,cy)}function ly(G){var he=-1,fe=G==null?0:G.length,Fe=0,tt=[];while(++he<fe){var yt=G[he];if(yt)tt[Fe++]=yt}return tt}var ND="__lodash_hash_undefined__";function II(G){return this.__data__.set(G,ND),this}function D4(G){return this.__data__.has(G)}function LC(G){var he=-1,fe=G==null?0:G.length;this.__data__=new Mn;while(++he<fe)this.add(G[he])}LC.prototype.add=LC.prototype.push=II,LC.prototype.has=D4;function RD(G,he){var fe=-1,Fe=G==null?0:G.length;while(++fe<Fe)if(he(G[fe],fe,G))return!0;return!1}function HC(G,he){return G.has(he)}var tW=1,uM=2;function QD(G,he,fe,Fe,tt,yt){var Bt=fe&tW,Rt=G.length,Xt=he.length;if(Rt!=Xt&&!(Bt&&Xt>Rt))return!1;var Hn=yt.get(G),so=yt.get(he);if(Hn&&so)return Hn==he&&so==G;var So=-1,nr=!0,Rr=fe&uM?new LC:void 0;yt.set(G,he),yt.set(he,G);while(++So<Rt){var Yi=G[So],li=he[So];if(Fe)var zr=Bt?Fe(li,Yi,So,he,G,yt):Fe(Yi,li,So,G,he,yt);if(zr!==void 0){if(zr)continue;nr=!1;break}if(Rr){if(!RD(he,function(Pr,Eo){if(!HC(Rr,Eo)&&(Yi===Pr||tt(Yi,Pr,fe,Fe,yt)))return Rr.push(Eo)})){nr=!1;break}}else if(!(Yi===li||tt(Yi,li,fe,Fe,yt))){nr=!1;break}}return yt.delete(G),yt.delete(he),nr}function tF(G){var he=-1,fe=Array(G.size);return G.forEach(function(Fe,tt){fe[++he]=[tt,Fe]}),fe}function vI(G){var he=-1,fe=Array(G.size);return G.forEach(function(Fe){fe[++he]=Fe}),fe}var kD=1,LD=2,SI="[object Boolean]",PI="[object Date]",nW="[object Error]",oW="[object Map]",u_="[object Number]",EI="[object RegExp]",Wd="[object Set]",FC="[object String]",bg="[object Symbol]",HD="[object ArrayBuffer]",zC="[object DataView]",MI=s?s.prototype:void 0,OC=MI?MI.valueOf:void 0;function VC(G,he,fe,Fe,tt,yt,Bt){switch(fe){case zC:if(G.byteLength!=he.byteLength||G.byteOffset!=he.byteOffset)return!1;G=G.buffer,he=he.buffer;case HD:if(G.byteLength!=he.byteLength||!yt(new gI(G),new gI(he)))return!1;return!0;case SI:case PI:case u_:return ir(+G,+he);case nW:return G.name==he.name&&G.message==he.message;case EI:case FC:return G==he+"";case oW:var Rt=tF;case Wd:var Xt=Fe&kD;if(Rt||(Rt=vI),G.size!=he.size&&!Xt)return!1;var Hn=Bt.get(G);if(Hn)return Hn==he;Fe|=LD,Bt.set(G,he);var so=QD(Rt(G),Rt(he),Fe,tt,yt,Bt);return Bt.delete(G),so;case bg:if(OC)return OC.call(G)==OC.call(he)}return!1}var nF=1,FD=Object.prototype,pM=FD.hasOwnProperty;function zD(G,he,fe,Fe,tt,yt){var Bt=fe&nF,Rt=v8(G),Xt=Rt.length,Hn=v8(he),so=Hn.length;if(Xt!=so&&!Bt)return!1;var So=Xt;while(So--){var nr=Rt[So];if(!(Bt?nr in he:pM.call(he,nr)))return!1}var Rr=yt.get(G),Yi=yt.get(he);if(Rr&&Yi)return Rr==he&&Yi==G;var li=!0;yt.set(G,he),yt.set(he,G);var zr=Bt;while(++So<Xt){nr=Rt[So];var Pr=G[nr],Eo=he[nr];if(Fe)var Fo=Bt?Fe(Eo,Pr,nr,he,G,yt):Fe(Pr,Eo,nr,G,he,yt);if(!(Fo===void 0?Pr===Eo||tt(Pr,Eo,fe,Fe,yt):Fo)){li=!1;break}zr||(zr=nr=="constructor")}if(li&&!zr){var ks=G.constructor,ph=he.constructor;if(ks!=ph&&"constructor"in G&&"constructor"in he&&!(typeof ks=="function"&&ks instanceof ks&&typeof ph=="function"&&ph instanceof ph))li=!1}return yt.delete(G),yt.delete(he),li}var T8=1,D8="[object Arguments]",N8="[object Array]",R8="[object Object]",rW=Object.prototype,OD=rW.hasOwnProperty;function VD(G,he,fe,Fe,tt,yt){var Bt=v(G),Rt=v(he),Xt=Bt?N8:_I(G),Hn=Rt?N8:_I(he);Xt=Xt==D8?R8:Xt,Hn=Hn==D8?R8:Hn;var so=Xt==R8,So=Hn==R8,nr=Xt==Hn;if(nr&&kl(G)){if(!kl(he))return!1;Bt=!0,so=!1}if(nr&&!so)return yt||(yt=new Rf),Bt||a_(G)?QD(G,he,fe,Fe,tt,yt):VC(G,he,Xt,fe,Fe,tt,yt);if(!(fe&T8)){var Rr=so&&OD.call(G,"__wrapped__"),Yi=So&&OD.call(he,"__wrapped__");if(Rr||Yi){var li=Rr?G.value():G,zr=Yi?he.value():he;return yt||(yt=new Rf),tt(li,zr,fe,Fe,yt)}}if(!nr)return!1;return yt||(yt=new Rf),zD(G,he,fe,Fe,tt,yt)}function YD(G,he,fe,Fe,tt){if(G===he)return!0;if(G==null||he==null||!y(G)&&!y(he))return G!==G&&he!==he;return VD(G,he,fe,Fe,YD,tt)}var N4=1,mM=2;function GD(G,he,fe,Fe){var tt=fe.length,yt=tt,Bt=!Fe;if(G==null)return!yt;G=Object(G);while(tt--){var Rt=fe[tt];if(Bt&&Rt[2]?Rt[1]!==G[Rt[0]]:!(Rt[0]in G))return!1}while(++tt<yt){Rt=fe[tt];var Xt=Rt[0],Hn=G[Xt],so=Rt[1];if(Bt&&Rt[2]){if(Hn===void 0&&!(Xt in G))return!1}else{var So=new Rf;if(Fe)var nr=Fe(Hn,so,Xt,G,he,So);if(!(nr===void 0?YD(so,Hn,N4|mM,Fe,So):nr))return!1}}return!0}function _M(G){return G===G&&!V(G)}function oF(G){var he=Ud(G),fe=he.length;while(fe--){var Fe=he[fe],tt=G[Fe];he[fe]=[Fe,tt,_M(tt)]}return he}function gM(G,he){return function(fe){if(fe==null)return!1;return fe[G]===he&&(he!==void 0||(G in Object(fe)))}}function rF(G){var he=oF(G);if(he.length==1&&he[0][2])return gM(he[0][0],he[0][1]);return function(fe){return fe===G||GD(fe,G,he)}}function iW(G,he){return G!=null&&he in Object(G)}function R4(G,he,fe){he=vc(he,G);var Fe=-1,tt=he.length,yt=!1;while(++Fe<tt){var Bt=jt(he[Fe]);if(!(yt=G!=null&&fe(G,Bt)))break;G=G[Bt]}if(yt||++Fe!=tt)return yt;return tt=G==null?0:G.length,!!tt&&Zn(tt)&&no(Bt,tt)&&(v(G)||Ci(G))}function YC(G,he){return G!=null&&R4(G,he,iW)}var UD=1,sW=2;function yl(G,he){if(I4(G)&&_M(he))return gM(jt(G),he);return function(fe){var Fe=oo(fe,G);return Fe===void 0&&Fe===he?YC(fe,G):YD(he,Fe,UD|sW)}}function WD(G){return function(he){return he==null?void 0:he[G]}}function AM(G){return function(he){return vn(he,G)}}function XD(G){return I4(G)?WD(jt(G)):AM(G)}function Of(G){if(typeof G=="function")return G;if(G==null)return re;if(typeof G=="object")return v(G)?yl(G[0],G[1]):rF(G);return XD(G)}function aW(G,he,fe,Fe){var tt=-1,yt=G==null?0:G.length;while(++tt<yt){var Bt=G[tt];he(Fe,Bt,fe(Bt),G)}return Fe}function jD(G){return function(he,fe,Fe){var tt=-1,yt=Object(he),Bt=Fe(he),Rt=Bt.length;while(Rt--){var Xt=Bt[G?Rt:++tt];if(fe(yt[Xt],Xt,yt)===!1)break}return he}}var KD=jD();let $D=KD;function iF(G,he){return G&&$D(G,he,Ud)}function Q8(G,he){return function(fe,Fe){if(fe==null)return fe;if(!Vn(fe))return G(fe,Fe);var tt=fe.length,yt=he?tt:-1,Bt=Object(fe);while(he?yt--:++yt<tt)if(Fe(Bt[yt],yt,Bt)===!1)break;return fe}}var wI=Q8(iF);let GC=wI;function UC(G,he,fe,Fe){return GC(G,function(tt,yt,Bt){he(Fe,tt,fe(tt),Bt)}),Fe}function qD(G,he){return function(fe,Fe){var tt=v(fe)?aW:UC,yt=he?he():{};return tt(fe,G,Of(Fe),yt)}}var k8=Object.prototype,sF=k8.hasOwnProperty,fM=Kt(function(G,he){G=Object(G);var fe=-1,Fe=he.length,tt=Fe>2?he[2]:void 0;if(tt&&Rn(he[0],he[1],tt))Fe=1;while(++fe<Fe){var yt=he[fe],Bt=wC(yt),Rt=-1,Xt=Bt.length;while(++Rt<Xt){var Hn=Bt[Rt],so=G[Hn];if(so===void 0||ir(so,k8[Hn])&&!sF.call(G,Hn))G[Hn]=yt[Hn]}}return G});let yM=fM;function L8(G){return y(G)&&Vn(G)}function Fx(G,he,fe){var Fe=-1,tt=G==null?0:G.length;while(++Fe<tt)if(fe(he,G[Fe]))return!0;return!1}var F0=200;function JD(G,he,fe,Fe){var tt=-1,yt=Fn,Bt=!0,Rt=G.length,Xt=[],Hn=he.length;if(!Rt)return Xt;if(fe)he=b(he,Bh(fe));if(Fe)yt=Fx,Bt=!1;else if(he.length>=F0)yt=HC,Bt=!1,he=new LC(he);e:while(++tt<Rt){var so=G[tt],So=fe==null?so:fe(so);if(so=Fe||so!==0?so:0,Bt&&So===So){var nr=Hn;while(nr--)if(he[nr]===So)continue e;Xt.push(so)}else if(!yt(he,So,Fe))Xt.push(so)}return Xt}var xM=Kt(function(G,he){return L8(G)?JD(G,ds(he,1,L8,!0)):[]});let hy=xM;function Q4(G){var he=G==null?0:G.length;return he?G[he-1]:void 0}function Xd(G,he,fe){var Fe=G==null?0:G.length;if(!Fe)return[];return he=fe||he===void 0?1:ne(he),Cg(G,he<0?0:he,Fe)}function H8(G,he,fe){var Fe=G==null?0:G.length;if(!Fe)return[];return he=fe||he===void 0?1:ne(he),he=Fe-he,Cg(G,0,he<0?0:he)}function CM(G){return typeof G=="function"?G:re}function Vi(G,he){var fe=v(G)?Lt:GC;return fe(G,CM(he))}function cW(G,he){var fe=-1,Fe=G==null?0:G.length;while(++fe<Fe)if(!he(G[fe],fe,G))return!1;return!0}function BI(G,he){var fe=!0;return GC(G,function(Fe,tt,yt){return fe=!!he(Fe,tt,yt),fe}),fe}function IA(G,he,fe){var Fe=v(G)?cW:BI;if(fe&&Rn(G,he,fe))he=void 0;return Fe(G,Of(he))}function ZD(G,he){var fe=[];return GC(G,function(Fe,tt,yt){if(he(Fe,tt,yt))fe.push(Fe)}),fe}function Ig(G,he){var fe=v(G)?R2:ZD;return fe(G,Of(he))}function lW(G){return function(he,fe,Fe){var tt=Object(he);if(!Vn(he)){var yt=Of(fe);he=Ud(he),fe=function(Rt){return yt(tt[Rt],Rt,tt)}}var Bt=G(he,fe,Fe);return Bt>-1?tt[yt?he[Bt]:Bt]:void 0}}var aF=Math.max;function Ma(G,he,fe){var Fe=G==null?0:G.length;if(!Fe)return-1;var tt=fe==null?0:ne(fe);if(tt<0)tt=aF(Fe+tt,0);return Wt(G,Of(he),tt)}var pp=lW(Ma);let TI=pp;function mp(G){return G&&G.length?G[0]:void 0}function zx(G,he){var fe=-1,Fe=Vn(G)?Array(G.length):[];return GC(G,function(tt,yt,Bt){Fe[++fe]=he(tt,yt,Bt)}),Fe}function Ur(G,he){var fe=v(G)?b:zx;return fe(G,Of(he))}function vg(G,he){return ds(Ur(G,he),1)}var eN=Object.prototype,hW=eN.hasOwnProperty,F8=qD(function(G,he,fe){if(hW.call(G,fe))G[fe].push(he);else To(G,fe,[he])});let dy=F8;var DI=Object.prototype,tN=DI.hasOwnProperty;function uy(G,he){return G!=null&&tN.call(G,he)}function bi(G,he){return G!=null&&R4(G,he,uy)}var Vf="[object String]";function Op(G){return typeof G=="string"||!v(G)&&y(G)&&f(G)==Vf}function k4(G,he){return b(he,function(fe){return G[fe]})}function fu(G){return G==null?[]:k4(G,Ud(G))}var dW=Math.max;function Kc(G,he,fe,Fe){G=Vn(G)?G:fu(G),fe=fe&&!Fe?ne(fe):0;var tt=G.length;if(fe<0)fe=dW(tt+fe,0);return Op(G)?fe<=tt&&G.indexOf(he,fe)>-1:!!tt&&wn(G,he,fe)>-1}var zn=Math.max;function Ol(G,he,fe){var Fe=G==null?0:G.length;if(!Fe)return-1;var tt=fe==null?0:ne(fe);if(tt<0)tt=zn(Fe+tt,0);return wn(G,he,tt)}var _oe="[object Map]",uW="[object Set]",NI=Object.prototype,Ox=NI.hasOwnProperty;function dh(G){if(G==null)return!0;if(Vn(G)&&(v(G)||typeof G=="string"||typeof G.splice=="function"||kl(G)||a_(G)||Ci(G)))return!G.length;var he=_I(G);if(he==_oe||he==uW)return!G.size;if(Qo(G))return!Z1(G).length;for(var fe in G)if(Ox.call(G,fe))return!1;return!0}var cF="[object RegExp]";function bM(G){return y(G)&&f(G)==cF}var RI=lp&&lp.isRegExp,nN=RI?Bh(RI):bM;let F2=nN;function Yf(G){return G===void 0}var pW="Expected a function";function goe(G){if(typeof G!="function")throw TypeError(pW);return function(){var he=arguments;switch(he.length){case 0:return!G.call(this);case 1:return!G.call(this,he[0]);case 2:return!G.call(this,he[0],he[1]);case 3:return!G.call(this,he[0],he[1],he[2])}return!G.apply(this,he)}}function mW(G,he,fe,Fe){if(!V(G))return G;he=vc(he,G);var tt=-1,yt=he.length,Bt=yt-1,Rt=G;while(Rt!=null&&++tt<yt){var Xt=jt(he[tt]),Hn=fe;if(Xt==="__proto__"||Xt==="constructor"||Xt==="prototype")return G;if(tt!=Bt){var so=Rt[Xt];if(Hn=Fe?Fe(so,Xt,Rt):void 0,Hn===void 0)Hn=V(so)?so:no(he[tt+1])?[]:{}}Ot(Rt,Xt,Hn),Rt=Rt[Xt]}return G}function QI(G,he,fe){var Fe=-1,tt=he.length,yt={};while(++Fe<tt){var Bt=he[Fe],Rt=vn(G,Bt);if(fe(Rt,Bt))mW(yt,vc(Bt,G),Rt)}return yt}function ql(G,he){if(G==null)return{};var fe=b(Qf(G),function(Fe){return[Fe]});return he=Of(he),QI(G,fe,function(Fe,tt){return he(Fe,tt[0])})}function $c(G,he,fe,Fe,tt){return tt(G,function(yt,Bt,Rt){fe=Fe?(Fe=!1,yt):he(fe,yt,Bt,Rt)}),fe}function c0(G,he,fe){var Fe=v(G)?Fl:$c,tt=arguments.length<3;return Fe(G,Of(he),fe,tt,GC)}function Sg(G,he){var fe=v(G)?R2:ZD;return fe(G,goe(Of(he)))}function oN(G,he){var fe;return GC(G,function(Fe,tt,yt){return fe=he(Fe,tt,yt),!fe}),!!fe}function lF(G,he,fe){var Fe=v(G)?RD:oN;if(fe&&Rn(G,he,fe))he=void 0;return Fe(G,Of(he))}var yu=1/0,py=!(dp&&1/vI(new dp([,-0]))[1]==yu)?ht:function(G){return new dp(G)};let hF=py;var dF=200;function uF(G,he,fe){var Fe=-1,tt=Fn,yt=G.length,Bt=!0,Rt=[],Xt=Rt;if(fe)Bt=!1,tt=Fx;else if(yt>=dF){var Hn=he?null:hF(G);if(Hn)return vI(Hn);Bt=!1,tt=HC,Xt=new LC}else Xt=he?[]:Rt;e:while(++Fe<yt){var so=G[Fe],So=he?he(so):so;if(so=fe||so!==0?so:0,Bt&&So===So){var nr=Xt.length;while(nr--)if(Xt[nr]===So)continue e;if(he)Xt.push(So);Rt.push(so)}else if(!tt(Xt,So,fe)){if(Xt!==Rt)Xt.push(So);Rt.push(so)}}return Rt}function rN(G){return G&&G.length?uF(G):[]}function z8(G){if(console&&console.error)console.error(`Error: ${G}`)}function iN(G){if(console&&console.warn)console.warn(`Warning: ${G}`)}function O8(G){let he=new Date().getTime(),fe=G();return{time:new Date().getTime()-he,value:fe}}function _W(G){function he(){}he.prototype=G;let fe=new he;function Fe(){return typeof fe.bar}return Fe(),Fe(),G}function kI(G){if(WC(G))return G.LABEL;else return G.name}function WC(G){return Op(G.LABEL)&&G.LABEL!==""}class z2{get definition(){return this._definition}set definition(G){this._definition=G}constructor(G){this._definition=G}accept(G){G.visit(this),Vi(this.definition,(he)=>{he.accept(G)})}}class _p extends z2{constructor(G){super([]);this.idx=1,sl(this,ql(G,(he)=>he!==void 0))}set definition(G){}get definition(){if(this.referencedRule!==void 0)return this.referencedRule.definition;return[]}accept(G){G.visit(this)}}class XC extends z2{constructor(G){super(G.definition);this.orgText="",sl(this,ql(G,(he)=>he!==void 0))}}class fd extends z2{constructor(G){super(G.definition);this.ignoreAmbiguities=!1,sl(this,ql(G,(he)=>he!==void 0))}}class jd extends z2{constructor(G){super(G.definition);this.idx=1,sl(this,ql(G,(he)=>he!==void 0))}}class Gf extends z2{constructor(G){super(G.definition);this.idx=1,sl(this,ql(G,(he)=>he!==void 0))}}class Uf extends z2{constructor(G){super(G.definition);this.idx=1,sl(this,ql(G,(he)=>he!==void 0))}}class xu extends z2{constructor(G){super(G.definition);this.idx=1,sl(this,ql(G,(he)=>he!==void 0))}}class Sm extends z2{constructor(G){super(G.definition);this.idx=1,sl(this,ql(G,(he)=>he!==void 0))}}class vA extends z2{get definition(){return this._definition}set definition(G){this._definition=G}constructor(G){super(G.definition);this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,sl(this,ql(G,(he)=>he!==void 0))}}class uh{constructor(G){this.idx=1,sl(this,ql(G,(he)=>he!==void 0))}accept(G){G.visit(this)}}function gW(G){return Ur(G,V8)}function V8(G){function he(fe){return Ur(fe,V8)}if(G instanceof _p){let fe={type:"NonTerminal",name:G.nonTerminalName,idx:G.idx};if(Op(G.label))fe.label=G.label;return fe}else if(G instanceof fd)return{type:"Alternative",definition:he(G.definition)};else if(G instanceof jd)return{type:"Option",idx:G.idx,definition:he(G.definition)};else if(G instanceof Gf)return{type:"RepetitionMandatory",idx:G.idx,definition:he(G.definition)};else if(G instanceof Uf)return{type:"RepetitionMandatoryWithSeparator",idx:G.idx,separator:V8(new uh({terminalType:G.separator})),definition:he(G.definition)};else if(G instanceof Sm)return{type:"RepetitionWithSeparator",idx:G.idx,separator:V8(new uh({terminalType:G.separator})),definition:he(G.definition)};else if(G instanceof xu)return{type:"Repetition",idx:G.idx,definition:he(G.definition)};else if(G instanceof vA)return{type:"Alternation",idx:G.idx,definition:he(G.definition)};else if(G instanceof uh){let fe={type:"Terminal",name:G.terminalType.name,label:kI(G.terminalType),idx:G.idx};if(Op(G.label))fe.terminalLabel=G.label;let Fe=G.terminalType.PATTERN;if(G.terminalType.PATTERN)fe.pattern=F2(Fe)?Fe.source:Fe;return fe}else if(G instanceof XC)return{type:"Rule",name:G.name,orgText:G.orgText,definition:he(G.definition)};else throw Error("non exhaustive match")}class jC{visit(G){let he=G;switch(he.constructor){case _p:return this.visitNonTerminal(he);case fd:return this.visitAlternative(he);case jd:return this.visitOption(he);case Gf:return this.visitRepetitionMandatory(he);case Uf:return this.visitRepetitionMandatoryWithSeparator(he);case Sm:return this.visitRepetitionWithSeparator(he);case xu:return this.visitRepetition(he);case vA:return this.visitAlternation(he);case uh:return this.visitTerminal(he);case XC:return this.visitRule(he);default:throw Error("non exhaustive match")}}visitNonTerminal(G){}visitAlternative(G){}visitOption(G){}visitRepetition(G){}visitRepetitionMandatory(G){}visitRepetitionMandatoryWithSeparator(G){}visitRepetitionWithSeparator(G){}visitAlternation(G){}visitTerminal(G){}visitRule(G){}}function AW(G){return G instanceof fd||G instanceof jd||G instanceof xu||G instanceof Gf||G instanceof Uf||G instanceof Sm||G instanceof uh||G instanceof XC}function IM(G,he=[]){if(G instanceof jd||G instanceof xu||G instanceof Sm)return!0;if(G instanceof vA)return lF(G.definition,(Fe)=>IM(Fe,he));else if(G instanceof _p&&Kc(he,G))return!1;else if(G instanceof z2){if(G instanceof _p)he.push(G);return IA(G.definition,(Fe)=>IM(Fe,he))}else return!1}function fW(G){return G instanceof vA}function Vx(G){if(G instanceof _p)return"SUBRULE";else if(G instanceof jd)return"OPTION";else if(G instanceof vA)return"OR";else if(G instanceof Gf)return"AT_LEAST_ONE";else if(G instanceof Uf)return"AT_LEAST_ONE_SEP";else if(G instanceof Sm)return"MANY_SEP";else if(G instanceof xu)return"MANY";else if(G instanceof uh)return"CONSUME";else throw Error("non exhaustive match")}class KC{walk(G,he=[]){Vi(G.definition,(fe,Fe)=>{let tt=Xd(G.definition,Fe+1);if(fe instanceof _p)this.walkProdRef(fe,tt,he);else if(fe instanceof uh)this.walkTerminal(fe,tt,he);else if(fe instanceof fd)this.walkFlat(fe,tt,he);else if(fe instanceof jd)this.walkOption(fe,tt,he);else if(fe instanceof Gf)this.walkAtLeastOne(fe,tt,he);else if(fe instanceof Uf)this.walkAtLeastOneSep(fe,tt,he);else if(fe instanceof Sm)this.walkManySep(fe,tt,he);else if(fe instanceof xu)this.walkMany(fe,tt,he);else if(fe instanceof vA)this.walkOr(fe,tt,he);else throw Error("non exhaustive match")})}walkTerminal(G,he,fe){}walkProdRef(G,he,fe){}walkFlat(G,he,fe){let Fe=he.concat(fe);this.walk(G,Fe)}walkOption(G,he,fe){let Fe=he.concat(fe);this.walk(G,Fe)}walkAtLeastOne(G,he,fe){let Fe=[new jd({definition:G.definition})].concat(he,fe);this.walk(G,Fe)}walkAtLeastOneSep(G,he,fe){let Fe=pF(G,he,fe);this.walk(G,Fe)}walkMany(G,he,fe){let Fe=[new jd({definition:G.definition})].concat(he,fe);this.walk(G,Fe)}walkManySep(G,he,fe){let Fe=pF(G,he,fe);this.walk(G,Fe)}walkOr(G,he,fe){let Fe=he.concat(fe);Vi(G.definition,(tt)=>{let yt=new fd({definition:[tt]});this.walk(yt,Fe)})}}function pF(G,he,fe){return[new jd({definition:[new uh({terminalType:G.separator})].concat(G.definition)})].concat(he,fe)}function LI(G){if(G instanceof _p)return LI(G.referencedRule);else if(G instanceof uh)return yW(G);else if(AW(G))return mF(G);else if(fW(G))return _F(G);else throw Error("non exhaustive match")}function mF(G){let he=[],fe=G.definition,Fe=0,tt=fe.length>Fe,yt,Bt=!0;while(tt&&Bt)yt=fe[Fe],Bt=IM(yt),he=he.concat(LI(yt)),Fe=Fe+1,tt=fe.length>Fe;return rN(he)}function _F(G){let he=Ur(G.definition,(fe)=>LI(fe));return rN(Ea(he))}function yW(G){return[G.terminalType]}let O2="_~IN~_";class gF extends KC{constructor(G){super();this.topProd=G,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(G,he,fe){}walkProdRef(G,he,fe){let Fe=CW(G.referencedRule,G.idx)+this.topProd.name,tt=he.concat(fe),yt=new fd({definition:tt}),Bt=LI(yt);this.follows[Fe]=Bt}}function xW(G){let he={};return Vi(G,(fe)=>{let Fe=new gF(fe).startWalking();sl(he,Fe)}),he}function CW(G,he){return G.name+he+O2}function qi(G){return G.charCodeAt(0)}function HI(G,he){if(Array.isArray(G))G.forEach(function(fe){he.push(fe)});else he.push(G)}function gp(G,he){if(G[he]===!0)throw"duplicate flag "+he;G[he],G[he]=!0}function $C(G){if(G===void 0)throw Error("Internal Error - Should never get here!");return!0}function p_(){throw Error("Internal Error - Should never get here!")}function sN(G){return G.type==="Character"}let my=[];for(let G=qi("0");G<=qi("9");G++)my.push(G);let FI=[qi("_")].concat(my);for(let G=qi("a");G<=qi("z");G++)FI.push(G);for(let G=qi("A");G<=qi("Z");G++)FI.push(G);let V2=[qi(" "),qi("\f"),qi(`
`),qi("\r"),qi("\t"),qi("\v"),qi("\t"),qi(" "),qi(" "),qi(" "),qi(" "),qi(" "),qi(" "),qi(" "),qi(" "),qi(" "),qi(" "),qi(" "),qi(" "),qi(" "),qi("\u2028"),qi("\u2029"),qi(" "),qi(" "),qi(" "),qi("\uFEFF")],bW=/[0-9a-fA-F]/,_y=/[0-9]/,IW=/[1-9]/;class Pg{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(G){this.idx=G.idx,this.input=G.input,this.groupIdx=G.groupIdx}pattern(G){this.idx=0,this.input=G,this.groupIdx=0,this.consumeChar("/");let he=this.disjunction();this.consumeChar("/");let fe={type:"Flags",loc:{begin:this.idx,end:G.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};while(this.isRegExpFlag())switch(this.popChar()){case"g":gp(fe,"global");break;case"i":gp(fe,"ignoreCase");break;case"m":gp(fe,"multiLine");break;case"u":gp(fe,"unicode");break;case"y":gp(fe,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:fe,value:he,loc:this.loc(0)}}disjunction(){let G=[],he=this.idx;G.push(this.alternative());while(this.peekChar()==="|")this.consumeChar("|"),G.push(this.alternative());return{type:"Disjunction",value:G,loc:this.loc(he)}}alternative(){let G=[],he=this.idx;while(this.isTerm())G.push(this.term());return{type:"Alternative",value:G,loc:this.loc(he)}}term(){if(this.isAssertion())return this.assertion();else return this.atom()}assertion(){let G=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(G)};case"$":return{type:"EndAnchor",loc:this.loc(G)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(G)};case"B":return{type:"NonWordBoundary",loc:this.loc(G)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let he;switch(this.popChar()){case"=":he="Lookahead";break;case"!":he="NegativeLookahead";break}$C(he);let fe=this.disjunction();return this.consumeChar(")"),{type:he,value:fe,loc:this.loc(G)}}return p_()}quantifier(G=!1){let he=void 0,fe=this.idx;switch(this.popChar()){case"*":he={atLeast:0,atMost:1/0};break;case"+":he={atLeast:1,atMost:1/0};break;case"?":he={atLeast:0,atMost:1};break;case"{":let Fe=this.integerIncludingZero();switch(this.popChar()){case"}":he={atLeast:Fe,atMost:Fe};break;case",":let tt;if(this.isDigit())tt=this.integerIncludingZero(),he={atLeast:Fe,atMost:tt};else he={atLeast:Fe,atMost:1/0};this.consumeChar("}");break}if(G===!0&&he===void 0)return;$C(he);break}if(G===!0&&he===void 0)return;if($C(he)){if(this.peekChar(0)==="?")this.consumeChar("?"),he.greedy=!1;else he.greedy=!0;return he.type="Quantifier",he.loc=this.loc(fe),he}}atom(){let G,he=this.idx;switch(this.peekChar()){case".":G=this.dotAll();break;case"\\":G=this.atomEscape();break;case"[":G=this.characterClass();break;case"(":G=this.group();break}if(G===void 0&&this.isPatternCharacter())G=this.patternCharacter();if($C(G)){if(G.loc=this.loc(he),this.isQuantifier())G.quantifier=this.quantifier();return G}}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[qi(`
`),qi("\r"),qi("\u2028"),qi("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let G,he=!1;switch(this.popChar()){case"d":G=my;break;case"D":G=my,he=!0;break;case"s":G=V2;break;case"S":G=V2,he=!0;break;case"w":G=FI;break;case"W":G=FI,he=!0;break}if($C(G))return{type:"Set",value:G,complement:he}}controlEscapeAtom(){let G;switch(this.popChar()){case"f":G=qi("\f");break;case"n":G=qi(`
`);break;case"r":G=qi("\r");break;case"t":G=qi("\t");break;case"v":G=qi("\v");break}if($C(G))return{type:"Character",value:G}}controlLetterEscapeAtom(){this.consumeChar("c");let G=this.popChar();if(/[a-zA-Z]/.test(G)===!1)throw Error("Invalid ");return{type:"Character",value:G.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:qi("\x00")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){let G=this.popChar();return{type:"Character",value:qi(G)}}classPatternCharacterAtom(){switch(this.peekChar()){case`
`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:let G=this.popChar();return{type:"Character",value:qi(G)}}}characterClass(){let G=[],he=!1;if(this.consumeChar("["),this.peekChar(0)==="^")this.consumeChar("^"),he=!0;while(this.isClassAtom()){let fe=this.classAtom();if(fe.type,sN(fe)&&this.isRangeDash()){this.consumeChar("-");let Fe=this.classAtom();if(Fe.type,sN(Fe)){if(Fe.value<fe.value)throw Error("Range out of order in character class");G.push({from:fe.value,to:Fe.value})}else HI(fe.value,G),G.push(qi("-")),HI(Fe.value,G)}else HI(fe.value,G)}return this.consumeChar("]"),{type:"Set",complement:he,value:G}}classAtom(){switch(this.peekChar()){case"]":case`
`:case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}}classEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:qi("\b")};case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}group(){let G=!0;switch(this.consumeChar("("),this.peekChar(0)){case"?":this.consumeChar("?"),this.consumeChar(":"),G=!1;break;default:this.groupIdx++;break}let he=this.disjunction();this.consumeChar(")");let fe={type:"Group",capturing:G,value:he};if(G)fe.idx=this.groupIdx;return fe}positiveInteger(){let G=this.popChar();if(IW.test(G)===!1)throw Error("Expecting a positive integer");while(_y.test(this.peekChar(0)))G+=this.popChar();return parseInt(G,10)}integerIncludingZero(){let G=this.popChar();if(_y.test(G)===!1)throw Error("Expecting an integer");while(_y.test(this.peekChar(0)))G+=this.popChar();return parseInt(G,10)}patternCharacter(){let G=this.popChar();switch(G){case`
`:case"\r":case"\u2028":case"\u2029":case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":throw Error("TBD");default:return{type:"Character",value:qi(G)}}}isRegExpFlag(){switch(this.peekChar(0)){case"g":case"i":case"m":case"u":case"y":return!0;default:return!1}}isRangeDash(){return this.peekChar()==="-"&&this.isClassAtom(1)}isDigit(){return _y.test(this.peekChar(0))}isClassAtom(G=0){switch(this.peekChar(G)){case"]":case`
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}isTerm(){return this.isAtom()||this.isAssertion()}isAtom(){if(this.isPatternCharacter())return!0;switch(this.peekChar(0)){case".":case"\\":case"[":case"(":return!0;default:return!1}}isAssertion(){switch(this.peekChar(0)){case"^":case"$":return!0;case"\\":switch(this.peekChar(1)){case"b":case"B":return!0;default:return!1}case"(":return this.peekChar(1)==="?"&&(this.peekChar(2)==="="||this.peekChar(2)==="!");default:return!1}}isQuantifier(){let G=this.saveState();try{return this.quantifier(!0)!==void 0}catch(he){return!1}finally{this.restoreState(G)}}isPatternCharacter(){switch(this.peekChar()){case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":case"/":case`
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}parseHexDigits(G){let he="";for(let Fe=0;Fe<G;Fe++){let tt=this.popChar();if(bW.test(tt)===!1)throw Error("Expecting a HexDecimal digits");he+=tt}return{type:"Character",value:parseInt(he,16)}}peekChar(G=0){return this.input[this.idx+G]}popChar(){let G=this.peekChar(0);return this.consumeChar(void 0),G}consumeChar(G){if(G!==void 0&&this.input[this.idx]!==G)throw Error("Expected: '"+G+"' but found: '"+this.input[this.idx]+"' at offset: "+this.idx);if(this.idx>=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(G){return{begin:G,end:this.idx}}}class Y8{visitChildren(G){for(let he in G){let fe=G[he];if(G.hasOwnProperty(he)){if(fe.type!==void 0)this.visit(fe);else if(Array.isArray(fe))fe.forEach((Fe)=>{this.visit(Fe)},this)}}}visit(G){switch(G.type){case"Pattern":this.visitPattern(G);break;case"Flags":this.visitFlags(G);break;case"Disjunction":this.visitDisjunction(G);break;case"Alternative":this.visitAlternative(G);break;case"StartAnchor":this.visitStartAnchor(G);break;case"EndAnchor":this.visitEndAnchor(G);break;case"WordBoundary":this.visitWordBoundary(G);break;case"NonWordBoundary":this.visitNonWordBoundary(G);break;case"Lookahead":this.visitLookahead(G);break;case"NegativeLookahead":this.visitNegativeLookahead(G);break;case"Character":this.visitCharacter(G);break;case"Set":this.visitSet(G);break;case"Group":this.visitGroup(G);break;case"GroupBackReference":this.visitGroupBackReference(G);break;case"Quantifier":this.visitQuantifier(G);break}this.visitChildren(G)}visitPattern(G){}visitFlags(G){}visitDisjunction(G){}visitAlternative(G){}visitStartAnchor(G){}visitEndAnchor(G){}visitWordBoundary(G){}visitNonWordBoundary(G){}visitLookahead(G){}visitNegativeLookahead(G){}visitCharacter(G){}visitSet(G){}visitGroup(G){}visitGroupBackReference(G){}visitQuantifier(G){}}let G8={},Y2=new Pg;function vM(G){let he=G.toString();if(G8.hasOwnProperty(he))return G8[he];else{let fe=Y2.pattern(he);return G8[he]=fe,fe}}function U8(){G8={}}let AF="Complement Sets are not supported for first char optimization",qC=`Unable to use "first char" lexer optimizations:
`;function zI(G,he=!1){try{let fe=vM(G);return aN(fe.value,{},fe.flags.ignoreCase)}catch(fe){if(fe.message===AF){if(he)iN(`${qC}	Unable to optimize: < ${G.toString()} >
	Complement Sets cannot be automatically optimized.
	This will disable the lexer's first char optimizations.
	See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`)}else{let Fe="";if(he)Fe=`
	This will disable the lexer's first char optimizations.
	See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`;z8(`${qC}
	Failed parsing: < ${G.toString()} >
	Using the @chevrotain/regexp-to-ast library
	Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+Fe)}}return[]}function aN(G,he,fe){switch(G.type){case"Disjunction":for(let tt=0;tt<G.value.length;tt++)aN(G.value[tt],he,fe);break;case"Alternative":let Fe=G.value;for(let tt=0;tt<Fe.length;tt++){let yt=Fe[tt];switch(yt.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}let Bt=yt;switch(Bt.type){case"Character":SM(Bt.value,he,fe);break;case"Set":if(Bt.complement===!0)throw Error(AF);Vi(Bt.value,(Xt)=>{if(typeof Xt==="number")SM(Xt,he,fe);else{let Hn=Xt;if(fe===!0)for(let so=Hn.from;so<=Hn.to;so++)SM(so,he,fe);else{for(let so=Hn.from;so<=Hn.to&&so<MM;so++)SM(so,he,fe);if(Hn.to>=MM){let so=Hn.from>=MM?Hn.from:MM,So=Hn.to,nr=Ay(so),Rr=Ay(So);for(let Yi=nr;Yi<=Rr;Yi++)he[Yi]=Yi}}}});break;case"Group":aN(Bt.value,he,fe);break;default:throw Error("Non Exhaustive Match")}let Rt=Bt.quantifier!==void 0&&Bt.quantifier.atLeast===0;if(Bt.type==="Group"&&W8(Bt)===!1||Bt.type!=="Group"&&Rt===!1)break}break;default:throw Error("non exhaustive match!")}return fu(he)}function SM(G,he,fe){let Fe=Ay(G);if(he[Fe]=Fe,fe===!0)PM(G,he)}function PM(G,he){let fe=String.fromCharCode(G),Fe=fe.toUpperCase();if(Fe!==fe){let tt=Ay(Fe.charCodeAt(0));he[tt]=tt}else{let tt=fe.toLowerCase();if(tt!==fe){let yt=Ay(tt.charCodeAt(0));he[yt]=yt}}}function cN(G,he){return TI(G.value,(fe)=>{if(typeof fe==="number")return Kc(he,fe);else{let Fe=fe;return TI(he,(tt)=>Fe.from<=tt&&tt<=Fe.to)!==void 0}})}function W8(G){let he=G.quantifier;if(he&&he.atLeast===0)return!0;if(!G.value)return!1;return v(G.value)?IA(G.value,W8):W8(G.value)}class fF extends Y8{constructor(G){super();this.targetCharCodes=G,this.found=!1}visitChildren(G){if(this.found===!0)return;switch(G.type){case"Lookahead":this.visitLookahead(G);return;case"NegativeLookahead":this.visitNegativeLookahead(G);return}super.visitChildren(G)}visitCharacter(G){if(Kc(this.targetCharCodes,G.value))this.found=!0}visitSet(G){if(G.complement){if(cN(G,this.targetCharCodes)===void 0)this.found=!0}else if(cN(G,this.targetCharCodes)!==void 0)this.found=!0}}function lN(G,he){if(he instanceof RegExp){let fe=vM(he),Fe=new fF(G);return Fe.visit(fe),Fe.found}else return TI(he,(fe)=>Kc(G,fe.charCodeAt(0)))!==void 0}let OI="PATTERN",VI="defaultMode",Pm="modes",hN=typeof new RegExp("(?:)").sticky==="boolean";function YI(G,he){he=yM(he,{useSticky:hN,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
`],tracer:(Eo,Fo)=>Fo()});let fe=he.tracer;fe("initCharCodeToOptimizedIndexMap",()=>{K8()});let Fe;fe("Reject Lexer.NA",()=>{Fe=Sg(G,(Eo)=>Eo[OI]===Eg.NA)});let tt=!1,yt;fe("Transform Patterns",()=>{tt=!1,yt=Ur(Fe,(Eo)=>{let Fo=Eo[OI];if(F2(Fo)){let ks=Fo.source;if(ks.length===1&&ks!=="^"&&ks!=="$"&&ks!=="."&&!Fo.ignoreCase)return ks;else if(ks.length===2&&ks[0]==="\\"&&!Kc(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],ks[1]))return ks[1];else return he.useSticky?bF(Fo):l0(Fo)}else if(ue(Fo))return tt=!0,{exec:Fo};else if(typeof Fo==="object")return tt=!0,Fo;else if(typeof Fo==="string")if(Fo.length===1)return Fo;else{let ks=Fo.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),ph=new RegExp(ks);return he.useSticky?bF(ph):l0(ph)}else throw Error("non exhaustive match")})});let Bt,Rt,Xt,Hn,so;fe("misc mapping",()=>{Bt=Ur(Fe,(Eo)=>Eo.tokenTypeIdx),Rt=Ur(Fe,(Eo)=>{let Fo=Eo.GROUP;if(Fo===Eg.SKIPPED)return;else if(Op(Fo))return Fo;else if(Yf(Fo))return!1;else throw Error("non exhaustive match")}),Xt=Ur(Fe,(Eo)=>{let Fo=Eo.LONGER_ALT;if(Fo)return v(Fo)?Ur(Fo,(ph)=>Ol(Fe,ph)):[Ol(Fe,Fo)]}),Hn=Ur(Fe,(Eo)=>Eo.PUSH_MODE),so=Ur(Fe,(Eo)=>bi(Eo,"POP_MODE"))});let So;fe("Line Terminator Handling",()=>{let Eo=m_(he.lineTerminatorCharacters);if(So=Ur(Fe,(Fo)=>!1),he.positionTracking!=="onlyOffset")So=Ur(Fe,(Fo)=>{if(bi(Fo,"LINE_BREAKS"))return!!Fo.LINE_BREAKS;else return gy(Fo,Eo)===!1&&lN(Eo,Fo.PATTERN)})});let nr,Rr,Yi,li;fe("Misc Mapping #2",()=>{nr=Ur(Fe,UI),Rr=Ur(yt,ZC),Yi=c0(Fe,(Eo,Fo)=>{let ks=Fo.GROUP;if(Op(ks)&&ks!==Eg.SKIPPED)Eo[ks]=[];return Eo},{}),li=Ur(yt,(Eo,Fo)=>({pattern:yt[Fo],longerAlt:Xt[Fo],canLineTerminator:So[Fo],isCustom:nr[Fo],short:Rr[Fo],group:Rt[Fo],push:Hn[Fo],pop:so[Fo],tokenTypeIdx:Bt[Fo],tokenType:Fe[Fo]}))});let zr=!0,Pr=[];if(!he.safeMode)fe("First Char Optimization",()=>{Pr=c0(Fe,(Eo,Fo,ks)=>{if(typeof Fo.PATTERN==="string"){let ph=Fo.PATTERN.charCodeAt(0),Yp=Ay(ph);SF(Eo,Yp,li[ks])}else if(v(Fo.START_CHARS_HINT)){let ph;Vi(Fo.START_CHARS_HINT,(Yp)=>{let cb=typeof Yp==="string"?Yp.charCodeAt(0):Yp,Bg=Ay(cb);if(ph!==Bg)ph=Bg,SF(Eo,Bg,li[ks])})}else if(F2(Fo.PATTERN))if(Fo.PATTERN.unicode){if(zr=!1,he.ensureOptimizations)z8(`${qC}	Unable to analyze < ${Fo.PATTERN.toString()} > pattern.
	The regexp unicode flag is not currently supported by the regexp-to-ast library.
	This will disable the lexer's first char optimizations.
	For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`)}else{let ph=zI(Fo.PATTERN,he.ensureOptimizations);if(dh(ph))zr=!1;Vi(ph,(Yp)=>{SF(Eo,Yp,li[ks])})}else{if(he.ensureOptimizations)z8(`${qC}	TokenType: <${Fo.name}> is using a custom token pattern without providing <start_chars_hint> parameter.
	This will disable the lexer's first char optimizations.
	For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`);zr=!1}return Eo},[])});return{emptyGroups:Yi,patternIdxToConfig:li,charCodeToPatternIdxToConfig:Pr,hasCustom:tt,canBeOptimized:zr}}function Kd(G,he){let fe=[],Fe=G2(G);fe=fe.concat(Fe.errors);let tt=SW(Fe.valid),yt=tt.valid;return fe=fe.concat(tt.errors),fe=fe.concat(vW(yt)),fe=fe.concat(PW(yt)),fe=fe.concat(EW(yt,he)),fe=fe.concat(uN(yt)),fe}function vW(G){let he=[],fe=Ig(G,(Fe)=>F2(Fe[OI]));return he=he.concat(GI(fe)),he=he.concat(X8(fe)),he=he.concat(yF(fe)),he=he.concat(xF(fe)),he=he.concat(dN(fe)),he}function G2(G){let he=Ig(G,(tt)=>!bi(tt,OI)),fe=Ur(he,(tt)=>({message:"Token Type: ->"+tt.name+"<- missing static 'PATTERN' property",type:yd.MISSING_PATTERN,tokenTypes:[tt]})),Fe=hy(G,he);return{errors:fe,valid:Fe}}function SW(G){let he=Ig(G,(tt)=>{let yt=tt[OI];return!F2(yt)&&!ue(yt)&&!bi(yt,"exec")&&!Op(yt)}),fe=Ur(he,(tt)=>({message:"Token Type: ->"+tt.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:yd.INVALID_PATTERN,tokenTypes:[tt]})),Fe=hy(G,he);return{errors:fe,valid:Fe}}let Yx=/[^\\][$]/;function GI(G){class he extends Y8{constructor(){super(...arguments);this.found=!1}visitEndAnchor(tt){this.found=!0}}let fe=Ig(G,(tt)=>{let yt=tt.PATTERN;try{let Bt=vM(yt),Rt=new he;return Rt.visit(Bt),Rt.found}catch(Bt){return Yx.test(yt.source)}});return Ur(fe,(tt)=>({message:`Unexpected RegExp Anchor Error:
	Token Type: ->`+tt.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
	See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS	for details.`,type:yd.EOI_ANCHOR_FOUND,tokenTypes:[tt]}))}function dN(G){let he=Ig(G,(Fe)=>Fe.PATTERN.test(""));return Ur(he,(Fe)=>({message:"Token Type: ->"+Fe.name+"<- static 'PATTERN' must not match an empty string",type:yd.EMPTY_MATCH_PATTERN,tokenTypes:[Fe]}))}let JC=/[^\\[][\^]|^\^/;function X8(G){class he extends Y8{constructor(){super(...arguments);this.found=!1}visitStartAnchor(tt){this.found=!0}}let fe=Ig(G,(tt)=>{let yt=tt.PATTERN;try{let Bt=vM(yt),Rt=new he;return Rt.visit(Bt),Rt.found}catch(Bt){return JC.test(yt.source)}});return Ur(fe,(tt)=>({message:`Unexpected RegExp Anchor Error:
	Token Type: ->`+tt.name+`<- static 'PATTERN' cannot contain start of input anchor '^'
	See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS	for details.`,type:yd.SOI_ANCHOR_FOUND,tokenTypes:[tt]}))}function yF(G){let he=Ig(G,(Fe)=>{let tt=Fe[OI];return tt instanceof RegExp&&(tt.multiline||tt.global)});return Ur(he,(Fe)=>({message:"Token Type: ->"+Fe.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:yd.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[Fe]}))}function xF(G){let he=[],fe=Ur(G,(yt)=>c0(G,(Bt,Rt)=>{if(yt.PATTERN.source===Rt.PATTERN.source&&!Kc(he,Rt)&&Rt.PATTERN!==Eg.NA)return he.push(Rt),Bt.push(Rt),Bt;return Bt},[]));fe=ly(fe);let Fe=Ig(fe,(yt)=>yt.length>1);return Ur(Fe,(yt)=>{let Bt=Ur(yt,(Xt)=>Xt.name);return{message:`The same RegExp pattern ->${mp(yt).PATTERN}<-has been used in all of the following Token Types: ${Bt.join(", ")} <-`,type:yd.DUPLICATE_PATTERNS_FOUND,tokenTypes:yt}})}function PW(G){let he=Ig(G,(Fe)=>{if(!bi(Fe,"GROUP"))return!1;let tt=Fe.GROUP;return tt!==Eg.SKIPPED&&tt!==Eg.NA&&!Op(tt)});return Ur(he,(Fe)=>({message:"Token Type: ->"+Fe.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:yd.INVALID_GROUP_TYPE_FOUND,tokenTypes:[Fe]}))}function EW(G,he){let fe=Ig(G,(tt)=>tt.PUSH_MODE!==void 0&&!Kc(he,tt.PUSH_MODE));return Ur(fe,(tt)=>({message:`Token Type: ->${tt.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${tt.PUSH_MODE}<-which does not exist`,type:yd.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[tt]}))}function uN(G){let he=[],fe=c0(G,(Fe,tt,yt)=>{let Bt=tt.PATTERN;if(Bt===Eg.NA)return Fe;if(Op(Bt))Fe.push({str:Bt,idx:yt,tokenType:tt});else if(F2(Bt)&&CF(Bt))Fe.push({str:Bt.source,idx:yt,tokenType:tt});return Fe},[]);return Vi(G,(Fe,tt)=>{Vi(fe,({str:yt,idx:Bt,tokenType:Rt})=>{if(tt<Bt&&EM(yt,Fe.PATTERN)){let Xt=`Token: ->${Rt.name}<- can never be matched.
Because it appears AFTER the Token Type ->${Fe.name}<-in the lexer's definition.
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;he.push({message:Xt,type:yd.UNREACHABLE_PATTERN,tokenTypes:[Fe,Rt]})}})}),he}function EM(G,he){if(F2(he)){let fe=he.exec(G);return fe!==null&&fe.index===0}else if(ue(he))return he(G,0,[],{});else if(bi(he,"exec"))return he.exec(G,0,[],{});else if(typeof he==="string")return he===G;else throw Error("non exhaustive match")}function CF(G){return TI([".","\\","[","]","|","^","$","(",")","?","*","+","{"],(fe)=>G.source.indexOf(fe)!==-1)===void 0}function l0(G){let he=G.ignoreCase?"i":"";return new RegExp(`^(?:${G.source})`,he)}function bF(G){let he=G.ignoreCase?"iy":"y";return new RegExp(`${G.source}`,he)}function Aoe(G,he,fe){let Fe=[];if(!bi(G,VI))Fe.push({message:"A MultiMode Lexer cannot be initialized without a <"+VI+`> property in its definition
`,type:yd.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE});if(!bi(G,Pm))Fe.push({message:"A MultiMode Lexer cannot be initialized without a <"+Pm+`> property in its definition
`,type:yd.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY});if(bi(G,Pm)&&bi(G,VI)&&!bi(G.modes,G.defaultMode))Fe.push({message:`A MultiMode Lexer cannot be initialized with a ${VI}: <${G.defaultMode}>which does not exist
`,type:yd.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST});if(bi(G,Pm))Vi(G.modes,(tt,yt)=>{Vi(tt,(Bt,Rt)=>{if(Yf(Bt))Fe.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${yt}> at index: <${Rt}>
`,type:yd.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(bi(Bt,"LONGER_ALT")){let Xt=v(Bt.LONGER_ALT)?Bt.LONGER_ALT:[Bt.LONGER_ALT];Vi(Xt,(Hn)=>{if(!Yf(Hn)&&!Kc(tt,Hn))Fe.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${Hn.name}> on token <${Bt.name}> outside of mode <${yt}>
`,type:yd.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})});return Fe}function IF(G,he,fe){let Fe=[],tt=!1,yt=ly(Ea(fu(G.modes))),Bt=Sg(yt,(Xt)=>Xt[OI]===Eg.NA),Rt=m_(fe);if(he)Vi(Bt,(Xt)=>{let Hn=gy(Xt,Rt);if(Hn!==!1){let So={message:Gx(Xt,Hn),type:Hn.issue,tokenType:Xt};Fe.push(So)}else if(bi(Xt,"LINE_BREAKS")){if(Xt.LINE_BREAKS===!0)tt=!0}else if(lN(Rt,Xt.PATTERN))tt=!0});if(he&&!tt)Fe.push({message:`Warning: No LINE_BREAKS Found.
	This Lexer has been defined to track line and column information,
	But none of the Token Types can be identified as matching a line terminator.
	See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS 
	for details.`,type:yd.NO_LINE_BREAKS_FLAGS});return Fe}function vF(G){let he={},fe=Ud(G);return Vi(fe,(Fe)=>{let tt=G[Fe];if(v(tt))he[Fe]=[];else throw Error("non exhaustive match")}),he}function UI(G){let he=G.PATTERN;if(F2(he))return!1;else if(ue(he))return!0;else if(bi(he,"exec"))return!0;else if(Op(he))return!1;else throw Error("non exhaustive match")}function ZC(G){if(Op(G)&&G.length===1)return G.charCodeAt(0);else return!1}let j8={test:function(G){let he=G.length;for(let fe=this.lastIndex;fe<he;fe++){let Fe=G.charCodeAt(fe);if(Fe===10)return this.lastIndex=fe+1,!0;else if(Fe===13){if(G.charCodeAt(fe+1)===10)this.lastIndex=fe+2;else this.lastIndex=fe+1;return!0}}return!1},lastIndex:0};function gy(G,he){if(bi(G,"LINE_BREAKS"))return!1;else if(F2(G.PATTERN)){try{lN(he,G.PATTERN)}catch(fe){return{issue:yd.IDENTIFY_TERMINATOR,errMsg:fe.message}}return!1}else if(Op(G.PATTERN))return!1;else if(UI(G))return{issue:yd.CUSTOM_LINE_BREAK};else throw Error("non exhaustive match")}function Gx(G,he){if(he.issue===yd.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
	The problem is in the <${G.name}> Token Type
	 Root cause: ${he.errMsg}.
	For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;else if(he.issue===yd.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
	The problem is in the <${G.name}> Token Type
	For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;else throw Error("non exhaustive match")}function m_(G){return Ur(G,(fe)=>{if(Op(fe))return fe.charCodeAt(0);else return fe})}function SF(G,he,fe){if(G[he]===void 0)G[he]=[fe];else G[he].push(fe)}let MM=256,WI=[];function Ay(G){return G<MM?G:WI[G]}function K8(){if(dh(WI)){WI=Array(65536);for(let G=0;G<65536;G++)WI[G]=G>255?255+~~(G/255):G}}function XI(G,he){let fe=G.tokenTypeIdx;if(fe===he.tokenTypeIdx)return!0;else return he.isParent===!0&&he.categoryMatchesMap[fe]===!0}function $8(G,he){return G.tokenTypeIdx===he.tokenTypeIdx}let PF=1,Wf={};function fy(G){let he=pN(G);q8(he),EF(he),qc(he),Vi(he,(fe)=>{fe.isParent=fe.categoryMatches.length>0})}function pN(G){let he=up(G),fe=G,Fe=!0;while(Fe){fe=ly(Ea(Ur(fe,(yt)=>yt.CATEGORIES)));let tt=hy(fe,he);if(he=he.concat(tt),dh(tt))Fe=!1;else fe=tt}return he}function q8(G){Vi(G,(he)=>{if(!eb(he))Wf[PF]=he,he.tokenTypeIdx=PF++;if(Em(he)&&!v(he.CATEGORIES))he.CATEGORIES=[he.CATEGORIES];if(!Em(he))he.CATEGORIES=[];if(!Cr(he))he.categoryMatches=[];if(!U2(he))he.categoryMatchesMap={}})}function qc(G){Vi(G,(he)=>{he.categoryMatches=[],Vi(he.categoryMatchesMap,(fe,Fe)=>{he.categoryMatches.push(Wf[Fe].tokenTypeIdx)})})}function EF(G){Vi(G,(he)=>{MW([],he)})}function MW(G,he){Vi(G,(fe)=>{he.categoryMatchesMap[fe.tokenTypeIdx]=!0}),Vi(he.CATEGORIES,(fe)=>{let Fe=G.concat(he);if(!Kc(Fe,fe))MW(Fe,fe)})}function eb(G){return bi(G,"tokenTypeIdx")}function Em(G){return bi(G,"CATEGORIES")}function Cr(G){return bi(G,"categoryMatches")}function U2(G){return bi(G,"categoryMatchesMap")}function W2(G){return bi(G,"tokenTypeIdx")}let J8={buildUnableToPopLexerModeMessage(G){return`Unable to pop Lexer Mode after encountering Token ->${G.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(G,he,fe,Fe,tt){return`unexpected character: ->${G.charAt(he)}<- at offset: ${he}, skipped ${fe} characters.`}};var yd;(function(G){G[G.MISSING_PATTERN=0]="MISSING_PATTERN",G[G.INVALID_PATTERN=1]="INVALID_PATTERN",G[G.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",G[G.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",G[G.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",G[G.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",G[G.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",G[G.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",G[G.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",G[G.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",G[G.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",G[G.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",G[G.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",G[G.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",G[G.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",G[G.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",G[G.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",G[G.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"})(yd||(yd={}));let Ux={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:J8,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(Ux);class Eg{constructor(G,he=Ux){if(this.lexerDefinition=G,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(Fe,tt)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;let yt=Array(this.traceInitIndent+1).join("\t");if(this.traceInitIndent<this.traceInitMaxIdent)console.log(`${yt}--> <${Fe}>`);let{time:Bt,value:Rt}=O8(tt),Xt=Bt>10?console.warn:console.log;if(this.traceInitIndent<this.traceInitMaxIdent)Xt(`${yt}<-- <${Fe}> time: ${Bt}ms`);return this.traceInitIndent--,Rt}else return tt()},typeof he==="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.
a boolean 2nd argument is no longer supported`);this.config=sl({},Ux,he);let fe=this.config.traceInitPerf;if(fe===!0)this.traceInitMaxIdent=1/0,this.traceInitPerf=!0;else if(typeof fe==="number")this.traceInitMaxIdent=fe,this.traceInitPerf=!0;this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let Fe,tt=!0;if(this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===Ux.lineTerminatorsPattern)this.config.lineTerminatorsPattern=j8;else if(this.config.lineTerminatorCharacters===Ux.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.
	For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(he.safeMode&&he.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');if(this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),v(G))Fe={modes:{defaultMode:up(G)},defaultMode:VI};else tt=!1,Fe=up(G)}),this.config.skipValidations===!1)this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(Aoe(Fe,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(IF(Fe,this.trackStartLines,this.config.lineTerminatorCharacters))});Fe.modes=Fe.modes?Fe.modes:{},Vi(Fe.modes,(Bt,Rt)=>{Fe.modes[Rt]=Sg(Bt,(Xt)=>Yf(Xt))});let yt=Ud(Fe.modes);if(Vi(Fe.modes,(Bt,Rt)=>{this.TRACE_INIT(`Mode: <${Rt}> processing`,()=>{if(this.modes.push(Rt),this.config.skipValidations===!1)this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(Kd(Bt,yt))});if(dh(this.lexerDefinitionErrors)){fy(Bt);let Xt;this.TRACE_INIT("analyzeTokenTypes",()=>{Xt=YI(Bt,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:he.positionTracking,ensureOptimizations:he.ensureOptimizations,safeMode:he.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[Rt]=Xt.patternIdxToConfig,this.charCodeToPatternIdxToConfig[Rt]=Xt.charCodeToPatternIdxToConfig,this.emptyGroups=sl({},this.emptyGroups,Xt.emptyGroups),this.hasCustom=Xt.hasCustom||this.hasCustom,this.canModeBeOptimized[Rt]=Xt.canBeOptimized}})}),this.defaultMode=Fe.defaultMode,!dh(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){let Rt=Ur(this.lexerDefinitionErrors,(Xt)=>Xt.message).join(`-----------------------
`);throw Error(`Errors detected in definition of Lexer:
`+Rt)}Vi(this.lexerDefinitionWarning,(Bt)=>{iN(Bt.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(hN)this.chopInput=re,this.match=this.matchWithTest;else this.updateLastIndex=ht,this.match=this.matchWithExec;if(tt)this.handleModes=ht;if(this.trackStartLines===!1)this.computeNewColumn=re;if(this.trackEndLines===!1)this.updateTokenEndLineColumnLocation=ht;if(/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else if(/onlyOffset/i.test(this.config.positionTracking))this.createTokenInstance=this.createOffsetOnlyToken;else throw Error(`Invalid <positionTracking> config option: "${this.config.positionTracking}"`);if(this.hasCustom)this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom;else this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom}),this.TRACE_INIT("Failed Optimization Warnings",()=>{let Bt=c0(this.canModeBeOptimized,(Rt,Xt,Hn)=>{if(Xt===!1)Rt.push(Hn);return Rt},[]);if(he.ensureOptimizations&&!dh(Bt))throw Error(`Lexer Modes: < ${Bt.join(", ")} > cannot be optimized.
	 Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.
	 Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{U8()}),this.TRACE_INIT("toFastProperties",()=>{_W(this)})})}tokenize(G,he=this.defaultMode){if(!dh(this.lexerDefinitionErrors)){let Fe=Ur(this.lexerDefinitionErrors,(tt)=>tt.message).join(`-----------------------
`);throw Error(`Unable to Tokenize because Errors detected in definition of Lexer:
`+Fe)}return this.tokenizeInternal(G,he)}tokenizeInternal(G,he){let fe,Fe,tt,yt,Bt,Rt,Xt,Hn,so,So,nr,Rr,Yi,li,zr,Pr=G,Eo=Pr.length,Fo=0,ks=0,ph=this.hasCustom?0:Math.floor(G.length/10),Yp=Array(ph),cb=[],Bg=this.trackStartLines?1:void 0,Cy=this.trackStartLines?1:void 0,Dm=vF(this.emptyGroups),by=this.trackStartLines,lb=this.config.lineTerminatorsPattern,hb=0,Rh=[],db=[],a9=[],FM=[];Object.freeze(FM);let c9;function PN(){return Rh}function l9(Nm){let Rm=Ay(Nm),ub=db[Rm];if(ub===void 0)return FM;else return ub}let RW=(Nm)=>{if(a9.length===1&&Nm.tokenType.PUSH_MODE===void 0){let Rm=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(Nm);cb.push({offset:Nm.startOffset,line:Nm.startLine,column:Nm.startColumn,length:Nm.image.length,message:Rm})}else{a9.pop();let Rm=Q4(a9);Rh=this.patternIdxToConfig[Rm],db=this.charCodeToPatternIdxToConfig[Rm],hb=Rh.length;let ub=this.canModeBeOptimized[Rm]&&this.config.safeMode===!1;if(db&&ub)c9=l9;else c9=PN}};function EN(Nm){a9.push(Nm),db=this.charCodeToPatternIdxToConfig[Nm],Rh=this.patternIdxToConfig[Nm],hb=Rh.length,hb=Rh.length;let Rm=this.canModeBeOptimized[Nm]&&this.config.safeMode===!1;if(db&&Rm)c9=l9;else c9=PN}EN.call(this,he);let Tg,MN=this.config.recoveryEnabled;while(Fo<Eo){Rt=null;let Nm=Pr.charCodeAt(Fo),Rm=c9(Nm),ub=Rm.length;for(fe=0;fe<ub;fe++){Tg=Rm[fe];let $d=Tg.pattern;Xt=null;let $2=Tg.short;if($2!==!1){if(Nm===$2)Rt=$d}else if(Tg.isCustom===!0)if(zr=$d.exec(Pr,Fo,Yp,Dm),zr!==null){if(Rt=zr[0],zr.payload!==void 0)Xt=zr.payload}else Rt=null;else this.updateLastIndex($d,Fo),Rt=this.match($d,G,Fo);if(Rt!==null){if(Bt=Tg.longerAlt,Bt!==void 0){let Iy=Bt.length;for(tt=0;tt<Iy;tt++){let Vl=Rh[Bt[tt]],j4=Vl.pattern;if(Hn=null,Vl.isCustom===!0)if(zr=j4.exec(Pr,Fo,Yp,Dm),zr!==null){if(yt=zr[0],zr.payload!==void 0)Hn=zr.payload}else yt=null;else this.updateLastIndex(j4,Fo),yt=this.match(j4,G,Fo);if(yt&&yt.length>Rt.length){Rt=yt,Xt=Hn,Tg=Vl;break}}}break}}if(Rt!==null){if(so=Rt.length,So=Tg.group,So!==void 0)if(nr=Tg.tokenTypeIdx,Rr=this.createTokenInstance(Rt,Fo,nr,Tg.tokenType,Bg,Cy,so),this.handlePayload(Rr,Xt),So===!1)ks=this.addToken(Yp,ks,Rr);else Dm[So].push(Rr);if(G=this.chopInput(G,so),Fo=Fo+so,Cy=this.computeNewColumn(Cy,so),by===!0&&Tg.canLineTerminator===!0){let $d=0,$2,Iy;lb.lastIndex=0;do if($2=lb.test(Rt),$2===!0)Iy=lb.lastIndex-1,$d++;while($2===!0);if($d!==0)Bg=Bg+$d,Cy=so-Iy,this.updateTokenEndLineColumnLocation(Rr,So,Iy,$d,Bg,Cy,so)}this.handleModes(Tg,RW,EN,Rr)}else{let $d=Fo,$2=Bg,Iy=Cy,Vl=MN===!1;while(Vl===!1&&Fo<Eo){G=this.chopInput(G,1),Fo++;for(Fe=0;Fe<hb;Fe++){let j4=Rh[Fe],{pattern:K4,short:zM}=j4;if(zM!==!1){if(Pr.charCodeAt(Fo)===zM)Vl=!0}else if(j4.isCustom===!0)Vl=K4.exec(Pr,Fo,Yp,Dm)!==null;else this.updateLastIndex(K4,Fo),Vl=K4.exec(G)!==null;if(Vl===!0)break}}if(Yi=Fo-$d,Cy=this.computeNewColumn(Cy,Yi),li=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(Pr,$d,Yi,$2,Iy),cb.push({offset:$d,line:$2,column:Iy,length:Yi,message:li}),MN===!1)break}}if(!this.hasCustom)Yp.length=ks;return{tokens:Yp,groups:Dm,errors:cb}}handleModes(G,he,fe,Fe){if(G.pop===!0){let tt=G.push;if(he(Fe),tt!==void 0)fe.call(this,tt)}else if(G.push!==void 0)fe.call(this,G.push)}chopInput(G,he){return G.substring(he)}updateLastIndex(G,he){G.lastIndex=he}updateTokenEndLineColumnLocation(G,he,fe,Fe,tt,yt,Bt){let Rt,Xt;if(he!==void 0){if(Rt=fe===Bt-1,Xt=Rt?-1:0,!(Fe===1&&Rt===!0))G.endLine=tt+Xt,G.endColumn=yt-1+-Xt}}computeNewColumn(G,he){return G+he}createOffsetOnlyToken(G,he,fe,Fe){return{image:G,startOffset:he,tokenTypeIdx:fe,tokenType:Fe}}createStartOnlyToken(G,he,fe,Fe,tt,yt){return{image:G,startOffset:he,startLine:tt,startColumn:yt,tokenTypeIdx:fe,tokenType:Fe}}createFullToken(G,he,fe,Fe,tt,yt,Bt){return{image:G,startOffset:he,endOffset:he+Bt-1,startLine:tt,endLine:tt,startColumn:yt,endColumn:yt+Bt-1,tokenTypeIdx:fe,tokenType:Fe}}addTokenUsingPush(G,he,fe){return G.push(fe),he}addTokenUsingMemberAccess(G,he,fe){return G[he]=fe,he++,he}handlePayloadNoCustom(G,he){}handlePayloadWithCustom(G,he){if(he!==null)G.payload=he}matchWithTest(G,he,fe){if(G.test(he)===!0)return he.substring(fe,G.lastIndex);return null}matchWithExec(G,he){let fe=G.exec(he);return fe!==null?fe[0]:null}}Eg.SKIPPED="This marks a skipped Token pattern, this means each token identified by it willbe consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.",Eg.NA=/NOT_APPLICABLE/;function Z8(G){if(X2(G))return G.LABEL;else return G.name}function X2(G){return Op(G.LABEL)&&G.LABEL!==""}let e7="parent",MF="categories",t7="label",mN="group",wM="push_mode",BM="pop_mode",n7="longer_alt",tb="line_breaks",L4="start_chars_hint";function jI(G){return _N(G)}function _N(G){let he=G.pattern,fe={};if(fe.name=G.name,!Yf(he))fe.PATTERN=he;if(bi(G,e7))throw`The parent property is no longer supported.
See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;if(bi(G,MF))fe.CATEGORIES=G[MF];if(fy([fe]),bi(G,t7))fe.LABEL=G[t7];if(bi(G,mN))fe.GROUP=G[mN];if(bi(G,BM))fe.POP_MODE=G[BM];if(bi(G,wM))fe.PUSH_MODE=G[wM];if(bi(G,n7))fe.LONGER_ALT=G[n7];if(bi(G,tb))fe.LINE_BREAKS=G[tb];if(bi(G,L4))fe.START_CHARS_HINT=G[L4];return fe}let h0=jI({name:"EOF",pattern:Eg.NA});fy([h0]);function Mg(G,he,fe,Fe,tt,yt,Bt,Rt){return{image:he,startOffset:fe,endOffset:Fe,startLine:tt,endLine:yt,startColumn:Bt,endColumn:Rt,tokenTypeIdx:G.tokenTypeIdx,tokenType:G}}function Xs(G,he){return XI(G,he)}let j2={buildMismatchTokenMessage({expected:G,actual:he,previous:fe,ruleName:Fe}){return`Expecting ${X2(G)?`--> ${Z8(G)} <--`:`token of type --> ${G.name} <--`} but found --> '${he.image}' <--`},buildNotAllInputParsedMessage({firstRedundant:G,ruleName:he}){return"Redundant input, expecting EOF but found: "+G.image},buildNoViableAltMessage({expectedPathsPerAlt:G,actual:he,previous:fe,customUserDescription:Fe,ruleName:tt}){let Rt=`
but found: '`+mp(he).image+"'";if(Fe)return"Expecting: "+Fe+Rt;else{let Xt=c0(G,(nr,Rr)=>nr.concat(Rr),[]),Hn=Ur(Xt,(nr)=>`[${Ur(nr,(Rr)=>Z8(Rr)).join(", ")}]`);return`Expecting: one of these possible Token sequences:
${Ur(Hn,(nr,Rr)=>`  ${Rr+1}. ${nr}`).join(`
`)}`+Rt}},buildEarlyExitMessage({expectedIterationPaths:G,actual:he,customUserDescription:fe,ruleName:Fe}){let Bt=`
but found: '`+mp(he).image+"'";if(fe)return"Expecting: "+fe+Bt;else return`Expecting: expecting at least one iteration which starts with one of these possible Token sequences::
  <${Ur(G,(Hn)=>`[${Ur(Hn,(so)=>Z8(so)).join(",")}]`).join(" ,")}>`+Bt}};Object.freeze(j2);let yy={buildRuleNotFoundError(G,he){return"Invalid grammar, reference to a rule which is not defined: ->"+he.nonTerminalName+`<-
inside top level rule: ->`+G.name+"<-"}},wg={buildDuplicateFoundError(G,he){function fe(so){if(so instanceof uh)return so.terminalType.name;else if(so instanceof _p)return so.nonTerminalName;else return""}let Fe=G.name,tt=mp(he),yt=tt.idx,Bt=Vx(tt),Rt=fe(tt),Xt=yt>0,Hn=`->${Bt}${Xt?yt:""}<- ${Rt?`with argument: ->${Rt}<-`:""}
                  appears more than once (${he.length} times) in the top level rule: ->${Fe}<-.                  
                  For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES 
                  `;return Hn=Hn.replace(/[ \t]+/g," "),Hn=Hn.replace(/\s\s+/g,`
`),Hn},buildNamespaceConflictError(G){return`Namespace conflict found in grammar.
The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${G.name}>.
To resolve this make sure each Terminal and Non-Terminal names are unique
This is easy to accomplish by using the convention that Terminal names start with an uppercase letter
and Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError(G){let he=Ur(G.prefixPath,(tt)=>Z8(tt)).join(", "),fe=G.alternation.idx===0?"":G.alternation.idx;return`Ambiguous alternatives: <${G.ambiguityIndices.join(" ,")}> due to common lookahead prefix
in <OR${fe}> inside <${G.topLevelRule.name}> Rule,
<${he}> may appears as a prefix path in all these alternatives.
See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX
For Further details.`},buildAlternationAmbiguityError(G){let he=Ur(G.prefixPath,(tt)=>Z8(tt)).join(", "),fe=G.alternation.idx===0?"":G.alternation.idx,Fe=`Ambiguous Alternatives Detected: <${G.ambiguityIndices.join(" ,")}> in <OR${fe}> inside <${G.topLevelRule.name}> Rule,
<${he}> may appears as a prefix path in all these alternatives.
`;return Fe=Fe+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
For Further details.`,Fe},buildEmptyRepetitionError(G){let he=Vx(G.repetition);if(G.repetition.idx!==0)he+=G.repetition.idx;return`The repetition <${he}> within Rule <${G.topLevelRule.name}> can never consume any tokens.
This could lead to an infinite loop.`},buildTokenNameError(G){return"deprecated"},buildEmptyAlternationError(G){return`Ambiguous empty alternative: <${G.emptyChoiceIdx+1}> in <OR${G.alternation.idx}> inside <${G.topLevelRule.name}> Rule.
Only the last alternative may be an empty alternative.`},buildTooManyAlternativesError(G){return`An Alternation cannot have more than 256 alternatives:
<OR${G.alternation.idx}> inside <${G.topLevelRule.name}> Rule.
 has ${G.alternation.definition.length+1} alternatives.`},buildLeftRecursionError(G){let he=G.topLevelRule.name,fe=Ur(G.leftRecursionPath,(yt)=>yt.name),Fe=`${he} --> ${fe.concat([he]).join(" --> ")}`;return`Left Recursion found in grammar.
rule: <${he}> can be invoked from itself (directly or indirectly)
without consuming any Tokens. The grammar path that causes this is: 
 ${Fe}
 To fix this refactor your grammar to remove the left recursion.
see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(G){return"deprecated"},buildDuplicateRuleNameError(G){let he;if(G.topLevelRule instanceof XC)he=G.topLevelRule.name;else he=G.topLevelRule;return`Duplicate definition, rule: ->${he}<- is already defined in the grammar: ->${G.grammarName}<-`}};function KI(G,he){let fe=new Xf(G,he);return fe.resolveRefs(),fe.errors}class Xf extends jC{constructor(G,he){super();this.nameToTopRule=G,this.errMsgProvider=he,this.errors=[]}resolveRefs(){Vi(fu(this.nameToTopRule),(G)=>{this.currTopLevel=G,G.accept(this)})}visitNonTerminal(G){let he=this.nameToTopRule[G.nonTerminalName];if(!he){let fe=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,G);this.errors.push({message:fe,type:Iu.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:G.nonTerminalName})}else G.referencedRule=he}}class nb extends KC{constructor(G,he){super();this.topProd=G,this.path=he,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=up(this.path.ruleStack).reverse(),this.occurrenceStack=up(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(G,he=[]){if(!this.found)super.walk(G,he)}walkProdRef(G,he,fe){if(G.referencedRule.name===this.nextProductionName&&G.idx===this.nextProductionOccurrence){let Fe=he.concat(fe);this.updateExpectedNext(),this.walk(G.referencedRule,Fe)}}updateExpectedNext(){if(dh(this.ruleStack))this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0;else this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop()}}class wF extends nb{constructor(G,he){super(G,he);this.path=he,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(G,he,fe){if(this.isAtEndOfPath&&G.terminalType.name===this.nextTerminalName&&G.idx===this.nextTerminalOccurrence&&!this.found){let Fe=he.concat(fe),tt=new fd({definition:Fe});this.possibleTokTypes=LI(tt),this.found=!0}}}class SA extends KC{constructor(G,he){super();this.topRule=G,this.occurrence=he,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}}class jf extends SA{walkMany(G,he,fe){if(G.idx===this.occurrence){let Fe=mp(he.concat(fe));if(this.result.isEndOfRule=Fe===void 0,Fe instanceof uh)this.result.token=Fe.terminalType,this.result.occurrence=Fe.idx}else super.walkMany(G,he,fe)}}class Sc extends SA{walkManySep(G,he,fe){if(G.idx===this.occurrence){let Fe=mp(he.concat(fe));if(this.result.isEndOfRule=Fe===void 0,Fe instanceof uh)this.result.token=Fe.terminalType,this.result.occurrence=Fe.idx}else super.walkManySep(G,he,fe)}}class Cu extends SA{walkAtLeastOne(G,he,fe){if(G.idx===this.occurrence){let Fe=mp(he.concat(fe));if(this.result.isEndOfRule=Fe===void 0,Fe instanceof uh)this.result.token=Fe.terminalType,this.result.occurrence=Fe.idx}else super.walkAtLeastOne(G,he,fe)}}class $a extends SA{walkAtLeastOneSep(G,he,fe){if(G.idx===this.occurrence){let Fe=mp(he.concat(fe));if(this.result.isEndOfRule=Fe===void 0,Fe instanceof uh)this.result.token=Fe.terminalType,this.result.occurrence=Fe.idx}else super.walkAtLeastOneSep(G,he,fe)}}function xy(G,he,fe=[]){fe=up(fe);let Fe=[],tt=0;function yt(Rt){return Rt.concat(Xd(G,tt+1))}function Bt(Rt){let Xt=xy(yt(Rt),he,fe);return Fe.concat(Xt)}while(fe.length<he&&tt<G.length){let Rt=G[tt];if(Rt instanceof fd)return Bt(Rt.definition);else if(Rt instanceof _p)return Bt(Rt.definition);else if(Rt instanceof jd)Fe=Bt(Rt.definition);else if(Rt instanceof Gf){let Xt=Rt.definition.concat([new xu({definition:Rt.definition})]);return Bt(Xt)}else if(Rt instanceof Uf){let Xt=[new fd({definition:Rt.definition}),new xu({definition:[new uh({terminalType:Rt.separator})].concat(Rt.definition)})];return Bt(Xt)}else if(Rt instanceof Sm){let Xt=Rt.definition.concat([new xu({definition:[new uh({terminalType:Rt.separator})].concat(Rt.definition)})]);Fe=Bt(Xt)}else if(Rt instanceof xu){let Xt=Rt.definition.concat([new xu({definition:Rt.definition})]);Fe=Bt(Xt)}else if(Rt instanceof vA)return Vi(Rt.definition,(Xt)=>{if(dh(Xt.definition)===!1)Fe=Bt(Xt.definition)}),Fe;else if(Rt instanceof uh)fe.push(Rt.terminalType);else throw Error("non exhaustive match");tt++}return Fe.push({partialPath:fe,suffixDef:Xd(G,tt)}),Fe}function bu(G,he,fe,Fe){let yt=["EXIT_NONE_TERMINAL"],Bt="EXIT_ALTERNATIVE",Rt=!1,Xt=he.length,Hn=Xt-Fe-1,so=[],So=[];So.push({idx:-1,def:G,ruleStack:[],occurrenceStack:[]});while(!dh(So)){let nr=So.pop();if(nr==="EXIT_ALTERNATIVE"){if(Rt&&Q4(So).idx<=Hn)So.pop();continue}let{def:Rr,idx:Yi,ruleStack:li,occurrenceStack:zr}=nr;if(dh(Rr))continue;let Pr=Rr[0];if(Pr==="EXIT_NONE_TERMINAL"){let Eo={idx:Yi,def:Xd(Rr),ruleStack:H8(li),occurrenceStack:H8(zr)};So.push(Eo)}else if(Pr instanceof uh)if(Yi<Xt-1){let Eo=Yi+1,Fo=he[Eo];if(fe(Fo,Pr.terminalType)){let ks={idx:Eo,def:Xd(Rr),ruleStack:li,occurrenceStack:zr};So.push(ks)}}else if(Yi===Xt-1)so.push({nextTokenType:Pr.terminalType,nextTokenOccurrence:Pr.idx,ruleStack:li,occurrenceStack:zr}),Rt=!0;else throw Error("non exhaustive match");else if(Pr instanceof _p){let Eo=up(li);Eo.push(Pr.nonTerminalName);let Fo=up(zr);Fo.push(Pr.idx);let ks={idx:Yi,def:Pr.definition.concat(yt,Xd(Rr)),ruleStack:Eo,occurrenceStack:Fo};So.push(ks)}else if(Pr instanceof jd){let Eo={idx:Yi,def:Xd(Rr),ruleStack:li,occurrenceStack:zr};So.push(Eo),So.push("EXIT_ALTERNATIVE");let Fo={idx:Yi,def:Pr.definition.concat(Xd(Rr)),ruleStack:li,occurrenceStack:zr};So.push(Fo)}else if(Pr instanceof Gf){let Eo=new xu({definition:Pr.definition,idx:Pr.idx}),Fo=Pr.definition.concat([Eo],Xd(Rr)),ks={idx:Yi,def:Fo,ruleStack:li,occurrenceStack:zr};So.push(ks)}else if(Pr instanceof Uf){let Eo=new uh({terminalType:Pr.separator}),Fo=new xu({definition:[Eo].concat(Pr.definition),idx:Pr.idx}),ks=Pr.definition.concat([Fo],Xd(Rr)),ph={idx:Yi,def:ks,ruleStack:li,occurrenceStack:zr};So.push(ph)}else if(Pr instanceof Sm){let Eo={idx:Yi,def:Xd(Rr),ruleStack:li,occurrenceStack:zr};So.push(Eo),So.push("EXIT_ALTERNATIVE");let Fo=new uh({terminalType:Pr.separator}),ks=new xu({definition:[Fo].concat(Pr.definition),idx:Pr.idx}),ph=Pr.definition.concat([ks],Xd(Rr)),Yp={idx:Yi,def:ph,ruleStack:li,occurrenceStack:zr};So.push(Yp)}else if(Pr instanceof xu){let Eo={idx:Yi,def:Xd(Rr),ruleStack:li,occurrenceStack:zr};So.push(Eo),So.push("EXIT_ALTERNATIVE");let Fo=new xu({definition:Pr.definition,idx:Pr.idx}),ks=Pr.definition.concat([Fo],Xd(Rr)),ph={idx:Yi,def:ks,ruleStack:li,occurrenceStack:zr};So.push(ph)}else if(Pr instanceof vA)for(let Eo=Pr.definition.length-1;Eo>=0;Eo--){let Fo=Pr.definition[Eo],ks={idx:Yi,def:Fo.definition.concat(Xd(Rr)),ruleStack:li,occurrenceStack:zr};So.push(ks),So.push("EXIT_ALTERNATIVE")}else if(Pr instanceof fd)So.push({idx:Yi,def:Pr.definition.concat(Xd(Rr)),ruleStack:li,occurrenceStack:zr});else if(Pr instanceof XC)So.push(ob(Pr,Yi,li,zr));else throw Error("non exhaustive match")}return so}function ob(G,he,fe,Fe){let tt=up(fe);tt.push(G.name);let yt=up(Fe);return yt.push(1),{idx:he,def:G.definition,ruleStack:tt,occurrenceStack:yt}}var La;(function(G){G[G.OPTION=0]="OPTION",G[G.REPETITION=1]="REPETITION",G[G.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",G[G.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",G[G.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",G[G.ALTERNATION=5]="ALTERNATION"})(La||(La={}));function TM(G){if(G instanceof jd||G==="Option")return La.OPTION;else if(G instanceof xu||G==="Repetition")return La.REPETITION;else if(G instanceof Gf||G==="RepetitionMandatory")return La.REPETITION_MANDATORY;else if(G instanceof Uf||G==="RepetitionMandatoryWithSeparator")return La.REPETITION_MANDATORY_WITH_SEPARATOR;else if(G instanceof Sm||G==="RepetitionWithSeparator")return La.REPETITION_WITH_SEPARATOR;else if(G instanceof vA||G==="Alternation")return La.ALTERNATION;else throw Error("non exhaustive match")}function xl(G,he,fe,Fe,tt,yt){let Bt=qI(G,he,fe),Rt=TF(Bt)?$8:XI;return yt(Bt,Fe,Rt,tt)}function BF(G,he,fe,Fe,tt,yt){let Bt=Wx(G,he,tt,fe),Rt=TF(Bt)?$8:XI;return yt(Bt[0],Rt,Fe)}function Vp(G,he,fe,Fe){let tt=G.length,yt=IA(G,(Bt)=>IA(Bt,(Rt)=>Rt.length===1));if(he)return function(Bt){let Rt=Ur(Bt,(Xt)=>Xt.GATE);for(let Xt=0;Xt<tt;Xt++){let Hn=G[Xt],so=Hn.length,So=Rt[Xt];if(So!==void 0&&So.call(this)===!1)continue;e:for(let nr=0;nr<so;nr++){let Rr=Hn[nr],Yi=Rr.length;for(let li=0;li<Yi;li++){let zr=this.LA(li+1);if(fe(zr,Rr[li])===!1)continue e}return Xt}}return};else if(yt&&!Fe){let Bt=Ur(G,(Xt)=>Ea(Xt)),Rt=c0(Bt,(Xt,Hn,so)=>(Vi(Hn,(So)=>{if(!bi(Xt,So.tokenTypeIdx))Xt[So.tokenTypeIdx]=so;Vi(So.categoryMatches,(nr)=>{if(!bi(Xt,nr))Xt[nr]=so})}),Xt),{});return function(){let Xt=this.LA(1);return Rt[Xt.tokenTypeIdx]}}else return function(){for(let Bt=0;Bt<tt;Bt++){let Rt=G[Bt],Xt=Rt.length;e:for(let Hn=0;Hn<Xt;Hn++){let so=Rt[Hn],So=so.length;for(let nr=0;nr<So;nr++){let Rr=this.LA(nr+1);if(fe(Rr,so[nr])===!1)continue e}return Bt}}return}}function foe(G,he,fe){let Fe=IA(G,(yt)=>yt.length===1),tt=G.length;if(Fe&&!fe){let yt=Ea(G);if(yt.length===1&&dh(yt[0].categoryMatches)){let Rt=yt[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===Rt}}else{let Bt=c0(yt,(Rt,Xt,Hn)=>(Rt[Xt.tokenTypeIdx]=!0,Vi(Xt.categoryMatches,(so)=>{Rt[so]=!0}),Rt),[]);return function(){let Rt=this.LA(1);return Bt[Rt.tokenTypeIdx]===!0}}}else return function(){e:for(let yt=0;yt<tt;yt++){let Bt=G[yt],Rt=Bt.length;for(let Xt=0;Xt<Rt;Xt++){let Hn=this.LA(Xt+1);if(he(Hn,Bt[Xt])===!1)continue e}return!0}return!1}}class Mm extends KC{constructor(G,he,fe){super();this.topProd=G,this.targetOccurrence=he,this.targetProdType=fe}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(G,he,fe,Fe){if(G.idx===this.targetOccurrence&&this.targetProdType===he)return this.restDef=fe.concat(Fe),!0;return!1}walkOption(G,he,fe){if(!this.checkIsTarget(G,La.OPTION,he,fe))super.walkOption(G,he,fe)}walkAtLeastOne(G,he,fe){if(!this.checkIsTarget(G,La.REPETITION_MANDATORY,he,fe))super.walkOption(G,he,fe)}walkAtLeastOneSep(G,he,fe){if(!this.checkIsTarget(G,La.REPETITION_MANDATORY_WITH_SEPARATOR,he,fe))super.walkOption(G,he,fe)}walkMany(G,he,fe){if(!this.checkIsTarget(G,La.REPETITION,he,fe))super.walkOption(G,he,fe)}walkManySep(G,he,fe){if(!this.checkIsTarget(G,La.REPETITION_WITH_SEPARATOR,he,fe))super.walkOption(G,he,fe)}}class Cl extends jC{constructor(G,he,fe){super();this.targetOccurrence=G,this.targetProdType=he,this.targetRef=fe,this.result=[]}checkIsTarget(G,he){if(G.idx===this.targetOccurrence&&this.targetProdType===he&&(this.targetRef===void 0||G===this.targetRef))this.result=G.definition}visitOption(G){this.checkIsTarget(G,La.OPTION)}visitRepetition(G){this.checkIsTarget(G,La.REPETITION)}visitRepetitionMandatory(G){this.checkIsTarget(G,La.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(G){this.checkIsTarget(G,La.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(G){this.checkIsTarget(G,La.REPETITION_WITH_SEPARATOR)}visitAlternation(G){this.checkIsTarget(G,La.ALTERNATION)}}function o7(G){let he=Array(G);for(let fe=0;fe<G;fe++)he[fe]=[];return he}function __(G){let he=[""];for(let fe=0;fe<G.length;fe++){let Fe=G[fe],tt=[];for(let yt=0;yt<he.length;yt++){let Bt=he[yt];tt.push(Bt+"_"+Fe.tokenTypeIdx);for(let Rt=0;Rt<Fe.categoryMatches.length;Rt++){let Xt="_"+Fe.categoryMatches[Rt];tt.push(Bt+Xt)}}he=tt}return he}function gN(G,he,fe){for(let Fe=0;Fe<G.length;Fe++){if(Fe===fe)continue;let tt=G[Fe];for(let yt=0;yt<he.length;yt++){let Bt=he[yt];if(tt[Bt]===!0)return!1}}return!0}function $I(G,he){let fe=Ur(G,(Bt)=>xy([Bt],1)),Fe=o7(fe.length),tt=Ur(fe,(Bt)=>{let Rt={};return Vi(Bt,(Xt)=>{let Hn=__(Xt.partialPath);Vi(Hn,(so)=>{Rt[so]=!0})}),Rt}),yt=fe;for(let Bt=1;Bt<=he;Bt++){let Rt=yt;yt=o7(Rt.length);for(let Xt=0;Xt<Rt.length;Xt++){let Hn=Rt[Xt];for(let so=0;so<Hn.length;so++){let So=Hn[so].partialPath,nr=Hn[so].suffixDef,Rr=__(So);if(gN(tt,Rr,Xt)||dh(nr)||So.length===he){let li=Fe[Xt];if(H4(li,So)===!1){li.push(So);for(let zr=0;zr<Rr.length;zr++){let Pr=Rr[zr];tt[Xt][Pr]=!0}}}else{let li=xy(nr,Bt+1,So);yt[Xt]=yt[Xt].concat(li),Vi(li,(zr)=>{let Pr=__(zr.partialPath);Vi(Pr,(Eo)=>{tt[Xt][Eo]=!0})})}}}}return Fe}function qI(G,he,fe,Fe){let tt=new Cl(G,La.ALTERNATION,Fe);return he.accept(tt),$I(tt.result,fe)}function Wx(G,he,fe,Fe){let tt=new Cl(G,fe);he.accept(tt);let yt=tt.result,Rt=new Mm(he,G,fe).startWalking(),Xt=new fd({definition:yt}),Hn=new fd({definition:Rt});return $I([Xt,Hn],Fe)}function H4(G,he){e:for(let fe=0;fe<G.length;fe++){let Fe=G[fe];if(Fe.length!==he.length)continue;for(let tt=0;tt<Fe.length;tt++){let yt=he[tt],Bt=Fe[tt];if((yt===Bt||Bt.categoryMatchesMap[yt.tokenTypeIdx]!==void 0)===!1)continue e}return!0}return!1}function yoe(G,he){return G.length<he.length&&IA(G,(fe,Fe)=>{let tt=he[Fe];return fe===tt||tt.categoryMatchesMap[fe.tokenTypeIdx]})}function TF(G){return IA(G,(he)=>IA(he,(fe)=>IA(fe,(Fe)=>dh(Fe.categoryMatches))))}function xoe(G){let he=G.lookaheadStrategy.validate({rules:G.rules,tokenTypes:G.tokenTypes,grammarName:G.grammarName});return Ur(he,(fe)=>Object.assign({type:Iu.CUSTOM_LOOKAHEAD_VALIDATION},fe))}function Dh(G,he,fe,Fe){let tt=vg(G,(Xt)=>JI(Xt,fe)),yt=e9(G,he,fe),Bt=vg(G,(Xt)=>ZI(Xt,fe)),Rt=vg(G,(Xt)=>r7(Xt,G,Fe,fe));return tt.concat(yt,Bt,Rt)}function JI(G,he){let fe=new rb;G.accept(fe);let Fe=fe.allProductions,tt=dy(Fe,DM),yt=ql(tt,(Rt)=>Rt.length>1);return Ur(fu(yt),(Rt)=>{let Xt=mp(Rt),Hn=he.buildDuplicateFoundError(G,Rt),so=Vx(Xt),So={message:Hn,type:Iu.DUPLICATE_PRODUCTIONS,ruleName:G.name,dslName:so,occurrence:Xt.idx},nr=g_(Xt);if(nr)So.parameter=nr;return So})}function DM(G){return`${Vx(G)}_#_${G.idx}_#_${g_(G)}`}function g_(G){if(G instanceof uh)return G.terminalType.name;else if(G instanceof _p)return G.nonTerminalName;else return""}class rb extends jC{constructor(){super(...arguments);this.allProductions=[]}visitNonTerminal(G){this.allProductions.push(G)}visitOption(G){this.allProductions.push(G)}visitRepetitionWithSeparator(G){this.allProductions.push(G)}visitRepetitionMandatory(G){this.allProductions.push(G)}visitRepetitionMandatoryWithSeparator(G){this.allProductions.push(G)}visitRepetition(G){this.allProductions.push(G)}visitAlternation(G){this.allProductions.push(G)}visitTerminal(G){this.allProductions.push(G)}}function r7(G,he,fe,Fe){let tt=[];if(c0(he,(Bt,Rt)=>{if(Rt.name===G.name)return Bt+1;return Bt},0)>1){let Bt=Fe.buildDuplicateRuleNameError({topLevelRule:G,grammarName:fe});tt.push({message:Bt,type:Iu.DUPLICATE_RULE_NAME,ruleName:G.name})}return tt}function AN(G,he,fe){let Fe=[],tt;if(!Kc(he,G))tt=`Invalid rule override, rule: ->${G}<- cannot be overridden in the grammar: ->${fe}<-as it is not defined in any of the super grammars `,Fe.push({message:tt,type:Iu.INVALID_RULE_OVERRIDE,ruleName:G});return Fe}function F4(G,he,fe,Fe=[]){let tt=[],yt=Kf(he.definition);if(dh(yt))return[];else{let Bt=G.name;if(Kc(yt,G))tt.push({message:fe.buildLeftRecursionError({topLevelRule:G,leftRecursionPath:Fe}),type:Iu.LEFT_RECURSION,ruleName:Bt});let Xt=hy(yt,Fe.concat([G])),Hn=vg(Xt,(so)=>{let So=up(Fe);return So.push(so),F4(G,so,fe,So)});return tt.concat(Hn)}}function Kf(G){let he=[];if(dh(G))return he;let fe=mp(G);if(fe instanceof _p)he.push(fe.referencedRule);else if(fe instanceof fd||fe instanceof jd||fe instanceof Gf||fe instanceof Uf||fe instanceof Sm||fe instanceof xu)he=he.concat(Kf(fe.definition));else if(fe instanceof vA)he=Ea(Ur(fe.definition,(yt)=>Kf(yt.definition)));else if(fe instanceof uh);else throw Error("non exhaustive match");let Fe=IM(fe),tt=G.length>1;if(Fe&&tt){let yt=Xd(G);return he.concat(Kf(yt))}else return he}class i7 extends jC{constructor(){super(...arguments);this.alternations=[]}visitAlternation(G){this.alternations.push(G)}}function DF(G,he){let fe=new i7;G.accept(fe);let Fe=fe.alternations;return vg(Fe,(yt)=>{let Bt=H8(yt.definition);return vg(Bt,(Rt,Xt)=>{let Hn=bu([Rt],[],XI,1);if(dh(Hn))return[{message:he.buildEmptyAlternationError({topLevelRule:G,alternation:yt,emptyChoiceIdx:Xt}),type:Iu.NONE_LAST_EMPTY_ALT,ruleName:G.name,occurrence:yt.idx,alternative:Xt+1}];else return[]})})}function fN(G,he,fe){let Fe=new i7;G.accept(Fe);let tt=Fe.alternations;return tt=Sg(tt,(Bt)=>Bt.ignoreAmbiguities===!0),vg(tt,(Bt)=>{let Rt=Bt.idx,Xt=Bt.maxLookahead||he,Hn=qI(Rt,G,Xt,Bt),so=s7(Hn,Bt,G,fe),So=Xx(Hn,Bt,G,fe);return so.concat(So)})}class yN extends jC{constructor(){super(...arguments);this.allProductions=[]}visitRepetitionWithSeparator(G){this.allProductions.push(G)}visitRepetitionMandatory(G){this.allProductions.push(G)}visitRepetitionMandatoryWithSeparator(G){this.allProductions.push(G)}visitRepetition(G){this.allProductions.push(G)}}function ZI(G,he){let fe=new i7;G.accept(fe);let Fe=fe.alternations;return vg(Fe,(yt)=>{if(yt.definition.length>255)return[{message:he.buildTooManyAlternativesError({topLevelRule:G,alternation:yt}),type:Iu.TOO_MANY_ALTS,ruleName:G.name,occurrence:yt.idx}];else return[]})}function NF(G,he,fe){let Fe=[];return Vi(G,(tt)=>{let yt=new yN;tt.accept(yt);let Bt=yt.allProductions;Vi(Bt,(Rt)=>{let Xt=TM(Rt),Hn=Rt.maxLookahead||he,so=Rt.idx,nr=Wx(so,tt,Xt,Hn)[0];if(dh(Ea(nr))){let Rr=fe.buildEmptyRepetitionError({topLevelRule:tt,repetition:Rt});Fe.push({message:Rr,type:Iu.NO_NON_EMPTY_LOOKAHEAD,ruleName:tt.name})}})}),Fe}function s7(G,he,fe,Fe){let tt=[],yt=c0(G,(Rt,Xt,Hn)=>{if(he.definition[Hn].ignoreAmbiguities===!0)return Rt;return Vi(Xt,(so)=>{let So=[Hn];if(Vi(G,(nr,Rr)=>{if(Hn!==Rr&&H4(nr,so)&&he.definition[Rr].ignoreAmbiguities!==!0)So.push(Rr)}),So.length>1&&!H4(tt,so))tt.push(so),Rt.push({alts:So,path:so})}),Rt},[]);return Ur(yt,(Rt)=>{let Xt=Ur(Rt.alts,(so)=>so+1);return{message:Fe.buildAlternationAmbiguityError({topLevelRule:fe,alternation:he,ambiguityIndices:Xt,prefixPath:Rt.path}),type:Iu.AMBIGUOUS_ALTS,ruleName:fe.name,occurrence:he.idx,alternatives:Rt.alts}})}function Xx(G,he,fe,Fe){let tt=c0(G,(Bt,Rt,Xt)=>{let Hn=Ur(Rt,(so)=>({idx:Xt,path:so}));return Bt.concat(Hn)},[]);return ly(vg(tt,(Bt)=>{if(he.definition[Bt.idx].ignoreAmbiguities===!0)return[];let{idx:Xt,path:Hn}=Bt,so=Ig(tt,(nr)=>he.definition[nr.idx].ignoreAmbiguities!==!0&&nr.idx<Xt&&yoe(nr.path,Hn));return Ur(so,(nr)=>{let Rr=[nr.idx+1,Xt+1],Yi=he.idx===0?"":he.idx;return{message:Fe.buildAlternationPrefixAmbiguityError({topLevelRule:fe,alternation:he,ambiguityIndices:Rr,prefixPath:nr.path}),type:Iu.AMBIGUOUS_PREFIX_ALTS,ruleName:fe.name,occurrence:Yi,alternatives:Rr}})}))}function e9(G,he,fe){let Fe=[],tt=Ur(he,(yt)=>yt.name);return Vi(G,(yt)=>{let Bt=yt.name;if(Kc(tt,Bt)){let Rt=fe.buildNamespaceConflictError(yt);Fe.push({message:Rt,type:Iu.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:Bt})}}),Fe}function a7(G){let he=yM(G,{errMsgProvider:yy}),fe={};return Vi(G.rules,(Fe)=>{fe[Fe.name]=Fe}),KI(fe,he.errMsgProvider)}function RF(G){return G=yM(G,{errMsgProvider:wg}),Dh(G.rules,G.tokenTypes,G.errMsgProvider,G.grammarName)}let z4="MismatchedTokenException",wW="NoViableAltException",K2="EarlyExitException",c7="NotAllInputParsedException",l7=[z4,wW,K2,c7];Object.freeze(l7);function ib(G){return Kc(l7,G.name)}class O4 extends Error{constructor(G,he){super(G);if(this.token=he,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor)}}class t9 extends O4{constructor(G,he,fe){super(G,he);this.previousToken=fe,this.name=z4}}class n9 extends O4{constructor(G,he,fe){super(G,he);this.previousToken=fe,this.name=wW}}class V4 extends O4{constructor(G,he){super(G,he);this.name=c7}}class h7 extends O4{constructor(G,he,fe){super(G,he);this.previousToken=fe,this.name=K2}}let d7={},u7="InRuleRecoveryException";class xN extends Error{constructor(G){super(G);this.name=u7}}class NM{initRecoverable(G){if(this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=bi(G,"recoveryEnabled")?G.recoveryEnabled:u0.recoveryEnabled,this.recoveryEnabled)this.attemptInRepetitionRecovery=CN}getTokenToInsert(G){let he=Mg(G,"",NaN,NaN,NaN,NaN,NaN,NaN);return he.isInsertedInRecovery=!0,he}canTokenTypeBeInsertedInRecovery(G){return!0}canTokenTypeBeDeletedInRecovery(G){return!0}tryInRepetitionRecovery(G,he,fe,Fe){let tt=this.findReSyncTokenType(),yt=this.exportLexerState(),Bt=[],Rt=!1,Xt=this.LA(1),Hn=this.LA(1),so=()=>{let So=this.LA(0),nr=this.errorMessageProvider.buildMismatchTokenMessage({expected:Fe,actual:Xt,previous:So,ruleName:this.getCurrRuleFullName()}),Rr=new t9(nr,Xt,this.LA(0));Rr.resyncedTokens=H8(Bt),this.SAVE_ERROR(Rr)};while(!Rt)if(this.tokenMatcher(Hn,Fe)){so();return}else if(fe.call(this)){so(),G.apply(this,he);return}else if(this.tokenMatcher(Hn,tt))Rt=!0;else Hn=this.SKIP_TOKEN(),this.addToResyncTokens(Hn,Bt);this.importLexerState(yt)}shouldInRepetitionRecoveryBeTried(G,he,fe){if(fe===!1)return!1;if(this.tokenMatcher(this.LA(1),G))return!1;if(this.isBackTracking())return!1;if(this.canPerformInRuleRecovery(G,this.getFollowsForInRuleRecovery(G,he)))return!1;return!0}getFollowsForInRuleRecovery(G,he){let fe=this.getCurrentGrammarPath(G,he);return this.getNextPossibleTokenTypes(fe)}tryInRuleRecovery(G,he){if(this.canRecoverWithSingleTokenInsertion(G,he))return this.getTokenToInsert(G);if(this.canRecoverWithSingleTokenDeletion(G)){let fe=this.SKIP_TOKEN();return this.consumeToken(),fe}throw new xN("sad sad panda")}canPerformInRuleRecovery(G,he){return this.canRecoverWithSingleTokenInsertion(G,he)||this.canRecoverWithSingleTokenDeletion(G)}canRecoverWithSingleTokenInsertion(G,he){if(!this.canTokenTypeBeInsertedInRecovery(G))return!1;if(dh(he))return!1;let fe=this.LA(1);return TI(he,(tt)=>this.tokenMatcher(fe,tt))!==void 0}canRecoverWithSingleTokenDeletion(G){if(!this.canTokenTypeBeDeletedInRecovery(G))return!1;return this.tokenMatcher(this.LA(2),G)}isInCurrentRuleReSyncSet(G){let he=this.getCurrFollowKey(),fe=this.getFollowSetFromFollowKey(he);return Kc(fe,G)}findReSyncTokenType(){let G=this.flattenFollowSet(),he=this.LA(1),fe=2;while(!0){let Fe=TI(G,(tt)=>Xs(he,tt));if(Fe!==void 0)return Fe;he=this.LA(fe),fe++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return d7;let G=this.getLastExplicitRuleShortName(),he=this.getLastExplicitRuleOccurrenceIndex(),fe=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(G),idxInCallingRule:he,inRule:this.shortRuleNameToFullName(fe)}}buildFullFollowKeyStack(){let G=this.RULE_STACK,he=this.RULE_OCCURRENCE_STACK;return Ur(G,(fe,Fe)=>{if(Fe===0)return d7;return{ruleName:this.shortRuleNameToFullName(fe),idxInCallingRule:he[Fe],inRule:this.shortRuleNameToFullName(G[Fe-1])}})}flattenFollowSet(){let G=Ur(this.buildFullFollowKeyStack(),(he)=>this.getFollowSetFromFollowKey(he));return Ea(G)}getFollowSetFromFollowKey(G){if(G===d7)return[h0];let he=G.ruleName+G.idxInCallingRule+O2+G.inRule;return this.resyncFollows[he]}addToResyncTokens(G,he){if(!this.tokenMatcher(G,h0))he.push(G);return he}reSyncTo(G){let he=[],fe=this.LA(1);while(this.tokenMatcher(fe,G)===!1)fe=this.SKIP_TOKEN(),this.addToResyncTokens(fe,he);return H8(he)}attemptInRepetitionRecovery(G,he,fe,Fe,tt,yt,Bt){}getCurrentGrammarPath(G,he){let fe=this.getHumanReadableRuleStack(),Fe=up(this.RULE_OCCURRENCE_STACK);return{ruleStack:fe,occurrenceStack:Fe,lastTok:G,lastTokOccurrence:he}}getHumanReadableRuleStack(){return Ur(this.RULE_STACK,(G)=>this.shortRuleNameToFullName(G))}}function CN(G,he,fe,Fe,tt,yt,Bt){let Rt=this.getKeyForAutomaticLookahead(Fe,tt),Xt=this.firstAfterRepMap[Rt];if(Xt===void 0){let nr=this.getCurrRuleFullName(),Rr=this.getGAstProductions()[nr];Xt=new yt(Rr,tt).startWalking(),this.firstAfterRepMap[Rt]=Xt}let Hn=Xt.token,so=Xt.occurrence,So=Xt.isEndOfRule;if(this.RULE_STACK.length===1&&So&&Hn===void 0)Hn=h0,so=1;if(Hn===void 0||so===void 0)return;if(this.shouldInRepetitionRecoveryBeTried(Hn,so,Bt))this.tryInRepetitionRecovery(G,he,fe,Hn)}let p7=4,wm=8,PA=1<<wm,$h=2<<wm,Bm=3<<wm,Ap=4<<wm,Nh=5<<wm,A_=6<<wm;function Y4(G,he,fe){return fe|he|G}class RM{constructor(G){var he;this.maxLookahead=(he=G===null||G===void 0?void 0:G.maxLookahead)!==null&&he!==void 0?he:u0.maxLookahead}validate(G){let he=this.validateNoLeftRecursion(G.rules);if(dh(he)){let fe=this.validateEmptyOrAlternatives(G.rules),Fe=this.validateAmbiguousAlternationAlternatives(G.rules,this.maxLookahead),tt=this.validateSomeNonEmptyLookaheadPath(G.rules,this.maxLookahead);return[...he,...fe,...Fe,...tt]}return he}validateNoLeftRecursion(G){return vg(G,(he)=>F4(he,he,wg))}validateEmptyOrAlternatives(G){return vg(G,(he)=>DF(he,wg))}validateAmbiguousAlternationAlternatives(G,he){return vg(G,(fe)=>fN(fe,he,wg))}validateSomeNonEmptyLookaheadPath(G,he){return NF(G,he,wg)}buildLookaheadForAlternation(G){return xl(G.prodOccurrence,G.rule,G.maxLookahead,G.hasPredicates,G.dynamicTokensEnabled,Vp)}buildLookaheadForOptional(G){return BF(G.prodOccurrence,G.rule,G.maxLookahead,G.dynamicTokensEnabled,TM(G.prodType),foe)}}class QM{initLooksAhead(G){this.dynamicTokensEnabled=bi(G,"dynamicTokensEnabled")?G.dynamicTokensEnabled:u0.dynamicTokensEnabled,this.maxLookahead=bi(G,"maxLookahead")?G.maxLookahead:u0.maxLookahead,this.lookaheadStrategy=bi(G,"lookaheadStrategy")?G.lookaheadStrategy:new RM({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(G){Vi(G,(he)=>{this.TRACE_INIT(`${he.name} Rule Lookahead`,()=>{let{alternation:fe,repetition:Fe,option:tt,repetitionMandatory:yt,repetitionMandatoryWithSeparator:Bt,repetitionWithSeparator:Rt}=kF(he);Vi(fe,(Xt)=>{let Hn=Xt.idx===0?"":Xt.idx;this.TRACE_INIT(`${Vx(Xt)}${Hn}`,()=>{let so=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:Xt.idx,rule:he,maxLookahead:Xt.maxLookahead||this.maxLookahead,hasPredicates:Xt.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),So=Y4(this.fullRuleNameToShort[he.name],PA,Xt.idx);this.setLaFuncCache(So,so)})}),Vi(Fe,(Xt)=>{this.computeLookaheadFunc(he,Xt.idx,Bm,"Repetition",Xt.maxLookahead,Vx(Xt))}),Vi(tt,(Xt)=>{this.computeLookaheadFunc(he,Xt.idx,$h,"Option",Xt.maxLookahead,Vx(Xt))}),Vi(yt,(Xt)=>{this.computeLookaheadFunc(he,Xt.idx,Ap,"RepetitionMandatory",Xt.maxLookahead,Vx(Xt))}),Vi(Bt,(Xt)=>{this.computeLookaheadFunc(he,Xt.idx,A_,"RepetitionMandatoryWithSeparator",Xt.maxLookahead,Vx(Xt))}),Vi(Rt,(Xt)=>{this.computeLookaheadFunc(he,Xt.idx,Nh,"RepetitionWithSeparator",Xt.maxLookahead,Vx(Xt))})})})}computeLookaheadFunc(G,he,fe,Fe,tt,yt){this.TRACE_INIT(`${yt}${he===0?"":he}`,()=>{let Bt=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:he,rule:G,maxLookahead:tt||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:Fe}),Rt=Y4(this.fullRuleNameToShort[G.name],fe,he);this.setLaFuncCache(Rt,Bt)})}getKeyForAutomaticLookahead(G,he){let fe=this.getLastExplicitRuleShortName();return Y4(fe,G,he)}getLaFuncFromCache(G){return this.lookAheadFuncsCache.get(G)}setLaFuncCache(G,he){this.lookAheadFuncsCache.set(G,he)}}class QF extends jC{constructor(){super(...arguments);this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(G){this.dslMethods.option.push(G)}visitRepetitionWithSeparator(G){this.dslMethods.repetitionWithSeparator.push(G)}visitRepetitionMandatory(G){this.dslMethods.repetitionMandatory.push(G)}visitRepetitionMandatoryWithSeparator(G){this.dslMethods.repetitionMandatoryWithSeparator.push(G)}visitRepetition(G){this.dslMethods.repetition.push(G)}visitAlternation(G){this.dslMethods.alternation.push(G)}}let kM=new QF;function kF(G){kM.reset(),G.accept(kM);let he=kM.dslMethods;return kM.reset(),he}function G4(G,he){if(isNaN(G.startOffset)===!0)G.startOffset=he.startOffset,G.endOffset=he.endOffset;else if(G.endOffset<he.endOffset===!0)G.endOffset=he.endOffset}function LF(G,he){if(isNaN(G.startOffset)===!0)G.startOffset=he.startOffset,G.startColumn=he.startColumn,G.startLine=he.startLine,G.endOffset=he.endOffset,G.endColumn=he.endColumn,G.endLine=he.endLine;else if(G.endOffset<he.endOffset===!0)G.endOffset=he.endOffset,G.endColumn=he.endColumn,G.endLine=he.endLine}function HF(G,he,fe){if(G.children[fe]===void 0)G.children[fe]=[he];else G.children[fe].push(he)}function bN(G,he,fe){if(G.children[he]===void 0)G.children[he]=[fe];else G.children[he].push(fe)}let m7="name";function _7(G,he){Object.defineProperty(G,m7,{enumerable:!1,configurable:!0,writable:!1,value:he})}function o9(G,he){let fe=Ud(G),Fe=fe.length;for(let tt=0;tt<Fe;tt++){let yt=fe[tt],Bt=G[yt],Rt=Bt.length;for(let Xt=0;Xt<Rt;Xt++){let Hn=Bt[Xt];if(Hn.tokenTypeIdx===void 0)this[Hn.name](Hn.children,he)}}}function BW(G,he){let fe=function(){};_7(fe,G+"BaseSemantics");let Fe={visit:function(tt,yt){if(v(tt))tt=tt[0];if(Yf(tt))return;return this[tt.name](tt.children,yt)},validateVisitor:function(){let tt=TW(this,he);if(!dh(tt)){let yt=Ur(tt,(Bt)=>Bt.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:
	${yt.join(`

`).replace(/\n/g,`
	`)}`)}}};return fe.prototype=Fe,fe.prototype.constructor=fe,fe._RULE_NAMES=he,fe}function IN(G,he,fe){let Fe=function(){};_7(Fe,G+"BaseSemanticsWithDefaults");let tt=Object.create(fe.prototype);return Vi(he,(yt)=>{tt[yt]=o9}),Fe.prototype=tt,Fe.prototype.constructor=Fe,Fe}var LM;(function(G){G[G.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",G[G.MISSING_METHOD=1]="MISSING_METHOD"})(LM||(LM={}));function TW(G,he){return U4(G,he)}function U4(G,he){let fe=Ig(he,(tt)=>ue(G[tt])===!1),Fe=Ur(fe,(tt)=>({msg:`Missing visitor method: <${tt}> on ${G.constructor.name} CST Visitor.`,type:LM.MISSING_METHOD,methodName:tt}));return ly(Fe)}class Ji{initTreeBuilder(G){if(this.CST_STACK=[],this.outputCst=G.outputCst,this.nodeLocationTracking=bi(G,"nodeLocationTracking")?G.nodeLocationTracking:u0.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=ht,this.cstFinallyStateUpdate=ht,this.cstPostTerminal=ht,this.cstPostNonTerminal=ht,this.cstPostRule=ht;else if(/full/i.test(this.nodeLocationTracking))if(this.recoveryEnabled)this.setNodeLocationFromToken=LF,this.setNodeLocationFromNode=LF,this.cstPostRule=ht,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery;else this.setNodeLocationFromToken=ht,this.setNodeLocationFromNode=ht,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular;else if(/onlyOffset/i.test(this.nodeLocationTracking))if(this.recoveryEnabled)this.setNodeLocationFromToken=G4,this.setNodeLocationFromNode=G4,this.cstPostRule=ht,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery;else this.setNodeLocationFromToken=ht,this.setNodeLocationFromNode=ht,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular;else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=ht,this.setNodeLocationFromNode=ht,this.cstPostRule=ht,this.setInitialNodeLocation=ht;else throw Error(`Invalid <nodeLocationTracking> config option: "${G.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(G){G.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(G){G.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(G){G.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(G){let he=this.LA(1);G.location={startOffset:he.startOffset,startLine:he.startLine,startColumn:he.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(G){let he={name:G,children:Object.create(null)};this.setInitialNodeLocation(he),this.CST_STACK.push(he)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(G){let he=this.LA(0),fe=G.location;if(fe.startOffset<=he.startOffset===!0)fe.endOffset=he.endOffset,fe.endLine=he.endLine,fe.endColumn=he.endColumn;else fe.startOffset=NaN,fe.startLine=NaN,fe.startColumn=NaN}cstPostRuleOnlyOffset(G){let he=this.LA(0),fe=G.location;if(fe.startOffset<=he.startOffset===!0)fe.endOffset=he.endOffset;else fe.startOffset=NaN}cstPostTerminal(G,he){let fe=this.CST_STACK[this.CST_STACK.length-1];HF(fe,he,G),this.setNodeLocationFromToken(fe.location,he)}cstPostNonTerminal(G,he){let fe=this.CST_STACK[this.CST_STACK.length-1];bN(fe,he,G),this.setNodeLocationFromNode(fe.location,G.location)}getBaseCstVisitorConstructor(){if(Yf(this.baseCstVisitorConstructor)){let G=BW(this.className,Ud(this.gastProductionsCache));return this.baseCstVisitorConstructor=G,G}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(Yf(this.baseCstVisitorWithDefaultsConstructor)){let G=IN(this.className,Ud(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=G,G}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){let G=this.RULE_STACK;return G[G.length-1]}getPreviousExplicitRuleShortName(){let G=this.RULE_STACK;return G[G.length-2]}getLastExplicitRuleOccurrenceIndex(){let G=this.RULE_OCCURRENCE_STACK;return G[G.length-1]}}class ll{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(G){if(this.selfAnalysisDone!==!0)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=G,this.tokVectorLength=G.length}get input(){return this.tokVector}SKIP_TOKEN(){if(this.currIdx<=this.tokVector.length-2)return this.consumeToken(),this.LA(1);else return A7}LA(G){let he=this.currIdx+G;if(he<0||this.tokVectorLength<=he)return A7;else return this.tokVector[he]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(G){this.currIdx=G}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}}class d0{ACTION(G){return G.call(this)}consume(G,he,fe){return this.consumeInternal(he,G,fe)}subrule(G,he,fe){return this.subruleInternal(he,G,fe)}option(G,he){return this.optionInternal(he,G)}or(G,he){return this.orInternal(he,G)}many(G,he){return this.manyInternal(G,he)}atLeastOne(G,he){return this.atLeastOneInternal(G,he)}CONSUME(G,he){return this.consumeInternal(G,0,he)}CONSUME1(G,he){return this.consumeInternal(G,1,he)}CONSUME2(G,he){return this.consumeInternal(G,2,he)}CONSUME3(G,he){return this.consumeInternal(G,3,he)}CONSUME4(G,he){return this.consumeInternal(G,4,he)}CONSUME5(G,he){return this.consumeInternal(G,5,he)}CONSUME6(G,he){return this.consumeInternal(G,6,he)}CONSUME7(G,he){return this.consumeInternal(G,7,he)}CONSUME8(G,he){return this.consumeInternal(G,8,he)}CONSUME9(G,he){return this.consumeInternal(G,9,he)}SUBRULE(G,he){return this.subruleInternal(G,0,he)}SUBRULE1(G,he){return this.subruleInternal(G,1,he)}SUBRULE2(G,he){return this.subruleInternal(G,2,he)}SUBRULE3(G,he){return this.subruleInternal(G,3,he)}SUBRULE4(G,he){return this.subruleInternal(G,4,he)}SUBRULE5(G,he){return this.subruleInternal(G,5,he)}SUBRULE6(G,he){return this.subruleInternal(G,6,he)}SUBRULE7(G,he){return this.subruleInternal(G,7,he)}SUBRULE8(G,he){return this.subruleInternal(G,8,he)}SUBRULE9(G,he){return this.subruleInternal(G,9,he)}OPTION(G){return this.optionInternal(G,0)}OPTION1(G){return this.optionInternal(G,1)}OPTION2(G){return this.optionInternal(G,2)}OPTION3(G){return this.optionInternal(G,3)}OPTION4(G){return this.optionInternal(G,4)}OPTION5(G){return this.optionInternal(G,5)}OPTION6(G){return this.optionInternal(G,6)}OPTION7(G){return this.optionInternal(G,7)}OPTION8(G){return this.optionInternal(G,8)}OPTION9(G){return this.optionInternal(G,9)}OR(G){return this.orInternal(G,0)}OR1(G){return this.orInternal(G,1)}OR2(G){return this.orInternal(G,2)}OR3(G){return this.orInternal(G,3)}OR4(G){return this.orInternal(G,4)}OR5(G){return this.orInternal(G,5)}OR6(G){return this.orInternal(G,6)}OR7(G){return this.orInternal(G,7)}OR8(G){return this.orInternal(G,8)}OR9(G){return this.orInternal(G,9)}MANY(G){this.manyInternal(0,G)}MANY1(G){this.manyInternal(1,G)}MANY2(G){this.manyInternal(2,G)}MANY3(G){this.manyInternal(3,G)}MANY4(G){this.manyInternal(4,G)}MANY5(G){this.manyInternal(5,G)}MANY6(G){this.manyInternal(6,G)}MANY7(G){this.manyInternal(7,G)}MANY8(G){this.manyInternal(8,G)}MANY9(G){this.manyInternal(9,G)}MANY_SEP(G){this.manySepFirstInternal(0,G)}MANY_SEP1(G){this.manySepFirstInternal(1,G)}MANY_SEP2(G){this.manySepFirstInternal(2,G)}MANY_SEP3(G){this.manySepFirstInternal(3,G)}MANY_SEP4(G){this.manySepFirstInternal(4,G)}MANY_SEP5(G){this.manySepFirstInternal(5,G)}MANY_SEP6(G){this.manySepFirstInternal(6,G)}MANY_SEP7(G){this.manySepFirstInternal(7,G)}MANY_SEP8(G){this.manySepFirstInternal(8,G)}MANY_SEP9(G){this.manySepFirstInternal(9,G)}AT_LEAST_ONE(G){this.atLeastOneInternal(0,G)}AT_LEAST_ONE1(G){return this.atLeastOneInternal(1,G)}AT_LEAST_ONE2(G){this.atLeastOneInternal(2,G)}AT_LEAST_ONE3(G){this.atLeastOneInternal(3,G)}AT_LEAST_ONE4(G){this.atLeastOneInternal(4,G)}AT_LEAST_ONE5(G){this.atLeastOneInternal(5,G)}AT_LEAST_ONE6(G){this.atLeastOneInternal(6,G)}AT_LEAST_ONE7(G){this.atLeastOneInternal(7,G)}AT_LEAST_ONE8(G){this.atLeastOneInternal(8,G)}AT_LEAST_ONE9(G){this.atLeastOneInternal(9,G)}AT_LEAST_ONE_SEP(G){this.atLeastOneSepFirstInternal(0,G)}AT_LEAST_ONE_SEP1(G){this.atLeastOneSepFirstInternal(1,G)}AT_LEAST_ONE_SEP2(G){this.atLeastOneSepFirstInternal(2,G)}AT_LEAST_ONE_SEP3(G){this.atLeastOneSepFirstInternal(3,G)}AT_LEAST_ONE_SEP4(G){this.atLeastOneSepFirstInternal(4,G)}AT_LEAST_ONE_SEP5(G){this.atLeastOneSepFirstInternal(5,G)}AT_LEAST_ONE_SEP6(G){this.atLeastOneSepFirstInternal(6,G)}AT_LEAST_ONE_SEP7(G){this.atLeastOneSepFirstInternal(7,G)}AT_LEAST_ONE_SEP8(G){this.atLeastOneSepFirstInternal(8,G)}AT_LEAST_ONE_SEP9(G){this.atLeastOneSepFirstInternal(9,G)}RULE(G,he,fe=fp){if(Kc(this.definedRulesNames,G)){let yt={message:wg.buildDuplicateRuleNameError({topLevelRule:G,grammarName:this.className}),type:Iu.DUPLICATE_RULE_NAME,ruleName:G};this.definitionErrors.push(yt)}this.definedRulesNames.push(G);let Fe=this.defineRule(G,he,fe);return this[G]=Fe,Fe}OVERRIDE_RULE(G,he,fe=fp){let Fe=AN(G,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(Fe);let tt=this.defineRule(G,he,fe);return this[G]=tt,tt}BACKTRACK(G,he){return function(){this.isBackTrackingStack.push(1);let fe=this.saveRecogState();try{return G.apply(this,he),!0}catch(Fe){if(ib(Fe))return!1;else throw Fe}finally{this.reloadRecogState(fe),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return gW(fu(this.gastProductionsCache))}}class Tm{initRecognizerEngine(G,he){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=$8,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},bi(he,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
	See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0
	For Further details.`);if(v(G)){if(dh(G))throw Error(`A Token Vocabulary cannot be empty.
	Note that the first argument for the parser constructor
	is no longer a Token vector (since v4.0).`);if(typeof G[0].startOffset==="number")throw Error(`The Parser constructor no longer accepts a token vector as the first argument.
	See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0
	For Further details.`)}if(v(G))this.tokensMap=c0(G,(tt,yt)=>(tt[yt.name]=yt,tt),{});else if(bi(G,"modes")&&IA(Ea(fu(G.modes)),W2)){let tt=Ea(fu(G.modes)),yt=rN(tt);this.tokensMap=c0(yt,(Bt,Rt)=>(Bt[Rt.name]=Rt,Bt),{})}else if(V(G))this.tokensMap=up(G);else throw Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=h0;let fe=bi(G,"modes")?Ea(fu(G.modes)):fu(G),Fe=IA(fe,(tt)=>dh(tt.categoryMatches));this.tokenMatcher=Fe?$8:XI,fy(fu(this.tokensMap))}defineRule(G,he,fe){if(this.selfAnalysisDone)throw Error(`Grammar rule <${G}> may not be defined after the 'performSelfAnalysis' method has been called'
Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);let Fe=bi(fe,"resyncEnabled")?fe.resyncEnabled:fp.resyncEnabled,tt=bi(fe,"recoveryValueFunc")?fe.recoveryValueFunc:fp.recoveryValueFunc,yt=this.ruleShortNameIdx<<p7+wm;this.ruleShortNameIdx++,this.shortRuleNameToFull[yt]=G,this.fullRuleNameToShort[G]=yt;let Bt;if(this.outputCst===!0)Bt=function(...Hn){try{this.ruleInvocationStateUpdate(yt,G,this.subruleIdx),he.apply(this,Hn);let so=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(so),so}catch(so){return this.invokeRuleCatch(so,Fe,tt)}finally{this.ruleFinallyStateUpdate()}};else Bt=function(...Hn){try{return this.ruleInvocationStateUpdate(yt,G,this.subruleIdx),he.apply(this,Hn)}catch(so){return this.invokeRuleCatch(so,Fe,tt)}finally{this.ruleFinallyStateUpdate()}};return Object.assign(Bt,{ruleName:G,originalGrammarAction:he})}invokeRuleCatch(G,he,fe){let Fe=this.RULE_STACK.length===1,tt=he&&!this.isBackTracking()&&this.recoveryEnabled;if(ib(G)){let yt=G;if(tt){let Bt=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(Bt))if(yt.resyncedTokens=this.reSyncTo(Bt),this.outputCst){let Rt=this.CST_STACK[this.CST_STACK.length-1];return Rt.recoveredNode=!0,Rt}else return fe(G);else{if(this.outputCst){let Rt=this.CST_STACK[this.CST_STACK.length-1];Rt.recoveredNode=!0,yt.partialCstResult=Rt}throw yt}}else if(Fe)return this.moveToTerminatedState(),fe(G);else throw yt}else throw G}optionInternal(G,he){let fe=this.getKeyForAutomaticLookahead($h,he);return this.optionInternalLogic(G,he,fe)}optionInternalLogic(G,he,fe){let Fe=this.getLaFuncFromCache(fe),tt;if(typeof G!=="function"){tt=G.DEF;let yt=G.GATE;if(yt!==void 0){let Bt=Fe;Fe=()=>yt.call(this)&&Bt.call(this)}}else tt=G;if(Fe.call(this)===!0)return tt.call(this);return}atLeastOneInternal(G,he){let fe=this.getKeyForAutomaticLookahead(Ap,G);return this.atLeastOneInternalLogic(G,he,fe)}atLeastOneInternalLogic(G,he,fe){let Fe=this.getLaFuncFromCache(fe),tt;if(typeof he!=="function"){tt=he.DEF;let yt=he.GATE;if(yt!==void 0){let Bt=Fe;Fe=()=>yt.call(this)&&Bt.call(this)}}else tt=he;if(Fe.call(this)===!0){let yt=this.doSingleRepetition(tt);while(Fe.call(this)===!0&&yt===!0)yt=this.doSingleRepetition(tt)}else throw this.raiseEarlyExitException(G,La.REPETITION_MANDATORY,he.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[G,he],Fe,Ap,G,Cu)}atLeastOneSepFirstInternal(G,he){let fe=this.getKeyForAutomaticLookahead(A_,G);this.atLeastOneSepFirstInternalLogic(G,he,fe)}atLeastOneSepFirstInternalLogic(G,he,fe){let{DEF:Fe,SEP:tt}=he;if(this.getLaFuncFromCache(fe).call(this)===!0){Fe.call(this);let Bt=()=>this.tokenMatcher(this.LA(1),tt);while(this.tokenMatcher(this.LA(1),tt)===!0)this.CONSUME(tt),Fe.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[G,tt,Bt,Fe,$a],Bt,A_,G,$a)}else throw this.raiseEarlyExitException(G,La.REPETITION_MANDATORY_WITH_SEPARATOR,he.ERR_MSG)}manyInternal(G,he){let fe=this.getKeyForAutomaticLookahead(Bm,G);return this.manyInternalLogic(G,he,fe)}manyInternalLogic(G,he,fe){let Fe=this.getLaFuncFromCache(fe),tt;if(typeof he!=="function"){tt=he.DEF;let Bt=he.GATE;if(Bt!==void 0){let Rt=Fe;Fe=()=>Bt.call(this)&&Rt.call(this)}}else tt=he;let yt=!0;while(Fe.call(this)===!0&&yt===!0)yt=this.doSingleRepetition(tt);this.attemptInRepetitionRecovery(this.manyInternal,[G,he],Fe,Bm,G,jf,yt)}manySepFirstInternal(G,he){let fe=this.getKeyForAutomaticLookahead(Nh,G);this.manySepFirstInternalLogic(G,he,fe)}manySepFirstInternalLogic(G,he,fe){let{DEF:Fe,SEP:tt}=he;if(this.getLaFuncFromCache(fe).call(this)===!0){Fe.call(this);let Bt=()=>this.tokenMatcher(this.LA(1),tt);while(this.tokenMatcher(this.LA(1),tt)===!0)this.CONSUME(tt),Fe.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[G,tt,Bt,Fe,Sc],Bt,Nh,G,Sc)}}repetitionSepSecondInternal(G,he,fe,Fe,tt){while(fe())this.CONSUME(he),Fe.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[G,he,fe,Fe,tt],fe,A_,G,tt)}doSingleRepetition(G){let he=this.getLexerPosition();return G.call(this),this.getLexerPosition()>he}orInternal(G,he){let fe=this.getKeyForAutomaticLookahead(PA,he),Fe=v(G)?G:G.DEF,yt=this.getLaFuncFromCache(fe).call(this,Fe);if(yt!==void 0)return Fe[yt].ALT.call(this);this.raiseNoAltException(he,G.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){let G=this.LA(1),he=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:G,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new V4(he,G))}}subruleInternal(G,he,fe){let Fe;try{let tt=fe!==void 0?fe.ARGS:void 0;return this.subruleIdx=he,Fe=G.apply(this,tt),this.cstPostNonTerminal(Fe,fe!==void 0&&fe.LABEL!==void 0?fe.LABEL:G.ruleName),Fe}catch(tt){throw this.subruleInternalError(tt,fe,G.ruleName)}}subruleInternalError(G,he,fe){if(ib(G)&&G.partialCstResult!==void 0)this.cstPostNonTerminal(G.partialCstResult,he!==void 0&&he.LABEL!==void 0?he.LABEL:fe),delete G.partialCstResult;throw G}consumeInternal(G,he,fe){let Fe;try{let tt=this.LA(1);if(this.tokenMatcher(tt,G)===!0)this.consumeToken(),Fe=tt;else this.consumeInternalError(G,tt,fe)}catch(tt){Fe=this.consumeInternalRecovery(G,he,tt)}return this.cstPostTerminal(fe!==void 0&&fe.LABEL!==void 0?fe.LABEL:G.name,Fe),Fe}consumeInternalError(G,he,fe){let Fe,tt=this.LA(0);if(fe!==void 0&&fe.ERR_MSG)Fe=fe.ERR_MSG;else Fe=this.errorMessageProvider.buildMismatchTokenMessage({expected:G,actual:he,previous:tt,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new t9(Fe,he,tt))}consumeInternalRecovery(G,he,fe){if(this.recoveryEnabled&&fe.name==="MismatchedTokenException"&&!this.isBackTracking()){let Fe=this.getFollowsForInRuleRecovery(G,he);try{return this.tryInRuleRecovery(G,Fe)}catch(tt){if(tt.name===u7)throw fe;else throw tt}}else throw fe}saveRecogState(){let G=this.errors,he=up(this.RULE_STACK);return{errors:G,lexerState:this.exportLexerState(),RULE_STACK:he,CST_STACK:this.CST_STACK}}reloadRecogState(G){this.errors=G.errors,this.importLexerState(G.lexerState),this.RULE_STACK=G.RULE_STACK}ruleInvocationStateUpdate(G,he,fe){this.RULE_OCCURRENCE_STACK.push(fe),this.RULE_STACK.push(G),this.cstInvocationStateUpdate(he)}isBackTracking(){return this.isBackTrackingStack.length!==0}getCurrRuleFullName(){let G=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[G]}shortRuleNameToFullName(G){return this.shortRuleNameToFull[G]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),h0)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}}class sb{initErrorHandler(G){this._errors=[],this.errorMessageProvider=bi(G,"errorMessageProvider")?G.errorMessageProvider:u0.errorMessageProvider}SAVE_ERROR(G){if(ib(G))return G.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:up(this.RULE_OCCURRENCE_STACK)},this._errors.push(G),G;else throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return up(this._errors)}set errors(G){this._errors=G}raiseEarlyExitException(G,he,fe){let Fe=this.getCurrRuleFullName(),tt=this.getGAstProductions()[Fe],Bt=Wx(G,tt,he,this.maxLookahead)[0],Rt=[];for(let Hn=1;Hn<=this.maxLookahead;Hn++)Rt.push(this.LA(Hn));let Xt=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:Bt,actual:Rt,previous:this.LA(0),customUserDescription:fe,ruleName:Fe});throw this.SAVE_ERROR(new h7(Xt,this.LA(1),this.LA(0)))}raiseNoAltException(G,he){let fe=this.getCurrRuleFullName(),Fe=this.getGAstProductions()[fe],tt=qI(G,Fe,this.maxLookahead),yt=[];for(let Xt=1;Xt<=this.maxLookahead;Xt++)yt.push(this.LA(Xt));let Bt=this.LA(0),Rt=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:tt,actual:yt,previous:Bt,customUserDescription:he,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new n9(Rt,this.LA(1),Bt))}}class W4{initContentAssist(){}computeContentAssist(G,he){let fe=this.gastProductionsCache[G];if(Yf(fe))throw Error(`Rule ->${G}<- does not exist in this grammar.`);return bu([fe],he,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(G){let he=mp(G.ruleStack),Fe=this.getGAstProductions()[he];return new wF(Fe,G).startWalking()}}let X4={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(X4);let r9=!0,jx=Math.pow(2,wm)-1,DW=jI({name:"RECORDING_PHASE_TOKEN",pattern:Eg.NA});fy([DW]);let NW=Mg(DW,`This IToken indicates the Parser is in Recording Phase
	See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(NW);let $n={name:`This CSTNode indicates the Parser is in Recording Phase
	See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}};class $f{initGastRecorder(G){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let G=0;G<10;G++){let he=G>0?G:"";this[`CONSUME${he}`]=function(fe,Fe){return this.consumeInternalRecord(fe,G,Fe)},this[`SUBRULE${he}`]=function(fe,Fe){return this.subruleInternalRecord(fe,G,Fe)},this[`OPTION${he}`]=function(fe){return this.optionInternalRecord(fe,G)},this[`OR${he}`]=function(fe){return this.orInternalRecord(fe,G)},this[`MANY${he}`]=function(fe){this.manyInternalRecord(G,fe)},this[`MANY_SEP${he}`]=function(fe){this.manySepFirstInternalRecord(G,fe)},this[`AT_LEAST_ONE${he}`]=function(fe){this.atLeastOneInternalRecord(G,fe)},this[`AT_LEAST_ONE_SEP${he}`]=function(fe){this.atLeastOneSepFirstInternalRecord(G,fe)}}this.consume=function(G,he,fe){return this.consumeInternalRecord(he,G,fe)},this.subrule=function(G,he,fe){return this.subruleInternalRecord(he,G,fe)},this.option=function(G,he){return this.optionInternalRecord(he,G)},this.or=function(G,he){return this.orInternalRecord(he,G)},this.many=function(G,he){this.manyInternalRecord(G,he)},this.atLeastOne=function(G,he){this.atLeastOneInternalRecord(G,he)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{let G=this;for(let he=0;he<10;he++){let fe=he>0?he:"";delete G[`CONSUME${fe}`],delete G[`SUBRULE${fe}`],delete G[`OPTION${fe}`],delete G[`OR${fe}`],delete G[`MANY${fe}`],delete G[`MANY_SEP${fe}`],delete G[`AT_LEAST_ONE${fe}`],delete G[`AT_LEAST_ONE_SEP${fe}`]}delete G.consume,delete G.subrule,delete G.option,delete G.or,delete G.many,delete G.atLeastOne,delete G.ACTION,delete G.BACKTRACK,delete G.LA})}ACTION_RECORD(G){}BACKTRACK_RECORD(G,he){return()=>!0}LA_RECORD(G){return A7}topLevelRuleRecord(G,he){try{let fe=new XC({definition:[],name:G});return fe.name=G,this.recordingProdStack.push(fe),he.call(this),this.recordingProdStack.pop(),fe}catch(fe){if(fe.KNOWN_RECORDER_ERROR!==!0)try{fe.message=fe.message+`
	 This error was thrown during the "grammar recording phase" For more info see:
	https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch(Fe){throw fe}throw fe}}optionInternalRecord(G,he){return EA.call(this,jd,G,he)}atLeastOneInternalRecord(G,he){EA.call(this,Gf,he,G)}atLeastOneSepFirstInternalRecord(G,he){EA.call(this,Uf,he,G,r9)}manyInternalRecord(G,he){EA.call(this,xu,he,G)}manySepFirstInternalRecord(G,he){EA.call(this,Sm,he,G,r9)}orInternalRecord(G,he){return HM.call(this,G,he)}subruleInternalRecord(G,he,fe){if(ab(he),!G||bi(G,"ruleName")===!1){let Bt=Error(`<SUBRULE${g7(he)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(G)}>
 inside top level rule: <${this.recordingProdStack[0].name}>`);throw Bt.KNOWN_RECORDER_ERROR=!0,Bt}let Fe=Q4(this.recordingProdStack),tt=G.ruleName,yt=new _p({idx:he,nonTerminalName:tt,label:fe===null||fe===void 0?void 0:fe.LABEL,referencedRule:void 0});return Fe.definition.push(yt),this.outputCst?$n:X4}consumeInternalRecord(G,he,fe){if(ab(he),!eb(G)){let yt=Error(`<CONSUME${g7(he)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(G)}>
 inside top level rule: <${this.recordingProdStack[0].name}>`);throw yt.KNOWN_RECORDER_ERROR=!0,yt}let Fe=Q4(this.recordingProdStack),tt=new uh({idx:he,terminalType:G,label:fe===null||fe===void 0?void 0:fe.LABEL});return Fe.definition.push(tt),NW}}function EA(G,he,fe,Fe=!1){ab(fe);let tt=Q4(this.recordingProdStack),yt=ue(he)?he:he.DEF,Bt=new G({definition:[],idx:fe});if(Fe)Bt.separator=he.SEP;if(bi(he,"MAX_LOOKAHEAD"))Bt.maxLookahead=he.MAX_LOOKAHEAD;return this.recordingProdStack.push(Bt),yt.call(this),tt.definition.push(Bt),this.recordingProdStack.pop(),X4}function HM(G,he){ab(he);let fe=Q4(this.recordingProdStack),Fe=v(G)===!1,tt=Fe===!1?G:G.DEF,yt=new vA({definition:[],idx:he,ignoreAmbiguities:Fe&&G.IGNORE_AMBIGUITIES===!0});if(bi(G,"MAX_LOOKAHEAD"))yt.maxLookahead=G.MAX_LOOKAHEAD;let Bt=lF(tt,(Rt)=>ue(Rt.GATE));return yt.hasPredicates=Bt,fe.definition.push(yt),Vi(tt,(Rt)=>{let Xt=new fd({definition:[]});if(yt.definition.push(Xt),bi(Rt,"IGNORE_AMBIGUITIES"))Xt.ignoreAmbiguities=Rt.IGNORE_AMBIGUITIES;else if(bi(Rt,"GATE"))Xt.ignoreAmbiguities=!0;this.recordingProdStack.push(Xt),Rt.ALT.call(this),this.recordingProdStack.pop()}),X4}function g7(G){return G===0?"":`${G}`}function ab(G){if(G<0||G>jx){let he=Error(`Invalid DSL Method idx value: <${G}>
	Idx value must be a none negative value smaller than ${jx+1}`);throw he.KNOWN_RECORDER_ERROR=!0,he}}class i9{initPerformanceTracer(G){if(bi(G,"traceInitPerf")){let he=G.traceInitPerf,fe=typeof he==="number";this.traceInitMaxIdent=fe?he:1/0,this.traceInitPerf=fe?he>0:he}else this.traceInitMaxIdent=0,this.traceInitPerf=u0.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(G,he){if(this.traceInitPerf===!0){this.traceInitIndent++;let fe=Array(this.traceInitIndent+1).join("\t");if(this.traceInitIndent<this.traceInitMaxIdent)console.log(`${fe}--> <${G}>`);let{time:Fe,value:tt}=O8(he),yt=Fe>10?console.warn:console.log;if(this.traceInitIndent<this.traceInitMaxIdent)yt(`${fe}<-- <${G}> time: ${Fe}ms`);return this.traceInitIndent--,tt}else return he()}}function vN(G,he){he.forEach((fe)=>{let Fe=fe.prototype;Object.getOwnPropertyNames(Fe).forEach((tt)=>{if(tt==="constructor")return;let yt=Object.getOwnPropertyDescriptor(Fe,tt);if(yt&&(yt.get||yt.set))Object.defineProperty(G.prototype,tt,yt);else G.prototype[tt]=fe.prototype[tt]})})}let A7=Mg(h0,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(A7);let u0=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:j2,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),fp=Object.freeze({recoveryValueFunc:()=>{return},resyncEnabled:!0});var Iu;(function(G){G[G.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",G[G.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",G[G.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",G[G.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",G[G.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",G[G.LEFT_RECURSION=5]="LEFT_RECURSION",G[G.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",G[G.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",G[G.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",G[G.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",G[G.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",G[G.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",G[G.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",G[G.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"})(Iu||(Iu={}));class s9{static performSelfAnalysis(G){throw Error("The **static** `performSelfAnalysis` method has been deprecated.\t\nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let G;this.selfAnalysisDone=!0;let he=this.className;this.TRACE_INIT("toFastProps",()=>{_W(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),Vi(this.definedRulesNames,(Fe)=>{let yt=this[Fe].originalGrammarAction,Bt;this.TRACE_INIT(`${Fe} Rule`,()=>{Bt=this.topLevelRuleRecord(Fe,yt)}),this.gastProductionsCache[Fe]=Bt})}finally{this.disableRecording()}});let fe=[];if(this.TRACE_INIT("Grammar Resolving",()=>{fe=a7({rules:fu(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(fe)}),this.TRACE_INIT("Grammar Validations",()=>{if(dh(fe)&&this.skipValidations===!1){let Fe=RF({rules:fu(this.gastProductionsCache),tokenTypes:fu(this.tokensMap),errMsgProvider:wg,grammarName:he}),tt=xoe({lookaheadStrategy:this.lookaheadStrategy,rules:fu(this.gastProductionsCache),tokenTypes:fu(this.tokensMap),grammarName:he});this.definitionErrors=this.definitionErrors.concat(Fe,tt)}}),dh(this.definitionErrors)){if(this.recoveryEnabled)this.TRACE_INIT("computeAllProdsFollows",()=>{let Fe=xW(fu(this.gastProductionsCache));this.resyncFollows=Fe});this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var Fe,tt;(tt=(Fe=this.lookaheadStrategy).initialize)===null||tt===void 0||tt.call(Fe,{rules:fu(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(fu(this.gastProductionsCache))})}if(!s9.DEFER_DEFINITION_ERRORS_HANDLING&&!dh(this.definitionErrors))throw G=Ur(this.definitionErrors,(Fe)=>Fe.message),Error(`Parser Definition Errors detected:
 ${G.join(`
-------------------------------
`)}`)})}constructor(G,he){this.definitionErrors=[],this.selfAnalysisDone=!1;let fe=this;if(fe.initErrorHandler(he),fe.initLexerAdapter(),fe.initLooksAhead(he),fe.initRecognizerEngine(G,he),fe.initRecoverable(he),fe.initTreeBuilder(he),fe.initContentAssist(),fe.initGastRecorder(he),fe.initPerformanceTracer(he),bi(he,"ignoredIssues"))throw Error(`The <ignoredIssues> IParserConfig property has been deprecated.
	Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.
	See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES
	For further details.`);this.skipValidations=bi(he,"skipValidations")?he.skipValidations:u0.skipValidations}}s9.DEFER_DEFINITION_ERRORS_HANDLING=!1,vN(s9,[NM,QM,Ji,ll,Tm,d0,sb,W4,$f,i9]);class SN extends s9{constructor(G,he=u0){let fe=up(he);fe.outputCst=!0;super(G,fe)}}return{CstParser:SN,Lexer:Eg,createToken:jI}})();class oMe extends s1{constructor(e){super(e)}load(e,t,n,o){let r=this,i=r.path===""?R9.extractUrlBase(e):r.path,s=new Tb(r.manager);s.setPath(r.path),s.setRequestHeader(r.requestHeader),s.setWithCredentials(r.withCredentials),s.load(e,function(a){try{t(r.parse(a,i))}catch(c){if(o)o(c);else console.error(c);r.manager.itemError(e)}},n,o)}parse(e,t){let n={};function o(_e){let ye=r(),Se=new aXn(ye.tokens),Ne=new cXn(ye.tokenVocabulary),ke=i(Ne.getBaseCstVisitorConstructor()),nt=Se.lex(_e);Ne.input=nt.tokens;let dt=Ne.vrml();if(Ne.errors.length>0)throw console.error(Ne.errors),Error("THREE.VRMLLoader: Parsing errors detected.");return ke.visit(dt)}function r(){let _e=um({name:"RouteIdentifier",pattern:/[^\x30-\x39\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d][^\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d]*[\.][^\x30-\x39\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d][^\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d]*/}),ye=um({name:"Identifier",pattern:/[^\x30-\x39\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d][^\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d]*/,longer_alt:_e}),Se=["Anchor","Billboard","Collision","Group","Transform","Inline","LOD","Switch","AudioClip","DirectionalLight","PointLight","Script","Shape","Sound","SpotLight","WorldInfo","CylinderSensor","PlaneSensor","ProximitySensor","SphereSensor","TimeSensor","TouchSensor","VisibilitySensor","Box","Cone","Cylinder","ElevationGrid","Extrusion","IndexedFaceSet","IndexedLineSet","PointSet","Sphere","Color","Coordinate","Normal","TextureCoordinate","Appearance","FontStyle","ImageTexture","Material","MovieTexture","PixelTexture","TextureTransform","ColorInterpolator","CoordinateInterpolator","NormalInterpolator","OrientationInterpolator","PositionInterpolator","ScalarInterpolator","Background","Fog","NavigationInfo","Viewpoint","Text"],Ne=um({name:"Version",pattern:/#VRML.*/,longer_alt:ye}),ke=um({name:"NodeName",pattern:new RegExp(Se.join("|")),longer_alt:ye}),nt=um({name:"DEF",pattern:/DEF/,longer_alt:ye}),dt=um({name:"USE",pattern:/USE/,longer_alt:ye}),rt=um({name:"ROUTE",pattern:/ROUTE/,longer_alt:ye}),mt=um({name:"TO",pattern:/TO/,longer_alt:ye}),lt=um({name:"StringLiteral",pattern:/"(?:[^\\"\n\r]|\\[bfnrtv"\\/]|\\u[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])*"/}),Ct=um({name:"HexLiteral",pattern:/0[xX][0-9a-fA-F]+/}),Nt=um({name:"NumberLiteral",pattern:/[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?/}),Ht=um({name:"TrueLiteral",pattern:/TRUE/}),Tt=um({name:"FalseLiteral",pattern:/FALSE/}),et=um({name:"NullLiteral",pattern:/NULL/}),vt=um({name:"LSquare",pattern:/\[/}),ht=um({name:"RSquare",pattern:/]/}),We=um({name:"LCurly",pattern:/{/}),Le=um({name:"RCurly",pattern:/}/}),Ze=um({name:"Comment",pattern:/#.*/,group:epe.SKIPPED}),qe=[um({name:"WhiteSpace",pattern:/[ ,\s]/,group:epe.SKIPPED}),ke,nt,dt,rt,mt,Ht,Tt,et,Ne,ye,_e,lt,Ct,Nt,vt,ht,We,Le,Ze],ft={};for(let It=0,ze=qe.length;It<ze;It++){let Xe=qe[It];ft[Xe.name]=Xe}return{tokens:qe,tokenVocabulary:ft}}function i(_e){function ye(){_e.call(this),this.validateVisitor()}ye.prototype=Object.assign(Object.create(_e.prototype),{constructor:ye,vrml:function(Ne){let ke={version:this.visit(Ne.version),nodes:[],routes:[]};for(let nt=0,dt=Ne.node.length;nt<dt;nt++){let rt=Ne.node[nt];ke.nodes.push(this.visit(rt))}if(Ne.route)for(let nt=0,dt=Ne.route.length;nt<dt;nt++){let rt=Ne.route[nt];ke.routes.push(this.visit(rt))}return ke},version:function(Ne){return Ne.Version[0].image},node:function(Ne){let ke={name:Ne.NodeName[0].image,fields:[]};if(Ne.field)for(let nt=0,dt=Ne.field.length;nt<dt;nt++){let rt=Ne.field[nt];ke.fields.push(this.visit(rt))}if(Ne.def)ke.DEF=this.visit(Ne.def[0]);return ke},field:function(Ne){let ke={name:Ne.Identifier[0].image,type:null,values:null},nt;if(Ne.singleFieldValue)nt=this.visit(Ne.singleFieldValue[0]);if(Ne.multiFieldValue)nt=this.visit(Ne.multiFieldValue[0]);return ke.type=nt.type,ke.values=nt.values,ke},def:function(Ne){return(Ne.Identifier||Ne.NodeName)[0].image},use:function(Ne){return{USE:(Ne.Identifier||Ne.NodeName)[0].image}},singleFieldValue:function(Ne){return Se(this,Ne)},multiFieldValue:function(Ne){return Se(this,Ne)},route:function(Ne){return{FROM:Ne.RouteIdentifier[0].image,TO:Ne.RouteIdentifier[1].image}}});function Se(Ne,ke){let nt={type:null,values:[]};if(ke.node){nt.type="node";for(let dt=0,rt=ke.node.length;dt<rt;dt++){let mt=ke.node[dt];nt.values.push(Ne.visit(mt))}}if(ke.use){nt.type="use";for(let dt=0,rt=ke.use.length;dt<rt;dt++){let mt=ke.use[dt];nt.values.push(Ne.visit(mt))}}if(ke.StringLiteral){nt.type="string";for(let dt=0,rt=ke.StringLiteral.length;dt<rt;dt++){let mt=ke.StringLiteral[dt];nt.values.push(mt.image.replace(/'|"/g,""))}}if(ke.NumberLiteral){nt.type="number";for(let dt=0,rt=ke.NumberLiteral.length;dt<rt;dt++){let mt=ke.NumberLiteral[dt];nt.values.push(parseFloat(mt.image))}}if(ke.HexLiteral){nt.type="hex";for(let dt=0,rt=ke.HexLiteral.length;dt<rt;dt++){let mt=ke.HexLiteral[dt];nt.values.push(mt.image)}}if(ke.TrueLiteral){nt.type="boolean";for(let dt=0,rt=ke.TrueLiteral.length;dt<rt;dt++)if(ke.TrueLiteral[dt].image==="TRUE")nt.values.push(!0)}if(ke.FalseLiteral){nt.type="boolean";for(let dt=0,rt=ke.FalseLiteral.length;dt<rt;dt++)if(ke.FalseLiteral[dt].image==="FALSE")nt.values.push(!1)}if(ke.NullLiteral)nt.type="null",ke.NullLiteral.forEach(function(){nt.values.push(null)});return nt}return new ye}function s(_e){let ye=_e.nodes,Se=new Dy;for(let Ne=0,ke=ye.length;Ne<ke;Ne++){let nt=ye[Ne];a(nt)}for(let Ne=0,ke=ye.length;Ne<ke;Ne++){let nt=ye[Ne],dt=c(nt);if(dt instanceof Sl)Se.add(dt);if(nt.name==="WorldInfo")Se.userData.worldInfo=dt}return Se}function a(_e){if(_e.DEF)n[_e.DEF]=_e;let ye=_e.fields;for(let Se=0,Ne=ye.length;Se<Ne;Se++){let ke=ye[Se];if(ke.type==="node"){let nt=ke.values;for(let dt=0,rt=nt.length;dt<rt;dt++)a(nt[dt])}}}function c(_e){if(_e.USE)return L(_e.USE);if(_e.build!==void 0)return _e.build;return _e.build=l(_e),_e.build}function l(_e){let ye=_e.name,Se;switch(ye){case"Group":case"Transform":case"Collision":Se=h(_e);break;case"Background":Se=d(_e);break;case"Shape":Se=u(_e);break;case"Appearance":Se=_(_e);break;case"Material":Se=p(_e);break;case"ImageTexture":Se=f(_e);break;case"PixelTexture":Se=g(_e);break;case"TextureTransform":Se=y(_e);break;case"IndexedFaceSet":Se=b(_e);break;case"IndexedLineSet":Se=I(_e);break;case"PointSet":Se=v(_e);break;case"Box":Se=P(_e);break;case"Cone":Se=M(_e);break;case"Cylinder":Se=B(_e);break;case"Sphere":Se=T(_e);break;case"ElevationGrid":Se=N(_e);break;case"Extrusion":Se=D(_e);break;case"Color":case"Coordinate":case"Normal":case"TextureCoordinate":Se=x(_e);break;case"WorldInfo":Se=C(_e);break;case"Anchor":case"Billboard":case"Inline":case"LOD":case"Switch":case"AudioClip":case"DirectionalLight":case"PointLight":case"Script":case"Sound":case"SpotLight":case"CylinderSensor":case"PlaneSensor":case"ProximitySensor":case"SphereSensor":case"TimeSensor":case"TouchSensor":case"VisibilitySensor":case"Text":case"FontStyle":case"MovieTexture":case"ColorInterpolator":case"CoordinateInterpolator":case"NormalInterpolator":case"OrientationInterpolator":case"PositionInterpolator":case"ScalarInterpolator":case"Fog":case"NavigationInfo":case"Viewpoint":break;default:console.warn("THREE.VRMLLoader: Unknown node:",ye);break}if(Se!==void 0&&_e.DEF!==void 0&&Se.hasOwnProperty("name")===!0)Se.name=_e.DEF;return Se}function h(_e){let ye=new Ba,Se=_e.fields;for(let Ne=0,ke=Se.length;Ne<ke;Ne++){let nt=Se[Ne],{name:dt,values:rt}=nt;switch(dt){case"bboxCenter":break;case"bboxSize":break;case"center":break;case"children":H(rt,ye);break;case"collide":break;case"rotation":let mt=new Et(rt[0],rt[1],rt[2]).normalize(),lt=rt[3];ye.quaternion.setFromAxisAngle(mt,lt);break;case"scale":ye.scale.set(rt[0],rt[1],rt[2]);break;case"scaleOrientation":break;case"translation":ye.position.set(rt[0],rt[1],rt[2]);break;case"proxy":break;default:console.warn("THREE.VRMLLoader: Unknown field:",dt);break}}return ye}function d(_e){let ye=new Ba,Se,Ne,ke,nt,dt=_e.fields;for(let mt=0,lt=dt.length;mt<lt;mt++){let Ct=dt[mt],{name:Nt,values:Ht}=Ct;switch(Nt){case"groundAngle":Se=Ht;break;case"groundColor":Ne=Ht;break;case"backUrl":break;case"bottomUrl":break;case"frontUrl":break;case"leftUrl":break;case"rightUrl":break;case"topUrl":break;case"skyAngle":ke=Ht;break;case"skyColor":nt=Ht;break;default:console.warn("THREE.VRMLLoader: Unknown field:",Nt);break}}let rt=1e4;if(nt){let mt=new _w(rt,32,16),lt=new Up({fog:!1,side:Ure,depthWrite:!1,depthTest:!1});if(nt.length>3)xe(mt,rt,ke,Ae(nt),!0),lt.vertexColors=!0;else lt.color.setRGB(nt[0],nt[1],nt[2]);let Ct=new Mo(mt,lt);ye.add(Ct)}if(Ne){if(Ne.length>0){let mt=new _w(rt,32,16,0,2*Math.PI,0.5*Math.PI,1.5*Math.PI),lt=new Up({fog:!1,side:Ure,vertexColors:!0,depthWrite:!1,depthTest:!1});xe(mt,rt,Se,Ae(Ne),!1);let Ct=new Mo(mt,lt);ye.add(Ct)}}return ye.renderOrder=-1/0,ye}function u(_e){let ye=_e.fields,Se=new Up({color:0}),Ne;for(let nt=0,dt=ye.length;nt<dt;nt++){let rt=ye[nt],{name:mt,values:lt}=rt;switch(mt){case"appearance":if(lt[0]!==null)Se=c(lt[0]);break;case"geometry":if(lt[0]!==null)Ne=c(lt[0]);break;default:console.warn("THREE.VRMLLoader: Unknown field:",mt);break}}let ke;if(Ne&&Ne.attributes.position){let nt=Ne._type;if(nt==="points"){let dt=new T9({color:16777215});if(Ne.attributes.color!==void 0)dt.vertexColors=!0;else if(Se.isMeshPhongMaterial)dt.color.copy(Se.emissive);ke=new pw(Ne,dt)}else if(nt==="line"){let dt=new n2({color:16777215});if(Ne.attributes.color!==void 0)dt.vertexColors=!0;else if(Se.isMeshPhongMaterial)dt.color.copy(Se.emissive);ke=new u3(Ne,dt)}else{if(Ne._solid!==void 0)Se.side=Ne._solid?O7:bd;if(Ne.attributes.color!==void 0)Se.vertexColors=!0;ke=new Mo(Ne,Se)}}else ke=new Sl,ke.visible=!1;return ke}function _(_e){let ye=new Bz,Se,Ne=_e.fields;for(let ke=0,nt=Ne.length;ke<nt;ke++){let dt=Ne[ke],{name:rt,values:mt}=dt;switch(rt){case"material":if(mt[0]!==null){let Ct=c(mt[0]);if(Ct.diffuseColor)ye.color.copy(Ct.diffuseColor);if(Ct.emissiveColor)ye.emissive.copy(Ct.emissiveColor);if(Ct.shininess)ye.shininess=Ct.shininess;if(Ct.specularColor)ye.specular.copy(Ct.specularColor);if(Ct.transparency)ye.opacity=1-Ct.transparency;if(Ct.transparency>0)ye.transparent=!0}else ye=new Up({color:0});break;case"texture":let lt=mt[0];if(lt!==null){if(lt.name==="ImageTexture"||lt.name==="PixelTexture")ye.map=c(lt)}break;case"textureTransform":if(mt[0]!==null)Se=c(mt[0]);break;default:console.warn("THREE.VRMLLoader: Unknown field:",rt);break}}if(ye.map){if(ye.map.__type){switch(ye.map.__type){case zv.INTENSITY_ALPHA:ye.opacity=1;break;case zv.RGB:ye.color.set(16777215);break;case zv.RGBA:ye.color.set(16777215),ye.opacity=1;break}delete ye.map.__type}if(Se)ye.map.center.copy(Se.center),ye.map.rotation=Se.rotation,ye.map.repeat.copy(Se.scale),ye.map.offset.copy(Se.translation)}return ye}function p(_e){let ye={},Se=_e.fields;for(let Ne=0,ke=Se.length;Ne<ke;Ne++){let nt=Se[Ne],{name:dt,values:rt}=nt;switch(dt){case"ambientIntensity":break;case"diffuseColor":ye.diffuseColor=new No(rt[0],rt[1],rt[2]);break;case"emissiveColor":ye.emissiveColor=new No(rt[0],rt[1],rt[2]);break;case"shininess":ye.shininess=rt[0];break;case"specularColor":ye.emissiveColor=new No(rt[0],rt[1],rt[2]);break;case"transparency":ye.transparency=rt[0];break;default:console.warn("THREE.VRMLLoader: Unknown field:",dt);break}}return ye}function m(_e,ye,Se){let Ne;switch(ye){case zv.INTENSITY:Ne=parseInt(_e),Se.r=Ne,Se.g=Ne,Se.b=Ne,Se.a=1;break;case zv.INTENSITY_ALPHA:Ne=parseInt("0x"+_e.substring(2,4)),Se.r=Ne,Se.g=Ne,Se.b=Ne,Se.a=parseInt("0x"+_e.substring(4,6));break;case zv.RGB:Se.r=parseInt("0x"+_e.substring(2,4)),Se.g=parseInt("0x"+_e.substring(4,6)),Se.b=parseInt("0x"+_e.substring(6,8)),Se.a=1;break;case zv.RGBA:Se.r=parseInt("0x"+_e.substring(2,4)),Se.g=parseInt("0x"+_e.substring(4,6)),Se.b=parseInt("0x"+_e.substring(6,8)),Se.a=parseInt("0x"+_e.substring(8,10));break}}function A(_e){let ye;switch(_e){case 1:ye=zv.INTENSITY;break;case 2:ye=zv.INTENSITY_ALPHA;break;case 3:ye=zv.RGB;break;case 4:ye=zv.RGBA;break}return ye}function g(_e){let ye,Se=h3,Ne=h3,ke=_e.fields;for(let nt=0,dt=ke.length;nt<dt;nt++){let rt=ke[nt],{name:mt,values:lt}=rt;switch(mt){case"image":let Ct=lt[0],Nt=lt[1],Ht=lt[2],Tt=A(Ht),et=new Uint8Array(4*Ct*Nt),vt={r:0,g:0,b:0,a:0};for(let ht=3,We=0,Le=lt.length;ht<Le;ht++,We++){m(lt[ht],Tt,vt);let Ze=We*4;et[Ze+0]=vt.r,et[Ze+1]=vt.g,et[Ze+2]=vt.b,et[Ze+3]=vt.a}ye=new ZX(et,Ct,Nt),ye.needsUpdate=!0,ye.__type=Tt;break;case"repeatS":if(lt[0]===!1)Se=Bb;break;case"repeatT":if(lt[0]===!1)Ne=Bb;break;default:console.warn("THREE.VRMLLoader: Unknown field:",mt);break}}if(ye)ye.wrapS=Se,ye.wrapT=Ne;return ye}function f(_e){let ye,Se=h3,Ne=h3,ke=_e.fields;for(let nt=0,dt=ke.length;nt<dt;nt++){let rt=ke[nt],{name:mt,values:lt}=rt;switch(mt){case"url":let Ct=lt[0];if(Ct)ye=Me.load(Ct);break;case"repeatS":if(lt[0]===!1)Se=Bb;break;case"repeatT":if(lt[0]===!1)Ne=Bb;break;default:console.warn("THREE.VRMLLoader: Unknown field:",mt);break}}if(ye)ye.wrapS=Se,ye.wrapT=Ne;return ye}function y(_e){let ye={center:new ro,rotation:new ro,scale:new ro,translation:new ro},Se=_e.fields;for(let Ne=0,ke=Se.length;Ne<ke;Ne++){let nt=Se[Ne],{name:dt,values:rt}=nt;switch(dt){case"center":ye.center.set(rt[0],rt[1]);break;case"rotation":ye.rotation=rt[0];break;case"scale":ye.scale.set(rt[0],rt[1]);break;case"translation":ye.translation.set(rt[0],rt[1]);break;default:console.warn("THREE.VRMLLoader: Unknown field:",dt);break}}return ye}function x(_e){return _e.fields[0].values}function C(_e){let ye={},Se=_e.fields;for(let Ne=0,ke=Se.length;Ne<ke;Ne++){let nt=Se[Ne],{name:dt,values:rt}=nt;switch(dt){case"title":ye.title=rt[0];break;case"info":ye.info=rt;break;default:console.warn("THREE.VRMLLoader: Unknown field:",dt);break}}return ye}function b(_e){let ye,Se,Ne,ke,nt=!0,dt=!0,rt=0,mt,lt,Ct,Nt,Ht=!0,Tt=!0,et=_e.fields;for(let qe=0,ft=et.length;qe<ft;qe++){let It=et[qe],{name:ze,values:Xe}=It;switch(ze){case"color":let it=Xe[0];if(it!==null)ye=c(it);break;case"coord":let St=Xe[0];if(St!==null)Se=c(St);break;case"normal":let kt=Xe[0];if(kt!==null)Ne=c(kt);break;case"texCoord":let Lt=Xe[0];if(Lt!==null)ke=c(Lt);break;case"ccw":nt=Xe[0];break;case"colorIndex":mt=Xe;break;case"colorPerVertex":Ht=Xe[0];break;case"convex":break;case"coordIndex":lt=Xe;break;case"creaseAngle":rt=Xe[0];break;case"normalIndex":Ct=Xe;break;case"normalPerVertex":Tt=Xe[0];break;case"solid":dt=Xe[0];break;case"texCoordIndex":Nt=Xe;break;default:console.warn("THREE.VRMLLoader: Unknown field:",ze);break}}if(lt===void 0)return console.warn("THREE.VRMLLoader: Missing coordIndex."),new js;let vt=V(lt,nt),ht,We,Le;if(ye)if(Ht===!0)if(mt&&mt.length>0){let qe=V(mt,nt);ht=re(vt,qe,ye,3)}else ht=ie(vt,new Wr(ye,3));else if(mt&&mt.length>0){let qe=U(ye,mt),ft=O(qe,lt);ht=Z(vt,ft)}else{let qe=O(ye,lt);ht=Z(vt,qe)}if(Ne)if(Tt===!0)if(Ct&&Ct.length>0){let qe=V(Ct,nt);We=re(vt,qe,Ne,3)}else We=ie(vt,new Wr(Ne,3));else if(Ct&&Ct.length>0){let qe=U(Ne,Ct),ft=O(qe,lt);We=Z(vt,ft)}else{let qe=O(Ne,lt);We=Z(vt,qe)}else We=de(vt,Se,rt);if(ke)if(Nt&&Nt.length>0){let qe=V(Nt,nt);Le=re(vt,qe,ke,2)}else Le=ie(vt,new Wr(ke,2));let Ze=new js,$e=ie(vt,new Wr(Se,3));if(Ze.setAttribute("position",$e),Ze.setAttribute("normal",We),ht)Ze.setAttribute("color",ht);if(Le)Ze.setAttribute("uv",Le);return Ze._solid=dt,Ze._type="mesh",Ze}function I(_e){let ye,Se,Ne,ke,nt=!0,dt=_e.fields;for(let Nt=0,Ht=dt.length;Nt<Ht;Nt++){let Tt=dt[Nt],{name:et,values:vt}=Tt;switch(et){case"color":let ht=vt[0];if(ht!==null)ye=c(ht);break;case"coord":let We=vt[0];if(We!==null)Se=c(We);break;case"colorIndex":Ne=vt;break;case"colorPerVertex":nt=vt[0];break;case"coordIndex":ke=vt;break;default:console.warn("THREE.VRMLLoader: Unknown field:",et);break}}let rt,mt=j(ke);if(ye)if(nt===!0)if(Ne.length>0){let Nt=j(Ne);rt=re(mt,Nt,ye,3)}else rt=ie(mt,new Wr(ye,3));else if(Ne.length>0){let Nt=U(ye,Ne),Ht=Y(Nt,ke);rt=te(mt,Ht)}else{let Nt=Y(ye,ke);rt=te(mt,Nt)}let lt=new js,Ct=ie(mt,new Wr(Se,3));if(lt.setAttribute("position",Ct),rt)lt.setAttribute("color",rt);return lt._type="line",lt}function v(_e){let ye,Se,Ne=_e.fields;for(let nt=0,dt=Ne.length;nt<dt;nt++){let rt=Ne[nt],{name:mt,values:lt}=rt;switch(mt){case"color":let Ct=lt[0];if(Ct!==null)ye=c(Ct);break;case"coord":let Nt=lt[0];if(Nt!==null)Se=c(Nt);break;default:console.warn("THREE.VRMLLoader: Unknown field:",mt);break}}let ke=new js;if(ke.setAttribute("position",new Wr(Se,3)),ye)ke.setAttribute("color",new Wr(ye,3));return ke._type="points",ke}function P(_e){let ye=new Et(2,2,2),Se=_e.fields;for(let ke=0,nt=Se.length;ke<nt;ke++){let dt=Se[ke],{name:rt,values:mt}=dt;switch(rt){case"size":ye.x=mt[0],ye.y=mt[1],ye.z=mt[2];break;default:console.warn("THREE.VRMLLoader: Unknown field:",rt);break}}return new S_(ye.x,ye.y,ye.z)}function M(_e){let ye=1,Se=2,Ne=!1,ke=_e.fields;for(let dt=0,rt=ke.length;dt<rt;dt++){let mt=ke[dt],{name:lt,values:Ct}=mt;switch(lt){case"bottom":Ne=!Ct[0];break;case"bottomRadius":ye=Ct[0];break;case"height":Se=Ct[0];break;case"side":break;default:console.warn("THREE.VRMLLoader: Unknown field:",lt);break}}return new qAe(ye,Se,16,1,Ne)}function B(_e){let ye=1,Se=2,Ne=_e.fields;for(let nt=0,dt=Ne.length;nt<dt;nt++){let rt=Ne[nt],{name:mt,values:lt}=rt;switch(mt){case"bottom":break;case"radius":ye=lt[0];break;case"height":Se=lt[0];break;case"side":break;case"top":break;default:console.warn("THREE.VRMLLoader: Unknown field:",mt);break}}return new mw(ye,ye,Se,16,1)}function T(_e){let ye=1,Se=_e.fields;for(let ke=0,nt=Se.length;ke<nt;ke++){let dt=Se[ke],{name:rt,values:mt}=dt;switch(rt){case"radius":ye=mt[0];break;default:console.warn("THREE.VRMLLoader: Unknown field:",rt);break}}return new _w(ye,16,16)}function N(_e){let ye,Se,Ne,ke,nt=!0,dt=!0,rt=!0,mt=!0,lt=0,Ct=2,Nt=2,Ht=1,Tt=1,et=_e.fields;for(let Xe=0,it=et.length;Xe<it;Xe++){let St=et[Xe],{name:kt,values:Lt}=St;switch(kt){case"color":let Wt=Lt[0];if(Wt!==null)ye=c(Wt);break;case"normal":let bn=Lt[0];if(bn!==null)Se=c(bn);break;case"texCoord":let pn=Lt[0];if(pn!==null)Ne=c(pn);break;case"height":ke=Lt;break;case"ccw":mt=Lt[0];break;case"colorPerVertex":nt=Lt[0];break;case"creaseAngle":lt=Lt[0];break;case"normalPerVertex":dt=Lt[0];break;case"solid":rt=Lt[0];break;case"xDimension":Ct=Lt[0];break;case"xSpacing":Ht=Lt[0];break;case"zDimension":Nt=Lt[0];break;case"zSpacing":Tt=Lt[0];break;default:console.warn("THREE.VRMLLoader: Unknown field:",kt);break}}let vt=[],ht=[],We=[],Le=[];for(let Xe=0;Xe<Nt;Xe++)for(let it=0;it<Ct;it++){let St=Xe*Ct+it,kt=Ht*Xe,Lt=ke[St],Wt=Tt*it;if(vt.push(kt,Lt,Wt),ye&&nt===!0){let bn=ye[St*3+0],pn=ye[St*3+1],wn=ye[St*3+2];We.push(bn,pn,wn)}if(Se&&dt===!0){let bn=Se[St*3+0],pn=Se[St*3+1],wn=Se[St*3+2];ht.push(bn,pn,wn)}if(Ne){let bn=Ne[St*2+0],pn=Ne[St*2+1];Le.push(bn,pn)}else Le.push(Xe/(Ct-1),it/(Nt-1))}let Ze=[];for(let Xe=0;Xe<Ct-1;Xe++)for(let it=0;it<Nt-1;it++){let St=Xe+it*Ct,kt=Xe+(it+1)*Ct,Lt=Xe+1+(it+1)*Ct,Wt=Xe+1+it*Ct;if(mt===!0)Ze.push(St,Lt,kt),Ze.push(Lt,St,Wt);else Ze.push(St,kt,Lt),Ze.push(Lt,Wt,St)}let $e=ie(Ze,new Wr(vt,3)),qe=ie(Ze,new Wr(Le,2)),ft,It;if(ye)if(nt===!1){for(let Xe=0;Xe<Ct-1;Xe++)for(let it=0;it<Nt-1;it++){let St=Xe+it*(Ct-1),kt=ye[St*3+0],Lt=ye[St*3+1],Wt=ye[St*3+2];We.push(kt,Lt,Wt),We.push(kt,Lt,Wt),We.push(kt,Lt,Wt),We.push(kt,Lt,Wt),We.push(kt,Lt,Wt),We.push(kt,Lt,Wt)}ft=new Wr(We,3)}else ft=ie(Ze,new Wr(We,3));if(Se)if(dt===!1){for(let Xe=0;Xe<Ct-1;Xe++)for(let it=0;it<Nt-1;it++){let St=Xe+it*(Ct-1),kt=Se[St*3+0],Lt=Se[St*3+1],Wt=Se[St*3+2];ht.push(kt,Lt,Wt),ht.push(kt,Lt,Wt),ht.push(kt,Lt,Wt),ht.push(kt,Lt,Wt),ht.push(kt,Lt,Wt),ht.push(kt,Lt,Wt)}It=new Wr(ht,3)}else It=ie(Ze,new Wr(ht,3));else It=de(Ze,vt,lt);let ze=new js;if(ze.setAttribute("position",$e),ze.setAttribute("normal",It),ze.setAttribute("uv",qe),ft)ze.setAttribute("color",ft);return ze._solid=rt,ze._type="mesh",ze}function D(_e){let ye=[1,1,1,-1,-1,-1,-1,1,1,1],Se=[0,0,0,0,1,0],Ne,ke,nt=!0,dt=!0,rt=0,mt=!0,lt=!0,Ct=_e.fields;for(let ze=0,Xe=Ct.length;ze<Xe;ze++){let it=Ct[ze],{name:St,values:kt}=it;switch(St){case"beginCap":nt=kt[0];break;case"ccw":dt=kt[0];break;case"convex":break;case"creaseAngle":rt=kt[0];break;case"crossSection":ye=kt;break;case"endCap":mt=kt[0];break;case"orientation":ke=kt;break;case"scale":Ne=kt;break;case"solid":lt=kt[0];break;case"spine":Se=kt;break;default:console.warn("THREE.VRMLLoader: Unknown field:",St);break}}let Nt=ye[0]===ye[ye.length-2]&&ye[1]===ye[ye.length-1],Ht=[],Tt=new Et,et=new Et,vt=new Et,ht=new Et,We=new Eu;for(let ze=0,Xe=0,it=0,St=Se.length;ze<St;ze+=3,Xe+=2,it+=4){Tt.fromArray(Se,ze),et.x=Ne?Ne[Xe+0]:1,et.y=1,et.z=Ne?Ne[Xe+1]:1,vt.x=ke?ke[it+0]:0,vt.y=ke?ke[it+1]:0,vt.z=ke?ke[it+2]:1;let kt=ke?ke[it+3]:0;for(let Lt=0,Wt=ye.length;Lt<Wt;Lt+=2)ht.x=ye[Lt+0],ht.y=0,ht.z=ye[Lt+1],ht.multiply(et),We.setFromAxisAngle(vt,kt),ht.applyQuaternion(We),ht.add(Tt),Ht.push(ht.x,ht.y,ht.z)}let Le=[],Ze=Se.length/3,$e=ye.length/2;for(let ze=0;ze<Ze-1;ze++)for(let Xe=0;Xe<$e-1;Xe++){let it=Xe+ze*$e,St=Xe+1+ze*$e,kt=Xe+(ze+1)*$e,Lt=Xe+1+(ze+1)*$e;if(Xe===$e-2&&Nt===!0)St=ze*$e,Lt=(ze+1)*$e;if(dt===!0)Le.push(it,St,kt),Le.push(kt,St,Lt);else Le.push(it,kt,St),Le.push(kt,Lt,St)}if(nt===!0||mt===!0){let ze=[];for(let St=0,kt=ye.length;St<kt;St+=2)ze.push(new ro(ye[St],ye[St+1]));let Xe=Ez.triangulateShape(ze,[]),it=[];for(let St=0,kt=Xe.length;St<kt;St++){let Lt=Xe[St];it.push(Lt[0],Lt[1],Lt[2])}if(nt===!0)for(let St=0,kt=it.length;St<kt;St+=3)if(dt===!0)Le.push(it[St+0],it[St+1],it[St+2]);else Le.push(it[St+0],it[St+2],it[St+1]);if(mt===!0){let St=$e*(Ze-1);for(let kt=0,Lt=it.length;kt<Lt;kt+=3)if(dt===!0)Le.push(St+it[kt+0],St+it[kt+2],St+it[kt+1]);else Le.push(St+it[kt+0],St+it[kt+1],St+it[kt+2])}}let qe=ie(Le,new Wr(Ht,3)),ft=de(Le,Ht,rt),It=new js;return It.setAttribute("position",qe),It.setAttribute("normal",ft),It._solid=lt,It._type="mesh",It}function L(_e){let ye=n[_e],Se=c(ye);return Se.isObject3D||Se.isMaterial?Se.clone():Se}function H(_e,ye){for(let Se=0,Ne=_e.length;Se<Ne;Se++){let ke=c(_e[Se]);if(ke instanceof Sl)ye.add(ke)}}function V(_e,ye){let Se=[],Ne=0;for(let ke=0,nt=_e.length;ke<nt;ke++){let dt=_e[Ne],rt=_e[ke+(ye?1:2)],mt=_e[ke+(ye?2:1)];if(Se.push(dt,rt,mt),_e[ke+3]===-1||ke+3>=nt)ke+=3,Ne=ke+1}return Se}function O(_e,ye){let Se=[],Ne=0;for(let ke=0,nt=ye.length;ke<nt;ke++){let dt=Ne*3,rt=_e[dt],mt=_e[dt+1],lt=_e[dt+2];if(Se.push(rt,mt,lt),ye[ke+3]===-1||ke+3>=nt)ke+=3,Ne++}return Se}function U(_e,ye){let Se=[];for(let Ne=0,ke=ye.length;Ne<ke;Ne++){let dt=ye[Ne]*3,rt=_e[dt],mt=_e[dt+1],lt=_e[dt+2];Se.push(rt,mt,lt)}return Se}function j(_e){let ye=[];for(let Se=0,Ne=_e.length;Se<Ne;Se++){let ke=_e[Se],nt=_e[Se+1];if(ye.push(ke,nt),_e[Se+2]===-1||Se+2>=Ne)Se+=2}return ye}function Y(_e,ye){let Se=[],Ne=0;for(let ke=0,nt=ye.length;ke<nt;ke++){let dt=Ne*3,rt=_e[dt],mt=_e[dt+1],lt=_e[dt+2];if(Se.push(rt,mt,lt),ye[ke+2]===-1||ke+2>=nt)ke+=2,Ne++}return Se}let X=new Et,K=new Et,J=new Et,ee=new ro,se=new ro,ne=new ro;function re(_e,ye,Se,Ne){let ke=[];for(let nt=0,dt=_e.length;nt<dt;nt+=3){let rt=ye[nt],mt=ye[nt+1],lt=ye[nt+2];if(Ne===2)ee.fromArray(Se,rt*Ne),se.fromArray(Se,mt*Ne),ne.fromArray(Se,lt*Ne),ke.push(ee.x,ee.y),ke.push(se.x,se.y),ke.push(ne.x,ne.y);else X.fromArray(Se,rt*Ne),K.fromArray(Se,mt*Ne),J.fromArray(Se,lt*Ne),ke.push(X.x,X.y,X.z),ke.push(K.x,K.y,K.z),ke.push(J.x,J.y,J.z)}return new Wr(ke,Ne)}function Z(_e,ye){let Se=[];for(let Ne=0,ke=0,nt=_e.length;Ne<nt;Ne+=3,ke++)X.fromArray(ye,ke*3),Se.push(X.x,X.y,X.z),Se.push(X.x,X.y,X.z),Se.push(X.x,X.y,X.z);return new Wr(Se,3)}function te(_e,ye){let Se=[];for(let Ne=0,ke=0,nt=_e.length;Ne<nt;Ne+=2,ke++)X.fromArray(ye,ke*3),Se.push(X.x,X.y,X.z),Se.push(X.x,X.y,X.z);return new Wr(Se,3)}function ie(_e,ye){let{array:Se,itemSize:Ne}=ye,ke=new Se.constructor(_e.length*Ne),nt=0,dt=0;for(let rt=0,mt=_e.length;rt<mt;rt++){nt=_e[rt]*Ne;for(let lt=0;lt<Ne;lt++)ke[dt++]=Se[nt++]}return new Wr(ke,Ne)}let le=new Et,ue=new Et;function de(_e,ye,Se){let Ne=[],ke={};for(let dt=0,rt=_e.length;dt<rt;dt+=3){let mt=_e[dt],lt=_e[dt+1],Ct=_e[dt+2],Nt=new lXn(mt,lt,Ct);if(X.fromArray(ye,mt*3),K.fromArray(ye,lt*3),J.fromArray(ye,Ct*3),ue.subVectors(J,K),le.subVectors(X,K),ue.cross(le),ue.normalize(),Nt.normal.copy(ue),ke[mt]===void 0)ke[mt]=[];if(ke[lt]===void 0)ke[lt]=[];if(ke[Ct]===void 0)ke[Ct]=[];ke[mt].push(Nt.normal),ke[lt].push(Nt.normal),ke[Ct].push(Nt.normal),Ne.push(Nt)}let nt=[];for(let dt=0,rt=Ne.length;dt<rt;dt++){let mt=Ne[dt],lt=me(ke[mt.a],mt.normal,Se),Ct=me(ke[mt.b],mt.normal,Se),Nt=me(ke[mt.c],mt.normal,Se);X.fromArray(ye,mt.a*3),K.fromArray(ye,mt.b*3),J.fromArray(ye,mt.c*3),nt.push(lt.x,lt.y,lt.z),nt.push(Ct.x,Ct.y,Ct.z),nt.push(Nt.x,Nt.y,Nt.z)}return new Wr(nt,3)}function me(_e,ye,Se){let Ne=new Et;if(Se===0)Ne.copy(ye);else for(let ke=0,nt=_e.length;ke<nt;ke++)if(_e[ke].angleTo(ye)<Se)Ne.add(_e[ke]);return Ne.normalize()}function Ae(_e){let ye=[];for(let Se=0,Ne=_e.length;Se<Ne;Se+=3)ye.push(new No(_e[Se],_e[Se+1],_e[Se+2]));return ye}function xe(_e,ye,Se,Ne,ke){let nt=[],dt=ke===!0?0:Math.PI;for(let Ht=0,Tt=Ne.length;Ht<Tt;Ht++){let et=Ht===0?0:Se[Ht-1];et=ke===!0?et:dt-et;let vt=new Et;vt.setFromSphericalCoords(ye,et,0),nt.push(vt)}let rt=_e.index,mt=_e.attributes.position,lt=new Pl(new Float32Array(_e.attributes.position.count*3),3),Ct=new Et,Nt=new No;for(let Ht=0;Ht<rt.count;Ht++){let Tt=rt.getX(Ht);Ct.fromBufferAttribute(mt,Tt);let et,vt,ht=1;for(let Ze=1;Ze<nt.length;Ze++){et=Ze-1,vt=Ze;let $e=nt[et],qe=nt[vt];if(ke===!0){if(Ct.y<=$e.y&&Ct.y>qe.y){ht=Math.abs($e.y-Ct.y)/Math.abs($e.y-qe.y);break}}else if(Ct.y>=$e.y&&Ct.y<qe.y){ht=Math.abs($e.y-Ct.y)/Math.abs($e.y-qe.y);break}}let We=Ne[et],Le=Ne[vt];Nt.copy(We).lerp(Le,ht),lt.setXYZ(Tt,Nt.r,Nt.g,Nt.b)}_e.setAttribute("color",lt)}let Me=new Rz(this.manager);if(Me.setPath(this.resourcePath||t).setCrossOrigin(this.crossOrigin),e.indexOf("#VRML V2.0")===-1)throw Error("THREE.VRMLLexer: Version of VRML asset not supported.");let Re=o(e);return s(Re)}}class aXn{constructor(e){this.lexer=new epe(e)}lex(e){let t=this.lexer.tokenize(e);if(t.errors.length>0)throw console.error(t.errors),Error("THREE.VRMLLexer: Lexing errors detected.");return t}}class cXn extends cut{constructor(e){super(e);let t=this,{Version:n,LCurly:o,RCurly:r,LSquare:i,RSquare:s,Identifier:a,RouteIdentifier:c,StringLiteral:l,HexLiteral:h,NumberLiteral:d,TrueLiteral:u,FalseLiteral:_,NullLiteral:p,DEF:m,USE:A,ROUTE:g,TO:f,NodeName:y}=e;t.RULE("vrml",function(){t.SUBRULE(t.version),t.AT_LEAST_ONE(function(){t.SUBRULE(t.node)}),t.MANY(function(){t.SUBRULE(t.route)})}),t.RULE("version",function(){t.CONSUME(n)}),t.RULE("node",function(){t.OPTION(function(){t.SUBRULE(t.def)}),t.CONSUME(y),t.CONSUME(o),t.MANY(function(){t.SUBRULE(t.field)}),t.CONSUME(r)}),t.RULE("field",function(){t.CONSUME(a),t.OR2([{ALT:function(){t.SUBRULE(t.singleFieldValue)}},{ALT:function(){t.SUBRULE(t.multiFieldValue)}}])}),t.RULE("def",function(){t.CONSUME(m),t.OR([{ALT:function(){t.CONSUME(a)}},{ALT:function(){t.CONSUME(y)}}])}),t.RULE("use",function(){t.CONSUME(A),t.OR([{ALT:function(){t.CONSUME(a)}},{ALT:function(){t.CONSUME(y)}}])}),t.RULE("singleFieldValue",function(){t.AT_LEAST_ONE(function(){t.OR([{ALT:function(){t.SUBRULE(t.node)}},{ALT:function(){t.SUBRULE(t.use)}},{ALT:function(){t.CONSUME(l)}},{ALT:function(){t.CONSUME(h)}},{ALT:function(){t.CONSUME(d)}},{ALT:function(){t.CONSUME(u)}},{ALT:function(){t.CONSUME(_)}},{ALT:function(){t.CONSUME(p)}}])})}),t.RULE("multiFieldValue",function(){t.CONSUME(i),t.MANY(function(){t.OR([{ALT:function(){t.SUBRULE(t.node)}},{ALT:function(){t.SUBRULE(t.use)}},{ALT:function(){t.CONSUME(l)}},{ALT:function(){t.CONSUME(h)}},{ALT:function(){t.CONSUME(d)}},{ALT:function(){t.CONSUME(p)}}])}),t.CONSUME(s)}),t.RULE("route",function(){t.CONSUME(g),t.CONSUME(c),t.CONSUME(f),t.CONSUME2(c)}),this.performSelfAnalysis()}}class lXn{constructor(e,t,n){this.a=e,this.b=t,this.c=n,this.normal=new Et}}var zv={INTENSITY:1,INTENSITY_ALPHA:2,RGB:3,RGBA:4};function lut(e,t){if(t===t5t)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),e;if(t===Xre||t===FAe){let n=e.getIndex();if(n===null){let s=[],a=e.getAttribute("position");if(a!==void 0){for(let c=0;c<a.count;c++)s.push(c);e.setIndex(s),n=e.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e}let o=n.count-2,r=[];if(n)if(t===Xre)for(let s=1;s<=o;s++)r.push(n.getX(0)),r.push(n.getX(s)),r.push(n.getX(s+1));else for(let s=0;s<o;s++)if(s%2===0)r.push(n.getX(s)),r.push(n.getX(s+1)),r.push(n.getX(s+2));else r.push(n.getX(s+2)),r.push(n.getX(s+1)),r.push(n.getX(s));if(r.length/3!==o)console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");let i=e.clone();return i.setIndex(r),i.clearGroups(),i}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",t),e}var WG="srgb",IT="srgb-linear",hXn=3001,BBi=3000;class pte extends s1{constructor(e){super(e);this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new fXn(t)}),this.register(function(t){return new yXn(t)}),this.register(function(t){return new MXn(t)}),this.register(function(t){return new wXn(t)}),this.register(function(t){return new BXn(t)}),this.register(function(t){return new CXn(t)}),this.register(function(t){return new bXn(t)}),this.register(function(t){return new IXn(t)}),this.register(function(t){return new vXn(t)}),this.register(function(t){return new AXn(t)}),this.register(function(t){return new SXn(t)}),this.register(function(t){return new xXn(t)}),this.register(function(t){return new EXn(t)}),this.register(function(t){return new PXn(t)}),this.register(function(t){return new _Xn(t)}),this.register(function(t){return new TXn(t)}),this.register(function(t){return new DXn(t)})}load(e,t,n,o){let r=this,i;if(this.resourcePath!=="")i=this.resourcePath;else if(this.path!==""){let c=R9.extractUrlBase(e);i=R9.resolveURL(c,this.path)}else i=R9.extractUrlBase(e);this.manager.itemStart(e);let s=function(c){if(o)o(c);else console.error(c);r.manager.itemError(e),r.manager.itemEnd(e)},a=new Tb(this.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(c){try{r.parse(c,i,function(l){t(l),r.manager.itemEnd(e)},s)}catch(l){s(l)}},n,s)}setDRACOLoader(e){return this.dracoLoader=e,this}setDDSLoader(){throw Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){if(this.pluginCallbacks.indexOf(e)===-1)this.pluginCallbacks.push(e);return this}unregister(e){if(this.pluginCallbacks.indexOf(e)!==-1)this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1);return this}parse(e,t,n,o){let r,i={},s={};if(typeof e==="string")r=JSON.parse(e);else if(e instanceof ArrayBuffer)if(GG(new Uint8Array(e.slice(0,4)))===NXn){try{i[Uc.KHR_BINARY_GLTF]=new RXn(e)}catch(l){if(o)o(l);return}r=JSON.parse(i[Uc.KHR_BINARY_GLTF].content)}else r=JSON.parse(GG(new Uint8Array(e)));else r=e;if(r.asset===void 0||r.asset.version[0]<2){if(o)o(Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}let a=new FXn(r,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});a.fileLoader.setRequestHeader(this.requestHeader);for(let c=0;c<this.pluginCallbacks.length;c++){let l=this.pluginCallbacks[c](a);if(!l.name)console.error("THREE.GLTFLoader: Invalid plugin found: missing name");s[l.name]=l,i[l.name]=!0}if(r.extensionsUsed)for(let c=0;c<r.extensionsUsed.length;++c){let l=r.extensionsUsed[c],h=r.extensionsRequired||[];switch(l){case Uc.KHR_MATERIALS_UNLIT:i[l]=new gXn;break;case Uc.KHR_DRACO_MESH_COMPRESSION:i[l]=new QXn(r,this.dracoLoader);break;case Uc.KHR_TEXTURE_TRANSFORM:i[l]=new kXn;break;case Uc.KHR_MESH_QUANTIZATION:i[l]=new LXn;break;default:if(h.indexOf(l)>=0&&s[l]===void 0)console.warn('THREE.GLTFLoader: Unknown extension "'+l+'".')}}a.setExtensions(i),a.setPlugins(s),a.parse(n,o)}parseAsync(e,t){let n=this;return new Promise(function(o,r){n.parse(e,t,o,r)})}}function TBi(){let e={};return{get:function(t){return e[t]},add:function(t,n){e[t]=n},remove:function(t){delete e[t]},removeAll:function(){e={}}}}var Uc={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class _Xn{constructor(e){this.parser=e,this.name=Uc.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){let e=this.parser,t=this.parser.json.nodes||[];for(let n=0,o=t.length;n<o;n++){let r=t[n];if(r.extensions&&r.extensions[this.name]&&r.extensions[this.name].light!==void 0)e._addNodeRef(this.cache,r.extensions[this.name].light)}}_loadLight(e){let t=this.parser,n="light:"+e,o=t.cache.get(n);if(o)return o;let r=t.json,a=((r.extensions&&r.extensions[this.name]||{}).lights||[])[e],c,l=new No(16777215);if(a.color!==void 0)l.setRGB(a.color[0],a.color[1],a.color[2],IT);let h=a.range!==void 0?a.range:0;switch(a.type){case"directional":c=new Qz(l),c.target.position.set(0,0,-1),c.add(c.target);break;case"point":c=new tie(l),c.distance=h;break;case"spot":c=new RQe(l),c.distance=h,a.spot=a.spot||{},a.spot.innerConeAngle=a.spot.innerConeAngle!==void 0?a.spot.innerConeAngle:0,a.spot.outerConeAngle=a.spot.outerConeAngle!==void 0?a.spot.outerConeAngle:Math.PI/4,c.angle=a.spot.outerConeAngle,c.penumbra=1-a.spot.innerConeAngle/a.spot.outerConeAngle,c.target.position.set(0,0,-1),c.add(c.target);break;default:throw Error("THREE.GLTFLoader: Unexpected light type: "+a.type)}if(c.position.set(0,0,0),c.decay=2,bT(c,a),a.intensity!==void 0)c.intensity=a.intensity;return c.name=t.createUniqueName(a.name||"light_"+e),o=Promise.resolve(c),t.cache.add(n,o),o}getDependency(e,t){if(e!=="light")return;return this._loadLight(t)}createNodeAttachment(e){let t=this,n=this.parser,r=n.json.nodes[e],s=(r.extensions&&r.extensions[this.name]||{}).light;if(s===void 0)return null;return this._loadLight(s).then(function(a){return n._getNodeRef(t.cache,s,a)})}}class gXn{constructor(){this.name=Uc.KHR_MATERIALS_UNLIT}getMaterialType(){return Up}extendParams(e,t,n){let o=[];e.color=new No(1,1,1),e.opacity=1;let r=t.pbrMetallicRoughness;if(r){if(Array.isArray(r.baseColorFactor)){let i=r.baseColorFactor;e.color.setRGB(i[0],i[1],i[2],IT),e.opacity=i[3]}if(r.baseColorTexture!==void 0)o.push(n.assignTexture(e,"map",r.baseColorTexture,WG))}return Promise.all(o)}}class AXn{constructor(e){this.parser=e,this.name=Uc.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){let o=this.parser.json.materials[e];if(!o.extensions||!o.extensions[this.name])return Promise.resolve();let r=o.extensions[this.name].emissiveStrength;if(r!==void 0)t.emissiveIntensity=r;return Promise.resolve()}}class fXn{constructor(e){this.parser=e,this.name=Uc.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){let n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return null;return OA}extendMaterialParams(e,t){let n=this.parser,o=n.json.materials[e];if(!o.extensions||!o.extensions[this.name])return Promise.resolve();let r=[],i=o.extensions[this.name];if(i.clearcoatFactor!==void 0)t.clearcoat=i.clearcoatFactor;if(i.clearcoatTexture!==void 0)r.push(n.assignTexture(t,"clearcoatMap",i.clearcoatTexture));if(i.clearcoatRoughnessFactor!==void 0)t.clearcoatRoughness=i.clearcoatRoughnessFactor;if(i.clearcoatRoughnessTexture!==void 0)r.push(n.assignTexture(t,"clearcoatRoughnessMap",i.clearcoatRoughnessTexture));if(i.clearcoatNormalTexture!==void 0){if(r.push(n.assignTexture(t,"clearcoatNormalMap",i.clearcoatNormalTexture)),i.clearcoatNormalTexture.scale!==void 0){let s=i.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new ro(s,s)}}return Promise.all(r)}}class yXn{constructor(e){this.parser=e,this.name=Uc.KHR_MATERIALS_DISPERSION}getMaterialType(e){let n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return null;return OA}extendMaterialParams(e,t){let o=this.parser.json.materials[e];if(!o.extensions||!o.extensions[this.name])return Promise.resolve();let r=o.extensions[this.name];return t.dispersion=r.dispersion!==void 0?r.dispersion:0,Promise.resolve()}}class xXn{constructor(e){this.parser=e,this.name=Uc.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){let n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return null;return OA}extendMaterialParams(e,t){let n=this.parser,o=n.json.materials[e];if(!o.extensions||!o.extensions[this.name])return Promise.resolve();let r=[],i=o.extensions[this.name];if(i.iridescenceFactor!==void 0)t.iridescence=i.iridescenceFactor;if(i.iridescenceTexture!==void 0)r.push(n.assignTexture(t,"iridescenceMap",i.iridescenceTexture));if(i.iridescenceIor!==void 0)t.iridescenceIOR=i.iridescenceIor;if(t.iridescenceThicknessRange===void 0)t.iridescenceThicknessRange=[100,400];if(i.iridescenceThicknessMinimum!==void 0)t.iridescenceThicknessRange[0]=i.iridescenceThicknessMinimum;if(i.iridescenceThicknessMaximum!==void 0)t.iridescenceThicknessRange[1]=i.iridescenceThicknessMaximum;if(i.iridescenceThicknessTexture!==void 0)r.push(n.assignTexture(t,"iridescenceThicknessMap",i.iridescenceThicknessTexture));return Promise.all(r)}}class CXn{constructor(e){this.parser=e,this.name=Uc.KHR_MATERIALS_SHEEN}getMaterialType(e){let n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return null;return OA}extendMaterialParams(e,t){let n=this.parser,o=n.json.materials[e];if(!o.extensions||!o.extensions[this.name])return Promise.resolve();let r=[];t.sheenColor=new No(0,0,0),t.sheenRoughness=0,t.sheen=1;let i=o.extensions[this.name];if(i.sheenColorFactor!==void 0){let s=i.sheenColorFactor;t.sheenColor.setRGB(s[0],s[1],s[2],IT)}if(i.sheenRoughnessFactor!==void 0)t.sheenRoughness=i.sheenRoughnessFactor;if(i.sheenColorTexture!==void 0)r.push(n.assignTexture(t,"sheenColorMap",i.sheenColorTexture,WG));if(i.sheenRoughnessTexture!==void 0)r.push(n.assignTexture(t,"sheenRoughnessMap",i.sheenRoughnessTexture));return Promise.all(r)}}class bXn{constructor(e){this.parser=e,this.name=Uc.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){let n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return null;return OA}extendMaterialParams(e,t){let n=this.parser,o=n.json.materials[e];if(!o.extensions||!o.extensions[this.name])return Promise.resolve();let r=[],i=o.extensions[this.name];if(i.transmissionFactor!==void 0)t.transmission=i.transmissionFactor;if(i.transmissionTexture!==void 0)r.push(n.assignTexture(t,"transmissionMap",i.transmissionTexture));return Promise.all(r)}}class IXn{constructor(e){this.parser=e,this.name=Uc.KHR_MATERIALS_VOLUME}getMaterialType(e){let n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return null;return OA}extendMaterialParams(e,t){let n=this.parser,o=n.json.materials[e];if(!o.extensions||!o.extensions[this.name])return Promise.resolve();let r=[],i=o.extensions[this.name];if(t.thickness=i.thicknessFactor!==void 0?i.thicknessFactor:0,i.thicknessTexture!==void 0)r.push(n.assignTexture(t,"thicknessMap",i.thicknessTexture));t.attenuationDistance=i.attenuationDistance||1/0;let s=i.attenuationColor||[1,1,1];return t.attenuationColor=new No().setRGB(s[0],s[1],s[2],IT),Promise.all(r)}}class vXn{constructor(e){this.parser=e,this.name=Uc.KHR_MATERIALS_IOR}getMaterialType(e){let n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return null;return OA}extendMaterialParams(e,t){let o=this.parser.json.materials[e];if(!o.extensions||!o.extensions[this.name])return Promise.resolve();let r=o.extensions[this.name];return t.ior=r.ior!==void 0?r.ior:1.5,Promise.resolve()}}class SXn{constructor(e){this.parser=e,this.name=Uc.KHR_MATERIALS_SPECULAR}getMaterialType(e){let n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return null;return OA}extendMaterialParams(e,t){let n=this.parser,o=n.json.materials[e];if(!o.extensions||!o.extensions[this.name])return Promise.resolve();let r=[],i=o.extensions[this.name];if(t.specularIntensity=i.specularFactor!==void 0?i.specularFactor:1,i.specularTexture!==void 0)r.push(n.assignTexture(t,"specularIntensityMap",i.specularTexture));let s=i.specularColorFactor||[1,1,1];if(t.specularColor=new No().setRGB(s[0],s[1],s[2],IT),i.specularColorTexture!==void 0)r.push(n.assignTexture(t,"specularColorMap",i.specularColorTexture,WG));return Promise.all(r)}}class PXn{constructor(e){this.parser=e,this.name=Uc.EXT_MATERIALS_BUMP}getMaterialType(e){let n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return null;return OA}extendMaterialParams(e,t){let n=this.parser,o=n.json.materials[e];if(!o.extensions||!o.extensions[this.name])return Promise.resolve();let r=[],i=o.extensions[this.name];if(t.bumpScale=i.bumpFactor!==void 0?i.bumpFactor:1,i.bumpTexture!==void 0)r.push(n.assignTexture(t,"bumpMap",i.bumpTexture));return Promise.all(r)}}class EXn{constructor(e){this.parser=e,this.name=Uc.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){let n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return null;return OA}extendMaterialParams(e,t){let n=this.parser,o=n.json.materials[e];if(!o.extensions||!o.extensions[this.name])return Promise.resolve();let r=[],i=o.extensions[this.name];if(i.anisotropyStrength!==void 0)t.anisotropy=i.anisotropyStrength;if(i.anisotropyRotation!==void 0)t.anisotropyRotation=i.anisotropyRotation;if(i.anisotropyTexture!==void 0)r.push(n.assignTexture(t,"anisotropyMap",i.anisotropyTexture));return Promise.all(r)}}class MXn{constructor(e){this.parser=e,this.name=Uc.KHR_TEXTURE_BASISU}loadTexture(e){let t=this.parser,n=t.json,o=n.textures[e];if(!o.extensions||!o.extensions[this.name])return null;let r=o.extensions[this.name],i=t.options.ktx2Loader;if(!i)if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");else return null;return t.loadTextureImage(e,r.source,i)}}class wXn{constructor(e){this.parser=e,this.name=Uc.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){let t=this.name,n=this.parser,o=n.json,r=o.textures[e];if(!r.extensions||!r.extensions[t])return null;let i=r.extensions[t],s=o.images[i.source],a=n.textureLoader;if(s.uri){let c=n.options.manager.getHandler(s.uri);if(c!==null)a=c}return this.detectSupport().then(function(c){if(c)return n.loadTextureImage(e,i.source,a);if(o.extensionsRequired&&o.extensionsRequired.indexOf(t)>=0)throw Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return n.loadTexture(e)})}detectSupport(){if(!this.isSupported)this.isSupported=new Promise(function(e){let t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}});return this.isSupported}}class BXn{constructor(e){this.parser=e,this.name=Uc.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){let t=this.name,n=this.parser,o=n.json,r=o.textures[e];if(!r.extensions||!r.extensions[t])return null;let i=r.extensions[t],s=o.images[i.source],a=n.textureLoader;if(s.uri){let c=n.options.manager.getHandler(s.uri);if(c!==null)a=c}return this.detectSupport().then(function(c){if(c)return n.loadTextureImage(e,i.source,a);if(o.extensionsRequired&&o.extensionsRequired.indexOf(t)>=0)throw Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return n.loadTexture(e)})}detectSupport(){if(!this.isSupported)this.isSupported=new Promise(function(e){let t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(t.height===1)}});return this.isSupported}}class TXn{constructor(e){this.name=Uc.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){let t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){let o=n.extensions[this.name],r=this.parser.getDependency("buffer",o.buffer),i=this.parser.options.meshoptDecoder;if(!i||!i.supported)if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");else return null;return r.then(function(s){let a=o.byteOffset||0,c=o.byteLength||0,{count:l,byteStride:h}=o,d=new Uint8Array(s,a,c);if(i.decodeGltfBufferAsync)return i.decodeGltfBufferAsync(l,h,d,o.mode,o.filter).then(function(u){return u.buffer});else return i.ready.then(function(){let u=new ArrayBuffer(l*h);return i.decodeGltfBuffer(new Uint8Array(u),l,h,d,o.mode,o.filter),u})})}else return null}}class DXn{constructor(e){this.name=Uc.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){let t=this.parser.json,n=t.nodes[e];if(!n.extensions||!n.extensions[this.name]||n.mesh===void 0)return null;let o=t.meshes[n.mesh];for(let c of o.primitives)if(c.mode!==Y6.TRIANGLES&&c.mode!==Y6.TRIANGLE_STRIP&&c.mode!==Y6.TRIANGLE_FAN&&c.mode!==void 0)return null;let i=n.extensions[this.name].attributes,s=[],a={};for(let c in i)s.push(this.parser.getDependency("accessor",i[c]).then((l)=>(a[c]=l,a[c])));if(s.length<1)return null;return s.push(this.parser.createNodeMesh(e)),Promise.all(s).then((c)=>{let l=c.pop(),h=l.isGroup?l.children:[l],d=c[0].count,u=[];for(let _ of h){let p=new Gi,m=new Et,A=new Eu,g=new Et(1,1,1),f=new SQe(_.geometry,_.material,d);for(let y=0;y<d;y++){if(a.TRANSLATION)m.fromBufferAttribute(a.TRANSLATION,y);if(a.ROTATION)A.fromBufferAttribute(a.ROTATION,y);if(a.SCALE)g.fromBufferAttribute(a.SCALE,y);f.setMatrixAt(y,p.compose(m,A,g))}for(let y in a)if(y==="_COLOR_0"){let x=a[y];f.instanceColor=new Mz(x.array,x.itemSize,x.normalized)}else if(y!=="TRANSLATION"&&y!=="ROTATION"&&y!=="SCALE")_.geometry.setAttribute(y,a[y]);Sl.prototype.copy.call(f,_),this.parser.assignFinalMaterial(f),u.push(f)}if(l.isGroup)return l.clear(),l.add(...u),l;return u[0]})}}var NXn="glTF",tpe=12,dXn={JSON:1313821514,BIN:5130562};class RXn{constructor(e){this.name=Uc.KHR_BINARY_GLTF,this.content=null,this.body=null;let t=new DataView(e,0,tpe);if(this.header={magic:GG(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==NXn)throw Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");else if(this.header.version<2)throw Error("THREE.GLTFLoader: Legacy binary file detected.");let n=this.header.length-tpe,o=new DataView(e,tpe),r=0;while(r<n){let i=o.getUint32(r,!0);r+=4;let s=o.getUint32(r,!0);if(r+=4,s===dXn.JSON){let a=new Uint8Array(e,tpe+r,i);this.content=GG(a)}else if(s===dXn.BIN){let a=tpe+r;this.body=e.slice(a,a+i)}r+=i}if(this.content===null)throw Error("THREE.GLTFLoader: JSON content not found.")}}class QXn{constructor(e,t){if(!t)throw Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=Uc.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){let n=this.json,o=this.dracoLoader,r=e.extensions[this.name].bufferView,i=e.extensions[this.name].attributes,s={},a={},c={};for(let l in i){let h=put[l]||l.toLowerCase();s[h]=i[l]}for(let l in e.attributes){let h=put[l]||l.toLowerCase();if(i[l]!==void 0){let d=n.accessors[e.attributes[l]],u=ute[d.componentType];c[h]=u.name,a[h]=d.normalized===!0}}return t.getDependency("bufferView",r).then(function(l){return new Promise(function(h,d){o.decodeDracoFile(l,function(u){for(let _ in u.attributes){let p=u.attributes[_],m=a[_];if(m!==void 0)p.normalized=m}h(u)},s,c,IT,d)})})}}class kXn{constructor(){this.name=Uc.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){if((t.texCoord===void 0||t.texCoord===e.channel)&&t.offset===void 0&&t.rotation===void 0&&t.scale===void 0)return e;if(e=e.clone(),t.texCoord!==void 0)e.channel=t.texCoord;if(t.offset!==void 0)e.offset.fromArray(t.offset);if(t.rotation!==void 0)e.rotation=t.rotation;if(t.scale!==void 0)e.repeat.fromArray(t.scale);return e.needsUpdate=!0,e}}class LXn{constructor(){this.name=Uc.KHR_MESH_QUANTIZATION}}class _ut extends Tz{constructor(e,t,n,o){super(e,t,n,o)}copySampleValue_(e){let t=this.resultBuffer,n=this.sampleValues,o=this.valueSize,r=e*o*3+o;for(let i=0;i!==o;i++)t[i]=n[r+i];return t}interpolate_(e,t,n,o){let r=this.resultBuffer,i=this.sampleValues,s=this.valueSize,a=s*2,c=s*3,l=o-t,h=(n-t)/l,d=h*h,u=d*h,_=e*c,p=_-c,m=-2*u+3*d,A=u-d,g=1-m,f=A-d+h;for(let y=0;y!==s;y++){let x=i[p+y+s],C=i[p+y+a]*l,b=i[_+y+s],I=i[_+y]*l;r[y]=g*x+f*C+m*b+A*I}return r}}var DBi=new Eu;class HXn extends _ut{interpolate_(e,t,n,o){let r=super.interpolate_(e,t,n,o);return DBi.fromArray(r).normalize().toArray(r),r}}var Y6={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},ute={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},uXn={9728:RAe,9729:Ec,9984:QAe,9985:LAe,9986:kAe,9987:Jd},pXn={33071:Bb,33648:NAe,10497:h3},hut={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},put={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",...$Ee>=152?{TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3"}:{TEXCOORD_0:"uv",TEXCOORD_1:"uv2"},COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},WL={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},NBi={CUBICSPLINE:void 0,LINEAR:Wre,STEP:HAe},dut={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function RBi(e){if(e.DefaultMaterial===void 0)e.DefaultMaterial=new vs({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:O7});return e.DefaultMaterial}function UG(e,t,n){for(let o in n.extensions)if(e[o]===void 0)t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[o]=n.extensions[o]}function bT(e,t){if(t.extras!==void 0)if(typeof t.extras==="object")Object.assign(e.userData,t.extras);else console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras)}function QBi(e,t,n){let o=!1,r=!1,i=!1;for(let l=0,h=t.length;l<h;l++){let d=t[l];if(d.POSITION!==void 0)o=!0;if(d.NORMAL!==void 0)r=!0;if(d.COLOR_0!==void 0)i=!0;if(o&&r&&i)break}if(!o&&!r&&!i)return Promise.resolve(e);let s=[],a=[],c=[];for(let l=0,h=t.length;l<h;l++){let d=t[l];if(o){let u=d.POSITION!==void 0?n.getDependency("accessor",d.POSITION):e.attributes.position;s.push(u)}if(r){let u=d.NORMAL!==void 0?n.getDependency("accessor",d.NORMAL):e.attributes.normal;a.push(u)}if(i){let u=d.COLOR_0!==void 0?n.getDependency("accessor",d.COLOR_0):e.attributes.color;c.push(u)}}return Promise.all([Promise.all(s),Promise.all(a),Promise.all(c)]).then(function(l){let h=l[0],d=l[1],u=l[2];if(o)e.morphAttributes.position=h;if(r)e.morphAttributes.normal=d;if(i)e.morphAttributes.color=u;return e.morphTargetsRelative=!0,e})}function kBi(e,t){if(e.updateMorphTargets(),t.weights!==void 0)for(let n=0,o=t.weights.length;n<o;n++)e.morphTargetInfluences[n]=t.weights[n];if(t.extras&&Array.isArray(t.extras.targetNames)){let n=t.extras.targetNames;if(e.morphTargetInfluences.length===n.length){e.morphTargetDictionary={};for(let o=0,r=n.length;o<r;o++)e.morphTargetDictionary[n[o]]=o}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function LBi(e){let t,n=e.extensions&&e.extensions[Uc.KHR_DRACO_MESH_COMPRESSION];if(n)t="draco:"+n.bufferView+":"+n.indices+":"+uut(n.attributes);else t=e.indices+":"+uut(e.attributes)+":"+e.mode;if(e.targets!==void 0)for(let o=0,r=e.targets.length;o<r;o++)t+=":"+uut(e.targets[o]);return t}function uut(e){let t="",n=Object.keys(e).sort();for(let o=0,r=n.length;o<r;o++)t+=n[o]+":"+e[n[o]]+";";return t}function mut(e){switch(e){case Int8Array:return 0.007874015748031496;case Uint8Array:return 0.00392156862745098;case Int16Array:return 0.00003051850947599719;case Uint16Array:return 0.000015259021896696422;default:throw Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}function HBi(e){if(e.search(/\.jpe?g($|\?)/i)>0||e.search(/^data\:image\/jpeg/)===0)return"image/jpeg";if(e.search(/\.webp($|\?)/i)>0||e.search(/^data\:image\/webp/)===0)return"image/webp";return"image/png"}var FBi=new Gi;class FXn{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new TBi,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let n=!1,o=!1,r=-1;if(typeof navigator<"u"&&typeof navigator.userAgent<"u")n=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)===!0,o=navigator.userAgent.indexOf("Firefox")>-1,r=o?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1;if(typeof createImageBitmap>"u"||n||o&&r<98)this.textureLoader=new Rz(this.options.manager);else this.textureLoader=new kQe(this.options.manager);if(this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new Tb(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials")this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){let n=this,o=this.json,r=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(i){return i._markDefs&&i._markDefs()}),Promise.all(this._invokeAll(function(i){return i.beforeRoot&&i.beforeRoot()})).then(function(){return Promise.all([n.getDependencies("scene"),n.getDependencies("animation"),n.getDependencies("camera")])}).then(function(i){let s={scene:i[0][o.scene||0],scenes:i[0],animations:i[1],cameras:i[2],asset:o.asset,parser:n,userData:{}};return UG(r,s,o),bT(s,o),Promise.all(n._invokeAll(function(a){return a.afterRoot&&a.afterRoot(s)})).then(function(){for(let a of s.scenes)a.updateMatrixWorld();e(s)})}).catch(t)}_markDefs(){let e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[];for(let o=0,r=t.length;o<r;o++){let i=t[o].joints;for(let s=0,a=i.length;s<a;s++)e[i[s]].isBone=!0}for(let o=0,r=e.length;o<r;o++){let i=e[o];if(i.mesh!==void 0){if(this._addNodeRef(this.meshCache,i.mesh),i.skin!==void 0)n[i.mesh].isSkinnedMesh=!0}if(i.camera!==void 0)this._addNodeRef(this.cameraCache,i.camera)}}_addNodeRef(e,t){if(t===void 0)return;if(e.refs[t]===void 0)e.refs[t]=e.uses[t]=0;e.refs[t]++}_getNodeRef(e,t,n){if(e.refs[t]<=1)return n;let o=n.clone(),r=(i,s)=>{let a=this.associations.get(i);if(a!=null)this.associations.set(s,a);for(let[c,l]of i.children.entries())r(l,s.children[c])};return r(n,o),o.name+="_instance_"+e.uses[t]++,o}_invokeOne(e){let t=Object.values(this.plugins);t.push(this);for(let n=0;n<t.length;n++){let o=e(t[n]);if(o)return o}return null}_invokeAll(e){let t=Object.values(this.plugins);t.unshift(this);let n=[];for(let o=0;o<t.length;o++){let r=e(t[o]);if(r)n.push(r)}return n}getDependency(e,t){let n=e+":"+t,o=this.cache.get(n);if(!o){switch(e){case"scene":o=this.loadScene(t);break;case"node":o=this._invokeOne(function(r){return r.loadNode&&r.loadNode(t)});break;case"mesh":o=this._invokeOne(function(r){return r.loadMesh&&r.loadMesh(t)});break;case"accessor":o=this.loadAccessor(t);break;case"bufferView":o=this._invokeOne(function(r){return r.loadBufferView&&r.loadBufferView(t)});break;case"buffer":o=this.loadBuffer(t);break;case"material":o=this._invokeOne(function(r){return r.loadMaterial&&r.loadMaterial(t)});break;case"texture":o=this._invokeOne(function(r){return r.loadTexture&&r.loadTexture(t)});break;case"skin":o=this.loadSkin(t);break;case"animation":o=this._invokeOne(function(r){return r.loadAnimation&&r.loadAnimation(t)});break;case"camera":o=this.loadCamera(t);break;default:if(o=this._invokeOne(function(r){return r!=this&&r.getDependency&&r.getDependency(e,t)}),!o)throw Error("Unknown type: "+e);break}this.cache.add(n,o)}return o}getDependencies(e){let t=this.cache.get(e);if(!t){let n=this,o=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(o.map(function(r,i){return n.getDependency(e,i)})),this.cache.add(e,t)}return t}loadBuffer(e){let t=this.json.buffers[e],n=this.fileLoader;if(t.type&&t.type!=="arraybuffer")throw Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[Uc.KHR_BINARY_GLTF].body);let o=this.options;return new Promise(function(r,i){n.load(R9.resolveURL(t.uri,o.path),r,void 0,function(){i(Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){let t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(n){let o=t.byteLength||0,r=t.byteOffset||0;return n.slice(r,r+o)})}loadAccessor(e){let t=this,n=this.json,o=this.json.accessors[e];if(o.bufferView===void 0&&o.sparse===void 0){let i=hut[o.type],s=ute[o.componentType],a=o.normalized===!0,c=new s(o.count*i);return Promise.resolve(new Pl(c,i,a))}let r=[];if(o.bufferView!==void 0)r.push(this.getDependency("bufferView",o.bufferView));else r.push(null);if(o.sparse!==void 0)r.push(this.getDependency("bufferView",o.sparse.indices.bufferView)),r.push(this.getDependency("bufferView",o.sparse.values.bufferView));return Promise.all(r).then(function(i){let s=i[0],a=hut[o.type],c=ute[o.componentType],l=c.BYTES_PER_ELEMENT,h=l*a,d=o.byteOffset||0,u=o.bufferView!==void 0?n.bufferViews[o.bufferView].byteStride:void 0,_=o.normalized===!0,p,m;if(u&&u!==h){let A=Math.floor(d/u),g="InterleavedBuffer:"+o.bufferView+":"+o.componentType+":"+A+":"+o.count,f=t.cache.get(g);if(!f)p=new c(s,A*u,o.count*u/l),f=new WAe(p,u/l),t.cache.add(g,f);m=new Kre(f,a,d%u/l,_)}else{if(s===null)p=new c(o.count*a);else p=new c(s,d,o.count*a);m=new Pl(p,a,_)}if(o.sparse!==void 0){let A=hut.SCALAR,g=ute[o.sparse.indices.componentType],f=o.sparse.indices.byteOffset||0,y=o.sparse.values.byteOffset||0,x=new g(i[1],f,o.sparse.count*A),C=new c(i[2],y,o.sparse.count*a);if(s!==null)m=new Pl(m.array.slice(),m.itemSize,m.normalized);for(let b=0,I=x.length;b<I;b++){let v=x[b];if(m.setX(v,C[b*a]),a>=2)m.setY(v,C[b*a+1]);if(a>=3)m.setZ(v,C[b*a+2]);if(a>=4)m.setW(v,C[b*a+3]);if(a>=5)throw Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return m})}loadTexture(e){let t=this.json,n=this.options,r=t.textures[e].source,i=t.images[r],s=this.textureLoader;if(i.uri){let a=n.manager.getHandler(i.uri);if(a!==null)s=a}return this.loadTextureImage(e,r,s)}loadTextureImage(e,t,n){let o=this,r=this.json,i=r.textures[e],s=r.images[t],a=(s.uri||s.bufferView)+":"+i.sampler;if(this.textureCache[a])return this.textureCache[a];let c=this.loadImageSource(t,n).then(function(l){if(l.flipY=!1,l.name=i.name||s.name||"",l.name===""&&typeof s.uri==="string"&&s.uri.startsWith("data:image/")===!1)l.name=s.uri;let d=(r.samplers||{})[i.sampler]||{};return l.magFilter=uXn[d.magFilter]||Ec,l.minFilter=uXn[d.minFilter]||Jd,l.wrapS=pXn[d.wrapS]||h3,l.wrapT=pXn[d.wrapT]||h3,o.associations.set(l,{textures:e}),l}).catch(function(){return null});return this.textureCache[a]=c,c}loadImageSource(e,t){let n=this,o=this.json,r=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then((h)=>h.clone());let i=o.images[e],s=self.URL||self.webkitURL,a=i.uri||"",c=!1;if(i.bufferView!==void 0)a=n.getDependency("bufferView",i.bufferView).then(function(h){c=!0;let d=new Blob([h],{type:i.mimeType});return a=s.createObjectURL(d),a});else if(i.uri===void 0)throw Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");let l=Promise.resolve(a).then(function(h){return new Promise(function(d,u){let _=d;if(t.isImageBitmapLoader===!0)_=function(p){let m=new vl(p);m.needsUpdate=!0,d(m)};t.load(R9.resolveURL(h,r.path),_,void 0,u)})}).then(function(h){if(c===!0)s.revokeObjectURL(a);return bT(h,i),h.userData.mimeType=i.mimeType||HBi(i.uri),h}).catch(function(h){throw console.error("THREE.GLTFLoader: Couldn't load texture",a),h});return this.sourceCache[e]=l,l}assignTexture(e,t,n,o){let r=this;return this.getDependency("texture",n.index).then(function(i){if(!i)return null;if(n.texCoord!==void 0&&n.texCoord>0)i=i.clone(),i.channel=n.texCoord;if(r.extensions[Uc.KHR_TEXTURE_TRANSFORM]){let s=n.extensions!==void 0?n.extensions[Uc.KHR_TEXTURE_TRANSFORM]:void 0;if(s){let a=r.associations.get(i);i=r.extensions[Uc.KHR_TEXTURE_TRANSFORM].extendTexture(i,s),r.associations.set(i,a)}}if(o!==void 0){if(typeof o==="number")o=o===hXn?WG:IT;if("colorSpace"in i)i.colorSpace=o;else i.encoding=o===WG?hXn:BBi}return e[t]=i,i})}assignFinalMaterial(e){let{geometry:t,material:n}=e,o=t.attributes.tangent===void 0,r=t.attributes.color!==void 0,i=t.attributes.normal===void 0;if(e.isPoints){let s="PointsMaterial:"+n.uuid,a=this.cache.get(s);if(!a)a=new T9,zA.prototype.copy.call(a,n),a.color.copy(n.color),a.map=n.map,a.sizeAttenuation=!1,this.cache.add(s,a);n=a}else if(e.isLine){let s="LineBasicMaterial:"+n.uuid,a=this.cache.get(s);if(!a)a=new n2,zA.prototype.copy.call(a,n),a.color.copy(n.color),a.map=n.map,this.cache.add(s,a);n=a}if(o||r||i){let s="ClonedMaterial:"+n.uuid+":";if(o)s+="derivative-tangents:";if(r)s+="vertex-colors:";if(i)s+="flat-shading:";let a=this.cache.get(s);if(!a){if(a=n.clone(),r)a.vertexColors=!0;if(i)a.flatShading=!0;if(o){if(a.normalScale)a.normalScale.y*=-1;if(a.clearcoatNormalScale)a.clearcoatNormalScale.y*=-1}this.cache.add(s,a),this.associations.set(a,this.associations.get(n))}n=a}e.material=n}getMaterialType(){return vs}loadMaterial(e){let t=this,n=this.json,o=this.extensions,r=n.materials[e],i,s={},a=r.extensions||{},c=[];if(a[Uc.KHR_MATERIALS_UNLIT]){let h=o[Uc.KHR_MATERIALS_UNLIT];i=h.getMaterialType(),c.push(h.extendParams(s,r,t))}else{let h=r.pbrMetallicRoughness||{};if(s.color=new No(1,1,1),s.opacity=1,Array.isArray(h.baseColorFactor)){let d=h.baseColorFactor;s.color.setRGB(d[0],d[1],d[2],IT),s.opacity=d[3]}if(h.baseColorTexture!==void 0)c.push(t.assignTexture(s,"map",h.baseColorTexture,WG));if(s.metalness=h.metallicFactor!==void 0?h.metallicFactor:1,s.roughness=h.roughnessFactor!==void 0?h.roughnessFactor:1,h.metallicRoughnessTexture!==void 0)c.push(t.assignTexture(s,"metalnessMap",h.metallicRoughnessTexture)),c.push(t.assignTexture(s,"roughnessMap",h.metallicRoughnessTexture));i=this._invokeOne(function(d){return d.getMaterialType&&d.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(d){return d.extendMaterialParams&&d.extendMaterialParams(e,s)})))}if(r.doubleSided===!0)s.side=bd;let l=r.alphaMode||dut.OPAQUE;if(l===dut.BLEND)s.transparent=!0,s.depthWrite=!1;else if(s.transparent=!1,l===dut.MASK)s.alphaTest=r.alphaCutoff!==void 0?r.alphaCutoff:0.5;if(r.normalTexture!==void 0&&i!==Up){if(c.push(t.assignTexture(s,"normalMap",r.normalTexture)),s.normalScale=new ro(1,1),r.normalTexture.scale!==void 0){let h=r.normalTexture.scale;s.normalScale.set(h,h)}}if(r.occlusionTexture!==void 0&&i!==Up){if(c.push(t.assignTexture(s,"aoMap",r.occlusionTexture)),r.occlusionTexture.strength!==void 0)s.aoMapIntensity=r.occlusionTexture.strength}if(r.emissiveFactor!==void 0&&i!==Up){let h=r.emissiveFactor;s.emissive=new No().setRGB(h[0],h[1],h[2],IT)}if(r.emissiveTexture!==void 0&&i!==Up)c.push(t.assignTexture(s,"emissiveMap",r.emissiveTexture,WG));return Promise.all(c).then(function(){let h=new i(s);if(r.name)h.name=r.name;if(bT(h,r),t.associations.set(h,{materials:e}),r.extensions)UG(o,h,r);return h})}createUniqueName(e){let t=dl.sanitizeNodeName(e||"");if(t in this.nodeNamesUsed)return t+"_"+ ++this.nodeNamesUsed[t];else return this.nodeNamesUsed[t]=0,t}loadGeometries(e){let t=this,n=this.extensions,o=this.primitiveCache;function r(s){return n[Uc.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(s,t).then(function(a){return mXn(a,s,t)})}let i=[];for(let s=0,a=e.length;s<a;s++){let c=e[s],l=LBi(c),h=o[l];if(h)i.push(h.promise);else{let d;if(c.extensions&&c.extensions[Uc.KHR_DRACO_MESH_COMPRESSION])d=r(c);else d=mXn(new js,c,t);o[l]={primitive:c,promise:d},i.push(d)}}return Promise.all(i)}loadMesh(e){let t=this,n=this.json,o=this.extensions,r=n.meshes[e],i=r.primitives,s=[];for(let a=0,c=i.length;a<c;a++){let l=i[a].material===void 0?RBi(this.cache):this.getDependency("material",i[a].material);s.push(l)}return s.push(t.loadGeometries(i)),Promise.all(s).then(function(a){let c=a.slice(0,a.length-1),l=a[a.length-1],h=[];for(let u=0,_=l.length;u<_;u++){let p=l[u],m=i[u],A,g=c[u];if(m.mode===Y6.TRIANGLES||m.mode===Y6.TRIANGLE_STRIP||m.mode===Y6.TRIANGLE_FAN||m.mode===void 0){if(A=r.isSkinnedMesh===!0?new vQe(p,g):new Mo(p,g),A.isSkinnedMesh===!0)A.normalizeSkinWeights();if(m.mode===Y6.TRIANGLE_STRIP)A.geometry=lut(A.geometry,FAe);else if(m.mode===Y6.TRIANGLE_FAN)A.geometry=lut(A.geometry,Xre)}else if(m.mode===Y6.LINES)A=new u3(p,g);else if(m.mode===Y6.LINE_STRIP)A=new $re(p,g);else if(m.mode===Y6.LINE_LOOP)A=new qre(p,g);else if(m.mode===Y6.POINTS)A=new pw(p,g);else throw Error("THREE.GLTFLoader: Primitive mode unsupported: "+m.mode);if(Object.keys(A.geometry.morphAttributes).length>0)kBi(A,r);if(A.name=t.createUniqueName(r.name||"mesh_"+e),bT(A,r),m.extensions)UG(o,A,m);t.assignFinalMaterial(A),h.push(A)}for(let u=0,_=h.length;u<_;u++)t.associations.set(h[u],{meshes:e,primitives:u});if(h.length===1){if(r.extensions)UG(o,h[0],r);return h[0]}let d=new Ba;if(r.extensions)UG(o,d,r);t.associations.set(d,{meshes:e});for(let u=0,_=h.length;u<_;u++)d.add(h[u]);return d})}loadCamera(e){let t,n=this.json.cameras[e],o=n[n.type];if(!o){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}if(n.type==="perspective")t=new Pc(t2.radToDeg(o.yfov),o.aspectRatio||1,o.znear||1,o.zfar||2000000);else if(n.type==="orthographic")t=new r5(-o.xmag,o.xmag,o.ymag,-o.ymag,o.znear,o.zfar);if(n.name)t.name=this.createUniqueName(n.name);return bT(t,n),Promise.resolve(t)}loadSkin(e){let t=this.json.skins[e],n=[];for(let o=0,r=t.joints.length;o<r;o++)n.push(this._loadNodeShallow(t.joints[o]));if(t.inverseBindMatrices!==void 0)n.push(this.getDependency("accessor",t.inverseBindMatrices));else n.push(null);return Promise.all(n).then(function(o){let r=o.pop(),i=o,s=[],a=[];for(let c=0,l=i.length;c<l;c++){let h=i[c];if(h){s.push(h);let d=new Gi;if(r!==null)d.fromArray(r.array,c*16);a.push(d)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[c])}return new jAe(s,a)})}loadAnimation(e){let t=this.json,n=this,o=t.animations[e],r=o.name?o.name:"animation_"+e,i=[],s=[],a=[],c=[],l=[];for(let h=0,d=o.channels.length;h<d;h++){let u=o.channels[h],_=o.samplers[u.sampler],p=u.target,m=p.node,A=o.parameters!==void 0?o.parameters[_.input]:_.input,g=o.parameters!==void 0?o.parameters[_.output]:_.output;if(p.node===void 0)continue;i.push(this.getDependency("node",m)),s.push(this.getDependency("accessor",A)),a.push(this.getDependency("accessor",g)),c.push(_),l.push(p)}return Promise.all([Promise.all(i),Promise.all(s),Promise.all(a),Promise.all(c),Promise.all(l)]).then(function(h){let d=h[0],u=h[1],_=h[2],p=h[3],m=h[4],A=[];for(let g=0,f=d.length;g<f;g++){let y=d[g],x=u[g],C=_[g],b=p[g],I=m[g];if(y===void 0)continue;if(y.updateMatrix)y.updateMatrix();let v=n._createAnimationTracks(y,x,C,b,I);if(v)for(let P=0;P<v.length;P++)A.push(v[P])}return new DQe(r,void 0,A)})}createNodeMesh(e){let t=this.json,n=this,o=t.nodes[e];if(o.mesh===void 0)return null;return n.getDependency("mesh",o.mesh).then(function(r){let i=n._getNodeRef(n.meshCache,o.mesh,r);if(o.weights!==void 0)i.traverse(function(s){if(!s.isMesh)return;for(let a=0,c=o.weights.length;a<c;a++)s.morphTargetInfluences[a]=o.weights[a]});return i})}loadNode(e){let t=this.json,n=this,o=t.nodes[e],r=n._loadNodeShallow(e),i=[],s=o.children||[];for(let c=0,l=s.length;c<l;c++)i.push(n.getDependency("node",s[c]));let a=o.skin===void 0?Promise.resolve(null):n.getDependency("skin",o.skin);return Promise.all([r,Promise.all(i),a]).then(function(c){let l=c[0],h=c[1],d=c[2];if(d!==null)l.traverse(function(u){if(!u.isSkinnedMesh)return;u.bind(d,FBi)});for(let u=0,_=h.length;u<_;u++)l.add(h[u]);return l})}_loadNodeShallow(e){let t=this.json,n=this.extensions,o=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];let r=t.nodes[e],i=r.name?o.createUniqueName(r.name):"",s=[],a=o._invokeOne(function(c){return c.createNodeMesh&&c.createNodeMesh(e)});if(a)s.push(a);if(r.camera!==void 0)s.push(o.getDependency("camera",r.camera).then(function(c){return o._getNodeRef(o.cameraCache,r.camera,c)}));return o._invokeAll(function(c){return c.createNodeAttachment&&c.createNodeAttachment(e)}).forEach(function(c){s.push(c)}),this.nodeCache[e]=Promise.all(s).then(function(c){let l;if(r.isBone===!0)l=new XAe;else if(c.length>1)l=new Ba;else if(c.length===1)l=c[0];else l=new Sl;if(l!==c[0])for(let h=0,d=c.length;h<d;h++)l.add(c[h]);if(r.name)l.userData.name=r.name,l.name=i;if(bT(l,r),r.extensions)UG(n,l,r);if(r.matrix!==void 0){let h=new Gi;h.fromArray(r.matrix),l.applyMatrix4(h)}else{if(r.translation!==void 0)l.position.fromArray(r.translation);if(r.rotation!==void 0)l.quaternion.fromArray(r.rotation);if(r.scale!==void 0)l.scale.fromArray(r.scale)}if(!o.associations.has(l))o.associations.set(l,{});return o.associations.get(l).nodes=e,l}),this.nodeCache[e]}loadScene(e){let t=this.extensions,n=this.json.scenes[e],o=this,r=new Ba;if(n.name)r.name=o.createUniqueName(n.name);if(bT(r,n),n.extensions)UG(t,r,n);let i=n.nodes||[],s=[];for(let a=0,c=i.length;a<c;a++)s.push(o.getDependency("node",i[a]));return Promise.all(s).then(function(a){for(let l=0,h=a.length;l<h;l++)r.add(a[l]);let c=(l)=>{let h=new Map;for(let[d,u]of o.associations)if(d instanceof zA||d instanceof vl)h.set(d,u);return l.traverse((d)=>{let u=o.associations.get(d);if(u!=null)h.set(d,u)}),h};return o.associations=c(r),r})}_createAnimationTracks(e,t,n,o,r){let i=[],s=e.name?e.name:e.uuid,a=[];if(WL[r.path]===WL.weights)e.traverse(function(d){if(d.morphTargetInfluences)a.push(d.name?d.name:d.uuid)});else a.push(s);let c;switch(WL[r.path]){case WL.weights:c=pR;break;case WL.rotation:c=gR;break;case WL.position:case WL.scale:c=mR;break;default:switch(n.itemSize){case 1:c=pR;break;case 2:case 3:default:c=mR;break}break}let l=o.interpolation!==void 0?NBi[o.interpolation]:Wre,h=this._getArrayFromAccessor(n);for(let d=0,u=a.length;d<u;d++){let _=new c(a[d]+"."+WL[r.path],t.array,h,l);if(o.interpolation==="CUBICSPLINE")this._createCubicSplineTrackInterpolant(_);i.push(_)}return i}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){let n=mut(t.constructor),o=new Float32Array(t.length);for(let r=0,i=t.length;r<i;r++)o[r]=t[r]*n;t=o}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(n){return new(this instanceof gR?HXn:_ut)(this.times,this.values,this.getValueSize()/3,n)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function zBi(e,t,n){let o=t.attributes,r=new Mu;if(o.POSITION!==void 0){let a=n.json.accessors[o.POSITION],{min:c,max:l}=a;if(c!==void 0&&l!==void 0){if(r.set(new Et(c[0],c[1],c[2]),new Et(l[0],l[1],l[2])),a.normalized){let h=mut(ute[a.componentType]);r.min.multiplyScalar(h),r.max.multiplyScalar(h)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;let i=t.targets;if(i!==void 0){let a=new Et,c=new Et;for(let l=0,h=i.length;l<h;l++){let d=i[l];if(d.POSITION!==void 0){let u=n.json.accessors[d.POSITION],{min:_,max:p}=u;if(_!==void 0&&p!==void 0){if(c.setX(Math.max(Math.abs(_[0]),Math.abs(p[0]))),c.setY(Math.max(Math.abs(_[1]),Math.abs(p[1]))),c.setZ(Math.max(Math.abs(_[2]),Math.abs(p[2]))),u.normalized){let m=mut(ute[u.componentType]);c.multiplyScalar(m)}a.max(c)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}r.expandByVector(a)}e.boundingBox=r;let s=new v_;r.getCenter(s.center),s.radius=r.min.distanceTo(r.max)/2,e.boundingSphere=s}function mXn(e,t,n){let o=t.attributes,r=[];function i(s,a){return n.getDependency("accessor",s).then(function(c){e.setAttribute(a,c)})}for(let s in o){let a=put[s]||s.toLowerCase();if(a in e.attributes)continue;r.push(i(o[s],a))}if(t.indices!==void 0&&!e.index){let s=n.getDependency("accessor",t.indices).then(function(a){e.setIndex(a)});r.push(s)}return bT(e,t),zBi(e,t,n),Promise.all(r).then(function(){return t.targets!==void 0?QBi(e,t.targets,n):e})}var OBi=/^[og]\s*(.+)?/,VBi=/^mtllib /,YBi=/^usemtl /,GBi=/^usemap /,zXn=new Et,gut=new Et,OXn=new Et,VXn=new Et,G6=new Et;function UBi(){let e={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(t,n){if(this.object&&this.object.fromDeclaration===!1){this.object.name=t,this.object.fromDeclaration=n!==!1;return}let o=this.object&&typeof this.object.currentMaterial==="function"?this.object.currentMaterial():void 0;if(this.object&&typeof this.object._finalize==="function")this.object._finalize(!0);if(this.object={name:t||"",fromDeclaration:n!==!1,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(r,i){let s=this._finalize(!1);if(s&&(s.inherited||s.groupCount<=0))this.materials.splice(s.index,1);let a={index:this.materials.length,name:r||"",mtllib:Array.isArray(i)&&i.length>0?i[i.length-1]:"",smooth:s!==void 0?s.smooth:this.smooth,groupStart:s!==void 0?s.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(c){let l={index:typeof c==="number"?c:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return l.clone=this.clone.bind(l),l}};return this.materials.push(a),a},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1];return},_finalize:function(r){let i=this.currentMaterial();if(i&&i.groupEnd===-1)i.groupEnd=this.geometry.vertices.length/3,i.groupCount=i.groupEnd-i.groupStart,i.inherited=!1;if(r&&this.materials.length>1){for(let s=this.materials.length-1;s>=0;s--)if(this.materials[s].groupCount<=0)this.materials.splice(s,1)}if(r&&this.materials.length===0)this.materials.push({name:"",smooth:this.smooth});return i}},o&&o.name&&typeof o.clone==="function"){let r=o.clone(0);r.inherited=!0,this.object.materials.push(r)}this.objects.push(this.object)},finalize:function(){if(this.object&&typeof this.object._finalize==="function")this.object._finalize(!0)},parseVertexIndex:function(t,n){let o=parseInt(t,10);return(o>=0?o-1:o+n/3)*3},parseNormalIndex:function(t,n){let o=parseInt(t,10);return(o>=0?o-1:o+n/3)*3},parseUVIndex:function(t,n){let o=parseInt(t,10);return(o>=0?o-1:o+n/2)*2},addVertex:function(t,n,o){let r=this.vertices,i=this.object.geometry.vertices;i.push(r[t+0],r[t+1],r[t+2]),i.push(r[n+0],r[n+1],r[n+2]),i.push(r[o+0],r[o+1],r[o+2])},addVertexPoint:function(t){let n=this.vertices;this.object.geometry.vertices.push(n[t+0],n[t+1],n[t+2])},addVertexLine:function(t){let n=this.vertices;this.object.geometry.vertices.push(n[t+0],n[t+1],n[t+2])},addNormal:function(t,n,o){let r=this.normals,i=this.object.geometry.normals;i.push(r[t+0],r[t+1],r[t+2]),i.push(r[n+0],r[n+1],r[n+2]),i.push(r[o+0],r[o+1],r[o+2])},addFaceNormal:function(t,n,o){let r=this.vertices,i=this.object.geometry.normals;zXn.fromArray(r,t),gut.fromArray(r,n),OXn.fromArray(r,o),G6.subVectors(OXn,gut),VXn.subVectors(zXn,gut),G6.cross(VXn),G6.normalize(),i.push(G6.x,G6.y,G6.z),i.push(G6.x,G6.y,G6.z),i.push(G6.x,G6.y,G6.z)},addColor:function(t,n,o){let r=this.colors,i=this.object.geometry.colors;if(r[t]!==void 0)i.push(r[t+0],r[t+1],r[t+2]);if(r[n]!==void 0)i.push(r[n+0],r[n+1],r[n+2]);if(r[o]!==void 0)i.push(r[o+0],r[o+1],r[o+2])},addUV:function(t,n,o){let r=this.uvs,i=this.object.geometry.uvs;i.push(r[t+0],r[t+1]),i.push(r[n+0],r[n+1]),i.push(r[o+0],r[o+1])},addDefaultUV:function(){let t=this.object.geometry.uvs;t.push(0,0),t.push(0,0),t.push(0,0)},addUVLine:function(t){let n=this.uvs;this.object.geometry.uvs.push(n[t+0],n[t+1])},addFace:function(t,n,o,r,i,s,a,c,l){let h=this.vertices.length,d=this.parseVertexIndex(t,h),u=this.parseVertexIndex(n,h),_=this.parseVertexIndex(o,h);if(this.addVertex(d,u,_),this.addColor(d,u,_),a!==void 0&&a!==""){let p=this.normals.length;d=this.parseNormalIndex(a,p),u=this.parseNormalIndex(c,p),_=this.parseNormalIndex(l,p),this.addNormal(d,u,_)}else this.addFaceNormal(d,u,_);if(r!==void 0&&r!==""){let p=this.uvs.length;d=this.parseUVIndex(r,p),u=this.parseUVIndex(i,p),_=this.parseUVIndex(s,p),this.addUV(d,u,_),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(t){this.object.geometry.type="Points";let n=this.vertices.length;for(let o=0,r=t.length;o<r;o++){let i=this.parseVertexIndex(t[o],n);this.addVertexPoint(i),this.addColor(i)}},addLineGeometry:function(t,n){this.object.geometry.type="Line";let o=this.vertices.length,r=this.uvs.length;for(let i=0,s=t.length;i<s;i++)this.addVertexLine(this.parseVertexIndex(t[i],o));for(let i=0,s=n.length;i<s;i++)this.addUVLine(this.parseUVIndex(n[i],r))}};return e.startObject("",!1),e}class rMe extends s1{constructor(e){super(e);this.materials=null}load(e,t,n,o){let r=this,i=new Tb(this.manager);i.setPath(this.path),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials),i.load(e,function(s){try{t(r.parse(s))}catch(a){if(o)o(a);else console.error(a);r.manager.itemError(e)}},n,o)}setMaterials(e){return this.materials=e,this}parse(e){let t=new UBi;if(e.indexOf(`\r
`)!==-1)e=e.replace(/\r\n/g,`
`);if(e.indexOf("\\\n")!==-1)e=e.replace(/\\\n/g,"");let n=e.split(`
`),o="",r="",i=0,s=[],a=typeof"".trimLeft==="function";for(let h=0,d=n.length;h<d;h++){if(o=n[h],o=a?o.trimLeft():o.trim(),i=o.length,i===0)continue;if(r=o.charAt(0),r==="#")continue;if(r==="v"){let u=o.split(/\s+/);switch(u[0]){case"v":if(t.vertices.push(parseFloat(u[1]),parseFloat(u[2]),parseFloat(u[3])),u.length>=7)t.colors.push(parseFloat(u[4]),parseFloat(u[5]),parseFloat(u[6]));else t.colors.push(void 0,void 0,void 0);break;case"vn":t.normals.push(parseFloat(u[1]),parseFloat(u[2]),parseFloat(u[3]));break;case"vt":t.uvs.push(parseFloat(u[1]),parseFloat(u[2]));break}}else if(r==="f"){let _=o.substr(1).trim().split(/\s+/),p=[];for(let A=0,g=_.length;A<g;A++){let f=_[A];if(f.length>0){let y=f.split("/");p.push(y)}}let m=p[0];for(let A=1,g=p.length-1;A<g;A++){let f=p[A],y=p[A+1];t.addFace(m[0],f[0],y[0],m[1],f[1],y[1],m[2],f[2],y[2])}}else if(r==="l"){let u=o.substring(1).trim().split(" "),_=[],p=[];if(o.indexOf("/")===-1)_=u;else for(let m=0,A=u.length;m<A;m++){let g=u[m].split("/");if(g[0]!=="")_.push(g[0]);if(g[1]!=="")p.push(g[1])}t.addLineGeometry(_,p)}else if(r==="p"){let _=o.substr(1).trim().split(" ");t.addPointGeometry(_)}else if((s=OBi.exec(o))!==null){let u=(" "+s[0].substr(1).trim()).substr(1);t.startObject(u)}else if(YBi.test(o))t.object.startMaterial(o.substring(7).trim(),t.materialLibraries);else if(VBi.test(o))t.materialLibraries.push(o.substring(7).trim());else if(GBi.test(o))console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if(r==="s"){if(s=o.split(" "),s.length>1){let _=s[1].trim().toLowerCase();t.object.smooth=_!=="0"&&_!=="off"}else t.object.smooth=!0;let u=t.object.currentMaterial();if(u)u.smooth=t.object.smooth}else{if(o==="\x00")continue;console.warn('THREE.OBJLoader: Unexpected line: "'+o+'"')}}t.finalize();let c=new Ba;if(c.materialLibraries=[].concat(t.materialLibraries),!(t.objects.length===1&&t.objects[0].geometry.vertices.length===0)===!0)for(let h=0,d=t.objects.length;h<d;h++){let u=t.objects[h],{geometry:_,materials:p}=u,m=_.type==="Line",A=_.type==="Points",g=!1;if(_.vertices.length===0)continue;let f=new js;if(f.setAttribute("position",new Wr(_.vertices,3)),_.normals.length>0)f.setAttribute("normal",new Wr(_.normals,3));if(_.colors.length>0)g=!0,f.setAttribute("color",new Wr(_.colors,3));if(_.hasUVIndices===!0)f.setAttribute("uv",new Wr(_.uvs,2));let y=[];for(let C=0,b=p.length;C<b;C++){let I=p[C],v=I.name+"_"+I.smooth+"_"+g,P=t.materials[v];if(this.materials!==null){if(P=this.materials.create(I.name),m&&P&&!(P instanceof n2)){let M=new n2;zA.prototype.copy.call(M,P),M.color.copy(P.color),P=M}else if(A&&P&&!(P instanceof T9)){let M=new T9({size:10,sizeAttenuation:!1});zA.prototype.copy.call(M,P),M.color.copy(P.color),M.map=P.map,P=M}}if(P===void 0){if(m)P=new n2;else if(A)P=new T9({size:1,sizeAttenuation:!1});else P=new Bz;P.name=I.name,P.flatShading=I.smooth?!1:!0,P.vertexColors=g,t.materials[v]=P}y.push(P)}let x;if(y.length>1){for(let C=0,b=p.length;C<b;C++){let I=p[C];f.addGroup(I.groupStart,I.groupCount,C)}if(m)x=new u3(f,y);else if(A)x=new pw(f,y);else x=new Mo(f,y)}else if(m)x=new u3(f,y[0]);else if(A)x=new pw(f,y[0]);else x=new Mo(f,y[0]);x.name=u.name,c.add(x)}else if(t.vertices.length>0){let h=new T9({size:1,sizeAttenuation:!1}),d=new js;if(d.setAttribute("position",new Wr(t.vertices,3)),t.colors.length>0&&t.colors[0]!==void 0)d.setAttribute("color",new Wr(t.colors,3)),h.vertexColors=!0;let u=new pw(d,h);c.add(u)}return c}}var hC=at(ln(),1);var Ueo=at(lo(),1);var Dte=at(ln(),1),Xeo=at(lo(),1),Vwe=at(ln(),1);var jeo=at(ln(),1);var Keo=at(lo(),1),Ywe=at(ln(),1);var $eo=at(lo(),1);var Jeo=at(ln(),1),h4=at(lo(),1),fE=at(ln(),1);var j6=at(ln(),1),tto=at(lo(),1),Af=at(ln(),1);var ito=at(lo(),1),d4=at(ln(),1);var RT=at(ln(),1),sA=at(ln(),1);var KMe=at(lo(),1),Gwe=at(ln(),1);var Mpe=at(ln(),1);var NT=at(ln(),1);var YXn={type:"change"},Aut={type:"start"},GXn={type:"end"},iMe=new V7,UXn=new Mb,WBi=Math.cos(70*t2.DEG2RAD);class fut extends uw{constructor(e,t){super();this.object=e,this.domElement=t,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new Et,this.cursor=new Et,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=0.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:e2.ROTATE,MIDDLE:e2.DOLLY,RIGHT:e2.PAN},this.touches={ONE:o5.ROTATE,TWO:o5.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return s.phi},this.getAzimuthalAngle=function(){return s.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(ht){ht.addEventListener("keydown",dt),this._domElementKeyEvents=ht},this.stopListenToKeyEvents=function(){this._domElementKeyEvents.removeEventListener("keydown",dt),this._domElementKeyEvents=null},this.saveState=function(){n.target0.copy(n.target),n.position0.copy(n.object.position),n.zoom0=n.object.zoom},this.reset=function(){n.target.copy(n.target0),n.object.position.copy(n.position0),n.object.zoom=n.zoom0,n.object.updateProjectionMatrix(),n.dispatchEvent(YXn),n.update(),r=o.NONE},this.update=function(){let ht=new Et,We=new Eu().setFromUnitVectors(e.up,new Et(0,1,0)),Le=We.clone().invert(),Ze=new Et,$e=new Eu,qe=new Et,ft=2*Math.PI;return function(ze=null){let Xe=n.object.position;if(ht.copy(Xe).sub(n.target),ht.applyQuaternion(We),s.setFromVector3(ht),n.autoRotate&&r===o.NONE)B(P(ze));if(n.enableDamping)s.theta+=a.theta*n.dampingFactor,s.phi+=a.phi*n.dampingFactor;else s.theta+=a.theta,s.phi+=a.phi;let{minAzimuthAngle:it,maxAzimuthAngle:St}=n;if(isFinite(it)&&isFinite(St)){if(it<-Math.PI)it+=ft;else if(it>Math.PI)it-=ft;if(St<-Math.PI)St+=ft;else if(St>Math.PI)St-=ft;if(it<=St)s.theta=Math.max(it,Math.min(St,s.theta));else s.theta=s.theta>(it+St)/2?Math.max(it,s.theta):Math.min(St,s.theta)}if(s.phi=Math.max(n.minPolarAngle,Math.min(n.maxPolarAngle,s.phi)),s.makeSafe(),n.enableDamping===!0)n.target.addScaledVector(l,n.dampingFactor);else n.target.add(l);n.target.sub(n.cursor),n.target.clampLength(n.minTargetRadius,n.maxTargetRadius),n.target.add(n.cursor);let kt=!1;if(n.zoomToCursor&&C||n.object.isOrthographicCamera)s.radius=U(s.radius);else{let Lt=s.radius;s.radius=U(s.radius*c),kt=Lt!=s.radius}if(ht.setFromSpherical(s),ht.applyQuaternion(Le),Xe.copy(n.target).add(ht),n.object.lookAt(n.target),n.enableDamping===!0)a.theta*=1-n.dampingFactor,a.phi*=1-n.dampingFactor,l.multiplyScalar(1-n.dampingFactor);else a.set(0,0,0),l.set(0,0,0);if(n.zoomToCursor&&C){let Lt=null;if(n.object.isPerspectiveCamera){let Wt=ht.length();Lt=U(Wt*c);let bn=Wt-Lt;n.object.position.addScaledVector(y,bn),n.object.updateMatrixWorld(),kt=!!bn}else if(n.object.isOrthographicCamera){let Wt=new Et(x.x,x.y,0);Wt.unproject(n.object);let bn=n.object.zoom;n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/c)),n.object.updateProjectionMatrix(),kt=bn!==n.object.zoom;let pn=new Et(x.x,x.y,0);pn.unproject(n.object),n.object.position.sub(pn).add(Wt),n.object.updateMatrixWorld(),Lt=ht.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),n.zoomToCursor=!1;if(Lt!==null)if(this.screenSpacePanning)n.target.set(0,0,-1).transformDirection(n.object.matrix).multiplyScalar(Lt).add(n.object.position);else if(iMe.origin.copy(n.object.position),iMe.direction.set(0,0,-1).transformDirection(n.object.matrix),Math.abs(n.object.up.dot(iMe.direction))<WBi)e.lookAt(n.target);else UXn.setFromNormalAndCoplanarPoint(n.object.up,n.target),iMe.intersectPlane(UXn,n.target)}else if(n.object.isOrthographicCamera){let Lt=n.object.zoom;if(n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/c)),Lt!==n.object.zoom)n.object.updateProjectionMatrix(),kt=!0}if(c=1,C=!1,kt||Ze.distanceToSquared(n.object.position)>i||8*(1-$e.dot(n.object.quaternion))>i||qe.distanceToSquared(n.target)>i)return n.dispatchEvent(YXn),Ze.copy(n.object.position),$e.copy(n.object.quaternion),qe.copy(n.target),!0;return!1}}(),this.dispose=function(){if(n.domElement.removeEventListener("contextmenu",lt),n.domElement.removeEventListener("pointerdown",Me),n.domElement.removeEventListener("pointercancel",we),n.domElement.removeEventListener("wheel",Se),n.domElement.removeEventListener("pointermove",Re),n.domElement.removeEventListener("pointerup",we),n.domElement.getRootNode().removeEventListener("keydown",ke,{capture:!0}),n._domElementKeyEvents!==null)n._domElementKeyEvents.removeEventListener("keydown",dt),n._domElementKeyEvents=null};let n=this,o={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},r=o.NONE,i=0.000001,s=new gw,a=new gw,c=1,l=new Et,h=new ro,d=new ro,u=new ro,_=new ro,p=new ro,m=new ro,A=new ro,g=new ro,f=new ro,y=new Et,x=new ro,C=!1,b=[],I={},v=!1;function P(ht){if(ht!==null)return 2*Math.PI/60*n.autoRotateSpeed*ht;else return 2*Math.PI/60/60*n.autoRotateSpeed}function M(ht){let We=Math.abs(ht*0.01);return Math.pow(0.95,n.zoomSpeed*We)}function B(ht){a.theta-=ht}function T(ht){a.phi-=ht}let N=function(){let ht=new Et;return function(Le,Ze){ht.setFromMatrixColumn(Ze,0),ht.multiplyScalar(-Le),l.add(ht)}}(),D=function(){let ht=new Et;return function(Le,Ze){if(n.screenSpacePanning===!0)ht.setFromMatrixColumn(Ze,1);else ht.setFromMatrixColumn(Ze,0),ht.crossVectors(n.object.up,ht);ht.multiplyScalar(Le),l.add(ht)}}(),L=function(){let ht=new Et;return function(Le,Ze){let $e=n.domElement;if(n.object.isPerspectiveCamera){let qe=n.object.position;ht.copy(qe).sub(n.target);let ft=ht.length();ft*=Math.tan(n.object.fov/2*Math.PI/180),N(2*Le*ft/$e.clientHeight,n.object.matrix),D(2*Ze*ft/$e.clientHeight,n.object.matrix)}else if(n.object.isOrthographicCamera)N(Le*(n.object.right-n.object.left)/n.object.zoom/$e.clientWidth,n.object.matrix),D(Ze*(n.object.top-n.object.bottom)/n.object.zoom/$e.clientHeight,n.object.matrix);else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),n.enablePan=!1}}();function H(ht){if(n.object.isPerspectiveCamera||n.object.isOrthographicCamera)c/=ht;else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1}function V(ht){if(n.object.isPerspectiveCamera||n.object.isOrthographicCamera)c*=ht;else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1}function O(ht,We){if(!n.zoomToCursor)return;C=!0;let Le=n.domElement.getBoundingClientRect(),Ze=ht-Le.left,$e=We-Le.top,{width:qe,height:ft}=Le;x.x=Ze/qe*2-1,x.y=-($e/ft)*2+1,y.set(x.x,x.y,1).unproject(n.object).sub(n.object.position).normalize()}function U(ht){return Math.max(n.minDistance,Math.min(n.maxDistance,ht))}function j(ht){h.set(ht.clientX,ht.clientY)}function Y(ht){O(ht.clientX,ht.clientX),A.set(ht.clientX,ht.clientY)}function X(ht){_.set(ht.clientX,ht.clientY)}function K(ht){d.set(ht.clientX,ht.clientY),u.subVectors(d,h).multiplyScalar(n.rotateSpeed);let We=n.domElement;B(2*Math.PI*u.x/We.clientHeight),T(2*Math.PI*u.y/We.clientHeight),h.copy(d),n.update()}function J(ht){if(g.set(ht.clientX,ht.clientY),f.subVectors(g,A),f.y>0)H(M(f.y));else if(f.y<0)V(M(f.y));A.copy(g),n.update()}function ee(ht){p.set(ht.clientX,ht.clientY),m.subVectors(p,_).multiplyScalar(n.panSpeed),L(m.x,m.y),_.copy(p),n.update()}function se(ht){if(O(ht.clientX,ht.clientY),ht.deltaY<0)V(M(ht.deltaY));else if(ht.deltaY>0)H(M(ht.deltaY));n.update()}function ne(ht){let We=!1;switch(ht.code){case n.keys.UP:if(ht.ctrlKey||ht.metaKey||ht.shiftKey)T(2*Math.PI*n.rotateSpeed/n.domElement.clientHeight);else L(0,n.keyPanSpeed);We=!0;break;case n.keys.BOTTOM:if(ht.ctrlKey||ht.metaKey||ht.shiftKey)T(-2*Math.PI*n.rotateSpeed/n.domElement.clientHeight);else L(0,-n.keyPanSpeed);We=!0;break;case n.keys.LEFT:if(ht.ctrlKey||ht.metaKey||ht.shiftKey)B(2*Math.PI*n.rotateSpeed/n.domElement.clientHeight);else L(n.keyPanSpeed,0);We=!0;break;case n.keys.RIGHT:if(ht.ctrlKey||ht.metaKey||ht.shiftKey)B(-2*Math.PI*n.rotateSpeed/n.domElement.clientHeight);else L(-n.keyPanSpeed,0);We=!0;break}if(We)ht.preventDefault(),n.update()}function re(ht){if(b.length===1)h.set(ht.pageX,ht.pageY);else{let We=et(ht),Le=0.5*(ht.pageX+We.x),Ze=0.5*(ht.pageY+We.y);h.set(Le,Ze)}}function Z(ht){if(b.length===1)_.set(ht.pageX,ht.pageY);else{let We=et(ht),Le=0.5*(ht.pageX+We.x),Ze=0.5*(ht.pageY+We.y);_.set(Le,Ze)}}function te(ht){let We=et(ht),Le=ht.pageX-We.x,Ze=ht.pageY-We.y,$e=Math.sqrt(Le*Le+Ze*Ze);A.set(0,$e)}function ie(ht){if(n.enableZoom)te(ht);if(n.enablePan)Z(ht)}function le(ht){if(n.enableZoom)te(ht);if(n.enableRotate)re(ht)}function ue(ht){if(b.length==1)d.set(ht.pageX,ht.pageY);else{let Le=et(ht),Ze=0.5*(ht.pageX+Le.x),$e=0.5*(ht.pageY+Le.y);d.set(Ze,$e)}u.subVectors(d,h).multiplyScalar(n.rotateSpeed);let We=n.domElement;B(2*Math.PI*u.x/We.clientHeight),T(2*Math.PI*u.y/We.clientHeight),h.copy(d)}function de(ht){if(b.length===1)p.set(ht.pageX,ht.pageY);else{let We=et(ht),Le=0.5*(ht.pageX+We.x),Ze=0.5*(ht.pageY+We.y);p.set(Le,Ze)}m.subVectors(p,_).multiplyScalar(n.panSpeed),L(m.x,m.y),_.copy(p)}function me(ht){let We=et(ht),Le=ht.pageX-We.x,Ze=ht.pageY-We.y,$e=Math.sqrt(Le*Le+Ze*Ze);g.set(0,$e),f.set(0,Math.pow(g.y/A.y,n.zoomSpeed)),H(f.y),A.copy(g);let qe=(ht.pageX+We.x)*0.5,ft=(ht.pageY+We.y)*0.5;O(qe,ft)}function Ae(ht){if(n.enableZoom)me(ht);if(n.enablePan)de(ht)}function xe(ht){if(n.enableZoom)me(ht);if(n.enableRotate)ue(ht)}function Me(ht){if(n.enabled===!1)return;if(b.length===0)n.domElement.setPointerCapture(ht.pointerId),n.domElement.addEventListener("pointermove",Re),n.domElement.addEventListener("pointerup",we);if(Ht(ht))return;if(Ct(ht),ht.pointerType==="touch")rt(ht);else _e(ht)}function Re(ht){if(n.enabled===!1)return;if(ht.pointerType==="touch")mt(ht);else ye(ht)}function we(ht){switch(Nt(ht),b.length){case 0:n.domElement.releasePointerCapture(ht.pointerId),n.domElement.removeEventListener("pointermove",Re),n.domElement.removeEventListener("pointerup",we),n.dispatchEvent(GXn),r=o.NONE;break;case 1:let We=b[0],Le=I[We];rt({pointerId:We,pageX:Le.x,pageY:Le.y});break}}function _e(ht){let We;switch(ht.button){case 0:We=n.mouseButtons.LEFT;break;case 1:We=n.mouseButtons.MIDDLE;break;case 2:We=n.mouseButtons.RIGHT;break;default:We=-1}switch(We){case e2.DOLLY:if(n.enableZoom===!1)return;Y(ht),r=o.DOLLY;break;case e2.ROTATE:if(ht.ctrlKey||ht.metaKey||ht.shiftKey){if(n.enablePan===!1)return;X(ht),r=o.PAN}else{if(n.enableRotate===!1)return;j(ht),r=o.ROTATE}break;case e2.PAN:if(ht.ctrlKey||ht.metaKey||ht.shiftKey){if(n.enableRotate===!1)return;j(ht),r=o.ROTATE}else{if(n.enablePan===!1)return;X(ht),r=o.PAN}break;default:r=o.NONE}if(r!==o.NONE)n.dispatchEvent(Aut)}function ye(ht){switch(r){case o.ROTATE:if(n.enableRotate===!1)return;K(ht);break;case o.DOLLY:if(n.enableZoom===!1)return;J(ht);break;case o.PAN:if(n.enablePan===!1)return;ee(ht);break}}function Se(ht){if(n.enabled===!1||n.enableZoom===!1||r!==o.NONE)return;ht.preventDefault(),n.dispatchEvent(Aut),se(Ne(ht)),n.dispatchEvent(GXn)}function Ne(ht){let We=ht.deltaMode,Le={clientX:ht.clientX,clientY:ht.clientY,deltaY:ht.deltaY};switch(We){case 1:Le.deltaY*=16;break;case 2:Le.deltaY*=100;break}if(ht.ctrlKey&&!v)Le.deltaY*=10;return Le}function ke(ht){if(ht.key==="Control")v=!0,n.domElement.getRootNode().addEventListener("keyup",nt,{passive:!0,capture:!0})}function nt(ht){if(ht.key==="Control")v=!1,n.domElement.getRootNode().removeEventListener("keyup",nt,{passive:!0,capture:!0})}function dt(ht){if(n.enabled===!1||n.enablePan===!1)return;ne(ht)}function rt(ht){switch(Tt(ht),b.length){case 1:switch(n.touches.ONE){case o5.ROTATE:if(n.enableRotate===!1)return;re(ht),r=o.TOUCH_ROTATE;break;case o5.PAN:if(n.enablePan===!1)return;Z(ht),r=o.TOUCH_PAN;break;default:r=o.NONE}break;case 2:switch(n.touches.TWO){case o5.DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;ie(ht),r=o.TOUCH_DOLLY_PAN;break;case o5.DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;le(ht),r=o.TOUCH_DOLLY_ROTATE;break;default:r=o.NONE}break;default:r=o.NONE}if(r!==o.NONE)n.dispatchEvent(Aut)}function mt(ht){switch(Tt(ht),r){case o.TOUCH_ROTATE:if(n.enableRotate===!1)return;ue(ht),n.update();break;case o.TOUCH_PAN:if(n.enablePan===!1)return;de(ht),n.update();break;case o.TOUCH_DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;Ae(ht),n.update();break;case o.TOUCH_DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;xe(ht),n.update();break;default:r=o.NONE}}function lt(ht){if(n.enabled===!1)return;ht.preventDefault()}function Ct(ht){b.push(ht.pointerId)}function Nt(ht){delete I[ht.pointerId];for(let We=0;We<b.length;We++)if(b[We]==ht.pointerId){b.splice(We,1);return}}function Ht(ht){for(let We=0;We<b.length;We++)if(b[We]==ht.pointerId)return!0;return!1}function Tt(ht){let We=I[ht.pointerId];if(We===void 0)We=new ro,I[ht.pointerId]=We;We.set(ht.pageX,ht.pageY)}function et(ht){let We=ht.pointerId===b[0]?b[1]:b[0];return I[We]}n.domElement.addEventListener("contextmenu",lt),n.domElement.addEventListener("pointerdown",Me),n.domElement.addEventListener("pointercancel",we),n.domElement.addEventListener("wheel",Se,{passive:!1}),n.domElement.getRootNode().addEventListener("keydown",ke,{passive:!0,capture:!0}),this.update()}}var Uwe=at(ln(),1);var hto=at(lo(),1),qpe=at(ln(),1);er();var V1=at(lo(),1),wpe=at(ln(),1),_to=at(gjn(),1),Ute=at(ln(),1);er();er();var pC=at(ln(),1),Wwe=at(ln(),1);er();var QT=at(lo(),1),Nte=at(ln(),1);er();H9();H9();var vT=at(As(),1),Ljn=at(As(),1),Hjn=at(As(),1),uMe=at(As(),1),XL=at(As(),1),zjn=at(As(),1);var dTi={"0":[[{x:0.019944796633211075,y:0.35828068632415006},{x:0.020222641007547733,y:0.3550960892473839},{x:0.020327535068617307,y:0.3519011161217302},{x:0.02060526835904108,y:0.3507104904820116},{x:0.02071153113201321,y:0.34949252766745387},{x:0.047065531132013214,y:0.20882352766745393},{x:0.047989939967683706,y:0.20564918300405605},{x:0.04875673163473768,y:0.20243312543665407},{x:0.04922094308839032,y:0.20142201853303832},{x:0.04953201774467938,y:0.20035381349539033},{x:0.05105794824635218,y:0.1974208061920286},{x:0.05243742793298141,y:0.1944161379022362},{x:0.1205174279329814,y:0.07784313790223615},{x:0.1216536619223176,y:0.07627409360623287},{x:0.12261018498510404,y:0.07458945972562232},{x:0.1242345189777056,y:0.07271014544101197},{x:0.12569143736362237,y:0.07069826276137084},{x:0.12711194429242206,y:0.06938103546641537},{x:0.12837874379901673,y:0.06791537974577894},{x:0.130338502698373,y:0.06638906779986004},{x:0.132159925645859,y:0.06470007355882942},{x:0.13381011622947792,y:0.06368528357115737},{x:0.13533850978527173,y:0.062494930337889824},{x:0.2330665097852717,y:0.000743930337889824},{x:0.2364974226485404,y:-0.000978818921256936},{x:0.23988324554357096,y:-0.0027885789630079164},{x:0.24043487144166406,y:-0.0029559128497863825},{x:0.24095002304009888,y:-0.0032145836671228292},{x:0.2446511035824589,y:-0.0042348928870151745},{x:0.24832493550927423,y:-0.005349337618145378},{x:0.24889860729226898,y:-0.005405839357118937},{x:0.2494543245702404,y:-0.005559038796006631},{x:0.2532833423420387,y:-0.0058376980655201055},{x:0.257104,y:-0.006214000000000011},{x:0.344948,y:-0.006214000000000011},{x:0.34876845169289644,y:-0.005837718351308385},{x:0.352597265623821,y:-0.005559109487024962},{x:0.35315318526669126,y:-0.00540585978827806},{x:0.3537270644907258,y:-0.005349337618145378},{x:0.3574006983675983,y:-0.004234952964808514},{x:0.36110158881940224,y:-0.0032147329490055873},{x:0.36161692908913895,y:-0.0029559733581057666},{x:0.36216875445642904,y:-0.0027885789630079164},{x:0.36555439482758706,y:-0.000978916482299381},{x:0.3689851386556908,y:0.0007437082019616584},{x:0.4667151386556908,y:0.06249470820196166},{x:0.46824382031514195,y:0.0636852631221029},{x:0.4698943035897058,y:0.06470024765114774},{x:0.4717154585013725,y:0.06638901501054441},{x:0.47367495473362387,y:0.0679150932923645},{x:0.4749419974608878,y:0.0693810030307532},{x:0.47636275350351887,y:0.0706984782301942},{x:0.4778194532662604,y:0.07271008609647399},{x:0.47944357522443626,y:0.07458911996296573},{x:0.4804002872780698,y:0.07627405043044727},{x:0.48153671723081914,y:0.07784338646721853},{x:0.5496157172308191,y:0.19441638646721857},{x:0.5509951179002539,y:0.19742093333312605},{x:0.5525209822553206,y:0.20035381349539033},{x:0.5528320971760705,y:0.20142215679791795},{x:0.5532963622471587,y:0.2024333975455826},{x:0.5540631001039363,y:0.20564932060673602},{x:0.5549874688679868,y:0.20882352766745393},{x:0.5813414688679868,y:0.34949252766745387},{x:0.5814477200321959,y:0.3507103574246747},{x:0.581725430046729,y:0.351900851345405},{x:0.5818303474337426,y:0.35509595676374855},{x:0.5821082033667889,y:0.35828068632415006},{x:0.5819748261451739,y:0.3594958443979094},{x:0.5820149461972951,y:0.36071764184793353},{x:0.5710349461972951,y:0.5284976418479336},{x:0.5705756858728281,y:0.5312810757499365},{x:0.5703149436633981,y:0.5340900680661724},{x:0.5698592272920282,y:0.5356233082419208},{x:0.5695988288779222,y:0.5372015019922555},{x:0.5686053720955593,y:0.5398418557477263},{x:0.5678016327590553,y:0.5425460057826548},{x:0.5216826327590552,y:0.6556800057826547},{x:0.5211943471023096,y:0.656605995281004},{x:0.5208498728309648,y:0.6575945381025444},{x:0.5191405880551111,y:0.6605007631972294},{x:0.5175679428069421,y:0.6634831423933323},{x:0.5169083878327574,y:0.664296079457111},{x:0.5163776774005638,y:0.665198424109003},{x:0.5141342596628157,y:0.6677153419860701},{x:0.5120099990343735,y:0.6703336077343061},{x:0.511204521070525,y:0.6710022516480534},{x:0.510507969381766,y:0.6717837215313657},{x:0.425955969381766,y:0.7497057215313657},{x:0.4243831978740034,y:0.750892537075826},{x:0.42294870744900304,y:0.7522432326643229},{x:0.4208707687817478,y:0.7535430209032156},{x:0.4189143183619635,y:0.7550193610827685},{x:0.4171402309909699,y:0.7558765397994217},{x:0.4154697962599445,y:0.7569214269519826},{x:0.41317820849544135,y:0.7577908544006052},{x:0.41097133104084405,y:0.7588571425751742},{x:0.40906410498936707,y:0.7593517435666508},{x:0.4072219198222394,y:0.7600506678559823},{x:0.3127869198222394,y:0.7856226678559822},{x:0.3097655669518694,y:0.7861297177594856},{x:0.3067801557646532,y:0.7868174624905968},{x:0.3054245519856559,y:0.7868582361795984},{x:0.30408703940192616,y:0.7870827004032797},{x:0.3010248204508113,y:0.7869905707806608},{x:0.2979626007613803,y:0.7870826758597451},{x:0.29662508997676323,y:0.7868582009159747},{x:0.29526948652460844,y:0.786817416361878},{x:0.2922840808497275,y:0.7861296477028675},{x:0.28926273204343433,y:0.7856225735833884},{x:0.19483073204343437,y:0.7600505735833885},{x:0.19298859701529922,y:0.7593516514268194},{x:0.1910814199885863,y:0.7588570511522524},{x:0.1888745059729717,y:0.757790729268721},{x:0.18658288068670334,y:0.7569212665731724},{x:0.18491249471518256,y:0.7558763912940257},{x:0.18313845528709377,y:0.7550192228447639},{x:0.18118197558509466,y:0.7535428424712565},{x:0.17910400699337814,y:0.7522430123425641},{x:0.17766956207459372,y:0.7508923379118444},{x:0.17609683558545802,y:0.7497055417906873},{x:0.09154583558545802,y:0.6717835417906872},{x:0.09084937681091164,y:0.6710021668773223},{x:0.09004400096562647,y:0.6703336077343061},{x:0.087919657143162,y:0.6677152394449524},{x:0.08567616637982708,y:0.6651982097729843},{x:0.0851455285488078,y:0.6642959763928821},{x:0.08448605719305789,y:0.6634831423933323},{x:0.08291335035419628,y:0.6605006463960624},{x:0.08120401576602496,y:0.6575942974079984},{x:0.08085959099279398,y:0.6566058778839782},{x:0.08037136724094471,y:0.6556800057826547},{x:0.03425236724094472,y:0.5425460057826548},{x:0.03344866581310472,y:0.5398419832899659},{x:0.03245524021837327,y:0.537201759963462},{x:0.0321948107181119,y:0.5356234361255728},{x:0.03173905633660196,y:0.5340900680661724},{x:0.03147832642517492,y:0.5312812082371015},{x:0.031019071243648687,y:0.5284979083423142},{x:0.020038071243648682,y:0.36071790834231426},{x:0.020078188427320915,y:0.3594959771633442},{x:0.019944796633211075,y:0.35828068632415006}],[{x:0.11021604810185967,y:0.3604951889884744},{x:0.12035004420691338,y:0.5153337161267963},{x:0.1599220965290545,y:0.612407472440097},{x:0.22898846858521874,y:0.6760588762479813},{x:0.301025186831377,y:0.6955662779655215},{x:0.373064807645506,y:0.6760587099720985},{x:0.44213195602343713,y:0.6124073435241713},{x:0.48170390405887986,y:0.5153338430353971},{x:0.49183697687726113,y:0.3604953223188204},{x:0.4679633532090146,y:0.23306575687188358},{x:0.4093572783633461,y:0.13271343144136735},{x:0.3319224534250481,y:0.08378599999999999},{x:0.27012977192577264,y:0.08378599999999999},{x:0.19269670382412518,y:0.13271332265415062},{x:0.13408961949133952,y:0.23306590258843124},{x:0.11021604810185967,y:0.3604951889884744}]],"1":[[{x:0.17556757075794932,y:0.5951166967821685},{x:0.17573368487361973,y:0.586296718297643},{x:0.17761729959585784,y:0.5776786204828649},{x:0.18114602866723137,y:0.5695935920037709},{x:0.1861842650084615,y:0.5623523359706766},{x:0.19253839202243023,y:0.5562331297919906},{x:0.19996422417142623,y:0.5514711311294693},{x:0.20817639089041826,y:0.548249340921154},{x:0.21685930321783156,y:0.5466915707579493},{x:0.225679281702357,y:0.5468576848736197},{x:0.2342973795171352,y:0.5487412995958578},{x:0.24238240799622912,y:0.5522700286672314},{x:0.24962366402932343,y:0.5573082650084615},{x:0.33662600000000004,y:0.6314944876419193},{x:0.33662600000000004,y:0.051034000000000024},{x:0.33749066238185466,y:0.042254935509274234},{x:0.3400514210369921,y:0.033813245543570986},{x:0.3442098674463855,y:0.026033339514117928},{x:0.34980619484660536,y:0.019214194846605387},{x:0.35662533951411796,y:0.013617867446385483},{x:0.364405245543571,y:0.00945942103699212},{x:0.3728469355092743,y:0.006898662381854659},{x:0.381626,y:0.0060340000000000255},{x:0.3904050644907258,y:0.006898662381854659},{x:0.3988467544564291,y:0.00945942103699212},{x:0.40662666048588214,y:0.01361786744638549},{x:0.4134458051533947,y:0.019214194846605387},{x:0.41904213255361455,y:0.026033339514117928},{x:0.42320057896300795,y:0.033813245543570986},{x:0.4257613376181454,y:0.042254935509274255},{x:0.426626,y:0.051034000000000024},{x:0.426626,y:0.729004},{x:0.42636789988195944,y:0.7316245344755278},{x:0.4263183151263803,y:0.7342572817023569},{x:0.42593657376816557,y:0.7360038620015019},{x:0.4257613376181454,y:0.7377830644907257},{x:0.42499695590681574,y:0.7403028932959718},{x:0.4244347004041422,y:0.7428753795171351},{x:0.42371955318609683,y:0.744513925721078},{x:0.42320057896300795,y:0.746224754456429},{x:0.4219592904188853,y:0.7485470419835442},{x:0.42090597133276864,y:0.7509604079962291},{x:0.419884900961423,y:0.7524279516932593},{x:0.41904213255361455,y:0.7540046604858821},{x:0.41737163919932724,y:0.7560401625275525},{x:0.41586773499153856,y:0.7582016640293234},{x:0.4145799806286405,y:0.7594418083381722},{x:0.4134458051533947,y:0.7608238051533946},{x:0.41141030311172405,y:0.7624942985076821},{x:0.4095136079775698,y:0.7643208702080094},{x:0.40800865730110464,y:0.7652859570783687},{x:0.40662666048588214,y:0.7664201325536145},{x:0.40430437295876726,y:0.767661421097737},{x:0.4020877758285738,y:0.7690828688705307},{x:0.4004234632490515,y:0.7697358105551997},{x:0.3988467544564291,y:0.7705785789630079},{x:0.39632692565118355,y:0.7713429606743374},{x:0.3938756091095818,y:0.772304659078846},{x:0.39211589322607654,y:0.7726203633950566},{x:0.3904050644907258,y:0.7731393376181454},{x:0.3877845300151986,y:0.7733974377361859},{x:0.3851926967821685,y:0.7738624292420507},{x:0.38340520248922366,y:0.7738287638499798},{x:0.381626,y:0.774004},{x:0.37900546552447173,y:0.7737458998819594},{x:0.376372718297643,y:0.7736963151263803},{x:0.37462613799849803,y:0.7733145737681656},{x:0.3728469355092743,y:0.7731393376181454},{x:0.3703271067040287,y:0.7723749559068158},{x:0.36775462048286484,y:0.7718127004041422},{x:0.3661160742789217,y:0.7710975531860966},{x:0.364405245543571,y:0.7705785789630079},{x:0.3620829580164563,y:0.7693372904188854},{x:0.3596695920037709,y:0.7682839713327686},{x:0.35820204830674063,y:0.7672629009614229},{x:0.35662533951411796,y:0.7664201325536145},{x:0.3545898374724472,y:0.7647496391993269},{x:0.35242833597067663,y:0.7632457349915385},{x:0.1912283359706766,y:0.6257917349915385},{x:0.18510912979199054,y:0.6194376079775697},{x:0.18034713112946932,y:0.6120117758285738},{x:0.17712534092115398,y:0.6037996091095817},{x:0.17556757075794932,y:0.5951166967821685}]],"2":[[{x:0.034589999999999996,y:0.05195499999999997},{x:0.034692251306008066,y:0.05091682506774448},{x:0.03463809526377374,y:0.04987503351343359},{x:0.03512383076438082,y:0.04653492529109402},{x:0.03545466238185463,y:0.043175935509274184},{x:0.03575748683953214,y:0.042177657057450094},{x:0.03590761484026801,y:0.04114531791601493},{x:0.0370356398580977,y:0.03796415123181852},{x:0.03801542103699209,y:0.034734245543570935},{x:0.03850718127225641,y:0.0338142268532408},{x:0.03885582398108696,y:0.03283101233894428},{x:0.040582789147307716,y:0.02993103764454602},{x:0.04217386744638545,y:0.02695433951411788},{x:0.04283566538917773,y:0.026147936387598623},{x:0.04336942466232366,y:0.025251630882832152},{x:0.04562896367409083,y:0.022744292579413156},{x:0.04777019484660536,y:0.020135194846605337},{x:0.04857659797312457,y:0.019473396903813094},{x:0.04927496174105457,y:0.01869844492647086},{x:0.0519802417813102,y:0.01668009861889986},{x:0.05458933951411791,y:0.014538867446385433},{x:0.055509358204447995,y:0.01404710721112114},{x:0.05634548873920743,y:0.013423289731094336},{x:0.05939254741314285,y:0.011971499336069797},{x:0.062369245543570956,y:0.01038042103699207},{x:0.0633675239953951,y:0.010077596579314544},{x:0.06430928926944049,y:0.00962888655251979},{x:0.06758102982102647,y:0.008799443560749052},{x:0.07081093550927423,y:0.007819662381854608},{x:0.0718491104415297,y:0.007717411075846537},{x:0.07286031894352762,y:0.007461052176974015},{x:0.07623101021818018,y:0.0072858316174737835},{x:0.07959,y:0.006954999999999975},{x:0.522462,y:0.006954999999999975},{x:0.5312410644907257,y:0.007819662381854608},{x:0.539682754456429,y:0.01038042103699207},{x:0.5474626604858821,y:0.014538867446385433},{x:0.5542818051533946,y:0.020135194846605337},{x:0.5598781325536145,y:0.02695433951411788},{x:0.5640365789630079,y:0.034734245543570935},{x:0.5665973376181453,y:0.043175935509274205},{x:0.567462,y:0.05195499999999997},{x:0.5665973376181453,y:0.06073406449072574},{x:0.5640365789630079,y:0.06917575445642901},{x:0.5598781325536145,y:0.07695566048588207},{x:0.5542818051533946,y:0.08377480515339461},{x:0.5474626604858821,y:0.08937113255361451},{x:0.539682754456429,y:0.09352957896300787},{x:0.5312410644907257,y:0.09609033761814534},{x:0.522462,y:0.09695499999999997},{x:0.1815000359059797,y:0.09695499999999997},{x:0.2783905550735291,y:0.2032469617410546},{x:0.2792807818102756,y:0.20444017254595384},{x:0.28031851181367967,y:0.20550758629318672},{x:0.43775551181367967,y:0.4029575862931866},{x:0.4393581707982963,y:0.4054309283363016},{x:0.4411189018513206,y:0.4077943501865292},{x:0.5036359018513206,y:0.5115903501865292},{x:0.5044316302389797,y:0.5132634494776924},{x:0.5054127007337849,y:0.5148350555317778},{x:0.5063216043693862,y:0.5172373109446714},{x:0.5074247535047713,y:0.5195567934026113},{x:0.5078787867151084,y:0.5213529834674229},{x:0.5085344010842773,y:0.5230857889106145},{x:0.5229384010842772,y:0.5764717889106146},{x:0.5230947969602031,y:0.5774089507908463},{x:0.5233933154704733,y:0.5783109589719573},{x:0.5238196553887738,y:0.5817524776504878},{x:0.5243904806061233,y:0.5851730002877248},{x:0.5243610401661515,y:0.586122666187007},{x:0.5244778496604383,y:0.5870655806061408},{x:0.5252778496604383,y:0.6189585806061408},{x:0.525154398698275,y:0.6206444560860672},{x:0.5252359209411441,y:0.6223328785443973},{x:0.5248330095087286,y:0.6250334227224941},{x:0.5246336028763079,y:0.6277565667648055},{x:0.5241836259995084,y:0.6293859645321488},{x:0.5239341869342451,y:0.6310578486269935},{x:0.5118811869342451,y:0.6790048486269935},{x:0.5115474759395316,y:0.6799350391147754},{x:0.5113589931552627,y:0.6809051378786065},{x:0.5100605296725933,y:0.6840797730170447},{x:0.5089023081582834,y:0.6873082151493771},{x:0.5083935381649621,y:0.6881554285023456},{x:0.5080194201443183,y:0.6890701159233712},{x:0.5061265656819337,y:0.6919304336788418},{x:0.5043607612540449,y:0.6948708843926746},{x:0.5036964840076373,y:0.6956025626767983},{x:0.5031511078963445,y:0.6964266878303904},{x:0.4695951078963445,y:0.7376876878303904},{x:0.46829294792790443,y:0.7390014838193654},{x:0.46714904955699066,y:0.7404551608815331},{x:0.46519525859727806,y:0.7421268539092958},{x:0.4633851429208498,y:0.7439531446668906},{x:0.4618516947085211,y:0.7449876576267703},{x:0.4604461776978856,y:0.7461902391902692},{x:0.4582037971525157,y:0.7474486453977692},{x:0.45607217068925404,y:0.7488867084403534},{x:0.4543663637878686,y:0.7496021826182516},{x:0.45275324136800726,y:0.7505074541480116},{x:0.3913892413680073,y:0.7774134541480116},{x:0.3883140702117422,y:0.7784156528007931},{x:0.3852957573995619,y:0.7795779210778271},{x:0.3841283231887951,y:0.779779788263216},{x:0.3830018757962646,y:0.7801468976050565},{x:0.3797902739335826,y:0.7805299031606142},{x:0.3766032098633093,y:0.781080995160135},{x:0.2948022098633093,y:0.7870669951601349},{x:0.29450281220893076,y:0.7870594704966325},{x:0.2942070489499988,y:0.7871065838776864},{x:0.29009611613079095,y:0.7869487184427649},{x:0.2859834519838158,y:0.7868453561974301},{x:0.28569127516043946,y:0.7867795665334233},{x:0.28539200354491423,y:0.7867680740946454},{x:0.2381110035449142,y:0.7802710740946455},{x:0.2365476307297285,y:0.7798972084805876},{x:0.2349498387179436,y:0.7797212234138579},{x:0.23226739693423346,y:0.7788736316211718},{x:0.2295313767481002,y:0.7782193386355017},{x:0.22807098126622102,y:0.7775476578384392},{x:0.22653822336325463,y:0.7770633405173258},{x:0.15287222336325462,y:0.7455503405173259},{x:0.15277120515837472,y:0.7454948388638573},{x:0.15266147866932564,y:0.7454595513468599},{x:0.14890641990559073,y:0.7433714396994592},{x:0.14514076206912752,y:0.7413025033471496},{x:0.1450525127361761,y:0.7412283604682699},{x:0.14495177886390068,y:0.7411723444149347},{x:0.14167624287507044,y:0.7383917796239132},{x:0.1383865705572421,y:0.7356279539035645},{x:0.138314481468594,y:0.7355380190685297},{x:0.13822661135931125,y:0.7354634271443719},{x:0.09327661135931127,y:0.6889934271443718},{x:0.09215967204365061,y:0.6875853345117547},{x:0.09088652507606766,y:0.6863167230283468},{x:0.0894249598835053,y:0.6841377631074377},{x:0.0877944205712414,y:0.6820821900242812},{x:0.08697364817646357,y:0.6804832494460014},{x:0.08597245819367963,y:0.6789906353246448},{x:0.0849640705590952,y:0.6765684062835642},{x:0.08376588401722862,y:0.6742342280213215},{x:0.08327282036617045,y:0.6725058858871059},{x:0.08258206253775009,y:0.6708466294514168},{x:0.06737006253775008,y:0.6210196294514168},{x:0.06563362911198059,y:0.61237067498716},{x:0.06561788807912042,y:0.6035491464015462},{x:0.0673234443582347,y:0.5948940500909503},{x:0.07068475437800403,y:0.5867379965527546},{x:0.07557264487941309,y:0.5793944183504645},{x:0.08179927697165325,y:0.5731455250760676},{x:0.08912536467535526,y:0.5682314581936796},{x:0.09726937054858317,y:0.56484106253775},{x:0.10591832501283995,y:0.5631046291119806},{x:0.11473985359845373,y:0.5630888880791204},{x:0.12339494990904962,y:0.5647944443582347},{x:0.13155100344724535,y:0.568155754378004},{x:0.13889458164953555,y:0.5730436448794131},{x:0.14514347492393234,y:0.5792702769716532},{x:0.15005754180632036,y:0.5865963646753553},{x:0.1534479374622499,y:0.5947403705485832},{x:0.16549687462406137,y:0.6342067386764809},{x:0.19660916323298405,y:0.666371100226128},{x:0.2563653288901179,y:0.6919337213587163},{x:0.29295461470925055,y:0.696961546277117},{x:0.3623268316838737,y:0.6918850546595318},{x:0.40664087103378327,y:0.672454875030618},{x:0.4270299373286165,y:0.6473841495451277},{x:0.4351521014718352,y:0.6150740687208592},{x:0.4346413299816387,y:0.5947115247998124},{x:0.4232850296720603,y:0.5526213103922067},{x:0.3655461500158852,y:0.45675834907300783},{x:0.21087613207581168,y:0.2627785664153893},{x:0.04633344492647088,y:0.0822700382589454},{x:0.04431509861889995,y:0.07956475821868986},{x:0.04217386744638545,y:0.07695566048588207},{x:0.04168210721112112,y:0.0760356417955519},{x:0.04105828973109435,y:0.07519951126079251},{x:0.03960649933606985,y:0.07215245258685718},{x:0.03801542103699209,y:0.06917575445642901},{x:0.037712596579314576,y:0.0681774760046049},{x:0.037263886552519804,y:0.06723571073055948},{x:0.036434443560749034,y:0.06396397017897336},{x:0.03545466238185463,y:0.06073406449072574},{x:0.03535241107584656,y:0.059695889558470286},{x:0.035096052176974035,y:0.05868468105647236},{x:0.03492083161747381,y:0.05531398978181981},{x:0.034589999999999996,y:0.05195499999999997}]],"3":[[{x:0.02624429558875499,y:0.07454886751538828},{x:0.02628189246403191,y:0.06572740500388341},{x:0.028039748887915363,y:0.057082779207475086},{x:0.03145031142385274,y:0.04894719824755728},{x:0.036382514066253493,y:0.04163330793793327},{x:0.042646815033581253,y:0.035422176981524986},{x:0.05000248075272204,y:0.030552495657744837},{x:0.05816683711519421,y:0.027211403088916904},{x:0.11448783711519421,y:0.010388403088916982},{x:0.11753114712885143,y:0.009796523380387901},{x:0.12053464064709668,y:0.009027703431080128},{x:0.20267064064709667,y:-0.0035892965689199724},{x:0.20562630159751,y:-0.003749783589053152},{x:0.20856537842676282,y:-0.004101230781641964},{x:0.30947437842676284,y:-0.00620423078164193},{x:0.31075400531193675,y:-0.006105070212514369},{x:0.31203499449415534,y:-0.0061847225744922005},{x:0.3151428517207607,y:-0.005764970678224511},{x:0.3182695531731509,y:-0.005522677007230838},{x:0.31950524711917533,y:-0.005175778959545043},{x:0.3207771618583987,y:-0.005003992231664048},{x:0.3829651618583987,y:0.009716007768336019},{x:0.3849642059743718,y:0.010402067561162992},{x:0.38702295869345676,y:0.010879972006216251},{x:0.389126076828856,y:0.011830396347599064},{x:0.3913090018652735,y:0.012579562954916447},{x:0.3931357912831918,y:0.013642434461507345},{x:0.39506175111398195,y:0.014512798837572657},{x:0.47719975111398194,y:0.06182779883757265},{x:0.47924722409526294,y:0.06329195880211928},{x:0.48141099047099317,y:0.06457804786673271},{x:0.4828265323572166,y:0.06585154318044145},{x:0.484375351035892,y:0.06695911252196202},{x:0.4860978389589892,y:0.06879458122658251},{x:0.48796912564078,y:0.07047808832945178},{x:0.54077112564078,y:0.12830608832945176},{x:0.5409949120745448,y:0.12860551518367325},{x:0.5412686389329152,y:0.1288600940829806},{x:0.5436334835107667,y:0.13213593090859313},{x:0.5460522072884215,y:0.13537218987116906},{x:0.5462132784472015,y:0.1357095218897727},{x:0.546432079841298,y:0.13601261058785885},{x:0.5481124005325159,y:0.13968686141763526},{x:0.5498532864078638,y:0.14333280617235186},{x:0.5499454524173568,y:0.14369507987504085},{x:0.5501009199323095,y:0.14403503084321223},{x:0.5735679199323094,y:0.2123790308432122},{x:0.5742003382158373,y:0.21504899342087444},{x:0.5750294951185407,y:0.21766455299430504},{x:0.5752146521018063,y:0.21933125436759},{x:0.575601167738761,y:0.22096305773765262},{x:0.575700550423256,y:0.22370509641963415},{x:0.5760035049491392,y:0.22643215923642232},{x:0.5758599468852712,y:0.22810295774565637},{x:0.5759206866877095,y:0.2297788119316045},{x:0.5754832145523405,y:0.2324875517091097},{x:0.575248324328873,y:0.23522131827456078},{x:0.563515324328873,y:0.2983063182745607},{x:0.5624930457986839,y:0.30183400865706583},{x:0.561587550163308,y:0.3053934651440046},{x:0.5612670272694029,y:0.3060647673464004},{x:0.5610599744254687,y:0.30677926765590185},{x:0.5593691204378909,y:0.31003973780923805},{x:0.5577866081350055,y:0.3133541469027738},{x:0.5573412794357957,y:0.31395001930700017},{x:0.5569988129587381,y:0.31461039668740554},{x:0.5547043620842722,y:0.317478348572073},{x:0.5525056481741942,y:0.32042033938948294},{x:0.4997036481741942,y:0.378250339389483},{x:0.4970091109540712,y:0.38067456957783247},{x:0.49440132723244246,y:0.38319188697894757},{x:0.4937347452782226,y:0.3836204617554604},{x:0.49314561461057166,y:0.3841504927896343},{x:0.49002990831948917,y:0.38600246394071897},{x:0.48698112816844114,y:0.387962658427834},{x:0.4171684643874312,y:0.4237087345514058},{x:0.48487098803351525,y:0.4540412587201935},{x:0.4882241875669253,y:0.4559584413246188},{x:0.4916233115558361,y:0.4577929691542233},{x:0.4920492459188098,y:0.45814540790983926},{x:0.4925291804180174,y:0.45841980913886743},{x:0.49544392539098053,y:0.4609543303938907},{x:0.49841983754054403,y:0.46341674447922576},{x:0.545354837540544,y:0.5107317444792258},{x:0.5454749496657809,y:0.5108793107625336},{x:0.5456205162109946,y:0.5110018387655073},{x:0.548258239278959,y:0.5142987798858712},{x:0.5509236260451226,y:0.5175733969812307},{x:0.5510126414958236,y:0.5177415605329735},{x:0.5511315069931322,y:0.5178901328189077},{x:0.5530753456471339,y:0.5216383183828395},{x:0.5550506716503533,y:0.525370005791429},{x:0.5551051696126684,y:0.5255523041806199},{x:0.555192766127671,y:0.525721211199887},{x:0.5563680197383496,y:0.5297766005381628},{x:0.5575773743081012,y:0.5338219516056334},{x:0.5575952604559016,y:0.5340113792074108},{x:0.557648221703651,y:0.5341941299579837},{x:0.569382221703651,y:0.5972801299579837},{x:0.5696549699390315,y:0.6004540423597167},{x:0.5701008412017201,y:0.6036082951002054},{x:0.5700318821169291,y:0.6048400880993865},{x:0.5701375119403227,y:0.6060692795769916},{x:0.5697858198023349,y:0.6092354166829699},{x:0.5696077595908724,y:0.6124160465097288},{x:0.5692998146426919,y:0.6136107177017713},{x:0.5691636114574624,y:0.614836897966064},{x:0.5682009942777376,y:0.6178735869028962},{x:0.5674058453461934,y:0.6209583639953996},{x:0.5668707486862845,y:0.622070002836373},{x:0.5664979467044567,y:0.623246050467446},{x:0.5649613973213707,y:0.6260365929822823},{x:0.5635797167972587,y:0.6289069710868302},{x:0.5283787167972587,y:0.6867359710868302},{x:0.526364685994031,y:0.6894131274243959},{x:0.524479650893362,y:0.6921826271628648},{x:0.5237177195860089,y:0.6929316152663909},{x:0.5230754099184859,y:0.6937854072711274},{x:0.5205777908604191,y:0.6960182048823972},{x:0.5181886735848373,y:0.6983667373551676},{x:0.4595186735848373,y:0.7456807373551677},{x:0.45627545779875317,y:0.7478078267647688},{x:0.4530837115337172,y:0.7500113951823929},{x:0.4525909707504246,y:0.7502243275150239},{x:0.4521421155924859,y:0.7505187128152536},{x:0.44854624273044896,y:0.7519722107862162},{x:0.4449859301027389,y:0.7535107594479447},{x:0.362848930102739,y:0.7797967594479446},{x:0.36158078031831586,y:0.7800691142952486},{x:0.3603625229719573,y:0.7805143446587972},{x:0.35727696699365546,y:0.7809934249999153},{x:0.35422405316989464,y:0.781649085623381},{x:0.352927136733123,y:0.7816688034988555},{x:0.3516454277250751,y:0.7818678086678129},{x:0.2577774277250751,y:0.7871168086678129},{x:0.2534831925795917,y:0.7869349938938289},{x:0.24918809681378723,y:0.7867747925856998},{x:0.2490774333618657,y:0.786748457272228},{x:0.24896378128970398,y:0.7867436453266514},{x:0.24478752897123962,y:0.7857275603552258},{x:0.2406062159909945,y:0.7847325056542677},{x:0.16433721599099446,y:0.7584545056542678},{x:0.1612047546311144,y:0.7570179671101032},{x:0.15801334200327716,y:0.7557176430739929},{x:0.09817134200327716,y:0.7241756430739928},{x:0.09479788711775466,y:0.721949723610623},{x:0.09138819905405325,y:0.7197797137879894},{x:0.05384019905405325,y:0.6903397137879895},{x:0.04746503339724546,y:0.6842424293748122},{x:0.0424018859405069,y:0.677018569451043},{x:0.0388453306011542,y:0.6689457429023652},{x:0.036932043806339465,y:0.6603341839257509},{x:0.036735552094603836,y:0.6515148299032538},{x:0.03826340653223549,y:0.6428266036640077},{x:0.041456892530026886,y:0.6346033888699733},{x:0.046193286212010486,y:0.6271611990540533},{x:0.05229057062518783,y:0.6207860333972455},{x:0.05951443054895701,y:0.615722885940507},{x:0.06758725709763488,y:0.6121663306011542},{x:0.07619881607424907,y:0.6102530438063395},{x:0.08501817009674617,y:0.6100565520946039},{x:0.09370639633599236,y:0.6115844065322356},{x:0.1019296111300268,y:0.6147778925300269},{x:0.10937180094594674,y:0.6195142862120105},{x:0.14372643260130716,y:0.6464504840370294},{x:0.1969218011618275,y:0.6744891243755197},{x:0.2615721948597163,y:0.6967640072977177},{x:0.3408866683163358,y:0.6923288252210377},{x:0.40955721054777616,y:0.6703524458415177},{x:0.4555820596629536,y:0.6332360369266462},{x:0.477752059875079,y:0.596814658492312},{x:0.4716998550115053,y:0.5642759337587675},{x:0.44042564505409965,y:0.532748518309004},{x:0.3700728058889163,y:0.5012285825754976},{x:0.28267158635688694,y:0.4816496665818946},{x:0.2026156257994338,y:0.47140070238604853},{x:0.19958923290487823,y:0.4707064281346213},{x:0.19652752938874105,y:0.4701896668089735},{x:0.19529880233776667,y:0.46972217540403877},{x:0.1940174323454584,y:0.4694282207777866},{x:0.19118463692903986,y:0.4681568668470777},{x:0.18828257832087977,y:0.4670527262205195},{x:0.18716866396437967,y:0.46635450477580015},{x:0.18596926283986664,y:0.4658162155208443},{x:0.1834389276407875,y:0.4640166393294268},{x:0.18080803842542348,y:0.46236755090702814},{x:0.17985174386742717,y:0.4614654316810775},{x:0.17878040392329292,y:0.4607034939516098},{x:0.17664976830422657,y:0.45844485220330683},{x:0.1743911520787843,y:0.45631418952832026},{x:0.17362922718285934,y:0.45524284045707714},{x:0.17272711941234267,y:0.45428653509274164},{x:0.17107806250525512,y:0.45165562612327925},{x:0.16927851662463225,y:0.44912526936741537},{x:0.1687402417372368,y:0.44792586179486843},{x:0.1680420336360506,y:0.4468119390745141},{x:0.1669379277730794,y:0.44390986724015796},{x:0.1656666077762714,y:0.4410770565945043},{x:0.16537266849946,y:0.43979568308103084},{x:0.16490519181337332,y:0.438566950430106},{x:0.16438846716364272,y:0.4355052407239498},{x:0.16369422916516244,y:0.43247883951296023},{x:0.16365592142049992,y:0.43116474252408066},{x:0.16343714101639506,y:0.42986841944927895},{x:0.1635276550184117,y:0.4267647316583033},{x:0.16343717819520762,y:0.42366104278329114},{x:0.1636559741278381,y:0.4223647223293339},{x:0.1636942976139514,y:0.42105062579943375},{x:0.1643885718653787,y:0.41802423290487795},{x:0.16490533319102646,y:0.414962529388741},{x:0.1653728245959611,y:0.41373380233776696},{x:0.1656667792222133,y:0.41245243234545836},{x:0.1669381331529224,y:0.40961963692903947},{x:0.16804227377948042,y:0.40671757832087974},{x:0.16874049522419982,y:0.4056036639643795},{x:0.16927878447915568,y:0.4044042628398666},{x:0.17107836067057278,y:0.40187392764078794},{x:0.1727274490929718,y:0.3992430384254234},{x:0.17362956831892262,y:0.3982867438674269},{x:0.17439150604839013,y:0.3972154039232929},{x:0.1766501477966929,y:0.39508476830422673},{x:0.1787808104716797,y:0.39282615207878424},{x:0.17985215954292283,y:0.39206422718285927},{x:0.18080846490725827,y:0.39116211941234263},{x:0.18343937387672077,y:0.38951306250525497},{x:0.18596973063258454,y:0.3877135166246322},{x:0.18716913820513145,y:0.3871752417372368},{x:0.1882830609254858,y:0.38647703363605057},{x:0.19118513275984234,y:0.3853729277730792},{x:0.19401794340549564,y:0.3841016077762714},{x:0.19529931691896882,y:0.38380766849946},{x:0.19652804956989395,y:0.38334019181337325},{x:0.19958975927605035,y:0.38282346716364263},{x:0.20261616048703973,y:0.3821292291651624},{x:0.28149235433605535,y:0.37203226198800626},{x:0.3678476199052635,y:0.34785057975990136},{x:0.4387239808422848,y:0.31155986033736477},{x:0.4773813812672204,y:0.26922136053481893},{x:0.48460036747312013,y:0.2304069273293995},{x:0.4680118822440525,y:0.1820955353962423},{x:0.4262197745588727,y:0.1363254129914362},{x:0.35583608100487274,y:0.09578139608686695},{x:0.3056218275014876,y:0.083895601213743},{x:0.2134048551529998,y:0.08581745449589688},{x:0.13726972612583144,y:0.09751265420048184},{x:0.0839251628848058,y:0.11344659691108305},{x:0.0752658675153883,y:0.11513070441124498},{x:0.06644440500388343,y:0.11509310753596806},{x:0.05779977920747511,y:0.11333525111208462},{x:0.0496641982475573,y:0.10992468857614723},{x:0.04235030793793329,y:0.10499248593374648},{x:0.036139176981525016,y:0.09872818496641873},{x:0.03126949565774486,y:0.09137251924727793},{x:0.027928403088916927,y:0.08320816288480577},{x:0.02624429558875499,y:0.07454886751538828}]],"4":[[{x:0.003828000000000005,y:0.27580099999999996},{x:0.0040512821902059844,y:0.2735339778783202},{x:0.004058111165048277,y:0.2712559968420181},{x:0.004482570943879651,y:0.26915502967601196},{x:0.004692662381854638,y:0.26702193550927417},{x:0.005353928343121064,y:0.26484203377636983},{x:0.005805038155045426,y:0.26260915577382815},{x:0.0066312204192078995,y:0.26063136609773396},{x:0.0072534210369921,y:0.25858024554357095},{x:0.008327258689269697,y:0.2565712366005347},{x:0.009205313441189196,y:0.2544692698811785},{x:0.010401468469599332,y:0.25269066304309135},{x:0.011411867446385462,y:0.25080033951411784},{x:0.01285700981091242,y:0.2490394284479652},{x:0.014128266351129452,y:0.24714915041402313},{x:0.01564842657685691,y:0.24563807727727646},{x:0.017008194846605366,y:0.24398119484660533},{x:0.018769105912757822,y:0.24253605248207852},{x:0.020384710565360974,y:0.24093010545831445},{x:0.022170457083446928,y:0.23974463571613375},{x:0.023827339514117918,y:0.23838486744638543},{x:0.025836348457154004,y:0.2373110297941079},{x:0.027734214441385185,y:0.2360511294240198},{x:0.029716922014597604,y:0.23523682001377813},{x:0.031607245543570965,y:0.23422642103699207},{x:0.03378714727647517,y:0.23356515507572567},{x:0.03589434066689576,y:0.23269971862397582},{x:0.03799781495511128,y:0.23228786299963877},{x:0.040048935509274235,y:0.2316656623818546},{x:0.04231595763095386,y:0.23144238019164864},{x:0.0445515001672978,y:0.23100466589573537},{x:0.046694905833262405,y:0.23101109143797494},{x:0.048828,y:0.23080099999999998},{x:0.36918100000000004,y:0.23080099999999998},{x:0.36918100000000004,y:0.05103000000000002},{x:0.37004566238185466,y:0.04225093550927423},{x:0.3726064210369921,y:0.03380924554357098},{x:0.3767648674463855,y:0.026029339514117924},{x:0.38236119484660536,y:0.019210194846605383},{x:0.38918033951411796,y:0.013613867446385479},{x:0.396960245543571,y:0.009455421036992116},{x:0.4054019355092743,y:0.006894662381854655},{x:0.414181,y:0.0060300000000000215},{x:0.4229600644907258,y:0.006894662381854655},{x:0.4314017544564291,y:0.009455421036992116},{x:0.43918166048588214,y:0.013613867446385486},{x:0.4460008051533947,y:0.019210194846605383},{x:0.45159713255361456,y:0.026029339514117924},{x:0.45575557896300795,y:0.03380924554357098},{x:0.4583163376181454,y:0.04225093550927425},{x:0.459181,y:0.05103000000000002},{x:0.459181,y:0.23080099999999998},{x:0.553224,y:0.23080099999999998},{x:0.5620030644907258,y:0.2316656623818546},{x:0.5704447544564291,y:0.23422642103699207},{x:0.5782246604858822,y:0.23838486744638543},{x:0.5850438051533947,y:0.24398119484660533},{x:0.5906401325536146,y:0.25080033951411784},{x:0.5947985789630079,y:0.25858024554357095},{x:0.5973593376181454,y:0.26702193550927417},{x:0.5982240000000001,y:0.27580099999999996},{x:0.5973593376181454,y:0.28458006449072576},{x:0.5947985789630079,y:0.293021754456429},{x:0.5906401325536146,y:0.3008016604858821},{x:0.5850438051533947,y:0.3076208051533946},{x:0.5782246604858822,y:0.3132171325536145},{x:0.5704447544564291,y:0.3173755789630079},{x:0.5620030644907258,y:0.31993633761814533},{x:0.553224,y:0.32080099999999995},{x:0.459181,y:0.32080099999999995},{x:0.459181,y:0.421833},{x:0.4583163376181454,y:0.4306120644907258},{x:0.45575557896300795,y:0.439053754456429},{x:0.45159713255361456,y:0.4468336604858821},{x:0.4460008051533947,y:0.4536528051533947},{x:0.43918166048588214,y:0.45924913255361455},{x:0.4314017544564291,y:0.4634075789630079},{x:0.4229600644907258,y:0.4659683376181454},{x:0.414181,y:0.466833},{x:0.4054019355092743,y:0.4659683376181454},{x:0.396960245543571,y:0.4634075789630079},{x:0.38918033951411796,y:0.45924913255361455},{x:0.38236119484660536,y:0.4536528051533947},{x:0.3767648674463855,y:0.4468336604858821},{x:0.3726064210369921,y:0.439053754456429},{x:0.37004566238185466,y:0.4306120644907258},{x:0.36918100000000004,y:0.421833},{x:0.36918100000000004,y:0.32080099999999995},{x:0.1436046917940101,y:0.32080099999999995},{x:0.4533648945416855,y:0.700560710565361},{x:0.45824387057598015,y:0.7079102144413851},{x:0.4615952813760241,y:0.7160703406668958},{x:0.46329033410426457,y:0.7247275001672978},{x:0.46326388883495173,y:0.7335490031579818},{x:0.46151696184495455,y:0.7421958442261718},{x:0.45811668655881077,y:0.7503357301188214},{x:0.4531937336488705,y:0.7576558495859769},{x:0.446937289434639,y:0.7638748945416856},{x:0.4395877855586148,y:0.7687538705759801},{x:0.43142765933310423,y:0.7721052813760241},{x:0.42277049983270215,y:0.7738003341042645},{x:0.41394899684201814,y:0.7737738888349517},{x:0.40530215577382817,y:0.7720269618449546},{x:0.39716226988117853,y:0.7686266865588108},{x:0.38984215041402315,y:0.7637037336488706},{x:0.38362310545831446,y:0.757447289434639},{x:0.013957105458314502,y:0.304244289434639},{x:0.012771635716133971,y:0.30245854291655333},{x:0.011411867446385462,y:0.3008016604858821},{x:0.010338029794107799,y:0.29879265154284573},{x:0.009078129424019837,y:0.29689478555861476},{x:0.008263820013778204,y:0.2949120779854024},{x:0.0072534210369921,y:0.293021754456429},{x:0.006592155075725704,y:0.29084185272352475},{x:0.005726718623975863,y:0.2887346593331042},{x:0.0053148629996388475,y:0.28663118504488877},{x:0.004692662381854638,y:0.28458006449072576},{x:0.00446938019164866,y:0.282313042369046},{x:0.00403166589573542,y:0.2800774998327022},{x:0.00403809143797499,y:0.27793409416673776},{x:0.003828000000000005,y:0.27580099999999996}]],"5":[[{x:0.029951000000000005,y:0.38529899999999995},{x:0.030026331329377584,y:0.3845341481773043},{x:0.029977079633894697,y:0.38376717530271315},{x:0.030458063889865227,y:0.38015069392879464},{x:0.03081566238185464,y:0.37651993550927415},{x:0.03103876142924568,y:0.3757844765131909},{x:0.03114008507636279,y:0.3750226322781917},{x:0.0323173678705276,y:0.3715694759531816},{x:0.0333764210369921,y:0.36807824554357094},{x:0.033738714231120716,y:0.3674004426508694},{x:0.033986719409902104,y:0.366673004302166},{x:0.03581505842470893,y:0.3635158758870829},{x:0.03753486744638546,y:0.3602983395141178},{x:0.03802243206297786,y:0.35970424030984804},{x:0.03840758807348568,y:0.3590391628952293},{x:0.04081672126593952,y:0.35629938906452685},{x:0.04313119484660537,y:0.3534791948466053},{x:0.04372529405087513,y:0.3529916302300129},{x:0.04423279956362368,y:0.3524144723015426},{x:0.04713014529619686,y:0.3501973410270508},{x:0.04995033951411792,y:0.3478828674463854},{x:0.05062814240681941,y:0.3475205742522568},{x:0.05123849426956635,y:0.347053515665452},{x:0.054512709170605814,y:0.34544423005866864},{x:0.057730245543570965,y:0.343724421036992},{x:0.05846570453965444,y:0.3435013219896009},{x:0.05915544727260316,y:0.34316231154402344},{x:0.06268070509966306,y:0.34222271554831923},{x:0.06617193550927424,y:0.3411636623818546},{x:0.0669367873319697,y:0.34108833105247705},{x:0.06767941450870582,y:0.34089039672943083},{x:0.07132024158048059,y:0.34065659849198926},{x:0.074951,y:0.34029899999999996},{x:0.0757158518226955,y:0.3403743313293775},{x:0.07648282469728679,y:0.34032507963389463},{x:0.08009930607120508,y:0.3408060638898651},{x:0.08373006449072577,y:0.3411636623818546},{x:0.0844655234868091,y:0.3413867614292456},{x:0.08522736772180821,y:0.34148808507636275},{x:0.2701097088502776,y:0.3848544225750548},{x:0.39095673206080095,y:0.3699215697302287},{x:0.4312208460684155,y:0.34735587040502247},{x:0.4569274445394237,y:0.3179203076157562},{x:0.4808881134259603,y:0.2201177906149206},{x:0.47151862074291284,y:0.1781066999956386},{x:0.4461217481742335,y:0.14395206669668215},{x:0.3876788357927069,y:0.10680533743499816},{x:0.3169820044514503,y:0.08634947983662909},{x:0.2505487358362677,y:0.08307118781270932},{x:0.19638270317906092,y:0.09339965838335124},{x:0.15518503458472022,y:0.11245499400015477},{x:0.1051531598037562,y:0.15775209985578706},{x:0.09806479623887651,y:0.16300326318775482},{x:0.09008818244690309,y:0.16677065575830224},{x:0.0815298552225249,y:0.16890949878372125},{x:0.07271870628140957,y:0.16933759772602197},{x:0.06399334313601493,y:0.16803850098293246},{x:0.05568907659877849,y:0.16506213211374782},{x:0.04812503497563989,y:0.16052287130494386},{x:0.041591900144212934,y:0.15459515980375618},{x:0.03634073681224515,y:0.1475067962388765},{x:0.03257334424169774,y:0.13953018244690307},{x:0.03043450121627874,y:0.13097185522252489},{x:0.03000640227397801,y:0.12216070628140954},{x:0.031305499017067515,y:0.1134353431360149},{x:0.034281867886252176,y:0.10513107659877846},{x:0.03882112869505611,y:0.09756703497563987},{x:0.044748840196243804,y:0.09103390014421289},{x:0.09986584019624378,y:0.041132900144212926},{x:0.10178680031290575,y:0.03970982481314967},{x:0.10357183338498165,y:0.03811957700249835},{x:0.10532248536915285,y:0.037090537646117014},{x:0.10695420376112348,y:0.035881736812245144},{x:0.10911588139237749,y:0.0348607662023731},{x:0.11117685751196796,y:0.03364931723433351},{x:0.16362485751196798,y:0.009390317234333478},{x:0.1646572774363771,y:0.009030847933342759},{x:0.16562545909873666,y:0.008523173483185618},{x:0.16881529925253239,y:0.0075831025339957205},{x:0.1719558576504946,y:0.006489618860012841},{x:0.17303856889723523,y:0.006338471796353147},{x:0.17408718959239433,y:0.0060294350406820685},{x:0.23897018959239436,y:-0.00634256495931787},{x:0.2399001168767359,y:-0.006426714843400178},{x:0.24080591100583193,y:-0.006653392925378379},{x:0.24428588214420577,y:-0.0068235863462415185},{x:0.247755834543085,y:-0.007137585190079683},{x:0.24868431036339586,y:-0.007038698344381461},{x:0.24961692261229596,y:-0.007084309202250054},{x:0.32666292261229596,y:-0.003282309202250082},{x:0.32746661284147915,y:-0.0031629125067284265},{x:0.32827905619988357,y:-0.00317336931171093},{x:0.3318231917274382,y:-0.002515696572186591},{x:0.33538870069659477,y:-0.001986002452099067},{x:0.33615365510360457,y:-0.0017121077449900682},{x:0.3369525276121403,y:-0.0015638637889859724},{x:0.4188855276121403,y:0.02214313621101406},{x:0.4207304127428032,y:0.02287964098341223},{x:0.42264402370761556,y:0.023412682727046455},{x:0.4248170355152836,y:0.024511079778651145},{x:0.4270783417525648,y:0.02541382586724525},{x:0.42874409297954025,y:0.02649609814118395},{x:0.43051694316083267,y:0.027392224616519634},{x:0.5014129431608326,y:0.07245422461651957},{x:0.5044011686844615,y:0.0747943741105689},{x:0.5074525565132345,y:0.07705154573740032},{x:0.5078697672823866,y:0.07751071502587484},{x:0.5083582165656543,y:0.07789323111579813},{x:0.5108324836553944,y:0.0807713891731658},{x:0.5133848875831327,y:0.08358048611421783},{x:0.5494628875831328,y:0.1320994861142178},{x:0.5497798823390716,y:0.1326268676033582},{x:0.5501811109693575,y:0.13309337858567127},{x:0.5520495631508493,y:0.13640291633591076},{x:0.5540074974944301,y:0.13966031511116345},{x:0.5542155142604781,y:0.14023940572188273},{x:0.5545180216173755,y:0.1407752286491667},{x:0.5557049132287019,y:0.14438569149730107},{x:0.5569897394368822,y:0.14796247431004633},{x:0.5570807842453774,y:0.1485710199149322},{x:0.5572729451408087,y:0.14915556341258465},{x:0.5710219451408087,y:0.2108035634125847},{x:0.5712046210163666,y:0.21230267395853206},{x:0.5715791512667351,y:0.2137656948046034},{x:0.571736996194895,y:0.21667155541097086},{x:0.5720890113736304,y:0.2195603313107129},{x:0.5719757152243157,y:0.2210662751632623},{x:0.5720576277729665,y:0.2225742517011615},{x:0.5716455344736617,y:0.2254550710286549},{x:0.5714272135589309,y:0.2283570146640783},{x:0.5710222992922247,y:0.22981191924551903},{x:0.5708084462858501,y:0.23130690078257787},{x:0.5417354462858501,y:0.3499769007825779},{x:0.5411002871662289,y:0.3517814599872898},{x:0.540669734049328,y:0.3536454570484658},{x:0.5396393400617131,y:0.355932176655931},{x:0.5388066121493867,y:0.3582980512419798},{x:0.5378316053978042,y:0.3599440229503987},{x:0.537045677451414,y:0.361688207084494},{x:0.5355889653307644,y:0.36372996812105773},{x:0.5343106788169316,y:0.36588792593376723},{x:0.5330332933960605,y:0.36731205637621067},{x:0.5319221933904076,y:0.36886939956510134},{x:0.49389619339040763,y:0.4124113995651013},{x:0.49150876583293945,y:0.41465677330496736},{x:0.4892379705562563,y:0.41702003426923534},{x:0.48830169237996507,y:0.41767302336482964},{x:0.48747017448549057,y:0.4184550652905171},{x:0.4846905699931398,y:0.420191530792605},{x:0.4820023580684325,y:0.4220663721783498},{x:0.4272473580684325,y:0.4527533721783498},{x:0.42330567688981036,y:0.45447898255061825},{x:0.4193723578126433,y:0.45622356923745777},{x:0.4192660752068488,y:0.4562474610875831},{x:0.4191662841579818,y:0.4562911481493166},{x:0.41496369139475175,y:0.45721461755172516},{x:0.4107655979622113,y:0.4581583300092093},{x:0.27317359796221125,y:0.47516033000920926},{x:0.26964530070808584,y:0.4752477446385603},{x:0.2661231753027132,y:0.4754739203661053},{x:0.26524270860794985,y:0.4753568201865933},{x:0.26435476148695686,y:0.47537881934450843},{x:0.2608772057270339,y:0.4747762176787918},{x:0.2573786322781918,y:0.4743109149236372},{x:0.119951,y:0.44207564006371447},{x:0.119951,y:0.684004},{x:0.527101,y:0.684004},{x:0.5358800644907258,y:0.6848686623818546},{x:0.544321754456429,y:0.6874294210369921},{x:0.5521016604858822,y:0.6915878674463855},{x:0.5589208051533947,y:0.6971841948466053},{x:0.5645171325536146,y:0.7040033395141179},{x:0.5686755789630079,y:0.711783245543571},{x:0.5712363376181454,y:0.7202249355092742},{x:0.5721010000000001,y:0.729004},{x:0.5712363376181454,y:0.7377830644907257},{x:0.5686755789630079,y:0.746224754456429},{x:0.5645171325536146,y:0.7540046604858821},{x:0.5589208051533947,y:0.7608238051533946},{x:0.5521016604858822,y:0.7664201325536145},{x:0.544321754456429,y:0.7705785789630079},{x:0.5358800644907258,y:0.7731393376181454},{x:0.527101,y:0.774004},{x:0.074951,y:0.774004},{x:0.06617193550927424,y:0.7731393376181454},{x:0.05773024554357094,y:0.7705785789630079},{x:0.04995033951411792,y:0.7664201325536145},{x:0.04313119484660537,y:0.7608238051533946},{x:0.03753486744638546,y:0.7540046604858821},{x:0.0333764210369921,y:0.746224754456429},{x:0.03081566238185464,y:0.7377830644907257},{x:0.029951000000000005,y:0.729004},{x:0.029951000000000005,y:0.38529899999999995}]],"6":[[{x:0.01994450211145162,y:0.2755194646798348},{x:0.020758274672659796,y:0.26806396163938684},{x:0.0201773643330274,y:0.24423363638780976},{x:0.020440223451033163,y:0.2406784570189078},{x:0.020568639264984916,y:0.237115887070161},{x:0.02076496657089406,y:0.23628629421823594},{x:0.02082782677693791,y:0.23543610758842642},{x:0.021779216218601925,y:0.23200052126419074},{x:0.022600187477202785,y:0.22853145778054884},{x:0.04459918747720279,y:0.16442145778054884},{x:0.04602253566469808,y:0.16130748249724527},{x:0.047307319174730654,y:0.15813382633120915},{x:0.06831231917473066,y:0.11806482633120913},{x:0.06934150993632018,y:0.11649740482650416},{x:0.07018719324152095,y:0.11482382676006757},{x:0.07175673818837072,y:0.11281909673987861},{x:0.07315419088510985,y:0.11069082519836773},{x:0.0744693948008918,y:0.10935430641546007},{x:0.07562532742241568,y:0.1078778703106287},{x:0.1253733274224157,y:0.055788870310628645},{x:0.12585541612958862,y:0.055374327647901005},{x:0.12626130847256478,y:0.0548849335871293},{x:0.1291958120945167,y:0.0525019586891126},{x:0.1320620582603259,y:0.05003730581521479},{x:0.13261575702973094,y:0.04972477931463493},{x:0.1331093263100589,y:0.049323974491408525},{x:0.1861743263100589,y:0.014262974491408516},{x:0.18683955107784095,y:0.013911818906951787},{x:0.187438960697758,y:0.013457349607970202},{x:0.1907349034619545,y:0.011855559414887177},{x:0.19397565070571454,y:0.010144849670490022},{x:0.19469660042216425,y:0.009930220356283175},{x:0.19537315511619574,y:0.009601422573216056},{x:0.19891826102894206,y:0.008673416864759805},{x:0.2024304811380398,y:0.007627816351770726},{x:0.20317945010986724,y:0.007557961391993223},{x:0.20390715026053782,y:0.0073674706392518954},{x:0.2857161502605378,y:-0.005654529360748083},{x:0.2860775594607644,y:-0.005676122674759226},{x:0.28642923596273784,y:-0.0057621838110407525},{x:0.2904772893795591,y:-0.005938995755027237},{x:0.2945219894833068,y:-0.006180656673914681},{x:0.2948806669536751,y:-0.006131327641200151},{x:0.2952423757850646,y:-0.006147126454864343},{x:0.38700037578506463,y:-0.001139126454864331},{x:0.39074801870473747,y:-0.000562375362895672},{x:0.3945101708776463,y:-0.00008942684208443352},{x:0.395102371884912,y:0.00010774663253235539},{x:0.3957192721812796,y:0.00020268575218489876},{x:0.39928238663684656,y:0.0014994835976446027},{x:0.4028799824314506,y:0.002697304024131271},{x:0.47474098243145063,y:0.03475230402413133},{x:0.4764407459001163,y:0.03572046389197228},{x:0.4782361407270164,y:0.03649705052245801},{x:0.48026428101539703,y:0.03789829234877595},{x:0.4824063061811086,y:0.03911835786940705},{x:0.4838845305509628,y:0.04039952221931584},{x:0.48549392283388365,y:0.041511451110380196},{x:0.5363469228338836,y:0.08458545111038014},{x:0.5369424578291695,y:0.08519979361043255},{x:0.5376274627831791,y:0.08571247952886965},{x:0.5400078699953618,y:0.08836201411598918},{x:0.5424869876672573,y:0.09091942444541115},{x:0.5429512273484354,y:0.09163814564059086},{x:0.5435230500634102,y:0.09227461827992436},{x:0.5453408198626901,y:0.09533763721244376},{x:0.5472733759789791,y:0.0983295594844189},{x:0.5475884798754501,y:0.09912503932225875},{x:0.5480251455251356,y:0.09986083939589693},{x:0.5756631455251356,y:0.15896283939589692},{x:0.5756676990332947,y:0.1589757429605767},{x:0.575674675284325,y:0.15898751446598428},{x:0.5771354507402345,y:0.1631350040011944},{x:0.5785987361645655,y:0.16728160865370237},{x:0.5786006848177536,y:0.16729515262537814},{x:0.5786052305152959,y:0.16730805894366996},{x:0.5792288025114348,y:0.17166083878445604},{x:0.5798550088797246,y:0.1760132404159827},{x:0.5798542777922926,y:0.17602690430741857},{x:0.5798562182477396,y:0.17604044945602063},{x:0.5820672182477395,y:0.2261264494560206},{x:0.5819074721227447,y:0.22907858468741052},{x:0.5819395990078049,y:0.232034864293962},{x:0.5816696541741431,y:0.23347350033714379},{x:0.5815905637246603,y:0.23493510513282764},{x:0.580857954063737,y:0.2377993509905685},{x:0.5803127220992973,y:0.2407050941577823},{x:0.5648357220992973,y:0.2937960941577823},{x:0.5632290277642941,y:0.2977974374258546},{x:0.5616400226499054,y:0.30180583827676916},{x:0.5384240226499054,y:0.3468838382767692},{x:0.5373215489467563,y:0.3485896803397862},{x:0.5364060617863755,y:0.35040275195151915},{x:0.5349331318310961,y:0.3522852445680167},{x:0.5336357086983223,y:0.35429272914301846},{x:0.5322216254408594,y:0.35575071197935654},{x:0.5309700163849885,y:0.3573503432435408},{x:0.49559401638498846,y:0.39441334324354077},{x:0.4926979475395651,y:0.39690515537305066},{x:0.48986855873600776,y:0.3994724304741097},{x:0.48935820160472765,y:0.3997787125549045},{x:0.48890701524930746,y:0.4001669186691625},{x:0.48558046512393155,y:0.4020458563236817},{x:0.4823045917066957,y:0.404011815580751},{x:0.4336605917066957,y:0.42705181558075106},{x:0.43309173356321873,y:0.4272557130907893},{x:0.4325654489917744,y:0.42755269513041455},{x:0.42894434743018467,y:0.4287422729922158},{x:0.4253563740806812,y:0.43002832091195864},{x:0.42475866795602985,y:0.4301173218701226},{x:0.42418455747331046,y:0.430305924456616},{x:0.35674655747331047,y:0.44533192445661596},{x:0.3529000911149492,y:0.4457998510145922},{x:0.3490659246900917,y:0.4463596961147396},{x:0.28494592469009167,y:0.4493636961147396},{x:0.2805873413475358,y:0.449139645094856},{x:0.27622830276644406,y:0.44892463285807194},{x:0.20879130276644411,y:0.4389076328580719},{x:0.2058686377582091,y:0.4381749274884603},{x:0.2029059705898912,y:0.4376259000221244},{x:0.2015992206546876,y:0.4371045944779896},{x:0.20023455588710068,y:0.4367624761715421},{x:0.19751099279397463,y:0.4354736658725529},{x:0.19471236238975773,y:0.4343572001231398},{x:0.1250653623897577,y:0.39829620012313977},{x:0.12281565387932818,y:0.3968352958512946},{x:0.12046004217050754,y:0.3955521266688945},{x:0.11912493361112,y:0.39443863469229795},{x:0.1176668837895426,y:0.39349181371392206},{x:0.11574541108214431,y:0.3916200839502759},{x:0.11440461043594556,y:0.3905018447245139},{x:0.11499744675527566,y:0.4076710597897629},{x:0.14015918883207887,y:0.48309781218266834},{x:0.17625691985197756,y:0.5624688107059582},{x:0.22079283681825793,y:0.6049160879451294},{x:0.2812243215554422,y:0.6473094683632384},{x:0.35529887985725983,y:0.6721340784004237},{x:0.44197867319461825,y:0.699237682451455},{x:0.450099621980826,y:0.7026829408131323},{x:0.45739239245003865,y:0.7076463180152294},{x:0.4635767275229571,y:0.7139370742553635},{x:0.4684149666709443,y:0.7213134592991232},{x:0.47172117907685873,y:0.729492002806001},{x:0.4733683088520865,y:0.7381584079356077},{x:0.4732930577230865,y:0.7469796295989887},{x:0.471498317548545,y:0.7556166731946181},{x:0.4680530591868676,y:0.7637376219808258},{x:0.4630896819847706,y:0.7710303924500386},{x:0.4567989257446365,y:0.7772147275229571},{x:0.4494225407008768,y:0.7820529666709441},{x:0.4412439971939989,y:0.7853591790768587},{x:0.43257759206439217,y:0.7870063088520864},{x:0.4237563704010112,y:0.7869310577230865},{x:0.41511932680538177,y:0.7851363175485448},{x:0.32800332680538175,y:0.7578963175485449},{x:0.32758097645219697,y:0.7577171382279785},{x:0.32713377373466446,y:0.7576146941984534},{x:0.2464307737346645,y:0.7305686941984535},{x:0.24453959681011464,y:0.7297206474805041},{x:0.2425703892464572,y:0.7290741531131611},{x:0.24052462272791658,y:0.727920241844807},{x:0.2383814751569417,y:0.7269592057619036},{x:0.2366920823739949,y:0.725758503708645},{x:0.23488683737580707,y:0.7247402582115807},{x:0.16634483737580705,y:0.6766572582115807},{x:0.16379281785599412,y:0.6744641039532857},{x:0.16114120086592887,y:0.6723924725748345},{x:0.10785520086592887,y:0.6216054725748346},{x:0.10512406158167997,y:0.61843588774195},{x:0.10236095541706475,y:0.6152941312068447},{x:0.10224621895073822,y:0.6150960484276141},{x:0.1020967920615373,y:0.6149226331776604},{x:0.10003648617852028,y:0.6112811321861437},{x:0.09793939861820375,y:0.6076606883504815},{x:0.057256398618203745,y:0.5182076883504814},{x:0.05649445644348035,y:0.515973451082899},{x:0.055531562043165734,y:0.5138181769891187},{x:0.02756156204316574,y:0.4299731769891187},{x:0.02710606704062858,y:0.4279720709807987},{x:0.026442901166776424,y:0.42602987841114226},{x:0.0261294707087366,y:0.42368163359604843},{x:0.025603668479436986,y:0.4213716499642221},{x:0.02554732210120287,y:0.4193201319800137},{x:0.025275801747494525,y:0.4172858808521062},{x:0.022290801747494524,y:0.3308368808521062},{x:0.022305383523873214,y:0.330608131273329},{x:0.022277364333027405,y:0.33038063638780973},{x:0.021194122115214913,y:0.2859434614650037},{x:0.02071653916751727,y:0.2843071590959475},{x:0.01994450211145162,y:0.2755194646798348}],[{x:0.11034731747482908,y:0.25010871966048204},{x:0.11054573733688708,y:0.2582483748303443},{x:0.14138614929871246,y:0.28974619429248377},{x:0.17280436841728808,y:0.32166563054627706},{x:0.2294333737827033,y:0.3509863272379111},{x:0.2851142784460479,y:0.35925709287120927},{x:0.3409693478959939,y:0.3566403020317264},{x:0.39969116147327427,y:0.34355637352239615},{x:0.43624565447916347,y:0.3262425111990739},{x:0.46138408324665353,y:0.29990528863548604},{x:0.47964461062187336,y:0.2644492215688011},{x:0.49182659739178797,y:0.22266115801633354},{x:0.4903391577658353,y:0.18896604218391924},{x:0.47066764412974615,y:0.14689983627465894},{x:0.4322187986209955,y:0.11433252320671945},{x:0.3738017517723872,y:0.08827446060346957},{x:0.29512698962943984,y:0.08398052210424463},{x:0.22766698305582697,y:0.09471851188045},{x:0.18695506157646963,y:0.1216176107024183},{x:0.1450838647757246,y:0.1654591474507099},{x:0.12861258258928074,y:0.1968796571354811},{x:0.11034731747482908,y:0.25010871966048204}]],"7":[[{x:0.026534000000000002,y:0.729004},{x:0.027398662381854635,y:0.7202249355092742},{x:0.029959421036992097,y:0.711783245543571},{x:0.03411786744638546,y:0.7040033395141179},{x:0.039714194846605363,y:0.6971841948466053},{x:0.046533339514117915,y:0.6915878674463855},{x:0.05431324554357096,y:0.6874294210369921},{x:0.06275493550927423,y:0.6848686623818546},{x:0.071534,y:0.684004},{x:0.4019606654607806,y:0.684004},{x:0.4004737160341744,y:0.6825246433416329},{x:0.3773547160341744,y:0.6545006433416328},{x:0.37631768094411194,y:0.6529571778549935},{x:0.37511206403824765,y:0.6515414747212956},{x:0.3516100640382476,y:0.6177174747212957},{x:0.35070717908442606,y:0.6160998190359583},{x:0.34962595461558005,y:0.6145955036421288},{x:0.32637595461558006,y:0.5744575036421288},{x:0.32562538351875275,y:0.5728072168885044},{x:0.3246890272988689,y:0.5712547864166106},{x:0.3023170272988689,y:0.5242907864166106},{x:0.3017220252289498,y:0.5226423026482856},{x:0.3009361907094137,y:0.5210757809262708},{x:0.2800741907094137,y:0.4667717809262708},{x:0.2796297795277362,y:0.4651572895546526},{x:0.27899211910181604,y:0.46360891205912846},{x:0.26027511910181605,y:0.40145091205912853},{x:0.2599700482242006,y:0.399900691568321},{x:0.2594722021762355,y:0.3984012246220316},{x:0.2435242021762355,y:0.3278752246220315},{x:0.24329560198997774,y:0.32604433113097486},{x:0.24285939794168837,y:0.32425152465814894},{x:0.22552039794168838,y:0.201651524658149},{x:0.22543629437721757,y:0.19966542745190077},{x:0.2251384028560513,y:0.1976999971774209},{x:0.21759140285605127,y:0.0533799971774209},{x:0.2179964236931644,y:0.04456775725283754},{x:0.22011284489303193,y:0.03600385769296016},{x:0.22385933357584556,y:0.028017404355184638},{x:0.22909191428257988,y:0.020915312162427036},{x:0.23560950187114016,y:0.014970510534755857},{x:0.24316162910560324,y:0.010411454864839347},{x:0.25145807197163045,y:0.007413347105324521},{x:0.2601800028225791,y:0.006091402856051323},{x:0.26899224274716244,y:0.0064964236931644576},{x:0.27755614230703984,y:0.008612844893031955},{x:0.2855425956448154,y:0.0123593335758456},{x:0.29264468783757297,y:0.017591914282579925},{x:0.29858948946524416,y:0.02410950187114019},{x:0.30314854513516065,y:0.03166162910560326},{x:0.30614665289467546,y:0.03995807197163046},{x:0.3074685971439487,y:0.04868000282257914},{x:0.3149118365119932,y:0.19101580586964154},{x:0.33171443080019297,y:0.3098230069615897},{x:0.3469078029209317,y:0.3770118558572018},{x:0.3646876244488305,y:0.43605754408347375},{x:0.3843219343355222,y:0.48716585412502805},{x:0.40516196826036527,y:0.5309139031705462},{x:0.42657620329737017,y:0.5678827017045378},{x:0.4479617026009278,y:0.5986606409626235},{x:0.4682073320853445,y:0.6232016470905397},{x:0.5069453480603512,y:0.6602460238293135},{x:0.5211069187127709,y:0.670919967941474},{x:0.553634852004927,y:0.6903949675582732},{x:0.5545334052571363,y:0.6910607030437311},{x:0.5555196604858821,y:0.6915878674463855},{x:0.5580709875097788,y:0.6936816874233654},{x:0.5607229359621996,y:0.6956465083018619},{x:0.5614743452153894,y:0.6964747509099635},{x:0.5623388051533946,y:0.6971841948466053},{x:0.5644326251303754,y:0.699735521870503},{x:0.5666502995990071,y:0.7021799587443133},{x:0.5672256886169725,y:0.7031388795761127},{x:0.5679351325536145,y:0.7040033395141179},{x:0.5694909811561905,y:0.7069141275182039},{x:0.5711891576548912,y:0.709744242049125},{x:0.5715664145603537,y:0.7107969903148255},{x:0.5720935789630078,y:0.711783245543571},{x:0.5730516658019124,y:0.7149416345772374},{x:0.5741650843601849,y:0.7180486670509921},{x:0.5743297113818354,y:0.7191547862251302},{x:0.5746543376181453,y:0.7202249355092742},{x:0.574977843953461,y:0.7235095504532041},{x:0.5754637165205229,y:0.7267740993542682},{x:0.5754093871342436,y:0.7278910818973009},{x:0.575519,y:0.729004},{x:0.5751954936646845,y:0.7322886149439295},{x:0.5750351484302645,y:0.735585225488817},{x:0.5747639504839017,y:0.7366701463880269},{x:0.5746543376181453,y:0.7377830644907257},{x:0.5736962507792408,y:0.7409414535243923},{x:0.5728958497207748,y:0.7441434388186243},{x:0.5724182051993175,y:0.7451546051722857},{x:0.5720935789630078,y:0.746224754456429},{x:0.570537730360432,y:0.749135542460515},{x:0.5691280324417267,y:0.752119852004927},{x:0.5684622969562688,y:0.7530184052571364},{x:0.5679351325536145,y:0.7540046604858821},{x:0.5658413125766343,y:0.756555987509779},{x:0.563876491698138,y:0.7592079359621996},{x:0.5630482490900365,y:0.7599593452153895},{x:0.5623388051533946,y:0.7608238051533946},{x:0.5597874781294971,y:0.7629176251303754},{x:0.5573430412556867,y:0.7651352995990072},{x:0.5563841204238874,y:0.7657106886169726},{x:0.5555196604858821,y:0.7664201325536145},{x:0.5526088724817957,y:0.7679759811561907},{x:0.5497787579508749,y:0.7696741576548912},{x:0.5487260096851745,y:0.7700514145603538},{x:0.547739754456429,y:0.7705785789630079},{x:0.5445813654227618,y:0.7715366658019126},{x:0.5414743329490078,y:0.7726500843601849},{x:0.5403682137748697,y:0.7728147113818356},{x:0.5392980644907257,y:0.7731393376181454},{x:0.5360134495467959,y:0.773462843953461},{x:0.5327489006457318,y:0.7739487165205229},{x:0.531631918102699,y:0.7738943871342436},{x:0.530519,y:0.774004},{x:0.071534,y:0.774004},{x:0.06275493550927423,y:0.7731393376181454},{x:0.054313245543570934,y:0.7705785789630079},{x:0.046533339514117915,y:0.7664201325536145},{x:0.039714194846605363,y:0.7608238051533946},{x:0.03411786744638546,y:0.7540046604858821},{x:0.029959421036992097,y:0.746224754456429},{x:0.027398662381854635,y:0.7377830644907257},{x:0.026534000000000002,y:0.729004}]],"8":[[{x:0.018998734783549534,y:0.19034712298183487},{x:0.01918983868826437,y:0.187136446932327},{x:0.01920952916989005,y:0.18392014879903562},{x:0.019451409422642358,y:0.18274188004279768},{x:0.019522877627479743,y:0.18154116541629586},{x:0.0203366813486396,y:0.1784294641291047},{x:0.020983462121705806,y:0.17527880768498513},{x:0.021450563544301488,y:0.17417036752890672},{x:0.021754906310756543,y:0.17300666705236456},{x:0.02316013582774355,y:0.17011352146289485},{x:0.024409151469860245,y:0.16714958466818597},{x:0.06244715146986025,y:0.097021584668186},{x:0.06364531823888224,y:0.0952519506947441},{x:0.06465809579443724,y:0.09337006609963419},{x:0.0661122558858275,y:0.09160840391706095},{x:0.06739294989385258,y:0.08971688123025286},{x:0.06891333268610705,y:0.08821500101819715},{x:0.07027378747657535,y:0.08656685940733966},{x:0.07204368953204261,y:0.0851227396301211},{x:0.07366879313388441,y:0.08351741302778071},{x:0.0754529644913056,y:0.08234100299139627},{x:0.07710881500204132,y:0.08098994152260804},{x:0.14910981500204132,y:0.03317594152260801},{x:0.1504928100364302,y:0.03244176283843531},{x:0.15177178054792087,y:0.031538475488709236},{x:0.15438005907773164,y:0.030378172358910993},{x:0.15690151209615905,y:0.029039630272177964},{x:0.1584011644246711,y:0.028589367572161194},{x:0.15983178249634203,y:0.027952951404511282},{x:0.24949378249634205,y:-0.0017990485954887184},{x:0.251605077566582,y:-0.002276091838878668},{x:0.25365804064979064,y:-0.002962007073194259},{x:0.2558970148670134,y:-0.0032458471890824472},{x:0.2580984148155577,y:-0.003743249464233246},{x:0.2602622084630055,y:-0.003799233220341744},{x:0.26240953986016613,y:-0.0040714555567724145},{x:0.33848653986016614,y:-0.006196455556772458},{x:0.34211630259529946,y:-0.0059410451417675775},{x:0.3457527120689106,y:-0.005810898556388326},{x:0.34651004211407876,y:-0.005631877045722989},{x:0.3472863241290845,y:-0.005577253499755554},{x:0.35079651389094996,y:-0.004618619143417753},{x:0.3543376604369356,y:-0.0037815449929937683},{x:0.4535096604369356,y:0.03022045500700621},{x:0.45591274590665615,y:0.03131812424947078},{x:0.4583949217344816,y:0.03222283453480715},{x:0.45991547545056405,y:0.03314647083206772},{x:0.461533744189149,y:0.033885655452327273},{x:0.46367651039942226,y:0.035431052006208004},{x:0.4659344916938285,y:0.03680262701864639},{x:0.5338604916938285,y:0.08780462701864639},{x:0.5368034713408607,y:0.09050382186837246},{x:0.5397962541268131,y:0.09314768896709699},{x:0.5400513850489728,y:0.09348269124727963},{x:0.5403617177400871,y:0.09376731720532937},{x:0.5427215620660051,y:0.09698879462990716},{x:0.5451410464862535,y:0.10016572352111452},{x:0.5453259194365666,y:0.1005440624001799},{x:0.5455747614022292,y:0.10088376225489704},{x:0.547260782913003,y:0.10450372268352329},{x:0.5490139895381407,y:0.10809162577156875},{x:0.5802599895381407,y:0.1920326257715688},{x:0.5808621946470703,y:0.19431314395649216},{x:0.5816704362178704,y:0.19652903198349428},{x:0.5819856183913868,y:0.19856748893015458},{x:0.5825122482529622,y:0.20056180773987195},{x:0.5826579751325236,y:0.20291599079595712},{x:0.5830183882594349,y:0.20524698126417715},{x:0.5829298310737253,y:0.20730775882392333},{x:0.5830572695913885,y:0.20936649774620245},{x:0.5827409180393249,y:0.21170387573884492},{x:0.582639652248002,y:0.21406038999182395},{x:0.570412652248002,y:0.30012638999182395},{x:0.5703409363500996,y:0.30042034316527866},{x:0.5703238989157716,y:0.30072243812390526},{x:0.5692961437829783,y:0.3047027979582916},{x:0.5683217827960937,y:0.30869656381164773},{x:0.5681940974797931,y:0.30897087767968473},{x:0.5681184516122305,y:0.3092638441298401},{x:0.5663339148242972,y:0.3129672173863048},{x:0.5645991308441736,y:0.31669415574996157},{x:0.5644203829845738,y:0.31693828858446854},{x:0.5642890357120441,y:0.31721086798977133},{x:0.5618162960169492,y:0.32049493611094637},{x:0.5593877558190667,y:0.3238118228336772},{x:0.5591648145961691,y:0.32401639274673566},{x:0.5589828135206953,y:0.3242581100335041},{x:0.5032838135206953,y:0.3848241100335041},{x:0.5011622073766187,y:0.38671918495638496},{x:0.4991781602202921,y:0.38875783119234486},{x:0.4978799327840818,y:0.3896509997457094},{x:0.496704700181234,y:0.39070074870143656},{x:0.4942541493273608,y:0.39214550546522026},{x:0.4919105049301597,y:0.39375791128677606},{x:0.42072451102124153,y:0.4330589294870645},{x:0.4777200661568854,y:0.4633968522602595},{x:0.4805213378044988,y:0.46526159042857346},{x:0.48340658539474834,y:0.46699355971902134},{x:0.4841865730327025,y:0.4677014480666941},{x:0.48506339053858555,y:0.46828512408085676},{x:0.487447044167244,y:0.4706605328159332},{x:0.4899389620874836,y:0.4729221066835925},{x:0.4905658603159866,y:0.4737685611946159},{x:0.49131196047780046,y:0.47451208064740324},{x:0.493186393615322,y:0.4773068743236967},{x:0.4951892188573616,y:0.48001114175313947},{x:0.5250762188573616,y:0.5299501417531395},{x:0.5263287500632193,y:0.5326029758232522},{x:0.5277533683388757,y:0.5351675080991},{x:0.5282078804872482,y:0.5365829335183069},{x:0.5288425912810938,y:0.5379272372855163},{x:0.5295535131980511,y:0.5407734546091212},{x:0.5304504424054924,y:0.5435666393545394},{x:0.5306200854295579,y:0.5450435386925929},{x:0.5309803397786421,y:0.5464858379730204},{x:0.5311223320761199,y:0.5494160600145488},{x:0.5314571037289079,y:0.5523305567062068},{x:0.5328161037289079,y:0.6362725567062067},{x:0.5325682225912138,y:0.6392892202473488},{x:0.5325070847315841,y:0.6423154334158161},{x:0.5322077563487247,y:0.6436760218476847},{x:0.5320936668790056,y:0.6450644677251389},{x:0.5312620268462096,y:0.647974807711247},{x:0.530611678831884,y:0.6509309456375182},{x:0.530052664324664,y:0.6522069946735811},{x:0.5296698946987799,y:0.6535465042014387},{x:0.5282864552309536,y:0.656238677898982},{x:0.5270718895714029,y:0.659011137860374},{x:0.493108889571403,y:0.7195761378603741},{x:0.49086599866607616,y:0.7227903647520136},{x:0.4886941713149356,y:0.7260530293196586},{x:0.4883443495413535,y:0.7264040725827037},{x:0.48806074906628455,y:0.7268104928286833},{x:0.4852338901214668,y:0.7295253929429124},{x:0.4824672795427586,y:0.7323016638284542},{x:0.4820556943532359,y:0.7325777150511769},{x:0.48169825452511067,y:0.7329209983380867},{x:0.4783960621447291,y:0.7350322395860499},{x:0.4751409876314614,y:0.737215426256307},{x:0.4058559876314614,y:0.774404426256307},{x:0.40535390944732597,y:0.7746134197603937},{x:0.4048950878292554,y:0.7749053846735706},{x:0.40128606998249994,y:0.7763066859700772},{x:0.39771184087056327,y:0.7777944834687843},{x:0.3971786373679402,y:0.7779015106266721},{x:0.3966716723496766,y:0.778098353858693},{x:0.39285862044769176,y:0.7787686450898307},{x:0.3890628142527955,y:0.7795305574683767},{x:0.38851897614326597,y:0.7795315052864096},{x:0.3879833501061526,y:0.7796256622622586},{x:0.29017035010615255,y:0.7870576622622585},{x:0.28883979914978264,y:0.7870279344512828},{x:0.28751770557027906,y:0.7871806372910648},{x:0.2844390802539456,y:0.7869296114679608},{x:0.28135100845003463,y:0.7868606162788429},{x:0.2800518232654171,y:0.7865718820648824},{x:0.2787253424971381,y:0.7864637231002555},{x:0.20264834249713812,y:0.7726567231002556},{x:0.20090732012312768,y:0.7721604024311715},{x:0.19912055356042774,y:0.7718689262507037},{x:0.1966754417776232,y:0.7709540028332816},{x:0.19416478523538352,y:0.7702382792713757},{x:0.19255404347725652,y:0.7694118386491953},{x:0.19085847331495095,y:0.7687773822377194},{x:0.12157447331495094,y:0.7347753822377193},{x:0.11864840230662128,y:0.7329636093328938},{x:0.1156466869822177,y:0.7312801255296781},{x:0.11490452792065226,y:0.7306454666247165},{x:0.11407427694169714,y:0.7301313894804525},{x:0.11155788892673538,y:0.7277835811487093},{x:0.10894228211787771,y:0.7255468394054793},{x:0.1083381992447159,y:0.7247795872431081},{x:0.10762419278113186,y:0.7241134140161837},{x:0.10561419113974596,y:0.7213197952150451},{x:0.1034852091492498,y:0.7186157522626143},{x:0.05457920914924981,y:0.6421127522626143},{x:0.05400544809690788,y:0.6409849569633866},{x:0.05327967340990527,y:0.639948436299892},{x:0.05200937551205521,y:0.6370614399018406},{x:0.05057918033015655,y:0.6342502218929852},{x:0.050236465883645505,y:0.633032161635733},{x:0.04972685190376166,y:0.6318739658087451},{x:0.04904418748077848,y:0.6287946194110116},{x:0.04818991452487371,y:0.6257584009293389},{x:0.04809141700817653,y:0.6244968850866522},{x:0.047817547914863534,y:0.6232615229122788},{x:0.04774875137767971,y:0.6201081640700103},{x:0.04750322987838258,y:0.6169636252890404},{x:0.04765273449582791,y:0.6157071332072875},{x:0.04762513492475421,y:0.6144420789610904},{x:0.04817285008571219,y:0.6113358894861711},{x:0.048545515296550656,y:0.608203873267779},{x:0.04893727666953319,y:0.607000691233013},{x:0.04915700725673716,y:0.6057545602402229},{x:0.06817600725673716,y:0.537751560240223},{x:0.0695259178796919,y:0.5342803033966695},{x:0.07076883034011841,y:0.5307693133112962},{x:0.07112252784165454,y:0.530174666206544},{x:0.07137329591617819,y:0.5295298232221028},{x:0.07337447700044117,y:0.5263886201035727},{x:0.07527846743280868,y:0.5231875729003385},{x:0.0757413786311829,y:0.522673354732434},{x:0.07611313089295507,y:0.5220898246495332},{x:0.07868867817173447,y:0.5193993899302627},{x:0.08118057729149615,y:0.5166313000580217},{x:0.13823757729149616,y:0.46456630005802163},{x:0.1415344063491032,y:0.46210392848613274},{x:0.14479841194755694,y:0.45959821041612353},{x:0.17870395742216458,y:0.4385038845164132},{x:0.16590813892329467,y:0.43401753680148847},{x:0.1630836262780146,y:0.43270367241359486},{x:0.16018787852971583,y:0.4315553012665589},{x:0.15909238677042803,y:0.43084708753997614},{x:0.15790960896480868,y:0.43029690071741367},{x:0.15539569076452509,y:0.4284572467838155},{x:0.15277962009410193,y:0.4267660089056696},{x:0.07398562009410191,y:0.3640750089056696},{x:0.07334669706368892,y:0.36345515994886657},{x:0.07261876409580822,y:0.3629427646304707},{x:0.07018582297292754,y:0.3603886489381779},{x:0.067654053855944,y:0.3579324619307791},{x:0.06714833408498834,y:0.3571998754981266},{x:0.06653435151263618,y:0.35655531303498644},{x:0.06464644192410274,y:0.3535756306924294},{x:0.06264249835499126,y:0.3506727149773525},{x:0.06228941637067996,y:0.3498555439546183},{x:0.061812979199786275,y:0.3491035845207174},{x:0.026491979199786284,y:0.27897658452071744},{x:0.026206182636496978,y:0.2782362375154344},{x:0.02580526951533789,y:0.27755135647970497},{x:0.024619992088609113,y:0.2741272608068926},{x:0.023315086847465263,y:0.27074694483548933},{x:0.02317921632066564,y:0.26996506724675395},{x:0.022919620294515476,y:0.2692151317381758},{x:0.022425125568608657,y:0.2656255929487299},{x:0.02180476064715109,y:0.2620556544171705},{x:0.02182403758498896,y:0.26126229336223583},{x:0.021715734783549545,y:0.26047612298183487},{x:0.018998734783549534,y:0.19034712298183487}],[{x:0.10940940002433477,y:0.19920410482166873},{x:0.1112697837122767,y:0.2472228194523932},{x:0.137749803196691,y:0.2997967648781603},{x:0.20286290613296581,y:0.3516028102138205},{x:0.27392321813344717,y:0.3765172983642545},{x:0.30180455045059645,y:0.38547932587505673},{x:0.3589974388819276,y:0.364332623176267},{x:0.44199758150171664,y:0.31850914110336725},{x:0.48327372240847105,y:0.27362627516037924},{x:0.4919267227459848,y:0.21271770175329152},{x:0.46927072007314496,y:0.15185335046477932},{x:0.41758736799183827,y:0.11304708595854013},{x:0.33285528741119674,y:0.08399594043457195},{x:0.2715476841223936,y:0.0857083982994813},{x:0.19388634557978268,y:0.1114782912788902},{x:0.13622191473335832,y:0.14977174687660325},{x:0.10940940002433477,y:0.19920410482166873}],[{x:0.1412545940070051,y:0.610603192179028},{x:0.17253143522148345,y:0.6595291354872365},{x:0.22488466829434647,y:0.6852221473073319},{x:0.28911227954018853,y:0.6968786351876549},{x:0.37167628924266627,y:0.6906052797020977},{x:0.4210229734590171,y:0.664118250196117},{x:0.4426312796779887,y:0.6255849325813003},{x:0.4416638895166663,y:0.5658316839266069},{x:0.4243877259953326,y:0.5369644730960824},{x:0.3411654121752423,y:0.49266641996418925},{x:0.3038587353431559,y:0.48067475972705925},{x:0.2482367446999157,y:0.5012406330709052},{x:0.1958501022844071,y:0.5338329684082593},{x:0.1513751879049268,y:0.5744167077770947},{x:0.1412545940070051,y:0.610603192179028}]],"9":[[{x:0.04617702144416433,y:0.5785043710151274},{x:0.046308257010348054,y:0.5777836867379841},{x:0.04632014162646953,y:0.5770512474182771},{x:0.047097404355444614,y:0.5734500590446777},{x:0.04775742235616295,y:0.5698255492446179},{x:0.06775742235616294,y:0.499825549244618},{x:0.06870401207934061,y:0.497431122678351},{x:0.06945142103699212,y:0.4949672455435709},{x:0.07032179921115676,y:0.4933388825112154},{x:0.07100061044171635,y:0.4916218095236955},{x:0.07239614115864691,y:0.4894580616864063},{x:0.07360986744638548,y:0.48718733951411786},{x:0.07478119941633177,y:0.4857600673791044},{x:0.07578195180149752,y:0.48420841696912487},{x:0.07757279404935197,y:0.4823584994767568},{x:0.07920619484660538,y:0.4803681948466053},{x:0.1292061948466054,y:0.43036819484660543},{x:0.1324047212320044,y:0.4277432320802026},{x:0.1355710052680468,y:0.42507946670648067},{x:0.13581237417673697,y:0.4249466435819557},{x:0.13602533951411794,y:0.4247718674463855},{x:0.13967451194327588,y:0.422821344145996},{x:0.14329963156393744,y:0.42082647364918746},{x:0.21329963156393744,y:0.39082647364918743},{x:0.21510775104315333,y:0.39025382151681987},{x:0.2168404136401385,y:0.3894823898342746},{x:0.21930272871556003,y:0.3889252240779052},{x:0.22170947225776405,y:0.3881629808537447},{x:0.22359456811709633,y:0.38795407868297094},{x:0.22544443694348562,y:0.38753549554788497},{x:0.30544443694348566,y:0.37753549554788496},{x:0.30933066171136914,y:0.37743373006124875},{x:0.3132134481214367,y:0.3772411973248817},{x:0.31373545479679327,y:0.3773183852372503},{x:0.314262956584918,y:0.37730457196617717},{x:0.3180943620951528,y:0.37796292671622445},{x:0.321940103126635,y:0.37853158749346005},{x:0.39912055139763536,y:0.39782669956121014},{x:0.3920145202755848,y:0.3793136184800785},{x:0.3919728818872528,y:0.3791621799808353},{x:0.39190347676812315,y:0.3790212888743934},{x:0.33928123709710245,y:0.23902627390054626},{x:0.29593066247424293,y:0.13853176000209894},{x:0.2601678276974797,y:0.06104561798577861},{x:0.25727396725620644,y:0.05271224015242973},{x:0.25606147289685455,y:0.04397442167208486},{x:0.2565769400976792,y:0.035167952008718584},{x:0.2588005597432301,y:0.02663125885276897},{x:0.2626468793775489,y:0.018692402534786497},{x:0.2679680870941297,y:0.011656468850909336},{x:0.274559691864592,y:0.005793844786811796},{x:0.2821683820142214,y:0.0013298276974796769},{x:0.29050175984757026,y:-0.0015640327437935753},{x:0.29923957832791515,y:-0.002776527103145486},{x:0.30804604799128144,y:-0.002261059902320825},{x:0.31658274114723106,y:-0.00003744025676995222},{x:0.32452159746521353,y:0.003808879377548882},{x:0.3315575311490907,y:0.009130087094129706},{x:0.33742015521318824,y:0.015721691864591977},{x:0.34188417230252033,y:0.023330382014221395},{x:0.3778841723025203,y:0.10133038201422136},{x:0.3780704961344211,y:0.10186693411204945},{x:0.37834550457920557,y:0.10236389998544072},{x:0.42234550457920556,y:0.2043638999854408},{x:0.4226728981736059,y:0.20538920106595157},{x:0.42314852323187685,y:0.20635471112560658},{x:0.47609350933819694,y:0.3472083534084579},{x:0.5496013805841499,y:0.5387157021808093},{x:0.5512752235949963,y:0.542063388202502},{x:0.5520259437659378,y:0.5440252139743784},{x:0.5529745491659372,y:0.5458993775022888},{x:0.553598518494472,y:0.5481347580495968},{x:0.5544279630456541,y:0.5503023109672317},{x:0.5547815251174404,y:0.5523728990468965},{x:0.5553462721645,y:0.554396114781092},{x:0.555522150986547,y:0.5567102734952235},{x:0.5559127893965689,y:0.5589979940959194},{x:0.5558556061770612,y:0.5610977729446709},{x:0.5560147919588762,y:0.5631922898391183},{x:0.5557358213499382,y:0.5654962948984841},{x:0.5556726416037749,y:0.5678162673625252},{x:0.5552069106120301,y:0.5698645436567753},{x:0.5549544177082778,y:0.5719498706018395},{x:0.5349544177082779,y:0.6619498706018395},{x:0.5345092452033302,y:0.663307558548854},{x:0.5342480120020212,y:0.6647122835522489},{x:0.5331378863550271,y:0.6674899313564284},{x:0.5322058990004909,y:0.6703323081518522},{x:0.5315044085816177,y:0.6715770596583215},{x:0.5309741466497647,y:0.6729038291953012},{x:0.5293434595512297,y:0.6754115305058349},{x:0.5278748598680685,y:0.6780174701150343},{x:0.5269440094186665,y:0.6791014500786302},{x:0.5261650964249364,y:0.6802992771399491},{x:0.4861650964249363,y:0.7302992771399491},{x:0.4855393928217795,y:0.7309407996522789},{x:0.48502142797480674,y:0.7316720783612058},{x:0.48246447922773295,y:0.7340934525762789},{x:0.48000567043073006,y:0.7366144244690945},{x:0.4792668347133476,y:0.7371215515888083},{x:0.4786161570168623,y:0.7377377290536072},{x:0.47563595264764597,y:0.7396137412876539},{x:0.4727325719538572,y:0.7416065836124539},{x:0.4719089971645242,y:0.7419598267287414},{x:0.4711506117974981,y:0.7424372235949962},{x:0.4111506117974981,y:0.7724372235949962},{x:0.40814803697660645,y:0.7735862009991664},{x:0.4052110607504687,y:0.7748937847545917},{x:0.4040364518244048,y:0.77515955677446},{x:0.40291168903276836,y:0.7755899630456542},{x:0.39974265347336024,y:0.7761310898824948},{x:0.39660701348596056,y:0.7768405731449995},{x:0.3166070134859606,y:0.7868395731449994},{x:0.31542693671630134,y:0.7868704603456931},{x:0.31426350899694466,y:0.7870703881908964},{x:0.3110259999999998,y:0.7869856499834279},{x:0.3077884910030554,y:0.7870703881908964},{x:0.3066250632836987,y:0.7868704603456931},{x:0.30544498651403945,y:0.7868395731449994},{x:0.22544498651403946,y:0.7768405731449995},{x:0.22359484289355938,y:0.7764219517671516},{x:0.22170947225776405,y:0.7762130191462554},{x:0.21930299190993624,y:0.775450859278766},{x:0.2168409392495313,y:0.7748937847545917},{x:0.21510801459933976,y:0.7741222619544408},{x:0.21329963156393744,y:0.7735495263508126},{x:0.14329963156393744,y:0.7435495263508126},{x:0.1396745119432796,y:0.741554655854006},{x:0.13602533951411788,y:0.7396041325536146},{x:0.13581237417673678,y:0.7394293564180442},{x:0.1355710052680468,y:0.7392965332935194},{x:0.13240472123200803,y:0.7366327679198006},{x:0.12920619484660534,y:0.7340078051533947},{x:0.07920619484660535,y:0.6840078051533947},{x:0.07757279404935197,y:0.6820175005232432},{x:0.0757819518014975,y:0.6801675830308751},{x:0.07478119941633177,y:0.6786159326208956},{x:0.07360986744638545,y:0.6771886604858821},{x:0.07239614115864686,y:0.6749179383135936},{x:0.07100061044171635,y:0.6727541904763045},{x:0.07032179921115676,y:0.6710371174887846},{x:0.06945142103699209,y:0.669408754456429},{x:0.06870401207934061,y:0.666944877321649},{x:0.06775742235616294,y:0.664550450755382},{x:0.04775742235616295,y:0.5945504507553819},{x:0.0470974043554446,y:0.590925940955322},{x:0.04632014162646953,y:0.5873247525817227},{x:0.046308257010348054,y:0.5865923132620157},{x:0.04617702144416433,y:0.5858716289848723},{x:0.0462367922883029,y:0.5821879999999999},{x:0.04617702144416433,y:0.5785043710151274}],[{x:0.13782670643108905,y:0.5821879999999999},{x:0.15109114488080894,y:0.6286135345740196},{x:0.18671787059591238,y:0.6642402602891231},{x:0.24291204200407931,y:0.688323476606909},{x:0.311026,y:0.696836869931924},{x:0.377796042530131,y:0.6884914492411893},{x:0.4220611757635009,y:0.6663588826245044},{x:0.4493630453483168,y:0.6322315456434845},{x:0.46363172164975686,y:0.5680225022870041},{x:0.4540425513192988,y:0.5488441616260881},{x:0.42235697647551157,y:0.5171585867823008},{x:0.37255000597497323,y:0.48395393978194207},{x:0.30826669745594837,y:0.4678831126521858},{x:0.24291230161158606,y:0.4760524121327311},{x:0.1867178705959123,y:0.500135739710877},{x:0.15109114488080894,y:0.5357624654259804},{x:0.13782670643108905,y:0.5821879999999999}]],"!":[[{x:0.20646600000000004,y:0.05103000000000002},{x:0.20733066238185466,y:0.04225093550927423},{x:0.20989142103699213,y:0.03380924554357098},{x:0.2140498674463855,y:0.026029339514117927},{x:0.21964619484660539,y:0.019210194846605383},{x:0.22646533951411793,y:0.013613867446385479},{x:0.23424524554357098,y:0.009455421036992116},{x:0.24268693550927425,y:0.006894662381854655},{x:0.251466,y:0.0060300000000000215},{x:0.350587,y:0.0060300000000000215},{x:0.3593660644907258,y:0.006894662381854655},{x:0.36780775445642905,y:0.009455421036992116},{x:0.3755876604858821,y:0.013613867446385479},{x:0.38240680515339465,y:0.019210194846605383},{x:0.3880031325536145,y:0.026029339514117927},{x:0.3921615789630079,y:0.03380924554357098},{x:0.39472233761814535,y:0.04225093550927425},{x:0.39558699999999997,y:0.05103000000000002},{x:0.39472233761814535,y:0.05980906449072579},{x:0.3921615789630079,y:0.06825075445642906},{x:0.3880031325536145,y:0.07603066048588211},{x:0.38240680515339465,y:0.08284980515339466},{x:0.3755876604858821,y:0.08844613255361455},{x:0.36780775445642905,y:0.09260457896300792},{x:0.3593660644907258,y:0.09516533761814538},{x:0.350587,y:0.09603000000000002},{x:0.251466,y:0.09603000000000002},{x:0.24268693550927425,y:0.09516533761814538},{x:0.23424524554357098,y:0.09260457896300792},{x:0.22646533951411793,y:0.08844613255361455},{x:0.21964619484660539,y:0.08284980515339466},{x:0.2140498674463855,y:0.07603066048588211},{x:0.20989142103699213,y:0.06825075445642906},{x:0.20733066238185466,y:0.05980906449072579},{x:0.20646600000000004,y:0.05103000000000002}],[{x:0.25602600000000003,y:0.25043400000000005},{x:0.25689066238185465,y:0.24165493550927428},{x:0.2594514210369921,y:0.233213245543571},{x:0.2636098674463855,y:0.22543333951411795},{x:0.26920619484660535,y:0.2186141948466054},{x:0.27602533951411795,y:0.2130178674463855},{x:0.283805245543571,y:0.20885942103699215},{x:0.2922469355092743,y:0.20629866238185468},{x:0.301026,y:0.20543400000000006},{x:0.3098050644907258,y:0.20629866238185468},{x:0.3182467544564291,y:0.20885942103699215},{x:0.32602666048588214,y:0.2130178674463855},{x:0.3328458051533947,y:0.2186141948466054},{x:0.33844213255361455,y:0.22543333951411795},{x:0.34260057896300794,y:0.233213245543571},{x:0.3451613376181454,y:0.24165493550927428},{x:0.346026,y:0.25043400000000005},{x:0.346026,y:0.729004},{x:0.3451613376181454,y:0.7377830644907257},{x:0.34260057896300794,y:0.746224754456429},{x:0.33844213255361455,y:0.7540046604858821},{x:0.3328458051533947,y:0.7608238051533946},{x:0.32602666048588214,y:0.7664201325536145},{x:0.3182467544564291,y:0.7705785789630079},{x:0.3098050644907258,y:0.7731393376181454},{x:0.301026,y:0.774004},{x:0.2922469355092743,y:0.7731393376181454},{x:0.283805245543571,y:0.7705785789630079},{x:0.27602533951411795,y:0.7664201325536145},{x:0.26920619484660535,y:0.7608238051533946},{x:0.2636098674463855,y:0.7540046604858821},{x:0.2594514210369921,y:0.746224754456429},{x:0.25689066238185465,y:0.7377830644907257},{x:0.25602600000000003,y:0.729004},{x:0.25602600000000003,y:0.25043400000000005}]],'"':[[{x:0.12004,y:0.476978},{x:0.12090466238185463,y:0.4681989355092742},{x:0.1234654210369921,y:0.459757245543571},{x:0.12762386744638546,y:0.4519773395141179},{x:0.13322019484660536,y:0.44515819484660535},{x:0.1400393395141179,y:0.4395618674463855},{x:0.14781924554357095,y:0.4354034210369921},{x:0.15626093550927422,y:0.43284266238185465},{x:0.16504,y:0.43197800000000003},{x:0.17381906449072576,y:0.43284266238185465},{x:0.18226075445642903,y:0.4354034210369921},{x:0.19004066048588208,y:0.4395618674463855},{x:0.19685980515339463,y:0.44515819484660535},{x:0.20245613255361453,y:0.4519773395141179},{x:0.2066145789630079,y:0.459757245543571},{x:0.20917533761814536,y:0.4681989355092742},{x:0.21004,y:0.476978},{x:0.21004,y:0.729004},{x:0.20917533761814536,y:0.7377830644907257},{x:0.2066145789630079,y:0.746224754456429},{x:0.20245613255361453,y:0.7540046604858821},{x:0.19685980515339463,y:0.7608238051533946},{x:0.19004066048588208,y:0.7664201325536145},{x:0.18226075445642903,y:0.7705785789630079},{x:0.17381906449072576,y:0.7731393376181454},{x:0.16504,y:0.774004},{x:0.15626093550927422,y:0.7731393376181454},{x:0.14781924554357095,y:0.7705785789630079},{x:0.1400393395141179,y:0.7664201325536145},{x:0.13322019484660536,y:0.7608238051533946},{x:0.12762386744638546,y:0.7540046604858821},{x:0.1234654210369921,y:0.746224754456429},{x:0.12090466238185463,y:0.7377830644907257},{x:0.12004,y:0.729004},{x:0.12004,y:0.476978}],[{x:0.392013,y:0.476978},{x:0.3928776623818546,y:0.4681989355092742},{x:0.39543842103699206,y:0.459757245543571},{x:0.39959686744638545,y:0.4519773395141179},{x:0.4051931948466053,y:0.44515819484660535},{x:0.4120123395141179,y:0.4395618674463855},{x:0.419792245543571,y:0.4354034210369921},{x:0.42823393550927424,y:0.43284266238185465},{x:0.437013,y:0.43197800000000003},{x:0.4457920644907258,y:0.43284266238185465},{x:0.45423375445642905,y:0.4354034210369921},{x:0.4620136604858821,y:0.4395618674463855},{x:0.46883280515339465,y:0.44515819484660535},{x:0.4744291325536145,y:0.4519773395141179},{x:0.4785875789630079,y:0.459757245543571},{x:0.48114833761814535,y:0.4681989355092742},{x:0.48201299999999997,y:0.476978},{x:0.48201299999999997,y:0.729004},{x:0.48114833761814535,y:0.7377830644907257},{x:0.4785875789630079,y:0.746224754456429},{x:0.4744291325536145,y:0.7540046604858821},{x:0.46883280515339465,y:0.7608238051533946},{x:0.4620136604858821,y:0.7664201325536145},{x:0.45423375445642905,y:0.7705785789630079},{x:0.4457920644907258,y:0.7731393376181454},{x:0.437013,y:0.774004},{x:0.42823393550927424,y:0.7731393376181454},{x:0.419792245543571,y:0.7705785789630079},{x:0.4120123395141179,y:0.7664201325536145},{x:0.4051931948466053,y:0.7608238051533946},{x:0.39959686744638545,y:0.7540046604858821},{x:0.39543842103699206,y:0.746224754456429},{x:0.3928776623818546,y:0.7377830644907257},{x:0.392013,y:0.729004},{x:0.392013,y:0.476978}]],"#":[[{x:-0.04343582416242281,y:0.17932596542766122},{x:-0.043155600373289436,y:0.1705088746946064},{x:-0.04116063193533153,y:0.16191587083690517},{x:-0.037527584366828626,y:0.15387717817379684},{x:-0.03239607364840174,y:0.1467017191561739},{x:-0.025963300859175642,y:0.14066524265003977},{x:-0.01847647384989975,y:0.13599972706223024},{x:-0.010223307183879607,y:0.1328844655403335},{x:-0.0015209654276611437,y:0.13143917583757725},{x:0.007296125305393629,y:0.13171939962671061},{x:0.11028337660265361,y:0.14517801654688708},{x:0.10171449233133083,y:0.05447855391336175},{x:0.10174959121806887,y:0.04565708110917159},{x:0.10350499965956604,y:0.03701195788446062},{x:0.10691325829386003,y:0.02887541147651351},{x:0.11184338965300836,y:0.02156012480075985},{x:0.11810593155372849,y:0.015347220221688843},{x:0.1254602180228497,y:0.01047545617803717},{x:0.13362362795569505,y:0.007132051829885598},{x:0.14228244608663826,y:0.005445492331330834},{x:0.15110391889082841,y:0.0054805912180688685},{x:0.1597490421155394,y:0.0072359996595660475},{x:0.1678855885234865,y:0.010644258293860037},{x:0.17520087519924016,y:0.015574389653008364},{x:0.18141377977831116,y:0.02183693155372849},{x:0.18628554382196283,y:0.029191218022849703},{x:0.18962894817011441,y:0.03735462795569504},{x:0.19131550766866917,y:0.04601344608663827},{x:0.2018142041879224,y:0.1571394809935999},{x:0.36570083500909,y:0.17855657247605955},{x:0.35397849233133083,y:0.05447855391336175},{x:0.35401359121806886,y:0.04565708110917159},{x:0.35576899965956604,y:0.03701195788446062},{x:0.35917725829386,y:0.02887541147651351},{x:0.3641073896530084,y:0.02156012480075985},{x:0.3703699315537285,y:0.015347220221688843},{x:0.37772421802284967,y:0.01047545617803717},{x:0.38588762795569503,y:0.007132051829885598},{x:0.39454644608663825,y:0.005445492331330834},{x:0.4033679188908284,y:0.0054805912180688685},{x:0.4120130421155394,y:0.0072359996595660475},{x:0.4201495885234865,y:0.010644258293860037},{x:0.42746487519924015,y:0.015574389653008364},{x:0.4336777797783111,y:0.02183693155372849},{x:0.4385495438219628,y:0.029191218022849703},{x:0.44189294817011443,y:0.03735462795569504},{x:0.44357950766866916,y:0.04601344608663827},{x:0.45723166259435877,y:0.19051803692277236},{x:0.5748861253053936,y:0.20589339962671058},{x:0.5834791291630949,y:0.20788836806466848},{x:0.5915178218262032,y:0.2115214156331714},{x:0.5986932808438261,y:0.21665292635159827},{x:0.6047297573499603,y:0.22308569914082438},{x:0.6093952729377698,y:0.23057252615010027},{x:0.6125105344596665,y:0.2388256928161204},{x:0.6139558241624228,y:0.24752803457233888},{x:0.6136756003732894,y:0.25634512530539366},{x:0.6116806319353315,y:0.2649381291630949},{x:0.6080475843668286,y:0.2729768218262032},{x:0.6029160736484017,y:0.2801522808438262},{x:0.5964833008591757,y:0.2861887573499603},{x:0.5889964738498997,y:0.29085427293776983},{x:0.5807433071838796,y:0.29396953445966656},{x:0.5720409654276611,y:0.2954148241624228},{x:0.5632238746946063,y:0.2951346003732895},{x:0.4659139564059225,y:0.28241791072205386},{x:0.48521785958998953,y:0.48674482074743597},{x:0.6064180682130128,y:0.5025833921657807},{x:0.6150110746232834,y:0.5045783496089273},{x:0.6230497719348954,y:0.5082113868918628},{x:0.6302252375183169,y:0.5133428884292346},{x:0.6362617222552247,y:0.5197756534947408},{x:0.640927247422479,y:0.5272624745344501},{x:0.6440425195043586,y:0.5355156372144642},{x:0.645487820341822,y:0.544217977121417},{x:0.6452076078342193,y:0.5530350682130128},{x:0.6432126503910727,y:0.5616280746232835},{x:0.6395796131081373,y:0.5696667719348955},{x:0.6344481115707654,y:0.576842237518317},{x:0.6280153465052593,y:0.5828787222552247},{x:0.6205285254655499,y:0.587544247422479},{x:0.6122753627855358,y:0.5906595195043587},{x:0.603573022878583,y:0.592104820341822},{x:0.5947559317869872,y:0.5918246078342193},{x:0.493900150869001,y:0.5786446677402959},{x:0.5066445076686692,y:0.7135404460866382},{x:0.5066094087819312,y:0.7223619188908285},{x:0.5048540003404339,y:0.7310070421155394},{x:0.50144574170614,y:0.7391435885234865},{x:0.4965156103469916,y:0.7464588751992401},{x:0.4902530684462715,y:0.7526717797783111},{x:0.4828987819771503,y:0.7575435438219629},{x:0.47473537204430494,y:0.7608869481701144},{x:0.4660765539133617,y:0.7625735076686692},{x:0.45725508110917157,y:0.7625384087819311},{x:0.44860995788446056,y:0.760783000340434},{x:0.4404734114765135,y:0.7573747417061399},{x:0.43315812480075977,y:0.7524446103469916},{x:0.4269452202216888,y:0.7461820684462716},{x:0.42207345617803715,y:0.7388277819771503},{x:0.41873005182988554,y:0.730664372044305},{x:0.4170434923313308,y:0.7220055539133617},{x:0.40236933467780645,y:0.5666833238969633},{x:0.23848272425781383,y:0.5452664483557571},{x:0.25438050766866915,y:0.7135404460866382},{x:0.2543454087819311,y:0.7223619188908285},{x:0.25259000034043394,y:0.7310070421155394},{x:0.24918174170614,y:0.7391435885234865},{x:0.2442516103469916,y:0.7464588751992401},{x:0.23798906844627152,y:0.7526717797783111},{x:0.2306347819771503,y:0.7575435438219629},{x:0.22247137204430495,y:0.7608869481701144},{x:0.21381255391336174,y:0.7625735076686692},{x:0.20499108110917158,y:0.7625384087819311},{x:0.1963459578844606,y:0.760783000340434},{x:0.18820941147651346,y:0.7573747417061399},{x:0.1808941248007598,y:0.7524446103469916},{x:0.17468122022168883,y:0.7461820684462716},{x:0.16980945617803714,y:0.7388277819771503},{x:0.16646605182988555,y:0.730664372044305},{x:0.16477949233133082,y:0.7220055539133617},{x:0.14695190806661926,y:0.5333051045124245},{x:0.02716793178698713,y:0.5176516078342193},{x:0.01857492537671658,y:0.5156566503910727},{x:0.01053622806510461,y:0.5120236131081373},{x:0.0033607624816830023,y:0.5068921115707654},{x:-0.0026757222552247634,y:0.5004593465052593},{x:-0.0073412474224789775,y:0.4929725254655499},{x:-0.010456519504358698,y:0.48471936278553585},{x:-0.011901820341822023,y:0.476017022878583},{x:-0.011621607834219276,y:0.4671999317869871},{x:-0.00962665039107264,y:0.45860692537671655},{x:-0.005993613108137223,y:0.45056822806510455},{x:-0.0008621115707654614,y:0.44339276248168297},{x:0.005570653494740684,y:0.4373562777447752},{x:0.013057474534450029,y:0.432690752577521},{x:0.02131063721446411,y:0.42957548049564126},{x:0.03001297712141698,y:0.42813017965817796},{x:0.03883006821301287,y:0.4284103921657807},{x:0.13826961678760774,y:0.4414052575195645},{x:0.1189656704142173,y:0.23707789034616855},{x:-0.004366125305393629,y:0.2209606003732895},{x:-0.012959129163094893,y:0.21896563193533158},{x:-0.0209978218262032,y:0.2153325843668287},{x:-0.028173280843826164,y:0.2102010736484018},{x:-0.034209757349960276,y:0.2037683008591757},{x:-0.03887527293776982,y:0.1962814738498998},{x:-0.041990534459666565,y:0.18802830718387967},{x:-0.04343582416242281,y:0.17932596542766122}],[{x:0.2104964979994861,y:0.24903935479288136},{x:0.22980043297880234,y:0.4533666013628972},{x:0.39368704339879496,y:0.4747834769041034},{x:0.3743831288206537,y:0.27045644627534104},{x:0.2104964979994861,y:0.24903935479288136}]],$:[[{x:0.030517420733400163,y:0.165091535964518},{x:0.03086584266660257,y:0.1562768767808978},{x:0.032927224468652025,y:0.14769956254897784},{x:0.06950822446865203,y:0.04228956254897785},{x:0.0704003940010533,y:0.04035550336969822},{x:0.07109145007989037,y:0.03834080913001754},{x:0.07224350295250744,y:0.03635998272422403},{x:0.073203348392932,y:0.034279214644477654},{x:0.0744556913660193,y:0.03255637151138059},{x:0.07552651634405921,y:0.03071520740954014},{x:0.07704287290513265,y:0.02899719639360223},{x:0.07839021289928177,y:0.02714366624511229},{x:0.07995460247492134,y:0.0256982470536212},{x:0.08136404514878363,y:0.02410136799351792},{x:0.08318643266605391,y:0.022712194567306505},{x:0.08486948969354943,y:0.02115713247420773},{x:0.0866858072576693,y:0.0200446838732511},{x:0.08837970353582197,y:0.01875345702162473},{x:0.17373770353582196,y:-0.03394954297837521},{x:0.17475219432147746,y:-0.03444582628601368},{x:0.17568351020275566,y:-0.03508468417701866},{x:0.17870701554383397,y:-0.03638050305696308},{x:0.18166188368778688,y:-0.037826008286632525},{x:0.18275370138776084,y:-0.03811483831561822},{x:0.18379175728720304,y:-0.038559730016208084},{x:0.18700996854351615,y:-0.03924079346911771},{x:0.19019006380536974,y:-0.04008205754340442},{x:0.19131725047775072,y:-0.0401523347177012},{x:0.19242215448928965,y:-0.04038616328932037},{x:0.262121,y:-0.048110644533924524},{x:0.262121,y:-0.08350199999999997},{x:0.2629856623818546,y:-0.09228106449072573},{x:0.26554642103699205,y:-0.100722754456429},{x:0.26970486744638544,y:-0.10850266048588206},{x:0.2753011948466053,y:-0.1153218051533946},{x:0.2821203395141179,y:-0.1209181325536145},{x:0.28990024554357097,y:-0.12507657896300786},{x:0.29834193550927424,y:-0.12763733761814533},{x:0.307121,y:-0.12850199999999995},{x:0.3159000644907258,y:-0.12763733761814533},{x:0.32434175445642904,y:-0.12507657896300786},{x:0.3321216604858821,y:-0.1209181325536145},{x:0.33894080515339464,y:-0.1153218051533946},{x:0.3445371325536145,y:-0.10850266048588206},{x:0.3486955789630079,y:-0.100722754456429},{x:0.35125633761814534,y:-0.09228106449072573},{x:0.35212099999999996,y:-0.08350199999999997},{x:0.35212099999999996,y:-0.05796857189257534},{x:0.3537665284657676,y:-0.05798865052825875},{x:0.3565834008023822,y:-0.05822276473922817},{x:0.35816715833059226,y:-0.05804234673933715},{x:0.35976104048452195,y:-0.05806179518994546},{x:0.3625398346041163,y:-0.05754422155704884},{x:0.36534825494544937,y:-0.05722429279787242},{x:0.3668663832111493,y:-0.05673836571308556},{x:0.3684334335709129,y:-0.056446489484502926},{x:0.37105786033397337,y:-0.05539674504422484},{x:0.37374990266128777,y:-0.05453506799769968},{x:0.49568890266128773,y:-0.0018330679976996528},{x:0.4995437197067623,y:0.0003036028478311586},{x:0.5033988605511543,y:0.0024396894158641644},{x:0.5034014762743246,y:0.0024419030290919073},{x:0.503404473339876,y:0.00244356426035406},{x:0.5067683773534712,y:0.005291217073469004},{x:0.510132712931077,y:0.008138360005776092},{x:0.5101348465393426,y:0.008141041387321917},{x:0.510137461926978,y:0.00814325539697476},{x:0.5128811799638975,y:0.011592456477016289},{x:0.5156254207452635,y:0.015041241667436683},{x:0.5156269902452553,y:0.015044287773311453},{x:0.5156291234470946,y:0.015046969478205698},{x:0.5176472159618929,y:0.018965167962033513},{x:0.519665902312761,y:0.02288306052976895},{x:0.5684429023127611,y:0.1458620605297689},{x:0.5688122064775901,y:0.14714915498994666},{x:0.5693537919217377,y:0.14837377040805427},{x:0.5700262192706007,y:0.15138021786244946},{x:0.5708758841928585,y:0.15434145989163614},{x:0.5709869926090132,y:0.15567587086110493},{x:0.5712792610244494,y:0.1569826137160382},{x:0.5713522390683521,y:0.16006247719363653},{x:0.5716078682563359,y:0.16313258119086366},{x:0.5714565110896938,y:0.16446302800441426},{x:0.5714882307651191,y:0.1658016809010868},{x:0.5709589549987614,y:0.16883660297565092},{x:0.5706107247661352,y:0.1718975865660398},{x:0.570202718587728,y:0.17317294089875004},{x:0.5699726705538047,y:0.1744920601570685},{x:0.5455836705538047,y:0.26233106015706853},{x:0.5448796820390573,y:0.26415145628779163},{x:0.5443792359109676,y:0.2660379863232085},{x:0.5432925447356423,y:0.2682555269445408},{x:0.5424018225194911,y:0.2705587850827968},{x:0.5413562192793141,y:0.27220686146627543},{x:0.5404973453311464,y:0.27395951015977},{x:0.5389989139081434,y:0.2759224384285429},{x:0.5376759632977357,y:0.2780076688235372},{x:0.5363289272782685,y:0.2794200908086057},{x:0.5351446315541886,y:0.28097150485378414},{x:0.5332920437627642,y:0.28260438653745124},{x:0.5315877050081386,y:0.28439145495451523},{x:0.529991002048182,y:0.2855139439563835},{x:0.528526796368706,y:0.2868045033815319},{x:0.4553637963687061,y:0.3395095033815319},{x:0.4552094954443409,y:0.33959910378534747},{x:0.4550747122553104,y:0.3397160246969866},{x:0.45139660000367776,y:0.341813199213456},{x:0.44773515946955245,y:0.3439393468807752},{x:0.44756634322254935,y:0.3439971230209339},{x:0.4474113397164003,y:0.34408550243429054},{x:0.4433947629085852,y:0.34542481622689836},{x:0.43938888509457313,y:0.34679579895012297},{x:0.43921204103863115,y:0.34681953052195974},{x:0.439042773913178,y:0.34687597206574233},{x:0.35212099999999996,y:0.3666493043587998},{x:0.35212099999999996,y:0.6320956693586206},{x:0.3838005126074005,y:0.6288356018928482},{x:0.4577579663937751,y:0.5527249728659002},{x:0.46449612147708186,y:0.5470313904751531},{x:0.47221556762189953,y:0.5427617575185425},{x:0.48061965084199804,y:0.5400801535961528},{x:0.48938540693229315,y:0.5390896312428609},{x:0.49817597280212744,y:0.5398282556772123},{x:0.5066535319349293,y:0.5422676419764202},{x:0.5144922964874953,y:0.5463140458930298},{x:0.5213910271340998,y:0.551811966393775},{x:0.5270846095248467,y:0.5585501214770818},{x:0.5313542424814575,y:0.5662695676218995},{x:0.534035846403847,y:0.5746736508419981},{x:0.535026368757139,y:0.5834394069322931},{x:0.5342877443227877,y:0.5922299728021274},{x:0.5318483580235798,y:0.6007075319349293},{x:0.5278019541069703,y:0.6085462964874953},{x:0.5223040336062249,y:0.6154450271340998},{x:0.4369490336062249,y:0.7032850271340998},{x:0.435089451582588,y:0.7048563301588934},{x:0.43337550685970433,y:0.706585327551969},{x:0.43172842132509603,y:0.7076963215886295},{x:0.4302108785229181,y:0.7089786095248467},{x:0.4280804818333404,y:0.7101569339468108},{x:0.4260621594195314,y:0.7115183351118896},{x:0.4242299779872524,y:0.7122866512623272},{x:0.42249143237810044,y:0.7132482424814575},{x:0.4201720909726226,y:0.7139883059538676},{x:0.4179269538663623,y:0.7149297930076584},{x:0.4159800862413552,y:0.7153259053130885},{x:0.41408734915800194,y:0.715929846403847},{x:0.4116681940261354,y:0.716203208702491},{x:0.4092825215873294,y:0.7166886008255086},{x:0.35212099999999996,y:0.7225709645831306},{x:0.35212099999999996,y:0.7597659999999999},{x:0.35125633761814534,y:0.7685450644907257},{x:0.3486955789630079,y:0.776986754456429},{x:0.3445371325536145,y:0.7847666604858821},{x:0.33894080515339464,y:0.7915858051533946},{x:0.3321216604858821,y:0.7971821325536145},{x:0.32434175445642904,y:0.8013405789630078},{x:0.3159000644907258,y:0.8039013376181453},{x:0.307121,y:0.804766},{x:0.29834193550927424,y:0.8039013376181453},{x:0.28990024554357097,y:0.8013405789630078},{x:0.2821203395141179,y:0.7971821325536145},{x:0.2753011948466053,y:0.7915858051533946},{x:0.26970486744638544,y:0.7847666604858821},{x:0.26554642103699205,y:0.776986754456429},{x:0.2629856623818546,y:0.7685450644907257},{x:0.262121,y:0.7597659999999999},{x:0.262121,y:0.7318326623736131},{x:0.23856652158732947,y:0.7342566008255086},{x:0.23743405616423266,y:0.7342615520061975},{x:0.23631438427367413,y:0.7344313675125375},{x:0.2330314335362298,y:0.7342808004350606},{x:0.22974506326706257,y:0.734295168567351},{x:0.22863339192208898,y:0.7340790915684273},{x:0.22750210485113245,y:0.7340272069677483},{x:0.2243116092711877,y:0.7332390610779145},{x:0.22108558260167874,y:0.7326120140964958},{x:0.22003742624118275,y:0.7321832126358507},{x:0.21893799871753236,y:0.7319116218242595},{x:0.21596256725097532,y:0.7305161851266182},{x:0.21292085857685591,y:0.729271820095334},{x:0.21197649726195836,y:0.7286467727726252},{x:0.21095117966878213,y:0.7281659128327016},{x:0.2083051564782311,y:0.7262168111769735},{x:0.20556465695803808,y:0.7244029483461277},{x:0.204760381964467,y:0.7236056753794367},{x:0.20384857668186554,y:0.7229340254890024},{x:0.10629557668186554,y:0.6350940254890024},{x:0.10393291169686979,y:0.6325042238563513},{x:0.10146752815288923,y:0.6300120075116347},{x:0.10096488682836192,y:0.6292508655939548},{x:0.10035013880638408,y:0.6285770182897039},{x:0.09853811700104832,y:0.6255760458964971},{x:0.09660631239978806,y:0.6226507443205297},{x:0.09626182060918942,y:0.6218061670735107},{x:0.09579034588565258,y:0.6210253361666956},{x:0.09459860224176168,y:0.6177285186990383},{x:0.0932746147506803,y:0.6144825495908574},{x:0.056695614750680294,y:0.49150554959085735},{x:0.05654965816703397,y:0.490750439567249},{x:0.05628361804350595,y:0.49002883224693095},{x:0.05571374572525952,y:0.48642582571377374},{x:0.055021470477783566,y:0.4828443224653027},{x:0.055025633066628665,y:0.4820752469521588},{x:0.05490548343396577,y:0.4813156032607913},{x:0.055049472757300266,y:0.47767065091379934},{x:0.05506921600663437,y:0.4740229090450286},{x:0.05522333780201598,y:0.4732694231830167},{x:0.05525369594322076,y:0.472500935801646},{x:0.05610601347919053,y:0.46895411111540136},{x:0.056837016503334954,y:0.46538031130067065},{x:0.05713517469108906,y:0.46467137112890816},{x:0.05731487395982006,y:0.46392357259662753},{x:0.08169987395982006,y:0.39365157259662753},{x:0.08192222202041206,y:0.3931695328553223},{x:0.08205835369770847,y:0.3926564352635495},{x:0.08376780756696771,y:0.3891683934837906},{x:0.08539480756850773,y:0.3856411369034641},{x:0.08570692456181836,y:0.38521173737536313},{x:0.08594054088151196,y:0.3847350567827023},{x:0.08829763126802886,y:0.38164753465350854},{x:0.09058150254284453,y:0.37850546527353984},{x:0.0909713939878581,y:0.378145207541698},{x:0.09129351720579659,y:0.37772326251599964},{x:0.09420766244788897,y:0.3751549117812935},{x:0.09706063710369874,y:0.372518777565862},{x:0.09751331969083687,y:0.37224150613287915},{x:0.09791157079240381,y:0.3718905117848512},{x:0.17107757079240382,y:0.3191875117848513},{x:0.17123114354048857,y:0.3190983419119289},{x:0.17136528774468962,y:0.3189819753030134},{x:0.17504412834709762,y:0.3168843854977816},{x:0.17870637355344754,y:0.314757953928811},{x:0.1788743916234626,y:0.3147004579868701},{x:0.17902866028359976,y:0.31461249756570947},{x:0.183046032465951,y:0.31327291855818423},{x:0.1870527548771027,y:0.3119018143721617},{x:0.18722876142884332,y:0.31187820189800686},{x:0.18739722608682208,y:0.3118220279342577},{x:0.262121,y:0.2948235482063542},{x:0.262121,y:0.04244038202745839},{x:0.212402420161311,y:0.04795051974434915},{x:0.14928483997433578,y:0.08692151049617265},{x:0.11795277553134796,y:0.17720643745102208},{x:0.114257651607068,y:0.18521678535552225},{x:0.10907078710071823,y:0.1923523337548876},{x:0.10259151030645056,y:0.1983388675257922},{x:0.09506881619784838,y:0.20294632753270694},{x:0.08679179769072982,y:0.20599765167145945},{x:0.07807853596451803,y:0.20737557926659977},{x:0.06926387678089782,y:0.20702715733339738},{x:0.0606865625489779,y:0.20496577553134793},{x:0.052676214644477706,y:0.20127065160706795},{x:0.04554066624511235,y:0.1960837871007182},{x:0.039554132474207776,y:0.18960451030645054},{x:0.034946672467293015,y:0.18208181619784836},{x:0.03189534832854049,y:0.1738047976907298},{x:0.030517420733400163,y:0.165091535964518}],[{x:0.14709211773983194,y:0.4797371545422716},{x:0.17592903295677773,y:0.5766856037244347},{x:0.24922570721126042,y:0.6426843927572041},{x:0.262121,y:0.6413573671491031},{x:0.262121,y:0.3871228845247169},{x:0.21626819752335621,y:0.3975536737173561},{x:0.16206100150816494,y:0.4366002507010456},{x:0.14709211773983194,y:0.4797371545422716}],[{x:0.35212099999999996,y:0.034163101195078524},{x:0.35212099999999996,y:0.2743499680404371},{x:0.4101709471377665,y:0.26114452085874473},{x:0.4630938273127818,y:0.2230200535785049},{x:0.47920731446793274,y:0.1649859973145621},{x:0.44287681685863156,y:0.07338773859643172},{x:0.35212099999999996,y:0.034163101195078524}]],"'":[[{x:0.25602600000000003,y:0.476978},{x:0.25689066238185465,y:0.4681989355092742},{x:0.2594514210369921,y:0.459757245543571},{x:0.2636098674463855,y:0.4519773395141179},{x:0.26920619484660535,y:0.44515819484660535},{x:0.27602533951411795,y:0.4395618674463855},{x:0.283805245543571,y:0.4354034210369921},{x:0.2922469355092743,y:0.43284266238185465},{x:0.301026,y:0.43197800000000003},{x:0.3098050644907258,y:0.43284266238185465},{x:0.3182467544564291,y:0.4354034210369921},{x:0.32602666048588214,y:0.4395618674463855},{x:0.3328458051533947,y:0.44515819484660535},{x:0.33844213255361455,y:0.4519773395141179},{x:0.34260057896300794,y:0.459757245543571},{x:0.3451613376181454,y:0.4681989355092742},{x:0.346026,y:0.476978},{x:0.346026,y:0.729004},{x:0.3451613376181454,y:0.7377830644907257},{x:0.34260057896300794,y:0.746224754456429},{x:0.33844213255361455,y:0.7540046604858821},{x:0.3328458051533947,y:0.7608238051533946},{x:0.32602666048588214,y:0.7664201325536145},{x:0.3182467544564291,y:0.7705785789630079},{x:0.3098050644907258,y:0.7731393376181454},{x:0.301026,y:0.774004},{x:0.2922469355092743,y:0.7731393376181454},{x:0.283805245543571,y:0.7705785789630079},{x:0.27602533951411795,y:0.7664201325536145},{x:0.26920619484660535,y:0.7608238051533946},{x:0.2636098674463855,y:0.7540046604858821},{x:0.2594514210369921,y:0.746224754456429},{x:0.25689066238185465,y:0.7377830644907257},{x:0.25602600000000003,y:0.729004},{x:0.25602600000000003,y:0.476978}]],"(":[[{x:0.14398102142772873,y:0.343473372436119},{x:0.14438344127795402,y:0.34024506484177663},{x:0.14461855620935057,y:0.33700027938992067},{x:0.15480555620935058,y:0.27783527938992064},{x:0.15553530200183258,y:0.27518493680242373},{x:0.1560666158259812,y:0.2724877993619115},{x:0.1764416158259812,y:0.20487079936191147},{x:0.17757136816824137,y:0.2021290142392397},{x:0.17852197521392682,y:0.19932008699588913},{x:0.2090839752139268,y:0.13170208699588917},{x:0.21040800505224358,y:0.12940389577393302},{x:0.21154775445201235,y:0.12700896170152925},{x:0.25229575445201236,y:0.05939296170152925},{x:0.2531150427152032,y:0.05829379345186112},{x:0.2537782786760274,y:0.05709399256856861},{x:0.29452927867602746,y:-0.0020700074314313824},{x:0.29560111146026063,y:-0.0033391000809501682},{x:0.29650963843516415,y:-0.004729783512322571},{x:0.3372576384351641,y:-0.05544378351232261},{x:0.3386866074193021,y:-0.05690267270426387},{x:0.3399537097957662,y:-0.05850416001284604},{x:0.38070370979576623,y:-0.10073716001284601},{x:0.38742176905533504,y:-0.10645444032360908},{x:0.3951261287468799,y:-0.11075123635207199},{x:0.40352071464810957,y:-0.11346242463653189},{x:0.41228292753057777,y:-0.11448381573166892},{x:0.42107604046711683,y:-0.11377615815049966},{x:0.4295621390588101,y:-0.11136664677700951},{x:0.4374151072958377,y:-0.10734787778201216},{x:0.444333160012846,y:-0.10187429020423372},{x:0.4500504403236091,y:-0.09515623094466494},{x:0.45434723635207197,y:-0.08745187125312004},{x:0.4570584246365319,y:-0.07905728535189037},{x:0.45807981573166895,y:-0.07029507246942218},{x:0.4573721581504997,y:-0.06150195953288313},{x:0.45496264677700954,y:-0.053015860941189874},{x:0.45094387778201217,y:-0.04516289270416226},{x:0.44547029020423373,y:-0.03824483998715393},{x:0.4061377413616867,y:0.0025191240684850026},{x:0.3677075745656829,y:0.050348403515145926},{x:0.3286739379437331,y:0.10701906379590062},{x:0.2900025757951927,y:0.1711891536907596},{x:0.2617573982317254,y:0.23368121626802973},{x:0.24303344075060918,y:0.2958190240226623},{x:0.23462816944303005,y:0.34463593546989096},{x:0.24303340667749923,y:0.39345182392970596},{x:0.26175739639474455,y:0.45558881969516635},{x:0.2900026404789191,y:0.5180819536434618},{x:0.328674029726828,y:0.5822520885061939},{x:0.36770768599197223,y:0.6389237351633864},{x:0.4061420841180472,y:0.6867582808236831},{x:0.4454798975405431,y:0.7275528000242046},{x:0.45095135740921277,y:0.7344725356602282},{x:0.45496771125722263,y:0.7423267393839987},{x:0.45737461285859093,y:0.7508135785511003},{x:0.458079566334583,y:0.759606908691815},{x:0.4570554807184589,y:0.768368807060192},{x:0.4543417110461325,y:0.7767625588156633},{x:0.4500425459642118,y:0.7844655967855365},{x:0.4443231999757953,y:0.791181897540543},{x:0.4374034643397718,y:0.7966533574092127},{x:0.4295492606160011,y:0.8006697112572226},{x:0.42106242144889966,y:0.8030766128585909},{x:0.41226909130818484,y:0.803781566334583},{x:0.403507192939808,y:0.8027574807184589},{x:0.39511344118433667,y:0.8000437110461325},{x:0.3874104032144634,y:0.7957445459642117},{x:0.38069410245945684,y:0.7900251999757952},{x:0.33994410245945683,y:0.7477661999757953},{x:0.338681775527778,y:0.7461697396410558},{x:0.3372576384351641,y:0.7447157835123226},{x:0.29650963843516415,y:0.6940017835123226},{x:0.2956010143988682,y:0.6926109515089496},{x:0.29452907712829884,y:0.6913417148135671},{x:0.2537780771282988,y:0.6321767148135672},{x:0.25311493656839296,y:0.6309770641401381},{x:0.25229575445201236,y:0.6298780382984708},{x:0.21154775445201235,y:0.5622620382984707},{x:0.21040795156345282,y:0.5598669918310725},{x:0.2090838723444427,y:0.5575686854051248},{x:0.17852187234444272,y:0.48994968540512485},{x:0.17757135012625538,y:0.48714095747585867},{x:0.17644166886939822,y:0.4843993766680373},{x:0.1560666688693982,y:0.4167833766680374},{x:0.15553533856931018,y:0.4140862136984408},{x:0.15480557779123924,y:0.4114358459543075},{x:0.14461857779123924,y:0.3522718459543075},{x:0.14438345368873493,y:0.3490270611669966},{x:0.14398102471397584,y:0.3457987547100726},{x:0.14406527252602844,y:0.3446360634540339},{x:0.14398102142772873,y:0.343473372436119}]],")":[[{x:0.14397318426833106,y:-0.07029507246942218},{x:0.14499457536346808,y:-0.07905728535189037},{x:0.14770576364792798,y:-0.08745187125312004},{x:0.1520025596763909,y:-0.09515623094466495},{x:0.15771983998715397,y:-0.10187429020423372},{x:0.16463789270416226,y:-0.10734787778201214},{x:0.1724908609411899,y:-0.11136664677700951},{x:0.18097695953288315,y:-0.11377615815049966},{x:0.1897700724694222,y:-0.11448381573166892},{x:0.19853228535189038,y:-0.11346242463653189},{x:0.20692687125312006,y:-0.11075123635207199},{x:0.21463123094466496,y:-0.10645444032360907},{x:0.22134929020423375,y:-0.10073716001284601},{x:0.2620992902042337,y:-0.05850416001284604},{x:0.2633660586938147,y:-0.05690309470300352},{x:0.26479468609075496,y:-0.05544462417080616},{x:0.30554468609075497,y:-0.004730624170806122},{x:0.3064541047100432,y:-0.003338648753719708},{x:0.307526891803669,y:-0.002068307996824087},{x:0.348273891803669,y:0.05709569200317591},{x:0.3489362195699084,y:0.058293979727073175},{x:0.3497544895549002,y:0.059391707275619196},{x:0.39050548955490016,y:0.12700770727561922},{x:0.39164563057902163,y:0.12940326331913213},{x:0.3929700247860732,y:0.13170208699588917},{x:0.42353202478607316,y:0.19932008699588913},{x:0.4244827292530259,y:0.20212930210713742},{x:0.4256125601984483,y:0.2048713835354543},{x:0.4459865601984483,y:0.27248838353545435},{x:0.4465177787005257,y:0.27518522990297933},{x:0.4472474437906494,y:0.27783527938992064},{x:0.4574344437906494,y:0.33700027938992067},{x:0.45766955872204595,y:0.3402450648417768},{x:0.4580719785722712,y:0.34347337243611903},{x:0.45798772747397154,y:0.3446360634540339},{x:0.4580719752860241,y:0.3457987547100726},{x:0.45766954631126505,y:0.34902706116699656},{x:0.45743442220876074,y:0.3522718459543075},{x:0.44724742220876074,y:0.4114358459543075},{x:0.4465177421348676,y:0.414085920594514},{x:0.44598650715958776,y:0.4167827924880124},{x:0.42561250715958776,y:0.4843987924880123},{x:0.42448274729464536,y:0.48714066960378194},{x:0.42353212765555726,y:0.48994968540512485},{x:0.3929701276555573,y:0.5575686854051248},{x:0.39164568407140216,y:0.5598676242877579},{x:0.39050548955490016,y:0.5622632927243807},{x:0.3497544895549002,y:0.6298792927243808},{x:0.3489363257182038,y:0.6309768778726063},{x:0.34827409333092635,y:0.6321750153799588},{x:0.3075270933309263,y:0.6913400153799587},{x:0.3064542017711834,y:0.692610500189881},{x:0.30554468609075497,y:0.6940026241708062},{x:0.26479468609075496,y:0.7447166241708062},{x:0.26337089070969094,y:0.7461701617493295},{x:0.2621088975405431,y:0.7477661999757953},{x:0.2213588975405431,y:0.7900251999757952},{x:0.21464259678553657,y:0.7957445459642117},{x:0.20693955881566328,y:0.8000437110461325},{x:0.19854580706019195,y:0.8027574807184589},{x:0.1897839086918151,y:0.803781566334583},{x:0.1809905785511003,y:0.8030766128585909},{x:0.17250373938399882,y:0.8006697112572226},{x:0.16464953566022822,y:0.7966533574092127},{x:0.15772980002420467,y:0.791181897540543},{x:0.15201045403578817,y:0.7844655967855365},{x:0.14771128895386743,y:0.7767625588156633},{x:0.14499751928154103,y:0.7683688070601918},{x:0.14397343366541698,y:0.759606908691815},{x:0.14467838714140904,y:0.7508135785511002},{x:0.14708528874277732,y:0.7423267393839987},{x:0.1511016425907872,y:0.7344725356602282},{x:0.15657310245945688,y:0.7275528000242046},{x:0.19591129092993145,y:0.6867578918874246},{x:0.23434697314436972,y:0.6389240958672278},{x:0.27337685298529213,y:0.5822523693404118},{x:0.3120516621801016,y:0.518081284004684},{x:0.34029647741491703,y:0.4555890988936643},{x:0.35901954136421654,y:0.39345212569273014},{x:0.36742483055696995,y:0.344635935469891},{x:0.359019507292604,y:0.29581872226323463},{x:0.3402964755778617,y:0.23368093707349602},{x:0.3120517268674457,y:0.17118982332763816},{x:0.27337694476991303,y:0.10701878295300266},{x:0.23434708457036935,y:0.05034804280413771},{x:0.1959156338111051,y:0.0025195128948044543},{x:0.15658270979576625,y:-0.03824483998715393},{x:0.1511091222179878,y:-0.045162892704162266},{x:0.14709035322299047,y:-0.053015860941189874},{x:0.1446808418495003,y:-0.06150195953288312},{x:0.14397318426833106,y:-0.07029507246942218}]],"*":[[{x:0.03611444520266741,y:0.4654782574484574},{x:0.03652686631141767,y:0.45666636076295464},{x:0.038650478626155074,y:0.4481042415682919},{x:0.04240367291655979,y:0.4401209373034283},{x:0.04764221603086716,y:0.4330232418741738},{x:0.05416479369500318,y:0.42708391573544136},{x:0.06172074690723879,y:0.42253120385992987},{x:0.07001970462305517,y:0.4195400644118251},{x:0.0787427425515426,y:0.41822544520266736},{x:0.08755463923704532,y:0.41863786631141764},{x:0.09611675843170807,y:0.42076147862615504},{x:0.25602600000000003,y:0.47756000598755177},{x:0.25602600000000003,y:0.31805799999999995},{x:0.25689066238185465,y:0.30927893550927416},{x:0.2594514210369921,y:0.30083724554357094},{x:0.2636098674463855,y:0.29305733951411783},{x:0.26920619484660535,y:0.2862381948466053},{x:0.27602533951411795,y:0.2806418674463854},{x:0.283805245543571,y:0.276483421036992},{x:0.2922469355092743,y:0.2739226623818546},{x:0.301026,y:0.27305799999999997},{x:0.3098050644907258,y:0.2739226623818546},{x:0.3182467544564291,y:0.276483421036992},{x:0.32602666048588214,y:0.2806418674463854},{x:0.3328458051533947,y:0.2862381948466053},{x:0.33844213255361455,y:0.29305733951411783},{x:0.34260057896300794,y:0.30083724554357094},{x:0.3451613376181454,y:0.30927893550927416},{x:0.346026,y:0.31805799999999995},{x:0.346026,y:0.47756000598755177},{x:0.505935241568292,y:0.42076147862615504},{x:0.5144973607629547,y:0.41863786631141764},{x:0.5233092574484575,y:0.41822544520266736},{x:0.5320322953769449,y:0.4195400644118251},{x:0.5403312530927612,y:0.42253120385992987},{x:0.5478872063049969,y:0.42708391573544136},{x:0.5544097839691329,y:0.4330232418741738},{x:0.5596483270834403,y:0.4401209373034283},{x:0.5634015213738449,y:0.4481042415682919},{x:0.5655251336885824,y:0.45666636076295464},{x:0.5659375547973327,y:0.4654782574484574},{x:0.5646229355881749,y:0.4742012953769448},{x:0.5616317961400701,y:0.4825002530927612},{x:0.5570790842645587,y:0.4900562063049968},{x:0.5511397581258262,y:0.4965787839691328},{x:0.5440420626965717,y:0.5018173270834402},{x:0.5360587584317081,y:0.5055705213738448},{x:0.37146215609131306,y:0.5640339630732496},{x:0.47696549129035026,y:0.7165911114148321},{x:0.48124783600971727,y:0.7243035129909579},{x:0.48394328176908086,y:0.732703166943666},{x:0.4849482440995321,y:0.7414672792821342},{x:0.48422410286230105,y:0.7502590500841659},{x:0.48179868639903156,y:0.758740616528321},{x:0.47776520210421775,y:0.7665860367726678},{x:0.4722786545173053,y:0.7734938157169785},{x:0.4655498885851679,y:0.7791984912903502},{x:0.45783748700904214,y:0.7834808360097172},{x:0.449437833056334,y:0.7861762817690807},{x:0.4406737207178658,y:0.7871812440995319},{x:0.431881949915834,y:0.786457102862301},{x:0.4234003834716789,y:0.7840316863990314},{x:0.4155549632273321,y:0.7799982021042177},{x:0.40864718428302144,y:0.7745116545173052},{x:0.40294250870964976,y:0.7677828885851677},{x:0.301026,y:0.6204122684209616},{x:0.19910949129035027,y:0.7677828885851677},{x:0.19340481571697854,y:0.7745116545173052},{x:0.18649703677266788,y:0.7799982021042177},{x:0.17865161652832107,y:0.7840316863990314},{x:0.17017005008416597,y:0.786457102862301},{x:0.1613782792821342,y:0.7871812440995319},{x:0.15261416694366597,y:0.7861762817690807},{x:0.14421451299095783,y:0.7834808360097172},{x:0.13650211141483212,y:0.7791984912903502},{x:0.12977334548269473,y:0.7734938157169785},{x:0.12428679789578226,y:0.7665860367726678},{x:0.12025331360096844,y:0.758740616528321},{x:0.11782789713769894,y:0.7502590500841659},{x:0.11710375590046794,y:0.7414672792821342},{x:0.11810871823091917,y:0.732703166943666},{x:0.12080416399028275,y:0.7243035129909579},{x:0.1250865087096497,y:0.7165911114148321},{x:0.23058984390868703,y:0.5640339630732496},{x:0.06599324156829194,y:0.5055705213738448},{x:0.058009937303428294,y:0.5018173270834402},{x:0.05091224187417384,y:0.4965787839691328},{x:0.04497291573544139,y:0.4900562063049968},{x:0.04042020385992993,y:0.4825002530927612},{x:0.03742906441182516,y:0.4742012953769448},{x:0.03611444520266741,y:0.4654782574484574}]],"+":[[{x:-0.002030999999999998,y:0.33155},{x:-0.0011663376181453647,y:0.3227709355092742},{x:0.0013944210369920967,y:0.314329245543571},{x:0.005552867446385459,y:0.3065493395141179},{x:0.011149194846605363,y:0.29973019484660535},{x:0.017968339514117915,y:0.2941338674463855},{x:0.025748245543570962,y:0.2899754210369921},{x:0.03418993550927423,y:0.28741466238185465},{x:0.042969,y:0.28655},{x:0.256023,y:0.28655},{x:0.256023,y:0.09133899999999995},{x:0.2568876623818546,y:0.08255993550927418},{x:0.25944842103699206,y:0.07411824554357091},{x:0.26360686744638545,y:0.06633833951411786},{x:0.2692031948466054,y:0.05951919484660531},{x:0.2760223395141179,y:0.053922867446385414},{x:0.2838022455435709,y:0.049764421036992045},{x:0.2922439355092742,y:0.04720366238185458},{x:0.301023,y:0.04633899999999995},{x:0.3098020644907258,y:0.04720366238185458},{x:0.31824375445642905,y:0.049764421036992045},{x:0.3260236604858821,y:0.053922867446385414},{x:0.3328428051533946,y:0.05951919484660531},{x:0.3384391325536145,y:0.06633833951411786},{x:0.3425975789630079,y:0.07411824554357091},{x:0.34515833761814535,y:0.08255993550927418},{x:0.34602299999999997,y:0.09133899999999995},{x:0.34602299999999997,y:0.28655},{x:0.559083,y:0.28655},{x:0.5678620644907257,y:0.28741466238185465},{x:0.576303754456429,y:0.2899754210369921},{x:0.5840836604858821,y:0.2941338674463855},{x:0.5909028051533947,y:0.29973019484660535},{x:0.5964991325536145,y:0.3065493395141179},{x:0.6006575789630079,y:0.314329245543571},{x:0.6032183376181454,y:0.3227709355092742},{x:0.604083,y:0.33155},{x:0.6032183376181454,y:0.3403290644907258},{x:0.6006575789630079,y:0.348770754456429},{x:0.5964991325536145,y:0.35655066048588213},{x:0.5909028051533947,y:0.3633698051533947},{x:0.5840836604858821,y:0.36896613255361455},{x:0.576303754456429,y:0.37312457896300794},{x:0.5678620644907257,y:0.3756853376181454},{x:0.559083,y:0.37655},{x:0.34602299999999997,y:0.37655},{x:0.34602299999999997,y:0.571777},{x:0.34515833761814535,y:0.5805560644907257},{x:0.3425975789630079,y:0.588997754456429},{x:0.3384391325536145,y:0.5967776604858821},{x:0.3328428051533946,y:0.6035968051533946},{x:0.3260236604858821,y:0.6091931325536145},{x:0.31824375445642905,y:0.6133515789630078},{x:0.3098020644907258,y:0.6159123376181453},{x:0.301023,y:0.616777},{x:0.2922439355092742,y:0.6159123376181453},{x:0.2838022455435709,y:0.6133515789630078},{x:0.2760223395141179,y:0.6091931325536145},{x:0.2692031948466054,y:0.6035968051533946},{x:0.26360686744638545,y:0.5967776604858821},{x:0.25944842103699206,y:0.588997754456429},{x:0.2568876623818546,y:0.5805560644907257},{x:0.256023,y:0.571777},{x:0.256023,y:0.37655},{x:0.042969,y:0.37655},{x:0.03418993550927421,y:0.3756853376181454},{x:0.025748245543570934,y:0.37312457896300794},{x:0.017968339514117904,y:0.36896613255361455},{x:0.011149194846605356,y:0.3633698051533947},{x:0.005552867446385459,y:0.35655066048588213},{x:0.0013944210369920967,y:0.348770754456429},{x:-0.0011663376181453647,y:0.3403290644907258},{x:-0.002030999999999998,y:0.33155}]],",":[[{x:0.1703425796668749,y:-0.03158948169003215},{x:0.1707557440557006,y:-0.035050650253961146},{x:0.17102563140319493,y:-0.03852592771911176},{x:0.17127771326913271,y:-0.039423300660751795},{x:0.17138819577001116,y:-0.0403488367651378},{x:0.1724686618106471,y:-0.0436628955719719},{x:0.1734113563482083,y:-0.04701874414557815},{x:0.1738336633079298,y:-0.04784969558537063},{x:0.17412258605517572,y:-0.048735893706360625},{x:0.1758288320436127,y:-0.05177548533469908},{x:0.17740810654883146,y:-0.054882941638058576},{x:0.177984409582707,y:-0.05561553857817519},{x:0.17844066943717352,y:-0.05642834261896521},{x:0.18070712529694977,y:-0.05907665726715373},{x:0.18286228913625774,y:-0.06181630349720979},{x:0.26855428913625773,y:-0.1511263034972098},{x:0.27525630293239317,y:-0.15686238451505874},{x:0.2829485933055849,y:-0.16118075031492074},{x:0.2913355498506774,y:-0.16391544852087458},{x:0.3000948665311021,y:-0.16496138621450188},{x:0.3088899277191117,y:-0.1642783685968051},{x:0.3173827441455781,y:-0.16189264365179173},{x:0.3252469416380585,y:-0.15789589345116858},{x:0.33218030349720973,y:-0.1524417108637423},{x:0.3379163845150587,y:-0.14573969706760687},{x:0.3422347503149207,y:-0.13804740669441512},{x:0.3449694485208745,y:-0.12966045014932262},{x:0.3460153862145018,y:-0.12090113346889794},{x:0.34533236859680505,y:-0.11210607228088836},{x:0.34294664365179167,y:-0.10361325585442197},{x:0.33894989345116855,y:-0.09574905836194152},{x:0.33349571086374225,y:-0.08881569650279031},{x:0.277697993368333,y:-0.03066214483501502},{x:0.41918956700521515,y:0.11679250439324337},{x:0.42464400414059766,y:0.12372566600271688},{x:0.42864104306488354,y:0.1315897167531037},{x:0.43102707981377775,y:0.14008244558427704},{x:0.4317104203331251,y:0.14887748169003212},{x:0.4306648042299889,y:0.15763683676513773},{x:0.4279304139448243,y:0.1660238937063606},{x:0.4236123305628265,y:0.17371634261896518},{x:0.41787649560675666,y:0.1804185670052151},{x:0.41094333399728317,y:0.18587300414059763},{x:0.4030792832468963,y:0.18987004306488353},{x:0.39458655441572293,y:0.19225607981377774},{x:0.3857915183099679,y:0.19293942033312508},{x:0.37703216323486227,y:0.19189380422998883},{x:0.36864510629363945,y:0.18915941394482427},{x:0.3609526573810348,y:0.18484133056282648},{x:0.35425043299478487,y:0.17910549560675662},{x:0.18286343299478489,y:0.000495495606756581},{x:0.18070816857348473,y:-0.0022440714967103576},{x:0.1784416154849413,y:-0.004892302932393237},{x:0.17798532578947307,y:-0.005705090221499034},{x:0.17740899585940237,y:-0.006437666002716908},{x:0.1758296072680145,y:-0.009545064322455634},{x:0.1741232496850793,y:-0.012584593305585},{x:0.17383429440212667,y:-0.013470780818460306},{x:0.1734119569351165,y:-0.014301716753103766},{x:0.1724691391914766,y:-0.01765753071433596},{x:0.17138855147912546,y:-0.02097154985067746},{x:0.17127803499816427,y:-0.02189708189818214},{x:0.17102592018622226,y:-0.022794445584277102},{x:0.17075590524748027,y:-0.02626971313843455},{x:0.17034261378549817,y:-0.029730866531102167},{x:0.17041478319291342,y:-0.03066017543569507},{x:0.1703425796668749,y:-0.03158948169003215}]],"-":[[{x:0.12882900000000003,y:0.31396500000000005},{x:0.12969366238185465,y:0.30518593550927425},{x:0.13225442103699211,y:0.29674424554357104},{x:0.13641286744638548,y:0.28896433951411793},{x:0.14200919484660537,y:0.2821451948466054},{x:0.14882833951411792,y:0.2765488674463855},{x:0.15660824554357097,y:0.2723904210369921},{x:0.16504993550927424,y:0.2698296623818547},{x:0.173829,y:0.26896500000000007},{x:0.428224,y:0.26896500000000007},{x:0.4370030644907258,y:0.2698296623818547},{x:0.44544475445642906,y:0.2723904210369921},{x:0.4532246604858821,y:0.2765488674463855},{x:0.4600438051533946,y:0.2821451948466054},{x:0.4656401325536145,y:0.28896433951411793},{x:0.4697985789630079,y:0.29674424554357104},{x:0.47235933761814536,y:0.30518593550927425},{x:0.473224,y:0.31396500000000005},{x:0.47235933761814536,y:0.32274406449072585},{x:0.4697985789630079,y:0.33118575445642906},{x:0.4656401325536145,y:0.33896566048588217},{x:0.4600438051533946,y:0.3457848051533947},{x:0.4532246604858821,y:0.3513811325536146},{x:0.44544475445642906,y:0.355539578963008},{x:0.4370030644907258,y:0.3581003376181454},{x:0.428224,y:0.35896500000000003},{x:0.173829,y:0.35896500000000003},{x:0.16504993550927424,y:0.3581003376181454},{x:0.15660824554357097,y:0.355539578963008},{x:0.14882833951411792,y:0.3513811325536146},{x:0.14200919484660537,y:0.3457848051533947},{x:0.13641286744638548,y:0.33896566048588217},{x:0.13225442103699211,y:0.33118575445642906},{x:0.12969366238185465,y:0.32274406449072585},{x:0.12882900000000003,y:0.31396500000000005}]],".":[[{x:0.19450299999999998,y:0.148926},{x:0.19536766238185463,y:0.14014693550927423},{x:0.1979284210369921,y:0.13170524554357096},{x:0.20208686744638546,y:0.12392533951411791},{x:0.20768319484660536,y:0.11710619484660537},{x:0.2145023395141179,y:0.11150986744638547},{x:0.22228224554357093,y:0.1073514210369921},{x:0.2307239355092742,y:0.10479066238185464},{x:0.239503,y:0.103926},{x:0.362549,y:0.103926},{x:0.3713280644907258,y:0.10479066238185464},{x:0.3797697544564291,y:0.1073514210369921},{x:0.38754966048588213,y:0.11150986744638547},{x:0.3943688051533947,y:0.11710619484660537},{x:0.39996513255361454,y:0.12392533951411791},{x:0.40412357896300793,y:0.13170524554357096},{x:0.4066843376181454,y:0.14014693550927423},{x:0.407549,y:0.148926},{x:0.4066843376181454,y:0.1577050644907258},{x:0.40412357896300793,y:0.16614675445642904},{x:0.39996513255361454,y:0.1739266604858821},{x:0.3943688051533947,y:0.18074580515339464},{x:0.38754966048588213,y:0.18634213255361454},{x:0.3797697544564291,y:0.1905005789630079},{x:0.3713280644907258,y:0.19306133761814537},{x:0.362549,y:0.193926},{x:0.239503,y:0.193926},{x:0.2307239355092742,y:0.19306133761814537},{x:0.22228224554357093,y:0.1905005789630079},{x:0.2145023395141179,y:0.18634213255361454},{x:0.20768319484660536,y:0.18074580515339464},{x:0.20208686744638546,y:0.1739266604858821},{x:0.1979284210369921,y:0.16614675445642904},{x:0.19536766238185463,y:0.1577050644907258},{x:0.19450299999999998,y:0.148926}]],"/":[[{x:0.017522651058219416,y:-0.036644753012328966},{x:0.01865919532569161,y:-0.04539277458837648},{x:0.02148055556003016,y:-0.053750976595687026},{x:0.02587830846966649,y:-0.06139815801845333},{x:0.031683450876571484,y:-0.06804044196318723},{x:0.038672894413609195,y:-0.07342256918292836},{x:0.04657803868537635,y:-0.0773377075469538},{x:0.0550950934307649,y:-0.07963540048356893},{x:0.0638967530123289,y:-0.08022734894178067},{x:0.07264477458837641,y:-0.07909080467430848},{x:0.08100297659568695,y:-0.07626944443996993},{x:0.08865015801845323,y:-0.0718716915303336},{x:0.09529244196318715,y:-0.0660665491234286},{x:0.10067456918292828,y:-0.059077105586390885},{x:0.5777245691829282,y:0.7051758944136092},{x:0.5816397075469537,y:0.7130810386853763},{x:0.5839374004835688,y:0.7215980934307649},{x:0.5845293489417805,y:0.7303997530123288},{x:0.5833928046743084,y:0.7391477745883763},{x:0.5805714444399699,y:0.747505976595687},{x:0.5761736915303335,y:0.7551531580184532},{x:0.5703685491234285,y:0.7617954419631872},{x:0.5633791055863908,y:0.7671775691829282},{x:0.5554739613146237,y:0.7710927075469537},{x:0.5469569065692351,y:0.7733904004835688},{x:0.5381552469876711,y:0.7739823489417805},{x:0.5294072254116237,y:0.7728458046743084},{x:0.521049023404313,y:0.7700244444399699},{x:0.5134018419815468,y:0.7656266915303335},{x:0.5067595580368128,y:0.7598215491234285},{x:0.5013774308170718,y:0.7528321055863908},{x:0.024327430817071727,y:-0.011420894413609283},{x:0.020412292453046287,y:-0.019326038685376436},{x:0.018114599516431164,y:-0.027843093430764996},{x:0.017522651058219416,y:-0.036644753012328966}]],"<":[[{x:-0.002019645490236678,y:0.32959917016575135},{x:-0.0016099914284145765,y:0.3262199732716625},{x:-0.0013526191024594778,y:0.3228257800560043},{x:-0.001080072865731869,y:0.3218487260950263},{x:-0.0009579981642362373,y:0.3208417436418168},{x:0.00010303311987996846,y:0.3176073966113462},{x:0.0010176343561875828,y:0.3143286327165328},{x:0.0014755574652736251,y:0.31342352370653337},{x:0.001791739066671412,y:0.3124597057316259},{x:0.003463372735866293,y:0.309494502707312},{x:0.00500005526992945,y:0.3064571691910689},{x:0.005625757523098081,y:0.30565878796371126},{x:0.0061238953427729045,y:0.3047751734513664},{x:0.008341891452602095,y:0.3021930655225286},{x:0.010441601436418424,y:0.2995138854085287},{x:0.011211037446978121,y:0.298852913306643},{x:0.011871988327878901,y:0.29808345906703315},{x:0.014551110531708777,y:0.29598367519331337},{x:0.017133157288130564,y:0.2937656078708368},{x:0.01801675806170013,y:0.2932674456816211},{x:0.018815122032139454,y:0.29264172140965955},{x:0.021852413166145952,y:0.29110495510775264},{x:0.024817570086352318,y:0.28943323966009543},{x:0.5409315700863523,y:0.06192123966009548},{x:0.5493135321567164,y:0.059171271257023414},{x:0.5580709293975171,y:0.05810938240515066},{x:0.5668672199439956,y:0.058776380897540545},{x:0.5753643672834672,y:0.061146634356187606},{x:0.583235830808931,y:0.06512905526992949},{x:0.5901791145914712,y:0.07057060143641844},{x:0.5959273921291632,y:0.07726215728813057},{x:0.6002597603399046,y:0.08494657008635234},{x:0.6030097287429766,y:0.09332853215671641},{x:0.6040716175948494,y:0.10208592939751719},{x:0.6034046191024595,y:0.11088221994399564},{x:0.6010343656438124,y:0.11937936728346718},{x:0.5970519447300705,y:0.12725083080893104},{x:0.5916103985635816,y:0.13419411459147126},{x:0.5849188427118694,y:0.1399423921291632},{x:0.5772344299136477,y:0.14427476033990455},{x:0.15453394878652635,y:0.33060846154195217},{x:0.577233294268374,y:0.5169277390666714},{x:0.5849178265486336,y:0.521259895342773},{x:0.5916095409329668,y:0.527007988327879},{x:0.5970512785903404,y:0.5339511220321395},{x:0.6010339165943431,y:0.5418224757210541},{x:0.6034044043999703,y:0.5503195576866639},{x:0.6040716454902366,y:0.5591158298342486},{x:0.6030099981642363,y:0.5678732563581832},{x:0.6002602609333286,y:0.5762552942683741},{x:0.5959281046572271,y:0.5839398265486336},{x:0.5901800116721211,y:0.5906315409329669},{x:0.5832368779678606,y:0.5960732785903404},{x:0.5753655242789459,y:0.6000559165943432},{x:0.5668684423133362,y:0.6024264043999704},{x:0.5580721701657515,y:0.6030936454902367},{x:0.5493147436418169,y:0.6020319981642364},{x:0.540932705731626,y:0.5992822609333287},{x:0.024818705731625975,y:0.37178726093332853},{x:0.02185350270731245,y:0.3701156272641339},{x:0.018816169191068974,y:0.3685789447300705},{x:0.01801778796371134,y:0.36795324247690187},{x:0.01713417345136639,y:0.367455104657227},{x:0.01455206552252819,y:0.3652371085473975},{x:0.011872885408528756,y:0.3631373985635815},{x:0.011211913306643135,y:0.3623679625530219},{x:0.010442459067033207,y:0.36170701167212105},{x:0.008342675193313383,y:0.3590278894682912},{x:0.006124607870836803,y:0.3564458427118694},{x:0.005626445681621026,y:0.3555622419382997},{x:0.005000721409659611,y:0.3547638779678605},{x:0.0034639551077528313,y:0.3517265868338544},{x:0.0017922396600954515,y:0.3487614299136476},{x:0.0014760314771086122,y:0.3477976206592673},{x:0.0010180834056568513,y:0.3468925242789459},{x:0.00010339174271701993,y:0.34361378560971106},{x:-0.0009577287429766018,y:0.3403794678432836},{x:-0.0010798312165939596,y:0.33937248875722786},{x:-0.0013524043999703778,y:0.33839544231333624},{x:-0.001609870336301571,y:0.33500125619719334},{x:-0.0020196175948493655,y:0.3316220706024828},{x:-0.001942922029511974,y:0.3306106193263084},{x:-0.002019645490236678,y:0.32959917016575135}]],"=":[[{x:-0.002030999999999998,y:0.19162999999999997},{x:-0.0011663376181453647,y:0.1828509355092742},{x:0.0013944210369920967,y:0.17440924554357093},{x:0.005552867446385459,y:0.16662933951411787},{x:0.011149194846605363,y:0.15981019484660533},{x:0.017968339514117915,y:0.15421386744638543},{x:0.025748245543570962,y:0.15005542103699207},{x:0.03418993550927423,y:0.1474946623818546},{x:0.042969,y:0.14662999999999998},{x:0.559083,y:0.14662999999999998},{x:0.5678620644907257,y:0.1474946623818546},{x:0.576303754456429,y:0.15005542103699207},{x:0.5840836604858821,y:0.15421386744638543},{x:0.5909028051533947,y:0.15981019484660533},{x:0.5964991325536145,y:0.16662933951411787},{x:0.6006575789630079,y:0.17440924554357093},{x:0.6032183376181454,y:0.1828509355092742},{x:0.604083,y:0.19162999999999997},{x:0.6032183376181454,y:0.20040906449072574},{x:0.6006575789630079,y:0.208850754456429},{x:0.5964991325536145,y:0.21663066048588206},{x:0.5909028051533947,y:0.2234498051533946},{x:0.5840836604858821,y:0.2290461325536145},{x:0.576303754456429,y:0.23320457896300786},{x:0.5678620644907257,y:0.23576533761814533},{x:0.559083,y:0.23662999999999995},{x:0.042969,y:0.23662999999999995},{x:0.03418993550927421,y:0.23576533761814533},{x:0.025748245543570934,y:0.23320457896300786},{x:0.017968339514117904,y:0.2290461325536145},{x:0.011149194846605356,y:0.2234498051533946},{x:0.005552867446385459,y:0.21663066048588206},{x:0.0013944210369920967,y:0.208850754456429},{x:-0.0011663376181453647,y:0.20040906449072574},{x:-0.002030999999999998,y:0.19162999999999997}],[{x:-0.002030999999999998,y:0.454102},{x:-0.0011663376181453647,y:0.4453229355092742},{x:0.0013944210369920967,y:0.436881245543571},{x:0.005552867446385459,y:0.4291013395141179},{x:0.011149194846605363,y:0.42228219484660534},{x:0.017968339514117915,y:0.41668586744638547},{x:0.025748245543570962,y:0.4125274210369921},{x:0.03418993550927423,y:0.40996666238185464},{x:0.042969,y:0.409102},{x:0.559083,y:0.409102},{x:0.5678620644907257,y:0.40996666238185464},{x:0.576303754456429,y:0.4125274210369921},{x:0.5840836604858821,y:0.41668586744638547},{x:0.5909028051533947,y:0.42228219484660534},{x:0.5964991325536145,y:0.4291013395141179},{x:0.6006575789630079,y:0.436881245543571},{x:0.6032183376181454,y:0.4453229355092742},{x:0.604083,y:0.454102},{x:0.6032183376181454,y:0.4628810644907258},{x:0.6006575789630079,y:0.471322754456429},{x:0.5964991325536145,y:0.4791026604858821},{x:0.5909028051533947,y:0.48592180515339467},{x:0.5840836604858821,y:0.49151813255361454},{x:0.576303754456429,y:0.49567657896300793},{x:0.5678620644907257,y:0.49823733761814537},{x:0.559083,y:0.499102},{x:0.042969,y:0.499102},{x:0.03418993550927421,y:0.49823733761814537},{x:0.025748245543570934,y:0.49567657896300793},{x:0.017968339514117904,y:0.49151813255361454},{x:0.011149194846605356,y:0.48592180515339467},{x:0.005552867446385459,y:0.4791026604858821},{x:0.0013944210369920967,y:0.471322754456429},{x:-0.0011663376181453647,y:0.4628810644907258},{x:-0.002030999999999998,y:0.454102}]],">":[[{x:-0.002019645490236678,y:0.5591158298342487},{x:-0.0013524043999703708,y:0.5503195576866637},{x:0.0010180834056568513,y:0.5418224757210541},{x:0.005000721409659611,y:0.5339511220321396},{x:0.01044245906703322,y:0.527007988327879},{x:0.01713417345136643,y:0.521259895342773},{x:0.024818705731625975,y:0.5169277390666714},{x:0.44751805121347366,y:0.33060846154195217},{x:0.024817570086352318,y:0.14427476033990455},{x:0.017133157288130554,y:0.1399423921291632},{x:0.01044160143641841,y:0.13419411459147126},{x:0.00500005526992945,y:0.12725083080893107},{x:0.0010176343561875828,y:0.11937936728346718},{x:-0.0013526191024594778,y:0.11088221994399562},{x:-0.0020196175948493655,y:0.10208592939751718},{x:-0.0009577287429766018,y:0.0933285321567164},{x:0.0017922396600954585,y:0.08494657008635234},{x:0.00612460787083681,y:0.07726215728813059},{x:0.011872885408528759,y:0.07057060143641844},{x:0.018816169191068984,y:0.06512905526992947},{x:0.02668763271653284,y:0.061146634356187606},{x:0.03518478005600438,y:0.058776380897540545},{x:0.04398107060248284,y:0.05810938240515066},{x:0.052738467843283614,y:0.05917127125702342},{x:0.06112042991364768,y:0.06192123966009548},{x:0.5772344299136477,y:0.28943323966009543},{x:0.5801995868338548,y:0.29110495510775297},{x:0.5832368779678606,y:0.2926417214096596},{x:0.5840352419382998,y:0.29326744568162105},{x:0.5849188427118694,y:0.2937656078708368},{x:0.5875008894682915,y:0.29598367519331353},{x:0.5901800116721211,y:0.29808345906703315},{x:0.5908409625530218,y:0.2988529133066429},{x:0.5916103985635817,y:0.29951388540852875},{x:0.5937101085473976,y:0.3021930655225282},{x:0.5959281046572271,y:0.3047751734513664},{x:0.5964262424769022,y:0.30565878796371176},{x:0.5970519447300705,y:0.30645716919106897},{x:0.5985886272641329,y:0.3094945027073105},{x:0.6002602609333286,y:0.31245970573162596},{x:0.6005764425347265,y:0.31342352370653376},{x:0.6010343656438124,y:0.31432863271653283},{x:0.6019489668801197,y:0.31760739661134507},{x:0.6030099981642363,y:0.32084174364181683},{x:0.6031320728657319,y:0.3218487260950267},{x:0.6034046191024595,y:0.3228257800560044},{x:0.6036619914284146,y:0.3262199732716634},{x:0.6040716454902366,y:0.32959917016575135},{x:0.603994922029512,y:0.330610619326308},{x:0.6040716175948494,y:0.33162207060248283},{x:0.6036618703363014,y:0.3350012561971954},{x:0.6034044043999703,y:0.33839544231333624},{x:0.6031318312165941,y:0.33937248875722736},{x:0.6030097287429766,y:0.3403794678432836},{x:0.6019486082572825,y:0.3436137856097129},{x:0.6010339165943431,y:0.3468925242789459},{x:0.6005759685228916,y:0.3477976206592668},{x:0.6002597603399046,y:0.34876142991364767},{x:0.5985880448922466,y:0.3517265868338553},{x:0.5970512785903404,y:0.3547638779678605},{x:0.596425554318379,y:0.35556224193829966},{x:0.5959273921291631,y:0.35644584271186947},{x:0.5937093248066866,y:0.3590278894682911},{x:0.5916095409329668,y:0.36170701167212105},{x:0.5908400866933569,y:0.3623679625530219},{x:0.5901791145914712,y:0.36313739856358157},{x:0.5874999344774714,y:0.3652371085473978},{x:0.5849178265486336,y:0.367455104657227},{x:0.5840342120362888,y:0.36795324247690175},{x:0.583235830808931,y:0.3685789447300705},{x:0.5801984972926872,y:0.37011562726413405},{x:0.577233294268374,y:0.37178726093332853},{x:0.06111929426837402,y:0.5992822609333287},{x:0.05273725635818315,y:0.6020319981642364},{x:0.04397982983424857,y:0.6030936454902367},{x:0.035183557686663716,y:0.6024264043999704},{x:0.02668647572105406,y:0.6000559165943432},{x:0.018815122032139416,y:0.5960732785903404},{x:0.011871988327878898,y:0.5906315409329669},{x:0.006123895342772898,y:0.5839398265486336},{x:0.001791739066671405,y:0.5762552942683741},{x:-0.0009579981642362442,y:0.5678732563581832},{x:-0.002019645490236678,y:0.5591158298342487}]],A:[[{x:-0.026930267425517032,y:0.05053409251215203},{x:-0.025968910797820398,y:0.041765089843587025},{x:-0.02331527881378681,y:0.03335213247651147},{x:-0.019071349062388714,y:0.025618525644501258},{x:-0.013400213383949137,y:0.018861467521053887},{x:-0.006519810342180955,y:0.013340628060451547},{x:0.0013054500325951415,y:0.009268170027042777},{x:0.009774847372633092,y:0.006800595699190677},{x:0.018562907487847988,y:0.006032732574482988},{x:0.02733191015641301,y:0.006994089202179622},{x:0.035744867523488544,y:0.00964772118621321},{x:0.043478474355498745,y:0.013891650937611293},{x:0.05023553247894613,y:0.019562786616050876},{x:0.055756371939548466,y:0.02644318965781906},{x:0.05982882997295724,y:0.03426845003259516},{x:0.15465984441872488,y:0.2705423452957767},{x:0.155303,y:0.27047899999999997},{x:0.433548,y:0.27047899999999997},{x:0.439584057854266,y:0.2710734998088117},{x:0.5426964027293978,y:0.03313672871631684},{x:0.5469805748198717,y:0.025425342079263714},{x:0.5526868446471364,y:0.018697928086846893},{x:0.559595923461843,y:0.013213017486017727},{x:0.5674422992397985,y:0.009181392315192764},{x:0.5759244401601543,y:0.006757985668725375},{x:0.5847163823041805,y:0.006035927704977205},{x:0.5934802562658602,y:0.007042966706560308},{x:0.6018792712836831,y:0.009740402729397836},{x:0.6095906579207363,y:0.01402457481987169},{x:0.6163180719131531,y:0.019730844647136342},{x:0.6218029825139822,y:0.026639923461843008},{x:0.6258346076848073,y:0.03448629923979854},{x:0.6282580143312746,y:0.042968440160154345},{x:0.6289800722950228,y:0.05176038230418057},{x:0.6279730332934397,y:0.060524256265860256},{x:0.6252755972706022,y:0.0689232712836832},{x:0.3314685972706022,y:0.7468972712836831},{x:0.3293831787279993,y:0.7506509647260751},{x:0.32731734906238874,y:0.7544154743554987},{x:0.32724162770964893,y:0.7545056950115825},{x:0.32718442518012836,y:0.7546086579207363},{x:0.324406768107635,y:0.7578833802211685},{x:0.32164621338394916,y:0.7611725324789461},{x:0.3215543458189217,y:0.761246247067332},{x:0.32147815535286367,y:0.7613360719131531},{x:0.3181150035540548,y:0.764005977330098},{x:0.314765810342181,y:0.7666933719395485},{x:0.31466132698386995,y:0.7667477476499444},{x:0.314569076538157,y:0.7668209825139822},{x:0.31074967405057474,y:0.7687834680795742},{x:0.3069405499674049,y:0.7707658299729572},{x:0.30682746605267575,y:0.7707987771773066},{x:0.30672270076020147,y:0.7708526076848072},{x:0.3025938250794972,y:0.7720322561793334},{x:0.29847115262736695,y:0.7732334043008093},{x:0.2983538139076442,y:0.7732436568565263},{x:0.29824055983984565,y:0.7732760143312747},{x:0.29396088134293,y:0.7736274925246428},{x:0.289683092512152,y:0.774001267425517},{x:0.28956600824863027,y:0.7739884313326351},{x:0.2894486176958195,y:0.7739980722950228},{x:0.2851826020272766,y:0.773507873077374},{x:0.280914089843587,y:0.7730399107978204},{x:0.2808017595188513,y:0.7730044793401902},{x:0.28068474373413976,y:0.7729910332934397},{x:0.2765963314836881,y:0.7716779947458032},{x:0.2725011324765115,y:0.7703862788137869},{x:0.27239787288194656,y:0.7703296136024552},{x:0.27228572871631684,y:0.7702935972706022},{x:0.26853203527393116,y:0.7682081787280027},{x:0.2647675256445013,y:0.7661423490623888},{x:0.26467730498841713,y:0.7660666277096486},{x:0.2645743420792637,y:0.7660094251801283},{x:0.2612996197788366,y:0.7632317681076393},{x:0.2580104675210539,y:0.7604712133839491},{x:0.2579367529326681,y:0.7603793458189217},{x:0.2578469280868469,y:0.7603031553528636},{x:0.25517702266989234,y:0.7569400035540427},{x:0.25248962806045155,y:0.7535908103421809},{x:0.2524352523500559,y:0.7534863269838704},{x:0.2523620174860177,y:0.753394076538157},{x:0.2503995319204231,y:0.7495746740505695},{x:0.24841717002704278,y:0.7457655499674049},{x:-0.023694829972957243,y:0.06779154996740488},{x:-0.026162404300809343,y:0.05932215262736691},{x:-0.026930267425517032,y:0.05053409251215203}],[{x:0.19075686729109992,y:0.36047899999999994},{x:0.2917712201653896,y:0.6121588409316518},{x:0.4008392655839541,y:0.36047899999999994},{x:0.19075686729109992,y:0.36047899999999994}]],B:[[{x:0.018964999999999996,y:0.05103000000000002},{x:0.018993157630992935,y:0.05074411077481729},{x:0.01896863696544404,y:0.050457886669927884},{x:0.019425235762019696,y:0.046357147889743},{x:0.01982966238185463,y:0.04225093550927423},{x:0.019913053192865363,y:0.04197603284668677},{x:0.019944843237820968,y:0.04169052471317667},{x:0.02119268306568244,y:0.037757658485048945},{x:0.02239042103699209,y:0.03380924554357098},{x:0.0225258403659196,y:0.03355589379873479},{x:0.022612719447780122,y:0.03328207355405998},{x:0.02460384652213923,y:0.029668217721559587},{x:0.026548867446385453,y:0.026029339514117924},{x:0.02673111120436309,y:0.02580727485250577},{x:0.026869740608734982,y:0.025555665255108946},{x:0.029527637032761178,y:0.022399698271204867},{x:0.03214519484660536,y:0.019210194846605383},{x:0.03236725950821749,y:0.019027951088627763},{x:0.03255231178483501,y:0.01880822135423258},{x:0.03577483608951879,y:0.016231425260229353},{x:0.03896433951411791,y:0.013613867446385479},{x:0.03921769125895406,y:0.013478448117457993},{x:0.03944205495260531,y:0.013299042336531411},{x:0.04310536733612953,y:0.011400441961238211},{x:0.046744245543570956,y:0.009455421036992116},{x:0.04701914820615845,y:0.009372030225981372},{x:0.047274201145921,y:0.009239842862072495},{x:0.051237522567796415,y:0.008092400353164256},{x:0.055185935509274225,y:0.006894662381854655},{x:0.05547182473445692,y:0.006866504750861718},{x:0.05574776537889109,y:0.006786615690234012},{x:0.05985878761953148,y:0.006434426619834929},{x:0.063965,y:0.0060300000000000215},{x:0.06425088922518268,y:0.006058157630992957},{x:0.06453711333007213,y:0.00603363696544406},{x:0.4241221133300721,y:0.01060563696544408},{x:0.4260098351414485,y:0.010815826288282449},{x:0.4279092214657345,y:0.010813640036582327},{x:0.43038314701987823,y:0.011302774871886453},{x:0.43288947528682337,y:0.011581843237821021},{x:0.43469991915024053,y:0.012156270087817089},{x:0.43656323581544765,y:0.012524677733968342},{x:0.4388942001112364,y:0.013487052913568918},{x:0.44129792644594007,y:0.014249719447780182},{x:0.4429615180190356,y:0.01516630892323094},{x:0.4447171588106798,y:0.015891152767997317},{x:0.5224141588106799,y:0.0573061527679973},{x:0.525028554951968,y:0.05904868699814221},{x:0.5277374225537912,y:0.06064039332865708},{x:0.5286915199232336,y:0.06149010807639827},{x:0.529754639763497,y:0.06219869339105244},{x:0.5319788494519322,y:0.06441778869965879},{x:0.5343251404217865,y:0.06650738469209135},{x:0.5350951339540482,y:0.06752690757225652},{x:0.5359995881074716,y:0.06842928201075814},{x:0.5377481362120787,y:0.07103965980959966},{x:0.5396416839038074,y:0.07354684346181917},{x:0.5707946839038074,y:0.12450984346181915},{x:0.5718407730360667,y:0.12667263757185424},{x:0.573076251912317,y:0.12873311634664666},{x:0.5737567016649755,y:0.13063382885667474},{x:0.5746357412153917,y:0.13245124718509382},{x:0.57523978983892,y:0.1347765656784282},{x:0.576049549867314,y:0.13703848290314058},{x:0.576346114353134,y:0.13903542291661675},{x:0.5768537026781452,y:0.1409894121704204},{x:0.5769924975430949,y:0.14338789436140983},{x:0.5773454200998597,y:0.14576432582559334},{x:0.5830324200998597,y:0.2611263258255933},{x:0.5829003037879823,y:0.26382496142481277},{x:0.5829742287592172,y:0.2665258175697889},{x:0.5826851199428378,y:0.2682203519457296},{x:0.5826010630436497,y:0.26993731586400416},{x:0.5819450076216034,y:0.2725583233230625},{x:0.5814906012502021,y:0.27522170532098544},{x:0.5808764603215925,y:0.2768272773619606},{x:0.5804590555084463,y:0.278494851612457},{x:0.5793042728181804,y:0.28093750708458076},{x:0.5783389976861617,y:0.283461062658912},{x:0.5774234257367941,y:0.284915971131802},{x:0.5766887136425759,y:0.2864700717712602},{x:0.575079581335268,y:0.2886405053765124},{x:0.5736405324246225,y:0.2909272557017569},{x:0.5044305324246225,y:0.38012925570175693},{x:0.5017223718437749,y:0.38298983800955333},{x:0.499075053174031,y:0.3859068173944946},{x:0.49869279401231464,y:0.38618992769627897},{x:0.4983657648506557,y:0.38653536283797296},{x:0.49515156889241035,y:0.38881264393905274},{x:0.49198604326106643,y:0.39115710813128307},{x:0.4915558970220145,y:0.39136020348505085},{x:0.4911677605809681,y:0.39163520096290155},{x:0.48757104899345777,y:0.3932416662216644},{x:0.4840089657752798,y:0.3949235187770668},{x:0.3737297002329455,y:0.43429966367120415},{x:0.4408630401939032,y:0.4733794631163462},{x:0.44336631106573315,y:0.475186847643908},{x:0.4459719275146733,y:0.476843279595192},{x:0.4469351296354233,y:0.4777635673817196},{x:0.4480152047486495,y:0.4785433915190981},{x:0.45011777274311354,y:0.48080441158023823},{x:0.45235016915983667,y:0.4829373462081214},{x:0.4531153243813002,y:0.4840278623347861},{x:0.4540225100120052,y:0.48500341457167107},{x:0.4556435746202097,y:0.4876311804334344},{x:0.4574169612623637,y:0.4901586502563309},{x:0.45795466509848404,y:0.4913774867999537},{x:0.45865409861163536,y:0.4925112772109775},{x:0.4597313632297904,y:0.4954048053049642},{x:0.460977589843244,y:0.49822968107500176},{x:0.46126717863714684,y:0.4995299988307428},{x:0.46173198119508085,y:0.5007784564862466},{x:0.46222404714804793,y:0.5038265501505143},{x:0.4628952219429378,y:0.5068402734760588},{x:0.4768502219429378,y:0.6216502734760588},{x:0.47694604753136066,y:0.6258560133977795},{x:0.4770801736029929,y:0.6300607061367898},{x:0.47704647561686464,y:0.6302637547476413},{x:0.47705116403527437,y:0.6304695272224051},{x:0.47632464920624185,y:0.6346131496757303},{x:0.47563590322258376,y:0.6387632171212809},{x:0.475563239914934,y:0.6389557900590453},{x:0.4755276940283349,y:0.6391585233384632},{x:0.47400675833929046,y:0.6430807912362932},{x:0.4725216084222428,y:0.647016748623825},{x:0.4724127722032346,y:0.6471914454185},{x:0.4723383580201142,y:0.6473833485763381},{x:0.4700814501766401,y:0.6509335313629835},{x:0.46785696980463054,y:0.6545041220574128},{x:0.46771614318912413,y:0.6546542292091504},{x:0.46760572040480797,y:0.6548279275146733},{x:0.4646995721096373,y:0.6578695936566139},{x:0.4618212468158623,y:0.6609376018599591},{x:0.3721282468158623,y:0.739463601859959},{x:0.3693406873548985,y:0.7414576112446344},{x:0.36664335021940475,y:0.7435720694617842},{x:0.36575927454484214,y:0.7440194833243711},{x:0.36495338890552403,y:0.7445959530105889},{x:0.3618303796850022,y:0.746007822191186},{x:0.35877236079175173,y:0.7475554273162446},{x:0.35781798626885214,y:0.7478217696388809},{x:0.3569151218394033,y:0.7482299421328396},{x:0.35357667835226414,y:0.7490054137685334},{x:0.3502754956523681,y:0.7499266922044516},{x:0.21714549565236804,y:0.7733246922044517},{x:0.2164184100494338,y:0.7733799121498203},{x:0.21571010443589486,y:0.773553134187072},{x:0.21202614434596675,y:0.7737134914026773},{x:0.20834928456346336,y:0.7739927377465721},{x:0.20762539682958886,y:0.7739050492917646},{x:0.20689690716677497,y:0.7739367593459113},{x:0.061505907166774995,y:0.7659797593459113},{x:0.05835682356136361,y:0.7654946428322841},{x:0.055185935509274225,y:0.7651823376181454},{x:0.05400593378019863,y:0.7648243880069794},{x:0.05278721145616079,y:0.7646366437616691},{x:0.0497932781460736,y:0.7635464928911877},{x:0.046744245543570956,y:0.7626215789630079},{x:0.045656749721751114,y:0.7620403003359452},{x:0.0444980718907103,y:0.7616184026130197},{x:0.04177434405403643,y:0.7599651112722733},{x:0.03896433951411791,y:0.7584631325536145},{x:0.03801114145411163,y:0.7576808631223083},{x:0.03695703545532078,y:0.7570410252146568},{x:0.03460818442533898,y:0.7548881284626934},{x:0.03214519484660536,y:0.7528668051533947},{x:0.03136292541529926,y:0.7519136070933885},{x:0.03045389995114224,y:0.7510804176129765},{x:0.02857019075568381,y:0.7485106500646154},{x:0.026548867446385453,y:0.7460476604858821},{x:0.025967588819322866,y:0.7449601646640625},{x:0.025238577228599887,y:0.7439656426153641},{x:0.023892399755650346,y:0.7410777589963466},{x:0.02239042103699209,y:0.738267754456429},{x:0.022032471425826126,y:0.7370877527273536},{x:0.021511489215134356,y:0.7359701170349662},{x:0.02075457631003429,y:0.7328750970932278},{x:0.01982966238185463,y:0.7298260644907257},{x:0.019708797589401895,y:0.7285989036590902},{x:0.01941586581292807,y:0.7274011044358949},{x:0.019277305214138767,y:0.7242178880520896},{x:0.018964999999999996,y:0.721047},{x:0.018964999999999996,y:0.05103000000000002}],[{x:0.10896499999999999,y:0.09660579683225357},{x:0.10896499999999999,y:0.37786028838708235},{x:0.29722384626437015,y:0.36605169579422814},{x:0.44137514989764515,y:0.3145812530901673},{x:0.49232133133007555,y:0.24891875813083103},{x:0.48801965008125897,y:0.1616582425292873},{x:0.46925190911582665,y:0.130956211173677},{x:0.41203782454012283,y:0.1004592638951106},{x:0.10896499999999999,y:0.09660579683225357}],[{x:0.10896499999999999,y:0.47257215902605326},{x:0.10896499999999999,y:0.6784424315209651},{x:0.20665565807681563,y:0.6837888736412973},{x:0.32230778354311135,y:0.6634626629325134},{x:0.3846372425734713,y:0.608893375476212},{x:0.3762519660226853,y:0.5399063743443061},{x:0.2981741908903496,y:0.4944555775409729},{x:0.10896499999999999,y:0.47257215902605326}]],C:[[{x:0.028007484408327545,y:0.4010798543150725},{x:0.028340096336253087,y:0.39680461654123217},{x:0.028649292669517497,y:0.39252762152779447},{x:0.06572429266951751,y:0.1769866215277945},{x:0.0657499934516808,y:0.17689321918606288},{x:0.06575739253020782,y:0.1767966283931179},{x:0.06691993730130205,y:0.17264138379230456},{x:0.0680646634579554,y:0.1684811950870131},{x:0.0681080922997215,y:0.16839460141895576},{x:0.06813419313592875,y:0.16830131007962543},{x:0.07008504794245551,y:0.16445270857242494},{x:0.07201939106115751,y:0.16059578172109576},{x:0.07207887901649253,y:0.16051932447281397},{x:0.0721226785698821,y:0.1604329177209502},{x:0.1274306785698821,y:0.07363491772095027},{x:0.13009575906138268,y:0.07023973030268985},{x:0.13274648275581225,y:0.06683332229320074},{x:0.13281865262016482,y:0.06677089175108791},{x:0.13287757357360944,y:0.06669582922279092},{x:0.1361538134974972,y:0.06388581079003605},{x:0.13941816151489866,y:0.0610619864944041},{x:0.19692016151489866,y:0.020443986494404057},{x:0.19808425112310213,y:0.019782383965415776},{x:0.19914710087537263,y:0.01896802966513257},{x:0.20191114759162085,y:0.01760739299916557},{x:0.20458957759683996,y:0.01608512525217841},{x:0.2058603718000633,y:0.015663337846789194},{x:0.20706167183504787,y:0.015071982836463577},{x:0.21003805521400143,y:0.014276729186446702},{x:0.2129619996426652,y:0.013306247159584957},{x:0.21429066253234816,y:0.013140483931242813},{x:0.21558424756339917,y:0.01279485365228588},{x:0.32760524756339915,y:-0.005618146347714133},{x:0.32775803960473765,y:-0.005628051859015257},{x:0.32790622767465843,y:-0.005666572281957827},{x:0.3321581535063009,y:-0.005913311337168391},{x:0.3364083102547015,y:-0.006188849089881349},{x:0.3365600989091985,y:-0.006168756021014132},{x:0.33671295454862427,y:-0.006177626226551311},{x:0.34093131721939995,y:-0.005590114680318674},{x:0.3451535631465426,y:-0.005031193603710363},{x:0.34529851526132993,y:-0.004981874120043047},{x:0.3454501643137599,y:-0.004960753231150514},{x:0.44307616431375996,y:0.01857424676884946},{x:0.4458503498549469,y:0.019539172468847843},{x:0.4486819664572553,y:0.020319643122350156},{x:0.45000735163266253,y:0.02098507354168687},{x:0.45140809089867484,y:0.021472282957461515},{x:0.45394072357704407,y:0.022959884631265325},{x:0.4565656691892177,y:0.024277779754777677},{x:0.4577357684253341,y:0.0251889939358613},{x:0.459014543037309,y:0.025940112433793877},{x:0.4612082951993476,y:0.027893222383335445},{x:0.4635256946335971,y:0.029697896006345384},{x:0.5358116946335971,y:0.09837789600634546},{x:0.5383578959705028,y:0.10132350300922108},{x:0.5409714489909738,y:0.10420951799057969},{x:0.5412394420583803,y:0.10465705806338507},{x:0.5415805729157932,y:0.10505169984914184},{x:0.5435031902892489,y:0.10843744707814906},{x:0.545503491029224,y:0.11177788699125937},{x:0.5456790239480676,y:0.11226911056087577},{x:0.5459366092786453,y:0.11272272074420048},{x:0.5471617575812067,y:0.11641849583208026},{x:0.548471935605029,y:0.12008498944441898},{x:0.572709935605029,y:0.21701898944441894},{x:0.5740007070580636,y:0.2257455880614603},{x:0.5735642017652605,y:0.23455632455146336},{x:0.571417194380227,y:0.24311260725223527},{x:0.5676421931927146,y:0.25108562301800397},{x:0.5623842693813143,y:0.2581689733242098},{x:0.5558454820094204,y:0.2640904489909738},{x:0.5482771130087407,y:0.26862249102922403},{x:0.539970010555581,y:0.27159093560502906},{x:0.5312434119385397,y:0.2728817070580635},{x:0.5224326754485367,y:0.2724452017652604},{x:0.5138763927477648,y:0.270298194380227},{x:0.5059033769819961,y:0.26652319319271456},{x:0.49882002667579023,y:0.2612652693813142},{x:0.49289855100902624,y:0.25472648200942033},{x:0.488366508970776,y:0.24715811300874066},{x:0.48539806439497096,y:0.23885101055558106},{x:0.46433420621000654,y:0.15461122058523102},{x:0.4102697826671089,y:0.10324381045150927},{x:0.3332137540403124,y:0.08466767669890593},{x:0.24039332695070226,y:0.09992465997883551},{x:0.1985742470214596,y:0.12946463056361485},{x:0.15288732813236672,y:0.2011637190451272},{x:0.11884238546013813,y:0.39908903228895243},{x:0.16184523767713488,y:0.5942488915238071},{x:0.2166399992296726,y:0.6603981208316636},{x:0.2708106585112101,y:0.6880654725502051},{x:0.33167151101531583,y:0.6962265900331734},{x:0.41875307675349,y:0.6679697644015699},{x:0.4604926982936834,y:0.628705384802963},{x:0.487421989657252,y:0.5630715564186946},{x:0.49155436139101494,y:0.5552777692634718},{x:0.49712782320648147,y:0.5484399232752638},{x:0.5039281900917167,y:0.5428207930406891},{x:0.5116941277610109,y:0.5386363185834178},{x:0.5201271955849208,y:0.5360473069101626},{x:0.5289033154962927,y:0.5351532522875923},{x:0.5376852261286371,y:0.5359885127334604},{x:0.5461354435813054,y:0.5385209896572519},{x:0.5539292307365281,y:0.5426533613910148},{x:0.5607670767247361,y:0.5482268232064814},{x:0.5663862069593109,y:0.5550271900917166},{x:0.5705706814165822,y:0.5627931277610108},{x:0.5731596930898373,y:0.5712261955849207},{x:0.5740537477124077,y:0.5800023154962926},{x:0.5732184872665396,y:0.588784226128637},{x:0.570686010342748,y:0.5972344435813053},{x:0.540057010342748,y:0.6718854435813053},{x:0.5396985836895672,y:0.6725614478775368},{x:0.539454213118803,y:0.6732865233897278},{x:0.5376352487491008,y:0.6764529645154376},{x:0.5359246386089851,y:0.679679230736528},{x:0.5354412171276051,y:0.6802723202285732},{x:0.5350600868536766,y:0.680935789284769},{x:0.5326583313554347,y:0.6836865257875079},{x:0.5303511767935185,y:0.686517076724736},{x:0.5297613381003629,y:0.6870044593160238},{x:0.5292580947459566,y:0.687580825172473},{x:0.47307109474595666,y:0.7404358251724731},{x:0.4722065860115991,y:0.7411021817697292},{x:0.4714497622811152,y:0.7418887085063782},{x:0.4687194058651613,y:0.7437900730587934},{x:0.46608420409854834,y:0.7458212660502541},{x:0.46510630693397415,y:0.746306161504971},{x:0.46421058160492856,y:0.7469299263656303},{x:0.4611617503991064,y:0.748262090618912},{x:0.45818091720073817,y:0.7497401524453693},{x:0.45712721164557074,y:0.7500249524971546},{x:0.4561270069400303,y:0.7504619845480405},{x:0.3497190069400303,y:0.7849899845480404},{x:0.34852117258500637,y:0.7852523061157466},{x:0.34737251112679673,y:0.7856814874310271},{x:0.34422084285321763,y:0.7861940634064482},{x:0.3411016855274714,y:0.7868771480384597},{x:0.33987569082458696,y:0.7869007432807547},{x:0.3386653714532072,y:0.7870975852636362},{x:0.3354742629896646,y:0.786985452257037},{x:0.33228177619648713,y:0.7870468942022847},{x:0.3310747354346284,y:0.7868308563672394},{x:0.32984927004476555,y:0.7867877944907101},{x:0.25121827004476555,y:0.7762437944907102},{x:0.24809780050166644,y:0.7755083028870222},{x:0.24494229970605153,y:0.7749416523797719},{x:0.24381291428322105,y:0.7744983594176508},{x:0.24263200473447152,y:0.7742200201979198},{x:0.2397149814324578,y:0.772889887451158},{x:0.2367306607297473,y:0.771718517308175},{x:0.16743766072974728,y:0.7363275173081749},{x:0.16716950847174827,y:0.7361554960544541},{x:0.16687461978467572,y:0.7360349240533984},{x:0.16345937419922074,y:0.733775423054901},{x:0.16001260855282193,y:0.7315643025810339},{x:0.15978316844705134,y:0.7313432727571054},{x:0.15951746839392553,y:0.7311674875843215},{x:0.15660865257214304,y:0.7282851209029094},{x:0.15365948376641753,y:0.7254440558690711},{x:0.15347757306746915,y:0.725182511527114},{x:0.15325127235232486,y:0.7249582685082102},{x:0.08558827235232488,y:0.6432742685082102},{x:0.0845522070982367,y:0.6417389136031936},{x:0.0833480194008015,y:0.6403315480201149},{x:0.08209078724421986,y:0.6380913122274521},{x:0.0806538380596292,y:0.6359618836319892},{x:0.07993721339171088,y:0.6342539038369039},{x:0.07903072722802115,y:0.632638655023214},{x:0.07823470075697891,y:0.6301961909068614},{x:0.07724079305844417,y:0.627827343805619},{x:0.07687114846079628,y:0.6260123758261444},{x:0.07629719958575912,y:0.6242513168879111},{x:0.02905219958575911,y:0.40983931688791114},{x:0.028544362954760993,y:0.4055813372409792},{x:0.028013217832748447,y:0.4013262022752188},{x:0.028022142274708197,y:0.401202753871557},{x:0.028007484408327545,y:0.4010798543150725}]],D:[[{x:0.019456783112310236,y:0.0515304721392918},{x:0.019516560837245702,y:0.0508455251733057},{x:0.019462408649259272,y:0.05016011050819538},{x:0.01989956114396584,y:0.04645701928180655},{x:0.020223754746627687,y:0.042742334175020345},{x:0.02041601038349858,y:0.04208221032853139},{x:0.020496616482350807,y:0.04139940114622653},{x:0.021647806474261868,y:0.03785274800035644},{x:0.022690469901424933,y:0.03427268656062632},{x:0.023007815173924504,y:0.033662754022853354},{x:0.023220081912440925,y:0.03300879029730612},{x:0.025041069815762075,y:0.029754871123364675},{x:0.026762134096652887,y:0.026447013104097812},{x:0.027192373603928278,y:0.025910711240413317},{x:0.027528143690388265,y:0.025310724430849408},{x:0.029948949961216734,y:0.02247458551787214},{x:0.03228227556070457,y:0.019566050047680916},{x:0.03280887543977226,y:0.01912398863794477},{x:0.03325524541805519,y:0.01860103590097925},{x:0.03618283982900684,y:0.01629166847686688},{x:0.03903875835284746,y:0.013894228942745224},{x:0.03964148166567549,y:0.013563396159022682},{x:0.0401812977878431,y:0.013137574275061882},{x:0.04350317452751879,y:0.011443726034814963},{x:0.04677193462845869,y:0.0096495146935595},{x:0.04742761905614622,y:0.009442624254195854},{x:0.048040136491355995,y:0.009130297319436702},{x:0.05162863769958001,y:0.008117061901006828},{x:0.05518462276008175,y:0.0069950292882567724},{x:0.05586807071778482,y:0.006920031876811272},{x:0.05652975076450537,y:0.006733202440201605},{x:0.060246972352300414,y:0.0064395179124900545},{x:0.06395352786070822,y:0.006032783112310258},{x:0.06463847482669428,y:0.006092560837245719},{x:0.06532388949180462,y:0.006038408649259287},{x:0.22607288949180462,y:0.009146408649259287},{x:0.22716730592225892,y:0.009275605270020776},{x:0.2282688262216939,y:0.009242558031150067},{x:0.23153975417198444,y:0.00979177582685766},{x:0.23483359885377353,y:0.010180616482350843},{x:0.23588178136904675,y:0.010520840680108605},{x:0.23696858346127098,y:0.010703324384590318},{x:0.374121583461271,y:0.04785532438459028},{x:0.3763172878682137,y:0.048688585594252994},{x:0.37858028056243914,y:0.049316523610364836},{x:0.3804311803743379,y:0.05024979166335608},{x:0.3823691959266467,y:0.050985260963484026},{x:0.38436014929137596,y:0.0522308719724549},{x:0.38645715458576285,y:0.05328823230909956},{x:0.47004915458576285,y:0.1063032323090996},{x:0.47296331256678825,y:0.10858070495130694},{x:0.47594842000778254,y:0.11076435600861785},{x:0.476434095048061,y:0.11129319075325024},{x:0.4769998347544389,y:0.11173532762855881},{x:0.47941368513584726,y:0.11453756329148114},{x:0.48191542538645477,y:0.11726162167794474},{x:0.5445294253864548,y:0.20053762167794476},{x:0.5457907389554543,y:0.20261097926106453},{x:0.5472304508598836,y:0.2045646816997861},{x:0.5480776582474705,y:0.2063702359380903},{x:0.54911422277829,y:0.20807414921008693},{x:0.5499468085621922,y:0.21035373787896267},{x:0.5509777083681839,y:0.21255077433219424},{x:0.570480708368184,y:0.26758877433219413},{x:0.5715324066676154,y:0.27184261440989077},{x:0.5725895850614416,y:0.2760950958693092},{x:0.5821235850614417,y:0.3411630958693092},{x:0.5823063349967632,y:0.3450227385412275},{x:0.5825832689280143,y:0.34887676846995497},{x:0.5805752689280143,y:0.424797768469955},{x:0.5800798101377765,y:0.42875301375722},{x:0.5796594372976747,y:0.43271694253692033},{x:0.5588164372976746,y:0.5335539425369203},{x:0.5581925601051908,y:0.535556542700639},{x:0.5577783377379867,y:0.5376127649642906},{x:0.5568838034059929,y:0.5397575559956548},{x:0.5561926080991778,y:0.5419762423834013},{x:0.555190030621201,y:0.5438186507441294},{x:0.5543826183570809,y:0.5457545524985521},{x:0.5020956183570809,y:0.6430055524985521},{x:0.5018901867095668,y:0.6433113858234256},{x:0.5017428412228655,y:0.6436490624319612},{x:0.4994325691935421,y:0.6469701275279692},{x:0.4971767628200625,y:0.6503284258808291},{x:0.4969156133622187,y:0.650588304977856},{x:0.4967052216394318,y:0.6508907475465959},{x:0.49379143318032753,y:0.6536972875938759},{x:0.49092379998669317,y:0.6565509711937552},{x:0.49061696854573045,y:0.6567549090549786},{x:0.49035161582277553,y:0.657010494885618},{x:0.39890061582277553,y:0.7292364948856179},{x:0.3986791836579038,y:0.7293785203585265},{x:0.39848760231040037,y:0.7295587979940886},{x:0.39496847203231433,y:0.7317585520660096},{x:0.39147518928128755,y:0.7339991259907827},{x:0.39123030407812903,y:0.7340952232117042},{x:0.391007233490524,y:0.7342346611962726},{x:0.3871265715837099,y:0.7357055993513507},{x:0.38326329699273004,y:0.7372216156196327},{x:0.3830043695523095,y:0.737268091626259},{x:0.38275838220218455,y:0.7373613314362847},{x:0.25909638220218456,y:0.7708063314362847},{x:0.2580664240588666,y:0.7709788511982676},{x:0.2570738325025125,y:0.7713034106651087},{x:0.2537238261308602,y:0.7717062438265866},{x:0.2503960471743838,y:0.7722636525302581},{x:0.2493522224520667,y:0.7722319225075465},{x:0.24831538485324267,y:0.7723566006488801},{x:0.17218438485324267,y:0.7739936006488801},{x:0.16854768223369815,y:0.7737142062783378},{x:0.16490357022768087,y:0.7735589167265521},{x:0.06552457022768086,y:0.7594769167265522},{x:0.06454980411013514,y:0.759239472501363},{x:0.06355033417502035,y:0.7591522452533723},{x:0.06027159361314519,y:0.7581973390517399},{x:0.056953647958865025,y:0.7573891174476861},{x:0.056043934769293216,y:0.7569660682109414},{x:0.05508068656062633,y:0.7566855300985751},{x:0.05205123903764884,y:0.7551093215998242},{x:0.04895472299174925,y:0.7536693306611393},{x:0.04814502249785432,y:0.7530769339577588},{x:0.0472550131040978,y:0.7526138659033472},{x:0.04459127858939255,y:0.7504769279161366},{x:0.04183518952697092,y:0.7484605056870383},{x:0.041156618064647085,y:0.7477215269901124},{x:0.040374050047680896,y:0.7470937244392954},{x:0.03817839436480973,y:0.744478178292066},{x:0.035868647242901154,y:0.7419628147479951},{x:0.03534728193289863,y:0.7411056525944231},{x:0.03470222894274521,y:0.7403372416471526},{x:0.03305902990826266,y:0.7373436013115269},{x:0.03128438701344127,y:0.73442596046285},{x:0.030940263632238257,y:0.7334835551134912},{x:0.030457514693559486,y:0.7326040653715413},{x:0.029429919524844063,y:0.7293473747667649},{x:0.028258579388326675,y:0.7261395799150647},{x:0.028104922404476318,y:0.7251481474789881},{x:0.02780302928825676,y:0.7241913772399183},{x:0.02743052789135989,y:0.7207967891595589},{x:0.026907504457698045,y:0.7174221140620348},{x:0.02695021882291786,y:0.7164197547317572},{x:0.026840783112310238,y:0.7154224721392919},{x:0.019456783112310236,y:0.0515304721392918}],[{x:0.1099671672449683,y:0.09691838411671685},{x:0.1164055200593884,y:0.675787686211921},{x:0.17390769441284104,y:0.6839357418297609},{x:0.2408956143230629,y:0.6824953400894312},{x:0.35035782392371695,y:0.652890743688808},{x:0.42724604872976657,y:0.5921661050862587},{x:0.4720072878873445,y:0.5089126143655517},{x:0.4907125333997566,y:0.41841792349882906},{x:0.4925121994894803,y:0.35037387509349616},{x:0.4841787199640398,y:0.2934992321564965},{x:0.4684498534661817,y:0.24911194023683725},{x:0.41491413338319044,y:0.1779099626338861},{x:0.34401115658372555,y:0.1329424859013802},{x:0.21878934362335548,y:0.0990224054430332},{x:0.1099671672449683,y:0.09691838411671685}]],E:[[{x:0.035078,y:0.05103000000000002},{x:0.03594266238185463,y:0.04225093550927423},{x:0.03850342103699209,y:0.03380924554357098},{x:0.042661867446385456,y:0.026029339514117924},{x:0.04825819484660536,y:0.019210194846605383},{x:0.05507733951411791,y:0.013613867446385479},{x:0.06285724554357096,y:0.009455421036992116},{x:0.07129893550927423,y:0.006894662381854655},{x:0.080078,y:0.0060300000000000215},{x:0.521974,y:0.0060300000000000215},{x:0.5307530644907258,y:0.006894662381854655},{x:0.5391947544564291,y:0.009455421036992116},{x:0.5469746604858822,y:0.013613867446385479},{x:0.5537938051533947,y:0.019210194846605383},{x:0.5593901325536146,y:0.026029339514117924},{x:0.5635485789630079,y:0.03380924554357098},{x:0.5661093376181454,y:0.04225093550927425},{x:0.5669740000000001,y:0.05103000000000002},{x:0.5661093376181454,y:0.05980906449072579},{x:0.5635485789630079,y:0.06825075445642906},{x:0.5593901325536146,y:0.07603066048588211},{x:0.5537938051533947,y:0.08284980515339466},{x:0.5469746604858822,y:0.08844613255361455},{x:0.5391947544564291,y:0.09260457896300792},{x:0.5307530644907258,y:0.09516533761814538},{x:0.521974,y:0.09603000000000002},{x:0.125078,y:0.09603000000000002},{x:0.125078,y:0.345019},{x:0.389405,y:0.345019},{x:0.3981840644907258,y:0.34588366238185464},{x:0.40662575445642907,y:0.3484444210369921},{x:0.4144056604858821,y:0.35260286744638547},{x:0.42122480515339467,y:0.35819919484660534},{x:0.42682113255361454,y:0.3650183395141179},{x:0.4309795789630079,y:0.372798245543571},{x:0.43354033761814537,y:0.3812399355092742},{x:0.434405,y:0.390019},{x:0.43354033761814537,y:0.3987980644907258},{x:0.4309795789630079,y:0.407239754456429},{x:0.42682113255361454,y:0.4150196604858821},{x:0.42122480515339467,y:0.42183880515339467},{x:0.4144056604858821,y:0.42743513255361454},{x:0.40662575445642907,y:0.43159357896300793},{x:0.3981840644907258,y:0.43415433761814537},{x:0.389405,y:0.435019},{x:0.125078,y:0.435019},{x:0.125078,y:0.684004},{x:0.521974,y:0.684004},{x:0.5307530644907258,y:0.6848686623818546},{x:0.5391947544564291,y:0.6874294210369921},{x:0.5469746604858822,y:0.6915878674463855},{x:0.5537938051533947,y:0.6971841948466053},{x:0.5593901325536146,y:0.7040033395141179},{x:0.5635485789630079,y:0.711783245543571},{x:0.5661093376181454,y:0.7202249355092742},{x:0.5669740000000001,y:0.729004},{x:0.5661093376181454,y:0.7377830644907257},{x:0.5635485789630079,y:0.746224754456429},{x:0.5593901325536146,y:0.7540046604858821},{x:0.5537938051533947,y:0.7608238051533946},{x:0.5469746604858822,y:0.7664201325536145},{x:0.5391947544564291,y:0.7705785789630079},{x:0.5307530644907258,y:0.7731393376181454},{x:0.521974,y:0.774004},{x:0.080078,y:0.774004},{x:0.07129893550927423,y:0.7731393376181454},{x:0.06285724554357093,y:0.7705785789630079},{x:0.05507733951411791,y:0.7664201325536145},{x:0.04825819484660536,y:0.7608238051533946},{x:0.042661867446385456,y:0.7540046604858821},{x:0.03850342103699209,y:0.746224754456429},{x:0.03594266238185463,y:0.7377830644907257},{x:0.035078,y:0.729004},{x:0.035078,y:0.05103000000000002}]],F:[[{x:0.041426000000000004,y:0.05103000000000002},{x:0.04229066238185464,y:0.04225093550927423},{x:0.0448514210369921,y:0.03380924554357098},{x:0.04900986744638546,y:0.026029339514117924},{x:0.054606194846605366,y:0.019210194846605383},{x:0.06142533951411792,y:0.013613867446385479},{x:0.06920524554357096,y:0.009455421036992116},{x:0.07764693550927423,y:0.006894662381854655},{x:0.086426,y:0.0060300000000000215},{x:0.09520506449072577,y:0.006894662381854655},{x:0.10364675445642904,y:0.009455421036992116},{x:0.11142666048588211,y:0.013613867446385486},{x:0.11824580515339464,y:0.019210194846605383},{x:0.12384213255361454,y:0.026029339514117924},{x:0.1280005789630079,y:0.03380924554357098},{x:0.13056133761814537,y:0.04225093550927425},{x:0.131426,y:0.05103000000000002},{x:0.131426,y:0.347323},{x:0.447344,y:0.347323},{x:0.4561230644907258,y:0.3481876623818546},{x:0.4645647544564291,y:0.35074842103699205},{x:0.47234466048588214,y:0.35490686744638544},{x:0.47916380515339463,y:0.3605031948466053},{x:0.48476013255361455,y:0.36732233951411786},{x:0.48891857896300794,y:0.37510224554357097},{x:0.4914793376181454,y:0.3835439355092742},{x:0.492344,y:0.392323},{x:0.4914793376181454,y:0.4011020644907258},{x:0.48891857896300794,y:0.409543754456429},{x:0.48476013255361455,y:0.4173236604858821},{x:0.47916380515339463,y:0.42414280515339464},{x:0.47234466048588214,y:0.4297391325536145},{x:0.4645647544564291,y:0.4338975789630079},{x:0.4561230644907258,y:0.43645833761814534},{x:0.447344,y:0.43732299999999996},{x:0.131426,y:0.43732299999999996},{x:0.131426,y:0.679393},{x:0.515626,y:0.679393},{x:0.5244050644907258,y:0.6802576623818547},{x:0.532846754456429,y:0.6828184210369922},{x:0.5406266604858821,y:0.6869768674463855},{x:0.5474458051533947,y:0.6925731948466054},{x:0.5530421325536146,y:0.6993923395141179},{x:0.5572005789630079,y:0.707172245543571},{x:0.5597613376181454,y:0.7156139355092743},{x:0.5606260000000001,y:0.7243930000000001},{x:0.5597613376181454,y:0.7331720644907258},{x:0.5572005789630079,y:0.7416137544564291},{x:0.5530421325536146,y:0.7493936604858822},{x:0.5474458051533947,y:0.7562128051533947},{x:0.5406266604858821,y:0.7618091325536146},{x:0.532846754456429,y:0.7659675789630079},{x:0.5244050644907258,y:0.7685283376181454},{x:0.515626,y:0.7693930000000001},{x:0.10586481668800227,y:0.7693930000000001},{x:0.10364675445642904,y:0.7705785789630079},{x:0.09520506449072577,y:0.7731393376181454},{x:0.086426,y:0.774004},{x:0.0776469355092742,y:0.7731393376181454},{x:0.06920524554357094,y:0.7705785789630079},{x:0.06142533951411792,y:0.7664201325536145},{x:0.054606194846605366,y:0.7608238051533946},{x:0.04900986744638546,y:0.7540046604858821},{x:0.0448514210369921,y:0.746224754456429},{x:0.04229066238185464,y:0.7377830644907257},{x:0.041426000000000004,y:0.729004},{x:0.041426000000000004,y:0.05103000000000002}]],G:[[{x:0.011397831509003739,y:0.41623356008285023},{x:0.011618856500496228,y:0.4138403978921803},{x:0.011624876992355357,y:0.4114370583257866},{x:0.031979876992355355,y:0.20994505832578658},{x:0.0322125865037964,y:0.20879027461506633},{x:0.03227702681480045,y:0.2076140405475535},{x:0.033082276634523504,y:0.2044745765152392},{x:0.033722542929381774,y:0.20129735748690203},{x:0.034176068118796386,y:0.2002101619949014},{x:0.03446874211029117,y:0.19906910061620064},{x:0.03587099832954512,y:0.19614705695158466},{x:0.03711880677043453,y:0.1931557970536144},{x:0.03777571891913337,y:0.19217797009338475},{x:0.03828537929375919,y:0.19111593175236494},{x:0.08239837929375919,y:0.11845093175236496},{x:0.08400149586436068,y:0.11631468084865614},{x:0.08543403702225794,y:0.1140604899753128},{x:0.08664282877724949,y:0.11279494315419919},{x:0.08769326713863865,y:0.11139516977529508},{x:0.08968234215056696,y:0.10961271886167734},{x:0.09152712825517066,y:0.10768131654967852},{x:0.15960912825517065,y:0.049144316549678456},{x:0.16129904644183068,y:0.0479582081853546},{x:0.16285577619764602,y:0.04660201166682107},{x:0.1649006360722032,y:0.045430348778213794},{x:0.16682965744636918,y:0.04407642028337947},{x:0.16871850259167306,y:0.043242789341903884},{x:0.17050990103726027,y:0.04221635466854622},{x:0.25257090103726026,y:0.005359354668546305},{x:0.2555014876285109,y:0.004375276469579791},{x:0.2583690572759664,y:0.003220377345201267},{x:0.25967433471463813,y:0.0029740526131209386},{x:0.2609335532503684,y:0.0025512125194529015},{x:0.2639998135747395,y:0.0021577721889240492},{x:0.26703759331756605,y:0.0015844992133087973},{x:0.35309859331756605,y:-0.006038500786691249},{x:0.3541123404679588,y:-0.006028536718703998},{x:0.3551159915981175,y:-0.006171599559831674},{x:0.3585153812714738,y:-0.005985259459774228},{x:0.361919709861342,y:-0.005951798491220829},{x:0.36291203425126567,y:-0.00574425362199294},{x:0.3639243106821295,y:-0.005688764928569123},{x:0.3672220288859873,y:-0.004842817275250554},{x:0.37055441634545594,y:-0.004145847688979236},{x:0.3714871835051078,y:-0.003748697851442632},{x:0.37246918402112983,y:-0.003496790022837183},{x:0.4525501840211298,y:0.02567020997716287},{x:0.4548144879103283,y:0.026756908839544704},{x:0.45716266717941917,y:0.02764799841997529},{x:0.45878159595452606,y:0.02866082810547922},{x:0.4605032369247208,y:0.02948708879101062},{x:0.4625120284186098,y:0.03099465081435172},{x:0.46464124512829075,y:0.032326725408117304},{x:0.4660314733714444,y:0.03363593119127184},{x:0.46755883802994086,y:0.034782191000688294},{x:0.46923492039795345,y:0.03665268142188218},{x:0.47106334994415,y:0.038374550149380404},{x:0.53517534994415,y:0.11188255014938031},{x:0.5366918789074028,y:0.11401106513419482},{x:0.5383741006891446,y:0.11601120663268963},{x:0.5392453250303639,y:0.11759493887966013},{x:0.5402941837404813,y:0.11906705813061697},{x:0.5413663203511413,y:0.12145053442062861},{x:0.5426260104640281,y:0.12374042895017842},{x:0.5431715236397763,y:0.1254636976633839},{x:0.5439130326051668,y:0.12711215273922669},{x:0.5444995752545472,y:0.12965899467727895},{x:0.5452883245139833,y:0.13215064287530112},{x:0.5896823245139834,y:0.3420786428753011},{x:0.5897067631627176,y:0.34229945557802055},{x:0.5897717252277992,y:0.3425119065778641},{x:0.5901917436343531,y:0.346681442891342},{x:0.5906527316031134,y:0.3508466486034176},{x:0.590633622248786,y:0.3510679861958218},{x:0.5906558889520306,y:0.35128902847947113},{x:0.590254400640623,y:0.3554603898480228},{x:0.5898939395311937,y:0.3596354965915505},{x:0.5898320165355749,y:0.3598488531940917},{x:0.589810732180064,y:0.3600699922305474},{x:0.5886031661213459,y:0.3640828755761044},{x:0.5874351082520124,y:0.3681074363403587},{x:0.5873327512810971,y:0.3683046127784522},{x:0.5872687338126765,y:0.3685173503185603},{x:0.5853014960930706,y:0.3722175427846122},{x:0.5833707292727002,y:0.37593689595641405},{x:0.5832318718474782,y:0.3761103148501221},{x:0.583127581421558,y:0.3763064755095204},{x:0.5804762718833937,y:0.37955178077467916},{x:0.577856994398102,y:0.38282299369748307},{x:0.5776869727315521,y:0.38296599065597503},{x:0.5775464171707139,y:0.38313803609053093},{x:0.5743129241526703,y:0.3858037388934479},{x:0.5711057933673104,y:0.38850110068914456},{x:0.5709111412967293,y:0.38860818041949885},{x:0.5707397220723512,y:0.3887494990196469},{x:0.5670483068977423,y:0.3907331578965531},{x:0.5633765710498215,y:0.39275301046402805},{x:0.5631647689451196,y:0.3928200579522583},{x:0.5629690736018615,y:0.39292521892344706},{x:0.5589615952856832,y:0.39415060297614785},{x:0.5549663571246989,y:0.39541532451398326},{x:0.5547455444219794,y:0.39543976316271745},{x:0.5545330934221359,y:0.39550472522779906},{x:0.5503635571086607,y:0.3959247436343527},{x:0.5461983513965825,y:0.39638573160311336},{x:0.5459770138041778,y:0.396366622248786},{x:0.5457559715205288,y:0.3963888889520305},{x:0.32969497152052885,y:0.39686888895203054},{x:0.32091400776945256,y:0.3960237321800639},{x:0.31246664968143967,y:0.39348173381267654},{x:0.3046775244904796,y:0.389340581421558},{x:0.29784596390946905,y:0.3837594171707138},{x:0.2922345009803531,y:0.3769527220723512},{x:0.2880587810765529,y:0.3691820736018615},{x:0.2854792747722009,y:0.3607460934221358},{x:0.2845951110479695,y:0.3519689715205288},{x:0.2854402678199361,y:0.3431880077694525},{x:0.2879822661873235,y:0.33474064968143963},{x:0.29212341857844204,y:0.32695152449047954},{x:0.29770458282928614,y:0.320119963909469},{x:0.3045112779276488,y:0.31450850098035305},{x:0.31228192639813845,y:0.3103327810765529},{x:0.3207179065778642,y:0.3077532747722009},{x:0.3294950284794712,y:0.30686911104796943},{x:0.49017057214072013,y:0.30651215509128404},{x:0.45965681956734333,y:0.16222033524572274},{x:0.4108567628008364,y:0.10626833604444391},{x:0.35107150330533127,y:0.0844934248457151},{x:0.2825297162303303,y:0.09056463065174497},{x:0.21333680545064249,y:0.12164203785622632},{x:0.15562253329738823,y:0.17126485077351794},{x:0.1205010051965362,y:0.2291186770707186},{x:0.10185989085514695,y:0.41364510354456796},{x:0.13655871914038514,y:0.5827099362211221},{x:0.190187982415082,y:0.6526649281775241},{x:0.2569251189377254,y:0.6872526727450867},{x:0.3715857772516941,y:0.6967797369989467},{x:0.4883723057362636,y:0.6711064406866752},{x:0.49713228125159653,y:0.6700660353148682},{x:0.5059269093127409,y:0.6707546074846872},{x:0.5144182172953911,y:0.6731456957538017},{x:0.5222798889957544,y:0.6771474119409674},{x:0.529209804779262,y:0.6826059723372997},{x:0.5349416518686954,y:0.6893116075279637},{x:0.5392551585948644,y:0.6970066237131456},{x:0.5419845593133248,y:0.7053953057362636},{x:0.5430249646851317,y:0.7141552812515966},{x:0.5423363925153128,y:0.722949909312741},{x:0.5399453042461984,y:0.7314412172953911},{x:0.5359435880590326,y:0.7393028889957545},{x:0.5304850276627003,y:0.7462328047792621},{x:0.5237793924720363,y:0.7519646518686954},{x:0.5160843762868544,y:0.7562781585948645},{x:0.5076956942637364,y:0.7590075593133249},{x:0.38428269426373635,y:0.7861375593133247},{x:0.3819812519937546,y:0.7864108971664274},{x:0.3797153389243004,y:0.7868977113667894},{x:0.37761181025895013,y:0.7869298473215656},{x:0.37552271874840343,y:0.7871779646851318},{x:0.3732121724765259,y:0.7869970613144796},{x:0.370894825552222,y:0.7870324638061055},{x:0.24049282555222196,y:0.7761974638061055},{x:0.24043595887820252,y:0.7761870527203061},{x:0.24037815170992255,y:0.776187787986971},{x:0.2360978388350013,y:0.7753928346522221},{x:0.2318155069745089,y:0.7746088302209789},{x:0.231761764079766,y:0.7745875250435272},{x:0.2317049242166051,y:0.7745769685631748},{x:0.227661944055434,y:0.7729622424167508},{x:0.22361484767780643,y:0.7713578609091699},{x:0.22356629387164592,y:0.7713264803860874},{x:0.22351260563766895,y:0.7713050378383375},{x:0.13987060563766895,y:0.7279560378383374},{x:0.13900257424615298,y:0.727391873258006},{x:0.13805978359276902,y:0.7269641982011581},{x:0.13531067905832161,y:0.7249923788161832},{x:0.13247402218179744,y:0.7231487342752945},{x:0.13173273281971745,y:0.7224260654354895},{x:0.1308914928889356,y:0.7218226787027751},{x:0.128579894506033,y:0.7193524235854973},{x:0.12615742040314795,y:0.7169907998540069},{x:0.12557136040496888,y:0.7161373985129647},{x:0.12486399957555622,y:0.7153814879181388},{x:0.05884299957555622,y:0.6292624879181389},{x:0.05814177883495547,y:0.6281337214080167},{x:0.057292540659828396,y:0.62711165542026},{x:0.05581896837632758,y:0.6243946553718145},{x:0.05418793684040681,y:0.6217691571968414},{x:0.05372040128165289,y:0.6205252782386133},{x:0.05308687616260495,y:0.6193571728131668},{x:0.052171678571706244,y:0.6164048994674943},{x:0.051084196133809955,y:0.613511651036194},{x:0.05086831288622884,y:0.6122004612006492},{x:0.05047484683830003,y:0.6109312059739318},{x:0.012315846838300032,y:0.4250072059739319},{x:0.012065742114142504,y:0.42261690788694145},{x:0.011602778634016861,y:0.4202585732767163},{x:0.011607833784388823,y:0.41824059149262255},{x:0.011397831509003739,y:0.41623356008285023}]],H:[[{x:0.021894999999999998,y:0.05103000000000002},{x:0.02275966238185463,y:0.04225093550927423},{x:0.025320421036992093,y:0.03380924554357098},{x:0.029478867446385455,y:0.026029339514117924},{x:0.03507519484660536,y:0.019210194846605383},{x:0.04189433951411791,y:0.013613867446385479},{x:0.04967424554357096,y:0.009455421036992116},{x:0.05811593550927423,y:0.006894662381854655},{x:0.066895,y:0.0060300000000000215},{x:0.07567406449072576,y:0.006894662381854655},{x:0.08411575445642903,y:0.009455421036992116},{x:0.0918956604858821,y:0.013613867446385486},{x:0.09871480515339463,y:0.019210194846605383},{x:0.10431113255361453,y:0.026029339514117924},{x:0.1084695789630079,y:0.03380924554357098},{x:0.11103033761814536,y:0.04225093550927425},{x:0.111895,y:0.05103000000000002},{x:0.111895,y:0.359342},{x:0.490157,y:0.359342},{x:0.490157,y:0.05103000000000002},{x:0.49102166238185463,y:0.04225093550927423},{x:0.49358242103699207,y:0.03380924554357098},{x:0.49774086744638546,y:0.026029339514117924},{x:0.5033371948466053,y:0.019210194846605383},{x:0.5101563395141179,y:0.013613867446385479},{x:0.517936245543571,y:0.009455421036992116},{x:0.5263779355092743,y:0.006894662381854655},{x:0.535157,y:0.0060300000000000215},{x:0.5439360644907257,y:0.006894662381854655},{x:0.552377754456429,y:0.009455421036992116},{x:0.5601576604858821,y:0.013613867446385486},{x:0.5669768051533947,y:0.019210194846605383},{x:0.5725731325536145,y:0.026029339514117924},{x:0.5767315789630079,y:0.03380924554357098},{x:0.5792923376181454,y:0.04225093550927425},{x:0.580157,y:0.05103000000000002},{x:0.580157,y:0.729004},{x:0.5792923376181454,y:0.7377830644907257},{x:0.5767315789630079,y:0.746224754456429},{x:0.5725731325536145,y:0.7540046604858821},{x:0.5669768051533947,y:0.7608238051533946},{x:0.5601576604858821,y:0.7664201325536145},{x:0.552377754456429,y:0.7705785789630079},{x:0.5439360644907257,y:0.7731393376181454},{x:0.535157,y:0.774004},{x:0.5263779355092743,y:0.7731393376181454},{x:0.517936245543571,y:0.7705785789630079},{x:0.5101563395141179,y:0.7664201325536145},{x:0.5033371948466053,y:0.7608238051533946},{x:0.49774086744638546,y:0.7540046604858821},{x:0.49358242103699207,y:0.746224754456429},{x:0.49102166238185463,y:0.7377830644907257},{x:0.490157,y:0.729004},{x:0.490157,y:0.44934199999999996},{x:0.111895,y:0.44934199999999996},{x:0.111895,y:0.729004},{x:0.11103033761814536,y:0.7377830644907257},{x:0.10846957896300788,y:0.746224754456429},{x:0.10431113255361453,y:0.7540046604858821},{x:0.09871480515339463,y:0.7608238051533946},{x:0.09189566048588207,y:0.7664201325536145},{x:0.08411575445642903,y:0.7705785789630079},{x:0.07567406449072576,y:0.7731393376181454},{x:0.066895,y:0.774004},{x:0.05811593550927421,y:0.7731393376181454},{x:0.04967424554357093,y:0.7705785789630079},{x:0.04189433951411791,y:0.7664201325536145},{x:0.03507519484660536,y:0.7608238051533946},{x:0.029478867446385455,y:0.7540046604858821},{x:0.025320421036992093,y:0.746224754456429},{x:0.02275966238185463,y:0.7377830644907257},{x:0.021894999999999998,y:0.729004},{x:0.021894999999999998,y:0.05103000000000002}]],I:[[{x:0.25602600000000003,y:0.05103000000000002},{x:0.25689066238185465,y:0.04225093550927423},{x:0.2594514210369921,y:0.03380924554357098},{x:0.2636098674463855,y:0.026029339514117924},{x:0.26920619484660535,y:0.019210194846605383},{x:0.27602533951411795,y:0.013613867446385479},{x:0.283805245543571,y:0.009455421036992116},{x:0.2922469355092743,y:0.006894662381854655},{x:0.301026,y:0.0060300000000000215},{x:0.3098050644907258,y:0.006894662381854655},{x:0.3182467544564291,y:0.009455421036992116},{x:0.32602666048588214,y:0.013613867446385486},{x:0.3328458051533947,y:0.019210194846605383},{x:0.33844213255361455,y:0.026029339514117924},{x:0.34260057896300794,y:0.03380924554357098},{x:0.3451613376181454,y:0.04225093550927425},{x:0.346026,y:0.05103000000000002},{x:0.346026,y:0.729004},{x:0.3451613376181454,y:0.7377830644907257},{x:0.34260057896300794,y:0.746224754456429},{x:0.33844213255361455,y:0.7540046604858821},{x:0.3328458051533947,y:0.7608238051533946},{x:0.32602666048588214,y:0.7664201325536145},{x:0.3182467544564291,y:0.7705785789630079},{x:0.3098050644907258,y:0.7731393376181454},{x:0.301026,y:0.774004},{x:0.2922469355092743,y:0.7731393376181454},{x:0.283805245543571,y:0.7705785789630079},{x:0.27602533951411795,y:0.7664201325536145},{x:0.26920619484660535,y:0.7608238051533946},{x:0.2636098674463855,y:0.7540046604858821},{x:0.2594514210369921,y:0.746224754456429},{x:0.25689066238185465,y:0.7377830644907257},{x:0.25602600000000003,y:0.729004},{x:0.25602600000000003,y:0.05103000000000002}]],J:[[{x:0.0492700034030052,y:0.22191686675397743},{x:0.05066400340300519,y:0.18438286675397747},{x:0.05116783173382979,y:0.18068175768771486},{x:0.05155979864248331,y:0.17696713613904605},{x:0.05874879864248331,y:0.14209513613904604},{x:0.05880353678004782,y:0.1419191061579158},{x:0.05882437610196882,y:0.14173594355086241},{x:0.060112741823836933,y:0.13770889095133898},{x:0.06136821695472819,y:0.13367146342030908},{x:0.0614562450600313,y:0.133509494686791},{x:0.06151241721221637,y:0.13333391704789688},{x:0.07511841721221638,y:0.10184091704789687},{x:0.07557207470549994,y:0.10102219111224012},{x:0.07589401217340325,y:0.10014328637013822},{x:0.07770640675364808,y:0.09717031380613761},{x:0.07939396242231754,y:0.09412474393402119},{x:0.07999862852050488,y:0.09341025377409445},{x:0.08048584585939292,y:0.09261104382444658},{x:0.10112984585939291,y:0.06520804382444652},{x:0.10197173470408774,y:0.06429305686105671},{x:0.10267645797068833,y:0.06326868237508665},{x:0.10495244591663212,y:0.06105354143298789},{x:0.10710291637241387,y:0.058716353519649434},{x:0.10810713366035453,y:0.05798319214000915},{x:0.10899816141532707,y:0.05711598541156246},{x:0.1373061614153271,y:0.03451898541156248},{x:0.13912164740426522,y:0.03334117545586675},{x:0.1408101373903697,y:0.03198757757075004},{x:0.14281300361792376,y:0.03094638082514127},{x:0.14470672673278473,y:0.029717813955661344},{x:0.1467171079910441,y:0.028916819034200267},{x:0.14863722796281134,y:0.027918638208003034},{x:0.20683022796281134,y:0.004592638208003076},{x:0.20850921914024034,y:0.004104279923540699},{x:0.2101185278310492,y:0.0034204446176558795},{x:0.21273469892125257,y:0.0028752394826936905},{x:0.21530073387518742,y:0.0021288719943945503},{x:0.21704273768291169,y:0.0019774523068977427},{x:0.21875453360851305,y:0.0016207172553791283},{x:0.2976895336085131,y:-0.0068802827446208525},{x:0.29850402526559744,y:-0.006887701289741747},{x:0.2993068957135494,y:-0.007024999279811796},{x:0.30290822222422875,y:-0.006927815554356645},{x:0.3065107103471747,y:-0.0069606277022222565},{x:0.30731099906181086,y:-0.006809004262418785},{x:0.30812522808832776,y:-0.0067870318558802545},{x:0.3663632280883278,y:0.0005399681441197179},{x:0.367446910459264,y:0.0007860908462292888},{x:0.3685549625674647,y:0.000870733572342984},{x:0.37174033606180384,y:0.0017612008405818037},{x:0.37496569353784953,y:0.0024937343933679954},{x:0.37598053709868623,y:0.002946543859479297},{x:0.3770507853196353,y:0.0032457304419443098},{x:0.4423997853196353,y:0.028649730441944292},{x:0.44339023767510893,y:0.0291515261148112},{x:0.4444435524779453,y:0.029502699422305954},{x:0.4473177196266577,y:0.03114131738307233},{x:0.45026902431580135,y:0.03263654520916596},{x:0.4511425499275847,y:0.03332192668785485},{x:0.4521071150681948,y:0.03387184382278591},{x:0.4818761150681948,y:0.0549598438227859},{x:0.482276572000261,y:0.05530719927286456},{x:0.48273081061614365,y:0.05558049186877649},{x:0.48560514894853896,y:0.05819439949693127},{x:0.48854004666413575,y:0.060740123232255375},{x:0.48886504324193186,y:0.061158929616590856},{x:0.48925723704963914,y:0.06151558852974905},{x:0.5141262370496392,y:0.08904658852974903},{x:0.5149956342421861,y:0.09022293690705172},{x:0.5160117353213701,y:0.09127516577002369},{x:0.5176116053111659,y:0.0937625081737249},{x:0.5193693801104602,y:0.0961408866071265},{x:0.519992577896003,y:0.09746424275846524},{x:0.5207838752101566,y:0.09869448482562238},{x:0.5385188752101566,y:0.1333154848256224},{x:0.5396070973995049,y:0.13607819549886616},{x:0.5408707323766272,y:0.1387652058155645},{x:0.5412201620380835,y:0.14017334347255597},{x:0.5417518824254063,y:0.14152324205357814},{x:0.5422802166156467,y:0.1444451696332536},{x:0.5429953614930656,y:0.1473270727547606},{x:0.5523413614930656,y:0.2113020727547606},{x:0.5524962602601196,y:0.21460328519222147},{x:0.5528139181508881,y:0.2178928278123641},{x:0.5518389181508881,y:0.7290898278123641},{x:0.5509575131661891,y:0.7378672271777721},{x:0.5483806584624608,y:0.7463040176932935},{x:0.5442073811208505,y:0.7540759782308231},{x:0.5385980578491955,y:0.7608844367054697},{x:0.5317682517950807,y:0.7664677478762799},{x:0.5239804285749665,y:0.7706113482261165},{x:0.5155338698677402,y:0.7731560015172932},{x:0.5067531721876358,y:0.7740039181508881},{x:0.4979757728222279,y:0.7731225131661891},{x:0.4895389823067066,y:0.7705456584624607},{x:0.48176702176917696,y:0.7663723811208505},{x:0.4749585632945304,y:0.7607630578491954},{x:0.46937525212372017,y:0.7539332517950806},{x:0.4652316517738835,y:0.7461454285749665},{x:0.46268699848270683,y:0.7376988698677401},{x:0.461839081849112,y:0.7289181721876359},{x:0.462807763438783,y:0.22103394388498027},{x:0.45501827222953295,y:0.16771351802238937},{x:0.44337725180090903,y:0.14498874958374325},{x:0.42579959063650114,y:0.12552955984883984},{x:0.4046143325842134,y:0.11052217895574154},{x:0.34961801160788414,y:0.08914271579513207},{x:0.3021031758959219,y:0.08316481131246532},{x:0.2345584384824393,y:0.09043912324952764},{x:0.18827433696976265,y:0.10899157718530504},{x:0.16959144206995366,y:0.1239052897771866},{x:0.155605251275173,y:0.14247066404328695},{x:0.14596289111822178,y:0.16478926233983734},{x:0.14046290234137151,y:0.19146830095804884},{x:0.13920799659699482,y:0.22525713324602253},{x:0.1380181031040591,y:0.23399805813086086},{x:0.13514580323043823,y:0.24233889189031887},{x:0.13070147784947123,y:0.24995910096061402},{x:0.12485591989314217,y:0.25656584498063745},{x:0.11783377087548613,y:0.26190523048280423},{x:0.10990488804518514,y:0.26577206787662816},{x:0.10137397392283892,y:0.2680177567696118},{x:0.09256886675397746,y:0.2685559965969948},{x:0.08382794186913914,y:0.26736610310405906},{x:0.07548710810968112,y:0.26449380323043825},{x:0.06786689903938595,y:0.2600494778494712},{x:0.06126015501936256,y:0.2542039198931421},{x:0.055920769517195726,y:0.24718177087548612},{x:0.052053932123371845,y:0.23925288804518513},{x:0.04980824323038816,y:0.2307219739228389},{x:0.0492700034030052,y:0.22191686675397743}]],K:[[{x:-0.009598999999999996,y:0.05103000000000002},{x:-0.008734337618145363,y:0.04225093550927423},{x:-0.006173578963007902,y:0.03380924554357098},{x:-0.002015132553614539,y:0.026029339514117924},{x:0.003581194846605365,y:0.019210194846605383},{x:0.010400339514117916,y:0.013613867446385479},{x:0.018180245543570964,y:0.009455421036992116},{x:0.026621935509274233,y:0.006894662381854655},{x:0.035401,y:0.0060300000000000215},{x:0.04418006449072578,y:0.006894662381854655},{x:0.05262175445642904,y:0.009455421036992116},{x:0.06040166048588211,y:0.013613867446385486},{x:0.06722080515339464,y:0.019210194846605383},{x:0.07281713255361454,y:0.026029339514117924},{x:0.07697557896300791,y:0.03380924554357098},{x:0.07953633761814537,y:0.04225093550927425},{x:0.080401,y:0.05103000000000002},{x:0.080401,y:0.29048154892126793},{x:0.18934433769134518,y:0.3772029724897202},{x:0.5349508182082354,y:0.03415901207017739},{x:0.5417907398770268,y:0.02858809778868676},{x:0.5495860658299886,y:0.024458629583942203},{x:0.5580372260624178,y:0.02192930060321959},{x:0.5668194472260474,y:0.021097311540784057},{x:0.5755952334866855,y:0.021994635269720175},{x:0.5840273362998535,y:0.024586788142349852},{x:0.5917917146832189,y:0.028774155177474024},{x:0.5985899879298227,y:0.03439581820823536},{x:0.6041609022113132,y:0.04123573987702663},{x:0.6082903704160578,y:0.04903106582998847},{x:0.6108196993967804,y:0.05748222606241771},{x:0.6116516884592159,y:0.06626444722604735},{x:0.6107543647302798,y:0.07504023348668547},{x:0.6081622118576502,y:0.08347233629985339},{x:0.603974844822526,y:0.0912367146832188},{x:0.5983531817917647,y:0.09803498792982254},{x:0.26024203797571366,y:0.43363918627462555},{x:0.5302838206406747,y:0.648598708462355},{x:0.5366139141989896,y:0.654742773070568},{x:0.5416237292416561,y:0.6620037211908337},{x:0.545120741386121,y:0.6701025186588768},{x:0.5469705624168195,y:0.6787279332298585},{x:0.5471021047489336,y:0.6875484950590041},{x:0.5455103132844098,y:0.6962252349018474},{x:0.542256359676543,y:0.7044247105121999},{x:0.537465291537645,y:0.7118318206406747},{x:0.531321226929432,y:0.7181619141989897},{x:0.5240602788091663,y:0.7231717292416562},{x:0.5159614813411232,y:0.726668741386121},{x:0.5073360667701415,y:0.7285185624168196},{x:0.498515504940996,y:0.7286501047489337},{x:0.48983876509815266,y:0.7270583132844098},{x:0.48163928948780005,y:0.723804359676543},{x:0.47423217935932527,y:0.719013291537645},{x:0.080401,y:0.4055145384845117},{x:0.080401,y:0.729004},{x:0.07953633761814537,y:0.7377830644907257},{x:0.07697557896300788,y:0.746224754456429},{x:0.07281713255361454,y:0.7540046604858821},{x:0.06722080515339464,y:0.7608238051533946},{x:0.06040166048588208,y:0.7664201325536145},{x:0.052621754456429054,y:0.7705785789630079},{x:0.04418006449072578,y:0.7731393376181454},{x:0.035401,y:0.774004},{x:0.026621935509274212,y:0.7731393376181454},{x:0.018180245543570936,y:0.7705785789630079},{x:0.010400339514117906,y:0.7664201325536145},{x:0.003581194846605358,y:0.7608238051533946},{x:-0.002015132553614539,y:0.7540046604858821},{x:-0.006173578963007902,y:0.746224754456429},{x:-0.008734337618145363,y:0.7377830644907257},{x:-0.009598999999999996,y:0.729004},{x:-0.009598999999999996,y:0.05103000000000002}]],L:[[{x:0.030439999999999995,y:0.05103000000000002},{x:0.03130466238185463,y:0.04225093550927423},{x:0.03386542103699209,y:0.03380924554357098},{x:0.03802386744638545,y:0.026029339514117924},{x:0.043620194846605356,y:0.019210194846605383},{x:0.05043933951411791,y:0.013613867446385479},{x:0.058219245543570955,y:0.009455421036992116},{x:0.06666093550927422,y:0.006894662381854655},{x:0.07544,y:0.0060300000000000215},{x:0.526613,y:0.0060300000000000215},{x:0.5353920644907257,y:0.006894662381854655},{x:0.543833754456429,y:0.009455421036992116},{x:0.5516136604858821,y:0.013613867446385479},{x:0.5584328051533947,y:0.019210194846605383},{x:0.5640291325536145,y:0.026029339514117924},{x:0.5681875789630079,y:0.03380924554357098},{x:0.5707483376181454,y:0.04225093550927425},{x:0.571613,y:0.05103000000000002},{x:0.5707483376181454,y:0.05980906449072579},{x:0.5681875789630079,y:0.06825075445642906},{x:0.5640291325536145,y:0.07603066048588211},{x:0.5584328051533947,y:0.08284980515339466},{x:0.5516136604858821,y:0.08844613255361455},{x:0.543833754456429,y:0.09260457896300792},{x:0.5353920644907257,y:0.09516533761814538},{x:0.526613,y:0.09603000000000002},{x:0.12043999999999999,y:0.09603000000000002},{x:0.12043999999999999,y:0.729004},{x:0.11957533761814536,y:0.7377830644907257},{x:0.11701457896300788,y:0.746224754456429},{x:0.11285613255361453,y:0.7540046604858821},{x:0.10725980515339463,y:0.7608238051533946},{x:0.10044066048588207,y:0.7664201325536145},{x:0.09266075445642903,y:0.7705785789630079},{x:0.08421906449072576,y:0.7731393376181454},{x:0.07544,y:0.774004},{x:0.06666093550927422,y:0.7731393376181454},{x:0.05821924554357093,y:0.7705785789630079},{x:0.05043933951411791,y:0.7664201325536145},{x:0.043620194846605356,y:0.7608238051533946},{x:0.03802386744638545,y:0.7540046604858821},{x:0.03386542103699209,y:0.746224754456429},{x:0.03130466238185463,y:0.7377830644907257},{x:0.030439999999999995,y:0.729004},{x:0.030439999999999995,y:0.05103000000000002}]],M:[[{x:-0.0025190000000000004,y:0.05103000000000002},{x:-0.001654337618145367,y:0.04225093550927423},{x:0.0009064210369920944,y:0.03380924554357098},{x:0.005064867446385457,y:0.026029339514117924},{x:0.010661194846605361,y:0.019210194846605383},{x:0.017480339514117912,y:0.013613867446385479},{x:0.02526024554357096,y:0.009455421036992116},{x:0.03370193550927423,y:0.006894662381854655},{x:0.042481,y:0.0060300000000000215},{x:0.051260064490725774,y:0.006894662381854655},{x:0.05970175445642904,y:0.009455421036992116},{x:0.06748166048588208,y:0.013613867446385486},{x:0.07430080515339463,y:0.019210194846605383},{x:0.07989713255361454,y:0.026029339514117924},{x:0.0840555789630079,y:0.03380924554357098},{x:0.08661633761814536,y:0.04225093550927425},{x:0.087481,y:0.05103000000000002},{x:0.087481,y:0.5631122522964573},{x:0.26219554141599577,y:0.26476777519375044},{x:0.26376288989624813,y:0.2626088267569117},{x:0.2651577075441738,y:0.2603345964826191},{x:0.26634817172230724,y:0.2590477232579252},{x:0.26737807478439135,y:0.2576290804774607},{x:0.2693364970488442,y:0.25581739014918375},{x:0.271148193983327,y:0.2538589739959976},{x:0.27256684023788735,y:0.25282907571933333},{x:0.27385371747828813,y:0.25163861588213104},{x:0.27612795245761435,y:0.25024380590572387},{x:0.27828690618147356,y:0.24867646470811877},{x:0.2798792167324836,y:0.24794311979268302},{x:0.28137361418054185,y:0.2470265916026687},{x:0.2838762642998919,y:0.24610226374330602},{x:0.28629950743227456,y:0.24498622954453103},{x:0.28800429067823724,y:0.24457762002415934},{x:0.28964877947809164,y:0.24397024514568044},{x:0.29228366929688115,y:0.24355192080462856},{x:0.2948780779631802,y:0.2429300821730634},{x:0.29662982004000654,y:0.24286191068247276},{x:0.29836120340931876,y:0.24258703019148947},{x:0.3010270755894747,y:0.24269078533857608},{x:0.3036929481196057,y:0.24258703918410057},{x:0.30542433056167173,y:0.24286192551544342},{x:0.30717607240852984,y:0.24293010291506947},{x:0.3097704789772072,y:0.24355195029817853},{x:0.3124053673848756,y:0.24397028352732772},{x:0.31404985413590314,y:0.24457766395304856},{x:0.3157546360035206,y:0.24498627922405064},{x:0.3181778753712451,y:0.24610232159698525},{x:0.32068052237260675,y:0.24702665789836697},{x:0.32217491672899246,y:0.24794319112932822},{x:0.32376722480624953,y:0.2486765414159958},{x:0.3259261732430879,y:0.2502438898962479},{x:0.3282004035173809,y:0.2516387075441738},{x:0.329487276742075,y:0.2528291717223074},{x:0.3309059195225393,y:0.2538590747843914},{x:0.3327176098508159,y:0.2558174970488439},{x:0.33467602600400237,y:0.257629193983327},{x:0.3357059242806667,y:0.2590478402378874},{x:0.33689638411786893,y:0.2603347174782881},{x:0.3382911940942761,y:0.2626089524576143},{x:0.3398585352918812,y:0.26476790618147356},{x:0.514571,y:0.5631111449291359},{x:0.514571,y:0.05103000000000002},{x:0.5154356623818547,y:0.04225093550927423},{x:0.5179964210369922,y:0.03380924554357098},{x:0.5221548674463855,y:0.026029339514117924},{x:0.5277511948466054,y:0.019210194846605383},{x:0.5345703395141179,y:0.013613867446385479},{x:0.542350245543571,y:0.009455421036992116},{x:0.5507919355092743,y:0.006894662381854655},{x:0.559571,y:0.0060300000000000215},{x:0.5683500644907258,y:0.006894662381854655},{x:0.576791754456429,y:0.009455421036992116},{x:0.5845716604858822,y:0.013613867446385486},{x:0.5913908051533947,y:0.019210194846605383},{x:0.5969871325536146,y:0.026029339514117924},{x:0.6011455789630079,y:0.03380924554357098},{x:0.6037063376181454,y:0.04225093550927425},{x:0.6045710000000001,y:0.05103000000000002},{x:0.6045710000000001,y:0.729004},{x:0.6044399806971988,y:0.7303342613054065},{x:0.6044919608158994,y:0.7316699481196056},{x:0.6040085293496043,y:0.7347148603514975},{x:0.6037063376181454,y:0.7377830644907257},{x:0.6033183147080721,y:0.7390622046001841},{x:0.6031087164726723,y:0.7403823673848756},{x:0.6020405410986152,y:0.7432744596816038},{x:0.6011455789630079,y:0.746224754456429},{x:0.6005154639484909,y:0.7474036167328832},{x:0.600052342101633,y:0.7486575223726067},{x:0.5984404722003996,y:0.7512856532491108},{x:0.5969871325536146,y:0.7540046604858821},{x:0.596139140401289,y:0.7550379419131618},{x:0.5954402924558263,y:0.7561774035173808},{x:0.5933466712837743,y:0.758440575377949},{x:0.5913908051533947,y:0.7608238051533946},{x:0.5903575237261146,y:0.7616717973057207},{x:0.589449806016673,y:0.7626530260040023},{x:0.5869548902613284,y:0.7644642664232344},{x:0.5845716604858822,y:0.7664201325536145},{x:0.5833927982094276,y:0.7670502475681318},{x:0.5823110938185264,y:0.7678355352918812},{x:0.579510761693201,y:0.7691252393162225},{x:0.576791754456429,y:0.7705785789630079},{x:0.5755126143469705,y:0.7709666018730812},{x:0.5742984925677255,y:0.7715257704554689},{x:0.5713003592655512,y:0.772244375482538},{x:0.5683500644907258,y:0.7731393376181454},{x:0.5670198031853202,y:0.7732703569209465},{x:0.5657199220368199,y:0.7735819178269366},{x:0.5626392041392276,y:0.7737018082685412},{x:0.559571,y:0.774004},{x:0.5582407386945936,y:0.7738729806971988},{x:0.5569050518803944,y:0.7739249608158993},{x:0.5538601396485026,y:0.7734415293496042},{x:0.5507919355092743,y:0.7731393376181454},{x:0.5495127953998159,y:0.772751314708072},{x:0.5481926326151244,y:0.7725417164726722},{x:0.5453005403183963,y:0.7714735410986151},{x:0.542350245543571,y:0.7705785789630079},{x:0.5411713832671168,y:0.7699484639484908},{x:0.5399174776273933,y:0.769485342101633},{x:0.5372893467508892,y:0.7678734722003996},{x:0.5345703395141179,y:0.7664201325536145},{x:0.5335370580868383,y:0.765572140401289},{x:0.5323975964826192,y:0.7648732924558262},{x:0.5301344246220511,y:0.7627796712837742},{x:0.5277511948466054,y:0.7608238051533946},{x:0.5269032026942794,y:0.7597905237261146},{x:0.5259219739959977,y:0.7588828060166729},{x:0.5241107335767656,y:0.7563878902613284},{x:0.5221548674463855,y:0.7540046604858821},{x:0.5215247524318682,y:0.7528257982094275},{x:0.5207394647081188,y:0.7517440938185264},{x:0.30102684980758887,y:0.3765575080608823},{x:0.08131245858400418,y:0.7517442248062496},{x:0.0805272117946797,y:0.752825865136849},{x:0.07989713255361454,y:0.7540046604858821},{x:0.07794121846393844,y:0.7563879486998997},{x:0.0761299252156086,y:0.7588829195225393},{x:0.07514874916275306,y:0.7597905823884902},{x:0.07430080515339463,y:0.7608238051533946},{x:0.0719175169393771,y:0.7627797192430708},{x:0.06965428252171184,y:0.764873384117869},{x:0.06851488325078628,y:0.7655721885442563},{x:0.06748166048588208,y:0.7664201325536145},{x:0.06476258657702469,y:0.7678735078373721},{x:0.06213438581945812,y:0.7694854083973313},{x:0.06088054980546198,y:0.7699484997219428},{x:0.05970175445642904,y:0.7705785789630079},{x:0.056751387338174995,y:0.7714735630437544},{x:0.05385922052190834,y:0.7725417548543195},{x:0.05253913197970031,y:0.7727513367372549},{x:0.051260064490725774,y:0.7731393376181454},{x:0.04819178511684276,y:0.773441536759571},{x:0.0451467965906812,y:0.7739249698085104},{x:0.04381118578262464,y:0.7738729881355436},{x:0.042481,y:0.774004},{x:0.039412720626117295,y:0.7737018008585744},{x:0.03633192759147018,y:0.7735818970849305},{x:0.035032121291898165,y:0.7732703494826018},{x:0.03370193550927423,y:0.7731393376181454},{x:0.030751568391020223,y:0.7722443535373988},{x:0.02775336399647938,y:0.7715257207759494},{x:0.026539313032545114,y:0.7709665798438982},{x:0.02526024554357096,y:0.7705785789630079},{x:0.02254117163471342,y:0.7691252036792503},{x:0.01974077519375046,y:0.7678354585840041},{x:0.01865913486315115,y:0.7670502117946798},{x:0.017480339514117912,y:0.7664201325536145},{x:0.015097051300099952,y:0.7644642184639381},{x:0.012602080477460715,y:0.7626529252156086},{x:0.011694417611510011,y:0.7616717491627533},{x:0.010661194846605361,y:0.7608238051533946},{x:0.008705280756928618,y:0.7584405169393763},{x:0.006611615882131057,y:0.7561772825217118},{x:0.005912811455744052,y:0.7550378832507868},{x:0.005064867446385457,y:0.7540046604858821},{x:0.0036114921626275165,y:0.7512855865770239},{x:0.0019995916026687363,y:0.7486573858194581},{x:0.0015365002780573323,y:0.7474035498054622},{x:0.0009064210369920944,y:0.746224754456429},{x:0.000011436956245516774,y:0.7432743873381747},{x:-0.0010567548543195318,y:0.7403822205219084},{x:-0.0012663367372549837,y:0.7390621319797002},{x:-0.001654337618145367,y:0.7377830644907257},{x:-0.0019565367595708303,y:0.7347147851168438},{x:-0.0024399698085105087,y:0.7316697965906812},{x:-0.0023879881355436095,y:0.730334185782624},{x:-0.0025190000000000004,y:0.729004},{x:-0.0025190000000000004,y:0.05103000000000002}]],N:[[{x:0.022871000000000002,y:0.05103000000000002},{x:0.023735662381854636,y:0.04225093550927423},{x:0.026296421036992097,y:0.03380924554357098},{x:0.03045486744638546,y:0.026029339514117924},{x:0.036051194846605364,y:0.019210194846605383},{x:0.042870339514117915,y:0.013613867446385479},{x:0.05065024554357096,y:0.009455421036992116},{x:0.05909193550927423,y:0.006894662381854655},{x:0.067871,y:0.0060300000000000215},{x:0.07665006449072577,y:0.006894662381854655},{x:0.08509175445642904,y:0.009455421036992116},{x:0.0928716604858821,y:0.013613867446385486},{x:0.09969080515339464,y:0.019210194846605383},{x:0.10528713255361455,y:0.026029339514117924},{x:0.10944557896300791,y:0.03380924554357098},{x:0.11200633761814537,y:0.04225093550927425},{x:0.112871,y:0.05103000000000002},{x:0.112871,y:0.5841703094604355},{x:0.49710429367778214,y:0.025528669675955993},{x:0.4971050718109503,y:0.02552774709009411},{x:0.49710565506134197,y:0.025526690456344234},{x:0.49994880496714983,y:0.022156103119426583},{x:0.5027917749380927,y:0.01878536401177818},{x:0.5027927181072235,y:0.018784610959395015},{x:0.5027934962896407,y:0.018783688415073364},{x:0.5062395848358414,y:0.016032536999645196},{x:0.5096855265142521,y:0.01328120162562755},{x:0.5096865984738844,y:0.013280647046104224},{x:0.5096875416832135,y:0.013279894044071351},{x:0.5136041376200112,y:0.011253903755746949},{x:0.5175206253992491,y:0.009227704391234041},{x:0.5175217849545753,y:0.009227369596750634},{x:0.5175228569438108,y:0.00922681507445236},{x:0.5217594476858983,y:0.008003843583871996},{x:0.5259959731369073,y:0.006780645934087934},{x:0.5259971757268666,y:0.006780543790608634},{x:0.5259983353000632,y:0.006780209058025982},{x:0.5303921110410749,y:0.006407254473822295},{x:0.5347858668666982,y:0.00603406533837119},{x:0.5347870662764328,y:0.00603419977121261},{x:0.5347882688718429,y:0.006034097691931008},{x:0.5391703792739257,y:0.006525492449663053},{x:0.5435525159020149,y:0.007016653277689966},{x:0.5435536660388816,y:0.007017019120673398},{x:0.543554865441438,y:0.007017153617542397},{x:0.547756908459233,y:0.008354013692199154},{x:0.5519590228368241,y:0.009690649448577907},{x:0.5519600795017079,y:0.0096912326425627},{x:0.551961229619043,y:0.009691598546943021},{x:0.555821723096155,y:0.01182254915564361},{x:0.559682330324044,y:0.013953293677782128},{x:0.5596832529099061,y:0.01395407181095043},{x:0.5596843095436558,y:0.013954655061341997},{x:0.5630548968806759,y:0.016797804967236304},{x:0.5664256359882218,y:0.01964077493809272},{x:0.5664263890406048,y:0.019641718107223288},{x:0.5664273115849267,y:0.019642496289640633},{x:0.5691784630004857,y:0.02308858483600535},{x:0.5719297983743725,y:0.026534526514252196},{x:0.5719303529538958,y:0.0265355984738845},{x:0.5719311059559287,y:0.0265365416832135},{x:0.5739570962443242,y:0.03045313762014873},{x:0.575983295608766,y:0.03436962539924916},{x:0.5759836304032494,y:0.03437078495457533},{x:0.5759841849255477,y:0.0343718569438108},{x:0.5772071564160691,y:0.03860844768569421},{x:0.5784303540659121,y:0.04284497313690728},{x:0.5784304562093915,y:0.04284617572686688},{x:0.578430790941974,y:0.042847335300063204},{x:0.5788037455260991,y:0.04724111104014873},{x:0.5791769346616289,y:0.05163486686669809},{x:0.5791768002287875,y:0.05163606627643281},{x:0.5791769023080691,y:0.05163726887184294},{x:0.5700269023080691,y:0.7296112688718429},{x:0.5690438463824576,y:0.738377865441438},{x:0.566369401453057,y:0.746784229619043},{x:0.5621063449386581,y:0.7545073095436557},{x:0.5564185037103594,y:0.7612503115849266},{x:0.5495244583167865,y:0.7667541059559286},{x:0.5416891430561892,y:0.7708071849255477},{x:0.5332136646999368,y:0.773253790941974},{x:0.5244237311281571,y:0.773999902308069},{x:0.515657134558562,y:0.7730168463824576},{x:0.507250770380957,y:0.770342401453057},{x:0.49952769045634426,y:0.766079344938658},{x:0.4927846884150734,y:0.7603915037103594},{x:0.4872808940440714,y:0.7534974583167865},{x:0.4832278150744524,y:0.7456621430561892},{x:0.480781209058026,y:0.7371866646999369},{x:0.48003509769193103,y:0.7283967311281571},{x:0.48718300813543913,y:0.19876859615253395},{x:0.10494770632221789,y:0.754505330324044},{x:0.1022980223560627,y:0.75764690179997},{x:0.09969080515339464,y:0.7608238051533946},{x:0.09945603456444842,y:0.7610164763964532},{x:0.09926022506190729,y:0.7612486359882218},{x:0.09604856383930557,y:0.7638129153509474},{x:0.0928716604858821,y:0.7664201325536145},{x:0.09260381265312083,y:0.7665633002029657},{x:0.09236647348574781,y:0.7667527983743725},{x:0.08871625734636118,y:0.7686412418060533},{x:0.08509175445642904,y:0.7705785789630079},{x:0.08480112262185491,y:0.7706667411661766},{x:0.08453137460075086,y:0.770806295608766},{x:0.08058287930375276,y:0.7719463312873718},{x:0.07665006449072577,y:0.7731393376181454},{x:0.07634781747275289,y:0.773169106351106},{x:0.07605602686309273,y:0.7732533540659121},{x:0.07196099086840901,y:0.7736011710596524},{x:0.067871,y:0.774004},{x:0.06756875298202693,y:0.7739742312670393},{x:0.06726613313330192,y:0.7739999346616289},{x:0.06318192637768459,y:0.7735421665584931},{x:0.05909193550927423,y:0.7731393376181454},{x:0.05880130367469977,y:0.7730511754149765},{x:0.05849948409798508,y:0.77301734672231},{x:0.054583060356599135,y:0.7717715852937818},{x:0.05065024554357096,y:0.7705785789630079},{x:0.0503823977108098,y:0.7704354113136568},{x:0.050092977163175983,y:0.7703433505514221},{x:0.04649484240404986,y:0.768357469710569},{x:0.042870339514117915,y:0.7664201325536145},{x:0.04263556892517204,y:0.7662274613105563},{x:0.04236966967595597,y:0.7660807063222179},{x:0.03922809820002561,y:0.7634310223560591},{x:0.036051194846605364,y:0.7608238051533946},{x:0.03585852360354703,y:0.7605890345644487},{x:0.035626364011778155,y:0.7603932250619073},{x:0.033062084649052234,y:0.7571815638393052},{x:0.03045486744638546,y:0.7540046604858821},{x:0.030311699797034096,y:0.7537368126531205},{x:0.03012220162562753,y:0.7534994734857478},{x:0.028233758193948882,y:0.7498492573463653},{x:0.026296421036992097,y:0.746224754456429},{x:0.026208258833823234,y:0.7459341226218545},{x:0.026068704391234022,y:0.7456643746007509},{x:0.02492866871262922,y:0.741715879303756},{x:0.023735662381854636,y:0.7377830644907257},{x:0.023705893648893955,y:0.7374808174727527},{x:0.023621645934087915,y:0.7371890268630927},{x:0.023273828940347806,y:0.7330939908684111},{x:0.022871000000000002,y:0.729004},{x:0.022871000000000002,y:0.05103000000000002}]],O:[[{x:0.012131736117046842,y:0.4355587711738732},{x:0.012426138979982786,y:0.43287355609157196},{x:0.012514983726773468,y:0.43017371170811375},{x:0.012905745911416293,y:0.42849911573111366},{x:0.01309315536666239,y:0.42678977537085305},{x:0.07316415536666239,y:0.1412837753708531},{x:0.07429915106219231,y:0.13768552483470178},{x:0.07533122192175289,y:0.13405641311271962},{x:0.07562440736087628,y:0.1334840955199844},{x:0.07581784742995093,y:0.1328708369543332},{x:0.07763301835724021,y:0.12956315246900071},{x:0.0793532628391043,y:0.12620512014747703},{x:0.07975246842568721,y:0.12570099711853563},{x:0.0800618324091279,y:0.12513726042963025},{x:0.08248742256740031,y:0.1222472544549173},{x:0.0848297326408542,y:0.1192893488327618},{x:0.1660597326408542,y:0.03517334883276172},{x:0.16792084009780786,y:0.033590824390739155},{x:0.16963596886504836,y:0.031851158363102774},{x:0.17127304088861567,y:0.03074040344046043},{x:0.172780173663761,y:0.0294588683817891},{x:0.1749142556657825,y:0.0282698357562587},{x:0.17693582072022015,y:0.026898201947035502},{x:0.17875813439943417,y:0.026128166777013812},{x:0.18048632312818114,y:0.025165283073572443},{x:0.1828113681007397,y:0.02441543612151622},{x:0.18506168183103927,y:0.023464545648773483},{x:0.2739246818310393,y:-0.0041824543512264944},{x:0.2748960678404206,y:-0.004382857312604547},{x:0.27582577451608603,y:-0.004728396924478621},{x:0.2792086173377598,y:-0.005272563034129881},{x:0.28256427991205235,y:-0.0059648570457577},{x:0.28355609768991147,y:-0.005971901311054349},{x:0.2845353517466465,y:-0.006129424701440567},{x:0.287959355733624,y:-0.0060031749164705245},{x:0.2913856000541485,y:-0.006027509400590186},{x:0.29235973459950004,y:-0.005840924262640544},{x:0.29335090385307644,y:-0.005804377895986514},{x:0.3811419038530764,y:0.006122622104013507},{x:0.38318930529213563,y:0.00660893405691686},{x:0.3852758334501729,y:0.006882342567970358},{x:0.387470347489584,y:0.0076257947232155985},{x:0.38972465411174423,y:0.008161252125438313},{x:0.3916378405507577,y:0.009037647936572414},{x:0.39363093730084414,y:0.009712864429997858},{x:0.3956382440479665,y:0.010870159811164118},{x:0.3977447722434711,y:0.011835121954387393},{x:0.39945022100051475,y:0.01306792222421872},{x:0.4012732927522862,y:0.01411899850883961},{x:0.4916652927522862,y:0.07880999850883955},{x:0.49276799959381884,y:0.07977586317754862},{x:0.49398769122063274,y:0.08058901093294302},{x:0.4960788615418114,y:0.08267585840574071},{x:0.4983012083703825,y:0.08462241954283417},{x:0.4991942961599152,y:0.08578485282556958},{x:0.5002319144966787,y:0.08682032620708877},{x:0.5018757798210403,y:0.08927504258220473},{x:0.5036756696393939,y:0.09161775945128844},{x:0.5043248175140242,y:0.09293208968889465},{x:0.5051404874699588,y:0.09415009603518716},{x:0.5560304874699588,y:0.18912209603518723},{x:0.5570965448702581,y:0.19168827319789875},{x:0.5583465570022521,y:0.1941700494329812},{x:0.5587848767756364,y:0.19575236841213633},{x:0.559414776433869,y:0.19726864147332673},{x:0.5599597135111237,y:0.1999934877429328},{x:0.5607015364856348,y:0.20267144261291137},{x:0.5892585364856349,y:0.36700144261291134},{x:0.5895780755292599,y:0.371318367211785},{x:0.589913428370686,y:0.37563409214099147},{x:0.5899036127276142,y:0.3757163259822715},{x:0.58990972616553,y:0.3757989176124618},{x:0.5893809351459178,y:0.38009523269056544},{x:0.5888678881103582,y:0.38439345626922305},{x:0.5314878881103581,y:0.6446844562692231},{x:0.5303800126922803,y:0.6480826863142071},{x:0.5293998170293023,y:0.651519919480997},{x:0.5290148883003433,y:0.6522699863013032},{x:0.5287535704445262,y:0.6530715368858165},{x:0.5270040207481954,y:0.6561883351212919},{x:0.5253720883446767,y:0.6593682961290664},{x:0.5248482251358019,y:0.6600288547560561},{x:0.5244355536676654,y:0.6607640231862051},{x:0.522111563906752,y:0.6634796128039058},{x:0.5198906090097624,y:0.6662800975344761},{x:0.4528876090097624,y:0.7355630975344761},{x:0.4513498405668143,y:0.7368687638478525},{x:0.44995999895015265,y:0.7383308981052339},{x:0.44799560298794544,y:0.7397167316507253},{x:0.4461630292013509,y:0.741272707045399},{x:0.44440008568631667,y:0.7422532816059559},{x:0.4427517012434998,y:0.743416176715023},{x:0.4405546878862334,y:0.7443921472166956},{x:0.43845377075029196,y:0.7455607075703166},{x:0.43653340109378364,y:0.7461785074476045},{x:0.43468982031452474,y:0.7469974740014746},{x:0.32025082031452473,y:0.7849044740014746},{x:0.3162756641960007,y:0.785800462676764},{x:0.3123143949565378,y:0.7867559771378485},{x:0.3119757732525013,y:0.7867696456410259},{x:0.3116451697261732,y:0.786844162718285},{x:0.30757159639863574,y:0.7869474207351895},{x:0.30350003021295163,y:0.7871117699623142},{x:0.30316524843732107,y:0.7870591140117537},{x:0.302826459804451,y:0.7870677017158569},{x:0.29881101440639224,y:0.7863742609266953},{x:0.29478561927964103,y:0.7857411290712295},{x:0.173234619279641,y:0.7541621290712296},{x:0.17180894449846637,y:0.7536379076298808},{x:0.17032768986057922,y:0.753301394035824},{x:0.16767817066393412,y:0.7521190197025511},{x:0.16495505208167519,y:0.7511177274253745},{x:0.16365904177145735,y:0.7503254433998781},{x:0.16227189957151614,y:0.7497064173758784},{x:0.15990395993272244,y:0.7480298664806163},{x:0.1574285077432372,y:0.7465165596726792},{x:0.15631196685338702,y:0.745486660093817},{x:0.15507224418821702,y:0.7446089104628228},{x:0.08487024418821705,y:0.6837459104628228},{x:0.08477922863788438,y:0.6836498346778195},{x:0.08467166808724909,y:0.6835727301071804},{x:0.08174665618590948,y:0.6804486588585436},{x:0.07880340242944883,y:0.6773417676286113},{x:0.07873287917322891,y:0.6772297816598538},{x:0.07864242772392874,y:0.6771331746094597},{x:0.07638309517198695,y:0.6734984900001298},{x:0.07410251962167697,y:0.6698770964908778},{x:0.07405519882875666,y:0.6697535038963435},{x:0.0739853324792622,y:0.6696411069209627},{x:0.07247850415964274,y:0.6656354878421232},{x:0.07094824805491862,y:0.6616387601752097},{x:0.07092594823683183,y:0.6615083105489945},{x:0.0708793519117729,y:0.6613844430013583},{x:0.013660351911772894,y:0.4476944430013583},{x:0.013380528959940628,y:0.4459977798389246},{x:0.012899536483696877,y:0.44434683677239306},{x:0.012664423003084308,y:0.4416557821956227},{x:0.012224847112815455,y:0.43899048181468664},{x:0.012281403443251489,y:0.4372718288093888},{x:0.012131736117046842,y:0.4355587711738732}],[{x:0.10337829031332789,y:0.4348001396911351},{x:0.15424861715004387,y:0.6247803934833692},{x:0.2060651876410252,y:0.6697037849792326},{x:0.3045603004668897,y:0.6952928559694175},{x:0.3958853477721772,y:0.6650421672339206},{x:0.4463402797077116,y:0.6128703383711886},{x:0.499069598507425,y:0.373676069990286},{x:0.47327322171072966,y:0.22523195474705573},{x:0.4307624349909165,y:0.1458974207255564},{x:0.35796896612556683,y:0.09380119213930618},{x:0.2911281310221294,y:0.08472041346861442},{x:0.22279798440939425,y:0.10597924519162948},{x:0.15856873728877424,y:0.17249047688925445},{x:0.10337829031332789,y:0.4348001396911351}]],P:[[{x:0.025556999999999996,y:0.05103000000000002},{x:0.02642166238185463,y:0.04225093550927423},{x:0.02898242103699209,y:0.03380924554357098},{x:0.033140867446385454,y:0.026029339514117924},{x:0.03873719484660536,y:0.019210194846605383},{x:0.04555633951411791,y:0.013613867446385479},{x:0.053336245543570956,y:0.009455421036992116},{x:0.061777935509274226,y:0.006894662381854655},{x:0.070557,y:0.0060300000000000215},{x:0.07933606449072576,y:0.006894662381854655},{x:0.08777775445642903,y:0.009455421036992116},{x:0.09555766048588209,y:0.013613867446385486},{x:0.10237680515339463,y:0.019210194846605383},{x:0.10797313255361454,y:0.026029339514117924},{x:0.1121315789630079,y:0.03380924554357098},{x:0.11469233761814536,y:0.04225093550927425},{x:0.11555699999999999,y:0.05103000000000002},{x:0.11555699999999999,y:0.3249696679740436},{x:0.22632413005583354,y:0.32573306868659574},{x:0.22797244585475993,y:0.3259068917113995},{x:0.2296296407459454,y:0.32587748916779646},{x:0.3399906407459454,y:0.3347734891677965},{x:0.3425199358315593,y:0.3352301100895628},{x:0.3450781711944775,y:0.33547763407671893},{x:0.4262801711944775,y:0.3514846340767189},{x:0.43023360415359113,y:0.35267647626036297},{x:0.4342017122431381,y:0.35381850872164355},{x:0.49034871224313803,y:0.3761405087216436},{x:0.49223471805815816,y:0.37711419756221787},{x:0.49421014578428074,y:0.3778905822551455},{x:0.4961445509948513,y:0.379132728294546},{x:0.49818726580808836,y:0.3801873213410173},{x:0.49984707528076383,y:0.38151024250532195},{x:0.5016330805772936,y:0.3826570960152846},{x:0.5368430805772937,y:0.4104950960152846},{x:0.538268982488492,y:0.41186995272090265},{x:0.539835277869678,y:0.41308244849417974},{x:0.5414366048100854,y:0.41492417879038607},{x:0.5431934850553138,y:0.4166181652891421},{x:0.5443237674236908,y:0.41824478417169497},{x:0.5456234206874699,y:0.41973955124896434},{x:0.546834674823181,y:0.4218582966024136},{x:0.5482273167355989,y:0.4238624839583804},{x:0.5490185434436073,y:0.4256783549664296},{x:0.5500016096439067,y:0.4273979502871872},{x:0.5725636096439066,y:0.4777629502871872},{x:0.5732747072201834,y:0.47988746499756846},{x:0.5741879174558705,y:0.48193325814034926},{x:0.5746713208988057,y:0.4840600657825243},{x:0.5753635933927087,y:0.4861283376286891},{x:0.5756465551694752,y:0.4883507586397718},{x:0.5761431038835471,y:0.49053540091990977},{x:0.5762022992770958,y:0.49271564988294925},{x:0.5764777701286589,y:0.49487923612929946},{x:0.5763217220435205,y:0.4971141570479765},{x:0.5763825271473633,y:0.4993536938878067},{x:0.5706825271473633,y:0.5794656938878067},{x:0.5700654182420953,y:0.5830779192715516},{x:0.5695689975224034,y:0.5867086990904052},{x:0.5693236589408173,y:0.5874197813867033},{x:0.5691969863455608,y:0.5881612549906394},{x:0.5678870248015591,y:0.5915836805014664},{x:0.5666918126627678,y:0.5950478490261242},{x:0.5415328126627678,y:0.6498468490261241},{x:0.5413708296623262,y:0.6501242105110185},{x:0.5412617638147841,y:0.650426323944409},{x:0.5391478795722351,y:0.653930540410781},{x:0.5370840246571379,y:0.6574644536133865},{x:0.536871043573226,y:0.6577048843594048},{x:0.5367051339883567,y:0.6579799150765678},{x:0.5339482287199508,y:0.661004400648547},{x:0.5312345979336611,y:0.6640677725799057},{x:0.5309788035098929,y:0.664262032968313},{x:0.5307624259999995,y:0.6644994116930277},{x:0.47414742599999943,y:0.7155204116930277},{x:0.47266946719886654,y:0.7166100541651699},{x:0.4713261182021025,y:0.7178618913781634},{x:0.46912758296129603,y:0.7192213498885075},{x:0.46704701478499566,y:0.7207552731949938},{x:0.4653848758470294,y:0.7215356430341334},{x:0.4638231175995642,y:0.7225013521577397},{x:0.4283261175995643,y:0.7398953521577398},{x:0.4243082080780145,y:0.7413960258251278},{x:0.4202985181688539,y:0.7429185254841078},{x:0.34090751816885384,y:0.7644395254841077},{x:0.3408415384597873,y:0.7644506164558663},{x:0.3407789202555512,y:0.7644741810938074},{x:0.33649241770984384,y:0.7651816893280429},{x:0.33220802793590354,y:0.7659018811363755},{x:0.33214115226719376,y:0.7658998869955335},{x:0.33207514002138977,y:0.7659107826399355},{x:0.2099811400213898,y:0.7739077826399355},{x:0.20641155146718015,y:0.773790767187745},{x:0.20284008504333162,y:0.7738075792583221},{x:0.0663570850433316,y:0.7610135792583221},{x:0.06408313636872824,y:0.7605723800858132},{x:0.061777935509274226,y:0.7603453376181454},{x:0.05976354040438703,y:0.759734277543603},{x:0.05769704052657306,y:0.7593333282846051},{x:0.05555285882676713,y:0.7584569812513055},{x:0.053336245543570956,y:0.7577845789630079},{x:0.05147976838249502,y:0.7567922712467745},{x:0.04953119704042999,y:0.7559958719887517},{x:0.04759918201567506,y:0.7547180546196904},{x:0.04555633951411791,y:0.7536261325536145},{x:0.043929123673028744,y:0.7522907110247322},{x:0.04217336337061703,y:0.7511294669445447},{x:0.04052776127482757,y:0.7494992850446065},{x:0.03873719484660536,y:0.7480298051533947},{x:0.037401773317722896,y:0.7464025893123053},{x:0.03590629693874444,y:0.7449211263687215},{x:0.034610347337597366,y:0.7430012269141045},{x:0.033140867446385454,y:0.7412106604858821},{x:0.032148559730151835,y:0.7393541833248057},{x:0.030970837593177758,y:0.7376094333079335},{x:0.030074343103068113,y:0.7354735969579864},{x:0.02898242103699209,y:0.733430754456429},{x:0.028371360962449563,y:0.7314163593515414},{x:0.027556652268729623,y:0.729475372026062},{x:0.027094064670152376,y:0.7272056777739226},{x:0.02642166238185463,y:0.7249890644907258},{x:0.02621533264498147,y:0.722894163516222},{x:0.025794946192721373,y:0.7208315299365354},{x:0.02578404246766777,y:0.7185152008594541},{x:0.025556999999999996,y:0.71621},{x:0.025556999999999996,y:0.05103000000000002}],[{x:0.11555699999999999,y:0.414971805397996},{x:0.11555699999999999,y:0.6752310456989574},{x:0.20767337575712835,y:0.6838660911730216},{x:0.3217031184787672,y:0.6763972896549704},{x:0.3925929523867085,y:0.6571807523203506},{x:0.4185706758911827,y:0.6444513238436673},{x:0.46361487793542,y:0.6038578374443203},{x:0.4814895996448674,y:0.5649247767123354},{x:0.48580725170954087,y:0.5042413131675768},{x:0.4723746184159119,y:0.474255736718963},{x:0.45098032059796866,y:0.45734081304228297},{x:0.40480552914494095,y:0.4389833995595593},{x:0.3301954695220376,y:0.42427584033215343},{x:0.22404845814303564,y:0.41571952231013837},{x:0.11555699999999999,y:0.414971805397996}]],Q:[[{x:0.012134510452571898,y:0.39776120903599943},{x:0.012467756958298536,y:0.3937322544040442},{x:0.012734737801221134,y:0.38969836671479857},{x:0.012831073490929856,y:0.38933975275179394},{x:0.012861682585025715,y:0.38896968840207613},{x:0.0716656825850257,y:0.06709568840207614},{x:0.07243605319674906,y:0.06440524795975149},{x:0.07301096718930201,y:0.06166637692330789},{x:0.07364750148994079,y:0.06017438890024393},{x:0.07409402290033937,y:0.05861495861744442},{x:0.07537446994903126,y:0.05612650608452361},{x:0.07647266436288541,y:0.053552421842995857},{x:0.07738804025928744,y:0.05221328363312273},{x:0.0781302116420243,y:0.05077092937167972},{x:0.07987152826568633,y:0.04858009458346291},{x:0.08145080010539194,y:0.04626971775068952},{x:0.16096480010539196,y:-0.04855928224931053},{x:0.16315500529851779,y:-0.05070373085173594},{x:0.16521251383898505,y:-0.052975804178533654},{x:0.1663001767861927,y:-0.05378319510572523},{x:0.1672680674520078,y:-0.05473086511953138},{x:0.1698345496348827,y:-0.056406820906963286},{x:0.172295783242646,y:-0.058233836978172464},{x:0.17352006120728586,y:-0.058813521600477286},{x:0.17465423537351554,y:-0.059554156299027654},{x:0.17749836607515132,y:-0.06069721323044178},{x:0.18026874092294012,y:-0.06200896084304842},{x:0.2672567409229401,y:-0.09317596084304836},{x:0.2695830047845554,y:-0.09375972267138269},{x:0.2718475349769373,y:-0.09454977610873284},{x:0.2738508793967248,y:-0.09483071995927067},{x:0.27581299058749986,y:-0.09532309988014809},{x:0.2782084422243766,y:-0.09544181332278269},{x:0.28058359188359605,y:-0.09577489818042065},{x:0.2826032520283714,y:-0.0956596106656824},{x:0.28462372036011635,y:-0.09575974074040533},{x:0.28699630390923414,y:-0.09540884370631499},{x:0.2893907973658866,y:-0.09527215971995788},{x:0.3753267973658866,y:-0.08182715971995795},{x:0.37840631600914065,y:-0.08102976437129623},{x:0.38152495221950905,y:-0.08040256216817918},{x:0.38266795913198753,y:-0.07992627554804835},{x:0.3838666954562622,y:-0.07961588068444121},{x:0.38673147789694834,y:-0.07823302278004476},{x:0.38966782930723504,y:-0.07700945634885908},{x:0.3906959547522998,y:-0.07631933185595965},{x:0.3918111026603398,y:-0.07578103928710583},{x:0.3943510569158511,y:-0.07386586128072498},{x:0.3969922811880835,y:-0.07209295159323717},{x:0.45217017177581864,y:-0.026613783173476364},{x:0.5097585536672307,y:-0.09873256043298734},{x:0.5159122791302333,y:-0.10505326271144577},{x:0.5231808703268614,y:-0.11005198218579294},{x:0.5312849993737013,y:-0.11353662086994384},{x:0.5399132291363312,y:-0.11537326605347448},{x:0.5487339815837399,y:-0.1154913364919842},{x:0.5574082801461085,y:-0.11388629480473579},{x:0.5656027763942881,y:-0.11061982184365243},{x:0.5730025604329874,y:-0.10581744633276943},{x:0.5793232627114457,y:-0.0996637208697668},{x:0.5843219821857929,y:-0.09239512967313873},{x:0.5878066208699438,y:-0.08429100062629874},{x:0.5896432660534744,y:-0.07566277086366895},{x:0.5897613364919841,y:-0.06684201841626024},{x:0.5881562948047357,y:-0.058167719853891554},{x:0.5848898218436525,y:-0.04997322360571205},{x:0.5800874463327694,y:-0.042573439567012816},{x:0.5106129498444961,y:0.04443049374200151},{x:0.5474711182959175,y:0.12365010382899572},{x:0.5481373073434039,y:0.1255496832776173},{x:0.5490025186311253,y:0.12736726941208848},{x:0.5495935209593992,y:0.1297019482663393},{x:0.5503905347901464,y:0.13197456307270286},{x:0.5506733336355601,y:0.13396760967066554},{x:0.5511673266667299,y:0.13591906574595297},{x:0.5791213266667299,y:0.32118306574595296},{x:0.5792865967797204,y:0.3243841932678159},{x:0.5796238248970751,y:0.32757179562983435},{x:0.579513579388425,y:0.3287806341158348},{x:0.5795761658223595,y:0.3299928748079828},{x:0.5791137513174164,y:0.3331647361616822},{x:0.5788226293197903,y:0.33635687958013644},{x:0.5226546293197903,y:0.6297998795801365},{x:0.5219105438778229,y:0.6323181740447382},{x:0.521369234544533,y:0.6348876981954499},{x:0.5206636104444891,y:0.6365383151545928},{x:0.5201549436340621,y:0.6382598551025291},{x:0.5189338607071872,y:0.6405845973766512},{x:0.5179016631869613,y:0.6429991446291672},{x:0.5168875780620563,y:0.6444803850133782},{x:0.5160528293589531,y:0.6460696100820955},{x:0.5144016744792594,y:0.6481114616238732},{x:0.5129182555439367,y:0.6502782422813739},{x:0.4473292555439367,y:0.7283852422813738},{x:0.4454767413796947,y:0.7301964293264013},{x:0.4437773055972873,y:0.732151966404103},{x:0.44233025961343425,y:0.7332727172827731},{x:0.4410215211764534,y:0.7345522595114605},{x:0.4388512574885805,y:0.735967237520439},{x:0.4368029695300015,y:0.737553656027496},{x:0.4351650804791521,y:0.7383705673253327},{x:0.43363186277883553,y:0.7393702013057781},{x:0.431227251583759,y:0.7403345934673514},{x:0.4289088260065632,y:0.7414909282302113},{x:0.3168848260065632,y:0.7842309282302113},{x:0.31544522398579106,y:0.7846236280557255},{x:0.31406876767085296,y:0.7851998529634103},{x:0.3111991137964475,y:0.7857818972901452},{x:0.30837424253549156,y:0.7865524758495462},{x:0.30688569012846406,y:0.7866567776362199},{x:0.305423266132861,y:0.7869533972381565},{x:0.30249520063786056,y:0.7869644160479279},{x:0.2995742760667897,y:0.7871690831124285},{x:0.29809397750772,y:0.7869809786010931},{x:0.2966017859654652,y:0.7869865939723252},{x:0.2937278327647654,y:0.7864261638184524},{x:0.2908231043767717,y:0.786057054147543},{x:0.2894079467091229,y:0.7855837720890787},{x:0.28794333170435554,y:0.785298167434039},{x:0.16895933170435556,y:0.7496931674340391},{x:0.16685145995859063,y:0.7488293371508981},{x:0.16467103610787698,y:0.748169732810473},{x:0.1627799564873854,y:0.7471607878174731},{x:0.16079664289106937,y:0.7463480029082842},{x:0.1588977982379503,y:0.7450895455041626},{x:0.15688795304330724,y:0.7440172356850165},{x:0.15523004539103946,y:0.7426587459550258},{x:0.15344340707901263,y:0.7414746531917952},{x:0.15182656105367498,y:0.739869930478983},{x:0.1500645317387979,y:0.7384261234461069},{x:0.08134353173879794,y:0.6698101234461069},{x:0.07898814712174665,y:0.6669445493412297},{x:0.07654417665723892,y:0.6641541443502993},{x:0.0761910053095167,y:0.6635415309608049},{x:0.07574199244846258,y:0.6629952594015535},{x:0.07399091166125166,y:0.6597252337561722},{x:0.07213828241215867,y:0.6565116506297859},{x:0.07191141209628055,y:0.6558419081228384},{x:0.07157759918584938,y:0.6552185349547689},{x:0.07049811528111428,y:0.6516697230205841},{x:0.06930802275051184,y:0.6481564579560907},{x:0.013298022750511833,y:0.4072474579560906},{x:0.013249789700227431,y:0.40687927578320093},{x:0.013136451320225305,y:0.40652566731159423},{x:0.012677284531251238,y:0.4025091147450468},{x:0.012152162963867598,y:0.3985006516980174},{x:0.01217668547678935,y:0.39813013424102855},{x:0.012134510452571898,y:0.39776120903599943}],[{x:0.1030741934540208,y:0.3959601630333355},{x:0.15405220468618464,y:0.6152256818322884},{x:0.20562817178182732,y:0.6667228451191239},{x:0.2990925609035841,y:0.6946913078929434},{x:0.38591644511804135,y:0.6615657918309754},{x:0.4364618489221904,y:0.6013735361946543},{x:0.4889800495366121,y:0.3269984766785998},{x:0.4631403994395801,y:0.1557472448128009},{x:0.4478929247459949,y:0.12297570323093639},{x:0.3763894463327694,y:0.21252056043298723},{x:0.3702357208697667,y:0.2188412627114457},{x:0.36296712967313866,y:0.22383998218579282},{x:0.35486300062629866,y:0.22732462086994373},{x:0.34623477086366883,y:0.22916126605347437},{x:0.3374140184162602,y:0.2292793364919841},{x:0.3287397198538915,y:0.22767429480473567},{x:0.32054522360571197,y:0.22440782184365232},{x:0.31314543956701274,y:0.21960544633276935},{x:0.3068247372885543,y:0.2134517208697667},{x:0.30182601781420715,y:0.20618312967313862},{x:0.2983413791300562,y:0.19807900062629863},{x:0.2965047339465256,y:0.18945077086366885},{x:0.29638666350801585,y:0.18063001841626014},{x:0.2979917051952643,y:0.17195571985389144},{x:0.30125817815634764,y:0.16376122360571194},{x:0.3060605536672306,y:0.1563614395670127},{x:0.3960043024488616,y:0.04372356068896105},{x:0.3492507773512258,y:0.005187991106938553},{x:0.28681342879982186,y:-0.004580559340762309},{x:0.22209853619564562,y:0.018606191220169738},{x:0.15806156000107346,y:0.09497717514193305},{x:0.1030741934540208,y:0.3959601630333355}]],R:[[{x:-0.010088,y:0.05588800000000005},{x:-0.009223337618145366,y:0.04710893550927426},{x:-0.006662578963007905,y:0.03866724554357101},{x:-0.0025041325536145423,y:0.030887339514117953},{x:0.0030921948466053617,y:0.024068194846605412},{x:0.009911339514117913,y:0.018471867446385508},{x:0.01769124554357096,y:0.014313421036992145},{x:0.02613293550927423,y:0.011752662381854684},{x:0.034912,y:0.01088800000000005},{x:0.043691064490725774,y:0.011752662381854684},{x:0.05213275445642904,y:0.014313421036992145},{x:0.059912660485882105,y:0.018471867446385515},{x:0.06673180515339464,y:0.024068194846605412},{x:0.07232813255361453,y:0.030887339514117953},{x:0.0764865789630079,y:0.03866724554357101},{x:0.07904733761814536,y:0.04710893550927428},{x:0.079912,y:0.05588800000000005},{x:0.079912,y:0.36648688236049143},{x:0.25933152798675563,y:0.3728389247505383},{x:0.2598033776805002,y:0.3702688775066002},{x:0.2630584474090824,y:0.36206984491555727},{x:0.26785052379396923,y:0.35466338703825},{x:0.5319365237939692,y:0.022999387038250052},{x:0.5380814500271169,y:0.016670129897313986},{x:0.5453430800394999,y:0.011661303295187019},{x:0.5534423534621115,y:0.008165393629206541},{x:0.5620680197594453,y:0.00631674674730745},{x:0.5708885994130244,y:0.006186405112428031},{x:0.5795651224933998,y:0.00777937768050025},{x:0.5877641550844427,y:0.011034447409082423},{x:0.59517061296175,y:0.015826523793969254},{x:0.601499870102686,y:0.021971450027116944},{x:0.606508696704813,y:0.02923308003949996},{x:0.6100046063707935,y:0.03733235346211146},{x:0.6118532532526926,y:0.04595801975944533},{x:0.6119835948875719,y:0.05477859941302443},{x:0.6103906223194997,y:0.06345512249339977},{x:0.6071355525909176,y:0.07165415508444274},{x:0.6023434762060308,y:0.07906061296174999},{x:0.36492288462028066,y:0.3772356888373974},{x:0.45122307475864126,y:0.3907421966461853},{x:0.4517263325772421,y:0.3908725352482557},{x:0.4522445282141884,y:0.3909141268943158},{x:0.4559919550269364,y:0.3919772876167318},{x:0.459762859565968,y:0.3929539131315124},{x:0.46023101962685037,y:0.3931799280437793},{x:0.4607311441523136,y:0.39332181547170203},{x:0.5072261441523136,y:0.41160281547170213},{x:0.5099186672764574,y:0.4129799887569096},{x:0.5126912264123276,y:0.4141879634543456},{x:0.5138373975854011,y:0.41498434320238026},{x:0.5150799754049854,y:0.4156198976243936},{x:0.5174520892726079,y:0.41749589411441484},{x:0.5199357102894067,y:0.4192215573713852},{x:0.5536387102894067,y:0.4479225573713852},{x:0.5544422891842978,y:0.4487559165260936},{x:0.5553578681885658,y:0.44946439490120116},{x:0.5574982196806069,y:0.4519250983842071},{x:0.5597619879819907,y:0.4542727608851649},{x:0.5603875460278954,y:0.4552468777427617},{x:0.5611473151639865,y:0.4561203635073251},{x:0.5627664809673836,y:0.45895134712470415},{x:0.5645287453623273,y:0.46169553923588524},{x:0.5649522427143585,y:0.46277297903182424},{x:0.5655270044804562,y:0.4637779046177677},{x:0.5843050044804562,y:0.5056739046177676},{x:0.5856980535944053,y:0.5098331481877504},{x:0.5870956418010017,y:0.5139908687307394},{x:0.5870987900445207,y:0.5140153439302019},{x:0.587106627133701,y:0.514038743222053},{x:0.5876614810321307,y:0.5183898384933372},{x:0.5882210839336397,y:0.522740325535193},{x:0.5899430839336397,y:0.580600325535193},{x:0.589777587866933,y:0.5830153029012521},{x:0.5898269599494498,y:0.5854354407122341},{x:0.5894767504310368,y:0.5874052295805413},{x:0.5893399666658296,y:0.589401226848592},{x:0.5887065118476329,y:0.5917375144207835},{x:0.5882827897945603,y:0.5941207819778186},{x:0.5699357897945603,y:0.6593647819778187},{x:0.5695566600666073,y:0.6603356321127045},{x:0.5693270257483343,y:0.6613522723710545},{x:0.5679549854437747,y:0.6644370937206254},{x:0.5667268644118839,y:0.6675819841936177},{x:0.5661656160899001,y:0.668460215174679},{x:0.5657420574552864,y:0.6694125215424361},{x:0.5637945617300048,y:0.6721703971299327},{x:0.5619765010042908,y:0.6750152648867381},{x:0.5612547025465381,y:0.6757671267898905},{x:0.5606534967163777,y:0.6766185026674012},{x:0.5398464967163776,y:0.7006785026674012},{x:0.5387925287989109,y:0.70167944573824},{x:0.5378793324857355,y:0.7028102896247742},{x:0.535601038014175,y:0.7047103734673366},{x:0.5334498940671065,y:0.7067532939324781},{x:0.5322209035416287,y:0.707529385222465},{x:0.5311046373415733,y:0.7084603444980107},{x:0.5029396373415734,y:0.7276033444980106},{x:0.49917038563569516,y:0.7296565217962586},{x:0.49541206095977475,y:0.7317296332429761},{x:0.4611910609597748,y:0.7464366332429762},{x:0.457170688924302,y:0.7477143925092122},{x:0.45316143447737084,y:0.7490266191763204},{x:0.37177643447737085,y:0.7670666191763205},{x:0.36787988134157384,y:0.7675363076101905},{x:0.36399443936523473,y:0.7680904503837813},{x:0.2290834393652347,y:0.7739614503837813},{x:0.2260604581328276,y:0.7737959747883908},{x:0.2230330269857825,y:0.7738173839936113},{x:0.030818026985782503,y:0.7562573839936113},{x:0.028490934977474184,y:0.7558115802948838},{x:0.02613293550927423,y:0.7555793376181453},{x:0.024169339379190496,y:0.7549836872441402},{x:0.022154034015341384,y:0.7545976128723226},{x:0.01995862841458906,y:0.7537063820373993},{x:0.01769124554357096,y:0.7530185789630078},{x:0.01588158498580211,y:0.7520512952425895},{x:0.013980322522940947,y:0.7512794726091756},{x:0.012000971535783972,y:0.7499770641392344},{x:0.009911339514117913,y:0.7488601325536145},{x:0.008325158769029223,y:0.7475583876576994},{x:0.006611003657363959,y:0.7464304774736483},{x:0.004923772632206568,y:0.7447669421957904},{x:0.0030921948466053617,y:0.7432638051533946},{x:0.0017904499506900475,y:0.7416776244083056},{x:0.0003292762098528329,y:0.7402369716294513},{x:-0.001000995511218774,y:0.7382762382714833},{x:-0.0025041325536145423,y:0.7364446604858821},{x:-0.0034714162740331275,y:0.7346349999281129},{x:-0.004623456556617868,y:0.732936968032819},{x:-0.005545647377387794,y:0.7307543864780955},{x:-0.006662578963007905,y:0.728664754456429},{x:-0.007258229337013042,y:0.7267011583263452},{x:-0.008056863899357211,y:0.7248110017280808},{x:-0.008535534543753812,y:0.7224904473617442},{x:-0.009223337618145366,y:0.7202230644907257},{x:-0.009424464135908606,y:0.7181809926864091},{x:-0.009839001899660749,y:0.7161713490432334},{x:-0.009855757323261527,y:0.7138019994682},{x:-0.010088,y:0.711444},{x:-0.010088,y:0.05588800000000005}],[{x:0.079912,y:0.45654326739466394},{x:0.079912,y:0.6703676283824797},{x:0.22820062174801237,y:0.6839146886946046},{x:0.3561457472749752,y:0.6783468266821017},{x:0.42954781695254723,y:0.662076342723345},{x:0.4559144639404158,y:0.6507448714849071},{x:0.47563211893454127,y:0.6373433067928232},{x:0.48601322722124407,y:0.6253391992627579},{x:0.4997779385388953,y:0.5763903343143285},{x:0.4985264355495565,y:0.5343392524542002},{x:0.48755361344964526,y:0.5098575528750181},{x:0.467303195590932,y:0.4926125823096997},{x:0.43241084881177044,y:0.4788935374345549},{x:0.3509044963348569,y:0.4661372945522357},{x:0.079912,y:0.45654326739466394}]],S:[[{x:0.021897597226735628,y:0.20918252956592975},{x:0.022856530106274857,y:0.20041326151782815},{x:0.025507836686771486,y:0.19199957102060095},{x:0.07532383668677148,y:0.0752955710206009},{x:0.07606476437254353,y:0.07394451179196875},{x:0.07662717764446286,y:0.07250992955787258},{x:0.07818101321859919,y:0.07008559601860773},{x:0.07956562874320691,y:0.06756079148160443},{x:0.08055589829123208,y:0.06638024029801701},{x:0.0813873780598424,y:0.06508294454561242},{x:0.08338432112997196,y:0.06300833217803187},{x:0.0852348965856767,y:0.0608021661408081},{x:0.08643645249257384,y:0.05983749092219001},{x:0.08750504545666679,y:0.05872733599970995},{x:0.08986835462050304,y:0.05708217099364391},{x:0.09211377343035676,y:0.05527942517977789},{x:0.09348044057646428,y:0.05456769785378441},{x:0.09474508130770348,y:0.05368734639231786},{x:0.18347008130770348,y:0.00406434639231789},{x:0.18531117162778632,y:0.0032602675504258996},{x:0.18705570252460849,y:0.0022638899609980986},{x:0.18934358471290644,y:0.0014991491478438968},{x:0.19155425509545604,y:0.0005336596975895336},{x:0.19351683738147718,y:0.0001042099085839361},{x:0.19542223123106015,y:-0.0005326814704223887},{x:0.1978153459361366,y:-0.0008363843304376121},{x:0.20017189655491793,y:-0.0013520417748285815},{x:0.2021805498702545,y:-0.0013903589963945293},{x:0.20417358345551592,y:-0.0016432887864569548},{x:0.36640558345551594,y:-0.006196288786456984},{x:0.3683537351453612,y:-0.006059465175549666},{x:0.37030515940756886,y:-0.006136660097762148},{x:0.3727431942064551,y:-0.005751182385354602},{x:0.3752054496398049,y:-0.005578251970786187},{x:0.37708947517888647,y:-0.005063991846688501},{x:0.37901846335331396,y:-0.004758999502412188},{x:0.3813344490261288,y:-0.00390529164215812},{x:0.3837156558614866,y:-0.003255321831637216},{x:0.38546315320491126,y:-0.002383387922517842},{x:0.38729557535780434,y:-0.001707928996501587},{x:0.5134735753578044,y:0.059451071003498376},{x:0.5144073364238021,y:0.06002293670994077},{x:0.5154151369003129,y:0.060451046875811966},{x:0.5181619939873726,y:0.06232241135953579},{x:0.5209964106485654,y:0.06405830049148753},{x:0.5218006642926897,y:0.06480134570578519},{x:0.5227055800155168,y:0.06541784197435321},{x:0.5250345719141375,y:0.06778913394790613},{x:0.5274758708842278,y:0.07004463571609586},{x:0.5281197100899656,y:0.07093030562736781},{x:0.5288869656553633,y:0.07171149639276676},{x:0.5307085905129939,y:0.07449158843544039},{x:0.5326629540416582,y:0.07718002517181716},{x:0.5331216364294024,y:0.07817428398206286},{x:0.5337217466362741,y:0.07909014852127505},{x:0.5349660004312154,y:0.08217220325496363},{x:0.5363583234240663,y:0.08519025984344057},{x:0.5366142220868877,y:0.08625489874416871},{x:0.5370241250365293,y:0.08727024089657527},{x:0.5783351250365293,y:0.22800124089657534},{x:0.5784689928995229,y:0.22870739358153944},{x:0.5787167010683089,y:0.22938208824013706},{x:0.5792894483007394,y:0.23303529403132756},{x:0.5799781923062021,y:0.23666841715613338},{x:0.579971724381043,y:0.23738711763976203},{x:0.5800830465086156,y:0.23809717369609615},{x:0.5799320834693805,y:0.24179192160438975},{x:0.5798988062915618,y:0.2454896025769029},{x:0.5797522511369868,y:0.24619323160266243},{x:0.5797229091764134,y:0.2469113620006918},{x:0.5788540372904492,y:0.2505056649360105},{x:0.5781000177526308,y:0.2541258039501414},{x:0.5778190074010411,y:0.2547873214491718},{x:0.5776501289474114,y:0.2554859288404322},{x:0.5462891289474114,y:0.3454679288404322},{x:0.5453940585085517,y:0.34740151578805634},{x:0.5446999978282894,y:0.3494160105998292},{x:0.5435456407901493,y:0.3513945829466735},{x:0.5425833616033817,y:0.3534733584203385},{x:0.5413282655917657,y:0.35519517245680393},{x:0.5402545326513293,y:0.3570355547940282},{x:0.5387363559437135,y:0.3587509055417339},{x:0.537387017705137,y:0.36060200657115166},{x:0.5358201287566253,y:0.36204587934864135},{x:0.5344079865107593,y:0.36364142435019586},{x:0.5325843328131388,y:0.3650276335315076},{x:0.5308997898345437,y:0.36657992334222783},{x:0.5290813226127058,y:0.36769036763963614},{x:0.5273850388959807,y:0.368979759405903},{x:0.44286903889598056,y:0.42100375940590296},{x:0.4391930936098881,y:0.42279580082266366},{x:0.4355432374645799,y:0.42464039733796655},{x:0.4352309585303121,y:0.42472736117212373},{x:0.4349395777453148,y:0.4248694107387315},{x:0.430984654780085,y:0.42590987723258605},{x:0.42704506666901776,y:0.42700697873237736},{x:0.18802361397643091,y:0.46887992641475673},{x:0.1445277950559712,y:0.506325930968192},{x:0.1345999941059918,y:0.5433489412625321},{x:0.1668438673565076,y:0.6442112383308392},{x:0.2418447705661005,y:0.6964178007533797},{x:0.3847076342900009,y:0.6886954406015322},{x:0.4475324208368403,y:0.608018765726417},{x:0.4536085342974724,y:0.6016234190133417},{x:0.4608155671913789,y:0.5965363480257236},{x:0.46887655728619765,y:0.5929530460487544},{x:0.47748172525324006,y:0.5910112173678703},{x:0.48630037931336645,y:0.5907854853702875},{x:0.49499362353660437,y:0.5922845248100812},{x:0.5032273814226823,y:0.5954507284422511},{x:0.5106852342735829,y:0.6001624208368403},{x:0.5170805809866582,y:0.6062385342974724},{x:0.5221676519742764,y:0.6134455671913789},{x:0.5257509539512455,y:0.6215065572861976},{x:0.5276927826321296,y:0.63011172525324},{x:0.5279185146297124,y:0.6389303793133664},{x:0.5264194751899187,y:0.6476236235366044},{x:0.5232532715577489,y:0.6558573814226824},{x:0.5185415791631597,y:0.663315234273583},{x:0.4431175791631597,y:0.760171234273583},{x:0.4420344490669973,y:0.7613112710002186},{x:0.44110391182703096,y:0.7625789282836855},{x:0.4390031114098716,y:0.7645018722698176},{x:0.4370414657025276,y:0.7665665809866583},{x:0.43575673751534005,y:0.767473404028016},{x:0.4345967726198766,y:0.768535164822443},{x:0.4321611907321885,y:0.7700113141492059},{x:0.4298344328086211,y:0.7716536519742764},{x:0.42839747791415833,y:0.7722924126294288},{x:0.42705266216361437,y:0.7731074740629288},{x:0.4243758968514515,y:0.7740801011395291},{x:0.42177344271380235,y:0.7752369539512456},{x:0.4202394824828045,y:0.7755831050064366},{x:0.4187614963922926,y:0.7761201447252115},{x:0.4159464142454535,y:0.7765518720385514},{x:0.41316827474676,y:0.7771787826321297},{x:0.4115962584106506,y:0.7772190216964318},{x:0.4100419001567639,y:0.7774574015652649},{x:0.23125890015676387,y:0.7871214015652648},{x:0.22961427991333744,y:0.7870487065186679},{x:0.22797320559841586,y:0.7871788426312305},{x:0.22521775007366066,y:0.7868543723294609},{x:0.22244596265035355,y:0.7867318545526676},{x:0.22084712542379714,y:0.7863397068281228},{x:0.21921219559556868,y:0.7861471846952227},{x:0.21657298639174055,y:0.7852913862936938},{x:0.21387836011908076,y:0.7846304737606538},{x:0.21238674832737245,y:0.7839339433752962},{x:0.2108207924222569,y:0.7834261615145331},{x:0.2083992528689725,y:0.782071922865878},{x:0.2058853407234555,y:0.7808980140745921},{x:0.20455827617124617,y:0.7799238683005129},{x:0.20312147299647784,y:0.7791203404840283},{x:0.10291447299647782,y:0.7093683404840284},{x:0.10181255131472464,y:0.7084283417469311},{x:0.10059641238964509,y:0.7076416809983432},{x:0.09846400643554813,y:0.7055718520256913},{x:0.09620311784593605,y:0.7036431918911783},{x:0.09530575393663021,y:0.7025062807105057},{x:0.09426645267874648,y:0.7014974784931097},{x:0.09257882390791694,y:0.6990514089395268},{x:0.09073764058529563,y:0.6967187299857058},{x:0.09007931964022471,y:0.6954285972205445},{x:0.08925679581402991,y:0.6942364212378118},{x:0.08807879885369768,y:0.6915081121844703},{x:0.08672807644060793,y:0.6888610579553555},{x:0.08633409736450004,y:0.6874672826843552},{x:0.08575996009935855,y:0.6861375475907227},{x:0.04484896009935855,y:0.5581635475907226},{x:0.04400698871411546,y:0.5542371548008082},{x:0.04309586967447821,y:0.5503262293029391},{x:0.04308290316808571,y:0.5499278363503387},{x:0.04299932697019912,y:0.5495380927241992},{x:0.04293953506277818,y:0.5455228840020936},{x:0.042808906634767226,y:0.5415093553341928},{x:0.04287391188557095,y:0.5411160877505585},{x:0.04286797679041901,y:0.5407175280315513},{x:0.04359266213029085,y:0.5367678055966908},{x:0.04424754429113727,y:0.532805911414652},{x:0.06119154429113727,y:0.4696179114146519},{x:0.06126294463056804,y:0.4694283141856516},{x:0.06129777501412092,y:0.46922873472253734},{x:0.06281676603792068,y:0.46530228011432895},{x:0.0643004966052513,y:0.46136236601319713},{x:0.0644075135916399,y:0.46119034135699993},{x:0.06448061074086608,y:0.46100139182805006},{x:0.06673642807197144,y:0.45744672339211917},{x:0.06896028828319853,y:0.453871975109843},{x:0.06909880931377366,y:0.45372413383751425},{x:0.06920736414622189,y:0.4535530754671619},{x:0.07211331798967527,y:0.4505067971180214},{x:0.07499184614403663,y:0.4474345902263458},{x:0.07515654793327702,y:0.4473166137950705},{x:0.07529638874761438,y:0.44717002026055797},{x:0.1386943887476144,y:0.392590020260558},{x:0.14135607757337018,y:0.39071931904916735},{x:0.1439175788350931,y:0.3887136217356019},{x:0.14495796828078528,y:0.38818782053421796},{x:0.14591168674437638,y:0.38751752344016943},{x:0.1488871876674173,y:0.38620203695812855},{x:0.15179076253542007,y:0.38473460266203335},{x:0.15291373991533655,y:0.3844218744952798},{x:0.15397990142199966,y:0.3839505182141148},{x:0.15715486761053352,y:0.383240799869195},{x:0.1602889333309822,y:0.3823680212676226},{x:0.4030282434963717,y:0.3398437611206276},{x:0.46657219784598525,y:0.30072914754350266},{x:0.487912612564808,y:0.23949853636308405},{x:0.45628203537627,y:0.13174508671722343},{x:0.35793695341674575,y:0.08407681754539842},{x:0.21775140382412592,y:0.0880110894972649},{x:0.15207256592030022,y:0.12474460286217379},{x:0.10828216331322851,y:0.2273324289793991},{x:0.10404037125679308,y:0.23506720851839558},{x:0.09837110341432329,y:0.2418258338591919},{x:0.09149222656964323,y:0.24734857482022213},{x:0.08366809210217534,y:0.25142319556354265},{x:0.07519937711167927,y:0.2538931106990613},{x:0.06641152956592972,y:0.2546634027732644},{x:0.05764226151782814,y:0.2537044698937252},{x:0.04922857102060091,y:0.2510531633132285},{x:0.04149379148160447,y:0.24681137125679312},{x:0.034735166140808106,y:0.24114210341432332},{x:0.029212425179777887,y:0.23426322656964324},{x:0.025137804436457384,y:0.22643909210217536},{x:0.022667889300938757,y:0.21797037711167933},{x:0.021897597226735628,y:0.20918252956592975}]],T:[[{x:-0.022050999999999998,y:0.729004},{x:-0.021186337618145364,y:0.7202249355092742},{x:-0.018625578963007903,y:0.711783245543571},{x:-0.01446713255361454,y:0.7040033395141179},{x:-0.008870805153394636,y:0.6971841948466053},{x:-0.002051660485882085,y:0.6915878674463855},{x:0.005728245543570962,y:0.6874294210369921},{x:0.014169935509274232,y:0.6848686623818546},{x:0.022949,y:0.684004},{x:0.264284,y:0.684004},{x:0.264284,y:0.05103000000000002},{x:0.26514866238185464,y:0.04225093550927423},{x:0.2677094210369921,y:0.03380924554357098},{x:0.27186786744638547,y:0.026029339514117924},{x:0.27746419484660534,y:0.019210194846605383},{x:0.28428333951411794,y:0.013613867446385479},{x:0.292063245543571,y:0.009455421036992116},{x:0.30050493550927426,y:0.006894662381854655},{x:0.309284,y:0.0060300000000000215},{x:0.3180630644907258,y:0.006894662381854655},{x:0.32650475445642907,y:0.009455421036992116},{x:0.3342846604858821,y:0.013613867446385486},{x:0.34110380515339467,y:0.019210194846605383},{x:0.34670013255361454,y:0.026029339514117924},{x:0.3508585789630079,y:0.03380924554357098},{x:0.35341933761814537,y:0.04225093550927425},{x:0.354284,y:0.05103000000000002},{x:0.354284,y:0.684004},{x:0.579103,y:0.684004},{x:0.5878820644907258,y:0.6848686623818546},{x:0.596323754456429,y:0.6874294210369921},{x:0.6041036604858822,y:0.6915878674463855},{x:0.6109228051533947,y:0.6971841948466053},{x:0.6165191325536146,y:0.7040033395141179},{x:0.6206775789630079,y:0.711783245543571},{x:0.6232383376181454,y:0.7202249355092742},{x:0.6241030000000001,y:0.729004},{x:0.6232383376181454,y:0.7377830644907257},{x:0.6206775789630079,y:0.746224754456429},{x:0.6165191325536146,y:0.7540046604858821},{x:0.6109228051533947,y:0.7608238051533946},{x:0.6041036604858822,y:0.7664201325536145},{x:0.596323754456429,y:0.7705785789630079},{x:0.5878820644907258,y:0.7731393376181454},{x:0.579103,y:0.774004},{x:0.022949,y:0.774004},{x:0.014169935509274211,y:0.7731393376181454},{x:0.005728245543570935,y:0.7705785789630079},{x:-0.0020516604858820953,y:0.7664201325536145},{x:-0.008870805153394643,y:0.7608238051533946},{x:-0.01446713255361454,y:0.7540046604858821},{x:-0.018625578963007903,y:0.746224754456429},{x:-0.021186337618145364,y:0.7377830644907257},{x:-0.022050999999999998,y:0.729004}]],U:[[{x:0.027022176378557076,y:0.7288780077818786},{x:0.02808017637855708,y:0.35099900778187865},{x:0.02823473618726791,y:0.3494735334648019},{x:0.028192796744230073,y:0.34794082288884604},{x:0.035484796744230065,y:0.24514582288884607},{x:0.03612518708694976,y:0.24139252668431194},{x:0.03666424897987138,y:0.2376233431565944},{x:0.055316248979871384,y:0.16148034315659432},{x:0.05618736340037885,y:0.15900518320818077},{x:0.05685851158014249,y:0.15646848905542057},{x:0.057648252259250334,y:0.15485425480263812},{x:0.058244846291224776,y:0.15315910934454152},{x:0.0595821022437829,y:0.15090145489330362},{x:0.06073523897858293,y:0.14854443712190207},{x:0.09649723897858292,y:0.0906284371219021},{x:0.09834293286415725,y:0.08820732921922435},{x:0.10003759110096133,y:0.08567820232322114},{x:0.10101147458130413,y:0.08470684222595504},{x:0.10184538199049184,y:0.08361295562088691},{x:0.10412794610596264,y:0.08159844564215248},{x:0.10628345014049506,y:0.07944852663140606},{x:0.15306845014049508,y:0.041154526631406},{x:0.15518086878702558,y:0.03974701384514513},{x:0.15716842451696925,y:0.03816808161035298},{x:0.15884280372557036,y:0.03730705230772802},{x:0.16040964618671547,y:0.03626305906247794},{x:0.1627560674239954,y:0.03529470367371844},{x:0.16501346722603244,y:0.034133863066459845},{x:0.23490646722603245,y:0.006476863066459913},{x:0.23625924682734178,y:0.006089880823813601},{x:0.23754823013535448,y:0.005525708919597472},{x:0.24049103862888763,y:0.004879315347967098},{x:0.24338780663402787,y:0.004050652809021178},{x:0.24479008944495417,y:0.003935020529692536},{x:0.24616436977860445,y:0.0036331571990539033},{x:0.3343553697786044,y:-0.006825842800946093},{x:0.3363658265006992,y:-0.006865793301669296},{x:0.3383604992721398,y:-0.007120376900508131},{x:0.34076517153289726,y:-0.0069532142518240045},{x:0.3431751712391958,y:-0.00700110421331946},{x:0.3451547915551648,y:-0.0066480664270605625},{x:0.3471608040448924,y:-0.0065086169201366215},{x:0.4090588040448924,y:0.003962383079863387},{x:0.4119620232343868,y:0.004752615784895447},{x:0.4149089852784979,y:0.005359710588792872},{x:0.4162090298953196,y:0.005908616535408058},{x:0.4175706649775032,y:0.0062792425557079215},{x:0.42026393287145114,y:0.0076206811274584655},{x:0.4230358315454356,y:0.008791034549085273},{x:0.4738028315454356,y:0.03637303454908527},{x:0.4760785863358737,y:0.0379161826666043},{x:0.4784624107710392,y:0.03928649177082543},{x:0.47972093897980134,y:0.04038599604431689},{x:0.48110410464379305,y:0.04132389563682743},{x:0.48303507818089647,y:0.043281370330868374},{x:0.4851057640535682,y:0.045090410406577325},{x:0.5154867640535682,y:0.07740541040657731},{x:0.5155903820373309,y:0.07753992155387555},{x:0.5157174079857786,y:0.07765259073212467},{x:0.5182811318880063,y:0.08103290449336144},{x:0.5208701788099869,y:0.08439386230433626},{x:0.5209455639802052,y:0.08454600372347547},{x:0.521048168494406,y:0.08468128952824439},{x:0.5340921684944061,y:0.10592328952824437},{x:0.5341054861393935,y:0.10595068243490303},{x:0.5341238592672674,y:0.10597497562685786},{x:0.5360339092314592,y:0.10991723311331511},{x:0.5379492688231333,y:0.11385691363208547},{x:0.5379569864823256,y:0.11388637833537296},{x:0.5379702672090579,y:0.11391378915988949},{x:0.557924267209058,y:0.16807278915988946},{x:0.5580810067186996,y:0.16867450001810444},{x:0.5583366124011981,y:0.1692413235937006},{x:0.5591915686944892,y:0.17293786157308777},{x:0.5601479818122073,y:0.1766094575809222},{x:0.5601843216510317,y:0.17723018509512725},{x:0.5603244341481242,y:0.17783598350956487},{x:0.5696394341481241,y:0.2495799835095649},{x:0.569721927352796,y:0.25224539988339456},{x:0.5700114646960025,y:0.2548963275892337},{x:0.5750284646960026,y:0.7275053275892338},{x:0.5742570402937379,y:0.7362930758081182},{x:0.5717860339652341,y:0.7447614724740409},{x:0.5677104050979391,y:0.752585081852262},{x:0.5621867778235843,y:0.7594632470219072},{x:0.5554274220406369,y:0.7651316439528263},{x:0.5476920960011455,y:0.7693724393298378},{x:0.5392780639467868,y:0.7720226617648687},{x:0.5305086724107663,y:0.7729804646960026},{x:0.5217209241918819,y:0.7722090402937379},{x:0.5132525275259592,y:0.7697380339652341},{x:0.505428918147738,y:0.7656624050979391},{x:0.4985507529780929,y:0.7601387778235843},{x:0.49288235604717384,y:0.753379422040637},{x:0.48864156067016223,y:0.7456440960011456},{x:0.48599133823513135,y:0.7372300639467868},{x:0.4850335353039975,y:0.7284606724107663},{x:0.48004487037154997,y:0.258520878697574},{x:0.4717248917269394,y:0.19444051929027983},{x:0.4550625667192203,y:0.14921575933773623},{x:0.4467624246683876,y:0.135699076001046},{x:0.42448554918380393,y:0.11200409455592171},{x:0.3866565267646711,y:0.09145137140181527},{x:0.33852910612300163,y:0.08330987698295},{x:0.2625775703514966,y:0.09231733933890664},{x:0.20464797458906397,y:0.11524036210229632},{x:0.16911733402594603,y:0.14432255403825953},{x:0.14104265103985364,y:0.1897890642955865},{x:0.12498883901236212,y:0.25532548983758135},{x:0.11807553704626646,y:0.35278200048003916},{x:0.11702182362144292,y:0.7291299922181214},{x:0.11613258476624799,y:0.737906601393955},{x:0.11354820087598706,y:0.7463410885908555},{x:0.10936798837422372,y:0.7541093211959605},{x:0.10375259048311052,y:0.7609127703867312},{x:0.09691780379445152,y:0.7664899834261845},{x:0.0891262853276994,y:0.770626631144951},{x:0.08067745876799748,y:0.7731637444910576},{x:0.07189600778187862,y:0.7740038236214429},{x:0.06311939860604492,y:0.773114584766248},{x:0.05468491140914452,y:0.770530200875987},{x:0.04691667880403945,y:0.7663499883742237},{x:0.04011322961326877,y:0.7607345904831105},{x:0.03453601657381558,y:0.7538998037944515},{x:0.030399368855048972,y:0.7461082853276993},{x:0.027862255508942363,y:0.7376594587679974},{x:0.027022176378557076,y:0.7288780077818786}]],V:[[{x:-0.017163400590915968,y:0.72836062945125},{x:-0.016173311217885875,y:0.7195948244454146},{x:-0.01349212241321528,y:0.7111906087794154},{x:0.27875887758678475,y:0.033216608779415485},{x:0.2789749302503264,y:0.03282594254600198},{x:0.27911899522766415,y:0.032403397706182537},{x:0.2811076886540147,y:0.028969490703698003},{x:0.2830281292409603,y:0.025496951748158487},{x:0.28331624571443165,y:0.0251559418405784},{x:0.28353997693249255,y:0.024769621764193565},{x:0.2861603801951793,y:0.021789671162821947},{x:0.2887213787977949,y:0.018758515442121357},{x:0.2890704869266977,y:0.018480266679882864},{x:0.2893652865202418,y:0.018145017430816868},{x:0.2925166989914198,y:0.015733541060992128},{x:0.2956198378696305,y:0.013260254189586457},{x:0.29601652162435305,y:0.013055459516578674},{x:0.296371060610326,y:0.012784164535463174},{x:0.29993237527606087,y:0.011033834081706148},{x:0.30345840254303674,y:0.009213463087028258},{x:0.303887417589348,y:0.00908999264768462},{x:0.3042880712333465,y:0.00889307764850001},{x:0.3081224287682413,y:0.00787115732855266},{x:0.3119358411735324,y:0.006773658047051503},{x:0.31238070070379703,y:0.0067362567411129665},{x:0.3128120721109714,y:0.0066212890568466964},{x:0.3167721203052928,y:0.006367050695504971},{x:0.32072637054875,y:0.006034599409084053},{x:0.3211699788607,y:0.006084704547762943},{x:0.3216154906697884,y:0.006056102322046737},{x:0.325549047092249,y:0.006579316156958459},{x:0.3294921755545854,y:0.0070246887821141385},{x:0.32991748502957097,y:0.007160374853030322},{x:0.330360016471596,y:0.007219237253358143},{x:0.3341159167548444,y:0.008499796470269213},{x:0.33789639122058457,y:0.00970587758678474},{x:0.33828705745399834,y:0.009921930250326543},{x:0.33870960229381747,y:0.01006599522766418},{x:0.3421435092963017,y:0.012054688654014527},{x:0.34561604825184156,y:0.013975129240960359},{x:0.3459570581594215,y:0.014263245714431577},{x:0.34634337823580646,y:0.014486976932492547},{x:0.34932332883717915,y:0.01710738019518028},{x:0.35235448455787866,y:0.01966837879779494},{x:0.3526327333201171,y:0.020017486926697612},{x:0.35296798256918316,y:0.020312286520241793},{x:0.3553794589390082,y:0.023463698991420194},{x:0.3578527458104136,y:0.026566837869630475},{x:0.3580575404834214,y:0.026963521624353053},{x:0.35832883546453687,y:0.02731806061032596},{x:0.3600791659182934,y:0.03087937527605991},{x:0.3618995369129718,y:0.03440540254303673},{x:0.3620230073523154,y:0.034834417589348},{x:0.3622199223515,y:0.0352350712333465},{x:0.6163569223515,y:0.7132090712333464},{x:0.6186287109431533,y:0.7217330721109714},{x:0.6191938976779532,y:0.7305364906697883},{x:0.6180307627466418,y:0.7392810164715959},{x:0.6151840047723358,y:0.7476306022938175},{x:0.6107630230675074,y:0.7552643782358064},{x:0.6049377134797582,y:0.7618889825691831},{x:0.597931939389674,y:0.7672498354645368},{x:0.5900149287666535,y:0.7711409223515},{x:0.5814909278890286,y:0.7734127109431533},{x:0.5726875093302116,y:0.7739778976779532},{x:0.5639429835284039,y:0.7728147627466418},{x:0.5555933977061824,y:0.7699680047723358},{x:0.5479596217641935,y:0.7655470230675074},{x:0.5413350174308168,y:0.7597217134797583},{x:0.5359741645354631,y:0.7527159393896741},{x:0.5320830776484999,y:0.7447989287666535},{x:0.3171703309688009,y:0.17146543337864517},{x:0.06915612241321528,y:0.7468173912205845},{x:0.06488687075903964,y:0.7545370482518415},{x:0.059193621202205074,y:0.7612754845578786},{x:0.05229516213036956,y:0.7667737458104136},{x:0.04445659745696326,y:0.7708205369129717},{x:0.0359791588264676,y:0.7732603419529485},{x:0.027188629451250054,y:0.773999400590916},{x:0.01842282444541461,y:0.7730093112178859},{x:0.010018608779415478,y:0.7703281224132152},{x:0.0022989517481584835,y:0.7660588707590397},{x:-0.004439484557878664,y:0.7603656212022051},{x:-0.009937745810413578,y:0.7534671621303695},{x:-0.013984536912971763,y:0.7456285974569633},{x:-0.016424341952948517,y:0.7371511588264675},{x:-0.017163400590915968,y:0.72836062945125}]],W:[[{x:-0.04486424190193638,y:0.7324968210037928},{x:-0.04468360364824366,y:0.7236771280279449},{x:0.03511539635175633,y:0.05429612802794491},{x:0.03538914303981033,y:0.053053468981350556},{x:0.035486899606724354,y:0.05178477579191172},{x:0.03633616861564037,y:0.04875449496443272},{x:0.037013200434797444,y:0.04568114375463893},{x:0.03752411791055629,y:0.04451576738270255},{x:0.03786750587531561,y:0.043290523137271594},{x:0.039291634880795206,y:0.040484152470619886},{x:0.040555238800576446,y:0.03760193719815913},{x:0.041283692791972554,y:0.036558628261303676},{x:0.041859515947665654,y:0.035423918409107566},{x:0.04380377647068911,y:0.032949305154171604},{x:0.045605392901094464,y:0.030368987735599786},{x:0.046523389329760155,y:0.02948784001117424},{x:0.047309519115439125,y:0.028487270815480248},{x:0.049699194314460494,y:0.02643951297186818},{x:0.05196958814642765,y:0.024260253558522238},{x:0.05304184892442764,y:0.02357512905942291},{x:0.054008074813295476,y:0.022747151833295932},{x:0.056751330810561565,y:0.021204943586542027},{x:0.059403252082379655,y:0.019510489895534},{x:0.060588570829346225,y:0.019047717572039012},{x:0.06169776130235942,y:0.01842415101594414},{x:0.06468917630833097,y:0.01744675856409077},{x:0.06762071317273859,y:0.01630222750050557},{x:0.06887353875396018,y:0.016079591433481148},{x:0.07008306824328207,y:0.01568439886046892},{x:0.07320768385688461,y:0.015309382847312772},{x:0.07630617899620724,y:0.014758758098063603},{x:0.07757836602719018,y:0.014784814066709744},{x:0.07884175299285809,y:0.014633182505734484},{x:0.08197949198836539,y:0.014874954586349768},{x:0.08512587197205507,y:0.014939396351756326},{x:0.08636853101864941,y:0.015213143039810315},{x:0.08763722420808827,y:0.015310899606724347},{x:0.09066750503556728,y:0.016160168615640357},{x:0.09374085624536103,y:0.01683720043479743},{x:0.09490623261729739,y:0.017348117910556266},{x:0.09613147686272838,y:0.017691505875315594},{x:0.09893784752938008,y:0.01911563488079519},{x:0.10182006280184085,y:0.020379238800576432},{x:0.10286337173869634,y:0.02110769279197256},{x:0.1039980815908924,y:0.02168351594766564},{x:0.10647269484582828,y:0.023627776470689026},{x:0.1090530122644002,y:0.025429392901094458},{x:0.10993415998882576,y:0.026347389329760156},{x:0.11093472918451973,y:0.02713351911543911},{x:0.11298248702813177,y:0.02952319431446044},{x:0.11516174644147774,y:0.03179358814642764},{x:0.11584687094057705,y:0.032865848924427614},{x:0.11667484816670405,y:0.03383207481329547},{x:0.118217056413458,y:0.03657533081056164},{x:0.11991151010446596,y:0.039227252082379635},{x:0.12037428242796094,y:0.040412570829346184},{x:0.12099784898405583,y:0.041521761302359406},{x:0.2862381791186236,y:0.4176126753554925},{x:0.4644074439049092,y:0.03214939722735514},{x:0.46457066699968924,y:0.031871550040082325},{x:0.46468087848244366,y:0.03156873942729889},{x:0.4668033610072479,y:0.028070937443703255},{x:0.4688757411162635,y:0.024543219843286366},{x:0.46909003322228215,y:0.024302554657928657},{x:0.4692572024422568,y:0.02402706365982141},{x:0.47202128937582516,y:0.021010546759784428},{x:0.47474207284479647,y:0.017954914566682648},{x:0.47499919883659564,y:0.017760680011347015},{x:0.4752169015744166,y:0.01752309559247584},{x:0.47851637060601154,y:0.015103786828781735},{x:0.4817809992520572,y:0.012637666274559728},{x:0.4820710779219699,y:0.012497326674279732},{x:0.48233094798351184,y:0.012306779070622963},{x:0.4860390023686124,y:0.010577651122297159},{x:0.4897220183436901,y:0.008795813836836655},{x:0.4900339021311097,y:0.008714762363747632},{x:0.4903259528556443,y:0.008578574212853553},{x:0.49430009414373083,y:0.007606076497244536},{x:0.4982599612093785,y:0.006576997488159493},{x:0.4985816645952609,y:0.006558348904918078},{x:0.4988946726372282,y:0.006481753841050326},{x:0.5029821768073245,y:0.006303258899985619},{x:0.5070667194929276,y:0.00606648509648134},{x:0.5073858795965667,y:0.006110956057683261},{x:0.5077078162324508,y:0.006096897586191266},{x:0.5117516027915979,y:0.006719264880154805},{x:0.5158038544123874,y:0.0072838953667157535},{x:0.5161082060899873,y:0.007389776878261636},{x:0.5164266994754154,y:0.007438795258320738},{x:0.5202713679739276,y:0.008838107561233023},{x:0.5241356027726449,y:0.01018244390490916},{x:0.524413449959918,y:0.010345666999689355},{x:0.5247162605727012,y:0.010455878482443691},{x:0.5282140625562944,y:0.012578361007246536},{x:0.5317417801567137,y:0.014650741116263542},{x:0.5319824453420714,y:0.01486503322228222},{x:0.5322579363401786,y:0.01503220244225683},{x:0.535274453240215,y:0.01779628937582467},{x:0.5383300854333174,y:0.020517072844796484},{x:0.5385243199886531,y:0.020774198836595797},{x:0.5387619044075241,y:0.0209919015744166},{x:0.5411812131712181,y:0.024291370606011366},{x:0.5436473337254403,y:0.027555999252057217},{x:0.5437876733257202,y:0.027846077921969747},{x:0.5439782209293771,y:0.028105947983511865},{x:0.5457073488777034,y:0.03181400236861376},{x:0.5474891861631633,y:0.0354970183436901},{x:0.5475702376362523,y:0.03580890213110964},{x:0.5477064257871465,y:0.03610095285564429},{x:0.548678923502756,y:0.040075094143733274},{x:0.5497080025118405,y:0.04403496120937851},{x:0.5497266510950819,y:0.04435666459526063},{x:0.5498032461589497,y:0.04466967263722821},{x:0.6466002461589497,y:0.7226436726372282},{x:0.6469851024138088,y:0.7314568162324507},{x:0.6456432047416794,y:0.7401756994754154},{x:0.6426261215175564,y:0.7484652605727011},{x:0.6380497975577433,y:0.7560069363401786},{x:0.6320900984255835,y:0.7625109044075241},{x:0.6249760520164882,y:0.7677272209293771},{x:0.6169810471443558,y:0.7714554257871464},{x:0.6084123273627718,y:0.7735522461589497},{x:0.5995991837675493,y:0.7739371024138088},{x:0.5908803005245846,y:0.7725952047416793},{x:0.5825907394272989,y:0.7695781215175563},{x:0.5750490636598214,y:0.7650017975577432},{x:0.5685450955924759,y:0.7590420984255835},{x:0.563328779070623,y:0.7519280520164882},{x:0.5596005742128536,y:0.7439330471443557},{x:0.5575037538410503,y:0.7353643273627718},{x:0.4822251865940539,y:0.2081071670095049},{x:0.3260455560950909,y:0.5459966027726448},{x:0.3245096626856286,y:0.5486110836728201},{x:0.32313748405233433,y:0.5513150815908924},{x:0.32228015650766817,y:0.5524062697730983},{x:0.32157725888373645,y:0.5536027801567136},{x:0.3195608173147473,y:0.5558673865996665},{x:0.3176874808845609,y:0.5582517291845196},{x:0.31663374639442166,y:0.5591546941850146},{x:0.31571092715520355,y:0.5601910854333173},{x:0.3132914281453504,y:0.5620187898634509},{x:0.3109889251867045,y:0.563991848166704},{x:0.30977927817660644,y:0.5646718895469083},{x:0.3086720007479428,y:0.5655083337254402},{x:0.3059424242873038,y:0.566828898486493},{x:0.3032992386976406,y:0.5683148489840557},{x:0.30198016522380455,y:0.5687458331350992},{x:0.3007309816563099,y:0.5693501861631632},{x:0.29779622383750376,y:0.570112862691949},{x:0.29491393175671793,y:0.571054601139531},{x:0.29353612307299787,y:0.5712199655821879},{x:0.29219303879062153,y:0.5715690025118404},{x:0.28916588071079274,y:0.5717444815770724},{x:0.2861552470071419,y:0.5721058174942654},{x:0.2847716515285703,y:0.5719992073657418},{x:0.2833862805070725,y:0.5720795149035186},{x:0.28038305415357795,y:0.5716610529431293},{x:0.27735977579191173,y:0.5714281003932755},{x:0.27602356431680025,y:0.5710536126610233},{x:0.27464914558761266,y:0.5708621046332842},{x:0.27178526326499086,y:0.5698657829057354},{x:0.26886552313727163,y:0.5690474941246844},{x:0.26762804552325165,y:0.5684195201422382},{x:0.26631739722735515,y:0.5679635560950907},{x:0.26370291632718046,y:0.5664276626856288},{x:0.2609989184091076,y:0.5650554840523343},{x:0.25990773022690183,y:0.5641981565076682},{x:0.2587112198432863,y:0.5634952588837364},{x:0.25644661340033337,y:0.5614788173147471},{x:0.2540622708154803,y:0.5596054808845607},{x:0.2531593058149851,y:0.5585517463944213},{x:0.2521229145666826,y:0.5576289271552034},{x:0.2502952101365493,y:0.5552094281453507},{x:0.24832215183329598,y:0.5529069251867045},{x:0.2476421104530918,y:0.5516972781766065},{x:0.24680566627455972,y:0.5505900007479427},{x:0.245485101513507,y:0.5478604242873037},{x:0.24399915101594416,y:0.5452172386976405},{x:0.10495542809967917,y:0.22875042455884986},{x:0.04468360364824366,y:0.734330871972055},{x:0.04278579956520255,y:0.742945856245361},{x:0.03924376119942353,y:0.7510250628018409},{x:0.034193607098905524,y:0.7582580122644001},{x:0.02782941185357234,y:0.7643667464414777},{x:0.020395747917620333,y:0.7691165101044659},{x:0.012178286827261426,y:0.7723247724994944},{x:0.003492821003792758,y:0.7738682419019364},{x:-0.00532687197205508,y:0.7736876036482436},{x:-0.013941856245361059,y:0.7717897995652026},{x:-0.022021062801840872,y:0.7682477611994235},{x:-0.029254012264400202,y:0.7631976070989055},{x:-0.035362746441477744,y:0.7568334118535723},{x:-0.04011251010446598,y:0.7493997479176203},{x:-0.04332077249949441,y:0.7411822868272614},{x:-0.04486424190193638,y:0.7324968210037928}]],X:[[{x:-0.03582341524240513,y:0.7325834270170574},{x:-0.035659804156077404,y:0.7237634017461555},{x:-0.03377863524060577,y:0.7151447697271875},{x:-0.030252200762440104,y:0.7070587401552579},{x:-0.02521601962092907,y:0.6998160546121182},{x:0.24190189785100796,y:0.3863717955888736},{x:-0.0190039697420246,y:0.08021800391719859},{x:-0.024040163260448045,y:0.07297532698032597},{x:-0.027566611556706647,y:0.06488930343468059},{x:-0.029447795200430175,y:0.056270674630427356},{x:-0.029611421359170286,y:0.047450649639130975},{x:-0.028051201971409197,y:0.03876817707487998},{x:-0.024827095393237467,y:0.030556919489131844},{x:-0.02006300223235442,y:0.02313243090598055},{x:-0.013942003917198569,y:0.016780030257975413},{x:-0.006699326980325947,y:0.011743836739551976},{x:0.0013866965653194212,y:0.00821738844329338},{x:0.010005325369572668,y:0.006336204799569846},{x:0.018825350360869044,y:0.0061725786408297345},{x:0.02750782292512003,y:0.007732798028590823},{x:0.03571908051086817,y:0.010956904606762553},{x:0.04314356909401947,y:0.0157209977676456},{x:0.049495969742024595,y:0.021841996082801452},{x:0.3010259353438819,y:0.31699385831754345},{x:0.5525549803790709,y:0.021842054612118165},{x:0.558907370566982,y:0.01572104544144637},{x:0.5663318510088331,y:0.010956939592969957},{x:0.5745431030849405,y:0.007732818982704524},{x:0.5832255729829426,y:0.006172584757594898},{x:0.5920455982538445,y:0.006336195843922615},{x:0.6006642302728125,y:0.008217364759394247},{x:0.6087502598447422,y:0.011743799237559922},{x:0.6159929453878819,y:0.016779980379070948},{x:0.6221139545585537,y:0.023132370566981995},{x:0.6268780604070301,y:0.03055685100883309},{x:0.6301021810172955,y:0.0387681030849405},{x:0.6316624152424052,y:0.04745057298294264},{x:0.6314988041560774,y:0.05627059825384449},{x:0.6296176352406058,y:0.06488923027281246},{x:0.6260912007624402,y:0.07297525984474214},{x:0.6210550196209291,y:0.08021794538788188},{x:0.36015009139561527,y:0.3863716945525663},{x:0.6272689697420246,y:0.6998159960828014},{x:0.632305163260448,y:0.7070586730196741},{x:0.6358316115567066,y:0.7151446965653194},{x:0.6377127952004301,y:0.7237633253695727},{x:0.6378764213591702,y:0.7325833503608691},{x:0.6363162019714091,y:0.74126582292512},{x:0.6330920953932374,y:0.7494770805108681},{x:0.6283280022323544,y:0.7569015690940195},{x:0.6222070039171985,y:0.7632539697420246},{x:0.6149643269803259,y:0.7682901632604481},{x:0.6068783034346805,y:0.7718166115567067},{x:0.5982596746304273,y:0.7736977952004301},{x:0.5894396496391309,y:0.7738614213591702},{x:0.58075717707488,y:0.7723012019714092},{x:0.5725459194891318,y:0.7690770953932374},{x:0.5651214309059804,y:0.7643130022323544},{x:0.5587690302579753,y:0.7581920039171985},{x:0.30102605390274134,y:0.4557496318238965},{x:0.04328401962092907,y:0.7581919453878818},{x:0.03693162943301802,y:0.7643129545585536},{x:0.029507148991166913,y:0.76907706040703},{x:0.021295896915059523,y:0.7723011810172955},{x:0.012613427017057378,y:0.7738614152424051},{x:0.003793401746155514,y:0.7736978041560774},{x:-0.004825230272812429,y:0.7718166352406057},{x:-0.012911259844742107,y:0.7682902007624401},{x:-0.02015394538788185,y:0.7632540196209291},{x:-0.02627495455855365,y:0.756901629433018},{x:-0.031039060407030063,y:0.7494771489911669},{x:-0.034263181017295495,y:0.7412658969150595},{x:-0.03582341524240513,y:0.7325834270170574}]],Y:[[{x:-0.02688005049839745,y:0.731186349993587},{x:-0.02644216088936969,y:0.7223756821949907},{x:-0.024293809188388457,y:0.7138197369324374},{x:-0.020517555346512936,y:0.7058473143841377},{x:-0.015258518681138845,y:0.6987647902776368},{x:0.25043465103960333,y:0.4059541390643743},{x:0.26029423204414154,y:0.04978477430584237},{x:0.26140149479875585,y:0.04103299828270508},{x:0.26419486861258723,y:0.03266540142918031},{x:0.26856700569651215,y:0.025003545799746604},{x:0.27434988727431814,y:0.01834187220942495},{x:0.28132128045004745,y:0.012936385038381841},{x:0.28921327849355916,y:0.008994814127168342},{x:0.2977225963459245,y:0.006668631835443931},{x:0.30652222569415766,y:0.00604723204414153},{x:0.3152740017172949,y:0.007154494798755871},{x:0.32364159857081976,y:0.009947868612587236},{x:0.3313034542002534,y:0.014320005696512164},{x:0.3379651277905751,y:0.020102887274318144},{x:0.3433706149616182,y:0.027074280450047443},{x:0.3473121858728317,y:0.03496627849355913},{x:0.3496383681645561,y:0.04347559634592452},{x:0.3502597679558585,y:0.05227522569415767},{x:0.34045421751128274,y:0.4064927803087797},{x:0.6166036868780955,y:0.6970396048261934},{x:0.6220250193382449,y:0.7039986829780357},{x:0.6259845336177533,y:0.7118816938899454},{x:0.6283300678033804,y:0.7203856978734211},{x:0.6289714843317633,y:0.7291838908244783},{x:0.6278841339254269,y:0.7379381631220915},{x:0.6251098028506934,y:0.7463120929913156},{x:0.620755107094902,y:0.7539838750034306},{x:0.6149873951738065,y:0.7606586868780956},{x:0.6080283170219642,y:0.7660800193382449},{x:0.6001453061100546,y:0.7700395336177532},{x:0.5916413021265788,y:0.7723850678033803},{x:0.5828431091755216,y:0.7730264843317632},{x:0.5740888368779085,y:0.7719391339254268},{x:0.5657149070086843,y:0.7691648028506933},{x:0.5580431249965694,y:0.7648101070949019},{x:0.5513683131219045,y:0.7590423951738065},{x:0.29567976193894085,y:0.4900232412279098},{x:0.051392518681138845,y:0.7592432097223631},{x:0.04485280102201476,y:0.765163657957578},{x:0.03728372005126494,y:0.7696945108160528},{x:0.028976151305805796,y:0.7726616501633681},{x:0.02024934999358704,y:0.7739510504983974},{x:0.011438682194990706,y:0.7735131608893697},{x:0.002882736932437466,y:0.7713648091883885},{x:-0.0050896856158622154,y:0.7675885553465129},{x:-0.012172209722363214,y:0.7623295186811389},{x:-0.01809265795757798,y:0.7557898010220148},{x:-0.022623510816052815,y:0.7482207200512649},{x:-0.025590650163368103,y:0.7399131513058058},{x:-0.02688005049839745,y:0.731186349993587}]],Z:[[{x:0.008711000000000003,y:0.05103000000000002},{x:0.00905278632815029,y:0.04755978517413498},{x:0.009251179439517476,y:0.04407842782316871},{x:0.009484424544736794,y:0.043177288815328604},{x:0.009575662381854637,y:0.04225093550927423},{x:0.01058788670939069,y:0.038914079093048184},{x:0.01146164687940622,y:0.0355383196233794},{x:0.011866213744552238,y:0.0346999996115786},{x:0.012136421036992098,y:0.03380924554357098},{x:0.013780184150668652,y:0.030733981057728944},{x:0.015295733266009179,y:0.0275935480126292},{x:0.015856074613338045,y:0.026850263164785913},{x:0.01629486744638546,y:0.026029339514117927},{x:0.01850700045157689,y:0.023333847648222647},{x:0.020606096809669634,y:0.02054942610843994},{x:0.02130067903544657,y:0.01992974044441782},{x:0.021891194846605365,y:0.019210194846605383},{x:0.024586686712500538,y:0.016998061841414044},{x:0.027188663217490867,y:0.014676655565200585},{x:0.02799079391630549,y:0.014204383257544266},{x:0.028710339514117916,y:0.013613867446385479},{x:0.03178560399995988,y:0.01197010433270896},{x:0.03479046815396611,y:0.010200923661400137},{x:0.035669321892902964,y:0.00989421387003954},{x:0.036490245543570964,y:0.009455421036992116},{x:0.03982710195979704,y:0.008443196709456058},{x:0.04311937851852794,y:0.007294230264082269},{x:0.04404118144126662,y:0.007164869674294513},{x:0.04493193550927423,y:0.006894662381854655},{x:0.048402150335139275,y:0.006552876053704368},{x:0.05185531895677298,y:0.006068277970413476},{x:0.052784646693945655,y:0.006121237837117864},{x:0.053711,y:0.0060300000000000215},{x:0.548341,y:0.0060300000000000215},{x:0.5571200644907257,y:0.006894662381854655},{x:0.565561754456429,y:0.009455421036992116},{x:0.5733416604858821,y:0.013613867446385479},{x:0.5801608051533946,y:0.019210194846605383},{x:0.5857571325536145,y:0.026029339514117927},{x:0.5899155789630078,y:0.03380924554357098},{x:0.5924763376181453,y:0.04225093550927425},{x:0.593341,y:0.05103000000000002},{x:0.5924763376181453,y:0.05980906449072579},{x:0.5899155789630078,y:0.06825075445642906},{x:0.5857571325536145,y:0.07603066048588211},{x:0.5801608051533946,y:0.08284980515339466},{x:0.5733416604858821,y:0.08844613255361455},{x:0.565561754456429,y:0.09260457896300792},{x:0.5571200644907257,y:0.09516533761814538},{x:0.548341,y:0.09603000000000002},{x:0.14224494935878249,y:0.09603000000000002},{x:0.5846943444347994,y:0.7024816632174908},{x:0.5851666167424556,y:0.7032837939163054},{x:0.5857571325536145,y:0.7040033395141179},{x:0.5874008956672913,y:0.7070786039999603},{x:0.5891700763385999,y:0.7100834681539662},{x:0.5894767861299605,y:0.7109623218929031},{x:0.5899155789630078,y:0.711783245543571},{x:0.5909278032905438,y:0.7151201019597967},{x:0.5920767697359177,y:0.7184123785185279},{x:0.5922061303257055,y:0.7193341814412667},{x:0.5924763376181453,y:0.7202249355092742},{x:0.5928181239462956,y:0.7236951503351391},{x:0.5933027220295866,y:0.7271483189567729},{x:0.5932497621628822,y:0.7280776466939456},{x:0.593341,y:0.729004},{x:0.5929992136718496,y:0.7324742148258655},{x:0.5928008205604824,y:0.7359555721768313},{x:0.5925675754552632,y:0.7368567111846711},{x:0.5924763376181453,y:0.7377830644907257},{x:0.5914641132906093,y:0.7411199209069517},{x:0.5905903531205937,y:0.7444956803766206},{x:0.5901857862554476,y:0.7453340003884216},{x:0.5899155789630078,y:0.746224754456429},{x:0.5882718158493319,y:0.74930001894227},{x:0.5867562667339908,y:0.7524404519873709},{x:0.5861959253866618,y:0.7531837368352144},{x:0.5857571325536145,y:0.7540046604858821},{x:0.5835449995484229,y:0.7567001523517777},{x:0.5814459031903303,y:0.7594845738915601},{x:0.5807513209645536,y:0.760104259555582},{x:0.5801608051533946,y:0.7608238051533946},{x:0.5774653132874991,y:0.7630359381585863},{x:0.5748633367825091,y:0.7653573444347994},{x:0.5740612060836946,y:0.7658296167424556},{x:0.5733416604858821,y:0.7664201325536145},{x:0.5702663960000408,y:0.7680638956672906},{x:0.5672615318460339,y:0.7698330763385999},{x:0.5663826781070966,y:0.7701397861299606},{x:0.565561754456429,y:0.7705785789630079},{x:0.5622248980402041,y:0.7715908032905435},{x:0.558932621481472,y:0.7727397697359177},{x:0.5580108185587332,y:0.7728691303257055},{x:0.5571200644907257,y:0.7731393376181454},{x:0.553649849664861,y:0.7734811239462956},{x:0.5501966810432269,y:0.7739657220295866},{x:0.5492673533060543,y:0.7739127621628822},{x:0.548341,y:0.774004},{x:0.053711,y:0.774004},{x:0.04493193550927421,y:0.7731393376181454},{x:0.036490245543570936,y:0.7705785789630079},{x:0.028710339514117906,y:0.7664201325536145},{x:0.021891194846605358,y:0.7608238051533946},{x:0.01629486744638546,y:0.7540046604858821},{x:0.012136421036992098,y:0.746224754456429},{x:0.009575662381854637,y:0.7377830644907257},{x:0.008711000000000003,y:0.729004},{x:0.009575662381854637,y:0.7202249355092742},{x:0.012136421036992098,y:0.711783245543571},{x:0.01629486744638546,y:0.7040033395141179},{x:0.021891194846605365,y:0.6971841948466053},{x:0.028710339514117916,y:0.6915878674463855},{x:0.036490245543570964,y:0.6874294210369921},{x:0.04493193550927423,y:0.6848686623818546},{x:0.053711,y:0.684004},{x:0.4598070506412174,y:0.684004},{x:0.017357655565200567,y:0.07755233678250915},{x:0.016885383257544267,y:0.07675020608369457},{x:0.01629486744638546,y:0.07603066048588211},{x:0.014651104332708876,y:0.07295539600004002},{x:0.012881923661400112,y:0.06995053184603389},{x:0.012575213870039523,y:0.06907167810709706},{x:0.012136421036992098,y:0.06825075445642906},{x:0.011124196709456038,y:0.06491389804020298},{x:0.00997523026408225,y:0.06162162148147208},{x:0.009845869674294495,y:0.0606998185587334},{x:0.009575662381854637,y:0.05980906449072579},{x:0.009233876053704348,y:0.056338849664860746},{x:0.008749277970413458,y:0.05288568104322705},{x:0.008802237837117845,y:0.05195635330605437},{x:0.008711000000000003,y:0.05103000000000002}]],"[":[[{x:0.152511,y:-0.06942399999999993},{x:0.15337566238185463,y:-0.0782030644907257},{x:0.1559364210369921,y:-0.08664475445642897},{x:0.16009486744638546,y:-0.09442466048588202},{x:0.16569119484660536,y:-0.10124380515339457},{x:0.1725103395141179,y:-0.10684013255361446},{x:0.18029024554357093,y:-0.11099857896300783},{x:0.1887319355092742,y:-0.1135593376181453},{x:0.197511,y:-0.11442399999999993},{x:0.404542,y:-0.11442399999999993},{x:0.4133210644907258,y:-0.1135593376181453},{x:0.4217627544564291,y:-0.11099857896300783},{x:0.42954266048588213,y:-0.10684013255361446},{x:0.4363618051533946,y:-0.10124380515339457},{x:0.44195813255361455,y:-0.09442466048588202},{x:0.44611657896300794,y:-0.08664475445642897},{x:0.4486773376181454,y:-0.0782030644907257},{x:0.449542,y:-0.06942399999999993},{x:0.4486773376181454,y:-0.06064493550927416},{x:0.44611657896300794,y:-0.05220324554357089},{x:0.44195813255361455,y:-0.04442333951411784},{x:0.4363618051533946,y:-0.03760419484660529},{x:0.42954266048588213,y:-0.032007867446385396},{x:0.4217627544564291,y:-0.027849421036992027},{x:0.4133210644907258,y:-0.025288662381854565},{x:0.404542,y:-0.024423999999999932},{x:0.24251099999999998,y:-0.024423999999999932},{x:0.24251099999999998,y:0.7147659999999999},{x:0.404542,y:0.7147659999999999},{x:0.4133210644907258,y:0.7156306623818546},{x:0.4217627544564291,y:0.7181914210369921},{x:0.42954266048588213,y:0.7223498674463854},{x:0.4363618051533946,y:0.7279461948466053},{x:0.44195813255361455,y:0.7347653395141178},{x:0.44611657896300794,y:0.7425452455435709},{x:0.4486773376181454,y:0.7509869355092742},{x:0.449542,y:0.7597659999999999},{x:0.4486773376181454,y:0.7685450644907257},{x:0.44611657896300794,y:0.776986754456429},{x:0.44195813255361455,y:0.7847666604858821},{x:0.4363618051533946,y:0.7915858051533946},{x:0.42954266048588213,y:0.7971821325536145},{x:0.4217627544564291,y:0.8013405789630078},{x:0.4133210644907258,y:0.8039013376181453},{x:0.404542,y:0.804766},{x:0.197511,y:0.804766},{x:0.1887319355092742,y:0.8039013376181453},{x:0.18029024554357093,y:0.8013405789630078},{x:0.1725103395141179,y:0.7971821325536145},{x:0.16569119484660536,y:0.7915858051533946},{x:0.16009486744638546,y:0.7847666604858821},{x:0.1559364210369921,y:0.776986754456429},{x:0.15337566238185463,y:0.7685450644907257},{x:0.152511,y:0.7597659999999999},{x:0.152511,y:-0.06942399999999993}]],"\\":[[{x:0.017522651058219416,y:0.7303997530123288},{x:0.018114599516431164,y:0.7215980934307649},{x:0.020412292453046287,y:0.7130810386853763},{x:0.024327430817071727,y:0.7051758944136092},{x:0.5013774308170718,y:-0.059077105586390885},{x:0.5067595580368128,y:-0.06606654912342862},{x:0.5134018419815468,y:-0.0718716915303336},{x:0.521049023404313,y:-0.07626944443996993},{x:0.5294072254116235,y:-0.07909080467430848},{x:0.5381552469876711,y:-0.08022734894178067},{x:0.5469569065692351,y:-0.07963540048356893},{x:0.5554739613146237,y:-0.0773377075469538},{x:0.5633791055863908,y:-0.07342256918292836},{x:0.5703685491234285,y:-0.06804044196318723},{x:0.5761736915303335,y:-0.06139815801845332},{x:0.5805714444399699,y:-0.05375097659568702},{x:0.5833928046743084,y:-0.04539277458837649},{x:0.5845293489417805,y:-0.03664475301232898},{x:0.5839374004835688,y:-0.02784309343076498},{x:0.5816397075469537,y:-0.01932603868537643},{x:0.5777245691829282,y:-0.011420894413609283},{x:0.10067456918292828,y:0.7528321055863908},{x:0.09529244196318712,y:0.7598215491234285},{x:0.0886501580184532,y:0.7656266915303336},{x:0.08100297659568693,y:0.7700244444399699},{x:0.07264477458837638,y:0.7728458046743084},{x:0.06389675301232887,y:0.7739823489417805},{x:0.055095093430764894,y:0.7733904004835688},{x:0.04657803868537634,y:0.7710927075469537},{x:0.03867289441360919,y:0.7671775691829282},{x:0.03168345087657147,y:0.7617954419631872},{x:0.025878308469666468,y:0.7551531580184532},{x:0.021480555560030153,y:0.747505976595687},{x:0.01865919532569161,y:0.7391477745883763},{x:0.017522651058219416,y:0.7303997530123288}]],"]":[[{x:0.15250999999999998,y:-0.06942399999999993},{x:0.15337466238185463,y:-0.0782030644907257},{x:0.1559354210369921,y:-0.08664475445642897},{x:0.16009386744638546,y:-0.09442466048588202},{x:0.16569019484660535,y:-0.10124380515339457},{x:0.1725093395141179,y:-0.10684013255361446},{x:0.18028924554357095,y:-0.11099857896300783},{x:0.18873093550927422,y:-0.1135593376181453},{x:0.19751,y:-0.11442399999999993},{x:0.404542,y:-0.11442399999999993},{x:0.4133210644907258,y:-0.1135593376181453},{x:0.4217627544564291,y:-0.11099857896300783},{x:0.42954266048588213,y:-0.10684013255361446},{x:0.4363618051533946,y:-0.10124380515339457},{x:0.44195813255361455,y:-0.09442466048588202},{x:0.44611657896300794,y:-0.08664475445642897},{x:0.4486773376181454,y:-0.0782030644907257},{x:0.449542,y:-0.06942399999999993},{x:0.449542,y:0.7597659999999999},{x:0.4486773376181454,y:0.7685450644907257},{x:0.44611657896300794,y:0.776986754456429},{x:0.44195813255361455,y:0.7847666604858821},{x:0.4363618051533946,y:0.7915858051533946},{x:0.42954266048588213,y:0.7971821325536145},{x:0.4217627544564291,y:0.8013405789630078},{x:0.4133210644907258,y:0.8039013376181453},{x:0.404542,y:0.804766},{x:0.19751,y:0.804766},{x:0.18873093550927422,y:0.8039013376181453},{x:0.18028924554357095,y:0.8013405789630078},{x:0.1725093395141179,y:0.7971821325536145},{x:0.16569019484660535,y:0.7915858051533946},{x:0.16009386744638546,y:0.7847666604858821},{x:0.1559354210369921,y:0.776986754456429},{x:0.15337466238185463,y:0.7685450644907257},{x:0.15250999999999998,y:0.7597659999999999},{x:0.15337466238185463,y:0.7509869355092742},{x:0.1559354210369921,y:0.7425452455435709},{x:0.16009386744638546,y:0.7347653395141178},{x:0.16569019484660535,y:0.7279461948466053},{x:0.1725093395141179,y:0.7223498674463854},{x:0.18028924554357095,y:0.7181914210369921},{x:0.18873093550927422,y:0.7156306623818546},{x:0.19751,y:0.7147659999999999},{x:0.35954200000000003,y:0.7147659999999999},{x:0.35954200000000003,y:-0.024423999999999932},{x:0.19751,y:-0.024423999999999932},{x:0.18873093550927422,y:-0.025288662381854565},{x:0.18028924554357095,y:-0.027849421036992027},{x:0.1725093395141179,y:-0.03200786744638539},{x:0.16569019484660535,y:-0.03760419484660529},{x:0.16009386744638546,y:-0.04442333951411784},{x:0.1559354210369921,y:-0.052203245543570885},{x:0.15337466238185463,y:-0.06064493550927414},{x:0.15250999999999998,y:-0.06942399999999993}]],"^":[[{x:-0.009830024293871129,y:0.4771904357900641},{x:-0.009184411720694952,y:0.46839254975009553},{x:-0.006834821991481832,y:0.4598896653882279},{x:-0.002871548521860348,y:0.4520085437820153},{x:0.002553102311361327,y:0.44505205201500053},{x:0.009230664218841726,y:0.43928752416454453},{x:0.016904522241296224,y:0.4349364878031557},{x:0.02527977431847106,y:0.43216615081811305},{x:0.034034564209935884,y:0.43108297570612886},{x:0.04283245024990444,y:0.431728588279305},{x:0.05133533461177206,y:0.4340781780085181},{x:0.05921645621798466,y:0.4380414514781396},{x:0.06617294798499941,y:0.4434661023113613},{x:0.30102423332324457,y:0.6668931783680099},{x:0.5358792969655858,y:0.44346586927801307},{x:0.5428358294884947,y:0.4380412707099504},{x:0.5507169808710617,y:0.43407805645230807},{x:0.5592198828854552,y:0.4317285306064111},{x:0.5680177737757447,y:0.431082984132888},{x:0.5767725555289304,y:0.4321662250206897},{x:0.5851477867919753,y:0.43493662492998636},{x:0.5928216121243246,y:0.439287718945922},{x:0.5994991307219868,y:0.44505229696558585},{x:0.6049237292900496,y:0.45200882948849475},{x:0.6088869435476919,y:0.4598899808710617},{x:0.6112364693935889,y:0.4683928828854553},{x:0.6118820158671119,y:0.47719077377574476},{x:0.6107987749793102,y:0.4859455555289303},{x:0.6080283750700135,y:0.4943207867919753},{x:0.6036772810540779,y:0.5019946121243246},{x:0.5979127030344141,y:0.5086721307219868},{x:0.33204070303441413,y:0.7616071307219868},{x:0.3294429315385385,y:0.7636328335402047},{x:0.3269493357811583,y:0.7657854758354554},{x:0.3259710287822201,y:0.7663401706594313},{x:0.32508417051150523,y:0.7670317292900496},{x:0.3221411194513825,y:0.7685117087189752},{x:0.3192754777587038,y:0.7701365121968442},{x:0.31820775306259985,y:0.7704896904878621},{x:0.3172030191289383,y:0.7709949435476919},{x:0.31402778830632944,y:0.7718723248078522},{x:0.310900225681529,y:0.7729068491818869},{x:0.30978411534954325,y:0.7730449384962876},{x:0.3087001171145447,y:0.7733444693935889},{x:0.30541472886927135,y:0.7735855352151975},{x:0.30214543579006414,y:0.7739900242938711},{x:0.3010238313163334,y:0.7739077179367437},{x:0.2999022262242552,y:0.773990015867112},{x:0.29663293618411596,y:0.7735855022258356},{x:0.2933475497500956,y:0.7733444117206949},{x:0.29226355376554153,y:0.7730448726791859},{x:0.29114744447106966,y:0.7729067749793103},{x:0.2880198896188706,y:0.7718722271075298},{x:0.28484466538822795,y:0.7709948219914818},{x:0.28383993525062523,y:0.7704895613829726},{x:0.2827722132080247,y:0.7701363750700135},{x:0.27990658372278143,y:0.7685115500622604},{x:0.2769635437820154,y:0.7670315485218604},{x:0.2760766907070934,y:0.7663399832281829},{x:0.2750983878756754,y:0.765785281054078},{x:0.27260480829144085,y:0.7636326200241867},{x:0.2700070520150006,y:0.7616068976886387},{x:0.004139052015000585,y:0.5086718976886386},{x:-0.001625475835455463,y:0.5019943357811583},{x:-0.0059765121968442594,y:0.49432047775870375},{x:-0.00874684918188691,y:0.4859452256815289},{x:-0.009830024293871129,y:0.4771904357900641}]],_:[[{x:-0.045,y:-0.160601},{x:-0.044135337618145365,y:-0.16938006449072576},{x:-0.041574578963007904,y:-0.17782175445642903},{x:-0.03741613255361454,y:-0.1856016604858821},{x:-0.03181980515339464,y:-0.19242080515339463},{x:-0.025000660485882086,y:-0.19801713255361453},{x:-0.017220754456429038,y:-0.2021755789630079},{x:-0.008779064490725769,y:-0.20473633761814536},{x:0,y:-0.20560099999999998},{x:0.602052,y:-0.20560099999999998},{x:0.6108310644907258,y:-0.20473633761814536},{x:0.619272754456429,y:-0.2021755789630079},{x:0.6270526604858822,y:-0.19801713255361453},{x:0.6338718051533947,y:-0.19242080515339463},{x:0.6394681325536146,y:-0.1856016604858821},{x:0.6436265789630079,y:-0.17782175445642903},{x:0.6461873376181454,y:-0.16938006449072576},{x:0.6470520000000001,y:-0.160601},{x:0.6461873376181454,y:-0.15182193550927423},{x:0.6436265789630079,y:-0.14338024554357096},{x:0.6394681325536146,y:-0.1356003395141179},{x:0.6338718051533947,y:-0.12878119484660536},{x:0.6270526604858822,y:-0.12318486744638546},{x:0.619272754456429,y:-0.1190264210369921},{x:0.6108310644907258,y:-0.11646566238185463},{x:0.602052,y:-0.115601},{x:0,y:-0.115601},{x:-0.00877906449072579,y:-0.11646566238185463},{x:-0.017220754456429066,y:-0.1190264210369921},{x:-0.025000660485882096,y:-0.12318486744638546},{x:-0.03181980515339464,y:-0.12878119484660536},{x:-0.03741613255361454,y:-0.1356003395141179},{x:-0.041574578963007904,y:-0.14338024554357096},{x:-0.044135337618145365,y:-0.15182193550927423},{x:-0.045,y:-0.160601}]],a:[[{x:0.029951000000000005,y:0.25490100000000004},{x:0.030216131121475042,y:0.2522090785486062},{x:0.03027571711850824,y:0.2495047884160563},{x:0.03064747136410999,y:0.24782960757010103},{x:0.03081566238185464,y:0.24612193550927428},{x:0.0316008669059687,y:0.24353346308961055},{x:0.0321868888075612,y:0.2408927597850148},{x:0.06949088880756119,y:0.12701175978501478},{x:0.07014919013856018,y:0.12551652306247207},{x:0.07061771774296957,y:0.1239514111231075},{x:0.07192248021942128,y:0.12148874987750752},{x:0.07304546130734973,y:0.1189380599695235},{x:0.0739828197765546,y:0.11759998201998349},{x:0.07474768294666384,y:0.11615634846888903},{x:0.07650781615341086,y:0.11399555310027064},{x:0.07810683439013419,y:0.11171295672570881},{x:0.07928722783725009,y:0.11058345913436952},{x:0.08031903331037206,y:0.10931678199931477},{x:0.15605303331037207,y:0.033026781999314685},{x:0.1581401110567553,y:0.03130114899494214},{x:0.16009013354595797,y:0.02942202284781055},{x:0.16153164054777758,y:0.028496972085311937},{x:0.16285166496406625,y:0.027405552418137233},{x:0.16523529439528092,y:0.026120245637685162},{x:0.16751444707429886,y:0.024657656887915},{x:0.24324744707429888,y:-0.014037343112084925},{x:0.24491821916217926,y:-0.014693433733650136},{x:0.24650124554357095,y:-0.015539578963007873},{x:0.24901423193062222,y:-0.016301885049470277},{x:0.2514585861893129,y:-0.017261751399011975},{x:0.25322525179064753,y:-0.017579283958613606},{x:0.2549429355092742,y:-0.018100337618145335},{x:0.2575563541074305,y:-0.01835773688343746},{x:0.2601410014196699,y:-0.018822289810772906},{x:0.26193566856615697,y:-0.018789061710219754},{x:0.263722,y:-0.018964999999999968},{x:0.376759,y:-0.018964999999999968},{x:0.3786816094876915,y:-0.018775639493449434},{x:0.3806133727303473,y:-0.01879962736385296},{x:0.3830607170270406,y:-0.018344335046447002},{x:0.3855380644907258,y:-0.018100337618145335},{x:0.3873867891740171,y:-0.01753953311656589},{x:0.3892861139289994,y:-0.017186191753697247},{x:0.3915976100664607,y:-0.016262194563578608},{x:0.3939797544564291,y:-0.015539578963007873},{x:0.3956835488825182,y:-0.014628881868892333},{x:0.3974774451646465,y:-0.013911789983170525},{x:0.4720844451646465,y:0.0247832100168294},{x:0.4742399118062311,y:0.026185049737888398},{x:0.4765030886255536,y:0.02740538646642049},{x:0.47792879308654873,y:0.028584168427667152},{x:0.47947957817165415,y:0.02959274452399146},{x:0.48132014276352414,y:0.0313881589690925},{x:0.48210100000000006,y:0.032033776942416534},{x:0.48210100000000006,y:0.02603500000000003},{x:0.4829656623818547,y:0.01725593550927424},{x:0.4855264210369921,y:0.008814245543570985},{x:0.4896848674463855,y:0.0010343395141179344},{x:0.4952811948466054,y:-0.0057848051533946065},{x:0.5021003395141179,y:-0.01138113255361451},{x:0.509880245543571,y:-0.015539578963007873},{x:0.5183219355092743,y:-0.018100337618145335},{x:0.527101,y:-0.018964999999999968},{x:0.5358800644907258,y:-0.018100337618145335},{x:0.544321754456429,y:-0.015539578963007873},{x:0.5521016604858822,y:-0.011381132553614504},{x:0.5589208051533947,y:-0.0057848051533946065},{x:0.5645171325536146,y:0.0010343395141179344},{x:0.5686755789630079,y:0.008814245543570992},{x:0.5712363376181454,y:0.01725593550927426},{x:0.5721010000000001,y:0.02603500000000003},{x:0.5721010000000001,y:0.560059},{x:0.5712363376181454,y:0.5688380644907257},{x:0.5686755789630079,y:0.577279754456429},{x:0.5645171325536146,y:0.5850596604858821},{x:0.5589208051533947,y:0.5918788051533946},{x:0.5521016604858822,y:0.5974751325536145},{x:0.544321754456429,y:0.6016335789630078},{x:0.5358800644907258,y:0.6041943376181453},{x:0.527101,y:0.605059},{x:0.5183219355092743,y:0.6041943376181453},{x:0.509880245543571,y:0.6016335789630078},{x:0.5021003395141179,y:0.5974751325536145},{x:0.4952811948466054,y:0.5918788051533946},{x:0.4896848674463855,y:0.5850596604858821},{x:0.4855264210369921,y:0.577279754456429},{x:0.4829656623818547,y:0.5688380644907257},{x:0.48210100000000006,y:0.560059},{x:0.48210100000000006,y:0.5551612473179106},{x:0.48111784979070266,y:0.5559741116228759},{x:0.47906658786156825,y:0.5579287481398052},{x:0.4777260461549398,y:0.558778440075324},{x:0.476502844006682,y:0.5597897782764175},{x:0.474008872962507,y:0.5611345413953497},{x:0.47161569478864906,y:0.5626514387693977},{x:0.3970086947886491,y:0.6002454387693977},{x:0.39545173243232984,y:0.6008467903430146},{x:0.3939797544564291,y:0.6016335789630078},{x:0.39134652561635536,y:0.6024323601988234},{x:0.3887796173011618,y:0.6034237870938969},{x:0.38713525366780027,y:0.6037098355781862},{x:0.3855380644907258,y:0.6041943376181453},{x:0.3827995979159321,y:0.6044640530341434},{x:0.3800885942320307,y:0.6049356509696303},{x:0.37842002129388747,y:0.6048954036817589},{x:0.376759,y:0.605059},{x:0.263722,y:0.605059},{x:0.26219504701733515,y:0.604908608257877},{x:0.26066140118579323,y:0.6049547986330399},{x:0.25781511370268967,y:0.6044772224791067},{x:0.2549429355092742,y:0.6041943376181453},{x:0.2534746624734083,y:0.6037489418620853},{x:0.2519614739213154,y:0.6034950452430072},{x:0.24926304753974865,y:0.6024713624393285},{x:0.24650124554357095,y:0.6016335789630078},{x:0.24514807736385555,y:0.6009102955021357},{x:0.24371349707866236,y:0.6003660689935006},{x:0.16798049707866233,y:0.5627720689935006},{x:0.1654642487594581,y:0.5611982224645521},{x:0.16285190958182658,y:0.5597896123262998},{x:0.16173267757498783,y:0.5588642237445607},{x:0.16050143578237863,y:0.5580941146870384},{x:0.15834057869520102,y:0.5560596134829665},{x:0.15605324108782545,y:0.5541684273021619},{x:0.08031924108782545,y:0.47787942730216193},{x:0.07924694249287094,y:0.47656305714472025},{x:0.07802357952480113,y:0.4753857561141845},{x:0.07646760484406812,y:0.47315109973327435},{x:0.07474784589903924,y:0.4710398973462887},{x:0.07395296229881854,y:0.46953962579412084},{x:0.07298278594430238,y:0.4681462799973844},{x:0.07189266871370663,y:0.46565100631071576},{x:0.07061782960809859,y:0.46324486175923196},{x:0.0701309079335922,y:0.4616183434067253},{x:0.06945120152585271,y:0.46006249834135976},{x:0.032147201525852716,y:0.3450764983413597},{x:0.031582343425880205,y:0.34249647318004567},{x:0.03081566238185464,y:0.3399690644907258},{x:0.030641204072877935,y:0.33819775955415116},{x:0.03026054307811779,y:0.33645906634171463},{x:0.03020987650767869,y:0.3338184172918108},{x:0.029951000000000005,y:0.33119},{x:0.029951000000000005,y:0.25490100000000004}],[{x:0.119951,y:0.2620835578942187},{x:0.119951,y:0.3240730820964405},{x:0.15174843963453788,y:0.42208563822492473},{x:0.21467365091165175,y:0.4854719831046318},{x:0.2742766075147511,y:0.5150589999999999},{x:0.3660620360389177,y:0.5150589999999999},{x:0.4245839309326211,y:0.4855701837142105},{x:0.48210100000000006,y:0.4276323784447675},{x:0.48210100000000006,y:0.15956344905445352},{x:0.4243936225653894,y:0.10143318135145685},{x:0.36578354074375496,y:0.07103500000000003},{x:0.2745522516182332,y:0.07103500000000003},{x:0.21486246778999646,y:0.10153288315838035},{x:0.15170083487400915,y:0.1651582162341545},{x:0.119951,y:0.2620835578942187}]],b:[[{x:0.03166000000000001,y:0.04001500000000002},{x:0.03252466238185464,y:0.031235935509274233},{x:0.0350854210369921,y:0.022794245543570978},{x:0.039243867446385465,y:0.015014339514117927},{x:0.04484019484660537,y:0.008195194846605386},{x:0.05165933951411792,y:0.002598867446385482},{x:0.05943924554357097,y:-0.0015595789630078807},{x:0.06788093550927424,y:-0.004120337618145342},{x:0.07666,y:-0.0049849999999999756},{x:0.08543906449072577,y:-0.004120337618145342},{x:0.09388075445642904,y:-0.0015595789630078807},{x:0.10166066048588211,y:0.002598867446385489},{x:0.10847980515339464,y:0.008195194846605386},{x:0.11407613255361454,y:0.015014339514117927},{x:0.1182345789630079,y:0.022794245543570985},{x:0.12079533761814537,y:0.031235935509274254},{x:0.12166,y:0.04001500000000002},{x:0.12166,y:0.041388769861289504},{x:0.12338630711141785,y:0.04010106584896898},{x:0.12512540667363178,y:0.03853443023544684},{x:0.12691331624345048,y:0.03747016444054036},{x:0.12858112311649333,y:0.036226097502515},{x:0.13069431360107225,y:0.035219499067818724},{x:0.13270563229917137,y:0.034022247411931134},{x:0.20674863229917137,y:-0.0007227525880688923},{x:0.20772794171481185,y:-0.0010698043626217635},{x:0.20864424554357097,y:-0.0015595789630078669},{x:0.21187816153300185,y:-0.0025405766534664824},{x:0.21506348921487128,y:-0.003669406425619949},{x:0.21609168791714548,y:-0.0038187359083884913},{x:0.21708593550927424,y:-0.004120337618145342},{x:0.22044909586509742,y:-0.004451580001305548},{x:0.22379344213248661,y:-0.004937293022731791},{x:0.22483101702188665,y:-0.00488316156543817},{x:0.225865,y:-0.0049849999999999756},{x:0.338045,y:-0.0049849999999999756},{x:0.33894984805462636,y:-0.004895880245274822},{x:0.33985755144997865,y:-0.004948481373678995},{x:0.343332465401001,y:-0.004464230112452937},{x:0.3468240644907258,y:-0.004120337618145342},{x:0.3476941397420575,y:-0.003856403176165039},{x:0.34859466384226984,y:-0.0037309094409420443},{x:0.351908335561611,y:-0.0025780408502315546},{x:0.35526575445642905,y:-0.0015595789630078807},{x:0.35606762040050133,y:-0.0011309726863615623},{x:0.35692635856942223,y:-0.0008322067413783357},{x:0.43209235856942224,y:0.03391279325862169},{x:0.4342218624454842,y:0.03516383683568551},{x:0.43645162164562873,y:0.03622594356254809},{x:0.4380158580934015,y:0.037392738102356306},{x:0.4396984532755396,y:0.03838123120587913},{x:0.4415429728374372,y:0.04002368192832182},{x:0.4435226810964235,y:0.04150038501262054},{x:0.5186856810964235,y:0.11000138501262047},{x:0.5200684051728882,y:0.11153543836568303},{x:0.5216038163727121,y:0.1129166544997947},{x:0.5230144082918019,y:0.11480386048953693},{x:0.5245918796416693,y:0.11655397481445093},{x:0.5256487561000858,y:0.11832830784782436},{x:0.5268852029038621,y:0.11998252816661786},{x:0.5279005150705119,y:0.12210866485417524},{x:0.5291062453835067,y:0.12413290061668979},{x:0.5297966590542814,y:0.12607932670695898},{x:0.530686625504748,y:0.12794298045128052},{x:0.567704625504748,y:0.2301969804512806},{x:0.5685418230641662,y:0.23348712941632632},{x:0.5695273376181453,y:0.23673593550927427},{x:0.5696276430094915,y:0.2377543532384077},{x:0.5698799976366801,y:0.23874609563675617},{x:0.5700592324586751,y:0.24213635445346285},{x:0.570392,y:0.24551500000000004},{x:0.570392,y:0.314017},{x:0.570065993218988,y:0.3173270023951309},{x:0.5699006262411136,y:0.32064890697528625},{x:0.569634437926433,y:0.3217086568121163},{x:0.5695273376181453,y:0.3227960644907258},{x:0.5685618455328773,y:0.32597886535008125},{x:0.5677515846008636,y:0.32920467896823863},{x:0.5307335846008636,y:0.4324506789682387},{x:0.5298196963817511,y:0.43437967657309706},{x:0.5291061063615623,y:0.4363913954201699},{x:0.5279358002551,y:0.43835612690926706},{x:0.5269566878799311,y:0.4404227969757902},{x:0.5256840310027916,y:0.4421364386856148},{x:0.5245916855370664,y:0.44397028841230757},{x:0.523060566435399,y:0.4456689527415915},{x:0.5216970801011935,y:0.44750489697372575},{x:0.5201145620561008,y:0.4489373284986299},{x:0.5186854393684929,y:0.45052283528838016},{x:0.44352243936849295,y:0.5190228352883801},{x:0.44134657552661755,y:0.5206458300432604},{x:0.43929971954126384,y:0.5224287703137037},{x:0.4378191137317927,y:0.523276992839783},{x:0.43645134158383936,y:0.5242972253466508},{x:0.43400065578620683,y:0.5254645447348341},{x:0.43164529517316985,y:0.52681390451462},{x:0.35647929517316984,y:0.56056790451462},{x:0.3558506134628383,y:0.560778965311121},{x:0.35526575445642905,y:0.5610915789630079},{x:0.351674330744245,y:0.5621810254355277},{x:0.34811645117964274,y:0.5633754754766519},{x:0.34745867349333664,y:0.563459831081816},{x:0.3468240644907258,y:0.5636523376181454},{x:0.3430891085149791,y:0.5640201986736739},{x:0.3393665669654169,y:0.5644975898222324},{x:0.3387049713307353,y:0.5644519984974604},{x:0.338045,y:0.564517},{x:0.225865,y:0.564517},{x:0.22507819619617456,y:0.5644395065891945},{x:0.22428916125732748,y:0.5644893996719887},{x:0.22069487882474298,y:0.5640077875099223},{x:0.21708593550927424,y:0.5636523376181454},{x:0.21632936813438544,y:0.5634228354140474},{x:0.21554576062305134,y:0.5633178367349442},{x:0.2121144991913443,y:0.5621442688983362},{x:0.20864424554357097,y:0.5610915789630079},{x:0.20794698905754733,y:0.5607188876066144},{x:0.20719892257093525,y:0.5604630322059678},{x:0.13315592257093525,y:0.5267090322059678},{x:0.13091775246116674,y:0.5254099486077729},{x:0.12858140317750869,y:0.5242970714087468},{x:0.1271119341080524,y:0.5232009671819817},{x:0.12552641140636125,y:0.5222806946221156},{x:0.12358468574515913,y:0.5205699272235509},{x:0.12166,y:0.5191342684374534},{x:0.12166,y:0.7597659999999999},{x:0.12079533761814537,y:0.7685450644907257},{x:0.1182345789630079,y:0.776986754456429},{x:0.11407613255361454,y:0.7847666604858821},{x:0.10847980515339464,y:0.7915858051533946},{x:0.10166066048588208,y:0.7971821325536145},{x:0.09388075445642904,y:0.8013405789630078},{x:0.08543906449072577,y:0.8039013376181453},{x:0.07666,y:0.804766},{x:0.06788093550927421,y:0.8039013376181453},{x:0.05943924554357094,y:0.8013405789630078},{x:0.05165933951411792,y:0.7971821325536145},{x:0.04484019484660537,y:0.7915858051533946},{x:0.039243867446385465,y:0.7847666604858821},{x:0.0350854210369921,y:0.776986754456429},{x:0.03252466238185464,y:0.7685450644907257},{x:0.03166000000000001,y:0.7597659999999999},{x:0.03166000000000001,y:0.04001500000000002}],[{x:0.12166,y:0.16313400296117606},{x:0.12166,y:0.39738980161800674},{x:0.17691400696537596,y:0.447746357818324},{x:0.23563826658076475,y:0.474517},{x:0.3284048540018634,y:0.474517},{x:0.3882155063572531,y:0.44765846343288423},{x:0.44979135555302596,y:0.39154114946310603},{x:0.480392,y:0.30619363915535625},{x:0.480392,y:0.2534097446111891},{x:0.44984564070758065,y:0.16903221413717517},{x:0.38802932067077023,y:0.11269492399652684},{x:0.3281476350434013,y:0.08501500000000002},{x:0.2358983461114888,y:0.08501500000000002},{x:0.1771018588393058,y:0.11260550754658781},{x:0.12166,y:0.16313400296117606}]],c:[[{x:0.0446,y:0.25490100000000004},{x:0.044822712444716174,y:0.2526397626013558},{x:0.04482893549381362,y:0.2503675925637664},{x:0.045254001037800355,y:0.24826081602954003},{x:0.045464662381854634,y:0.24612193550927428},{x:0.04612424100165128,y:0.2439475961957434},{x:0.04657362286091401,y:0.24172029932495478},{x:0.08145962286091402,y:0.1278402993249547},{x:0.08196610920465827,y:0.1266269431042867},{x:0.08230081253195312,y:0.125355433994083},{x:0.08366176737769918,y:0.12256476567779218},{x:0.08485778977199918,y:0.11969953302126297},{x:0.0855912581784792,y:0.11860830168404396},{x:0.08616758939694805,y:0.11742652164475936},{x:0.08804682625741464,y:0.11495498435675963},{x:0.08977884657839008,y:0.1123781387363477},{x:0.09071111026807865,y:0.11145096769089737},{x:0.09150692129220603,y:0.11040433186669174},{x:0.16233292129220603,y:0.03411333186669174},{x:0.16445877247754231,y:0.03223237849112975},{x:0.1664474797904295,y:0.03020697184383589},{x:0.16775479669311927,y:0.029316055882572942},{x:0.16893962068732413,y:0.02826772347496185},{x:0.17139158003796548,y:0.02683764508339147},{x:0.17373721213250964,y:0.02523913360696181},{x:0.24456521213250962,y:-0.013455866393038113},{x:0.2467886390083486,y:-0.014400746043602006},{x:0.24891924554357092,y:-0.015539578963007873},{x:0.25083834630720225,y:-0.016121731815163746},{x:0.25268405147305695,y:-0.01690609278116076},{x:0.2550490927002279,y:-0.01739904776899966},{x:0.2573609355092742,y:-0.018100337618145335},{x:0.259356733677244,y:-0.018296906580526337},{x:0.26131999536931183,y:-0.018706117055345653},{x:0.26373576373978486,y:-0.0187282033967292},{x:0.26614,y:-0.018964999999999968},{x:0.371854,y:-0.018964999999999968},{x:0.3744001776009888,y:-0.018714223394882004},{x:0.3769583677219744,y:-0.018674567546095353},{x:0.3787793796063011,y:-0.01828290964379429},{x:0.3806330644907258,y:-0.018100337618145335},{x:0.3830813939144215,y:-0.01735764500708899},{x:0.3855826926572475,y:-0.01681967299983559},{x:0.38729230564255435,y:-0.01608027889939661},{x:0.3890747544564291,y:-0.015539578963007873},{x:0.391331147776118,y:-0.014333511606549179},{x:0.393679431632842,y:-0.013317897403369645},{x:0.463449431632842,y:0.02537710259663028},{x:0.46566730315778443,y:0.026909287408228903},{x:0.46799586592077425,y:0.028267352155161442},{x:0.4692879686356918,y:0.029410572352257962},{x:0.47070743151062955,y:0.03039118797094862},{x:0.4725837728278355,y:0.03232661755101331},{x:0.4746026476214732,y:0.03411286752390576},{x:0.5454306476214732,y:0.11040386752390575},{x:0.5507700783887176,y:0.11742598212342069},{x:0.5546369668925095,y:0.12535484002769406},{x:0.5568827107762242,y:0.13388573967401945},{x:0.5574210073618384,y:0.14269084337317217},{x:0.5562311702134469,y:0.15143177592795284},{x:0.5533589241053942,y:0.15977262820225266},{x:0.5489146478448386,y:0.16739286592077418},{x:0.5430691324760942,y:0.17399964762147313},{x:0.5360470178765793,y:0.17933907838871752},{x:0.5281181599723059,y:0.18320596689250943},{x:0.5195872603259806,y:0.1854517107762242},{x:0.5107821566268278,y:0.1859900073618383},{x:0.5020412240720471,y:0.18480017021344686},{x:0.4937003717977473,y:0.18192792410539416},{x:0.4860801340792258,y:0.17748364784483847},{x:0.47947335237852684,y:0.17163813247609414},{x:0.41352572033101553,y:0.10060392571412592},{x:0.36021071976053953,y:0.07103500000000003},{x:0.27763077403847125,y:0.07103500000000003},{x:0.2233107097601157,y:0.10071132697875086},{x:0.16448866962379677,y:0.16407213041308155},{x:0.1346,y:0.2616391113440561},{x:0.1346,y:0.3245158400933278},{x:0.1645319520417492,y:0.4231721923699009},{x:0.2231207776861973,y:0.4862793045993598},{x:0.27734241586879393,y:0.5150589999999999},{x:0.3605019191882548,y:0.5150589999999999},{x:0.41371701660545657,y:0.4863852380349392},{x:0.47947395272027693,y:0.4155592208902026},{x:0.48608084903755494,y:0.4097138350672089},{x:0.4937011738972078,y:0.40526970822380387},{x:0.5020420824884065,y:0.4023976256622846},{x:0.5107830383716269,y:0.4012079599048077},{x:0.5195881315142611,y:0.40174642913926084},{x:0.5281189871247909,y:0.40399234029494097},{x:0.5360477692062626,y:0.4078593842656568},{x:0.5430697791097975,y:0.41319895272027696},{x:0.5489151649327911,y:0.41980584903755497},{x:0.5533592917761961,y:0.42742617389720783},{x:0.5562313743377155,y:0.4357670824884066},{x:0.5574210400951923,y:0.4445080383716269},{x:0.5568825708607392,y:0.4533131315142611},{x:0.5546366597050592,y:0.4618439871247909},{x:0.5507696157343432,y:0.46977276920626265},{x:0.5454300472797231,y:0.4767947791097975},{x:0.4746020472797231,y:0.5530827791097974},{x:0.47237947035514305,y:0.5550491819442839},{x:0.4702881116089302,y:0.5571546051529963},{x:0.469083054274185,y:0.5579656532949738},{x:0.4679951509624451,y:0.5589281649327911},{x:0.46543165406806053,y:0.5604231806402761},{x:0.46296973250196366,y:0.5620801448811513},{x:0.39319973250196366,y:0.5996741448811513},{x:0.39109075852725916,y:0.6005560023370271},{x:0.3890747544564291,y:0.6016335789630078},{x:0.38703122642603144,y:0.6022534764138876},{x:0.38506104886577136,y:0.6030772968079529},{x:0.3828205563795885,y:0.6035307692082409},{x:0.3806330644907258,y:0.6041943376181453},{x:0.3785078662851109,y:0.6044036513718285},{x:0.37641482574826585,y:0.6048272797133635},{x:0.3741289156203665,y:0.604834940368031},{x:0.371854,y:0.605059},{x:0.26614,y:0.605059},{x:0.26400488750824663,y:0.6048487097743618},{x:0.26185945318827825,y:0.6048549475733314},{x:0.2596259398913868,y:0.6044174210783497},{x:0.2573609355092742,y:0.6041943376181453},{x:0.2553078741931944,y:0.60357154827667},{x:0.25320244685788745,y:0.6031591127457343},{x:0.2510972070775077,y:0.6022942563713519},{x:0.24891924554357092,y:0.6016335789630078},{x:0.24702713339817148,y:0.6006222239508241},{x:0.24504262343928468,y:0.5998069647561404},{x:0.1742146234392847,y:0.5622129647561404},{x:0.17162525666515238,y:0.5604936738034747},{x:0.16894033563687538,y:0.5589277936219744},{x:0.16795812189104978,y:0.5580587651214349},{x:0.16686556037036515,y:0.5573333247718834},{x:0.16466136457832586,y:0.5551419091149951},{x:0.16233352162359432,y:0.5530823147741101},{x:0.09150752162359431,y:0.47679431477411016},{x:0.09067474586023959,y:0.4756991081857825},{x:0.08970182133886938,y:0.4747262717047309},{x:0.08801053269383365,y:0.4721953272870651},{x:0.08616805203977476,y:0.4697722296898647},{x:0.08556494203519081,y:0.46853560069719197},{x:0.08480050296804506,y:0.467391648838166},{x:0.08363547472152838,y:0.4645793817614187},{x:0.08230111970711389,y:0.461843393160995},{x:0.08195085264054901,y:0.4605128647226562},{x:0.08142427599227564,y:0.4592417589140625},{x:0.046538275992275634,y:0.3442567589140625},{x:0.04610669192420131,y:0.34208755224892967},{x:0.045464662381854634,y:0.33997106449072584},{x:0.04524807462900009,y:0.3377720121321243},{x:0.04481688692083,y:0.3356047976316928},{x:0.044816786846426454,y:0.33339307378956023},{x:0.0446,y:0.33119200000000004},{x:0.0446,y:0.25490100000000004}]],d:[[{x:0.03166100000000001,y:0.24551500000000004},{x:0.03199378652782141,y:0.24213616168032864},{x:0.032173060891358886,y:0.2387457109778176},{x:0.032425376075824915,y:0.237754159461938},{x:0.03252566238185464,y:0.23673593550927427},{x:0.03351123316568353,y:0.23348694405135337},{x:0.034348506941927405,y:0.23019661460170962},{x:0.0713675069419274,y:0.12794261460170955},{x:0.07225746993456125,y:0.1260790095358921},{x:0.0729478813145148,y:0.12413263082247869},{x:0.07415364826248581,y:0.12210836405190925},{x:0.07516899837159816,y:0.11998219518580837},{x:0.07640543228727825,y:0.1183280219355851},{x:0.07746229725612473,y:0.11655373492181778},{x:0.07903981058640837,y:0.11480359733178996},{x:0.08045044599662987,y:0.11291636718401242},{x:0.08198583537337678,y:0.11153519469971836},{x:0.08336853920306012,y:0.1100011842405046},{x:0.15853253920306012,y:0.04150018424050468},{x:0.16051177365736521,y:0.04002385498013544},{x:0.16235580937568672,y:0.038381768082408986},{x:0.16403890527939927,y:0.03739293492543645},{x:0.16560363358955885,y:0.03622578962650935},{x:0.16783285515961555,y:0.03516395710594637},{x:0.16996181351033893,y:0.03391317596960988},{x:0.24512381351033893,y:-0.0008318240303901436},{x:0.24598297689097734,y:-0.0011307574341723537},{x:0.24678524554357095,y:-0.0015595789630078807},{x:0.25014222995258023,y:-0.0025779090504023904},{x:0.2534554494825366,y:-0.0037306956028641883},{x:0.25435642329373365,y:-0.003856270624521421},{x:0.2552269355092742,y:-0.004120337618145342},{x:0.2587180827488419,y:-0.0044641856090968535},{x:0.2621925371943035,y:-0.004948444626188875},{x:0.2631006975177666,y:-0.004895835488062085},{x:0.264006,y:-0.0049849999999999756},{x:0.376189,y:-0.0049849999999999756},{x:0.37722298297811335,y:-0.004883161565438171},{x:0.3782605578675134,y:-0.004937293022731791},{x:0.3816049041349026,y:-0.004451580001305548},{x:0.3849680644907258,y:-0.004120337618145342},{x:0.3859623120828546,y:-0.003818735908388489},{x:0.38699051078512875,y:-0.003669406425619949},{x:0.39017583846699794,y:-0.0025405766534665605},{x:0.39340975445642906,y:-0.0015595789630078807},{x:0.39432605828518835,y:-0.0010698043626217065},{x:0.39530536770082864,y:-0.0007227525880688923},{x:0.46934836770082866,y:0.034022247411931134},{x:0.4713599418403825,y:0.035219651121148166},{x:0.4734733873673339,y:0.03622640539423388},{x:0.4751409393435705,y:0.037470316580519136},{x:0.4769285933263682,y:0.03853443023544684},{x:0.47866791375766776,y:0.04010126481479184},{x:0.480392,y:0.041387347763641016},{x:0.480392,y:0.04001500000000002},{x:0.4812566623818546,y:0.031235935509274233},{x:0.48381742103699205,y:0.022794245543570978},{x:0.48797586744638544,y:0.015014339514117927},{x:0.4935721948466053,y:0.008195194846605386},{x:0.5003913395141178,y:0.002598867446385482},{x:0.508171245543571,y:-0.0015595789630078807},{x:0.5166129355092742,y:-0.004120337618145342},{x:0.525392,y:-0.0049849999999999756},{x:0.5341710644907257,y:-0.004120337618145342},{x:0.542612754456429,y:-0.0015595789630078807},{x:0.5503926604858821,y:0.002598867446385489},{x:0.5572118051533946,y:0.008195194846605386},{x:0.5628081325536145,y:0.015014339514117927},{x:0.5669665789630078,y:0.022794245543570985},{x:0.5695273376181453,y:0.031235935509274254},{x:0.570392,y:0.04001500000000002},{x:0.570392,y:0.7597659999999999},{x:0.5695273376181453,y:0.7685450644907257},{x:0.5669665789630078,y:0.776986754456429},{x:0.5628081325536145,y:0.7847666604858821},{x:0.5572118051533946,y:0.7915858051533946},{x:0.5503926604858821,y:0.7971821325536145},{x:0.542612754456429,y:0.8013405789630078},{x:0.5341710644907257,y:0.8039013376181453},{x:0.525392,y:0.804766},{x:0.5166129355092742,y:0.8039013376181453},{x:0.508171245543571,y:0.8013405789630078},{x:0.5003913395141178,y:0.7971821325536145},{x:0.4935721948466053,y:0.7915858051533946},{x:0.48797586744638544,y:0.7847666604858821},{x:0.48381742103699205,y:0.776986754456429},{x:0.4812566623818546,y:0.7685450644907257},{x:0.480392,y:0.7597659999999999},{x:0.480392,y:0.5191356905079497},{x:0.47846953719699326,y:0.5205697307992189},{x:0.47652758859363875,y:0.5222806946221157},{x:0.47494232329576636,y:0.5232008177790934},{x:0.47347310730786674,y:0.524296763521154},{x:0.4711365045177018,y:0.5254097994515352},{x:0.46889807742906475,y:0.5267090322059679},{x:0.3948550774290648,y:0.5604630322059679},{x:0.3941070109424522,y:0.5607188876066146},{x:0.39340975445642906,y:0.5610915789630079},{x:0.389939500808656,y:0.5621442688983361},{x:0.38650823937694867,y:0.5633178367349442},{x:0.38572463186561456,y:0.5634228354140474},{x:0.3849680644907258,y:0.5636523376181454},{x:0.38135912117525683,y:0.5640077875099224},{x:0.3777648387426725,y:0.5644893996719887},{x:0.3769758038038255,y:0.5644395065891945},{x:0.376189,y:0.564517},{x:0.264006,y:0.564517},{x:0.26334558239453953,y:0.5644519545432365},{x:0.2626835384795895,y:0.5644975635305632},{x:0.2589614482177297,y:0.5640201550156564},{x:0.2552269355092742,y:0.5636523376181454},{x:0.25459189738202526,y:0.5634597009082802},{x:0.2539336765832372,y:0.5633752751711479},{x:0.2503762430229788,y:0.5621808961392286},{x:0.24678524554357095,y:0.5610915789630079},{x:0.24619999105363047,y:0.5607787539207695},{x:0.24557088842716707,y:0.5605675378929096},{x:0.17040888842716706,y:0.5268135378929095},{x:0.16805407047382528,y:0.5254644267942322},{x:0.16560391365212207,y:0.5242973792806265},{x:0.16423565717286473,y:0.5232767996121171},{x:0.1627545512703112,y:0.5224282514648534},{x:0.16070817900232118,y:0.5206456609648356},{x:0.15853278093215223,y:0.5190230360586235},{x:0.08336878093215222,y:0.45052303605862365},{x:0.08193967718325436,y:0.44893757139643337},{x:0.08035717944512263,y:0.44750518296134467},{x:0.07899365114577664,y:0.44566921514174185},{x:0.07746249136223225,y:0.4439705283033309},{x:0.07637015625263606,y:0.44213672358948825},{x:0.0750975108858587,y:0.44042312810321155},{x:0.07411836195358443,y:0.43835642671545355},{x:0.07294802033824888,y:0.4363916652130956},{x:0.07223443169362759,y:0.4343799925343442},{x:0.07132054574594202,y:0.4324510425104215},{x:0.034301545745942026,y:0.32920504251042143},{x:0.033491210284420626,y:0.32597904935505284},{x:0.03252566238185464,y:0.3227960644907258},{x:0.03241858101312289,y:0.3217088491086539},{x:0.03215243067755317,y:0.32064928896150824},{x:0.031987025628206905,y:0.31732719375391183},{x:0.03166100000000001,y:0.314017},{x:0.03166100000000001,y:0.24551500000000004}],[{x:0.121661,y:0.25340994514221},{x:0.121661,y:0.3061934402169761},{x:0.15226243948714763,y:0.39154086238640384},{x:0.21383969339611897,y:0.4476587099299689},{x:0.27364661400534074,y:0.474517},{x:0.3664157334192352,y:0.474517},{x:0.42513971513426946,y:0.4477464845048247},{x:0.480392,y:0.3973901578243758},{x:0.480392,y:0.1631336467554691},{x:0.4249518651426514,y:0.1126053780239199},{x:0.3661556538885112,y:0.08501500000000002},{x:0.2739038430667855,y:0.08501500000000002},{x:0.21402588591940364,y:0.11269467351967463},{x:0.15220815290195538,y:0.1690325018607451},{x:0.121661,y:0.25340994514221}]],e:[[{x:0.014571,y:0.25490100000000004},{x:0.014880046743786594,y:0.2517631957525991},{x:0.01501248842711947,y:0.2486129918567585},{x:0.015311525398480692,y:0.24738231945287367},{x:0.015435662381854634,y:0.24612193550927428},{x:0.016350926120166094,y:0.24310471531940006},{x:0.01709539726614681,y:0.24004087979874045},{x:0.05693639726614681,y:0.12616087979874036},{x:0.057746546207777846,y:0.12441615547982068},{x:0.05835851556287996,y:0.12259245107255745},{x:0.05959975008908581,y:0.12042512406141898},{x:0.06065161969764369,y:0.11815983382640528},{x:0.06178658068373706,y:0.11660668611395116},{x:0.06274257829935428,y:0.11493741297405176},{x:0.06438278737670251,y:0.11305388338712186},{x:0.06585638180708843,y:0.11103732964943176},{x:0.06727253892344205,y:0.10973544513901749},{x:0.06853582634733585,y:0.1082847524971091},{x:0.14942282634733584,y:0.031993752497109104},{x:0.15144602889400902,y:0.03043003785468449},{x:0.15333307828862142,y:0.02870446646813117},{x:0.1549277151407192,y:0.027739074573098352},{x:0.15640262843323158,y:0.02659912765300345},{x:0.15869202130341495,y:0.025460166585296706},{x:0.1608794538505091,y:0.024135896643135493},{x:0.2417664538505091,y:-0.01455910335686443},{x:0.24290092295632487,y:-0.014970686687880902},{x:0.2439652455435709,y:-0.015539578963007873},{x:0.24703931387581265,y:-0.016472087396775758},{x:0.2500591116803148,y:-0.017567664555291233},{x:0.2512520782049556,y:-0.01775001548484057},{x:0.2524069355092742,y:-0.018100337618145335},{x:0.25560385985111694,y:-0.01841520718300011},{x:0.2587793695882151,y:-0.01890059980751419},{x:0.2599849884971624,y:-0.018846710691637396},{x:0.261186,y:-0.018964999999999968},{x:0.381914,y:-0.018964999999999968},{x:0.3832466926412995,y:-0.01883374123151461},{x:0.3845848263549422,y:-0.018885671038862982},{x:0.3876272824249201,y:-0.01840229079619376},{x:0.39069306449072577,y:-0.018100337618145335},{x:0.3919745425012029,y:-0.017711605513551366},{x:0.39329709535359264,y:-0.017501480567117658},{x:0.39618678867610163,y:-0.016433834605858122},{x:0.39913475445642904,y:-0.015539578963007873},{x:0.4003157713548023,y:-0.014908312279081314},{x:0.40157191838151796,y:-0.014444207562717595},{x:0.48125191838151804,y:0.02425079243728233},{x:0.4833189661071789,y:0.02551885102394819},{x:0.4854901362659954,y:0.026598980192539007},{x:0.48706966813422276,y:0.027819770278194},{x:0.48877129863032925,y:0.028863658687316496},{x:0.4905512426555404,y:0.030510612890229178},{x:0.492469971641239,y:0.03199356196515255},{x:0.573357971641239,y:0.10828456196515254},{x:0.5791512607417543,y:0.11493718669263933},{x:0.5835353707163221,y:0.12259219773755695},{x:0.5863418226772573,y:0.13095541731842886},{x:0.5874627662495775,y:0.13970545159690978},{x:0.5868551242004307,y:0.1485060416627534},{x:0.584542247872996,y:0.15701898577515713},{x:0.5806130198074609,y:0.16491713626599536},{x:0.5752184380348474,y:0.17189697164123896},{x:0.5685658133073607,y:0.17769026074175415},{x:0.560910802262443,y:0.1820743707163221},{x:0.5525475826815711,y:0.18488082267725728},{x:0.5437975484030901,y:0.18600176624957743},{x:0.5349969583372466,y:0.1853941242004306},{x:0.5264840142248428,y:0.183081247872996},{x:0.5185858637340046,y:0.17915201980746093},{x:0.511606028358761,y:0.17375743803484736},{x:0.43573388395098006,y:0.1021972341849065},{x:0.3715652104827451,y:0.07103500000000003},{x:0.2713955768569904,y:0.07103500000000003},{x:0.2060606884620834,y:0.10229012760321096},{x:0.13826613078700495,y:0.16623259795801962},{x:0.104571,y:0.2625454790108076},{x:0.104571,y:0.28619200000000006},{x:0.542482,y:0.28619200000000006},{x:0.5512610644907258,y:0.2870566623818547},{x:0.559702754456429,y:0.2896174210369921},{x:0.5674826604858821,y:0.2937758674463855},{x:0.5743018051533947,y:0.2993721948466054},{x:0.5798981325536146,y:0.3061913395141179},{x:0.5840565789630079,y:0.31397124554357103},{x:0.5866173376181454,y:0.32241293550927425},{x:0.5874820000000001,y:0.33119200000000004},{x:0.5866173376181454,y:0.33997106449072584},{x:0.5840565789630079,y:0.34841275445642905},{x:0.5798981325536146,y:0.35619266048588216},{x:0.5743018051533947,y:0.3630118051533947},{x:0.5674826604858821,y:0.3686081325536146},{x:0.5660433240263831,y:0.3693774739195968},{x:0.5706944449992851,y:0.3724210772554575},{x:0.5769918122169339,y:0.3785986803904119},{x:0.5819629867044116,y:0.38588613801169297},{x:0.5854169290140312,y:0.3940033972097681},{x:0.5872209060798271,y:0.40263851626586683},{x:0.5873055920748429,y:0.4114596523972937},{x:0.5856677325637826,y:0.4201278142894682},{x:0.5823702695691338,y:0.4283098893420352},{x:0.5425292695691338,y:0.5045998893420351},{x:0.54083893518448,y:0.5071829952333479},{x:0.5393041274419548,y:0.5098614335042745},{x:0.5384286685906833,y:0.5108662746451583},{x:0.5376989227445426,y:0.5119814449992851},{x:0.5355371287009763,y:0.5141851493557908},{x:0.5335092744740836,y:0.5165126960496618},{x:0.49246227447408364,y:0.5552086960496617},{x:0.4903478252727746,y:0.5568421196453192},{x:0.48836639942178184,y:0.5586345815458318},{x:0.486865329057947,y:0.5595323670561179},{x:0.4854811710293013,y:0.5606016367187369},{x:0.48308868524123094,y:0.5617911659624512},{x:0.4807956399629947,y:0.5631626292028359},{x:0.40111563996299465,y:0.6007566292028359},{x:0.40009264564938235,y:0.6011215754533451},{x:0.39913475445642904,y:0.6016335789630078},{x:0.3959457374462889,y:0.6026009566970012},{x:0.3928069722488333,y:0.6037206897930685},{x:0.3917324370025758,y:0.603879047413643},{x:0.39069306449072577,y:0.6041943376181453},{x:0.38737659751458814,y:0.6045209811048129},{x:0.38407969371999856,y:0.6050068561303112},{x:0.38299491132800306,y:0.6049525395264004},{x:0.381914,y:0.605059},{x:0.261186,y:0.605059},{x:0.26023449599616577,y:0.6049652850353624},{x:0.2592798763752433,y:0.6050186117946668},{x:0.25585213857488087,y:0.6045336605029273},{x:0.2524069355092742,y:0.6041943376181453},{x:0.2514919972706982,y:0.6039167941377678},{x:0.2505453168634681,y:0.6037828591890964},{x:0.24727805138745723,y:0.6026385076291858},{x:0.2439652455435709,y:0.6016335789630078},{x:0.24312203363365809,y:0.6011828728071931},{x:0.24221967283726598,y:0.6008668231955117},{x:0.161332672837266,y:0.5632728231955116},{x:0.15891596978001063,y:0.5618462817840929},{x:0.15640337688314435,y:0.5605963413854953},{x:0.1551260781006526,y:0.5596091689500753},{x:0.15373589412748892,y:0.5587885654418143},{x:0.1516439317651508,y:0.5569179592459522},{x:0.1494234689111216,y:0.555201853544281},{x:0.06853646891112161,y:0.47891385354428107},{x:0.06722863655802509,y:0.4774120673763562},{x:0.06576662511800205,y:0.47605991734502884},{x:0.06433886916992998,y:0.4740937424536807},{x:0.06274309028364713,y:0.4722613067803989},{x:0.06175337150959475,y:0.4705332315776763},{x:0.06058324359446483,y:0.4689218384474283},{x:0.05956650326928079,y:0.4667149016876259},{x:0.05835887729241062,y:0.4646063547351938},{x:0.05772530643484857,y:0.4627183994585984},{x:0.05689202940417486,y:0.4609096881637455},{x:0.017051029404174856,y:0.3459246881637455},{x:0.016331419439147486,y:0.342923979771159},{x:0.015435662381854634,y:0.33997106449072584},{x:0.015304912520774374,y:0.33864353887302173},{x:0.014993833838408223,y:0.33734636893611664},{x:0.014873460143664087,y:0.33426292937408214},{x:0.014571,y:0.33119200000000004},{x:0.014571,y:0.25490100000000004}],[{x:0.12278767041868709,y:0.376192},{x:0.13831799224413532,y:0.421014018902617},{x:0.20587340146207272,y:0.4847284236699839},{x:0.27113246747276615,y:0.5150589999999999},{x:0.37183117966561724,y:0.5150589999999999},{x:0.4359272756482788,y:0.48481767680255794},{x:0.4662598881310508,y:0.45622238914125884},{x:0.5025937304308662,y:0.3866481106579649},{x:0.5074240772554575,y:0.379266555000715},{x:0.5104401600015575,y:0.376192},{x:0.12278767041868709,y:0.376192}]],f:[[{x:0.044112,y:0.5239119999999999},{x:0.04497666238185463,y:0.5151329355092742},{x:0.04753742103699209,y:0.5066912455435709},{x:0.051695867446385456,y:0.4989113395141178},{x:0.05729219484660536,y:0.49209219484660527},{x:0.0641113395141179,y:0.4864958674463854},{x:0.07189124554357096,y:0.482337421036992},{x:0.08033293550927423,y:0.47977666238185457},{x:0.089112,y:0.47891199999999995},{x:0.20304699999999998,y:0.47891199999999995},{x:0.20304699999999998,y:0.05318299999999998},{x:0.20391166238185462,y:0.04440393550927419},{x:0.2064724210369921,y:0.03596224554357094},{x:0.21063086744638546,y:0.028182339514117884},{x:0.21622719484660535,y:0.021363194846605343},{x:0.2230463395141179,y:0.01576686744638544},{x:0.23082624554357095,y:0.011608421036992077},{x:0.23926793550927422,y:0.009047662381854615},{x:0.248047,y:0.008182999999999982},{x:0.25682606449072576,y:0.009047662381854615},{x:0.26526775445642903,y:0.011608421036992077},{x:0.2730476604858821,y:0.015766867446385446},{x:0.2798668051533946,y:0.021363194846605343},{x:0.28546313255361455,y:0.028182339514117884},{x:0.2896215789630079,y:0.03596224554357094},{x:0.2921823376181454,y:0.04440393550927421},{x:0.293047,y:0.05318299999999998},{x:0.293047,y:0.47891199999999995},{x:0.459965,y:0.47891199999999995},{x:0.4687440644907258,y:0.47977666238185457},{x:0.4771857544564291,y:0.482337421036992},{x:0.48496566048588213,y:0.4864958674463854},{x:0.4917848051533946,y:0.49209219484660527},{x:0.49738113255361455,y:0.4989113395141178},{x:0.5015395789630079,y:0.5066912455435709},{x:0.5041003376181454,y:0.5151329355092742},{x:0.504965,y:0.5239119999999999},{x:0.5041003376181454,y:0.5326910644907257},{x:0.5015395789630079,y:0.5411327544564289},{x:0.49738113255361455,y:0.548912660485882},{x:0.4917848051533946,y:0.5557318051533946},{x:0.48496566048588213,y:0.5613281325536145},{x:0.4771857544564291,y:0.5654865789630078},{x:0.4687440644907258,y:0.5680473376181453},{x:0.459965,y:0.568912},{x:0.293047,y:0.568912},{x:0.293047,y:0.6141229501499061},{x:0.3322669208002554,y:0.6884371453882767},{x:0.4140490730325775,y:0.7147659999999999},{x:0.512941,y:0.7147659999999999},{x:0.5217200644907257,y:0.7156306623818546},{x:0.530161754456429,y:0.7181914210369921},{x:0.5379416604858821,y:0.7223498674463854},{x:0.5447608051533946,y:0.7279461948466053},{x:0.5503571325536145,y:0.7347653395141178},{x:0.5545155789630078,y:0.7425452455435709},{x:0.5570763376181453,y:0.7509869355092742},{x:0.557941,y:0.7597659999999999},{x:0.5570763376181453,y:0.7685450644907257},{x:0.5545155789630078,y:0.776986754456429},{x:0.5503571325536145,y:0.7847666604858821},{x:0.5447608051533946,y:0.7915858051533946},{x:0.5379416604858821,y:0.7971821325536145},{x:0.530161754456429,y:0.8013405789630078},{x:0.5217200644907257,y:0.8039013376181453},{x:0.512941,y:0.804766},{x:0.406984,y:0.804766},{x:0.40440576588043703,y:0.8045120661033809},{x:0.40181542834229744,y:0.8044681908525655},{x:0.400026512750784,y:0.8040807473169851},{x:0.3982049355092742,y:0.8039013376181453},{x:0.39572578148103565,y:0.8031492944655273},{x:0.39319377618916257,y:0.8026009124809075},{x:0.2872357761891626,y:0.7684889124809076},{x:0.28342960508890525,y:0.7668362808879404},{x:0.2796044085190959,y:0.7652281761559891},{x:0.27938594032962494,y:0.7650805300410848},{x:0.27914407460343155,y:0.764975512444704},{x:0.2757334504432472,y:0.7626120885587936},{x:0.27229547962292316,y:0.7602886242777711},{x:0.2721100135665551,y:0.7601011941121303},{x:0.27189328313916555,y:0.7599510087370087},{x:0.2690092742928275,y:0.7569676176126634},{x:0.26609064851257996,y:0.7540180832118794},{x:0.26594531194585036,y:0.7537980718316557},{x:0.26576204564604555,y:0.7536084902175343},{x:0.26351548295615396,y:0.7501197819025626},{x:0.26122836336792754,y:0.7466575263349163},{x:0.2082493633679275,y:0.6462725263349164},{x:0.20745880379789322,y:0.6443351468057326},{x:0.2064724210369921,y:0.6424897544564291},{x:0.20579637196662365,y:0.6402611193438609},{x:0.20491647908027386,y:0.6381048157198157},{x:0.20451907388691828,y:0.636050431873947},{x:0.20391166238185462,y:0.6340480644907258},{x:0.20368338854657433,y:0.6317303613460921},{x:0.20324107652369047,y:0.6294438319050109},{x:0.20325209776572678,y:0.6273513925615422},{x:0.20304699999999998,y:0.6252690000000001},{x:0.20304699999999998,y:0.568912},{x:0.089112,y:0.568912},{x:0.0803329355092742,y:0.5680473376181453},{x:0.07189124554357093,y:0.5654865789630078},{x:0.0641113395141179,y:0.5613281325536145},{x:0.05729219484660536,y:0.5557318051533946},{x:0.051695867446385456,y:0.548912660485882},{x:0.04753742103699209,y:0.5411327544564289},{x:0.04497666238185463,y:0.5326910644907257},{x:0.044112,y:0.5239119999999999}]],g:[[{x:0.03166100000000001,y:0.285331},{x:0.03199195389402992,y:0.28197076872347165},{x:0.03216742697517915,y:0.27859884139484714},{x:0.032423533978450624,y:0.2775888625904497},{x:0.03252566238185464,y:0.2765519355092742},{x:0.03350580569139788,y:0.2733208360362635},{x:0.034335737494852386,y:0.2700479324456657},{x:0.07135573749485238,y:0.1675239324456658},{x:0.07223945098422414,y:0.16566943556296815},{x:0.07292365731738822,y:0.16373243532732273},{x:0.07413231799188957,y:0.16169720247238553},{x:0.07515058411631778,y:0.15956034321175439},{x:0.07637911169281072,y:0.15791388391586245},{x:0.07742806119285411,y:0.15614758463046624},{x:0.07901055202445481,y:0.15438725620434748},{x:0.0804261330120869,y:0.15249010996133996},{x:0.08195226304990277,y:0.15111496075964967},{x:0.08332564517579637,y:0.14958724031548856},{x:0.1584886451757964,y:0.08090524031548854},{x:0.16047116284778873,y:0.07942238349974136},{x:0.16231838489394151,y:0.07777404756068641},{x:0.16399482319868336,y:0.07678680357956279},{x:0.16555276842115366,y:0.07562151273533077},{x:0.16778648358567103,y:0.07455391860853194},{x:0.1699197861673149,y:0.07329763012616651},{x:0.2450797861673149,y:0.038459630126166475},{x:0.2459605302529857,y:0.0381521715215269},{x:0.24678324554357095,y:0.03771242103699209},{x:0.2501181687545519,y:0.03670078314085588},{x:0.253408434365457,y:0.03555218561964517},{x:0.254332237398671,y:0.03542245939316866},{x:0.2552249355092742,y:0.03515166238185463},{x:0.2586931398688001,y:0.03481007406735549},{x:0.26214426420887293,y:0.034325445502994434},{x:0.2630756249571383,y:0.03437843696081321},{x:0.264004,y:0.034287},{x:0.376189,y:0.034287},{x:0.37724627227682206,y:0.03439113223027483},{x:0.37830727432005307,y:0.03433688416138392},{x:0.3816280756224084,y:0.03482270219101675},{x:0.3849680644907258,y:0.03515166238185463},{x:0.38598470638687477,y:0.035460057329467706},{x:0.38703590484658207,y:0.03561384285228289},{x:0.39019811948723343,y:0.036738182220129235},{x:0.39340975445642906,y:0.03771242103699209},{x:0.39434669699397534,y:0.038213227257056566},{x:0.39534769490287125,y:0.03856913648017993},{x:0.4693886949028713,y:0.07340713648017996},{x:0.47140406041677185,y:0.07460963544760885},{x:0.47352148667564636,y:0.07562166704766733},{x:0.4751827197672129,y:0.0768642309221422},{x:0.47696422705836306,y:0.07792719476830276},{x:0.47870627197824944,y:0.0794997663623443},{x:0.480392,y:0.08076065187723735},{x:0.480392,y:0.018480463023952315},{x:0.44982106300216956,y:-0.06618482166306154},{x:0.42509763890365326,y:-0.0887666681923909},{x:0.3663917896728536,y:-0.115601},{x:0.27366828971008494,y:-0.115601},{x:0.21388478385740822,y:-0.08868092320279419},{x:0.15228882603575622,y:-0.032396134475538775},{x:0.11903308523020223,y:0.0605977685009861},{x:0.11526275900748023,y:0.06857299605517989},{x:0.11000898883421664,y:0.07565942769130271},{x:0.1034736741518217,y:0.08158473581569503},{x:0.09590796343849313,y:0.08612121416008753},{x:0.08760260271404471,y:0.08909452840579157},{x:0.07887676233341709,y:0.09039041575379858},{x:0.07006577144893004,y:0.08995907598006667},{x:0.061508231499013855,y:0.08781708523020218},{x:0.05353300394482007,y:0.08404675900748018},{x:0.046446572308697254,y:0.07879298883421659},{x:0.04052126418430494,y:0.07225767415182165},{x:0.035984785839912437,y:0.06469196343849308},{x:0.03301147159420839,y:0.05638660271404467},{x:0.03171558424620138,y:0.04766076233341703},{x:0.0321469240199333,y:0.038849771448930016},{x:0.03428891476979778,y:0.030292231499013812},{x:0.07130891476979778,y:-0.07322776850098624},{x:0.07221644299685706,y:-0.07514742841768875},{x:0.07292365731738822,y:-0.07714956467267746},{x:0.07409706350042253,y:-0.07912543338941479},{x:0.07507924099251978,y:-0.08120299605518004},{x:0.07634383839048098,y:-0.08290872027080634},{x:0.07742806119285414,y:-0.08473441536953392},{x:0.07896439356931816,y:-0.08644339813281518},{x:0.08033301116578337,y:-0.08828942769130284},{x:0.0819060799658371,y:-0.08971566618082738},{x:0.08332564517579637,y:-0.09129475968451163},{x:0.1584886451757964,y:-0.15997675968451153},{x:0.16066766565506738,y:-0.1616065940183929},{x:0.16271768036753925,y:-0.16339598773796155},{x:0.16419165994754753,y:-0.1642424237156923},{x:0.16555276842115366,y:-0.1652604872646693},{x:0.16800788453794988,y:-0.16643389898185532},{x:0.17036760218951646,y:-0.1677889719724602},{x:0.24552760218951647,y:-0.2016329719724602},{x:0.24617798725770038,y:-0.20185206166908357},{x:0.24678324554357095,y:-0.2021755789630079},{x:0.2503526828238078,y:-0.20325835592431216},{x:0.25388756161766735,y:-0.20444912053505218},{x:0.25456819199860076,y:-0.20453711665220192},{x:0.2552249355092742,y:-0.20473633761814536},{x:0.25893702635910487,y:-0.20510194665533446},{x:0.2626362900994872,y:-0.20558021041579141},{x:0.263321009549333,y:-0.20553373131203426},{x:0.264004,y:-0.20560099999999998},{x:0.376189,y:-0.20560099999999998},{x:0.3769985938815523,y:-0.20552126196245651},{x:0.37781053527049396,y:-0.2055717752142049},{x:0.38138177137190815,y:-0.20508955666026785},{x:0.3849680644907258,y:-0.20473633761814536},{x:0.3857465461334356,y:-0.20450018779358015},{x:0.38655274094280934,y:-0.2043913285403334},{x:0.3899612805709507,y:-0.2032216620796743},{x:0.39340975445642906,y:-0.2021755789630079},{x:0.39412720724734457,y:-0.20179209245674457},{x:0.39489667386274535,y:-0.20152804409855607},{x:0.4689376738627454,y:-0.16768404409855608},{x:0.471176129388074,y:-0.16638175223486265},{x:0.4735129313995788,y:-0.16526550692304898},{x:0.47497970384913024,y:-0.16416890323360386},{x:0.4765626813675205,y:-0.163247956304222},{x:0.47850406105855325,y:-0.16153398660426738},{x:0.480578193417323,y:-0.15998330217620907},{x:0.5187211934173229,y:-0.125144302176209},{x:0.5200982241105119,y:-0.12361318710120846},{x:0.5216280341275545,y:-0.12223470670068204},{x:0.5230406381933351,y:-0.12034152832018923},{x:0.5246201913815024,y:-0.1185852292702623},{x:0.52567205708302,y:-0.11681488878073784},{x:0.5269035440443172,y:-0.11516444436572898},{x:0.5279196645391884,y:-0.1130320574948894},{x:0.5291262301085498,y:-0.11100134969861394},{x:0.5298125082093796,y:-0.10905981698676002},{x:0.5306983467616347,y:-0.10720083421055714},{x:0.5677173467616347,y:-0.0046778342105572215},{x:0.5685472301626403,y:-0.001405045768812418},{x:0.5695273376181453,y:0.0018259355092742052},{x:0.5696294781899907,y:0.002862986138707272},{x:0.5698856101392306,y:0.003873086692614168},{x:0.5700610582123972,y:0.007244891642088324},{x:0.570392,y:0.010604999999999976},{x:0.570392,y:0.560059},{x:0.5695273376181453,y:0.5688380644907257},{x:0.5669665789630078,y:0.577279754456429},{x:0.5628081325536145,y:0.5850596604858821},{x:0.5572118051533946,y:0.5918788051533946},{x:0.5503926604858821,y:0.5974751325536145},{x:0.542612754456429,y:0.6016335789630078},{x:0.5341710644907257,y:0.6041943376181453},{x:0.525392,y:0.605059},{x:0.5166129355092742,y:0.6041943376181453},{x:0.508171245543571,y:0.6016335789630078},{x:0.5003913395141178,y:0.5974751325536145},{x:0.4935721948466053,y:0.5918788051533946},{x:0.48797586744638544,y:0.5850596604858821},{x:0.48381742103699205,y:0.577279754456429},{x:0.4812566623818546,y:0.5688380644907257},{x:0.480392,y:0.560059},{x:0.480392,y:0.5595783858718113},{x:0.47850787544975776,y:0.5609876460911735},{x:0.47656308903374583,y:0.5627046621197919},{x:0.47498407852937236,y:0.5636233247252487},{x:0.47352120750708176,y:0.5647175018259646},{x:0.47118052218859596,y:0.5658362200595997},{x:0.46893813108831367,y:0.5671408350985324},{x:0.39489713108831365,y:0.6009858350985324},{x:0.39412742928685096,y:0.6012499737741558},{x:0.39340975445642906,y:0.6016335789630078},{x:0.38996152003118717,y:0.6026795894402057},{x:0.3865532301567984,y:0.60384921275647},{x:0.38574678706033977,y:0.6039581147092028},{x:0.3849680644907258,y:0.6041943376181453},{x:0.38138202040224084,y:0.6045475321329209},{x:0.37781103767268465,y:0.6050297570960106},{x:0.3769988444371686,y:0.6049792372848822},{x:0.376189,y:0.605059},{x:0.264004,y:0.605059},{x:0.2633207613423033,y:0.6049917068657756},{x:0.2626357925427961,y:0.6050381952835313},{x:0.25893677979996554,y:0.6045599223713788},{x:0.2552249355092742,y:0.6041943376181453},{x:0.25456795333002863,y:0.6039950442528821},{x:0.2538870765735461,y:0.6039070086250592},{x:0.2503524457397967,y:0.6027162840056636},{x:0.24678324554357095,y:0.6016335789630078},{x:0.24617776729948443,y:0.6013099440989677},{x:0.24552714829793862,y:0.6010907675853725},{x:0.17036714829793861,y:0.5672457675853725},{x:0.16800780172583518,y:0.5658908729822889},{x:0.16555304759050302,y:0.5647176561362495},{x:0.1641916021742222,y:0.563699355958929},{x:0.16271727507130354,y:0.5628526987282604},{x:0.16066758950642807,y:0.5610635523625588},{x:0.15848888603577402,y:0.5594339797745099},{x:0.08332588603577401,y:0.49075297977450993},{x:0.08190615458499984,y:0.48917372437901785},{x:0.08033291862515302,y:0.48774732555289924},{x:0.07896444452212992,y:0.48590147772545017},{x:0.07742825448734617,y:0.4841926782200152},{x:0.07634390022195357,y:0.48236679190821125},{x:0.07507917015624571,y:0.48066087782555583},{x:0.0740970979464375,y:0.4785835213931001},{x:0.07292379561819572,y:0.47660786018244516},{x:0.07221648966449083,y:0.47460551074132296},{x:0.0713088683600783,y:0.4726856387236396},{x:0.034288868360078294,y:0.36916463872363964},{x:0.03348577523186824,y:0.3659561323879453},{x:0.03252566238185464,y:0.3627910644907258},{x:0.0324167369020588,y:0.3616851255348066},{x:0.032146903820267865,y:0.36060709221327164},{x:0.03198519043554786,y:0.35730356073015046},{x:0.03166100000000001,y:0.354012},{x:0.03166100000000001,y:0.285331}],[{x:0.121661,y:0.29320659086815803},{x:0.121661,y:0.34620780969623244},{x:0.15228882172599023,y:0.4318540207415116},{x:0.21388481974037543,y:0.48813802669691503},{x:0.2736685500834057,y:0.5150589999999999},{x:0.3663915263934284,y:0.5150589999999999},{x:0.4250929420729598,y:0.48822590193711934},{x:0.480392,y:0.4376951204586189},{x:0.480392,y:0.20264468470162808},{x:0.4249051037436742,y:0.15194152341431572},{x:0.3661311050032371,y:0.124287},{x:0.2739261218560311,y:0.124287},{x:0.21407100266628776,y:0.15203091487935444},{x:0.15223458736534265,y:0.208535427414771},{x:0.121661,y:0.29320659086815803}]],h:[[{x:0.047041,y:0.05318299999999998},{x:0.04790566238185463,y:0.04440393550927419},{x:0.050466421036992094,y:0.03596224554357094},{x:0.05462486744638546,y:0.028182339514117884},{x:0.06022119484660536,y:0.021363194846605343},{x:0.06704033951411792,y:0.01576686744638544},{x:0.07482024554357096,y:0.011608421036992077},{x:0.08326193550927423,y:0.009047662381854615},{x:0.092041,y:0.008182999999999982},{x:0.10082006449072577,y:0.009047662381854615},{x:0.10926175445642904,y:0.011608421036992077},{x:0.1170416604858821,y:0.015766867446385446},{x:0.12386080515339463,y:0.021363194846605343},{x:0.12945713255361452,y:0.028182339514117884},{x:0.1336155789630079,y:0.03596224554357094},{x:0.13617633761814535,y:0.04440393550927421},{x:0.137041,y:0.05318299999999998},{x:0.137041,y:0.3692271498339558},{x:0.23047284680205596,y:0.45237128863270537},{x:0.2915669774325256,y:0.478914},{x:0.38669764440631527,y:0.478914},{x:0.43644054132690624,y:0.4571557093088599},{x:0.465011,y:0.38123324165433015},{x:0.465011,y:0.05318299999999998},{x:0.4658756623818546,y:0.04440393550927419},{x:0.46843642103699207,y:0.03596224554357094},{x:0.47259486744638546,y:0.028182339514117884},{x:0.4781911948466053,y:0.021363194846605343},{x:0.4850103395141179,y:0.01576686744638544},{x:0.492790245543571,y:0.011608421036992077},{x:0.5012319355092743,y:0.009047662381854615},{x:0.510011,y:0.008182999999999982},{x:0.5187900644907257,y:0.009047662381854615},{x:0.527231754456429,y:0.011608421036992077},{x:0.5350116604858821,y:0.015766867446385446},{x:0.5418308051533947,y:0.021363194846605343},{x:0.5474271325536145,y:0.028182339514117884},{x:0.5515855789630079,y:0.03596224554357094},{x:0.5541463376181454,y:0.04440393550927421},{x:0.555011,y:0.05318299999999998},{x:0.555011,y:0.38942},{x:0.5546506186962206,y:0.39307901278178137},{x:0.554410350301749,y:0.3967478709583736},{x:0.5542188683658584,y:0.3974626474508545},{x:0.5541463376181454,y:0.3981990644907258},{x:0.5530790429582076,y:0.40171746346329923},{x:0.5521276325304605,y:0.40526895152034226},{x:0.5139866325304605,y:0.5066239515203422},{x:0.5138553396770835,y:0.5068902237569821},{x:0.5137747554395128,y:0.50717595947055},{x:0.511905898744729,y:0.5108438433478746},{x:0.5100853961903059,y:0.5145359657635786},{x:0.5099046789559015,y:0.5147715076888114},{x:0.5097698988494882,y:0.5150360318659072},{x:0.5072213830653152,y:0.5182688425286295},{x:0.504715563605999,y:0.5215348594178236},{x:0.5044923668525381,y:0.521730619287556},{x:0.5043085704011859,y:0.5219637664124008},{x:0.5011783335599848,y:0.5246372687597332},{x:0.4980834944323178,y:0.5273516689249697},{x:0.497826395485866,y:0.5275001237971909},{x:0.49760064588412606,y:0.5276929341565276},{x:0.49400898123224624,y:0.5297043869925788},{x:0.49044405536829966,y:0.5317628575577613},{x:0.490162934397186,y:0.5318583023949868},{x:0.48990390707565157,y:0.532003366394835},{x:0.41414290707565155,y:0.5651423663948351},{x:0.41372099607879415,y:0.5652794559590063},{x:0.41332975445642905,y:0.5654885789630079},{x:0.40952975949805703,y:0.5666412948313546},{x:0.4057531353317914,y:0.5678684156337233},{x:0.40531258638921414,y:0.5679205603081202},{x:0.4048880644907258,y:0.5680493376181454},{x:0.4009362016599996,y:0.5684385621342186},{x:0.39699274487562397,y:0.5689053213297277},{x:0.39655048803612764,y:0.5688705172237564},{x:0.396109,y:0.568914},{x:0.282214,y:0.568914},{x:0.28182836168040026,y:0.5688760179407144},{x:0.2814421286004882,y:0.5689073796745989},{x:0.27744221175957573,y:0.5684440198796774},{x:0.2734349355092742,y:0.5680493376181454},{x:0.2730641170540284,y:0.5679368510695262},{x:0.2726791869636831,y:0.5678922598605547},{x:0.26884652441488044,y:0.5666574583296339},{x:0.26499324554357095,y:0.5654885789630079},{x:0.2646514972979566,y:0.5653059107200353},{x:0.264282662844679,y:0.5651870801833616},{x:0.18800566284467896,y:0.5320480801833616},{x:0.1856267698486466,y:0.5307235797343987},{x:0.1831549202301779,y:0.529581917442145},{x:0.18178185218619736,y:0.5285828381463435},{x:0.18029822995654404,y:0.527756799180932},{x:0.17822344394147954,y:0.5259936496360635},{x:0.17602181748454487,y:0.5243916901265875},{x:0.137041,y:0.4897030201456747},{x:0.137041,y:0.7597659999999999},{x:0.13617633761814535,y:0.7685450644907257},{x:0.1336155789630079,y:0.776986754456429},{x:0.12945713255361452,y:0.7847666604858821},{x:0.12386080515339463,y:0.7915858051533946},{x:0.11704166048588208,y:0.7971821325536145},{x:0.10926175445642904,y:0.8013405789630078},{x:0.10082006449072577,y:0.8039013376181453},{x:0.092041,y:0.804766},{x:0.08326193550927423,y:0.8039013376181453},{x:0.07482024554357093,y:0.8013405789630078},{x:0.06704033951411792,y:0.7971821325536145},{x:0.06022119484660536,y:0.7915858051533946},{x:0.05462486744638546,y:0.7847666604858821},{x:0.050466421036992094,y:0.776986754456429},{x:0.04790566238185463,y:0.7685450644907257},{x:0.047041,y:0.7597659999999999},{x:0.047041,y:0.05318299999999998}]],i:[[{x:0.216026,y:0.7597659999999999},{x:0.21689066238185462,y:0.7509869355092742},{x:0.21945142103699208,y:0.7425452455435709},{x:0.22360986744638545,y:0.7347653395141178},{x:0.22920619484660534,y:0.7279461948466053},{x:0.2360253395141179,y:0.7223498674463854},{x:0.24380524554357094,y:0.7181914210369921},{x:0.25224693550927424,y:0.7156306623818546},{x:0.261026,y:0.7147659999999999},{x:0.341026,y:0.7147659999999999},{x:0.3498050644907258,y:0.7156306623818546},{x:0.35824675445642906,y:0.7181914210369921},{x:0.3660266604858821,y:0.7223498674463854},{x:0.3728458051533946,y:0.7279461948466053},{x:0.37844213255361453,y:0.7347653395141178},{x:0.3826005789630079,y:0.7425452455435709},{x:0.38516133761814536,y:0.7509869355092742},{x:0.386026,y:0.7597659999999999},{x:0.38516133761814536,y:0.7685450644907257},{x:0.3826005789630079,y:0.776986754456429},{x:0.37844213255361453,y:0.7847666604858821},{x:0.3728458051533946,y:0.7915858051533946},{x:0.3660266604858821,y:0.7971821325536145},{x:0.35824675445642906,y:0.8013405789630078},{x:0.3498050644907258,y:0.8039013376181453},{x:0.341026,y:0.804766},{x:0.261026,y:0.804766},{x:0.25224693550927424,y:0.8039013376181453},{x:0.24380524554357094,y:0.8013405789630078},{x:0.2360253395141179,y:0.7971821325536145},{x:0.22920619484660534,y:0.7915858051533946},{x:0.22360986744638545,y:0.7847666604858821},{x:0.21945142103699208,y:0.776986754456429},{x:0.21689066238185462,y:0.7685450644907257},{x:0.216026,y:0.7597659999999999}],[{x:0.25597800000000004,y:0.05318299999999998},{x:0.25684266238185466,y:0.04440393550927419},{x:0.2594034210369921,y:0.03596224554357094},{x:0.2635618674463855,y:0.028182339514117884},{x:0.2691581948466054,y:0.021363194846605343},{x:0.27597733951411796,y:0.01576686744638544},{x:0.28375724554357096,y:0.011608421036992077},{x:0.2921989355092742,y:0.009047662381854615},{x:0.300978,y:0.008182999999999982},{x:0.3097570644907258,y:0.009047662381854615},{x:0.3181987544564291,y:0.011608421036992077},{x:0.32597866048588214,y:0.015766867446385446},{x:0.33279780515339463,y:0.021363194846605343},{x:0.33839413255361456,y:0.028182339514117884},{x:0.34255257896300795,y:0.03596224554357094},{x:0.3451133376181454,y:0.04440393550927421},{x:0.345978,y:0.05318299999999998},{x:0.345978,y:0.523911},{x:0.3451133376181454,y:0.5326900644907258},{x:0.34255257896300795,y:0.541131754456429},{x:0.33839413255361456,y:0.5489116604858821},{x:0.33279780515339463,y:0.5557308051533947},{x:0.32597866048588214,y:0.5613271325536145},{x:0.3181987544564291,y:0.5654855789630079},{x:0.3097570644907258,y:0.5680463376181454},{x:0.300978,y:0.5689110000000001},{x:0.2921989355092742,y:0.5680463376181454},{x:0.28375724554357096,y:0.5654855789630079},{x:0.27597733951411796,y:0.5613271325536145},{x:0.2691581948466054,y:0.5557308051533947},{x:0.2635618674463855,y:0.5489116604858821},{x:0.2594034210369921,y:0.541131754456429},{x:0.25684266238185466,y:0.5326900644907258},{x:0.25597800000000004,y:0.523911},{x:0.25597800000000004,y:0.05318299999999998}]],j:[[{x:0.11017199870220953,y:-0.1121580749666587},{x:0.11173080987432929,y:-0.12084080046598154},{x:0.114953584640513,y:-0.12905258085596802},{x:0.11971647357384912,y:-0.1364778420214504},{x:0.12583644152368842,y:-0.14283123533997366},{x:0.1330783015538362,y:-0.147868603469331},{x:0.14116375304461573,y:-0.15139636317729976},{x:0.23896575304461573,y:-0.18307436317729964},{x:0.2424293887998465,y:-0.18383095770413346},{x:0.24586120600074532,y:-0.1847208108507566},{x:0.24673197042105502,y:-0.1847708110651418},{x:0.2475840766296098,y:-0.18495694463669302},{x:0.2511287638648936,y:-0.18502327959701073},{x:0.25466824139749206,y:-0.18522652014211538},{x:0.25553202888155596,y:-0.18510568190524296},{x:0.2564040749666586,y:-0.1851220012977904},{x:0.25989359333942796,y:-0.1844955274762681},{x:0.2634047110671092,y:-0.18400434499968443},{x:0.3944597110671092,y:-0.15232634499968456},{x:0.39510744613291976,y:-0.15210060706564532},{x:0.39578357398914765,y:-0.1519849807175323},{x:0.3992672661785621,y:-0.15065089524264363},{x:0.4027898773796621,y:-0.14942325292878383},{x:0.40338112711156726,y:-0.1490754856432793},{x:0.40402170577913904,y:-0.1488301750218278},{x:0.4071781926350792,y:-0.14684208899421944},{x:0.4103936167153703,y:-0.14495080812962524},{x:0.41090565971774945,y:-0.14449437599440731},{x:0.41148607211771127,y:-0.14412880824922783},{x:0.41419405162048195,y:-0.14156312270000898},{x:0.41697872163578864,y:-0.1390808841476645},{x:0.4173918803832174,y:-0.13853332759371953},{x:0.41788982159253774,y:-0.13806155128824654},{x:0.42004522760849955,y:-0.13501686407422092},{x:0.422292130251795,y:-0.13203905886963707},{x:0.4225905272853119,y:-0.13142142018825975},{x:0.42298686170256505,y:-0.13086156542133753},{x:0.4245068631872901,y:-0.12745488216466036},{x:0.4261296512500701,y:-0.1240959456918764},{x:0.4263018193390199,y:-0.1234319603912164},{x:0.42658131605481786,y:-0.12280554206756752},{x:0.4588533160548179,y:-0.025908542067567514},{x:0.4594769463166796,y:-0.023162642495487502},{x:0.46029433761814537,y:-0.02046806449072583},{x:0.46045163429328767,y:-0.01887100454660151},{x:0.46080705178433234,y:-0.017306069686551954},{x:0.4608830007338393,y:-0.01449126757618431},{x:0.461159,y:-0.01168900000000006},{x:0.461159,y:0.534292},{x:0.46029433761814537,y:0.5430710644907257},{x:0.4577335789630079,y:0.551512754456429},{x:0.45357513255361454,y:0.5592926604858821},{x:0.4479788051533946,y:0.5661118051533947},{x:0.4411596604858821,y:0.5717081325536145},{x:0.43337975445642907,y:0.5758665789630079},{x:0.4249380644907258,y:0.5784273376181454},{x:0.416159,y:0.579292},{x:0.4073799355092742,y:0.5784273376181454},{x:0.39893824554357094,y:0.5758665789630079},{x:0.39115833951411794,y:0.5717081325536145},{x:0.3843391948466054,y:0.5661118051533947},{x:0.37874286744638547,y:0.5592926604858821},{x:0.3745844210369921,y:0.551512754456429},{x:0.37202366238185464,y:0.5430710644907257},{x:0.371159,y:0.534292},{x:0.371159,y:-0.004392296840350002},{x:0.3490732119536395,y:-0.07070509444595838},{x:0.254610065464387,y:-0.09353828321774525},{x:0.16889624695538427,y:-0.06577563682270039},{x:0.16027792337039018,y:-0.063893055363307},{x:0.15145792503334138,y:-0.0637279987022096},{x:0.14277519953401854,y:-0.06528680987432936},{x:0.13456341914403205,y:-0.06850958464051307},{x:0.12713815797854966,y:-0.0732724735738492},{x:0.12078476466002638,y:-0.07939244152368852},{x:0.11574739653066908,y:-0.08663430155383627},{x:0.11221963682270032,y:-0.0947197530446158},{x:0.11033705536330693,y:-0.10333807662960988},{x:0.11017199870220953,y:-0.1121580749666587}],[{x:0.3403,y:0.7597659999999999},{x:0.3411646623818546,y:0.7509869355092742},{x:0.34372542103699205,y:0.7425452455435709},{x:0.34788386744638544,y:0.7347653395141178},{x:0.3534801948466053,y:0.7279461948466053},{x:0.3602993395141179,y:0.7223498674463854},{x:0.36807924554357097,y:0.7181914210369921},{x:0.37652093550927423,y:0.7156306623818546},{x:0.3853,y:0.7147659999999999},{x:0.447023,y:0.7147659999999999},{x:0.4558020644907258,y:0.7156306623818546},{x:0.46424375445642907,y:0.7181914210369921},{x:0.4720236604858821,y:0.7223498674463854},{x:0.4788428051533946,y:0.7279461948466053},{x:0.48443913255361454,y:0.7347653395141178},{x:0.48859757896300793,y:0.7425452455435709},{x:0.49115833761814537,y:0.7509869355092742},{x:0.492023,y:0.7597659999999999},{x:0.49115833761814537,y:0.7685450644907257},{x:0.48859757896300793,y:0.776986754456429},{x:0.48443913255361454,y:0.7847666604858821},{x:0.4788428051533946,y:0.7915858051533946},{x:0.4720236604858821,y:0.7971821325536145},{x:0.46424375445642907,y:0.8013405789630078},{x:0.4558020644907258,y:0.8039013376181453},{x:0.447023,y:0.804766},{x:0.3853,y:0.804766},{x:0.37652093550927423,y:0.8039013376181453},{x:0.36807924554357097,y:0.8013405789630078},{x:0.3602993395141179,y:0.7971821325536145},{x:0.3534801948466053,y:0.7915858051533946},{x:0.34788386744638544,y:0.7847666604858821},{x:0.34372542103699205,y:0.776986754456429},{x:0.3411646623818546,y:0.7685450644907257},{x:0.3403,y:0.7597659999999999}]],k:[[{x:0.020185999999999996,y:0.05318299999999998},{x:0.02105066238185463,y:0.04440393550927419},{x:0.02361142103699209,y:0.03596224554357094},{x:0.027769867446385453,y:0.028182339514117884},{x:0.03336619484660536,y:0.021363194846605343},{x:0.04018533951411791,y:0.01576686744638544},{x:0.047965245543570956,y:0.011608421036992077},{x:0.056406935509274225,y:0.009047662381854615},{x:0.065186,y:0.008182999999999982},{x:0.07396506449072576,y:0.009047662381854615},{x:0.08240675445642903,y:0.011608421036992077},{x:0.0901866604858821,y:0.015766867446385446},{x:0.09700580515339463,y:0.021363194846605343},{x:0.10260213255361453,y:0.028182339514117884},{x:0.10676057896300789,y:0.03596224554357094},{x:0.10932133761814536,y:0.04440393550927421},{x:0.11018599999999999,y:0.05318299999999998},{x:0.11018599999999999,y:0.16578332733911408},{x:0.23477705990096162,y:0.26351643594805596},{x:0.5068321321577423,y:0.019673199736523116},{x:0.5139466814455551,y:0.014457569113271652},{x:0.5219420457215526,y:0.010730135081525344},{x:0.5305109676204599,y:0.008634140840755075},{x:0.539324148279209,y:0.008250134274186548},{x:0.5480429021075728,y:0.009592872538819623},{x:0.5563321722854605,y:0.012610754956160736},{x:0.5638734068086124,y:0.017187805997359452},{x:0.5703768002634768,y:0.02314813215774228},{x:0.5755924308867283,y:0.030262681445555134},{x:0.5793198649184746,y:0.03825804572155257},{x:0.5814158591592449,y:0.04682696762045996},{x:0.5817998657258134,y:0.05564014827920904},{x:0.5804571274611804,y:0.06435890210757275},{x:0.5774392450438393,y:0.07264817228546054},{x:0.5728621940026405,y:0.08018940680861247},{x:0.5669018678422577,y:0.08669280026347684},{x:0.3066862956724008,y:0.3199242805817128},{x:0.5215978711622948,y:0.4885076152557163},{x:0.5279716470169837,y:0.49460635247919954},{x:0.533033147947031,y:0.5018313661609891},{x:0.5365878633102175,y:0.5099050030771282},{x:0.5384991873886431,y:0.5185169978886772},{x:0.5386936690698568,y:0.5273363964646907},{x:0.5371638345319164,y:0.5360242742638681},{x:0.5339684744581735,y:0.5442467610146052},{x:0.5292303847442837,y:0.5516878711622948},{x:0.5231316475208004,y:0.5580616470169838},{x:0.5159066338390108,y:0.5631231479470311},{x:0.5078329969228718,y:0.5666778633102175},{x:0.4992210021113228,y:0.5685891873886431},{x:0.49040160353530926,y:0.5687836690698569},{x:0.4817137257361318,y:0.5672538345319164},{x:0.47349123898539475,y:0.5640584744581736},{x:0.46605012883770514,y:0.5593203847442837},{x:0.11018599999999999,y:0.28016947631338524},{x:0.11018599999999999,y:0.7597659999999999},{x:0.10932133761814536,y:0.7685450644907257},{x:0.10676057896300789,y:0.776986754456429},{x:0.10260213255361453,y:0.7847666604858821},{x:0.09700580515339463,y:0.7915858051533946},{x:0.09018666048588207,y:0.7971821325536145},{x:0.08240675445642903,y:0.8013405789630078},{x:0.07396506449072576,y:0.8039013376181453},{x:0.065186,y:0.804766},{x:0.056406935509274204,y:0.8039013376181453},{x:0.04796524554357093,y:0.8013405789630078},{x:0.04018533951411791,y:0.7971821325536145},{x:0.03336619484660536,y:0.7915858051533946},{x:0.027769867446385453,y:0.7847666604858821},{x:0.02361142103699209,y:0.776986754456429},{x:0.02105066238185463,y:0.7685450644907257},{x:0.020185999999999996,y:0.7597659999999999},{x:0.020185999999999996,y:0.05318299999999998}]],l:[[{x:0.25602600000000003,y:0.05355900000000002},{x:0.25689066238185465,y:0.044779935509274234},{x:0.2594514210369921,y:0.036338245543570985},{x:0.2636098674463855,y:0.028558339514117927},{x:0.26920619484660535,y:0.021739194846605386},{x:0.27602533951411795,y:0.016142867446385482},{x:0.283805245543571,y:0.01198442103699212},{x:0.2922469355092743,y:0.009423662381854658},{x:0.301026,y:0.008559000000000025},{x:0.3098050644907258,y:0.009423662381854658},{x:0.3182467544564291,y:0.01198442103699212},{x:0.32602666048588214,y:0.01614286744638549},{x:0.3328458051533947,y:0.021739194846605386},{x:0.33844213255361455,y:0.028558339514117927},{x:0.34260057896300794,y:0.036338245543570985},{x:0.3451613376181454,y:0.044779935509274255},{x:0.346026,y:0.05355900000000002},{x:0.346026,y:0.765137},{x:0.3451613376181454,y:0.7739160644907257},{x:0.34260057896300794,y:0.782357754456429},{x:0.33844213255361455,y:0.7901376604858821},{x:0.3328458051533947,y:0.7969568051533946},{x:0.32602666048588214,y:0.8025531325536145},{x:0.3182467544564291,y:0.8067115789630078},{x:0.3098050644907258,y:0.8092723376181453},{x:0.301026,y:0.810137},{x:0.2922469355092743,y:0.8092723376181453},{x:0.283805245543571,y:0.8067115789630078},{x:0.27602533951411795,y:0.8025531325536145},{x:0.26920619484660535,y:0.7969568051533946},{x:0.2636098674463855,y:0.7901376604858821},{x:0.2594514210369921,y:0.782357754456429},{x:0.25689066238185465,y:0.7739160644907257},{x:0.25602600000000003,y:0.765137},{x:0.25602600000000003,y:0.05355900000000002}]],m:[[{x:0.005538000000000001,y:0.03920400000000002},{x:0.006402662381854635,y:0.030424935509274227},{x:0.008963421036992096,y:0.02198324554357097},{x:0.013121867446385459,y:0.01420333951411792},{x:0.018718194846605363,y:0.00738419484660538},{x:0.025537339514117914,y:0.0017878674463854757},{x:0.03331724554357096,y:-0.002370578963007887},{x:0.04175893550927423,y:-0.004931337618145348},{x:0.050538,y:-0.005795999999999982},{x:0.059317064490725775,y:-0.004931337618145348},{x:0.06775875445642904,y:-0.002370578963007887},{x:0.0755386604858821,y:0.0017878674463854827},{x:0.08235780515339464,y:0.00738419484660538},{x:0.08795413255361453,y:0.01420333951411792},{x:0.0921125789630079,y:0.02198324554357098},{x:0.09467333761814536,y:0.030424935509274248},{x:0.095538,y:0.03920400000000002},{x:0.095538,y:0.3993271266071161},{x:0.14963521853994496,y:0.4943223065353007},{x:0.1738257653562211,y:0.5150589999999999},{x:0.22021623464377893,y:0.5150589999999999},{x:0.2416666625786254,y:0.49667119950297894},{x:0.27741,y:0.4029520066676719},{x:0.27741,y:0.03920400000000002},{x:0.2782746623818546,y:0.030424935509274227},{x:0.28083542103699205,y:0.02198324554357097},{x:0.28499386744638544,y:0.01420333951411792},{x:0.2905901948466053,y:0.00738419484660538},{x:0.2974093395141179,y:0.0017878674463854757},{x:0.30518924554357096,y:-0.002370578963007887},{x:0.31363093550927423,y:-0.004931337618145348},{x:0.32241,y:-0.005795999999999982},{x:0.33118906449072577,y:-0.004931337618145348},{x:0.33963075445642904,y:-0.002370578963007887},{x:0.3474106604858821,y:0.0017878674463854827},{x:0.35422980515339464,y:0.00738419484660538},{x:0.3598261325536145,y:0.01420333951411792},{x:0.3639845789630079,y:0.02198324554357098},{x:0.36654533761814534,y:0.030424935509274248},{x:0.36740999999999996,y:0.03920400000000002},{x:0.36740999999999996,y:0.3993264781598986},{x:0.4215891088917321,y:0.494459500052724},{x:0.445289826307752,y:0.5150589999999999},{x:0.4920928256254945,y:0.5150589999999999},{x:0.5065149999999999,y:0.5026965582556255},{x:0.5065149999999999,y:0.03920400000000002},{x:0.5073796623818546,y:0.030424935509274227},{x:0.5099404210369921,y:0.02198324554357097},{x:0.5140988674463854,y:0.01420333951411792},{x:0.5196951948466053,y:0.00738419484660538},{x:0.5265143395141179,y:0.0017878674463854757},{x:0.534294245543571,y:-0.002370578963007887},{x:0.5427359355092742,y:-0.004931337618145348},{x:0.551515,y:-0.005795999999999982},{x:0.5602940644907257,y:-0.004931337618145348},{x:0.568735754456429,y:-0.002370578963007887},{x:0.5765156604858821,y:0.0017878674463854827},{x:0.5833348051533946,y:0.00738419484660538},{x:0.5889311325536145,y:0.01420333951411792},{x:0.5930895789630078,y:0.02198324554357098},{x:0.5956503376181453,y:0.030424935509274248},{x:0.596515,y:0.03920400000000002},{x:0.596515,y:0.523393},{x:0.5963454778388272,y:0.5251141873868636},{x:0.5963825315707437,y:0.5268433058919912},{x:0.5959141404350922,y:0.5294936295415332},{x:0.5956503376181453,y:0.5321720644907257},{x:0.5951482857762117,y:0.5338271076115645},{x:0.59484729324509,y:0.5355302304139588},{x:0.5938708496195351,y:0.5380382502602514},{x:0.5930895789630078,y:0.540613754456429},{x:0.592274291011045,y:0.5421390509322689},{x:0.5916468191910574,y:0.543750727977755},{x:0.5901998472565338,y:0.5460200622246176},{x:0.5889311325536145,y:0.5483936604858821},{x:0.5878339395503975,y:0.5497305940285525},{x:0.5869041018316961,y:0.5511888894721116},{x:0.5850422079081763,y:0.5531323288770946},{x:0.5833348051533946,y:0.5552128051533947},{x:0.581997871610724,y:0.5563099981566119},{x:0.5808014011353795,y:0.5575588705221693},{x:0.5380264011353795,y:0.5942248705221693},{x:0.5358211367621821,y:0.5957677297988329},{x:0.5337406604858821,y:0.5974751325536145},{x:0.5322153640100423,y:0.5982904205055773},{x:0.5307982404674333,y:0.599281876328501},{x:0.5283343527176928,y:0.600364864260089},{x:0.525960754456429,y:0.6016335789630078},{x:0.5243057113355902,y:0.6021356308049415},{x:0.5227223939887274,y:0.6028315689939708},{x:0.5200945686869033,y:0.6034130669616181},{x:0.5175190644907257,y:0.6041943376181453},{x:0.5157978771038628,y:0.6043638597793182},{x:0.5141092119504517,y:0.6047375358201355},{x:0.5114184349491921,y:0.6047951971830532},{x:0.50874,y:0.605059},{x:0.428467,y:0.605059},{x:0.42563553135621585,y:0.6047801246797119},{x:0.42279150043448566,y:0.6046996620098968},{x:0.4212557149999115,y:0.6043487504203328},{x:0.4196879355092742,y:0.6041943376181453},{x:0.41696527861756566,y:0.6033684286794448},{x:0.4141915924406847,y:0.6027346691689239},{x:0.4127537761476033,y:0.6020908833721776},{x:0.4112462455435709,y:0.6016335789630078},{x:0.40873703058140176,y:0.6002923756232341},{x:0.4061402803536474,y:0.5991296742945802},{x:0.40485568767586616,y:0.5982177546177817},{x:0.4034663395141179,y:0.5974751325536145},{x:0.4012669942053008,y:0.5956701765049598},{x:0.3989469715816508,y:0.5940232153181825},{x:0.3567609715816508,y:0.5573572153181825},{x:0.3545792701559384,y:0.5550484712393128},{x:0.3522737143614353,y:0.552863400803129},{x:0.35155574109793963,y:0.5518488790642903},{x:0.35070210094674875,y:0.5509455305944583},{x:0.3490127339279754,y:0.5482555195520005},{x:0.34717776483660073,y:0.5456626430091704},{x:0.33048446785976626,y:0.5163509060824124},{x:0.3216828574856715,y:0.5394287684036221},{x:0.32062739498214626,y:0.5415455848316745},{x:0.31976928952310246,y:0.5437498007710907},{x:0.3186639603788477,y:0.5454834136126945},{x:0.31774653490223986,y:0.5473233854865517},{x:0.3162983824161672,y:0.5491936173608123},{x:0.31502674401548947,y:0.5511880718386934},{x:0.3136044423732838,y:0.5526727347769701},{x:0.3123456842645886,y:0.5542983712755478},{x:0.3105604934838748,y:0.5558501466339272},{x:0.30892419049215825,y:0.5575581938831911},{x:0.2661511904921582,y:0.594224193883191},{x:0.26394553725639397,y:0.5957674011217274},{x:0.2618646604858821,y:0.5974751325536145},{x:0.26033982189406285,y:0.5982901757614695},{x:0.258923146662659,y:0.5992813666868191},{x:0.25645880963824363,y:0.6003646200309664},{x:0.25408475445642903,y:0.6016335789630078},{x:0.25243020816870526,y:0.6021354800922637},{x:0.25084738219782576,y:0.6028312459348294},{x:0.24821906447459133,y:0.6034129165660671},{x:0.24564306449072576,y:0.6041943376181453},{x:0.24392239379305308,y:0.6043638088898747},{x:0.2422342441971012,y:0.6047374117585159},{x:0.2395429505511757,y:0.6047951464006902},{x:0.236864,y:0.605059},{x:0.157178,y:0.605059},{x:0.1544990494488241,y:0.6047951464006902},{x:0.1518077558028988,y:0.6047374117585159},{x:0.15011960620694695,y:0.6043638088898747},{x:0.14839893550927424,y:0.6041943376181453},{x:0.14582293552540848,y:0.6034129165660671},{x:0.1431946178021742,y:0.6028312459348294},{x:0.1416117918312948,y:0.6021354800922637},{x:0.13995724554357097,y:0.6016335789630078},{x:0.13758319036175665,y:0.6003646200309664},{x:0.135118853337341,y:0.5992813666868191},{x:0.13370217810593676,y:0.5982901757614691},{x:0.13217733951411792,y:0.5974751325536145},{x:0.13009646274360603,y:0.5957674011217274},{x:0.1278908095078418,y:0.594224193883191},{x:0.09495385911112918,y:0.5659898819750746},{x:0.09467333761814536,y:0.5688380644907257},{x:0.0921125789630079,y:0.577279754456429},{x:0.08795413255361453,y:0.5850596604858821},{x:0.08235780515339464,y:0.5918788051533946},{x:0.07553866048588208,y:0.5974751325536145},{x:0.06775875445642904,y:0.6016335789630078},{x:0.059317064490725775,y:0.6041943376181453},{x:0.050538,y:0.605059},{x:0.04175893550927421,y:0.6041943376181453},{x:0.033317245543570934,y:0.6016335789630078},{x:0.025537339514117904,y:0.5974751325536145},{x:0.018718194846605356,y:0.5918788051533946},{x:0.013121867446385459,y:0.5850596604858821},{x:0.008963421036992096,y:0.577279754456429},{x:0.006402662381854635,y:0.5688380644907257},{x:0.005538000000000001,y:0.560059},{x:0.005538000000000001,y:0.03920400000000002}]],n:[[{x:0.047041,y:0.03920400000000002},{x:0.04790566238185463,y:0.030424935509274227},{x:0.050466421036992094,y:0.02198324554357097},{x:0.05462486744638546,y:0.01420333951411792},{x:0.06022119484660536,y:0.00738419484660538},{x:0.06704033951411792,y:0.0017878674463854757},{x:0.07482024554357096,y:-0.002370578963007887},{x:0.08326193550927423,y:-0.004931337618145348},{x:0.092041,y:-0.005795999999999982},{x:0.10082006449072577,y:-0.004931337618145348},{x:0.10926175445642904,y:-0.002370578963007887},{x:0.1170416604858821,y:0.0017878674463854827},{x:0.12386080515339463,y:0.00738419484660538},{x:0.12945713255361452,y:0.01420333951411792},{x:0.1336155789630079,y:0.02198324554357098},{x:0.13617633761814535,y:0.030424935509274248},{x:0.137041,y:0.03920400000000002},{x:0.137041,y:0.3923986904044417},{x:0.23217657812189968,y:0.4860775193429304},{x:0.29246969284729285,y:0.5150589999999999},{x:0.3857956927587408,y:0.5150589999999999},{x:0.4353266752666751,y:0.4910865745843881},{x:0.465011,y:0.4037995608673687},{x:0.465011,y:0.03920400000000002},{x:0.4658756623818546,y:0.030424935509274227},{x:0.46843642103699207,y:0.02198324554357097},{x:0.47259486744638546,y:0.01420333951411792},{x:0.4781911948466053,y:0.00738419484660538},{x:0.4850103395141179,y:0.0017878674463854757},{x:0.492790245543571,y:-0.002370578963007887},{x:0.5012319355092743,y:-0.004931337618145348},{x:0.510011,y:-0.005795999999999982},{x:0.5187900644907257,y:-0.004931337618145348},{x:0.527231754456429,y:-0.002370578963007887},{x:0.5350116604858821,y:0.0017878674463854827},{x:0.5418308051533947,y:0.00738419484660538},{x:0.5474271325536145,y:0.01420333951411792},{x:0.5515855789630079,y:0.02198324554357098},{x:0.5541463376181454,y:0.030424935509274248},{x:0.555011,y:0.03920400000000002},{x:0.555011,y:0.411242},{x:0.5547211401667089,y:0.41418499627592825},{x:0.5546227314347089,y:0.4171405946120584},{x:0.5542897326303223,y:0.4185651504993601},{x:0.5541463376181454,y:0.4200210644907258},{x:0.5532878972691104,y:0.42285096307022063},{x:0.5526147708021555,y:0.4257305718218671},{x:0.5144747708021555,y:0.537881571821867},{x:0.5144109474804813,y:0.5380222238814931},{x:0.5143747633675698,y:0.5381723808934484},{x:0.5125889395552703,y:0.5420375142269895},{x:0.5108295711501452,y:0.5459147613418461},{x:0.5107395343200961,y:0.546040259499208},{x:0.5106747512949527,y:0.5461804721160435},{x:0.5081691914797779,y:0.5496229410537735},{x:0.5056872154570532,y:0.5530824522038071},{x:0.5055744251835149,y:0.5531879736350976},{x:0.505483532821465,y:0.5533128535645805},{x:0.5023545242619802,y:0.5562003659557777},{x:0.4992453215682988,y:0.5591091940676126},{x:0.49911411231822944,y:0.5591906836434047},{x:0.49900060356177384,y:0.559295431819878},{x:0.49536839230215873,y:0.5615170221826804},{x:0.49175144785337105,y:0.5637633826232722},{x:0.4916068619246677,y:0.563817708744868},{x:0.49147509885166074,y:0.5638982997546532},{x:0.41571709885166075,y:0.6005642997546532},{x:0.4144883994140345,y:0.6010164083750983},{x:0.41333375445642906,y:0.6016335789630078},{x:0.41035728417594536,y:0.6025364813514484},{x:0.4074382196167836,y:0.6036105717354909},{x:0.4061449272779714,y:0.6038142858466193},{x:0.4048920644907258,y:0.6041943376181453},{x:0.4017966387343604,y:0.6044992104448776},{x:0.3987241185432898,y:0.6049831812385367},{x:0.3974159338025849,y:0.6049306722213019},{x:0.396113,y:0.605059},{x:0.282216,y:0.605059},{x:0.28097323419788345,y:0.6049365982521052},{x:0.2797255990169867,y:0.6049900349640848},{x:0.2765922846246742,y:0.6045051123806029},{x:0.2734369355092743,y:0.6041943376181453},{x:0.2722419284999821,y:0.603831836204989},{x:0.27100784129389754,y:0.6036408445963318},{x:0.26802933636200627,y:0.6025539603505436},{x:0.264995245543571,y:0.6016335789630078},{x:0.2638939207763026,y:0.6010449086106044},{x:0.2627208068242762,y:0.6006168283817219},{x:0.18644080682427616,y:0.563950828381722},{x:0.18387931815291048,y:0.5623935720684188},{x:0.18122474955630472,y:0.5610008994562176},{x:0.18011833133270075,y:0.5601070811947741},{x:0.17890296169536754,y:0.5593681975674947},{x:0.17669449694619624,y:0.5573411418478543},{x:0.17436263208920222,y:0.5554573484070612},{x:0.137041,y:0.5187071981771466},{x:0.137041,y:0.560059},{x:0.13617633761814535,y:0.5688380644907257},{x:0.1336155789630079,y:0.577279754456429},{x:0.12945713255361452,y:0.5850596604858821},{x:0.12386080515339463,y:0.5918788051533946},{x:0.11704166048588208,y:0.5974751325536145},{x:0.10926175445642904,y:0.6016335789630078},{x:0.10082006449072577,y:0.6041943376181453},{x:0.092041,y:0.605059},{x:0.08326193550927423,y:0.6041943376181453},{x:0.07482024554357093,y:0.6016335789630078},{x:0.06704033951411792,y:0.5974751325536145},{x:0.06022119484660536,y:0.5918788051533946},{x:0.05462486744638546,y:0.5850596604858821},{x:0.050466421036992094,y:0.577279754456429},{x:0.04790566238185463,y:0.5688380644907257},{x:0.047041,y:0.560059},{x:0.047041,y:0.03920400000000002}]],o:[[{x:0.021894999999999998,y:0.25490100000000004},{x:0.022142430975592695,y:0.2523887911456351},{x:0.02217771682540861,y:0.24986467341374632},{x:0.02257373987793045,y:0.24800963837050735},{x:0.02275966238185463,y:0.24612193550927428},{x:0.023492446675001572,y:0.24370626943231966},{x:0.02401948545822835,y:0.2412375358426815},{x:0.060310485458228355,y:0.12735753584268142},{x:0.06080304558444478,y:0.12621387418764726},{x:0.061129830312657105,y:0.12501229639135567},{x:0.06254436541764224,y:0.12217075210694647},{x:0.06379993607002282,y:0.11925547753662338},{x:0.06450614911208748,y:0.11822988473324028},{x:0.0650610709625847,y:0.11711514745523491},{x:0.06700278396163635,y:0.114604164756607},{x:0.06880297103068717,y:0.11198985605258731},{x:0.06969569761744246,y:0.11112174505713},{x:0.07045743125471368,y:0.1101366870258529},{x:0.14244943125471368,y:0.0338456870258529},{x:0.144568728324263,y:0.03200109409682955},{x:0.1465508815997487,y:0.0300098604251366},{x:0.14788834203377002,y:0.029111770054614114},{x:0.1491035320893312,y:0.02805409342394511},{x:0.1515419696884587,y:0.026658398178569347},{x:0.15387450686277807,y:0.025092124424329433},{x:0.22587150686277807,y:-0.01360287557567049},{x:0.22795933917571506,y:-0.014473279294209745},{x:0.22995424554357097,y:-0.015539578963007873},{x:0.23202067225559728,y:-0.016166422653018674},{x:0.2340138134199343,y:-0.01699735024728135},{x:0.23623133596214702,y:-0.01744371352418634},{x:0.23839593550927424,y:-0.018100337618145335},{x:0.2405449475487996,y:-0.01831199682974963},{x:0.24266189699648397,y:-0.01873811583170923},{x:0.2449238916202761,y:-0.018743285176571887},{x:0.247175,y:-0.018964999999999968},{x:0.354874,y:-0.018964999999999968},{x:0.35712497901801044,y:-0.018743297917588594},{x:0.3593868436844028,y:-0.018738141970160445},{x:0.36150392306047363,y:-0.018312009573623896},{x:0.3636530644907258,y:-0.018100337618145335},{x:0.36581753964743763,y:-0.017443751257606326},{x:0.36803493734305537,y:-0.016997426474138877},{x:0.370028203326089,y:-0.016166460394901543},{x:0.3720947544564291,y:-0.015539578963007873},{x:0.3740895461854217,y:-0.014473340569958804},{x:0.376177263560353,y:-0.01360299896157894},{x:0.448175263560353,y:0.025092001038420984},{x:0.4505076595021602,y:0.026658160356610353},{x:0.4529459593263057,y:0.028053731854915283},{x:0.45416130097157975,y:0.029111510806286087},{x:0.45549891730603415,y:0.030009694621828502},{x:0.4574809543881169,y:0.03200078850323144},{x:0.4596001404718476,y:0.03384523318438343},{x:0.5315941404718476,y:0.11013623318438343},{x:0.5323560786638525,y:0.11112152750713142},{x:0.5332490289693128,y:0.11198985605258731},{x:0.5350490398057314,y:0.11460390882403626},{x:0.5369905975332091,y:0.11711461878219896},{x:0.5375456739097991,y:0.11822962771804991},{x:0.5382520639299772,y:0.11925547753662338},{x:0.5395075116659538,y:0.12217046671076734},{x:0.5409219476918898,y:0.12501171320336152},{x:0.5412488309792026,y:0.126213587584214},{x:0.5417415145417717,y:0.12735753584268142},{x:0.5780325145417716,y:0.2412375358426815},{x:0.5785595533249983,y:0.2437062694323195},{x:0.5792923376181454,y:0.24612193550927428},{x:0.5794782601220696,y:0.2480096383705079},{x:0.5798742831745913,y:0.24986467341374632},{x:0.5799095690244073,y:0.25238879114563434},{x:0.580157,y:0.25490100000000004},{x:0.580157,y:0.33119200000000004},{x:0.5799156873690254,y:0.3336420882589673},{x:0.5798881240960263,y:0.3361038771468651},{x:0.5794843860383102,y:0.3380211641581212},{x:0.5792923376181454,y:0.33997106449072584},{x:0.5785776732343003,y:0.3423269972319261},{x:0.5780703683949873,y:0.3447361062088315},{x:0.5417793683949873,y:0.4597211062088315},{x:0.5412650895934552,y:0.4609244011905288},{x:0.540921633437906,y:0.46218711230867804},{x:0.5395351283421765,y:0.46497211555478546},{x:0.5383124760126231,y:0.46783284286481475},{x:0.5375733277285976,y:0.46891268605384906},{x:0.5369901282681178,y:0.47008412955994733},{x:0.5350869372989228,y:0.47254512602400234},{x:0.5333296776789325,y:0.47511235762423976},{x:0.5323940649664491,y:0.4760272512524403},{x:0.5315935342292432,y:0.47706240922950055},{x:0.45959953422924316,y:0.5533504092295005},{x:0.4572787448447235,y:0.5553702403350376},{x:0.45508230823461715,y:0.5575246421731296},{x:0.45395838697349994,y:0.5582600166131206},{x:0.4529452394037514,y:0.5591417799431011},{x:0.45027499383570063,y:0.5606700370119551},{x:0.44770045819082444,y:0.5623545390972755},{x:0.3757024581908245,y:0.5999485390972755},{x:0.37385313535723513,y:0.6006937047902838},{x:0.3720947544564291,y:0.6016335789630078},{x:0.36977177563531344,y:0.6023382468844833},{x:0.3675201821794923,y:0.6032455034042244},{x:0.36556101895058973,y:0.6036155659602718},{x:0.3636530644907258,y:0.6041943376181453},{x:0.36123724716457173,y:0.6044322748568528},{x:0.35885192047906295,y:0.6048828346046191},{x:0.35685820639902277,y:0.60486357272721},{x:0.354874,y:0.605059},{x:0.247175,y:0.605059},{x:0.24519066624232813,y:0.6048635601834779},{x:0.24319682408363533,y:0.6048828119349353},{x:0.24081162559758007,y:0.6044322623250186},{x:0.23839593550927424,y:0.6041943376181453},{x:0.23648785858508298,y:0.6036155288111242},{x:0.234528571713998,y:0.6032454313367869},{x:0.23227710201651716,y:0.602338209770572},{x:0.22995424554357097,y:0.6016335789630078},{x:0.2281957517789948,y:0.6006936444633418},{x:0.22634631449119302,y:0.5999484204015954},{x:0.15434931449119302,y:0.5623544204015953},{x:0.15177463525955168,y:0.5606698034147719},{x:0.14910425200363037,y:0.5591414183832311},{x:0.14809125527340347,y:0.55825976164439},{x:0.1469674919716301,y:0.5575244814106152},{x:0.14477093694990967,y:0.5553699388664325},{x:0.14245003748743465,y:0.5533499553954043},{x:0.07045803748743465,y:0.4770619553954044},{x:0.06965771196430402,y:0.47602703312304784},{x:0.06872232232106745,y:0.47511235762423976},{x:0.06696488716695402,y:0.4725448695811053},{x:0.06506154021654398,y:0.4700836008922148},{x:0.0644784960433022,y:0.46891242859710086},{x:0.06373952398737684,y:0.46783284286481475},{x:0.06251674952606694,y:0.46497182979435886},{x:0.06113014455468816,y:0.46218652912371366},{x:0.06078678779193787,y:0.46092411430034236},{x:0.06027263160501272,y:0.4597211062088315},{x:0.023981631605012717,y:0.3447361062088315},{x:0.0234743267656997,y:0.3423269972319261},{x:0.02275966238185463,y:0.33997106449072584},{x:0.0225676139616898,y:0.3380211641581212},{x:0.022163875903973694,y:0.3361038771468651},{x:0.022136312630974576,y:0.33364208825896713},{x:0.021894999999999998,y:0.33119200000000004},{x:0.021894999999999998,y:0.25490100000000004}],[{x:0.111895,y:0.2618978965790472},{x:0.111895,y:0.324259211613835},{x:0.14299436878278687,y:0.42279496206129447},{x:0.20271328316555492,y:0.48607750096051383},{x:0.25821631520114247,y:0.5150589999999999},{x:0.3438328207386419,y:0.5150589999999999},{x:0.3993370917152178,y:0.4860772565752743},{x:0.4590577300605173,y:0.42279464888454726},{x:0.490157,y:0.324259211613835},{x:0.490157,y:0.2618978965790472},{x:0.4591028039244665,y:0.16445082019422033},{x:0.39914727445977055,y:0.10091681321598435},{x:0.3435475642149213,y:0.07103500000000003},{x:0.2585015743575747,y:0.07103500000000003},{x:0.20290309936793577,y:0.10091656436690524},{x:0.14294929572583875,y:0.164450507494742},{x:0.111895,y:0.2618978965790472}]],p:[[{x:0.031904,y:-0.15424400000000005},{x:0.032768662381854635,y:-0.16302306449072582},{x:0.0353294210369921,y:-0.17146475445642909},{x:0.03948786744638546,y:-0.17924466048588214},{x:0.04508419484660536,y:-0.18606380515339468},{x:0.051903339514117915,y:-0.19166013255361458},{x:0.05968324554357096,y:-0.19581857896300794},{x:0.06812493550927423,y:-0.1983793376181454},{x:0.076904,y:-0.19924400000000003},{x:0.08568306449072577,y:-0.1983793376181454},{x:0.09412475445642904,y:-0.19581857896300794},{x:0.1019046604858821,y:-0.19166013255361458},{x:0.10872380515339464,y:-0.18606380515339468},{x:0.11432013255361453,y:-0.17924466048588214},{x:0.1184785789630079,y:-0.17146475445642909},{x:0.12103933761814537,y:-0.16302306449072582},{x:0.121904,y:-0.15424400000000005},{x:0.121904,y:0.08461372659928788},{x:0.12362832174470662,y:0.08333438131496537},{x:0.12536021772829115,y:0.08178035235824195},{x:0.1271620685101291,y:0.08071254912256186},{x:0.12884414120453105,y:0.07946455014784792},{x:0.13094744853162613,y:0.07846927732892851},{x:0.13294924262910485,y:0.07728298474798974},{x:0.20690724262910487,y:0.04275398474798971},{x:0.20784573679964677,y:0.04242345923251374},{x:0.20872324554357097,y:0.041954421036992075},{x:0.21199903754957586,y:0.040960720395783044},{x:0.21522783943974558,y:0.03982357810698025},{x:0.21621278303720604,y:0.03968249467654502},{x:0.21716493550927424,y:0.0393936623818546},{x:0.22057164546850772,y:0.03905813073713887},{x:0.2239602522910248,y:0.038572746319036566},{x:0.22495379448531613,y:0.03862652673075318},{x:0.225944,y:0.038528999999999966},{x:0.338005,y:0.038528999999999966},{x:0.33886621477794643,y:0.03861382225207184},{x:0.3397300481447032,y:0.038562076501738984},{x:0.34324908380057223,y:0.0390454971728409},{x:0.3467840644907258,y:0.0393936623818546},{x:0.3476121832677305,y:0.039644869466491955},{x:0.3484695134136621,y:0.03976264352593092},{x:0.35182662109175783,y:0.04092330520367998},{x:0.35522575445642907,y:0.04195442103699206},{x:0.3559889530923063,y:0.042362359206810904},{x:0.35680683330070073,y:0.04264512708496585},{x:0.4318888333007007,y:0.07717412708496588},{x:0.43400924312431544,y:0.07841428389434572},{x:0.43622962614931016,y:0.07946501028796468},{x:0.4378075563324746,y:0.08063579029221077},{x:0.43950360927818305,y:0.0816277549521855},{x:0.44134133343031445,y:0.08325775393151234},{x:0.4433140658676044,y:0.08472146615145025},{x:0.5183930658676044,y:0.1527974661514503},{x:0.519792625068414,y:0.15434228537837358},{x:0.5213447099268285,y:0.1557337827706549},{x:0.522746916505161,y:0.1576032022519019},{x:0.5243158963961404,y:0.15933502631539204},{x:0.52538718417891,y:0.1611232027292085},{x:0.5266379784876352,y:0.1627907596241023},{x:0.5276485364111687,y:0.16489781566710873},{x:0.5288495066792682,y:0.16690245600899573},{x:0.5295513540552914,y:0.16886527099294393},{x:0.530452790490496,y:0.17074480411415546},{x:0.5674347904904959,y:0.2723648041141554},{x:0.5682868803844835,y:0.2756900562357905},{x:0.5692833376181453,y:0.27897493550927416},{x:0.5693799285821196,y:0.2799556400244087},{x:0.5696245448495124,y:0.2809102467717411},{x:0.5698115375679212,y:0.2843378395980749},{x:0.570148,y:0.28775399999999995},{x:0.570148,y:0.355831},{x:0.5698183264321395,y:0.3591782319067787},{x:0.5696454905753794,y:0.362537215959393},{x:0.5693867528695432,y:0.3635600718226051},{x:0.5692833376181453,y:0.3646100644907258},{x:0.5683069860848939,y:0.3678286641524751},{x:0.567482165940186,y:0.37108938766543825},{x:0.530500165940186,y:0.47369538766543823},{x:0.5295747233109523,y:0.4756403735939819},{x:0.5288495066792682,y:0.4776685439910043},{x:0.5276841925618525,y:0.47961366765708685},{x:0.5267099630491849,y:0.4816611880905031},{x:0.5254228546094585,y:0.48338825675926556},{x:0.5243158963961404,y:0.48523597368460797},{x:0.5227934986603558,y:0.48691638083844907},{x:0.5214385372739072,y:0.48873449599152474},{x:0.5198392258792078,y:0.49017727712011666},{x:0.5183930658676044,y:0.4917735338485497},{x:0.4433140658676044,y:0.5598495338485497},{x:0.44114571117720175,y:0.5614583923016819},{x:0.43910641435493325,y:0.5632279843609703},{x:0.43761161896162687,y:0.5640805897495177},{x:0.43622962614931016,y:0.5651059897120353},{x:0.43378906307257026,y:0.5662609093863238},{x:0.43144372048223223,y:0.5675986521566495},{x:0.35636172048223225,y:0.6011446521566495},{x:0.355773047491519,y:0.6013410447411239},{x:0.35522575445642907,y:0.6016335789630078},{x:0.3515938477815883,y:0.6027353058079922},{x:0.3479935881359665,y:0.6039364213810477},{x:0.34737791203915763,y:0.6040141959337602},{x:0.3467840644907258,y:0.6041943376181453},{x:0.34300700763927916,y:0.6045663452480041},{x:0.3392415999493003,y:0.6050420059085138},{x:0.33862258083352115,y:0.60499817359702},{x:0.338005,y:0.605059},{x:0.225944,y:0.605059},{x:0.2251997336627212,y:0.6049856961639699},{x:0.22445344765540867,y:0.6050343071552383},{x:0.22081614914993766,y:0.6045539507735711},{x:0.21716493550927424,y:0.6041943376181453},{x:0.21644927090994795,y:0.6039772431353645},{x:0.21570784104506457,y:0.6038793269025836},{x:0.2122341450916469,y:0.6026985986973952},{x:0.20872324554357097,y:0.6016335789630078},{x:0.20806368527139987,y:0.6012810366527016},{x:0.20735560428285457,y:0.6010403560617851},{x:0.13339760428285458,y:0.5674943560617851},{x:0.13116986982932302,y:0.566206971138138},{x:0.12884414120453105,y:0.5651064498521521},{x:0.1273598902040749,y:0.5640052229355318},{x:0.12575970914356202,y:0.5630804946901414},{x:0.12382593632220404,y:0.5613832370749092},{x:0.121904,y:0.5599572734007121},{x:0.121904,y:0.560059},{x:0.12103933761814537,y:0.5688380644907257},{x:0.1184785789630079,y:0.577279754456429},{x:0.11432013255361453,y:0.5850596604858821},{x:0.10872380515339464,y:0.5918788051533946},{x:0.10190466048588208,y:0.5974751325536145},{x:0.09412475445642904,y:0.6016335789630078},{x:0.08568306449072577,y:0.6041943376181453},{x:0.076904,y:0.605059},{x:0.0681249355092742,y:0.6041943376181453},{x:0.059683245543570934,y:0.6016335789630078},{x:0.051903339514117915,y:0.5974751325536145},{x:0.04508419484660536,y:0.5918788051533946},{x:0.03948786744638546,y:0.5850596604858821},{x:0.0353294210369921,y:0.577279754456429},{x:0.032768662381854635,y:0.5688380644907257},{x:0.031904,y:0.560059},{x:0.031904,y:-0.15424400000000005}],[{x:0.121904,y:0.20607608160839302},{x:0.121904,y:0.438494918391607},{x:0.17699192809119763,y:0.48844251958412144},{x:0.23567259519301437,y:0.5150589999999999},{x:0.3284092961747297,y:0.5150589999999999},{x:0.38817711429028284,y:0.4883552464171925},{x:0.4496333594179428,y:0.43263133769024387},{x:0.48014799999999996,y:0.3479689286382035},{x:0.48014799999999996,y:0.29568777567179994},{x:0.44968806913177495,y:0.21198926897045803},{x:0.3879916447872207,y:0.1560475837631447},{x:0.32815352882369925,y:0.12852899999999995},{x:0.2359312215606538,y:0.12852899999999995},{x:0.17717907548697515,y:0.15595879598931894},{x:0.121904,y:0.20607608160839302}]],q:[[{x:0.031905,y:0.285813},{x:0.03224141038262204,y:0.2823973680650777},{x:0.0324282929389951,y:0.2789703010434802},{x:0.03267301908894614,y:0.2780151713289937},{x:0.032769662381854636,y:0.2770339355092742},{x:0.03376596546737772,y:0.2737495643941025},{x:0.03461784473664685,y:0.27042480648246636},{x:0.07159784473664685,y:0.1688028064824664},{x:0.0724995244823713,y:0.166922651750872},{x:0.0732016076706368,y:0.1649592141085361},{x:0.07440224792307432,y:0.1629551516523985},{x:0.07541246819615938,y:0.16084867156853302},{x:0.07666362241043057,y:0.15918055247485355},{x:0.0777352629490018,y:0.15739181137154173},{x:0.07930380642556048,y:0.15566048970702676},{x:0.08070556947724908,y:0.15379156924569237},{x:0.08225811700526783,y:0.15239959067120604},{x:0.08365813234923056,y:0.15085428642438087},{x:0.15873913234923054,y:0.08277728642438094},{x:0.16071062555900373,y:0.0813145118522212},{x:0.16254708404197357,y:0.07968542770293169},{x:0.16424441690754124,y:0.07869257021816739},{x:0.16582360332185575,y:0.07752087268448676},{x:0.16804258800473576,y:0.07647082416071167},{x:0.17016157800418052,y:0.07523131768336211},{x:0.24523757800418056,y:0.0406993176833621},{x:0.24605678866737324,y:0.04041603175027397},{x:0.24682124554357093,y:0.04000742103699214},{x:0.2502190216384501,y:0.03897671692697023},{x:0.2535747153580455,y:0.03781630621794852},{x:0.25443345146196317,y:0.037698283616711674},{x:0.2552629355092742,y:0.03744666238185468},{x:0.25879650468596477,y:0.037098636194782805},{x:0.2623141045905799,y:0.03661518582049534},{x:0.2631793653883337,y:0.03666696209348752},{x:0.264042,y:0.036582000000000045},{x:0.376106,y:0.036582000000000045},{x:0.3770966034546813,y:0.036679565924422064},{x:0.37809054588497415,y:0.03662578154659327},{x:0.38147875036256007,y:0.037111169723096304},{x:0.3848850644907258,y:0.03744666238185468},{x:0.3858375996101805,y:0.03773561075136079},{x:0.38682293652697,y:0.03787676837406198},{x:0.39005134306992567,y:0.03901383585544661},{x:0.39332675445642906,y:0.04000742103699214},{x:0.39420461585020444,y:0.04047664772778637},{x:0.3951434813083616,y:0.04080732274273922},{x:0.4691044813083616,y:0.07533932274273922},{x:0.47110618065167786,y:0.07652560719175487},{x:0.47320939667814427,y:0.07752087268448679},{x:0.4748915208069018,y:0.0787689461703934},{x:0.4766934263594154,y:0.07983682509171056},{x:0.47842523099597173,y:0.08139082758714347},{x:0.48014799999999996,y:0.08266905805748193},{x:0.48014799999999996,y:-0.15619500000000008},{x:0.4810126623818546,y:-0.16497406449072585},{x:0.483573421036992,y:-0.17341575445642912},{x:0.4877318674463854,y:-0.18119566048588218},{x:0.4933281948466053,y:-0.18801480515339472},{x:0.5001473395141178,y:-0.19361113255361462},{x:0.5079272455435709,y:-0.19776957896300798},{x:0.5163689355092742,y:-0.20033033761814545},{x:0.525148,y:-0.20119500000000007},{x:0.5339270644907257,y:-0.20033033761814545},{x:0.542368754456429,y:-0.19776957896300798},{x:0.5501486604858821,y:-0.19361113255361462},{x:0.5569678051533946,y:-0.18801480515339472},{x:0.5625641325536145,y:-0.18119566048588218},{x:0.5667225789630078,y:-0.17341575445642912},{x:0.5692833376181453,y:-0.16497406449072585},{x:0.570148,y:-0.15619500000000008},{x:0.570148,y:0.5581050000000001},{x:0.5692833376181453,y:0.5668840644907258},{x:0.5667225789630078,y:0.5753257544564291},{x:0.5625641325536145,y:0.5831056604858822},{x:0.5569678051533946,y:0.5899248051533947},{x:0.5501486604858821,y:0.5955211325536146},{x:0.542368754456429,y:0.5996795789630079},{x:0.5339270644907257,y:0.6022403376181454},{x:0.525148,y:0.6031050000000001},{x:0.5163689355092742,y:0.6022403376181454},{x:0.5079272455435709,y:0.5996795789630079},{x:0.5001473395141178,y:0.5955211325536146},{x:0.4933281948466053,y:0.5899248051533947},{x:0.4877318674463854,y:0.5831056604858822},{x:0.483573421036992,y:0.5753257544564291},{x:0.4810126623818546,y:0.5668840644907258},{x:0.48014799999999996,y:0.5581050000000001},{x:0.48014799999999996,y:0.558005596763998},{x:0.4782247267606458,y:0.559432223348863},{x:0.47629232280480055,y:0.5611281889595863},{x:0.4746904859851039,y:0.5620538174856352},{x:0.4732046002880372,y:0.5631560030691136},{x:0.4708804506539088,y:0.5642554633364756},{x:0.4686543108210992,y:0.5655418481335316},{x:0.3946933108210992,y:0.5990868481335316},{x:0.3939857884552202,y:0.5993273179516839},{x:0.39332675445642906,y:0.5996795789630079},{x:0.3898152875083263,y:0.6007447708163117},{x:0.38634099890642704,y:0.6019255978665906},{x:0.3856001580501581,y:0.6020234163584227},{x:0.3848850644907258,y:0.6022403376181454},{x:0.38123326077373504,y:0.6026000088910167},{x:0.3775953617236344,y:0.6030803465985108},{x:0.3768496724756141,y:0.6030317546542387},{x:0.376106,y:0.6031050000000001},{x:0.264042,y:0.6031050000000001},{x:0.26342400033164626,y:0.6030441323453897},{x:0.26280456058717394,y:0.6030879828235033},{x:0.25903957642572706,y:0.602612304281983},{x:0.2552629355092742,y:0.6022403376181454},{x:0.254668685221597,y:0.6020600737641458},{x:0.25405259303422617,y:0.6019822349683996},{x:0.25045275226756825,y:0.6007811844842303},{x:0.24682124554357093,y:0.5996795789630079},{x:0.24627358134186672,y:0.5993868463484354},{x:0.24568451278884912,y:0.5991903095800973},{x:0.17060851278884911,y:0.5656453095800973},{x:0.16826609518471405,y:0.5643091772352096},{x:0.16582839971196278,y:0.5631560030691136},{x:0.1644435861855132,y:0.5621287897998347},{x:0.16294590048199914,y:0.5612744987855388},{x:0.1609091582647261,y:0.559507056844315},{x:0.15874327554635076,y:0.5579004698017108},{x:0.08366227554635075,y:0.4898404698017108},{x:0.0822135909199537,y:0.48824184486316324},{x:0.08061175169940471,y:0.4867967151276658},{x:0.07925889408089541,y:0.48498133393711457},{x:0.07773859373239328,y:0.48330368097737925},{x:0.0766296214289207,y:0.4814531488185024},{x:0.0753404919252871,y:0.4797232835162987},{x:0.07436779238761855,y:0.4776788549378484},{x:0.07320399804016177,y:0.47573684172476444},{x:0.07247735524331753,y:0.47370551725863386},{x:0.07155047598047157,y:0.4717573941431678},{x:0.034570475980471575,y:0.3691493941431678},{x:0.03374586128764337,y:0.36588916100716024},{x:0.032769662381854636,y:0.3626710644907258},{x:0.032666195333495754,y:0.36162054591923504},{x:0.032407352052251925,y:0.36059717166956007},{x:0.03223462203187315,y:0.35723870865311785},{x:0.031905,y:0.353892},{x:0.031905,y:0.285813}],[{x:0.121905,y:0.2937462257558374},{x:0.121905,y:0.3460304727958324},{x:0.1524170009298456,y:0.4306917867874386},{x:0.21387346155335435,y:0.48640130996954867},{x:0.2736381428091649,y:0.513105},{x:0.36637802828147564,y:0.513105},{x:0.4250638403772601,y:0.4864880590885319},{x:0.48014799999999996,y:0.4365549481293854},{x:0.48014799999999996,y:0.20413270643748072},{x:0.4248733312055972,y:0.15401438585682045},{x:0.36611835928516706,y:0.12658200000000003},{x:0.27389496414813935,y:0.12658200000000003},{x:0.2140623112166411,y:0.15410266134357853},{x:0.15236330162501277,y:0.21004602219345103},{x:0.121905,y:0.2937462257558374}]],r:[[{x:0.062422000000000005,y:0.03920400000000002},{x:0.06328666238185464,y:0.030424935509274227},{x:0.0658474210369921,y:0.02198324554357097},{x:0.07000586744638546,y:0.01420333951411792},{x:0.07560219484660537,y:0.00738419484660538},{x:0.08242133951411793,y:0.0017878674463854757},{x:0.09020124554357097,y:-0.002370578963007887},{x:0.09864293550927423,y:-0.004931337618145348},{x:0.107422,y:-0.005795999999999982},{x:0.11620106449072577,y:-0.004931337618145348},{x:0.12464275445642904,y:-0.002370578963007887},{x:0.1324226604858821,y:0.0017878674463854827},{x:0.13924180515339463,y:0.00738419484660538},{x:0.14483813255361455,y:0.01420333951411792},{x:0.14899657896300791,y:0.02198324554357098},{x:0.15155733761814538,y:0.030424935509274248},{x:0.152422,y:0.03920400000000002},{x:0.152422,y:0.3275398012121413},{x:0.1925108808296549,y:0.4204278633799401},{x:0.27478075869941443,y:0.4836647262821032},{x:0.3576648607132649,y:0.5150589999999999},{x:0.49463,y:0.5150589999999999},{x:0.5034090644907258,y:0.5159236623818546},{x:0.511850754456429,y:0.5184844210369921},{x:0.5196306604858821,y:0.5226428674463854},{x:0.5264498051533947,y:0.5282391948466053},{x:0.5320461325536145,y:0.5350583395141179},{x:0.5362045789630079,y:0.542838245543571},{x:0.5387653376181454,y:0.5512799355092742},{x:0.53963,y:0.560059},{x:0.5387653376181454,y:0.5688380644907257},{x:0.5362045789630079,y:0.577279754456429},{x:0.5320461325536145,y:0.5850596604858821},{x:0.5264498051533947,y:0.5918788051533946},{x:0.5196306604858821,y:0.5974751325536145},{x:0.511850754456429,y:0.6016335789630078},{x:0.5034090644907258,y:0.6041943376181453},{x:0.49463,y:0.605059},{x:0.349428,y:0.605059},{x:0.34572095329292224,y:0.6046938877675093},{x:0.3420044651532413,y:0.6044424555930356},{x:0.34133700376168824,y:0.6042621064259311},{x:0.3406489355092742,y:0.6041943376181453},{x:0.33708434852821606,y:0.6031130319790114},{x:0.33348832364990477,y:0.6021413801353276},{x:0.23668632364990477,y:0.5654753801353276},{x:0.2347311434313091,y:0.5645060813254815},{x:0.23268939209293205,y:0.5637356779621759},{x:0.23078888495220712,y:0.562551669954317},{x:0.22878273496962892,y:0.5615571024090896},{x:0.2270542238076375,y:0.5602249916656349},{x:0.22520200238894322,y:0.5590710654608507},{x:0.152422,y:0.5031286093364514},{x:0.152422,y:0.560059},{x:0.15155733761814538,y:0.5688380644907257},{x:0.14899657896300791,y:0.577279754456429},{x:0.14483813255361455,y:0.5850596604858821},{x:0.13924180515339463,y:0.5918788051533946},{x:0.1324226604858821,y:0.5974751325536145},{x:0.12464275445642904,y:0.6016335789630078},{x:0.11620106449072577,y:0.6041943376181453},{x:0.107422,y:0.605059},{x:0.09864293550927423,y:0.6041943376181453},{x:0.09020124554357094,y:0.6016335789630078},{x:0.08242133951411793,y:0.5974751325536145},{x:0.07560219484660537,y:0.5918788051533946},{x:0.07000586744638546,y:0.5850596604858821},{x:0.0658474210369921,y:0.577279754456429},{x:0.06328666238185464,y:0.5688380644907257},{x:0.062422000000000005,y:0.560059},{x:0.062422000000000005,y:0.03920400000000002}]],s:[[{x:0.056563,y:0.369888},{x:0.056809270227573656,y:0.3673875764180495},{x:0.05684306423764694,y:0.36487528163458033},{x:0.05724057756471223,y:0.36300843953465567},{x:0.057427662381854636,y:0.3611089355092742},{x:0.05815700903783985,y:0.3587046018033244},{x:0.05868027810379197,y:0.35624717294397146},{x:0.05943435615016931,y:0.3544937526945111},{x:0.0599884210369921,y:0.352667245543571},{x:0.06117281573842168,y:0.3504513989095756},{x:0.06216545092350078,y:0.34814327358726177},{x:0.06324711489275962,y:0.3465706581451233},{x:0.06414686744638545,y:0.3448873395141179},{x:0.06574079456909979,y:0.3429451336955602},{x:0.0671646494598194,y:0.3408750118720105},{x:0.06853233161222538,y:0.3395436359667022},{x:0.06974319484660536,y:0.33806819484660533},{x:0.07168540066516299,y:0.33647426772389105},{x:0.07348575731657993,y:0.3347217030198468},{x:0.07508689839402109,y:0.33368273068076537},{x:0.07656233951411792,y:0.33247186744638546},{x:0.07877818614811302,y:0.331287472744956},{x:0.08088585786376518,y:0.3299198152391437},{x:0.15568385786376518,y:0.29122381523914376},{x:0.1574569269125657,y:0.29051717359061785},{x:0.15914024554357095,y:0.2896174210369921},{x:0.16154457924952065,y:0.28888807438100694},{x:0.16387856938737105,y:0.2879578823843842},{x:0.16575542835833412,y:0.2876107272686775},{x:0.16758193550927422,y:0.2870566623818547},{x:0.17008235909122482,y:0.286810392154281},{x:0.17255297371919248,y:0.2863534124236203},{x:0.17446149597461844,y:0.28637908481714247},{x:0.176361,y:0.28619200000000006},{x:0.288347309340128,y:0.28619200000000006},{x:0.3974525128623667,y:0.21942256309828728},{x:0.45549,y:0.1602321160680505},{x:0.45549,y:0.13007078589845048},{x:0.407404042616179,y:0.10590438131127383},{x:0.31753214348357883,y:0.07103500000000003},{x:0.21224543978224936,y:0.07103500000000003},{x:0.16354378174687056,y:0.09622932957230687},{x:0.14433666195924297,y:0.15500005013212306},{x:0.1407876006468136,y:0.16307617408904287},{x:0.13573115992893667,y:0.17030473007440486},{x:0.12936165598671553,y:0.1764079287355125},{x:0.12192386528459082,y:0.18115122757053267},{x:0.11370361794808405,y:0.18435234426530817},{x:0.10501681347236942,y:0.18588826170046568},{x:0.09619728088183255,y:0.18569995543032455},{x:0.08758394986787689,y:0.1837946619592429},{x:0.07950782591095708,y:0.18024560064681355},{x:0.07227926992559508,y:0.1751891599289366},{x:0.06617607126448745,y:0.1688196559867155},{x:0.06143277242946728,y:0.16138186528459075},{x:0.05823165573469179,y:0.153161617948084},{x:0.05669573829953427,y:0.14447481347236937},{x:0.0568840445696754,y:0.1356552808818325},{x:0.05878933804075704,y:0.12704194986787684},{x:0.08372233804075704,y:0.050750949867876836},{x:0.08542587043333498,y:0.04687444913825993},{x:0.08709879890390285,y:0.042984643121031924},{x:0.08719974017890864,y:0.04283789110571456},{x:0.0872713993531864,y:0.04267482591095703},{x:0.0896984666241539,y:0.03920515373890898},{x:0.0920981137517354,y:0.03571646140762123},{x:0.09222574536637099,y:0.03559222185697407},{x:0.09232784007106334,y:0.035446269925595034},{x:0.09538517138631239,y:0.032516763866873036},{x:0.0984193200775319,y:0.02956325371133576},{x:0.09856873722042347,y:0.029466301081615798},{x:0.09869734401328446,y:0.029343071264487396},{x:0.10226744784494098,y:0.027066310594042624},{x:0.10581949746716537,y:0.024761484353185106},{x:0.18061849746716538,y:-0.013933515646814817},{x:0.1823912439162618,y:-0.014639995851387814},{x:0.18407424554357094,y:-0.01553957896300786},{x:0.18647892276401756,y:-0.016269029822976466},{x:0.18881326125361947,y:-0.017199317363260178},{x:0.19068977232738848,y:-0.017546377073194466},{x:0.1925159355092742,y:-0.018100337618145335},{x:0.19501671633437545,y:-0.018346643031098245},{x:0.19748769126025723,y:-0.018803648509519946},{x:0.19939585369049342,y:-0.018777950414796084},{x:0.201295,y:-0.018964999999999968},{x:0.325956,y:-0.018964999999999968},{x:0.3298421413721484,y:-0.018582248482612737},{x:0.33373593654739714,y:-0.01828737118339306},{x:0.334227355251249,y:-0.018150342613638803},{x:0.3347350644907258,y:-0.018100337618145335},{x:0.33847186362931597,y:-0.016966791992147238},{x:0.34223331291484477,y:-0.015917938922943478},{x:0.44196531291484475,y:0.022777061077056446},{x:0.44388622686678575,y:0.02374867869889352},{x:0.4458951331158935,y:0.02452214291663178},{x:0.5206971331158935,y:0.06211514291663188},{x:0.5230429253028388,y:0.06359852573319036},{x:0.5254906604858821,y:0.06490686744638552},{x:0.526762463529903,y:0.06595060923072474},{x:0.5281530225051898,y:0.06682994172267823},{x:0.5301643473216751,y:0.06874246310749585},{x:0.5323098051533947,y:0.07050319484660542},{x:0.5333535469377338,y:0.07177499789062616},{x:0.5345458374532134,y:0.07290871885358566},{x:0.536145400814505,y:0.07517688168239829},{x:0.5379061325536145,y:0.07732233951411796},{x:0.538681702666837,y:0.0787733291400739},{x:0.5396299056666436,y:0.08011787031323085},{x:0.5407562372498129,y:0.08265451036052812},{x:0.5420645789630079,y:0.08510224554357101},{x:0.5425421726806072,y:0.08667666103386074},{x:0.5432098492552168,y:0.08818035245395842},{x:0.5438196647691762,y:0.09088798806528645},{x:0.5446253376181454,y:0.09354393550927428},{x:0.5447866012813922,y:0.09518127295954937},{x:0.5451480929944793,y:0.09678632860859225},{x:0.545217957571016,y:0.09956090686586556},{x:0.54549,y:0.10232300000000005},{x:0.54549,y:0.17861300000000002},{x:0.5450792542455133,y:0.1827833716312913},{x:0.5447095428008049,y:0.18695758114513777},{x:0.5446471218945653,y:0.18717088502046353},{x:0.5446253376181454,y:0.1873920644907258},{x:0.5434088850836819,y:0.19140217107899518},{x:0.5422319296624953,y:0.19542404720269643},{x:0.5421290946347417,y:0.1956210747891699},{x:0.5420645789630079,y:0.19583375445642906},{x:0.5400891672372728,y:0.199529489854385},{x:0.5381501975764,y:0.20324447414399938},{x:0.5380109003195782,y:0.20341765378196683},{x:0.5379061325536145,y:0.20361366048588211},{x:0.5352476756014034,y:0.20685299965477524},{x:0.5326212052175259,y:0.21011832734743824},{x:0.45781920521752584,y:0.28640632734743826},{x:0.45695946559173245,y:0.28712616331644525},{x:0.45621413415776596,y:0.2879638966272176},{x:0.45358375241990234,y:0.28995255364350675},{x:0.45105542866152953,y:0.29206944848930627},{x:0.4500717756605794,y:0.29260772613156716},{x:0.4491773318997613,y:0.2932839556822147},{x:0.3245133318997613,y:0.3695749556822147},{x:0.3213472249094816,y:0.3711082739568931},{x:0.3182447544564291,y:0.37276657896300797},{x:0.31738368821196916,y:0.37302778055263114},{x:0.3165738477898179,y:0.3734199792757539},{x:0.31316944110160955,y:0.3743061584374605},{x:0.3098030644907258,y:0.3753273376181454},{x:0.3089075854904768,y:0.3754155346015568},{x:0.3080367917497669,y:0.3756422053074494},{x:0.30452491480344407,y:0.37584718998797495},{x:0.301024,y:0.376192},{x:0.18731182116617404,y:0.376192},{x:0.146563,y:0.397272996602132},{x:0.146563,y:0.42779681790574337},{x:0.20153437253410483,y:0.48386323770148376},{x:0.2842918489876165,y:0.5150589999999999},{x:0.39008456648169626,y:0.5150589999999999},{x:0.4553477907191711,y:0.4822576837794137},{x:0.4635801440629335,y:0.47908783003036465},{x:0.47227272283422006,y:0.4775849365970516},{x:0.4810914761057044,y:0.47780675883128426},{x:0.48969750413477736,y:0.47974477222900047},{x:0.4977600820905977,y:0.48332450002217653},{x:0.5049693696238691,y:0.488408375279255},{x:0.5110483178577028,y:0.4948010275251766},{x:0.5157633162205862,y:0.5022567907191711},{x:0.5189331699696352,y:0.5104891440629334},{x:0.5204360634029483,y:0.51918172283422},{x:0.5202142411687157,y:0.5280004761057044},{x:0.5182762277709995,y:0.5366065041347774},{x:0.5146964999778234,y:0.5446690820905977},{x:0.509612624720745,y:0.551878369623869},{x:0.5032199724748234,y:0.5579573178577029},{x:0.49576420928082887,y:0.5626723162205862},{x:0.42096520928082887,y:0.6002663162205862},{x:0.41942927464851043,y:0.6008577252562829},{x:0.41797775445642904,y:0.6016335789630078},{x:0.4153223812886681,y:0.6024390776071881},{x:0.41273285593706643,y:0.6034361699696352},{x:0.41111105567880996,y:0.6037165692645292},{x:0.40953606449072577,y:0.6041943376181453},{x:0.40677456858393113,y:0.6044663212253706},{x:0.4040402771657799,y:0.6049390634029483},{x:0.4023949361559939,y:0.6048976773693867},{x:0.400757,y:0.605059},{x:0.276092,y:0.605059},{x:0.2724204350331364,y:0.6046973824138966},{x:0.26873912724910987,y:0.6044542166602351},{x:0.2680367190736708,y:0.6042656240771296},{x:0.2673129355092742,y:0.6041943376181453},{x:0.2637824667250502,y:0.6031233816208718},{x:0.26021933352302795,y:0.6021667007079561},{x:0.1604883335230279,y:0.5645727007079561},{x:0.15963695838633216,y:0.5641523105976027},{x:0.15873109713512196,y:0.563867735718488},{x:0.15568848233041307,y:0.5622026409240001},{x:0.1525785174681621,y:0.5606670094317409},{x:0.15182551530799093,y:0.5600886019499048},{x:0.15099257773152036,y:0.559632770334096},{x:0.14833326979676884,y:0.5574060851671644},{x:0.1455826488796249,y:0.5552932363569977},{x:0.14495695714670492,y:0.554579039378831},{x:0.14422895256892138,y:0.5539694683796904},{x:0.06943095256892137,y:0.47768146837969044},{x:0.06680494464711424,y:0.4744165369262552},{x:0.06414686744638545,y:0.4711776604858821},{x:0.0640418150384659,y:0.470981121254323},{x:0.0639021439692389,y:0.47080746737336276},{x:0.06196355058191934,y:0.4670929619312254},{x:0.0599884210369921,y:0.46339775445642906},{x:0.05992373008360734,y:0.46318449696300446},{x:0.05982062094636722,y:0.462986931318802},{x:0.05864394115023422,y:0.4589655982489849},{x:0.057427662381854636,y:0.45495606449072584},{x:0.05740581892006417,y:0.454734284101312},{x:0.05734323414113077,y:0.4545203990307778},{x:0.05697368708086039,y:0.4503467759079653},{x:0.056563,y:0.44617700000000005},{x:0.056563,y:0.369888}]],t:[[{x:0.036055000000000004,y:0.484201},{x:0.03691966238185464,y:0.4754219355092742},{x:0.0394804210369921,y:0.466980245543571},{x:0.04363886744638546,y:0.4592003395141179},{x:0.049235194846605365,y:0.45238119484660533},{x:0.05605433951411792,y:0.44678486744638546},{x:0.06383424554357096,y:0.44262642103699207},{x:0.07227593550927423,y:0.4400656623818546},{x:0.081055,y:0.439201},{x:0.201032,y:0.439201},{x:0.201032,y:0.17345100000000002},{x:0.2013458215844704,y:0.17026471598156256},{x:0.20148726326025637,y:0.1670661406603643},{x:0.20177732050748418,y:0.165883633894134},{x:0.20189666238185464,y:0.16467193550927425},{x:0.20282606714776777,y:0.16160809859877695},{x:0.20358880215081968,y:0.15849857690755997},{x:0.20410398165518515,y:0.15739537903902878},{x:0.2044574210369921,y:0.15623024554357098},{x:0.20596669248041014,y:0.15340659727526443},{x:0.20732140933230742,y:0.15050562638878262},{x:0.2623124093323074,y:0.05773162638878261},{x:0.2645408071528226,y:0.05469603003381387},{x:0.2666808493837164,y:0.051597510818645845},{x:0.2671477670132535,y:0.051144744093296994},{x:0.26753264280400524,y:0.05062045370997057},{x:0.2703104380556505,y:0.04807792433615628},{x:0.27301385108661325,y:0.04545644382682572},{x:0.2735601274310704,y:0.04510346799784869},{x:0.2740398919211364,y:0.04466433724917905},{x:0.27726033549019774,y:0.04271258283448707},{x:0.28042322867453984,y:0.040668883056825214},{x:0.28102787064035484,y:0.04042926278737637},{x:0.28158408674943697,y:0.04009216722176761},{x:0.28512341879560005,y:0.038806192593798694},{x:0.288624243922019,y:0.03741881178414046},{x:0.39861224392201905,y:0.005893811784140432},{x:0.4004470188387682,y:0.005558110934368086},{x:0.4022319355092743,y:0.0050166623818546086},{x:0.4047755505163489,y:0.004766138170207483},{x:0.4072897364122725,y:0.0043061284251197166},{x:0.4091547486303562,y:0.0043348248023798485},{x:0.411011,y:0.004151999999999975},{x:0.520997,y:0.004151999999999975},{x:0.5297760644907258,y:0.0050166623818546086},{x:0.538217754456429,y:0.00757742103699207},{x:0.5459976604858822,y:0.011735867446385433},{x:0.5528168051533947,y:0.017332194846605337},{x:0.5584131325536146,y:0.02415133951411788},{x:0.5625715789630079,y:0.031931245543570935},{x:0.5651323376181454,y:0.040372935509274205},{x:0.5659970000000001,y:0.049151999999999973},{x:0.5651323376181454,y:0.05793106449072574},{x:0.5625715789630079,y:0.06637275445642901},{x:0.5584131325536146,y:0.07415266048588207},{x:0.5528168051533947,y:0.08097180515339461},{x:0.5459976604858822,y:0.08656813255361451},{x:0.538217754456429,y:0.09072657896300787},{x:0.5297760644907258,y:0.09328733761814534},{x:0.520997,y:0.09415199999999997},{x:0.41733272532416527,y:0.09415199999999997},{x:0.33061421916568134,y:0.11900744701827656},{x:0.291032,y:0.1857856616511605},{x:0.291032,y:0.439201},{x:0.466004,y:0.439201},{x:0.47478306449072577,y:0.4400656623818546},{x:0.48322475445642904,y:0.44262642103699207},{x:0.4910046604858821,y:0.44678486744638546},{x:0.49782380515339464,y:0.45238119484660533},{x:0.5034201325536145,y:0.4592003395141179},{x:0.5075785789630078,y:0.466980245543571},{x:0.5101393376181453,y:0.4754219355092742},{x:0.511004,y:0.484201},{x:0.5101393376181453,y:0.4929800644907258},{x:0.5075785789630078,y:0.501421754456429},{x:0.5034201325536145,y:0.5092016604858821},{x:0.49782380515339464,y:0.5160208051533947},{x:0.4910046604858821,y:0.5216171325536145},{x:0.48322475445642904,y:0.5257755789630079},{x:0.47478306449072577,y:0.5283363376181454},{x:0.466004,y:0.529201},{x:0.291032,y:0.529201},{x:0.291032,y:0.702148},{x:0.2901673376181454,y:0.7109270644907257},{x:0.2876065789630079,y:0.719368754456429},{x:0.28344813255361456,y:0.7271486604858821},{x:0.27785180515339464,y:0.7339678051533947},{x:0.2710326604858821,y:0.7395641325536145},{x:0.26325275445642904,y:0.7437225789630079},{x:0.25481106449072577,y:0.7462833376181454},{x:0.246032,y:0.747148},{x:0.23725293550927423,y:0.7462833376181454},{x:0.22881124554357096,y:0.7437225789630079},{x:0.2210313395141179,y:0.7395641325536145},{x:0.21421219484660536,y:0.7339678051533947},{x:0.20861586744638547,y:0.7271486604858821},{x:0.2044574210369921,y:0.719368754456429},{x:0.20189666238185464,y:0.7109270644907257},{x:0.201032,y:0.702148},{x:0.201032,y:0.529201},{x:0.081055,y:0.529201},{x:0.07227593550927423,y:0.5283363376181454},{x:0.06383424554357094,y:0.5257755789630079},{x:0.05605433951411792,y:0.5216171325536145},{x:0.049235194846605365,y:0.5160208051533947},{x:0.04363886744638546,y:0.5092016604858821},{x:0.0394804210369921,y:0.501421754456429},{x:0.03691966238185464,y:0.4929800644907258},{x:0.036055000000000004,y:0.484201}]],u:[[{x:0.047041,y:0.17386599999999997},{x:0.04733731084809023,y:0.17085750547164297},{x:0.04744678100255899,y:0.1678364368310572},{x:0.0477687404511641,y:0.16647712720137547},{x:0.04790566238185463,y:0.1650869355092742},{x:0.048783207866406234,y:0.16219405573845885},{x:0.04947995583647738,y:0.15925239265237093},{x:0.08761895583647737,y:0.04817539265237096},{x:0.08938287590080696,y:0.04431825367483454},{x:0.09111755940033861,y:0.04044787795123246},{x:0.0912166047918106,y:0.04030846472648272},{x:0.0912877277290914,y:0.04015294120864865},{x:0.09377024504918263,y:0.03671403980837168},{x:0.09622666993792225,y:0.03325645223155292},{x:0.09635101037087945,y:0.03313904059014135},{x:0.09645110783403886,y:0.03300038080982997},{x:0.09955682066149267,y:0.030111872039067004},{x:0.10264058790854466,y:0.027199945760571206},{x:0.10278544504987946,y:0.027109047766032002},{x:0.10291067034954356,y:0.026992580340839414},{x:0.10652022788210418,y:0.024765467971757132},{x:0.11011283004156149,y:0.02251110668543916},{x:0.1858688300415615,y:-0.015231893314560811},{x:0.1873332068933575,y:-0.0157898639141544},{x:0.18871524554357097,y:-0.01652857896300789},{x:0.19144581156206075,y:-0.017356887109087667},{x:0.19411224226228255,y:-0.018372875537717062},{x:0.1956573361874375,y:-0.018634439137126358},{x:0.19715693550927424,y:-0.019089337618145352},{x:0.1999966293703256,y:-0.019369023051625026},{x:0.20281003486202434,y:-0.01984529472354478},{x:0.2043764687674932,y:-0.01980039958033106},{x:0.205936,y:-0.019953999999999986},{x:0.319832,y:-0.019953999999999986},{x:0.32132997950952447,y:-0.01980646189590665},{x:0.3228344649392302,y:-0.019853723877644197},{x:0.3257100002545037,y:-0.019375067506000147},{x:0.3286110644907258,y:-0.019089337618145352},{x:0.3300514774877758,y:-0.018652393112465325},{x:0.33153627500704863,y:-0.018405236421526333},{x:0.3342631764918695,y:-0.017374788187221168},{x:0.33705275445642907,y:-0.01652857896300789},{x:0.3383802466773209,y:-0.015819019588053155},{x:0.3397882963501792,y:-0.015286942317463331},{x:0.4160692963501792,y:0.02245605768253664},{x:0.4183042276197719,y:0.02384992521458428},{x:0.42064256487504254,y:0.025062345668598177},{x:0.4220380841989542,y:0.02617863282445781},{x:0.4235544084161923,y:0.027124324140885128},{x:0.42547446604244665,y:0.028927422360218155},{x:0.42753134130624215,y:0.03057273346328787},{x:0.465011,y:0.06712410441560081},{x:0.465011,y:0.025046000000000013},{x:0.4658756623818546,y:0.016266935509274223},{x:0.46843642103699207,y:0.007825245543570968},{x:0.47259486744638546,y:0.000045339514117916785},{x:0.4781911948466053,y:-0.006773805153394624},{x:0.4850103395141179,y:-0.012370132553614528},{x:0.492790245543571,y:-0.01652857896300789},{x:0.5012319355092743,y:-0.019089337618145352},{x:0.510011,y:-0.019953999999999986},{x:0.5187900644907257,y:-0.019089337618145352},{x:0.527231754456429,y:-0.01652857896300789},{x:0.5350116604858821,y:-0.012370132553614521},{x:0.5418308051533947,y:-0.006773805153394624},{x:0.5474271325536145,y:0.000045339514117916785},{x:0.5515855789630079,y:0.007825245543570974},{x:0.5541463376181454,y:0.016266935509274244},{x:0.555011,y:0.025046000000000013},{x:0.555011,y:0.545898},{x:0.5541463376181454,y:0.5546770644907257},{x:0.5515855789630079,y:0.563118754456429},{x:0.5474271325536145,y:0.5708986604858821},{x:0.5418308051533947,y:0.5777178051533947},{x:0.5350116604858821,y:0.5833141325536145},{x:0.527231754456429,y:0.5874725789630079},{x:0.5187900644907257,y:0.5900333376181454},{x:0.510011,y:0.590898},{x:0.5012319355092743,y:0.5900333376181454},{x:0.492790245543571,y:0.5874725789630079},{x:0.4850103395141179,y:0.5833141325536145},{x:0.4781911948466053,y:0.5777178051533947},{x:0.47259486744638546,y:0.5708986604858821},{x:0.46843642103699207,y:0.563118754456429},{x:0.4658756623818546,y:0.5546770644907257},{x:0.465011,y:0.545898},{x:0.465011,y:0.19283699530520199},{x:0.36978450462305706,y:0.099969048308901},{x:0.30930812362389754,y:0.07004600000000001},{x:0.2165251763155874,y:0.07004600000000001},{x:0.16675256431883717,y:0.09484360935890679},{x:0.137041,y:0.18137632992954258},{x:0.137041,y:0.545898},{x:0.13617633761814535,y:0.5546770644907257},{x:0.1336155789630079,y:0.563118754456429},{x:0.12945713255361452,y:0.5708986604858821},{x:0.12386080515339463,y:0.5777178051533947},{x:0.11704166048588208,y:0.5833141325536145},{x:0.10926175445642904,y:0.5874725789630079},{x:0.10082006449072577,y:0.5900333376181454},{x:0.092041,y:0.590898},{x:0.08326193550927423,y:0.5900333376181454},{x:0.07482024554357093,y:0.5874725789630079},{x:0.06704033951411792,y:0.5833141325536145},{x:0.06022119484660536,y:0.5777178051533947},{x:0.05462486744638546,y:0.5708986604858821},{x:0.050466421036992094,y:0.563118754456429},{x:0.04790566238185463,y:0.5546770644907257},{x:0.047041,y:0.545898},{x:0.047041,y:0.17386599999999997}]],v:[[{x:0.003930906419490336,y:0.5438334563092145},{x:0.005386967221411215,y:0.5351329102741644},{x:0.00851244255100142,y:0.5268836061622384},{x:0.26071044255100145,y:0.018289606162238365},{x:0.26144011887972296,y:0.017121905714788027},{x:0.2620056398700735,y:0.01586646241095203},{x:0.26377267234206975,y:0.013389122267562115},{x:0.26538522214413157,y:0.010808560104194675},{x:0.26632868500311185,y:0.009805649483352854},{x:0.267128264504625,y:0.008684656842684199},{x:0.2693446490294707,y:0.006599649029470163},{x:0.2714296568426842,y:0.00438326450462502},{x:0.27255064948335267,y:0.0035836850031119977},{x:0.2735535601041947,y:0.0026402221441315446},{x:0.27613412226756273,y:0.0010276723420693272},{x:0.278611462410952,y:-0.0007393601299264599},{x:0.2798669057147878,y:-0.0013048811202769175},{x:0.28103460616223835,y:-0.0020345574489985807},{x:0.28388017640738666,y:-0.0031126798553442526},{x:0.2866546460885495,y:-0.00436245420755494},{x:0.28799629407344673,y:-0.00467218403223142},{x:0.2892839102741644,y:-0.005160032778588779},{x:0.2922851349323858,y:-0.00566229614975999},{x:0.29525011283741587,y:-0.006346784254711718},{x:0.2966264067237199,y:-0.006388820170250395},{x:0.2979844563092145,y:-0.006616093580509658},{x:0.301026,y:-0.00652319621682493},{x:0.30406754369078554,y:-0.006616093580509658},{x:0.3054255932762801,y:-0.006388820170250395},{x:0.30680188716258416,y:-0.006346784254711718},{x:0.30976686506761425,y:-0.005662296149759988},{x:0.31276808972583564,y:-0.005160032778588779},{x:0.3140557059265533,y:-0.00467218403223142},{x:0.3153973539114505,y:-0.00436245420755494},{x:0.3181718235926135,y:-0.0031126798553442175},{x:0.3210173938377617,y:-0.0020345574489985807},{x:0.32218509428521225,y:-0.0013048811202769192},{x:0.323440537589048,y:-0.0007393601299264599},{x:0.32591787773243747,y:0.0010276723420694187},{x:0.32849843989580535,y:0.0026402221441315446},{x:0.32950135051664736,y:0.0035836850031119635},{x:0.3306223431573158,y:0.00438326450462502},{x:0.3327073509705293,y:0.006599649029470129},{x:0.334923735495375,y:0.008684656842684203},{x:0.33572331499688823,y:0.009805649483352899},{x:0.33666677785586846,y:0.01080856010419469},{x:0.3382793276579303,y:0.013389122267562135},{x:0.3400463601299265,y:0.01586646241095204},{x:0.34061188112027707,y:0.017121905714788034},{x:0.3413415574489986,y:0.018289606162238365},{x:0.5935395574489987,y:0.5268836061622384},{x:0.5966650327785888,y:0.5351329102741644},{x:0.5981210935805097,y:0.5438334563092145},{x:0.5978517842547117,y:0.5526508871625841},{x:0.595867454207555,y:0.5612463539114505},{x:0.5922443601299265,y:0.569289537589048},{x:0.587121735495375,y:0.5764713431573159},{x:0.5806964398958053,y:0.5825157778558685},{x:0.5732153938377617,y:0.5871905574489986},{x:0.5649660897258356,y:0.5903160327785888},{x:0.5562655436907855,y:0.5917720935805096},{x:0.5474481128374159,y:0.5915027842547117},{x:0.5388526460885495,y:0.589518454207555},{x:0.5308094624109521,y:0.5858953601299265},{x:0.5236276568426842,y:0.580772735495375},{x:0.5175832221441315,y:0.5743474398958054},{x:0.5129084425510014,y:0.5668663938377616},{x:0.301026,y:0.13957458745236595},{x:0.08914355744899859,y:0.5668663938377616},{x:0.08446877785586845,y:0.5743474398958054},{x:0.07842434315731579,y:0.580772735495375},{x:0.07124253758904797,y:0.5858953601299265},{x:0.06319935391145051,y:0.589518454207555},{x:0.054603887162584124,y:0.5915027842547117},{x:0.04578645630921451,y:0.5917720935805096},{x:0.037085910274164385,y:0.5903160327785888},{x:0.028836606162238352,y:0.5871905574489986},{x:0.02135556010419467,y:0.5825157778558685},{x:0.014930264504625007,y:0.5764713431573159},{x:0.009807639870073534,y:0.569289537589048},{x:0.006184545792445054,y:0.5612463539114505},{x:0.004200215745288276,y:0.5526508871625841},{x:0.003930906419490336,y:0.5438334563092145}]],w:[[{x:-0.04481226541001698,y:0.5427688011711321},{x:-0.0431501306438814,y:0.534105261341125},{x:0.1073618693561186,y:0.025511261341124997},{x:0.10747750697825527,y:0.02522662926113043},{x:0.10753949092041715,y:0.02492572151525217},{x:0.1091366577408943,y:0.021142772088450095},{x:0.11068223944402648,y:0.01733845540642648},{x:0.11085118408582124,y:0.017081852232977028},{x:0.1109706812129555,y:0.01679881881229654},{x:0.11327517574267339,y:0.0134001494872997},{x:0.11553324489331337,y:0.009970459715744673},{x:0.11574900410692728,y:0.009751746564891355},{x:0.11592142221145292,y:0.009497464285038355},{x:0.11884468401801046,y:0.006613684018010047},{x:0.12172846428503836,y:0.0036904222114529234},{x:0.12198274656489135,y:0.0035180041069272803},{x:0.12220145971574467,y:0.0033022448933133844},{x:0.1256311494872997,y:0.001044175742673395},{x:0.12902981881229655,y:-0.0012603187870445023},{x:0.12931285223297703,y:-0.0013798159141787526},{x:0.12956945540642648,y:-0.0015487605559735135},{x:0.1333737720884501,y:-0.0030943422591057004},{x:0.13715672151525218,y:-0.004691509079582858},{x:0.13745762926113045,y:-0.004753493021744735},{x:0.137742261341125,y:-0.004869130643881392},{x:0.14177500717701197,y:-0.005642829061426576},{x:0.14579686008065018,y:-0.006471289947453558},{x:0.1461040784358031,y:-0.006473378696506754},{x:0.14640580117113214,y:-0.006531265410016966},{x:0.150512,y:-0.006503347745684165},{x:0.15461819882886788,y:-0.006531265410016966},{x:0.15491992156419693,y:-0.006473378696506754},{x:0.15522713991934983,y:-0.006471289947453558},{x:0.159248992822988,y:-0.005642829061426585},{x:0.16328173865887502,y:-0.004869130643881392},{x:0.16356637073886957,y:-0.004753493021744732},{x:0.16386727848474786,y:-0.004691509079582851},{x:0.1676502279115502,y:-0.0030943422591055763},{x:0.17145454459357354,y:-0.0015487605559735135},{x:0.17171114776702298,y:-0.0013798159141787517},{x:0.17199418118770346,y:-0.0012603187870445023},{x:0.17539285051270065,y:0.001044175742673613},{x:0.17882254028425534,y:0.0033022448933133844},{x:0.17904125343510863,y:0.0035180041069272374},{x:0.17929553571496165,y:0.0036904222114529095},{x:0.18217931598198978,y:0.006613684018010279},{x:0.1851025777885471,y:0.009497464285038375},{x:0.18527499589307275,y:0.009751746564891386},{x:0.18549075510668664,y:0.009970459715744683},{x:0.1877488242573266,y:0.013400149487299715},{x:0.1900533187870445,y:0.016798818812296553},{x:0.19017281591417878,y:0.01708185223297707},{x:0.19034176055597352,y:0.01733845540642648},{x:0.19188734225910553,y:0.02114277208844964},{x:0.19348450907958287,y:0.02492572151525217},{x:0.19354649302174473,y:0.02522662926113043},{x:0.1936621306438814,y:0.025511261341124997},{x:0.30102443002882817,y:0.38829842311817664},{x:0.4083889386148475,y:0.025511027311792445},{x:0.40850451632069196,y:0.025226547135196155},{x:0.40856646677585007,y:0.0249257992040805},{x:0.410163689741502,y:0.021142697708463984},{x:0.41170935302882616,y:0.01733823938560964},{x:0.41187820927072055,y:0.017081773507688556},{x:0.41199764237598097,y:0.016798890297984457},{x:0.41430222163921304,y:0.013400082779514221},{x:0.4165603984391837,y:0.009970270005002412},{x:0.41677604416644776,y:0.009751674265617277},{x:0.4169483701745541,y:0.009497526820430955},{x:0.41987174204670485,y:0.006613627545966159},{x:0.42275565189129766,y:0.0036902661012626486},{x:0.42300979995956794,y:0.0035179410120882958},{x:0.4232283964786704,y:0.003302296075210584},{x:0.4266582174181369,y:0.0010441316765615349},{x:0.4300570332693414,y:-0.001260435297455717},{x:0.43033991691088264,y:-0.001379867379883588},{x:0.4305963833993421,y:-0.0015487226944633017},{x:0.43440084731088763,y:-0.0030943722258508074},{x:0.43818395458161874,y:-0.004691581512785238},{x:0.43848470273672896,y:-0.004753530880516994},{x:0.4387691833312223,y:-0.0048691075577547704},{x:0.44280208680029426,y:-0.005642843777199688},{x:0.4468241027997286,y:-0.0064713155198797695},{x:0.44713115788546864,y:-0.006473401493455157},{x:0.44743272015628793,y:-0.006531257986460835},{x:0.45153908096424766,y:-0.006503346644966049},{x:0.45564544187310013,y:-0.00653124313893301},{x:0.4559470039347234,y:-0.006473385555557348},{x:0.4562540590129192,y:-0.0064712984717510205},{x:0.4602760720167908,y:-0.005642812186517322},{x:0.4643089726882076,y:-0.004869061385152536},{x:0.46459345286480397,y:-0.004753483679308031},{x:0.46489420079591953,y:-0.0046915332241499325},{x:0.46867730229153426,y:-0.003094310258498727},{x:0.4724817606143904,y:-0.0015486469711738574},{x:0.4727382264923116,y:-0.0013797907292793573},{x:0.47302110970201555,y:-0.0012603576240190345},{x:0.4764199172204845,y:0.0010442216392121837},{x:0.47984972999499764,y:0.0033023984391836667},{x:0.4800683257343829,y:0.003518044166447842},{x:0.48032247317956905,y:0.003690370174554085},{x:0.483206372454032,y:0.0066137420467029156},{x:0.48612973389873737,y:0.009497651891297622},{x:0.4863020589879118,y:0.009751799959568049},{x:0.48651770392478944,y:0.009970396478670394},{x:0.4887758683234383,y:0.01340021741813658},{x:0.49108043529745576,y:0.016799033269341422},{x:0.49119986737988364,y:0.017081916910882677},{x:0.4913687226944633,y:0.017338383399342037},{x:0.4929143722258502,y:0.021142847310886045},{x:0.4945115815127853,y:0.024925954581618698},{x:0.4945735308805171,y:0.025226702736729056},{x:0.4946891075577548,y:0.025511183331222268},{x:0.6452021075577549,y:0.5341051833312223},{x:0.6468642579864609,y:0.542768720156288},{x:0.646804298471751,y:0.5515900590129192},{x:0.64502453322415,y:0.5602302007959196},{x:0.641593357624019,y:0.5683571097020156},{x:0.636642629825446,y:0.5756584731795691},{x:0.6303626035213297,y:0.5818537039247894},{x:0.622994616600658,y:0.5867047226944633},{x:0.6148218166687778,y:0.5900251075577548},{x:0.6061582798437121,y:0.5916872579864608},{x:0.5973369409870808,y:0.591627298471751},{x:0.5886967992040805,y:0.58984753322415},{x:0.5805698902979844,y:0.5864163576240191},{x:0.573268526820431,y:0.5814656298254459},{x:0.5670732960752106,y:0.5751856035213296},{x:0.5622222773055368,y:0.567817616600658},{x:0.5589018924422452,y:0.5596448166687777},{x:0.4515387133151436,y:0.1968570925189096},{x:0.34417406138515255,y:0.5596449726882076},{x:0.3440584683142858,y:0.559929490683899},{x:0.34399650907958285,y:0.5602302784847478},{x:0.3423992950207163,y:0.5640133397974443},{x:0.3408536469711739,y:0.5678177606143904},{x:0.3406847682813525,y:0.5680742605871558},{x:0.34056531878704455,y:0.5683571811877035},{x:0.33826075609875456,y:0.5717559510329858},{x:0.33600260156081635,y:0.5751857299949976},{x:0.33578692716538155,y:0.5754043547947312},{x:0.3356145777885471,y:0.5756585357149616},{x:0.33269122952253233,y:0.5785424012737268},{x:0.32980734810870244,y:0.5814657338987373},{x:0.3295531662537196,y:0.581638081896991},{x:0.3293345402842553,y:0.5818537551066867},{x:0.3259047490749403,y:0.5841118910428063},{x:0.32250596673065857,y:0.5864164352974557},{x:0.322223045482268,y:0.5865358832573104},{x:0.32196654459357354,y:0.5867047605559735},{x:0.318162115393689,y:0.5882503879717952},{x:0.31437904541838135,y:0.5898475815127853},{x:0.31407825728149374,y:0.5899095391161314},{x:0.313793738658875,y:0.5900251306438814},{x:0.30976087354902626,y:0.5907988519446131},{x:0.3057388972002714,y:0.5916273155198798},{x:0.3054318012943039,y:0.5916294017707667},{x:0.3051301988288679,y:0.5916872654100169},{x:0.30102387855356455,y:0.5916593469199811},{x:0.29691755812689985,y:0.5916872431389331},{x:0.2966159559752979,y:0.5916293778639092},{x:0.2963088600806502,y:0.5916272899474536},{x:0.29228688822522214,y:0.5907988045585649},{x:0.28825402731179245,y:0.5900250613851525},{x:0.2879695093161011,y:0.5899094683142858},{x:0.2876687215152522,y:0.5898475090795828},{x:0.2838856602025565,y:0.5882502950207166},{x:0.28008123938560964,y:0.5867046469711739},{x:0.27982473941284386,y:0.5865357682813523},{x:0.27954181881229656,y:0.5864163187870445},{x:0.276143048967013,y:0.5841117560987538},{x:0.2727132700050024,y:0.5818536015608163},{x:0.2724946452052691,y:0.5816379271653819},{x:0.27224046428503834,y:0.5814655777885471},{x:0.2693565987262721,y:0.5785422295225312},{x:0.2664332661012626,y:0.5756583481087024},{x:0.2662609181030087,y:0.5754041662537193},{x:0.2660452448933134,y:0.5751855402842553},{x:0.26378710895719626,y:0.5717557490749442},{x:0.2614825647025443,y:0.5683569667306586},{x:0.2613631167426894,y:0.5680740454822678},{x:0.2611942394440265,y:0.5678175445935736},{x:0.2596486120282045,y:0.5640131153936881},{x:0.2580514184872148,y:0.5602300454183813},{x:0.25798946088386876,y:0.5599292572814941},{x:0.2578738693561186,y:0.559644738658875},{x:0.150512,y:0.196859029989096},{x:0.0431501306438814,y:0.559644738658875},{x:0.039829760555973516,y:0.5678175445935736},{x:0.034978755106686646,y:0.5751855402842553},{x:0.028783535714961644,y:0.5814655777885471},{x:0.021482181187703456,y:0.5864163187870445},{x:0.01335527848474783,y:0.5898475090795828},{x:0.0047151399193498065,y:0.5916272899474536},{x:-0.004106198828867862,y:0.5916872654100169},{x:-0.01276973865887501,y:0.5900251306438814},{x:-0.020942544593573535,y:0.5867047605559735},{x:-0.028310540284255312,y:0.5818537551066867},{x:-0.034590577788547086,y:0.5756585357149616},{x:-0.03954131878704451,y:0.5683571811877035},{x:-0.04297250907958286,y:0.5602302784847478},{x:-0.04475228994745356,y:0.5515901399193498},{x:-0.04481226541001698,y:0.5427688011711321}]],x:[[{x:-0.007882248997940308,y:0.03911618267902263},{x:-0.007180671607209664,y:0.030322582532795114},{x:-0.0047770285451087455,y:0.021834819906700376},{x:-0.0007636904665355299,y:0.013979074758467071},{x:0.004705112296856322,y:0.007057238968589209},{x:0.011419216721809594,y:0.001335314804661543},{x:0.019120603540586492,y:-0.0029668073965882433},{x:0.02751331277672888,y:-0.0056837994916240225},{x:0.036274817320977384,y:-0.006711248997940296},{x:0.04506841746720488,y:-0.006009671607209652},{x:0.05355618009329963,y:-0.003606028545108733},{x:0.061411925241532925,y:0.0004073095334644686},{x:0.0683337610314108,y:0.005876112296856327},{x:0.3010265,y:0.23008742701759316},{x:0.5337192389685892,y:0.005876112296856327},{x:0.540641074758467,y:0.0004073095334644686},{x:0.5484968199067003,y:-0.003606028545108733},{x:0.556984582532795,y:-0.006009671607209652},{x:0.5657781826790226,y:-0.006711248997940296},{x:0.5745396872232711,y:-0.0056837994916240225},{x:0.5829323964594135,y:-0.0029668073965882433},{x:0.5906337832781904,y:0.001335314804661536},{x:0.5973478877031436,y:0.007057238968589213},{x:0.6028166904665355,y:0.013979074758467089},{x:0.6068300285451087,y:0.021834819906700383},{x:0.6092336716072096,y:0.030322582532795128},{x:0.6099352489979403,y:0.03911618267902263},{x:0.608907799491624,y:0.047877687223271126},{x:0.6061908073965883,y:0.05627039645941352},{x:0.6018886851953384,y:0.0639717832781904},{x:0.5961667610314108,y:0.07068588770314368},{x:0.36588095484811606,y:0.292578},{x:0.5961667610314108,y:0.5144701122968564},{x:0.6018886851953384,y:0.5211842167218096},{x:0.6061908073965883,y:0.5288856035405864},{x:0.608907799491624,y:0.5372783127767289},{x:0.6099352489979403,y:0.5460398173209774},{x:0.6092336716072096,y:0.5548334174672048},{x:0.6068300285451087,y:0.5633211800932996},{x:0.6028166904665355,y:0.571176925241533},{x:0.5973478877031436,y:0.5780987610314108},{x:0.5906337832781904,y:0.5838206851953385},{x:0.5829323964594135,y:0.5881228073965883},{x:0.5745396872232711,y:0.590839799491624},{x:0.5657781826790226,y:0.5918672489979403},{x:0.556984582532795,y:0.5911656716072097},{x:0.5484968199067003,y:0.5887620285451087},{x:0.540641074758467,y:0.5847486904665355},{x:0.5337192389685892,y:0.5792798877031436},{x:0.3010265,y:0.35506857298240685},{x:0.0683337610314108,y:0.5792798877031436},{x:0.06141192524153289,y:0.5847486904665355},{x:0.05355618009329961,y:0.5887620285451087},{x:0.0450684174672049,y:0.5911656716072097},{x:0.03627481732097735,y:0.5918672489979403},{x:0.02751331277672888,y:0.590839799491624},{x:0.01912060354058648,y:0.5881228073965883},{x:0.011419216721809584,y:0.5838206851953385},{x:0.004705112296856315,y:0.5780987610314108},{x:-0.0007636904665355368,y:0.571176925241533},{x:-0.004777028545108752,y:0.5633211800932996},{x:-0.007180671607209664,y:0.5548334174672048},{x:-0.007882248997940308,y:0.5460398173209774},{x:-0.006854799491624035,y:0.5372783127767289},{x:-0.004137807396588256,y:0.5288856035405864},{x:0.0001643148046615306,y:0.5211842167218096},{x:0.005886238968589197,y:0.5144701122968564},{x:0.23617204515188386,y:0.292578},{x:0.005886238968589197,y:0.07068588770314368},{x:0.00016431480466150977,y:0.0639717832781904},{x:-0.004137807396588256,y:0.05627039645941351},{x:-0.006854799491624035,y:0.047877687223271126},{x:-0.007882248997940308,y:0.03911618267902263}]],y:[[{x:-0.00007800000000000168,y:-0.15516599999999992},{x:0.0007866623818546317,y:-0.16394506449072568},{x:0.003347421036992093,y:-0.17238675445642895},{x:0.007505867446385456,y:-0.180166660485882},{x:0.013102194846605353,y:-0.18698580515339455},{x:0.0199213395141179,y:-0.19258213255361445},{x:0.02770124554357093,y:-0.1967405789630078},{x:0.03614293550927421,y:-0.19930133761814528},{x:0.044922,y:-0.2001659999999999},{x:0.084618,y:-0.2001659999999999},{x:0.08470326921416556,y:-0.20015760171543356},{x:0.08478856964894584,y:-0.200165676732115},{x:0.08909199801123496,y:-0.19972534965725622},{x:0.09339706449072577,y:-0.19930133761814528},{x:0.0934790568568106,y:-0.19927646550581232},{x:0.09356429362525961,y:-0.1992677440740231},{x:0.09769912926743524,y:-0.1979963205354665},{x:0.10183875445642904,y:-0.1967405789630078},{x:0.1019143190537861,y:-0.19670018884423682},{x:0.10199621655469396,y:-0.19667500612370953},{x:0.18074721655469395,y:-0.16370500612370958},{x:0.18295470197399702,y:-0.16251430076809983},{x:0.18525522528778574,y:-0.16151511930158513},{x:0.18682754729843723,y:-0.16042530954354395},{x:0.18851130436774752,y:-0.15951710034658062},{x:0.19044407848245243,y:-0.15791861501920362},{x:0.19250546725178602,y:-0.1564898227103016},{x:0.27125546725178606,y:-0.08958282271030155},{x:0.27347158712358693,y:-0.0872898341236823},{x:0.27580944257935097,y:-0.08512109812948883},{x:0.27653091968085064,y:-0.08412438503144627},{x:0.2773860111192193,y:-0.08323963374445845},{x:0.2791122089873479,y:-0.0805583607511536},{x:0.2809820438025964,y:-0.07797520343727593},{x:0.35909504380259644,y:0.055837796562724036},{x:0.35921507445013207,y:0.05609937330868571},{x:0.35938084670619436,y:0.05633463764830328},{x:0.359814044874128,y:0.05731131476590327},{x:0.3603874218559792,y:0.0582128676935936},{x:0.5972854218559792,y:0.5265638676935935},{x:0.6004763520268956,y:0.5347880745861305},{x:0.6020015061983327,y:0.5434767752438966},{x:0.6018022735507984,y:0.5522960677732933},{x:0.5998863104832066,y:0.5609070317083322},{x:0.5963272463817603,y:0.568978752534074},{x:0.591261854083932,y:0.5762010385458585},{x:0.5848847937750224,y:0.5822963413425576},{x:0.5774411323064065,y:0.5870304218559792},{x:0.5692169254138695,y:0.5902213520268956},{x:0.5605282247561034,y:0.5917465061983327},{x:0.5517089322267067,y:0.5915472735507984},{x:0.5430979682916678,y:0.5896313104832066},{x:0.5350262474659261,y:0.5860722463817603},{x:0.5278039614541415,y:0.5810068540839319},{x:0.5217086586574424,y:0.5746297937750224},{x:0.5169745781440208,y:0.5671861323064065},{x:0.3203411783046204,y:0.17843886787959407},{x:0.12481771439881506,y:0.5670983271806026},{x:0.12009991274687032,y:0.5745523168465348},{x:0.11401856108654926,y:0.5809426827476728},{x:0.10680736235169674,y:0.5860238467061943},{x:0.09874343886560628,y:0.5896005424407229},{x:0.09013668268554793,y:0.5915353195400148},{x:0.08131784662479694,y:0.5917538256051798},{x:0.0726258336075076,y:0.5902476635706729},{x:0.06439467281939737,y:0.5870747143988151},{x:0.05694068315346515,y:0.5823569127468703},{x:0.05055031725232718,y:0.5762755610865493},{x:0.04546915329380567,y:0.5690643623516968},{x:0.041892457559277035,y:0.5610004388656062},{x:0.039957680459985136,y:0.5523936826855479},{x:0.039739174394820276,y:0.5435748466247969},{x:0.0412453364293271,y:0.5348828336075077},{x:0.04441828560118493,y:0.5266516728193974},{x:0.26905653043412125,y:0.0801181620528446},{x:0.20712852539925722,y:-0.025968816269973185},{x:0.1395520619925953,y:-0.08338263769409424},{x:0.07557825049874085,y:-0.11016599999999992},{x:0.044922,y:-0.11016599999999992},{x:0.03614293550927422,y:-0.11103066238185455},{x:0.02770124554357096,y:-0.11359142103699202},{x:0.01992133951411791,y:-0.11774986744638538},{x:0.01310219484660536,y:-0.12334619484660528},{x:0.007505867446385456,y:-0.13016533951411782},{x:0.003347421036992093,y:-0.13794524554357088},{x:0.0007866623818546317,y:-0.14638693550927412},{x:-0.00007800000000000168,y:-0.15516599999999992}]],z:[[{x:0.051680000000000004,y:0.038348999999999966},{x:0.05192127447228559,y:0.035899299172703986},{x:0.05194879067317478,y:0.033437899088824954},{x:0.05235257576103353,y:0.03152022369965088},{x:0.05254466238185464,y:0.029569935509274177},{x:0.053259213756049764,y:0.02721437531096308},{x:0.05376639657582897,y:0.024805638484003446},{x:0.054536542955643516,y:0.023003585252525667},{x:0.0551054210369921,y:0.02112824554357092},{x:0.05626578950451143,y:0.018957348831652537},{x:0.05723314819184797,y:0.01669384166703705},{x:0.05834005957014514,y:0.015076662488338128},{x:0.05926386744638546,y:0.01334833951411787},{x:0.060825460697764414,y:0.011445532631778232},{x:0.062215820200804926,y:0.009414240440453706},{x:0.0636169585940798,y:0.00804408260344652},{x:0.06486019484660537,y:0.0065291948466053296},{x:0.06676300172894496,y:0.004967601595226417},{x:0.06852293131171022,y:0.0032465857969436324},{x:0.07016445175727676,y:0.0021761036989109733},{x:0.07167933951411792,y:0.0009328674463854256},{x:0.07385023622603624,y:-0.00022750102113387976},{x:0.07591210278164046,y:-0.0015721027544036703},{x:0.07773092256935071,y:-0.0023017710867676167},{x:0.07945924554357096,y:-0.003225578963007937},{x:0.08181480574188199,y:-0.003940130337203038},{x:0.08409937289490133,y:-0.004856645714911602},{x:0.08602559580031956,y:-0.00521745953679684},{x:0.08790093550927423,y:-0.0057863376181453985},{x:0.09035063633657014,y:-0.00602761209043098},{x:0.09277010945251417,y:-0.006480819940600742},{x:0.09472971180962335,y:-0.006458913379178931},{x:0.09668,y:-0.006651000000000032},{x:0.505373,y:-0.006651000000000032},{x:0.5141520644907257,y:-0.0057863376181453985},{x:0.522593754456429,y:-0.003225578963007937},{x:0.5303736604858821,y:0.0009328674463854256},{x:0.5371928051533946,y:0.0065291948466053296},{x:0.5427891325536145,y:0.013348339514117874},{x:0.5469475789630078,y:0.021128245543570928},{x:0.5495083376181453,y:0.029569935509274198},{x:0.550373,y:0.038348999999999966},{x:0.5495083376181453,y:0.047128064490725735},{x:0.5469475789630078,y:0.055569754456429005},{x:0.5427891325536145,y:0.06334966048588206},{x:0.5371928051533946,y:0.0701688051533946},{x:0.5303736604858821,y:0.0757651325536145},{x:0.522593754456429,y:0.07992357896300786},{x:0.5141520644907257,y:0.08248433761814533},{x:0.505373,y:0.08334899999999996},{x:0.190464663126857,y:0.08334899999999996},{x:0.5404754142030563,y:0.5196949313117102},{x:0.5415458963010891,y:0.5213364517572769},{x:0.5427891325536145,y:0.5228513395141179},{x:0.5439495010211337,y:0.525022236226036},{x:0.5452941027544036,y:0.5270841027816404},{x:0.5460237710867677,y:0.5289029225693511},{x:0.5469475789630078,y:0.530631245543571},{x:0.5476621303372028,y:0.5329868057418816},{x:0.5485786457149116,y:0.5352713728949013},{x:0.5489394595367969,y:0.53719759580032},{x:0.5495083376181453,y:0.5390729355092743},{x:0.5497496120904308,y:0.5415226363365697},{x:0.5502028199406007,y:0.5439421094525142},{x:0.5501809133791788,y:0.5459017118096235},{x:0.550373,y:0.547852},{x:0.5501317255277144,y:0.5503017008272966},{x:0.5501042093268251,y:0.552763100911175},{x:0.5497004242389665,y:0.5546807763003486},{x:0.5495083376181453,y:0.5566310644907257},{x:0.5487937862439503,y:0.5589866246890365},{x:0.548286603424171,y:0.5613953615159966},{x:0.5475164570443563,y:0.5631974147474748},{x:0.5469475789630078,y:0.565072754456429},{x:0.5457872104954887,y:0.567243651168347},{x:0.544819851808152,y:0.569507158332963},{x:0.5437129404298549,y:0.5711243375116617},{x:0.5427891325536145,y:0.5728526604858821},{x:0.5412275393022352,y:0.5747554673682221},{x:0.539837179799195,y:0.5767867595595463},{x:0.5384360414059206,y:0.578156917396553},{x:0.5371928051533946,y:0.5796718051533947},{x:0.5352899982710546,y:0.5812333984047738},{x:0.5335300686882897,y:0.5829544142030564},{x:0.5318885482427235,y:0.5840248963010888},{x:0.5303736604858821,y:0.5852681325536145},{x:0.5282027637739638,y:0.5864285010211338},{x:0.5261408972183595,y:0.5877731027544036},{x:0.5243220774306487,y:0.5885027710867679},{x:0.522593754456429,y:0.5894265789630079},{x:0.5202381942581186,y:0.5901411303372028},{x:0.5179536271050986,y:0.5910576457149116},{x:0.5160274041996802,y:0.5914184595367968},{x:0.5141520644907257,y:0.5919873376181454},{x:0.5117023636634302,y:0.5922286120904309},{x:0.5092828905474858,y:0.5926818199406008},{x:0.5073232881903766,y:0.5926599133791789},{x:0.505373,y:0.592852},{x:0.09668,y:0.592852},{x:0.08790093550927423,y:0.5919873376181454},{x:0.07945924554357094,y:0.5894265789630079},{x:0.07167933951411792,y:0.5852681325536145},{x:0.06486019484660537,y:0.5796718051533947},{x:0.05926386744638546,y:0.5728526604858821},{x:0.0551054210369921,y:0.565072754456429},{x:0.05254466238185464,y:0.5566310644907257},{x:0.051680000000000004,y:0.547852},{x:0.05254466238185464,y:0.5390729355092743},{x:0.0551054210369921,y:0.530631245543571},{x:0.05926386744638546,y:0.5228513395141179},{x:0.06486019484660537,y:0.5160321948466053},{x:0.07167933951411792,y:0.5104358674463855},{x:0.07945924554357096,y:0.5062774210369921},{x:0.08790093550927423,y:0.5037166623818546},{x:0.09668,y:0.502852},{x:0.41158833687314295,y:0.502852},{x:0.06157758579694366,y:0.06650606868828973},{x:0.06050710369891106,y:0.06486454824272328},{x:0.05926386744638546,y:0.06334966048588206},{x:0.05810349897886612,y:0.06117876377396365},{x:0.05675889724559635,y:0.059116897218359485},{x:0.05602922891323242,y:0.05729807743064926},{x:0.0551054210369921,y:0.055569754456429005},{x:0.054390869662797,y:0.05321419425811798},{x:0.053474354285088434,y:0.050929627105098636},{x:0.0531135404632032,y:0.04900340419968042},{x:0.05254466238185464,y:0.047128064490725735},{x:0.05230338790956906,y:0.04467836366342984},{x:0.051850180059399294,y:0.04225889054748581},{x:0.05187208662082111,y:0.04029928819037662},{x:0.051680000000000004,y:0.038348999999999966}]]};var Ajn=dTi;var Ojn=at(As(),1),Eut=at(As(),1),Vjn=at(As(),1),_te=at(As(),1),Mut=at(As(),1),Ujn=at(As(),1),Wjn=at(As(),1),Xjn=at(As(),1),wut=at(As(),1),oC=at(As(),1),z1=at(As(),1),XG=at(As(),1),But=at(As(),1),Tut=at(As(),1),IDi=at(As(),1),Dut=at(As(),1),tKn=at(As(),1),pMe=at(As(),1),Nut=at(As(),1),mMe=at(As(),1),gte=at(As(),1),Vv=at(As(),1),O1=at(As(),1),hE=at(As(),1);er();var cKn=at(As(),1);function dMe(e){let{ctx:t,points:n,fill:o,stroke:r,strokeWidth:i=1,minStrokePx:s,realToCanvasMat:a,closePath:c=!1}=e;if(n.length<2)return;t.beginPath();let l=n.map((_)=>Ljn.applyToPoint(a,[_.x,_.y])),h=l[0];if(!h)return;let[d,u]=h;t.moveTo(d,u);for(let _=1;_<l.length;_++){let p=l[_];if(!p)continue;let[m,A]=p;t.lineTo(m,A)}if(c)t.closePath();if(o)t.fillStyle=o,t.fill();if(r){let _=i*Math.abs(a.a),p=s===void 0?_:Math.max(_,s);t.strokeStyle=r,t.lineWidth=p,t.stroke()}}function Tp(e){let{ctx:t,center:n,width:o,height:r,fill:i,realToCanvasMat:s,borderRadius:a=0,ccwRotationDegrees:c=0,stroke:l,strokeWidth:h,isStrokeDashed:d=!1,lineJoin:u}=e,[_,p]=Hjn.applyToPoint(s,[n.x,n.y]),m=o*Math.abs(s.a),A=r*Math.abs(s.a),g=a*Math.abs(s.a),f=h?h*Math.abs(s.a):void 0;if(t.save(),t.translate(_,p),c!==0)t.rotate(-c*(Math.PI/180));if(t.beginPath(),g>0){let y=-m/2,x=-A/2,C=Math.min(g,m/2,A/2);t.moveTo(y+C,x),t.lineTo(y+m-C,x),t.arcTo(y+m,x,y+m,x+C,C),t.lineTo(y+m,x+A-C),t.arcTo(y+m,x+A,y+m-C,x+A,C),t.lineTo(y+C,x+A),t.arcTo(y,x+A,y,x+A-C,C),t.lineTo(y,x+C),t.arcTo(y,x,y+C,x,C)}else t.rect(-m/2,-A/2,m,A);if(i)t.fillStyle=i,t.fill();if(l&&f){if(d)t.setLineDash([f*3,f*2]);else t.setLineDash([]);if(u)t.lineJoin=u;t.strokeStyle=l,t.lineWidth=f,t.stroke()}t.restore()}function uTi(e){let{ctx:t,board:n,realToCanvasMat:o,colorMap:r,drawBoardMaterial:i,minBoardOutlineStrokePx:s}=e,{width:a,height:c,center:l,outline:h}=n;if(h&&Array.isArray(h)&&h.length>=3){if(i)dMe({ctx:t,points:h.map((d)=>({x:d.x,y:d.y})),fill:r.substrate,realToCanvasMat:o,closePath:!0});dMe({ctx:t,points:h.map((d)=>({x:d.x,y:d.y})),stroke:r.boardOutline,strokeWidth:0.1,realToCanvasMat:o,closePath:!0,minStrokePx:s});return}if(a!==void 0&&c!==void 0&&l){if(i)Tp({ctx:t,center:l,width:a,height:c,fill:r.substrate,realToCanvasMat:o});let d=a/2,u=c/2,_=[{x:l.x-d,y:l.y-u},{x:l.x+d,y:l.y-u},{x:l.x+d,y:l.y+u},{x:l.x-d,y:l.y+u}];dMe({ctx:t,points:_,stroke:r.boardOutline,strokeWidth:0.1,realToCanvasMat:o,closePath:!0,minStrokePx:s})}}function pTi({startX:e,startY:t,endX:n,endY:o,bulge:r}){if(Math.abs(r)<0.0000000001)return null;let i=n-e,s=o-t,a=Math.hypot(i,s);if(a<0.0000000001)return null;let c=Math.abs(r)*(a/2),l=a/2,h=(c*c+l*l)/(2*c),d=h-c,u=(e+n)/2,_=(t+o)/2,p=-s/a,m=i/a,A=r>0?-1:1;return{centerX:u+A*p*d,centerY:_+A*m*d,radius:h}}function Cut({ctx:e,realStartX:t,realStartY:n,realEndX:o,realEndY:r,bulge:i,realToCanvasMat:s}){if(Math.abs(i)<0.0000000001){let[x,C]=XL.applyToPoint(s,[o,r]);e.lineTo(x,C);return}let a=pTi({startX:t,startY:n,endX:o,endY:r,bulge:i});if(!a){let[x,C]=XL.applyToPoint(s,[o,r]);e.lineTo(x,C);return}let[c,l]=XL.applyToPoint(s,[t,n]),[h,d]=XL.applyToPoint(s,[o,r]),[u,_]=XL.applyToPoint(s,[a.centerX,a.centerY]),p=Math.hypot(c-u,l-_),m=Math.atan2(l-_,c-u),A=Math.atan2(d-_,h-u),f=s.a*s.d-s.b*s.c<0,y=i>0?!f:f;e.arc(u,_,p,m,A,y)}function fjn({ctx:e,ring:t,realToCanvasMat:n}){if(t.vertices.length<2)return;if(t.vertices.length===2){let[s,a]=t.vertices;if(s&&a&&Math.abs((s.bulge??0)-1)<0.0000000001&&Math.abs((a.bulge??0)-1)<0.0000000001){let[c,l]=XL.applyToPoint(n,[s.x,s.y]);e.moveTo(c,l),Cut({ctx:e,realStartX:s.x,realStartY:s.y,realEndX:a.x,realEndY:a.y,bulge:1,realToCanvasMat:n}),Cut({ctx:e,realStartX:a.x,realStartY:a.y,realEndX:s.x,realEndY:s.y,bulge:1,realToCanvasMat:n});return}}let o=t.vertices[0];if(!o)return;let[r,i]=XL.applyToPoint(n,[o.x,o.y]);e.moveTo(r,i);for(let s=0;s<t.vertices.length;s++){let a=t.vertices[s],c=t.vertices[(s+1)%t.vertices.length];if(!a||!c)continue;Cut({ctx:e,realStartX:a.x,realStartY:a.y,realEndX:c.x,realEndY:c.y,bulge:a.bulge??0,realToCanvasMat:n})}}function Fjn({ctx:e,shape:t,realToCanvasMat:n}){fjn({ctx:e,ring:t.outer_ring,realToCanvasMat:n});for(let o of t.inner_rings??[])fjn({ctx:e,ring:o,realToCanvasMat:n})}function mTi(e,t){return t.copper[e]??t.copper.top}function Rut(e){let{ctx:t,pour:n,realToCanvasMat:o}=e;if(n.shape==="rect"){let r=n.width/2,i=n.height/2,s=(n.rotation??0)*Math.PI/180,a=Math.cos(s),c=Math.sin(s),l=[{x:-r,y:-i},{x:r,y:-i},{x:r,y:i},{x:-r,y:i}].map((d)=>uMe.applyToPoint(o,[n.center.x+d.x*a-d.y*c,n.center.y+d.x*c+d.y*a])),h=l[0];if(!h)return;t.moveTo(h[0],h[1]);for(let d=1;d<l.length;d++){let u=l[d];if(u)t.lineTo(u[0],u[1])}t.closePath();return}if(n.shape==="polygon"){let r=n.points[0];if(!r)return;let[i,s]=uMe.applyToPoint(o,[r.x,r.y]);t.moveTo(i,s);for(let a=1;a<n.points.length;a++){let c=n.points[a];if(!c)continue;let[l,h]=uMe.applyToPoint(o,[c.x,c.y]);t.lineTo(l,h)}t.closePath();return}if(n.shape!=="brep")return;Fjn({ctx:t,shape:n.brep_shape,realToCanvasMat:o})}function Qut(e){let{ctx:t,pour:n,realToCanvasMat:o,colorMap:r}=e,i=mTi(n.layer,r),s=0.5;t.save(),t.globalAlpha=0.5,t.beginPath(),Rut({ctx:t,pour:n,realToCanvasMat:o}),t.fillStyle=i,t.fill(n.shape==="brep"?"evenodd":"nonzero"),t.restore()}function _Ti(e,t){if(t.length<3)return;let n=t[0];if(!n)return;e.moveTo(n.x,n.y);for(let o=1;o<t.length;o++){let r=t[o];if(!r)continue;e.lineTo(r.x,r.y)}e.closePath()}var gTi=(e)=>Oj[e]??(e===" "?A3.spaceWidthRatio:A3.glyphWidthRatio);function kut(e,t,n){let o=gTi(e),r=t?A3.letterSpacingRatio:0,i=t?M2e[e]?.[t]??0:0;return n*(o+r+i)}function ATi(e,t){let n=t*A3.glyphWidthRatio,o=t*A3.letterSpacingRatio,r=t*A3.spaceWidthRatio,i=t*A3.strokeWidthRatio,s=t*A3.lineHeightRatio,a=e.replace(/\\n/g,`
`).split(`
`),c=a.map((d)=>{let u=Array.from(d);return u.reduce((_,p,m)=>_+kut(p,u[m+1],t),0)}),l=c.reduce((d,u)=>Math.max(d,u),0),h=a.length>1?t+(a.length-1)*s:t;return{width:l,height:h,glyphWidth:n,letterSpacing:o,spaceWidth:r,strokeWidth:i,lineHeight:s,lines:a,lineWidths:c}}function fTi(e){let{line:t,fontSize:n,startX:o,startY:r}=e,i=n,s=n,a=Array.from(t),c=[],l=o+e.layout.strokeWidth/2;return a.forEach((h,d)=>{let u=Ajn[h];if(u?.length){let _=[];for(let p of u){let m=p.map((A)=>({x:l+A.x*s,y:r+(1-A.y)*i}));if(m.length>=3)_.push(m)}if(_.length>0)c.push(_)}l+=kut(h,a[d+1],n)}),c}function yTi(e){let{POSITIVE_INFINITY:t,POSITIVE_INFINITY:n,NEGATIVE_INFINITY:o,NEGATIVE_INFINITY:r}=Number;for(let i of e)for(let s of i)t=Math.min(t,s.x),n=Math.min(n,s.y),o=Math.max(o,s.x),r=Math.max(r,s.y);if(t===Number.POSITIVE_INFINITY||n===Number.POSITIVE_INFINITY||o===Number.NEGATIVE_INFINITY||r===Number.NEGATIVE_INFINITY)return null;return{minX:t,minY:n,maxX:o,maxY:r}}function xTi(e,t,n){let o=bTi(e,t),r=ITi(o,t,n),i=yTi(r.flat()),s=vTi(e,t,i);return{bounds:i?MTi(i,s):null,glyphGroups:ETi(r,s),linePlacements:o.map(({line:a,startX:c,startY:l})=>({line:a,startX:c+s.x,startY:l+s.y})),startOffset:s}}function CTi(e,t){let n=t.width+t.strokeWidth,o=t.height+t.strokeWidth,r=0,i=0;if(e==="center"||e==="top_center"||e==="bottom_center")r=-n/2;else if(e==="top_left"||e==="bottom_left"||e==="center_left")r=0;else if(e==="top_right"||e==="bottom_right"||e==="center_right")r=-n;else if(e==="top_center"||e==="bottom_center")r=-n/2;if(e==="center"||e==="center_left"||e==="center_right")i=-o/2;else if(e==="top_left"||e==="top_right"||e==="top_center")i=0;else if(e==="bottom_left"||e==="bottom_right"||e==="bottom_center")i=-o;return{x:r,y:i}}function bTi(e,t){return t.lines.map((n,o)=>({line:n,startX:wTi({alignment:e,lineWidth:t.lineWidths[o],maxWidth:t.width,strokeWidth:t.strokeWidth}),startY:o*t.lineHeight}))}function ITi(e,t,n){return e.flatMap(({line:o,startX:r,startY:i})=>fTi({line:o,fontSize:n,startX:r,startY:i,layout:t}))}function vTi(e,t,n){if(!n)return CTi(e,t);return{x:-STi(e,n),y:-PTi(e,n)}}function STi(e,t){if(e==="top_left"||e==="bottom_left"||e==="center_left")return t.minX;if(e==="top_right"||e==="bottom_right"||e==="center_right")return t.maxX;return(t.minX+t.maxX)/2}function PTi(e,t){if(e==="top_left"||e==="top_right"||e==="top_center")return t.minY;if(e==="bottom_left"||e==="bottom_right"||e==="bottom_center")return t.maxY;return(t.minY+t.maxY)/2}function ETi(e,t){if(t.x===0&&t.y===0)return e;return e.map((n)=>n.map((o)=>o.map((r)=>({x:r.x+t.x,y:r.y+t.y}))))}function MTi(e,t){return{minX:e.minX+t.x,minY:e.minY+t.y,maxX:e.maxX+t.x,maxY:e.maxY+t.y}}function wTi(e){let{alignment:t,lineWidth:n,maxWidth:o,strokeWidth:r}=e,i=n+r,s=o+r;if(t==="top_left"||t==="bottom_left"||t==="center_left")return 0;if(t==="top_right"||t==="bottom_right"||t==="center_right")return s-i;return(s-i)/2}var BTi=(e)=>E2e[e];function TTi(e){let{ctx:t,line:n,fontSize:o,startX:r,startY:i,layout:s}=e,{strokeWidth:a}=s,c=o,l=o,h=i,d=Array.from(n),u=r+a/2;d.forEach((_,p)=>{let m=BTi(_);if(m?.length){t.beginPath();for(let A of m){let g=u+A.x1*l,f=h+(1-A.y1)*c,y=u+A.x2*l,x=h+(1-A.y2)*c;t.moveTo(g,f),t.lineTo(y,x)}t.stroke()}u+=kut(_,d[p+1],o)})}var DTi={left:0.2,right:0.2,top:0.2,bottom:0.2};function fte(e){let{ctx:t,text:n,x:o,y:r,fontSize:i,color:s,realToCanvasMat:a,anchorAlignment:c,rotation:l=0,mirrorX:h=!1,knockout:d=!1,knockoutPadding:u={}}=e;if(!n)return;let[_,p]=zjn.applyToPoint(a,[o,r]),m=Math.abs(a.a),A=i*m,g=ATi(n,A),f=xTi(c,g,A);if(t.save(),t.translate(_,p),l!==0)t.rotate(-l*(Math.PI/180));if(h)t.scale(-1,1);if(d){let y={...DTi,...u},x=y.left*m,C=y.right*m,b=y.top*m,I=y.bottom*m,v=f.bounds;if(!v){t.restore();return}let P=v.minX-x,M=v.minY-b,B=v.maxX-v.minX+x+C,T=v.maxY-v.minY+b+I;t.fillStyle=s,t.beginPath(),t.rect(P,M,B,T);for(let N of f.glyphGroups)for(let D of N)_Ti(t,D);t.fill("evenodd")}else t.strokeStyle=s;if(t.lineWidth=g.strokeWidth,t.lineCap="round",t.lineJoin="round",!d)f.linePlacements.forEach(({line:y,startX:x,startY:C})=>{TTi({ctx:t,line:y,fontSize:A,startX:x,startY:C,layout:g})});t.restore()}function NTi(e){if(!e)return"center";return e}function RTi(e){let{ctx:t,text:n,realToCanvasMat:o,colorMap:r}=e,i=n.text??"";if(!i)return;fte({ctx:t,text:i,x:n.anchor_position.x,y:n.anchor_position.y,fontSize:n.font_size??1,color:r.copper[n.layer]??r.copper.top,realToCanvasMat:o,anchorAlignment:NTi(n.anchor_alignment),rotation:n.ccw_rotation??0,mirrorX:n.is_mirrored??n.layer==="bottom",knockout:n.is_knockout,knockoutPadding:n.is_knockout?n.knockout_padding:void 0})}function o_(e){let{ctx:t,center:n,radius:o,fill:r,realToCanvasMat:i,stroke:s,strokeWidth:a,isStrokeDashed:c=!1}=e,[l,h]=Ojn.applyToPoint(i,[n.x,n.y]),d=o*Math.abs(i.a),u=a?a*Math.abs(i.a):void 0;if(t.beginPath(),t.arc(l,h,d,0,Math.PI*2),r)t.fillStyle=r,t.fill();if(s&&u){if(c)t.setLineDash([u*3,u*2]);else t.setLineDash([]);t.strokeStyle=s,t.lineWidth=u,t.stroke()}}function QTi(e,t){return e==="bottom"?t.courtyard.bottom:t.courtyard.top}function kTi(e){let{ctx:t,circle:n,realToCanvasMat:o,colorMap:r}=e;o_({ctx:t,center:n.center,radius:n.radius,stroke:QTi(n.layer,r),strokeWidth:0.05,realToCanvasMat:o})}function LTi(e,t){return e==="bottom"?t.courtyard.bottom:t.courtyard.top}function HTi(e){let{ctx:t,outline:n,realToCanvasMat:o,colorMap:r}=e;if(!n.outline||n.outline.length<2)return;t.beginPath();let i=Eut.applyToPoint(o,n.outline[0]);t.moveTo(i.x,i.y);for(let s=1;s<n.outline.length;s++){let a=Eut.applyToPoint(o,n.outline[s]);t.lineTo(a.x,a.y)}t.closePath(),t.lineWidth=0.05*Math.abs(o.a),t.strokeStyle=LTi(n.layer,r),t.lineJoin="round",t.stroke()}function FTi(e,t){return e==="bottom"?t.courtyard.bottom:t.courtyard.top}function zTi(e){let{ctx:t,rect:n,realToCanvasMat:o,colorMap:r}=e;Tp({ctx:t,center:n.center,width:n.width,height:n.height,stroke:FTi(n.layer,r),strokeWidth:0.05,realToCanvasMat:o,ccwRotationDegrees:n.ccw_rotation??0,lineJoin:"round"})}function dE(e){let{ctx:t,points:n,fill:o,realToCanvasMat:r}=e;if(n.length<3)return;t.beginPath();let i=n.map((l)=>Vjn.applyToPoint(r,[l.x,l.y])),s=i[0];if(!s)return;let[a,c]=s;t.moveTo(a,c);for(let l=1;l<i.length;l++){let h=i[l];if(!h)continue;let[d,u]=h;t.lineTo(d,u)}t.closePath(),t.fillStyle=o,t.fill()}function OTi(e){let{ctx:t,cutout:n,realToCanvasMat:o,colorMap:r}=e;if(n.shape==="rect"){Tp({ctx:t,center:n.center,width:n.width,height:n.height,fill:r.drill,realToCanvasMat:o,ccwRotationDegrees:n.rotation??0,borderRadius:n.corner_radius??0});return}if(n.shape==="circle"){o_({ctx:t,center:n.center,radius:n.radius,fill:r.drill,realToCanvasMat:o});return}if(n.shape==="polygon"){if(n.points&&n.points.length>=3)dE({ctx:t,points:n.points,fill:r.drill,realToCanvasMat:o});return}}var Yjn="#ff4d4d",VTi={a:1,b:0,c:0,d:1,e:0,f:0};function YTi(e){let t=Math.min(e.canvas.width,e.canvas.height),n=Math.max(1,Math.min(2,t*0.002)),o=Math.max(10,Math.min(18,t*0.02));return{fontSize:o,strokeWidth:n,dashLength:n*4,labelGap:o*0.35,pointRadius:n*3}}function but({ctx:e,label:t,x:n,y:o,style:r,align:i="left"}){if(!t)return;e.setLineDash([]),fte({ctx:e,text:t,x:n,y:o,fontSize:r.fontSize,color:Yjn,realToCanvasMat:VTi,anchorAlignment:i==="center"?"bottom_center":"bottom_left"})}function GTi({ctx:e,debugObject:t,realToCanvasMat:n,labelStackIndex:o=0}){let r=YTi(e);if(e.save(),e.strokeStyle=Yjn,e.lineWidth=r.strokeWidth,e.setLineDash([r.dashLength,r.dashLength]),t.shape==="rect"){let a=_te.applyToPoint(n,[t.center.x-t.size.width/2,t.center.y-t.size.height/2]),c=_te.applyToPoint(n,[t.center.x+t.size.width/2,t.center.y+t.size.height/2]),l=Math.min(a[0],c[0]),h=Math.min(a[1],c[1]),d=Math.abs(c[0]-a[0]),u=Math.abs(c[1]-a[1]);e.beginPath(),e.rect(l,h,d,u),e.stroke(),but({ctx:e,label:t.label,x:l,y:h-r.labelGap-o*(r.fontSize+r.labelGap),style:r}),e.restore();return}if(t.shape==="line"){let[a,c]=_te.applyToPoint(n,[t.start.x,t.start.y]),[l,h]=_te.applyToPoint(n,[t.end.x,t.end.y]);e.beginPath(),e.moveTo(a,c),e.lineTo(l,h),e.stroke(),but({ctx:e,label:t.label,x:(a+l)/2,y:(c+h)/2-r.labelGap,style:r,align:"center"}),e.restore();return}let[i,s]=_te.applyToPoint(n,[t.center.x,t.center.y]);e.beginPath(),e.arc(i,s,r.pointRadius,0,Math.PI*2),e.stroke(),but({ctx:e,label:t.label,x:i+r.pointRadius+r.labelGap,y:s-r.pointRadius,style:r}),e.restore()}var UTi=1.5,WTi=0.6,XTi=0.3;function Iut(e){let t=Math.hypot(e.x,e.y)||1;return{x:e.x/t,y:e.y/t}}function Gjn(e){let{ctx:t,from:n,to:o,realToCanvasMat:r,color:i,fontSize:s,arrowSize:a=1,strokeWidth:c,text:l,textRotation:h,offset:d}=e,u=Iut({x:o.x-n.x,y:o.y-n.y}),_={x:-u.y,y:u.x},p=d?.direction&&typeof d.direction.x==="number"&&typeof d.direction.y==="number",m=p?Iut(d.direction):{x:0,y:0},A=d?.distance??0,g={x:m.x*A,y:m.y*A},f={x:n.x+g.x,y:n.y+g.y},y={x:o.x+g.x,y:o.y+g.y},x={x:f.x+u.x*a,y:f.y+u.y*a},C={x:y.x-u.x*a,y:y.y-u.y*a},b=Math.abs(r.a),I=c??a/5,v=i||"rgba(255,255,255,0.5)",P=p&&(Math.abs(m.x)>Number.EPSILON||Math.abs(m.y)>Number.EPSILON)?m:_,M=A+0.5,B=[],T=(L)=>{let H={x:L.x+P.x*M,y:L.y+P.y*M},V=I/2,O={x:-P.y,y:P.x};return[{x:L.x+O.x*V,y:L.y+O.y*V},{x:L.x-O.x*V,y:L.y-O.y*V},{x:H.x-O.x*V,y:H.y-O.y*V},{x:H.x+O.x*V,y:H.y+O.y*V}]};B.push(f),B.push({x:x.x+_.x*(a/2),y:x.y+_.y*(a/2)}),B.push({x:x.x+_.x*(I/2),y:x.y+_.y*(I/2)}),B.push({x:C.x+_.x*(I/2),y:C.y+_.y*(I/2)}),B.push({x:C.x+_.x*(a/2),y:C.y+_.y*(a/2)}),B.push(y),B.push({x:C.x-_.x*(a/2),y:C.y-_.y*(a/2)}),B.push({x:C.x-_.x*(I/2),y:C.y-_.y*(I/2)}),B.push({x:x.x-_.x*(I/2),y:x.y-_.y*(I/2)}),B.push({x:x.x-_.x*(a/2),y:x.y-_.y*(a/2)}),B.push(f);let N=B[0],D=(L)=>{let H=T(L);B.push(N),B.push(H[0]),B.push(...H),B.push(H[0]),B.push(N)};if(D(n),D(o),dE({ctx:t,points:B,fill:v,realToCanvasMat:r}),l){let L={x:(n.x+o.x)/2+g.x,y:(n.y+o.y)/2+g.y},[H,V]=Mut.applyToPoint(r,[f.x,f.y]),[O,U]=Mut.applyToPoint(r,[y.x,y.y]),j=Iut({x:O-H,y:U-V}),Y=Math.atan2(j.y,j.x)*180/Math.PI;if(Y>90||Y<-90)Y+=180;let X=typeof h==="number"&&Number.isFinite(h)?Y-h:Y,K=0;if(l&&typeof h==="number"&&Number.isFinite(h)){let se=l.length*s*WTi,ne=s,re=h*Math.PI/180,Z=Math.abs(Math.sin(re)),te=Math.abs(Math.cos(re)),ie=se/2,le=ne/2;K=ie*Z+le*te+s*XTi}let J=a*UTi+K,ee={x:L.x+_.x*J,y:L.y+_.y*J};fte({ctx:t,text:l,x:ee.x,y:ee.y,fontSize:s,color:v,realToCanvasMat:r,anchorAlignment:"center",rotation:-X})}}function jTi(e){let{ctx:t,pcbFabricationNoteDimension:n,realToCanvasMat:o,colorMap:r}=e,i=n.color??r.fabricationNote;Gjn({ctx:t,from:n.from,to:n.to,realToCanvasMat:o,color:i,fontSize:n.font_size??1,arrowSize:n.arrow_size??1,text:n.text,textRotation:n.text_ccw_rotation,offset:n.offset_distance&&n.offset_direction?{distance:n.offset_distance,direction:n.offset_direction}:void 0})}function KTi(e){let{ctx:t,path:n,realToCanvasMat:o,colorMap:r}=e;if(!n.route||n.route.length<2)return;let i=n.route.map((a)=>Ujn.applyToPoint(o,a)),s=n.stroke_width*Math.abs(o.a)/2;if(t.beginPath(),n.is_filled){let c=i.reduce((l,h,d)=>{let u=i[(d+1)%i.length];return l+h.x*u.y-u.x*h.y},0)<0?[...i].reverse():i;t.moveTo(c[0].x,c[0].y);for(let l of c.slice(1))t.lineTo(l.x,l.y);t.closePath()}if(n.has_stroke!==!1&&s>0){let a=n.is_filled?[...i,i[0]]:i;for(let c=1;c<a.length;c++){let l=a[c-1],h=a[c],d=Math.atan2(h.y-l.y,h.x-l.x);t.moveTo(l.x+s*Math.cos(d+Math.PI/2),l.y+s*Math.sin(d+Math.PI/2)),t.arc(l.x,l.y,s,d+Math.PI/2,d+3*Math.PI/2),t.lineTo(h.x+s*Math.cos(d-Math.PI/2),h.y+s*Math.sin(d-Math.PI/2)),t.arc(h.x,h.y,s,d-Math.PI/2,d+Math.PI/2),t.closePath()}}t.fillStyle=n.color??r.fabricationNote,t.fill()}function $Ti(e){let{ctx:t,rect:n,realToCanvasMat:o,colorMap:r}=e,i=r.fabricationNote,s=n.color??i,a=n.is_filled??!1,c=n.has_stroke??!0,l=n.is_stroke_dashed??!1;Tp({ctx:t,center:n.center,width:n.width,height:n.height,fill:a?s:void 0,stroke:c?s:void 0,strokeWidth:c?n.stroke_width:void 0,borderRadius:n.corner_radius,realToCanvasMat:o,isStrokeDashed:l})}function qTi(e,t){return t.fabricationNote}function JTi(e){let{ctx:t,text:n,realToCanvasMat:o,colorMap:r}=e,i=qTi(n.layer,r),s=n.color??i,a=n.font_size;fte({ctx:t,text:n.text,x:n.anchor_position.x,y:n.anchor_position.y,fontSize:a,color:s,realToCanvasMat:o,anchorAlignment:n.anchor_alignment})}function Ov(e){let{ctx:t,center:n,radius_x:o,radius_y:r,fill:i,stroke:s,strokeWidth:a=0.1,realToCanvasMat:c,rotation:l=0}=e,[h,d]=Wjn.applyToPoint(c,[n.x,n.y]),u=o*Math.abs(c.a),_=r*Math.abs(c.a),p=a*Math.abs(c.a);if(t.save(),t.translate(h,d),l!==0)t.rotate(-l*(Math.PI/180));if(t.beginPath(),t.ellipse(0,0,u,_,0,0,Math.PI*2),i)t.fillStyle=i,t.fill();if(s)t.strokeStyle=s,t.lineWidth=p,t.stroke();t.restore()}function J_(e){let{ctx:t,center:n,width:o,height:r,fill:i,realToCanvasMat:s,rotation:a=0,stroke:c,strokeWidth:l}=e,[h,d]=Xjn.applyToPoint(s,[n.x,n.y]),u=o*Math.abs(s.a),_=r*Math.abs(s.a),p=l?l*Math.abs(s.a):void 0;if(t.save(),t.translate(h,d),a!==0)t.rotate(-a*(Math.PI/180));if(t.beginPath(),u>_){let m=_/2,A=u-_;t.moveTo(-A/2,-m),t.lineTo(A/2,-m),t.arc(A/2,0,m,-Math.PI/2,Math.PI/2),t.lineTo(-A/2,m),t.arc(-A/2,0,m,Math.PI/2,-Math.PI/2)}else if(_>u){let m=u/2,A=_-u;t.moveTo(m,-A/2),t.lineTo(m,A/2),t.arc(0,A/2,m,0,Math.PI),t.lineTo(-m,-A/2),t.arc(0,-A/2,m,Math.PI,0)}else t.arc(0,0,u/2,0,Math.PI*2);if(t.closePath(),i)t.fillStyle=i,t.fill();if(c&&p)t.strokeStyle=c,t.lineWidth=p,t.stroke();t.restore()}function sMe(e){if("ccw_rotation"in e&&typeof e.ccw_rotation==="number")return e.ccw_rotation;return 0}function yjn(e){let{ctx:t,hole:n,realToCanvasMat:o,colorMap:r,soldermaskMargin:i=0,drawSoldermask:s=!1}=e;if(s&&n.is_covered_with_solder_mask===!0)return;let a=i<0?Math.abs(i):0;if(n.hole_shape==="circle"){o_({ctx:t,center:{x:n.x,y:n.y},radius:n.hole_diameter/2-a,fill:r.drill,realToCanvasMat:o});return}if(n.hole_shape==="square"){let c=sMe(n);Tp({ctx:t,center:{x:n.x,y:n.y},width:n.hole_diameter-a*2,height:n.hole_diameter-a*2,fill:r.drill,realToCanvasMat:o,ccwRotationDegrees:c});return}if(n.hole_shape==="oval"){let c=sMe(n);Ov({ctx:t,center:{x:n.x,y:n.y},radius_x:n.hole_width/2-a,radius_y:n.hole_height/2-a,fill:r.drill,realToCanvasMat:o,rotation:c});return}if(n.hole_shape==="rect"){let c=sMe(n);Tp({ctx:t,center:{x:n.x,y:n.y},width:n.hole_width-a*2,height:n.hole_height-a*2,fill:r.drill,realToCanvasMat:o,ccwRotationDegrees:c});return}if(n.hole_shape==="pill"||n.hole_shape==="rotated_pill"){let c=sMe(n);J_({ctx:t,center:{x:n.x,y:n.y},width:n.hole_width-a*2,height:n.hole_height-a*2,fill:r.drill,realToCanvasMat:o,rotation:c});return}}function ZTi(e){let{ctx:t,cx:n,cy:o,radius:r}=e;t.beginPath(),t.arc(n,o,r,0,Math.PI*2)}function eDi(e){let{ctx:t,cx:n,cy:o,width:r,height:i}=e;t.beginPath(),t.rect(n-r/2,o-i/2,r,i)}function ST(e){let{ctx:t,cx:n,cy:o,width:r,height:i,ccwRotationDegrees:s=0}=e,a=s*Math.PI/180,c=oC.compose(oC.translate(n,o),oC.rotate(-a));if(r>i){let l=i/2,h=(r-i)/2,d=oC.applyToPoint(c,{x:-h,y:0}),u=oC.applyToPoint(c,{x:h,y:0}),_=oC.applyToPoint(c,{x:h,y:-l});t.moveTo(_.x,_.y),t.arc(u.x,u.y,l,-a-Math.PI/2,-a+Math.PI/2),t.arc(d.x,d.y,l,-a+Math.PI/2,-a-Math.PI/2)}else if(i>r){let l=r/2,h=(i-r)/2,d=oC.applyToPoint(c,{x:0,y:-h}),u=oC.applyToPoint(c,{x:0,y:h}),_=oC.applyToPoint(c,{x:l,y:h});t.moveTo(_.x,_.y),t.arc(u.x,u.y,l,-a,-a+Math.PI),t.arc(d.x,d.y,l,-a+Math.PI,-a)}else{let l=r/2;t.moveTo(n+l,o),t.arc(n,o,l,0,Math.PI*2)}t.closePath()}function KL(e){let{ctx:t,points:n}=e;if(n.length<3)return;let o=n[0];if(o){t.moveTo(o.x,o.y);for(let r=1;r<n.length;r++){let i=n[r];if(i)t.lineTo(i.x,i.y)}t.closePath()}}function rC(e){let{ctx:t,cx:n,cy:o,width:r,height:i,radius:s,ccwRotationDegrees:a=0}=e,c=a*Math.PI/180,l=z1.compose(z1.translate(n,o),z1.rotate(-c)),h=r/2,d=i/2,u=Math.min(s,h,d);if(u>0){let _=z1.applyToPoint(l,{x:-h,y:-d}),p=z1.applyToPoint(l,{x:h,y:-d}),m=z1.applyToPoint(l,{x:h,y:d}),A=z1.applyToPoint(l,{x:-h,y:d}),g=z1.applyToPoint(l,{x:-h,y:0});t.moveTo(g.x,g.y),t.arcTo(_.x,_.y,p.x,p.y,u),t.arcTo(p.x,p.y,m.x,m.y,u),t.arcTo(m.x,m.y,A.x,A.y,u),t.arcTo(A.x,A.y,_.x,_.y,u)}else{let _=z1.applyToPoint(l,{x:-h,y:-d}),p=z1.applyToPoint(l,{x:h,y:-d}),m=z1.applyToPoint(l,{x:h,y:d}),A=z1.applyToPoint(l,{x:-h,y:d});t.moveTo(_.x,_.y),t.lineTo(p.x,p.y),t.lineTo(m.x,m.y),t.lineTo(A.x,A.y)}t.closePath()}function tDi(e){let{ctx:t,pad:n,realToCanvasMat:o,color:r,drillCutouts:i}=e;if(t.save(),t.beginPath(),!xjn(t,n,o)){t.restore();return}t.clip(),t.beginPath(),xjn(t,n,o);for(let s of i)oDi(t,s,o);t.fillStyle=r,t.fill("evenodd"),t.restore()}function nDi(e){let{pad:t,holes:n=[],platedHoles:o=[],vias:r=[],cutouts:i=[]}=e,s=iDi(t);if(!s)return[];let a=[],c=(l)=>{if(l&&cDi(s,sDi(l)))a.push(l)};for(let l of i)c(aDi(l));for(let l of n)c(lDi(l));for(let l of o){if(!Cjn(l.layers,t.layer))continue;c(hDi(l))}for(let l of r){if(!Cjn(l.layers,t.layer))continue;let h=l.hole_diameter/2;if(h<=0)continue;let d={shape:"circle",x:l.x,y:l.y,radius:h};c(d)}return a}function xjn(e,t,n){if(t.shape==="rect"||t.shape==="rotated_rect")return Kjn(e,{x:t.x,y:t.y,width:t.width,height:t.height,radius:dDi(t),rotation:t.shape==="rotated_rect"?t.ccw_rotation??0:0,realToCanvasMat:n}),!0;if(t.shape==="circle")return jjn(e,{x:t.x,y:t.y,radius:t.radius,realToCanvasMat:n}),!0;if(t.shape==="pill"||t.shape==="rotated_pill")return $jn(e,{x:t.x,y:t.y,width:t.width,height:t.height,rotation:t.shape==="rotated_pill"?t.ccw_rotation??0:0,realToCanvasMat:n}),!0;if(t.shape==="polygon"&&t.points&&t.points.length>=3)return qjn(e,t.points,n),!0;return!1}function oDi(e,t,n){if(t.shape==="circle"){jjn(e,{x:t.x,y:t.y,radius:t.radius,realToCanvasMat:n});return}if(t.shape==="oval"){rDi(e,{x:t.x,y:t.y,radiusX:t.radiusX,radiusY:t.radiusY,rotation:t.rotation,realToCanvasMat:n});return}if(t.shape==="pill"){$jn(e,{x:t.x,y:t.y,width:t.width,height:t.height,rotation:t.rotation,realToCanvasMat:n});return}if(t.shape==="polygon"){qjn(e,t.points,n);return}Kjn(e,{x:t.x,y:t.y,width:t.width,height:t.height,radius:t.radius,rotation:t.rotation,realToCanvasMat:n})}function jjn(e,t){let{x:n,y:o,radius:r,realToCanvasMat:i}=t,[s,a]=XG.applyToPoint(i,[n,o]),c=r*Math.abs(i.a);e.moveTo(s+c,a),e.arc(s,a,c,0,Math.PI*2),e.closePath()}function rDi(e,t){let{x:n,y:o,radiusX:r,radiusY:i,rotation:s=0,realToCanvasMat:a}=t,[c,l]=XG.applyToPoint(a,[n,o]),h=r*Math.abs(a.a),d=i*Math.abs(a.a);if(e.save(),e.translate(c,l),s!==0)e.rotate(-s*(Math.PI/180));e.moveTo(h,0),e.ellipse(0,0,h,d,0,0,Math.PI*2),e.closePath(),e.restore()}function Kjn(e,t){let{x:n,y:o,width:r,height:i,radius:s=0,rotation:a=0,realToCanvasMat:c}=t,[l,h]=XG.applyToPoint(c,[n,o]),d=r*Math.abs(c.a),u=i*Math.abs(c.a),_=s*Math.abs(c.a);if(e.save(),e.translate(l,h),a!==0)e.rotate(-a*(Math.PI/180));if(_>0){let p=-d/2,m=-u/2,A=Math.min(_,d/2,u/2);e.moveTo(p+A,m),e.lineTo(p+d-A,m),e.arcTo(p+d,m,p+d,m+A,A),e.lineTo(p+d,m+u-A),e.arcTo(p+d,m+u,p+d-A,m+u,A),e.lineTo(p+A,m+u),e.arcTo(p,m+u,p,m+u-A,A),e.lineTo(p,m+A),e.arcTo(p,m,p+A,m,A),e.closePath()}else e.rect(-d/2,-u/2,d,u);e.restore()}function $jn(e,t){let{x:n,y:o,width:r,height:i,rotation:s=0,realToCanvasMat:a}=t,[c,l]=XG.applyToPoint(a,[n,o]),h=r*Math.abs(a.a),d=i*Math.abs(a.a);if(e.save(),e.translate(c,l),s!==0)e.rotate(-s*(Math.PI/180));if(h>d){let u=d/2,_=h-d;e.moveTo(-_/2,-u),e.lineTo(_/2,-u),e.arc(_/2,0,u,-Math.PI/2,Math.PI/2),e.lineTo(-_/2,u),e.arc(-_/2,0,u,Math.PI/2,-Math.PI/2)}else if(d>h){let u=h/2,_=d-h;e.moveTo(u,-_/2),e.lineTo(u,_/2),e.arc(0,_/2,u,0,Math.PI),e.lineTo(-u,-_/2),e.arc(0,-_/2,u,Math.PI,0)}else e.moveTo(h/2,0),e.arc(0,0,h/2,0,Math.PI*2);e.closePath(),e.restore()}function qjn(e,t,n){let o=t[0];if(!o)return;let[r,i]=XG.applyToPoint(n,[o.x,o.y]);e.moveTo(r,i);for(let s=1;s<t.length;s++){let a=t[s];if(!a)continue;let[c,l]=XG.applyToPoint(n,[a.x,a.y]);e.lineTo(c,l)}e.closePath()}function iDi(e){if(e.shape==="circle")return jL(e.x,e.y,e.radius,e.radius);if(e.shape==="rect"||e.shape==="rotated_rect"||e.shape==="pill"||e.shape==="rotated_pill"){let t=Math.hypot(e.width/2,e.height/2);if((e.shape==="rotated_rect"||e.shape==="rotated_pill")&&(e.ccw_rotation??0)!==0)return jL(e.x,e.y,t,t);return jL(e.x,e.y,e.width/2,e.height/2)}if(e.shape==="polygon"&&e.points&&e.points.length>=3)return Jjn(e.points)}function sDi(e){if(e.shape==="polygon")return Jjn(e.points);if(e.shape==="circle")return jL(e.x,e.y,e.radius,e.radius);if(e.shape==="oval"){if((e.rotation??0)!==0){let o=Math.hypot(e.radiusX,e.radiusY);return jL(e.x,e.y,o,o)}return jL(e.x,e.y,e.radiusX,e.radiusY)}let t=e.width/2,n=e.height/2;if((e.rotation??0)!==0){let o=Math.hypot(t,n);return jL(e.x,e.y,o,o)}return jL(e.x,e.y,t,n)}function aDi(e){if(e.shape==="circle"){if(e.radius<=0)return;return{shape:"circle",x:e.center.x,y:e.center.y,radius:e.radius}}if(e.shape==="rect"){if(e.width<=0||e.height<=0)return;return{shape:"rect",x:e.center.x,y:e.center.y,width:e.width,height:e.height,radius:e.corner_radius,rotation:e.rotation}}if(e.shape==="polygon"&&e.points.length>=3)return{shape:"polygon",points:e.points}}function Jjn(e){let t=1/0,n=-1/0,o=1/0,r=-1/0;for(let i of e)t=Math.min(t,i.x),n=Math.max(n,i.x),o=Math.min(o,i.y),r=Math.max(r,i.y);return{minX:t,maxX:n,minY:o,maxY:r}}function jL(e,t,n,o){return{minX:e-n,maxX:e+n,minY:t-o,maxY:t+o}}function cDi(e,t){return e.minX<=t.maxX&&e.maxX>=t.minX&&e.minY<=t.maxY&&e.maxY>=t.minY}function lDi(e){if(e.hole_shape==="circle"){let t=e.hole_diameter/2;if(t<=0)return;return{shape:"circle",x:e.x,y:e.y,radius:t}}if(e.hole_shape==="square"){if(e.hole_diameter<=0)return;return{shape:"rect",x:e.x,y:e.y,width:e.hole_diameter,height:e.hole_diameter,rotation:aMe(e)}}if(e.hole_shape==="oval"){if(e.hole_width<=0||e.hole_height<=0)return;return{shape:"oval",x:e.x,y:e.y,radiusX:e.hole_width/2,radiusY:e.hole_height/2,rotation:aMe(e)}}if(e.hole_shape==="rect"){if(e.hole_width<=0||e.hole_height<=0)return;return{shape:"rect",x:e.x,y:e.y,width:e.hole_width,height:e.hole_height,rotation:aMe(e)}}if(e.hole_shape==="pill"||e.hole_shape==="rotated_pill"){if(e.hole_width<=0||e.hole_height<=0)return;return{shape:"pill",x:e.x,y:e.y,width:e.hole_width,height:e.hole_height,rotation:aMe(e)}}}function hDi(e){if(e.shape==="circle"){let r=e.hole_diameter/2;if(r<=0)return;return{shape:"circle",x:e.x,y:e.y,radius:r}}if(e.shape==="oval"){let r=e.hole_width/2,i=e.hole_height/2;if(r<=0||i<=0)return;return{shape:"oval",x:e.x,y:e.y,radiusX:r,radiusY:i,rotation:e.ccw_rotation}}if(e.shape==="pill"){if(e.hole_width<=0||e.hole_height<=0)return;return{shape:"pill",x:e.x,y:e.y,width:e.hole_width,height:e.hole_height,rotation:e.ccw_rotation}}if(e.shape==="circular_hole_with_rect_pad"){let r=e.hole_diameter/2;if(r<=0)return;return{shape:"circle",x:e.x+(e.hole_offset_x??0),y:e.y+(e.hole_offset_y??0),radius:r}}if(e.shape==="pill_hole_with_rect_pad"){if(e.hole_width<=0||e.hole_height<=0)return;return{shape:"pill",x:e.x+(e.hole_offset_x??0),y:e.y+(e.hole_offset_y??0),width:e.hole_width,height:e.hole_height}}if(e.shape==="rotated_pill_hole_with_rect_pad"){if(e.hole_width<=0||e.hole_height<=0)return;return{shape:"pill",x:e.x+(e.hole_offset_x??0),y:e.y+(e.hole_offset_y??0),width:e.hole_width,height:e.hole_height,rotation:e.hole_ccw_rotation}}if(e.shape!=="hole_with_polygon_pad")return;let t=e.x+(e.hole_offset_x??0),n=e.y+(e.hole_offset_y??0),o=e.hole_shape;if(o==="circle"){let r=(e.hole_diameter??0)/2;if(r<=0)return;return{shape:"circle",x:t,y:n,radius:r}}if(o==="oval"){let r=(e.hole_width??0)/2,i=(e.hole_height??0)/2;if(r<=0||i<=0)return;return{shape:"oval",x:t,y:n,radiusX:r,radiusY:i}}if(o==="pill"||o==="rotated_pill"){let r=e.hole_width??0,i=e.hole_height??0;if(r<=0||i<=0)return;return{shape:"pill",x:t,y:n,width:r,height:i,rotation:o==="rotated_pill"?e.ccw_rotation:0}}}function aMe(e){return"ccw_rotation"in e&&typeof e.ccw_rotation==="number"?e.ccw_rotation:0}function dDi(e){if(e.shape==="rect"||e.shape==="rotated_rect")return e.corner_radius??e.rect_border_radius??0;return 0}function Cjn(e,t){if(!e||e.length===0)return!0;let n=bjn(t);return e.some((o)=>bjn(o)===n)}function bjn(e){if(typeof e==="string")return e;if(e&&typeof e==="object"&&"name"in e&&typeof e.name==="string")return e.name}function uDi(e,t){let n=parseInt(e.slice(1,3),16),o=parseInt(e.slice(3,5),16),r=parseInt(e.slice(5,7),16);return`rgba(${n}, ${o}, ${r}, ${t})`}function pDi(e,t){return e.layers.includes("bottom")&&!e.layers.includes("top")?t.keepout.bottom:t.keepout.top}function Ijn(e){let{ctx:t,strokeColor:n,hatchWidth:o,hatchSpacing:r,diagonal:i,getLineEndpoints:s}=e;t.strokeStyle=n,t.lineWidth=o,t.setLineDash([]);for(let a=-i;a<i*2;a+=r){let{startX:c,startY:l,endX:h,endY:d}=s(a);t.beginPath(),t.moveTo(c,l),t.lineTo(h,d),t.stroke()}}function vjn(e){let{ctx:t,fillColor:n,drawPath:o,drawHatch:r}=e;o(),t.fillStyle=n,t.fill(),o(),t.clip(),r()}function mDi(e){let{ctx:t,keepout:n,realToCanvasMat:o,colorMap:r}=e,i=Math.abs(o.a),s=pDi(n,r),a=uDi(s,0.2),c=1*i,l=0.15*i;if(n.shape==="rect"){let[h,d]=wut.applyToPoint(o,[n.center.x,n.center.y]),u=n.width*i,_=n.height*i,p=n.rotation??0,m=Math.sqrt(u*u+_*_),A=u/2,g=_/2;if(t.save(),t.translate(h,d),p!==0)t.rotate(-p*(Math.PI/180));vjn({ctx:t,strokeColor:s,fillColor:a,drawPath:()=>eDi({ctx:t,cx:0,cy:0,width:u,height:_}),drawHatch:()=>Ijn({ctx:t,strokeColor:s,hatchWidth:l,hatchSpacing:c,diagonal:m,getLineEndpoints:(f)=>({startX:-A+f,startY:-g,endX:-A+f+m,endY:-g+m})})}),t.restore();return}if(n.shape==="circle"){let[h,d]=wut.applyToPoint(o,[n.center.x,n.center.y]),u=n.radius*i,_=u*2;t.save(),t.translate(h,d),vjn({ctx:t,strokeColor:s,fillColor:a,drawPath:()=>ZTi({ctx:t,cx:0,cy:0,radius:u}),drawHatch:()=>Ijn({ctx:t,strokeColor:s,hatchWidth:l,hatchSpacing:c,diagonal:_,getLineEndpoints:(p)=>({startX:p-_,startY:-_,endX:p+_,endY:_})})}),t.restore()}}var _Di="rgba(255,255,255,0.5)";function gDi(e){let{ctx:t,pcbNoteDimension:n,realToCanvasMat:o}=e,r=n.color??_Di;Gjn({ctx:t,from:n.from,to:n.to,realToCanvasMat:o,color:r,fontSize:n.font_size,arrowSize:n.arrow_size,text:n.text,textRotation:n.text_ccw_rotation,offset:n.offset_distance&&n.offset_direction?{distance:n.offset_distance,direction:n.offset_direction}:void 0})}function ADi(e){let{ctx:t,line:n,realToCanvasMat:o,colorMap:r}=e,i="rgb(89, 148, 220)",s=n.color??"rgb(89, 148, 220)",a=n.stroke_width??0.1,c=n.is_dashed??!1,[l,h]=But.applyToPoint(o,[n.x1,n.y1]),[d,u]=But.applyToPoint(o,[n.x2,n.y2]),_=a*Math.abs(o.a);if(t.save(),c)t.setLineDash([_*2,_*2]);else t.setLineDash([]);t.beginPath(),t.moveTo(l,h),t.lineTo(d,u),t.lineWidth=_,t.strokeStyle=s,t.lineCap="round",t.stroke(),t.restore()}function ope(e){let{ctx:t,start:n,end:o,strokeWidth:r,stroke:i,realToCanvasMat:s,lineCap:a="round"}=e,[c,l]=Tut.applyToPoint(s,[n.x,n.y]),[h,d]=Tut.applyToPoint(s,[o.x,o.y]),u=r*Math.abs(s.a);t.beginPath(),t.moveTo(c,l),t.lineTo(h,d),t.lineWidth=u,t.strokeStyle=i,t.lineCap=a,t.stroke()}function fDi(e){let{ctx:t,path:n,realToCanvasMat:o,colorMap:r}=e,i="rgb(89, 148, 220)",s=n.color??"rgb(89, 148, 220)";if(!n.route||n.route.length<2)return;for(let a=0;a<n.route.length-1;a++){let c=n.route[a],l=n.route[a+1];if(!c||!l)continue;ope({ctx:t,start:{x:c.x,y:c.y},end:{x:l.x,y:l.y},strokeWidth:n.stroke_width??0.1,stroke:s,realToCanvasMat:o})}}function yDi(e){let{ctx:t,rect:n,realToCanvasMat:o,colorMap:r}=e,i="rgb(89, 148, 220)",s=n.color??"rgb(89, 148, 220)",a=n.is_filled??!1,c=n.has_stroke??!0,l=n.is_stroke_dashed??!1;Tp({ctx:t,center:n.center,width:n.width,height:n.height,fill:a?s:void 0,stroke:c?s:void 0,strokeWidth:c?n.stroke_width:void 0,borderRadius:n.corner_radius,realToCanvasMat:o,isStrokeDashed:l})}var xDi="rgb(89, 148, 220)";function CDi(e){let{ctx:t,text:n,realToCanvasMat:o,colorMap:r}=e,i=xDi,s=n.color??i,a=n.font_size??1;fte({ctx:t,text:n.text??"",x:n.anchor_position.x,y:n.anchor_position.y,fontSize:a,color:s,realToCanvasMat:o,anchorAlignment:n.anchor_alignment??"center",mirrorX:n.is_mirrored_from_top_view??n.layer==="bottom"})}function bDi(e){let{ctx:t,panel:n,realToCanvasMat:o,colorMap:r,drawBoardMaterial:i}=e,{width:s,height:a,center:c}=n;if(s!==void 0&&a!==void 0&&c){if(i)Tp({ctx:t,center:c,width:s,height:a,fill:r.substrate,realToCanvasMat:o});let l=s/2,h=a/2,d=[{x:c.x-l,y:c.y-h},{x:c.x+l,y:c.y-h},{x:c.x+l,y:c.y+h},{x:c.x-l,y:c.y+h}];dMe({ctx:t,points:d,stroke:r.boardOutline,strokeWidth:0.5,realToCanvasMat:o,closePath:!0})}}function rpe(e,t){if(e.length<3||t===0)return e;let n=0,o=0;for(let i of e)n+=i.x,o+=i.y;n/=e.length,o/=e.length;let r=[];for(let i of e){let s=i.x-n,a=i.y-o,c=Math.sqrt(s*s+a*a);if(c>0){let l=s/c,h=a/c;r.push({x:i.x+l*t,y:i.y+h*t})}else r.push({x:i.x+t,y:i.y})}return r}function Sjn(e){let{ctx:t,hole:n,realToCanvasMat:o,colorMap:r,soldermaskMargin:i=0,drawSoldermask:s}=e;if(n.is_covered_with_solder_mask===!0&&s)return;let a=r.copper[e.layer??"top"],c=i<0?Math.abs(i):0;if(n.shape==="circle"){o_({ctx:t,center:{x:n.x,y:n.y},radius:n.outer_diameter/2-c,fill:a,realToCanvasMat:o}),lE(t,()=>{o_({ctx:t,center:{x:n.x,y:n.y},radius:n.hole_diameter/2,fill:"#000",realToCanvasMat:o})}),o_({ctx:t,center:{x:n.x,y:n.y},radius:n.hole_diameter/2,fill:r.drill,realToCanvasMat:o});return}if(n.shape==="oval"){Ov({ctx:t,center:{x:n.x,y:n.y},radius_x:n.outer_width/2-c,radius_y:n.outer_height/2-c,fill:a,realToCanvasMat:o,rotation:n.ccw_rotation}),lE(t,()=>{Ov({ctx:t,center:{x:n.x,y:n.y},radius_x:n.hole_width/2,radius_y:n.hole_height/2,fill:"#000",realToCanvasMat:o,rotation:n.ccw_rotation})}),Ov({ctx:t,center:{x:n.x,y:n.y},radius_x:n.hole_width/2,radius_y:n.hole_height/2,fill:r.drill,realToCanvasMat:o,rotation:n.ccw_rotation});return}if(n.shape==="pill"){J_({ctx:t,center:{x:n.x,y:n.y},width:n.outer_width-c*2,height:n.outer_height-c*2,fill:a,realToCanvasMat:o,rotation:n.ccw_rotation}),lE(t,()=>{J_({ctx:t,center:{x:n.x,y:n.y},width:n.hole_width,height:n.hole_height,fill:"#000",realToCanvasMat:o,rotation:n.ccw_rotation})}),J_({ctx:t,center:{x:n.x,y:n.y},width:n.hole_width,height:n.hole_height,fill:r.drill,realToCanvasMat:o,rotation:n.ccw_rotation});return}if(n.shape==="circular_hole_with_rect_pad"){Tp({ctx:t,center:{x:n.x,y:n.y},width:n.rect_pad_width-c*2,height:n.rect_pad_height-c*2,fill:a,realToCanvasMat:o,borderRadius:n.rect_border_radius?Math.max(0,n.rect_border_radius-c):0,ccwRotationDegrees:n.rect_ccw_rotation});let l=n.x+(n.hole_offset_x??0),h=n.y+(n.hole_offset_y??0);lE(t,()=>{o_({ctx:t,center:{x:l,y:h},radius:n.hole_diameter/2,fill:"#000",realToCanvasMat:o})}),o_({ctx:t,center:{x:l,y:h},radius:n.hole_diameter/2,fill:r.drill,realToCanvasMat:o});return}if(n.shape==="pill_hole_with_rect_pad"){Tp({ctx:t,center:{x:n.x,y:n.y},width:n.rect_pad_width-c*2,height:n.rect_pad_height-c*2,fill:a,realToCanvasMat:o,borderRadius:n.rect_border_radius?Math.max(0,n.rect_border_radius-c):0});let l=n.x+(n.hole_offset_x??0),h=n.y+(n.hole_offset_y??0);lE(t,()=>{J_({ctx:t,center:{x:l,y:h},width:n.hole_width,height:n.hole_height,fill:"#000",realToCanvasMat:o})}),J_({ctx:t,center:{x:l,y:h},width:n.hole_width,height:n.hole_height,fill:r.drill,realToCanvasMat:o});return}if(n.shape==="rotated_pill_hole_with_rect_pad"){Tp({ctx:t,center:{x:n.x,y:n.y},width:n.rect_pad_width-c*2,height:n.rect_pad_height-c*2,fill:a,realToCanvasMat:o,borderRadius:n.rect_border_radius?Math.max(0,n.rect_border_radius-c):0,ccwRotationDegrees:n.rect_ccw_rotation});let l=n.x+(n.hole_offset_x??0),h=n.y+(n.hole_offset_y??0);lE(t,()=>{J_({ctx:t,center:{x:l,y:h},width:n.hole_width,height:n.hole_height,fill:"#000",realToCanvasMat:o,rotation:n.hole_ccw_rotation})}),J_({ctx:t,center:{x:l,y:h},width:n.hole_width,height:n.hole_height,fill:r.drill,realToCanvasMat:o,rotation:n.hole_ccw_rotation});return}if(n.shape==="hole_with_polygon_pad"){let l=n.pad_outline;if(l&&l.length>=3){let _=l.map((m)=>({x:n.x+m.x,y:n.y+m.y})),p=c>0?rpe(_,-c):_;if(p.length>=3)dE({ctx:t,points:p,fill:a,realToCanvasMat:o})}let h=n.x+(n.hole_offset_x??0),d=n.y+(n.hole_offset_y??0),u=n.hole_shape;if(u==="circle")lE(t,()=>{o_({ctx:t,center:{x:h,y:d},radius:(n.hole_diameter??0)/2,fill:"#000",realToCanvasMat:o})}),o_({ctx:t,center:{x:h,y:d},radius:(n.hole_diameter??0)/2,fill:r.drill,realToCanvasMat:o});else if(u==="oval")lE(t,()=>{Ov({ctx:t,center:{x:h,y:d},radius_x:(n.hole_width??0)/2,radius_y:(n.hole_height??0)/2,fill:"#000",realToCanvasMat:o})}),Ov({ctx:t,center:{x:h,y:d},radius_x:(n.hole_width??0)/2,radius_y:(n.hole_height??0)/2,fill:r.drill,realToCanvasMat:o});else if(u==="pill")lE(t,()=>{J_({ctx:t,center:{x:h,y:d},width:n.hole_width??0,height:n.hole_height??0,fill:"#000",realToCanvasMat:o})}),J_({ctx:t,center:{x:h,y:d},width:n.hole_width??0,height:n.hole_height??0,fill:r.drill,realToCanvasMat:o});else if(u==="rotated_pill")lE(t,()=>{J_({ctx:t,center:{x:h,y:d},width:n.hole_width??0,height:n.hole_height??0,fill:"#000",realToCanvasMat:o})}),J_({ctx:t,center:{x:h,y:d},width:n.hole_width??0,height:n.hole_height??0,fill:r.drill,realToCanvasMat:o});return}}function lE(e,t){e.save(),e.globalCompositeOperation="destination-out",t(),e.restore()}function vDi(e,t){return e==="bottom"?t.silkscreen.bottom:t.silkscreen.top}function SDi(e){let{ctx:t,circle:n,realToCanvasMat:o,colorMap:r}=e,i=vDi(n.layer,r);o_({ctx:t,center:n.center,radius:n.radius,stroke:i,strokeWidth:n.stroke_width,realToCanvasMat:o})}function PDi(e){let{ctx:t,graphic:n,realToCanvasMat:o,colorMap:r}=e,i=n.layer==="bottom"?r.silkscreen.bottom:r.silkscreen.top;t.beginPath(),Fjn({ctx:t,shape:n.brep_shape,realToCanvasMat:o}),t.fillStyle=i,t.fill("evenodd")}function EDi(e,t){return e==="bottom"?t.silkscreen.bottom:t.silkscreen.top}function MDi(e){let{ctx:t,line:n,realToCanvasMat:o,colorMap:r}=e,i=EDi(n.layer,r);ope({ctx:t,start:{x:n.x1,y:n.y1},end:{x:n.x2,y:n.y2},strokeWidth:n.stroke_width??0.1,stroke:i,realToCanvasMat:o})}function wDi(e,t){return e==="bottom"?t.silkscreen.bottom:t.silkscreen.top}function BDi(e){let{ctx:t,oval:n,realToCanvasMat:o,colorMap:r}=e,i=wDi(n.layer,r);Ov({ctx:t,center:n.center,radius_x:n.radius_x,radius_y:n.radius_y,stroke:i,strokeWidth:0.1,realToCanvasMat:o,rotation:n.ccw_rotation??0})}function TDi(e,t){return e==="bottom"?t.silkscreen.bottom:t.silkscreen.top}function DDi(e){let{ctx:t,path:n,realToCanvasMat:o,colorMap:r}=e,i=TDi(n.layer,r);if(!n.route||n.route.length<2)return;for(let s=0;s<n.route.length-1;s++){let a=n.route[s],c=n.route[s+1];if(!a||!c)continue;ope({ctx:t,start:{x:a.x,y:a.y},end:{x:c.x,y:c.y},strokeWidth:n.stroke_width??0.1,stroke:i,realToCanvasMat:o})}}function NDi(e,t){return e==="bottom"?t.silkscreen.bottom:t.silkscreen.top}function RDi(e){let{ctx:t,pill:n,realToCanvasMat:o,colorMap:r}=e,i=NDi(n.layer,r),s=0.2;J_({ctx:t,center:n.center,width:n.width,height:n.height,stroke:i,strokeWidth:0.2,realToCanvasMat:o})}function QDi(e,t){return e==="bottom"?t.silkscreen.bottom:t.silkscreen.top}function kDi(e){let{ctx:t,rect:n,realToCanvasMat:o,colorMap:r}=e,i=QDi(n.layer,r);Tp({ctx:t,center:n.center,width:n.width,height:n.height,borderRadius:n.corner_radius,fill:n.is_filled?i:"transparent",stroke:i,strokeWidth:n.stroke_width,realToCanvasMat:o})}function LDi(e,t){return e==="bottom"?t.silkscreen.bottom:t.silkscreen.top}function HDi(e){if(!e)return"center";return e}function FDi(e){let{ctx:t,text:n,realToCanvasMat:o,colorMap:r}=e,i=n.text??"";if(!i)return;let s=LDi(n.layer,r),a=HDi(n.anchor_alignment),c=n.font_size??1;fte({ctx:t,text:i,x:n.anchor_position.x,y:n.anchor_position.y,fontSize:c,color:s,realToCanvasMat:o,anchorAlignment:a,rotation:n.ccw_rotation??0,mirrorX:n.layer==="bottom",knockout:n.is_knockout,knockoutPadding:n.is_knockout?n.knockout_padding:void 0})}function zDi(e,t){return t.copper[e]??t.copper.top}function Pjn(e){if(e.shape==="rect"||e.shape==="rotated_rect")return e.corner_radius??e.rect_border_radius??0;return 0}function ODi(e){let{ctx:t,pad:n,realToCanvasMat:o,colorMap:r}=e,i=zDi(n.layer,r),s=nDi(e);if(s.length>0){tDi({ctx:t,pad:n,realToCanvasMat:o,color:i,drillCutouts:s});return}if(n.shape==="rect"){Tp({ctx:t,center:{x:n.x,y:n.y},width:n.width,height:n.height,fill:i,realToCanvasMat:o,borderRadius:Pjn(n)});return}if(n.shape==="rotated_rect"){Tp({ctx:t,center:{x:n.x,y:n.y},width:n.width,height:n.height,fill:i,realToCanvasMat:o,borderRadius:Pjn(n),ccwRotationDegrees:n.ccw_rotation??0});return}if(n.shape==="circle"){o_({ctx:t,center:{x:n.x,y:n.y},radius:n.radius,fill:i,realToCanvasMat:o});return}if(n.shape==="pill"){J_({ctx:t,center:{x:n.x,y:n.y},width:n.width,height:n.height,fill:i,realToCanvasMat:o});return}if(n.shape==="rotated_pill"){J_({ctx:t,center:{x:n.x,y:n.y},width:n.width,height:n.height,fill:i,realToCanvasMat:o,rotation:n.ccw_rotation??0});return}if(n.shape==="polygon"){if(n.points&&n.points.length>=3)dE({ctx:t,points:n.points,fill:i,realToCanvasMat:o});return}}var npe="rgb(105, 105, 105)";function Ejn(e){let{ctx:t,solderPaste:n,realToCanvasMat:o}=e;if(n.shape==="polygon")return;let r={x:n.x,y:n.y};if(n.shape==="rect"){Tp({ctx:t,center:r,width:n.width,height:n.height,fill:npe,realToCanvasMat:o});return}if(n.shape==="rotated_rect"){Tp({ctx:t,center:r,width:n.width,height:n.height,fill:npe,realToCanvasMat:o,ccwRotationDegrees:n.ccw_rotation});return}if(n.shape==="pill"){J_({ctx:t,center:r,width:n.width,height:n.height,fill:npe,realToCanvasMat:o});return}if(n.shape==="oval"){Ov({ctx:t,center:r,radius_x:n.width/2,radius_y:n.height/2,fill:npe,realToCanvasMat:o});return}if(n.shape==="circle")o_({ctx:t,center:r,radius:n.radius,fill:npe,realToCanvasMat:o})}function VDi(e){return typeof e==="function"}function Zjn(e,t,n){if(t<=0||n<=0)return null;let o=globalThis,r=null;if("OffscreenCanvas"in o&&typeof o.OffscreenCanvas==="function")r=new o.OffscreenCanvas(t,n);else if("document"in o&&o.document&&typeof o.document.createElement==="function"){let s=o.document.createElement("canvas");s.width=t,s.height=n,r=s}else{let s=e.canvas.constructor;if(VDi(s))try{r=new s(t,n)}catch{return null}}if(!r)return null;let i=r.getContext("2d");if(i)i.boardOwnerMap=e.boardOwnerMap;return i}function YDi(e){return"createPattern"in e&&typeof Reflect.get(e,"createPattern")==="function"}function eKn(e,t){if(e===t)return!1;if(t.canvas.width<=0||t.canvas.height<=0)return!1;if(!YDi(e))return!1;let n=null;try{n=e.createPattern(t.canvas,"no-repeat")}catch{return!1}if(!n)return!1;return e.save(),e.globalCompositeOperation="source-over",e.fillStyle=n,e.fillRect(0,0,t.canvas.width,t.canvas.height),e.restore(),!0}function Mjn(e){let{ctx:t,board:n,realToCanvasMat:o,soldermaskColor:r}=e,{width:i,height:s,center:a,outline:c}=n;if(c&&Array.isArray(c)&&c.length>=3){let l=c.map((h)=>{let[d,u]=Dut.applyToPoint(o,[h.x,h.y]);return{x:d,y:u}});t.beginPath(),KL({ctx:t,points:l}),t.fillStyle=r,t.fill()}else if(i!==void 0&&s!==void 0&&a){let[l,h]=Dut.applyToPoint(o,[a.x,a.y]),d=i*Math.abs(o.a),u=s*Math.abs(o.a);t.fillStyle=r,t.fillRect(l-d/2,h-u/2,d,u)}}function GDi(e){let{ctx:t,panel:n,realToCanvasMat:o,soldermaskColor:r}=e,{width:i,height:s,center:a}=n;if(i===void 0||s===void 0||!a)return;let[c,l]=tKn.applyToPoint(o,[a.x,a.y]),h=i*Math.abs(o.a),d=s*Math.abs(o.a);t.fillStyle=r,t.fillRect(c-h/2,l-d/2,h,d)}function iC(e){e.save(),e.globalCompositeOperation="destination-out",e.fill(),e.restore()}function UDi(e){let{ctx:t,cutout:n,realToCanvasMat:o}=e;if(n.shape==="rect"){let[r,i]=pMe.applyToPoint(o,[n.center?.x??0,n.center?.y??0]),s=n.width*Math.abs(o.a),a=n.height*Math.abs(o.a),c=(n.corner_radius??0)*Math.abs(o.a);if(t.save(),t.translate(r,i),n.rotation)t.rotate(-n.rotation*Math.PI/180);t.beginPath(),rC({ctx:t,cx:0,cy:0,width:s,height:a,radius:c}),t.restore(),iC(t)}else if(n.shape==="circle"){let[r,i]=pMe.applyToPoint(o,[n.center?.x??0,n.center?.y??0]),s=n.radius*Math.abs(o.a);t.beginPath(),t.arc(r,i,s,0,Math.PI*2),t.closePath(),iC(t)}else if(n.shape==="polygon"&&n.points&&n.points.length>=3){let r=n.points.map((i)=>{let[s,a]=pMe.applyToPoint(o,[i.x,i.y]);return{x:s,y:a}});t.beginPath(),KL({ctx:t,points:r}),iC(t)}}var pf="rgba(255, 255, 255, 1)";function vut(e){let{ctx:t,elements:n,layer:o,realToCanvasMat:r}=e;t.save(),t.globalCompositeOperation="destination-out";for(let i of n){if(i.type==="pcb_smtpad"){if(i.layer!==o)continue;if(i.is_covered_with_solder_mask===!0)continue;WDi({ctx:t,pad:i,realToCanvasMat:r});continue}if(i.type==="pcb_plated_hole"){if(i.layers&&!i.layers.includes(o))continue;if(i.is_covered_with_solder_mask===!0)continue;XDi({ctx:t,hole:i,realToCanvasMat:r});continue}if(i.type==="pcb_via"){if(i.layers&&!i.layers.includes(o))continue;o_({ctx:t,center:{x:i.x,y:i.y},radius:i.outer_diameter/2,fill:pf,realToCanvasMat:r});continue}if(i.type==="pcb_hole"){if(i.is_covered_with_solder_mask===!0)continue;jDi({ctx:t,hole:i,realToCanvasMat:r})}}t.restore()}function WDi(e){let{ctx:t,pad:n,realToCanvasMat:o}=e;if(n.shape==="rect"){Tp({ctx:t,center:{x:n.x,y:n.y},width:n.width,height:n.height,borderRadius:n.corner_radius??n.rect_border_radius??0,fill:pf,realToCanvasMat:o});return}if(n.shape==="rotated_rect"){Tp({ctx:t,center:{x:n.x,y:n.y},width:n.width,height:n.height,borderRadius:n.corner_radius??n.rect_border_radius??0,ccwRotationDegrees:n.ccw_rotation??0,fill:pf,realToCanvasMat:o});return}if(n.shape==="circle"){o_({ctx:t,center:{x:n.x,y:n.y},radius:n.radius,fill:pf,realToCanvasMat:o});return}if(n.shape==="pill"||n.shape==="rotated_pill"){J_({ctx:t,center:{x:n.x,y:n.y},width:n.width,height:n.height,rotation:n.shape==="rotated_pill"?n.ccw_rotation??0:0,fill:pf,realToCanvasMat:o});return}if(n.shape==="polygon"&&n.points&&n.points.length>=3)dE({ctx:t,points:n.points,fill:pf,realToCanvasMat:o})}function XDi(e){let{ctx:t,hole:n,realToCanvasMat:o}=e;if(n.shape==="circle"){o_({ctx:t,center:{x:n.x,y:n.y},radius:n.outer_diameter/2,fill:pf,realToCanvasMat:o});return}if(n.shape==="oval"){Ov({ctx:t,center:{x:n.x,y:n.y},radius_x:n.outer_width/2,radius_y:n.outer_height/2,rotation:n.ccw_rotation,fill:pf,realToCanvasMat:o});return}if(n.shape==="pill"){J_({ctx:t,center:{x:n.x,y:n.y},width:n.outer_width,height:n.outer_height,rotation:n.ccw_rotation,fill:pf,realToCanvasMat:o});return}if(n.shape==="circular_hole_with_rect_pad"){Tp({ctx:t,center:{x:n.x,y:n.y},width:n.rect_pad_width,height:n.rect_pad_height,borderRadius:n.rect_border_radius??0,ccwRotationDegrees:n.rect_ccw_rotation,fill:pf,realToCanvasMat:o});return}if(n.shape==="pill_hole_with_rect_pad"){Tp({ctx:t,center:{x:n.x,y:n.y},width:n.rect_pad_width,height:n.rect_pad_height,borderRadius:n.rect_border_radius??0,fill:pf,realToCanvasMat:o});return}if(n.shape==="rotated_pill_hole_with_rect_pad"){Tp({ctx:t,center:{x:n.x,y:n.y},width:n.rect_pad_width,height:n.rect_pad_height,borderRadius:n.rect_border_radius??0,ccwRotationDegrees:n.rect_ccw_rotation,fill:pf,realToCanvasMat:o});return}if(n.shape==="hole_with_polygon_pad"&&n.pad_outline&&n.pad_outline.length>=3)dE({ctx:t,points:n.pad_outline.map((r)=>({x:n.x+r.x,y:n.y+r.y})),fill:pf,realToCanvasMat:o})}function jDi(e){let{ctx:t,hole:n,realToCanvasMat:o}=e,r="ccw_rotation"in n&&typeof n.ccw_rotation==="number"?n.ccw_rotation:0;if(n.hole_shape==="circle"){o_({ctx:t,center:{x:n.x,y:n.y},radius:n.hole_diameter/2,fill:pf,realToCanvasMat:o});return}if(n.hole_shape==="square"){Tp({ctx:t,center:{x:n.x,y:n.y},width:n.hole_diameter,height:n.hole_diameter,ccwRotationDegrees:r,fill:pf,realToCanvasMat:o});return}if(n.hole_shape==="oval"){Ov({ctx:t,center:{x:n.x,y:n.y},radius_x:n.hole_width/2,radius_y:n.hole_height/2,rotation:r,fill:pf,realToCanvasMat:o});return}if(n.hole_shape==="rect"){Tp({ctx:t,center:{x:n.x,y:n.y},width:n.hole_width,height:n.hole_height,ccwRotationDegrees:r,fill:pf,realToCanvasMat:o});return}if(n.hole_shape==="pill"||n.hole_shape==="rotated_pill")J_({ctx:t,center:{x:n.x,y:n.y},width:n.hole_width,height:n.hole_height,rotation:r,fill:pf,realToCanvasMat:o})}function KDi(e,t,n,o,r){if(Math.abs(r)<0.0000000001)return null;let i=n-e,s=o-t,a=Math.hypot(i,s);if(a<0.0000000001)return null;let c=Math.abs(r)*(a/2),l=a/2,h=(c*c+l*l)/(2*c),d=h-c,u=(e+n)/2,_=(t+o)/2,p=-s/a,m=i/a,A=r>0?-1:1;return{centerX:u+A*p*d,centerY:_+A*m*d,radius:h}}function Sut(e,t,n,o,r,i,s){if(Math.abs(i)<0.0000000001){let[x,C]=gte.applyToPoint(s,[o,r]);e.lineTo(x,C);return}let a=KDi(t,n,o,r,i);if(!a){let[x,C]=gte.applyToPoint(s,[o,r]);e.lineTo(x,C);return}let[c,l]=gte.applyToPoint(s,[t,n]),[h,d]=gte.applyToPoint(s,[o,r]),[u,_]=gte.applyToPoint(s,[a.centerX,a.centerY]),p=Math.hypot(c-u,l-_),m=Math.atan2(l-_,c-u),A=Math.atan2(d-_,h-u),f=s.a*s.d-s.b*s.c<0,y=i>0?!f:f;e.arc(u,_,p,m,A,y)}function wjn(e,t,n){if(t.vertices.length<2)return;if(t.vertices.length===2){let s=t.vertices[0],a=t.vertices[1];if(s&&a&&Math.abs((s.bulge??0)-1)<0.0000000001&&Math.abs((a.bulge??0)-1)<0.0000000001){let[c,l]=mMe.applyToPoint(n,[s.x,s.y]);e.moveTo(c,l),Sut(e,s.x,s.y,a.x,a.y,1,n),Sut(e,a.x,a.y,s.x,s.y,1,n);return}}let o=t.vertices[0];if(!o)return;let[r,i]=mMe.applyToPoint(n,[o.x,o.y]);e.moveTo(r,i);for(let s=0;s<t.vertices.length;s++){let a=t.vertices[s],c=t.vertices[(s+1)%t.vertices.length];if(!a||!c)continue;let l=a.bulge??0;if(Math.abs(l)<0.0000000001){let[h,d]=mMe.applyToPoint(n,[c.x,c.y]);e.lineTo(h,d)}else Sut(e,a.x,a.y,c.x,c.y,l,n)}}function $Di(e){let{ctx:t,pour:n,realToCanvasMat:o,soldermaskOverCopperColor:r,layer:i,elements:s}=e;if(n.layer!==i)return;if(n.covered_with_solder_mask!==!0)return;if(t.save(),t.fillStyle=r,n.shape==="rect"){let[a,c]=Nut.applyToPoint(o,[n.center.x,n.center.y]),l=n.width*Math.abs(o.a),h=n.height*Math.abs(o.a);if(t.translate(a,c),n.rotation)t.rotate(-n.rotation*(Math.PI/180));t.beginPath(),t.rect(-l/2,-h/2,l,h),t.fill(),t.restore(),vut({ctx:t,elements:s,layer:i,realToCanvasMat:o});return}if(n.shape==="polygon"){if(n.points&&n.points.length>=3){let a=n.points.map((l)=>Nut.applyToPoint(o,[l.x,l.y])),c=a[0];if(c){t.beginPath();let[l,h]=c;t.moveTo(l,h);for(let d=1;d<a.length;d++){let u=a[d];if(!u)continue;let[_,p]=u;t.lineTo(_,p)}t.closePath(),t.fill(),vut({ctx:t,elements:s,layer:i,realToCanvasMat:o})}}t.restore();return}if(n.shape==="brep"){if(t.beginPath(),wjn(t,n.brep_shape.outer_ring,o),n.brep_shape.inner_rings)for(let a of n.brep_shape.inner_rings)wjn(t,a,o);t.fill("evenodd"),vut({ctx:t,elements:s,layer:i,realToCanvasMat:o}),t.restore();return}t.restore()}function qDi(e){let{ctx:t,hole:n,realToCanvasMat:o,soldermaskOverCopperColor:r}=e,i=n.is_covered_with_solder_mask===!0,s=n.soldermask_margin??0;if(i)t.fillStyle=r,cMe({ctx:t,hole:n,realToCanvasMat:o,margin:0}),t.fill();else if(s<0)cMe({ctx:t,hole:n,realToCanvasMat:o,margin:s}),iC(t),JDi({ctx:t,hole:n,realToCanvasMat:o,soldermaskOverCopperColor:r,margin:s});else if(s>0)cMe({ctx:t,hole:n,realToCanvasMat:o,margin:s}),iC(t);else cMe({ctx:t,hole:n,realToCanvasMat:o,margin:0}),iC(t)}function nKn(e){if("ccw_rotation"in e&&typeof e.ccw_rotation==="number")return e.ccw_rotation;return 0}function cMe(e){let{ctx:t,hole:n,realToCanvasMat:o,margin:r}=e,i=nKn(n);if(n.hole_shape==="circle"){let[s,a]=Vv.applyToPoint(o,[n.x,n.y]),c=(n.hole_diameter/2+r)*Math.abs(o.a);t.beginPath(),t.arc(s,a,c,0,Math.PI*2),t.closePath()}else if(n.hole_shape==="square"){let[s,a]=Vv.applyToPoint(o,[n.x,n.y]),c=(n.hole_diameter+r*2)*Math.abs(o.a);if(t.save(),t.translate(s,a),i!==0)t.rotate(-i*Math.PI/180);t.beginPath(),t.rect(-c/2,-c/2,c,c),t.closePath(),t.restore()}else if(n.hole_shape==="oval"){let[s,a]=Vv.applyToPoint(o,[n.x,n.y]),c=(n.hole_width/2+r)*Math.abs(o.a),l=(n.hole_height/2+r)*Math.abs(o.a);if(t.save(),t.translate(s,a),i!==0)t.rotate(-i*Math.PI/180);t.beginPath(),t.ellipse(0,0,c,l,0,0,Math.PI*2),t.closePath(),t.restore()}else if(n.hole_shape==="rect"){let[s,a]=Vv.applyToPoint(o,[n.x,n.y]),c=(n.hole_width+r*2)*Math.abs(o.a),l=(n.hole_height+r*2)*Math.abs(o.a);if(t.save(),t.translate(s,a),i!==0)t.rotate(-i*Math.PI/180);t.beginPath(),t.rect(-c/2,-l/2,c,l),t.closePath(),t.restore()}else if(n.hole_shape==="pill"||n.hole_shape==="rotated_pill"){let[s,a]=Vv.applyToPoint(o,[n.x,n.y]),c=(n.hole_width+r*2)*Math.abs(o.a),l=(n.hole_height+r*2)*Math.abs(o.a);if(t.save(),t.translate(s,a),i!==0)t.rotate(-i*Math.PI/180);t.beginPath(),ST({ctx:t,cx:0,cy:0,width:c,height:l}),t.restore()}}function JDi(e){let{ctx:t,hole:n,realToCanvasMat:o,soldermaskOverCopperColor:r,margin:i}=e,s=Math.abs(i),a=nKn(n);if(t.fillStyle=r,n.hole_shape==="circle"){let[c,l]=Vv.applyToPoint(o,[n.x,n.y]),h=n.hole_diameter/2*Math.abs(o.a),d=s*Math.abs(o.a),u=Math.max(0,h-d);if(t.save(),t.beginPath(),t.arc(c,l,h,0,Math.PI*2),u>0)t.arc(c,l,u,0,Math.PI*2,!0);t.fill("evenodd"),t.restore()}else if(n.hole_shape==="square"){let[c,l]=Vv.applyToPoint(o,[n.x,n.y]),h=n.hole_diameter*Math.abs(o.a),d=s*Math.abs(o.a),u=Math.max(0,h-d*2);if(t.save(),t.translate(c,l),a!==0)t.rotate(-a*Math.PI/180);if(t.beginPath(),t.rect(-h/2,-h/2,h,h),u>0)t.rect(-u/2,-u/2,u,u);t.fill("evenodd"),t.restore()}else if(n.hole_shape==="oval"){let[c,l]=Vv.applyToPoint(o,[n.x,n.y]),h=n.hole_width/2*Math.abs(o.a),d=n.hole_height/2*Math.abs(o.a),u=s*Math.abs(o.a),_=Math.max(0,h-u),p=Math.max(0,d-u);if(t.save(),t.translate(c,l),a!==0)t.rotate(-a*Math.PI/180);if(t.beginPath(),t.ellipse(0,0,h,d,0,0,Math.PI*2),_>0&&p>0)t.moveTo(_,0),t.ellipse(0,0,_,p,0,0,Math.PI*2);t.fill("evenodd"),t.restore()}else if(n.hole_shape==="rect"){let[c,l]=Vv.applyToPoint(o,[n.x,n.y]),h=n.hole_width*Math.abs(o.a),d=n.hole_height*Math.abs(o.a),u=s*Math.abs(o.a),_=Math.max(0,h-u*2),p=Math.max(0,d-u*2);if(t.save(),t.translate(c,l),a!==0)t.rotate(-a*Math.PI/180);if(t.beginPath(),t.rect(-h/2,-d/2,h,d),_>0&&p>0)t.rect(-_/2,-p/2,_,p);t.fill("evenodd"),t.restore()}else if(n.hole_shape==="pill"||n.hole_shape==="rotated_pill"){let[c,l]=Vv.applyToPoint(o,[n.x,n.y]),h=n.hole_width*Math.abs(o.a),d=n.hole_height*Math.abs(o.a),u=s*Math.abs(o.a);if(t.save(),t.translate(c,l),a!==0)t.rotate(-a*Math.PI/180);t.beginPath(),ST({ctx:t,cx:0,cy:0,width:h,height:d});let _=h-u*2,p=d-u*2;if(_>0&&p>0)ST({ctx:t,cx:0,cy:0,width:_,height:p});t.fill("evenodd"),t.restore()}}function ZDi(e){let{ctx:t,hole:n,realToCanvasMat:o,soldermaskOverCopperColor:r,layer:i}=e;if(n.layers&&!n.layers.includes(i))return;let s=n.is_covered_with_solder_mask===!0,a=n.soldermask_margin??0;if(s)t.fillStyle=r,lMe({ctx:t,hole:n,realToCanvasMat:o,margin:0}),t.fill();else if(a<0)lMe({ctx:t,hole:n,realToCanvasMat:o,margin:a}),iC(t),eNi({ctx:t,hole:n,realToCanvasMat:o,soldermaskOverCopperColor:r,margin:a});else if(a>0)lMe({ctx:t,hole:n,realToCanvasMat:o,margin:a}),iC(t);else lMe({ctx:t,hole:n,realToCanvasMat:o,margin:0}),iC(t)}function lMe(e){let{ctx:t,hole:n,realToCanvasMat:o,margin:r}=e;if(n.shape==="circle"){let[i,s]=O1.applyToPoint(o,[n.x,n.y]),a=(n.outer_diameter/2+r)*Math.abs(o.a);t.beginPath(),t.arc(i,s,a,0,Math.PI*2),t.closePath()}else if(n.shape==="oval"){let[i,s]=O1.applyToPoint(o,[n.x,n.y]),a=(n.outer_width/2+r)*Math.abs(o.a),c=(n.outer_height/2+r)*Math.abs(o.a);t.beginPath(),t.ellipse(i,s,a,c,-((n.ccw_rotation??0)*Math.PI)/180,0,Math.PI*2),t.closePath()}else if(n.shape==="pill"){let[i,s]=O1.applyToPoint(o,[n.x,n.y]),a=(n.outer_width+r*2)*Math.abs(o.a),c=(n.outer_height+r*2)*Math.abs(o.a);t.beginPath(),ST({ctx:t,cx:i,cy:s,width:a,height:c,ccwRotationDegrees:n.ccw_rotation})}else if(n.shape==="circular_hole_with_rect_pad"){let[i,s]=O1.applyToPoint(o,[n.x,n.y]),a=(n.rect_pad_width+r*2)*Math.abs(o.a),c=(n.rect_pad_height+r*2)*Math.abs(o.a),l=(n.rect_border_radius??0)*Math.abs(o.a);t.beginPath(),rC({ctx:t,cx:i,cy:s,width:a,height:c,radius:l,ccwRotationDegrees:n.rect_ccw_rotation})}else if(n.shape==="pill_hole_with_rect_pad"){let[i,s]=O1.applyToPoint(o,[n.x,n.y]),a=(n.rect_pad_width+r*2)*Math.abs(o.a),c=(n.rect_pad_height+r*2)*Math.abs(o.a),l=(n.rect_border_radius??0)*Math.abs(o.a);t.beginPath(),rC({ctx:t,cx:i,cy:s,width:a,height:c,radius:l})}else if(n.shape==="rotated_pill_hole_with_rect_pad"){let[i,s]=O1.applyToPoint(o,[n.x,n.y]),a=(n.rect_pad_width+r*2)*Math.abs(o.a),c=(n.rect_pad_height+r*2)*Math.abs(o.a),l=(n.rect_border_radius??0)*Math.abs(o.a);t.beginPath(),rC({ctx:t,cx:i,cy:s,width:a,height:c,radius:l,ccwRotationDegrees:n.rect_ccw_rotation})}else if(n.shape==="hole_with_polygon_pad"&&n.pad_outline&&n.pad_outline.length>=3){let i=n.pad_outline.map((c)=>({x:n.x+c.x,y:n.y+c.y})),a=(r!==0?rpe(i,r):i).map((c)=>{let[l,h]=O1.applyToPoint(o,[c.x,c.y]);return{x:l,y:h}});t.beginPath(),KL({ctx:t,points:a})}}function eNi(e){let{ctx:t,hole:n,realToCanvasMat:o,soldermaskOverCopperColor:r,margin:i}=e,s=Math.abs(i);if(t.fillStyle=r,n.shape==="circle"){let[a,c]=O1.applyToPoint(o,[n.x,n.y]),l=n.outer_diameter/2*Math.abs(o.a),h=s*Math.abs(o.a),d=Math.max(0,l-h);if(t.beginPath(),t.arc(a,c,l,0,Math.PI*2),d>0)t.arc(a,c,d,0,Math.PI*2,!0);t.fill("evenodd")}else if(n.shape==="oval"){let[a,c]=O1.applyToPoint(o,[n.x,n.y]),l=n.outer_width/2*Math.abs(o.a),h=n.outer_height/2*Math.abs(o.a),d=s*Math.abs(o.a),u=Math.max(0,l-d),_=Math.max(0,h-d),p=-((n.ccw_rotation??0)*Math.PI)/180;if(t.beginPath(),t.ellipse(a,c,l,h,p,0,Math.PI*2),u>0&&_>0){let m=a+u*Math.cos(p),A=c+u*Math.sin(p);t.moveTo(m,A),t.ellipse(a,c,u,_,p,0,Math.PI*2)}t.fill("evenodd")}else if(n.shape==="pill"){let[a,c]=O1.applyToPoint(o,[n.x,n.y]),l=n.outer_width*Math.abs(o.a),h=n.outer_height*Math.abs(o.a),d=s*Math.abs(o.a);t.beginPath(),ST({ctx:t,cx:a,cy:c,width:l,height:h,ccwRotationDegrees:n.ccw_rotation});let u=l-d*2,_=h-d*2;if(u>0&&_>0)ST({ctx:t,cx:a,cy:c,width:u,height:_,ccwRotationDegrees:n.ccw_rotation});t.fill("evenodd")}else if(n.shape==="circular_hole_with_rect_pad"){let[a,c]=O1.applyToPoint(o,[n.x,n.y]),l=n.rect_pad_width*Math.abs(o.a),h=n.rect_pad_height*Math.abs(o.a),d=s*Math.abs(o.a),u=n.rect_border_radius?n.rect_border_radius*Math.abs(o.a):0;t.beginPath(),rC({ctx:t,cx:a,cy:c,width:l,height:h,radius:u,ccwRotationDegrees:n.rect_ccw_rotation});let _=l-d*2,p=h-d*2;if(_>0&&p>0){let m=Math.max(0,u-d);rC({ctx:t,cx:a,cy:c,width:_,height:p,radius:m,ccwRotationDegrees:n.rect_ccw_rotation})}t.fill("evenodd")}else if(n.shape==="pill_hole_with_rect_pad"){let[a,c]=O1.applyToPoint(o,[n.x,n.y]),l=n.rect_pad_width*Math.abs(o.a),h=n.rect_pad_height*Math.abs(o.a),d=s*Math.abs(o.a),u=n.rect_border_radius?n.rect_border_radius*Math.abs(o.a):0;t.beginPath(),rC({ctx:t,cx:a,cy:c,width:l,height:h,radius:u});let _=l-d*2,p=h-d*2;if(_>0&&p>0){let m=Math.max(0,u-d);rC({ctx:t,cx:a,cy:c,width:_,height:p,radius:m})}t.fill("evenodd")}else if(n.shape==="rotated_pill_hole_with_rect_pad"){let[a,c]=O1.applyToPoint(o,[n.x,n.y]),l=n.rect_pad_width*Math.abs(o.a),h=n.rect_pad_height*Math.abs(o.a),d=s*Math.abs(o.a),u=n.rect_border_radius?n.rect_border_radius*Math.abs(o.a):0;t.beginPath(),rC({ctx:t,cx:a,cy:c,width:l,height:h,radius:u,ccwRotationDegrees:n.rect_ccw_rotation});let _=l-d*2,p=h-d*2;if(_>0&&p>0){let m=Math.max(0,u-d);rC({ctx:t,cx:a,cy:c,width:_,height:p,radius:m,ccwRotationDegrees:n.rect_ccw_rotation})}t.fill("evenodd")}else if(n.shape==="hole_with_polygon_pad"&&n.pad_outline&&n.pad_outline.length>=3){let a=n.pad_outline.map((h)=>({x:n.x+h.x,y:n.y+h.y}));t.beginPath();let c=a.map((h)=>{let[d,u]=O1.applyToPoint(o,[h.x,h.y]);return{x:d,y:u}});KL({ctx:t,points:c});let l=rpe(a,-s);if(l.length>=3){let h=l.map((d)=>{let[u,_]=O1.applyToPoint(o,[d.x,d.y]);return{x:u,y:_}});KL({ctx:t,points:h})}t.fill("evenodd")}}function tNi(e){let{ctx:t,pad:n,realToCanvasMat:o,soldermaskOverCopperColor:r,layer:i}=e;if(n.layer!==i)return;let s=n.is_covered_with_solder_mask===!0,a=n.soldermask_margin??0,c=a,l=a,h=a,d=a;if(n.shape==="rect"||n.shape==="rotated_rect")c=n.soldermask_margin_left??a,l=n.soldermask_margin_right??a,h=n.soldermask_margin_top??a,d=n.soldermask_margin_bottom??a;if(s)t.fillStyle=r,hMe({ctx:t,pad:n,realToCanvasMat:o,ml:0,mr:0,mt:0,mb:0}),t.fill();else if(c<0||l<0||h<0||d<0)hMe({ctx:t,pad:n,realToCanvasMat:o,ml:c,mr:l,mt:h,mb:d}),iC(t),nNi({ctx:t,pad:n,realToCanvasMat:o,soldermaskOverCopperColor:r,ml:c,mr:l,mt:h,mb:d});else if(c>0||l>0||h>0||d>0)hMe({ctx:t,pad:n,realToCanvasMat:o,ml:c,mr:l,mt:h,mb:d}),iC(t);else hMe({ctx:t,pad:n,realToCanvasMat:o,ml:0,mr:0,mt:0,mb:0}),iC(t)}function hMe(e){let{ctx:t,pad:n,realToCanvasMat:o,ml:r,mr:i,mt:s,mb:a}=e,c=n.shape==="rotated_rect"||n.shape==="rotated_pill"?n.ccw_rotation??0:0;if(n.shape==="rect"||n.shape==="rotated_rect"){let l=n.corner_radius??n.rect_border_radius??0,h=c*Math.PI/180,d=(i-r)/2,u=(s-a)/2,_=d*Math.cos(h)-u*Math.sin(h),p=d*Math.sin(h)+u*Math.cos(h),[m,A]=hE.applyToPoint(o,[n.x+_,n.y+p]),g=(n.width+r+i)*Math.abs(o.a),f=(n.height+s+a)*Math.abs(o.a),y=l*Math.abs(o.a);if(t.save(),t.translate(m,A),c!==0)t.rotate(-c*Math.PI/180);t.beginPath(),rC({ctx:t,cx:0,cy:0,width:g,height:f,radius:y}),t.restore()}else if(n.shape==="circle"){let l=(r+i+s+a)/4,[h,d]=hE.applyToPoint(o,[n.x,n.y]),u=(n.radius+l)*Math.abs(o.a);t.beginPath(),t.arc(h,d,u,0,Math.PI*2),t.closePath()}else if(n.shape==="pill"||n.shape==="rotated_pill"){let l=(r+i)/2,[h,d]=hE.applyToPoint(o,[n.x,n.y]),u=(n.width+l*2)*Math.abs(o.a),_=(n.height+l*2)*Math.abs(o.a);if(t.save(),t.translate(h,d),c!==0)t.rotate(-c*Math.PI/180);t.beginPath(),ST({ctx:t,cx:0,cy:0,width:u,height:_}),t.restore()}else if(n.shape==="polygon"&&n.points&&n.points.length>=3){let l=(r+i+s+a)/4,d=(l!==0?rpe(n.points,l):n.points).map((u)=>{let[_,p]=hE.applyToPoint(o,[u.x,u.y]);return{x:_,y:p}});t.beginPath(),KL({ctx:t,points:d})}}function nNi(e){let{ctx:t,pad:n,realToCanvasMat:o,soldermaskOverCopperColor:r,ml:i,mr:s,mt:a,mb:c}=e,l=n.shape==="rotated_rect"||n.shape==="rotated_pill"?n.ccw_rotation??0:0,h=Math.max(0,-i),d=Math.max(0,-s),u=Math.max(0,-a),_=Math.max(0,-c);if(t.fillStyle=r,n.shape==="rect"||n.shape==="rotated_rect"){let p=n.corner_radius??n.rect_border_radius??0,[m,A]=hE.applyToPoint(o,[n.x,n.y]),g=n.width*Math.abs(o.a),f=n.height*Math.abs(o.a),y=p*Math.abs(o.a),x=h*Math.abs(o.a),C=d*Math.abs(o.a),b=u*Math.abs(o.a),I=_*Math.abs(o.a);if(t.save(),t.translate(m,A),l!==0)t.rotate(-l*Math.PI/180);t.beginPath(),rC({ctx:t,cx:0,cy:0,width:g,height:f,radius:y});let v=g-x-C,P=f-b-I,M=(x-C)/2,B=(b-I)/2,T=Math.max(0,y-(x+C+b+I)/4);if(v>0&&P>0)rC({ctx:t,cx:M,cy:B,width:v,height:P,radius:T});t.fill("evenodd"),t.restore()}else if(n.shape==="circle"){let p=Math.max(h,d,u,_),[m,A]=hE.applyToPoint(o,[n.x,n.y]),g=n.radius*Math.abs(o.a),f=p*Math.abs(o.a),y=Math.max(0,g-f);if(t.save(),t.beginPath(),t.arc(m,A,g,0,Math.PI*2),y>0)t.arc(m,A,y,0,Math.PI*2,!0);t.fill("evenodd"),t.restore()}else if(n.shape==="pill"||n.shape==="rotated_pill"){let p=Math.max(h,d,u,_),[m,A]=hE.applyToPoint(o,[n.x,n.y]),g=n.width*Math.abs(o.a),f=n.height*Math.abs(o.a),y=p*Math.abs(o.a);if(t.save(),t.translate(m,A),l!==0)t.rotate(-l*Math.PI/180);t.beginPath(),ST({ctx:t,cx:0,cy:0,width:g,height:f});let x=g-y*2,C=f-y*2;if(x>0&&C>0)ST({ctx:t,cx:0,cy:0,width:x,height:C});t.fill("evenodd"),t.restore()}else if(n.shape==="polygon"&&n.points&&n.points.length>=3){let p=Math.max(h,d,u,_);t.save(),t.beginPath();let m=n.points.map((g)=>{let[f,y]=hE.applyToPoint(o,[g.x,g.y]);return{x:f,y}});KL({ctx:t,points:m});let A=rpe(n.points,-p);if(A.length>=3){let g=A.map((f)=>{let[y,x]=hE.applyToPoint(o,[f.x,f.y]);return{x:y,y:x}});KL({ctx:t,points:g})}t.fill("evenodd"),t.restore()}}function oKn(e){if(!e||typeof e!=="object")return!1;return"route_type"in e&&e.route_type==="wire"&&(("start_width"in e)||("end_width"in e)||("width_interpolation_mode"in e))}function Lut(e){let t=[];for(let n=0;n<e.length-1;n++){let o=e[n];if(!oKn(o))continue;let r=e[n+1];if(!r)continue;let i=r.route_type==="through_pad"?r.start:{x:r.x,y:r.y},s=r.route_type==="via"?r.from_layer:r.route_type==="through_pad"?r.start_layer:r.layer;if(!i||s!==o.layer||o.width!==o.start_width)continue;let a={start:{x:o.x,y:o.y},end:i,start_width:o.start_width,end_width:o.end_width,width_interpolation_mode:o.width_interpolation_mode,layer:o.layer,is_inside_copper_pour:Boolean(o.is_inside_copper_pour&&r.is_inside_copper_pour)};if(iKn(a))t.push(a)}return t}function rKn(e){let{start:t,end:n,start_width:o,end_width:r}=e,i=n.x-t.x,s=n.y-t.y,a=Math.hypot(i,s);if(!iKn(e))return[];let c=Math.abs(r-o),l=e.width_interpolation_mode==="linear"?1:Math.max(1,Math.ceil(Math.sqrt(c/(0.001+c*0.000001)*0.375))),h=-s/a,d=i/a,u=[],_=[];for(let p=0;p<=l;p++){let m=p/l,A=o<=r?m:1-m,f=(e.width_interpolation_mode==="quadratic"?Math.min(o,r)+c*A*A:o+(r-o)*m)/2,y=t.x+i*m,x=t.y+s*m;u.push({x:y+h*f,y:x+d*f}),_.push({x:y-h*f,y:x-d*f})}return[...u,..._.reverse()]}function iKn(e){let{start:t,end:n,start_width:o,end_width:r}=e,i=Math.hypot(n.x-t.x,n.y-t.y);if(![t.x,t.y,n.x,n.y,i,o,r].every(Number.isFinite)||i<=0||o<=0||r<=0)return!1;if(e.width_interpolation_mode!=="linear"&&e.width_interpolation_mode!=="quadratic")return!1;return!0}function Ate(e,t){let n=Math.hypot(e,t);if(n<=Number.EPSILON)return{x:0,y:0};return{x:e/n,y:t/n}}function oNi(e,t){let n=e.length;if(n<2)return{x:1,y:0};if(t<=0){let l=e[1],h=e[0];if(!l||!h)return{x:1,y:0};let d=Ate(l.x-h.x,l.y-h.y);return d.x===0&&d.y===0?{x:1,y:0}:d}if(t>=n-1){let l=e[n-2],h=e[n-1];if(!l||!h)return{x:1,y:0};let d=Ate(h.x-l.x,h.y-l.y);return d.x===0&&d.y===0?{x:1,y:0}:d}let o=e[t-1],r=e[t],i=e[t+1];if(!o||!r||!i)return{x:1,y:0};let s=Ate(r.x-o.x,r.y-o.y),a=Ate(i.x-r.x,i.y-r.y),c=Ate(s.x+a.x,s.y+a.y);if(c.x===0&&c.y===0){if(s.x!==0||s.y!==0)return s;if(a.x!==0||a.y!==0)return a;return{x:1,y:0}}return c}function sKn(e){let t=[],n=[];for(let o=0;o<e.length;o++){let r=e[o];if(!r)continue;let i=oNi(e,o),s=Ate(-i.y,i.x),a=r.width/2;t.push({x:r.x+s.x*a,y:r.y+s.y*a}),n.push({x:r.x-s.x*a,y:r.y-s.y*a})}return t.concat(n.reverse())}function Hut(e){let t=[],n=[],o=null;for(let r of e??[]){if(!r||r.route_type!=="wire"){if(n.length>=2)t.push(n);n=[],o=null;continue}let i=r.layer??o;if(!i)continue;let{x:s,y:a}=r;if(typeof s!=="number"||typeof a!=="number")continue;if(typeof r.width!=="number")continue;let c=r.width;if(o&&i!==o){if(n.length>=2)t.push(n);n=[]}if(o=i,n.push(r),oKn(r)){if(n.length>=2)t.push(n);n=[],o=null}}if(n.length>=2)t.push(n);return t}var Bjn=0.000001;function aKn(e){let{ctx:t,trace:n,realToCanvasMat:o,vias:r,platedHoles:i,layer:s}=e;if(!n.route||n.route.length===0)return;let a=Hut(n.route);for(let l of Lut(n.route))for(let h of[l.start,l.end])a.push([{route_type:"wire",...h,layer:l.layer,width:l.end_width}]);if(a.length===0)return;let c=new Map;for(let l of a){let h=l[0]?.layer,d=l[l.length-1];if(!h||!d)continue;if(s&&h!==s)continue;for(let u of r){if(u.layers&&Array.isArray(u.layers)&&!u.layers.includes(h))continue;if(!Tjn(d.x,d.y,u.x,u.y))continue;let _=u.hole_diameter/2;if(_<=0)continue;let p={shape:"circle",x:u.x,y:u.y,radius:_};c.set(Djn(p),p)}for(let u of i){if(u.layers&&Array.isArray(u.layers)&&!u.layers.includes(h))continue;let _=rNi(u);if(!_)continue;if(!Tjn(d.x,d.y,_.x,_.y))continue;c.set(Djn(_),_)}}if(c.size===0)return;t.save(),t.globalCompositeOperation="destination-out";for(let l of c.values()){if(l.shape==="circle"){o_({ctx:t,center:{x:l.x,y:l.y},radius:l.radius,fill:"#000",realToCanvasMat:o});continue}if(l.shape==="oval"){Ov({ctx:t,center:{x:l.x,y:l.y},radius_x:l.radiusX,radius_y:l.radiusY,fill:"#000",realToCanvasMat:o,rotation:l.rotation});continue}J_({ctx:t,center:{x:l.x,y:l.y},width:l.width,height:l.height,fill:"#000",realToCanvasMat:o,rotation:l.rotation})}t.restore()}function rNi(e){if(e.shape==="circle"){let r=e.hole_diameter/2;if(r<=0)return;return{shape:"circle",x:e.x,y:e.y,radius:r}}if(e.shape==="oval"){let r=e.hole_width/2,i=e.hole_height/2;if(r<=0||i<=0)return;return{shape:"oval",x:e.x,y:e.y,radiusX:r,radiusY:i,rotation:e.ccw_rotation}}if(e.shape==="pill"){if(e.hole_width<=0||e.hole_height<=0)return;return{shape:"pill",x:e.x,y:e.y,width:e.hole_width,height:e.hole_height,rotation:e.ccw_rotation}}if(e.shape==="circular_hole_with_rect_pad"){let r=e.hole_diameter/2;if(r<=0)return;return{shape:"circle",x:e.x+(e.hole_offset_x??0),y:e.y+(e.hole_offset_y??0),radius:r}}if(e.shape==="pill_hole_with_rect_pad"){if(e.hole_width<=0||e.hole_height<=0)return;return{shape:"pill",x:e.x+(e.hole_offset_x??0),y:e.y+(e.hole_offset_y??0),width:e.hole_width,height:e.hole_height}}if(e.shape==="rotated_pill_hole_with_rect_pad"){if(e.hole_width<=0||e.hole_height<=0)return;return{shape:"pill",x:e.x+(e.hole_offset_x??0),y:e.y+(e.hole_offset_y??0),width:e.hole_width,height:e.hole_height,rotation:e.hole_ccw_rotation}}if(e.shape!=="hole_with_polygon_pad")return;let t=e.x+(e.hole_offset_x??0),n=e.y+(e.hole_offset_y??0),o=e.hole_shape;if(o==="circle"){let r=(e.hole_diameter??0)/2;if(r<=0)return;return{shape:"circle",x:t,y:n,radius:r}}if(o==="oval"){let r=(e.hole_width??0)/2,i=(e.hole_height??0)/2;if(r<=0||i<=0)return;return{shape:"oval",x:t,y:n,radiusX:r,radiusY:i}}if(o==="pill"||o==="rotated_pill"){let r=e.hole_width??0,i=e.hole_height??0;if(r<=0||i<=0)return;return{shape:"pill",x:t,y:n,width:r,height:i,rotation:o==="rotated_pill"?e.ccw_rotation:0}}}function Tjn(e,t,n,o){return Math.abs(e-n)<=Bjn&&Math.abs(t-o)<=Bjn}function Djn(e){if(e.shape==="circle")return`circle:${e.x}:${e.y}:${e.radius}`;if(e.shape==="oval")return`oval:${e.x}:${e.y}:${e.radiusX}:${e.radiusY}:${e.rotation??0}`;return`pill:${e.x}:${e.y}:${e.width}:${e.height}:${e.rotation??0}`}function iNi(e){let{ctx:t,trace:n,realToCanvasMat:o,soldermaskOverCopperColor:r,layer:i}=e;if(!n.route||!Array.isArray(n.route)||n.route.length===0)return;for(let a of Lut(n.route)){if(i&&a.layer!==i)continue;if(a.is_inside_copper_pour)continue;dE({ctx:t,points:rKn(a),fill:r,realToCanvasMat:o})}let s=Hut(n.route);for(let a of s){if(a[0]?.layer!==i)continue;if(n.route_thickness_mode==="interpolated"){dE({ctx:t,points:sKn(a),fill:r,realToCanvasMat:o});continue}for(let l=0;l<a.length-1;l++){let h=a[l],d=a[l+1];if(!h||!d)continue;ope({ctx:t,start:{x:h.x,y:h.y},end:{x:d.x,y:d.y},strokeWidth:h.width,stroke:r,realToCanvasMat:o,lineCap:"round"})}}aKn({ctx:t,trace:n,realToCanvasMat:o,layer:i,vias:e.vias,platedHoles:e.platedHoles})}function lKn(e){let{ctx:t,via:n,realToCanvasMat:o,layer:r,soldermaskOverCopperColor:i,soldermaskOverHoleColor:s}=e;if(!n.layers.includes(r))return;let a=Fut(n,r,t),[c,l]=cKn.applyToPoint(o,[n.x,n.y]),h=n.outer_diameter/2*Math.abs(o.a);if(t.beginPath(),t.arc(c,l,h,0,Math.PI*2),t.closePath(),a){let d=n.hole_diameter/2*Math.abs(o.a);t.moveTo(c+d,l),t.arc(c,l,d,0,Math.PI*2),t.closePath(),t.fillStyle=i,t.fill("evenodd"),t.fillStyle=s,t.beginPath(),t.arc(c,l,d,0,Math.PI*2),t.fill()}else iC(t)}function Fut(e,t,n){let o=n.boardOwnerMap?.get(e.pcb_via_id);if(!n.boardOwnerMap?.has(e.pcb_via_id)&&e.pcb_trace_id)o=n.boardOwnerMap?.get(e.pcb_trace_id);let r=e,i=t==="top"?r.tented_on_top:r.tented_on_bottom,s=t==="top"?o?.default_via_tented_on_top:o?.default_via_tented_on_bottom;return i??r.is_tented??s??!1}function Njn(e){let{ctx:t,realToCanvasMat:n,colorMap:o,layer:r,drawSoldermask:i}=e,{elements:s}=e;if(!i)return;if(t.canvas.width<=0||t.canvas.height<=0)return;let a=s.filter((m)=>m.type==="pcb_board"),c=s.find((m)=>m.type==="pcb_panel");if(a.length===0&&!c)s=s.filter((m)=>m.type==="pcb_via");let l=o.soldermask[r]??o.soldermask.top,h=o.soldermaskOverCopper[r]??o.soldermaskOverCopper.top,d=o.soldermaskOverHole[r]??o.soldermaskOverHole.top,u=s.filter((m)=>m.type==="pcb_via"),_=s.filter((m)=>m.type==="pcb_plated_hole"),p=Zjn(t,t.canvas.width,t.canvas.height)??t;if(c)GDi({ctx:p,panel:c,realToCanvasMat:n,soldermaskColor:l});if(c&&a.length>0){p.save(),p.globalCompositeOperation="destination-out";for(let m of a)Mjn({ctx:p,board:m,realToCanvasMat:n,soldermaskColor:"#000"});p.restore()}for(let m of a)Mjn({ctx:p,board:m,realToCanvasMat:n,soldermaskColor:l});for(let m of s)if(m.type==="pcb_trace")iNi({ctx:p,trace:m,realToCanvasMat:n,soldermaskOverCopperColor:h,layer:r,vias:u,platedHoles:_});else if(m.type==="pcb_copper_pour")$Di({ctx:p,pour:m,realToCanvasMat:n,soldermaskOverCopperColor:h,layer:r,elements:s});for(let m of u){if(!Fut(m,r,p))continue;lKn({ctx:p,via:m,realToCanvasMat:n,layer:r,soldermaskOverCopperColor:h,soldermaskOverHoleColor:d})}for(let m of s)sNi({ctx:p,element:m,realToCanvasMat:n,soldermaskOverCopperColor:h,soldermaskOverHoleColor:d,layer:r});eKn(t,p)}function sNi(e){let{ctx:t,element:n,realToCanvasMat:o,soldermaskOverCopperColor:r,soldermaskOverHoleColor:i,layer:s}=e;if(n.type==="pcb_smtpad")tNi({ctx:t,pad:n,realToCanvasMat:o,soldermaskOverCopperColor:r,layer:s});else if(n.type==="pcb_plated_hole")ZDi({ctx:t,hole:n,realToCanvasMat:o,soldermaskOverCopperColor:r,layer:s});else if(n.type==="pcb_hole")qDi({ctx:t,hole:n,realToCanvasMat:o,soldermaskOverCopperColor:r});else if(n.type==="pcb_via"){if(Fut(n,s,t))return;lKn({ctx:t,via:n,realToCanvasMat:o,layer:s,soldermaskOverCopperColor:r,soldermaskOverHoleColor:i})}else if(n.type==="pcb_cutout")UDi({ctx:t,cutout:n,realToCanvasMat:o});else if(n.type==="pcb_copper_pour")return;else if(n.type==="pcb_trace")return}function Rjn(e,t){return t.copper[e]??t.copper.top}function aNi(e){let{ctx:t,trace:n,realToCanvasMat:o,colorMap:r,layer:i}=e;if(!n.route||!Array.isArray(n.route)||n.route.length===0)return;for(let a of Lut(n.route)){if(i&&a.layer!==i)continue;if(a.is_inside_copper_pour)continue;dE({ctx:t,points:rKn(a),fill:Rjn(a.layer,r),realToCanvasMat:o})}let s=Hut(n.route);for(let a of s){let c=a[0]?.layer;if(!c)continue;if(i&&c!==i)continue;let l=Rjn(c,r);if(n.route_thickness_mode==="interpolated"){dE({ctx:t,points:sKn(a),fill:l,realToCanvasMat:o});continue}for(let h=0;h<a.length-1;h++){let d=a[h],u=a[h+1];if(!d||!u)continue;if(d.is_inside_copper_pour&&u.is_inside_copper_pour)continue;ope({ctx:t,start:{x:d.x,y:d.y},end:{x:u.x,y:u.y},strokeWidth:d.width,stroke:l,realToCanvasMat:o,lineCap:"round"})}}aKn({ctx:t,trace:n,realToCanvasMat:o,vias:e.vias??[],platedHoles:e.platedHoles??[],layer:i})}function Qjn(e){let{ctx:t,traces:n,copperPours:o,realToCanvasMat:r,colorMap:i,vias:s,platedHoles:a,renderLayers:c}=e;for(let l of lNi(n,c)){let h=o.filter((u)=>u.layer===l);if(h.length===0){Put({ctx:t,traces:n,layer:l,realToCanvasMat:r,colorMap:i,vias:s,platedHoles:a});continue}let d=Zjn(t,t.canvas.width,t.canvas.height);if(d){if(Put({ctx:d,traces:n,layer:l,realToCanvasMat:r,colorMap:i,vias:s,platedHoles:a}),cNi({ctx:d,copperPours:h,realToCanvasMat:r}),eKn(t,d))continue}t.save(),hNi({ctx:t,copperPours:h,realToCanvasMat:r}),Put({ctx:t,traces:n,layer:l,realToCanvasMat:r,colorMap:i,vias:s,platedHoles:a}),t.restore()}}function Put(e){let{ctx:t,traces:n,layer:o,realToCanvasMat:r,colorMap:i,vias:s,platedHoles:a}=e;for(let c of n)aNi({ctx:t,trace:c,realToCanvasMat:r,colorMap:i,vias:s,platedHoles:a,layer:o})}function cNi(e){let{ctx:t,copperPours:n,realToCanvasMat:o}=e;if(n.length===0)return;t.save(),t.globalCompositeOperation="destination-out",t.fillStyle="#000";for(let r of n)t.beginPath(),Rut({ctx:t,pour:r,realToCanvasMat:o}),t.fill(r.shape==="brep"?"evenodd":"nonzero");t.restore()}function lNi(e,t){let n=new Set;for(let o of e)for(let r of o.route??[]){if(r.route_type!=="wire"||!r.layer)continue;if(t?.length&&!t.includes(`${r.layer}_copper`))continue;n.add(r.layer)}return[...n]}function hNi(e){let{ctx:t,copperPours:n,realToCanvasMat:o}=e;if(n.length===0)return;t.beginPath(),t.rect(0,0,t.canvas.width,t.canvas.height);for(let r of n)Rut({ctx:t,pour:r,realToCanvasMat:o});t.clip("evenodd")}function dNi(e,t,n=[]){let o=[...e,...n].filter((a)=>a.type==="pcb_via"),r=new Map;for(let a of o){let l=`${t.boardOwnerMap?.get(a.pcb_via_id)?.pcb_board_id??""}:${a.x}:${a.y}`,h=r.get(l)??[];h.push(a),r.set(l,h)}let i=e.filter((a)=>a.type==="pcb_trace"),s=[];for(let a of i){let c=t.boardOwnerMap?.get(a.pcb_trace_id);for(let[l,h]of a.route.entries()){if(h.route_type!=="via")continue;let d=`${c?.pcb_board_id??""}:${h.x}:${h.y}`,u=r.get(d)??[];if(u.some((m)=>m.layers.includes(h.from_layer)&&m.layers.includes(h.to_layer)))continue;let p={type:"pcb_via",pcb_via_id:`${a.pcb_trace_id}_route_via_${l}`,pcb_trace_id:a.pcb_trace_id,subcircuit_id:a.subcircuit_id,pcb_group_id:a.pcb_group_id,x:h.x,y:h.y,layers:[h.from_layer,h.to_layer],hole_diameter:h.hole_diameter??c?.min_via_hole_diameter??0.25,outer_diameter:h.outer_diameter??c?.min_via_pad_diameter??0.6,tented_on_top:h.tented_on_top,tented_on_bottom:h.tented_on_bottom};s.push(p),u.push(p),r.set(d,u)}}return s}function kjn(e){let{ctx:t,via:n,realToCanvasMat:o,colorMap:r,layer:i}=e;o_({ctx:t,center:{x:n.x,y:n.y},radius:n.outer_diameter/2,fill:r.copper[i??"top"],realToCanvasMat:o}),t.save(),t.globalCompositeOperation="destination-out",o_({ctx:t,center:{x:n.x,y:n.y},radius:n.hole_diameter/2,fill:"#000",realToCanvasMat:o}),t.restore(),o_({ctx:t,center:{x:n.x,y:n.y},radius:n.hole_diameter/2,fill:r.drill,realToCanvasMat:o})}function o4(e,t){if(!t.layers||t.layers.length===0)return!0;if(e.type==="pcb_silkscreen_graphic")return t.layers.some((o)=>o===`${e.layer}_silkscreen`);let n=a2e(e);if(n.length===0)return!0;return n.some((o)=>t.layers.includes(o))}var $u={copper:{top:"rgb(200, 52, 52)",inner1:"rgb(127, 200, 127)",inner2:"rgb(206, 125, 44)",inner3:"rgb(79, 203, 203)",inner4:"rgb(219, 98, 139)",inner5:"rgb(167, 165, 198)",inner6:"rgb(40, 204, 217)",inner7:"rgb(232, 178, 167)",inner8:"rgb(242, 237, 161)",bottom:"rgb(77, 127, 196)"},copperPour:{top:"rgb(230, 95, 95)",bottom:"rgb(122, 162, 222)"},soldermaskWithCopperUnderneath:{top:"rgb(18, 82, 50)",bottom:"rgb(77, 127, 196)"},soldermask:{top:"rgb(12, 55, 33)",bottom:"rgb(12, 55, 33)"},soldermaskOverCopper:{top:"rgb(52, 135, 73)",bottom:"rgb(52, 135, 73)"},soldermaskOverHole:{top:"rgb(26, 68, 37)",bottom:"rgb(26, 68, 37)"},substrate:"rgb(201, 162, 110)",drill:"#FF26E2",silkscreen:{top:"#f2eda1",bottom:"#5da9e9"},boardOutline:"rgba(255, 255, 255, 0.5)",courtyard:{top:"#FF00FF",bottom:"rgb(38, 233, 255)"},keepout:{top:"#FF6B6B",bottom:"#5da9e9"},fabricationNote:"rgba(255, 255, 255, 0.5)"};function uNi(e){if(!e||e.length===0)return"top";return(e.find((n)=>n.endsWith("_copper"))??e[0]??"top_copper").split("_")[0]}var mte=(e,t)=>e.layers?.includes(t)??!0,ui=class e{ctx;colorMap;realToCanvasMat;constructor(t){if("getContext"in t&&typeof t.getContext==="function"){let n=t.getContext("2d");if(!n)throw Error("Failed to get 2D rendering context from canvas");this.ctx=n}else this.ctx=t;this.colorMap={...$u},this.realToCanvasMat=vT.identity()}configure(t){if(t.colorOverrides)this.colorMap={...this.colorMap,...t.colorOverrides,copper:{...this.colorMap.copper,...t.colorOverrides.copper},copperPour:{...this.colorMap.copperPour,...t.colorOverrides.copperPour},silkscreen:{...this.colorMap.silkscreen,...t.colorOverrides.silkscreen},soldermask:{...this.colorMap.soldermask,...t.colorOverrides.soldermask},soldermaskWithCopperUnderneath:{...this.colorMap.soldermaskWithCopperUnderneath,...t.colorOverrides.soldermaskWithCopperUnderneath},soldermaskOverCopper:{...this.colorMap.soldermaskOverCopper,...t.colorOverrides.soldermaskOverCopper},soldermaskOverHole:{...this.colorMap.soldermaskOverHole,...t.colorOverrides.soldermaskOverHole}}}setCameraBounds(t){let n=this.ctx.canvas,{width:o,height:r}=n,i=t.maxX-t.minX,s=t.maxY-t.minY,a=o/i,c=r/s,l=Math.min(a,c),h=(o-i*l)/2,d=(r-s*l)/2;this.realToCanvasMat=vT.compose(vT.translate(h,d),vT.scale(l,-l),vT.translate(-t.minX,-t.maxY))}drawElements(t,n={}){this.ctx.boardOwnerMap=n2e([...n.clipContextElements??[],...t]),t=[...t,...dNi(t,this.ctx,n.clipContextElements)];let o=uNi(n.layers),r=t.find((b)=>b.type==="pcb_board"),i=t.find((b)=>b.type==="pcb_panel");if(i)bDi({ctx:this.ctx,panel:i,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap,drawBoardMaterial:!1});let s=n.drawBoardMaterial??!1,a=n.drawSoldermask??!1,c=n.drawSolderPaste??!1,l=n.drawSoldermaskTop!==void 0||n.drawSoldermaskBottom!==void 0,h=n.drawSolderPasteTop!==void 0||n.drawSolderPasteBottom!==void 0,d=a&&(n.drawSoldermaskTop??!l),u=a&&(n.drawSoldermaskBottom??!1),_=c&&(n.drawSolderPasteTop??!h)&&t.some((b)=>b.type==="pcb_solder_paste"&&b.layer==="top"),p=c&&(n.drawSolderPasteBottom??!1)&&t.some((b)=>b.type==="pcb_solder_paste"&&b.layer==="bottom"),m=d||_,A=t.filter((b)=>o4(b,n)&&b.type==="pcb_via"&&mte(b,o)),g=t.filter((b)=>o4(b,n)&&b.type==="pcb_hole"),f=t.filter((b)=>o4(b,n)&&b.type==="pcb_plated_hole"&&mte(b,o)),y=t.filter((b)=>o4(b,n)&&b.type==="pcb_cutout"),x=(n.clipContextElements??t).filter((b)=>o4(b,n)&&b.type==="pcb_copper_pour"),C=t.filter((b)=>o4(b,n)&&b.type==="pcb_trace");if(r)uTi({ctx:this.ctx,board:r,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap,drawBoardMaterial:s,minBoardOutlineStrokePx:n.minBoardOutlineStrokePx});for(let b of t){if(!o4(b,n))continue;if(b.type==="pcb_copper_pour")Qut({ctx:this.ctx,pour:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap})}for(let b of t){if(!o4(b,n))continue;if(b.type==="pcb_smtpad")ODi({ctx:this.ctx,pad:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap,holes:g,platedHoles:f,vias:A,cutouts:y});if(b.type==="pcb_copper_text")RTi({ctx:this.ctx,text:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap})}if(m){Qjn({ctx:this.ctx,traces:C,copperPours:x,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap,vias:A,platedHoles:f,renderLayers:n.layers});for(let b of t){if(!o4(b,n))continue;if(b.type==="pcb_hole")yjn({ctx:this.ctx,hole:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap,soldermaskMargin:d?b.soldermask_margin:void 0,drawSoldermask:d});if(b.type==="pcb_plated_hole"&&mte(b,o))Sjn({ctx:this.ctx,hole:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap,soldermaskMargin:d?b.soldermask_margin:void 0,drawSoldermask:d,layer:o});if(b.type==="pcb_via"&&mte(b,o))kjn({ctx:this.ctx,via:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap,layer:o})}}if(d)Njn({ctx:this.ctx,elements:t,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap,layer:"top",drawSoldermask:!0});if(_)for(let b of t){if(b.type!=="pcb_solder_paste"||b.layer!=="top")continue;Ejn({ctx:this.ctx,solderPaste:b,realToCanvasMat:this.realToCanvasMat})}for(let b of t){if(!o4(b,n))continue;if(b.type==="pcb_silkscreen_text")FDi({ctx:this.ctx,text:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap});if(b.type==="pcb_silkscreen_rect")kDi({ctx:this.ctx,rect:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap});if(b.type==="pcb_silkscreen_circle")SDi({ctx:this.ctx,circle:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap});if(b.type==="pcb_silkscreen_line")MDi({ctx:this.ctx,line:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap});if(b.type==="pcb_silkscreen_path")DDi({ctx:this.ctx,path:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap});if(b.type==="pcb_silkscreen_pill")RDi({ctx:this.ctx,pill:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap});if(b.type==="pcb_silkscreen_oval")BDi({ctx:this.ctx,oval:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap});if(b.type==="pcb_silkscreen_graphic")PDi({ctx:this.ctx,graphic:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap})}if(!m)Qjn({ctx:this.ctx,traces:C,copperPours:x,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap,vias:A,platedHoles:f,renderLayers:n.layers});for(let b of t){if(!o4(b,n))continue;if(b.type==="pcb_hole"&&!m)yjn({ctx:this.ctx,hole:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap,soldermaskMargin:d?b.soldermask_margin:void 0,drawSoldermask:d})}for(let b of t){if(!o4(b,n))continue;if(b.type==="pcb_plated_hole"&&!m&&mte(b,o))Sjn({ctx:this.ctx,hole:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap,soldermaskMargin:d?b.soldermask_margin:void 0,drawSoldermask:d,layer:o});if(b.type==="pcb_via"&&!m&&mte(b,o))kjn({ctx:this.ctx,via:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap,layer:o})}if(u)Njn({ctx:this.ctx,elements:t,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap,layer:"bottom",drawSoldermask:!0});if(p)for(let b of t){if(b.type!=="pcb_solder_paste"||b.layer!=="bottom")continue;Ejn({ctx:this.ctx,solderPaste:b,realToCanvasMat:this.realToCanvasMat})}for(let b of t){if(!o4(b,n))continue;if(b.type==="pcb_cutout")OTi({ctx:this.ctx,cutout:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap})}for(let b of t){if(!o4(b,n))continue;if(b.type==="pcb_keepout")mDi({ctx:this.ctx,keepout:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap});if(b.type==="pcb_fabrication_note_text")JTi({ctx:this.ctx,text:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap});if(b.type==="pcb_fabrication_note_rect")$Ti({ctx:this.ctx,rect:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap});let I=n.showPcbNotes??!0;if(I&&b.type==="pcb_note_rect")yDi({realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap,ctx:this.ctx,rect:b});if(b.type==="pcb_fabrication_note_path")KTi({ctx:this.ctx,path:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap});if(I&&b.type==="pcb_note_path")fDi({ctx:this.ctx,path:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap});if(I&&b.type==="pcb_note_text")CDi({ctx:this.ctx,text:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap});if(I&&b.type==="pcb_note_line")ADi({ctx:this.ctx,line:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap});if(I&&b.type==="pcb_note_dimension")gDi({ctx:this.ctx,pcbNoteDimension:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap});if(b.type==="pcb_fabrication_note_dimension")jTi({ctx:this.ctx,pcbFabricationNoteDimension:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap});if(b.type==="pcb_courtyard_circle")kTi({ctx:this.ctx,circle:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap});if(b.type==="pcb_courtyard_rect")zTi({ctx:this.ctx,rect:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap});if(b.type==="pcb_courtyard_outline")HTi({ctx:this.ctx,outline:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap})}if(n.clearDrillHoles)this.clearDrillHoles(t,o);if(n.showDebugObjects){let b=new Map;for(let I of t){if(I.type!=="pcb_debug_object")continue;let v=I.shape==="rect"?`${I.center.x}:${I.center.y}:${I.size.width}:${I.size.height}`:void 0,P=v?b.get(v)??0:0;if(GTi({ctx:this.ctx,debugObject:I,realToCanvasMat:this.realToCanvasMat,labelStackIndex:P}),v)b.set(v,P+1)}}}clearDrillHoles(t,n){let o=t.filter((a)=>a.type==="pcb_hole"||a.type==="pcb_plated_hole"||a.type==="pcb_via"||a.type==="pcb_cutout");if(o.length===0)return;let r="rgba(0,0,0,0)",i=new e(this.ctx);i.realToCanvasMat=this.realToCanvasMat,i.configure({colorOverrides:{copper:{top:r,bottom:r,inner1:r,inner2:r,inner3:r,inner4:r,inner5:r,inner6:r,inner7:r,inner8:r},drill:"#000"}}),this.ctx.save(),this.ctx.globalCompositeOperation="destination-out";let s=this.ctx.boardOwnerMap;i.drawElements(o,{layers:[`${n}_copper`],showPcbNotes:!1}),this.ctx.boardOwnerMap=s,this.ctx.restore()}};er();er();er();var vto=at(ln(),1),rU=at(ln(),1);var Eto=at(lo(),1);be();be();be();be();var spe=an([ce(2),ce(3),ce(3.5),ce(4),ce(5),ce(5.5),ce(6),ce(8)]),hKn=bt(["male","female"]);function dKn({diameter:e,gender:t,pinCount:n=1,pitch:o=e+2}){let r=e*2,i=e+(t==="female"?1:0.6);return{kind:t==="male"?"bullet_male":"bullet_female",diameter:e,contactDepth:r,pinCount:n,pitch:o,bodyWidth:i+(n-1)*o,bodyHeight:i,bodyDepth:r+e*1.5}}var pNi=bt(["usb_c","jst_sh","jst_ph","us_mains","bullet","adaptercable"]),sC=ge().finite().positive(),uKn=k().regex(/^#[0-9a-fA-F]{6}$/),jG={bodyWidth:sC,bodyHeight:sC,bodyDepth:sC},gMe=ss("kind",[Ee({kind:ce("bullet_male"),...jG,diameter:spe,pinCount:ge().int().min(1).max(16).default(1),pitch:sC,contactDepth:sC}).strict(),Ee({kind:ce("bullet_female"),...jG,diameter:spe,pinCount:ge().int().min(1).max(16).default(1),pitch:sC,contactDepth:sC}).strict(),Ee({kind:ce("usb_c_plug"),...jG,shellWidth:sC,shellHeight:sC,shellDepth:sC}).strict(),Ee({kind:ce("jst_sh_housing"),...jG,pinCount:ge().int().min(2).max(15),pitch:ce(1)}).strict(),Ee({kind:ce("jst_ph_housing"),...jG,pinCount:ge().int().min(2).max(16),pitch:ce(2)}).strict(),Ee({kind:ce("nema_5_15p"),...jG}).strict(),Ee({kind:ce("iec_c13"),...jG}).strict()]),_Kn=ss("kind",[Ee({kind:ce("round_jacket"),diameter:sC,color:uKn}).strict(),Ee({kind:ce("wire_bundle"),wires:st(Ee({diameter:sC,color:uKn}).strict()).min(2),wirePitch:sC}).strict()]),ipe=Ee({standard:pNi,connectorA:gMe,connectorB:gMe,crossSection:_Kn}).strict().superRefine((e,t)=>{let{connectorA:n,connectorB:o,crossSection:r}=e,i={usb_c:["usb_c_plug","usb_c_plug"],jst_sh:["jst_sh_housing","jst_sh_housing"],jst_ph:["jst_ph_housing","jst_ph_housing"],us_mains:["nema_5_15p","iec_c13"],bullet:[n.kind,o.kind],adaptercable:[n.kind,o.kind]}[e.standard];if(n.kind!==i[0]||o.kind!==i[1])t.addIssue({code:Gt.custom,message:"Connector kinds must match the cable standard"});if(e.standard==="bullet"){if(!("diameter"in n)||!("diameter"in o)||n.diameter!==o.diameter||"pinCount"in n&&"pinCount"in o&&n.pinCount!==o.pinCount)t.addIssue({code:Gt.custom,message:"Bullet connectors require supported nominal diameters and matching contact counts"});if("pinCount"in n&&(n.pinCount===1&&r.kind!=="round_jacket"||n.pinCount>1&&r.kind!=="wire_bundle"))t.addIssue({code:Gt.custom,message:"Bullet cables require one insulated wire per contact"});for(let s of[n,o])if("diameter"in s&&(s.bodyHeight<=s.diameter||s.pitch<s.bodyHeight||Math.abs(s.bodyWidth-(s.bodyHeight+(s.pinCount-1)*s.pitch))>0.000001||r.kind==="wire_bundle"&&(r.wirePitch!==s.pitch||r.wires.some((a)=>a.diameter>s.bodyHeight))||s.contactDepth>=s.bodyDepth||r.kind==="round_jacket"&&r.diameter>s.bodyHeight))t.addIssue({code:Gt.custom,message:"Bullet contact, body, and wire dimensions must fit"})}else if(e.standard!=="adaptercable"&&(("diameter"in n)||("diameter"in o)))t.addIssue({code:Gt.custom,message:"Bullet connectors require the bullet cable standard"});if(e.standard==="adaptercable"){if("pinCount"in n&&"pinCount"in o&&n.pinCount!==o.pinCount)t.addIssue({code:Gt.custom,message:"Adapter connector pin counts must match"});if("pinCount"in n&&"pinCount"in o&&n.pinCount>1&&r.kind!=="wire_bundle")t.addIssue({code:Gt.custom,message:"Adapter cables require one wire per explicit contact"});for(let s of[n,o])if("diameter"in s&&(s.bodyHeight<=s.diameter||s.pitch<s.bodyHeight||Math.abs(s.bodyWidth-(s.bodyHeight+(s.pinCount-1)*s.pitch))>0.000001||s.contactDepth>=s.bodyDepth||s.pinCount===1&&(r.kind!=="round_jacket"||r.diameter>s.bodyHeight)||s.pinCount>1&&(r.kind!=="wire_bundle"||r.wires.some((a)=>a.diameter>s.bodyHeight))))t.addIssue({code:Gt.custom,message:"Bullet contact, body, and wire dimensions must fit"})}if(r.kind==="wire_bundle"){for(let s of[n,o]){if(!("pinCount"in s)||s.pinCount!==r.wires.length)t.addIssue({code:Gt.custom,message:"Bundle wire count must match each connector pin count"});if("pitch"in s&&r.wires.some((a)=>a.diameter>s.pitch))t.addIssue({code:Gt.custom,message:"Insulated wires must fit each connector pitch"})}if(r.wires.some((s)=>s.diameter>r.wirePitch))t.addIssue({code:Gt.custom,message:"Bundle wires must not overlap in the cross section"})}else if(e.standard==="jst_sh"||e.standard==="jst_ph")t.addIssue({code:Gt.custom,message:"JST cables require a wire bundle"})}),gKn=Ee({standard:ce("adaptercable"),connectorA:gMe,connectorB:gMe,crossSection:_Kn.optional()}).strict(),AKn=k().regex(/^#[0-9a-fA-F]{6}$/),zut={jacketDiameter:ge().finite().positive().default(4),color:AKn.default("#263449")},mNi=ss("standard",[Ee({standard:ce("bullet"),diameter:spe,pinCount:ge().int().min(1).max(16).default(1),genderA:hKn.default("male"),genderB:hKn.default("female"),wireDiameter:ge().finite().positive().default(2),color:AKn.default("#263449")}).strict(),Ee({standard:ce("usb_c"),...zut}).strict(),Ee({standard:ce("jst_sh"),pinCount:ge().int().min(2).max(15).default(4),wireDiameter:ge().finite().min(0.4).max(0.8).default(0.6)}).strict(),Ee({standard:ce("jst_ph"),pinCount:ge().int().min(2).max(16).default(2),wireDiameter:ge().finite().min(0.8).max(1.5).default(1.2)}).strict(),Ee({standard:ce("us_mains"),...zut,jacketDiameter:zut.jacketDiameter.default(6.2)}).strict(),gKn]),pKn=["#df4049","#263449","#e1b13c","#347dc9","#27a782","#af62bd"];function fKn(e){let t=gKn.parse({standard:"adaptercable",...e}),{connectorA:n,connectorB:o}=t,r="pinCount"in n&&"pinCount"in o&&n.pinCount>1,i=[n,o].flatMap((a)=>("pitch"in a)?[a.pitch]:[]),s=Math.min(2,...i.map((a)=>a*0.6));return ipe.parse({...t,crossSection:t.crossSection??(r?{kind:"wire_bundle",wirePitch:Math.max(...i),wires:Array.from({length:n.pinCount},(a,c)=>({diameter:s,color:pKn[c%pKn.length]}))}:{kind:"round_jacket",diameter:Math.min(4,n.bodyHeight,o.bodyHeight,...i.map((a)=>Math.min(2,a*0.6))),color:"#263449"})})}var _Me=["#df4049","#263449","#e1b13c","#347dc9","#27a782","#af62bd"];function $L(e){let t=mNi.parse(e);if(t.standard==="adaptercable")return fKn(t);if(t.standard==="bullet"){let r=t.diameter+2;return ipe.parse({standard:"bullet",connectorA:dKn({diameter:t.diameter,gender:t.genderA,pinCount:t.pinCount,pitch:r}),connectorB:dKn({diameter:t.diameter,gender:t.genderB,pinCount:t.pinCount,pitch:r}),crossSection:t.pinCount===1?{kind:"round_jacket",diameter:t.wireDiameter,color:t.color}:{kind:"wire_bundle",wirePitch:r,wires:Array.from({length:t.pinCount},(i,s)=>({diameter:t.wireDiameter,color:_Me[s%_Me.length]}))}})}if(t.standard==="usb_c"){let r={kind:"usb_c_plug",bodyWidth:12,bodyHeight:6,bodyDepth:18,shellWidth:8.25,shellHeight:2.4,shellDepth:6.5};return ipe.parse({standard:t.standard,connectorA:r,connectorB:{...r},crossSection:{kind:"round_jacket",diameter:t.jacketDiameter,color:t.color}})}if(t.standard==="us_mains")return ipe.parse({standard:t.standard,connectorA:{kind:"nema_5_15p",bodyWidth:32,bodyHeight:28,bodyDepth:35},connectorB:{kind:"iec_c13",bodyWidth:24,bodyHeight:18,bodyDepth:30},crossSection:{kind:"round_jacket",diameter:t.jacketDiameter,color:t.color}});let n=t.standard==="jst_sh",o={kind:n?"jst_sh_housing":"jst_ph_housing",pinCount:t.pinCount,pitch:n?1:2,bodyWidth:n?t.pinCount+1:(t.pinCount-1)*2+3.8,bodyHeight:n?2.8:4.5,bodyDepth:n?5:6.85};return ipe.parse({standard:t.standard,connectorA:o,connectorB:{...o},crossSection:{kind:"wire_bundle",wirePitch:o.pitch,wires:Array.from({length:t.pinCount},(r,i)=>({diameter:t.wireDiameter,color:_Me[i%_Me.length]}))}})}function mKn(e){let t=e.trim().toLowerCase(),n=/^bullet([1-9][0-9]*)?_(.+)$/.exec(t);if(n){let r,i,s=new Set;for(let a of n[2].split("_")){let c=/^d([0-9]+(?:\.[0-9]+)?)mm$/.exec(a)??/^g(male|female)$/.exec(a),l=a[0];if(!c||s.has(l))throw Error(`Invalid or duplicate connector parameter: "${a}"`);if(s.add(l),l==="d")r=Number(c[1]);else i=c[1]}if(r===void 0||i===void 0)throw Error("Bullet connector strings require dNmm and gmale or gfemale");return $L({standard:"bullet",diameter:spe.parse(r),pinCount:n[1]?Number(n[1]):1,genderA:i}).connectorA}let o=/^(jst_sh|jst_ph)(?:_pins([0-9]+))?$/.exec(t);if(o)return $L({standard:o[1],...o[2]?{pinCount:Number(o[2])}:{}}).connectorA;if(t==="usb_c")return $L({standard:"usb_c"}).connectorA;if(t==="nema_5_15p")return $L({standard:"us_mains"}).connectorA;if(t==="iec_c13")return $L({standard:"us_mains"}).connectorB;throw Error(`Unsupported connector string: "${e}"`)}function yKn(e){let t=e.trim().toLowerCase();if(t.startsWith("adaptercable")){let r=/^adaptercable_(a|b)\(([^()]+)\)_(a|b)\(([^()]+)\)$/.exec(t);if(!r||r[1]===r[3])throw Error("Adapter cables require exactly one named a(CONNECTOR) and b(CONNECTOR)");let i=mKn(r[2]),s=mKn(r[4]);return fKn({connectorA:r[1]==="a"?i:s,connectorB:r[1]==="b"?i:s})}if(t==="usb_c"||t==="us_mains")return $L({standard:t});let n=/^bullet([1-9][0-9]*)?_(.+)$/.exec(t);if(n){let r,i,s,a=new Set;for(let c of n[2].split("_")){let l=/^d([0-9]+(?:\.[0-9]+)?)mm$/.exec(c)??/^(a|b)(male|female)$/.exec(c),h=c[0];if(!l||a.has(h))throw Error(`Invalid or duplicate bullet parameter: "${c}"`);if(a.add(h),h==="d")r=Number(l[1]);else if(h==="a")i=l[2];else s=l[2]}if(r===void 0)throw Error("Bullet cables require dNmm");return $L({standard:"bullet",diameter:spe.parse(r),pinCount:n[1]?Number(n[1]):1,genderA:i??"male",genderB:s??"female"})}let o=/^(jst_sh|jst_ph)(?:_pins([0-9]+))?$/.exec(t);if(o)return $L({standard:o[1],...o[2]?{pinCount:Number(o[2])}:{}});throw Error(`Unsupported cable string: "${e}". Expected usb_c, jst_sh[_pinsN], jst_ph[_pinsN], us_mains, bullet[CONTACTS]_dNmm[_amale][_bfemale], or adaptercable_a(CONNECTOR)_b(CONNECTOR).`)}var Vut=at(n4(),1),bKn=at(n4(),1),hpe=at(n4(),1),qL={moldedPlastic:{metalness:0,roughness:0.7},rubber:{metalness:0,roughness:0.9},sleeve:{metalness:0,roughness:0.45},tinnedLead:{metalness:0.8,roughness:0.55},goldContact:{metalness:1,roughness:0.25},copper:{metalness:1,roughness:0.35},brushedMetal:{metalness:1,roughness:0.4},steel:{metalness:1,roughness:0.25}},vx=(e,t)=>[e[0]+t[0],e[1]+t[1],e[2]+t[2]],cpe=(e,t)=>[e[0]-t[0],e[1]-t[1],e[2]-t[2]],pm=(e,t)=>[e[0]*t,e[1]*t,e[2]*t],yte=(e,t)=>e[0]*t[0]+e[1]*t[1]+e[2]*t[2],xte=(e,t)=>[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]];function PT(e){let t=Math.hypot(...e);if(t<0.0000000001)throw Error("Cable path must not contain coincident points or a reversing tangent");return pm(e,1/t)}function Out(e,{startPin1Side:t,endPin1Side:n}={}){if(e.length<2||e.some((_)=>_.length!==3||!_.every(Number.isFinite)))throw Error("Cable path needs at least two finite 3D points");let o=e.slice(1).map((_,p)=>PT(cpe(_,e[p]))),r=e.map((_,p)=>p===0?o[0]:p===e.length-1?o.at(-1):PT(vx(o[p-1],o[p]))),i=Math.abs(r[0][2])>0.95?[0,1,0]:[0,0,1],s=(_,p)=>{if(_.length!==3||!_.every(Number.isFinite)||Math.hypot(..._)<0.0000000001)throw Error("Connector pin 1 side must be a finite nonzero vector");let m=pm(PT(_),-1);if(Math.abs(yte(m,p))>0.00001)throw Error("Connector pin 1 side must be perpendicular to its path tangent");return PT(cpe(m,pm(p,yte(m,p))))},a=t?s(t,r[0]):PT(xte(i,r[0])),c=r.map((_,p)=>{if(p>0){let m=r[p-1],A=xte(m,_),g=Math.hypot(...A),f=Math.max(-1,Math.min(1,yte(m,_)));if(g>0.0000000001){let y=pm(A,1/g);a=PT(vx(vx(pm(a,f),pm(xte(y,a),g)),pm(y,yte(y,a)*(1-f))))}}return{point:e[p],tangent:_,normal:a,binormal:PT(xte(_,a))}});if(!n)return c;let l=c.at(-1),h=s(n,l.tangent),d=Math.atan2(yte(l.tangent,xte(l.normal,h)),yte(l.normal,h)),u=[0];for(let _=1;_<e.length;_++)u.push(u[_-1]+Math.hypot(...cpe(e[_],e[_-1])));return c.map((_,p)=>{let m=d*(t?u[p]/u.at(-1):1),A=PT(vx(pm(_.normal,Math.cos(m)),pm(_.binormal,Math.sin(m))));return{..._,normal:A,binormal:PT(xte(_.tangent,A))}})}function r4({geometry:e,color:t,name:n,material:o}){let r=bKn.default.geometries.geom3.toPolygons(e),i=[],s=[],a=new Map;for(let c of r){let l=[];for(let h of c.vertices){let d=h.map((_)=>_.toFixed(8)).join(","),u=a.get(d);if(u===void 0)u=i.length/3,i.push(...h),a.set(d,u);l.push(u)}for(let h=1;h<l.length-1;h++)s.push(l[0],l[h],l[h+1])}return{name:n,positions:i,indices:s,color:t,material:o,smooth:!1}}function _Ni({mesh:e,frame:t,wireExitDepth:n,isEnd:o}){let r=pm(t.tangent,o?-1:1),i=o?pm(t.binormal,-1):t.binormal,s=vx(t.point,pm(r,-n)),a=[];for(let c=0;c<e.positions.length;c+=3)a.push(...vx(s,vx(vx(pm(t.normal,e.positions[c]),pm(i,e.positions[c+1])),pm(r,e.positions[c+2]))));return{...e,positions:a}}function gNi(e){let{cylinder:t,sphere:n,cuboid:o}=Vut.default.primitives,{subtract:r,union:i}=Vut.default.booleans,{diameter:s,contactDepth:a,bodyDepth:c,kind:l}=e,h=e.bodyHeight,d=s/2,u=l==="bullet_male"?i(n({radius:d,center:[0,0,d],segments:32}),t({radius:d,height:a-d,center:[0,0,(a+d)/2],segments:32})):r(t({radius:h/2,height:a,center:[0,0,a/2],segments:32}),t({radius:d,height:a-s/4+0.1,center:[0,0,(a-s/4-0.1)/2],segments:32}));if(l==="bullet_male")u=r(u,o({size:[s+0.2,s*0.08,a*0.65],center:[0,0,a*0.45]}),o({size:[s*0.08,s+0.2,a*0.65],center:[0,0,a*0.45]}));let _=c-a,p=r(t({radius:h/2,height:_,center:[0,0,a+_/2],segments:32}),t({radius:d*0.75,height:_*0.8+0.1,center:[0,0,c-_*0.4+0.05],segments:32})),m=[r4({geometry:u,material:qL.goldContact,color:[0.83,0.64,0.22,1],name:l==="bullet_male"?"bullet-pin":"bullet-socket"}),r4({geometry:p,material:qL.goldContact,color:[0.83,0.64,0.22,1],name:"solder-cup"})],A=e.pinCount??1;return Array.from({length:A},(g,f)=>{let y=(f-(A-1)/2)*(e.pitch??h);return m.map((x)=>({...x,name:A===1?x.name:`${x.name}-${f+1}`,positions:x.positions.map((C,b)=>b%3===0?C+y:C)}))}).flat()}var{cuboid:ET,roundedCuboid:Yut,cylinder:lpe,roundedRectangle:AMe,polygon:ANi,sphere:fNi}=hpe.default.primitives,{extrudeLinear:ape}=hpe.default.extrusions,{translate:yMe,rotateY:yNi}=hpe.default.transforms,{subtract:Cte,union:IKn}=hpe.default.booleans,xMe=[0.055,0.07,0.09,1],xNi=[0.86,0.84,0.75,1],vKn=[0.6,0.64,0.7,1],fMe=[0.66,0.46,0.18,1];function SKn(e){if(e.kind==="usb_c_plug")return e.shellDepth+e.bodyDepth;if(e.kind==="nema_5_15p")return 19.05+e.bodyDepth;return e.bodyDepth}function CNi(e){let{bodyWidth:t,bodyHeight:n,bodyDepth:o,pinCount:r,pitch:i}=e,s=i===1?0.55:1.05,a=Array.from({length:r},(u,_)=>{let p=(_-(r-1)/2)*i;return ET({size:[s,s*1.35,o-0.6],center:[p,0,(o-0.6)/2-0.02]})}),c=Array.from({length:r},(u,_)=>lpe({radius:i*0.34,height:1.3,segments:16,center:[(_-(r-1)/2)*i,0,o-0.5]})),l=ET({size:[t*0.45,0.5,o*0.5],center:[0,n/2,o*0.65]}),h=Cte(Yut({size:[t,n,o],center:[0,0,o/2],roundRadius:0.1,segments:8}),...a,...c,l,...Array.from({length:r},(u,_)=>ET({size:[s*0.8,n*0.7,o*0.24],center:[(_-(r-1)/2)*i,n/2,o*0.7]}))),d=Array.from({length:r},(u,_)=>{let p=(_-(r-1)/2)*i;return r4({material:qL.goldContact,name:`contact-${_+1}`,color:vKn,geometry:Cte(ET({size:[s*0.92,s*1.25,o*0.65],center:[p,0,o*0.45]}),ET({size:[s*0.92-0.12,s*1.25-0.12,o*0.65+0.2],center:[p,0,o*0.45]}))})});return[r4({geometry:h,color:xNi,name:"housing"}),...d]}function bNi(e){let{shellWidth:t,shellHeight:n,shellDepth:o,bodyWidth:r,bodyHeight:i,bodyDepth:s}=e,a=Cte(ape({height:o},AMe({size:[t,n],roundRadius:n/2-0.02,segments:32})),yMe([0,0,-0.1],ape({height:o+0.2},AMe({size:[t-0.4,n-0.4],roundRadius:(n-0.4)/2-0.02,segments:32})))),c=Cte(ape({height:o},AMe({size:[t-0.41,n-0.41],roundRadius:0.85,segments:32})),yMe([0,0,-0.1],ape({height:o-0.3},AMe({size:[t-0.8,n-0.8],roundRadius:0.65,segments:32})))),l=Yut({size:[r,i,s],center:[0,0,o+s/2],roundRadius:Math.min(1.3,i/4),segments:16}),h=Array.from({length:24},(d,u)=>ET({size:[0.22,0.08,3.5],center:[(u%12-5.5)*0.5,u<12?0.77:-0.77,2.6]}));return[r4({geometry:l,color:xMe,name:"overmold"}),r4({geometry:a,color:vKn,material:qL.brushedMetal,name:"shell"}),r4({geometry:c,color:[0.025,0.026,0.03,1],name:"liner"}),...h.map((d,u)=>r4({geometry:d,color:fMe,material:qL.goldContact,name:`contact-${u+1}`}))]}function INi(e){let{bodyWidth:t,bodyHeight:n,bodyDepth:o,kind:r}=e,s=Yut({size:[t,n,o],center:[0,0,(r==="nema_5_15p"?19.05:0)+o/2],roundRadius:2,segments:16});if(r==="nema_5_15p"){let l=[-6.35,6.35].map((d)=>{let u=ET({size:[1.524,6.35,15.875],center:[d,2.7,11.1125]}),_=yMe([d,2.7,7.3],yNi(Math.PI/2,lpe({radius:1.1,height:3,segments:20})));return Cte(u,_)}),h=IKn(lpe({radius:2.38125,height:16.66875,center:[0,-9.20625,10.715625000000001],segments:32}),fNi({radius:2.38125,center:[0,-9.20625,2.38125],segments:32}));return[r4({geometry:s,color:xMe,name:"plug-body"}),...l.map((d,u)=>r4({geometry:d,color:fMe,material:qL.goldContact,name:`blade-${u+1}`})),r4({geometry:h,color:fMe,material:qL.goldContact,name:"ground-pin"})]}let a=yMe([0,0,-0.1],ape({height:3.2},ANi({points:[[-9,-6],[9,-6],[9,2],[5,6],[-5,6],[-9,2]]}))),c=[[-4.4,-1.8,8],[4.4,-1.8,8],[0,3.1,8]];return s=Cte(s,a,...c.map((l)=>ET({size:[2.3,3.4,16.2],center:l}))),[r4({geometry:s,color:xMe,name:"appliance-body"}),...c.map(([l,h],d)=>r4({geometry:ET({size:[0.15,2.8,6],center:[l-1.05,h,7.8]}),color:fMe,material:qL.goldContact,name:`socket-contact-${d+1}`}))]}function vNi({connector:e,jacketDiameter:t}){let n=e.kind==="usb_c_plug"?bNi(e):e.kind==="bullet_male"||e.kind==="bullet_female"?gNi(e):e.kind==="jst_sh_housing"||e.kind==="jst_ph_housing"?CNi(e):INi(e);if(t!==void 0&&e.kind!=="bullet_male"&&e.kind!=="bullet_female"){let o=SKn(e),r=IKn(lpe({radius:t/2+0.15,height:5,center:[0,0,o+2.5],segments:32}),...Array.from({length:7},(i,s)=>lpe({radius:t/2+0.8-s*0.06,height:0.28,center:[0,0,o+0.4+s*0.7],segments:32})));n.push(r4({geometry:r,color:xMe,name:"strain-relief"}))}return n}function SNi(e){let t=[0];for(let c=1;c<e.length;c++)t.push(t[c-1]+Math.hypot(...cpe(e[c],e[c-1])));let n=t.at(-1),o=Math.min(20,n/3),r=[...t,n/2];for(let c=0;c<=10;c++){let l=o*c/10;r.push(l,n-l)}let i=r.sort((c,l)=>c-l).filter((c,l,h)=>l===0||c-h[l-1]>0.000000001),s=0;return{path:i.map((c)=>{while(s<e.length-2&&c>t[s+1])s++;let l=(c-t[s])/(t[s+1]-t[s]);return vx(e[s],pm(cpe(e[s+1],e[s]),l))}),distances:i,length:n,endLength:o}}function xKn({frames:e,diameter:t,offset:n=0,radialSegments:o,color:r,name:i}){let s=[],a=[];for(let d of e){let u=vx(d.point,pm(d.normal,n));for(let _=0;_<o;_++){let p=_*Math.PI*2/o;s.push(...vx(u,vx(pm(d.normal,t*Math.cos(p)/2),pm(d.binormal,t*Math.sin(p)/2))))}}for(let d=0;d<e.length-1;d++)for(let u=0;u<o;u++){let _=d*o+u,p=d*o+(u+1)%o,m=_+o,A=p+o;a.push(_,p,m,p,A,m)}let c=s.length/3;s.push(...vx(e[0].point,pm(e[0].normal,n)));let l=s.length/3;s.push(...vx(e.at(-1).point,pm(e.at(-1).normal,n)));let h=(e.length-1)*o;for(let d=0;d<o;d++){let u=(d+1)%o;a.push(c,u,d,l,h+d,h+u)}return{name:i,positions:s,indices:a,color:r,smooth:!0}}function CKn(e){if(!/^#[a-f\d]{6}$/i.test(e))throw Error("Cable colors must be six-digit hex strings");return[parseInt(e.slice(1,3),16)/255,parseInt(e.slice(3,5),16)/255,parseInt(e.slice(5,7),16)/255,1]}function PNi(e){for(let o of[e.connectorA,e.connectorB]){let r=[o.bodyWidth,o.bodyHeight,o.bodyDepth];if(o.kind==="usb_c_plug")r.push(o.shellWidth,o.shellHeight,o.shellDepth);if(o.kind==="bullet_male"||o.kind==="bullet_female"){let i=o.pinCount??1,s=o.pitch??o.bodyHeight;if(r.push(o.diameter,o.contactDepth,s),!Number.isInteger(i)||i<1||i>16||o.bodyHeight<=o.diameter||s<o.bodyHeight||Math.abs(o.bodyWidth-(o.bodyHeight+(i-1)*s))>0.000001||o.contactDepth>=o.bodyDepth||o.contactDepth<=o.diameter/2)throw Error("Bullet contact must fit inside its cylindrical body");if(i===1&&(e.crossSection.kind!=="round_jacket"||e.crossSection.diameter>o.bodyHeight)||i>1&&(e.crossSection.kind!=="wire_bundle"||e.crossSection.wires.length!==i||e.crossSection.wires.some((a)=>a.diameter>o.bodyHeight)))throw Error("Bullet cables require one insulated wire per contact that fits its solder cup")}if(r.some((i)=>!Number.isFinite(i)||i<=0))throw Error("Connector dimensions must be finite and positive");if((o.kind==="jst_sh_housing"||o.kind==="jst_ph_housing")&&(!Number.isInteger(o.pinCount)||o.pinCount<2||!Number.isFinite(o.pitch)||o.pitch<=0))throw Error("JST connectors need a positive pitch and at least two contacts")}let t=e.crossSection,n=t.kind==="round_jacket"?[t.diameter]:t.wires.map((o)=>o.diameter);if(n.length===0||n.some((o)=>!Number.isFinite(o)||o<=0))throw Error("Cable diameters must be finite and positive");if(t.kind==="wire_bundle"){if(!Number.isFinite(t.wirePitch)||t.wires.some((o)=>o.diameter>t.wirePitch))throw Error("Insulated bundle wires must not overlap");for(let o of[e.connectorA,e.connectorB]){if(!("pinCount"in o)||(o.pinCount??1)!==t.wires.length)throw Error("Bundle wire count must match connector contact count");if("pitch"in o&&t.wires.some((r)=>r.diameter>o.pitch))throw Error("Insulated wires must fit each connector pitch")}}}function PKn({definition:e,path:t,radialSegments:n=24,startPin1Side:o,endPin1Side:r}){if(PNi(e),!Number.isInteger(n)||n<8||n>128)throw Error("radialSegments must be an integer from 8 to 128");let i=Out(t,{startPin1Side:o,endPin1Side:r}),s=e.crossSection,a=s.kind==="round_jacket"?s.diameter:void 0,c="pitch"in e.connectorA?e.connectorA.pitch:void 0,l="pitch"in e.connectorB?e.connectorB.pitch:void 0,h=c!==l&&s.kind==="wire_bundle"?SNi(t):void 0,d=h?Out(h.path,{startPin1Side:o,endPin1Side:r}):i,u=s.kind==="round_jacket"?[xKn({frames:i,diameter:s.diameter,radialSegments:n,color:CKn(s.color),name:"jacket"})]:s.wires.map((_,p)=>{let m=p-(s.wires.length-1)/2,A=Math.min(s.wirePitch,c??s.wirePitch,l??s.wirePitch,1.2*Math.max(...s.wires.map((y)=>y.diameter))),g=(y)=>y*y*(3-2*y),f=h?Out(d.map((y,x)=>{let C=h.distances[x],b=1-g(Math.min(1,C/h.endLength)),I=1-g(Math.min(1,(h.length-C)/h.endLength)),v=A+((c??s.wirePitch)-A)*b+((l??s.wirePitch)-A)*I;return vx(y.point,pm(y.normal,m*v))})):i;return xKn({frames:f,diameter:_.diameter,offset:(h?0:m)*s.wirePitch,radialSegments:n,color:CKn(_.color),name:`wire-${p+1}`})});for(let[_,p]of[e.connectorA,e.connectorB].entries()){let m=_===0?i[0]:i.at(-1),A=vNi({connector:p,jacketDiameter:a});u.push(...A.map((g)=>_Ni({mesh:{...g,name:`${_===0?"A":"B"}-${g.name}`},frame:m,isEnd:_===1,wireExitDepth:SKn(p)})))}return u}var jwe=at(ln(),1);er();er();er();var TT=at(lo(),1),Y1=at(ln(),1);er();var p4=at(ln(),1);er();er();er();var lC=at(lo(),1),_C=at(ln(),1),Gto=at(ln(),1),$6=at(ln(),1),Xpt=at(lo(),1),q6=at(ln(),1),jto=at(ln(),1),Wv=at(ln(),1),Xte=at(ln(),1),Jto=at(ln(),1),Zto=at(z7(),1),P2=at(ln(),1),ano=at(lo(),1),Oi=at(ln(),1),Xv=at(ln(),1),JMe=at(lo(),1),aA=at(ln(),1),nH=at(lo(),1),$we=at(ln(),1),hji=at(lo(),1),Qd=at(ln(),1),eme=at(ln(),1),pno=at(lo(),1),Ano=at(ln(),1),Dp=at(ln(),1),nmt=at(lo(),1),rmt=at(ln(),1),U1=at(ln(),1);var og=at(ln(),1),Hno=at(ln(),1),Fno=at(z7(),1),Ono=at(ln(),1),Qte=at(lo(),1),oBe=at(ln(),1),$no=at(z7(),1),qno=at(lo(),1),v2=at(ln(),1),Jno=at(ln(),1),ff=at(ln(),1),KKi=at(ln(),1),rBe=at(ln(),1),aH=at(lo(),1),sBe=at(ln(),1),W1=at(ln(),1),moo=at(ln(),1),aBe=at(ln(),1),_oo=at(ln(),1),D0=at(ln(),1),$te=at(ln(),1),foo=at(ln(),1),kc=at(lo(),1),mC=at(lo(),1),Lpe=at(ln(),1),Voo=at(lo(),1),iwe=at(ln(),1),$0t=at(ln(),1),zT=at(lo(),1),Lr=at(lo(),1);var Yr=at(lo(),1),OT=at(ln(),1),GT=at(ln(),1),mm=at(lo(),1);var bte=at(ln(),1),U6=at(ln(),1),MT=at(ln(),1);var ENi={data:""},MNi=(e)=>{if(typeof window=="object"){let t=(e?e.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return t.nonce=window.__nonce__,t.parentNode||(e||document.head).appendChild(t),t.firstChild}return e||ENi};var wNi=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,BNi=/\/\*[^]*?\*\/|  +/g,EKn=/\n+/g,ZL=(e,t)=>{let n="",o="",r="";for(let i in e){let s=e[i];i[0]=="@"?i[1]=="i"?n=i+" "+s+";":o+=i[1]=="f"?ZL(s,i):i+"{"+ZL(s,i[1]=="k"?"":t)+"}":typeof s=="object"?o+=ZL(s,t?t.replace(/([^,])+/g,(a)=>i.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,(c)=>/&/.test(c)?c.replace(/&/g,a):a?a+" "+c:c)):i):s!=null&&(i=i[1]=="-"?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),r+=ZL.p?ZL.p(i,s):i+":"+s+";")}return n+(t&&r?t+"{"+r+"}":r)+o},JL={},MKn=(e)=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+MKn(e[n]);return t}return e},TNi=(e,t,n,o,r)=>{let i=MKn(e),s=JL[i]||(JL[i]=((c)=>{let l=0,h=11;for(;l<c.length;)h=101*h+c.charCodeAt(l++)>>>0;return"go"+h})(i));if(!JL[s]){let c=i!==e?e:((l)=>{let h,d,u=[{}];for(;h=wNi.exec(l.replace(BNi,""));)h[4]?u.shift():h[3]?(d=h[3].replace(EKn," ").trim(),u.unshift(u[0][d]=u[0][d]||{})):u[0][h[1]]=h[2].replace(EKn," ").trim();return u[0]})(e);JL[s]=ZL(r?{["@keyframes "+s]:c}:c,n?"":"."+s)}let a=n&&JL.g;return n&&(JL.g=JL[s]),((c,l,h,d)=>{d?l.data=l.data.replace(d,c):l.data.indexOf(c)===-1&&(l.data=h?c+l.data:l.data+c)})(JL[s],t,o,a),s},DNi=(e,t,n)=>e.reduce((o,r,i)=>{let s=t[i];if(s&&s.call){let a=s(n),c=a&&a.props&&a.props.className||/^go/.test(a)&&a;s=c?"."+c:a&&typeof a=="object"?a.props?"":ZL(a,""):a===!1?"":a}return o+r+(s==null?"":s)},"");function dpe(e){let t=this||{},n=e.call?e(t.p):e;return TNi(n.unshift?n.raw?DNi(n,[].slice.call(arguments,1),t.p):n.reduce((o,r)=>Object.assign(o,r&&r.call?r(t.p):r),{}):n,MNi(t.target),t.g,t.o,t.k)}var wKn,Gut,Uut,NPa=dpe.bind({g:1}),i4=dpe.bind({k:1});function BKn(e,t,n,o){ZL.p=t,wKn=e,Gut=n,Uut=o}function aC(e,t){let n=this||{};return function(){let o=arguments;function r(i,s){let a=Object.assign({},i),c=a.className||r.className;n.p=Object.assign({theme:Gut&&Gut()},a),n.o=/go\d/.test(c),a.className=dpe.apply(n,o)+(c?" "+c:""),t&&(a.ref=s);let l=e;return e[0]&&(l=a.as||e,delete a.as),Uut&&l[0]&&Uut(a),wKn(l,a)}return t?t(r):r}}var KG=at(ln(),1);var eH=at(ln(),1),NNi=(e)=>typeof e=="function",IMe=(e,t)=>NNi(e)?e(t):e,RNi=(()=>{let e=0;return()=>(++e).toString()})(),TKn=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),QNi=20,Wut="default",DKn=(e,t)=>{let{toastLimit:n}=e.settings;switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,n)};case 1:return{...e,toasts:e.toasts.map((s)=>s.id===t.toast.id?{...s,...t.toast}:s)};case 2:let{toast:o}=t;return DKn(e,{type:e.toasts.find((s)=>s.id===o.id)?1:0,toast:o});case 3:let{toastId:r}=t;return{...e,toasts:e.toasts.map((s)=>s.id===r||r===void 0?{...s,dismissed:!0,visible:!1}:s)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter((s)=>s.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let i=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map((s)=>({...s,pauseDuration:s.pauseDuration+i}))}}},bMe=[],NKn={toasts:[],pausedAt:void 0,settings:{toastLimit:QNi}},uE={},RKn=(e,t=Wut)=>{uE[t]=DKn(uE[t]||NKn,e),bMe.forEach(([n,o])=>{n===t&&o(uE[t])})},QKn=(e)=>Object.keys(uE).forEach((t)=>RKn(e,t)),kNi=(e)=>Object.keys(uE).find((t)=>uE[t].toasts.some((n)=>n.id===e)),vMe=(e=Wut)=>(t)=>{RKn(t,e)},LNi={blank:4000,error:4000,success:2000,loading:1/0,custom:4000},HNi=(e={},t=Wut)=>{let[n,o]=bte.useState(uE[t]||NKn),r=bte.useRef(uE[t]);bte.useEffect(()=>(r.current!==uE[t]&&o(uE[t]),bMe.push([t,o]),()=>{let s=bMe.findIndex(([a])=>a===t);s>-1&&bMe.splice(s,1)}),[t]);let i=n.toasts.map((s)=>{var a,c,l;return{...e,...e[s.type],...s,removeDelay:s.removeDelay||((a=e[s.type])==null?void 0:a.removeDelay)||(e==null?void 0:e.removeDelay),duration:s.duration||((c=e[s.type])==null?void 0:c.duration)||(e==null?void 0:e.duration)||LNi[s.type],style:{...e.style,...(l=e[s.type])==null?void 0:l.style,...s.style}}});return{...n,toasts:i}},FNi=(e,t="blank",n)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...n,id:(n==null?void 0:n.id)||RNi()}),upe=(e)=>(t,n)=>{let o=FNi(t,e,n);return vMe(o.toasterId||kNi(o.id))({type:2,toast:o}),o.id},Z_=(e,t)=>upe("blank")(e,t);Z_.error=upe("error");Z_.success=upe("success");Z_.loading=upe("loading");Z_.custom=upe("custom");Z_.dismiss=(e,t)=>{let n={type:3,toastId:e};t?vMe(t)(n):QKn(n)};Z_.dismissAll=(e)=>Z_.dismiss(void 0,e);Z_.remove=(e,t)=>{let n={type:4,toastId:e};t?vMe(t)(n):QKn(n)};Z_.removeAll=(e)=>Z_.remove(void 0,e);Z_.promise=(e,t,n)=>{let o=Z_.loading(t.loading,{...n,...n==null?void 0:n.loading});return typeof e=="function"&&(e=e()),e.then((r)=>{let i=t.success?IMe(t.success,r):void 0;return i?Z_.success(i,{id:o,...n,...n==null?void 0:n.success}):Z_.dismiss(o),r}).catch((r)=>{let i=t.error?IMe(t.error,r):void 0;i?Z_.error(i,{id:o,...n,...n==null?void 0:n.error}):Z_.dismiss(o)}),e};var zNi=1000,ONi=(e,t="default")=>{let{toasts:n,pausedAt:o}=HNi(e,t),r=U6.useRef(new Map).current,i=U6.useCallback((d,u=zNi)=>{if(r.has(d))return;let _=setTimeout(()=>{r.delete(d),s({type:4,toastId:d})},u);r.set(d,_)},[]);U6.useEffect(()=>{if(o)return;let d=Date.now(),u=n.map((_)=>{if(_.duration===1/0)return;let p=(_.duration||0)+_.pauseDuration-(d-_.createdAt);if(p<0){_.visible&&Z_.dismiss(_.id);return}return setTimeout(()=>Z_.dismiss(_.id,t),p)});return()=>{u.forEach((_)=>_&&clearTimeout(_))}},[n,o,t]);let s=U6.useCallback(vMe(t),[t]),a=U6.useCallback(()=>{s({type:5,time:Date.now()})},[s]),c=U6.useCallback((d,u)=>{s({type:1,toast:{id:d,height:u}})},[s]),l=U6.useCallback(()=>{o&&s({type:6,time:Date.now()})},[o,s]),h=U6.useCallback((d,u)=>{let{reverseOrder:_=!1,gutter:p=8,defaultPosition:m}=u||{},A=n.filter((y)=>(y.position||m)===(d.position||m)&&y.height),g=A.findIndex((y)=>y.id===d.id),f=A.filter((y,x)=>x<g&&y.visible).length;return A.filter((y)=>y.visible).slice(..._?[f+1]:[0,f]).reduce((y,x)=>y+(x.height||0)+p,0)},[n]);return U6.useEffect(()=>{n.forEach((d)=>{if(d.dismissed)i(d.id,d.removeDelay);else{let u=r.get(d.id);u&&(clearTimeout(u),r.delete(d.id))}})},[n,i]),{toasts:n,handlers:{updateHeight:c,startPause:a,endPause:l,calculateOffset:h}}},VNi=i4` from { transform: scale(0) rotate(45deg); opacity: 0; } to { transform: scale(1) rotate(45deg); opacity: 1; }`,YNi=i4` from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; }`,GNi=i4` from { transform: scale(0) rotate(90deg); opacity: 0; } to { transform: scale(1) rotate(90deg); opacity: 1; }`,UNi=aC("div")` width: 20px; opacity: 0; height: 20px; border-radius: 10px; background: ${(e)=>e.primary||"#ff4b4b"}; position: relative; transform: rotate(45deg); animation: ${VNi} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; animation-delay: 100ms; &:after, &:before { content: ''; animation: ${YNi} 0.15s ease-out forwards; animation-delay: 150ms; position: absolute; border-radius: 3px; opacity: 0; background: ${(e)=>e.secondary||"#fff"}; bottom: 9px; left: 4px; height: 2px; width: 12px; } &:before { animation: ${GNi} 0.15s ease-out forwards; animation-delay: 180ms; transform: rotate(90deg); } `,WNi=i4` from { transform: rotate(0deg); } to { transform: rotate(360deg); } `,XNi=aC("div")` width: 12px; height: 12px; box-sizing: border-box; border: 2px solid; border-radius: 100%; border-color: ${(e)=>e.secondary||"#e0e0e0"}; border-right-color: ${(e)=>e.primary||"#616161"}; animation: ${WNi} 1s linear infinite; `,jNi=i4` from { transform: scale(0) rotate(45deg); opacity: 0; } to { transform: scale(1) rotate(45deg); opacity: 1; }`,KNi=i4` 0% { height: 0; width: 0; opacity: 0; } 40% { height: 0; width: 6px; opacity: 1; } 100% { opacity: 1; height: 10px; }`,$Ni=aC("div")` width: 20px; opacity: 0; height: 20px; border-radius: 10px; background: ${(e)=>e.primary||"#61d345"}; position: relative; transform: rotate(45deg); animation: ${jNi} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; animation-delay: 100ms; &:after { content: ''; box-sizing: border-box; animation: ${KNi} 0.2s ease-out forwards; opacity: 0; animation-delay: 200ms; position: absolute; border-right: 2px solid; border-bottom: 2px solid; border-color: ${(e)=>e.secondary||"#fff"}; bottom: 6px; left: 6px; height: 10px; width: 6px; } `,qNi=aC("div")` position: absolute; `,JNi=aC("div")` position: relative; display: flex; justify-content: center; align-items: center; min-width: 20px; min-height: 20px; `,ZNi=i4` from { transform: scale(0.6); opacity: 0.4; } to { transform: scale(1); opacity: 1; }`,eRi=aC("div")` position: relative; transform: scale(0.6); opacity: 0.4; min-width: 20px; animation: ${ZNi} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; `,tRi=({toast:e})=>{let{icon:t,type:n,iconTheme:o}=e;return t!==void 0?typeof t=="string"?KG.createElement(eRi,null,t):t:n==="blank"?null:KG.createElement(JNi,null,KG.createElement(XNi,{...o}),n!=="loading"&&KG.createElement(qNi,null,n==="error"?KG.createElement(UNi,{...o}):KG.createElement($Ni,{...o})))},nRi=(e)=>` 0% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;} 100% {transform: translate3d(0,0,0) scale(1); opacity:1;} `,oRi=(e)=>` 0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;} 100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;} `,rRi="0%{opacity:0;} 100%{opacity:1;}",iRi="0%{opacity:1;} 100%{opacity:0;}",sRi=aC("div")` :where(&) { display: flex; align-items: center; background: #fff; color: #363636; line-height: 1.3; will-change: transform; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05); max-width: 350px; pointer-events: auto; padding: 8px 10px; border-radius: 8px; } `,aRi=aC("div")` display: flex; justify-content: center; margin: 4px 10px; color: inherit; flex: 1 1 auto; white-space: pre-line; `,cRi=(e,t)=>{let n=e.includes("top")?1:-1,[o,r]=TKn()?[rRi,iRi]:[nRi(n),oRi(n)];return{animation:t?`${i4(o)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${i4(r)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},lRi=MT.memo(({toast:e,position:t,style:n,children:o})=>{let r=e.height?cRi(e.position||t||"top-center",e.visible):{opacity:0},i=MT.createElement(tRi,{toast:e}),s=MT.createElement(aRi,{...e.ariaProps},IMe(e.message,e));return MT.createElement(sRi,{className:e.className,style:{...r,...n,...e.style}},typeof o=="function"?o({icon:i,message:s}):MT.createElement(MT.Fragment,null,i,s))});BKn(eH.createElement);var hRi=({id:e,className:t,style:n,onHeightUpdate:o,children:r})=>{let i=eH.useCallback((s)=>{if(s){let a=()=>{let c=s.getBoundingClientRect().height;o(e,c)};a(),new MutationObserver(a).observe(s,{subtree:!0,childList:!0,characterData:!0})}},[e,o]);return eH.createElement("div",{ref:i,className:t,style:n},r)},dRi=(e,t)=>{let n=e.includes("top"),o=n?{top:0}:{bottom:0},r=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:TKn()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...o,...r}},uRi=dpe` z-index: 9999; > * { pointer-events: auto; } `,CMe=16,kKn=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:o,children:r,toasterId:i,containerStyle:s,containerClassName:a})=>{let{toasts:c,handlers:l}=ONi(n,i);return eH.createElement("div",{"data-rht-toaster":i||"",style:{position:"fixed",zIndex:9999,top:CMe,left:CMe,right:CMe,bottom:CMe,pointerEvents:"none",...s},className:a,onMouseEnter:l.startPause,onMouseLeave:l.endPause},c.map((h)=>{let d=h.position||t,u=l.calculateOffset(h,{reverseOrder:e,gutter:o,defaultPosition:t}),_=dRi(d,u);return eH.createElement(hRi,{id:h.id,key:h.id,onHeightUpdate:l.updateHeight,className:h.visible?uRi:"",style:_},h.type==="custom"?IMe(h.message,h):r?r(h):eH.createElement(lRi,{toast:h,position:d}))}))};var Jte=at(lo(),1),Uoo=at(ln(),1),G1=at(ln(),1),Woo=at(ln(),1);er();var u4=at(lo(),1);var dBe=at(ln(),1),{create:pRi,defineProperty:vwe,getOwnPropertyDescriptor:mRi,getOwnPropertyNames:tpt,getPrototypeOf:_Ri}=Object,gRi=Object.prototype.hasOwnProperty,$v=(e,t)=>function(){return e&&(t=(0,e[tpt(e)[0]])(e=0)),t},At=(e,t)=>function(){return t||(0,e[tpt(e)[0]])((t={exports:{}}).exports,t),t.exports},qv=(e,t)=>{for(var n in t)vwe(e,n,{get:t[n],enumerable:!0})},V$n=(e,t,n,o)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let r of tpt(t))if(!gRi.call(e,r)&&r!==n)vwe(e,r,{get:()=>t[r],enumerable:!(o=mRi(t,r))||o.enumerable})}return e},ih=(e,t,n)=>(n=e!=null?pRi(_Ri(e)):{},V$n(t||!e||!e.__esModule?vwe(n,"default",{value:e,enumerable:!0}):n,e)),ARi=(e)=>V$n(vwe({},"__esModule",{value:!0}),e),Rs=At({"node_modules/@jscad/modeling/src/utils/flatten.js"(e,t){var n=(o)=>o.flat(1/0);t.exports=n}}),fRi=At({"node_modules/@jscad/modeling/src/geometries/geom2/clone.js"(e,t){var n=(o)=>Object.assign({},o);t.exports=n}}),yRi=At({"node_modules/@jscad/modeling/src/maths/mat4/add.js"(e,t){var n=(o,r,i)=>(o[0]=r[0]+i[0],o[1]=r[1]+i[1],o[2]=r[2]+i[2],o[3]=r[3]+i[3],o[4]=r[4]+i[4],o[5]=r[5]+i[5],o[6]=r[6]+i[6],o[7]=r[7]+i[7],o[8]=r[8]+i[8],o[9]=r[9]+i[9],o[10]=r[10]+i[10],o[11]=r[11]+i[11],o[12]=r[12]+i[12],o[13]=r[13]+i[13],o[14]=r[14]+i[14],o[15]=r[15]+i[15],o);t.exports=n}}),npt=At({"node_modules/@jscad/modeling/src/maths/mat4/create.js"(e,t){var n=()=>[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];t.exports=n}}),xRi=At({"node_modules/@jscad/modeling/src/maths/mat4/clone.js"(e,t){var n=npt(),o=(r)=>{let i=n();return i[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=r[3],i[4]=r[4],i[5]=r[5],i[6]=r[6],i[7]=r[7],i[8]=r[8],i[9]=r[9],i[10]=r[10],i[11]=r[11],i[12]=r[12],i[13]=r[13],i[14]=r[14],i[15]=r[15],i};t.exports=o}}),Y$n=At({"node_modules/@jscad/modeling/src/maths/mat4/copy.js"(e,t){var n=(o,r)=>(o[0]=r[0],o[1]=r[1],o[2]=r[2],o[3]=r[3],o[4]=r[4],o[5]=r[5],o[6]=r[6],o[7]=r[7],o[8]=r[8],o[9]=r[9],o[10]=r[10],o[11]=r[11],o[12]=r[12],o[13]=r[13],o[14]=r[14],o[15]=r[15],o);t.exports=n}}),CRi=At({"node_modules/@jscad/modeling/src/maths/mat4/invert.js"(e,t){var n=(o,r)=>{let i=r[0],s=r[1],a=r[2],c=r[3],l=r[4],h=r[5],d=r[6],u=r[7],_=r[8],p=r[9],m=r[10],A=r[11],g=r[12],f=r[13],y=r[14],x=r[15],C=i*h-s*l,b=i*d-a*l,I=i*u-c*l,v=s*d-a*h,P=s*u-c*h,M=a*u-c*d,B=_*f-p*g,T=_*y-m*g,N=_*x-A*g,D=p*y-m*f,L=p*x-A*f,H=m*x-A*y,V=C*H-b*L+I*D+v*N-P*T+M*B;if(!V)return null;return V=1/V,o[0]=(h*H-d*L+u*D)*V,o[1]=(a*L-s*H-c*D)*V,o[2]=(f*M-y*P+x*v)*V,o[3]=(m*P-p*M-A*v)*V,o[4]=(d*N-l*H-u*T)*V,o[5]=(i*H-a*N+c*T)*V,o[6]=(y*I-g*M-x*b)*V,o[7]=(_*M-m*I+A*b)*V,o[8]=(l*L-h*N+u*B)*V,o[9]=(s*N-i*L-c*B)*V,o[10]=(g*P-f*I+x*C)*V,o[11]=(p*I-_*P-A*C)*V,o[12]=(h*T-l*D-d*B)*V,o[13]=(i*D-s*T+a*B)*V,o[14]=(f*b-g*v-y*C)*V,o[15]=(_*v-p*b+m*C)*V,o};t.exports=n}}),bRi=At({"node_modules/@jscad/modeling/src/maths/mat4/equals.js"(e,t){var n=(o,r)=>o[0]===r[0]&&o[1]===r[1]&&o[2]===r[2]&&o[3]===r[3]&&o[4]===r[4]&&o[5]===r[5]&&o[6]===r[6]&&o[7]===r[7]&&o[8]===r[8]&&o[9]===r[9]&&o[10]===r[10]&&o[11]===r[11]&&o[12]===r[12]&&o[13]===r[13]&&o[14]===r[14]&&o[15]===r[15];t.exports=n}}),Lc=At({"node_modules/@jscad/modeling/src/maths/constants.js"(e,t){var n=1e5,o=0.00001,r=0.0000000000001,i=Math.PI*2;t.exports={EPS:o,NEPS:r,TAU:i,spatialResolution:n}}}),S2=At({"node_modules/@jscad/modeling/src/maths/utils/trigonometry.js"(e,t){var{NEPS:n}=Lc(),o=(s)=>Math.abs(s)<n?0:s,r=(s)=>o(Math.sin(s)),i=(s)=>o(Math.cos(s));t.exports={sin:r,cos:i}}}),G$n=At({"node_modules/@jscad/modeling/src/maths/mat4/identity.js"(e,t){var n=(o)=>(o[0]=1,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=1,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=1,o[11]=0,o[12]=0,o[13]=0,o[14]=0,o[15]=1,o);t.exports=n}}),U$n=At({"node_modules/@jscad/modeling/src/maths/mat4/fromRotation.js"(e,t){var{EPS:n}=Lc(),{sin:o,cos:r}=S2(),i=G$n(),s=(a,c,l)=>{let[h,d,u]=l,_=h*h+d*d+u*u;if(Math.abs(_)<n)return i(a);let p=1/Math.sqrt(_);h*=p,d*=p,u*=p;let m=o(c),A=r(c),g=1-A;return a[0]=h*h*g+A,a[1]=d*h*g+u*m,a[2]=u*h*g-d*m,a[3]=0,a[4]=h*d*g-u*m,a[5]=d*d*g+A,a[6]=u*d*g+h*m,a[7]=0,a[8]=h*u*g+d*m,a[9]=d*u*g-h*m,a[10]=u*u*g+A,a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1,a};t.exports=s}}),IRi=At({"node_modules/@jscad/modeling/src/maths/mat4/fromScaling.js"(e,t){var n=(o,r)=>(o[0]=r[0],o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=r[1],o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=r[2],o[11]=0,o[12]=0,o[13]=0,o[14]=0,o[15]=1,o);t.exports=n}}),vRi=At({"node_modules/@jscad/modeling/src/maths/mat4/fromTaitBryanRotation.js"(e,t){var{sin:n,cos:o}=S2(),r=(i,s,a,c)=>{let l=n(s),h=o(s),d=n(a),u=o(a),_=n(c),p=o(c);return i[0]=u*h,i[1]=u*l,i[2]=-d,i[3]=0,i[4]=_*d*h-p*l,i[5]=p*h+_*d*l,i[6]=_*u,i[7]=0,i[8]=_*l+p*d*h,i[9]=p*d*l-_*h,i[10]=p*u,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i};t.exports=r}}),SRi=At({"node_modules/@jscad/modeling/src/maths/mat4/fromTranslation.js"(e,t){var n=(o,r)=>(o[0]=1,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=1,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=1,o[11]=0,o[12]=r[0],o[13]=r[1],o[14]=r[2],o[15]=1,o);t.exports=n}}),PRi=At({"node_modules/@jscad/modeling/src/maths/mat4/fromValues.js"(e,t){var n=npt(),o=(r,i,s,a,c,l,h,d,u,_,p,m,A,g,f,y)=>{let x=n();return x[0]=r,x[1]=i,x[2]=s,x[3]=a,x[4]=c,x[5]=l,x[6]=h,x[7]=d,x[8]=u,x[9]=_,x[10]=p,x[11]=m,x[12]=A,x[13]=g,x[14]=f,x[15]=y,x};t.exports=o}}),W$n=At({"node_modules/@jscad/modeling/src/maths/vec3/abs.js"(e,t){var n=(o,r)=>(o[0]=Math.abs(r[0]),o[1]=Math.abs(r[1]),o[2]=Math.abs(r[2]),o);t.exports=n}}),X$n=At({"node_modules/@jscad/modeling/src/maths/vec3/add.js"(e,t){var n=(o,r,i)=>(o[0]=r[0]+i[0],o[1]=r[1]+i[1],o[2]=r[2]+i[2],o);t.exports=n}}),Swe=At({"node_modules/@jscad/modeling/src/maths/vec3/dot.js"(e,t){var n=(o,r)=>o[0]*r[0]+o[1]*r[1]+o[2]*r[2];t.exports=n}}),ERi=At({"node_modules/@jscad/modeling/src/maths/vec3/angle.js"(e,t){var n=Swe(),o=(r,i)=>{let s=r[0],a=r[1],c=r[2],l=i[0],h=i[1],d=i[2],u=Math.sqrt(s*s+a*a+c*c),_=Math.sqrt(l*l+h*h+d*d),p=u*_,m=p&&n(r,i)/p;return Math.acos(Math.min(Math.max(m,-1),1))};t.exports=o}}),Pwe=At({"node_modules/@jscad/modeling/src/maths/vec3/create.js"(e,t){var n=()=>[0,0,0];t.exports=n}}),MRi=At({"node_modules/@jscad/modeling/src/maths/vec3/clone.js"(e,t){var n=Pwe(),o=(r)=>{let i=n();return i[0]=r[0],i[1]=r[1],i[2]=r[2],i};t.exports=o}}),j$n=At({"node_modules/@jscad/modeling/src/maths/vec3/copy.js"(e,t){var n=(o,r)=>(o[0]=r[0],o[1]=r[1],o[2]=r[2],o);t.exports=n}}),Hpe=At({"node_modules/@jscad/modeling/src/maths/vec3/cross.js"(e,t){var n=(o,r,i)=>{let s=r[0],a=r[1],c=r[2],l=i[0],h=i[1],d=i[2];return o[0]=a*d-c*h,o[1]=c*l-s*d,o[2]=s*h-a*l,o};t.exports=n}}),K$n=At({"node_modules/@jscad/modeling/src/maths/vec3/distance.js"(e,t){var n=(o,r)=>{let i=r[0]-o[0],s=r[1]-o[1],a=r[2]-o[2];return Math.sqrt(i*i+s*s+a*a)};t.exports=n}}),wRi=At({"node_modules/@jscad/modeling/src/maths/vec3/divide.js"(e,t){var n=(o,r,i)=>(o[0]=r[0]/i[0],o[1]=r[1]/i[1],o[2]=r[2]/i[2],o);t.exports=n}}),BRi=At({"node_modules/@jscad/modeling/src/maths/vec3/equals.js"(e,t){var n=(o,r)=>o[0]===r[0]&&o[1]===r[1]&&o[2]===r[2];t.exports=n}}),TRi=At({"node_modules/@jscad/modeling/src/maths/vec3/fromScalar.js"(e,t){var n=(o,r)=>(o[0]=r,o[1]=r,o[2]=r,o);t.exports=n}}),DRi=At({"node_modules/@jscad/modeling/src/maths/vec3/fromValues.js"(e,t){var n=Pwe(),o=(r,i,s)=>{let a=n();return a[0]=r,a[1]=i,a[2]=s,a};t.exports=o}}),NRi=At({"node_modules/@jscad/modeling/src/maths/vec3/fromVec2.js"(e,t){var n=(o,r,i=0)=>(o[0]=r[0],o[1]=r[1],o[2]=i,o);t.exports=n}}),$$n=At({"node_modules/@jscad/modeling/src/maths/vec3/length.js"(e,t){var n=(o)=>{let r=o[0],i=o[1],s=o[2];return Math.sqrt(r*r+i*i+s*s)};t.exports=n}}),RRi=At({"node_modules/@jscad/modeling/src/maths/vec3/lerp.js"(e,t){var n=(o,r,i,s)=>(o[0]=r[0]+s*(i[0]-r[0]),o[1]=r[1]+s*(i[1]-r[1]),o[2]=r[2]+s*(i[2]-r[2]),o);t.exports=n}}),q$n=At({"node_modules/@jscad/modeling/src/maths/vec3/max.js"(e,t){var n=(o,r,i)=>(o[0]=Math.max(r[0],i[0]),o[1]=Math.max(r[1],i[1]),o[2]=Math.max(r[2],i[2]),o);t.exports=n}}),J$n=At({"node_modules/@jscad/modeling/src/maths/vec3/min.js"(e,t){var n=(o,r,i)=>(o[0]=Math.min(r[0],i[0]),o[1]=Math.min(r[1],i[1]),o[2]=Math.min(r[2],i[2]),o);t.exports=n}}),QRi=At({"node_modules/@jscad/modeling/src/maths/vec3/multiply.js"(e,t){var n=(o,r,i)=>(o[0]=r[0]*i[0],o[1]=r[1]*i[1],o[2]=r[2]*i[2],o);t.exports=n}}),kRi=At({"node_modules/@jscad/modeling/src/maths/vec3/negate.js"(e,t){var n=(o,r)=>(o[0]=-r[0],o[1]=-r[1],o[2]=-r[2],o);t.exports=n}}),opt=At({"node_modules/@jscad/modeling/src/maths/vec3/normalize.js"(e,t){var n=(o,r)=>{let i=r[0],s=r[1],a=r[2],c=i*i+s*s+a*a;if(c>0)c=1/Math.sqrt(c);return o[0]=i*c,o[1]=s*c,o[2]=a*c,o};t.exports=n}}),LRi=At({"node_modules/@jscad/modeling/src/maths/vec3/orthogonal.js"(e,t){var n=W$n(),o=Pwe(),r=Hpe(),i=(s,a)=>{let c=n(o(),a),l=0+(c[0]<c[1]&&c[0]<c[2]),h=0+(c[1]<=c[0]&&c[1]<c[2]),d=0+(c[2]<=c[0]&&c[2]<=c[1]);return r(s,a,[l,h,d])};t.exports=i}}),HRi=At({"node_modules/@jscad/modeling/src/maths/vec3/rotateX.js"(e,t){var n=(o,r,i,s)=>{let a=[],c=[];return a[0]=r[0]-i[0],a[1]=r[1]-i[1],a[2]=r[2]-i[2],c[0]=a[0],c[1]=a[1]*Math.cos(s)-a[2]*Math.sin(s),c[2]=a[1]*Math.sin(s)+a[2]*Math.cos(s),o[0]=c[0]+i[0],o[1]=c[1]+i[1],o[2]=c[2]+i[2],o};t.exports=n}}),FRi=At({"node_modules/@jscad/modeling/src/maths/vec3/rotateY.js"(e,t){var n=(o,r,i,s)=>{let a=[],c=[];return a[0]=r[0]-i[0],a[1]=r[1]-i[1],a[2]=r[2]-i[2],c[0]=a[2]*Math.sin(s)+a[0]*Math.cos(s),c[1]=a[1],c[2]=a[2]*Math.cos(s)-a[0]*Math.sin(s),o[0]=c[0]+i[0],o[1]=c[1]+i[1],o[2]=c[2]+i[2],o};t.exports=n}}),zRi=At({"node_modules/@jscad/modeling/src/maths/vec3/rotateZ.js"(e,t){var n=(o,r,i,s)=>{let a=[],c=[];return a[0]=r[0]-i[0],a[1]=r[1]-i[1],c[0]=a[0]*Math.cos(s)-a[1]*Math.sin(s),c[1]=a[0]*Math.sin(s)+a[1]*Math.cos(s),o[0]=c[0]+i[0],o[1]=c[1]+i[1],o[2]=r[2],o};t.exports=n}}),Z$n=At({"node_modules/@jscad/modeling/src/maths/vec3/scale.js"(e,t){var n=(o,r,i)=>(o[0]=r[0]*i,o[1]=r[1]*i,o[2]=r[2]*i,o);t.exports=n}}),ORi=At({"node_modules/@jscad/modeling/src/maths/vec3/snap.js"(e,t){var n=(o,r,i)=>(o[0]=Math.round(r[0]/i)*i+0,o[1]=Math.round(r[1]/i)*i+0,o[2]=Math.round(r[2]/i)*i+0,o);t.exports=n}}),eqn=At({"node_modules/@jscad/modeling/src/maths/vec3/squaredDistance.js"(e,t){var n=(o,r)=>{let i=r[0]-o[0],s=r[1]-o[1],a=r[2]-o[2];return i*i+s*s+a*a};t.exports=n}}),tqn=At({"node_modules/@jscad/modeling/src/maths/vec3/squaredLength.js"(e,t){var n=(o)=>{let r=o[0],i=o[1],s=o[2];return r*r+i*i+s*s};t.exports=n}}),Ewe=At({"node_modules/@jscad/modeling/src/maths/vec3/subtract.js"(e,t){var n=(o,r,i)=>(o[0]=r[0]-i[0],o[1]=r[1]-i[1],o[2]=r[2]-i[2],o);t.exports=n}}),VRi=At({"node_modules/@jscad/modeling/src/maths/vec3/toString.js"(e,t){var n=(o)=>`[${o[0].toFixed(7)}, ${o[1].toFixed(7)}, ${o[2].toFixed(7)}]`;t.exports=n}}),YRi=At({"node_modules/@jscad/modeling/src/maths/vec3/transform.js"(e,t){var n=(o,r,i)=>{let s=r[0],a=r[1],c=r[2],l=i[3]*s+i[7]*a+i[11]*c+i[15];return l=l||1,o[0]=(i[0]*s+i[4]*a+i[8]*c+i[12])/l,o[1]=(i[1]*s+i[5]*a+i[9]*c+i[13])/l,o[2]=(i[2]*s+i[6]*a+i[10]*c+i[14])/l,o};t.exports=n}}),Ai=At({"node_modules/@jscad/modeling/src/maths/vec3/index.js"(e,t){t.exports={abs:W$n(),add:X$n(),angle:ERi(),clone:MRi(),copy:j$n(),create:Pwe(),cross:Hpe(),distance:K$n(),divide:wRi(),dot:Swe(),equals:BRi(),fromScalar:TRi(),fromValues:DRi(),fromVec2:NRi(),length:$$n(),lerp:RRi(),max:q$n(),min:J$n(),multiply:QRi(),negate:kRi(),normalize:opt(),orthogonal:LRi(),rotateX:HRi(),rotateY:FRi(),rotateZ:zRi(),scale:Z$n(),snap:ORi(),squaredDistance:eqn(),squaredLength:tqn(),subtract:Ewe(),toString:VRi(),transform:YRi()}}}),GRi=At({"node_modules/@jscad/modeling/src/maths/mat4/fromVectorRotation.js"(e,t){var n=Ai(),o=U$n(),r=(i,s,a)=>{let c=n.normalize(n.create(),s),l=n.normalize(n.create(),a),h=n.cross(n.create(),l,c),d=n.dot(l,c);if(d===-1)return o(i,Math.PI,n.orthogonal(h,c));let u=1/(1+d);return i[0]=h[0]*h[0]*u+d,i[1]=h[1]*h[0]*u-h[2],i[2]=h[2]*h[0]*u+h[1],i[3]=0,i[4]=h[0]*h[1]*u+h[2],i[5]=h[1]*h[1]*u+d,i[6]=h[2]*h[1]*u-h[0],i[7]=0,i[8]=h[0]*h[2]*u-h[1],i[9]=h[1]*h[2]*u+h[0],i[10]=h[2]*h[2]*u+d,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i};t.exports=r}}),URi=At({"node_modules/@jscad/modeling/src/maths/mat4/fromXRotation.js"(e,t){var{sin:n,cos:o}=S2(),r=(i,s)=>{let a=n(s),c=o(s);return i[0]=1,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=c,i[6]=a,i[7]=0,i[8]=0,i[9]=-a,i[10]=c,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i};t.exports=r}}),WRi=At({"node_modules/@jscad/modeling/src/maths/mat4/fromYRotation.js"(e,t){var{sin:n,cos:o}=S2(),r=(i,s)=>{let a=n(s),c=o(s);return i[0]=c,i[1]=0,i[2]=-a,i[3]=0,i[4]=0,i[5]=1,i[6]=0,i[7]=0,i[8]=a,i[9]=0,i[10]=c,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i};t.exports=r}}),XRi=At({"node_modules/@jscad/modeling/src/maths/mat4/fromZRotation.js"(e,t){var{sin:n,cos:o}=S2(),r=(i,s)=>{let a=n(s),c=o(s);return i[0]=c,i[1]=a,i[2]=0,i[3]=0,i[4]=-a,i[5]=c,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=1,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i};t.exports=r}}),jRi=At({"node_modules/@jscad/modeling/src/maths/mat4/isIdentity.js"(e,t){var n=(o)=>o[0]===1&&o[1]===0&&o[2]===0&&o[3]===0&&o[4]===0&&o[5]===1&&o[6]===0&&o[7]===0&&o[8]===0&&o[9]===0&&o[10]===1&&o[11]===0&&o[12]===0&&o[13]===0&&o[14]===0&&o[15]===1;t.exports=n}}),KRi=At({"node_modules/@jscad/modeling/src/maths/mat4/isOnlyTransformScale.js"(e,t){var n=(r)=>o(r[1])&&o(r[2])&&o(r[3])&&o(r[4])&&o(r[6])&&o(r[7])&&o(r[8])&&o(r[9])&&o(r[11])&&r[15]===1,o=(r)=>Math.abs(r)<Number.EPSILON;t.exports=n}}),$Ri=At({"node_modules/@jscad/modeling/src/maths/mat4/isMirroring.js"(e,t){var n=(o)=>{let r=o[4]*o[9]-o[8]*o[5],i=o[8]*o[1]-o[0]*o[9],s=o[0]*o[5]-o[4]*o[1];return r*o[2]+i*o[6]+s*o[10]<0};t.exports=n}}),qRi=At({"node_modules/@jscad/modeling/src/maths/mat4/mirrorByPlane.js"(e,t){var n=(o,r)=>{let[i,s,a,c]=r;return o[0]=1-2*i*i,o[1]=-2*s*i,o[2]=-2*a*i,o[3]=0,o[4]=-2*i*s,o[5]=1-2*s*s,o[6]=-2*a*s,o[7]=0,o[8]=-2*i*a,o[9]=-2*s*a,o[10]=1-2*a*a,o[11]=0,o[12]=2*i*c,o[13]=2*s*c,o[14]=2*a*c,o[15]=1,o};t.exports=n}}),JRi=At({"node_modules/@jscad/modeling/src/maths/mat4/multiply.js"(e,t){var n=(o,r,i)=>{let s=r[0],a=r[1],c=r[2],l=r[3],h=r[4],d=r[5],u=r[6],_=r[7],p=r[8],m=r[9],A=r[10],g=r[11],f=r[12],y=r[13],x=r[14],C=r[15],b=i[0],I=i[1],v=i[2],P=i[3];return o[0]=b*s+I*h+v*p+P*f,o[1]=b*a+I*d+v*m+P*y,o[2]=b*c+I*u+v*A+P*x,o[3]=b*l+I*_+v*g+P*C,b=i[4],I=i[5],v=i[6],P=i[7],o[4]=b*s+I*h+v*p+P*f,o[5]=b*a+I*d+v*m+P*y,o[6]=b*c+I*u+v*A+P*x,o[7]=b*l+I*_+v*g+P*C,b=i[8],I=i[9],v=i[10],P=i[11],o[8]=b*s+I*h+v*p+P*f,o[9]=b*a+I*d+v*m+P*y,o[10]=b*c+I*u+v*A+P*x,o[11]=b*l+I*_+v*g+P*C,b=i[12],I=i[13],v=i[14],P=i[15],o[12]=b*s+I*h+v*p+P*f,o[13]=b*a+I*d+v*m+P*y,o[14]=b*c+I*u+v*A+P*x,o[15]=b*l+I*_+v*g+P*C,o};t.exports=n}}),ZRi=At({"node_modules/@jscad/modeling/src/maths/mat4/rotate.js"(e,t){var{EPS:n}=Lc(),{sin:o,cos:r}=S2(),i=Y$n(),s=(a,c,l,h)=>{let[d,u,_]=h,p=d*d+u*u+_*_;if(Math.abs(p)<n)return i(a,c);let m=1/Math.sqrt(p);d*=m,u*=m,_*=m;let A=o(l),g=r(l),f=1-g,y=c[0],x=c[1],C=c[2],b=c[3],I=c[4],v=c[5],P=c[6],M=c[7],B=c[8],T=c[9],N=c[10],D=c[11],L=d*d*f+g,H=u*d*f+_*A,V=_*d*f-u*A,O=d*u*f-_*A,U=u*u*f+g,j=_*u*f+d*A,Y=d*_*f+u*A,X=u*_*f-d*A,K=_*_*f+g;if(a[0]=y*L+I*H+B*V,a[1]=x*L+v*H+T*V,a[2]=C*L+P*H+N*V,a[3]=b*L+M*H+D*V,a[4]=y*O+I*U+B*j,a[5]=x*O+v*U+T*j,a[6]=C*O+P*U+N*j,a[7]=b*O+M*U+D*j,a[8]=y*Y+I*X+B*K,a[9]=x*Y+v*X+T*K,a[10]=C*Y+P*X+N*K,a[11]=b*Y+M*X+D*K,c!==a)a[12]=c[12],a[13]=c[13],a[14]=c[14],a[15]=c[15];return a};t.exports=s}}),eQi=At({"node_modules/@jscad/modeling/src/maths/mat4/rotateX.js"(e,t){var{sin:n,cos:o}=S2(),r=(i,s,a)=>{let c=n(a),l=o(a),h=s[4],d=s[5],u=s[6],_=s[7],p=s[8],m=s[9],A=s[10],g=s[11];if(s!==i)i[0]=s[0],i[1]=s[1],i[2]=s[2],i[3]=s[3],i[12]=s[12],i[13]=s[13],i[14]=s[14],i[15]=s[15];return i[4]=h*l+p*c,i[5]=d*l+m*c,i[6]=u*l+A*c,i[7]=_*l+g*c,i[8]=p*l-h*c,i[9]=m*l-d*c,i[10]=A*l-u*c,i[11]=g*l-_*c,i};t.exports=r}}),tQi=At({"node_modules/@jscad/modeling/src/maths/mat4/rotateY.js"(e,t){var{sin:n,cos:o}=S2(),r=(i,s,a)=>{let c=n(a),l=o(a),h=s[0],d=s[1],u=s[2],_=s[3],p=s[8],m=s[9],A=s[10],g=s[11];if(s!==i)i[4]=s[4],i[5]=s[5],i[6]=s[6],i[7]=s[7],i[12]=s[12],i[13]=s[13],i[14]=s[14],i[15]=s[15];return i[0]=h*l-p*c,i[1]=d*l-m*c,i[2]=u*l-A*c,i[3]=_*l-g*c,i[8]=h*c+p*l,i[9]=d*c+m*l,i[10]=u*c+A*l,i[11]=_*c+g*l,i};t.exports=r}}),nQi=At({"node_modules/@jscad/modeling/src/maths/mat4/rotateZ.js"(e,t){var{sin:n,cos:o}=S2(),r=(i,s,a)=>{let c=n(a),l=o(a),h=s[0],d=s[1],u=s[2],_=s[3],p=s[4],m=s[5],A=s[6],g=s[7];if(s!==i)i[8]=s[8],i[9]=s[9],i[10]=s[10],i[11]=s[11],i[12]=s[12],i[13]=s[13],i[14]=s[14],i[15]=s[15];return i[0]=h*l+p*c,i[1]=d*l+m*c,i[2]=u*l+A*c,i[3]=_*l+g*c,i[4]=p*l-h*c,i[5]=m*l-d*c,i[6]=A*l-u*c,i[7]=g*l-_*c,i};t.exports=r}}),oQi=At({"node_modules/@jscad/modeling/src/maths/mat4/scale.js"(e,t){var n=(o,r,i)=>{let s=i[0],a=i[1],c=i[2];return o[0]=r[0]*s,o[1]=r[1]*s,o[2]=r[2]*s,o[3]=r[3]*s,o[4]=r[4]*a,o[5]=r[5]*a,o[6]=r[6]*a,o[7]=r[7]*a,o[8]=r[8]*c,o[9]=r[9]*c,o[10]=r[10]*c,o[11]=r[11]*c,o[12]=r[12],o[13]=r[13],o[14]=r[14],o[15]=r[15],o};t.exports=n}}),rQi=At({"node_modules/@jscad/modeling/src/maths/mat4/subtract.js"(e,t){var n=(o,r,i)=>(o[0]=r[0]-i[0],o[1]=r[1]-i[1],o[2]=r[2]-i[2],o[3]=r[3]-i[3],o[4]=r[4]-i[4],o[5]=r[5]-i[5],o[6]=r[6]-i[6],o[7]=r[7]-i[7],o[8]=r[8]-i[8],o[9]=r[9]-i[9],o[10]=r[10]-i[10],o[11]=r[11]-i[11],o[12]=r[12]-i[12],o[13]=r[13]-i[13],o[14]=r[14]-i[14],o[15]=r[15]-i[15],o);t.exports=n}}),iQi=At({"node_modules/@jscad/modeling/src/maths/mat4/toString.js"(e,t){var n=(o)=>o.map((r)=>r.toFixed(7)).toString();t.exports=n}}),sQi=At({"node_modules/@jscad/modeling/src/maths/mat4/translate.js"(e,t){var n=(o,r,i)=>{let s=i[0],a=i[1],c=i[2],l,h,d,u,_,p,m,A,g,f,y,x;if(r===o)o[12]=r[0]*s+r[4]*a+r[8]*c+r[12],o[13]=r[1]*s+r[5]*a+r[9]*c+r[13],o[14]=r[2]*s+r[6]*a+r[10]*c+r[14],o[15]=r[3]*s+r[7]*a+r[11]*c+r[15];else l=r[0],h=r[1],d=r[2],u=r[3],_=r[4],p=r[5],m=r[6],A=r[7],g=r[8],f=r[9],y=r[10],x=r[11],o[0]=l,o[1]=h,o[2]=d,o[3]=u,o[4]=_,o[5]=p,o[6]=m,o[7]=A,o[8]=g,o[9]=f,o[10]=y,o[11]=x,o[12]=l*s+_*a+g*c+r[12],o[13]=h*s+p*a+f*c+r[13],o[14]=d*s+m*a+y*c+r[14],o[15]=u*s+A*a+x*c+r[15];return o};t.exports=n}}),kd=At({"node_modules/@jscad/modeling/src/maths/mat4/index.js"(e,t){t.exports={add:yRi(),clone:xRi(),copy:Y$n(),create:npt(),invert:CRi(),equals:bRi(),fromRotation:U$n(),fromScaling:IRi(),fromTaitBryanRotation:vRi(),fromTranslation:SRi(),fromValues:PRi(),fromVectorRotation:GRi(),fromXRotation:URi(),fromYRotation:WRi(),fromZRotation:XRi(),identity:G$n(),isIdentity:jRi(),isOnlyTransformScale:KRi(),isMirroring:$Ri(),mirrorByPlane:qRi(),multiply:JRi(),rotate:ZRi(),rotateX:eQi(),rotateY:tQi(),rotateZ:nQi(),scale:oQi(),subtract:rQi(),toString:iQi(),translate:sQi()}}}),Mwe=At({"node_modules/@jscad/modeling/src/geometries/geom2/create.js"(e,t){var n=kd(),o=(r)=>{if(r===void 0)r=[];return{sides:r,transforms:n.create()}};t.exports=o}}),aQi=At({"node_modules/@jscad/modeling/src/maths/vec2/abs.js"(e,t){var n=(o,r)=>(o[0]=Math.abs(r[0]),o[1]=Math.abs(r[1]),o);t.exports=n}}),cQi=At({"node_modules/@jscad/modeling/src/maths/vec2/add.js"(e,t){var n=(o,r,i)=>(o[0]=r[0]+i[0],o[1]=r[1]+i[1],o);t.exports=n}}),rpt=At({"node_modules/@jscad/modeling/src/maths/vec2/angleRadians.js"(e,t){var n=(o)=>Math.atan2(o[1],o[0]);t.exports=n}}),lQi=At({"node_modules/@jscad/modeling/src/maths/vec2/angle.js"(e,t){t.exports=rpt()}}),hQi=At({"node_modules/@jscad/modeling/src/maths/vec2/angleDegrees.js"(e,t){var n=rpt(),o=(r)=>n(r)*57.29577951308232;t.exports=o}}),wwe=At({"node_modules/@jscad/modeling/src/maths/vec2/create.js"(e,t){var n=()=>[0,0];t.exports=n}}),dQi=At({"node_modules/@jscad/modeling/src/maths/vec2/clone.js"(e,t){var n=wwe(),o=(r)=>{let i=n();return i[0]=r[0],i[1]=r[1],i};t.exports=o}}),uQi=At({"node_modules/@jscad/modeling/src/maths/vec2/copy.js"(e,t){var n=(o,r)=>(o[0]=r[0],o[1]=r[1],o);t.exports=n}}),pQi=At({"node_modules/@jscad/modeling/src/maths/vec2/cross.js"(e,t){var n=(o,r,i)=>(o[0]=0,o[1]=0,o[2]=r[0]*i[1]-r[1]*i[0],o);t.exports=n}}),mQi=At({"node_modules/@jscad/modeling/src/maths/vec2/distance.js"(e,t){var n=(o,r)=>{let i=r[0]-o[0],s=r[1]-o[1];return Math.sqrt(i*i+s*s)};t.exports=n}}),_Qi=At({"node_modules/@jscad/modeling/src/maths/vec2/divide.js"(e,t){var n=(o,r,i)=>(o[0]=r[0]/i[0],o[1]=r[1]/i[1],o);t.exports=n}}),gQi=At({"node_modules/@jscad/modeling/src/maths/vec2/dot.js"(e,t){var n=(o,r)=>o[0]*r[0]+o[1]*r[1];t.exports=n}}),AQi=At({"node_modules/@jscad/modeling/src/maths/vec2/equals.js"(e,t){var n=(o,r)=>o[0]===r[0]&&o[1]===r[1];t.exports=n}}),nqn=At({"node_modules/@jscad/modeling/src/maths/vec2/fromAngleRadians.js"(e,t){var{sin:n,cos:o}=S2(),r=(i,s)=>(i[0]=o(s),i[1]=n(s),i);t.exports=r}}),fQi=At({"node_modules/@jscad/modeling/src/maths/vec2/fromAngleDegrees.js"(e,t){var n=nqn(),o=(r,i)=>n(r,i*0.017453292519943295);t.exports=o}}),yQi=At({"node_modules/@jscad/modeling/src/maths/vec2/fromScalar.js"(e,t){var n=(o,r)=>(o[0]=r,o[1]=r,o);t.exports=n}}),xQi=At({"node_modules/@jscad/modeling/src/maths/vec2/fromValues.js"(e,t){var n=wwe(),o=(r,i)=>{let s=n();return s[0]=r,s[1]=i,s};t.exports=o}}),CQi=At({"node_modules/@jscad/modeling/src/maths/vec2/length.js"(e,t){var n=(o)=>Math.sqrt(o[0]*o[0]+o[1]*o[1]);t.exports=n}}),bQi=At({"node_modules/@jscad/modeling/src/maths/vec2/lerp.js"(e,t){var n=(o,r,i,s)=>{let a=r[0],c=r[1];return o[0]=a+s*(i[0]-a),o[1]=c+s*(i[1]-c),o};t.exports=n}}),IQi=At({"node_modules/@jscad/modeling/src/maths/vec2/max.js"(e,t){var n=(o,r,i)=>(o[0]=Math.max(r[0],i[0]),o[1]=Math.max(r[1],i[1]),o);t.exports=n}}),vQi=At({"node_modules/@jscad/modeling/src/maths/vec2/min.js"(e,t){var n=(o,r,i)=>(o[0]=Math.min(r[0],i[0]),o[1]=Math.min(r[1],i[1]),o);t.exports=n}}),SQi=At({"node_modules/@jscad/modeling/src/maths/vec2/multiply.js"(e,t){var n=(o,r,i)=>(o[0]=r[0]*i[0],o[1]=r[1]*i[1],o);t.exports=n}}),PQi=At({"node_modules/@jscad/modeling/src/maths/vec2/negate.js"(e,t){var n=(o,r)=>(o[0]=-r[0],o[1]=-r[1],o);t.exports=n}}),oqn=At({"node_modules/@jscad/modeling/src/maths/vec2/rotate.js"(e,t){var n=(o,r,i,s)=>{let a=r[0]-i[0],c=r[1]-i[1],l=Math.cos(s),h=Math.sin(s);return o[0]=a*l-c*h+i[0],o[1]=a*h+c*l+i[1],o};t.exports=n}}),EQi=At({"node_modules/@jscad/modeling/src/maths/vec2/normal.js"(e,t){var{TAU:n}=Lc(),o=wwe(),r=oqn(),i=(s,a)=>r(s,a,o(),n/4);t.exports=i}}),MQi=At({"node_modules/@jscad/modeling/src/maths/vec2/normalize.js"(e,t){var n=(o,r)=>{let i=r[0],s=r[1],a=i*i+s*s;if(a>0)a=1/Math.sqrt(a);return o[0]=i*a,o[1]=s*a,o};t.exports=n}}),wQi=At({"node_modules/@jscad/modeling/src/maths/vec2/scale.js"(e,t){var n=(o,r,i)=>(o[0]=r[0]*i,o[1]=r[1]*i,o);t.exports=n}}),BQi=At({"node_modules/@jscad/modeling/src/maths/vec2/snap.js"(e,t){var n=(o,r,i)=>(o[0]=Math.round(r[0]/i)*i+0,o[1]=Math.round(r[1]/i)*i+0,o);t.exports=n}}),TQi=At({"node_modules/@jscad/modeling/src/maths/vec2/squaredDistance.js"(e,t){var n=(o,r)=>{let i=r[0]-o[0],s=r[1]-o[1];return i*i+s*s};t.exports=n}}),DQi=At({"node_modules/@jscad/modeling/src/maths/vec2/squaredLength.js"(e,t){var n=(o)=>{let r=o[0],i=o[1];return r*r+i*i};t.exports=n}}),NQi=At({"node_modules/@jscad/modeling/src/maths/vec2/subtract.js"(e,t){var n=(o,r,i)=>(o[0]=r[0]-i[0],o[1]=r[1]-i[1],o);t.exports=n}}),RQi=At({"node_modules/@jscad/modeling/src/maths/vec2/toString.js"(e,t){var n=(o)=>`[${o[0].toFixed(7)}, ${o[1].toFixed(7)}]`;t.exports=n}}),QQi=At({"node_modules/@jscad/modeling/src/maths/vec2/transform.js"(e,t){var n=(o,r,i)=>{let s=r[0],a=r[1];return o[0]=i[0]*s+i[4]*a+i[12],o[1]=i[1]*s+i[5]*a+i[13],o};t.exports=n}}),Na=At({"node_modules/@jscad/modeling/src/maths/vec2/index.js"(e,t){t.exports={abs:aQi(),add:cQi(),angle:lQi(),angleDegrees:hQi(),angleRadians:rpt(),clone:dQi(),copy:uQi(),create:wwe(),cross:pQi(),distance:mQi(),divide:_Qi(),dot:gQi(),equals:AQi(),fromAngleDegrees:fQi(),fromAngleRadians:nqn(),fromScalar:yQi(),fromValues:xQi(),length:CQi(),lerp:bQi(),max:IQi(),min:vQi(),multiply:SQi(),negate:PQi(),normal:EQi(),normalize:MQi(),rotate:oqn(),scale:wQi(),snap:BQi(),squaredDistance:TQi(),squaredLength:DQi(),subtract:NQi(),toString:RQi(),transform:QQi()}}}),kQi=At({"node_modules/@jscad/modeling/src/geometries/geom2/fromPoints.js"(e,t){var n=Na(),o=Mwe(),r=(i)=>{if(!Array.isArray(i))throw Error("the given points must be an array");let s=i.length;if(s<3)throw Error("the given points must define a closed geometry with three or more points");if(n.equals(i[0],i[s-1]))--s;let a=[],c=i[s-1];for(let l=0;l<s;l++){let h=i[l];a.push([n.clone(c),n.clone(h)]),c=h}return o(a)};t.exports=r}}),LQi=At({"node_modules/@jscad/modeling/src/geometries/geom2/fromCompactBinary.js"(e,t){var n=kd(),o=Na(),r=Mwe(),i=(s)=>{if(s[0]!==0)throw Error("invalid compact binary data");let a=r();a.transforms=n.clone(s.slice(1,17));for(let c=21;c<s.length;c+=4){let l=o.fromValues(s[c+0],s[c+1]),h=o.fromValues(s[c+2],s[c+3]);a.sides.push([l,h])}if(s[17]>=0)a.color=[s[17],s[18],s[19],s[20]];return a};t.exports=i}}),rqn=At({"node_modules/@jscad/modeling/src/geometries/geom2/isA.js"(e,t){var n=(o)=>{if(o&&typeof o==="object"){if("sides"in o&&"transforms"in o){if(Array.isArray(o.sides)&&"length"in o.transforms)return!0}}return!1};t.exports=n}}),HQi=At({"node_modules/@jscad/modeling/src/geometries/geom2/applyTransforms.js"(e,t){var n=kd(),o=Na(),r=(i)=>{if(n.isIdentity(i.transforms))return i;return i.sides=i.sides.map((s)=>{let a=o.transform(o.create(),s[0],i.transforms),c=o.transform(o.create(),s[1],i.transforms);return[a,c]}),i.transforms=n.create(),i};t.exports=r}}),Fpe=At({"node_modules/@jscad/modeling/src/geometries/geom2/toSides.js"(e,t){var n=HQi(),o=(r)=>n(r).sides;t.exports=o}}),iqn=At({"node_modules/@jscad/modeling/src/geometries/geom2/reverse.js"(e,t){var n=Mwe(),o=Fpe(),r=(i)=>{let a=o(i).map((c)=>[c[1],c[0]]);return a.reverse(),n(a)};t.exports=r}}),sqn=At({"node_modules/@jscad/modeling/src/geometries/geom2/toOutlines.js"(e,t){var n=Na(),o=Fpe(),r=(c)=>{let l=new Map,h=(d)=>{let u=d.toString();if(l.has(u))return l.get(u);else return l.set(u,d),d};return c.map((d)=>d.map(h))},i=(c)=>{let l=new Map;return r(c).forEach((d)=>{if(l.has(d[0]))l.get(d[0]).push(d);else l.set(d[0],[d])}),l},s=(c)=>{let l=i(o(c)),h=[];while(!0){let d;for(let[p,m]of l){if(d=m.shift(),!d){l.delete(p);continue}break}if(d===void 0)break;let u=[],_=d[0];while(!0){u.push(d[0]);let p=d[1];if(p===_)break;let m=l.get(p);if(!m)throw Error(`geometry is not closed at vertex ${p}`);let A=a(d,m);if(m.length===0)l.delete(p);d=A}if(u.length>0)u.push(u.shift());h.push(u)}return l.clear(),h},a=(c,l)=>{if(l.length===1)return l.pop();let h=n.create(),d=n.angleDegrees(n.subtract(h,c[1],c[0])),u,_;l.forEach((m,A)=>{let f=n.angleDegrees(n.subtract(h,m[1],m[0]))-d;if(f<-180)f+=360;if(f>=180)f-=360;if(_===void 0||f>u)_=A,u=f});let p=l[_];return l.splice(_,1),p};t.exports=s}}),FQi=At({"node_modules/@jscad/modeling/src/geometries/geom2/toPoints.js"(e,t){var n=Fpe(),o=(r)=>{let s=n(r).map((a)=>a[0]);if(s.length>0)s.push(s.shift());return s};t.exports=o}}),zQi=At({"node_modules/@jscad/modeling/src/geometries/geom2/toString.js"(e,t){var n=Na(),o=Fpe(),r=(i)=>{let s=o(i),a="geom2 ("+s.length+` sides):
[
`;return s.forEach((c)=>{a+="  ["+n.toString(c[0])+", "+n.toString(c[1])+`]
`}),a+=`]
`,a};t.exports=r}}),OQi=At({"node_modules/@jscad/modeling/src/geometries/geom2/toCompactBinary.js"(e,t){var n=(o)=>{let{sides:r,transforms:i}=o,s=[-1,-1,-1,-1];if(o.color)s=o.color;let a=new Float32Array(21+r.length*4);a[0]=0,a[1]=i[0],a[2]=i[1],a[3]=i[2],a[4]=i[3],a[5]=i[4],a[6]=i[5],a[7]=i[6],a[8]=i[7],a[9]=i[8],a[10]=i[9],a[11]=i[10],a[12]=i[11],a[13]=i[12],a[14]=i[13],a[15]=i[14],a[16]=i[15],a[17]=s[0],a[18]=s[1],a[19]=s[2],a[20]=s[3];for(let c=0;c<r.length;c++){let l=c*4+21,h=r[c][0],d=r[c][1];a[l+0]=h[0],a[l+1]=h[1],a[l+2]=d[0],a[l+3]=d[1]}return a};t.exports=n}}),VQi=At({"node_modules/@jscad/modeling/src/geometries/geom2/transform.js"(e,t){var n=kd(),o=iqn(),r=(i,s)=>{let a=n.multiply(n.create(),i,s.transforms),c=Object.assign({},s,{transforms:a});if(i[0]*i[5]-i[4]*i[1]<0)return o(c);return c};t.exports=r}}),YQi=At({"node_modules/@jscad/modeling/src/geometries/geom2/validate.js"(e,t){var n=Na(),o=rqn(),r=sqn(),i=(s)=>{if(!o(s))throw Error("invalid geom2 structure");if(r(s),s.sides.forEach((a)=>{if(n.equals(a[0],a[1]))throw Error(`geom2 self-edge ${a[0]}`)}),!s.transforms.every(Number.isFinite))throw Error(`geom2 invalid transforms ${s.transforms}`)};t.exports=i}}),la=At({"node_modules/@jscad/modeling/src/geometries/geom2/index.js"(e,t){t.exports={clone:fRi(),create:Mwe(),fromPoints:kQi(),fromCompactBinary:LQi(),isA:rqn(),reverse:iqn(),toOutlines:sqn(),toPoints:FQi(),toSides:Fpe(),toString:zQi(),toCompactBinary:OQi(),transform:VQi(),validate:YQi()}}}),GQi=At({"node_modules/@jscad/modeling/src/geometries/geom3/clone.js"(e,t){var n=(o)=>Object.assign({},o);t.exports=n}}),zpe=At({"node_modules/@jscad/modeling/src/geometries/geom3/create.js"(e,t){var n=kd(),o=(r)=>{if(r===void 0)r=[];return{polygons:r,transforms:n.create()}};t.exports=o}}),UQi=At({"node_modules/@jscad/modeling/src/operations/hulls/quickhull/point-line-distance.js"(e,t){var n=Hpe(),o=Ewe(),r=tqn(),i=(a,c,l)=>{let h=[],d=[],u=[];o(h,l,c),o(d,a,c);let _=r(n(u,d,h)),p=r(h);if(p===0)throw Error("a and b are the same point");return _/p},s=(a,c,l)=>Math.sqrt(i(a,c,l));t.exports=s}}),WQi=At({"node_modules/@jscad/modeling/src/operations/hulls/quickhull/get-plane-normal.js"(e,t){var n=Hpe(),o=opt(),r=Ewe(),i=(s,a,c,l)=>{let h=[0,0,0];return r(s,a,c),r(h,c,l),n(s,s,h),o(s,s)};t.exports=i}}),XQi=At({"node_modules/@jscad/modeling/src/operations/hulls/quickhull/VertexList.js"(e,t){var n=class{constructor(){this.head=null,this.tail=null}clear(){this.head=this.tail=null}insertBefore(o,r){if(r.prev=o.prev,r.next=o,!r.prev)this.head=r;else r.prev.next=r;o.prev=r}insertAfter(o,r){if(r.prev=o,r.next=o.next,!r.next)this.tail=r;else r.next.prev=r;o.next=r}add(o){if(!this.head)this.head=o;else this.tail.next=o;o.prev=this.tail,o.next=null,this.tail=o}addAll(o){if(!this.head)this.head=o;else this.tail.next=o;o.prev=this.tail;while(o.next)o=o.next;this.tail=o}remove(o){if(!o.prev)this.head=o.next;else o.prev.next=o.next;if(!o.next)this.tail=o.prev;else o.next.prev=o.prev}removeChain(o,r){if(!o.prev)this.head=r.next;else o.prev.next=r.next;if(!r.next)this.tail=o.prev;else r.next.prev=o.prev}first(){return this.head}isEmpty(){return!this.head}};t.exports=n}}),jQi=At({"node_modules/@jscad/modeling/src/operations/hulls/quickhull/Vertex.js"(e,t){var n=class{constructor(o,r){this.point=o,this.index=r,this.next=null,this.prev=null,this.face=null}};t.exports=n}}),KQi=At({"node_modules/@jscad/modeling/src/operations/hulls/quickhull/HalfEdge.js"(e,t){var n=K$n(),o=eqn(),r=class{constructor(i,s){this.vertex=i,this.face=s,this.next=null,this.prev=null,this.opposite=null}head(){return this.vertex}tail(){return this.prev?this.prev.vertex:null}length(){if(this.tail())return n(this.tail().point,this.head().point);return-1}lengthSquared(){if(this.tail())return o(this.tail().point,this.head().point);return-1}setOpposite(i){this.opposite=i,i.opposite=this}};t.exports=r}}),$Qi=At({"node_modules/@jscad/modeling/src/operations/hulls/quickhull/Face.js"(e,t){var n=X$n(),o=j$n(),r=Hpe(),i=Swe(),s=$$n(),a=opt(),c=Z$n(),l=Ewe(),h=KQi(),d=0,u=1,_=2,p=class m{constructor(){this.normal=[],this.centroid=[],this.offset=0,this.outside=null,this.mark=d,this.edge=null,this.nVertices=0}getEdge(A){if(typeof A!=="number")throw Error("requires a number");let g=this.edge;while(A>0)g=g.next,A-=1;while(A<0)g=g.prev,A+=1;return g}computeNormal(){let A=this.edge,g=A.next,f=g.next,y=l([],g.head().point,A.head().point),x=[],C=[];this.nVertices=2,this.normal=[0,0,0];while(f!==A)o(C,y),l(y,f.head().point,A.head().point),n(this.normal,this.normal,r(x,C,y)),f=f.next,this.nVertices+=1;this.area=s(this.normal),this.normal=c(this.normal,this.normal,1/this.area)}computeNormalMinArea(A){if(this.computeNormal(),this.area<A){let g,f=0,y=this.edge;do{let P=y.lengthSquared();if(P>f)g=y,f=P;y=y.next}while(y!==this.edge);let x=g.tail().point,C=g.head().point,b=l([],C,x),I=Math.sqrt(f);c(b,b,1/I);let v=i(this.normal,b);c(b,b,-v),n(this.normal,this.normal,b),a(this.normal,this.normal)}}computeCentroid(){this.centroid=[0,0,0];let A=this.edge;do n(this.centroid,this.centroid,A.head().point),A=A.next;while(A!==this.edge);c(this.centroid,this.centroid,1/this.nVertices)}computeNormalAndCentroid(A){if(typeof A<"u")this.computeNormalMinArea(A);else this.computeNormal();this.computeCentroid(),this.offset=i(this.normal,this.centroid)}distanceToPlane(A){return i(this.normal,A)-this.offset}connectHalfEdges(A,g){let f;if(A.opposite.face===g.opposite.face){let y=g.opposite.face,x;if(A===this.edge)this.edge=g;if(y.nVertices===3)x=g.opposite.prev.opposite,y.mark=_,f=y;else{if(x=g.opposite.next,y.edge===x.prev)y.edge=x;x.prev=x.prev.prev,x.prev.next=x}g.prev=A.prev,g.prev.next=g,g.setOpposite(x),y.computeNormalAndCentroid()}else A.next=g,g.prev=A;return f}mergeAdjacentFaces(A,g){let f=A.opposite,y=f.face;g.push(y),y.mark=_;let{prev:x,next:C}=A,{prev:b,next:I}=f;while(x.opposite.face===y)x=x.prev,I=I.next;while(C.opposite.face===y)C=C.next,b=b.prev;let v;for(v=I;v!==b.next;v=v.next)v.face=this;this.edge=C;let P;if(P=this.connectHalfEdges(b,C),P)g.push(P);if(P=this.connectHalfEdges(x,I),P)g.push(P);return this.computeNormalAndCentroid(),g}collectIndices(){let A=[],g=this.edge;do A.push(g.head().index),g=g.next;while(g!==this.edge);return A}static createTriangle(A,g,f,y=0){let x=new m,C=new h(A,x),b=new h(g,x),I=new h(f,x);return C.next=I.prev=b,b.next=C.prev=I,I.next=b.prev=C,x.edge=C,x.computeNormalAndCentroid(y),x}};t.exports={VISIBLE:d,NON_CONVEX:u,DELETED:_,Face:p}}}),qQi=At({"node_modules/@jscad/modeling/src/operations/hulls/quickhull/QuickHull.js"(e,t){var n=Swe(),o=UQi(),r=WQi(),i=XQi(),s=jQi(),{Face:a,VISIBLE:c,NON_CONVEX:l,DELETED:h}=$Qi(),d=1,u=2,_=class{constructor(p){if(!Array.isArray(p))throw TypeError("input is not a valid array");if(p.length<4)throw Error("cannot build a simplex out of <4 points");this.tolerance=-1,this.nFaces=0,this.nPoints=p.length,this.faces=[],this.newFaces=[],this.claimed=new i,this.unclaimed=new i,this.vertices=[];for(let m=0;m<p.length;m+=1)this.vertices.push(new s(p[m],m));this.discardedFaces=[],this.vertexPointIndices=[]}addVertexToFace(p,m){if(p.face=m,!m.outside)this.claimed.add(p);else this.claimed.insertBefore(m.outside,p);m.outside=p}removeVertexFromFace(p,m){if(p===m.outside)if(p.next&&p.next.face===m)m.outside=p.next;else m.outside=null;this.claimed.remove(p)}removeAllVerticesFromFace(p){if(p.outside){let m=p.outside;while(m.next&&m.next.face===p)m=m.next;return this.claimed.removeChain(p.outside,m),m.next=null,p.outside}}deleteFaceVertices(p,m){let A=this.removeAllVerticesFromFace(p);if(A)if(!m)this.unclaimed.addAll(A);else{let g;for(let f=A;f;f=g)if(g=f.next,m.distanceToPlane(f.point)>this.tolerance)this.addVertexToFace(f,m);else this.unclaimed.add(f)}}resolveUnclaimedPoints(p){let m=this.unclaimed.first();for(let A=m;A;A=m){m=A.next;let g=this.tolerance,f;for(let y=0;y<p.length;y+=1){let x=p[y];if(x.mark===c){let C=x.distanceToPlane(A.point);if(C>g)g=C,f=x;if(g>1000*this.tolerance)break}}if(f)this.addVertexToFace(A,f)}}computeExtremes(){let p=[],m=[],A=[],g=[],f,y;for(f=0;f<3;f+=1)A[f]=g[f]=this.vertices[0];for(f=0;f<3;f+=1)p[f]=m[f]=this.vertices[0].point[f];for(f=1;f<this.vertices.length;f+=1){let x=this.vertices[f],C=x.point;for(y=0;y<3;y+=1)if(C[y]<p[y])p[y]=C[y],A[y]=x;for(y=0;y<3;y+=1)if(C[y]>m[y])m[y]=C[y],g[y]=x}return this.tolerance=3*Number.EPSILON*(Math.max(Math.abs(p[0]),Math.abs(m[0]))+Math.max(Math.abs(p[1]),Math.abs(m[1]))+Math.max(Math.abs(p[2]),Math.abs(m[2]))),[A,g]}createInitialSimplex(){let p=this.vertices,[m,A]=this.computeExtremes(),g,f,y,x,C=0,b=0;for(y=0;y<3;y+=1){let T=A[y].point[y]-m[y].point[y];if(T>C)C=T,b=y}let I=m[b],v=A[b];C=0;for(y=0;y<this.vertices.length;y+=1){let T=this.vertices[y];if(T!==I&&T!==v){let N=o(T.point,I.point,v.point);if(N>C)C=N,g=T}}let P=r([],I.point,v.point,g.point),M=n(I.point,P);C=-1;for(y=0;y<this.vertices.length;y+=1){let T=this.vertices[y];if(T!==I&&T!==v&&T!==g){let N=Math.abs(n(P,T.point)-M);if(N>C)C=N,f=T}}let B=[];if(n(f.point,P)-M<0){B.push(a.createTriangle(I,v,g),a.createTriangle(f,v,I),a.createTriangle(f,g,v),a.createTriangle(f,I,g));for(y=0;y<3;y+=1){let T=(y+1)%3;B[y+1].getEdge(2).setOpposite(B[0].getEdge(T)),B[y+1].getEdge(1).setOpposite(B[T+1].getEdge(0))}}else{B.push(a.createTriangle(I,g,v),a.createTriangle(f,I,v),a.createTriangle(f,v,g),a.createTriangle(f,g,I));for(y=0;y<3;y+=1){let T=(y+1)%3;B[y+1].getEdge(2).setOpposite(B[0].getEdge((3-y)%3)),B[y+1].getEdge(0).setOpposite(B[T+1].getEdge(1))}}for(y=0;y<4;y+=1)this.faces.push(B[y]);for(y=0;y<p.length;y+=1){let T=p[y];if(T!==I&&T!==v&&T!==g&&T!==f){C=this.tolerance;let N;for(x=0;x<4;x+=1){let D=B[x].distanceToPlane(T.point);if(D>C)C=D,N=B[x]}if(N)this.addVertexToFace(T,N)}}}reindexFaceAndVertices(){let p=[];for(let m=0;m<this.faces.length;m+=1){let A=this.faces[m];if(A.mark===c)p.push(A)}this.faces=p}collectFaces(p){let m=[];for(let A=0;A<this.faces.length;A+=1){if(this.faces[A].mark!==c)throw Error("attempt to include a destroyed face in the hull");let g=this.faces[A].collectIndices();if(p)m.push(g);else for(let f=0;f<g.length-2;f+=1)m.push([g[0],g[f+1],g[f+2]])}return m}nextVertexToAdd(){if(!this.claimed.isEmpty()){let p,m,A=0,g=this.claimed.first().face;for(m=g.outside;m&&m.face===g;m=m.next){let f=g.distanceToPlane(m.point);if(f>A)A=f,p=m}return p}}computeHorizon(p,m,A,g){this.deleteFaceVertices(A),A.mark=h;let f;if(!m)f=m=A.getEdge(0);else f=m.next;do{let y=f.opposite,x=y.face;if(x.mark===c)if(x.distanceToPlane(p)>this.tolerance)this.computeHorizon(p,y,x,g);else g.push(f);f=f.next}while(f!==m)}addAdjoiningFace(p,m){let A=a.createTriangle(p,m.tail(),m.head());return this.faces.push(A),A.getEdge(-1).setOpposite(m.opposite),A.getEdge(0)}addNewFaces(p,m){this.newFaces=[];let A,g;for(let f=0;f<m.length;f+=1){let y=m[f],x=this.addAdjoiningFace(p,y);if(!A)A=x;else x.next.setOpposite(g);this.newFaces.push(x.face),g=x}A.next.setOpposite(g)}oppositeFaceDistance(p){return p.face.distanceToPlane(p.opposite.face.centroid)}doAdjacentMerge(p,m){let A=p.edge,g=!0,f=0;do{if(f>=p.nVertices)throw Error("merge recursion limit exceeded");let y=A.opposite.face,x=!1;if(m===u){if(this.oppositeFaceDistance(A)>-this.tolerance||this.oppositeFaceDistance(A.opposite)>-this.tolerance)x=!0}else if(p.area>y.area){if(this.oppositeFaceDistance(A)>-this.tolerance)x=!0;else if(this.oppositeFaceDistance(A.opposite)>-this.tolerance)g=!1}else if(this.oppositeFaceDistance(A.opposite)>-this.tolerance)x=!0;else if(this.oppositeFaceDistance(A)>-this.tolerance)g=!1;if(x){let C=p.mergeAdjacentFaces(A,[]);for(let b=0;b<C.length;b+=1)this.deleteFaceVertices(C[b],p);return!0}A=A.next,f+=1}while(A!==p.edge);if(!g)p.mark=l;return!1}addVertexToHull(p){let m=[];this.unclaimed.clear(),this.removeVertexFromFace(p,p.face),this.computeHorizon(p.point,null,p.face,m),this.addNewFaces(p,m);for(let A=0;A<this.newFaces.length;A+=1){let g=this.newFaces[A];if(g.mark===c)while(this.doAdjacentMerge(g,d));}for(let A=0;A<this.newFaces.length;A+=1){let g=this.newFaces[A];if(g.mark===l){g.mark=c;while(this.doAdjacentMerge(g,u));}}this.resolveUnclaimedPoints(this.newFaces)}build(){let p;this.createInitialSimplex();while(p=this.nextVertexToAdd())this.addVertexToHull(p);this.reindexFaceAndVertices()}};t.exports=_}}),aqn=At({"node_modules/@jscad/modeling/src/operations/hulls/quickhull/index.js"(e,t){var n=qQi(),o=(r,i={})=>{let s=new n(r);return s.build(),s.collectFaces(i.skipTriangulation)};t.exports=o}}),Fte=At({"node_modules/@jscad/modeling/src/geometries/poly3/create.js"(e,t){var n=(o)=>{if(o===void 0||o.length<3)o=[];return{vertices:o}};t.exports=n}}),JQi=At({"node_modules/@jscad/modeling/src/geometries/poly3/clone.js"(e,t){var n=Fte(),o=Ai(),r=(...i)=>{let s,a;if(i.length===1)s=n(),a=i[0];else s=i[0],a=i[1];return s.vertices=a.vertices.map((c)=>o.clone(c)),s};t.exports=r}}),ZQi=At({"node_modules/@jscad/modeling/src/geometries/poly3/fromPoints.js"(e,t){var n=Ai(),o=Fte(),r=(i)=>{let s=i.map((a)=>n.clone(a));return o(s)};t.exports=r}}),eki=At({"node_modules/@jscad/modeling/src/geometries/poly3/fromPointsAndPlane.js"(e,t){var n=Fte(),o=(r,i)=>{let s=n(r);return s.plane=i,s};t.exports=o}}),Bwe=At({"node_modules/@jscad/modeling/src/maths/vec4/create.js"(e,t){var n=()=>[0,0,0,0];t.exports=n}}),cqn=At({"node_modules/@jscad/modeling/src/maths/vec4/clone.js"(e,t){var n=Bwe(),o=(r)=>{let i=n();return i[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=r[3],i};t.exports=o}}),lqn=At({"node_modules/@jscad/modeling/src/maths/vec4/copy.js"(e,t){var n=(o,r)=>(o[0]=r[0],o[1]=r[1],o[2]=r[2],o[3]=r[3],o);t.exports=n}}),hqn=At({"node_modules/@jscad/modeling/src/maths/vec4/equals.js"(e,t){var n=(o,r)=>o[0]===r[0]&&o[1]===r[1]&&o[2]===r[2]&&o[3]===r[3];t.exports=n}}),dqn=At({"node_modules/@jscad/modeling/src/maths/plane/flip.js"(e,t){var n=(o,r)=>(o[0]=-r[0],o[1]=-r[1],o[2]=-r[2],o[3]=-r[3],o);t.exports=n}}),uqn=At({"node_modules/@jscad/modeling/src/maths/plane/fromNormalAndPoint.js"(e,t){var n=Ai(),o=(r,i,s)=>{let a=n.normalize(n.create(),i),c=n.dot(s,a);return r[0]=a[0],r[1]=a[1],r[2]=a[2],r[3]=c,r};t.exports=o}}),pqn=At({"node_modules/@jscad/modeling/src/maths/vec4/fromValues.js"(e,t){var n=Bwe(),o=(r,i,s,a)=>{let c=n();return c[0]=r,c[1]=i,c[2]=s,c[3]=a,c};t.exports=o}}),tki=At({"node_modules/@jscad/modeling/src/maths/plane/fromNoisyPoints.js"(e,t){var n=Ai(),o=uqn(),r=(i,...s)=>{i[0]=0,i[1]=0,i[2]=0,i[3]=0;let a=s.length;s.forEach((f)=>{n.add(i,i,f)}),n.scale(i,i,1/a);let c=0,l=0,h=0,d=0,u=0,_=0,p=n.create();s.forEach((f)=>{n.subtract(p,f,i),c+=p[0]*p[0],l+=p[0]*p[1],h+=p[0]*p[2],d+=p[1]*p[1],u+=p[1]*p[2],_+=p[2]*p[2]}),c/=a,l/=a,h/=a,d/=a,u/=a,_/=a,p[0]=0,p[1]=0,p[2]=0;let m=n.create(),A=d*_-u*u;m[0]=A,m[1]=h*u-l*_,m[2]=l*u-h*d;let g=A*A;if(n.add(p,p,n.scale(m,m,g)),A=c*_-h*h,m[0]=h*u-l*_,m[1]=A,m[2]=l*h-u*c,g=A*A,n.dot(p,m)<0)g=-g;if(n.add(p,p,n.scale(m,m,g)),A=c*d-l*l,m[0]=l*u-h*d,m[1]=l*h-u*c,m[2]=A,g=A*A,n.dot(p,m)<0)g=-g;return n.add(p,p,n.scale(m,m,g)),o(i,p,i)};t.exports=r}}),mqn=At({"node_modules/@jscad/modeling/src/maths/plane/fromPoints.js"(e,t){var n=Ai(),o=(r,...i)=>{let s=i.length,a=n.create(),c=n.create(),l=(h)=>{let d=i[h],u=i[(h+1)%s],_=i[(h+2)%s];return n.subtract(a,u,d),n.subtract(c,_,d),n.cross(a,a,c),n.normalize(a,a),a};if(r[0]=0,r[1]=0,r[2]=0,s===3)n.copy(r,l(0));else i.forEach((h,d)=>{n.add(r,r,l(d))}),n.normalize(r,r);return r[3]=n.dot(r,i[0]),r};t.exports=o}}),nki=At({"node_modules/@jscad/modeling/src/maths/plane/fromPointsRandom.js"(e,t){var{EPS:n}=Lc(),o=Ai(),r=(i,s,a,c)=>{let l=o.subtract(o.create(),a,s),h=o.subtract(o.create(),c,s);if(o.length(l)<n)l=o.orthogonal(l,h);if(o.length(h)<n)h=o.orthogonal(h,l);let d=o.cross(o.create(),l,h);if(o.length(d)<n)h=o.orthogonal(h,l),d=o.cross(d,l,h);d=o.normalize(d,d);let u=o.dot(d,s);return i[0]=d[0],i[1]=d[1],i[2]=d[2],i[3]=u,i};t.exports=r}}),oki=At({"node_modules/@jscad/modeling/src/maths/plane/projectionOfPoint.js"(e,t){var n=Ai(),o=(r,i)=>{let s=i[0]*r[0]+i[1]*r[1]+i[2]*r[2]-r[3],a=i[0]-s*r[0],c=i[1]-s*r[1],l=i[2]-s*r[2];return n.fromValues(a,c,l)};t.exports=o}}),_qn=At({"node_modules/@jscad/modeling/src/maths/plane/signedDistanceToPoint.js"(e,t){var n=Ai(),o=(r,i)=>n.dot(r,i)-r[3];t.exports=o}}),gqn=At({"node_modules/@jscad/modeling/src/maths/vec4/toString.js"(e,t){var n=(o)=>`(${o[0].toFixed(9)}, ${o[1].toFixed(9)}, ${o[2].toFixed(9)}, ${o[3].toFixed(9)})`;t.exports=n}}),rki=At({"node_modules/@jscad/modeling/src/maths/plane/transform.js"(e,t){var n=kd(),o=Ai(),r=mqn(),i=dqn(),s=(a,c,l)=>{let h=n.isMirroring(l),d=o.orthogonal(o.create(),c),u=o.cross(d,c,d),_=o.cross(o.create(),c,u),p=o.fromScalar(o.create(),c[3]);o.multiply(p,p,c);let m=o.add(o.create(),p,u),A=o.add(o.create(),p,_);if(p=o.transform(p,p,l),m=o.transform(m,m,l),A=o.transform(A,A,l),r(a,p,m,A),h)i(a,a);return a};t.exports=s}}),IE=At({"node_modules/@jscad/modeling/src/maths/plane/index.js"(e,t){t.exports={clone:cqn(),copy:lqn(),create:Bwe(),equals:hqn(),flip:dqn(),fromNormalAndPoint:uqn(),fromValues:pqn(),fromNoisyPoints:tki(),fromPoints:mqn(),fromPointsRandom:nki(),projectionOfPoint:oki(),signedDistanceToPoint:_qn(),toString:gqn(),transform:rki()}}}),iki=At({"node_modules/@jscad/modeling/src/geometries/poly3/invert.js"(e,t){var n=IE(),o=Fte(),r=(i)=>{let s=i.vertices.slice().reverse(),a=o(s);if(i.plane)a.plane=n.flip(n.create(),i.plane);return a};t.exports=r}}),Aqn=At({"node_modules/@jscad/modeling/src/geometries/poly3/isA.js"(e,t){var n=(o)=>{if(o&&typeof o==="object"){if("vertices"in o){if(Array.isArray(o.vertices))return!0}}return!1};t.exports=n}}),fqn=At({"node_modules/@jscad/modeling/src/geometries/poly3/isConvex.js"(e,t){var n=IE(),o=Ai(),r=(a)=>i(a.vertices),i=(a)=>{let c=a.length;if(c>2){let l=n.fromPoints(n.create(),...a),h=a[c-2],d=a[c-1];for(let u=0;u<c;u++){let _=a[u];if(!s(h,d,_,l))return!1;h=d,d=_}}return!0},s=(a,c,l,h)=>{let d=o.cross(o.create(),o.subtract(o.create(),c,a),o.subtract(o.create(),l,c));return o.dot(d,h)>=0};t.exports=r}}),ipt=At({"node_modules/@jscad/modeling/src/geometries/poly3/plane.js"(e,t){var n=IE(),o=(r)=>{if(!r.plane)r.plane=n.fromPoints(n.create(),...r.vertices);return r.plane};t.exports=o}}),yqn=At({"node_modules/@jscad/modeling/src/geometries/poly3/measureArea.js"(e,t){var n=ipt(),o=(r)=>{let i=r.vertices.length;if(i<3)return 0;let s=r.vertices,a=n(r),c=Math.abs(a[0]),l=Math.abs(a[1]),h=Math.abs(a[2]);if(c+l+h===0)return 0;let d=3;if(c>l&&c>h)d=1;else if(l>h)d=2;let u=0,_=0,p=1,m=2;switch(d){case 1:for(p=1;p<i;p++)_=p-1,m=(p+1)%i,u+=s[p][1]*(s[m][2]-s[_][2]);u+=s[0][1]*(s[1][2]-s[i-1][2]),u/=2*a[0];break;case 2:for(p=1;p<i;p++)_=p-1,m=(p+1)%i,u+=s[p][2]*(s[m][0]-s[_][0]);u+=s[0][2]*(s[1][0]-s[i-1][0]),u/=2*a[1];break;case 3:default:for(p=1;p<i;p++)_=p-1,m=(p+1)%i,u+=s[p][0]*(s[m][1]-s[_][1]);u+=s[0][0]*(s[1][1]-s[i-1][1]),u/=2*a[2];break}return u};t.exports=o}}),ski=At({"node_modules/@jscad/modeling/src/geometries/poly3/measureBoundingBox.js"(e,t){var n=Ai(),o=(r)=>{let i=r.vertices,s=i.length,a=s===0?n.create():n.clone(i[0]),c=n.clone(a);for(let l=1;l<s;l++)n.min(a,a,i[l]),n.max(c,c,i[l]);return[a,c]};t.exports=o}}),aki=At({"node_modules/@jscad/modeling/src/maths/vec4/dot.js"(e,t){var n=(o,r)=>o[0]*r[0]+o[1]*r[1]+o[2]*r[2]+o[3]*r[3];t.exports=n}}),cki=At({"node_modules/@jscad/modeling/src/maths/vec4/fromScalar.js"(e,t){var n=(o,r)=>(o[0]=r,o[1]=r,o[2]=r,o[3]=r,o);t.exports=n}}),lki=At({"node_modules/@jscad/modeling/src/maths/vec4/transform.js"(e,t){var n=(o,r,i)=>{let[s,a,c,l]=r;return o[0]=i[0]*s+i[4]*a+i[8]*c+i[12]*l,o[1]=i[1]*s+i[5]*a+i[9]*c+i[13]*l,o[2]=i[2]*s+i[6]*a+i[10]*c+i[14]*l,o[3]=i[3]*s+i[7]*a+i[11]*c+i[15]*l,o};t.exports=n}}),xqn=At({"node_modules/@jscad/modeling/src/maths/vec4/index.js"(e,t){t.exports={clone:cqn(),copy:lqn(),create:Bwe(),dot:aki(),equals:hqn(),fromScalar:cki(),fromValues:pqn(),toString:gqn(),transform:lki()}}}),hki=At({"node_modules/@jscad/modeling/src/geometries/poly3/measureBoundingSphere.js"(e,t){var n=xqn(),o=new WeakMap,r=(i)=>{let s=o.get(i);if(s)return s;let a=i.vertices,c=n.create();if(a.length===0)return c[0]=0,c[1]=0,c[2]=0,c[3]=0,c;let l=a[0],h=l,d=l,u=l,_=l,p=l;a.forEach((f)=>{if(l[0]>f[0])l=f;if(h[1]>f[1])h=f;if(d[2]>f[2])d=f;if(u[0]<f[0])u=f;if(_[1]<f[1])_=f;if(p[2]<f[2])p=f}),c[0]=(l[0]+u[0])*0.5,c[1]=(h[1]+_[1])*0.5,c[2]=(d[2]+p[2])*0.5;let m=c[0]-u[0],A=c[1]-_[1],g=c[2]-p[2];return c[3]=Math.sqrt(m*m+A*A+g*g),o.set(i,c),c};t.exports=r}}),dki=At({"node_modules/@jscad/modeling/src/geometries/poly3/measureSignedVolume.js"(e,t){var n=Ai(),o=(r)=>{let i=0,s=r.vertices,a=n.create();for(let c=0;c<s.length-2;c++)n.cross(a,s[c+1],s[c+2]),i+=n.dot(s[0],a);return i/=6,i};t.exports=o}}),uki=At({"node_modules/@jscad/modeling/src/geometries/poly3/toPoints.js"(e,t){var n=(o)=>o.vertices;t.exports=n}}),pki=At({"node_modules/@jscad/modeling/src/geometries/poly3/toString.js"(e,t){var n=Ai(),o=(r)=>{let i="poly3: vertices: [";return r.vertices.forEach((s)=>{i+=`${n.toString(s)}, `}),i+="]",i};t.exports=o}}),mki=At({"node_modules/@jscad/modeling/src/geometries/poly3/transform.js"(e,t){var n=kd(),o=Ai(),r=Fte(),i=(s,a)=>{let c=a.vertices.map((l)=>o.transform(o.create(),l,s));if(n.isMirroring(s))c.reverse();return r(c)};t.exports=i}}),_ki=At({"node_modules/@jscad/modeling/src/geometries/poly3/validate.js"(e,t){var n=_qn(),{NEPS:o}=Lc(),r=Ai(),i=Aqn(),s=fqn(),a=yqn(),c=ipt(),l=(h)=>{if(!i(h))throw Error("invalid poly3 structure");if(h.vertices.length<3)throw Error(`poly3 not enough vertices ${h.vertices.length}`);if(a(h)<=0)throw Error("poly3 area must be greater than zero");for(let d=0;d<h.vertices.length;d++)if(r.equals(h.vertices[d],h.vertices[(d+1)%h.vertices.length]))throw Error(`poly3 duplicate vertex ${h.vertices[d]}`);if(!s(h))throw Error("poly3 must be convex");if(h.vertices.forEach((d)=>{if(!d.every(Number.isFinite))throw Error(`poly3 invalid vertex ${d}`)}),h.vertices.length>3){let d=c(h);h.vertices.forEach((u)=>{let _=Math.abs(n(d,u));if(_>o)throw Error(`poly3 must be coplanar: vertex ${u} distance ${_}`)})}};t.exports=l}}),_c=At({"node_modules/@jscad/modeling/src/geometries/poly3/index.js"(e,t){t.exports={clone:JQi(),create:Fte(),fromPoints:ZQi(),fromPointsAndPlane:eki(),invert:iki(),isA:Aqn(),isConvex:fqn(),measureArea:yqn(),measureBoundingBox:ski(),measureBoundingSphere:hki(),measureSignedVolume:dki(),plane:ipt(),toPoints:uki(),toString:pki(),transform:mki(),validate:_ki()}}}),gki=At({"node_modules/@jscad/modeling/src/geometries/geom3/fromPointsConvex.js"(e,t){var n=aqn(),o=zpe(),r=_c(),i=(s)=>{if(!Array.isArray(s))throw Error("the given points must be an array");let c=n(s,{skipTriangulation:!0}).map((l)=>{let h=l.map((d)=>s[d]);return r.create(h)});return o(c)};t.exports=i}}),Aki=At({"node_modules/@jscad/modeling/src/geometries/geom3/fromPoints.js"(e,t){var n=_c(),o=zpe(),r=(i)=>{if(!Array.isArray(i))throw Error("the given points must be an array");let s=i.map((c,l)=>n.create(c));return o(s)};t.exports=r}}),fki=At({"node_modules/@jscad/modeling/src/geometries/geom3/fromCompactBinary.js"(e,t){var n=Ai(),o=kd(),r=_c(),i=zpe(),s=(a)=>{if(a[0]!==1)throw Error("invalid compact binary data");let c=i();c.transforms=o.clone(a.slice(1,17));let l=a[21],h=22,d=a.length-l*3;while(d<a.length){let u=a[h];h++;let _=[];for(let p=0;p<u;p++)_.push(n.fromValues(a[d],a[d+1],a[d+2])),d+=3;c.polygons.push(r.create(_))}if(a[17]>=0)c.color=[a[17],a[18],a[19],a[20]];return c};t.exports=s}}),yki=At({"node_modules/@jscad/modeling/src/geometries/geom3/applyTransforms.js"(e,t){var n=kd(),o=_c(),r=(i)=>{if(n.isIdentity(i.transforms))return i;return i.polygons=i.polygons.map((s)=>o.transform(i.transforms,s)),i.transforms=n.create(),i};t.exports=r}}),Ope=At({"node_modules/@jscad/modeling/src/geometries/geom3/toPolygons.js"(e,t){var n=yki(),o=(r)=>n(r).polygons;t.exports=o}}),xki=At({"node_modules/@jscad/modeling/src/geometries/geom3/invert.js"(e,t){var n=_c(),o=zpe(),r=Ope(),i=(s)=>{let c=r(s).map((l)=>n.invert(l));return o(c)};t.exports=i}}),spt=At({"node_modules/@jscad/modeling/src/geometries/geom3/isA.js"(e,t){var n=(o)=>{if(o&&typeof o==="object"){if("polygons"in o&&"transforms"in o){if(Array.isArray(o.polygons)&&"length"in o.transforms)return!0}}return!1};t.exports=n}}),Cki=At({"node_modules/@jscad/modeling/src/geometries/geom3/isConvex.js"(e,t){var{EPS:n}=Lc(),o=Ai(),r=spt(),i=Ope(),s=_c(),a=(c)=>{if(!r(c))throw Error("isConvex requires a geom3 geometry");let l=i(c);if(l.length===0)return!0;let h=[],d=new Set;for(let u=0;u<l.length;u++){let _=l[u].vertices;for(let p=0;p<_.length;p++){let m=_[p],A=`${m[0]},${m[1]},${m[2]}`;if(!d.has(A))d.add(A),h.push(m)}}for(let u=0;u<l.length;u++){let _=s.plane(l[u]);for(let p=0;p<h.length;p++){let m=h[p];if(o.dot(_,m)-_[3]>n)return!1}}return!0};t.exports=a}}),bki=At({"node_modules/@jscad/modeling/src/geometries/geom3/toPoints.js"(e,t){var n=_c(),o=Ope(),r=(i)=>o(i).map((c)=>n.toPoints(c));t.exports=r}}),Iki=At({"node_modules/@jscad/modeling/src/geometries/geom3/toString.js"(e,t){var n=_c(),o=Ope(),r=(i)=>{let s=o(i),a="geom3 ("+s.length+` polygons):
`;return s.forEach((c)=>{a+="  "+n.toString(c)+`
`}),a};t.exports=r}}),vki=At({"node_modules/@jscad/modeling/src/geometries/geom3/toCompactBinary.js"(e,t){var n=_c(),o=(r)=>{let{polygons:i,transforms:s}=r,a=i.length,c=i.reduce((_,p)=>_+p.vertices.length,0),l=[-1,-1,-1,-1];if(r.color)l=r.color;let h=new Float32Array(22+a+c*3);h[0]=1,h[1]=s[0],h[2]=s[1],h[3]=s[2],h[4]=s[3],h[5]=s[4],h[6]=s[5],h[7]=s[6],h[8]=s[7],h[9]=s[8],h[10]=s[9],h[11]=s[10],h[12]=s[11],h[13]=s[12],h[14]=s[13],h[15]=s[14],h[16]=s[15],h[17]=l[0],h[18]=l[1],h[19]=l[2],h[20]=l[3],h[21]=c;let d=22,u=d+a;return i.forEach((_)=>{let p=n.toPoints(_);h[d]=p.length,d++;for(let m=0;m<p.length;m++){let A=p[m];h[u+0]=A[0],h[u+1]=A[1],h[u+2]=A[2],u+=3}}),h};t.exports=o}}),Ski=At({"node_modules/@jscad/modeling/src/geometries/geom3/transform.js"(e,t){var n=kd(),o=(r,i)=>{let s=n.multiply(n.create(),r,i.transforms);return Object.assign({},i,{transforms:s})};t.exports=o}}),Pki=At({"node_modules/@jscad/modeling/src/geometries/geom3/validate.js"(e,t){var n=_c(),o=spt(),r=(s)=>{if(!o(s))throw Error("invalid geom3 structure");if(s.polygons.forEach(n.validate),i(s),!s.transforms.every(Number.isFinite))throw Error(`geom3 invalid transforms ${s.transforms}`)},i=(s)=>{let a=new Map;s.polygons.forEach(({vertices:l})=>{l.forEach((h,d)=>{let u=`${h}`,_=`${l[(d+1)%l.length]}`,p=`${u}/${_}`,m=a.has(p)?a.get(p):0;a.set(p,m+1)})});let c=[];if(a.forEach((l,h)=>{let d=h.split("/").reverse().join("/"),u=a.get(d);if(l!==u)c.push(h.replace("/"," -> "))}),c.length>0)throw Error(`non-manifold edges ${c.length}
${c.join(`
`)}`)};t.exports=r}}),Js=At({"node_modules/@jscad/modeling/src/geometries/geom3/index.js"(e,t){t.exports={clone:GQi(),create:zpe(),fromPointsConvex:gki(),fromPoints:Aki(),fromCompactBinary:fki(),invert:xki(),isA:spt(),isConvex:Cki(),toPoints:bki(),toPolygons:Ope(),toString:Iki(),toCompactBinary:vki(),transform:Ski(),validate:Pki()}}}),apt=At({"node_modules/@jscad/modeling/src/geometries/path2/clone.js"(e,t){var n=(o)=>Object.assign({},o);t.exports=n}}),Cqn=At({"node_modules/@jscad/modeling/src/geometries/path2/close.js"(e,t){var{EPS:n}=Lc(),o=Na(),r=apt(),i=(s)=>{if(s.isClosed)return s;let a=r(s);if(a.isClosed=!0,a.points.length>1){let c=a.points,l=c[0],h=c[c.length-1];while(o.distance(l,h)<n*n){if(c.pop(),c.length===1)break;h=c[c.length-1]}}return a};t.exports=i}}),Twe=At({"node_modules/@jscad/modeling/src/geometries/path2/create.js"(e,t){var n=kd(),o=(r)=>{if(r===void 0)r=[];return{points:r,isClosed:!1,transforms:n.create()}};t.exports=o}}),cpt=At({"node_modules/@jscad/modeling/src/geometries/path2/fromPoints.js"(e,t){var{EPS:n}=Lc(),o=Na(),r=Cqn(),i=Twe(),s=(a,c)=>{let l={closed:!1},{closed:h}=Object.assign({},l,a),d=i();if(d.points=c.map((u)=>o.clone(u)),d.points.length>1){let u=d.points[0],_=d.points[d.points.length-1];if(o.distance(u,_)<n*n)h=!0}if(h===!0)d=r(d);return d};t.exports=s}}),Eki=At({"node_modules/@jscad/modeling/src/geometries/path2/applyTransforms.js"(e,t){var n=kd(),o=Na(),r=(i)=>{if(n.isIdentity(i.transforms))return i;return i.points=i.points.map((s)=>o.transform(o.create(),s,i.transforms)),i.transforms=n.create(),i};t.exports=r}}),zte=At({"node_modules/@jscad/modeling/src/geometries/path2/toPoints.js"(e,t){var n=Eki(),o=(r)=>n(r).points;t.exports=o}}),Mki=At({"node_modules/@jscad/modeling/src/geometries/path2/appendArc.js"(e,t){var{TAU:n}=Lc(),o=Na(),r=cpt(),i=zte(),s=(a,c)=>{let l={radius:[0,0],xaxisrotation:0,clockwise:!1,large:!1,segments:16},{endpoint:h,radius:d,xaxisrotation:u,clockwise:_,large:p,segments:m}=Object.assign({},l,a);if(!Array.isArray(h))throw Error("endpoint must be an array of X and Y values");if(h.length<2)throw Error("endpoint must contain X and Y values");if(h=o.clone(h),!Array.isArray(d))throw Error("radius must be an array of X and Y values");if(d.length<2)throw Error("radius must contain X and Y values");if(m<4)throw Error("segments must be four or more");let A=1e5;if(c.isClosed)throw Error("the given path cannot be closed");let g=i(c);if(g.length<1)throw Error("the given path must contain one or more points (as the starting point for the arc)");let f=d[0],y=d[1],x=g[g.length-1];f=Math.round(f*A)/A,y=Math.round(y*A)/A,h=o.fromValues(Math.round(h[0]*A)/A,Math.round(h[1]*A)/A);let C=!_,b=[];if(f===0||y===0)b.push(h);else{f=Math.abs(f),y=Math.abs(y);let v=u,P=Math.cos(v),M=Math.sin(v),B=o.subtract(o.create(),x,h);o.scale(B,B,0.5);let T=Math.round((P*B[0]+M*B[1])*A)/A,N=Math.round((-M*B[0]+P*B[1])*A)/A,D=o.fromValues(T,N),L=D[0]*D[0]/(f*f)+D[1]*D[1]/(y*y);if(L>1){let ee=Math.sqrt(L);f*=ee,y*=ee,f=Math.round(f*A)/A,y=Math.round(y*A)/A}let H=Math.sqrt((f*f*y*y-f*f*D[1]*D[1]-y*y*D[0]*D[0])/(f*f*D[1]*D[1]+y*y*D[0]*D[0]));if(C===p)H=-H;let V=o.fromValues(f*D[1]/y,-y*D[0]/f);o.scale(V,V,H);let O=o.fromValues(P*V[0]-M*V[1],M*V[0]+P*V[1]);O=o.add(O,O,o.scale(o.create(),o.add(o.create(),x,h),0.5));let U=o.fromValues((D[0]-V[0])/f,(D[1]-V[1])/y),j=o.fromValues((-D[0]-V[0])/f,(-D[1]-V[1])/y),Y=o.angleRadians(U),K=o.angleRadians(j)-Y;if(K=K%n,!C&&K>0)K-=n;else if(C&&K<0)K+=n;let J=Math.floor(m*(Math.abs(K)/n));if(J<1)J=1;for(let ee=1;ee<J;ee++){let se=Y+ee/J*K,ne=Math.cos(se),re=Math.sin(se),Z=o.fromValues(P*f*ne-M*y*re,M*f*ne+P*y*re);o.add(Z,Z,O),b.push(Z)}if(J)b.push(a.endpoint)}return b=g.concat(b),r({},b)};t.exports=s}}),bqn=At({"node_modules/@jscad/modeling/src/geometries/path2/concat.js"(e,t){var n=cpt(),o=zte(),{equals:r}=Na(),i=(...s)=>{let a=!1,c=[];return s.forEach((l,h)=>{let d=o(l).slice();if(c.length>0&&d.length>0&&r(d[0],c[c.length-1]))d.shift();if(d.length>0&&a)throw Error(`Cannot concatenate to a closed path; check the ${h}th path`);a=l.isClosed,c=c.concat(d)}),n({closed:a},c)};t.exports=i}}),Iqn=At({"node_modules/@jscad/modeling/src/geometries/path2/appendPoints.js"(e,t){var n=bqn(),o=Twe(),r=(i,s)=>n(s,o(i));t.exports=r}}),wki=At({"node_modules/@jscad/modeling/src/geometries/path2/appendBezier.js"(e,t){var{TAU:n}=Lc(),o=Na(),r=Na(),i=Iqn(),s=zte(),a=(c,l)=>{let h={segments:16},{controlPoints:d,segments:u}=Object.assign({},h,c);if(!Array.isArray(d))throw Error("controlPoints must be an array of one or more points");if(d.length<1)throw Error("controlPoints must be an array of one or more points");if(u<4)throw Error("segments must be four or more");if(l.isClosed)throw Error("the given geometry cannot be closed");let _=s(l);if(_.length<1)throw Error("the given path must contain one or more points (as the starting point for the bezier curve)");if(d=d.slice(),d[0]===null){if(d.length<2)throw Error("a null control point must be passed with one more control points");let D=_[_.length-2];if("lastBezierControlPoint"in l)D=l.lastBezierControlPoint;if(!Array.isArray(D))throw Error("the given path must contain TWO or more points if given a null control point");let L=o.scale(o.create(),_[_.length-1],2);o.subtract(L,L,D),d[0]=L}d.unshift(_[_.length-1]);let m=d.length-1,A=[],g=1;for(let D=0;D<=m;++D){if(D>0)g*=D;A.push(g)}let f=[];for(let D=0;D<=m;++D){let L=A[m]/(A[D]*A[m-D]);f.push(L)}let y=o.create(),x=o.create(),C=r.create(),b=(D)=>{let L=1,H=Math.pow(1-D,m),V=D!==1?1/(1-D):1,O=o.create();for(let U=0;U<=m;++U){if(U===m)H=1;let j=f[U]*L*H,Y=o.scale(y,d[U],j);o.add(O,O,Y),L*=D,H*=V}return O},I=[],v=[],P=m+1;for(let D=0;D<P;++D){let L=D/(P-1),H=b(L);I.push(H),v.push(L)}let M=1,B=n/u,T=Math.sin(B);while(M<I.length-1){let D=o.subtract(y,I[M],I[M-1]);o.normalize(D,D);let L=o.subtract(x,I[M+1],I[M]);o.normalize(L,L);let H=o.cross(C,D,L);if(Math.abs(H[2])>T){let V=v[M-1],O=v[M+1],U=V+(O-V)*1/3,j=V+(O-V)*2/3,Y=b(U),X=b(j);if(I.splice(M,1,Y,X),v.splice(M,1,U,j),M--,M<1)M=1}else++M}I.shift();let N=i(I,l);return N.lastBezierControlPoint=d[d.length-2],N};t.exports=a}}),Bki=At({"node_modules/@jscad/modeling/src/geometries/path2/equals.js"(e,t){var n=Na(),o=zte(),r=(i,s)=>{if(i.isClosed!==s.isClosed)return!1;if(i.points.length!==s.points.length)return!1;let a=o(i),c=o(s),l=a.length,h=0;do{let d=!1;for(let u=0;u<l;u++)if(!n.equals(a[u],c[(u+h)%l])){d=!0;break}if(d===!1)return!0;if(!i.isClosed)return!1}while(++h<l);return!1};t.exports=r}}),Tki=At({"node_modules/@jscad/modeling/src/geometries/path2/fromCompactBinary.js"(e,t){var n=kd(),o=Na(),r=Twe(),i=(s)=>{if(s[0]!==2)throw Error("invalid compact binary data");let a=r();a.transforms=n.clone(s.slice(1,17)),a.isClosed=!!s[17];for(let c=22;c<s.length;c+=2){let l=o.fromValues(s[c],s[c+1]);a.points.push(l)}if(s[18]>=0)a.color=[s[18],s[19],s[20],s[21]];return a};t.exports=i}}),vqn=At({"node_modules/@jscad/modeling/src/geometries/path2/isA.js"(e,t){var n=(o)=>{if(o&&typeof o==="object"){if("points"in o&&"transforms"in o&&"isClosed"in o){if(Array.isArray(o.points)&&"length"in o.transforms)return!0}}return!1};t.exports=n}}),Dki=At({"node_modules/@jscad/modeling/src/geometries/path2/reverse.js"(e,t){var n=apt(),o=(r)=>{let i=n(r);return i.points=r.points.slice().reverse(),i};t.exports=o}}),Nki=At({"node_modules/@jscad/modeling/src/geometries/path2/toString.js"(e,t){var n=Na(),o=zte(),r=(i)=>{let s=o(i),a="path ("+s.length+" points, "+i.isClosed+`):
[
`;return s.forEach((c)=>{a+="  "+n.toString(c)+`,
`}),a+=`]
`,a};t.exports=r}}),Rki=At({"node_modules/@jscad/modeling/src/geometries/path2/toCompactBinary.js"(e,t){var n=(o)=>{let{points:r,transforms:i}=o,s=[-1,-1,-1,-1];if(o.color)s=o.color;let a=new Float32Array(22+r.length*2);a[0]=2,a[1]=i[0],a[2]=i[1],a[3]=i[2],a[4]=i[3],a[5]=i[4],a[6]=i[5],a[7]=i[6],a[8]=i[7],a[9]=i[8],a[10]=i[9],a[11]=i[10],a[12]=i[11],a[13]=i[12],a[14]=i[13],a[15]=i[14],a[16]=i[15],a[17]=o.isClosed?1:0,a[18]=s[0],a[19]=s[1],a[20]=s[2],a[21]=s[3];for(let c=0;c<r.length;c++){let l=c*2+22,h=r[c];a[l]=h[0],a[l+1]=h[1]}return a};t.exports=n}}),Qki=At({"node_modules/@jscad/modeling/src/geometries/path2/transform.js"(e,t){var n=kd(),o=(r,i)=>{let s=n.multiply(n.create(),r,i.transforms);return Object.assign({},i,{transforms:s})};t.exports=o}}),kki=At({"node_modules/@jscad/modeling/src/geometries/path2/validate.js"(e,t){var n=Na(),o=vqn(),r=(i)=>{if(!o(i))throw Error("invalid path2 structure");if(i.points.length>1){for(let s=0;s<i.points.length;s++)if(n.equals(i.points[s],i.points[(s+1)%i.points.length]))throw Error(`path2 duplicate points ${i.points[s]}`)}if(i.points.forEach((s)=>{if(!s.every(Number.isFinite))throw Error(`path2 invalid point ${s}`)}),!i.transforms.every(Number.isFinite))throw Error(`path2 invalid transforms ${i.transforms}`)};t.exports=r}}),hd=At({"node_modules/@jscad/modeling/src/geometries/path2/index.js"(e,t){t.exports={appendArc:Mki(),appendBezier:wki(),appendPoints:Iqn(),clone:apt(),close:Cqn(),concat:bqn(),create:Twe(),equals:Bki(),fromPoints:cpt(),fromCompactBinary:Tki(),isA:vqn(),reverse:Dki(),toPoints:zte(),toString:Nki(),toCompactBinary:Rki(),transform:Qki(),validate:kki()}}}),Lki=At({"node_modules/@jscad/modeling/src/colors/colorize.js"(e,t){var n=Rs(),o=la(),r=Js(),i=hd(),s=_c(),a=(u,_)=>{let p=o.clone(_);return p.color=u,p},c=(u,_)=>{let p=r.clone(_);return p.color=u,p},l=(u,_)=>{let p=i.clone(_);return p.color=u,p},h=(u,_)=>{let p=s.clone(_);return p.color=u,p},d=(u,..._)=>{if(!Array.isArray(u))throw Error("color must be an array");if(u.length<3)throw Error("color must contain R, G and B values");if(u.length===3)u=[u[0],u[1],u[2],1];if(_=n(_),_.length===0)throw Error("wrong number of arguments");let p=_.map((m)=>{if(o.isA(m))return a(u,m);if(r.isA(m))return c(u,m);if(i.isA(m))return l(u,m);if(s.isA(m))return h(u,m);return m.color=u,m});return p.length===1?p[0]:p};t.exports=d}}),Sqn=At({"node_modules/@jscad/modeling/src/colors/cssColors.js"(e,t){var n={black:[0,0,0],silver:[0.7529411764705882,0.7529411764705882,0.7529411764705882],gray:[0.5019607843137255,0.5019607843137255,0.5019607843137255],white:[1,1,1],maroon:[0.5019607843137255,0,0],red:[1,0,0],purple:[0.5019607843137255,0,0.5019607843137255],fuchsia:[1,0,1],green:[0,0.5019607843137255,0],lime:[0,1,0],olive:[0.5019607843137255,0.5019607843137255,0],yellow:[1,1,0],navy:[0,0,0.5019607843137255],blue:[0,0,1],teal:[0,0.5019607843137255,0.5019607843137255],aqua:[0,1,1],aliceblue:[0.9411764705882353,0.9725490196078431,1],antiquewhite:[0.9803921568627451,0.9215686274509803,0.8431372549019608],aquamarine:[0.4980392156862745,1,0.8313725490196079],azure:[0.9411764705882353,1,1],beige:[0.9607843137254902,0.9607843137254902,0.8627450980392157],bisque:[1,0.8941176470588236,0.7686274509803922],blanchedalmond:[1,0.9215686274509803,0.803921568627451],blueviolet:[0.5411764705882353,0.16862745098039217,0.8862745098039215],brown:[0.6470588235294118,0.16470588235294117,0.16470588235294117],burlywood:[0.8705882352941177,0.7215686274509804,0.5294117647058824],cadetblue:[0.37254901960784315,0.6196078431372549,0.6274509803921569],chartreuse:[0.4980392156862745,1,0],chocolate:[0.8235294117647058,0.4117647058823529,0.11764705882352941],coral:[1,0.4980392156862745,0.3137254901960784],cornflowerblue:[0.39215686274509803,0.5843137254901961,0.9294117647058824],cornsilk:[1,0.9725490196078431,0.8627450980392157],crimson:[0.8627450980392157,0.0784313725490196,0.23529411764705882],cyan:[0,1,1],darkblue:[0,0,0.5450980392156862],darkcyan:[0,0.5450980392156862,0.5450980392156862],darkgoldenrod:[0.7215686274509804,0.5254901960784314,0.043137254901960784],darkgray:[0.6627450980392157,0.6627450980392157,0.6627450980392157],darkgreen:[0,0.39215686274509803,0],darkgrey:[0.6627450980392157,0.6627450980392157,0.6627450980392157],darkkhaki:[0.7411764705882353,0.7176470588235294,0.4196078431372549],darkmagenta:[0.5450980392156862,0,0.5450980392156862],darkolivegreen:[0.3333333333333333,0.4196078431372549,0.1843137254901961],darkorange:[1,0.5490196078431373,0],darkorchid:[0.6,0.19607843137254902,0.8],darkred:[0.5450980392156862,0,0],darksalmon:[0.9137254901960784,0.5882352941176471,0.47843137254901963],darkseagreen:[0.5607843137254902,0.7372549019607844,0.5607843137254902],darkslateblue:[0.2823529411764706,0.23921568627450981,0.5450980392156862],darkslategray:[0.1843137254901961,0.30980392156862746,0.30980392156862746],darkslategrey:[0.1843137254901961,0.30980392156862746,0.30980392156862746],darkturquoise:[0,0.807843137254902,0.8196078431372549],darkviolet:[0.5803921568627451,0,0.8274509803921568],deeppink:[1,0.0784313725490196,0.5764705882352941],deepskyblue:[0,0.7490196078431373,1],dimgray:[0.4117647058823529,0.4117647058823529,0.4117647058823529],dimgrey:[0.4117647058823529,0.4117647058823529,0.4117647058823529],dodgerblue:[0.11764705882352941,0.5647058823529412,1],firebrick:[0.6980392156862745,0.13333333333333333,0.13333333333333333],floralwhite:[1,0.9803921568627451,0.9411764705882353],forestgreen:[0.13333333333333333,0.5450980392156862,0.13333333333333333],gainsboro:[0.8627450980392157,0.8627450980392157,0.8627450980392157],ghostwhite:[0.9725490196078431,0.9725490196078431,1],gold:[1,0.8431372549019608,0],goldenrod:[0.8549019607843137,0.6470588235294118,0.12549019607843137],greenyellow:[0.6784313725490196,1,0.1843137254901961],grey:[0.5019607843137255,0.5019607843137255,0.5019607843137255],honeydew:[0.9411764705882353,1,0.9411764705882353],hotpink:[1,0.4117647058823529,0.7058823529411765],indianred:[0.803921568627451,0.3607843137254902,0.3607843137254902],indigo:[0.29411764705882354,0,0.5098039215686274],ivory:[1,1,0.9411764705882353],khaki:[0.9411764705882353,0.9019607843137255,0.5490196078431373],lavender:[0.9019607843137255,0.9019607843137255,0.9803921568627451],lavenderblush:[1,0.9411764705882353,0.9607843137254902],lawngreen:[0.48627450980392156,0.9882352941176471,0],lemonchiffon:[1,0.9803921568627451,0.803921568627451],lightblue:[0.6784313725490196,0.8470588235294118,0.9019607843137255],lightcoral:[0.9411764705882353,0.5019607843137255,0.5019607843137255],lightcyan:[0.8784313725490196,1,1],lightgoldenrodyellow:[0.9803921568627451,0.9803921568627451,0.8235294117647058],lightgray:[0.8274509803921568,0.8274509803921568,0.8274509803921568],lightgreen:[0.5647058823529412,0.9333333333333333,0.5647058823529412],lightgrey:[0.8274509803921568,0.8274509803921568,0.8274509803921568],lightpink:[1,0.7137254901960784,0.7568627450980392],lightsalmon:[1,0.6274509803921569,0.47843137254901963],lightseagreen:[0.12549019607843137,0.6980392156862745,0.6666666666666666],lightskyblue:[0.5294117647058824,0.807843137254902,0.9803921568627451],lightslategray:[0.4666666666666667,0.5333333333333333,0.6],lightslategrey:[0.4666666666666667,0.5333333333333333,0.6],lightsteelblue:[0.6901960784313725,0.7686274509803922,0.8705882352941177],lightyellow:[1,1,0.8784313725490196],limegreen:[0.19607843137254902,0.803921568627451,0.19607843137254902],linen:[0.9803921568627451,0.9411764705882353,0.9019607843137255],magenta:[1,0,1],mediumaquamarine:[0.4,0.803921568627451,0.6666666666666666],mediumblue:[0,0,0.803921568627451],mediumorchid:[0.7294117647058823,0.3333333333333333,0.8274509803921568],mediumpurple:[0.5764705882352941,0.4392156862745098,0.8588235294117647],mediumseagreen:[0.23529411764705882,0.7019607843137254,0.44313725490196076],mediumslateblue:[0.4823529411764706,0.40784313725490196,0.9333333333333333],mediumspringgreen:[0,0.9803921568627451,0.6039215686274509],mediumturquoise:[0.2823529411764706,0.8196078431372549,0.8],mediumvioletred:[0.7803921568627451,0.08235294117647059,0.5215686274509804],midnightblue:[0.09803921568627451,0.09803921568627451,0.4392156862745098],mintcream:[0.9607843137254902,1,0.9803921568627451],mistyrose:[1,0.8941176470588236,0.8823529411764706],moccasin:[1,0.8941176470588236,0.7098039215686275],navajowhite:[1,0.8705882352941177,0.6784313725490196],oldlace:[0.9921568627450981,0.9607843137254902,0.9019607843137255],olivedrab:[0.4196078431372549,0.5568627450980392,0.13725490196078433],orange:[1,0.6470588235294118,0],orangered:[1,0.27058823529411763,0],orchid:[0.8549019607843137,0.4392156862745098,0.8392156862745098],palegoldenrod:[0.9333333333333333,0.9098039215686274,0.6666666666666666],palegreen:[0.596078431372549,0.984313725490196,0.596078431372549],paleturquoise:[0.6862745098039216,0.9333333333333333,0.9333333333333333],palevioletred:[0.8588235294117647,0.4392156862745098,0.5764705882352941],papayawhip:[1,0.9372549019607843,0.8352941176470589],peachpuff:[1,0.8549019607843137,0.7254901960784313],peru:[0.803921568627451,0.5215686274509804,0.24705882352941178],pink:[1,0.7529411764705882,0.796078431372549],plum:[0.8666666666666667,0.6274509803921569,0.8666666666666667],powderblue:[0.6901960784313725,0.8784313725490196,0.9019607843137255],rosybrown:[0.7372549019607844,0.5607843137254902,0.5607843137254902],royalblue:[0.2549019607843137,0.4117647058823529,0.8823529411764706],saddlebrown:[0.5450980392156862,0.27058823529411763,0.07450980392156863],salmon:[0.9803921568627451,0.5019607843137255,0.4470588235294118],sandybrown:[0.9568627450980393,0.6431372549019608,0.3764705882352941],seagreen:[0.1803921568627451,0.5450980392156862,0.3411764705882353],seashell:[1,0.9607843137254902,0.9333333333333333],sienna:[0.6274509803921569,0.3215686274509804,0.17647058823529413],skyblue:[0.5294117647058824,0.807843137254902,0.9215686274509803],slateblue:[0.41568627450980394,0.35294117647058826,0.803921568627451],slategray:[0.4392156862745098,0.5019607843137255,0.5647058823529412],slategrey:[0.4392156862745098,0.5019607843137255,0.5647058823529412],snow:[1,0.9803921568627451,0.9803921568627451],springgreen:[0,1,0.4980392156862745],steelblue:[0.27450980392156865,0.5098039215686274,0.7058823529411765],tan:[0.8235294117647058,0.7058823529411765,0.5490196078431373],thistle:[0.8470588235294118,0.7490196078431373,0.8470588235294118],tomato:[1,0.38823529411764707,0.2784313725490196],turquoise:[0.25098039215686274,0.8784313725490196,0.8156862745098039],violet:[0.9333333333333333,0.5098039215686274,0.9333333333333333],wheat:[0.9607843137254902,0.8705882352941177,0.7019607843137254],whitesmoke:[0.9607843137254902,0.9607843137254902,0.9607843137254902],yellowgreen:[0.6039215686274509,0.803921568627451,0.19607843137254902]};t.exports=n}}),Hki=At({"node_modules/@jscad/modeling/src/colors/colorNameToRgb.js"(e,t){var n=Sqn(),o=(r)=>n[r.toLowerCase()];t.exports=o}}),Fki=At({"node_modules/@jscad/modeling/src/colors/hexToRgb.js"(e,t){var n=(o)=>{if(o=o.replace("#",""),o.length<6)throw Error("the given notation must contain 3 or more hex values");let r=parseInt(o.substring(0,2),16)/255,i=parseInt(o.substring(2,4),16)/255,s=parseInt(o.substring(4,6),16)/255;if(o.length>=8){let a=parseInt(o.substring(6,8),16)/255;return[r,i,s,a]}return[r,i,s]};t.exports=n}}),Pqn=At({"node_modules/@jscad/modeling/src/colors/hueToColorComponent.js"(e,t){var n=(o,r,i)=>{if(i<0)i+=1;if(i>1)i-=1;if(i<0.16666666666666666)return o+(r-o)*6*i;if(i<0.5)return r;if(i<0.6666666666666666)return o+(r-o)*(0.6666666666666666-i)*6;return o};t.exports=n}}),zki=At({"node_modules/@jscad/modeling/src/colors/hslToRgb.js"(e,t){var n=Rs(),o=Pqn(),r=(...i)=>{if(i=n(i),i.length<3)throw Error("values must contain H, S and L values");let s=i[0],a=i[1],c=i[2],l=c,h=c,d=c;if(a!==0){let u=c<0.5?c*(1+a):c+a-c*a,_=2*c-u;l=o(_,u,s+0.3333333333333333),h=o(_,u,s),d=o(_,u,s-0.3333333333333333)}if(i.length>3){let u=i[3];return[l,h,d,u]}return[l,h,d]};t.exports=r}}),Oki=At({"node_modules/@jscad/modeling/src/colors/hsvToRgb.js"(e,t){var n=Rs(),o=(...r)=>{if(r=n(r),r.length<3)throw Error("values must contain H, S and V values");let i=r[0],s=r[1],a=r[2],c=0,l=0,h=0,d=Math.floor(i*6),u=i*6-d,_=a*(1-s),p=a*(1-u*s),m=a*(1-(1-u)*s);switch(d%6){case 0:c=a,l=m,h=_;break;case 1:c=p,l=a,h=_;break;case 2:c=_,l=a,h=m;break;case 3:c=_,l=p,h=a;break;case 4:c=m,l=_,h=a;break;case 5:c=a,l=_,h=p;break}if(r.length>3){let A=r[3];return[c,l,h,A]}return[c,l,h]};t.exports=o}}),Vki=At({"node_modules/@jscad/modeling/src/colors/rgbToHex.js"(e,t){var n=Rs(),o=(...r)=>{if(r=n(r),r.length<3)throw Error("values must contain R, G and B values");let i=r[0]*255,s=r[1]*255,a=r[2]*255,c=`#${Number(16777216+i*65536+s*256+a).toString(16).substring(1,7)}`;if(r.length>3)c=c+Number(r[3]*255).toString(16);return c};t.exports=o}}),Yki=At({"node_modules/@jscad/modeling/src/colors/rgbToHsl.js"(e,t){var n=Rs(),o=(...r)=>{if(r=n(r),r.length<3)throw Error("values must contain R, G and B values");let i=r[0],s=r[1],a=r[2],c=Math.max(i,s,a),l=Math.min(i,s,a),h,d,u=(c+l)/2;if(c===l)h=d=0;else{let _=c-l;switch(d=u>0.5?_/(2-c-l):_/(c+l),c){case i:h=(s-a)/_+(s<a?6:0);break;case s:h=(a-i)/_+2;break;case a:h=(i-s)/_+4;break}h/=6}if(r.length>3){let _=r[3];return[h,d,u,_]}return[h,d,u]};t.exports=o}}),Gki=At({"node_modules/@jscad/modeling/src/colors/rgbToHsv.js"(e,t){var n=Rs(),o=(...r)=>{if(r=n(r),r.length<3)throw Error("values must contain R, G and B values");let i=r[0],s=r[1],a=r[2],c=Math.max(i,s,a),l=Math.min(i,s,a),h,d=c,u=c-l,_=c===0?0:u/c;if(c===l)h=0;else{switch(c){case i:h=(s-a)/u+(s<a?6:0);break;case s:h=(a-i)/u+2;break;case a:h=(i-s)/u+4;break}h/=6}if(r.length>3){let p=r[3];return[h,_,d,p]}return[h,_,d]};t.exports=o}}),Dwe=At({"node_modules/@jscad/modeling/src/colors/index.js"(e,t){t.exports={colorize:Lki(),colorNameToRgb:Hki(),cssColors:Sqn(),hexToRgb:Fki(),hslToRgb:zki(),hsvToRgb:Oki(),hueToColorComponent:Pqn(),rgbToHex:Vki(),rgbToHsl:Yki(),rgbToHsv:Gki()}}}),Uki=At({"node_modules/@jscad/modeling/src/curves/bezier/create.js"(e,t){var n=(s)=>{if(!Array.isArray(s))throw Error("Bezier points must be a valid array/");if(s.length<2)throw Error("Bezier points must contain at least 2 values.");let a=o(s);return{points:s,pointType:a,dimensions:a==="float_single"?0:s[0].length,permutations:r(s.length-1),tangentPermutations:r(s.length-2)}},o=function(s){let a=null;return s.forEach((c)=>{let l="";if(Number.isFinite(c))l="float_single";else if(Array.isArray(c))c.forEach((h)=>{if(!Number.isFinite(h))throw Error("Bezier point values must all be numbers.")}),l="float_"+c.length;else throw Error("Bezier points must all be numbers or arrays of number.");if(a==null)a=l;else if(a!==l)throw Error("Bezier points must be either all numbers or all arrays of numbers of the same size.")}),a},r=function(s){let a=[];for(let c=0;c<=s;c++)a.push(i(s)/(i(c)*i(s-c)));return a},i=function(s){let a=1;for(let c=2;c<=s;c++)a*=c;return a};t.exports=n}}),Eqn=At({"node_modules/@jscad/modeling/src/curves/bezier/valueAt.js"(e,t){var n=(r,i)=>{if(r<0||r>1)throw Error("Bezier valueAt() input must be between 0 and 1");if(i.pointType==="float_single")return o(i,i.points,r);else{let s=[];for(let a=0;a<i.dimensions;a++){let c=[];for(let l=0;l<i.points.length;l++)c.push(i.points[l][a]);s.push(o(i,c,r))}return s}},o=function(r,i,s){let a=i.length-1,c=0;for(let l=0;l<=a;l++)c+=r.permutations[l]*Math.pow(1-s,a-l)*Math.pow(s,l)*i[l];return c};t.exports=n}}),Wki=At({"node_modules/@jscad/modeling/src/curves/bezier/tangentAt.js"(e,t){var n=(r,i)=>{if(r<0||r>1)throw Error("Bezier tangentAt() input must be between 0 and 1");if(i.pointType==="float_single")return o(i,i.points,r);else{let s=[];for(let a=0;a<i.dimensions;a++){let c=[];for(let l=0;l<i.points.length;l++)c.push(i.points[l][a]);s.push(o(i,c,r))}return s}},o=function(r,i,s){let a=i.length-1,c=0;for(let l=0;l<a;l++){let h=a*(i[l+1]-i[l]);c+=r.tangentPermutations[l]*Math.pow(1-s,a-1-l)*Math.pow(s,l)*h}return c};t.exports=n}}),lpt=At({"node_modules/@jscad/modeling/src/curves/bezier/lengths.js"(e,t){var n=Eqn(),o=(i,s)=>{let a=0,c=[0],l=n(0,s);for(let h=1;h<=i;h++){let d=n(h/i,s);a+=r(d,l),c.push(a),l=d}return c},r=(i,s)=>{if(Number.isFinite(i)&&Number.isFinite(s))return Math.abs(i-s);else if(Array.isArray(i)&&Array.isArray(s)){if(i.length!==s.length)throw Error("The operands must have the same number of dimensions.");let a=0;for(let c=0;c<i.length;c++)a+=(s[c]-i[c])*(s[c]-i[c]);return Math.sqrt(a)}else throw Error("The operands must be of the same type, either number or array.")};t.exports=o}}),Xki=At({"node_modules/@jscad/modeling/src/curves/bezier/length.js"(e,t){var n=lpt(),o=(r,i)=>n(r,i)[r];t.exports=o}}),jki=At({"node_modules/@jscad/modeling/src/curves/bezier/arcLengthToT.js"(e,t){var n=lpt(),o=(r,i)=>{let s={distance:0,segments:100},{distance:a,segments:c}=Object.assign({},s,r),l=n(c,i),h=0,d=c;while(h<=d){let g=Math.floor(h+(d-h)/2),f=l[g]-a;if(f<0)h=g+1;else if(f>0)d=g-1;else{d=g;break}}let u=d;if(l[u]===a)return u/c;let _=l[u],m=l[u+1]-_,A=(a-_)/m;return(u+A)/c};t.exports=o}}),Kki=At({"node_modules/@jscad/modeling/src/curves/bezier/index.js"(e,t){t.exports={create:Uki(),valueAt:Eqn(),tangentAt:Wki(),lengths:lpt(),length:Xki(),arcLengthToT:jki()}}}),$ki=At({"node_modules/@jscad/modeling/src/curves/index.js"(e,t){t.exports={bezier:Kki()}}}),Nwe=At({"node_modules/@jscad/modeling/src/maths/utils/area.js"(e,t){var n=(o)=>{let r=0;for(let i=0;i<o.length;i++){let s=(i+1)%o.length;r+=o[i][0]*o[s][1],r-=o[s][0]*o[i][1]}return r/2};t.exports=n}}),Mqn=At({"node_modules/@jscad/modeling/src/geometries/poly2/measureArea.js"(e,t){var n=Nwe(),o=(r)=>n(r.vertices);t.exports=o}}),wqn=At({"node_modules/@jscad/modeling/src/geometries/poly2/create.js"(e,t){var n=(o)=>{if(o===void 0||o.length<3)o=[];return{vertices:o}};t.exports=n}}),Bqn=At({"node_modules/@jscad/modeling/src/geometries/poly2/flip.js"(e,t){var n=wqn(),o=(r)=>{let i=r.vertices.slice().reverse();return n(i)};t.exports=o}}),qki=At({"node_modules/@jscad/modeling/src/geometries/poly2/arePointsInside.js"(e,t){var n=Mqn(),o=Bqn(),r=(s,a)=>{if(s.length===0)return 0;let c=a.vertices;if(c.length<3)return 0;if(n(a)<0)a=o(a);return s.reduce((h,d)=>h+i(d,c),0)===s.length?1:0},i=(s,a)=>{let c=a.length,l=s[0],h=s[1],d=a[c-1],u=a[0],_=d[1]>h,p=0,m=0;for(let A=c+1;--A;){let g=u[1]>h;if(_!==g){let f=d[0]>l,y=u[0]>l;if(f&&y)p=!p;else if(u[0]-(u[1]-h)*(d[0]-u[0])/(d[1]-u[1])>=l)p=!p}_=g,d=u,u=a[++m]}return p};t.exports=r}}),hpt=At({"node_modules/@jscad/modeling/src/geometries/poly2/index.js"(e,t){t.exports={arePointsInside:qki(),create:wqn(),flip:Bqn(),measureArea:Mqn()}}}),dpt=At({"node_modules/@jscad/modeling/src/geometries/index.js"(e,t){t.exports={geom2:la(),geom3:Js(),path2:hd(),poly2:hpt(),poly3:_c()}}}),upt=At({"node_modules/@jscad/modeling/src/maths/line2/create.js"(e,t){var n=()=>[0,1,0];t.exports=n}}),Jki=At({"node_modules/@jscad/modeling/src/maths/line2/clone.js"(e,t){var n=upt(),o=(r)=>{let i=n();return i[0]=r[0],i[1]=r[1],i[2]=r[2],i};t.exports=o}}),ppt=At({"node_modules/@jscad/modeling/src/maths/line2/direction.js"(e,t){var n=Na(),o=(r)=>{let i=n.normal(n.create(),r);return n.negate(i,i),i};t.exports=o}}),Rwe=At({"node_modules/@jscad/modeling/src/maths/line2/origin.js"(e,t){var n=Na(),o=(r)=>n.scale(n.create(),r,r[2]);t.exports=o}}),Zki=At({"node_modules/@jscad/modeling/src/maths/line2/closestPoint.js"(e,t){var n=Na(),o=ppt(),r=Rwe(),i=(s,a)=>{let c=r(s),l=o(s),h=n.subtract(n.create(),a,c),d=n.dot(h,l);return n.scale(h,l,d),n.add(h,h,c),h};t.exports=i}}),Tqn=At({"node_modules/@jscad/modeling/src/maths/line2/copy.js"(e,t){var n=(o,r)=>(o[0]=r[0],o[1]=r[1],o[2]=r[2],o);t.exports=n}}),eLi=At({"node_modules/@jscad/modeling/src/maths/line2/distanceToPoint.js"(e,t){var n=Na(),o=(r,i)=>{let s=n.dot(i,r);return s=Math.abs(s-r[2]),s};t.exports=o}}),tLi=At({"node_modules/@jscad/modeling/src/maths/line2/equals.js"(e,t){var n=(o,r)=>o[0]===r[0]&&(o[1]===r[1]&&o[2]===r[2]);t.exports=n}}),Dqn=At({"node_modules/@jscad/modeling/src/maths/line2/fromPoints.js"(e,t){var n=Na(),o=(r,i,s)=>{let a=n.subtract(n.create(),s,i);n.normal(a,a),n.normalize(a,a);let c=n.dot(i,a);return r[0]=a[0],r[1]=a[1],r[2]=c,r};t.exports=o}}),Nqn=At({"node_modules/@jscad/modeling/src/maths/line2/fromValues.js"(e,t){var n=upt(),o=(r,i,s)=>{let a=n();return a[0]=r,a[1]=i,a[2]=s,a};t.exports=o}}),mpt=At({"node_modules/@jscad/modeling/src/maths/utils/aboutEqualNormals.js"(e,t){var{NEPS:n}=Lc(),o=(r,i)=>Math.abs(r[0]-i[0])<=n&&Math.abs(r[1]-i[1])<=n&&Math.abs(r[2]-i[2])<=n;t.exports=o}}),Rqn=At({"node_modules/@jscad/modeling/src/maths/utils/interpolateBetween2DPointsForY.js"(e,t){var n=(o,r,i)=>{let s=i-o[1],a=r[1]-o[1];if(a<0)s=-s,a=-a;let c;if(s<=0)c=0;else if(s>=a)c=1;else if(a<0.0000000001)c=0.5;else c=s/a;return o[0]+c*(r[0]-o[0])};t.exports=n}}),Qqn=At({"node_modules/@jscad/modeling/src/maths/utils/intersect.js"(e,t){var n=(o,r,i,s)=>{if(o[0]===r[0]&&o[1]===r[1]||i[0]===s[0]&&i[1]===s[1])return;let a=(s[1]-i[1])*(r[0]-o[0])-(s[0]-i[0])*(r[1]-o[1]);if(Math.abs(a)<Number.MIN_VALUE)return;let c=((s[0]-i[0])*(o[1]-i[1])-(s[1]-i[1])*(o[0]-i[0]))/a,l=((r[0]-o[0])*(o[1]-i[1])-(r[1]-o[1])*(o[0]-i[0]))/a;if(c<0||c>1||l<0||l>1)return;let h=o[0]+c*(r[0]-o[0]),d=o[1]+c*(r[1]-o[1]);return[h,d]};t.exports=n}}),nLi=At({"node_modules/@jscad/modeling/src/maths/utils/solve2Linear.js"(e,t){var n=(o,r,i,s,a,c)=>{let h=1/(o*s-r*i),d=a*s-r*c,u=-a*i+o*c;return d*=h,u*=h,[d,u]};t.exports=n}}),Vpe=At({"node_modules/@jscad/modeling/src/maths/utils/index.js"(e,t){t.exports={aboutEqualNormals:mpt(),area:Nwe(),cos:S2().cos,interpolateBetween2DPointsForY:Rqn(),intersect:Qqn(),sin:S2().sin,solve2Linear:nLi()}}}),oLi=At({"node_modules/@jscad/modeling/src/maths/line2/intersectPointOfLines.js"(e,t){var n=Na(),{solve2Linear:o}=Vpe(),r=(i,s)=>{let a=o(i[0],i[1],s[0],s[1],i[2],s[2]);return n.clone(a)};t.exports=r}}),rLi=At({"node_modules/@jscad/modeling/src/maths/line2/reverse.js"(e,t){var n=Na(),o=Tqn(),r=Nqn(),i=(s,a)=>{let c=n.negate(n.create(),a),l=-a[2];return o(s,r(c[0],c[1],l))};t.exports=i}}),iLi=At({"node_modules/@jscad/modeling/src/maths/line2/toString.js"(e,t){var n=(o)=>`line2: (${o[0].toFixed(7)}, ${o[1].toFixed(7)}, ${o[2].toFixed(7)})`;t.exports=n}}),sLi=At({"node_modules/@jscad/modeling/src/maths/line2/transform.js"(e,t){var n=Na(),o=Dqn(),r=Rwe(),i=ppt(),s=(a,c,l)=>{let h=r(c),d=i(c);return n.transform(h,h,l),n.transform(d,d,l),o(a,h,d)};t.exports=s}}),aLi=At({"node_modules/@jscad/modeling/src/maths/line2/xAtY.js"(e,t){var n=Rwe(),o=(r,i)=>{let s=(r[2]-r[1]*i)/r[0];if(Number.isNaN(s))s=n(r)[0];return s};t.exports=o}}),_pt=At({"node_modules/@jscad/modeling/src/maths/line2/index.js"(e,t){t.exports={clone:Jki(),closestPoint:Zki(),copy:Tqn(),create:upt(),direction:ppt(),distanceToPoint:eLi(),equals:tLi(),fromPoints:Dqn(),fromValues:Nqn(),intersectPointOfLines:oLi(),origin:Rwe(),reverse:rLi(),toString:iLi(),transform:sLi(),xAtY:aLi()}}}),kqn=At({"node_modules/@jscad/modeling/src/maths/line3/create.js"(e,t){var n=Ai(),o=()=>[n.fromValues(0,0,0),n.fromValues(0,0,1)];t.exports=o}}),cLi=At({"node_modules/@jscad/modeling/src/maths/line3/clone.js"(e,t){var n=Ai(),o=kqn(),r=(i)=>{let s=o();return n.copy(s[0],i[0]),n.copy(s[1],i[1]),s};t.exports=r}}),Lqn=At({"node_modules/@jscad/modeling/src/maths/line3/closestPoint.js"(e,t){var n=Ai(),o=(r,i)=>{let s=r[0],a=r[1],c=n.dot(n.subtract(n.create(),i,s),a),l=n.dot(a,a),h=c/l,d=n.scale(n.create(),a,h);return n.add(d,d,s),d};t.exports=o}}),lLi=At({"node_modules/@jscad/modeling/src/maths/line3/copy.js"(e,t){var n=Ai(),o=(r,i)=>(n.copy(r[0],i[0]),n.copy(r[1],i[1]),r);t.exports=o}}),hLi=At({"node_modules/@jscad/modeling/src/maths/line3/direction.js"(e,t){var n=(o)=>o[1];t.exports=n}}),dLi=At({"node_modules/@jscad/modeling/src/maths/line3/distanceToPoint.js"(e,t){var n=Ai(),o=Lqn(),r=(i,s)=>{let a=o(i,s),c=n.subtract(n.create(),s,a);return n.length(c)};t.exports=r}}),uLi=At({"node_modules/@jscad/modeling/src/maths/line3/equals.js"(e,t){var n=Ai(),o=(r,i)=>{if(!n.equals(r[1],i[1]))return!1;if(!n.equals(r[0],i[0]))return!1;return!0};t.exports=o}}),Ype=At({"node_modules/@jscad/modeling/src/maths/line3/fromPointAndDirection.js"(e,t){var n=Ai(),o=(r,i,s)=>{let a=n.normalize(n.create(),s);return n.copy(r[0],i),n.copy(r[1],a),r};t.exports=o}}),pLi=At({"node_modules/@jscad/modeling/src/maths/line3/fromPlanes.js"(e,t){var n=Ai(),{solve2Linear:o}=Vpe(),{EPS:r}=Lc(),i=Ype(),s=(a,c,l)=>{let h=n.cross(n.create(),c,l),d=n.length(h);if(d<r)throw Error("parallel planes do not intersect");d=1/d,h=n.scale(h,h,d);let u=Math.abs(h[0]),_=Math.abs(h[1]),p=Math.abs(h[2]),m,A;if(u>=_&&u>=p)A=o(c[1],c[2],l[1],l[2],c[3],l[3]),m=n.fromValues(0,A[0],A[1]);else if(_>=u&&_>=p)A=o(c[0],c[2],l[0],l[2],c[3],l[3]),m=n.fromValues(A[0],0,A[1]);else A=o(c[0],c[1],l[0],l[1],c[3],l[3]),m=n.fromValues(A[0],A[1],0);return i(a,m,h)};t.exports=s}}),mLi=At({"node_modules/@jscad/modeling/src/maths/line3/fromPoints.js"(e,t){var n=Ai(),o=Ype(),r=(i,s,a)=>{let c=n.subtract(n.create(),a,s);return o(i,s,c)};t.exports=r}}),_Li=At({"node_modules/@jscad/modeling/src/maths/line3/intersectPointOfLineAndPlane.js"(e,t){var n=Ai(),o=(r,i)=>{let s=i,a=i[3],c=r[0],l=r[1],h=(a-n.dot(s,c))/n.dot(s,l);return n.add(n.create(),c,n.scale(n.create(),l,h))};t.exports=o}}),gLi=At({"node_modules/@jscad/modeling/src/maths/line3/origin.js"(e,t){var n=(o)=>o[0];t.exports=n}}),ALi=At({"node_modules/@jscad/modeling/src/maths/line3/reverse.js"(e,t){var n=Ai(),o=Ype(),r=(i,s)=>{let a=n.clone(s[0]),c=n.negate(n.create(),s[1]);return o(i,a,c)};t.exports=r}}),fLi=At({"node_modules/@jscad/modeling/src/maths/line3/toString.js"(e,t){var n=(o)=>{let r=o[0],i=o[1];return`line3: point: (${r[0].toFixed(7)}, ${r[1].toFixed(7)}, ${r[2].toFixed(7)}) direction: (${i[0].toFixed(7)}, ${i[1].toFixed(7)}, ${i[2].toFixed(7)})`};t.exports=n}}),yLi=At({"node_modules/@jscad/modeling/src/maths/line3/transform.js"(e,t){var n=Ai(),o=Ype(),r=(i,s,a)=>{let c=s[0],l=s[1],h=n.add(n.create(),c,l),d=n.transform(n.create(),c,a),u=n.transform(h,h,a),_=n.subtract(u,u,d);return o(i,d,_)};t.exports=r}}),xLi=At({"node_modules/@jscad/modeling/src/maths/line3/index.js"(e,t){t.exports={clone:cLi(),closestPoint:Lqn(),copy:lLi(),create:kqn(),direction:hLi(),distanceToPoint:dLi(),equals:uLi(),fromPlanes:pLi(),fromPointAndDirection:Ype(),fromPoints:mLi(),intersectPointOfLineAndPlane:_Li(),origin:gLi(),reverse:ALi(),toString:fLi(),transform:yLi()}}}),CLi=At({"node_modules/@jscad/modeling/src/maths/index.js"(e,t){t.exports={constants:Lc(),line2:_pt(),line3:xLi(),mat4:kd(),plane:IE(),utils:Vpe(),vec2:Na(),vec3:Ai(),vec4:xqn()}}}),Hqn=At({"node_modules/@jscad/modeling/src/measurements/measureArea.js"(e,t){var n=Rs(),o=la(),r=Js(),i=hd(),s=_c(),a=new WeakMap,c=()=>0,l=(u)=>{let _=a.get(u);if(_)return _;return _=o.toSides(u).reduce((m,A)=>m+(A[0][0]*A[1][1]-A[0][1]*A[1][0]),0),_*=0.5,a.set(u,_),_},h=(u)=>{let _=a.get(u);if(_)return _;return _=r.toPolygons(u).reduce((m,A)=>m+s.measureArea(A),0),a.set(u,_),_},d=(...u)=>{if(u=n(u),u.length===0)throw Error("wrong number of arguments");let _=u.map((p)=>{if(i.isA(p))return c(p);if(o.isA(p))return l(p);if(r.isA(p))return h(p);return 0});return _.length===1?_[0]:_};t.exports=d}}),bLi=At({"node_modules/@jscad/modeling/src/measurements/measureAggregateArea.js"(e,t){var n=Rs(),o=Hqn(),r=(...i)=>{if(i=n(i),i.length===0)throw Error("measureAggregateArea: no geometries supplied");let s=o(i);if(i.length===1)return s;let a=0;return s.reduce((c,l)=>c+l,a)};t.exports=r}}),lU=At({"node_modules/@jscad/modeling/src/measurements/measureBoundingBox.js"(e,t){var n=Rs(),o=Na(),r=Ai(),i=la(),s=Js(),a=hd(),c=_c(),l=new WeakMap,h=(p)=>{let m=l.get(p);if(m)return m;let A=a.toPoints(p),g;if(A.length===0)g=o.create();else g=o.clone(A[0]);let f=o.clone(g);return A.forEach((y)=>{o.min(g,g,y),o.max(f,f,y)}),g=[g[0],g[1],0],f=[f[0],f[1],0],m=[g,f],l.set(p,m),m},d=(p)=>{let m=l.get(p);if(m)return m;let A=i.toPoints(p),g;if(A.length===0)g=o.create();else g=o.clone(A[0]);let f=o.clone(g);return A.forEach((y)=>{o.min(g,g,y),o.max(f,f,y)}),g=[g[0],g[1],0],f=[f[0],f[1],0],m=[g,f],l.set(p,m),m},u=(p)=>{let m=l.get(p);if(m)return m;let A=s.toPolygons(p),g=r.create();if(A.length>0){let y=c.toPoints(A[0]);r.copy(g,y[0])}let f=r.clone(g);return A.forEach((y)=>{c.toPoints(y).forEach((x)=>{r.min(g,g,x),r.max(f,f,x)})}),g=[g[0],g[1],g[2]],f=[f[0],f[1],f[2]],m=[g,f],l.set(p,m),m},_=(...p)=>{if(p=n(p),p.length===0)throw Error("wrong number of arguments");let m=p.map((A)=>{if(a.isA(A))return h(A);if(i.isA(A))return d(A);if(s.isA(A))return u(A);return[[0,0,0],[0,0,0]]});return m.length===1?m[0]:m};t.exports=_}}),gpt=At({"node_modules/@jscad/modeling/src/measurements/measureAggregateBoundingBox.js"(e,t){var n=Rs(),o=J$n(),r=q$n(),i=lU(),s=(...a)=>{if(a=n(a),a.length===0)throw Error("measureAggregateBoundingBox: no geometries supplied");let c=i(a);if(a.length===1)return c;let l=[[Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE],[-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE]];return c.reduce((h,d)=>(h=[o(h[0],h[0],d[0]),r(h[1],h[1],d[1])],h),l)};t.exports=s}}),Fqn=At({"node_modules/@jscad/modeling/src/measurements/calculateEpsilonFromBounds.js"(e,t){var{EPS:n}=Lc(),o=(r,i)=>{let s=0;for(let a=0;a<i;a++)s+=r[1][a]-r[0][a];return n*s/i};t.exports=o}}),ILi=At({"node_modules/@jscad/modeling/src/measurements/measureAggregateEpsilon.js"(e,t){var n=Rs(),o=gpt(),r=Fqn(),{geom2:i,geom3:s,path2:a}=dpt(),c=(...l)=>{if(l=n(l),l.length===0)throw Error("measureAggregateEpsilon: no geometries supplied");let h=o(l),d=0;return d=l.reduce((u,_)=>{if(a.isA(_)||i.isA(_))return Math.max(u,2);if(s.isA(_))return Math.max(u,3);return 0},d),r(h,d)};t.exports=c}}),zqn=At({"node_modules/@jscad/modeling/src/measurements/measureVolume.js"(e,t){var n=Rs(),o=la(),r=Js(),i=hd(),s=_c(),a=new WeakMap,c=()=>0,l=()=>0,h=(u)=>{let _=a.get(u);if(_)return _;return _=r.toPolygons(u).reduce((m,A)=>m+s.measureSignedVolume(A),0),a.set(u,_),_},d=(...u)=>{if(u=n(u),u.length===0)throw Error("wrong number of arguments");let _=u.map((p)=>{if(i.isA(p))return c(p);if(o.isA(p))return l(p);if(r.isA(p))return h(p);return 0});return _.length===1?_[0]:_};t.exports=d}}),vLi=At({"node_modules/@jscad/modeling/src/measurements/measureAggregateVolume.js"(e,t){var n=Rs(),o=zqn(),r=(...i)=>{if(i=n(i),i.length===0)throw Error("measureAggregateVolume: no geometries supplied");let s=o(i);if(i.length===1)return s;let a=0;return s.reduce((c,l)=>c+l,a)};t.exports=r}}),SLi=At({"node_modules/@jscad/modeling/src/measurements/measureBoundingSphere.js"(e,t){var n=Rs(),o=Na(),r=Ai(),i=la(),s=Js(),a=hd(),c=_c(),l=new WeakMap,h=(p)=>{let m=l.get(p);if(m!==void 0)return m;let A=r.create(),g=0,f=a.toPoints(p);if(f.length>0){let y=0,x=r.create();f.forEach((C)=>{r.add(A,A,r.fromVec2(x,C,0)),y++}),r.scale(A,A,1/y),f.forEach((C)=>{g=Math.max(g,o.squaredDistance(A,C))}),g=Math.sqrt(g)}return m=[A,g],l.set(p,m),m},d=(p)=>{let m=l.get(p);if(m!==void 0)return m;let A=r.create(),g=0,f=i.toSides(p);if(f.length>0){let y=0,x=r.create();f.forEach((C)=>{r.add(A,A,r.fromVec2(x,C[0],0)),y++}),r.scale(A,A,1/y),f.forEach((C)=>{g=Math.max(g,o.squaredDistance(A,C[0]))}),g=Math.sqrt(g)}return m=[A,g],l.set(p,m),m},u=(p)=>{let m=l.get(p);if(m!==void 0)return m;let A=r.create(),g=0,f=s.toPolygons(p);if(f.length>0){let y=0;f.forEach((x)=>{c.toPoints(x).forEach((C)=>{r.add(A,A,C),y++})}),r.scale(A,A,1/y),f.forEach((x)=>{c.toPoints(x).forEach((C)=>{g=Math.max(g,r.squaredDistance(A,C))})}),g=Math.sqrt(g)}return m=[A,g],l.set(p,m),m},_=(...p)=>{p=n(p);let m=p.map((A)=>{if(a.isA(A))return h(A);if(i.isA(A))return d(A);if(s.isA(A))return u(A);return[[0,0,0],0]});return m.length===1?m[0]:m};t.exports=_}}),PLi=At({"node_modules/@jscad/modeling/src/measurements/measureCenter.js"(e,t){var n=Rs(),o=lU(),r=(...i)=>{i=n(i);let s=i.map((a)=>{let c=o(a);return[c[0][0]+(c[1][0]-c[0][0])/2,c[0][1]+(c[1][1]-c[0][1])/2,c[0][2]+(c[1][2]-c[0][2])/2]});return s.length===1?s[0]:s};t.exports=r}}),ELi=At({"node_modules/@jscad/modeling/src/measurements/measureCenterOfMass.js"(e,t){var n=Rs(),o=Ai(),r=la(),i=Js(),s=new WeakMap,a=(h)=>{let d=s.get(h);if(d!==void 0)return d;let u=r.toSides(h),_=0,p=0,m=0;if(u.length>0){for(let g=0;g<u.length;g++){let f=u[g][0],y=u[g][1],x=f[0]*y[1]-f[1]*y[0];_+=x,p+=(f[0]+y[0])*x,m+=(f[1]+y[1])*x}_/=2;let A=1/(_*6);p*=A,m*=A}return d=o.fromValues(p,m,0),s.set(h,d),d},c=(h)=>{let d=s.get(h);if(d!==void 0)return d;d=o.create();let u=i.toPolygons(h);if(u.length===0)return d;let _=0,p=o.create();return u.forEach((m)=>{let A=m.vertices;for(let g=0;g<A.length-2;g++){o.cross(p,A[g+1],A[g+2]);let f=o.dot(A[0],p)/6;_+=f,o.add(p,A[0],A[g+1]),o.add(p,p,A[g+2]);let y=o.scale(p,p,0.25*f);o.add(d,d,y)}}),o.scale(d,d,1/_),s.set(h,d),d},l=(...h)=>{h=n(h);let d=h.map((u)=>{if(r.isA(u))return a(u);if(i.isA(u))return c(u);return[0,0,0]});return d.length===1?d[0]:d};t.exports=l}}),MLi=At({"node_modules/@jscad/modeling/src/measurements/measureDimensions.js"(e,t){var n=Rs(),o=lU(),r=(...i)=>{i=n(i);let s=i.map((a)=>{let c=o(a);return[c[1][0]-c[0][0],c[1][1]-c[0][1],c[1][2]-c[0][2]]});return s.length===1?s[0]:s};t.exports=r}}),hH=At({"node_modules/@jscad/modeling/src/measurements/measureEpsilon.js"(e,t){var n=Rs(),{geom2:o,geom3:r,path2:i}=dpt(),s=Fqn(),a=lU(),c=(u)=>s(a(u),2),l=(u)=>s(a(u),2),h=(u)=>s(a(u),3),d=(...u)=>{if(u=n(u),u.length===0)throw Error("wrong number of arguments");let _=u.map((p)=>{if(i.isA(p))return c(p);if(o.isA(p))return l(p);if(r.isA(p))return h(p);return 0});return _.length===1?_[0]:_};t.exports=d}}),Oqn=At({"node_modules/@jscad/modeling/src/measurements/index.js"(e,t){t.exports={measureAggregateArea:bLi(),measureAggregateBoundingBox:gpt(),measureAggregateEpsilon:ILi(),measureAggregateVolume:vLi(),measureArea:Hqn(),measureBoundingBox:lU(),measureBoundingSphere:SLi(),measureCenter:PLi(),measureCenterOfMass:ELi(),measureDimensions:MLi(),measureEpsilon:hH(),measureVolume:zqn()}}}),lA=At({"node_modules/@jscad/modeling/src/primitives/commonChecks.js"(e,t){var n=(i,s)=>{if(Array.isArray(i)&&i.length>=s)return i.every((a)=>Number.isFinite(a));return!1},o=(i,s)=>Number.isFinite(i)&&i>s,r=(i,s)=>Number.isFinite(i)&&i>=s;t.exports={isNumberArray:n,isGT:o,isGTE:r}}}),wLi=At({"node_modules/@jscad/modeling/src/primitives/arc.js"(e,t){var{EPS:n,TAU:o}=Lc(),r=Na(),i=hd(),{isGT:s,isGTE:a,isNumberArray:c}=lA(),l=(h)=>{let d={center:[0,0],radius:1,startAngle:0,endAngle:o,makeTangent:!1,segments:32},{center:u,radius:_,startAngle:p,endAngle:m,makeTangent:A,segments:g}=Object.assign({},d,h);if(!c(u,2))throw Error("center must be an array of X and Y values");if(!s(_,0))throw Error("radius must be greater than zero");if(!a(p,0))throw Error("startAngle must be positive");if(!a(m,0))throw Error("endAngle must be positive");if(!a(g,4))throw Error("segments must be four or more");p=p%o,m=m%o;let f=o;if(p<m)f=m-p;if(p>m)f=m+(o-p);let y=Math.acos((_*_+_*_-n*n)/(2*_*_)),x=r.clone(u),C,b=[];if(f<y)C=r.fromAngleRadians(r.create(),p),r.scale(C,C,_),r.add(C,C,x),b.push(C);else{let I=Math.floor(g*(Math.abs(f)/o)),v=I*0.5/f;if(v>0.25)v=0.25;let P=A?I+2:I;for(let M=0;M<=P;M++){let B=M;if(A){if(B=(M-1)*(I-2*v)/I+v,B<0)B=0;if(B>I)B=I}let T=p+B*(f/I);C=r.fromAngleRadians(r.create(),T),r.scale(C,C,_),r.add(C,C,x),b.push(C)}}return i.fromPoints({closed:!1},b)};t.exports=l}}),Vqn=At({"node_modules/@jscad/modeling/src/primitives/ellipse.js"(e,t){var{EPS:n,TAU:o}=Lc(),r=Na(),i=la(),{sin:s,cos:a}=S2(),{isGTE:c,isNumberArray:l}=lA(),h=(d)=>{let u={center:[0,0],radius:[1,1],startAngle:0,endAngle:o,segments:32},{center:_,radius:p,startAngle:m,endAngle:A,segments:g}=Object.assign({},u,d);if(!l(_,2))throw Error("center must be an array of X and Y values");if(!l(p,2))throw Error("radius must be an array of X and Y values");if(!p.every((v)=>v>=0))throw Error("radius values must be positive");if(!c(m,0))throw Error("startAngle must be positive");if(!c(A,0))throw Error("endAngle must be positive");if(!c(g,3))throw Error("segments must be three or more");if(p[0]===0||p[1]===0)return i.create();m=m%o,A=A%o;let f=o;if(m<A)f=A-m;if(m>A)f=A+(o-m);let y=Math.min(p[0],p[1]),x=Math.acos((y*y+y*y-n*n)/(2*y*y));if(f<x)throw Error("startAngle and endAngle do not define a significant rotation");g=Math.floor(g*(f/o));let C=r.clone(_),b=f/g,I=[];g=f<o?g+1:g;for(let v=0;v<g;v++){let P=b*v+m,M=r.fromValues(p[0]*a(P),p[1]*s(P));r.add(M,C,M),I.push(M)}if(f<o)I.push(C);return i.fromPoints(I)};t.exports=h}}),Yqn=At({"node_modules/@jscad/modeling/src/primitives/circle.js"(e,t){var{TAU:n}=Lc(),o=Vqn(),{isGTE:r}=lA(),i=(s)=>{let a={center:[0,0],radius:1,startAngle:0,endAngle:n,segments:32},{center:c,radius:l,startAngle:h,endAngle:d,segments:u}=Object.assign({},a,s);if(!r(l,0))throw Error("radius must be positive");return l=[l,l],o({center:c,radius:l,startAngle:h,endAngle:d,segments:u})};t.exports=i}}),Apt=At({"node_modules/@jscad/modeling/src/primitives/cuboid.js"(e,t){var n=Js(),o=_c(),{isNumberArray:r}=lA(),i=(s)=>{let a={center:[0,0,0],size:[2,2,2]},{center:c,size:l}=Object.assign({},a,s);if(!r(c,3))throw Error("center must be an array of X, Y and Z values");if(!r(l,3))throw Error("size must be an array of width, depth and height values");if(!l.every((d)=>d>=0))throw Error("size values must be positive");if(l[0]===0||l[1]===0||l[2]===0)return n.create();return n.create([[[0,4,6,2],[-1,0,0]],[[1,3,7,5],[1,0,0]],[[0,1,5,4],[0,-1,0]],[[2,6,7,3],[0,1,0]],[[0,2,3,1],[0,0,-1]],[[4,5,7,6],[0,0,1]]].map((d)=>{let u=d[0].map((_)=>[c[0]+l[0]/2*(2*!!(_&1)-1),c[1]+l[1]/2*(2*!!(_&2)-1),c[2]+l[2]/2*(2*!!(_&4)-1)]);return o.create(u)}))};t.exports=i}}),BLi=At({"node_modules/@jscad/modeling/src/primitives/cube.js"(e,t){var n=Apt(),{isGTE:o}=lA(),r=(i)=>{let s={center:[0,0,0],size:2},{center:a,size:c}=Object.assign({},s,i);if(!o(c,0))throw Error("size must be positive");return c=[c,c,c],n({center:a,size:c})};t.exports=r}}),Gqn=At({"node_modules/@jscad/modeling/src/primitives/cylinderElliptic.js"(e,t){var{EPS:n,TAU:o}=Lc(),r=Ai(),i=Js(),s=_c(),{sin:a,cos:c}=S2(),{isGT:l,isGTE:h,isNumberArray:d}=lA(),u=(_)=>{let p={center:[0,0,0],height:2,startRadius:[1,1],startAngle:0,endRadius:[1,1],endAngle:o,segments:32},{center:m,height:A,startRadius:g,startAngle:f,endRadius:y,endAngle:x,segments:C}=Object.assign({},p,_);if(!d(m,3))throw Error("center must be an array of X, Y and Z values");if(!l(A,0))throw Error("height must be greater then zero");if(!d(g,2))throw Error("startRadius must be an array of X and Y values");if(!g.every((X)=>X>=0))throw Error("startRadius values must be positive");if(!d(y,2))throw Error("endRadius must be an array of X and Y values");if(!y.every((X)=>X>=0))throw Error("endRadius values must be positive");if(y.every((X)=>X===0)&&g.every((X)=>X===0))throw Error("at least one radius must be positive");if(!h(f,0))throw Error("startAngle must be positive");if(!h(x,0))throw Error("endAngle must be positive");if(!h(C,4))throw Error("segments must be four or more");f=f%o,x=x%o;let b=o;if(f<x)b=x-f;if(f>x)b=x+(o-f);let I=Math.min(g[0],g[1],y[0],y[1]),v=Math.acos((I*I+I*I-n*n)/(2*I*I));if(b<v)throw Error("startAngle and endAngle do not define a significant rotation");let P=Math.floor(C*(b/o)),M=r.fromValues(0,0,-(A/2)),B=r.fromValues(0,0,A/2),T=r.subtract(r.create(),B,M),N=r.fromValues(1,0,0),D=r.fromValues(0,1,0),L=r.create(),H=r.create(),V=r.create(),O=(X,K,J)=>{let ee=K*b+f;return r.scale(L,N,J[0]*c(ee)),r.scale(H,D,J[1]*a(ee)),r.add(L,L,H),r.scale(V,T,X),r.add(V,V,M),r.add(r.create(),L,V)},U=(...X)=>{let K=X.map((J)=>r.add(r.create(),J,m));return s.create(K)},j=[];for(let X=0;X<P;X++){let K=X/P,J=(X+1)/P;if(b===o&&X===P-1)J=0;if(y[0]===g[0]&&y[1]===g[1])j.push(U(M,O(0,J,y),O(0,K,y))),j.push(U(O(0,J,y),O(1,J,y),O(1,K,y),O(0,K,y))),j.push(U(B,O(1,K,y),O(1,J,y)));else{if(g[0]>0&&g[1]>0)j.push(U(M,O(0,J,g),O(0,K,g)));if(g[0]>0||g[1]>0)j.push(U(O(0,K,g),O(0,J,g),O(1,K,y)));if(y[0]>0&&y[1]>0)j.push(U(B,O(1,K,y),O(1,J,y)));if(y[0]>0||y[1]>0)j.push(U(O(1,K,y),O(0,J,g),O(1,J,y)))}}if(b<o)j.push(U(M,O(0,0,g),B)),j.push(U(O(0,0,g),O(1,0,y),B)),j.push(U(M,B,O(0,1,g))),j.push(U(O(0,1,g),B,O(1,1,y)));return i.create(j)};t.exports=u}}),Uqn=At({"node_modules/@jscad/modeling/src/primitives/cylinder.js"(e,t){var n=Js(),o=Gqn(),{isGTE:r}=lA(),i=(s)=>{let a={center:[0,0,0],height:2,radius:1,segments:32},{center:c,height:l,radius:h,segments:d}=Object.assign({},a,s);if(!r(h,0))throw Error("radius must be positive");if(l===0||h===0)return n.create();return o({center:c,height:l,startRadius:[h,h],endRadius:[h,h],segments:d})};t.exports=i}}),Wqn=At({"node_modules/@jscad/modeling/src/primitives/ellipsoid.js"(e,t){var{TAU:n}=Lc(),o=Ai(),r=Js(),i=_c(),{sin:s,cos:a}=S2(),{isGTE:c,isNumberArray:l}=lA(),h=(d)=>{let u={center:[0,0,0],radius:[1,1,1],segments:32,axes:[[1,0,0],[0,-1,0],[0,0,1]]},{center:_,radius:p,segments:m,axes:A}=Object.assign({},u,d);if(!l(_,3))throw Error("center must be an array of X, Y and Z values");if(!l(p,3))throw Error("radius must be an array of X, Y and Z values");if(!p.every((P)=>P>=0))throw Error("radius values must be positive");if(!c(m,4))throw Error("segments must be four or more");if(p[0]===0||p[1]===0||p[2]===0)return r.create();let g=o.scale(o.create(),o.normalize(o.create(),A[0]),p[0]),f=o.scale(o.create(),o.normalize(o.create(),A[1]),p[1]),y=o.scale(o.create(),o.normalize(o.create(),A[2]),p[2]),x=Math.round(m/4),C,b=[],I=o.create(),v=o.create();for(let P=0;P<=m;P++){let M=n*P/m,B=o.add(o.create(),o.scale(I,g,a(M)),o.scale(v,f,s(M)));if(P>0){let T,N;for(let D=0;D<=x;D++){let L=n/4*D/x,H=a(L),V=s(L);if(D>0){let O=[],U;if(U=o.subtract(o.create(),o.scale(I,C,T),o.scale(v,y,N)),O.push(o.add(U,U,_)),U=o.subtract(o.create(),o.scale(I,B,T),o.scale(v,y,N)),O.push(o.add(U,U,_)),D<x)U=o.subtract(o.create(),o.scale(I,B,H),o.scale(v,y,V)),O.push(o.add(U,U,_));if(U=o.subtract(o.create(),o.scale(I,C,H),o.scale(v,y,V)),O.push(o.add(U,U,_)),b.push(i.create(O)),O=[],U=o.add(o.create(),o.scale(I,C,T),o.scale(v,y,N)),O.push(o.add(o.create(),_,U)),U=o.add(U,o.scale(I,B,T),o.scale(v,y,N)),O.push(o.add(o.create(),_,U)),D<x)U=o.add(U,o.scale(I,B,H),o.scale(v,y,V)),O.push(o.add(o.create(),_,U));U=o.add(U,o.scale(I,C,H),o.scale(v,y,V)),O.push(o.add(o.create(),_,U)),O.reverse(),b.push(i.create(O))}T=H,N=V}}C=B}return r.create(b)};t.exports=h}}),Xqn=At({"node_modules/@jscad/modeling/src/primitives/polyhedron.js"(e,t){var n=Js(),o=_c(),{isNumberArray:r}=lA(),i=(s)=>{let a={points:[],faces:[],colors:void 0,orientation:"outward"},{points:c,faces:l,colors:h,orientation:d}=Object.assign({},a,s);if(!(Array.isArray(c)&&Array.isArray(l)))throw Error("points and faces must be arrays");if(c.length<3)throw Error("three or more points are required");if(l.length<1)throw Error("one or more faces are required");if(h){if(!Array.isArray(h))throw Error("colors must be an array");if(h.length!==l.length)throw Error("faces and colors must have the same length")}if(c.forEach((_,p)=>{if(!r(_,3))throw Error(`point ${p} must be an array of X, Y, Z values`)}),l.forEach((_,p)=>{if(_.length<3)throw Error(`face ${p} must contain 3 or more indexes`);if(!r(_,_.length))throw Error(`face ${p} must be an array of numbers`)}),d!=="outward")l.forEach((_)=>_.reverse());let u=l.map((_,p)=>{let m=o.create(_.map((A)=>c[A]));if(h&&h[p])m.color=h[p];return m});return n.create(u)};t.exports=i}}),TLi=At({"node_modules/@jscad/modeling/src/primitives/geodesicSphere.js"(e,t){var n=kd(),o=Ai(),r=Js(),i=Xqn(),{isGTE:s}=lA(),a=(c)=>{let l={radius:1,frequency:6},{radius:h,frequency:d}=Object.assign({},l,c);if(!s(h,0))throw Error("radius must be positive");if(!s(d,6))throw Error("frequency must be six or more");if(h===0)return r.create();d=Math.floor(d/6);let u=[[0.850651,0,-0.525731],[0.850651,-0,0.525731],[-0.850651,-0,0.525731],[-0.850651,0,-0.525731],[0,-0.525731,0.850651],[0,0.525731,0.850651],[0,0.525731,-0.850651],[0,-0.525731,-0.850651],[-0.525731,-0.850651,-0],[0.525731,-0.850651,-0],[0.525731,0.850651,0],[-0.525731,0.850651,0]],_=[[0,9,1],[1,10,0],[6,7,0],[10,6,0],[7,9,0],[5,1,4],[4,1,9],[5,10,1],[2,8,3],[3,11,2],[2,5,4],[4,8,2],[2,11,5],[3,7,6],[6,11,3],[8,7,3],[9,8,4],[11,10,5],[10,11,6],[8,9,7]],p=(x,C,b)=>{let I=x[0],v=x[1],P=x[2],M=b,B=[],T=[];for(let N=0;N<C;N++)for(let D=0;D<C-N;D++){let L=N/C,H=(N+1)/C,V=D/(C-N),O=(D+1)/(C-N),U=C-N-1?D/(C-N-1):1,j=[];j[0]=m(m(I,v,V),P,L),j[1]=m(m(I,v,O),P,L),j[2]=m(m(I,v,U),P,H);for(let Y=0;Y<3;Y++){let X=o.length(j[Y]);for(let K=0;K<3;K++)j[Y][K]/=X}if(B.push(j[0],j[1],j[2]),T.push([M,M+1,M+2]),M+=3,D<C-N-1){let Y=C-N-1?(D+1)/(C-N-1):1;j[0]=m(m(I,v,O),P,L),j[1]=m(m(I,v,Y),P,H),j[2]=m(m(I,v,U),P,H);for(let X=0;X<3;X++){let K=o.length(j[X]);for(let J=0;J<3;J++)j[X][J]/=K}B.push(j[0],j[1],j[2]),T.push([M,M+1,M+2]),M+=3}}return{points:B,triangles:T,offset:M}},m=(x,C,b)=>{let I=1-b,v=[];for(let P=0;P<3;P++)v[P]=x[P]*I+C[P]*b;return v},A=[],g=[],f=0;for(let x=0;x<_.length;x++){let C=p([u[_[x][0]],u[_[x][1]],u[_[x][2]]],d,f);A=A.concat(C.points),g=g.concat(C.triangles),f=C.offset}let y=i({points:A,faces:g,orientation:"inward"});if(h!==1)y=r.transform(n.fromScaling(n.create(),[h,h,h]),y);return y};t.exports=a}}),DLi=At({"node_modules/@jscad/modeling/src/primitives/line.js"(e,t){var n=hd(),o=(r)=>{if(!Array.isArray(r))throw Error("points must be an array");return n.fromPoints({},r)};t.exports=o}}),NLi=At({"node_modules/@jscad/modeling/src/primitives/polygon.js"(e,t){var n=la(),o=(r)=>{let i={points:[],paths:[],orientation:"counterclockwise"},{points:s,paths:a,orientation:c}=Object.assign({},i,r);if(!(Array.isArray(s)&&Array.isArray(a)))throw Error("points and paths must be arrays");let l=s;if(Array.isArray(s[0])){if(!Array.isArray(s[0][0]))l=[s]}l.forEach((p,m)=>{if(!Array.isArray(p))throw Error("list of points "+m+" must be an array");if(p.length<3)throw Error("list of points "+m+" must contain three or more points");p.forEach((A,g)=>{if(!Array.isArray(A))throw Error("list of points "+m+", point "+g+" must be an array");if(A.length<2)throw Error("list of points "+m+", point "+g+" must contain by X and Y values")})});let h=a;if(a.length===0){let p=0;h=l.map((m)=>m.map((A)=>p++))}let d=[];l.forEach((p)=>p.forEach((m)=>d.push(m)));let u=[];h.forEach((p)=>{let m=p.map((g)=>d[g]),A=n.fromPoints(m);u=u.concat(n.toSides(A))});let _=n.create(u);if(c==="clockwise")_=n.reverse(_);return _};t.exports=o}}),fpt=At({"node_modules/@jscad/modeling/src/primitives/rectangle.js"(e,t){var n=Na(),o=la(),{isNumberArray:r}=lA(),i=(s)=>{let a={center:[0,0],size:[2,2]},{center:c,size:l}=Object.assign({},a,s);if(!r(c,2))throw Error("center must be an array of X and Y values");if(!r(l,2))throw Error("size must be an array of X and Y values");if(!l.every((_)=>_>=0))throw Error("size values must be positive");if(l[0]===0||l[1]===0)return o.create();let h=[l[0]/2,l[1]/2],d=[h[0],-h[1]],u=[n.subtract(n.create(),c,h),n.add(n.create(),c,d),n.add(n.create(),c,h),n.subtract(n.create(),c,d)];return o.fromPoints(u)};t.exports=i}}),RLi=At({"node_modules/@jscad/modeling/src/primitives/roundedCuboid.js"(e,t){var{EPS:n,TAU:o}=Lc(),r=Na(),i=Ai(),s=Js(),a=_c(),{sin:c,cos:l}=S2(),{isGTE:h,isNumberArray:d}=lA(),u=Apt(),_=(f,y,x,C,b,I)=>{let v=o/4*b/C,P=l(v),M=c(v),B=C-b,T=x*P,N=y[2]-(x-x*M);if(!I)N=x-x*M-y[2];T=T>n?T:0;let D=i.add(i.create(),f,[y[0]-x,y[1]-x,N]),L=i.add(i.create(),f,[x-y[0],y[1]-x,N]),H=i.add(i.create(),f,[x-y[0],x-y[1],N]),V=i.add(i.create(),f,[y[0]-x,x-y[1],N]),O=[],U=[],j=[],Y=[];for(let X=0;X<=B;X++){let K=B>0?o/4*X/B:0,J=r.fromAngleRadians(r.create(),K);r.scale(J,J,T);let ee=i.fromVec2(i.create(),J);O.push(i.add(i.create(),D,ee)),i.rotateZ(ee,ee,[0,0,0],o/4),U.push(i.add(i.create(),L,ee)),i.rotateZ(ee,ee,[0,0,0],o/4),j.push(i.add(i.create(),H,ee)),i.rotateZ(ee,ee,[0,0,0],o/4),Y.push(i.add(i.create(),V,ee))}if(!I)return O.reverse(),U.reverse(),j.reverse(),Y.reverse(),[Y,j,U,O];return[O,U,j,Y]},p=(f,y)=>{let x=[];for(let C=0;C<f.length;C++){let b=f[C],I=y[C];for(let v=0;v<b.length-1;v++)if(x.push(a.create([b[v],b[v+1],I[v]])),v<I.length-1)x.push(a.create([I[v],b[v+1],I[v+1]]))}return x},m=(f,y)=>{let x=[];for(let C=0;C<f.length;C++){let b=f[C],I=y[C],v=b[b.length-1],P=I[I.length-1],M=(C+1)%f.length;b=f[M],I=y[M];let B=b[0],T=I[0];x.push(a.create([v,B,T,P]))}return x},A=(f,y)=>{f=[f[3],f[2],f[1],f[0]],f=f.map((I)=>I.slice().reverse());let x=[];f.forEach((I)=>{I.forEach((v)=>x.push(v))});let C=[];y.forEach((I)=>{I.forEach((v)=>C.push(v))});let b=[];for(let I=0;I<C.length;I++){let v=(I+1)%C.length;b.push(a.create([x[I],x[v],C[v],C[I]]))}return b},g=(f)=>{let y={center:[0,0,0],size:[2,2,2],roundRadius:0.2,segments:32},{center:x,size:C,roundRadius:b,segments:I}=Object.assign({},y,f);if(!d(x,3))throw Error("center must be an array of X, Y and Z values");if(!d(C,3))throw Error("size must be an array of X, Y and Z values");if(!C.every((B)=>B>=0))throw Error("size values must be positive");if(!h(b,0))throw Error("roundRadius must be positive");if(!h(I,4))throw Error("segments must be four or more");if(C[0]===0||C[1]===0||C[2]===0)return s.create();if(b===0)return u({center:x,size:C});if(C=C.map((B)=>B/2),b>C[0]-n||b>C[1]-n||b>C[2]-n)throw Error("roundRadius must be smaller than the radius of all dimensions");I=Math.floor(I/4);let v=null,P=null,M=[];for(let B=0;B<=I;B++){let T=_(x,C,b,I,B,!0),N=_(x,C,b,I,B,!1);if(B===0)M=M.concat(A(N,T));if(v)M=M.concat(p(v,T),m(v,T));if(P)M=M.concat(p(P,N),m(P,N));if(B===I){let D=T.map((L)=>L[0]);M.push(a.create(D)),D=N.map((L)=>L[0]),M.push(a.create(D))}v=T,P=N}return s.create(M)};t.exports=g}}),QLi=At({"node_modules/@jscad/modeling/src/primitives/roundedCylinder.js"(e,t){var{EPS:n,TAU:o}=Lc(),r=Ai(),i=Js(),s=_c(),{sin:a,cos:c}=S2(),{isGTE:l,isNumberArray:h}=lA(),d=Uqn(),u=(_)=>{let p={center:[0,0,0],height:2,radius:1,roundRadius:0.2,segments:32},{center:m,height:A,radius:g,roundRadius:f,segments:y}=Object.assign({},p,_);if(!h(m,3))throw Error("center must be an array of X, Y and Z values");if(!l(A,0))throw Error("height must be positive");if(!l(g,0))throw Error("radius must be positive");if(!l(f,0))throw Error("roundRadius must be positive");if(f>g)throw Error("roundRadius must be smaller than the radius");if(!l(y,4))throw Error("segments must be four or more");if(A===0||g===0)return i.create();if(f===0)return d({center:m,height:A,radius:g});let x=[0,0,-(A/2)],C=[0,0,A/2],b=r.subtract(r.create(),C,x),I=r.length(b);if(2*f>I-n)throw Error("height must be larger than twice roundRadius");let v;if(Math.abs(b[0])>Math.abs(b[1]))v=r.fromValues(0,1,0);else v=r.fromValues(1,0,0);let P=r.scale(r.create(),r.normalize(r.create(),b),f),M=r.scale(r.create(),r.normalize(r.create(),r.cross(r.create(),P,v)),g),B=r.scale(r.create(),r.normalize(r.create(),r.cross(r.create(),M,P)),g);r.add(x,x,P),r.subtract(C,C,P);let T=Math.floor(0.25*y),N=(U)=>{let j=U.map((Y)=>r.add(Y,Y,m));return s.create(j)},D=[],L=r.create(),H=r.create(),V;for(let U=0;U<=y;U++){let j=o*U/y,Y=r.add(r.create(),r.scale(L,M,c(j)),r.scale(H,B,a(j)));if(U>0){let X=[];X.push(r.add(r.create(),x,Y)),X.push(r.add(r.create(),x,V)),X.push(r.add(r.create(),C,V)),X.push(r.add(r.create(),C,Y)),D.push(N(X));let K,J;for(let ee=0;ee<=T;ee++){let se=o/4*ee/T,ne=c(se),re=a(se);if(ee>0){X=[];let Z;if(Z=r.add(r.create(),x,r.subtract(L,r.scale(L,V,K),r.scale(H,P,J))),X.push(Z),Z=r.add(r.create(),x,r.subtract(L,r.scale(L,Y,K),r.scale(H,P,J))),X.push(Z),ee<T)Z=r.add(r.create(),x,r.subtract(L,r.scale(L,Y,ne),r.scale(H,P,re))),X.push(Z);if(Z=r.add(r.create(),x,r.subtract(L,r.scale(L,V,ne),r.scale(H,P,re))),X.push(Z),D.push(N(X)),X=[],Z=r.add(r.create(),r.scale(L,V,K),r.scale(H,P,J)),r.add(Z,Z,C),X.push(Z),Z=r.add(r.create(),r.scale(L,Y,K),r.scale(H,P,J)),r.add(Z,Z,C),X.push(Z),ee<T)Z=r.add(r.create(),r.scale(L,Y,ne),r.scale(H,P,re)),r.add(Z,Z,C),X.push(Z);Z=r.add(r.create(),r.scale(L,V,ne),r.scale(H,P,re)),r.add(Z,Z,C),X.push(Z),X.reverse(),D.push(N(X))}K=ne,J=re}}V=Y}return i.create(D)};t.exports=u}}),kLi=At({"node_modules/@jscad/modeling/src/primitives/roundedRectangle.js"(e,t){var{EPS:n,TAU:o}=Lc(),r=Na(),i=la(),{isGTE:s,isNumberArray:a}=lA(),c=fpt(),l=(h)=>{let d={center:[0,0],size:[2,2],roundRadius:0.2,segments:32},{center:u,size:_,roundRadius:p,segments:m}=Object.assign({},d,h);if(!a(u,2))throw Error("center must be an array of X and Y values");if(!a(_,2))throw Error("size must be an array of X and Y values");if(!_.every((P)=>P>=0))throw Error("size values must be positive");if(!s(p,0))throw Error("roundRadius must be positive");if(!s(m,4))throw Error("segments must be four or more");if(_[0]===0||_[1]===0)return i.create();if(p===0)return c({center:u,size:_});if(_=_.map((P)=>P/2),p>_[0]-n||p>_[1]-n)throw Error("roundRadius must be smaller than the radius of all dimensions");let A=Math.floor(m/4),g=r.add(r.create(),u,[_[0]-p,_[1]-p]),f=r.add(r.create(),u,[p-_[0],_[1]-p]),y=r.add(r.create(),u,[p-_[0],p-_[1]]),x=r.add(r.create(),u,[_[0]-p,p-_[1]]),C=[],b=[],I=[],v=[];for(let P=0;P<=A;P++){let M=o/4*P/A,B=r.fromAngleRadians(r.create(),M);r.scale(B,B,p),C.push(r.add(r.create(),g,B)),r.rotate(B,B,r.create(),o/4),b.push(r.add(r.create(),f,B)),r.rotate(B,B,r.create(),o/4),I.push(r.add(r.create(),y,B)),r.rotate(B,B,r.create(),o/4),v.push(r.add(r.create(),x,B))}return i.fromPoints(C.concat(b,I,v))};t.exports=l}}),jqn=At({"node_modules/@jscad/modeling/src/primitives/sphere.js"(e,t){var n=Wqn(),{isGTE:o}=lA(),r=(i)=>{let s={center:[0,0,0],radius:1,segments:32,axes:[[1,0,0],[0,-1,0],[0,0,1]]},{center:a,radius:c,segments:l,axes:h}=Object.assign({},s,i);if(!o(c,0))throw Error("radius must be positive");return c=[c,c,c],n({center:a,radius:c,segments:l,axes:h})};t.exports=r}}),LLi=At({"node_modules/@jscad/modeling/src/primitives/square.js"(e,t){var n=fpt(),{isGTE:o}=lA(),r=(i)=>{let s={center:[0,0],size:2},{center:a,size:c}=Object.assign({},s,i);if(!o(c,0))throw Error("size must be positive");return c=[c,c],n({center:a,size:c})};t.exports=r}}),HLi=At({"node_modules/@jscad/modeling/src/primitives/star.js"(e,t){var{TAU:n}=Lc(),o=Na(),r=la(),{isGT:i,isGTE:s,isNumberArray:a}=lA(),c=(d,u)=>{if(d>0&&u>1&&u<d/2)return Math.cos(Math.PI*u/d)/Math.cos(Math.PI*(u-1)/d);return 0},l=(d,u,_,p)=>{let m=n/d,A=[];for(let g=0;g<d;g++){let f=o.fromAngleRadians(o.create(),m*g+_);o.scale(f,f,u),o.add(f,p,f),A.push(f)}return A},h=(d)=>{let u={center:[0,0],vertices:5,outerRadius:1,innerRadius:0,density:2,startAngle:0},{center:_,vertices:p,outerRadius:m,innerRadius:A,density:g,startAngle:f}=Object.assign({},u,d);if(!a(_,2))throw Error("center must be an array of X and Y values");if(!s(p,2))throw Error("vertices must be two or more");if(!i(m,0))throw Error("outerRadius must be greater than zero");if(!s(A,0))throw Error("innerRadius must be greater than zero");if(!s(f,0))throw Error("startAngle must be greater than zero");if(p=Math.floor(p),g=Math.floor(g),f=f%n,A===0){if(!s(g,2))throw Error("density must be two or more");A=m*c(p,g)}let y=o.clone(_),x=l(p,m,f,y),C=l(p,A,f+Math.PI/p,y),b=[];for(let I=0;I<p;I++)b.push(x[I]),b.push(C[I]);return r.fromPoints(b)};t.exports=h}}),bpe=At({"node_modules/@jscad/modeling/src/operations/transforms/mirror.js"(e,t){var n=Rs(),o=kd(),r=IE(),i=la(),s=Js(),a=hd(),c=(u,..._)=>{let p={origin:[0,0,0],normal:[0,0,1]},{origin:m,normal:A}=Object.assign({},p,u);if(_=n(_),_.length===0)throw Error("wrong number of arguments");let g=r.fromNormalAndPoint(r.create(),A,m);if(Number.isNaN(g[0]))throw Error("the given origin and normal do not define a proper plane");let f=o.mirrorByPlane(o.create(),g),y=_.map((x)=>{if(a.isA(x))return a.transform(f,x);if(i.isA(x))return i.transform(f,x);if(s.isA(x))return s.transform(f,x);return x});return y.length===1?y[0]:y},l=(...u)=>c({normal:[1,0,0]},u),h=(...u)=>c({normal:[0,1,0]},u),d=(...u)=>c({normal:[0,0,1]},u);t.exports={mirror:c,mirrorX:l,mirrorY:h,mirrorZ:d}}}),Kqn=At({"node_modules/@jscad/modeling/src/operations/extrusions/slice/calculatePlane.js"(e,t){var n=IE(),o=Ai(),r=(i)=>{let s=i.edges;if(s.length<3)throw Error("slices must have 3 or more edges to calculate a plane");let a=s.reduce((d,u)=>o.add(o.create(),d,u[0]),o.create());o.scale(a,a,1/s.length);let c,l=0;s.forEach((d)=>{if(!o.equals(d[0],d[1])){let u=o.squaredDistance(a,d[0]);if(u>l)c=d,l=u}});let h=s.find((d)=>o.equals(d[1],c[0]));return n.fromPoints(n.create(),h[0],c[0],c[1])};t.exports=r}}),hU=At({"node_modules/@jscad/modeling/src/operations/extrusions/slice/create.js"(e,t){var n=(o)=>{if(!o)o=[];return{edges:o}};t.exports=n}}),FLi=At({"node_modules/@jscad/modeling/src/operations/extrusions/slice/clone.js"(e,t){var n=hU(),o=Ai(),r=(...i)=>{let s,a;if(i.length===1)s=n(),a=i[0];else s=i[0],a=i[1];return s.edges=a.edges.map((c)=>[o.clone(c[0]),o.clone(c[1])]),s};t.exports=r}}),zLi=At({"node_modules/@jscad/modeling/src/operations/extrusions/slice/equals.js"(e,t){var n=Ai(),o=(r,i)=>{let s=r.edges,a=i.edges;if(s.length!==a.length)return!1;return s.reduce((l,h,d)=>{let u=a[d],_=n.squaredDistance(h[0],u[0]);return l&&_<Number.EPSILON},!0)};t.exports=o}}),OLi=At({"node_modules/@jscad/modeling/src/operations/extrusions/slice/fromPoints.js"(e,t){var n=Ai(),o=hU(),r=(i)=>{if(!Array.isArray(i))throw Error("the given points must be an array");if(i.length<3)throw Error("the given points must contain THREE or more points");let s=[],a=i[i.length-1];return i.forEach((c)=>{if(c.length===2)s.push([n.fromVec2(n.create(),a),n.fromVec2(n.create(),c)]);if(c.length===3)s.push([a,c]);a=c}),o(s)};t.exports=r}}),VLi=At({"node_modules/@jscad/modeling/src/operations/extrusions/slice/fromSides.js"(e,t){var n=Ai(),o=hU(),r=(i)=>{if(!Array.isArray(i))throw Error("the given sides must be an array");let s=[];return i.forEach((a)=>{s.push([n.fromVec2(n.create(),a[0]),n.fromVec2(n.create(),a[1])])}),o(s)};t.exports=r}}),YLi=At({"node_modules/@jscad/modeling/src/operations/extrusions/slice/isA.js"(e,t){var n=(o)=>{if(o&&typeof o==="object"){if("edges"in o){if(Array.isArray(o.edges))return!0}}return!1};t.exports=n}}),GLi=At({"node_modules/@jscad/modeling/src/operations/extrusions/slice/reverse.js"(e,t){var n=hU(),o=(...r)=>{let i,s;if(r.length===1)i=n(),s=r[0];else i=r[0],s=r[1];return i.edges=s.edges.map((a)=>[a[1],a[0]]),i};t.exports=o}}),ULi=At({"node_modules/@jscad/modeling/src/operations/extrusions/slice/toEdges.js"(e,t){var n=(o)=>o.edges;t.exports=n}}),WLi=At({"node_modules/@jscad/modeling/src/operations/extrusions/earcut/linkedListSort.js"(e,t){var n=(o,r)=>{let i,s,a,c,l,h=1;do{s=o,o=null;let d=null;l=0;while(s){l++,a=s;let u=0;for(i=0;i<h;i++)if(u++,a=a.nextZ,!a)break;let _=h;while(u>0||_>0&&a){if(u!==0&&(_===0||!a||r(s)<=r(a)))c=s,s=s.nextZ,u--;else c=a,a=a.nextZ,_--;if(d)d.nextZ=c;else o=c;c.prevZ=d,d=c}s=a}d.nextZ=null,h*=2}while(l>1);return o};t.exports=n}}),$qn=At({"node_modules/@jscad/modeling/src/operations/extrusions/earcut/linkedList.js"(e,t){var n=WLi(),o=class{constructor(s,a,c){this.i=s,this.x=a,this.y=c,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}},r=(s,a,c,l)=>{let h=new o(s,a,c);if(!l)h.prev=h,h.next=h;else h.next=l.next,h.prev=l,l.next.prev=h,l.next=h;return h},i=(s)=>{if(s.next.prev=s.prev,s.prev.next=s.next,s.prevZ)s.prevZ.nextZ=s.nextZ;if(s.nextZ)s.nextZ.prevZ=s.prevZ};t.exports={Node:o,insertNode:r,removeNode:i,sortLinked:n}}}),ypt=At({"node_modules/@jscad/modeling/src/operations/extrusions/earcut/triangle.js"(e,t){var n=(r,i,s,a,c,l,h,d)=>(c-h)*(i-d)-(r-h)*(l-d)>=0&&(r-h)*(a-d)-(s-h)*(i-d)>=0&&(s-h)*(l-d)-(c-h)*(a-d)>=0,o=(r,i,s)=>(i.y-r.y)*(s.x-i.x)-(i.x-r.x)*(s.y-i.y);t.exports={area:o,pointInTriangle:n}}}),qqn=At({"node_modules/@jscad/modeling/src/operations/extrusions/earcut/linkedPolygon.js"(e,t){var{Node:n,insertNode:o,removeNode:r}=$qn(),{area:i}=ypt(),s=(f,y,x,C,b)=>{let I;if(b===A(f,y,x,C)>0)for(let v=y;v<x;v+=C)I=o(v,f[v],f[v+1],I);else for(let v=x-C;v>=y;v-=C)I=o(v,f[v],f[v+1],I);if(I&&g(I,I.next))r(I),I=I.next;return I},a=(f,y)=>{if(!f)return f;if(!y)y=f;let x=f,C;do if(C=!1,!x.steiner&&(g(x,x.next)||i(x.prev,x,x.next)===0)){if(r(x),x=y=x.prev,x===x.next)break;C=!0}else x=x.next;while(C||x!==y);return y},c=(f,y,x)=>{let C=f;do{let b=C.prev,I=C.next.next;if(!g(b,I)&&p(b,C,C.next,I)&&h(b,I)&&h(I,b))y.push(b.i/x),y.push(C.i/x),y.push(I.i/x),r(C),r(C.next),C=f=I;C=C.next}while(C!==f);return a(C)},l=(f,y)=>{let x=f;do{if(x.i!==f.i&&x.next.i!==f.i&&x.i!==y.i&&x.next.i!==y.i&&p(x,x.next,f,y))return!0;x=x.next}while(x!==f);return!1},h=(f,y)=>i(f.prev,f,f.next)<0?i(f,y,f.next)>=0&&i(f,f.prev,y)>=0:i(f,y,f.prev)<0||i(f,f.next,y)<0,d=(f,y)=>{let x=f,C=!1,b=(f.x+y.x)/2,I=(f.y+y.y)/2;do{if(x.y>I!==x.next.y>I&&x.next.y!==x.y&&b<(x.next.x-x.x)*(I-x.y)/(x.next.y-x.y)+x.x)C=!C;x=x.next}while(x!==f);return C},u=(f,y)=>{let x=new n(f.i,f.x,f.y),C=new n(y.i,y.x,y.y),b=f.next,I=y.prev;return f.next=y,y.prev=f,x.next=b,b.prev=x,C.next=x,x.prev=C,I.next=C,C.prev=I,C},_=(f,y)=>f.next.i!==y.i&&f.prev.i!==y.i&&!l(f,y)&&(h(f,y)&&h(y,f)&&d(f,y)&&(i(f.prev,f,y.prev)||i(f,y.prev,y))||g(f,y)&&i(f.prev,f,f.next)>0&&i(y.prev,y,y.next)>0),p=(f,y,x,C)=>{let b=Math.sign(i(f,y,x)),I=Math.sign(i(f,y,C)),v=Math.sign(i(x,C,f)),P=Math.sign(i(x,C,y));if(b!==I&&v!==P)return!0;if(b===0&&m(f,x,y))return!0;if(I===0&&m(f,C,y))return!0;if(v===0&&m(x,f,C))return!0;if(P===0&&m(x,y,C))return!0;return!1},m=(f,y,x)=>y.x<=Math.max(f.x,x.x)&&y.x>=Math.min(f.x,x.x)&&y.y<=Math.max(f.y,x.y)&&y.y>=Math.min(f.y,x.y),A=(f,y,x,C)=>{let b=0;for(let I=y,v=x-C;I<x;I+=C)b+=(f[v]-f[I])*(f[I+1]+f[v+1]),v=I;return b},g=(f,y)=>f.x===y.x&&f.y===y.y;t.exports={cureLocalIntersections:c,filterPoints:a,isValidDiagonal:_,linkedPolygon:s,locallyInside:h,splitPolygon:u}}}),XLi=At({"node_modules/@jscad/modeling/src/operations/extrusions/earcut/eliminateHoles.js"(e,t){var{filterPoints:n,linkedPolygon:o,locallyInside:r,splitPolygon:i}=qqn(),{area:s,pointInTriangle:a}=ypt(),c=(_,p,m,A)=>{let g=[];for(let f=0,y=p.length;f<y;f++){let x=p[f]*A,C=f<y-1?p[f+1]*A:_.length,b=o(_,x,C,A,!1);if(b===b.next)b.steiner=!0;g.push(u(b))}g.sort((f,y)=>f.x-y.x);for(let f=0;f<g.length;f++)m=l(g[f],m),m=n(m,m.next);return m},l=(_,p)=>{let m=h(_,p);if(!m)return p;let A=i(m,_),g=n(m,m.next);return n(A,A.next),p===m?g:p},h=(_,p)=>{let m=p,{x:A,y:g}=_,f=-1/0,y;do{if(g<=m.y&&g>=m.next.y&&m.next.y!==m.y){let v=m.x+(g-m.y)*(m.next.x-m.x)/(m.next.y-m.y);if(v<=A&&v>f){if(f=v,v===A){if(g===m.y)return m;if(g===m.next.y)return m.next}y=m.x<m.next.x?m:m.next}}m=m.next}while(m!==p);if(!y)return null;if(A===f)return y;let x=y,C=y.x,b=y.y,I=1/0;m=y;do{if(A>=m.x&&m.x>=C&&A!==m.x&&a(g<b?A:f,g,C,b,g<b?f:A,g,m.x,m.y)){let v=Math.abs(g-m.y)/(A-m.x);if(r(m,_)&&(v<I||v===I&&(m.x>y.x||m.x===y.x&&d(y,m))))y=m,I=v}m=m.next}while(m!==x);return y},d=(_,p)=>s(_.prev,_,p.prev)<0&&s(p.next,_,_.next)<0,u=(_)=>{let p=_,m=_;do{if(p.x<m.x||p.x===m.x&&p.y<m.y)m=p;p=p.next}while(p!==_);return m};t.exports=c}}),jLi=At({"node_modules/@jscad/modeling/src/operations/extrusions/earcut/index.js"(e,t){var n=XLi(),{removeNode:o,sortLinked:r}=$qn(),{cureLocalIntersections:i,filterPoints:s,isValidDiagonal:a,linkedPolygon:c,splitPolygon:l}=qqn(),{area:h,pointInTriangle:d}=ypt(),u=(y,x,C=2)=>{let b=x&&x.length,I=b?x[0]*C:y.length,v=c(y,0,I,C,!0),P=[];if(!v||v.next===v.prev)return P;let M,B,T,N,D;if(b)v=n(y,x,v,C);if(y.length>80*C){M=T=y[0],B=N=y[1];for(let L=C;L<I;L+=C){let H=y[L],V=y[L+1];if(H<M)M=H;if(V<B)B=V;if(H>T)T=H;if(V>N)N=V}D=Math.max(T-M,N-B),D=D!==0?1/D:0}return _(v,P,C,M,B,D),P},_=(y,x,C,b,I,v,P)=>{if(!y)return;if(!P&&v)g(y,b,I,v);let M=y,B,T;while(y.prev!==y.next){if(B=y.prev,T=y.next,v?m(y,b,I,v):p(y)){x.push(B.i/C),x.push(y.i/C),x.push(T.i/C),o(y),y=T.next,M=T.next;continue}if(y=T,y===M){if(!P)_(s(y),x,C,b,I,v,1);else if(P===1)y=i(s(y),x,C),_(y,x,C,b,I,v,2);else if(P===2)A(y,x,C,b,I,v);break}}},p=(y)=>{let x=y.prev,C=y,b=y.next;if(h(x,C,b)>=0)return!1;let I=y.next.next;while(I!==y.prev){if(d(x.x,x.y,C.x,C.y,b.x,b.y,I.x,I.y)&&h(I.prev,I,I.next)>=0)return!1;I=I.next}return!0},m=(y,x,C,b)=>{let I=y.prev,v=y,P=y.next;if(h(I,v,P)>=0)return!1;let M=I.x<v.x?I.x<P.x?I.x:P.x:v.x<P.x?v.x:P.x,B=I.y<v.y?I.y<P.y?I.y:P.y:v.y<P.y?v.y:P.y,T=I.x>v.x?I.x>P.x?I.x:P.x:v.x>P.x?v.x:P.x,N=I.y>v.y?I.y>P.y?I.y:P.y:v.y>P.y?v.y:P.y,D=f(M,B,x,C,b),L=f(T,N,x,C,b),{prevZ:H,nextZ:V}=y;while(H&&H.z>=D&&V&&V.z<=L){if(H!==y.prev&&H!==y.next&&d(I.x,I.y,v.x,v.y,P.x,P.y,H.x,H.y)&&h(H.prev,H,H.next)>=0)return!1;if(H=H.prevZ,V!==y.prev&&V!==y.next&&d(I.x,I.y,v.x,v.y,P.x,P.y,V.x,V.y)&&h(V.prev,V,V.next)>=0)return!1;V=V.nextZ}while(H&&H.z>=D){if(H!==y.prev&&H!==y.next&&d(I.x,I.y,v.x,v.y,P.x,P.y,H.x,H.y)&&h(H.prev,H,H.next)>=0)return!1;H=H.prevZ}while(V&&V.z<=L){if(V!==y.prev&&V!==y.next&&d(I.x,I.y,v.x,v.y,P.x,P.y,V.x,V.y)&&h(V.prev,V,V.next)>=0)return!1;V=V.nextZ}return!0},A=(y,x,C,b,I,v)=>{let P=y;do{let M=P.next.next;while(M!==P.prev){if(P.i!==M.i&&a(P,M)){let B=l(P,M);P=s(P,P.next),B=s(B,B.next),_(P,x,C,b,I,v),_(B,x,C,b,I,v);return}M=M.next}P=P.next}while(P!==y)},g=(y,x,C,b)=>{let I=y;do{if(I.z===null)I.z=f(I.x,I.y,x,C,b);I.prevZ=I.prev,I.nextZ=I.next,I=I.next}while(I!==y);I.prevZ.nextZ=null,I.prevZ=null,r(I,(v)=>v.z)},f=(y,x,C,b,I)=>(y=32767*(y-C)*I,x=32767*(x-b)*I,y=(y|y<<8)&16711935,y=(y|y<<4)&252645135,y=(y|y<<2)&858993459,y=(y|y<<1)&1431655765,x=(x|x<<8)&16711935,x=(x|x<<4)&252645135,x=(x|x<<2)&858993459,x=(x|x<<1)&1431655765,y|x<<1);t.exports=u}}),KLi=At({"node_modules/@jscad/modeling/src/operations/extrusions/earcut/assignHoles.js"(e,t){var{area:n}=Vpe(),{toOutlines:o}=la(),{arePointsInside:r}=hpt(),i=(a)=>{let c=o(a),l=[],h=[];c.forEach((_,p)=>{let m=n(_);if(m<0)h.push(p);else if(m>0)l.push(p)});let d=[],u=[];return l.forEach((_,p)=>{let m=c[_];d[p]=[],h.forEach((A,g)=>{let f=c[A];if(r([f[0]],{vertices:m})){if(d[p].push(A),!u[g])u[g]=[];u[g].push(p)}})}),h.forEach((_,p)=>{if(u[p]&&u[p].length>1){let m=s(u[p],(A)=>d[A].length);u[p].forEach((A,g)=>{if(g!==m)d[A]=d[A].filter((f)=>f!==_)})}}),d.map((_,p)=>({solid:c[l[p]],holes:_.map((m)=>c[m])}))},s=(a,c)=>{let l,h;return a.forEach((d,u)=>{let _=c(d);if(h===void 0||_<h)l=u,h=_}),l};t.exports=i}}),$Li=At({"node_modules/@jscad/modeling/src/operations/extrusions/earcut/polygonHierarchy.js"(e,t){var n=la(),o=IE(),r=Na(),i=Ai(),s=Kqn(),a=KLi(),c=class{constructor(l){this.plane=s(l);let h=i.orthogonal(i.create(),this.plane),d=i.cross(i.create(),this.plane,h);this.v=i.normalize(d,d),this.u=i.cross(i.create(),this.v,this.plane),this.basisMap=new Map;let u=l.edges.map((p)=>p.map((m)=>this.to2D(m))),_=n.create(u);this.roots=a(_)}to2D(l){let h=r.fromValues(i.dot(l,this.u),i.dot(l,this.v));return this.basisMap.set(h,l),h}to3D(l){let h=this.basisMap.get(l);if(h)return h;else{console.log("Warning: point not in original slice");let d=i.scale(i.create(),this.u,l[0]),u=i.scale(i.create(),this.v,l[1]),_=i.scale(i.create(),o,o[3]),p=i.add(d,d,_);return i.add(u,u,p)}}};t.exports=c}}),qLi=At({"node_modules/@jscad/modeling/src/operations/extrusions/slice/toPolygons.js"(e,t){var n=_c(),o=jLi(),r=$Li(),i=(s)=>{let a=new r(s),c=[];return a.roots.forEach(({solid:l,holes:h})=>{let d=l.length,u=[];h.forEach((g,f)=>{u.push(d),d+=g.length});let _=[l,...h].flat(),p=_.flat(),m=(g)=>a.to3D(_[g]),A=o(p,u);for(let g=0;g<A.length;g+=3){let f=A.slice(g,g+3).map(m);c.push(n.fromPointsAndPlane(f,a.plane))}}),c};t.exports=i}}),JLi=At({"node_modules/@jscad/modeling/src/operations/extrusions/slice/toString.js"(e,t){var n=Ai(),o=(i)=>i.reduce((s,a)=>s+=`[${n.toString(a[0])}, ${n.toString(a[1])}], `,""),r=(i)=>`[${o(i.edges)}]`;t.exports=r}}),ZLi=At({"node_modules/@jscad/modeling/src/operations/extrusions/slice/transform.js"(e,t){var n=Ai(),o=hU(),r=(i,s)=>{let a=s.edges.map((c)=>[n.transform(n.create(),c[0],i),n.transform(n.create(),c[1],i)]);return o(a)};t.exports=r}}),Ote=At({"node_modules/@jscad/modeling/src/operations/extrusions/slice/index.js"(e,t){t.exports={calculatePlane:Kqn(),clone:FLi(),create:hU(),equals:zLi(),fromPoints:OLi(),fromSides:VLi(),isA:YLi(),reverse:GLi(),toEdges:ULi(),toPolygons:qLi(),toString:JLi(),transform:ZLi()}}}),eHi=At({"node_modules/@jscad/modeling/src/operations/extrusions/slice/repair.js"(e,t){var n=Ai(),o=hU(),r=(i)=>{if(!i.edges)return i;let s=i.edges,a=new Map,c=new Map;s=s.filter((d)=>!n.equals(d[0],d[1])),s.forEach((d)=>{let u=d[0].toString(),_=d[1].toString();a.set(u,d[0]),a.set(_,d[1]),c.set(u,(c.get(u)||0)+1),c.set(_,(c.get(_)||0)-1)});let l=[],h=[];return c.forEach((d,u)=>{if(d<0)l.push(u);if(d>0)h.push(u)}),l.forEach((d)=>{let u=a.get(d),_=1/0,p;h.forEach((m)=>{let A=a.get(m),g=n.distance(u,A);if(g<_)_=g,p=A}),console.warn(`slice.repair: repairing vertex gap ${u} to ${p} distance ${_}`),s=s.map((m)=>{if(m[0].toString()===d)return[p,m[1]];if(m[1].toString()===d)return[m[0],p];return m})}),o(s)};t.exports=r}}),tHi=At({"node_modules/@jscad/modeling/src/operations/extrusions/extrudeWalls.js"(e,t){var{EPS:n}=Lc(),o=Ai(),r=_c(),i=Ote(),s=(d,u)=>{if(d===u)return d;if(d<u)return s(u,d);if(u===1)return 1;if(u===0)return d;return s(u,d%u)},a=(d,u)=>d*u/s(d,u),c=(d,u)=>{let _=d/u.length;if(_===1)return u;let p=o.fromValues(_,_,_),m=o.create(),A=[];return u.forEach((g)=>{o.subtract(m,g[1],g[0]),o.divide(m,m,p);let f=g[0];for(let y=1;y<=_;++y){let x=o.add(o.create(),f,m);A.push([f,x]),f=x}}),A},l=n*n/2*Math.sin(Math.PI/3),h=(d,u)=>{let _=i.toEdges(d),p=i.toEdges(u);if(_.length!==p.length){let A=a(_.length,p.length);if(A!==_.length)_=c(A,_);if(A!==p.length)p=c(A,p)}let m=[];return _.forEach((A,g)=>{let f=p[g],y=r.create([A[0],A[1],f[1]]),x=r.measureArea(y);if(Number.isFinite(x)&&x>l)m.push(y);let C=r.create([A[0],f[1],f[0]]),b=r.measureArea(C);if(Number.isFinite(b)&&b>l)m.push(C)}),m};t.exports=h}}),Qwe=At({"node_modules/@jscad/modeling/src/operations/extrusions/extrudeFromSlices.js"(e,t){var n=kd(),o=la(),r=Js(),i=_c(),s=Ote(),a=eHi(),c=tHi(),l=(d,u,_)=>{let p=null;if(o.isA(_))p=s.fromSides(o.toSides(_));if(i.isA(_))p=s.fromPoints(i.toPoints(_));return d===0||d===1?s.transform(n.fromTranslation(n.create(),[0,0,d]),p):null},h=(d,u)=>{let _={numberOfSlices:2,capStart:!0,capEnd:!0,close:!1,repair:!0,callback:l},{numberOfSlices:p,capStart:m,capEnd:A,close:g,repair:f,callback:y}=Object.assign({},_,d);if(p<2)throw Error("numberOfSlices must be 2 or more");if(f)u=a(u);let x=p-1,C=null,b=null,I=null,v=[];for(let P=0;P<p;P++){let M=y(P/x,P,u);if(M){if(!s.isA(M))throw Error("the callback function must return slice objects");if(s.toEdges(M).length===0)throw Error("the callback function must return slices with one or more edges");if(I){let T=c(I,M);for(let N=0;N<T.length;N++)v.push(T[N])}if(P===0)C=M;if(P===p-1)b=M;I=M}}if(A){let P=s.toPolygons(b);for(let M=0;M<P.length;M++)v.push(P[M])}if(m){let P=s.toPolygons(C).map(i.invert);for(let M=0;M<P.length;M++)v.push(P[M])}if(!m&&!A){if(g&&!s.equals(b,C)){let P=c(b,C);for(let M=0;M<P.length;M++)v.push(P[M])}}return r.create(v)};t.exports=h}}),Jqn=At({"node_modules/@jscad/modeling/src/operations/extrusions/extrudeRotate.js"(e,t){var{TAU:n}=Lc(),o=kd(),{mirrorX:r}=bpe(),i=la(),s=Ote(),a=Qwe(),c=(l,h)=>{let d={segments:12,startAngle:0,angle:n,overflow:"cap"},{segments:u,startAngle:_,angle:p,overflow:m}=Object.assign({},d,l);if(u<3)throw Error("segments must be greater then 3");_=Math.abs(_)>n?_%n:_,p=Math.abs(p)>n?p%n:p;let A=_+p;if(A=Math.abs(A)>n?A%n:A,A<_){let N=_;_=A,A=N}let g=A-_;if(g<=0)g=n;if(Math.abs(g)<n){let N=n/u;if(u=Math.floor(Math.abs(g)/N),Math.abs(g)>u*N)u++}let f=i.toSides(h);if(f.length===0)throw Error("the given geometry cannot be empty");let y=f.filter((N)=>N[0][0]<0),x=f.filter((N)=>N[0][0]>=0);if(y.length>0&&x.length>0&&m==="cap"){if(y.length>x.length)f=f.map((N)=>{let D=N[0],L=N[1];return D=[Math.min(D[0],0),D[1]],L=[Math.min(L[0],0),L[1]],[D,L]}),h=i.create(f),h=r(h);else if(x.length>=y.length)f=f.map((N)=>{let D=N[0],L=N[1];return D=[Math.max(D[0],0),D[1]],L=[Math.max(L[0],0),L[1]],[D,L]}),h=i.create(f)}let b=g/u,I=Math.abs(g)<n,v=s.fromSides(i.toSides(h));s.reverse(v,v);let P=o.create(),M=o.fromXRotation(o.create(),n/4),B=o.create(),T=(N,D,L)=>{let H=b*D+_;if(g===n&&D===u)H=_;return o.fromZRotation(B,H),o.multiply(P,B,M),s.transform(P,L)};return l={numberOfSlices:u+1,capStart:I,capEnd:I,close:!I,callback:T},a(l,v)};t.exports=c}}),Ipe=At({"node_modules/@jscad/modeling/src/operations/transforms/rotate.js"(e,t){var n=Rs(),o=kd(),r=la(),i=Js(),s=hd(),a=(d,...u)=>{if(!Array.isArray(d))throw Error("angles must be an array");if(u=n(u),u.length===0)throw Error("wrong number of arguments");d=d.slice();while(d.length<3)d.push(0);let _=d[2],p=d[1],m=d[0],A=o.fromTaitBryanRotation(o.create(),_,p,m),g=u.map((f)=>{if(s.isA(f))return s.transform(A,f);if(r.isA(f))return r.transform(A,f);if(i.isA(f))return i.transform(A,f);return f});return g.length===1?g[0]:g},c=(d,...u)=>a([d,0,0],u),l=(d,...u)=>a([0,d,0],u),h=(d,...u)=>a([0,0,d],u);t.exports={rotate:a,rotateX:c,rotateY:l,rotateZ:h}}}),nU=At({"node_modules/@jscad/modeling/src/operations/transforms/translate.js"(e,t){var n=Rs(),o=kd(),r=la(),i=Js(),s=hd(),a=(d,...u)=>{if(!Array.isArray(d))throw Error("offset must be an array");if(u=n(u),u.length===0)throw Error("wrong number of arguments");d=d.slice();while(d.length<3)d.push(0);let _=o.fromTranslation(o.create(),d),p=u.map((m)=>{if(s.isA(m))return s.transform(_,m);if(r.isA(m))return r.transform(_,m);if(i.isA(m))return i.transform(_,m);return m});return p.length===1?p[0]:p},c=(d,...u)=>a([d,0,0],u),l=(d,...u)=>a([0,d,0],u),h=(d,...u)=>a([0,0,d],u);t.exports={translate:a,translateX:c,translateY:l,translateZ:h}}}),nHi=At({"node_modules/@jscad/modeling/src/primitives/torus.js"(e,t){var{TAU:n}=Lc(),o=Jqn(),{rotate:r}=Ipe(),{translate:i}=nU(),s=Yqn(),{isGT:a,isGTE:c}=lA(),l=(h)=>{let d={innerRadius:1,innerSegments:32,outerRadius:4,outerSegments:32,innerRotation:0,startAngle:0,outerRotation:n},{innerRadius:u,innerSegments:_,outerRadius:p,outerSegments:m,innerRotation:A,startAngle:g,outerRotation:f}=Object.assign({},d,h);if(!a(u,0))throw Error("innerRadius must be greater than zero");if(!c(_,3))throw Error("innerSegments must be three or more");if(!a(p,0))throw Error("outerRadius must be greater than zero");if(!c(m,3))throw Error("outerSegments must be three or more");if(!c(g,0))throw Error("startAngle must be positive");if(!a(f,0))throw Error("outerRotation must be greater than zero");if(u>=p)throw Error("inner circle is too large to rotate about the outer circle");let y=s({radius:u,segments:_});if(A!==0)y=r([0,0,A],y);return y=i([p,0],y),o({startAngle:g,angle:f,segments:m},y)};t.exports=l}}),oHi=At({"node_modules/@jscad/modeling/src/primitives/triangle.js"(e,t){var{NEPS:n}=Lc(),o=Na(),r=la(),{isNumberArray:i}=lA(),s=(A,g,f)=>Math.acos((A*A+g*g-f*f)/(2*A*g)),a=(A,g,f)=>{if(g>n)return Math.sqrt(A*A+f*f-2*A*f*Math.cos(g));return Math.sqrt((A-f)*(A-f)+A*f*g*g*(1-g*g/12))},c=(A)=>{if(Math.abs(A[0]+A[1]+A[2]-Math.PI)>n)throw Error("AAA triangles require angles that sum to PI");let f=A[0],y=A[1],x=Math.PI-f-y,C=1,b=C/Math.sin(x)*Math.sin(f),I=C/Math.sin(x)*Math.sin(y);return p(f,y,x,b,I,C)},l=(A)=>{let g=A[0],f=A[1],y=Math.PI+n-g-f;if(y<n)throw Error("AAS triangles require angles that sum to PI");let x=A[2],C=x/Math.sin(g)*Math.sin(f),b=x/Math.sin(g)*Math.sin(y);return p(g,f,y,x,C,b)},h=(A)=>{let g=A[0],f=A[2],y=Math.PI+n-g-f;if(y<n)throw Error("ASA triangles require angles that sum to PI");let x=A[1],C=x/Math.sin(y)*Math.sin(g),b=x/Math.sin(y)*Math.sin(f);return p(g,f,y,C,b,x)},d=(A)=>{let g=A[0],f=A[1],y=A[2],x=a(g,f,y),C=s(x,g,y),b=Math.PI-C-f;return p(C,f,b,y,x,g)},u=(A)=>{let g=A[0],f=A[1],y=A[2],x=Math.asin(f*Math.sin(y)/g),C=Math.PI-x-y,b=g/Math.sin(y)*Math.sin(C);return p(x,C,y,f,b,g)},_=(A)=>{let g=A[1],f=A[2],y=A[0];if(g+f<=y||f+y<=g||y+g<=f)throw Error("SSS triangle is incorrect, as the longest side is longer than the sum of the other sides");let x=s(f,y,g),C=s(y,g,f),b=Math.PI-x-C;return p(x,C,b,g,f,y)},p=(A,g,f,y,x,C)=>{let b=o.fromValues(0,0),I=o.fromValues(C,0),v=o.fromValues(y,0);return o.add(v,o.rotate(v,v,[0,0],Math.PI-g),I),r.fromPoints([b,I,v])},m=(A)=>{let g={type:"SSS",values:[1,1,1]},{type:f,values:y}=Object.assign({},g,A);if(typeof f!=="string")throw Error("triangle type must be a string");if(f=f.toUpperCase(),!((f[0]==="A"||f[0]==="S")&&(f[1]==="A"||f[1]==="S")&&(f[2]==="A"||f[2]==="S")))throw Error("triangle type must contain three letters; A or S");if(!i(y,3))throw Error("triangle values must contain three values");if(!y.every((x)=>x>0))throw Error("triangle values must be greater than zero");switch(f){case"AAA":return c(y);case"AAS":return l(y);case"ASA":return h(y);case"SAS":return d(y);case"SSA":return u(y);case"SSS":return _(y);default:throw Error("invalid triangle type, try again")}};t.exports=m}}),dU=At({"node_modules/@jscad/modeling/src/primitives/index.js"(e,t){t.exports={arc:wLi(),circle:Yqn(),cube:BLi(),cuboid:Apt(),cylinder:Uqn(),cylinderElliptic:Gqn(),ellipse:Vqn(),ellipsoid:Wqn(),geodesicSphere:TLi(),line:DLi(),polygon:NLi(),polyhedron:Xqn(),rectangle:fpt(),roundedCuboid:RLi(),roundedCylinder:QLi(),roundedRectangle:kLi(),sphere:jqn(),square:LLi(),star:HLi(),torus:nHi(),triangle:oHi()}}}),rHi=At({"node_modules/@jscad/modeling/src/text/fonts/single-line/hershey/simplex.js"(e,t){t.exports={height:14,32:[16],33:[10,5,21,5,7,void 0,5,2,4,1,5,0,6,1,5,2],34:[16,4,21,4,14,void 0,12,21,12,14],35:[21,11,25,4,-7,void 0,17,25,10,-7,void 0,4,12,18,12,void 0,3,6,17,6],36:[20,8,25,8,-4,void 0,12,25,12,-4,void 0,17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3],37:[24,21,21,3,0,void 0,8,21,10,19,10,17,9,15,7,14,5,14,3,16,3,18,4,20,6,21,8,21,10,20,13,19,16,19,19,20,21,21,void 0,17,7,15,6,14,4,14,2,16,0,18,0,20,1,21,3,21,5,19,7,17,7],38:[26,23,12,23,13,22,14,21,14,20,13,19,11,17,6,15,3,13,1,11,0,7,0,5,1,4,2,3,4,3,6,4,8,5,9,12,13,13,14,14,16,14,18,13,20,11,21,9,20,8,18,8,16,9,13,11,10,16,3,18,1,20,0,22,0,23,1,23,2],39:[10,5,19,4,20,5,21,6,20,6,18,5,16,4,15],40:[14,11,25,9,23,7,20,5,16,4,11,4,7,5,2,7,-2,9,-5,11,-7],41:[14,3,25,5,23,7,20,9,16,10,11,10,7,9,2,7,-2,5,-5,3,-7],42:[16,8,21,8,9,void 0,3,18,13,12,void 0,13,18,3,12],43:[26,13,18,13,0,void 0,4,9,22,9],44:[10,6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4],45:[26,4,9,22,9],46:[10,5,2,4,1,5,0,6,1,5,2],47:[22,20,25,2,-7],48:[20,9,21,6,20,4,17,3,12,3,9,4,4,6,1,9,0,11,0,14,1,16,4,17,9,17,12,16,17,14,20,11,21,9,21],49:[20,6,17,8,18,11,21,11,0],50:[20,4,16,4,17,5,19,6,20,8,21,12,21,14,20,15,19,16,17,16,15,15,13,13,10,3,0,17,0],51:[20,5,21,16,21,10,13,13,13,15,12,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4],52:[20,13,21,3,7,18,7,void 0,13,21,13,0],53:[20,15,21,5,21,4,12,5,13,8,14,11,14,14,13,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4],54:[20,16,18,15,20,12,21,10,21,7,20,5,17,4,12,4,7,5,3,7,1,10,0,11,0,14,1,16,3,17,6,17,7,16,10,14,12,11,13,10,13,7,12,5,10,4,7],55:[20,17,21,7,0,void 0,3,21,17,21],56:[20,8,21,5,20,4,18,4,16,5,14,7,13,11,12,14,11,16,9,17,7,17,4,16,2,15,1,12,0,8,0,5,1,4,2,3,4,3,7,4,9,6,11,9,12,13,13,15,14,16,16,16,18,15,20,12,21,8,21],57:[20,16,14,15,11,13,9,10,8,9,8,6,9,4,11,3,14,3,15,4,18,6,20,9,21,10,21,13,20,15,18,16,14,16,9,15,4,13,1,10,0,8,0,5,1,4,3],58:[10,5,14,4,13,5,12,6,13,5,14,void 0,5,2,4,1,5,0,6,1,5,2],59:[10,5,14,4,13,5,12,6,13,5,14,void 0,6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4],60:[24,20,18,4,9,20,0],61:[26,4,12,22,12,void 0,4,6,22,6],62:[24,4,18,20,9,4,0],63:[18,3,16,3,17,4,19,5,20,7,21,11,21,13,20,14,19,15,17,15,15,14,13,13,12,9,10,9,7,void 0,9,2,8,1,9,0,10,1,9,2],64:[27,18,13,17,15,15,16,12,16,10,15,9,14,8,11,8,8,9,6,11,5,14,5,16,6,17,8,void 0,12,16,10,14,9,11,9,8,10,6,11,5,void 0,18,16,17,8,17,6,19,5,21,5,23,7,24,10,24,12,23,15,22,17,20,19,18,20,15,21,12,21,9,20,7,19,5,17,4,15,3,12,3,9,4,6,5,4,7,2,9,1,12,0,15,0,18,1,20,2,21,3,void 0,19,16,18,8,18,6,19,5],65:[18,9,21,1,0,void 0,9,21,17,0,void 0,4,7,14,7],66:[21,4,21,4,0,void 0,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,void 0,4,11,13,11,16,10,17,9,18,7,18,4,17,2,16,1,13,0,4,0],67:[21,18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5],68:[21,4,21,4,0,void 0,4,21,11,21,14,20,16,18,17,16,18,13,18,8,17,5,16,3,14,1,11,0,4,0],69:[19,4,21,4,0,void 0,4,21,17,21,void 0,4,11,12,11,void 0,4,0,17,0],70:[18,4,21,4,0,void 0,4,21,17,21,void 0,4,11,12,11],71:[21,18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,18,8,void 0,13,8,18,8],72:[22,4,21,4,0,void 0,18,21,18,0,void 0,4,11,18,11],73:[8,4,21,4,0],74:[16,12,21,12,5,11,2,10,1,8,0,6,0,4,1,3,2,2,5,2,7],75:[21,4,21,4,0,void 0,18,21,4,7,void 0,9,12,18,0],76:[17,4,21,4,0,void 0,4,0,16,0],77:[24,4,21,4,0,void 0,4,21,12,0,void 0,20,21,12,0,void 0,20,21,20,0],78:[22,4,21,4,0,void 0,4,21,18,0,void 0,18,21,18,0],79:[22,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21],80:[21,4,21,4,0,void 0,4,21,13,21,16,20,17,19,18,17,18,14,17,12,16,11,13,10,4,10],81:[22,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21,void 0,12,4,18,-2],82:[21,4,21,4,0,void 0,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,4,11,void 0,11,11,18,0],83:[20,17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3],84:[16,8,21,8,0,void 0,1,21,15,21],85:[22,4,21,4,6,5,3,7,1,10,0,12,0,15,1,17,3,18,6,18,21],86:[18,1,21,9,0,void 0,17,21,9,0],87:[24,2,21,7,0,void 0,12,21,7,0,void 0,12,21,17,0,void 0,22,21,17,0],88:[20,3,21,17,0,void 0,17,21,3,0],89:[18,1,21,9,11,9,0,void 0,17,21,9,11],90:[20,17,21,3,0,void 0,3,21,17,21,void 0,3,0,17,0],91:[14,4,25,4,-7,void 0,5,25,5,-7,void 0,4,25,11,25,void 0,4,-7,11,-7],92:[14,0,21,14,-3],93:[14,9,25,9,-7,void 0,10,25,10,-7,void 0,3,25,10,25,void 0,3,-7,10,-7],94:[16,6,15,8,18,10,15,void 0,3,12,8,17,13,12,void 0,8,17,8,0],95:[16,0,-2,16,-2],96:[10,6,21,5,20,4,18,4,16,5,15,6,16,5,17],97:[19,15,14,15,0,void 0,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3],98:[19,4,21,4,0,void 0,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3],99:[18,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3],100:[19,15,21,15,0,void 0,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3],101:[18,3,8,15,8,15,10,14,12,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3],102:[12,10,21,8,21,6,20,5,17,5,0,void 0,2,14,9,14],103:[19,15,14,15,-2,14,-5,13,-6,11,-7,8,-7,6,-6,void 0,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3],104:[19,4,21,4,0,void 0,4,10,7,13,9,14,12,14,14,13,15,10,15,0],105:[8,3,21,4,20,5,21,4,22,3,21,void 0,4,14,4,0],106:[10,5,21,6,20,7,21,6,22,5,21,void 0,6,14,6,-3,5,-6,3,-7,1,-7],107:[17,4,21,4,0,void 0,14,14,4,4,void 0,8,8,15,0],108:[8,4,21,4,0],109:[30,4,14,4,0,void 0,4,10,7,13,9,14,12,14,14,13,15,10,15,0,void 0,15,10,18,13,20,14,23,14,25,13,26,10,26,0],110:[19,4,14,4,0,void 0,4,10,7,13,9,14,12,14,14,13,15,10,15,0],111:[19,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3,16,6,16,8,15,11,13,13,11,14,8,14],112:[19,4,14,4,-7,void 0,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3],113:[19,15,14,15,-7,void 0,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3],114:[13,4,14,4,0,void 0,4,8,5,11,7,13,9,14,12,14],115:[17,14,11,13,13,10,14,7,14,4,13,3,11,4,9,6,8,11,7,13,6,14,4,14,3,13,1,10,0,7,0,4,1,3,3],116:[12,5,21,5,4,6,1,8,0,10,0,void 0,2,14,9,14],117:[19,4,14,4,4,5,1,7,0,10,0,12,1,15,4,void 0,15,14,15,0],118:[16,2,14,8,0,void 0,14,14,8,0],119:[22,3,14,7,0,void 0,11,14,7,0,void 0,11,14,15,0,void 0,19,14,15,0],120:[17,3,14,14,0,void 0,14,14,3,0],121:[16,2,14,8,0,void 0,14,14,8,0,6,-4,4,-6,2,-7,1,-7],122:[17,14,14,3,0,void 0,3,14,14,14,void 0,3,0,14,0],123:[14,9,25,7,24,6,23,5,21,5,19,6,17,7,16,8,14,8,12,6,10,void 0,7,24,6,22,6,20,7,18,8,17,9,15,9,13,8,11,4,9,8,7,9,5,9,3,8,1,7,0,6,-2,6,-4,7,-6,void 0,6,8,8,6,8,4,7,2,6,1,5,-1,5,-3,6,-5,7,-6,9,-7],124:[8,4,25,4,-7],125:[14,5,25,7,24,8,23,9,21,9,19,8,17,7,16,6,14,6,12,8,10,void 0,7,24,8,22,8,20,7,18,6,17,5,15,5,13,6,11,10,9,6,7,5,5,5,3,6,1,7,0,8,-2,8,-4,7,-6,void 0,8,8,6,6,6,4,7,2,8,1,9,-1,9,-3,8,-5,7,-6,5,-7],126:[24,3,6,3,8,4,11,6,12,8,12,10,11,14,8,16,7,18,7,20,8,21,10,void 0,3,8,4,10,6,11,8,11,10,10,14,7,16,6,18,6,20,7,21,10,21,12]}}}),Zqn=At({"node_modules/@jscad/modeling/src/text/vectorParams.js"(e,t){var n=rHi(),o={xOffset:0,yOffset:0,input:"?",align:"left",font:n,height:14,lineSpacing:2.142857142857143,letterSpacing:1,extrudeOffset:0},r=(i,s)=>{if(!s&&typeof i==="string")i={input:i};i=i||{};let a=Object.assign({},o,i);return a.input=s||a.input,a};t.exports=r}}),eJn=At({"node_modules/@jscad/modeling/src/text/vectorChar.js"(e,t){var n=Zqn(),o=(r,i)=>{let{xOffset:s,yOffset:a,input:c,font:l,height:h,extrudeOffset:d}=n(r,i),u=c.charCodeAt(0);if(!u||!l[u])u=63;let _=[].concat(l[u]),p=(h-d)/l.height,m=d/2,A=_.shift()*p,g=[],f=[];for(let y=0,x=_.length;y<x;y+=2){let C=p*_[y]+s,b=p*_[y+1]+a+m;if(_[y]!==void 0){f.push([C,b]);continue}g.push(f),f=[],y--}if(f.length)g.push(f);return{width:A,height:h,segments:g}};t.exports=o}}),iHi=At({"node_modules/@jscad/modeling/src/text/vectorText.js"(e,t){var n=eJn(),o=Zqn(),r=(s,a)=>{let{x:c,y:l}=Object.assign({x:0,y:0},s||{}),h=a.segments,d=null,u=null;for(let _=0,p=h.length;_<p;_++){d=h[_];for(let m=0,A=d.length;m<A;m++)u=d[m],d[m]=[u[0]+c,u[1]+l]}return a},i=(s,a)=>{let{xOffset:c,yOffset:l,input:h,font:d,height:u,align:_,extrudeOffset:p,lineSpacing:m,letterSpacing:A}=o(s,a),[g,f]=[c,l],y,x,C,b,I,v,P={width:0,segments:[]},M=[],B=[],T=0,N=g,D=()=>{M.push(P),T=Math.max(T,P.width),P={width:0,segments:[]}};for(y=0,x=h.length;y<x;y++){if(C=h[y],b=n({xOffset:g,yOffset:f,font:d,height:u,extrudeOffset:p},C),C===`
`){g=N,f-=b.height*m,D();continue}if(I=b.width*A,P.width+=I,g+=I,C!==" ")P.segments=P.segments.concat(b.segments)}if(P.segments.length)D();for(y=0,x=M.length;y<x;y++){if(P=M[y],T>P.width){if(v=T-P.width,_==="right")P=r({x:v},P);else if(_==="center")P=r({x:v/2},P)}B=B.concat(P.segments)}return B};t.exports=i}}),sHi=At({"node_modules/@jscad/modeling/src/text/index.js"(e,t){t.exports={vectorChar:eJn(),vectorText:iHi()}}}),Gpe=At({"node_modules/@jscad/modeling/src/utils/areAllShapesTheSameType.js"(e,t){var n=la(),o=Js(),r=hd(),i=(s)=>{let a;for(let c of s){let l=0;if(n.isA(c))l=1;if(o.isA(c))l=2;if(r.isA(c))l=3;if(a&&l!==a)return!1;a=l}return!0};t.exports=i}}),aHi=At({"node_modules/@jscad/modeling/src/utils/degToRad.js"(e,t){var n=(o)=>o*0.017453292519943295;t.exports=n}}),tJn=At({"node_modules/@jscad/modeling/src/utils/fnNumberSort.js"(e,t){var n=(o,r)=>o-r;t.exports=n}}),cHi=At({"node_modules/@jscad/modeling/src/utils/insertSorted.js"(e,t){var n=(o,r,i)=>{let s=0,a=o.length;while(a>s){let c=Math.floor((s+a)/2),l=o[c];if(i(r,l)>0)s=c+1;else a=c}o.splice(s,0,r)};t.exports=n}}),lHi=At({"node_modules/@jscad/modeling/src/utils/radiusToSegments.js"(e,t){var{TAU:n}=Lc(),o=(r,i,s)=>{let a=i>0?r*n/i:0,c=s>0?n/s:0;return Math.ceil(Math.max(a,c,4))};t.exports=o}}),hHi=At({"node_modules/@jscad/modeling/src/utils/radToDeg.js"(e,t){var n=(o)=>o*57.29577951308232;t.exports=n}}),nJn=At({"node_modules/@jscad/modeling/src/utils/index.js"(e,t){t.exports={areAllShapesTheSameType:Gpe(),degToRad:aHi(),flatten:Rs(),fnNumberSort:tJn(),insertSorted:cHi(),radiusToSegments:lHi(),radToDeg:hHi()}}}),xpt=At({"node_modules/@jscad/modeling/src/operations/booleans/fromFakePolygons.js"(e,t){var n=Na(),o=la(),r=(s,a)=>{if(a.vertices.length<4)return null;let c=[],l=a.vertices.filter((u,_)=>{if(u[2]>0)return c.push(_),!0;return!1});if(l.length!==2)throw Error("Assertion failed: fromFakePolygon: not enough points found");let h=l.map((u)=>{let _=Math.round(u[0]/s)*s+0,p=Math.round(u[1]/s)*s+0;return n.fromValues(_,p)});if(n.equals(h[0],h[1]))return null;let d=c[1]-c[0];if(d===1||d===3){if(d===1)h.reverse()}else throw Error("Assertion failed: fromFakePolygon: unknown index ordering");return h},i=(s,a)=>{let c=a.map((l)=>r(s,l)).filter((l)=>l!==null);return o.create(c)};t.exports=i}}),Cpt=At({"node_modules/@jscad/modeling/src/operations/booleans/to3DWalls.js"(e,t){var n=Ai(),o=la(),r=Js(),i=_c(),s=(c,l,h)=>{let d=[n.fromVec2(n.create(),h[0],c),n.fromVec2(n.create(),h[1],c),n.fromVec2(n.create(),h[1],l),n.fromVec2(n.create(),h[0],l)];return i.create(d)},a=(c,l)=>{let d=o.toSides(l).map((_)=>s(c.z0,c.z1,_));return r.create(d)};t.exports=a}}),dHi=At({"node_modules/@jscad/modeling/src/maths/OrthoNormalBasis.js"(e,t){var n=kd(),o=Na(),r=Ai(),i=function(s,a){if(arguments.length<2)a=r.orthogonal(r.create(),s);this.v=r.normalize(r.create(),r.cross(r.create(),s,a)),this.u=r.cross(r.create(),this.v,s),this.plane=s,this.planeorigin=r.scale(r.create(),s,s[3])};i.prototype={getProjectionMatrix:function(){return n.fromValues(this.u[0],this.v[0],this.plane[0],0,this.u[1],this.v[1],this.plane[1],0,this.u[2],this.v[2],this.plane[2],0,0,0,-this.plane[3],1)},getInverseProjectionMatrix:function(){let s=r.scale(r.create(),this.plane,this.plane[3]);return n.fromValues(this.u[0],this.u[1],this.u[2],0,this.v[0],this.v[1],this.v[2],0,this.plane[0],this.plane[1],this.plane[2],0,s[0],s[1],s[2],1)},to2D:function(s){return o.fromValues(r.dot(s,this.u),r.dot(s,this.v))},to3D:function(s){let a=r.scale(r.create(),this.u,s[0]),c=r.scale(r.create(),this.v,s[1]),l=r.add(a,a,this.planeorigin);return r.add(c,c,l)}},t.exports=i}}),uHi=At({"node_modules/@jscad/modeling/src/operations/modifiers/reTesselateCoplanarPolygons.js"(e,t){var{EPS:n}=Lc(),o=_pt(),r=Na(),i=dHi(),s=Rqn(),{insertSorted:a,fnNumberSort:c}=nJn(),l=_c(),h=(d)=>{if(d.length<2)return d;let u=[],_=d.length,p=l.plane(d[0]),m=new i(p),A=[],g=[],f=new Map,y=new Map,x=new Map,C=10/n;for(let P=0;P<_;P++){let M=d[P],B=[],T=M.vertices.length,N=-1;if(T>0){let D,L;for(let H=0;H<T;H++){let V=m.to2D(M.vertices[H]),O=Math.floor(V[1]*C),U;if(x.has(O))U=x.get(O);else if(x.has(O+1))U=x.get(O+1);else if(x.has(O-1))U=x.get(O-1);else U=V[1],x.set(O,V[1]);V=r.fromValues(V[0],U),B.push(V);let j=V[1];if(H===0||j<D)D=j,N=H;if(H===0||j>L)L=j;let Y=y.get(j);if(!Y)Y={},y.set(j,Y);Y[P]=!0}if(D>=L)B=[],T=0,N=-1;else{let H=f.get(D);if(!H)H=[],f.set(D,H);H.push(P)}}B.reverse(),N=T-N-1,A.push(B),g.push(N)}let b=[];y.forEach((P,M)=>b.push(M)),b.sort(c);let I=[],v=[];for(let P=0;P<b.length;P++){let M=[],B=b[P],T=y.get(B),N=0;for(let L=0;L<I.length;++L){let H=I[L],V=H.polygonindex;if(T[V]){let O=A[V],U=O.length,{leftvertexindex:j,rightvertexindex:Y}=H;while(!0){let K=j+1;if(K>=U)K=0;if(O[K][1]!==B)break;j=K}let X=Y-1;if(X<0)X=U-1;if(O[X][1]===B)Y=X;if(j!==H.leftvertexindex&&j===Y)H._remove=!0,N++;else{H.leftvertexindex=j,H.rightvertexindex=Y,H.topleft=O[j],H.topright=O[Y];let K=j+1;if(K>=U)K=0;H.bottomleft=O[K];let J=Y-1;if(J<0)J=U-1;H.bottomright=O[J]}}}if(N>0)I=I.filter((L)=>!L._remove);let D;if(P>=b.length-1)I=[],D=null;else{D=Number(b[P+1]);let L=0.5*(B+D),H=f.get(B);for(let V in H){let O=H[V],U=A[O],j=U.length,Y=g[O],X=Y;while(!0){let ne=X+1;if(ne>=j)ne=0;if(U[ne][1]!==B)break;if(ne===Y)break;X=ne}let K=Y;while(!0){let ne=K-1;if(ne<0)ne=j-1;if(U[ne][1]!==B)break;if(ne===X)break;K=ne}let J=X+1;if(J>=j)J=0;let ee=K-1;if(ee<0)ee=j-1;let se={polygonindex:O,leftvertexindex:X,rightvertexindex:K,topleft:U[X],topright:U[K],bottomleft:U[J],bottomright:U[ee]};a(I,se,(ne,re)=>{let Z=s(ne.topleft,ne.bottomleft,L),te=s(re.topleft,re.bottomleft,L);if(Z>te)return 1;if(Z<te)return-1;return 0})}}for(let L in I){let H=I[L],V=s(H.topleft,H.bottomleft,B),O=r.fromValues(V,B);V=s(H.topright,H.bottomright,B);let U=r.fromValues(V,B);V=s(H.topleft,H.bottomleft,D);let j=r.fromValues(V,D);V=s(H.topright,H.bottomright,D);let Y=r.fromValues(V,D),X={topleft:O,topright:U,bottomleft:j,bottomright:Y,leftline:o.fromPoints(o.create(),O,j),rightline:o.fromPoints(o.create(),Y,U)};if(M.length>0){let K=M[M.length-1],J=r.distance(X.topleft,K.topright),ee=r.distance(X.bottomleft,K.bottomright);if(J<n&&ee<n)X.topleft=K.topleft,X.leftline=K.leftline,X.bottomleft=K.bottomleft,M.splice(M.length-1,1)}M.push(X)}if(P>0){let L=new Set,H=new Set;for(let V=0;V<M.length;V++){let O=M[V];for(let U=0;U<v.length;U++)if(!H.has(U)){let j=v[U];if(r.distance(j.bottomleft,O.topleft)<n){if(r.distance(j.bottomright,O.topright)<n){H.add(U);let Y=o.direction(O.leftline),X=o.direction(j.leftline),K=Y[0]-X[0],J=o.direction(O.rightline),ee=o.direction(j.rightline),se=J[0]-ee[0],ne=Math.abs(K)<n,re=Math.abs(se)<n,Z=ne||K>=0,te=re||se>=0;if(Z&&te)O.outpolygon=j.outpolygon,O.leftlinecontinues=ne,O.rightlinecontinues=re,L.add(U);break}}}}for(let V=0;V<v.length;V++)if(!L.has(V)){let O=v[V];if(O.outpolygon.rightpoints.push(O.bottomright),r.distance(O.bottomright,O.bottomleft)>n)O.outpolygon.leftpoints.push(O.bottomleft);O.outpolygon.leftpoints.reverse();let j=O.outpolygon.rightpoints.concat(O.outpolygon.leftpoints).map((X)=>m.to3D(X)),Y=l.fromPointsAndPlane(j,p);if(Y.vertices.length)u.push(Y)}}for(let L=0;L<M.length;L++){let H=M[L];if(!H.outpolygon){if(H.outpolygon={leftpoints:[],rightpoints:[]},H.outpolygon.leftpoints.push(H.topleft),r.distance(H.topleft,H.topright)>n)H.outpolygon.rightpoints.push(H.topright)}else{if(!H.leftlinecontinues)H.outpolygon.leftpoints.push(H.topleft);if(!H.rightlinecontinues)H.outpolygon.rightpoints.push(H.topright)}}v=M}return u};t.exports=h}}),Upe=At({"node_modules/@jscad/modeling/src/operations/modifiers/retessellate.js"(e,t){var n=Js(),o=_c(),{NEPS:r}=Lc(),i=uHi(),s=(l)=>{if(l.isRetesselated)return l;let h=n.toPolygons(l).map((p,m)=>({vertices:p.vertices,plane:o.plane(p),index:m})),d=a(h),u=[];d.forEach((p)=>{if(Array.isArray(p)){let m=i(p);for(let A=0;A<m.length;A++)u.push(m[A])}else u.push(p)});let _=n.create(u);return _.isRetesselated=!0,_},a=(l)=>{let h=[l],d=[];for(let _=3;_>=0;_--){let p=[],m=_===3?0.000000015:r;h.forEach((A)=>{A.sort(c(_,m));let g=0;for(let f=1;f<A.length;f++)if(A[f].plane[_]-A[g].plane[_]>m){if(f-g===1)d.push(A[g]);else p.push(A.slice(g,f));g=f}if(A.length-g===1)d.push(A[g]);else p.push(A.slice(g))}),h=p}let u=[];return h.forEach((_)=>{if(_[0])u[_[0].index]=_}),d.forEach((_)=>{u[_.index]=_}),u},c=(l,h)=>(d,u)=>{if(d.plane[l]-u.plane[l]>h)return 1;else if(u.plane[l]-d.plane[l]>h)return-1;return 0};t.exports=s}}),bpt=At({"node_modules/@jscad/modeling/src/operations/booleans/mayOverlap.js"(e,t){var{EPS:n}=Lc(),o=lU(),r=(i,s)=>{if(i.polygons.length===0||s.polygons.length===0)return!1;let a=o(i),c=a[0],l=a[1],h=o(s),d=h[0],u=h[1];if(d[0]-l[0]>n)return!1;if(c[0]-u[0]>n)return!1;if(d[1]-l[1]>n)return!1;if(c[1]-u[1]>n)return!1;if(d[2]-l[2]>n)return!1;if(c[2]-u[2]>n)return!1;return!0};t.exports=r}}),pHi=At({"node_modules/@jscad/modeling/src/operations/booleans/trees/Node.js"(e,t){var n=IE(),o=_c(),r=class i{constructor(s){this.plane=null,this.front=null,this.back=null,this.polygontreenodes=[],this.parent=s}invert(){let s=[this],a;for(let c=0;c<s.length;c++){if(a=s[c],a.plane)a.plane=n.flip(n.create(),a.plane);if(a.front)s.push(a.front);if(a.back)s.push(a.back);let l=a.front;a.front=a.back,a.back=l}}clipPolygons(s,a){let c={node:this,polygontreenodes:s},l,h=[];do{if(l=c.node,s=c.polygontreenodes,l.plane){let d=l.plane,u=[],_=[],p=a?u:_,m=s.length;for(let g=0;g<m;g++){let f=s[g];if(!f.isRemoved())f.splitByPlane(d,p,u,_,u)}if(l.front&&_.length>0)h.push({node:l.front,polygontreenodes:_});let A=u.length;if(l.back&&A>0)h.push({node:l.back,polygontreenodes:u});else for(let g=0;g<A;g++)u[g].remove()}c=h.pop()}while(c!==void 0)}clipTo(s,a){let c=this,l=[];do{if(c.polygontreenodes.length>0)s.rootnode.clipPolygons(c.polygontreenodes,a);if(c.front)l.push(c.front);if(c.back)l.push(c.back);c=l.pop()}while(c!==void 0)}addPolygonTreeNodes(s){let a={node:this,polygontreenodes:s},c=[];do{let l=a.node,h=a.polygontreenodes;if(h.length===0){a=c.pop();continue}if(!l.plane){let p=0;p=Math.floor(h.length/2);let m=h[p].getPolygon();l.plane=o.plane(m)}let d=[],u=[],_=h.length;for(let p=0;p<_;++p)h[p].splitByPlane(l.plane,l.polygontreenodes,u,d,u);if(d.length>0){if(!l.front)l.front=new i(l);if(_===d.length&&u.length===0)l.front.polygontreenodes=d;else c.push({node:l.front,polygontreenodes:d})}if(u.length>0){if(!l.back)l.back=new i(l);if(_===u.length&&d.length===0)l.back.polygontreenodes=u;else c.push({node:l.back,polygontreenodes:u})}a=c.pop()}while(a!==void 0)}};t.exports=r}}),mHi=At({"node_modules/@jscad/modeling/src/operations/booleans/trees/splitLineSegmentByPlane.js"(e,t){var n=Ai(),o=(r,i,s)=>{let a=n.subtract(n.create(),s,i),c=(r[3]-n.dot(r,i))/n.dot(r,a);if(Number.isNaN(c))c=0;if(c>1)c=1;if(c<0)c=0;return n.scale(a,a,c),n.add(a,i,a),a};t.exports=o}}),_Hi=At({"node_modules/@jscad/modeling/src/operations/booleans/trees/splitPolygonByPlane.js"(e,t){var{EPS:n}=Lc(),o=IE(),r=Ai(),i=_c(),s=mHi(),a=n*n,c=(h)=>{let d=[],u=h[h.length-1];for(let _=0;_<h.length;_++){let p=h[_];if(r.squaredDistance(p,u)>=a)d.push(p);u=p}return d},l=(h,d)=>{let u={type:null,front:null,back:null},_=d.vertices,p=_.length,m=i.plane(d);if(o.equals(m,h))u.type=0;else{let A=!1,g=!1,f=[],y=-n;for(let x=0;x<p;x++){let C=r.dot(h,_[x])-h[3],b=C<y;if(f.push(b),C>n)A=!0;if(C<y)g=!0}if(!A&&!g){let x=r.dot(h,m);u.type=x>=0?0:1}else if(!g)u.type=2;else if(!A)u.type=3;else{u.type=4;let x=[],C=[],b=f[0];for(let I=0;I<p;I++){let v=_[I],P=I+1;if(P>=p)P=0;let M=f[P];if(b===M)if(b)C.push(v);else x.push(v);else{let B=_[P],T=s(h,v,B);if(b)C.push(v),C.push(T),x.push(T);else x.push(v),x.push(T),C.push(T)}b=M}if(x.length>=3){let I=c(x);if(I.length>=3)u.front=i.fromPointsAndPlane(I,m)}if(C.length>=3){let I=c(C);if(I.length>=3)u.back=i.fromPointsAndPlane(I,m)}}}return u};t.exports=l}}),gHi=At({"node_modules/@jscad/modeling/src/operations/booleans/trees/PolygonTreeNode.js"(e,t){var{EPS:n}=Lc(),o=Ai(),r=_c(),i=_Hi(),s=class a{constructor(c,l){this.parent=c,this.children=[],this.polygon=l,this.removed=!1}addPolygons(c){if(!this.isRootNode())throw Error("Assertion failed");let l=this;c.forEach((h)=>{l.addChild(h)})}remove(){if(!this.removed)this.removed=!0,this.polygon=null,this.parent.recursivelyInvalidatePolygon()}isRemoved(){return this.removed}isRootNode(){return!this.parent}invert(){if(!this.isRootNode())throw Error("Assertion failed");this.invertSub()}getPolygon(){if(!this.polygon)throw Error("Assertion failed");return this.polygon}getPolygons(c){if(this.isRootNode()&&this.children.length>0){let m=[];for(let A=0;A<this.children.length;A++)if(!this.children[A].removed)m.push(this.children[A]);this.children=m}let l=[this],h=[l],d,u,_,p;for(d=0;d<h.length;++d){l=h[d];for(u=0,_=l.length;u<_;u++)if(p=l[u],p.polygon)c.push(p.polygon);else if(p.children.length>0)h.push(p.children)}}splitByPlane(c,l,h,d,u){if(this.children.length){let _=[this.children],p,m,A,g,f;for(p=0;p<_.length;p++){f=_[p];for(m=0,A=f.length;m<A;m++)if(g=f[m],g.children.length>0)_.push(g.children);else g._splitByPlane(c,l,h,d,u)}}else this._splitByPlane(c,l,h,d,u)}_splitByPlane(c,l,h,d,u){let _=this.polygon;if(_){let p=r.measureBoundingSphere(_),m=p[3]+n,A=p,g=o.dot(c,A)-c[3];if(g>m)d.push(this);else if(g<-m)u.push(this);else{let f=i(c,_);switch(f.type){case 0:l.push(this);break;case 1:h.push(this);break;case 2:d.push(this);break;case 3:u.push(this);break;case 4:if(f.front){let y=this.addChild(f.front);d.push(y)}if(f.back){let y=this.addChild(f.back);u.push(y)}break}}}}addChild(c){let l=new a(this,c);return this.children.push(l),l}invertSub(){let c=[this],l=[c],h,d,u,_;for(h=0;h<l.length;h++){c=l[h];for(d=0,u=c.length;d<u;d++){if(_=c[d],_.polygon)_.polygon=r.invert(_.polygon);if(_.children.length>0)l.push(_.children)}}}recursivelyInvalidatePolygon(){if(this.polygon=null,this.parent)this.parent.recursivelyInvalidatePolygon()}clear(){let c=[this],l=[c];for(let h=0;h<l.length;++h){c=l[h];let d=c.length;for(let u=0;u<d;u++){let _=c[u];if(_.polygon)_.polygon=null;if(_.parent)_.parent=null;if(_.children.length>0)l.push(_.children);_.children=[]}}}toString(){let c="",l=[this],h=[l],d,u,_,p;for(d=0;d<h.length;++d){l=h[d];let m=" ".repeat(d);for(u=0,_=l.length;u<_;u++){if(p=l[u],c+=`${m}PolygonTreeNode (${p.isRootNode()}): ${p.children.length}`,p.polygon)c+=`
 ${m}polygon: ${p.polygon.vertices}
`;else c+=`
`;if(p.children.length>0)h.push(p.children)}}return c}};t.exports=s}}),AHi=At({"node_modules/@jscad/modeling/src/operations/booleans/trees/Tree.js"(e,t){var n=pHi(),o=gHi(),r=class{constructor(i){if(this.polygonTree=new o,this.rootnode=new n(null),i)this.addPolygons(i)}invert(){this.polygonTree.invert(),this.rootnode.invert()}clipTo(i,s=!1){this.rootnode.clipTo(i,s)}allPolygons(){let i=[];return this.polygonTree.getPolygons(i),i}addPolygons(i){let s=Array(i.length);for(let a=0;a<i.length;a++)s[a]=this.polygonTree.addChild(i[a]);this.rootnode.addPolygonTreeNodes(s)}clear(){this.polygonTree.clear()}toString(){return"Tree: "+this.polygonTree.toString("")}};t.exports=r}}),Ipt=At({"node_modules/@jscad/modeling/src/operations/booleans/trees/index.js"(e,t){t.exports={Tree:AHi()}}}),fHi=At({"node_modules/@jscad/modeling/src/operations/booleans/intersectGeom3Sub.js"(e,t){var n=Js(),o=bpt(),{Tree:r}=Ipt(),i=(s,a)=>{if(!o(s,a))return n.create();let c=new r(n.toPolygons(s)),l=new r(n.toPolygons(a));c.invert(),l.clipTo(c),l.invert(),c.clipTo(l),l.clipTo(c),c.addPolygons(l.allPolygons()),c.invert();let h=c.allPolygons();return n.create(h)};t.exports=i}}),oJn=At({"node_modules/@jscad/modeling/src/operations/booleans/intersectGeom3.js"(e,t){var n=Rs(),o=Upe(),r=fHi(),i=(...s)=>{s=n(s);let a=s.shift();return s.forEach((c)=>{a=r(a,c)}),a=o(a),a};t.exports=i}}),yHi=At({"node_modules/@jscad/modeling/src/operations/booleans/intersectGeom2.js"(e,t){var n=Rs(),o=Js(),r=hH(),i=xpt(),s=Cpt(),a=oJn(),c=(...l)=>{l=n(l);let h=l.map((_)=>s({z0:-1,z1:1},_)),d=a(h),u=r(d);return i(u,o.toPolygons(d))};t.exports=c}}),xHi=At({"node_modules/@jscad/modeling/src/operations/booleans/intersect.js"(e,t){var n=Rs(),o=Gpe(),r=la(),i=Js(),s=yHi(),a=oJn(),c=(...l)=>{if(l=n(l),l.length===0)throw Error("wrong number of arguments");if(!o(l))throw Error("only intersect of the types are supported");let h=l[0];if(r.isA(h))return s(l);if(i.isA(h))return a(l);return h};t.exports=c}}),vpt=At({"node_modules/@jscad/modeling/src/operations/hulls/hullPoints3.js"(e,t){var n=_c(),o=aqn(),r=(i)=>o(i,{skipTriangulation:!0}).map((c)=>{let l=c.map((h)=>i[h]);return n.create(l)});t.exports=r}}),rJn=At({"node_modules/@jscad/modeling/src/operations/booleans/unionGeom3Sub.js"(e,t){var n=Js(),o=bpt(),{Tree:r}=Ipt(),i=(a,c)=>{if(!o(a,c))return s(a,c);let l=new r(n.toPolygons(a)),h=new r(n.toPolygons(c));l.clipTo(h,!1),h.clipTo(l),h.invert(),h.clipTo(l),h.invert();let d=l.allPolygons().concat(h.allPolygons());return n.create(d)},s=(a,c)=>{let l=n.toPolygons(a);return l=l.concat(n.toPolygons(c)),n.create(l)};t.exports=i}}),Spt=At({"node_modules/@jscad/modeling/src/operations/booleans/unionGeom3.js"(e,t){var n=Rs(),o=Upe(),r=rJn(),i=(...s)=>{s=n(s);let a;for(a=1;a<s.length;a+=2)s.push(r(s[a-1],s[a]));let c=s[a-1];return c=o(c),c};t.exports=i}}),iJn=At({"node_modules/@jscad/modeling/src/operations/minkowski/minkowskiSum.js"(e,t){var n=Rs(),o=Js(),r=_c(),i=vpt(),s=Spt(),a=(..._)=>{if(_=n(_),_.length!==2)throw Error("minkowskiSum requires exactly two geometries");let[p,m]=_;if(!o.isA(p)||!o.isA(m))throw Error("minkowskiSum requires geom3 geometries");let A=o.isConvex(p),g=o.isConvex(m);if(A&&g)return d(p,m);if(!A&&g)return c(p,m);if(A&&!g)return c(m,p);throw Error("minkowskiSum of two non-convex geometries is not yet supported")},c=(_,p)=>{let m=l(_);if(m.length===0)return o.create();let A=m.map((g)=>d(g,p));if(A.length===1)return A[0];return s(A)},l=(_)=>{let p=o.toPolygons(_);if(p.length===0)return[];let m=[];for(let A=0;A<p.length;A++){let g=p[A],f=g.vertices,y=0,x=0,C=0;for(let T=0;T<f.length;T++)y+=f[T][0],x+=f[T][1],C+=f[T][2];y/=f.length,x/=f.length,C/=f.length;let b=r.plane(g),I=b[0],v=b[1],P=b[2],M=0.1,B=[y-I*M,x-v*M,C-P*M];for(let T=1;T<f.length-1;T++){let N=f[0],D=f[T],L=f[T+1],H=h(B,N,D,L);m.push(o.create(H))}}return m},h=(_,p,m,A)=>[r.create([_,m,p]),r.create([_,p,A]),r.create([p,m,A]),r.create([m,_,A])],d=(_,p)=>{let m=u(_),A=u(p);if(m.length===0||A.length===0)return o.create();let g=[];for(let y=0;y<m.length;y++){let x=m[y];for(let C=0;C<A.length;C++){let b=A[C];g.push([x[0]+b[0],x[1]+b[1],x[2]+b[2]])}}let f=i(g);return o.create(f)},u=(_)=>{let p=new Set,m=[],A=o.toPolygons(_);for(let g=0;g<A.length;g++){let f=A[g].vertices;for(let y=0;y<f.length;y++){let x=f[y],C=`${x[0]},${x[1]},${x[2]}`;if(!p.has(C))p.add(C),m.push(x)}}return m};t.exports=a}}),CHi=At({"node_modules/@jscad/modeling/src/operations/booleans/scissionGeom3.js"(e,t){var n=Ai(),o=hH(),r=Js(),i=(l)=>l.sort((h,d)=>h-d).filter((h,d,u)=>!d||h!==u[d-1]),s=(l,h,d)=>{let u=`${h}`,_=l.get(u);if(_===void 0)l.set(u,[d]);else _.push(d)},a=(l,h)=>{let d=`${h}`;return l.get(d)},c=(l)=>{let h=o(l),d=r.toPolygons(l),u=d.length,_=new Map,p=n.create();d.forEach((y,x)=>{y.vertices.forEach((C)=>{s(_,n.snap(p,C,h),x)})});let m=d.map((y)=>{let x=[];return y.vertices.forEach((C)=>{x=x.concat(a(_,n.snap(p,C,h)))}),{e:1,d:i(x)}});_.clear();let A=0,g=m.length;for(let y=0;y<g;y++){let x=m[y];if(x.e>0){let C=Array(u);C[y]=!0;do A=0,C.forEach((b,I)=>{let v=m[I];if(v.e>0){v.e=-1;for(let P=0;P<v.d.length;P++)C[v.d[P]]=!0;A++}});while(A>0);x.indexes=C}}let f=[];for(let y=0;y<g;y++)if(m[y].indexes){let x=[];m[y].indexes.forEach((C,b)=>x.push(d[b])),f.push(r.create(x))}return f};t.exports=c}}),bHi=At({"node_modules/@jscad/modeling/src/operations/booleans/scission.js"(e,t){var n=Rs(),o=Js(),r=CHi(),i=(...s)=>{if(s=n(s),s.length===0)throw Error("wrong number of arguments");let a=s.map((c)=>{if(o.isA(c))return r(c);return c});return a.length===1?a[0]:a};t.exports=i}}),IHi=At({"node_modules/@jscad/modeling/src/operations/booleans/subtractGeom3Sub.js"(e,t){var n=Js(),o=bpt(),{Tree:r}=Ipt(),i=(s,a)=>{if(!o(s,a))return n.clone(s);let c=new r(n.toPolygons(s)),l=new r(n.toPolygons(a));c.invert(),c.clipTo(l),l.clipTo(c,!0),c.addPolygons(l.allPolygons()),c.invert();let h=c.allPolygons();return n.create(h)};t.exports=i}}),sJn=At({"node_modules/@jscad/modeling/src/operations/booleans/subtractGeom3.js"(e,t){var n=Rs(),o=Upe(),r=IHi(),i=(...s)=>{s=n(s);let a=s.shift();return s.forEach((c)=>{a=r(a,c)}),a=o(a),a};t.exports=i}}),vHi=At({"node_modules/@jscad/modeling/src/operations/booleans/subtractGeom2.js"(e,t){var n=Rs(),o=Js(),r=hH(),i=xpt(),s=Cpt(),a=sJn(),c=(...l)=>{l=n(l);let h=l.map((_)=>s({z0:-1,z1:1},_)),d=a(h),u=r(d);return i(u,o.toPolygons(d))};t.exports=c}}),SHi=At({"node_modules/@jscad/modeling/src/operations/booleans/subtract.js"(e,t){var n=Rs(),o=Gpe(),r=la(),i=Js(),s=vHi(),a=sJn(),c=(...l)=>{if(l=n(l),l.length===0)throw Error("wrong number of arguments");if(!o(l))throw Error("only subtract of the types are supported");let h=l[0];if(r.isA(h))return s(l);if(i.isA(h))return a(l);return h};t.exports=c}}),aJn=At({"node_modules/@jscad/modeling/src/operations/booleans/unionGeom2.js"(e,t){var n=Rs(),o=Js(),r=hH(),i=xpt(),s=Cpt(),a=Spt(),c=(...l)=>{l=n(l);let h=l.map((_)=>s({z0:-1,z1:1},_)),d=a(h),u=r(d);return i(u,o.toPolygons(d))};t.exports=c}}),Ppt=At({"node_modules/@jscad/modeling/src/operations/booleans/union.js"(e,t){var n=Rs(),o=Gpe(),r=la(),i=Js(),s=aJn(),a=Spt(),c=(...l)=>{if(l=n(l),l.length===0)throw Error("wrong number of arguments");if(!o(l))throw Error("only unions of the same type are supported");let h=l[0];if(r.isA(h))return s(l);if(i.isA(h))return a(l);return h};t.exports=c}}),Wpe=At({"node_modules/@jscad/modeling/src/operations/booleans/index.js"(e,t){t.exports={intersect:xHi(),minkowski:iJn(),scission:bHi(),subtract:SHi(),union:Ppt()}}}),kwe=At({"node_modules/@jscad/modeling/src/operations/expansions/offsetFromPoints.js"(e,t){var{EPS:n,TAU:o}=Lc(),r=Qqn(),i=_pt(),s=Na(),a=Nwe(),c=(l,h)=>{let d={delta:1,corners:"edge",closed:!1,segments:16},{delta:u,corners:_,closed:p,segments:m}=Object.assign({},d,l);if(Math.abs(u)<n)return h;let A=l.closed?a(h):1;if(A===0)A=1;let g=A>0&&u>=0||A<0&&u<0;u=Math.abs(u);let f=null,y=[],x=[],C=s.create(),b=h.length;for(let I=0;I<b;I++){let v=(I+1)%b,P=h[I],M=h[v];g?s.subtract(C,P,M):s.subtract(C,M,P),s.normal(C,C),s.normalize(C,C),s.scale(C,C,u);let B=s.add(s.create(),P,C),T=s.add(s.create(),M,C),N=[B,T];if(f!=null){if(p||!p&&v!==0){let D=r(f[0],f[1],N[0],N[1]);if(D)y.pop(),N[0]=D;else x.push({c:P,s0:f,s1:N})}}if(f=[B,T],v===0&&!p)continue;y.push(N[0]),y.push(N[1])}if(p&&f!=null){let I=y[0],v=y[1],P=r(f[0],f[1],I,v);if(P)y[0]=P,y.pop();else{let M=h[0],B=[I,v];x.push({c:M,s0:f,s1:B})}}if(_==="edge"){let I=new Map;y.forEach((M,B)=>I.set(M,B));let v=i.create(),P=i.create();x.forEach((M)=>{i.fromPoints(v,M.s0[0],M.s0[1]),i.fromPoints(P,M.s1[0],M.s1[1]);let B=i.intersectPointOfLines(v,P);if(Number.isFinite(B[0])&&Number.isFinite(B[1])){let T=M.s0[1],N=I.get(T);y[N]=B,y[(N+1)%y.length]=void 0}else{let T=M.s1[0],N=I.get(T);y[N]=void 0}}),y=y.filter((M)=>M!==void 0)}if(_==="round"){let I=Math.floor(m/4),v=s.create();x.forEach((P)=>{let M=s.angle(s.subtract(v,P.s1[0],P.c));if(M-=s.angle(s.subtract(v,P.s0[1],P.c)),g&&M<0){if(M=M+Math.PI,M<0)M=M+Math.PI}if(!g&&M>0){if(M=M-Math.PI,M>0)M=M-Math.PI}if(M!==0){I=Math.floor(m*(Math.abs(M)/o));let B=M/I,T=s.angle(s.subtract(v,P.s0[1],P.c)),N=[];for(let D=1;D<I;D++){let L=T+B*D,H=s.fromAngleRadians(s.create(),L);s.scale(H,H,u),s.add(H,H,P.c),N.push(H)}if(N.length>0){let D=P.s0[1],L=y.findIndex((H)=>s.equals(D,H));L=(L+1)%y.length,y.splice(L,0,...N)}}else{let B=P.s1[0],T=y.findIndex((N)=>s.equals(B,N));y.splice(T,1)}})}return y};t.exports=c}}),PHi=At({"node_modules/@jscad/modeling/src/operations/expansions/expandGeom2.js"(e,t){var n=la(),o=kwe(),r=(i,s)=>{let a={delta:1,corners:"edge",segments:16},{delta:c,corners:l,segments:h}=Object.assign({},a,i);if(!(l==="edge"||l==="chamfer"||l==="round"))throw Error('corners must be "edge", "chamfer", or "round"');let _=n.toOutlines(s).map((p)=>(i={delta:c,corners:l,closed:!0,segments:h},o(i,p))).reduce((p,m)=>p.concat(n.toSides(n.fromPoints(m))),[]);return n.create(_)};t.exports=r}}),EHi=At({"node_modules/@jscad/modeling/src/operations/expansions/extrudePolygon.js"(e,t){var n=kd(),o=Ai(),r=Js(),i=_c(),s=(a,c)=>{if(o.dot(i.plane(c),a)>0)c=i.invert(c);let h=[c],d=i.transform(n.fromTranslation(n.create(),a),c),u=c.vertices.length;for(let _=0;_<u;_++){let p=_<u-1?_+1:0,m=i.create([c.vertices[_],d.vertices[_],d.vertices[p],c.vertices[p]]);h.push(m)}return h.push(i.invert(d)),r.create(h)};t.exports=s}}),MHi=At({"node_modules/@jscad/modeling/src/operations/expansions/expandShell.js"(e,t){var{EPS:n,TAU:o}=Lc(),r=kd(),i=Ai(),s=tJn(),a=Js(),c=_c(),l=jqn(),h=Upe(),d=rJn(),u=EHi(),_=(g,f,y)=>{let x=f.toString();if(!g.has(x)){let C=[f,[y]];g.set(x,C)}else g.get(x)[1].push(y)},p=(g,f,y)=>{let x=f[0].toString(),C=f[1].toString(),b=x<C?`${x},${C}`:`${C},${x}`;if(!g.has(b)){let I=[f,[y]];g.set(b,I)}else g.get(b)[1].push(y)},m=(g,f)=>{if(g.findIndex((x)=>x===f)<0)g.push(f)},A=(g,f)=>{let y={delta:1,segments:12},{delta:x,segments:C}=Object.assign({},y,g),b=a.create(),I=new Map,v=new Map,P=i.create(),M=i.create();return a.toPolygons(f).forEach((T,N)=>{let D=i.scale(i.create(),c.plane(T),2*x),L=c.transform(r.fromTranslation(r.create(),i.scale(i.create(),D,-0.5)),T),H=u(D,L);b=d(b,H);let V=T.vertices;for(let O=0;O<V.length;O++){_(I,V[O],c.plane(T));let U=(O+1)%V.length,j=[V[O],V[U]];p(v,j,c.plane(T))}}),v.forEach((T)=>{let N=T[0],D=T[1],L=N[0],H=N[1],V=i.subtract(i.create(),H,L);i.normalize(V,V);let O=D[0],U=i.cross(i.create(),O,V),j=[];for(let re=0;re<C;re++)m(j,re*o/C);for(let re=0,Z=D.length;re<Z;re++){let te=D[re],ie=i.dot(U,te),le=i.dot(O,te),ue=Math.atan2(ie,le);if(ue<0)ue+=o;if(m(j,ue),ue=Math.atan2(-ie,-le),ue<0)ue+=o;m(j,ue)}j=j.sort(s);let Y=j.length,X,K,J=[],ee=[],se=[];for(let re=-1;re<Y;re++){let Z=j[re<0?re+Y:re],te=Math.sin(Z),ie=Math.cos(Z);i.scale(P,O,ie*x),i.scale(M,U,te*x),i.add(P,P,M);let le=i.add(i.create(),L,P),ue=i.add(i.create(),H,P),de=!1;if(re>=0){if(i.distance(le,X)<n)de=!0}if(!de){if(re>=0){J.push(le),ee.push(ue);let me=[K,ue,le,X],Ae=c.create(me);se.push(Ae)}X=le,K=ue}}ee.reverse(),se.push(c.create(J)),se.push(c.create(ee));let ne=a.create(se);b=d(b,ne)}),I.forEach((T)=>{let N=T[0],D=T[1],L=D[0],H=null,V=0;for(let Y=1;Y<D.length;Y++){let X=D[Y],K=i.cross(P,L,X),J=i.length(K);if(J>0.05){if(J>V)V=J,H=X}}if(!H)H=i.orthogonal(P,L);let O=i.cross(P,L,H);i.normalize(O,O);let U=i.cross(M,O,L),j=l({center:[N[0],N[1],N[2]],radius:x,segments:C,axes:[L,O,U]});b=d(b,j)}),h(b)};t.exports=A}}),wHi=At({"node_modules/@jscad/modeling/src/operations/expansions/expandGeom3.js"(e,t){var n=Js(),o=Ppt(),r=MHi(),i=(s,a)=>{let c={delta:1,corners:"round",segments:12},{delta:l,corners:h,segments:d}=Object.assign({},c,s);if(h!=="round")throw Error('corners must be "round" for 3D geometries');if(n.toPolygons(a).length===0)throw Error("the given geometry cannot be empty");s={delta:l,corners:h,segments:d};let _=r(s,a);return o(a,_)};t.exports=i}}),BHi=At({"node_modules/@jscad/modeling/src/operations/expansions/expandPath2.js"(e,t){var n=Nwe(),o=Na(),r=la(),i=hd(),s=kwe(),a=(h)=>{let{external:d,internal:u}=h;if(n(d)<0)d=d.reverse();else u=u.reverse();let _=i.fromPoints({closed:!0},d),p=i.fromPoints({closed:!0},u),m=r.toSides(r.fromPoints(i.toPoints(_))),A=r.toSides(r.fromPoints(i.toPoints(p)));return m.push(...A),r.create(m)},c=(h,d,u,_)=>{let{points:p,external:m,internal:A}=h,g=Math.floor(d/2),f=[],y=[];if(u==="round"&&g>0){let C=Math.PI/g,b=p[p.length-1],I=o.angle(o.subtract(o.create(),m[m.length-1],b)),v=p[0],P=o.angle(o.subtract(o.create(),A[0],v));for(let M=1;M<g;M++){let B=I+C*M,T=o.fromAngleRadians(o.create(),B);o.scale(T,T,_),o.add(T,T,b),f.push(T),B=P+C*M,T=o.fromAngleRadians(o.create(),B),o.scale(T,T,_),o.add(T,T,v),y.push(T)}}let x=[];return x.push(...m,...f,...A.reverse(),...y),r.fromPoints(x)},l=(h,d)=>{h=Object.assign({},{delta:1,corners:"edge",segments:16},h);let{delta:_,corners:p,segments:m}=h;if(_<=0)throw Error("the given delta must be positive for paths");if(!(p==="edge"||p==="chamfer"||p==="round"))throw Error('corners must be "edge", "chamfer", or "round"');let A=d.isClosed,g=i.toPoints(d);if(g.length===0)throw Error("the given geometry cannot be empty");let f={points:g,external:s({delta:_,corners:p,segments:m,closed:A},g),internal:s({delta:-_,corners:p,segments:m,closed:A},g)};if(d.isClosed)return a(f);else return c(f,m,p,_)};t.exports=l}}),Ept=At({"node_modules/@jscad/modeling/src/operations/expansions/expand.js"(e,t){var n=Rs(),o=la(),r=Js(),i=hd(),s=PHi(),a=wHi(),c=BHi(),l=(h,...d)=>{if(d=n(d),d.length===0)throw Error("wrong number of arguments");let u=d.map((_)=>{if(i.isA(_))return c(h,_);if(o.isA(_))return s(h,_);if(r.isA(_))return a(h,_);return _});return u.length===1?u[0]:u};t.exports=l}}),THi=At({"node_modules/@jscad/modeling/src/operations/expansions/offsetGeom2.js"(e,t){var n=la(),o=hpt(),r=kwe(),i=(s,a)=>{let c={delta:1,corners:"edge",segments:0},{delta:l,corners:h,segments:d}=Object.assign({},c,s);if(!(h==="edge"||h==="chamfer"||h==="round"))throw Error('corners must be "edge", "chamfer", or "round"');let u=n.toOutlines(a),p=u.map((m)=>(s={delta:u.reduce((f,y)=>f+o.arePointsInside(m,o.create(y)),0)%2===0?l:-l,corners:h,closed:!0,segments:d},r(s,m))).reduce((m,A)=>m.concat(n.toSides(n.fromPoints(A))),[]);return n.create(p)};t.exports=i}}),DHi=At({"node_modules/@jscad/modeling/src/operations/expansions/offsetPath2.js"(e,t){var n=hd(),o=kwe(),r=(i,s)=>{let a={delta:1,corners:"edge",closed:s.isClosed,segments:16},{delta:c,corners:l,closed:h,segments:d}=Object.assign({},a,i);if(!(l==="edge"||l==="chamfer"||l==="round"))throw Error('corners must be "edge", "chamfer", or "round"');i={delta:c,corners:l,closed:h,segments:d};let u=o(i,n.toPoints(s));return n.fromPoints({closed:h},u)};t.exports=r}}),NHi=At({"node_modules/@jscad/modeling/src/operations/expansions/offset.js"(e,t){var n=Rs(),o=la(),r=hd(),i=THi(),s=DHi(),a=(c,...l)=>{if(l=n(l),l.length===0)throw Error("wrong number of arguments");let h=l.map((d)=>{if(r.isA(d))return s(c,d);if(o.isA(d))return i(c,d);return d});return h.length===1?h[0]:h};t.exports=a}}),cJn=At({"node_modules/@jscad/modeling/src/operations/expansions/index.js"(e,t){t.exports={expand:Ept(),offset:NHi()}}}),Lwe=At({"node_modules/@jscad/modeling/src/operations/extrusions/extrudeLinearGeom2.js"(e,t){var n=kd(),o=Ai(),r=la(),i=Ote(),s=Qwe(),a=(c,l)=>{let h={offset:[0,0,1],twistAngle:0,twistSteps:12,repair:!0},{offset:d,twistAngle:u,twistSteps:_,repair:p}=Object.assign({},h,c);if(_<1)throw Error("twistSteps must be 1 or more");if(u===0)_=1;let m=o.clone(d),A=r.toSides(l);if(A.length===0)throw Error("the given geometry cannot be empty");let g=i.fromSides(A);if(m[2]<0)i.reverse(g,g);let f=n.create(),y=(x,C,b)=>{let I=C/_*u,v=o.scale(o.create(),m,C/_);return n.multiply(f,n.fromZRotation(f,I),n.fromTranslation(n.create(),v)),i.transform(f,b)};return c={numberOfSlices:_+1,capStart:!0,capEnd:!0,repair:p,callback:y},s(c,g)};t.exports=a}}),RHi=At({"node_modules/@jscad/modeling/src/operations/extrusions/extrudeLinearPath2.js"(e,t){var n=la(),o=hd(),r=Lwe(),i=(s,a)=>{if(!a.isClosed)throw Error("extruded path must be closed");let c=o.toPoints(a),l=n.fromPoints(c);return r(s,l)};t.exports=i}}),QHi=At({"node_modules/@jscad/modeling/src/operations/extrusions/extrudeLinear.js"(e,t){var n=Rs(),o=la(),r=hd(),i=Lwe(),s=RHi(),a=(c,...l)=>{let h={height:1,twistAngle:0,twistSteps:1,repair:!0},{height:d,twistAngle:u,twistSteps:_,repair:p}=Object.assign({},h,c);if(l=n(l),l.length===0)throw Error("wrong number of arguments");c={offset:[0,0,d],twistAngle:u,twistSteps:_,repair:p};let m=l.map((A)=>{if(r.isA(A))return s(c,A);if(o.isA(A))return i(c,A);return A});return m.length===1?m[0]:m};t.exports=a}}),kHi=At({"node_modules/@jscad/modeling/src/operations/extrusions/extrudeRectangularPath2.js"(e,t){var n=hd(),o=Ept(),r=Lwe(),i=(s,a)=>{let c={size:1,height:1},{size:l,height:h}=Object.assign({},c,s);if(s.delta=l,s.offset=[0,0,h],n.toPoints(a).length===0)throw Error("the given geometry cannot be empty");let u=o(s,a);return r(s,u)};t.exports=i}}),LHi=At({"node_modules/@jscad/modeling/src/operations/extrusions/extrudeRectangularGeom2.js"(e,t){var{area:n}=Vpe(),o=la(),r=hd(),i=Ept(),s=Lwe(),a=(c,l)=>{let h={size:1,height:1},{size:d,height:u}=Object.assign({},h,c);c.delta=d,c.offset=[0,0,u];let _=o.toOutlines(l);if(_.length===0)throw Error("the given geometry cannot be empty");let m=_.map((g)=>{if(n(g)<0)g.reverse();return i(c,r.fromPoints({closed:!0},g))}).reduce((g,f)=>g.concat(o.toSides(f)),[]),A=o.create(m);return s(c,A)};t.exports=a}}),HHi=At({"node_modules/@jscad/modeling/src/operations/extrusions/extrudeRectangular.js"(e,t){var n=Rs(),o=la(),r=hd(),i=kHi(),s=LHi(),a=(c,...l)=>{let h={size:1,height:1},{size:d,height:u}=Object.assign({},h,c);if(l=n(l),l.length===0)throw Error("wrong number of arguments");if(d<=0)throw Error("size must be positive");if(u<=0)throw Error("height must be positive");let _=l.map((p)=>{if(r.isA(p))return i(c,p);if(o.isA(p))return s(c,p);return p});return _.length===1?_[0]:_};t.exports=a}}),FHi=At({"node_modules/@jscad/modeling/src/operations/extrusions/extrudeHelical.js"(e,t){var{TAU:n}=Lc(),o=kd(),r=la(),i=Qwe(),s=Ote(),a=(c,l)=>{let h={angle:n,startAngle:0,pitch:10,height:0,endOffset:0,segmentsPerRotation:32},{angle:d,startAngle:u,pitch:_,height:p,endOffset:m,segmentsPerRotation:A}=Object.assign({},h,c);if(p!=0)_=p/(d/n);if(A<3)throw Error("The number of segments per rotation needs to be at least 3.");let f=r.toSides(l);if(f.length===0)throw Error("The given geometry cannot be empty");let y=f.filter((M)=>M[0][0]>=0),x=s.fromSides(f);if(y.length===0)x=s.reverse(x);let C=Math.round(A/n*Math.abs(d)),b=C>=2?C:2,I=o.create(),v=o.create(),P=(M,B,T)=>{let N=u+d/b*B,D=m/b*B,L=(N-u)/n*_;return o.multiply(I,o.fromTranslation(o.create(),[D,0,L*Math.sign(d)]),o.fromXRotation(o.create(),-n/4*Math.sign(d))),o.multiply(v,o.fromZRotation(o.create(),N),I),s.transform(v,T)};return i({numberOfSlices:b+1,callback:P},x)};t.exports=a}}),zHi=At({"node_modules/@jscad/modeling/src/operations/extrusions/project.js"(e,t){var n=Rs(),o=mpt(),r=IE(),i=kd(),s=la(),a=Js(),c=_c(),l=hH(),h=aJn(),d=(_,p)=>{let m=r.fromNormalAndPoint(r.create(),_.axis,_.origin);if(Number.isNaN(m[0])||Number.isNaN(m[1])||Number.isNaN(m[2])||Number.isNaN(m[3]))throw Error("project: invalid axis or origin");let A=l(p),g=A*A*Math.sqrt(3)/4;if(A===0)return s.create();let f=a.toPolygons(p),y=[];for(let C=0;C<f.length;C++){let b=f[C].vertices.map((P)=>r.projectionOfPoint(m,P)),I=c.create(b),v=c.plane(I);if(!o(m,v))continue;if(c.measureArea(I)<g)continue;y.push(I)}if(!o(m,[0,0,1])){let C=i.fromVectorRotation(i.create(),m,[0,0,1]);y=y.map((b)=>c.transform(C,b))}y=y.sort((C,b)=>c.measureArea(b)-c.measureArea(C));let x=y.map((C)=>s.fromPoints(C.vertices));return h(x)},u=(_,...p)=>{let m={axis:[0,0,1],origin:[0,0,0]},{axis:A,origin:g}=Object.assign({},m,_);if(p=n(p),p.length===0)throw Error("wrong number of arguments");_={axis:A,origin:g};let f=p.map((y)=>{if(a.isA(y))return d(_,y);return y});return f.length===1?f[0]:f};t.exports=u}}),Xpe=At({"node_modules/@jscad/modeling/src/operations/extrusions/index.js"(e,t){t.exports={extrudeFromSlices:Qwe(),extrudeLinear:QHi(),extrudeRectangular:HHi(),extrudeRotate:Jqn(),extrudeHelical:FHi(),project:zHi(),slice:Ote()}}}),Mpt=At({"node_modules/@jscad/modeling/src/operations/hulls/hullPoints2.js"(e,t){var n=Na(),o=(s)=>{let a=n.fromValues(1/0,1/0);s.forEach((h)=>{if(h[1]<a[1]||h[1]===a[1]&&h[0]<a[0])a=h});let c=[];s.forEach((h)=>{let d=i(h[1]-a[1],h[0]-a[0]),u=n.squaredDistance(h,a);c.push({point:h,angle:d,distSq:u})}),c.sort((h,d)=>h.angle!==d.angle?h.angle-d.angle:h.distSq-d.distSq);let l=[];return c.forEach((h)=>{let d=l.length;while(d>1&&r(l[d-2],l[d-1],h.point)<=Number.EPSILON)l.pop(),d=l.length;l.push(h.point)}),l},r=(s,a,c)=>(a[0]-s[0])*(c[1]-s[1])-(a[1]-s[1])*(c[0]-s[0]),i=(s,a)=>{if(s===0&&a===0)return-1/0;else return-a/s};t.exports=o}}),wpt=At({"node_modules/@jscad/modeling/src/operations/hulls/toUniquePoints.js"(e,t){var n=la(),o=Js(),r=hd(),i=(s)=>{let a=new Set,c=[],l=(h)=>{let d=h.toString();if(!a.has(d))c.push(h),a.add(d)};return s.forEach((h)=>{if(n.isA(h))n.toPoints(h).forEach(l);else if(o.isA(h))o.toPoints(h).forEach((d)=>d.forEach(l));else if(r.isA(h))r.toPoints(h).forEach(l)}),c};t.exports=i}}),OHi=At({"node_modules/@jscad/modeling/src/operations/hulls/hullPath2.js"(e,t){var n=Rs(),o=hd(),r=Mpt(),i=wpt(),s=(...a)=>{a=n(a);let c=i(a),l=r(c);return o.fromPoints({closed:!0},l)};t.exports=s}}),VHi=At({"node_modules/@jscad/modeling/src/operations/hulls/hullGeom2.js"(e,t){var n=Rs(),o=la(),r=Mpt(),i=wpt(),s=(...a)=>{a=n(a);let c=i(a),l=r(c);if(l.length<3)return o.create();return o.fromPoints(l)};t.exports=s}}),YHi=At({"node_modules/@jscad/modeling/src/operations/hulls/hullGeom3.js"(e,t){var n=Rs(),o=Js(),r=wpt(),i=vpt(),s=(...a)=>{a=n(a);let c=r(a);if(c.length===0)return o.create();return o.create(i(c))};t.exports=s}}),lJn=At({"node_modules/@jscad/modeling/src/operations/hulls/hull.js"(e,t){var n=Rs(),o=Gpe(),r=la(),i=Js(),s=hd(),a=OHi(),c=VHi(),l=YHi(),h=(...d)=>{if(d=n(d),d.length===0)throw Error("wrong number of arguments");if(!o(d))throw Error("only hulls of the same type are supported");let u=d[0];if(s.isA(u))return a(d);if(r.isA(u))return c(d);if(i.isA(u))return l(d);return u};t.exports=h}}),GHi=At({"node_modules/@jscad/modeling/src/operations/hulls/hullChain.js"(e,t){var n=Rs(),o=Ppt(),r=lJn(),i=(...s)=>{if(s=n(s),s.length<2)throw Error("wrong number of arguments");let a=[];for(let c=1;c<s.length;c++)a.push(r(s[c-1],s[c]));return o(a)};t.exports=i}}),UHi=At({"node_modules/@jscad/modeling/src/operations/hulls/index.js"(e,t){t.exports={hull:lJn(),hullChain:GHi(),hullPoints2:Mpt(),hullPoints3:vpt()}}}),WHi=At({"node_modules/@jscad/modeling/src/operations/minkowski/index.js"(e,t){t.exports={minkowskiSum:iJn()}}}),hJn=At({"node_modules/@jscad/modeling/src/operations/modifiers/snapPolygons.js"(e,t){var n=Ai(),o=_c(),r=(s,a)=>{let c=Math.abs(o.measureArea(a));return Number.isFinite(c)&&c>s},i=(s,a)=>{let c=a.map((h)=>{let d=h.vertices.map((p)=>n.snap(n.create(),p,s)),u=[];for(let p=0;p<d.length;p++){let m=(p+1)%d.length;if(!n.equals(d[p],d[m]))u.push(d[p])}let _=o.create(u);if(h.color)_.color=h.color;return _}),l=s*s*Math.sqrt(3)/4;return c=c.filter((h)=>r(l,h)),c};t.exports=i}}),XHi=At({"node_modules/@jscad/modeling/src/operations/modifiers/mergePolygons.js"(e,t){var n=mpt(),o=Ai(),r=_c(),i=(g)=>{let f=r.toPoints(g),y=[];for(let x=0;x<f.length;x++){let C=(x+1)%f.length,b={v1:f[x],v2:f[C]};y.push(b)}for(let x=0;x<y.length;x++){let C=(x+1)%f.length;y[x].next=y[C],y[C].prev=y[x]}return y},s=(g,f)=>{let y=`${f.v1}:${f.v2}`;g.set(y,f)},a=(g,f)=>{let y=`${f.v1}:${f.v2}`;g.delete(y)},c=(g,f)=>{let y=`${f.v2}:${f.v1}`;return g.get(y)},l=(g,f,y)=>{let x=g.prev.v1,C=g.prev.v2,b=f.next.v2,I=u(x,C,b,y);x=f.prev.v1,C=f.prev.v2,b=g.next.v2;let v=u(x,C,b,y);return[I,v]},h=o.create(),d=o.create(),u=(g,f,y,x)=>{let C=o.subtract(h,f,g),b=o.subtract(d,y,f);return o.cross(C,C,b),o.dot(C,x)},_=(g)=>{let f,y=[];while(g.next){let x=g.next;y.push(g.v1),g.v1=null,g.v2=null,g.next=null,g.prev=null,g=x}if(y.length>0)f=r.create(y);return f},p=(g)=>{if(g.length<2)return g;let f=g[0].plane,y=g.slice(),x=new Map;while(y.length>0){let b=y.shift(),I=i(b);for(let v=0;v<I.length;v++){let P=I[v],M=c(x,P);if(M){let B=l(P,M,f);if(B[0]>=0&&B[1]>=0){let T=M.next,N=P.next;P.prev.next=M.next,P.next.prev=M.prev,M.prev.next=P.next,M.next.prev=P.prev,P.v1=null,P.v2=null,P.next=null,P.prev=null,a(x,M),M.v1=null,M.v2=null,M.next=null,M.prev=null;let D=(L,H,V)=>{let O={v1:V.v1,v2:H.v2,next:H.next,prev:V.prev};V.prev.next=O,H.next.prev=O,a(L,H),H.v1=null,H.v2=null,H.next=null,H.prev=null,a(L,V),V.v1=null,V.v2=null,V.next=null,V.prev=null};if(B[0]===0)D(x,T,T.prev);if(B[1]===0)D(x,N,N.prev)}}else if(P.next)s(x,P)}}let C=[];return x.forEach((b)=>{let I=_(b);if(I)C.push(I)}),x.clear(),C},m=(g,f)=>{if(Math.abs(g[3]-f[3])<0.00000015)return n(g,f);return!1},A=(g,f)=>{let y=[];f.forEach((C)=>{let b=y.find((I)=>m(I[0],r.plane(C)));if(b)b[1].push(C);else y.push([r.plane(C),[C]])});let x=[];return y.forEach((C)=>{let b=C[1],I=p(b);x=x.concat(I)}),x};t.exports=A}}),jHi=At({"node_modules/@jscad/modeling/src/operations/modifiers/insertTjunctions.js"(e,t){var n=Lc(),o=Ai(),r=_c(),i=!1,s=(h)=>`${h}`,a=(h,d,u,_,p,m)=>{let A=s(_),g=s(p);if(i&&A===g)throw Error("assert failed");let f=`${A}/${g}`,y=`${g}/${A}`;if(h.has(y))return c(h,d,u,p,_,null),null;let x={vertex0:_,vertex1:p,polygonindex:m};if(!h.has(f))h.set(f,[x]);else h.get(f).push(x);if(d.has(A))d.get(A).push(f);else d.set(A,[f]);if(u.has(g))u.get(g).push(f);else u.set(g,[f]);return f},c=(h,d,u,_,p,m)=>{let A=s(_),g=s(p),f=`${A}/${g}`;if(i&&!h.has(f))throw Error("assert failed");let y=-1,x=h.get(f);for(let C=0;C<x.length;C++){let b=x[C],I=s(b.vertex0);if(I!==A)continue;if(I=s(b.vertex1),I!==g)continue;if(m!==null){if(b.polygonindex!==m)continue}y=C;break}if(i&&y<0)throw Error("assert failed");if(x.splice(y,1),x.length===0)h.delete(f);if(y=d.get(A).indexOf(f),i&&y<0)throw Error("assert failed");if(d.get(A).splice(y,1),d.get(A).length===0)d.delete(A);if(y=u.get(g).indexOf(f),i&&y<0)throw Error("assert failed");if(u.get(g).splice(y,1),u.get(g).length===0)u.delete(g)},l=(h)=>{let d=new Map;for(let u=0;u<h.length;u++){let _=h[u],p=_.vertices.length;if(p>=3){let m=_.vertices[0],A=s(m);for(let g=0;g<p;g++){let f=g+1;if(f===p)f=0;let y=_.vertices[f],x=s(y),C=`${A}/${x}`,b=`${x}/${A}`;if(d.has(b)){let I=d.get(b);if(I.splice(-1,1),I.length===0)d.delete(b)}else{let I={vertex0:m,vertex1:y,polygonindex:u};if(!d.has(C))d.set(C,[I]);else d.get(C).push(I)}m=y,A=x}}else console.warn("warning: invalid polygon found during insertTjunctions")}if(d.size>0){let u=new Map,_=new Map,p=new Map;for(let[A,g]of d)p.set(A,!0),g.forEach((f)=>{let y=s(f.vertex0),x=s(f.vertex1);if(u.has(y))u.get(y).push(A);else u.set(y,[A]);if(_.has(x))_.get(x).push(A);else _.set(x,[A])});let m=h.slice(0);while(!0){if(d.size===0)break;for(let g of d.keys())p.set(g,!0);let A=!1;while(!0){let g=Array.from(p.keys());if(g.length===0)break;let f=g[0],y=!0;if(d.has(f)){let x=d.get(f);if(i&&x.length===0)throw Error("assert failed");let C=x[0];for(let b=0;b<2;b++){let I=b===0?C.vertex0:C.vertex1,v=b===0?C.vertex1:C.vertex0,P=s(I),M=s(v),B=[];if(b===0){if(_.has(P))B=_.get(P)}else if(u.has(P))B=u.get(P);for(let T=0;T<B.length;T++){let N=B[T],D=d.get(N)[0],L=b===0?D.vertex0:D.vertex1,H=b===0?D.vertex1:D.vertex0,V=s(L),O=s(H);if(i&&O!==P)throw Error("assert failed");if(V===M){c(d,u,_,I,v,null),c(d,u,_,v,I,null),y=!1,b=2,A=!0;break}else{let U=I,j=v,Y=L,X=o.subtract(o.create(),Y,U),K=o.dot(o.subtract(o.create(),j,U),X)/o.dot(X,X);if(K>0&&K<1){let J=o.scale(o.create(),X,K);if(o.add(J,J,U),o.squaredDistance(J,j)<n.EPS*n.EPS){let se=D.polygonindex,ne=m[se],re=s(D.vertex1),Z=-1;for(let de=0;de<ne.vertices.length;de++)if(s(ne.vertices[de])===re){Z=de;break}if(i&&Z<0)throw Error("assert failed");let te=ne.vertices.slice(0);te.splice(Z,0,v);let ie=r.create(te);m[se]=ie,c(d,u,_,D.vertex0,D.vertex1,se);let le=a(d,u,_,D.vertex0,v,se),ue=a(d,u,_,v,D.vertex1,se);if(le!==null)p.set(le,!0);if(ue!==null)p.set(ue,!0);y=!1,b=2,A=!0;break}}}}}}if(y)p.delete(f)}if(!A)break}h=m}return d.clear(),h};t.exports=l}}),KHi=At({"node_modules/@jscad/modeling/src/operations/modifiers/triangulatePolygons.js"(e,t){var n=Ai(),o=_c(),r=(s,a,c)=>{let l=a.vertices.length;if(l>3){if(l>4){let u=[0,0,0];a.vertices.forEach((_)=>n.add(u,u,_)),n.snap(u,n.divide(u,u,[l,l,l]),s);for(let _=0;_<l;_++){let p=o.create([u,a.vertices[_],a.vertices[(_+1)%l]]);if(a.color)p.color=a.color;c.push(p)}return}let h=o.create([a.vertices[0],a.vertices[1],a.vertices[2]]),d=o.create([a.vertices[0],a.vertices[2],a.vertices[3]]);if(a.color)h.color=a.color,d.color=a.color;c.push(h,d);return}c.push(a)},i=(s,a)=>{let c=[];return a.forEach((l)=>{r(s,l,c)}),c};t.exports=i}}),$Hi=At({"node_modules/@jscad/modeling/src/operations/modifiers/generalize.js"(e,t){var n=Rs(),o=hH(),r=la(),i=Js(),s=hd(),a=hJn(),c=XHi(),l=jHi(),h=KHi(),d=(m,A)=>A,u=(m,A)=>A,_=(m,A)=>{let g={snap:!1,simplify:!1,triangulate:!1},{snap:f,simplify:y,triangulate:x}=Object.assign({},g,m),C=o(A),b=i.toPolygons(A);if(f)b=a(C,b);if(y)b=c(C,b);if(x)b=l(b),b=h(C,b);let I=Object.assign({},A);return I.polygons=b,I},p=(m,...A)=>{if(A=n(A),A.length===0)throw Error("wrong number of arguments");let g=A.map((f)=>{if(s.isA(f))return d(m,f);if(r.isA(f))return u(m,f);if(i.isA(f))return _(m,f);throw Error("invalid geometry")});return g.length===1?g[0]:g};t.exports=p}}),qHi=At({"node_modules/@jscad/modeling/src/operations/modifiers/snap.js"(e,t){var n=Rs(),o=Na(),r=la(),i=Js(),s=hd(),a=hH(),c=hJn(),l=(_)=>{let p=a(_),A=s.toPoints(_).map((g)=>o.snap(o.create(),g,p));return s.create(A)},h=(_)=>{let p=a(_),A=r.toSides(_).map((g)=>[o.snap(o.create(),g[0],p),o.snap(o.create(),g[1],p)]);return A=A.filter((g)=>!o.equals(g[0],g[1])),r.create(A)},d=(_)=>{let p=a(_),m=i.toPolygons(_),A=c(p,m);return i.create(A)},u=(..._)=>{if(_=n(_),_.length===0)throw Error("wrong number of arguments");let p=_.map((m)=>{if(s.isA(m))return l(m);if(r.isA(m))return h(m);if(i.isA(m))return d(m);return m});return p.length===1?p[0]:p};t.exports=u}}),JHi=At({"node_modules/@jscad/modeling/src/operations/modifiers/index.js"(e,t){t.exports={generalize:$Hi(),snap:qHi(),retessellate:Upe()}}}),ZHi=At({"node_modules/@jscad/modeling/src/utils/padArrayToLength.js"(e,t){var n=(o,r,i)=>{o=o.slice();while(o.length<i)o.push(r);return o};t.exports=n}}),eFi=At({"node_modules/@jscad/modeling/src/operations/transforms/align.js"(e,t){var n=Rs(),o=ZHi(),r=gpt(),{translate:i}=nU(),s=(h)=>{if(!Array.isArray(h.modes)||h.modes.length>3)throw Error("align(): modes must be an array of length <= 3");if(h.modes=o(h.modes,"none",3),h.modes.filter((d)=>["center","max","min","none"].includes(d)).length!==3)throw Error('align(): all modes must be one of "center", "max" or "min"');if(!Array.isArray(h.relativeTo)||h.relativeTo.length>3)throw Error("align(): relativeTo must be an array of length <= 3");if(h.relativeTo=o(h.relativeTo,0,3),h.relativeTo.filter((d)=>Number.isFinite(d)||d==null).length!==3)throw Error("align(): all relativeTo values must be a number, or null.");if(typeof h.grouped!=="boolean")throw Error("align(): grouped must be a boolean value.");return h},a=(h,d,u)=>{for(let _=0;_<3;_++)if(h[_]==null){if(d[_]==="center")h[_]=(u[0][_]+u[1][_])/2;else if(d[_]==="max")h[_]=u[1][_];else if(d[_]==="min")h[_]=u[0][_]}return h},c=(h,d,u)=>{let _=r(h),p=[0,0,0];for(let m=0;m<3;m++)if(d[m]==="center")p[m]=u[m]-(_[0][m]+_[1][m])/2;else if(d[m]==="max")p[m]=u[m]-_[1][m];else if(d[m]==="min")p[m]=u[m]-_[0][m];return i(p,h)},l=(h,...d)=>{h=Object.assign({},{modes:["center","center","min"],relativeTo:[0,0,0],grouped:!1},h),h=s(h);let{modes:_,relativeTo:p,grouped:m}=h;if(d=n(d),d.length===0)throw Error("align(): No geometries were provided to act upon");if(p.filter((A)=>A==null).length){let A=r(d);p=a(p,_,A)}if(m)d=c(d,_,p);else d=d.map((A)=>c(A,_,p));return d.length===1?d[0]:d};t.exports=l}}),SMe=At({"node_modules/@jscad/modeling/src/operations/transforms/center.js"(e,t){var n=Rs(),o=la(),r=Js(),i=hd(),s=lU(),{translate:a}=nU(),c=(_,p)=>{let m={axes:[!0,!0,!0],relativeTo:[0,0,0]},{axes:A,relativeTo:g}=Object.assign({},m,_),f=s(p),y=[0,0,0];if(A[0])y[0]=g[0]-(f[0][0]+(f[1][0]-f[0][0])/2);if(A[1])y[1]=g[1]-(f[0][1]+(f[1][1]-f[0][1])/2);if(A[2])y[2]=g[2]-(f[0][2]+(f[1][2]-f[0][2])/2);return a(y,p)},l=(_,...p)=>{let m={axes:[!0,!0,!0],relativeTo:[0,0,0]},{axes:A,relativeTo:g}=Object.assign({},m,_);if(p=n(p),p.length===0)throw Error("wrong number of arguments");if(g.length!==3)throw Error("relativeTo must be an array of length 3");_={axes:A,relativeTo:g};let f=p.map((y)=>{if(i.isA(y))return c(_,y);if(o.isA(y))return c(_,y);if(r.isA(y))return c(_,y);return y});return f.length===1?f[0]:f},h=(..._)=>l({axes:[!0,!1,!1]},_),d=(..._)=>l({axes:[!1,!0,!1]},_),u=(..._)=>l({axes:[!1,!1,!0]},_);t.exports={center:l,centerX:h,centerY:d,centerZ:u}}}),PMe=At({"node_modules/@jscad/modeling/src/operations/transforms/scale.js"(e,t){var n=Rs(),o=kd(),r=la(),i=Js(),s=hd(),a=(d,...u)=>{if(!Array.isArray(d))throw Error("factors must be an array");if(u=n(u),u.length===0)throw Error("wrong number of arguments");d=d.slice();while(d.length<3)d.push(1);if(d[0]<=0||d[1]<=0||d[2]<=0)throw Error("factors must be positive");let _=o.fromScaling(o.create(),d),p=u.map((m)=>{if(s.isA(m))return s.transform(_,m);if(r.isA(m))return r.transform(_,m);if(i.isA(m))return i.transform(_,m);return m});return p.length===1?p[0]:p},c=(d,...u)=>a([d,1,1],u),l=(d,...u)=>a([1,d,1],u),h=(d,...u)=>a([1,1,d],u);t.exports={scale:a,scaleX:c,scaleY:l,scaleZ:h}}}),tFi=At({"node_modules/@jscad/modeling/src/operations/transforms/transform.js"(e,t){var n=Rs(),o=la(),r=Js(),i=hd(),s=(a,...c)=>{if(c=n(c),c.length===0)throw Error("wrong number of arguments");let l=c.map((h)=>{if(i.isA(h))return i.transform(a,h);if(o.isA(h))return o.transform(a,h);if(r.isA(h))return r.transform(a,h);return h});return l.length===1?l[0]:l};t.exports=s}}),uU=At({"node_modules/@jscad/modeling/src/operations/transforms/index.js"(e,t){t.exports={align:eFi(),center:SMe().center,centerX:SMe().centerX,centerY:SMe().centerY,centerZ:SMe().centerZ,mirror:bpe().mirror,mirrorX:bpe().mirrorX,mirrorY:bpe().mirrorY,mirrorZ:bpe().mirrorZ,rotate:Ipe().rotate,rotateX:Ipe().rotateX,rotateY:Ipe().rotateY,rotateZ:Ipe().rotateZ,scale:PMe().scale,scaleX:PMe().scaleX,scaleY:PMe().scaleY,scaleZ:PMe().scaleZ,transform:tFi(),translate:nU().translate,translateX:nU().translateX,translateY:nU().translateY,translateZ:nU().translateZ}}}),Hwe=At({"node_modules/@jscad/modeling/src/index.js"(e,t){t.exports={colors:Dwe(),curves:$ki(),geometries:dpt(),maths:CLi(),measurements:Oqn(),primitives:dU(),text:sHi(),utils:nJn(),booleans:Wpe(),expansions:cJn(),extrusions:Xpe(),hulls:UHi(),minkowski:WHi(),modifiers:JHi(),transforms:uU()}}}),dJn={};qv(dJn,{ANGLE_ORDER:()=>Bpt,ARRAY_TYPE:()=>rc,EPSILON:()=>ci,RANDOM:()=>X6,equals:()=>iFi,round:()=>gE,setMatrixArrayType:()=>nFi,toDegree:()=>rFi,toRadian:()=>oFi});function gE(e){if(e>=0)return Math.round(e);return e%0.5===0?Math.floor(e):Math.round(e)}function nFi(e){rc=e}function oFi(e){return e*uJn}function rFi(e){return e*pJn}function iFi(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ci;return Math.abs(e-t)<=n*Math.max(1,Math.abs(e),Math.abs(t))}var ci,rc,X6,Bpt,uJn,pJn,vE=$v({"node_modules/gl-matrix/esm/common.js"(){ci=0.000001,rc=typeof Float32Array<"u"?Float32Array:Array,X6=Math.random,Bpt="zyx",uJn=Math.PI/180,pJn=180/Math.PI}}),mJn={};qv(mJn,{LDU:()=>bFi,add:()=>IFi,adjoint:()=>mFi,clone:()=>aFi,copy:()=>cFi,create:()=>sFi,determinant:()=>_Fi,equals:()=>SFi,exactEquals:()=>vFi,frob:()=>CFi,fromRotation:()=>fFi,fromScaling:()=>yFi,fromValues:()=>hFi,identity:()=>lFi,invert:()=>pFi,mul:()=>AJn,multiply:()=>_Jn,multiplyScalar:()=>PFi,multiplyScalarAndAdd:()=>EFi,rotate:()=>gFi,scale:()=>AFi,set:()=>dFi,str:()=>xFi,sub:()=>fJn,subtract:()=>gJn,transpose:()=>uFi});function sFi(){var e=new rc(4);if(rc!=Float32Array)e[1]=0,e[2]=0;return e[0]=1,e[3]=1,e}function aFi(e){var t=new rc(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function cFi(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function lFi(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e}function hFi(e,t,n,o){var r=new rc(4);return r[0]=e,r[1]=t,r[2]=n,r[3]=o,r}function dFi(e,t,n,o,r){return e[0]=t,e[1]=n,e[2]=o,e[3]=r,e}function uFi(e,t){if(e===t){var n=t[1];e[1]=t[2],e[2]=n}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e}function pFi(e,t){var n=t[0],o=t[1],r=t[2],i=t[3],s=n*i-r*o;if(!s)return null;return s=1/s,e[0]=i*s,e[1]=-o*s,e[2]=-r*s,e[3]=n*s,e}function mFi(e,t){var n=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=n,e}function _Fi(e){return e[0]*e[3]-e[2]*e[1]}function _Jn(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=n[0],c=n[1],l=n[2],h=n[3];return e[0]=o*a+i*c,e[1]=r*a+s*c,e[2]=o*l+i*h,e[3]=r*l+s*h,e}function gFi(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=Math.sin(n),c=Math.cos(n);return e[0]=o*c+i*a,e[1]=r*c+s*a,e[2]=o*-a+i*c,e[3]=r*-a+s*c,e}function AFi(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=n[0],c=n[1];return e[0]=o*a,e[1]=r*a,e[2]=i*c,e[3]=s*c,e}function fFi(e,t){var n=Math.sin(t),o=Math.cos(t);return e[0]=o,e[1]=n,e[2]=-n,e[3]=o,e}function yFi(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e}function xFi(e){return"mat2("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}function CFi(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3])}function bFi(e,t,n,o){return e[2]=o[2]/o[0],n[0]=o[0],n[1]=o[1],n[3]=o[3]-e[2]*n[1],[e,t,n]}function IFi(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}function gJn(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}function vFi(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}function SFi(e,t){var n=e[0],o=e[1],r=e[2],i=e[3],s=t[0],a=t[1],c=t[2],l=t[3];return Math.abs(n-s)<=ci*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(o-a)<=ci*Math.max(1,Math.abs(o),Math.abs(a))&&Math.abs(r-c)<=ci*Math.max(1,Math.abs(r),Math.abs(c))&&Math.abs(i-l)<=ci*Math.max(1,Math.abs(i),Math.abs(l))}function PFi(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}function EFi(e,t,n,o){return e[0]=t[0]+n[0]*o,e[1]=t[1]+n[1]*o,e[2]=t[2]+n[2]*o,e[3]=t[3]+n[3]*o,e}var AJn,fJn,MFi=$v({"node_modules/gl-matrix/esm/mat2.js"(){vE(),AJn=_Jn,fJn=gJn}}),yJn={};qv(yJn,{add:()=>UFi,clone:()=>BFi,copy:()=>TFi,create:()=>wFi,determinant:()=>kFi,equals:()=>KFi,exactEquals:()=>jFi,frob:()=>GFi,fromRotation:()=>zFi,fromScaling:()=>OFi,fromTranslation:()=>VFi,fromValues:()=>NFi,identity:()=>DFi,invert:()=>QFi,mul:()=>bJn,multiply:()=>xJn,multiplyScalar:()=>WFi,multiplyScalarAndAdd:()=>XFi,rotate:()=>LFi,scale:()=>HFi,set:()=>RFi,str:()=>YFi,sub:()=>IJn,subtract:()=>CJn,translate:()=>FFi});function wFi(){var e=new rc(6);if(rc!=Float32Array)e[1]=0,e[2]=0,e[4]=0,e[5]=0;return e[0]=1,e[3]=1,e}function BFi(e){var t=new rc(6);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function TFi(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function DFi(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}function NFi(e,t,n,o,r,i){var s=new rc(6);return s[0]=e,s[1]=t,s[2]=n,s[3]=o,s[4]=r,s[5]=i,s}function RFi(e,t,n,o,r,i,s){return e[0]=t,e[1]=n,e[2]=o,e[3]=r,e[4]=i,e[5]=s,e}function QFi(e,t){var n=t[0],o=t[1],r=t[2],i=t[3],s=t[4],a=t[5],c=n*i-o*r;if(!c)return null;return c=1/c,e[0]=i*c,e[1]=-o*c,e[2]=-r*c,e[3]=n*c,e[4]=(r*a-i*s)*c,e[5]=(o*s-n*a)*c,e}function kFi(e){return e[0]*e[3]-e[1]*e[2]}function xJn(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=t[4],c=t[5],l=n[0],h=n[1],d=n[2],u=n[3],_=n[4],p=n[5];return e[0]=o*l+i*h,e[1]=r*l+s*h,e[2]=o*d+i*u,e[3]=r*d+s*u,e[4]=o*_+i*p+a,e[5]=r*_+s*p+c,e}function LFi(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=t[4],c=t[5],l=Math.sin(n),h=Math.cos(n);return e[0]=o*h+i*l,e[1]=r*h+s*l,e[2]=o*-l+i*h,e[3]=r*-l+s*h,e[4]=a,e[5]=c,e}function HFi(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=t[4],c=t[5],l=n[0],h=n[1];return e[0]=o*l,e[1]=r*l,e[2]=i*h,e[3]=s*h,e[4]=a,e[5]=c,e}function FFi(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=t[4],c=t[5],l=n[0],h=n[1];return e[0]=o,e[1]=r,e[2]=i,e[3]=s,e[4]=o*l+i*h+a,e[5]=r*l+s*h+c,e}function zFi(e,t){var n=Math.sin(t),o=Math.cos(t);return e[0]=o,e[1]=n,e[2]=-n,e[3]=o,e[4]=0,e[5]=0,e}function OFi(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e[4]=0,e[5]=0,e}function VFi(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0],e[5]=t[1],e}function YFi(e){return"mat2d("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+")"}function GFi(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+1)}function UFi(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e}function CJn(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e}function WFi(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e}function XFi(e,t,n,o){return e[0]=t[0]+n[0]*o,e[1]=t[1]+n[1]*o,e[2]=t[2]+n[2]*o,e[3]=t[3]+n[3]*o,e[4]=t[4]+n[4]*o,e[5]=t[5]+n[5]*o,e}function jFi(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]}function KFi(e,t){var n=e[0],o=e[1],r=e[2],i=e[3],s=e[4],a=e[5],c=t[0],l=t[1],h=t[2],d=t[3],u=t[4],_=t[5];return Math.abs(n-c)<=ci*Math.max(1,Math.abs(n),Math.abs(c))&&Math.abs(o-l)<=ci*Math.max(1,Math.abs(o),Math.abs(l))&&Math.abs(r-h)<=ci*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(i-d)<=ci*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(s-u)<=ci*Math.max(1,Math.abs(s),Math.abs(u))&&Math.abs(a-_)<=ci*Math.max(1,Math.abs(a),Math.abs(_))}var bJn,IJn,$Fi=$v({"node_modules/gl-matrix/esm/mat2d.js"(){vE(),bJn=xJn,IJn=CJn}}),vJn={};qv(vJn,{add:()=>yzi,adjoint:()=>izi,clone:()=>JFi,copy:()=>ZFi,create:()=>SJn,determinant:()=>szi,equals:()=>Izi,exactEquals:()=>bzi,frob:()=>fzi,fromMat2d:()=>pzi,fromMat4:()=>qFi,fromQuat:()=>mzi,fromRotation:()=>dzi,fromScaling:()=>uzi,fromTranslation:()=>hzi,fromValues:()=>ezi,identity:()=>nzi,invert:()=>rzi,mul:()=>MJn,multiply:()=>PJn,multiplyScalar:()=>xzi,multiplyScalarAndAdd:()=>Czi,normalFromMat4:()=>_zi,projection:()=>gzi,rotate:()=>czi,scale:()=>lzi,set:()=>tzi,str:()=>Azi,sub:()=>wJn,subtract:()=>EJn,translate:()=>azi,transpose:()=>ozi});function SJn(){var e=new rc(9);if(rc!=Float32Array)e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0;return e[0]=1,e[4]=1,e[8]=1,e}function qFi(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}function JFi(e){var t=new rc(9);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function ZFi(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function ezi(e,t,n,o,r,i,s,a,c){var l=new rc(9);return l[0]=e,l[1]=t,l[2]=n,l[3]=o,l[4]=r,l[5]=i,l[6]=s,l[7]=a,l[8]=c,l}function tzi(e,t,n,o,r,i,s,a,c,l){return e[0]=t,e[1]=n,e[2]=o,e[3]=r,e[4]=i,e[5]=s,e[6]=a,e[7]=c,e[8]=l,e}function nzi(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function ozi(e,t){if(e===t){var n=t[1],o=t[2],r=t[5];e[1]=t[3],e[2]=t[6],e[3]=n,e[5]=t[7],e[6]=o,e[7]=r}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}function rzi(e,t){var n=t[0],o=t[1],r=t[2],i=t[3],s=t[4],a=t[5],c=t[6],l=t[7],h=t[8],d=h*s-a*l,u=-h*i+a*c,_=l*i-s*c,p=n*d+o*u+r*_;if(!p)return null;return p=1/p,e[0]=d*p,e[1]=(-h*o+r*l)*p,e[2]=(a*o-r*s)*p,e[3]=u*p,e[4]=(h*n-r*c)*p,e[5]=(-a*n+r*i)*p,e[6]=_*p,e[7]=(-l*n+o*c)*p,e[8]=(s*n-o*i)*p,e}function izi(e,t){var n=t[0],o=t[1],r=t[2],i=t[3],s=t[4],a=t[5],c=t[6],l=t[7],h=t[8];return e[0]=s*h-a*l,e[1]=r*l-o*h,e[2]=o*a-r*s,e[3]=a*c-i*h,e[4]=n*h-r*c,e[5]=r*i-n*a,e[6]=i*l-s*c,e[7]=o*c-n*l,e[8]=n*s-o*i,e}function szi(e){var t=e[0],n=e[1],o=e[2],r=e[3],i=e[4],s=e[5],a=e[6],c=e[7],l=e[8];return t*(l*i-s*c)+n*(-l*r+s*a)+o*(c*r-i*a)}function PJn(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=t[4],c=t[5],l=t[6],h=t[7],d=t[8],u=n[0],_=n[1],p=n[2],m=n[3],A=n[4],g=n[5],f=n[6],y=n[7],x=n[8];return e[0]=u*o+_*s+p*l,e[1]=u*r+_*a+p*h,e[2]=u*i+_*c+p*d,e[3]=m*o+A*s+g*l,e[4]=m*r+A*a+g*h,e[5]=m*i+A*c+g*d,e[6]=f*o+y*s+x*l,e[7]=f*r+y*a+x*h,e[8]=f*i+y*c+x*d,e}function azi(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=t[4],c=t[5],l=t[6],h=t[7],d=t[8],u=n[0],_=n[1];return e[0]=o,e[1]=r,e[2]=i,e[3]=s,e[4]=a,e[5]=c,e[6]=u*o+_*s+l,e[7]=u*r+_*a+h,e[8]=u*i+_*c+d,e}function czi(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=t[4],c=t[5],l=t[6],h=t[7],d=t[8],u=Math.sin(n),_=Math.cos(n);return e[0]=_*o+u*s,e[1]=_*r+u*a,e[2]=_*i+u*c,e[3]=_*s-u*o,e[4]=_*a-u*r,e[5]=_*c-u*i,e[6]=l,e[7]=h,e[8]=d,e}function lzi(e,t,n){var o=n[0],r=n[1];return e[0]=o*t[0],e[1]=o*t[1],e[2]=o*t[2],e[3]=r*t[3],e[4]=r*t[4],e[5]=r*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function hzi(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e}function dzi(e,t){var n=Math.sin(t),o=Math.cos(t);return e[0]=o,e[1]=n,e[2]=0,e[3]=-n,e[4]=o,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function uzi(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function pzi(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e}function mzi(e,t){var n=t[0],o=t[1],r=t[2],i=t[3],s=n+n,a=o+o,c=r+r,l=n*s,h=o*s,d=o*a,u=r*s,_=r*a,p=r*c,m=i*s,A=i*a,g=i*c;return e[0]=1-d-p,e[3]=h-g,e[6]=u+A,e[1]=h+g,e[4]=1-l-p,e[7]=_-m,e[2]=u-A,e[5]=_+m,e[8]=1-l-d,e}function _zi(e,t){var n=t[0],o=t[1],r=t[2],i=t[3],s=t[4],a=t[5],c=t[6],l=t[7],h=t[8],d=t[9],u=t[10],_=t[11],p=t[12],m=t[13],A=t[14],g=t[15],f=n*a-o*s,y=n*c-r*s,x=n*l-i*s,C=o*c-r*a,b=o*l-i*a,I=r*l-i*c,v=h*m-d*p,P=h*A-u*p,M=h*g-_*p,B=d*A-u*m,T=d*g-_*m,N=u*g-_*A,D=f*N-y*T+x*B+C*M-b*P+I*v;if(!D)return null;return D=1/D,e[0]=(a*N-c*T+l*B)*D,e[1]=(c*M-s*N-l*P)*D,e[2]=(s*T-a*M+l*v)*D,e[3]=(r*T-o*N-i*B)*D,e[4]=(n*N-r*M+i*P)*D,e[5]=(o*M-n*T-i*v)*D,e[6]=(m*I-A*b+g*C)*D,e[7]=(A*x-p*I-g*y)*D,e[8]=(p*b-m*x+g*f)*D,e}function gzi(e,t,n){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/n,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}function Azi(e){return"mat3("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+")"}function fzi(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8])}function yzi(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e}function EJn(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e}function xzi(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e}function Czi(e,t,n,o){return e[0]=t[0]+n[0]*o,e[1]=t[1]+n[1]*o,e[2]=t[2]+n[2]*o,e[3]=t[3]+n[3]*o,e[4]=t[4]+n[4]*o,e[5]=t[5]+n[5]*o,e[6]=t[6]+n[6]*o,e[7]=t[7]+n[7]*o,e[8]=t[8]+n[8]*o,e}function bzi(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]}function Izi(e,t){var n=e[0],o=e[1],r=e[2],i=e[3],s=e[4],a=e[5],c=e[6],l=e[7],h=e[8],d=t[0],u=t[1],_=t[2],p=t[3],m=t[4],A=t[5],g=t[6],f=t[7],y=t[8];return Math.abs(n-d)<=ci*Math.max(1,Math.abs(n),Math.abs(d))&&Math.abs(o-u)<=ci*Math.max(1,Math.abs(o),Math.abs(u))&&Math.abs(r-_)<=ci*Math.max(1,Math.abs(r),Math.abs(_))&&Math.abs(i-p)<=ci*Math.max(1,Math.abs(i),Math.abs(p))&&Math.abs(s-m)<=ci*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(a-A)<=ci*Math.max(1,Math.abs(a),Math.abs(A))&&Math.abs(c-g)<=ci*Math.max(1,Math.abs(c),Math.abs(g))&&Math.abs(l-f)<=ci*Math.max(1,Math.abs(l),Math.abs(f))&&Math.abs(h-y)<=ci*Math.max(1,Math.abs(h),Math.abs(y))}var MJn,wJn,BJn=$v({"node_modules/gl-matrix/esm/mat3.js"(){vE(),MJn=PJn,wJn=EJn}}),TJn={};qv(TJn,{add:()=>rOi,adjoint:()=>Tzi,clone:()=>Szi,copy:()=>Pzi,create:()=>vzi,decompose:()=>Wzi,determinant:()=>Dzi,equals:()=>cOi,exactEquals:()=>aOi,frob:()=>oOi,fromQuat:()=>Kzi,fromQuat2:()=>Uzi,fromRotation:()=>Ozi,fromRotationTranslation:()=>RJn,fromRotationTranslationScale:()=>Xzi,fromRotationTranslationScaleOrigin:()=>jzi,fromScaling:()=>zzi,fromTranslation:()=>Fzi,fromValues:()=>Ezi,fromXRotation:()=>Vzi,fromYRotation:()=>Yzi,fromZRotation:()=>Gzi,frustum:()=>$zi,getRotation:()=>LJn,getScaling:()=>kJn,getTranslation:()=>QJn,identity:()=>DJn,invert:()=>Bzi,lookAt:()=>eOi,mul:()=>YJn,multiply:()=>NJn,multiplyScalar:()=>iOi,multiplyScalarAndAdd:()=>sOi,ortho:()=>VJn,orthoNO:()=>FJn,orthoZO:()=>Zzi,perspective:()=>OJn,perspectiveFromFieldOfView:()=>Jzi,perspectiveNO:()=>HJn,perspectiveZO:()=>qzi,rotate:()=>Qzi,rotateX:()=>kzi,rotateY:()=>Lzi,rotateZ:()=>Hzi,scale:()=>Rzi,set:()=>Mzi,str:()=>nOi,sub:()=>GJn,subtract:()=>zJn,targetTo:()=>tOi,translate:()=>Nzi,transpose:()=>wzi});function vzi(){var e=new rc(16);if(rc!=Float32Array)e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0;return e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function Szi(e){var t=new rc(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Pzi(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function Ezi(e,t,n,o,r,i,s,a,c,l,h,d,u,_,p,m){var A=new rc(16);return A[0]=e,A[1]=t,A[2]=n,A[3]=o,A[4]=r,A[5]=i,A[6]=s,A[7]=a,A[8]=c,A[9]=l,A[10]=h,A[11]=d,A[12]=u,A[13]=_,A[14]=p,A[15]=m,A}function Mzi(e,t,n,o,r,i,s,a,c,l,h,d,u,_,p,m,A){return e[0]=t,e[1]=n,e[2]=o,e[3]=r,e[4]=i,e[5]=s,e[6]=a,e[7]=c,e[8]=l,e[9]=h,e[10]=d,e[11]=u,e[12]=_,e[13]=p,e[14]=m,e[15]=A,e}function DJn(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function wzi(e,t){if(e===t){var n=t[1],o=t[2],r=t[3],i=t[6],s=t[7],a=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=o,e[9]=i,e[11]=t[14],e[12]=r,e[13]=s,e[14]=a}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}function Bzi(e,t){var n=t[0],o=t[1],r=t[2],i=t[3],s=t[4],a=t[5],c=t[6],l=t[7],h=t[8],d=t[9],u=t[10],_=t[11],p=t[12],m=t[13],A=t[14],g=t[15],f=n*a-o*s,y=n*c-r*s,x=n*l-i*s,C=o*c-r*a,b=o*l-i*a,I=r*l-i*c,v=h*m-d*p,P=h*A-u*p,M=h*g-_*p,B=d*A-u*m,T=d*g-_*m,N=u*g-_*A,D=f*N-y*T+x*B+C*M-b*P+I*v;if(!D)return null;return D=1/D,e[0]=(a*N-c*T+l*B)*D,e[1]=(r*T-o*N-i*B)*D,e[2]=(m*I-A*b+g*C)*D,e[3]=(u*b-d*I-_*C)*D,e[4]=(c*M-s*N-l*P)*D,e[5]=(n*N-r*M+i*P)*D,e[6]=(A*x-p*I-g*y)*D,e[7]=(h*I-u*x+_*y)*D,e[8]=(s*T-a*M+l*v)*D,e[9]=(o*M-n*T-i*v)*D,e[10]=(p*b-m*x+g*f)*D,e[11]=(d*x-h*b-_*f)*D,e[12]=(a*P-s*B-c*v)*D,e[13]=(n*B-o*P+r*v)*D,e[14]=(m*y-p*C-A*f)*D,e[15]=(h*C-d*y+u*f)*D,e}function Tzi(e,t){var n=t[0],o=t[1],r=t[2],i=t[3],s=t[4],a=t[5],c=t[6],l=t[7],h=t[8],d=t[9],u=t[10],_=t[11],p=t[12],m=t[13],A=t[14],g=t[15],f=n*a-o*s,y=n*c-r*s,x=n*l-i*s,C=o*c-r*a,b=o*l-i*a,I=r*l-i*c,v=h*m-d*p,P=h*A-u*p,M=h*g-_*p,B=d*A-u*m,T=d*g-_*m,N=u*g-_*A;return e[0]=a*N-c*T+l*B,e[1]=r*T-o*N-i*B,e[2]=m*I-A*b+g*C,e[3]=u*b-d*I-_*C,e[4]=c*M-s*N-l*P,e[5]=n*N-r*M+i*P,e[6]=A*x-p*I-g*y,e[7]=h*I-u*x+_*y,e[8]=s*T-a*M+l*v,e[9]=o*M-n*T-i*v,e[10]=p*b-m*x+g*f,e[11]=d*x-h*b-_*f,e[12]=a*P-s*B-c*v,e[13]=n*B-o*P+r*v,e[14]=m*y-p*C-A*f,e[15]=h*C-d*y+u*f,e}function Dzi(e){var t=e[0],n=e[1],o=e[2],r=e[3],i=e[4],s=e[5],a=e[6],c=e[7],l=e[8],h=e[9],d=e[10],u=e[11],_=e[12],p=e[13],m=e[14],A=e[15],g=t*s-n*i,f=t*a-o*i,y=n*a-o*s,x=l*p-h*_,C=l*m-d*_,b=h*m-d*p,I=t*b-n*C+o*x,v=i*b-s*C+a*x,P=l*y-h*f+d*g,M=_*y-p*f+m*g;return c*I-r*v+A*P-u*M}function NJn(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=t[4],c=t[5],l=t[6],h=t[7],d=t[8],u=t[9],_=t[10],p=t[11],m=t[12],A=t[13],g=t[14],f=t[15],y=n[0],x=n[1],C=n[2],b=n[3];return e[0]=y*o+x*a+C*d+b*m,e[1]=y*r+x*c+C*u+b*A,e[2]=y*i+x*l+C*_+b*g,e[3]=y*s+x*h+C*p+b*f,y=n[4],x=n[5],C=n[6],b=n[7],e[4]=y*o+x*a+C*d+b*m,e[5]=y*r+x*c+C*u+b*A,e[6]=y*i+x*l+C*_+b*g,e[7]=y*s+x*h+C*p+b*f,y=n[8],x=n[9],C=n[10],b=n[11],e[8]=y*o+x*a+C*d+b*m,e[9]=y*r+x*c+C*u+b*A,e[10]=y*i+x*l+C*_+b*g,e[11]=y*s+x*h+C*p+b*f,y=n[12],x=n[13],C=n[14],b=n[15],e[12]=y*o+x*a+C*d+b*m,e[13]=y*r+x*c+C*u+b*A,e[14]=y*i+x*l+C*_+b*g,e[15]=y*s+x*h+C*p+b*f,e}function Nzi(e,t,n){var o=n[0],r=n[1],i=n[2],s,a,c,l,h,d,u,_,p,m,A,g;if(t===e)e[12]=t[0]*o+t[4]*r+t[8]*i+t[12],e[13]=t[1]*o+t[5]*r+t[9]*i+t[13],e[14]=t[2]*o+t[6]*r+t[10]*i+t[14],e[15]=t[3]*o+t[7]*r+t[11]*i+t[15];else s=t[0],a=t[1],c=t[2],l=t[3],h=t[4],d=t[5],u=t[6],_=t[7],p=t[8],m=t[9],A=t[10],g=t[11],e[0]=s,e[1]=a,e[2]=c,e[3]=l,e[4]=h,e[5]=d,e[6]=u,e[7]=_,e[8]=p,e[9]=m,e[10]=A,e[11]=g,e[12]=s*o+h*r+p*i+t[12],e[13]=a*o+d*r+m*i+t[13],e[14]=c*o+u*r+A*i+t[14],e[15]=l*o+_*r+g*i+t[15];return e}function Rzi(e,t,n){var o=n[0],r=n[1],i=n[2];return e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e[3]=t[3]*o,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*i,e[9]=t[9]*i,e[10]=t[10]*i,e[11]=t[11]*i,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function Qzi(e,t,n,o){var r=o[0],i=o[1],s=o[2],a=Math.sqrt(r*r+i*i+s*s),c,l,h,d,u,_,p,m,A,g,f,y,x,C,b,I,v,P,M,B,T,N,D,L;if(a<ci)return null;if(a=1/a,r*=a,i*=a,s*=a,c=Math.sin(n),l=Math.cos(n),h=1-l,d=t[0],u=t[1],_=t[2],p=t[3],m=t[4],A=t[5],g=t[6],f=t[7],y=t[8],x=t[9],C=t[10],b=t[11],I=r*r*h+l,v=i*r*h+s*c,P=s*r*h-i*c,M=r*i*h-s*c,B=i*i*h+l,T=s*i*h+r*c,N=r*s*h+i*c,D=i*s*h-r*c,L=s*s*h+l,e[0]=d*I+m*v+y*P,e[1]=u*I+A*v+x*P,e[2]=_*I+g*v+C*P,e[3]=p*I+f*v+b*P,e[4]=d*M+m*B+y*T,e[5]=u*M+A*B+x*T,e[6]=_*M+g*B+C*T,e[7]=p*M+f*B+b*T,e[8]=d*N+m*D+y*L,e[9]=u*N+A*D+x*L,e[10]=_*N+g*D+C*L,e[11]=p*N+f*D+b*L,t!==e)e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15];return e}function kzi(e,t,n){var o=Math.sin(n),r=Math.cos(n),i=t[4],s=t[5],a=t[6],c=t[7],l=t[8],h=t[9],d=t[10],u=t[11];if(t!==e)e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15];return e[4]=i*r+l*o,e[5]=s*r+h*o,e[6]=a*r+d*o,e[7]=c*r+u*o,e[8]=l*r-i*o,e[9]=h*r-s*o,e[10]=d*r-a*o,e[11]=u*r-c*o,e}function Lzi(e,t,n){var o=Math.sin(n),r=Math.cos(n),i=t[0],s=t[1],a=t[2],c=t[3],l=t[8],h=t[9],d=t[10],u=t[11];if(t!==e)e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15];return e[0]=i*r-l*o,e[1]=s*r-h*o,e[2]=a*r-d*o,e[3]=c*r-u*o,e[8]=i*o+l*r,e[9]=s*o+h*r,e[10]=a*o+d*r,e[11]=c*o+u*r,e}function Hzi(e,t,n){var o=Math.sin(n),r=Math.cos(n),i=t[0],s=t[1],a=t[2],c=t[3],l=t[4],h=t[5],d=t[6],u=t[7];if(t!==e)e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15];return e[0]=i*r+l*o,e[1]=s*r+h*o,e[2]=a*r+d*o,e[3]=c*r+u*o,e[4]=l*r-i*o,e[5]=h*r-s*o,e[6]=d*r-a*o,e[7]=u*r-c*o,e}function Fzi(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}function zzi(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Ozi(e,t,n){var o=n[0],r=n[1],i=n[2],s=Math.sqrt(o*o+r*r+i*i),a,c,l;if(s<ci)return null;return s=1/s,o*=s,r*=s,i*=s,a=Math.sin(t),c=Math.cos(t),l=1-c,e[0]=o*o*l+c,e[1]=r*o*l+i*a,e[2]=i*o*l-r*a,e[3]=0,e[4]=o*r*l-i*a,e[5]=r*r*l+c,e[6]=i*r*l+o*a,e[7]=0,e[8]=o*i*l+r*a,e[9]=r*i*l-o*a,e[10]=i*i*l+c,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Vzi(e,t){var n=Math.sin(t),o=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=n,e[7]=0,e[8]=0,e[9]=-n,e[10]=o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Yzi(e,t){var n=Math.sin(t),o=Math.cos(t);return e[0]=o,e[1]=0,e[2]=-n,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=n,e[9]=0,e[10]=o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Gzi(e,t){var n=Math.sin(t),o=Math.cos(t);return e[0]=o,e[1]=n,e[2]=0,e[3]=0,e[4]=-n,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function RJn(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=o+o,c=r+r,l=i+i,h=o*a,d=o*c,u=o*l,_=r*c,p=r*l,m=i*l,A=s*a,g=s*c,f=s*l;return e[0]=1-(_+m),e[1]=d+f,e[2]=u-g,e[3]=0,e[4]=d-f,e[5]=1-(h+m),e[6]=p+A,e[7]=0,e[8]=u+g,e[9]=p-A,e[10]=1-(h+_),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}function Uzi(e,t){var n=new rc(3),o=-t[0],r=-t[1],i=-t[2],s=t[3],a=t[4],c=t[5],l=t[6],h=t[7],d=o*o+r*r+i*i+s*s;if(d>0)n[0]=(a*s+h*o+c*i-l*r)*2/d,n[1]=(c*s+h*r+l*o-a*i)*2/d,n[2]=(l*s+h*i+a*r-c*o)*2/d;else n[0]=(a*s+h*o+c*i-l*r)*2,n[1]=(c*s+h*r+l*o-a*i)*2,n[2]=(l*s+h*i+a*r-c*o)*2;return RJn(e,t,n),e}function QJn(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function kJn(e,t){var n=t[0],o=t[1],r=t[2],i=t[4],s=t[5],a=t[6],c=t[8],l=t[9],h=t[10];return e[0]=Math.sqrt(n*n+o*o+r*r),e[1]=Math.sqrt(i*i+s*s+a*a),e[2]=Math.sqrt(c*c+l*l+h*h),e}function LJn(e,t){var n=new rc(3);kJn(n,t);var o=1/n[0],r=1/n[1],i=1/n[2],s=t[0]*o,a=t[1]*r,c=t[2]*i,l=t[4]*o,h=t[5]*r,d=t[6]*i,u=t[8]*o,_=t[9]*r,p=t[10]*i,m=s+h+p,A=0;if(m>0)A=Math.sqrt(m+1)*2,e[3]=0.25*A,e[0]=(d-_)/A,e[1]=(u-c)/A,e[2]=(a-l)/A;else if(s>h&&s>p)A=Math.sqrt(1+s-h-p)*2,e[3]=(d-_)/A,e[0]=0.25*A,e[1]=(a+l)/A,e[2]=(u+c)/A;else if(h>p)A=Math.sqrt(1+h-s-p)*2,e[3]=(u-c)/A,e[0]=(a+l)/A,e[1]=0.25*A,e[2]=(d+_)/A;else A=Math.sqrt(1+p-s-h)*2,e[3]=(a-l)/A,e[0]=(u+c)/A,e[1]=(d+_)/A,e[2]=0.25*A;return e}function Wzi(e,t,n,o){t[0]=o[12],t[1]=o[13],t[2]=o[14];var r=o[0],i=o[1],s=o[2],a=o[4],c=o[5],l=o[6],h=o[8],d=o[9],u=o[10];n[0]=Math.sqrt(r*r+i*i+s*s),n[1]=Math.sqrt(a*a+c*c+l*l),n[2]=Math.sqrt(h*h+d*d+u*u);var _=1/n[0],p=1/n[1],m=1/n[2],A=r*_,g=i*p,f=s*m,y=a*_,x=c*p,C=l*m,b=h*_,I=d*p,v=u*m,P=A+x+v,M=0;if(P>0)M=Math.sqrt(P+1)*2,e[3]=0.25*M,e[0]=(C-I)/M,e[1]=(b-f)/M,e[2]=(g-y)/M;else if(A>x&&A>v)M=Math.sqrt(1+A-x-v)*2,e[3]=(C-I)/M,e[0]=0.25*M,e[1]=(g+y)/M,e[2]=(b+f)/M;else if(x>v)M=Math.sqrt(1+x-A-v)*2,e[3]=(b-f)/M,e[0]=(g+y)/M,e[1]=0.25*M,e[2]=(C+I)/M;else M=Math.sqrt(1+v-A-x)*2,e[3]=(g-y)/M,e[0]=(b+f)/M,e[1]=(C+I)/M,e[2]=0.25*M;return e}function Xzi(e,t,n,o){var r=t[0],i=t[1],s=t[2],a=t[3],c=r+r,l=i+i,h=s+s,d=r*c,u=r*l,_=r*h,p=i*l,m=i*h,A=s*h,g=a*c,f=a*l,y=a*h,x=o[0],C=o[1],b=o[2];return e[0]=(1-(p+A))*x,e[1]=(u+y)*x,e[2]=(_-f)*x,e[3]=0,e[4]=(u-y)*C,e[5]=(1-(d+A))*C,e[6]=(m+g)*C,e[7]=0,e[8]=(_+f)*b,e[9]=(m-g)*b,e[10]=(1-(d+p))*b,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}function jzi(e,t,n,o,r){var i=t[0],s=t[1],a=t[2],c=t[3],l=i+i,h=s+s,d=a+a,u=i*l,_=i*h,p=i*d,m=s*h,A=s*d,g=a*d,f=c*l,y=c*h,x=c*d,C=o[0],b=o[1],I=o[2],v=r[0],P=r[1],M=r[2],B=(1-(m+g))*C,T=(_+x)*C,N=(p-y)*C,D=(_-x)*b,L=(1-(u+g))*b,H=(A+f)*b,V=(p+y)*I,O=(A-f)*I,U=(1-(u+m))*I;return e[0]=B,e[1]=T,e[2]=N,e[3]=0,e[4]=D,e[5]=L,e[6]=H,e[7]=0,e[8]=V,e[9]=O,e[10]=U,e[11]=0,e[12]=n[0]+v-(B*v+D*P+V*M),e[13]=n[1]+P-(T*v+L*P+O*M),e[14]=n[2]+M-(N*v+H*P+U*M),e[15]=1,e}function Kzi(e,t){var n=t[0],o=t[1],r=t[2],i=t[3],s=n+n,a=o+o,c=r+r,l=n*s,h=o*s,d=o*a,u=r*s,_=r*a,p=r*c,m=i*s,A=i*a,g=i*c;return e[0]=1-d-p,e[1]=h+g,e[2]=u-A,e[3]=0,e[4]=h-g,e[5]=1-l-p,e[6]=_+m,e[7]=0,e[8]=u+A,e[9]=_-m,e[10]=1-l-d,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function $zi(e,t,n,o,r,i,s){var a=1/(n-t),c=1/(r-o),l=1/(i-s);return e[0]=i*2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i*2*c,e[6]=0,e[7]=0,e[8]=(n+t)*a,e[9]=(r+o)*c,e[10]=(s+i)*l,e[11]=-1,e[12]=0,e[13]=0,e[14]=s*i*2*l,e[15]=0,e}function HJn(e,t,n,o,r){var i=1/Math.tan(t/2);if(e[0]=i/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){var s=1/(o-r);e[10]=(r+o)*s,e[14]=2*r*o*s}else e[10]=-1,e[14]=-2*o;return e}function qzi(e,t,n,o,r){var i=1/Math.tan(t/2);if(e[0]=i/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){var s=1/(o-r);e[10]=r*s,e[14]=r*o*s}else e[10]=-1,e[14]=-o;return e}function Jzi(e,t,n,o){var r=Math.tan(t.upDegrees*Math.PI/180),i=Math.tan(t.downDegrees*Math.PI/180),s=Math.tan(t.leftDegrees*Math.PI/180),a=Math.tan(t.rightDegrees*Math.PI/180),c=2/(s+a),l=2/(r+i);return e[0]=c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=l,e[6]=0,e[7]=0,e[8]=-((s-a)*c*0.5),e[9]=(r-i)*l*0.5,e[10]=o/(n-o),e[11]=-1,e[12]=0,e[13]=0,e[14]=o*n/(n-o),e[15]=0,e}function FJn(e,t,n,o,r,i,s){var a=1/(t-n),c=1/(o-r),l=1/(i-s);return e[0]=-2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*c,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*l,e[11]=0,e[12]=(t+n)*a,e[13]=(r+o)*c,e[14]=(s+i)*l,e[15]=1,e}function Zzi(e,t,n,o,r,i,s){var a=1/(t-n),c=1/(o-r),l=1/(i-s);return e[0]=-2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*c,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=l,e[11]=0,e[12]=(t+n)*a,e[13]=(r+o)*c,e[14]=i*l,e[15]=1,e}function eOi(e,t,n,o){var r,i,s,a,c,l,h,d,u,_,p=t[0],m=t[1],A=t[2],g=o[0],f=o[1],y=o[2],x=n[0],C=n[1],b=n[2];if(Math.abs(p-x)<ci&&Math.abs(m-C)<ci&&Math.abs(A-b)<ci)return DJn(e);if(h=p-x,d=m-C,u=A-b,_=1/Math.sqrt(h*h+d*d+u*u),h*=_,d*=_,u*=_,r=f*u-y*d,i=y*h-g*u,s=g*d-f*h,_=Math.sqrt(r*r+i*i+s*s),!_)r=0,i=0,s=0;else _=1/_,r*=_,i*=_,s*=_;if(a=d*s-u*i,c=u*r-h*s,l=h*i-d*r,_=Math.sqrt(a*a+c*c+l*l),!_)a=0,c=0,l=0;else _=1/_,a*=_,c*=_,l*=_;return e[0]=r,e[1]=a,e[2]=h,e[3]=0,e[4]=i,e[5]=c,e[6]=d,e[7]=0,e[8]=s,e[9]=l,e[10]=u,e[11]=0,e[12]=-(r*p+i*m+s*A),e[13]=-(a*p+c*m+l*A),e[14]=-(h*p+d*m+u*A),e[15]=1,e}function tOi(e,t,n,o){var r=t[0],i=t[1],s=t[2],a=o[0],c=o[1],l=o[2],h=r-n[0],d=i-n[1],u=s-n[2],_=h*h+d*d+u*u;if(_>0)_=1/Math.sqrt(_),h*=_,d*=_,u*=_;var p=c*u-l*d,m=l*h-a*u,A=a*d-c*h;if(_=p*p+m*m+A*A,_>0)_=1/Math.sqrt(_),p*=_,m*=_,A*=_;return e[0]=p,e[1]=m,e[2]=A,e[3]=0,e[4]=d*A-u*m,e[5]=u*p-h*A,e[6]=h*m-d*p,e[7]=0,e[8]=h,e[9]=d,e[10]=u,e[11]=0,e[12]=r,e[13]=i,e[14]=s,e[15]=1,e}function nOi(e){return"mat4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+", "+e[9]+", "+e[10]+", "+e[11]+", "+e[12]+", "+e[13]+", "+e[14]+", "+e[15]+")"}function oOi(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8]+e[9]*e[9]+e[10]*e[10]+e[11]*e[11]+e[12]*e[12]+e[13]*e[13]+e[14]*e[14]+e[15]*e[15])}function rOi(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e}function zJn(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e}function iOi(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12]*n,e[13]=t[13]*n,e[14]=t[14]*n,e[15]=t[15]*n,e}function sOi(e,t,n,o){return e[0]=t[0]+n[0]*o,e[1]=t[1]+n[1]*o,e[2]=t[2]+n[2]*o,e[3]=t[3]+n[3]*o,e[4]=t[4]+n[4]*o,e[5]=t[5]+n[5]*o,e[6]=t[6]+n[6]*o,e[7]=t[7]+n[7]*o,e[8]=t[8]+n[8]*o,e[9]=t[9]+n[9]*o,e[10]=t[10]+n[10]*o,e[11]=t[11]+n[11]*o,e[12]=t[12]+n[12]*o,e[13]=t[13]+n[13]*o,e[14]=t[14]+n[14]*o,e[15]=t[15]+n[15]*o,e}function aOi(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}function cOi(e,t){var n=e[0],o=e[1],r=e[2],i=e[3],s=e[4],a=e[5],c=e[6],l=e[7],h=e[8],d=e[9],u=e[10],_=e[11],p=e[12],m=e[13],A=e[14],g=e[15],f=t[0],y=t[1],x=t[2],C=t[3],b=t[4],I=t[5],v=t[6],P=t[7],M=t[8],B=t[9],T=t[10],N=t[11],D=t[12],L=t[13],H=t[14],V=t[15];return Math.abs(n-f)<=ci*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(o-y)<=ci*Math.max(1,Math.abs(o),Math.abs(y))&&Math.abs(r-x)<=ci*Math.max(1,Math.abs(r),Math.abs(x))&&Math.abs(i-C)<=ci*Math.max(1,Math.abs(i),Math.abs(C))&&Math.abs(s-b)<=ci*Math.max(1,Math.abs(s),Math.abs(b))&&Math.abs(a-I)<=ci*Math.max(1,Math.abs(a),Math.abs(I))&&Math.abs(c-v)<=ci*Math.max(1,Math.abs(c),Math.abs(v))&&Math.abs(l-P)<=ci*Math.max(1,Math.abs(l),Math.abs(P))&&Math.abs(h-M)<=ci*Math.max(1,Math.abs(h),Math.abs(M))&&Math.abs(d-B)<=ci*Math.max(1,Math.abs(d),Math.abs(B))&&Math.abs(u-T)<=ci*Math.max(1,Math.abs(u),Math.abs(T))&&Math.abs(_-N)<=ci*Math.max(1,Math.abs(_),Math.abs(N))&&Math.abs(p-D)<=ci*Math.max(1,Math.abs(p),Math.abs(D))&&Math.abs(m-L)<=ci*Math.max(1,Math.abs(m),Math.abs(L))&&Math.abs(A-H)<=ci*Math.max(1,Math.abs(A),Math.abs(H))&&Math.abs(g-V)<=ci*Math.max(1,Math.abs(g),Math.abs(V))}var OJn,VJn,YJn,GJn,UJn=$v({"node_modules/gl-matrix/esm/mat4.js"(){vE(),OJn=HJn,VJn=FJn,YJn=NJn,GJn=zJn}}),WJn={};qv(WJn,{add:()=>uOi,angle:()=>NOi,bezier:()=>SOi,ceil:()=>pOi,clone:()=>lOi,copy:()=>hOi,create:()=>Tpt,cross:()=>UMe,dist:()=>rZn,distance:()=>qJn,div:()=>oZn,divide:()=>$Jn,dot:()=>Fwe,equals:()=>LOi,exactEquals:()=>kOi,floor:()=>mOi,forEach:()=>aZn,fromValues:()=>f0t,hermite:()=>vOi,inverse:()=>COi,len:()=>Dpt,length:()=>XJn,lerp:()=>bOi,max:()=>gOi,min:()=>_Oi,mul:()=>nZn,multiply:()=>KJn,negate:()=>xOi,normalize:()=>eZn,random:()=>POi,rotateX:()=>BOi,rotateY:()=>TOi,rotateZ:()=>DOi,round:()=>AOi,scale:()=>fOi,scaleAndAdd:()=>yOi,set:()=>dOi,slerp:()=>IOi,sqrDist:()=>iZn,sqrLen:()=>sZn,squaredDistance:()=>JJn,squaredLength:()=>ZJn,str:()=>QOi,sub:()=>tZn,subtract:()=>jJn,transformMat3:()=>MOi,transformMat4:()=>EOi,transformQuat:()=>wOi,zero:()=>ROi});function Tpt(){var e=new rc(3);if(rc!=Float32Array)e[0]=0,e[1]=0,e[2]=0;return e}function lOi(e){var t=new rc(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function XJn(e){var t=e[0],n=e[1],o=e[2];return Math.sqrt(t*t+n*n+o*o)}function f0t(e,t,n){var o=new rc(3);return o[0]=e,o[1]=t,o[2]=n,o}function hOi(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function dOi(e,t,n,o){return e[0]=t,e[1]=n,e[2]=o,e}function uOi(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}function jJn(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}function KJn(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}function $Jn(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e}function pOi(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}function mOi(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}function _Oi(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e}function gOi(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e}function AOi(e,t){return e[0]=gE(t[0]),e[1]=gE(t[1]),e[2]=gE(t[2]),e}function fOi(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}function yOi(e,t,n,o){return e[0]=t[0]+n[0]*o,e[1]=t[1]+n[1]*o,e[2]=t[2]+n[2]*o,e}function qJn(e,t){var n=t[0]-e[0],o=t[1]-e[1],r=t[2]-e[2];return Math.sqrt(n*n+o*o+r*r)}function JJn(e,t){var n=t[0]-e[0],o=t[1]-e[1],r=t[2]-e[2];return n*n+o*o+r*r}function ZJn(e){var t=e[0],n=e[1],o=e[2];return t*t+n*n+o*o}function xOi(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function COi(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}function eZn(e,t){var n=t[0],o=t[1],r=t[2],i=n*n+o*o+r*r;if(i>0)i=1/Math.sqrt(i);return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e}function Fwe(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function UMe(e,t,n){var o=t[0],r=t[1],i=t[2],s=n[0],a=n[1],c=n[2];return e[0]=r*c-i*a,e[1]=i*s-o*c,e[2]=o*a-r*s,e}function bOi(e,t,n,o){var r=t[0],i=t[1],s=t[2];return e[0]=r+o*(n[0]-r),e[1]=i+o*(n[1]-i),e[2]=s+o*(n[2]-s),e}function IOi(e,t,n,o){var r=Math.acos(Math.min(Math.max(Fwe(t,n),-1),1)),i=Math.sin(r),s=Math.sin((1-o)*r)/i,a=Math.sin(o*r)/i;return e[0]=s*t[0]+a*n[0],e[1]=s*t[1]+a*n[1],e[2]=s*t[2]+a*n[2],e}function vOi(e,t,n,o,r,i){var s=i*i,a=s*(2*i-3)+1,c=s*(i-2)+i,l=s*(i-1),h=s*(3-2*i);return e[0]=t[0]*a+n[0]*c+o[0]*l+r[0]*h,e[1]=t[1]*a+n[1]*c+o[1]*l+r[1]*h,e[2]=t[2]*a+n[2]*c+o[2]*l+r[2]*h,e}function SOi(e,t,n,o,r,i){var s=1-i,a=s*s,c=i*i,l=a*s,h=3*i*a,d=3*c*s,u=c*i;return e[0]=t[0]*l+n[0]*h+o[0]*d+r[0]*u,e[1]=t[1]*l+n[1]*h+o[1]*d+r[1]*u,e[2]=t[2]*l+n[2]*h+o[2]*d+r[2]*u,e}function POi(e,t){t=t===void 0?1:t;var n=X6()*2*Math.PI,o=X6()*2-1,r=Math.sqrt(1-o*o)*t;return e[0]=Math.cos(n)*r,e[1]=Math.sin(n)*r,e[2]=o*t,e}function EOi(e,t,n){var o=t[0],r=t[1],i=t[2],s=n[3]*o+n[7]*r+n[11]*i+n[15];return s=s||1,e[0]=(n[0]*o+n[4]*r+n[8]*i+n[12])/s,e[1]=(n[1]*o+n[5]*r+n[9]*i+n[13])/s,e[2]=(n[2]*o+n[6]*r+n[10]*i+n[14])/s,e}function MOi(e,t,n){var o=t[0],r=t[1],i=t[2];return e[0]=o*n[0]+r*n[3]+i*n[6],e[1]=o*n[1]+r*n[4]+i*n[7],e[2]=o*n[2]+r*n[5]+i*n[8],e}function wOi(e,t,n){var o=n[0],r=n[1],i=n[2],s=n[3],a=t[0],c=t[1],l=t[2],h=r*l-i*c,d=i*a-o*l,u=o*c-r*a;return h=h+h,d=d+d,u=u+u,e[0]=a+s*h+r*u-i*d,e[1]=c+s*d+i*h-o*u,e[2]=l+s*u+o*d-r*h,e}function BOi(e,t,n,o){var r=[],i=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],i[0]=r[0],i[1]=r[1]*Math.cos(o)-r[2]*Math.sin(o),i[2]=r[1]*Math.sin(o)+r[2]*Math.cos(o),e[0]=i[0]+n[0],e[1]=i[1]+n[1],e[2]=i[2]+n[2],e}function TOi(e,t,n,o){var r=[],i=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],i[0]=r[2]*Math.sin(o)+r[0]*Math.cos(o),i[1]=r[1],i[2]=r[2]*Math.cos(o)-r[0]*Math.sin(o),e[0]=i[0]+n[0],e[1]=i[1]+n[1],e[2]=i[2]+n[2],e}function DOi(e,t,n,o){var r=[],i=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],i[0]=r[0]*Math.cos(o)-r[1]*Math.sin(o),i[1]=r[0]*Math.sin(o)+r[1]*Math.cos(o),i[2]=r[2],e[0]=i[0]+n[0],e[1]=i[1]+n[1],e[2]=i[2]+n[2],e}function NOi(e,t){var n=e[0],o=e[1],r=e[2],i=t[0],s=t[1],a=t[2],c=Math.sqrt((n*n+o*o+r*r)*(i*i+s*s+a*a)),l=c&&Fwe(e,t)/c;return Math.acos(Math.min(Math.max(l,-1),1))}function ROi(e){return e[0]=0,e[1]=0,e[2]=0,e}function QOi(e){return"vec3("+e[0]+", "+e[1]+", "+e[2]+")"}function kOi(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function LOi(e,t){var n=e[0],o=e[1],r=e[2],i=t[0],s=t[1],a=t[2];return Math.abs(n-i)<=ci*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(o-s)<=ci*Math.max(1,Math.abs(o),Math.abs(s))&&Math.abs(r-a)<=ci*Math.max(1,Math.abs(r),Math.abs(a))}var tZn,nZn,oZn,rZn,iZn,Dpt,sZn,aZn,cZn=$v({"node_modules/gl-matrix/esm/vec3.js"(){vE(),tZn=jJn,nZn=KJn,oZn=$Jn,rZn=qJn,iZn=JJn,Dpt=XJn,sZn=ZJn,aZn=function(){var e=Tpt();return function(t,n,o,r,i,s){var a,c;if(!n)n=3;if(!o)o=0;if(r)c=Math.min(r*n+o,t.length);else c=t.length;for(a=o;a<c;a+=n)e[0]=t[a],e[1]=t[a+1],e[2]=t[a+2],i(e,e,s),t[a]=e[0],t[a+1]=e[1],t[a+2]=e[2];return t}}()}}),lZn={};qv(lZn,{add:()=>_Zn,ceil:()=>HOi,clone:()=>dZn,copy:()=>pZn,create:()=>hZn,cross:()=>WOi,dist:()=>MZn,distance:()=>xZn,div:()=>EZn,divide:()=>fZn,dot:()=>Qpt,equals:()=>JOi,exactEquals:()=>vZn,floor:()=>FOi,forEach:()=>DZn,fromValues:()=>uZn,inverse:()=>UOi,len:()=>BZn,length:()=>Npt,lerp:()=>IZn,max:()=>OOi,min:()=>zOi,mul:()=>PZn,multiply:()=>AZn,negate:()=>GOi,normalize:()=>bZn,random:()=>XOi,round:()=>VOi,scale:()=>yZn,scaleAndAdd:()=>YOi,set:()=>mZn,sqrDist:()=>wZn,sqrLen:()=>TZn,squaredDistance:()=>CZn,squaredLength:()=>Rpt,str:()=>qOi,sub:()=>SZn,subtract:()=>gZn,transformMat4:()=>jOi,transformQuat:()=>KOi,zero:()=>$Oi});function hZn(){var e=new rc(4);if(rc!=Float32Array)e[0]=0,e[1]=0,e[2]=0,e[3]=0;return e}function dZn(e){var t=new rc(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function uZn(e,t,n,o){var r=new rc(4);return r[0]=e,r[1]=t,r[2]=n,r[3]=o,r}function pZn(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function mZn(e,t,n,o,r){return e[0]=t,e[1]=n,e[2]=o,e[3]=r,e}function _Zn(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}function gZn(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}function AZn(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e}function fZn(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e[3]=t[3]/n[3],e}function HOi(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e}function FOi(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e}function zOi(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e[3]=Math.min(t[3],n[3]),e}function OOi(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e[3]=Math.max(t[3],n[3]),e}function VOi(e,t){return e[0]=gE(t[0]),e[1]=gE(t[1]),e[2]=gE(t[2]),e[3]=gE(t[3]),e}function yZn(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}function YOi(e,t,n,o){return e[0]=t[0]+n[0]*o,e[1]=t[1]+n[1]*o,e[2]=t[2]+n[2]*o,e[3]=t[3]+n[3]*o,e}function xZn(e,t){var n=t[0]-e[0],o=t[1]-e[1],r=t[2]-e[2],i=t[3]-e[3];return Math.sqrt(n*n+o*o+r*r+i*i)}function CZn(e,t){var n=t[0]-e[0],o=t[1]-e[1],r=t[2]-e[2],i=t[3]-e[3];return n*n+o*o+r*r+i*i}function Npt(e){var t=e[0],n=e[1],o=e[2],r=e[3];return Math.sqrt(t*t+n*n+o*o+r*r)}function Rpt(e){var t=e[0],n=e[1],o=e[2],r=e[3];return t*t+n*n+o*o+r*r}function GOi(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e}function UOi(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}function bZn(e,t){var n=t[0],o=t[1],r=t[2],i=t[3],s=n*n+o*o+r*r+i*i;if(s>0)s=1/Math.sqrt(s);return e[0]=n*s,e[1]=o*s,e[2]=r*s,e[3]=i*s,e}function Qpt(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function WOi(e,t,n,o){var r=n[0]*o[1]-n[1]*o[0],i=n[0]*o[2]-n[2]*o[0],s=n[0]*o[3]-n[3]*o[0],a=n[1]*o[2]-n[2]*o[1],c=n[1]*o[3]-n[3]*o[1],l=n[2]*o[3]-n[3]*o[2],h=t[0],d=t[1],u=t[2],_=t[3];return e[0]=d*l-u*c+_*a,e[1]=-(h*l)+u*s-_*i,e[2]=h*c-d*s+_*r,e[3]=-(h*a)+d*i-u*r,e}function IZn(e,t,n,o){var r=t[0],i=t[1],s=t[2],a=t[3];return e[0]=r+o*(n[0]-r),e[1]=i+o*(n[1]-i),e[2]=s+o*(n[2]-s),e[3]=a+o*(n[3]-a),e}function XOi(e,t){t=t===void 0?1:t;var n,o,r,i,s,a,c;c=X6(),n=c*2-1,o=(4*X6()-2)*Math.sqrt(c*-c+c),s=n*n+o*o,c=X6(),r=c*2-1,i=(4*X6()-2)*Math.sqrt(c*-c+c),a=r*r+i*i;var l=Math.sqrt((1-s)/a);return e[0]=t*n,e[1]=t*o,e[2]=t*r*l,e[3]=t*i*l,e}function jOi(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3];return e[0]=n[0]*o+n[4]*r+n[8]*i+n[12]*s,e[1]=n[1]*o+n[5]*r+n[9]*i+n[13]*s,e[2]=n[2]*o+n[6]*r+n[10]*i+n[14]*s,e[3]=n[3]*o+n[7]*r+n[11]*i+n[15]*s,e}function KOi(e,t,n){var o=n[0],r=n[1],i=n[2],s=n[3],a=t[0],c=t[1],l=t[2],h=r*l-i*c,d=i*a-o*l,u=o*c-r*a;return h=h+h,d=d+d,u=u+u,e[0]=a+s*h+r*u-i*d,e[1]=c+s*d+i*h-o*u,e[2]=l+s*u+o*d-r*h,e[3]=t[3],e}function $Oi(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}function qOi(e){return"vec4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}function vZn(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}function JOi(e,t){var n=e[0],o=e[1],r=e[2],i=e[3],s=t[0],a=t[1],c=t[2],l=t[3];return Math.abs(n-s)<=ci*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(o-a)<=ci*Math.max(1,Math.abs(o),Math.abs(a))&&Math.abs(r-c)<=ci*Math.max(1,Math.abs(r),Math.abs(c))&&Math.abs(i-l)<=ci*Math.max(1,Math.abs(i),Math.abs(l))}var SZn,PZn,EZn,MZn,wZn,BZn,TZn,DZn,NZn=$v({"node_modules/gl-matrix/esm/vec4.js"(){vE(),SZn=gZn,PZn=AZn,EZn=fZn,MZn=xZn,wZn=CZn,BZn=Npt,TZn=Rpt,DZn=function(){var e=hZn();return function(t,n,o,r,i,s){var a,c;if(!n)n=4;if(!o)o=0;if(r)c=Math.min(r*n+o,t.length);else c=t.length;for(a=o;a<c;a+=n)e[0]=t[a],e[1]=t[a+1],e[2]=t[a+2],e[3]=t[a+3],i(e,e,s),t[a]=e[0],t[a+1]=e[1],t[a+2]=e[2],t[a+3]=e[3];return t}}()}}),RZn={};qv(RZn,{add:()=>WZn,calculateW:()=>nVi,clone:()=>YZn,conjugate:()=>sVi,copy:()=>awe,create:()=>swe,dot:()=>zwe,equals:()=>lVi,exactEquals:()=>qZn,exp:()=>zZn,fromEuler:()=>aVi,fromMat3:()=>VZn,fromValues:()=>GZn,getAngle:()=>tVi,getAxisAngle:()=>eVi,identity:()=>ZOi,invert:()=>iVi,len:()=>KZn,length:()=>cwe,lerp:()=>jZn,ln:()=>OZn,mul:()=>XZn,multiply:()=>kZn,normalize:()=>XMe,pow:()=>oVi,random:()=>rVi,rotateX:()=>LZn,rotateY:()=>HZn,rotateZ:()=>FZn,rotationTo:()=>JZn,scale:()=>kpt,set:()=>UZn,setAxes:()=>eeo,setAxisAngle:()=>QZn,slerp:()=>WMe,sqlerp:()=>ZZn,sqrLen:()=>$Zn,squaredLength:()=>lwe,str:()=>cVi});function swe(){var e=new rc(4);if(rc!=Float32Array)e[0]=0,e[1]=0,e[2]=0;return e[3]=1,e}function ZOi(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function QZn(e,t,n){n=n*0.5;var o=Math.sin(n);return e[0]=o*t[0],e[1]=o*t[1],e[2]=o*t[2],e[3]=Math.cos(n),e}function eVi(e,t){var n=Math.acos(t[3])*2,o=Math.sin(n/2);if(o>ci)e[0]=t[0]/o,e[1]=t[1]/o,e[2]=t[2]/o;else e[0]=1,e[1]=0,e[2]=0;return n}function tVi(e,t){var n=zwe(e,t);return Math.acos(2*n*n-1)}function kZn(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=n[0],c=n[1],l=n[2],h=n[3];return e[0]=o*h+s*a+r*l-i*c,e[1]=r*h+s*c+i*a-o*l,e[2]=i*h+s*l+o*c-r*a,e[3]=s*h-o*a-r*c-i*l,e}function LZn(e,t,n){n*=0.5;var o=t[0],r=t[1],i=t[2],s=t[3],a=Math.sin(n),c=Math.cos(n);return e[0]=o*c+s*a,e[1]=r*c+i*a,e[2]=i*c-r*a,e[3]=s*c-o*a,e}function HZn(e,t,n){n*=0.5;var o=t[0],r=t[1],i=t[2],s=t[3],a=Math.sin(n),c=Math.cos(n);return e[0]=o*c-i*a,e[1]=r*c+s*a,e[2]=i*c+o*a,e[3]=s*c-r*a,e}function FZn(e,t,n){n*=0.5;var o=t[0],r=t[1],i=t[2],s=t[3],a=Math.sin(n),c=Math.cos(n);return e[0]=o*c+r*a,e[1]=r*c-o*a,e[2]=i*c+s*a,e[3]=s*c-i*a,e}function nVi(e,t){var n=t[0],o=t[1],r=t[2];return e[0]=n,e[1]=o,e[2]=r,e[3]=Math.sqrt(Math.abs(1-n*n-o*o-r*r)),e}function zZn(e,t){var n=t[0],o=t[1],r=t[2],i=t[3],s=Math.sqrt(n*n+o*o+r*r),a=Math.exp(i),c=s>0?a*Math.sin(s)/s:0;return e[0]=n*c,e[1]=o*c,e[2]=r*c,e[3]=a*Math.cos(s),e}function OZn(e,t){var n=t[0],o=t[1],r=t[2],i=t[3],s=Math.sqrt(n*n+o*o+r*r),a=s>0?Math.atan2(s,i)/s:0;return e[0]=n*a,e[1]=o*a,e[2]=r*a,e[3]=0.5*Math.log(n*n+o*o+r*r+i*i),e}function oVi(e,t,n){return OZn(e,t),kpt(e,e,n),zZn(e,e),e}function WMe(e,t,n,o){var r=t[0],i=t[1],s=t[2],a=t[3],c=n[0],l=n[1],h=n[2],d=n[3],u,_,p,m,A;if(_=r*c+i*l+s*h+a*d,_<0)_=-_,c=-c,l=-l,h=-h,d=-d;if(1-_>ci)u=Math.acos(_),p=Math.sin(u),m=Math.sin((1-o)*u)/p,A=Math.sin(o*u)/p;else m=1-o,A=o;return e[0]=m*r+A*c,e[1]=m*i+A*l,e[2]=m*s+A*h,e[3]=m*a+A*d,e}function rVi(e){var t=X6(),n=X6(),o=X6(),r=Math.sqrt(1-t),i=Math.sqrt(t);return e[0]=r*Math.sin(2*Math.PI*n),e[1]=r*Math.cos(2*Math.PI*n),e[2]=i*Math.sin(2*Math.PI*o),e[3]=i*Math.cos(2*Math.PI*o),e}function iVi(e,t){var n=t[0],o=t[1],r=t[2],i=t[3],s=n*n+o*o+r*r+i*i,a=s?1/s:0;return e[0]=-n*a,e[1]=-o*a,e[2]=-r*a,e[3]=i*a,e}function sVi(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function VZn(e,t){var n=t[0]+t[4]+t[8],o;if(n>0)o=Math.sqrt(n+1),e[3]=0.5*o,o=0.5/o,e[0]=(t[5]-t[7])*o,e[1]=(t[6]-t[2])*o,e[2]=(t[1]-t[3])*o;else{var r=0;if(t[4]>t[0])r=1;if(t[8]>t[r*3+r])r=2;var i=(r+1)%3,s=(r+2)%3;o=Math.sqrt(t[r*3+r]-t[i*3+i]-t[s*3+s]+1),e[r]=0.5*o,o=0.5/o,e[3]=(t[i*3+s]-t[s*3+i])*o,e[i]=(t[i*3+r]+t[r*3+i])*o,e[s]=(t[s*3+r]+t[r*3+s])*o}return e}function aVi(e,t,n,o){var r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:Bpt,i=Math.PI/360;t*=i,o*=i,n*=i;var s=Math.sin(t),a=Math.cos(t),c=Math.sin(n),l=Math.cos(n),h=Math.sin(o),d=Math.cos(o);switch(r){case"xyz":e[0]=s*l*d+a*c*h,e[1]=a*c*d-s*l*h,e[2]=a*l*h+s*c*d,e[3]=a*l*d-s*c*h;break;case"xzy":e[0]=s*l*d-a*c*h,e[1]=a*c*d-s*l*h,e[2]=a*l*h+s*c*d,e[3]=a*l*d+s*c*h;break;case"yxz":e[0]=s*l*d+a*c*h,e[1]=a*c*d-s*l*h,e[2]=a*l*h-s*c*d,e[3]=a*l*d+s*c*h;break;case"yzx":e[0]=s*l*d+a*c*h,e[1]=a*c*d+s*l*h,e[2]=a*l*h-s*c*d,e[3]=a*l*d-s*c*h;break;case"zxy":e[0]=s*l*d-a*c*h,e[1]=a*c*d+s*l*h,e[2]=a*l*h+s*c*d,e[3]=a*l*d-s*c*h;break;case"zyx":e[0]=s*l*d-a*c*h,e[1]=a*c*d+s*l*h,e[2]=a*l*h-s*c*d,e[3]=a*l*d+s*c*h;break;default:throw Error("Unknown angle order "+r)}return e}function cVi(e){return"quat("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}function lVi(e,t){return Math.abs(Qpt(e,t))>=1-ci}var YZn,GZn,awe,UZn,WZn,XZn,kpt,zwe,jZn,cwe,KZn,lwe,$Zn,XMe,qZn,JZn,ZZn,eeo,teo=$v({"node_modules/gl-matrix/esm/quat.js"(){vE(),BJn(),cZn(),NZn(),YZn=dZn,GZn=uZn,awe=pZn,UZn=mZn,WZn=_Zn,XZn=kZn,kpt=yZn,zwe=Qpt,jZn=IZn,cwe=Npt,KZn=cwe,lwe=Rpt,$Zn=lwe,XMe=bZn,qZn=vZn,JZn=function(){var e=Tpt(),t=f0t(1,0,0),n=f0t(0,1,0);return function(o,r,i){var s=Fwe(r,i);if(s<-0.999999){if(UMe(e,t,r),Dpt(e)<0.000001)UMe(e,n,r);return eZn(e,e),QZn(o,e,Math.PI),o}else if(s>0.999999)return o[0]=0,o[1]=0,o[2]=0,o[3]=1,o;else return UMe(e,r,i),o[0]=e[0],o[1]=e[1],o[2]=e[2],o[3]=1+s,XMe(o,o)}}(),ZZn=function(){var e=swe(),t=swe();return function(n,o,r,i,s,a){return WMe(e,o,s,a),WMe(t,r,i,a),WMe(n,e,t,2*a*(1-a)),n}}(),eeo=function(){var e=SJn();return function(t,n,o,r){return e[0]=o[0],e[3]=o[1],e[6]=o[2],e[1]=r[0],e[4]=r[1],e[7]=r[2],e[2]=-n[0],e[5]=-n[1],e[8]=-n[2],XMe(t,VZn(t,e))}}()}}),neo={};qv(neo,{add:()=>wVi,clone:()=>dVi,conjugate:()=>NVi,copy:()=>reo,create:()=>hVi,dot:()=>Lpt,equals:()=>LVi,exactEquals:()=>kVi,fromMat4:()=>gVi,fromRotation:()=>_Vi,fromRotationTranslation:()=>oeo,fromRotationTranslationValues:()=>pVi,fromTranslation:()=>mVi,fromValues:()=>uVi,getDual:()=>yVi,getReal:()=>seo,getTranslation:()=>CVi,identity:()=>AVi,invert:()=>DVi,len:()=>leo,length:()=>y0t,lerp:()=>TVi,mul:()=>ceo,multiply:()=>ieo,normalize:()=>RVi,rotateAroundAxis:()=>MVi,rotateByQuatAppend:()=>PVi,rotateByQuatPrepend:()=>EVi,rotateX:()=>IVi,rotateY:()=>vVi,rotateZ:()=>SVi,scale:()=>BVi,set:()=>fVi,setDual:()=>xVi,setReal:()=>aeo,sqrLen:()=>heo,squaredLength:()=>Ppe,str:()=>QVi,translate:()=>bVi});function hVi(){var e=new rc(8);if(rc!=Float32Array)e[0]=0,e[1]=0,e[2]=0,e[4]=0,e[5]=0,e[6]=0,e[7]=0;return e[3]=1,e}function dVi(e){var t=new rc(8);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t}function uVi(e,t,n,o,r,i,s,a){var c=new rc(8);return c[0]=e,c[1]=t,c[2]=n,c[3]=o,c[4]=r,c[5]=i,c[6]=s,c[7]=a,c}function pVi(e,t,n,o,r,i,s){var a=new rc(8);a[0]=e,a[1]=t,a[2]=n,a[3]=o;var c=r*0.5,l=i*0.5,h=s*0.5;return a[4]=c*o+l*n-h*t,a[5]=l*o+h*e-c*n,a[6]=h*o+c*t-l*e,a[7]=-c*e-l*t-h*n,a}function oeo(e,t,n){var o=n[0]*0.5,r=n[1]*0.5,i=n[2]*0.5,s=t[0],a=t[1],c=t[2],l=t[3];return e[0]=s,e[1]=a,e[2]=c,e[3]=l,e[4]=o*l+r*c-i*a,e[5]=r*l+i*s-o*c,e[6]=i*l+o*a-r*s,e[7]=-o*s-r*a-i*c,e}function mVi(e,t){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0]*0.5,e[5]=t[1]*0.5,e[6]=t[2]*0.5,e[7]=0,e}function _Vi(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}function gVi(e,t){var n=swe();LJn(n,t);var o=new rc(3);return QJn(o,t),oeo(e,n,o),e}function reo(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}function AVi(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}function fVi(e,t,n,o,r,i,s,a,c){return e[0]=t,e[1]=n,e[2]=o,e[3]=r,e[4]=i,e[5]=s,e[6]=a,e[7]=c,e}function yVi(e,t){return e[0]=t[4],e[1]=t[5],e[2]=t[6],e[3]=t[7],e}function xVi(e,t){return e[4]=t[0],e[5]=t[1],e[6]=t[2],e[7]=t[3],e}function CVi(e,t){var n=t[4],o=t[5],r=t[6],i=t[7],s=-t[0],a=-t[1],c=-t[2],l=t[3];return e[0]=(n*l+i*s+o*c-r*a)*2,e[1]=(o*l+i*a+r*s-n*c)*2,e[2]=(r*l+i*c+n*a-o*s)*2,e}function bVi(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=n[0]*0.5,c=n[1]*0.5,l=n[2]*0.5,h=t[4],d=t[5],u=t[6],_=t[7];return e[0]=o,e[1]=r,e[2]=i,e[3]=s,e[4]=s*a+r*l-i*c+h,e[5]=s*c+i*a-o*l+d,e[6]=s*l+o*c-r*a+u,e[7]=-o*a-r*c-i*l+_,e}function IVi(e,t,n){var o=-t[0],r=-t[1],i=-t[2],s=t[3],a=t[4],c=t[5],l=t[6],h=t[7],d=a*s+h*o+c*i-l*r,u=c*s+h*r+l*o-a*i,_=l*s+h*i+a*r-c*o,p=h*s-a*o-c*r-l*i;return LZn(e,t,n),o=e[0],r=e[1],i=e[2],s=e[3],e[4]=d*s+p*o+u*i-_*r,e[5]=u*s+p*r+_*o-d*i,e[6]=_*s+p*i+d*r-u*o,e[7]=p*s-d*o-u*r-_*i,e}function vVi(e,t,n){var o=-t[0],r=-t[1],i=-t[2],s=t[3],a=t[4],c=t[5],l=t[6],h=t[7],d=a*s+h*o+c*i-l*r,u=c*s+h*r+l*o-a*i,_=l*s+h*i+a*r-c*o,p=h*s-a*o-c*r-l*i;return HZn(e,t,n),o=e[0],r=e[1],i=e[2],s=e[3],e[4]=d*s+p*o+u*i-_*r,e[5]=u*s+p*r+_*o-d*i,e[6]=_*s+p*i+d*r-u*o,e[7]=p*s-d*o-u*r-_*i,e}function SVi(e,t,n){var o=-t[0],r=-t[1],i=-t[2],s=t[3],a=t[4],c=t[5],l=t[6],h=t[7],d=a*s+h*o+c*i-l*r,u=c*s+h*r+l*o-a*i,_=l*s+h*i+a*r-c*o,p=h*s-a*o-c*r-l*i;return FZn(e,t,n),o=e[0],r=e[1],i=e[2],s=e[3],e[4]=d*s+p*o+u*i-_*r,e[5]=u*s+p*r+_*o-d*i,e[6]=_*s+p*i+d*r-u*o,e[7]=p*s-d*o-u*r-_*i,e}function PVi(e,t,n){var o=n[0],r=n[1],i=n[2],s=n[3],a=t[0],c=t[1],l=t[2],h=t[3];return e[0]=a*s+h*o+c*i-l*r,e[1]=c*s+h*r+l*o-a*i,e[2]=l*s+h*i+a*r-c*o,e[3]=h*s-a*o-c*r-l*i,a=t[4],c=t[5],l=t[6],h=t[7],e[4]=a*s+h*o+c*i-l*r,e[5]=c*s+h*r+l*o-a*i,e[6]=l*s+h*i+a*r-c*o,e[7]=h*s-a*o-c*r-l*i,e}function EVi(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=n[0],c=n[1],l=n[2],h=n[3];return e[0]=o*h+s*a+r*l-i*c,e[1]=r*h+s*c+i*a-o*l,e[2]=i*h+s*l+o*c-r*a,e[3]=s*h-o*a-r*c-i*l,a=n[4],c=n[5],l=n[6],h=n[7],e[4]=o*h+s*a+r*l-i*c,e[5]=r*h+s*c+i*a-o*l,e[6]=i*h+s*l+o*c-r*a,e[7]=s*h-o*a-r*c-i*l,e}function MVi(e,t,n,o){if(Math.abs(o)<ci)return reo(e,t);var r=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);o=o*0.5;var i=Math.sin(o),s=i*n[0]/r,a=i*n[1]/r,c=i*n[2]/r,l=Math.cos(o),h=t[0],d=t[1],u=t[2],_=t[3];e[0]=h*l+_*s+d*c-u*a,e[1]=d*l+_*a+u*s-h*c,e[2]=u*l+_*c+h*a-d*s,e[3]=_*l-h*s-d*a-u*c;var p=t[4],m=t[5],A=t[6],g=t[7];return e[4]=p*l+g*s+m*c-A*a,e[5]=m*l+g*a+A*s-p*c,e[6]=A*l+g*c+p*a-m*s,e[7]=g*l-p*s-m*a-A*c,e}function wVi(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e}function ieo(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=n[4],c=n[5],l=n[6],h=n[7],d=t[4],u=t[5],_=t[6],p=t[7],m=n[0],A=n[1],g=n[2],f=n[3];return e[0]=o*f+s*m+r*g-i*A,e[1]=r*f+s*A+i*m-o*g,e[2]=i*f+s*g+o*A-r*m,e[3]=s*f-o*m-r*A-i*g,e[4]=o*h+s*a+r*l-i*c+d*f+p*m+u*g-_*A,e[5]=r*h+s*c+i*a-o*l+u*f+p*A+_*m-d*g,e[6]=i*h+s*l+o*c-r*a+_*f+p*g+d*A-u*m,e[7]=s*h-o*a-r*c-i*l+p*f-d*m-u*A-_*g,e}function BVi(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e}function TVi(e,t,n,o){var r=1-o;if(Lpt(t,n)<0)o=-o;return e[0]=t[0]*r+n[0]*o,e[1]=t[1]*r+n[1]*o,e[2]=t[2]*r+n[2]*o,e[3]=t[3]*r+n[3]*o,e[4]=t[4]*r+n[4]*o,e[5]=t[5]*r+n[5]*o,e[6]=t[6]*r+n[6]*o,e[7]=t[7]*r+n[7]*o,e}function DVi(e,t){var n=Ppe(t);return e[0]=-t[0]/n,e[1]=-t[1]/n,e[2]=-t[2]/n,e[3]=t[3]/n,e[4]=-t[4]/n,e[5]=-t[5]/n,e[6]=-t[6]/n,e[7]=t[7]/n,e}function NVi(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e[4]=-t[4],e[5]=-t[5],e[6]=-t[6],e[7]=t[7],e}function RVi(e,t){var n=Ppe(t);if(n>0){n=Math.sqrt(n);var o=t[0]/n,r=t[1]/n,i=t[2]/n,s=t[3]/n,a=t[4],c=t[5],l=t[6],h=t[7],d=o*a+r*c+i*l+s*h;e[0]=o,e[1]=r,e[2]=i,e[3]=s,e[4]=(a-o*d)/n,e[5]=(c-r*d)/n,e[6]=(l-i*d)/n,e[7]=(h-s*d)/n}return e}function QVi(e){return"quat2("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+")"}function kVi(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]}function LVi(e,t){var n=e[0],o=e[1],r=e[2],i=e[3],s=e[4],a=e[5],c=e[6],l=e[7],h=t[0],d=t[1],u=t[2],_=t[3],p=t[4],m=t[5],A=t[6],g=t[7];return Math.abs(n-h)<=ci*Math.max(1,Math.abs(n),Math.abs(h))&&Math.abs(o-d)<=ci*Math.max(1,Math.abs(o),Math.abs(d))&&Math.abs(r-u)<=ci*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(i-_)<=ci*Math.max(1,Math.abs(i),Math.abs(_))&&Math.abs(s-p)<=ci*Math.max(1,Math.abs(s),Math.abs(p))&&Math.abs(a-m)<=ci*Math.max(1,Math.abs(a),Math.abs(m))&&Math.abs(c-A)<=ci*Math.max(1,Math.abs(c),Math.abs(A))&&Math.abs(l-g)<=ci*Math.max(1,Math.abs(l),Math.abs(g))}var seo,aeo,ceo,Lpt,y0t,leo,Ppe,heo,HVi=$v({"node_modules/gl-matrix/esm/quat2.js"(){vE(),teo(),UJn(),seo=awe,aeo=awe,ceo=ieo,Lpt=zwe,y0t=cwe,leo=y0t,Ppe=lwe,heo=Ppe}}),deo={};qv(deo,{add:()=>YVi,angle:()=>lYi,ceil:()=>GVi,clone:()=>FVi,copy:()=>OVi,create:()=>ueo,cross:()=>tYi,dist:()=>veo,distance:()=>geo,div:()=>Ieo,divide:()=>_eo,dot:()=>eYi,equals:()=>mYi,exactEquals:()=>pYi,floor:()=>UVi,forEach:()=>Eeo,fromValues:()=>zVi,inverse:()=>JVi,len:()=>xeo,length:()=>feo,lerp:()=>nYi,max:()=>XVi,min:()=>WVi,mul:()=>beo,multiply:()=>meo,negate:()=>qVi,normalize:()=>ZVi,random:()=>oYi,rotate:()=>cYi,round:()=>jVi,scale:()=>KVi,scaleAndAdd:()=>$Vi,set:()=>VVi,signedAngle:()=>hYi,sqrDist:()=>Seo,sqrLen:()=>Peo,squaredDistance:()=>Aeo,squaredLength:()=>yeo,str:()=>uYi,sub:()=>Ceo,subtract:()=>peo,transformMat2:()=>rYi,transformMat2d:()=>iYi,transformMat3:()=>sYi,transformMat4:()=>aYi,zero:()=>dYi});function ueo(){var e=new rc(2);if(rc!=Float32Array)e[0]=0,e[1]=0;return e}function FVi(e){var t=new rc(2);return t[0]=e[0],t[1]=e[1],t}function zVi(e,t){var n=new rc(2);return n[0]=e,n[1]=t,n}function OVi(e,t){return e[0]=t[0],e[1]=t[1],e}function VVi(e,t,n){return e[0]=t,e[1]=n,e}function YVi(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}function peo(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}function meo(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e}function _eo(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e}function GVi(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e}function UVi(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e}function WVi(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e}function XVi(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}function jVi(e,t){return e[0]=gE(t[0]),e[1]=gE(t[1]),e}function KVi(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}function $Vi(e,t,n,o){return e[0]=t[0]+n[0]*o,e[1]=t[1]+n[1]*o,e}function geo(e,t){var n=t[0]-e[0],o=t[1]-e[1];return Math.sqrt(n*n+o*o)}function Aeo(e,t){var n=t[0]-e[0],o=t[1]-e[1];return n*n+o*o}function feo(e){var t=e[0],n=e[1];return Math.sqrt(t*t+n*n)}function yeo(e){var t=e[0],n=e[1];return t*t+n*n}function qVi(e,t){return e[0]=-t[0],e[1]=-t[1],e}function JVi(e,t){return e[0]=1/t[0],e[1]=1/t[1],e}function ZVi(e,t){var n=t[0],o=t[1],r=n*n+o*o;if(r>0)r=1/Math.sqrt(r);return e[0]=t[0]*r,e[1]=t[1]*r,e}function eYi(e,t){return e[0]*t[0]+e[1]*t[1]}function tYi(e,t,n){var o=t[0]*n[1]-t[1]*n[0];return e[0]=e[1]=0,e[2]=o,e}function nYi(e,t,n,o){var r=t[0],i=t[1];return e[0]=r+o*(n[0]-r),e[1]=i+o*(n[1]-i),e}function oYi(e,t){t=t===void 0?1:t;var n=X6()*2*Math.PI;return e[0]=Math.cos(n)*t,e[1]=Math.sin(n)*t,e}function rYi(e,t,n){var o=t[0],r=t[1];return e[0]=n[0]*o+n[2]*r,e[1]=n[1]*o+n[3]*r,e}function iYi(e,t,n){var o=t[0],r=t[1];return e[0]=n[0]*o+n[2]*r+n[4],e[1]=n[1]*o+n[3]*r+n[5],e}function sYi(e,t,n){var o=t[0],r=t[1];return e[0]=n[0]*o+n[3]*r+n[6],e[1]=n[1]*o+n[4]*r+n[7],e}function aYi(e,t,n){var o=t[0],r=t[1];return e[0]=n[0]*o+n[4]*r+n[12],e[1]=n[1]*o+n[5]*r+n[13],e}function cYi(e,t,n,o){var r=t[0]-n[0],i=t[1]-n[1],s=Math.sin(o),a=Math.cos(o);return e[0]=r*a-i*s+n[0],e[1]=r*s+i*a+n[1],e}function lYi(e,t){var n=e[0],o=e[1],r=t[0],i=t[1];return Math.abs(Math.atan2(o*r-n*i,n*r+o*i))}function hYi(e,t){var n=e[0],o=e[1],r=t[0],i=t[1];return Math.atan2(n*i-o*r,n*r+o*i)}function dYi(e){return e[0]=0,e[1]=0,e}function uYi(e){return"vec2("+e[0]+", "+e[1]+")"}function pYi(e,t){return e[0]===t[0]&&e[1]===t[1]}function mYi(e,t){var n=e[0],o=e[1],r=t[0],i=t[1];return Math.abs(n-r)<=ci*Math.max(1,Math.abs(n),Math.abs(r))&&Math.abs(o-i)<=ci*Math.max(1,Math.abs(o),Math.abs(i))}var xeo,Ceo,beo,Ieo,veo,Seo,Peo,Eeo,_Yi=$v({"node_modules/gl-matrix/esm/vec2.js"(){vE(),xeo=feo,Ceo=peo,beo=meo,Ieo=_eo,veo=geo,Seo=Aeo,Peo=yeo,Eeo=function(){var e=ueo();return function(t,n,o,r,i,s){var a,c;if(!n)n=2;if(!o)o=0;if(r)c=Math.min(r*n+o,t.length);else c=t.length;for(a=o;a<c;a+=n)e[0]=t[a],e[1]=t[a+1],i(e,e,s),t[a]=e[0],t[a+1]=e[1];return t}}()}}),Meo={};qv(Meo,{glMatrix:()=>dJn,mat2:()=>mJn,mat2d:()=>yJn,mat3:()=>vJn,mat4:()=>TJn,quat:()=>RZn,quat2:()=>neo,vec2:()=>deo,vec3:()=>WJn,vec4:()=>lZn});var gYi=$v({"node_modules/gl-matrix/esm/index.js"(){vE(),MFi(),$Fi(),BJn(),UJn(),teo(),HVi(),_Yi(),cZn(),NZn()}}),weo=At({"node_modules/jscad-planner/dist/index.cjs"(e,t){var{defineProperty:n,getOwnPropertyDescriptor:o,getOwnPropertyNames:r}=Object,i=Object.prototype.hasOwnProperty,s=(C,b)=>{for(var I in b)n(C,I,{get:b[I],enumerable:!0})},a=(C,b,I,v)=>{if(b&&typeof b==="object"||typeof b==="function"){for(let P of r(b))if(!i.call(C,P)&&P!==I)n(C,P,{get:()=>b[P],enumerable:!(v=o(b,P))||v.enumerable})}return C},c=(C)=>a(n({},"__esModule",{value:!0}),C),l={};s(l,{assertTransformMatrix:()=>d,executeJscadOperations:()=>y,jscadPlanner:()=>_,resolveReferencePlanes:()=>f,toTransformMatrix:()=>u}),t.exports=c(l);var h="Transform matrix must be a column-major array of exactly 16 finite numbers";function d(C){if(!Array.isArray(C)||C.length!==16||!Array.from(C).every(Number.isFinite))throw Error(h)}function u(C){if(C==null||C.length!==16)throw Error(h);let b=Array.from(C);return d(b),b}var _={booleans:{intersect:(...C)=>({type:"intersect",shapes:C}),subtract:(...C)=>({type:"subtract",shapes:C}),union:(...C)=>({type:"union",shapes:C})},hulls:{hull:(...C)=>({type:"hull",shapes:C.flat()}),hullChain:(...C)=>({type:"hullChain",shapes:C.flat()})},colors:{colorize:(C,b)=>({type:"colorize",color:C,shape:b})},primitives:{rectangle:(C)=>({...C,type:"rectangle"}),cube:(C)=>({type:"cube",...C}),sphere:(C)=>({type:"sphere",...C}),cylinder:(C)=>({type:"cylinder",...C}),polygon:(C)=>({type:"polygon",...C}),cuboid:(C)=>({type:"cuboid",...C}),roundedCuboid:(C)=>({type:"roundedCuboid",...C})},transforms:{transform:(C,b)=>(d(C),{type:"transform",matrix:C,shape:b}),rotate:(C,b)=>({type:"rotate",angles:C,shape:b}),rotateX:(C,b)=>({type:"rotateX",angle:C,shape:b}),rotateY:(C,b)=>({type:"rotateY",angle:C,shape:b}),rotateZ:(C,b)=>({type:"rotateZ",angle:C,shape:b}),scale:(C,b)=>({type:"scale",factors:C,shape:b}),translate:(C,b)=>({type:"translate",vector:C,shape:b})},extrusions:{extrudeLinear:(C,b)=>({type:"extrudeLinear",options:C,shape:b}),extrudeRotate:(C,b)=>({type:"extrudeRotate",options:C,shape:b})},maths:{vec2:{create:(C,b)=>[C,b],fromValues:(C,b)=>[C,b]},vec3:{create:(C,b,I)=>[C,b,I],fromValues:(C,b,I)=>[C,b,I]}},geometries:{geom2:{create:(C)=>({type:"createGeom2",points:C}),fromPoints:(C)=>({type:"fromPointsGeom2",points:C})},geom3:{create:(C)=>({type:"createGeom3",polygons:C})},path2:{create:(C)=>({type:"createPath2",points:C})}},measurements:{measureBoundingBox:(C)=>({type:"measureBoundingBox",shape:C}),measureArea:(C)=>({type:"measureArea",shape:C}),measureVolume:(C)=>({type:"measureVolume",shape:C})},utils:{degToRad:(C)=>C*Math.PI/180,radToDeg:(C)=>C*180/Math.PI}},p=(gYi(),ARi(Meo)),m=()=>u(p.mat4.create());function A(C){let b=m();switch(C.type){case"transform":return d(C.matrix),[...C.matrix];case"translate":return u(p.mat4.fromTranslation(b,C.vector));case"scale":return u(p.mat4.fromScaling(b,C.factors));case"rotate":return p.mat4.rotateZ(b,b,C.angles[2]),p.mat4.rotateY(b,b,C.angles[1]),p.mat4.rotateX(b,b,C.angles[0]),b;case"rotateX":return u(p.mat4.fromXRotation(b,C.angle));case"rotateY":return u(p.mat4.fromYRotation(b,C.angle));case"rotateZ":return u(p.mat4.fromZRotation(b,C.angle));default:throw Error(`Cannot use ${C.type} as a reference transform`)}}function g(C,b){let I=C.name;if(!I?.trim())throw Error("Reference rectangles require a nonblank name");let v;if(C.type==="rectangle"){if(C.size.length!==2||!C.size.every((D)=>Number.isFinite(D)&&D>0))throw Error(`Reference rectangle "${I}" requires two positive finite dimensions`);v=C.center??[0,0]}else{let D=C.points;if(C.paths||D.length!==4||!D.every((O)=>O.length===2&&O.every((U)=>typeof U==="number"&&Number.isFinite(U))))throw Error(`Reference polygon "${I}" must be an axis-aligned rectangle`);let L=D,H=[...new Set(L.map((O)=>O[0]))],V=[...new Set(L.map((O)=>O[1]))];if(H.length!==2||V.length!==2||new Set(L.map((O)=>JSON.stringify(O))).size!==4)throw Error(`Reference polygon "${I}" must be an axis-aligned rectangle`);v=[(H[0]+H[1])/2,(V[0]+V[1])/2]}if(v.length!==2||!v.every(Number.isFinite))throw Error(`Reference rectangle "${I}" has an invalid center`);let P=m();for(let D of b)p.mat4.multiply(P,P,A(D));if(d(P),P[3]!==0||P[7]!==0||P[11]!==0||P[15]!==1)throw Error(`Reference rectangle "${I}" requires affine transforms`);let M=p.mat4.invert(m(),P);if(!M)throw Error(`Reference rectangle "${I}" has a singular transform`);let B=[0,0,0];p.vec3.transformMat4(B,[v[0],v[1],0],P);let T=[M[2],M[6],M[10]],N=[P[0],P[1],P[2]];if(![...B,...T,...N].every(Number.isFinite)||!p.vec3.length(T)||!p.vec3.length(N))throw Error(`Reference rectangle "${I}" has an invalid frame`);return p.vec3.normalize(T,T),p.vec3.normalize(N,N),{name:I,origin:B,normal:T,xAxis:N}}function f(C){let b=[],I=new Set;function v(B,T,N=!1){if(B.reference){if(B.type!=="rectangle"&&B.type!=="polygon")throw Error("Only rectangles can be reference geometry");if(N)throw Error("Reference rectangles must be outside extrusion and measurement inputs");let D=g(B,T);if(I.has(D.name))throw Error(`Duplicate reference plane "${D.name}"`);I.add(D.name),b.push(D);return}switch(B.type){case"translate":case"rotate":case"rotateX":case"rotateY":case"rotateZ":case"scale":case"transform":{let D=v(B.shape,[...T,B],N);return D?{...B,shape:D}:void 0}case"colorize":{let D=v(B.shape,T,N);return D?{...B,shape:D}:void 0}case"extrudeLinear":case"extrudeRotate":case"measureArea":case"measureVolume":case"measureBoundingBox":{let D=v(B.shape,T,!0);return D?{...B,shape:D}:void 0}case"union":case"subtract":case"intersect":case"hull":case"hullChain":{let D=B.shapes.map((H)=>v(H,T,N));if(B.type==="subtract"&&B.shapes.length&&!D[0])throw Error("A subtraction base cannot be reference geometry");let L=D.filter((H)=>H!==void 0);if(!L.length)return;if(L.length===1)return L[0];return{...B,shapes:L}}default:return{...B}}}let P=(Array.isArray(C)?C:[C]).map((B)=>v(B,[])).filter((B)=>B!==void 0);return{geometry:P.length>1?{type:"union",shapes:P}:P[0],referencePlanes:b}}var y=(C,b)=>{if(Array.isArray(b)&&b.length===1)return y(C,b[0]);if(Array.isArray(b))throw Error("executeJscadOperations currently doesn't support Array<JscadOperation>, try adding a root union or or executing each element individually");let{geometry:I}=f(b);if(!I)throw Error("JSCAD plan contains only reference geometry");return x(C,I)},x=(C,b)=>{let I=(M)=>x(C,M),{type:v,...P}=b;switch(v){case"rectangle":if(!C.primitives.rectangle)throw Error("JSCAD adapter does not support primitives.rectangle");return C.primitives.rectangle({size:b.size,center:b.center??[0,0]});case"intersect":return C.booleans.intersect(...b.shapes.map(I));case"subtract":return C.booleans.subtract(...b.shapes.map(I));case"union":return C.booleans.union(...b.shapes.map(I));case"hull":return C.hulls.hull(...b.shapes.map(I));case"hullChain":return C.hulls.hullChain(...b.shapes.map(I));case"colorize":return C.colors.colorize(b.color,I(b.shape));case"cube":return C.primitives.cube(P);case"sphere":return C.primitives.sphere(P);case"cylinder":return C.primitives.cylinder(P);case"polygon":return C.primitives.polygon(P);case"cuboid":return C.primitives.cuboid(P);case"roundedCuboid":return C.primitives.roundedCuboid(P);case"transform":if(d(b.matrix),!C.transforms.transform)throw Error('Cannot execute "transform" operation: this JSCAD adapter does not support transforms.transform');return C.transforms.transform(b.matrix,I(b.shape));case"rotate":return C.transforms.rotate(b.angles,I(b.shape));case"rotateX":return C.transforms.rotateX(b.angle,I(b.shape));case"rotateY":return C.transforms.rotateY(b.angle,I(b.shape));case"rotateZ":return C.transforms.rotateZ(b.angle,I(b.shape));case"scale":return C.transforms.scale(b.factors,I(b.shape));case"translate":return C.transforms.translate(b.vector,I(b.shape));case"extrudeLinear":return C.extrusions.extrudeLinear(b.options,I(b.shape));case"extrudeRotate":return C.extrusions.extrudeRotate(b.options,I(b.shape));case"createGeom2":return C.geometries.geom2.create(b.points);case"fromPointsGeom2":return C.geometries.geom2.fromPoints(b.points);case"createGeom3":return C.geometries.geom3.create(b.polygons);case"createPath2":return C.geometries.path2.create(b.points);case"measureBoundingBox":return C.measurements.measureBoundingBox(I(b.shape));case"measureArea":return C.measurements.measureArea(I(b.shape));case"measureVolume":return C.measurements.measureVolume(I(b.shape));case"degToRad":return C.utils.degToRad(b.degrees);case"radToDeg":return C.utils.radToDeg(b.radians);default:if(b.type===void 0)throw Error(`Operation type is undefined. This usually means the operation object is malformed or not properly initialized. Operation: ${JSON.stringify(b,null,2).slice(0,200)}...`);throw Error(`Unsupported operation type: ${b.type}. Operation: ${JSON.stringify(b,null,2)}`)}}}}),AYi=At({"node_modules/ms/index.js"(e,t){var n=1000,o=n*60,r=o*60,i=r*24,s=i*7,a=i*365.25;t.exports=function(u,_){_=_||{};var p=typeof u;if(p==="string"&&u.length>0)return c(u);else if(p==="number"&&isFinite(u))return _.long?h(u):l(u);throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(u))};function c(u){if(u=String(u),u.length>100)return;var _=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(u);if(!_)return;var p=parseFloat(_[1]),m=(_[2]||"ms").toLowerCase();switch(m){case"years":case"year":case"yrs":case"yr":case"y":return p*a;case"weeks":case"week":case"w":return p*s;case"days":case"day":case"d":return p*i;case"hours":case"hour":case"hrs":case"hr":case"h":return p*r;case"minutes":case"minute":case"mins":case"min":case"m":return p*o;case"seconds":case"second":case"secs":case"sec":case"s":return p*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return p;default:return}}function l(u){var _=Math.abs(u);if(_>=i)return Math.round(u/i)+"d";if(_>=r)return Math.round(u/r)+"h";if(_>=o)return Math.round(u/o)+"m";if(_>=n)return Math.round(u/n)+"s";return u+"ms"}function h(u){var _=Math.abs(u);if(_>=i)return d(u,_,i,"day");if(_>=r)return d(u,_,r,"hour");if(_>=o)return d(u,_,o,"minute");if(_>=n)return d(u,_,n,"second");return u+" ms"}function d(u,_,p,m){var A=_>=p*1.5;return Math.round(u/p)+" "+m+(A?"s":"")}}}),fYi=At({"node_modules/debug/src/common.js"(e,t){function n(o){i.debug=i,i.default=i,i.coerce=d,i.disable=l,i.enable=a,i.enabled=h,i.humanize=AYi(),i.destroy=u,Object.keys(o).forEach((_)=>{i[_]=o[_]}),i.names=[],i.skips=[],i.formatters={};function r(_){let p=0;for(let m=0;m<_.length;m++)p=(p<<5)-p+_.charCodeAt(m),p|=0;return i.colors[Math.abs(p)%i.colors.length]}i.selectColor=r;function i(_){let p,m=null,A,g;function f(...y){if(!f.enabled)return;let x=f,C=Number(new Date),b=C-(p||C);if(x.diff=b,x.prev=p,x.curr=C,p=C,y[0]=i.coerce(y[0]),typeof y[0]!=="string")y.unshift("%O");let I=0;y[0]=y[0].replace(/%([a-zA-Z%])/g,(P,M)=>{if(P==="%%")return"%";I++;let B=i.formatters[M];if(typeof B==="function"){let T=y[I];P=B.call(x,T),y.splice(I,1),I--}return P}),i.formatArgs.call(x,y),(x.log||i.log).apply(x,y)}if(f.namespace=_,f.useColors=i.useColors(),f.color=i.selectColor(_),f.extend=s,f.destroy=i.destroy,Object.defineProperty(f,"enabled",{enumerable:!0,configurable:!1,get:()=>{if(m!==null)return m;if(A!==i.namespaces)A=i.namespaces,g=i.enabled(_);return g},set:(y)=>{m=y}}),typeof i.init==="function")i.init(f);return f}function s(_,p){let m=i(this.namespace+(typeof p>"u"?":":p)+_);return m.log=this.log,m}function a(_){i.save(_),i.namespaces=_,i.names=[],i.skips=[];let p=(typeof _==="string"?_:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let m of p)if(m[0]==="-")i.skips.push(m.slice(1));else i.names.push(m)}function c(_,p){let m=0,A=0,g=-1,f=0;while(m<_.length)if(A<p.length&&(p[A]===_[m]||p[A]==="*"))if(p[A]==="*")g=A,f=m,A++;else m++,A++;else if(g!==-1)A=g+1,f++,m=f;else return!1;while(A<p.length&&p[A]==="*")A++;return A===p.length}function l(){let _=[...i.names,...i.skips.map((p)=>"-"+p)].join(",");return i.enable(""),_}function h(_){for(let p of i.skips)if(c(_,p))return!1;for(let p of i.names)if(c(_,p))return!0;return!1}function d(_){if(_ instanceof Error)return _.stack||_.message;return _}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return i.enable(i.load()),i}t.exports=n}}),yYi=At({"node_modules/debug/src/browser.js"(e,t){e.formatArgs=o,e.save=r,e.load=i,e.useColors=n,e.storage=s(),e.destroy=(()=>{let c=!1;return()=>{if(!c)c=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function n(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let c;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(c=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(c[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function o(c){if(c[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+c[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;let l="color: "+this.color;c.splice(1,0,l,"color: inherit");let h=0,d=0;c[0].replace(/%[a-zA-Z%]/g,(u)=>{if(u==="%%")return;if(h++,u==="%c")d=h}),c.splice(d,0,l)}e.log=console.debug||console.log||(()=>{});function r(c){try{if(c)e.storage.setItem("debug",c);else e.storage.removeItem("debug")}catch(l){}}function i(){let c;try{c=e.storage.getItem("debug")||e.storage.getItem("DEBUG")}catch(l){}if(!c&&typeof process<"u"&&"env"in process)c=process.env.DEBUG;return c}function s(){try{return localStorage}catch(c){}}t.exports=fYi()(e);var{formatters:a}=t.exports;a.j=function(c){try{return JSON.stringify(c)}catch(l){return"[UnexpectedJSONParseError]: "+l.message}}}}),Hpt=Vte.createContext(null),rg=()=>{let e=Vte.useContext(Hpt);if(!e)throw Error("useThree must be used within a ThreeProvider");return e},jpe=(e,t=[])=>{let{addFrameListener:n,removeFrameListener:o}=rg();Vte.default.useEffect(()=>(n(e),()=>o(e)),[n,o,...t])},Fpt=yE.createContext(null),xYi=()=>{let e=yE.useContext(Fpt),t=rg();return yE.useEffect(()=>{if(!e)return;return e.current=t,()=>{e.current=null}},[e,t]),null},CYi=({cadComponent:e,children:t})=>{let n=rg(),o=yE.useMemo(()=>new Ba,[]);o.userData.cad_component_id=e.cad_component_id,o.userData.pcb_component_id=e.pcb_component_id,yE.useEffect(()=>(n.rootObject.add(o),()=>{n.rootObject.remove(o)}),[n.rootObject,o]);let r=yE.useMemo(()=>({...n,rootObject:o}),[n,o]);return Beo.jsx(Hpt.Provider,{value:r,children:t})},Teo=(e,t)=>{if(!e)return;let{camera:n,rootObject:o,renderer:r}=e,i=r.domElement.getBoundingClientRect();if(!i.width||!i.height)return;if(t.x<i.left||t.x>i.right||t.y<i.top||t.y>i.bottom)return;let s=new Lz;n.updateWorldMatrix(!0,!1),o.updateWorldMatrix(!0,!0),s.setFromCamera(new ro((t.x-i.left)/i.width*2-1,-((t.y-i.top)/i.height)*2+1),n);for(let a of s.intersectObject(o,!0)){if(!(a.object instanceof Mo))continue;let c=a.object,l=!0;while(c){if(!c.visible)l=!1;c=c.parent}if(l)return a.object}},bYi=(e,t,n)=>{let o=Teo(e,t)??null,r;while(o)r??=o.userData.pcb_component_id,o=o.parent;if(!r)return;let i=n.find((a)=>a.type==="pcb_component"&&a.pcb_component_id===r);if(i?.type!=="pcb_component")return;let s=n.find((a)=>a.type==="source_component"&&a.source_component_id===i.source_component_id);if(s?.type!=="source_component")return;return{source_component_id:s.source_component_id,pcb_component_id:i.pcb_component_id,refdes:s.name}};function Deo(e,t){return t??e.some((n)=>n.type==="cad_component"&&n.is_on_folded_board===!0)}var IYi=(e,t,n)=>{let o=Teo(e,t)??null;while(o){let r=o.userData.cad_component_id;if(r){let i=n.find((a)=>a.type==="cad_component"&&a.cad_component_id===r);if(i?.type!=="cad_component")return;let s=n.find((a)=>a.type==="source_component"&&a.source_component_id===i.source_component_id);return{cad_component_id:i.cad_component_id,componentName:s?.type==="source_component"?s.name:i.cad_component_id}}o=o.parent}},EMe=new Set,vYi=(e)=>{let[t,n]=Neo.useState({circuitKey:e,ids:EMe}),o=t.circuitKey===e?t.ids:EMe;if(t.circuitKey!==e)n({circuitKey:e,ids:EMe});return{hiddenCadComponentIds:o,hideComponent:(r)=>{n((i)=>({circuitKey:e,ids:new Set([...i.circuitKey===e?i.ids:[],r])}))},unhideAllComponents:()=>{n({circuitKey:e,ids:EMe})}}};function Epe(e,t,n){let o=typeof window<"u"?window.TSCIRCUIT_JSCDN_BASE_URL:void 0;if(!o)return`https://cdn.jsdelivr.net/npm/${e}@${t}/${n}`;return new URL(`${o.replace(/\/+$/,"")}/${e}/${t}/${n}`,window.location.href).href}var LKn=!1;function SYi(){if(LKn||typeof window>"u"||!window.TSCIRCUIT_JSCDN_BASE_URL)return;d4t({defaultFontURL:Epe("three","0.165.0","examples/fonts/ttf/kenpixel.ttf"),unicodeFontsURL:Epe("troika-three-text","0.52.5","unicode-fonts/")}),LKn=!0}var zpt=(e)=>Reo.useMemo(()=>{if(!e)return[];let t=new _En;return t.add(e),t.render(),t.getCircuitJson()},[e]),PYi=(e,t)=>{let n=e.pcb_component_id?t.find((o)=>o.type==="pcb_component"&&o.pcb_component_id===e.pcb_component_id):void 0;return{pcbComponent:n,layer:e.layer??n?.layer??"top",isThroughHole:Boolean(n&&t.some((o)=>o.type==="pcb_plated_hole"&&o.pcb_component_id===n.pcb_component_id))}},Xut=["translucent","opaque","hidden"],EYi=(e)=>Xut[(Xut.indexOf(e)+1)%Xut.length],HKn={boardBody:!0,topCopper:!0,bottomCopper:!0,keepout:!0,adhesive:!1,solderPaste:!1,topSilkscreen:!0,bottomSilkscreen:!0,topMask:!0,bottomMask:!0,throughHoleModels:!0,smtModels:!0,translucentModels:!0,modelsNotInPosFile:!1,modelsMarkedDNP:!1,modelBoundingBoxes:!1,threedAxis:!1,pcbNotes:!1,backgroundStart:!0,backgroundEnd:!0,enclosure:"translucent"},keo=Kv.createContext(void 0),MYi=({children:e})=>{let[t,n]=Kv.useState(HKn),o=Kv.useCallback((s,a)=>{n((c)=>({...c,[s]:a}))},[]),r=Kv.useCallback(()=>{n(HKn)},[]),i=Kv.useMemo(()=>({visibility:t,setLayerVisibility:o,resetToDefaults:r}),[t,o,r]);return Qeo.jsx(keo.Provider,{value:i,children:e})},pU=()=>{let e=Kv.useContext(keo);if(!e)throw Error("useLayerVisibility must be used within a LayerVisibilityProvider");return e},jut=1.2;function Heo(e){return Leo.useMemo(()=>{if(!e)return jut;try{return Vo(e).pcb_board.list()[0]?.thickness??jut}catch(t){return jut}},[e])}var Kpe={clickToInteractOverlay:100,htmlElements:95,orientationCube:95,contextMenu:110,appearanceMenu:111},zeo=({children:e,position:t,style:n})=>{let{camera:o,renderer:r}=rg(),i=Yte.useRef(document.createElement("div")),[s,a]=Yte.useState(null);return Yte.useEffect(()=>{let c=r?.domElement.parentNode;if(!c)return;if(c.style.position!=="relative"&&c.style.position!=="absolute")c.style.position="relative";return c.appendChild(i.current),a(Feo.default.createPortal(e,i.current)),()=>{if(c.contains(i.current))c.removeChild(i.current)}},[r,e]),jpe(()=>{if(!o||!i.current||!r)return;let c=new Et(...t);c.project(o);let l=r.domElement.getBoundingClientRect(),h=Math.round((c.x+1)/2*l.width),d=Math.round((-c.y+1)/2*l.height);if(i.current.style.position="absolute",i.current.style.left=`${h}px`,i.current.style.top=`${d}px`,i.current.style.pointerEvents="none",i.current.style.zIndex=Kpe.htmlElements.toString(),n)Object.assign(i.current.style,n)},[o,r,t,n]),s},wYi=ih(Hwe(),1),Yeo=tg.createContext(null),BYi=()=>{let e=tg.useContext(Yeo);if(!e)throw Error("useHover must be used within a HoverProvider");return e},TYi=({children:e})=>{let{camera:t,renderer:n}=rg(),[o,r]=tg.useState([]),i=tg.useMemo(()=>new Lz,[]),s=tg.useMemo(()=>new ro,[]),a=tg.useRef(o);a.current=o;let c=tg.useRef(null),l=tg.useCallback((p)=>{r((m)=>[...m,p])},[]),h=tg.useCallback((p)=>{if(c.current){let m=!1,A=c.current.object;while(A){if(A===p){m=!0;break}A=A.parent}if(m)c.current.onUnhover(),c.current=null}r((m)=>m.filter((A)=>A.object!==p))},[]),d=tg.useCallback((p)=>{let m=p;while(m){let A=a.current.find((g)=>g.object===m);if(A)return A;m=m.parent}return},[]),u=tg.useCallback((p)=>{if(!n.domElement)return;let m=n.domElement.getBoundingClientRect();s.x=(p.clientX-m.left)/m.width*2-1,s.y=-((p.clientY-m.top)/m.height)*2+1,i.setFromCamera(s,t);let A=a.current.map((f)=>f.object);if(A.length===0){if(c.current)c.current.onUnhover(),c.current=null;return}let g=i.intersectObjects(A,!0);if(g.length>0){let f=g[0],y=d(f.object);if(y){let x={mousePosition:[f.point.x,f.point.y,f.point.z]};if(c.current!==y)c.current?.onUnhover(),y.onHover(x),c.current=y;else y.onHover(x)}else if(c.current)c.current.onUnhover(),c.current=null}else if(c.current)c.current.onUnhover(),c.current=null},[t,n,i,s,d]);tg.useEffect(()=>{let p=n.domElement;return p.addEventListener("mousemove",u),()=>{p.removeEventListener("mousemove",u)}},[n,u]);let _=tg.useMemo(()=>({addHoverable:l,removeHoverable:h}),[l,h]);return Veo.jsx(Yeo.Provider,{value:_,children:e})},DYi=({children:e,object:t,onHover:n,onUnhover:o,isHovered:r})=>{let{addHoverable:i,removeHoverable:s}=BYi();return Oeo.useEffect(()=>{if(!t)return;return i({object:t,onHover:n,onUnhover:o}),()=>{s(t)}},[t,n,o,i,s]),Owe.jsx(Owe.Fragment,{children:e})},$pe=DYi,uC=(e,{castShadow:t=!0,receiveShadow:n=!0}={})=>{e.traverse((o)=>{if(!(o instanceof Mo))return;o.castShadow=t,o.receiveShadow=n})},NYi=({positionOffset:e,footprint:t,rotationOffset:n,onHover:o,onUnhover:r,isHovered:i,scale:s,isTranslucent:a=!1})=>{let{rootObject:c}=rg(),l=Tte.useMemo(()=>{if(!t)return null;let{geometries:h}=tut(t,wYi),d=new Ba;for(let u of h.flat(1/0)){let _=u.geom;if(!_||!_.polygons&&!_.sides)continue;let p=new No(u.color);p.convertLinearToSRGB();let m={..._,color:[p.r,p.g,p.b]},A=J0e(m),g=new vs({vertexColors:!0,side:bd,transparent:a,opacity:a?0.5:1,depthWrite:!a}),f=new Mo(A,g);f.renderOrder=a?2:1,uC(f,{castShadow:!a,receiveShadow:!0}),d.add(f)}return d},[t,a]);if(Tte.useEffect(()=>{if(!l||!c)return;return c.add(l),()=>{c.remove(l)}},[c,l]),Tte.useEffect(()=>{if(!l)return;if(e)l.position.fromArray(e);if(n)l.rotation.fromArray(n);if(s!==void 0)l.scale.setScalar(s)},[l,e?.[0],e?.[1],e?.[2],n?.[0],n?.[1],n?.[2],s]),Tte.useEffect(()=>{if(!l)return;l.traverse((h)=>{if(h instanceof Mo&&h.material instanceof vs)if(i)h.material.emissive.setHex(255),h.material.emissiveIntensity=0.2;else h.material.emissiveIntensity=0})},[i,l]),!l)return null;return Geo.jsx($pe,{isHovered:i,onHover:o,onUnhover:r,object:l})},FKn=new WeakMap,RYi=()=>{let e=new vl;return e.name="fallback-environment-map",e.mapping=e5t,e},QYi=(e)=>{if(!e)return null;let t=e,n=FKn.get(t);if(n)return n;let o;if(e instanceof d3){let r=new zre(e);o=r.fromScene(sut(),0.04).texture,r.dispose()}else o=RYi();return FKn.set(t,o),o};function kYi(e){let t=new Mu,n=!1;e.updateWorldMatrix(!0,!1);let o=e.parent?e.parent.matrixWorld.clone().invert():new Gi;return e.traverse((r)=>{if(r.updateWorldMatrix(!0,!1),r instanceof Mo&&r.geometry){if(!r.geometry.boundingBox)r.geometry.computeBoundingBox();if(r.geometry.boundingBox){let i=o.clone().multiply(r.matrixWorld),s=r.geometry.boundingBox.clone();if(s.applyMatrix4(i),!n)t.copy(s),n=!0;else t.union(s)}}}),n?t:null}function LYi(e){let t=kYi(e);if(!t)return new Et;return t.getSize(new Et)}function HYi(e,t,n="contain_within_bounds"){if(!t)return[1,1,1];let o=LYi(e),r=[o.x>0?t[0]/o.x:1,o.y>0?t[1]/o.y:1,o.z>0?t[2]/o.z:1];if(n==="fill_bounds")return r;let i=Math.min(...r);return[i,i,i]}var Opt=({model:e,position:t,rotation:n,modelOffset:o=[0,0,0],modelRotation:r=[0,0,0],sourceCoordinateTransform:i,modelSize:s,modelFitMode:a="contain_within_bounds",scale:c})=>{let{rootObject:l}=rg(),h=hC.useMemo(()=>new Ba,[]),d=hC.useMemo(()=>new Ba,[]),u=hC.useMemo(()=>new Ba,[]),_=hC.useMemo(()=>new Ba,[]);return hC.useEffect(()=>(h.add(d),()=>{h.remove(d)}),[h,d]),hC.useEffect(()=>(d.add(u),()=>{d.remove(u)}),[d,u]),hC.useEffect(()=>(u.add(_),()=>{u.remove(_)}),[u,_]),hC.useEffect(()=>{while(_.children.length>0){let p=_.children[0];if(!p)break;_.remove(p)}if(e)_.add(e)},[_,e]),hC.useEffect(()=>{if(!i){_.matrixAutoUpdate=!0,_.position.set(0,0,0),_.rotation.set(0,0,0),_.scale.set(1,1,1),_.updateMatrix();return}_.matrixAutoUpdate=!1,_.matrix.copy(i),_.matrixWorldNeedsUpdate=!0},[_,i]),hC.useEffect(()=>{if(!l)return;return l.add(h),()=>{l.remove(h)}},[l,h]),hC.useEffect(()=>{if(t)h.position.fromArray(t);else h.position.set(0,0,0);if(n)h.rotation.fromArray(n);else h.rotation.set(0,0,0);if(u.position.fromArray(o),u.rotation.fromArray(r),u.scale.setScalar(c??1),!e){d.scale.set(1,1,1);return}d.scale.set(1,1,1),d.updateWorldMatrix(!0,!0);let p=HYi(u,s,a);d.scale.set(p[0],p[1],p[2])},[h,d,e,a,o,_,u,r,s,t,n,c]),{boardTransformGroup:h}},zKn=1.25;function Weo({gltfUrl:e,position:t,rotation:n,modelOffset:o=[0,0,0],modelRotation:r=[0,0,0],sourceCoordinateTransform:i,modelSize:s,modelFitMode:a="contain_within_bounds",onHover:c,onUnhover:l,isHovered:h,scale:d,isTranslucent:u=!1}){let{renderer:_}=rg(),[p,m]=oU.useState(null),[A,g]=oU.useState(null),{boardTransformGroup:f}=Opt({model:p,position:t,rotation:n,modelOffset:o,modelRotation:r,sourceCoordinateTransform:i,modelSize:s,modelFitMode:a,scale:d});if(oU.useEffect(()=>{if(!e)return;let y=new pte,x=!0;return y.load(e,(C)=>{if(!x)return;let b=C.scene;b.traverse((I)=>{if(I instanceof Mo&&I.material){let v=(P)=>{P.transparent=u,P.opacity=u?0.5:1,P.depthWrite=!u,P.needsUpdate=!0};if(Array.isArray(I.material))I.material.forEach(v);else v(I.material);I.renderOrder=u?2:1}}),uC(b,{castShadow:!u,receiveShadow:!0}),m(b)},void 0,(C)=>{if(!x)return;console.error(`An error happened loading ${e}`,C);let b=C instanceof Error?C:Error(`Failed to load glTF model from ${e}`);g(b)}),()=>{x=!1}},[e,u]),oU.useEffect(()=>{if(!p||!_)return;let y=QYi(_);if(!y)return;let x=[],C=(b)=>{if(!(b instanceof vs))return;if(x.push({material:b,envMap:b.envMap??null,envMapIntensity:b.envMapIntensity??1}),b.envMap=y,typeof b.envMapIntensity!=="number"||b.envMapIntensity<zKn)b.envMapIntensity=zKn;b.needsUpdate=!0};return p.traverse((b)=>{if(!(b instanceof Mo))return;let I=b.material;if(Array.isArray(I))I.forEach(C);else if(I)C(I)}),()=>{x.forEach(({material:b,envMap:I,envMapIntensity:v})=>{b.envMap=I,b.envMapIntensity=v,b.needsUpdate=!0})}},[p,_]),oU.useEffect(()=>{if(!p)return;p.traverse((y)=>{if(!(y instanceof Mo))return;let x=Array.isArray(y.material)?y.material:[y.material];for(let C of x){if(!(C instanceof vs))continue;if(h)C.emissive.setHex(255),C.emissiveIntensity=0.2;else C.emissiveIntensity=0}})},[h,p]),A)throw A;if(!p)return null;return Ueo.jsx($pe,{isHovered:h,onHover:c,onUnhover:l,object:f})}var FYi=ih(weo(),1),zYi=ih(Hwe(),1),OYi=({jscadPlan:e,positionOffset:t,rotationOffset:n,modelOffset:o=[0,0,0],modelRotation:r=[0,0,0],sourceCoordinateTransform:i,modelSize:s,modelFitMode:a="contain_within_bounds",onHover:c,onUnhover:l,isHovered:h,scale:d,isTranslucent:u=!1})=>{let[_,p]=Dte.useState(null);Dte.useEffect(()=>{let g=(0,FYi.executeJscadOperations)(zYi.default,e);if(!g||!g.polygons&&!g.sides){p(null);return}let f=J0e(g),y=new vs({vertexColors:!0,side:bd}),x=new Mo(f,y);return p(x),()=>{f.dispose(),y.dispose()}},[e]),Dte.useEffect(()=>{if(!_)return;let g=_.material;g.transparent=u,g.opacity=u?0.5:1,g.depthWrite=!u,g.needsUpdate=!0,_.renderOrder=u?2:1,uC(_,{castShadow:!u,receiveShadow:!0})},[_,u]);let m=_?.material,{boardTransformGroup:A}=Opt({model:_,position:t,rotation:n,modelOffset:o,modelRotation:r,sourceCoordinateTransform:i,modelSize:s,modelFitMode:a,scale:d});if(Dte.useEffect(()=>{if(!m)return;if(h){let g=new No(m.color.getHex());m.emissive.copy(g),m.emissive.setRGB(0,0,1),m.emissiveIntensity=0.2}else m.emissiveIntensity=0},[h,m]),!_)return null;return Xeo.jsx($pe,{isHovered:h,onHover:c,onUnhover:l,object:A})};function VYi(e){return e.replace(/(DEF|USE)\s+([^\s]+)/g,(t,n,o)=>`${n} ${o.replace(/-/g,"_")}`)}async function YYi(e){let t=await fetch(e);if(!t.ok)throw Error(`Failed to fetch "${e}": ${t.status} ${t.statusText}`);let n=await t.text();return new oMe().parse(VYi(n),e)}if(typeof window<"u"&&!window.TSCIRCUIT_OBJ_LOADER_CACHE)window.TSCIRCUIT_OBJ_LOADER_CACHE=new Map;function GYi(e){let[t,n]=Vwe.useState(null);return Vwe.useEffect(()=>{if(!e)return;let o=e.replace(/&cachebust_origin=$/,""),r=window.TSCIRCUIT_OBJ_LOADER_CACHE,i=!1;async function s(){try{if(o.endsWith(".wrl"))return await YYi(o);let c=await fetch(o);if(!c.ok)throw Error(`Failed to fetch "${o}": ${c.status} ${c.statusText}`);let l=await c.text(),h=l.match(/newmtl[\s\S]*?endmtl/g),d=new rMe;if(h?.length){let u=h.join(`
`).replace(/^d\s+0\./gm,"d 1."),_=l.replace(/newmtl[\s\S]*?endmtl/g,"").replace(/^mtllib.*/gm,""),p=new nMe;p.setMaterialOptions({invertTrProperty:!0});let m=p.parse(u,"embedded.mtl");return d.setMaterials(m),d.parse(_)}return d.parse(l.replace(/^mtllib.*/gm,""))}catch(c){return c}}function a(){if(r.has(o)){let l=r.get(o);if(l.result)return Promise.resolve(l.result.clone());return l.promise.then((h)=>{if(h instanceof Error)return h;return h.clone()})}let c=s().then((l)=>{if(l instanceof Error)return l;return r.set(o,{...r.get(o),result:l}),l});return r.set(o,{promise:c,result:null}),c}return a().then((c)=>{if(i)return;n(c)}).catch((c)=>{console.error(c)}),()=>{i=!0}},[e]),t}function UYi({url:e,position:t,rotation:n,modelOffset:o=[0,0,0],modelRotation:r=[0,0,0],sourceCoordinateTransform:i,modelSize:s,modelFitMode:a="contain_within_bounds",onHover:c,onUnhover:l,isHovered:h,scale:d,isTranslucent:u=!1}){let _=GYi(e),p=jeo.useMemo(()=>{if(_&&!(_ instanceof Error))return _.traverse((g)=>{if(g instanceof Mo&&g.material){let f=(y)=>{y.transparent=u,y.opacity=u?0.5:1,y.depthWrite=!u,y.needsUpdate=!0};if(Array.isArray(g.material))g.material.forEach(f);else f(g.material);g.renderOrder=u?2:1}}),uC(_,{castShadow:!u,receiveShadow:!0}),_;let A=new Mo(new S_(0.5,0.5,0.5),new vs({transparent:!0,color:"red",opacity:0.25}));return uC(A,{castShadow:!1,receiveShadow:!0}),A},[_,u]),{boardTransformGroup:m}=Opt({model:p,position:Array.isArray(t)?t:t?[t.x,t.y,t.z]:void 0,rotation:Array.isArray(n)?n:n?[n.x,n.y,n.z]:void 0,modelOffset:o,modelRotation:r,sourceCoordinateTransform:i,modelSize:s,modelFitMode:a,scale:d});if(_ instanceof Error)throw _;return Keo.jsx($pe,{isHovered:h,onHover:c,onUnhover:l,object:m})}var WYi=new No(0.82,0.82,0.82),OKn=(e)=>new vs({color:e?new No(e[0],e[1],e[2]):WYi});function XYi(e,t){let n=OKn(t.color),o=t.brep_faces??[];if(o.length===0)return[n];let r=o.length>1?[...o].sort((d,u)=>d.first-u.first):o,i=[n],s=new Map,a=t.index.array.length/3,c=0,l=0,h=(d)=>{if(!d)return 0;let u=d.join(","),_=s.get(u);if(_!==void 0)return _;let p=i.length;return i.push(OKn(d)),s.set(u,p),p};while(c<a){let d=r[l],u=a,_=0;if(d)if(c<d.first)u=d.first;else u=d.last+1,_=h(d.color),l+=1;if(u>c)e.addGroup(c*3,(u-c)*3,_);c=u}return i}function jYi(e){let t=new Ba;for(let n of e){let o=n.attributes.position?.array??[],r=n.index?.array??[];if(!o.length||!r.length)continue;let i=new js;i.setAttribute("position",new Wr(o,3));let s=n.attributes.normal?.array??[];if(s.length)i.setAttribute("normal",new Wr(s,3));else i.computeVertexNormals();i.setIndex(r),i.clearGroups();let a=XYi(i,n),c=new Mo(i,a.length>1?a:a[0]);c.name=n.name,t.add(c)}return t}var MMe;function KYi(e){if(typeof e==="function")return e;if(e&&typeof e==="object"&&"default"in e&&typeof e.default==="function")return e.default;throw Error("Unable to resolve occt-import-js factory export")}async function $Yi(){if(!MMe)MMe=(async()=>{let e=await import(Epe("occt-import-js","0.0.23","+esm"));return KYi(e)({locateFile:(n)=>Epe("occt-import-js","0.0.23",`dist/${n}`)})})().catch((e)=>{throw MMe=void 0,e});return MMe}async function qYi(e){let t=await fetch(e);if(!t.ok)throw Error(`Failed to fetch STEP file: ${t.statusText}`);let n=await t.arrayBuffer(),r=(await $Yi()).ReadStepFile(new Uint8Array(n),null);if(!r.success||!r.meshes.length)throw Error("occt-import-js failed to convert STEP file");let i=jYi(r.meshes),s=new dte;return await new Promise((c,l)=>{s.parse(i,(h)=>{if(h instanceof ArrayBuffer)c(h);else l(Error("GLTFExporter did not return binary output"))},(h)=>{l(h)},{binary:!0})})}var qeo="step-glb-cache:v2:";function JYi(e){let t=new Uint8Array(e),n=32768,o="";for(let r=0;r<t.length;r+=32768){let i=t.subarray(r,r+32768);o+=String.fromCharCode(...i)}return btoa(o)}function ZYi(e){let t=atob(e),n=new Uint8Array(t.length);for(let o=0;o<t.length;o+=1)n[o]=t.charCodeAt(o);return n.buffer}function eGi(e){try{let t=localStorage.getItem(`${qeo}${e}`);if(!t)return null;return ZYi(t)}catch(t){return console.warn("Failed to read STEP GLB cache",t),null}}function VKn(e,t){try{let n=JYi(t);localStorage.setItem(`${qeo}${e}`,n)}catch(n){console.warn("Failed to write STEP GLB cache",n)}}function tGi(){let e=globalThis;if(!e.stepUrlToGltfModelConversions)e.stepUrlToGltfModelConversions={inProgress:new Map,completed:new Map};return e.stepUrlToGltfModelConversions}var nGi=({stepUrl:e,position:t,rotation:n,modelOffset:o,modelRotation:r,sourceCoordinateTransform:i,modelSize:s,modelFitMode:a,scale:c,onHover:l,onUnhover:h,isHovered:d,isTranslucent:u})=>{let[_,p]=Ywe.useState(null);if(Ywe.useEffect(()=>{let m=!0,A=null,g=!0,f=tGi(),y=eGi(e);if(y){let b={arrayBuffer:y,blobUrl:URL.createObjectURL(new Blob([y],{type:"model/gltf-binary"}))};return f.completed.set(e,b),A=b.blobUrl,g=!1,p(b.blobUrl),()=>{if(m=!1,A&&g)URL.revokeObjectURL(A)}}let x=f.completed.get(e);if(x)return A=x.blobUrl,g=!1,p(x.blobUrl),VKn(e,x.arrayBuffer),()=>{if(m=!1,A&&g)URL.revokeObjectURL(A)};let C=f.inProgress.get(e);if(!C)C=qYi(e).then((b)=>{let I={arrayBuffer:b,blobUrl:URL.createObjectURL(new Blob([b],{type:"model/gltf-binary"}))};return f.completed.set(e,I),f.inProgress.delete(e),I}).catch((b)=>{throw f.inProgress.delete(e),b}),f.inProgress.set(e,C);return C.then((b)=>{if(!m)return;A=b.blobUrl,g=!1,p(b.blobUrl),VKn(e,b.arrayBuffer)}).catch((b)=>{if(console.error("Failed to convert STEP file to GLB",b),m)p(null)}),()=>{if(m=!1,A&&g)URL.revokeObjectURL(A)}},[e]),!_)return null;return $eo.jsx(Weo,{gltfUrl:_,position:t,rotation:n,modelOffset:o,modelRotation:r,sourceCoordinateTransform:i,modelSize:s,modelFitMode:a,scale:c,onHover:l,onUnhover:h,isHovered:d,isTranslucent:u})};function jMe(e,t){let{x:n,y:o,z:r}=e;if(t.axisMapping){let i={x:n,y:o,z:r};if(t.axisMapping.x)n=Kut(i,t.axisMapping.x);if(t.axisMapping.y)o=Kut(i,t.axisMapping.y);if(t.axisMapping.z)r=Kut(i,t.axisMapping.z)}if(n*=t.flipX??1,o*=t.flipY??1,r*=t.flipZ??1,t.rotation){if(t.rotation.x){let i=t.rotation.x*Math.PI/180,s=Math.cos(i),a=Math.sin(i),c=o*s-r*a,l=o*a+r*s;o=c,r=l}if(t.rotation.y){let i=t.rotation.y*Math.PI/180,s=Math.cos(i),a=Math.sin(i),c=n*s+r*a,l=-n*a+r*s;n=c,r=l}if(t.rotation.z){let i=t.rotation.z*Math.PI/180,s=Math.cos(i),a=Math.sin(i),c=n*s-o*a,l=n*a+o*s;n=c,o=l}}return{x:n,y:o,z:r}}function Kut(e,t){switch(t){case"x":return e.x;case"y":return e.y;case"z":return e.z;case"-x":return-e.x;case"-y":return-e.y;case"-z":return-e.z;default:return 0}}var $ut={Z_UP_TO_Y_UP:{axisMapping:{x:"x",y:"-z",z:"y"}},Z_OUT_OF_TOP:{axisMapping:{x:"x",y:"z",z:"-y"}},STEP_INVERTED:{axisMapping:{x:"-x",y:"z",z:"-y"}},USB_PORT_FIX:{flipY:-1},Z_UP_TO_Y_UP_USB_FIX:{axisMapping:{x:"x",y:"-z",z:"y"},flipZ:-1},FOOTPRINTER_MODEL_TRANSFORM:{axisMapping:{x:"x",y:"-z",z:"y"},flipX:-1,rotation:{x:180,y:180}},IDENTITY:{},TEST_ROTATE_X_90:{axisMapping:{x:"x",y:"-z",z:"y"},rotation:{x:90}},TEST_ROTATE_X_270:{axisMapping:{x:"x",y:"-z",z:"y"},rotation:{x:270}},TEST_ROTATE_Y_90:{axisMapping:{x:"x",y:"-z",z:"y"},rotation:{y:90}},TEST_ROTATE_Y_270:{axisMapping:{x:"x",y:"-z",z:"y"},rotation:{y:270}},TEST_ROTATE_Z_90:{axisMapping:{x:"x",y:"-z",z:"y"},rotation:{z:90}},TEST_ROTATE_Z_270:{axisMapping:{x:"x",y:"-z",z:"y"},rotation:{z:270}},TEST_FLIP_X:{axisMapping:{x:"x",y:"-z",z:"y"},flipX:-1},TEST_FLIP_Z:{axisMapping:{x:"x",y:"-z",z:"y"},flipZ:-1},OBJ_Z_UP_TO_Y_UP:{axisMapping:{x:"x",y:"z",z:"y"}}};function oGi(e,t){if(t.coordinateTransform)return t.coordinateTransform;if(t.usingGlbCoordinates)return;if(t.hasFootprinterModel)return $ut.FOOTPRINTER_MODEL_TRANSFORM;if(t.usingObjFormat)return;if(t.usingStepFormat)return $ut.STEP_INVERTED;return $ut.Z_UP_TO_Y_UP_USB_FIX}function vpe(e,t){return oGi(e,{usingGlbCoordinates:t==="gltf"||t==="glb"||t==="jscad",usingObjFormat:t==="obj"||t==="wrl",usingStepFormat:t==="step",hasFootprinterModel:t==="footprinter"})}function wMe(e){if(!e)return;let t=jMe({x:1,y:0,z:0},e),n=jMe({x:0,y:1,z:0},e),o=jMe({x:0,y:0,z:1},e);return new Gi().makeBasis(new Et(t.x,t.y,t.z),new Et(n.x,n.y,n.z),new Et(o.x,o.y,o.z))}function oH(e){return e*Math.PI/180}function rGi(e){if(e==="z+")return[0,0,0];switch(e){case"x+":return[0,oH(-90),0];case"x-":return[0,oH(90),0];case"y+":return[oH(90),0,0];case"y-":return[oH(-90),0,0];case"z-":return[oH(180),0,0];default:return[0,0,0]}}function iGi(e,t,n){if(!e.position)return;let o=e.position.z;if(!e.is_on_folded_board&&e.pcb_component_id&&t==="bottom"&&e.position.z>=0)o=-(e.position.z+n);return[e.position.x,e.position.y,o]}function sGi(e,t){if(!e.rotation)return t==="bottom"?[Math.PI,0,0]:[0,0,0];return[oH(e.rotation.x),oH(e.rotation.y),oH(e.rotation.z)]}function aGi(e,t){let n=new Et(e.x,e.y,e.z),o=new FA(t[0],t[1],t[2],"XYZ");return n.applyEuler(o),[n.x,n.y,n.z]}function cGi(e,t,n){if(!e.model_origin_position)return[0,0,0];let o=t?jMe(e.model_origin_position,t):e.model_origin_position;return aGi(o,n)}function lGi(e,t){let n=iGi(e,t.layer,t.pcbThickness),o=sGi(e,t.layer),r=vpe(e,t.modelType),i=rGi(e.model_board_normal_direction??"z+"),s=cGi(e,r,i);return{position:n,rotation:o,modelPosition:[-s[0],-s[1],-s[2]],modelRotation:i,scale:e.model_unit_to_mm_scale_factor??void 0,fitMode:e.model_object_fit??"contain_within_bounds",size:e.size?[e.size.x,e.size.y,e.size.z]:void 0}}var hGi=(e)=>{if(e.model_glb_url||e.model_gltf_url)return e.model_glb_url?"glb":"gltf";if(e.model_obj_url||e.model_wrl_url||e.model_stl_url){if(e.model_wrl_url)return"wrl";if(e.model_stl_url)return"stl";return"obj"}if(e.model_jscad)return"jscad";if(e.footprinter_string)return"footprinter";if(e.model_step_url)return"step";return"unknown"},dGi=(e)=>e==="step"?"glb":e,uGi=(e,t)=>{if(!e.pcb_component_id||!e.model_jscad||e.model_origin_alignment!=="bottom_center_of_component")return!1;let n=t.find((o)=>o.type==="pcb_component"&&o.pcb_component_id===e.pcb_component_id);return Boolean(n&&n.do_not_place&&n.is_allowed_to_be_off_board&&n.obstructs_within_bounds===!1)},pGi=(e,t)=>{if(!e)return;return t?t(e):e},mGi=(...e)=>e,Vpt=class extends Jeo.default.Component{constructor(e){super(e);this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}render(){if(this.state.hasError&&this.state.error)return this.props.fallback({error:this.state.error});return this.props.children}},_Gi=({error:e,onError:t})=>(gf.useEffect(()=>{t(e)},[e,t]),null),Zeo=({cad_component:e,circuitJson:t,resolveStaticAsset:n})=>{let o=Heo(t),[r,i]=gf.useState(!1),{visibility:s}=pU(),[a,c]=gf.useState(null),l=gf.useCallback((O)=>{if(O?.mousePosition)i(!0),c(O.mousePosition);else i(!1),c(null)},[]),h=gf.useCallback(()=>{i(!1),c(null)},[]),d=gf.useMemo(()=>Vo(t).source_component.getUsing({source_component_id:e.source_component_id})?.name,[t,e.source_component_id]),{pcbComponent:u,layer:_,isThroughHole:p}=gf.useMemo(()=>PYi(e,t),[e,t]),m=gf.useCallback((O)=>pGi(O,n),[n]),A=m(e.model_wrl_url??e.model_stl_url??e.model_obj_url),g=m(e.model_glb_url??e.model_gltf_url),f=m(e.model_step_url),[y,x]=gf.useState(0),[C,b]=gf.useState(null);gf.useEffect(()=>{x(0),b(null)},[e.cad_component_id,A,g,f]);let I=gf.useMemo(()=>uGi(e,t),[e,t]),v=I?s.enclosure==="translucent":Boolean(e.show_as_translucent_model),P=hGi(e),M=dGi(P),B=e.model_glb_url?"glb":"gltf",T=e.model_wrl_url?"wrl":e.model_stl_url?"stl":"obj",N=gf.useMemo(()=>lGi(e,{layer:_,pcbThickness:o,modelType:M}),[e,_,o,M]),D=mGi(...N.rotation),L=N.position,H=gf.useMemo(()=>{let O=[];if(g)O.push(h4.jsx(Weo,{gltfUrl:g,position:L,rotation:D,modelOffset:N.modelPosition,modelRotation:N.modelRotation,sourceCoordinateTransform:wMe(vpe(e,B)),scale:N.scale,modelSize:N.size,modelFitMode:N.fitMode,onHover:l,onUnhover:h,isHovered:r,isTranslucent:v},`${e.cad_component_id}-gltf-${g}`));if(A)O.push(h4.jsx(UYi,{url:A,position:L,rotation:D,modelOffset:N.modelPosition,modelRotation:N.modelRotation,sourceCoordinateTransform:wMe(vpe(e,T)),scale:N.scale,modelSize:N.size,modelFitMode:N.fitMode,onHover:l,onUnhover:h,isHovered:r,isTranslucent:v},`${e.cad_component_id}-mixed-${A}`));if(f&&!e.model_jscad&&!e.footprinter_string)O.push(h4.jsx(nGi,{stepUrl:f,position:L,rotation:D,modelOffset:N.modelPosition,modelRotation:N.modelRotation,sourceCoordinateTransform:wMe(vpe(e,M)),scale:N.scale,modelSize:N.size,modelFitMode:N.fitMode,onHover:l,onUnhover:h,isHovered:r,isTranslucent:v},`${e.cad_component_id}-step-${f}`));return O},[L,e.cad_component_id,e.footprinter_string,e.model_jscad,v,g,B,l,h,r,T,N.modelPosition,N.modelRotation,N.scale,N.fitMode,N.size,M,D,f,A]),V=null;if(H.length>0){if(y>=H.length){if(C)throw C;return null}V=h4.jsx(Vpt,{fallback:({error:O})=>h4.jsx(_Gi,{error:O,onError:(U)=>{b(U),x((j)=>Math.max(j,y+1))}}),children:H[y]},`${e.cad_component_id}-fallback-${y}`)}else if(e.model_jscad)V=h4.jsx(OYi,{jscadPlan:e.model_jscad,positionOffset:L,rotationOffset:D,modelOffset:N.modelPosition,modelRotation:N.modelRotation,sourceCoordinateTransform:wMe(vpe(e,"jscad")),scale:N.scale,modelSize:N.size,modelFitMode:N.fitMode,onHover:l,onUnhover:h,isHovered:r,isTranslucent:v},e.cad_component_id);else if(e.footprinter_string)V=h4.jsx(NYi,{positionOffset:L,rotationOffset:D,footprint:e.footprinter_string,scale:N.scale,onHover:l,onUnhover:h,isHovered:r,isTranslucent:v});if(I){if(s.enclosure==="hidden")return null}else if(e.show_as_translucent_model){if(!s.translucentModels)return null}else if(u){if(p&&!s.throughHoleModels)return null;if(!p&&!s.smtModels)return null}return h4.jsxs(h4.Fragment,{children:[h4.jsx(CYi,{cadComponent:e,children:V}),r&&a?h4.jsx(zeo,{position:a,style:{fontFamily:"sans-serif",transform:"translate3d(1rem, 1rem, 0)",backgroundColor:"white",padding:"5px",borderRadius:"3px",pointerEvents:"none",userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none"},children:d??"<unknown>"}):null]})},eto={name:"@tscircuit/3d-viewer",version:"0.0.626",repository:{type:"git",url:"https://github.com/tscircuit/3d-viewer"},main:"./dist/index.js",module:"./dist/index.js",type:"module",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js"}},files:["dist"],scripts:{start:"bun run storybook","dev:old":"bunx --bun vite",build:"tsup",prepublish:"npm run build",preview:"vite preview",storybook:"storybook dev -p 6006","build-storybook":"bun run prepare:renderer-comparisons && storybook build","vercel-build":"bun run build-storybook",format:"biome format . --write","format:check":"biome format .","test:node-bundle":"node ./scripts/load-bundle-in-node.js","prepare:renderer-comparisons":"bun scripts/prepare-renderer-comparisons.ts","storybook:comparisons":"bun run prepare:renderer-comparisons && bun run storybook --initial-path '/story/diagnostics-renderer-parity--x-rotation'","test:renderer-comparisons:serve":"bun run prepare:renderer-comparisons && vite --config playwright/vite.config.ts","test:renderer-calibration":"playwright test --project=calibration","test:renderer-comparisons":"bun scripts/run-renderer-comparisons.ts"},dependencies:{"@jscad/regl-renderer":"^2.6.12","@jscad/stl-serializer":"^2.1.20","@tscircuit/cableprinter":"^0.0.6","circuit-json":"^0.0.525","circuit-to-canvas":"^0.0.135","jscad-electronics":"^0.0.213","react-hot-toast":"^2.6.0",three:"^0.165.0","three-stdlib":"^2.36.0","troika-three-text":"^0.52.4"},peerDependencies:{zod:"*",react:"19.1.0","react-dom":"19.1.0","@tscircuit/core":"*","@tscircuit/circuit-json-util":"*"},devDependencies:{"@tscircuit/flex-utils":"https://jscdn.tscircuit.com/@tscircuit/flex-utils/0.0.5.tgz","@biomejs/biome":"^2.1.4","@chromatic-com/storybook":"^1.9.0","@jscad/modeling":"^2.12.5","@napi-rs/canvas":"^1.0.9","@playwright/test":"1.58.2","@radix-ui/react-dropdown-menu":"^2.1.16","@storybook/blocks":"9.0.0-alpha.17","@storybook/react-vite":"^9.1.5","@tscircuit/alphabet":"^0.0.25","@tscircuit/circuit-json-util":"^0.0.119","@tscircuit/copper-pour-solver":"^0.0.29","@tscircuit/core":"^0.0.2152","@tscircuit/props":"^0.0.701","@tscircuit/solver-utils":"^0.0.4","@types/debug":"^4.1.13","@types/jsdom":"^21.1.7","@types/react":"19","@types/react-dom":"19","@types/three":"^0.165.0","@vitejs/plugin-react":"^4.3.4","bun-match-svg":"^0.0.9","bun-types":"1.2.1",debug:"^4.4.0","jscad-planner":"^0.0.18",jsdom:"^26.0.0","manifold-3d":"3.5.1","react-use-gesture":"^9.1.3",semver:"^7.7.0","strip-ansi":"^7.1.0",tscircuit:"^0.0.2611",tsup:"^8.3.6",typescript:"^5.7.3",vite:"^7.1.5","vite-tsconfig-paths":"^4.3.2","circuit-json-to-gltf":"0.0.143",zod:"^3.25.67","@tscircuit/modelprinter":"^0.0.18"},engines:{node:"24.x"}},nto="cadViewerLightingEnabled",gGi=()=>{if(typeof window>"u")return!0;return window.localStorage.getItem(nto)!=="false"},oto=j6.createContext(void 0),AGi=({children:e})=>{let[t,n]=j6.useState(!1),[o,r]=j6.useState(!1),[i,s]=j6.useState(gGi);j6.useEffect(()=>{window.localStorage.setItem(nto,i?"true":"false")},[i]);let a=j6.useMemo(()=>({darkBackgroundEnabled:t,setDarkBackgroundEnabled:n,gridEnabled:o,setGridEnabled:r,lightingEnabled:i,setLightingEnabled:s}),[t,o,i]);return tto.jsx(oto.Provider,{value:a,children:e})},Ypt=()=>{let e=j6.useContext(oto);if(!e)throw Error("useAppearance must be used within an AppearanceProvider");return e},YKn="cadViewerCameraStateSession";function rto(e){if(!e)return YKn;return`${YKn}:${e}`}function fGi({camera:e,controls:t,cameraSessionScope:n}){try{let o={position:e.position.toArray(),quaternion:e.quaternion.toArray(),up:e.up.toArray(),fov:e instanceof Pc?e.fov:50,target:t.target.toArray()};sessionStorage.setItem(rto(n),JSON.stringify(o))}catch(o){console.warn("Failed to save camera:",o)}}function yGi({camera:e,controls:t,cameraSessionScope:n}){try{let o=sessionStorage.getItem(rto(n));if(!o)return!1;let r=JSON.parse(o);if(e.position.fromArray(r.position),e.quaternion.fromArray(r.quaternion),e.up.fromArray(r.up),e instanceof Pc)e.fov=r.fov,e.updateProjectionMatrix();return t.target.fromArray(r.target),t.update(),e.updateMatrixWorld(),!0}catch(o){return console.warn("Failed to restore camera:",o),!1}}function sto(e){if("controls"in e)return e;return{controls:e}}var ato=(e,t)=>{let{controls:n,cameraSessionScope:o}=sto(t);fGi({camera:e,controls:n,cameraSessionScope:o})},x0t=(e,t)=>{let{controls:n,cameraSessionScope:o}=sto(t);return yGi({camera:e,controls:n,cameraSessionScope:o})},cto=Af.createContext(void 0),xGi=({children:e,defaultTarget:t,initialCameraPosition:n,initialCameraType:o})=>{let r=Af.useRef(null),i=Af.useRef(null),[s,a]=Af.useState(null),[c,l]=Af.useState(o??"perspective"),[h,d]=Af.useState(n??null),[u,_]=Af.useState(new FA(0,0,0)),p=Af.useMemo(()=>{let[f,y,x]=n??[5,-5,5],C=Math.hypot(f-t.x,y-t.y,x-t.z);return C>0?C:5},[n,t]),m=Af.useCallback((f)=>{let y=[t.x,t.y,t.z],x=i.current,C=r.current,b=p;if(x&&C)b=x.position.distanceTo(C.target);switch(f){case"Top Center Angled":{let I=b/Math.sqrt(2);return{position:[t.x,t.y-I,t.z+I],target:y,up:[0,0,1]}}case"Top Down":return{position:[t.x,t.y,t.z+b],target:y,up:[0,0,1]};case"Top Left Corner":return{position:[t.x-b*0.6,t.y-b*0.6,t.z+b*0.6],target:y,up:[0,0,1]};case"Top Right Corner":return{position:[t.x+b*0.6,t.y-b*0.6,t.z+b*0.6],target:y,up:[0,0,1]};case"Left Sideview":return{position:[t.x-b,t.y,t.z],target:y,up:[0,0,1]};case"Right Sideview":return{position:[t.x+b,t.y,t.z],target:y,up:[0,0,1]};case"Front":return{position:[t.x,t.y-b,t.z],target:y,up:[0,0,1]};case"Custom":default:return null}},[p,t,i,r]),A=Af.useCallback((f)=>{r.current=f},[]),g=Af.useMemo(()=>({controlsRef:r,mainCameraRef:i,defaultTarget:t,baseDistance:p,controller:s,setController:a,getPresetConfig:m,handleControlsChange:A,cameraType:c,setCameraType:l,cameraPosition:h,setCameraPosition:d,cameraRotation:u,setCameraRotation:_,saveCameraToSession:ato,loadCameraFromSession:x0t}),[t,p,s,m,A,c,h,u]);return ito.jsx(cto.Provider,{value:g,children:e})},VT=()=>{let e=Af.useContext(cto);if(!e)throw Error("useCameraController must be used within a CameraControllerProvider");return e},CGi=(e)=>e<0.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2,bGi=()=>{let{controlsRef:e,mainCameraRef:t,defaultTarget:n,setController:o,getPresetConfig:r}=VT(),i=d4.useRef(null),s=d4.useRef(new Eu),a=d4.useRef(new Et),c=d4.useRef(new Et),l=d4.useRef(new Eu),h=d4.useRef(new Eu),d=d4.useRef(new Sl),u=d4.useRef(new Sl),_=d4.useCallback(({position:m,target:A,up:g,durationMs:f=600})=>{if(!t.current)return;let y=e.current?.target??n,x=new Et(m[0],m[1],m[2]),C=A?new Et(A[0],A[1],A[2]):n.clone(),b=new Et(...g??[0,0,1]).normalize(),I=u.current;I.position.copy(x),I.up.copy(b),I.lookAt(C);let v=I.quaternion.clone(),P=t.current.quaternion.clone(),M=t.current.position.clone(),B=y.clone(),T=d.current;T.up.set(0,0,1),T.position.copy(M),T.lookAt(B);let N=T.quaternion.clone();T.up.set(0,0,1),T.position.copy(x),T.lookAt(C);let D=T.quaternion.clone(),L=N.clone().invert().multiply(P).normalize(),H=D.clone().invert().multiply(v).normalize();i.current={fromPosition:M,toPosition:x,fromTarget:B,toTarget:C,toQuaternion:v,rollFrom:L,rollTo:H,startTime:performance.now(),duration:f}},[t,e,n]),p=d4.useCallback((m)=>{if(m==="Custom")return;let A=r(m);if(!A)return;_(A)},[_,r]);return d4.useEffect(()=>{if(!t.current)return;return o({animateTo:_,animateToPreset:p}),()=>{o(null)}},[_,p,t,o]),jpe(()=>{if(!t.current||!i.current)return;let{fromPosition:m,toPosition:A,fromTarget:g,toTarget:f,toQuaternion:y,rollFrom:x,rollTo:C,startTime:b,duration:I}=i.current,v=performance.now()-b,P=I<=0?1:Math.min(v/I,1),M=CGi(P);t.current.position.lerpVectors(m,A,M);let B=a.current;B.copy(g).lerp(f,M);let T=d.current;T.up.set(0,0,1),T.position.copy(t.current.position),T.lookAt(B);let N=s.current;N.copy(T.quaternion);let D=l.current;D.copy(x);let L=h.current;if(L.copy(C),x.dot(C)<0)L.x*=-1,L.y*=-1,L.z*=-1,L.w*=-1;L.normalize(),D.slerp(L,M),t.current.quaternion.copy(N).multiply(D).normalize();let H=c.current;if(H.set(0,1,0).applyQuaternion(t.current.quaternion).normalize(),t.current.up.copy(H),e.current?.target.copy(B),t.current.updateMatrixWorld(),e.current?.update(),P>=1)t.current.position.copy(A),t.current.quaternion.copy(y),t.current.up.set(0,0,1),t.current.updateMatrixWorld(),e.current?.target.copy(f),e.current?.update(),i.current=null}),null},IGi=Symbol("camera-session-not-restored"),vGi=({cameraSessionScope:e}={})=>{let{controlsRef:t}=VT(),n=RT.useRef(null),o=RT.useRef(IGi),r=RT.useRef(null);RT.useEffect(()=>()=>{if(r.current!==null)clearTimeout(r.current),r.current=null},[e]);let i=RT.useCallback((a)=>{if(n.current=a,o.current!==e&&t.current){let c=x0t(a,{controls:t.current,cameraSessionScope:e});if(o.current=e,c)return}},[e,t]),s=RT.useCallback(()=>{if(!n.current||!t.current)return;if(o.current!==e){let a=x0t(n.current,{controls:t.current,cameraSessionScope:e});if(o.current=e,a)return}if(r.current!==null)clearTimeout(r.current);r.current=setTimeout(()=>{if(n.current&&t.current)ato(n.current,{controls:t.current,cameraSessionScope:e})},150)},[e,t]);return{handleCameraCreated:i,handleControlsChange:s}};function SGi(e){e.querySelectorAll("canvas").forEach((t)=>t.remove())}var PGi=(e)=>{e.outputColorSpace=_R,e.toneMapping=DAe,e.toneMappingExposure=1,e.shadowMap.enabled=!0,e.shadowMap.type=Zxt},EGi=sA.forwardRef(({children:e,scene:t,camera:n,style:o,onCreated:r},i)=>{let{cameraType:s}=VT(),a=sA.useRef(null),[c,l]=sA.useState(null),h=sA.useRef([]),d=sA.useRef(void 0);d.current=r;let u=sA.useRef(null),_=sA.useCallback((g)=>{h.current.push(g)},[]),p=sA.useCallback((g)=>{h.current=h.current.filter((f)=>f!==g)},[]),m=sA.useMemo(()=>new Dy,[]);if(t?.up)m.up.set(t.up.x,t.up.y,t.up.z);let A=sA.useRef(new Sl);return sA.useImperativeHandle(i,()=>A.current),sA.useEffect(()=>{if(!a.current)return;SGi(a.current);let g=new d3({antialias:!0,alpha:!0});PGi(g),g.setSize(a.current.clientWidth,a.current.clientHeight),g.setPixelRatio(window.devicePixelRatio),a.current.appendChild(g.domElement);let f=a.current.clientWidth/a.current.clientHeight,y=s==="perspective"?new Pc(75,f,0.1,1000):new r5(-10*f,10*f,10,-10,-1000,1000);if(u.current)y.position.copy(u.current.position),y.quaternion.copy(u.current.quaternion),y.up.copy(u.current.up);else{if(n?.up)y.up.set(n.up[0],n.up[1],n.up[2]);if(n?.position)y.position.set(n.position[0],n.position[1],n.position[2]);y.lookAt(0,0,0)}m.add(A.current),window.__TSCIRCUIT_THREE_OBJECT=A.current,l({scene:m,camera:y,renderer:g,rootObject:A.current,addFrameListener:_,removeFrameListener:p}),d.current?.({camera:y,renderer:g});let x,C=new LQe,b=!0,I=new IntersectionObserver(([M])=>{if(b=M?.isIntersecting??!1,b)P()});I.observe(a.current);let v=()=>{if(x=requestAnimationFrame(v),!b)return;let M=C.getElapsedTime(),B=C.getDelta();h.current.forEach((T)=>T(M,B)),g.render(m,y)};v();let P=()=>{if(a.current?.clientWidth&&a.current.clientHeight){let M=a.current.clientWidth/a.current.clientHeight;if(y instanceof Pc)y.aspect=M;else if(y instanceof r5)y.left=-10*M,y.right=10*M,y.top=10,y.bottom=-10;y.updateProjectionMatrix(),g.setSize(a.current.clientWidth,a.current.clientHeight)}};return window.addEventListener("resize",P),()=>{if(u.current={position:y.position.clone(),quaternion:y.quaternion.clone(),up:y.up.clone()},window.removeEventListener("resize",P),cancelAnimationFrame(x),I.disconnect(),a.current&&g.domElement)a.current.removeChild(g.domElement);if(g.dispose(),m.remove(A.current),window.__TSCIRCUIT_THREE_OBJECT===A.current)window.__TSCIRCUIT_THREE_OBJECT=void 0}},[m,_,p,s]),KMe.jsx("div",{ref:a,style:{width:"100%",height:"100%",...o},children:c&&KMe.jsx(Hpt.Provider,{value:c,children:KMe.jsx(TYi,{children:e})})})}),MGi=`
  varying vec3 worldPosition;
  void main() {
    worldPosition = (modelMatrix * vec4(position, 1.0)).xyz;
    gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
  }
`,wGi=`
  varying vec3 worldPosition;
  uniform float cellSize;
  uniform float sectionSize;
  uniform vec3 gridColor;
  uniform vec3 sectionColor;
  uniform float fadeDistance;
  uniform float fadeStrength;

  float getGrid(float size) {
    vec2 r = worldPosition.xy / size;
    vec2 grid = abs(fract(r - 0.5) - 0.5) / fwidth(r);
    float line = min(grid.x, grid.y);
    return 1.0 - min(line * 1.5, 1.0);
  }

  void main() {
    float g1 = getGrid(cellSize);
    float g2 = getGrid(sectionSize);

    float d = distance(worldPosition.xy, cameraPosition.xy);
    float a = 1.0 - smoothstep(fadeDistance, fadeDistance * fadeStrength, d);

    vec3 color = mix(gridColor, sectionColor, g2);

    gl_FragColor = vec4(color, max(g1, g2) * a);
    if (gl_FragColor.a <= 0.0) discard;
  }
`,BGi=({rotation:e,infiniteGrid:t,cellSize:n=1,sectionSize:o=10})=>{let{scene:r,camera:i}=rg(),s=1000,a=Gwe.useMemo(()=>{let c=new i1(1000,1000);c.rotateX(-Math.PI/2);let l=new l3({vertexShader:MGi,fragmentShader:wGi,uniforms:{cellSize:{value:n},sectionSize:{value:o},gridColor:{value:new No(15658734)},sectionColor:{value:new No(13421823)},fadeDistance:{value:100},fadeStrength:{value:1.5}},transparent:!0,side:bd}),h=new Mo(c,l);if(e)h.rotation.fromArray(e);return h},[1000,n,o,e]);return jpe(()=>{if(t)a.position.set(i.position.x,i.position.y,0)}),Gwe.useEffect(()=>{if(!r||!a)return;return r.add(a),()=>{if(r.remove(a),a.geometry.dispose(),Array.isArray(a.material))a.material.forEach((c)=>c.dispose());else a.material.dispose()}},[r,a]),null},qut=0.75,TGi=({boardDimensions:e,boardCenter:t,darkBackgroundEnabled:n=!1,shadowsEnabled:o=!1})=>{let{scene:r}=rg(),i=Mpe.useMemo(()=>{let s=new Ba;s.name="cad-viewer-light-rig";let a=t?.x??0,c=t?.y??0,l=Math.max(e?.width??0,e?.height??0,20),h=l*0.8,d=l,u=l*1.7,_=new kz(16186360,0.22);_.name="cad-viewer-soft-ambient",s.add(_);let p=new eie(15004141,1581597,0.2);p.name="cad-viewer-hemisphere",s.add(p);let m=(A,g,f,y,x=!1)=>{let C=new Qz(g,f);if(C.name=A,C.position.set(a+y[0],c+y[1],y[2]),C.target.position.set(a,c,0),C.castShadow=x,x){C.shadow.mapSize.set(2048,2048),C.shadow.bias=-0.0002,C.shadow.normalBias=0.03,C.shadow.radius=5;let b=C.shadow.camera;b.left=-h,b.right=h,b.top=h,b.bottom=-h,b.near=0.5,b.far=Math.max(l*4,Math.hypot(...y)+l*2),b.updateProjectionMatrix()}s.add(C),s.add(C.target)};return m("cad-viewer-key-light",16775406,1.35,[u*0.68,-u*0.8,u*1.08],o),m("cad-viewer-fill-light",14477554,0.25,[-d*0.85,d*0.55,d*0.75]),m("cad-viewer-rim-light",12184275,0.5,[-d*0.35,d*0.85,d*0.95]),m("cad-viewer-underside-key-light",16775406,1.35*qut,[u*0.68,-u*0.8,-u*1.08]),m("cad-viewer-underside-fill-light",14477554,0.25*qut,[-d*0.85,d*0.55,-d*0.75]),m("cad-viewer-underside-rim-light",12184275,0.5*qut,[-d*0.35,d*0.85,-d*0.95]),s},[t,e,o]);return Mpe.useEffect(()=>{let{background:s,environment:a}=r;return r.background=n?new No(1053456):null,r.environment=null,()=>{r.background=s,r.environment=a}},[n,r]),Mpe.useEffect(()=>{if(!r)return;return r.add(i),()=>{r.remove(i)}},[r,i]),null},DGi=0.05,NGi=({camera:e,initialOrbitDistance:t})=>{let n=Number.isFinite(t)?t*DGi:0;return Math.max(n,e.near,Number.EPSILON)},RGi=({camera:e,controls:t,minimumDollyDistance:n})=>{if(!(e instanceof Pc))return!1;let o=t.getDistance();if(Number.isFinite(o)&&o>=n)return!1;let r=new Et;return e.getWorldDirection(r),t.target.copy(e.position).addScaledVector(r,n),!0},QGi=({autoRotate:e,autoRotateSpeed:t,onStart:n,panSpeed:o,rotateSpeed:r,zoomSpeed:i,enableDamping:s,dampingFactor:a,target:c,onControlsChange:l})=>{let{camera:h,renderer:d}=rg(),u=NT.useMemo(()=>{if(!h||!d)return null;return new fut(h,d.domElement)},[h,d]),_=NT.useMemo(()=>{if(!u||!(h instanceof Pc))return Number.EPSILON;let p=c?Math.hypot(h.position.x-c[0],h.position.y-c[1],h.position.z-c[2]):u.getDistance();return NGi({camera:h,initialOrbitDistance:p})},[h,u,c]);return NT.useEffect(()=>(l?.(u??null),()=>l?.(null)),[u,l]),NT.useEffect(()=>{if(!u)return;let p=()=>{l?.(u)};return u.addEventListener("change",p),()=>{u.removeEventListener("change",p)}},[u,l]),NT.useEffect(()=>{if(!u)return;if(u.autoRotate=e||!1,u.autoRotateSpeed=t||1,o!==void 0)u.panSpeed=o;if(r!==void 0)u.rotateSpeed=r;if(i!==void 0)u.zoomSpeed=i;if(s!==void 0)u.enableDamping=s;if(a!==void 0)u.dampingFactor=a;if(u.zoomToCursor=!0,u.mouseButtons={LEFT:e2.ROTATE,MIDDLE:e2.PAN,RIGHT:null},c)u.target.set(c[0],c[1],c[2]),u.update()},[u,e,t,o,r,i,s,a,c]),NT.useEffect(()=>{if(!u||!n)return;return u.addEventListener("start",n),()=>{u.removeEventListener("start",n)}},[u,n]),NT.useEffect(()=>{if(!u)return;return()=>{u.dispose()}},[u]),jpe(()=>{if(!u)return;RGi({camera:h,controls:u,minimumDollyDistance:_}),u.update()},[h,u,_]),null},kGi=10,Gte={banana:{type:"banana",label:"Show Banana",width:190,height:60,depth:34,zCenter:17},"credit-card":{type:"credit-card",label:"Show Credit Card",width:85.6,height:53.98,depth:0.76,zCenter:0},"14in-macbook":{type:"14in-macbook",label:"Show 14in Macbook",width:312.6,height:221.2,depth:15.5,zCenter:0}},LGi=Object.values(Gte),HGi=[{type:null,label:"None"},...LGi],FGi=(e,t)=>e===t?null:t,C0t=(e)=>Number.isFinite(e)?Math.max(e??0,0):0,hwe=(e)=>Number.isFinite(e)?e??0:0,lto=(e,t,n)=>{let o=Gte[e],r=C0t(t?.width),i=hwe(n?.x),s=hwe(n?.y);return{x:i+r/2+kGi+o.width/2,y:s,z:0}},zGi=(e,t,n)=>{let o=Gte[e],r=C0t(t?.width),i=C0t(t?.height),s=hwe(n?.x),a=hwe(n?.y),c=lto(e,t,n);return{minX:Math.min(s-r/2,c.x-o.width/2),maxX:Math.max(s+r/2,c.x+o.width/2),minY:Math.min(a-i/2,c.y-o.height/2),maxY:Math.max(a+i/2,c.y+o.height/2),minZ:Math.min(0,c.z+o.zCenter-o.depth/2),maxZ:Math.max(0,c.z+o.zCenter+o.depth/2)}};function OGi(e,t){let n=new Eu().setFromEuler(new FA(e.x,e.y,e.z)),o=new Et(0,0,1);return o.applyQuaternion(n),o.multiplyScalar(t)}var VGi=()=>{let{mainCameraRef:e}=VT(),t=Uwe.useRef(null);return Uwe.useEffect(()=>{if(!t.current)return;let n=t.current,o=document.createElement("canvas");n.appendChild(o);let r=new d3({canvas:o,antialias:!0,alpha:!0});r.setSize(120,120),r.setPixelRatio(window.devicePixelRatio);let i=new Dy,s=new Pc(75,1,0.1,1000);s.up.set(0,0,1);let a=new kz(16777215,Math.PI/2);i.add(a);let c=new Ba;c.rotation.fromArray([Math.PI/2,0,0]);let l=1,h=new Mo(new S_(l,l,l),new vs({color:"white"}));c.add(h);let d=new u3(new Zre(new S_(l,l,l)),new n2({color:0,linewidth:2}));c.add(d),i.add(c);let u=0.51,_=(v,P,M)=>{let B=new nj;if(B.text=v,B.position.fromArray(P),M)B.rotation.fromArray(M);return B.color="black",B.fontSize=0.25,B.anchorX="center",B.anchorY="middle",B.depthOffset=0,B.font=null,B.sync(),B},p=_("Front",[0,0,u]),m=_("Back",[0,0,-u],[0,Math.PI,0]),A=_("Right",[u,0,0],[0,Math.PI/2,0]),g=_("Left",[-u,0,0],[0,-Math.PI/2,0]),f=_("Top",[0,u,0],[-Math.PI/2,0,0]),y=_("Bottom",[0,-u,0],[Math.PI/2,0,0]);c.add(p),c.add(m),c.add(A),c.add(g),c.add(f),c.add(y);let x=null,C=!0,b=new IntersectionObserver(([v])=>{C=v?.isIntersecting??!1});b.observe(o);let I=()=>{if(x=requestAnimationFrame(I),!C)return;if(e.current){let v=OGi(e.current.rotation??new FA(0,0,0),2);if(!v.equals(s.position))s.position.copy(v),s.lookAt(0,0,0)}r.render(i,s)};return I(),()=>{if(b.disconnect(),o.remove(),x!==null)cancelAnimationFrame(x);p.dispose(),m.dispose(),A.dispose(),g.dispose(),f.dispose(),y.dispose(),h.geometry.dispose(),h.material.dispose(),d.geometry.dispose(),d.material.dispose(),i.clear(),r.dispose(),r.forceContextLoss()}},[e]),hto.jsx("div",{ref:t,style:{position:"absolute",top:0,left:0,width:120,height:120,zIndex:Kpe.orientationCube}})},dto=(e,t,n)=>{let o=e/2,r=t/2,i=Math.min(n,o,r),s=new JAe;return s.moveTo(-o+i,-r),s.lineTo(o-i,-r),s.quadraticCurveTo(o,-r,o,-r+i),s.lineTo(o,r-i),s.quadraticCurveTo(o,r,o-i,r),s.lineTo(-o+i,r),s.quadraticCurveTo(-o,r,-o,r-i),s.lineTo(-o,-r+i),s.quadraticCurveTo(-o,-r,-o+i,-r),s},b0t=(e,t,n,o)=>uto(dto(e,t,o),n),uto=(e,t)=>{let n=new efe(e,{depth:t,bevelEnabled:!1,curveSegments:24});return n.translate(0,0,-t/2),n.computeVertexNormals(),n},YGi=(e,t)=>{let n=Gte[t];e.updateMatrixWorld(!0);let r=new Mu().setFromObject(e).getSize(new Et);e.scale.set(n.width/r.x,n.height/r.y,n.depth/r.z),e.updateMatrixWorld(!0);let s=new Mu().setFromObject(e).getCenter(new Et);e.position.set(-s.x,-s.y,n.zCenter-s.z),e.updateMatrixWorld(!0)},GGi=()=>{let e=new $Ae([new Et(-82,18,16),new Et(-67,7,15),new Et(-43,-9,14),new Et(-15,-18,14),new Et(16,-18,14),new Et(47,-8,14.5),new Et(72,8,16),new Et(84,19,17)]),t=84,n=30,o=e.computeFrenetFrames(84,!1),r=[],i=[],s=[],a=[],c=[],l=new No(16766023),h=new No(12038965);for(let u=0;u<=84;u++){let _=u/84,p=e.getPointAt(_),m=o.normals[u],A=o.binormals[u],f=3.4+12.4*Math.sin(Math.PI*_)**0.48,y=Math.max(0,(_-0.82)/0.18)*0.38,x=l.clone().lerp(h,y);for(let C=0;C<=30;C++){let b=C/30*Math.PI*2,I=Math.sin(b),v=Math.cos(b),P=1+Math.cos(b*5+0.35)*0.035,M=new Et().addScaledVector(m,v).addScaledVector(A,I*0.9).normalize(),B=p.clone().addScaledVector(m,v*f*P).addScaledVector(A,I*f*0.9*P);r.push(B.x,B.y,B.z),i.push(M.x,M.y,M.z),s.push(x.r,x.g,x.b),a.push(_,C/30)}}for(let u=1;u<=84;u++)for(let _=1;_<=30;_++){let m=31*(u-1)+(_-1),A=31*u+(_-1),g=31*u+_,f=31*(u-1)+_;c.push(m,f,A,A,f,g)}let d=new js;return d.setIndex(c),d.setAttribute("position",new Wr(r,3)),d.setAttribute("normal",new Wr(i,3)),d.setAttribute("color",new Wr(s,3)),d.setAttribute("uv",new Wr(a,2)),d.computeBoundingBox(),d.computeBoundingSphere(),{geometry:d,curve:e}},UGi=()=>{let e=new Ba,t=new Ba,{geometry:n,curve:o}=GGi(),r=new Mo(n,new vs({color:16777215,roughness:0.72,metalness:0,vertexColors:!0}));r.name="banana-peel",t.add(r);let i=new Mo(new _w(3.4,20,12),new vs({color:6242844,roughness:0.92}));i.position.copy(o.getPointAt(0)),i.scale.set(1.15,0.78,0.78),i.name="banana-blossom-tip",t.add(i);let s=11,a=o.getTangentAt(1).normalize(),c=new Mo(new mw(2.5,4.1,s,18),new vs({color:8483625,roughness:0.82}));c.quaternion.setFromUnitVectors(new Et(0,1,0),a),c.position.copy(o.getPointAt(1)).addScaledVector(a,s/2),c.name="banana-stem",t.add(c);let l=new Mo(new _w(2.55,18,10),new vs({color:5981470,roughness:0.9}));return l.position.copy(o.getPointAt(1)).addScaledVector(a,s),l.name="banana-stem-tip",t.add(l),YGi(t,"banana"),e.add(t),e},WGi=(e,t,n,o,r)=>{let i=dto(e,t,o),s=new Ore;return s.absarc(0,0,r,0,Math.PI*2,!0),i.holes.push(s),uto(i,n)},XGi=(e,t)=>{let r=new Mo(new mw(t-0.15,t-0.15,0.25,48),new vs({color:10199202,roughness:0.48,metalness:0.28}));return r.rotation.x=Math.PI/2,r.position.z=e-0.35-0.125,r.name="macbook-lid-indent",r},jGi=()=>{let e=Gte["credit-card"],t=new Ba,n=new Mo(b0t(e.width,e.height,e.depth,3.18),new vs({color:2383272,roughness:0.38,metalness:0.08}));n.name="credit-card-body",t.add(n);let o=e.depth/2+0.08,r=new Mo(b0t(12,9,0.14,1.2),new vs({color:14003525,roughness:0.3,metalness:0.62}));r.position.set(-21,3,o),r.name="credit-card-chip",t.add(r);let i=new vs({color:15331061,roughness:0.45,metalness:0.05});for(let s=0;s<4;s++){let a=new Mo(new S_(s===3?8:12,0.8,0.1),i);a.position.set(-20+s*14,-14,o+0.08),a.name="credit-card-detail",t.add(a)}return t},KGi=()=>{let e=Gte["14in-macbook"],t=new Ba,n=new vs({color:12896201,roughness:0.3,metalness:0.38}),o=new Mo(b0t(e.width,e.height,13.5,9),n);o.position.z=-1,o.name="macbook-body",t.add(o);let r=2,i=6.75,s=i+r/2,a=12,c=new Mo(WGi(e.width-1.8,e.height-1.8,r,8.2,a),n.clone());c.position.z=i,c.name="macbook-lid",t.add(c);let l=new Mo(new S_(e.width-42,3.2,1.2),new vs({color:3158838,roughness:0.55,metalness:0.45}));l.position.set(0,e.height/2-2.4,6.15),l.name="macbook-hinge",t.add(l),t.add(XGi(s,a));let h=new Mo(new S_(54,1.2,0.8),new vs({color:6712174,roughness:0.45,metalness:0.5}));return h.position.set(0,-e.height/2+0.5,2.5),h.name="macbook-front-notch",t.add(h),t},$Gi=(e)=>{let t=e==="banana"?UGi():e==="credit-card"?jGi():KGi();return t.name=`reference-object-${e}`,t.userData.isReferenceObject=!0,t.userData.referenceObjectType=e,uC(t),t},qGi=(e)=>{let t=new Set,n=new Set;e.traverse((o)=>{if(!(o instanceof Mo))return;t.add(o.geometry);let r=Array.isArray(o.material)?o.material:[o.material];for(let i of r)n.add(i)});for(let o of t)o.dispose();for(let o of n)o.dispose()},JGi=(e,t,n,o=1.18)=>{let r=Math.max(n.maxX-n.minX,0),i=Math.max(n.maxY-n.minY,0),s=Math.max(n.maxZ-n.minZ,0),a=new Et((n.minX+n.maxX)/2,(n.minY+n.maxY)/2,(n.minZ+n.maxZ)/2),c=Math.max(Math.hypot(r,i,s)/2,1),l=t?.target??new Et,h=new Et(0,-0.75,0.9).normalize(),d=Math.max(e.position.distanceTo(l),5);if(e instanceof Pc){let u=t2.degToRad(e.fov),_=2*Math.atan(Math.tan(u/2)*e.aspect),p=Math.min(u,_);d=c*o/Math.sin(p/2),e.far=Math.max(e.far,d+c*o*3),e.updateProjectionMatrix()}else if(e instanceof r5){let u=Math.abs(e.right-e.left)/2,_=Math.abs(e.top-e.bottom)/2;e.zoom=Math.min(u/(c*o),_/(c*o)),d=Math.max(d,c*o*2),e.updateProjectionMatrix()}if(e.position.copy(a).addScaledVector(h,d),e.lookAt(a),e.updateMatrixWorld(),t)t.target.copy(a),t.update();return{center:a,radius:c,distance:d}},ZGi=({type:e,boardDimensions:t,boardCenter:n})=>{let{scene:o}=rg(),r=qpe.useMemo(()=>{let i=$Gi(e),s=lto(e,t,n);return i.position.set(s.x,s.y,s.z),i},[e,t,n]);return qpe.useEffect(()=>(o.add(r),()=>{o.remove(r),qGi(r)}),[o,r]),null},pto=({bounds:e})=>{let{camera:t}=rg(),{controlsRef:n}=VT();return qpe.useEffect(()=>{JGi(t,n.current,e)},[e,t,n]),null},eUi=()=>{let{camera:e}=rg(),{setCameraRotation:t}=VT();return jpe(()=>{if(e)t(e.rotation)}),null},mto=fE.forwardRef(({children:e,initialCameraPosition:t=[5,-5,5],autoRotateDisabled:n,clickToInteractEnabled:o=!1,boardDimensions:r,boardCenter:i,cameraSessionScope:s,referenceObject:a,onUserInteraction:c,onCameraControllerReady:l},h)=>{let[d,u]=fE.useState(!o),{mainCameraRef:_,handleControlsChange:p,controller:m}=VT(),{darkBackgroundEnabled:A,gridEnabled:g,lightingEnabled:f}=Ypt(),{handleCameraCreated:y,handleControlsChange:x}=vGi({cameraSessionScope:s});fE.useEffect(()=>{if(l)l(m)},[m,l]);let C=fE.useMemo(()=>{if(!a)return;return zGi(a,r,i)},[a,r,i]),b=fE.useMemo(()=>{if(!r)return 10;let v=r.width??0,P=r.height??0;return Math.max(Math.max(v,P)*1.5,10)},[r]),I=fE.useMemo(()=>{if(C)return[(C.minX+C.maxX)/2,(C.minY+C.maxY)/2,(C.minZ+C.maxZ)/2];if(!i)return;return[i.x,i.y,0]},[i,C]);return V1.jsxs("div",{style:{position:"relative",width:"100%",height:"100%"},children:[V1.jsx(VGi,{}),V1.jsxs(EGi,{ref:h,scene:{up:new Et(0,0,1)},camera:{up:[0,0,1],position:t},onCreated:({camera:v})=>{_.current=v,y(v)},children:[V1.jsx(xYi,{}),V1.jsx(bGi,{}),V1.jsx(eUi,{}),d&&V1.jsx(QGi,{autoRotate:!n,autoRotateSpeed:1,onStart:c,rotateSpeed:0.5,panSpeed:0.75,zoomSpeed:0.5,enableDamping:!0,dampingFactor:0.1,target:I,onControlsChange:(v)=>{p(v),x()}}),V1.jsx(TGi,{boardDimensions:r,boardCenter:i,darkBackgroundEnabled:A,shadowsEnabled:f}),a&&V1.jsx(ZGi,{type:a,boardDimensions:r,boardCenter:i}),C&&V1.jsx(pto,{bounds:C}),g&&V1.jsx(BGi,{rotation:[Math.PI/2,0,0],infiniteGrid:!0,cellSize:3,sectionSize:b}),e]},s),V1.jsxs("div",{style:{position:"absolute",right:24,bottom:24,fontFamily:"sans-serif",color:"white",WebkitTextStroke:"0.5px rgba(0, 0, 0, 0.5)",fontSize:11},children:["@",eto.version]}),o&&!d&&V1.jsx("button",{type:"button",onClick:()=>u(!0),onKeyDown:(v)=>{if(v.key==="Enter"||v.key===" ")u(!0)},style:{position:"absolute",inset:0,cursor:"pointer",zIndex:Kpe.clickToInteractOverlay,display:"flex",alignItems:"center",justifyContent:"center"},children:V1.jsx("div",{style:{backgroundColor:"rgba(0, 0, 0, 0.8)",color:"white",padding:"12px 24px",borderRadius:"8px",fontSize:"16px",fontFamily:"sans-serif",pointerEvents:"none"},children:"Click to Interact"})})]})}),tUi=(e)=>{let[t,n]=wpe.useState([]),[o,r]=wpe.useState(!0);return wpe.useEffect(()=>{if(!e)return;(async()=>{r(!0);let a=(Array.isArray(e)?e:[e]).map(async(c,l)=>{let h=_to.default.serialize({binary:!0},[c]),u=await new Blob(h).arrayBuffer(),p=c.layerType||(l===0?"board":void 0);return{stlData:u,color:c.color,layerType:p}});try{let c=await Promise.all(a);n(c)}catch(c){console.error("Error generating STLs:",c),n([])}finally{r(!1)}})()},[e]),{stls:t,loading:o}},nUi=ih(Dwe(),1),oUi=ih(dU(),1),rUi=ih(Xpe(),1),iUi=ih(dU(),1),sUi=ih(uU(),1),aUi=ih(cJn(),1),gto=(e)=>{let t=0;for(let o=0;o<e.length;o++){let r=(o+1)%e.length;t+=e[o][0]*e[r][1],t-=e[r][0]*e[o][1]}return t/2<=0},I0t=(e,t=1.2,n={})=>{let{xyOutset:o=0}=n,{outline:r}=e,i=r.map((c)=>[c.x,c.y]);if(gto(i))i=i.reverse();let s=(0,iUi.polygon)({points:i});if(o!==0)s=(0,aUi.expand)({delta:o,corners:"edge"},s);let a=(0,rUi.extrudeLinear)({height:t},s);return a=(0,sUi.translate)([0,0,-t/2],a),a},Ni=0.01,gl={copper:[0.78,0.63,0.39],fr4Tan:[0.6,0.43,0.28],fr4SolderMaskGreen:[0.06,0.31,0.19],fr4TracesWithMaskGreen:[0.09,0.38,0.23],fr4TracesWithoutMaskTan:[0.6,0.43,0.28],flexAmber:[0.8,0.61,0.2],fr1Tan:[0.8,0.4,0.2],fr1TracesWithMaskCopper:[0.9,0.6,0.2],fr1SolderMaskGreen:[0.02,0.1,0.04]},Gv=0.001,rA=32,K6=150,dwe=0.6,cUi={fr1:gl.fr1Tan,fr4:gl.fr4Tan,flex:gl.flexAmber},lUi={fr1:gl.fr1SolderMaskGreen,fr4:gl.fr4SolderMaskGreen,flex:gl.flexAmber},hUi={red:"#650202",blue:"#003f7d",purple:"#4c1d69",black:"#071014",white:"#dddddd",yellow:"#dcc84a"},dUi=0.875,uUi=/^#(?:[\da-f]{3}|[\da-f]{6})$/i,pUi=/^rgb\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*\)$/i,mUi=/^rgb\(\s*\d+%\s*,\s*\d+%\s*,\s*\d+%\s*\)$/i,_Ui=/^hsl\(\s*\d*\.?\d+\s*,\s*\d*\.?\d+%\s*,\s*\d*\.?\d+%\s*\)$/i,gUi={blue:0.96,purple:0.96,black:0.99,yellow:0.92},Ato=(e)=>{let t=e?.trim();if(!t)return null;let n=t.toLowerCase();if(n==="green"||n==="not_specified")return null;let r=hUi[n];if(r)return new No(r);return Object.hasOwn(No.NAMES,n)||uUi.test(t)||pUi.test(t)||mUi.test(t)||_Ui.test(t)?new No(n):null},AUi=(e)=>{let t=e?.trim().toLowerCase();return gUi[t]??dUi},fUi=({red:e,green:t,blue:n})=>Math.hypot(e-220,t-200,n-74)<4||Math.hypot(e-218,t-197,n-76)<4,yUi=({soldermaskColor:e,copperColor:t,soldermaskOpacity:n})=>e.clone().multiplyScalar(n).add(t.clone().multiplyScalar(1-n)),GKn=(e)=>{let t=e.clone().convertLinearToSRGB();return`rgb(${[Math.round(t.r*255),Math.round(t.g*255),Math.round(t.b*255)].join(",")})`},xUi=new No(1063462),Gpt=({material:e,solder_mask_color:t})=>{let n=Ato(t);if(n)return n;if(e==="fr4")return xUi.clone();let o=cUi[e]??gl.fr4Tan;return new No(o[0],o[1],o[2])},CUi=(e)=>{let t=e.filter((c)=>c.type==="pcb_panel"),n=Vo(e).pcb_board.list(),o,r,i=1.2;if(t.length>0)o=t[0],r=n.find((c)=>c.pcb_panel_id===o.pcb_panel_id),i=r?.thickness??1.2;else{if(o=n.filter((l)=>!l.pcb_panel_id)[0],!o)return console.warn("No pcb_board or pcb_panel found for simplified geometry"),[];r=o,i=o.thickness??1.2}let s;if("outline"in o&&o.outline&&o.outline.length>0)s=I0t({outline:o.outline},i);else s=(0,oUi.cuboid)({size:[o.width??10,o.height??10,i],center:[o.center.x,o.center.y,0]});let a=Gpt({material:r?.material??"fr4",solder_mask_color:r?.solder_mask_color});return[(0,nUi.colorize)([a.r,a.g,a.b],s)]},Jut=ih(Dwe(),1),I2=ih(Wpe(),1),UKn=ih(Oqn(),1),Zut=ih(Xpe(),1),s4=ih(uU(),1),du=ih(dU(),1),rH=ih(dU(),1),bUi=ih(Xpe(),1),$Me=ih(uU(),1),IUi=ih(Wpe(),1),vUi=64,SUi=(e,t,n)=>{let o=(0,rH.ellipse)({center:[0,0],radius:[Math.max(e/2,Ni/2),Math.max(t/2,Ni/2)],segments:vUi}),r=(0,bUi.extrudeLinear)({height:n},o);return(0,$Me.translate)([0,0,-n/2],r)},PUi=(e,t,n)=>{let o=Math.max(e,Ni),r=Math.max(t,Ni);if(Math.abs(o-r)<0.000001)return(0,rH.cylinder)({center:[0,0,0],radius:o/2,height:n});let i=o>=r,s=i?o:r,a=i?r:o,c=Math.max(s-a,0),l=(0,rH.cuboid)({center:[0,0,0],size:i?[c,a,n]:[a,c,n]});if(c<=0.000001)return(0,rH.cylinder)({center:[0,0,0],radius:a/2,height:n});let h=c/2,d=(0,rH.cylinder)({center:i?[-h,0,0]:[0,-h,0],radius:a/2,height:n}),u=(0,rH.cylinder)({center:i?[h,0,0]:[0,h,0],radius:a/2,height:n});return(0,IUi.union)(l,d,u)},uwe=(e,t,n={})=>{let o=e.hole_shape||"circle",r=n.sizeDelta??0,i=e.hole_offset_x||0,s=e.hole_offset_y||0,a=[e.x+i,e.y+s,0];if(o==="circle"){let _=Math.max((e.hole_diameter??0)+r,Ni),p=Math.max(_/2,Ni/2);return(0,rH.cylinder)({center:a,radius:p,height:t})}let c=e.hole_width??e.hole_diameter,l=e.hole_height??e.hole_diameter;if(!c||!l)return null;let h=Math.max(c+r,Ni),d=Math.max(l+r,Ni);if(o==="oval"){let _=SUi(h,d,t);return(0,$Me.translate)([a[0],a[1],0],_)}if(o==="pill"||o==="rotated_pill"){let _=PUi(h,d,t);if(!_)return null;let p=e.ccw_rotation||0;if(p)_=(0,$Me.rotateZ)(p*Math.PI/180,_);return(0,$Me.translate)(a,_)}let u=Math.max((e.hole_diameter??c??l??Ni)+r,Ni);return(0,rH.cylinder)({center:a,radius:u/2,height:t})},_l=ih(dU(),1),pE=ih(Dwe(),1),qu=ih(Wpe(),1),WKn=ih(uU(),1),BMe=ih(Xpe(),1),a4=ih(uU(),1),EUi=0.00001;function fto(e,t,n){if(typeof n!=="number"||!Number.isFinite(n))return 0;if(n<=0)return 0;let o=e/2,r=t/2,i=Math.min(o,r)-2*EUi;return Math.max(0,Math.min(n,i))}function iH(e){if(!e||typeof e!=="object")return;return e.corner_radius??e.cornerRadius??e.rect_pad_border_radius??e.rectPadBorderRadius??e.rect_border_radius??e.rectBorderRadius??void 0}var MUi=0.05,e0t=64,$G=(e,t)=>t?(0,qu.intersect)(t,e):e,ppe=(e,t,n={})=>{let{clipGeom:o}=n;if(!e.shape)e.shape="circle";let r=Math.max(t.pcbThickness*0.002,Ni/5),i=Math.max(t.pcbThickness*0.0003,Ni/20),s=Math.max(t.pcbThickness*0.0025,Ni/4),a=t.pcbThickness+2*MUi+4*Ni,c=Math.max(t.pcbThickness-2*(r+i+s),Ni),l=Math.max(c,Ni);if(e.shape==="circle"){let h=e.outer_diameter??Math.max(e.hole_diameter,0),d=c,u=(0,_l.cylinder)({center:[e.x,e.y,0],radius:h/2,height:d}),_=$G(u,o),p=(0,_l.cylinder)({center:[e.x,e.y,0],radius:Math.max(e.hole_diameter/2,0.01),height:a});return(0,pE.colorize)(gl.copper,(0,qu.subtract)(_,p))}if(e.shape==="oval"){let h=e.outer_width||e.hole_width||0,d=e.outer_height||e.hole_height||0,u=e.hole_width||0,_=e.hole_height||0,p=(()=>{let g=(0,_l.cylinder)({center:[0,0,0],radius:1,height:c,segments:64}),f=(0,WKn.scale)([h/2,d/2,1],g);return(0,a4.translate)([e.x,e.y,0],f)})(),m=$G(p,o),A=(()=>{let g=(0,_l.cylinder)({center:[0,0,0],radius:1,height:a,segments:64}),f=(0,WKn.scale)([Math.max(u/2,0.01),Math.max(_/2,0.01),1],g);return(0,a4.translate)([e.x,e.y,0],f)})();return(0,pE.colorize)(gl.copper,(0,qu.subtract)(m,A))}if(e.shape==="circular_hole_with_rect_pad"){let h=e.hole_offset_x||0,d=e.hole_offset_y||0,u=e.rect_pad_width||e.hole_diameter,_=e.rect_pad_height||e.hole_diameter,p=iH(e),m=$G((0,qu.union)((()=>{let f=(0,_l.roundedRectangle)({size:[u,_],roundRadius:p||0,segments:e0t}),y=(0,BMe.extrudeLinear)({height:c},f);return(0,a4.translate)([e.x,e.y,-c/2],y)})(),(0,_l.cylinder)({center:[e.x+(h||0),e.y+(d||0),0],radius:e.hole_diameter/2,height:l})),o),A=(0,_l.cylinder)({center:[e.x+(h||0),e.y+(d||0),0],radius:Math.max(e.hole_diameter/2-Ni,0.01),height:a}),g=(0,qu.subtract)(m,A);if(n.clipGeom)return(0,pE.colorize)(gl.copper,(0,qu.intersect)(g,n.clipGeom));return(0,pE.colorize)(gl.copper,g)}if(e.shape==="pill"){let h=(e.ccw_rotation||0)*Math.PI/180,d=(D)=>{if(!h)return D;let L=(0,a4.translate)([-e.x,-e.y,0],D),H=(0,a4.rotate)([0,0,h],L);return(0,a4.translate)([e.x,e.y,0],H)},u=e.hole_height>e.hole_width,_=u?e.hole_height:e.hole_width,p=u?e.hole_width:e.hole_height,m=u?e.outer_height||p+0.2:e.outer_width||_+0.2,A=u?e.outer_width||_+0.2:e.outer_height||p+0.2,g=p/2,f=A/2,y=Math.abs(_-p),x=Math.abs(m-A),I=((D,L,H)=>{let V=L/2,O=Math.abs(D-L);if(O<=0.000001)return(0,_l.cylinder)({center:[e.x,e.y,0],radius:V,height:H});let U=(0,_l.cuboid)({center:[e.x,e.y,0],size:u?[L,O,H]:[O,L,H]}),j=(0,_l.cylinder)({center:u?[e.x,e.y-O/2,0]:[e.x-O/2,e.y,0],radius:V,height:H}),Y=(0,_l.cylinder)({center:u?[e.x,e.y+O/2,0]:[e.x+O/2,e.y,0],radius:V,height:H});return(0,qu.union)(U,j,Y)})(m,A,c),v=(0,_l.cuboid)({center:[e.x,e.y,0],size:u?[p-2*Ni,y,a]:[y,p-2*Ni,a]}),P=(0,_l.cylinder)({center:u?[e.x,e.y-y/2,0]:[e.x-y/2,e.y,0],radius:g-Ni,height:a}),M=(0,_l.cylinder)({center:u?[e.x,e.y+y/2,0]:[e.x+y/2,e.y,0],radius:g-Ni,height:a}),B=(0,qu.union)(v,P,M),T=$G(d(I),o),N=d(B);return(0,pE.colorize)(gl.copper,(0,qu.subtract)(T,N))}if(e.shape==="pill_hole_with_rect_pad"){if(e.hole_shape&&e.hole_shape!=="pill"||e.pad_shape&&e.pad_shape!=="rect")throw Error("Invalid hole_shape or pad_shape for pill_hole_with_rect_pad");let h=e.hole_offset_x||0,d=e.hole_offset_y||0,u=e.hole_height>e.hole_width,_=u?e.hole_height:e.hole_width,p=u?e.hole_width:e.hole_height,m=p/2,A=Math.abs(_-p),g=e.rect_pad_width||_+0.2,f=e.rect_pad_height||p+0.2,y=iH(e),x=0.03,C=(0,qu.union)((0,_l.cuboid)({center:[e.x+h,e.y+d,0],size:u?[p+2*x,A+2*x,l]:[A+2*x,p+2*x,l]}),(0,_l.cylinder)({center:u?[e.x+h,e.y+d-A/2,0]:[e.x+h-A/2,e.y+d,0],radius:m+x,height:l}),(0,_l.cylinder)({center:u?[e.x+h,e.y+d+A/2,0]:[e.x+h+A/2,e.y+d,0],radius:m+x,height:l})),b=(0,qu.union)((0,_l.cuboid)({center:[e.x+h,e.y+d,0],size:u?[p,A,a]:[A,p,a]}),(0,_l.cylinder)({center:u?[e.x+h,e.y+d-A/2,0]:[e.x+h-A/2,e.y+d,0],radius:m,height:a}),(0,_l.cylinder)({center:u?[e.x+h,e.y+d+A/2,0]:[e.x+h+A/2,e.y+d,0],radius:m,height:a})),I=(()=>{let T=(0,_l.roundedRectangle)({size:[g,f],roundRadius:y||0,segments:e0t}),N=(0,BMe.extrudeLinear)({height:c},T);return(0,a4.translate)([e.x,e.y,-c/2],N)})(),v=(0,qu.subtract)(I,b),P=(0,qu.union)((0,_l.cuboid)({center:[e.x+h,e.y+d,0],size:u?[p-2*Ni,A-2*Ni,a]:[A-2*Ni,p-2*Ni,a]}),(0,_l.cylinder)({center:u?[e.x+h,e.y+d-A/2,0]:[e.x+h-A/2,e.y+d,0],radius:m-Ni,height:a}),(0,_l.cylinder)({center:u?[e.x+h,e.y+d+A/2,0]:[e.x+h+A/2,e.y+d,0],radius:m-Ni,height:a})),M=(0,qu.subtract)(C,P),B=$G((0,qu.union)(v,M),o);return(0,pE.colorize)(gl.copper,B)}else if(e.shape==="rotated_pill_hole_with_rect_pad"){if(e.hole_shape&&e.hole_shape!=="rotated_pill"||e.pad_shape&&e.pad_shape!=="rect")throw Error("Invalid hole_shape or pad_shape for rotated_pill_hole_with_rect_pad");let h=e.hole_offset_x||0,d=e.hole_offset_y||0,{hole_width:u,hole_height:_}=e,p=u>=_,m=p?u:_,A=p?_:u,g=A/2,f=Math.abs(m-A),y=e.rect_pad_width||u+0.2,x=e.rect_pad_height||_+0.2,C=iH(e),b=0.03,I=(e.hole_ccw_rotation||0)*Math.PI/180,v=(e.rect_ccw_rotation||0)*Math.PI/180,P=(O)=>{let U=h*Math.cos(I)-d*Math.sin(I),j=h*Math.sin(I)+d*Math.cos(I),Y=(0,a4.rotate)([0,0,I],O);return(0,a4.translate)([e.x+U,e.y+j,0],Y)},M=(O)=>{if(!v)return O;let U=(0,a4.translate)([-e.x,-e.y,0],O),j=(0,a4.rotate)([0,0,v],U);return(0,a4.translate)([e.x,e.y,0],j)},B=P((0,qu.union)((0,_l.cuboid)({center:[0,0,0],size:p?[f+2*b,A+2*b,l]:[A+2*b,f+2*b,l]}),(0,_l.cylinder)({center:p?[-f/2,0,0]:[0,-f/2,0],radius:g+b,height:l}),(0,_l.cylinder)({center:p?[f/2,0,0]:[0,f/2,0],radius:g+b,height:l}))),T=P((0,qu.union)((0,_l.cuboid)({center:[0,0,0],size:p?[f,A,a]:[A,f,a]}),(0,_l.cylinder)({center:p?[-f/2,0,0]:[0,-f/2,0],radius:g,height:a}),(0,_l.cylinder)({center:p?[f/2,0,0]:[0,f/2,0],radius:g,height:a}))),N=M((()=>{let O=(0,_l.roundedRectangle)({size:[y,x],roundRadius:C||0,segments:e0t}),U=(0,BMe.extrudeLinear)({height:c},O);return(0,a4.translate)([e.x,e.y,-c/2],U)})()),D=(0,qu.subtract)(N,T),L=P((0,qu.union)((0,_l.cuboid)({center:[0,0,0],size:p?[f-2*Ni,A-2*Ni,a]:[A-2*Ni,f-2*Ni,a]}),(0,_l.cylinder)({center:p?[-f/2,0,0]:[0,-f/2,0],radius:g-Ni,height:a}),(0,_l.cylinder)({center:p?[f/2,0,0]:[0,f/2,0],radius:g-Ni,height:a}))),H=(0,qu.subtract)(B,L),V=$G((0,qu.union)(D,H),o);return(0,pE.colorize)(gl.copper,V)}else if(e.shape==="hole_with_polygon_pad"){let h=e.pad_outline;if(!Array.isArray(h)||h.length<3)throw Error(`Invalid pad_outline for plated hole at (${e.x}, ${e.y})`);let d=h.map((x)=>[x.x,x.y]),u=(0,_l.polygon)({points:d}),m=((x,C)=>{let b=Math.max(x,Ni),I=(0,BMe.extrudeLinear)({height:b},u);return(0,a4.translate)([e.x,e.y,C-b/2],I)})(c,0),A=$G(m,o),g=uwe(e,l);if(!g)return(0,pE.colorize)(gl.copper,A);let f=uwe(e,a,{sizeDelta:-2*Ni})||g,y=(0,qu.union)((0,qu.subtract)(A,g),g);if(n.clipGeom)return y=(0,qu.subtract)(y,f),y=(0,qu.intersect)(y,n.clipGeom),(0,pE.colorize)(gl.copper,y);return(0,pE.colorize)(gl.copper,(0,qu.subtract)(y,f))}else throw Error(`Unsupported plated hole shape: ${e.shape}`)},wUi=ih(Wpe(),1),BUi=ih(uU(),1),v0t=ih(dU(),1);function TUi({x:e,y:t,outerDiameter:n,holeDiameter:o,thickness:r}){if(n<=o)throw Error(`Invalid via geometry: outerDiameter (${n}) must be > holeDiameter (${o})`);let i=Ni,s=Math.min(n/2,o/2+i),c=(0,v0t.cylinder)({center:[0,0,0],radius:s,height:r,segments:rA}),l=r+2*Ni,h=(0,v0t.cylinder)({center:[0,0,0],radius:o/2,height:l,segments:rA}),d=(0,wUi.subtract)(c,h);return(0,BUi.translate)([e,t,0],d)}function DUi({x:e,y:t,holeDiameter:n,thickness:o}){let r=o*1.5,i=n/2+Ni;return(0,v0t.cylinder)({center:[e,t,0],radius:i,height:r,segments:rA})}function Upt(e){let t=n2e(e),n=[...Vo(e).pcb_via.list()],o=new Map;for(let r of n){let s=`${t.get(r.pcb_via_id)?.pcb_board_id??""}:${r.x}:${r.y}`,a=o.get(s)??[];a.push(r),o.set(s,a)}for(let r of Vo(e).pcb_trace.list()){let i=t.get(r.pcb_trace_id);for(let[s,a]of r.route.entries()){if(a.route_type!=="via")continue;let c=`${i?.pcb_board_id??""}:${a.x}:${a.y}`,l=o.get(c)??[];if(l.some((u)=>u.layers.includes(a.from_layer)&&u.layers.includes(a.to_layer)))continue;let d={type:"pcb_via",pcb_via_id:`${r.pcb_trace_id}_route_via_${s}`,pcb_trace_id:r.pcb_trace_id,subcircuit_id:r.subcircuit_id,pcb_group_id:r.pcb_group_id,x:a.x,y:a.y,layers:[a.from_layer,a.to_layer],hole_diameter:a.hole_diameter??i?.min_via_hole_diameter??0.25,outer_diameter:a.outer_diameter??i?.min_via_pad_diameter??0.6,tented_on_top:a.tented_on_top,tented_on_bottom:a.tented_on_bottom};n.push(d),l.push(d),o.set(c,l)}}return n}var NUi=64,RUi=1,t0t=0.05,XKn=["initializing","processing_plated_holes","processing_holes","processing_cutouts","processing_vias","finalizing","done"],QUi=class{board;plated_holes;holes;pcb_vias;pcb_cutouts;boardGeom=null;platedHoleGeoms=[];viaGeoms=[];copperDrills=[];boardClipGeom=null;state="initializing";currentIndex=0;ctx;onCompleteCallback;finalGeoms=[];constructor(e,t){this.onCompleteCallback=t;let n=e.filter((r)=>r.type==="pcb_panel"),o=Vo(e).pcb_board.list();if(n.length>0){let r=n[0],i=o.find((s)=>s.pcb_panel_id===r.pcb_panel_id);this.board={type:"pcb_board",pcb_board_id:r.pcb_panel_id,center:r.center,width:r.width,height:r.height,thickness:i?.thickness??1.4,material:i?.material??"fr4",num_layers:i?.num_layers??2,solder_mask_color:i?.solder_mask_color}}else{let r=o.filter((i)=>!i.pcb_panel_id);this.board=r[0]}this.plated_holes=Vo(e).pcb_plated_hole.list(),this.holes=Vo(e).pcb_hole.list(),this.pcb_vias=Upt(e),this.pcb_cutouts=Vo(e).pcb_cutout.list(),this.ctx={pcbThickness:this.board.thickness??1.2},this.initializeBoard()}initializeBoard(){let e=this.ctx.pcbThickness+2*RUi;if(this.board.outline&&this.board.outline.length>0)this.boardGeom=I0t({outline:this.board.outline},this.ctx.pcbThickness),this.boardClipGeom=I0t({outline:this.board.outline},e,{xyOutset:t0t});else this.boardGeom=(0,du.cuboid)({size:[this.board.width,this.board.height,this.ctx.pcbThickness],center:[this.board.center.x,this.board.center.y,0]}),this.boardClipGeom=(0,du.cuboid)({size:[this.board.width+2*t0t,this.board.height+2*t0t,e],center:[this.board.center.x,this.board.center.y,0]});this.state="processing_plated_holes",this.currentIndex=0}goToNextState(){let e=XKn.indexOf(this.state);if(e===-1)return;this.state=XKn[e+1],this.currentIndex=0}step(e=1){if(this.state==="done"||!this.boardGeom)return!0;for(let t=0;t<e;t++){if(this.state==="done")break;switch(this.state){case"processing_plated_holes":if(this.currentIndex<this.plated_holes.length)this.processPlatedHole(this.plated_holes[this.currentIndex]),this.currentIndex++;else this.goToNextState();break;case"processing_holes":if(this.currentIndex<this.holes.length)this.processHole(this.holes[this.currentIndex]),this.currentIndex++;else this.goToNextState();break;case"processing_vias":if(this.currentIndex<this.pcb_vias.length)this.processVia(this.pcb_vias[this.currentIndex]),this.currentIndex++;else this.goToNextState();break;case"processing_cutouts":if(this.currentIndex<this.pcb_cutouts.length)this.processCutout(this.pcb_cutouts[this.currentIndex]),this.currentIndex++;else this.goToNextState();break;case"finalizing":this.finalize(),this.state="done";break}}return this.state==="done"}processCutout(e){if(!this.boardGeom)return;let t=null,n=this.ctx.pcbThickness*1.5;switch(e.shape){case"rect":{let o=fto(e.width,e.height,iH(e));if(o>0){let r=(0,du.roundedRectangle)({size:[e.width,e.height],roundRadius:o,segments:NUi});t=(0,Zut.extrudeLinear)({height:n},r),t=(0,s4.translate)([0,0,-n/2],t)}else t=(0,du.cuboid)({center:[0,0,0],size:[e.width,e.height,n]});if(e.rotation){let r=e.rotation*Math.PI/180;t=(0,s4.rotateZ)(r,t)}t=(0,s4.translate)([e.center.x,e.center.y,0],t);break}case"circle":t=(0,du.cylinder)({center:[e.center.x,e.center.y,0],radius:e.radius,height:n});break;case"polygon":{let o=e.points.map((i)=>[i.x,i.y]);if(o.length<3){console.warn(`PCB Cutout [${e.pcb_cutout_id}] polygon has fewer than 3 points, skipping.`);break}if(gto(o))o=o.reverse();let r=(0,du.polygon)({points:o});t=(0,Zut.extrudeLinear)({height:n},r),t=(0,s4.translate)([0,0,-n/2],t);break}}if(t)this.boardGeom=(0,I2.subtract)(this.boardGeom,t)}processPlatedHole(e,t={}){if(!this.boardGeom)return;if(e.shape==="circle"||e.shape==="circular_hole_with_rect_pad"){let n=null;if(e.shape==="circular_hole_with_rect_pad"){if(e.hole_shape&&e.hole_shape!=="circle"||e.pad_shape&&e.pad_shape!=="rect")return;n=(0,du.cylinder)({center:[e.x+(e.hole_offset_x||0),e.y+(e.hole_offset_y||0),0],radius:e.hole_diameter/2+Ni,height:this.ctx.pcbThickness*1.5})}else n=(0,du.cylinder)({center:[e.x,e.y,0],radius:e.hole_diameter/2+Ni,height:this.ctx.pcbThickness*1.5});if(!t.dontCutBoard)this.boardGeom=(0,I2.subtract)(this.boardGeom,n),this.copperDrills.push({geom:n,platedHoleIndex:this.platedHoleGeoms.length});let o=ppe(e,this.ctx,{clipGeom:this.boardClipGeom});this.platedHoleGeoms.push(o)}else if(e.shape==="pill"||e.shape==="oval"){let n=e.hole_height>e.hole_width,o=n?e.hole_height:e.hole_width,r=n?e.hole_width:e.hole_height,i=r/2,s=Math.abs(o-r),a;if(a=(0,I2.union)((0,du.cuboid)({center:[e.x,e.y,0],size:n?[r,s,this.ctx.pcbThickness*1.5]:[s,r,this.ctx.pcbThickness*1.5]}),(0,du.cylinder)({center:n?[e.x,e.y-s/2,0]:[e.x-s/2,e.y,0],radius:i,height:this.ctx.pcbThickness*1.5}),(0,du.cylinder)({center:n?[e.x,e.y+s/2,0]:[e.x+s/2,e.y,0],radius:i,height:this.ctx.pcbThickness*1.5})),e.ccw_rotation){let l=e.ccw_rotation*Math.PI/180;a=(0,s4.translate)([e.x,e.y,0],(0,s4.rotateZ)(l,(0,s4.translate)([-e.x,-e.y,0],a)))}if(!t.dontCutBoard)this.boardGeom=(0,I2.subtract)(this.boardGeom,a),this.copperDrills.push({geom:a,platedHoleIndex:this.platedHoleGeoms.length});let c=ppe(e,this.ctx,{clipGeom:this.boardClipGeom});this.platedHoleGeoms.push(c)}else if(e.shape==="pill_hole_with_rect_pad"){if(e.hole_shape&&e.hole_shape!=="pill"||e.pad_shape&&e.pad_shape!=="rect")return;let n=e.hole_height>e.hole_width,o=n?e.hole_height:e.hole_width,r=n?e.hole_width:e.hole_height,i=r/2,s=Math.abs(o-r),a;if(a=(0,I2.union)((0,du.cuboid)({center:[e.x+(e.hole_offset_x||0),e.y+(e.hole_offset_y||0),0],size:n?[r,s,this.ctx.pcbThickness*1.5]:[s,r,this.ctx.pcbThickness*1.5]}),(0,du.cylinder)({center:n?[e.x+(e.hole_offset_x||0),e.y+(e.hole_offset_y||0)-s/2,0]:[e.x+(e.hole_offset_x||0)-s/2,e.y+(e.hole_offset_y||0),0],radius:i,height:this.ctx.pcbThickness*1.5}),(0,du.cylinder)({center:n?[e.x+(e.hole_offset_x||0),e.y+(e.hole_offset_y||0)+s/2,0]:[e.x+(e.hole_offset_x||0)+s/2,e.y+(e.hole_offset_y||0),0],radius:i,height:this.ctx.pcbThickness*1.5})),!t.dontCutBoard)this.boardGeom=(0,I2.subtract)(this.boardGeom,a),this.copperDrills.push({geom:a,platedHoleIndex:this.platedHoleGeoms.length});let c=ppe(e,this.ctx,{clipGeom:this.boardClipGeom});this.platedHoleGeoms.push(c)}else if(e.shape==="rotated_pill_hole_with_rect_pad"){if(e.hole_shape&&e.hole_shape!=="rotated_pill"||e.pad_shape&&e.pad_shape!=="rect")return;let{hole_width:n,hole_height:o}=e,r=n>=o,i=r?n:o,s=r?o:n,a=s/2,c=Math.abs(i-s),l=e.hole_offset_x||0,h=e.hole_offset_y||0,d=(0,I2.union)((0,du.cuboid)({center:[0,0,0],size:r?[c,s,this.ctx.pcbThickness*1.5]:[s,c,this.ctx.pcbThickness*1.5]}),(0,du.cylinder)({center:r?[-c/2,0,0]:[0,-c/2,0],radius:a,height:this.ctx.pcbThickness*1.5}),(0,du.cylinder)({center:r?[c/2,0,0]:[0,c/2,0],radius:a,height:this.ctx.pcbThickness*1.5})),u=(e.hole_ccw_rotation||0)*Math.PI/180,_=l*Math.cos(u)-h*Math.sin(u),p=l*Math.sin(u)+h*Math.cos(u);d=(0,s4.rotateZ)(u,d);let m=(0,s4.translate)([e.x+_,e.y+p,0],d);if(!t.dontCutBoard)this.boardGeom=(0,I2.subtract)(this.boardGeom,m),this.copperDrills.push({geom:m,platedHoleIndex:this.platedHoleGeoms.length});let A=ppe(e,this.ctx,{clipGeom:this.boardClipGeom});this.platedHoleGeoms.push(A)}else if(e.shape==="hole_with_polygon_pad"){let n=e.pad_outline;if(!Array.isArray(n)||n.length<3)return;let o=this.ctx.pcbThickness*1.5,r=uwe(e,o,{sizeDelta:2*Ni}),i=uwe(e,o,{sizeDelta:-2*Ni});if(!r||!i)return;if(!t.dontCutBoard)this.boardGeom=(0,I2.subtract)(this.boardGeom,r),this.copperDrills.push({geom:r,platedHoleIndex:this.platedHoleGeoms.length});let s=ppe(e,this.ctx,{clipGeom:this.boardClipGeom});this.platedHoleGeoms.push(s)}}processHole(e){if(!this.boardGeom)return;let t=this.ctx.pcbThickness*1.5;if(e.hole_shape==="circle"){let n=(0,du.cylinder)({center:[e.x,e.y,0],radius:e.hole_diameter/2+Ni,height:t});this.boardGeom=(0,I2.subtract)(this.boardGeom,n);let o=(0,du.cylinder)({center:[e.x,e.y,0],radius:e.hole_diameter/2+Ni/2,height:t});this.copperDrills.push({geom:o})}else if(e.hole_shape==="pill"||e.hole_shape==="rotated_pill"||e.hole_shape==="rect"||e.hole_shape==="oval"){let n=e.hole_width??e.hole_diameter,o=e.hole_height??e.hole_diameter,r=e.ccw_rotation??e.rotation??0,i=0.02,s=(l,h,d,u)=>{if(l<=0||h<=0)return null;if(e.hole_shape==="rect")return(0,du.cuboid)({center:[0,0,0],size:[l,h,d]});if(u)return(0,s4.translate)([0,0,-d/2],(0,Zut.extrudeLinear)({height:d},(0,du.ellipse)({radius:[l/2,h/2]})));let _=Math.min(l,h)/2,p=Math.abs(l-h);if(l>h)return(0,I2.union)((0,du.cuboid)({center:[0,0,0],size:[p,h,d]}),(0,du.cylinder)({center:[-p/2,0,0],radius:_,height:d}),(0,du.cylinder)({center:[p/2,0,0],radius:_,height:d}));return(0,I2.union)((0,du.cuboid)({center:[0,0,0],size:[l,p,d]}),(0,du.cylinder)({center:[0,-p/2,0],radius:_,height:d}),(0,du.cylinder)({center:[0,p/2,0],radius:_,height:d}))},a=s(n,o,t,e.hole_shape==="oval"),c=s(n-0.04,o-0.04,t,e.hole_shape==="oval");if(a&&r!==0)a=(0,s4.rotateZ)(r*Math.PI/180,a);if(c&&r!==0)c=(0,s4.rotateZ)(r*Math.PI/180,c);if(a){let l=(0,s4.translate)([e.x,e.y,0],a);this.boardGeom=(0,I2.subtract)(this.boardGeom,l)}if(c){let l=(0,s4.translate)([e.x,e.y,0],c);this.copperDrills.push({geom:l})}}}processVia(e){if(!this.boardGeom)return;let t;if(typeof e.outer_diameter==="number"&&typeof e.hole_diameter==="number"){let n=TUi({x:e.x,y:e.y,outerDiameter:e.outer_diameter,holeDiameter:e.hole_diameter,thickness:this.ctx.pcbThickness}),o=n;if(this.boardClipGeom)o=(0,I2.intersect)(this.boardClipGeom,n),o=(0,Jut.colorize)(gl.copper,o);t=this.viaGeoms.length,this.viaGeoms.push(o)}if(typeof e.hole_diameter==="number"){let n=DUi({x:e.x,y:e.y,holeDiameter:e.hole_diameter,thickness:this.ctx.pcbThickness});this.boardGeom=(0,I2.subtract)(this.boardGeom,n),this.copperDrills.push({geom:n,viaIndex:t})}}finalize(){if(!this.boardGeom)return;let e=this.copperDrills.map((o)=>({...o,bounds:(0,UKn.measureBoundingBox)(o.geom)})),t=(o,r,i)=>{let s=(0,UKn.measureBoundingBox)(o),a=e.filter((c)=>c[i]!==r&&[0,1,2].every((l)=>c.bounds[0][l]<=s[1][l]&&c.bounds[1][l]>=s[0][l])).map((c)=>c.geom);return(0,Jut.colorize)(gl.copper,a.length?(0,I2.subtract)(o,(0,I2.union)(...a)):o)};this.platedHoleGeoms=this.platedHoleGeoms.map((o,r)=>t(o,r,"platedHoleIndex")),this.viaGeoms=this.viaGeoms.map((o,r)=>t(o,r,"viaIndex"));let n=Gpt(this.board);if(this.boardGeom=(0,Jut.colorize)([n.r,n.g,n.b],this.boardGeom),this.finalGeoms=[this.boardGeom,...this.platedHoleGeoms,...this.viaGeoms],this.onCompleteCallback)this.onCompleteCallback(this.finalGeoms)}getGeoms(){return this.finalGeoms}},kUi=(e)=>{let[t,n]=Ute.useState(null),o=Ute.useRef(!1);return Ute.useEffect(()=>{let r=!1;if(!e){n(null);return}if(!e.some((l)=>l.type==="pcb_board"||l.type==="pcb_panel")){n(null);return}let s=CUi(e);n(s);let a=new QUi(e,(l)=>{});return(async()=>{if(o.current)return;o.current=!0;try{let l=!1;while(!l&&!r)if(l=a.step(1),!l)await new Promise((h)=>setTimeout(h,0));if(!r)n(a.getGeoms())}catch(l){console.error("Error during board geometry building:",l)}finally{o.current=!1}})(),()=>{r=!0}},[e]),t},LUi=({children:e,parent:t,position:n,rotation:o,scale:r,color:i,fontSize:s,anchorX:a,anchorY:c,depthOffset:l})=>{let{rootObject:h}=rg(),d=Wwe.useMemo(()=>{let u=new nj;if(u.text=e,n)u.position.fromArray(n);if(o)u.rotation.fromArray(o);if(r)u.scale.fromArray(r);return u.color=i||"white",u.fontSize=s||1,u.anchorX=a||"center",u.anchorY=c||"middle",u.depthOffset=l||0,u.font=null,u.sync(),u},[e,n,o,r,i,s,a,c,l]);return Wwe.useEffect(()=>{let u=t||h;if(!u||!d)return;return u.add(d),()=>{u.remove(d),d.dispose()}},[h,t,d]),null},yto=({error:e,cad_component:t})=>{let{rootObject:n}=rg(),[o,r]=pC.useState(!1),[i,s]=pC.useState(null),a=pC.useCallback((d)=>{if(d?.mousePosition)r(!0),s(d.mousePosition);else r(!1),s(null)},[]),c=pC.useCallback(()=>{r(!1),s(null)},[]),l=pC.useMemo(()=>{if(t?.position)return[t.position.x,t.position.y,t.position.z].map((u)=>Number.isNaN(u)?0:u);return[0,0,0]},[t]),h=pC.useMemo(()=>{let d=new Ba;return d.position.fromArray(l),d},[l]);return h.userData.cad_component_id=t?.cad_component_id,h.userData.pcb_component_id=t?.pcb_component_id,pC.useEffect(()=>{if(!n)return;return n.add(h),()=>{n.remove(h)}},[n,h]),QT.jsxs(QT.Fragment,{children:[QT.jsxs($pe,{isHovered:o,onHover:a,onUnhover:c,object:h,children:[QT.jsx(HUi,{parent:h}),QT.jsx(LUi,{parent:h,scale:[0.1,0.1,0.1],color:"red",anchorX:"center",anchorY:"middle",depthOffset:-99999,children:`${e.toString().slice(0,50)}...`})]}),o&&i?QT.jsx(zeo,{position:i,style:{fontFamily:"sans-serif",transform:"translate3d(-1rem, 0rem, 0)",backgroundColor:"white",padding:"6px",borderRadius:"4px",color:"red",pointerEvents:"none",userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none"},children:e.toString()}):null]})},HUi=({parent:e})=>{let t=pC.useMemo(()=>{let n=new Mo(new S_(0.5,0.5,0.5),new vs({depthTest:!1,transparent:!0,color:"red",opacity:0.5}));return n.renderOrder=999999,n.rotation.fromArray([Math.PI/4,Math.PI/4,0]),n},[]);return pC.useEffect(()=>(e.add(t),()=>{e.remove(t)}),[e,t]),null},FUi=(e)=>{if(e.length===0)return null;let t=e[0].x,n=e[0].y,o=e[0].x,r=e[0].y;for(let i=1;i<e.length;i++){let s=e[i];if(s.x<t)t=s.x;if(s.y<n)n=s.y;if(s.x>o)o=s.x;if(s.y>r)r=s.y}return{minX:t,minY:n,maxX:o,maxY:r}};function yf(e){if(e.outline&&e.outline.length>=3){let s=FUi(e.outline);return{...s,width:s.maxX-s.minX,height:s.maxY-s.minY,centerX:(s.minX+s.maxX)/2,centerY:(s.minY+s.maxY)/2}}let t=e.width??0,n=e.height??0,o=e.center?.x??0,r=e.center?.y??0;return{...{minX:o-t/2,maxX:o+t/2,minY:r-n/2,maxY:r+n/2},width:t,height:n,centerX:o,centerY:r}}function zUi(e,t,n){let o=Upt(e);if(!o.length)return[];let r=yf(t),i=Math.floor(r.width*n),s=Math.floor(r.height*n);if(i<=0||s<=0)return[];let a=new Set;for(let c of["top","bottom"]){let l=e.filter((p)=>(p.type==="pcb_smtpad"&&p.layer===c||p.type==="pcb_plated_hole"&&(!Array.isArray(p.layers)||p.layers.includes(c)))&&p.is_covered_with_solder_mask!==!0);if(!l.length)continue;let h=document.createElement("canvas");h.width=i,h.height=s;let d=h.getContext("2d");if(!d)continue;let u=new ui(d);u.configure({colorOverrides:{copper:{top:"white",bottom:"white",inner1:"white",inner2:"white",inner3:"white",inner4:"white",inner5:"white",inner6:"white",inner7:"white",inner8:"white"},drill:"rgba(0,0,0,0)"}}),u.setCameraBounds(r),u.drawElements(l,{layers:[c==="top"?"top_copper":"bottom_copper"],drawSoldermask:!1});let _=d.getImageData(0,0,i,s).data;for(let p of o){if(a.has(p)||!p.layers.includes(c))continue;let m=p.outer_diameter/2,A=(p.x-r.minX)*i/r.width,g=(r.maxY-p.y)*s/r.height,f=m*i/r.width,y=m*s/r.height;if(f<=0||y<=0)continue;let x=Math.max(0,Math.floor(A-f)),C=Math.min(i-1,Math.ceil(A+f)),b=Math.max(0,Math.floor(g-y)),I=Math.min(s-1,Math.ceil(g+y)),v=!1;for(let P=b;P<=I&&!v;P++)for(let M=x;M<=C;M++)if(_[(P*i+M)*4+3]>=128&&((M+0.5-A)/f)**2+((P+0.5-g)/y)**2<=1){v=!0;break}if(v)a.add(p)}}return[...a]}function OUi({ctx:e,vias:t,boardData:n,layer:o,width:r,height:i}){if(!t.length)return;let s=yf(n);e.save(),e.globalCompositeOperation="destination-out",e.fillStyle="black";for(let a of t){if(!a.layers.includes(o))continue;let c=(a.x-s.minX)*r/s.width,l=(o==="top"?s.maxY-a.y:a.y-s.minY)*i/s.height;e.beginPath(),e.ellipse(c,l,a.hole_diameter/2*r/s.width,a.hole_diameter/2*i/s.height,0,0,Math.PI*2),e.fill()}e.restore()}function VUi({layer:e,circuitJson:t,boardData:n,copperColor:o,traceTextureResolution:r}){let s=Vo(t).pcb_smtpad.list().filter((C)=>C.layer===e);if(s.length===0)return null;let a=Vo(t).pcb_hole.list(),c=Vo(t).pcb_plated_hole.list().filter((C)=>!Array.isArray(C.layers)||C.layers.includes(e)),l=Vo(t).pcb_via.list().filter((C)=>!Array.isArray(C.layers)||C.layers.includes(e)),h=Vo(t).pcb_cutout.list(),d=[...a,...c,...l],u=e==="top"?"top_copper":"bottom_copper",_=yf(n),p=document.createElement("canvas"),m=Math.floor(_.width*r),A=Math.floor(_.height*r);p.width=m,p.height=A;let g=p.getContext("2d");if(!g)return null;if(e==="bottom")g.translate(0,A),g.scale(1,-1);let f="rgba(0,0,0,0)",y=new ui(g);y.configure({colorOverrides:{copper:{top:o,bottom:o,inner1:o,inner2:o,inner3:o,inner4:o,inner5:o,inner6:o,inner7:o,inner8:o},copperPour:{top:f,bottom:f},drill:f,boardOutline:f,substrate:f,keepout:{top:f,bottom:f},fabricationNote:f,courtyard:{top:f,bottom:f},silkscreen:{top:f,bottom:f},soldermask:{top:f,bottom:f},soldermaskWithCopperUnderneath:{top:f,bottom:f},soldermaskOverCopper:{top:f,bottom:f}}}),y.setCameraBounds({minX:_.minX,maxX:_.maxX,minY:_.minY,maxY:_.maxY}),y.drawElements([...s,...d,...h],{layers:[u],drawSoldermask:!1,drawSoldermaskTop:!1,drawSoldermaskBottom:!1});let x=new Id(p);return x.generateMipmaps=!0,x.minFilter=Jd,x.magFilter=Ec,x.anisotropy=16,x.needsUpdate=!0,x}var YUi=(e)=>{let t=e.filter((n)=>n.type==="pcb_panel");if(t.length===0)return null;if(t.length===1)return t[0].pcb_panel_id;return null};function GUi({layer:e,circuitJson:t,panelData:n,outlineColor:o="black",traceTextureResolution:r}){let i=YUi(t);if(!i)return null;let a=Vo(t).pcb_board.list().filter((m)=>m.pcb_panel_id===i||m.position_mode==="relative_to_panel_anchor"&&!m.pcb_panel_id);if(a.length===0)return null;let c=document.createElement("canvas"),l=Math.floor(n.width*r),h=Math.floor(n.height*r);c.width=l,c.height=h;let d=c.getContext("2d");if(!d)return null;if(e==="bottom")d.translate(0,h),d.scale(1,-1);d.strokeStyle=o,d.lineWidth=0.05*r;let u=(m)=>(m-n.center.x+n.width/2)*r,_=(m)=>(-(m-n.center.y)+n.height/2)*r;a.forEach((m)=>{if(m.outline&&m.outline.length>=2)d.beginPath(),m.outline.forEach((A,g)=>{let f=u(A.x),y=_(A.y);if(g===0)d.moveTo(f,y);else d.lineTo(f,y)}),d.closePath(),d.stroke();else{let{width:A,height:g}=m,{x:f,y}=m.center,x=u(f-A/2),C=_(y+g/2);d.strokeRect(x,C,A*r,g*r)}});let p=new Id(c);return p.generateMipmaps=!0,p.minFilter=Jd,p.magFilter=Ec,p.anisotropy=16,p.needsUpdate=!0,p}function UUi({layer:e,circuitJson:t,boardData:n,traceColor:o,traceTextureResolution:r}){let i=Vo(t).pcb_trace.list(),s=Vo(t).pcb_via.list(),a=Vo(t).pcb_plated_hole.list(),c=e==="top"?"top_copper":"bottom_copper",l=i.filter((x)=>a2e(x).includes(c));if(l.length===0)return null;let h=a.filter((x)=>x.layers.includes(e)),d=[...l,...s,...h],u=yf(n),_=document.createElement("canvas"),p=Math.floor(u.width*r),m=Math.floor(u.height*r);_.width=p,_.height=m;let A=_.getContext("2d");if(!A)return null;if(e==="bottom")A.translate(0,m),A.scale(1,-1);let g="rgba(0,0,0,0)",f=new ui(A);f.configure({colorOverrides:{copper:{top:o,bottom:o,inner1:o,inner2:o,inner3:o,inner4:o,inner5:o,inner6:o,inner7:o,inner8:o},copperPour:{top:g,bottom:g},drill:g,boardOutline:g,substrate:g,keepout:{top:g,bottom:g},fabricationNote:g,courtyard:{top:g,bottom:g},silkscreen:{top:g,bottom:g},soldermask:{top:g,bottom:g},soldermaskWithCopperUnderneath:{top:g,bottom:g},soldermaskOverCopper:{top:g,bottom:g}}}),f.setCameraBounds({minX:u.minX,maxX:u.maxX,minY:u.minY,maxY:u.maxY}),f.drawElements(d,{layers:[c],clipContextElements:t,drawSoldermask:!1,drawSoldermaskTop:!1,drawSoldermaskBottom:!1});let y=new Id(_);return y.generateMipmaps=!0,y.minFilter=Jd,y.magFilter=Ec,y.anisotropy=16,y.needsUpdate=!0,y}var WUi=(e)=>{let[t=0,n=0,o=0]=e;return`rgb(${Math.round(t*255)}, ${Math.round(n*255)}, ${Math.round(o*255)})`},XUi=8;function jKn({layer:e,circuitJson:t,boardData:n,traceTextureResolution:o=K6,copperColor:r=WUi(gl.copper),onlyCoveredBySoldermask:i=!1}){let s=t.filter((P)=>P.type==="pcb_copper_pour"),a=e==="top"?"top_copper":"bottom_copper",c=s.filter((P)=>P.layer===e&&(!i||P.covered_with_solder_mask!==!1));if(c.length===0)return null;let l=t.filter((P)=>P.type==="pcb_hole"),h=t.filter((P)=>{if(P.type!=="pcb_plated_hole")return!1;return!Array.isArray(P.layers)||P.layers.includes(e)}),d=t.filter((P)=>{if(P.type!=="pcb_via")return!1;return!Array.isArray(P.layers)||P.layers.includes(e)}),u=[...l,...h,...d],_=yf(n),p=document.createElement("canvas"),m=Math.floor(_.width*o),A=Math.floor(_.height*o);p.width=m,p.height=A;let g=p.getContext("2d");if(!g)return null;if(e==="bottom")g.translate(0,A),g.scale(1,-1);let f="rgba(0,0,0,0)",y=r,x=r,C=(P,M)=>{if(P.length===0)return;let B=[...P,...u],T=new ui(g);T.configure({colorOverrides:{copper:{top:M,bottom:M,inner1:M,inner2:M,inner3:M,inner4:M,inner5:M,inner6:M,inner7:M,inner8:M},copperPour:{top:f,bottom:f},drill:f,boardOutline:f,substrate:f,keepout:{top:f,bottom:f},fabricationNote:f,courtyard:{top:f,bottom:f},silkscreen:{top:f,bottom:f},soldermask:{top:f,bottom:f},soldermaskWithCopperUnderneath:{top:f,bottom:f},soldermaskOverCopper:{top:f,bottom:f}}}),T.setCameraBounds({minX:_.minX,maxX:_.maxX,minY:_.minY,maxY:_.maxY}),T.drawElements(B,{layers:[a],drawSoldermask:!1,drawSoldermaskTop:!1,drawSoldermaskBottom:!1});for(let N=1;N<XUi;N+=1)T.drawElements(B,{layers:[a],drawSoldermask:!1,drawSoldermaskTop:!1,drawSoldermaskBottom:!1})},b=c.filter((P)=>P.covered_with_solder_mask!==!1),I=c.filter((P)=>P.covered_with_solder_mask===!1);if(C(b,y),!i)C(I,x);let v=new Id(p);return v.generateMipmaps=!0,v.minFilter=Jd,v.magFilter=Ec,v.anisotropy=16,v.needsUpdate=!0,v}var KKn=(e,t)=>{e.setCameraBounds({minX:t.minX,maxX:t.maxX,minY:t.minY,maxY:t.maxY})},jUi=({ctx:e,layer:t,bounds:n,elements:o,copperColor:r})=>{let i=t==="top"?"top_copper":"bottom_copper",s=new ui(e);s.configure({colorOverrides:{copper:{top:r,bottom:r,inner1:r,inner2:r,inner3:r,inner4:r,inner5:r,inner6:r,inner7:r,inner8:r}}}),KKn(s,n),s.drawElements(o,{layers:[i]});let a=o.filter((d)=>d.type==="pcb_copper_text"&&d.is_knockout===!0);if(a.length===0)return;let c=document.createElement("canvas");c.width=e.canvas.width,c.height=e.canvas.height;let l=c.getContext("2d");if(!l)return;let h=new ui(l);h.configure({colorOverrides:{copper:{top:"rgb(255,255,255)",bottom:"rgb(255,255,255)",inner1:"rgb(255,255,255)",inner2:"rgb(255,255,255)",inner3:"rgb(255,255,255)",inner4:"rgb(255,255,255)",inner5:"rgb(255,255,255)",inner6:"rgb(255,255,255)",inner7:"rgb(255,255,255)",inner8:"rgb(255,255,255)"}}}),KKn(h,n),h.drawElements(a.map((d)=>({...d,is_knockout:!1})),{layers:[i]}),e.save(),e.globalCompositeOperation="destination-out",e.drawImage(c,0,0),e.restore()};function KUi({layer:e,circuitJson:t,boardData:n,copperColor:o="rgb(230, 153, 51)",traceTextureResolution:r=K6}){let i=t.filter((u)=>u.type==="pcb_copper_text"&&("layer"in u)&&u.layer===e);if(i.length===0)return null;let s=yf(n),a=Math.floor(s.width*r),c=Math.floor(s.height*r);if(a<=0||c<=0)return null;let l=document.createElement("canvas");l.width=a,l.height=c;let h=l.getContext("2d");if(!h)return null;if(e==="bottom")h.translate(0,c),h.scale(1,-1);jUi({ctx:h,layer:e,bounds:s,elements:i,copperColor:o});let d=new Id(l);return d.generateMipmaps=!0,d.minFilter=Jd,d.magFilter=Ec,d.anisotropy=16,d.needsUpdate=!0,d}var xto=25.4,$Ui=xto/1000,qUi=/^\s*(-?\d*(?:\.\d+)?)(?:\s*(mm|mil|inch|in|"))?\s*$/i;function JUi(e){if(!e)return;let t=e.trim().toLowerCase();if(t==='"')return"in";if(t==="inch")return"in";return t}function qMe(e){if(e===null||e===void 0)return;if(typeof e==="number")return Number.isFinite(e)?e:void 0;if(typeof e!=="string")return;let t=e.trim();if(t.length===0)return;let n=t.match(qUi);if(!n){let a=Number.parseFloat(t);return Number.isFinite(a)?a:void 0}let[,o,r]=n,i=Number.parseFloat(o||"0");if(!Number.isFinite(i))return;switch(JUi(r)){case"mil":return i*$Ui;case"in":return i*xto;case"mm":case void 0:return i;default:return i}}function Xh(e,t){let n=qMe(e);return n===void 0?t:n}var ZUi="rgb(255,243,204)",uu="rgba(0,0,0,0)",eWi=(e,t)=>{e.setCameraBounds({minX:t.minX,maxX:t.maxX,minY:t.minY,maxY:t.maxY})},tWi=(e)=>{if(e.type==="pcb_fabrication_note_rect")return{...e,width:qMe(e.width)??0,height:qMe(e.height)??0,stroke_width:Xh(e.stroke_width,0.1),corner_radius:qMe(e.corner_radius)};if(e.type==="pcb_fabrication_note_path")return{...e,stroke_width:Xh(e.stroke_width,0.1)};if(e.type==="pcb_fabrication_note_text")return{...e,font_size:Xh(e.font_size,1)};if(e.type==="pcb_fabrication_note_dimension")return{...e,font_size:Xh(e.font_size,1),arrow_size:Xh(e.arrow_size,1),offset_distance:Xh(e.offset_distance,0)};return e},nWi=({ctx:e,layer:t,bounds:n,elements:o})=>{let r=`${t}_fabrication_note`,i=o.map(tWi),s=new ui(e);s.configure({colorOverrides:{copper:{top:uu,bottom:uu,inner1:uu,inner2:uu,inner3:uu,inner4:uu,inner5:uu,inner6:uu,inner7:uu,inner8:uu},copperPour:{top:uu,bottom:uu},drill:uu,boardOutline:uu,substrate:uu,keepout:{top:uu,bottom:uu},courtyard:{top:uu,bottom:uu},soldermask:{top:uu,bottom:uu},soldermaskWithCopperUnderneath:{top:uu,bottom:uu},soldermaskOverCopper:{top:uu,bottom:uu},silkscreen:{top:uu,bottom:uu},fabricationNote:ZUi}}),eWi(s,n),s.drawElements(i,{layers:[r]})},oWi=(e)=>({minX:e.center.x-e.width/2,maxX:e.center.x+e.width/2,minY:e.center.y-e.height/2,maxY:e.center.y+e.height/2,width:e.width,height:e.height,centerX:e.center.x,centerY:e.center.y}),rWi=(e,t)=>{let n=Math.min(e.minX,t.minX),o=Math.max(e.maxX,t.maxX),r=Math.min(e.minY,t.minY),i=Math.max(e.maxY,t.maxY);return{minX:n,maxX:o,minY:r,maxY:i,width:o-n,height:i-r,centerX:(n+o)/2,centerY:(r+i)/2}},Xwe=(e,t)=>{let n=e.filter((s)=>s.type==="pcb_panel"),o=e.filter((s)=>s.type==="pcb_board"),r=n.find((s)=>s.pcb_panel_id===t.pcb_board_id)??n[0];if(r&&r.width>0&&r.height>0)return oWi(r);return(o.length>1?o:[t]).map((s)=>yf(s)).reduce((s,a)=>rWi(s,a))},iWi=(e,t)=>{if(!("layer"in e)||e.layer!==t)return!1;let n=e.type;return n.startsWith("pcb_fabrication_note_")&&n!=="pcb_fabrication_note_text"&&n!=="pcb_fabrication_note_dimension"};function sWi({layer:e,circuitJson:t,boardData:n,traceTextureResolution:o=K6}){let r=t.filter((d)=>iWi(d,e));if(r.length===0)return null;let i=Xwe(t,n),s=Math.floor(i.width*o),a=Math.floor(i.height*o);if(s<=0||a<=0)return null;let c=document.createElement("canvas");c.width=s,c.height=a;let l=c.getContext("2d");if(!l)return null;if(e==="bottom")l.translate(0,a),l.scale(1,-1);nWi({ctx:l,layer:e,bounds:i,elements:r});let h=new Id(c);return h.generateMipmaps=!0,h.minFilter=Jd,h.magFilter=Ec,h.anisotropy=16,h.needsUpdate=!0,h}var aWi=(e,t)=>{e.setCameraBounds({minX:t.minX,maxX:t.maxX,minY:t.minY,maxY:t.maxY})},cWi=({ctx:e,layer:t,bounds:n,elements:o,keepoutColor:r})=>{let i=t==="top"?"top_copper":"bottom_copper",s=new ui(e);s.configure({colorOverrides:{keepout:{top:r,bottom:r}}}),aWi(s,n),s.drawElements(o,{layers:[i],drawSoldermask:!1,drawSoldermaskTop:!1,drawSoldermaskBottom:!1})},lWi=(e,t)=>{if(e.type!=="pcb_keepout")return!1;if(!("layers"in e)||!Array.isArray(e.layers))return!0;return e.layers.includes(t)};function hWi({layer:e,circuitJson:t,boardData:n,traceTextureResolution:o=K6,keepoutColor:r=e==="bottom"?"#4b72d2":"#d24b4b"}){let i=t.filter((u)=>lWi(u,e));if(i.length===0)return null;let s=yf(n),a=Math.floor(s.width*o),c=Math.floor(s.height*o);if(a<=0||c<=0)return null;let l=document.createElement("canvas");l.width=a,l.height=c;let h=l.getContext("2d");if(!h)return null;if(e==="bottom")h.translate(0,c),h.scale(1,-1);cWi({ctx:h,layer:e,bounds:s,elements:i,keepoutColor:r});let d=new Id(l);return d.generateMipmaps=!0,d.minFilter=Jd,d.magFilter=Ec,d.anisotropy=16,d.needsUpdate=!0,d}var Rd="rgba(0,0,0,0)",dWi=(e,t)=>{e.setCameraBounds({minX:t.minX,maxX:t.maxX,minY:t.minY,maxY:t.maxY})},uWi=(e)=>{if(e.type==="pcb_note_line")return{...e,x1:Xh(e.x1,0),y1:Xh(e.y1,0),x2:Xh(e.x2,0),y2:Xh(e.y2,0),stroke_width:Xh(e.stroke_width,0.1)};if(e.type==="pcb_note_rect")return{...e,center:{x:Xh(e.center.x,0),y:Xh(e.center.y,0)},width:Xh(e.width,0),height:Xh(e.height,0),stroke_width:Xh(e.stroke_width,0.1),corner_radius:Xh(e.corner_radius,0)};if(e.type==="pcb_note_text")return{...e,anchor_position:{x:Xh(e.anchor_position.x,0),y:Xh(e.anchor_position.y,0)},font_size:Xh(e.font_size,1)};if(e.type==="pcb_note_path")return{...e,route:e.route.map((t)=>({...t,x:Xh(t.x,0),y:Xh(t.y,0)})),stroke_width:Xh(e.stroke_width,0.1)};if(e.type==="pcb_note_dimension")return{...e,from:{x:Xh(e.from.x,0),y:Xh(e.from.y,0)},to:{x:Xh(e.to.x,0),y:Xh(e.to.y,0)},font_size:Xh(e.font_size,1),arrow_size:Xh(e.arrow_size,1),offset_distance:Xh(e.offset_distance,0)};return e},pWi=({ctx:e,bounds:t,elements:n})=>{let o=n.map(uWi),r=new ui(e);r.configure({colorOverrides:{copper:{top:Rd,bottom:Rd,inner1:Rd,inner2:Rd,inner3:Rd,inner4:Rd,inner5:Rd,inner6:Rd,inner7:Rd,inner8:Rd},copperPour:{top:Rd,bottom:Rd},drill:Rd,boardOutline:Rd,substrate:Rd,keepout:{top:Rd,bottom:Rd},courtyard:{top:Rd,bottom:Rd},soldermask:{top:Rd,bottom:Rd},soldermaskWithCopperUnderneath:{top:Rd,bottom:Rd},soldermaskOverCopper:{top:Rd,bottom:Rd},silkscreen:{top:Rd,bottom:Rd},fabricationNote:Rd}}),dWi(r,t),r.drawElements(o)},mWi=(e,t)=>{if(!("layer"in e)||e.layer!==t)return!1;let n=e.type;return n.startsWith("pcb_note_")&&n!=="pcb_note_dimension"};function _Wi({layer:e,circuitJson:t,boardData:n,traceTextureResolution:o=K6}){let r=t.filter((d)=>mWi(d,e));if(r.length===0)return null;let i=Xwe(t,n),s=Math.floor(i.width*o),a=Math.floor(i.height*o);if(s<=0||a<=0)return null;let c=document.createElement("canvas");c.width=s,c.height=a;let l=c.getContext("2d");if(!l)return null;if(e==="bottom")l.translate(0,a),l.scale(1,-1);pWi({ctx:l,bounds:i,elements:r});let h=new Id(c);return h.generateMipmaps=!0,h.minFilter=Jd,h.magFilter=Ec,h.anisotropy=16,h.needsUpdate=!0,h}var gWi="rgb(255,243,204)",B0="rgba(0,0,0,0)",Cto=(e,t,n)=>{let o=t==="top"?e.tented_on_top:e.tented_on_bottom,r="is_tented"in e?e.is_tented:void 0,i=t==="top"?n?.default_via_tented_on_top:n?.default_via_tented_on_bottom;return o??r??i??!1},AWi=(e,t,n,o)=>{if(e.type==="pcb_cutout")return!0;if(e.type==="pcb_via")return!o||!Cto(e,t,n);if(e.type==="pcb_hole"||e.type==="pcb_plated_hole")return!o||e.is_covered_with_solder_mask!==!0;return!1},fWi=(e,t)=>{e.setCameraBounds({minX:t.minX,maxX:t.maxX,minY:t.minY,maxY:t.maxY})},yWi=({ctx:e,layer:t,bounds:n,elements:o,circuitJson:r,silkscreenColor:i,soldermaskVisible:s})=>{let a=t==="top"?"top_silkscreen":"bottom_silkscreen",c=new ui(e);c.configure({colorOverrides:{copper:{top:B0,bottom:B0,inner1:B0,inner2:B0,inner3:B0,inner4:B0,inner5:B0,inner6:B0,inner7:B0,inner8:B0},copperPour:{top:B0,bottom:B0},drill:B0,boardOutline:B0,substrate:B0,keepout:{top:B0,bottom:B0},courtyard:{top:B0,bottom:B0},soldermask:{top:B0,bottom:B0},soldermaskWithCopperUnderneath:{top:B0,bottom:B0},soldermaskOverCopper:{top:B0,bottom:B0},silkscreen:{top:i,bottom:i},fabricationNote:gWi}}),fWi(c,n),c.drawElements(o,{layers:[a],clipContextElements:r});let l=r.flatMap((h)=>{if(h.type==="pcb_trace"){let u=e.boardOwnerMap?.get(h.pcb_trace_id),_=h.route.filter((p)=>p.route_type==="via"&&(!s||!Cto(p,t,u)));return _.length?[{...h,route:_}]:[]}let d=h.type==="pcb_via"?e.boardOwnerMap?.get(h.pcb_via_id):void 0;return AWi(h,t,d,s)?[h]:[]});c.drawElements(l,{layers:[a],clipContextElements:r,clearDrillHoles:!0})},xWi=(e,t)=>{if(!("layer"in e)||e.layer!==t)return!1;return e.type.startsWith("pcb_silkscreen_")};function CWi({layer:e,circuitJson:t,boardData:n,traceTextureResolution:o=K6,silkscreenColor:r="rgb(255,255,255)",soldermaskVisible:i=!0}){let s=t.filter((_)=>xWi(_,e));if(s.length===0)return null;let a=Xwe(t,n),c=Math.floor(a.width*o),l=Math.floor(a.height*o);if(c<=0||l<=0)return null;let h=document.createElement("canvas");h.width=c,h.height=l;let d=h.getContext("2d");if(!d)return null;if(e==="bottom")d.translate(0,l),d.scale(1,-1);yWi({ctx:d,layer:e,bounds:a,elements:s,circuitJson:t,silkscreenColor:r,soldermaskVisible:i});let u=new Id(h);return u.generateMipmaps=!0,u.minFilter=Jd,u.magFilter=Ec,u.anisotropy=16,u.needsUpdate=!0,u}var mpe=(e)=>{let[t=0,n=0,o=0]=e;return`rgb(${Math.round(t*255)}, ${Math.round(n*255)}, ${Math.round(o*255)})`},bWi=(e)=>{let t=mpe(lUi[e.material]??gl.fr4SolderMaskGreen),n=e.material==="fr1"?mpe(gl.fr1TracesWithMaskCopper):mpe(gl.fr4TracesWithMaskGreen),o=Ato(e.solder_mask_color);if(!o)return{soldermask:t,soldermaskOverCopper:n,copper:mpe(gl.copper),transparent:"rgba(0,0,0,0)"};let r=new No().setRGB(gl.copper[0],gl.copper[1],gl.copper[2],_R);return{soldermask:GKn(o),soldermaskOverCopper:GKn(yUi({soldermaskColor:o,copperColor:r,soldermaskOpacity:AUi(e.solder_mask_color)})),copper:mpe(gl.copper),transparent:"rgba(0,0,0,0)"}},$Kn=(e,t)=>{e.setCameraBounds({minX:t.minX,maxX:t.maxX,minY:t.minY,maxY:t.maxY})},IWi=(e)=>e.type.startsWith("pcb_note_")||e.type.startsWith("pcb_fabrication_note_"),vWi=({ctx:e,layer:t,bounds:n,elements:o,boardData:r})=>{let i=bWi(r),s=t==="top"?"top_copper":"bottom_copper",a=new ui(e);a.configure({colorOverrides:{copper:{top:i.transparent,bottom:i.transparent,inner1:i.transparent,inner2:i.transparent,inner3:i.transparent,inner4:i.transparent,inner5:i.transparent,inner6:i.transparent,inner7:i.transparent,inner8:i.transparent},drill:i.transparent,boardOutline:i.transparent,substrate:i.transparent,keepout:{top:i.transparent,bottom:i.transparent},fabricationNote:i.transparent,silkscreen:{top:i.transparent,bottom:i.transparent},courtyard:{top:i.transparent,bottom:i.transparent},soldermask:{top:i.soldermask,bottom:i.soldermask},soldermaskWithCopperUnderneath:{top:i.soldermaskOverCopper,bottom:i.soldermaskOverCopper},soldermaskOverCopper:{top:i.soldermaskOverCopper,bottom:i.soldermaskOverCopper}}}),$Kn(a,n);let c=o.filter((h)=>h.type!=="pcb_keepout"&&!IWi(h));a.drawElements(c,{layers:[s],drawSoldermask:!0,drawSoldermaskTop:t==="top",drawSoldermaskBottom:t==="bottom"});let l=c.filter((h)=>h.type==="pcb_copper_pour"&&h.layer===t&&h.covered_with_solder_mask===!1);if(l.length>0){e.save(),e.globalCompositeOperation="destination-out";let h=new ui(e);h.configure({colorOverrides:{copper:{top:i.copper,bottom:i.copper,inner1:i.copper,inner2:i.copper,inner3:i.copper,inner4:i.copper,inner5:i.copper,inner6:i.copper,inner7:i.copper,inner8:i.copper}}}),$Kn(h,n),h.drawElements(l,{layers:[s]}),e.restore()}};function SWi({layer:e,circuitJson:t,boardData:n,traceTextureResolution:o=K6}){let r=Xwe(t,n),i=Math.floor(r.width*o),s=Math.floor(r.height*o);if(i<=0||s<=0)return null;let a=document.createElement("canvas");a.width=i,a.height=s;let c=a.getContext("2d");if(!c)return null;if(e==="bottom")c.translate(0,s),c.scale(1,-1);let l=t.some((d)=>d.type==="pcb_board")?t:[n,...t];vWi({ctx:c,layer:e,bounds:r,elements:l,boardData:n});let h=new Id(a);return h.generateMipmaps=!0,h.minFilter=Jd,h.magFilter=Ec,h.anisotropy=16,h.needsUpdate=!0,h}var PWi=(e,t)=>{e.setCameraBounds({minX:t.minX,maxX:t.maxX,minY:t.minY,maxY:t.maxY})},EWi=({ctx:e,layer:t,bounds:n,elements:o,copperColor:r})=>{let i=t==="top"?"top_copper":"bottom_copper",s="rgba(0,0,0,0)",a=new ui(e);a.configure({colorOverrides:{copper:{top:r,bottom:r,inner1:r,inner2:r,inner3:r,inner4:r,inner5:r,inner6:r,inner7:r,inner8:r},drill:"rgba(0,0,0,0)",boardOutline:"rgba(0,0,0,0)",substrate:"rgba(0,0,0,0)",keepout:{top:"rgba(0,0,0,0)",bottom:"rgba(0,0,0,0)"},fabricationNote:"rgba(0,0,0,0)",silkscreen:{top:"rgba(0,0,0,0)",bottom:"rgba(0,0,0,0)"},courtyard:{top:"rgba(0,0,0,0)",bottom:"rgba(0,0,0,0)"},soldermask:{top:"rgba(0,0,0,0)",bottom:"rgba(0,0,0,0)"},soldermaskWithCopperUnderneath:{top:"rgba(0,0,0,0)",bottom:"rgba(0,0,0,0)"},soldermaskOverCopper:{top:"rgba(0,0,0,0)",bottom:"rgba(0,0,0,0)"}}}),PWi(a,n),a.drawElements(o,{layers:[i]})};function MWi({layer:e,circuitJson:t,boardData:n,copperColor:o="rgb(230, 153, 51)",traceTextureResolution:r=K6}){let i=t.filter((u)=>{if(u.type==="pcb_via")return!0;if(u.type!=="pcb_plated_hole")return!1;let _=u;return!Array.isArray(_.layers)||_.layers.includes(e)});if(i.length===0)return null;let s=yf(n),a=Math.floor(s.width*r),c=Math.floor(s.height*r);if(a<=0||c<=0)return null;let l=document.createElement("canvas");l.width=a,l.height=c;let h=l.getContext("2d");if(!h)return null;if(e==="bottom")h.translate(0,c),h.scale(1,-1);EWi({ctx:h,layer:e,bounds:s,elements:i,copperColor:o});let d=new Id(l);return d.generateMipmaps=!0,d.minFilter=Jd,d.magFilter=Ec,d.anisotropy=16,d.needsUpdate=!0,d}var qKn=(e)=>{let[t=0,n=0,o=0]=e;return`rgb(${Math.round(t*255)}, ${Math.round(n*255)}, ${Math.round(o*255)})`},n0t=(e)=>Math.max(0,Math.min(255,e)),wWi=(e,t,n,o={})=>{let r=e.getImageData(0,0,t,n),i=r.data,s=Math.max(t-1,1),a=Math.max(n-1,1);for(let c=0;c<i.length;c+=4){if((i[c+3]??0)<16)continue;let h=i[c]??0,d=i[c+1]??0,u=i[c+2]??0,_=0.2126*h+0.7152*d+0.0722*u;if(!(d>h*1.35&&d>u*1.15&&_<90&&h<80&&u<80))continue;let m=c/4,A=m%t,g=Math.floor(m/t),f=A/s,y=g/a,x=f*0.62+(1-y)*0.38,C=Math.sin((f*1.15+y*0.35)*Math.PI)*0.04,b=0.74+x*0.18+C,I=o.includeReflection?(()=>{let N=f-0.36,D=y-0.22,L=Math.max(0,1-Math.hypot(N,D)/0.38);return L*L*0.07})():0,v=(h*0.9+3)*b,P=(d*1.08+15)*b,M=(u*1.28+13)*b;i[c]=n0t(v*(1-I)+255*I),i[c+1]=n0t(P*(1-I)+255*I),i[c+2]=n0t(M*(1-I)+255*I)}e.putImageData(r,0,0)},BWi=({textures:e,boardData:t,traceTextureResolution:n,layer:o,openViaHoles:r})=>{if(!e.some((u)=>u?.image))return null;let s=yf(t),a=Math.floor(s.width*n),c=Math.floor(s.height*n);if(a<=0||c<=0)return null;let l=document.createElement("canvas");l.width=a,l.height=c+1;let h=l.getContext("2d");if(!h)return null;for(let u of e){if(!u?.image)continue;let _=u.image;h.drawImage(_,0,0,a,c)}OUi({ctx:h,vias:r,boardData:t,layer:o,width:a,height:c}),wWi(h,a,c,{includeReflection:o==="top"});let d=new Id(l);return d.generateMipmaps=!1,d.minFilter=Ec,d.magFilter=Ec,d.premultiplyAlpha=!0,d.anisotropy=16,d.needsUpdate=!0,d},TWi=({textures:e,soldermaskTexture:t,boardData:n,traceTextureResolution:o})=>{if(!t?.image||!e.some((h)=>h?.image))return null;let r=yf(n),i=Math.floor(r.width*o),s=Math.floor(r.height*o);if(i<=0||s<=0)return null;let a=document.createElement("canvas");a.width=i,a.height=s+1;let c=a.getContext("2d");if(!c)return null;for(let h of e){if(!h?.image)continue;c.drawImage(h.image,0,0,i,s)}c.globalCompositeOperation="destination-in",c.drawImage(t.image,0,0,i,s),c.globalCompositeOperation="source-over";let l=new Id(a);return l.colorSpace=zAe,l.generateMipmaps=!1,l.minFilter=Ec,l.magFilter=Ec,l.premultiplyAlpha=!1,l.needsUpdate=!0,l};function bto({circuitJson:e,boardData:t,traceTextureResolution:n,visibility:o}){let r=qKn(gl.copper),i="rgb(255,255,255)",s=qKn(gl.copper),a=o?.boardBody??!0,c=zUi(e,t,n),l=(_)=>{let p=(_==="top"?o?.topMask:o?.bottomMask)??!0,m=(_==="top"?o?.topCopper:o?.bottomCopper)??!0,A=(_==="top"?o?.topSilkscreen:o?.bottomSilkscreen)??!0,g=o?.keepout??!0,f=p?SWi({layer:_,circuitJson:e,boardData:t,traceTextureResolution:n}):null,y=m?UUi({layer:_,circuitJson:e,boardData:t,traceColor:r,traceTextureResolution:n}):null,x=m?jKn({layer:_,circuitJson:e,boardData:t,traceTextureResolution:n,copperColor:s}):null,C=p&&m?jKn({layer:_,circuitJson:e,boardData:t,traceTextureResolution:n,copperColor:s,onlyCoveredBySoldermask:!0}):null,b=m?KUi({layer:_,circuitJson:e,boardData:t,copperColor:s,traceTextureResolution:n}):null,I=m?VUi({layer:_,circuitJson:e,boardData:t,copperColor:s,traceTextureResolution:n}):null,v=m?MWi({layer:_,circuitJson:e,boardData:t,copperColor:s,traceTextureResolution:n}):null,P=A?CWi({layer:_,circuitJson:e,boardData:t,silkscreenColor:"rgb(255,255,255)",traceTextureResolution:n,soldermaskVisible:p}):null,M=A?sWi({layer:_,circuitJson:e,boardData:t,traceTextureResolution:n}):null,T=o?.pcbNotes??!1?_Wi({layer:_,circuitJson:e,boardData:t,traceTextureResolution:n}):null,N=a?GUi({layer:_,circuitJson:e,panelData:t,traceTextureResolution:n}):null,D=g?hWi({layer:_,circuitJson:e,boardData:t,traceTextureResolution:n}):null,L=BWi({openViaHoles:c,textures:[x,y,I,v,f,b,P,M,T,N,D],boardData:t,traceTextureResolution:n,layer:_}),H=p&&m?TWi({textures:[y,C],soldermaskTexture:f,boardData:t,traceTextureResolution:n}):null;return{boardTexture:L,maskedCopperTexture:H}},h=t.num_layers??2,d=l("top"),u=h<2?null:l("bottom");return{topBoard:d.boardTexture,bottomBoard:u?.boardTexture??null,topMaskedCopper:d.maskedCopperTexture,bottomMaskedCopper:u?.maskedCopperTexture??null}}var Uv={bumpScale:0.12,normalScale:0.08,roughness:0.7,roughnessBias:0.015,roughnessVariance:0.025,clearcoat:0.08,clearcoatRoughness:0.55,detailStrength:0.035},pwe={roughness:0.42,metalness:0.5,roughnessVariance:0.035,detailStrength:0.028},mwe=0.22,DWi=0.7,NWi=0.86,JKn={height:mwe,microSurfaceWeight:1,roughness:0.7,metalness:0.015,isExposedCopper:!1,isMaskedCopper:!1},RWi={height:DWi,microSurfaceWeight:0.9,roughness:0.54,metalness:0.025,isExposedCopper:!1,isMaskedCopper:!0},o0t=(e)=>Math.max(0,Math.min(1,e)),ZKn=(e)=>1-e,Spe=(e,t,n)=>{let o=Math.imul(e,374761393)^Math.imul(t,668265263)^n;return o=Math.imul(o^o>>>13,1274126177),((o^o>>>16)>>>0)/4294967295},e$n=(e)=>e*e*(3-2*e),r0t=(e,t,n)=>e+(t-e)*n,S0t=(e,t,n,o)=>{let r=e/n,i=t/n,s=Math.floor(r),a=Math.floor(i),c=e$n(r-s),l=e$n(i-a),h=r0t(Spe(s,a,o),Spe(s+1,a,o),c),d=r0t(Spe(s,a+1,o),Spe(s+1,a+1,o),c);return r0t(h,d,l)},QWi=(e,t,n)=>{let o=(S0t(e,t,7,n+31)-0.5)*0.55,r=Math.sin(e*0.12+S0t(e,t,44,n+37)*2)*0.22;return(o+r)*pwe.detailStrength},kWi=(e,t,n)=>{let o=(Spe(e,t,n+53)-0.5)*0.42,r=Math.sin(e*0.26+t*0.06)*0.2+Math.sin(t*0.31-e*0.04)*0.12;return(o+r)*0.045},LWi=(e,t,n,o)=>{if(o)return RWi;if(fUi({red:e,green:t,blue:n}))return JKn;if(e>120&&t>70&&n<150&&e>t*1.05&&t>n*1.15)return{height:NWi,microSurfaceWeight:0.9,roughness:pwe.roughness,metalness:pwe.metalness,isExposedCopper:!0,isMaskedCopper:!1};if(e>170&&t>170&&n>160)return{height:mwe,microSurfaceWeight:0.4,roughness:0.76,metalness:0,isExposedCopper:!1,isMaskedCopper:!1};if(!(t>e*1.25&&t>n*1.05&&e<110&&t<180&&n<130))return{height:mwe,microSurfaceWeight:0.7,roughness:0.58,metalness:0.015,isExposedCopper:!1,isMaskedCopper:!1};return JKn},TMe=(e)=>{let t=new Id(e);return t.colorSpace=zAe,t.generateMipmaps=!1,t.minFilter=Ec,t.magFilter=Ec,t.wrapS=Bb,t.wrapT=Bb,t.needsUpdate=!0,t},Ito=(e,t)=>{let n=e.image;if(!n?.width||!n.height)return null;let{width:o,height:r}=n,i=n.getContext("2d");if(!i)return null;let s=t?.image,a=s?.getContext("2d"),c=s?.width??0,l=s?.height??0,h=a&&c&&l?a.getImageData(0,0,c,l):null,d=i.getImageData(0,0,o,r),u=d.data,_=new Float32Array(o*r),p=document.createElement("canvas"),m=document.createElement("canvas");p.width=m.width=o,p.height=m.height=r;let A=p.getContext("2d"),g=m.getContext("2d");if(!A||!g)return null;let f=A.createImageData(o,r),y=g.createImageData(o,r),x=f.data,C=y.data;for(let N=0;N<u.length;N+=4){let D=N/4,L=D%o,H=Math.floor(D/o);if((u[N+3]??0)<16){_[D]=ZKn(mwe);continue}let O=h?Math.min(c-1,Math.floor(L/o*c)):0,U=h?Math.min(l-1,Math.floor(H/r*l)):0,j=h?h.data[(U*c+O)*4+3]??0:0,Y=LWi(u[N]??0,u[N+1]??0,u[N+2]??0,j>=16),X=o+r,K=Y.isExposedCopper?QWi(L,H,X):Y.isMaskedCopper?kWi(L,H,X):0,J=o0t(ZKn(Y.height)+K*Y.microSurfaceWeight);_[D]=J;let ee=J*255;u[N]=u[N+1]=u[N+2]=ee,u[N+3]=255;let ne=(Y.isExposedCopper?o0t(Y.roughness+K*0.7+(S0t(L,H,36,X+17)-0.5)*pwe.roughnessVariance):Y.isMaskedCopper?o0t(Y.roughness+K+Uv.roughnessBias):Y.roughness)*255;x[N]=x[N+1]=x[N+2]=ne,x[N+3]=255;let re=Y.metalness*255;C[N]=C[N+1]=C[N+2]=re,C[N+3]=255}A.putImageData(f,0,0),g.putImageData(y,0,0);let b=document.createElement("canvas");b.width=o,b.height=r;let I=b.getContext("2d");if(!I)return null;I.putImageData(d,0,0);let v=document.createElement("canvas");v.width=o,v.height=r;let P=v.getContext("2d");if(!P)return null;let M=P.createImageData(o,r),B=M.data,T=(N,D)=>_[Math.max(0,Math.min(r-1,D))*o+Math.max(0,Math.min(o-1,N))]??0;for(let N=0;N<r;N++)for(let D=0;D<o;D++){let L=(T(D+1,N)-T(D-1,N))*4,H=(T(D,N+1)-T(D,N-1))*4,V=1/Math.sqrt(L*L+H*H+1),O=(N*o+D)*4;B[O]=(-L*V*0.5+0.5)*255,B[O+1]=(-H*V*0.5+0.5)*255,B[O+2]=(V*0.5+0.5)*255,B[O+3]=255}return P.putImageData(M,0,0),{bumpMap:TMe(b),normalMap:TMe(v),roughnessMap:TMe(p),metalnessMap:TMe(m)}};function t$n(e,t){let{texture:n,maskedCopperMask:o,yOffset:r,isBottomLayer:i,usePolygonOffset:s=!1,renderOrder:a=0,isFaux:c=!1}=e;if(!n)return null;let l=yf(t),h=new i1(l.width,l.height);n.colorSpace=_R;let d={map:n,transparent:!0,alphaTest:0.08,side:O7,depthWrite:!0,polygonOffset:s,polygonOffsetFactor:s?-4:0,polygonOffsetUnits:s?-4:0,opacity:c?dwe:1},u=Ito(n,o),_=new OA({...d,bumpMap:u?.bumpMap??null,bumpScale:Uv.bumpScale,normalMap:u?.normalMap??null,normalScale:new ro(Uv.normalScale,Uv.normalScale),roughnessMap:u?.roughnessMap??null,roughness:1,metalnessMap:u?.metalnessMap??null,metalness:1,clearcoat:Uv.clearcoat,clearcoatRoughness:Uv.clearcoatRoughness,envMapIntensity:0.18}),p=new Mo(h,_);if(p.position.set(l.centerX,l.centerY,r),i)p.rotation.set(Math.PI,0,0);return p.name=`${i?"bottom":"top"}-board-texture-plane`,p.renderOrder=a,uC(p,{castShadow:!1,receiveShadow:!0}),p}function HWi(e,t,n,o=!1){let r=[];if(!e||!t||n===null)return r;let i=0.005,s=t$n({texture:e.topBoard,maskedCopperMask:e.topMaskedCopper,yOffset:n/2+i,isBottomLayer:!1,usePolygonOffset:!0,renderOrder:1,isFaux:o},t);if(s)r.push(s);let a=t$n({texture:e.bottomBoard,maskedCopperMask:e.bottomMaskedCopper,yOffset:-n/2-i,isBottomLayer:!0,usePolygonOffset:!0,renderOrder:1,isFaux:o},t);if(a)r.push(a);return r}var Sto=(e)=>{let{boardBody:t,topCopper:n,bottomCopper:o,topSilkscreen:r,bottomSilkscreen:i,topMask:s,bottomMask:a,keepout:c,pcbNotes:l}=e;return vto.useMemo(()=>({boardBody:t,topCopper:n,bottomCopper:o,topSilkscreen:r,bottomSilkscreen:i,topMask:s,bottomMask:a,keepout:c,pcbNotes:l}),[t,n,o,r,i,s,a,c,l])},FWi=4000000,zWi=4096,OWi=1;function Pto(e,t,n={}){let{maxTexturePixels:o=FWi,maxTextureDimension:r=zWi,minTextureResolution:i=OWi}=n,s=yf(e);if(!Number.isFinite(s.width)||!Number.isFinite(s.height)||s.width<=0||s.height<=0)return t;let a=Math.max(s.width,s.height),c=r/a,l=Math.sqrt(o/(s.width*s.height)),h=Math.min(t,c,l);return Math.max(i,h)}function VWi({circuitJson:e,pcbThickness:t,isFaux:n=!1}){let{rootObject:o}=rg(),{visibility:r}=pU(),i=Sto(r),s=Nte.useMemo(()=>{let l=e.filter((u)=>u.type==="pcb_panel"),h=Vo(e).pcb_board.list();if(l.length>0){let u=l[0],_=h.find((p)=>p.pcb_panel_id===u.pcb_panel_id);return{type:"pcb_board",pcb_board_id:u.pcb_panel_id,center:u.center,width:u.width,height:u.height,thickness:_?.thickness??1.4,material:_?.material??"fr4",num_layers:_?.num_layers??2,solder_mask_color:_?.solder_mask_color}}let d=h.filter((u)=>!u.pcb_panel_id);return d.length>0?d[0]:null},[e]),a=Nte.useMemo(()=>{if(!s)return K6;return Pto(s,K6)},[s]),c=Nte.useMemo(()=>{if(!s?.width||!s.height)return null;return bto({circuitJson:e,boardData:s,traceTextureResolution:a,visibility:i})},[e,s,a,i]);return Nte.useEffect(()=>{if(!o||!s||!c)return;let l=[],h=(m)=>{let A=["map","alphaMap","aoMap","bumpMap","displacementMap","emissiveMap","lightMap","metalnessMap","normalMap","roughnessMap","specularMap"],g=m;for(let f of A){let y=g[f];if(y&&y instanceof vl)y.dispose(),g[f]=null}m.dispose()},d=({texture:m,maskedCopperMask:A,zOffset:g,isBottomLayer:f,name:y,usePolygonOffset:x=!1,depthWrite:C=!0,renderOrder:b=1})=>{if(!m)return null;let I=yf(s),v=new i1(I.width,I.height);m.colorSpace=_R;let P={map:m,transparent:!0,alphaTest:0.08,side:O7,depthWrite:C,polygonOffset:x,polygonOffsetFactor:x?-4:0,polygonOffsetUnits:x?-4:0,opacity:n?dwe:1},M=Ito(m,A),B=new OA({...P,bumpMap:M?.bumpMap??null,bumpScale:Uv.bumpScale,normalMap:M?.normalMap??null,normalScale:new ro(Uv.normalScale,Uv.normalScale),roughnessMap:M?.roughnessMap??null,roughness:1,metalnessMap:M?.metalnessMap??null,metalness:1,clearcoat:Uv.clearcoat,clearcoatRoughness:Uv.clearcoatRoughness,envMapIntensity:0.18}),T=new Mo(v,B);if(T.position.set(I.centerX,I.centerY,g),f)T.rotation.set(Math.PI,0,0);return T.name=y,T.renderOrder=b,T.frustumCulled=!1,uC(T,{castShadow:!1,receiveShadow:!0}),T},u=0.005,_=d({texture:c.topBoard,maskedCopperMask:c.topMaskedCopper,zOffset:t/2+u,isBottomLayer:!1,name:"jscad-top-board-texture",usePolygonOffset:!0});if(_)l.push(_),o.add(_);let p=d({texture:c.bottomBoard,maskedCopperMask:c.bottomMaskedCopper,zOffset:-t/2-u,isBottomLayer:!0,name:"jscad-bottom-board-texture",usePolygonOffset:!0});if(p)l.push(p),o.add(p);return()=>{for(let m of l){if(m.parent===o)o.remove(m);if(m.geometry.dispose(),Array.isArray(m.material))for(let A of m.material)h(A);else if(m.material instanceof zA)h(m.material)}c.topBoard?.dispose(),c.bottomBoard?.dispose()}},[o,s,c,t]),null}function YWi({stlUrl:e,stlData:t,mtlUrl:n,color:o,opacity:r=1,layerType:i}){let{rootObject:s}=rg(),[a,c]=rU.useState(null);rU.useEffect(()=>{let h=new tMe;if(t){try{let d=h.parse(t);c(d)}catch(d){console.error("Failed to parse STL data",d),c(null)}return}if(e)h.load(e,(d)=>{c(d)})},[e,t]);let l=rU.useMemo(()=>{if(!a)return null;let h=i==="board",d=new vs({color:Array.isArray(o)?new No(o[0],o[1],o[2]):o,transparent:r!==1,opacity:r,polygonOffset:h,polygonOffsetFactor:h?6:0,polygonOffsetUnits:h?6:0}),u=new Mo(a,d);return u.renderOrder=h?-1:1,uC(u,{castShadow:!h&&r===1,receiveShadow:!0}),u},[a,o,r,i]);return rU.useEffect(()=>{if(!s||!l)return;return s.add(l),()=>{if(s.remove(l),l.geometry.dispose(),Array.isArray(l.material))l.material.forEach((h)=>h.dispose());else l.material.dispose()}},[s,l]),null}function GWi({stlData:e,color:t,opacity:n=1,layerType:o}){let{visibility:r}=pU(),i=!0;if(o==="board")i=r.boardBody;else if(o==="top-copper")i=r.topCopper;else if(o==="bottom-copper")i=r.bottomCopper;else if(o==="top-silkscreen")i=r.topSilkscreen;else if(o==="bottom-silkscreen")i=r.bottomSilkscreen;if(!i)return null;return Eto.jsx(YWi,{stlData:e,color:t,opacity:n,layerType:o})}var UWi=(e)=>{if(!e||typeof e!=="object")return!1;let t=e;return t.type==="cad_cable"&&typeof t.cad_cable_id==="string"&&typeof t.cableprinter_string==="string"&&Array.isArray(t.path)},Mto=(e)=>e.filter(UWi),WWi=({x:e,y:t,z:n})=>[e,t,n],n$n=({path:e,pin1Position:t,end:n})=>{if(!t||e.length<2)return;let o=n==="start"?e[0]:e[e.length-1],r=n==="start"?e[1]:e[e.length-2];if(!o||!r)return;let i=new Et(r.x-o.x,r.y-o.y,r.z-o.z);if(i.lengthSq()<0.000000000001)return;i.normalize();let s=new Et(t.x-o.x,t.y-o.y,t.z-o.z);if(s.addScaledVector(i,-s.dot(i)),s.lengthSq()<0.000000000001)return;return s.normalize(),[s.x,s.y,s.z]},XWi=(e)=>{let t=yKn(e.cableprinter_string),n=PKn({definition:t,path:e.path.map(WWi),startPin1Side:n$n({path:e.path,pin1Position:e.from_connector_pin1_position,end:"start"}),endPin1Side:n$n({path:e.path,pin1Position:e.to_connector_pin1_position,end:"end"})}),o=new Ba;o.name=`cad-cable-${e.cad_cable_id}`,o.userData={cadCableId:e.cad_cable_id,name:e.name};for(let r of n){let i=new js;if(i.setAttribute("position",new Wr(r.positions,3)),i.setIndex(r.indices),!r.smooth)i=i.toNonIndexed();i.computeVertexNormals();let[s,a,c,l]=r.color,h=new vs({color:new No(s,a,c),metalness:r.material?.metalness??0,roughness:r.material?.roughness??0.7,opacity:l,transparent:l<1,side:bd}),d=new Mo(i,h);d.name=`${o.name}:${r.name}`,uC(d,{castShadow:!0,receiveShadow:!0}),o.add(d)}return o},jWi=(e)=>{e.traverse((t)=>{if(!(t instanceof Mo))return;t.geometry.dispose();let n=Array.isArray(t.material)?t.material:[t.material];for(let o of n)o.dispose()})},wto=({cable:e})=>{let{rootObject:t}=rg(),n=jwe.useMemo(()=>{try{return XWi(e)}catch(o){return console.error(`Failed to render CAD cable ${e.cad_cable_id}`,o),null}},[e]);return jwe.useEffect(()=>{if(!n)return;return t.add(n),()=>{t.remove(n),jWi(n)}},[n,t]),null};function Bto({boardDimensions:e,boardCenter:t}){if(!e||!t)return[5,-5,5];let n=Math.max(e.width??0,1),o=Math.max(e.height??0,1),r=Math.max(n,o,5);return[t.x+r*0.4,t.y-r*0.7,r*0.9]}function KWi(e){let t=Vo(e).cad_component.list().filter((f)=>f.pcb_component_id),n=Vo(e).pcb_smtpad.list(),o=Vo(e).pcb_hole.list(),r=Vo(e).pcb_plated_hole.list(),i=Vo(e).pcb_via.list();if(t.length===0&&n.length===0&&o.length===0&&r.length===0&&i.length===0)return null;let s=[...o,...r,...i,...n],a=ky(s),{minX:c,maxX:l,minY:h,maxY:d}=a;for(let f of t)if(f.position){let y=f.position.x,x=f.position.y;c=Math.min(c,y),l=Math.max(l,y),h=Math.min(h,x),d=Math.max(d,x)}if(c===1/0)c=-10,l=10,h=-10,d=10;let u=2,_=Math.max(Math.abs(c),Math.abs(l))+u,p=Math.max(Math.abs(h),Math.abs(d))+u,m=Math.max(2*_,10),A=Math.max(2*p,10);return{type:"pcb_board",pcb_board_id:"faux-board",center:{x:0,y:0},width:m,height:A,thickness:1.4,material:"fr4",num_layers:2}}function Tto(e){if(Vo(e).pcb_board.list().length>0)return e;let n=KWi(e);if(!n)return e;let r=n.thickness/2;return[...e.map((s)=>{if(s.type==="cad_component"&&s.pcb_component_id){let a=s;if(a.position){let c=a.position.z??0;return{...a,position:{...a.position,z:c+r}}}}return s}),n]}var $Wi=BT.forwardRef(({circuitJson:e,children:t,autoRotateDisabled:n,clickToInteractEnabled:o,onUserInteraction:r,onCameraControllerReady:i,resolveStaticAsset:s,referenceObject:a,hiddenCadComponentIds:c},l)=>{let h=zpt(t),d=BT.useMemo(()=>Tto(e??h),[e,h]),u=kUi(d),_=BT.useMemo(()=>{if(!d)return!1;try{let I=Vo(d).pcb_board.list()[0];return!!I&&I.pcb_board_id==="faux-board"}catch(I){return!1}},[d]),p=BT.useMemo(()=>{if(!d)return;try{let I=Vo(d).pcb_board.list()[0];if(!I)return;let v=yf(I);return{width:v.width,height:v.height}}catch(I){console.error(I);return}},[d]),m=BT.useMemo(()=>{if(!d)return;try{let I=Vo(d).pcb_board.list()[0];if(!I)return;let v=yf(I);return{x:v.centerX,y:v.centerY}}catch(I){console.error(I);return}},[d]),A=BT.useMemo(()=>{if(!d)return;let I=Vo(d).pcb_board.list()[0];if(!I)return;return JSON.stringify({pcbBoardId:I.pcb_board_id,center:m,dimensions:p})},[d,m,p]),g=BT.useMemo(()=>Bto({boardDimensions:p,boardCenter:m}),[p,m]),f=Heo(d),{stls:y,loading:x}=tUi(u),C=Vo(d).cad_component.list().filter((I)=>!c?.has(I.cad_component_id)),b=Mto(d);return TT.jsxs(mto,{ref:l,autoRotateDisabled:n,initialCameraPosition:g,clickToInteractEnabled:o,boardDimensions:p,boardCenter:m,cameraSessionScope:A,referenceObject:a,onUserInteraction:r,onCameraControllerReady:i,children:[y.map(({stlData:I,color:v,layerType:P},M)=>TT.jsx(GWi,{stlData:I,color:v,opacity:M===0?_?0.8:0.95:1,layerType:P},`board-${M}`)),TT.jsx(VWi,{circuitJson:d,pcbThickness:f,isFaux:_}),C.map((I)=>TT.jsx(Vpt,{fallback:({error:v})=>TT.jsx(yto,{cad_component:I,error:v}),children:TT.jsx(Zeo,{cad_component:I,circuitJson:d,resolveStaticAsset:s},I.cad_component_id)},I.cad_component_id)),b.map((I)=>TT.jsx(wto,{cable:I},I.cad_cable_id))]})}),Bpe=new Set,P0t=!1;function qWi(e,t,n=2){let o=t&&t.length,r=o?t[0]*n:e.length;if(Bpe.size)Bpe.clear();let i=Dto(e,0,r,n,!0),s=[];if(!i||i.next===i.prev)return s;let a=0,c=0,l=0;if(o)i=nXi(e,t,i,n);if(e.length>80*n){a=e[0],c=e[1];let h=a,d=c;for(let u=n;u<r;u+=n){let _=e[u],p=e[u+1];if(_<a)a=_;if(p<c)c=p;if(_>h)h=_;if(p>d)d=p}l=Math.max(h-a,d-c),l=l!==0?32767/l:0}return E0t(i,s,a,c,l),s}function Dto(e,t,n,o,r){let i=null;if(r===_Xi(e,t,n,o)>0)for(let s=t;s<n;s+=o)i=i$n(s/o|0,e[s],e[s+1],i);else for(let s=n-o;s>=t;s-=o)i=i$n(s/o|0,e[s],e[s+1],i);if(i&&Tpe(i,i.next))Npe(i),i=i.next;return i}function iU(e,t=e){let n=t===e,o=e,r;do if(r=!1,o!==o.next&&(Bpe.size===0||!Bpe.has(o))&&(Tpe(o,o.next)||eg(o.prev,o,o.next)===0)){if(n||o===t)t=o.prev;P0t=!0,Npe(o),o=o.prev,r=!0}else if(n||o!==t)o=o.next,r=!n;while(r||o!==t);return t}function E0t(e,t,n,o,r){if(r)lXi(e,n,o,r);let i=e,s=!1;while(e.prev!==e.next){let a=e.prev,c=e.next;if(eg(a,e,c)<0&&(r?ZWi(e,n,o,r):JWi(e))){t.push(a.i,e.i,c.i),Npe(e),e=c,i=c;continue}if(e=c,e===i){if(P0t=!1,e=iU(e),P0t){i=e;continue}if(!s){e=eXi(e,t),i=e,s=!0;continue}tXi(e,t,n,o,r);break}}}function JWi(e){let t=e.prev,n=e,o=e.next,r=t.x,i=n.x,s=o.x,a=t.y,c=n.y,l=o.y,h=Math.min(r,i,s),d=Math.min(a,c,l),u=Math.max(r,i,s),_=Math.max(a,c,l),p=o.next;while(p!==t){if(p.x>=h&&p.x<=u&&p.y>=d&&p.y<=_&&!(r===p.x&&a===p.y)&&gwe(r,a,i,c,s,l,p.x,p.y)&&eg(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function ZWi(e,t,n,o){let r=e.prev,i=e,s=e.next,a=r.x,c=i.x,l=s.x,h=r.y,d=i.y,u=s.y,_=Math.min(a,c,l),p=Math.min(h,d,u),m=Math.max(a,c,l),A=Math.max(h,d,u),g=T0t(_,p,t,n,o),f=T0t(m,A,t,n,o),y=e.prevZ;while(y&&y.z>=g){if(y.x>=_&&y.x<=m&&y.y>=p&&y.y<=A&&y!==s&&!(a===y.x&&h===y.y)&&gwe(a,h,c,d,l,u,y.x,y.y)&&eg(y.prev,y,y.next)>=0)return!1;y=y.prevZ}let x=e.nextZ;while(x&&x.z<=f){if(x.x>=_&&x.x<=m&&x.y>=p&&x.y<=A&&x!==s&&!(a===x.x&&h===x.y)&&gwe(a,h,c,d,l,u,x.x,x.y)&&eg(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function eXi(e,t){let n=e,o=!1;do{let r=n.prev,i=n.next.next;if(Qto(r,n,n.next,i,!1)&&Dpe(r,i)&&Dpe(i,r))t.push(r.i,n.i,i.i),Npe(n),Npe(n.next),n=e=i,o=!0;n=n.next}while(n!==e);return o?iU(n):n}function tXi(e,t,n,o,r){let i=e;do{let s=i.next.next;while(s!==i.prev){if(i.i!==s.i&&uXi(i,s)){let a=kto(i,s);i=iU(i,i.next),a=iU(a,a.next),E0t(i,t,n,o,r),E0t(a,t,n,o,r);return}s=s.next}i=i.next}while(i!==e)}var M0t=!1;function nXi(e,t,n,o){let r=[];for(let i=0,s=t.length;i<s;i++){let a=t[i]*o,c=i<s-1?t[i+1]*o:e.length,l=Dto(e,a,c,o,!1);if(l===l.next)Bpe.add(l);r.push(dXi(l))}r.sort(oXi),iXi(e.length/o,t.length),Rto(n,n),M0t=!0;for(let i=0;i<r.length;i++)n=rXi(r[i],n);return M0t=!1,iU(n)}function oXi(e,t){return e.x-t.x||e.y-t.y||(e.next.y-e.y)/(e.next.x-e.x)-(t.next.y-t.y)/(t.next.x-t.x)}function rXi(e,t){let n=aXi(e,t);if(!n)return t;let o=kto(n,e),r=o.next;return Rto(n,r.next),iU(o,o.next),iU(n,n.next)}var Nto=16,_m=new Float64Array(0),_we=0,w0t=[],B0t=[];function iXi(e,t){let n=Math.ceil((e+2*t)/Nto)+t+2;if(_m.length<n*4)_m=new Float64Array(n*4);_we=0}function Rto(e,t){let n=e;do{let o=_we++;w0t[o]=n;let r=n.x,i=n.y,s=n.x,a=n.y,c=0;do{let h=n.next;if(n.z=o,h.x<r)r=h.x;if(h.x>s)s=h.x;if(h.y<i)i=h.y;if(h.y>a)a=h.y;n=h}while(++c<Nto&&n!==t);B0t[o]=n;let l=o*4;_m[l]=r,_m[l+1]=i,_m[l+2]=s,_m[l+3]=a}while(n!==t)}function sXi(e,t){let n=e.z*4;if(t.x<_m[n])_m[n]=t.x;if(t.y<_m[n+1])_m[n+1]=t.y;if(t.x>_m[n+2])_m[n+2]=t.x;if(t.y>_m[n+3])_m[n+3]=t.y}function o$n(e){let t=B0t[e];while(t.prev.next!==t)t=t.next;return B0t[e]=t,t}function r$n(e){let t=w0t[e];while(t.prev.next!==t)t=t.next;return w0t[e]=t,t}function aXi(e,t){let n=t,{x:o,y:r}=e,i=-1/0,s;if(Tpe(e,n))return n;for(let u=0,_=0;u<_we;u++,_+=4){if(r<_m[_+1]||r>_m[_+3]||_m[_]>o||_m[_+2]<=i)continue;let p=o$n(u);n=r$n(u);do{if(n.prev.next===n){if(Tpe(e,n.next))return n.next;else if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){let m=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(m<=o&&m>i){if(i=m,s=n.x<n.next.x?n:n.next,m===o)return s}}}n=n.next}while(n!==p)}if(!s)return null;let a=s.x,c=s.y,l=Math.min(r,c),h=Math.max(r,c),d=1/0;for(let u=0,_=0;u<_we;u++,_+=4){if(_m[_+2]<a||_m[_]>o||_m[_+3]<l||_m[_+1]>h)continue;let p=o$n(u);n=r$n(u);do{if(n.prev.next===n&&o>=n.x&&n.x>=a&&o!==n.x&&gwe(r<c?o:i,r,a,c,r<c?i:o,r,n.x,n.y)){let m=Math.abs(r-n.y)/(o-n.x);if((Dpe(n,e)||n.y===r&&n.next.y===r&&n.next.x>o)&&(m<d||m===d&&(n.x>s.x||n.x===s.x&&cXi(s,n))))s=n,d=m}n=n.next}while(n!==p)}return s}function cXi(e,t){return eg(e.prev,e,t.prev)<0&&eg(t.next,e,e.next)<0}var cC=[],wte=[],qG=new Uint32Array(0),_pe=new Uint32Array(0),gpe=new Uint32Array(256);function lXi(e,t,n,o){let r=e,i=0;do r.z=T0t(r.x,r.y,t,n,o),cC[i++]=r,r=r.next;while(r!==e);hXi(i);let s=null;for(let a=0;a<i;a++){let c=cC[a];if(c.prevZ=s,s)s.nextZ=c;s=c}s.nextZ=null,cC.fill(null,0,i),wte.fill(null,0,i)}function hXi(e){if(e<=32){for(let t=1;t<e;t++){let n=cC[t],o=n.z,r=t-1;while(r>=0&&cC[r].z>o)cC[r+1]=cC[r],r--;cC[r+1]=n}return}if(qG.length<e)qG=new Uint32Array(e),_pe=new Uint32Array(e),wte=Array(e);for(let t=0;t<e;t++)qG[t]=cC[t].z;DMe(e,cC,qG,wte,_pe,0),DMe(e,wte,_pe,cC,qG,8),DMe(e,cC,qG,wte,_pe,16),DMe(e,wte,_pe,cC,qG,24)}function DMe(e,t,n,o,r,i){gpe.fill(0);for(let a=0;a<e;a++)gpe[n[a]>>>i&255]++;let s=0;for(let a=0;a<256;a++){let c=gpe[a];gpe[a]=s,s+=c}for(let a=0;a<e;a++){let c=n[a],l=gpe[c>>>i&255]++;o[l]=t[a],r[l]=c}}function T0t(e,t,n,o,r){return e=(e-n)*r|0,t=(t-o)*r|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function dXi(e){let t=e,n=e;do{if(t.x<n.x||t.x===n.x&&t.y<n.y)n=t;t=t.next}while(t!==e);return n}function gwe(e,t,n,o,r,i,s,a){return(r-s)*(t-a)>=(e-s)*(i-a)&&(e-s)*(o-a)>=(n-s)*(t-a)&&(n-s)*(i-a)>=(r-s)*(o-a)}function uXi(e,t){let n=Tpe(e,t)&&eg(e.prev,e,e.next)>0&&eg(t.prev,t,t.next)>0;return e.next.i!==t.i&&(n||Dpe(e,t)&&Dpe(t,e)&&(eg(e.prev,e,t.prev)!==0||eg(e,t.prev,t)!==0))&&!pXi(e,t)&&(n||mXi(e,t))}function eg(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function Tpe(e,t){return e.x===t.x&&e.y===t.y}function Qto(e,t,n,o,r=!0){let i=eg(e,t,n),s=eg(e,t,o),a=eg(n,o,e),c=eg(n,o,t);if((i>0&&s<0||i<0&&s>0)&&(a>0&&c<0||a<0&&c>0))return!0;if(!r)return!1;if(i===0&&NMe(e,n,t))return!0;if(s===0&&NMe(e,o,t))return!0;if(a===0&&NMe(n,e,o))return!0;if(c===0&&NMe(n,t,o))return!0;return!1}function NMe(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function pXi(e,t){let n=Math.min(e.x,t.x),o=Math.max(e.x,t.x),r=Math.min(e.y,t.y),i=Math.max(e.y,t.y),s=e;do{let a=s.next;if(s.x>o&&a.x>o||s.x<n&&a.x<n||s.y>i&&a.y>i||s.y<r&&a.y<r){s=a;continue}if(s.i!==e.i&&a.i!==e.i&&s.i!==t.i&&a.i!==t.i&&Qto(s,a,e,t))return!0;s=a}while(s!==e);return!1}function Dpe(e,t){return eg(e.prev,e,e.next)<0?eg(e,t,e.next)>=0&&eg(e,e.prev,t)>=0:eg(e,t,e.prev)<0||eg(e,e.next,t)<0}function mXi(e,t){let n=e,o=!1,r=(e.x+t.x)/2,i=(e.y+t.y)/2;do{let s=n.next;if(n.y>i!==s.y>i&&r<(s.x-n.x)*(i-n.y)/(s.y-n.y)+n.x)o=!o;n=s}while(n!==e);return o}function kto(e,t){let n=D0t(e.i,e.x,e.y),o=D0t(t.i,t.x,t.y),r=e.next,i=t.prev;return e.next=t,t.prev=e,n.next=r,r.prev=n,o.next=n,n.prev=o,i.next=o,o.prev=i,o}function i$n(e,t,n,o){let r=D0t(e,t,n);if(!o)r.prev=r,r.next=r;else r.next=o.next,r.prev=o,o.next.prev=r,o.next=r;return r}function Npe(e){if(e.next.prev=e.prev,e.prev.next=e.next,e.prevZ)e.prevZ.nextZ=e.nextZ;if(e.nextZ)e.nextZ.prevZ=e.prevZ;if(M0t)sXi(e.prev,e.next)}function D0t(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null}}function _Xi(e,t,n,o){let r=0;for(let i=t,s=n-o;i<n;i+=o)r+=(e[s]-e[i])*(e[i+1]+e[s+1]),s=i;return r}var JG=0.0000001;function Lto(e,t){if(!Number.isFinite(t)||t<0)throw Error("Board thickness must be finite and nonnegative");let n=e.map((a)=>{let{start:c,end:l,bend_angle:h,bend_radius:d}=a;if([c?.x,c?.y,l?.x,l?.y,h,d].some((x)=>!Number.isFinite(x))||d<=t/2||!["left","right"].includes(a.bend_side))throw Error(`Invalid PCB bend ${a.pcb_bend_id}: finite geometry and radius greater than half the board thickness are required`);let _=Math.hypot(l.x-c.x,l.y-c.y);if(_<JG||Math.abs(h)>180)throw Error(`Unsupported PCB bend ${a.pcb_bend_id}: distinct endpoints and angles within ±180 degrees are required`);let p=a.bend_side==="right"?1:-1,m=p*(l.y-c.y)/_,A=-p*(l.x-c.x)/_,g=h*Math.PI/180,f=d*Math.abs(g),y=c.x*m+c.y*A;return{id:a.pcb_bend_id,nx:m,ny:A,start:y-f/2,end:y+f/2,angle:g,radius:d,axisMin:Math.min(-A*c.x+m*c.y,-A*l.x+m*l.y),axisMax:Math.max(-A*c.x+m*c.y,-A*l.x+m*l.y)}}).filter((a)=>Math.abs(a.angle)>JG),o=n[0];if(o&&n.some((a)=>Math.abs(a.nx-o.nx)>JG||Math.abs(a.ny-o.ny)>JG))throw Error("Folded PCB rendering currently requires parallel bends with the same moving direction");n.sort((a,c)=>a.start-c.start);for(let a=1;a<n.length;a++)if(n[a].start<n[a-1].end-JG)throw Error("Overlapping PCB bend zones are not supported");let r=[...n].reverse(),i=({p:a,anchor:c,direction:l})=>{let h={...a};for(let d of r){let u=d.end-d.start,_=c.x*d.nx+c.y*d.ny-d.start,p=Math.max(0,Math.min(u,_)),m=d.angle*p/u,A=Math.cos(m),g=Math.sin(m),f=h.x*d.nx+h.y*d.ny-(l?0:d.start),y=h.x-(f+(l?0:d.start))*d.nx,x=h.y-(f+(l?0:d.start))*d.ny,C=Math.sign(d.angle)*d.radius,b=l?0:C*g-p*A,I=l?0:C*(1-A)-p*g,v=f*A-h.z*g+b;h={x:y+(v+(l?0:d.start))*d.nx,y:x+(v+(l?0:d.start))*d.ny,z:f*g+h.z*A+I}}return h},s=({p:a,anchor:c,direction:l})=>{let h=l?{x:0,y:0,z:0}:i({p:{x:0,y:0,z:0},anchor:c,direction:!1}),d={x:a.x-h.x,y:a.y-h.y,z:a.z-h.z},u=[{x:1,y:0,z:0},{x:0,y:1,z:0},{x:0,y:0,z:1}].map((p)=>i({p,anchor:c,direction:!0})),_=(p)=>p.x*d.x+p.y*d.y+p.z*d.z;return{x:_(u[0]),y:_(u[1]),z:_(u[2])}};return{bends:n,inversePoint:(a,c)=>s({p:a,anchor:c,direction:!1}),inverseDirection:(a,c)=>s({p:a,anchor:c,direction:!0}),point:(a,c=a)=>i({p:a,anchor:c,direction:!1}),direction:(a,c)=>i({p:a,anchor:c,direction:!0}),assertRigid(a,c){for(let l of n){let h=a.map((d)=>d.x*l.nx+d.y*l.ny);if(Math.max(...h)>l.start+JG&&Math.min(...h)<l.end-JG)throw Error(`${c} intersects PCB bend zone ${l.id}`)}}}}var Yv=0.0000001;function Jpe(e){let t=e.flatMap((r)=>r.vertices);if(!t.length)return{min:{x:0,y:0,z:0},max:{x:0,y:0,z:0}};let n={x:1/0,y:1/0,z:1/0},o={x:-1/0,y:-1/0,z:-1/0};for(let r of t)for(let i of["x","y","z"])n[i]=Math.min(n[i],r[i]),o[i]=Math.max(o[i],r[i]);return{min:n,max:o}}function s$n(e,t){let n=t.bends.flatMap((a)=>{let c=Math.ceil(Math.abs(a.angle)/(Math.PI/36));return Array.from({length:c+1},(l,h)=>({b:a,d:a.start+(a.end-a.start)*h/c}))}),{min:o,max:r}=e.boundingBox,i=({polygon:a,nx:c,ny:l,d:h})=>{let d=a.map(({p:_})=>c*_.x+l*_.y-h);if(Math.min(...d)>=-Yv||Math.max(...d)<=Yv)return[a];let u=[[],[]];for(let _=0;_<2;_++){let p=_===0?1:-1;for(let m=0;m<a.length;m++){let A=a[m],g=(m+1)%a.length,f=a[g],y=d[m]*p,x=d[g]*p;if(y>=-Yv)u[_].push(A);if(y>Yv&&x<-Yv||y<-Yv&&x>Yv){let C=y/(y-x);u[_].push({p:{x:A.p.x+(f.p.x-A.p.x)*C,y:A.p.y+(f.p.y-A.p.y)*C,z:A.p.z+(f.p.z-A.p.z)*C},uv:{u:A.uv.u+(f.uv.u-A.uv.u)*C,v:A.uv.v+(f.uv.v-A.uv.v)*C}})}}}return u.filter((_)=>_.length>=3)},s=[];for(let a of e.triangles){let c=a.pcbFace??(a.normal.z>0.8?"top":a.normal.z<-0.8?"bottom":"side"),l=[a.vertices.map((h,d)=>({p:h,uv:a.uvs?.[d]??{u:(h.x-o.x)/(r.x-o.x),v:1-(h.y-o.y)/(r.y-o.y)}}))];for(let{b:h,d}of n)l=l.flatMap((u)=>i({polygon:u,nx:h.nx,ny:h.ny,d}));for(let h of l){for(let d of t.bends){let u=h.reduce((_,{p})=>_+p.x*d.nx+p.y*d.ny,0)/h.length;if(u>d.start+Yv&&u<d.end-Yv&&h.some(({p:_})=>{let p=-d.ny*_.x+d.nx*_.y;return p<d.axisMin-Yv||p>d.axisMax+Yv}))throw Error(`PCB bend ${d.id} must span the full board cross-section through its bend zone`)}for(let d=1;d+1<h.length;d++){let u=[h[0],h[d],h[d+1]],_=u.map(({p:C})=>t.point(C)),[p,m,A]=_,g={x:m.x-p.x,y:m.y-p.y,z:m.z-p.z},f={x:A.x-p.x,y:A.y-p.y,z:A.z-p.z},y={x:g.y*f.z-g.z*f.y,y:g.z*f.x-g.x*f.z,z:g.x*f.y-g.y*f.x},x=Math.hypot(y.x,y.y,y.z);if(x<0.000000000001)continue;s.push({...a,vertices:_,normal:{x:y.x/x,y:y.y/x,z:y.z/x},pcbFace:c,uvs:u.map(({uv:C})=>C)})}}}return{...e,triangles:s,boundingBox:Jpe(s)}}var gXi=[{x:1,y:0,z:0},{x:0,y:1,z:0},{x:0,y:0,z:1}];function AXi(e,t){let[n,o,r]=[t.x,t.y,t.z].map((a)=>a*Math.PI/180),i={x:Math.cos(r)*e.x-Math.sin(r)*e.y,y:Math.sin(r)*e.x+Math.cos(r)*e.y,z:e.z},s={x:Math.cos(o)*i.x+Math.sin(o)*i.z,y:i.y,z:-Math.sin(o)*i.x+Math.cos(o)*i.z};return{x:s.x,y:Math.cos(n)*s.y-Math.sin(n)*s.z,z:Math.sin(n)*s.y+Math.cos(n)*s.z}}function fXi([e,t,n]){let o=Math.asin(Math.max(-1,Math.min(1,n.x))),r=Math.abs(n.x)<0.999999999999;return{x:(r?Math.atan2(-n.y,n.z):Math.atan2(t.z,t.y))*180/Math.PI,y:o*180/Math.PI,z:(r?Math.atan2(-t.x,e.x):0)*180/Math.PI}}function yXi({cadComponent:e,foldPcbs:t},n){return xXi({cadComponentPlacement:e,foldPcbs:t},n)}function xXi({cadComponentPlacement:e,foldPcbs:t},n){if(e.is_on_folded_board===!0===t)return e;let{fold:o,boardCenter:r,flatMount:i}=n,s={x:i.x-r.x,y:i.y-r.y,z:0};o.assertRigid([s],"CAD mount");let a={x:e.position.x-r.x,y:e.position.y-r.y,z:e.position.z},c=t?o.direction:o.inverseDirection,l=t?o.point(a,s):o.inversePoint(a,s),h=e.rotation??n.defaultRotation??{x:0,y:0,z:0},d=gXi.map((u)=>c(AXi(u,h),s));return{...e,position:{x:l.x+r.x,y:l.y+r.y,z:l.z},rotation:fXi(d),is_on_folded_board:t}}function CXi(e,t){let n=t.find((c)=>c.type==="pcb_component"&&c.pcb_component_id===e.pcb_component_id);if(n?.type!=="pcb_component"){if(e.is_on_folded_board)throw Error(`Folded CAD ${e.cad_component_id} requires its flat pcb_component reference`);return}let o=t.filter((c)=>c.type==="pcb_board"),r=n.positioned_relative_to_pcb_board_id,i=r?o.filter((c)=>c.pcb_board_id===r):o.filter((c)=>c.subcircuit_id&&c.subcircuit_id===n.subcircuit_id),s=i.length===1?i[0]:!r&&!i.length&&o.length===1?o[0]:void 0;if(!s)throw Error(`Cannot unambiguously resolve board for CAD ${e.cad_component_id}`);let a=t.filter((c)=>c.type==="pcb_bend"&&c.pcb_board_id===s.pcb_board_id);return{fold:Lto(a,s.thickness??1.6),boardCenter:s.center,flatMount:n.center,defaultRotation:{x:(e.layer??n.layer)==="bottom"?180:0,y:0,z:0}}}function bXi(e,t){let n=e.some((o)=>o.type==="pcb_bend");return e.map((o)=>{if(o.type!=="cad_component")return o;let r=o;if(!n&&!r.is_on_folded_board)return o;if(r.is_on_folded_board===!0===t.foldPcbs)return o;let i=CXi(r,e);if(!i||!i.fold.bends.length&&!r.is_on_folded_board)return o;return yXi({cadComponent:r,foldPcbs:t.foldPcbs},i)})}function IXi({outline:e,bottom:t,top:n}){if(e.length<3||!Number.isFinite(t)||!Number.isFinite(n)||n<=t||e.some((c)=>!Number.isFinite(c.x)||!Number.isFinite(c.y)))throw Error("A finite polygon and positive extrusion thickness are required");let o=0;for(let[c,l]of e.entries()){let h=e[(c+1)%e.length];o+=l.x*h.y-h.x*l.y}if(Math.abs(o)<0.000000000001)throw Error("Degenerate polygon");let r=o>0?e:[...e].reverse(),i=[],s=({a:c,b:l,c:h,pcbFace:d})=>{let u={x:l.x-c.x,y:l.y-c.y,z:l.z-c.z},_={x:h.x-c.x,y:h.y-c.y,z:h.z-c.z},p={x:u.y*_.z-u.z*_.y,y:u.z*_.x-u.x*_.z,z:u.x*_.y-u.y*_.x},m=Math.hypot(p.x,p.y,p.z);if(m>0.000000000001)i.push({vertices:[c,l,h],normal:{x:p.x/m,y:p.y/m,z:p.z/m},pcbFace:d})},a=qWi(r.flatMap((c)=>[c.x,c.y]));for(let c=0;c<a.length;c+=3){let[l,h,d]=a.slice(c,c+3).map((u)=>r[u]);s({a:{...l,z:n},b:{...h,z:n},c:{...d,z:n},pcbFace:"top"}),s({a:{...d,z:t},b:{...h,z:t},c:{...l,z:t},pcbFace:"bottom"})}for(let c=0;c<r.length;c++){let l=r[c],h=r[(c+1)%r.length];s({a:{...l,z:t},b:{...h,z:t},c:{...h,z:n},pcbFace:"side"}),s({a:{...l,z:t},b:{...h,z:n},c:{...l,z:n},pcbFace:"side"})}return{triangles:i,boundingBox:Jpe(i)}}function vXi({stiffener:e,boardThickness:t,fold:n}){let o=e.adhesive_thickness??0;if(!Number.isFinite(o)||o<0||!Number.isFinite(e.thickness)||e.thickness<=0||!["top","bottom"].includes(e.layer))throw Error(`Invalid PCB stiffener ${e.pcb_stiffener_id}`);let r=e.shape==="polygon"?e.outline:(()=>{if(!(e.width>0&&e.height>0))throw Error("Invalid stiffener dimensions");let h=(e.rotation??0)*Math.PI/180;return[[-1,-1],[1,-1],[1,1],[-1,1]].map(([d,u])=>({x:e.center.x+d*e.width/2*Math.cos(h)-u*e.height/2*Math.sin(h),y:e.center.y+d*e.width/2*Math.sin(h)+u*e.height/2*Math.cos(h)}))})(),i=t/2+o,s=i+e.thickness,a=IXi({outline:r,bottom:e.layer==="top"?i:-s,top:e.layer==="top"?s:-i});if(!n)return a;n.assertRigid(a.triangles.flatMap((h)=>h.vertices),e.pcb_stiffener_id);let c={x:r.reduce((h,d)=>h+d.x,0)/r.length,y:r.reduce((h,d)=>h+d.y,0)/r.length,z:0},l=a.triangles.map((h)=>({...h,vertices:h.vertices.map((d)=>n.point(d,c)),normal:n.direction(h.normal,c)}));return{...a,triangles:l,boundingBox:Jpe(l)}}var SXi=(e)=>{let t=0;for(let o=0;o<e.length;o++){let r=(o+1)%e.length;if(e[o]&&e[r])t+=e[o][0]*e[r][1],t-=e[r][0]*e[o][1]}return t/2<=0};function PXi(e,t,n,o,r){let i,s=null;if(n.outline&&n.outline.length>=3){let a=n.outline.map((l)=>[l.x,l.y]);if(SXi(a))a=a.reverse();let c=t.ofPolygons([a]);r.push(c),s=c,i=e.extrude(c,o,void 0,void 0,void 0,!0),r.push(i)}else{if(n.outline&&n.outline.length>0)console.warn("Board outline has fewer than 3 points, falling back to rectangular board.");i=e.cube([n.width,n.height,o],!0),r.push(i),i=i.translate([n.center.x,n.center.y,0]),r.push(i)}return{boardOp:i,outlineCrossSection:s}}var EXi=64;function tU({Manifold:e,width:t,height:n,thickness:o,borderRadius:r}){let i=fto(t,n,r);if(i<=0)return e.cube([t,n,o],!0);let s=[],a=t-2*i,c=n-2*i;if(a>0)s.push(e.cube([a,n,o],!0));if(c>0)s.push(e.cube([t,c,o],!0));return[[t/2-i,n/2-i],[-t/2+i,n/2-i],[-t/2+i,-n/2+i],[t/2-i,-n/2+i]].forEach(([h,d])=>{s.push(e.cylinder(o,i,i,EXi,!0).translate([h,d,0]))}),e.union(s)}var MXi=(e)=>{let t=0;for(let o=0;o<e.length;o++){let r=(o+1)%e.length;if(e[o]&&e[r])t+=e[o][0]*e[r][1],t-=e[r][0]*e[o][1]}return t/2<=0};function wXi(e,t,n,o,r){let i=[],s=Vo(n).pcb_cutout.list();for(let a of s){let c,l=o*1.5;switch(a.shape){case"rect":{let u=iH(a);if(typeof u==="number"&&u>0)c=tU({Manifold:e,width:a.width,height:a.height,thickness:l,borderRadius:u});else c=e.cube([a.width,a.height,l],!0);if(r.push(c),a.rotation){let _=c.rotate([0,0,a.rotation]);r.push(_),c=_}c=c.translate([a.center.x,a.center.y,0]),r.push(c);break}case"circle":c=e.cylinder(l,a.radius,-1,rA,!0),r.push(c),c=c.translate([a.center.x,a.center.y,0]),r.push(c);break;case"polygon":if(a.points.length<3){console.warn(`PCB Cutout [${a.pcb_cutout_id}] polygon has fewer than 3 points, skipping.`);continue}let h=a.points.map((u)=>[u.x,u.y]);if(MXi(h))h=h.reverse();let d=t.ofPolygons([h]);r.push(d),c=e.extrude(d,l,0,0,[1,1],!0),r.push(c);break;default:console.warn(`Unsupported cutout shape: ${a.shape} for cutout ${a.pcb_cutout_id}`);continue}if(c)i.push(c)}return{cutoutOps:i}}function Hto({Manifold:e,x:t,y:n,diameter:o,thickness:r,segments:i=32}){return e.cylinder(r*1.2,o/2,o/2,i,!0).translate([t,n,0])}function Fto({Manifold:e,x:t,y:n,holeDiameter:o,thickness:r,zOffset:i=0.001,segments:s=32}){let a=o/2+i;return e.cylinder(r*1.2,a,a,s,!0).translate([t,n,0])}function BXi(e,t,n,o,r){let i=[],s=Vo(n).pcb_hole.list(),a=(h,d,u)=>{let _=tU({Manifold:e,width:h,height:d,thickness:u,borderRadius:Math.min(h,d)/2});return r.push(_),_},c=(h,d,u)=>{let _=e.cube([h,d,u],!0);return r.push(_),_},l=(h,d,u)=>{let _=[];for(let p=0;p<u;p++){let m=2*Math.PI*p/u;_.push([h/2*Math.cos(m),d/2*Math.sin(m)])}return _};for(let h of s){let{hole_shape:d,x:u,y:_}=h,p=o*1.2,m=h.ccw_rotation??h.rotation??0,A=h.hole_width??h.hole_diameter,g=h.hole_height??h.hole_diameter,f=null;if(d==="circle"){f=Hto({Manifold:e,x:u,y:_,diameter:h.hole_diameter,thickness:o,segments:rA}),i.push(f),r.push(f);continue}if(d==="pill"||d==="rotated_pill")f=a(A,g,p);else if(d==="rect")f=c(A,g,p);else if(d==="oval"){let y=l(A,g,rA),x=0;for(let b=0;b<y.length;b++){let I=(b+1)%y.length;x+=y[b][0]*y[I][1],x-=y[I][0]*y[b][1]}if(x<=0)y=y.reverse();let C=t.ofPolygons([y]);r.push(C),f=e.extrude(C,p,0,0,[1,1],!0),r.push(f)}if(f){if(m!==0){let x=f.rotate([0,0,m]);r.push(x),f=x}let y=f.translate([u,_,0]);r.push(y),i.push(y)}}return{nonPlatedHoleBoardDrills:i}}function mE(e){let t=new js;if(t.setAttribute("position",new Wr(e.vertProperties,3)),t.setIndex(new jre(e.triVerts,1)),e.runIndex&&e.runIndex.length>1&&e.runOriginalID)for(let n=0;n<e.runIndex.length-1;n++){let o=e.runIndex[n],r=e.runIndex[n+1]-o;t.addGroup(o,r,0)}else t.addGroup(0,e.triVerts.length,0);return t}var Ape=(e)=>{let t=0;for(let o=0;o<e.length;o++){let r=(o+1)%e.length;if(e[o]&&e[r])t+=e[o][0]*e[r][1],t-=e[r][0]*e[o][1]}return t/2<=0},RMe=(e,t,n)=>{let o=[];for(let r=0;r<n;r++){let i=2*Math.PI*r/n;o.push([e/2*Math.cos(i),t/2*Math.sin(i)])}return o},ZG=new No(...gl.copper),QMe=0.05,fpe=0.003,ype=0.0005,xpe=0.004;function TXi(e,t,n,o,r,i){let s=[],a=Vo(n).pcb_plated_hole.list(),c=[],l=[],h=(p,m,A)=>{let g=tU({Manifold:e,width:p,height:m,thickness:A,borderRadius:Math.min(p,m)/2});return r.push(g),g},d=({padOutline:p,thickness:m})=>{if(!Array.isArray(p)||p.length<3)return null;let A=p.map((y)=>[y.x,y.y]);if(Ape(A))A=A.reverse();let g=t.ofPolygons([A]);r.push(g);let f=e.extrude(g,m,0,0,[1,1],!0);return r.push(f),f},u=({ph:p,depth:m,sizeDelta:A=0})=>{if(p.shape!=="hole_with_polygon_pad")return null;let f=p.pad_outline;if(!Array.isArray(f)||f.length<3)return null;let y=p.hole_shape||"circle",x=p.hole_offset_x||0,C=p.hole_offset_y||0,b=null;if(y==="circle"){let I=Math.max((p.hole_diameter??0)+A,Ni),v=Math.max(I/2,Ni/2);b=e.cylinder(m,v,v,rA,!0),r.push(b)}else{let I=p.hole_width??p.hole_diameter,v=p.hole_height??p.hole_diameter;if(!I||!v)return null;let P=Math.max(I+A,Ni),M=Math.max(v+A,Ni);if(y==="oval"){let B=RMe(P,M,rA);if(Ape(B))B=B.reverse();let T=t.ofPolygons([B]);r.push(T),b=e.extrude(T,m,0,0,[1,1],!0),r.push(b)}else if(y==="pill"||y==="rotated_pill")b=tU({Manifold:e,width:P,height:M,thickness:m,borderRadius:Math.min(P,M)/2}),r.push(b)}if(!b)return null;if(x||C){let I=b.translate([x,C,0]);r.push(I),b=I}return b};a.forEach((p,m)=>{let A=Math.max(o-2*(fpe+ype+xpe),Ni);if(p.shape==="circle"){let g=Fto({Manifold:e,x:p.x,y:p.y,holeDiameter:p.hole_diameter*1.02,thickness:o,zOffset:Gv,segments:rA});r.push(g),s.push(g);let f=A,y=e.cylinder(f,p.outer_diameter/2,p.outer_diameter/2,rA,!0);r.push(y);let x=e.cylinder(f*1.05,p.hole_diameter/2,p.hole_diameter/2,rA,!0);r.push(x);let C=y.subtract(x);r.push(C);let b=C.translate([p.x,p.y,0]);r.push(b);let I=b;if(i){let P=e.intersection([b,i]);r.push(P),I=P}l.push(I);let v=mE(I.getMesh());c.push({key:`ph-${p.pcb_plated_hole_id||m}`,geometry:v,color:ZG})}else if(p.shape==="pill"){let{hole_width:g,hole_height:f}=p,y=0.4,x=p.outer_width??g+0.4,C=p.outer_height??f+0.4,b=g+2*Gv,I=f+2*Gv,v=o*1.2,P=h(b,I,v);if(p.ccw_rotation){let O=P.rotate([0,0,p.ccw_rotation]);r.push(O),P=O}let M=P.translate([p.x,p.y,0]);r.push(M),s.push(M);let B=A,T=h(x,C,B),N=h(g,f,B*1.05),D=T.subtract(N);if(r.push(D),p.ccw_rotation){let O=D.rotate([0,0,p.ccw_rotation]);r.push(O),D=O}let L=D.translate([p.x,p.y,0]);r.push(L);let H=L;if(i){let O=e.intersection([L,i]);r.push(O),H=O}l.push(H);let V=mE(H.getMesh());c.push({key:`ph-${p.pcb_plated_hole_id||m}`,geometry:V,color:ZG})}else if(p.shape==="pill_hole_with_rect_pad"){if(p.hole_shape&&p.hole_shape!=="pill"||p.pad_shape&&p.pad_shape!=="rect")return;let{hole_width:g,hole_height:f}=p,y=p.hole_offset_x||0,x=p.hole_offset_y||0,{rect_pad_width:C,rect_pad_height:b}=p,I=iH(p),v=fpe,P=g+2*Gv,M=f+2*Gv,B=o*1.2,N=h(P,M,B).translate([y,x,0]).translate([p.x,p.y,0]);r.push(N),s.push(N);let D=tU({Manifold:e,width:C,height:b,thickness:Math.max(o-2*(v+ype+xpe),Ni),borderRadius:I});r.push(D);let L=h(g,f,o*0.8).translate([y,x,0]);r.push(L);let H=e.union([D,L]);r.push(H);let V=h(Math.max(g-2*QMe,0.01),Math.max(f-2*QMe,0.01),o*1.2).translate([y,x,0]);r.push(V);let O=H.subtract(V);r.push(O);let U=O.translate([p.x,p.y,0]);r.push(U);let j=U;if(i){let X=e.intersection([U,i]);r.push(X),j=X}l.push(j);let Y=mE(j.getMesh());c.push({key:`ph-${p.pcb_plated_hole_id||m}`,geometry:Y,color:ZG})}else if(p.shape==="rotated_pill_hole_with_rect_pad"){if(p.hole_shape&&p.hole_shape!=="rotated_pill"||p.pad_shape&&p.pad_shape!=="rect")return;let{hole_width:g,hole_height:f}=p,y=p.hole_offset_x||0,x=p.hole_offset_y||0,{rect_pad_width:C,rect_pad_height:b}=p,I=iH(p),v=fpe,P=g+2*Gv,M=f+2*Gv,B=o*1.2,T=h(P,M,B).translate([y,x,0]);if(p.hole_ccw_rotation){let X=T.rotate([0,0,p.hole_ccw_rotation]);r.push(X),T=X}let N=T.translate([p.x,p.y,0]);r.push(N),s.push(N);let D=tU({Manifold:e,width:C,height:b,thickness:Math.max(o-2*(v+ype+xpe),Ni),borderRadius:I});if(r.push(D),p.rect_ccw_rotation){let X=D.rotate([0,0,p.rect_ccw_rotation]);r.push(X),D=X}let L=h(g,f,o*0.8).translate([y,x,0]);if(p.hole_ccw_rotation){let X=L.rotate([0,0,p.hole_ccw_rotation]);r.push(X),L=X}r.push(L);let H=e.union([D,L]);r.push(H);let V=h(Math.max(g-2*QMe,0.01),Math.max(f-2*QMe,0.01),o*1.2).translate([y,x,0]);if(p.hole_ccw_rotation){let X=V.rotate([0,0,p.hole_ccw_rotation]);r.push(X),V=X}r.push(V);let O=H.subtract(V);r.push(O);let U=O.translate([p.x,p.y,0]);r.push(U);let j=U;if(i){let X=e.intersection([U,i]);r.push(X),j=X}l.push(j);let Y=mE(j.getMesh());c.push({key:`ph-${p.pcb_plated_hole_id||m}`,geometry:Y,color:ZG})}else if(p.shape==="hole_with_polygon_pad"){let g=p.pad_outline;if(!Array.isArray(g)||g.length<3)return;let f=u({ph:p,depth:o*1.2,sizeDelta:2*Ni});if(!f)return;let y=f.translate([p.x,p.y,0]);r.push(y),s.push(y);let C=Math.max(o-2*(fpe+ype+xpe),Ni),b=d({padOutline:g,thickness:C});if(!b)return;let I=u({ph:p,depth:o*1.02});if(!I)return;let v=u({ph:p,depth:o*0.8,sizeDelta:-2*Ni})||I,P=e.union([b,I]);r.push(P);let M=P.subtract(v);r.push(M);let B=M.translate([p.x,p.y,0]);r.push(B);let T=B;if(i){let D=e.intersection([B,i]);r.push(D),T=D}l.push(T);let N=mE(T.getMesh());c.push({key:`ph-${p.pcb_plated_hole_id||m}`,geometry:N,color:ZG})}else if(p.shape==="oval"){let{hole_width:g,hole_height:f}=p,y=p.outer_width??g+0.4,x=p.outer_height??f+0.4,C=g+2*Gv,b=f+2*Gv,I=o*1.2,v=RMe(C,b,rA);if(Ape(v))v=v.reverse();let P=t.ofPolygons([v]);r.push(P);let M=e.extrude(P,I,0,0,[1,1],!0);if(r.push(M),p.ccw_rotation){let K=M.rotate([0,0,p.ccw_rotation]);r.push(K),M=K}let B=M.translate([p.x,p.y,0]);r.push(B),s.push(B);let T=A,N=RMe(y,x,rA);if(Ape(N))N=N.reverse();let D=t.ofPolygons([N]);r.push(D);let L=e.extrude(D,T,0,0,[1,1],!0);r.push(L);let H=RMe(g,f,rA);if(Ape(H))H=H.reverse();let V=t.ofPolygons([H]);r.push(V);let O=e.extrude(V,T*1.05,0,0,[1,1],!0);r.push(O);let U=L.subtract(O);if(r.push(U),p.ccw_rotation){let K=U.rotate([0,0,p.ccw_rotation]);r.push(K),U=K}let j=U.translate([p.x,p.y,0]);r.push(j);let Y=j;if(i){let K=e.intersection([j,i]);r.push(K),Y=K}l.push(Y);let X=mE(Y.getMesh());c.push({key:`ph-${p.pcb_plated_hole_id||m}`,geometry:X,color:ZG})}else if(p.shape==="circular_hole_with_rect_pad"){if(p.hole_shape&&p.hole_shape!=="circle"||p.pad_shape&&p.pad_shape!=="rect")return;let g=p.hole_offset_x||0,f=p.hole_offset_y||0,y=Hto({Manifold:e,x:p.x+g,y:p.y+f,diameter:p.hole_diameter,thickness:o,segments:rA});r.push(y),s.push(y);let x=p.rect_pad_width??p.hole_diameter,C=p.rect_pad_height??p.hole_diameter,b=iH(p),I=fpe,v=p.hole_diameter/2,P=tU({Manifold:e,width:x,height:C,thickness:Math.max(o-2*(I+ype+xpe),Ni),borderRadius:b});r.push(P);let M=e.cylinder(o*0.8,v,v,rA,!0).translate([g,f,0]);r.push(M);let B=e.union([P,M]);r.push(B);let T=e.cylinder(o*1.2,Math.max(v-Ni,0.01),Math.max(v-Ni,0.01),rA,!0).translate([g,f,0]);r.push(T);let N=B.subtract(T);r.push(N);let D=N.translate([p.x,p.y,0]);r.push(D);let L=D;if(i){let V=e.intersection([D,i]);r.push(V),L=V}l.push(L);let H=mE(L.getMesh());c.push({key:`ph-${p.pcb_plated_hole_id||m}`,geometry:H,color:ZG})}});let _;if(l.length>0)_=e.union(l),r.push(_);return{platedHoleBoardDrills:s,platedHoleCopperGeoms:c,platedHoleSubtractOp:_}}function DXi({Manifold:e,x:t,y:n,outerDiameter:o,holeDiameter:r,thickness:i,zOffset:s=0.001,segments:a=32}){let c=s;if(o<r)throw Error(`Invalid via geometry: outerDiameter (${o}) must be >= holeDiameter (${r})`);let l=Math.min(o/2,r/2+c),d=e.cylinder(i,l,-1,a,!0),u=i+2*s,_=e.cylinder(u,r/2,-1,a,!0);return d.subtract(_).translate([t,n,0])}var NXi=new No(...gl.copper);function RXi(e,t,n,o,r,i=[]){let s=[],a=Upt(t),c=[],l=[];a.forEach((d,u)=>{let _;if(typeof d.hole_diameter==="number"){let p=Fto({Manifold:e,x:d.x,y:d.y,holeDiameter:d.hole_diameter,thickness:n,zOffset:Gv,segments:rA});o.push(p),s.push(p),_=p}if(typeof d.outer_diameter==="number"&&typeof d.hole_diameter==="number"){let p=DXi({Manifold:e,x:d.x,y:d.y,outerDiameter:d.outer_diameter,holeDiameter:d.hole_diameter,thickness:n,zOffset:Gv,segments:rA});o.push(p);let m=p;if(r){let A=e.intersection([p,r]);o.push(A),m=A}l.push({key:`via-${d.pcb_via_id||u}`,copper:m,ownDrill:_})}});let h=[...i,...s].map((d)=>({drill:d,bounds:d.boundingBox()}));for(let{key:d,copper:u,ownDrill:_}of l){let p=u.boundingBox(),m=h.filter(({drill:g,bounds:f})=>g!==_&&[0,1,2].every((y)=>f.min[y]<=p.max[y]&&f.max[y]>=p.min[y])).map(({drill:g})=>g),A=u;if(m.length){let g=e.union(m);A=u.subtract(g),o.push(g,A)}c.push({key:d,geometry:mE(A.getMesh()),color:NXi})}return{viaBoardDrills:s,viaCopperGeoms:c}}var QXi=(e,t,n)=>{let o=Sto(n),[r,i]=p4.useState(null),[s,a]=p4.useState(null),[c,l]=p4.useState(null),[h,d]=p4.useState(!0),u=p4.useRef([]),_=p4.useMemo(()=>{let g=t.filter((x)=>x.type==="pcb_panel"),f=Vo(t).pcb_board.list();if(g.length>0){let x=g[0],C=f.find((b)=>b.pcb_panel_id===x.pcb_panel_id);return{type:"pcb_board",pcb_board_id:x.pcb_panel_id,center:x.center,width:x.width,height:x.height,thickness:C?.thickness??1.4,material:C?.material??"fr4",num_layers:C?.num_layers??2,solder_mask_color:C?.solder_mask_color}}let y=f.filter((x)=>!x.pcb_panel_id);return y.length>0?y[0]:null},[t]),p=p4.useMemo(()=>{let g=Vo(t).pcb_board.list();return g.length>0&&g[0].pcb_board_id==="faux-board"},[t]),m=p4.useMemo(()=>{if(!_)return K6;return Pto(_,K6)},[_]);p4.useEffect(()=>{if(!e||!_){i(null),a(null),d(!1);return}if((_.width===0||!_.width)&&(_.height===0||!_.height)&&(!_.outline||_.outline.length<3)){i({platedHoles:[],vias:[]}),a(_.thickness??0),d(!1);return}d(!0),l(null);let{Manifold:g,CrossSection:f}=e,y=(b)=>{if(!b||typeof b.delete!=="function")return;try{b.delete()}catch(I){if(!(I instanceof Error)||!I.message?.includes("Manifold instance already deleted"))console.warn("Failed to delete Manifold instance",I)}};u.current.forEach(y),u.current=[];let x=null,C={};try{let b=_.thickness||1.4;a(b);let{boardOp:I,outlineCrossSection:v}=PXi(g,f,_,b,u.current),P=I,B=b+2,T=null,N=0.01;if(v){let K=v;if(N>0){let ee=v.offset(N);u.current.push(ee),K=ee}let J=g.extrude(K,B,void 0,void 0,void 0,!0);u.current.push(J),T=J}else{let K=(_.width||0)+2*N,J=(_.height||0)+2*N,ee=g.cube([K,J,B],!0);u.current.push(ee);let se=ee.translate([_.center.x,_.center.y,0]);u.current.push(se),T=se}let D=[],L=null,{nonPlatedHoleBoardDrills:H}=BXi(g,f,t,b,u.current);D.push(...H);let{platedHoleBoardDrills:V,platedHoleCopperGeoms:O,platedHoleSubtractOp:U}=TXi(g,f,t,b,u.current,T);D.push(...V),C.platedHoles=O;let{viaBoardDrills:j,viaCopperGeoms:Y}=RXi(g,t,b,u.current,T,D);if(D.push(...j),C.vias=Y,D.length>0){L=g.union(D),u.current.push(L);let K=U?g.union([L,U]):L;u.current.push(K);let J=P.subtract(K);if(u.current.push(J),P=J,U){let ee=U.subtract(L);u.current.push(ee);let se=ee.getMesh(),ne=mE(se);C.platedHoles=[{key:"plated-holes-union",geometry:ne,color:new No(gl.copper[0],gl.copper[1],gl.copper[2])}]}}let{cutoutOps:X}=wXi(g,f,t,b,u.current);if(X.length>0){let K=g.union(X);u.current.push(K);let J=P.subtract(K);u.current.push(J),P=J}if(x=P,x){let K=x.getMesh(),J=mE(K);C.board={geometry:J,color:Gpt(_),material:_.material,isFaux:p}}i(C)}catch(b){console.error("Error processing geometry with Manifold in hook:",b),l(b.message||"An unknown error occurred while processing geometry in hook."),i(null)}finally{d(!1)}return()=>{u.current.forEach(y),u.current=[]}},[e,t,_]);let A=p4.useMemo(()=>{if(!_||!m)return null;return bto({circuitJson:t,boardData:_,traceTextureResolution:m,visibility:o})},[t,_,m,o]);return{geoms:r,textures:A,pcbThickness:s,error:c,isLoading:h,boardData:_,isFauxBoard:p}};function a$n(e,t){e.updateMatrix();let n=e.geometry.index?e.geometry.toNonIndexed():e.geometry,o=n.getAttribute("position"),r=n.getAttribute("uv"),i=[];for(let s=0;s<o.count;s+=3){let a=[0,1,2].map((u)=>{let _=new Et().fromBufferAttribute(o,s+u).applyMatrix4(e.matrix);return{x:_.x-t.x,y:_.y-t.y,z:_.z}}),[c,l,h]=a,d=new Et(l.x-c.x,l.y-c.y,l.z-c.z).cross(new Et(h.x-c.x,h.y-c.y,h.z-c.z)).normalize();i.push({vertices:a,normal:{x:d.x,y:d.y,z:d.z},...r?{uvs:[0,1,2].map((u)=>({u:r.getX(s+u),v:r.getY(s+u)}))}:{}})}if(n!==e.geometry)n.dispose();return{triangles:i,boundingBox:Jpe(i)}}function zto(e,t){let n=[],o=[],r=[];for(let s of e.triangles)s.vertices.forEach((a,c)=>{n.push(a.x+t.x,a.y+t.y,a.z),o.push(s.normal.x,s.normal.y,s.normal.z),r.push(s.uvs?.[c]?.u??0,s.uvs?.[c]?.v??0)});let i=new js;return i.setAttribute("position",new Wr(n,3)),i.setAttribute("normal",new Wr(o,3)),i.setAttribute("uv",new Wr(r,2)),i.computeBoundingBox(),i.computeBoundingSphere(),i}function c$n(e,t,n){let o=e.clone();return o.geometry=zto(t,n.center),o.position.set(0,0,0),o.rotation.set(0,0,0),o.scale.set(1,1,1),o.updateMatrix(),o}function kXi(e,t,n,o){let r=n.filter((p)=>p.type==="pcb_board"),i=n.filter((p)=>p.type==="pcb_bend"),s=n.filter((p)=>p.type==="pcb_stiffener");if(!i.length&&!s.length)return{geometryMeshes:e,textureMeshes:t};let a=r[0];if(!a||r.length!==1||n.some((p)=>p.type==="pcb_panel")||[...i,...s].some((p)=>p.pcb_board_id!==a.pcb_board_id))throw Error("Flex rendering requires one board, matching board references, and no panel");let c=o?Lto(i,a.thickness??1.6):void 0,l=e.find((p)=>p.name==="board-geom"),h=l?a$n(l,a.center):void 0,d=c?e.map((p)=>c$n(p,s$n(a$n(p,a.center),c),a)):[...e],u=c&&h?t.map((p)=>{p.updateMatrix();let m=p.matrix.clone().invert(),A=p.name.startsWith("bottom"),g=p.geometry.parameters,f=h.triangles.filter((x)=>A?x.normal.z<-0.9:x.normal.z>0.9).map((x)=>{let C=x.vertices.map((I)=>({...I,z:p.position.z})),b=C.map((I)=>{let v=new Et(I.x+a.center.x,I.y+a.center.y,I.z).applyMatrix4(m);return{u:v.x/g.width+0.5,v:v.y/g.height+0.5}});return{...x,vertices:C,uvs:b}}),y=c$n(p,s$n({triangles:f,boundingBox:Jpe(f)},c),a);return p.geometry.dispose(),y}):t;for(let p of s){let m=new Mo(zto(vXi({stiffener:p,boardThickness:a.thickness??1.6,fold:c}),a.center),new vs({color:p.material==="fr4"?"#879568":p.material==="polyimide"?"#bd7f27":"#b8bdc4",side:bd}));m.name="board-stiffener",uC(m),d.push(m)}let _=new Mu;for(let p of[...d,...u])_.expandByObject(p);return{geometryMeshes:d,textureMeshes:u,bounds:{minX:_.min.x,maxX:_.max.x,minY:_.min.y,maxY:_.max.y,minZ:_.min.z,maxZ:_.max.z}}}var LXi=bd,HXi=({material:e,color:t,side:n=LXi,isFaux:o=!1})=>{if(e==="fr4")return new OA({color:t,side:n,metalness:0,roughness:0.48,specularIntensity:0.3,ior:1.45,sheen:0,clearcoat:0.16,clearcoatRoughness:0.3,transparent:o,opacity:o?dwe:1,flatShading:!0,polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:1});return new vs({color:t,side:n,flatShading:!0,metalness:0.1,roughness:0.8,transparent:!0,opacity:o?dwe:0.9,polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:1})};function FXi(e){let t=[];if(!e)return t;if(e.board?.geometry){let o=new Mo(e.board.geometry,HXi({material:e.board.material,color:e.board.color,side:bd,isFaux:e.board.isFaux}));o.name="board-geom",uC(o,{castShadow:!1,receiveShadow:!0}),t.push(o)}let n=(o)=>{if(o)for(let r of o){let i=new Mo(r.geometry,new vs({color:r.color,side:bd,flatShading:!0}));i.name=r.key,uC(i),t.push(i)}};return n(e.platedHoles),n(e.vias),t}var kMe;function zXi(){if(!kMe)kMe=(async()=>{let e=window.ManifoldModule??window.MANIFOLD??window.MANIFOLD_MODULE;if(e&&typeof e==="object"&&e.setup)return window.ManifoldModule=e,e;let n=await(e??(await import(Epe("manifold-3d","3.5.1","manifold.js"))).default)();return n.setup(),window.ManifoldModule=n,n})().catch((e)=>{throw kMe=void 0,e});return kMe}var OXi=({geometryMeshes:e,textureMeshes:t})=>{let{rootObject:n}=rg(),{visibility:o}=pU(),r=(i)=>{i.geometry.dispose();let s=Array.isArray(i.material)?i.material:[i.material];for(let a of s){if(!a)continue;let c=["map","alphaMap","aoMap","bumpMap","displacementMap","emissiveMap","lightMap","metalnessMap","normalMap","roughnessMap","specularMap"],l=a;for(let h of c){let d=l[h];if(d&&d instanceof vl)d.dispose()}a.dispose()}};return Y1.useEffect(()=>{if(!n)return;for(let i of e){let s=!0;if(i.name==="board-geom"||i.name==="board-stiffener")s=o.boardBody;else if(i.name.includes("plated_hole")||i.name.includes("via"))s=o.topCopper||o.bottomCopper;if(s)n.add(i)}return()=>{for(let i of e){if(i.parent===n)n.remove(i);r(i)}}},[n,e,o]),Y1.useEffect(()=>{if(!n)return;for(let i of t)n.add(i);return()=>{for(let i of t){if(i.parent===n)n.remove(i);r(i)}}},[n,t]),null},VXi=({circuitJson:e,foldPcbs:t,autoRotateDisabled:n,clickToInteractEnabled:o,onUserInteraction:r,children:i,onCameraControllerReady:s,resolveStaticAsset:a,referenceObject:c,hiddenCadComponentIds:l})=>{let h=zpt(i),d=Y1.useMemo(()=>Tto(e??h),[e,h]),[u,_]=Y1.useState(null),[p,m]=Y1.useState(null),{visibility:A}=pU();Y1.useEffect(()=>{let L=!0;return zXi().then((H)=>{if(L)_(H)}).catch((H)=>{if(!L)return;console.error("Failed to initialize Manifold:",H),m(`Failed to initialize Manifold: ${H instanceof Error?H.message:"Unknown error"}`)}),()=>{L=!1}},[]);let{geoms:g,textures:f,pcbThickness:y,error:x,isLoading:C,boardData:b,isFauxBoard:I}=QXi(u,d,A),v=Y1.useMemo(()=>{try{let L=Deo(d,t),H=bXi(d,{foldPcbs:L});return{...kXi(FXi(g),HWi(f,b,y,I),d,L),posedJson:H,error:void 0}}catch(L){return{error:L instanceof Error?L.message:String(L),geometryMeshes:[],textureMeshes:[],posedJson:d,bounds:void 0}}},[g,f,b,y,I,d,t]),P=Y1.useMemo(()=>Vo(v.posedJson).cad_component.list().filter((L)=>!l?.has(L.cad_component_id)),[v.posedJson,l]),M=Y1.useMemo(()=>Mto(v.posedJson),[v.posedJson]),B=Y1.useMemo(()=>{if(!b)return;let L=yf(b);return{width:L.width,height:L.height}},[b]),T=Y1.useMemo(()=>{if(!b)return;let L=yf(b);return{x:L.centerX,y:L.centerY}},[b]),N=Y1.useMemo(()=>Bto({boardDimensions:B,boardCenter:T}),[B,T]),D=Y1.useMemo(()=>{if(!b)return;return JSON.stringify({pcbBoardId:b.pcb_board_id,center:T,dimensions:B})},[b,T,B]);if(p)return lC.jsxs("div",{style:{color:"red",padding:"1em",border:"1px solid red",margin:"1em"},children:["Error: ",p]});if(!u)return lC.jsx("div",{style:{padding:"1em"},children:"Loading Manifold module..."});if(x||v.error)return lC.jsxs("div",{role:"alert",style:{color:"red",padding:"1em",border:"1px solid red",margin:"1em"},children:["Error: ",x??v.error]});if(C)return lC.jsx("div",{style:{padding:"1em"},children:"Processing board geometry..."});return lC.jsxs(mto,{initialCameraPosition:N,autoRotateDisabled:n,clickToInteractEnabled:o,boardDimensions:B,boardCenter:T,cameraSessionScope:D,referenceObject:c,onUserInteraction:r,onCameraControllerReady:s,children:[lC.jsx(OXi,{geometryMeshes:v.geometryMeshes,textureMeshes:v.textureMeshes}),v.bounds&&lC.jsx(pto,{bounds:v.bounds}),P.map((L)=>lC.jsx(Vpt,{fallback:({error:H})=>lC.jsx(yto,{cad_component:L,error:H}),children:lC.jsx(Zeo,{cad_component:L,circuitJson:v.posedJson,resolveStaticAsset:a})},L.cad_component_id)),M.map((L)=>lC.jsx(wto,{cable:L},L.cad_cable_id))]})},l$n=VXi,YXi=Object.defineProperty,Wte=(e,t)=>YXi(e,"name",{value:t,configurable:!0}),Oto=!!(typeof window<"u"&&window.document&&window.document.createElement);function Rl(e,t,{checkForDefaultPrevented:n=!0}={}){return Wte(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},"handleEvent")}Wte(Rl,"composeEventHandlers");function GXi(e){if(!Oto)throw Error("Cannot access window outside of the DOM");return e?.ownerDocument?.defaultView??window}Wte(GXi,"getOwnerWindow");function N0t(e){if(!Oto)throw Error("Cannot access document outside of the DOM");return e?.ownerDocument??document}Wte(N0t,"getOwnerDocument");function Vto(e,t=!1){let{activeElement:n}=N0t(e);if(!n?.nodeName)return null;if(Yto(n)&&n.contentDocument)return Vto(n.contentDocument.body,t);if(t){let o=n.getAttribute("aria-activedescendant");if(o){let r=N0t(n).getElementById(o);if(r)return r}}return n}Wte(Vto,"getActiveElement");function Yto(e){return e.tagName==="IFRAME"}Wte(Yto,"isFrame");var UXi=Object.defineProperty,Wpt=(e,t)=>UXi(e,"name",{value:t,configurable:!0});function R0t(e,t){if(typeof e==="function")return e(t);else if(e!==null&&e!==void 0)e.current=t}Wpt(R0t,"setRef");function Uto(...e){return(t)=>{let n=!1,o=e.map((r)=>{let i=R0t(r,t);if(!n&&typeof i=="function")n=!0;return i});if(n)return()=>{for(let r=0;r<o.length;r++){let i=o[r];if(typeof i=="function")i();else R0t(e[r],null)}}}}Wpt(Uto,"composeRefs");function cA(...e){return Gto.useCallback(Uto(...e),e)}Wpt(cA,"useComposedRefs");var WXi=Object.defineProperty,W6=(e,t)=>WXi(e,"name",{value:t,configurable:!0});function XXi(e,t){let n=$6.createContext(t);n.displayName=e+"Context";let o=W6((i)=>{let{children:s,...a}=i,c=$6.useMemo(()=>a,Object.values(a));return Xpt.jsx(n.Provider,{value:c,children:s})},"Provider");o.displayName=e+"Provider";function r(i,s={}){let{optional:a=!1}=s,c=$6.useContext(n);if(c)return c;if(t!==void 0)return t;if(a)return;throw Error(`\`${i}\` must be used within \`${e}\``)}return W6(r,"useContext"),[o,r]}W6(XXi,"createContext");function mU(e,t=[]){let n=[];function o(i,s){let a=$6.createContext(s);a.displayName=i+"Context";let c=n.length;n=[...n,s];let l=W6((d)=>{let{scope:u,children:_,...p}=d,m=u?.[e]?.[c]||a,A=$6.useMemo(()=>p,Object.values(p));return Xpt.jsx(m.Provider,{value:A,children:_})},"Provider");l.displayName=i+"Provider";function h(d,u,_={}){let{optional:p=!1}=_,m=u?.[e]?.[c]||a,A=$6.useContext(m);if(A)return A;if(s!==void 0)return s;if(p)return;throw Error(`\`${d}\` must be used within \`${i}\``)}return W6(h,"useContext"),[l,h]}W6(o,"createContext");let r=W6(()=>{let i=n.map((s)=>$6.createContext(s));return W6(function(a){let c=a?.[e]||i;return $6.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])},"useScope")},"createScope");return r.scopeName=e,[o,Wto(r,...t)]}W6(mU,"createContextScope");function Wto(...e){let t=e[0];if(e.length===1)return t;let n=W6(()=>{let o=e.map((r)=>({useScope:r(),scopeName:r.scopeName}));return W6(function(i){let s=o.reduce((a,{useScope:c,scopeName:l})=>{let d=c(i)[`__scope${l}`];return{...a,...d}},{});return $6.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}W6(Wto,"composeContextScopes");var Xto=!1,dC=globalThis?.document?jto.useLayoutEffect:()=>{},jXi=Object.defineProperty,KXi=(e,t)=>jXi(e,"name",{value:t,configurable:!0}),h$n=Xte[" useEffectEvent ".trim().toString()],d$n=Xte[" useInsertionEffect ".trim().toString()];function Kto(e){if(typeof h$n==="function")return h$n(e);let t=Xte.useRef(()=>{throw Error("Cannot call an event handler while rendering.")});if(typeof d$n==="function")d$n(()=>{t.current=e});else dC(()=>{t.current=e});return Xte.useMemo(()=>(...n)=>t.current?.(...n),[])}KXi(Kto,"useEffectEvent");var $Xi=Object.defineProperty,Zpe=(e,t)=>$Xi(e,"name",{value:t,configurable:!0}),qXi=q6[" useInsertionEffect ".trim().toString()]||dC;function Kwe({prop:e,defaultProp:t,onChange:n=Zpe(()=>{},"onChange"),caller:o}){let[r,i,s]=$to({defaultProp:t,onChange:n}),a=e!==void 0,c=a?e:r;if(Xto){let h=q6.useRef(e!==void 0);q6.useEffect(()=>{let d=h.current;if(d!==a)console.warn(`${o} is changing from ${d?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`);h.current=a},[a,o])}let l=q6.useCallback((h)=>{if(a){let d=qto(h)?h(e):h;if(d!==e)s.current?.(d)}else i(h)},[a,e,i,s]);return[c,l]}Zpe(Kwe,"useControllableState");function $to({defaultProp:e,onChange:t}){let[n,o]=q6.useState(e),r=q6.useRef(n),i=q6.useRef(t);return qXi(()=>{i.current=t},[t]),q6.useEffect(()=>{if(r.current!==n)i.current?.(n),r.current=n},[n,r]),[n,o,i]}Zpe($to,"useUncontrolledState");function qto(e){return typeof e==="function"}Zpe(qto,"isFunction");var u$n=Symbol("RADIX:SYNC_STATE");function JXi(e,t,n,o){let{prop:r,defaultProp:i,onChange:s,caller:a}=t,c=r!==void 0,l=Kto(s);if(Xto){let A=Wv.useRef(r!==void 0);Wv.useEffect(()=>{let g=A.current;if(g!==c)console.warn(`${a} is changing from ${g?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`);A.current=c},[c,a])}let h=[{...n,state:i}];if(o)h.push(o);let[d,u]=Wv.useReducer((A,g)=>{if(g.type===u$n)return{...A,state:g.state};let f=e(A,g);if(c&&!Object.is(f.state,A.state))l(f.state);return f},...h),_=d.state,p=Wv.useRef(_);Wv.useEffect(()=>{if(p.current!==_){if(p.current=_,!c)l(_)}},[_,p,c]);let m=Wv.useMemo(()=>{if(r!==void 0)return{...d,state:r};return d},[d,r]);return Wv.useEffect(()=>{if(c&&!Object.is(r,d.state))u({type:u$n,state:r})},[r,d.state,c]),[m,u]}Zpe(JXi,"useControllableStateReducer");var ZXi=Object.defineProperty,gC=(e,t)=>ZXi(e,"name",{value:t,configurable:!0});function sU(e){let t=P2.forwardRef((n,o)=>{let{children:r,...i}=n,s=null,a=!1,c=[];if(r=ino(r),P2.Children.forEach(r,(u)=>{if(ono(u)){a=!0;let _=u,p="child"in _.props?_.props.child:_.props.children;while(jpt(p)&&typeof Awe==="function")p=Awe(p._payload);s=tji(_,p),c.push(s?.props?.children)}else c.push(u)}),s)s=P2.cloneElement(s,void 0,c);else if(!a&&P2.Children.count(r)===1&&P2.isValidElement(r))s=r;let l=s?nno(s):void 0,h=cA(o,l);if(!s){if(r||r===0)throw Error(a?rji(e):oji(e));return r}let d=tno(i,s.props??{});if(s.type!==P2.Fragment)d.ref=o?h:l;return P2.cloneElement(s,d)});return t.displayName=`${e}.Slot`,t}gC(sU,"createSlot");var eno=Symbol.for("radix.slottable");function eji(e){let t=gC((n)=>("child"in n)?n.children(n.child):n.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=eno,t}gC(eji,"createSlottable");var tji=gC((e,t)=>{if("child"in e.props){if(!P2.isValidElement(t))return null;return P2.cloneElement(t,void 0,e.props.children(t.props.children))}return P2.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function tno(e,t){let n={...t};for(let o in t){let r=e[o],i=t[o];if(/^on[A-Z]/.test(o)){if(r&&i)n[o]=(...a)=>{let c=i(...a);return r(...a),c};else if(r)n[o]=r}else if(o==="style")n[o]={...r,...i};else if(o==="className")n[o]=[r,i].filter(Boolean).join(" ");else if(o==="aria-describedby")n[o]=sno(i,r)}return{...e,...n}}gC(tno,"mergeProps");function nno(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}gC(nno,"getElementRef");function ono(e){return P2.isValidElement(e)&&typeof e.type==="function"&&"__radixId"in e.type&&e.type.__radixId===eno}gC(ono,"isSlottable");var nji=Symbol.for("react.lazy");function jpt(e){return e!=null&&typeof e==="object"&&"$$typeof"in e&&e.$$typeof===nji&&"_payload"in e&&rno(e._payload)}gC(jpt,"isLazyComponent");function rno(e){return typeof e==="object"&&e!==null&&"then"in e}gC(rno,"isPromiseLike");function ino(e){let t=e;while(jpt(t)&&typeof Awe==="function")t=Awe(t._payload);return t}gC(ino,"useUnwrappedLazy");function sno(...e){let t=new Set;for(let n of e){if(typeof n!=="string")continue;for(let o of String(n).trim().split(/\s+/))if(o)t.add(o)}return t.size>0?Array.from(t).join(" "):void 0}gC(sno,"concatAriaDescribedby");var oji=gC((e)=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),rji=gC((e)=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),Awe=P2[" use ".trim().toString()],iji=Object.defineProperty,sji=(e,t)=>iji(e,"name",{value:t,configurable:!0}),aji=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],SE=aji.reduce((e,t)=>{let n=sU(`Primitive.${t}`),o=Jto.forwardRef((r,i)=>{let{asChild:s,...a}=r,c=s?n:t;if(typeof window<"u")window[Symbol.for("radix-ui")]=!0;return ano.jsx(c,{...a,ref:i})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function Kpt(e,t){if(e)Zto.flushSync(()=>e.dispatchEvent(t))}sji(Kpt,"dispatchDiscreteCustomEvent");var cji=Object.defineProperty,iA=(e,t)=>cji(e,"name",{value:t,configurable:!0});function $pt(e){let t=e+"CollectionProvider",[n,o]=mU(t),[r,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=iA((m)=>{let{scope:A,children:g}=m,f=Xv.useRef(null),y=Xv.useRef(new Map).current;return JMe.jsx(r,{scope:A,itemMap:y,collectionRef:f,children:g})},"CollectionProvider");s.displayName=t;let a=e+"CollectionSlot",c=sU(a),l=Xv.forwardRef((m,A)=>{let{scope:g,children:f}=m,y=i(a,g),x=cA(A,y.collectionRef);return JMe.jsx(c,{ref:x,children:f})});l.displayName=a;let h=e+"CollectionItemSlot",d="data-radix-collection-item",u=sU(h),_=Xv.forwardRef((m,A)=>{let{scope:g,children:f,...y}=m,x=Xv.useRef(null),C=cA(A,x),b=i(h,g);return Xv.useEffect(()=>(b.itemMap.set(x,{ref:x,...y}),()=>void b.itemMap.delete(x))),JMe.jsx(u,{...{[d]:""},ref:C,children:f})});_.displayName=h;function p(m){let A=i(e+"CollectionConsumer",m);return Xv.useCallback(()=>{let f=A.collectionRef.current;if(!f)return[];let y=Array.from(f.querySelectorAll(`[${d}]`));return Array.from(A.itemMap.values()).sort((b,I)=>y.indexOf(b.ref.current)-y.indexOf(I.ref.current))},[A.collectionRef,A.itemMap])}return iA(p,"useCollection"),[{Provider:s,Slot:l,ItemSlot:_},p,o]}iA($pt,"createCollection");var p$n=new WeakMap,LMe=class e extends Map{static{iA(this,"OrderedDict")}#e;constructor(t){super(t);this.#e=[...super.keys()],p$n.set(this,!0)}set(t,n){if(p$n.get(this)&&!this.has(t))this.#e.push(t);return super.set(t,n),this}insert(t,n,o){let r=this.has(n),i=r?this.size:this.size+1,s=qpt(t),a=s>=0?Math.min(s,i-1):Math.max(i+s,0);if(r?this.#e.indexOf(n)===a:a===this.size)return this.set(n,o),this;let c=this.#e.filter((h)=>h!==n);c.splice(a,0,n);let l=c.map((h)=>[h,h===n?o:this.get(h)]);this.clear();for(let[h,d]of l)this.set(h,d);return this}with(t,n,o){let r=new e(this);return r.insert(t,n,o),r}before(t){let n=this.#e.indexOf(t)-1;if(n<0)return;return this.entryAt(n)}setBefore(t,n,o){let r=this.#e.indexOf(t);if(r===-1)return this;let i=this.#e.indexOf(n),s=i!==-1&&i<r?r-1:r;return this.insert(s,n,o)}after(t){let n=this.#e.indexOf(t);if(n=n===-1||n===this.size-1?-1:n+1,n===-1)return;return this.entryAt(n)}setAfter(t,n,o){let r=this.#e.indexOf(t);if(r===-1)return this;let i=this.#e.indexOf(n),s=i!==-1&&i<=r?r:r+1;return this.insert(s,n,o)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(t){let n=super.delete(t);if(n)this.#e.splice(this.#e.indexOf(t),1);return n}deleteAt(t){let n=this.keyAt(t);if(n!==void 0)return this.delete(n);return!1}at(t){let n=ZMe(this.#e,t);if(n!==void 0)return this.get(n)}entryAt(t){let n=ZMe(this.#e,t);if(n!==void 0)return[n,this.get(n)]}indexOf(t){return this.#e.indexOf(t)}keyAt(t){return ZMe(this.#e,t)}from(t,n){let o=this.indexOf(t);if(o===-1)return;let r=o+n;if(r<0)r=0;if(r>=this.size)r=this.size-1;return this.at(r)}keyFrom(t,n){let o=this.indexOf(t);if(o===-1)return;let r=o+n;if(r<0)r=0;if(r>=this.size)r=this.size-1;return this.keyAt(r)}find(t,n){let o=0;for(let r of this){if(Reflect.apply(t,n,[r,o,this]))return r;o++}return}findIndex(t,n){let o=0;for(let r of this){if(Reflect.apply(t,n,[r,o,this]))return o;o++}return-1}filter(t,n){let o=[],r=0;for(let i of this){if(Reflect.apply(t,n,[i,r,this]))o.push(i);r++}return new e(o)}map(t,n){let o=[],r=0;for(let i of this)o.push([i[0],Reflect.apply(t,n,[i,r,this])]),r++;return new e(o)}reduce(...t){let[n,o]=t,r=t.length>1;if(!r&&this.size===0)throw TypeError("Reduce of empty OrderedDict with no initial value");let i=0,s=o;for(let a of this){if(i===0&&!r)s=a;else s=Reflect.apply(n,this,[s,a,i,this]);i++}return s}reduceRight(...t){let[n,o]=t,r=t.length>1;if(!r&&this.size===0)throw TypeError("Reduce of empty OrderedDict with no initial value");let i=o;for(let s=this.size-1;s>=0;s--){let a=this.entryAt(s);if(s===this.size-1&&!r)i=a;else i=Reflect.apply(n,this,[i,a,s,this])}return i}sort(t){if(typeof t!=="function")throw TypeError("OrderedDict.sort requires a compare function");let n=[...this.entries()].sort(t);this.clear();for(let[o,r]of n)this.set(o,r);return this}toSorted(t){if(typeof t!=="function")throw TypeError("OrderedDict.toSorted requires a compare function");let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let n=this.size-1;n>=0;n--){let o=this.keyAt(n),r=this.get(o);t.set(o,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let o=new e;for(let r of this.#e.slice(t,n))o.set(r,this.get(r));return o}every(t,n){let o=0;for(let r of this){if(!Reflect.apply(t,n,[r,o,this]))return!1;o++}return!0}some(t,n){let o=0;for(let r of this){if(Reflect.apply(t,n,[r,o,this]))return!0;o++}return!1}};function ZMe(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);let n=cno(e,t);return n===-1?void 0:e[n]}iA(ZMe,"at");function cno(e,t){let n=e.length,o=qpt(t),r=o>=0?o:n+o;return r<0||r>=n?-1:r}iA(cno,"toSafeIndex");function qpt(e){return e!==e||e===0?0:Math.trunc(e)}iA(qpt,"toSafeInteger");function lji(e){let t=e+"CollectionProvider",[n,o]=mU(t),[r,i]=n(t);r.displayName=e+"CollectionStableContextProvider";let[s,a]=n(t);s.displayName=e+"CollectionStatefulContextProvider";let c=iA(({state:b,...I})=>b?nH.jsx(h,{...I,state:b}):nH.jsx(l,{...I}),"CollectionProvider");c.displayName=t;let l=iA((b)=>{let I=f();return nH.jsx(h,{...b,state:I})},"CollectionInit");l.displayName=e+"CollectionInit";let h=iA((b)=>{let{scope:I,children:v,state:P}=b,M=aA.useRef(null),[B,T]=aA.useState(null),N=cA(M,T),[D,L]=P,H=aA.useRef(new LMe),V=aA.useCallback(()=>{let O=H.current;if(!dno(O))O.sort(ewe);return O},[]);return aA.useEffect(()=>{if(!B)return;let O=uno(()=>{L((U)=>{let j=U.toSorted(ewe);return j.some(([X],K)=>U.keyAt(K)!==X)?j:U})});return O.observe(B,{childList:!0,subtree:!0}),()=>{O.disconnect()}},[B,L]),nH.jsx(r,{scope:I,collectionElementRef:N,collectionElementRefObject:M,getCollection:V,setCollection:L,registryRef:H,children:nH.jsx(s,{scope:I,collectionElement:B,collection:D,children:v})})},"CollectionProviderImpl");h.displayName=e+"CollectionProviderImpl";let d=e+"CollectionSlot",u=sU(d),_=aA.forwardRef((b,I)=>{let{scope:v,children:P}=b,M=i(d,v),B=cA(I,M.collectionElementRef);return nH.jsx(u,{ref:B,children:P})});_.displayName=d;let p=e+"CollectionItemSlot",m="data-radix-collection-item",A=sU(p),g=aA.forwardRef((b,I)=>{let{scope:v,children:P,...M}=b,B=aA.useRef(null),T=i(p,v),{setCollection:N,registryRef:D}=T,L=aA.useRef(M);if(!lno(L.current,M))L.current=M;let H=L.current,V=aA.useCallback((j)=>{let Y=D.current;if(j)Y.set(j,{...L.current,element:j});else if(B.current)Y.delete(B.current)},[D]),O=cA(I,V,B);dC(()=>{let j=B.current,Y=D.current;if(j&&Y.has(j))Y.set(j,{...H,element:j})},[H,D]);let U=aA.useRef(null);return aA.useEffect(()=>{let j=B.current,Y=U.current;if((Y?.element??null)===j&&(!j||Y?.itemData===H))return;U.current=j?{element:j,itemData:H}:null,N((X)=>{let K=new LMe(X);if(Y&&Y.element!==j)K.delete(Y.element);if(j)K.set(j,{...H,element:j});return K.sort(ewe)})}),aA.useEffect(()=>()=>{let j=U.current;if(U.current=null,!j)return;N((Y)=>{if(!Y.has(j.element))return Y;let X=new LMe(Y);return X.delete(j.element),X})},[N]),nH.jsx(A,{...{[m]:""},ref:O,children:P})});g.displayName=p;function f(){return aA.useState(new LMe)}iA(f,"useInitCollection");function y(b){let{collection:I}=a(e+"CollectionConsumer",b);return I}iA(y,"useCollection");function x(b){let{getCollection:I}=i(e+"CollectionConsumer",b);return I}return iA(x,"useGetCollection"),[{Provider:c,Slot:_,ItemSlot:g},{createCollectionScope:o,useCollection:y,useGetCollection:x,useInitCollection:f}]}iA(lji,"createCollection");function lno(e,t){if(e===t)return!0;if(typeof e!=="object"||typeof t!=="object")return!1;if(e==null||t==null)return!1;let n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(let r of n){if(!Object.prototype.hasOwnProperty.call(t,r))return!1;if(e[r]!==t[r])return!1}return!0}iA(lno,"shallowEqual");function hno(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}iA(hno,"isElementPreceding");function dno(e){let t;for(let n of e.keys()){if(t){let o=t.compareDocumentPosition(n);if(!(o&Node.DOCUMENT_POSITION_DISCONNECTED)&&o&Node.DOCUMENT_POSITION_PRECEDING)return!1}t=n}return!0}iA(dno,"isInDocumentOrder");function ewe(e,t){return!e[1].element||!t[1].element?0:hno(e[1].element,t[1].element)?-1:1}iA(ewe,"sortByDocumentPosition");function uno(e){return new MutationObserver((n)=>{for(let o of n)if(o.type==="childList"){e();return}})}iA(uno,"getChildListObserver");var dji=Object.defineProperty,uji=(e,t)=>dji(e,"name",{value:t,configurable:!0}),pji={LTR:"ltr",RTL:"rtl"},mji=$we.createContext(void 0);function Jpt(e){let t=$we.useContext(mji);return e||t||pji.LTR}uji(Jpt,"useDirection");var _ji=Object.defineProperty,gji=(e,t)=>_ji(e,"name",{value:t,configurable:!0}),m$n=eme[" useInsertionEffect ".trim().toString()];function xE(e){let t=eme.useRef(e);if(typeof m$n==="function")m$n(()=>{t.current=e});else dC(()=>{t.current=e});return eme.useMemo(()=>(...n)=>t.current?.(...n),[])}gji(xE,"useCallbackRef");var Aji=Object.defineProperty,_f=(e,t)=>Aji(e,"name",{value:t,configurable:!0}),Q0t="dismissableLayer.update",fji="dismissableLayer.pointerDownOutside",yji="dismissableLayer.focusOutside",_$n,mno=Qd.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),xji=Qd.forwardRef(_f(function(t,n){let{disableOutsidePointerEvents:o=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:c,onDismiss:l,...h}=t,d=Qd.useContext(mno),[u,_]=Qd.useState(null),p=u?.ownerDocument??globalThis?.document,[,m]=Qd.useState({}),A=cA(n,_),g=Array.from(d.layers),[f]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=f?g.indexOf(f):-1,x=u?g.indexOf(u):-1,C=d.layersWithOutsidePointerEventsDisabled.size>0,b=x>=y,I=Qd.useRef(!1),v=_no((T)=>{if(s?.(T),c?.(T),!T.defaultPrevented)l?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:I,dismissableSurfaces:d.dismissableSurfaces,shouldHandlePointerDownOutside:Qd.useCallback((T)=>{if(!(T instanceof Node))return!1;let N=[...d.branches].some((D)=>D.contains(T));return b&&!N},[d.branches,b])}),P=gno((T)=>{if(r&&I.current)return;let N=T.target;if([...d.branches].some((L)=>L.contains(N)))return;if(a?.(T),c?.(T),!T.defaultPrevented)l?.()},p),M=u?x===g.length-1:!1,B=xE((T)=>{if(T.key!=="Escape")return;if(i?.(T),!T.defaultPrevented&&l)T.preventDefault(),l()});return Qd.useEffect(()=>{if(!M)return;return p.addEventListener("keydown",B,{capture:!0}),()=>p.removeEventListener("keydown",B,{capture:!0})},[p,M,B]),Qd.useEffect(()=>{if(!u)return;if(o){if(d.layersWithOutsidePointerEventsDisabled.size===0)_$n=p.body.style.pointerEvents,p.body.style.pointerEvents="none";d.layersWithOutsidePointerEventsDisabled.add(u)}return d.layers.add(u),k0t(),()=>{if(o){if(d.layersWithOutsidePointerEventsDisabled.delete(u),d.layersWithOutsidePointerEventsDisabled.size===0)p.body.style.pointerEvents=_$n}}},[u,p,o,d]),Qd.useEffect(()=>()=>{if(!u)return;d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),k0t()},[u,d]),Qd.useEffect(()=>{let T=_f(()=>m({}),"handleUpdate");return document.addEventListener(Q0t,T),()=>document.removeEventListener(Q0t,T)},[]),pno.jsx(SE.div,{...h,ref:A,style:{pointerEvents:C?b?"auto":"none":void 0,...t.style},onFocusCapture:Rl(t.onFocusCapture,P.onFocusCapture),onBlurCapture:Rl(t.onBlurCapture,P.onBlurCapture),onPointerDownCapture:Rl(t.onPointerDownCapture,v.onPointerDownCapture)})},"DismissableLayer"));function Cji(){let e=Qd.useContext(mno),[t,n]=Qd.useState(null);return Qd.useEffect(()=>{if(!t)return;return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}_f(Cji,"useDismissableLayerSurface");var bji=_f(()=>!0,"IS_TRUE");function _no(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:o=!1,isDeferredPointerDownOutsideRef:r,dismissableSurfaces:i,shouldHandlePointerDownOutside:s=bji}=t,a=xE(e),c=Qd.useRef(!1),l=Qd.useRef(!1),h=Qd.useRef(new Map),d=Qd.useRef(()=>{});return Qd.useEffect(()=>{function u(){l.current=!1,r.current=!1,h.current.clear()}_f(u,"resetOutsideInteraction");function _(){return Array.from(h.current.values()).some(Boolean)}_f(_,"isOutsideInteractionIntercepted");function p(y){if(!l.current)return;let x=y.target;if(!(x instanceof Node&&[...i].some((b)=>b.contains(x))))h.current.set(y.type,!0);if(y.type==="click")window.setTimeout(()=>{if(l.current)d.current()},0)}_f(p,"handleInteractionCapture");function m(y){if(l.current)h.current.set(y.type,!1)}_f(m,"handleInteractionBubble");let A=_f((y)=>{if(y.target&&!c.current){let C=function(){n.removeEventListener("click",d.current);let I=_();if(u(),!I)Zpt(fji,a,b,{discrete:!0})};var x=C;if(_f(C,"handleAndDispatchPointerDownOutsideEvent"),!s(y.target)){n.removeEventListener("click",d.current),u(),c.current=!1;return}let b={originalEvent:y};if(l.current=!0,r.current=o&&y.button===0,h.current.clear(),!o||y.button!==0)C();else n.removeEventListener("click",d.current),d.current=C,n.addEventListener("click",d.current,{once:!0})}else n.removeEventListener("click",d.current),u();c.current=!1},"handlePointerDown"),g=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(let y of g)n.addEventListener(y,p,!0),n.addEventListener(y,m);let f=window.setTimeout(()=>{n.addEventListener("pointerdown",A)},0);return()=>{window.clearTimeout(f),n.removeEventListener("pointerdown",A),n.removeEventListener("click",d.current);for(let y of g)n.removeEventListener(y,p,!0),n.removeEventListener(y,m)}},[n,a,o,r,i,s]),{onPointerDownCapture:_f(()=>c.current=!0,"onPointerDownCapture")}}_f(_no,"usePointerDownOutside");function gno(e,t=globalThis?.document){let n=xE(e),o=Qd.useRef(!1);return Qd.useEffect(()=>{let r=_f((i)=>{if(i.target&&!o.current)Zpt(yji,n,{originalEvent:i},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:_f(()=>o.current=!0,"onFocusCapture"),onBlurCapture:_f(()=>o.current=!1,"onBlurCapture")}}_f(gno,"useFocusOutside");function k0t(){let e=new CustomEvent(Q0t);document.dispatchEvent(e)}_f(k0t,"dispatchUpdate");function Zpt(e,t,n,{discrete:o}){let r=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});if(t)r.addEventListener(e,t,{once:!0});if(o)Kpt(r,i);else r.dispatchEvent(i)}_f(Zpt,"handleAndDispatchCustomEvent");var Iji=Object.defineProperty,emt=(e,t)=>Iji(e,"name",{value:t,configurable:!0}),HMe=0,Ite=null;function vji(e){return tmt(),e.children}emt(vji,"FocusGuards");function tmt(){Ano.useEffect(()=>{if(!Ite)Ite={start:L0t(),end:L0t()};let{start:e,end:t}=Ite;if(document.body.firstElementChild!==e)document.body.insertAdjacentElement("afterbegin",e);if(document.body.lastElementChild!==t)document.body.insertAdjacentElement("beforeend",t);return HMe++,()=>{if(HMe===1)Ite?.start.remove(),Ite?.end.remove(),Ite=null;HMe=Math.max(0,HMe-1)}},[])}emt(tmt,"useFocusGuards");function L0t(){let e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}emt(L0t,"createFocusGuard");var Sji=Object.defineProperty,ng=(e,t)=>Sji(e,"name",{value:t,configurable:!0}),i0t="focusScope.autoFocusOnMount",s0t="focusScope.autoFocusOnUnmount",g$n={bubbles:!1,cancelable:!0},Pji=Dp.forwardRef(ng(function(t,n){let{loop:o=!1,trapped:r=!1,branches:i,onMountAutoFocus:s,onUnmountAutoFocus:a,...c}=t,[l,h]=Dp.useState(null),d=xE(s),u=xE(a),_=Dp.useRef(null),p=cA(n,h),m=Dp.useRef(i);Dp.useEffect(()=>{m.current=i});let A=Dp.useCallback((y)=>{if(!y)return!1;if(l?.contains(y))return!0;return Boolean(m.current?.some((x)=>x.contains(y)))},[l]),g=Dp.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;Dp.useEffect(()=>{if(r){let b=function(M){if(g.paused||!l)return;let B=M.target;if(A(B))_.current=B;else wT(_.current,{select:!0})},I=function(M){if(g.paused||!l)return;let B=M.relatedTarget;if(B===null)return;if(!A(B))wT(_.current,{select:!0})},v=function(M){if(document.activeElement!==document.body)return;for(let T of M)if(T.removedNodes.length>0)wT(l)};var y=b,x=I,C=v;ng(b,"handleFocusIn"),ng(I,"handleFocusOut"),ng(v,"handleMutations"),document.addEventListener("focusin",b),document.addEventListener("focusout",I);let P=new MutationObserver(v);if(l)P.observe(l,{childList:!0,subtree:!0});return()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",I),P.disconnect()}}},[r,l,g.paused,A]),Dp.useEffect(()=>{if(l){A$n.add(g);let y=document.activeElement;if(!l.contains(y)){let C=new CustomEvent(i0t,g$n);if(l.addEventListener(i0t,d),l.dispatchEvent(C),!C.defaultPrevented){if(bno(Eno(omt(l)),{select:!0}),document.activeElement===y)wT(l)}}return()=>{l.removeEventListener(i0t,d);let C=l.ownerDocument,b=CustomEvent;setTimeout(()=>{let I=new b(s0t,g$n);if(l.addEventListener(s0t,u),l.dispatchEvent(I),!I.defaultPrevented)wT(y??C.body,{select:!0});l.removeEventListener(s0t,u),A$n.remove(g)},0)}}},[l,d,u,g]);let f=Dp.useCallback((y)=>{if(!o&&!r)return;if(g.paused)return;let x=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,C=document.activeElement;if(x&&C){let b=y.currentTarget,[I,v]=Ino(b);if(!(I&&v)){if(C===b)y.preventDefault()}else if(!y.shiftKey&&C===v){if(y.preventDefault(),o)wT(I,{select:!0})}else if(y.shiftKey&&C===I){if(y.preventDefault(),o)wT(v,{select:!0})}}},[o,r,g.paused]);return nmt.jsx(SE.div,{tabIndex:-1,...c,ref:p,onKeyDown:f})},"FocusScope")),fno=Dp.createContext(null);function yno({registry:e,children:t}){if(!e)return t;return nmt.jsx(fno.Provider,{value:e,children:t})}ng(yno,"FocusScopeBranchProvider");function xno(){let[e,t]=Dp.useState([]),n=Dp.useMemo(()=>({add:ng((o)=>t((r)=>r.includes(o)?r:[...r,o]),"add"),remove:ng((o)=>t((r)=>r.filter((i)=>i!==o)),"remove")}),[]);return{nodes:e,registry:n}}ng(xno,"useFocusScopeBranchRegistry");function Cno(e){let t=Dp.useContext(fno);Dp.useEffect(()=>{if(!e||!t)return;return t.add(e),()=>t.remove(e)},[e,t])}ng(Cno,"useFocusScopeBranch");function bno(e,{select:t=!1}={}){let n=document.activeElement;for(let o of e)if(wT(o,{select:t}),document.activeElement!==n)return}ng(bno,"focusFirst");function Ino(e){let t=omt(e),n=H0t(t,e),o=H0t(t.reverse(),e);return[n,o]}ng(Ino,"getTabbableEdges");function omt(e){let t=[],o=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:ng((r)=>{let i=r.tagName==="INPUT"&&r.type==="hidden";if(r.disabled||r.hidden||i)return NodeFilter.FILTER_SKIP;return r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});while(o.nextNode())t.push(o.currentNode);return t}ng(omt,"getTabbableCandidates");function H0t(e,t){let n=typeof t.checkVisibility==="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(let o of e)if(!(n?!o.checkVisibility({checkVisibilityCSS:!0}):vno(o,{upTo:t})))return o}ng(H0t,"findVisible");function vno(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;while(e){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}ng(vno,"isHidden");function Sno(e){return e.tagName==="INPUT"&&typeof e.select==="function"}ng(Sno,"isSelectableInput");function wT(e,{select:t=!1}={}){if(e&&e.focus){let o=(e.ownerDocument??document).activeElement;if(e.focus({preventScroll:!0}),e!==o&&Sno(e)&&t)e.select()}}ng(wT,"focus");var A$n=Pno();function Pno(){let e=[];return{add(t){let n=e[0];if(t!==n)n?.pause();e=F0t(e,t),e.unshift(t)},remove(t){e=F0t(e,t),e[0]?.resume()}}}ng(Pno,"createFocusScopesStack");function F0t(e,t){let n=[...e],o=n.indexOf(t);if(o!==-1)n.splice(o,1);return n}ng(F0t,"arrayRemove");function Eno(e){return e.filter((t)=>t.tagName!=="A")}ng(Eno,"removeLinks");var Eji=Object.defineProperty,Mji=(e,t)=>Eji(e,"name",{value:t,configurable:!0}),wji=rmt[" useId ".trim().toString()]||(()=>{return}),Bji=0;function Lte(e){let[t,n]=rmt.useState(wji());return dC(()=>{if(!e)n((o)=>o??String(Bji++))},[e]),e||(t?`radix-${t}`:"")}Mji(Lte,"useId");var Tji=["top","right","bottom","left"],{min:cH,max:kT,round:fwe,floor:FMe}=Math,LT=(e)=>({x:e,y:e}),Dji={left:"right",right:"left",bottom:"top",top:"bottom"};function Mno(e,t,n){return kT(e,cH(t,n))}function HT(e,t){return typeof e==="function"?e(t):e}function lH(e){return e.split("-")[0]}function jte(e){return e.split("-")[1]}function imt(e){return e==="x"?"y":"x"}function smt(e){return e==="y"?"height":"width"}function AE(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function amt(e){return imt(AE(e))}function Nji(e,t,n){if(n===void 0)n=!1;let o=jte(e),r=amt(e),i=smt(r),s=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";if(t.reference[i]>t.floating[i])s=ywe(s);return[s,ywe(s)]}function Rji(e){let t=ywe(e);return[z0t(e),t,z0t(t)]}function z0t(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}var f$n=["left","right"],y$n=["right","left"],Qji=["top","bottom"],kji=["bottom","top"];function Lji(e,t,n){switch(e){case"top":case"bottom":if(n)return t?y$n:f$n;return t?f$n:y$n;case"left":case"right":return t?Qji:kji;default:return[]}}function Hji(e,t,n,o){let r=jte(e),i=Lji(lH(e),n==="start",o);if(r){if(i=i.map((s)=>s+"-"+r),t)i=i.concat(i.map(z0t))}return i}function ywe(e){let t=lH(e);return Dji[t]+e.slice(t.length)}function Fji(e){var t,n,o,r;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(o=e.bottom)!=null?o:0,left:(r=e.left)!=null?r:0}}function wno(e){return typeof e!=="number"?Fji(e):{top:e,right:e,bottom:e,left:e}}function xwe(e){let{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function x$n(e,t,n){let{reference:o,floating:r}=e,i=AE(t),s=amt(t),a=smt(s),c=lH(t),l=i==="y",h=o.x+o.width/2-r.width/2,d=o.y+o.height/2-r.height/2,u=o[a]/2-r[a]/2,_;switch(c){case"top":_={x:h,y:o.y-r.height};break;case"bottom":_={x:h,y:o.y+o.height};break;case"right":_={x:o.x+o.width,y:d};break;case"left":_={x:o.x-r.width,y:d};break;default:_={x:o.x,y:o.y}}let p=jte(t);if(p)_[s]+=u*(p==="end"?1:-1)*(n&&l?-1:1);return _}async function zji(e,t){var n;if(t===void 0)t={};let{x:o,y:r,platform:i,rects:s,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:h="viewport",elementContext:d="floating",altBoundary:u=!1,padding:_=0}=HT(t,e),p=wno(_),A=a[u?d==="floating"?"reference":"floating":d],g=xwe(await i.getClippingRect({element:((n=await(i.isElement==null?void 0:i.isElement(A)))!=null?n:!0)?A:A.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:l,rootBoundary:h,strategy:c})),f=d==="floating"?{x:o,y:r,width:s.floating.width,height:s.floating.height}:s.reference,y=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),x=await(i.isElement==null?void 0:i.isElement(y))&&await(i.getScale==null?void 0:i.getScale(y))||{x:1,y:1},C=xwe(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:f,offsetParent:y,strategy:c}):f);return{top:(g.top-C.top+p.top)/x.y,bottom:(C.bottom-g.bottom+p.bottom)/x.y,left:(g.left-C.left+p.left)/x.x,right:(C.right-g.right+p.right)/x.x}}var Oji=50,Vji=async(e,t,n)=>{let{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:s}=n,a=s.detectOverflow?s:{...s,detectOverflow:zji},c=await(s.isRTL==null?void 0:s.isRTL(t)),l=await s.getElementRects({reference:e,floating:t,strategy:r}),{x:h,y:d}=x$n(l,o,c),u=o,_=0,p={};for(let m=0;m<i.length;m++){let A=i[m];if(!A)continue;let{name:g,fn:f}=A,{x:y,y:x,data:C,reset:b}=await f({x:h,y:d,initialPlacement:o,placement:u,strategy:r,middlewareData:p,rects:l,platform:a,elements:{reference:e,floating:t}});if(h=y!=null?y:h,d=x!=null?x:d,p[g]={...p[g],...C},b&&_<Oji){if(_++,typeof b==="object"){if(b.placement)u=b.placement;if(b.rects)l=b.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:r}):b.rects;({x:h,y:d}=x$n(l,u,c))}m=-1}}return{x:h,y:d,placement:u,strategy:r,middlewareData:p}},Yji=(e)=>({name:"arrow",options:e,async fn(t){let{x:n,y:o,placement:r,rects:i,platform:s,elements:a,middlewareData:c}=t,{element:l,padding:h=0}=HT(e,t)||{};if(l==null)return{};let d=wno(h),u={x:n,y:o},_=amt(r),p=smt(_),m=await s.getDimensions(l),A=_==="y",g=A?"top":"left",f=A?"bottom":"right",y=A?"clientHeight":"clientWidth",x=i.reference[p]+i.reference[_]-u[_]-i.floating[p],C=u[_]-i.reference[_],b=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l)),I=b?b[y]:0;if(!I||!await(s.isElement==null?void 0:s.isElement(b)))I=a.floating[y]||i.floating[p];let v=x/2-C/2,P=I/2-m[p]/2-1,M=cH(d[g],P),B=cH(d[f],P),T=I-m[p]-B,N=I/2-m[p]/2+v,D=Mno(M,N,T),L=!c.arrow&&jte(r)!=null&&N!==D&&i.reference[p]/2-(N<M?M:B)-m[p]/2<0,H=L?N<M?N-M:N-T:0;return{[_]:u[_]+H,data:{[_]:D,centerOffset:N-D-H,...L&&{alignmentOffset:H}},reset:L}}}),Gji=function(e){if(e===void 0)e={};return{name:"flip",options:e,async fn(t){var n,o;let{placement:r,middlewareData:i,rects:s,initialPlacement:a,platform:c,elements:l}=t,{mainAxis:h=!0,crossAxis:d=!0,fallbackPlacements:u,fallbackStrategy:_="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...A}=HT(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=lH(r),f=AE(a),y=lH(a)===a,x=await(c.isRTL==null?void 0:c.isRTL(l.floating)),C=u||(y||!m?[ywe(a)]:Rji(a)),b=p!=="none";if(!u&&b)C.push(...Hji(a,m,p,x));let I=[a,...C],v=await c.detectOverflow(t,A),P=[],M=((o=i.flip)==null?void 0:o.overflows)||[];if(h)P.push(v[g]);if(d){let D=Nji(r,s,x);P.push(v[D[0]],v[D[1]])}if(M=[...M,{placement:r,overflows:P}],!P.every((D)=>D<=0)){var B,T;let D=(((B=i.flip)==null?void 0:B.index)||0)+1,L=I[D];if(L){if(!(d==="alignment"?f!==AE(L):!1)||M.every((O)=>AE(O.placement)===f?O.overflows[0]>0:!0))return{data:{index:D,overflows:M},reset:{placement:L}}}let H=(T=M.filter((V)=>V.overflows[0]<=0).sort((V,O)=>V.overflows[1]-O.overflows[1])[0])==null?void 0:T.placement;if(!H)switch(_){case"bestFit":{var N;let V=(N=M.filter((O)=>{if(b){let U=AE(O.placement);return U===f||U==="y"}return!0}).map((O)=>[O.placement,O.overflows.filter((U)=>U>0).reduce((U,j)=>U+j,0)]).sort((O,U)=>O[1]-U[1])[0])==null?void 0:N[0];if(V)H=V;break}case"initialPlacement":H=a;break}if(r!==H)return{reset:{placement:H}}}return{}}}};function C$n(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function b$n(e){return Tji.some((t)=>e[t]>=0)}var Uji=function(e){if(e===void 0)e={};return{name:"hide",options:e,async fn(t){let{rects:n,platform:o}=t,{strategy:r="referenceHidden",...i}=HT(e,t);switch(r){case"referenceHidden":{let s=await o.detectOverflow(t,{...i,elementContext:"reference"}),a=C$n(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:b$n(a)}}}case"escaped":{let s=await o.detectOverflow(t,{...i,altBoundary:!0}),a=C$n(s,n.floating);return{data:{escapedOffsets:a,escaped:b$n(a)}}}default:return{}}}}},Bno=new Set(["left","top"]);async function Wji(e,t){let{placement:n,platform:o,elements:r}=e,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),s=lH(n),a=jte(n),c=AE(n)==="y",l=Bno.has(s)?-1:1,h=i&&c?-1:1,d=HT(t,e),{mainAxis:u,crossAxis:_,alignmentAxis:p}=typeof d==="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};if(a&&typeof p==="number")_=a==="end"?p*-1:p;return c?{x:_*h,y:u*l}:{x:u*l,y:_*h}}var Xji=function(e){if(e===void 0)e=0;return{name:"offset",options:e,async fn(t){var n,o;let{x:r,y:i,placement:s,middlewareData:a}=t,c=await Wji(t,e);if(s===((n=a.offset)==null?void 0:n.placement)&&(o=a.arrow)!=null&&o.alignmentOffset)return{};return{x:r+c.x,y:i+c.y,data:{...c,placement:s}}}}},jji=function(e){if(e===void 0)e={};return{name:"shift",options:e,async fn(t){let{x:n,y:o,placement:r,platform:i}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:c={fn:(f)=>{let{x:y,y:x}=f;return{x:y,y:x}}},...l}=HT(e,t),h={x:n,y:o},d=await i.detectOverflow(t,l),u=AE(r),_=imt(u),p=h[_],m=h[u],A=(f,y)=>Mno(y+d[f==="y"?"top":"left"],y,y-d[f==="y"?"bottom":"right"]);if(s)p=A(_,p);if(a)m=A(u,m);let g=c.fn({...t,[_]:p,[u]:m});return{...g,data:{x:g.x-n,y:g.y-o,enabled:{[_]:s,[u]:a}}}}}},Kji=function(e){if(e===void 0)e={};return{options:e,fn(t){var n,o;let{x:r,y:i,placement:s,rects:a,middlewareData:c}=t,{offset:l=0,mainAxis:h=!0,crossAxis:d=!0}=HT(e,t),u={x:r,y:i},_=AE(s),p=imt(_),m=u[p],A=u[_],g=HT(l,t),f=typeof g==="number"?{mainAxis:g,crossAxis:0}:{mainAxis:(n=g.mainAxis)!=null?n:0,crossAxis:(o=g.crossAxis)!=null?o:0};if(h){let C=p==="y"?"height":"width",b=a.reference[p]-a.floating[C]+f.mainAxis,I=a.reference[p]+a.reference[C]-f.mainAxis;if(m<b)m=b;else if(m>I)m=I}if(d){var y,x;let C=p==="y"?"width":"height",b=Bno.has(lH(s)),I=a.reference[_]-a.floating[C]+(b?((y=c.offset)==null?void 0:y[_])||0:0)+(b?0:f.crossAxis),v=a.reference[_]+a.reference[C]+(b?0:((x=c.offset)==null?void 0:x[_])||0)-(b?f.crossAxis:0);if(A<I)A=I;else if(A>v)A=v}return{[p]:m,[_]:A}}}},$ji=function(e){if(e===void 0)e={};return{name:"size",options:e,async fn(t){let{placement:n,rects:o,platform:r,elements:i}=t,{apply:s=()=>{},...a}=HT(e,t),c=await r.detectOverflow(t,a),l=lH(n),h=jte(n),d=AE(n)==="y",{width:u,height:_}=o.floating,p,m;if(l==="top"||l==="bottom")p=l,m=h===(await(r.isRTL==null?void 0:r.isRTL(i.floating))?"start":"end")?"left":"right";else m=l,p=h==="end"?"top":"bottom";let A=_-c.top-c.bottom,g=u-c.left-c.right,f=cH(_-c[p],A),y=cH(u-c[m],g),x=t.middlewareData.shift,C=!x,b=f,I=y;if(x!=null&&x.enabled.x)I=g;if(x!=null&&x.enabled.y)b=A;if(C&&!h)if(d)I=u-2*kT(c.left,c.right);else b=_-2*kT(c.top,c.bottom);await s({...t,availableWidth:I,availableHeight:b});let v=await r.getDimensions(i.floating);if(u!==v.width||_!==v.height)return{reset:{rects:!0}};return{}}}};function qwe(){return typeof window<"u"}function Kte(e){if(Tno(e))return(e.nodeName||"").toLowerCase();return"#document"}function m4(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function YT(e){var t;return(t=(Tno(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Tno(e){if(!qwe())return!1;return e instanceof Node||e instanceof m4(e).Node}function CE(e){if(!qwe())return!1;return e instanceof Element||e instanceof m4(e).Element}function dH(e){if(!qwe())return!1;return e instanceof HTMLElement||e instanceof m4(e).HTMLElement}function I$n(e){if(!qwe()||typeof ShadowRoot>"u")return!1;return e instanceof ShadowRoot||e instanceof m4(e).ShadowRoot}function Jwe(e){let{overflow:t,overflowX:n,overflowY:o,display:r}=bE(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&r!=="inline"&&r!=="contents"}function qji(e){return/^(table|td|th)$/.test(Kte(e))}function Zwe(e){try{if(e.matches(":popover-open"))return!0}catch(t){}try{return e.matches(":modal")}catch(t){return!1}}var Jji=/transform|translate|scale|rotate|perspective|filter/,Zji=/paint|layout|strict|content/,eU=(e)=>!!e&&e!=="none",a0t;function cmt(e){let t=CE(e)?bE(e):e;return eU(t.transform)||eU(t.translate)||eU(t.scale)||eU(t.rotate)||eU(t.perspective)||!lmt()&&(eU(t.backdropFilter)||eU(t.filter))||Jji.test(t.willChange||"")||Zji.test(t.contain||"")}function eKi(e){let t=aU(e);while(dH(t)&&!Rpe(t)){if(cmt(t))return t;else if(Zwe(t))return null;t=aU(t)}return null}function lmt(){if(a0t==null)a0t=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none");return a0t}function Rpe(e){return/^(html|body|#document)$/.test(Kte(e))}function bE(e){return m4(e).getComputedStyle(e)}function eBe(e){if(CE(e))return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop};return{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function aU(e){if(Kte(e)==="html")return e;let t=e.assignedSlot||e.parentNode||I$n(e)&&e.host||YT(e);return I$n(t)?t.host:t}function Dno(e){let t=aU(e);if(Rpe(t))return(e.ownerDocument||e).body;if(dH(t)&&Jwe(t))return t;return Dno(t)}function Qpe(e,t,n){var o;if(t===void 0)t=[];if(n===void 0)n=!0;let r=Dno(e),i=r===((o=e.ownerDocument)==null?void 0:o.body),s=m4(r);if(i){let a=O0t(s);return t.concat(s,s.visualViewport||[],Jwe(r)?r:[],a&&n?Qpe(a):[])}else return t.concat(r,Qpe(r,[],n))}function O0t(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Nno(e){let t=bE(e),n=parseFloat(t.width)||0,o=parseFloat(t.height)||0,r=dH(e),i=r?e.offsetWidth:n,s=r?e.offsetHeight:o,a=fwe(n)!==i||fwe(o)!==s;if(a)n=i,o=s;return{width:n,height:o,$:a}}function hmt(e){return!CE(e)?e.contextElement:e}function Rte(e){let t=hmt(e);if(!dH(t))return LT(1);let n=t.getBoundingClientRect(),{width:o,height:r,$:i}=Nno(t),s=(i?fwe(n.width):n.width)/o,a=(i?fwe(n.height):n.height)/r;if(!s||!Number.isFinite(s))s=1;if(!a||!Number.isFinite(a))a=1;return{x:s,y:a}}var tKi=LT(0);function Rno(e){let t=m4(e);if(!lmt()||!t.visualViewport)return tKi;return{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function nKi(e,t,n){if(t===void 0)t=!1;return!!n&&t&&n===m4(e)}function cU(e,t,n,o){if(t===void 0)t=!1;if(n===void 0)n=!1;let r=e.getBoundingClientRect(),i=hmt(e),s=LT(1);if(t)if(o){if(CE(o))s=Rte(o)}else s=Rte(e);let a=nKi(i,n,o)?Rno(i):LT(0),c=(r.left+a.x)/s.x,l=(r.top+a.y)/s.y,h=r.width/s.x,d=r.height/s.y;if(i&&o){let u=m4(i),_=CE(o)?m4(o):o,p=u,m=O0t(p);while(m&&_!==p){let A=Rte(m),g=m.getBoundingClientRect(),f=bE(m),y=g.left+(m.clientLeft+parseFloat(f.paddingLeft))*A.x,x=g.top+(m.clientTop+parseFloat(f.paddingTop))*A.y;c*=A.x,l*=A.y,h*=A.x,d*=A.y,c+=y,l+=x,p=m4(m),m=O0t(p)}}return xwe({width:h,height:d,x:c,y:l})}function tBe(e,t){let n=eBe(e).scrollLeft;if(!t)return cU(YT(e)).left+n;return t.left+n}function Qno(e,t){let n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-tBe(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function oKi(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e,i=r==="fixed",s=YT(o),a=t?Zwe(t.floating):!1;if(o===s||a&&i)return n;let c={scrollLeft:0,scrollTop:0},l=LT(1),h=LT(0),d=dH(o);if(d||!i){if(Kte(o)!=="body"||Jwe(s))c=eBe(o);if(d){let _=cU(o);l=Rte(o),h.x=_.x+o.clientLeft,h.y=_.y+o.clientTop}}let u=s&&!d&&!i?Qno(s,c):LT(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+h.x+u.x,y:n.y*l.y-c.scrollTop*l.y+h.y+u.y}}function rKi(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function iKi(e){let t=eBe(e),n=e.ownerDocument.body,o=kT(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),r=kT(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),i=-t.scrollLeft+tBe(e),s=-t.scrollTop;if(bE(n).direction==="rtl")i+=kT(e.clientWidth,n.clientWidth)-o;return{width:o,height:r,x:i,y:s}}var sKi=25;function aKi(e,t,n){if(n===void 0)n="viewport";let o=n==="layoutViewport",r=m4(e),i=YT(e),s=r.visualViewport,{clientWidth:a,clientHeight:c}=i,l=0,h=0;if(s){let u=!lmt()||t==="fixed";if(o){if(!u)l=-s.offsetLeft,h=-s.offsetTop}else if(a=s.width,c=s.height,u)l=s.offsetLeft,h=s.offsetTop}if(tBe(i)<=0){let u=i.ownerDocument,_=u.body,p=getComputedStyle(_),m=u.compatMode==="CSS1Compat"?parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0:0,A=Math.abs(i.clientWidth-_.clientWidth-m),g=getComputedStyle(i).scrollbarGutter==="stable both-edges"?A/2:A;if(g<=sKi)a-=g}return{width:a,height:c,x:l,y:h}}function cKi(e,t){let n=cU(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=Rte(e),s=e.clientWidth*i.x,a=e.clientHeight*i.y,c=r*i.x,l=o*i.y;return{width:s,height:a,x:c,y:l}}function v$n(e,t,n){let o;if(t==="viewport"||t==="layoutViewport")o=aKi(e,n,t);else if(t==="document")o=iKi(YT(e));else if(CE(t))o=cKi(t,n);else{let r=Rno(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return xwe(o)}function lKi(e,t){let n=t.get(e);if(n)return n;let o=Qpe(e,[],!1).filter((a)=>CE(a)&&Kte(a)!=="body"),r=null,i=bE(e).position==="fixed",s=i?aU(e):e;while(CE(s)&&!Rpe(s)){let a=bE(s),c=cmt(s),l=r?r.position:i?"fixed":"";if(!c&&(l==="fixed"||l==="absolute"&&a.position==="static"))o=o.filter((d)=>d!==s);else r=a;s=aU(s)}return t.set(e,o),o}function hKi(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e,s=[...n==="clippingAncestors"?Zwe(t)?[]:lKi(t,this._c):[].concat(n),o],a=v$n(t,s[0],r),{top:c,right:l,bottom:h,left:d}=a;for(let u=1;u<s.length;u++){let _=v$n(t,s[u],r);c=kT(_.top,c),l=cH(_.right,l),h=cH(_.bottom,h),d=kT(_.left,d)}return{width:l-d,height:h-c,x:d,y:c}}function dKi(e){let{width:t,height:n}=Nno(e);return{width:t,height:n}}function uKi(e,t,n){let o=dH(t),r=YT(t),i=n==="fixed",s=cU(e,!0,i,t),a={scrollLeft:0,scrollTop:0},c=LT(0);if(o||!i){if(Kte(t)!=="body"||Jwe(r))a=eBe(t);if(o){let u=cU(t,!0,i,t);c.x=u.x+t.clientLeft,c.y=u.y+t.clientTop}}if(!o&&r)c.x=tBe(r);let l=r&&!o&&!i?Qno(r,a):LT(0),h=s.left+a.scrollLeft-c.x-l.x,d=s.top+a.scrollTop-c.y-l.y;return{x:h,y:d,width:s.width,height:s.height}}function c0t(e){return bE(e).position==="static"}function S$n(e,t){if(!dH(e)||bE(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;if(YT(e)===n)n=n.ownerDocument.body;return n}function kno(e,t){let n=m4(e);if(Zwe(e))return n;if(!dH(e)){let r=aU(e);while(r&&!Rpe(r)){if(CE(r)&&!c0t(r))return r;r=aU(r)}return n}let o=S$n(e,t);while(o&&qji(o)&&c0t(o))o=S$n(o,t);if(o&&Rpe(o)&&c0t(o)&&!cmt(o))return n;return o||eKi(e)||n}var pKi=async function(e){let t=this.getOffsetParent||kno,n=this.getDimensions,o=await n(e.floating);return{reference:uKi(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function mKi(e){return bE(e).direction==="rtl"}var _Ki={convertOffsetParentRelativeRectToViewportRelativeRect:oKi,getDocumentElement:YT,getClippingRect:hKi,getOffsetParent:kno,getElementRects:pKi,getClientRects:rKi,getDimensions:dKi,getScale:Rte,isElement:CE,isRTL:mKi};function Lno(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function gKi(e,t,n){let o=null,r,i=YT(e);function s(){var h;clearTimeout(r),(h=o)==null||h.disconnect(),o=null}function a(h,d){if(h===void 0)h=!1;if(d===void 0)d=1;s();let u=e.getBoundingClientRect(),{left:_,top:p,width:m,height:A}=u;if(!h)t();if(!m||!A)return;let g=FMe(p),f=FMe(i.clientWidth-(_+m)),y=FMe(i.clientHeight-(p+A)),x=FMe(_),b={rootMargin:-g+"px "+-f+"px "+-y+"px "+-x+"px",threshold:kT(0,cH(1,d))||1},I=!0;function v(P){let M=P[0].intersectionRatio;if(!Lno(u,e.getBoundingClientRect()))return a();if(M!==d){if(!I)return a();if(!M)r=setTimeout(()=>{a(!1,0.0000001)},1000);else a(!1,M)}I=!1}try{o=new IntersectionObserver(v,{...b,root:i.ownerDocument})}catch(P){o=new IntersectionObserver(v,b)}o.observe(e)}let c=m4(e),l=()=>a(n);return c.addEventListener("resize",l),a(!0),()=>{c.removeEventListener("resize",l),s()}}function AKi(e,t,n,o){if(o===void 0)o={};let{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver==="function",layoutShift:a=typeof IntersectionObserver==="function",animationFrame:c=!1}=o,l=hmt(e),h=r||i?[...l?Qpe(l):[],...t?Qpe(t):[]]:[];h.forEach((g)=>{r&&g.addEventListener("scroll",n),i&&g.addEventListener("resize",n)});let d=l&&a?gKi(l,n,i):null,u=-1,_=null;if(s){if(_=new ResizeObserver((g)=>{let[f]=g;if(f&&f.target===l&&_&&t)_.unobserve(t),cancelAnimationFrame(u),u=requestAnimationFrame(()=>{var y;(y=_)==null||y.observe(t)});n()}),l&&!c)_.observe(l);if(t)_.observe(t)}let p,m=c?cU(e):null;if(c)A();function A(){let g=cU(e);if(m&&!Lno(m,g))n();m=g,p=requestAnimationFrame(A)}return n(),()=>{var g;if(h.forEach((f)=>{r&&f.removeEventListener("scroll",n),i&&f.removeEventListener("resize",n)}),d==null||d(),(g=_)==null||g.disconnect(),_=null,c)cancelAnimationFrame(p)}}var fKi=Xji,yKi=jji,xKi=Gji,CKi=$ji,bKi=Uji,P$n=Yji,IKi=Kji,vKi=(e,t,n)=>{let o=new Map,r=n!=null?n:{},i={..._Ki,...r.platform,_c:o};return Vji(e,t,{...r,platform:i})},SKi=typeof document<"u",PKi=function(){},twe=SKi?Hno.useLayoutEffect:PKi;function Cwe(e,t){if(e===t)return!0;if(typeof e!==typeof t)return!1;if(typeof e==="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e==="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!Cwe(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){let i=r[o];if(i==="_owner"&&e.$$typeof)continue;if(!Cwe(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function zno(e){if(typeof window>"u")return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function E$n(e,t){let n=zno(e);return Math.round(t*n)/n}function l0t(e){let t=og.useRef(e);return twe(()=>{t.current=e}),t}function EKi(e){if(e===void 0)e={};let{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:c,open:l}=e,[h,d]=og.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[u,_]=og.useState(o);if(!Cwe(u,o))_(o);let[p,m]=og.useState(null),[A,g]=og.useState(null),f=og.useCallback((O)=>{if(O!==b.current)b.current=O,m(O)},[]),y=og.useCallback((O)=>{if(O!==I.current)I.current=O,g(O)},[]),x=i||p,C=s||A,b=og.useRef(null),I=og.useRef(null),v=og.useRef(h),P=c!=null,M=l0t(c),B=l0t(r),T=l0t(l),N=og.useCallback(()=>{if(!b.current||!I.current)return;let O={placement:t,strategy:n,middleware:u};if(B.current)O.platform=B.current;vKi(b.current,I.current,O).then((U)=>{let j={...U,isPositioned:T.current!==!1};if(D.current&&!Cwe(v.current,j))v.current=j,Fno.flushSync(()=>{d(j)})})},[u,t,n,B,T]);twe(()=>{if(l===!1&&v.current.isPositioned)v.current.isPositioned=!1,d((O)=>({...O,isPositioned:!1}))},[l]);let D=og.useRef(!1);twe(()=>(D.current=!0,()=>{D.current=!1}),[]),twe(()=>{if(x)b.current=x;if(C)I.current=C;if(x&&C){if(M.current)return M.current(x,C,N);N()}},[x,C,N,M,P]);let L=og.useMemo(()=>({reference:b,floating:I,setReference:f,setFloating:y}),[f,y]),H=og.useMemo(()=>({reference:x,floating:C}),[x,C]),V=og.useMemo(()=>{let O={position:n,left:0,top:0};if(!H.floating)return O;let U=E$n(H.floating,h.x),j=E$n(H.floating,h.y);if(a)return{...O,transform:"translate("+U+"px, "+j+"px)",...zno(H.floating)>=1.5&&{willChange:"transform"}};return{position:n,left:U,top:j}},[n,a,H.floating,h.x,h.y]);return og.useMemo(()=>({...h,update:N,refs:L,elements:H,floatingStyles:V}),[h,N,L,H,V])}var MKi=(e)=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){let{element:o,padding:r}=typeof e==="function"?e(n):e;if(o&&t(o)){if(o.current!=null)return P$n({element:o.current,padding:r}).fn(n);return{}}if(o)return P$n({element:o,padding:r}).fn(n);return{}}}},wKi=(e,t)=>{let n=fKi(e);return{name:n.name,fn:n.fn,options:[e,t]}},BKi=(e,t)=>{let n=yKi(e);return{name:n.name,fn:n.fn,options:[e,t]}},TKi=(e,t)=>({fn:IKi(e).fn,options:[e,t]}),DKi=(e,t)=>{let n=xKi(e);return{name:n.name,fn:n.fn,options:[e,t]}},NKi=(e,t)=>{let n=CKi(e);return{name:n.name,fn:n.fn,options:[e,t]}},RKi=(e,t)=>{let n=bKi(e);return{name:n.name,fn:n.fn,options:[e,t]}},QKi=(e,t)=>{let n=MKi(e);return{name:n.name,fn:n.fn,options:[e,t]}},kKi=Object.defineProperty,LKi=(e,t)=>kKi(e,"name",{value:t,configurable:!0});function Vno(e){let[t,n]=Ono.useState(void 0);return dC(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let o=0,r=new ResizeObserver((i)=>{if(!Array.isArray(i))return;if(!i.length)return;let s=i[0];window.cancelAnimationFrame(o),o=window.requestAnimationFrame(()=>{let a,c;if("borderBoxSize"in s){let l=s.borderBoxSize,h=Array.isArray(l)?l[0]:l;a=h.inlineSize,c=h.blockSize}else a=e.offsetWidth,c=e.offsetHeight;n({width:a,height:c})})});return r.observe(e,{box:"border-box"}),()=>{window.cancelAnimationFrame(o),r.unobserve(e)}}else n(void 0)},[e]),t}LKi(Vno,"useSize");var HKi=Object.defineProperty,sH=(e,t)=>HKi(e,"name",{value:t,configurable:!0}),M$n={Partial:"partial",Always:"always"},w$n={Optimized:"optimized",Always:"always"},Yno="Popper",[Gno,Uno]=mU(Yno),[FKi,Wno]=Gno(Yno),Xno=sH((e)=>{let{__scopePopper:t,children:n}=e,[o,r]=U1.useState(null),[i,s]=U1.useState(void 0);return Qte.jsx(FKi,{scope:t,anchor:o,onAnchorChange:r,placementState:i,setPlacementState:s,children:n})},"Popper"),zKi="PopperAnchor",OKi=U1.forwardRef(sH(function(t,n){let{__scopePopper:o,virtualRef:r,...i}=t,s=Wno(zKi,o),a=U1.useRef(null),c=s.onAnchorChange,l=U1.useCallback((m)=>{if(a.current=m,m)c(m)},[c]),h=cA(n,l),d=U1.useRef(null);U1.useEffect(()=>{if(!r)return;let m=d.current;if(d.current=r.current,m!==d.current)c(d.current)});let u=s.placementState&&nBe(s.placementState),_=u?.[0],p=u?.[1];return r?null:Qte.jsx(SE.div,{"data-radix-popper-side":_,"data-radix-popper-align":p,...i,ref:h})},"PopperAnchor")),jno="PopperContent",[VKi,DEa]=Gno(jno),YKi=U1.forwardRef(sH(function(t,n){let{__scopePopper:o,side:r="bottom",sideOffset:i=0,align:s="center",alignOffset:a=0,arrowPadding:c=0,avoidCollisions:l=!0,collisionBoundary:h=[],collisionPadding:d=0,sticky:u=M$n.Partial,hideWhenDetached:_=!1,updatePositionStrategy:p=w$n.Optimized,onPlaced:m,...A}=t,g=Wno(jno,o),[f,y]=U1.useState(null),x=cA(n,y),[C,b]=U1.useState(null),I=Vno(C),v=I?.width??0,P=I?.height??0,M=r+(s!=="center"?"-"+s:""),B=typeof d==="number"?d:{top:0,right:0,bottom:0,left:0,...d},T=Array.isArray(h)?h:[h],N=T.length>0,D={padding:B,boundary:T.filter(Kno),altBoundary:N},{refs:L,floatingStyles:H,placement:V,isPositioned:O,middlewareData:U}=EKi({strategy:"fixed",placement:M,whileElementsMounted:sH((...Z)=>AKi(...Z,{animationFrame:p===w$n.Always}),"whileElementsMounted"),elements:{reference:g.anchor},middleware:[wKi({mainAxis:i+P,alignmentAxis:a}),l&&BKi({mainAxis:!0,crossAxis:!1,...u===M$n.Partial?{limiter:TKi()}:{},...D}),l&&DKi({...D}),NKi({...D,apply:sH(({elements:Z,rects:te,availableWidth:ie,availableHeight:le})=>{let{width:ue,height:de}=te.reference,me=Z.floating.style;me.setProperty("--radix-popper-available-width",`${ie}px`),me.setProperty("--radix-popper-available-height",`${le}px`),me.setProperty("--radix-popper-anchor-width",`${ue}px`),me.setProperty("--radix-popper-anchor-height",`${de}px`)},"apply")}),C&&QKi({element:C,padding:c}),GKi({arrowWidth:v,arrowHeight:P}),_&&RKi(N?{strategy:"referenceHidden",...D}:{strategy:"referenceHidden",padding:D.padding,altBoundary:D.altBoundary})]}),j=g.setPlacementState;dC(()=>(j(V),()=>{j(void 0)}),[V,j]);let[Y,X]=nBe(V),K=xE(m);dC(()=>{if(O)K?.()},[O,K]);let J=U.arrow?.x,ee=U.arrow?.y,se=U.arrow?.centerOffset!==0,[ne,re]=U1.useState();return dC(()=>{if(f)re(window.getComputedStyle(f).zIndex)},[f]),Qte.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:O?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ne,"--radix-popper-transform-origin":[U.transformOrigin?.x,U.transformOrigin?.y].join(" "),...U.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:Qte.jsx(VKi,{scope:o,placedSide:Y,placedAlign:X,onArrowChange:b,arrowX:J,arrowY:ee,shouldHideArrow:se,children:Qte.jsx(SE.div,{"data-side":Y,"data-align":X,...A,ref:x,style:{...A.style,animation:!O?"none":A.style?.animation}})})})},"PopperContent"));function Kno(e){return e!==null}sH(Kno,"isNotNull");var GKi=sH((e)=>({name:"transformOrigin",options:e,fn(t){let{placement:n,rects:o,middlewareData:r}=t,s=r.arrow?.centerOffset!==0,a=s?0:e.arrowWidth,c=s?0:e.arrowHeight,[l,h]=nBe(n),d={start:"0%",center:"50%",end:"100%"}[h],u=(r.arrow?.x??0)+a/2,_=(r.arrow?.y??0)+c/2,p="",m="";if(l==="bottom")p=s?d:`${u}px`,m=`${-c}px`;else if(l==="top")p=s?d:`${u}px`,m=`${o.floating.height+c}px`;else if(l==="right")p=`${-c}px`,m=s?d:`${_}px`;else if(l==="left")p=`${o.floating.width+c}px`,m=s?d:`${_}px`;return{data:{x:p,y:m}}}}),"transformOrigin");function nBe(e){let[t,n="center"]=e.split("-");return[t,n]}sH(nBe,"getSideAndAlignFromPlacement");var UKi=Object.defineProperty,WKi=(e,t)=>UKi(e,"name",{value:t,configurable:!0}),XKi=oBe.forwardRef(WKi(function(t,n){let{container:o,...r}=t,[i,s]=oBe.useState(!1);dC(()=>s(!0),[]);let a=o||i&&globalThis?.document?.body;return a?$no.createPortal(qno.jsx(SE.div,{...r,ref:n}),a):null},"Portal")),jKi=Object.defineProperty,FT=(e,t)=>jKi(e,"name",{value:t,configurable:!0});function Zno(e,t){return Jno.useReducer((n,o)=>t[n][o]??n,e)}FT(Zno,"useStateMachine");var dmt=FT((e)=>{let{present:t,children:n}=e,o=eoo(t),r=typeof n==="function"?n({present:o.isPresent}):v2.Children.only(n),i=too(o.ref,noo(r));return typeof n==="function"||o.isPresent?v2.cloneElement(r,{ref:i}):null},"Presence");function eoo(e){let[t,n]=v2.useState(),o=v2.useRef(null),r=v2.useRef(e),i=v2.useRef("none"),s=v2.useRef(void 0),a=e?"mounted":"unmounted",[c,l]=Zno(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v2.useEffect(()=>{if(c==="mounted")i.current=s.current??Bte(o.current),s.current=void 0;else i.current="none"},[c]),dC(()=>{let h=o.current,d=r.current;if(d!==e){let _=i.current,p=Bte(h);if(e)s.current=p,l("MOUNT");else if(p==="none"||h?.display==="none")l("UNMOUNT");else if(d&&_!==p)l("ANIMATION_OUT");else l("UNMOUNT");r.current=e}},[e,l]),dC(()=>{if(t){let h,d=t.ownerDocument.defaultView??window,u=FT((p)=>{let A=Bte(o.current).includes(CSS.escape(p.animationName));if(p.target===t&&A){if(l("ANIMATION_END"),!r.current){let g=t.style.animationFillMode;t.style.animationFillMode="forwards",h=d.setTimeout(()=>{if(t.style.animationFillMode==="forwards")t.style.animationFillMode=g})}}},"handleAnimationEnd"),_=FT((p)=>{if(p.target===t)i.current=Bte(o.current)},"handleAnimationStart");return t.addEventListener("animationstart",_),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{d.clearTimeout(h),t.removeEventListener("animationstart",_),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:v2.useCallback((h)=>{if(h){let d=getComputedStyle(h);o.current=d,s.current=Bte(d)}else o.current=null;n(h)},[])}}FT(eoo,"usePresence");function V0t(e,t){if(typeof e==="function")return e(t);else if(e!==null&&e!==void 0)e.current=t}FT(V0t,"setRef");function too(...e){let t=v2.useRef(e);return t.current=e,v2.useCallback((n)=>{let o=t.current,r=!1,i=o.map((s)=>{let a=V0t(s,n);if(!r&&typeof a==="function")r=!0;return a});if(r)return()=>{for(let s=0;s<i.length;s++){let a=i[s];if(typeof a==="function")a();else V0t(o[s],null)}}},[])}FT(too,"useStableComposedRefs");function Bte(e){return e?.animationName||"none"}FT(Bte,"getAnimationName");function noo(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}FT(noo,"getElementRef");var $Ki=Object.defineProperty,umt=(e,t)=>$Ki(e,"name",{value:t,configurable:!0}),h0t=!1;function ooo(){let[e,t]=rBe.useState(h0t);return rBe.useEffect(()=>{if(!h0t)h0t=!0,t(!0)},[]),e}umt(ooo,"useIsHydrated");var roo=KKi[" useSyncExternalStore ".trim().toString()];function ioo(){return()=>{}}umt(ioo,"subscribe");function soo(){return roo(ioo,()=>!0,()=>!1)}umt(soo,"useIsHydratedModern");var qKi=typeof roo==="function"?soo:ooo,JKi=Object.defineProperty,_U=(e,t)=>JKi(e,"name",{value:t,configurable:!0}),d0t="rovingFocusGroup.onEntryFocus",ZKi={bubbles:!1,cancelable:!0},iBe="RovingFocusGroup",[Y0t,aoo,e$i]=$pt(iBe),[t$i,coo]=mU(iBe,[e$i]),B$n={Vertical:"vertical",Horizontal:"horizontal"},n$i={LTR:"ltr",RTL:"rtl"},[o$i,r$i]=t$i(iBe),i$i=ff.forwardRef(_U(function(t,n){return aH.jsx(Y0t.Provider,{scope:t.__scopeRovingFocusGroup,children:aH.jsx(Y0t.Slot,{scope:t.__scopeRovingFocusGroup,children:aH.jsx(s$i,{...t,ref:n})})})},"RovingFocusGroup")),s$i=ff.forwardRef(_U(function(t,n){let{__scopeRovingFocusGroup:o,orientation:r,loop:i=!1,dir:s,currentTabStopId:a,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:l,onEntryFocus:h,preventScrollOnEntryFocus:d=!1,...u}=t,_=ff.useRef(null),p=cA(n,_),m=Jpt(s),[A,g]=Kwe({prop:a,defaultProp:c??null,onChange:l,caller:iBe}),[f,y]=ff.useState(!1),x=xE(h),C=aoo(o),b=ff.useRef(!1),[I,v]=ff.useState(0);return ff.useEffect(()=>{let P=_.current;if(P)return P.addEventListener(d0t,x),()=>P.removeEventListener(d0t,x)},[x]),aH.jsx(o$i,{scope:o,orientation:r,dir:m,loop:i,currentTabStopId:A,onItemFocus:ff.useCallback((P)=>g(P),[g]),onItemShiftTab:ff.useCallback(()=>y(!0),[]),onFocusableItemAdd:ff.useCallback(()=>v((P)=>P+1),[]),onFocusableItemRemove:ff.useCallback(()=>v((P)=>P-1),[]),children:aH.jsx(SE.div,{tabIndex:f||I===0?-1:0,"data-orientation":r,...u,ref:p,style:{outline:"none",...t.style},onMouseDown:Rl(t.onMouseDown,()=>{b.current=!0}),onFocus:Rl(t.onFocus,(P)=>{let M=!b.current;if(P.target===P.currentTarget&&M&&!f){let B=new CustomEvent(d0t,ZKi);if(P.currentTarget.dispatchEvent(B),!B.defaultPrevented){let T=C().filter((V)=>V.focusable),N=T.find((V)=>V.active),D=T.find((V)=>V.id===A),H=[N,D,...T].filter(Boolean).map((V)=>V.ref.current);pmt(H,d)}}b.current=!1}),onBlur:Rl(t.onBlur,()=>y(!1))})})},"RovingFocusGroupImpl")),a$i="RovingFocusGroupItem",c$i=ff.forwardRef(_U(function(t,n){let{__scopeRovingFocusGroup:o,focusable:r=!0,active:i=!1,tabStopId:s,children:a,...c}=t,l=Lte(),h=s||l,d=r$i(a$i,o),u=d.currentTabStopId===h,_=aoo(o),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:A}=d,g=qKi();return dC(()=>{if(!g||!r)return;return p(),()=>m()},[g,r,p,m]),ff.useEffect(()=>{if(g||!r)return;return p(),()=>m()},[g,r,p,m]),aH.jsx(Y0t.ItemSlot,{scope:o,id:h,focusable:r,active:i,children:aH.jsx(SE.span,{tabIndex:u?0:-1,"data-orientation":d.orientation,...c,ref:n,onMouseDown:Rl(t.onMouseDown,(f)=>{if(!r)f.preventDefault();else d.onItemFocus(h)}),onFocus:Rl(t.onFocus,()=>d.onItemFocus(h)),onKeyDown:Rl(t.onKeyDown,(f)=>{if(f.key==="Tab"&&f.shiftKey){d.onItemShiftTab();return}if(f.target!==f.currentTarget)return;let y=hoo(f,d.orientation,d.dir);if(y!==void 0){if(f.metaKey||f.ctrlKey||f.altKey||f.shiftKey)return;f.preventDefault();let C=_().filter((b)=>b.focusable).map((b)=>b.ref.current);if(y==="last")C.reverse();else if(y==="prev"||y==="next"){if(y==="prev")C.reverse();let b=C.indexOf(f.currentTarget);C=d.loop?doo(C,b+1):C.slice(b+1)}setTimeout(()=>pmt(C))}}),children:typeof a==="function"?a({isCurrentTabStop:u,hasTabStop:A!=null}):a})})},"RovingFocusGroupItem")),l$i={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function loo(e,t){if(t!==n$i.RTL)return e;return e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}_U(loo,"getDirectionAwareKey");function hoo(e,t,n){let o=loo(e.key,n);if(t===B$n.Vertical&&["ArrowLeft","ArrowRight"].includes(o))return;if(t===B$n.Horizontal&&["ArrowUp","ArrowDown"].includes(o))return;return l$i[o]}_U(hoo,"getFocusIntent");function pmt(e,t=!1){let n=document.activeElement;for(let o of e){if(o===n)return;if(o.focus({preventScroll:t}),document.activeElement!==n)return}}_U(pmt,"focusFirst");function doo(e,t){return e.map((n,o)=>e[(t+o)%e.length])}_U(doo,"wrapArray");var h$i=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},vte=new WeakMap,zMe=new WeakMap,OMe={},u0t=0,uoo=function(e){return e&&(e.host||uoo(e.parentNode))},d$i=function(e,t){return t.map(function(n){if(e.contains(n))return n;var o=uoo(n);if(o&&e.contains(o))return o;return console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null}).filter(function(n){return Boolean(n)})},u$i=function(e,t,n,o){var r=d$i(t,Array.isArray(e)?e:[e]);if(!OMe[n])OMe[n]=new WeakMap;var i=OMe[n],s=[],a=new Set,c=new Set(r),l=function(d){if(!d||a.has(d))return;a.add(d),l(d.parentNode)};r.forEach(l);var h=function(d){if(!d||c.has(d))return;Array.prototype.forEach.call(d.children,function(u){if(a.has(u))h(u);else try{var _=u.getAttribute(o),p=_!==null&&_!=="false",m=(vte.get(u)||0)+1,A=(i.get(u)||0)+1;if(vte.set(u,m),i.set(u,A),s.push(u),m===1&&p)zMe.set(u,!0);if(A===1)u.setAttribute(n,"true");if(!p)u.setAttribute(o,"true")}catch(g){console.error("aria-hidden: cannot operate on ",u,g)}})};return h(t),a.clear(),u0t++,function(){if(s.forEach(function(d){var u=vte.get(d)-1,_=i.get(d)-1;if(vte.set(d,u),i.set(d,_),!u){if(!zMe.has(d))d.removeAttribute(o);zMe.delete(d)}if(!_)d.removeAttribute(n)}),u0t--,!u0t)vte=new WeakMap,vte=new WeakMap,zMe=new WeakMap,OMe={}}},p$i=function(e,t,n){if(n===void 0)n="data-aria-hidden";var o=Array.from(Array.isArray(e)?e:[e]),r=t||h$i(e);if(!r)return function(){return null};return o.push.apply(o,Array.from(r.querySelectorAll("[aria-live], script"))),u$i(o,r,n,"aria-hidden")},_E=function(){return _E=Object.assign||function(t){for(var n,o=1,r=arguments.length;o<r;o++){n=arguments[o];for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i))t[i]=n[i]}return t},_E.apply(this,arguments)};function poo(e,t){var n={};for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0)n[o]=e[o];if(e!=null&&typeof Object.getOwnPropertySymbols==="function"){for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)if(t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r]))n[o[r]]=e[o[r]]}return n}function m$i(e,t,n){if(n||arguments.length===2){for(var o=0,r=t.length,i;o<r;o++)if(i||!(o in t)){if(!i)i=Array.prototype.slice.call(t,0,o);i[o]=t[o]}}return e.concat(i||Array.prototype.slice.call(t))}var nwe="right-scroll-bar-position",owe="width-before-scroll-bar",_$i="with-scroll-bars-hidden",g$i="--removed-body-scroll-bar-size";function p0t(e,t){if(typeof e==="function")e(t);else if(e)e.current=t;return e}function A$i(e,t){var n=moo.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(o){var r=n.value;if(r!==o)n.value=o,n.callback(o,r)}}}})[0];return n.callback=t,n.facade}var f$i=typeof window<"u"?aBe.useLayoutEffect:aBe.useEffect,T$n=new WeakMap;function y$i(e,t){var n=A$i(t||null,function(o){return e.forEach(function(r){return p0t(r,o)})});return f$i(function(){var o=T$n.get(n);if(o){var r=new Set(o),i=new Set(e),s=n.current;r.forEach(function(a){if(!i.has(a))p0t(a,null)}),i.forEach(function(a){if(!r.has(a))p0t(a,s)})}T$n.set(n,e)},[e]),n}function x$i(e){return e}function C$i(e,t){if(t===void 0)t=x$i;var n=[],o=!1,r={read:function(){if(o)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");if(n.length)return n[n.length-1];return e},useMedium:function(i){var s=t(i,o);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(i){o=!0;while(n.length){var s=n;n=[],s.forEach(i)}n={push:function(a){return i(a)},filter:function(){return n}}},assignMedium:function(i){o=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(i),s=n}var c=function(){var h=s;s=[],h.forEach(i)},l=function(){return Promise.resolve().then(c)};l(),n={push:function(h){s.push(h),l()},filter:function(h){return s=s.filter(h),n}}}};return r}function b$i(e){if(e===void 0)e={};var t=C$i(null);return t.options=_E({async:!0,ssr:!1},e),t}var goo=function(e){var t=e.sideCar,n=poo(e,["sideCar"]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var o=t.read();if(!o)throw Error("Sidecar medium not found");return _oo.createElement(o,_E({},n))};goo.isSideCarExport=!0;function I$i(e,t){return e.useMedium(t),goo}var Aoo=b$i(),m0t=function(){return},cBe=W1.forwardRef(function(e,t){var n=W1.useRef(null),o=W1.useState({onScrollCapture:m0t,onWheelCapture:m0t,onTouchMoveCapture:m0t}),r=o[0],i=o[1],{forwardProps:s,children:a,className:c,removeScrollBar:l,enabled:h,shards:d,sideCar:u,noRelative:_,noIsolation:p,inert:m,allowPinchZoom:A,as:g}=e,f=g===void 0?"div":g,y=e.gapMode,x=poo(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=u,b=y$i([n,t]),I=_E(_E({},x),r);return W1.createElement(W1.Fragment,null,h&&W1.createElement(C,{sideCar:Aoo,removeScrollBar:l,shards:d,noRelative:_,noIsolation:p,inert:m,setCallbacks:i,allowPinchZoom:!!A,lockRef:n,gapMode:y}),s?W1.cloneElement(W1.Children.only(a),_E(_E({},I),{ref:b})):W1.createElement(f,_E({},I,{className:c,ref:b}),a))});cBe.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};cBe.classNames={fullWidth:owe,zeroRight:nwe};var D$n,v$i=function(){if(D$n)return D$n;if(typeof __webpack_nonce__<"u")return __webpack_nonce__;return};function S$i(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=v$i();if(t)e.setAttribute("nonce",t);return e}function P$i(e,t){if(e.styleSheet)e.styleSheet.cssText=t;else e.appendChild(document.createTextNode(t))}function E$i(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var M$i=function(){var e=0,t=null;return{add:function(n){if(e==0){if(t=S$i())P$i(t,n),E$i(t)}e++},remove:function(){if(e--,!e&&t)t.parentNode&&t.parentNode.removeChild(t),t=null}}},w$i=function(){var e=M$i();return function(t,n){foo.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},yoo=function(){var e=w$i(),t=function(n){var{styles:o,dynamic:r}=n;return e(o,r),null};return t},B$i={left:0,top:0,right:0,gap:0},_0t=function(e){return parseInt(e||"",10)||0},T$i=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],o=t[e==="padding"?"paddingTop":"marginTop"],r=t[e==="padding"?"paddingRight":"marginRight"];return[_0t(n),_0t(o),_0t(r)]},D$i=function(e){if(e===void 0)e="margin";if(typeof window>"u")return B$i;var t=T$i(e),n=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-n+t[2]-t[0])}},N$i=yoo(),kte="data-scroll-locked",R$i=function(e,t,n,o){var{left:r,top:i,right:s,gap:a}=e;if(n===void 0)n="margin";return`
  .`.concat(_$i,` {
   overflow: hidden `).concat(o,`;
   padding-right: `).concat(a,"px ").concat(o,`;
  }
  body[`).concat(kte,`] {
    overflow: hidden `).concat(o,`;
    overscroll-behavior: contain;
    `).concat([t&&"position: relative ".concat(o,";"),n==="margin"&&`
    padding-left: `.concat(r,`px;
    padding-top: `).concat(i,`px;
    padding-right: `).concat(s,`px;
    margin-left:0;
    margin-top:0;
    margin-right: `).concat(a,"px ").concat(o,`;
    `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(o,";")].filter(Boolean).join(""),`
  }
  
  .`).concat(nwe,` {
    right: `).concat(a,"px ").concat(o,`;
  }
  
  .`).concat(owe,` {
    margin-right: `).concat(a,"px ").concat(o,`;
  }
  
  .`).concat(nwe," .").concat(nwe,` {
    right: 0 `).concat(o,`;
  }
  
  .`).concat(owe," .").concat(owe,` {
    margin-right: 0 `).concat(o,`;
  }
  
  body[`).concat(kte,`] {
    `).concat(g$i,": ").concat(a,`px;
  }
`)},N$n=function(){var e=parseInt(document.body.getAttribute(kte)||"0",10);return isFinite(e)?e:0},Q$i=function(){$te.useEffect(function(){return document.body.setAttribute(kte,(N$n()+1).toString()),function(){var e=N$n()-1;if(e<=0)document.body.removeAttribute(kte);else document.body.setAttribute(kte,e.toString())}},[])},k$i=function(e){var{noRelative:t,noImportant:n,gapMode:o}=e,r=o===void 0?"margin":o;Q$i();var i=$te.useMemo(function(){return D$i(r)},[r]);return $te.createElement(N$i,{styles:R$i(i,!t,r,!n?"!important":"")})},G0t=!1;if(typeof window<"u")try{Cpe=Object.defineProperty({},"passive",{get:function(){return G0t=!0,!0}}),window.addEventListener("test",Cpe,Cpe),window.removeEventListener("test",Cpe,Cpe)}catch(e){G0t=!1}var Cpe,Ste=G0t?{passive:!1}:!1,L$i=function(e){return e.tagName==="TEXTAREA"},xoo=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!L$i(e)&&n[t]==="visible")},H$i=function(e){return xoo(e,"overflowY")},F$i=function(e){return xoo(e,"overflowX")},R$n=function(e,t){var n=t.ownerDocument,o=t;do{if(typeof ShadowRoot<"u"&&o instanceof ShadowRoot)o=o.host;var r=Coo(e,o);if(r){var i=boo(e,o),s=i[1],a=i[2];if(s>a)return!0}o=o.parentNode}while(o&&o!==n.body);return!1},z$i=function(e){var{scrollTop:t,scrollHeight:n,clientHeight:o}=e;return[t,n,o]},O$i=function(e){var{scrollLeft:t,scrollWidth:n,clientWidth:o}=e;return[t,n,o]},Coo=function(e,t){return e==="v"?H$i(t):F$i(t)},boo=function(e,t){return e==="v"?z$i(t):O$i(t)},V$i=function(e,t){return e==="h"&&t==="rtl"?-1:1},Y$i=function(e,t,n,o,r){var i=V$i(e,window.getComputedStyle(t).direction),s=i*o,a=n.target,c=t.contains(a),l=!1,h=s>0,d=0,u=0;do{if(!a)break;var _=boo(e,a),p=_[0],m=_[1],A=_[2],g=m-A-i*p;if(p||g){if(Coo(e,a))d+=g,u+=p}var f=a.parentNode;a=f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE?f.host:f}while(!c&&a!==document.body||c&&(t.contains(a)||t===a));if(h&&(r&&Math.abs(d)<1||!r&&s>d))l=!0;else if(!h&&(r&&Math.abs(u)<1||!r&&-s>u))l=!0;return l},VMe=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Q$n=function(e){return[e.deltaX,e.deltaY]},k$n=function(e){return e&&"current"in e?e.current:e},G$i=function(e,t){return e[0]===t[0]&&e[1]===t[1]},U$i=function(e){return`
  .block-interactivity-`.concat(e,` {pointer-events: none;}
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},W$i=0,Pte=[];function X$i(e){var t=D0.useRef([]),n=D0.useRef([0,0]),o=D0.useRef(),r=D0.useState(W$i++)[0],i=D0.useState(yoo)[0],s=D0.useRef(e);D0.useEffect(function(){s.current=e},[e]),D0.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var m=m$i([e.lockRef.current],(e.shards||[]).map(k$n),!0).filter(Boolean);return m.forEach(function(A){return A.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),m.forEach(function(A){return A.classList.remove("allow-interactivity-".concat(r))})}}return},[e.inert,e.lockRef.current,e.shards]);var a=D0.useCallback(function(m,A){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!s.current.allowPinchZoom;var g=VMe(m),f=n.current,y="deltaX"in m?m.deltaX:f[0]-g[0],x="deltaY"in m?m.deltaY:f[1]-g[1],C,b=m.target,I=Math.abs(y)>Math.abs(x)?"h":"v";if("touches"in m&&I==="h"&&b.type==="range")return!1;var v=window.getSelection(),P=v&&v.anchorNode,M=P?P===b||P.contains(b):!1;if(M)return!1;var B=R$n(I,b);if(!B)return!0;if(B)C=I;else C=I==="v"?"h":"v",B=R$n(I,b);if(!B)return!1;if(!o.current&&"changedTouches"in m&&(y||x))o.current=C;if(!C)return!0;var T=o.current||C;return Y$i(T,A,m,T==="h"?y:x,!0)},[]),c=D0.useCallback(function(m){var A=m;if(!Pte.length||Pte[Pte.length-1]!==i)return;var g="deltaY"in A?Q$n(A):VMe(A),f=t.current.filter(function(C){return C.name===A.type&&(C.target===A.target||A.target===C.shadowParent)&&G$i(C.delta,g)})[0];if(f&&f.should){if(A.cancelable)A.preventDefault();return}if(!f){var y=(s.current.shards||[]).map(k$n).filter(Boolean).filter(function(C){return C.contains(A.target)}),x=y.length>0?a(A,y[0]):!s.current.noIsolation;if(x){if(A.cancelable)A.preventDefault()}}},[]),l=D0.useCallback(function(m,A,g,f){var y={name:m,delta:A,target:g,should:f,shadowParent:j$i(g)};t.current.push(y),setTimeout(function(){t.current=t.current.filter(function(x){return x!==y})},1)},[]),h=D0.useCallback(function(m){n.current=VMe(m),o.current=void 0},[]),d=D0.useCallback(function(m){l(m.type,Q$n(m),m.target,a(m,e.lockRef.current))},[]),u=D0.useCallback(function(m){l(m.type,VMe(m),m.target,a(m,e.lockRef.current))},[]);D0.useEffect(function(){return Pte.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:u}),document.addEventListener("wheel",c,Ste),document.addEventListener("touchmove",c,Ste),document.addEventListener("touchstart",h,Ste),function(){Pte=Pte.filter(function(m){return m!==i}),document.removeEventListener("wheel",c,Ste),document.removeEventListener("touchmove",c,Ste),document.removeEventListener("touchstart",h,Ste)}},[]);var{removeScrollBar:_,inert:p}=e;return D0.createElement(D0.Fragment,null,p?D0.createElement(i,{styles:U$i(r)}):null,_?D0.createElement(k$i,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function j$i(e){var t=null;while(e!==null){if(e instanceof ShadowRoot)t=e.host,e=e.host;e=e.parentNode}return t}var K$i=I$i(Aoo,X$i),Ioo=sBe.forwardRef(function(e,t){return sBe.createElement(cBe,_E({},e,{ref:t,sideCar:K$i}))});Ioo.classNames=cBe.classNames;var $$i=Ioo,q$i=Object.defineProperty,jh=(e,t)=>q$i(e,"name",{value:t,configurable:!0}),J$i={LTR:"ltr",RTL:"rtl"},U0t=["Enter"," "],Z$i=["ArrowDown","PageUp","Home"],voo=["ArrowUp","PageDown","End"],eqi=[...Z$i,...voo],tqi={ltr:[...U0t,"ArrowRight"],rtl:[...U0t,"ArrowLeft"]},nqi={ltr:["ArrowLeft"],rtl:["ArrowRight"]},lBe="Menu",[kpe,oqi,rqi]=$pt(lBe),[gU,Soo]=mU(lBe,[rqi,Uno,coo]),hBe=Uno(),Poo=coo(),[Eoo,uH]=gU(lBe),[iqi,tme]=gU(lBe),sqi=jh((e)=>{let{__scopeMenu:t,open:n=!1,children:o,dir:r,onOpenChange:i,modal:s=!0}=e,a=hBe(t),[c,l]=Oi.useState(null),h=Oi.useRef(!1),d=xE(i),u=Jpt(r);return Oi.useEffect(()=>{let _=jh(()=>{h.current=!0,document.addEventListener("pointerdown",p,{capture:!0,once:!0}),document.addEventListener("pointermove",p,{capture:!0,once:!0})},"handleKeyDown"),p=jh(()=>h.current=!1,"handlePointer");return document.addEventListener("keydown",_,{capture:!0}),()=>{document.removeEventListener("keydown",_,{capture:!0}),document.removeEventListener("pointerdown",p,{capture:!0}),document.removeEventListener("pointermove",p,{capture:!0})}},[]),Oi.useEffect(()=>{if(!n)return;let _=jh(()=>d(!1),"handleBlur");return window.addEventListener("blur",_),()=>window.removeEventListener("blur",_)},[n,d]),kc.jsx(Xno,{...a,children:kc.jsx(Eoo,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:kc.jsx(iqi,{scope:t,onClose:Oi.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:h,dir:u,modal:s,children:o})})})},"Menu"),Moo=Oi.forwardRef(jh(function(t,n){let{__scopeMenu:o,...r}=t,i=hBe(o);return kc.jsx(OKi,{...i,...r,ref:n})},"MenuAnchor")),woo="MenuPortal",[aqi,Boo]=gU(woo,{forceMount:void 0}),cqi=jh((e)=>{let{__scopeMenu:t,forceMount:n,children:o,container:r}=e,i=uH(woo,t);return kc.jsx(aqi,{scope:t,forceMount:n,children:kc.jsx(dmt,{present:n||i.open,children:kc.jsx(XKi,{asChild:!0,container:r,children:o})})})},"MenuPortal"),jv="MenuContent",[lqi,mmt]=gU(jv),hqi=Oi.forwardRef(jh(function(t,n){let o=Boo(jv,t.__scopeMenu),{forceMount:r=o.forceMount,...i}=t,s=uH(jv,t.__scopeMenu),a=tme(jv,t.__scopeMenu);return kc.jsx(kpe.Provider,{scope:t.__scopeMenu,children:kc.jsx(dmt,{present:r||s.open,children:kc.jsx(kpe.Slot,{scope:t.__scopeMenu,children:a.modal?kc.jsx(dqi,{...i,ref:n}):kc.jsx(uqi,{...i,ref:n})})})})},"MenuContent")),dqi=Oi.forwardRef(jh(function(t,n){let o=uH(jv,t.__scopeMenu),r=Oi.useRef(null),i=cA(n,r);return Oi.useEffect(()=>{let s=r.current;if(s)return p$i(s)},[]),kc.jsx(_mt,{...t,ref:i,trapFocus:o.open,disableOutsidePointerEvents:o.open,disableOutsideScroll:!0,onFocusOutside:Rl(t.onFocusOutside,(s)=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>o.onOpenChange(!1)})},"MenuRootContentModal")),uqi=Oi.forwardRef(jh(function(t,n){let o=uH(jv,t.__scopeMenu);return kc.jsx(_mt,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>o.onOpenChange(!1)})},"MenuRootContentNonModal")),pqi=sU("MenuContent.ScrollLock"),_mt=Oi.forwardRef(jh(function(t,n){let{__scopeMenu:o,loop:r=!1,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:c,onEntryFocus:l,onEscapeKeyDown:h,onPointerDownOutside:d,onFocusOutside:u,onInteractOutside:_,onDismiss:p,disableOutsideScroll:m,...A}=t,g=uH(jv,o),f=tme(jv,o),y=hBe(o),x=Poo(o),C=oqi(o),[b,I]=Oi.useState(null),v=Oi.useRef(null),[P,M]=Oi.useState(null);Cno(P);let{nodes:B,registry:T}=xno(),N=Boolean(i||m),D=cA(n,v,g.onContentChange,M),L=Oi.useRef(0),H=Oi.useRef(""),V=Oi.useRef(0),O=Oi.useRef(null),U=Oi.useRef("right"),j=Oi.useRef(0),Y=Oi.useMemo(()=>m?[v,...B.map((se)=>({current:se}))]:[],[v,B,m]),X=m?$$i:Oi.Fragment,K=m?{as:pqi,allowPinchZoom:!0,shards:Y}:void 0,J=jh((se)=>{let ne=H.current+se,re=C().filter((me)=>!me.disabled),Z=document.activeElement,te=re.find((me)=>me.ref.current===Z)?.textValue,ie=re.map((me)=>me.textValue),le=Hoo(ie,ne,te),ue=re.find((me)=>me.textValue===le)?.ref.current;function de(me){if(H.current=me,window.clearTimeout(L.current),me!=="")L.current=window.setTimeout(()=>de(""),1000)}if(jh(de,"updateSearch"),de(ne),ue)setTimeout(()=>ue.focus())},"handleTypeaheadSearch");Oi.useEffect(()=>()=>window.clearTimeout(L.current),[]),tmt();let ee=Oi.useCallback((se)=>U.current===O.current?.side&&zoo(se,O.current?.area),[]);return kc.jsx(lqi,{scope:o,searchRef:H,onItemEnter:Oi.useCallback((se)=>{if(ee(se))se.preventDefault()},[ee]),onItemLeave:Oi.useCallback((se)=>{if(ee(se))return;v.current?.focus(),I(null)},[ee]),onTriggerLeave:Oi.useCallback((se)=>{if(ee(se))se.preventDefault()},[ee]),pointerGraceTimerRef:V,onPointerGraceIntentChange:Oi.useCallback((se)=>{O.current=se},[]),children:kc.jsx(yno,{registry:N?T:null,children:kc.jsx(X,{...K,children:kc.jsx(Pji,{asChild:!0,trapped:i,branches:B,onMountAutoFocus:Rl(s,(se)=>{se.preventDefault(),v.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:kc.jsx(xji,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:h,onPointerDownOutside:d,onFocusOutside:u,onInteractOutside:_,onDismiss:p,children:kc.jsx(i$i,{asChild:!0,...x,dir:f.dir,orientation:"vertical",loop:r,currentTabStopId:b,onCurrentTabStopIdChange:I,onEntryFocus:Rl(l,(se)=>{if(!f.isUsingKeyboardRef.current)se.preventDefault()}),preventScrollOnEntryFocus:!0,children:kc.jsx(YKi,{role:"menu","aria-orientation":"vertical","data-state":gmt(g.open),"data-radix-menu-content":"",dir:f.dir,...y,...A,ref:D,style:{outline:"none",...A.style},onKeyDown:Rl(A.onKeyDown,(se)=>{let re=se.target.closest("[data-radix-menu-content]")===se.currentTarget,Z=se.ctrlKey||se.altKey||se.metaKey,te=se.key.length===1;if(re){if(se.key==="Tab")se.preventDefault();if(!Z&&te)J(se.key)}let ie=v.current;if(se.target!==ie)return;if(!eqi.includes(se.key))return;se.preventDefault();let ue=C().filter((de)=>!de.disabled).map((de)=>de.ref.current);if(voo.includes(se.key))ue.reverse();koo(ue)}),onBlur:Rl(t.onBlur,(se)=>{if(!se.currentTarget.contains(se.target))window.clearTimeout(L.current),H.current=""}),onPointerMove:Rl(t.onPointerMove,Hte((se)=>{let ne=se.target,re=j.current!==se.clientX;if(se.currentTarget.contains(ne)&&re){let Z=se.clientX>j.current?"right":"left";U.current=Z,j.current=se.clientX}}))})})})})})})})},"MenuContentImpl")),W0t="MenuItem",L$n="menu.itemSelect",Too=Oi.forwardRef(jh(function(t,n){let{disabled:o=!1,onSelect:r,...i}=t,s=Oi.useRef(null),a=tme(W0t,t.__scopeMenu),c=mmt(W0t,t.__scopeMenu),l=cA(n,s),h=Oi.useRef(!1),d=jh(()=>{let u=s.current;if(!o&&u){let _=new CustomEvent(L$n,{bubbles:!0,cancelable:!0});if(u.addEventListener(L$n,(p)=>r?.(p),{once:!0}),Kpt(u,_),_.defaultPrevented)h.current=!1;else a.onClose()}},"handleSelect");return kc.jsx(Doo,{...i,ref:l,disabled:o,onClick:Rl(t.onClick,d),onPointerDown:(u)=>{t.onPointerDown?.(u),h.current=!0},onPointerUp:Rl(t.onPointerUp,(u)=>{if(!h.current)u.currentTarget?.click()}),onKeyDown:Rl(t.onKeyDown,(u)=>{if(o||u.target!==u.currentTarget)return;if(c.searchRef.current!==""&&u.key===" ")return;if(U0t.includes(u.key))u.currentTarget.click(),u.preventDefault()})})},"MenuItem")),Doo=Oi.forwardRef(jh(function(t,n){let{__scopeMenu:o,disabled:r=!1,textValue:i,...s}=t,a=mmt(W0t,o),c=Poo(o),l=Oi.useRef(null),h=cA(n,l),[d,u]=Oi.useState(!1),[_,p]=Oi.useState("");return Oi.useEffect(()=>{let m=l.current;if(m)p((m.textContent??"").trim())},[s.children]),kc.jsx(kpe.ItemSlot,{scope:o,disabled:r,textValue:i??_,children:kc.jsx(c$i,{asChild:!0,...c,focusable:!r,children:kc.jsx(SE.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:h,onPointerMove:Rl(t.onPointerMove,Hte((m)=>{if(r)a.onItemLeave(m);else if(a.onItemEnter(m),!m.defaultPrevented)m.currentTarget.focus({preventScroll:!0})})),onPointerLeave:Rl(t.onPointerLeave,Hte((m)=>a.onItemLeave(m))),onFocus:Rl(t.onFocus,()=>u(!0)),onBlur:Rl(t.onBlur,()=>u(!1))})})})},"MenuItemImpl")),mqi=Oi.forwardRef(jh(function(t,n){let{checked:o=!1,onCheckedChange:r,...i}=t;return kc.jsx(Aqi,{scope:t.__scopeMenu,checked:o,children:kc.jsx(Too,{role:"menuitemcheckbox","aria-checked":bwe(o)?"mixed":o,...i,ref:n,"data-state":Qoo(o),onSelect:Rl(i.onSelect,()=>r?.(bwe(o)?!0:!o),{checkForDefaultPrevented:!1})})})},"MenuCheckboxItem")),_qi="MenuRadioGroup",[NEa,REa]=gU(_qi,{value:void 0,onValueChange:jh(()=>{},"onValueChange")}),gqi="MenuItemIndicator",[Aqi,QEa]=gU(gqi,{checked:!1}),fqi=Oi.forwardRef(jh(function(t,n){let{__scopeMenu:o,...r}=t;return kc.jsx(SE.div,{role:"separator","aria-orientation":"horizontal",...r,ref:n})},"MenuSeparator")),Noo="MenuSub",[yqi,Roo]=gU(Noo),xqi=jh((e)=>{let{__scopeMenu:t,children:n,open:o=!1,onOpenChange:r}=e,i=uH(Noo,t),s=hBe(t),[a,c]=Oi.useState(null),[l,h]=Oi.useState(null),d=xE(r);return Oi.useEffect(()=>{if(i.open===!1)d(!1);return()=>d(!1)},[i.open,d]),kc.jsx(Xno,{...s,children:kc.jsx(Eoo,{scope:t,open:o,onOpenChange:d,content:l,onContentChange:h,children:kc.jsx(yqi,{scope:t,contentId:Lte(),triggerId:Lte(),trigger:a,onTriggerChange:c,children:n})})})},"MenuSub"),YMe="MenuSubTrigger",Cqi=Oi.forwardRef(jh(function(t,n){let o=uH(YMe,t.__scopeMenu),r=tme(YMe,t.__scopeMenu),i=Roo(YMe,t.__scopeMenu),s=mmt(YMe,t.__scopeMenu),a=Oi.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:l}=s,h={__scopeMenu:t.__scopeMenu},d=Oi.useCallback(()=>{if(a.current)window.clearTimeout(a.current);a.current=null},[]);Oi.useEffect(()=>d,[d]),Oi.useEffect(()=>{let _=c.current;return()=>{window.clearTimeout(_),l(null)}},[c,l]);let u=cA(n,i.onTriggerChange);return kc.jsx(Moo,{asChild:!0,...h,children:kc.jsx(Doo,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?i.contentId:void 0,"data-state":gmt(o.open),...t,ref:u,onClick:(_)=>{if(t.onClick?.(_),t.disabled||_.defaultPrevented)return;if(_.currentTarget.focus(),!o.open)o.onOpenChange(!0)},onPointerMove:Rl(t.onPointerMove,Hte((_)=>{if(s.onItemEnter(_),_.defaultPrevented)return;if(!t.disabled&&!o.open&&!a.current)s.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{o.onOpenChange(!0),d()},100)})),onPointerLeave:Rl(t.onPointerLeave,Hte((_)=>{d();let p=o.content?.getBoundingClientRect();if(p){let m=o.content?.dataset.side,A=m==="right",g=A?-5:5,f=p[A?"left":"right"],y=p[A?"right":"left"];s.onPointerGraceIntentChange({area:[{x:_.clientX+g,y:_.clientY},{x:f,y:p.top},{x:y,y:p.top},{x:y,y:p.bottom},{x:f,y:p.bottom}],side:m}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(_),_.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:Rl(t.onKeyDown,(_)=>{if(t.disabled||_.target!==_.currentTarget)return;if(s.searchRef.current!==""&&_.key===" ")return;if(tqi[r.dir].includes(_.key))o.onOpenChange(!0),o.content?.focus(),_.preventDefault()})})})},"MenuSubTrigger")),bqi="MenuSubContent",Iqi=Oi.forwardRef(jh(function(t,n){let o=Boo(jv,t.__scopeMenu),{forceMount:r=o.forceMount,align:i="start",...s}=t,a=uH(jv,t.__scopeMenu),c=tme(jv,t.__scopeMenu),l=Roo(bqi,t.__scopeMenu),h=Oi.useRef(null),d=cA(n,h);return kc.jsx(kpe.Provider,{scope:t.__scopeMenu,children:kc.jsx(dmt,{present:r||a.open,children:kc.jsx(kpe.Slot,{scope:t.__scopeMenu,children:kc.jsx(_mt,{id:l.contentId,"aria-labelledby":l.triggerId,...s,ref:d,align:i,side:c.dir===J$i.RTL?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:(u)=>{if(c.isUsingKeyboardRef.current)h.current?.focus();u.preventDefault()},onCloseAutoFocus:(u)=>u.preventDefault(),onFocusOutside:Rl(t.onFocusOutside,(u)=>{if(u.target!==l.trigger)a.onOpenChange(!1)}),onEscapeKeyDown:Rl(t.onEscapeKeyDown,(u)=>{c.onClose(),u.preventDefault()}),onKeyDown:Rl(t.onKeyDown,(u)=>{let _=u.currentTarget.contains(u.target),p=nqi[c.dir].includes(u.key);if(_&&p)a.onOpenChange(!1),l.trigger?.focus(),u.preventDefault()})})})})})},"MenuSubContent"));function gmt(e){return e?"open":"closed"}jh(gmt,"getOpenState");function bwe(e){return e==="indeterminate"}jh(bwe,"isIndeterminate");function Qoo(e){return bwe(e)?"indeterminate":e?"checked":"unchecked"}jh(Qoo,"getCheckedState");function koo(e){let t=document.activeElement;for(let n of e){if(n===t)return;if(n.focus(),document.activeElement!==t)return}}jh(koo,"focusFirst");function Loo(e,t){return e.map((n,o)=>e[(t+o)%e.length])}jh(Loo,"wrapArray");function Hoo(e,t,n){let r=t.length>1&&Array.from(t).every((l)=>l===t[0])?t[0]:t,i=n?e.indexOf(n):-1,s=Loo(e,Math.max(i,0));if(r.length===1)s=s.filter((l)=>l!==n);let c=s.find((l)=>l.toLowerCase().startsWith(r.toLowerCase()));return c!==n?c:void 0}jh(Hoo,"getNextMatch");function Foo(e,t){let{x:n,y:o}=e,r=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){let a=t[i],c=t[s],{x:l,y:h}=a,{x:d,y:u}=c;if(h>o!==u>o&&n<(d-l)*(o-h)/(u-h)+l)r=!r}return r}jh(Foo,"isPointInPolygon");function zoo(e,t){if(!t)return!1;let n={x:e.clientX,y:e.clientY};return Foo(n,t)}jh(zoo,"isPointerInGraceArea");function Hte(e){return(t)=>t.pointerType==="mouse"?e(t):void 0}jh(Hte,"whenMouse");var vqi=Object.defineProperty,PE=(e,t)=>vqi(e,"name",{value:t,configurable:!0}),Amt="DropdownMenu",[Sqi,kEa]=mU(Amt,[Soo]),EE=Soo(),[Pqi,Ooo]=Sqi(Amt),Eqi=PE((e)=>{let{__scopeDropdownMenu:t,children:n,dir:o,open:r,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,c=EE(t),l=_C.useRef(null),[h,d]=Kwe({prop:r,defaultProp:i??!1,onChange:s,caller:Amt});return mC.jsx(Pqi,{scope:t,triggerId:Lte(),triggerRef:l,contentId:Lte(),open:h,onOpenChange:d,onOpenToggle:_C.useCallback(()=>d((u)=>!u),[d]),modal:a,children:mC.jsx(sqi,{...c,open:h,onOpenChange:d,dir:o,modal:a,children:n})})},"DropdownMenu"),Mqi="DropdownMenuTrigger",wqi=_C.forwardRef(PE(function(t,n){let{__scopeDropdownMenu:o,disabled:r=!1,...i}=t,s=Ooo(Mqi,o),a=EE(o),c=cA(n,s.triggerRef);return mC.jsx(Moo,{asChild:!0,...a,children:mC.jsx(SE.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:c,onPointerDown:Rl(t.onPointerDown,(l)=>{if(!r&&l.button===0&&l.ctrlKey===!1){if(s.onOpenToggle(),!s.open)l.preventDefault()}}),onKeyDown:Rl(t.onKeyDown,(l)=>{if(r)return;if(["Enter"," "].includes(l.key))s.onOpenToggle();if(l.key==="ArrowDown")s.onOpenChange(!0);if(["Enter"," ","ArrowDown"].includes(l.key))l.preventDefault()})})})},"DropdownMenuTrigger")),rwe=PE((e)=>{let{__scopeDropdownMenu:t,...n}=e,o=EE(t);return mC.jsx(cqi,{...o,...n})},"DropdownMenuPortal"),Bqi="DropdownMenuContent",Tqi=_C.forwardRef(PE(function(t,n){let{__scopeDropdownMenu:o,...r}=t,i=Ooo(Bqi,o),s=EE(o),a=_C.useRef(!1);return mC.jsx(hqi,{id:i.contentId,"aria-labelledby":i.triggerId,...s,...r,ref:n,onCloseAutoFocus:Rl(t.onCloseAutoFocus,(c)=>{if(!a.current)i.triggerRef.current?.focus();a.current=!1,c.preventDefault()}),onInteractOutside:Rl(t.onInteractOutside,(c)=>{let l=c.detail.originalEvent,h=l.button===0&&l.ctrlKey===!0,d=l.button===2||h;if(!i.modal||d)a.current=!0}),style:{...t.style,...{"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}})},"DropdownMenuContent")),T0=_C.forwardRef(PE(function(t,n){let{__scopeDropdownMenu:o,...r}=t,i=EE(o);return mC.jsx(Too,{...i,...r,ref:n})},"DropdownMenuItem")),Dqi=_C.forwardRef(PE(function(t,n){let{__scopeDropdownMenu:o,...r}=t,i=EE(o);return mC.jsx(mqi,{...i,...r,ref:n})},"DropdownMenuCheckboxItem")),DT=_C.forwardRef(PE(function(t,n){let{__scopeDropdownMenu:o,...r}=t,i=EE(o);return mC.jsx(fqi,{...i,...r,ref:n})},"DropdownMenuSeparator")),X0t=PE((e)=>{let{__scopeDropdownMenu:t,children:n,open:o,onOpenChange:r,defaultOpen:i}=e,s=EE(t),[a,c]=Kwe({prop:o,defaultProp:i??!1,onChange:r,caller:"DropdownMenuSub"});return mC.jsx(xqi,{...s,open:a,onOpenChange:c,children:n})},"DropdownMenuSub"),j0t=_C.forwardRef(PE(function(t,n){let{__scopeDropdownMenu:o,...r}=t,i=EE(o);return mC.jsx(Cqi,{...i,...r,ref:n})},"DropdownMenuSubTrigger")),Nqi=_C.forwardRef(PE(function(t,n){let{__scopeDropdownMenu:o,...r}=t,i=EE(o);return mC.jsx(Iqi,{...i,...r,ref:n,style:{...t.style,...{"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}})},"DropdownMenuSubContent")),K0t=(e)=>{let[t,n]=Lpe.useState(null),[o,r]=Lpe.useState();return Lpe.useLayoutEffect(()=>{if(!t)return;let i=document.getElementById(t.getAttribute("aria-labelledby")??"");if(!i)return;let s=0,a=()=>{if(s=Math.max(s,t.offsetWidth),!s)return;let l=i.getBoundingClientRect(),h=Math.max(l.left-10,document.documentElement.clientWidth-l.right-10);r(h<s?l.width:void 0)},c=new ResizeObserver(a);return c.observe(t),c.observe(i),a(),window.addEventListener("resize",a),()=>{c.disconnect(),window.removeEventListener("resize",a)}},[t]),Voo.jsx(Nqi,{...e,ref:n,sideOffset:o===void 0?e.sideOffset:-o,style:{...e.style,...o===void 0?{}:{minWidth:Math.min(160,o),maxWidth:o}}})},Yoo={boxSizing:"border-box",minWidth:"min(160px, calc(100vw - 20px))",maxWidth:"calc(100vw - 20px)",maxHeight:"var(--radix-dropdown-menu-content-available-height, calc(100dvh - 20px))",overflowY:"auto",overflowX:"hidden",overscrollBehavior:"contain",overflowWrap:"anywhere"},mf=()=>zT.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:zT.jsx("path",{d:"M20 6 9 17l-5-5"})}),q0t=({isOpen:e})=>zT.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{transition:"transform 0.2s ease",transform:e?"rotate(90deg)":"rotate(0deg)",opacity:0.6},children:zT.jsx("path",{d:"m9 18 6-6-6-6"})}),Rqi=()=>zT.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:zT.jsx("path",{d:"M5 12h14"})}),H$n=()=>zT.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-dot-icon lucide-dot",children:zT.jsx("circle",{cx:"12.1",cy:"12.1",r:"4.5",fill:"white"})}),Sx={padding:"6px 8px",borderRadius:6,cursor:"default",outline:"none",userSelect:"none",display:"flex",alignItems:"center",gap:8,color:"#fafafa",fontWeight:400,fontSize:14,transition:"background-color 0.15s ease, color 0.15s ease",fontFamily:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif'},Qqi={paddingLeft:32,paddingTop:6,paddingBottom:6,paddingRight:8},g0t={height:1,backgroundColor:"#ffffff1a",margin:"4px 0"},kqi={...Yoo,backgroundColor:"#262626",color:"#fafafa",borderRadius:8,boxShadow:"0px 12px 48px -12px rgba(0, 0, 0, 0.5), 0px 8px 24px -8px rgba(0, 0, 0, 0.3)",border:"1px solid #333333",padding:"4px",zIndex:Kpe.appearanceMenu,fontSize:14,fontFamily:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif'},c4={width:16,height:16,display:"flex",alignItems:"flex-end",justifyContent:"center",flexShrink:0},Lqi=()=>{let{visibility:e,setLayerVisibility:t}=pU(),{darkBackgroundEnabled:n,setDarkBackgroundEnabled:o,lightingEnabled:r,setLightingEnabled:i}=Ypt(),[s,a]=$0t.useState(!1),[c,l]=$0t.useState(null);return Lr.jsxs(Lr.Fragment,{children:[Lr.jsx(DT,{style:g0t}),Lr.jsxs(X0t,{onOpenChange:a,children:[Lr.jsxs(j0t,{style:{...Sx,...Qqi,backgroundColor:s||c==="appearance"?"#404040":"transparent"},onMouseEnter:()=>l("appearance"),onMouseLeave:()=>l(null),onTouchStart:()=>l("appearance"),children:[Lr.jsx("span",{style:{flex:1,display:"flex",alignItems:"center"},children:"Appearance"}),Lr.jsx("div",{style:{marginLeft:"auto",display:"flex",alignItems:"flex-end",marginBottom:"-5px"},children:Lr.jsx(q0t,{isOpen:s})})]}),Lr.jsx(rwe,{children:Lr.jsxs(K0t,{style:{...kqi,marginLeft:-2},collisionPadding:10,avoidCollisions:!0,children:[Lr.jsxs(T0,{style:{...Sx,backgroundColor:c==="darkBackground"?"#404040":"transparent"},onSelect:(h)=>h.preventDefault(),onPointerDown:(h)=>{h.preventDefault(),o(!n)},onMouseEnter:()=>l("darkBackground"),onMouseLeave:()=>l(null),onTouchStart:()=>l("darkBackground"),children:[Lr.jsx("span",{style:c4,children:n&&Lr.jsx(mf,{})}),Lr.jsx("span",{style:{display:"flex",alignItems:"center"},children:"Dark Background"})]}),Lr.jsxs(T0,{style:{...Sx,backgroundColor:c==="lighting"?"#404040":"transparent"},onSelect:(h)=>h.preventDefault(),onPointerDown:(h)=>{h.preventDefault(),i(!r)},onMouseEnter:()=>l("lighting"),onMouseLeave:()=>l(null),onTouchStart:()=>l("lighting"),children:[Lr.jsx("span",{style:c4,children:r&&Lr.jsx(mf,{})}),Lr.jsx("span",{style:{display:"flex",alignItems:"center"},children:"Lighting"})]}),Lr.jsx(DT,{style:g0t}),Lr.jsxs(T0,{style:{...Sx,backgroundColor:c==="boardBody"?"#404040":"transparent"},onSelect:(h)=>h.preventDefault(),onPointerDown:(h)=>{h.preventDefault(),t("boardBody",!e.boardBody)},onMouseEnter:()=>l("boardBody"),onMouseLeave:()=>l(null),onTouchStart:()=>l("boardBody"),children:[Lr.jsx("span",{style:c4,children:e.boardBody&&Lr.jsx(mf,{})}),Lr.jsx("span",{style:{display:"flex",alignItems:"center"},children:"Board Body"})]}),Lr.jsxs(T0,{style:{...Sx,backgroundColor:c==="topCopper"?"#404040":"transparent"},onSelect:(h)=>h.preventDefault(),onPointerDown:(h)=>{h.preventDefault(),t("topCopper",!e.topCopper)},onMouseEnter:()=>l("topCopper"),onMouseLeave:()=>l(null),onTouchStart:()=>l("topCopper"),children:[Lr.jsx("span",{style:c4,children:e.topCopper&&Lr.jsx(mf,{})}),Lr.jsx("span",{style:{display:"flex",alignItems:"center"},children:"Top Copper"})]}),Lr.jsxs(T0,{style:{...Sx,backgroundColor:c==="bottomCopper"?"#404040":"transparent"},onSelect:(h)=>h.preventDefault(),onPointerDown:(h)=>{h.preventDefault(),t("bottomCopper",!e.bottomCopper)},onMouseEnter:()=>l("bottomCopper"),onMouseLeave:()=>l(null),onTouchStart:()=>l("bottomCopper"),children:[Lr.jsx("span",{style:c4,children:e.bottomCopper&&Lr.jsx(mf,{})}),Lr.jsx("span",{style:{display:"flex",alignItems:"center"},children:"Bottom Copper"})]}),Lr.jsxs(T0,{style:{...Sx,backgroundColor:c==="keepout"?"#404040":"transparent"},onSelect:(h)=>h.preventDefault(),onPointerDown:(h)=>{h.preventDefault(),t("keepout",!e.keepout)},onMouseEnter:()=>l("keepout"),onMouseLeave:()=>l(null),onTouchStart:()=>l("keepout"),children:[Lr.jsx("span",{style:c4,children:e.keepout&&Lr.jsx(mf,{})}),Lr.jsx("span",{style:{display:"flex",alignItems:"center"},children:"Keepout"})]}),Lr.jsxs(T0,{style:{...Sx,backgroundColor:c==="topSilkscreen"?"#404040":"transparent"},onSelect:(h)=>h.preventDefault(),onPointerDown:(h)=>{h.preventDefault(),t("topSilkscreen",!e.topSilkscreen)},onMouseEnter:()=>l("topSilkscreen"),onMouseLeave:()=>l(null),onTouchStart:()=>l("topSilkscreen"),children:[Lr.jsx("span",{style:c4,children:e.topSilkscreen&&Lr.jsx(mf,{})}),Lr.jsx("span",{style:{display:"flex",alignItems:"center"},children:"Top Silkscreen"})]}),Lr.jsxs(T0,{style:{...Sx,backgroundColor:c==="bottomSilkscreen"?"#404040":"transparent"},onSelect:(h)=>h.preventDefault(),onPointerDown:(h)=>{h.preventDefault(),t("bottomSilkscreen",!e.bottomSilkscreen)},onMouseEnter:()=>l("bottomSilkscreen"),onMouseLeave:()=>l(null),onTouchStart:()=>l("bottomSilkscreen"),children:[Lr.jsx("span",{style:c4,children:e.bottomSilkscreen&&Lr.jsx(mf,{})}),Lr.jsx("span",{style:{display:"flex",alignItems:"center"},children:"Bottom Silkscreen"})]}),Lr.jsxs(T0,{style:{...Sx,backgroundColor:c==="topMask"?"#404040":"transparent"},onSelect:(h)=>h.preventDefault(),onPointerDown:(h)=>{h.preventDefault(),t("topMask",!e.topMask)},onMouseEnter:()=>l("topMask"),onMouseLeave:()=>l(null),onTouchStart:()=>l("topMask"),children:[Lr.jsx("span",{style:c4,children:e.topMask&&Lr.jsx(mf,{})}),Lr.jsx("span",{style:{display:"flex",alignItems:"center"},children:"Top Soldermask"})]}),Lr.jsxs(T0,{style:{...Sx,backgroundColor:c==="bottomMask"?"#404040":"transparent"},onSelect:(h)=>h.preventDefault(),onPointerDown:(h)=>{h.preventDefault(),t("bottomMask",!e.bottomMask)},onMouseEnter:()=>l("bottomMask"),onMouseLeave:()=>l(null),onTouchStart:()=>l("bottomMask"),children:[Lr.jsx("span",{style:c4,children:e.bottomMask&&Lr.jsx(mf,{})}),Lr.jsx("span",{style:{display:"flex",alignItems:"center"},children:"Bottom Soldermask"})]}),Lr.jsxs(T0,{style:{...Sx,backgroundColor:c==="pcbNotes"?"#404040":"transparent"},onSelect:(h)=>h.preventDefault(),onPointerDown:(h)=>{h.preventDefault(),t("pcbNotes",!e.pcbNotes)},onMouseEnter:()=>l("pcbNotes"),onMouseLeave:()=>l(null),onTouchStart:()=>l("pcbNotes"),children:[Lr.jsx("span",{style:c4,children:e.pcbNotes&&Lr.jsx(mf,{})}),Lr.jsx("span",{style:{display:"flex",alignItems:"center"},children:"PCB Notes"})]}),Lr.jsxs(T0,{style:{...Sx,backgroundColor:c==="smtModels"?"#404040":"transparent"},onSelect:(h)=>h.preventDefault(),onPointerDown:(h)=>{h.preventDefault(),t("smtModels",!e.smtModels)},onMouseEnter:()=>l("smtModels"),onMouseLeave:()=>l(null),onTouchStart:()=>l("smtModels"),children:[Lr.jsx("span",{style:c4,children:e.smtModels&&Lr.jsx(mf,{})}),Lr.jsx("span",{style:{display:"flex",alignItems:"center"},children:"Surface Mount Components"})]}),Lr.jsxs(T0,{style:{...Sx,backgroundColor:c==="throughHoleModels"?"#404040":"transparent"},onSelect:(h)=>h.preventDefault(),onPointerDown:(h)=>{h.preventDefault(),t("throughHoleModels",!e.throughHoleModels)},onMouseEnter:()=>l("throughHoleModels"),onMouseLeave:()=>l(null),onTouchStart:()=>l("throughHoleModels"),children:[Lr.jsx("span",{style:c4,children:e.throughHoleModels&&Lr.jsx(mf,{})}),Lr.jsx("span",{style:{display:"flex",alignItems:"center"},children:"Through-Hole Components"})]}),Lr.jsx(DT,{style:g0t}),Lr.jsxs(T0,{style:{...Sx,backgroundColor:c==="enclosure"?"#404040":"transparent"},onSelect:(h)=>h.preventDefault(),onPointerDown:(h)=>{h.preventDefault(),t("enclosure",EYi(e.enclosure))},onMouseEnter:()=>l("enclosure"),onMouseLeave:()=>l(null),onTouchStart:()=>l("enclosure"),title:`Enclosure: ${e.enclosure}`,children:[Lr.jsxs("span",{style:c4,children:[e.enclosure==="opaque"&&Lr.jsx(mf,{}),e.enclosure==="translucent"&&Lr.jsx(Rqi,{})]}),Lr.jsx("span",{style:{display:"flex",alignItems:"center"},children:"Enclosure"})]})]})})]})]})},Hqi=["Custom","Top Center Angled","Top Down","Top Left Corner","Top Right Corner","Left Sideview","Right Sideview","Front"],A0t={...Yoo,backgroundColor:"#262626",color:"#fafafa",borderRadius:6,boxShadow:"0px 12px 48px -12px rgba(0, 0, 0, 0.5), 0px 8px 24px -8px rgba(0, 0, 0, 0.3)",border:"1px solid #333333",padding:"4px",zIndex:Kpe.contextMenu,fontSize:14,fontWeight:400,fontFamily:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif'},l4={padding:"6px 8px",borderRadius:6,cursor:"default",outline:"none",userSelect:"none",display:"flex",alignItems:"center",gap:8,color:"#fafafa",fontWeight:400,fontSize:14,transition:"background-color 0.15s ease, color 0.15s ease",fontFamily:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif'},tH={paddingLeft:32,paddingTop:6,paddingBottom:6,paddingRight:8},Ete={width:16,height:16,display:"flex",alignItems:"flex-end",justifyContent:"center",flexShrink:0},Mte={height:1,backgroundColor:"#ffffff1a",margin:"4px 0"},F$n={fontSize:11,opacity:0.65,fontWeight:500,color:"#b5b5bcff",backgroundColor:"rgba(161, 161, 170, 0.1)",padding:"2px 6px",borderRadius:4,border:"1px solid rgba(161, 161, 170, 0.2)",letterSpacing:"0.3px"},Fqi=({menuRef:e,menuPos:t,engine:n,cameraPreset:o,autoRotate:r,foldPcbs:i=!1,onFoldPcbsToggle:s,flexScene:a=!1,referenceObject:c=null,onEngineSwitch:l,onCameraPresetSelect:h,onAutoRotateToggle:d,onReferenceObjectSelect:u=()=>{},onViewSchematicComponent:_,componentName:p,onHideComponent:m,onUnhideAllComponents:A,onDownloadGltf:g,onOpenKeyboardShortcuts:f})=>{let{cameraType:y,setCameraType:x}=VT(),{gridEnabled:C,setGridEnabled:b}=Ypt(),[I,v]=iwe.useState(!1),[P,M]=iwe.useState(!1),[B,T]=iwe.useState(null);return Yr.jsx("div",{ref:e,style:{position:"fixed",left:t.x,top:t.y,width:0,height:0},children:Yr.jsxs(Eqi,{open:!0,modal:!1,children:[Yr.jsx(wqi,{asChild:!0,children:Yr.jsx("div",{style:{position:"absolute",width:1,height:1}})}),Yr.jsx(rwe,{children:Yr.jsxs(Tqi,{style:A0t,collisionPadding:10,avoidCollisions:!0,sideOffset:0,align:"start",children:[m&&Yr.jsx(T0,{style:{...l4,...tH,backgroundColor:B==="hide"?"#404040":"transparent"},onSelect:m,onMouseEnter:()=>T("hide"),onMouseLeave:()=>T(null),children:`Hide "${p}"`}),_&&Yr.jsx(Yr.Fragment,{children:Yr.jsx(T0,{style:{...l4,...tH,backgroundColor:B==="schematic"?"#404040":"transparent"},onSelect:_,onMouseEnter:()=>T("schematic"),onMouseLeave:()=>T(null),children:"Show on schematic"})}),A&&Yr.jsx(T0,{style:{...l4,...tH,backgroundColor:B==="unhide"?"#404040":"transparent"},onSelect:A,onMouseEnter:()=>T("unhide"),onMouseLeave:()=>T(null),children:"Unhide All Components"}),(_||m||A)&&Yr.jsx(DT,{style:Mte}),Yr.jsxs(X0t,{onOpenChange:v,children:[Yr.jsxs(j0t,{style:{...l4,...tH,backgroundColor:I||B==="camera"?"#404040":"transparent"},onMouseEnter:()=>T("camera"),onMouseLeave:()=>T(null),onTouchStart:()=>T("camera"),children:[Yr.jsx("span",{style:{flex:1,display:"flex",alignItems:"center"},children:"Camera"}),Yr.jsxs("div",{style:{display:"flex",alignItems:"flex-end",gap:6,marginLeft:"auto"},children:[Yr.jsx("span",{style:{opacity:0.55,fontSize:13},children:o}),Yr.jsx(q0t,{isOpen:I})]})]}),Yr.jsx(rwe,{children:Yr.jsxs(K0t,{style:{...A0t,marginLeft:-2},collisionPadding:10,avoidCollisions:!0,children:[Hqi.map((N)=>Yr.jsxs(T0,{style:{...l4,backgroundColor:B===N?"#404040":"transparent"},onSelect:()=>h(N),onMouseEnter:()=>T(N),onMouseLeave:()=>T(null),onTouchStart:()=>T(N),children:[Yr.jsx("span",{style:Ete,children:o===N&&Yr.jsx(H$n,{})}),Yr.jsx("span",{style:{display:"flex",alignItems:"center"},children:N})]},N)),Yr.jsx(DT,{style:Mte}),Yr.jsxs(T0,{style:{...l4,backgroundColor:B==="autorotate"?"#404040":"transparent"},onSelect:d,onMouseEnter:()=>T("autorotate"),onMouseLeave:()=>T(null),onTouchStart:()=>T("autorotate"),children:[Yr.jsx("span",{style:Ete,children:r&&Yr.jsx(mf,{})}),Yr.jsx("span",{style:{display:"flex",alignItems:"center"},children:"Auto rotate"})]}),Yr.jsxs(T0,{style:{...l4,backgroundColor:B==="cameratype"?"#404040":"transparent"},onSelect:(N)=>{N.preventDefault(),x(y==="perspective"?"orthographic":"perspective")},onMouseEnter:()=>T("cameratype"),onMouseLeave:()=>T(null),onTouchStart:()=>T("cameratype"),children:[Yr.jsx("span",{style:Ete,children:y==="orthographic"&&Yr.jsx(mf,{})}),Yr.jsx("span",{style:{display:"flex",alignItems:"center"},children:"Orthographic Camera"})]})]})})]}),Yr.jsxs(X0t,{onOpenChange:M,children:[Yr.jsxs(j0t,{style:{...l4,...tH,backgroundColor:P||B==="reference-object"?"#404040":"transparent"},onMouseEnter:()=>T("reference-object"),onMouseLeave:()=>T(null),onTouchStart:()=>T("reference-object"),children:[Yr.jsx("span",{style:{flex:1,display:"flex",alignItems:"center"},children:"Show Reference Object"}),Yr.jsx("div",{style:{display:"flex",alignItems:"flex-end",gap:6,marginLeft:"auto"},children:Yr.jsx(q0t,{isOpen:P})})]}),Yr.jsx(rwe,{children:Yr.jsx(K0t,{style:{...A0t,marginLeft:-2},collisionPadding:10,avoidCollisions:!0,children:HGi.map((N)=>{let D=N.type??"none";return Yr.jsxs(T0,{style:{...l4,backgroundColor:B===D?"#404040":"transparent"},onSelect:(L)=>L.preventDefault(),onPointerDown:(L)=>{L.preventDefault(),u(N.type)},onMouseEnter:()=>T(D),onMouseLeave:()=>T(null),onTouchStart:()=>T(D),children:[Yr.jsx("span",{style:Ete,children:c===N.type&&Yr.jsx(H$n,{})}),Yr.jsx("span",{style:{display:"flex",alignItems:"center"},children:N.label})]},D)})})})]}),s&&Yr.jsxs(Dqi,{checked:i,onCheckedChange:s,style:{...l4,backgroundColor:B==="fold"?"#404040":"transparent"},onMouseEnter:()=>T("fold"),onMouseLeave:()=>T(null),children:[Yr.jsx("span",{style:Ete,children:i&&Yr.jsx(mf,{})}),Yr.jsx("span",{children:"Fold PCBs"})]}),Yr.jsxs(T0,{style:{...l4,backgroundColor:B==="grid"?"#404040":"transparent"},onSelect:(N)=>N.preventDefault(),onPointerDown:(N)=>{N.preventDefault(),b(!C)},onMouseEnter:()=>T("grid"),onMouseLeave:()=>T(null),onTouchStart:()=>T("grid"),children:[Yr.jsx("span",{style:Ete,children:C&&Yr.jsx(mf,{})}),Yr.jsx("span",{style:{display:"flex",alignItems:"center"},children:"Show Grid"})]}),Yr.jsx(Lqi,{}),Yr.jsx(DT,{style:Mte}),Yr.jsx(T0,{style:{...l4,...tH,backgroundColor:B==="download"?"#404040":"transparent"},onSelect:g,onMouseEnter:()=>T("download"),onMouseLeave:()=>T(null),onTouchStart:()=>T("download"),children:Yr.jsx("span",{style:{display:"flex",alignItems:"center"},children:"Download GLTF"})}),Yr.jsx(DT,{style:Mte}),!a&&Yr.jsxs(T0,{style:{...l4,...tH,backgroundColor:B==="engine"?"#404040":"transparent"},onSelect:(N)=>N.preventDefault(),onPointerDown:(N)=>{N.preventDefault(),l(n==="jscad"?"manifold":"jscad")},onMouseEnter:()=>T("engine"),onMouseLeave:()=>T(null),onTouchStart:()=>T("engine"),children:[Yr.jsxs("span",{style:{flex:1,display:"flex",alignItems:"center"},children:["Switch to ",n==="jscad"?"Manifold":"JSCAD"," Engine"]}),Yr.jsx("div",{style:{...F$n,display:"flex",alignItems:"center"},children:n==="jscad"?"experimental":"default"})]}),Yr.jsx(DT,{style:Mte}),Yr.jsxs(T0,{style:{...l4,...tH,backgroundColor:B==="shortcuts"?"#404040":"transparent"},onSelect:f,onMouseEnter:()=>T("shortcuts"),onMouseLeave:()=>T(null),onTouchStart:()=>T("shortcuts"),children:[Yr.jsx("span",{style:{flex:1,display:"flex",alignItems:"center"},children:"Keyboard Shortcuts"}),Yr.jsx("div",{style:{...F$n,display:"flex",alignItems:"center"},children:"Shift+?"})]}),Yr.jsx(DT,{style:Mte}),Yr.jsx("div",{style:{display:"flex",alignItems:"center",marginTop:0,paddingLeft:32,paddingTop:4,paddingBottom:4},children:Yr.jsxs("span",{style:{fontSize:11,opacity:0.35,fontWeight:400,color:"#a1a1aa",letterSpacing:"0.2px"},children:["@tscircuit/3d-viewer@",eto.version]})})]})})]})})},qte=new Map,J0t=new Set,z$n=!1,Z0t=0,ept=0,Iwe=null,O$n=!1,zqi=20,Oqi=(e)=>{let t=e.toLowerCase().split("+"),n=t[t.length-1],o=t.slice(0,-1);return{key:n,ctrl:o.includes("ctrl"),cmd:o.includes("cmd"),shift:o.includes("shift"),alt:o.includes("alt")}},Vqi=(e,t)=>{let n=Oqi(t),o=e.key.toLowerCase()===n.key,r=n.ctrl===e.ctrlKey,i=n.cmd===e.metaKey,s=n.shift===e.shiftKey,a=n.alt===e.altKey;return o&&r&&i&&s&&a},Yqi=(e)=>{if(!e||typeof e!=="object")return!1;let t=e,n=t.tagName,o=["INPUT","TEXTAREA","SELECT"];if(o.includes(n))return!0;let r=t.getAttribute?.("contenteditable");if(r==="true"||r==="")return!0;let i=t.parentElement;for(let s=0;s<zqi&&i;s++){let a=i.tagName;if(o.includes(a))return!0;let c=i.getAttribute?.("contenteditable");if(c==="true"||c==="")return!0;i=i.parentElement}return!1},Gqi=()=>{if(typeof document>"u")return!1;let e=document.activeElement;if(!e)return!1;let t=e.tagName;if(t==="INPUT"||t==="TEXTAREA"||t==="SELECT")return!0;let n=e.getAttribute("contenteditable");return n==="true"||n===""},Uqi=()=>{if(!Iwe)return!0;let e=Iwe.getBoundingClientRect();return Z0t>=e.left&&Z0t<=e.right&&ept>=e.top&&ept<=e.bottom},Wqi=()=>{if(O$n||typeof window>"u")return;window.addEventListener("mousemove",(e)=>{Z0t=e.clientX,ept=e.clientY}),O$n=!0},Xqi=(e)=>{if(Yqi(e.target)||Gqi())return;if(Iwe&&!Uqi())return;qte.forEach((t)=>{if(Vqi(e,t.shortcut))e.preventDefault(),t.invoke()})},Goo=()=>{let e=Array.from(qte.values());J0t.forEach((t)=>t(e))},jqi=()=>{if(z$n)return;if(typeof window>"u")return;window.addEventListener("keydown",Xqi),z$n=!0},Kqi=(e)=>{qte.set(e.id,e),Goo(),jqi()},$qi=(e)=>{if(qte.delete(e))Goo()},qqi=(e)=>(J0t.add(e),e(Array.from(qte.values())),()=>{J0t.delete(e)}),GMe=(e,t,n)=>{let o=GT.useRef(t);o.current=t;let r=GT.useMemo(()=>({shortcut:n.shortcut,description:n.description}),[n.shortcut,n.description]);GT.useEffect(()=>{let i={id:e,...r,invoke:()=>o.current()};return Kqi(i),()=>{$qi(e)}},[e,r])},Jqi=()=>{let[e,t]=GT.useState(()=>Array.from(qte.values()));return GT.useEffect(()=>qqi(t),[]),e},Zqi=(e)=>{Iwe=e,Wqi()},eJi=({open:e,onClose:t})=>{let[n,o]=OT.useState(""),r=OT.useRef(null),i=Jqi();OT.useEffect(()=>{if(!e)return;let a=(c)=>{if(c.key==="Escape")c.preventDefault(),t()};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[e,t]),OT.useEffect(()=>{if(e)setTimeout(()=>{r.current?.focus()},0)},[e]);let s=OT.useMemo(()=>{let a=n.trim().toLowerCase();if(!a)return i;return i.filter((c)=>`${c.shortcut} ${c.description}`.toLowerCase().includes(a))},[i,n]);if(!e)return null;return mm.jsx("div",{role:"dialog","aria-modal":"true",style:{position:"fixed",inset:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999},onClick:t,children:mm.jsxs("div",{style:{backgroundColor:"#1f1f23",color:"#f8f8ff",borderRadius:12,width:"min(640px, 90vw)",maxHeight:"80vh",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.45), 0 8px 20px rgba(0, 0, 0, 0.35)",display:"flex",flexDirection:"column",overflow:"hidden"},onClick:(a)=>a.stopPropagation(),children:[mm.jsxs("header",{style:{padding:"20px 24px 12px",borderBottom:"1px solid rgba(255, 255, 255, 0.08)"},children:[mm.jsxs("div",{style:{display:"flex",justifyContent:"space-between"},children:[mm.jsx("h2",{style:{margin:0,fontSize:"1.1rem",fontWeight:600,letterSpacing:"0.02em"},children:"Keyboard Shortcuts"}),mm.jsx("button",{type:"button",onClick:t,style:{background:"transparent",border:"none",color:"rgba(255, 255, 255, 0.8)",fontSize:"1rem",cursor:"pointer"},children:"✕"})]}),mm.jsx("input",{ref:r,type:"text",placeholder:"Search shortcuts...",value:n,onChange:(a)=>o(a.target.value),style:{marginTop:12,width:"calc(100% - 24px)",padding:"10px 12px",borderRadius:8,border:"1px solid rgba(255, 255, 255, 0.1)",backgroundColor:"rgba(255, 255, 255, 0.05)",color:"white",fontSize:"0.95rem"}})]}),mm.jsx("div",{style:{overflowY:"auto"},children:mm.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"0.95rem"},children:[mm.jsx("thead",{children:mm.jsxs("tr",{style:{textAlign:"left",color:"#a1a1b5"},children:[mm.jsx("th",{style:{padding:"12px 24px",width:"25%"},children:"Key"}),mm.jsx("th",{style:{padding:"12px 24px"},children:"Description"})]})}),mm.jsx("tbody",{children:s.length===0?mm.jsx("tr",{children:mm.jsx("td",{colSpan:2,style:{padding:"24px",textAlign:"center"},children:"No shortcuts found"})}):s.map((a)=>mm.jsxs("tr",{style:{borderTop:"1px solid rgba(255, 255, 255, 0.05)"},children:[mm.jsx("td",{style:{padding:"12px 24px"},children:mm.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",border:"1px solid rgba(255, 255, 255, 0.3)",borderRadius:6,minWidth:36,padding:"4px 8px",fontFamily:"monospace",fontSize:"0.95rem",textTransform:"capitalize"},children:a.shortcut})}),mm.jsx("td",{style:{padding:"12px 24px"},children:a.description})]},a.id))})]})})]})})},tJi=()=>({showToast:(e,t=2000)=>{Z_(e,{duration:t})}}),nJi=({children:e})=>Jte.jsxs(Jte.Fragment,{children:[e,Jte.jsx(kKn,{position:"bottom-right"})]});function oJi({setAutoRotate:e,setAutoRotateUserToggled:t,setCameraPreset:n,closeMenu:o,cameraControllerRef:r,isAnimatingRef:i,lastPresetSelectTime:s}){return{handleCameraPresetSelect:Uoo.useCallback((c)=>{if(e(!1),t(!0),n(c),o(),s.current=Date.now(),c==="Custom")return;i.current=!0,r.current?.animateToPreset(c),setTimeout(()=>{i.current=!1},600)},[e,t,n,o,r,i,s])}}var rJi=({containerRef:e,onOpen:t})=>{let[n,o]=G1.useState(!1),[r,i]=G1.useState({x:0,y:0}),s=G1.useRef(null),a=G1.useRef(null),c=G1.useRef(null),l=G1.useRef(!1),h=()=>{if(c.current!==null)clearTimeout(c.current),c.current=null},d=G1.useCallback((g)=>{g.preventDefault();let f=typeof g.clientX==="number"?g.clientX:0,y=typeof g.clientY==="number"?g.clientY:0;if(l.current){l.current=!1;return}if(!a.current)return;let{x,y:C}=a.current,b=Math.abs(f-x),I=Math.abs(y-C),v=10;if(b>v||I>v){a.current=null;return}t?.({x:f,y}),i({x:f,y}),o(!0),a.current=null},[i,o,t]),u=G1.useCallback((g)=>{if(g.touches.length===1){let f=g.touches[0];if(f)a.current={x:f.clientX,y:f.clientY},h(),c.current=window.setTimeout(()=>{if(!a.current)return;if(e.current){t?.(a.current);let y=e.current.getBoundingClientRect();i({x:y.left+y.width/2,y:y.top+y.height/2}),o(!0),l.current=!0}a.current=null},600);else a.current=null}else a.current=null,h()},[e,t]),_=G1.useCallback((g)=>{if(!a.current||g.touches.length!==1)return;let f=g.touches[0];if(f){let y=Math.abs(f.clientX-a.current.x),x=Math.abs(f.clientY-a.current.y),C=10;if(y>10||x>10)a.current=null,h()}else a.current=null,h()},[]),p=G1.useCallback(()=>{h(),setTimeout(()=>{if(a.current)a.current=null},0)},[]),m=G1.useCallback((g)=>{let f=g.target;if(s.current&&s.current.contains(f))return;if(f.closest?.("[data-radix-popper-content-wrapper], [data-radix-dropdown-menu-content], [data-radix-dropdown-menu-sub-content]"))return;o(!1)},[]);return G1.useEffect(()=>{if(n)return document.addEventListener("mousedown",m),document.addEventListener("touchstart",m),()=>{document.removeEventListener("mousedown",m),document.removeEventListener("touchstart",m)}},[n,m]),{menuVisible:n,menuPos:r,menuRef:s,contextMenuEventHandlers:{onMouseDown:(g)=>{if(g.button===2)a.current={x:g.clientX,y:g.clientY};else a.current=null},onContextMenu:d,onTouchStart:u,onTouchMove:_,onTouchEnd:p},setMenuVisible:o}},iJi=()=>Woo.useCallback(()=>{let e=window.__TSCIRCUIT_THREE_OBJECT;if(!e)return;new dte().parse(e,(n)=>{let o=new Blob([n instanceof ArrayBuffer?n:JSON.stringify(n)],{type:"model/gltf+json"}),r=URL.createObjectURL(o),i=document.createElement("a");i.href=r,i.download="scene.gltf",i.click(),URL.revokeObjectURL(r)},(n)=>{console.error("Failed to export GLTF",n)})},[]),sJi=new Et(0,0,0),aJi=[5,-5,5],cJi=()=>{if(typeof window>"u")return;let e=window.localStorage.getItem("cadViewerCameraType");return e==="orthographic"||e==="perspective"?e:void 0},lJi=(e)=>{let t=zpt(e.circuitJson?void 0:e.children),n=e.circuitJson??t,o=n.some((Re)=>Re.type==="pcb_bend"),r=o||n.some((Re)=>Re.type==="pcb_stiffener"),[i,s]=Sh.useState(void 0),a=i??e.foldPcbs,c=Deo(n,a),l=JSON.stringify(n),{hiddenCadComponentIds:h,hideComponent:d,unhideAllComponents:u}=vYi(l),_={...e,circuitJson:n,children:void 0,hiddenCadComponentIds:h},[p,m]=Sh.useState(()=>{let Re=window.localStorage.getItem("cadViewerEngine");return Re==="jscad"||Re==="manifold"?Re:"manifold"}),A=Sh.useRef(null),[g,f]=Sh.useState(!1),[y,x]=Sh.useState(()=>window.localStorage.getItem("cadViewerAutoRotate")!=="false"),[C,b]=Sh.useState(()=>window.localStorage.getItem("cadViewerAutoRotateUserToggled")==="true"),[I,v]=Sh.useState("Custom"),[P,M]=Sh.useState(null),{cameraType:B}=VT(),{visibility:T,setLayerVisibility:N}=pU(),{showToast:D}=tJi(),L=Sh.useRef(null),H=e.onCameraControllerReady,V=Sh.useContext(Fpt),[O,U]=Sh.useState(),[j,Y]=Sh.useState(),X=Sh.useCallback((Re)=>{Y(IYi(V.current,Re,n)),U(e.onViewSchematicComponent?bYi(V.current,Re,n):void 0)},[V,n,e.onViewSchematicComponent]),{menuVisible:K,menuPos:J,menuRef:ee,contextMenuEventHandlers:se,setMenuVisible:ne}=rJi({containerRef:A,onOpen:X}),re=Sh.useRef(C);re.current=C;let Z=Sh.useRef(!1),te=Sh.useRef(0),ie=1000,le=Sh.useCallback(()=>{if(Z.current||Date.now()-te.current<ie)return;if(!re.current)x(!1);if(!K)v("Custom")},[K]),ue=Sh.useCallback(()=>{x((Re)=>!Re),b(!0)},[]),de=iJi(),me=Sh.useCallback(()=>{ne(!1)},[ne]),Ae=Sh.useCallback((Re)=>{if(L.current=Re,H?.(Re),Re&&I!=="Custom")Re.animateToPreset(I)},[I,H]),{handleCameraPresetSelect:xe}=oJi({setAutoRotate:x,setAutoRotateUserToggled:b,setCameraPreset:v,closeMenu:me,cameraControllerRef:L,isAnimatingRef:Z,lastPresetSelectTime:te});GMe("open_keyboard_shortcuts_dialog",()=>{f(!0)},{shortcut:"shift+?",description:"Open keyboard shortcuts"}),GMe("toggle_smt_models",()=>{let Re=!T.smtModels;N("smtModels",Re),D(Re?"SMT components visible":"SMT components hidden",1500)},{shortcut:"shift+s",description:"Toggle surface mount components"}),GMe("toggle_through_hole_models",()=>{let Re=!T.throughHoleModels;N("throughHoleModels",Re),D(Re?"Through-hole components visible":"Through-hole components hidden",1500)},{shortcut:"shift+t",description:"Toggle through-hole components"}),GMe("toggle_translucent_models",()=>{let Re=!T.translucentModels;N("translucentModels",Re),D(Re?"Translucent components visible":"Translucent components hidden",1500)},{shortcut:"shift+v",description:"Toggle translucent components"}),Sh.useEffect(()=>{if(A.current)Zqi(A.current)},[]),Sh.useEffect(()=>{window.localStorage.setItem("cadViewerEngine",p)},[p]),Sh.useEffect(()=>{window.localStorage.setItem("cadViewerAutoRotate",String(y))},[y]),Sh.useEffect(()=>{window.localStorage.setItem("cadViewerAutoRotateUserToggled",String(C))},[C]),Sh.useEffect(()=>{window.localStorage.setItem("cadViewerCameraType",B)},[B]);let Me=e.circuitJson?l:void 0;return u4.jsxs("div",{ref:A,style:{width:"100%",height:"100%",position:"relative",userSelect:"none",MozUserSelect:"none",msUserSelect:"none",WebkitUserSelect:"none",WebkitTouchCallout:"none"},...se,children:[r?u4.jsx(l$n,{..._,foldPcbs:a,autoRotateDisabled:e.autoRotateDisabled||!y,onUserInteraction:le,onCameraControllerReady:Ae,referenceObject:P}):p==="jscad"?u4.jsx($Wi,{..._,autoRotateDisabled:e.autoRotateDisabled||!y,cameraType:B,onUserInteraction:le,onCameraControllerReady:Ae,referenceObject:P}):u4.jsx(l$n,{..._,autoRotateDisabled:e.autoRotateDisabled||!y,cameraType:B,onUserInteraction:le,onCameraControllerReady:Ae,referenceObject:P}),K&&u4.jsx(Fqi,{componentName:j?.componentName,onHideComponent:j?()=>{d(j.cad_component_id),me()}:void 0,onUnhideAllComponents:h.size>0?()=>{u(),me()}:void 0,onViewSchematicComponent:O&&e.onViewSchematicComponent?()=>{e.onViewSchematicComponent?.(O),me()}:void 0,menuRef:ee,menuPos:J,engine:p,flexScene:r,foldPcbs:c,onFoldPcbsToggle:o?()=>{s(!c),v("Custom"),me()}:void 0,cameraPreset:I,autoRotate:y,referenceObject:P,onEngineSwitch:(Re)=>{m(Re),me()},onCameraPresetSelect:xe,onAutoRotateToggle:()=>{ue(),me()},onReferenceObjectSelect:(Re)=>{M((we)=>FGi(we,Re)),x(!1),b(!0),v("Custom"),me()},onDownloadGltf:()=>{de(),me()},onOpenKeyboardShortcuts:()=>{f(!0),me()}}),u4.jsx(eJi,{open:g,onClose:()=>f(!1)})]},Me)},Xoo=(e)=>{SYi();let t=Sh.useRef(null);return u4.jsx(Fpt.Provider,{value:t,children:u4.jsx(xGi,{defaultTarget:sJi,initialCameraPosition:aJi,initialCameraType:cJi(),children:u4.jsx(MYi,{children:u4.jsx(AGi,{children:u4.jsx(nJi,{children:u4.jsx(lJi,{...e})})})})})})},hJi=ih(yYi(),1);var zEa=ih(Hwe(),1),OEa=ih(weo(),1),VEa=ih(Hwe(),1);var GEa=(0,hJi.default)("tscircuit:3d-viewer:convert-circuit-json-to-3d-svg");var lro=Object.freeze({left:0,top:0,width:16,height:16}),pBe=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),sme=Object.freeze({...lro,...pBe}),Cmt=Object.freeze({...sme,body:"",hidden:!1}),dJi=Object.freeze({width:null,height:null}),hro=Object.freeze({...dJi,...pBe});function uJi(e,t=0){let n=e.replace(/^-?[0-9.]*/,"");function o(r){while(r<0)r+=4;return r%4}if(n===""){let r=parseInt(e);return isNaN(r)?0:o(r)}else if(n!==e){let r=0;switch(n){case"%":r=25;break;case"deg":r=90}if(r){let i=parseFloat(e.slice(0,e.length-n.length));if(isNaN(i))return 0;return i=i/r,i%1===0?o(i):0}}return t}var pJi=/[\s,]+/;function mJi(e,t){t.split(pJi).forEach((n)=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0}})}var dro={...hro,preserveAspectRatio:""};function joo(e){let t={...dro},n=(o,r)=>e.getAttribute(o)||r;return t.width=n("width",null),t.height=n("height",null),t.rotate=uJi(n("rotate","")),mJi(t,n("flip","")),t.preserveAspectRatio=n("preserveAspectRatio",n("preserveaspectratio","")),t}function _Ji(e,t){for(let n in dro)if(e[n]!==t[n])return!0;return!1}var uro=/^[a-z0-9]+(-[a-z0-9]+)*$/,ame=(e,t,n,o="")=>{let r=e.split(":");if(e.slice(0,1)==="@"){if(r.length<2||r.length>3)return null;o=r.shift().slice(1)}if(r.length>3||!r.length)return null;if(r.length>1){let a=r.pop(),c=r.pop(),l={provider:r.length>0?r[0]:o,prefix:c,name:a};return t&&!uBe(l)?null:l}let i=r[0],s=i.split("-");if(s.length>1){let a={provider:o,prefix:s.shift(),name:s.join("-")};return t&&!uBe(a)?null:a}if(n&&o===""){let a={provider:o,prefix:"",name:i};return t&&!uBe(a,n)?null:a}return null},uBe=(e,t)=>{if(!e)return!1;return!!((t&&e.prefix===""||!!e.prefix)&&!!e.name)};function gJi(e,t){let n=e.icons,o=e.aliases||Object.create(null),r=Object.create(null);function i(s){if(n[s])return r[s]=[];if(!(s in r)){r[s]=null;let a=o[s]&&o[s].parent,c=a&&i(a);if(c)r[s]=[a].concat(c)}return r[s]}return Object.keys(n).concat(Object.keys(o)).forEach(i),r}function AJi(e,t){let n={};if(!e.hFlip!==!t.hFlip)n.hFlip=!0;if(!e.vFlip!==!t.vFlip)n.vFlip=!0;let o=((e.rotate||0)+(t.rotate||0))%4;if(o)n.rotate=o;return n}function Koo(e,t){let n=AJi(e,t);for(let o in Cmt)if(o in pBe){if(o in e&&!(o in n))n[o]=pBe[o]}else if(o in t)n[o]=t[o];else if(o in e)n[o]=e[o];return n}function fJi(e,t,n){let o=e.icons,r=e.aliases||Object.create(null),i={};function s(a){i=Koo(o[a]||r[a],i)}return s(t),n.forEach(s),Koo(e,i)}function pro(e,t){let n=[];if(typeof e!=="object"||typeof e.icons!=="object")return n;if(e.not_found instanceof Array)e.not_found.forEach((r)=>{t(r,null),n.push(r)});let o=gJi(e);for(let r in o){let i=o[r];if(i)t(r,fJi(e,r,i)),n.push(r)}return n}var yJi={provider:"",aliases:{},not_found:{},...lro};function fmt(e,t){for(let n in t)if(n in e&&typeof e[n]!==typeof t[n])return!1;return!0}function mro(e){if(typeof e!=="object"||e===null)return null;let t=e;if(typeof t.prefix!=="string"||!e.icons||typeof e.icons!=="object")return null;if(!fmt(e,yJi))return null;let n=t.icons;for(let r in n){let i=n[r];if(!r||typeof i.body!=="string"||!fmt(i,Cmt))return null}let o=t.aliases||Object.create(null);for(let r in o){let i=o[r],s=i.parent;if(!r||typeof s!=="string"||!n[s]&&!o[s]||!fmt(i,Cmt))return null}return t}var mBe=Object.create(null);function xJi(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function UT(e,t){let n=mBe[e]||(mBe[e]=Object.create(null));return n[t]||(n[t]=xJi(e,t))}function _ro(e,t){if(!mro(t))return[];return pro(t,(n,o)=>{if(o)e.icons[n]=o;else e.missing.add(n)})}function CJi(e,t,n){try{if(typeof n.body==="string")return e.icons[t]={...n},!0}catch(o){}return!1}function bJi(e,t){let n=[];return(typeof e==="string"?[e]:Object.keys(mBe)).forEach((o)=>{(typeof o==="string"&&typeof t==="string"?[t]:Object.keys(mBe[o]||{})).forEach((r)=>{let i=UT(o,r);n=n.concat(Object.keys(i.icons).map((s)=>(o!==""?"@"+o+":":"")+r+":"+s))})}),n}var rme=!1;function gro(e){if(typeof e==="boolean")rme=e;return rme}function ime(e){let t=typeof e==="string"?ame(e,!0,rme):e;if(t){let n=UT(t.provider,t.prefix),o=t.name;return n.icons[o]||(n.missing.has(o)?null:void 0)}}function Aro(e,t){let n=ame(e,!0,rme);if(!n)return!1;let o=UT(n.provider,n.prefix);if(t)return CJi(o,n.name,t);else return o.missing.add(n.name),!0}function $oo(e,t){if(typeof e!=="object")return!1;if(typeof t!=="string")t=e.provider||"";if(rme&&!t&&!e.prefix){let r=!1;if(mro(e))e.prefix="",pro(e,(i,s)=>{if(Aro(i,s))r=!0});return r}let n=e.prefix;if(!uBe({prefix:n,name:"a"}))return!1;let o=UT(t,n);return!!_ro(o,e)}function IJi(e){return!!ime(e)}function vJi(e){let t=ime(e);return t?{...sme,...t}:t}function fro(e,t){e.forEach((n)=>{let o=n.loaderCallbacks;if(o)n.loaderCallbacks=o.filter((r)=>r.id!==t)})}function SJi(e){if(!e.pendingCallbacksFlag)e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;let t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1,{provider:o,prefix:r}=e;t.forEach((i)=>{let s=i.icons,a=s.pending.length;if(s.pending=s.pending.filter((c)=>{if(c.prefix!==r)return!0;let l=c.name;if(e.icons[l])s.loaded.push({provider:o,prefix:r,name:l});else if(e.missing.has(l))s.missing.push({provider:o,prefix:r,name:l});else return n=!0,!0;return!1}),s.pending.length!==a){if(!n)fro([e],i.id);i.callback(s.loaded.slice(0),s.missing.slice(0),s.pending.slice(0),i.abort)}})})}var PJi=0;function EJi(e,t,n){let o=PJi++,r=fro.bind(null,n,o);if(!t.pending.length)return r;let i={id:o,icons:t,callback:e,abort:r};return n.forEach((s)=>{(s.loaderCallbacks||(s.loaderCallbacks=[])).push(i)}),r}function MJi(e){let t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((r,i)=>{if(r.provider!==i.provider)return r.provider.localeCompare(i.provider);if(r.prefix!==i.prefix)return r.prefix.localeCompare(i.prefix);return r.name.localeCompare(i.name)});let o={provider:"",prefix:"",name:""};return e.forEach((r)=>{if(o.name===r.name&&o.prefix===r.prefix&&o.provider===r.provider)return;o=r;let{provider:i,prefix:s,name:a}=r,c=n[i]||(n[i]=Object.create(null)),l=c[s]||(c[s]=UT(i,s)),h;if(a in l.icons)h=t.loaded;else if(s===""||l.missing.has(a))h=t.missing;else h=t.pending;let d={provider:i,prefix:s,name:a};h.push(d)}),t}var bmt=Object.create(null);function qoo(e,t){bmt[e]=t}function Imt(e){return bmt[e]||bmt[""]}function wJi(e,t=!0,n=!1){let o=[];return e.forEach((r)=>{let i=typeof r==="string"?ame(r,t,n):r;if(i)o.push(i)}),o}function Emt(e){let t;if(typeof e.resources==="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5000,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}var ABe=Object.create(null);ABe[""]=Emt({resources:["https://api.iconify.design"]});function Joo(e,t){let n=Emt(t);if(n===null)return!1;return ABe[e]=n,!0}function fBe(e){return ABe[e]}function BJi(){return Object.keys(ABe)}var TJi={resources:[],index:0,timeout:2000,rotate:750,random:!1,dataAfterTimeout:!1};function DJi(e,t,n,o){let r=e.resources.length,i=e.random?Math.floor(Math.random()*r):e.index,s;if(e.random){let b=e.resources.slice(0);s=[];while(b.length>1){let I=Math.floor(Math.random()*b.length);s.push(b[I]),b=b.slice(0,I).concat(b.slice(I+1))}s=s.concat(b)}else s=e.resources.slice(i).concat(e.resources.slice(0,i));let a=Date.now(),c="pending",l=0,h,d=null,u=[],_=[];if(typeof o==="function")_.push(o);function p(){if(d)clearTimeout(d),d=null}function m(){if(c==="pending")c="aborted";p(),u.forEach((b)=>{if(b.status==="pending")b.status="aborted"}),u=[]}function A(b,I){if(I)_=[];if(typeof b==="function")_.push(b)}function g(){return{startTime:a,payload:t,status:c,queriesSent:l,queriesPending:u.length,subscribe:A,abort:m}}function f(){c="failed",_.forEach((b)=>{b(void 0,h)})}function y(){u.forEach((b)=>{if(b.status==="pending")b.status="aborted"}),u=[]}function x(b,I,v){let P=I!=="success";switch(u=u.filter((M)=>M!==b),c){case"pending":break;case"failed":if(P||!e.dataAfterTimeout)return;break;default:return}if(I==="abort"){h=v,f();return}if(P){if(h=v,!u.length)if(!s.length)f();else C();return}if(p(),y(),!e.random){let M=e.resources.indexOf(b.resource);if(M!==-1&&M!==e.index)e.index=M}c="completed",_.forEach((M)=>{M(v)})}function C(){if(c!=="pending")return;p();let b=s.shift();if(b===void 0){if(u.length){d=setTimeout(()=>{if(p(),c==="pending")y(),f()},e.timeout);return}f();return}let I={status:"pending",resource:b,callback:(v,P)=>{x(I,v,P)}};u.push(I),l++,d=setTimeout(C,e.rotate),n(b,t,I.callback)}return setTimeout(C),g}function yro(e){let t={...TJi,...e},n=[];function o(){n=n.filter((s)=>s().status==="pending")}function r(s,a,c){let l=DJi(t,s,a,(h,d)=>{if(o(),c)c(h,d)});return n.push(l),l}function i(s){return n.find((a)=>s(a))||null}return{query:r,find:i,setIndex:(s)=>{t.index=s},getIndex:()=>t.index,cleanup:o}}function Zoo(){}var ymt=Object.create(null);function NJi(e){if(!ymt[e]){let t=fBe(e);if(!t)return;let n={config:t,redundancy:yro(t)};ymt[e]=n}return ymt[e]}function xro(e,t,n){let o,r;if(typeof e==="string"){let i=Imt(e);if(!i)return n(void 0,424),Zoo;r=i.send;let s=NJi(e);if(s)o=s.redundancy}else{let i=Emt(e);if(i){o=yro(i);let s=e.resources?e.resources[0]:"",a=Imt(s);if(a)r=a.send}}if(!o||!r)return n(void 0,424),Zoo;return o.query(t,r,n)().abort}function ero(){}function RJi(e){if(!e.iconsLoaderFlag)e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,SJi(e)})}function QJi(e){let t=[],n=[];return e.forEach((o)=>{(o.match(uro)?t:n).push(o)}),{valid:t,invalid:n}}function nme(e,t,n){function o(){let r=e.pendingIcons;t.forEach((i)=>{if(r)r.delete(i);if(!e.icons[i])e.missing.add(i)})}if(n&&typeof n==="object")try{if(!_ro(e,n).length){o();return}}catch(r){console.error(r)}o(),RJi(e)}function tro(e,t){if(e instanceof Promise)e.then((n)=>{t(n)}).catch(()=>{t(null)});else t(e)}function kJi(e,t){if(!e.iconsToLoad)e.iconsToLoad=t;else e.iconsToLoad=e.iconsToLoad.concat(t).sort();if(!e.iconsQueueFlag)e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;let{provider:n,prefix:o}=e,r=e.iconsToLoad;if(delete e.iconsToLoad,!r||!r.length)return;let i=e.loadIcon;if(e.loadIcons&&(r.length>1||!i)){tro(e.loadIcons(r,o,n),(l)=>{nme(e,r,l)});return}if(i){r.forEach((l)=>{tro(i(l,o,n),(h)=>{nme(e,[l],h?{prefix:o,icons:{[l]:h}}:null)})});return}let{valid:s,invalid:a}=QJi(r);if(a.length)nme(e,a,null);if(!s.length)return;let c=o.match(uro)?Imt(n):null;if(!c){nme(e,s,null);return}c.prepare(n,o,s).forEach((l)=>{xro(n,l,(h)=>{nme(e,l.icons,h)})})})}var Mmt=(e,t)=>{let n=wJi(e,!0,gro()),o=MJi(n);if(!o.pending.length){let c=!0;if(t)setTimeout(()=>{if(c)t(o.loaded,o.missing,o.pending,ero)});return()=>{c=!1}}let r=Object.create(null),i=[],s,a;return o.pending.forEach((c)=>{let{provider:l,prefix:h}=c;if(h===a&&l===s)return;s=l,a=h,i.push(UT(l,h));let d=r[l]||(r[l]=Object.create(null));if(!d[h])d[h]=[]}),o.pending.forEach((c)=>{let{provider:l,prefix:h,name:d}=c,u=UT(l,h),_=u.pendingIcons||(u.pendingIcons=new Set);if(!_.has(d))_.add(d),r[l][h].push(d)}),i.forEach((c)=>{let l=r[c.provider][c.prefix];if(l.length)kJi(c,l)}),t?EJi(t,o,i):ero},LJi=(e)=>new Promise((t,n)=>{let o=typeof e==="string"?ame(e,!0):e;if(!o){n(e);return}Mmt([o||e],(r)=>{if(r.length&&o){let i=ime(o);if(i){t({...sme,...i});return}}n(e)})});function nro(e){try{let t=typeof e==="string"?JSON.parse(e):e;if(typeof t.body==="string")return{...t}}catch(t){}}function HJi(e,t){if(typeof e==="object")return{data:nro(e),value:e};if(typeof e!=="string")return{value:e};if(e.includes("{")){let i=nro(e);if(i)return{data:i,value:e}}let n=ame(e,!0,!0);if(!n)return{value:e};let o=ime(n);if(o!==void 0||!n.prefix)return{value:e,name:n,data:o};let r=Mmt([n],()=>t(e,n,ime(n)));return{value:e,name:n,loading:r}}var Cro=!1;try{Cro=navigator.vendor.indexOf("Apple")===0}catch(e){}function FJi(e,t){switch(t){case"svg":case"bg":case"mask":return t}if(t!=="style"&&(Cro||e.indexOf("<a")===-1))return"svg";return e.indexOf("currentColor")===-1?"bg":"mask"}var zJi=/(-?[0-9.]*[0-9]+[0-9.]*)/g,OJi=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function vmt(e,t,n){if(t===1)return e;if(n=n||100,typeof e==="number")return Math.ceil(e*t*n)/n;if(typeof e!=="string")return e;let o=e.split(zJi);if(o===null||!o.length)return e;let r=[],i=o.shift(),s=OJi.test(i);while(!0){if(s){let a=parseFloat(i);if(isNaN(a))r.push(i);else r.push(Math.ceil(a*t*n)/n)}else r.push(i);if(i=o.shift(),i===void 0)return r.join("");s=!s}}function VJi(e,t="defs"){let n="",o=e.indexOf("<"+t);while(o>=0){let r=e.indexOf(">",o),i=e.indexOf("</"+t);if(r===-1||i===-1)break;let s=e.indexOf(">",i);if(s===-1)break;n+=e.slice(r+1,i).trim(),e=e.slice(0,o).trim()+e.slice(s+1)}return{defs:n,content:e}}function YJi(e,t){return e?"<defs>"+e+"</defs>"+t:t}function GJi(e,t,n){let o=VJi(e);return YJi(o.defs,t+o.content+n)}var UJi=(e)=>e==="unset"||e==="undefined"||e==="none";function bro(e,t){let n={...sme,...e},o={...hro,...t},r={left:n.left,top:n.top,width:n.width,height:n.height},i=n.body;[n,o].forEach((m)=>{let A=[],{hFlip:g,vFlip:f,rotate:y}=m;if(g)if(f)y+=2;else A.push("translate("+(r.width+r.left).toString()+" "+(0-r.top).toString()+")"),A.push("scale(-1 1)"),r.top=r.left=0;else if(f)A.push("translate("+(0-r.left).toString()+" "+(r.height+r.top).toString()+")"),A.push("scale(1 -1)"),r.top=r.left=0;let x;if(y<0)y-=Math.floor(y/4)*4;switch(y=y%4,y){case 1:x=r.height/2+r.top,A.unshift("rotate(90 "+x.toString()+" "+x.toString()+")");break;case 2:A.unshift("rotate(180 "+(r.width/2+r.left).toString()+" "+(r.height/2+r.top).toString()+")");break;case 3:x=r.width/2+r.left,A.unshift("rotate(-90 "+x.toString()+" "+x.toString()+")")}if(y%2===1){if(r.left!==r.top)x=r.left,r.left=r.top,r.top=x;if(r.width!==r.height)x=r.width,r.width=r.height,r.height=x}if(A.length)i=GJi(i,'<g transform="'+A.join(" ")+'">',"</g>")});let{width:s,height:a}=o,{width:c,height:l}=r,h,d;if(s===null)d=a===null?"1em":a==="auto"?l:a,h=vmt(d,c/l);else h=s==="auto"?c:s,d=a===null?vmt(h,l/c):a==="auto"?l:a;let u={},_=(m,A)=>{if(!UJi(A))u[m]=A.toString()};_("width",h),_("height",d);let p=[r.left,r.top,c,l];return u.viewBox=p.join(" "),{attributes:u,viewBox:p,body:i}}function wmt(e,t){let n=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(let o in t)n+=" "+o+'="'+t[o]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+e+"</svg>"}function WJi(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ").replace(/:/g,"%3A").replace(/\//g,"%2F")}function XJi(e){return"data:image/svg+xml,"+WJi(e)}function Iro(e){return'url("'+XJi(e)+'")'}var jJi=()=>{let e;try{if(e=fetch,typeof e==="function")return e}catch(t){}},_Be=jJi();function KJi(e){_Be=e}function $Ji(){return _Be}function qJi(e,t){let n=fBe(e);if(!n)return 0;let o;if(!n.maxURL)o=0;else{let r=0;n.resources.forEach((s)=>{r=Math.max(r,s.length)});let i=t+".json?icons=";o=n.maxURL-r-n.path.length-i.length}return o}function JJi(e){return e===404}var ZJi=(e,t,n)=>{let o=[],r=qJi(e,t),i="icons",s={type:"icons",provider:e,prefix:t,icons:[]},a=0;return n.forEach((c,l)=>{if(a+=c.length+1,a>=r&&l>0)o.push(s),s={type:"icons",provider:e,prefix:t,icons:[]},a=c.length;s.icons.push(c)}),o.push(s),o};function eZi(e){if(typeof e==="string"){let t=fBe(e);if(t)return t.path}return"/"}var tZi=(e,t,n)=>{if(!_Be){n("abort",424);return}let o=eZi(t.provider);switch(t.type){case"icons":{let i=t.prefix,s=t.icons.join(","),a=new URLSearchParams({icons:s});o+=i+".json?"+a.toString();break}case"custom":{let i=t.uri;o+=i.slice(0,1)==="/"?i.slice(1):i;break}default:n("abort",400);return}let r=503;_Be(e+o).then((i)=>{let s=i.status;if(s!==200){setTimeout(()=>{n(JJi(s)?"abort":"next",s)});return}return r=501,i.json()}).then((i)=>{if(typeof i!=="object"||i===null){setTimeout(()=>{if(i===404)n("abort",i);else n("next",r)});return}setTimeout(()=>{n("success",i)})}).catch(()=>{n("next",r)})},nZi={prepare:ZJi,send:tZi};function oZi(e,t,n){UT(n||"",t).loadIcons=e}function rZi(e,t,n){UT(n||"",t).loadIcon=e}var xmt="data-style",vro="",Zte={};function gBe(e){return":host{display:inline-block;vertical-align:"+(e?"-0.125em":"0")+"}span,svg{display:block;margin:auto}"+vro}function iZi(e){return"adoptedStyleSheets"in e&&typeof CSSStyleSheet==="function"&&typeof CSSStyleSheet.prototype.replaceSync==="function"}function sZi(e){let t=e?"inline":"block",n=Zte[t];if(!n)n=Zte[t]=new CSSStyleSheet,n.replaceSync(gBe(e));return n}function aZi(e){vro=e,Zte.inline?.replaceSync(gBe(!0)),Zte.block?.replaceSync(gBe(!1))}function oro(e,t){if(iZi(e)){let o=sZi(t),r=e.adoptedStyleSheets;if(r.includes(o))return;e.adoptedStyleSheets=r.filter((i)=>i!==Zte.inline&&i!==Zte.block).concat(o);return}let n=Array.from(e.childNodes).find((o)=>o.hasAttribute&&o.hasAttribute(xmt));if(!n)n=document.createElement("style"),n.setAttribute(xmt,xmt),e.appendChild(n);n.textContent=gBe(t)}function Sro(){qoo("",nZi),gro(!0);let e;try{e=window}catch(n){}if(e){if(e.IconifyPreload!==void 0){let n=e.IconifyPreload,o="Invalid IconifyPreload syntax.";if(typeof n==="object"&&n!==null)(n instanceof Array?n:[n]).forEach((r)=>{try{if(typeof r!=="object"||r===null||r instanceof Array||typeof r.icons!=="object"||typeof r.prefix!=="string"||!$oo(r))console.error("Invalid IconifyPreload syntax.")}catch(i){console.error("Invalid IconifyPreload syntax.")}})}if(e.IconifyProviders!==void 0){let n=e.IconifyProviders;if(typeof n==="object"&&n!==null)for(let o in n){let r="IconifyProviders["+o+"] is invalid.";try{let i=n[o];if(typeof i!=="object"||!i||i.resources===void 0)continue;if(!Joo(o,i))console.error(r)}catch(i){console.error(r)}}}}return{iconLoaded:IJi,getIcon:vJi,listIcons:bJi,addIcon:Aro,addCollection:$oo,calculateSize:vmt,buildIcon:bro,iconToHTML:wmt,svgToURL:Iro,loadIcons:Mmt,loadIcon:LJi,addAPIProvider:Joo,setCustomIconLoader:rZi,setCustomIconsLoader:oZi,appendCustomStyle:aZi,_api:{getAPIConfig:fBe,setAPIModule:qoo,sendAPIQuery:xro,setFetch:KJi,getFetch:$Ji,listAPIProviders:BJi}}}var Smt={"background-color":"currentColor"},Pro={"background-color":"transparent"},rro={image:"var(--svg)",repeat:"no-repeat",size:"100% 100%"},iro={"-webkit-mask":Smt,mask:Smt,background:Pro};for(let e in iro){let t=iro[e];for(let n in rro)t[e+"-"+n]=rro[n]}function sro(e){return e?e+(e.match(/^[-0-9.]+$/)?"px":""):"inherit"}function cZi(e,t,n){let o=document.createElement("span"),r=e.body;if(r.indexOf("<a")!==-1)r+="<!-- "+Date.now()+" -->";let i=e.attributes,s=wmt(r,{...i,width:t.width+"",height:t.height+""}),a=Iro(s),c=o.style,l={"--svg":a,width:sro(i.width),height:sro(i.height),...n?Smt:Pro};for(let h in l)c.setProperty(h,l[h]);return o}var ome;function lZi(){try{ome=window.trustedTypes.createPolicy("iconify",{createHTML:(e)=>e})}catch(e){ome=null}}function hZi(e){if(ome===void 0)lZi();return ome?ome.createHTML(e):e}function dZi(e){let t=document.createElement("span"),n=e.attributes,o="";if(!n.width)o="width: inherit;";if(!n.height)o+="height: inherit;";if(o)n.style=o;let r=wmt(e.body,n);return t.innerHTML=hZi(r),t.firstChild}function Pmt(e){return Array.from(e.childNodes).find((t)=>{let n=t.tagName&&t.tagName.toUpperCase();return n==="SPAN"||n==="SVG"})}function aro(e,t){let n=t.icon.data,o=t.customisations,r=bro(n,o);if(o.preserveAspectRatio)r.attributes.preserveAspectRatio=o.preserveAspectRatio;let i=t.renderedMode,s;switch(i){case"svg":s=dZi(r);break;default:s=cZi(r,{...sme,...n},i==="mask")}let a=Pmt(e);if(a)if(s.tagName==="SPAN"&&a.tagName===s.tagName)a.setAttribute("style",s.getAttribute("style"));else e.replaceChild(s,a);else e.appendChild(s)}function cro(e,t,n){let o=n&&(n.rendered?n:n.lastRender);return{rendered:!1,inline:t,icon:e,lastRender:o}}function uZi(e="iconify-icon"){let t,n;try{t=window.customElements,n=window.HTMLElement}catch(a){return}if(!t||!n)return;let o=t.get(e);if(o)return o;let r=["icon","mode","inline","noobserver","width","height","rotate","flip"],i=class extends n{_shadowRoot;_initialised=!1;_state;_checkQueued=!1;_connected=!1;_observer=null;_visible=!0;constructor(){super();let a=this._shadowRoot=this.attachShadow({mode:"open"}),c=this.hasAttribute("inline");oro(a,c),this._state=cro({value:""},c),this._queueCheck()}connectedCallback(){this._connected=!0,this.startObserver()}disconnectedCallback(){this._connected=!1,this.stopObserver()}static get observedAttributes(){return r.slice(0)}attributeChangedCallback(a){switch(a){case"inline":{let c=this.hasAttribute("inline"),l=this._state;if(c!==l.inline)l.inline=c,oro(this._shadowRoot,c);break}case"noobserver":{if(this.hasAttribute("noobserver"))this.startObserver();else this.stopObserver();break}default:this._queueCheck()}}get icon(){let a=this.getAttribute("icon");if(a&&a.slice(0,1)==="{")try{return JSON.parse(a)}catch(c){}return a}set icon(a){if(typeof a==="object")a=JSON.stringify(a);this.setAttribute("icon",a)}get inline(){return this.hasAttribute("inline")}set inline(a){if(a)this.setAttribute("inline","true");else this.removeAttribute("inline")}get observer(){return this.hasAttribute("observer")}set observer(a){if(a)this.setAttribute("observer","true");else this.removeAttribute("observer")}restartAnimation(){let a=this._state;if(a.rendered){let c=this._shadowRoot;if(a.renderedMode==="svg")try{c.lastChild.setCurrentTime(0);return}catch(l){}aro(c,a)}}get status(){let a=this._state;return a.rendered?"rendered":a.icon.data===null?"failed":"loading"}_queueCheck(){if(!this._checkQueued)this._checkQueued=!0,setTimeout(()=>{this._check()})}_check(){if(!this._checkQueued)return;this._checkQueued=!1;let a=this._state,c=this.getAttribute("icon");if(c!==a.icon.value){this._iconChanged(c);return}if(!a.rendered||!this._visible)return;let l=this.getAttribute("mode"),h=joo(this);if(a.attrMode!==l||_Ji(a.customisations,h)||!Pmt(this._shadowRoot))this._renderIcon(a.icon,h,l)}_iconChanged(a){let c=HJi(a,(l,h,d)=>{let u=this._state;if(u.rendered||this.getAttribute("icon")!==l)return;let _={value:l,name:h,data:d};if(_.data)this._gotIconData(_);else u.icon=_});if(c.data)this._gotIconData(c);else this._state=cro(c,this._state.inline,this._state)}_forceRender(){if(!this._visible){let a=Pmt(this._shadowRoot);if(a)this._shadowRoot.removeChild(a);return}this._queueCheck()}_gotIconData(a){this._checkQueued=!1,this._renderIcon(a,joo(this),this.getAttribute("mode"))}_renderIcon(a,c,l){let h=FJi(a.data.body,l),d=this._state.inline;aro(this._shadowRoot,this._state={rendered:!0,icon:a,inline:d,customisations:c,attrMode:l,renderedMode:h})}startObserver(){if(!this._observer&&!this.hasAttribute("noobserver"))try{this._observer=new IntersectionObserver((a)=>{let c=a.some((l)=>l.isIntersecting);if(c!==this._visible)this._visible=c,this._forceRender()}),this._observer.observe(this)}catch(a){if(this._observer){try{this._observer.disconnect()}catch(c){}this._observer=null}}}stopObserver(){if(this._observer){if(this._observer.disconnect(),this._observer=null,this._visible=!0,this._connected)this._forceRender()}}};r.forEach((a)=>{if(!(a in i.prototype))Object.defineProperty(i.prototype,a,{get:function(){return this.getAttribute(a)},set:function(c){if(c!==null)this.setAttribute(a,c);else this.removeAttribute(a)}})});let s=Sro();for(let a in s)i[a]=i.prototype[a]=s[a];return t.define(e,i),i}var pZi=uZi()||Sro(),{iconLoaded:tMa,getIcon:nMa,listIcons:oMa,addIcon:rMa,addCollection:Ero,calculateSize:iMa,buildIcon:sMa,iconToHTML:aMa,svgToURL:cMa,loadIcons:lMa,loadIcon:hMa,setCustomIconLoader:dMa,setCustomIconsLoader:uMa,addAPIProvider:pMa,_api:mMa}=pZi;var Mro={prefix:"pixelarticons",icons:{"4g":{body:'<path fill="currentColor" d="M5 7H3v6h5v4h2V7H8v4H5zm16 0h-9v10h9v-6h-4v2h2v2h-5V9h7z"/>',hidden:!0},"4k":{body:'<path fill="currentColor" d="M3 7h2v4h4V7h2v10H9v-4H3zm10 0h2v4h2v2h-2v4h-2zm6 8h-2v-2h2zm0 0h2v2h-2zm0-6h-2v2h2zm0 0V7h2v2z"/>',hidden:!0},"4k-box":{body:'<path fill="currentColor" d="M3 4H1v16h22V4zm18 2v12H3V6zM7 8H5v5h4v3h2V8H9v3H7zm8 0h-2v8h2v-3h2v3h2v-3h-2v-2h2V8h-2v3h-2z"/>',hidden:!0},"5g":{body:'<path fill="currentColor" d="M10 7H3v6h5v2H3v2h7v-6H5V9h5zm11 0h-9v10h9v-6h-4v2h2v2h-5V9h7z"/>',hidden:!0},"a-arrow-down":{body:'<g fill="currentColor"><path d="M16 6h2v12h-2zm2 8h2v2h-2zm-4 0h2v2h-2zm4-2h4v2h-4zm-6 0h4v2h-4zM2 8h2v10H2zm6 0h2v10H8z"/><path d="M4 12h6v2H4zm0-6h4v2H4z"/></g>'},"a-arrow-down-sharp":{body:'<g fill="currentColor"><path d="M16 6h2v12h-2zm2 8h2v2h-2zm-4 0h2v2h-2zm4-2h4v2h-4zm-6 0h4v2h-4zM2 8h2v10H2zm6 0h2v10H8z"/><path d="M4 12h6v2H4zM2 6h8v2H2z"/></g>'},"a-arrow-up":{body:'<g fill="currentColor"><path d="M16 18h2V6h-2zm2-8h2V8h-2zm-4 0h2V8h-2zm4 2h4v-2h-4zm-6 0h4v-2h-4zM2 8h2v10H2zm6 0h2v10H8z"/><path d="M4 12h6v2H4zm0-6h4v2H4z"/></g>'},"a-arrow-up-sharp":{body:'<g fill="currentColor"><path d="M16 18h2V6h-2zm2-8h2V8h-2zm-4 0h2V8h-2zm4 2h4v-2h-4zm-6 0h4v-2h-4zM2 8h2v10H2zm6 0h2v10H8z"/><path d="M4 12h6v2H4zM2 6h8v2H2z"/></g>'},"ab-testing":{body:'<path fill="currentColor" d="M3 3h6v2H5v2h4v2H5v2h4v2H3zm6 8h2V9H9zm0-4h2V5H9zm4 4h8v10h-2v-4h-4v4h-2zm2 4h4v-2h-4zm0-12h6v6h-2V5h-4zM3 15h2v4h4v2H3z"/>',hidden:!0},ac:{body:'<path fill="currentColor" d="M13 2h-2v4H9V4H7v2h2v2h2v3H8V9H6V7H4v2h2v2H2v2h4v2H4v2h2v-2h2v-2h3v3H9v2H7v2h2v-2h2v4h2v-4h2v2h2v-2h-2v-2h-2v-3h3v2h2v2h2v-2h-2v-2h4v-2h-4V9h2V7h-2v2h-2v2h-3V8h2V6h2V4h-2v2h-2z"/>',hidden:!0},"add-box":{body:'<path fill="currentColor" d="M3 3h18v18H3zm16 16V5H5v14zm-6-8h4v2h-4v4h-2v-4H7v-2h4V7h2z"/>',hidden:!0},"add-box-multiple":{body:'<path fill="currentColor" d="M3 3h14v14H3zm12 12V5H5v10zm-8 6v-2h12V7h2v14zm4-12h2v2h-2v2H9v-2H7V9h2V7h2z"/>',hidden:!0},"add-col":{body:'<path fill="currentColor" d="M2 2h10v20H2v-2h8v-4H2v-2h8v-4H2V8h8V4H2zm17 9h3v2h-3v3h-2v-3h-3v-2h3V8h2z"/>',hidden:!0},"add-grid":{body:'<path fill="currentColor" d="M3 3h8v8H3zm6 6V5H5v4zm9 4h-2v3h-3v2h3v3h2v-3h3v-2h-3zM15 3h6v8h-8V3zm4 6V5h-4v4zM5 13h6v8H3v-8zm4 6v-4H5v4z"/>',hidden:!0},"add-row":{body:'<path fill="currentColor" d="M4 10V2H2v10h20V2h-2v8h-4V2h-2v8h-4V2H8v8zm9 9v3h-2v-3H8v-2h3v-3h2v3h3v2z"/>',hidden:!0},"ai-app-mac":{body:'<path fill="currentColor" d="M4 3h16v2H4zm0 16h6v2H4zM2 5h2v14H2zm18 0h2v8h-2zM6 7h2v2H6zm4 0h2v2h-2zm4 0h2v2h-2zm2 6h2v2h-2zm0 8h2v2h-2zm-4-4h2v2h-2zm8 0h2v2h-2zm-6-2h2v2h-2zm4 0h2v2h-2zm0 4h2v2h-2zm-4 0h2v2h-2z"/>'},"ai-app-mac-sharp":{body:'<path fill="currentColor" d="M2 3h20v2H2zm0 16h8v2H2zM2 5h2v14H2zm18 0h2v8h-2zM6 7h2v2H6zm4 0h2v2h-2zm4 0h2v2h-2zm2 6h2v2h-2zm0 8h2v2h-2zm-4-4h2v2h-2zm8 0h2v2h-2zm-6-2h2v2h-2zm4 0h2v2h-2zm0 4h2v2h-2zm-4 0h2v2h-2z"/>'},"ai-file":{body:'<g fill="currentColor"><path d="M6 4H4v8h2zm10-2H6v2h10zm4 4h-2v14h2zm-2 14h-4v2h4zM16 4h2v2h-2zm-4 0h2v6h-2z"/><path d="M12 8h6v2h-6zM2 16h2v6H2zm4 0h2v6H6zm4-2h2v8h-2zm-6 0h2v2H4zm0 4h2v2H4z"/></g>'},"ai-file-sharp":{body:'<g fill="currentColor"><path d="M6 4H4v8h2zm10-2H4v2h12zm4 4h-2v14h2zm0 14h-6v2h6zM16 4h2v2h-2zm-4 0h2v6h-2z"/><path d="M12 8h6v2h-6zM2 16h2v6H2zm4 0h2v6H6zm4-2h2v8h-2zm-8 0h6v2H2zm2 4h2v2H4z"/></g>'},"ai-scan":{body:'<path fill="currentColor" d="M9 11h2v2H9zm4 0h2v2h-2zM7 7h10v2H7zM5 9h2v6H5zm2 6h10v2H7zm10-6h2v6h-2zm-6-4h2v2h-2zM4 2h4v2H4zm0 18h4v2H4zM16 2h4v2h-4zm0 18h4v2h-4zM2 4h2v4H2zm0 12h2v4H2zM20 4h2v4h-2zm0 12h2v4h-2z"/>'},"ai-scan-sharp":{body:'<path fill="currentColor" d="M9 11h2v2H9zm4 0h2v2h-2zM5 7h14v2H5zm0 2h2v6H5zm0 6h14v2H5zm12-6h2v6h-2zm-6-4h2v2h-2zM2 2h6v2H2zm0 18h6v2H2zM16 2h6v2h-6zm0 18h6v2h-6zM2 4h2v4H2zm0 12h2v4H2zM20 4h2v4h-2zm0 12h2v4h-2z"/>'},"ai-settings-2":{body:'<g fill="currentColor"><path d="M18 2h2v2h-2zM4 2h2v2H4zm0 20h2v-2H4zM20 4h2v2h-2zM6 4h4v2H6zm0 16h4v-2H6zM18 6h2v4h-2zM4 6h2v4H4zm0 12h2v-4H4zM14 4h4v2h-4zM2 4h2v2H2zm0 16h2v-2H2z"/><path d="M8 2h2v4H8zm0 20h2v-4H8z"/><path d="M8 2h8v2H8zm0 20h4v-2H8zM2 8h2v8H2zm18 0h2v4h-2zM10 8h4v2h-4zm-2 2h2v4H8zm2 4h4v2h-4zm4-4h2v4h-2zm4 4h2v2h-2zm0 8h2v2h-2zm-4-4h2v2h-2zm8 0h2v2h-2zm-6-2h2v2h-2zm4 0h2v2h-2zm0 4h2v2h-2zm-4 0h2v2h-2z"/></g>'},"ai-settings-3":{body:'<g fill="currentColor"><path d="M4 2h2v2H4zm0 20h2v-2H4zM6 4h4v2H6zm0 16h4v-2H6zM4 6h2v4H4zm0 12h2v-4H4zM2 4h2v2H2zm0 16h2v-2H2z"/><path d="M8 2h2v4H8zm0 20h2v-4H8zM2 8h2v8H2zm8 0h3v2h-3zm4 3h4v2h-4zm2-8h2v2h-2zm-2 2h2v2h-2zm2 14h2v2h-2zm-2-2h2v2h-2zM10 2h3v2h-3zm0 18h3v2h-3zM8 10h2v4H8zm2 4h3v2h-3zm8-5h2v2h-2zm0-8h2v2h-2zm0 16h2v2h-2zm2-6h2v2h-2zm0-8h2v2h-2zm0 16h2v2h-2zm-2-6h2v2h-2zm0-8h2v2h-2zm0 16h2v2h-2z"/></g>'},"ai-user-circle":{body:'<path fill="currentColor" d="M6 2h8v2H6zm0 18h12v2H6zM4 4h2v2H4zM2 6h2v12H2zm20 4h-2v8h2zM4 18h2v2H4zm16 0h-2v2h2zM10 6h4v2h-4zM8 8h2v4H8zm2 4h4v2h-4zm4-4h2v4h-2zm-8 8h12v2H6zM18 2h2v2h-2zm-2 2h2v2h-2zm2 2h2v2h-2zm2-2h2v2h-2z"/>'},"ai-view":{body:'<path fill="currentColor" d="M2 15h2v2H2zm0 4h2v-2H2zm20-4h-2v2h2zm0 4h-2v-2h2zM4 13h4v2H4zm0 8h4v-2H4zm16-8h-4v2h4zm0 8h-4v-2h4zM8 11h8v2H8zm0 12h8v-2H8zm2-8h4v4h-4zm1-6V5h2v4zM3 7V5h2v2zm2 2V7h2v2zm14-2V5h2v2zm-2 2V7h2v2zM9 5V3h2v2zM1 5V3h2v2zm16 0V3h2v2zm-6-2V1h2v2zM3 3V1h2v2zm16 0V1h2v2zm-6 2V3h2v2zM5 5V3h2v2zm16 0V3h2v2z"/>'},"ai-voice":{body:'<path fill="currentColor" d="M4 3h16v2H4zm0 12h6v2H4zM2 5h2v10H2zm18 0h2v8h-2zM5 9h2v2H5zm3-2h2v6H8zm6 0h2v4h-2zm-3 2h2v3h-2zm5 4h2v2h-2zm0 8h2v2h-2zm-4-4h2v2h-2zm8 0h2v2h-2zm-6-2h2v2h-2zm4 0h2v2h-2zm0 4h2v2h-2zm-4 0h2v2h-2z"/>'},"ai-voice-sharp":{body:'<path fill="currentColor" d="M2 3h20v2H2zm0 12h8v2H2zM2 5h2v10H2zm18 0h2v8h-2zM5 9h2v2H5zm3-2h2v6H8zm6 0h2v4h-2zm-3 2h2v3h-2zm5 4h2v2h-2zm0 8h2v2h-2zm-4-4h2v2h-2zm8 0h2v2h-2zm-6-2h2v2h-2zm4 0h2v2h-2zm0 4h2v2h-2zm-4 0h2v2h-2z"/>'},airplay:{body:'<path fill="currentColor" d="M4 3h16v2H4zM2 5h2v12H2zm18 0h2v12h-2zM4 17h2v2H4zm14 0h2v2h-2zm-7-2h2v2h-2zm-2 2h4v2H9zm4 0h2v2h-2zm2 2h2v2h-2zm-8 0h8v2H7z"/>'},"airplay-sharp":{body:'<path fill="currentColor" d="M2 3h20v2H2zm0 2h2v12H2zm18 0h2v12h-2zM2 17h4v2H2zm16 0h4v2h-4zm-7-2h2v2h-2zm-2 2h4v2H9zm4 0h2v2h-2zm2 2h2v2h-2zm-8 0h8v2H7z"/>'},"alarm-clock":{body:'<path fill="currentColor" d="M8 5h8v2H8zm0 14h8v2H8zM6 7h2v2H6zm0 10h2v2H6zM16 7h2v2h-2zm0 10h2v2h-2zM4 9h2v8H4zm14 0h2v8h-2zM4 2h2v2H4zm0 17h2v2H4zm14 0h2v2h-2zm0-17h2v2h-2zM2 4h2v2H2zm18 0h2v2h-2zm-9 5h2v4h-2zm2 4h2v2h-2z"/>'},album:{body:'<g fill="currentColor"><path d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zm-4 0h2v8h-2zm-4 0h2v8h-2z"/><path d="M14 3h2v7h-2z"/></g>'},"album-sharp":{body:'<g fill="currentColor"><path d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zm-4 0h2v8h-2zm-4 0h2v8h-2z"/><path d="M14 3h2v7h-2z"/></g>'},alert:{body:'<path fill="currentColor" d="M13 1h-2v2H9v2H7v2H5v2H3v2H1v2h2v2h2v2h2v2h2v2h2v2h2v-2h2v-2h2v-2h2v-2h2v-2h2v-2h-2V9h-2V7h-2V5h-2V3h-2zm0 2v2h2v2h2v2h2v2h2v2h-2v2h-2v2h-2v2h-2v2h-2v-2H9v-2H7v-2H5v-2H3v-2h2V9h2V7h2V5h2V3zm0 4h-2v6h2zm0 8h-2v2h2z"/>',hidden:!0},algorithm:{body:'<g fill="currentColor"><path d="M11 16h4v2h-4zm-8 0h4v2H3zm16 0h4v2h-4zM9 16h2v6H9zm-8 0h2v6H1zm16 0h2v6h-2z"/><path d="M9 20h6v2H9zm-8 0h6v2H1zm16 0h6v2h-6z"/><path d="M13 16h2v6h-2zm-8 0h2v6H5zm16 0h2v6h-2zM8 8h8v2H8z"/><path d="M8 2h2v8H8z"/><path d="M8 2h8v2H8z"/><path d="M14 2h2v8h-2zM3 14h2v3H3zm2-2h14v2H5zm14 2h2v3h-2z"/><path d="M11 9h2v9h-2zm5-4h2v2h-2zm-5-5h2v2h-2zM6 5h2v2H6z"/></g>'},"algorithm-sharp":{body:'<g fill="currentColor"><path d="M11 16h4v2h-4zm-8 0h4v2H3zm16 0h4v2h-4zM9 16h2v6H9zm-8 0h2v6H1zm16 0h2v6h-2z"/><path d="M9 20h6v2H9zm-8 0h6v2H1zm16 0h6v2h-6z"/><path d="M13 16h2v6h-2zm-8 0h2v6H5zm16 0h2v6h-2zM8 8h8v2H8z"/><path d="M8 2h2v8H8z"/><path d="M8 2h8v2H8z"/><path d="M14 2h2v8h-2zM3 14h2v3H3zm0-2h18v2H3zm16 2h2v3h-2z"/><path d="M11 9h2v9h-2zm5-4h2v2h-2zm-5-5h2v2h-2zM6 5h2v2H6z"/></g>'},alien:{body:'<path fill="currentColor" d="M14 22h-4v-2h4zm-4-2H8v-2h2zm6 0h-2v-2h2zm-8-2H6v-2h2zm10 0h-2v-2h2zm-5-1h-2v-2h2zm-7-1H4v-2h2zm14 0h-2v-2h2zM4 14H2V6h2zm18 0h-2V6h2zm-12-4h1v3H8v-1H6V8h4zm8 2h-2v1h-3v-3h1V8h4zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"align-center":{body:'<path fill="currentColor" d="M20 5H4v2h16zm-4 4H8v2h8zM4 13h16v2H4zm12 4H8v2h8z"/>',hidden:!0},"align-center-horizontal":{body:'<path fill="currentColor" d="M5 2h4v2H5zm10 3h4v2h-4zm0 14h4v-2h-4zM3 15h2v5H3zM3 4h2v5H3zm10 3h2v2h-2zm0 10h2v-2h-2zm-8 3h4v2H5zm4-5h2v5H9zM9 4h2v5H9zm10 3h2v2h-2zm0 10h2v-2h-2zM2 11h20v2H2z"/>'},"align-center-horizontal-sharp":{body:'<path fill="currentColor" d="M3 2h8v2H3zm10 3h8v2h-8zm0 14h8v-2h-8zM3 15h2v5H3zM3 4h2v5H3zm10 3h2v2h-2zm0 10h2v-2h-2zM3 20h8v2H3zm6-5h2v5H9zM9 4h2v5H9zm10 3h2v2h-2zm0 10h2v-2h-2zM2 11h20v2H2z"/>'},"align-center-vertical":{body:'<path fill="currentColor" d="M22 5v4h-2V5zm-3 10v4h-2v-4zM5 15v4h2v-4zM9 3v2H4V3zm11 0v2h-5V3zm-3 10v2h-2v-2zM7 13v2h2v-2zM4 5v4H2V5zm5 4v2H4V9zm11 0v2h-5V9zm-3 10v2h-2v-2zM7 19v2h2v-2zm6-17v20h-2V2z"/>'},"align-center-vertical-sharp":{body:'<path fill="currentColor" d="M22 3v8h-2V3zm-3 10v8h-2v-8zM5 13v8h2v-8zM9 3v2H4V3zm11 0v2h-5V3zm-3 10v2h-2v-2zM7 13v2h2v-2zM4 3v8H2V3zm5 6v2H4V9zm11 0v2h-5V9zm-3 10v2h-2v-2zM7 19v2h2v-2zm6-17v20h-2V2z"/>'},"align-end-horizontal":{body:'<path fill="currentColor" d="M5 2h4v2H5zM3 4h2v12H3zm2 12h4v2H5zM9 4h2v12H9zm6 5h4v2h-4zm-2 2h2v5h-2zm2 5h4v2h-4zm4-5h2v5h-2zM2 20h20v2H2z"/>'},"align-end-horizontal-sharp":{body:'<path fill="currentColor" d="M3 2h8v2H3zm0 2h2v12H3zm0 12h8v2H3zM9 4h2v12H9zm4 5h8v2h-8zm0 2h2v5h-2zm0 5h8v2h-8zm6-5h2v5h-2zM2 20h20v2H2z"/>'},"align-end-vertical":{body:'<path fill="currentColor" d="M2 5v4h2V5zm2-2v2h12V3zm12 2v4h2V5zM4 9v2h12V9zm5 6v4h2v-4zm2-2v2h5v-2zm5 2v4h2v-4zm-5 4v2h5v-2zm9-17v20h2V2z"/>'},"align-end-vertical-sharp":{body:'<path fill="currentColor" d="M2 5v4h2V5zm0-2v2h16V3zm14 2v4h2V5zM2 9v2h16V9zm7 6v4h2v-4zm0-2v2h9v-2zm7 2v4h2v-4zm-7 4v2h9v-2zM20 2v20h2V2z"/>'},"align-horizontal-distribute-center":{body:'<path fill="currentColor" d="M5 8h4V6H5zm10 2h4V8h-4zm-6 6h2V8H9zm10-2h2v-4h-2zM5 18h4v-2H5zm10-2h4v-2h-4zM3 16h2V8H3zm10-2h2v-4h-2zM6 2h2v4H6zm0 16h2v4H6zm10-2h2v6h-2zm0-14h2v6h-2z"/>'},"align-horizontal-distribute-center-sharp":{body:'<path fill="currentColor" d="M5 8h4V6H5zm10 2h4V8h-4zm-6 8h2V6H9zm10-2h2V8h-2zM5 18h4v-2H5zm10-2h4v-2h-4zM3 18h2V6H3zm10-2h2V8h-2zM6 2h2v4H6zm0 16h2v4H6zm10-2h2v6h-2zm0-14h2v6h-2z"/>'},"align-horizontal-distribute-end":{body:'<path fill="currentColor" d="M9 4H6v2h3zm2-2H9v20h2zM9 18H6v2h3zM6 6H4v12h2zm9 1h3v2h-3zm-2 2h2v6h-2zm2 6h3v2h-3zm3-13h2v20h-2z"/>'},"align-horizontal-distribute-end-sharp":{body:'<path fill="currentColor" d="M9 4H6v2h3zm2-2H9v20h2zM9 18H6v2h3zM6 4H4v16h2zm9 3h3v2h-3zm-2 0h2v10h-2zm2 8h3v2h-3zm3-13h2v20h-2z"/>'},"align-horizontal-distribute-start":{body:'<path fill="currentColor" d="M6 4h3v2H6zM4 2h2v20H4zm2 16h3v2H6zM9 6h2v12H9zm9 1h-3v2h3zm2 2h-2v6h2zm-2 6h-3v2h3zM15 2h-2v20h2z"/>'},"align-horizontal-distribute-start-sharp":{body:'<path fill="currentColor" d="M6 4h3v2H6zM4 2h2v20H4zm2 16h3v2H6zM9 4h2v16H9zm9 3h-3v2h3zm2 0h-2v10h2zm-2 8h-3v2h3zM15 2h-2v20h2z"/>'},"align-horizontal-justify-center":{body:'<path fill="currentColor" d="M11 2v20h2V2zM7 4H4v2h3zm2 2H7v12h2zM7 18H4v2h3zM4 6H2v12h2zm13 1h3v2h-3zm-2 2h2v6h-2zm2 6h3v2h-3zm3-6h2v6h-2z"/>'},"align-horizontal-justify-center-sharp":{body:'<path fill="currentColor" d="M11 2v20h2V2zM7 4H4v2h3zm2 0H7v16h2zM7 18H4v2h3zM4 4H2v16h2zm13 3h3v2h-3zm-2 0h2v10h-2zm2 8h3v2h-3zm3-8h2v10h-2z"/>'},"align-horizontal-justify-end":{body:'<path fill="currentColor" d="M20 2v20h2V2zM7 4H4v2h3zm2 2H7v12h2zM7 18H4v2h3zM4 6H2v12h2zm9 1h3v2h-3zm-2 2h2v6h-2zm2 6h3v2h-3zm3-6h2v6h-2z"/>'},"align-horizontal-justify-end-sharp":{body:'<path fill="currentColor" d="M20 2v20h2V2zM7 4H4v2h3zm2 0H7v16h2zM7 18H4v2h3zM4 4H2v16h2zm9 3h3v2h-3zm-2 0h2v10h-2zm2 8h3v2h-3zm3-8h2v10h-2z"/>'},"align-horizontal-justify-start":{body:'<path fill="currentColor" d="M4 2v20H2V2zm4 2h3v2H8zM6 6h2v12H6zm2 12h3v2H8zm3-12h2v12h-2zm6 1h3v2h-3zm-2 2h2v6h-2zm2 6h3v2h-3zm3-6h2v6h-2z"/>'},"align-horizontal-justify-start-sharp":{body:'<path fill="currentColor" d="M4 2v20H2V2zm4 2h3v2H8zM6 4h2v16H6zm2 14h3v2H8zm3-14h2v16h-2zm6 3h3v2h-3zm-2 0h2v10h-2zm2 8h3v2h-3zm3-8h2v10h-2z"/>'},"align-horizontal-space-around":{body:'<path fill="currentColor" d="M10 6h4v2h-4zM8 8h2v8H8zm2 8h4v2h-4zm4-8h2v8h-2zM4 2v20h2V2zm14 0v20h2V2z"/>'},"align-horizontal-space-around-sharp":{body:'<path fill="currentColor" d="M10 6h4v2h-4zM8 6h2v12H8zm2 10h4v2h-4zm4-10h2v12h-2zM4 2v20h2V2zm14 0v20h2V2z"/>'},"align-horizontal-space-between":{body:'<path fill="currentColor" d="M5 4h3v2H5zM3 2h2v20H3zm2 16h3v2H5zM8 6h2v12H8zm8 1h3v2h-3zm-2 2h2v6h-2zm2 6h3v2h-3zm3-13h2v20h-2z"/>'},"align-horizontal-space-between-sharp":{body:'<path fill="currentColor" d="M5 4h3v2H5zM3 2h2v20H3zm2 16h3v2H5zM8 4h2v16H8zm8 3h3v2h-3zm-2 0h2v10h-2zm2 8h3v2h-3zm3-13h2v20h-2z"/>'},"align-justify":{body:'<path fill="currentColor" d="M20 5H4v2h16zm0 4H4v2h16zM4 13h16v2H4zm16 4H4v2h16z"/>',hidden:!0},"align-left":{body:'<path fill="currentColor" d="M20 5H4v2h16zm-8 4H4v2h8zm8 4v2H4v-2zm-8 4H4v2h8z"/>',hidden:!0},"align-right":{body:'<path fill="currentColor" d="M4 5h16v2H4zm8 4h8v2h-8zm-8 4v2h16v-2zm8 4h8v2h-8z"/>',hidden:!0},"align-start-horizontal":{body:'<path fill="currentColor" d="M5 22h4v-2H5zm-2-2h2V8H3zM5 8h4V6H5zm4 12h2V8H9zm6-5h4v-2h-4zm-2-2h2V8h-2zm2-5h4V6h-4zm4 5h2V8h-2zM2 4h20V2H2z"/>'},"align-start-horizontal-sharp":{body:'<path fill="currentColor" d="M5 22h4v-2H5zm-2 0h2V6H3zM5 8h4V6H5zm4 14h2V6H9zm6-7h4v-2h-4zm-2 0h2V6h-2zm2-7h4V6h-4zm4 7h2V6h-2zM2 4h20V2H2z"/>'},"align-start-vertical":{body:'<path fill="currentColor" d="M22 5v4h-2V5zm-2-2v2H8V3zM8 5v4H6V5zm12 4v2H8V9zm-5 6v4h-2v-4zm-2-2v2H8v-2zm-5 2v4H6v-4zm5 4v2H8v-2zM4 2v20H2V2z"/>'},"align-start-vertical-sharp":{body:'<path fill="currentColor" d="M22 5v4h-2V5zm0-2v2H6V3zM8 5v4H6V5zm14 4v2H6V9zm-7 6v4h-2v-4zm0-2v2H6v-2zm-7 2v4H6v-4zm7 4v2H6v-2zM4 2v20H2V2z"/>'},"align-vertical-distribute-center":{body:'<path fill="currentColor" d="M8 19v-4H6v4zm2-10V5H8v4zm6 6v-2H8v2zM14 5V3h-4v2zm4 14v-4h-2v4zM16 9V5h-2v4zm0 12v-2H8v2zm-2-10V9h-4v2zM2 18v-2h4v2zm16 0v-2h4v2zM16 8V6h6v2zM2 8V6h6v2z"/>'},"align-vertical-distribute-center-sharp":{body:'<path fill="currentColor" d="M8 19v-4H6v4zm2-10V5H8v4zm8 6v-2H6v2zM16 5V3H8v2zm2 14v-4h-2v4zM16 9V5h-2v4zm2 12v-2H6v2zm-2-10V9H8v2zM2 18v-2h4v2zm16 0v-2h4v2zM16 8V6h6v2zM2 8V6h6v2z"/>'},"align-vertical-distribute-end":{body:'<path fill="currentColor" d="M4 18v-3h2v3zm-2 2v-2h20v2zm16-2v-3h2v3zM6 15v-2h12v2zm1-9v3h2V6zm2-2v2h6V4zm6 2v3h2V6zM2 9v2h20V9z"/>'},"align-vertical-distribute-end-sharp":{body:'<path fill="currentColor" d="M4 18v-3h2v3zm-2 2v-2h20v2zm16-2v-3h2v3zM4 15v-2h16v2zm3-9v3h2V6zm0-2v2h10V4zm8 2v3h2V6zM2 9v2h20V9z"/>'},"align-vertical-distribute-start":{body:'<path fill="currentColor" d="M4 6v3h2V6zM2 4v2h20V4zm16 2v3h2V6zM6 9v2h12V9zm1 9v-3h2v3zm2 2v-2h6v2zm6-2v-3h2v3zM2 15v-2h20v2z"/>'},"align-vertical-distribute-start-sharp":{body:'<path fill="currentColor" d="M4 6v3h2V6zM2 4v2h20V4zm16 2v3h2V6zM4 9v2h16V9zm3 9v-3h2v3zm0 2v-2h10v2zm8-2v-3h2v3zM2 15v-2h20v2z"/>'},"align-vertical-justify-center":{body:'<path fill="currentColor" d="M2 13h20v-2H2zm2 4v3h2v-3zm2-2v2h12v-2zm12 2v3h2v-3zM6 20v2h12v-2zM7 7V4h2v3zm2 2V7h6v2zm6-2V4h2v3zM9 4V2h6v2z"/>'},"align-vertical-justify-center-sharp":{body:'<path fill="currentColor" d="M2 13h20v-2H2zm2 4v3h2v-3zm0-2v2h16v-2zm14 2v3h2v-3zM4 20v2h16v-2zM7 7V4h2v3zm0 2V7h10v2zm8-2V4h2v3zM7 4V2h10v2z"/>'},"align-vertical-justify-end":{body:'<path fill="currentColor" d="M2 20h20v2H2zm2-4v-3h2v3zm2 2v-2h12v2zm12-2v-3h2v3zM6 13v-2h12v2zm1-6V4h2v3zm2 2V7h6v2zm6-2V4h2v3zM9 4V2h6v2z"/>'},"align-vertical-justify-end-sharp":{body:'<path fill="currentColor" d="M2 20h20v2H2zm2-4v-3h2v3zm0 2v-2h16v2zm14-2v-3h2v3zM4 13v-2h16v2zm3-6V4h2v3zm0 2V7h10v2zm8-2V4h2v3zM7 4V2h10v2z"/>'},"align-vertical-justify-start":{body:'<path fill="currentColor" d="M2 4h20V2H2zm5 4v3h2V8zm2-2v2h6V6zm6 2v3h2V8zm-6 3v2h6v-2zm-5 6v3h2v-3zm2-2v2h12v-2zm12 2v3h2v-3zM6 20v2h12v-2z"/>'},"align-vertical-justify-start-sharp":{body:'<path fill="currentColor" d="M2 4h20V2H2zm5 4v3h2V8zm0-2v2h10V6zm8 2v3h2V8zm-8 3v2h10v-2zm-3 6v3h2v-3zm0-2v2h16v-2zm14 2v3h2v-3zM4 20v2h16v-2z"/>'},"align-vertical-space-around":{body:'<path fill="currentColor" d="M18 10v4h-2v-4zm-2-2v2H8V8zm-8 2v4H6v-4zm8 4v2H8v-2zm6-10H2v2h20zm0 14H2v2h20z"/>'},"align-vertical-space-around-sharp":{body:'<path fill="currentColor" d="M18 10v4h-2v-4zm0-2v2H6V8zM8 10v4H6v-4zm10 4v2H6v-2zm4-10H2v2h20zm0 14H2v2h20z"/>'},"align-vertical-space-between":{body:'<path fill="currentColor" d="M4 19v-3h2v3zm-2 2v-2h20v2zm16-2v-3h2v3zM6 16v-2h12v2zm1-8V5h2v3zm2 2V8h6v2zm6-2V5h2v3zM2 5V3h20v2z"/>'},"align-vertical-space-between-sharp":{body:'<path fill="currentColor" d="M4 19v-3h2v3zm-2 2v-2h20v2zm16-2v-3h2v3zM4 16v-2h16v2zm3-8V5h2v3zm0 2V8h10v2zm8-2V5h2v3zM2 5V3h20v2z"/>'},ampersand:{body:'<path fill="currentColor" d="M15 11h6v2h-6zm2 2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2h-2zm-8 2h8v2H5zm-2-6h2v6H3zm2-2h4v2H5zm4-2h4v2H9zm4-4h2v4h-2zM7 3h6v2H7zM5 5h2v4H5zm4 8h2v2H9zM7 9h2v2H7zm4 6h2v2h-2zm4 4h4v2h-4z"/>'},"ampersand-sharp":{body:'<path fill="currentColor" d="M15 11h6v2h-6zm2 2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2h-2zm-8 2h8v2H5zm-2-8h2v10H3zm2 0h4v2H5zm4-2h4v2H9zm4-4h2v4h-2zM5 3h10v2H5zm0 2h2v4H5zm4 8h2v2H9zM7 9h2v2H7zm4 6h2v2h-2zm4 4h4v2h-4z"/>'},analytics:{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zm-9 8h2v6h-2zm-4 2h2v4H7zm8-8h2v12h-2z"/>'},"analytics-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zm-9 8h2v6h-2zm-4 2h2v4H7zm8-8h2v12h-2z"/>'},anchor:{body:'<g fill="currentColor"><path d="M10 2h4v2h-4zm0 6h4v2h-4zM8 4h2v4H8zm6 0h2v4h-2z"/><path d="M11 9h2v12h-2z"/><path d="M5 20h14v2H5zm-2-8h2v8H3zm16 0h2v8h-2zM5 12h2v2H5zm12 0h2v2h-2z"/></g>'},"anchor-sharp":{body:'<g fill="currentColor"><path d="M8 2h8v2H8zm0 6h8v2H8zm0-4h2v4H8zm6 0h2v4h-2z"/><path d="M11 9h2v12h-2z"/><path d="M5 20h14v2H5zm-2-8h2v10H3zm16 0h2v10h-2zM5 12h2v2H5zm12 0h2v2h-2z"/></g>'},android:{body:'<path fill="currentColor" d="M2 12h2v6H2zm18 0h2v6h-2zM4 10h2v2H4zm4 2h2v4H8zm6 0h2v4h-2zm6-2h-2v2h2zM6 8h2v2H6zM4 6h2v2H4zM2 4h2v2H2zm16 4h-2v2h2zm2-2h-2v2h2zm2-2h-2v2h2zM8 6h8v2H8zM2 18h20v2H2z"/>'},"android-solid":{body:'<path fill="currentColor" d="M16 8h2v2h2v2h2v8H2v-8h2v-2h2V8h2V6h8zm-8 8h2v-4H8zm6-4v4h2v-4zM6 8H4V6h2zm14 0h-2V6h2zM4 6H2V4h2zm18 0h-2V4h2z"/>'},angry:{body:'<path fill="currentColor" d="M6 20h12v2H6zM6 2h12v2H6zm12 2h2v2h-2zM4 4h2v2H4zm0 14h2v2H4zm14 0h2v2h-2zM2 6h2v12H2zm18 0h2v12h-2zM7 7h2v2H7zm2 2h2v2H9zm6-2h2v2h-2zm-2 2h2v2h-2zm-6 6h2v2H7zm2-2h6v2H9zm6 2h2v2h-2z"/>'},"angry-sharp":{body:'<g fill="currentColor"><path d="M2 20h20v2H2zM2 2h20v2H2z"/><path d="M2 2h2v20H2zm18 0h2v20h-2zM7 7h2v2H7zm2 2h2v2H9zm6-2h2v2h-2zm-2 2h2v2h-2zm-6 6h2v2H7zm2-2h6v2H9zm6 2h2v2h-2z"/></g>'},animation:{body:'<path fill="currentColor" d="M4 2H2v12h2V4h10V2zm2 4h12v2H8v10H6zm4 4h12v12H10zm10 10v-8h-8v8z"/>',hidden:!0},annoyed:{body:'<path fill="currentColor" d="M6 20h12v2H6zM6 2h12v2H6zm12 2h2v2h-2zM4 4h2v2H4zm0 14h2v2H4zm14 0h2v2h-2zM2 6h2v12H2zm18 0h2v12h-2zM7 8h3v2H7zm7 0h3v2h-3zm-7 6h10v2H7z"/>'},"annoyed-sharp":{body:'<path fill="currentColor" d="M2 20h20v2H2zM2 2h20v2H2zm0 2h2v16H2zm18 0h2v16h-2zM7 8h3v2H7zm7 0h3v2h-3zm-7 6h10v2H7z"/>'},"app-mac":{body:'<path fill="currentColor" d="M4 3h16v2H4zm0 16h16v2H4zM2 5h2v14H2zm18 0h2v14h-2zM6 7h2v2H6zm4 0h2v2h-2zm4 0h2v2h-2z"/>'},"app-mac-sharp":{body:'<path fill="currentColor" d="M2 3h20v2H2zm0 16h20v2H2zM2 5h2v14H2zm18 0h2v14h-2zM6 7h2v2H6zm4 0h2v2h-2zm4 0h2v2h-2z"/>'},"app-windows":{body:'<path fill="currentColor" d="M4 3h16v2H4zm0 16h16v2H4zM2 5h2v14H2zm18 0h2v14h-2zM4 7h16v2H4zm8-2h2v2h-2zm4 0h2v2h-2z"/>'},"app-windows-sharp":{body:'<path fill="currentColor" d="M2 3h20v2H2zm0 16h20v2H2zM2 5h2v14H2zm18 0h2v14h-2zM4 7h16v2H4zm8-2h2v2h-2zm4 0h2v2h-2z"/>'},apple:{body:'<path fill="currentColor" d="M11 8h3v2h-3zm3-2h4v2h-4zm4 2h2v3h-2zm-2 3h2v4h-2zm2 4h2v5h-2zm-4 5h4v2h-4zm-3-2h3v2h-3zm-4 2h4v2H7zm-2-2h2v2H5zm-2-8h2v8H3zm2-2h2v2H5zm2-2h4v2H7zm5-3h2v2h-2zm2-2h2v2h-2z"/>'},"apple-solid":{body:'<path fill="currentColor" d="M11 8h3V6h4v2h2v3h-2v4h2v5h-2v2h-4v-2h-3v2H7v-2H5v-2H3v-8h2V8h2V6h4zm3-3h-2V3h2zm2-2h-2V1h2z"/>'},archive:{body:'<path fill="currentColor" d="M3 2h18v2H3zm0 5h18v2H3zM1 4h2v3H1zm20 0h2v3h-2zm-2 5h2v11h-2zM3 9h2v11H3zm2 11h14v2H5zm4-9h6v2H9z"/>'},"archive-sharp":{body:'<path fill="currentColor" d="M1 2h22v2H1zm0 5h22v2H1zm0-3h2v3H1zm20 0h2v3h-2zm-2 5h2v11h-2zM3 9h2v11H3zm0 11h18v2H3zm6-9h6v2H9z"/>'},"arrow-bar-down":{body:'<path fill="currentColor" d="M4 20h16v2H4zm7-18h2v16h-2zm2 12h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2zm-8 4h2v2H9zm-2-2h2v2H7zm-2-2h2v2H5z"/>'},"arrow-bar-left":{body:'<path fill="currentColor" d="M4 4v16H2V4zm18 7v2H6v-2zm-12 2v2H8v-2zm2 2v2h-2v-2zm2 2v2h-2v-2zm-4-8v2H8V9zm2-2v2h-2V7zm2-2v2h-2V5z"/>'},"arrow-bar-right":{body:'<path fill="currentColor" d="M20 4v16h2V4zM2 11v2h16v-2zm12 2v2h2v-2zm-2 2v2h2v-2zm-2 2v2h2v-2zm4-8v2h2V9zm-2-2v2h2V7zm-2-2v2h2V5z"/>'},"arrow-bar-up":{body:'<path fill="currentColor" d="M4 4h16V2H4zm7 18h2V6h-2zm2-12h2V8h-2zm2 2h2v-2h-2zm2 2h2v-2h-2zm-8-4h2V8H9zm-2 2h2v-2H7zm-2 2h2v-2H5z"/>'},"arrow-big-down":{body:'<path fill="currentColor" d="M8 3h8v2H8zm0 2h2v6H8zm-5 6h5v2H3zm0 2h2v2H3zm2 2h2v2H5zm2 2h2v2H7zm2 2h2v2H9zm2 2h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2zm2-4h2v4h-2zm-3 0h3v2h-3zm-2-6h2v6h-2z"/>'},"arrow-big-down-dash":{body:'<g fill="currentColor"><path d="M8 3h8v2H8zm0 4h8v2H8z"/><path d="M8 7h2v4H8zm-5 4h5v2H3zm0 2h2v2H3zm2 2h2v2H5zm2 2h2v2H7zm2 2h2v2H9zm2 2h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2zm2-4h2v4h-2zm-3 0h3v2h-3zm-2-4h2v4h-2z"/></g>'},"arrow-big-down-dash-sharp":{body:'<g fill="currentColor"><path d="M8 3h8v2H8zm0 4h8v2H8z"/><path d="M8 7h2v6H8zm-5 4h5v2H3zm0 2h2v2H3zm2 2h2v2H5zm2 2h2v2H7zm2 2h2v2H9zm2 2h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2zm2-4h2v4h-2zm-3 0h3v2h-3zm-2-4h2v6h-2z"/></g>'},"arrow-big-down-sharp":{body:'<path fill="currentColor" d="M8 3h8v2H8zm0 2h2v8H8zm-5 6h5v2H3zm0 2h2v2H3zm2 2h2v2H5zm2 2h2v2H7zm2 2h2v2H9zm2 2h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2zm2-4h2v4h-2zm-3 0h3v2h-3zm-2-6h2v8h-2z"/>'},"arrow-big-up":{body:'<path fill="currentColor" d="M8 21h8v-2H8zm0-2h2v-6H8zm-5-6h5v-2H3zm0-2h2V9H3zm2-2h2V7H5zm2-2h2V5H7zm2-2h2V3H9zm2-2h2V1h-2zm2 2h2V3h-2zm2 2h2V5h-2zm2 2h2V7h-2zm2 4h2V9h-2zm-3 0h3v-2h-3zm-2 6h2v-6h-2z"/>'},"arrow-big-up-dash":{body:'<g fill="currentColor"><path d="M8 21h8v-2H8zm0-4h8v-2H8z"/><path d="M8 17h2v-4H8zm-5-4h5v-2H3zm0-2h2V9H3zm2-2h2V7H5zm2-2h2V5H7zm2-2h2V3H9zm2-2h2V1h-2zm2 2h2V3h-2zm2 2h2V5h-2zm2 2h2V7h-2zm2 4h2V9h-2zm-3 0h3v-2h-3zm-2 4h2v-4h-2z"/></g>'},"arrow-big-up-dash-sharp":{body:'<g fill="currentColor"><path d="M8 21h8v-2H8zm0-4h8v-2H8z"/><path d="M8 17h2v-6H8zm-5-4h5v-2H3zm0-2h2V9H3zm2-2h2V7H5zm2-2h2V5H7zm2-2h2V3H9zm2-2h2V1h-2zm2 2h2V3h-2zm2 2h2V5h-2zm2 2h2V7h-2zm2 4h2V9h-2zm-3 0h3v-2h-3zm-2 4h2v-6h-2z"/></g>'},"arrow-big-up-sharp":{body:'<path fill="currentColor" d="M8 21h8v-2H8zm0-2h2v-8H8zm-5-6h5v-2H3zm0-2h2V9H3zm2-2h2V7H5zm2-2h2V5H7zm2-2h2V3H9zm2-2h2V1h-2zm2 2h2V3h-2zm2 2h2V5h-2zm2 2h2V7h-2zm2 4h2V9h-2zm-3 0h3v-2h-3zm-2 6h2v-8h-2z"/>'},"arrow-down":{body:'<path fill="currentColor" d="M13 12h6v2h-2v2h-2v2h-2v2h-2v-2H9v-2H7v-2H5v-2h6V4h2z"/>'},"arrow-down-box":{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zm-9 12h2v2h-2zm0-10h2v6h-2zm-2 8h6v2H9zm-2-2h10v2H7z"/>'},"arrow-down-box-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zm-9 12h2v2h-2zm0-10h2v6h-2zm-2 8h6v2H9zm-2-2h10v2H7z"/>'},"arrow-down-circle":{body:'<path fill="currentColor" d="M11 16h2v2h-2zm0-10h2v6h-2zm-2 8h6v2H9zm-2-2h10v2H7zm11 6h2v2h-2zm0-14h2v2h-2zM4 4h2v2H4zm0 14h2v2H4zM6 2h12v2H6zm0 18h12v2H6zM2 6h2v12H2zm18 0h2v12h-2z"/>'},"arrow-down-diamond":{body:'<path fill="currentColor" d="M11 16h2v2h-2zm0-10h2v6h-2zm-2 8h6v2H9zm-2-2h10v2H7zm4-11h2v2h-2zm2 2h2v2h-2zm-2 0H9v2h2zm4 2h2v2h-2zM9 5H7v2h2zm8 2h2v2h-2zM7 7H5v2h2zm12 2h2v2h-2zM5 9H3v2h2zm16 2h2v2h-2zM3 11H1v2h2zm16 2h2v2h-2zM5 13H3v2h2zm12 2h2v2h-2zM7 15H5v2h2zm8 2h2v2h-2zm-6 0H7v2h2zm4 2h2v2h-2zm-2 0H9v2h2zm0 2h2v2h-2z"/>'},"arrow-down-narrow-wide":{body:'<g fill="currentColor"><path d="M6 3h2v18H6z"/><path d="M4 17h6v2H4zm-2-2h10v2H2zm8-12h6v2h-6zm0 4h9v2h-9zm0 4h12v2H10z"/></g>'},"arrow-down-wide-narrow":{body:'<g fill="currentColor"><path d="M6 3h2v18H6z"/><path d="M4 17h6v2H4zm-2-2h10v2H2zm8-2h6v-2h-6zm0-4h9V7h-9zm0-4h12V3H10z"/></g>'},"arrow-down-z-a":{body:'<g fill="currentColor"><path d="M14 3h7v2h-7zm0 6h7v2h-7zm2-2h2v2h-2zm2-2h2v2h-2zM6 3h2v18H6z"/><path d="M4 17h6v2H4zm-2-2h10v2H2zm12 0h2v6h-2zm2-2h3v2h-3zm3 2h2v6h-2zm-3 2h3v2h-3z"/></g>'},"arrow-down-z-a-sharp":{body:'<g fill="currentColor"><path d="M14 3h7v2h-7zm0 6h7v2h-7zm2-2h2v2h-2zm2-2h2v2h-2zM6 3h2v18H6z"/><path d="M4 17h6v2H4zm-2-2h10v2H2zm12 0h2v6h-2zm0-2h7v2h-7zm5 2h2v6h-2zm-3 2h3v2h-3z"/></g>'},"arrow-left":{body:'<g fill="currentColor"><path d="M20 11v2H4v-2zM8 13v2H6v-2zm2 2v2H8v-2zm2 2v2h-2v-2zm-4-6V9H6v2z"/><path d="M10 15V7H8v8zm2 2V5h-2v12z"/></g>'},"arrow-left-box":{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zM8.067 11.009v2h-2v-2zm10 0v2h-6v-2zm-8-2v6h-2v-6zm2-2v10h-2v-10z"/>'},"arrow-left-box-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zM8.067 11.009v2h-2v-2zm10 0v2h-6v-2zm-8-2v6h-2v-6zm2-2v10h-2v-10z"/>'},"arrow-right":{body:'<g fill="currentColor"><path d="M4 11v2h16v-2zm12 2v2h2v-2zm-2 2v2h2v-2zm-2 2v2h2v-2zm4-6V9h2v2z"/><path d="M14 15V7h2v8zm-2 2V5h2v12z"/></g>'},"arrow-right-box":{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zm-3.933 7.009v2h2v-2zm-10 0v2h6v-2zm8-2v6h2v-6zm-2-2v10h2v-10z"/>'},"arrow-right-box-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zm-3.933 7.009v2h2v-2zm-10 0v2h6v-2zm8-2v6h2v-6zm-2-2v10h2v-10z"/>'},"arrow-up":{body:'<g fill="currentColor"><path d="M11 20h2V4h-2zm2-12h2V6h-2zm2 2h2V8h-2zm2 2h2v-2h-2zm-6-4H9V6h2z"/><path d="M15 10H7V8h8zm2 2H5v-2h12z"/></g>'},"arrow-up-box":{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zm-8.933 4.009h2v-2h-2zm0 10h2v-6h-2zm-2-8h6v-2h-6zm-2 2h10v-2h-10z"/>'},"arrow-up-box-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zm-8.933 4.009h2v-2h-2zm0 10h2v-6h-2zm-2-8h6v-2h-6zm-2 2h10v-2h-10z"/>'},"arrow-up-narrow-wide":{body:'<g fill="currentColor"><path d="M6 21h2V3H6z"/><path d="M4 7h6V5H4zM2 9h10V7H2zm8 2h6v2h-6zm0 4h9v2h-9zm0 4h12v2H10z"/></g>'},"arrow-up-wide-narrow":{body:'<g fill="currentColor"><path d="M6 21h2V3H6z"/><path d="M4 7h6V5H4zM2 9h10V7H2zm8 12h6v-2h-6zm0-4h9v-2h-9zm0-4h12v-2H10z"/></g>'},"arrow-up-z-a":{body:'<g fill="currentColor"><path d="M14 9h7v2h-7zm0-6h7v2h-7zm2 4h2v2h-2zm2-2h2v2h-2zM6 21h2V3H6z"/><path d="M4 7h6V5H4zM2 9h10V7H2zm12 6h2v6h-2zm2-2h3v2h-3zm3 2h2v6h-2zm-3 2h3v2h-3z"/></g>'},"arrow-up-z-a-sharp":{body:'<g fill="currentColor"><path d="M14 9h7v2h-7zm0-6h7v2h-7zm2 4h2v2h-2zm2-2h2v2h-2zM6 21h2V3H6z"/><path d="M4 7h6V5H4zM2 9h10V7H2zm12 6h2v6h-2zm0-2h7v2h-7zm5 2h2v6h-2zm-3 2h3v2h-3z"/></g>'},"arrows-horizontal":{body:'<g fill="currentColor"><path d="M13 13v-2h10v2zm6 2v-2h2v2zm-2 2v-2h2v2zm2-6V9h2v2z"/><path d="M17 15V7h2v8zm-6-2v-2H1v2zm-6 2v-2H3v2zm2 2v-2H5v2zm-2-6V9H3v2z"/><path d="M7 15V7H5v8z"/></g>'},"arrows-vertical":{body:'<g fill="currentColor"><path d="M13 11h-2V1h2zm2-6h-2V3h2zm2 2h-2V5h2zm-6-2H9V3h2z"/><path d="M15 7H7V5h8zm-2 6h-2v10h2zm2 6h-2v2h2zm2-2h-2v2h2zm-6 2H9v2h2z"/><path d="M15 17H7v2h8z"/></g>'},"art-text":{body:'<path fill="currentColor" d="M2 7h10v10H2zm8 8V9H4v6zm12-8h-8v2h8zm-8 4h8v2h-8zm8 4h-8v2h8z"/>',hidden:!0},article:{body:'<path fill="currentColor" d="M8 2h12v2H8zM6 4h2v16H6zm14 0h2v16h-2zM4 20h16v2H4zm-2-9h2v9H2zm2-2h2v2H4zm6-3h8v2h-8zm0 4h8v2h-8zm0-2h2v2h-2zm6 0h2v2h-2zm-6 5h8v2h-8zm0 3h4v2h-4z"/>'},"article-multiple":{body:'<path fill="currentColor" d="M3 1H1v18h18V1zm14 2v14H3V3zm4 18H5v2h18V5h-2zM15 5H5v2h10zM5 9h10v2H5zm7 4H5v2h7z"/>',hidden:!0},"article-sharp":{body:'<path fill="currentColor" d="M6 2h16v2H6zm0 2h2v16H6zm14 0h2v16h-2zM2 20h20v2H2zm0-9h2v9H2zm0-2h4v2H2zm8-3h8v2h-8zm0 4h8v2h-8zm0-2h2v2h-2zm6 0h2v2h-2zm-6 5h8v2h-8zm0 3h4v2h-4z"/>'},"aspect-ratio":{body:'<path fill="currentColor" d="M4 4h16v2H4zM2 6h2v12H2zm2 12h16v2H4zM20 6h2v12h-2zM6 8h4v2H6zm8 6h4v2h-4zm-8-4h2v2H6zm10 2h2v2h-2z"/>'},"aspect-ratio-sharp":{body:'<path fill="currentColor" d="M2 4h20v2H2zm0 2h2v12H2zm0 12h20v2H2zM20 6h2v12h-2zM6 8h4v2H6zm8 6h4v2h-4zm-8-4h2v2H6zm10 2h2v2h-2z"/>'},at:{body:'<path fill="currentColor" d="M4 4h16v12H8V8h8v6h2V6H6v12h14v2H4zm10 10v-4h-4v4z"/>',hidden:!0},"at-sign":{body:'<g fill="currentColor"><path d="M9 8h6v2H9zm0 6h8v2H9zm-2 0v-4h2v4z"/><path d="M13 14V8h2v6zm4-8h2v8h-2zM7 4h10v2H7zM3 8h2v8H3zm4 10h12v2H7zm-2-2h2v2H5zm14 0h2v2h-2zM5 6h2v2H5z"/></g>'},"at-sign-sharp":{body:'<g fill="currentColor"><path d="M9 8h6v2H9zm0 6h8v2H9zm-2 2V8h2v8z"/><path d="M13 14V8h2v6zm4-10h2v12h-2zM3 4h14v2H3zm0 2h2v12H3zm0 12h16v2H3z"/></g>'},attachment:{body:'<path fill="currentColor" d="M7 7v10H5V7zm12 0v12h-2V7zm-8 2v10H9V9zm4 0v8h-2V9zm0-6v2H9V3zm-2 4v2h-2V7zm4 12v2h-6v-2zm0-14v2h-2V5zM9 5v2H7V5z"/>'},"attachment-sharp":{body:'<path fill="currentColor" d="M7 3v14H5V3zm12 0v16h-2V3zm-8 6v10H9V9zm4 0v8h-2V9zm2-6v2H7V3zm-2 4v2H9V7zm4 12v2H9v-2z"/>'},"audio-device":{body:'<path fill="currentColor" d="M4 4h4v2H4v8h4v2H2V4zm6 0h10v2h-8v12h8v2H10zm12 0h-2v16h2zm-7 4h2v2h-2zm3 4h-4v4h4zM8 18H4v2h4z"/>',hidden:!0},"audio-waveform":{body:'<path fill="currentColor" d="M3 7h2v5H3zm4 0h2v13H7zm4-3h2v16h-2zm4 0h2v13h-2zM5 5h2v2H5zm4 15h2v2H9zm4-18h2v2h-2zm4 15h2v2h-2zm2-5h2v5h-2zm2-2h2v2h-2zM1 12h2v2H1z"/>'},"audio-waveform-sharp":{body:'<path fill="currentColor" d="M3 7h2v5H3zm4 0h2v13H7zm4-3h2v16h-2zm4 0h2v13h-2zM3 5h6v2H3zm4 15h6v2H7zm4-18h6v2h-6zm4 15h6v2h-6zm4-5h2v5h-2zm0-2h4v2h-4zM1 12h4v2H1z"/>'},avatar:{body:'<path fill="currentColor" d="M3 3h18v18H3zm16 16V5H5v14zM14 7h-4v4h4zm1 6H9v2H7v2h2v-2h6v2h2v-2h-2z"/>',hidden:!0},"avatar-circle":{body:'<path fill="currentColor" d="M6 2h12v2H6zm0 18h12v2H6zM2 6h2v12H2zm18 0h2v12h-2zM6 18h2v2H6zm10 0h2v2h-2zm2-14h2v2h-2zM4 4h2v2H4zm0 14h2v2H4zm14 0h2v2h-2zM8 16h8v2H8zm2-4h4v2h-4zM8 8h2v4H8zm2-2h4v2h-4zm4 2h2v4h-2z"/>'},"avatar-circle-minus":{body:'<g fill="currentColor"><path d="M6 2h12v2H6zm0 18h8v2H6zM2 6h2v12H2zm18 0h2v8h-2zM6 18h2v2H6zM18 4h2v2h-2zM4 4h2v2H4zm0 14h2v2H4zm14 0h2v2h-2zM8 16h6v2H8zm2-4h4v2h-4zM8 8h2v4H8zm2-2h4v2h-4zm4 2h2v4h-2z"/><path d="M16 18h6v2h-6z"/></g>'},"avatar-circle-minus-sharp":{body:'<g fill="currentColor"><path d="M6 2h12v2H6zm0 18h8v2H6zM2 6h2v12H2zm18 0h2v8h-2zM6 18h2v2H6zM18 4h2v2h-2zM4 4h2v2H4zm0 14h2v2H4zm14 0h2v2h-2zM6 16h8v2H6zm2-4h8v2H8zm0-4h2v4H8zm0-2h8v2H8zm6 2h2v4h-2z"/><path d="M16 18h6v2h-6z"/></g>'},"avatar-circle-plus":{body:'<g fill="currentColor"><path d="M6 2h12v2H6zm0 18h8v2H6zM2 6h2v12H2zm18 0h2v8h-2zM6 18h2v2H6zM18 4h2v2h-2zM4 4h2v2H4zm0 14h2v2H4zm14 0h2v2h-2zM8 16h6v2H8zm2-4h4v2h-4zM8 8h2v4H8zm2-2h4v2h-4zm4 2h2v4h-2z"/><path d="M18 16h2v6h-2z"/><path d="M16 18h6v2h-6z"/></g>'},"avatar-circle-plus-sharp":{body:'<g fill="currentColor"><path d="M6 2h12v2H6zm0 18h8v2H6zM2 6h2v12H2zm18 0h2v8h-2zM6 18h2v2H6zM18 4h2v2h-2zM4 4h2v2H4zm0 14h2v2H4zm14 0h2v2h-2zM6 16h8v2H6zm2-4h8v2H8zm0-4h2v4H8zm0-2h8v2H8zm6 2h2v4h-2z"/><path d="M18 16h2v6h-2z"/><path d="M16 18h6v2h-6z"/></g>'},"avatar-circle-sharp":{body:'<path fill="currentColor" d="M6 2h12v2H6zm0 18h12v2H6zM2 6h2v12H2zm18 0h2v12h-2zM6 18h2v2H6zm10 0h2v2h-2zm2-14h2v2h-2zM4 4h2v2H4zm0 14h2v2H4zm14 0h2v2h-2zM6 16h12v2H6zm2-4h8v2H8zm0-4h2v4H8zm0-2h8v2H8zm6 2h2v4h-2z"/>'},"avatar-circle-x":{body:'<path fill="currentColor" d="M6 2h12v2H6zm0 18h8v2H6zM2 6h2v12H2zm18 0h2v8h-2zM6 18h2v2H6zM18 4h2v2h-2zM4 4h2v2H4zm0 14h2v2H4zm4-2h6v2H8zm2-4h4v2h-4zM8 8h2v4H8zm2-2h4v2h-4zm4 2h2v4h-2zm4 10h2v2h-2zm-2-2h2v2h-2zm4 0h2v2h-2zm0 4h2v2h-2zm-4 0h2v2h-2z"/>'},"avatar-circle-x-sharp":{body:'<path fill="currentColor" d="M6 2h12v2H6zm0 18h8v2H6zM2 6h2v12H2zm18 0h2v8h-2zM6 18h2v2H6zM18 4h2v2h-2zM4 4h2v2H4zm0 14h2v2H4zm2-2h8v2H6zm2-4h8v2H8zm0-4h2v4H8zm0-2h8v2H8zm6 2h2v4h-2zm4 10h2v2h-2zm-2-2h2v2h-2zm4 0h2v2h-2zm0 4h2v2h-2zm-4 0h2v2h-2z"/>'},"avatar-square":{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zM6 18h2v2H6zm10 0h2v2h-2zm-8-2h8v2H8zm2-4h4v2h-4zM8 8h2v4H8zm2-2h4v2h-4zm4 2h2v4h-2z"/>'},"avatar-square-minus":{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h10v2H4zM2 4h2v16H2zm18 0h2v10h-2zM6 18h2v2H6zm2-2h6v2H8zm2-4h4v2h-4zM8 8h2v4H8zm2-2h4v2h-4zm4 2h2v4h-2zm2 10h6v2h-6z"/>'},"avatar-square-minus-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 18h12v2H2zM2 4h2v16H2zm18 0h2v10h-2zM6 18h2v2H6zm0-2h8v2H6zm2-4h8v2H8zm0-4h2v4H8zm0-2h8v2H8zm6 2h2v4h-2zm2 10h6v2h-6z"/>'},"avatar-square-plus":{body:'<g fill="currentColor"><path d="M4 2h16v2H4zm0 18h10v2H4zM2 4h2v16H2zm18 0h2v10h-2zM6 18h2v2H6zm2-2h6v2H8zm2-4h4v2h-4zM8 8h2v4H8zm2-2h4v2h-4zm4 2h2v4h-2zm4 8h2v6h-2z"/><path d="M16 18h6v2h-6z"/></g>'},"avatar-square-plus-sharp":{body:'<g fill="currentColor"><path d="M2 2h20v2H2zm0 18h12v2H2zM2 4h2v16H2zm18 0h2v10h-2zM6 18h2v2H6zm0-2h8v2H6zm2-4h8v2H8zm0-4h2v4H8zm0-2h8v2H8zm6 2h2v4h-2zm4 8h2v6h-2z"/><path d="M16 18h6v2h-6z"/></g>'},"avatar-square-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zM6 18h2v2H6zm10 0h2v2h-2zM6 16h12v2H6zm2-4h8v2H8zm0-4h2v4H8zm0-2h8v2H8zm6 2h2v4h-2z"/>'},"avatar-square-x":{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h10v2H4zM2 4h2v16H2zm18 0h2v10h-2zM6 18h2v2H6zm2-2h6v2H8zm2-4h4v2h-4zM8 8h2v4H8zm2-2h4v2h-4zm4 2h2v4h-2zm4 10h2v2h-2zm-2-2h2v2h-2zm4 0h2v2h-2zm0 4h2v2h-2zm-4 0h2v2h-2z"/>'},"avatar-square-x-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 18h12v2H2zM2 4h2v16H2zm18 0h2v10h-2zM6 18h2v2H6zm0-2h8v2H6zm2-4h8v2H8zm0-4h2v4H8zm0-2h8v2H8zm6 2h2v4h-2zm4 10h2v2h-2zm-2-2h2v2h-2zm4 0h2v2h-2zm0 4h2v2h-2zm-4 0h2v2h-2z"/>'},backburger:{body:'<path fill="currentColor" d="M11 7h10v2H11zm-8 4h2V9h2v2h14v2H7v2H5v-2H3zm4 4v2h2v-2zm0-6V7h2v2zm14 6H11v2h10z"/>',hidden:!0},backpack:{body:'<g fill="currentColor"><path d="M5 6h14v2H5zM3 8h2v12H3zm2 12h14v2H5zM19 8h2v12h-2z"/><path d="M7 16h2v6H7zm8 0h2v6h-2zm-6-2h6v2H9zm-2-4h10v2H7zm1-6h2v2H8zm6 0h2v2h-2zm-4-2h4v2h-4z"/></g>'},"backpack-sharp":{body:'<g fill="currentColor"><path d="M3 6h18v2H3zm0 2h2v12H3zm0 12h18v2H3zM19 8h2v12h-2z"/><path d="M7 16h2v6H7zm8 0h2v6h-2zm-8-2h10v2H7zm0-4h10v2H7zm1-6h2v2H8zm6 0h2v2h-2zM8 2h8v2H8z"/></g>'},"badge-4k":{body:'<path fill="currentColor" d="M3 4h18v2H3zm0 14h18v2H3zM1 6h2v12H1zm20 0h2v12h-2zM5 8h2v5H5zm4 0h2v8H9zm4 0h2v8h-2zm4 0h2v3h-2zm0 5h2v3h-2zm-2-2h2v2h-2zm-8 0h2v2H7z"/>'},"badge-4k-sharp":{body:'<path fill="currentColor" d="M1 4h22v2H1zm0 14h22v2H1zM1 6h2v12H1zm20 0h2v12h-2zM5 8h2v5H5zm4 0h2v8H9zm4 0h2v8h-2zm4 0h2v3h-2zm0 5h2v3h-2zm-2-2h2v2h-2zm-8 0h2v2H7z"/>'},"badge-5k":{body:'<path fill="currentColor" d="M3 4h18v2H3zm0 14h18v2H3zM1 6h2v12H1zm20 0h2v12h-2zM5 8h2v5H5zm4 3h2v3H9zm4-3h2v8h-2zm4 0h2v3h-2zm0 5h2v3h-2zm-2-2h2v2h-2zm-8 0h2v2H7zm0-3h4v2H7zm-2 6h4v2H5z"/>'},"badge-5k-sharp":{body:'<path fill="currentColor" d="M1 4h22v2H1zm0 14h22v2H1zM1 6h2v12H1zm20 0h2v12h-2zM5 8h2v5H5zm4 3h2v3H9zm4-3h2v8h-2zm4 0h2v3h-2zm0 5h2v3h-2zm-2-2h2v2h-2zm-8 0h2v2H7zm0-3h4v2H7zm-2 6h4v2H5z"/>'},"badge-captions":{body:'<path fill="currentColor" d="M3 4h18v2H3zm0 14h18v2H3zM1 6h2v12H1zm20 0h2v12h-2zm-6 8h4v2h-4zM5 10h4v2H5zm0 4h8v2H5zm6-4h8v2h-8z"/>'},"badge-captions-sharp":{body:'<path fill="currentColor" d="M1 4h22v2H1zm0 14h22v2H1zM1 6h2v12H1zm20 0h2v12h-2zm-6 8h4v2h-4zM5 10h4v2H5zm0 4h8v2H5zm6-4h8v2h-8z"/>'},"badge-hd":{body:'<path fill="currentColor" d="M3 4h18v2H3zm0 14h18v2H3zM1 6h2v12H1zm20 0h2v12h-2zM5 8h2v8H5zm4 0h2v8H9zm4 0h2v8h-2zm2 0h2v2h-2zm0 6h2v2h-2zm2-4h2v4h-2zM7 11h2v2H7z"/>'},"badge-hd-sharp":{body:'<path fill="currentColor" d="M1 4h22v2H1zm0 14h22v2H1zM1 6h2v12H1zm20 0h2v12h-2zM5 8h2v8H5zm4 0h2v8H9zm4 0h2v8h-2zm2 0h2v2h-2zm0 6h2v2h-2zm2-4h2v4h-2zM7 11h2v2H7z"/>'},balloon:{body:'<path fill="currentColor" d="M9 1h6v2H9zM7 3h2v2H7zm8 0h2v2h-2zm-4 2h2v2h-2zm2 2h2v2h-2zM5 5h2v8H5zm12 0h2v8h-2zM7 13h2v2H7zm2 2h2v2H9zm4 4h4v2h-4zm-2-4h4v2h-4zm4-2h2v2h-2zm2 8h2v2h-2zm-6-4h2v2h-2z"/>'},banknote:{body:'<path fill="currentColor" d="M3 5h18v2H3zM1 7h2v10H1zm2 10h18v2H3zM21 7h2v10h-2zM11 9h2v2h-2zm-2 2h2v2H9zm2 2h2v2h-2zm2-2h2v2h-2zm4 0h2v2h-2zM5 11h2v2H5z"/>'},"banknote-sharp":{body:'<path fill="currentColor" d="M1 5h22v2H1zm0 2h2v10H1zm0 10h22v2H1zM21 7h2v10h-2zM9 9h6v2H9zm0 2h2v2H9zm0 2h6v2H9zm4-2h2v2h-2zm4 0h2v2h-2zM5 11h2v2H5z"/>'},barcode:{body:'<path fill="currentColor" d="M2 4h2v16H2zm4 0h3v16H6zm5 0h3v16h-3zm5 0h2v16h-2zm4 0h2v16h-2z"/>'},battery:{body:'<path fill="currentColor" d="M4 5h14v2H4zm0 12h14v2H4zM2 7h2v10H2zm16-2h2v14h-2zm2 4h2v6h-2z"/>'},"battery-1":{body:'<path fill="currentColor" d="M4 5H2v14h18v-4h2V9h-2V5zm14 2v10H4V7zM8 9H6v6h2z"/>',hidden:!0},"battery-2":{body:'<path fill="currentColor" d="M4 5H2v14h18v-4h2V9h-2V5zm14 2v10H4V7zM6 9h2v6H6zm6 0h-2v6h2z"/>',hidden:!0},"battery-charging":{body:'<path fill="currentColor" d="M4 5H2v14h6v-2H4V7h4V5zm10 0h6v4h2v6h-2v4h-6v-2h4V7h-4zm-4 2h2v4h4v2h-2v2h-2v2h-2v-4H6v-2h2V9h2z"/>',hidden:!0},"battery-full":{body:'<path fill="currentColor" d="M4 5h14v2H4zm0 12h14v2H4zM2 7h2v10H2zm16-2h2v14h-2zm2 4h2v6h-2zM6 9h2v6H6zm4 0h2v6h-2zm4 0h2v6h-2z"/>'},"battery-full-sharp":{body:'<path fill="currentColor" d="M4 5h14v2H4zm0 12h14v2H4zM2 5h2v14H2zm16 0h2v14h-2zm2 4h2v6h-2zM6 9h2v6H6zm4 0h2v6h-2zm4 0h2v6h-2z"/>'},"battery-low":{body:'<path fill="currentColor" d="M4 5h14v2H4zm0 12h14v2H4zM2 7h2v10H2zm16-2h2v14h-2zm2 4h2v6h-2zM6 9h2v6H6z"/>'},"battery-low-sharp":{body:'<path fill="currentColor" d="M4 5h14v2H4zm0 12h14v2H4zM2 5h2v14H2zm16 0h2v14h-2zm2 4h2v6h-2zM6 9h2v6H6z"/>'},"battery-medium":{body:'<path fill="currentColor" d="M4 5h14v2H4zm0 12h14v2H4zM2 7h2v10H2zm16-2h2v14h-2zm2 4h2v6h-2zM6 9h2v6H6zm4 0h2v6h-2z"/>'},"battery-medium-sharp":{body:'<path fill="currentColor" d="M4 5h14v2H4zm0 12h14v2H4zM2 5h2v14H2zm16 0h2v14h-2zm2 4h2v6h-2zM6 9h2v6H6zm4 0h2v6h-2z"/>'},"battery-sharp":{body:'<path fill="currentColor" d="M4 5h14v2H4zm0 12h14v2H4zM2 5h2v14H2zm16 0h2v14h-2zm2 4h2v6h-2z"/>'},bed:{body:'<g fill="currentColor"><path d="M2 4h2v16H2zm18 6h2v10h-2z"/><path d="M2 16h20v2H2zm2-8h16v2H4zm2 2h2v6H6z"/></g>'},"bed-sharp":{body:'<g fill="currentColor"><path d="M2 4h2v16H2zm18 6h2v10h-2z"/><path d="M2 16h20v2H2zm2-8h18v2H4zm2 2h2v6H6z"/></g>'},bell:{body:'<g fill="currentColor"><path d="M9 2h6v2H9zM7 4h2v2H7zm8 0h2v2h-2zM5 6h2v7H5zm12 0h2v7h-2zM3 13h2v4H3zm16 0h2v4h-2z"/><path d="M3 15h18v2H3zm5 3h2v2H8zm6 0h2v2h-2zm-4 2h4v2h-4z"/></g>'},"bell-off":{body:'<g fill="currentColor"><path d="M9 2h6v2H9zm6 2h2v2h-2zM5 6h2v7H5zm12 0h2v6h-2zM3 13h2v4H3z"/><path d="M3 15h14v2H3zm5 3h2v2H8zm6 0h2v2h-2zm-4 2h4v2h-4zM5 4h2v2H5zm2 2h2v2H7zm2 2h2v2H9zm2 2h2v2h-2zm2 2h2v2h-2z"/><path d="M15 14h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zM3 2h2v2H3z"/></g>'},"bell-off-sharp":{body:'<g fill="currentColor"><path d="M9 2h6v2H9zm6 2h2v2h-2zM5 6h2v7H5zm12 0h2v6h-2zM3 13h2v4H3z"/><path d="M3 15h14v2H3zm5 3h2v2H8zm6 0h2v2h-2zm-6 2h8v2H8zM5 4h2v2H5zm2 2h2v2H7zm2 2h2v2H9zm2 2h2v2h-2zm2 2h2v2h-2z"/><path d="M15 14h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zM3 2h2v2H3z"/></g>'},"bell-ring":{body:'<path fill="currentColor" d="M14 22h-4v-2h4zm-4-2H8v-2h2zm6 0h-2v-2h2zM5 15h14v-2h2v4H3v-4h2zm2-2H5V6h2zm12 0h-2V6h2zM3 6H1V4h2zm6 0H7V4h2zm8 0h-2V4h2zm6 0h-2V4h2zM5 4H3V2h2zm10 0H9V2h6zm6 0h-2V2h2z"/>'},"bell-ring-sharp":{body:'<path fill="currentColor" d="M16 22H8v-4h2v2h4v-2h2zM5 15h14v-2h2v4H3v-4h2zm2-2H5V6h2zm12 0h-2V6h2zM3 6H1V4h2zm6 0H7V4h2zm8 0h-2V4h2zm6 0h-2V4h2zM5 4H3V2h2zm10 0H9V2h6zm6 0h-2V2h2z"/>'},"bell-sharp":{body:'<g fill="currentColor"><path d="M9 2h6v2H9zM7 4h2v2H7zm8 0h2v2h-2zM5 6h2v7H5zm12 0h2v7h-2zM3 13h2v4H3zm16 0h2v4h-2z"/><path d="M3 15h18v2H3zm5 3h2v2H8zm6 0h2v2h-2zm-6 2h8v2H8z"/></g>'},binary:{body:'<path fill="currentColor" d="M7 3h2v2H7zm8 10h2v2h-2zM5 5h2v4H5zm8 10h2v4h-2zM9 5h2v4H9zm8 10h2v4h-2zM7 9h2v2H7zm8 10h2v2h-2zM13 3h4v2h-4zM5 13h4v2H5zm10-8h2v4h-2zM7 15h2v4H7zm6-6h6v2h-6zM5 19h6v2H5z"/>'},"binary-sharp":{body:'<path fill="currentColor" d="M5 3h6v2H5zm8 10h6v2h-6zM5 5h2v4H5zm8 10h2v4h-2zM9 5h2v4H9zm8 10h2v4h-2zM5 9h6v2H5zm8 10h6v2h-6zm0-16h4v2h-4zM5 13h4v2H5zm10-8h2v4h-2zM7 15h2v4H7zm6-6h6v2h-6zM5 19h6v2H5z"/>'},bitcoin:{body:'<path fill="currentColor" d="M13 3h2v2h2v2H9v4h8v2H9v4h8v2h-2v2h-2v-2h-2v2H9v-2H5v-2h2v-4H5v-2h2V7H5V5h4V3h2v2h2zm4 14v-4h2v4zm0-6V7h2v4z"/>',hidden:!0},blocks:{body:'<g fill="currentColor"><path d="M15 1h6v2h-6zm-2 2h2v6h-2zm2 6h6v2h-6zm6-6h2v6h-2zM3 5h6v2H3zM1 7h2v14H1zm2 14h14v2H3zm14-6h2v6h-2zM3 13h14v2H3z"/><path d="M9 7h2v14H9z"/></g>'},"blocks-sharp":{body:'<g fill="currentColor"><path d="M13 1h10v2H13zm0 2h2v6h-2zm0 6h10v2H13zm8-6h2v6h-2zM1 5h10v2H1zm0 2h2v16H1zm2 14h14v2H3zm14-8h2v10h-2zM3 13h14v2H3z"/><path d="M9 7h2v14H9z"/></g>'},bluesky:{body:'<path fill="currentColor" d="M11 15h2v2h-2zm5-2h2v2h-2zm-8 0H6v2h2zm10-2h2v2h-2zM6 11H4v2h2zm14-6h2v6h-2zM4 5H2v6h2zm9 12h2v2h-2zm-2 0H9v2h2zm7-2h2v4h-2zM6 15H4v4h2zm9 4h3v2h-3zm-6 0H6v2h3zm8-16h3v2h-3zM7 3H4v2h3zm8 2h2v2h-2zM9 5H7v2h2zm4 2h2v2h-2zm-2 0H9v2h2zm0 2h2v2h-2z"/>'},bluetooth:{body:'<path fill="currentColor" d="M15 3h-2v2h2v2h2v2h-2v2h2V9h2V7h-2V5h-2zm-2 0h-2v6H9V7H7V5H5v2h2v2h2v2h2v2H9v2H7v2H5v2h2v-2h2v-2h2v6h2zm2 8h-2v2h2v2h2v2h-2v2h-2v2h2v-2h2v-2h2v-2h-2v-2h-2z"/>',hidden:!0},bomb:{body:'<path fill="currentColor" d="M12 6h2v4h2v2h2v6h-2v2h-2v2H6v-2H4v-2H2v-6h2v-2h2V6h4V4h2zm0 10h2v-2h-2zm-2-2h2v-2h-2zm12-1h-2v-2h2zm0-3h-2V6h2zm-2-4h-2V4h2zm-2-2h-6V2h6z"/>'},book:{body:'<path fill="currentColor" d="M8 2h12v20H4V2zm4 8h-2v2H8V4H6v16h12V4h-4v8h-2z"/>',hidden:!0},"book-open":{body:'<path fill="currentColor" d="M2 3h9v2H2zM0 19h11v2H0zM13 3h9v2h-9zm0 16h11v2H13zM11 5h2v18h-2zM0 5h2v14H0zm22 0h2v14h-2zm-7 2h5v2h-5zm0 4h5v2h-5zm0 4h2v2h-2z"/>'},"book-open-sharp":{body:'<g fill="currentColor"><path d="M0 3h13v2H0zm0 16h11v2H0z"/><path d="M11 3h13v2H11zm2 16h11v2H13zM11 5h2v18h-2zM0 5h2v14H0zm22 0h2v14h-2zm-7 2h5v2h-5zm0 4h5v2h-5zm0 4h2v2h-2z"/></g>'},bookmark:{body:'<path fill="currentColor" d="M6 2h12v2H6zM4 4h2v18H4zm14 0h2v18h-2zm-2 16h2v2h-2zm-2-2h2v2h-2zm-8 2h2v2H6zm2-2h2v2H8zm2-2h4v2h-4z"/>'},"bookmark-sharp":{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 2h2v18H4zm14 0h2v18h-2zm-2 16h2v2h-2zm-2-2h2v2h-2zm-8 2h2v2H6zm2-2h2v2H8zm2-2h4v2h-4z"/>'},bookmarks:{body:'<path fill="currentColor" d="M21 18V2H7v2h12v14zM5 6H3v16h4v-2h2v-2h2v2h2v2h4V6zm8 14v-2h-2v-2H9v2H7v2H5V8h10v12z"/>',hidden:!0},"bottle-wine":{body:'<path fill="currentColor" d="M9 1h6v2H9zm0 2h2v4H9zm4 0h2v4h-2zM7 7h2v2H7zm8 0h2v2h-2zm2 2h2v12h-2zM5 9h2v12H5zm2 12h10v2H7z"/>'},"bottle-wine-sharp":{body:'<path fill="currentColor" d="M9 1h6v2H9zm0 2h2v4H9zm4 0h2v4h-2zM7 7h2v2H7zm8 0h2v2h-2zm2 2h2v12h-2zM5 9h2v12H5zm0 12h14v2H5z"/>'},box:{body:'<g fill="currentColor"><path d="M14 4h4v2h-4zm-4-2h4v2h-4zM6 8h4v2H6zm0 10h4v2H6zm4-8h4v2h-4zm0 10h4v2h-4zm4-12h4v2h-4zm0 10h4v2h-4zM6 4h4v2H6zM2 6h4v2H2zm0 10h4v2H2zM18 6h4v2h-4zm0 10h4v2h-4z"/><path d="M2 6h2v12H2zm18 0h2v12h-2zm-8 6h2v8h-2z"/></g>'},braces:{body:'<path fill="currentColor" d="M6 4h4v2H6zm12 0h-4v2h4zM6 20h4v-2H6zm12 0h-4v-2h4zM4 6h2v5H4zm16 0h-2v5h2zM4 18h2v-5H4zm16 0h-2v-5h2zM2 11h2v2H2zm20 0h-2v2h2z"/>'},"braces-content":{body:'<path fill="currentColor" d="M5 4h4v2H5zm14 0h-4v2h4zM5 20h4v-2H5zm14 0h-4v-2h4zM3 6h2v5H3zm18 0h-2v5h2zM3 18h2v-5H3zm18 0h-2v-5h2zM1 11h2v2H1zm10 0h2v2h-2zm-4 0h2v2H7zm8 0h2v2h-2zm8 0h-2v2h2z"/>'},"braces-content-sharp":{body:'<path fill="currentColor" d="M3 4h6v2H3zm18 0h-6v2h6zM3 20h6v-2H3zm18 0h-6v-2h6zM3 6h2v5H3zm18 0h-2v5h2zM3 18h2v-5H3zm18 0h-2v-5h2zM1 11h2v2H1zm10 0h2v2h-2zm-4 0h2v2H7zm8 0h2v2h-2zm8 0h-2v2h2z"/>'},"braces-off":{body:'<g fill="currentColor"><path d="M8 3h2v2H8zm10 0h-4v2h4zM6 21h4v-2H6zm12 0h-4v-2h4zM4 5h2v6H4zm16 0h-2v6h2zM4 19h2v-6H4zm16-4h-2v-2h2zM2 11h2v2H2zm20 0h-2v2h2zM2 3h2v2H2z"/><path d="M4 5h2v2H4zm2 2h2v2H6zm2 2h2v2H8zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2z"/></g>'},"braces-off-sharp":{body:'<g fill="currentColor"><path d="M8 3h2v2H8zm12 0h-6v2h6zM4 21h6v-2H4zm14 0h-4v-2h4zM4 5h2v6H4zm16 0h-2v6h2zM4 19h2v-6H4zm16-4h-2v-2h2zM2 11h2v2H2zm20 0h-2v2h2zM2 3h2v2H2z"/><path d="M4 5h2v2H4zm2 2h2v2H6zm2 2h2v2H8zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2z"/></g>'},"braces-sharp":{body:'<path fill="currentColor" d="M4 4h6v2H4zm16 0h-6v2h6zM4 20h6v-2H4zm16 0h-6v-2h6zM4 6h2v5H4zm16 0h-2v5h2zM4 18h2v-5H4zm16 0h-2v-5h2zM2 11h2v2H2zm20 0h-2v2h2z"/>'},brackets:{body:'<path fill="currentColor" d="M5 4h4v2H5zm14 0h-4v2h4zM5 20h4v-2H5zm14 0h-4v-2h4zM3 6h2v12H3zm18 0h-2v12h2z"/>'},"brackets-angle":{body:'<path fill="currentColor" d="M8 5h2v2H8zM6 7h2v2H6zM4 9h2v2H4zm-2 2h2v2H2zm2 2h2v2H4zm2 2h2v2H6zm2 2h2v2H8zm8-12h-2v2h2zm2 2h-2v2h2zm2 2h-2v2h2zm2 2h-2v2h2zm-2 2h-2v2h2zm-2 2h-2v2h2zm-2 2h-2v2h2z"/>'},"brackets-angle-off":{body:'<path fill="currentColor" d="M2 1h2v2H2zm2 2h2v2H4zm2 2h2v2H6zm2 2h2v2H8zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zM4 9h2v2H4zm2-2h2v2H6zm-4 4h2v2H2zm2 2h2v2H4zm2 2h2v2H6zm2 2h2v2H8zm6 0h2v2h-2zm6-6h2v2h-2zm-2-2h2v2h-2zm-2-2h2v2h-2zm-2-2h2v2h-2z"/>'},"brackets-content":{body:'<path fill="currentColor" d="M5 4h4v2H5zm14 0h-4v2h4zM5 20h4v-2H5zm14 0h-4v-2h4zM3 6h2v12H3zm18 0h-2v12h2zm-10 5h2v2h-2zm-4 0h2v2H7zm8 0h2v2h-2z"/>'},"brackets-content-sharp":{body:'<path fill="currentColor" d="M3 4h6v2H3zm18 0h-6v2h6zM3 20h6v-2H3zm18 0h-6v-2h6zM3 6h2v12H3zm18 0h-2v12h2zm-10 5h2v2h-2zm-4 0h2v2H7zm8 0h2v2h-2z"/>'},"brackets-off":{body:'<path fill="currentColor" d="M19 3h-4v2h4zM5 21h4v-2H5zm14 0h-4v-2h4zM3 5h2v14H3zm18 0h-2v10h2zM3 3h2v2H3zm2 2h2v2H5zm2 2h2v2H7zm2 2h2v2H9zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2z"/>'},"brackets-off-sharp":{body:'<path fill="currentColor" d="M21 3h-6v2h6zM3 21h6v-2H3zm16 0h-4v-2h4zM3 5h2v14H3zm18 0h-2v10h2zM3 3h2v2H3zm2 2h2v2H5zm2 2h2v2H7zm2 2h2v2H9zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2z"/>'},"brackets-sharp":{body:'<path fill="currentColor" d="M3 4h6v2H3zm18 0h-6v2h6zM3 20h6v-2H3zm18 0h-6v-2h6zM3 6h2v12H3zm18 0h-2v12h2z"/>'},briefcase:{body:'<path fill="currentColor" d="M2 8h2v12H2zm18 0h2v12h-2zM4 6h16v2H4zm0 14h16v2H4zM8 4h2v2H8zm2-2h4v2h-4zm4 2h2v2h-2z"/>'},"briefcase-account":{body:'<path fill="currentColor" d="M16 3H8v4H2v14h20V7h-6zm-2 4h-4V5h4zM4 19V9h16v10zm6-8h4v3h-4zm-2 4h8v2H8z"/>',hidden:!0},"briefcase-check":{body:'<path fill="currentColor" d="M16 3H8v4H2v14h20V7h-6zm-2 4h-4V5h4zM4 19V9h16v10zm10-8h2v2h-2zm-2 4v-2h2v2zm-2 0h2v2h-2zm0 0H8v-2h2z"/>',hidden:!0},"briefcase-delete":{body:'<path fill="currentColor" d="M16 3H8v4H2v14h12v-2H4V9h16v4h2V7h-6zm-2 4h-4V5h4zm4 8h-2v2h2v2h-2v2h2v-2h2v2h2v-2h-2v-2h2v-2h-2v2h-2z"/>',hidden:!0},"briefcase-download":{body:'<path fill="currentColor" d="M8 3h8v4h6v14h-5v-2h3V9H4v10h3v2H2V7h6zm6 2h-4v2h4zm-3 6h2v6h2v2h-2v2h-2v-2H9v-2h2zm-2 6H7v-2h2zm6 0v-2h2v2z"/>',hidden:!0},"briefcase-minus":{body:'<path fill="currentColor" d="M8 3h8v4h6v6h-2V9H4v10h10v2H2V7h6zm6 2h-4v2h4zm2 12h6v2h-6z"/>',hidden:!0},"briefcase-plus":{body:'<path fill="currentColor" d="M8 3h8v4h6v4h-2V9H4v10h8v2H2V7h6zm2 4h4V5h-4zm7 14h2v-3h3v-2h-3v-3h-2v3h-3v2h3z"/>',hidden:!0},"briefcase-search":{body:'<path fill="currentColor" d="M16 3H8v4H2v14h10v-2H4V9h16v2h2V7h-6zm-2 4h-4V5h4zm6 6h-6v6h6v2h2v-2h-2zm-4 4v-2h2v2z"/>',hidden:!0},"briefcase-search-1":{body:'<path fill="currentColor" d="M16 3H8v4H2v14h7v-2H4V9h18V7h-6zm-2 4h-4V5h4zm0 4h8v2h-8zm0 10h-2v-8h2zm8 0v2h-8v-2zm0 0h2v-8h-2zm-6-6h2v2h2v2h-4z"/>',hidden:!0},"briefcase-sharp":{body:'<path fill="currentColor" d="M2 8h2v12H2zm18 0h2v12h-2zM2 6h20v2H2zm0 14h20v2H2zM8 4h2v2H8zm0-2h8v2H8zm6 2h2v2h-2z"/>'},"briefcase-upload":{body:'<path fill="currentColor" d="M8 3h8v4h6v14h-5v-2h3V9H4v10h3v2H2V7h6zm6 2h-4v2h4zm-3 16h2v-6h2v2h2v-2h-2v-2h-2v-2h-2v2H9v2H7v2h2v-2h2z"/>',hidden:!0},briefcases:{body:'<path fill="currentColor" d="M6 8h2v8H6zm14 0h2v8h-2zM8 6h12v2H8zm0 10h12v2H8zm-6-4h2v8H2zm2 8h12v2H4zm6-16h2v2h-2zm2-2h4v2h-4zm4 2h2v2h-2zM4 10h2v2H4zm12 8h2v2h-2z"/>'},"briefcases-sharp":{body:'<path fill="currentColor" d="M6 8h2v8H6zm14 0h2v8h-2zM6 6h16v2H6zm0 10h16v2H6zm-4-4h2v8H2zm0 8h16v2H2zm8-16h2v2h-2zm0-2h8v2h-8zm6 2h2v2h-2zM2 10h4v2H2zm14 8h2v2h-2z"/>'},brush:{body:'<g fill="currentColor"><path d="M7 2h10v2H7zM5 4h2v10H5zm12-2h2v12h-2z"/><path d="M13 2h2v6h-2zM9 2h2v4H9zm-4 8h14v2H5zm2 4h10v2H7zm2 2h2v4H9zm4 0h2v4h-2zm-4 4h6v2H9z"/></g>'},"brush-sharp":{body:'<g fill="currentColor"><path d="M5 2h12v2H5zm0 2h2v10H5zm12-2h2v12h-2z"/><path d="M13 2h2v6h-2zM9 2h2v4H9zm-4 8h14v2H5zm0 4h14v2H5zm4 2h2v4H9zm4 0h2v4h-2zm-4 4h6v2H9z"/></g>'},bug:{body:'<g fill="currentColor"><path d="M2 5h2v4H2zm20 0h-2v4h2zM4 9h2v2H4zm16 0h-2v2h2zM2 13h4v2H2zm20 0h-4v2h4zM4 17h2v2H4zm16 0h-2v2h2zM2 19h2v2H2zm20 0h-2v2h2zM6 11h12v2H6z"/><path d="M6 7h2v12H6zm10 0h2v12h-2zM8 19h8v2H8zM8 5h8v2H8z"/><path d="M11 15h2v6h-2zM8 1h2v6H8zm6 0h2v6h-2z"/></g>'},"bug-sharp":{body:'<g fill="currentColor"><path d="M2 5h2v4H2zm20 0h-2v4h2zM2 9h4v2H2zm20 0h-4v2h4zM2 13h4v2H2zm20 0h-4v2h4zM2 17h4v2H2zm20 0h-4v2h4zM2 19h2v2H2zm20 0h-2v2h2zM6 11h12v2H6z"/><path d="M6 5h2v14H6zm10 0h2v14h-2zM6 19h12v2H6zM8 5h8v2H8z"/><path d="M11 15h2v6h-2zM8 1h2v6H8zm6 0h2v6h-2z"/></g>'},building:{body:'<path fill="currentColor" d="M5 2h14v2H5zm0 18h14v2H5zM3 4h2v16H3zm16 0h2v16h-2zM7 6h2v2H7zm4 0h2v2h-2zm4 0h2v2h-2zm-8 4h2v2H7zm4 0h2v2h-2zm4 0h2v2h-2zm-8 4h2v2H7zm4 0h2v2h-2zm-1 4h4v2h-4zm5-4h2v2h-2z"/>'},"building-community":{body:'<path fill="currentColor" d="M4 20h16v2H4zM20 4h2v16h-2zM10 2h10v2H10zM8 8h2v2H8zm0-4h2v2H8zm2 6h2v2h-2zm2 2h2v2h-2zm2 2h2v6h-2zm-8-4h2v2H6zm-2 2h2v2H4zm-2 2h2v6H2zm14-8h2v2h-2zm-4 0h2v2h-2zm4 4h2v2h-2zm-8 6h2v4H8z"/>'},"building-community-sharp":{body:'<path fill="currentColor" d="M2 20h20v2H2zM20 4h2v16h-2zM8 2h14v2H8zm0 6h2v2H8zm0-4h2v2H8zm2 6h2v2h-2zm2 2h2v2h-2zm2 2h2v6h-2zm-8-4h2v2H6zm-2 2h2v2H4zm-2 2h2v6H2zm14-8h2v2h-2zm-4 0h2v2h-2zm4 4h2v2h-2zm-8 6h2v4H8z"/>'},"building-sharp":{body:'<path fill="currentColor" d="M3 2h18v2H3zm0 18h18v2H3zM3 4h2v16H3zm16 0h2v16h-2zM7 6h2v2H7zm4 0h2v2h-2zm4 0h2v2h-2zm-8 4h2v2H7zm4 0h2v2h-2zm4 0h2v2h-2zm-8 4h2v2H7zm4 0h2v2h-2zm-1 4h4v2h-4zm5-4h2v2h-2z"/>'},"building-skyscraper":{body:'<path fill="currentColor" d="M10 2h4v5h2v2h-2v11h4v-9h2v9h2v2H2v-2h2V8h2v12h6V4h-2zM8 6V4h2v2zm0 0H6v2h2zm10 5h-2V9h2zm-8-1H8v2h2zm-2 4h2v2H8z"/>',hidden:!0},buildings:{body:'<path fill="currentColor" d="M2 2h14v4h6v16H2zm18 6h-4v2h2v2h-2v2h2v2h-2v2h2v2h2zm-6-4H4v16h2v-2h6v2h2zM6 6h2v2H6zm6 0h-2v2h2zm-6 4h2v2H6zm6 0h-2v2h2zm-6 4h2v2H6zm6 0h-2v2h2z"/>',hidden:!0},bulletlist:{body:'<path fill="currentColor" d="M10 5h12v2H10zm0 4h8v2h-8zm0 4h12v2H10zm0 4h8v2h-8zm-4-6H4V9h2zM4 9H2V7h2zm4 0H6V7h2zM6 7H4V5h2zm-2 6h2v2H4zm0 4h2v2H4zm-2 0v-2h2v2zm4 0v-2h2v2z"/>'},"bulletlist-sharp":{body:'<path fill="currentColor" d="M10 5h12v2H10zm0 4h8v2h-8zm0 4h12v2H10zm0 4h8v2h-8zM4 7v2h2V7zm4 4H2V5h6zm-6 2h6v2H2zm0 4h6v2H2zm0 0v-2h2v2zm4 0v-2h2v2z"/>'},bullseye:{body:'<path fill="currentColor" d="M18 2H6v2H4v2H2v12h2v2h2v2h12v-2h2v-2h2V6h-2V4h-2zm0 2v2h2v12h-2v2H6v-2H4V6h2V4zm-8 6h4v4h-4zM8 6h8v2H8zm0 10H6V8h2zm8 0v2H8v-2zm0 0h2V8h-2z"/>',hidden:!0},"bullseye-arrow":{body:'<path fill="currentColor" d="M6 2h10v2H6zM4 6V4h2v2zm0 12H2V6h2zm2 2H4v-2h2zm12 0H6v2h12zm2-2v2h-2v-2zm0 0h2V8h-2zM12 6H8v2H6v8h2v2h8v-2h2v-4h-2v4H8V8h4zm2 8v-4h2V8h2V6h4V4h-2V2h-2v4h-2v2h-2v2h-4v4z"/>',hidden:!0},bus:{body:'<path fill="currentColor" d="M4 15h6v2H4zm10 0h6v2h-6zM4 19h6v2H4zm10 0h6v2h-6zM0 7h2v10H0zm2-2h18v2H2zm20 4h2v8h-2zM2 11h20v2H2zm2 6h2v2H4zm4 0h8v2H8zm-6 0h2v2H2zm16 0h4v2h-4zm2-10h2v2h-2zm-6 0h2v4h-2zM7 7h2v4H7z"/>'},"bus-sharp":{body:'<path fill="currentColor" d="M4 15h6v2H4zm10 0h6v2h-6zM4 19h6v2H4zm10 0h6v2h-6zM0 7h2v10H0zm0-2h22v2H0zm22 2h2v10h-2zM2 11h20v2H2zm2 6h2v2H4zm4 0h8v2H8zm-8 0h4v2H0zm18 0h6v2h-6zM14 7h2v4h-2zM7 7h2v4H7z"/>'},cake:{body:'<path fill="currentColor" d="M1 20h22v2H1zm2-8h2v8H3zm2-2h14v2H5zm14 2h2v8h-2zm-8-5h2v3h-2zM7 7h2v3H7zm8 0h2v3h-2zM7 3h2v2H7zm4 0h2v2h-2zm4 0h2v2h-2zM5 14h2v2H5zm2 2h4v2H7zm4-2h6v2h-6zm6 2h2v2h-2z"/>'},"cake-sharp":{body:'<path fill="currentColor" d="M1 20h22v2H1zm2-8h2v8H3zm0-2h18v2H3zm16 2h2v8h-2zm-8-5h2v3h-2zM7 7h2v3H7zm8 0h2v3h-2zM7 3h2v2H7zm4 0h2v2h-2zm4 0h2v2h-2zM5 14h2v2H5zm2 2h4v2H7zm4-2h6v2h-6zm6 2h2v2h-2z"/>'},calculator:{body:'<path fill="currentColor" d="M5 2h14v2H5zm0 18h14v2H5zM3 4h2v16H3zm16 0h2v16h-2zM7 6h10v4H7zm0 6h2v2H7zm4 0h2v2h-2zm4 0h2v2h-2zm-8 4h2v2H7zm4 0h2v2h-2zm4 0h2v2h-2z"/>'},"calculator-sharp":{body:'<path fill="currentColor" d="M3 2h18v2H3zm0 18h18v2H3zM3 4h2v16H3zm16 0h2v16h-2zM7 6h10v4H7zm0 6h2v2H7zm4 0h2v2h-2zm4 0h2v2h-2zm-8 4h2v2H7zm4 0h2v2h-2zm4 0h2v2h-2z"/>'},calendar:{body:'<path fill="currentColor" d="M5 4h14v2H5zm0 16h14v2H5zM3 10h2v10H3zm0-4h2v2H3zm16 0h2v2h-2zm0 4h2v10h-2zM3 8h18v2H3zm12-6h2v2h-2zM7 2h2v2H7z"/>'},"calendar-2":{body:'<path fill="currentColor" d="M5 4h14v2H5zm0 16h14v2H5zM3 10h2v10H3zm0-4h2v2H3zm16 0h2v2h-2zm0 4h2v10h-2zM3 8h18v2H3zm12-6h2v2h-2zM7 2h2v2H7zm0 10h2v2H7zm0 4h2v2H7zm4-4h2v2h-2zm0 4h2v2h-2zm4-4h2v2h-2z"/>'},"calendar-2-sharp":{body:'<path fill="currentColor" d="M3 4h18v2H3zm0 16h18v2H3zm0-10h2v10H3zm0-4h2v2H3zm16 0h2v2h-2zm0 4h2v10h-2zM3 8h18v2H3zm12-6h2v2h-2zM7 2h2v2H7zm0 10h2v2H7zm0 4h2v2H7zm4-4h2v2h-2zm0 4h2v2h-2zm4-4h2v2h-2z"/>'},"calendar-alert":{body:'<path fill="currentColor" d="M7 5V4H5v2H3v14h14V6h-2V4h-2v2H7zm-2 5V8h10v2zm0 2h10v6H5zm16-3V8h-2v6h2zm0 6h-2v2h2z"/>',hidden:!0},"calendar-arrow-left":{body:'<path fill="currentColor" d="M17 2h-2v2H9V2H7v2H3v8h2v-2h14v10h-8v2h10V4h-4zm2 6H5V6h14zm-6 8H7v-2h2v-2H7v2H5v2H3v2h2v2h2v2h2v-2H7v-2h6z"/>',hidden:!0},"calendar-arrow-right":{body:'<path fill="currentColor" d="M17 2h-2v2H9V2H7v2H3v18h10v-2H5V10h14v2h2V4h-4zM7 6h12v2H5V6zm14 10h-2v-2h-2v-2h-2v2h2v2h-6v2h6v2h-2v2h2v-2h2v-2h2z"/>',hidden:!0},"calendar-check":{body:'<path fill="currentColor" d="M15 2h2v2h4v18H3V4h4V2h2v2h6zm4 6V6H5v2zm0 2H5v10h14zm-3 2v2h-2v-2zm-4 4v-2h2v2zm-2 0h2v2h-2zm0 0H8v-2h2z"/>',hidden:!0},"calendar-export":{body:'<path fill="currentColor" d="M17 2h-2v2H9V2H7v2H3v18h4v-2H5V10h14v10h-2v2h4V4h-4zM7 6h12v2H5V6zm6 6h-2v6H9v-2H7v2h2v2h2v2h2v-2h2v-2h2v-2h-2v2h-2z"/>',hidden:!0},"calendar-grid":{body:'<path fill="currentColor" d="M3 3h18v18H3zm2 2v2h14V5zm14 4h-6v2h6zm0 4h-6v2h6zm0 4h-6v2h6zm-8 2v-2H5v2zm-6-4h6v-2H5zm0-4h6V9H5z"/>',hidden:!0},"calendar-import":{body:'<path fill="currentColor" d="M17 2h-2v2H9V2H7v2H3v18h4v-2H5V10h14v10h-2v2h4V4h-4zM7 6h12v2H5V6zm6 16h-2v-6H9v-2h2v-2h2v2h2v2h-2zm2-6v2h2v-2zm-6 0v2H7v-2z"/>',hidden:!0},"calendar-minus":{body:'<path fill="currentColor" d="M17 2h-2v2H9V2H7v2H3v18h18V4h-4zM7 6h12v2H5V6zM5 20V10h14v10zm10-6H9v2h6z"/>',hidden:!0},"calendar-month":{body:'<path fill="currentColor" d="M15 2h2v2h4v18H3V4h4V2h2v2h6zM9 6H5v2h14V6zm-4 4v10h14V10zm2 2h2v2H7zm6 0h-2v2h2zm2 0h2v2h-2zm-6 4H7v2h2zm2 0h2v2h-2zm6 0h-2v2h2z"/>',hidden:!0},"calendar-multiple":{body:'<path fill="currentColor" d="M17 2h2v2h4v14H5V4h4V2h2v2h6zm-6 4H7v2h14V6zm-4 4v6h14v-6zM3 20h16v2H1V8h2z"/>',hidden:!0},"calendar-multiple-check":{body:'<path fill="currentColor" d="M17 2h2v2h4v10h-2v-4H7v6h6v2H5V4h4V2h2v2h6zm-6 4H7v2h14V6zm2 14v2H1V8h2v12zm2-2h2v2h-2zm4 2v2h-2v-2zm2-2h-2v2h2zm0 0v-2h2v2z"/>',hidden:!0},"calendar-plus":{body:'<path fill="currentColor" d="M15 2h2v2h4v18H3V4h4V2h2v2h6zM9 6H5v2h14V6zm-4 4v10h14V10zm6 2h2v2h2v2h-2v2h-2v-2H9v-2h2z"/>',hidden:!0},"calendar-range":{body:'<path fill="currentColor" d="M5 4h14v2H5zm0 16h14v2H5zM3 10h2v10H3zm0-4h2v2H3zm16 0h2v2h-2zm0 4h2v10h-2zM3 8h18v2H3zm12-6h2v2h-2zM7 2h2v2H7zm4 10h6v2h-6zm-4 4h6v2H7z"/>'},"calendar-range-sharp":{body:'<path fill="currentColor" d="M3 4h18v2H3zm0 16h18v2H3zm0-10h2v10H3zm0-4h2v2H3zm16 0h2v2h-2zm0 4h2v10h-2zM3 8h18v2H3zm12-6h2v2h-2zM7 2h2v2H7zm4 10h6v2h-6zm-4 4h6v2H7z"/>'},"calendar-remove":{body:'<path fill="currentColor" d="M17 2h-2v2H9V2H7v2H3v18h18V4h-4zM7 6h12v2H5V6zM5 20V10h14v10zm6-4H9v2h2zm0-2v-2H9v2zm2 0h-2v2h2v2h2v-2h-2zm0 0v-2h2v2z"/>',hidden:!0},"calendar-search":{body:'<path fill="currentColor" d="M15 2h2v2h4v8h-2v-2H5v10h6v2H3V4h4V2h2v2h6zM9 6H5v2h14V6zm8 6v2h-4v-2zm-4 6h-2v-4h2zm4 0h-4v2h6v2h2v-2h-2v-6h-2z"/>',hidden:!0},"calendar-sharp":{body:'<path fill="currentColor" d="M3 4h18v2H3zm0 16h18v2H3zm0-10h2v10H3zm0-4h2v2H3zm16 0h2v2h-2zm0 4h2v10h-2zM3 8h18v2H3zm12-6h2v2h-2zM7 2h2v2H7z"/>'},"calendar-sort-ascending":{body:'<path fill="currentColor" d="M10 5H8v2H4V5H2v2H0v12h12V7h-2zM2 9h8v2H2zm0 8v-4h8v4zM20 7h-2v8h-2v-2h-2v2h2v2h2v2h2v-2h2v-2h2v-2h-2v2h-2z"/>',hidden:!0},"calendar-sort-descending":{body:'<path fill="currentColor" d="M10 5H8v2H4V5H2v2H0v12h12V7h-2zM2 9h8v2H2zm0 8v-4h8v4zm18 2h-2v-8h-2V9h2V7h2v2h2v2h-2zm2-8v2h2v-2zm-6 0v2h-2v-2z"/>',hidden:!0},"calendar-text":{body:'<path fill="currentColor" d="M5 4h14v2H5zm0 16h14v2H5zM3 10h2v10H3zm0-4h2v2H3zm16 0h2v2h-2zm0 4h2v10h-2zM3 8h18v2H3zm12-6h2v2h-2zM7 2h2v2H7zm0 10h8v2H7zm0 4h4v2H7z"/>'},"calendar-text-sharp":{body:'<path fill="currentColor" d="M3 4h18v2H3zm0 16h18v2H3zm0-10h2v10H3zm0-4h2v2H3zm16 0h2v2h-2zm0 4h2v10h-2zM3 8h18v2H3zm12-6h2v2h-2zM7 2h2v2H7zm0 10h8v2H7zm0 4h4v2H7z"/>'},"calendar-today":{body:'<path fill="currentColor" d="M17 2h-2v2H9V2H7v2H3v18h18V4h-4zM7 6h12v2H5V6zM5 20V10h14v10zm6-4v-4H7v4z"/>',hidden:!0},"calendar-tomorrow":{body:'<path fill="currentColor" d="M17 2h-2v2H9V2H7v2H3v18h18V4h-4zM7 6h12v2H5V6zM5 20V10h14v10zm12-2v-4h-4v4z"/>',hidden:!0},"calendar-week":{body:'<path fill="currentColor" d="M17 2h-2v2H9V2H7v2H3v18h18V4h-4zM7 6h12v2H5V6zM5 20V10h14v10zm12-8H7v2h10z"/>',hidden:!0},"calendar-week-begin":{body:'<path fill="currentColor" d="M17 2h-2v2H9V2H7v2H3v18h18V4h-4zM7 6h12v2H5V6zM5 20V10h14v10zm4-8H7v6h2z"/>',hidden:!0},"calendar-weekend":{body:'<path fill="currentColor" d="M17 2h-2v2H9V2H7v2H3v18h18V4h-4zM7 6h12v2H5V6zM5 20V10h14v10zm12-8h-2v6h2z"/>',hidden:!0},"calendar-weeks":{body:'<path fill="currentColor" d="M5 4h14v2H5zm0 16h14v2H5zM3 10h2v10H3zm0-4h2v2H3zm16 0h2v2h-2zm0 4h2v10h-2zM3 8h18v2H3zm12-6h2v2h-2zM7 2h2v2H7zm0 10h10v2H7zm0 4h10v2H7z"/>'},"calendar-weeks-sharp":{body:'<path fill="currentColor" d="M3 4h18v2H3zm0 16h18v2H3zm0-10h2v10H3zm0-4h2v2H3zm16 0h2v2h-2zm0 4h2v10h-2zM3 8h18v2H3zm12-6h2v2h-2zM7 2h2v2H7zm0 10h10v2H7zm0 4h10v2H7z"/>'},camera:{body:'<path fill="currentColor" d="M4 5h4v2H4zm4-2h8v2H8zm8 2h4v2h-4zM2 7h2v12H2zm2 12h16v2H4zM20 7h2v12h-2zM10 8h4v2h-4zm0 6h4v2h-4zm-2-4h2v4H8zm6 0h2v4h-2z"/>'},"camera-add":{body:'<path fill="currentColor" d="M5 2H3v3H0v2h3v3h2V7h3V5H5zm12 1h-7v2h5v2h5v12H5v-7H3v9h19V5h-5zm-7 6h4v2h2v4h-2v2h-4v-2h4v-4h-4zm-2 2h2v4H8z"/>',hidden:!0},"camera-alt":{body:'<path fill="currentColor" d="M4 4H2v16h20V4zm16 2v12H4V6zM8 8H6v2h2zm4 0h4v2h-4zm-2 2h2v4h-2zm6 4h2v-4h-2zm0 0h-4v2h4z"/>',hidden:!0},"camera-face":{body:'<path fill="currentColor" d="M7 3h10v2h5v16H2V7h2v12h16V7h-5V5H9v2H2V5h5zm7 12h-4v2h4zm-4-2v2H8v-2zm0-2V9H8v2zm6 2v2h-2v-2zm0-2V9h-2v2z"/>',hidden:!0},"camera-sharp":{body:'<path fill="currentColor" d="M2 5h6v2H2zm4-2h12v2H6zm10 2h6v2h-6zM2 7h2v12H2zm0 12h20v2H2zM20 7h2v12h-2zM10 8h4v2h-4zm0 6h4v2h-4zm-2-4h2v4H8zm6 0h2v4h-2z"/>'},cancel:{body:'<path fill="currentColor" d="M6 2h12v2H6zm0 18h12v2H6zM2 6h2v12H2zm18 0h2v12h-2zm-2-2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2H8zm-2 2h2v2H6zm12 2h2v2h-2zM4 4h2v2H4zm0 14h2v2H4z"/>'},car:{body:'<path fill="currentColor" d="M4 13h6v2H4zm10 0h6v2h-6zM4 17h6v2H4zm10 0h6v2h-6zM2 15h4v2H2zm6 0h8v2H8zm10 0h4v2h-4zm4-4h2v4h-2zm-6-4h2v2h-2zM4 5h12v2H4zm-4 6h2v4H0zm12-2h10v2H12zM2 7h2v4H2zm8 0h2v2h-2z"/>'},"car-sharp":{body:'<path fill="currentColor" d="M4 13h6v2H4zm10 0h6v2h-6zM4 17h6v2H4zm10 0h6v2h-6zM2 15h4v2H2zm6 0h8v2H8zm11 0h5v2h-5zm3-4h2v4h-2zm-6-4h2v2h-2zM4 5h12v2H4zM0 9h2v8H0zm12 0h10v2H12zM2 5h2v6H2zm8 2h2v2h-2z"/>'},card:{body:'<path fill="currentColor" d="M4 4h16v2H4zm0 14h16v2H4zM2 6h2v12H2zm18 0h2v12h-2z"/>'},"card-id":{body:'<path fill="currentColor" d="M2 4h20v16H2zm2 2v4h16V6zm16 6H10v2h10zm0 4h-4v2h4zm-6 2v-2H4v2zM4 14h4v-2H4z"/>',hidden:!0},"card-plus":{body:'<path fill="currentColor" d="M22 4H2v16h10v-2H4V6h16v4h2zm-3 13h3v-2h-3v-3h-2v3h-3v2h3v3h2z"/>',hidden:!0},"card-sharp":{body:'<path fill="currentColor" d="M2 4h20v2H2zm0 14h20v2H2zM2 6h2v12H2zm18 0h2v12h-2z"/>'},"card-stack":{body:'<path fill="currentColor" d="M4 4h18v12H2V4zm16 10V6H4v8zm2 4H2v2h20z"/>',hidden:!0},"card-text":{body:'<path fill="currentColor" d="M6 8h12v2H6zm0 4h8v2H6zM4 4h16v2H4zm0 14h16v2H4zM2 6h2v12H2zm18 0h2v12h-2z"/>'},"card-text-sharp":{body:'<path fill="currentColor" d="M6 8h12v2H6zm0 4h8v2H6zM2 4h20v2H2zm0 14h20v2H2zM2 6h2v12H2zm18 0h2v12h-2z"/>'},cart:{body:'<path fill="currentColor" d="M2 2h4v4h16v11H4V4H2zm4 13h14V8H6zm0 4h3v3H6zm14 0h-3v3h3z"/>',hidden:!0},cast:{body:'<path fill="currentColor" d="M4 3h18v18h-8v-2h6V5H4v4H2V3zm0 16H2v2h2zm-2-4h4v2H2zm8-4H2v2h8v8h2V11zm-4 4h2v6H6z"/>',hidden:!0},castle:{body:'<path fill="currentColor" d="M1 8h2v12H1zm2 12h18v2H3zM21 8h2v12h-2zM3 10h18v2H3zm2-8h2v8H5zm12 0h2v8h-2zM7 4h10v2H7zm2-2h2v2H9zm4 0h2v2h-2zM8 16h2v4H8zm2-2h4v2h-4zm4 2h2v4h-2z"/>'},"castle-sharp":{body:'<path fill="currentColor" d="M1 8h2v12H1zm0 12h22v2H1zM21 8h2v12h-2zM3 10h18v2H3zm2-8h2v8H5zm12 0h2v8h-2zM7 4h10v2H7zm2-2h2v2H9zm4 0h2v2h-2zM8 16h2v4H8zm0-2h8v2H8zm6 2h2v4h-2z"/>'},"cellular-signal-0":{body:'<path fill="currentColor" d="M4 14h2v2H4zm7-4h2v2h-2zm7-6h2v2h-2zM2 16h2v2H2zm7-4h2v6H9zm7-6h2v12h-2zM6 14h2v4H6zm7-4h2v8h-2zm7-6h2v14h-2zM2 18h6v2H2zm7 0h6v2H9zm7 0h6v2h-6z"/>'},"cellular-signal-0-sharp":{body:'<path fill="currentColor" d="M4 14h2v2H4zm7-4h2v2h-2zm7-6h2v2h-2zM2 14h2v4H2zm7-4h2v8H9zm7-6h2v14h-2zM6 14h2v4H6zm7-4h2v8h-2zm7-6h2v14h-2zM2 18h6v2H2zm7 0h6v2H9zm7 0h6v2h-6z"/>'},"cellular-signal-1":{body:'<path fill="currentColor" d="M4 12h2v6H4zm7-2h2v2h-2zm7-6h2v2h-2zM2 14h2v4H2zm7-2h2v6H9zm7-6h2v12h-2zM6 12h2v6H6zm7-2h2v8h-2zm7-6h2v14h-2zM2 18h6v2H2zm7 0h6v2H9zm7 0h6v2h-6z"/>'},"cellular-signal-1-sharp":{body:'<path fill="currentColor" d="M4 12h2v6H4zm7-2h2v2h-2zm7-6h2v2h-2zM2 12h2v6H2zm7-2h2v8H9zm7-6h2v14h-2zM6 12h2v6H6zm7-2h2v8h-2zm7-6h2v14h-2zM2 18h6v2H2zm7 0h6v2H9zm7 0h6v2h-6z"/>'},"cellular-signal-2":{body:'<path fill="currentColor" d="M4 12h2v6H4zm7-4h2v10h-2zm7-4h2v2h-2zM2 14h2v4H2zm7-4h2v8H9zm7-4h2v12h-2zM6 12h2v6H6zm7-4h2v10h-2zm7-4h2v14h-2zM2 18h6v2H2zm7 0h6v2H9zm7 0h6v2h-6z"/>'},"cellular-signal-2-sharp":{body:'<path fill="currentColor" d="M4 12h2v6H4zm7-4h2v10h-2zm7-4h2v2h-2zM2 12h2v6H2zm7-4h2v10H9zm7-4h2v14h-2zM6 12h2v6H6zm7-4h2v10h-2zm7-4h2v14h-2zM2 18h6v2H2zm7 0h6v2H9zm7 0h6v2h-6z"/>'},"cellular-signal-3":{body:'<g fill="currentColor"><path d="M4 14h2v4H4zm7-4h2v8h-2zm7-6h2v14h-2zM2 16h2v3H2zm7-4h2v6H9zm7-6h2v12h-2zM6 14h2v5H6zm7-4h2v8h-2zm7-6h2v14h-2z"/><path d="M2 18h6v2H2zm7 0h6v2H9zm7 0h6v2h-6z"/></g>'},"cellular-signal-3-sharp":{body:'<g fill="currentColor"><path d="M4 14h2v4H4zm7-4h2v8h-2zm7-6h2v14h-2zM2 14h2v5H2zm7-4h2v8H9zm7-6h2v14h-2zM6 14h2v5H6zm7-4h2v8h-2zm7-6h2v14h-2z"/><path d="M2 18h6v2H2zm7 0h6v2H9zm7 0h6v2h-6z"/></g>'},"cellular-signal-off":{body:'<path fill="currentColor" d="M4 2H2v2h2v2H2v2h2V6h2v2h2V6H6V4h2V2H6v2H4zm12 2v16h6V4zm2 2h2v12h-2zm-9 4v10h6V10zm2 8v-6h2v6zm-3-4v6H2v-6zm-2 4v-2H4v2z"/>',hidden:!0},chart:{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zM7 11h2v6H7zm4-4h2v10h-2zm4 6h2v4h-2z"/>'},"chart-add":{body:'<path fill="currentColor" d="M3 3h10v2H5v14h14v-8h2v10H3zm6 8H7v6h2zm2-4h2v10h-2zm6 6h-2v4h2zm0-10h2v2h2v2h-2v2h-2V7h-2V5h2z"/>',hidden:!0},"chart-bar":{body:'<path fill="currentColor" d="M13 5h2v14h-2zm-2 4H9v10h2zm-4 4H5v6h2zm12 0h-2v6h2z"/>',hidden:!0},"chart-bar-big":{body:'<path fill="currentColor" d="M4 20h18v2H4zM2 2h2v18H2zm16 11v3h-2v-3zM8 13v3H6v-3zm8-2v2H8v-2zm0 5v2H8v-2zm4-12v3h-2V4zM8 4v3H6V4zm10-2v2H8V2zm0 5v2H8V7z"/>'},"chart-bar-big-sharp":{body:'<path fill="currentColor" d="M4 20h18v2H4zM2 2h2v20H2zm16 11v3h-2v-3zM8 13v3H6v-3zm10-2v2H6v-2zm0 5v2H6v-2zm2-12v3h-2V4zM8 4v3H6V4zm12-2v2H6V2zm0 5v2H6V7z"/>'},"chart-column-decreasing":{body:'<path fill="currentColor" d="M4 20h18v2H4zM2 2h2v18H2zm5 4h2v12H7zm5 4h2v8h-2zm5 4h2v4h-2z"/>'},"chart-column-decreasing-sharp":{body:'<path fill="currentColor" d="M4 20h18v2H4zM2 2h2v20H2zm5 4h2v12H7zm5 4h2v8h-2zm5 4h2v4h-2z"/>'},"chart-delete":{body:'<path fill="currentColor" d="M13 3H3v18h18V11h-2v8H5V5h8zm-6 8h2v6H7zm6-4h-2v10h2zm2 6h2v4h-2zm2-6h-2v2h2zm0-2V3h-2v2zm2 0h-2v2h2v2h2V7h-2zm0 0V3h2v2z"/>',hidden:!0},"chart-line":{body:'<path fill="currentColor" d="M22 22H4v-2h18zM4 20H2V2h2zm4-6H6v-2h2zm8 0h-2v-2h2zm-6-2H8v-2h2zm4 0h-2v-2h2zm4 0h-2v-2h2zm-6-2h-2V8h2zm8 0h-2V8h2zm2-2h-2V6h2z"/>'},"chart-line-sharp":{body:'<path fill="currentColor" d="M4 20h18v2H2V2h2zm4-6H6v-2h2zm8 0h-2v-2h2zm-6-2H8v-2h2zm4 0h-2v-2h2zm4 0h-2v-2h2zm-6-2h-2V8h2zm8 0h-2V8h2zm2-2h-2V6h2z"/>'},"chart-minus":{body:'<path fill="currentColor" d="M13 3H3v18h18V11h-2v8H5V5h8zm-6 8h2v6H7zm6-4h-2v10h2zm2 6h2v4h-2zm6-8h-6v2h6z"/>',hidden:!0},"chart-multiple":{body:'<path fill="currentColor" d="M3 2H1v16h18V2zm0 2h14v12H3zm18 2v14H5v2h18V6zM7 8H5v6h2zm2-2h2v8H9zm6 4h-2v4h2z"/>',hidden:!0},"chart-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zM7 11h2v6H7zm4-4h2v10h-2zm4 6h2v4h-2z"/>'},chat:{body:'<path fill="currentColor" d="M20 2H2v20h2V4h16v12H6v2H4v2h2v-2h16V2z"/>',hidden:!0},check:{body:'<path fill="currentColor" d="M10 18H8v-2h2zm-2-2H6v-2h2zm4-2v2h-2v-2zm-6 0H4v-2h2zm8 0h-2v-2h2zm2-2h-2v-2h2zm2-2h-2V8h2zm2-2h-2V6h2z"/>'},"check-double":{body:'<path fill="currentColor" d="M7 18H5v-2h2zm6 0h-2v-2h2zm-8-2H3v-2h2zm4 0H7v-2h2zm6-2v2h-2v-2zM3 14H1v-2h2zm8 0H9v-2h2zm6 0h-2v-2h2zm-4-2h-2v-2h2zm6 0h-2v-2h2zm-4-2h-2V8h2zm6 0h-2V8h2zm-4-2h-2V6h2zm6 0h-2V6h2z"/>'},checkbox:{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2z"/>'},"checkbox-on":{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zM7 12h2v2H7zm2 2h2v2H9zm2-2h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2z"/>'},"checkbox-on-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zM7 12h2v2H7zm2 2h2v2H9zm2-2h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2z"/>'},"checkbox-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2z"/>'},checklist:{body:'<path fill="currentColor" d="M19 4h2v2h-2zm-2 4V6h2v2zm-2 0h2v2h-2zm0 0h-2V6h2zM3 6h8v2H3zm8 10H3v2h8zm7 2v-2h2v-2h-2v2h-2v-2h-2v2h2v2h-2v2h2v-2zm0 0v2h2v-2z"/>',hidden:!0},chess:{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zM8 4h4v4H8zM4 8h4v4H4zm4 4h4v4H8zm-4 4h4v4H4zM16 4h4v4h-4zm-4 4h4v4h-4zm4 4h4v4h-4zm-4 4h4v4h-4z"/>'},"chess-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zM8 4h4v4H8zM4 8h4v4H4zm4 4h4v4H8zm-4 4h4v4H4zM16 4h4v4h-4zm-4 4h4v4h-4zm4 4h4v4h-4zm-4 4h4v4h-4z"/>'},"chevron-down":{body:'<path fill="currentColor" d="M13 16h-2v-2h2zm-2-2H9v-2h2zm4 0h-2v-2h2zm-6-2H7v-2h2zm8 0h-2v-2h2zM7 10H5V8h2zm12 0h-2V8h2z"/>'},"chevron-down-2":{body:'<path fill="currentColor" d="M17 9v2h-2v2h-2v2h-2v-2H9v-2H7V9z"/>'},"chevron-left":{body:'<path fill="currentColor" d="M8 13v-2h2v2zm2-2V9h2v2zm0 4v-2h2v2zm2-6V7h2v2zm0 8v-2h2v2zm2-10V5h2v2zm0 12v-2h2v2z"/>'},"chevron-left-2":{body:'<path fill="currentColor" d="M15 17h-2v-2h-2v-2H9v-2h2V9h2V7h2z"/>'},"chevron-right":{body:'<path fill="currentColor" d="M16 13v-2h-2v2zm-2-2V9h-2v2zm0 4v-2h-2v2zm-2-6V7h-2v2zm0 8v-2h-2v2zM10 7V5H8v2zm0 12v-2H8v2z"/>'},"chevron-right-2":{body:'<path fill="currentColor" d="M9 17h2v-2h2v-2h2v-2h-2V9h-2V7H9z"/>'},"chevron-up":{body:'<path fill="currentColor" d="M13 8h-2v2h2zm-2 2H9v2h2zm4 0h-2v2h2zm-6 2H7v2h2zm8 0h-2v2h2zM7 14H5v2h2zm12 0h-2v2h2z"/>'},"chevron-up-2":{body:'<path fill="currentColor" d="M17 15v-2h-2v-2h-2V9h-2v2H9v2H7v2z"/>'},"chevrons-horizontal":{body:'<path fill="currentColor" d="M10 15v2H8v-2zm6 2h-2v-2h2zm-8-2H6v-2h2zm10 0h-2v-2h2zM6 13H4v-2h2zm14 0h-2v-2h2zM8 11H6V9h2zm10 0h-2V9h2zm-8-2H8V7h2zm6 0h-2V7h2z"/>'},"chevrons-horizontal-2":{body:'<path fill="currentColor" d="M8 15H6v-2H4v-2h2V9h2V7h2v10H8zm8-6h2v2h2v2h-2v2h-2v2h-2V7h2z"/>'},"chevrons-vertical":{body:'<path fill="currentColor" d="M13 20h-2v-2h2zm-2-2H9v-2h2zm4 0h-2v-2h2zm-6-2H7v-2h2zm8-2v2h-2v-2zm-8-4H7V8h2zm8 0h-2V8h2zm-6-2H9V6h2zm4 0h-2V6h2zm-2-2h-2V4h2z"/>'},"chevrons-vertical-2":{body:'<path fill="currentColor" d="M15 16v2h-2v2h-2v-2H9v-2H7v-2h10v2zM9 8V6h2V4h2v2h2v2h2v2H7V8z"/>'},"cigarette-off":{body:'<g fill="currentColor"><path d="M2 13h2v2H2zm2-2h9v2H4zm0 4h13v2H4zm3-2h2v2H7zm10-2h3v2h-3zm3 2h2v2h-2z"/><path d="M11 11h2v2h-2zM9 9h2v2H9zM7 7h2v2H7zM5 5h2v2H5zM3 3h2v2H3zm10 10h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zM14 6h2v3h-2zm-2-3h2v3h-2zm7 3h2v3h-2zm-2-3h2v3h-2z"/></g>'},"cigarette-off-sharp":{body:'<g fill="currentColor"><path d="M2 11h2v6H2zm2 0h9v2H4zm0 4h13v2H4zm3-2h2v2H7zm10-2h3v2h-3zm3 0h2v6h-2z"/><path d="M11 11h2v2h-2zM9 9h2v2H9zM7 7h2v2H7zM5 5h2v2H5zM3 3h2v2H3zm10 10h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zM14 6h2v3h-2zm-2-3h2v3h-2zm7 3h2v3h-2zm-2-3h2v3h-2z"/></g>'},circle:{body:'<path fill="currentColor" d="M6 2h12v2H6zm0 18h12v2H6zM2 6h2v12H2zm18 0h2v12h-2zm-2-2h2v2h-2zm0 14h2v2h-2zM4 4h2v2H4zm0 14h2v2H4z"/>'},"circle-info":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14 0h-2v-2h2zM4 18H2V6h2zm18 0h-2V6h2zm-9-1h-2v-6h2zm0-8h-2V7h2zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"circle-info-solid":{body:'<path fill="currentColor" d="M18 4h2v2h2v12h-2v2h-2v2H6v-2H4v-2H2V6h2V4h2V2h12zm-7 13h2v-6h-2zm0-8h2V7h-2z"/>'},"circle-pile":{body:'<path fill="currentColor" d="M11 2h2v2h-2zM7 9h2v2H7zm8 0h2v2h-2zM3 16h2v2H3zm8 0h2v2h-2zm8 0h2v2h-2zM9 4h2v2H9zm-4 7h2v2H5zm8 0h2v2h-2zM1 18h2v2H1zm8 0h2v2H9zm8 0h2v2h-2zM11 6h2v2h-2zm-4 7h2v2H7zm8 0h2v2h-2zM3 20h2v2H3zm8 0h2v2h-2zm8 0h2v2h-2zM13 4h2v2h-2zm-4 7h2v2H9zm8 0h2v2h-2zM5 18h2v2H5zm8 0h2v2h-2zm8 0h2v2h-2z"/>'},"circle-power":{body:'<path fill="currentColor" d="M6 20h12v2H6zM6 2h12v2H6zm12 2h2v2h-2zM4 4h2v2H4zm0 14h2v2H4zm14 0h2v2h-2zM2 6h2v12H2zm18 0h2v12h-2zM9 15h6v2H9zM7 9h2v6H7zm8 0h2v6h-2zm-4-2h2v5h-2z"/>'},"circle-question":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14 0h-2v-2h2zM4 18H2V6h2zm9 0h-2v-2h2zm9 0h-2V6h2zm-7-5h-2v2h-2v-4h4zm2-2h-2V8h2zm-8-1H7V8h2zm6-2H9V6h6zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"circle-question-solid":{body:'<path fill="currentColor" d="M18 4h2v2h2v12h-2v2h-2v2H6v-2H4v-2H2V6h2V4h2V2h12zm-7 14h2v-2h-2zm0-3h2v-2h2v-2h-4zm4-4h2V8h-2zm-8-1h2V8H7zm2-2h6V6H9z"/>'},"circle-square":{body:'<g fill="currentColor"><path d="M11 9h9v2h-9zm0 11h9v2h-9zm-2-9h2v9H9zm11 0h2v9h-2zM6 2h7v2H6z"/><path d="M6 15h7v2H6zm7-11h2v2h-2zm0 9h2v2h-2zM4 4h2v2H4zm0 9h2v2H4zm11-7h2v7h-2zM2 6h2v7H2z"/></g>'},"circuit-board":{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zM8 6h2v2H8zm8 12h-2v-2h2zM6 8h2v2H6zm12 8h-2v-2h2zM8 10h2v2H8zm8 4h-2v-2h2zm-6-6h6v2h-6zm4 8H8v-2h6zm2-12h2v4h-2zM8 20H6v-4h2z"/>'},"circuit-board-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zM8 6h2v2H8zm8 12h-2v-2h2zM6 8h2v2H6zm12 8h-2v-2h2zM8 10h2v2H8zm8 4h-2v-2h2zm-6-6h6v2h-6zm4 8H8v-2h6zm2-12h2v4h-2zM8 20H6v-4h2z"/>'},clapperboard:{body:'<path fill="currentColor" d="M4 3h16v2H4zm0 6h16v2H4zM2 5h2v14H2zm18 0h2v14h-2zM4 19h16v2H4zM18 7h-2v2h2zm-8 0H8v2h2zm6-2h-2v2h2zM8 5H6v2h2z"/>'},"clapperboard-sharp":{body:'<path fill="currentColor" d="M2 3h20v2H2zm2 6h16v2H4zM2 5h2v14H2zm18 0h2v14h-2zM2 19h20v2H2zM18 7h-2v2h2zm-8 0H8v2h2zm6-2h-2v2h2zM8 5H6v2h2z"/>'},clipboard:{body:'<path fill="currentColor" d="M4 6h2v14H4zm2 14h12v2H6zM18 6h2v14h-2zM6 4h2v2H6zm10 0h2v2h-2zm-6-2h4v2h-4zm0 4h4v2h-4zM8 2h2v6H8zm6 0h2v6h-2z"/>'},"clipboard-note":{body:'<g fill="currentColor"><path d="M20 12h2v8h-2zm-8-2h8v2h-8zm0 10h8v2h-8zm-2-8h2v8h-2zM6 2h8v2H6zm0 4h8v2H6zm0-2h2v2H6zm6 0h2v2h-2zm2 0h2v2h-2z"/><path d="M16 6h2v5h-2zM4 4h2v2H4zM2 6h2v12H2zm2 12h6v2H4zm2-8h4v2H6zm0 4h2v2H6zm11 2h5v2h-5z"/><path d="M16 16h2v6h-2z"/></g>'},"clipboard-note-sharp":{body:'<g fill="currentColor"><path d="M20 12h2v8h-2zm-10-2h12v2H10zm0 10h10v2H10zm0-8h2v8h-2zM6 2h8v2H6zm0 4h8v2H6zm0-2h2v2H6zm6 0h2v2h-2zm2 0h4v2h-4z"/><path d="M16 6h2v5h-2zM2 4h4v2H2zm0 2h2v12H2zm0 12h8v2H2zm4-8h2v2H6zm0 4h2v2H6zm11 2h5v2h-5z"/><path d="M16 16h2v6h-2z"/></g>'},"clipboard-sharp":{body:'<path fill="currentColor" d="M4 6h2v14H4zm0 14h16v2H4zM18 6h2v14h-2zM4 4h4v2H4zm12 0h4v2h-4zm-6-2h4v2h-4zm0 4h4v2h-4zM8 2h2v6H8zm6 0h2v6h-2z"/>'},clock:{body:'<path fill="currentColor" d="M6 2h12v2H6zM2 6h2v12H2zm18 0h2v12h-2zm-2-2h2v2h-2zM4 4h2v2H4zm2 18h12v-2H6zm12-2h2v-2h-2zM4 20h2v-2H4zm7-14h2v7h-2zm2 7h2v2h-2zm2 2h2v2h-2z"/>'},close:{body:'<path fill="currentColor" d="M7 19H5v-2h2zm12 0h-2v-2h2zM9 15v2H7v-2zm8 2h-2v-2h2zm-6-2H9v-2h2zm4 0h-2v-2h2zm-2-2h-2v-2h2zm-2-2H9V9h2zm4 0h-2V9h2zM9 9H7V7h2zm8 0h-2V7h2zM7 7H5V5h2zm12 0h-2V5h2z"/>'},"close-box":{body:'<path fill="currentColor" d="M5 3H3v18h18V3zm14 2v14H5V5zm-8 4H9V7H7v2h2v2h2v2H9v2H7v2h2v-2h2v-2h2v2h2v2h2v-2h-2v-2h-2v-2h2V9h2V7h-2v2h-2v2h-2z"/>',hidden:!0},cloud:{body:'<g fill="currentColor"><path d="M22 10h-4v2h4zm2 2h-2v6h2zm-2 6H2v2h20zM2 12H0v6h2zm2-2H2v2h2zm4-2H4v2h4zm8-4h-6v2h6zm-6 2H8v2h2zm0 4H8v2h2zm8-4h-2v2h2z"/><path d="M20 8h-2v4h2zm-2 4h-2v2h2z"/></g>'},"cloud-done":{body:'<path fill="currentColor" d="M16 4h-6v2H8v2H4v2H2v2H0v6h2v2h20v-2h2v-6h-2v-2h-2V8h-2V6h-2zm0 2v2h2v4h4v6H2v-6h2v-2h4V8h2V6zm-6 6H8v2h2v2h2v-2h2v-2h2v-2h-2v2h-2v2h-2z"/>',hidden:!0},"cloud-download":{body:'<path fill="currentColor" d="M10 4h6v2h-6zM8 8V6h2v2zm-4 2V8h4v2zm-2 2v-2h2v2zm0 6H0v-6h2zm0 0h5v2H2zM18 8h-2V6h2zm4 4h-4V8h2v2h2zm0 6v-6h2v6zm0 0v2h-5v-2zm-11 2h2v-2h2v-2h2v-2h-4V9h-2v5H7v2h2v2h2z"/>',hidden:!0},"cloud-moon":{body:'<path fill="currentColor" d="M14 22H4v-2h10zM4 20H2v-4h2zm12 0h-2v-4h2zm-6-2H8v-2h2zm-2-2H4v-2h4zm6 0h-2v-2h2zm6 0h-2v-2h2zm-8-2H8v-2h4zm10 0h-2v-4h-2V8h2V6h2zm-4-2h-4v-2h4zM8 10H6V6h2zm6 0h-2V6h2zm-4-4H8V4h2zm8-2h-2v2h-2V4h-4V2h8z"/>'},"cloud-server":{body:'<path fill="currentColor" d="M20 6h-2v2h2zm2 2h-2v4h2zm-2 4H4v2h16zM4 8H2v4h2zm4-2H4v2h4zm8-4h-6v2h6zm-6 2H8v2h2zm0 4H8v2h2zm8-4h-2v2h2zm0 4h-2v2h2zm-7 8h2v2h-2zm0 4h2v2h-2zm-7-2h7v2H4zm9 0h7v2h-7zm-2-4h2v2h-2z"/>'},"cloud-sun":{body:'<path fill="currentColor" d="M14 22H4v-2h10zM4 20H2v-4h2zm12 0h-2v-4h2zm-6-2H8v-2h2zm-2-2H4v-2h4zm6 0h-2v-2h2zm-2-2H8v-2h4zm12-1h-4v-2h4zm-6-1h-2v-2h2zM8 10H6V8h2zm8 0h-2V8h2zm-2-2H8V6h6zM6 6H4V4h2zm14 0h-2V4h2zM4 4H2V2h2zm9 0h-2V0h2zm9 0h-2V2h2z"/>'},"cloud-upload":{body:'<path fill="currentColor" d="M10 4h6v2h-6zM8 8V6h2v2zm-4 2V8h4v2zm-2 2v-2h2v2zm0 6H0v-6h2zm0 0h7v2H2zM18 8h-2V6h2zm4 4h-4V8h2v2h2zm0 6v-6h2v6zm0 0v2h-7v-2zM11 9h2v2h2v2h2v2h-4v5h-2v-5H7v-2h2v-2h2z"/>',hidden:!0},cocktail:{body:'<path fill="currentColor" d="M19 3H3v4h2v2h2v2h2v2h2v6H7v2h10v-2h-4v-6h2v-2h2V9h2V7h2V3zm0 4H5V5h14z"/>',hidden:!0},code:{body:'<path fill="currentColor" d="M11 18H9v-4h2zm-4-1H5v-2h2zm12-2v2h-2v-2zM5 15H3v-2h2zm16 0h-2v-2h2zm-8-1h-2v-4h2zM3 13H1v-2h2zm20 0h-2v-2h2zM5 11H3V9h2zm16 0h-2V9h2zm-6-1h-2V6h2zM7 9H5V7h2zm12 0h-2V7h2z"/>'},coffee:{body:'<path fill="currentColor" d="M4 4h16v2H4zm0 2h2v8H4zm2 8h10v2H6zm14-8h2v4h-2zm-2 4h2v2h-2zm-2-4h2v8h-2zM2 18h18v2H2z"/>'},"coffee-alt":{body:'<path fill="currentColor" d="M7 3H5v4h2zm4 0H9v4h2zm2 0h2v4h-2zm8 6H3v12h14v-5h4zm-2 5h-2v-3h2zM5 11h10v8H5z"/>',hidden:!0},"coffee-sharp":{body:'<path fill="currentColor" d="M4 4h16v2H4zm0 2h2v8H4zm0 8h14v2H4zM20 4h2v8h-2zm-2 6h2v2h-2zm-2-4h2v8h-2zM2 18h18v2H2z"/>'},coin:{body:'<path fill="currentColor" d="M6 2h12v2H6zM4 6V4h2v2zm0 12V6H2v12zm2 2v-2H4v2zm12 0v2H6v-2zm2-2v2h-2v-2zm0-12h2v12h-2zm0 0V4h-2v2zm-9-1h2v2h3v2h-6v2h6v6h-3v2h-2v-2H8v-2h6v-2H8V7h3z"/>',hidden:!0},coins:{body:'<g fill="currentColor"><path d="M6 2h6v2H6zM4 4h2v2H4zm8 0h2v2h-2zm-8 8h2v2H4zm8 0h2v2h-2zm-6 2h6v2H6zM2 6h2v6H2zm12 0h2v6h-2z"/><path d="M14 8h4v2h-4zm-4 10h2v2h-2zm8-8h2v2h-2zm-6 10h2v2h-2zm6-2h2v2h-2z"/><path d="M12 20h6v2h-6zm-4-6h2v4H8zm12-2h2v6h-2zM7 6h4v2H7z"/><path d="M9 6h2v6H9zm6 8h2v4h-2zm-1-2h3v2h-3z"/></g>'},collapse:{body:'<path fill="currentColor" d="M7 19h2v-2h2v-2h2v2h2v2h2v2H7zm13-6H4v-2h16zm-3-8h-2v2h-2v2h-2V7H9V5H7V3h10z"/>'},"colors-swatch":{body:'<path fill="currentColor" d="M14 2h6v2h-6zm0 18h6v2h-6zM4 20h10v2H4zm8-16h2v16h-2zm8 0h2v16h-2zM2 16h2v4H2zm2-2h8v2H4zm12 2h2v2h-2zM6 12h2v2H6zM4 8h2v4H4zm2-2h4v2H6zm4 2h2v2h-2z"/>'},"colors-swatch-sharp":{body:'<path fill="currentColor" d="M12 2h10v2H12zm2 18h8v2h-8zM4 20h10v2H4zm8-16h2v16h-2zm8 0h2v16h-2zM2 14h2v8H2zm2 0h8v2H4zm12 2h2v2h-2zM6 12h2v2H6zm-2-2h2v2H4zm2-2h2v2H6zm2-2h2v2H8zm2 2h2v2h-2z"/>'},command:{body:'<path fill="currentColor" d="M4 2H2v8h2zm16 0h2v8h-2zm-6 6h-4V2H4v2h4v4H4v2h4v4H4v2h4v4H4v2h6v-6h4v6h2v-6h4v-2h-4v-4h4V8h-4V2h-2zm-4 6v-4h4v4zM20 2h-4v2h4zM2 14h2v8H2zm14 6h4v2h-4zm6-6h-2v8h2z"/>',hidden:!0},comment:{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 14h14v2H4zM2 4h2v12H2zm18 0h2v18h-2zm-2 14h2v2h-2z"/>'},"comment-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 14h16v2H2zM2 4h2v12H2zm18 0h2v18h-2zm-2 14h2v2h-2z"/>'},"comment-text":{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 14h14v2H4zm2-6h6v2H6zm0-4h12v2H6zM2 4h2v12H2zm18 0h2v18h-2zm-2 14h2v2h-2z"/>'},"comment-text-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 14h16v2H2zm4-6h6v2H6zm0-4h12v2H6zM2 4h2v12H2zm18 0h2v18h-2zm-2 14h2v2h-2z"/>'},compass:{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14 0h-2v-2h2zm-10-4h2v2h-2v1H8v-9h2zm-6 2H2V6h2zm18 0h-2V6h2zm-8-2h-2v-2h2zm2-2h-2V8h-2V6h2V5h2zm-3-1h-2v-2h2zm-1-3h-2V8h2zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"compass-solid":{body:'<path fill="currentColor" d="M18 4h2v2h2v12h-2v2h-2v2H6v-2H4v-2H2V6h2V4h2V2h12zm-4 2h-2v2h-2v2H8v9h2v-1h2v-2h2v-2h2V5h-2zm-1 7h-2v-2h2z"/>'},computer:{body:'<path fill="currentColor" d="M6 1h12v2H6zm0 8h12v2H6zM4 3h2v6H4zm14 0h2v6h-2zM4 13h16v2H4zm0 8h16v2H4zm-2-6h2v6H2zm18 0h2v6h-2zM6 17h2v2H6zm4 0h8v2h-8zm-2-6h2v2H8zm6 0h2v2h-2z"/>'},"computer-sharp":{body:'<path fill="currentColor" d="M4 1h16v2H4zm0 8h16v2H4zm0-6h2v6H4zm14 0h2v6h-2zM2 13h20v2H2zm0 8h20v2H2zm0-6h2v6H2zm18 0h2v6h-2zM6 17h2v2H6zm4 0h8v2h-8zm-2-6h2v2H8zm6 0h2v2h-2z"/>'},contact:{body:'<path fill="currentColor" d="M2 2h20v2H2zM0 4h2v16H0zm22 0h2v16h-2zM2 20h20v2H2zM14 7h6v2h-6zm0 4h6v2h-6zm0 4h4v2h-4zM6 7h4v4H6zm0 6h4v2H6zm4 2h2v2h-2zm-6 0h2v2H4z"/>'},"contact-delete":{body:'<path fill="currentColor" d="M22 3H0v18h16v-2H2V5h20v10h2V3zM6 7h4v4H6zm0 8H4v2h2zm4 0H6v-2h4zm0 0v2h2v-2zm4-8h6v2h-6zm6 4h-6v2h6zm-6 4h2v2h-2zm8 4h-2v-2h-2v2h2v2h-2v2h2v-2h2v2h2v-2h-2zm0 0h2v-2h-2z"/>',hidden:!0},"contact-multiple":{body:'<path fill="currentColor" d="M4 3h20v14H4zm18 12V5H6v10zm-2 4H2V7H0v14h20zM9 7h2v2H9zm3 4H8v2h4zm2-4h6v2h-6zm6 4h-6v2h6z"/>',hidden:!0},"contact-plus":{body:'<path fill="currentColor" d="M2 3h22v11h-2V5H2v14h12v2H0V3zm8 4H6v4h4zm-6 6h8v4H4zm16-6h-6v2h6zm-6 4h6v2h-6zm3 4h-3v2h3zm4 6v3h-2v-3h-3v-2h3v-3h2v3h3v2z"/>',hidden:!0},"contact-sharp":{body:'<path fill="currentColor" d="M0 2h24v2H0zm0 2h2v16H0zm22 0h2v16h-2zM0 20h24v2H0zM14 7h6v2h-6zm0 4h6v2h-6zm0 4h4v2h-4zM6 7h4v4H6zm0 6h4v2H6zm4 2h2v2h-2zm-6 0h2v2H4z"/>'},copy:{body:'<path fill="currentColor" d="M8 6h12v2H8zM4 2h12v2H4zm2 6h2v12H6zM2 4h2v12H2zm6 16h12v2H8zM20 8h2v12h-2zm-4-4h2v2h-2zM4 16h2v2H4z"/>'},"copy-sharp":{body:'<path fill="currentColor" d="M6 6h16v2H6zM2 2h16v2H2zm4 6h2v12H6zM2 4h2v12H2zm4 16h16v2H6zM20 8h2v12h-2zm-4-4h2v2h-2zM2 16h4v2H2z"/>'},"copy-x":{body:'<path fill="currentColor" d="M8 6h12v2H8zM4 2h12v2H4zm2 6h2v12H6zM2 4h2v12H2zm6 16h12v2H8zM20 8h2v12h-2zm-4-4h2v2h-2zM4 16h2v2H4zm7-5h2v2h-2zm4 4h2v2h-2zm0-4h2v2h-2zm-4 4h2v2h-2zm2-2h2v2h-2z"/>'},"copy-x-sharp":{body:'<path fill="currentColor" d="M6 6h16v2H6zM2 2h16v2H2zm4 6h2v12H6zM2 4h2v12H2zm4 16h16v2H6zM20 8h2v12h-2zm-4-4h2v2h-2zM2 16h4v2H2zm9-5h2v2h-2zm4 4h2v2h-2zm0-4h2v2h-2zm-4 4h2v2h-2zm2-2h2v2h-2z"/>'},"corner-down-left":{body:'<g fill="currentColor"><path d="M18 16H4v-2h14zm2-2h-2V4h2z"/><path d="M8 10h2v8H8zm-2 2h2v2H6zm0 4h2v2H6zm2 2h2v2H8z"/></g>'},"corner-down-left-sharp":{body:'<g fill="currentColor"><path d="M18 16H4v-2h14zm2 0h-2V4h2z"/><path d="M8 10h2v8H8zm-2 2h2v2H6zm0 4h2v2H6zm2 2h2v2H8z"/></g>'},"corner-down-right":{body:'<g fill="currentColor"><path d="M6 16h14v-2H6zm-2-2h2V4H4z"/><path d="M16 10h-2v8h2zm2 2h-2v2h2zm0 4h-2v2h2zm-2 2h-2v2h2z"/></g>'},"corner-down-right-sharp":{body:'<g fill="currentColor"><path d="M6 16h14v-2H6zm-2 0h2V4H4z"/><path d="M16 10h-2v8h2zm2 2h-2v2h2zm0 4h-2v2h2zm-2 2h-2v2h2z"/></g>'},"corner-left-down":{body:'<g fill="currentColor"><path d="M8 6v14h2V6zm2-2v2h10V4zm4 12v-2h-2v2zm-2 2v-2h-2v2zm-4 0v-2H6v2z"/><path d="M14 16v-2H4v2z"/></g>'},"corner-left-down-sharp":{body:'<g fill="currentColor"><path d="M8 4v16h2V4zm2 0v2h10V4zm4 12v-2h-2v2zm-2 2v-2h-2v2zm-4 0v-2H6v2z"/><path d="M14 16v-2H4v2z"/></g>'},"corner-left-up":{body:'<g fill="currentColor"><path d="M8 18V4h2v14zm2 2v-2h10v2zm4-12v2h-2V8zm-2-2v2h-2V6zM8 6v2H6V6z"/><path d="M12 8v2H4V8z"/></g>'},"corner-left-up-sharp":{body:'<g fill="currentColor"><path d="M8 18V4h2v14zm0 2v-2h12v2zm6-12v2h-2V8zm-2-2v2h-2V6zM8 6v2H6V6z"/><path d="M12 8v2H4V8z"/></g>'},"corner-right-down":{body:'<g fill="currentColor"><path d="M16 6v14h-2V6zm-2-2v2H4V4z"/><path d="M10 16v-2h10v2zm2 2v-2h2v2zm4 0v-2h2v2z"/><path d="M18 16v-2h2v2z"/></g>'},"corner-right-down-sharp":{body:'<g fill="currentColor"><path d="M16 4v16h-2V4zm-2 0v2H4V4z"/><path d="M10 16v-2h10v2zm2 2v-2h2v2zm4 0v-2h2v2z"/><path d="M18 16v-2h2v2z"/></g>'},"corner-right-up":{body:'<g fill="currentColor"><path d="M16 18V4h-2v14zm-2 2v-2H4v2z"/><path d="M10 8v2h8V8zm2-2v2h2V6zm4 0v2h2V6zm2 2v2h2V8z"/></g>'},"corner-right-up-sharp":{body:'<g fill="currentColor"><path d="M16 20V4h-2v16zm-2 0v-2H4v2z"/><path d="M10 8v2h8V8zm2-2v2h2V6zm4 0v2h2V6zm2 2v2h2V8z"/></g>'},"corner-up-left":{body:'<g fill="currentColor"><path d="M18 8H4v2h14zm2 2h-2v10h2zM8 14h2v-2H8zm-2-2h2v-2H6zm0-4h2V6H6z"/><path d="M8 12h2V4H8z"/></g>'},"corner-up-left-sharp":{body:'<g fill="currentColor"><path d="M18 8H4v2h14zm2 0h-2v12h2zM8 14h2v-2H8zm-2-2h2v-2H6zm0-4h2V6H6z"/><path d="M8 12h2V4H8z"/></g>'},"corner-up-right":{body:'<g fill="currentColor"><path d="M6 8h14v2H6zm-2 2h2v10H4zm12 4h-2v-2h2zm2-2h-2v-2h2zm0-4h-2V6h2z"/><path d="M16 12h-2V4h2z"/></g>'},"corner-up-right-sharp":{body:'<g fill="currentColor"><path d="M6 8h14v2H6zM4 8h2v12H4zm12 6h-2v-2h2zm2-2h-2v-2h2zm0-4h-2V6h2z"/><path d="M16 12h-2V4h2z"/></g>'},cpu:{body:'<path fill="currentColor" d="M5 3h14v2H5zm0 16h14v2H5zM3 5h2v14H3zm16 0h2v14h-2zM9 7h6v2H9zm0 8h6v2H9zM7 9h2v6H7zm8 0h2v6h-2zm-4-8h2v2h-2zm0 20h2v2h-2zM1 11h2v2H1zm20 0h2v2h-2zm0-4h2v2h-2zm0 8h2v2h-2zM1 15h2v2H1zm0-8h2v2H1zm6-6h2v2H7zm8 0h2v2h-2zm0 20h2v2h-2zm-8 0h2v2H7z"/>'},"cpu-sharp":{body:'<path fill="currentColor" d="M5 3h14v2H5zm0 16h14v2H5zM3 5h2v14H3zm16 0h2v14h-2zM7 7h10v2H7zm0 8h10v2H7zm0-6h2v6H7zm8 0h2v6h-2zm-4-8h2v2h-2zm0 20h2v2h-2zM1 11h2v2H1zm20 0h2v2h-2zm0-4h2v2h-2zm0 8h2v2h-2zM1 15h2v2H1zm0-8h2v2H1zm6-6h2v2H7zm8 0h2v2h-2zm0 20h2v2h-2zm-8 0h2v2H7z"/>'},"credit-card":{body:'<path fill="currentColor" d="M4 4h16v2H4zm0 14h16v2H4zM2 6h2v12H2zm18 0h2v12h-2zM4 8h16v4H4zm2 6h6v2H6z"/>'},"credit-card-delete":{body:'<path fill="currentColor" d="M20 4H2v16h12v-2H4v-6h16V8H4V6h16zm0 0h2v8h-2zm2 14h-2v-2h2v-2h-2v2h-2v-2h-2v2h2v2h-2v2h2v-2h2v2h2z"/>',hidden:!0},"credit-card-minus":{body:'<path fill="currentColor" d="M20 4H2v16h12v-2H4v-6h16V8H4V6h16zm0 0h2v8h-2zm2 12h-6v2h6z"/>',hidden:!0},"credit-card-multiple":{body:'<path fill="currentColor" d="M1 3h16v2H3v2h14v4H3v4h14v2H1zm18 0h-2v14h2zM5 19h16v2H5zM23 7h-2v14h2z"/>',hidden:!0},"credit-card-plus":{body:'<path fill="currentColor" d="M2 4h18v2H4v2h16v4H4v6h10v2H2zm20 0h-2v8h2zm-4 10h2v2h2v2h-2v2h-2v-2h-2v-2h2z"/>',hidden:!0},"credit-card-settings":{body:'<path fill="currentColor" d="M20 4H2v16h18v-2H4v-6h16V8H4V6h16zm0 0h2v16h-2zm-7 18h-2v2h2zm2 0h2v2h-2zm-6 0H7v2h2z"/>',hidden:!0},"credit-card-sharp":{body:'<path fill="currentColor" d="M2 4h20v2H2zm0 14h20v2H2zM2 6h2v12H2zm18 0h2v12h-2zM4 8h16v4H4zm2 6h6v2H6z"/>'},"credit-card-wireless":{body:'<path fill="currentColor" d="M16 2H8v2H6v2h2V4h8v2h2V4h-2zM8 8h2v2H8zm6 0V6h-4v2zm0 0h2v2h-2zM4 11h16v12H4zm14 10v-3H6v3zm0-6v-2H6v2z"/>',hidden:!0},crop:{body:'<path fill="currentColor" d="M18 16h4v2h-4v4h-2V8h2zm-4 2H8v-2h6zm-6-2H6v-6h2zM8 6h8v2H2V6h4V2h2z"/>'},"crop-sharp":{body:'<path fill="currentColor" d="M8 6h10v10h4v2h-4v4h-2V8H2V6h4V2h2zm0 10h6v2H6v-8h2z"/>'},cross:{body:'<path fill="currentColor" d="M14 22h-4v-2h4zm-4-2H8v-4H4v-2h6zm10-4h-4v4h-2v-6h6zM4 14H2v-4h2zm18 0h-2v-4h2zm-12-4H4V8h4V4h2zm6-2h4v2h-6V4h2zm-2-4h-4V2h4z"/>'},"cross-glyph":{body:'<path fill="currentColor" d="M16 8h6v8h-6v6H8v-6H2V8h6V2h8z"/>'},"cross-sharp":{body:'<path fill="currentColor" d="M16 8h6v8h-6v6H8v-6H2V8h6V2h8zm-6 2H4v4h6v6h4v-6h6v-4h-6V4h-4z"/>'},"cross-solid":{body:'<path fill="currentColor" d="M14 4h2v4h4v2h2v4h-2v2h-4v4h-2v2h-4v-2H8v-4H4v-2H2v-4h2V8h4V4h2V2h4z"/>'},crown:{body:'<g fill="currentColor"><path d="M3 3h2v12H3zm16 0h2v12h-2zm-8 0h2v2h-2zM9 5h2v2H9zM5 5h2v2H5z"/><path d="M3 3h2v2H3zm4 4h2v2H7zm6-2h2v2h-2zm2 2h2v2h-2zm2-2h2v2h-2zM5 15h14v2H5zm-2 4h18v2H3z"/></g>'},"crown-sharp":{body:'<g fill="currentColor"><path d="M3 3h2v12H3zm16 0h2v12h-2zm-8 0h2v2h-2zM9 5h2v2H9zM5 5h2v2H5z"/><path d="M3 3h2v2H3zm4 4h2v2H7zm6-2h2v2h-2zm2 2h2v2h-2zm2-2h2v2h-2zM3 15h18v2H3zm0 4h18v2H3z"/></g>'},"cursor-minimal":{body:'<path fill="currentColor" d="M6 4h2v16H6zm2 0h2v2H8zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm-8 6h2v2H8zm2-2h2v2h-2zm2-2h6v2h-6z"/>'},cut:{body:'<g fill="currentColor"><path d="M1 17h2v4H1zm14 0h2v4h-2zM3 21h4v2H3zm14 0h4v2h-4zM3 15h4v2H3zm14 0h4v2h-4zM7 17h2v4H7zm14 0h2v4h-2zM7 15h2v2H7zm8 0h2v2h-2zm-6-2h2v2H9zm6 0h-2v2h2zm-4-2h2v2h-2z"/><path d="M13 11h-2v2h2zm0-2h2v2h-2zm-2 0H9v2h2zm4-2h2v2h-2zM9 7H7v2h2zm8-2h2v2h-2zM7 5H5v2h2zm12-2h2v2h-2zM5 3H3v2h2z"/></g>'},"cut-sharp":{body:'<g fill="currentColor"><path d="M1 15h2v8H1zm14 2h2v4h-2zM3 21h6v2H3zm12 0h6v2h-6zM3 15h4v2H3zm14 0h4v2h-4zM7 17h2v4H7zm14-2h2v8h-2zM7 15h2v2H7zm8 0h2v2h-2zm-6-2h2v2H9zm6 0h-2v2h2zm-4-2h2v2h-2z"/><path d="M13 11h-2v2h2zm0-2h2v2h-2zm-2 0H9v2h2zm4-2h2v2h-2zM9 7H7v2h2zm8-2h2v2h-2zM7 5H5v2h2zm12-2h2v2h-2zM5 3H3v2h2z"/></g>'},dashboard:{body:'<path fill="currentColor" d="M3 3h8v10H3zm2 2v6h4V5zm8-2h8v6h-8zm2 2v2h4V5zm-2 6h8v10h-8zm2 2v6h4v-6zM3 15h8v6H3zm2 2v2h4v-2z"/>',hidden:!0},database:{body:'<path fill="currentColor" d="M2 6h2v4H2zm0 4h2v4H2zm0 4h2v4H2zm18-8h2v4h-2zm0 4h2v4h-2zm0 4h2v4h-2zM4 4h4v2H4zm0 8h4v-2H4zm0 4h4v-2H4zm0 4h4v-2H4zM16 4h4v2h-4zm0 8h4v-2h-4zm0 4h4v-2h-4zm0 4h4v-2h-4zM8 2h8v2H8zm0 12h8v-2H8zm0 4h8v-2H8zm0 4h8v-2H8z"/>'},"date-time":{body:'<path fill="currentColor" d="M21 23h-8v-2h8zM9 21H3v-2h6zm4 0h-2v-8h2zm10 0h-2v-8h2zM3 7h14V5h2v4H3v10H1V5h2zm15 10h2v2h-2v-1h-2v-4h2zm3-4h-8v-2h8zM7 3h6V1h2v2h2v2H3V3h2V1h2z"/>'},debug:{body:'<path fill="currentColor" d="M8 6h8v2H8zm0 14h8v2H8zM6 8h2v12H6zm10 0h2v12h-2zM4 8h2v2H4zm16 0h-2v2h2zM4 18h2v2H4zm16 0h-2v2h2zM2 20h2v2H2zm20 0h-2v2h2zM2 6h2v2H2zm20 0h-2v2h2zM2 13h4v2H2zm20 0h-4v2h4zM6 2h2v2H6zm2 2h2v2H8zm6 0h2v2h-2zm2-2h2v2h-2zm-6 8h4v2h-4zm0 4h4v2h-4z"/>'},"debug-check":{body:'<path fill="currentColor" d="M8 2H6v2h2v2H6v3H4V7H2v2h2v2h2v2H2v2h4v2H4v2H2v2h2v-2h2v3h6v-2H8V8h8v6h2v-3h2V9h2V7h-2v2h-2V6h-2V4h2V2h-2v2h-2v2h-4V4H8zm6 9h-4v2h4zm-4 4h2v2h-2zm4 3h2v2h-2zm4 2v2h-2v-2zm2-2h-2v2h2zm0 0v-2h2v2z"/>',hidden:!0},"debug-off":{body:'<path fill="currentColor" d="M16 2h2v2h-2zm4 7h-2V6h-2V4h-2v2h-2v2h4v5h2v2h4v-2h-4v-2h2zm0 0V7h2v2zM8 20v-9H6V9H4V7H2v2h2v2h2v2H2v2h4v2H4v2H2v2h2v-2h2v3h10v-2zm2-5h2v2h-2zM2 2h2v2H2zm4 4H4V4h2zm2 2H6V6h2zm2 2H8V8h2zm0 0v2h2v2h2v2h2v2h2v2h2v2h2v-2h-2v-2h-2v-2h-2v-2h-2v-2h-2v-2z"/>',hidden:!0},"debug-pause":{body:'<path fill="currentColor" d="M8 2H6v2h2v2H6v3H4V7H2v2h2v2h2v2H2v2h4v2H4v2H2v2h2v-2h2v3h8v-2H8V8h8v6h2v-3h2V9h2V7h-2v2h-2V6h-2V4h2V2h-2v2h-2v2h-4V4H8zm6 9h-4v2h4zm-4 4h4v2h-4zm6 1h2v6h-2zm6 0h-2v6h2z"/>',hidden:!0},"debug-play":{body:'<path fill="currentColor" d="M6 2h2v2H6zm10 2h-2v2h-4V4H8v2H6v3H4V7H2v2h2v2h2v2H2v2h4v2H4v2H2v2h2v-2h2v3h8v-2H8V8h8v3h4V9h2V7h-2v2h-2V6h-2zm0 0V2h2v2zm-6 7h4v2h-4zm4 4h-4v2h4zm4-2h-2v10h2v-2h2v-2h2v-2h-2v-2h-2z"/>',hidden:!0},"debug-stop":{body:'<path fill="currentColor" d="M6 2h2v2H6zm10 2h-2v2h-4V4H8v2H6v3H4V7H2v2h2v2h2v2H2v2h4v2H4v2H2v2h2v-2h2v3h8v-2H8V8h8v6h2v-3h2V9h2V7h-2v2h-2V6h-2zm0 0V2h2v2zm-6 7h4v2h-4zm4 4h-4v2h4zm8 1h-6v6h6z"/>',hidden:!0},delete:{body:'<path fill="currentColor" d="M6 7h2v2H6zm14 0h2v10h-2zM8 5h12v2H8zM4 9h2v2H4zm-2 2h2v2H2zm2 2h2v2H4zm2 2h2v2H6zm2 2h12v2H8zm6-6h2v2h-2zm2 2h2v2h-2zm0-4h2v2h-2zm-4 4h2v2h-2zm0-4h2v2h-2z"/>'},"delete-sharp":{body:'<path fill="currentColor" d="M6 7h2v2H6zm14 0h2v10h-2zM8 5h14v2H8zM4 9h2v2H4zm-2 2h2v2H2zm2 2h2v2H4zm2 2h2v2H6zm2 2h14v2H8zm6-6h2v2h-2zm2 2h2v2h-2zm0-4h2v2h-2zm-4 4h2v2h-2zm0-4h2v2h-2z"/>'},deno:{body:'<path fill="currentColor" d="M14 20h4v2H6v-2h6v-3h2zm-8 0H4v-2h2zm16-2h-2v2h-2v-4h2V6h2zM4 18H2V6h2zm8-1H8v-2h4zm6-1h-2v-6h2zM8 15H6v-5h2zm5-2h-2v-2h2zm3-3H8V8h8zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"deno-solid":{body:'<path fill="currentColor" d="M18 4h2v2h2v12h-2v-2h-2v2h2v2h-2v2h-4v-5h-2v5H6v-2H4v-2H2V6h2V4h2V2h12zM8 17h4v-2H8zm0-7H6v5h2zh8v6h2v-6h-2V8H8zm3 3h2v-2h-2z"/>'},deskphone:{body:'<path fill="currentColor" d="M3 3h18v18H3zm2 2v6h8V5zm10 0v14h4V5zm-2 14v-2h-3v2zm-5 0v-2H5v2zm-3-4h3v-2H5zm5-2v2h3v-2z"/>',hidden:!0},"device-laptop":{body:'<path fill="currentColor" d="M6 4H4v12h16V4zm12 2v8H6V6zm4 12H2v2h20z"/>',hidden:!0},"device-phone":{body:'<path fill="currentColor" d="M6 3h12v18H6zm10 16V5h-2v2h-4V5H8v14zm-5-4h2v2h-2z"/>',hidden:!0},"device-tablet":{body:'<path fill="currentColor" d="M6 2H4v20h16V2zm12 2v16H6V4zm-5 12h-2v2h2z"/>',hidden:!0},"device-tv":{body:'<path fill="currentColor" d="M2 20h20V6h-7V4h-2v2h-2V4H9v2H2zM9 4V2H7v2zm6 0h2V2h-2zm5 4v10H4V8z"/>',hidden:!0},"device-tv-smart":{body:'<path fill="currentColor" d="M4 4h18v14h-6v2H8v-2H2V4zm16 12V6H4v10z"/>',hidden:!0},"device-vibrate":{body:'<path fill="currentColor" d="M8 3H6v18h12V3zm8 2v14H8V5zm-3 10h-2v2h2zm7-8h2v2h-2zm2 4V9h2v2zm0 2h-2v-2h2zm0 2v-2h2v2zm0 0v2h-2v-2zM2 17h2v-2H2v-2h2v-2H2V9h2V7H2v2H0v2h2v2H0v2h2z"/>',hidden:!0},"device-watch":{body:'<path fill="currentColor" d="M8 2h8v4h5v12h-5v4H8v-4H3V6h5zM5 16h14V8H5zm6-6h2v2h2v2h-4z"/>',hidden:!0},devices:{body:'<path fill="currentColor" d="M2 2h16v6h4v14H12v-6H2zm14 6V4H4v10h8V8zm-6-2H6v2h4zm10 14V10h-6v10zm-4-4h2v2h-2zM6 10h4v2H6z"/>',hidden:!0},"diamond-gem":{body:'<path fill="currentColor" d="M7 1h10v2H7zM5 3h2v2H5zm12 0h2v2h-2zm2 2h2v2h-2zm0 8h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2h-2zm-2-2h2v2H9zm-2-2h2v2H7zm-2-2h2v2H5zm-2-2h2v2H3zm0-8h2v2H3zM1 7h2v6H1zm20 0h2v6h-2zM3 9h18v2H3zm6-6h2v3H9zM7 6h2v3H7zm8 0h2v3h-2zm-8 5h2v2H7zm2 2h2v3H9zm2 3h2v3h-2zm2-3h2v3h-2zm2-2h2v2h-2zm-2-8h2v3h-2z"/>'},dice:{body:'<path fill="currentColor" d="M5 3H3v18h18V3zm14 2v14H5V5zM9 7H7v2h2zm6 0h2v2h-2zm-6 8H7v2h2zm6 0h2v2h-2zm-2-4h-2v2h2z"/>',hidden:!0},directions:{body:'<g fill="currentColor"><path d="M2 2h2v2H2zm2 2h2v2H4zm2-2h2v2H6zM2 6h2v2H2zm4 0h2v2H6zm11 9h3v2h-3zm-2 2h2v3h-2zm2 3h3v2h-3zm3-3h2v3h-2zM15 2h2v10h-2zm-2 2h2v2h-2z"/><path d="M11 6h9v2h-9z"/><path d="M19 6h2v2h-2zm-2-2h2v2h-2zM6 12h9v2H6zm-2 2h2v4H4zm0 6h2v2H4z"/></g>'},"directions-sharp":{body:'<g fill="currentColor"><path d="M2 2h2v2H2zm2 2h2v2H4zm2-2h2v2H6zM2 6h2v2H2zm4 0h2v2H6zm11 9h3v2h-3zm-2 2h2v3h-2zm2 3h3v2h-3zm3-3h2v3h-2zM15 2h2v10h-2zm-2 2h2v2h-2z"/><path d="M11 6h9v2h-9z"/><path d="M19 6h2v2h-2zm-2-2h2v2h-2zM4 12h13v2H4zm0 2h2v4H4zm0 6h2v2H4z"/></g>'},discord:{body:'<path fill="currentColor" d="M9 21H5v-2h4zm10 0h-4v-2h4zM5 19H3v-2h2zm12-2h-2v2h-2v-2h-2v2H9v-2H7v-2h10zm4 2h-2v-2h2zM3 17H1V7h2zm20 0h-2V7h2zm-12-4H8v-3h3zm5 0h-3v-3h3zM5 7H3V5h2zm10 0H9V5h6zm6 0h-2V5h2zM9 5H5V3h4zm10 0h-4V3h4z"/>'},"discord-solid":{body:'<path fill="currentColor" d="M9 5h6V3h4v2h2v2h2v10h-2v2h-2v2h-4v-2h-2v-2h4v-2H7v2h4v2H9v2H5v-2H3v-2H1V7h2V5h2V3h4zm4 8h3v-3h-3zm-5 0h3v-3H8z"/>'},dock:{body:'<path fill="currentColor" d="M4 4h16v2H4zm0 14h16v2H4zM2 6h2v12H2zm18 0h2v12h-2zM4 8h16v2H4zm2 6h12v2H6z"/>'},"dock-sharp":{body:'<path fill="currentColor" d="M2 4h20v2H2zm0 14h20v2H2zM2 6h2v12H2zm18 0h2v12h-2zM4 8h16v2H4zm2 6h12v2H6z"/>'},docker:{body:'<path fill="currentColor" d="M16 20H6v-2h10zM6 18H4v-2h2zm12 0h-2v-2h2zm2-2h-2v-4H4v4H2v-6h16V8h2zM9 15H7v-2h2zM6 8H4V6h2zm3 0H7V6h2zm3 0h-2V6h2zm6 0h-2V6h2zm4 0h-2V6h2zM9 5H7V3h2zm3 0h-2V3h2z"/>'},"docker-solid":{body:'<path fill="currentColor" d="M20 16h-2v2h-2v2H6v-2H4v-2H2v-6h16V8h2zM7 15h2v-2H7zM6 8H4V6h2zm3 0H7V6h2zm3 0h-2V6h2zm6 0h-2V6h2zm4 0h-2V6h2zM9 5H7V3h2zm3 0h-2V3h2z"/>'},dog:{body:'<path fill="currentColor" d="M14 22h-4v-2h4zm2-2h-2v-2h-4v2H8v-2H5v-2h6v-2h2v2h6v2h-3zM3 10h2v6H3v-4H1V6h2zm20 2h-2v4h-2v-6h2V6h2zm-12 0H9V8h2zm4 0h-2V8h2zm-8-2H5V6h2zm12 0h-2V6h2zM5 6H3V4h2zm14-2h-2v2h-2V4H9v2H7V4H5V2h14zm2 2h-2V4h2z"/>'},dollar:{body:'<path fill="currentColor" d="M17 18h-4v4h-2v-4H7v-2h10zm2-2h-2v-3h2zm-2-3H7v-2h10zM7 11H5V8h2zm6-5h4v2H7V6h4V2h2z"/>'},"dollar-sharp":{body:'<path fill="currentColor" d="M19 18h-6v4h-2v-4H5v-2h12v-3H5V6h6V2h2v4h6v2H7v3h12z"/>'},"door-closed":{body:'<path fill="currentColor" d="M3 19h18v2H3zM5 5h2v14H5zm2-2h10v2H7zm10 2h2v14h-2zm-8 6h2v2H9z"/>'},"door-closed-sharp":{body:'<path fill="currentColor" d="M3 19h18v2H3zM5 5h2v14H5zm0-2h14v2H5zm12 2h2v14h-2zm-8 6h2v2H9z"/>'},downasaur:{body:'<path fill="currentColor" d="M6 4h14v2h2v6h-8v2h6v2h-4v2h-2v2H2V8h2V6h2zm2 6h2V8H8z"/>',hidden:!0},download:{body:'<g fill="currentColor"><path d="M21 15v4h-2v-4zm-2 4v2H5v-2zM5 15v4H3v-4zm8-12v14h-2V3z"/><path d="M7 11v2h10v-2zm2 2v2h2v-2zm4 0v2h2v-2z"/><path d="M15 11v2h2v-2z"/></g>'},"download-sharp":{body:'<g fill="currentColor"><path d="M21 15v4h-2v-4zm0 4v2H3v-2zM5 15v4H3v-4zm8-12v14h-2V3z"/><path d="M7 11v2h10v-2zm2 2v2h2v-2zm4 0v2h2v-2z"/><path d="M15 11v2h2v-2z"/></g>'},draft:{body:'<path fill="currentColor" d="M14 2h-4v2H8v2H6v2H4v2H2v12h20V10h-2V8h-2V6h-2V4h-2zm0 2v2h2v2h2v4h-2v2h-2v2h-4v-2H8v-2H6V8h2V6h2V4zm-8 8v2h2v2h2v2h4v-2h2v-2h2v-2h2v8H4v-8z"/>',hidden:!0},"drag-and-drop":{body:'<path fill="currentColor" d="M11 21H9v-2h2zm10 0h-2v-2h2zM9 19H7V9h2zm10-4h-2v2h-2v2h-2v-6h6zm0 4h-2v-2h2zM5 17H3v-2h2zm0-4H3v-2h2zm16-2h-2V9h2zM5 9H3V7h2zm14 0H9V7h10zM5 5H3V3h2zm4 0H7V3h2zm4 0h-2V3h2zm4 0h-2V3h2z"/>'},"drag-and-drop-glyph":{body:'<path fill="currentColor" d="M21 11H11v10H7V7h14zm0 10h-2v-2h2zm-2-6h-2v2h-2v2h-2v-6h6zm0 4h-2v-2h2zM5 17H3v-2h2zm0-4H3v-2h2zm0-4H3V7h2zm0-4H3V3h2zm4 0H7V3h2zm4 0h-2V3h2zm4 0h-2V3h2z"/>'},"drag-and-drop-sharp":{body:'<path fill="currentColor" d="M21 11h-2V9H9v10h2v2H7V7h14zm0 10h-2v-2h2zm-2-6h-2v2h-2v2h-2v-6h6zm0 4h-2v-2h2zM5 17H3v-2h2zm0-4H3v-2h2zm0-4H3V7h2zm0-4H3V3h2zm4 0H7V3h2zm4 0h-2V3h2zm4 0h-2V3h2z"/>'},"drag-and-drop-solid":{body:'<path fill="currentColor" d="M19 9h2v2H11v10H9v-2H7V9h2V7h10zm2 12h-2v-2h2zm-2-6h-2v2h-2v2h-2v-6h6zm0 4h-2v-2h2zM5 17H3v-2h2zm0-4H3v-2h2zm0-4H3V7h2zm0-4H3V3h2zm4 0H7V3h2zm4 0h-2V3h2zm4 0h-2V3h2z"/>'},drop:{body:'<path fill="currentColor" d="M13 2h-2v2H9v4H7v4H5v6h2v2h2v2h6v-2h2v-2h2v-6h-2V8h-2V4h-2zm0 2v4h2v4h2v6h-2v2H9v-2H7v-6h2V8h2V4z"/>',hidden:!0},"drop-area":{body:'<path fill="currentColor" d="M5 3H3v2h2zm2 0h2v2H7zm6 0h-2v2h2zm2 0h2v2h-2zm4 0h2v2h-2zM3 7h2v2H3zm2 4H3v2h2zm-2 4h2v2H3zm2 4H3v2h2zm2 0h2v2H7zm6 0h-2v2h2zm6-8h2v2h-2zm2-4h-2v2h2zm-6 10v-2h6v2h-2v2h-2v2h-2zm4 2v2h2v-2z"/>',hidden:!0},"drop-full":{body:'<path fill="currentColor" d="M11 2h2v2h2v4h2v4h2v6h-2v2h-2v2H9v-2H7v-2H5v-6h2V8h2V4h2z"/>',hidden:!0},"drop-half":{body:'<path fill="currentColor" d="M13 2h-2v2H9v4H7v4H5v6h2v2h2v2h6v-2h2v-2h2v-6h-2V8h-2V4h-2zm0 2v4h2v4h2v3H7v-3h2V8h2V4z"/>',hidden:!0},drum:{body:'<path fill="currentColor" d="M8 3h8v2H8zm0 10h8v2H8zm0 6h8v2H8zm-4-8h4v2H4zm0 6h4v2H4zm16-6h-4v2h4zm0 6h-4v2h4zM2 7h2v4H2zm0 4h2v6H2zm20-4h-2v4h2zm0 4h-2v6h2zM6 5h2v2H6zM4 3h2v2H4zM2 1h2v2H2zm6 6h2v2H8zm4 2h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2z"/>'},duplicate:{body:'<path fill="currentColor" d="M5 3h12v4h4v14H7v-4H3V3zm10 4V5H5v10h2V7zM9 17v2h10V9H9z"/>',hidden:!0},"duplicate-alt":{body:'<path fill="currentColor" d="M5 1H3v14h10v2h-2v2h2v-2h2v-2h2v-2h-2v-2h-2V9h-2v2h2v2H5V3h12V1zm4 4H7v6h2V7h10v14H9v-4H7v6h14V5z"/>',hidden:!0},earth:{body:'<path fill="currentColor" d="M6 2h12v2H6zm0 18h12v2H6zM18 4h2v2h-2zM4 18h2v2H4zM4 4h2v2H4zm14 14h2v2h-2zM2 6h2v12H2zm18 0h2v12h-2zM8 4h2v4H8zm2 4h4v2h-4zm4 2h4v2h-4zm4-2h2v2h-2zM4 12h2v2H4zm6 4h2v4h-2zm-4-2h4v2H6zm8 2h2v4h-2zm2-2h4v2h-4z"/>'},edit:{body:'<path fill="currentColor" d="M18 2h-2v2h-2v2h-2v2h-2v2H8v2H6v2H4v2H2v6h6v-2h2v-2h2v-2h2v-2h2v-2h2v-2h2V8h2V6h-2V4h-2zm0 8h-2v2h-2v2h-2v2h-2v2H8v-2H6v-2h2v-2h2v-2h2V8h2V6h2v2h2zM6 16H4v4h4v-2H6z"/>',hidden:!0},"edit-box":{body:'<path fill="currentColor" d="M18 2h-2v2h2zM4 4h6v2H4v14h14v-6h2v8H2V4zm4 8H6v6h6v-2h2v-2h-2v2H8zm4-2h-2v2H8v-2h2V8h2V6h2v2h-2zm2-6h2v2h-2zm4 0h2v2h2v2h-2v2h-2v2h-2v-2h2V8h2V6h-2zm-4 8h2v2h-2z"/>',hidden:!0},eraser:{body:'<path fill="currentColor" d="M15 18h6v2H7v-2h6v-2h2zm-8 0H5v-2h2zm-2-2H3v-2h2zm12 0h-2v-2h2zM7 14H5v-2h2zm8 0h-2v-2h2zm4 0h-2v-2h2zM9 12H7v-2h2zm4 0h-2v-2h2zm8 0h-2v-2h2zm-10-2H9V8h2zm8 0h-2V8h2zm-6-2h-2V6h2zm4 0h-2V6h2zm-2-2h-2V4h2z"/>'},"eraser-solid":{body:'<path fill="currentColor" d="M15 6h2v2h2v2h2v2h-2v2h-4v-2h-2v2h2v4h6v2H7v-2H5v-2H3v-2h2v-2h2v-2h4v2h2v-2h-2V6h2V4h2z"/>'},estate:{body:'<path fill="currentColor" d="M2 20h20v2H2zM2 4h2v16H2zm2-2h8v2H4zm8 2h2v16h-2zM6 6h4v2H6zm0 4h4v2H6zm1 6h2v4H7zm11-6h2v2h-2zm2 2h2v4h-2zm-4 0h2v4h-2zm2 4h2v4h-2z"/>'},"estate-sharp":{body:'<path fill="currentColor" d="M2 20h20v2H2zM2 4h2v16H2zm0-2h12v2H2zm10 2h2v16h-2zM6 6h4v2H6zm0 4h4v2H6zm1 6h2v4H7zm9-6h6v2h-6zm4 2h2v6h-2zm-4 0h2v6h-2zm2 4h2v4h-2z"/>'},euro:{body:'<path fill="currentColor" d="M19 20H9v-2h10zM9 9h7v2H9v2h7v2H9v3H7v-3H5v-2h2v-2H5V9h2V6h2zm10-3H9V4h10z"/>'},"euro-sharp":{body:'<path fill="currentColor" d="M19 4v2H9v3h7v2H9v2h7v2H9v3h10v2H7v-5H5v-2h2v-2H5V9h2V4z"/>'},expand:{body:'<path fill="currentColor" d="M4 13h16v-2H4zm7-8h2V3h-2zM9 7h4V5H9zm4 0h2V5h-2zm2 2h2V7h-2zM7 9h8V7H7zm4 10h2v2h-2zm-2-2h4v2H9zm4 0h2v2h-2zm2-2h2v2h-2zm-8 0h8v2H7z"/>'},"external-link":{body:'<g fill="currentColor"><path d="M11 5H5v2h6zM5 7H3v12h2zm12 12H5v2h12zm2-6h-2v6h2zm-8 0H9v2h2zm2-2h-2v2h2zm2-2h-2v2h2zm2-2h-2v2h2zm2-2h-2v2h2zm2-2h-2v8h2z"/><path d="M21 3h-8v2h8z"/></g>'},"external-link-sharp":{body:'<g fill="currentColor"><path d="M11 5H3v2h8zM5 7H3v12h2zm14 12H3v2h16zm0-6h-2v6h2zm-8 0H9v2h2zm2-2h-2v2h2zm2-2h-2v2h2zm2-2h-2v2h2zm2-2h-2v2h2zm2-2h-2v8h2z"/><path d="M21 3h-8v2h8z"/></g>'},eye:{body:'<path fill="currentColor" d="M16 20H8v-2h8zm-8-2H4v-2h4zm12 0h-4v-2h4zM4 16H2v-2h2zm10-6h-2v2h2zh2v4h-2v2h-4v-2H8v-4h2V8h4zm8 6h-2v-2h2zM2 14H0v-4h2zm22 0h-2v-4h2zM4 10H2V8h2zm18 0h-2V8h2zM8 8H4V6h4zm12 0h-4V6h4zm-4-2H8V4h8z"/>'},"eye-closed":{body:'<path fill="currentColor" d="M0 7h2v2H0zm4 4H2V9h2zm4 2v-2H4v2H2v2h2v-2zm8 0H8v2H6v2h2v-2h8v2h2v-2h-2zm4-2h-4v2h4v2h2v-2h-2zm2-2v2h-2V9zm0 0V7h2v2z"/>',hidden:!0},"eye-off":{body:'<g fill="currentColor"><path d="M0 10h2v4H0zm24 0h-2v4h2zm-8 0h-2v2h2zm-6 0H8v4h2zM2 8h2v2H2zm0 8h2v-2H2zm20-8h-2v2h2zm0 8h-2v-2h2zM4 6h4v2H4zm0 12h4v-2H4zM20 6h-4v2h4zM10 4h6v2h-6zM8 20h8v-2H8zm4-12h2v2h-2zm-2 6h4v2h-4zM8 8h2v2H8zm2 2h2v4h-2zm2 2h2v2h-2z"/><path d="M6 6h2v2H6zM4 4h2v2H4zM2 2h2v2H2zm12 12h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2z"/></g>'},facebook:{body:'<path fill="currentColor" d="M11 12H8v2h3v6h2v-6h4v-2h-4V6h4V4h-4V2h6v6h-4v2h4v6h-4v6H9v-6H6v-6h3V6h2zm2-6h-2V4h2z"/>'},"facebook-solid":{body:'<path fill="currentColor" d="M17 6h-4v4h4v4h-4v8H9v-8H6v-4h3V4h2V2h6z"/>'},factory:{body:'<path fill="currentColor" d="M2 4h2v16H2zm2 16h16v2H4zM20 7h2v13h-2zm-2 0h2v2h-2zm-6 0h2v2h-2zm4 2h2v2h-2zm-6 0h2v2h-2zm4-2h2v6h-2zM8 4h2v9H8zM4 2h6v2H4zm3 13h2v2H7zm4 0h2v2h-2zm4 0h2v2h-2z"/>'},"factory-sharp":{body:'<path fill="currentColor" d="M2 2h2v20H2zm2 18h16v2H4zM20 7h2v15h-2zm-2 0h2v2h-2zm-6 0h2v2h-2zm4 2h2v2h-2zm-6 0h2v2h-2zm4-2h2v6h-2zM8 4h2v9H8zM4 2h6v2H4zm3 13h2v2H7zm4 0h2v2h-2zm4 0h2v2h-2z"/>'},feather:{body:'<path fill="currentColor" d="M2 20h2v2H2zm6-2h6v2H8zm-2-2h2v2H6zm-2 2h2v2H4zm4-4h2v2H8zm2-2h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2zm0 8h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2zm2-6h2v6h-2zm-2-2h2v2h-2zM4 10h2v6H4zm2-2h2v2H6zm2-2h2v2H8zm2-2h2v2h-2zm2-2h6v2h-6z"/>'},figma:{body:'<path fill="currentColor" d="M11 22H7v-2h4zm-4-2H5v-4h2zM17 4h-4v4h4v2h-4v4h4v2h-4v4h-2v-4H7v-2h4v-4H7V8h4V4H7V2h10zM7 14H5v-4h2zm12 0h-2v-4h2zM7 8H5V4h2zm12 0h-2V4h2z"/>'},file:{body:'<g fill="currentColor"><path d="M6 4H4v16h2zm10-2H6v2h10zm4 4h-2v14h2zm-2 14H6v2h12zM16 4h2v2h-2zm-4 0h2v6h-2z"/><path d="M12 8h6v2h-6z"/></g>'},"file-alt":{body:'<path fill="currentColor" d="M21 22H3V2h12v2h2v2h2v2h2zM17 6h-2v2h2zM5 4v16h14V10h-6V4zm8 12H7v2h6zm-6-4h10v2H7zm4-4H7v2h4z"/>',hidden:!0},"file-delete":{body:'<path fill="currentColor" d="M11 22h10V8h-2V6h-2v2h-2V6h2V4h-2V2H3v12h2V4h8v6h6v10h-8zm-4-2H5v2H3v-2h2v-2H3v-2h2v2h2v-2h2v2H7zm0 0h2v2H7z"/>',hidden:!0},"file-flash":{body:'<path fill="currentColor" d="M19 22h-6v-2h6V10h-6V4H5v8H3V2h12v2h2v2h2v2h2v14zM17 6h-2v2h2zM7 12h2v4h4v2h-2v2H9v2H7v-4H3v-2h2v-2h2z"/>',hidden:!0},"file-minus":{body:'<path fill="currentColor" d="M13 22h8V8h-2V6h-2v2h-2V6h2V4h-2V2H3v13h2V4h8v6h6v10h-6zm-2-3H3v-2h8z"/>',hidden:!0},"file-multiple":{body:'<path fill="currentColor" d="M21 18H7V2h8v2h2v2h-2v2h2V6h2v2h2zM9 4v12h10v-6h-6V4zM3 6h2v14h12v2H3z"/>',hidden:!0},"file-off":{body:'<path fill="currentColor" d="M5 2H3v2h2v2h2v2h2v2h2v2h2v2h2v2h2v2h2v2h2v2h2v-2h-2v-2h-2v-2h-2v-2h-2v-2h-2v-2h6v4h2V8h-2V6h-2V4h-2V2H9v2h4v6h-2V8H9V6H7V4H5zm12 4v2h-2V6zM3 8h2v12h12v2H3z"/>',hidden:!0},"file-plus":{body:'<path fill="currentColor" d="M19 22h-7v-2h7V10h-6V4H5v8H3V2h12v2h2v2h2v2h2v14zM17 6h-2v2h2zM8 19h3v-2H8v-3H6v3H3v2h3v3h2z"/>',hidden:!0},"file-sharp":{body:'<g fill="currentColor"><path d="M6 4H4v16h2zm10-2H4v2h12zm4 4h-2v14h2zm0 14H4v2h16zM16 4h2v2h-2zm-4 0h2v6h-2z"/><path d="M12 8h6v2h-6z"/></g>'},"file-text":{body:'<g fill="currentColor"><path d="M6 4H4v16h2zm10-2H6v2h10zm4 4h-2v14h2zm-2 14H6v2h12zM16 4h2v2h-2zm-4 0h2v6h-2z"/><path d="M12 8h6v2h-6zm-4 8h8v2H8zm0-4h8v2H8zm0-4h2v2H8z"/></g>'},"file-text-sharp":{body:'<g fill="currentColor"><path d="M6 4H4v16h2zm10-2H4v2h12zm4 4h-2v14h2zm0 14H4v2h16zM16 4h2v2h-2zm-4 0h2v6h-2z"/><path d="M12 8h6v2h-6zm-4 8h8v2H8zm0-4h8v2H8zm0-4h2v2H8z"/></g>'},files:{body:'<g fill="currentColor"><path d="M9 3H7v14h2zM5 7H3v14h2zm12-6H9v2h8zm4 4h-2v12h2zm-2 12H9v2h10zm-4 4H5v2h10zm2-18h2v2h-2zm-4 0h2v6h-2z"/><path d="M13 7h6v2h-6zM5 5h2v2H5zm10 14h2v2h-2z"/></g>'},"files-sharp":{body:'<g fill="currentColor"><path d="M9 3H7v14h2zM5 7H3v14h2zm12-6H9v2h8zm4 4h-2v12h2zm-2 12H9v2h10zm-4 4H5v2h10zm2-18h2v2h-2zm-4 0h2v6h-2z"/><path d="M13 7h6v2h-6zM5 5h2v2H5zm10 14h2v2h-2z"/></g>'},fill:{body:'<path fill="currentColor" d="M9 2h2v2H9zm4 4V4h-2v2H9v2H7v2H5v2H3v2h2v2h2v2h2v2h2v2h2v-2h2v-2h2v-2h2v6h2V12h-2v-2h-2V8h-2V6zm0 0v2h2v2h2v2h2v2h-2v2h-2v2h-2v2h-2v-2H9v-2H7v-2H5v-2h2v-2h2V8h2V6z"/>',hidden:!0},"fill-half":{body:'<path fill="currentColor" d="M9 2h2v2H9zm4 4V4h-2v2H9v2H7v2H5v2H3v2h2v2h2v2h2v2h2v2h2v-2h2v-2h2v-2h2v6h2V12h-2v-2h-2V8h-2V6zm0 0v2h2v2h2v2h2v2H5v-2h2v-2h2V8h2V6z"/>',hidden:!0},filter:{body:'<path fill="currentColor" d="M11 20h2v2H9V12h2zm4 0h-2v-8h2zm-6-8H7v-2h2zm8 0h-2v-2h2zM7 10H5V8h2zm12 0h-2V8h2zm2-2h-2V4H5v4H3V2h18z"/>'},fire:{body:'<g fill="currentColor"><path d="M9 2h2v4H9zM7 6h2v2H7zM5 8h2v2H5zm8 2h2v2h-2zm2-2h2v2h-2zm2 2h2v2h-2zm2 2h2v6h-2zM3 10h2v8H3zm8-4h2v4h-2zm6 12h2v2h-2zM7 20h10v2H7zm-2-2h2v2H5zm4-2h6v4H9z"/><path d="M11 14h2v3h-2z"/></g>'},fish:{body:'<path fill="currentColor" d="M20 9h2v6h-2zm-2-2h2v2h-2zm0 8h2v2h-2zm-6 2h6v2h-6zm0-12h6v2h-6zM2 7h2v10H2zm2 2h2v2H4zm0 4h2v2H4zm2-2h2v2H6zm2-2h2v2H8zm0 4h2v2H8zm2 2h2v2h-2zm0-8h2v2h-2zm5 3h2v2h-2z"/>'},flag:{body:'<g fill="currentColor"><path d="M4 2h2v20H4z"/><path d="M4 4h16v2H4zm12 2h2v2h-2zm-2 2h2v2h-2zm2 2h2v2h-2zM4 12h16v2H4z"/></g>'},flatten:{body:'<g fill="currentColor"><path d="M4 16h16v2H4zm4 4h8v2H8zm3-18h2v12h-2z"/><path d="M9 10h6v2H9zM7 8h10v2H7z"/></g>'},"flip-horizontal-2":{body:'<path fill="currentColor" d="M11 7h2v4h-2zm0-6h2v4h-2zm0 12h2v4h-2zm0 6h2v4h-2zm-4-8h2v2H7zm10 0h-2v2h2zM5 13h2v2H5zm14 0h-2v2h2zM5 9h2v4H5zm14 0h-2v4h2zM3 7h2v10H3zm18 0h-2v10h2z"/>'},"flip-to-back":{body:'<path fill="currentColor" d="M9 3H7v2h2zm0 12H7v2h2zm2-12h2v2h-2zm2 12h-2v2h2zm2-12h2v2h-2zm2 12h-2v2h2zm2-12h2v2h-2zm2 4h-2v2h2zM7 7h2v2H7zm14 4h-2v2h2zM7 11h2v2H7zm14 4h-2v2h2zM3 7h2v12h12v2H3z"/>',hidden:!0},"flip-to-front":{body:'<path fill="currentColor" d="M21 3H7v14h14zm-2 12H9V5h10zM5 7H3v2h2zm-2 4h2v2H3zm2 4H3v2h2zm-2 4h2v2H3zm6 0H7v2h2zm2 0h2v2h-2zm6 0h-2v2h2z"/>',hidden:!0},"flip-vertical-2":{body:'<path fill="currentColor" d="M17 11v2h-4v-2zm6 0v2h-4v-2zm-12 0v2H7v-2zm-6 0v2H1v-2zm8-4v2h-2V7zm0 10v-2h-2v2zm0-12v2H9V5zm0 14v-2H9v2zm2-14v2h-2V5zm0 14v-2h-2v2zm2-16v2H7V3zm0 18v-2H7v2z"/>'},"float-center":{body:'<path fill="currentColor" d="M18 6h4v2h-4zm0 4h4v2h-4zM2 6h4v2H2zm0 4h4v2H2zm0 4h20v2H2zm0 4h20v2H2zm8-14h4v2h-4zm0 6h4v2h-4zM8 6h2v4H8zm6 0h2v4h-2z"/>'},"float-center-sharp":{body:'<path fill="currentColor" d="M18 6h4v2h-4zm0 4h4v2h-4zM2 6h4v2H2zm0 4h4v2H2zm0 4h20v2H2zm0 4h20v2H2zM8 4h8v2H8zm0 6h8v2H8zm0-4h2v4H8zm6 0h2v4h-2z"/>'},"float-left":{body:'<path fill="currentColor" d="M12 6h10v2H12zm0 4h10v2H12zM2 14h20v2H2zm0 4h20v2H2zM4 4h4v2H4zm0 6h4v2H4zM2 6h2v4H2zm6 0h2v4H8z"/>'},"float-left-sharp":{body:'<path fill="currentColor" d="M12 6h10v2H12zm0 4h10v2H12zM2 14h20v2H2zm0 4h20v2H2zM2 4h8v2H2zm0 6h8v2H2zm0-4h2v4H2zm6 0h2v4H8z"/>'},"float-right":{body:'<path fill="currentColor" d="M2 6h10v2H2zm0 4h10v2H2zm0 4h20v2H2zm0 4h20v2H2zM16 4h4v2h-4zm0 6h4v2h-4zm-2-4h2v4h-2zm6 0h2v4h-2z"/>'},"float-right-sharp":{body:'<path fill="currentColor" d="M2 6h10v2H2zm0 4h10v2H2zm0 4h20v2H2zm0 4h20v2H2zM14 4h8v2h-8zm0 6h8v2h-8zm0-4h2v4h-2zm6 0h2v4h-2z"/>'},folder:{body:'<path fill="currentColor" d="M4 4h6v2H4zm0 14h16v2H4zM20 8h2v10h-2zM2 6h2v12H2zm8 0h10v2H10z"/>'},"folder-minus":{body:'<path fill="currentColor" d="M12 4H2v16h20V6H12zm-2 4h10v10H4V6h6zm8 6v-2h-6v2z"/>',hidden:!0},"folder-plus":{body:'<g fill="currentColor"><path d="M4 4h6v2H4zm0 14h10v2H4zM20 8h2v6h-2zM2 6h2v12H2zm8 0h10v2H10zm12 12v2h-6v-2z"/><path d="M18 16h2v6h-2z"/></g>'},"folder-plus-sharp":{body:'<g fill="currentColor"><path d="M2 4h10v2H2zm0 14h12v2H2zM20 6h2v8h-2zM2 6h2v12H2zm8 0h10v2H10zm12 12v2h-6v-2z"/><path d="M18 16h2v6h-2z"/></g>'},"folder-sharp":{body:'<path fill="currentColor" d="M2 4h10v2H2zm0 14h20v2H2zM20 6h2v12h-2zM2 6h2v12H2zm8 0h10v2H10z"/>'},"folder-x":{body:'<path fill="currentColor" d="M12 4H2v16h20V6H12zm-2 4h10v10H4V6h6zm6 4h-2v-2h-2v2h2v2h-2v2h2v-2h2v2h2v-2h-2zm0 0h2v-2h-2z"/>',hidden:!0},forward:{body:'<path fill="currentColor" d="M2 11h2v6H2zm2 6h2v2H4zm2-2h4v2H6zm0-8h4v2H6zm4 8h2v6h-2zm0-12h2v6h-2zm2 16h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2zm-2-2h2v2h-2zm-2-2h2v2h-2zm-2-2h2v2h-2zm-2-2h2v2h-2zM4 9h2v2H4z"/>'},"forward-sharp":{body:'<g fill="currentColor"><path d="M2 7h2v12H2zm0 12h6v2H2zm4-4h4v2H6zM4 7h6v2H4zm6 8h2v6h-2z"/><path d="M6 15h2v6H6zm4-12h2v6h-2zm2 16h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2zm-2-2h2v2h-2zm-2-2h2v2h-2zm-2-2h2v2h-2zm-2-2h2v2h-2z"/></g>'},forwardburger:{body:'<path fill="currentColor" d="M13 7H3v2h10zm8 4h-2V9h-2V7h-2v2h2v2H3v2h14v2h-2v2h2v-2h2v-2h2zM3 15h10v2H3z"/>',hidden:!0},frame:{body:'<path fill="currentColor" d="M7 5h10V2h2v3h3v2h-3v10h3v2h-3v3h-2v-3H7v3H5v-3H2v-2h3V7H2V5h3V2h2zm0 12h10V7H7z"/>'},"frame-add":{body:'<path fill="currentColor" d="M2 3h20v18H2zm18 16V7H4v12zm-7-7h3v2h-3v3h-2v-3H8v-2h3V9h2z"/>',hidden:!0},"frame-check":{body:'<path fill="currentColor" d="M2 3h20v18H2zm18 16V7H4v12zm-4-9h-2v2h-2v2h-2v-2H8v2h2v2h2v-2h2v-2h2z"/>',hidden:!0},"frame-delete":{body:'<path fill="currentColor" d="M2 3h20v18H2zm18 16V7H4v12zM9 10h2v2H9zm4 2h-2v2H9v2h2v-2h2v2h2v-2h-2zm0 0v-2h2v2z"/>',hidden:!0},"frame-minus":{body:'<path fill="currentColor" d="M2 3h20v18H2zm18 16V7H4v12zM8 12h8v2H8z"/>',hidden:!0},frown:{body:'<path fill="currentColor" d="M6 20h12v2H6zM6 2h12v2H6zm12 2h2v2h-2zM4 4h2v2H4zm0 14h2v2H4zm14 0h2v2h-2zM2 6h2v12H2zm18 0h2v12h-2zM8 8h2v2H8zm6 0h2v2h-2zm-7 7h2v2H7zm2-2h6v2H9zm6 2h2v2h-2z"/>'},"gallery-thumbnails":{body:'<path fill="currentColor" d="M4 2h16v2H4zM2 4h2v12H2zm2 12h16v2H4zM20 4h2v12h-2zM3 20h3v2H3zm5 0h3v2H8zm5 0h3v2h-3zm5 0h3v2h-3z"/>'},"gallery-thumbnails-sharp":{body:'<path fill="currentColor" d="M4 2h16v2H4zM2 2h2v16H2zm2 14h16v2H4zM20 2h2v16h-2zM3 20h3v2H3zm5 0h3v2H8zm5 0h3v2h-3zm5 0h3v2h-3z"/>'},gamepad:{body:'<g fill="currentColor"><path d="M4 4h16v2H4zm0 14h16v2H4zM2 6h2v12H2zm18 0h2v12h-2zM8 9h2v6H8z"/><path d="M6 11h6v2H6zm8-2h2v2h-2zm2 4h2v2h-2z"/></g>'},"gamepad-sharp":{body:'<g fill="currentColor"><path d="M4 4h16v2H4zm0 14h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zM8 9h2v6H8z"/><path d="M6 11h6v2H6zm8-2h2v2h-2zm2 4h2v2h-2z"/></g>'},gear:{body:'<path fill="currentColor" d="M18 22h-5v2h-2v-2H6v-2h12zM4 22H2v-2h2zm18 0h-2v-2h2zM6 20H4v-2h2zm14 0h-2v-2h2zM4 18H2v-5H0v-2h2V6h2zm4 0H6v-2h2zm14-7h2v2h-2v5h-2v-5h-4v3H8V8h8v3h4V6h2zm-12-1v4h4v-4zM8 8H6V6h2zM6 6H4V4h2zm14 0h-2V4h2zM4 4H2V2h2zm9-2h5v2H6V2h5V0h2zm9 2h-2V2h2z"/>'},"gear-solid":{body:'<path fill="currentColor" d="M18 22h-5v2h-2v-2H6v-2h12zM4 22H2v-2h2zm18 0h-2v-2h2zM6 20H4v-2h2zm14 0h-2v-2h2zM4 18H2v-5H0v-2h2V6h2zm4 0H6v-2h2zm14-7h2v2h-2v5h-2v-5h-4v3H8V8h8v3h4V6h2zM8 8H6V6h2zM6 6H4V4h2zm14 0h-2V4h2zM4 4H2V2h2zm9-2h5v2H6V2h5V0h2zm9 2h-2V2h2z"/>'},gif:{body:'<path fill="currentColor" d="M3 7h6v2H3v6h4v-2H5v-2h4v6H1V7zm14 0h6v2h-6v2h4v2h-4v4h-2V7zm-4 0h-2v10h2z"/>',hidden:!0},gift:{body:'<path fill="currentColor" d="M4 6h16v2H4zM2 8h2v4H2zm2 4h16v2H4zm16-4h2v4h-2zM6 4h2v2H6zm2-2h3v2H8zm3 2h2v2h-2zm2-2h3v2h-3zm3 2h2v2h-2zM4 14h2v6H4zm2 6h12v2H6zm12-6h2v6h-2zm-7-6h2v4h-2zm0 6h2v6h-2z"/>'},"gift-sharp":{body:'<path fill="currentColor" d="M2 6h20v2H2zm0 2h2v4H2zm0 4h20v2H2zm18-4h2v4h-2zM6 4h2v2H6zm2-2h3v2H8zm3 2h2v2h-2zm2-2h3v2h-3zm3 2h2v2h-2zM4 14h2v6H4zm0 6h16v2H4zm14-6h2v6h-2zm-7-6h2v4h-2zm0 6h2v6h-2z"/>'},"git-branch":{body:'<path fill="currentColor" d="M4 14h4v2H4zm0 6h4v2H4zm-2-4h2v4H2zm6 0h2v4H8zm8-14h4v2h-4zm0 6h4v2h-4zm-2-4h2v4h-2zm6 0h2v4h-2zm-8 13h5v2h-5zm5-5h2v5h-2zM5 2h2v10H5z"/>'},"git-branch-sharp":{body:'<path fill="currentColor" d="M2 14h8v2H2zm0 6h8v2H2zm0-4h2v4H2zm6 0h2v4H8zm6-14h8v2h-8zm0 6h8v2h-8zm0-4h2v4h-2zm6 0h2v4h-2zm-8 13h7v2h-7zm5-5h2v5h-2zM5 2h2v10H5z"/>'},"git-commit":{body:'<path fill="currentColor" d="M9 7h6v2H9zM7 9h2v6H7zm2 6h6v2H9zm6-6h2v6h-2zM0 11h5v2H0zm19 0h5v2h-5z"/>'},"git-commit-sharp":{body:'<path fill="currentColor" d="M7 7h10v2H7zm0 2h2v6H7zm0 6h10v2H7zm8-6h2v6h-2zM0 11h5v2H0zm19 0h5v2h-5z"/>'},"git-merge":{body:'<path fill="currentColor" d="M4 2h4v2H4zm0 6h4v2H4zM2 4h2v4H2zm6 0h2v4H8zm8 10h4v2h-4zm0 6h4v2h-4zm-2-4h2v4h-2zm6 0h2v4h-2zM5 12h2v10H5zm7 0h2v2h-2zm-2-2h2v2h-2z"/>'},"git-merge-sharp":{body:'<path fill="currentColor" d="M2 2h8v2H2zm0 6h8v2H2zm0-4h2v4H2zm6 0h2v4H8zm6 10h8v2h-8zm0 6h8v2h-8zm0-4h2v4h-2zm6 0h2v4h-2zM5 12h2v10H5zm7 0h2v2h-2zm-2-2h2v2h-2z"/>'},"git-pull-request":{body:'<path fill="currentColor" d="M4 10h4V8H4zm0-6h4V2H4zM2 8h2V4H2zm6 0h2V4H8zm8 14h4v-2h-4zm0-6h4v-2h-4zm-2 4h2v-4h-2zm6 0h2v-4h-2zM12 7h5V5h-5zM5 22h2V12H5z"/>'},"git-pull-request-sharp":{body:'<path fill="currentColor" d="M2 10h8V8H2zm0-6h8V2H2zm0 4h2V4H2zm6 0h2V4H8zm6 14h8v-2h-8zm0-6h8v-2h-8zm0 4h2v-4h-2zm6 0h2v-4h-2zM12 7h5V5h-5zM5 22h2V12H5z"/>'},github:{body:'<path fill="currentColor" d="M5 2h4v2H7v2H5zm0 10H3V6h2zm2 2H5v-2h2zm2 2v-2H7v2H3v-2H1v2h2v2h4v4h2v-4h2v-2zm0 0v2H7v-2zm6-12v2H9V4zm4 2h-2V4h-2V2h4zm0 6V6h2v6zm-2 2v-2h2v2zm-2 2v-2h2v2zm0 2h-2v-2h2zm0 0h2v4h-2z"/>'},"github-2":{body:'<path fill="currentColor" d="M6 2h12v2H6zm4 12H8v-2h2zm4 0v2h-4v-2zm0 0v-2h2v2z"/><path fill="currentColor" d="M6 6V4H4v2H2v12h2v2h2v2h12v-2h2v-2h2V6h-2V4h-2v2h-2v2H8V6zm2 6v-2h8v2h2V6h2v12h-2v2h-2v-4h-2v4h-4v-4H6v2h2v2H6v-2H4v-2h2v-2H4V6h2v6z"/>',hidden:!0},"github-solid":{body:'<path fill="currentColor" d="M19 14h-2v2h-2v2h2v4H7v-4H3v-2H1v-2h2v2h4v-2H5v-2H3V6h2V2h4v2h6V2h4v4h2v6h-2zM7 18h2v-2H7z"/>'},gitlab:{body:'<path fill="currentColor" d="M15 22H9v-2h6zm-6-2H7v-2h2zm8 0h-2v-2h2zM7 18H5v-2h2zm12 0h-2v-2h2zM5 16H3v-2h2zm16 0h-2v-2h2zM3 14H1V8h2zm20 0h-2V8h2zm-8-4H9V8h6zM5 8H3V4h2zm4 0H7V4h2zm8 0h-2V4h2zm4 0h-2V4h2zM7 4H5V2h2zm12 0h-2V2h2z"/>'},"gitlab-solid":{body:'<path fill="currentColor" d="M7 4h2v4h6V4h2V2h2v2h2v4h2v6h-2v2h-2v2h-2v2h-2v2H9v-2H7v-2H5v-2H3v-2H1V8h2V4h2V2h2z"/>'},globe:{body:'<g fill="currentColor"><path d="M6 2h12v2H6zm0 18h12v2H6zM4 4h2v2H4zm5 0h2v2H9zm0 14h2v2H9zm4 0h2v2h-2zM7 6h2v12H7zm8 0h2v12h-2zm-2-2h2v2h-2zm7 0h-2v2h2zM2 6h2v12H2zm20 0h-2v12h2zM4 18h2v2H4zm16 0h-2v2h2z"/><path d="M3 11h18v2H3z"/></g>'},gmail:{body:'<path fill="currentColor" d="M20 20H4v-2h16zM4 18H2V6h2zm18 0h-2V6h2zM8 10h2v2H8v4H6V8h2zm10 6h-2v-4h-2v-2h2V8h2zm-4-2h-4v-2h4zm6-8H4V4h16z"/>'},"gmail-solid":{body:'<path fill="currentColor" d="M20 20H4v-2H2V6h2V4h16v2h2v12h-2zM6 16h2v-4h2v-2H8V8H6zm10-6h-2v2h-4v2h4v-2h2v4h2V8h-2z"/>'},goal:{body:'<g fill="currentColor"><path d="M6 2h2v2H6zm0 18h12v2H6zm12-2h2v2h-2zM4 18h2v2H4zM4 4h2v2H4zm16 10h2v4h-2zM2 6h2v12H2zm6 10h8v2H8zM6 8h2v8H6zm10 6h2v2h-2zM10 2h2v12h-2z"/><path d="M10 2h6v2h-6zm0 6h6v2h-6zm6-4h6v2h-6zm0 6h6v2h-6zm4-4h2v4h-2z"/></g>'},google:{body:'<path fill="currentColor" d="M17 21H7v-2h10zM7 19H5v-2h2zm12 0h-2v-2h2zM5 17H3V7h2zm16 0h-2v-4h-6v-2h8zM7 7H5V5h2zm12 0h-2V5h2zm-2-2H7V3h10z"/>'},"google-chrome":{body:'<path fill="currentColor" d="M18 22H6v-2h4v-2h2v2h6zM6 20H4v-2h2zm14 0h-2v-2h2zM4 8h2v2H4v8H2V6h2zm10 10h-2v-2h-2v-2h4zm8 0h-2V6h2zm-12-4H8v-2H6v-2h4zm6 0h-2v-4h2zm-2-4h-4V8h4zm4-2h-4V6h4zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"google-chrome-solid":{body:'<path fill="currentColor" d="M18 4h2v2h2v12h-2v2h-2v2H6v-2H4v-2H2V6h2V4h2V2h12zm-4 4h-4v2H6V8H4v2h2v2h2v2h2v2h2v2h-2v2h2v-2h2v-4h2v-4h-2zh4V6h-4zm0 6h-4v-4h4z"/>'},gps:{body:'<path fill="currentColor" d="M9 5h6v2H9zM7 7h2v2H7zm0 8h2v2H7zm8 0h2v2h-2zm0-8h2v2h-2zm2 2h2v6h-2zm-8 8h6v2H9zM5 9h2v6H5zm14 2h4v2h-4zM1 11h4v2H1zM11 1h2v4h-2zm0 18h2v4h-2z"/>'},"gps-2":{body:'<path fill="currentColor" d="M9 5h6v2H9zM7 7h2v2H7zm0 8h2v2H7zm8 0h2v2h-2zm0-8h2v2h-2zm2 2h2v6h-2zm-8 8h6v2H9zM5 9h2v6H5zm14 2h4v2h-4zM1 11h4v2H1zM11 1h2v4h-2zm0 18h2v4h-2zm0-10h2v2h-2zm-2 2h2v2H9zm2 2h2v2h-2zm2-2h2v2h-2z"/>'},"gps-2-sharp":{body:'<path fill="currentColor" d="M7 5h10v2H7zm10 0h2v14h-2zM7 17h10v2H7zM5 5h2v14H5zm14 6h4v2h-4zM1 11h4v2H1zM11 1h2v4h-2zm0 18h2v4h-2zm0-10h2v2h-2zm-2 2h2v2H9zm2 2h2v2h-2zm2-2h2v2h-2z"/>'},"gps-sharp":{body:'<path fill="currentColor" d="M7 5h10v2H7zm10 0h2v14h-2zM7 17h10v2H7zM5 5h2v14H5zm14 6h4v2h-4zM1 11h4v2H1zM11 1h2v4h-2zm0 18h2v4h-2z"/>'},gpu:{body:'<path fill="currentColor" d="M1 2h2v20H1zm2 2h18v2H3zm18 2h2v10h-2zM3 16h18v2H3zm4 2h2v2H7zm2 2h6v2H9zm6-2h2v2h-2zM7 8h2v2H7zm8 0h2v2h-2zM5 10h2v2H5zm8 0h2v2h-2zm-6 2h2v2H7zm8 0h2v2h-2zm-6-2h2v2H9zm8 0h2v2h-2z"/>'},"gpu-sharp":{body:'<path fill="currentColor" d="M1 2h2v20H1zm2 2h20v2H3zm18 2h2v10h-2zM3 16h20v2H3zm4 2h2v2H7zm0 2h10v2H7zm8-2h2v2h-2zM7 8h2v2H7zm8 0h2v2h-2zM5 10h2v2H5zm8 0h2v2h-2zm-6 2h2v2H7zm8 0h2v2h-2zm-6-2h2v2H9zm8 0h2v2h-2z"/>'},grid:{body:'<path fill="currentColor" d="M2 2h20v20H2zm2 2v4h4V4zm6 0v4h4V4zm6 0v4h4V4zm4 6h-4v4h4zm0 6h-4v4h4zm-6 4v-4h-4v4zm-6 0v-4H4v4zm-4-6h4v-4H4zm6-4v4h4v-4z"/>',hidden:!0},"grid-2x2-2":{body:'<g fill="currentColor"><path d="M4 2h16v2H4zM2 4h2v16H2zm2 7h16v2H4zm16-7h2v16h-2z"/><path d="M11 4h2v18h-2z"/><path d="M4 20h16v2H4z"/></g>'},"grid-2x2-2-sharp":{body:'<g fill="currentColor"><path d="M4 2h16v2H4zM2 2h2v20H2zm2 9h16v2H4zm16-9h2v20h-2z"/><path d="M11 4h2v18h-2z"/><path d="M4 20h16v2H4z"/></g>'},"grid-2x3":{body:'<g fill="currentColor"><path d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zm-7 0v16h-2V4z"/><path d="M20 8v2H4V8zm0 6v2H4v-2z"/></g>'},"grid-2x3-sharp":{body:'<g fill="currentColor"><path d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zm-7 0v16h-2V4z"/><path d="M20 8v2H4V8zm0 6v2H4v-2z"/></g>'},"grid-3x2":{body:'<g fill="currentColor"><path d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zM4 11h16v2H4z"/><path d="M8 4h2v16H8zm6 0h2v16h-2z"/></g>'},"grid-3x2-sharp":{body:'<g fill="currentColor"><path d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zM4 11h16v2H4z"/><path d="M8 4h2v16H8zm6 0h2v16h-2z"/></g>'},"grid-3x3":{body:'<g fill="currentColor"><path d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zM4 8h16v2H4zm0 6h16v2H4z"/><path d="M8 4h2v16H8zm6 0h2v16h-2z"/></g>'},"grid-3x3-sharp":{body:'<g fill="currentColor"><path d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zM4 8h16v2H4zm0 6h16v2H4z"/><path d="M8 4h2v16H8zm6 0h2v16h-2z"/></g>'},group:{body:'<path fill="currentColor" d="M3 3h18v18H3zm2 2v14h14V5zm2 2h4v4H7zm6 0h4v4h-4zm-6 6h4v4H7zm6 0h4v4h-4z"/>',hidden:!0},hand:{body:'<path fill="currentColor" d="M21 7h2v5h-2zm-4-2h2v7h-2zm-4-2h2v8h-2zM9 3h2v8H9zM5 5h2v8H5zm14 0h2v2h-2zm-4-2h2v2h-2zm-4-2h2v2h-2zM7 3h2v2H7zm-4 8h2v2H3zm-2 2h2v2H1zm0 2h2v2H1zm2 2h2v2H3zm2 2h2v2H5zm2 2h12v2H7zm12-2h2v2h-2zm2-7h2v7h-2zM5 13h2v2H5zm2 2h2v2H7z"/>'},handbag:{body:'<g fill="currentColor"><path d="M7 4h2v7H7zm2-2h6v2H9zm6 2h2v7h-2z"/><path d="M5 7h14v2H5zm14 2h2v5h-2zM5 9H3v5h2zm16 5h2v6h-2zM3 14H1v6h2zm0 6h18v2H3z"/></g>'},"handbag-sharp":{body:'<g fill="currentColor"><path d="M7 4h2v7H7zm2-2h6v2H9zm6 2h2v7h-2z"/><path d="M1 7h22v2H1zm20 2h2v11h-2zM3 9H1v11h2zM1 20h22v2H1z"/></g>'},hash:{body:'<path fill="currentColor" d="M9 3h2v5H9zm6 0h2v5h-2zm-7 7h2v4H8zm6 0h2v4h-2zm-7 6h2v5H7zm6 0h2v5h-2zM3 8h18v2H3zm0 6h18v2H3z"/>'},hd:{body:'<path fill="currentColor" d="M3 7h2v4h4V7h2v10H9v-4H5v4H3zm10 8V7h6v2h-4v6h4v2h-6zm6 0V9h2v6z"/>',hidden:!0},heading:{body:'<g fill="currentColor"><path d="M5 4h2v16H5z"/><path d="M5 11h14v2H5z"/><path d="M17 4h2v16h-2z"/></g>'},"heading-1":{body:'<g fill="currentColor"><path d="M3 6h2v12H3z"/><path d="M3 11h10v2H3z"/><path d="M11 6h2v12h-2zm8 2h2v10h-2zm-4 2h2v2h-2zm2-2h2v2h-2z"/></g>'},"heading-2":{body:'<g fill="currentColor"><path d="M3 6h2v12H3z"/><path d="M3 11h10v2H3z"/><path d="M11 6h2v12h-2zm4 10h6v2h-6zm0-2h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2zm-2-2h2v2h-2zm-2 0h2v2h-2z"/></g>'},"heading-3":{body:'<g fill="currentColor"><path d="M3 6h2v12H3z"/><path d="M3 11h10v2H3z"/><path d="M11 6h2v12h-2zm4 10h4v2h-4zm4-2h2v2h-2zm-4-2h4v2h-4zm4-2h2v2h-2zm-2-2h2v2h-2zm-2 0h2v2h-2z"/></g>'},"heading-4":{body:'<g fill="currentColor"><path d="M3 6h2v12H3z"/><path d="M3 11h10v2H3z"/><path d="M11 6h2v12h-2zm4 6h4v2h-4zm4-4h2v10h-2zm-4 0h2v4h-2z"/></g>'},"heading-5":{body:'<g fill="currentColor"><path d="M3 6h2v12H3z"/><path d="M3 11h10v2H3z"/><path d="M11 6h2v12h-2zm10 10h-6v2h6zm0-2h-2v2h2zm-2-2h-2v2h2zm-2-4h-2v6h2zm2 0h-2v2h2zm2 0h-2v2h2z"/></g>'},"heading-6":{body:'<g fill="currentColor"><path d="M3 6h2v12H3z"/><path d="M3 11h10v2H3z"/><path d="M11 6h2v12h-2zm4 10h4v2h-4zm4-2h2v2h-2zm-4 0h2v2h-2zm0-2h4v2h-4zm2-4h2v2h-2zm-2 2h2v2h-2z"/></g>'},headphone:{body:'<g fill="currentColor"><path d="M14 13h7v2h-7zm2 6h3v2h-3z"/><path d="M14 13h2v8h-2zm5-6h2v12h-2zM3 13h7v2H3zm2 6h3v2H5z"/><path d="M3 7h2v12H3zm5 6h2v8H8zM7 3h10v2H7zM5 5h2v2H5zm12 0h2v2h-2z"/></g>'},headset:{body:'<path fill="currentColor" d="M19 2H5v2H3v14h7v-8H5V4h14v6h-5v8h3v2h-6v2h8v-4h2V4h-2zm-3 10h3v4h-3zm-8 0v4H5v-4z"/>',hidden:!0},heart:{body:'<path fill="currentColor" d="M13 22h-2v-2h2zm-2-2H9v-2h2zm4 0h-2v-2h2zm-6-2H7v-2h2zm8 0h-2v-2h2zM7 16H5v-2h2zm12 0h-2v-2h2zM5 14H3v-2h2zm16 0h-2v-2h2zM3 12H1V6h2zm20 0h-2V6h2zM13 8h-2V6h2zM5 6H3V4h2zm6 0H9V4h2zm4 0h-2V4h2zm6 0h-2V4h2zM9 4H5V2h4zm10 0h-4V2h4z"/>'},helicopter:{body:'<g fill="currentColor"><path d="M2 8h2v8H2zm2 4h2v2H4zm2-4h2v8H6zm2-2h10v2H8zm10 2h2v2h-2zm2 2h2v6h-2zM8 16h12v2H8zm2 2h2v2h-2zm6 0h2v2h-2zM6 20h16v2H6zM4 2h18v2H4z"/><path d="M12 4h2v8h-2zm2 8h6v2h-6z"/></g>'},hidden:{body:'<path fill="currentColor" d="M8 6h8v2H8zm-4 4V8h4v2zm-2 2v-2h2v2zm0 2v-2H0v2zm2 2H2v-2h2zm4 2H4v-2h4zm8 0v2H8v-2zm4-2v2h-4v-2zm2-2v2h-2v-2zm0-2h2v2h-2zm-2-2h2v2h-2zm0 0V8h-4v2zM9 10h2v2H9zm4 2h-2v2H9v2h2v-2h2v2h2v-2h-2zm0 0v-2h2v2z"/>',hidden:!0},home:{body:'<path fill="currentColor" d="M4 20h16v2H4zm16-10h2v10h-2zM2 10h2v10H2zm2-2h2v2H4zm2-2h2v2H6zm2-2h2v2H8zm2-2h4v2h-4zm4 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zM8 14h2v6H8zm2-2h4v2h-4zm4 2h2v6h-2z"/>'},"home-sharp":{body:'<path fill="currentColor" d="M2 20h20v2H2zm18-10h2v10h-2zM2 10h2v10H2zm2-2h2v2H4zm2-2h2v2H6zm2-2h2v2H8zm2-2h4v2h-4zm4 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zM8 14h2v6H8zm0-2h8v2H8zm6 2h2v6h-2z"/>'},"hotel-bed":{body:'<path fill="currentColor" d="M2 16h10V8h10v2h-8v6h8v-6h2v10h-2v-2H2v2H0V4h2zm7-1H5v-2h4zm-4-2H3V9h2zm6 0H9V9h2zM9 9H5V7h4z"/>'},"hotel-bed-sharp":{body:'<path fill="currentColor" d="M2 16h10V8h12v12h-2v-2H2v2H0V4h2zm12 0h8v-6h-8zm-5-1H5v-2h4zm-4-2H3V9h2zm6 0H9V9h2zM9 9H5V7h4z"/>'},hourglass:{body:'<path fill="currentColor" d="M16 22H8v-2h8zm-8-2H6v-4h2zm10 0h-2v-4h2zm-8-4H8v-2h2zm6 0h-2v-2h2zm-6-6h4v4h-4zm0 0H8V8h2zm6 0h-2V8h2zM8 8H6V4h2zm10 0h-2V4h2zm-2-4H8V2h8z"/>'},"hourglass-glyph":{body:'<path fill="currentColor" d="M16 16h2v6H6v-6h2v-2h2v-4H8V8H6V2h12v6h-2v2h-2v4h2z"/>'},"hourglass-sharp":{body:'<path fill="currentColor" d="M8 20h8v-4h2v6H6v-6h2zm2-4H8v-2h2zm6 0h-2v-2h2zm-6-6h4v4h-4zm0 0H8V8h2zm6 0h-2V8h2zm2-2h-2V4H8v4H6V2h12z"/>'},"hourglass-solid":{body:'<path fill="currentColor" d="M10 14v-4H8V8H6V4h2V2h8v2h2v4h-2v2h-2v4h2v2h2v4h-2v2H8v-2H6v-4h2v-2z"/>'},hq:{body:'<path fill="currentColor" d="M3 7h2v4h4V7h2v10H9v-4H5v4H3zm10 2h2v6h-2zm6 6h-4v2h8v-2h-2V9h-2V7h-4v2h4z"/>',hidden:!0},human:{body:'<path fill="currentColor" d="M10 2h4v4h-4zM3 7h18v2H3zm6 2h2v7H9zm4 0h2v7h-2zm-4 7h2v6H9zm4 0h2v6h-2zm-2-2h2v2h-2z"/>'},"human-arms-down":{body:'<path fill="currentColor" d="M10 2h4v4h-4zM7 7h10v2H7zm2 2h2v7H9zm4 0h2v7h-2zm-4 7h2v6H9zm4 0h2v6h-2zm-2-2h2v2h-2zM5 9h2v2H5zm-2 2h2v2H3zm14-2h2v2h-2zm2 2h2v2h-2z"/>'},"human-arms-up":{body:'<path fill="currentColor" d="M10 2h4v4h-4zM7 7h10v2H7zm2 2h2v7H9zm4 0h2v7h-2zm-4 7h2v6H9zm4 0h2v6h-2zm-2-2h2v2h-2zM5 5h2v2H5zM3 3h2v2H3zm14 2h2v2h-2zm2-2h2v2h-2z"/>'},"human-handsdown":{body:'<path fill="currentColor" d="M10 2h4v4h-4zM7 7h10v2h-2v13h-2v-6h-2v6H9V9H7zm-2 4h2V9H5zm0 0v2H3v-2zm14 0h-2V9h2zm0 0h2v2h-2z"/>',hidden:!0},"human-handsup":{body:'<path fill="currentColor" d="M10 2h4v4h-4zM7 7h10v2h-2v13h-2v-6h-2v6H9V9H7zM5 5v2h2V5zm0 0H3V3h2zm14 0v2h-2V5zm0 0V3h2v2z"/>',hidden:!0},"human-height":{body:'<path fill="currentColor" d="M6 2h4v4H6zM3 7h10v9h-2v6H9v-6H7v6H5v-6H3zm18-4h-6v2h6zm-4 4h4v2h-4zm4 4h-6v2h6zm-6 8h6v2h-6zm6-4h-4v2h4z"/>',hidden:!0},"human-height-alt":{body:'<path fill="currentColor" d="M4 2h4v4H4zM1 7h10v9H9v6H7v-6H5v6H3v-6H1zm18-5h-2v2h-2v2h-2v2h2V6h2v12h-2v-2h-2v2h2v2h2v2h2v-2h2v-2h2v-2h-2v2h-2V6h2v2h2V6h-2V4h-2z"/>',hidden:!0},"human-run":{body:'<path fill="currentColor" d="M10 3H8v2H6v2h2V5h2v2h2v2h-2v2H8v2H6v2H4v-2H2v2h2v2h2v-2h4v2h2v2h-2v2h2v-2h2v-2h-2v-4h2v-2h2v2h2v2h2v-2h2v-2h-2v2h-2v-2h-2V9h2V5h-4v2h-2V5h-2z"/>',hidden:!0},"icon-category":{body:'<path fill="currentColor" d="M3 3h8v2H3zm0 6h8v2H3zm0-4h2v4H3zm6 0h2v4H9zm4-2h8v2h-8zm0 6h8v2h-8zm0-4h2v4h-2zm6 0h2v4h-2zM3 13h8v2H3zm0 6h8v2H3zm0-4h2v4H3zm6 0h2v4H9zm6-2h4v2h-4zm-2 2h2v4h-2zm2 4h4v2h-4zm4-4h2v4h-2z"/>'},icons:{body:'<g fill="currentColor"><path d="M3 1h6v2H3zM1 3h2v6H1zm2 6h6v2H3zm6-6h2v6H9zm4-2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm-2-6h2v2h-2zm2-2h2v2h-2zm-6 6h2v2h-2zm-2 2h2v2h-2zm0 4h10v2H13zm0 8h10v2H13zm0-6h2v6h-2zm8 0h2v6h-2zM5 13h2v2H5zm2 2h2v4H7zm-4 0h2v4H3zm-2 4h2v4H1zm8 0h2v4H9z"/><path d="M1 21h10v2H1z"/></g>'},image:{body:'<g fill="currentColor"><path d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zm-4 8h2v2h-2zm-2 2h2v2h-2zm4 0h2v2h-2zm-8 0h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2z"/><path d="M20 16h2v2h-2zM8 16h2v2H8zm-2 2h2v2H6zM8 6h2v2H8zM6 8h2v2H6zm2 2h2v2H8zm2-2h2v2h-2z"/></g>'},"image-2-plus":{body:'<g fill="currentColor"><path d="M4 2h10v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 6h2v10h-2zm-6 0h2v2h-2zm-2 2h2v2h-2zm4 0h2v2h-2zm-6 2h2v2h-2zm8 0h2v2h-2zM8 16h2v2H8zm-2 2h2v2H6zM8 6h2v2H8zM6 8h2v2H6zm2 2h2v2H8zm2-2h2v2h-2zm8-6h2v6h-2z"/><path d="M16 4h6v2h-6z"/></g>'},"image-2-plus-sharp":{body:'<g fill="currentColor"><path d="M2 2h12v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 6h2v10h-2zm-6 0h2v2h-2zm-2 2h2v2h-2zm4 0h2v2h-2zm-6 2h2v2h-2zm8 0h2v2h-2zM8 16h2v2H8zm-2 2h2v2H6zM8 6h2v2H8zM6 8h2v2H6zm2 2h2v2H8zm2-2h2v2h-2zm8-6h2v6h-2z"/><path d="M16 4h6v2h-6z"/></g>'},"image-arrow-right":{body:'<path fill="currentColor" d="M19 1h-2v2h2v2h-6v2h6v2h-2v2h2V9h2V7h2V5h-2V3h-2zm-8 2H2v18h20v-8h-2v6H4V5h7zm1 8V9h2v2zm-2 2v-2h2v2zm-2 2v-2h2v2zm0 0v2H6v-2zm8-2h-2v-2h2zm0 0h2v2h-2zM6 7h2v2H6z"/>',hidden:!0},"image-broken":{body:'<path fill="currentColor" d="M22 3H2v18h20v-2h-2v-2h2v-2h-2v-2h2v-2h-2V9h2V7h-2V5h2zm-2 4v2h-2v2h2v2h-2v2h2v2h-2v2H4V5h14v2zm-6 2h-2v2h-2v2H8v2H6v2h2v-2h2v-2h2v-2h2v2h2v-2h-2zM6 7h2v2H6z"/>',hidden:!0},"image-delete":{body:'<path fill="currentColor" d="M14 3H2v18h20V11h-2v8H4V5h10zM6 7h2v2H6zm14-2h-2V3h-2v2h2v2h-2v2h2V7h2v2h2V7h-2zm0 0V3h2v2zm-8 4h2v2h-2zm-2 4v-2h2v2zm-2 2h2v-2H8zm0 0v2H6v-2zm8-2h-2v-2h2zm0 0h2v2h-2z"/>',hidden:!0},"image-flash":{body:'<path fill="currentColor" d="M18 0h2v4h4v2h-2v2h-2v2h-2V6h-4V4h2V2h2zM4 3h8v2H4v14h16v-7h2v9H2V3zm10 6h-2v2h-2v2H8v2H6v2h2v-2h2v-2h2v-2h2v2h2v2h2v-2h-2v-2h-2zM8 7H6v2h2z"/>',hidden:!0},"image-frame":{body:'<path fill="currentColor" d="M13 1h-2v2H9v2H7v2H2v16h20V7h-5V5h-2V3h-2zm2 6H9V5h2V3h2v2h2zM4 9h16v12H4zm10 6v-2h-2v2h-2v2H8v2h2v-2h2v-2zm2 2v-2h-2v2zm0 0v2h2v-2zM6 13v-2h2v2z"/>',hidden:!0},"image-gallery":{body:'<path fill="currentColor" d="M2 2h20v16h-5v2h-2v-2H9v2H7v-2H2zm5 18v2H5v-2zm10 0v2h2v-2zm3-16H4v12h16zm-8 4h2v2h-2zm-2 4v-2h2v2zm0 0v2H8v-2zm6 0h-2v-2h2zm0 0h2v2h-2zM8 6H6v2h2z"/>',hidden:!0},"image-multiple":{body:'<path fill="currentColor" d="M24 2H4v16h20zM6 16V4h16v12zM2 4H0v18h20v-2H2zm12 2h2v2h-2zm-2 4V8h2v2zm-2 2v-2h2v2zm0 0v2H8v-2zm8-2h-2V8h2zm0 0h2v2h-2zM8 6h2v2H8z"/>',hidden:!0},"image-new":{body:'<path fill="currentColor" d="M8 6h8v2H8zM6 8h2v8H6zm2 8h8v2H8zm8-8h2v8h-2zm-4 4h2v2h-2zm2-2h2v2h-2zm-4 4h2v2h-2zm1-13h2v3h-2zm0 19h2v3h-2zM1 11h3v2H1zm19 0h3v2h-3zm-1-8h2v2h-2zM3 3h2v2H3zM1 1h2v2H1zm2 18h2v2H3zm-2 2h2v2H1zm18-2h2v2h-2zm2 2h2v2h-2zm0-20h2v2h-2zM9 9h2v2H9z"/>'},"image-new-sharp":{body:'<path fill="currentColor" d="M6 6h12v2H6zm0 2h2v8H6zm0 8h12v2H6zm10-8h2v8h-2zm-2 4h2v2h-2zm-2-2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2H8zm3-13h2v3h-2zm0 19h2v3h-2zM1 11h3v2H1zm19 0h3v2h-3zm-1-8h2v2h-2zM3 3h2v2H3zM1 1h2v2H1zm2 18h2v2H3zm-2 2h2v2H1zm18-2h2v2h-2zm2 2h2v2h-2zm0-20h2v2h-2z"/>'},"image-plus":{body:'<path fill="currentColor" d="M4 3h10v2H4v14h16v-8h2v10H2V3zm10 6h-2v2h-2v2H8v2H6v2h2v-2h2v-2h2v-2h2v2h2v2h2v-2h-2v-2h-2zM8 7H6v2h2zm10-4h2v2h2v2h-2v2h-2V7h-2V5h2z"/>',hidden:!0},"image-sharp":{body:'<g fill="currentColor"><path d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zm-4 8h2v2h-2zm-2 2h2v2h-2zm4 0h2v2h-2zm-8 0h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2z"/><path d="M20 16h2v2h-2zM8 16h2v2H8zm-2 2h2v2H6zM8 6h2v2H8zM6 8h2v2H6zm2 2h2v2H8zm2-2h2v2h-2z"/></g>'},images:{body:'<path fill="currentColor" d="M7 2h14v2H7zm0 14h14v2H7zm-4 4h14v2H3zM5 4h2v12H5zM1 8h2v12H1zm20-4h2v12h-2zm-4 6h2v2h-2zm2 2h2v2h-2zm-4 0h2v2h-2zm-2 2h2v2h-2zm-2-8h2v2h-2zM9 8h2v2H9zm2 2h2v2h-2zm2-2h2v2h-2zM3 6h2v2H3zm14 12h2v2h-2z"/>'},"images-sharp":{body:'<path fill="currentColor" d="M5 2h18v2H5zm0 14h18v2H5zm-4 4h18v2H1zM5 4h2v12H5zM1 8h2v12H1zm20-4h2v12h-2zm-4 6h2v2h-2zm2 2h2v2h-2zm-4 0h2v2h-2zm-2 2h2v2h-2zm-2-8h2v2h-2zM9 8h2v2H9zm2 2h2v2h-2zm2-2h2v2h-2zM1 6h4v2H1zm16 12h2v2h-2z"/>'},inbox:{body:'<path fill="currentColor" d="M2 4h2v16H2zm2 16h16v2H4zM20 4h2v16h-2zM4 2h16v2H4zm0 12h4v2H4zm4 2h8v2H8zm8-2h4v2h-4z"/>'},"inbox-all":{body:'<path fill="currentColor" d="M3 2h18v20H3zm2 2v4h4v2h6V8h4V4zm14 6h-2v2H7v-2H5v4h14zm0 6h-2v2H7v-2H5v4h14z"/>',hidden:!0},"inbox-full":{body:'<path fill="currentColor" d="M3 2h18v20H3zm2 2v10h4v2h6v-2h4V4zm14 12h-2v2H7v-2H5v4h14zM7 6h10v2H7zm0 4h10v2H7z"/>',hidden:!0},"inbox-sharp":{body:'<path fill="currentColor" d="M2 4h2v16H2zm0 16h20v2H2zM20 4h2v16h-2zM2 2h20v2H2zm2 12h4v2H4zm2 2h12v2H6zm10-2h4v2h-4z"/>'},infinity:{body:'<path fill="currentColor" d="M8 18H4v-2h4zm12 0h-4v-2h4zM4 16H2v-2h2zm6 0H8v-2h2zm6 0h-2v-2h2zm6 0h-2v-2h2zM2 14H0v-4h2zm12 0h-2v-2h2zm10 0h-2v-4h2zm-12-2h-2v-2h2zm-8-2H2V8h2zm6 0H8V8h2zm6 0h-2V8h2zm6 0h-2V8h2zM8 8H4V6h4zm12 0h-4V6h4z"/>'},"infinity-glyph":{body:'<path fill="currentColor" d="M8 8H2v8h6v2H0V6h8zm16 10h-8v-2h6V8h-6V6h8zm-14-2H8v-2h2zm6 0h-2v-2h2zm-8-2H4v-4h4zm6 0h-2v-2h2zm6 0h-4v-4h4zm-8-2h-2v-2h2zm-2-2H8V8h2zm6 0h-2V8h2z"/>'},"infinity-sharp":{body:'<path fill="currentColor" d="M8 8H2v8h6v2H0V6h8zm16 10h-8v-2h6V8h-6V6h8zm-14-2H8v-2h2zm6 0h-2v-2h2zm-2-2h-2v-2h2zm-2-2h-2v-2h2zm-2-2H8V8h2zm6 0h-2V8h2z"/>'},"infinity-solid":{body:'<path fill="currentColor" d="M8 18H4v-2h4zm12 0h-4v-2h4zM4 16H2v-2h2zm6 0H8v-2h2zm6 0h-2v-2h2zm6 0h-2v-2h2zM2 14H0v-4h2zm6 0H4v-4h4zm6 0h-2v-2h2zm6 0h-4v-4h4zm4 0h-2v-4h2zm-12-2h-2v-2h2zm-8-2H2V8h2zm6 0H8V8h2zm6 0h-2V8h2zm6 0h-2V8h2zM8 8H4V6h4zm12 0h-4V6h4z"/>'},"info-box":{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zm-9 5h2V7h-2zm0 8h2v-6h-2z"/>'},"info-box-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zm-9 5h2V7h-2zm0 8h2v-6h-2z"/>'},instagram:{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14 0h-2v-2h2zM4 18H2V6h2zm18 0h-2V6h2zm-8-2h-4v-2h4zm-4-2H8v-4h2zm6 0h-2v-4h2zm-2-4h-4V8h4zm4-2h-2V6h2zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"instagram-solid":{body:'<path fill="currentColor" d="M16 6v2h2V6zm-6 10h4v-2h-4zm-2-2h2v-4H8zm6 0h2v-4h-2zm-4-4h4V8h-4zm12-4v12h-2v2h-2v2H6v-2H4v-2H2V6h2V4h2V2h12v2h2v2z"/>'},invert:{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zM4 18h2v2H4zm0-2h4v2H4zm0-2h6v2H4zm0-2h8v2H4zm0-2h10v2H4zm0-2h12v2H4zm0-2h14v2H4zm0-2h16v2H4z"/>'},"invert-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zM4 18h2v2H4zm0-2h4v2H4zm0-2h6v2H4zm0-2h8v2H4zm0-2h10v2H4zm0-2h12v2H4zm0-2h14v2H4zm0-2h16v2H4z"/>'},invoice:{body:'<path fill="currentColor" d="M5 20h2v2H3V4h2zm6 2H9v-2h2zm4 0h-2v-2h2zm6 0h-4v-2h2V4h2zM9 20H7v-2h2zm4 0h-2v-2h2zm4 0h-2v-2h2zm2-16H5V2h14z"/>'},"invoice-sharp":{body:'<path fill="currentColor" d="M21 22h-4v-2h2V4H5v16h2v2H3V2h18zm-10 0H9v-2h2zm4 0h-2v-2h2zm-6-2H7v-2h2zm4 0h-2v-2h2zm4 0h-2v-2h2z"/>'},iso:{body:'<path fill="currentColor" d="M8 3H6v3H3v2h3v3h2V8h3V6H8zm11 2h-2v2h-2v2h-2v2h-2v2H9v2H7v2H5v2h2v-2h2v-2h2v-2h2v-2h2V9h2V7h2zm-6 13v-2h8v2z"/>',hidden:!0},joystick:{body:'<path fill="currentColor" d="M4 14h16v2H4zm0 6h16v2H4zm-2-4h2v4H2zm18 0h2v4h-2zM10 2h4v2h-4zM8 4h2v4H8zm6 0h2v4h-2zm-4 4h4v2h-4zm1 2h2v4h-2zm-4 2h2v2H7z"/>'},"joystick-sharp":{body:'<path fill="currentColor" d="M2 14h20v2H2zm0 6h20v2H2zm0-4h2v4H2zm18 0h2v4h-2zM8 2h8v2H8zm0 2h2v4H8zm6 0h2v4h-2zM8 8h8v2H8zm3 2h2v4h-2zm-4 2h2v2H7z"/>'},kanban:{body:'<path fill="currentColor" d="M21 3H3v18h18zM5 19V5h14v14zM9 7H7v8h2zm2 0h2v4h-2zm6 0h-2v10h2z"/>',hidden:!0},key:{body:'<path fill="currentColor" d="M11 18H3v-2h8zm12-3h-2v3h-4v-2h2v-3h2v-2H11V8h2v1h10zM3 16H1V8h2zm14 0h-2v-1h-2v1h-2v-3h6zm-8-2H5v-4h4zm2-6H3V6h8z"/>'},"key-solid":{body:'<path fill="currentColor" d="M11 8h2v1h10v5h-2v4h-2v-4h-2v2h-2v-2h-2v2h-2v2H3v-2H1V8h2V6h8zm-6 6h4v-4H5z"/>'},keyboard:{body:'<path fill="currentColor" d="M21 21H3v-2h18zM3 19H1V5h2zm20 0h-2V5h2zm-5-2H6v-2h12zm-9-4H7v-2h2zm4 0h-2v-2h2zm4 0h-2v-2h2zM7 9H5V7h2zm4 0H9V7h2zm4 0h-2V7h2zm4 0h-2V7h2zm2-4H3V3h18z"/>'},"keyboard-glyph":{body:'<path fill="currentColor" d="M23 21H1V3h22zM6 17h12v-2H6zm1-4h2v-2H7zm4 0h2v-2h-2zm4 0h2v-2h-2zM5 9h2V7H5zm4 0h2V7H9zm4 0h2V7h-2zm4 0h2V7h-2z"/>'},"keyboard-music":{body:'<path fill="currentColor" d="M3 3h18v2H3zm0 16h18v2H3zM1 5h2v14H1zm20 0h2v14h-2zM3 11h18v2H3zm2-4h6v2H5zm8 0h2v2h-2zm4 0h2v2h-2zM5 13h2v4H5zm4 0h2v4H9zm4 0h2v4h-2zm4 0h2v4h-2z"/>'},"keyboard-music-sharp":{body:'<path fill="currentColor" d="M1 3h22v2H1zm0 16h22v2H1zM1 5h2v14H1zm20 0h2v14h-2zM3 11h18v2H3zm2-4h6v2H5zm8 0h2v2h-2zm4 0h2v2h-2zM5 13h2v4H5zm4 0h2v4H9zm4 0h2v4h-2zm4 0h2v4h-2z"/>'},"keyboard-sharp":{body:'<path fill="currentColor" d="M3 5v14h18V5zm15 12H6v-2h12zm-9-4H7v-2h2zm4 0h-2v-2h2zm4 0h-2v-2h2zM7 9H5V7h2zm4 0H9V7h2zm4 0h-2V7h2zm4 0h-2V7h2zm4 12H1V3h22z"/>'},"keyboard-solid":{body:'<path fill="currentColor" d="M21 5h2v14h-2v2H3v-2H1V5h2V3h18zM6 17h12v-2H6zm1-4h2v-2H7zm4 0h2v-2h-2zm4 0h2v-2h-2zM5 9h2V7H5zm4 0h2V7H9zm4 0h2V7h-2zm4 0h2V7h-2z"/>'},label:{body:'<path fill="currentColor" d="M16 22h-4v-2h4zm-4-2h-2v-2h2zm6 0h-2v-2h2zm-8-2H8v-2h2zm10 0h-2v-2h2zM8 16H6v-2h2zm14 0h-2v-4h2zM6 14H4v-2h2zm-2-2H2V4h2zm16 0h-2v-2h2zm-2-2h-2V8h2zM8 8H6V6h2zm8 0h-2V6h2zm-2-2h-2V4h2zm-2-2H4V2h8z"/>'},"label-alt":{body:'<path fill="currentColor" d="M16 5H2v14h14v-2h2v-2h2v-2h2v-2h-2V9h-2V7h-2zm0 2v2h2v2h2v2h-2v2h-2v2H4V7z"/>',hidden:!0},"label-alt-multiple":{body:'<path fill="currentColor" d="M8 5H6v10h12v-2h2v-2h2V9h-2V7h-2V5zm10 2v2h2v2h-2v2H8V7zM4 9H2v10h12v-2H4z"/>',hidden:!0},"label-sharp":{body:'<path fill="currentColor" d="M4 17h12v2H2v-4h2zm14 0h-2v-2h2zM6 15H4v-2h2zm14 0h-2v-2h2zM8 13H6v-2h2zm14 0h-2v-2h2zM6 11H4V9h2zm14 0h-2V9h2zm-4-4H4v2H2V5h14zm2 2h-2V7h2z"/>'},"label-solid":{body:'<path fill="currentColor" d="M12 4h2v2h2v2h2v2h2v2h2v4h-2v2h-2v2h-2v2h-4v-2h-2v-2H8v-2H6v-2H4v-2H2V4h2V2h8zM6 8h2V6H6z"/>'},languages:{body:'<path fill="currentColor" d="M7 2h4v2H7zM2 5h14v2H2zm9 2h2v2h-2zM9 9h2v2H9zm-2 2h2v2H7zM5 9h2v2H5zm4 4h2v2H9zm-4 0h2v2H5zm8 2h2v7h-2zm2-2h5v2h-5zm5 2h2v7h-2zm-5 2h5v2h-5z"/>'},"languages-sharp":{body:'<path fill="currentColor" d="M7 2h4v2H7zM2 5h14v2H2zm9 2h2v2h-2zM9 9h2v2H9zm-2 2h2v2H7zM5 9h2v2H5zm4 4h2v2H9zm-4 0h2v2H5zm8 2h2v7h-2zm0-2h9v2h-9zm7 2h2v7h-2zm-5 2h5v2h-5z"/>'},laptop:{body:'<path fill="currentColor" d="M3 18h18v-2h2v4H1v-4h2zm2-4h14V6h2v10H3V6h2zm14-8H5V4h14z"/>'},"laptop-glyph":{body:'<path fill="currentColor" d="M23 20H1v-4h22zm-2-6H3V4h18z"/>'},"laptop-sharp":{body:'<path fill="currentColor" d="M3 16v2h18v-2zm2-2h14V6H5zm18 6H1v-6h2V4h18v10h2z"/>'},"laptop-solid":{body:'<path fill="currentColor" d="M23 16v4H1v-4zM19 6h2v8H3V6h2V4h14z"/>'},lasso:{body:'<path fill="currentColor" d="M4 12h2v2H4zm-2 2h2v2H2zm2 2h2v4H4zm2-2h4v2H6zm0 6h2v2H6zm4-4h4v2h-4zm0-14h4v2h-4zm4 12h4v2h-4zm4-2h2v2h-2zm0-6h2v2h-2zM6 4h4v2H6zM4 6h2v2H4zm10-2h4v2h-4zm6 4h2v4h-2zM2 8h2v4H2z"/>'},laugh:{body:'<path fill="currentColor" d="M6 20h12v2H6zM6 2h12v2H6zm12 2h2v2h-2zM4 4h2v2H4zm0 14h2v2H4zm14 0h2v2h-2zM2 6h2v12H2zm18 0h2v12h-2zM7 14h2v2H7zm0-2h10v2H7zm2 4h6v2H9zm6-2h2v2h-2zM8 8h2v2H8zm6 0h2v2h-2z"/>'},"laugh-sharp":{body:'<path fill="currentColor" d="M4 20h16v2H4zM4 2h16v2H4zM2 2h2v20H2zm18 0h2v20h-2zM7 14h2v2H7zm0-2h10v2H7zm2 4h6v2H9zm6-2h2v2h-2zM8 8h2v2H8zm6 0h2v2h-2z"/>'},layout:{body:'<path fill="currentColor" d="M20 20H4v-2h4v-8H4v8H2V6h2v2h16V6h2v12h-2v-8H10v8h10zm0-14H4V4h16z"/>'},"layout-align-bottom":{body:'<path fill="currentColor" d="M16 4H8v12h8zm-6 10V6h4v8zm10 6v-2H4v2z"/>',hidden:!0},"layout-align-left":{body:'<path fill="currentColor" d="M20 16V8H8v8zm-10-6h8v4h-8zM4 20h2V4H4z"/>',hidden:!0},"layout-align-right":{body:'<path fill="currentColor" d="M4 8v8h12V8zm10 6H6v-4h8zm6-10h-2v16h2z"/>',hidden:!0},"layout-align-top":{body:'<path fill="currentColor" d="M16 20H8V8h8zm-6-10v8h4v-8zm10-6v2H4V4z"/>',hidden:!0},"layout-columns":{body:'<path fill="currentColor" d="M2 5h20v14H2zm2 2v10h7V7zm9 0v10h7V7z"/>',hidden:!0},"layout-distribute-horizontal":{body:'<path fill="currentColor" d="M6 4H4v16h2zm14 0h-2v16h2zM10 7h6v10H8V7zm4 8V9h-4v6z"/>',hidden:!0},"layout-distribute-vertical":{body:'<path fill="currentColor" d="M20 6V4H4v2zm0 14v-2H4v2zM17 8v8h-2V8zm-8 6v-4h6V8H7v8h8v-2z"/>',hidden:!0},"layout-footer":{body:'<path fill="currentColor" d="M2 5h20v14H2zm2 2v6h16V7zm16 8H4v2h16z"/>',hidden:!0},"layout-glyph":{body:'<path fill="currentColor" d="M8 20H2V10h6zm14 0H10V10h12zm0-12H2V4h20z"/>'},"layout-header":{body:'<path fill="currentColor" d="M2 19h20V5H2zm2-2v-6h16v6zm16-8H4V7h16z"/>',hidden:!0},"layout-rows":{body:'<path fill="currentColor" d="M2 5h20v14H2zm2 2v4h16V7zm16 6H4v4h16z"/>',hidden:!0},"layout-sharp":{body:'<path fill="currentColor" d="M22 20H2V4h20zm-12-2h10v-8H10zm-6 0h4v-8H4zM4 8h16V6H4z"/>'},"layout-sidebar-left":{body:'<path fill="currentColor" d="M2 5h20v14H2zm2 2v10h2V7zm4 0v10h12V7z"/>',hidden:!0},"layout-sidebar-right":{body:'<path fill="currentColor" d="M22 5H2v14h20zm-2 2v10h-2V7zm-4 0v10H4V7z"/>',hidden:!0},"layout-solid":{body:'<path fill="currentColor" d="M8 20H4v-2H2v-8h6zm14-2h-2v2H10V10h12zM20 6h2v2H2V6h2V4h16z"/>'},leaf:{body:'<path fill="currentColor" d="M1 18h2v4H1zm2-2h2v2H3zm2-2h6v2H5zm6-2h2v2h-2zm-6 6h4v2H5zm4 2h4v2H9zm4-2h4v2h-4zm4-2h2v2h-2zm2-8h2v8h-2zm0-4h2v4h-2zm-2-2h2v2h-2zm-4 2h4v2h-4zM7 6h6v2H7zM5 8h2v2H5zm-2 2h2v4H3z"/>'},"letter-a":{body:'<path fill="currentColor" d="M8 12h8V5h2v16h-2v-7H8v7H6V5h2zm8-7H8V3h8z"/>'},"letter-a-circle":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14 0h-2v-2h2zM4 18H2V6h2zm5-7h6V8h2v10h-2v-5H9v5H7V8h2zm13 7h-2V6h2zM15 8H9V6h6zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"letter-b":{body:'<path fill="currentColor" d="M16 5H8v6h8v2H8v6h8v2H6V3h10zm2 14h-2v-6h2zm0-8h-2V5h2z"/>'},"letter-b-circle":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14 0h-2v-2h2zM4 18H2V6h2zM16 8H9v3h7v2H9v3h7v2H7V6h9zm6 10h-2V6h2zm-4-2h-2v-3h2zm0-5h-2V8h2zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"letter-c":{body:'<path fill="currentColor" d="M16 21H8v-2h8zm-8-2H6V5h2zm10 0h-2v-3h2zm0-11h-2V5h2zm-2-3H8V3h8z"/>'},"letter-c-circle":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14 0h-2v-2h2zM4 18H2V6h2zm11 0H9v-2h6zm7 0h-2V6h2zM9 16H7V8h2zm8 0h-2v-2h2zm0-6h-2V8h2zm-2-2H9V6h6zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"letter-d":{body:'<path fill="currentColor" d="M14 5H8v14h6v2H6V3h8zm2 14h-2v-2h2zm2-2h-2V7h2zM16 7h-2V5h2z"/>'},"letter-d-circle":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14 0h-2v-2h2zM4 18H2V6h2zM15 8h-5v8h5v2H8V6h7zm7 10h-2V6h2zm-5-2h-2V8h2zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"letter-e":{body:'<path fill="currentColor" d="M18 5H8v6h8v2H8v6h10v2H6V3h12z"/>'},"letter-e-circle":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14 0h-2v-2h2zM4 18H2V6h2zM16 8h-6v3h4v2h-4v3h6v2H8V6h8zm6 10h-2V6h2zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"letter-f":{body:'<path fill="currentColor" d="M18 5H8v6h8v2H8v8H6V3h12z"/>'},"letter-f-circle":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14 0h-2v-2h2zM4 18H2V6h2zM16 8h-6v3h4v2h-4v5H8V6h8zm6 10h-2V6h2zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"letter-g":{body:'<path fill="currentColor" d="M16 21H8v-2h8zm-8-2H6V5h2zm10-7v7h-2v-5h-4v-2zm0-4h-2V5h2zm-2-3H8V3h8z"/>'},"letter-g-circle":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14 0h-2v-2h2zM4 18H2V6h2zm11 0H9v-2h6zm7 0h-2V6h2zM9 16H7V8h2zm8 0h-2v-3h-3v-2h5zm-2-8H9V6h6zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"letter-h":{body:'<path fill="currentColor" d="M8 11h8V3h2v18h-2v-8H8v8H6V3h2z"/>'},"letter-h-circle":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14 0h-2v-2h2zM4 18H2V6h2zm18 0h-2V6h2zM9 11h6V7h2v10h-2v-4H9v4H7V7h2zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"letter-i":{body:'<path fill="currentColor" d="M16 5h-3v14h3v2H8v-2h3V5H8V3h8z"/>'},"letter-i-circle":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14 0h-2v-2h2zM4 18H2V6h2zM15 8h-2v8h2v2H9v-2h2V8H9V6h6zm7 10h-2V6h2zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"letter-j":{body:'<path fill="currentColor" d="M16 21H8v-2h8zm-8-2H6v-3h2zm10 0h-2V5h-4V3h6z"/>'},"letter-j-circle":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14 0h-2v-2h2zM4 18H2V6h2zm10 0h-4v-2h4zm8 0h-2V6h2zm-12-2H8v-2h2zm6 0h-2V8h-4V6h6zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"letter-k":{body:'<path fill="currentColor" d="M8 11h2v2H8v8H6V3h2zm10 8v2h-2v-2zm-2 0h-2v-2h2zm-2-2h-2v-2h2zm-2-2h-2v-2h2zm0-4h-2V9h2zm2-2h-2V7h2zm2-2h-2V5h2zm2-2h-2V3h2z"/>'},"letter-k-circle":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14-2v2h-2v-2zM4 18H2V6h2zm18 0h-2V6h2zm-12-7h2v2h-2v4H8V7h2zm6 6h-2v-2h2zm-2-2h-2v-2h2zm0-4h-2V9h2zm2-2h-2V7h2zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"letter-l":{body:'<path fill="currentColor" d="M8 19h10v2H6V3h2z"/>'},"letter-l-circle":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14-2v2h-2v-2zM4 18H2V6h2zm18 0h-2V6h2zm-12-3h6v2H8V7h2zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"letter-m":{body:'<path fill="currentColor" d="M7 5h2v2H7v14H5V3h2zm12 16h-2V7h-2V5h2V3h2zm-6-10h-2V9h2zm-2-2H9V7h2zm4 0h-2V7h2z"/>'},"letter-m-circle":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14-2v2h-2v-2zM4 18H2V6h2zm18 0h-2V6h2zM9 9h2v2H9v6H7V7h2zm8 8h-2v-6h-2V9h2V7h2zm-4-4h-2v-2h2zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"letter-n":{body:'<path fill="currentColor" d="M7 5h2v2H7v14H5V3h2zm12 16h-2v-2h-2v-2h2V3h2zm-4-4h-2v-3h2zm-2-3h-2v-4h2zm-2-4H9V7h2z"/>'},"letter-n-circle":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14-2v2h-2v-2zM4 18H2V6h2zm18 0h-2V6h2zM9 9h2v2H9v6H7V7h2zm8 8h-2v-2h-2v-2h2V7h2zm-4-4h-2v-2h2zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"letter-o":{body:'<path fill="currentColor" d="M16 21H8v-2h8zm-8-2H6V5h2zm10 0h-2V5h2zM16 5H8V3h8z"/>'},"letter-o-circle":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14 0h-2v-2h2zM4 18H2V6h2zm11 0H9v-2h6zm7 0h-2V6h2zM9 16H7V8h2zm8 0h-2V8h2zm-2-8H9V6h6zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"letter-p":{body:'<path fill="currentColor" d="M16 5H8v6h8v2H8v8H6V3h10zm2 6h-2V5h2z"/>'},"letter-p-circle":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14 0h-2v-2h2zM4 18H2V6h2zM15 8h-5v4h5v2h-5v4H8V6h7zm7 10h-2V6h2zm-5-6h-2V8h2zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"letter-q":{body:'<path fill="currentColor" d="M14 21H8v-2h6zm6 0h-4v-2h4zM8 19H6V5h2zm8 0h-2v-2h2zm-2-2h-2v-2h2zm4 0h-2V5h2zM16 5H8V3h8z"/>'},"letter-q-circle":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14 0h-2v-2h2zM4 18H2V6h2zm9 0H9v-2h4zm4 0h-2v-2h2zm5 0h-2V6h2zM9 16H7V8h2zm6 0h-2v-2h2zm-2-2h-2v-2h2zm4 0h-2V8h2zm-2-6H9V6h6zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"letter-r":{body:'<path fill="currentColor" d="M16 5H8v6h8v2h-4v2h-2v-2H8v8H6V3h10zm2 16h-2v-2h2zm-2-2h-2v-2h2zm-2-2h-2v-2h2zm4-6h-2V5h2z"/>'},"letter-r-circle":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14 0h-2v-2h2zM4 18H2V6h2zM14 8h-4v4h4v4h-2v-2h-2v4H8V6h6zm2 10h-2v-2h2zm6 0h-2V6h2zm-6-6h-2V8h2zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"letter-s":{body:'<path fill="currentColor" d="M16 21H7v-2h9zm2-2h-2v-6h2zm-2-6H8v-2h8zm-8-2H6V5h2zm9-6H8V3h9z"/>'},"letter-s-circle":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14 0h-2v-2h2zM4 18H2V6h2zm10 0H9v-2h5zm8 0h-2V6h2zm-6-2h-2v-3h2zm-2-3h-4v-2h4zm-4-2H8V8h2zm5-3h-5V6h5zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"letter-t":{body:'<path fill="currentColor" d="M13 21h-2V5H5V3h14v2h-6z"/>'},"letter-t-circle":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14 0h-2v-2h2zM4 18H2V6h2zM16 8h-3v10h-2V8H8V6h8zm6 10h-2V6h2zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"letter-u":{body:'<path fill="currentColor" d="M16 21H8v-2h8zm-8-2H6V3h2zm10 0h-2V3h2z"/>'},"letter-u-circle":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14 0h-2v-2h2zM4 18H2V6h2zm11 0H9v-2h6zm7 0h-2V6h2zM9 16H7V7h2zm8 0h-2V7h2zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"letter-v":{body:'<path fill="currentColor" d="M14 21h-4v-2h4zm-4-2H8v-4h2zm6 0h-2v-4h2zm-8-4H6V3h2zm10 0h-2V3h2z"/>'},"letter-v-circle":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14 0h-2v-2h2zM4 18H2V6h2zm9 0h-2v-2h2zm9 0h-2V6h2zm-11-2H9v-2h2zm4 0h-2v-2h2zm-6-2H7V7h2zm8 0h-2V7h2zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"letter-w":{body:'<path fill="currentColor" d="M9 21H7v-2h2zm8 0h-2v-2h2zM7 19H5v-2h2zm4 0H9v-2h2zm4 0h-2v-2h2zm4 0h-2v-2h2zM5 17H3V3h2zm8 0h-2V3h2zm8 0h-2V3h2z"/>'},"letter-w-circle":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14 0h-2v-2h2zM4 18H2V6h2zm7 0H8v-2h3zm5 0h-3v-2h3zm6 0h-2V6h2zM8 16H6V7h2zm5 0h-2V7h2zm5 0h-2V7h2zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"letter-x":{body:'<path fill="currentColor" d="M9 21H7v-4h2zm8 0h-2v-4h2zm-6-4H9v-4h2zm4 0h-2v-4h2zm-2-4h-2v-2h2zm-2-2H9V7h2zm4 0h-2V7h2zM9 7H7V3h2zm8 0h-2V3h2z"/>'},"letter-x-circle":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14 0h-2v-2h2zM4 18H2V6h2zm18 0h-2V6h2zM9 17H7v-2h2zm8 0h-2v-2h2zm-6-2H9v-2h2zm4 0h-2v-2h2zm-2-2h-2v-2h2zm-2-2H9V9h2zm4 0h-2V9h2zM9 9H7V7h2zm8 0h-2V7h2zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"letter-y":{body:'<path fill="currentColor" d="M13 21h-2v-9h2zm-2-9H9V9h2zm4 0h-2V9h2zM9 9H7V6h2zm8 0h-2V6h2zM7 3v3H5V3zm12 3h-2V3h2z"/>'},"letter-y-circle":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14 0h-2v-2h2zM4 18H2V6h2zm9 0h-2v-7h2zm9 0h-2V6h2zm-11-7H9V9h2zm4 0h-2V9h2zM9 9H7V7h2zm8 0h-2V7h2zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"letter-z":{body:'<path fill="currentColor" d="M17 21H7v-6h2v4h8zm-6-6H9v-2h2zm2-2h-2v-2h2zm2-2h-2V9h2zm2-2h-2V5H7V3h10z"/>'},"letter-z-circle":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14 0h-2v-2h2zM4 18H2V6h2zm6-2h6v2H8v-4h2zm12 2h-2V6h2zm-10-4h-2v-2h2zm2-2h-2v-2h2zm2-2h-2V8H8V6h8zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},library:{body:'<path fill="currentColor" d="M3 4h2v17H3zm4 4h2v13H7zm4-2h2v15h-2zm4 0h2v5h-2zm2 5h2v5h-2zm2 5h2v5h-2z"/>'},lightbulb:{body:'<path fill="currentColor" d="M9 4h6v2H9zM7 6h2v2H7zm8 0h2v2h-2zm4-2h2v2h-2zm2-2h2v2h-2zM0 10h3v2H0zm21 0h3v2h-3zM3 4h2v2H3zM1 2h2v2H1zm6 12h2v2H7zm8 0h2v2h-2zM5 8h2v6H5zm12 0h2v6h-2zm-8 8h6v2H9zm0 4h6v2H9zm0-2h2v2H9zm4 0h2v2h-2zM11 0h2v3h-2z"/>'},"lightbulb-2":{body:'<path fill="currentColor" d="M8 2h8v2H8zM6 6V4h2v2zm0 6H4V6h2zm2 2H6v-2h2zm2 0H8v4h8v-4h2v-2h2V6h-2V4h-2v2h2v6h-2v2h-2v2h-4zm2-2v2h-2v-2zm0-2h2v2h-2zm0-2v2h-2V8zm0 0V6h2v2zm4 14v-2H8v2z"/>',hidden:!0},"lightbulb-off":{body:'<path fill="currentColor" d="M9 3h6v2H9zM7 5h2v2H7zm8 0h2v2h-2zm-8 8h2v2H7zm8 0h2v2h-2zM5 7h2v6H5zm12 0h2v6h-2zm-8 8h6v2H9zm0 4h6v2H9zm0-2h2v2H9zm4 0h2v2h-2z"/>'},"lightbulb-on":{body:'<path fill="currentColor" d="M13 2h-2v4h2zm2 6H9v2H7v4h2v4h6v-4h2v-4h-2zm0 2v4h-2v2h-2v-2H9v-4zM9 20h6v2H9zm14-9v2h-4v-2zM5 13v-2H1v2zm12-7h2v2h-2zm2 0h2V4h-2zM5 6h2v2H5zm0 0V4H3v2z"/>',hidden:!0},link:{body:'<path fill="currentColor" d="M4 6h7v2H4zm0 10h7v2H4zM2 8h2v8H2zm18-2h-7v2h7zm0 10h-7v2h7zm2-8h-2v8h2zM7 11h10v2H7z"/>'},"link-sharp":{body:'<path fill="currentColor" d="M2 6h9v2H2zm0 10h9v2H2zm0-8h2v8H2zm20-2h-9v2h9zm0 10h-9v2h9zm0-8h-2v8h2zM7 11h10v2H7z"/>'},linkedin:{body:'<path fill="currentColor" d="M7 22H1V8h6zm12-12h-8v10h2v-8h4v2h-2v8H9V8h10zm4 12h-6v-8h2v6h2v-8h2zM3 20h2V10H3zm18-8h-2v-2h2zM5 7H3V5h2zM3 5H1V3h2zm4 0H5V3h2zM5 3H3V1h2z"/>'},"linkedin-2":{body:'<path fill="currentColor" d="M20 22H4v-2h16zM4 20H2V4h2zm18 0h-2V4h2zM9 17H7v-6h2zm6-6v2h-2v4h-2v-6zm2 6h-2v-4h2zM9 9H7V7h2zm11-5H4V2h16z"/>'},"linkedin-2-solid":{body:'<path fill="currentColor" d="M20 22H4v-2H2V4h2V2h16v2h2v16h-2zM7 17h2v-6H7zm4 0h2v-4h2v-2h-4zm4 0h2v-4h-2zM7 9h2V7H7z"/>'},linux:{body:'<path fill="currentColor" d="M15 22H9v-2h6zm-6-2H7v-2h2zm8 0h-2v-2h2zM3 14h4v4H5v-2H1v-4h2zm20 2h-4v2h-2v-4h4v-2h2zm-10-3h-2v-2H9V9h6v2h-2zm-8-1H3v-2h2zm16 0h-2v-2h2zM7 10H5V8h2zm12 0h-2V8h2zM9 8H7V4h2zm8 0h-2V4h2zm-2-4H9V2h6z"/>'},"linux-solid":{body:'<path fill="currentColor" d="M15 22H9v-2H7v-2H5v-2H1v-4h2v-2h2V8h2V4h2V2h6v2h2v4h2v2h2v2h2v4h-4v2h-2v2h-2zM9 9v2h2v2h2v-2h2V9z"/>'},list:{body:'<path fill="currentColor" d="M6 6H4v2h2zm14 0H8v2h12zM4 11h2v2H4zm16 0H8v2h12zM4 16h2v2H4zm16 0H8v2h12z"/>',hidden:!0},"list-box":{body:'<path fill="currentColor" d="M4 2h16v2H4zm2 5h2v2H6zm4 0h8v2h-8zm-4 4h2v2H6zm4 0h8v2h-8zm-4 4h2v2H6zm4 0h8v2h-8zm-6 5h16v2H4zM2 4h2v16H2zm18 0h2v16h-2z"/>'},"list-box-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm4 5h2v2H6zm4 0h8v2h-8zm-4 4h2v2H6zm4 0h8v2h-8zm-4 4h2v2H6zm4 0h8v2h-8zm-8 5h20v2H2zM2 4h2v16H2zm18 0h2v16h-2z"/>'},loader:{body:'<path fill="currentColor" d="M13 22h-2v-6h2zm-6-3H5v-2h2zm12 0h-2v-2h2zM9 17H7v-2h2zm8 0h-2v-2h2zm-9-4H2v-2h6zm14 0h-6v-2h6zM9 9H7V7h2zm8 0h-2V7h2zm-4-1h-2V2h2zM7 7H5V5h2zm12 0h-2V5h2z"/>'},loading:{body:'<path fill="currentColor" d="M4 12H2V6h2zm2-6H4V4h2zm6-2H6V2h6z"/>'},"loading-2":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14 0h-2v-2h2zM4 18H2V6h2zm18 0h-2v-6h2zM6 6H4V4h2zm6-2H6V2h6z"/>'},"loading-3":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14 0h-2v-2h2zM4 18H2v-6h2zm18 0h-2V6h2zM9 14.998h2v2H9V15H7V9h2zm6-6h2v2h-2V9H9V7h6zM20 6h-2V4h2zm-2-2h-6V2h6z"/>'},lock:{body:'<path fill="currentColor" d="M5 8h14v2H5zm0 12h14v2H5zM3 10h2v10H3zm16 0h2v10h-2zM7 4h2v4H7zm2-2h6v2H9zm6 2h2v4h-2z"/>'},"lock-open":{body:'<path fill="currentColor" d="M15 2H9v2H7v2h2V4h6v4H4v14h16V8h-3V4h-2zm0 8h3v10H6V10zm-2 3h-2v4h2z"/>',hidden:!0},"lock-sharp":{body:'<path fill="currentColor" d="M3 8h18v2H3zm0 12h18v2H3zm0-10h2v10H3zm16 0h2v10h-2zM7 4h2v4H7zm0-2h10v2H7zm8 2h2v4h-2z"/>'},login:{body:'<g fill="currentColor"><path d="M2 11h14v2H2zm10-2h2v2h-2z"/><path d="M10 7h2v10h-2zm2 6h2v2h-2zM6 2h12v2H6zm0 18h12v2H6zM4 4h2v5H4zm0 11h2v5H4zM18 4h2v16h-2z"/></g>'},"login-sharp":{body:'<g fill="currentColor"><path d="M2 11h14v2H2zm10-2h2v2h-2z"/><path d="M10 7h2v10h-2zm2 6h2v2h-2zM4 2h16v2H4zm0 18h16v2H4zM4 4h2v5H4zm0 11h2v5H4zM18 4h2v16h-2z"/></g>'},logout:{body:'<g fill="currentColor"><path d="M8 11h12v2H8zm8-2h2v2h-2z"/><path d="M14 7h2v10h-2zm2 6h2v2h-2zM6 2h12v2H6zm0 18h12v2H6zM4 4h2v16H4zm14 0h2v3h-2zm0 13h2v3h-2z"/></g>'},"logout-sharp":{body:'<g fill="currentColor"><path d="M8 11h12v2H8zm8-2h2v2h-2z"/><path d="M14 7h2v10h-2zm2 6h2v2h-2zM4 2h16v2H4zm0 18h16v2H4zM4 4h2v16H4zm14 0h2v3h-2zm0 13h2v3h-2z"/></g>'},luggage:{body:'<path fill="currentColor" d="M9 2h6v4h4v14h-2v2h-2v-2H9v2H7v-2H5V6h4zm2 4h2V4h-2zM7 18h10V8H7zm4-8v6H9v-6zm4 0v6h-2v-6z"/>',hidden:!0},"magic-edit":{body:'<path fill="currentColor" d="M16 2h4v2h-4zm2 2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2H8zm-2 2h2v2H6zm-2 2h2v2H4zm-2-2h2v4H2zm2-2h2v2H4zm2-2h2v2H6zm2-2h2v2H8zm2-2h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2zm0 2h2v2h-2zm2-2h2v2h-2zm0 8h2v2h-2zm0 8h2v2h-2zm-4-4h2v2h-2zm8 0h2v2h-2zm-6-2h2v2h-2zm4 0h2v2h-2zm0 4h2v2h-2zm-4 0h2v2h-2zM4 2h2v2H4zM2 4h2v2H2zm2 2h2v2H4zm2-2h2v2H6zm14 6h2v2h-2zM8 20h2v2H8z"/>'},mail:{body:'<path fill="currentColor" d="M6 8h2v2H6zm2 2h2v2H8zm10-2h-2v2h2zm-2 2h-2v2h2zm-6 2h4v2h-4zM2 6h2v12H2zm18 0h2v12h-2zM4 4h16v2H4zm0 14h16v2H4z"/>'},"mail-arrow-right":{body:'<path fill="currentColor" d="M20 4H2v16h10v-2H4V6h16v6h2V4zM6 8h2v2H6zm4 4H8v-2h2zm4 0v2h-4v-2zm2-2v2h-2v-2zm0 0V8h2v2zm8 8h-2v-2h-2v-2h-2v2h2v2h-6v2h6v2h-2v2h2v-2h2v-2h2z"/>',hidden:!0},"mail-check":{body:'<path fill="currentColor" d="M4 4h18v10h-2V6H4v12h8v2H2V4zm4 4H6v2h2v2h2v2h4v-2h2v-2h2V8h-2v2h-2v2h-4v-2H8zm6 10h2v2h-2zm4 2v2h-2v-2zm2-2h-2v2h2zm0 0v-2h2v2z"/>',hidden:!0},"mail-delete":{body:'<path fill="currentColor" d="M20 4H2v16h12v-2H4V6h16v8h2V4zM6 8h2v2H6zm4 4H8v-2h2zm4 0v2h-4v-2zm2-2v2h-2v-2zm0 0V8h2v2zm2 6h-2v2h2v2h-2v2h2v-2h2v2h2v-2h-2v-2h2v-2h-2v2h-2z"/>',hidden:!0},"mail-flash":{body:'<path fill="currentColor" d="M4 4h18v8h-2V6H4v12h8v2H2V4zm4 4H6v2h2v2h2v2h4v-2h2v-2h2V8h-2v2h-2v2h-4v-2H8zm10 6h2v4h4v2h-2v2h-2v2h-2v-4h-4v-2h2v-2h2z"/>',hidden:!0},"mail-multiple":{body:'<path fill="currentColor" d="M24 2H4v16h20zM6 16V4h16v12zM2 7H0v15h19v-2H2zm8-1H8v2h2v2h2v2h4v-2h2V8h2V6h-2v2h-2v2h-4V8h-2z"/>',hidden:!0},"mail-off":{body:'<path fill="currentColor" d="M2 2h2v2H2zm4 4H4V4h2zm2 2H6V6h2zm2 2H8V8h2zm2 2h-2v-2h2zm2 0h-2v2h2v2h2v2h2v2h2v2h2v-2h-2v-2h-2v-2h-2v-2h-2zm2-2h-2v2h2zm0 0V8h2v2zm-6-6h12v12h-2V6H10zm4 14v2H2V8h2v10z"/>',hidden:!0},"mail-open":{body:'<path fill="currentColor" d="M4 8h2V6H4zm2 4h2v2H6zm-2-2h2v2H4zm14 0h2v2h-2zM6 6h2V4H6zm2 8h8v2H8zm12-6h-2V6h2zm-2 4h-2v2h2zm0-6h-2V4h2zM8 4h8V2H8zM2 8h2v12H2zm18 0h2v12h-2zM4 20h16v2H4z"/>'},"mail-open-sharp":{body:'<path fill="currentColor" d="M4 8h2V6H4zm2 4h2v2H6zm-2-2h2v2H4zm14 0h2v2h-2zM6 6h2V4H6zm2 8h8v2H8zm12-6h-2V6h2zm-2 4h-2v2h2zm0-6h-2V4h2zM8 4h8V2H8zM2 8h2v12H2zm18 0h2v12h-2zM2 20h20v2H2z"/>'},"mail-right":{body:'<g fill="currentColor"><path d="M6 8h2v2H6zm2 2h2v2H8zm10-2h-2v2h2zm-2 2h-2v2h2zm-6 2h4v2h-4z" opacity=".1"/><path d="M4 4h16v2H4zm0 14h8v2H4zM2 6h2v12H2zm18 0h2v6h-2zM6 8h2v2H6zm2 2h2v2H8zm6 0h2v2h-2zm2-2h2v2h-2zm-6 4h4v2h-4zm12 6h2v2h-2zm-8 0h4v2h-4zm6-2h2v6h-2zm-2-2h2v10h-2z"/></g>'},"mail-right-sharp":{body:'<g fill="currentColor"><path d="M6 8h2v2H6zm2 2h2v2H8zm10-2h-2v2h2zm-2 2h-2v2h2zm-6 2h4v2h-4z" opacity=".1"/><path d="M2 4h20v2H2zm0 14h10v2H2zM2 6h2v12H2zm18 0h2v6h-2zM6 8h2v2H6zm2 2h2v2H8zm6 0h2v2h-2zm2-2h2v2h-2zm-6 4h4v2h-4zm12 6h2v2h-2zm-8 0h4v2h-4zm6-2h2v6h-2zm-2-2h2v10h-2z"/></g>'},"mail-sharp":{body:'<path fill="currentColor" d="M6 8h2v2H6zm2 2h2v2H8zm10-2h-2v2h2zm-2 2h-2v2h2zm-6 2h4v2h-4zM2 6h2v12H2zm18 0h2v12h-2zM2 4h20v2H2zm0 14h20v2H2z"/>'},"mail-unread":{body:'<path fill="currentColor" d="M22 2h-6v6h6zM4 4h10v2H4v12h16v-8h2v10H2V4zm4 4H6v2h2v2h2v2h4v-2h2v-2h-2v2h-4v-2H8z"/>',hidden:!0},mailbox:{body:'<path fill="currentColor" d="M3 18h18v2H3zM1 8h2v10H1zm4-4h14v2H5zM3 6h2v2H3zm4 0h2v2H7zm12 0h2v2h-2zM9 8h2v10H9zm12 0h2v10h-2zM5 10h2v2H5zm9 0h4v2h-4zm2 2h2v2h-2z"/>'},"mailbox-sharp":{body:'<path fill="currentColor" d="M1 18h22v2H1zM1 8h2v10H1zm4-4h14v2H5zM3 6h2v2H3zm4 0h2v2H7zm12 0h2v2h-2zM9 8h2v10H9zm12 0h2v10h-2zM5 10h2v2H5zm9 0h4v2h-4zm2 2h2v2h-2z"/>'},map:{body:'<path fill="currentColor" d="M4 20h2v2H2V6h2zm12 0h2v2h-4v-2h-2v-2h2V8h-2V6h4zm-8 0H6v-2h2zm12 0h-2v-2h2zM10 4h2v2h-2v10h2v2H8V4H6V2h4zm12 14h-2V4h-2V2h4zM6 6H4V4h2zm12 0h-2V4h2z"/>'},"map-pin":{body:'<path fill="currentColor" d="M7 2h10v2H7zM5 4h2v2H5zm14 0h-2v2h2zM7 17h2v2H7zm2 2h2v2H9zm6-2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2h-2zm-6-7h2v3H5zm12 0h2v3h-2zM3 6h2v8H3zm18 0h-2v8h2zM10 6h4v2h-4zM8 8h2v4H8zm2 4h4v2h-4zm4-4h2v4h-2z"/>'},"map-pin-home":{body:'<path fill="currentColor" d="M6 2h10v2H6zM4 4h2v2H4zm14 0h-2v2h2zM6 17h2v2H6zm2 2h2v2H8zm2 2h2v2h-2zm-6-7h2v3H4zM2 6h2v8H2zm18 0h-2v3h2zM9 6h4v2H9zM7 8h2v4H7zm2 4h4v2H9zm4-4h2v4h-2zm3 5h2v2h-2zm-2 2h2v6h-2zm8 0h2v6h-2zm-4-4h2v2h-2zm2 2h2v2h-2zm-4 6h6v2h-6zm2-2h2v2h-2z"/>'},"map-solid":{body:'<path fill="currentColor" d="M8 20H6v2H2V6h2V4h2V2h2zm14-2h-2v2h-2v2h-2V4h2V2h4zM12 6h2v14h-2v-2h-2V4h2z"/>'},mastodon:{body:'<path fill="currentColor" d="M11 20v2H7v-2zm-4-2v2H5v-2zm6 0v2h-2v-2zM5 6v12H3V6zm6 10v2H9v-2zm8-2v2h-8v-2zm2-8v8h-2V6zM9 8v4H7V8zm8 0v4h-2V8zm-4 0v2h-2V8zm-2-2v2H9V6zm4 0v2h-2V6zM7 4v2H5V4zm12 0v2h-2V4zm-2-2v2H7V2z"/>'},"mastodon-solid":{body:'<path fill="currentColor" d="M17 4h2v2h2v8h-2v2h-8v2h2v2h-2v2H7v-2H5v-2H3V6h2V4h2V2h10zM9 8H7v4h2zh2v2h2V8h2v4h2V8h-2V6h-2v2h-2V6H9z"/>'},megaphone:{body:'<path fill="currentColor" d="M4 6h12v2H4zM2 8h2v6H2zm2 6h12v2H4zM20 2h2v18h-2zm-2 16h2v2h-2zm-2-2h2v2h-2zm0-12h2v2h-2zm2-2h2v2h-2zM8 8h2v6H8zm-2 8h2v4H6zm2 4h4v2H8zm2-4h2v4h-2z"/>'},"megaphone-sharp":{body:'<path fill="currentColor" d="M4 6h12v2H4zM2 6h2v10H2zm2 8h12v2H4zM20 2h2v18h-2zm-2 16h2v2h-2zm-2-2h2v2h-2zm0-12h2v2h-2zm2-2h2v2h-2zM8 8h2v6H8zm-2 8h2v4H6zm0 4h6v2H6zm4-4h2v4h-2z"/>'},meh:{body:'<path fill="currentColor" d="M6 20h12v2H6zM6 2h12v2H6zm12 2h2v2h-2zM4 4h2v2H4zm0 14h2v2H4zm14 0h2v2h-2zM2 6h2v12H2zm18 0h2v12h-2zM7 14h10v2H7zm1-6h2v2H8zm6 0h2v2h-2z"/>'},"meh-sharp":{body:'<path fill="currentColor" d="M4 20h16v2H4zM4 2h16v2H4zM2 2h2v20H2zm18 0h2v20h-2zM7 14h10v2H7zm1-6h2v2H8zm6 0h2v2h-2z"/>'},membercard:{body:'<path fill="currentColor" d="M20 19h-5v4h-2v-2h-2v2H9v-4H4v-2h16zM4 17H2V7h2zm18 0h-2V7h2zm-8-2H6v-2h8zm4-4H6V9h12zm2-4H4V5h16z"/>'},"membercard-sharp":{body:'<path fill="currentColor" d="M22 19h-7v4h-2v-2h-2v2H9v-4H2V5h20zM4 17h16V7H4zm10-2H6v-2h8zm4-4H6V9h12z"/>'},"memory-stick":{body:'<path fill="currentColor" d="M3 4h18v2H3zM1 6h2v3H1zm0 5h2v7H1zm20 0h2v7h-2zM3 9h2v2H3zm16 0h2v2h-2zm2-3h2v3h-2zM3 18h18v2H3zm0-4h18v2H3zm2 2h2v2H5zm4 0h2v2H9zm4 0h2v2h-2zm4 0h2v2h-2zM7 8h2v4H7zm4 0h2v4h-2zm4 0h2v4h-2z"/>'},"memory-stick-sharp":{body:'<path fill="currentColor" d="M1 4h22v2H1zm0 2h2v3H1zm0 5h2v7H1zm20 0h2v7h-2zM3 9h2v2H3zm16 0h2v2h-2zm2-3h2v3h-2zM1 18h22v2H1zm2-4h18v2H3zm2 2h2v2H5zm4 0h2v2H9zm4 0h2v2h-2zm4 0h2v2h-2zM7 8h2v4H7zm4 0h2v4h-2zm4 0h2v4h-2z"/>'},menu:{body:'<path fill="currentColor" d="M20 18H4v-2h16zm0-5H4v-2h16zm0-5H4V6h16z"/>'},"menu-circle":{body:'<path fill="currentColor" d="M6 2h12v2H6zm0 18h12v2H6zM2 6h2v12H2zm18 0h2v12h-2zm-2-2h2v2h-2zm0 14h2v2h-2zM4 4h2v2H4zm0 14h2v2H4zM7 7h10v2H7zm0 4h10v2H7zm0 4h10v2H7z"/>'},"menu-square":{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zM7 7h10v2H7zm0 4h10v2H7zm0 4h10v2H7z"/>'},"menu-square-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zM7 7h10v2H7zm0 4h10v2H7zm0 4h10v2H7z"/>'},message:{body:'<path fill="currentColor" d="M20 2H4v2h16zm0 14H6v2h14zm2-12h-2v12h2zM4 4H2v18h2zm2 14H4v2h2z"/>'},"message-arrow-left":{body:'<path fill="currentColor" d="M4 2h18v12h-2V4H4v18H2V2zm2 14h4v2H6v2H4v-2h2zm16 0h-6v-2h2v-2h-2v2h-2v2h-2v2h2v2h2v2h2v-2h-2v-2h6z"/>',hidden:!0},"message-arrow-right":{body:'<path fill="currentColor" d="M4 2h18v10h-2V4H4v18H2V2zm2 14h4v2H6v2H4v-2h2zm16 0h-2v-2h-2v-2h-2v2h2v2h-6v2h6v2h-2v2h2v-2h2v-2h2z"/>',hidden:!0},"message-bookmark":{body:'<path fill="currentColor" d="M4 2h18v16H6v2H4v-2h2v-2h14V4H4v18H2V2zm14 4h-6v8h2v-2h2v2h2z"/>',hidden:!0},"message-clock":{body:'<path fill="currentColor" d="M20 2H2v20h2V4h16v4h2V2zM8 16H6v2H4v2h2v-2h2zm6-2h2v2h2v2h-4zm6-4h-8v2h-2v8h2v2h8v-2h2v-8h-2zm0 2v8h-8v-8z"/>',hidden:!0},"message-delete":{body:'<path fill="currentColor" d="M4 2h18v16H6v2H4v-2h2v-2h14V4H4v18H2V2zm9 7h-2V7H9v2h2v2H9v2h2v-2h2v2h2v-2h-2zm0 0V7h2v2z"/>',hidden:!0},"message-flash":{body:'<path fill="currentColor" d="M20 2H2v20h2V4h16v10h2V2zM10 16H6v2H4v2h2v-2h4zm6-4h2v4h4v2h-2v2h-2v2h-2v-4h-4v-2h2v-2h2z"/>',hidden:!0},"message-image":{body:'<path fill="currentColor" d="M4 2h18v16H6v2H4v-2h2v-2h14V4H4v18H2V2zm10 4h-2v2h-2v2H8v2H6v2h2v-2h2v-2h2V8h2v2h2v2h2v-2h-2V8h-2zM6 6h2v2H6z"/>',hidden:!0},"message-minus":{body:'<path fill="currentColor" d="M4 2h18v16H6v2H4v-2h2v-2h14V4H4v18H2V2zm12 7H8v2h8z"/>',hidden:!0},"message-plus":{body:'<path fill="currentColor" d="M20 2H2v20h2V4h16v12H6v2H4v2h2v-2h16V2zm-7 7h3v2h-3v3h-2v-3H8V9h3V6h2z"/>',hidden:!0},"message-processing":{body:'<path fill="currentColor" d="M4 2h18v16H6v2H4v-2h2v-2h14V4H4v18H2V2zm5 7H7v2h2zm2 0h2v2h-2zm6 0h-2v2h2z"/>',hidden:!0},"message-reply":{body:'<path fill="currentColor" d="M4 18h2v2H4v2H2V4h2zm6 0H6v-2h4zm6-6h4v2h-4v4h-2v-2h-2v-2h-2v-2h2v-2h2V8h2zm6 4h-2v-2h2zm0-6h-2V4h2zm-2-6H4V2h16z"/>'},"message-reply-glyph":{body:'<path fill="currentColor" d="M22 10h-4V6h-6v2h-2v2H8v8H6v2H4v2H2V2h20zm-6 2h4v2h-4v4h-2v-2h-2v-2h-2v-2h2v-2h2V8h2zm6 4h-2v-2h2z"/>'},"message-reply-sharp":{body:'<path fill="currentColor" d="M22 10h-2V4H4v14h2v2H4v2H2V2h20zm-12 8H6v-2h4zm6-6h4v2h-4v4h-2v-2h-2v-2h-2v-2h2v-2h2V8h2zm6 4h-2v-2h2z"/>'},"message-reply-solid":{body:'<path fill="currentColor" d="M20 4h2v6h-4V6h-6v2h-2v2H8v6h2v2H6v2H4v2H2V4h2V2h16zm-4 8h4v2h-4v4h-2v-2h-2v-2h-2v-2h2v-2h2V8h2zm6 4h-2v-2h2z"/>'},"message-sharp":{body:'<path fill="currentColor" d="M22 2H2v2h20zm0 14H6v2h16zm0-12h-2v12h2zM4 4H2v18h2zm2 14H4v2h2z"/>'},"message-text":{body:'<path fill="currentColor" d="M20 2H4v2h16zm0 14H6v2h14zm2-12h-2v12h2zM4 4H2v18h2zm2 14H4v2h2zm0-6h4v2H6zm0-4h8v2H6z"/>'},"message-text-sharp":{body:'<path fill="currentColor" d="M22 2H2v2h20zm0 14H6v2h16zm0-12h-2v12h2zM4 4H2v18h2zm2 14H4v2h2zm0-6h4v2H6zm0-4h8v2H6z"/>'},mic:{body:'<path fill="currentColor" d="M10 2h4v2h-4zM8 4h2v10H8zm2 10h4v2h-4zm4-10h2v10h-2zM4 10h2v6H4zm2 6h2v2H6zm2 2h8v2H8zm8-2h2v2h-2zm2-6h2v6h-2zm-7 10h2v2h-2z"/>'},"mic-off":{body:'<g fill="currentColor"><path d="M10 2h4v2h-4zM8 8h2v6H8zm2 6h4v2h-4zm4-10h2v6h-2zM4 10h2v6H4zm2 6h2v2H6zm2 2h8v2H8zm8-2h2v2h-2zm-2-2h2v2h-2zm-2-2h2v2h-2zm-2-2h2v2h-2z"/><path d="M8 8h2v2H8zM6 6h2v2H6zM4 4h2v2H4zM2 2h2v2H2zm16 16h2v2h-2zm2 2h2v2h-2zm-2-10h2v4h-2zm-7 10h2v2h-2z"/></g>'},"mic-off-sharp":{body:'<g fill="currentColor"><path d="M8 2h8v2H8zm0 6h2v8H8zm2 6h4v2h-4zm4-10h2v6h-2zM4 10h2v9H4zm2 8h12v2H6zm10-2h2v2h-2zm-2-2h2v2h-2zm-2-2h2v2h-2zm-2-2h2v2h-2z"/><path d="M8 8h2v2H8zM6 6h2v2H6zM4 4h2v2H4zM2 2h2v2H2zm16 16h2v2h-2zm2 2h2v2h-2zm-2-10h2v4h-2zm-7 10h2v2h-2z"/></g>'},"mic-sharp":{body:'<path fill="currentColor" d="M8 2h8v2H8zm0 2h2v10H8zm0 10h8v2H8zm6-10h2v10h-2zM4 10h2v8H4zm2 8h12v2H6zm12-8h2v8h-2zm-7 10h2v2h-2z"/>'},minus:{body:'<path fill="currentColor" d="M4 11h16v2H4z"/>'},"minus-box":{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zM8 11h8v2H8z"/>'},"minus-box-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zM8 11h8v2H8z"/>'},"missed-call":{body:'<path fill="currentColor" d="M20 6h-4v2h2v2h-2v2h-2v2h-2v2h-2v-2H8v-2H6v-2H4V8H2v2h2v2h2v2h2v2h2v2h2v-2h2v-2h2v-2h2v-2h2v2h2V6z"/>',hidden:!0},modem:{body:'<path fill="currentColor" d="M4 12h16v2H4zm0 8h16v2H4zm-2-6h2v6H2zm18 0h2v6h-2zm-4 2h2v2h-2zm-4 0h2v2h-2zm2-6h2v2h-2zm-3-2h2v2h-2zM9 4h2v2H9zm10 0h2v2h-2zm-2 4h2v2h-2zm-4-2h4v2h-4zm-2-4h8v2h-8z"/>'},"modem-sharp":{body:'<path fill="currentColor" d="M2 12h20v2H2zm0 8h20v2H2zm0-6h2v6H2zm18 0h2v6h-2zm-4 2h2v2h-2zm-4 0h2v2h-2zm2-6h2v2h-2zm-3-2h2v2h-2zM9 4h2v2H9zm10 0h2v2h-2zm-2 4h2v2h-2zm-4-2h4v2h-4zm-2-4h8v2h-8z"/>'},money:{body:'<path fill="currentColor" d="M8 8h12v2H8zm0 10h12v2H8zm-2-8h2v8H6zm14 0h2v8h-2zM4 4h12v2H4zm0 10h2v2H4zM2 6h2v8H2zm14 0h2v2h-2zm-4 6h4v4h-4z"/>'},"money-sharp":{body:'<path fill="currentColor" d="M6 8h16v2H6zm0 10h16v2H6zm0-8h2v8H6zm14 0h2v8h-2zM2 4h16v2H2zm0 10h4v2H2zm0-8h2v8H2zm14 0h2v2h-2zm-4 6h4v4h-4z"/>'},monitor:{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 14h16v2H4zM2 4h2v12H2zm18 0h2v12h-2zm-9 14h2v2h-2zm-3 2h8v2H8z"/>'},"monitor-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 14h20v2H2zM2 4h2v12H2zm18 0h2v12h-2zm-9 14h2v2h-2zm-3 2h8v2H8z"/>'},"mood-happy":{body:'<path fill="currentColor" d="M5 3h14v2H5zm0 16H3V5h2zm14 0v2H5v-2zm0 0h2V5h-2zM10 8H8v2h2zm4 0h2v2h-2zm-5 6v-2H7v2zm6 0v2H9v-2zm0 0h2v-2h-2z"/>',hidden:!0},"mood-neutral":{body:'<path fill="currentColor" d="M5 3h14v2H5zm0 16H3V5h2zm14 0v2H5v-2zm0 0h2V5h-2zM10 8H8v2h2zm4 0h2v2h-2zm1 5H9v2h6z"/>',hidden:!0},"mood-sad":{body:'<path fill="currentColor" d="M5 3h14v2H5zm0 16H3V5h2zm14 0v2H5v-2zm0 0h2V5h-2zM10 8H8v2h2zm4 0h2v2h-2zm-5 8v-2h6v2h2v-2h-2v-2H9v2H7v2z"/>',hidden:!0},moon:{body:'<path fill="currentColor" d="M18 22H8v-2h10zM8 20H6v-2h2zm12 0h-2v-2h2zM6 18H4v-2h2zm16 0h-2v-4h-2v-2h2v-2h2zM4 16H2V6h2zm14 0h-6v-2h6zm-6-2h-2v-2h2zm-2-2H8V6h2zM6 6H4V4h2zm8-2h-2v2h-2V4H6V2h8z"/>'},"moon-star":{body:'<path fill="currentColor" d="M6 2h8v2h-2v2h-2V4H6zM4 6V4h2v2zm0 10H2V6h2zm2 2H4v-2h2zm2 2H6v-2h2zm10 0v2H8v-2zm2-2v2h-2v-2zm-2-4v-2h2v-2h2v8h-2v-4zm-6 0h6v2h-6zm-2-2h2v2h-2zm0 0V6H8v6zm8-10h2v2h2v2h-2v2h-2V6h-2V4h2z"/>',hidden:!0},"moon-stars":{body:'<path fill="currentColor" d="M20 0h2v2h2v2h-2v2h-2V4h-2V2h2zM8 4h8v2h-2v2h-2V6H8zM6 8V6h2v2zm0 8H4V8h2zm2 2H6v-2h2zm8 0v2H8v-2zm2-2v2h-2v-2zm-2-4v-2h2V8h2v8h-2v-4zm-4 0h4v2h-4zm0 0V8h-2v4zm-8 6H2v2H0v2h2v2h2v-2h2v-2H4z"/>',hidden:!0},"more-horizontal":{body:'<path fill="currentColor" d="M3 9h2v2H3zm8 0h2v2h-2zm8 0h2v2h-2zM1 11h2v2H1zm8 0h2v2H9zm8 0h2v2h-2zM3 13h2v2H3zm8 0h2v2h-2zm8 0h2v2h-2zM5 11h2v2H5zm8 0h2v2h-2zm8 0h2v2h-2z"/>'},"more-horizontal-sharp":{body:'<path fill="currentColor" d="M1 9h6v2H1zm8 0h6v2H9zm8 0h6v2h-6zM1 11h2v2H1zm8 0h2v2H9zm8 0h2v2h-2zM1 13h6v2H1zm8 0h6v2H9zm8 0h6v2h-6zM5 11h2v2H5zm8 0h2v2h-2zm8 0h2v2h-2z"/>'},"more-vertical":{body:'<path fill="currentColor" d="M15 3v2h-2V3zm0 8v2h-2v-2zm0 8v2h-2v-2zM13 1v2h-2V1zm0 8v2h-2V9zm0 8v2h-2v-2zM11 3v2H9V3zm0 8v2H9v-2zm0 8v2H9v-2zm2-14v2h-2V5zm0 8v2h-2v-2zm0 8v2h-2v-2z"/>'},"more-vertical-sharp":{body:'<path fill="currentColor" d="M15 1v6h-2V1zm0 8v6h-2V9zm0 8v6h-2v-6zM13 1v2h-2V1zm0 8v2h-2V9zm0 8v2h-2v-2zM11 1v6H9V1zm0 8v6H9V9zm0 8v6H9v-6zm2-12v2h-2V5zm0 8v2h-2v-2zm0 8v2h-2v-2z"/>'},mouse:{body:'<path fill="currentColor" d="M8 2h8v2H8zm0 20h8v-2H8zM6 4h2v2H6zm0 16h2v-2H6zM16 4h2v2h-2zm0 16h2v-2h-2zM4 6h2v12H4zm14 0h2v12h-2zm-7 0h2v4h-2z"/>'},move:{body:'<path fill="currentColor" d="M13 2h2v2h2v2h-4v5h5V7h2v2h2v2h2v2h-2v2h-2v2h-2v-4h-5v5h4v2h-2v2h-2v2h-2v-2H9v-2H7v-2h4v-5H6v4H4v-2H2v-2H0v-2h2V9h2V7h2v4h5V6H7V4h2V2h2V0h2z"/>'},movie:{body:'<path fill="currentColor" d="M3 3h18v18H3zm2 2v2h2V5zm4 0v6h6V5zm8 0v2h2V5zm2 4h-2v2h2zm0 4h-2v2h2zm0 4h-2v2h2zm-4 2v-6H9v6zm-8 0v-2H5v2zm-2-4h2v-2H5zm0-4h2V9H5z"/>',hidden:!0},mug:{body:'<path fill="currentColor" d="M16 19H6v-2h10zm2-8h2v2h-2v4h-2V7H6v10H4V5h16v2h-2zm4 0h-2V7h2z"/>'},"mug-glyph":{body:'<path fill="currentColor" d="M22 13h-4v6H4V5h18zm-4-2h2V7h-2z"/>'},"mug-sharp":{body:'<path fill="currentColor" d="M16 17V7H6v10zm2-6h2V7h-2zm0 8H4V5h18v8h-4z"/>'},"mug-solid":{body:'<path fill="currentColor" d="M16 19H6v-2H4V5h16v2h-2v4h2v2h-2v4h-2zm6-8h-2V7h2z"/>'},music:{body:'<path fill="currentColor" d="M4 12h4v2H4zm-2 2h2v4H2zm2 4h4v2H4zM8 6h2v12H8zm10 0h2v12h-2zm-6 8h2v4h-2zm2-2h4v2h-4zm0 6h4v2h-4zM10 4h8v2h-8z"/>'},"music-sharp":{body:'<g fill="currentColor"><path d="M2 12h8v2H2zm0 2h2v4H2zm0 4h8v2H2z"/><path d="M8 6h2v12H8zm10 0h2v12h-2zm-6 8h2v4h-2z"/><path d="M12 12h8v2h-8zm0 6h8v2h-8zM8 4h12v2H8z"/></g>'},netlify:{body:'<path fill="currentColor" d="M13 23h-2v-6h2zm-7-3H4v-2h2zm2-2H6v-2h2zm5-3h-2v-2h2zm-6-2H0v-2h7zm4 0H9v-2h2zm4 0h-2v-2h2zm9 0h-7v-2h7zm-11-2h-2V9h2zM8 8H6V6h2zm5-1h-2V1h2zM6 6H4V4h2z"/>'},"netlify-solid":{body:'<path fill="currentColor" d="M13 23h-2v-6h2zm-7-3H4v-2h2zm2-2H6v-2h2zm7-3H9V9h6zm-8-2H0v-2h7zm17 0h-7v-2h7zM8 8H6V6h2zm5-1h-2V1h2zM6 6H4V4h2z"/>'},next:{body:'<path fill="currentColor" d="M6 4h2v2h2v2h2v2h2v4h-2v2h-2v2H8v2H6zm12 0h-2v16h2z"/>',hidden:!0},note:{body:'<path fill="currentColor" d="M2 4h2v16H2zm18 0h2v12h-2zM4 2h16v2H4zm14 14h2v2h-2zm-2 2h2v2h-2zM4 20h12v2H4zm10-8h6v2h-6zm-2 2h2v6h-2z"/>'},"note-delete":{body:'<path fill="currentColor" d="M11 2h10v14h-2v2h-2v-2h-2v2h2v2h-2v2H3V10h2v10h8v-6h6V4h-8zM7 4H5V2H3v2h2v2H3v2h2V6h2v2h2V6H7zm0 0h2V2H7z"/>',hidden:!0},"note-multiple":{body:'<path fill="currentColor" d="M21 6H7v16h8v-2h2v-2h-2v-2h2v2h2v-2h2zM9 20V8h10v6h-6v6zm-6-2h2V4h12V2H3z"/>',hidden:!0},"note-plus":{body:'<path fill="currentColor" d="M7 1H5v3H2v2h3v3h2V6h3V4H7zm12 1h-7v2h7v10h-6v6H5v-9H3v11h12v-2h2v-2h2v-2h2V2zm-2 16h-2v-2h2z"/>',hidden:!0},"note-sharp":{body:'<path fill="currentColor" d="M2 4h2v16H2zm18 0h2v12h-2zM2 2h20v2H2zm16 14h2v2h-2zm-2 2h2v2h-2zM2 20h14v2H2zm10-8h8v2h-8zm0 2h2v6h-2z"/>'},notebook:{body:'<g fill="currentColor"><path d="M6 2h14v2H6zm0 18h14v2H6zM20 4h2v16h-2zM4 4h2v16H4z"/><path d="M2 7h6v2H2zm0 4h6v2H2zm0 4h6v2H2zM16 4h2v16h-2z"/></g>'},"notebook-sharp":{body:'<g fill="currentColor"><path d="M4 2h18v2H4zm0 18h18v2H4zM20 4h2v16h-2zM4 4h2v16H4z"/><path d="M2 7h6v2H2zm0 4h6v2H2zm0 4h6v2H2zM16 4h2v16h-2z"/></g>'},notes:{body:'<g fill="currentColor"><path d="M6 8h2v12H6zM2 4h2v12H2zm18 4h2v8h-2zM8 6h12v2H8zM4 2h12v2H4zm14 14h2v2h-2zm-2 2h2v2h-2zm-8 2h8v2H8zm6-6h6v2h-6z"/><path d="M14 14h2v6h-2zm2-10h2v2h-2zM4 16h2v2H4z"/></g>'},"notes-delete":{body:'<path fill="currentColor" d="M19 2H3v20h10v-2H5V4h14v10h2V2zm-2 4H7v2h10zM7 10h10v2H7zm6 4H7v2h6zm6 4h-2v-2h-2v2h2v2h-2v2h2v-2h2v2h2v-2h-2zm0 0h2v-2h-2z"/>',hidden:!0},"notes-multiple":{body:'<path fill="currentColor" d="M7 0h16v20H5V0zm14 18V2H7v16zM9 4h10v2H9zm10 4H9v2h10zM9 12h7v2H9zm10 10H3V4H1v20h18z"/>',hidden:!0},"notes-plus":{body:'<path fill="currentColor" d="M5 2h16v12h-2V4H5v16h8v2H3V2zm2 4h10v2H7zm10 4H7v2h10zM7 14h7v2H7zm13 5h3v2h-3v3h-2v-3h-3v-2h3v-3h2z"/>',hidden:!0},"notes-sharp":{body:'<g fill="currentColor"><path d="M6 8h2v12H6zM2 4h2v12H2zm18 4h2v8h-2zM6 6h16v2H6zM2 2h16v2H2zm16 14h2v2h-2zm-2 2h2v2h-2zM6 20h10v2H6zm8-6h6v2h-6z"/><path d="M14 14h2v6h-2zm2-10h2v2h-2zM2 16h4v2H2z"/></g>'},notification:{body:'<path fill="currentColor" d="M14 4V2h-4v2H5v2h14V4zm5 12H5v-4H3v6h5v4h2v-4h4v2h-4v2h6v-4h5v-6h-2V6h-2v8h2zM5 6v8h2V6z"/>',hidden:!0},"notification-off":{body:'<path fill="currentColor" d="M14 2v2h5v2h-8V2zM5 16h9v2h2v4h-6v-2h4v-2h-4v4H8v-4H3v-6h2v-2h2v4H5zm16-2h-2v-2h-2V6h2v6h2zM5 2H3v2h2v2h2v2h2v2h2v2h2v2h2v2h2v2h2v2h2v-2h-2v-2h-2v-2h-2v-2h-2v-2h-2V8H9V6H7V4H5z"/>',hidden:!0},npm:{body:'<path fill="currentColor" d="M24 16H12v2H6v-2H0V7h24zM8 16h2v-2h3V9H8zm-6-2h1v-4h2v4h1V9H2zm13 0h1v-4h2v4h1v-4h2v4h1V9h-7zm-3-1h-2v-3h2z"/>'},open:{body:'<g fill="currentColor"><path d="M5 5h6v2H5zm8-2h8v2h-8zM5 19h12v2H5zM3 7h2v12H3zm14 6h2v6h-2z"/><path d="M19 3h2v8h-2zm-8 8h2v2h-2zm6-4h-2v2h2zm2-2h-2v2h2zm-4 4h-2v2h2zm-4 4H9v2h2z"/></g>'},"open-sharp":{body:'<g fill="currentColor"><path d="M3 5h8v2H3zm10-2h8v2h-8zM3 19h16v2H3zM3 7h2v12H3zm14 6h2v6h-2z"/><path d="M19 3h2v8h-2zm-8 8h2v2h-2zm6-4h-2v2h2zm2-2h-2v2h2zm-4 4h-2v2h2zm-4 4H9v2h2z"/></g>'},package:{body:'<g fill="currentColor"><path d="M10 20h4v2h-4zm0-16h4V2h-4zm0 6h4v2h-4zm4 8h4v2h-4zm0-12h4V4h-4zm0 2h4v2h-4zm4 8h4v2h-4zm0-8h4V6h-4zM6 18h4v2H6zM6 6h4V4H6zm0 2h4v2H6zm-4 8h4v2H2zm0-8h4V6H2z"/><path d="M2 6h2v12H2zm18 0h2v12h-2zm-8 6h2v8h-2zm-2-6h4v2h-4z"/></g>'},"paint-bucket":{body:'<path fill="currentColor" d="M8 3h8v2H8zm0 2H6v4H4v12h16V9h-2V5h-2v4H8zm8 6h2v8H6v-8h2v6h2v-4h2v2h2v-2h2z"/>',hidden:!0},paperclip:{body:'<path fill="currentColor" d="M5 5h16v10H7V9h10v2H9v2h10V7H5v10h14v2H3V5z"/>',hidden:!0},parking:{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zM8 6h2v12H8zm2 0h4v2h-4zm4 2h2v4h-2zm-4 4h4v2h-4z"/>'},"parking-off":{body:'<g fill="currentColor"><path d="M8 2h12v2H8zM4 20h14v2H4zM2 6h2v14H2zm18-2h2v12h-2zM8 8h2v10H8zm4-2h2v2h-2zm2 2h2v2h-2zm-4 4h4v2h-4zm10 8h2v2h-2zm-2-2h2v2h-2zm-2-2h2v2h-2zm-2-2h2v2h-2z"/><path d="M12 12h2v2h-2zm-2-2h2v2h-2zM8 8h2v2H8zM6 6h2v2H6zM4 4h2v2H4zM2 2h2v2H2z"/></g>'},"parking-off-sharp":{body:'<g fill="currentColor"><path d="M8 2h14v2H8zM4 20h14v2H4zM2 6h2v16H2zm18-2h2v12h-2zM8 8h2v10H8zm4-2h2v2h-2zm2 2h2v2h-2zm-4 4h4v2h-4zm10 8h2v2h-2zm-2-2h2v2h-2zm-2-2h2v2h-2zm-2-2h2v2h-2z"/><path d="M12 12h2v2h-2zm-2-2h2v2h-2zM8 8h2v2H8zM6 6h2v2H6zM4 4h2v2H4zM2 2h2v2H2z"/></g>'},"parking-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zM8 6h2v12H8zm2 0h4v2h-4zm4 2h2v4h-2zm-4 4h4v2h-4z"/>'},"party-popper":{body:'<path fill="currentColor" d="M4 20h2v2H2v-4h2zm16 1h-2v-2h2zm-10-1H6v-2h4zm-4-2H4v-4h2zm8 0h-4v-2h4zm-4-2H8v-2h2zm6 0h-2v-4h2zm6 0h-2v-2h2zM8 14H6v-4h2zm12 0h-2v-2h2zm-6-2h-2v-2h2zm-2-2H8V8h4zm8-1h-4V7h4zM5 8H3V6h2zm17-1h-2V5h2zM12 6h-2V4h2zm-2-2H8V2h2zm7 0h-2V2h2z"/>'},pause:{body:'<path fill="currentColor" d="M10 20H4V4h6zm8-16v16h-6V4zm-4 2v12h2V6zM6 18h2V6H6z"/>'},"pause-solid":{body:'<path fill="currentColor" d="M10 20H4V4h6zm8-16v16h-6V4z"/>'},"pc-case":{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h16v2H4zM6 4h2v16H6zM2 4h2v16H2zm18 0h2v16h-2zM10 6h8v2h-8zm0 4h2v2h-2z"/>'},"pc-case-sharp":{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h16v2H4zM6 4h2v16H6zM2 2h2v20H2zm18 0h2v20h-2zM10 6h8v2h-8zm0 4h2v2h-2z"/>'},"pen-square":{body:'<path fill="currentColor" d="M5 3h6v2H5zM3 5h2v14H3zm16 8h2v6h-2zM5 19h14v2H5zm3-9h2v6H8zm2 4h4v2h-4zm0-6h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2h-2zm-4 0h2v2h-2z"/>'},"pen-square-sharp":{body:'<path fill="currentColor" d="M5 3h6v2H5zM3 3h2v18H3zm16 10h2v6h-2zM5 19h16v2H5zm3-9h2v6H8zm2 4h4v2h-4zm0-6h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2h-2zm-4 0h2v2h-2z"/>'},pencil:{body:'<path fill="currentColor" d="M4 16h2v2h2v2h2v2H2v-8h2zm8 4h-2v-2h2zm2-2h-2v-2h2zm-4-2H8v-2h2zm6 0h-2v-2h2zM6 14H4v-2h2zm6 0h-2v-2h2zm6 0h-2v-2h2zM8 12H6v-2h2zm6 0h-2v-2h2zm6 0h-2v-2h2zm-10-2H8V8h2zm8 0h-2V8h2zm4 0h-2V8h2zM12 8h-2V6h2zm4 0h-2V6h2zm4 0h-2V6h2zm-6-2h-2V4h2zm4 0h-2V4h2zm-2-2h-2V2h2z"/>'},percent:{body:'<path fill="currentColor" d="M6 20H4v-2h2zm12 0h-4v-2h4zM8 18H6v-2h2zm6 0h-2v-4h2zm6 0h-2v-4h2zm-10-2H8v-2h2zm2-2h-2v-2h2zm6 0h-4v-2h4zm-8-2H6v-2h4zm4 0h-2v-2h2zm-8-2H4V6h2zm6 0h-2V6h2zm4 0h-2V8h2zm2-2h-2V6h2zm-8-2H6V4h4zm10 0h-2V4h2z"/>'},phone:{body:'<path fill="currentColor" d="M4 1h5v2H4zm5 2h2v4H9zM7 7h2v4H7zm-3 5h2v2H4zM2 3h2v9H2zm7 8h2v2H9zm2 2h2v2h-2zm2 2h4v2h-4zm4-2h4v2h-4zm4 2h2v5h-2zM6 14h2v2H6zm2 2h2v2H8zm2 2h2v2h-2zm2 2h9v2h-9z"/>'},"phone-call":{body:'<path fill="currentColor" d="M4 1h5v2H4zm5 2h2v4H9zM7 7h2v4H7zm-3 5h2v2H4zM2 3h2v9H2zm7 8h2v2H9zm2 2h2v2h-2zm2 2h4v2h-4zm4-2h4v2h-4zm4 2h2v5h-2zM6 14h2v2H6zm2 2h2v2H8zm2 2h2v2h-2zm2 2h9v2h-9zm1-18h5v2h-5zm7 4h2v5h-2zm-2-2h2v2h-2zm-5 2h3v2h-3zm3 2h2v3h-2z"/>'},"phone-call-sharp":{body:'<path fill="currentColor" d="M2 1h9v2H2zm7 2h2v6H9zM7 7h2v4H7zm-3 5h2v2H4zM2 3h2v9H2zm7 8h2v2H9zm2 2h2v2h-2zm2 2h4v2h-4zm2-2h6v2h-6zm6 0h2v9h-2zM6 14h2v2H6zm2 2h2v2H8zm2 2h2v2h-2zm2 2h9v2h-9zm1-18h5v2h-5zm7 4h2v5h-2zm-2-2h2v2h-2zm-5 2h3v2h-3zm3 2h2v3h-2z"/>'},"phone-outgoing":{body:'<g fill="currentColor"><path d="M4 1h5v2H4zm5 2h2v4H9zM7 7h2v4H7zm-3 5h2v2H4zM2 3h2v9H2zm7 8h2v2H9zm2 2h2v2h-2zm2 2h4v2h-4zm4-2h4v2h-4zm4 2h2v5h-2zM6 14h2v2H6zm2 2h2v2H8zm2 2h2v2h-2zm2 2h9v2h-9zm9-9h-2V3h2z"/><path d="M21 5h-8V3h8zm-2 2h-2V5h2zm-2 2h-2V7h2zm-2 2h-2V9h2z"/></g>'},"phone-outgoing-sharp":{body:'<g fill="currentColor"><path d="M21 11h-2V3h2z"/><path d="M21 5h-8V3h8zm-2 2h-2V5h2zm-2 2h-2V7h2zm-2 2h-2V9h2zM2 1h9v2H2zm7 2h2v6H9zM7 7h2v4H7zm-3 5h2v2H4zM2 3h2v9H2zm7 8h2v2H9zm2 2h2v2h-2zm2 2h4v2h-4zm2-2h6v2h-6zm6 0h2v9h-2zM6 14h2v2H6zm2 2h2v2H8zm2 2h2v2h-2zm2 2h9v2h-9z"/></g>'},"phone-sharp":{body:'<path fill="currentColor" d="M2 1h9v2H2zm7 2h2v6H9zM7 7h2v4H7zm-3 5h2v2H4zM2 3h2v9H2zm7 8h2v2H9zm2 2h2v2h-2zm2 2h4v2h-4zm2-2h6v2h-6zm6 0h2v9h-2zM6 14h2v2H6zm2 2h2v2H8zm2 2h2v2h-2zm2 2h9v2h-9z"/>'},pi:{body:'<path fill="currentColor" d="M8 6h2v15H8zm6 0h2v13h-2zm2 13h4v2h-4zM6 4h14v2H6zM4 6h2v4H4z"/>'},"pi-circle":{body:'<g fill="currentColor"><path d="M2 6h2v12H2zm4 14h12v2H6zM20 6h2v12h-2zM6 2h12v2H6zM4 4h2v2H4zm0 14h2v2H4zm14 0h2v2h-2zm0-14h2v2h-2zM6 9h2v2H6zm2-2h10v2H8z"/><path d="M10 7h2v10h-2zm3 0h2v8h-2zm2 8h2v2h-2z"/></g>'},"picture-in-picture":{body:'<path fill="currentColor" d="M4 4h16v2H4zM2 6h2v12H2zm2 12h16v2H4zM20 6h2v12h-2zm-8 2h6v2h-6zm4 2h2v4h-2zm-6 2h6v2h-6zm0-4h2v4h-2z"/>'},"picture-in-picture-alt":{body:'<path fill="currentColor" d="M2 4h20v16H2zm2 2v12h16V6zm6 4h8v6h-8zm2 2v2h4v-2z"/>',hidden:!0},"picture-in-picture-sharp":{body:'<path fill="currentColor" d="M2 4h20v2H2zm0 2h2v12H2zm0 12h20v2H2zM20 6h2v12h-2zm-8 2h6v2h-6zm4 2h2v4h-2zm-6 2h6v2h-6zm0-4h2v4h-2z"/>'},pin:{body:'<path fill="currentColor" d="M7 2h10v2H7zM5 6V4h2v2zm0 8H3V6h2zm2 2H5v-2h2zm2 2H7v-2h2zm2 2H9v-2h2zm2 0v2h-2v-2zm2-2v2h-2v-2zm2-2v2h-2v-2zm2-2v2h-2v-2zm0-8h2v8h-2zm0 0V4h-2v2zm-5 2h-4v4h4z"/>',hidden:!0},pipette:{body:'<g fill="currentColor"><path d="M3 15h2v4H3zm2 4h4v2H5zm0-6h2v2H5zm4 4h2v2H9zm-2-6h2v2H7zm4 4h2v2h-2zM9 9h2v2H9zm4 4h2v2h-2zm-2-6h2v2h-2zM9 5h2v2H9zm2-2h2v2h-2zm2 2h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2h-2zm2 2h2v2h-2zm-2 2h2v2h-2zm-4-4h2v2h-2zm2 2h2v2h-2zM1 19h2v4H1z"/><path d="M1 21h4v2H1z"/></g>'},pixelarticons:{body:'<path fill="currentColor" d="M7 13h2v2H7zm0-6h6v2H7zM4 2h16v2H4zm0 18h16v2H4zm-2 0V4h2v16zm18 0V4h2v16zM7 11h6v2H7zm4-2h2v2h-2zM7 9h2v2H7zm6 4h2v2h-2zm2-2h2v2h-2zm0 4h2v2h-2zm-4 0h2v2h-2z"/>'},play:{body:'<path fill="currentColor" d="M15 11h-2V9h2zm0 4h-2v-2h2zm-2 2h-2v-2h2zm0-8h-2V7h2zm-2-2H9V5h2zM9 21H7V3h2zm6-8h2v-2h-2zm-6 4h2v2H9z"/>'},playlist:{body:'<path fill="currentColor" d="M10 13h6V5h6v4h-4v10h-8zm2 2v2h4v-2zM2 17h6v2H2zm6-4H2v2h6zM2 9h12v2H2zm12-4H2v2h12z"/>',hidden:!0},plug:{body:'<path fill="currentColor" d="M16 18h-3v4h-2v-4H8v-2h8zm-8-2H6v-2h2zm10 0h-2v-2h2zm-8-9h4V2h2v5h5v2h-1v5h-2V9H6v5H4V9H3V7h5V2h2z"/>'},"plug-solid":{body:'<path fill="currentColor" d="M10 7h4V2h2v5h5v2h-1v5h-2v2h-2v2h-3v4h-2v-4H8v-2H6v-2H4V9H3V7h5V2h2z"/>'},plus:{body:'<path fill="currentColor" d="M13 11h7v2h-7v7h-2v-7H4v-2h7V4h2z"/>'},"plus-box":{body:'<g fill="currentColor"><path d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zM7 11h10v2H7z"/><path d="M11 17V7h2v10z"/></g>'},"plus-box-sharp":{body:'<g fill="currentColor"><path d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zM7 11h10v2H7z"/><path d="M11 17V7h2v10z"/></g>'},pnpm:{body:'<path fill="currentColor" d="M8 22H2v-6h6zm7 0H9v-6h6zm7 0h-6v-6h6zM4 20h2v-2H4zm7 0h2v-2h-2zm7 0h2v-2h-2zm-7-9v2h2v-2zm11 4h-6V9h6zm-4-2h2v-2h-2zM8 8H2V2h6zm7 0H9V2h6zm7 0h-6V2h6zM4 6h2V4H4zm7 0h2V4h-2zm7 0h2V4h-2zm-3 9H9V9h6z"/>'},"pnpm-solid":{body:'<path fill="currentColor" d="M8 22H2v-6h6zm7 0H9v-6h6zm7 0h-6v-6h6zm-7-7H9V9h6zm7 0h-6V9h6zM8 8H2V2h6zm7 0H9V2h6zm7 0h-6V2h6z"/>'},pointer:{body:'<path fill="currentColor" d="M17 9h2v3h-2zm-4-2h2v4h-2zM9 3h2v8H9zM5 3h2v10H5zm14 6h2v2h-2zm-4-2h2v2h-2zm-4 0h2v2h-2zM7 1h2v2H7zM3 11h2v2H3zm-2 2h2v2H1zm0 2h2v2H1zm2 2h2v2H3zm2 2h2v2H5zm2 2h12v2H7zm12-2h2v2h-2zm2-8h2v8h-2zM5 13h2v2H5zm2 2h2v2H7z"/>'},potion:{body:'<path fill="currentColor" d="M8 6h8v2H8zm0-4h8v2H8zm0 6h2v2H8zm6 0h2v2h-2zM6 20h12v2H6zm-2-8h2v8H4zm14 0h2v8h-2zM6 10h2v2H6zm10 0h2v2h-2zM6 4h2v2H6zm10 0h2v2h-2z"/>'},"potion-sharp":{body:'<path fill="currentColor" d="M8 6h8v2H8zm0-4h8v2H8zm0 6h2v2H8zm6 0h2v2h-2zM4 20h16v2H4zm0-8h2v8H4zm14 0h2v8h-2zM6 10h2v2H6zm10 0h2v2h-2zM6 2h2v6H6zm10 0h2v6h-2z"/>'},pound:{body:'<path fill="currentColor" d="M8 20H6v-2h2zm10 0h-8v-2h8zm-8-8h5v2h-5v4H8v-4H6v-2h2V6h2zm8-4h-2V6h2zm-2-2h-6V4h6z"/>'},power:{body:'<path fill="currentColor" d="M6 20h12v2H6zM18 6h2v2h-2zM4 6h2v2H4zm2-2h2v2H6zm10 0h2v2h-2zM4 18h2v2H4zm14 0h2v2h-2zM2 8h2v10H2zm18 0h2v10h-2zm-9-6h2v9h-2z"/>'},"power-off":{body:'<path fill="currentColor" d="M6 20h10v2H6zM18 6h2v2h-2zm-2-2h2v2h-2zM4 18h2v2H4zm14 0h2v2h-2zM2 8h2v10H2zm18 0h2v8h-2zm-9-6h2v6h-2zm9 18h2v2h-2zm-4-4h2v2h-2zm-2-2h2v2h-2zm-2-2h2v2h-2zm-2-2h2v2h-2zM8 8h2v2H8zM6 6h2v2H6zM4 4h2v2H4zM2 2h2v2H2z"/>'},presentation:{body:'<path fill="currentColor" d="M1 3h22v2H1zm1 2h2v11H2zm2 11h16v2H4zM20 5h2v11h-2zM9 18h2v2H9zm-2 2h2v2H7zm6-2h2v2h-2zm2 2h2v2h-2z"/>'},"presentation-sharp":{body:'<path fill="currentColor" d="M1 3h22v2H1zm1 2h2v11H2zm0 11h20v2H2zM20 5h2v11h-2zM9 18h2v2H9zm-2 2h2v2H7zm6-2h2v2h-2zm2 2h2v2h-2z"/>'},prev:{body:'<path fill="currentColor" d="M6 4h2v16H6zm12 0h-2v2h-2v3h-2v2h-2v2h2v3h2v2h2v2h2z"/>',hidden:!0},print:{body:'<path fill="currentColor" d="M6 2h12v6h4v10h-4v4H6v-4H2V8h4zm2 6h8V4H8zm-2 8v-4h12v4h2v-6H4v6zm2-2v6h8v-6z"/>',hidden:!0},printer:{body:'<g fill="currentColor"><path d="M6 4h2v4H6zm2-2h8v2H8zm8 2h2v4h-2z"/><path d="M4 6h16v2H4zM2 8h2v10H2zm2 10h2v2H4zm2-4h12v2H6z"/><path d="M6 14h2v8H6zm2 6h8v2H8zm8-6h2v8h-2zm2 4h2v2h-2zm2-10h2v10h-2zm-4 2h2v2h-2zm-4 0h2v2h-2z"/></g>'},"printer-minimal-sharp":{body:'<path fill="currentColor" d="M6 2h12v2H6zM4 8h16v2H4zm2-4h2v4H6zM2 8h2v8H2zm14-4h2v4h-2zM2 16h4v2H2zm4-2h2v6H6zm10 0h2v6h-2zM6 12h12v2H6zm0 8h12v2H6zm12-4h4v2h-4zm2-8h2v8h-2z"/>'},projector:{body:'<path fill="currentColor" d="M7 9h4v2H7zm-2 2h2v4H5zm2 4h4v2H7zm4-4h2v4h-2zm-8 0h2v2H3zm-2 2h2v6H1zm2 6h18v2H3zm18-6h2v6h-2zm-8-2h8v2h-8zM8 2h2v5H8zm4 4h2v2h-2zm2-2h2v2h-2zM4 6h2v2H4zM2 4h2v2H2zm13 11h4v2h-4z"/>'},proportions:{body:'<path fill="currentColor" d="M4 4h16v2H4zM2 6h2v12H2zm2 12h16v2H4zM20 6h2v12h-2zM4 10h12v2H4zm12 2h2v6h-2zm-5 0h2v6h-2z"/>'},"proportions-sharp":{body:'<path fill="currentColor" d="M2 4h20v2H2zm0 2h2v12H2zm0 12h20v2H2zM20 6h2v12h-2zM4 10h14v2H4zm12 2h2v6h-2zm-5 0h2v6h-2z"/>'},"qr-code":{body:'<path fill="currentColor" d="M7 22H4v-2h3zm6 0h-2v-3h2zm4 0h-2v-5h2zm5 0h-2v-2h2zM4 20H2v-3h2zm5 0H7v-3h2zm-2-3H4v-2h3zm6 0h-2v-2h2zm9 0h-5v-2h5zM4 13H2v-2h2zm7 0H6v-2h5zm7 0h-3v-2h3zm4 0h-2v-2h2zm-9-2h-2V6h2zM7 9H4V7h3zm13 0h-3V7h3zM4 7H2V4h2zm5 0H7V4h2zm8 0h-2V4h2zm5 0h-2V4h2zM7 4H4V2h3zm6 0h-2V2h2zm7 0h-3V2h3z"/>'},"qr-code-solid":{body:'<path fill="currentColor" d="M7 17h2v3H7v2H4v-2H2v-3h2v-2h3zm6 5h-2v-3h2zm4 0h-2v-5h2zm5 0h-2v-2h2zm-9-5h-2v-2h2zm9 0h-5v-2h5zM4 13H2v-2h2zm7 0H6v-2h5zm7 0h-3v-2h3zm4 0h-2v-2h2zm-9-2h-2V6h2zM7 4h2v3H7v2H4V7H2V4h2V2h3zm13 0h2v3h-2v2h-3V7h-2V4h2V2h3zm-7 0h-2V2h2z"/>'},"quote-text-inline":{body:'<path fill="currentColor" d="M2 8h4v4H2zm6 0h4v4H8zM2 6h2v2H2zm6 0h2v2H8zM4 4h2v2H4zm6 0h2v2h-2zm4 2h8v2h-8zm0 4h8v2h-8zM2 14h20v2H2zm0 4h20v2H2z"/>'},radio:{body:'<path fill="currentColor" d="M11 9h2v2h-2zm0 4h2v2h-2zm-2-2h2v2H9zm4 0h2v2h-2zm6-2h-2v6h2zM5 9h2v6H5zm18-2h-2v10h2zM1 7h2v10H1zm16 0h-2v2h2zM7 7h2v2H7zm14-2h-2v2h2zM3 5h2v2H3zm14 10h-2v2h2zM7 15h2v2H7zm14 2h-2v2h2zM3 17h2v2H3z"/>'},"radio-handheld":{body:'<path fill="currentColor" d="M9 2v5h8v15H7V2zm0 7v4h6V9zm6 6H9v5h6z"/>',hidden:!0},"radio-on":{body:'<path fill="currentColor" d="M17 3H7v2H5v2H3v10h2v2h2v2h10v-2h2v-2h2V7h-2V5h-2zm0 2v2h2v10h-2v2H7v-2H5V7h2V5zm-9 6h2v2h2v2h-2v-2H8zm8-2h-2v2h-2v2h2v-2h2z"/>',hidden:!0},"radio-signal":{body:'<path fill="currentColor" d="M19 2h2v2h-2zm2 14V4h2v12zm0 0v2h-2v-2zM1 4h2v12H1zm2 12h2v2H3zM3 4h2V2H3zm2 2h2v8H5zm2 8h2v2H7zm0-8h2V4H7zm10 0h2v8h-2zm0 0h-2V4h2zm0 8v2h-2v-2zm-6-7h4v6h-2v9h-2v-9H9V7zm0 4h2V9h-2z"/>',hidden:!0},"radio-tower":{body:'<path fill="currentColor" d="M22 2h-2v2h2v12h-2v2h2v-2h2V4h-2zM2 4H0v12h2v2h2v-2H2zm0 0V2h2v2zm4 2H4v8h2zm0 0V4h2v2zm4 0h4v2h-4zm0 6H8V8h2zm4 0h-4v2H8v4H6v4h2v-4h2v-4h4v4h2v4h2v-4h-2v-4h-2zm0 0h2V8h-2zm6-6h-2V4h-2v2h2v8h2z"/>',hidden:!0},radius:{body:'<path fill="currentColor" d="M2 6h2v12H2zm4 14h8v2H6zM20 6h2v8h-2zM6 2h12v2H6zM4 4h2v2H4zm0 14h2v2H4zM18 4h2v2h-2zm-8 6h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm2 6h6v2h-6zm0-4h6v2h-6zm0 2h2v2h-2zm4 0h2v2h-2z"/>'},ratio:{body:'<g fill="currentColor"><path d="M4 6h16v2H4z"/><path d="M6 20V4h2v16zM2 8h2v8H2zm6 14v-2h8v2z"/><path d="M4 16h16v2H4z"/><path d="M16 20V4h2v16zm4-12h2v8h-2zM8 4V2h8v2z"/></g>'},react:{body:'<path fill="currentColor" d="M8 22H4v-2h4zm12 0h-4v-2h4zM4 20H2v-4h2zm6 0H8v-2h2zm6 0h-2v-2h2zm6 0h-2v-4h2zm-8-2h-4v-2h4zm-8-2H4v-2h2zm4 0H8v-2h2zm6 0h-2v-2h2zm4 0h-2v-2h2zM4 14H2v-4h2zm4 0H6v-4h2zm6 0h-4v-4h4zm4 0h-2v-4h2zm4 0h-2v-4h2zM6 10H4V8h2zm4 0H8V8h2zm6 0h-2V8h2zm4 0h-2V8h2zM4 8H2V4h2zm10 0h-4V6h4zm8 0h-2V4h2zM10 6H8V4h2zm6 0h-2V4h2zM8 4H4V2h4zm12 0h-4V2h4z"/>'},"react-solid":{body:'<path fill="currentColor" d="M8 22H4v-2h4zm12 0h-4v-2h4zM4 20H2v-4h2zm6 0H8v-2h2zm6 0h-2v-2h2zm6 0h-2v-4h2zM10 10v4h4v-4zm-4 6H4v-2h2zm14 0h-2v-2h2zM4 14H2v-4h2zm18 0h-2v-4h2zM6 10H4V8h2zm14 0h-2V8h2zM4 8H2V4h2zm18 0h-2V4h2zM10 6H8V4h2zm6 0h-2V4h2zM8 4H4V2h4zm12 0h-4V2h4zm-2 6v4h-2v2h-2v2h-4v-2H8v-2H6v-4h2V8h2V6h4v2h2v2z"/>'},receipt:{body:'<path fill="currentColor" d="M3 2h2v18H3zm16 0h2v18h-2zM5 4h2v2H5zm4 0h2v2H9zM5 20h14v2H5zm8-16h2v2h-2zM7 2h2v2H7zm4 0h2v2h-2zm4 0h2v2h-2zm2 2h2v2h-2zM7 8h10v2H7zm0 4h10v2H7zm0 4h4v2H7z"/>'},"receipt-sharp":{body:'<path fill="currentColor" d="M3 2h2v18H3zm16 0h2v18h-2zM5 4h2v2H5zm4 0h2v2H9zM3 20h18v2H3zM13 4h2v2h-2zM7 2h2v2H7zm4 0h2v2h-2zm4 0h2v2h-2zm2 2h2v2h-2zM7 8h10v2H7zm0 4h10v2H7zm0 4h4v2H7z"/>'},reciept:{body:'<path fill="currentColor" d="M3 2h2v2h2v2H5v14h14V6h-2V4h2V2h2v20H3zm12 2V2h2v2zm-2 0h2v2h-2zm-2 0V2h2v2zM9 4h2v2H9zm0 0V2H7v2zm8 4H7v2h10zM7 12h10v2H7zm10 6v-2h-4v2z"/>',hidden:!0},"reciept-alt":{body:'<path fill="currentColor" d="M5 2H3v20h2v-2h2v2h2v-2h2v2h2v-2h2v2h2v-2h2v2h2V2h-2v2h-2V2h-2v2h-2V2h-2v2H9V2H7v2H5zm2 2h2v2h2V4h2v2h2V4h2v2h2v12h-2v2h-2v-2h-2v2h-2v-2H9v2H7v-2H5V6h2zm0 4h10v2H7zm10 4H7v2h10z"/>',hidden:!0},recycle:{body:'<g fill="currentColor"><path d="M10 17h2v2h-2zm2-2h2v6h-2zm2-2h2v10h-2zm2 4h4v2h-4zm4-3h2v3h-2zm-2-2h2v2h-2zM4 8h6v2H4zm4 2h2v4H8zm-2 0h2v2H6zm-2 2h2v2H4zm-2 2h2v3H2zm2 3h4v2H4zm9-9h6v2h-6z"/><path d="M17 4h2v6h-2zm-2 2h2v2h-2zm-2-3h2v3h-2zM8 3h2v3H8zm2-2h3v2h-3z"/></g>'},redo:{body:'<g fill="currentColor"><path d="M20 8H6v2h14zM4 10h2v8H4zm2 8h6v2H6z"/><path d="M18 6h-2v6h2zm-2-2h-2v8h2zm0 8h-2v2h2z"/></g>'},"redo-sharp":{body:'<g fill="currentColor"><path d="M20 8H6v2h14zM4 8h2v12H4zm2 10h6v2H6z"/><path d="M18 6h-2v6h2zm-2-2h-2v8h2zm0 8h-2v2h2z"/></g>'},refresh:{body:'<path fill="currentColor" d="M13 20H9v-2h4zm6-4h2v2h-2v2h-2v-2h-2v-2h2V8h2zM9 18H7v-2h2zM7 6h2v2H7v8H5V8H3V6h2V4h2zm8 10h-2v-2h2zm8 0h-2v-2h2zM3 10H1V8h2zm8 0H9V8h2zm6-2h-2V6h2zm-2-2h-4V4h4z"/>'},"refresh-glyph":{body:'<path fill="currentColor" d="M19 14h4v2h-2v2h-2v2h-2v-2h-2v-2h-2v-2h4V8h-4V6h6zM7 6h2v2h2v2H7v6h4v2H5v-8H1V8h2V6h2V4h2z"/>'},"refresh-sharp":{body:'<path fill="currentColor" d="M19 16h2v2h-2v2h-2v-2h-2v-2h2V8h-4V6h6zM7 6h2v2H7v8h4v2H5V8H3V6h2V4h2zm8 10h-2v-2h2zm8 0h-2v-2h2zM3 10H1V8h2zm8 0H9V8h2z"/>'},"refresh-solid":{body:'<path fill="currentColor" d="M13 20H9v-2h4zm6-6h4v2h-2v2h-2v2h-2v-2h-2v-2h-2v-2h4V8h2zM9 18H7v-2h2zM7 6h2v2h2v2H7v6H5v-6H1V8h2V6h2V4h2zm10 2h-2V6h2zm-2-2h-4V4h4z"/>'},reload:{body:'<g fill="currentColor"><path d="M16 4h2v6h-2zm-2-2h2v2h-2zm0 2h2v8h-2zM4 8H2v5h2z"/><path d="M4 6h16v2H4zm4 14H6v-6h2zm2 2H8v-2h2zm0-2H8v-8h2zm10-4h2v-5h-2z"/><path d="M20 18H4v-2h16z"/></g>'},"reload-sharp":{body:'<g fill="currentColor"><path d="M16 4h2v6h-2zm-2-2h2v2h-2zm0 2h2v8h-2zM4 8H2v5h2z"/><path d="M2 6h18v2H2zm6 14H6v-6h2zm2 2H8v-2h2zm0-2H8v-8h2zm10-4h2v-5h-2z"/><path d="M22 18H4v-2h18z"/></g>'},"remove-box":{body:'<path fill="currentColor" d="M5 3H3v18h18V3zm14 2v14H5V5zm-3 6H8v2h8z"/>',hidden:!0},"remove-box-multiple":{body:'<path fill="currentColor" d="M5 3H3v14h14V3zm10 2v10H5V5zm4 2v12H7v2h14V7zm-6 2H7v2h6z"/>',hidden:!0},repeat:{body:'<g fill="currentColor"><path d="M17 5h2v2h-2zM5 17h2v2H5zm6-14h2v6h-2zM9 1h2v8H9zm0 8h2v2H9zm10 8H9v2h10zM5 7H3v10h2z"/><path d="M13 15h-2v6h2zm2-2h-2v8h2zm0 8h-2v2h2zM5 5h10v2H5zm14 12h2V7h-2z"/></g>'},"repeat-1":{body:'<path fill="currentColor" d="M19 19h-4v4h-2v-2h-2v-2H9v-2h10zM7 19H5v-2h2zm-2-2H3V7h2zm16 0h-2V7h2zm-8-8v4h2v2H9v-2h2v-2H9V9zm-2-6h2v2h2v2H5V5h4V1h2zm8 4h-2V5h2z"/>'},"repeat-1-sharp":{body:'<path fill="currentColor" d="M21 19h-6v4h-2v-2h-2v-2H9v-2h10V7h-2V5h4zM11 3h2v2h2v2H5v10h2v2H3V5h6V1h2zm2 6v4h2v2H9v-2h2v-2H9V9z"/>'},"repeat-sharp":{body:'<g fill="currentColor"><path d="M17 5h2v2h-2zM5 17h2v2H5zm6-14h2v6h-2zM9 1h2v8H9zm0 8h2v2H9zm10 8H9v2h10zM5 5H3v14h2z"/><path d="M13 15h-2v6h2zm2-2h-2v8h2zm0 8h-2v2h2zM5 5h10v2H5zm14 14h2V5h-2z"/></g>'},reply:{body:'<path fill="currentColor" d="M12 19h-2v-2H8v-2H6v-2H4v-2h2V9h2V7h2V5h2v4h8v6h-8z"/>',hidden:!0},"reply-all":{body:'<path fill="currentColor" d="M13 19h2v-4h7V9h-7V5h-2v2h-2v2H9v2H7v2h2v2h2v2h2zM8 7H6v2H4v2H2v2h2v2h2v2h2v2h2v-2H8v-2H6v-2H4v-2h2V9h2zm0 0h2V5H8z"/>',hidden:!0},"road-sign":{body:'<g fill="currentColor"><path d="M2 10h2v2H2zm0 4h2v-2H2zm20-4h-2v2h2zm0 4h-2v-2h2zM4 8h2v2H4zm0 8h2v-2H4zm16-8h-2v2h2zm0 8h-2v-2h2zM6 6h2v2H6zm0 12h2v-2H6zM18 6h-2v2h2zm0 12h-2v-2h2zM8 4h2v2H8zm0 16h2v-2H8zm8-16h-2v2h2zm0 16h-2v-2h2zM10 2h2v2h-2zm0 20h2v-2h-2zm4-20h-2v2h2zm0 20h-2v-2h2zm2-11h2v2h-2zm-2-2h2v6h-2zm-2-2h2v10h-2zm-4 4h2v4H8z"/><path d="M10 11h3v2h-3z"/></g>'},robot:{body:'<path fill="currentColor" d="M5 7h14v2H5zm0 12h14v2H5zM3 9h2v10H3zm16 0h2v10h-2zM1 13h2v2H1zm20 0h2v2h-2zM11 5h2v2h-2zM7 3h4v2H7zm1 9h2v4H8zm6 0h2v4h-2z"/>'},"robot-face":{body:'<g fill="currentColor"><path d="M4 6h16v2H4zm0 14h16v2H4zM2 8h2v12H2zm18 0h2v12h-2z"/><path d="M11 4h2v4h-2zm-3 6h2v2H8zm6 0h4v2h-4zm-1-8h4v2h-4zM0 12h2v2H0zm22 0h2v2h-2zm-12 4h4v2h-4zm-2-2h2v2H8zm6 0h2v2h-2z"/></g>'},"robot-face-happy":{body:'<g fill="currentColor"><path d="M4 6h16v2H4zm0 14h16v2H4zM2 8h2v12H2zm18 0h2v12h-2z"/><path d="M11 4h2v4h-2zm-3 6h2v2H8zm6 0h2v2h-2zm-1-8h4v2h-4zM0 12h2v2H0zm22 0h2v2h-2zM7 14h10v2H7zm2 2h6v2H9z"/></g>'},"robot-face-happy-sharp":{body:'<path fill="currentColor" d="M2 6h20v2H2zm0 14h20v2H2zM2 8h2v12H2zm18 0h2v12h-2zm-9-6h2v4h-2zm-3 8h2v2H8zm6 0h2v2h-2zm-1-8h4v2h-4zM0 12h2v2H0zm22 0h2v2h-2zM7 14h10v2H7zm2 2h6v2H9z"/>'},"robot-face-sad":{body:'<g fill="currentColor"><path d="M4 6h16v2H4zm0 14h16v2H4zM2 8h2v12H2zm18 0h2v12h-2z"/><path d="M11 4h2v4h-2zM8 18h2v-2H8zm6 0h2v-2h-2zm-4-2h4v-2h-4zm-2-6h2v2H8zm6 0h2v2h-2zm-1-8h4v2h-4zM0 12h2v2H0zm22 0h2v2h-2z"/></g>'},"robot-face-sad-sharp":{body:'<path fill="currentColor" d="M2 6h20v2H2zm0 14h20v2H2zM2 8h2v12H2zm18 0h2v12h-2zm-9-6h2v4h-2zM8 18h2v-2H8zm6 0h2v-2h-2zm-4-2h4v-2h-4zm-2-6h2v2H8zm6 0h2v2h-2zm-1-8h4v2h-4zM0 12h2v2H0zm22 0h2v2h-2z"/>'},"robot-face-sharp":{body:'<path fill="currentColor" d="M2 6h20v2H2zm0 14h20v2H2zM2 8h2v12H2zm18 0h2v12h-2zm-9-6h2v4h-2zm-3 8h2v2H8zm6 0h4v2h-4zm-1-8h4v2h-4zM0 12h2v2H0zm22 0h2v2h-2zm-12 4h4v2h-4zm-2-2h2v2H8zm6 0h2v2h-2z"/>'},"robot-sharp":{body:'<path fill="currentColor" d="M3 7h18v2H3zm0 12h18v2H3zM3 9h2v10H3zm16 0h2v10h-2zM1 13h2v2H1zm20 0h2v2h-2zM11 5h2v2h-2zM7 3h4v2H7zm1 9h2v4H8zm6 0h2v4h-2z"/>'},"rounded-corner":{body:'<path fill="currentColor" d="M3 3h2v2H3zm0 4h2v2H3zm2 4H3v2h2zm-2 4h2v2H3zm2 4H3v2h2zm2 0h2v2H7zm6 0h-2v2h2zm2 0h2v2h-2zm6 0h-2v2h2zm-2-4h2v2h-2zM17 5h-2V3h-4v2h4v2h2v2h2v4h2V9h-2V7h-2zM7 3h2v2H7z"/>',hidden:!0},rss:{body:'<path fill="currentColor" d="M4 10h6v2H4zm8 4h2v6h-2zm6 0h2v6h-2zM4 16h4v4H4zm12-6h2v4h-2zm-2-2h2v2h-2zM4 4h6v2H4zm6 2h4v2h-4zm0 6h2v2h-2z"/>'},"rss-circle":{body:'<path fill="currentColor" d="M6 2h12v2H6zm0 18h12v2H6zM20 6h2v12h-2zM2 6h2v12H2zm5 9h2v2H7zm0-4h4v2H7zm0-4h6v2H7zm4 6h2v4h-2zm4-2h2v6h-2zm-2-2h2v2h-2zm-9 9h2v2H4zM4 4h2v2H4zm14 0h2v2h-2zm0 14h2v2h-2z"/>'},"rss-square":{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h16v2H4zM20 4h2v16h-2zM2 4h2v16H2zm5 11h2v2H7zm0-4h4v2H7zm0-4h6v2H7zm4 6h2v4h-2zm4-2h2v6h-2zm-2-2h2v2h-2z"/>'},"rss-square-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 18h20v2H2zM20 4h2v16h-2zM2 4h2v16H2zm5 11h2v2H7zm0-4h4v2H7zm0-4h6v2H7zm4 6h2v4h-2zm4-2h2v6h-2zm-2-2h2v2h-2z"/>'},rubel:{body:'<path fill="currentColor" d="M17 6H9v5h8v2H9v2h6v2H9v3H7v-3H5v-2h2v-2H5v-2h2V4h10zm2 5h-2V6h2z"/>'},save:{body:'<path fill="currentColor" d="M20 22H4v-2h2v-6h2v6h8v-6h2v6h2zM4 20H2V4h2zm18 0h-2V6h2zm-6-6H8v-2h8zm-4-4H6V6h6zm8-4h-2V4h2zm-2-2H4V2h14z"/>'},"save-sharp":{body:'<path fill="currentColor" d="M16 20v-6H8v6zm-4-10H6V6h6zm8-4h-2V4h2zm0 14V6h2v16H2V2h16v2H4v16h2v-8h12v8z"/>'},scale:{body:'<g fill="currentColor"><path d="M13 9h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2zm2-2h2v8h-2z"/><path d="M13 3h8v2h-8zm-2 12H9v-2h2zm-2 2H7v-2h2zm-2 2H5v-2h2zm-2 2H3v-8h2z"/><path d="M11 21H3v-2h8z"/></g>'},"scan-barcode":{body:'<path fill="currentColor" d="M16 2h4v2h-4zm4 2h2v4h-2zm0 12h2v4h-2zm-4 4h4v2h-4zM4 20h4v2H4zm-2-4h2v4H2zM2 4h2v4H2zm2-2h4v2H4zm3 6h2v8H7zm4 0h2v8h-2zm5 0h2v8h-2z"/>'},"scan-barcode-sharp":{body:'<path fill="currentColor" d="M16 2h6v2h-6zm4 2h2v4h-2zm0 12h2v4h-2zm-4 4h6v2h-6zM2 20h6v2H2zm0-4h2v4H2zM2 4h2v4H2zm0-2h6v2H2zm5 6h2v8H7zm4 0h2v8h-2zm5 0h2v8h-2z"/>'},scissors:{body:'<path fill="currentColor" d="M5 2h4v2H5zm0 12h4v2H5zm0-6h4v2H5zm0 12h4v2H5zM3 4h2v4H3zm0 12h2v4H3zM9 4h2v4H9zm0 12h2v4H9zm0-8h2v2H9zm2 2h2v2h-2zm-2 4h2v2H9zm2-2h2v2h-2zm2-2h2v2h-2zm2 4h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zM15 8h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2z"/>'},"scissors-sharp":{body:'<path fill="currentColor" d="M5 2h6v2H5zm0 12h4v2H5zm0-6h4v2H5zm0 12h6v2H5zM3 2h2v8H3zm0 12h2v8H3zM9 4h2v4H9zm0 12h2v4H9zm0-8h2v2H9zm2 2h2v2h-2zm-2 4h2v2H9zm2-2h2v2h-2zm2-2h2v2h-2zm2 4h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zM15 8h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2z"/>'},script:{body:'<path fill="currentColor" d="M16 19h2v2H4v-2h10v-2h2zM6 15h8v2H4v2H2v-4h2V5h2zM20 5h2v6h-2v8h-2V5H6V3h14z"/>'},"script-sharp":{body:'<path fill="currentColor" d="M2 17h2v4H2zM18 5h2v16h-2zM4 3h2v12H4zm10 12h2v4h-2zM4 19h14v2H4zm-2-4h12v2H2zM6 3h14v2H6zm14 2h2v6h-2z"/>'},"script-text":{body:'<path fill="currentColor" d="M6 3h14v2h2v6h-2v8h-2V5H6zm8 14v-2H6V5H4v10H2v4h2v2h14v-2h-2v-2zm0 0v2H4v-2zM8 7h8v2H8zm8 4H8v2h8z"/>',hidden:!0},"scroll-horizontal":{body:'<g fill="currentColor"><path d="M8 3v2H4V3zm0 16v2H4v-2zm6-16v2h-4V3zm0 16v2h-4v-2zm6-16v2h-4V3zm0 16v2h-4v-2zM18 9v6h2V9z"/><path d="M2 11v2h20v-2z"/><path d="M16 7v10h2V7zM6 9v6H4V9zm2-2v10H6V7z"/></g>'},"scroll-vertical":{body:'<g fill="currentColor"><path d="M21 8h-2V4h2zM5 8H3V4h2zm16 6h-2v-4h2zM5 14H3v-4h2zm16 6h-2v-4h2zM5 20H3v-4h2zm10-2H9v2h6z"/><path d="M13 2h-2v20h2z"/><path d="M17 16H7v2h10zM15 6H9V4h6zm2 2H7V6h10z"/></g>'},sd:{body:'<path fill="currentColor" d="M18 2h2v20H4V6h2v14h12V4H8V2zM8 4H6v2h2zm6 2h2v4h-2zm-2 0h-2v4h2z"/>',hidden:!0},search:{body:'<path fill="currentColor" d="M22 22h-2v-2h2zm-2-2h-2v-2h2zm-6-2H6v-2h8zm4 0h-2v-2h2zM6 16H4v-2h2zm10 0h-2v-2h2zM4 14H2V6h2zm14 0h-2V6h2zM6 6H4V4h2zm10 0h-2V4h2zm-2-2H6V2h8z"/>'},section:{body:'<path fill="currentColor" d="M5 21H3v-2h2zm4 0H7v-2h2zm4 0h-2v-2h2zm4 0h-2v-2h2zm4 0h-2v-2h2zM5 17H3v-2h2zm16 0h-2v-2h2zM5 13H3v-2h2zm16 0h-2v-2h2zM5 9H3V7h2zm16 0h-2V7h2zM5 5H3V3h2zm4 0H7V3h2zm4 0h-2V3h2zm4 0h-2V3h2zm4 0h-2V3h2z"/>'},"section-copy":{body:'<path fill="currentColor" d="M9 21H7v-2h2zm4 0h-2v-2h2zm4 0h-2v-2h2zm4 0h-2v-2h2zM5 17H3v-2h2zm4 0H7v-2h2zm12 0h-2v-2h2zM5 13H3v-2h2zm4 0H7v-2h2zm12 0h-2v-2h2zM5 9H3V7h2zm4 0H7V7h2zm4 0h-2V7h2zm4 0h-2V7h2zm4 0h-2V7h2zM5 5H3V3h2zm4 0H7V3h2zm4 0h-2V3h2zm4 0h-2V3h2z"/>'},"section-minus":{body:'<path fill="currentColor" d="M5 21H3v-2h2zm4 0H7v-2h2zm4 0h-2v-2h2zm8-2h-6v-2h6zM5 17H3v-2h2zm0-4H3v-2h2zm16 0h-2v-2h2zM5 9H3V7h2zm16 0h-2V7h2zM5 5H3V3h2zm4 0H7V3h2zm4 0h-2V3h2zm4 0h-2V3h2zm4 0h-2V3h2z"/>'},"section-plus":{body:'<path fill="currentColor" d="M5 21H3v-2h2zm4 0H7v-2h2zm4 0h-2v-2h2zm6-4h2v2h-2v2h-2v-2h-2v-2h2v-2h2zM5 17H3v-2h2zm0-4H3v-2h2zm16 0h-2v-2h2zM5 9H3V7h2zm16 0h-2V7h2zM5 5H3V3h2zm4 0H7V3h2zm4 0h-2V3h2zm4 0h-2V3h2zm4 0h-2V3h2z"/>'},"section-x":{body:'<path fill="currentColor" d="M5 21H3v-2h2zm4 0H7v-2h2zm4 0h-2v-2h2zm4 0h-2v-2h2zm4 0h-2v-2h2zm-2-2h-2v-2h2zM5 17H3v-2h2zm12 0h-2v-2h2zm4 0h-2v-2h2zM5 13H3v-2h2zm16 0h-2v-2h2zM5 9H3V7h2zm16 0h-2V7h2zM5 5H3V3h2zm4 0H7V3h2zm4 0h-2V3h2zm4 0h-2V3h2zm4 0h-2V3h2z"/>'},send:{body:'<path fill="currentColor" d="M4 19h4v2H2v-8h2zm8 0H8v-2h4zm4-2h-4v-2h4zm4-2h-4v-2h4zm-10-2H4v-2h6zm12 0h-2v-2h2zM8 5H4v6H2V3h6zm12 6h-4V9h4zm-4-2h-4V7h4zm-4-2H8V5h4z"/>'},server:{body:'<path fill="currentColor" d="M6 7h4v2H6zm0 8h4v2H6zM2 5h2v14H2zm18 0h2v14h-2zM4 19h16v2H4zM4 3h16v2H4zm0 8h16v2H4z"/>'},"server-sharp":{body:'<g fill="currentColor"><path d="M6 7h4v2H6zm0 8h4v2H6zM2 5h2v14H2zm18 0h2v14h-2zM2 19h20v2H2zM2 3h20v2H2z"/><path d="M2 11h20v2H2z"/></g>'},"settings-2":{body:'<g fill="currentColor"><path d="M4 14h2v6H4zm6 0h2v6h-2zm-4-2h4v2H6zm0 8h4v2H6zm-4-4h2v2H2zm20-8h-4V6h4z"/><path d="M10 16h12v2H10zm4-8H2V6h12zm6-4v2h-2V4zm0 6V8h-2v2zm-6-8h4v2h-4zm0 10h4v-2h-4zm-2-8h2v2h-2zm0 6h2V8h-2z"/></g>'},"settings-2-sharp":{body:'<g fill="currentColor"><path d="M4 14h2v6H4zm5 0h2v6H9zm-5-2h7v2H4zm0 8h7v2H4zm-2-4h2v2H2zm20-8h-4V6h4z"/><path d="M10 16h12v2H10zm5-8H2V6h13zm5-4v2h-2V4zm0 6V8h-2v2zm-7-8h7v2h-7zm0 10h7v-2h-7zm0-8h2v2h-2zm0 6h2V8h-2z"/></g>'},"settings-cog":{body:'<path fill="currentColor" d="M4 20h3v-2h4v4h2v-4h4v2h-2v4H9v-4H7v2H2v-5h2zm18 2h-5v-2h3v-3h2zM6 11H2v2h4v4H4v-2H0V9h4V7h2zm14-2h4v6h-4v2h-2v-4h4v-2h-4V7h2zm-6 7h-4v-2h4zm-4-2H8v-4h2zm6 0h-2v-4h2zm-2-4h-4V8h4zM7 4H4v3H2V2h5zm8 0h2V2h5v5h-2V4h-3v2h-4V2h-2v4H7V4h2V0h6z"/>'},"settings-cog-2":{body:'<g fill="currentColor"><path d="M18 2h2v2h-2zM4 2h2v2H4zm16 20h-2v-2h2zM4 22h2v-2H4zM20 4h2v2h-2zM6 4h4v2H6zm12 16h-4v-2h4zM6 20h4v-2H6zM18 6h2v4h-2zM4 6h2v4H4zm16 12h-2v-4h2zM4 18h2v-4H4zM14 4h4v2h-4zM2 4h2v2H2zm20 16h-2v-2h2zM2 20h2v-2H2z"/><path d="M8 2h2v4H8zm0 20h2v-4H8z"/><path d="M8 2h8v2H8zm0 20h8v-2H8zM2 8h2v8H2zm20 8h-2V8h2z"/><path d="M20 8h2v4h-2zM10 8h4v2h-4zm-2 2h2v4H8zm2 4h4v2h-4zm4-4h2v4h-2z"/></g>'},shapes:{body:'<path fill="currentColor" d="M2 13h9v2H2zm0 2h2v5H2zm0 5h9v2H2zm7-5h2v5H9zm6-2h5v2h-5zm-2 2h2v5h-2zm2 5h5v2h-5zm5-5h2v5h-2zM7 9h10v2H7zm0-2h2v2H7zm2-3h2v3H9zm2-2h2v2h-2zm2 2h2v3h-2zm2 3h2v2h-2z"/>'},share:{body:'<path fill="currentColor" d="M20 22H4v-2h16zM4 20H2v-6h2zm18 0h-2v-6h2zM13 4h2v2h2v2h-4v10h-2V8H7V6h2V4h2V2h2zM9 14H4v-2h5zm11 0h-5v-2h5z"/>'},"share-sharp":{body:'<path fill="currentColor" d="M9 14H4v6h16v-6h-5v-2h7v10H2V12h7zm4-10h2v2h2v2h-4v10h-2V8H7V6h2V4h2V2h2z"/>'},"sharp-corner":{body:'<path fill="currentColor" d="M3 3h2v2H3zm0 4h2v2H3zm2 4H3v2h2zm-2 4h2v2H3zm2 4H3v2h2zm2 0h2v2H7zm6 0h-2v2h2zm2 0h2v2h-2zm6 0h-2v2h2zm-2-4h2v2h-2zm2-2V3H11v2h8v8zM7 3h2v2H7z"/>',hidden:!0},shield:{body:'<path fill="currentColor" d="M4 2h16v2H4zM2 4h2v10H2zm18 0h2v10h-2zM4 14h2v2H4zm2 2h2v2H6zm4 4h4v2h-4zm10-6h-2v2h2zm-2 2h-2v2h2zm-2 2h-2v2h2zm-6 0H8v2h2z"/>'},"shield-off":{body:'<path fill="currentColor" d="M8 2h14v12h-2V4H8zM2 8h2v6H2zm2 6h2v2H4zm4 2H6v2h2v2h2v2h4v-2h-4v-2H8zm10 0h-2v2h2v2h2v2h2v-2h-2v-2h-2zM4 2H2v2h2v2h2v2h2v2h2v2h2v2h2v2h2v-2h-2v-2h-2v-2h-2V8H8V6H6V4H4z"/>',hidden:!0},"shield-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 2h2v10H2zm18 0h2v10h-2zM4 14h2v2H4zm2 2h2v2H6zm4 4h4v2h-4zm10-6h-2v2h2zm-2 2h-2v2h2zm-2 2h-2v2h2zm-6 0H8v2h2z"/>'},ship:{body:'<g fill="currentColor"><path d="M14 8h2v2h-2zm4 8h2v2h-2zM8 4h2v4H8z"/><path d="M6 6h8v2H6zm-4 4h20v2H2zm18 2h2v4h-2zM2 12h2v6H2zm4-4h2v2H6z"/><path d="M0 16h4v2H0zm4 2h4v2H4zm4-2h4v2H8zm4 2h4v2h-4zm4-2h4v2h-4zm4 2h4v2h-4z"/></g>'},shirt:{body:'<g fill="currentColor"><path d="M4 3h6v2H4zM2 3h2v8H2zm2 6h4v2H4z"/><path d="M6 9h2v10H6zm2 10h8v2H8zm8-10h2v10h-2z"/><path d="M16 9h4v2h-4zm4-6h2v8h-2zm-6 0h6v2h-6zm-4 2h4v2h-4z"/></g>'},"shirt-sharp":{body:'<g fill="currentColor"><path d="M4 3h6v2H4zM2 3h2v8H2zm2 6h4v2H4z"/><path d="M6 9h2v10H6zm0 10h12v2H6zM16 9h2v10h-2z"/><path d="M16 9h4v2h-4zm4-6h2v8h-2zm-6 0h6v2h-6zM8 5h8v2H8z"/></g>'},"shopping-bag":{body:'<g fill="currentColor"><path d="M3 6h18v2H3zm2 14h14v2H5zM3 8h2v12H3zm16 0h2v12h-2z"/><path d="M7 4h2v6H7zm2-2h6v2H9zm6 2h2v6h-2z"/></g>'},"shopping-bag-sharp":{body:'<g fill="currentColor"><path d="M3 6h18v2H3zm2 14h14v2H5zM3 8h2v12H3zm16 0h2v12h-2z"/><path d="M7 4h2v6H7zm2-2h6v2H9zm6 2h2v6h-2z"/></g>'},"shopping-cart":{body:'<path fill="currentColor" d="M2 2h2v2H2zm2 6h2v4H4zm2 4h2v4H6zm2 4h10v2H8zm10-4h2v4h-2zm2-4h2v4h-2zM4 6h18v2H4zm0-4h2v4H4zm2 17h3v3H6zm11 0h3v3h-3z"/>'},shuffle:{body:'<path fill="currentColor" d="M10 19H2v-2h8zm12 0h-8v-2h8zm-10-2h-2v-6h2zm6-10h2v2h2v2h-2v2h-2v2h-2v-4h-4V9h4V5h2zM8 11H2V9h6z"/>'},"shuffle-sharp":{body:'<path fill="currentColor" d="M18 7h2v2h2v2h-2v2h-2v2h-2v-4h-4v8H2v-2h8V9h6V5h2zm4 12h-8v-2h8zM8 11H2V9h6z"/>'},signal:{body:'<path fill="currentColor" d="M19 3h2v18h-2zm-4 4h2v14h-2zm-4 4h2v10h-2zm-4 4h2v6H7zm-4 4h2v2H3z"/>'},siren:{body:'<path fill="currentColor" d="M6 11h2v5H6zm2-2h2v2H8zm2-2h4v2h-4zm4 2h2v2h-2zm2 2h2v5h-2zM6 16h12v2H6zm-2 4h16v2H4zm0-2h2v2H4zm14 0h2v2h-2zm-7-6h2v4h-2zm9-1h3v2h-3zM1 11h3v2H1zm5-6h2v2H6zm10 0h2v2h-2zm2-2h2v2h-2zM4 3h2v2H4zm7-1h2v3h-2z"/>'},"siren-off":{body:'<path fill="currentColor" d="M6 11h2v5H6zm2-2h2v2H8zm2-2h4v2h-4zm4 2h2v2h-2zm2 2h2v5h-2zM6 16h12v2H6zm-2 4h16v2H4zm0-2h2v2H4zm14 0h2v2h-2zm-7-6h2v4h-2z"/>'},"siren-off-sharp":{body:'<path fill="currentColor" d="M6 11h2v5H6zm2-2h2v2H8zm2-2h4v2h-4zm4 2h2v2h-2zm2 2h2v5h-2zM6 16h12v2H6zm-2 4h16v2H4zm0-4h2v4H4zm14 0h2v4h-2zm-7-4h2v4h-2z"/>'},"siren-sharp":{body:'<path fill="currentColor" d="M6 11h2v5H6zm2-2h2v2H8zm2-2h4v2h-4zm4 2h2v2h-2zm2 2h2v5h-2zM6 16h12v2H6zm-2 4h16v2H4zm0-4h2v4H4zm14 0h2v4h-2zm-7-4h2v4h-2zm9-1h3v2h-3zM1 11h3v2H1zm5-6h2v2H6zm10 0h2v2h-2zm2-2h2v2h-2zM4 3h2v2H4zm7-1h2v3h-2z"/>'},skull:{body:'<g fill="currentColor"><path d="M7 20h2v2H7zm4 0h2v2h-2zm4 0h2v2h-2zm-6-4h2v4H9zm4 0h2v4h-2zm-8-2h2v6H5zm12 0h2v6h-2z"/><path d="M3 14h4v2H3zM1 4h2v10H1zm20 0h2v10h-2zM3 2h18v2H3zm14 12h4v2h-4zM8 7h2v4H8zm6 0h2v4h-2z"/></g>'},"skull-sharp":{body:'<g fill="currentColor"><path d="M5 20h14v2H5zm4-4h2v4H9zm4 0h2v4h-2zm-8-2h2v6H5zm12 0h2v6h-2z"/><path d="M3 14h4v2H3zM1 2h2v14H1zm20 0h2v14h-2zM3 2h18v2H3zm14 12h4v2h-4zM8 7h2v4H8zm6 0h2v4h-2z"/></g>'},slack:{body:'<path fill="currentColor" d="M17 24h-2v-2h2zm-6-9h1v6h-1v2H8v-2H7v-6h1v-2h3zm6 5h-2v2h-2v-4h4zm2 2h-2v-2h2zM9 21h1v-6H9zm-5-2H2v-2h2zm-2-2H0v-2h2zm4 0H4v-2H2v-2h4zm15-4h2v3h-2v1h-6v-1h-2v-3h2v-1h6zm-6 2h6v-1h-6zM9 8h2v3H9v1H3v-1H1V8h2V7h6zm7-5h1v6h-1v2h-3V9h-1V3h1V1h3zm4 6h2v2h-4V7h2zM3 9v1h6V9zm11 0h1V3h-1zm10 0h-2V7h2zm-2-2h-2V5h2zM11 6H7V4h2V2h2zM7 4H5V2h2zm2-2H7V0h2z"/>'},"slack-solid":{body:'<path fill="currentColor" d="M17 20h2v2h-2v2h-2v-2h-2v-4h4zm-6-5h1v6h-1v2H8v-2H7v-6h1v-2h3zm-5 2H4v2H2v-2H0v-2h2v-2h4zm15-4h2v3h-2v1h-6v-1h-2v-3h2v-1h6zM9 8h2v3H9v1H3v-1H1V8h2V7h6zm7-5h1v6h-1v2h-3V9h-1V3h1V1h3zm6 4h2v2h-2v2h-4V7h2V5h2zM9 2h2v4H7V4H5V2h2V0h2z"/>'},sliders:{body:'<path fill="currentColor" d="M8 14H7v6H5v-6H2v-2h6zm5 6h-2V10h2zm9-2h-3v2h-2v-2h-1v-2h6zm-3-4h-2V4h2zM7 10H5V4h2zm6-4h2v2H9V6h2V4h2z"/>'},"sliders-2":{body:'<path fill="currentColor" d="M4 4h6v3h12v2H10v3H4V9H2V7h2zm2 2v4h2V6zm8 6h6v3h2v2h-2v3h-6v-3H2v-2h12zm2 2v4h2v-4z"/>',hidden:!0},"sliders-horizontal":{body:'<path fill="currentColor" d="M17 18h5v2h-5v2h-2v-6h2zm-4 2H2v-2h11zm-4-5H7v-2H2v-2h5V9h2zm13-2H11v-2h11zm-7-9h7v2h-7v2h-2V2h2zm-4 2H2V4h9z"/>'},"sliders-vertical":{body:'<path fill="currentColor" d="M8 15H6v7H4v-7H2v-2h6zm5 7h-2V11h2zm9-5h-2v5h-2v-5h-2v-2h6zm-2-4h-2V2h2zM6 11H4V2h2zm9-2H9V7h2V2h2v5h2z"/>'},"smart-home":{body:'<path fill="currentColor" d="M4 20h16v2H4zm16-10h2v10h-2zM2 10h2v10H2zm2-2h2v2H4zm2-2h2v2H6zm2-2h2v2H8zm2-2h4v2h-4zm4 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm-9 8h6v2H9zm-2-2h2v2H7zm8 0h2v2h-2z"/>'},"smart-home-sharp":{body:'<path fill="currentColor" d="M2 20h20v2H2zm18-10h2v10h-2zM2 10h2v10H2zm2-2h2v2H4zm2-2h2v2H6zm2-2h2v2H8zm2-2h4v2h-4zm4 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm-9 8h6v2H9zm-2-2h2v2H7zm8 0h2v2h-2z"/>'},smartphone:{body:'<path fill="currentColor" d="M6 2h12v2H6zm0 18h12v2H6zM4 4h2v16H4zm14 0h2v16h-2zm-7 13h2v2h-2z"/>'},"smartphone-sharp":{body:'<path fill="currentColor" d="M6 2h12v2H6zm0 18h12v2H6zM4 2h2v20H4zm14 0h2v20h-2zm-7 15h2v2h-2z"/>'},smile:{body:'<path fill="currentColor" d="M6 20h12v2H6zM6 2h12v2H6zm12 2h2v2h-2zM4 4h2v2H4zm0 14h2v2H4zm14 0h2v2h-2zM2 6h2v12H2zm18 0h2v12h-2zM7 13h2v2H7zm2 2h6v2H9zm6-2h2v2h-2zM8 8h2v2H8zm6 0h2v2h-2z"/>'},"smile-sharp":{body:'<path fill="currentColor" d="M4 20h16v2H4zM4 2h16v2H4zM2 2h2v20H2zm18 0h2v20h-2zM7 13h2v2H7zm2 2h6v2H9zm6-2h2v2h-2zM8 8h2v2H8zm6 0h2v2h-2z"/>'},snail:{body:'<path fill="currentColor" d="M20 22H6v-2h14zM6 20H4v-8h2zm14-4h2v4h-2v-2h-6v-2h4v-2h2zm-8 2h-2v-2h2zm-2-2H8V8H4V6h6zm4 0h-2V9h2zm8-2h-2V6h2zM4 12H2V8h2zm14 0h-2V9h2zm-2-3h-2V7h2zm-4-3h-2V4h2zm8 0h-2V4h2zM4 4H2V2h2zm4 0H6V2h2zm10 0h-6V2h6z"/>'},snake:{body:'<path fill="currentColor" d="M4 20h16v2H2v-4h2zM8 8h4v4h2V4h2v8h2v4h2V8h2v12h-2v-2H4v-4h2v2h10v-2H6v-2h4v-2H6V8H4V6h2V4h2zm-4 2H2V8h2zm0-4H2V4h2zm8 0h-2V4H8V2h6v2h-2z"/>'},snowflake:{body:'<path fill="currentColor" d="M13 24h-2v-2h2zm-2-2H9v-2H7v2H2v-5h2v3h3v-2h2v-2h2zm4-4h2v2h-2v2h-2v-6h2zm7 4h-5v-2h3v-3h2zM4 15H2v-2h6v2H6v2H4zm18 0h-2v2h-2v-2h-2v-2h6zM2 13H0v-2h2zm22 0h-2v-2h2zM6 9h2v2H2V9h2V7h2zm14 0h2v2h-6V9h2V7h2zm-9-1H9V6H7V4h2V2h2zm4-4h2V2h5v5h-2V4h-3v2h-2v2h-2V2h2zM7 4H4v3H2V2h5zm6-2h-2V0h2z"/>'},"snowflake-solid":{body:'<path fill="currentColor" d="M13 24h-2v-2h2zm-2-2H9v-2H7v2H2v-5h2v3h3v-2h2v-2h2zm4-4h2v2h-2v2h-2v-6h2zm7 4h-5v-2h3v-3h2zM8 15H6v2H4v-2H2v-2h6zm14 0h-2v2h-2v-2h-2v-2h6zm-8-1h-4v-4h4zM2 13H0v-2h2zm22 0h-2v-2h2zM6 9h2v2H2V9h2V7h2zm14 0h2v2h-6V9h2V7h2zm-9-1H9V6H7V4h2V2h2zm4-4h2V2h5v5h-2V4h-3v2h-2v2h-2V2h2zM7 4H4v3H2V2h5zm6-2h-2V0h2z"/>'},sofa:{body:'<path fill="currentColor" d="M5 3h14v2H5zM3 5h2v3H3zM1 8h6v2H1zm0 2h2v7H1zm2 7h18v2H3zm18-7h2v7h-2zm-4-2h6v2h-6zm0 2h2v2h-2zM7 12h10v2H7zm-2-2h2v2H5zm6-5h2v7h-2zm8 0h2v3h-2zm0 14h2v2h-2zM3 19h2v2H3z"/>'},"sofa-sharp":{body:'<path fill="currentColor" d="M3 3h18v2H3zm0 2h2v3H3zM1 8h6v2H1zm0 2h2v7H1zm0 7h22v2H1zm20-7h2v7h-2zm-4-2h6v2h-6zm0 2h2v2h-2zM5 12h14v2H5zm0-2h2v2H5zm6-5h2v7h-2zm8 0h2v3h-2zm0 14h2v2h-2zM3 19h2v2H3z"/>'},sort:{body:'<path fill="currentColor" d="M8 20H6V8H4V6h2V4h2v2h2v2H8zm2-12v2h2V8zM4 8v2H2V8zm14-4h-2v12h-2v-2h-2v2h2v2h2v2h2v-2h2v-2h2v-2h-2v2h-2z"/>',hidden:!0},"sort-alphabetic":{body:'<path fill="currentColor" d="M11 2h2v2h-2zm0 2v2H9V4zm2 0h2v2h-2zM9 18v2h2v2h2v-2h2v-2h-2v2h-2v-2zM8 8H2v8h2v-2h2v2h2zm-2 4H4v-2h2zm6-1v-1h2v1zm4-3h-6v8h6zm-4 6v-1h2v1zm10-6h-4v8h4v-2h-2v-4h2z"/>',hidden:!0},"sort-horizontal":{body:'<path fill="currentColor" d="M20 16v2H4v-2zm-10-2v2H6v-2zm0-2v2H8v-2zm0 6v2H6v-2zm0 2v2H8v-2zM4 6v2h16V6zm10-2v2h4V4zm0-2v2h2V2zm0 6v2h4V8zm0 2v2h2v-2z"/>'},"sort-numeric":{body:'<path fill="currentColor" d="M13 2h-2v2H9v2h2V4h2v2h2V4h-2zM2 8h4v8H4v-6H2zm6 0h6v5h-4v1h4v2H8v-5h4v-1H8zm12 0h-4v2h4v1h-4v2h4v1h-4v2h6V8zm-9 10v2H9v-2zm2 2h-2v2h2zm0 0v-2h2v2z"/>',hidden:!0},"sort-vertical":{body:'<path fill="currentColor" d="M16 4h2v16h-2zm-2 10h2v4h-2zm-2 0h2v2h-2zm6 0h2v4h-2zm2 0h2v2h-2zM6 20h2V4H6zM4 10h2V6H4zm-2 0h2V8H2zm6 0h2V6H8zm2 0h2V8h-2z"/>'},sparkle:{body:'<path fill="currentColor" d="M11 1h2v4h-2zm0 22h2v-4h-2zM9 5h2v4H9zm0 14h2v-4H9zm4-14h2v4h-2zm0 14h2v-4h-2zM5 9h4v2H5zm14 0h-4v2h4zM1 11h4v2H1zm22 0h-4v2h4zM5 13h4v2H5zm14 0h-4v2h4z"/>'},sparkles:{body:'<g fill="currentColor"><path d="M11 1h2v4h-2zm0 22h2v-4h-2zM9 5h2v4H9zm0 14h2v-4H9zm4-14h2v4h-2zm0 14h2v-4h-2zM5 9h4v2H5zm14 0h-4v2h4zM1 11h4v2H1zm22 0h-4v2h4zM5 13h4v2H5zm14 0h-4v2h4zm0-12h2v6h-2z"/><path d="M17 3h6v2h-6zM3 17h2v2H3zm-2 2h2v2H1zm2 2h2v2H3zm2-2h2v2H5z"/></g>'},speaker:{body:'<path fill="currentColor" d="M4 2H3v20h18V2zm15 2v16H5V4zm-6 2h-2v2h2zm-5 4h8v6h-2v-4h-4v4H8zm8 6H8v2h8z"/>',hidden:!0},"speed-fast":{body:'<path fill="currentColor" d="M5 19H3v-2h2zm16 0h-2v-2h2zM3 17H1v-6h2zm11 0h-4v-4h4zm9 0h-2v-6h2zm-7-4h-2v-2h2zM5 11H3V9h2zm13 0h-2V9h2zM9 9H5V7h4zm11 0h-2V7h2zm-5-2H9V5h6z"/>'},"speed-medium":{body:'<path fill="currentColor" d="M5 19H3v-2h2zm16 0h-2v-2h2zM3 17H1v-6h2zm11 0h-4v-4h1V5h2v8h1zm9 0h-2v-6h2zM5 11H3V9h2zm16 0h-2V9h2zM9 9H5V7h4zm10 0h-4V7h4z"/>'},"speed-slow":{body:'<path fill="currentColor" d="M5 19H3v-2h2zm16 0h-2v-2h2zM3 17H1v-6h2zm11 0h-4v-4h4zm9 0h-2v-6h2zm-13-4H8v-2h2zm-2-2H6V9h2zm13 0h-2V9h2zM6 7v2H4V7zm13 2h-4V7h4zm-4-2H9V5h6z"/>'},spinner:{body:'<path fill="currentColor" d="M13 22h-2v-7h2zm-8-1H3v-2h2zm16-2v2h-2v-2zM7 19H5v-2h2zm12 0h-2v-2h2zM9 17H7v-2h2zm8 0h-2v-2h2zm-8-4H2v-2h7zm13 0h-7v-2h7zM9 9H7V7h2zm4 0h-2V2h2zm4 0h-2V7h2zM7 7H5V5h2zm12 0h-2V5h2zM5 5H3V3h2zm16 0h-2V3h2z"/>'},"spline-cursor":{body:'<path fill="currentColor" d="M12 10h2v12h-2zm2 0h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm-6 4h2v2h-2zm2-2h6v2h-6zM4 15h3v2H4zM17 2h3v2h-3zM7 17h2v3H7zM20 4h2v3h-2zM2 17h2v3H2zM15 4h2v3h-2zM4 20h3v2H4zM17 7h3v2h-3zM4 8h2v5H4zm2-2h2v2H6zm2-2h5v2H8z"/>'},spotlight:{body:'<path fill="currentColor" d="M19 2H5v2h14zm0 18H5v2h14zM5 4H3v16h2zm16 0h-2v16h2zm-8 2H7v2h6zm-4 4H7v8h2zm8 0h-2v8h2zm-8 0h6v2H9zm0 6h6v2H9z"/>'},"spotlight-sharp":{body:'<path fill="currentColor" d="M21 2H3v2h18zm0 18H3v2h18zM5 4H3v16h2zm16 0h-2v16h2zm-8 2H7v2h6zm-4 4H7v8h2zm8 0h-2v8h2zm-8 0h6v2H9zm0 6h6v2H9z"/>'},spray:{body:'<path fill="currentColor" d="M4 9h6v2H4zm2-2h2v2H6zm-4 4h2v10H2zm2 8h6v2H4zm6-8h2v10h-2zm2-4h2v2h-2zm2-2h2v2h-2zm0 6h2V9h-2zm2-8h2v2h-2zm0 10h2v-2h-2zm2-12h2v2h-2zm0 14h2v-2h-2zm-2-8h2v2h-2zm2-2h2v2h-2zm0 4h2v2h-2z"/>'},"spray-can":{body:'<g fill="currentColor"><path d="M9 3h4v4H9zM7 7h8v2H7zM5 21h12v2H5zM15 9h2v12h-2zM5 9h2v12H5zm4 8h6v2H9z"/><path d="M9 13h2v6H9z"/><path d="M9 13h8v2H9zm6-10h2v2h-2zm2-2h2v2h-2zm0 4h2v2h-2z"/></g>'},"spray-image":{body:'<path fill="currentColor" d="M4 12h6v2H4zm2-2h2v2H6zm-4 4h2v6H2zm0 6h10v2H2zm8-6h2v6h-2zM4 2h16v2H4zM2 4h2v6H2zm18 0h2v16h-2zm-6 16h6v2h-6zm4-8h2v2h-2zm0 4h2v2h-2zm-6-6h2v2h-2zm2-2h2v2h-2zm0 8h2v2h-2zm2-6h2v2h-2zm0 4h2v2h-2zM8 6h2v2H8z"/>'},"spray-wave":{body:'<g fill="currentColor"><path d="M4 9h6v2H4zm2-2h2v2H6zm-4 4h2v10H2zm2 8h6v2H4zm6-8h2v10h-2z"/><path d="M6 15h6v2H6zm8-11h2v2h-2zm4-2h2v2h-2zm0 10h2v2h-2zm-2-6h2v4h-2zm4-2h2v8h-2zm-6 6h2v2h-2zm-3-3h2v2h-2z"/></g>'},square:{body:'<path fill="currentColor" d="M2 4h2v16H2zm2 16h16v2H4zM20 4h2v16h-2zM4 2h16v2H4z"/>'},"square-alert":{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h16v2H4zM20 4h2v16h-2zM2 4h2v16H2zm9 2h2v8h-2zm0 10h2v2h-2z"/>'},"square-alert-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 18h20v2H2zM20 4h2v16h-2zM2 4h2v16H2zm9 2h2v8h-2zm0 10h2v2h-2z"/>'},"square-chevron-down":{body:'<path fill="currentColor" d="M4 20h16v2H4zM4 2h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zm-9 11h2v-2h-2zm-2-2h2v-2H9zm-2-2h2V9H7zm6 2h2v-2h-2zm2-2h2V9h-2z"/>'},"square-chevron-down-sharp":{body:'<path fill="currentColor" d="M2 20h20v2H2zM2 2h20v2H2zm0 2h2v16H2zm18 0h2v16h-2zm-9 11h2v-2h-2zm-2-2h2v-2H9zm-2-2h2V9H7zm6 2h2v-2h-2zm2-2h2V9h-2z"/>'},"square-chevron-left":{body:'<path fill="currentColor" d="M4 20h16v2H4zM4 2h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zM9 11v2h2v-2zm2-2v2h2V9zm2-2v2h2V7zm-2 6v2h2v-2zm2 2v2h2v-2z"/>'},"square-chevron-left-sharp":{body:'<path fill="currentColor" d="M2 20h20v2H2zM2 2h20v2H2zm0 2h2v16H2zm18 0h2v16h-2zM9 11v2h2v-2zm2-2v2h2V9zm2-2v2h2V7zm-2 6v2h2v-2zm2 2v2h2v-2z"/>'},"square-chevron-right":{body:'<path fill="currentColor" d="M4 20h16v2H4zM4 2h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zm-5 7v2h-2v-2zm-2-2v2h-2V9zm-2-2v2H9V7zm2 6v2h-2v-2zm-2 2v2H9v-2z"/>'},"square-chevron-right-sharp":{body:'<path fill="currentColor" d="M2 20h20v2H2zM2 2h20v2H2zm0 2h2v16H2zm18 0h2v16h-2zm-5 7v2h-2v-2zm-2-2v2h-2V9zm-2-2v2H9V7zm2 6v2h-2v-2zm-2 2v2H9v-2z"/>'},"square-chevron-up":{body:'<path fill="currentColor" d="M4 20h16v2H4zM4 2h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zm-9 5h2v2h-2zm-2 2h2v2H9zm-2 2h2v2H7zm6-2h2v2h-2zm2 2h2v2h-2z"/>'},"square-chevron-up-sharp":{body:'<path fill="currentColor" d="M2 20h20v2H2zM2 2h20v2H2zm0 2h2v16H2zm18 0h2v16h-2zm-9 5h2v2h-2zm-2 2h2v2H9zm-2 2h2v2H7zm6-2h2v2h-2zm2 2h2v2h-2z"/>'},"square-cursor":{body:'<path fill="currentColor" d="M12 10h2v12h-2zm2 0h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm-6 4h2v2h-2zm2-2h6v2h-6zM4 2h16v2H4zm0 18h6v2H4zM2 4h2v16H2zm18 0h2v8h-2z"/>'},"square-cursor-sharp":{body:'<path fill="currentColor" d="M12 10h2v12h-2zm2 0h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm-6 4h2v2h-2zm2-2h6v2h-6zM2 2h20v2H2zm0 18h8v2H2zM2 4h2v16H2zm18 0h2v8h-2z"/>'},"square-dashed-cursor":{body:'<path fill="currentColor" d="M12 10h2v12h-2zm2 0h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm-6 4h2v2h-2zm2-2h6v2h-6zM2 16h2v4H2zm2 4h2v2H4zm4 0h2v2H8zM2 10h2v4H2zm0-6h2v4H2zm2-2h2v2H4zm4 0h4v2H8zm6 0h4v2h-4zm6 2h2v4h-2zm0 6h2v2h-2z"/>'},"square-dashed-cursor-sharp":{body:'<g fill="currentColor"><path d="M12 10h2v12h-2zm2 0h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm-6 4h2v2h-2zm2-2h6v2h-6zM2 18h2v4H2zm2 2h2v2H4zm4 0h2v2H8zM2 8h2v4H2zm0-6h2v4H2zm2 0h2v2H4zm4 0h4v2H8zm10 0h4v2h-4z"/><path d="M20 2h2v4h-2zm0 6h2v4h-2zm-6-6h2v2h-2zM2 14h2v2H2z"/></g>'},"square-power":{body:'<path fill="currentColor" d="M4 20h16v2H4zM4 2h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zM9 15h6v2H9zM7 9h2v6H7zm8 0h2v6h-2zm-4-2h2v5h-2z"/>'},"square-power-sharp":{body:'<path fill="currentColor" d="M2 20h20v2H2zM2 2h20v2H2zm0 2h2v16H2zm18 0h2v16h-2zM9 15h6v2H9zM7 9h2v6H7zm8 0h2v6h-2zm-4-2h2v5h-2z"/>'},"square-scissors":{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zm-4 3h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2h-2zm4 4h2v2h-2zm-2-2h2v2h-2zm-4-2h2v2h-2zm0-2h2v2h-2zM8 7h2v2H8zm0 8h2v2H8zm-2-2h2v2H6zm2-2h2v2H8zM6 9h2v2H6zm4 4h2v2h-2z"/>'},"square-scissors-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zm-4 3h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2h-2zm4 4h2v2h-2zm-2-2h2v2h-2zm-4-2h2v2h-2zm0-2h2v2h-2zM8 7h2v2H8zm0 8h2v2H8zm-2-2h2v2H6zm2-2h2v2H8zM6 9h2v2H6zm4 4h2v2h-2z"/>'},"square-sharp":{body:'<path fill="currentColor" d="M2 4h2v16H2zm0 16h20v2H2zM20 4h2v16h-2zM2 2h20v2H2z"/>'},star:{body:'<path fill="currentColor" d="M5 20h3v2H3v-6h2zm16 2h-5v-2h3v-4h2zm-11-2H8v-2h2zm6 0h-2v-2h2zm-2-2h-4v-2h4zm-7-2H5v-3h2zm12 0h-2v-3h2zM5 13H3v-2h2zm16 0h-2v-2h2zM9 9H3v2H1V7h8zm14 2h-2V9h-6V7h8zM11 7H9V3h2zm4 0h-2V3h2zm-2-4h-2V1h2z"/>'},sticker:{body:'<g fill="currentColor"><path d="M4 4H2v16h2zm14-2H4v2h14zm4 4h-2v14h2zm-2 14H4v2h16zM18 4h2v2h-2zm-4 0h2v4h-2z"/><path d="M14 6h6v2h-6zm-6 8h2v2H8zm6 0h2v2h-2zm-4 2h4v2h-4zm-2-6h2v2H8zm6 0h2v2h-2z"/></g>'},"sticker-sharp":{body:'<g fill="currentColor"><path d="M4 4H2v16h2zm14-2H2v2h16zm4 4h-2v14h2zm0 14H2v2h20zM18 4h2v2h-2zm-4 0h2v4h-2z"/><path d="M14 6h6v2h-6zm-6 8h2v2H8zm6 0h2v2h-2zm-4 2h4v2h-4zm-2-6h2v2H8zm6 0h2v2h-2z"/></g>'},"sticky-note":{body:'<path fill="currentColor" d="M4 4H2v16h2zm12-2H4v2h12zm6 6h-2v12h2zm-2 12H4v2h16zM18 6h2v2h-2zm-2-2h2v2h-2zm-4 0h2v6h-2zm0 6h8v2h-8z"/>'},"sticky-note-sharp":{body:'<path fill="currentColor" d="M4 4H2v16h2zm12-2H2v2h14zm6 6h-2v12h2zm0 12H2v2h20zM18 6h2v2h-2zm-2-2h2v2h-2zm-4 0h2v6h-2zm0 6h8v2h-8z"/>'},"sticky-note-text":{body:'<path fill="currentColor" d="M4 4H2v16h2zm12-2H4v2h12zm6 6h-2v12h2zm-2 12H4v2h16zM18 6h2v2h-2zm-2-2h2v2h-2zm-4 0h2v6h-2zm0 6h8v2h-8zm-6 2h4v2H6zm0 4h6v2H6z"/>'},"sticky-note-text-sharp":{body:'<path fill="currentColor" d="M4 4H2v16h2zm12-2H2v2h14zm6 6h-2v12h2zm0 12H2v2h20zM18 6h2v2h-2zm-2-2h2v2h-2zm-4 0h2v6h-2zm0 6h8v2h-8zm-6 2h4v2H6zm0 4h6v2H6z"/>'},stop:{body:'<path fill="currentColor" d="M20 20H4V4h16zM6 18h12V6H6zm8-4h-4v-4h4z"/>'},"stop-solid":{body:'<path fill="currentColor" d="M20 20H4V4h16zm-10-6h4v-4h-4z"/>'},store:{body:'<path fill="currentColor" d="M3 13h2v8H3zm2 8h14v2H5zm14-8h2v8h-2zm-9-2h4v2h-4zm4-2h4v2h-4zm4 2h4v2h-4zM6 9h4v2H6zm-4 2h4v2H2zM0 7h2v4H0zm2-2h2v2H2zm18 0h2v2h-2zm2 2h2v4h-2zM4 3h16v2H4zm6 12h4v2h-4zm-2 2h2v4H8zm6 0h2v4h-2z"/>'},"store-sharp":{body:'<path fill="currentColor" d="M3 13h2v8H3zm0 8h18v2H3zm16-8h2v8h-2zm-9-2h4v2h-4zm4-2h4v2h-4zm4 2h4v2h-4zM6 9h4v2H6zm-4 2h4v2H2zM0 5h2v6H0zm22 0h2v6h-2zM0 3h24v2H0zm8 12h8v2H8zm0 2h2v4H8zm6 0h2v4h-2z"/>'},subscriptions:{body:'<path fill="currentColor" d="M4 10h16v2H4zm0 10h16v2H4zm-2-8h2v8H2zm18 0h2v8h-2zM6 6h12v2H6zm2-4h8v2H8zM6 16h2v2H6zm4 0h2v2h-2zm4 0h2v2h-2z"/>'},"subscriptions-sharp":{body:'<path fill="currentColor" d="M2 10h20v2H2zm0 10h20v2H2zm0-8h2v8H2zm18 0h2v8h-2zM6 6h12v2H6zm2-4h8v2H8zM6 16h2v2H6zm4 0h2v2h-2zm4 0h2v2h-2z"/>'},subtitles:{body:'<path fill="currentColor" d="M21 7h-8v10h8v-2h-6V9h6zM3 15V7h8v2H5v6h6v2H3z"/>',hidden:!0},suitcase:{body:'<path fill="currentColor" d="M4 6h16v2H4zM2 8h2v12H2zm18 0h2v12h-2zM4 20h16v2H4zM8 4h2v2H8zm2-2h4v2h-4zm4 2h2v2h-2zm-8 6h2v8H6zm10 0h2v8h-2z"/>'},"suitcase-sharp":{body:'<path fill="currentColor" d="M2 6h20v2H2zm0 2h2v12H2zm18 0h2v12h-2zM2 20h20v2H2zM8 4h2v2H8zm0-2h8v2H8zm6 2h2v2h-2zm-8 6h2v8H6zm10 0h2v8h-2z"/>'},sun:{body:'<path fill="currentColor" d="M13 22h-2v-3h2zm-6-3H5v-2h2zm12 0h-2v-2h2zm-4-2H9v-2h6zm-6-2H7V9h2zm8 0h-2V9h2zM5 13H2v-2h3zm17 0h-3v-2h3zm-7-4H9V7h6zM7 7H5V5h2zm12 0h-2V5h2zm-6-2h-2V2h2z"/>'},"sun-alt":{body:'<path fill="currentColor" d="M13 0h-2v4h2zM0 11v2h4v-2zm24 0v2h-4v-2zM13 24h-2v-4h2zM8 6h8v2H8zM6 8h2v8H6zm2 10v-2h8v2zm10-2h-2V8h2zm2-14h2v2h-2zm0 2v2h-2V4zm2 18h-2v-2h2zm-2-2h-2v-2h2zM4 2H2v2h2v2h2V4H4zM2 22h2v-2h2v-2H4v2H2z"/>',hidden:!0},"sun-solid":{body:'<path fill="currentColor" d="M13 22h-2v-3h2zm-6-3H5v-2h2zm12 0h-2v-2h2zM15 9h2v6h-2v2H9v-2H7V9h2V7h6zM5 13H2v-2h3zm17 0h-3v-2h3zM7 7H5V5h2zm12 0h-2V5h2zm-6-2h-2V2h2z"/>'},sunglasses:{body:'<path fill="currentColor" d="M15 10h5v2h-5zM4 10h5v2H4zm16 2h2v5h-2zM9 12h2v5H9zm4 0h2v5h-2zM2 12h2v5H2zm13 5h5v2h-5zM4 17h5v2H4zm7-5h2v2h-2zM2 6h2v6H2zm18 0h2v6h-2zM4 4h2v2H4zm14 0h2v2h-2zM6 12h3v2H6zm11 0h3v2h-3zM4 14h2v3H4zm11 0h2v3h-2zm-9 2h3v1H6zm11 0h3v1h-3zm-9-2h1v2H8zm11 0h1v2h-1z"/>'},"sunglasses-sharp":{body:'<path fill="currentColor" d="M13 10h7v2h-7zm-9 0h7v2H4zm16 2h2v5h-2zM9 12h2v5H9zm4 0h2v5h-2zM2 12h2v5H2zm11 5h9v2h-9zM2 17h9v2H2zm9-5h2v2h-2zM2 6h2v6H2zm18 0h2v6h-2zM4 4h2v2H4zm14 0h2v2h-2zM6 12h3v2H6zm11 0h3v2h-3zM4 14h2v3H4zm11 0h2v3h-2zm-9 2h3v1H6zm11 0h3v1h-3zm-9-2h1v2H8zm11 0h1v2h-1z"/>'},switch:{body:'<path fill="currentColor" d="M5 21H3v-2h2zm16 0h-6v-2h2v-2h2v-2h2zM7 19H5v-2h2zm2-2H7v-2h2zm8 0h-2v-2h2zm-2-2h-2v-2h2zm-2-2h-2v-2h2zm-2-2H9V9h2zm4 0h-2V9h2zM9 9H7V7h2zm8 0h-2V7h2zm4-6v6h-2V7h-2V5h-2V3zM7 7H5V5h2zM5 5H3V3h2z"/>'},sword:{body:'<path fill="currentColor" d="M11 2h2v2h-2zM9 4h2v12H9zm4 0h2v12h-2zM7 16h10v2H7zm4 2h2v4h-2z"/>'},sync:{body:'<path fill="currentColor" d="M4 9V7h12V5h2v2h2v2h-2v2h-2V9zm12 2h-2v2h2zm0-6h-2V3h2zm4 12v-2H8v-2h2v-2H8v2H6v2H4v2h2v2h2v2h2v-2H8v-2z"/>',hidden:!0},"t-arrow-down":{body:'<g fill="currentColor"><path d="M16 6h2v12h-2zm2 8h2v2h-2zm-4 0h2v2h-2zm4-2h4v2h-4zm-6 0h4v2h-4zM6 8h2v10H6zM2 6h8v2H2z"/><path d="M2 6h2v3H2zm8 0h2v3h-2zM4 16h6v2H4z"/></g>'},"t-arrow-up":{body:'<g fill="currentColor"><path d="M16 18h2V6h-2zm2-8h2V8h-2zm-4 0h2V8h-2zm4 2h4v-2h-4zm-6 0h4v-2h-4zM6 8h2v10H6zM2 6h8v2H2z"/><path d="M2 6h2v3H2zm8 0h2v3h-2zM4 16h6v2H4z"/></g>'},"t-rex":{body:'<path fill="currentColor" d="M18 23h-8v-2h2v-2h2v2h2v-4h2zm-8-8h2v4h-2v-2H6v-2h2v-2H4v-2h6zm10 2h-2v-2h2zm-6-2h-2v-2h2zm8 0h-2v-2h-2v-2h2V7h2zM4 7h4v2H4v2H2V3h2zm14 4h-2V9h2zm-2-2h-2V3h2zm-4-2h-2V5h2zm2-4H4V1h10z"/>'},tab:{body:'<path fill="currentColor" d="M2 6h2v12H2zm2 12h16v2H4zM20 6h2v12h-2zM4 4h16v2H4zm8 2h8v4h-8z"/>'},"tab-sharp":{body:'<path fill="currentColor" d="M2 6h2v12H2zm0 12h20v2H2zM20 6h2v12h-2zM2 4h20v2H2zm10 2h8v4h-8z"/>'},table:{body:'<path fill="currentColor" d="M2 3h20v18H2zm2 4v5h7V7zm9 0v5h7V7zm7 7h-7v5h7zm-9 5v-5H4v5z"/>',hidden:!0},tablet:{body:'<path fill="currentColor" d="M5 2h14v2H5zm0 18h14v2H5zM3 4h2v16H3zm16 0h2v16h-2zm-8 12h2v2h-2z"/>'},"tablet-sharp":{body:'<path fill="currentColor" d="M3 2h18v2H3zm0 18h18v2H3zM3 4h2v16H3zm16 0h2v16h-2zm-8 12h2v2h-2z"/>'},tangent:{body:'<g fill="currentColor"><path d="M6 16h2v2H6zm-2 0h2v2H4zm-2 0h2v6H2zm2 4h2v2H4zm2-2h2v4H6zM16 2h2v6h-2zm2 0h2v2h-2zm2 0h2v6h-2zm-2 4h2v2h-2zM8 14h2v2H8zm2-2h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2z"/><path d="M16 6h2v2h-2zm-2 6h4v2h-4zm4 2h4v2h-4zm-6-2h2v6h-2zm2 6h2v4h-2z"/></g>'},target:{body:'<path fill="currentColor" d="M5 1h14v2H5zM3 3h2v2H3zm0 16h2v2H3zm16 0h2v2h-2zm0-16h2v2h-2zm2 2h2v14h-2zM5 21h14v2H5zM1 5h2v14H1zm8 0h6v2H9zM5 9h2v6H5zm4 8h6v2H9zm8-8h2v6h-2zm-6 0h2v2h-2zM7 7h2v2H7zm0 8h2v2H7zm8 0h2v2h-2zm0-8h2v2h-2zm-6 4h2v2H9zm2 2h2v2h-2zm2-2h2v2h-2z"/>'},tea:{body:'<path fill="currentColor" d="M4 6h16v2H4zm0 2h2v10H4zm2 10h10v2H6zM20 8h2v4h-2zm-2 4h2v2h-2zm-2-4h2v10h-2zM7 2h2v2H7zm6 0h2v2h-2zM9 0h2v2H9zm6 0h2v2h-2zm-5 8h2v4h-2zm-2 4h6v4H8z"/>'},"tea-sharp":{body:'<path fill="currentColor" d="M4 6h16v2H4zm0 2h2v10H4zm0 10h14v2H4zM20 6h2v8h-2zm-2 6h2v2h-2zm-2-4h2v10h-2zM7 2h2v2H7zm6 0h2v2h-2zM9 0h2v2H9zm6 0h2v2h-2zm-5 8h2v4h-2zm-2 4h6v4H8z"/>'},teach:{body:'<g fill="currentColor"><path d="M3 2h4v4H3zM2 8h12v2H2zm7-4h11v2H9zm1 10h10v2H10z"/><path d="M2 9h6v7H2zm0 7h2v4H2zm4 0h2v4H6zM20 6h2v8h-2z"/></g>'},"teach-sharp":{body:'<g fill="currentColor"><path d="M3 2h4v4H3zM2 8h12v2H2zm7-4h11v2H9zm1 10h10v2H10z"/><path d="M2 9h6v7H2zm0 7h2v4H2zm4 0h2v4H6zM20 4h2v12h-2z"/></g>'},telegram:{body:'<path fill="currentColor" d="M19 23H5v-2h14zM5 21H3v-2h2zm16 0h-2v-2h2zM3 19H1V5h2zm14 0h-2v-2h-4v-2h4V7h-3V5h5zm6 0h-2V5h2zm-10-8v2h-2v2H9v2H7v-4h2v-2zm-6 2H4v-2h3zm2-2H7V9h2zm3-2H9V7h3zM5 5H3V3h2zm16 0h-2V3h2zm-2-2H5V1h14z"/>'},"telegram-glyph":{body:'<path fill="currentColor" d="M23 23H1V1h22zM13 7h-3v2H8v2H5v2h3v4h2v-2h2v2h4v2h2V5h-5zm3 8h-4v-2h2v-2h-4V9h4V7h2zm-6-2H8v-2h2z"/>'},"telegram-sharp":{body:'<path fill="currentColor" d="M23 23H1V1h22zM3 21h18V3H3zm15-2h-2v-2h-4v-2h4V7h-3V5h5zm-4-8v2h-2v2h-2v2H8v-4h2v-2zm-6 2H5v-2h3zm2-2H8V9h2zm3-2h-3V7h3z"/>'},"telegram-solid":{body:'<path fill="currentColor" d="M19 3h2v2h2v14h-2v2h-2v2H5v-2H3v-2H1V5h2V3h2V1h14zm-7 4H9v2H7v2H4v2h3v4h2v-2h2v2h4v2h2V5h-5zm3 8h-4v-2h2v-2H9V9h4V7h2zm-6-2H7v-2h2z"/>'},tent:{body:'<g fill="currentColor"><path d="M1 19h22v2H1z"/><path d="M3 17h2v3H3zm2-3h2v3H5zm2-3h2v3H7zm2-3h2v3H9zm2-3h2v3h-2zM9 3h2v2H9zm4 5h2v3h-2zm2 3h2v3h-2zm2 3h2v3h-2zm2 3h2v3h-2zM9 17h2v2H9zm4 0h2v2h-2zm-2-2h2v2h-2zm2-12h2v2h-2z"/></g>'},terminal:{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zM6 16h2v2H6zm2-2h2v2H8zm-2-2h2v2H6z"/>'},"terminal-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zM6 16h2v2H6zm2-2h2v2H8zm-2-2h2v2H6z"/>'},"test-tube":{body:'<g fill="currentColor"><path d="M7 2h10v2H7zm1 2h2v16H8zm2 16h4v2h-4zm4-16h2v16h-2z"/><path d="M8 13h8v2H8z"/></g>'},"test-tube-sharp":{body:'<g fill="currentColor"><path d="M7 2h10v2H7zm1 2h2v16H8zm0 16h8v2H8zm6-16h2v16h-2z"/><path d="M8 13h8v2H8z"/></g>'},"text-add":{body:'<path fill="currentColor" d="M19 4H3v2h16zm0 4H3v2h16zM3 12h8v2H3zm8 4H3v2h8zm7-1h3v2h-3v3h-2v-3h-3v-2h3v-3h2z"/>',hidden:!0},"text-align-center":{body:'<path fill="currentColor" d="M2 5h20v2H2zm4 6h12v2H6zm-2 6h16v2H4z"/>'},"text-align-center-box":{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zM6 7h12v2H6zm3 4h6v2H9zm-2 4h10v2H7z"/>'},"text-align-center-box-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zM6 7h12v2H6zm3 4h6v2H9zm-2 4h10v2H7z"/>'},"text-align-justify":{body:'<path fill="currentColor" d="M2 5h20v2H2zm0 6h20v2H2zm0 6h20v2H2z"/>'},"text-align-justify-box":{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zM6 7h12v2H6zm0 4h12v2H6zm0 4h12v2H6z"/>'},"text-align-justify-box-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zM6 7h12v2H6zm0 4h12v2H6zm0 4h12v2H6z"/>'},"text-align-left":{body:'<path fill="currentColor" d="M2 5h20v2H2zm0 6h12v2H2zm0 6h16v2H2z"/>'},"text-align-left-box":{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zM6 7h12v2H6zm0 4h6v2H6zm0 4h10v2H6z"/>'},"text-align-left-box-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zM6 7h12v2H6zm0 4h6v2H6zm0 4h10v2H6z"/>'},"text-align-right":{body:'<path fill="currentColor" d="M2 5h20v2H2zm8 6h12v2H10zm-4 6h16v2H6z"/>'},"text-align-right-box":{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zM6 7h12v2H6zm6 4h6v2h-6zm-4 4h10v2H8z"/>'},"text-align-right-box-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zM6 7h12v2H6zm6 4h6v2h-6zm-4 4h10v2H8z"/>'},"text-colums":{body:'<path fill="currentColor" d="M11 19H3v-2h8zm10 0h-8v-2h8zm-10-4H3v-2h8zm10 0h-8v-2h8zm-10-4H3V9h8zm10 0h-8V9h8zM11 7H3V5h8zm10 0h-8V5h8z"/>'},"text-cursor":{body:'<path fill="currentColor" d="M5 2h4v2H5zm0 20h4v-2H5zM9 4h2v2H9zm0 16h2v-2H9zm4-16h2v2h-2zm0 16h2v-2h-2zm2-18h4v2h-4zm0 20h4v-2h-4zM11 6h2v12h-2z"/>'},"text-cursor-input":{body:'<path fill="currentColor" d="M5 3h4v2H5zm4 2h2v14H9zm2-2h4v2h-4zM4 7h3v2H4zM2 9h2v6H2zm2 6h3v2H4zm9 0h7v2h-7zm7-6h2v6h-2zm-7-2h7v2h-7zM6 19h3v2H6zm5 0h3v2h-3z"/>'},"text-cursor-input-sharp":{body:'<path fill="currentColor" d="M5 3h4v2H5zm4 2h2v14H9zm2-2h4v2h-4zM4 7h3v2H4zM2 7h2v10H2zm2 8h3v2H4zm9 0h7v2h-7zm7-8h2v10h-2zm-7 0h7v2h-7zM6 19h3v2H6zm5 0h3v2h-3z"/>'},"text-search":{body:'<path fill="currentColor" d="M20 4H4v2h16zm0 4H4v2h16zm-8 4H4v2h8zm8 0h-6v6h6v2h2v-2h-2zm-4 4v-2h2v2zm-4 0H4v2h8z"/>',hidden:!0},"text-start-a":{body:'<path fill="currentColor" d="M12 6h10v2H12zm0 4h10v2H12zM2 14h20v2H2zm0 4h20v2H2zM2 6h2v6H2zm6 0h2v6H8zM4 4h4v2H4zm0 4h4v2H4z"/>'},"text-start-a-sharp":{body:'<path fill="currentColor" d="M12 6h10v2H12zm0 4h10v2H12zM2 14h20v2H2zm0 4h20v2H2zM2 6h2v6H2zm6 0h2v6H8zM2 4h8v2H2zm2 4h4v2H4z"/>'},"text-start-t":{body:'<g fill="currentColor"><path d="M12 6h10v2H12zm0 4h10v2H12zM2 14h20v2H2zm0 4h20v2H2zM2 4h8v2H2zm3 2h2v6H5z"/><path d="M3 10h6v2H3zM2 6h2v2H2zm6 0h2v2H8z"/></g>'},"text-wrap":{body:'<g fill="currentColor"><path d="M3 5h16v2H3zm0 8h4v2H3zm0 4h6v2H3zm0-8h6v2H3zm16-2h2v6h-2zM9 13h10v2H9z"/><path d="M11 11h2v6h-2zm2-2h2v8h-2zm0 8h2v2h-2z"/></g>'},"text-wrap-sharp":{body:'<g fill="currentColor"><path d="M3 5h16v2H3zm0 8h4v2H3zm0 4h6v2H3zm0-8h6v2H3zm16-4h2v10h-2zM9 13h10v2H9z"/><path d="M11 11h2v6h-2zm2-2h2v8h-2zm0 8h2v2h-2z"/></g>'},thermometer:{body:'<g fill="currentColor"><path d="M9 2h6v2H9zm0 18h6v2H9zm2-4h2v2h-2zM7 4h2v16H7zm8 0h2v16h-2z"/><path d="M5 16h4v2H5zM5 6h4v2H5zm0 5h4v2H5z"/></g>'},"thermometer-sharp":{body:'<g fill="currentColor"><path d="M7 2h10v2H7zm0 18h10v2H7zm4-4h2v2h-2zM7 4h2v16H7zm8 0h2v16h-2z"/><path d="M5 16h4v2H5zM5 6h4v2H5zm0 5h4v2H5z"/></g>'},"thumbs-down":{body:'<path fill="currentColor" d="M2 12h2V4H2zm2-8h14V2H4zm14 4h2V4h-2zm2 4h2V8h-2zm-6 2h6v-2h-6zm0 2h2v-2h-2zm2 4h2v-4h-2zm-2 2h2v-2h-2zm-2-2h2v-2h-2zm-2-2h2v-2h-2zm-2-2h2v-2H8zm-4-2h4v-2H4zm2-2h2V4H6z"/>'},"thumbs-down-sharp":{body:'<path fill="currentColor" d="M2 14h2V2H2zM4 4h14V2H4zm14 4h2V4h-2zm2 4h2V8h-2zm-6 2h6v-2h-6zm0 2h2v-2h-2zm2 4h2v-4h-2zm-2 2h2v-2h-2zm-2-2h2v-2h-2zm-2-2h2v-2h-2zm-2-2h2v-2H8zm-4-2h4v-2H4zm2-2h2V4H6z"/>'},"thumbs-up":{body:'<path fill="currentColor" d="M2 12h2v8H2zm2 8h14v2H4zm14-4h2v4h-2zm2-4h2v4h-2zm-6-2h6v2h-6zm0-2h2v2h-2zm2-4h2v4h-2zm-2-2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2h-2zM8 8h2v2H8zm-4 2h4v2H4zm2 2h2v8H6z"/>'},"thumbs-up-sharp":{body:'<path fill="currentColor" d="M2 10h2v12H2zm2 10h14v2H4zm14-4h2v4h-2zm2-4h2v4h-2zm-6-2h6v2h-6zm0-2h2v2h-2zm2-4h2v4h-2zm-2-2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2h-2zM8 8h2v2H8zm-4 2h4v2H4zm2 2h2v8H6z"/>'},tiktok:{body:'<path fill="currentColor" d="M15 22H7v-2h8zm-8-2H5v-2h2zM17 8h2V6h2v4h-4v10h-2V6h2zM5 18H3v-6h2zM17 4h-4v14H9v-2h2v-2H9v-2h2v-2H7V8h4V2h6zM9 16H7v-2h2zm-2-4H5v-2h2zm12-6h-2V4h2z"/>'},timeline:{body:'<path fill="currentColor" d="M7 7h4v4H7zm-2 6v-2h2v2zm0 0v4H1v-4zm8 0h-2v-2h2zm4 0h-4v4h4zm2-2v2h-2v-2zm0 0h4V7h-4z"/>',hidden:!0},"toggle-left":{body:'<path fill="currentColor" d="M4 5h16v2H4zm0 12H2V7h2zm16 0v2H4v-2zm0 0h2V7h-2zM10 9H6v6h4z"/>',hidden:!0},"toggle-right":{body:'<path fill="currentColor" d="M4 5h16v2H4zm0 12H2V7h2zm16 0v2H4v-2zm0 0h2V7h-2zm-2-8h-4v6h4z"/>',hidden:!0},"toke-circle":{body:'<path fill="currentColor" d="M6 2h12v2H6zm0 18h12v2H6zM4 4h2v2H4zm16 0h-2v2h2zM2 6h2v12H2zm20 0h-2v12h2zM4 18h2v2H4zm16 0h-2v2h2zM11 7h2v2h-2zm0 8h2v2h-2zm-4-4h2v2H7zm8 0h2v2h-2zM9 9h2v2H9zm4 0h2v2h-2zm0 4h2v2h-2zm-4 0h2v2H9z"/>'},"toke-square":{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zm-9 3h2v2h-2zm0 8h2v2h-2zm-4-4h2v2H7zm8 0h2v2h-2zM9 9h2v2H9zm4 0h2v2h-2zm0 4h2v2h-2zm-4 0h2v2H9z"/>'},"toke-square-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zm-9 3h2v2h-2zm0 8h2v2h-2zm-4-4h2v2H7zm8 0h2v2h-2zM9 9h2v2H9zm4 0h2v2h-2zm0 4h2v2h-2zm-4 0h2v2H9z"/>'},"tool-case":{body:'<path fill="currentColor" d="M2 11h20v2H2zm0 2h2v8H2zm2 8h16v2H4zm16-8h2v8h-2zM9 15h6v2H9zM4 8h2v3H4zm2-2h6v2H6zm6 2h2v3h-2zM8 4h2v2H8zm10 0h2v7h-2zm-8-2h8v2h-8z"/>'},"tool-case-sharp":{body:'<g fill="currentColor"><path d="M2 11h20v2H2zm0 2h2v8H2zm0 8h20v2H2zm18-8h2v8h-2zM9 15h6v2H9zM4 8h2v3H4zm0-2h10v2H4zm8 2h2v3h-2zM8 2h2v4H8zm10 1h2v8h-2z"/><path d="M8 2h12v2H8z"/></g>'},tools:{body:'<path fill="currentColor" d="M9 22H7v-2h2zm12-6h2v6h-6v-6h2v-6h2zm-2 2v2h2v-2zM7 20H5v-8h2zm4 0H9v-8h2zm-6-8H3v-2h2zm8 0h-2v-2h2zM3 10H1V4h2zm12 0h-2V4h2zm4 0h-2V4h2zm4 0h-2V4h2zM7 6h2V2h4v2h-2v4H5V4H3V2h4zm14-2h-2V2h2z"/>'},"tools-solid":{body:'<path fill="currentColor" d="M7 6h2V2h2v2h2v6h-2v2H9v4h2v6H5v-6h2v-4H5v-2H3V4h2V2h2zm12-2h2v6h-2v6h2v6h-6v-6h2v-6h-2V4h2V2h2z"/>'},tournament:{body:'<path fill="currentColor" d="M2 1h5v2H2zm0 12h5v2H2zm0-4h5v2H2zm0 12h5v2H2zM7 3h2v6H7zm7 4h2v10h-2zm-7 8h2v6H7zm2 2h5v2H9zM9 5h5v2H9zm7 6h6v2h-6z"/>'},"tournament-sharp":{body:'<path fill="currentColor" d="M2 1h5v2H2zm0 12h5v2H2zm0-4h5v2H2zm0 12h5v2H2zM7 1h2v10H7zm7 4h2v14h-2zm-7 8h2v10H7zm2 4h5v2H9zM9 5h5v2H9zm7 6h6v2h-6z"/>'},"track-changes":{body:'<path fill="currentColor" d="M11 2H2v20h20V4h-2v16H4V4h7v2H6v12h12V8h-2v8H8V8h3v2h-1v4h4v-4h-1V2z"/>',hidden:!0},trash:{body:'<path fill="currentColor" d="M18 22H6v-2h12zM9 6h6V4h2v2h5v2h-2v12h-2V8H6v12H4V8H2V6h5V4h2zm6-2H9V2h6z"/>'},"trash-alt":{body:'<path fill="currentColor" d="M16 2v4h6v2h-2v14H4V8H2V6h6V2zm-2 2h-4v2h4zm0 4H6v12h12V8z"/>',hidden:!0},"trash-sharp":{body:'<path fill="currentColor" d="M18 20V8H6v12zM9 6h6V4H9zm11 16H4V8H2V6h5V2h10v4h5v2h-2z"/>'},tree:{body:'<g fill="currentColor"><path d="M6 4h2v2H6zm2-2h8v2H8zm10 4h2v4h-2zm2 4h2v6h-2zm-2 6h2v2h-2zM4 16h2v2H4zm-2-6h2v6H2zm4 8h12v2H6zM4 6h2v4H4z"/><path d="M11 18h2v4h-2zm5-14h2v2h-2z"/></g>'},"tree-pine":{body:'<path fill="currentColor" d="M11 2h2v2h-2zM9 4h2v2H9zm4 0h2v2h-2zm2 2h2v2h-2zM7 6h2v2H7zm0 4h2v2H7zm-2 2h2v2H5zm2 2h2v2H7zm-2 2h2v2H5zm-2 2h18v2H3zM13 8h2v2h-2zm2 2h2v2h-2zM9 8h2v2H9zm8 4h2v2h-2zm-2 2h2v2h-2zm2 2h2v2h-2zm-6 4h2v2h-2z"/>'},trending:{body:'<path fill="currentColor" d="M3 4h2v14h16v2H3zm6 10H7v2h2zm2-2v2H9v-2zm2 0v-2h-2v2zm2 0h-2v2h2zm2-2h-2v2h2zm2-2v2h-2V8zm0 0V6h2v2z"/>',hidden:!0},"trending-down":{body:'<path fill="currentColor" d="M2 8h2v2h2v2h2v2h2v-2h2v-2h2v2h2v2h2v2h-4v2h8v-8h-2v4h-2v-2h-2v-2h-2V8h-2v2h-2v2H8v-2H6V8H4V6H2z"/>',hidden:!0},"trending-up":{body:'<path fill="currentColor" d="M4 18H2v-2h2zm2-2H4v-2h2zm8 0h-2v-2h2zm-6-2H6v-2h2zm4 0h-2v-2h2zm4 0h-2v-2h2zm6-8v8h-2v-4h-2V8h-4V6zm-12 6H8v-2h2zm8 0h-2v-2h2z"/>'},trophy:{body:'<path fill="currentColor" d="M16 17h-3v2h2v2H9v-2h2v-2H8v-2h8zm2-12h4v6h-2V7h-2v4h2v2h-2v2h-2V5H8v10H6v-2H4v-2h2V7H4v4H2V5h4V3h12z"/>'},"trophy-sharp":{body:'<path fill="currentColor" d="M18 5h4v8h-4v4h-5v2h2v2H9v-2h2v-2H6v-4H2V5h4V3h12zM8 15h8V5H8zm-4-4h2V7H4zm14 0h2V7h-2z"/>'},truck:{body:'<g fill="currentColor"><path d="M2 4h12v2H2zM0 16h4v2H0zm10 0h4v2h-4zm12-4h2v6h-2zm-8-6h2v12h-2zM0 6h2v10H0zm20 4h2v2h-2z"/><path d="M14 8h6v2h-6zM4 14h6v2H4zm10 0h6v2h-6zM4 16h2v2H4zm10 0h2v2h-2zM4 18h6v2H4zm10 0h6v2h-6zm-6-2h2v2H8zm10 0h4v2h-4z"/></g>'},"truck-sharp":{body:'<g fill="currentColor"><path d="M0 4h14v2H0zm0 12h4v2H0zm10 0h4v2h-4zm12-4h2v6h-2zm-8-8h2v14h-2zM0 6h2v10H0zm20 4h2v2h-2z"/><path d="M14 8h6v2h-6zM4 14h6v2H4zm10 0h6v2h-6zM4 16h2v2H4zm10 0h2v2h-2zM4 18h6v2H4zm10 0h6v2h-6zm-6-2h2v2H8zm10 0h4v2h-4z"/></g>'},tv:{body:'<path fill="currentColor" d="M4 3h16v2H4zM2 5h2v10H2zm2 10h16v2H4zM20 5h2v10h-2zM6 19h12v2H6zm3-2h2v2H9zm4 0h2v2h-2z"/>'},"tv-sharp":{body:'<path fill="currentColor" d="M2 3h20v2H2zm0 2h2v10H2zm0 10h20v2H2zM20 5h2v10h-2zM6 19h12v2H6zm3-2h2v2H9zm4 0h2v2h-2z"/>'},"twitter-bird":{body:'<path fill="currentColor" d="M14 21H6v-2h8zm-8-2H2v-2h4zm10 0h-2v-2h2zm-8-2H6v-2h2zm10 0h-2v-3h2zM6 15H4v-2h2zm14-1h-2v-2h2zM4 5h2v2H4v6H2V3h2zm14 3h4v4h-2v-2h-4V5h2zm-7 1H6V7h3V5h2zm5-4h-5V3h5z"/>'},"twitter-bird-solid":{body:'<path fill="currentColor" d="M14 21H6v-2H2v-2h4v-2H4v-2H2V3h2v2h2v2h3V5h2V3h5v2h2v3h4v4h-2v2h-2v3h-2v2h-2z"/>'},undo:{body:'<path fill="currentColor" d="M18 20h-6v-2h6zm2-2h-2v-8h2zm-10-4H8v-2H6v-2H4V8h2V6h2V4h2v4h8v2h-8z"/>'},"undo-sharp":{body:'<path fill="currentColor" d="M10 14H8v-2H6v-2H4V8h2V6h2V4h2v4h10v12h-8v-2h6v-8h-8z"/>'},ungroup:{body:'<path fill="currentColor" d="M7 3H3v4h4zm0 14H3v4h4zM17 3h4v4h-4zm4 14h-4v4h4zM8 8h2v2H8zm4 2h-2v4H8v2h2v-2h4v2h2v-2h-2v-4h2V8h-2v2z"/>',hidden:!0},university:{body:'<path fill="currentColor" d="M1 10h2v10H1zm2 10h18v2H3zm18-10h2v10h-2zM3 8h4v2H3zm14 0h4v2h-4zM7 6h2v2H7zm2-2h2v2H9zm2-2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm-4 2h2v2h-2zm-2 2h2v2H9zm2 2h2v2h-2zm2-2h2v2h-2zm-8 3h2v2H5zm0 4h2v2H5zm12 0h2v2h-2zm0-4h2v2h-2zm-8 5h2v2H9zm0-2h6v2H9zm4 2h2v2h-2z"/>'},"university-sharp":{body:'<path fill="currentColor" d="M1 10h2v10H1zm0 10h22v2H1zm20-10h2v10h-2zM1 8h6v2H1zm16 0h6v2h-6zM7 6h2v2H7zm2-2h2v2H9zm2-2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm-4 2h2v2h-2zm-2 2h2v2H9zm2 2h2v2h-2zm2-2h2v2h-2zm-8 3h2v2H5zm0 4h2v2H5zm12 0h2v2h-2zm0-4h2v2h-2zm-8 5h2v2H9zm0-2h6v2H9zm4 2h2v2h-2z"/>'},unlink:{body:'<path fill="currentColor" d="M4 6h5v2H4zm11 0h5v2h-5zm0 10h5v2h-5zM4 16h5v2H4zm16-8h2v8h-2zM2 8h2v8H2zm9-4h2v16h-2z"/>'},"unlink-sharp":{body:'<path fill="currentColor" d="M4 6h5v2H4zm11 0h5v2h-5zm0 10h5v2h-5zM4 16h5v2H4zM20 6h2v12h-2zM2 6h2v12H2zm9-2h2v16h-2z"/>'},unlock:{body:'<path fill="currentColor" d="M5 8h14v2H5zm0 12h14v2H5zM3 10h2v10H3zm16 0h2v10h-2zM7 4h2v4H7zm2-2h6v2H9zm6 2h2v2h-2z"/>'},"unlock-sharp":{body:'<path fill="currentColor" d="M3 8h18v2H3zm0 12h18v2H3zm0-10h2v10H3zm16 0h2v10h-2zM7 4h2v4H7zm0-2h10v2H7zm8 2h2v2h-2z"/>'},upload:{body:'<path fill="currentColor" d="M19 21H5v-2h14zM5 19H3v-4h2zm16 0h-2v-4h2zM13 5h2v2h2v2h-4v8h-2V9H7V7h2V5h2V3h2z"/>'},"upload-sharp":{body:'<path fill="currentColor" d="M5 19h14v-4h2v6H3v-6h2zm8-14h2v2h2v2h-4v8h-2V9H7V7h2V5h2V3h2z"/>'},usb:{body:'<path fill="currentColor" d="M19 22H5v-2h14zM7 13h10V4h2v9h2v7h-2v-5H5v5H3v-7h2V4h2zm4-2H9V6h2zm4 0h-2V6h2zm2-7H7V2h10z"/>'},"usb-glyph":{body:'<path fill="currentColor" d="M21 22H3v-7h18zm-2-9H5V2h14zM9 11h2V6H9zm4 0h2V6h-2z"/>'},"usb-sharp":{body:'<path fill="currentColor" d="M19 13h2v9H3v-9h2V2h14zM5 20h14v-5H5zm2-7h10V4H7zm4-2H9V6h2zm4 0h-2V6h2z"/>'},"usb-solid":{body:'<path fill="currentColor" d="M21 20h-2v2H5v-2H3v-5h18zM17 4h2v9H5V4h2V2h10zm-8 7h2V6H9zm4 0h2V6h-2z"/>'},user:{body:'<path fill="currentColor" d="M9 2h6v2H9zm0 8h6v2H9zm6-6h2v6h-2zM7 4h2v6H7zM4 18h2v4H4zm14 0h2v4h-2zM8 14h8v2H8zm-2 2h2v2H6zm10 0h2v2h-2z"/>'},"user-minus":{body:'<path fill="currentColor" d="M9 2h6v2H9zm0 8h6v2H9zm6-6h2v6h-2zM7 4h2v6H7zM4 18h2v4H4zm4-4h8v2H8zm-2 2h2v2H6zm10 2h6v2h-6z"/>'},"user-minus-sharp":{body:'<path fill="currentColor" d="M16 18h6v2h-6zM7 2h10v2H7zm0 8h10v2H7zm8-6h2v6h-2zM7 4h2v6H7zM4 14h2v8H4zm2 0h8v2H6z"/>'},"user-plus":{body:'<g fill="currentColor"><path d="M9 2h6v2H9zm0 8h6v2H9zm6-6h2v6h-2zM7 4h2v6H7zM4 18h2v4H4zm14 0h2v4h-2zM8 14h8v2H8zm-2 2h2v2H6z"/><path d="M18 16h2v6h-2z"/><path d="M16 18h6v2h-6z"/></g>'},"user-plus-sharp":{body:'<g fill="currentColor"><path d="M18 18h2v4h-2z"/><path d="M18 16h2v6h-2z"/><path d="M16 18h6v2h-6zM7 2h10v2H7zm0 8h10v2H7zm8-6h2v6h-2zM7 4h2v6H7zM4 14h2v8H4zm2 0h8v2H6z"/></g>'},"user-sharp":{body:'<path fill="currentColor" d="M7 2h10v2H7zm0 8h10v2H7zm8-6h2v6h-2zM7 4h2v6H7zM4 14h2v8H4zm14 0h2v8h-2zM6 14h12v2H6z"/>'},"user-x":{body:'<path fill="currentColor" d="M9 2h6v2H9zm0 8h6v2H9zm6-6h2v6h-2zM7 4h2v6H7zM4 18h2v4H4zm16 2h2v2h-2zM8 14h6v2H8zm-2 2h2v2H6zm10 0h2v2h-2zm2 2h2v2h-2zm2-2h2v2h-2zm-4 4h2v2h-2z"/>'},"user-x-sharp":{body:'<path fill="currentColor" d="M20 20h2v2h-2zm-4-4h2v2h-2zm2 2h2v2h-2zm2-2h2v2h-2zm-4 4h2v2h-2zM7 2h10v2H7zm0 8h10v2H7zm8-6h2v6h-2zM7 4h2v6H7zM4 14h2v8H4zm2 0h8v2H6z"/>'},users:{body:'<path fill="currentColor" d="M5 2h6v2H5zm10 0h4v2h-4zM5 10h6v2H5zm10 0h4v2h-4zm4-6h2v6h-2zm-8 0h2v6h-2zM3 4h2v6H3zM0 18h2v4H0zm14 0h2v4h-2zm8 0h2v4h-2zM4 14h8v2H4zm12 0h4v2h-4zM2 16h2v2H2zm10 0h2v2h-2zm8 0h2v2h-2z"/>'},"users-sharp":{body:'<path fill="currentColor" d="M3 2h10v2H3zm12 0h6v2h-6zM3 10h10v2H3zm12 0h6v2h-6zm-4-6h2v6h-2zm8 0h2v6h-2zM3 4h2v6H3zM0 14h2v8H0zm14 0h2v8h-2zm8 0h2v8h-2zM2 14h12v2H2zm16 0h4v2h-4z"/>'},"utility-pole":{body:'<g fill="currentColor"><path d="M11 2h2v20h-2z"/><path d="M1 5h22v2H1zm8 6h2v2H9zm4 0h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2zm2-4h2v2h-2zm-4 0h2v2h-2zM7 3h2v2H7zM3 3h2v2H3zm4 6h2v2H7zM5 7h2v2H5z"/></g>'},vercel:{body:'<path fill="currentColor" d="M3 18h18v-1h2v3H1v-3h2zm2-1H3v-3h2zm16 0h-2v-3h2zM7 14H5v-3h2zm12 0h-2v-3h2zM9 11H7V8h2zm8 0h-2V8h2zm-6-3H9V5h2zm4 0h-2V5h2zm-2-3h-2V3h2z"/>'},"vercel-solid":{body:'<path fill="currentColor" d="M13 5h2v3h2v3h2v3h2v3h2v3H1v-3h2v-3h2v-3h2V8h2V5h2V3h2z"/>'},vibrate:{body:'<path fill="currentColor" d="M8 3h8v2H8zm0 16h8v2H8zM6 5h2v14H6zm10 0h2v14h-2zm-5 11h2v2h-2zm13-9h-2v2h2zM0 7h2v2H0zm22 2h-2v2h2zM2 9h2v2H2zm22 2h-2v2h2zM0 11h2v2H0zm22 2h-2v2h2zM2 13h2v2H2zm22 2h-2v2h2zM0 15h2v2H0z"/>'},"vibrate-sharp":{body:'<path fill="currentColor" d="M6 3h12v2H6zm0 16h12v2H6zM6 5h2v14H6zm10 0h2v14h-2zm-5 11h2v2h-2zm13-9h-2v2h2zM0 7h2v2H0zm22 2h-2v2h2zM2 9h2v2H2zm22 2h-2v2h2zM0 11h2v2H0zm22 2h-2v2h2zM2 13h2v2H2zm22 2h-2v2h2zM0 15h2v2H0z"/>'},video:{body:'<path fill="currentColor" d="M20 17V7h2v10zm-2-2V9h2v6zM2 7h2v10H2zm14 0h2v10h-2zM4 5h12v2H4zm0 12h12v2H4z"/>'},"video-off":{body:'<path fill="currentColor" d="M4 5H2v14h14v-4h2v2h2v2h2V5h-2v2h-2v2h-2V5zm10 12H4V7h10zm-4-6H8V9H6v2h2v2H6v2h2v-2h2v2h2v-2h-2zm0 0V9h2v2z"/>',hidden:!0},"video-sharp":{body:'<path fill="currentColor" d="M20 17V7h2v10zm-2-2V9h2v6zM2 7h2v10H2zm14 0h2v10h-2zM2 5h16v2H2zm0 12h16v2H2z"/>'},"view-col":{body:'<path fill="currentColor" d="M2 5h20v14H2zm2 2v10h4V7zm6 0v10h4V7zm6 0v10h4V7z"/>',hidden:!0},"view-list":{body:'<path fill="currentColor" d="M2 5h20v14H2zm2 2v2h16V7zm16 4H4v2h16zm0 4H4v2h16z"/>',hidden:!0},"viewport-narrow":{body:'<path fill="currentColor" d="M10 2H8v4h2V4h4v2h2V2zM8 20v-2h2v2h4v-2h2v4H8zm9-9h5v2h-5v2h-2v-2h-2v-2h2V9h2zm0-2V7h2v2zm0 6h2v2h-2zM2 11h5V9h2v2h2v2H9v2H7v-2H2zm5 4v2H5v-2zm0-6V7H5v2z"/>',hidden:!0},"viewport-wide":{body:'<path fill="currentColor" d="M4 2H2v4h2V4h16v2h2V2zM2 20v-2h2v2h16v-2h2v4H2zm16-9h-5v2h5v2h-2v2h2v-2h2v-2h2v-2h-2V9h-2V7h-2v2h2zm-7 0H6V9h2V7H6v2H4v2H2v2h2v2h2v2h2v-2H6v-2h5z"/>',hidden:!0},visible:{body:'<path fill="currentColor" d="M0 0h2v2H0zm2 2h2v2H2zm18 0h2v2h-2zm2-2h2v2h-2zM2 20h2v2H2zm-2 2h2v2H0zm20-2h2v2h-2zm2 2h2v2h-2zM8 17h8v2H8zm8-2h4v2h-4zm-8 0H4v2h4zm8-8h4v2h-4zM8 7H4v2h4zm12 2h2v2h-2zM4 9H2v2h2zm18 2h2v2h-2zM2 11H0v2h2zm18 2h2v2h-2zM4 13H2v2h2zm4-8h8v2H8zm2 5h4v4h-4z"/>',hidden:!0},volume:{body:'<path fill="currentColor" d="M17 22h-2v-2h-2v-2h2V6h-2V4h2V2h2zm-4-4h-2v-2h2zM11 8v2H9v4h2v2H7V8zm2 0h-2V6h2z"/>'},"volume-1":{body:'<path fill="currentColor" d="M15 22h-2v-2h-2v-2h2V6h-2V4h2V2h2zm-4-4H9v-2h2zM9 8v2H7v4h2v2H5V8zm10 6h-2v-4h2zm-8-6H9V6h2z"/>'},"volume-2":{body:'<path fill="currentColor" d="M13 22h-2v-2H9v-2h2V6H9V4h2V2h2zm-4-4H7v-2h2zm10 0h-4v-2h4zM7 10H5v4h2v2H3V8h4zm14 6h-2V8h2zm-4-2h-2v-4h2zM9 8H7V6h2zm10 0h-4V6h4z"/>'},"volume-3":{body:'<path fill="currentColor" d="M11 22H9v-2H7v-2h2V6H7V4h2V2h2zm8 0h-6v-2h6zm2-2h-2v-2h2zM7 18H5v-2h2zm10 0h-4v-2h4zm6 0h-2V6h2zM5 10H3v4h2v2H1V8h4zm14 6h-2V8h2zm-4-2h-2v-4h2zM7 8H5V6h2zm10 0h-4V6h4zm4-2h-2V4h2zm-2-2h-6V2h6z"/>'},"volume-minus":{body:'<path fill="currentColor" d="M12 2h-2v2H8v2H6v2H2v8h4v2h2v2h2v2h2zM8 18v-2H6v-2H4v-4h2V8h2V6h2v12zm14-7h-8v2h8z"/>',hidden:!0},"volume-plus":{body:'<path fill="currentColor" d="M10 2h2v20h-2v-2H8v-2h2V6H8V4h2zM6 8V6h2v2zm0 8H2V8h4v2H4v4h2zm0 0v2h2v-2zm13-5h3v2h-3v3h-2v-3h-3v-2h3V8h2z"/>',hidden:!0},"volume-vibrate":{body:'<path fill="currentColor" d="M14 2h-2v2h-2v2H8v2H4v8h4v2h2v2h2v2h2zm-4 16v-2H8v-2H6v-4h2V8h2V6h2v12zm8-15h-2v2h2v2h-2v2h2v2h-2v2h2v2h-2v2h2v2h-2v2h2v-2h2v-2h-2v-2h2v-2h-2v-2h2V9h-2V7h2V5h-2z"/>',hidden:!0},"volume-x":{body:'<path fill="currentColor" d="M13 22h-2v-2H9v-2h2V6H9V4h2V2h2zm-4-4H7v-2h2zm-2-8H5v4h2v2H3V8h4zm10.001 5.224h-2v-2H17v-2h-1.999v-2h2v2H19v2h-1.999zm3.999 0h-2v-2h2zm0-4h-2v-2h2zM9 8H7V6h2z"/>'},"volume-x-solid":{body:'<path fill="currentColor" d="M13 22h-2v-2H9v-2H7v-2H3V8h4V6h2V4h2V2h2zm4.001-6.776h-2v-2H17v-2h-1.999v-2h2v2H19v2h-1.999zm3.999 0h-2v-2h2zm0-4h-2v-2h2z"/>'},wall:{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zM4 8h16v2H4zm0 6h16v2H4zM6 4h2v4H6zm2 12h2v4H8zm6-12h2v4h-2zm2 12h2v4h-2zm-5-6h2v4h-2z"/>'},"wall-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zM4 8h16v2H4zm0 6h16v2H4zM6 4h2v4H6zm2 12h2v4H8zm6-12h2v4h-2zm2 12h2v4h-2zm-5-6h2v4h-2z"/>'},wallet:{body:'<g fill="currentColor"><path d="M18 5h2v2h-2zM4 3h14v2H4zM2 5h2v14H2zm2 14h16v2H4zm12-4h6v2h-6zm0-4h6v2h-6zm-2 0h2v6h-2z"/><path d="M20 7h2v12h-2zM4 7h16v2H4z"/></g>'},"wallet-sharp":{body:'<g fill="currentColor"><path d="M18 5h2v2h-2zM2 3h18v2H2zm0 2h2v14H2zm0 14h20v2H2zm14-4h6v2h-6zm0-4h6v2h-6zm-2 0h2v6h-2z"/><path d="M20 7h2v12h-2zM4 7h16v2H4z"/></g>'},wand:{body:'<path fill="currentColor" d="M14 22h-2v-2h2zm6 0h-2v-2h2zM5 19h4v2H3v-6h2zm13 1h-2v-2h2zm4 0h-2v-2h2zm-11-1H9v-3h2zm9-1h-2v-2h2zm-7-2h-2v-3h2zm-5-1H5v-2h3zm3-2H8v-2h3zm4 0h-2v-2h2zm6 0h-2v-2h2zM4 12H2v-2h2zm9-1h-2V9h2zm4 0h-2V9h2zm-2-2h-2V7h2zm4 0h-2V7h2zM6 8H4V6h2zm11-1h-2V5h2zm4 0h-2V5h-2V3h4zM4 6H2V4h2zm4 0H6V4h2zm5-1h-2V3h2zM6 4H4V2h2z"/>'},"wand-solid":{body:'<path fill="currentColor" d="M14 22h-2v-2h2zm6 0h-2v-2h2zm1-15h-2v2h-2v2h-2v2h-2v3h-2v3H9v2H3v-6h2v-2h3v-2h3V9h2V7h2V5h2V3h4zm-3 13h-2v-2h2zm4 0h-2v-2h2zm-2-2h-2v-2h2zm1-5h-2v-2h2zM4 12H2v-2h2zm2-4H4V6h2zM4 6H2V4h2zm4 0H6V4h2zm5-1h-2V3h2zM6 4H4V2h2z"/>'},warehouse:{body:'<g fill="currentColor"><path d="M6 10h12v2H6z"/><path d="M6 10h2v10H6zm2 5h8v2H8zm-6 5h20v2H2zm14-10h2v10h-2z"/><path d="M2 6h2v16H2z"/><path d="M2 6h4v2H2zm4-2h4v2H6zm8 0h4v2h-4zm4 2h4v2h-4zm-8-4h4v2h-4z"/><path d="M20 6h2v16h-2z"/></g>'},"warning-box":{body:'<path fill="currentColor" d="M3 3h16v2H5v14h14v2H3zm18 0h-2v18h2zM11 15h2v2h-2zm2-8h-2v6h2z"/>',hidden:!0},"warning-diamond":{body:'<path fill="currentColor" d="M2 10h2v2H2zm0 4h2v-2H2zm20-4h-2v2h2zm0 4h-2v-2h2zM4 8h2v2H4zm0 8h2v-2H4zm16-8h-2v2h2zm0 8h-2v-2h2zM6 6h2v2H6zm0 12h2v-2H6zM18 6h-2v2h2zm0 12h-2v-2h2zM8 4h2v2H8zm0 16h2v-2H8zm8-16h-2v2h2zm0 16h-2v-2h2zM10 2h2v2h-2zm0 20h2v-2h-2zm4-20h-2v2h2zm0 20h-2v-2h2zm-3-5h2v-2h-2zm0-4h2V7h-2z"/>'},watch:{body:'<path fill="currentColor" d="M15 23h-2v-4h-2v4H9v-6h6zm-6-6H7v-2h2zm8 0h-2v-2h2zM7 15H5V9h2zm12 0h-2V9h2zm-6-4h2v2h-4V9h2zM9 9H7V7h2zm8 0h-2V7h2zm-6-4h2V1h2v6H9V1h2z"/>'},"watch-glyph":{body:'<path fill="currentColor" d="M15 23h-2v-4h-2v4H9v-4H5V5h4V1h2v4h2V1h2v4h4v14h-4zm-4-9h4v-2h-2V9h-2z"/>'},"watch-sharp":{body:'<path fill="currentColor" d="M11 5h2V1h2v4h4v14h-4v4h-2v-4h-2v4H9v-4H5V5h4V1h2zM7 17h10V7H7zm6-5h2v2h-4V9h2z"/>'},"watch-solid":{body:'<path fill="currentColor" d="M15 23h-2v-4h-2v4H9v-6H7v-2H5V9h2V7h2V1h2v4h2V1h2v6h2v2h2v6h-2v2h-2zm-4-10h4v-2h-2V9h-2z"/>'},waves:{body:'<path fill="currentColor" d="M2 18h4v-2H2zm0-6h4v-2H2zm0-6h4V4H2zm4 14h4v-2H6zm0-6h4v-2H6zm0-6h4V6H6zm4 10h4v-2h-4zm0-6h4v-2h-4zm0-6h4V4h-4zm4 14h4v-2h-4zm0-6h4v-2h-4zm0-6h4V6h-4zm4 10h4v-2h-4zm0-6h4v-2h-4zm0-6h4V4h-4z"/>'},"waves-arrow-down":{body:'<g fill="currentColor"><path d="M2 21h4v-2H2zm0-6h4v-2H2zm4 8h4v-2H6zm0-6h4v-2H6zm4 4h4v-2h-4zm4 2h4v-2h-4zm0-6h4v-2h-4zm-4-2h4v-2h-4zm8 6h4v-2h-4zm0-6h4v-2h-4zM11 1h2v10h-2z"/><path d="M9 7h6v2H9zM7 5h10v2H7z"/></g>'},"waves-arrow-up":{body:'<g fill="currentColor"><path d="M2 21h4v-2H2zm0-6h4v-2H2zm4 8h4v-2H6zm0-6h4v-2H6zm4 4h4v-2h-4zm4 2h4v-2h-4zm0-6h4v-2h-4zm-4-2h4v-2h-4zm8 6h4v-2h-4zm0-6h4v-2h-4zm-7-4h2V1h-2z"/><path d="M9 5h6V3H9zM7 7h10V5H7z"/></g>'},webcam:{body:'<path fill="currentColor" d="M4 20h16v-2h2v4H2v-4h2zm2-2H4v-2h2zm10 0H8v-2h8zm4 0h-2v-2h2zM8 16H6v-2h2zm10 0h-2v-2h2zM6 14H4V6h2zm8-6h2v4h-2v2h-4v-2H8V8h2v2h2V8h-2V6h4zm6 6h-2V6h2zM8 6H6V4h2zm10 0h-2V4h2zm-2-2H8V2h8z"/>'},whatsapp:{body:'<path fill="currentColor" d="M4 20h14v2H2V6h2zm16 0h-2v-2h2zm-9-9H9v2h2v2h2v-2h4v5h-7v-1H9v-2H7v-1H6V7h5zm11 7h-2V6h2zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"whatsapp-solid":{body:'<path fill="currentColor" d="M20 4v2h2v12h-2v2h-2v2H2V6h2V4h2V2h12v2zM6 14h1v1h2v2h1v1h7v-5h-4v2h-2v-2H9v-2h2V7H6z"/>'},wifi:{body:'<path fill="currentColor" d="M11 19h2v2h-2zm-4-3h2v2H7zm8 0h2v2h-2zm-6-2h6v2H9zm-5-1h2v2H4zm2-2h2v2H6zm2-2h8v2H8zm-7 1h2v2H1zm20 0h2v2h-2zM3 8h2v2H3zm2-2h2v2H5zm2-2h10v2H7zm12 4h2v2h-2zm-2-2h2v2h-2zm1 7h2v2h-2zm-2-2h2v2h-2z"/>'},wind:{body:'<path fill="currentColor" d="M2 7h10v2H2zm10-4h2v4h-2zM7 1h5v2H7zM2 11h18v2H2zm18-4h2v4h-2zm-4-2h4v2h-4zM2 17h12v-2H2zm12 2h2v-2h-2zm-5 2h5v-2H9z"/>'},"window-frame":{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 6h16v2H4zm0 12h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zM5 5h2v2H5zm3 0h2v2H8z"/>'},"window-frame-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm2 6h16v2H4zM2 20h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zM5 5h2v2H5zm3 0h2v2H8z"/>'},x:{body:'<path fill="currentColor" d="M6 20H4v-2h2zm14-2h2v2h-6v-2h2v-2h2zM8 18H6v-2h2zm8 0h-2v-2h2zm-6-2H8v-2h2zm4 0h-2v-2h2zm4 0h-2v-2h2zm-6-2h-2v-2h2zm4 0h-2v-2h2zm-6-2H8v-2h2zm4 0h-2v-2h2zm-6-2H6V8h2zm4 0h-2V8h2zm4 0h-2V8h2zM8 6H6v2H4V6H2V4h6zm2 2H8V6h2zm8 0h-2V6h2zm2-2h-2V4h2z"/>'},"x-solid":{body:'<path fill="currentColor" d="M6 20H4v-2h2zM8 6h2v2h2v2h2v2h2v2h2v2h2v2h2v2h-6v-2h-2v-2h-2v-2h-2v-2H8v-2H6V8H4V6H2V4h6zm0 12H6v-2h2zm2-2H8v-2h2zm6-6h-2V8h2zm2-2h-2V6h2zm2-2h-2V4h2z"/>'},youtube:{body:'<path fill="currentColor" d="M20 20H4v-2h16zM4 18H2V6h2zm18 0h-2V6h2zM12 9h-2v6h2v2H8V7h4zm3 6h-3v-2h3zm2-2h-2v-2h2zm-2-2h-3V9h3zm5-5H4V4h16z"/>'},"youtube-solid":{body:'<path fill="currentColor" d="M20 6h2v12h-2v2H4v-2H2V6h2V4h16zM8 17h4v-2h3v-2h2v-2h-2V9h-3V7H8z"/>'},zap:{body:'<path fill="currentColor" d="M4 13h8v6h2v2h-2v2h-2v-8H2v-4h2zm12 6h-2v-2h2zm2-2h-2v-2h2zm2-2h-2v-2h2zm-6-6h8v4h-2v-2h-8V5h-2V3h2V1h2zm-8 2H4V9h2zm2-2H6V7h2zm2-2H8V5h2z"/>'},"zap-off":{body:'<g fill="currentColor"><path d="M10 13h2v10h-2z"/><path d="M2 13h10v2H2zM12 1h2v6h-2zm4 8h6v2h-6zm4 2h2v2h-2zm-4 4h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2h-2zM2 11h2v2H2zm2-2h2v2H4zm2-2h2v2H6zm4-4h2v2h-2zM2 1h2v2H2zm2 2h2v2H4zm2 2h2v2H6zm2 2h2v2H8zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2z"/><path d="M16 15h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2z"/></g>'},"zoom-in":{body:'<path fill="currentColor" d="M22 22h-2v-2h2zm-2-2h-2v-2h2zm-6-2H6v-2h8zm4 0h-2v-2h2zM6 16H4v-2h2zm10 0h-2v-2h2zM4 14H2V6h2zm7-5h3v2h-3v3H9v-3H6V9h3V6h2zm7 5h-2V6h2zM6 6H4V4h2zm10 0h-2V4h2zm-2-2H6V2h8z"/>'},"zoom-out":{body:'<path fill="currentColor" d="M22 22h-2v-2h2zm-2-2h-2v-2h2zm-6-2H6v-2h8zm4 0h-2v-2h2zM6 16H4v-2h2zm10 0h-2v-2h2zM4 14H2V6h2zm14 0h-2V6h2zm-4-5v2H6V9zM6 6H4V4h2zm10 0h-2V4h2zm-2-2H6V2h8z"/>'}},aliases:{dashbaord:{parent:"dashboard"},"sort-alpabetic":{parent:"sort-alphabetic"}},lastModified:1787067615,width:24,height:24};function _Zi(e,t){return function(n,o){let r=e.domElement;r.__threeScene=n,r.__threeCamera=o,r.__threeRenderer=e,Object.assign(window,{__lastThreeScene:n,__lastThreeCamera:o}),t.call(e,n,o)}}function wro(){let e=d3.prototype;if(e.__fusiblePatched)return;Object.defineProperty(e,"render",{configurable:!0,set(t){Object.defineProperty(this,"render",{value:_Zi(this,t),writable:!0,configurable:!0})}}),e.__fusiblePatched=!0}function ene(e){if(!e)return null;let n=Array.from(e.querySelectorAll("canvas")).filter((o)=>o.__threeScene&&o.clientWidth*o.clientHeight>0);return n.sort((o,r)=>r.clientWidth*r.clientHeight-o.clientWidth*o.clientHeight),n[0]??null}var Bro=0.001,yBe=new WeakMap;function Tro(e){return new Eu().setFromUnitVectors(e.clone().normalize(),new Et(0,1,0))}function cme(e,t,n){let o=e.clone().sub(t).applyQuaternion(Tro(n)),{radius:r,phi:i,theta:s}=new gw().setFromVector3(o),a=t2.clamp(i,Bro,Math.PI-Bro);return{target:t.clone(),radius:r,polar:a,azimuth:s}}function Bmt(e,t){return new Et().setFromSphericalCoords(e.radius,e.polar,e.azimuth).applyQuaternion(Tro(t).invert()).add(e.target)}function gZi(e,t,n){let o=n<0.5?4*n*n*n:1-Math.pow(-2*n+2,3)/2,r=t2.euclideanModulo(t.azimuth-e.azimuth+Math.PI,Math.PI*2)-Math.PI;return{target:e.target.clone().lerp(t.target,o),radius:t2.lerp(e.radius,t.radius,o),polar:t2.lerp(e.polar,t.polar,o),azimuth:e.azimuth+r*o}}function Tmt(e,t,n,o,r=600){cancelAnimationFrame(yBe.get(e)??0);let i=performance.now(),s=()=>{let a=Math.min(1,(performance.now()-i)/r);if(o(gZi(t,n,a)),a<1)yBe.set(e,requestAnimationFrame(s));else yBe.delete(e)};yBe.set(e,requestAnimationFrame(s))}function Dro(e,t,n,o,r=600){let i=e.camera.up,s=new Et(...n),a=cme(new Et(...t).add(s),s,i);a.radius=o;let c=cme(e.camera.position,e.controls.target,i);Tmt(e.camera,c,a,(l)=>{e.camera.position.copy(Bmt(l,i)),e.controls.target.copy(l.target),e.controls.update()},r)}var ME={TOP:[0,0,1],ISO:[-1,-1,1],FRONT:[0,-1,0.1],RESET:[-1,-1,1]},Dmt=new Et(0,0,1);function AZi(e,t){let n=e.getWorldDirection(new Et),o=Math.max(0.001,t.clone().sub(e.position).dot(n));return e.position.clone().addScaledVector(n,o)}function Nro(e,t,n){let o=ene(e)?.__threeCamera;if(!o){t.animateToPreset(n==="TOP"?"Top Down":n==="FRONT"?"Front":"Top Left Corner");return}let r=new Et(0,0,0),i=AZi(o,r),s=cme(o.position,i,Dmt),a=cme(new Et(...ME[n]),r,Dmt);a.radius=s.radius,Tmt(o,s,a,(c)=>{let l=Bmt(c,Dmt),h=[c.target.x,c.target.y,c.target.z];t.animateTo({position:[l.x,l.y,l.z],target:h,up:[0,0,1],durationMs:0})})}function fZi(e){let t=new Mu().setFromObject(e.content);return t.isEmpty()?new v_(new Et,50):t.getBoundingSphere(new v_)}function yZi(e,t){let n=t2.degToRad(e.camera.fov)/2,o=Math.atan(Math.tan(n)*Math.max(e.camera.aspect,0.001));return t*1.2/Math.sin(Math.min(n,o))}function pH(e,t,n){Nmt(e,t,fZi(e),n)}function Nmt(e,t,n,o){let r=[n.center.x,n.center.y,n.center.z];Dro(e,t,r,yZi(e,n.radius),o)}function tne(e){return e instanceof Error&&e.message?e.message:String(e)}async function mH(e,t){let n=`${t} (HTTP ${e.status})`;try{let o=await e.json(),r=typeof o==="object"&&o!==null?o.error:void 0;return typeof r==="string"&&r?r:n}catch{return n}}async function Rmt(e){return(await new pte().parseAsync(e,"")).scene}async function xBe(e){let t=await Rmt(e),n=[];return t.updateMatrixWorld(!0),t.traverse((o)=>{if(!(o instanceof Mo))return;let r=o.geometry.clone().applyMatrix4(o.matrixWorld);n.push({node:o,geometry:r})}),n}function rl(e){return getComputedStyle(document.documentElement).getPropertyValue(`--${e}`).trim()}function ig(e){return parseInt(rl(e).replace("#",""),16)}function CBe(e,t,n){let o=new Qz(e,t);return o.position.set(...n),o}function xZi(e,t){let n=new eie(ig("light"),ig("stage-ground"),0.6);n.position.set(0,0,1),e.add(new kz(ig("light"),0.25),n),e.add(CBe(ig("light"),1.25,[70,-80,130])),e.add(CBe(ig("light-fill"),0.5,[-80,70,50])),e.add(CBe(ig("light"),0.85,[40,-50,-110])),t.add(CBe(ig("light"),0.7,[0,0,1])),e.add(t)}function CZi(){let e=new zQe(400,80,ig("grid-major"),ig("edge"));return e.rotation.x=Math.PI/2,e.position.z=-0.05,e}function bBe(e){let t=new d3({antialias:!0,alpha:!0});t.setPixelRatio(window.devicePixelRatio||1),t.toneMapping=DAe,t.toneMappingExposure=1.05,t.domElement.style.display="block",e.appendChild(t.domElement);let n=new Dy;n.background=new No(ig("bg"));let o=new Pc(45,1,0.1,5000);o.up.set(0,0,1),o.position.set(-120,-120,120);let r=new eMe(o,t.domElement);r.enableDamping=!0,r.dampingFactor=0.05,xZi(n,o);let i=CZi(),s=new Ba;return n.add(i,s),{host:e,renderer:t,scene:n,camera:o,controls:r,content:s,grid:i}}function nne(e){let t=e.host.clientWidth,n=e.host.clientHeight;if(!t||!n)return!1;if(e.renderer.domElement.width!==Math.round(t*e.renderer.getPixelRatio())||e.camera.aspect!==t/n)e.camera.aspect=t/n,e.camera.updateProjectionMatrix(),e.renderer.setSize(t,n);return!0}function Rro(e){e.controls.dispose(),e.renderer.dispose(),e.renderer.forceContextLoss(),e.renderer.domElement.remove()}var bZi="collision:",IZi=0.6;async function Qro(){let e=await fetch("/api/assembly");if(!e.ok)throw Error(await mH(e,"ASSEMBLY UNAVAILABLE"));return e.json()}function vZi(){return new Up({color:ig("alert"),transparent:!0,opacity:IZi,depthTest:!1,depthWrite:!1,side:bd})}function SZi(e){e.traverse((t)=>{if(!(t instanceof Mo))return;t.material=vZi(),t.renderOrder=10})}function PZi(e){let t=new Map;return e.traverse((n)=>{if(!n.name.startsWith(bZi)||t.has(n.name))return;t.set(n.name,n),SZi(n)}),t}async function kro(e){let t=await fetch(e);if(!t.ok)throw Error(await mH(t,"ASSEMBLY PREVIEW UNAVAILABLE"));let n=await Rmt(await t.arrayBuffer());return{url:e,root:n,collisions:PZi(n)}}function Lro(e,t){let n=e.collision?t.collisions.get(e.collision):void 0,o=n?new Mu().setFromObject(n):new Mu;if(!o.isEmpty())return o.getBoundingSphere(new v_);if(!e.at)return null;return new v_(new Et(...e.at),0)}function IBe(e){let t=ig("alert");e.collisions.forEach((n)=>n.traverse((o)=>{if(!(o instanceof Mo))return;[o.material].flat().forEach((r)=>{if(r instanceof Up&&r.color.getHex()!==t)r.color.setHex(t)})}))}function EZi(e){Object.values(e).forEach((t)=>{if(t instanceof vl)t.dispose()}),e.dispose()}function lme(e){e.root.traverse((t)=>{if(!(t instanceof Mo))return;t.geometry.dispose(),[t.material].flat().forEach(EZi)})}function Qmt(e){if(e.framed||!e.preview||!nne(e.stage))return;e.framed=!0,pH(e.stage,ME.ISO,1)}var Hro=0;function Fro(e){zro(e,++Hro)}function zro(e,t){let n=e();if(t!==Hro||!n?.active)return;if(requestAnimationFrame(()=>zro(e,t)),!nne(n.stage))return;if(Qmt(n),n.preview)IBe(n.preview);n.stage.controls.update(),n.stage.renderer.render(n.stage.scene,n.stage.camera)}function kmt(e){if(e.preview)lme(e.preview);e.stage.content.clear(),e.preview=null,e.framed=!1}function Oro(e){let t=document.createElement("div");t.className="empty-state assembly-status";let n=document.createElement("div");return n.className="assembly-list",n.hidden=!0,e.append(t,n),{status:t,list:n}}function MZi(){let e=document.createElement("button");return e.className="btn assembly-build",e.innerHTML='<iconify-icon icon="pixelarticons:layers"></iconify-icon> <span>BUILD ASSEMBLY</span>',e.addEventListener("click",()=>window.Project?.startRun("assembly")),e}function one(e,t,n=!1){if(e.status.replaceChildren(document.createTextNode(t)),t&&n)e.status.append(MZi());e.status.style.display=t?"flex":"none"}function wZi(e,t){let n=document.createElement("button");n.className="assembly-item";let o=document.createElement("span");o.className="assembly-rule",o.textContent=e.rule.toUpperCase();let r=document.createElement("span");return r.textContent=e.message,n.append(o,r),n.addEventListener("click",()=>t(e)),n}function BZi(e){let t=document.createElement("div");t.className="assembly-head";let n=e.violations.length,o=n===1?"VIOLATION":"VIOLATIONS";return t.textContent=e.fuse==="blown"?`FUSE BLOWN, ${n} ${o}`:"FUSE INTACT",t.classList.toggle("is-blown",e.fuse==="blown"),t}function Lmt(e,t,n){if(e.list.hidden=!t,!t)return;e.list.replaceChildren(BZi(t),...t.violations.map((o)=>wZi(o,n)))}function Vro(e,t){e.list.querySelectorAll(".assembly-item").forEach((n,o)=>n.classList.toggle("active",o===t))}var TZi=15,Yro="REPORT UNREADABLE",sg=null,Hmt=0;function Gro(e){if(!sg?.preview)return;let t=sg.overview?.report?.violations.indexOf(e)??-1;Vro(sg.panel,t);let n=Lro(e,sg.preview);if(!n)return;n.radius=Math.max(n.radius,TZi),Nmt(sg.stage,ME.ISO,n,600)}function DZi(e,t,n){if(n&&n!==e.preview){if(e.preview)lme(e.preview);e.stage.content.clear(),e.stage.content.add(n.root),e.preview=n,e.framed=!1}if(e.preview)IBe(e.preview);e.overview=t,Lmt(e.panel,t.report,Gro),one(e.panel,t.report?"":Yro,!t.report),Qmt(e)}function NZi(e,t){if(kmt(e),e.overview=t,Lmt(e.panel,null,Gro),t.report_error)return one(e.panel,Yro,!0);if(!t.declared)return one(e.panel,"NO ASSEMBLY IN fusible.yml");one(e.panel,"NO ASSEMBLY PREVIEW YET",!0)}async function Uro(){let e=sg;if(!e)return;let t=++Hmt;try{let n=await Qro(),o=n.model,r=o&&o===e.preview?.url?e.preview:o?await kro(o):null;if(t!==Hmt){if(r&&r!==e.preview)lme(r);return}if(r)DZi(e,n,r);else NZi(e,n)}catch(n){if(t===Hmt)one(e.panel,tne(n),!0)}}function Wro(e){if(!sg||sg.stage.host!==e){if(sg)kmt(sg),Rro(sg.stage);e.replaceChildren(),sg={stage:bBe(e),panel:Oro(e),preview:null,overview:null,active:!1,framed:!1}}let t=sg.active;if(sg.active=!0,Uro(),!t)Fro(()=>sg)}function Xro(){if(sg)sg.active=!1}function jro(){if(sg?.active)Uro()}function Kro(e){if(sg?.preview)pH(sg.stage,ME[e],600)}var $ro={renderAssemblyViewer:Wro,hideAssemblyViewer:Xro,refreshAssembly:jro,assemblyCameraPreset:Kro};async function qro(e,t){let n=await fetch(`/api/bodies/${encodeURIComponent(e)}.glb?rev=${t}`,{cache:"no-store"});if(!n.ok)throw Error(await mH(n,"BODY MODEL UNAVAILABLE"));return(await xBe(await n.arrayBuffer())).map((r)=>r.geometry)}function RZi(e){if(Array.isArray(e))return e;let t=e?.circuit_json;return Array.isArray(t)?t:[]}function QZi(e){let t=RZi(e).find((c)=>c.type==="pcb_board");if(!t)return[];if(t.outline&&t.outline.length>=3)return t.outline.map((c)=>[c.x,c.y]);let{width:n,height:o}=t;if(!n||!o)return[];let{x:r,y:i}=t.center??{x:0,y:0},[s,a]=[n/2,o/2];return[[r-s,i-a],[r+s,i-a],[r+s,i+a],[r-s,i+a]]}async function Jro(e){if(!e)return[];try{let t=await fetch(`/api/circuit?board=${encodeURIComponent(e)}`,{cache:"no-store"});return t.ok?QZi(await t.json()):[]}catch{return[]}}function Zro(e){let t=new js().setFromPoints(e.map(([o,r])=>new Et(o,r,0))),n=new qre(t,new n2({color:ig("green")}));return n.name="board-outline",n}var Fmt=new Set,zmt=new Set,AU=null,eio="",PBe=0,rne=null,tio={status:"idle"},vBe=null;function SBe(e){if(tio=e,Fmt.forEach((n)=>n(e)),e.status==="loading")return;let t=e.status==="ready"?e.model:null;if(vBe&&vBe!==t)vBe.geometries.forEach((n)=>n.dispose());vBe=t}function Omt(){if(AU===null||!zmt.size)return;let e=AU,t=eio,n=`${e}|${t}|${PBe}`;if(rne===n)return;rne=n,SBe({status:"loading"}),Promise.all([qro(e,PBe),Jro(t)]).then(([o,r])=>{if(rne===n)SBe({status:"ready",model:{key:n,name:e,geometries:o,outline:r}});else o.forEach((i)=>i.dispose())},(o)=>{if(rne===n)SBe({status:"error",error:tne(o)})})}function nio(e,t,n=""){if(AU=e!==null&&t==="authored"?e:null,eio=AU===null?"":n,PBe++,rne=null,AU===null)SBe({status:"idle"});Omt()}function oio(){return AU!==null}function rio(){if(AU===null)return;PBe++,rne=null,Omt()}function Vmt(e,t){if(t)zmt.add(e);else zmt.delete(e);Omt()}function iio(e){return Fmt.add(e),e(tio),()=>Fmt.delete(e)}var Ymt={lid:!0,explode:!1,overlay:!1},hme={...Ymt};function sio(e){return`fusible:mechanical:${e}`}function aio(){for(let e of Object.keys(Ymt))try{let t=localStorage.getItem(sio(e));if(t==="1"||t==="0")hme[e]=t==="1"}catch{hme[e]=Ymt[e]}return{...hme}}function fU(e){return hme[e]}function EBe(e,t){hme[e]=t;try{localStorage.setItem(sio(e),t?"1":"0")}catch{return}}var kZi={base:{color:"part-base",opacity:0.16},lid:{color:"olive",opacity:0.1}},LZi={solid:"edge",overlay:"green"};function HZi(e,t){let{color:n,opacity:o}=kZi[e],r=ig(n),i=t==="overlay";return new vs({color:r,roughness:0.72,metalness:0.05,side:bd,transparent:i,opacity:i?o:1,depthWrite:!i})}function FZi(e){let t=e==="overlay";return new n2({color:ig(LZi[e]),transparent:t,opacity:t?0.55:1,depthWrite:!t})}function cio(e){return e.raycast=()=>{return},e}function MBe(e,t,n){let o=new Ba;o.name=`mechanical-${t}`;let r=HZi(t,n),i=FZi(n),s=[];for(let c of e){let l=new Zre(c,30);s.push(l),o.add(cio(new Mo(c,r))),o.add(cio(new u3(l,i)))}return{group:o,dispose:()=>{s.forEach((c)=>c.dispose()),r.dispose(),i.dispose()}}}function wBe(e,t){let n=new Ba;n.name=`mechanical-${t}`;let o=MBe(e.parts.base,"base",t),r=MBe(e.parts.lid,"lid",t);if(n.add(o.group,r.group),t==="overlay")n.renderOrder=10;return{root:n,parts:{base:o.group,lid:r.group},dispose:()=>{n.removeFromParent(),o.dispose(),r.dispose()}}}function BBe(e,t,n,o){e.parts.lid.visible=n,e.parts.lid.position.z=o?Math.max(12,t.meta.size[2]):0}function zZi(e){let t=e;while(t&&t.name!=="lid"&&t.name!=="base")t=t.parent;return t?.name==="lid"?"lid":"base"}async function lio(e,t){let n=`rev=${encodeURIComponent(e)}&board=${encodeURIComponent(t)}`,o="MECHANICAL MODEL UNAVAILABLE",r=await fetch(`/api/mechanical?${n}`);if(!r.ok)throw Error(await mH(r,"MECHANICAL MODEL UNAVAILABLE"));let i=await r.json(),s=await fetch(`/api/mechanical.glb?${n}`);if(!s.ok)throw Error(await mH(s,"MECHANICAL MODEL UNAVAILABLE"));let a={base:[],lid:[]};for(let{node:c,geometry:l}of await xBe(await s.arrayBuffer()))a[zZi(c)].push(l);return{revision:e,meta:i,parts:a}}var Wmt=new Set,Xmt=new Set,ine=null,NBe="",hio={status:"idle"},DBe=null,TBe=null;function Gmt(e){if(hio=e,Wmt.forEach((n)=>n(e)),e.status==="loading")return;let t=e.status==="ready"?e.model:null;if(TBe&&TBe!==t)dio(TBe);TBe=t}function Umt(){return ine===null?null:`${NBe}|${ine}`}function dio(e){Object.values(e.parts).flat().forEach((t)=>t.dispose())}function uio(){let e=Umt();if(!Xmt.size||ine===null||e===null||DBe===e)return;let t=ine;DBe=e,Gmt({status:"loading"}),lio(t,NBe).then((n)=>Umt()===e?Gmt({status:"ready",model:n}):dio(n),(n)=>{if(Umt()!==e)return;DBe=null,Gmt({status:"error",error:tne(n)})})}function pio(e,t=""){if(e===ine&&t===NBe)return;ine=e,NBe=t,DBe=null,uio()}function dme(e,t){if(t)Xmt.add(e);else Xmt.delete(e);uio()}function RBe(e){return Wmt.add(e),e(hio),()=>Wmt.delete(e)}var _H={display:null,model:null},jmt=null,QBe=null,mio=0,Kmt=!1;function _io(){_H.display?.dispose(),_H={display:null,model:null}}function OZi(e,t){if(_H.model!==e){_io();let n=e.meta.board_z+e.meta.board_thickness/2,o=wBe(e,"overlay");o.root.matrixAutoUpdate=!1,o.root.matrix.makeTranslation(0,0,-n),_H={display:o,model:e}}if(!_H.display)return;if(BBe(_H.display,e,fU("lid"),!1),_H.display.root.parent!==t)t.add(_H.display.root)}function ume(){let e=ene(jmt)?.__threeScene??null;if(Kmt&&QBe&&e)OZi(QBe,e);else _io()}function VZi(e){QBe=e.status==="ready"?e.model:e.status==="loading"?QBe:null,ume()}function gio(e,t,n){jmt=n??jmt,EBe("overlay",e);let o=e&&t;if(o!==Kmt)window.clearInterval(mio),mio=o?window.setInterval(ume,300):0;Kmt=o,dme("overlay",o),ume()}RBe(VZi);function Aio(e,t){let n=MBe(e,"base","solid");n.group.name="authored-body";let o=t.length>=3?Zro(t):null;if(o)n.group.add(o);return{root:n.group,dispose:()=>{o?.geometry.dispose(),o?.material?.dispose(),n.group.removeFromParent(),n.dispose()}}}function fio(e){e.innerHTML="";let t=document.createElement("div");return t.className="empty-state mechanical-status",e.appendChild(t),{stage:bBe(e),status:t,display:null,model:null,authored:null,authoredModel:null,attached:null,active:!1,framed:!1}}function $mt(e,t){if(e.authoredModel===t)return;e.authored?.dispose(),e.authoredModel=t,e.authored=Aio(t.geometries,t.outline)}function yio(e){e.authored?.dispose(),e.authored=null,e.authoredModel=null}function xio(e,t){let n=t==="authored"?e.authored?.root:e.display?.root;if(e.stage.content.clear(),!n){e.attached=null;return}if(e.stage.content.add(n),e.attached!==t)e.framed=!1;e.attached=t,YZi(e)}function YZi(e){if(!e.framed&&nne(e.stage))e.framed=!0,pH(e.stage,ME.ISO,1)}function qmt(e){let t=e();if(!t?.active)return;if(requestAnimationFrame(()=>qmt(e)),!nne(t.stage))return;t.stage.controls.update(),t.stage.renderer.render(t.stage.scene,t.stage.camera)}var GZi={idle:"WAITING FOR CIRCUIT...",loading:"GENERATING MECHANICAL MODEL...",error:"",ready:""},UZi={idle:"SELECT A BODY",loading:"LOADING BODY MODEL...",error:"",ready:""},WZi=["btn-mechanical-lid","btn-mechanical-explode"],Al=null,Cio={status:"idle"},bio={status:"idle"};function Iio(e,t){if(e.model===t)return;e.display?.dispose(),e.model=t,e.display=wBe(t,"solid"),Zmt()}function Jmt(){if(!Al)return;let e=oio();xio(Al,e?"authored":"generated");let t=e?bio:Cio,n=e?UZi:GZi,o=t.status==="error"?t.error:n[t.status];Al.status.textContent=o,Al.status.style.display=o?"flex":"none",dme("tab",Al.active&&!e),Vmt("tab",Al.active&&e);for(let r of WZi){let i=document.getElementById(r);if(i)i.style.display=e?"none":""}}function XZi(e){if(Cio=e,!Al)return;if(e.status==="ready")Iio(Al,e.model);if(e.status==="error")Al.display?.dispose(),Al.display=null,Al.model=null;Jmt()}function jZi(e){if(bio=e,!Al)return;if(e.status==="ready")$mt(Al,e.model);if(e.status==="error"||e.status==="idle")yio(Al);Jmt()}function vio(e){let t=!Al;if(!Al||Al.stage.host!==e)Al=fio(e);if(t)RBe(XZi),iio(jZi);let n=Al.active;if(Al.active=!0,!n)rio();if(Al.model)Iio(Al,Al.model);if(Al.authoredModel)$mt(Al,Al.authoredModel);if(Jmt(),!n)qmt(()=>Al)}function Sio(){if(Al)Al.active=!1;dme("tab",!1),Vmt("tab",!1)}function Zmt(){if(!Al?.display||!Al.model)return;BBe(Al.display,Al.model,fU("lid"),fU("explode"))}function Pio(e){if(Al?.stage.content.children.length)pH(Al.stage,ME[e],600)}function KZi(e){let t=!fU(e);return EBe(e,t),Zmt(),ume(),t}var Eio={renderMechanicalViewer:vio,hideMechanicalViewer:Sio,mechanicalCameraPreset:Pio,setMechanicalRevision:pio,setMechanicalBody:nio,setMechanicalOverlay:gio,toggleMechanicalOption:KZi,getMechanicalOptions:aio};var wio=at(ln());function wE(e,t){if(!t)return"";if(!Array.isArray(e))return t;let n=e.find((s)=>s.type==="source_component"&&(s.name===t||s.source_component_id===t));if(n?.name)return n.name;let o=e.find((s)=>s.type==="schematic_component"&&(s.schematic_component_id===t||s.source_component_id===t));if(o?.source_component_id){let s=e.find((a)=>a.type==="source_component"&&a.source_component_id===o.source_component_id);if(s?.name)return s.name}let r=e.find((s)=>s.type==="pcb_component"&&(s.pcb_component_id===t||s.source_component_id===t));if(r?.source_component_id){let s=e.find((a)=>a.type==="source_component"&&a.source_component_id===r.source_component_id);if(s?.name)return s.name}let i=e.find((s)=>s.type==="cad_component"&&(s.cad_component_id===t||s.source_component_id===t||s.pcb_component_id===t));if(i?.source_component_id){let s=e.find((a)=>a.type==="source_component"&&a.source_component_id===i.source_component_id);if(s?.name)return s.name}if(i?.pcb_component_id){let s=e.find((a)=>a.type==="pcb_component"&&a.pcb_component_id===i.pcb_component_id);if(s?.source_component_id){let a=e.find((c)=>c.type==="source_component"&&c.source_component_id===s.source_component_id);if(a?.name)return a.name}}return t}function Mio(e,t){let n=t,o="",r="",i="",s="";while(n){if(n.visible===!1)return"";if(n.userData?.isReferenceObject)return"";if(!o&&n.userData?.pcb_component_id)o=n.userData.pcb_component_id;if(!r&&n.userData?.cad_component_id)r=n.userData.cad_component_id;if(!i&&n.userData?.source_component_id)i=n.userData.source_component_id;if(!s&&n.userData?.refdes)s=n.userData.refdes;if(!s&&n.userData?.name)s=n.userData.name;n=n.parent}let a=i||o||r||s;if(!a)return"";let c=wE(e,a);if(c&&e.some((h)=>h.type==="source_component"&&h.name===c))return c;if(c&&!["cad_","pcb_","source_","schematic_"].some((h)=>c.startsWith(h)))return c;return""}var Bio='button, [role="menuitem"]';function Tio(e,t){let n=[];if(t.includes("on Schematic"))n.push(t.replace("on Schematic","").replace(/[↗︎\s]/g,"").trim());let o=t.match(/Hide\s*"([^"]+)"/)?.[1];if(o)n.push(o);return n.filter(Boolean).map((r)=>wE(e,r)).filter(Boolean)}function $Zi(e){return e.flatMap((r)=>Array.from(r.addedNodes)).filter((r)=>r instanceof HTMLElement).map((r)=>r.getAttribute("role")==="menu"?r:r.querySelector('[role="menu"]')).filter((r)=>!!r)}function qZi(e,t){let n=t.flatMap((o)=>Array.from(o.querySelectorAll(Bio)));for(let o of n){let[r]=Tio(e,o.textContent||"");if(r)return r}return}function kBe(e,t){wio.useEffect(()=>{if(!t)return;let n=(r)=>{let i=r.target?.closest(Bio);if(i)Tio(e||[],i.textContent||"").forEach(t)},o=new MutationObserver((r)=>{let i=qZi(e||[],$Zi(r));if(i)t(i)});return document.addEventListener("click",n,!0),o.observe(document.body,{childList:!0,subtree:!0}),()=>{document.removeEventListener("click",n,!0),o.disconnect()}},[e,t])}var YE=at(ln());var bTe=at(ln(),1);bp();be();bp();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();var HBe=k().or(ge()).transform((e)=>Ta(e,"Ω").value),s_t=k().or(ge()).transform((e)=>Ta(e,"F").value).transform((e)=>Number.parseFloat(e.toPrecision(12))),Fio=k().or(ge()).transform((e)=>Ta(e,"H").value),J6=k().or(ge()).transform((e)=>Ta(e,"V").value),qo=k().or(ge()).transform((e)=>Ta(e).value),xU=k().or(ge()).transform((e)=>Ta(e,"Hz").value),En=qo,AH=k().or(ge()).transform((e)=>Ta(e,"A").value),ane=k().or(ge()).transform((e)=>Ta(e).value),JZi=ane,hA=ane,zio=k().datetime(),dd=k().or(ge()).transform((e)=>{if(typeof e==="number")return e;if(e.endsWith("deg"))return Number.parseFloat(e.split("deg")[0]);if(e.endsWith("rad"))return Number.parseFloat(e.split("rad")[0])*180/Math.PI;return Number.parseFloat(e)}),Oio=ge().or(k().endsWith("mAh")).transform((e)=>{if(typeof e==="string"){let t=e.replace("mAh",""),n=Number.parseFloat(t);if(Number.isNaN(n))throw Error("Invalid capacity");return n}return e}).describe("Battery capacity in mAh"),zt=(e)=>{};zt("extra props b");zt("missing props b");zt(!0);zt("mismatched prop types: a");var CU=(e)=>{};CU(!0);CU('T1 has extra: "c", T2 has extra: "d"');CU('T1 has extra: "c"');CU('T2 has extra: "c"');CU('T1 has extra: "d", T2 has extra: "c"');CU(!0);var mr=Ee({x:En,y:En}),ZZi=mr;zt(!0);zt(!0);var BE=Ee({x:En,y:En,z:En}),ees=BE;zt(!0);var FBe=Ee({width:ge(),height:ge()});zt(!0);var sne=En.pipe(ge().finite()),t_t=En.pipe(ge().finite().positive()),a_t=Ee({shape:ce("circle"),x:sne,y:sne,radius:t_t}).strict(),zBe=Ee({shape:ce("rect"),x:sne,y:sne,width:t_t,height:t_t}).strict(),c_t=zBe.extend({shape:ce("rotated_rect"),ccw_rotation:dd.pipe(ge().finite())}),gme=Ee({shape:ce("polygon"),points:st(mr.extend({x:sne,y:sne})).min(3).refine((e)=>{let t=e.reduce((n,o,r)=>{let i=e[(r+1)%e.length];return n+o.x*i.y-i.x*o.y},0);return Number.isFinite(t)&&t!==0},"Polygon boundary must enclose a nonzero area")}).strict();zt(!0);zt(!0);zt(!0);zt(!0);var tes=ss("shape",[a_t,zBe,c_t,gme]);zt(!0);var nes=(e)=>Array.from({length:e},()=>"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[Math.floor(Math.random()*62)]).join(""),Tn=(e)=>k().optional().default(()=>`${e}_${nes(10)}`),WT=bt(["top_left","top_center","top_right","center_left","center","center_right","bottom_left","bottom_center","bottom_right"]);zt(!0);var oes=bt(["top_silkscreen","bottom_silkscreen","top_copper","bottom_copper","top_soldermask","bottom_soldermask","top_fabrication_note","bottom_fabrication_note","top_user_note","bottom_user_note","top_courtyard","bottom_courtyard","inner1_copper","inner2_copper","inner3_copper","inner4_copper","inner5_copper","inner6_copper","inner7_copper","inner8_copper","edge_cuts","drill"]);zt(!0);var OBe=Ee({project_relative_path:k(),url:k(),mimetype:k()});zt(!0);var VBe=mr.extend({rotation:dd.optional()});zt(!0);var l_t=Ee({size:mr.optional(),thickness:En.optional()});zt(!0);var Vio=Ee({font:l_t.optional()});zt(!0);var _me=Ee({value:k(),at:VBe.optional(),layer:k().optional(),uuid:k().optional(),hide:Be().optional(),effects:Vio.optional()});zt(!0);var Yio=Ee({Reference:_me.optional(),Value:_me.optional(),Datasheet:_me.optional(),Description:_me.optional()});zt(!0);var Gio=Ee({through_hole:Be().optional(),smd:Be().optional(),exclude_from_pos_files:Be().optional(),exclude_from_bom:Be().optional()});zt(!0);var Uio=Ee({name:k(),type:k(),shape:k().optional(),at:VBe.optional(),size:mr.optional(),drill:En.optional(),layers:st(k()).optional(),removeUnusedLayers:Be().optional(),uuid:k().optional()});zt(!0);var Wio=Ee({path:k(),offset:BE.optional(),scale:BE.optional(),rotate:BE.optional()});zt(!0);var Xio=Ee({footprintName:k().optional(),version:an([ge(),k()]).optional(),generator:k().optional(),generatorVersion:an([ge(),k()]).optional(),layer:k().optional(),properties:Yio.optional(),attributes:Gio.optional(),pads:st(Uio).optional(),embeddedFonts:Be().optional(),model:Wio.optional()});zt(!0);var jio=Ee({hide:Be().optional()});zt(!0);var Kio=Ee({offset:En.optional(),hide:Be().optional()});zt(!0);var $io=Ee({font:l_t.optional(),justify:an([k(),st(k())]).optional(),hide:Be().optional()});zt(!0);var gH=Ee({value:k(),id:an([ge(),k()]).optional(),at:VBe.optional(),effects:$io.optional()});zt(!0);var qio=Ee({Reference:gH.optional(),Value:gH.optional(),Footprint:gH.optional(),Datasheet:gH.optional(),Description:gH.optional(),ki_keywords:gH.optional(),ki_fp_filters:gH.optional()});zt(!0);var Jio=Ee({symbolName:k().optional(),extends:k().optional(),pinNumbers:jio.optional(),pinNames:Kio.optional(),excludeFromSim:Be().optional(),inBom:Be().optional(),onBoard:Be().optional(),properties:qio.optional(),embeddedFonts:Be().optional()});zt(!0);var Hc=Ee({error_type:k(),message:k(),is_fatal:Be().optional()});zt(!0);var Ame=bt(["jlcpcb","macrofab","pcbway","digikey","mouser","lcsc"]);zt(!0);var Ph=Ee({type:ce("source_component"),ftype:k().optional(),source_component_id:k(),name:k(),manufacturer_part_number:k().optional(),supplier_part_numbers:Ss(Ame,st(k())).optional(),display_value:k().optional(),display_name:k().optional(),are_pins_interchangeable:Be().optional(),internally_connected_source_port_ids:st(st(k())).optional(),source_group_id:k().optional(),subcircuit_id:k().optional()});zt(!0);var h_t=Ph.extend({ftype:ce("simple_capacitor"),capacitance:s_t,max_voltage_rating:J6.optional(),display_capacitance:k().optional(),max_decoupling_trace_length:En.optional()});zt(!0);var d_t=Ph.extend({ftype:ce("simple_resistor"),resistance:HBe,display_resistance:k().optional()});zt(!0);var YBe=Ph.extend({ftype:ce("simple_diode")});zt(!0);var Zio=Ph.extend({ftype:ce("simple_fiducial")});zt(!0);var u_t=YBe.extend({ftype:ce("simple_led"),color:k().optional(),wavelength:k().optional()});zt(!0);var eso=Ph.extend({ftype:ce("simple_ground")});zt(!0);var p_t=Ph.extend({ftype:ce("simple_chip")});zt(!0);var tso=Ph.extend({ftype:ce("printedpart")});zt(!0);var nso=Ph.extend({ftype:ce("subassembly")});zt(!0);var oso=Ph.extend({ftype:ce("motor")});zt(!0);var m_t=Ph.extend({ftype:ce("simple_power_source"),voltage:J6});zt(!0);var rso=Ph.extend({ftype:ce("simple_current_source"),current:AH,frequency:xU.optional(),peak_to_peak_current:AH.optional(),wave_shape:bt(["sine","square","triangle","sawtooth","dc"]).optional().default("dc"),phase:ge().optional(),duty_cycle:ge().min(0).max(1).optional()});zt(!0);var iso=Ph.extend({ftype:ce("simple_fuse"),current_rating_amps:ge().describe("Nominal current in amps the fuse is rated for"),voltage_rating_volts:ge().describe("Voltage rating in volts, e.g. ±5V would be 5")});zt(!0);var sso=Ph.extend({ftype:ce("simple_ammeter")});zt(!0);var Dio=an([ge(),k().trim().regex(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?\s*(?:[fpnumkKMGTµμ]?V?|V)?$/,"Expected a scalar voltage, optionally with SI units")]).pipe(J6).pipe(ge().finite()),aso=Ee({is_input:Be().optional(),is_output:Be().optional(),is_bidirectional:Be().optional(),is_passive:Be().optional(),can_use_tri_state:Be().optional(),is_using_tri_state:Be().optional(),can_use_open_collector:Be().optional(),is_using_open_collector:Be().optional(),can_use_open_emitter:Be().optional(),is_using_open_emitter:Be().optional(),is_gpio:Be().optional(),highlight_color:k().optional(),must_be_connected:Be().optional(),provides_power:Be().optional(),requires_power:Be().optional(),provides_ground:Be().optional(),requires_ground:Be().optional(),provides_voltage:Dio.optional(),requires_voltage:Dio.optional(),required_voltage_tolerance:ge().finite().min(0).max(1).optional(),do_not_connect:Be().optional(),include_in_board_pinout:Be().optional(),can_use_internal_pullup:Be().optional(),is_using_internal_pullup:Be().optional(),needs_external_pullup:Be().optional(),can_use_internal_pulldown:Be().optional(),is_using_internal_pulldown:Be().optional(),needs_external_pulldown:Be().optional(),can_use_open_drain:Be().optional(),is_using_open_drain:Be().optional(),can_use_push_pull:Be().optional(),is_using_push_pull:Be().optional(),should_have_decoupling_capacitor:Be().optional(),recommended_decoupling_capacitor_capacitance:an([k(),ge()]).optional(),is_configured_for_i2c_sda:Be().optional(),is_configured_for_i2c_scl:Be().optional(),is_configured_for_spi_mosi:Be().optional(),is_configured_for_spi_miso:Be().optional(),is_configured_for_spi_sck:Be().optional(),is_configured_for_spi_cs:Be().optional(),is_configured_for_uart_tx:Be().optional(),is_configured_for_uart_rx:Be().optional(),supports_i2c_sda:Be().optional(),supports_i2c_scl:Be().optional(),supports_spi_mosi:Be().optional(),supports_spi_miso:Be().optional(),supports_spi_sck:Be().optional(),supports_spi_cs:Be().optional(),supports_uart_tx:Be().optional(),supports_uart_rx:Be().optional()});zt(!0);var __t=Ph.extend({ftype:ce("simple_battery"),capacity:Oio});zt(!0);var g_t=Ph.extend({ftype:ce("simple_inductor"),inductance:Fio,display_inductance:k().optional(),max_current_rating:ge().optional()});zt(!0);var A_t=Ph.extend({ftype:ce("simple_push_button")});zt(!0);var f_t=Ph.extend({ftype:ce("simple_potentiometer"),max_resistance:HBe,display_max_resistance:k().optional()});zt(!0);var cso=Ph.extend({ftype:ce("simple_crystal"),frequency:ge().describe("Frequency in Hz"),load_capacitance:ge().optional().describe("Load capacitance in pF"),pin_variant:bt(["two_pin","four_pin"]).optional()});zt(!0);var y_t=Ph.extend({ftype:ce("simple_pin_header"),pin_count:ge(),gender:bt(["male","female"]).optional().default("male")});zt(!0);var lso=["usb_c","m2","jst_sh","jst_gh","jst_zh","jst_ph","jst_xh","jst_vh"],hso=Ph.extend({ftype:ce("simple_connector"),standard:bt(lso).optional(),pin_count:ge().int().positive().optional()});zt(!0);var x_t=Ph.extend({ftype:ce("simple_pinout")});zt(!0);var C_t=Ph.extend({ftype:ce("simple_resonator"),load_capacitance:s_t,equivalent_series_resistance:HBe.optional(),frequency:xU});zt(!0);var b_t=Ph.extend({ftype:ce("simple_transistor"),transistor_type:bt(["npn","pnp"])});zt(!0);var I_t=Ph.extend({ftype:ce("simple_test_point"),footprint_variant:bt(["pad","through_hole"]).optional(),pad_shape:bt(["rect","circle"]).optional(),pad_diameter:an([ge(),k()]).optional(),hole_diameter:an([ge(),k()]).optional(),width:an([ge(),k()]).optional(),height:an([ge(),k()]).optional()});zt(!0);var v_t=Ph.extend({ftype:ce("simple_mosfet"),channel_type:bt(["n","p"]),mosfet_mode:bt(["enhancement","depletion"])});zt(!0);var S_t=Ph.extend({ftype:ce("simple_op_amp")});zt(!0);var P_t=Ph.extend({ftype:ce("simple_switch")});zt(!0);var E_t=Ee({type:ce("source_project_metadata"),name:k().optional(),software_used_string:k().optional(),project_url:k().optional(),source_filesystem_md5_hash:k().optional(),created_at:zio.optional()});zt(!0);var dso=Hc.extend({type:ce("source_missing_property_error"),source_missing_property_error_id:Tn("source_missing_property_error"),source_component_id:k(),property_name:k(),subcircuit_id:k().optional(),error_type:ce("source_missing_property_error").default("source_missing_property_error")}).describe("The source code is missing a property");zt(!0);var uso=Hc.extend({type:ce("source_failed_to_create_component_error"),source_failed_to_create_component_error_id:Tn("source_failed_to_create_component_error"),error_type:ce("source_failed_to_create_component_error").default("source_failed_to_create_component_error"),component_name:k().optional(),subcircuit_id:k().optional(),parent_source_component_id:k().optional(),pcb_center:Ee({x:ge().optional(),y:ge().optional()}).optional(),schematic_center:Ee({x:ge().optional(),y:ge().optional()}).optional()}).describe("Error emitted when a component fails to be constructed");zt(!0);var M_t=Hc.extend({type:ce("source_invalid_component_property_error"),source_invalid_component_property_error_id:Tn("source_invalid_component_property_error"),source_component_id:k(),property_name:k(),property_value:Xz().optional(),expected_format:k().optional(),subcircuit_id:k().optional(),error_type:ce("source_invalid_component_property_error").default("source_invalid_component_property_error")}).describe("The source component property is invalid");zt(!0);var w_t=Hc.extend({type:ce("source_trace_not_connected_error"),source_trace_not_connected_error_id:Tn("source_trace_not_connected_error"),error_type:ce("source_trace_not_connected_error").default("source_trace_not_connected_error"),subcircuit_id:k().optional(),source_group_id:k().optional(),source_trace_id:k().optional(),connected_source_port_ids:st(k()).optional(),selectors_not_found:st(k()).optional()}).describe("Occurs when a source trace selector does not match any ports");zt(!0);var pso=Ee({type:ce("source_property_ignored_warning"),source_property_ignored_warning_id:Tn("source_property_ignored_warning"),source_component_id:k(),property_name:k(),subcircuit_id:k().optional(),error_type:ce("source_property_ignored_warning").default("source_property_ignored_warning"),message:k()}).describe("The source property was ignored");zt(!0);var B_t=Ee({type:ce("source_pin_missing_trace_warning"),source_pin_missing_trace_warning_id:Tn("source_pin_missing_trace_warning"),warning_type:ce("source_pin_missing_trace_warning").default("source_pin_missing_trace_warning"),message:k(),source_component_id:k(),source_port_id:k(),subcircuit_id:k().optional()}).describe("Warning emitted when a source component pin is missing a trace connection");zt(!0);var T_t=Ee({type:ce("source_missing_manufacturer_part_number_warning"),source_missing_manufacturer_part_number_warning_id:Tn("source_missing_manufacturer_part_number_warning"),warning_type:ce("source_missing_manufacturer_part_number_warning").default("source_missing_manufacturer_part_number_warning"),message:k(),source_component_id:k(),standard:k().optional(),subcircuit_id:k().optional()}).describe("Warning emitted when a source component is missing its manufacturer part number");zt(!0);var D_t=Ee({type:ce("source_refdes_convention_warning"),source_refdes_convention_warning_id:Tn("source_refdes_convention_warning"),warning_type:ce("source_refdes_convention_warning").default("source_refdes_convention_warning"),message:k(),source_component_id:k(),refdes:k(),source_component_ftype:k(),expected_prefixes:st(k()),actual_prefix:k().optional(),subcircuit_id:k().optional()}).describe("Warning emitted when a source component reference designator does not match the component type convention");zt(!0);var mso=Ph.extend({ftype:ce("simple_voltage_probe")});zt(!0);var _so=Ph.extend({ftype:ce("interconnect")});zt(!0);var N_t=Hc.extend({type:ce("source_i2c_misconfigured_error"),source_i2c_misconfigured_error_id:Tn("source_i2c_misconfigured_error"),error_type:ce("source_i2c_misconfigured_error").default("source_i2c_misconfigured_error"),source_port_ids:st(k())}).describe("Error emitted when incompatible I2C pins (e.g. SDA and SCL) are connected to the same net");zt(!0);var R_t=Hc.extend({type:ce("source_component_misconfigured_error"),source_component_misconfigured_error_id:Tn("source_component_misconfigured_error"),error_type:ce("source_component_misconfigured_error").default("source_component_misconfigured_error"),source_component_ids:st(k()),source_port_ids:st(k()).optional()}).describe("Error emitted when one or more source components have an invalid or conflicting configuration");zt(!0);var gso=Ph.extend({ftype:ce("simple_voltage_source"),voltage:J6,frequency:xU.optional(),peak_to_peak_voltage:J6.optional(),wave_shape:bt(["sinewave","square","triangle","sawtooth"]).optional(),phase:dd.optional(),duty_cycle:ge().optional().describe("Duty cycle as a fraction (0 to 1)"),pulse_delay:hA.optional(),rise_time:hA.optional(),fall_time:hA.optional(),pulse_width:hA.optional(),period:hA.optional()});zt(!0);var Aso=an([d_t,h_t,YBe,Zio,u_t,eso,p_t,tso,nso,oso,m_t,rso,sso,__t,g_t,A_t,f_t,cso,y_t,hso,x_t,C_t,P_t,b_t,I_t,v_t,S_t,iso,mso,_so,gso,E_t,dso,M_t,uso,w_t,pso,B_t,T_t,D_t,N_t,R_t]);zt(!0);var fso=Ee({type:ce("source_port"),pin_number:ge().optional(),port_hints:st(k()).optional(),name:k(),source_port_id:k(),source_component_id:k().optional(),source_group_id:k().optional(),most_frequently_referenced_by_name:k().optional(),subcircuit_id:k().optional(),subcircuit_connectivity_map_key:k().optional()}).merge(aso);zt(!0);var yso=Ee({type:ce("source_component_internal_connection"),source_component_internal_connection_id:k(),source_component_id:k(),source_port_ids:st(k()),subcircuit_id:k().optional()});zt(!0);var xso=Ee({type:ce("source_trace"),source_trace_id:k(),connected_source_port_ids:st(k()),connected_source_net_ids:st(k()),subcircuit_id:k().optional(),subcircuit_connectivity_map_key:k().optional(),max_length:ge().optional(),max_via_count:ge().int().nonnegative().optional(),name:k().optional(),min_trace_thickness:ge().optional(),display_name:k().optional()});zt(!0);var Cso=Ee({type:ce("source_group"),source_group_id:k(),subcircuit_id:k().optional(),parent_subcircuit_id:k().optional(),parent_source_group_id:k().optional(),is_subcircuit:Be().optional(),show_as_schematic_box:Be().optional(),name:k().optional(),was_automatically_named:Be().optional()});zt(!0);var bso=Ee({type:ce("source_net"),source_net_id:k(),name:k(),member_source_group_ids:st(k()),is_power:Be().optional(),is_ground:Be().optional(),is_digital_signal:Be().optional(),is_analog_signal:Be().optional(),is_positive_voltage_source:Be().optional(),trace_width:ge().optional(),subcircuit_id:k().optional(),subcircuit_connectivity_map_key:k().optional()});zt(!0);var Iso=Ee({type:ce("source_board"),source_board_id:k(),source_group_id:k(),title:k().optional()}).describe("Defines a board in the source domain");zt(!0);var vso=Hc.extend({type:ce("source_ambiguous_port_reference"),source_ambiguous_port_reference_id:Tn("source_ambiguous_port_reference"),error_type:ce("source_ambiguous_port_reference").default("source_ambiguous_port_reference"),source_port_id:k().optional(),source_component_id:k().optional()}).describe("Error emitted when a port hint matches multiple non-overlapping pads, making the port reference ambiguous");zt(!0);var Sso=Ee({type:ce("source_pcb_ground_plane"),source_pcb_ground_plane_id:k(),source_group_id:k(),source_net_id:k(),subcircuit_id:k().optional()}).describe("Defines a ground plane in the source domain");zt(!0);var Pso=["top","bottom","inner1","inner2","inner3","inner4","inner5","inner6","inner7","inner8"],n_t=bt(Pso),ha=n_t.or(Ee({name:n_t})).transform((e)=>{if(typeof e==="string")return e;return e.name});zt(!0);var ag=bt(["top","bottom"]),Eso=Ee({type:ce("source_manually_placed_via"),source_manually_placed_via_id:k(),source_group_id:k(),source_net_id:k().min(1).optional(),subcircuit_id:k().optional(),source_trace_id:k().optional()}).describe("Defines a via that is manually placed in the source domain");zt(!0);var Mso=Ee({type:ce("source_unnamed_trace_warning"),source_unnamed_trace_warning_id:Tn("source_unnamed_trace_warning"),warning_type:ce("source_unnamed_trace_warning").default("source_unnamed_trace_warning"),message:k(),source_trace_id:k(),subcircuit_id:k().optional()}).describe("Warning emitted when a source trace is missing a name");zt(!0);var wso=Ee({type:ce("source_no_power_pin_defined_warning"),source_no_power_pin_defined_warning_id:Tn("source_no_power_pin_defined_warning"),warning_type:ce("source_no_power_pin_defined_warning").default("source_no_power_pin_defined_warning"),message:k(),source_component_id:k(),source_port_ids:st(k()),subcircuit_id:k().optional()}).describe("Warning emitted when a chip has no source ports with requires_power=true");zt(!0);var Bso=Ee({type:ce("source_no_ground_pin_defined_warning"),source_no_ground_pin_defined_warning_id:Tn("source_no_ground_pin_defined_warning"),warning_type:ce("source_no_ground_pin_defined_warning").default("source_no_ground_pin_defined_warning"),message:k(),source_component_id:k(),source_port_ids:st(k()),subcircuit_id:k().optional()}).describe("Warning emitted when a chip has no source ports marked as ground pins");zt(!0);var Tso=Ee({type:ce("source_component_pins_underspecified_warning"),source_component_pins_underspecified_warning_id:Tn("source_component_pins_underspecified_warning"),warning_type:ce("source_component_pins_underspecified_warning").default("source_component_pins_underspecified_warning"),message:k(),source_component_id:k(),source_port_ids:st(k()),subcircuit_id:k().optional()}).describe("Warning emitted when all ports on a source component are underspecified");zt(!0);var Dso=Hc.extend({type:ce("source_pin_must_be_connected_error"),source_pin_must_be_connected_error_id:Tn("source_pin_must_be_connected_error"),error_type:ce("source_pin_must_be_connected_error").default("source_pin_must_be_connected_error"),source_component_id:k(),source_port_id:k(),subcircuit_id:k().optional()}).describe("Error emitted when a pin with mustBeConnected attribute is not connected to any trace");zt(!0);var Nso=Hc.extend({type:ce("unknown_error_finding_part"),unknown_error_finding_part_id:Tn("unknown_error_finding_part"),error_type:ce("unknown_error_finding_part").default("unknown_error_finding_part"),source_component_id:k().optional(),subcircuit_id:k().optional()}).describe("Error emitted when an unexpected error occurs while finding a part");zt(!0);var Rso=Ee({type:ce("source_part_not_found_warning"),source_part_not_found_warning_id:Tn("source_part_not_found_warning"),warning_type:ce("source_part_not_found_warning").default("source_part_not_found_warning"),message:k(),source_component_id:k().optional(),subcircuit_id:k().optional(),supplier_name:Ame.optional(),manufacturer_part_number:k().optional(),supplier_part_number:k().optional(),part_name:k().optional()}).describe("Warning emitted when a requested part can not be found");zt(!0);var Qso=Ee({type:ce("source_confusing_net_name_warning"),source_confusing_net_name_warning_id:Tn("source_confusing_net_name_warning"),warning_type:ce("source_confusing_net_name_warning").default("source_confusing_net_name_warning"),message:k(),source_net_ids:st(k()).min(2),net_name:k(),subcircuit_id:k().optional()}).describe("Warning emitted when electrically disconnected source nets share a name");zt(!0);var e_t=an([ge().nonnegative().finite(),Ee({reference:ce("longest_manhattan"),source_trace_ids:st(k()).min(1).optional(),offset:ge().finite().optional()})]),Nio=an([ge().positive().finite(),Ee({width_multiplier:ge().positive().finite()})]),kso=Ee({type:ce("source_bus"),source_bus_id:k(),name:k().optional(),source_trace_ids:st(k()).min(1),max_length_skew:ge().nonnegative().finite().optional(),target_impedance:ge().positive().finite().optional(),target_differential_impedance:ge().positive().finite().optional(),differential_pair:Ee({positive_source_trace_id:k(),negative_source_trace_id:k(),trace_gap:ge().positive().finite().optional(),max_uncoupled_length:ge().nonnegative().finite().optional()}).optional(),length_match_source_trace_ids:st(k()).min(1).optional(),min_length:e_t.optional(),max_length:e_t.optional(),target_length:e_t.optional(),length_tolerance:ge().nonnegative().finite().optional(),pcb_trace_spacing:Nio.optional(),pcb_spacing_to_other_signals:Nio.optional(),target_impedance_min:ge().positive().finite().optional(),target_impedance_max:ge().positive().finite().optional(),target_differential_impedance_min:ge().positive().finite().optional(),target_differential_impedance_max:ge().positive().finite().optional(),subcircuit_id:k().optional()});zt(!0);var Lso=Hc.pick({message:!0,error_type:!0}).extend({type:ce("source_runtime_error"),source_runtime_error_id:Tn("source_runtime_error"),error_type:ce("source_runtime_error").default("source_runtime_error"),phase_name:k().optional()}).describe("An unexpected runtime failure while generating or validating a circuit");zt(!0);var Hso=Ee({type:ce("schematic_box"),schematic_sheet_id:k().optional(),schematic_component_id:k().optional(),schematic_symbol_id:k().optional(),width:En,height:En,is_dashed:Be().default(!1),x:En,y:En,subcircuit_id:k().optional()}).describe("Draws a box on the schematic");zt(!0);var Fso=Ee({type:ce("schematic_path"),schematic_path_id:Tn("schematic_path"),schematic_sheet_id:k().optional(),schematic_component_id:k().optional(),schematic_symbol_id:k().optional(),fill_color:k().optional(),is_filled:Be().optional(),is_dashed:Be().default(!1),stroke_width:En.nullable().optional(),stroke_color:k().optional(),dash_length:En.optional(),dash_gap:En.optional(),points:st(mr),subcircuit_id:k().optional()});zt(!0);var zso=Ss(Ee({left_margin:qo.optional(),right_margin:qo.optional(),top_margin:qo.optional(),bottom_margin:qo.optional()})),Oso=Ee({left_size:ge(),right_size:ge(),top_size:ge().optional(),bottom_size:ge().optional()});zt(!0);var Vso=Ee({left_side:Ee({pins:st(ge()),direction:bt(["top-to-bottom","bottom-to-top"]).optional()}).optional(),right_side:Ee({pins:st(ge()),direction:bt(["top-to-bottom","bottom-to-top"]).optional()}).optional(),top_side:Ee({pins:st(ge()),direction:bt(["left-to-right","right-to-left"]).optional()}).optional(),bottom_side:Ee({pins:st(ge()),direction:bt(["left-to-right","right-to-left"]).optional()}).optional()});zt(!0);var Yso=an([Oso,Vso]),Gso=Ee({type:ce("schematic_component"),size:FBe,center:mr,source_component_id:k().optional(),schematic_component_id:k(),schematic_sheet_id:k().optional(),schematic_symbol_id:k().optional(),pin_spacing:qo.optional(),pin_styles:zso.optional(),box_width:qo.optional(),symbol_name:k().optional(),port_arrangement:Yso.optional(),port_labels:Ss(k()).optional(),symbol_display_value:k().optional(),subcircuit_id:k().optional(),schematic_group_id:k().optional(),is_schematic_group:Be().optional(),source_group_id:k().optional(),is_box_with_pins:Be().optional().default(!0)});zt(!0);var res=Ee({kicad_symbol:Jio.optional()}).catchall(Xz()),Uso=Ee({type:ce("schematic_symbol"),schematic_symbol_id:k(),name:k().optional(),metadata:res.optional()}).describe("Defines a named schematic symbol that can be referenced by components.");zt(!0);var Wso=Ee({type:ce("schematic_line"),schematic_line_id:Tn("schematic_line"),schematic_sheet_id:k().optional(),schematic_component_id:k().optional(),schematic_symbol_id:k().optional(),x1:En,y1:En,x2:En,y2:En,stroke_width:En.nullable().optional(),color:k().default("#000000"),is_dashed:Be().default(!1),dash_length:En.optional(),dash_gap:En.optional(),subcircuit_id:k().optional()}).describe("Draws a styled line on the schematic");zt(!0);var Xso=Ee({type:ce("schematic_rect"),schematic_rect_id:Tn("schematic_rect"),schematic_sheet_id:k().optional(),schematic_component_id:k().optional(),schematic_symbol_id:k().optional(),center:mr,width:En,height:En,rotation:dd.default(0),stroke_width:En.nullable().optional(),color:k().default("#000000"),is_filled:Be().default(!1),fill_color:k().optional(),is_dashed:Be().default(!1),subcircuit_id:k().optional()}).describe("Draws a styled rectangle on the schematic");zt(!0);var jso=Ee({type:ce("schematic_circle"),schematic_circle_id:Tn("schematic_circle"),schematic_sheet_id:k().optional(),schematic_component_id:k().optional(),schematic_symbol_id:k().optional(),center:mr,radius:En,stroke_width:En.nullable().optional(),color:k().default("#000000"),is_filled:Be().default(!1),fill_color:k().optional(),is_dashed:Be().default(!1),subcircuit_id:k().optional()}).describe("Draws a styled circle on the schematic");zt(!0);var Kso=Ee({type:ce("schematic_arc"),schematic_arc_id:Tn("schematic_arc"),schematic_sheet_id:k().optional(),schematic_component_id:k().optional(),schematic_symbol_id:k().optional(),center:mr,radius:En,start_angle_degrees:dd,end_angle_degrees:dd,direction:bt(["clockwise","counterclockwise"]).default("counterclockwise"),stroke_width:En.nullable().optional(),color:k().default("#000000"),is_dashed:Be().default(!1),subcircuit_id:k().optional()}).describe("Draws a styled arc on the schematic");zt(!0);var $so=Ee({type:ce("schematic_trace"),schematic_trace_id:k(),schematic_sheet_id:k().optional(),source_trace_id:k().optional(),junctions:st(Ee({x:ge(),y:ge()})),edges:st(Ee({from:Ee({x:ge(),y:ge()}),to:Ee({x:ge(),y:ge()}),is_crossing:Be().optional(),from_schematic_port_id:k().optional(),to_schematic_port_id:k().optional()})),subcircuit_id:k().optional(),subcircuit_connectivity_map_key:k().optional()});zt(!0);var ies=bt(["center","left","right","top","bottom"]);zt(!0);var Q_t=Ee({text:k(),is_overlined:Be().optional()}),qso=Ee({type:ce("schematic_text"),schematic_sheet_id:k().optional(),schematic_component_id:k().optional(),schematic_symbol_id:k().optional(),schematic_text_id:k(),source_trace_id:k().optional(),text:k(),text_parts:st(Q_t).min(1).optional(),display_superscript:k().optional(),font_size:ge().default(0.18),position:Ee({x:En,y:En}),rotation:ge().default(0),anchor:an([ies.describe("legacy"),WT]).default("center"),color:k().default("#000000"),subcircuit_id:k().optional()});zt(!0);var Jso=Ee({type:ce("schematic_port"),schematic_port_id:k(),source_port_id:k(),schematic_sheet_id:k().optional(),schematic_component_id:k().optional(),center:mr,facing_direction:bt(["up","down","left","right"]).optional(),distance_from_component_edge:ge().optional(),side_of_component:bt(["top","bottom","left","right"]).optional(),true_ccw_index:ge().optional(),pin_number:ge().optional(),display_pin_label:k().optional(),display_pin_label_text_parts:st(Q_t).min(1).optional(),display_pin_label_font_size:ge().positive().finite().optional(),subcircuit_id:k().optional(),is_connected:Be().optional(),is_internal_circuit_port:Be().optional(),is_overlapping_internal_circuit_port:Be().optional(),has_input_arrow:Be().optional(),has_output_arrow:Be().optional(),is_drawn_with_inversion_circle:Be().optional()}).describe("Defines a port on a schematic component");zt(!0);var Zso=Ee({type:ce("schematic_net_label"),schematic_net_label_id:Tn("schematic_net_label"),schematic_sheet_id:k().optional(),schematic_trace_id:k().optional(),source_trace_id:k().optional(),source_net_id:k(),center:mr,anchor_position:mr.optional(),anchor_side:bt(["top","bottom","left","right"]),text:k(),display_superscript:k().optional(),symbol_name:k().optional(),is_movable:Be().optional(),subcircuit_id:k().optional()});zt(!0);var eao=Hc.extend({type:ce("schematic_error"),schematic_error_id:k(),error_type:ce("schematic_port_not_found").default("schematic_port_not_found"),subcircuit_id:k().optional()}).describe("Defines a schematic error on the schematic");zt(!0);var tao=Hc.extend({type:ce("schematic_layout_error"),schematic_layout_error_id:Tn("schematic_layout_error"),error_type:ce("schematic_layout_error").default("schematic_layout_error"),source_group_id:k(),schematic_group_id:k(),subcircuit_id:k().optional()}).describe("Error emitted when schematic layout fails for a group");zt(!0);var GBe=Ee({type:ce("schematic_debug_object"),label:k().optional(),subcircuit_id:k().optional()}),nao=GBe.extend({shape:ce("rect"),center:mr,size:FBe}),oao=GBe.extend({shape:ce("line"),start:mr,end:mr}),rao=GBe.extend({shape:ce("point"),center:mr}),iao=ss("shape",[nao,oao,rao]);zt(!0);var sao=Ee({type:ce("schematic_voltage_probe"),schematic_voltage_probe_id:k(),schematic_sheet_id:k().optional(),source_component_id:k().optional(),name:k().optional(),position:mr,schematic_trace_id:k(),voltage:J6.optional(),subcircuit_id:k().optional(),color:k().optional(),label_alignment:WT.optional()}).describe("Defines a voltage probe measurement point on a schematic trace");zt(!0);var aao=Ee({type:ce("schematic_manual_edit_conflict_warning"),schematic_manual_edit_conflict_warning_id:Tn("schematic_manual_edit_conflict_warning"),warning_type:ce("schematic_manual_edit_conflict_warning").default("schematic_manual_edit_conflict_warning"),message:k(),schematic_component_id:k(),schematic_group_id:k().optional(),subcircuit_id:k().optional(),source_component_id:k()}).describe("Warning emitted when a component has both manual placement and explicit schX/schY coordinates");zt(!0);var cao=Ee({type:ce("schematic_component_overlap_warning"),schematic_component_overlap_warning_id:Tn("schematic_component_overlap_warning"),warning_type:ce("schematic_component_overlap_warning").default("schematic_component_overlap_warning"),message:k(),schematic_component_ids:c1([k(),k()]),schematic_sheet_id:k().optional()}).describe("Warning emitted when the rendered bounds of two schematic components overlap");zt(!0);var lao=Ee({type:ce("schematic_component_styling_warning"),schematic_component_styling_warning_id:Tn("schematic_component_styling_warning"),warning_type:ce("schematic_component_styling_warning").default("schematic_component_styling_warning"),message:k(),schematic_component_id:k(),styling_issue_type:k(),schematic_port_ids:st(k()).optional(),source_component_id:k().optional(),schematic_sheet_id:k().optional(),subcircuit_id:k().optional()}).describe("Warning emitted when a schematic component has a visual styling issue");zt(!0);var hao=Ee({type:ce("schematic_element_outside_sheet_warning"),schematic_element_outside_sheet_warning_id:Tn("schematic_element_outside_sheet_warning"),warning_type:ce("schematic_element_outside_sheet_warning").default("schematic_element_outside_sheet_warning"),message:k(),schematic_sheet_id:k(),schematic_element_type:bt(["schematic_component","schematic_net_label","schematic_trace"]),schematic_element_id:k()}).describe("Warning emitted when a schematic component, net label, or trace extends outside its schematic sheet");zt(!0);var Rio=En.pipe(ge().positive().finite()),dao=Ee({type:ce("schematic_graphic"),schematic_graphic_id:Tn("schematic_graphic"),schematic_sheet_id:k().optional(),asset:OBe.optional(),svg_content:k().optional(),width:Rio.optional(),height:Rio.optional()}).describe("References a graphic asset or inline SVG content with optional centered layout bounds on a schematic sheet").superRefine(({asset:e,svg_content:t},n)=>{if(e===void 0&&t===void 0)n.addIssue({code:Gt.custom,message:"At least one of asset or svg_content is required"})});zt(!0);var uao=Ee({type:ce("schematic_group"),schematic_group_id:Tn("schematic_group"),schematic_sheet_id:k().optional(),source_group_id:k(),is_subcircuit:Be().optional(),subcircuit_id:k().optional(),width:qo,height:qo,center:mr,schematic_component_ids:st(k()),show_as_schematic_box:Be().optional(),name:k().optional(),description:k().optional()}).describe("Defines a group of components on the schematic");zt(!0);var pao=Ee({type:ce("schematic_table"),schematic_table_id:Tn("schematic_table"),schematic_sheet_id:k().optional(),anchor_position:mr,column_widths:st(En),row_heights:st(En),cell_padding:En.optional(),border_width:En.optional(),subcircuit_id:k().optional(),schematic_component_id:k().optional(),anchor:WT.optional()}).describe("Defines a table on the schematic");zt(!0);var mao=Ee({type:ce("schematic_table_cell"),schematic_table_cell_id:Tn("schematic_table_cell"),schematic_sheet_id:k().optional(),schematic_table_id:k(),start_row_index:ge(),end_row_index:ge(),start_column_index:ge(),end_column_index:ge(),text:k().optional(),center:mr,width:En,height:En,horizontal_align:bt(["left","center","right"]).optional(),vertical_align:bt(["top","middle","bottom"]).optional(),font_size:En.optional(),subcircuit_id:k().optional()}).describe("Defines a cell within a schematic_table");zt(!0);var _ao=bt(["a4","ansi_b"]),gao=Ee({type:ce("schematic_sheet"),schematic_sheet_id:Tn("schematic_sheet"),name:k().optional(),sheet_index:ge().optional(),sheet_size:_ao.optional(),sheet_width:ge().positive().optional(),sheet_height:ge().positive().optional(),subcircuit_id:k().optional(),outline_color:k().optional()}).describe("Defines a schematic sheet or page that components can be placed on");zt(!0);var Aao=Ee({type:ce("schematic_missing_sheet_warning"),schematic_missing_sheet_warning_id:Tn("schematic_missing_sheet_warning"),warning_type:ce("schematic_missing_sheet_warning").default("schematic_missing_sheet_warning"),message:k()}).describe("Circuit-wide warning emitted when a schematic has no schematic sheet. Display as a banner without attaching it to a component or drawing a target outline or leader line.");zt(!0);var fao=Ee({x:En,y:En,bulge:ge().optional()});zt(!0);var o_t=Ee({vertices:st(fao)});zt(!0);var k_t=Ee({outer_ring:o_t,inner_rings:st(o_t).default([])});zt(!0);var yao={from_left:"from_left",from_right:"from_right",from_top:"from_top",from_bottom:"from_bottom",from_above:"from_above",from_below:"from_below",from_x_neg:"from_left",from_x_pos:"from_right",from_y_pos:"from_top",from_y_neg:"from_bottom",from_z_pos:"from_above",from_z_neg:"from_below",from_front:"from_top",from_back:"from_bottom"},ses={from_left:{x:-1,y:0,z:0},from_right:{x:1,y:0,z:0},from_top:{x:0,y:1,z:0},from_bottom:{x:0,y:-1,z:0},from_above:{x:0,y:0,z:1},from_below:{x:0,y:0,z:-1}},xao=bt(["from_left","from_right","from_top","from_bottom","from_above","from_below","from_x_neg","from_x_pos","from_y_pos","from_y_neg","from_z_pos","from_z_neg","from_front","from_back"]).transform((e)=>yao[e]).describe('The side exposing the receptacle where the cable or mating part is attached, following the 2D PCB diagram convention, not a 3D viewport frame. In project coordinate space, "from_top" is +Y, "from_bottom" -Y, "from_left" -X, "from_right" +X, "from_above" +Z and "from_below" -Z. A receptacle on the +Y edge is "from_top" even though the plug moves in -Y as it seats. Cartesian spellings such as "from_y_pos" are accepted and normalized to the named values, as are the deprecated "from_front" (now "from_top") and "from_back" (now "from_bottom").');zt(!0);zt(!0);var r_t=bt(["leftside_top","leftside_bottom","rightside_top","rightside_bottom","topside_left","topside_right","bottomside_left","bottomside_right"]);zt(!0);var aes=[["leftside_top","bottomside_left","rightside_bottom","topside_right"],["leftside_bottom","bottomside_right","rightside_top","topside_left"]],ces=(e,t)=>{for(let n of aes){let o=n.indexOf(e),r=n.indexOf(t);if(o!==-1&&r!==-1)return(r-o+n.length)%n.length*90}return null},Cao=Ee({x:En,y:En,via:Be().optional(),via_to_layer:ha.optional()}),les=st(Cao);zt(!0);zt(!0);var bao=Ee({x:En,y:En,via:Be().optional(),to_layer:ha.optional(),trace_width:En.optional()});zt(!0);var Iao=Ee({min_trace_width:qo.optional(),min_board_edge_clearance:qo.optional(),min_via_hole_edge_to_via_hole_edge_clearance:qo.optional(),min_plated_hole_drill_edge_to_drill_edge_clearance:qo.optional(),min_trace_to_pad_edge_clearance:qo.optional(),min_trace_to_hole_edge_clearance:qo.optional().describe("Minimum distance from a trace copper edge to a non-plated hole edge, in mm. No default is applied when omitted."),min_pad_edge_to_pad_edge_clearance:qo.optional(),min_same_net_trace_edge_to_trace_edge_clearance:qo.optional(),min_different_net_trace_edge_to_trace_edge_clearance:qo.optional(),min_via_edge_to_pad_edge_clearance:qo.optional(),min_via_hole_diameter:qo.optional(),min_via_pad_diameter:qo.optional()}),vao=Ee({type:ce("pcb_component"),pcb_component_id:Tn("pcb_component"),source_component_id:k(),center:mr,layer:ha,rotation:dd,display_offset_x:k().optional().describe("How to display the x offset for this part, usually corresponding with how the user specified it"),display_offset_y:k().optional().describe("How to display the y offset for this part, usually corresponding with how the user specified it"),width:qo,height:qo,do_not_place:Be().optional(),is_allowed_to_be_off_board:Be().optional(),subcircuit_id:k().optional(),pcb_group_id:k().optional(),position_mode:bt(["packed","relative_to_group_anchor","relative_to_another_component","none"]).optional(),anchor_position:mr.optional(),anchor_alignment:WT.optional(),positioned_relative_to_pcb_group_id:k().optional(),positioned_relative_to_pcb_board_id:k().optional(),cable_insertion_center:mr.optional(),insertion_direction:xao.optional(),pin1_location:r_t.optional().describe("Location of pin 1 on the unrotated, top-view component footprint"),supplier_pin1_location_map:Ss(Ame,r_t).optional().describe("Pin 1 location for each supplier's unrotated, top-view footprint"),metadata:Ee({kicad_footprint:Xio.optional()}).optional(),obstructs_within_bounds:Be().default(!0).describe("Does this component take up all the space within its bounds on a layer. This is generally true except for when separated pin headers are being represented by a single component (in which case, chips can be placed between the pin headers) or for tall modules where chips fit underneath")}).describe("Defines a component on the PCB");zt(!0);var UBe=Ee({type:ce("pcb_debug_object"),pcb_debug_object_id:Tn("pcb_debug_object"),label:k().optional(),subcircuit_id:k().optional()}),Sao=UBe.extend({shape:ce("rect"),center:mr,size:FBe}),Pao=UBe.extend({shape:ce("line"),start:mr,end:mr}),Eao=UBe.extend({shape:ce("point"),center:mr}),Mao=ss("shape",[Sao,Pao,Eao]);zt(!0);var wao=Ee({type:ce("pcb_hole"),pcb_hole_id:Tn("pcb_hole"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),pcb_component_id:k().optional(),hole_shape:ce("circle"),hole_diameter:ge(),x:En,y:En,is_covered_with_solder_mask:Be().optional(),soldermask_margin:ge().optional()}),hes=wao.describe("Defines a circular hole on the PCB");zt(!0);var Bao=Ee({type:ce("pcb_hole"),pcb_hole_id:Tn("pcb_hole"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),pcb_component_id:k().optional(),hole_shape:ce("rect"),hole_width:ge(),hole_height:ge(),x:En,y:En,is_covered_with_solder_mask:Be().optional(),soldermask_margin:ge().optional()}),des=Bao.describe("Defines a rectangular (square-capable) hole on the PCB. Use equal width/height for square.");zt(!0);var Tao=Ee({type:ce("pcb_hole"),pcb_hole_id:Tn("pcb_hole"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),pcb_component_id:k().optional(),hole_shape:bt(["circle","square"]),hole_diameter:ge(),x:En,y:En,is_covered_with_solder_mask:Be().optional(),soldermask_margin:ge().optional()}),ues=Tao.describe("Defines a circular or square hole on the PCB");zt(!0);var Dao=Ee({type:ce("pcb_hole"),pcb_hole_id:Tn("pcb_hole"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),pcb_component_id:k().optional(),hole_shape:ce("oval"),hole_width:ge(),hole_height:ge(),x:En,y:En,is_covered_with_solder_mask:Be().optional(),soldermask_margin:ge().optional()}),pes=Dao.describe("Defines an oval hole on the PCB");zt(!0);var Nao=Ee({type:ce("pcb_hole"),pcb_hole_id:Tn("pcb_hole"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),pcb_component_id:k().optional(),hole_shape:ce("pill"),hole_width:ge(),hole_height:ge(),x:En,y:En,is_covered_with_solder_mask:Be().optional(),soldermask_margin:ge().optional()}),mes=Nao.describe("Defines a pill-shaped hole on the PCB");zt(!0);var Rao=Ee({type:ce("pcb_hole"),pcb_hole_id:Tn("pcb_hole"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),pcb_component_id:k().optional(),hole_shape:ce("rotated_pill"),hole_width:ge(),hole_height:ge(),x:En,y:En,ccw_rotation:dd,is_covered_with_solder_mask:Be().optional(),soldermask_margin:ge().optional()}),_es=Rao.describe("Defines a rotated pill-shaped hole on the PCB");zt(!0);var Qao=Tao.or(Dao).or(Nao).or(Rao).or(wao).or(Bao),ges=Ee({type:ce("pcb_plated_hole"),shape:ce("circle"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),outer_diameter:ge(),hole_diameter:ge(),is_covered_with_solder_mask:Be().optional(),x:En,y:En,layers:st(ha),port_hints:st(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),pcb_plated_hole_id:Tn("pcb_plated_hole"),soldermask_margin:ge().optional()}),Aes=Ee({type:ce("pcb_plated_hole"),shape:bt(["oval","pill"]),pcb_group_id:k().optional(),subcircuit_id:k().optional(),outer_width:ge(),outer_height:ge(),hole_width:ge(),hole_height:ge(),is_covered_with_solder_mask:Be().optional(),x:En,y:En,ccw_rotation:dd,layers:st(ha),port_hints:st(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),pcb_plated_hole_id:Tn("pcb_plated_hole"),soldermask_margin:ge().optional()}),fes=Ee({type:ce("pcb_plated_hole"),shape:ce("circular_hole_with_rect_pad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),hole_shape:ce("circle"),pad_shape:ce("rect"),hole_diameter:ge(),rect_pad_width:ge(),rect_pad_height:ge(),rect_border_radius:ge().optional(),hole_offset_x:En.default(0),hole_offset_y:En.default(0),is_covered_with_solder_mask:Be().optional(),x:En,y:En,layers:st(ha),port_hints:st(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),pcb_plated_hole_id:Tn("pcb_plated_hole"),soldermask_margin:ge().optional(),rect_ccw_rotation:dd.optional()}),yes=Ee({type:ce("pcb_plated_hole"),shape:ce("pill_hole_with_rect_pad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),hole_shape:ce("pill"),pad_shape:ce("rect"),hole_width:ge(),hole_height:ge(),rect_pad_width:ge(),rect_pad_height:ge(),rect_border_radius:ge().optional(),hole_offset_x:En.default(0),hole_offset_y:En.default(0),is_covered_with_solder_mask:Be().optional(),x:En,y:En,layers:st(ha),port_hints:st(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),pcb_plated_hole_id:Tn("pcb_plated_hole"),soldermask_margin:ge().optional()}),xes=Ee({type:ce("pcb_plated_hole"),shape:ce("rotated_pill_hole_with_rect_pad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),hole_shape:ce("rotated_pill"),pad_shape:ce("rect"),hole_width:ge(),hole_height:ge(),hole_ccw_rotation:dd,rect_pad_width:ge(),rect_pad_height:ge(),rect_border_radius:ge().optional(),rect_ccw_rotation:dd,hole_offset_x:En.default(0),hole_offset_y:En.default(0),is_covered_with_solder_mask:Be().optional(),x:En,y:En,layers:st(ha),port_hints:st(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),pcb_plated_hole_id:Tn("pcb_plated_hole"),soldermask_margin:ge().optional()}),Ces=Ee({type:ce("pcb_plated_hole"),shape:ce("hole_with_polygon_pad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),hole_shape:bt(["circle","oval","pill","rotated_pill"]),hole_diameter:ge().optional(),hole_width:ge().optional(),hole_height:ge().optional(),pad_outline:st(Ee({x:En,y:En})).min(3),hole_offset_x:En.default(0),hole_offset_y:En.default(0),is_covered_with_solder_mask:Be().optional(),x:En,y:En,layers:st(ha),port_hints:st(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),pcb_plated_hole_id:Tn("pcb_plated_hole"),soldermask_margin:ge().optional(),ccw_rotation:dd.optional()}),kao=an([ges,Aes,fes,yes,xes,Ces]);zt(!0);zt(!0);zt(!0);zt(!0);zt(!0);zt(!0);var Lao=Ee({type:ce("pcb_port"),pcb_port_id:Tn("pcb_port"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),source_port_id:k(),pcb_component_id:k().optional(),x:En,y:En,layers:st(ha),is_board_pinout:Be().optional()}).describe("Defines a port on the PCB");zt(!0);var bes=Ee({type:ce("pcb_smtpad"),shape:ce("circle"),pcb_smtpad_id:Tn("pcb_smtpad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:En,y:En,radius:ge(),layer:ha,port_hints:st(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),is_covered_with_solder_mask:Be().optional(),soldermask_margin:ge().optional(),solderpaste_margin:ge().optional()}),Ies=Ee({type:ce("pcb_smtpad"),shape:ce("rect"),pcb_smtpad_id:Tn("pcb_smtpad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:En,y:En,width:ge(),height:ge(),rect_border_radius:ge().optional(),corner_radius:ge().optional(),layer:ha,port_hints:st(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),is_covered_with_solder_mask:Be().optional(),soldermask_margin:ge().optional(),soldermask_margin_left:ge().optional(),soldermask_margin_top:ge().optional(),soldermask_margin_right:ge().optional(),soldermask_margin_bottom:ge().optional(),solderpaste_margin:ge().optional()}),ves=Ee({type:ce("pcb_smtpad"),shape:ce("rotated_rect"),pcb_smtpad_id:Tn("pcb_smtpad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:En,y:En,width:ge(),height:ge(),rect_border_radius:ge().optional(),corner_radius:ge().optional(),ccw_rotation:dd,layer:ha,port_hints:st(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),is_covered_with_solder_mask:Be().optional(),soldermask_margin:ge().optional(),soldermask_margin_left:ge().optional(),soldermask_margin_top:ge().optional(),soldermask_margin_right:ge().optional(),soldermask_margin_bottom:ge().optional(),solderpaste_margin:ge().optional()}),Hao=Ee({type:ce("pcb_smtpad"),shape:ce("pill"),pcb_smtpad_id:Tn("pcb_smtpad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:En,y:En,width:ge(),height:ge(),radius:ge(),layer:ha,port_hints:st(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),is_covered_with_solder_mask:Be().optional(),soldermask_margin:ge().optional(),solderpaste_margin:ge().optional()}),Ses=Ee({type:ce("pcb_smtpad"),shape:ce("rotated_pill"),pcb_smtpad_id:Tn("pcb_smtpad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:En,y:En,width:ge(),height:ge(),radius:ge(),ccw_rotation:dd,layer:ha,port_hints:st(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),is_covered_with_solder_mask:Be().optional(),soldermask_margin:ge().optional(),solderpaste_margin:ge().optional()}),Pes=Ee({type:ce("pcb_smtpad"),shape:ce("polygon"),pcb_smtpad_id:Tn("pcb_smtpad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),points:st(mr),layer:ha,port_hints:st(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),is_covered_with_solder_mask:Be().optional(),soldermask_margin:ge().optional(),solderpaste_margin:ge().optional()}),Fao=ss("shape",[bes,Ies,ves,Ses,Hao,Pes]).describe("Defines an SMT pad on the PCB");zt(!0);zt(!0);zt(!0);zt(!0);zt(!0);zt(!0);var Ees=Ee({type:ce("pcb_solder_paste"),shape:ce("circle"),pcb_solder_paste_id:Tn("pcb_solder_paste"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:En,y:En,radius:ge(),layer:ha,pcb_component_id:k().optional(),pcb_smtpad_id:k().optional()}),Mes=Ee({type:ce("pcb_solder_paste"),shape:ce("rect"),pcb_solder_paste_id:Tn("pcb_solder_paste"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:En,y:En,width:ge(),height:ge(),layer:ha,pcb_component_id:k().optional(),pcb_smtpad_id:k().optional()}),wes=Ee({type:ce("pcb_solder_paste"),shape:ce("pill"),pcb_solder_paste_id:Tn("pcb_solder_paste"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:En,y:En,width:ge(),height:ge(),radius:ge(),layer:ha,pcb_component_id:k().optional(),pcb_smtpad_id:k().optional()}),Bes=Ee({type:ce("pcb_solder_paste"),shape:ce("rotated_rect"),pcb_solder_paste_id:Tn("pcb_solder_paste"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:En,y:En,width:ge(),height:ge(),ccw_rotation:En,layer:ha,pcb_component_id:k().optional(),pcb_smtpad_id:k().optional()}),Tes=Ee({type:ce("pcb_solder_paste"),shape:ce("rotated_pill"),pcb_solder_paste_id:Tn("pcb_solder_paste"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:En,y:En,width:ge(),height:ge(),radius:ge(),ccw_rotation:dd,layer:ha,pcb_component_id:k().optional(),pcb_smtpad_id:k().optional()}),Des=Ee({type:ce("pcb_solder_paste"),shape:ce("oval"),pcb_solder_paste_id:Tn("pcb_solder_paste"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:En,y:En,width:ge(),height:ge(),layer:ha,pcb_component_id:k().optional(),pcb_smtpad_id:k().optional()}),Nes=gme.extend({type:ce("pcb_solder_paste"),pcb_solder_paste_id:Tn("pcb_solder_paste"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),holes:st(gme.shape.points).optional(),layer:ha,pcb_component_id:k().optional(),pcb_smtpad_id:k().optional()}),zao=an([Ees,Mes,wes,Bes,Tes,Des,Nes]).describe("Defines solderpaste on the PCB");zt(!0);zt(!0);zt(!0);zt(!0);zt(!0);zt(!0);zt(!0);var LBe=Ee({type:ce("pcb_soldermask_opening"),pcb_soldermask_opening_id:Tn("pcb_soldermask_opening"),layer:ha.pipe(ag),pcb_component_id:k().optional(),pcb_group_id:k().optional(),subcircuit_id:k().optional()}),Oao=ss("shape",[a_t.extend(LBe.shape),zBe.extend(LBe.shape),c_t.extend(LBe.shape),gme.extend(LBe.shape)]).describe("An explicit opening in top or bottom solder mask or flex coverlay, independent of pads. Removes mask without adding copper or solder paste.");zt(!0);var Vao=Ee({type:ce("pcb_text"),pcb_text_id:Tn("pcb_text"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),text:k(),center:mr,layer:ha,width:qo,height:qo,lines:ge(),align:bt(["bottom-left"])}).describe("Defines text on the PCB");zt(!0);var Qio=En.pipe(ge().finite().positive()),Yao=Ee({route_type:ce("wire"),x:En,y:En,width:En,start_width:Qio.optional(),end_width:Qio.optional(),width_interpolation_mode:bt(["linear","quadratic"]).optional(),copper_pour_id:k().optional(),is_inside_copper_pour:Be().optional(),start_pcb_port_id:k().optional(),end_pcb_port_id:k().optional(),layer:ha}).superRefine((e,t)=>{let n=[e.start_width,e.end_width,e.width_interpolation_mode].filter((o)=>o!==void 0).length;if(n===0)return;if(n!==3)t.addIssue({code:Gt.custom,message:"Wire taper requires start_width, end_width and width_interpolation_mode together"});if(e.width!==e.start_width)t.addIssue({code:Gt.custom,path:["start_width"],message:"start_width must equal width"});if(!Number.isFinite(e.x)||!Number.isFinite(e.y))t.addIssue({code:Gt.custom,message:"Tapered wire coordinates must be finite"})}),Gao=Ee({route_type:ce("via"),x:En,y:En,copper_pour_id:k().optional(),is_inside_copper_pour:Be().optional(),hole_diameter:En.optional(),outer_diameter:En.optional(),tented_on_top:Be().optional(),tented_on_bottom:Be().optional(),from_layer:ha,to_layer:ha}),Uao=Ee({route_type:ce("through_pad"),start:mr,end:mr,width:En,start_layer:ha,end_layer:ha,pcb_smtpad_id:k().optional(),pcb_plated_hole_id:k().optional()}),Wao=an([Yao,Gao,Uao]),Xao=Ee({type:ce("pcb_trace"),source_trace_id:k().optional(),pcb_component_id:k().optional(),pcb_trace_id:Tn("pcb_trace"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),route_thickness_mode:bt(["constant","interpolated"]).default("constant").optional(),route_order_index:ge().optional(),should_round_corners:Be().optional(),trace_length:ge().optional(),is_antenna_trace:Be().optional(),highlight_color:k().optional(),route:st(Wao).superRefine((e,t)=>{for(let[n,o]of e.entries()){if(o.route_type!=="wire"||o.width_interpolation_mode===void 0)continue;let r=e[n+1],i=r?.route_type==="through_pad"?r.start:r,s=r?.route_type==="wire"?r.layer:r?.route_type==="via"?r.from_layer:r?.start_layer,a=i?Math.hypot(i.x-o.x,i.y-o.y):NaN;if(!Number.isFinite(a)||a<=0||s!==o.layer)t.addIssue({code:Gt.custom,path:[n],message:"Tapered wire must lead to a distinct finite next point on the same layer"})}})}).describe("Defines a trace on the PCB");zt(!0);zt(!0);var jao=Ee({type:ce("pcb_trace_warning"),pcb_trace_warning_id:Tn("pcb_trace_warning"),warning_type:ce("pcb_trace_warning").default("pcb_trace_warning"),message:k(),center:mr.optional(),pcb_trace_id:k(),source_trace_id:k(),pcb_component_ids:st(k()),pcb_port_ids:st(k()),subcircuit_id:k().optional()}).describe("Defines a trace warning on the PCB");zt(!0);var Kao=Ee({type:ce("pcb_trace_too_long_error"),pcb_trace_too_long_error_id:Tn("pcb_trace_too_long_error"),error_type:ce("pcb_trace_too_long_error").default("pcb_trace_too_long_error"),message:k(),pcb_trace_id:k(),source_net_id:k().optional(),source_trace_id:k().optional(),actual_trace_length:En,maximum_trace_length:En,subcircuit_id:k().optional()}).describe("Error emitted when a PCB trace is longer than its maximum allowed length");zt(!0);var $ao=Hc.extend({type:ce("pcb_bus_length_skew_error"),pcb_bus_length_skew_error_id:Tn("pcb_bus_length_skew_error"),error_type:ce("pcb_bus_length_skew_error").default("pcb_bus_length_skew_error"),source_bus_id:k(),source_trace_ids:st(k()),pcb_trace_ids:st(k()),actual_length_skew:ge().nonnegative().finite(),maximum_length_skew:ge().nonnegative().finite(),subcircuit_id:k().optional()});zt(!0);var qao=Ee({type:ce("pcb_trace_too_long_warning"),pcb_trace_too_long_warning_id:Tn("pcb_trace_too_long_warning"),warning_type:ce("pcb_trace_too_long_warning").default("pcb_trace_too_long_warning"),message:k(),pcb_trace_id:k(),source_net_id:k().optional(),source_trace_id:k().optional(),actual_trace_length:En,maximum_trace_length:En,subcircuit_id:k().optional()}).describe("Warning emitted when a PCB trace is longer than its maximum allowed length");zt(!0);var Jao=Ee({type:ce("pcb_trace_too_many_vias_warning"),pcb_trace_too_many_vias_warning_id:Tn("pcb_trace_too_many_vias_warning"),warning_type:ce("pcb_trace_too_many_vias_warning").default("pcb_trace_too_many_vias_warning"),message:k(),pcb_trace_id:k(),source_net_id:k().optional(),source_trace_id:k().optional(),actual_via_count:ge().int().nonnegative(),maximum_via_count:ge().int().nonnegative(),subcircuit_id:k().optional()}).describe("Warning emitted when a PCB trace has more vias than its maximum allowed count");zt(!0);var yU=Hc.extend({type:ce("pcb_bus_routing_constraint_error"),pcb_bus_routing_constraint_error_id:Tn("pcb_bus_routing_constraint_error"),error_type:ce("pcb_bus_routing_constraint_error").default("pcb_bus_routing_constraint_error"),source_bus_id:k(),source_trace_ids:st(k()).min(1),pcb_trace_ids:st(k()),subcircuit_id:k().optional()}),Zao=ss("routing_rule",[yU.extend({routing_rule:ce("length_skew"),actual_length_skew:ge().nonnegative().finite(),maximum_length_skew:ge().nonnegative().finite()}),yU.extend({routing_rule:ce("min_length"),actual_trace_length:ge().nonnegative().finite(),minimum_trace_length:ge().finite()}),yU.extend({routing_rule:ce("max_length"),actual_trace_length:ge().nonnegative().finite(),maximum_trace_length:ge().finite()}),yU.extend({routing_rule:ce("target_length"),actual_trace_length:ge().nonnegative().finite(),target_trace_length:ge().finite(),length_tolerance:ge().nonnegative().finite()}),yU.extend({routing_rule:ce("pcb_trace_spacing"),other_pcb_trace_id:k(),other_source_trace_id:k().optional(),actual_centerline_spacing:ge().nonnegative().finite(),minimum_centerline_spacing:ge().positive().finite()}),yU.extend({routing_rule:ce("pcb_spacing_to_other_signals"),other_pcb_trace_id:k(),other_source_trace_id:k().optional(),actual_centerline_spacing:ge().nonnegative().finite(),minimum_centerline_spacing:ge().positive().finite()}),yU.extend({routing_rule:ce("impedance_target"),target_impedance:ge().positive().finite(),minimum_impedance:ge().positive().finite().optional(),maximum_impedance:ge().positive().finite().optional()})]).superRefine((e,t)=>{if(e.routing_rule!=="impedance_target")return;if(e.minimum_impedance===void 0&&e.maximum_impedance===void 0)t.addIssue({code:Gt.custom,path:["minimum_impedance"],message:"Provide an impedance bound"});if(e.minimum_impedance!==void 0&&e.maximum_impedance!==void 0&&e.minimum_impedance>e.maximum_impedance)t.addIssue({code:Gt.custom,path:["maximum_impedance"],message:"Impedance bounds must be ordered"})}).describe("A declared bus or differential-pair routing constraint is violated.");zt(!0);var pme=Ee({type:ce("pcb_bus_routing_constraint_warning"),pcb_bus_routing_constraint_warning_id:Tn("pcb_bus_routing_constraint_warning"),warning_type:ce("pcb_bus_routing_constraint_warning").default("pcb_bus_routing_constraint_warning"),source_bus_id:k(),source_trace_ids:st(k()).min(1),pcb_trace_ids:st(k()),message:k(),subcircuit_id:k().optional()}).describe("A declared bus or pair constraint could not be verified; this is not a pass."),eco=ss("routing_rule",[pme.extend({routing_rule:ce("route_geometry")}),pme.extend({routing_rule:ce("reference_geometry")}),pme.extend({routing_rule:ce("spacing_geometry")}),pme.extend({routing_rule:ce("target_length")}),pme.extend({routing_rule:ce("physical_impedance")})]);zt(!0);var tco=Hc.extend({type:ce("pcb_trace_error"),pcb_trace_error_id:Tn("pcb_trace_error"),error_type:ce("pcb_trace_error").default("pcb_trace_error"),center:mr.optional(),pcb_trace_id:k(),source_trace_id:k(),pcb_component_ids:st(k()),pcb_port_ids:st(k()),subcircuit_id:k().optional()}).describe("Defines a trace error on the PCB");zt(!0);var nco=Hc.extend({type:ce("pcb_trace_missing_error"),pcb_trace_missing_error_id:Tn("pcb_trace_missing_error"),error_type:ce("pcb_trace_missing_error").default("pcb_trace_missing_error"),center:mr.optional(),source_trace_id:k(),pcb_component_ids:st(k()),pcb_port_ids:st(k()),subcircuit_id:k().optional()}).describe("Defines an error when a source trace has no corresponding PCB trace");zt(!0);var oco=Hc.extend({type:ce("pcb_port_not_matched_error"),pcb_error_id:Tn("pcb_error"),error_type:ce("pcb_port_not_matched_error").default("pcb_port_not_matched_error"),pcb_component_ids:st(k()),subcircuit_id:k().optional()}).describe("Defines a trace error on the PCB where a port is not matched");zt(!0);var rco=Hc.extend({type:ce("pcb_port_not_connected_error"),pcb_port_not_connected_error_id:Tn("pcb_port_not_connected_error"),error_type:ce("pcb_port_not_connected_error").default("pcb_port_not_connected_error"),pcb_port_ids:st(k()),pcb_component_ids:st(k()),subcircuit_id:k().optional()}).describe("Defines an error when a pcb port is not connected to any trace");zt(!0);var ico=Ee({type:ce("pcb_net"),pcb_net_id:Tn("pcb_net"),source_net_id:k().optional(),highlight_color:k().optional()}).describe("Defines a net on the PCB");zt(!0);var sco=Ee({type:ce("pcb_via"),pcb_via_id:Tn("pcb_via"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),subcircuit_connectivity_map_key:k().optional(),x:En,y:En,outer_diameter:En.default("0.6mm"),hole_diameter:En.default("0.25mm"),topmost_drill_layer:ha.optional(),bottommost_drill_layer:ha.optional(),through_hole:Be().optional(),from_layer:ha.optional(),to_layer:ha.optional(),layers:st(ha),pcb_port_ids:st(k()).optional(),pcb_trace_id:k().optional(),source_trace_id:k().optional(),source_net_id:k().min(1).optional(),net_is_assignable:Be().optional(),net_assigned:Be().optional(),is_tented:Be().optional(),tented_on_top:Be().optional(),tented_on_bottom:Be().optional()}).transform(({is_tented:e,...t})=>{if(e!==void 0)t.tented_on_top??=e,t.tented_on_bottom??=e;return t}).describe("Defines a via on the PCB");zt(!0);var aco=Ee({type:ce("pcb_board"),pcb_board_id:Tn("pcb_board"),pcb_panel_id:k().optional(),carrier_pcb_board_id:k().optional(),is_subcircuit:Be().optional(),subcircuit_id:k().optional(),is_mounted_to_carrier_board:Be().optional(),is_via_in_pad_allowed:Be().optional(),default_via_tented_on_top:Be().optional(),default_via_tented_on_bottom:Be().optional(),default_via_plugged:Be().optional(),width:qo.optional(),height:qo.optional(),center:mr,display_offset_x:k().optional().describe("How to display the x offset for this board, usually corresponding with how the user specified it"),display_offset_y:k().optional().describe("How to display the y offset for this board, usually corresponding with how the user specified it"),thickness:qo.optional().default(1.4),num_layers:ge().optional().default(4),allow_blind_and_buried_vias:Be().optional().describe("Whether autorouters may generate blind and buried vias. False restricts newly generated vias to the full board stack."),outline:st(mr).optional(),shape:bt(["rect","polygon"]).optional(),material:bt(["fr4","fr1","flex"]).default("fr4"),solder_mask_color:k().optional(),silkscreen_color:k().optional(),anchor_position:mr.optional(),anchor_alignment:WT.optional(),position_mode:bt(["relative_to_panel_anchor","none"]).optional()}).merge(Iao).describe("Defines the board outline of the PCB");zt(!0);var kio=mr.extend({x:qo.pipe(ge().finite()),y:qo.pipe(ge().finite())}),cco=Ee({type:ce("pcb_bend"),pcb_bend_id:Tn("pcb_bend"),pcb_board_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),name:k().optional(),start:kio,end:kio,bend_angle:dd.pipe(ge().finite()),bend_radius:qo.pipe(ge().finite().positive()),bend_side:bt(["left","right"])}).refine(({start:e,end:t})=>e.x!==t.x||e.y!==t.y,{message:"Bend centerline endpoints must be distinct",path:["end"]}).describe("Defines a finite-radius bend on a flat PCB for runtime CAD folding");zt(!0);var i_t=qo.pipe(ge().finite().positive()),lco=mr.extend({x:qo.pipe(ge().finite()),y:qo.pipe(ge().finite())}),hco=Ee({type:ce("pcb_stiffener"),pcb_stiffener_id:Tn("pcb_stiffener"),pcb_board_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),name:k().optional(),layer:bt(["top","bottom"]),material:bt(["fr4","polyimide","stainless_steel","aluminum"]),thickness:i_t,adhesive_thickness:qo.pipe(ge().finite().nonnegative()).optional()}),dco=hco.extend({shape:ce("rect"),center:lco,rotation:dd.pipe(ge().finite()).optional(),width:i_t,height:i_t,outline:Fm().optional()});zt(!0);var uco=hco.extend({shape:ce("polygon"),outline:st(lco).min(3).refine((e)=>{let t=e.reduce((n,o,r)=>{let i=e[(r+1)%e.length];return n+o.x*i.y-i.x*o.y},0);return Number.isFinite(t)&&t!==0},"Stiffener outline must enclose a nonzero area"),center:Fm().optional(),rotation:Fm().optional(),width:Fm().optional(),height:Fm().optional()});zt(!0);var pco=ss("shape",[dco,uco]).describe("Defines bonded mechanical PCB reinforcement without adding copper layers");zt(!0);var mco=Ee({type:ce("pcb_panel"),pcb_panel_id:Tn("pcb_panel"),width:qo,height:qo,center:mr,thickness:qo.optional().default(1.4),covered_with_solder_mask:Be().optional().default(!0)}).describe("Defines a PCB panel that can contain multiple boards");zt(!0);var _co=Hc.extend({type:ce("pcb_placement_error"),pcb_placement_error_id:Tn("pcb_placement_error"),error_type:ce("pcb_placement_error").default("pcb_placement_error"),subcircuit_id:k().optional()}).describe("Defines a placement error on the PCB");zt(!0);var gco=Hc.extend({type:ce("pcb_packing_error"),pcb_packing_error_id:Tn("pcb_packing_error"),error_type:ce("pcb_packing_error").default("pcb_packing_error"),pcb_group_id:k().optional(),subcircuit_id:k().optional()}).describe("Defines a failure to pack PCB components within layout bounds");zt(!0);var Aco=Hc.extend({type:ce("pcb_panelization_placement_error"),pcb_panelization_placement_error_id:Tn("pcb_panelization_placement_error"),error_type:ce("pcb_panelization_placement_error").default("pcb_panelization_placement_error"),pcb_panel_id:k().optional(),pcb_board_id:k().optional(),subcircuit_id:k().optional()}).describe("Defines a panelization placement error on the PCB");zt(!0);var fco=Ee({type:ce("pcb_trace_hint"),pcb_trace_hint_id:Tn("pcb_trace_hint"),pcb_port_id:k(),pcb_component_id:k(),route:st(bao),subcircuit_id:k().optional()}).describe("A hint that can be used during generation of a PCB trace");zt(!0);var yco=Ee({type:ce("pcb_silkscreen_line"),pcb_silkscreen_line_id:Tn("pcb_silkscreen_line"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),stroke_width:En.default("0.1mm"),x1:En,y1:En,x2:En,y2:En,layer:ag}).describe("Defines a silkscreen line on the PCB");zt(!0);var xco=Ee({type:ce("pcb_silkscreen_path"),pcb_silkscreen_path_id:Tn("pcb_silkscreen_path"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),layer:ag,route:st(mr),stroke_width:qo}).describe("Defines a silkscreen path on the PCB");zt(!0);var Cco=Ee({type:ce("pcb_silkscreen_text"),pcb_silkscreen_text_id:Tn("pcb_silkscreen_text"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),font:ce("tscircuit2024").default("tscircuit2024"),font_size:En.default("0.2mm"),pcb_component_id:k(),text:k(),is_knockout:Be().default(!1).optional(),knockout_padding:Ee({left:qo,top:qo,bottom:qo,right:qo}).default({left:"0.2mm",top:"0.2mm",bottom:"0.2mm",right:"0.2mm"}).optional(),ccw_rotation:ge().optional(),layer:ha,is_mirrored:Be().default(!1).optional(),anchor_position:mr.default({x:0,y:0}),anchor_alignment:WT.default("center")}).describe("Defines silkscreen text on the PCB");zt(!0);var bco=Ee({type:ce("pcb_copper_text"),pcb_copper_text_id:Tn("pcb_copper_text"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),font:ce("tscircuit2024").default("tscircuit2024"),font_size:En.default("0.2mm"),pcb_component_id:k(),text:k(),is_knockout:Be().default(!1).optional(),knockout_padding:Ee({left:qo,top:qo,bottom:qo,right:qo}).default({left:"0.2mm",top:"0.2mm",bottom:"0.2mm",right:"0.2mm"}).optional(),ccw_rotation:ge().optional(),layer:ha,is_mirrored:Be().default(!1).optional(),anchor_position:mr.default({x:0,y:0}),anchor_alignment:WT.default("center")}).describe("Defines copper text on the PCB");zt(!0);var Ico=Ee({type:ce("pcb_silkscreen_rect"),pcb_silkscreen_rect_id:Tn("pcb_silkscreen_rect"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:mr,width:qo,height:qo,layer:ha,stroke_width:qo.default("1mm"),corner_radius:qo.optional(),is_filled:Be().default(!0).optional(),has_stroke:Be().optional(),is_stroke_dashed:Be().optional(),ccw_rotation:ge().optional()}).describe("Defines a silkscreen rect on the PCB");zt(!0);var vco=Ee({type:ce("pcb_silkscreen_circle"),pcb_silkscreen_circle_id:Tn("pcb_silkscreen_circle"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:mr,radius:qo,layer:ag,stroke_width:qo.default("1mm"),is_filled:Be().optional()}).describe("Defines a silkscreen circle on the PCB");zt(!0);var Sco=Ee({type:ce("pcb_silkscreen_oval"),pcb_silkscreen_oval_id:Tn("pcb_silkscreen_oval"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:mr,radius_x:En,radius_y:En,layer:ag,ccw_rotation:dd.optional()}).describe("Defines a silkscreen oval on the PCB");zt(!0);var Res=Ee({type:ce("pcb_silkscreen_graphic"),pcb_silkscreen_graphic_id:Tn("pcb_silkscreen_graphic"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),layer:ag,image_asset:OBe.optional()}),Pco=Res.extend({shape:ce("brep"),brep_shape:k_t}).describe("Defines a BRep silkscreen graphic on the PCB");zt(!0);var Eco=ss("shape",[Pco]).describe("Defines a silkscreen graphic on the PCB");zt(!0);var Mco=Ee({type:ce("pcb_silkscreen_pill"),pcb_silkscreen_pill_id:Tn("pcb_silkscreen_pill"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:mr,width:qo,height:qo,layer:ha,ccw_rotation:ge().optional()}).describe("Defines a silkscreen pill on the PCB");zt(!0);var wco=Ee({type:ce("pcb_fabrication_note_text"),pcb_fabrication_note_text_id:Tn("pcb_fabrication_note_text"),subcircuit_id:k().optional(),pcb_group_id:k().optional(),font:ce("tscircuit2024").default("tscircuit2024"),font_size:En.default("1mm"),pcb_component_id:k(),text:k(),ccw_rotation:ge().optional(),layer:ag,anchor_position:mr.default({x:0,y:0}),anchor_alignment:bt(["center","top_left","top_right","bottom_left","bottom_right"]).default("center"),color:k().optional()}).describe("Defines a fabrication note in text on the PCB, useful for leaving notes for assemblers or fabricators");zt(!0);var Bco=Ee({type:ce("pcb_fabrication_note_path"),pcb_fabrication_note_path_id:Tn("pcb_fabrication_note_path"),pcb_component_id:k(),subcircuit_id:k().optional(),layer:ha,route:st(mr),stroke_width:qo,color:k().optional(),is_filled:Be().optional(),has_stroke:Be().optional()}).describe("Defines a fabrication path on the PCB for fabricators or assemblers");zt(!0);var Tco=Ee({type:ce("pcb_fabrication_note_rect"),pcb_fabrication_note_rect_id:Tn("pcb_fabrication_note_rect"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:mr,width:qo,height:qo,layer:ag,stroke_width:qo.default("0.1mm"),corner_radius:qo.optional(),is_filled:Be().optional(),has_stroke:Be().optional(),is_stroke_dashed:Be().optional(),color:k().optional()}).describe("Defines a fabrication note rectangle on the PCB");zt(!0);var Dco=Ee({type:ce("pcb_fabrication_note_dimension"),pcb_fabrication_note_dimension_id:Tn("pcb_fabrication_note_dimension"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),layer:ag,from:mr,to:mr,text:k().optional(),text_ccw_rotation:ge().optional(),offset:qo.optional(),offset_distance:qo.optional(),offset_direction:Ee({x:ge(),y:ge()}).optional(),font:ce("tscircuit2024").default("tscircuit2024"),font_size:qo.default("1mm"),color:k().optional(),arrow_size:qo.default("1mm")}).describe("Defines a measurement annotation within PCB fabrication notes");zt(!0);var Nco=Ee({type:ce("pcb_note_text"),pcb_note_text_id:Tn("pcb_note_text"),pcb_component_id:k().optional(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),name:k().optional(),font:ce("tscircuit2024").default("tscircuit2024"),font_size:En.default("1mm"),text:k().optional(),anchor_position:mr.default({x:0,y:0}),anchor_alignment:bt(["center","top_left","top_right","bottom_left","bottom_right"]).default("center"),layer:ag.default("top"),is_mirrored_from_top_view:Be().optional(),color:k().optional()}).describe("Defines a documentation note in text on the PCB");zt(!0);var Rco=Ee({type:ce("pcb_note_rect"),pcb_note_rect_id:Tn("pcb_note_rect"),pcb_component_id:k().optional(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),name:k().optional(),text:k().optional(),center:mr,width:qo,height:qo,layer:ag.default("top"),stroke_width:qo.default("0.1mm"),corner_radius:qo.optional(),is_filled:Be().optional(),has_stroke:Be().optional(),is_stroke_dashed:Be().optional(),color:k().optional()}).describe("Defines a rectangular documentation note on the PCB");zt(!0);var Qco=Ee({type:ce("pcb_note_path"),pcb_note_path_id:Tn("pcb_note_path"),pcb_component_id:k().optional(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),name:k().optional(),text:k().optional(),route:st(mr),layer:ag.default("top"),stroke_width:qo.default("0.1mm"),color:k().optional()}).describe("Defines a polyline documentation note on the PCB");zt(!0);var kco=Ee({type:ce("pcb_note_line"),pcb_note_line_id:Tn("pcb_note_line"),pcb_component_id:k().optional(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),name:k().optional(),text:k().optional(),x1:En,y1:En,x2:En,y2:En,layer:ag.default("top"),stroke_width:En.default("0.1mm"),color:k().optional(),is_dashed:Be().optional()}).describe("Defines a straight documentation note line on the PCB");zt(!0);var Lco=Ee({type:ce("pcb_note_dimension"),pcb_note_dimension_id:Tn("pcb_note_dimension"),pcb_component_id:k().optional(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),name:k().optional(),from:mr,to:mr,text:k().optional(),text_ccw_rotation:ge().optional(),offset_distance:qo.optional(),offset_direction:Ee({x:ge(),y:ge()}).optional(),font:ce("tscircuit2024").default("tscircuit2024"),font_size:qo.default("1mm"),layer:ag.default("top"),color:k().optional(),arrow_size:qo.default("1mm")}).describe("Defines a measurement annotation within PCB documentation notes");zt(!0);var Hco=Hc.extend({type:ce("pcb_footprint_overlap_error"),pcb_error_id:Tn("pcb_error"),error_type:ce("pcb_footprint_overlap_error").default("pcb_footprint_overlap_error"),pcb_smtpad_ids:st(k()).optional(),pcb_plated_hole_ids:st(k()).optional(),pcb_hole_ids:st(k()).optional(),pcb_keepout_ids:st(k()).optional()}).describe("Error emitted when a pcb footprint overlaps with another element");zt(!0);var Fco=Hc.extend({type:ce("pcb_courtyard_overlap_error"),pcb_error_id:Tn("pcb_error"),error_type:ce("pcb_courtyard_overlap_error").default("pcb_courtyard_overlap_error"),pcb_component_ids:c1([k(),k()])}).describe("Error emitted when the courtyard (CrtYd) of one PCB component overlaps with the courtyard of another");zt(!0);var zco=Ee({type:ce("pcb_keepout"),shape:ce("outline"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),outline:st(mr).min(2),stroke_width:qo,pcb_keepout_id:k(),layers:st(k()),description:k().optional(),excluded_pcb_component_ids:st(k()).optional(),warning_only:Be().optional(),allow_traces:Be().optional(),allow_placements:Be().optional()}),Oco=Ee({type:ce("pcb_keepout"),shape:ce("rect"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:mr,width:En,height:En,pcb_keepout_id:k(),layers:st(k()),description:k().optional(),excluded_pcb_component_ids:st(k()).optional(),warning_only:Be().optional(),allow_traces:Be().optional(),allow_placements:Be().optional()}).or(Ee({type:ce("pcb_keepout"),shape:ce("circle"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:mr,radius:En,pcb_keepout_id:k(),layers:st(k()),description:k().optional(),excluded_pcb_component_ids:st(k()).optional(),warning_only:Be().optional(),allow_traces:Be().optional(),allow_placements:Be().optional()})).or(zco);zt(!0);zt(!0);var Vco=Ee({type:ce("pcb_keepout_overlap_warning"),pcb_keepout_overlap_warning_id:Tn("pcb_keepout_overlap_warning"),warning_type:ce("pcb_keepout_overlap_warning").default("pcb_keepout_overlap_warning"),message:k(),pcb_keepout_id:k(),pcb_component_ids:st(k()).optional(),pcb_trace_ids:st(k()).optional(),pcb_smtpad_ids:st(k()).optional(),pcb_plated_hole_ids:st(k()).optional(),pcb_via_ids:st(k()).optional(),center:mr.optional(),subcircuit_id:k().optional()}).describe("Warning emitted when copper overlaps a PCB keepout with warning_only enabled");zt(!0);var WBe=Ee({type:ce("pcb_cutout"),pcb_cutout_id:Tn("pcb_cutout"),pcb_component_id:k().optional(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),pcb_board_id:k().optional(),pcb_panel_id:k().optional()}),Yco=WBe.extend({shape:ce("rect"),center:mr,width:qo,height:qo,rotation:dd.optional(),corner_radius:qo.optional()});zt(!0);var Gco=WBe.extend({shape:ce("circle"),center:mr,radius:qo});zt(!0);var Uco=WBe.extend({shape:ce("polygon"),points:st(mr)});zt(!0);var Wco=WBe.extend({shape:ce("path"),route:st(mr),slot_width:qo,slot_length:qo.optional(),space_between_slots:qo.optional(),slot_corner_radius:qo.optional()});zt(!0);var Xco=ss("shape",[Yco,Gco,Uco,Wco]).describe("Defines a cutout on the PCB, removing board material.");zt(!0);var jco=Hc.extend({type:ce("pcb_missing_footprint_error"),pcb_missing_footprint_error_id:Tn("pcb_missing_footprint_error"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),error_type:ce("pcb_missing_footprint_error").default("pcb_missing_footprint_error"),source_component_id:k()}).describe("Defines a missing footprint error on the PCB");zt(!0);var Kco=Hc.extend({type:ce("external_footprint_load_error"),external_footprint_load_error_id:Tn("external_footprint_load_error"),pcb_component_id:k(),source_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),footprinter_string:k().optional(),error_type:ce("external_footprint_load_error").default("external_footprint_load_error")}).describe("Defines an error when an external footprint fails to load");zt(!0);var $co=Hc.extend({type:ce("circuit_json_footprint_load_error"),circuit_json_footprint_load_error_id:Tn("circuit_json_footprint_load_error"),pcb_component_id:k(),source_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),error_type:ce("circuit_json_footprint_load_error").default("circuit_json_footprint_load_error"),circuit_json:st(Sd()).optional()}).describe("Defines an error when a circuit JSON footprint fails to load");zt(!0);var qco=Ee({type:ce("pcb_group"),pcb_group_id:Tn("pcb_group"),source_group_id:k(),is_subcircuit:Be().optional(),subcircuit_id:k().optional(),width:qo.optional(),height:qo.optional(),center:mr,display_offset_x:k().optional().describe("How to display the x offset for this group, usually corresponding with how the user specified it"),display_offset_y:k().optional().describe("How to display the y offset for this group, usually corresponding with how the user specified it"),outline:st(mr).optional(),anchor_position:mr.optional(),anchor_alignment:WT.default("center"),position_mode:bt(["packed","relative_to_group_anchor","none"]).optional(),positioned_relative_to_pcb_group_id:k().optional(),positioned_relative_to_pcb_board_id:k().optional(),pcb_component_ids:st(k()),child_layout_mode:bt(["packed","none"]).optional(),name:k().optional(),description:k().optional(),layout_mode:k().optional(),autorouter_configuration:Ee({trace_clearance:qo}).optional(),autorouter_used_string:k().optional()}).describe("Defines a group of components on the PCB");zt(!0);var Jco=Hc.extend({type:ce("pcb_autorouting_error"),pcb_error_id:Tn("pcb_autorouting_error"),error_type:ce("pcb_autorouting_error").default("pcb_autorouting_error"),subcircuit_id:k().optional()}).describe("The autorouting has failed to route a portion of the board");zt(!0);var Zco=Hc.extend({type:ce("pcb_preflight_routing_error"),pcb_preflight_routing_error_id:Tn("pcb_preflight_routing_error"),error_type:ce("pcb_preflight_routing_error").default("pcb_preflight_routing_error"),error_code:k(),subcircuit_id:k().optional(),pcb_group_id:k().optional(),routing_phase_index:ge().int().optional(),phase_name:k().optional(),source_trace_ids:st(k()).optional(),pcb_component_ids:st(k()).optional(),pcb_port_ids:st(k()).optional(),related_error_ids:st(k()).optional(),measurements:Ss(ge().finite()).optional()});zt(!0);var elo=Ee({type:ce("pcb_manual_edit_conflict_warning"),pcb_manual_edit_conflict_warning_id:Tn("pcb_manual_edit_conflict_warning"),warning_type:ce("pcb_manual_edit_conflict_warning").default("pcb_manual_edit_conflict_warning"),message:k(),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),source_component_id:k()}).describe("Warning emitted when a component has both manual placement and explicit pcbX/pcbY coordinates");zt(!0);var Lio=bt(["x-","x+","y+","y-"]),tlo=Ee({type:ce("pcb_connector_not_in_accessible_orientation_warning"),pcb_connector_not_in_accessible_orientation_warning_id:Tn("pcb_connector_not_in_accessible_orientation_warning"),warning_type:ce("pcb_connector_not_in_accessible_orientation_warning").default("pcb_connector_not_in_accessible_orientation_warning"),message:k(),pcb_component_id:k(),source_component_id:k().optional(),pcb_board_id:k().optional(),facing_direction:Lio,recommended_facing_direction:Lio,subcircuit_id:k().optional()}).describe("Warning emitted when a connector PCB component is facing inward toward the board and should be reoriented to an outward-facing direction");zt(!0);var nlo=Ee({type:ce("pcb_component_missing_courtyard_warning"),pcb_component_missing_courtyard_warning_id:Tn("pcb_component_missing_courtyard_warning"),warning_type:ce("pcb_component_missing_courtyard_warning").default("pcb_component_missing_courtyard_warning"),message:k(),pcb_component_id:k(),source_component_id:k().optional(),subcircuit_id:k().optional()}).describe("Warning emitted when a PCB component has no courtyard geometry");zt(!0);var olo=Ee({type:ce("supplier_footprint_mismatch_warning"),supplier_footprint_mismatch_warning_id:Tn("supplier_footprint_mismatch_warning"),warning_type:ce("supplier_footprint_mismatch_warning").default("supplier_footprint_mismatch_warning"),message:k(),source_component_id:k(),pcb_component_id:k().optional(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),supplier_name:Ame.optional(),supplier_part_number:k().optional(),supplier_footprint_url:k().optional(),footprint_copper_intersection_over_union:ge()}).describe("Warning emitted when a supplier part footprint does not match the expected footprint");zt(!0);var rlo=Ee({type:ce("pcb_fabricator_extra_charge_warning"),pcb_fabricator_extra_charge_warning_id:Tn("pcb_fabricator_extra_charge_warning"),warning_type:ce("pcb_fabricator_extra_charge_warning").default("pcb_fabricator_extra_charge_warning"),message:k(),fabricator_preset:k(),pcb_board_id:k().optional(),pcb_via_ids:st(k()).optional(),subcircuit_id:k().optional()}).describe("Warning that a design feature incurs an extra charge for the selected fabricator preset, such as via hole diameters below 0.3 mm with JLCPCB economy or standard presets.");zt(!0);var ilo=Ee({type:ce("pcb_breakout_point"),pcb_breakout_point_id:Tn("pcb_breakout_point"),pcb_group_id:k(),subcircuit_id:k().optional(),source_trace_id:k().optional(),source_port_id:k().optional(),source_net_id:k().optional(),layer:ha.optional(),x:En,y:En}).describe("Defines a routing target within a pcb_group for a source_trace or source_net");zt(!0);var slo=Ee({type:ce("pcb_ground_plane"),pcb_ground_plane_id:Tn("pcb_ground_plane"),source_pcb_ground_plane_id:k(),source_net_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional()}).describe("Defines a ground plane on the PCB");zt(!0);var alo=Ee({type:ce("pcb_ground_plane_region"),pcb_ground_plane_region_id:Tn("pcb_ground_plane_region"),pcb_ground_plane_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),layer:ha,points:st(mr)}).describe("Defines a polygon region of a ground plane");zt(!0);var clo=Ee({type:ce("pcb_thermal_spoke"),pcb_thermal_spoke_id:Tn("pcb_thermal_spoke"),pcb_ground_plane_id:k(),shape:k(),spoke_count:ge(),spoke_thickness:En,spoke_inner_diameter:En,spoke_outer_diameter:En,pcb_plated_hole_id:k().optional(),subcircuit_id:k().optional()}).describe("Pattern for connecting a ground plane to a plated hole");zt(!0);var L_t=Ee({type:ce("pcb_copper_pour"),pcb_copper_pour_id:Tn("pcb_copper_pour"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),layer:ha,source_net_id:k().optional(),covered_with_solder_mask:Be().optional().default(!0)}),llo=L_t.extend({shape:ce("rect"),center:mr,width:qo,height:qo,rotation:dd.optional()});zt(!0);var hlo=L_t.extend({shape:ce("brep"),brep_shape:k_t});zt(!0);var dlo=L_t.extend({shape:ce("polygon"),points:st(mr)});zt(!0);var ulo=ss("shape",[llo,hlo,dlo]).describe("Defines a copper pour on the PCB.");zt(!0);var plo=Hc.extend({type:ce("pcb_component_outside_board_error"),pcb_component_outside_board_error_id:Tn("pcb_component_outside_board_error"),error_type:ce("pcb_component_outside_board_error").default("pcb_component_outside_board_error"),pcb_component_id:k(),pcb_board_id:k(),component_center:mr,component_bounds:Ee({min_x:ge(),max_x:ge(),min_y:ge(),max_y:ge()}),subcircuit_id:k().optional(),source_component_id:k().optional()}).describe("Error emitted when a PCB component is placed outside the board boundaries");zt(!0);var mlo=Hc.extend({type:ce("pcb_component_not_on_board_edge_error"),pcb_component_not_on_board_edge_error_id:Tn("pcb_component_not_on_board_edge_error"),error_type:ce("pcb_component_not_on_board_edge_error").default("pcb_component_not_on_board_edge_error"),pcb_component_id:k(),pcb_board_id:k(),component_center:mr,pad_to_nearest_board_edge_distance:ge(),source_component_id:k().optional(),subcircuit_id:k().optional()}).describe("Error emitted when a component that must be placed on the board edge is centered away from the edge");zt(!0);var _lo=Hc.extend({type:ce("pcb_component_invalid_layer_error"),pcb_component_invalid_layer_error_id:Tn("pcb_component_invalid_layer_error"),error_type:ce("pcb_component_invalid_layer_error").default("pcb_component_invalid_layer_error"),pcb_component_id:k().optional(),source_component_id:k(),layer:ha,subcircuit_id:k().optional()}).describe("Error emitted when a component is placed on an invalid layer (components can only be on 'top' or 'bottom' layers)");zt(!0);var glo=Hc.extend({type:ce("pcb_via_clearance_error"),pcb_error_id:Tn("pcb_error"),error_type:ce("pcb_via_clearance_error").default("pcb_via_clearance_error"),pcb_via_ids:st(k()).min(2),minimum_clearance:En.optional(),actual_clearance:En.optional(),pcb_center:Ee({x:ge().optional(),y:ge().optional()}).optional(),subcircuit_id:k().optional()}).describe("Error emitted when vias are closer than the allowed clearance");zt(!0);var Alo=Hc.extend({type:ce("pcb_via_trace_clearance_error"),pcb_via_trace_clearance_error_id:Tn("pcb_via_trace_clearance_error"),error_type:ce("pcb_via_trace_clearance_error").default("pcb_via_trace_clearance_error"),pcb_via_id:k(),pcb_trace_id:k(),minimum_clearance:En.optional(),actual_clearance:En.optional(),center:Ee({x:ge().optional(),y:ge().optional()}).optional(),subcircuit_id:k().optional()}).describe("Error emitted when a via and trace are closer than the allowed clearance");zt(!0);var flo=Hc.extend({type:ce("pcb_pad_pad_clearance_error"),pcb_pad_pad_clearance_error_id:Tn("pcb_pad_pad_clearance_error"),error_type:ce("pcb_pad_pad_clearance_error").default("pcb_pad_pad_clearance_error"),pcb_pad_ids:st(k()).min(2),minimum_clearance:En.optional(),actual_clearance:En.optional(),center:Ee({x:ge().optional(),y:ge().optional()}).optional(),subcircuit_id:k().optional()}).describe("Error emitted when pads are closer than the allowed clearance");zt(!0);var ylo=Hc.extend({type:ce("pcb_pad_trace_clearance_error"),pcb_pad_trace_clearance_error_id:Tn("pcb_pad_trace_clearance_error"),error_type:ce("pcb_pad_trace_clearance_error").default("pcb_pad_trace_clearance_error"),pcb_pad_id:k(),pcb_trace_id:k(),minimum_clearance:En.optional(),actual_clearance:En.optional(),center:Ee({x:ge().optional(),y:ge().optional()}).optional(),subcircuit_id:k().optional()}).describe("Error emitted when a pad and trace are closer than allowed clearance");zt(!0);var xlo=Ee({type:ce("pcb_courtyard_rect"),pcb_courtyard_rect_id:Tn("pcb_courtyard_rect"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:mr,width:qo,height:qo,layer:ag,ccw_rotation:dd.optional(),color:k().optional()}).describe("Defines a courtyard rectangle on the PCB");zt(!0);var Clo=Ee({type:ce("pcb_courtyard_outline"),pcb_courtyard_outline_id:Tn("pcb_courtyard_outline"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),layer:ag,outline:st(mr).min(2)}).describe("Defines a courtyard outline on the PCB");zt(!0);var blo=Ee({type:ce("pcb_courtyard_polygon"),pcb_courtyard_polygon_id:Tn("pcb_courtyard_polygon"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),layer:ag,points:st(mr).min(3),color:k().optional()}).describe("Defines a courtyard polygon on the PCB");zt(!0);var Ilo=Ee({type:ce("pcb_courtyard_circle"),pcb_courtyard_circle_id:Tn("pcb_courtyard_circle"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:mr,radius:qo,layer:ag,color:k().optional()}).describe("Defines a courtyard circle on the PCB");zt(!0);var vlo=Ee({type:ce("pcb_courtyard_pill"),pcb_courtyard_pill_id:Tn("pcb_courtyard_pill"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:mr,width:qo,height:qo,radius:qo,layer:ag,color:k().optional()}).describe("Defines a courtyard pill on the PCB");zt(!0);var Qes=["obj","stl","3mf","gltf","glb","step","wrl"],Slo=["x+","x-","y+","y-","z+","z-"],kes={obj:"z+",stl:"z+","3mf":"z+",gltf:"y+",glb:"y+",step:"z+",wrl:"y+"},Plo=Ee({type:ce("cad_component"),cad_component_id:k(),pcb_component_id:k().optional().describe("Optional PCB component reference; omit for CAD geometry without a PCB component"),source_component_id:k(),position:BE,rotation:BE.optional(),is_on_folded_board:Be().optional().describe("True when position and rotation describe the assembled folded board pose. False or omitted means the flat board pose. PCB records remain flat; pcb_component_id identifies the flat mount and owning board for reversible transforms."),size:BE.optional(),layer:ha.optional(),subcircuit_id:k().optional(),footprinter_string:k().optional(),model_obj_url:k().optional(),model_stl_url:k().optional(),model_3mf_url:k().optional(),model_gltf_url:k().optional(),model_glb_url:k().optional(),model_step_url:k().optional(),model_wrl_url:k().optional(),model_asset:OBe.optional(),model_unit_to_mm_scale_factor:ge().optional(),model_board_normal_direction:bt(Slo).optional().describe(`The direction in the model's coordinate space that is considered "up" or "coming out of the board surface"`),model_origin_position:BE.optional(),model_origin_alignment:bt(["unknown","center","center_of_component_on_board_surface","bottom_center_of_component"]).optional(),model_object_fit:bt(["contain_within_bounds","fill_bounds"]).optional().default("contain_within_bounds"),model_jscad:Sd().optional(),show_as_translucent_model:Be().optional(),show_as_bounding_box:Be().optional(),show_hidden_edges:Be().optional(),anchor_alignment:bt(["center","center_of_component_on_board_surface"]).optional().default("center")}).describe("Defines CAD geometry, optionally associated with a PCB component");zt(!0);var Elo=Hc.extend({type:ce("cad_collision_error"),cad_collision_error_id:Tn("cad_collision_error"),error_type:ce("cad_collision_error").default("cad_collision_error"),cad_component_ids:st(k()).min(1),pcb_component_ids:st(k()).optional(),source_component_ids:st(k()).min(1),intersection_area_mm2:ge().finite().nonnegative(),threshold_area_mm2:ge().finite().nonnegative()}).describe("An aperture-bearing part intersects the finished enclosure. The intersection_area_mm2 is the union silhouette area of the solid intersection projected along the aperture face normal, in the right-handed Circuit JSON world frame (+X right, +Y top, +Z above). It is an area in square millimetres, not intersection volume or surface area. This indicates possible aperture misplacement, insufficient size/depth, or body clearance problems; it does not prove which cause applies.");zt(!0);var Mlo=Ee({type:ce("cad_cable"),cad_cable_id:k(),name:k().min(1),from_source_component_id:k(),to_source_component_id:k(),cableprinter_string:k().min(1).describe('Physical cable definition, e.g. "usb_c" or "jst_ph_pins6". Independent of the route.'),path:st(BE).min(2).refine((e)=>e.every((t,n)=>[t.x,t.y,t.z].every(Number.isFinite)&&(n===0||Math.hypot(t.x-e[n-1].x,t.y-e[n-1].y,t.z-e[n-1].z)>0.00000001)),"Cable paths require finite, distinct consecutive points").describe("Resolved cable centerline points in right-handed circuit world, millimeters: +X right, +Y top, +Z above. First/last samples are connector wire exits; their tangents point into/out of the cable. Includes routing/slack; renderers must not recompute the path.")}).describe("A physical assembly cable with a resolved 3D route. Several cables are independent cad_cable records, each with its own endpoints, definition and path. Does not imply electrical pin mapping.");zt(!0);var H_t=bt(["sinewave","square","triangle","sawtooth"]),Les=an([k(),ge()]).transform((e)=>{if(typeof e==="string"){if(e.endsWith("%"))return parseFloat(e.slice(0,-1))/100;return parseFloat(e)}return e}).pipe(ge().min(0,"Duty cycle must be non-negative").max(1,"Duty cycle cannot be greater than 100%")),wlo=Ee({type:ce("simulation_voltage_source"),simulation_voltage_source_id:Tn("simulation_voltage_source"),is_dc_source:ce(!0).optional().default(!0),positive_source_port_id:k().optional(),negative_source_port_id:k().optional(),positive_source_net_id:k().optional(),negative_source_net_id:k().optional(),voltage:J6,ac_magnitude:J6.optional(),ac_phase:dd.optional()}).describe("Defines a DC voltage source for simulation"),Blo=Ee({type:ce("simulation_voltage_source"),simulation_voltage_source_id:Tn("simulation_voltage_source"),is_dc_source:ce(!1),terminal1_source_port_id:k().optional(),terminal2_source_port_id:k().optional(),terminal1_source_net_id:k().optional(),terminal2_source_net_id:k().optional(),voltage:J6.optional(),frequency:xU.optional(),peak_to_peak_voltage:J6.optional(),wave_shape:H_t.optional(),phase:dd.optional(),duty_cycle:Les.optional(),pulse_delay:hA.optional(),rise_time:hA.optional(),fall_time:hA.optional(),pulse_width:hA.optional(),period:hA.optional(),ac_magnitude:J6.optional(),ac_phase:dd.optional()}).describe("Defines an AC voltage source for simulation"),Tlo=an([wlo,Blo]).describe("Defines a voltage source for simulation");zt(!0);zt(!0);zt(!0);var Hes=an([k(),ge()]).transform((e)=>{if(typeof e==="string"){if(e.endsWith("%"))return parseFloat(e.slice(0,-1))/100;return parseFloat(e)}return e}).pipe(ge().min(0,"Duty cycle must be non-negative").max(1,"Duty cycle cannot be greater than 100%")),Dlo=Ee({type:ce("simulation_current_source"),simulation_current_source_id:Tn("simulation_current_source"),is_dc_source:ce(!0).optional().default(!0),positive_source_port_id:k().optional(),negative_source_port_id:k().optional(),positive_source_net_id:k().optional(),negative_source_net_id:k().optional(),current:AH,ac_magnitude:AH.optional(),ac_phase:dd.optional()}).describe("Defines a DC current source for simulation"),Nlo=Ee({type:ce("simulation_current_source"),simulation_current_source_id:Tn("simulation_current_source"),is_dc_source:ce(!1),terminal1_source_port_id:k().optional(),terminal2_source_port_id:k().optional(),terminal1_source_net_id:k().optional(),terminal2_source_net_id:k().optional(),current:AH.optional(),frequency:xU.optional(),peak_to_peak_current:AH.optional(),wave_shape:H_t.optional(),phase:dd.optional(),duty_cycle:Hes.optional(),ac_magnitude:AH.optional(),ac_phase:dd.optional()}).describe("Defines an AC current source for simulation"),Rlo=an([Dlo,Nlo]).describe("Defines a current source for simulation");zt(!0);zt(!0);zt(!0);var XBe=cc((e)=>e==="V"||e==="A"),F_t=cc((e)=>e==="Ω"||e==="F"||e==="H"||e==="V"||e==="A"),Qlo=an([ce("spice_dc_sweep"),ce("spice_dc_operating_point"),ce("spice_transient_analysis"),ce("spice_ac_analysis")]),klo=Ee({method:bt(["trap","gear"]).optional(),reltol:an([ge(),k()]).optional(),abstol:an([ge(),k()]).optional(),vntol:an([ge(),k()]).optional()}).describe("SPICE solver options for a simulation experiment"),Llo=Ee({type:ce("simulation_experiment"),simulation_experiment_id:Tn("simulation_experiment"),name:k(),experiment_type:Qlo,time_per_step:ane.optional(),start_time_ms:hA.optional(),end_time_ms:hA.optional(),spice_options:klo.optional(),dc_sweep_voltage_source_id:k().optional(),dc_sweep_current_source_id:k().optional(),dc_sweep_start:ge().optional(),dc_sweep_stop:ge().optional(),dc_sweep_step:ge().refine((e)=>e!==0).optional(),dc_sweep_unit:XBe.optional(),ac_sweep_type:bt(["linear","decade","octave"]).optional(),ac_samples_per_interval:ge().int().positive().optional(),ac_sample_count:ge().int().positive().optional(),ac_start_frequency_hz:ge().positive().optional(),ac_stop_frequency_hz:ge().positive().optional()}).superRefine((e,t)=>{if(e.experiment_type==="spice_dc_sweep"){let n=["dc_sweep_start","dc_sweep_stop","dc_sweep_step","dc_sweep_unit"];for(let i of n)if(e[i]===void 0)t.addIssue({code:Gt.custom,path:[i],message:`${i} is required for a DC sweep`});let o=e.dc_sweep_voltage_source_id!==void 0,r=e.dc_sweep_current_source_id!==void 0;if(o===r)t.addIssue({code:Gt.custom,path:["dc_sweep_voltage_source_id"],message:"Exactly one DC sweep voltage or current source ID is required"})}if(e.experiment_type==="spice_ac_analysis"){if(e.ac_sweep_type===void 0)t.addIssue({code:Gt.custom,path:["ac_sweep_type"],message:"ac_sweep_type is required for an AC analysis"});if(e.ac_start_frequency_hz===void 0)t.addIssue({code:Gt.custom,path:["ac_start_frequency_hz"],message:"ac_start_frequency_hz is required for an AC analysis"});if(e.ac_stop_frequency_hz===void 0)t.addIssue({code:Gt.custom,path:["ac_stop_frequency_hz"],message:"ac_stop_frequency_hz is required for an AC analysis"});if(e.ac_sweep_type==="linear"&&e.ac_sample_count===void 0)t.addIssue({code:Gt.custom,path:["ac_sample_count"],message:"ac_sample_count is required for a linear AC analysis"});if((e.ac_sweep_type==="decade"||e.ac_sweep_type==="octave")&&e.ac_samples_per_interval===void 0)t.addIssue({code:Gt.custom,path:["ac_samples_per_interval"],message:"ac_samples_per_interval is required for decade and octave AC analyses"})}}).describe("Defines a simulation experiment configuration");zt(!0);var XT=Ee({simulation_parameter_sweep_id:k(),sweep_index:ge().int().nonnegative(),parameter_value:ge(),parameter_unit:F_t});zt(!0);var Hlo=Ee({type:ce("simulation_transient_voltage_graph"),simulation_transient_voltage_graph_id:Tn("simulation_transient_voltage_graph"),simulation_experiment_id:k(),simulation_parameter_sweep_coordinate:XT.optional(),timestamps_ms:st(ge()).optional(),voltage_levels:st(ge()),source_component_id:k().optional(),subcircuit_connectivity_map_key:k().optional(),time_per_step:ane,start_time_ms:hA,end_time_ms:hA,name:k().optional(),color:k().optional()}).describe("Stores voltage measurements over time for a simulation");zt(!0);var Flo=Ee({type:ce("simulation_transient_current_graph"),simulation_transient_current_graph_id:Tn("simulation_transient_current_graph"),simulation_experiment_id:k(),simulation_parameter_sweep_coordinate:XT.optional(),timestamps_ms:st(ge()).optional(),current_levels:st(ge()),source_component_id:k().optional(),subcircuit_connectivity_map_key:k().optional(),time_per_step:ane,start_time_ms:hA,end_time_ms:hA,name:k().optional(),color:k().optional()}).describe("Stores current measurements over time for a simulation");zt(!0);var zlo=Ee({type:ce("simulation_switch"),simulation_switch_id:Tn("simulation_switch"),source_component_id:k().optional(),closes_at:hA.optional(),opens_at:hA.optional(),starts_closed:Be().optional(),switching_frequency:xU.optional()}).describe("Defines a switch for simulation timing control");zt(!0);var Olo=Ee({type:ce("simulation_voltage_probe"),simulation_voltage_probe_id:Tn("simulation_voltage_probe"),source_component_id:k().optional(),name:k().optional(),signal_input_source_port_id:k().optional(),signal_input_source_net_id:k().optional(),reference_input_source_port_id:k().optional(),reference_input_source_net_id:k().optional(),subcircuit_id:k().optional(),color:k().optional()}).describe("Defines a voltage probe for simulation. If a reference input is not provided, it measures against ground. If a reference input is provided, it measures the differential voltage between two points.").superRefine((e,t)=>{if(e.reference_input_source_port_id||e.reference_input_source_net_id){let o=!!e.signal_input_source_port_id||!!e.reference_input_source_port_id,r=!!e.signal_input_source_net_id||!!e.reference_input_source_net_id;if(o&&r)t.addIssue({code:Gt.custom,message:"Cannot mix port and net connections in a differential probe."});else if(o){if(!e.signal_input_source_port_id||!e.reference_input_source_port_id)t.addIssue({code:Gt.custom,message:"Differential port probe requires both signal_input_source_port_id and reference_input_source_port_id."})}else if(r){if(!e.signal_input_source_net_id||!e.reference_input_source_net_id)t.addIssue({code:Gt.custom,message:"Differential net probe requires both signal_input_source_net_id and reference_input_source_net_id."})}}else if(!!e.signal_input_source_port_id===!!e.signal_input_source_net_id)t.addIssue({code:Gt.custom,message:"A voltage probe must have exactly one of signal_input_source_port_id or signal_input_source_net_id."})});zt(!0);var Vlo=Ee({type:ce("simulation_current_probe"),simulation_current_probe_id:Tn("simulation_current_probe"),source_component_id:k().optional(),name:k().optional(),positive_source_port_id:k().optional(),negative_source_port_id:k().optional(),positive_source_net_id:k().optional(),negative_source_net_id:k().optional(),subcircuit_id:k().optional(),color:k().optional()}).describe("Defines a current probe for simulation. It measures current flowing from the positive endpoint to the negative endpoint.").superRefine((e,t)=>{let n=!!e.positive_source_port_id,o=!!e.negative_source_port_id,r=!!e.positive_source_net_id,i=!!e.negative_source_net_id,s=n||o,a=r||i;if(s&&a){t.addIssue({code:Gt.custom,message:"Cannot mix port and net connections in a current probe."});return}if(s){if(!n||!o)t.addIssue({code:Gt.custom,message:"Current probe using source ports requires both positive_source_port_id and negative_source_port_id."});return}if(a){if(!r||!i)t.addIssue({code:Gt.custom,message:"Current probe using source nets requires both positive_source_net_id and negative_source_net_id."});return}t.addIssue({code:Gt.custom,message:"A current probe must have either positive/negative source port ids or positive/negative source net ids."})});zt(!0);var Ylo=Hc.extend({type:ce("simulation_unknown_experiment_error"),simulation_unknown_experiment_error_id:Tn("simulation_unknown_experiment_error"),error_type:ce("simulation_unknown_experiment_error").default("simulation_unknown_experiment_error"),simulation_experiment_id:k().optional(),subcircuit_id:k().optional()}).describe("An unknown error occurred during the simulation experiment.");zt(!0);var Fes=bt(["resistance","capacitance","inductance","voltage","current"]),mme=Ee({type:ce("simulation_parameter_sweep"),simulation_parameter_sweep_id:Tn("simulation_parameter_sweep"),simulation_experiment_id:k(),name:k().optional(),parameter_values:st(ge()).min(1),parameter_unit:F_t}),Glo=ss("parameter_type",[mme.extend({parameter_type:ce("resistance"),resistor_source_component_id:k()}),mme.extend({parameter_type:ce("capacitance"),capacitor_source_component_id:k()}),mme.extend({parameter_type:ce("inductance"),inductor_source_component_id:k()}),mme.extend({parameter_type:ce("voltage"),source_net_id:k()}),mme.extend({parameter_type:ce("current"),current_source_component_id:k()})]).describe("Repeats a simulation experiment over component parameter values");zt(!0);var Ulo=Ee({type:ce("simulation_dc_operating_point_voltage"),simulation_dc_operating_point_voltage_id:Tn("simulation_dc_operating_point_voltage"),simulation_experiment_id:k(),simulation_parameter_sweep_coordinate:XT.optional(),simulation_voltage_probe_id:k(),voltage:ge(),name:k().optional(),color:k().optional()});zt(!0);var Wlo=Ee({type:ce("simulation_dc_operating_point_current"),simulation_dc_operating_point_current_id:Tn("simulation_dc_operating_point_current"),simulation_experiment_id:k(),simulation_parameter_sweep_coordinate:XT.optional(),simulation_current_probe_id:k(),current:ge(),name:k().optional(),color:k().optional()});zt(!0);var Xlo=Ee({type:ce("simulation_dc_sweep_voltage_graph"),simulation_dc_sweep_voltage_graph_id:Tn("simulation_dc_sweep_voltage_graph"),simulation_experiment_id:k(),simulation_parameter_sweep_coordinate:XT.optional(),simulation_voltage_probe_id:k(),sweep_values:st(ge()),sweep_unit:XBe,voltage_levels:st(ge()),name:k().optional(),color:k().optional()}).refine((e)=>e.sweep_values.length===e.voltage_levels.length,{message:"sweep_values and voltage_levels must have the same length"});zt(!0);var jlo=Ee({type:ce("simulation_dc_sweep_current_graph"),simulation_dc_sweep_current_graph_id:Tn("simulation_dc_sweep_current_graph"),simulation_experiment_id:k(),simulation_parameter_sweep_coordinate:XT.optional(),simulation_current_probe_id:k(),sweep_values:st(ge()),sweep_unit:XBe,current_levels:st(ge()),name:k().optional(),color:k().optional()}).refine((e)=>e.sweep_values.length===e.current_levels.length,{message:"sweep_values and current_levels must have the same length"});zt(!0);var z_t=Ee({re:ge(),im:ge()});zt(!0);var Klo=Ee({type:ce("simulation_ac_sweep_voltage_graph"),simulation_ac_sweep_voltage_graph_id:Tn("simulation_ac_sweep_voltage_graph"),simulation_experiment_id:k(),simulation_parameter_sweep_coordinate:XT.optional(),simulation_voltage_probe_id:k(),frequencies_hz:st(ge()),complex_voltages:st(z_t),name:k().optional(),color:k().optional()}).refine((e)=>e.frequencies_hz.length===e.complex_voltages.length,{message:"frequencies_hz and complex_voltages must have the same length"});zt(!0);var $lo=Ee({type:ce("simulation_ac_sweep_current_graph"),simulation_ac_sweep_current_graph_id:Tn("simulation_ac_sweep_current_graph"),simulation_experiment_id:k(),simulation_parameter_sweep_coordinate:XT.optional(),simulation_current_probe_id:k(),frequencies_hz:st(ge()),complex_currents:st(z_t),name:k().optional(),color:k().optional()}).refine((e)=>e.frequencies_hz.length===e.complex_currents.length,{message:"frequencies_hz and complex_currents must have the same length"});zt(!0);var qlo=Ee({type:ce("simulation_op_amp"),simulation_op_amp_id:Tn("simulation_op_amp"),source_component_id:k().optional(),inverting_input_source_port_id:k(),non_inverting_input_source_port_id:k(),output_source_port_id:k(),positive_supply_source_port_id:k(),negative_supply_source_port_id:k()}).describe("Defines a simple ideal operational amplifier for simulation");zt(!0);var Jlo=Ee({type:ce("simulation_spice_subcircuit"),simulation_spice_subcircuit_id:Tn("simulation_spice_subcircuit"),source_component_id:k(),spice_pin_to_source_port_map:Ss(k(),k()),subcircuit_source:k()}).describe("Defines a custom SPICE subcircuit model for simulation");zt(!0);var Hio=(e)=>e!==void 0,Zlo=Ee({type:ce("simulation_oscilloscope_trace"),simulation_oscilloscope_trace_id:Tn("simulation_oscilloscope_trace"),simulation_transient_voltage_graph_id:k().optional(),simulation_transient_current_graph_id:k().optional(),simulation_voltage_probe_id:k().optional(),simulation_current_probe_id:k().optional(),display_name:k().optional(),color:k().optional(),display_center_value:ge().optional(),display_center_offset_divs:ge().optional(),volts_per_div:ge().positive().optional(),amps_per_div:ge().positive().optional()}).describe("Defines how a simulation measurement is rendered as an oscilloscope-style trace.").superRefine((e,t)=>{let n=[e.simulation_transient_voltage_graph_id,e.simulation_voltage_probe_id].filter(Hio).length,o=[e.simulation_transient_current_graph_id,e.simulation_current_probe_id].filter(Hio).length;if(n+o!==1)t.addIssue({code:Gt.custom,message:"An oscilloscope trace must reference exactly one voltage graph, current graph, voltage probe, or current probe."});if(n>0&&e.amps_per_div!==void 0)t.addIssue({code:Gt.custom,message:"Voltage oscilloscope traces must use volts_per_div, not amps_per_div."});if(o>0&&e.volts_per_div!==void 0)t.addIssue({code:Gt.custom,message:"Current oscilloscope traces must use amps_per_div, not volts_per_div."})});zt(!0);var eho=an([Lso,xso,kso,fso,yso,Aso,bso,Cso,p_t,h_t,YBe,u_t,d_t,m_t,__t,g_t,y_t,x_t,C_t,P_t,b_t,I_t,v_t,S_t,f_t,A_t,Sso,Eso,Iso,E_t,M_t,w_t,B_t,Mso,Qso,T_t,D_t,wso,Bso,Tso,Dso,Nso,Rso,N_t,R_t,vso,vao,Mao,Qao,jco,Kco,$co,elo,tlo,nlo,olo,rlo,kao,Oco,Vco,Lao,ico,Vao,Xao,jao,qao,Kao,$ao,Jao,sco,Fao,zao,Oao,aco,cco,pco,mco,qco,fco,yco,xco,Cco,Mco,bco,Ico,vco,Sco,Eco,Zao,eco,tco,nco,_co,gco,Aco,oco,rco,glo,Alo,flo,ylo,Bco,wco,Tco,Dco,Nco,Rco,Qco,kco,Lco,Jco,Zco,Hco,Fco,ilo,Xco,slo,alo,clo,ulo,plo,mlo,_lo,xlo,Clo,blo,Ilo,vlo,Hso,qso,Wso,Xso,jso,Kso,Gso,Uso,Jso,$so,Fso,eao,tao,Zso,iao,sao,aao,cao,lao,Aao,hao,dao,uao,gao,pao,mao,Plo,Mlo,Elo,Tlo,Rlo,Llo,Hlo,Flo,Ulo,Wlo,Xlo,jlo,Klo,$lo,Glo,zlo,Olo,Vlo,Zlo,Ylo,qlo,Jlo]),cne=eho;zt(!0);CU(!0);function fo(e,t){return Array.isArray(t)?[e.a*t[0]+e.c*t[1]+e.e,e.b*t[0]+e.d*t[1]+e.f]:{x:e.a*t.x+e.c*t.y+e.e,y:e.b*t.x+e.d*t.y+e.f}}function xf(){return{a:1,c:0,e:0,b:0,d:1,f:0}}function Cf(e){let{a:t,b:n,c:o,d:r,e:i,f:s}=e,a=t*r-n*o;return{a:r/a,b:n/-a,c:o/-a,d:t/a,e:(r*i-o*s)/-a,f:(n*i-t*s)/a}}function bU(e){return typeof e>"u"}function Ra(e,t=0){return{a:1,c:0,e,b:0,d:1,f:t}}function IU(...e){e=Array.isArray(e[0])?e[0]:e;let t=(n,o)=>({a:n.a*o.a+n.c*o.b,c:n.a*o.c+n.c*o.d,e:n.a*o.e+n.c*o.f+n.e,b:n.b*o.a+n.d*o.b,d:n.b*o.c+n.d*o.d,f:n.b*o.e+n.d*o.f+n.f});switch(e.length){case 0:throw Error("no matrices provided");case 1:return e[0];case 2:return t(e[0],e[1]);default:{let[n,o,...r]=e,i=t(n,o);return IU(i,...r)}}}function ud(...e){return IU(...e)}var{cos:zes,sin:Oes,PI:Ves}=Math;function fme(e,t,n){let o=zes(e),r=Oes(e),i={a:o,c:-r,e:0,b:r,d:o,f:0};if(bU(t)||bU(n))return i;return IU([Ra(t,n),i,Ra(-t,-n)])}function O_t(e,t=void 0,n=void 0){return fme(e*Ves/180,t,n)}function bf(e,t=void 0,n=void 0,o=void 0){if(bU(t))t=e;let r={a:e,c:0,e:0,b:0,d:t,f:0};if(bU(n)||bU(o))return r;return IU([Ra(n,o),r,Ra(-n,-o)])}var{tan:yRa}=Math;function Yes(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n}function jBe(e,t,n,o){var r=Error.call(this,e);if(Object.setPrototypeOf)Object.setPrototypeOf(r,jBe.prototype);return r.expected=t,r.found=n,r.location=o,r.name="SyntaxError",r}Yes(jBe,Error);function V_t(e,t,n){if(n=n||" ",e.length>t)return e;return t-=e.length,n+=n.repeat(t),e+n.slice(0,t)}jBe.prototype.format=function(e){var t="Error: "+this.message;if(this.location){var n=null,o;for(o=0;o<e.length;o++)if(e[o].source===this.location.source){n=e[o].text.split(/\r\n|\n|\r/g);break}var r=this.location.start,i=this.location.source&&typeof this.location.source.offset==="function"?this.location.source.offset(r):r,s=this.location.source+":"+i.line+":"+i.column;if(n){var a=this.location.end,c=V_t("",i.line.toString().length," "),l=n[r.line-1],h=r.line===a.line?a.column:l.length+1,d=h-r.column||1;t+=`
 --> `+s+`
`+c+` |
`+i.line+" | "+l+`
`+c+" | "+V_t("",r.column-1," ")+V_t("",d,"^")}else t+=`
 at `+s}return t};jBe.buildMessage=function(e,t){var n={literal:function(l){return'"'+r(l.text)+'"'},class:function(l){var h=l.parts.map(function(d){return Array.isArray(d)?i(d[0])+"-"+i(d[1]):i(d)});return"["+(l.inverted?"^":"")+h.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(l){return l.description}};function o(l){return l.charCodeAt(0).toString(16).toUpperCase()}function r(l){return l.replace(/\\/g,"\\\\").replace(/"/g,"\\\"").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(h){return"\\x0"+o(h)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(h){return"\\x"+o(h)})}function i(l){return l.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(h){return"\\x0"+o(h)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(h){return"\\x"+o(h)})}function s(l){return n[l.type](l)}function a(l){var h=l.map(s),d,u;if(h.sort(),h.length>0){for(d=1,u=1;d<h.length;d++)if(h[d-1]!==h[d])h[u]=h[d],u++;h.length=u}switch(h.length){case 1:return h[0];case 2:return h[0]+" or "+h[1];default:return h.slice(0,-1).join(", ")+", or "+h[h.length-1]}}function c(l){return l?'"'+r(l)+'"':"end of input"}return"Expected "+a(e)+" but "+c(t)+" found."};function Y_t(e,t=!1,n=!1){if(t)if(n)e=ud(e,bf(-1,-1));else e=ud(e,bf(1,-1));else if(n)e=ud(e,bf(-1,1));let o=e.a,r=e.b,i=e.c,s=e.d,a,c,l;if(o!==0||i!==0){let h=Math.hypot(o,i);a=h,c=(o*s-r*i)/h;let d=Math.acos(o/h);l=i>0?-d:d}else if(r!==0||s!==0){let h=Math.hypot(r,s);a=(o*s-r*i)/h,c=h;let d=Math.acos(r/h);l=Math.PI/2+(s>0?-d:d)}else a=0,c=0,l=0;if(n)a=-a;if(t)c=-c;return{translate:{tx:e.e,ty:e.f},scale:{sx:a,sy:c},rotation:{angle:l}}}var kuo=at(ln(),1),Luo=at(ln(),1);var tho=(e)=>{let t,n=new Set,o=(h,d)=>{let u=typeof h==="function"?h(t):h;if(!Object.is(u,t)){let _=t;t=(d!=null?d:typeof u!=="object"||u===null)?u:Object.assign({},t,u),n.forEach((p)=>p(t,_))}},r=()=>t,c={setState:o,getState:r,getInitialState:()=>l,subscribe:(h)=>(n.add(h),()=>n.delete(h)),destroy:()=>{if((import.meta.env?import.meta.env.MODE:void 0)!=="production")console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected.");n.clear()}},l=t=e(o,r,c);return c},nho=(e)=>e?tho(e):tho;var sho=at(ln(),1),aho=at(rho(),1),{useDebugValue:Wes}=sho.default,{useSyncExternalStoreWithSelector:Xes}=aho.default,iho=!1,jes=(e)=>e;function cho(e,t=jes,n){if((import.meta.env?import.meta.env.MODE:void 0)!=="production"&&n&&!iho)console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),iho=!0;let o=Xes(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return Wes(o),o}var Huo=at(ln(),1),Oos=at(ln(),1),Ouo=at(lo(),1),Yuo=at(ln(),1);var wi=at(ln(),1);function lho(e){var t,n,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=lho(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function Kes(){for(var e,t,n=0,o="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=lho(e))&&(o&&(o+=" "),o+=t);return o}var KT=Kes;var xme=(e)=>typeof e=="number"&&!isNaN(e),vU=(e)=>typeof e=="string",fC=(e)=>typeof e=="function",qBe=(e)=>vU(e)||fC(e)?e:null,U_t=(e)=>wi.isValidElement(e)||vU(e)||fC(e)||xme(e);function $es(e,t,n){n===void 0&&(n=300);let{scrollHeight:o,style:r}=e;requestAnimationFrame(()=>{r.minHeight="initial",r.height=o+"px",r.transition=`all ${n}ms`,requestAnimationFrame(()=>{r.height="0",r.padding="0",r.margin="0",setTimeout(t,n)})})}function ZBe(e){let{enter:t,exit:n,appendPosition:o=!1,collapse:r=!0,collapseDuration:i=300}=e;return function(s){let{children:a,position:c,preventExitTransition:l,done:h,nodeRef:d,isIn:u,playToast:_}=s,p=o?`${t}--${c}`:t,m=o?`${n}--${c}`:n,A=wi.useRef(0);return wi.useLayoutEffect(()=>{let g=d.current,f=p.split(" "),y=(x)=>{x.target===d.current&&(_(),g.removeEventListener("animationend",y),g.removeEventListener("animationcancel",y),A.current===0&&x.type!=="animationcancel"&&g.classList.remove(...f))};g.classList.add(...f),g.addEventListener("animationend",y),g.addEventListener("animationcancel",y)},[]),wi.useEffect(()=>{let g=d.current,f=()=>{g.removeEventListener("animationend",f),r?$es(g,h,i):h()};u||(l?f():(A.current=1,g.className+=` ${m}`,g.addEventListener("animationend",f)))},[u]),wi.default.createElement(wi.default.Fragment,null,a)}}function hho(e,t){return e!=null?{content:e.content,containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon,status:t}:{}}var Px=new Map,Cme=[],W_t=new Set,qes=(e)=>W_t.forEach((t)=>t(e)),uho=()=>Px.size>0;function pho(e,t){var n;if(t)return!((n=Px.get(t))==null||!n.isToastActive(e));let o=!1;return Px.forEach((r)=>{r.isToastActive(e)&&(o=!0)}),o}function mho(e,t){U_t(e)&&(uho()||Cme.push({content:e,options:t}),Px.forEach((n)=>{n.buildToast(e,t)}))}function dho(e,t){Px.forEach((n)=>{t!=null&&t!=null&&t.containerId?(t==null?void 0:t.containerId)===n.id&&n.toggle(e,t==null?void 0:t.id):n.toggle(e,t==null?void 0:t.id)})}function Jes(e){let{subscribe:t,getSnapshot:n,setProps:o}=wi.useRef(function(i){let s=i.containerId||1;return{subscribe(a){let c=function(h,d,u){let _=1,p=0,m=[],A=[],g=[],f=d,y=new Map,x=new Set,C=()=>{g=Array.from(y.values()),x.forEach((v)=>v())},b=(v)=>{A=v==null?[]:A.filter((P)=>P!==v),C()},I=(v)=>{let{toastId:P,onOpen:M,updateId:B,children:T}=v.props,N=B==null;v.staleId&&y.delete(v.staleId),y.set(P,v),A=[...A,v.props.toastId].filter((D)=>D!==v.staleId),C(),u(hho(v,N?"added":"updated")),N&&fC(M)&&M(wi.isValidElement(T)&&T.props)};return{id:h,props:f,observe:(v)=>(x.add(v),()=>x.delete(v)),toggle:(v,P)=>{y.forEach((M)=>{P!=null&&P!==M.props.toastId||fC(M.toggle)&&M.toggle(v)})},removeToast:b,toasts:y,clearQueue:()=>{p-=m.length,m=[]},buildToast:(v,P)=>{if(((X)=>{let{containerId:K,toastId:J,updateId:ee}=X,se=K?K!==h:h!==1,ne=y.has(J)&&ee==null;return se||ne})(P))return;let{toastId:M,updateId:B,data:T,staleId:N,delay:D}=P,L=()=>{b(M)},H=B==null;H&&p++;let V={...f,style:f.toastStyle,key:_++,...Object.fromEntries(Object.entries(P).filter((X)=>{let[K,J]=X;return J!=null})),toastId:M,updateId:B,data:T,closeToast:L,isIn:!1,className:qBe(P.className||f.toastClassName),bodyClassName:qBe(P.bodyClassName||f.bodyClassName),progressClassName:qBe(P.progressClassName||f.progressClassName),autoClose:!P.isLoading&&(O=P.autoClose,U=f.autoClose,O===!1||xme(O)&&O>0?O:U),deleteToast(){let X=y.get(M),{onClose:K,children:J}=X.props;fC(K)&&K(wi.isValidElement(J)&&J.props),u(hho(X,"removed")),y.delete(M),p--,p<0&&(p=0),m.length>0?I(m.shift()):C()}};var O,U;V.closeButton=f.closeButton,P.closeButton===!1||U_t(P.closeButton)?V.closeButton=P.closeButton:P.closeButton===!0&&(V.closeButton=!U_t(f.closeButton)||f.closeButton);let j=v;wi.isValidElement(v)&&!vU(v.type)?j=wi.cloneElement(v,{closeToast:L,toastProps:V,data:T}):fC(v)&&(j=v({closeToast:L,toastProps:V,data:T}));let Y={content:j,props:V,staleId:N};f.limit&&f.limit>0&&p>f.limit&&H?m.push(Y):xme(D)?setTimeout(()=>{I(Y)},D):I(Y)},setProps(v){f=v},setToggle:(v,P)=>{y.get(v).toggle=P},isToastActive:(v)=>A.some((P)=>P===v),getSnapshot:()=>g}}(s,i,qes);Px.set(s,c);let l=c.observe(a);return Cme.forEach((h)=>mho(h.content,h.options)),Cme=[],()=>{l(),Px.delete(s)}},setProps(a){var c;(c=Px.get(s))==null||c.setProps(a)},getSnapshot(){var a;return(a=Px.get(s))==null?void 0:a.getSnapshot()}}}(e)).current;o(e);let r=wi.useSyncExternalStore(t,n,n);return{getToastToRender:function(i){if(!r)return[];let s=new Map;return e.newestOnTop&&r.reverse(),r.forEach((a)=>{let{position:c}=a.props;s.has(c)||s.set(c,[]),s.get(c).push(a)}),Array.from(s,(a)=>i(a[0],a[1]))},isToastActive:pho,count:r==null?void 0:r.length}}function Zes(e){let[t,n]=wi.useState(!1),[o,r]=wi.useState(!1),i=wi.useRef(null),s=wi.useRef({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:a,pauseOnHover:c,closeToast:l,onClick:h,closeOnClick:d}=e;var u,_;function p(){n(!0)}function m(){n(!1)}function A(y){let x=i.current;s.canDrag&&x&&(s.didMove=!0,t&&m(),s.delta=e.draggableDirection==="x"?y.clientX-s.start:y.clientY-s.start,s.start!==y.clientX&&(s.canCloseOnClick=!1),x.style.transform=`translate3d(${e.draggableDirection==="x"?`${s.delta}px, var(--y)`:`0, calc(${s.delta}px + var(--y))`},0)`,x.style.opacity=""+(1-Math.abs(s.delta/s.removalDistance)))}function g(){document.removeEventListener("pointermove",A),document.removeEventListener("pointerup",g);let y=i.current;if(s.canDrag&&s.didMove&&y){if(s.canDrag=!1,Math.abs(s.delta)>s.removalDistance)return r(!0),e.closeToast(),void e.collapseAll();y.style.transition="transform 0.2s, opacity 0.2s",y.style.removeProperty("transform"),y.style.removeProperty("opacity")}}(_=Px.get((u={id:e.toastId,containerId:e.containerId,fn:n}).containerId||1))==null||_.setToggle(u.id,u.fn),wi.useEffect(()=>{if(e.pauseOnFocusLoss)return document.hasFocus()||m(),window.addEventListener("focus",p),window.addEventListener("blur",m),()=>{window.removeEventListener("focus",p),window.removeEventListener("blur",m)}},[e.pauseOnFocusLoss]);let f={onPointerDown:function(y){if(e.draggable===!0||e.draggable===y.pointerType){s.didMove=!1,document.addEventListener("pointermove",A),document.addEventListener("pointerup",g);let x=i.current;s.canCloseOnClick=!0,s.canDrag=!0,x.style.transition="none",e.draggableDirection==="x"?(s.start=y.clientX,s.removalDistance=x.offsetWidth*(e.draggablePercent/100)):(s.start=y.clientY,s.removalDistance=x.offsetHeight*(e.draggablePercent===80?1.5*e.draggablePercent:e.draggablePercent)/100)}},onPointerUp:function(y){let{top:x,bottom:C,left:b,right:I}=i.current.getBoundingClientRect();y.nativeEvent.type!=="touchend"&&e.pauseOnHover&&y.clientX>=b&&y.clientX<=I&&y.clientY>=x&&y.clientY<=C?m():p()}};return a&&c&&(f.onMouseEnter=m,e.stacked||(f.onMouseLeave=p)),d&&(f.onClick=(y)=>{h&&h(y),s.canCloseOnClick&&l()}),{playToast:p,pauseToast:m,isRunning:t,preventExitTransition:o,toastRef:i,eventHandlers:f}}function ets(e){let{delay:t,isRunning:n,closeToast:o,type:r="default",hide:i,className:s,style:a,controlledProgress:c,progress:l,rtl:h,isIn:d,theme:u}=e,_=i||c&&l===0,p={...a,animationDuration:`${t}ms`,animationPlayState:n?"running":"paused"};c&&(p.transform=`scaleX(${l})`);let m=KT("Toastify__progress-bar",c?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${u}`,`Toastify__progress-bar--${r}`,{"Toastify__progress-bar--rtl":h}),A=fC(s)?s({rtl:h,type:r,defaultClassName:m}):KT(m,s),g={[c&&l>=1?"onTransitionEnd":"onAnimationEnd"]:c&&l<1?null:()=>{d&&o()}};return wi.default.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":_},wi.default.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${u} Toastify__progress-bar--${r}`}),wi.default.createElement("div",{role:"progressbar","aria-hidden":_?"true":"false","aria-label":"notification timer",className:A,style:p,...g}))}var tts=1,_ho=()=>""+tts++;function nts(e){return e&&(vU(e.toastId)||xme(e.toastId))?e.toastId:_ho()}function yme(e,t){return mho(e,t),t.toastId}function JBe(e,t){return{...t,type:t&&t.type||e,toastId:nts(t)}}function KBe(e){return(t,n)=>yme(t,JBe(e,n))}function Ju(e,t){return yme(e,JBe("default",t))}Ju.loading=(e,t)=>yme(e,JBe("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),Ju.promise=function(e,t,n){let o,{pending:r,error:i,success:s}=t;r&&(o=vU(r)?Ju.loading(r,n):Ju.loading(r.render,{...n,...r}));let a={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},c=(h,d,u)=>{if(d==null)return void Ju.dismiss(o);let _={type:h,...a,...n,data:u},p=vU(d)?{render:d}:d;return o?Ju.update(o,{..._,...p}):Ju(p.render,{..._,...p}),u},l=fC(e)?e():e;return l.then((h)=>c("success",s,h)).catch((h)=>c("error",i,h)),l},Ju.success=KBe("success"),Ju.info=KBe("info"),Ju.error=KBe("error"),Ju.warning=KBe("warning"),Ju.warn=Ju.warning,Ju.dark=(e,t)=>yme(e,JBe("default",{theme:"dark",...t})),Ju.dismiss=function(e){(function(t){var n;if(uho()){if(t==null||vU(n=t)||xme(n))Px.forEach((o)=>{o.removeToast(t)});else if(t&&(("containerId"in t)||("id"in t))){let o=Px.get(t.containerId);o?o.removeToast(t.id):Px.forEach((r)=>{r.removeToast(t.id)})}}else Cme=Cme.filter((o)=>t!=null&&o.options.toastId!==t)})(e)},Ju.clearWaitingQueue=function(e){e===void 0&&(e={}),Px.forEach((t)=>{!t.props.limit||e.containerId&&t.id!==e.containerId||t.clearQueue()})},Ju.isActive=pho,Ju.update=function(e,t){t===void 0&&(t={});let n=((o,r)=>{var i;let{containerId:s}=r;return(i=Px.get(s||1))==null?void 0:i.toasts.get(o)})(e,t);if(n){let{props:o,content:r}=n,i={delay:100,...o,...t,toastId:t.toastId||e,updateId:_ho()};i.toastId!==e&&(i.staleId=e);let s=i.render||r;delete i.render,yme(s,i)}},Ju.done=(e)=>{Ju.update(e,{progress:1})},Ju.onChange=function(e){return W_t.add(e),()=>{W_t.delete(e)}},Ju.play=(e)=>dho(!0,e),Ju.pause=(e)=>dho(!1,e);var ots=typeof window<"u"?wi.useLayoutEffect:wi.useEffect,$Be=(e)=>{let{theme:t,type:n,isLoading:o,...r}=e;return wi.default.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${n})`,...r})},G_t={info:function(e){return wi.default.createElement($Be,{...e},wi.default.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(e){return wi.default.createElement($Be,{...e},wi.default.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(e){return wi.default.createElement($Be,{...e},wi.default.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(e){return wi.default.createElement($Be,{...e},wi.default.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return wi.default.createElement("div",{className:"Toastify__spinner"})}},rts=(e)=>{let{isRunning:t,preventExitTransition:n,toastRef:o,eventHandlers:r,playToast:i}=Zes(e),{closeButton:s,children:a,autoClose:c,onClick:l,type:h,hideProgressBar:d,closeToast:u,transition:_,position:p,className:m,style:A,bodyClassName:g,bodyStyle:f,progressClassName:y,progressStyle:x,updateId:C,role:b,progress:I,rtl:v,toastId:P,deleteToast:M,isIn:B,isLoading:T,closeOnClick:N,theme:D}=e,L=KT("Toastify__toast",`Toastify__toast-theme--${D}`,`Toastify__toast--${h}`,{"Toastify__toast--rtl":v},{"Toastify__toast--close-on-click":N}),H=fC(m)?m({rtl:v,position:p,type:h,defaultClassName:L}):KT(L,m),V=function(Y){let{theme:X,type:K,isLoading:J,icon:ee}=Y,se=null,ne={theme:X,type:K};return ee===!1||(fC(ee)?se=ee({...ne,isLoading:J}):wi.isValidElement(ee)?se=wi.cloneElement(ee,ne):J?se=G_t.spinner():((re)=>(re in G_t))(K)&&(se=G_t[K](ne))),se}(e),O=!!I||!c,U={closeToast:u,type:h,theme:D},j=null;return s===!1||(j=fC(s)?s(U):wi.isValidElement(s)?wi.cloneElement(s,U):function(Y){let{closeToast:X,theme:K,ariaLabel:J="close"}=Y;return wi.default.createElement("button",{className:`Toastify__close-button Toastify__close-button--${K}`,type:"button",onClick:(ee)=>{ee.stopPropagation(),X(ee)},"aria-label":J},wi.default.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},wi.default.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}(U)),wi.default.createElement(_,{isIn:B,done:M,position:p,preventExitTransition:n,nodeRef:o,playToast:i},wi.default.createElement("div",{id:P,onClick:l,"data-in":B,className:H,...r,style:A,ref:o},wi.default.createElement("div",{...B&&{role:b},className:fC(g)?g({type:h}):KT("Toastify__toast-body",g),style:f},V!=null&&wi.default.createElement("div",{className:KT("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!T})},V),wi.default.createElement("div",null,a)),j,wi.default.createElement(ets,{...C&&!O?{key:`pb-${C}`}:{},rtl:v,theme:D,delay:c,isRunning:t,isIn:B,closeToast:u,hide:d,type:h,style:x,className:y,controlledProgress:O,progress:I||0})))},eTe=function(e,t){return t===void 0&&(t=!1),{enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:t}},its=ZBe(eTe("bounce",!0)),BQa=ZBe(eTe("slide",!0)),TQa=ZBe(eTe("zoom")),DQa=ZBe(eTe("flip")),sts={position:"top-right",transition:its,autoClose:5000,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};function gho(e){let t={...sts,...e},n=e.stacked,[o,r]=wi.useState(!0),i=wi.useRef(null),{getToastToRender:s,isToastActive:a,count:c}=Jes(t),{className:l,style:h,rtl:d,containerId:u}=t;function _(m){let A=KT("Toastify__toast-container",`Toastify__toast-container--${m}`,{"Toastify__toast-container--rtl":d});return fC(l)?l({position:m,rtl:d,defaultClassName:A}):KT(A,qBe(l))}function p(){n&&(r(!0),Ju.play())}return ots(()=>{if(n){var m;let A=i.current.querySelectorAll('[data-in="true"]'),g=12,f=(m=t.position)==null?void 0:m.includes("top"),y=0,x=0;Array.from(A).reverse().forEach((C,b)=>{let I=C;I.classList.add("Toastify__toast--stacked"),b>0&&(I.dataset.collapsed=`${o}`),I.dataset.pos||(I.dataset.pos=f?"top":"bot");let v=y*(o?0.2:1)+(o?0:12*b);I.style.setProperty("--y",`${f?v:-1*v}px`),I.style.setProperty("--g","12"),I.style.setProperty("--s",""+(1-(o?x:0))),y+=I.offsetHeight,x+=0.025})}},[o,c,n]),wi.default.createElement("div",{ref:i,className:"Toastify",id:u,onMouseEnter:()=>{n&&(r(!1),Ju.pause())},onMouseLeave:p},s((m,A)=>{let g=A.length?{...h}:{...h,pointerEvents:"none"};return wi.default.createElement("div",{className:_(m),style:g,key:`container-${m}`},A.map((f)=>{let{content:y,props:x}=f;return wi.default.createElement(rts,{...x,stacked:n,collapseAll:p,isIn:a(x.toastId,x.containerId),style:x.style,key:`toast-${x.key}`},y)}))}))}function Aho(){var e=":root{--toastify-color-light:#fff;--toastify-color-dark:#121212;--toastify-color-info:#3498db;--toastify-color-success:#07bc0c;--toastify-color-warning:#f1c40f;--toastify-color-error:#e74c3c;--toastify-color-transparent:hsla(0,0%,100%,.7);--toastify-icon-color-info:var(--toastify-color-info);--toastify-icon-color-success:var(--toastify-color-success);--toastify-icon-color-warning:var(--toastify-color-warning);--toastify-icon-color-error:var(--toastify-color-error);--toastify-toast-width:320px;--toastify-toast-offset:16px;--toastify-toast-top:max(var(--toastify-toast-offset),env(safe-area-inset-top));--toastify-toast-right:max(var(--toastify-toast-offset),env(safe-area-inset-right));--toastify-toast-left:max(var(--toastify-toast-offset),env(safe-area-inset-left));--toastify-toast-bottom:max(var(--toastify-toast-offset),env(safe-area-inset-bottom));--toastify-toast-background:#fff;--toastify-toast-min-height:64px;--toastify-toast-max-height:800px;--toastify-toast-bd-radius:6px;--toastify-font-family:sans-serif;--toastify-z-index:9999;--toastify-text-color-light:#757575;--toastify-text-color-dark:#fff;--toastify-text-color-info:#fff;--toastify-text-color-success:#fff;--toastify-text-color-warning:#fff;--toastify-text-color-error:#fff;--toastify-spinner-color:#616161;--toastify-spinner-color-empty-area:#e0e0e0;--toastify-color-progress-light:linear-gradient(90deg,#4cd964,#5ac8fa,#007aff,#34aadc,#5856d6,#ff2d55);--toastify-color-progress-dark:#bb86fc;--toastify-color-progress-info:var(--toastify-color-info);--toastify-color-progress-success:var(--toastify-color-success);--toastify-color-progress-warning:var(--toastify-color-warning);--toastify-color-progress-error:var(--toastify-color-error);--toastify-color-progress-bgo:0.2}.Toastify__toast-container{z-index:var(--toastify-z-index);-webkit-transform:translateZ(var(--toastify-z-index));position:fixed;padding:4px;width:var(--toastify-toast-width);box-sizing:border-box;color:#fff}.Toastify__toast-container--top-left{top:var(--toastify-toast-top);left:var(--toastify-toast-left)}.Toastify__toast-container--top-center{top:var(--toastify-toast-top);left:50%;transform:translateX(-50%)}.Toastify__toast-container--top-right{top:var(--toastify-toast-top);right:var(--toastify-toast-right)}.Toastify__toast-container--bottom-left{bottom:var(--toastify-toast-bottom);left:var(--toastify-toast-left)}.Toastify__toast-container--bottom-center{bottom:var(--toastify-toast-bottom);left:50%;transform:translateX(-50%)}.Toastify__toast-container--bottom-right{bottom:var(--toastify-toast-bottom);right:var(--toastify-toast-right)}@media only screen and (max-width:480px){.Toastify__toast-container{width:100vw;padding:0;left:env(safe-area-inset-left);margin:0}.Toastify__toast-container--top-center,.Toastify__toast-container--top-left,.Toastify__toast-container--top-right{top:env(safe-area-inset-top);transform:translateX(0)}.Toastify__toast-container--bottom-center,.Toastify__toast-container--bottom-left,.Toastify__toast-container--bottom-right{bottom:env(safe-area-inset-bottom);transform:translateX(0)}.Toastify__toast-container--rtl{right:env(safe-area-inset-right);left:auto}}.Toastify__toast{--y:0;position:relative;-ms-touch-action:none;touch-action:none;min-height:var(--toastify-toast-min-height);box-sizing:border-box;margin-bottom:1rem;padding:8px;border-radius:var(--toastify-toast-bd-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;max-height:var(--toastify-toast-max-height);font-family:var(--toastify-font-family);cursor:default;direction:ltr;z-index:0;overflow:hidden}.Toastify__toast--stacked{position:absolute;width:100%;transform:translate3d(0,var(--y),0) scale(var(--s));transition:transform .3s}.Toastify__toast--stacked[data-collapsed] .Toastify__close-button,.Toastify__toast--stacked[data-collapsed] .Toastify__toast-body{transition:opacity .1s}.Toastify__toast--stacked[data-collapsed=false]{overflow:visible}.Toastify__toast--stacked[data-collapsed=true]:not(:last-child)>*{opacity:0}.Toastify__toast--stacked:after{content:\"\";position:absolute;left:0;right:0;height:calc(var(--g) * 1px);bottom:100%}.Toastify__toast--stacked[data-pos=top]{top:0}.Toastify__toast--stacked[data-pos=bot]{bottom:0}.Toastify__toast--stacked[data-pos=bot].Toastify__toast--stacked:before{transform-origin:top}.Toastify__toast--stacked[data-pos=top].Toastify__toast--stacked:before{transform-origin:bottom}.Toastify__toast--stacked:before{content:\"\";position:absolute;left:0;right:0;bottom:0;height:100%;transform:scaleY(3);z-index:-1}.Toastify__toast--rtl{direction:rtl}.Toastify__toast--close-on-click{cursor:pointer}.Toastify__toast-body{margin:auto 0;-ms-flex:1 1 auto;flex:1 1 auto;padding:6px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.Toastify__toast-body>div:last-child{word-break:break-word;-ms-flex:1;flex:1}.Toastify__toast-icon{-webkit-margin-end:10px;margin-inline-end:10px;width:20px;-ms-flex-negative:0;flex-shrink:0;display:-ms-flexbox;display:flex}.Toastify--animate{animation-fill-mode:both;animation-duration:.5s}.Toastify--animate-icon{animation-fill-mode:both;animation-duration:.3s}@media only screen and (max-width:480px){.Toastify__toast{margin-bottom:0;border-radius:0}}.Toastify__toast-theme--dark{background:var(--toastify-color-dark);color:var(--toastify-text-color-dark)}.Toastify__toast-theme--colored.Toastify__toast--default,.Toastify__toast-theme--light{background:var(--toastify-color-light);color:var(--toastify-text-color-light)}.Toastify__toast-theme--colored.Toastify__toast--info{color:var(--toastify-text-color-info);background:var(--toastify-color-info)}.Toastify__toast-theme--colored.Toastify__toast--success{color:var(--toastify-text-color-success);background:var(--toastify-color-success)}.Toastify__toast-theme--colored.Toastify__toast--warning{color:var(--toastify-text-color-warning);background:var(--toastify-color-warning)}.Toastify__toast-theme--colored.Toastify__toast--error{color:var(--toastify-text-color-error);background:var(--toastify-color-error)}.Toastify__progress-bar-theme--light{background:var(--toastify-color-progress-light)}.Toastify__progress-bar-theme--dark{background:var(--toastify-color-progress-dark)}.Toastify__progress-bar--info{background:var(--toastify-color-progress-info)}.Toastify__progress-bar--success{background:var(--toastify-color-progress-success)}.Toastify__progress-bar--warning{background:var(--toastify-color-progress-warning)}.Toastify__progress-bar--error{background:var(--toastify-color-progress-error)}.Toastify__progress-bar-theme--colored.Toastify__progress-bar--error,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--info,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--success,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--warning{background:var(--toastify-color-transparent)}.Toastify__close-button{color:#fff;background:transparent;outline:none;border:none;padding:0;cursor:pointer;opacity:.7;transition:.3s ease;-ms-flex-item-align:start;align-self:flex-start;z-index:1}.Toastify__close-button--light{color:#000;opacity:.3}.Toastify__close-button>svg{fill:currentColor;height:16px;width:14px}.Toastify__close-button:focus,.Toastify__close-button:hover{opacity:1}@keyframes Toastify__trackProgress{0%{transform:scaleX(1)}to{transform:scaleX(0)}}.Toastify__progress-bar{position:absolute;bottom:0;left:0;width:100%;height:100%;z-index:var(--toastify-z-index);opacity:.7;transform-origin:left;border-bottom-left-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--animated{animation:Toastify__trackProgress linear 1 forwards}.Toastify__progress-bar--controlled{transition:transform .2s}.Toastify__progress-bar--rtl{right:0;left:auto;transform-origin:right;border-bottom-left-radius:0;border-bottom-right-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--wrp{position:absolute;bottom:0;left:0;width:100%;height:5px;border-bottom-left-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--wrp[data-hidden=true]{opacity:0}.Toastify__progress-bar--bg{opacity:var(--toastify-color-progress-bgo);width:100%;height:100%}.Toastify__spinner{width:20px;height:20px;box-sizing:border-box;border:2px solid;border-radius:100%;border-color:var(--toastify-spinner-color-empty-area);border-right-color:var(--toastify-spinner-color);animation:Toastify__spin .65s linear infinite}@keyframes Toastify__bounceInRight{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(3000px,0,0)}60%{opacity:1;transform:translate3d(-25px,0,0)}75%{transform:translate3d(10px,0,0)}90%{transform:translate3d(-5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutRight{20%{opacity:1;transform:translate3d(-20px,var(--y),0)}to{opacity:0;transform:translate3d(2000px,var(--y),0)}}@keyframes Toastify__bounceInLeft{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(-3000px,0,0)}60%{opacity:1;transform:translate3d(25px,0,0)}75%{transform:translate3d(-10px,0,0)}90%{transform:translate3d(5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutLeft{20%{opacity:1;transform:translate3d(20px,var(--y),0)}to{opacity:0;transform:translate3d(-2000px,var(--y),0)}}@keyframes Toastify__bounceInUp{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,3000px,0)}60%{opacity:1;transform:translate3d(0,-20px,0)}75%{transform:translate3d(0,10px,0)}90%{transform:translate3d(0,-5px,0)}to{transform:translateZ(0)}}@keyframes Toastify__bounceOutUp{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,-2000px,0)}}@keyframes Toastify__bounceInDown{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,-3000px,0)}60%{opacity:1;transform:translate3d(0,25px,0)}75%{transform:translate3d(0,-10px,0)}90%{transform:translate3d(0,5px,0)}to{transform:none}}@keyframes Toastify__bounceOutDown{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,2000px,0)}}.Toastify__bounce-enter--bottom-left,.Toastify__bounce-enter--top-left{animation-name:Toastify__bounceInLeft}.Toastify__bounce-enter--bottom-right,.Toastify__bounce-enter--top-right{animation-name:Toastify__bounceInRight}.Toastify__bounce-enter--top-center{animation-name:Toastify__bounceInDown}.Toastify__bounce-enter--bottom-center{animation-name:Toastify__bounceInUp}.Toastify__bounce-exit--bottom-left,.Toastify__bounce-exit--top-left{animation-name:Toastify__bounceOutLeft}.Toastify__bounce-exit--bottom-right,.Toastify__bounce-exit--top-right{animation-name:Toastify__bounceOutRight}.Toastify__bounce-exit--top-center{animation-name:Toastify__bounceOutUp}.Toastify__bounce-exit--bottom-center{animation-name:Toastify__bounceOutDown}@keyframes Toastify__zoomIn{0%{opacity:0;transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes Toastify__zoomOut{0%{opacity:1}50%{opacity:0;transform:translate3d(0,var(--y),0) scale3d(.3,.3,.3)}to{opacity:0}}.Toastify__zoom-enter{animation-name:Toastify__zoomIn}.Toastify__zoom-exit{animation-name:Toastify__zoomOut}@keyframes Toastify__flipIn{0%{transform:perspective(400px) rotateX(90deg);animation-timing-function:ease-in;opacity:0}40%{transform:perspective(400px) rotateX(-20deg);animation-timing-function:ease-in}60%{transform:perspective(400px) rotateX(10deg);opacity:1}80%{transform:perspective(400px) rotateX(-5deg)}to{transform:perspective(400px)}}@keyframes Toastify__flipOut{0%{transform:translate3d(0,var(--y),0) perspective(400px)}30%{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(-20deg);opacity:1}to{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(90deg);opacity:0}}.Toastify__flip-enter{animation-name:Toastify__flipIn}.Toastify__flip-exit{animation-name:Toastify__flipOut}@keyframes Toastify__slideInRight{0%{transform:translate3d(110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInLeft{0%{transform:translate3d(-110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInUp{0%{transform:translate3d(0,110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInDown{0%{transform:translate3d(0,-110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideOutRight{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(110%,var(--y),0)}}@keyframes Toastify__slideOutLeft{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(-110%,var(--y),0)}}@keyframes Toastify__slideOutDown{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,500px,0)}}@keyframes Toastify__slideOutUp{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,-500px,0)}}.Toastify__slide-enter--bottom-left,.Toastify__slide-enter--top-left{animation-name:Toastify__slideInLeft}.Toastify__slide-enter--bottom-right,.Toastify__slide-enter--top-right{animation-name:Toastify__slideInRight}.Toastify__slide-enter--top-center{animation-name:Toastify__slideInDown}.Toastify__slide-enter--bottom-center{animation-name:Toastify__slideInUp}.Toastify__slide-exit--bottom-left,.Toastify__slide-exit--top-left{animation-name:Toastify__slideOutLeft;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--bottom-right,.Toastify__slide-exit--top-right{animation-name:Toastify__slideOutRight;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-center{animation-name:Toastify__slideOutUp;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--bottom-center{animation-name:Toastify__slideOutDown;animation-timing-function:ease-in;animation-duration:.3s}@keyframes Toastify__spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}",t=document.createElement("style");t.innerText=e,document.head.appendChild(t)}var Guo=at(lo(),1),e0=at(ln(),1),Lne=at(ln(),1),ETe=at(ln(),1),Wuo=at(ln(),1),MTe=at(ln(),1),Lme=at(ln(),1);var vf=at(ln(),1);var ap=at(ln(),1);var t0o=at(_v(),1);var gm=at(ln(),1),Hme=at(j_t(),1),n8=at(lo(),1);var n0o=at(_v(),1);var i0o=at(_v(),1);var Jv=at(_v(),1);var s0o=at(_v(),1);var Zv=at(_v(),1);H9();var d0o=at(_v(),1);var yC=at(_v(),1);H9();var e8=at(_v(),1),vH=at(ln(),1),Fme=at(j_t(),1),Pne=at(lo(),1);var BTe=at(ln(),1),TTe=at(lo(),1),Hd=at(ln(),1);var y0o=at(ln(),1),DTe=at(ln(),1),zme=at(lo(),1),pu=at(lo(),1),Ome=at(ln(),1);var NTe=at(lo(),1),Ene=at(ln(),1);var gts=!0;function Ats(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t];return}function fts(e){var t=document.createElement("style");if(t.setAttribute("data-emotion",e.key),e.nonce!==void 0)t.setAttribute("nonce",e.nonce);return t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var bho=function(){function e(n){var o=this;this._insertTag=function(r){var i;if(o.tags.length===0)if(o.insertionPoint)i=o.insertionPoint.nextSibling;else if(o.prepend)i=o.container.firstChild;else i=o.before;else i=o.tags[o.tags.length-1].nextSibling;o.container.insertBefore(r,i),o.tags.push(r)},this.isSpeedy=n.speedy===void 0?!gts:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(o){o.forEach(this._insertTag)},t.insert=function(o){if(this.ctr%(this.isSpeedy?65000:1)===0)this._insertTag(fts(this));var r=this.tags[this.tags.length-1];{var i=o.charCodeAt(0)===64&&o.charCodeAt(1)===105;if(i&&this._alreadyInsertedOrderInsensitiveRule)console.error(`You're attempting to insert the following rule:
`+o+"\n\n`@import` rules must be before all other types of rules in a stylesheet but other rules have already been inserted. Please ensure that `@import` rules are before all other rules.");this._alreadyInsertedOrderInsensitiveRule=this._alreadyInsertedOrderInsensitiveRule||!i}if(this.isSpeedy){var s=Ats(r);try{s.insertRule(o,s.cssRules.length)}catch(a){if(!/:(-moz-placeholder|-moz-focus-inner|-moz-focusring|-ms-input-placeholder|-moz-read-write|-moz-read-only|-ms-clear|-ms-expand|-ms-reveal){/.test(o))console.error('There was a problem inserting the following rule: "'+o+'"',a)}}else r.appendChild(document.createTextNode(o));this.ctr++},t.flush=function(){this.tags.forEach(function(o){var r;return(r=o.parentNode)==null?void 0:r.removeChild(o)}),this.tags=[],this.ctr=0,this._alreadyInsertedOrderInsensitiveRule=!1},e}();var E2="-ms-",Ime="-moz-",sh="-webkit-",dne="comm",une="rule",pne="decl";var Iho="@import";var tTe="@keyframes";var vho="@layer";var Sho=Math.abs,SU=String.fromCharCode,Pho=Object.assign;function Eho(e,t){return r_(e,0)^45?(((t<<2^r_(e,0))<<2^r_(e,1))<<2^r_(e,2))<<2^r_(e,3):0}function nTe(e){return e.trim()}function K_t(e,t){return(e=t.exec(e))?e[0]:e}function Ql(e,t,n){return e.replace(t,n)}function vme(e,t){return e.indexOf(t)}function r_(e,t){return e.charCodeAt(t)|0}function fH(e,t,n){return e.slice(t,n)}function Ex(e){return e.length}function mne(e){return e.length}function _ne(e,t){return t.push(e),e}function $_t(e,t){return e.map(t).join("")}var oTe=1,gne=1,Mho=0,Mx=0,cg=0,fne="";function Sme(e,t,n,o,r,i,s){return{value:e,root:t,parent:n,type:o,props:r,children:i,line:oTe,column:gne,length:s,return:""}}function yne(e,t){return Pho(Sme("",null,null,"",null,null,0),e,{length:-e.length},t)}function who(){return cg}function Bho(){if(cg=Mx>0?r_(fne,--Mx):0,gne--,cg===10)gne=1,oTe--;return cg}function wx(){if(cg=Mx<Mho?r_(fne,Mx++):0,gne++,cg===10)gne=1,oTe++;return cg}function Z6(){return r_(fne,Mx)}function Pme(){return Mx}function xne(e,t){return fH(fne,e,t)}function Ane(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function rTe(e){return oTe=gne=1,Mho=Ex(fne=e),Mx=0,[]}function iTe(e){return fne="",e}function Cne(e){return nTe(xne(Mx-1,q_t(e===91?e+2:e===40?e+1:e)))}function Tho(e){while(cg=Z6())if(cg<33)wx();else break;return Ane(e)>2||Ane(cg)>3?"":" "}function Dho(e,t){while(--t&&wx())if(cg<48||cg>102||cg>57&&cg<65||cg>70&&cg<97)break;return xne(e,Pme()+(t<6&&Z6()==32&&wx()==32))}function q_t(e){while(wx())switch(cg){case e:return Mx;case 34:case 39:if(e!==34&&e!==39)q_t(cg);break;case 40:if(e===41)q_t(e);break;case 92:wx();break}return Mx}function Nho(e,t){while(wx())if(e+cg===57)break;else if(e+cg===84&&Z6()===47)break;return"/*"+xne(t,Mx-1)+"*"+SU(e===47?e:wx())}function Rho(e){while(!Ane(Z6()))wx();return xne(e,Mx)}function Lho(e){return iTe(sTe("",null,null,null,[""],e=rTe(e),0,[0],e))}function sTe(e,t,n,o,r,i,s,a,c){var l=0,h=0,d=s,u=0,_=0,p=0,m=1,A=1,g=1,f=0,y="",x=r,C=i,b=o,I=y;while(A)switch(p=f,f=wx()){case 40:if(p!=108&&r_(I,d-1)==58){if(vme(I+=Ql(Cne(f),"&","&\f"),"&\f")!=-1)g=-1;break}case 34:case 39:case 91:I+=Cne(f);break;case 9:case 10:case 13:case 32:I+=Tho(p);break;case 92:I+=Dho(Pme()-1,7);continue;case 47:switch(Z6()){case 42:case 47:_ne(yts(Nho(wx(),Pme()),t,n),c);break;default:I+="/"}break;case 123*m:a[l++]=Ex(I)*g;case 125*m:case 59:case 0:switch(f){case 0:case 125:A=0;case 59+h:if(g==-1)I=Ql(I,/\f/g,"");if(_>0&&Ex(I)-d)_ne(_>32?kho(I+";",o,n,d-1):kho(Ql(I," ","")+";",o,n,d-2),c);break;case 59:I+=";";default:if(_ne(b=Qho(I,t,n,l,h,r,a,y,x=[],C=[],d),i),f===123)if(h===0)sTe(I,t,b,b,x,i,d,a,C);else switch(u===99&&r_(I,3)===110?100:u){case 100:case 108:case 109:case 115:sTe(e,b,b,o&&_ne(Qho(e,b,b,0,0,r,a,y,r,x=[],d),C),r,C,d,a,o?x:C);break;default:sTe(I,b,b,b,[""],C,0,a,C)}}l=h=_=0,m=g=1,y=I="",d=s;break;case 58:d=1+Ex(I),_=p;default:if(m<1){if(f==123)--m;else if(f==125&&m++==0&&Bho()==125)continue}switch(I+=SU(f),f*m){case 38:g=h>0?1:(I+="\f",-1);break;case 44:a[l++]=(Ex(I)-1)*g,g=1;break;case 64:if(Z6()===45)I+=Cne(wx());u=Z6(),h=d=Ex(y=I+=Rho(Pme())),f++;break;case 45:if(p===45&&Ex(I)==2)m=0}}return i}function Qho(e,t,n,o,r,i,s,a,c,l,h){var d=r-1,u=r===0?i:[""],_=mne(u);for(var p=0,m=0,A=0;p<o;++p)for(var g=0,f=fH(e,d+1,d=Sho(m=s[p])),y=e;g<_;++g)if(y=nTe(m>0?u[g]+" "+f:Ql(f,/&\f/g,u[g])))c[A++]=y;return Sme(e,t,n,r===0?une:a,c,l,h)}function yts(e,t,n){return Sme(e,t,n,dne,SU(who()),fH(e,2,-2),0)}function kho(e,t,n,o){return Sme(e,t,n,pne,fH(e,0,o),fH(e,o+1,-1),o)}function PU(e,t){var n="",o=mne(e);for(var r=0;r<o;r++)n+=t(e[r],r,e,t)||"";return n}function Hho(e,t,n,o){switch(e.type){case vho:if(e.children.length)break;case Iho:case pne:return e.return=e.return||e.value;case dne:return"";case tTe:return e.return=e.value+"{"+PU(e.children,o)+"}";case une:e.value=e.props.join(",")}return Ex(n=PU(e.children,o))?e.return=e.value+"{"+n+"}":""}function Fho(e){var t=mne(e);return function(n,o,r,i){var s="";for(var a=0;a<t;a++)s+=e[a](n,o,r,i)||"";return s}}function zho(e){var t=Object.create(null);return function(n){if(t[n]===void 0)t[n]=e(n);return t[n]}}var xts=function(t,n,o){var r=0,i=0;while(!0){if(r=i,i=Z6(),r===38&&i===12)n[o]=1;if(Ane(i))break;wx()}return xne(t,Mx)},Cts=function(t,n){var o=-1,r=44;do switch(Ane(r)){case 0:if(r===38&&Z6()===12)n[o]=1;t[o]+=xts(Mx-1,n,o);break;case 2:t[o]+=Cne(r);break;case 4:if(r===44){t[++o]=Z6()===58?"&\f":"",n[o]=t[o].length;break}default:t[o]+=SU(r)}while(r=wx());return t},bts=function(t,n){return iTe(Cts(rTe(t),n))},Oho=new WeakMap,Its=function(t){if(t.type!=="rule"||!t.parent||t.length<1)return;var{value:n,parent:o}=t,r=t.column===o.column&&t.line===o.line;while(o.type!=="rule")if(o=o.parent,!o)return;if(t.props.length===1&&n.charCodeAt(0)!==58&&!Oho.get(o))return;if(r)return;Oho.set(t,!0);var i=[],s=bts(n,i),a=o.props;for(var c=0,l=0;c<s.length;c++)for(var h=0;h<a.length;h++,l++)t.props[l]=i[c]?s[c].replace(/&\f/g,a[h]):a[h]+" "+s[c]},vts=function(t){if(t.type==="decl"){var n=t.value;if(n.charCodeAt(0)===108&&n.charCodeAt(2)===98)t.return="",t.value=""}},Sts="emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason",Pts=function(t){return t.type==="comm"&&t.children.indexOf(Sts)>-1},Ets=function(t){return function(n,o,r){if(n.type!=="rule"||t.compat)return;var i=n.value.match(/(:first|:nth|:nth-last)-child/g);if(i){var s=!!n.parent,a=s?n.parent.children:r;for(var c=a.length-1;c>=0;c--){var l=a[c];if(l.line<n.line)break;if(l.column<n.column){if(Pts(l))return;break}}i.forEach(function(h){console.error('The pseudo class "'+h+'" is potentially unsafe when doing server-side rendering. Try changing it to "'+h.split("-child")[0]+'-of-type".')})}}},Yho=function(t){return t.type.charCodeAt(1)===105&&t.type.charCodeAt(0)===64},Mts=function(t,n){for(var o=t-1;o>=0;o--)if(!Yho(n[o]))return!0;return!1},Vho=function(t){t.type="",t.value="",t.return="",t.children="",t.props=""},wts=function(t,n,o){if(!Yho(t))return;if(t.parent)console.error("`@import` rules can't be nested inside other rules. Please move it to the top level and put it before regular rules. Keep in mind that they can only be used within global styles."),Vho(t);else if(Mts(n,o))console.error("`@import` rules can't be after other rules. Please put your `@import` rules before your other rules."),Vho(t)};function Gho(e,t){switch(Eho(e,t)){case 5103:return sh+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return sh+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return sh+e+Ime+e+E2+e+e;case 6828:case 4268:return sh+e+E2+e+e;case 6165:return sh+e+E2+"flex-"+e+e;case 5187:return sh+e+Ql(e,/(\w+).+(:[^]+)/,sh+"box-$1$2"+E2+"flex-$1$2")+e;case 5443:return sh+e+E2+"flex-item-"+Ql(e,/flex-|-self/,"")+e;case 4675:return sh+e+E2+"flex-line-pack"+Ql(e,/align-content|flex-|-self/,"")+e;case 5548:return sh+e+E2+Ql(e,"shrink","negative")+e;case 5292:return sh+e+E2+Ql(e,"basis","preferred-size")+e;case 6060:return sh+"box-"+Ql(e,"-grow","")+sh+e+E2+Ql(e,"grow","positive")+e;case 4554:return sh+Ql(e,/([^-])(transform)/g,"$1"+sh+"$2")+e;case 6187:return Ql(Ql(Ql(e,/(zoom-|grab)/,sh+"$1"),/(image-set)/,sh+"$1"),e,"")+e;case 5495:case 3959:return Ql(e,/(image-set\([^]*)/,sh+"$1$`$1");case 4968:return Ql(Ql(e,/(.+:)(flex-)?(.*)/,sh+"box-pack:$3"+E2+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+sh+e+e;case 4095:case 3583:case 4068:case 2532:return Ql(e,/(.+)-inline(.+)/,sh+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Ex(e)-1-t>6)switch(r_(e,t+1)){case 109:if(r_(e,t+4)!==45)break;case 102:return Ql(e,/(.+:)(.+)-([^]+)/,"$1"+sh+"$2-$3$1"+Ime+(r_(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~vme(e,"stretch")?Gho(Ql(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(r_(e,t+1)!==115)break;case 6444:switch(r_(e,Ex(e)-3-(~vme(e,"!important")&&10))){case 107:return Ql(e,":",":"+sh)+e;case 101:return Ql(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+sh+(r_(e,14)===45?"inline-":"")+"box$3$1"+sh+"$2$3$1"+E2+"$2box$3")+e}break;case 5936:switch(r_(e,t+11)){case 114:return sh+e+E2+Ql(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return sh+e+E2+Ql(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return sh+e+E2+Ql(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return sh+e+E2+e+e}return e}var Bts=function(t,n,o,r){if(t.length>-1){if(!t.return)switch(t.type){case pne:t.return=Gho(t.value,t.length);break;case tTe:return PU([yne(t,{value:Ql(t.value,"@","@"+sh)})],r);case une:if(t.length)return $_t(t.props,function(i){switch(K_t(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return PU([yne(t,{props:[Ql(i,/:(read-\w+)/,":"+Ime+"$1")]})],r);case"::placeholder":return PU([yne(t,{props:[Ql(i,/:(plac\w+)/,":"+sh+"input-$1")]}),yne(t,{props:[Ql(i,/:(plac\w+)/,":"+Ime+"$1")]}),yne(t,{props:[Ql(i,/:(plac\w+)/,E2+"input-$1")]})],r)}return""})}}},Tts=[Bts],J_t;Z_t=/\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//g,J_t=function(t){var n=t.match(Z_t);if(!n)return;return n[n.length-1]};var Z_t,Uho=function(t){var n=t.key;if(!n)throw Error(`You have to configure \`key\` for your cache. Please make sure it's unique (and not equal to 'css') as it's used for linking styles to your cache.
If multiple caches share the same key they might "fight" for each other's style elements.`);if(n==="css"){var o=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(o,function(m){var A=m.getAttribute("data-emotion");if(A.indexOf(" ")===-1)return;document.head.appendChild(m),m.setAttribute("data-s","")})}var r=t.stylisPlugins||Tts;if(/[^a-z-]/.test(n))throw Error('Emotion key must only contain lower case alphabetical characters and - but "'+n+'" was passed');var i={},s,a=[];s=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(m){var A=m.getAttribute("data-emotion").split(" ");for(var g=1;g<A.length;g++)i[A[g]]=!0;a.push(m)});var c,l=[Its,vts];l.push(Ets({get compat(){return p.compat}}),wts);{var h,d=[Hho,function(m){if(!m.root){if(m.return)h.insert(m.return);else if(m.value&&m.type!==dne)h.insert(m.value+"{}")}}],u=Fho(l.concat(r,d)),_=function(A){return PU(Lho(A),u)};c=function(A,g,f,y){if(h=f,J_t){var x=J_t(g.styles);if(x)h={insert:function(b){f.insert(b+x)}}}if(_(A?A+"{"+g.styles+"}":g.styles),y)p.inserted[g.name]=!0}}var p={key:n,sheet:new bho({key:n,container:s,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:i,registered:{},insert:c};return p.sheet.hydrate(a),p};function Who(e){var t=0,n,o=0,r=e.length;for(;r>=4;++o,r-=4)n=e.charCodeAt(o)&255|(e.charCodeAt(++o)&255)<<8|(e.charCodeAt(++o)&255)<<16|(e.charCodeAt(++o)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(r){case 3:t^=(e.charCodeAt(o+2)&255)<<16;case 2:t^=(e.charCodeAt(o+1)&255)<<8;case 1:t^=e.charCodeAt(o)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var Xho={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};var Dts=!0,jho=`You have illegal escape sequence in your template literal, most likely inside content's property value.
Because you write your CSS inside a JavaScript string you actually have to do double escaping, so for example "content: '\\00d7';" should become "content: '\\\\00d7';".
You can read more about this here:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences`,Nts="You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key).",Rts=/[A-Z]|^ms/g,qho=/_EMO_([^_]+?)_([^]*?)_EMO_/g,sgt=function(t){return t.charCodeAt(1)===45},Kho=function(t){return t!=null&&typeof t!=="boolean"},egt=zho(function(e){return sgt(e)?e:e.replace(Rts,"-$&").toLowerCase()}),cTe=function(t,n){switch(t){case"animation":case"animationName":if(typeof n==="string")return n.replace(qho,function(o,r,i){return DE={name:r,styles:i,next:DE},r})}if(Xho[t]!==1&&!sgt(t)&&typeof n==="number"&&n!==0)return n+"px";return n};tgt=/(var|attr|counters?|url|element|(((repeating-)?(linear|radial))|conic)-gradient)\(|(no-)?(open|close)-quote/,ngt=["normal","none","initial","inherit","unset"],ogt=cTe,rgt=/^-ms-/,igt=/-(.)/g,aTe={},cTe=function(t,n){if(t==="content"){if(typeof n!=="string"||ngt.indexOf(n)===-1&&!tgt.test(n)&&(n.charAt(0)!==n.charAt(n.length-1)||n.charAt(0)!=='"'&&n.charAt(0)!=="'"))throw Error("You seem to be using a value for 'content' without quotes, try replacing it with `content: '\""+n+"\"'`")}var o=ogt(t,n);if(o!==""&&!sgt(t)&&t.indexOf("-")!==-1&&aTe[t]===void 0)aTe[t]=!0,console.error("Using kebab-case for css properties in objects is not supported. Did you mean "+t.replace(rgt,"ms-").replace(igt,function(r,i){return i.toUpperCase()})+"?");return o};var tgt,ngt,ogt,rgt,igt,aTe,Jho="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function Eme(e,t,n){if(n==null)return"";var o=n;if(o.__emotion_styles!==void 0){if(String(o)==="NO_COMPONENT_SELECTOR")throw Error(Jho);return o}switch(typeof n){case"boolean":return"";case"object":{var r=n;if(r.anim===1)return DE={name:r.name,styles:r.styles,next:DE},r.name;var i=n;if(i.styles!==void 0){var s=i.next;if(s!==void 0)while(s!==void 0)DE={name:s.name,styles:s.styles,next:DE},s=s.next;var a=i.styles+";";return a}return Qts(e,t,n)}case"function":{if(e!==void 0){var c=DE,l=n(e);return DE=c,Eme(e,t,l)}else console.error("Functions that are interpolated in css calls will be stringified.\nIf you want to have a css call based on props, create a function that returns a css call like this\nlet dynamicStyle = (props) => css`color: ${props.color}`\nIt can be called directly with props or interpolated in a styled call like this\nlet SomeComponent = styled('div')`${dynamicStyle}`");break}case"string":{var h=[],d=n.replace(qho,function(p,m,A){var g="animation"+h.length;return h.push("const "+g+" = keyframes`"+A.replace(/^@keyframes animation-\w+/,"")+"`"),"${"+g+"}"});if(h.length)console.error("`keyframes` output got interpolated into plain string, please wrap it with `css`.\n\nInstead of doing this:\n\n"+[].concat(h,["`"+d+"`"]).join(`
`)+`

You should wrap it with \`css\` like this:

css\``+d+"`")}break}var u=n;if(t==null)return u;var _=t[u];return _!==void 0?_:u}function Qts(e,t,n){var o="";if(Array.isArray(n))for(var r=0;r<n.length;r++)o+=Eme(e,t,n[r])+";";else for(var i in n){var s=n[i];if(typeof s!=="object"){var a=s;if(t!=null&&t[a]!==void 0)o+=i+"{"+t[a]+"}";else if(Kho(a))o+=egt(i)+":"+cTe(i,a)+";"}else{if(i==="NO_COMPONENT_SELECTOR"&&Dts)throw Error(Jho);if(Array.isArray(s)&&typeof s[0]==="string"&&(t==null||t[s[0]]===void 0)){for(var c=0;c<s.length;c++)if(Kho(s[c]))o+=egt(i)+":"+cTe(i,s[c])+";"}else{var l=Eme(e,t,s);switch(i){case"animation":case"animationName":{o+=egt(i)+":"+l+";";break}default:{if(i==="undefined")console.error(Nts);o+=i+"{"+l+"}"}}}}}return o}var $ho=/label:\s*([^\s;{]+)\s*(;|$)/g,DE;function lTe(e,t,n){if(e.length===1&&typeof e[0]==="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var o=!0,r="";DE=void 0;var i=e[0];if(i==null||i.raw===void 0)o=!1,r+=Eme(n,t,i);else{var s=i;if(s[0]===void 0)console.error(jho);r+=s[0]}for(var a=1;a<e.length;a++)if(r+=Eme(n,t,e[a]),o){var c=i;if(c[a]===void 0)console.error(jho);r+=c[a]}$ho.lastIndex=0;var l="",h;while((h=$ho.exec(r))!==null)l+="-"+h[1];var d=Who(r)+l;{var u={name:d,styles:r,next:DE,toString:function(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}};return u}}var kts=!0;function agt(e,t,n){var o="";return n.split(" ").forEach(function(r){if(e[r]!==void 0)t.push(e[r]+";");else if(r)o+=r+" "}),o}var Lts=function(t,n,o){var r=t.key+"-"+n.name;if((o===!1||kts===!1)&&t.registered[r]===void 0)t.registered[r]=n.styles},Zho=function(t,n,o){Lts(t,n,o);var r=t.key+"-"+n.name;if(t.inserted[n.name]===void 0){var i=n;do t.insert(n===i?"."+r:"",i,t.sheet,!0),i=i.next;while(i!==void 0)}};function edo(e,t){if(e.inserted[t.name]===void 0)return e.insert("",t,e.sheet,!0)}function tdo(e,t,n){var o=[],r=agt(e,o,n);if(o.length<2)return n;return r+t(o)}var ndo=function(t){var n=Uho(t);n.sheet.speedy=function(a){if(this.ctr!==0)throw Error("speedy must be changed before any rules are inserted");this.isSpeedy=a},n.compat=!0;var o=function(){for(var c=arguments.length,l=Array(c),h=0;h<c;h++)l[h]=arguments[h];var d=lTe(l,n.registered,void 0);return Zho(n,d,!1),n.key+"-"+d.name},r=function(){for(var c=arguments.length,l=Array(c),h=0;h<c;h++)l[h]=arguments[h];var d=lTe(l,n.registered),u="animation-"+d.name;return edo(n,{name:d.name,styles:"@keyframes "+u+"{"+d.styles+"}"}),u},i=function(){for(var c=arguments.length,l=Array(c),h=0;h<c;h++)l[h]=arguments[h];var d=lTe(l,n.registered);edo(n,d)},s=function(){for(var c=arguments.length,l=Array(c),h=0;h<c;h++)l[h]=arguments[h];return tdo(n.registered,o,Hts(l))};return{css:o,cx:s,injectGlobal:i,keyframes:r,hydrate:function(c){c.forEach(function(l){n.inserted[l]=!0})},flush:function(){n.registered={},n.inserted={},n.sheet.flush()},sheet:n.sheet,cache:n,getRegisteredStyles:agt.bind(null,n.registered),merge:tdo.bind(null,n.registered,o)}},Hts=function e(t){var n="";for(var o=0;o<t.length;o++){var r=t[o];if(r==null)continue;var i=void 0;switch(typeof r){case"boolean":break;case"object":{if(Array.isArray(r))i=e(r);else{i="";for(var s in r)if(r[s]&&s)i&&(i+=" "),i+=s}break}default:i=r}if(i)n&&(n+=" "),n+=i}return n};var NE=ndo({key:"css"}),{flush:fka,hydrate:yka,cx:xka,merge:Cka,getRegisteredStyles:bka,injectGlobal:Ika,keyframes:vka,css:$T,sheet:Ska,cache:Pka}=NE;var qT=at(lo(),1),sp=at(lo(),1);var TU=at(ln(),1);var lg=at(lo(),1),C0o=at(lo(),1),b0o=at(lo(),1);var JT=at(lo(),1),I0o=at(lo(),1),RTe=at(ln(),1),t8=at(lo(),1),o8=at(lo(),1);var QTe=at(ln(),1),kTe=at(lo(),1);var Bgt=at(ln(),1),Vme=at(lo(),1),ah=at(ln(),1);var MU=at(ln(),1),LTe=at(ln(),1),Yme=at(ln(),1);var ZT=at(ln(),1),v0o=at(z7(),1),Ld=at(lo(),1),S0o=at(lo(),1),FE=at(ln(),1),zE=at(ln(),1),Np=at(lo(),1),Zs=at(lo(),1),HTe=at(ln(),1);var Gme=at(lo(),1),P0o=at(ln(),1);var M0o=at(lo(),1),g4=at(lo(),1);var kE=at(lo(),1),Wgt=at(ln(),1),{create:Fts,defineProperty:Tgt,getOwnPropertyDescriptor:zts,getOwnPropertyNames:Dgt,getPrototypeOf:Ots}=Object,Vts=Object.prototype.hasOwnProperty,Yts=(e,t)=>function(){return e&&(t=(0,e[Dgt(e)[0]])(e=0)),t},Ngt=(e,t)=>function(){return t||(0,e[Dgt(e)[0]])((t={exports:{}}).exports,t),t.exports},Gts=(e,t)=>{for(var n in t)Tgt(e,n,{get:t[n],enumerable:!0})},Uts=(e,t,n,o)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let r of Dgt(t))if(!Vts.call(e,r)&&r!==n)Tgt(e,r,{get:()=>t[r],enumerable:!(o=zts(t,r))||o.enumerable})}return e},$do=(e,t,n)=>(n=e!=null?Fts(Ots(e)):{},Uts(t||!e||!e.__esModule?Tgt(n,"default",{value:e,enumerable:!0}):n,e)),Wts=Ngt({"node_modules/toggle-selection/index.js"(e,t){t.exports=function(){var n=document.getSelection();if(!n.rangeCount)return function(){};var o=document.activeElement,r=[];for(var i=0;i<n.rangeCount;i++)r.push(n.getRangeAt(i));switch(o.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":o.blur();break;default:o=null;break}return n.removeAllRanges(),function(){if(n.type==="Caret"&&n.removeAllRanges(),!n.rangeCount)r.forEach(function(s){n.addRange(s)});o&&o.focus()}}}}),Xts=Ngt({"node_modules/copy-to-clipboard/index.js"(e,t){var n=Wts(),o={"text/plain":"Text","text/html":"Url",default:"Text"},r="Copy to clipboard: #{key}, Enter";function i(a){var c=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return a.replace(/#{\s*key\s*}/g,c)}function s(a,c){var l,h,d,u,_,p,m=!1;if(!c)c={};l=c.debug||!1;try{d=n(),u=document.createRange(),_=document.getSelection(),p=document.createElement("span"),p.textContent=a,p.ariaHidden="true",p.style.all="unset",p.style.position="fixed",p.style.top=0,p.style.clip="rect(0, 0, 0, 0)",p.style.whiteSpace="pre",p.style.webkitUserSelect="text",p.style.MozUserSelect="text",p.style.msUserSelect="text",p.style.userSelect="text",p.addEventListener("copy",function(g){if(g.stopPropagation(),c.format)if(g.preventDefault(),typeof g.clipboardData>"u"){l&&console.warn("unable to use e.clipboardData"),l&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var f=o[c.format]||o.default;window.clipboardData.setData(f,a)}else g.clipboardData.clearData(),g.clipboardData.setData(c.format,a);if(c.onCopy)g.preventDefault(),c.onCopy(g.clipboardData)}),document.body.appendChild(p),u.selectNodeContents(p),_.addRange(u);var A=document.execCommand("copy");if(!A)throw Error("copy command was unsuccessful");m=!0}catch(g){l&&console.error("unable to copy using execCommand: ",g),l&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(c.format||"text",a),c.onCopy&&c.onCopy(window.clipboardData),m=!0}catch(f){l&&console.error("unable to copy using clipboardData: ",f),l&&console.error("falling back to prompt"),h=i("message"in c?c.message:r),window.prompt(h,a)}}finally{if(_)if(typeof _.removeRange=="function")_.removeRange(u);else _.removeAllRanges();if(p)document.body.removeChild(p);d()}return m}t.exports=s}}),qdo={};Gts(qdo,{default:()=>jts});function jts(){let e=URL.createObjectURL(new Blob(['"use strict";(()=>{var t4=Object.create;var F0=Object.defineProperty;var e4=Object.getOwnPropertyDescriptor;var n4=Object.getOwnPropertyNames;var r4=Object.getPrototypeOf,i4=Object.prototype.hasOwnProperty;var o4=(y,x,e)=>x in y?F0(y,x,{enumerable:!0,configurable:!0,writable:!0,value:e}):y[x]=e;var s4=(y,x)=>()=>(x||y((x={exports:{}}).exports,x),x.exports);var l4=(y,x,e,r)=>{if(x&&typeof x=="object"||typeof x=="function")for(let o of n4(x))!i4.call(y,o)&&o!==e&&F0(y,o,{get:()=>x[o],enumerable:!(r=e4(x,o))||r.enumerable});return y};var c4=(y,x,e)=>(e=y!=null?t4(r4(y)):{},l4(x||!y||!y.__esModule?F0(e,"default",{value:y,enumerable:!0}):e,y));var U=(y,x,e)=>o4(y,typeof x!="symbol"?x+"":x,e);var g5=s4((Y0,V0)=>{"use strict";(function(y,x){typeof Y0=="object"&&typeof V0<"u"?V0.exports=x():typeof define=="function"&&define.amd?define(x):(y=typeof globalThis<"u"?globalThis:y||self,y.polygonClipping=x())})(Y0,function(){"use strict";function y(u,t){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,l,s,L;return L={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(L[Symbol.iterator]=function(){return this}),L;function p(d){return function(R){return m([d,R])}}function m(d){if(i)throw new TypeError("Generator is already executing.");for(;n;)try{if(i=1,l&&(s=d[0]&2?l.return:d[0]?l.throw||((s=l.return)&&s.call(l),0):l.next)&&!(s=s.call(l,d[1])).done)return s;switch(l=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return n.label++,{value:d[1],done:!1};case 5:n.label++,l=d[1],d=[0];continue;case 7:d=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){n=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]<s[3])){n.label=d[1];break}if(d[0]===6&&n.label<s[1]){n.label=s[1],s=d;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(d);break}s[2]&&n.ops.pop(),n.trys.pop();continue}d=t.call(u,n)}catch(R){d=[6,R],l=0}finally{i=s=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}var x=function(){function u(t,n){this.next=null,this.key=t,this.data=n,this.left=null,this.right=null}return u}();function e(u,t){return u>t?1:u<t?-1:0}function r(u,t,n){for(var i=new x(null,null),l=i,s=i;;){var L=n(u,t.key);if(L<0){if(t.left===null)break;if(n(u,t.left.key)<0){var p=t.left;if(t.left=p.right,p.right=t,t=p,t.left===null)break}s.left=t,s=t,t=t.left}else if(L>0){if(t.right===null)break;if(n(u,t.right.key)>0){var p=t.right;if(t.right=p.left,p.left=t,t=p,t.right===null)break}l.right=t,l=t,t=t.right}else break}return l.right=t.left,s.left=t.right,t.left=i.right,t.right=i.left,t}function o(u,t,n,i){var l=new x(u,t);if(n===null)return l.left=l.right=null,l;n=r(u,n,i);var s=i(u,n.key);return s<0?(l.left=n.left,l.right=n,n.left=null):s>=0&&(l.right=n.right,l.left=n,n.right=null),l}function c(u,t,n){var i=null,l=null;if(t){t=r(u,t,n);var s=n(t.key,u);s===0?(i=t.left,l=t.right):s<0?(l=t.right,t.right=null,i=t):(i=t.left,t.left=null,l=t)}return{left:i,right:l}}function a(u,t,n){return t===null?u:(u===null||(t=r(u.key,t,n),t.left=u),t)}function f(u,t,n,i,l){if(u){i(""+t+(n?"\\u2514\\u2500\\u2500 ":"\\u251C\\u2500\\u2500 ")+l(u)+`\n`);var s=t+(n?"    ":"\\u2502   ");u.left&&f(u.left,s,!1,i,l),u.right&&f(u.right,s,!0,i,l)}}var v=function(){function u(t){t===void 0&&(t=e),this._root=null,this._size=0,this._comparator=t}return u.prototype.insert=function(t,n){return this._size++,this._root=o(t,n,this._root,this._comparator)},u.prototype.add=function(t,n){var i=new x(t,n);this._root===null&&(i.left=i.right=null,this._size++,this._root=i);var l=this._comparator,s=r(t,this._root,l),L=l(t,s.key);return L===0?this._root=s:(L<0?(i.left=s.left,i.right=s,s.left=null):L>0&&(i.right=s.right,i.left=s,s.right=null),this._size++,this._root=i),this._root},u.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)},u.prototype._remove=function(t,n,i){var l;if(n===null)return null;n=r(t,n,i);var s=i(t,n.key);return s===0?(n.left===null?l=n.right:(l=r(t,n.left,i),l.right=n.right),this._size--,l):n},u.prototype.pop=function(){var t=this._root;if(t){for(;t.left;)t=t.left;return this._root=r(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null},u.prototype.findStatic=function(t){for(var n=this._root,i=this._comparator;n;){var l=i(t,n.key);if(l===0)return n;l<0?n=n.left:n=n.right}return null},u.prototype.find=function(t){return this._root&&(this._root=r(t,this._root,this._comparator),this._comparator(t,this._root.key)!==0)?null:this._root},u.prototype.contains=function(t){for(var n=this._root,i=this._comparator;n;){var l=i(t,n.key);if(l===0)return!0;l<0?n=n.left:n=n.right}return!1},u.prototype.forEach=function(t,n){for(var i=this._root,l=[],s=!1;!s;)i!==null?(l.push(i),i=i.left):l.length!==0?(i=l.pop(),t.call(n,i),i=i.right):s=!0;return this},u.prototype.range=function(t,n,i,l){for(var s=[],L=this._comparator,p=this._root,m;s.length!==0||p;)if(p)s.push(p),p=p.left;else{if(p=s.pop(),m=L(p.key,n),m>0)break;if(L(p.key,t)>=0&&i.call(l,p))return this;p=p.right}return this},u.prototype.keys=function(){var t=[];return this.forEach(function(n){var i=n.key;return t.push(i)}),t},u.prototype.values=function(){var t=[];return this.forEach(function(n){var i=n.data;return t.push(i)}),t},u.prototype.min=function(){return this._root?this.minNode(this._root).key:null},u.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},u.prototype.minNode=function(t){if(t===void 0&&(t=this._root),t)for(;t.left;)t=t.left;return t},u.prototype.maxNode=function(t){if(t===void 0&&(t=this._root),t)for(;t.right;)t=t.right;return t},u.prototype.at=function(t){for(var n=this._root,i=!1,l=0,s=[];!i;)if(n)s.push(n),n=n.left;else if(s.length>0){if(n=s.pop(),l===t)return n;l++,n=n.right}else i=!0;return null},u.prototype.next=function(t){var n=this._root,i=null;if(t.right){for(i=t.right;i.left;)i=i.left;return i}for(var l=this._comparator;n;){var s=l(t.key,n.key);if(s===0)break;s<0?(i=n,n=n.left):n=n.right}return i},u.prototype.prev=function(t){var n=this._root,i=null;if(t.left!==null){for(i=t.left;i.right;)i=i.right;return i}for(var l=this._comparator;n;){var s=l(t.key,n.key);if(s===0)break;s<0?n=n.left:(i=n,n=n.right)}return i},u.prototype.clear=function(){return this._root=null,this._size=0,this},u.prototype.toList=function(){return I(this._root)},u.prototype.load=function(t,n,i){n===void 0&&(n=[]),i===void 0&&(i=!1);var l=t.length,s=this._comparator;if(i&&g(t,n,0,l-1,s),this._root===null)this._root=w(t,n,0,l),this._size=l;else{var L=k(this.toList(),T(t,n),s);l=this._size+l,this._root=b({head:L},0,l)}return this},u.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(u.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),u.prototype.toString=function(t){t===void 0&&(t=function(i){return String(i.key)});var n=[];return f(this._root,"",!0,function(i){return n.push(i)},t),n.join("")},u.prototype.update=function(t,n,i){var l=this._comparator,s=c(t,this._root,l),L=s.left,p=s.right;l(t,n)<0?p=o(n,i,p,l):L=o(n,i,L,l),this._root=a(L,p,l)},u.prototype.split=function(t){return c(t,this._root,this._comparator)},u.prototype[Symbol.iterator]=function(){var t,n,i;return y(this,function(l){switch(l.label){case 0:t=this._root,n=[],i=!1,l.label=1;case 1:return i?[3,6]:t===null?[3,2]:(n.push(t),t=t.left,[3,5]);case 2:return n.length===0?[3,4]:(t=n.pop(),[4,t]);case 3:return l.sent(),t=t.right,[3,5];case 4:i=!0,l.label=5;case 5:return[3,1];case 6:return[2]}})},u}();function w(u,t,n,i){var l=i-n;if(l>0){var s=n+Math.floor(l/2),L=u[s],p=t[s],m=new x(L,p);return m.left=w(u,t,n,s),m.right=w(u,t,s+1,i),m}return null}function T(u,t){for(var n=new x(null,null),i=n,l=0;l<u.length;l++)i=i.next=new x(u[l],t[l]);return i.next=null,n.next}function I(u){for(var t=u,n=[],i=!1,l=new x(null,null),s=l;!i;)t?(n.push(t),t=t.left):n.length>0?(t=s=s.next=n.pop(),t=t.right):i=!0;return s.next=null,l.next}function b(u,t,n){var i=n-t;if(i>0){var l=t+Math.floor(i/2),s=b(u,t,l),L=u.head;return L.left=s,u.head=u.head.next,L.right=b(u,l+1,n),L}return null}function k(u,t,n){for(var i=new x(null,null),l=i,s=u,L=t;s!==null&&L!==null;)n(s.key,L.key)<0?(l.next=s,s=s.next):(l.next=L,L=L.next),l=l.next;return s!==null?l.next=s:L!==null&&(l.next=L),i.next}function g(u,t,n,i,l){if(!(n>=i)){for(var s=u[n+i>>1],L=n-1,p=i+1;;){do L++;while(l(u[L],s)<0);do p--;while(l(u[p],s)>0);if(L>=p)break;var m=u[L];u[L]=u[p],u[p]=m,m=t[L],t[L]=t[p],t[p]=m}g(u,t,n,p,l),g(u,t,p+1,i,l)}}let P=(u,t)=>u.ll.x<=t.x&&t.x<=u.ur.x&&u.ll.y<=t.y&&t.y<=u.ur.y,N=(u,t)=>{if(t.ur.x<u.ll.x||u.ur.x<t.ll.x||t.ur.y<u.ll.y||u.ur.y<t.ll.y)return null;let n=u.ll.x<t.ll.x?t.ll.x:u.ll.x,i=u.ur.x<t.ur.x?u.ur.x:t.ur.x,l=u.ll.y<t.ll.y?t.ll.y:u.ll.y,s=u.ur.y<t.ur.y?u.ur.y:t.ur.y;return{ll:{x:n,y:l},ur:{x:i,y:s}}},A=Number.EPSILON;A===void 0&&(A=Math.pow(2,-52));let E=A*A,S=(u,t)=>{if(-A<u&&u<A&&-A<t&&t<A)return 0;let n=u-t;return n*n<E*u*t?0:u<t?-1:1};class O{constructor(){this.reset()}reset(){this.xRounder=new s0,this.yRounder=new s0}round(t,n){return{x:this.xRounder.round(t),y:this.yRounder.round(n)}}}class s0{constructor(){this.tree=new v,this.round(0)}round(t){let n=this.tree.add(t),i=this.tree.prev(n);if(i!==null&&S(n.key,i.key)===0)return this.tree.remove(t),i.key;let l=this.tree.next(n);return l!==null&&S(n.key,l.key)===0?(this.tree.remove(t),l.key):t}}let J=new O,H=11102230246251565e-32,V=134217729,C5=(3+8*H)*H;function U0(u,t,n,i,l){let s,L,p,m,d=t[0],R=i[0],h=0,_=0;R>d==R>-d?(s=d,d=t[++h]):(s=R,R=i[++_]);let M=0;if(h<u&&_<n)for(R>d==R>-d?(L=d+s,p=s-(L-d),d=t[++h]):(L=R+s,p=s-(L-R),R=i[++_]),s=L,p!==0&&(l[M++]=p);h<u&&_<n;)R>d==R>-d?(L=s+d,m=L-s,p=s-(L-m)+(d-m),d=t[++h]):(L=s+R,m=L-s,p=s-(L-m)+(R-m),R=i[++_]),s=L,p!==0&&(l[M++]=p);for(;h<u;)L=s+d,m=L-s,p=s-(L-m)+(d-m),d=t[++h],s=L,p!==0&&(l[M++]=p);for(;_<n;)L=s+R,m=L-s,p=s-(L-m)+(R-m),R=i[++_],s=L,p!==0&&(l[M++]=p);return(s!==0||M===0)&&(l[M++]=s),M}function B5(u,t){let n=t[0];for(let i=1;i<u;i++)n+=t[i];return n}function v0(u){return new Float64Array(u)}let U5=(3+16*H)*H,F5=(2+12*H)*H,W5=(9+64*H)*H*H,p0=v0(4),x5=v0(8),t5=v0(12),e5=v0(16),q=v0(4);function z5(u,t,n,i,l,s,L){let p,m,d,R,h,_,M,C,G,F,B,W,X,Y,Z,j,y0,D,n0=u-l,r0=n-l,i0=t-s,o0=i-s;Y=n0*o0,_=V*n0,M=_-(_-n0),C=n0-M,_=V*o0,G=_-(_-o0),F=o0-G,Z=C*F-(Y-M*G-C*G-M*F),j=i0*r0,_=V*i0,M=_-(_-i0),C=i0-M,_=V*r0,G=_-(_-r0),F=r0-G,y0=C*F-(j-M*G-C*G-M*F),B=Z-y0,h=Z-B,p0[0]=Z-(B+h)+(h-y0),W=Y+B,h=W-Y,X=Y-(W-h)+(B-h),B=X-j,h=X-B,p0[1]=X-(B+h)+(h-j),D=W+B,h=D-W,p0[2]=W-(D-h)+(B-h),p0[3]=D;let l0=B5(4,p0),w0=F5*L;if(l0>=w0||-l0>=w0||(h=u-n0,p=u-(n0+h)+(h-l),h=n-r0,d=n-(r0+h)+(h-l),h=t-i0,m=t-(i0+h)+(h-s),h=i-o0,R=i-(o0+h)+(h-s),p===0&&m===0&&d===0&&R===0)||(w0=W5*L+C5*Math.abs(l0),l0+=n0*R+o0*p-(i0*d+r0*m),l0>=w0||-l0>=w0))return l0;Y=p*o0,_=V*p,M=_-(_-p),C=p-M,_=V*o0,G=_-(_-o0),F=o0-G,Z=C*F-(Y-M*G-C*G-M*F),j=m*r0,_=V*m,M=_-(_-m),C=m-M,_=V*r0,G=_-(_-r0),F=r0-G,y0=C*F-(j-M*G-C*G-M*F),B=Z-y0,h=Z-B,q[0]=Z-(B+h)+(h-y0),W=Y+B,h=W-Y,X=Y-(W-h)+(B-h),B=X-j,h=X-B,q[1]=X-(B+h)+(h-j),D=W+B,h=D-W,q[2]=W-(D-h)+(B-h),q[3]=D;let K5=U0(4,p0,4,q,x5);Y=n0*R,_=V*n0,M=_-(_-n0),C=n0-M,_=V*R,G=_-(_-R),F=R-G,Z=C*F-(Y-M*G-C*G-M*F),j=i0*d,_=V*i0,M=_-(_-i0),C=i0-M,_=V*d,G=_-(_-d),F=d-G,y0=C*F-(j-M*G-C*G-M*F),B=Z-y0,h=Z-B,q[0]=Z-(B+h)+(h-y0),W=Y+B,h=W-Y,X=Y-(W-h)+(B-h),B=X-j,h=X-B,q[1]=X-(B+h)+(h-j),D=W+B,h=D-W,q[2]=W-(D-h)+(B-h),q[3]=D;let y4=U0(K5,x5,4,q,t5);Y=p*R,_=V*p,M=_-(_-p),C=p-M,_=V*R,G=_-(_-R),F=R-G,Z=C*F-(Y-M*G-C*G-M*F),j=m*d,_=V*m,M=_-(_-m),C=m-M,_=V*d,G=_-(_-d),F=d-G,y0=C*F-(j-M*G-C*G-M*F),B=Z-y0,h=Z-B,q[0]=Z-(B+h)+(h-y0),W=Y+B,h=W-Y,X=Y-(W-h)+(B-h),B=X-j,h=X-B,q[1]=X-(B+h)+(h-j),D=W+B,h=D-W,q[2]=W-(D-h)+(B-h),q[3]=D;let x4=U0(y4,t5,4,q,e5);return e5[x4-1]}function $5(u,t,n,i,l,s){let L=(t-s)*(n-l),p=(u-l)*(i-s),m=L-p,d=Math.abs(L+p);return Math.abs(m)>=U5*d?m:-z5(u,t,n,i,l,s,d)}let R0=(u,t)=>u.x*t.y-u.y*t.x,n5=(u,t)=>u.x*t.x+u.y*t.y,r5=(u,t,n)=>{let i=$5(u.x,u.y,t.x,t.y,n.x,n.y);return i>0?-1:i<0?1:0},k0=u=>Math.sqrt(n5(u,u)),Y5=(u,t,n)=>{let i={x:t.x-u.x,y:t.y-u.y},l={x:n.x-u.x,y:n.y-u.y};return R0(l,i)/k0(l)/k0(i)},V5=(u,t,n)=>{let i={x:t.x-u.x,y:t.y-u.y},l={x:n.x-u.x,y:n.y-u.y};return n5(l,i)/k0(l)/k0(i)},i5=(u,t,n)=>t.y===0?null:{x:u.x+t.x/t.y*(n-u.y),y:n},o5=(u,t,n)=>t.x===0?null:{x:n,y:u.y+t.y/t.x*(n-u.x)},X5=(u,t,n,i)=>{if(t.x===0)return o5(n,i,u.x);if(i.x===0)return o5(u,t,n.x);if(t.y===0)return i5(n,i,u.y);if(i.y===0)return i5(u,t,n.y);let l=R0(t,i);if(l==0)return null;let s={x:n.x-u.x,y:n.y-u.y},L=R0(s,t)/l,p=R0(s,i)/l,m=u.x+p*t.x,d=n.x+L*i.x,R=u.y+p*t.y,h=n.y+L*i.y,_=(m+d)/2,M=(R+h)/2;return{x:_,y:M}};class K{static compare(t,n){let i=K.comparePoints(t.point,n.point);return i!==0?i:(t.point!==n.point&&t.link(n),t.isLeft!==n.isLeft?t.isLeft?1:-1:a0.compare(t.segment,n.segment))}static comparePoints(t,n){return t.x<n.x?-1:t.x>n.x?1:t.y<n.y?-1:t.y>n.y?1:0}constructor(t,n){t.events===void 0?t.events=[this]:t.events.push(this),this.point=t,this.isLeft=n}link(t){if(t.point===this.point)throw new Error("Tried to link already linked events");let n=t.point.events;for(let i=0,l=n.length;i<l;i++){let s=n[i];this.point.events.push(s),s.point=this.point}this.checkForConsuming()}checkForConsuming(){let t=this.point.events.length;for(let n=0;n<t;n++){let i=this.point.events[n];if(i.segment.consumedBy===void 0)for(let l=n+1;l<t;l++){let s=this.point.events[l];s.consumedBy===void 0&&i.otherSE.point.events===s.otherSE.point.events&&i.segment.consume(s.segment)}}}getAvailableLinkedEvents(){let t=[];for(let n=0,i=this.point.events.length;n<i;n++){let l=this.point.events[n];l!==this&&!l.segment.ringOut&&l.segment.isInResult()&&t.push(l)}return t}getLeftmostComparator(t){let n=new Map,i=l=>{let s=l.otherSE;n.set(l,{sine:Y5(this.point,t.point,s.point),cosine:V5(this.point,t.point,s.point)})};return(l,s)=>{n.has(l)||i(l),n.has(s)||i(s);let{sine:L,cosine:p}=n.get(l),{sine:m,cosine:d}=n.get(s);return L>=0&&m>=0?p<d?1:p>d?-1:0:L<0&&m<0?p<d?-1:p>d?1:0:m<L?-1:m>L?1:0}}}let Z5=0;class a0{static compare(t,n){let i=t.leftSE.point.x,l=n.leftSE.point.x,s=t.rightSE.point.x,L=n.rightSE.point.x;if(L<i)return 1;if(s<l)return-1;let p=t.leftSE.point.y,m=n.leftSE.point.y,d=t.rightSE.point.y,R=n.rightSE.point.y;if(i<l){if(m<p&&m<d)return 1;if(m>p&&m>d)return-1;let h=t.comparePoint(n.leftSE.point);if(h<0)return 1;if(h>0)return-1;let _=n.comparePoint(t.rightSE.point);return _!==0?_:-1}if(i>l){if(p<m&&p<R)return-1;if(p>m&&p>R)return 1;let h=n.comparePoint(t.leftSE.point);if(h!==0)return h;let _=t.comparePoint(n.rightSE.point);return _<0?1:_>0?-1:1}if(p<m)return-1;if(p>m)return 1;if(s<L){let h=n.comparePoint(t.rightSE.point);if(h!==0)return h}if(s>L){let h=t.comparePoint(n.rightSE.point);if(h<0)return 1;if(h>0)return-1}if(s!==L){let h=d-p,_=s-i,M=R-m,C=L-l;if(h>_&&M<C)return 1;if(h<_&&M>C)return-1}return s>L?1:s<L||d<R?-1:d>R?1:t.id<n.id?-1:t.id>n.id?1:0}constructor(t,n,i,l){this.id=++Z5,this.leftSE=t,t.segment=this,t.otherSE=n,this.rightSE=n,n.segment=this,n.otherSE=t,this.rings=i,this.windings=l}static fromRing(t,n,i){let l,s,L,p=K.comparePoints(t,n);if(p<0)l=t,s=n,L=1;else if(p>0)l=n,s=t,L=-1;else throw new Error(`Tried to create degenerate segment at [${t.x}, ${t.y}]`);let m=new K(l,!0),d=new K(s,!1);return new a0(m,d,[i],[L])}replaceRightSE(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){let t=this.leftSE.point.y,n=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:t<n?t:n},ur:{x:this.rightSE.point.x,y:t>n?t:n}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(t){return t.x===this.leftSE.point.x&&t.y===this.leftSE.point.y||t.x===this.rightSE.point.x&&t.y===this.rightSE.point.y}comparePoint(t){if(this.isAnEndpoint(t))return 0;let n=this.leftSE.point,i=this.rightSE.point,l=this.vector();if(n.x===i.x)return t.x===n.x?0:t.x<n.x?1:-1;let s=(t.y-n.y)/l.y,L=n.x+s*l.x;if(t.x===L)return 0;let p=(t.x-n.x)/l.x,m=n.y+p*l.y;return t.y===m?0:t.y<m?-1:1}getIntersection(t){let n=this.bbox(),i=t.bbox(),l=N(n,i);if(l===null)return null;let s=this.leftSE.point,L=this.rightSE.point,p=t.leftSE.point,m=t.rightSE.point,d=P(n,p)&&this.comparePoint(p)===0,R=P(i,s)&&t.comparePoint(s)===0,h=P(n,m)&&this.comparePoint(m)===0,_=P(i,L)&&t.comparePoint(L)===0;if(R&&d)return _&&!h?L:!_&&h?m:null;if(R)return h&&s.x===m.x&&s.y===m.y?null:s;if(d)return _&&L.x===p.x&&L.y===p.y?null:p;if(_&&h)return null;if(_)return L;if(h)return m;let M=X5(s,this.vector(),p,t.vector());return M===null||!P(l,M)?null:J.round(M.x,M.y)}split(t){let n=[],i=t.events!==void 0,l=new K(t,!0),s=new K(t,!1),L=this.rightSE;this.replaceRightSE(s),n.push(s),n.push(l);let p=new a0(l,L,this.rings.slice(),this.windings.slice());return K.comparePoints(p.leftSE.point,p.rightSE.point)>0&&p.swapEvents(),K.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),i&&(l.checkForConsuming(),s.checkForConsuming()),n}swapEvents(){let t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let n=0,i=this.windings.length;n<i;n++)this.windings[n]*=-1}consume(t){let n=this,i=t;for(;n.consumedBy;)n=n.consumedBy;for(;i.consumedBy;)i=i.consumedBy;let l=a0.compare(n,i);if(l!==0){if(l>0){let s=n;n=i,i=s}if(n.prev===i){let s=n;n=i,i=s}for(let s=0,L=i.rings.length;s<L;s++){let p=i.rings[s],m=i.windings[s],d=n.rings.indexOf(p);d===-1?(n.rings.push(p),n.windings.push(m)):n.windings[d]+=m}i.rings=null,i.windings=null,i.consumedBy=n,i.leftSE.consumedBy=n.leftSE,i.rightSE.consumedBy=n.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{let t=this.prev.consumedBy||this.prev;this._beforeState=t.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;let t=this.beforeState();this._afterState={rings:t.rings.slice(0),windings:t.windings.slice(0),multiPolys:[]};let n=this._afterState.rings,i=this._afterState.windings,l=this._afterState.multiPolys;for(let p=0,m=this.rings.length;p<m;p++){let d=this.rings[p],R=this.windings[p],h=n.indexOf(d);h===-1?(n.push(d),i.push(R)):i[h]+=R}let s=[],L=[];for(let p=0,m=n.length;p<m;p++){if(i[p]===0)continue;let d=n[p],R=d.poly;if(L.indexOf(R)===-1)if(d.isExterior)s.push(R);else{L.indexOf(R)===-1&&L.push(R);let h=s.indexOf(d.poly);h!==-1&&s.splice(h,1)}}for(let p=0,m=s.length;p<m;p++){let d=s[p].multiPoly;l.indexOf(d)===-1&&l.push(d)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;let t=this.beforeState().multiPolys,n=this.afterState().multiPolys;switch(e0.type){case"union":{let i=t.length===0,l=n.length===0;this._isInResult=i!==l;break}case"intersection":{let i,l;t.length<n.length?(i=t.length,l=n.length):(i=n.length,l=t.length),this._isInResult=l===e0.numMultiPolys&&i<l;break}case"xor":{let i=Math.abs(t.length-n.length);this._isInResult=i%2===1;break}case"difference":{let i=l=>l.length===1&&l[0].isSubject;this._isInResult=i(t)!==i(n);break}default:throw new Error(`Unrecognized operation type found ${e0.type}`)}return this._isInResult}}class s5{constructor(t,n,i){if(!Array.isArray(t)||t.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=n,this.isExterior=i,this.segments=[],typeof t[0][0]!="number"||typeof t[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let l=J.round(t[0][0],t[0][1]);this.bbox={ll:{x:l.x,y:l.y},ur:{x:l.x,y:l.y}};let s=l;for(let L=1,p=t.length;L<p;L++){if(typeof t[L][0]!="number"||typeof t[L][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let m=J.round(t[L][0],t[L][1]);m.x===s.x&&m.y===s.y||(this.segments.push(a0.fromRing(s,m,this)),m.x<this.bbox.ll.x&&(this.bbox.ll.x=m.x),m.y<this.bbox.ll.y&&(this.bbox.ll.y=m.y),m.x>this.bbox.ur.x&&(this.bbox.ur.x=m.x),m.y>this.bbox.ur.y&&(this.bbox.ur.y=m.y),s=m)}(l.x!==s.x||l.y!==s.y)&&this.segments.push(a0.fromRing(s,l,this))}getSweepEvents(){let t=[];for(let n=0,i=this.segments.length;n<i;n++){let l=this.segments[n];t.push(l.leftSE),t.push(l.rightSE)}return t}}class j5{constructor(t,n){if(!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new s5(t[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let i=1,l=t.length;i<l;i++){let s=new s5(t[i],this,!1);s.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=s.bbox.ll.x),s.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=s.bbox.ll.y),s.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=s.bbox.ur.y),this.interiorRings.push(s)}this.multiPoly=n}getSweepEvents(){let t=this.exteriorRing.getSweepEvents();for(let n=0,i=this.interiorRings.length;n<i;n++){let l=this.interiorRings[n].getSweepEvents();for(let s=0,L=l.length;s<L;s++)t.push(l[s])}return t}}class l5{constructor(t,n){if(!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof t[0][0][0]=="number"&&(t=[t])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let i=0,l=t.length;i<l;i++){let s=new j5(t[i],this);s.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=s.bbox.ll.x),s.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=s.bbox.ll.y),s.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=s.bbox.ur.y),this.polys.push(s)}this.isSubject=n}getSweepEvents(){let t=[];for(let n=0,i=this.polys.length;n<i;n++){let l=this.polys[n].getSweepEvents();for(let s=0,L=l.length;s<L;s++)t.push(l[s])}return t}}class A0{static factory(t){let n=[];for(let i=0,l=t.length;i<l;i++){let s=t[i];if(!s.isInResult()||s.ringOut)continue;let L=null,p=s.leftSE,m=s.rightSE,d=[p],R=p.point,h=[];for(;L=p,p=m,d.push(p),p.point!==R;)for(;;){let _=p.getAvailableLinkedEvents();if(_.length===0){let G=d[0].point,F=d[d.length-1].point;throw new Error(`Unable to complete output ring starting at [${G.x}, ${G.y}]. Last matching segment found ends at [${F.x}, ${F.y}].`)}if(_.length===1){m=_[0].otherSE;break}let M=null;for(let G=0,F=h.length;G<F;G++)if(h[G].point===p.point){M=G;break}if(M!==null){let G=h.splice(M)[0],F=d.splice(G.index);F.unshift(F[0].otherSE),n.push(new A0(F.reverse()));continue}h.push({index:d.length,point:p.point});let C=p.getLeftmostComparator(L);m=_.sort(C)[0].otherSE;break}n.push(new A0(d))}return n}constructor(t){this.events=t;for(let n=0,i=t.length;n<i;n++)t[n].segment.ringOut=this;this.poly=null}getGeom(){let t=this.events[0].point,n=[t];for(let d=1,R=this.events.length-1;d<R;d++){let h=this.events[d].point,_=this.events[d+1].point;r5(h,t,_)!==0&&(n.push(h),t=h)}if(n.length===1)return null;let i=n[0],l=n[1];r5(i,t,l)===0&&n.shift(),n.push(n[0]);let s=this.isExteriorRing()?1:-1,L=this.isExteriorRing()?0:n.length-1,p=this.isExteriorRing()?n.length:-1,m=[];for(let d=L;d!=p;d+=s)m.push([n[d].x,n[d].y]);return m}isExteriorRing(){if(this._isExteriorRing===void 0){let t=this.enclosingRing();this._isExteriorRing=t?!t.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let t=this.events[0];for(let l=1,s=this.events.length;l<s;l++){let L=this.events[l];K.compare(t,L)>0&&(t=L)}let n=t.segment.prevInResult(),i=n?n.prevInResult():null;for(;;){if(!n)return null;if(!i)return n.ringOut;if(i.ringOut!==n.ringOut)return i.ringOut.enclosingRing()!==n.ringOut?n.ringOut:n.ringOut.enclosingRing();n=i.prevInResult(),i=n?n.prevInResult():null}}}class c5{constructor(t){this.exteriorRing=t,t.poly=this,this.interiorRings=[]}addInterior(t){this.interiorRings.push(t),t.poly=this}getGeom(){let t=[this.exteriorRing.getGeom()];if(t[0]===null)return null;for(let n=0,i=this.interiorRings.length;n<i;n++){let l=this.interiorRings[n].getGeom();l!==null&&t.push(l)}return t}}class D5{constructor(t){this.rings=t,this.polys=this._composePolys(t)}getGeom(){let t=[];for(let n=0,i=this.polys.length;n<i;n++){let l=this.polys[n].getGeom();l!==null&&t.push(l)}return t}_composePolys(t){let n=[];for(let i=0,l=t.length;i<l;i++){let s=t[i];if(!s.poly)if(s.isExteriorRing())n.push(new c5(s));else{let L=s.enclosingRing();L.poly||n.push(new c5(L)),L.poly.addInterior(s)}}return n}}class q5{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:a0.compare;this.queue=t,this.tree=new v(n),this.segments=[]}process(t){let n=t.segment,i=[];if(t.consumedBy)return t.isLeft?this.queue.remove(t.otherSE):this.tree.remove(n),i;let l=t.isLeft?this.tree.add(n):this.tree.find(n);if(!l)throw new Error(`Unable to find segment #${n.id} [${n.leftSE.point.x}, ${n.leftSE.point.y}] -> [${n.rightSE.point.x}, ${n.rightSE.point.y}] in SweepLine tree.`);let s=l,L=l,p,m;for(;p===void 0;)s=this.tree.prev(s),s===null?p=null:s.key.consumedBy===void 0&&(p=s.key);for(;m===void 0;)L=this.tree.next(L),L===null?m=null:L.key.consumedBy===void 0&&(m=L.key);if(t.isLeft){let d=null;if(p){let h=p.getIntersection(n);if(h!==null&&(n.isAnEndpoint(h)||(d=h),!p.isAnEndpoint(h))){let _=this._splitSafely(p,h);for(let M=0,C=_.length;M<C;M++)i.push(_[M])}}let R=null;if(m){let h=m.getIntersection(n);if(h!==null&&(n.isAnEndpoint(h)||(R=h),!m.isAnEndpoint(h))){let _=this._splitSafely(m,h);for(let M=0,C=_.length;M<C;M++)i.push(_[M])}}if(d!==null||R!==null){let h=null;d===null?h=R:R===null?h=d:h=K.comparePoints(d,R)<=0?d:R,this.queue.remove(n.rightSE),i.push(n.rightSE);let _=n.split(h);for(let M=0,C=_.length;M<C;M++)i.push(_[M])}i.length>0?(this.tree.remove(n),i.push(t)):(this.segments.push(n),n.prev=p)}else{if(p&&m){let d=p.getIntersection(m);if(d!==null){if(!p.isAnEndpoint(d)){let R=this._splitSafely(p,d);for(let h=0,_=R.length;h<_;h++)i.push(R[h])}if(!m.isAnEndpoint(d)){let R=this._splitSafely(m,d);for(let h=0,_=R.length;h<_;h++)i.push(R[h])}}}this.tree.remove(n)}return i}_splitSafely(t,n){this.tree.remove(t);let i=t.rightSE;this.queue.remove(i);let l=t.split(n);return l.push(i),t.consumedBy===void 0&&this.tree.add(t),l}}let a5=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,H5=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class Q5{run(t,n,i){e0.type=t,J.reset();let l=[new l5(n,!0)];for(let h=0,_=i.length;h<_;h++)l.push(new l5(i[h],!1));if(e0.numMultiPolys=l.length,e0.type==="difference"){let h=l[0],_=1;for(;_<l.length;)N(l[_].bbox,h.bbox)!==null?_++:l.splice(_,1)}if(e0.type==="intersection")for(let h=0,_=l.length;h<_;h++){let M=l[h];for(let C=h+1,G=l.length;C<G;C++)if(N(M.bbox,l[C].bbox)===null)return[]}let s=new v(K.compare);for(let h=0,_=l.length;h<_;h++){let M=l[h].getSweepEvents();for(let C=0,G=M.length;C<G;C++)if(s.insert(M[C]),s.size>a5)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}let L=new q5(s),p=s.size,m=s.pop();for(;m;){let h=m.key;if(s.size===p){let M=h.segment;throw new Error(`Unable to pop() ${h.isLeft?"left":"right"} SweepEvent [${h.point.x}, ${h.point.y}] from segment #${M.id} [${M.leftSE.point.x}, ${M.leftSE.point.y}] -> [${M.rightSE.point.x}, ${M.rightSE.point.y}] from queue.`)}if(s.size>a5)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(L.segments.length>H5)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");let _=L.process(h);for(let M=0,C=_.length;M<C;M++){let G=_[M];G.consumedBy===void 0&&s.insert(G)}p=s.size,m=s.pop()}J.reset();let d=A0.factory(L.segments);return new D5(d).getGeom()}}let e0=new Q5;var J5={union:function(u){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return e0.run("union",u,n)},intersection:function(u){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return e0.run("intersection",u,n)},xor:function(u){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return e0.run("xor",u,n)},difference:function(u){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return e0.run("difference",u,n)}};return J5})});function $0(y,x,e=2){let r=x&&x.length,o=r?x[0]*e:y.length,c=f5(y,0,o,e,!0),a=[];if(!c||c.next===c.prev)return a;let f,v,w;if(r&&(c=p4(y,x,c,e)),y.length>80*e){f=y[0],v=y[1];let T=f,I=v;for(let b=e;b<o;b+=e){let k=y[b],g=y[b+1];k<f&&(f=k),g<v&&(v=g),k>T&&(T=k),g>I&&(I=g)}w=Math.max(T-f,I-v),w=w!==0?32767/w:0}return M0(c,a,e,f,v,w,0),a}function f5(y,x,e,r,o){let c;if(o===S4(y,x,e,r)>0)for(let a=x;a<e;a+=r)c=u5(a/r|0,y[a],y[a+1],c);else for(let a=e-r;a>=x;a-=r)c=u5(a/r|0,y[a],y[a+1],c);return c&&L0(c,c.next)&&(S0(c),c=c.next),c}function u0(y,x){if(!y)return y;x||(x=y);let e=y,r;do if(r=!1,!e.steiner&&(L0(e,e.next)||z(e.prev,e,e.next)===0)){if(S0(e),e=x=e.prev,e===e.next)break;r=!0}else e=e.next;while(r||e!==x);return x}function M0(y,x,e,r,o,c,a){if(!y)return;!a&&c&&_4(y,r,o,c);let f=y;for(;y.prev!==y.next;){let v=y.prev,w=y.next;if(c?u4(y,r,o,c):a4(y)){x.push(v.i,y.i,w.i),S0(y),y=w.next,f=w.next;continue}if(y=w,y===f){a?a===1?(y=f4(u0(y),x),M0(y,x,e,r,o,c,2)):a===2&&h4(y,x,e,r,o,c):M0(u0(y),x,e,r,o,c,1);break}}}function a4(y){let x=y.prev,e=y,r=y.next;if(z(x,e,r)>=0)return!1;let o=x.x,c=e.x,a=r.x,f=x.y,v=e.y,w=r.y,T=Math.min(o,c,a),I=Math.min(f,v,w),b=Math.max(o,c,a),k=Math.max(f,v,w),g=r.next;for(;g!==x;){if(g.x>=T&&g.x<=b&&g.y>=I&&g.y<=k&&b0(o,f,c,v,a,w,g.x,g.y)&&z(g.prev,g,g.next)>=0)return!1;g=g.next}return!0}function u4(y,x,e,r){let o=y.prev,c=y,a=y.next;if(z(o,c,a)>=0)return!1;let f=o.x,v=c.x,w=a.x,T=o.y,I=c.y,b=a.y,k=Math.min(f,v,w),g=Math.min(T,I,b),P=Math.max(f,v,w),N=Math.max(T,I,b),A=W0(k,g,x,e,r),E=W0(P,N,x,e,r),S=y.prevZ,O=y.nextZ;for(;S&&S.z>=A&&O&&O.z<=E;){if(S.x>=k&&S.x<=P&&S.y>=g&&S.y<=N&&S!==o&&S!==a&&b0(f,T,v,I,w,b,S.x,S.y)&&z(S.prev,S,S.next)>=0||(S=S.prevZ,O.x>=k&&O.x<=P&&O.y>=g&&O.y<=N&&O!==o&&O!==a&&b0(f,T,v,I,w,b,O.x,O.y)&&z(O.prev,O,O.next)>=0))return!1;O=O.nextZ}for(;S&&S.z>=A;){if(S.x>=k&&S.x<=P&&S.y>=g&&S.y<=N&&S!==o&&S!==a&&b0(f,T,v,I,w,b,S.x,S.y)&&z(S.prev,S,S.next)>=0)return!1;S=S.prevZ}for(;O&&O.z<=E;){if(O.x>=k&&O.x<=P&&O.y>=g&&O.y<=N&&O!==o&&O!==a&&b0(f,T,v,I,w,b,O.x,O.y)&&z(O.prev,O,O.next)>=0)return!1;O=O.nextZ}return!0}function f4(y,x){let e=y;do{let r=e.prev,o=e.next.next;!L0(r,o)&&p5(r,e,e.next,o)&&E0(r,o)&&E0(o,r)&&(x.push(r.i,e.i,o.i),S0(e),S0(e.next),e=y=o),e=e.next}while(e!==y);return u0(e)}function h4(y,x,e,r,o,c){let a=y;do{let f=a.next.next;for(;f!==a.prev;){if(a.i!==f.i&&b4(a,f)){let v=L5(a,f);a=u0(a,a.next),v=u0(v,v.next),M0(a,x,e,r,o,c,0),M0(v,x,e,r,o,c,0);return}f=f.next}a=a.next}while(a!==y)}function p4(y,x,e,r){let o=[];for(let c=0,a=x.length;c<a;c++){let f=x[c]*r,v=c<a-1?x[c+1]*r:y.length,w=f5(y,f,v,r,!1);w===w.next&&(w.steiner=!0),o.push(w4(w))}o.sort(L4);for(let c=0;c<o.length;c++)e=g4(o[c],e);return e}function L4(y,x){let e=y.x-x.x;if(e===0&&(e=y.y-x.y,e===0)){let r=(y.next.y-y.y)/(y.next.x-y.x),o=(x.next.y-x.y)/(x.next.x-x.x);e=r-o}return e}function g4(y,x){let e=d4(y,x);if(!e)return x;let r=L5(e,y);return u0(r,r.next),u0(e,e.next)}function d4(y,x){let e=x,r=y.x,o=y.y,c=-1/0,a;if(L0(y,e))return e;do{if(L0(y,e.next))return e.next;if(o<=e.y&&o>=e.next.y&&e.next.y!==e.y){let I=e.x+(o-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(I<=r&&I>c&&(c=I,a=e.x<e.next.x?e:e.next,I===r))return a}e=e.next}while(e!==x);if(!a)return null;let f=a,v=a.x,w=a.y,T=1/0;e=a;do{if(r>=e.x&&e.x>=v&&r!==e.x&&h5(o<w?r:c,o,v,w,o<w?c:r,o,e.x,e.y)){let I=Math.abs(o-e.y)/(r-e.x);E0(e,y)&&(I<T||I===T&&(e.x>a.x||e.x===a.x&&m4(a,e)))&&(a=e,T=I)}e=e.next}while(e!==f);return a}function m4(y,x){return z(y.prev,y,x.prev)<0&&z(x.next,y,y.next)<0}function _4(y,x,e,r){let o=y;do o.z===0&&(o.z=W0(o.x,o.y,x,e,r)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next;while(o!==y);o.prevZ.nextZ=null,o.prevZ=null,v4(o)}function v4(y){let x,e=1;do{let r=y,o;y=null;let c=null;for(x=0;r;){x++;let a=r,f=0;for(let w=0;w<e&&(f++,a=a.nextZ,!!a);w++);let v=e;for(;f>0||v>0&&a;)f!==0&&(v===0||!a||r.z<=a.z)?(o=r,r=r.nextZ,f--):(o=a,a=a.nextZ,v--),c?c.nextZ=o:y=o,o.prevZ=c,c=o;r=a}c.nextZ=null,e*=2}while(x>1);return y}function W0(y,x,e,r,o){return y=(y-e)*o|0,x=(x-r)*o|0,y=(y|y<<8)&16711935,y=(y|y<<4)&252645135,y=(y|y<<2)&858993459,y=(y|y<<1)&1431655765,x=(x|x<<8)&16711935,x=(x|x<<4)&252645135,x=(x|x<<2)&858993459,x=(x|x<<1)&1431655765,y|x<<1}function w4(y){let x=y,e=y;do(x.x<e.x||x.x===e.x&&x.y<e.y)&&(e=x),x=x.next;while(x!==y);return e}function h5(y,x,e,r,o,c,a,f){return(o-a)*(x-f)>=(y-a)*(c-f)&&(y-a)*(r-f)>=(e-a)*(x-f)&&(e-a)*(c-f)>=(o-a)*(r-f)}function b0(y,x,e,r,o,c,a,f){return!(y===a&&x===f)&&h5(y,x,e,r,o,c,a,f)}function b4(y,x){return y.next.i!==x.i&&y.prev.i!==x.i&&!M4(y,x)&&(E0(y,x)&&E0(x,y)&&E4(y,x)&&(z(y.prev,y,x.prev)||z(y,x.prev,x))||L0(y,x)&&z(y.prev,y,y.next)>0&&z(x.prev,x,x.next)>0)}function z(y,x,e){return(x.y-y.y)*(e.x-x.x)-(x.x-y.x)*(e.y-x.y)}function L0(y,x){return y.x===x.x&&y.y===x.y}function p5(y,x,e,r){let o=N0(z(y,x,e)),c=N0(z(y,x,r)),a=N0(z(e,r,y)),f=N0(z(e,r,x));return!!(o!==c&&a!==f||o===0&&T0(y,e,x)||c===0&&T0(y,r,x)||a===0&&T0(e,y,r)||f===0&&T0(e,x,r))}function T0(y,x,e){return x.x<=Math.max(y.x,e.x)&&x.x>=Math.min(y.x,e.x)&&x.y<=Math.max(y.y,e.y)&&x.y>=Math.min(y.y,e.y)}function N0(y){return y>0?1:y<0?-1:0}function M4(y,x){let e=y;do{if(e.i!==y.i&&e.next.i!==y.i&&e.i!==x.i&&e.next.i!==x.i&&p5(e,e.next,y,x))return!0;e=e.next}while(e!==y);return!1}function E0(y,x){return z(y.prev,y,y.next)<0?z(y,x,y.next)>=0&&z(y,y.prev,x)>=0:z(y,x,y.prev)<0||z(y,y.next,x)<0}function E4(y,x){let e=y,r=!1,o=(y.x+x.x)/2,c=(y.y+x.y)/2;do e.y>c!=e.next.y>c&&e.next.y!==e.y&&o<(e.next.x-e.x)*(c-e.y)/(e.next.y-e.y)+e.x&&(r=!r),e=e.next;while(e!==y);return r}function L5(y,x){let e=z0(y.i,y.x,y.y),r=z0(x.i,x.x,x.y),o=y.next,c=x.prev;return y.next=x,x.prev=y,e.next=o,o.prev=e,r.next=e,e.prev=r,c.next=r,r.prev=c,r}function u5(y,x,e,r){let o=z0(y,x,e);return r?(o.next=r.next,o.prev=r,r.next.prev=o,r.next=o):(o.prev=o,o.next=o),o}function S0(y){y.next.prev=y.prev,y.prev.next=y.next,y.prevZ&&(y.prevZ.nextZ=y.nextZ),y.nextZ&&(y.nextZ.prevZ=y.prevZ)}function z0(y,x,e){return{i:y,x,y:e,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function S4(y,x,e,r){let o=0;for(let c=x,a=e-r;c<e;c+=r)o+=(y[a]-y[c])*(y[c+1]+y[a+1]),a=c;return o}var R5=c4(g5(),1);var d5={0:"M0.301025 0.257813 L0.206593 0.283385 L0.122042 0.361307 L0.075923 0.474441 L0.064942 0.642221 L0.091296 0.78289 L0.159376 0.899463 L0.257104 0.961214 L0.344948 0.961214 L0.442678 0.899463 L0.510757 0.78289 L0.537111 0.642221 L0.526131 0.474441 L0.480012 0.361307 L0.39546 0.283385 L0.301025 0.257813",1:"M0.220426 0.40845 L0.381626 0.270996 L0.381626 0.948966",2:"M0.110409 0.39212 L0.125621 0.342293 L0.170571 0.295823 L0.244237 0.26431 L0.291518 0.257813 L0.373319 0.263799 L0.434683 0.290705 L0.468239 0.331966 L0.480292 0.379913 L0.479492 0.411806 L0.465088 0.465192 L0.402571 0.568988 L0.245134 0.766438 L0.07959 0.948045 L0.522462 0.948045",3:"M0.081606 0.345073 L0.119154 0.315633 L0.178996 0.284091 L0.255265 0.257813 L0.349133 0.263062 L0.43127 0.289348 L0.48994 0.336662 L0.525141 0.394491 L0.513407 0.457577 L0.466472 0.504892 L0.384334 0.541692 L0.290464 0.56272 L0.20833 0.573235 L0.290464 0.583749 L0.384334 0.610035 L0.466472 0.652092 L0.519274 0.709922 L0.531007 0.773007 L0.50754 0.841351 L0.454738 0.899179 L0.3726 0.946494 L0.310412 0.961214 L0.209503 0.959111 L0.127367 0.946494 L0.071046 0.929671",4:"M0.418494 0.270996 L0.048828 0.724199 L0.553224 0.724199 M0.414181 0.578167 L0.414181 0.94897",5:"M0.074951 0.270996 L0.074951 0.614701 L0.267655 0.5695 L0.405247 0.586502 L0.460002 0.617189 L0.498028 0.660731 L0.527101 0.779401 L0.513352 0.841049 L0.477274 0.889568 L0.406378 0.93463 L0.324445 0.958337 L0.247399 0.962139 L0.182516 0.949767 L0.130068 0.925508 L0.074951 0.875607 M0.074951 0.270996 L0.527101 0.270996",6:"M0.428549 0.257813 L0.341433 0.285053 L0.26073 0.312099 L0.192188 0.360182 L0.138902 0.410969 L0.098219 0.500422 L0.070249 0.584267 L0.067264 0.670716 L0.065164 0.756863 L0.087163 0.820973 L0.108168 0.861042 L0.157916 0.913131 L0.210981 0.948192 L0.29279 0.961214 L0.384548 0.956206 L0.456409 0.924151 L0.507262 0.881077 L0.5349 0.821975 L0.537111 0.771889 L0.521634 0.718798 L0.498418 0.67372 L0.463042 0.636657 L0.414398 0.613617 L0.34696 0.598591 L0.28284 0.595587 L0.215403 0.605604 L0.145756 0.641665 L0.109274 0.678729 L0.064942 0.724006",7:"M0.071534 0.270996 L0.530519 0.270996 L0.495935 0.291702 L0.477752 0.305407 L0.435186 0.346112 L0.412067 0.374136 L0.388565 0.40796 L0.365315 0.448098 L0.342943 0.495062 L0.322081 0.549366 L0.303364 0.611524 L0.287416 0.68205 L0.270077 0.80465 L0.26253 0.94897",8:"M0.286761 0.257813 L0.210684 0.27162 L0.1414 0.305622 L0.092494 0.382125 L0.111513 0.450128 L0.16857 0.502193 L0.228345 0.539382 L0.377781 0.594635 L0.470161 0.645637 L0.52586 0.706203 L0.538087 0.792269 L0.506841 0.87621 L0.438915 0.927212 L0.339743 0.961214 L0.263666 0.959089 L0.174004 0.929337 L0.102003 0.881523 L0.063965 0.811395 L0.066682 0.741266 L0.102003 0.671139 L0.180797 0.608448 L0.259591 0.580822 L0.358762 0.548945 L0.456576 0.49688 L0.486463 0.446941 L0.487822 0.362999 L0.453859 0.302434 L0.384574 0.265245 L0.286761 0.257813",9:"M0.511026 0.437812 L0.491026 0.347812 L0.451026 0.297812 L0.391026 0.267812 L0.311026 0.257813 L0.231026 0.267812 L0.161026 0.297812 L0.111026 0.347812 L0.091026 0.417812 L0.111026 0.487812 L0.161026 0.537812 L0.231026 0.567812 L0.311026 0.577812 L0.391026 0.557812 L0.451026 0.517812 L0.491026 0.477812 L0.511026 0.437812 M0.510026 0.438812 L0.434026 0.636812 L0.381026 0.777812 L0.337026 0.879812 L0.301026 0.957812","!":"M0.301026 0.270996 L0.301026 0.749566 M0.251466 0.94897 L0.350587 0.94897",\'"\':"M0.16504 0.270996 L0.16504 0.523022 M0.437013 0.270996 L0.437013 0.523022","#":"M0.20958 0.282227 L0.146515 0.949754 M0.461844 0.282227 L0.398779 0.949754 M0.032999 0.526969 L0.600587 0.452796 M0.001465 0.82366 L0.569055 0.749486",$:"M0.307121 0.240234 L0.307121 1.083502 M0.490031 0.415915 L0.404676 0.328075 L0.23396 0.310507 L0.136407 0.398347 L0.099828 0.521324 L0.124213 0.591596 L0.197379 0.644299 L0.429061 0.697003 L0.502224 0.749708 L0.526613 0.837547 L0.477836 0.960526 L0.355897 1.013228 L0.197379 0.99566 L0.112021 0.942957 L0.07544 0.837547","\'":"M0.301026 0.270996 L0.301026 0.523022","(":"M0.413087 0.241211 L0.372337 0.28347 L0.331589 0.334184 L0.290838 0.393349 L0.25009 0.460965 L0.219528 0.528584 L0.199153 0.5962 L0.188966 0.655364 L0.199153 0.714529 L0.219528 0.782146 L0.25009 0.849764 L0.290838 0.91738 L0.331589 0.976544 L0.372337 1.027258 L0.413087 1.069491",")":"M0.188966 0.241211 L0.229716 0.28347 L0.270466 0.334184 L0.311213 0.393349 L0.351964 0.460965 L0.382526 0.528584 L0.4029 0.5962 L0.413087 0.655364 L0.4029 0.714529 L0.382526 0.782146 L0.351964 0.849764 L0.311213 0.91738 L0.270466 0.976544 L0.229716 1.027258 L0.188966 1.069491","*":"M0.301026 0.458702 L0.301026 0.681942 M0.301026 0.458702 L0.520997 0.536834 M0.301026 0.458702 L0.439954 0.257813 M0.301026 0.458702 L0.162098 0.257813 M0.301026 0.458702 L0.081055 0.536834","+":"M0.042969 0.66845 L0.559083 0.66845 M0.301023 0.428223 L0.301023 0.908661",",":"M0.38672 0.852051 L0.215333 1.030661 L0.301025 1.119971","-":"M0.173829 0.686035 L0.428224 0.686035",".":"M0.362549 0.851074 L0.239503 0.851074","/":"M0.062501 1.035249 L0.539551 0.270996","<":"M0.559083 0.441895 L0.042969 0.66939 L0.042969 0.66939 L0.559083 0.896902","=":"M0.042969 0.545898 L0.559083 0.545898 M0.042969 0.80837 L0.559083 0.80837",">":"M0.042969 0.441895 L0.559083 0.66939 L0.559083 0.66939 L0.042969 0.896902",A:"M0.018067 0.94897 L0.290179 0.270996 L0.583986 0.94897 M0.155303 0.684521 L0.433548 0.684521",B:"M0.063965 0.94897 L0.063965 0.278953 L0.209356 0.270996 L0.342486 0.294394 L0.432179 0.37292 L0.418224 0.48773 L0.312686 0.549166 L0.084728 0.575531 L0.306377 0.589434 L0.468877 0.647456 L0.538087 0.736658 L0.5324 0.85202 L0.501247 0.902983 L0.42355 0.944398 L0.063965 0.94897",C:"M0.529054 0.419847 L0.498425 0.345196 L0.442238 0.292341 L0.33583 0.257813 L0.257199 0.268357 L0.187906 0.303748 L0.120243 0.385432 L0.072998 0.599844 L0.110073 0.815385 L0.165381 0.902183 L0.222883 0.942801 L0.334904 0.961214 L0.43253 0.937679 L0.504816 0.868999 L0.529054 0.772065",D:"M0.064454 0.94897 L0.071838 0.285078 L0.171217 0.270996 L0.247348 0.272633 L0.37101 0.306078 L0.462461 0.378304 L0.514748 0.475555 L0.535591 0.576392 L0.537599 0.652313 L0.528065 0.717381 L0.508562 0.772419 L0.445948 0.855695 L0.362356 0.90871 L0.225203 0.945862 L0.064454 0.94897",E:"M0.080078 0.270996 L0.080078 0.94897 M0.080078 0.270996 L0.521974 0.270996 M0.080078 0.609981 L0.389405 0.609981 M0.080078 0.94897 L0.521974 0.94897",F:"M0.086426 0.270996 L0.086426 0.94897 M0.091304 0.275607 L0.515626 0.275607 M0.091304 0.607677 L0.447344 0.607677",G:"M0.498034 0.284943 L0.374621 0.257813 L0.244219 0.268648 L0.160577 0.311997 L0.094556 0.398116 L0.056397 0.58404 L0.076752 0.785532 L0.120865 0.858197 L0.188947 0.916734 L0.271008 0.953591 L0.357069 0.961214 L0.43715 0.932047 L0.501262 0.858539 L0.545656 0.648611 L0.329595 0.648131",H:"M0.066895 0.270996 L0.066895 0.94897 M0.066895 0.595658 L0.530009 0.595658 M0.535157 0.270996 L0.535157 0.94897",I:"M0.301026 0.270996 L0.301026 0.94897",J:"M0.506839 0.270996 L0.507814 0.782193 L0.498468 0.846168 L0.480733 0.880789 L0.455864 0.90832 L0.426095 0.929408 L0.360746 0.954812 L0.302508 0.962139 L0.223573 0.953638 L0.16538 0.930312 L0.137072 0.907715 L0.116428 0.880312 L0.102822 0.848819 L0.095633 0.813947 L0.094239 0.776413",K:"M0.035401 0.270996 L0.035401 0.94897 M0.502258 0.316194 L0.035401 0.687823 M0.212484 0.582361 L0.566652 0.933903",L:"M0.07544 0.270996 L0.07544 0.94897 L0.526613 0.94897",M:"M0.042481 0.94897 L0.042481 0.270996 L0.301027 0.712492 L0.559571 0.270996 L0.559571 0.94897",N:"M0.067871 0.94897 L0.067871 0.270996 L0.534181 0.94897 L0.525031 0.270996",O:"M0.287293 0.961214 L0.19843 0.933567 L0.1172 0.849451 L0.057129 0.563945 L0.114348 0.350255 L0.18455 0.289392 L0.306101 0.257813 L0.42054 0.29572 L0.487543 0.365003 L0.544923 0.625294 L0.516366 0.789624 L0.465476 0.884596 L0.375084 0.949287 L0.287293 0.961214",P:"M0.070557 0.94897 L0.070557 0.28379 L0.20704 0.270996 L0.329134 0.278993 L0.408525 0.300514 L0.444022 0.317908 L0.500637 0.368929 L0.525796 0.423728 L0.531496 0.50384 L0.508934 0.554205 L0.473724 0.582043 L0.417577 0.604365 L0.336375 0.620372 L0.226014 0.629268 L0.082368 0.630258",Q:"M0.282435 1.050813 L0.195447 1.019646 L0.115933 0.924817 L0.057129 0.602943 L0.113139 0.362034 L0.18186 0.293418 L0.300844 0.257813 L0.412868 0.300553 L0.478457 0.37866 L0.534625 0.672103 L0.506671 0.857367 L0.456855 0.964437 L0.368371 1.037368 L0.282435 1.050813 M0.341225 0.815559 L0.544923 1.070653",R:"M0.034912 0.944112 L0.034912 0.288556 L0.227127 0.270996 L0.362038 0.276867 L0.443423 0.294907 L0.477644 0.309614 L0.505809 0.328757 L0.526616 0.352817 L0.544963 0.418061 L0.543241 0.475921 L0.524463 0.517817 L0.49076 0.546518 L0.444265 0.564799 L0.355195 0.578739 L0.047653 0.589627 M0.303054 0.617306 L0.56714 0.94897",S:"M0.483037 0.364333 L0.407613 0.267477 L0.22883 0.257813 L0.128623 0.327565 L0.087712 0.455539 L0.104656 0.518727 L0.168054 0.573307 L0.41928 0.617318 L0.503796 0.669342 L0.535157 0.759324 L0.493846 0.900055 L0.367668 0.961214 L0.205436 0.956661 L0.116711 0.907038 L0.066895 0.790334",T:"M0.022949 0.270996 L0.579103 0.270996 M0.309284 0.270996 L0.309284 0.94897",U:"M0.072022 0.270996 L0.07308 0.648875 L0.080372 0.75167 L0.099024 0.827813 L0.134786 0.885729 L0.181571 0.924023 L0.251464 0.95168 L0.339655 0.962139 L0.401553 0.951668 L0.45232 0.924086 L0.482701 0.891771 L0.495745 0.870529 L0.515699 0.81637 L0.525014 0.744626 L0.530031 0.272017",V:"M0.027832 0.270996 L0.320083 0.94897 L0.57422 0.270996",W:"M0 0.270996 L0.079799 0.940377 L0.285198 0.472884 L0.505255 0.94897 L0.602052 0.270996",X:"M0.009034 0.270996 L0.586805 0.94897 M0.593019 0.270996 L0.015246 0.94897",Y:"M0.018067 0.270996 L0.293132 0.574135 M0.583986 0.271959 L0.294954 0.57606 L0.305277 0.94897",Z:"M0.053711 0.270996 L0.548341 0.270996 L0.053711 0.94897 L0.548341 0.94897","[":"M0.404542 0.240234 L0.197511 0.240234 L0.197511 1.069424 L0.404542 1.069424","\\\\":"M0.062501 0.270996 L0.539551 1.035249","]":"M0.19751 0.240234 L0.404542 0.240234 L0.404542 1.069424 L0.19751 1.069424","^":"M0.035156 0.523931 L0.301024 0.270996 L0.566896 0.523931",_:"M0 1.160601 L0.602052 1.160601",a:"M0.527101 0.439941 L0.527101 0.973965 M0.527101 0.553824 L0.451366 0.477535 L0.376759 0.439941 L0.263722 0.439941 L0.187989 0.477535 L0.112255 0.553824 L0.074951 0.66881 L0.074951 0.745099 L0.112255 0.85898 L0.187989 0.93527 L0.263722 0.973965 L0.376759 0.973965 L0.451366 0.93527 L0.527101 0.85898",b:"M0.07666 0.240234 L0.07666 0.959985 M0.07666 0.582737 L0.151822 0.514237 L0.225865 0.480483 L0.338045 0.480483 L0.413211 0.514237 L0.488374 0.582737 L0.525392 0.685983 L0.525392 0.754485 L0.488374 0.856739 L0.413211 0.92524 L0.338045 0.959985 L0.225865 0.959985 L0.151822 0.92524 L0.07666 0.856739",c:"M0.512452 0.553823 L0.441624 0.477535 L0.371854 0.439941 L0.26614 0.439941 L0.195312 0.477535 L0.124486 0.553823 L0.0896 0.668808 L0.0896 0.745099 L0.124486 0.858979 L0.195312 0.93527 L0.26614 0.973965 L0.371854 0.973965 L0.441624 0.93527 L0.512452 0.858979",d:"M0.525392 0.240234 L0.525392 0.959985 M0.525392 0.582737 L0.450232 0.514237 L0.376189 0.480483 L0.264006 0.480483 L0.188844 0.514237 L0.11368 0.582737 L0.076661 0.685983 L0.076661 0.754485 L0.11368 0.856739 L0.188844 0.92524 L0.264006 0.959985 L0.376189 0.959985 L0.450232 0.92524 L0.525392 0.856739",e:"M0.059571 0.668808 L0.542482 0.668808 M0.542482 0.592521 L0.502641 0.516231 L0.461594 0.477535 L0.381914 0.439941 L0.261186 0.439941 L0.180299 0.477535 L0.099412 0.553823 L0.059571 0.668808 L0.059571 0.745099 L0.099412 0.858979 L0.180299 0.93527 L0.261186 0.973965 L0.381914 0.973965 L0.461594 0.93527 L0.542482 0.858979",f:"M0.512941 0.240234 L0.406984 0.240234 L0.301026 0.274346 L0.248047 0.374731 L0.248047 0.946817 M0.089112 0.476088 L0.459965 0.476088",g:"M0.525392 0.439941 L0.525392 0.989395 L0.488373 1.091918 L0.45023 1.126757 L0.376189 1.160601 L0.264004 1.160601 L0.188844 1.126757 L0.113681 1.058075 L0.076661 0.954555 M0.525392 0.542467 L0.45023 0.473786 L0.376189 0.439941 L0.264004 0.439941 L0.188844 0.473786 L0.113681 0.542467 L0.076661 0.645988 L0.076661 0.714669 L0.113681 0.817193 L0.188844 0.885875 L0.264004 0.920713 L0.376189 0.920713 L0.45023 0.885875 L0.525392 0.817193",h:"M0.092041 0.240234 L0.092041 0.946817 M0.092041 0.61058 L0.205937 0.509225 L0.282214 0.476086 L0.396109 0.476086 L0.47187 0.509225 L0.510011 0.61058 L0.510011 0.946817",i:"M0.261026 0.240234 L0.341026 0.240234 M0.300978 0.476089 L0.300978 0.946817",j:"M0.3853 0.240234 L0.447023 0.240234 M0.416159 0.465708 L0.416159 1.011689 L0.383887 1.108586 L0.252832 1.140264 L0.15503 1.108586",k:"M0.065186 0.240234 L0.065186 0.946817 M0.493824 0.476086 L0.065186 0.812323 M0.236758 0.677829 L0.536867 0.946817",l:"M0.301026 0.234863 L0.301026 0.946441",m:"M0.050538 0.439941 L0.050538 0.960796 M0.050538 0.588758 L0.114405 0.476607 L0.157178 0.439941 L0.236864 0.439941 L0.279637 0.476607 L0.32241 0.588758 L0.32241 0.960796 M0.32241 0.588758 L0.386281 0.476607 L0.428467 0.439941 L0.50874 0.439941 L0.551515 0.476607 L0.551515 0.960796",n:"M0.092041 0.439941 L0.092041 0.960796 M0.092041 0.588758 L0.205936 0.476607 L0.282216 0.439941 L0.396113 0.439941 L0.471871 0.476607 L0.510011 0.588758 L0.510011 0.960796",o:"M0.247175 0.439941 L0.175178 0.477535 L0.103186 0.553823 L0.066895 0.668808 L0.066895 0.745099 L0.103186 0.858979 L0.175178 0.93527 L0.247175 0.973965 L0.354874 0.973965 L0.426872 0.93527 L0.498866 0.858979 L0.535157 0.745099 L0.535157 0.668808 L0.498866 0.553823 L0.426872 0.477535 L0.354874 0.439941 L0.247175 0.439941",p:"M0.076904 0.439941 L0.076904 1.154244 M0.076904 0.541563 L0.151986 0.473487 L0.225944 0.439941 L0.338005 0.439941 L0.413087 0.473487 L0.488166 0.541563 L0.525148 0.644169 L0.525148 0.712246 L0.488166 0.813866 L0.413087 0.881942 L0.338005 0.916471 L0.225944 0.916471 L0.151986 0.881942 L0.076904 0.813866",q:"M0.525148 0.441895 L0.525148 1.156195 M0.525148 0.5435 L0.450067 0.47544 L0.376106 0.441895 L0.264042 0.441895 L0.188966 0.47544 L0.113885 0.5435 L0.076905 0.646108 L0.076905 0.714187 L0.113885 0.815809 L0.188966 0.883886 L0.264042 0.918418 L0.376106 0.918418 L0.450067 0.883886 L0.525148 0.815809",r:"M0.107422 0.439941 L0.107422 0.960796 M0.107422 0.663164 L0.155824 0.551014 L0.252626 0.476607 L0.349428 0.439941 L0.49463 0.439941",s:"M0.475556 0.477535 L0.400757 0.439941 L0.276092 0.439941 L0.176361 0.477535 L0.101563 0.553823 L0.101563 0.630112 L0.176361 0.668808 L0.301024 0.668808 L0.425688 0.745099 L0.50049 0.821387 L0.50049 0.897677 L0.425688 0.93527 L0.325956 0.973965 L0.201295 0.973965 L0.126496 0.93527 L0.101563 0.858979",t:"M0.246032 0.297852 L0.246032 0.826549 L0.301023 0.919323 L0.411011 0.950848 L0.520997 0.950848 M0.081055 0.515799 L0.466004 0.515799",u:"M0.092041 0.454102 L0.092041 0.826134 L0.13018 0.937211 L0.205936 0.974954 L0.319832 0.974954 L0.396113 0.937211 L0.510011 0.826134 M0.510011 0.454102 L0.510011 0.974954",v:"M0.048828 0.453125 L0.301026 0.961719 M0.553224 0.453125 L0.301026 0.961719",w:"M0 0.453125 L0.150512 0.961719 M0.301024 0.453125 L0.150512 0.961719 M0.301024 0.453125 L0.451539 0.961719 M0.602052 0.453125 L0.451539 0.961719",x:"M0.03711 0.453125 L0.564943 0.961719 M0.564943 0.453125 L0.03711 0.961719",y:"M0.084618 0.453125 L0.320232 0.921476 M0.55713 0.453125 L0.320232 0.921476 L0.242119 1.055289 L0.163369 1.122196 L0.084618 1.155166 L0.044922 1.155166",z:"M0.505373 0.452148 L0.09668 0.961651 M0.09668 0.452148 L0.505373 0.452148 M0.09668 0.961651 L0.505373 0.961651"},m5={};for(let y in d5){m5[y]=[];let x=d5[y].split("M").slice(1).map(e=>e.split("L").map(r=>r.trim().split(" ").map(parseFloat)));for(let e of x)for(let r=0;r<e.length-1;r++)m5[y].push({x1:e[r][0],y1:1-e[r][1],x2:e[r+1][0],y2:1-e[r+1][1]})}var P4=.09,I4=.692052,R4=.692052,k4=1.152,A4=0;var _5={0:.692052,1:.692052,2:.692052,3:.692052,4:.692052,5:.692052,6:.692052,7:.692052,8:.692052,9:.692052,"!":.692052,\'"\':.692052,"#":.692052,$:.692052,"\'":.692052,"(":.692052,")":.692052,"*":.692052,"+":.692052,",":.692052,"-":.692052,".":.692052,"/":.692052,"<":.692052,"=":.692052,">":.692052,A:.692052,B:.692052,C:.692052,D:.692052,E:.692052,F:.692052,G:.692052,H:.692052,I:.692052,J:.692052,K:.692052,L:.692052,M:.692052,N:.692052,O:.692052,P:.692052,Q:.692052,R:.692052,S:.692052,T:.692052,U:.692052,V:.692052,W:.692052,X:.692052,Y:.692052,Z:.692052,"[":.692052,"\\\\":.692052,"]":.692052,"^":.692052,_:.692052,a:.692052,b:.692052,c:.692052,d:.692052,e:.692052,f:.692052,g:.692052,h:.692052,i:.692052,j:.692052,k:.692052,l:.692052,m:.692052,n:.692052,o:.692052,p:.692052,q:.692052,r:.692052,s:.692052,t:.692052,u:.692052,v:.692052,w:.692052,x:.692052,y:.692052,z:.692052," ":.692052},v5={},c0={glyphWidthRatio:I4,spaceWidthRatio:R4,lineHeightRatio:k4,strokeWidthRatio:P4,letterSpacingRatio:A4};var T4={0:[[{x:.019944796633211075,y:.35828068632415006},{x:.020222641007547733,y:.3550960892473839},{x:.020327535068617307,y:.3519011161217302},{x:.02060526835904108,y:.3507104904820116},{x:.02071153113201321,y:.34949252766745387},{x:.047065531132013214,y:.20882352766745393},{x:.047989939967683706,y:.20564918300405605},{x:.04875673163473768,y:.20243312543665407},{x:.04922094308839032,y:.20142201853303832},{x:.04953201774467938,y:.20035381349539033},{x:.05105794824635218,y:.1974208061920286},{x:.05243742793298141,y:.1944161379022362},{x:.1205174279329814,y:.07784313790223615},{x:.1216536619223176,y:.07627409360623287},{x:.12261018498510404,y:.07458945972562232},{x:.1242345189777056,y:.07271014544101197},{x:.12569143736362237,y:.07069826276137084},{x:.12711194429242206,y:.06938103546641537},{x:.12837874379901673,y:.06791537974577894},{x:.130338502698373,y:.06638906779986004},{x:.132159925645859,y:.06470007355882942},{x:.13381011622947792,y:.06368528357115737},{x:.13533850978527173,y:.062494930337889824},{x:.2330665097852717,y:.000743930337889824},{x:.2364974226485404,y:-.000978818921256936},{x:.23988324554357096,y:-.0027885789630079164},{x:.24043487144166406,y:-.0029559128497863825},{x:.24095002304009888,y:-.0032145836671228292},{x:.2446511035824589,y:-.0042348928870151745},{x:.24832493550927423,y:-.005349337618145378},{x:.24889860729226898,y:-.005405839357118937},{x:.2494543245702404,y:-.005559038796006631},{x:.2532833423420387,y:-.0058376980655201055},{x:.257104,y:-.006214000000000011},{x:.344948,y:-.006214000000000011},{x:.34876845169289644,y:-.005837718351308385},{x:.352597265623821,y:-.005559109487024962},{x:.35315318526669126,y:-.00540585978827806},{x:.3537270644907258,y:-.005349337618145378},{x:.3574006983675983,y:-.004234952964808514},{x:.36110158881940224,y:-.0032147329490055873},{x:.36161692908913895,y:-.0029559733581057666},{x:.36216875445642904,y:-.0027885789630079164},{x:.36555439482758706,y:-.000978916482299381},{x:.3689851386556908,y:.0007437082019616584},{x:.4667151386556908,y:.06249470820196166},{x:.46824382031514195,y:.0636852631221029},{x:.4698943035897058,y:.06470024765114774},{x:.4717154585013725,y:.06638901501054441},{x:.47367495473362387,y:.0679150932923645},{x:.4749419974608878,y:.0693810030307532},{x:.47636275350351887,y:.0706984782301942},{x:.4778194532662604,y:.07271008609647399},{x:.47944357522443626,y:.07458911996296573},{x:.4804002872780698,y:.07627405043044727},{x:.48153671723081914,y:.07784338646721853},{x:.5496157172308191,y:.19441638646721857},{x:.5509951179002539,y:.19742093333312605},{x:.5525209822553206,y:.20035381349539033},{x:.5528320971760705,y:.20142215679791795},{x:.5532963622471587,y:.2024333975455826},{x:.5540631001039363,y:.20564932060673602},{x:.5549874688679868,y:.20882352766745393},{x:.5813414688679868,y:.34949252766745387},{x:.5814477200321959,y:.3507103574246747},{x:.581725430046729,y:.351900851345405},{x:.5818303474337426,y:.35509595676374855},{x:.5821082033667889,y:.35828068632415006},{x:.5819748261451739,y:.3594958443979094},{x:.5820149461972951,y:.36071764184793353},{x:.5710349461972951,y:.5284976418479336},{x:.5705756858728281,y:.5312810757499365},{x:.5703149436633981,y:.5340900680661724},{x:.5698592272920282,y:.5356233082419208},{x:.5695988288779222,y:.5372015019922555},{x:.5686053720955593,y:.5398418557477263},{x:.5678016327590553,y:.5425460057826548},{x:.5216826327590552,y:.6556800057826547},{x:.5211943471023096,y:.656605995281004},{x:.5208498728309648,y:.6575945381025444},{x:.5191405880551111,y:.6605007631972294},{x:.5175679428069421,y:.6634831423933323},{x:.5169083878327574,y:.664296079457111},{x:.5163776774005638,y:.665198424109003},{x:.5141342596628157,y:.6677153419860701},{x:.5120099990343735,y:.6703336077343061},{x:.511204521070525,y:.6710022516480534},{x:.510507969381766,y:.6717837215313657},{x:.425955969381766,y:.7497057215313657},{x:.4243831978740034,y:.750892537075826},{x:.42294870744900304,y:.7522432326643229},{x:.4208707687817478,y:.7535430209032156},{x:.4189143183619635,y:.7550193610827685},{x:.4171402309909699,y:.7558765397994217},{x:.4154697962599445,y:.7569214269519826},{x:.41317820849544135,y:.7577908544006052},{x:.41097133104084405,y:.7588571425751742},{x:.40906410498936707,y:.7593517435666508},{x:.4072219198222394,y:.7600506678559823},{x:.3127869198222394,y:.7856226678559822},{x:.3097655669518694,y:.7861297177594856},{x:.3067801557646532,y:.7868174624905968},{x:.3054245519856559,y:.7868582361795984},{x:.30408703940192616,y:.7870827004032797},{x:.3010248204508113,y:.7869905707806608},{x:.2979626007613803,y:.7870826758597451},{x:.29662508997676323,y:.7868582009159747},{x:.29526948652460844,y:.786817416361878},{x:.2922840808497275,y:.7861296477028675},{x:.28926273204343433,y:.7856225735833884},{x:.19483073204343437,y:.7600505735833885},{x:.19298859701529922,y:.7593516514268194},{x:.1910814199885863,y:.7588570511522524},{x:.1888745059729717,y:.757790729268721},{x:.18658288068670334,y:.7569212665731724},{x:.18491249471518256,y:.7558763912940257},{x:.18313845528709377,y:.7550192228447639},{x:.18118197558509466,y:.7535428424712565},{x:.17910400699337814,y:.7522430123425641},{x:.17766956207459372,y:.7508923379118444},{x:.17609683558545802,y:.7497055417906873},{x:.09154583558545802,y:.6717835417906872},{x:.09084937681091164,y:.6710021668773223},{x:.09004400096562647,y:.6703336077343061},{x:.087919657143162,y:.6677152394449524},{x:.08567616637982708,y:.6651982097729843},{x:.0851455285488078,y:.6642959763928821},{x:.08448605719305789,y:.6634831423933323},{x:.08291335035419628,y:.6605006463960624},{x:.08120401576602496,y:.6575942974079984},{x:.08085959099279398,y:.6566058778839782},{x:.08037136724094471,y:.6556800057826547},{x:.03425236724094472,y:.5425460057826548},{x:.03344866581310472,y:.5398419832899659},{x:.03245524021837327,y:.537201759963462},{x:.0321948107181119,y:.5356234361255728},{x:.03173905633660196,y:.5340900680661724},{x:.03147832642517492,y:.5312812082371015},{x:.031019071243648687,y:.5284979083423142},{x:.020038071243648682,y:.36071790834231426},{x:.020078188427320915,y:.3594959771633442},{x:.019944796633211075,y:.35828068632415006}],[{x:.11021604810185967,y:.3604951889884744},{x:.12035004420691338,y:.5153337161267963},{x:.1599220965290545,y:.612407472440097},{x:.22898846858521874,y:.6760588762479813},{x:.301025186831377,y:.6955662779655215},{x:.373064807645506,y:.6760587099720985},{x:.44213195602343713,y:.6124073435241713},{x:.48170390405887986,y:.5153338430353971},{x:.49183697687726113,y:.3604953223188204},{x:.4679633532090146,y:.23306575687188358},{x:.4093572783633461,y:.13271343144136735},{x:.3319224534250481,y:.08378599999999999},{x:.27012977192577264,y:.08378599999999999},{x:.19269670382412518,y:.13271332265415062},{x:.13408961949133952,y:.23306590258843124},{x:.11021604810185967,y:.3604951889884744}]],1:[[{x:.17556757075794932,y:.5951166967821685},{x:.17573368487361973,y:.586296718297643},{x:.17761729959585784,y:.5776786204828649},{x:.18114602866723137,y:.5695935920037709},{x:.1861842650084615,y:.5623523359706766},{x:.19253839202243023,y:.5562331297919906},{x:.19996422417142623,y:.5514711311294693},{x:.20817639089041826,y:.548249340921154},{x:.21685930321783156,y:.5466915707579493},{x:.225679281702357,y:.5468576848736197},{x:.2342973795171352,y:.5487412995958578},{x:.24238240799622912,y:.5522700286672314},{x:.24962366402932343,y:.5573082650084615},{x:.33662600000000004,y:.6314944876419193},{x:.33662600000000004,y:.051034000000000024},{x:.33749066238185466,y:.042254935509274234},{x:.3400514210369921,y:.033813245543570986},{x:.3442098674463855,y:.026033339514117928},{x:.34980619484660536,y:.019214194846605387},{x:.35662533951411796,y:.013617867446385483},{x:.364405245543571,y:.00945942103699212},{x:.3728469355092743,y:.006898662381854659},{x:.381626,y:.0060340000000000255},{x:.3904050644907258,y:.006898662381854659},{x:.3988467544564291,y:.00945942103699212},{x:.40662666048588214,y:.01361786744638549},{x:.4134458051533947,y:.019214194846605387},{x:.41904213255361455,y:.026033339514117928},{x:.42320057896300795,y:.033813245543570986},{x:.4257613376181454,y:.042254935509274255},{x:.426626,y:.051034000000000024},{x:.426626,y:.729004},{x:.42636789988195944,y:.7316245344755278},{x:.4263183151263803,y:.7342572817023569},{x:.42593657376816557,y:.7360038620015019},{x:.4257613376181454,y:.7377830644907257},{x:.42499695590681574,y:.7403028932959718},{x:.4244347004041422,y:.7428753795171351},{x:.42371955318609683,y:.744513925721078},{x:.42320057896300795,y:.746224754456429},{x:.4219592904188853,y:.7485470419835442},{x:.42090597133276864,y:.7509604079962291},{x:.419884900961423,y:.7524279516932593},{x:.41904213255361455,y:.7540046604858821},{x:.41737163919932724,y:.7560401625275525},{x:.41586773499153856,y:.7582016640293234},{x:.4145799806286405,y:.7594418083381722},{x:.4134458051533947,y:.7608238051533946},{x:.41141030311172405,y:.7624942985076821},{x:.4095136079775698,y:.7643208702080094},{x:.40800865730110464,y:.7652859570783687},{x:.40662666048588214,y:.7664201325536145},{x:.40430437295876726,y:.767661421097737},{x:.4020877758285738,y:.7690828688705307},{x:.4004234632490515,y:.7697358105551997},{x:.3988467544564291,y:.7705785789630079},{x:.39632692565118355,y:.7713429606743374},{x:.3938756091095818,y:.772304659078846},{x:.39211589322607654,y:.7726203633950566},{x:.3904050644907258,y:.7731393376181454},{x:.3877845300151986,y:.7733974377361859},{x:.3851926967821685,y:.7738624292420507},{x:.38340520248922366,y:.7738287638499798},{x:.381626,y:.774004},{x:.37900546552447173,y:.7737458998819594},{x:.376372718297643,y:.7736963151263803},{x:.37462613799849803,y:.7733145737681656},{x:.3728469355092743,y:.7731393376181454},{x:.3703271067040287,y:.7723749559068158},{x:.36775462048286484,y:.7718127004041422},{x:.3661160742789217,y:.7710975531860966},{x:.364405245543571,y:.7705785789630079},{x:.3620829580164563,y:.7693372904188854},{x:.3596695920037709,y:.7682839713327686},{x:.35820204830674063,y:.7672629009614229},{x:.35662533951411796,y:.7664201325536145},{x:.3545898374724472,y:.7647496391993269},{x:.35242833597067663,y:.7632457349915385},{x:.1912283359706766,y:.6257917349915385},{x:.18510912979199054,y:.6194376079775697},{x:.18034713112946932,y:.6120117758285738},{x:.17712534092115398,y:.6037996091095817},{x:.17556757075794932,y:.5951166967821685}]],2:[[{x:.034589999999999996,y:.05195499999999997},{x:.034692251306008066,y:.05091682506774448},{x:.03463809526377374,y:.04987503351343359},{x:.03512383076438082,y:.04653492529109402},{x:.03545466238185463,y:.043175935509274184},{x:.03575748683953214,y:.042177657057450094},{x:.03590761484026801,y:.04114531791601493},{x:.0370356398580977,y:.03796415123181852},{x:.03801542103699209,y:.034734245543570935},{x:.03850718127225641,y:.0338142268532408},{x:.03885582398108696,y:.03283101233894428},{x:.040582789147307716,y:.02993103764454602},{x:.04217386744638545,y:.02695433951411788},{x:.04283566538917773,y:.026147936387598623},{x:.04336942466232366,y:.025251630882832152},{x:.04562896367409083,y:.022744292579413156},{x:.04777019484660536,y:.020135194846605337},{x:.04857659797312457,y:.019473396903813094},{x:.04927496174105457,y:.01869844492647086},{x:.0519802417813102,y:.01668009861889986},{x:.05458933951411791,y:.014538867446385433},{x:.055509358204447995,y:.01404710721112114},{x:.05634548873920743,y:.013423289731094336},{x:.05939254741314285,y:.011971499336069797},{x:.062369245543570956,y:.01038042103699207},{x:.0633675239953951,y:.010077596579314544},{x:.06430928926944049,y:.00962888655251979},{x:.06758102982102647,y:.008799443560749052},{x:.07081093550927423,y:.007819662381854608},{x:.0718491104415297,y:.007717411075846537},{x:.07286031894352762,y:.007461052176974015},{x:.07623101021818018,y:.0072858316174737835},{x:.07959,y:.006954999999999975},{x:.522462,y:.006954999999999975},{x:.5312410644907257,y:.007819662381854608},{x:.539682754456429,y:.01038042103699207},{x:.5474626604858821,y:.014538867446385433},{x:.5542818051533946,y:.020135194846605337},{x:.5598781325536145,y:.02695433951411788},{x:.5640365789630079,y:.034734245543570935},{x:.5665973376181453,y:.043175935509274205},{x:.567462,y:.05195499999999997},{x:.5665973376181453,y:.06073406449072574},{x:.5640365789630079,y:.06917575445642901},{x:.5598781325536145,y:.07695566048588207},{x:.5542818051533946,y:.08377480515339461},{x:.5474626604858821,y:.08937113255361451},{x:.539682754456429,y:.09352957896300787},{x:.5312410644907257,y:.09609033761814534},{x:.522462,y:.09695499999999997},{x:.1815000359059797,y:.09695499999999997},{x:.2783905550735291,y:.2032469617410546},{x:.2792807818102756,y:.20444017254595384},{x:.28031851181367967,y:.20550758629318672},{x:.43775551181367967,y:.4029575862931866},{x:.4393581707982963,y:.4054309283363016},{x:.4411189018513206,y:.4077943501865292},{x:.5036359018513206,y:.5115903501865292},{x:.5044316302389797,y:.5132634494776924},{x:.5054127007337849,y:.5148350555317778},{x:.5063216043693862,y:.5172373109446714},{x:.5074247535047713,y:.5195567934026113},{x:.5078787867151084,y:.5213529834674229},{x:.5085344010842773,y:.5230857889106145},{x:.5229384010842772,y:.5764717889106146},{x:.5230947969602031,y:.5774089507908463},{x:.5233933154704733,y:.5783109589719573},{x:.5238196553887738,y:.5817524776504878},{x:.5243904806061233,y:.5851730002877248},{x:.5243610401661515,y:.586122666187007},{x:.5244778496604383,y:.5870655806061408},{x:.5252778496604383,y:.6189585806061408},{x:.525154398698275,y:.6206444560860672},{x:.5252359209411441,y:.6223328785443973},{x:.5248330095087286,y:.6250334227224941},{x:.5246336028763079,y:.6277565667648055},{x:.5241836259995084,y:.6293859645321488},{x:.5239341869342451,y:.6310578486269935},{x:.5118811869342451,y:.6790048486269935},{x:.5115474759395316,y:.6799350391147754},{x:.5113589931552627,y:.6809051378786065},{x:.5100605296725933,y:.6840797730170447},{x:.5089023081582834,y:.6873082151493771},{x:.5083935381649621,y:.6881554285023456},{x:.5080194201443183,y:.6890701159233712},{x:.5061265656819337,y:.6919304336788418},{x:.5043607612540449,y:.6948708843926746},{x:.5036964840076373,y:.6956025626767983},{x:.5031511078963445,y:.6964266878303904},{x:.4695951078963445,y:.7376876878303904},{x:.46829294792790443,y:.7390014838193654},{x:.46714904955699066,y:.7404551608815331},{x:.46519525859727806,y:.7421268539092958},{x:.4633851429208498,y:.7439531446668906},{x:.4618516947085211,y:.7449876576267703},{x:.4604461776978856,y:.7461902391902692},{x:.4582037971525157,y:.7474486453977692},{x:.45607217068925404,y:.7488867084403534},{x:.4543663637878686,y:.7496021826182516},{x:.45275324136800726,y:.7505074541480116},{x:.3913892413680073,y:.7774134541480116},{x:.3883140702117422,y:.7784156528007931},{x:.3852957573995619,y:.7795779210778271},{x:.3841283231887951,y:.779779788263216},{x:.3830018757962646,y:.7801468976050565},{x:.3797902739335826,y:.7805299031606142},{x:.3766032098633093,y:.781080995160135},{x:.2948022098633093,y:.7870669951601349},{x:.29450281220893076,y:.7870594704966325},{x:.2942070489499988,y:.7871065838776864},{x:.29009611613079095,y:.7869487184427649},{x:.2859834519838158,y:.7868453561974301},{x:.28569127516043946,y:.7867795665334233},{x:.28539200354491423,y:.7867680740946454},{x:.2381110035449142,y:.7802710740946455},{x:.2365476307297285,y:.7798972084805876},{x:.2349498387179436,y:.7797212234138579},{x:.23226739693423346,y:.7788736316211718},{x:.2295313767481002,y:.7782193386355017},{x:.22807098126622102,y:.7775476578384392},{x:.22653822336325463,y:.7770633405173258},{x:.15287222336325462,y:.7455503405173259},{x:.15277120515837472,y:.7454948388638573},{x:.15266147866932564,y:.7454595513468599},{x:.14890641990559073,y:.7433714396994592},{x:.14514076206912752,y:.7413025033471496},{x:.1450525127361761,y:.7412283604682699},{x:.14495177886390068,y:.7411723444149347},{x:.14167624287507044,y:.7383917796239132},{x:.1383865705572421,y:.7356279539035645},{x:.138314481468594,y:.7355380190685297},{x:.13822661135931125,y:.7354634271443719},{x:.09327661135931127,y:.6889934271443718},{x:.09215967204365061,y:.6875853345117547},{x:.09088652507606766,y:.6863167230283468},{x:.0894249598835053,y:.6841377631074377},{x:.0877944205712414,y:.6820821900242812},{x:.08697364817646357,y:.6804832494460014},{x:.08597245819367963,y:.6789906353246448},{x:.0849640705590952,y:.6765684062835642},{x:.08376588401722862,y:.6742342280213215},{x:.08327282036617045,y:.6725058858871059},{x:.08258206253775009,y:.6708466294514168},{x:.06737006253775008,y:.6210196294514168},{x:.06563362911198059,y:.61237067498716},{x:.06561788807912042,y:.6035491464015462},{x:.0673234443582347,y:.5948940500909503},{x:.07068475437800403,y:.5867379965527546},{x:.07557264487941309,y:.5793944183504645},{x:.08179927697165325,y:.5731455250760676},{x:.08912536467535526,y:.5682314581936796},{x:.09726937054858317,y:.56484106253775},{x:.10591832501283995,y:.5631046291119806},{x:.11473985359845373,y:.5630888880791204},{x:.12339494990904962,y:.5647944443582347},{x:.13155100344724535,y:.568155754378004},{x:.13889458164953555,y:.5730436448794131},{x:.14514347492393234,y:.5792702769716532},{x:.15005754180632036,y:.5865963646753553},{x:.1534479374622499,y:.5947403705485832},{x:.16549687462406137,y:.6342067386764809},{x:.19660916323298405,y:.666371100226128},{x:.2563653288901179,y:.6919337213587163},{x:.29295461470925055,y:.696961546277117},{x:.3623268316838737,y:.6918850546595318},{x:.40664087103378327,y:.672454875030618},{x:.4270299373286165,y:.6473841495451277},{x:.4351521014718352,y:.6150740687208592},{x:.4346413299816387,y:.5947115247998124},{x:.4232850296720603,y:.5526213103922067},{x:.3655461500158852,y:.45675834907300783},{x:.21087613207581168,y:.2627785664153893},{x:.04633344492647088,y:.0822700382589454},{x:.04431509861889995,y:.07956475821868986},{x:.04217386744638545,y:.07695566048588207},{x:.04168210721112112,y:.0760356417955519},{x:.04105828973109435,y:.07519951126079251},{x:.03960649933606985,y:.07215245258685718},{x:.03801542103699209,y:.06917575445642901},{x:.037712596579314576,y:.0681774760046049},{x:.037263886552519804,y:.06723571073055948},{x:.036434443560749034,y:.06396397017897336},{x:.03545466238185463,y:.06073406449072574},{x:.03535241107584656,y:.059695889558470286},{x:.035096052176974035,y:.05868468105647236},{x:.03492083161747381,y:.05531398978181981},{x:.034589999999999996,y:.05195499999999997}]],3:[[{x:.02624429558875499,y:.07454886751538828},{x:.02628189246403191,y:.06572740500388341},{x:.028039748887915363,y:.057082779207475086},{x:.03145031142385274,y:.04894719824755728},{x:.036382514066253493,y:.04163330793793327},{x:.042646815033581253,y:.035422176981524986},{x:.05000248075272204,y:.030552495657744837},{x:.05816683711519421,y:.027211403088916904},{x:.11448783711519421,y:.010388403088916982},{x:.11753114712885143,y:.009796523380387901},{x:.12053464064709668,y:.009027703431080128},{x:.20267064064709667,y:-.0035892965689199724},{x:.20562630159751,y:-.003749783589053152},{x:.20856537842676282,y:-.004101230781641964},{x:.30947437842676284,y:-.00620423078164193},{x:.31075400531193675,y:-.006105070212514369},{x:.31203499449415534,y:-.0061847225744922005},{x:.3151428517207607,y:-.005764970678224511},{x:.3182695531731509,y:-.005522677007230838},{x:.31950524711917533,y:-.005175778959545043},{x:.3207771618583987,y:-.005003992231664048},{x:.3829651618583987,y:.009716007768336019},{x:.3849642059743718,y:.010402067561162992},{x:.38702295869345676,y:.010879972006216251},{x:.389126076828856,y:.011830396347599064},{x:.3913090018652735,y:.012579562954916447},{x:.3931357912831918,y:.013642434461507345},{x:.39506175111398195,y:.014512798837572657},{x:.47719975111398194,y:.06182779883757265},{x:.47924722409526294,y:.06329195880211928},{x:.48141099047099317,y:.06457804786673271},{x:.4828265323572166,y:.06585154318044145},{x:.484375351035892,y:.06695911252196202},{x:.4860978389589892,y:.06879458122658251},{x:.48796912564078,y:.07047808832945178},{x:.54077112564078,y:.12830608832945176},{x:.5409949120745448,y:.12860551518367325},{x:.5412686389329152,y:.1288600940829806},{x:.5436334835107667,y:.13213593090859313},{x:.5460522072884215,y:.13537218987116906},{x:.5462132784472015,y:.1357095218897727},{x:.546432079841298,y:.13601261058785885},{x:.5481124005325159,y:.13968686141763526},{x:.5498532864078638,y:.14333280617235186},{x:.5499454524173568,y:.14369507987504085},{x:.5501009199323095,y:.14403503084321223},{x:.5735679199323094,y:.2123790308432122},{x:.5742003382158373,y:.21504899342087444},{x:.5750294951185407,y:.21766455299430504},{x:.5752146521018063,y:.21933125436759},{x:.575601167738761,y:.22096305773765262},{x:.575700550423256,y:.22370509641963415},{x:.5760035049491392,y:.22643215923642232},{x:.5758599468852712,y:.22810295774565637},{x:.5759206866877095,y:.2297788119316045},{x:.5754832145523405,y:.2324875517091097},{x:.575248324328873,y:.23522131827456078},{x:.563515324328873,y:.2983063182745607},{x:.5624930457986839,y:.30183400865706583},{x:.561587550163308,y:.3053934651440046},{x:.5612670272694029,y:.3060647673464004},{x:.5610599744254687,y:.30677926765590185},{x:.5593691204378909,y:.31003973780923805},{x:.5577866081350055,y:.3133541469027738},{x:.5573412794357957,y:.31395001930700017},{x:.5569988129587381,y:.31461039668740554},{x:.5547043620842722,y:.317478348572073},{x:.5525056481741942,y:.32042033938948294},{x:.4997036481741942,y:.378250339389483},{x:.4970091109540712,y:.38067456957783247},{x:.49440132723244246,y:.38319188697894757},{x:.4937347452782226,y:.3836204617554604},{x:.49314561461057166,y:.3841504927896343},{x:.49002990831948917,y:.38600246394071897},{x:.48698112816844114,y:.387962658427834},{x:.4171684643874312,y:.4237087345514058},{x:.48487098803351525,y:.4540412587201935},{x:.4882241875669253,y:.4559584413246188},{x:.4916233115558361,y:.4577929691542233},{x:.4920492459188098,y:.45814540790983926},{x:.4925291804180174,y:.45841980913886743},{x:.49544392539098053,y:.4609543303938907},{x:.49841983754054403,y:.46341674447922576},{x:.545354837540544,y:.5107317444792258},{x:.5454749496657809,y:.5108793107625336},{x:.5456205162109946,y:.5110018387655073},{x:.548258239278959,y:.5142987798858712},{x:.5509236260451226,y:.5175733969812307},{x:.5510126414958236,y:.5177415605329735},{x:.5511315069931322,y:.5178901328189077},{x:.5530753456471339,y:.5216383183828395},{x:.5550506716503533,y:.525370005791429},{x:.5551051696126684,y:.5255523041806199},{x:.555192766127671,y:.525721211199887},{x:.5563680197383496,y:.5297766005381628},{x:.5575773743081012,y:.5338219516056334},{x:.5575952604559016,y:.5340113792074108},{x:.557648221703651,y:.5341941299579837},{x:.569382221703651,y:.5972801299579837},{x:.5696549699390315,y:.6004540423597167},{x:.5701008412017201,y:.6036082951002054},{x:.5700318821169291,y:.6048400880993865},{x:.5701375119403227,y:.6060692795769916},{x:.5697858198023349,y:.6092354166829699},{x:.5696077595908724,y:.6124160465097288},{x:.5692998146426919,y:.6136107177017713},{x:.5691636114574624,y:.614836897966064},{x:.5682009942777376,y:.6178735869028962},{x:.5674058453461934,y:.6209583639953996},{x:.5668707486862845,y:.622070002836373},{x:.5664979467044567,y:.623246050467446},{x:.5649613973213707,y:.6260365929822823},{x:.5635797167972587,y:.6289069710868302},{x:.5283787167972587,y:.6867359710868302},{x:.526364685994031,y:.6894131274243959},{x:.524479650893362,y:.6921826271628648},{x:.5237177195860089,y:.6929316152663909},{x:.5230754099184859,y:.6937854072711274},{x:.5205777908604191,y:.6960182048823972},{x:.5181886735848373,y:.6983667373551676},{x:.4595186735848373,y:.7456807373551677},{x:.45627545779875317,y:.7478078267647688},{x:.4530837115337172,y:.7500113951823929},{x:.4525909707504246,y:.7502243275150239},{x:.4521421155924859,y:.7505187128152536},{x:.44854624273044896,y:.7519722107862162},{x:.4449859301027389,y:.7535107594479447},{x:.362848930102739,y:.7797967594479446},{x:.36158078031831586,y:.7800691142952486},{x:.3603625229719573,y:.7805143446587972},{x:.35727696699365546,y:.7809934249999153},{x:.35422405316989464,y:.781649085623381},{x:.352927136733123,y:.7816688034988555},{x:.3516454277250751,y:.7818678086678129},{x:.2577774277250751,y:.7871168086678129},{x:.2534831925795917,y:.7869349938938289},{x:.24918809681378723,y:.7867747925856998},{x:.2490774333618657,y:.786748457272228},{x:.24896378128970398,y:.7867436453266514},{x:.24478752897123962,y:.7857275603552258},{x:.2406062159909945,y:.7847325056542677},{x:.16433721599099446,y:.7584545056542678},{x:.1612047546311144,y:.7570179671101032},{x:.15801334200327716,y:.7557176430739929},{x:.09817134200327716,y:.7241756430739928},{x:.09479788711775466,y:.721949723610623},{x:.09138819905405325,y:.7197797137879894},{x:.05384019905405325,y:.6903397137879895},{x:.04746503339724546,y:.6842424293748122},{x:.0424018859405069,y:.677018569451043},{x:.0388453306011542,y:.6689457429023652},{x:.036932043806339465,y:.6603341839257509},{x:.036735552094603836,y:.6515148299032538},{x:.03826340653223549,y:.6428266036640077},{x:.041456892530026886,y:.6346033888699733},{x:.046193286212010486,y:.6271611990540533},{x:.05229057062518783,y:.6207860333972455},{x:.05951443054895701,y:.615722885940507},{x:.06758725709763488,y:.6121663306011542},{x:.07619881607424907,y:.6102530438063395},{x:.08501817009674617,y:.6100565520946039},{x:.09370639633599236,y:.6115844065322356},{x:.1019296111300268,y:.6147778925300269},{x:.10937180094594674,y:.6195142862120105},{x:.14372643260130716,y:.6464504840370294},{x:.1969218011618275,y:.6744891243755197},{x:.2615721948597163,y:.6967640072977177},{x:.3408866683163358,y:.6923288252210377},{x:.40955721054777616,y:.6703524458415177},{x:.4555820596629536,y:.6332360369266462},{x:.477752059875079,y:.596814658492312},{x:.4716998550115053,y:.5642759337587675},{x:.44042564505409965,y:.532748518309004},{x:.3700728058889163,y:.5012285825754976},{x:.28267158635688694,y:.4816496665818946},{x:.2026156257994338,y:.47140070238604853},{x:.19958923290487823,y:.4707064281346213},{x:.19652752938874105,y:.4701896668089735},{x:.19529880233776667,y:.46972217540403877},{x:.1940174323454584,y:.4694282207777866},{x:.19118463692903986,y:.4681568668470777},{x:.18828257832087977,y:.4670527262205195},{x:.18716866396437967,y:.46635450477580015},{x:.18596926283986664,y:.4658162155208443},{x:.1834389276407875,y:.4640166393294268},{x:.18080803842542348,y:.46236755090702814},{x:.17985174386742717,y:.4614654316810775},{x:.17878040392329292,y:.4607034939516098},{x:.17664976830422657,y:.45844485220330683},{x:.1743911520787843,y:.45631418952832026},{x:.17362922718285934,y:.45524284045707714},{x:.17272711941234267,y:.45428653509274164},{x:.17107806250525512,y:.45165562612327925},{x:.16927851662463225,y:.44912526936741537},{x:.1687402417372368,y:.44792586179486843},{x:.1680420336360506,y:.4468119390745141},{x:.1669379277730794,y:.44390986724015796},{x:.1656666077762714,y:.4410770565945043},{x:.16537266849946,y:.43979568308103084},{x:.16490519181337332,y:.438566950430106},{x:.16438846716364272,y:.4355052407239498},{x:.16369422916516244,y:.43247883951296023},{x:.16365592142049992,y:.43116474252408066},{x:.16343714101639506,y:.42986841944927895},{x:.1635276550184117,y:.4267647316583033},{x:.16343717819520762,y:.42366104278329114},{x:.1636559741278381,y:.4223647223293339},{x:.1636942976139514,y:.42105062579943375},{x:.1643885718653787,y:.41802423290487795},{x:.16490533319102646,y:.414962529388741},{x:.1653728245959611,y:.41373380233776696},{x:.1656667792222133,y:.41245243234545836},{x:.1669381331529224,y:.40961963692903947},{x:.16804227377948042,y:.40671757832087974},{x:.16874049522419982,y:.4056036639643795},{x:.16927878447915568,y:.4044042628398666},{x:.17107836067057278,y:.40187392764078794},{x:.1727274490929718,y:.3992430384254234},{x:.17362956831892262,y:.3982867438674269},{x:.17439150604839013,y:.3972154039232929},{x:.1766501477966929,y:.39508476830422673},{x:.1787808104716797,y:.39282615207878424},{x:.17985215954292283,y:.39206422718285927},{x:.18080846490725827,y:.39116211941234263},{x:.18343937387672077,y:.38951306250525497},{x:.18596973063258454,y:.3877135166246322},{x:.18716913820513145,y:.3871752417372368},{x:.1882830609254858,y:.38647703363605057},{x:.19118513275984234,y:.3853729277730792},{x:.19401794340549564,y:.3841016077762714},{x:.19529931691896882,y:.38380766849946},{x:.19652804956989395,y:.38334019181337325},{x:.19958975927605035,y:.38282346716364263},{x:.20261616048703973,y:.3821292291651624},{x:.28149235433605535,y:.37203226198800626},{x:.3678476199052635,y:.34785057975990136},{x:.4387239808422848,y:.31155986033736477},{x:.4773813812672204,y:.26922136053481893},{x:.48460036747312013,y:.2304069273293995},{x:.4680118822440525,y:.1820955353962423},{x:.4262197745588727,y:.1363254129914362},{x:.35583608100487274,y:.09578139608686695},{x:.3056218275014876,y:.083895601213743},{x:.2134048551529998,y:.08581745449589688},{x:.13726972612583144,y:.09751265420048184},{x:.0839251628848058,y:.11344659691108305},{x:.0752658675153883,y:.11513070441124498},{x:.06644440500388343,y:.11509310753596806},{x:.05779977920747511,y:.11333525111208462},{x:.0496641982475573,y:.10992468857614723},{x:.04235030793793329,y:.10499248593374648},{x:.036139176981525016,y:.09872818496641873},{x:.03126949565774486,y:.09137251924727793},{x:.027928403088916927,y:.08320816288480577},{x:.02624429558875499,y:.07454886751538828}]],4:[[{x:.003828000000000005,y:.27580099999999996},{x:.0040512821902059844,y:.2735339778783202},{x:.004058111165048277,y:.2712559968420181},{x:.004482570943879651,y:.26915502967601196},{x:.004692662381854638,y:.26702193550927417},{x:.005353928343121064,y:.26484203377636983},{x:.005805038155045426,y:.26260915577382815},{x:.0066312204192078995,y:.26063136609773396},{x:.0072534210369921,y:.25858024554357095},{x:.008327258689269697,y:.2565712366005347},{x:.009205313441189196,y:.2544692698811785},{x:.010401468469599332,y:.25269066304309135},{x:.011411867446385462,y:.25080033951411784},{x:.01285700981091242,y:.2490394284479652},{x:.014128266351129452,y:.24714915041402313},{x:.01564842657685691,y:.24563807727727646},{x:.017008194846605366,y:.24398119484660533},{x:.018769105912757822,y:.24253605248207852},{x:.020384710565360974,y:.24093010545831445},{x:.022170457083446928,y:.23974463571613375},{x:.023827339514117918,y:.23838486744638543},{x:.025836348457154004,y:.2373110297941079},{x:.027734214441385185,y:.2360511294240198},{x:.029716922014597604,y:.23523682001377813},{x:.031607245543570965,y:.23422642103699207},{x:.03378714727647517,y:.23356515507572567},{x:.03589434066689576,y:.23269971862397582},{x:.03799781495511128,y:.23228786299963877},{x:.040048935509274235,y:.2316656623818546},{x:.04231595763095386,y:.23144238019164864},{x:.0445515001672978,y:.23100466589573537},{x:.046694905833262405,y:.23101109143797494},{x:.048828,y:.23080099999999998},{x:.36918100000000004,y:.23080099999999998},{x:.36918100000000004,y:.05103000000000002},{x:.37004566238185466,y:.04225093550927423},{x:.3726064210369921,y:.03380924554357098},{x:.3767648674463855,y:.026029339514117924},{x:.38236119484660536,y:.019210194846605383},{x:.38918033951411796,y:.013613867446385479},{x:.396960245543571,y:.009455421036992116},{x:.4054019355092743,y:.006894662381854655},{x:.414181,y:.0060300000000000215},{x:.4229600644907258,y:.006894662381854655},{x:.4314017544564291,y:.009455421036992116},{x:.43918166048588214,y:.013613867446385486},{x:.4460008051533947,y:.019210194846605383},{x:.45159713255361456,y:.026029339514117924},{x:.45575557896300795,y:.03380924554357098},{x:.4583163376181454,y:.04225093550927425},{x:.459181,y:.05103000000000002},{x:.459181,y:.23080099999999998},{x:.553224,y:.23080099999999998},{x:.5620030644907258,y:.2316656623818546},{x:.5704447544564291,y:.23422642103699207},{x:.5782246604858822,y:.23838486744638543},{x:.5850438051533947,y:.24398119484660533},{x:.5906401325536146,y:.25080033951411784},{x:.5947985789630079,y:.25858024554357095},{x:.5973593376181454,y:.26702193550927417},{x:.5982240000000001,y:.27580099999999996},{x:.5973593376181454,y:.28458006449072576},{x:.5947985789630079,y:.293021754456429},{x:.5906401325536146,y:.3008016604858821},{x:.5850438051533947,y:.3076208051533946},{x:.5782246604858822,y:.3132171325536145},{x:.5704447544564291,y:.3173755789630079},{x:.5620030644907258,y:.31993633761814533},{x:.553224,y:.32080099999999995},{x:.459181,y:.32080099999999995},{x:.459181,y:.421833},{x:.4583163376181454,y:.4306120644907258},{x:.45575557896300795,y:.439053754456429},{x:.45159713255361456,y:.4468336604858821},{x:.4460008051533947,y:.4536528051533947},{x:.43918166048588214,y:.45924913255361455},{x:.4314017544564291,y:.4634075789630079},{x:.4229600644907258,y:.4659683376181454},{x:.414181,y:.466833},{x:.4054019355092743,y:.4659683376181454},{x:.396960245543571,y:.4634075789630079},{x:.38918033951411796,y:.45924913255361455},{x:.38236119484660536,y:.4536528051533947},{x:.3767648674463855,y:.4468336604858821},{x:.3726064210369921,y:.439053754456429},{x:.37004566238185466,y:.4306120644907258},{x:.36918100000000004,y:.421833},{x:.36918100000000004,y:.32080099999999995},{x:.1436046917940101,y:.32080099999999995},{x:.4533648945416855,y:.700560710565361},{x:.45824387057598015,y:.7079102144413851},{x:.4615952813760241,y:.7160703406668958},{x:.46329033410426457,y:.7247275001672978},{x:.46326388883495173,y:.7335490031579818},{x:.46151696184495455,y:.7421958442261718},{x:.45811668655881077,y:.7503357301188214},{x:.4531937336488705,y:.7576558495859769},{x:.446937289434639,y:.7638748945416856},{x:.4395877855586148,y:.7687538705759801},{x:.43142765933310423,y:.7721052813760241},{x:.42277049983270215,y:.7738003341042645},{x:.41394899684201814,y:.7737738888349517},{x:.40530215577382817,y:.7720269618449546},{x:.39716226988117853,y:.7686266865588108},{x:.38984215041402315,y:.7637037336488706},{x:.38362310545831446,y:.757447289434639},{x:.013957105458314502,y:.304244289434639},{x:.012771635716133971,y:.30245854291655333},{x:.011411867446385462,y:.3008016604858821},{x:.010338029794107799,y:.29879265154284573},{x:.009078129424019837,y:.29689478555861476},{x:.008263820013778204,y:.2949120779854024},{x:.0072534210369921,y:.293021754456429},{x:.006592155075725704,y:.29084185272352475},{x:.005726718623975863,y:.2887346593331042},{x:.0053148629996388475,y:.28663118504488877},{x:.004692662381854638,y:.28458006449072576},{x:.00446938019164866,y:.282313042369046},{x:.00403166589573542,y:.2800774998327022},{x:.00403809143797499,y:.27793409416673776},{x:.003828000000000005,y:.27580099999999996}]],5:[[{x:.029951000000000005,y:.38529899999999995},{x:.030026331329377584,y:.3845341481773043},{x:.029977079633894697,y:.38376717530271315},{x:.030458063889865227,y:.38015069392879464},{x:.03081566238185464,y:.37651993550927415},{x:.03103876142924568,y:.3757844765131909},{x:.03114008507636279,y:.3750226322781917},{x:.0323173678705276,y:.3715694759531816},{x:.0333764210369921,y:.36807824554357094},{x:.033738714231120716,y:.3674004426508694},{x:.033986719409902104,y:.366673004302166},{x:.03581505842470893,y:.3635158758870829},{x:.03753486744638546,y:.3602983395141178},{x:.03802243206297786,y:.35970424030984804},{x:.03840758807348568,y:.3590391628952293},{x:.04081672126593952,y:.35629938906452685},{x:.04313119484660537,y:.3534791948466053},{x:.04372529405087513,y:.3529916302300129},{x:.04423279956362368,y:.3524144723015426},{x:.04713014529619686,y:.3501973410270508},{x:.04995033951411792,y:.3478828674463854},{x:.05062814240681941,y:.3475205742522568},{x:.05123849426956635,y:.347053515665452},{x:.054512709170605814,y:.34544423005866864},{x:.057730245543570965,y:.343724421036992},{x:.05846570453965444,y:.3435013219896009},{x:.05915544727260316,y:.34316231154402344},{x:.06268070509966306,y:.34222271554831923},{x:.06617193550927424,y:.3411636623818546},{x:.0669367873319697,y:.34108833105247705},{x:.06767941450870582,y:.34089039672943083},{x:.07132024158048059,y:.34065659849198926},{x:.074951,y:.34029899999999996},{x:.0757158518226955,y:.3403743313293775},{x:.07648282469728679,y:.34032507963389463},{x:.08009930607120508,y:.3408060638898651},{x:.08373006449072577,y:.3411636623818546},{x:.0844655234868091,y:.3413867614292456},{x:.08522736772180821,y:.34148808507636275},{x:.2701097088502776,y:.3848544225750548},{x:.39095673206080095,y:.3699215697302287},{x:.4312208460684155,y:.34735587040502247},{x:.4569274445394237,y:.3179203076157562},{x:.4808881134259603,y:.2201177906149206},{x:.47151862074291284,y:.1781066999956386},{x:.4461217481742335,y:.14395206669668215},{x:.3876788357927069,y:.10680533743499816},{x:.3169820044514503,y:.08634947983662909},{x:.2505487358362677,y:.08307118781270932},{x:.19638270317906092,y:.09339965838335124},{x:.15518503458472022,y:.11245499400015477},{x:.1051531598037562,y:.15775209985578706},{x:.09806479623887651,y:.16300326318775482},{x:.09008818244690309,y:.16677065575830224},{x:.0815298552225249,y:.16890949878372125},{x:.07271870628140957,y:.16933759772602197},{x:.06399334313601493,y:.16803850098293246},{x:.05568907659877849,y:.16506213211374782},{x:.04812503497563989,y:.16052287130494386},{x:.041591900144212934,y:.15459515980375618},{x:.03634073681224515,y:.1475067962388765},{x:.03257334424169774,y:.13953018244690307},{x:.03043450121627874,y:.13097185522252489},{x:.03000640227397801,y:.12216070628140954},{x:.031305499017067515,y:.1134353431360149},{x:.034281867886252176,y:.10513107659877846},{x:.03882112869505611,y:.09756703497563987},{x:.044748840196243804,y:.09103390014421289},{x:.09986584019624378,y:.041132900144212926},{x:.10178680031290575,y:.03970982481314967},{x:.10357183338498165,y:.03811957700249835},{x:.10532248536915285,y:.037090537646117014},{x:.10695420376112348,y:.035881736812245144},{x:.10911588139237749,y:.0348607662023731},{x:.11117685751196796,y:.03364931723433351},{x:.16362485751196798,y:.009390317234333478},{x:.1646572774363771,y:.009030847933342759},{x:.16562545909873666,y:.008523173483185618},{x:.16881529925253239,y:.0075831025339957205},{x:.1719558576504946,y:.006489618860012841},{x:.17303856889723523,y:.006338471796353147},{x:.17408718959239433,y:.0060294350406820685},{x:.23897018959239436,y:-.00634256495931787},{x:.2399001168767359,y:-.006426714843400178},{x:.24080591100583193,y:-.006653392925378379},{x:.24428588214420577,y:-.0068235863462415185},{x:.247755834543085,y:-.007137585190079683},{x:.24868431036339586,y:-.007038698344381461},{x:.24961692261229596,y:-.007084309202250054},{x:.32666292261229596,y:-.003282309202250082},{x:.32746661284147915,y:-.0031629125067284265},{x:.32827905619988357,y:-.00317336931171093},{x:.3318231917274382,y:-.002515696572186591},{x:.33538870069659477,y:-.001986002452099067},{x:.33615365510360457,y:-.0017121077449900682},{x:.3369525276121403,y:-.0015638637889859724},{x:.4188855276121403,y:.02214313621101406},{x:.4207304127428032,y:.02287964098341223},{x:.42264402370761556,y:.023412682727046455},{x:.4248170355152836,y:.024511079778651145},{x:.4270783417525648,y:.02541382586724525},{x:.42874409297954025,y:.02649609814118395},{x:.43051694316083267,y:.027392224616519634},{x:.5014129431608326,y:.07245422461651957},{x:.5044011686844615,y:.0747943741105689},{x:.5074525565132345,y:.07705154573740032},{x:.5078697672823866,y:.07751071502587484},{x:.5083582165656543,y:.07789323111579813},{x:.5108324836553944,y:.0807713891731658},{x:.5133848875831327,y:.08358048611421783},{x:.5494628875831328,y:.1320994861142178},{x:.5497798823390716,y:.1326268676033582},{x:.5501811109693575,y:.13309337858567127},{x:.5520495631508493,y:.13640291633591076},{x:.5540074974944301,y:.13966031511116345},{x:.5542155142604781,y:.14023940572188273},{x:.5545180216173755,y:.1407752286491667},{x:.5557049132287019,y:.14438569149730107},{x:.5569897394368822,y:.14796247431004633},{x:.5570807842453774,y:.1485710199149322},{x:.5572729451408087,y:.14915556341258465},{x:.5710219451408087,y:.2108035634125847},{x:.5712046210163666,y:.21230267395853206},{x:.5715791512667351,y:.2137656948046034},{x:.571736996194895,y:.21667155541097086},{x:.5720890113736304,y:.2195603313107129},{x:.5719757152243157,y:.2210662751632623},{x:.5720576277729665,y:.2225742517011615},{x:.5716455344736617,y:.2254550710286549},{x:.5714272135589309,y:.2283570146640783},{x:.5710222992922247,y:.22981191924551903},{x:.5708084462858501,y:.23130690078257787},{x:.5417354462858501,y:.3499769007825779},{x:.5411002871662289,y:.3517814599872898},{x:.540669734049328,y:.3536454570484658},{x:.5396393400617131,y:.355932176655931},{x:.5388066121493867,y:.3582980512419798},{x:.5378316053978042,y:.3599440229503987},{x:.537045677451414,y:.361688207084494},{x:.5355889653307644,y:.36372996812105773},{x:.5343106788169316,y:.36588792593376723},{x:.5330332933960605,y:.36731205637621067},{x:.5319221933904076,y:.36886939956510134},{x:.49389619339040763,y:.4124113995651013},{x:.49150876583293945,y:.41465677330496736},{x:.4892379705562563,y:.41702003426923534},{x:.48830169237996507,y:.41767302336482964},{x:.48747017448549057,y:.4184550652905171},{x:.4846905699931398,y:.420191530792605},{x:.4820023580684325,y:.4220663721783498},{x:.4272473580684325,y:.4527533721783498},{x:.42330567688981036,y:.45447898255061825},{x:.4193723578126433,y:.45622356923745777},{x:.4192660752068488,y:.4562474610875831},{x:.4191662841579818,y:.4562911481493166},{x:.41496369139475175,y:.45721461755172516},{x:.4107655979622113,y:.4581583300092093},{x:.27317359796221125,y:.47516033000920926},{x:.26964530070808584,y:.4752477446385603},{x:.2661231753027132,y:.4754739203661053},{x:.26524270860794985,y:.4753568201865933},{x:.26435476148695686,y:.47537881934450843},{x:.2608772057270339,y:.4747762176787918},{x:.2573786322781918,y:.4743109149236372},{x:.119951,y:.44207564006371447},{x:.119951,y:.684004},{x:.527101,y:.684004},{x:.5358800644907258,y:.6848686623818546},{x:.544321754456429,y:.6874294210369921},{x:.5521016604858822,y:.6915878674463855},{x:.5589208051533947,y:.6971841948466053},{x:.5645171325536146,y:.7040033395141179},{x:.5686755789630079,y:.711783245543571},{x:.5712363376181454,y:.7202249355092742},{x:.5721010000000001,y:.729004},{x:.5712363376181454,y:.7377830644907257},{x:.5686755789630079,y:.746224754456429},{x:.5645171325536146,y:.7540046604858821},{x:.5589208051533947,y:.7608238051533946},{x:.5521016604858822,y:.7664201325536145},{x:.544321754456429,y:.7705785789630079},{x:.5358800644907258,y:.7731393376181454},{x:.527101,y:.774004},{x:.074951,y:.774004},{x:.06617193550927424,y:.7731393376181454},{x:.05773024554357094,y:.7705785789630079},{x:.04995033951411792,y:.7664201325536145},{x:.04313119484660537,y:.7608238051533946},{x:.03753486744638546,y:.7540046604858821},{x:.0333764210369921,y:.746224754456429},{x:.03081566238185464,y:.7377830644907257},{x:.029951000000000005,y:.729004},{x:.029951000000000005,y:.38529899999999995}]],6:[[{x:.01994450211145162,y:.2755194646798348},{x:.020758274672659796,y:.26806396163938684},{x:.0201773643330274,y:.24423363638780976},{x:.020440223451033163,y:.2406784570189078},{x:.020568639264984916,y:.237115887070161},{x:.02076496657089406,y:.23628629421823594},{x:.02082782677693791,y:.23543610758842642},{x:.021779216218601925,y:.23200052126419074},{x:.022600187477202785,y:.22853145778054884},{x:.04459918747720279,y:.16442145778054884},{x:.04602253566469808,y:.16130748249724527},{x:.047307319174730654,y:.15813382633120915},{x:.06831231917473066,y:.11806482633120913},{x:.06934150993632018,y:.11649740482650416},{x:.07018719324152095,y:.11482382676006757},{x:.07175673818837072,y:.11281909673987861},{x:.07315419088510985,y:.11069082519836773},{x:.0744693948008918,y:.10935430641546007},{x:.07562532742241568,y:.1078778703106287},{x:.1253733274224157,y:.055788870310628645},{x:.12585541612958862,y:.055374327647901005},{x:.12626130847256478,y:.0548849335871293},{x:.1291958120945167,y:.0525019586891126},{x:.1320620582603259,y:.05003730581521479},{x:.13261575702973094,y:.04972477931463493},{x:.1331093263100589,y:.049323974491408525},{x:.1861743263100589,y:.014262974491408516},{x:.18683955107784095,y:.013911818906951787},{x:.187438960697758,y:.013457349607970202},{x:.1907349034619545,y:.011855559414887177},{x:.19397565070571454,y:.010144849670490022},{x:.19469660042216425,y:.009930220356283175},{x:.19537315511619574,y:.009601422573216056},{x:.19891826102894206,y:.008673416864759805},{x:.2024304811380398,y:.007627816351770726},{x:.20317945010986724,y:.007557961391993223},{x:.20390715026053782,y:.0073674706392518954},{x:.2857161502605378,y:-.005654529360748083},{x:.2860775594607644,y:-.005676122674759226},{x:.28642923596273784,y:-.0057621838110407525},{x:.2904772893795591,y:-.005938995755027237},{x:.2945219894833068,y:-.006180656673914681},{x:.2948806669536751,y:-.006131327641200151},{x:.2952423757850646,y:-.006147126454864343},{x:.38700037578506463,y:-.001139126454864331},{x:.39074801870473747,y:-.000562375362895672},{x:.3945101708776463,y:-8942684208443352e-20},{x:.395102371884912,y:.00010774663253235539},{x:.3957192721812796,y:.00020268575218489876},{x:.39928238663684656,y:.0014994835976446027},{x:.4028799824314506,y:.002697304024131271},{x:.47474098243145063,y:.03475230402413133},{x:.4764407459001163,y:.03572046389197228},{x:.4782361407270164,y:.03649705052245801},{x:.48026428101539703,y:.03789829234877595},{x:.4824063061811086,y:.03911835786940705},{x:.4838845305509628,y:.04039952221931584},{x:.48549392283388365,y:.041511451110380196},{x:.5363469228338836,y:.08458545111038014},{x:.5369424578291695,y:.08519979361043255},{x:.5376274627831791,y:.08571247952886965},{x:.5400078699953618,y:.08836201411598918},{x:.5424869876672573,y:.09091942444541115},{x:.5429512273484354,y:.09163814564059086},{x:.5435230500634102,y:.09227461827992436},{x:.5453408198626901,y:.09533763721244376},{x:.5472733759789791,y:.0983295594844189},{x:.5475884798754501,y:.09912503932225875},{x:.5480251455251356,y:.09986083939589693},{x:.5756631455251356,y:.15896283939589692},{x:.5756676990332947,y:.1589757429605767},{x:.575674675284325,y:.15898751446598428},{x:.5771354507402345,y:.1631350040011944},{x:.5785987361645655,y:.16728160865370237},{x:.5786006848177536,y:.16729515262537814},{x:.5786052305152959,y:.16730805894366996},{x:.5792288025114348,y:.17166083878445604},{x:.5798550088797246,y:.1760132404159827},{x:.5798542777922926,y:.17602690430741857},{x:.5798562182477396,y:.17604044945602063},{x:.5820672182477395,y:.2261264494560206},{x:.5819074721227447,y:.22907858468741052},{x:.5819395990078049,y:.232034864293962},{x:.5816696541741431,y:.23347350033714379},{x:.5815905637246603,y:.23493510513282764},{x:.580857954063737,y:.2377993509905685},{x:.5803127220992973,y:.2407050941577823},{x:.5648357220992973,y:.2937960941577823},{x:.5632290277642941,y:.2977974374258546},{x:.5616400226499054,y:.30180583827676916},{x:.5384240226499054,y:.3468838382767692},{x:.5373215489467563,y:.3485896803397862},{x:.5364060617863755,y:.35040275195151915},{x:.5349331318310961,y:.3522852445680167},{x:.5336357086983223,y:.35429272914301846},{x:.5322216254408594,y:.35575071197935654},{x:.5309700163849885,y:.3573503432435408},{x:.49559401638498846,y:.39441334324354077},{x:.4926979475395651,y:.39690515537305066},{x:.48986855873600776,y:.3994724304741097},{x:.48935820160472765,y:.3997787125549045},{x:.48890701524930746,y:.4001669186691625},{x:.48558046512393155,y:.4020458563236817},{x:.4823045917066957,y:.404011815580751},{x:.4336605917066957,y:.42705181558075106},{x:.43309173356321873,y:.4272557130907893},{x:.4325654489917744,y:.42755269513041455},{x:.42894434743018467,y:.4287422729922158},{x:.4253563740806812,y:.43002832091195864},{x:.42475866795602985,y:.4301173218701226},{x:.42418455747331046,y:.430305924456616},{x:.35674655747331047,y:.44533192445661596},{x:.3529000911149492,y:.4457998510145922},{x:.3490659246900917,y:.4463596961147396},{x:.28494592469009167,y:.4493636961147396},{x:.2805873413475358,y:.449139645094856},{x:.27622830276644406,y:.44892463285807194},{x:.20879130276644411,y:.4389076328580719},{x:.2058686377582091,y:.4381749274884603},{x:.2029059705898912,y:.4376259000221244},{x:.2015992206546876,y:.4371045944779896},{x:.20023455588710068,y:.4367624761715421},{x:.19751099279397463,y:.4354736658725529},{x:.19471236238975773,y:.4343572001231398},{x:.1250653623897577,y:.39829620012313977},{x:.12281565387932818,y:.3968352958512946},{x:.12046004217050754,y:.3955521266688945},{x:.11912493361112,y:.39443863469229795},{x:.1176668837895426,y:.39349181371392206},{x:.11574541108214431,y:.3916200839502759},{x:.11440461043594556,y:.3905018447245139},{x:.11499744675527566,y:.4076710597897629},{x:.14015918883207887,y:.48309781218266834},{x:.17625691985197756,y:.5624688107059582},{x:.22079283681825793,y:.6049160879451294},{x:.2812243215554422,y:.6473094683632384},{x:.35529887985725983,y:.6721340784004237},{x:.44197867319461825,y:.699237682451455},{x:.450099621980826,y:.7026829408131323},{x:.45739239245003865,y:.7076463180152294},{x:.4635767275229571,y:.7139370742553635},{x:.4684149666709443,y:.7213134592991232},{x:.47172117907685873,y:.729492002806001},{x:.4733683088520865,y:.7381584079356077},{x:.4732930577230865,y:.7469796295989887},{x:.471498317548545,y:.7556166731946181},{x:.4680530591868676,y:.7637376219808258},{x:.4630896819847706,y:.7710303924500386},{x:.4567989257446365,y:.7772147275229571},{x:.4494225407008768,y:.7820529666709441},{x:.4412439971939989,y:.7853591790768587},{x:.43257759206439217,y:.7870063088520864},{x:.4237563704010112,y:.7869310577230865},{x:.41511932680538177,y:.7851363175485448},{x:.32800332680538175,y:.7578963175485449},{x:.32758097645219697,y:.7577171382279785},{x:.32713377373466446,y:.7576146941984534},{x:.2464307737346645,y:.7305686941984535},{x:.24453959681011464,y:.7297206474805041},{x:.2425703892464572,y:.7290741531131611},{x:.24052462272791658,y:.727920241844807},{x:.2383814751569417,y:.7269592057619036},{x:.2366920823739949,y:.725758503708645},{x:.23488683737580707,y:.7247402582115807},{x:.16634483737580705,y:.6766572582115807},{x:.16379281785599412,y:.6744641039532857},{x:.16114120086592887,y:.6723924725748345},{x:.10785520086592887,y:.6216054725748346},{x:.10512406158167997,y:.61843588774195},{x:.10236095541706475,y:.6152941312068447},{x:.10224621895073822,y:.6150960484276141},{x:.1020967920615373,y:.6149226331776604},{x:.10003648617852028,y:.6112811321861437},{x:.09793939861820375,y:.6076606883504815},{x:.057256398618203745,y:.5182076883504814},{x:.05649445644348035,y:.515973451082899},{x:.055531562043165734,y:.5138181769891187},{x:.02756156204316574,y:.4299731769891187},{x:.02710606704062858,y:.4279720709807987},{x:.026442901166776424,y:.42602987841114226},{x:.0261294707087366,y:.42368163359604843},{x:.025603668479436986,y:.4213716499642221},{x:.02554732210120287,y:.4193201319800137},{x:.025275801747494525,y:.4172858808521062},{x:.022290801747494524,y:.3308368808521062},{x:.022305383523873214,y:.330608131273329},{x:.022277364333027405,y:.33038063638780973},{x:.021194122115214913,y:.2859434614650037},{x:.02071653916751727,y:.2843071590959475},{x:.01994450211145162,y:.2755194646798348}],[{x:.11034731747482908,y:.25010871966048204},{x:.11054573733688708,y:.2582483748303443},{x:.14138614929871246,y:.28974619429248377},{x:.17280436841728808,y:.32166563054627706},{x:.2294333737827033,y:.3509863272379111},{x:.2851142784460479,y:.35925709287120927},{x:.3409693478959939,y:.3566403020317264},{x:.39969116147327427,y:.34355637352239615},{x:.43624565447916347,y:.3262425111990739},{x:.46138408324665353,y:.29990528863548604},{x:.47964461062187336,y:.2644492215688011},{x:.49182659739178797,y:.22266115801633354},{x:.4903391577658353,y:.18896604218391924},{x:.47066764412974615,y:.14689983627465894},{x:.4322187986209955,y:.11433252320671945},{x:.3738017517723872,y:.08827446060346957},{x:.29512698962943984,y:.08398052210424463},{x:.22766698305582697,y:.09471851188045},{x:.18695506157646963,y:.1216176107024183},{x:.1450838647757246,y:.1654591474507099},{x:.12861258258928074,y:.1968796571354811},{x:.11034731747482908,y:.25010871966048204}]],7:[[{x:.026534000000000002,y:.729004},{x:.027398662381854635,y:.7202249355092742},{x:.029959421036992097,y:.711783245543571},{x:.03411786744638546,y:.7040033395141179},{x:.039714194846605363,y:.6971841948466053},{x:.046533339514117915,y:.6915878674463855},{x:.05431324554357096,y:.6874294210369921},{x:.06275493550927423,y:.6848686623818546},{x:.071534,y:.684004},{x:.4019606654607806,y:.684004},{x:.4004737160341744,y:.6825246433416329},{x:.3773547160341744,y:.6545006433416328},{x:.37631768094411194,y:.6529571778549935},{x:.37511206403824765,y:.6515414747212956},{x:.3516100640382476,y:.6177174747212957},{x:.35070717908442606,y:.6160998190359583},{x:.34962595461558005,y:.6145955036421288},{x:.32637595461558006,y:.5744575036421288},{x:.32562538351875275,y:.5728072168885044},{x:.3246890272988689,y:.5712547864166106},{x:.3023170272988689,y:.5242907864166106},{x:.3017220252289498,y:.5226423026482856},{x:.3009361907094137,y:.5210757809262708},{x:.2800741907094137,y:.4667717809262708},{x:.2796297795277362,y:.4651572895546526},{x:.27899211910181604,y:.46360891205912846},{x:.26027511910181605,y:.40145091205912853},{x:.2599700482242006,y:.399900691568321},{x:.2594722021762355,y:.3984012246220316},{x:.2435242021762355,y:.3278752246220315},{x:.24329560198997774,y:.32604433113097486},{x:.24285939794168837,y:.32425152465814894},{x:.22552039794168838,y:.201651524658149},{x:.22543629437721757,y:.19966542745190077},{x:.2251384028560513,y:.1976999971774209},{x:.21759140285605127,y:.0533799971774209},{x:.2179964236931644,y:.04456775725283754},{x:.22011284489303193,y:.03600385769296016},{x:.22385933357584556,y:.028017404355184638},{x:.22909191428257988,y:.020915312162427036},{x:.23560950187114016,y:.014970510534755857},{x:.24316162910560324,y:.010411454864839347},{x:.25145807197163045,y:.007413347105324521},{x:.2601800028225791,y:.006091402856051323},{x:.26899224274716244,y:.0064964236931644576},{x:.27755614230703984,y:.008612844893031955},{x:.2855425956448154,y:.0123593335758456},{x:.29264468783757297,y:.017591914282579925},{x:.29858948946524416,y:.02410950187114019},{x:.30314854513516065,y:.03166162910560326},{x:.30614665289467546,y:.03995807197163046},{x:.3074685971439487,y:.04868000282257914},{x:.3149118365119932,y:.19101580586964154},{x:.33171443080019297,y:.3098230069615897},{x:.3469078029209317,y:.3770118558572018},{x:.3646876244488305,y:.43605754408347375},{x:.3843219343355222,y:.48716585412502805},{x:.40516196826036527,y:.5309139031705462},{x:.42657620329737017,y:.5678827017045378},{x:.4479617026009278,y:.5986606409626235},{x:.4682073320853445,y:.6232016470905397},{x:.5069453480603512,y:.6602460238293135},{x:.5211069187127709,y:.670919967941474},{x:.553634852004927,y:.6903949675582732},{x:.5545334052571363,y:.6910607030437311},{x:.5555196604858821,y:.6915878674463855},{x:.5580709875097788,y:.6936816874233654},{x:.5607229359621996,y:.6956465083018619},{x:.5614743452153894,y:.6964747509099635},{x:.5623388051533946,y:.6971841948466053},{x:.5644326251303754,y:.699735521870503},{x:.5666502995990071,y:.7021799587443133},{x:.5672256886169725,y:.7031388795761127},{x:.5679351325536145,y:.7040033395141179},{x:.5694909811561905,y:.7069141275182039},{x:.5711891576548912,y:.709744242049125},{x:.5715664145603537,y:.7107969903148255},{x:.5720935789630078,y:.711783245543571},{x:.5730516658019124,y:.7149416345772374},{x:.5741650843601849,y:.7180486670509921},{x:.5743297113818354,y:.7191547862251302},{x:.5746543376181453,y:.7202249355092742},{x:.574977843953461,y:.7235095504532041},{x:.5754637165205229,y:.7267740993542682},{x:.5754093871342436,y:.7278910818973009},{x:.575519,y:.729004},{x:.5751954936646845,y:.7322886149439295},{x:.5750351484302645,y:.735585225488817},{x:.5747639504839017,y:.7366701463880269},{x:.5746543376181453,y:.7377830644907257},{x:.5736962507792408,y:.7409414535243923},{x:.5728958497207748,y:.7441434388186243},{x:.5724182051993175,y:.7451546051722857},{x:.5720935789630078,y:.746224754456429},{x:.570537730360432,y:.749135542460515},{x:.5691280324417267,y:.752119852004927},{x:.5684622969562688,y:.7530184052571364},{x:.5679351325536145,y:.7540046604858821},{x:.5658413125766343,y:.756555987509779},{x:.563876491698138,y:.7592079359621996},{x:.5630482490900365,y:.7599593452153895},{x:.5623388051533946,y:.7608238051533946},{x:.5597874781294971,y:.7629176251303754},{x:.5573430412556867,y:.7651352995990072},{x:.5563841204238874,y:.7657106886169726},{x:.5555196604858821,y:.7664201325536145},{x:.5526088724817957,y:.7679759811561907},{x:.5497787579508749,y:.7696741576548912},{x:.5487260096851745,y:.7700514145603538},{x:.547739754456429,y:.7705785789630079},{x:.5445813654227618,y:.7715366658019126},{x:.5414743329490078,y:.7726500843601849},{x:.5403682137748697,y:.7728147113818356},{x:.5392980644907257,y:.7731393376181454},{x:.5360134495467959,y:.773462843953461},{x:.5327489006457318,y:.7739487165205229},{x:.531631918102699,y:.7738943871342436},{x:.530519,y:.774004},{x:.071534,y:.774004},{x:.06275493550927423,y:.7731393376181454},{x:.054313245543570934,y:.7705785789630079},{x:.046533339514117915,y:.7664201325536145},{x:.039714194846605363,y:.7608238051533946},{x:.03411786744638546,y:.7540046604858821},{x:.029959421036992097,y:.746224754456429},{x:.027398662381854635,y:.7377830644907257},{x:.026534000000000002,y:.729004}]],8:[[{x:.018998734783549534,y:.19034712298183487},{x:.01918983868826437,y:.187136446932327},{x:.01920952916989005,y:.18392014879903562},{x:.019451409422642358,y:.18274188004279768},{x:.019522877627479743,y:.18154116541629586},{x:.0203366813486396,y:.1784294641291047},{x:.020983462121705806,y:.17527880768498513},{x:.021450563544301488,y:.17417036752890672},{x:.021754906310756543,y:.17300666705236456},{x:.02316013582774355,y:.17011352146289485},{x:.024409151469860245,y:.16714958466818597},{x:.06244715146986025,y:.097021584668186},{x:.06364531823888224,y:.0952519506947441},{x:.06465809579443724,y:.09337006609963419},{x:.0661122558858275,y:.09160840391706095},{x:.06739294989385258,y:.08971688123025286},{x:.06891333268610705,y:.08821500101819715},{x:.07027378747657535,y:.08656685940733966},{x:.07204368953204261,y:.0851227396301211},{x:.07366879313388441,y:.08351741302778071},{x:.0754529644913056,y:.08234100299139627},{x:.07710881500204132,y:.08098994152260804},{x:.14910981500204132,y:.03317594152260801},{x:.1504928100364302,y:.03244176283843531},{x:.15177178054792087,y:.031538475488709236},{x:.15438005907773164,y:.030378172358910993},{x:.15690151209615905,y:.029039630272177964},{x:.1584011644246711,y:.028589367572161194},{x:.15983178249634203,y:.027952951404511282},{x:.24949378249634205,y:-.0017990485954887184},{x:.251605077566582,y:-.002276091838878668},{x:.25365804064979064,y:-.002962007073194259},{x:.2558970148670134,y:-.0032458471890824472},{x:.2580984148155577,y:-.003743249464233246},{x:.2602622084630055,y:-.003799233220341744},{x:.26240953986016613,y:-.0040714555567724145},{x:.33848653986016614,y:-.006196455556772458},{x:.34211630259529946,y:-.0059410451417675775},{x:.3457527120689106,y:-.005810898556388326},{x:.34651004211407876,y:-.005631877045722989},{x:.3472863241290845,y:-.005577253499755554},{x:.35079651389094996,y:-.004618619143417753},{x:.3543376604369356,y:-.0037815449929937683},{x:.4535096604369356,y:.03022045500700621},{x:.45591274590665615,y:.03131812424947078},{x:.4583949217344816,y:.03222283453480715},{x:.45991547545056405,y:.03314647083206772},{x:.461533744189149,y:.033885655452327273},{x:.46367651039942226,y:.035431052006208004},{x:.4659344916938285,y:.03680262701864639},{x:.5338604916938285,y:.08780462701864639},{x:.5368034713408607,y:.09050382186837246},{x:.5397962541268131,y:.09314768896709699},{x:.5400513850489728,y:.09348269124727963},{x:.5403617177400871,y:.09376731720532937},{x:.5427215620660051,y:.09698879462990716},{x:.5451410464862535,y:.10016572352111452},{x:.5453259194365666,y:.1005440624001799},{x:.5455747614022292,y:.10088376225489704},{x:.547260782913003,y:.10450372268352329},{x:.5490139895381407,y:.10809162577156875},{x:.5802599895381407,y:.1920326257715688},{x:.5808621946470703,y:.19431314395649216},{x:.5816704362178704,y:.19652903198349428},{x:.5819856183913868,y:.19856748893015458},{x:.5825122482529622,y:.20056180773987195},{x:.5826579751325236,y:.20291599079595712},{x:.5830183882594349,y:.20524698126417715},{x:.5829298310737253,y:.20730775882392333},{x:.5830572695913885,y:.20936649774620245},{x:.5827409180393249,y:.21170387573884492},{x:.582639652248002,y:.21406038999182395},{x:.570412652248002,y:.30012638999182395},{x:.5703409363500996,y:.30042034316527866},{x:.5703238989157716,y:.30072243812390526},{x:.5692961437829783,y:.3047027979582916},{x:.5683217827960937,y:.30869656381164773},{x:.5681940974797931,y:.30897087767968473},{x:.5681184516122305,y:.3092638441298401},{x:.5663339148242972,y:.3129672173863048},{x:.5645991308441736,y:.31669415574996157},{x:.5644203829845738,y:.31693828858446854},{x:.5642890357120441,y:.31721086798977133},{x:.5618162960169492,y:.32049493611094637},{x:.5593877558190667,y:.3238118228336772},{x:.5591648145961691,y:.32401639274673566},{x:.5589828135206953,y:.3242581100335041},{x:.5032838135206953,y:.3848241100335041},{x:.5011622073766187,y:.38671918495638496},{x:.4991781602202921,y:.38875783119234486},{x:.4978799327840818,y:.3896509997457094},{x:.496704700181234,y:.39070074870143656},{x:.4942541493273608,y:.39214550546522026},{x:.4919105049301597,y:.39375791128677606},{x:.42072451102124153,y:.4330589294870645},{x:.4777200661568854,y:.4633968522602595},{x:.4805213378044988,y:.46526159042857346},{x:.48340658539474834,y:.46699355971902134},{x:.4841865730327025,y:.4677014480666941},{x:.48506339053858555,y:.46828512408085676},{x:.487447044167244,y:.4706605328159332},{x:.4899389620874836,y:.4729221066835925},{x:.4905658603159866,y:.4737685611946159},{x:.49131196047780046,y:.47451208064740324},{x:.493186393615322,y:.4773068743236967},{x:.4951892188573616,y:.48001114175313947},{x:.5250762188573616,y:.5299501417531395},{x:.5263287500632193,y:.5326029758232522},{x:.5277533683388757,y:.5351675080991},{x:.5282078804872482,y:.5365829335183069},{x:.5288425912810938,y:.5379272372855163},{x:.5295535131980511,y:.5407734546091212},{x:.5304504424054924,y:.5435666393545394},{x:.5306200854295579,y:.5450435386925929},{x:.5309803397786421,y:.5464858379730204},{x:.5311223320761199,y:.5494160600145488},{x:.5314571037289079,y:.5523305567062068},{x:.5328161037289079,y:.6362725567062067},{x:.5325682225912138,y:.6392892202473488},{x:.5325070847315841,y:.6423154334158161},{x:.5322077563487247,y:.6436760218476847},{x:.5320936668790056,y:.6450644677251389},{x:.5312620268462096,y:.647974807711247},{x:.530611678831884,y:.6509309456375182},{x:.530052664324664,y:.6522069946735811},{x:.5296698946987799,y:.6535465042014387},{x:.5282864552309536,y:.656238677898982},{x:.5270718895714029,y:.659011137860374},{x:.493108889571403,y:.7195761378603741},{x:.49086599866607616,y:.7227903647520136},{x:.4886941713149356,y:.7260530293196586},{x:.4883443495413535,y:.7264040725827037},{x:.48806074906628455,y:.7268104928286833},{x:.4852338901214668,y:.7295253929429124},{x:.4824672795427586,y:.7323016638284542},{x:.4820556943532359,y:.7325777150511769},{x:.48169825452511067,y:.7329209983380867},{x:.4783960621447291,y:.7350322395860499},{x:.4751409876314614,y:.737215426256307},{x:.4058559876314614,y:.774404426256307},{x:.40535390944732597,y:.7746134197603937},{x:.4048950878292554,y:.7749053846735706},{x:.40128606998249994,y:.7763066859700772},{x:.39771184087056327,y:.7777944834687843},{x:.3971786373679402,y:.7779015106266721},{x:.3966716723496766,y:.778098353858693},{x:.39285862044769176,y:.7787686450898307},{x:.3890628142527955,y:.7795305574683767},{x:.38851897614326597,y:.7795315052864096},{x:.3879833501061526,y:.7796256622622586},{x:.29017035010615255,y:.7870576622622585},{x:.28883979914978264,y:.7870279344512828},{x:.28751770557027906,y:.7871806372910648},{x:.2844390802539456,y:.7869296114679608},{x:.28135100845003463,y:.7868606162788429},{x:.2800518232654171,y:.7865718820648824},{x:.2787253424971381,y:.7864637231002555},{x:.20264834249713812,y:.7726567231002556},{x:.20090732012312768,y:.7721604024311715},{x:.19912055356042774,y:.7718689262507037},{x:.1966754417776232,y:.7709540028332816},{x:.19416478523538352,y:.7702382792713757},{x:.19255404347725652,y:.7694118386491953},{x:.19085847331495095,y:.7687773822377194},{x:.12157447331495094,y:.7347753822377193},{x:.11864840230662128,y:.7329636093328938},{x:.1156466869822177,y:.7312801255296781},{x:.11490452792065226,y:.7306454666247165},{x:.11407427694169714,y:.7301313894804525},{x:.11155788892673538,y:.7277835811487093},{x:.10894228211787771,y:.7255468394054793},{x:.1083381992447159,y:.7247795872431081},{x:.10762419278113186,y:.7241134140161837},{x:.10561419113974596,y:.7213197952150451},{x:.1034852091492498,y:.7186157522626143},{x:.05457920914924981,y:.6421127522626143},{x:.05400544809690788,y:.6409849569633866},{x:.05327967340990527,y:.639948436299892},{x:.05200937551205521,y:.6370614399018406},{x:.05057918033015655,y:.6342502218929852},{x:.050236465883645505,y:.633032161635733},{x:.04972685190376166,y:.6318739658087451},{x:.04904418748077848,y:.6287946194110116},{x:.04818991452487371,y:.6257584009293389},{x:.04809141700817653,y:.6244968850866522},{x:.047817547914863534,y:.6232615229122788},{x:.04774875137767971,y:.6201081640700103},{x:.04750322987838258,y:.6169636252890404},{x:.04765273449582791,y:.6157071332072875},{x:.04762513492475421,y:.6144420789610904},{x:.04817285008571219,y:.6113358894861711},{x:.048545515296550656,y:.608203873267779},{x:.04893727666953319,y:.607000691233013},{x:.04915700725673716,y:.6057545602402229},{x:.06817600725673716,y:.537751560240223},{x:.0695259178796919,y:.5342803033966695},{x:.07076883034011841,y:.5307693133112962},{x:.07112252784165454,y:.530174666206544},{x:.07137329591617819,y:.5295298232221028},{x:.07337447700044117,y:.5263886201035727},{x:.07527846743280868,y:.5231875729003385},{x:.0757413786311829,y:.522673354732434},{x:.07611313089295507,y:.5220898246495332},{x:.07868867817173447,y:.5193993899302627},{x:.08118057729149615,y:.5166313000580217},{x:.13823757729149616,y:.46456630005802163},{x:.1415344063491032,y:.46210392848613274},{x:.14479841194755694,y:.45959821041612353},{x:.17870395742216458,y:.4385038845164132},{x:.16590813892329467,y:.43401753680148847},{x:.1630836262780146,y:.43270367241359486},{x:.16018787852971583,y:.4315553012665589},{x:.15909238677042803,y:.43084708753997614},{x:.15790960896480868,y:.43029690071741367},{x:.15539569076452509,y:.4284572467838155},{x:.15277962009410193,y:.4267660089056696},{x:.07398562009410191,y:.3640750089056696},{x:.07334669706368892,y:.36345515994886657},{x:.07261876409580822,y:.3629427646304707},{x:.07018582297292754,y:.3603886489381779},{x:.067654053855944,y:.3579324619307791},{x:.06714833408498834,y:.3571998754981266},{x:.06653435151263618,y:.35655531303498644},{x:.06464644192410274,y:.3535756306924294},{x:.06264249835499126,y:.3506727149773525},{x:.06228941637067996,y:.3498555439546183},{x:.061812979199786275,y:.3491035845207174},{x:.026491979199786284,y:.27897658452071744},{x:.026206182636496978,y:.2782362375154344},{x:.02580526951533789,y:.27755135647970497},{x:.024619992088609113,y:.2741272608068926},{x:.023315086847465263,y:.27074694483548933},{x:.02317921632066564,y:.26996506724675395},{x:.022919620294515476,y:.2692151317381758},{x:.022425125568608657,y:.2656255929487299},{x:.02180476064715109,y:.2620556544171705},{x:.02182403758498896,y:.26126229336223583},{x:.021715734783549545,y:.26047612298183487},{x:.018998734783549534,y:.19034712298183487}],[{x:.10940940002433477,y:.19920410482166873},{x:.1112697837122767,y:.2472228194523932},{x:.137749803196691,y:.2997967648781603},{x:.20286290613296581,y:.3516028102138205},{x:.27392321813344717,y:.3765172983642545},{x:.30180455045059645,y:.38547932587505673},{x:.3589974388819276,y:.364332623176267},{x:.44199758150171664,y:.31850914110336725},{x:.48327372240847105,y:.27362627516037924},{x:.4919267227459848,y:.21271770175329152},{x:.46927072007314496,y:.15185335046477932},{x:.41758736799183827,y:.11304708595854013},{x:.33285528741119674,y:.08399594043457195},{x:.2715476841223936,y:.0857083982994813},{x:.19388634557978268,y:.1114782912788902},{x:.13622191473335832,y:.14977174687660325},{x:.10940940002433477,y:.19920410482166873}],[{x:.1412545940070051,y:.610603192179028},{x:.17253143522148345,y:.6595291354872365},{x:.22488466829434647,y:.6852221473073319},{x:.28911227954018853,y:.6968786351876549},{x:.37167628924266627,y:.6906052797020977},{x:.4210229734590171,y:.664118250196117},{x:.4426312796779887,y:.6255849325813003},{x:.4416638895166663,y:.5658316839266069},{x:.4243877259953326,y:.5369644730960824},{x:.3411654121752423,y:.49266641996418925},{x:.3038587353431559,y:.48067475972705925},{x:.2482367446999157,y:.5012406330709052},{x:.1958501022844071,y:.5338329684082593},{x:.1513751879049268,y:.5744167077770947},{x:.1412545940070051,y:.610603192179028}]],9:[[{x:.04617702144416433,y:.5785043710151274},{x:.046308257010348054,y:.5777836867379841},{x:.04632014162646953,y:.5770512474182771},{x:.047097404355444614,y:.5734500590446777},{x:.04775742235616295,y:.5698255492446179},{x:.06775742235616294,y:.499825549244618},{x:.06870401207934061,y:.497431122678351},{x:.06945142103699212,y:.4949672455435709},{x:.07032179921115676,y:.4933388825112154},{x:.07100061044171635,y:.4916218095236955},{x:.07239614115864691,y:.4894580616864063},{x:.07360986744638548,y:.48718733951411786},{x:.07478119941633177,y:.4857600673791044},{x:.07578195180149752,y:.48420841696912487},{x:.07757279404935197,y:.4823584994767568},{x:.07920619484660538,y:.4803681948466053},{x:.1292061948466054,y:.43036819484660543},{x:.1324047212320044,y:.4277432320802026},{x:.1355710052680468,y:.42507946670648067},{x:.13581237417673697,y:.4249466435819557},{x:.13602533951411794,y:.4247718674463855},{x:.13967451194327588,y:.422821344145996},{x:.14329963156393744,y:.42082647364918746},{x:.21329963156393744,y:.39082647364918743},{x:.21510775104315333,y:.39025382151681987},{x:.2168404136401385,y:.3894823898342746},{x:.21930272871556003,y:.3889252240779052},{x:.22170947225776405,y:.3881629808537447},{x:.22359456811709633,y:.38795407868297094},{x:.22544443694348562,y:.38753549554788497},{x:.30544443694348566,y:.37753549554788496},{x:.30933066171136914,y:.37743373006124875},{x:.3132134481214367,y:.3772411973248817},{x:.31373545479679327,y:.3773183852372503},{x:.314262956584918,y:.37730457196617717},{x:.3180943620951528,y:.37796292671622445},{x:.321940103126635,y:.37853158749346005},{x:.39912055139763536,y:.39782669956121014},{x:.3920145202755848,y:.3793136184800785},{x:.3919728818872528,y:.3791621799808353},{x:.39190347676812315,y:.3790212888743934},{x:.33928123709710245,y:.23902627390054626},{x:.29593066247424293,y:.13853176000209894},{x:.2601678276974797,y:.06104561798577861},{x:.25727396725620644,y:.05271224015242973},{x:.25606147289685455,y:.04397442167208486},{x:.2565769400976792,y:.035167952008718584},{x:.2588005597432301,y:.02663125885276897},{x:.2626468793775489,y:.018692402534786497},{x:.2679680870941297,y:.011656468850909336},{x:.274559691864592,y:.005793844786811796},{x:.2821683820142214,y:.0013298276974796769},{x:.29050175984757026,y:-.0015640327437935753},{x:.29923957832791515,y:-.002776527103145486},{x:.30804604799128144,y:-.002261059902320825},{x:.31658274114723106,y:-3744025676995222e-20},{x:.32452159746521353,y:.003808879377548882},{x:.3315575311490907,y:.009130087094129706},{x:.33742015521318824,y:.015721691864591977},{x:.34188417230252033,y:.023330382014221395},{x:.3778841723025203,y:.10133038201422136},{x:.3780704961344211,y:.10186693411204945},{x:.37834550457920557,y:.10236389998544072},{x:.42234550457920556,y:.2043638999854408},{x:.4226728981736059,y:.20538920106595157},{x:.42314852323187685,y:.20635471112560658},{x:.47609350933819694,y:.3472083534084579},{x:.5496013805841499,y:.5387157021808093},{x:.5512752235949963,y:.542063388202502},{x:.5520259437659378,y:.5440252139743784},{x:.5529745491659372,y:.5458993775022888},{x:.553598518494472,y:.5481347580495968},{x:.5544279630456541,y:.5503023109672317},{x:.5547815251174404,y:.5523728990468965},{x:.5553462721645,y:.554396114781092},{x:.555522150986547,y:.5567102734952235},{x:.5559127893965689,y:.5589979940959194},{x:.5558556061770612,y:.5610977729446709},{x:.5560147919588762,y:.5631922898391183},{x:.5557358213499382,y:.5654962948984841},{x:.5556726416037749,y:.5678162673625252},{x:.5552069106120301,y:.5698645436567753},{x:.5549544177082778,y:.5719498706018395},{x:.5349544177082779,y:.6619498706018395},{x:.5345092452033302,y:.663307558548854},{x:.5342480120020212,y:.6647122835522489},{x:.5331378863550271,y:.6674899313564284},{x:.5322058990004909,y:.6703323081518522},{x:.5315044085816177,y:.6715770596583215},{x:.5309741466497647,y:.6729038291953012},{x:.5293434595512297,y:.6754115305058349},{x:.5278748598680685,y:.6780174701150343},{x:.5269440094186665,y:.6791014500786302},{x:.5261650964249364,y:.6802992771399491},{x:.4861650964249363,y:.7302992771399491},{x:.4855393928217795,y:.7309407996522789},{x:.48502142797480674,y:.7316720783612058},{x:.48246447922773295,y:.7340934525762789},{x:.48000567043073006,y:.7366144244690945},{x:.4792668347133476,y:.7371215515888083},{x:.4786161570168623,y:.7377377290536072},{x:.47563595264764597,y:.7396137412876539},{x:.4727325719538572,y:.7416065836124539},{x:.4719089971645242,y:.7419598267287414},{x:.4711506117974981,y:.7424372235949962},{x:.4111506117974981,y:.7724372235949962},{x:.40814803697660645,y:.7735862009991664},{x:.4052110607504687,y:.7748937847545917},{x:.4040364518244048,y:.77515955677446},{x:.40291168903276836,y:.7755899630456542},{x:.39974265347336024,y:.7761310898824948},{x:.39660701348596056,y:.7768405731449995},{x:.3166070134859606,y:.7868395731449994},{x:.31542693671630134,y:.7868704603456931},{x:.31426350899694466,y:.7870703881908964},{x:.3110259999999998,y:.7869856499834279},{x:.3077884910030554,y:.7870703881908964},{x:.3066250632836987,y:.7868704603456931},{x:.30544498651403945,y:.7868395731449994},{x:.22544498651403946,y:.7768405731449995},{x:.22359484289355938,y:.7764219517671516},{x:.22170947225776405,y:.7762130191462554},{x:.21930299190993624,y:.775450859278766},{x:.2168409392495313,y:.7748937847545917},{x:.21510801459933976,y:.7741222619544408},{x:.21329963156393744,y:.7735495263508126},{x:.14329963156393744,y:.7435495263508126},{x:.1396745119432796,y:.741554655854006},{x:.13602533951411788,y:.7396041325536146},{x:.13581237417673678,y:.7394293564180442},{x:.1355710052680468,y:.7392965332935194},{x:.13240472123200803,y:.7366327679198006},{x:.12920619484660534,y:.7340078051533947},{x:.07920619484660535,y:.6840078051533947},{x:.07757279404935197,y:.6820175005232432},{x:.0757819518014975,y:.6801675830308751},{x:.07478119941633177,y:.6786159326208956},{x:.07360986744638545,y:.6771886604858821},{x:.07239614115864686,y:.6749179383135936},{x:.07100061044171635,y:.6727541904763045},{x:.07032179921115676,y:.6710371174887846},{x:.06945142103699209,y:.669408754456429},{x:.06870401207934061,y:.666944877321649},{x:.06775742235616294,y:.664550450755382},{x:.04775742235616295,y:.5945504507553819},{x:.0470974043554446,y:.590925940955322},{x:.04632014162646953,y:.5873247525817227},{x:.046308257010348054,y:.5865923132620157},{x:.04617702144416433,y:.5858716289848723},{x:.0462367922883029,y:.5821879999999999},{x:.04617702144416433,y:.5785043710151274}],[{x:.13782670643108905,y:.5821879999999999},{x:.15109114488080894,y:.6286135345740196},{x:.18671787059591238,y:.6642402602891231},{x:.24291204200407931,y:.688323476606909},{x:.311026,y:.696836869931924},{x:.377796042530131,y:.6884914492411893},{x:.4220611757635009,y:.6663588826245044},{x:.4493630453483168,y:.6322315456434845},{x:.46363172164975686,y:.5680225022870041},{x:.4540425513192988,y:.5488441616260881},{x:.42235697647551157,y:.5171585867823008},{x:.37255000597497323,y:.48395393978194207},{x:.30826669745594837,y:.4678831126521858},{x:.24291230161158606,y:.4760524121327311},{x:.1867178705959123,y:.500135739710877},{x:.15109114488080894,y:.5357624654259804},{x:.13782670643108905,y:.5821879999999999}]],"!":[[{x:.20646600000000004,y:.05103000000000002},{x:.20733066238185466,y:.04225093550927423},{x:.20989142103699213,y:.03380924554357098},{x:.2140498674463855,y:.026029339514117927},{x:.21964619484660539,y:.019210194846605383},{x:.22646533951411793,y:.013613867446385479},{x:.23424524554357098,y:.009455421036992116},{x:.24268693550927425,y:.006894662381854655},{x:.251466,y:.0060300000000000215},{x:.350587,y:.0060300000000000215},{x:.3593660644907258,y:.006894662381854655},{x:.36780775445642905,y:.009455421036992116},{x:.3755876604858821,y:.013613867446385479},{x:.38240680515339465,y:.019210194846605383},{x:.3880031325536145,y:.026029339514117927},{x:.3921615789630079,y:.03380924554357098},{x:.39472233761814535,y:.04225093550927425},{x:.39558699999999997,y:.05103000000000002},{x:.39472233761814535,y:.05980906449072579},{x:.3921615789630079,y:.06825075445642906},{x:.3880031325536145,y:.07603066048588211},{x:.38240680515339465,y:.08284980515339466},{x:.3755876604858821,y:.08844613255361455},{x:.36780775445642905,y:.09260457896300792},{x:.3593660644907258,y:.09516533761814538},{x:.350587,y:.09603000000000002},{x:.251466,y:.09603000000000002},{x:.24268693550927425,y:.09516533761814538},{x:.23424524554357098,y:.09260457896300792},{x:.22646533951411793,y:.08844613255361455},{x:.21964619484660539,y:.08284980515339466},{x:.2140498674463855,y:.07603066048588211},{x:.20989142103699213,y:.06825075445642906},{x:.20733066238185466,y:.05980906449072579},{x:.20646600000000004,y:.05103000000000002}],[{x:.25602600000000003,y:.25043400000000005},{x:.25689066238185465,y:.24165493550927428},{x:.2594514210369921,y:.233213245543571},{x:.2636098674463855,y:.22543333951411795},{x:.26920619484660535,y:.2186141948466054},{x:.27602533951411795,y:.2130178674463855},{x:.283805245543571,y:.20885942103699215},{x:.2922469355092743,y:.20629866238185468},{x:.301026,y:.20543400000000006},{x:.3098050644907258,y:.20629866238185468},{x:.3182467544564291,y:.20885942103699215},{x:.32602666048588214,y:.2130178674463855},{x:.3328458051533947,y:.2186141948466054},{x:.33844213255361455,y:.22543333951411795},{x:.34260057896300794,y:.233213245543571},{x:.3451613376181454,y:.24165493550927428},{x:.346026,y:.25043400000000005},{x:.346026,y:.729004},{x:.3451613376181454,y:.7377830644907257},{x:.34260057896300794,y:.746224754456429},{x:.33844213255361455,y:.7540046604858821},{x:.3328458051533947,y:.7608238051533946},{x:.32602666048588214,y:.7664201325536145},{x:.3182467544564291,y:.7705785789630079},{x:.3098050644907258,y:.7731393376181454},{x:.301026,y:.774004},{x:.2922469355092743,y:.7731393376181454},{x:.283805245543571,y:.7705785789630079},{x:.27602533951411795,y:.7664201325536145},{x:.26920619484660535,y:.7608238051533946},{x:.2636098674463855,y:.7540046604858821},{x:.2594514210369921,y:.746224754456429},{x:.25689066238185465,y:.7377830644907257},{x:.25602600000000003,y:.729004},{x:.25602600000000003,y:.25043400000000005}]],\'"\':[[{x:.12004,y:.476978},{x:.12090466238185463,y:.4681989355092742},{x:.1234654210369921,y:.459757245543571},{x:.12762386744638546,y:.4519773395141179},{x:.13322019484660536,y:.44515819484660535},{x:.1400393395141179,y:.4395618674463855},{x:.14781924554357095,y:.4354034210369921},{x:.15626093550927422,y:.43284266238185465},{x:.16504,y:.43197800000000003},{x:.17381906449072576,y:.43284266238185465},{x:.18226075445642903,y:.4354034210369921},{x:.19004066048588208,y:.4395618674463855},{x:.19685980515339463,y:.44515819484660535},{x:.20245613255361453,y:.4519773395141179},{x:.2066145789630079,y:.459757245543571},{x:.20917533761814536,y:.4681989355092742},{x:.21004,y:.476978},{x:.21004,y:.729004},{x:.20917533761814536,y:.7377830644907257},{x:.2066145789630079,y:.746224754456429},{x:.20245613255361453,y:.7540046604858821},{x:.19685980515339463,y:.7608238051533946},{x:.19004066048588208,y:.7664201325536145},{x:.18226075445642903,y:.7705785789630079},{x:.17381906449072576,y:.7731393376181454},{x:.16504,y:.774004},{x:.15626093550927422,y:.7731393376181454},{x:.14781924554357095,y:.7705785789630079},{x:.1400393395141179,y:.7664201325536145},{x:.13322019484660536,y:.7608238051533946},{x:.12762386744638546,y:.7540046604858821},{x:.1234654210369921,y:.746224754456429},{x:.12090466238185463,y:.7377830644907257},{x:.12004,y:.729004},{x:.12004,y:.476978}],[{x:.392013,y:.476978},{x:.3928776623818546,y:.4681989355092742},{x:.39543842103699206,y:.459757245543571},{x:.39959686744638545,y:.4519773395141179},{x:.4051931948466053,y:.44515819484660535},{x:.4120123395141179,y:.4395618674463855},{x:.419792245543571,y:.4354034210369921},{x:.42823393550927424,y:.43284266238185465},{x:.437013,y:.43197800000000003},{x:.4457920644907258,y:.43284266238185465},{x:.45423375445642905,y:.4354034210369921},{x:.4620136604858821,y:.4395618674463855},{x:.46883280515339465,y:.44515819484660535},{x:.4744291325536145,y:.4519773395141179},{x:.4785875789630079,y:.459757245543571},{x:.48114833761814535,y:.4681989355092742},{x:.48201299999999997,y:.476978},{x:.48201299999999997,y:.729004},{x:.48114833761814535,y:.7377830644907257},{x:.4785875789630079,y:.746224754456429},{x:.4744291325536145,y:.7540046604858821},{x:.46883280515339465,y:.7608238051533946},{x:.4620136604858821,y:.7664201325536145},{x:.45423375445642905,y:.7705785789630079},{x:.4457920644907258,y:.7731393376181454},{x:.437013,y:.774004},{x:.42823393550927424,y:.7731393376181454},{x:.419792245543571,y:.7705785789630079},{x:.4120123395141179,y:.7664201325536145},{x:.4051931948466053,y:.7608238051533946},{x:.39959686744638545,y:.7540046604858821},{x:.39543842103699206,y:.746224754456429},{x:.3928776623818546,y:.7377830644907257},{x:.392013,y:.729004},{x:.392013,y:.476978}]],"#":[[{x:-.04343582416242281,y:.17932596542766122},{x:-.043155600373289436,y:.1705088746946064},{x:-.04116063193533153,y:.16191587083690517},{x:-.037527584366828626,y:.15387717817379684},{x:-.03239607364840174,y:.1467017191561739},{x:-.025963300859175642,y:.14066524265003977},{x:-.01847647384989975,y:.13599972706223024},{x:-.010223307183879607,y:.1328844655403335},{x:-.0015209654276611437,y:.13143917583757725},{x:.007296125305393629,y:.13171939962671061},{x:.11028337660265361,y:.14517801654688708},{x:.10171449233133083,y:.05447855391336175},{x:.10174959121806887,y:.04565708110917159},{x:.10350499965956604,y:.03701195788446062},{x:.10691325829386003,y:.02887541147651351},{x:.11184338965300836,y:.02156012480075985},{x:.11810593155372849,y:.015347220221688843},{x:.1254602180228497,y:.01047545617803717},{x:.13362362795569505,y:.007132051829885598},{x:.14228244608663826,y:.005445492331330834},{x:.15110391889082841,y:.0054805912180688685},{x:.1597490421155394,y:.0072359996595660475},{x:.1678855885234865,y:.010644258293860037},{x:.17520087519924016,y:.015574389653008364},{x:.18141377977831116,y:.02183693155372849},{x:.18628554382196283,y:.029191218022849703},{x:.18962894817011441,y:.03735462795569504},{x:.19131550766866917,y:.04601344608663827},{x:.2018142041879224,y:.1571394809935999},{x:.36570083500909,y:.17855657247605955},{x:.35397849233133083,y:.05447855391336175},{x:.35401359121806886,y:.04565708110917159},{x:.35576899965956604,y:.03701195788446062},{x:.35917725829386,y:.02887541147651351},{x:.3641073896530084,y:.02156012480075985},{x:.3703699315537285,y:.015347220221688843},{x:.37772421802284967,y:.01047545617803717},{x:.38588762795569503,y:.007132051829885598},{x:.39454644608663825,y:.005445492331330834},{x:.4033679188908284,y:.0054805912180688685},{x:.4120130421155394,y:.0072359996595660475},{x:.4201495885234865,y:.010644258293860037},{x:.42746487519924015,y:.015574389653008364},{x:.4336777797783111,y:.02183693155372849},{x:.4385495438219628,y:.029191218022849703},{x:.44189294817011443,y:.03735462795569504},{x:.44357950766866916,y:.04601344608663827},{x:.45723166259435877,y:.19051803692277236},{x:.5748861253053936,y:.20589339962671058},{x:.5834791291630949,y:.20788836806466848},{x:.5915178218262032,y:.2115214156331714},{x:.5986932808438261,y:.21665292635159827},{x:.6047297573499603,y:.22308569914082438},{x:.6093952729377698,y:.23057252615010027},{x:.6125105344596665,y:.2388256928161204},{x:.6139558241624228,y:.24752803457233888},{x:.6136756003732894,y:.25634512530539366},{x:.6116806319353315,y:.2649381291630949},{x:.6080475843668286,y:.2729768218262032},{x:.6029160736484017,y:.2801522808438262},{x:.5964833008591757,y:.2861887573499603},{x:.5889964738498997,y:.29085427293776983},{x:.5807433071838796,y:.29396953445966656},{x:.5720409654276611,y:.2954148241624228},{x:.5632238746946063,y:.2951346003732895},{x:.4659139564059225,y:.28241791072205386},{x:.48521785958998953,y:.48674482074743597},{x:.6064180682130128,y:.5025833921657807},{x:.6150110746232834,y:.5045783496089273},{x:.6230497719348954,y:.5082113868918628},{x:.6302252375183169,y:.5133428884292346},{x:.6362617222552247,y:.5197756534947408},{x:.640927247422479,y:.5272624745344501},{x:.6440425195043586,y:.5355156372144642},{x:.645487820341822,y:.544217977121417},{x:.6452076078342193,y:.5530350682130128},{x:.6432126503910727,y:.5616280746232835},{x:.6395796131081373,y:.5696667719348955},{x:.6344481115707654,y:.576842237518317},{x:.6280153465052593,y:.5828787222552247},{x:.6205285254655499,y:.587544247422479},{x:.6122753627855358,y:.5906595195043587},{x:.603573022878583,y:.592104820341822},{x:.5947559317869872,y:.5918246078342193},{x:.493900150869001,y:.5786446677402959},{x:.5066445076686692,y:.7135404460866382},{x:.5066094087819312,y:.7223619188908285},{x:.5048540003404339,y:.7310070421155394},{x:.50144574170614,y:.7391435885234865},{x:.4965156103469916,y:.7464588751992401},{x:.4902530684462715,y:.7526717797783111},{x:.4828987819771503,y:.7575435438219629},{x:.47473537204430494,y:.7608869481701144},{x:.4660765539133617,y:.7625735076686692},{x:.45725508110917157,y:.7625384087819311},{x:.44860995788446056,y:.760783000340434},{x:.4404734114765135,y:.7573747417061399},{x:.43315812480075977,y:.7524446103469916},{x:.4269452202216888,y:.7461820684462716},{x:.42207345617803715,y:.7388277819771503},{x:.41873005182988554,y:.730664372044305},{x:.4170434923313308,y:.7220055539133617},{x:.40236933467780645,y:.5666833238969633},{x:.23848272425781383,y:.5452664483557571},{x:.25438050766866915,y:.7135404460866382},{x:.2543454087819311,y:.7223619188908285},{x:.25259000034043394,y:.7310070421155394},{x:.24918174170614,y:.7391435885234865},{x:.2442516103469916,y:.7464588751992401},{x:.23798906844627152,y:.7526717797783111},{x:.2306347819771503,y:.7575435438219629},{x:.22247137204430495,y:.7608869481701144},{x:.21381255391336174,y:.7625735076686692},{x:.20499108110917158,y:.7625384087819311},{x:.1963459578844606,y:.760783000340434},{x:.18820941147651346,y:.7573747417061399},{x:.1808941248007598,y:.7524446103469916},{x:.17468122022168883,y:.7461820684462716},{x:.16980945617803714,y:.7388277819771503},{x:.16646605182988555,y:.730664372044305},{x:.16477949233133082,y:.7220055539133617},{x:.14695190806661926,y:.5333051045124245},{x:.02716793178698713,y:.5176516078342193},{x:.01857492537671658,y:.5156566503910727},{x:.01053622806510461,y:.5120236131081373},{x:.0033607624816830023,y:.5068921115707654},{x:-.0026757222552247634,y:.5004593465052593},{x:-.0073412474224789775,y:.4929725254655499},{x:-.010456519504358698,y:.48471936278553585},{x:-.011901820341822023,y:.476017022878583},{x:-.011621607834219276,y:.4671999317869871},{x:-.00962665039107264,y:.45860692537671655},{x:-.005993613108137223,y:.45056822806510455},{x:-.0008621115707654614,y:.44339276248168297},{x:.005570653494740684,y:.4373562777447752},{x:.013057474534450029,y:.432690752577521},{x:.02131063721446411,y:.42957548049564126},{x:.03001297712141698,y:.42813017965817796},{x:.03883006821301287,y:.4284103921657807},{x:.13826961678760774,y:.4414052575195645},{x:.1189656704142173,y:.23707789034616855},{x:-.004366125305393629,y:.2209606003732895},{x:-.012959129163094893,y:.21896563193533158},{x:-.0209978218262032,y:.2153325843668287},{x:-.028173280843826164,y:.2102010736484018},{x:-.034209757349960276,y:.2037683008591757},{x:-.03887527293776982,y:.1962814738498998},{x:-.041990534459666565,y:.18802830718387967},{x:-.04343582416242281,y:.17932596542766122}],[{x:.2104964979994861,y:.24903935479288136},{x:.22980043297880234,y:.4533666013628972},{x:.39368704339879496,y:.4747834769041034},{x:.3743831288206537,y:.27045644627534104},{x:.2104964979994861,y:.24903935479288136}]],$:[[{x:.030517420733400163,y:.165091535964518},{x:.03086584266660257,y:.1562768767808978},{x:.032927224468652025,y:.14769956254897784},{x:.06950822446865203,y:.04228956254897785},{x:.0704003940010533,y:.04035550336969822},{x:.07109145007989037,y:.03834080913001754},{x:.07224350295250744,y:.03635998272422403},{x:.073203348392932,y:.034279214644477654},{x:.0744556913660193,y:.03255637151138059},{x:.07552651634405921,y:.03071520740954014},{x:.07704287290513265,y:.02899719639360223},{x:.07839021289928177,y:.02714366624511229},{x:.07995460247492134,y:.0256982470536212},{x:.08136404514878363,y:.02410136799351792},{x:.08318643266605391,y:.022712194567306505},{x:.08486948969354943,y:.02115713247420773},{x:.0866858072576693,y:.0200446838732511},{x:.08837970353582197,y:.01875345702162473},{x:.17373770353582196,y:-.03394954297837521},{x:.17475219432147746,y:-.03444582628601368},{x:.17568351020275566,y:-.03508468417701866},{x:.17870701554383397,y:-.03638050305696308},{x:.18166188368778688,y:-.037826008286632525},{x:.18275370138776084,y:-.03811483831561822},{x:.18379175728720304,y:-.038559730016208084},{x:.18700996854351615,y:-.03924079346911771},{x:.19019006380536974,y:-.04008205754340442},{x:.19131725047775072,y:-.0401523347177012},{x:.19242215448928965,y:-.04038616328932037},{x:.262121,y:-.048110644533924524},{x:.262121,y:-.08350199999999997},{x:.2629856623818546,y:-.09228106449072573},{x:.26554642103699205,y:-.100722754456429},{x:.26970486744638544,y:-.10850266048588206},{x:.2753011948466053,y:-.1153218051533946},{x:.2821203395141179,y:-.1209181325536145},{x:.28990024554357097,y:-.12507657896300786},{x:.29834193550927424,y:-.12763733761814533},{x:.307121,y:-.12850199999999995},{x:.3159000644907258,y:-.12763733761814533},{x:.32434175445642904,y:-.12507657896300786},{x:.3321216604858821,y:-.1209181325536145},{x:.33894080515339464,y:-.1153218051533946},{x:.3445371325536145,y:-.10850266048588206},{x:.3486955789630079,y:-.100722754456429},{x:.35125633761814534,y:-.09228106449072573},{x:.35212099999999996,y:-.08350199999999997},{x:.35212099999999996,y:-.05796857189257534},{x:.3537665284657676,y:-.05798865052825875},{x:.3565834008023822,y:-.05822276473922817},{x:.35816715833059226,y:-.05804234673933715},{x:.35976104048452195,y:-.05806179518994546},{x:.3625398346041163,y:-.05754422155704884},{x:.36534825494544937,y:-.05722429279787242},{x:.3668663832111493,y:-.05673836571308556},{x:.3684334335709129,y:-.056446489484502926},{x:.37105786033397337,y:-.05539674504422484},{x:.37374990266128777,y:-.05453506799769968},{x:.49568890266128773,y:-.0018330679976996528},{x:.4995437197067623,y:.0003036028478311586},{x:.5033988605511543,y:.0024396894158641644},{x:.5034014762743246,y:.0024419030290919073},{x:.503404473339876,y:.00244356426035406},{x:.5067683773534712,y:.005291217073469004},{x:.510132712931077,y:.008138360005776092},{x:.5101348465393426,y:.008141041387321917},{x:.510137461926978,y:.00814325539697476},{x:.5128811799638975,y:.011592456477016289},{x:.5156254207452635,y:.015041241667436683},{x:.5156269902452553,y:.015044287773311453},{x:.5156291234470946,y:.015046969478205698},{x:.5176472159618929,y:.018965167962033513},{x:.519665902312761,y:.02288306052976895},{x:.5684429023127611,y:.1458620605297689},{x:.5688122064775901,y:.14714915498994666},{x:.5693537919217377,y:.14837377040805427},{x:.5700262192706007,y:.15138021786244946},{x:.5708758841928585,y:.15434145989163614},{x:.5709869926090132,y:.15567587086110493},{x:.5712792610244494,y:.1569826137160382},{x:.5713522390683521,y:.16006247719363653},{x:.5716078682563359,y:.16313258119086366},{x:.5714565110896938,y:.16446302800441426},{x:.5714882307651191,y:.1658016809010868},{x:.5709589549987614,y:.16883660297565092},{x:.5706107247661352,y:.1718975865660398},{x:.570202718587728,y:.17317294089875004},{x:.5699726705538047,y:.1744920601570685},{x:.5455836705538047,y:.26233106015706853},{x:.5448796820390573,y:.26415145628779163},{x:.5443792359109676,y:.2660379863232085},{x:.5432925447356423,y:.2682555269445408},{x:.5424018225194911,y:.2705587850827968},{x:.5413562192793141,y:.27220686146627543},{x:.5404973453311464,y:.27395951015977},{x:.5389989139081434,y:.2759224384285429},{x:.5376759632977357,y:.2780076688235372},{x:.5363289272782685,y:.2794200908086057},{x:.5351446315541886,y:.28097150485378414},{x:.5332920437627642,y:.28260438653745124},{x:.5315877050081386,y:.28439145495451523},{x:.529991002048182,y:.2855139439563835},{x:.528526796368706,y:.2868045033815319},{x:.4553637963687061,y:.3395095033815319},{x:.4552094954443409,y:.33959910378534747},{x:.4550747122553104,y:.3397160246969866},{x:.45139660000367776,y:.341813199213456},{x:.44773515946955245,y:.3439393468807752},{x:.44756634322254935,y:.3439971230209339},{x:.4474113397164003,y:.34408550243429054},{x:.4433947629085852,y:.34542481622689836},{x:.43938888509457313,y:.34679579895012297},{x:.43921204103863115,y:.34681953052195974},{x:.439042773913178,y:.34687597206574233},{x:.35212099999999996,y:.3666493043587998},{x:.35212099999999996,y:.6320956693586206},{x:.3838005126074005,y:.6288356018928482},{x:.4577579663937751,y:.5527249728659002},{x:.46449612147708186,y:.5470313904751531},{x:.47221556762189953,y:.5427617575185425},{x:.48061965084199804,y:.5400801535961528},{x:.48938540693229315,y:.5390896312428609},{x:.49817597280212744,y:.5398282556772123},{x:.5066535319349293,y:.5422676419764202},{x:.5144922964874953,y:.5463140458930298},{x:.5213910271340998,y:.551811966393775},{x:.5270846095248467,y:.5585501214770818},{x:.5313542424814575,y:.5662695676218995},{x:.534035846403847,y:.5746736508419981},{x:.535026368757139,y:.5834394069322931},{x:.5342877443227877,y:.5922299728021274},{x:.5318483580235798,y:.6007075319349293},{x:.5278019541069703,y:.6085462964874953},{x:.5223040336062249,y:.6154450271340998},{x:.4369490336062249,y:.7032850271340998},{x:.435089451582588,y:.7048563301588934},{x:.43337550685970433,y:.706585327551969},{x:.43172842132509603,y:.7076963215886295},{x:.4302108785229181,y:.7089786095248467},{x:.4280804818333404,y:.7101569339468108},{x:.4260621594195314,y:.7115183351118896},{x:.4242299779872524,y:.7122866512623272},{x:.42249143237810044,y:.7132482424814575},{x:.4201720909726226,y:.7139883059538676},{x:.4179269538663623,y:.7149297930076584},{x:.4159800862413552,y:.7153259053130885},{x:.41408734915800194,y:.715929846403847},{x:.4116681940261354,y:.716203208702491},{x:.4092825215873294,y:.7166886008255086},{x:.35212099999999996,y:.7225709645831306},{x:.35212099999999996,y:.7597659999999999},{x:.35125633761814534,y:.7685450644907257},{x:.3486955789630079,y:.776986754456429},{x:.3445371325536145,y:.7847666604858821},{x:.33894080515339464,y:.7915858051533946},{x:.3321216604858821,y:.7971821325536145},{x:.32434175445642904,y:.8013405789630078},{x:.3159000644907258,y:.8039013376181453},{x:.307121,y:.804766},{x:.29834193550927424,y:.8039013376181453},{x:.28990024554357097,y:.8013405789630078},{x:.2821203395141179,y:.7971821325536145},{x:.2753011948466053,y:.7915858051533946},{x:.26970486744638544,y:.7847666604858821},{x:.26554642103699205,y:.776986754456429},{x:.2629856623818546,y:.7685450644907257},{x:.262121,y:.7597659999999999},{x:.262121,y:.7318326623736131},{x:.23856652158732947,y:.7342566008255086},{x:.23743405616423266,y:.7342615520061975},{x:.23631438427367413,y:.7344313675125375},{x:.2330314335362298,y:.7342808004350606},{x:.22974506326706257,y:.734295168567351},{x:.22863339192208898,y:.7340790915684273},{x:.22750210485113245,y:.7340272069677483},{x:.2243116092711877,y:.7332390610779145},{x:.22108558260167874,y:.7326120140964958},{x:.22003742624118275,y:.7321832126358507},{x:.21893799871753236,y:.7319116218242595},{x:.21596256725097532,y:.7305161851266182},{x:.21292085857685591,y:.729271820095334},{x:.21197649726195836,y:.7286467727726252},{x:.21095117966878213,y:.7281659128327016},{x:.2083051564782311,y:.7262168111769735},{x:.20556465695803808,y:.7244029483461277},{x:.204760381964467,y:.7236056753794367},{x:.20384857668186554,y:.7229340254890024},{x:.10629557668186554,y:.6350940254890024},{x:.10393291169686979,y:.6325042238563513},{x:.10146752815288923,y:.6300120075116347},{x:.10096488682836192,y:.6292508655939548},{x:.10035013880638408,y:.6285770182897039},{x:.09853811700104832,y:.6255760458964971},{x:.09660631239978806,y:.6226507443205297},{x:.09626182060918942,y:.6218061670735107},{x:.09579034588565258,y:.6210253361666956},{x:.09459860224176168,y:.6177285186990383},{x:.0932746147506803,y:.6144825495908574},{x:.056695614750680294,y:.49150554959085735},{x:.05654965816703397,y:.490750439567249},{x:.05628361804350595,y:.49002883224693095},{x:.05571374572525952,y:.48642582571377374},{x:.055021470477783566,y:.4828443224653027},{x:.055025633066628665,y:.4820752469521588},{x:.05490548343396577,y:.4813156032607913},{x:.055049472757300266,y:.47767065091379934},{x:.05506921600663437,y:.4740229090450286},{x:.05522333780201598,y:.4732694231830167},{x:.05525369594322076,y:.472500935801646},{x:.05610601347919053,y:.46895411111540136},{x:.056837016503334954,y:.46538031130067065},{x:.05713517469108906,y:.46467137112890816},{x:.05731487395982006,y:.46392357259662753},{x:.08169987395982006,y:.39365157259662753},{x:.08192222202041206,y:.3931695328553223},{x:.08205835369770847,y:.3926564352635495},{x:.08376780756696771,y:.3891683934837906},{x:.08539480756850773,y:.3856411369034641},{x:.08570692456181836,y:.38521173737536313},{x:.08594054088151196,y:.3847350567827023},{x:.08829763126802886,y:.38164753465350854},{x:.09058150254284453,y:.37850546527353984},{x:.0909713939878581,y:.378145207541698},{x:.09129351720579659,y:.37772326251599964},{x:.09420766244788897,y:.3751549117812935},{x:.09706063710369874,y:.372518777565862},{x:.09751331969083687,y:.37224150613287915},{x:.09791157079240381,y:.3718905117848512},{x:.17107757079240382,y:.3191875117848513},{x:.17123114354048857,y:.3190983419119289},{x:.17136528774468962,y:.3189819753030134},{x:.17504412834709762,y:.3168843854977816},{x:.17870637355344754,y:.314757953928811},{x:.1788743916234626,y:.3147004579868701},{x:.17902866028359976,y:.31461249756570947},{x:.183046032465951,y:.31327291855818423},{x:.1870527548771027,y:.3119018143721617},{x:.18722876142884332,y:.31187820189800686},{x:.18739722608682208,y:.3118220279342577},{x:.262121,y:.2948235482063542},{x:.262121,y:.04244038202745839},{x:.212402420161311,y:.04795051974434915},{x:.14928483997433578,y:.08692151049617265},{x:.11795277553134796,y:.17720643745102208},{x:.114257651607068,y:.18521678535552225},{x:.10907078710071823,y:.1923523337548876},{x:.10259151030645056,y:.1983388675257922},{x:.09506881619784838,y:.20294632753270694},{x:.08679179769072982,y:.20599765167145945},{x:.07807853596451803,y:.20737557926659977},{x:.06926387678089782,y:.20702715733339738},{x:.0606865625489779,y:.20496577553134793},{x:.052676214644477706,y:.20127065160706795},{x:.04554066624511235,y:.1960837871007182},{x:.039554132474207776,y:.18960451030645054},{x:.034946672467293015,y:.18208181619784836},{x:.03189534832854049,y:.1738047976907298},{x:.030517420733400163,y:.165091535964518}],[{x:.14709211773983194,y:.4797371545422716},{x:.17592903295677773,y:.5766856037244347},{x:.24922570721126042,y:.6426843927572041},{x:.262121,y:.6413573671491031},{x:.262121,y:.3871228845247169},{x:.21626819752335621,y:.3975536737173561},{x:.16206100150816494,y:.4366002507010456},{x:.14709211773983194,y:.4797371545422716}],[{x:.35212099999999996,y:.034163101195078524},{x:.35212099999999996,y:.2743499680404371},{x:.4101709471377665,y:.26114452085874473},{x:.4630938273127818,y:.2230200535785049},{x:.47920731446793274,y:.1649859973145621},{x:.44287681685863156,y:.07338773859643172},{x:.35212099999999996,y:.034163101195078524}]],"\'":[[{x:.25602600000000003,y:.476978},{x:.25689066238185465,y:.4681989355092742},{x:.2594514210369921,y:.459757245543571},{x:.2636098674463855,y:.4519773395141179},{x:.26920619484660535,y:.44515819484660535},{x:.27602533951411795,y:.4395618674463855},{x:.283805245543571,y:.4354034210369921},{x:.2922469355092743,y:.43284266238185465},{x:.301026,y:.43197800000000003},{x:.3098050644907258,y:.43284266238185465},{x:.3182467544564291,y:.4354034210369921},{x:.32602666048588214,y:.4395618674463855},{x:.3328458051533947,y:.44515819484660535},{x:.33844213255361455,y:.4519773395141179},{x:.34260057896300794,y:.459757245543571},{x:.3451613376181454,y:.4681989355092742},{x:.346026,y:.476978},{x:.346026,y:.729004},{x:.3451613376181454,y:.7377830644907257},{x:.34260057896300794,y:.746224754456429},{x:.33844213255361455,y:.7540046604858821},{x:.3328458051533947,y:.7608238051533946},{x:.32602666048588214,y:.7664201325536145},{x:.3182467544564291,y:.7705785789630079},{x:.3098050644907258,y:.7731393376181454},{x:.301026,y:.774004},{x:.2922469355092743,y:.7731393376181454},{x:.283805245543571,y:.7705785789630079},{x:.27602533951411795,y:.7664201325536145},{x:.26920619484660535,y:.7608238051533946},{x:.2636098674463855,y:.7540046604858821},{x:.2594514210369921,y:.746224754456429},{x:.25689066238185465,y:.7377830644907257},{x:.25602600000000003,y:.729004},{x:.25602600000000003,y:.476978}]],"(":[[{x:.14398102142772873,y:.343473372436119},{x:.14438344127795402,y:.34024506484177663},{x:.14461855620935057,y:.33700027938992067},{x:.15480555620935058,y:.27783527938992064},{x:.15553530200183258,y:.27518493680242373},{x:.1560666158259812,y:.2724877993619115},{x:.1764416158259812,y:.20487079936191147},{x:.17757136816824137,y:.2021290142392397},{x:.17852197521392682,y:.19932008699588913},{x:.2090839752139268,y:.13170208699588917},{x:.21040800505224358,y:.12940389577393302},{x:.21154775445201235,y:.12700896170152925},{x:.25229575445201236,y:.05939296170152925},{x:.2531150427152032,y:.05829379345186112},{x:.2537782786760274,y:.05709399256856861},{x:.29452927867602746,y:-.0020700074314313824},{x:.29560111146026063,y:-.0033391000809501682},{x:.29650963843516415,y:-.004729783512322571},{x:.3372576384351641,y:-.05544378351232261},{x:.3386866074193021,y:-.05690267270426387},{x:.3399537097957662,y:-.05850416001284604},{x:.38070370979576623,y:-.10073716001284601},{x:.38742176905533504,y:-.10645444032360908},{x:.3951261287468799,y:-.11075123635207199},{x:.40352071464810957,y:-.11346242463653189},{x:.41228292753057777,y:-.11448381573166892},{x:.42107604046711683,y:-.11377615815049966},{x:.4295621390588101,y:-.11136664677700951},{x:.4374151072958377,y:-.10734787778201216},{x:.444333160012846,y:-.10187429020423372},{x:.4500504403236091,y:-.09515623094466494},{x:.45434723635207197,y:-.08745187125312004},{x:.4570584246365319,y:-.07905728535189037},{x:.45807981573166895,y:-.07029507246942218},{x:.4573721581504997,y:-.06150195953288313},{x:.45496264677700954,y:-.053015860941189874},{x:.45094387778201217,y:-.04516289270416226},{x:.44547029020423373,y:-.03824483998715393},{x:.4061377413616867,y:.0025191240684850026},{x:.3677075745656829,y:.050348403515145926},{x:.3286739379437331,y:.10701906379590062},{x:.2900025757951927,y:.1711891536907596},{x:.2617573982317254,y:.23368121626802973},{x:.24303344075060918,y:.2958190240226623},{x:.23462816944303005,y:.34463593546989096},{x:.24303340667749923,y:.39345182392970596},{x:.26175739639474455,y:.45558881969516635},{x:.2900026404789191,y:.5180819536434618},{x:.328674029726828,y:.5822520885061939},{x:.36770768599197223,y:.6389237351633864},{x:.4061420841180472,y:.6867582808236831},{x:.4454798975405431,y:.7275528000242046},{x:.45095135740921277,y:.7344725356602282},{x:.45496771125722263,y:.7423267393839987},{x:.45737461285859093,y:.7508135785511003},{x:.458079566334583,y:.759606908691815},{x:.4570554807184589,y:.768368807060192},{x:.4543417110461325,y:.7767625588156633},{x:.4500425459642118,y:.7844655967855365},{x:.4443231999757953,y:.791181897540543},{x:.4374034643397718,y:.7966533574092127},{x:.4295492606160011,y:.8006697112572226},{x:.42106242144889966,y:.8030766128585909},{x:.41226909130818484,y:.803781566334583},{x:.403507192939808,y:.8027574807184589},{x:.39511344118433667,y:.8000437110461325},{x:.3874104032144634,y:.7957445459642117},{x:.38069410245945684,y:.7900251999757952},{x:.33994410245945683,y:.7477661999757953},{x:.338681775527778,y:.7461697396410558},{x:.3372576384351641,y:.7447157835123226},{x:.29650963843516415,y:.6940017835123226},{x:.2956010143988682,y:.6926109515089496},{x:.29452907712829884,y:.6913417148135671},{x:.2537780771282988,y:.6321767148135672},{x:.25311493656839296,y:.6309770641401381},{x:.25229575445201236,y:.6298780382984708},{x:.21154775445201235,y:.5622620382984707},{x:.21040795156345282,y:.5598669918310725},{x:.2090838723444427,y:.5575686854051248},{x:.17852187234444272,y:.48994968540512485},{x:.17757135012625538,y:.48714095747585867},{x:.17644166886939822,y:.4843993766680373},{x:.1560666688693982,y:.4167833766680374},{x:.15553533856931018,y:.4140862136984408},{x:.15480557779123924,y:.4114358459543075},{x:.14461857779123924,y:.3522718459543075},{x:.14438345368873493,y:.3490270611669966},{x:.14398102471397584,y:.3457987547100726},{x:.14406527252602844,y:.3446360634540339},{x:.14398102142772873,y:.343473372436119}]],")":[[{x:.14397318426833106,y:-.07029507246942218},{x:.14499457536346808,y:-.07905728535189037},{x:.14770576364792798,y:-.08745187125312004},{x:.1520025596763909,y:-.09515623094466495},{x:.15771983998715397,y:-.10187429020423372},{x:.16463789270416226,y:-.10734787778201214},{x:.1724908609411899,y:-.11136664677700951},{x:.18097695953288315,y:-.11377615815049966},{x:.1897700724694222,y:-.11448381573166892},{x:.19853228535189038,y:-.11346242463653189},{x:.20692687125312006,y:-.11075123635207199},{x:.21463123094466496,y:-.10645444032360907},{x:.22134929020423375,y:-.10073716001284601},{x:.2620992902042337,y:-.05850416001284604},{x:.2633660586938147,y:-.05690309470300352},{x:.26479468609075496,y:-.05544462417080616},{x:.30554468609075497,y:-.004730624170806122},{x:.3064541047100432,y:-.003338648753719708},{x:.307526891803669,y:-.002068307996824087},{x:.348273891803669,y:.05709569200317591},{x:.3489362195699084,y:.058293979727073175},{x:.3497544895549002,y:.059391707275619196},{x:.39050548955490016,y:.12700770727561922},{x:.39164563057902163,y:.12940326331913213},{x:.3929700247860732,y:.13170208699588917},{x:.42353202478607316,y:.19932008699588913},{x:.4244827292530259,y:.20212930210713742},{x:.4256125601984483,y:.2048713835354543},{x:.4459865601984483,y:.27248838353545435},{x:.4465177787005257,y:.27518522990297933},{x:.4472474437906494,y:.27783527938992064},{x:.4574344437906494,y:.33700027938992067},{x:.45766955872204595,y:.3402450648417768},{x:.4580719785722712,y:.34347337243611903},{x:.45798772747397154,y:.3446360634540339},{x:.4580719752860241,y:.3457987547100726},{x:.45766954631126505,y:.34902706116699656},{x:.45743442220876074,y:.3522718459543075},{x:.44724742220876074,y:.4114358459543075},{x:.4465177421348676,y:.414085920594514},{x:.44598650715958776,y:.4167827924880124},{x:.42561250715958776,y:.4843987924880123},{x:.42448274729464536,y:.48714066960378194},{x:.42353212765555726,y:.48994968540512485},{x:.3929701276555573,y:.5575686854051248},{x:.39164568407140216,y:.5598676242877579},{x:.39050548955490016,y:.5622632927243807},{x:.3497544895549002,y:.6298792927243808},{x:.3489363257182038,y:.6309768778726063},{x:.34827409333092635,y:.6321750153799588},{x:.3075270933309263,y:.6913400153799587},{x:.3064542017711834,y:.692610500189881},{x:.30554468609075497,y:.6940026241708062},{x:.26479468609075496,y:.7447166241708062},{x:.26337089070969094,y:.7461701617493295},{x:.2621088975405431,y:.7477661999757953},{x:.2213588975405431,y:.7900251999757952},{x:.21464259678553657,y:.7957445459642117},{x:.20693955881566328,y:.8000437110461325},{x:.19854580706019195,y:.8027574807184589},{x:.1897839086918151,y:.803781566334583},{x:.1809905785511003,y:.8030766128585909},{x:.17250373938399882,y:.8006697112572226},{x:.16464953566022822,y:.7966533574092127},{x:.15772980002420467,y:.791181897540543},{x:.15201045403578817,y:.7844655967855365},{x:.14771128895386743,y:.7767625588156633},{x:.14499751928154103,y:.7683688070601918},{x:.14397343366541698,y:.759606908691815},{x:.14467838714140904,y:.7508135785511002},{x:.14708528874277732,y:.7423267393839987},{x:.1511016425907872,y:.7344725356602282},{x:.15657310245945688,y:.7275528000242046},{x:.19591129092993145,y:.6867578918874246},{x:.23434697314436972,y:.6389240958672278},{x:.27337685298529213,y:.5822523693404118},{x:.3120516621801016,y:.518081284004684},{x:.34029647741491703,y:.4555890988936643},{x:.35901954136421654,y:.39345212569273014},{x:.36742483055696995,y:.344635935469891},{x:.359019507292604,y:.29581872226323463},{x:.3402964755778617,y:.23368093707349602},{x:.3120517268674457,y:.17118982332763816},{x:.27337694476991303,y:.10701878295300266},{x:.23434708457036935,y:.05034804280413771},{x:.1959156338111051,y:.0025195128948044543},{x:.15658270979576625,y:-.03824483998715393},{x:.1511091222179878,y:-.045162892704162266},{x:.14709035322299047,y:-.053015860941189874},{x:.1446808418495003,y:-.06150195953288312},{x:.14397318426833106,y:-.07029507246942218}]],"*":[[{x:.03611444520266741,y:.4654782574484574},{x:.03652686631141767,y:.45666636076295464},{x:.038650478626155074,y:.4481042415682919},{x:.04240367291655979,y:.4401209373034283},{x:.04764221603086716,y:.4330232418741738},{x:.05416479369500318,y:.42708391573544136},{x:.06172074690723879,y:.42253120385992987},{x:.07001970462305517,y:.4195400644118251},{x:.0787427425515426,y:.41822544520266736},{x:.08755463923704532,y:.41863786631141764},{x:.09611675843170807,y:.42076147862615504},{x:.25602600000000003,y:.47756000598755177},{x:.25602600000000003,y:.31805799999999995},{x:.25689066238185465,y:.30927893550927416},{x:.2594514210369921,y:.30083724554357094},{x:.2636098674463855,y:.29305733951411783},{x:.26920619484660535,y:.2862381948466053},{x:.27602533951411795,y:.2806418674463854},{x:.283805245543571,y:.276483421036992},{x:.2922469355092743,y:.2739226623818546},{x:.301026,y:.27305799999999997},{x:.3098050644907258,y:.2739226623818546},{x:.3182467544564291,y:.276483421036992},{x:.32602666048588214,y:.2806418674463854},{x:.3328458051533947,y:.2862381948466053},{x:.33844213255361455,y:.29305733951411783},{x:.34260057896300794,y:.30083724554357094},{x:.3451613376181454,y:.30927893550927416},{x:.346026,y:.31805799999999995},{x:.346026,y:.47756000598755177},{x:.505935241568292,y:.42076147862615504},{x:.5144973607629547,y:.41863786631141764},{x:.5233092574484575,y:.41822544520266736},{x:.5320322953769449,y:.4195400644118251},{x:.5403312530927612,y:.42253120385992987},{x:.5478872063049969,y:.42708391573544136},{x:.5544097839691329,y:.4330232418741738},{x:.5596483270834403,y:.4401209373034283},{x:.5634015213738449,y:.4481042415682919},{x:.5655251336885824,y:.45666636076295464},{x:.5659375547973327,y:.4654782574484574},{x:.5646229355881749,y:.4742012953769448},{x:.5616317961400701,y:.4825002530927612},{x:.5570790842645587,y:.4900562063049968},{x:.5511397581258262,y:.4965787839691328},{x:.5440420626965717,y:.5018173270834402},{x:.5360587584317081,y:.5055705213738448},{x:.37146215609131306,y:.5640339630732496},{x:.47696549129035026,y:.7165911114148321},{x:.48124783600971727,y:.7243035129909579},{x:.48394328176908086,y:.732703166943666},{x:.4849482440995321,y:.7414672792821342},{x:.48422410286230105,y:.7502590500841659},{x:.48179868639903156,y:.758740616528321},{x:.47776520210421775,y:.7665860367726678},{x:.4722786545173053,y:.7734938157169785},{x:.4655498885851679,y:.7791984912903502},{x:.45783748700904214,y:.7834808360097172},{x:.449437833056334,y:.7861762817690807},{x:.4406737207178658,y:.7871812440995319},{x:.431881949915834,y:.786457102862301},{x:.4234003834716789,y:.7840316863990314},{x:.4155549632273321,y:.7799982021042177},{x:.40864718428302144,y:.7745116545173052},{x:.40294250870964976,y:.7677828885851677},{x:.301026,y:.6204122684209616},{x:.19910949129035027,y:.7677828885851677},{x:.19340481571697854,y:.7745116545173052},{x:.18649703677266788,y:.7799982021042177},{x:.17865161652832107,y:.7840316863990314},{x:.17017005008416597,y:.786457102862301},{x:.1613782792821342,y:.7871812440995319},{x:.15261416694366597,y:.7861762817690807},{x:.14421451299095783,y:.7834808360097172},{x:.13650211141483212,y:.7791984912903502},{x:.12977334548269473,y:.7734938157169785},{x:.12428679789578226,y:.7665860367726678},{x:.12025331360096844,y:.758740616528321},{x:.11782789713769894,y:.7502590500841659},{x:.11710375590046794,y:.7414672792821342},{x:.11810871823091917,y:.732703166943666},{x:.12080416399028275,y:.7243035129909579},{x:.1250865087096497,y:.7165911114148321},{x:.23058984390868703,y:.5640339630732496},{x:.06599324156829194,y:.5055705213738448},{x:.058009937303428294,y:.5018173270834402},{x:.05091224187417384,y:.4965787839691328},{x:.04497291573544139,y:.4900562063049968},{x:.04042020385992993,y:.4825002530927612},{x:.03742906441182516,y:.4742012953769448},{x:.03611444520266741,y:.4654782574484574}]],"+":[[{x:-.002030999999999998,y:.33155},{x:-.0011663376181453647,y:.3227709355092742},{x:.0013944210369920967,y:.314329245543571},{x:.005552867446385459,y:.3065493395141179},{x:.011149194846605363,y:.29973019484660535},{x:.017968339514117915,y:.2941338674463855},{x:.025748245543570962,y:.2899754210369921},{x:.03418993550927423,y:.28741466238185465},{x:.042969,y:.28655},{x:.256023,y:.28655},{x:.256023,y:.09133899999999995},{x:.2568876623818546,y:.08255993550927418},{x:.25944842103699206,y:.07411824554357091},{x:.26360686744638545,y:.06633833951411786},{x:.2692031948466054,y:.05951919484660531},{x:.2760223395141179,y:.053922867446385414},{x:.2838022455435709,y:.049764421036992045},{x:.2922439355092742,y:.04720366238185458},{x:.301023,y:.04633899999999995},{x:.3098020644907258,y:.04720366238185458},{x:.31824375445642905,y:.049764421036992045},{x:.3260236604858821,y:.053922867446385414},{x:.3328428051533946,y:.05951919484660531},{x:.3384391325536145,y:.06633833951411786},{x:.3425975789630079,y:.07411824554357091},{x:.34515833761814535,y:.08255993550927418},{x:.34602299999999997,y:.09133899999999995},{x:.34602299999999997,y:.28655},{x:.559083,y:.28655},{x:.5678620644907257,y:.28741466238185465},{x:.576303754456429,y:.2899754210369921},{x:.5840836604858821,y:.2941338674463855},{x:.5909028051533947,y:.29973019484660535},{x:.5964991325536145,y:.3065493395141179},{x:.6006575789630079,y:.314329245543571},{x:.6032183376181454,y:.3227709355092742},{x:.604083,y:.33155},{x:.6032183376181454,y:.3403290644907258},{x:.6006575789630079,y:.348770754456429},{x:.5964991325536145,y:.35655066048588213},{x:.5909028051533947,y:.3633698051533947},{x:.5840836604858821,y:.36896613255361455},{x:.576303754456429,y:.37312457896300794},{x:.5678620644907257,y:.3756853376181454},{x:.559083,y:.37655},{x:.34602299999999997,y:.37655},{x:.34602299999999997,y:.571777},{x:.34515833761814535,y:.5805560644907257},{x:.3425975789630079,y:.588997754456429},{x:.3384391325536145,y:.5967776604858821},{x:.3328428051533946,y:.6035968051533946},{x:.3260236604858821,y:.6091931325536145},{x:.31824375445642905,y:.6133515789630078},{x:.3098020644907258,y:.6159123376181453},{x:.301023,y:.616777},{x:.2922439355092742,y:.6159123376181453},{x:.2838022455435709,y:.6133515789630078},{x:.2760223395141179,y:.6091931325536145},{x:.2692031948466054,y:.6035968051533946},{x:.26360686744638545,y:.5967776604858821},{x:.25944842103699206,y:.588997754456429},{x:.2568876623818546,y:.5805560644907257},{x:.256023,y:.571777},{x:.256023,y:.37655},{x:.042969,y:.37655},{x:.03418993550927421,y:.3756853376181454},{x:.025748245543570934,y:.37312457896300794},{x:.017968339514117904,y:.36896613255361455},{x:.011149194846605356,y:.3633698051533947},{x:.005552867446385459,y:.35655066048588213},{x:.0013944210369920967,y:.348770754456429},{x:-.0011663376181453647,y:.3403290644907258},{x:-.002030999999999998,y:.33155}]],",":[[{x:.1703425796668749,y:-.03158948169003215},{x:.1707557440557006,y:-.035050650253961146},{x:.17102563140319493,y:-.03852592771911176},{x:.17127771326913271,y:-.039423300660751795},{x:.17138819577001116,y:-.0403488367651378},{x:.1724686618106471,y:-.0436628955719719},{x:.1734113563482083,y:-.04701874414557815},{x:.1738336633079298,y:-.04784969558537063},{x:.17412258605517572,y:-.048735893706360625},{x:.1758288320436127,y:-.05177548533469908},{x:.17740810654883146,y:-.054882941638058576},{x:.177984409582707,y:-.05561553857817519},{x:.17844066943717352,y:-.05642834261896521},{x:.18070712529694977,y:-.05907665726715373},{x:.18286228913625774,y:-.06181630349720979},{x:.26855428913625773,y:-.1511263034972098},{x:.27525630293239317,y:-.15686238451505874},{x:.2829485933055849,y:-.16118075031492074},{x:.2913355498506774,y:-.16391544852087458},{x:.3000948665311021,y:-.16496138621450188},{x:.3088899277191117,y:-.1642783685968051},{x:.3173827441455781,y:-.16189264365179173},{x:.3252469416380585,y:-.15789589345116858},{x:.33218030349720973,y:-.1524417108637423},{x:.3379163845150587,y:-.14573969706760687},{x:.3422347503149207,y:-.13804740669441512},{x:.3449694485208745,y:-.12966045014932262},{x:.3460153862145018,y:-.12090113346889794},{x:.34533236859680505,y:-.11210607228088836},{x:.34294664365179167,y:-.10361325585442197},{x:.33894989345116855,y:-.09574905836194152},{x:.33349571086374225,y:-.08881569650279031},{x:.277697993368333,y:-.03066214483501502},{x:.41918956700521515,y:.11679250439324337},{x:.42464400414059766,y:.12372566600271688},{x:.42864104306488354,y:.1315897167531037},{x:.43102707981377775,y:.14008244558427704},{x:.4317104203331251,y:.14887748169003212},{x:.4306648042299889,y:.15763683676513773},{x:.4279304139448243,y:.1660238937063606},{x:.4236123305628265,y:.17371634261896518},{x:.41787649560675666,y:.1804185670052151},{x:.41094333399728317,y:.18587300414059763},{x:.4030792832468963,y:.18987004306488353},{x:.39458655441572293,y:.19225607981377774},{x:.3857915183099679,y:.19293942033312508},{x:.37703216323486227,y:.19189380422998883},{x:.36864510629363945,y:.18915941394482427},{x:.3609526573810348,y:.18484133056282648},{x:.35425043299478487,y:.17910549560675662},{x:.18286343299478489,y:.000495495606756581},{x:.18070816857348473,y:-.0022440714967103576},{x:.1784416154849413,y:-.004892302932393237},{x:.17798532578947307,y:-.005705090221499034},{x:.17740899585940237,y:-.006437666002716908},{x:.1758296072680145,y:-.009545064322455634},{x:.1741232496850793,y:-.012584593305585},{x:.17383429440212667,y:-.013470780818460306},{x:.1734119569351165,y:-.014301716753103766},{x:.1724691391914766,y:-.01765753071433596},{x:.17138855147912546,y:-.02097154985067746},{x:.17127803499816427,y:-.02189708189818214},{x:.17102592018622226,y:-.022794445584277102},{x:.17075590524748027,y:-.02626971313843455},{x:.17034261378549817,y:-.029730866531102167},{x:.17041478319291342,y:-.03066017543569507},{x:.1703425796668749,y:-.03158948169003215}]],"-":[[{x:.12882900000000003,y:.31396500000000005},{x:.12969366238185465,y:.30518593550927425},{x:.13225442103699211,y:.29674424554357104},{x:.13641286744638548,y:.28896433951411793},{x:.14200919484660537,y:.2821451948466054},{x:.14882833951411792,y:.2765488674463855},{x:.15660824554357097,y:.2723904210369921},{x:.16504993550927424,y:.2698296623818547},{x:.173829,y:.26896500000000007},{x:.428224,y:.26896500000000007},{x:.4370030644907258,y:.2698296623818547},{x:.44544475445642906,y:.2723904210369921},{x:.4532246604858821,y:.2765488674463855},{x:.4600438051533946,y:.2821451948466054},{x:.4656401325536145,y:.28896433951411793},{x:.4697985789630079,y:.29674424554357104},{x:.47235933761814536,y:.30518593550927425},{x:.473224,y:.31396500000000005},{x:.47235933761814536,y:.32274406449072585},{x:.4697985789630079,y:.33118575445642906},{x:.4656401325536145,y:.33896566048588217},{x:.4600438051533946,y:.3457848051533947},{x:.4532246604858821,y:.3513811325536146},{x:.44544475445642906,y:.355539578963008},{x:.4370030644907258,y:.3581003376181454},{x:.428224,y:.35896500000000003},{x:.173829,y:.35896500000000003},{x:.16504993550927424,y:.3581003376181454},{x:.15660824554357097,y:.355539578963008},{x:.14882833951411792,y:.3513811325536146},{x:.14200919484660537,y:.3457848051533947},{x:.13641286744638548,y:.33896566048588217},{x:.13225442103699211,y:.33118575445642906},{x:.12969366238185465,y:.32274406449072585},{x:.12882900000000003,y:.31396500000000005}]],".":[[{x:.19450299999999998,y:.148926},{x:.19536766238185463,y:.14014693550927423},{x:.1979284210369921,y:.13170524554357096},{x:.20208686744638546,y:.12392533951411791},{x:.20768319484660536,y:.11710619484660537},{x:.2145023395141179,y:.11150986744638547},{x:.22228224554357093,y:.1073514210369921},{x:.2307239355092742,y:.10479066238185464},{x:.239503,y:.103926},{x:.362549,y:.103926},{x:.3713280644907258,y:.10479066238185464},{x:.3797697544564291,y:.1073514210369921},{x:.38754966048588213,y:.11150986744638547},{x:.3943688051533947,y:.11710619484660537},{x:.39996513255361454,y:.12392533951411791},{x:.40412357896300793,y:.13170524554357096},{x:.4066843376181454,y:.14014693550927423},{x:.407549,y:.148926},{x:.4066843376181454,y:.1577050644907258},{x:.40412357896300793,y:.16614675445642904},{x:.39996513255361454,y:.1739266604858821},{x:.3943688051533947,y:.18074580515339464},{x:.38754966048588213,y:.18634213255361454},{x:.3797697544564291,y:.1905005789630079},{x:.3713280644907258,y:.19306133761814537},{x:.362549,y:.193926},{x:.239503,y:.193926},{x:.2307239355092742,y:.19306133761814537},{x:.22228224554357093,y:.1905005789630079},{x:.2145023395141179,y:.18634213255361454},{x:.20768319484660536,y:.18074580515339464},{x:.20208686744638546,y:.1739266604858821},{x:.1979284210369921,y:.16614675445642904},{x:.19536766238185463,y:.1577050644907258},{x:.19450299999999998,y:.148926}]],"/":[[{x:.017522651058219416,y:-.036644753012328966},{x:.01865919532569161,y:-.04539277458837648},{x:.02148055556003016,y:-.053750976595687026},{x:.02587830846966649,y:-.06139815801845333},{x:.031683450876571484,y:-.06804044196318723},{x:.038672894413609195,y:-.07342256918292836},{x:.04657803868537635,y:-.0773377075469538},{x:.0550950934307649,y:-.07963540048356893},{x:.0638967530123289,y:-.08022734894178067},{x:.07264477458837641,y:-.07909080467430848},{x:.08100297659568695,y:-.07626944443996993},{x:.08865015801845323,y:-.0718716915303336},{x:.09529244196318715,y:-.0660665491234286},{x:.10067456918292828,y:-.059077105586390885},{x:.5777245691829282,y:.7051758944136092},{x:.5816397075469537,y:.7130810386853763},{x:.5839374004835688,y:.7215980934307649},{x:.5845293489417805,y:.7303997530123288},{x:.5833928046743084,y:.7391477745883763},{x:.5805714444399699,y:.747505976595687},{x:.5761736915303335,y:.7551531580184532},{x:.5703685491234285,y:.7617954419631872},{x:.5633791055863908,y:.7671775691829282},{x:.5554739613146237,y:.7710927075469537},{x:.5469569065692351,y:.7733904004835688},{x:.5381552469876711,y:.7739823489417805},{x:.5294072254116237,y:.7728458046743084},{x:.521049023404313,y:.7700244444399699},{x:.5134018419815468,y:.7656266915303335},{x:.5067595580368128,y:.7598215491234285},{x:.5013774308170718,y:.7528321055863908},{x:.024327430817071727,y:-.011420894413609283},{x:.020412292453046287,y:-.019326038685376436},{x:.018114599516431164,y:-.027843093430764996},{x:.017522651058219416,y:-.036644753012328966}]],"<":[[{x:-.002019645490236678,y:.32959917016575135},{x:-.0016099914284145765,y:.3262199732716625},{x:-.0013526191024594778,y:.3228257800560043},{x:-.001080072865731869,y:.3218487260950263},{x:-.0009579981642362373,y:.3208417436418168},{x:.00010303311987996846,y:.3176073966113462},{x:.0010176343561875828,y:.3143286327165328},{x:.0014755574652736251,y:.31342352370653337},{x:.001791739066671412,y:.3124597057316259},{x:.003463372735866293,y:.309494502707312},{x:.00500005526992945,y:.3064571691910689},{x:.005625757523098081,y:.30565878796371126},{x:.0061238953427729045,y:.3047751734513664},{x:.008341891452602095,y:.3021930655225286},{x:.010441601436418424,y:.2995138854085287},{x:.011211037446978121,y:.298852913306643},{x:.011871988327878901,y:.29808345906703315},{x:.014551110531708777,y:.29598367519331337},{x:.017133157288130564,y:.2937656078708368},{x:.01801675806170013,y:.2932674456816211},{x:.018815122032139454,y:.29264172140965955},{x:.021852413166145952,y:.29110495510775264},{x:.024817570086352318,y:.28943323966009543},{x:.5409315700863523,y:.06192123966009548},{x:.5493135321567164,y:.059171271257023414},{x:.5580709293975171,y:.05810938240515066},{x:.5668672199439956,y:.058776380897540545},{x:.5753643672834672,y:.061146634356187606},{x:.583235830808931,y:.06512905526992949},{x:.5901791145914712,y:.07057060143641844},{x:.5959273921291632,y:.07726215728813057},{x:.6002597603399046,y:.08494657008635234},{x:.6030097287429766,y:.09332853215671641},{x:.6040716175948494,y:.10208592939751719},{x:.6034046191024595,y:.11088221994399564},{x:.6010343656438124,y:.11937936728346718},{x:.5970519447300705,y:.12725083080893104},{x:.5916103985635816,y:.13419411459147126},{x:.5849188427118694,y:.1399423921291632},{x:.5772344299136477,y:.14427476033990455},{x:.15453394878652635,y:.33060846154195217},{x:.577233294268374,y:.5169277390666714},{x:.5849178265486336,y:.521259895342773},{x:.5916095409329668,y:.527007988327879},{x:.5970512785903404,y:.5339511220321395},{x:.6010339165943431,y:.5418224757210541},{x:.6034044043999703,y:.5503195576866639},{x:.6040716454902366,y:.5591158298342486},{x:.6030099981642363,y:.5678732563581832},{x:.6002602609333286,y:.5762552942683741},{x:.5959281046572271,y:.5839398265486336},{x:.5901800116721211,y:.5906315409329669},{x:.5832368779678606,y:.5960732785903404},{x:.5753655242789459,y:.6000559165943432},{x:.5668684423133362,y:.6024264043999704},{x:.5580721701657515,y:.6030936454902367},{x:.5493147436418169,y:.6020319981642364},{x:.540932705731626,y:.5992822609333287},{x:.024818705731625975,y:.37178726093332853},{x:.02185350270731245,y:.3701156272641339},{x:.018816169191068974,y:.3685789447300705},{x:.01801778796371134,y:.36795324247690187},{x:.01713417345136639,y:.367455104657227},{x:.01455206552252819,y:.3652371085473975},{x:.011872885408528756,y:.3631373985635815},{x:.011211913306643135,y:.3623679625530219},{x:.010442459067033207,y:.36170701167212105},{x:.008342675193313383,y:.3590278894682912},{x:.006124607870836803,y:.3564458427118694},{x:.005626445681621026,y:.3555622419382997},{x:.005000721409659611,y:.3547638779678605},{x:.0034639551077528313,y:.3517265868338544},{x:.0017922396600954515,y:.3487614299136476},{x:.0014760314771086122,y:.3477976206592673},{x:.0010180834056568513,y:.3468925242789459},{x:.00010339174271701993,y:.34361378560971106},{x:-.0009577287429766018,y:.3403794678432836},{x:-.0010798312165939596,y:.33937248875722786},{x:-.0013524043999703778,y:.33839544231333624},{x:-.001609870336301571,y:.33500125619719334},{x:-.0020196175948493655,y:.3316220706024828},{x:-.001942922029511974,y:.3306106193263084},{x:-.002019645490236678,y:.32959917016575135}]],"=":[[{x:-.002030999999999998,y:.19162999999999997},{x:-.0011663376181453647,y:.1828509355092742},{x:.0013944210369920967,y:.17440924554357093},{x:.005552867446385459,y:.16662933951411787},{x:.011149194846605363,y:.15981019484660533},{x:.017968339514117915,y:.15421386744638543},{x:.025748245543570962,y:.15005542103699207},{x:.03418993550927423,y:.1474946623818546},{x:.042969,y:.14662999999999998},{x:.559083,y:.14662999999999998},{x:.5678620644907257,y:.1474946623818546},{x:.576303754456429,y:.15005542103699207},{x:.5840836604858821,y:.15421386744638543},{x:.5909028051533947,y:.15981019484660533},{x:.5964991325536145,y:.16662933951411787},{x:.6006575789630079,y:.17440924554357093},{x:.6032183376181454,y:.1828509355092742},{x:.604083,y:.19162999999999997},{x:.6032183376181454,y:.20040906449072574},{x:.6006575789630079,y:.208850754456429},{x:.5964991325536145,y:.21663066048588206},{x:.5909028051533947,y:.2234498051533946},{x:.5840836604858821,y:.2290461325536145},{x:.576303754456429,y:.23320457896300786},{x:.5678620644907257,y:.23576533761814533},{x:.559083,y:.23662999999999995},{x:.042969,y:.23662999999999995},{x:.03418993550927421,y:.23576533761814533},{x:.025748245543570934,y:.23320457896300786},{x:.017968339514117904,y:.2290461325536145},{x:.011149194846605356,y:.2234498051533946},{x:.005552867446385459,y:.21663066048588206},{x:.0013944210369920967,y:.208850754456429},{x:-.0011663376181453647,y:.20040906449072574},{x:-.002030999999999998,y:.19162999999999997}],[{x:-.002030999999999998,y:.454102},{x:-.0011663376181453647,y:.4453229355092742},{x:.0013944210369920967,y:.436881245543571},{x:.005552867446385459,y:.4291013395141179},{x:.011149194846605363,y:.42228219484660534},{x:.017968339514117915,y:.41668586744638547},{x:.025748245543570962,y:.4125274210369921},{x:.03418993550927423,y:.40996666238185464},{x:.042969,y:.409102},{x:.559083,y:.409102},{x:.5678620644907257,y:.40996666238185464},{x:.576303754456429,y:.4125274210369921},{x:.5840836604858821,y:.41668586744638547},{x:.5909028051533947,y:.42228219484660534},{x:.5964991325536145,y:.4291013395141179},{x:.6006575789630079,y:.436881245543571},{x:.6032183376181454,y:.4453229355092742},{x:.604083,y:.454102},{x:.6032183376181454,y:.4628810644907258},{x:.6006575789630079,y:.471322754456429},{x:.5964991325536145,y:.4791026604858821},{x:.5909028051533947,y:.48592180515339467},{x:.5840836604858821,y:.49151813255361454},{x:.576303754456429,y:.49567657896300793},{x:.5678620644907257,y:.49823733761814537},{x:.559083,y:.499102},{x:.042969,y:.499102},{x:.03418993550927421,y:.49823733761814537},{x:.025748245543570934,y:.49567657896300793},{x:.017968339514117904,y:.49151813255361454},{x:.011149194846605356,y:.48592180515339467},{x:.005552867446385459,y:.4791026604858821},{x:.0013944210369920967,y:.471322754456429},{x:-.0011663376181453647,y:.4628810644907258},{x:-.002030999999999998,y:.454102}]],">":[[{x:-.002019645490236678,y:.5591158298342487},{x:-.0013524043999703708,y:.5503195576866637},{x:.0010180834056568513,y:.5418224757210541},{x:.005000721409659611,y:.5339511220321396},{x:.01044245906703322,y:.527007988327879},{x:.01713417345136643,y:.521259895342773},{x:.024818705731625975,y:.5169277390666714},{x:.44751805121347366,y:.33060846154195217},{x:.024817570086352318,y:.14427476033990455},{x:.017133157288130554,y:.1399423921291632},{x:.01044160143641841,y:.13419411459147126},{x:.00500005526992945,y:.12725083080893107},{x:.0010176343561875828,y:.11937936728346718},{x:-.0013526191024594778,y:.11088221994399562},{x:-.0020196175948493655,y:.10208592939751718},{x:-.0009577287429766018,y:.0933285321567164},{x:.0017922396600954585,y:.08494657008635234},{x:.00612460787083681,y:.07726215728813059},{x:.011872885408528759,y:.07057060143641844},{x:.018816169191068984,y:.06512905526992947},{x:.02668763271653284,y:.061146634356187606},{x:.03518478005600438,y:.058776380897540545},{x:.04398107060248284,y:.05810938240515066},{x:.052738467843283614,y:.05917127125702342},{x:.06112042991364768,y:.06192123966009548},{x:.5772344299136477,y:.28943323966009543},{x:.5801995868338548,y:.29110495510775297},{x:.5832368779678606,y:.2926417214096596},{x:.5840352419382998,y:.29326744568162105},{x:.5849188427118694,y:.2937656078708368},{x:.5875008894682915,y:.29598367519331353},{x:.5901800116721211,y:.29808345906703315},{x:.5908409625530218,y:.2988529133066429},{x:.5916103985635817,y:.29951388540852875},{x:.5937101085473976,y:.3021930655225282},{x:.5959281046572271,y:.3047751734513664},{x:.5964262424769022,y:.30565878796371176},{x:.5970519447300705,y:.30645716919106897},{x:.5985886272641329,y:.3094945027073105},{x:.6002602609333286,y:.31245970573162596},{x:.6005764425347265,y:.31342352370653376},{x:.6010343656438124,y:.31432863271653283},{x:.6019489668801197,y:.31760739661134507},{x:.6030099981642363,y:.32084174364181683},{x:.6031320728657319,y:.3218487260950267},{x:.6034046191024595,y:.3228257800560044},{x:.6036619914284146,y:.3262199732716634},{x:.6040716454902366,y:.32959917016575135},{x:.603994922029512,y:.330610619326308},{x:.6040716175948494,y:.33162207060248283},{x:.6036618703363014,y:.3350012561971954},{x:.6034044043999703,y:.33839544231333624},{x:.6031318312165941,y:.33937248875722736},{x:.6030097287429766,y:.3403794678432836},{x:.6019486082572825,y:.3436137856097129},{x:.6010339165943431,y:.3468925242789459},{x:.6005759685228916,y:.3477976206592668},{x:.6002597603399046,y:.34876142991364767},{x:.5985880448922466,y:.3517265868338553},{x:.5970512785903404,y:.3547638779678605},{x:.596425554318379,y:.35556224193829966},{x:.5959273921291631,y:.35644584271186947},{x:.5937093248066866,y:.3590278894682911},{x:.5916095409329668,y:.36170701167212105},{x:.5908400866933569,y:.3623679625530219},{x:.5901791145914712,y:.36313739856358157},{x:.5874999344774714,y:.3652371085473978},{x:.5849178265486336,y:.367455104657227},{x:.5840342120362888,y:.36795324247690175},{x:.583235830808931,y:.3685789447300705},{x:.5801984972926872,y:.37011562726413405},{x:.577233294268374,y:.37178726093332853},{x:.06111929426837402,y:.5992822609333287},{x:.05273725635818315,y:.6020319981642364},{x:.04397982983424857,y:.6030936454902367},{x:.035183557686663716,y:.6024264043999704},{x:.02668647572105406,y:.6000559165943432},{x:.018815122032139416,y:.5960732785903404},{x:.011871988327878898,y:.5906315409329669},{x:.006123895342772898,y:.5839398265486336},{x:.001791739066671405,y:.5762552942683741},{x:-.0009579981642362442,y:.5678732563581832},{x:-.002019645490236678,y:.5591158298342487}]],A:[[{x:-.026930267425517032,y:.05053409251215203},{x:-.025968910797820398,y:.041765089843587025},{x:-.02331527881378681,y:.03335213247651147},{x:-.019071349062388714,y:.025618525644501258},{x:-.013400213383949137,y:.018861467521053887},{x:-.006519810342180955,y:.013340628060451547},{x:.0013054500325951415,y:.009268170027042777},{x:.009774847372633092,y:.006800595699190677},{x:.018562907487847988,y:.006032732574482988},{x:.02733191015641301,y:.006994089202179622},{x:.035744867523488544,y:.00964772118621321},{x:.043478474355498745,y:.013891650937611293},{x:.05023553247894613,y:.019562786616050876},{x:.055756371939548466,y:.02644318965781906},{x:.05982882997295724,y:.03426845003259516},{x:.15465984441872488,y:.2705423452957767},{x:.155303,y:.27047899999999997},{x:.433548,y:.27047899999999997},{x:.439584057854266,y:.2710734998088117},{x:.5426964027293978,y:.03313672871631684},{x:.5469805748198717,y:.025425342079263714},{x:.5526868446471364,y:.018697928086846893},{x:.559595923461843,y:.013213017486017727},{x:.5674422992397985,y:.009181392315192764},{x:.5759244401601543,y:.006757985668725375},{x:.5847163823041805,y:.006035927704977205},{x:.5934802562658602,y:.007042966706560308},{x:.6018792712836831,y:.009740402729397836},{x:.6095906579207363,y:.01402457481987169},{x:.6163180719131531,y:.019730844647136342},{x:.6218029825139822,y:.026639923461843008},{x:.6258346076848073,y:.03448629923979854},{x:.6282580143312746,y:.042968440160154345},{x:.6289800722950228,y:.05176038230418057},{x:.6279730332934397,y:.060524256265860256},{x:.6252755972706022,y:.0689232712836832},{x:.3314685972706022,y:.7468972712836831},{x:.3293831787279993,y:.7506509647260751},{x:.32731734906238874,y:.7544154743554987},{x:.32724162770964893,y:.7545056950115825},{x:.32718442518012836,y:.7546086579207363},{x:.324406768107635,y:.7578833802211685},{x:.32164621338394916,y:.7611725324789461},{x:.3215543458189217,y:.761246247067332},{x:.32147815535286367,y:.7613360719131531},{x:.3181150035540548,y:.764005977330098},{x:.314765810342181,y:.7666933719395485},{x:.31466132698386995,y:.7667477476499444},{x:.314569076538157,y:.7668209825139822},{x:.31074967405057474,y:.7687834680795742},{x:.3069405499674049,y:.7707658299729572},{x:.30682746605267575,y:.7707987771773066},{x:.30672270076020147,y:.7708526076848072},{x:.3025938250794972,y:.7720322561793334},{x:.29847115262736695,y:.7732334043008093},{x:.2983538139076442,y:.7732436568565263},{x:.29824055983984565,y:.7732760143312747},{x:.29396088134293,y:.7736274925246428},{x:.289683092512152,y:.774001267425517},{x:.28956600824863027,y:.7739884313326351},{x:.2894486176958195,y:.7739980722950228},{x:.2851826020272766,y:.773507873077374},{x:.280914089843587,y:.7730399107978204},{x:.2808017595188513,y:.7730044793401902},{x:.28068474373413976,y:.7729910332934397},{x:.2765963314836881,y:.7716779947458032},{x:.2725011324765115,y:.7703862788137869},{x:.27239787288194656,y:.7703296136024552},{x:.27228572871631684,y:.7702935972706022},{x:.26853203527393116,y:.7682081787280027},{x:.2647675256445013,y:.7661423490623888},{x:.26467730498841713,y:.7660666277096486},{x:.2645743420792637,y:.7660094251801283},{x:.2612996197788366,y:.7632317681076393},{x:.2580104675210539,y:.7604712133839491},{x:.2579367529326681,y:.7603793458189217},{x:.2578469280868469,y:.7603031553528636},{x:.25517702266989234,y:.7569400035540427},{x:.25248962806045155,y:.7535908103421809},{x:.2524352523500559,y:.7534863269838704},{x:.2523620174860177,y:.753394076538157},{x:.2503995319204231,y:.7495746740505695},{x:.24841717002704278,y:.7457655499674049},{x:-.023694829972957243,y:.06779154996740488},{x:-.026162404300809343,y:.05932215262736691},{x:-.026930267425517032,y:.05053409251215203}],[{x:.19075686729109992,y:.36047899999999994},{x:.2917712201653896,y:.6121588409316518},{x:.4008392655839541,y:.36047899999999994},{x:.19075686729109992,y:.36047899999999994}]],B:[[{x:.018964999999999996,y:.05103000000000002},{x:.018993157630992935,y:.05074411077481729},{x:.01896863696544404,y:.050457886669927884},{x:.019425235762019696,y:.046357147889743},{x:.01982966238185463,y:.04225093550927423},{x:.019913053192865363,y:.04197603284668677},{x:.019944843237820968,y:.04169052471317667},{x:.02119268306568244,y:.037757658485048945},{x:.02239042103699209,y:.03380924554357098},{x:.0225258403659196,y:.03355589379873479},{x:.022612719447780122,y:.03328207355405998},{x:.02460384652213923,y:.029668217721559587},{x:.026548867446385453,y:.026029339514117924},{x:.02673111120436309,y:.02580727485250577},{x:.026869740608734982,y:.025555665255108946},{x:.029527637032761178,y:.022399698271204867},{x:.03214519484660536,y:.019210194846605383},{x:.03236725950821749,y:.019027951088627763},{x:.03255231178483501,y:.01880822135423258},{x:.03577483608951879,y:.016231425260229353},{x:.03896433951411791,y:.013613867446385479},{x:.03921769125895406,y:.013478448117457993},{x:.03944205495260531,y:.013299042336531411},{x:.04310536733612953,y:.011400441961238211},{x:.046744245543570956,y:.009455421036992116},{x:.04701914820615845,y:.009372030225981372},{x:.047274201145921,y:.009239842862072495},{x:.051237522567796415,y:.008092400353164256},{x:.055185935509274225,y:.006894662381854655},{x:.05547182473445692,y:.006866504750861718},{x:.05574776537889109,y:.006786615690234012},{x:.05985878761953148,y:.006434426619834929},{x:.063965,y:.0060300000000000215},{x:.06425088922518268,y:.006058157630992957},{x:.06453711333007213,y:.00603363696544406},{x:.4241221133300721,y:.01060563696544408},{x:.4260098351414485,y:.010815826288282449},{x:.4279092214657345,y:.010813640036582327},{x:.43038314701987823,y:.011302774871886453},{x:.43288947528682337,y:.011581843237821021},{x:.43469991915024053,y:.012156270087817089},{x:.43656323581544765,y:.012524677733968342},{x:.4388942001112364,y:.013487052913568918},{x:.44129792644594007,y:.014249719447780182},{x:.4429615180190356,y:.01516630892323094},{x:.4447171588106798,y:.015891152767997317},{x:.5224141588106799,y:.0573061527679973},{x:.525028554951968,y:.05904868699814221},{x:.5277374225537912,y:.06064039332865708},{x:.5286915199232336,y:.06149010807639827},{x:.529754639763497,y:.06219869339105244},{x:.5319788494519322,y:.06441778869965879},{x:.5343251404217865,y:.06650738469209135},{x:.5350951339540482,y:.06752690757225652},{x:.5359995881074716,y:.06842928201075814},{x:.5377481362120787,y:.07103965980959966},{x:.5396416839038074,y:.07354684346181917},{x:.5707946839038074,y:.12450984346181915},{x:.5718407730360667,y:.12667263757185424},{x:.573076251912317,y:.12873311634664666},{x:.5737567016649755,y:.13063382885667474},{x:.5746357412153917,y:.13245124718509382},{x:.57523978983892,y:.1347765656784282},{x:.576049549867314,y:.13703848290314058},{x:.576346114353134,y:.13903542291661675},{x:.5768537026781452,y:.1409894121704204},{x:.5769924975430949,y:.14338789436140983},{x:.5773454200998597,y:.14576432582559334},{x:.5830324200998597,y:.2611263258255933},{x:.5829003037879823,y:.26382496142481277},{x:.5829742287592172,y:.2665258175697889},{x:.5826851199428378,y:.2682203519457296},{x:.5826010630436497,y:.26993731586400416},{x:.5819450076216034,y:.2725583233230625},{x:.5814906012502021,y:.27522170532098544},{x:.5808764603215925,y:.2768272773619606},{x:.5804590555084463,y:.278494851612457},{x:.5793042728181804,y:.28093750708458076},{x:.5783389976861617,y:.283461062658912},{x:.5774234257367941,y:.284915971131802},{x:.5766887136425759,y:.2864700717712602},{x:.575079581335268,y:.2886405053765124},{x:.5736405324246225,y:.2909272557017569},{x:.5044305324246225,y:.38012925570175693},{x:.5017223718437749,y:.38298983800955333},{x:.499075053174031,y:.3859068173944946},{x:.49869279401231464,y:.38618992769627897},{x:.4983657648506557,y:.38653536283797296},{x:.49515156889241035,y:.38881264393905274},{x:.49198604326106643,y:.39115710813128307},{x:.4915558970220145,y:.39136020348505085},{x:.4911677605809681,y:.39163520096290155},{x:.48757104899345777,y:.3932416662216644},{x:.4840089657752798,y:.3949235187770668},{x:.3737297002329455,y:.43429966367120415},{x:.4408630401939032,y:.4733794631163462},{x:.44336631106573315,y:.475186847643908},{x:.4459719275146733,y:.476843279595192},{x:.4469351296354233,y:.4777635673817196},{x:.4480152047486495,y:.4785433915190981},{x:.45011777274311354,y:.48080441158023823},{x:.45235016915983667,y:.4829373462081214},{x:.4531153243813002,y:.4840278623347861},{x:.4540225100120052,y:.48500341457167107},{x:.4556435746202097,y:.4876311804334344},{x:.4574169612623637,y:.4901586502563309},{x:.45795466509848404,y:.4913774867999537},{x:.45865409861163536,y:.4925112772109775},{x:.4597313632297904,y:.4954048053049642},{x:.460977589843244,y:.49822968107500176},{x:.46126717863714684,y:.4995299988307428},{x:.46173198119508085,y:.5007784564862466},{x:.46222404714804793,y:.5038265501505143},{x:.4628952219429378,y:.5068402734760588},{x:.4768502219429378,y:.6216502734760588},{x:.47694604753136066,y:.6258560133977795},{x:.4770801736029929,y:.6300607061367898},{x:.47704647561686464,y:.6302637547476413},{x:.47705116403527437,y:.6304695272224051},{x:.47632464920624185,y:.6346131496757303},{x:.47563590322258376,y:.6387632171212809},{x:.475563239914934,y:.6389557900590453},{x:.4755276940283349,y:.6391585233384632},{x:.47400675833929046,y:.6430807912362932},{x:.4725216084222428,y:.647016748623825},{x:.4724127722032346,y:.6471914454185},{x:.4723383580201142,y:.6473833485763381},{x:.4700814501766401,y:.6509335313629835},{x:.46785696980463054,y:.6545041220574128},{x:.46771614318912413,y:.6546542292091504},{x:.46760572040480797,y:.6548279275146733},{x:.4646995721096373,y:.6578695936566139},{x:.4618212468158623,y:.6609376018599591},{x:.3721282468158623,y:.739463601859959},{x:.3693406873548985,y:.7414576112446344},{x:.36664335021940475,y:.7435720694617842},{x:.36575927454484214,y:.7440194833243711},{x:.36495338890552403,y:.7445959530105889},{x:.3618303796850022,y:.746007822191186},{x:.35877236079175173,y:.7475554273162446},{x:.35781798626885214,y:.7478217696388809},{x:.3569151218394033,y:.7482299421328396},{x:.35357667835226414,y:.7490054137685334},{x:.3502754956523681,y:.7499266922044516},{x:.21714549565236804,y:.7733246922044517},{x:.2164184100494338,y:.7733799121498203},{x:.21571010443589486,y:.773553134187072},{x:.21202614434596675,y:.7737134914026773},{x:.20834928456346336,y:.7739927377465721},{x:.20762539682958886,y:.7739050492917646},{x:.20689690716677497,y:.7739367593459113},{x:.061505907166774995,y:.7659797593459113},{x:.05835682356136361,y:.7654946428322841},{x:.055185935509274225,y:.7651823376181454},{x:.05400593378019863,y:.7648243880069794},{x:.05278721145616079,y:.7646366437616691},{x:.0497932781460736,y:.7635464928911877},{x:.046744245543570956,y:.7626215789630079},{x:.045656749721751114,y:.7620403003359452},{x:.0444980718907103,y:.7616184026130197},{x:.04177434405403643,y:.7599651112722733},{x:.03896433951411791,y:.7584631325536145},{x:.03801114145411163,y:.7576808631223083},{x:.03695703545532078,y:.7570410252146568},{x:.03460818442533898,y:.7548881284626934},{x:.03214519484660536,y:.7528668051533947},{x:.03136292541529926,y:.7519136070933885},{x:.03045389995114224,y:.7510804176129765},{x:.02857019075568381,y:.7485106500646154},{x:.026548867446385453,y:.7460476604858821},{x:.025967588819322866,y:.7449601646640625},{x:.025238577228599887,y:.7439656426153641},{x:.023892399755650346,y:.7410777589963466},{x:.02239042103699209,y:.738267754456429},{x:.022032471425826126,y:.7370877527273536},{x:.021511489215134356,y:.7359701170349662},{x:.02075457631003429,y:.7328750970932278},{x:.01982966238185463,y:.7298260644907257},{x:.019708797589401895,y:.7285989036590902},{x:.01941586581292807,y:.7274011044358949},{x:.019277305214138767,y:.7242178880520896},{x:.018964999999999996,y:.721047},{x:.018964999999999996,y:.05103000000000002}],[{x:.10896499999999999,y:.09660579683225357},{x:.10896499999999999,y:.37786028838708235},{x:.29722384626437015,y:.36605169579422814},{x:.44137514989764515,y:.3145812530901673},{x:.49232133133007555,y:.24891875813083103},{x:.48801965008125897,y:.1616582425292873},{x:.46925190911582665,y:.130956211173677},{x:.41203782454012283,y:.1004592638951106},{x:.10896499999999999,y:.09660579683225357}],[{x:.10896499999999999,y:.47257215902605326},{x:.10896499999999999,y:.6784424315209651},{x:.20665565807681563,y:.6837888736412973},{x:.32230778354311135,y:.6634626629325134},{x:.3846372425734713,y:.608893375476212},{x:.3762519660226853,y:.5399063743443061},{x:.2981741908903496,y:.4944555775409729},{x:.10896499999999999,y:.47257215902605326}]],C:[[{x:.028007484408327545,y:.4010798543150725},{x:.028340096336253087,y:.39680461654123217},{x:.028649292669517497,y:.39252762152779447},{x:.06572429266951751,y:.1769866215277945},{x:.0657499934516808,y:.17689321918606288},{x:.06575739253020782,y:.1767966283931179},{x:.06691993730130205,y:.17264138379230456},{x:.0680646634579554,y:.1684811950870131},{x:.0681080922997215,y:.16839460141895576},{x:.06813419313592875,y:.16830131007962543},{x:.07008504794245551,y:.16445270857242494},{x:.07201939106115751,y:.16059578172109576},{x:.07207887901649253,y:.16051932447281397},{x:.0721226785698821,y:.1604329177209502},{x:.1274306785698821,y:.07363491772095027},{x:.13009575906138268,y:.07023973030268985},{x:.13274648275581225,y:.06683332229320074},{x:.13281865262016482,y:.06677089175108791},{x:.13287757357360944,y:.06669582922279092},{x:.1361538134974972,y:.06388581079003605},{x:.13941816151489866,y:.0610619864944041},{x:.19692016151489866,y:.020443986494404057},{x:.19808425112310213,y:.019782383965415776},{x:.19914710087537263,y:.01896802966513257},{x:.20191114759162085,y:.01760739299916557},{x:.20458957759683996,y:.01608512525217841},{x:.2058603718000633,y:.015663337846789194},{x:.20706167183504787,y:.015071982836463577},{x:.21003805521400143,y:.014276729186446702},{x:.2129619996426652,y:.013306247159584957},{x:.21429066253234816,y:.013140483931242813},{x:.21558424756339917,y:.01279485365228588},{x:.32760524756339915,y:-.005618146347714133},{x:.32775803960473765,y:-.005628051859015257},{x:.32790622767465843,y:-.005666572281957827},{x:.3321581535063009,y:-.005913311337168391},{x:.3364083102547015,y:-.006188849089881349},{x:.3365600989091985,y:-.006168756021014132},{x:.33671295454862427,y:-.006177626226551311},{x:.34093131721939995,y:-.005590114680318674},{x:.3451535631465426,y:-.005031193603710363},{x:.34529851526132993,y:-.004981874120043047},{x:.3454501643137599,y:-.004960753231150514},{x:.44307616431375996,y:.01857424676884946},{x:.4458503498549469,y:.019539172468847843},{x:.4486819664572553,y:.020319643122350156},{x:.45000735163266253,y:.02098507354168687},{x:.45140809089867484,y:.021472282957461515},{x:.45394072357704407,y:.022959884631265325},{x:.4565656691892177,y:.024277779754777677},{x:.4577357684253341,y:.0251889939358613},{x:.459014543037309,y:.025940112433793877},{x:.4612082951993476,y:.027893222383335445},{x:.4635256946335971,y:.029697896006345384},{x:.5358116946335971,y:.09837789600634546},{x:.5383578959705028,y:.10132350300922108},{x:.5409714489909738,y:.10420951799057969},{x:.5412394420583803,y:.10465705806338507},{x:.5415805729157932,y:.10505169984914184},{x:.5435031902892489,y:.10843744707814906},{x:.545503491029224,y:.11177788699125937},{x:.5456790239480676,y:.11226911056087577},{x:.5459366092786453,y:.11272272074420048},{x:.5471617575812067,y:.11641849583208026},{x:.548471935605029,y:.12008498944441898},{x:.572709935605029,y:.21701898944441894},{x:.5740007070580636,y:.2257455880614603},{x:.5735642017652605,y:.23455632455146336},{x:.571417194380227,y:.24311260725223527},{x:.5676421931927146,y:.25108562301800397},{x:.5623842693813143,y:.2581689733242098},{x:.5558454820094204,y:.2640904489909738},{x:.5482771130087407,y:.26862249102922403},{x:.539970010555581,y:.27159093560502906},{x:.5312434119385397,y:.2728817070580635},{x:.5224326754485367,y:.2724452017652604},{x:.5138763927477648,y:.270298194380227},{x:.5059033769819961,y:.26652319319271456},{x:.49882002667579023,y:.2612652693813142},{x:.49289855100902624,y:.25472648200942033},{x:.488366508970776,y:.24715811300874066},{x:.48539806439497096,y:.23885101055558106},{x:.46433420621000654,y:.15461122058523102},{x:.4102697826671089,y:.10324381045150927},{x:.3332137540403124,y:.08466767669890593},{x:.24039332695070226,y:.09992465997883551},{x:.1985742470214596,y:.12946463056361485},{x:.15288732813236672,y:.2011637190451272},{x:.11884238546013813,y:.39908903228895243},{x:.16184523767713488,y:.5942488915238071},{x:.2166399992296726,y:.6603981208316636},{x:.2708106585112101,y:.6880654725502051},{x:.33167151101531583,y:.6962265900331734},{x:.41875307675349,y:.6679697644015699},{x:.4604926982936834,y:.628705384802963},{x:.487421989657252,y:.5630715564186946},{x:.49155436139101494,y:.5552777692634718},{x:.49712782320648147,y:.5484399232752638},{x:.5039281900917167,y:.5428207930406891},{x:.5116941277610109,y:.5386363185834178},{x:.5201271955849208,y:.5360473069101626},{x:.5289033154962927,y:.5351532522875923},{x:.5376852261286371,y:.5359885127334604},{x:.5461354435813054,y:.5385209896572519},{x:.5539292307365281,y:.5426533613910148},{x:.5607670767247361,y:.5482268232064814},{x:.5663862069593109,y:.5550271900917166},{x:.5705706814165822,y:.5627931277610108},{x:.5731596930898373,y:.5712261955849207},{x:.5740537477124077,y:.5800023154962926},{x:.5732184872665396,y:.588784226128637},{x:.570686010342748,y:.5972344435813053},{x:.540057010342748,y:.6718854435813053},{x:.5396985836895672,y:.6725614478775368},{x:.539454213118803,y:.6732865233897278},{x:.5376352487491008,y:.6764529645154376},{x:.5359246386089851,y:.679679230736528},{x:.5354412171276051,y:.6802723202285732},{x:.5350600868536766,y:.680935789284769},{x:.5326583313554347,y:.6836865257875079},{x:.5303511767935185,y:.686517076724736},{x:.5297613381003629,y:.6870044593160238},{x:.5292580947459566,y:.687580825172473},{x:.47307109474595666,y:.7404358251724731},{x:.4722065860115991,y:.7411021817697292},{x:.4714497622811152,y:.7418887085063782},{x:.4687194058651613,y:.7437900730587934},{x:.46608420409854834,y:.7458212660502541},{x:.46510630693397415,y:.746306161504971},{x:.46421058160492856,y:.7469299263656303},{x:.4611617503991064,y:.748262090618912},{x:.45818091720073817,y:.7497401524453693},{x:.45712721164557074,y:.7500249524971546},{x:.4561270069400303,y:.7504619845480405},{x:.3497190069400303,y:.7849899845480404},{x:.34852117258500637,y:.7852523061157466},{x:.34737251112679673,y:.7856814874310271},{x:.34422084285321763,y:.7861940634064482},{x:.3411016855274714,y:.7868771480384597},{x:.33987569082458696,y:.7869007432807547},{x:.3386653714532072,y:.7870975852636362},{x:.3354742629896646,y:.786985452257037},{x:.33228177619648713,y:.7870468942022847},{x:.3310747354346284,y:.7868308563672394},{x:.32984927004476555,y:.7867877944907101},{x:.25121827004476555,y:.7762437944907102},{x:.24809780050166644,y:.7755083028870222},{x:.24494229970605153,y:.7749416523797719},{x:.24381291428322105,y:.7744983594176508},{x:.24263200473447152,y:.7742200201979198},{x:.2397149814324578,y:.772889887451158},{x:.2367306607297473,y:.771718517308175},{x:.16743766072974728,y:.7363275173081749},{x:.16716950847174827,y:.7361554960544541},{x:.16687461978467572,y:.7360349240533984},{x:.16345937419922074,y:.733775423054901},{x:.16001260855282193,y:.7315643025810339},{x:.15978316844705134,y:.7313432727571054},{x:.15951746839392553,y:.7311674875843215},{x:.15660865257214304,y:.7282851209029094},{x:.15365948376641753,y:.7254440558690711},{x:.15347757306746915,y:.725182511527114},{x:.15325127235232486,y:.7249582685082102},{x:.08558827235232488,y:.6432742685082102},{x:.0845522070982367,y:.6417389136031936},{x:.0833480194008015,y:.6403315480201149},{x:.08209078724421986,y:.6380913122274521},{x:.0806538380596292,y:.6359618836319892},{x:.07993721339171088,y:.6342539038369039},{x:.07903072722802115,y:.632638655023214},{x:.07823470075697891,y:.6301961909068614},{x:.07724079305844417,y:.627827343805619},{x:.07687114846079628,y:.6260123758261444},{x:.07629719958575912,y:.6242513168879111},{x:.02905219958575911,y:.40983931688791114},{x:.028544362954760993,y:.4055813372409792},{x:.028013217832748447,y:.4013262022752188},{x:.028022142274708197,y:.401202753871557},{x:.028007484408327545,y:.4010798543150725}]],D:[[{x:.019456783112310236,y:.0515304721392918},{x:.019516560837245702,y:.0508455251733057},{x:.019462408649259272,y:.05016011050819538},{x:.01989956114396584,y:.04645701928180655},{x:.020223754746627687,y:.042742334175020345},{x:.02041601038349858,y:.04208221032853139},{x:.020496616482350807,y:.04139940114622653},{x:.021647806474261868,y:.03785274800035644},{x:.022690469901424933,y:.03427268656062632},{x:.023007815173924504,y:.033662754022853354},{x:.023220081912440925,y:.03300879029730612},{x:.025041069815762075,y:.029754871123364675},{x:.026762134096652887,y:.026447013104097812},{x:.027192373603928278,y:.025910711240413317},{x:.027528143690388265,y:.025310724430849408},{x:.029948949961216734,y:.02247458551787214},{x:.03228227556070457,y:.019566050047680916},{x:.03280887543977226,y:.01912398863794477},{x:.03325524541805519,y:.01860103590097925},{x:.03618283982900684,y:.01629166847686688},{x:.03903875835284746,y:.013894228942745224},{x:.03964148166567549,y:.013563396159022682},{x:.0401812977878431,y:.013137574275061882},{x:.04350317452751879,y:.011443726034814963},{x:.04677193462845869,y:.0096495146935595},{x:.04742761905614622,y:.009442624254195854},{x:.048040136491355995,y:.009130297319436702},{x:.05162863769958001,y:.008117061901006828},{x:.05518462276008175,y:.0069950292882567724},{x:.05586807071778482,y:.006920031876811272},{x:.05652975076450537,y:.006733202440201605},{x:.060246972352300414,y:.0064395179124900545},{x:.06395352786070822,y:.006032783112310258},{x:.06463847482669428,y:.006092560837245719},{x:.06532388949180462,y:.006038408649259287},{x:.22607288949180462,y:.009146408649259287},{x:.22716730592225892,y:.009275605270020776},{x:.2282688262216939,y:.009242558031150067},{x:.23153975417198444,y:.00979177582685766},{x:.23483359885377353,y:.010180616482350843},{x:.23588178136904675,y:.010520840680108605},{x:.23696858346127098,y:.010703324384590318},{x:.374121583461271,y:.04785532438459028},{x:.3763172878682137,y:.048688585594252994},{x:.37858028056243914,y:.049316523610364836},{x:.3804311803743379,y:.05024979166335608},{x:.3823691959266467,y:.050985260963484026},{x:.38436014929137596,y:.0522308719724549},{x:.38645715458576285,y:.05328823230909956},{x:.47004915458576285,y:.1063032323090996},{x:.47296331256678825,y:.10858070495130694},{x:.47594842000778254,y:.11076435600861785},{x:.476434095048061,y:.11129319075325024},{x:.4769998347544389,y:.11173532762855881},{x:.47941368513584726,y:.11453756329148114},{x:.48191542538645477,y:.11726162167794474},{x:.5445294253864548,y:.20053762167794476},{x:.5457907389554543,y:.20261097926106453},{x:.5472304508598836,y:.2045646816997861},{x:.5480776582474705,y:.2063702359380903},{x:.54911422277829,y:.20807414921008693},{x:.5499468085621922,y:.21035373787896267},{x:.5509777083681839,y:.21255077433219424},{x:.570480708368184,y:.26758877433219413},{x:.5715324066676154,y:.27184261440989077},{x:.5725895850614416,y:.2760950958693092},{x:.5821235850614417,y:.3411630958693092},{x:.5823063349967632,y:.3450227385412275},{x:.5825832689280143,y:.34887676846995497},{x:.5805752689280143,y:.424797768469955},{x:.5800798101377765,y:.42875301375722},{x:.5796594372976747,y:.43271694253692033},{x:.5588164372976746,y:.5335539425369203},{x:.5581925601051908,y:.535556542700639},{x:.5577783377379867,y:.5376127649642906},{x:.5568838034059929,y:.5397575559956548},{x:.5561926080991778,y:.5419762423834013},{x:.555190030621201,y:.5438186507441294},{x:.5543826183570809,y:.5457545524985521},{x:.5020956183570809,y:.6430055524985521},{x:.5018901867095668,y:.6433113858234256},{x:.5017428412228655,y:.6436490624319612},{x:.4994325691935421,y:.6469701275279692},{x:.4971767628200625,y:.6503284258808291},{x:.4969156133622187,y:.650588304977856},{x:.4967052216394318,y:.6508907475465959},{x:.49379143318032753,y:.6536972875938759},{x:.49092379998669317,y:.6565509711937552},{x:.49061696854573045,y:.6567549090549786},{x:.49035161582277553,y:.657010494885618},{x:.39890061582277553,y:.7292364948856179},{x:.3986791836579038,y:.7293785203585265},{x:.39848760231040037,y:.7295587979940886},{x:.39496847203231433,y:.7317585520660096},{x:.39147518928128755,y:.7339991259907827},{x:.39123030407812903,y:.7340952232117042},{x:.391007233490524,y:.7342346611962726},{x:.3871265715837099,y:.7357055993513507},{x:.38326329699273004,y:.7372216156196327},{x:.3830043695523095,y:.737268091626259},{x:.38275838220218455,y:.7373613314362847},{x:.25909638220218456,y:.7708063314362847},{x:.2580664240588666,y:.7709788511982676},{x:.2570738325025125,y:.7713034106651087},{x:.2537238261308602,y:.7717062438265866},{x:.2503960471743838,y:.7722636525302581},{x:.2493522224520667,y:.7722319225075465},{x:.24831538485324267,y:.7723566006488801},{x:.17218438485324267,y:.7739936006488801},{x:.16854768223369815,y:.7737142062783378},{x:.16490357022768087,y:.7735589167265521},{x:.06552457022768086,y:.7594769167265522},{x:.06454980411013514,y:.759239472501363},{x:.06355033417502035,y:.7591522452533723},{x:.06027159361314519,y:.7581973390517399},{x:.056953647958865025,y:.7573891174476861},{x:.056043934769293216,y:.7569660682109414},{x:.05508068656062633,y:.7566855300985751},{x:.05205123903764884,y:.7551093215998242},{x:.04895472299174925,y:.7536693306611393},{x:.04814502249785432,y:.7530769339577588},{x:.0472550131040978,y:.7526138659033472},{x:.04459127858939255,y:.7504769279161366},{x:.04183518952697092,y:.7484605056870383},{x:.041156618064647085,y:.7477215269901124},{x:.040374050047680896,y:.7470937244392954},{x:.03817839436480973,y:.744478178292066},{x:.035868647242901154,y:.7419628147479951},{x:.03534728193289863,y:.7411056525944231},{x:.03470222894274521,y:.7403372416471526},{x:.03305902990826266,y:.7373436013115269},{x:.03128438701344127,y:.73442596046285},{x:.030940263632238257,y:.7334835551134912},{x:.030457514693559486,y:.7326040653715413},{x:.029429919524844063,y:.7293473747667649},{x:.028258579388326675,y:.7261395799150647},{x:.028104922404476318,y:.7251481474789881},{x:.02780302928825676,y:.7241913772399183},{x:.02743052789135989,y:.7207967891595589},{x:.026907504457698045,y:.7174221140620348},{x:.02695021882291786,y:.7164197547317572},{x:.026840783112310238,y:.7154224721392919},{x:.019456783112310236,y:.0515304721392918}],[{x:.1099671672449683,y:.09691838411671685},{x:.1164055200593884,y:.675787686211921},{x:.17390769441284104,y:.6839357418297609},{x:.2408956143230629,y:.6824953400894312},{x:.35035782392371695,y:.652890743688808},{x:.42724604872976657,y:.5921661050862587},{x:.4720072878873445,y:.5089126143655517},{x:.4907125333997566,y:.41841792349882906},{x:.4925121994894803,y:.35037387509349616},{x:.4841787199640398,y:.2934992321564965},{x:.4684498534661817,y:.24911194023683725},{x:.41491413338319044,y:.1779099626338861},{x:.34401115658372555,y:.1329424859013802},{x:.21878934362335548,y:.0990224054430332},{x:.1099671672449683,y:.09691838411671685}]],E:[[{x:.035078,y:.05103000000000002},{x:.03594266238185463,y:.04225093550927423},{x:.03850342103699209,y:.03380924554357098},{x:.042661867446385456,y:.026029339514117924},{x:.04825819484660536,y:.019210194846605383},{x:.05507733951411791,y:.013613867446385479},{x:.06285724554357096,y:.009455421036992116},{x:.07129893550927423,y:.006894662381854655},{x:.080078,y:.0060300000000000215},{x:.521974,y:.0060300000000000215},{x:.5307530644907258,y:.006894662381854655},{x:.5391947544564291,y:.009455421036992116},{x:.5469746604858822,y:.013613867446385479},{x:.5537938051533947,y:.019210194846605383},{x:.5593901325536146,y:.026029339514117924},{x:.5635485789630079,y:.03380924554357098},{x:.5661093376181454,y:.04225093550927425},{x:.5669740000000001,y:.05103000000000002},{x:.5661093376181454,y:.05980906449072579},{x:.5635485789630079,y:.06825075445642906},{x:.5593901325536146,y:.07603066048588211},{x:.5537938051533947,y:.08284980515339466},{x:.5469746604858822,y:.08844613255361455},{x:.5391947544564291,y:.09260457896300792},{x:.5307530644907258,y:.09516533761814538},{x:.521974,y:.09603000000000002},{x:.125078,y:.09603000000000002},{x:.125078,y:.345019},{x:.389405,y:.345019},{x:.3981840644907258,y:.34588366238185464},{x:.40662575445642907,y:.3484444210369921},{x:.4144056604858821,y:.35260286744638547},{x:.42122480515339467,y:.35819919484660534},{x:.42682113255361454,y:.3650183395141179},{x:.4309795789630079,y:.372798245543571},{x:.43354033761814537,y:.3812399355092742},{x:.434405,y:.390019},{x:.43354033761814537,y:.3987980644907258},{x:.4309795789630079,y:.407239754456429},{x:.42682113255361454,y:.4150196604858821},{x:.42122480515339467,y:.42183880515339467},{x:.4144056604858821,y:.42743513255361454},{x:.40662575445642907,y:.43159357896300793},{x:.3981840644907258,y:.43415433761814537},{x:.389405,y:.435019},{x:.125078,y:.435019},{x:.125078,y:.684004},{x:.521974,y:.684004},{x:.5307530644907258,y:.6848686623818546},{x:.5391947544564291,y:.6874294210369921},{x:.5469746604858822,y:.6915878674463855},{x:.5537938051533947,y:.6971841948466053},{x:.5593901325536146,y:.7040033395141179},{x:.5635485789630079,y:.711783245543571},{x:.5661093376181454,y:.7202249355092742},{x:.5669740000000001,y:.729004},{x:.5661093376181454,y:.7377830644907257},{x:.5635485789630079,y:.746224754456429},{x:.5593901325536146,y:.7540046604858821},{x:.5537938051533947,y:.7608238051533946},{x:.5469746604858822,y:.7664201325536145},{x:.5391947544564291,y:.7705785789630079},{x:.5307530644907258,y:.7731393376181454},{x:.521974,y:.774004},{x:.080078,y:.774004},{x:.07129893550927423,y:.7731393376181454},{x:.06285724554357093,y:.7705785789630079},{x:.05507733951411791,y:.7664201325536145},{x:.04825819484660536,y:.7608238051533946},{x:.042661867446385456,y:.7540046604858821},{x:.03850342103699209,y:.746224754456429},{x:.03594266238185463,y:.7377830644907257},{x:.035078,y:.729004},{x:.035078,y:.05103000000000002}]],F:[[{x:.041426000000000004,y:.05103000000000002},{x:.04229066238185464,y:.04225093550927423},{x:.0448514210369921,y:.03380924554357098},{x:.04900986744638546,y:.026029339514117924},{x:.054606194846605366,y:.019210194846605383},{x:.06142533951411792,y:.013613867446385479},{x:.06920524554357096,y:.009455421036992116},{x:.07764693550927423,y:.006894662381854655},{x:.086426,y:.0060300000000000215},{x:.09520506449072577,y:.006894662381854655},{x:.10364675445642904,y:.009455421036992116},{x:.11142666048588211,y:.013613867446385486},{x:.11824580515339464,y:.019210194846605383},{x:.12384213255361454,y:.026029339514117924},{x:.1280005789630079,y:.03380924554357098},{x:.13056133761814537,y:.04225093550927425},{x:.131426,y:.05103000000000002},{x:.131426,y:.347323},{x:.447344,y:.347323},{x:.4561230644907258,y:.3481876623818546},{x:.4645647544564291,y:.35074842103699205},{x:.47234466048588214,y:.35490686744638544},{x:.47916380515339463,y:.3605031948466053},{x:.48476013255361455,y:.36732233951411786},{x:.48891857896300794,y:.37510224554357097},{x:.4914793376181454,y:.3835439355092742},{x:.492344,y:.392323},{x:.4914793376181454,y:.4011020644907258},{x:.48891857896300794,y:.409543754456429},{x:.48476013255361455,y:.4173236604858821},{x:.47916380515339463,y:.42414280515339464},{x:.47234466048588214,y:.4297391325536145},{x:.4645647544564291,y:.4338975789630079},{x:.4561230644907258,y:.43645833761814534},{x:.447344,y:.43732299999999996},{x:.131426,y:.43732299999999996},{x:.131426,y:.679393},{x:.515626,y:.679393},{x:.5244050644907258,y:.6802576623818547},{x:.532846754456429,y:.6828184210369922},{x:.5406266604858821,y:.6869768674463855},{x:.5474458051533947,y:.6925731948466054},{x:.5530421325536146,y:.6993923395141179},{x:.5572005789630079,y:.707172245543571},{x:.5597613376181454,y:.7156139355092743},{x:.5606260000000001,y:.7243930000000001},{x:.5597613376181454,y:.7331720644907258},{x:.5572005789630079,y:.7416137544564291},{x:.5530421325536146,y:.7493936604858822},{x:.5474458051533947,y:.7562128051533947},{x:.5406266604858821,y:.7618091325536146},{x:.532846754456429,y:.7659675789630079},{x:.5244050644907258,y:.7685283376181454},{x:.515626,y:.7693930000000001},{x:.10586481668800227,y:.7693930000000001},{x:.10364675445642904,y:.7705785789630079},{x:.09520506449072577,y:.7731393376181454},{x:.086426,y:.774004},{x:.0776469355092742,y:.7731393376181454},{x:.06920524554357094,y:.7705785789630079},{x:.06142533951411792,y:.7664201325536145},{x:.054606194846605366,y:.7608238051533946},{x:.04900986744638546,y:.7540046604858821},{x:.0448514210369921,y:.746224754456429},{x:.04229066238185464,y:.7377830644907257},{x:.041426000000000004,y:.729004},{x:.041426000000000004,y:.05103000000000002}]],G:[[{x:.011397831509003739,y:.41623356008285023},{x:.011618856500496228,y:.4138403978921803},{x:.011624876992355357,y:.4114370583257866},{x:.031979876992355355,y:.20994505832578658},{x:.0322125865037964,y:.20879027461506633},{x:.03227702681480045,y:.2076140405475535},{x:.033082276634523504,y:.2044745765152392},{x:.033722542929381774,y:.20129735748690203},{x:.034176068118796386,y:.2002101619949014},{x:.03446874211029117,y:.19906910061620064},{x:.03587099832954512,y:.19614705695158466},{x:.03711880677043453,y:.1931557970536144},{x:.03777571891913337,y:.19217797009338475},{x:.03828537929375919,y:.19111593175236494},{x:.08239837929375919,y:.11845093175236496},{x:.08400149586436068,y:.11631468084865614},{x:.08543403702225794,y:.1140604899753128},{x:.08664282877724949,y:.11279494315419919},{x:.08769326713863865,y:.11139516977529508},{x:.08968234215056696,y:.10961271886167734},{x:.09152712825517066,y:.10768131654967852},{x:.15960912825517065,y:.049144316549678456},{x:.16129904644183068,y:.0479582081853546},{x:.16285577619764602,y:.04660201166682107},{x:.1649006360722032,y:.045430348778213794},{x:.16682965744636918,y:.04407642028337947},{x:.16871850259167306,y:.043242789341903884},{x:.17050990103726027,y:.04221635466854622},{x:.25257090103726026,y:.005359354668546305},{x:.2555014876285109,y:.004375276469579791},{x:.2583690572759664,y:.003220377345201267},{x:.25967433471463813,y:.0029740526131209386},{x:.2609335532503684,y:.0025512125194529015},{x:.2639998135747395,y:.0021577721889240492},{x:.26703759331756605,y:.0015844992133087973},{x:.35309859331756605,y:-.006038500786691249},{x:.3541123404679588,y:-.006028536718703998},{x:.3551159915981175,y:-.006171599559831674},{x:.3585153812714738,y:-.005985259459774228},{x:.361919709861342,y:-.005951798491220829},{x:.36291203425126567,y:-.00574425362199294},{x:.3639243106821295,y:-.005688764928569123},{x:.3672220288859873,y:-.004842817275250554},{x:.37055441634545594,y:-.004145847688979236},{x:.3714871835051078,y:-.003748697851442632},{x:.37246918402112983,y:-.003496790022837183},{x:.4525501840211298,y:.02567020997716287},{x:.4548144879103283,y:.026756908839544704},{x:.45716266717941917,y:.02764799841997529},{x:.45878159595452606,y:.02866082810547922},{x:.4605032369247208,y:.02948708879101062},{x:.4625120284186098,y:.03099465081435172},{x:.46464124512829075,y:.032326725408117304},{x:.4660314733714444,y:.03363593119127184},{x:.46755883802994086,y:.034782191000688294},{x:.46923492039795345,y:.03665268142188218},{x:.47106334994415,y:.038374550149380404},{x:.53517534994415,y:.11188255014938031},{x:.5366918789074028,y:.11401106513419482},{x:.5383741006891446,y:.11601120663268963},{x:.5392453250303639,y:.11759493887966013},{x:.5402941837404813,y:.11906705813061697},{x:.5413663203511413,y:.12145053442062861},{x:.5426260104640281,y:.12374042895017842},{x:.5431715236397763,y:.1254636976633839},{x:.5439130326051668,y:.12711215273922669},{x:.5444995752545472,y:.12965899467727895},{x:.5452883245139833,y:.13215064287530112},{x:.5896823245139834,y:.3420786428753011},{x:.5897067631627176,y:.34229945557802055},{x:.5897717252277992,y:.3425119065778641},{x:.5901917436343531,y:.346681442891342},{x:.5906527316031134,y:.3508466486034176},{x:.590633622248786,y:.3510679861958218},{x:.5906558889520306,y:.35128902847947113},{x:.590254400640623,y:.3554603898480228},{x:.5898939395311937,y:.3596354965915505},{x:.5898320165355749,y:.3598488531940917},{x:.589810732180064,y:.3600699922305474},{x:.5886031661213459,y:.3640828755761044},{x:.5874351082520124,y:.3681074363403587},{x:.5873327512810971,y:.3683046127784522},{x:.5872687338126765,y:.3685173503185603},{x:.5853014960930706,y:.3722175427846122},{x:.5833707292727002,y:.37593689595641405},{x:.5832318718474782,y:.3761103148501221},{x:.583127581421558,y:.3763064755095204},{x:.5804762718833937,y:.37955178077467916},{x:.577856994398102,y:.38282299369748307},{x:.5776869727315521,y:.38296599065597503},{x:.5775464171707139,y:.38313803609053093},{x:.5743129241526703,y:.3858037388934479},{x:.5711057933673104,y:.38850110068914456},{x:.5709111412967293,y:.38860818041949885},{x:.5707397220723512,y:.3887494990196469},{x:.5670483068977423,y:.3907331578965531},{x:.5633765710498215,y:.39275301046402805},{x:.5631647689451196,y:.3928200579522583},{x:.5629690736018615,y:.39292521892344706},{x:.5589615952856832,y:.39415060297614785},{x:.5549663571246989,y:.39541532451398326},{x:.5547455444219794,y:.39543976316271745},{x:.5545330934221359,y:.39550472522779906},{x:.5503635571086607,y:.3959247436343527},{x:.5461983513965825,y:.39638573160311336},{x:.5459770138041778,y:.396366622248786},{x:.5457559715205288,y:.3963888889520305},{x:.32969497152052885,y:.39686888895203054},{x:.32091400776945256,y:.3960237321800639},{x:.31246664968143967,y:.39348173381267654},{x:.3046775244904796,y:.389340581421558},{x:.29784596390946905,y:.3837594171707138},{x:.2922345009803531,y:.3769527220723512},{x:.2880587810765529,y:.3691820736018615},{x:.2854792747722009,y:.3607460934221358},{x:.2845951110479695,y:.3519689715205288},{x:.2854402678199361,y:.3431880077694525},{x:.2879822661873235,y:.33474064968143963},{x:.29212341857844204,y:.32695152449047954},{x:.29770458282928614,y:.320119963909469},{x:.3045112779276488,y:.31450850098035305},{x:.31228192639813845,y:.3103327810765529},{x:.3207179065778642,y:.3077532747722009},{x:.3294950284794712,y:.30686911104796943},{x:.49017057214072013,y:.30651215509128404},{x:.45965681956734333,y:.16222033524572274},{x:.4108567628008364,y:.10626833604444391},{x:.35107150330533127,y:.0844934248457151},{x:.2825297162303303,y:.09056463065174497},{x:.21333680545064249,y:.12164203785622632},{x:.15562253329738823,y:.17126485077351794},{x:.1205010051965362,y:.2291186770707186},{x:.10185989085514695,y:.41364510354456796},{x:.13655871914038514,y:.5827099362211221},{x:.190187982415082,y:.6526649281775241},{x:.2569251189377254,y:.6872526727450867},{x:.3715857772516941,y:.6967797369989467},{x:.4883723057362636,y:.6711064406866752},{x:.49713228125159653,y:.6700660353148682},{x:.5059269093127409,y:.6707546074846872},{x:.5144182172953911,y:.6731456957538017},{x:.5222798889957544,y:.6771474119409674},{x:.529209804779262,y:.6826059723372997},{x:.5349416518686954,y:.6893116075279637},{x:.5392551585948644,y:.6970066237131456},{x:.5419845593133248,y:.7053953057362636},{x:.5430249646851317,y:.7141552812515966},{x:.5423363925153128,y:.722949909312741},{x:.5399453042461984,y:.7314412172953911},{x:.5359435880590326,y:.7393028889957545},{x:.5304850276627003,y:.7462328047792621},{x:.5237793924720363,y:.7519646518686954},{x:.5160843762868544,y:.7562781585948645},{x:.5076956942637364,y:.7590075593133249},{x:.38428269426373635,y:.7861375593133247},{x:.3819812519937546,y:.7864108971664274},{x:.3797153389243004,y:.7868977113667894},{x:.37761181025895013,y:.7869298473215656},{x:.37552271874840343,y:.7871779646851318},{x:.3732121724765259,y:.7869970613144796},{x:.370894825552222,y:.7870324638061055},{x:.24049282555222196,y:.7761974638061055},{x:.24043595887820252,y:.7761870527203061},{x:.24037815170992255,y:.776187787986971},{x:.2360978388350013,y:.7753928346522221},{x:.2318155069745089,y:.7746088302209789},{x:.231761764079766,y:.7745875250435272},{x:.2317049242166051,y:.7745769685631748},{x:.227661944055434,y:.7729622424167508},{x:.22361484767780643,y:.7713578609091699},{x:.22356629387164592,y:.7713264803860874},{x:.22351260563766895,y:.7713050378383375},{x:.13987060563766895,y:.7279560378383374},{x:.13900257424615298,y:.727391873258006},{x:.13805978359276902,y:.7269641982011581},{x:.13531067905832161,y:.7249923788161832},{x:.13247402218179744,y:.7231487342752945},{x:.13173273281971745,y:.7224260654354895},{x:.1308914928889356,y:.7218226787027751},{x:.128579894506033,y:.7193524235854973},{x:.12615742040314795,y:.7169907998540069},{x:.12557136040496888,y:.7161373985129647},{x:.12486399957555622,y:.7153814879181388},{x:.05884299957555622,y:.6292624879181389},{x:.05814177883495547,y:.6281337214080167},{x:.057292540659828396,y:.62711165542026},{x:.05581896837632758,y:.6243946553718145},{x:.05418793684040681,y:.6217691571968414},{x:.05372040128165289,y:.6205252782386133},{x:.05308687616260495,y:.6193571728131668},{x:.052171678571706244,y:.6164048994674943},{x:.051084196133809955,y:.613511651036194},{x:.05086831288622884,y:.6122004612006492},{x:.05047484683830003,y:.6109312059739318},{x:.012315846838300032,y:.4250072059739319},{x:.012065742114142504,y:.42261690788694145},{x:.011602778634016861,y:.4202585732767163},{x:.011607833784388823,y:.41824059149262255},{x:.011397831509003739,y:.41623356008285023}]],H:[[{x:.021894999999999998,y:.05103000000000002},{x:.02275966238185463,y:.04225093550927423},{x:.025320421036992093,y:.03380924554357098},{x:.029478867446385455,y:.026029339514117924},{x:.03507519484660536,y:.019210194846605383},{x:.04189433951411791,y:.013613867446385479},{x:.04967424554357096,y:.009455421036992116},{x:.05811593550927423,y:.006894662381854655},{x:.066895,y:.0060300000000000215},{x:.07567406449072576,y:.006894662381854655},{x:.08411575445642903,y:.009455421036992116},{x:.0918956604858821,y:.013613867446385486},{x:.09871480515339463,y:.019210194846605383},{x:.10431113255361453,y:.026029339514117924},{x:.1084695789630079,y:.03380924554357098},{x:.11103033761814536,y:.04225093550927425},{x:.111895,y:.05103000000000002},{x:.111895,y:.359342},{x:.490157,y:.359342},{x:.490157,y:.05103000000000002},{x:.49102166238185463,y:.04225093550927423},{x:.49358242103699207,y:.03380924554357098},{x:.49774086744638546,y:.026029339514117924},{x:.5033371948466053,y:.019210194846605383},{x:.5101563395141179,y:.013613867446385479},{x:.517936245543571,y:.009455421036992116},{x:.5263779355092743,y:.006894662381854655},{x:.535157,y:.0060300000000000215},{x:.5439360644907257,y:.006894662381854655},{x:.552377754456429,y:.009455421036992116},{x:.5601576604858821,y:.013613867446385486},{x:.5669768051533947,y:.019210194846605383},{x:.5725731325536145,y:.026029339514117924},{x:.5767315789630079,y:.03380924554357098},{x:.5792923376181454,y:.04225093550927425},{x:.580157,y:.05103000000000002},{x:.580157,y:.729004},{x:.5792923376181454,y:.7377830644907257},{x:.5767315789630079,y:.746224754456429},{x:.5725731325536145,y:.7540046604858821},{x:.5669768051533947,y:.7608238051533946},{x:.5601576604858821,y:.7664201325536145},{x:.552377754456429,y:.7705785789630079},{x:.5439360644907257,y:.7731393376181454},{x:.535157,y:.774004},{x:.5263779355092743,y:.7731393376181454},{x:.517936245543571,y:.7705785789630079},{x:.5101563395141179,y:.7664201325536145},{x:.5033371948466053,y:.7608238051533946},{x:.49774086744638546,y:.7540046604858821},{x:.49358242103699207,y:.746224754456429},{x:.49102166238185463,y:.7377830644907257},{x:.490157,y:.729004},{x:.490157,y:.44934199999999996},{x:.111895,y:.44934199999999996},{x:.111895,y:.729004},{x:.11103033761814536,y:.7377830644907257},{x:.10846957896300788,y:.746224754456429},{x:.10431113255361453,y:.7540046604858821},{x:.09871480515339463,y:.7608238051533946},{x:.09189566048588207,y:.7664201325536145},{x:.08411575445642903,y:.7705785789630079},{x:.07567406449072576,y:.7731393376181454},{x:.066895,y:.774004},{x:.05811593550927421,y:.7731393376181454},{x:.04967424554357093,y:.7705785789630079},{x:.04189433951411791,y:.7664201325536145},{x:.03507519484660536,y:.7608238051533946},{x:.029478867446385455,y:.7540046604858821},{x:.025320421036992093,y:.746224754456429},{x:.02275966238185463,y:.7377830644907257},{x:.021894999999999998,y:.729004},{x:.021894999999999998,y:.05103000000000002}]],I:[[{x:.25602600000000003,y:.05103000000000002},{x:.25689066238185465,y:.04225093550927423},{x:.2594514210369921,y:.03380924554357098},{x:.2636098674463855,y:.026029339514117924},{x:.26920619484660535,y:.019210194846605383},{x:.27602533951411795,y:.013613867446385479},{x:.283805245543571,y:.009455421036992116},{x:.2922469355092743,y:.006894662381854655},{x:.301026,y:.0060300000000000215},{x:.3098050644907258,y:.006894662381854655},{x:.3182467544564291,y:.009455421036992116},{x:.32602666048588214,y:.013613867446385486},{x:.3328458051533947,y:.019210194846605383},{x:.33844213255361455,y:.026029339514117924},{x:.34260057896300794,y:.03380924554357098},{x:.3451613376181454,y:.04225093550927425},{x:.346026,y:.05103000000000002},{x:.346026,y:.729004},{x:.3451613376181454,y:.7377830644907257},{x:.34260057896300794,y:.746224754456429},{x:.33844213255361455,y:.7540046604858821},{x:.3328458051533947,y:.7608238051533946},{x:.32602666048588214,y:.7664201325536145},{x:.3182467544564291,y:.7705785789630079},{x:.3098050644907258,y:.7731393376181454},{x:.301026,y:.774004},{x:.2922469355092743,y:.7731393376181454},{x:.283805245543571,y:.7705785789630079},{x:.27602533951411795,y:.7664201325536145},{x:.26920619484660535,y:.7608238051533946},{x:.2636098674463855,y:.7540046604858821},{x:.2594514210369921,y:.746224754456429},{x:.25689066238185465,y:.7377830644907257},{x:.25602600000000003,y:.729004},{x:.25602600000000003,y:.05103000000000002}]],J:[[{x:.0492700034030052,y:.22191686675397743},{x:.05066400340300519,y:.18438286675397747},{x:.05116783173382979,y:.18068175768771486},{x:.05155979864248331,y:.17696713613904605},{x:.05874879864248331,y:.14209513613904604},{x:.05880353678004782,y:.1419191061579158},{x:.05882437610196882,y:.14173594355086241},{x:.060112741823836933,y:.13770889095133898},{x:.06136821695472819,y:.13367146342030908},{x:.0614562450600313,y:.133509494686791},{x:.06151241721221637,y:.13333391704789688},{x:.07511841721221638,y:.10184091704789687},{x:.07557207470549994,y:.10102219111224012},{x:.07589401217340325,y:.10014328637013822},{x:.07770640675364808,y:.09717031380613761},{x:.07939396242231754,y:.09412474393402119},{x:.07999862852050488,y:.09341025377409445},{x:.08048584585939292,y:.09261104382444658},{x:.10112984585939291,y:.06520804382444652},{x:.10197173470408774,y:.06429305686105671},{x:.10267645797068833,y:.06326868237508665},{x:.10495244591663212,y:.06105354143298789},{x:.10710291637241387,y:.058716353519649434},{x:.10810713366035453,y:.05798319214000915},{x:.10899816141532707,y:.05711598541156246},{x:.1373061614153271,y:.03451898541156248},{x:.13912164740426522,y:.03334117545586675},{x:.1408101373903697,y:.03198757757075004},{x:.14281300361792376,y:.03094638082514127},{x:.14470672673278473,y:.029717813955661344},{x:.1467171079910441,y:.028916819034200267},{x:.14863722796281134,y:.027918638208003034},{x:.20683022796281134,y:.004592638208003076},{x:.20850921914024034,y:.004104279923540699},{x:.2101185278310492,y:.0034204446176558795},{x:.21273469892125257,y:.0028752394826936905},{x:.21530073387518742,y:.0021288719943945503},{x:.21704273768291169,y:.0019774523068977427},{x:.21875453360851305,y:.0016207172553791283},{x:.2976895336085131,y:-.0068802827446208525},{x:.29850402526559744,y:-.006887701289741747},{x:.2993068957135494,y:-.007024999279811796},{x:.30290822222422875,y:-.006927815554356645},{x:.3065107103471747,y:-.0069606277022222565},{x:.30731099906181086,y:-.006809004262418785},{x:.30812522808832776,y:-.0067870318558802545},{x:.3663632280883278,y:.0005399681441197179},{x:.367446910459264,y:.0007860908462292888},{x:.3685549625674647,y:.000870733572342984},{x:.37174033606180384,y:.0017612008405818037},{x:.37496569353784953,y:.0024937343933679954},{x:.37598053709868623,y:.002946543859479297},{x:.3770507853196353,y:.0032457304419443098},{x:.4423997853196353,y:.028649730441944292},{x:.44339023767510893,y:.0291515261148112},{x:.4444435524779453,y:.029502699422305954},{x:.4473177196266577,y:.03114131738307233},{x:.45026902431580135,y:.03263654520916596},{x:.4511425499275847,y:.03332192668785485},{x:.4521071150681948,y:.03387184382278591},{x:.4818761150681948,y:.0549598438227859},{x:.482276572000261,y:.05530719927286456},{x:.48273081061614365,y:.05558049186877649},{x:.48560514894853896,y:.05819439949693127},{x:.48854004666413575,y:.060740123232255375},{x:.48886504324193186,y:.061158929616590856},{x:.48925723704963914,y:.06151558852974905},{x:.5141262370496392,y:.08904658852974903},{x:.5149956342421861,y:.09022293690705172},{x:.5160117353213701,y:.09127516577002369},{x:.5176116053111659,y:.0937625081737249},{x:.5193693801104602,y:.0961408866071265},{x:.519992577896003,y:.09746424275846524},{x:.5207838752101566,y:.09869448482562238},{x:.5385188752101566,y:.1333154848256224},{x:.5396070973995049,y:.13607819549886616},{x:.5408707323766272,y:.1387652058155645},{x:.5412201620380835,y:.14017334347255597},{x:.5417518824254063,y:.14152324205357814},{x:.5422802166156467,y:.1444451696332536},{x:.5429953614930656,y:.1473270727547606},{x:.5523413614930656,y:.2113020727547606},{x:.5524962602601196,y:.21460328519222147},{x:.5528139181508881,y:.2178928278123641},{x:.5518389181508881,y:.7290898278123641},{x:.5509575131661891,y:.7378672271777721},{x:.5483806584624608,y:.7463040176932935},{x:.5442073811208505,y:.7540759782308231},{x:.5385980578491955,y:.7608844367054697},{x:.5317682517950807,y:.7664677478762799},{x:.5239804285749665,y:.7706113482261165},{x:.5155338698677402,y:.7731560015172932},{x:.5067531721876358,y:.7740039181508881},{x:.4979757728222279,y:.7731225131661891},{x:.4895389823067066,y:.7705456584624607},{x:.48176702176917696,y:.7663723811208505},{x:.4749585632945304,y:.7607630578491954},{x:.46937525212372017,y:.7539332517950806},{x:.4652316517738835,y:.7461454285749665},{x:.46268699848270683,y:.7376988698677401},{x:.461839081849112,y:.7289181721876359},{x:.462807763438783,y:.22103394388498027},{x:.45501827222953295,y:.16771351802238937},{x:.44337725180090903,y:.14498874958374325},{x:.42579959063650114,y:.12552955984883984},{x:.4046143325842134,y:.11052217895574154},{x:.34961801160788414,y:.08914271579513207},{x:.3021031758959219,y:.08316481131246532},{x:.2345584384824393,y:.09043912324952764},{x:.18827433696976265,y:.10899157718530504},{x:.16959144206995366,y:.1239052897771866},{x:.155605251275173,y:.14247066404328695},{x:.14596289111822178,y:.16478926233983734},{x:.14046290234137151,y:.19146830095804884},{x:.13920799659699482,y:.22525713324602253},{x:.1380181031040591,y:.23399805813086086},{x:.13514580323043823,y:.24233889189031887},{x:.13070147784947123,y:.24995910096061402},{x:.12485591989314217,y:.25656584498063745},{x:.11783377087548613,y:.26190523048280423},{x:.10990488804518514,y:.26577206787662816},{x:.10137397392283892,y:.2680177567696118},{x:.09256886675397746,y:.2685559965969948},{x:.08382794186913914,y:.26736610310405906},{x:.07548710810968112,y:.26449380323043825},{x:.06786689903938595,y:.2600494778494712},{x:.06126015501936256,y:.2542039198931421},{x:.055920769517195726,y:.24718177087548612},{x:.052053932123371845,y:.23925288804518513},{x:.04980824323038816,y:.2307219739228389},{x:.0492700034030052,y:.22191686675397743}]],K:[[{x:-.009598999999999996,y:.05103000000000002},{x:-.008734337618145363,y:.04225093550927423},{x:-.006173578963007902,y:.03380924554357098},{x:-.002015132553614539,y:.026029339514117924},{x:.003581194846605365,y:.019210194846605383},{x:.010400339514117916,y:.013613867446385479},{x:.018180245543570964,y:.009455421036992116},{x:.026621935509274233,y:.006894662381854655},{x:.035401,y:.0060300000000000215},{x:.04418006449072578,y:.006894662381854655},{x:.05262175445642904,y:.009455421036992116},{x:.06040166048588211,y:.013613867446385486},{x:.06722080515339464,y:.019210194846605383},{x:.07281713255361454,y:.026029339514117924},{x:.07697557896300791,y:.03380924554357098},{x:.07953633761814537,y:.04225093550927425},{x:.080401,y:.05103000000000002},{x:.080401,y:.29048154892126793},{x:.18934433769134518,y:.3772029724897202},{x:.5349508182082354,y:.03415901207017739},{x:.5417907398770268,y:.02858809778868676},{x:.5495860658299886,y:.024458629583942203},{x:.5580372260624178,y:.02192930060321959},{x:.5668194472260474,y:.021097311540784057},{x:.5755952334866855,y:.021994635269720175},{x:.5840273362998535,y:.024586788142349852},{x:.5917917146832189,y:.028774155177474024},{x:.5985899879298227,y:.03439581820823536},{x:.6041609022113132,y:.04123573987702663},{x:.6082903704160578,y:.04903106582998847},{x:.6108196993967804,y:.05748222606241771},{x:.6116516884592159,y:.06626444722604735},{x:.6107543647302798,y:.07504023348668547},{x:.6081622118576502,y:.08347233629985339},{x:.603974844822526,y:.0912367146832188},{x:.5983531817917647,y:.09803498792982254},{x:.26024203797571366,y:.43363918627462555},{x:.5302838206406747,y:.648598708462355},{x:.5366139141989896,y:.654742773070568},{x:.5416237292416561,y:.6620037211908337},{x:.545120741386121,y:.6701025186588768},{x:.5469705624168195,y:.6787279332298585},{x:.5471021047489336,y:.6875484950590041},{x:.5455103132844098,y:.6962252349018474},{x:.542256359676543,y:.7044247105121999},{x:.537465291537645,y:.7118318206406747},{x:.531321226929432,y:.7181619141989897},{x:.5240602788091663,y:.7231717292416562},{x:.5159614813411232,y:.726668741386121},{x:.5073360667701415,y:.7285185624168196},{x:.498515504940996,y:.7286501047489337},{x:.48983876509815266,y:.7270583132844098},{x:.48163928948780005,y:.723804359676543},{x:.47423217935932527,y:.719013291537645},{x:.080401,y:.4055145384845117},{x:.080401,y:.729004},{x:.07953633761814537,y:.7377830644907257},{x:.07697557896300788,y:.746224754456429},{x:.07281713255361454,y:.7540046604858821},{x:.06722080515339464,y:.7608238051533946},{x:.06040166048588208,y:.7664201325536145},{x:.052621754456429054,y:.7705785789630079},{x:.04418006449072578,y:.7731393376181454},{x:.035401,y:.774004},{x:.026621935509274212,y:.7731393376181454},{x:.018180245543570936,y:.7705785789630079},{x:.010400339514117906,y:.7664201325536145},{x:.003581194846605358,y:.7608238051533946},{x:-.002015132553614539,y:.7540046604858821},{x:-.006173578963007902,y:.746224754456429},{x:-.008734337618145363,y:.7377830644907257},{x:-.009598999999999996,y:.729004},{x:-.009598999999999996,y:.05103000000000002}]],L:[[{x:.030439999999999995,y:.05103000000000002},{x:.03130466238185463,y:.04225093550927423},{x:.03386542103699209,y:.03380924554357098},{x:.03802386744638545,y:.026029339514117924},{x:.043620194846605356,y:.019210194846605383},{x:.05043933951411791,y:.013613867446385479},{x:.058219245543570955,y:.009455421036992116},{x:.06666093550927422,y:.006894662381854655},{x:.07544,y:.0060300000000000215},{x:.526613,y:.0060300000000000215},{x:.5353920644907257,y:.006894662381854655},{x:.543833754456429,y:.009455421036992116},{x:.5516136604858821,y:.013613867446385479},{x:.5584328051533947,y:.019210194846605383},{x:.5640291325536145,y:.026029339514117924},{x:.5681875789630079,y:.03380924554357098},{x:.5707483376181454,y:.04225093550927425},{x:.571613,y:.05103000000000002},{x:.5707483376181454,y:.05980906449072579},{x:.5681875789630079,y:.06825075445642906},{x:.5640291325536145,y:.07603066048588211},{x:.5584328051533947,y:.08284980515339466},{x:.5516136604858821,y:.08844613255361455},{x:.543833754456429,y:.09260457896300792},{x:.5353920644907257,y:.09516533761814538},{x:.526613,y:.09603000000000002},{x:.12043999999999999,y:.09603000000000002},{x:.12043999999999999,y:.729004},{x:.11957533761814536,y:.7377830644907257},{x:.11701457896300788,y:.746224754456429},{x:.11285613255361453,y:.7540046604858821},{x:.10725980515339463,y:.7608238051533946},{x:.10044066048588207,y:.7664201325536145},{x:.09266075445642903,y:.7705785789630079},{x:.08421906449072576,y:.7731393376181454},{x:.07544,y:.774004},{x:.06666093550927422,y:.7731393376181454},{x:.05821924554357093,y:.7705785789630079},{x:.05043933951411791,y:.7664201325536145},{x:.043620194846605356,y:.7608238051533946},{x:.03802386744638545,y:.7540046604858821},{x:.03386542103699209,y:.746224754456429},{x:.03130466238185463,y:.7377830644907257},{x:.030439999999999995,y:.729004},{x:.030439999999999995,y:.05103000000000002}]],M:[[{x:-.0025190000000000004,y:.05103000000000002},{x:-.001654337618145367,y:.04225093550927423},{x:.0009064210369920944,y:.03380924554357098},{x:.005064867446385457,y:.026029339514117924},{x:.010661194846605361,y:.019210194846605383},{x:.017480339514117912,y:.013613867446385479},{x:.02526024554357096,y:.009455421036992116},{x:.03370193550927423,y:.006894662381854655},{x:.042481,y:.0060300000000000215},{x:.051260064490725774,y:.006894662381854655},{x:.05970175445642904,y:.009455421036992116},{x:.06748166048588208,y:.013613867446385486},{x:.07430080515339463,y:.019210194846605383},{x:.07989713255361454,y:.026029339514117924},{x:.0840555789630079,y:.03380924554357098},{x:.08661633761814536,y:.04225093550927425},{x:.087481,y:.05103000000000002},{x:.087481,y:.5631122522964573},{x:.26219554141599577,y:.26476777519375044},{x:.26376288989624813,y:.2626088267569117},{x:.2651577075441738,y:.2603345964826191},{x:.26634817172230724,y:.2590477232579252},{x:.26737807478439135,y:.2576290804774607},{x:.2693364970488442,y:.25581739014918375},{x:.271148193983327,y:.2538589739959976},{x:.27256684023788735,y:.25282907571933333},{x:.27385371747828813,y:.25163861588213104},{x:.27612795245761435,y:.25024380590572387},{x:.27828690618147356,y:.24867646470811877},{x:.2798792167324836,y:.24794311979268302},{x:.28137361418054185,y:.2470265916026687},{x:.2838762642998919,y:.24610226374330602},{x:.28629950743227456,y:.24498622954453103},{x:.28800429067823724,y:.24457762002415934},{x:.28964877947809164,y:.24397024514568044},{x:.29228366929688115,y:.24355192080462856},{x:.2948780779631802,y:.2429300821730634},{x:.29662982004000654,y:.24286191068247276},{x:.29836120340931876,y:.24258703019148947},{x:.3010270755894747,y:.24269078533857608},{x:.3036929481196057,y:.24258703918410057},{x:.30542433056167173,y:.24286192551544342},{x:.30717607240852984,y:.24293010291506947},{x:.3097704789772072,y:.24355195029817853},{x:.3124053673848756,y:.24397028352732772},{x:.31404985413590314,y:.24457766395304856},{x:.3157546360035206,y:.24498627922405064},{x:.3181778753712451,y:.24610232159698525},{x:.32068052237260675,y:.24702665789836697},{x:.32217491672899246,y:.24794319112932822},{x:.32376722480624953,y:.2486765414159958},{x:.3259261732430879,y:.2502438898962479},{x:.3282004035173809,y:.2516387075441738},{x:.329487276742075,y:.2528291717223074},{x:.3309059195225393,y:.2538590747843914},{x:.3327176098508159,y:.2558174970488439},{x:.33467602600400237,y:.257629193983327},{x:.3357059242806667,y:.2590478402378874},{x:.33689638411786893,y:.2603347174782881},{x:.3382911940942761,y:.2626089524576143},{x:.3398585352918812,y:.26476790618147356},{x:.514571,y:.5631111449291359},{x:.514571,y:.05103000000000002},{x:.5154356623818547,y:.04225093550927423},{x:.5179964210369922,y:.03380924554357098},{x:.5221548674463855,y:.026029339514117924},{x:.5277511948466054,y:.019210194846605383},{x:.5345703395141179,y:.013613867446385479},{x:.542350245543571,y:.009455421036992116},{x:.5507919355092743,y:.006894662381854655},{x:.559571,y:.0060300000000000215},{x:.5683500644907258,y:.006894662381854655},{x:.576791754456429,y:.009455421036992116},{x:.5845716604858822,y:.013613867446385486},{x:.5913908051533947,y:.019210194846605383},{x:.5969871325536146,y:.026029339514117924},{x:.6011455789630079,y:.03380924554357098},{x:.6037063376181454,y:.04225093550927425},{x:.6045710000000001,y:.05103000000000002},{x:.6045710000000001,y:.729004},{x:.6044399806971988,y:.7303342613054065},{x:.6044919608158994,y:.7316699481196056},{x:.6040085293496043,y:.7347148603514975},{x:.6037063376181454,y:.7377830644907257},{x:.6033183147080721,y:.7390622046001841},{x:.6031087164726723,y:.7403823673848756},{x:.6020405410986152,y:.7432744596816038},{x:.6011455789630079,y:.746224754456429},{x:.6005154639484909,y:.7474036167328832},{x:.600052342101633,y:.7486575223726067},{x:.5984404722003996,y:.7512856532491108},{x:.5969871325536146,y:.7540046604858821},{x:.596139140401289,y:.7550379419131618},{x:.5954402924558263,y:.7561774035173808},{x:.5933466712837743,y:.758440575377949},{x:.5913908051533947,y:.7608238051533946},{x:.5903575237261146,y:.7616717973057207},{x:.589449806016673,y:.7626530260040023},{x:.5869548902613284,y:.7644642664232344},{x:.5845716604858822,y:.7664201325536145},{x:.5833927982094276,y:.7670502475681318},{x:.5823110938185264,y:.7678355352918812},{x:.579510761693201,y:.7691252393162225},{x:.576791754456429,y:.7705785789630079},{x:.5755126143469705,y:.7709666018730812},{x:.5742984925677255,y:.7715257704554689},{x:.5713003592655512,y:.772244375482538},{x:.5683500644907258,y:.7731393376181454},{x:.5670198031853202,y:.7732703569209465},{x:.5657199220368199,y:.7735819178269366},{x:.5626392041392276,y:.7737018082685412},{x:.559571,y:.774004},{x:.5582407386945936,y:.7738729806971988},{x:.5569050518803944,y:.7739249608158993},{x:.5538601396485026,y:.7734415293496042},{x:.5507919355092743,y:.7731393376181454},{x:.5495127953998159,y:.772751314708072},{x:.5481926326151244,y:.7725417164726722},{x:.5453005403183963,y:.7714735410986151},{x:.542350245543571,y:.7705785789630079},{x:.5411713832671168,y:.7699484639484908},{x:.5399174776273933,y:.769485342101633},{x:.5372893467508892,y:.7678734722003996},{x:.5345703395141179,y:.7664201325536145},{x:.5335370580868383,y:.765572140401289},{x:.5323975964826192,y:.7648732924558262},{x:.5301344246220511,y:.7627796712837742},{x:.5277511948466054,y:.7608238051533946},{x:.5269032026942794,y:.7597905237261146},{x:.5259219739959977,y:.7588828060166729},{x:.5241107335767656,y:.7563878902613284},{x:.5221548674463855,y:.7540046604858821},{x:.5215247524318682,y:.7528257982094275},{x:.5207394647081188,y:.7517440938185264},{x:.30102684980758887,y:.3765575080608823},{x:.08131245858400418,y:.7517442248062496},{x:.0805272117946797,y:.752825865136849},{x:.07989713255361454,y:.7540046604858821},{x:.07794121846393844,y:.7563879486998997},{x:.0761299252156086,y:.7588829195225393},{x:.07514874916275306,y:.7597905823884902},{x:.07430080515339463,y:.7608238051533946},{x:.0719175169393771,y:.7627797192430708},{x:.06965428252171184,y:.764873384117869},{x:.06851488325078628,y:.7655721885442563},{x:.06748166048588208,y:.7664201325536145},{x:.06476258657702469,y:.7678735078373721},{x:.06213438581945812,y:.7694854083973313},{x:.06088054980546198,y:.7699484997219428},{x:.05970175445642904,y:.7705785789630079},{x:.056751387338174995,y:.7714735630437544},{x:.05385922052190834,y:.7725417548543195},{x:.05253913197970031,y:.7727513367372549},{x:.051260064490725774,y:.7731393376181454},{x:.04819178511684276,y:.773441536759571},{x:.0451467965906812,y:.7739249698085104},{x:.04381118578262464,y:.7738729881355436},{x:.042481,y:.774004},{x:.039412720626117295,y:.7737018008585744},{x:.03633192759147018,y:.7735818970849305},{x:.035032121291898165,y:.7732703494826018},{x:.03370193550927423,y:.7731393376181454},{x:.030751568391020223,y:.7722443535373988},{x:.02775336399647938,y:.7715257207759494},{x:.026539313032545114,y:.7709665798438982},{x:.02526024554357096,y:.7705785789630079},{x:.02254117163471342,y:.7691252036792503},{x:.01974077519375046,y:.7678354585840041},{x:.01865913486315115,y:.7670502117946798},{x:.017480339514117912,y:.7664201325536145},{x:.015097051300099952,y:.7644642184639381},{x:.012602080477460715,y:.7626529252156086},{x:.011694417611510011,y:.7616717491627533},{x:.010661194846605361,y:.7608238051533946},{x:.008705280756928618,y:.7584405169393763},{x:.006611615882131057,y:.7561772825217118},{x:.005912811455744052,y:.7550378832507868},{x:.005064867446385457,y:.7540046604858821},{x:.0036114921626275165,y:.7512855865770239},{x:.0019995916026687363,y:.7486573858194581},{x:.0015365002780573323,y:.7474035498054622},{x:.0009064210369920944,y:.746224754456429},{x:11436956245516774e-21,y:.7432743873381747},{x:-.0010567548543195318,y:.7403822205219084},{x:-.0012663367372549837,y:.7390621319797002},{x:-.001654337618145367,y:.7377830644907257},{x:-.0019565367595708303,y:.7347147851168438},{x:-.0024399698085105087,y:.7316697965906812},{x:-.0023879881355436095,y:.730334185782624},{x:-.0025190000000000004,y:.729004},{x:-.0025190000000000004,y:.05103000000000002}]],N:[[{x:.022871000000000002,y:.05103000000000002},{x:.023735662381854636,y:.04225093550927423},{x:.026296421036992097,y:.03380924554357098},{x:.03045486744638546,y:.026029339514117924},{x:.036051194846605364,y:.019210194846605383},{x:.042870339514117915,y:.013613867446385479},{x:.05065024554357096,y:.009455421036992116},{x:.05909193550927423,y:.006894662381854655},{x:.067871,y:.0060300000000000215},{x:.07665006449072577,y:.006894662381854655},{x:.08509175445642904,y:.009455421036992116},{x:.0928716604858821,y:.013613867446385486},{x:.09969080515339464,y:.019210194846605383},{x:.10528713255361455,y:.026029339514117924},{x:.10944557896300791,y:.03380924554357098},{x:.11200633761814537,y:.04225093550927425},{x:.112871,y:.05103000000000002},{x:.112871,y:.5841703094604355},{x:.49710429367778214,y:.025528669675955993},{x:.4971050718109503,y:.02552774709009411},{x:.49710565506134197,y:.025526690456344234},{x:.49994880496714983,y:.022156103119426583},{x:.5027917749380927,y:.01878536401177818},{x:.5027927181072235,y:.018784610959395015},{x:.5027934962896407,y:.018783688415073364},{x:.5062395848358414,y:.016032536999645196},{x:.5096855265142521,y:.01328120162562755},{x:.5096865984738844,y:.013280647046104224},{x:.5096875416832135,y:.013279894044071351},{x:.5136041376200112,y:.011253903755746949},{x:.5175206253992491,y:.009227704391234041},{x:.5175217849545753,y:.009227369596750634},{x:.5175228569438108,y:.00922681507445236},{x:.5217594476858983,y:.008003843583871996},{x:.5259959731369073,y:.006780645934087934},{x:.5259971757268666,y:.006780543790608634},{x:.5259983353000632,y:.006780209058025982},{x:.5303921110410749,y:.006407254473822295},{x:.5347858668666982,y:.00603406533837119},{x:.5347870662764328,y:.00603419977121261},{x:.5347882688718429,y:.006034097691931008},{x:.5391703792739257,y:.006525492449663053},{x:.5435525159020149,y:.007016653277689966},{x:.5435536660388816,y:.007017019120673398},{x:.543554865441438,y:.007017153617542397},{x:.547756908459233,y:.008354013692199154},{x:.5519590228368241,y:.009690649448577907},{x:.5519600795017079,y:.0096912326425627},{x:.551961229619043,y:.009691598546943021},{x:.555821723096155,y:.01182254915564361},{x:.559682330324044,y:.013953293677782128},{x:.5596832529099061,y:.01395407181095043},{x:.5596843095436558,y:.013954655061341997},{x:.5630548968806759,y:.016797804967236304},{x:.5664256359882218,y:.01964077493809272},{x:.5664263890406048,y:.019641718107223288},{x:.5664273115849267,y:.019642496289640633},{x:.5691784630004857,y:.02308858483600535},{x:.5719297983743725,y:.026534526514252196},{x:.5719303529538958,y:.0265355984738845},{x:.5719311059559287,y:.0265365416832135},{x:.5739570962443242,y:.03045313762014873},{x:.575983295608766,y:.03436962539924916},{x:.5759836304032494,y:.03437078495457533},{x:.5759841849255477,y:.0343718569438108},{x:.5772071564160691,y:.03860844768569421},{x:.5784303540659121,y:.04284497313690728},{x:.5784304562093915,y:.04284617572686688},{x:.578430790941974,y:.042847335300063204},{x:.5788037455260991,y:.04724111104014873},{x:.5791769346616289,y:.05163486686669809},{x:.5791768002287875,y:.05163606627643281},{x:.5791769023080691,y:.05163726887184294},{x:.5700269023080691,y:.7296112688718429},{x:.5690438463824576,y:.738377865441438},{x:.566369401453057,y:.746784229619043},{x:.5621063449386581,y:.7545073095436557},{x:.5564185037103594,y:.7612503115849266},{x:.5495244583167865,y:.7667541059559286},{x:.5416891430561892,y:.7708071849255477},{x:.5332136646999368,y:.773253790941974},{x:.5244237311281571,y:.773999902308069},{x:.515657134558562,y:.7730168463824576},{x:.507250770380957,y:.770342401453057},{x:.49952769045634426,y:.766079344938658},{x:.4927846884150734,y:.7603915037103594},{x:.4872808940440714,y:.7534974583167865},{x:.4832278150744524,y:.7456621430561892},{x:.480781209058026,y:.7371866646999369},{x:.48003509769193103,y:.7283967311281571},{x:.48718300813543913,y:.19876859615253395},{x:.10494770632221789,y:.754505330324044},{x:.1022980223560627,y:.75764690179997},{x:.09969080515339464,y:.7608238051533946},{x:.09945603456444842,y:.7610164763964532},{x:.09926022506190729,y:.7612486359882218},{x:.09604856383930557,y:.7638129153509474},{x:.0928716604858821,y:.7664201325536145},{x:.09260381265312083,y:.7665633002029657},{x:.09236647348574781,y:.7667527983743725},{x:.08871625734636118,y:.7686412418060533},{x:.08509175445642904,y:.7705785789630079},{x:.08480112262185491,y:.7706667411661766},{x:.08453137460075086,y:.770806295608766},{x:.08058287930375276,y:.7719463312873718},{x:.07665006449072577,y:.7731393376181454},{x:.07634781747275289,y:.773169106351106},{x:.07605602686309273,y:.7732533540659121},{x:.07196099086840901,y:.7736011710596524},{x:.067871,y:.774004},{x:.06756875298202693,y:.7739742312670393},{x:.06726613313330192,y:.7739999346616289},{x:.06318192637768459,y:.7735421665584931},{x:.05909193550927423,y:.7731393376181454},{x:.05880130367469977,y:.7730511754149765},{x:.05849948409798508,y:.77301734672231},{x:.054583060356599135,y:.7717715852937818},{x:.05065024554357096,y:.7705785789630079},{x:.0503823977108098,y:.7704354113136568},{x:.050092977163175983,y:.7703433505514221},{x:.04649484240404986,y:.768357469710569},{x:.042870339514117915,y:.7664201325536145},{x:.04263556892517204,y:.7662274613105563},{x:.04236966967595597,y:.7660807063222179},{x:.03922809820002561,y:.7634310223560591},{x:.036051194846605364,y:.7608238051533946},{x:.03585852360354703,y:.7605890345644487},{x:.035626364011778155,y:.7603932250619073},{x:.033062084649052234,y:.7571815638393052},{x:.03045486744638546,y:.7540046604858821},{x:.030311699797034096,y:.7537368126531205},{x:.03012220162562753,y:.7534994734857478},{x:.028233758193948882,y:.7498492573463653},{x:.026296421036992097,y:.746224754456429},{x:.026208258833823234,y:.7459341226218545},{x:.026068704391234022,y:.7456643746007509},{x:.02492866871262922,y:.741715879303756},{x:.023735662381854636,y:.7377830644907257},{x:.023705893648893955,y:.7374808174727527},{x:.023621645934087915,y:.7371890268630927},{x:.023273828940347806,y:.7330939908684111},{x:.022871000000000002,y:.729004},{x:.022871000000000002,y:.05103000000000002}]],O:[[{x:.012131736117046842,y:.4355587711738732},{x:.012426138979982786,y:.43287355609157196},{x:.012514983726773468,y:.43017371170811375},{x:.012905745911416293,y:.42849911573111366},{x:.01309315536666239,y:.42678977537085305},{x:.07316415536666239,y:.1412837753708531},{x:.07429915106219231,y:.13768552483470178},{x:.07533122192175289,y:.13405641311271962},{x:.07562440736087628,y:.1334840955199844},{x:.07581784742995093,y:.1328708369543332},{x:.07763301835724021,y:.12956315246900071},{x:.0793532628391043,y:.12620512014747703},{x:.07975246842568721,y:.12570099711853563},{x:.0800618324091279,y:.12513726042963025},{x:.08248742256740031,y:.1222472544549173},{x:.0848297326408542,y:.1192893488327618},{x:.1660597326408542,y:.03517334883276172},{x:.16792084009780786,y:.033590824390739155},{x:.16963596886504836,y:.031851158363102774},{x:.17127304088861567,y:.03074040344046043},{x:.172780173663761,y:.0294588683817891},{x:.1749142556657825,y:.0282698357562587},{x:.17693582072022015,y:.026898201947035502},{x:.17875813439943417,y:.026128166777013812},{x:.18048632312818114,y:.025165283073572443},{x:.1828113681007397,y:.02441543612151622},{x:.18506168183103927,y:.023464545648773483},{x:.2739246818310393,y:-.0041824543512264944},{x:.2748960678404206,y:-.004382857312604547},{x:.27582577451608603,y:-.004728396924478621},{x:.2792086173377598,y:-.005272563034129881},{x:.28256427991205235,y:-.0059648570457577},{x:.28355609768991147,y:-.005971901311054349},{x:.2845353517466465,y:-.006129424701440567},{x:.287959355733624,y:-.0060031749164705245},{x:.2913856000541485,y:-.006027509400590186},{x:.29235973459950004,y:-.005840924262640544},{x:.29335090385307644,y:-.005804377895986514},{x:.3811419038530764,y:.006122622104013507},{x:.38318930529213563,y:.00660893405691686},{x:.3852758334501729,y:.006882342567970358},{x:.387470347489584,y:.0076257947232155985},{x:.38972465411174423,y:.008161252125438313},{x:.3916378405507577,y:.009037647936572414},{x:.39363093730084414,y:.009712864429997858},{x:.3956382440479665,y:.010870159811164118},{x:.3977447722434711,y:.011835121954387393},{x:.39945022100051475,y:.01306792222421872},{x:.4012732927522862,y:.01411899850883961},{x:.4916652927522862,y:.07880999850883955},{x:.49276799959381884,y:.07977586317754862},{x:.49398769122063274,y:.08058901093294302},{x:.4960788615418114,y:.08267585840574071},{x:.4983012083703825,y:.08462241954283417},{x:.4991942961599152,y:.08578485282556958},{x:.5002319144966787,y:.08682032620708877},{x:.5018757798210403,y:.08927504258220473},{x:.5036756696393939,y:.09161775945128844},{x:.5043248175140242,y:.09293208968889465},{x:.5051404874699588,y:.09415009603518716},{x:.5560304874699588,y:.18912209603518723},{x:.5570965448702581,y:.19168827319789875},{x:.5583465570022521,y:.1941700494329812},{x:.5587848767756364,y:.19575236841213633},{x:.559414776433869,y:.19726864147332673},{x:.5599597135111237,y:.1999934877429328},{x:.5607015364856348,y:.20267144261291137},{x:.5892585364856349,y:.36700144261291134},{x:.5895780755292599,y:.371318367211785},{x:.589913428370686,y:.37563409214099147},{x:.5899036127276142,y:.3757163259822715},{x:.58990972616553,y:.3757989176124618},{x:.5893809351459178,y:.38009523269056544},{x:.5888678881103582,y:.38439345626922305},{x:.5314878881103581,y:.6446844562692231},{x:.5303800126922803,y:.6480826863142071},{x:.5293998170293023,y:.651519919480997},{x:.5290148883003433,y:.6522699863013032},{x:.5287535704445262,y:.6530715368858165},{x:.5270040207481954,y:.6561883351212919},{x:.5253720883446767,y:.6593682961290664},{x:.5248482251358019,y:.6600288547560561},{x:.5244355536676654,y:.6607640231862051},{x:.522111563906752,y:.6634796128039058},{x:.5198906090097624,y:.6662800975344761},{x:.4528876090097624,y:.7355630975344761},{x:.4513498405668143,y:.7368687638478525},{x:.44995999895015265,y:.7383308981052339},{x:.44799560298794544,y:.7397167316507253},{x:.4461630292013509,y:.741272707045399},{x:.44440008568631667,y:.7422532816059559},{x:.4427517012434998,y:.743416176715023},{x:.4405546878862334,y:.7443921472166956},{x:.43845377075029196,y:.7455607075703166},{x:.43653340109378364,y:.7461785074476045},{x:.43468982031452474,y:.7469974740014746},{x:.32025082031452473,y:.7849044740014746},{x:.3162756641960007,y:.785800462676764},{x:.3123143949565378,y:.7867559771378485},{x:.3119757732525013,y:.7867696456410259},{x:.3116451697261732,y:.786844162718285},{x:.30757159639863574,y:.7869474207351895},{x:.30350003021295163,y:.7871117699623142},{x:.30316524843732107,y:.7870591140117537},{x:.302826459804451,y:.7870677017158569},{x:.29881101440639224,y:.7863742609266953},{x:.29478561927964103,y:.7857411290712295},{x:.173234619279641,y:.7541621290712296},{x:.17180894449846637,y:.7536379076298808},{x:.17032768986057922,y:.753301394035824},{x:.16767817066393412,y:.7521190197025511},{x:.16495505208167519,y:.7511177274253745},{x:.16365904177145735,y:.7503254433998781},{x:.16227189957151614,y:.7497064173758784},{x:.15990395993272244,y:.7480298664806163},{x:.1574285077432372,y:.7465165596726792},{x:.15631196685338702,y:.745486660093817},{x:.15507224418821702,y:.7446089104628228},{x:.08487024418821705,y:.6837459104628228},{x:.08477922863788438,y:.6836498346778195},{x:.08467166808724909,y:.6835727301071804},{x:.08174665618590948,y:.6804486588585436},{x:.07880340242944883,y:.6773417676286113},{x:.07873287917322891,y:.6772297816598538},{x:.07864242772392874,y:.6771331746094597},{x:.07638309517198695,y:.6734984900001298},{x:.07410251962167697,y:.6698770964908778},{x:.07405519882875666,y:.6697535038963435},{x:.0739853324792622,y:.6696411069209627},{x:.07247850415964274,y:.6656354878421232},{x:.07094824805491862,y:.6616387601752097},{x:.07092594823683183,y:.6615083105489945},{x:.0708793519117729,y:.6613844430013583},{x:.013660351911772894,y:.4476944430013583},{x:.013380528959940628,y:.4459977798389246},{x:.012899536483696877,y:.44434683677239306},{x:.012664423003084308,y:.4416557821956227},{x:.012224847112815455,y:.43899048181468664},{x:.012281403443251489,y:.4372718288093888},{x:.012131736117046842,y:.4355587711738732}],[{x:.10337829031332789,y:.4348001396911351},{x:.15424861715004387,y:.6247803934833692},{x:.2060651876410252,y:.6697037849792326},{x:.3045603004668897,y:.6952928559694175},{x:.3958853477721772,y:.6650421672339206},{x:.4463402797077116,y:.6128703383711886},{x:.499069598507425,y:.373676069990286},{x:.47327322171072966,y:.22523195474705573},{x:.4307624349909165,y:.1458974207255564},{x:.35796896612556683,y:.09380119213930618},{x:.2911281310221294,y:.08472041346861442},{x:.22279798440939425,y:.10597924519162948},{x:.15856873728877424,y:.17249047688925445},{x:.10337829031332789,y:.4348001396911351}]],P:[[{x:.025556999999999996,y:.05103000000000002},{x:.02642166238185463,y:.04225093550927423},{x:.02898242103699209,y:.03380924554357098},{x:.033140867446385454,y:.026029339514117924},{x:.03873719484660536,y:.019210194846605383},{x:.04555633951411791,y:.013613867446385479},{x:.053336245543570956,y:.009455421036992116},{x:.061777935509274226,y:.006894662381854655},{x:.070557,y:.0060300000000000215},{x:.07933606449072576,y:.006894662381854655},{x:.08777775445642903,y:.009455421036992116},{x:.09555766048588209,y:.013613867446385486},{x:.10237680515339463,y:.019210194846605383},{x:.10797313255361454,y:.026029339514117924},{x:.1121315789630079,y:.03380924554357098},{x:.11469233761814536,y:.04225093550927425},{x:.11555699999999999,y:.05103000000000002},{x:.11555699999999999,y:.3249696679740436},{x:.22632413005583354,y:.32573306868659574},{x:.22797244585475993,y:.3259068917113995},{x:.2296296407459454,y:.32587748916779646},{x:.3399906407459454,y:.3347734891677965},{x:.3425199358315593,y:.3352301100895628},{x:.3450781711944775,y:.33547763407671893},{x:.4262801711944775,y:.3514846340767189},{x:.43023360415359113,y:.35267647626036297},{x:.4342017122431381,y:.35381850872164355},{x:.49034871224313803,y:.3761405087216436},{x:.49223471805815816,y:.37711419756221787},{x:.49421014578428074,y:.3778905822551455},{x:.4961445509948513,y:.379132728294546},{x:.49818726580808836,y:.3801873213410173},{x:.49984707528076383,y:.38151024250532195},{x:.5016330805772936,y:.3826570960152846},{x:.5368430805772937,y:.4104950960152846},{x:.538268982488492,y:.41186995272090265},{x:.539835277869678,y:.41308244849417974},{x:.5414366048100854,y:.41492417879038607},{x:.5431934850553138,y:.4166181652891421},{x:.5443237674236908,y:.41824478417169497},{x:.5456234206874699,y:.41973955124896434},{x:.546834674823181,y:.4218582966024136},{x:.5482273167355989,y:.4238624839583804},{x:.5490185434436073,y:.4256783549664296},{x:.5500016096439067,y:.4273979502871872},{x:.5725636096439066,y:.4777629502871872},{x:.5732747072201834,y:.47988746499756846},{x:.5741879174558705,y:.48193325814034926},{x:.5746713208988057,y:.4840600657825243},{x:.5753635933927087,y:.4861283376286891},{x:.5756465551694752,y:.4883507586397718},{x:.5761431038835471,y:.49053540091990977},{x:.5762022992770958,y:.49271564988294925},{x:.5764777701286589,y:.49487923612929946},{x:.5763217220435205,y:.4971141570479765},{x:.5763825271473633,y:.4993536938878067},{x:.5706825271473633,y:.5794656938878067},{x:.5700654182420953,y:.5830779192715516},{x:.5695689975224034,y:.5867086990904052},{x:.5693236589408173,y:.5874197813867033},{x:.5691969863455608,y:.5881612549906394},{x:.5678870248015591,y:.5915836805014664},{x:.5666918126627678,y:.5950478490261242},{x:.5415328126627678,y:.6498468490261241},{x:.5413708296623262,y:.6501242105110185},{x:.5412617638147841,y:.650426323944409},{x:.5391478795722351,y:.653930540410781},{x:.5370840246571379,y:.6574644536133865},{x:.536871043573226,y:.6577048843594048},{x:.5367051339883567,y:.6579799150765678},{x:.5339482287199508,y:.661004400648547},{x:.5312345979336611,y:.6640677725799057},{x:.5309788035098929,y:.664262032968313},{x:.5307624259999995,y:.6644994116930277},{x:.47414742599999943,y:.7155204116930277},{x:.47266946719886654,y:.7166100541651699},{x:.4713261182021025,y:.7178618913781634},{x:.46912758296129603,y:.7192213498885075},{x:.46704701478499566,y:.7207552731949938},{x:.4653848758470294,y:.7215356430341334},{x:.4638231175995642,y:.7225013521577397},{x:.4283261175995643,y:.7398953521577398},{x:.4243082080780145,y:.7413960258251278},{x:.4202985181688539,y:.7429185254841078},{x:.34090751816885384,y:.7644395254841077},{x:.3408415384597873,y:.7644506164558663},{x:.3407789202555512,y:.7644741810938074},{x:.33649241770984384,y:.7651816893280429},{x:.33220802793590354,y:.7659018811363755},{x:.33214115226719376,y:.7658998869955335},{x:.33207514002138977,y:.7659107826399355},{x:.2099811400213898,y:.7739077826399355},{x:.20641155146718015,y:.773790767187745},{x:.20284008504333162,y:.7738075792583221},{x:.0663570850433316,y:.7610135792583221},{x:.06408313636872824,y:.7605723800858132},{x:.061777935509274226,y:.7603453376181454},{x:.05976354040438703,y:.759734277543603},{x:.05769704052657306,y:.7593333282846051},{x:.05555285882676713,y:.7584569812513055},{x:.053336245543570956,y:.7577845789630079},{x:.05147976838249502,y:.7567922712467745},{x:.04953119704042999,y:.7559958719887517},{x:.04759918201567506,y:.7547180546196904},{x:.04555633951411791,y:.7536261325536145},{x:.043929123673028744,y:.7522907110247322},{x:.04217336337061703,y:.7511294669445447},{x:.04052776127482757,y:.7494992850446065},{x:.03873719484660536,y:.7480298051533947},{x:.037401773317722896,y:.7464025893123053},{x:.03590629693874444,y:.7449211263687215},{x:.034610347337597366,y:.7430012269141045},{x:.033140867446385454,y:.7412106604858821},{x:.032148559730151835,y:.7393541833248057},{x:.030970837593177758,y:.7376094333079335},{x:.030074343103068113,y:.7354735969579864},{x:.02898242103699209,y:.733430754456429},{x:.028371360962449563,y:.7314163593515414},{x:.027556652268729623,y:.729475372026062},{x:.027094064670152376,y:.7272056777739226},{x:.02642166238185463,y:.7249890644907258},{x:.02621533264498147,y:.722894163516222},{x:.025794946192721373,y:.7208315299365354},{x:.02578404246766777,y:.7185152008594541},{x:.025556999999999996,y:.71621},{x:.025556999999999996,y:.05103000000000002}],[{x:.11555699999999999,y:.414971805397996},{x:.11555699999999999,y:.6752310456989574},{x:.20767337575712835,y:.6838660911730216},{x:.3217031184787672,y:.6763972896549704},{x:.3925929523867085,y:.6571807523203506},{x:.4185706758911827,y:.6444513238436673},{x:.46361487793542,y:.6038578374443203},{x:.4814895996448674,y:.5649247767123354},{x:.48580725170954087,y:.5042413131675768},{x:.4723746184159119,y:.474255736718963},{x:.45098032059796866,y:.45734081304228297},{x:.40480552914494095,y:.4389833995595593},{x:.3301954695220376,y:.42427584033215343},{x:.22404845814303564,y:.41571952231013837},{x:.11555699999999999,y:.414971805397996}]],Q:[[{x:.012134510452571898,y:.39776120903599943},{x:.012467756958298536,y:.3937322544040442},{x:.012734737801221134,y:.38969836671479857},{x:.012831073490929856,y:.38933975275179394},{x:.012861682585025715,y:.38896968840207613},{x:.0716656825850257,y:.06709568840207614},{x:.07243605319674906,y:.06440524795975149},{x:.07301096718930201,y:.06166637692330789},{x:.07364750148994079,y:.06017438890024393},{x:.07409402290033937,y:.05861495861744442},{x:.07537446994903126,y:.05612650608452361},{x:.07647266436288541,y:.053552421842995857},{x:.07738804025928744,y:.05221328363312273},{x:.0781302116420243,y:.05077092937167972},{x:.07987152826568633,y:.04858009458346291},{x:.08145080010539194,y:.04626971775068952},{x:.16096480010539196,y:-.04855928224931053},{x:.16315500529851779,y:-.05070373085173594},{x:.16521251383898505,y:-.052975804178533654},{x:.1663001767861927,y:-.05378319510572523},{x:.1672680674520078,y:-.05473086511953138},{x:.1698345496348827,y:-.056406820906963286},{x:.172295783242646,y:-.058233836978172464},{x:.17352006120728586,y:-.058813521600477286},{x:.17465423537351554,y:-.059554156299027654},{x:.17749836607515132,y:-.06069721323044178},{x:.18026874092294012,y:-.06200896084304842},{x:.2672567409229401,y:-.09317596084304836},{x:.2695830047845554,y:-.09375972267138269},{x:.2718475349769373,y:-.09454977610873284},{x:.2738508793967248,y:-.09483071995927067},{x:.27581299058749986,y:-.09532309988014809},{x:.2782084422243766,y:-.09544181332278269},{x:.28058359188359605,y:-.09577489818042065},{x:.2826032520283714,y:-.0956596106656824},{x:.28462372036011635,y:-.09575974074040533},{x:.28699630390923414,y:-.09540884370631499},{x:.2893907973658866,y:-.09527215971995788},{x:.3753267973658866,y:-.08182715971995795},{x:.37840631600914065,y:-.08102976437129623},{x:.38152495221950905,y:-.08040256216817918},{x:.38266795913198753,y:-.07992627554804835},{x:.3838666954562622,y:-.07961588068444121},{x:.38673147789694834,y:-.07823302278004476},{x:.38966782930723504,y:-.07700945634885908},{x:.3906959547522998,y:-.07631933185595965},{x:.3918111026603398,y:-.07578103928710583},{x:.3943510569158511,y:-.07386586128072498},{x:.3969922811880835,y:-.07209295159323717},{x:.45217017177581864,y:-.026613783173476364},{x:.5097585536672307,y:-.09873256043298734},{x:.5159122791302333,y:-.10505326271144577},{x:.5231808703268614,y:-.11005198218579294},{x:.5312849993737013,y:-.11353662086994384},{x:.5399132291363312,y:-.11537326605347448},{x:.5487339815837399,y:-.1154913364919842},{x:.5574082801461085,y:-.11388629480473579},{x:.5656027763942881,y:-.11061982184365243},{x:.5730025604329874,y:-.10581744633276943},{x:.5793232627114457,y:-.0996637208697668},{x:.5843219821857929,y:-.09239512967313873},{x:.5878066208699438,y:-.08429100062629874},{x:.5896432660534744,y:-.07566277086366895},{x:.5897613364919841,y:-.06684201841626024},{x:.5881562948047357,y:-.058167719853891554},{x:.5848898218436525,y:-.04997322360571205},{x:.5800874463327694,y:-.042573439567012816},{x:.5106129498444961,y:.04443049374200151},{x:.5474711182959175,y:.12365010382899572},{x:.5481373073434039,y:.1255496832776173},{x:.5490025186311253,y:.12736726941208848},{x:.5495935209593992,y:.1297019482663393},{x:.5503905347901464,y:.13197456307270286},{x:.5506733336355601,y:.13396760967066554},{x:.5511673266667299,y:.13591906574595297},{x:.5791213266667299,y:.32118306574595296},{x:.5792865967797204,y:.3243841932678159},{x:.5796238248970751,y:.32757179562983435},{x:.579513579388425,y:.3287806341158348},{x:.5795761658223595,y:.3299928748079828},{x:.5791137513174164,y:.3331647361616822},{x:.5788226293197903,y:.33635687958013644},{x:.5226546293197903,y:.6297998795801365},{x:.5219105438778229,y:.6323181740447382},{x:.521369234544533,y:.6348876981954499},{x:.5206636104444891,y:.6365383151545928},{x:.5201549436340621,y:.6382598551025291},{x:.5189338607071872,y:.6405845973766512},{x:.5179016631869613,y:.6429991446291672},{x:.5168875780620563,y:.6444803850133782},{x:.5160528293589531,y:.6460696100820955},{x:.5144016744792594,y:.6481114616238732},{x:.5129182555439367,y:.6502782422813739},{x:.4473292555439367,y:.7283852422813738},{x:.4454767413796947,y:.7301964293264013},{x:.4437773055972873,y:.732151966404103},{x:.44233025961343425,y:.7332727172827731},{x:.4410215211764534,y:.7345522595114605},{x:.4388512574885805,y:.735967237520439},{x:.4368029695300015,y:.737553656027496},{x:.4351650804791521,y:.7383705673253327},{x:.43363186277883553,y:.7393702013057781},{x:.431227251583759,y:.7403345934673514},{x:.4289088260065632,y:.7414909282302113},{x:.3168848260065632,y:.7842309282302113},{x:.31544522398579106,y:.7846236280557255},{x:.31406876767085296,y:.7851998529634103},{x:.3111991137964475,y:.7857818972901452},{x:.30837424253549156,y:.7865524758495462},{x:.30688569012846406,y:.7866567776362199},{x:.305423266132861,y:.7869533972381565},{x:.30249520063786056,y:.7869644160479279},{x:.2995742760667897,y:.7871690831124285},{x:.29809397750772,y:.7869809786010931},{x:.2966017859654652,y:.7869865939723252},{x:.2937278327647654,y:.7864261638184524},{x:.2908231043767717,y:.786057054147543},{x:.2894079467091229,y:.7855837720890787},{x:.28794333170435554,y:.785298167434039},{x:.16895933170435556,y:.7496931674340391},{x:.16685145995859063,y:.7488293371508981},{x:.16467103610787698,y:.748169732810473},{x:.1627799564873854,y:.7471607878174731},{x:.16079664289106937,y:.7463480029082842},{x:.1588977982379503,y:.7450895455041626},{x:.15688795304330724,y:.7440172356850165},{x:.15523004539103946,y:.7426587459550258},{x:.15344340707901263,y:.7414746531917952},{x:.15182656105367498,y:.739869930478983},{x:.1500645317387979,y:.7384261234461069},{x:.08134353173879794,y:.6698101234461069},{x:.07898814712174665,y:.6669445493412297},{x:.07654417665723892,y:.6641541443502993},{x:.0761910053095167,y:.6635415309608049},{x:.07574199244846258,y:.6629952594015535},{x:.07399091166125166,y:.6597252337561722},{x:.07213828241215867,y:.6565116506297859},{x:.07191141209628055,y:.6558419081228384},{x:.07157759918584938,y:.6552185349547689},{x:.07049811528111428,y:.6516697230205841},{x:.06930802275051184,y:.6481564579560907},{x:.013298022750511833,y:.4072474579560906},{x:.013249789700227431,y:.40687927578320093},{x:.013136451320225305,y:.40652566731159423},{x:.012677284531251238,y:.4025091147450468},{x:.012152162963867598,y:.3985006516980174},{x:.01217668547678935,y:.39813013424102855},{x:.012134510452571898,y:.39776120903599943}],[{x:.1030741934540208,y:.3959601630333355},{x:.15405220468618464,y:.6152256818322884},{x:.20562817178182732,y:.6667228451191239},{x:.2990925609035841,y:.6946913078929434},{x:.38591644511804135,y:.6615657918309754},{x:.4364618489221904,y:.6013735361946543},{x:.4889800495366121,y:.3269984766785998},{x:.4631403994395801,y:.1557472448128009},{x:.4478929247459949,y:.12297570323093639},{x:.3763894463327694,y:.21252056043298723},{x:.3702357208697667,y:.2188412627114457},{x:.36296712967313866,y:.22383998218579282},{x:.35486300062629866,y:.22732462086994373},{x:.34623477086366883,y:.22916126605347437},{x:.3374140184162602,y:.2292793364919841},{x:.3287397198538915,y:.22767429480473567},{x:.32054522360571197,y:.22440782184365232},{x:.31314543956701274,y:.21960544633276935},{x:.3068247372885543,y:.2134517208697667},{x:.30182601781420715,y:.20618312967313862},{x:.2983413791300562,y:.19807900062629863},{x:.2965047339465256,y:.18945077086366885},{x:.29638666350801585,y:.18063001841626014},{x:.2979917051952643,y:.17195571985389144},{x:.30125817815634764,y:.16376122360571194},{x:.3060605536672306,y:.1563614395670127},{x:.3960043024488616,y:.04372356068896105},{x:.3492507773512258,y:.005187991106938553},{x:.28681342879982186,y:-.004580559340762309},{x:.22209853619564562,y:.018606191220169738},{x:.15806156000107346,y:.09497717514193305},{x:.1030741934540208,y:.3959601630333355}]],R:[[{x:-.010088,y:.05588800000000005},{x:-.009223337618145366,y:.04710893550927426},{x:-.006662578963007905,y:.03866724554357101},{x:-.0025041325536145423,y:.030887339514117953},{x:.0030921948466053617,y:.024068194846605412},{x:.009911339514117913,y:.018471867446385508},{x:.01769124554357096,y:.014313421036992145},{x:.02613293550927423,y:.011752662381854684},{x:.034912,y:.01088800000000005},{x:.043691064490725774,y:.011752662381854684},{x:.05213275445642904,y:.014313421036992145},{x:.059912660485882105,y:.018471867446385515},{x:.06673180515339464,y:.024068194846605412},{x:.07232813255361453,y:.030887339514117953},{x:.0764865789630079,y:.03866724554357101},{x:.07904733761814536,y:.04710893550927428},{x:.079912,y:.05588800000000005},{x:.079912,y:.36648688236049143},{x:.25933152798675563,y:.3728389247505383},{x:.2598033776805002,y:.3702688775066002},{x:.2630584474090824,y:.36206984491555727},{x:.26785052379396923,y:.35466338703825},{x:.5319365237939692,y:.022999387038250052},{x:.5380814500271169,y:.016670129897313986},{x:.5453430800394999,y:.011661303295187019},{x:.5534423534621115,y:.008165393629206541},{x:.5620680197594453,y:.00631674674730745},{x:.5708885994130244,y:.006186405112428031},{x:.5795651224933998,y:.00777937768050025},{x:.5877641550844427,y:.011034447409082423},{x:.59517061296175,y:.015826523793969254},{x:.601499870102686,y:.021971450027116944},{x:.606508696704813,y:.02923308003949996},{x:.6100046063707935,y:.03733235346211146},{x:.6118532532526926,y:.04595801975944533},{x:.6119835948875719,y:.05477859941302443},{x:.6103906223194997,y:.06345512249339977},{x:.6071355525909176,y:.07165415508444274},{x:.6023434762060308,y:.07906061296174999},{x:.36492288462028066,y:.3772356888373974},{x:.45122307475864126,y:.3907421966461853},{x:.4517263325772421,y:.3908725352482557},{x:.4522445282141884,y:.3909141268943158},{x:.4559919550269364,y:.3919772876167318},{x:.459762859565968,y:.3929539131315124},{x:.46023101962685037,y:.3931799280437793},{x:.4607311441523136,y:.39332181547170203},{x:.5072261441523136,y:.41160281547170213},{x:.5099186672764574,y:.4129799887569096},{x:.5126912264123276,y:.4141879634543456},{x:.5138373975854011,y:.41498434320238026},{x:.5150799754049854,y:.4156198976243936},{x:.5174520892726079,y:.41749589411441484},{x:.5199357102894067,y:.4192215573713852},{x:.5536387102894067,y:.4479225573713852},{x:.5544422891842978,y:.4487559165260936},{x:.5553578681885658,y:.44946439490120116},{x:.5574982196806069,y:.4519250983842071},{x:.5597619879819907,y:.4542727608851649},{x:.5603875460278954,y:.4552468777427617},{x:.5611473151639865,y:.4561203635073251},{x:.5627664809673836,y:.45895134712470415},{x:.5645287453623273,y:.46169553923588524},{x:.5649522427143585,y:.46277297903182424},{x:.5655270044804562,y:.4637779046177677},{x:.5843050044804562,y:.5056739046177676},{x:.5856980535944053,y:.5098331481877504},{x:.5870956418010017,y:.5139908687307394},{x:.5870987900445207,y:.5140153439302019},{x:.587106627133701,y:.514038743222053},{x:.5876614810321307,y:.5183898384933372},{x:.5882210839336397,y:.522740325535193},{x:.5899430839336397,y:.580600325535193},{x:.589777587866933,y:.5830153029012521},{x:.5898269599494498,y:.5854354407122341},{x:.5894767504310368,y:.5874052295805413},{x:.5893399666658296,y:.589401226848592},{x:.5887065118476329,y:.5917375144207835},{x:.5882827897945603,y:.5941207819778186},{x:.5699357897945603,y:.6593647819778187},{x:.5695566600666073,y:.6603356321127045},{x:.5693270257483343,y:.6613522723710545},{x:.5679549854437747,y:.6644370937206254},{x:.5667268644118839,y:.6675819841936177},{x:.5661656160899001,y:.668460215174679},{x:.5657420574552864,y:.6694125215424361},{x:.5637945617300048,y:.6721703971299327},{x:.5619765010042908,y:.6750152648867381},{x:.5612547025465381,y:.6757671267898905},{x:.5606534967163777,y:.6766185026674012},{x:.5398464967163776,y:.7006785026674012},{x:.5387925287989109,y:.70167944573824},{x:.5378793324857355,y:.7028102896247742},{x:.535601038014175,y:.7047103734673366},{x:.5334498940671065,y:.7067532939324781},{x:.5322209035416287,y:.707529385222465},{x:.5311046373415733,y:.7084603444980107},{x:.5029396373415734,y:.7276033444980106},{x:.49917038563569516,y:.7296565217962586},{x:.49541206095977475,y:.7317296332429761},{x:.4611910609597748,y:.7464366332429762},{x:.457170688924302,y:.7477143925092122},{x:.45316143447737084,y:.7490266191763204},{x:.37177643447737085,y:.7670666191763205},{x:.36787988134157384,y:.7675363076101905},{x:.36399443936523473,y:.7680904503837813},{x:.2290834393652347,y:.7739614503837813},{x:.2260604581328276,y:.7737959747883908},{x:.2230330269857825,y:.7738173839936113},{x:.030818026985782503,y:.7562573839936113},{x:.028490934977474184,y:.7558115802948838},{x:.02613293550927423,y:.7555793376181453},{x:.024169339379190496,y:.7549836872441402},{x:.022154034015341384,y:.7545976128723226},{x:.01995862841458906,y:.7537063820373993},{x:.01769124554357096,y:.7530185789630078},{x:.01588158498580211,y:.7520512952425895},{x:.013980322522940947,y:.7512794726091756},{x:.012000971535783972,y:.7499770641392344},{x:.009911339514117913,y:.7488601325536145},{x:.008325158769029223,y:.7475583876576994},{x:.006611003657363959,y:.7464304774736483},{x:.004923772632206568,y:.7447669421957904},{x:.0030921948466053617,y:.7432638051533946},{x:.0017904499506900475,y:.7416776244083056},{x:.0003292762098528329,y:.7402369716294513},{x:-.001000995511218774,y:.7382762382714833},{x:-.0025041325536145423,y:.7364446604858821},{x:-.0034714162740331275,y:.7346349999281129},{x:-.004623456556617868,y:.732936968032819},{x:-.005545647377387794,y:.7307543864780955},{x:-.006662578963007905,y:.728664754456429},{x:-.007258229337013042,y:.7267011583263452},{x:-.008056863899357211,y:.7248110017280808},{x:-.008535534543753812,y:.7224904473617442},{x:-.009223337618145366,y:.7202230644907257},{x:-.009424464135908606,y:.7181809926864091},{x:-.009839001899660749,y:.7161713490432334},{x:-.009855757323261527,y:.7138019994682},{x:-.010088,y:.711444},{x:-.010088,y:.05588800000000005}],[{x:.079912,y:.45654326739466394},{x:.079912,y:.6703676283824797},{x:.22820062174801237,y:.6839146886946046},{x:.3561457472749752,y:.6783468266821017},{x:.42954781695254723,y:.662076342723345},{x:.4559144639404158,y:.6507448714849071},{x:.47563211893454127,y:.6373433067928232},{x:.48601322722124407,y:.6253391992627579},{x:.4997779385388953,y:.5763903343143285},{x:.4985264355495565,y:.5343392524542002},{x:.48755361344964526,y:.5098575528750181},{x:.467303195590932,y:.4926125823096997},{x:.43241084881177044,y:.4788935374345549},{x:.3509044963348569,y:.4661372945522357},{x:.079912,y:.45654326739466394}]],S:[[{x:.021897597226735628,y:.20918252956592975},{x:.022856530106274857,y:.20041326151782815},{x:.025507836686771486,y:.19199957102060095},{x:.07532383668677148,y:.0752955710206009},{x:.07606476437254353,y:.07394451179196875},{x:.07662717764446286,y:.07250992955787258},{x:.07818101321859919,y:.07008559601860773},{x:.07956562874320691,y:.06756079148160443},{x:.08055589829123208,y:.06638024029801701},{x:.0813873780598424,y:.06508294454561242},{x:.08338432112997196,y:.06300833217803187},{x:.0852348965856767,y:.0608021661408081},{x:.08643645249257384,y:.05983749092219001},{x:.08750504545666679,y:.05872733599970995},{x:.08986835462050304,y:.05708217099364391},{x:.09211377343035676,y:.05527942517977789},{x:.09348044057646428,y:.05456769785378441},{x:.09474508130770348,y:.05368734639231786},{x:.18347008130770348,y:.00406434639231789},{x:.18531117162778632,y:.0032602675504258996},{x:.18705570252460849,y:.0022638899609980986},{x:.18934358471290644,y:.0014991491478438968},{x:.19155425509545604,y:.0005336596975895336},{x:.19351683738147718,y:.0001042099085839361},{x:.19542223123106015,y:-.0005326814704223887},{x:.1978153459361366,y:-.0008363843304376121},{x:.20017189655491793,y:-.0013520417748285815},{x:.2021805498702545,y:-.0013903589963945293},{x:.20417358345551592,y:-.0016432887864569548},{x:.36640558345551594,y:-.006196288786456984},{x:.3683537351453612,y:-.006059465175549666},{x:.37030515940756886,y:-.006136660097762148},{x:.3727431942064551,y:-.005751182385354602},{x:.3752054496398049,y:-.005578251970786187},{x:.37708947517888647,y:-.005063991846688501},{x:.37901846335331396,y:-.004758999502412188},{x:.3813344490261288,y:-.00390529164215812},{x:.3837156558614866,y:-.003255321831637216},{x:.38546315320491126,y:-.002383387922517842},{x:.38729557535780434,y:-.001707928996501587},{x:.5134735753578044,y:.059451071003498376},{x:.5144073364238021,y:.06002293670994077},{x:.5154151369003129,y:.060451046875811966},{x:.5181619939873726,y:.06232241135953579},{x:.5209964106485654,y:.06405830049148753},{x:.5218006642926897,y:.06480134570578519},{x:.5227055800155168,y:.06541784197435321},{x:.5250345719141375,y:.06778913394790613},{x:.5274758708842278,y:.07004463571609586},{x:.5281197100899656,y:.07093030562736781},{x:.5288869656553633,y:.07171149639276676},{x:.5307085905129939,y:.07449158843544039},{x:.5326629540416582,y:.07718002517181716},{x:.5331216364294024,y:.07817428398206286},{x:.5337217466362741,y:.07909014852127505},{x:.5349660004312154,y:.08217220325496363},{x:.5363583234240663,y:.08519025984344057},{x:.5366142220868877,y:.08625489874416871},{x:.5370241250365293,y:.08727024089657527},{x:.5783351250365293,y:.22800124089657534},{x:.5784689928995229,y:.22870739358153944},{x:.5787167010683089,y:.22938208824013706},{x:.5792894483007394,y:.23303529403132756},{x:.5799781923062021,y:.23666841715613338},{x:.579971724381043,y:.23738711763976203},{x:.5800830465086156,y:.23809717369609615},{x:.5799320834693805,y:.24179192160438975},{x:.5798988062915618,y:.2454896025769029},{x:.5797522511369868,y:.24619323160266243},{x:.5797229091764134,y:.2469113620006918},{x:.5788540372904492,y:.2505056649360105},{x:.5781000177526308,y:.2541258039501414},{x:.5778190074010411,y:.2547873214491718},{x:.5776501289474114,y:.2554859288404322},{x:.5462891289474114,y:.3454679288404322},{x:.5453940585085517,y:.34740151578805634},{x:.5446999978282894,y:.3494160105998292},{x:.5435456407901493,y:.3513945829466735},{x:.5425833616033817,y:.3534733584203385},{x:.5413282655917657,y:.35519517245680393},{x:.5402545326513293,y:.3570355547940282},{x:.5387363559437135,y:.3587509055417339},{x:.537387017705137,y:.36060200657115166},{x:.5358201287566253,y:.36204587934864135},{x:.5344079865107593,y:.36364142435019586},{x:.5325843328131388,y:.3650276335315076},{x:.5308997898345437,y:.36657992334222783},{x:.5290813226127058,y:.36769036763963614},{x:.5273850388959807,y:.368979759405903},{x:.44286903889598056,y:.42100375940590296},{x:.4391930936098881,y:.42279580082266366},{x:.4355432374645799,y:.42464039733796655},{x:.4352309585303121,y:.42472736117212373},{x:.4349395777453148,y:.4248694107387315},{x:.430984654780085,y:.42590987723258605},{x:.42704506666901776,y:.42700697873237736},{x:.18802361397643091,y:.46887992641475673},{x:.1445277950559712,y:.506325930968192},{x:.1345999941059918,y:.5433489412625321},{x:.1668438673565076,y:.6442112383308392},{x:.2418447705661005,y:.6964178007533797},{x:.3847076342900009,y:.6886954406015322},{x:.4475324208368403,y:.608018765726417},{x:.4536085342974724,y:.6016234190133417},{x:.4608155671913789,y:.5965363480257236},{x:.46887655728619765,y:.5929530460487544},{x:.47748172525324006,y:.5910112173678703},{x:.48630037931336645,y:.5907854853702875},{x:.49499362353660437,y:.5922845248100812},{x:.5032273814226823,y:.5954507284422511},{x:.5106852342735829,y:.6001624208368403},{x:.5170805809866582,y:.6062385342974724},{x:.5221676519742764,y:.6134455671913789},{x:.5257509539512455,y:.6215065572861976},{x:.5276927826321296,y:.63011172525324},{x:.5279185146297124,y:.6389303793133664},{x:.5264194751899187,y:.6476236235366044},{x:.5232532715577489,y:.6558573814226824},{x:.5185415791631597,y:.663315234273583},{x:.4431175791631597,y:.760171234273583},{x:.4420344490669973,y:.7613112710002186},{x:.44110391182703096,y:.7625789282836855},{x:.4390031114098716,y:.7645018722698176},{x:.4370414657025276,y:.7665665809866583},{x:.43575673751534005,y:.767473404028016},{x:.4345967726198766,y:.768535164822443},{x:.4321611907321885,y:.7700113141492059},{x:.4298344328086211,y:.7716536519742764},{x:.42839747791415833,y:.7722924126294288},{x:.42705266216361437,y:.7731074740629288},{x:.4243758968514515,y:.7740801011395291},{x:.42177344271380235,y:.7752369539512456},{x:.4202394824828045,y:.7755831050064366},{x:.4187614963922926,y:.7761201447252115},{x:.4159464142454535,y:.7765518720385514},{x:.41316827474676,y:.7771787826321297},{x:.4115962584106506,y:.7772190216964318},{x:.4100419001567639,y:.7774574015652649},{x:.23125890015676387,y:.7871214015652648},{x:.22961427991333744,y:.7870487065186679},{x:.22797320559841586,y:.7871788426312305},{x:.22521775007366066,y:.7868543723294609},{x:.22244596265035355,y:.7867318545526676},{x:.22084712542379714,y:.7863397068281228},{x:.21921219559556868,y:.7861471846952227},{x:.21657298639174055,y:.7852913862936938},{x:.21387836011908076,y:.7846304737606538},{x:.21238674832737245,y:.7839339433752962},{x:.2108207924222569,y:.7834261615145331},{x:.2083992528689725,y:.782071922865878},{x:.2058853407234555,y:.7808980140745921},{x:.20455827617124617,y:.7799238683005129},{x:.20312147299647784,y:.7791203404840283},{x:.10291447299647782,y:.7093683404840284},{x:.10181255131472464,y:.7084283417469311},{x:.10059641238964509,y:.7076416809983432},{x:.09846400643554813,y:.7055718520256913},{x:.09620311784593605,y:.7036431918911783},{x:.09530575393663021,y:.7025062807105057},{x:.09426645267874648,y:.7014974784931097},{x:.09257882390791694,y:.6990514089395268},{x:.09073764058529563,y:.6967187299857058},{x:.09007931964022471,y:.6954285972205445},{x:.08925679581402991,y:.6942364212378118},{x:.08807879885369768,y:.6915081121844703},{x:.08672807644060793,y:.6888610579553555},{x:.08633409736450004,y:.6874672826843552},{x:.08575996009935855,y:.6861375475907227},{x:.04484896009935855,y:.5581635475907226},{x:.04400698871411546,y:.5542371548008082},{x:.04309586967447821,y:.5503262293029391},{x:.04308290316808571,y:.5499278363503387},{x:.04299932697019912,y:.5495380927241992},{x:.04293953506277818,y:.5455228840020936},{x:.042808906634767226,y:.5415093553341928},{x:.04287391188557095,y:.5411160877505585},{x:.04286797679041901,y:.5407175280315513},{x:.04359266213029085,y:.5367678055966908},{x:.04424754429113727,y:.532805911414652},{x:.06119154429113727,y:.4696179114146519},{x:.06126294463056804,y:.4694283141856516},{x:.06129777501412092,y:.46922873472253734},{x:.06281676603792068,y:.46530228011432895},{x:.0643004966052513,y:.46136236601319713},{x:.0644075135916399,y:.46119034135699993},{x:.06448061074086608,y:.46100139182805006},{x:.06673642807197144,y:.45744672339211917},{x:.06896028828319853,y:.453871975109843},{x:.06909880931377366,y:.45372413383751425},{x:.06920736414622189,y:.4535530754671619},{x:.07211331798967527,y:.4505067971180214},{x:.07499184614403663,y:.4474345902263458},{x:.07515654793327702,y:.4473166137950705},{x:.07529638874761438,y:.44717002026055797},{x:.1386943887476144,y:.392590020260558},{x:.14135607757337018,y:.39071931904916735},{x:.1439175788350931,y:.3887136217356019},{x:.14495796828078528,y:.38818782053421796},{x:.14591168674437638,y:.38751752344016943},{x:.1488871876674173,y:.38620203695812855},{x:.15179076253542007,y:.38473460266203335},{x:.15291373991533655,y:.3844218744952798},{x:.15397990142199966,y:.3839505182141148},{x:.15715486761053352,y:.383240799869195},{x:.1602889333309822,y:.3823680212676226},{x:.4030282434963717,y:.3398437611206276},{x:.46657219784598525,y:.30072914754350266},{x:.487912612564808,y:.23949853636308405},{x:.45628203537627,y:.13174508671722343},{x:.35793695341674575,y:.08407681754539842},{x:.21775140382412592,y:.0880110894972649},{x:.15207256592030022,y:.12474460286217379},{x:.10828216331322851,y:.2273324289793991},{x:.10404037125679308,y:.23506720851839558},{x:.09837110341432329,y:.2418258338591919},{x:.09149222656964323,y:.24734857482022213},{x:.08366809210217534,y:.25142319556354265},{x:.07519937711167927,y:.2538931106990613},{x:.06641152956592972,y:.2546634027732644},{x:.05764226151782814,y:.2537044698937252},{x:.04922857102060091,y:.2510531633132285},{x:.04149379148160447,y:.24681137125679312},{x:.034735166140808106,y:.24114210341432332},{x:.029212425179777887,y:.23426322656964324},{x:.025137804436457384,y:.22643909210217536},{x:.022667889300938757,y:.21797037711167933},{x:.021897597226735628,y:.20918252956592975}]],T:[[{x:-.022050999999999998,y:.729004},{x:-.021186337618145364,y:.7202249355092742},{x:-.018625578963007903,y:.711783245543571},{x:-.01446713255361454,y:.7040033395141179},{x:-.008870805153394636,y:.6971841948466053},{x:-.002051660485882085,y:.6915878674463855},{x:.005728245543570962,y:.6874294210369921},{x:.014169935509274232,y:.6848686623818546},{x:.022949,y:.684004},{x:.264284,y:.684004},{x:.264284,y:.05103000000000002},{x:.26514866238185464,y:.04225093550927423},{x:.2677094210369921,y:.03380924554357098},{x:.27186786744638547,y:.026029339514117924},{x:.27746419484660534,y:.019210194846605383},{x:.28428333951411794,y:.013613867446385479},{x:.292063245543571,y:.009455421036992116},{x:.30050493550927426,y:.006894662381854655},{x:.309284,y:.0060300000000000215},{x:.3180630644907258,y:.006894662381854655},{x:.32650475445642907,y:.009455421036992116},{x:.3342846604858821,y:.013613867446385486},{x:.34110380515339467,y:.019210194846605383},{x:.34670013255361454,y:.026029339514117924},{x:.3508585789630079,y:.03380924554357098},{x:.35341933761814537,y:.04225093550927425},{x:.354284,y:.05103000000000002},{x:.354284,y:.684004},{x:.579103,y:.684004},{x:.5878820644907258,y:.6848686623818546},{x:.596323754456429,y:.6874294210369921},{x:.6041036604858822,y:.6915878674463855},{x:.6109228051533947,y:.6971841948466053},{x:.6165191325536146,y:.7040033395141179},{x:.6206775789630079,y:.711783245543571},{x:.6232383376181454,y:.7202249355092742},{x:.6241030000000001,y:.729004},{x:.6232383376181454,y:.7377830644907257},{x:.6206775789630079,y:.746224754456429},{x:.6165191325536146,y:.7540046604858821},{x:.6109228051533947,y:.7608238051533946},{x:.6041036604858822,y:.7664201325536145},{x:.596323754456429,y:.7705785789630079},{x:.5878820644907258,y:.7731393376181454},{x:.579103,y:.774004},{x:.022949,y:.774004},{x:.014169935509274211,y:.7731393376181454},{x:.005728245543570935,y:.7705785789630079},{x:-.0020516604858820953,y:.7664201325536145},{x:-.008870805153394643,y:.7608238051533946},{x:-.01446713255361454,y:.7540046604858821},{x:-.018625578963007903,y:.746224754456429},{x:-.021186337618145364,y:.7377830644907257},{x:-.022050999999999998,y:.729004}]],U:[[{x:.027022176378557076,y:.7288780077818786},{x:.02808017637855708,y:.35099900778187865},{x:.02823473618726791,y:.3494735334648019},{x:.028192796744230073,y:.34794082288884604},{x:.035484796744230065,y:.24514582288884607},{x:.03612518708694976,y:.24139252668431194},{x:.03666424897987138,y:.2376233431565944},{x:.055316248979871384,y:.16148034315659432},{x:.05618736340037885,y:.15900518320818077},{x:.05685851158014249,y:.15646848905542057},{x:.057648252259250334,y:.15485425480263812},{x:.058244846291224776,y:.15315910934454152},{x:.0595821022437829,y:.15090145489330362},{x:.06073523897858293,y:.14854443712190207},{x:.09649723897858292,y:.0906284371219021},{x:.09834293286415725,y:.08820732921922435},{x:.10003759110096133,y:.08567820232322114},{x:.10101147458130413,y:.08470684222595504},{x:.10184538199049184,y:.08361295562088691},{x:.10412794610596264,y:.08159844564215248},{x:.10628345014049506,y:.07944852663140606},{x:.15306845014049508,y:.041154526631406},{x:.15518086878702558,y:.03974701384514513},{x:.15716842451696925,y:.03816808161035298},{x:.15884280372557036,y:.03730705230772802},{x:.16040964618671547,y:.03626305906247794},{x:.1627560674239954,y:.03529470367371844},{x:.16501346722603244,y:.034133863066459845},{x:.23490646722603245,y:.006476863066459913},{x:.23625924682734178,y:.006089880823813601},{x:.23754823013535448,y:.005525708919597472},{x:.24049103862888763,y:.004879315347967098},{x:.24338780663402787,y:.004050652809021178},{x:.24479008944495417,y:.003935020529692536},{x:.24616436977860445,y:.0036331571990539033},{x:.3343553697786044,y:-.006825842800946093},{x:.3363658265006992,y:-.006865793301669296},{x:.3383604992721398,y:-.007120376900508131},{x:.34076517153289726,y:-.0069532142518240045},{x:.3431751712391958,y:-.00700110421331946},{x:.3451547915551648,y:-.0066480664270605625},{x:.3471608040448924,y:-.0065086169201366215},{x:.4090588040448924,y:.003962383079863387},{x:.4119620232343868,y:.004752615784895447},{x:.4149089852784979,y:.005359710588792872},{x:.4162090298953196,y:.005908616535408058},{x:.4175706649775032,y:.0062792425557079215},{x:.42026393287145114,y:.0076206811274584655},{x:.4230358315454356,y:.008791034549085273},{x:.4738028315454356,y:.03637303454908527},{x:.4760785863358737,y:.0379161826666043},{x:.4784624107710392,y:.03928649177082543},{x:.47972093897980134,y:.04038599604431689},{x:.48110410464379305,y:.04132389563682743},{x:.48303507818089647,y:.043281370330868374},{x:.4851057640535682,y:.045090410406577325},{x:.5154867640535682,y:.07740541040657731},{x:.5155903820373309,y:.07753992155387555},{x:.5157174079857786,y:.07765259073212467},{x:.5182811318880063,y:.08103290449336144},{x:.5208701788099869,y:.08439386230433626},{x:.5209455639802052,y:.08454600372347547},{x:.521048168494406,y:.08468128952824439},{x:.5340921684944061,y:.10592328952824437},{x:.5341054861393935,y:.10595068243490303},{x:.5341238592672674,y:.10597497562685786},{x:.5360339092314592,y:.10991723311331511},{x:.5379492688231333,y:.11385691363208547},{x:.5379569864823256,y:.11388637833537296},{x:.5379702672090579,y:.11391378915988949},{x:.557924267209058,y:.16807278915988946},{x:.5580810067186996,y:.16867450001810444},{x:.5583366124011981,y:.1692413235937006},{x:.5591915686944892,y:.17293786157308777},{x:.5601479818122073,y:.1766094575809222},{x:.5601843216510317,y:.17723018509512725},{x:.5603244341481242,y:.17783598350956487},{x:.5696394341481241,y:.2495799835095649},{x:.569721927352796,y:.25224539988339456},{x:.5700114646960025,y:.2548963275892337},{x:.5750284646960026,y:.7275053275892338},{x:.5742570402937379,y:.7362930758081182},{x:.5717860339652341,y:.7447614724740409},{x:.5677104050979391,y:.752585081852262},{x:.5621867778235843,y:.7594632470219072},{x:.5554274220406369,y:.7651316439528263},{x:.5476920960011455,y:.7693724393298378},{x:.5392780639467868,y:.7720226617648687},{x:.5305086724107663,y:.7729804646960026},{x:.5217209241918819,y:.7722090402937379},{x:.5132525275259592,y:.7697380339652341},{x:.505428918147738,y:.7656624050979391},{x:.4985507529780929,y:.7601387778235843},{x:.49288235604717384,y:.753379422040637},{x:.48864156067016223,y:.7456440960011456},{x:.48599133823513135,y:.7372300639467868},{x:.4850335353039975,y:.7284606724107663},{x:.48004487037154997,y:.258520878697574},{x:.4717248917269394,y:.19444051929027983},{x:.4550625667192203,y:.14921575933773623},{x:.4467624246683876,y:.135699076001046},{x:.42448554918380393,y:.11200409455592171},{x:.3866565267646711,y:.09145137140181527},{x:.33852910612300163,y:.08330987698295},{x:.2625775703514966,y:.09231733933890664},{x:.20464797458906397,y:.11524036210229632},{x:.16911733402594603,y:.14432255403825953},{x:.14104265103985364,y:.1897890642955865},{x:.12498883901236212,y:.25532548983758135},{x:.11807553704626646,y:.35278200048003916},{x:.11702182362144292,y:.7291299922181214},{x:.11613258476624799,y:.737906601393955},{x:.11354820087598706,y:.7463410885908555},{x:.10936798837422372,y:.7541093211959605},{x:.10375259048311052,y:.7609127703867312},{x:.09691780379445152,y:.7664899834261845},{x:.0891262853276994,y:.770626631144951},{x:.08067745876799748,y:.7731637444910576},{x:.07189600778187862,y:.7740038236214429},{x:.06311939860604492,y:.773114584766248},{x:.05468491140914452,y:.770530200875987},{x:.04691667880403945,y:.7663499883742237},{x:.04011322961326877,y:.7607345904831105},{x:.03453601657381558,y:.7538998037944515},{x:.030399368855048972,y:.7461082853276993},{x:.027862255508942363,y:.7376594587679974},{x:.027022176378557076,y:.7288780077818786}]],V:[[{x:-.017163400590915968,y:.72836062945125},{x:-.016173311217885875,y:.7195948244454146},{x:-.01349212241321528,y:.7111906087794154},{x:.27875887758678475,y:.033216608779415485},{x:.2789749302503264,y:.03282594254600198},{x:.27911899522766415,y:.032403397706182537},{x:.2811076886540147,y:.028969490703698003},{x:.2830281292409603,y:.025496951748158487},{x:.28331624571443165,y:.0251559418405784},{x:.28353997693249255,y:.024769621764193565},{x:.2861603801951793,y:.021789671162821947},{x:.2887213787977949,y:.018758515442121357},{x:.2890704869266977,y:.018480266679882864},{x:.2893652865202418,y:.018145017430816868},{x:.2925166989914198,y:.015733541060992128},{x:.2956198378696305,y:.013260254189586457},{x:.29601652162435305,y:.013055459516578674},{x:.296371060610326,y:.012784164535463174},{x:.29993237527606087,y:.011033834081706148},{x:.30345840254303674,y:.009213463087028258},{x:.303887417589348,y:.00908999264768462},{x:.3042880712333465,y:.00889307764850001},{x:.3081224287682413,y:.00787115732855266},{x:.3119358411735324,y:.006773658047051503},{x:.31238070070379703,y:.0067362567411129665},{x:.3128120721109714,y:.0066212890568466964},{x:.3167721203052928,y:.006367050695504971},{x:.32072637054875,y:.006034599409084053},{x:.3211699788607,y:.006084704547762943},{x:.3216154906697884,y:.006056102322046737},{x:.325549047092249,y:.006579316156958459},{x:.3294921755545854,y:.0070246887821141385},{x:.32991748502957097,y:.007160374853030322},{x:.330360016471596,y:.007219237253358143},{x:.3341159167548444,y:.008499796470269213},{x:.33789639122058457,y:.00970587758678474},{x:.33828705745399834,y:.009921930250326543},{x:.33870960229381747,y:.01006599522766418},{x:.3421435092963017,y:.012054688654014527},{x:.34561604825184156,y:.013975129240960359},{x:.3459570581594215,y:.014263245714431577},{x:.34634337823580646,y:.014486976932492547},{x:.34932332883717915,y:.01710738019518028},{x:.35235448455787866,y:.01966837879779494},{x:.3526327333201171,y:.020017486926697612},{x:.35296798256918316,y:.020312286520241793},{x:.3553794589390082,y:.023463698991420194},{x:.3578527458104136,y:.026566837869630475},{x:.3580575404834214,y:.026963521624353053},{x:.35832883546453687,y:.02731806061032596},{x:.3600791659182934,y:.03087937527605991},{x:.3618995369129718,y:.03440540254303673},{x:.3620230073523154,y:.034834417589348},{x:.3622199223515,y:.0352350712333465},{x:.6163569223515,y:.7132090712333464},{x:.6186287109431533,y:.7217330721109714},{x:.6191938976779532,y:.7305364906697883},{x:.6180307627466418,y:.7392810164715959},{x:.6151840047723358,y:.7476306022938175},{x:.6107630230675074,y:.7552643782358064},{x:.6049377134797582,y:.7618889825691831},{x:.597931939389674,y:.7672498354645368},{x:.5900149287666535,y:.7711409223515},{x:.5814909278890286,y:.7734127109431533},{x:.5726875093302116,y:.7739778976779532},{x:.5639429835284039,y:.7728147627466418},{x:.5555933977061824,y:.7699680047723358},{x:.5479596217641935,y:.7655470230675074},{x:.5413350174308168,y:.7597217134797583},{x:.5359741645354631,y:.7527159393896741},{x:.5320830776484999,y:.7447989287666535},{x:.3171703309688009,y:.17146543337864517},{x:.06915612241321528,y:.7468173912205845},{x:.06488687075903964,y:.7545370482518415},{x:.059193621202205074,y:.7612754845578786},{x:.05229516213036956,y:.7667737458104136},{x:.04445659745696326,y:.7708205369129717},{x:.0359791588264676,y:.7732603419529485},{x:.027188629451250054,y:.773999400590916},{x:.01842282444541461,y:.7730093112178859},{x:.010018608779415478,y:.7703281224132152},{x:.0022989517481584835,y:.7660588707590397},{x:-.004439484557878664,y:.7603656212022051},{x:-.009937745810413578,y:.7534671621303695},{x:-.013984536912971763,y:.7456285974569633},{x:-.016424341952948517,y:.7371511588264675},{x:-.017163400590915968,y:.72836062945125}]],W:[[{x:-.04486424190193638,y:.7324968210037928},{x:-.04468360364824366,y:.7236771280279449},{x:.03511539635175633,y:.05429612802794491},{x:.03538914303981033,y:.053053468981350556},{x:.035486899606724354,y:.05178477579191172},{x:.03633616861564037,y:.04875449496443272},{x:.037013200434797444,y:.04568114375463893},{x:.03752411791055629,y:.04451576738270255},{x:.03786750587531561,y:.043290523137271594},{x:.039291634880795206,y:.040484152470619886},{x:.040555238800576446,y:.03760193719815913},{x:.041283692791972554,y:.036558628261303676},{x:.041859515947665654,y:.035423918409107566},{x:.04380377647068911,y:.032949305154171604},{x:.045605392901094464,y:.030368987735599786},{x:.046523389329760155,y:.02948784001117424},{x:.047309519115439125,y:.028487270815480248},{x:.049699194314460494,y:.02643951297186818},{x:.05196958814642765,y:.024260253558522238},{x:.05304184892442764,y:.02357512905942291},{x:.054008074813295476,y:.022747151833295932},{x:.056751330810561565,y:.021204943586542027},{x:.059403252082379655,y:.019510489895534},{x:.060588570829346225,y:.019047717572039012},{x:.06169776130235942,y:.01842415101594414},{x:.06468917630833097,y:.01744675856409077},{x:.06762071317273859,y:.01630222750050557},{x:.06887353875396018,y:.016079591433481148},{x:.07008306824328207,y:.01568439886046892},{x:.07320768385688461,y:.015309382847312772},{x:.07630617899620724,y:.014758758098063603},{x:.07757836602719018,y:.014784814066709744},{x:.07884175299285809,y:.014633182505734484},{x:.08197949198836539,y:.014874954586349768},{x:.08512587197205507,y:.014939396351756326},{x:.08636853101864941,y:.015213143039810315},{x:.08763722420808827,y:.015310899606724347},{x:.09066750503556728,y:.016160168615640357},{x:.09374085624536103,y:.01683720043479743},{x:.09490623261729739,y:.017348117910556266},{x:.09613147686272838,y:.017691505875315594},{x:.09893784752938008,y:.01911563488079519},{x:.10182006280184085,y:.020379238800576432},{x:.10286337173869634,y:.02110769279197256},{x:.1039980815908924,y:.02168351594766564},{x:.10647269484582828,y:.023627776470689026},{x:.1090530122644002,y:.025429392901094458},{x:.10993415998882576,y:.026347389329760156},{x:.11093472918451973,y:.02713351911543911},{x:.11298248702813177,y:.02952319431446044},{x:.11516174644147774,y:.03179358814642764},{x:.11584687094057705,y:.032865848924427614},{x:.11667484816670405,y:.03383207481329547},{x:.118217056413458,y:.03657533081056164},{x:.11991151010446596,y:.039227252082379635},{x:.12037428242796094,y:.040412570829346184},{x:.12099784898405583,y:.041521761302359406},{x:.2862381791186236,y:.4176126753554925},{x:.4644074439049092,y:.03214939722735514},{x:.46457066699968924,y:.031871550040082325},{x:.46468087848244366,y:.03156873942729889},{x:.4668033610072479,y:.028070937443703255},{x:.4688757411162635,y:.024543219843286366},{x:.46909003322228215,y:.024302554657928657},{x:.4692572024422568,y:.02402706365982141},{x:.47202128937582516,y:.021010546759784428},{x:.47474207284479647,y:.017954914566682648},{x:.47499919883659564,y:.017760680011347015},{x:.4752169015744166,y:.01752309559247584},{x:.47851637060601154,y:.015103786828781735},{x:.4817809992520572,y:.012637666274559728},{x:.4820710779219699,y:.012497326674279732},{x:.48233094798351184,y:.012306779070622963},{x:.4860390023686124,y:.010577651122297159},{x:.4897220183436901,y:.008795813836836655},{x:.4900339021311097,y:.008714762363747632},{x:.4903259528556443,y:.008578574212853553},{x:.49430009414373083,y:.007606076497244536},{x:.4982599612093785,y:.006576997488159493},{x:.4985816645952609,y:.006558348904918078},{x:.4988946726372282,y:.006481753841050326},{x:.5029821768073245,y:.006303258899985619},{x:.5070667194929276,y:.00606648509648134},{x:.5073858795965667,y:.006110956057683261},{x:.5077078162324508,y:.006096897586191266},{x:.5117516027915979,y:.006719264880154805},{x:.5158038544123874,y:.0072838953667157535},{x:.5161082060899873,y:.007389776878261636},{x:.5164266994754154,y:.007438795258320738},{x:.5202713679739276,y:.008838107561233023},{x:.5241356027726449,y:.01018244390490916},{x:.524413449959918,y:.010345666999689355},{x:.5247162605727012,y:.010455878482443691},{x:.5282140625562944,y:.012578361007246536},{x:.5317417801567137,y:.014650741116263542},{x:.5319824453420714,y:.01486503322228222},{x:.5322579363401786,y:.01503220244225683},{x:.535274453240215,y:.01779628937582467},{x:.5383300854333174,y:.020517072844796484},{x:.5385243199886531,y:.020774198836595797},{x:.5387619044075241,y:.0209919015744166},{x:.5411812131712181,y:.024291370606011366},{x:.5436473337254403,y:.027555999252057217},{x:.5437876733257202,y:.027846077921969747},{x:.5439782209293771,y:.028105947983511865},{x:.5457073488777034,y:.03181400236861376},{x:.5474891861631633,y:.0354970183436901},{x:.5475702376362523,y:.03580890213110964},{x:.5477064257871465,y:.03610095285564429},{x:.548678923502756,y:.040075094143733274},{x:.5497080025118405,y:.04403496120937851},{x:.5497266510950819,y:.04435666459526063},{x:.5498032461589497,y:.04466967263722821},{x:.6466002461589497,y:.7226436726372282},{x:.6469851024138088,y:.7314568162324507},{x:.6456432047416794,y:.7401756994754154},{x:.6426261215175564,y:.7484652605727011},{x:.6380497975577433,y:.7560069363401786},{x:.6320900984255835,y:.7625109044075241},{x:.6249760520164882,y:.7677272209293771},{x:.6169810471443558,y:.7714554257871464},{x:.6084123273627718,y:.7735522461589497},{x:.5995991837675493,y:.7739371024138088},{x:.5908803005245846,y:.7725952047416793},{x:.5825907394272989,y:.7695781215175563},{x:.5750490636598214,y:.7650017975577432},{x:.5685450955924759,y:.7590420984255835},{x:.563328779070623,y:.7519280520164882},{x:.5596005742128536,y:.7439330471443557},{x:.5575037538410503,y:.7353643273627718},{x:.4822251865940539,y:.2081071670095049},{x:.3260455560950909,y:.5459966027726448},{x:.3245096626856286,y:.5486110836728201},{x:.32313748405233433,y:.5513150815908924},{x:.32228015650766817,y:.5524062697730983},{x:.32157725888373645,y:.5536027801567136},{x:.3195608173147473,y:.5558673865996665},{x:.3176874808845609,y:.5582517291845196},{x:.31663374639442166,y:.5591546941850146},{x:.31571092715520355,y:.5601910854333173},{x:.3132914281453504,y:.5620187898634509},{x:.3109889251867045,y:.563991848166704},{x:.30977927817660644,y:.5646718895469083},{x:.3086720007479428,y:.5655083337254402},{x:.3059424242873038,y:.566828898486493},{x:.3032992386976406,y:.5683148489840557},{x:.30198016522380455,y:.5687458331350992},{x:.3007309816563099,y:.5693501861631632},{x:.29779622383750376,y:.570112862691949},{x:.29491393175671793,y:.571054601139531},{x:.29353612307299787,y:.5712199655821879},{x:.29219303879062153,y:.5715690025118404},{x:.28916588071079274,y:.5717444815770724},{x:.2861552470071419,y:.5721058174942654},{x:.2847716515285703,y:.5719992073657418},{x:.2833862805070725,y:.5720795149035186},{x:.28038305415357795,y:.5716610529431293},{x:.27735977579191173,y:.5714281003932755},{x:.27602356431680025,y:.5710536126610233},{x:.27464914558761266,y:.5708621046332842},{x:.27178526326499086,y:.5698657829057354},{x:.26886552313727163,y:.5690474941246844},{x:.26762804552325165,y:.5684195201422382},{x:.26631739722735515,y:.5679635560950907},{x:.26370291632718046,y:.5664276626856288},{x:.2609989184091076,y:.5650554840523343},{x:.25990773022690183,y:.5641981565076682},{x:.2587112198432863,y:.5634952588837364},{x:.25644661340033337,y:.5614788173147471},{x:.2540622708154803,y:.5596054808845607},{x:.2531593058149851,y:.5585517463944213},{x:.2521229145666826,y:.5576289271552034},{x:.2502952101365493,y:.5552094281453507},{x:.24832215183329598,y:.5529069251867045},{x:.2476421104530918,y:.5516972781766065},{x:.24680566627455972,y:.5505900007479427},{x:.245485101513507,y:.5478604242873037},{x:.24399915101594416,y:.5452172386976405},{x:.10495542809967917,y:.22875042455884986},{x:.04468360364824366,y:.734330871972055},{x:.04278579956520255,y:.742945856245361},{x:.03924376119942353,y:.7510250628018409},{x:.034193607098905524,y:.7582580122644001},{x:.02782941185357234,y:.7643667464414777},{x:.020395747917620333,y:.7691165101044659},{x:.012178286827261426,y:.7723247724994944},{x:.003492821003792758,y:.7738682419019364},{x:-.00532687197205508,y:.7736876036482436},{x:-.013941856245361059,y:.7717897995652026},{x:-.022021062801840872,y:.7682477611994235},{x:-.029254012264400202,y:.7631976070989055},{x:-.035362746441477744,y:.7568334118535723},{x:-.04011251010446598,y:.7493997479176203},{x:-.04332077249949441,y:.7411822868272614},{x:-.04486424190193638,y:.7324968210037928}]],X:[[{x:-.03582341524240513,y:.7325834270170574},{x:-.035659804156077404,y:.7237634017461555},{x:-.03377863524060577,y:.7151447697271875},{x:-.030252200762440104,y:.7070587401552579},{x:-.02521601962092907,y:.6998160546121182},{x:.24190189785100796,y:.3863717955888736},{x:-.0190039697420246,y:.08021800391719859},{x:-.024040163260448045,y:.07297532698032597},{x:-.027566611556706647,y:.06488930343468059},{x:-.029447795200430175,y:.056270674630427356},{x:-.029611421359170286,y:.047450649639130975},{x:-.028051201971409197,y:.03876817707487998},{x:-.024827095393237467,y:.030556919489131844},{x:-.02006300223235442,y:.02313243090598055},{x:-.013942003917198569,y:.016780030257975413},{x:-.006699326980325947,y:.011743836739551976},{x:.0013866965653194212,y:.00821738844329338},{x:.010005325369572668,y:.006336204799569846},{x:.018825350360869044,y:.0061725786408297345},{x:.02750782292512003,y:.007732798028590823},{x:.03571908051086817,y:.010956904606762553},{x:.04314356909401947,y:.0157209977676456},{x:.049495969742024595,y:.021841996082801452},{x:.3010259353438819,y:.31699385831754345},{x:.5525549803790709,y:.021842054612118165},{x:.558907370566982,y:.01572104544144637},{x:.5663318510088331,y:.010956939592969957},{x:.5745431030849405,y:.007732818982704524},{x:.5832255729829426,y:.006172584757594898},{x:.5920455982538445,y:.006336195843922615},{x:.6006642302728125,y:.008217364759394247},{x:.6087502598447422,y:.011743799237559922},{x:.6159929453878819,y:.016779980379070948},{x:.6221139545585537,y:.023132370566981995},{x:.6268780604070301,y:.03055685100883309},{x:.6301021810172955,y:.0387681030849405},{x:.6316624152424052,y:.04745057298294264},{x:.6314988041560774,y:.05627059825384449},{x:.6296176352406058,y:.06488923027281246},{x:.6260912007624402,y:.07297525984474214},{x:.6210550196209291,y:.08021794538788188},{x:.36015009139561527,y:.3863716945525663},{x:.6272689697420246,y:.6998159960828014},{x:.632305163260448,y:.7070586730196741},{x:.6358316115567066,y:.7151446965653194},{x:.6377127952004301,y:.7237633253695727},{x:.6378764213591702,y:.7325833503608691},{x:.6363162019714091,y:.74126582292512},{x:.6330920953932374,y:.7494770805108681},{x:.6283280022323544,y:.7569015690940195},{x:.6222070039171985,y:.7632539697420246},{x:.6149643269803259,y:.7682901632604481},{x:.6068783034346805,y:.7718166115567067},{x:.5982596746304273,y:.7736977952004301},{x:.5894396496391309,y:.7738614213591702},{x:.58075717707488,y:.7723012019714092},{x:.5725459194891318,y:.7690770953932374},{x:.5651214309059804,y:.7643130022323544},{x:.5587690302579753,y:.7581920039171985},{x:.30102605390274134,y:.4557496318238965},{x:.04328401962092907,y:.7581919453878818},{x:.03693162943301802,y:.7643129545585536},{x:.029507148991166913,y:.76907706040703},{x:.021295896915059523,y:.7723011810172955},{x:.012613427017057378,y:.7738614152424051},{x:.003793401746155514,y:.7736978041560774},{x:-.004825230272812429,y:.7718166352406057},{x:-.012911259844742107,y:.7682902007624401},{x:-.02015394538788185,y:.7632540196209291},{x:-.02627495455855365,y:.756901629433018},{x:-.031039060407030063,y:.7494771489911669},{x:-.034263181017295495,y:.7412658969150595},{x:-.03582341524240513,y:.7325834270170574}]],Y:[[{x:-.02688005049839745,y:.731186349993587},{x:-.02644216088936969,y:.7223756821949907},{x:-.024293809188388457,y:.7138197369324374},{x:-.020517555346512936,y:.7058473143841377},{x:-.015258518681138845,y:.6987647902776368},{x:.25043465103960333,y:.4059541390643743},{x:.26029423204414154,y:.04978477430584237},{x:.26140149479875585,y:.04103299828270508},{x:.26419486861258723,y:.03266540142918031},{x:.26856700569651215,y:.025003545799746604},{x:.27434988727431814,y:.01834187220942495},{x:.28132128045004745,y:.012936385038381841},{x:.28921327849355916,y:.008994814127168342},{x:.2977225963459245,y:.006668631835443931},{x:.30652222569415766,y:.00604723204414153},{x:.3152740017172949,y:.007154494798755871},{x:.32364159857081976,y:.009947868612587236},{x:.3313034542002534,y:.014320005696512164},{x:.3379651277905751,y:.020102887274318144},{x:.3433706149616182,y:.027074280450047443},{x:.3473121858728317,y:.03496627849355913},{x:.3496383681645561,y:.04347559634592452},{x:.3502597679558585,y:.05227522569415767},{x:.34045421751128274,y:.4064927803087797},{x:.6166036868780955,y:.6970396048261934},{x:.6220250193382449,y:.7039986829780357},{x:.6259845336177533,y:.7118816938899454},{x:.6283300678033804,y:.7203856978734211},{x:.6289714843317633,y:.7291838908244783},{x:.6278841339254269,y:.7379381631220915},{x:.6251098028506934,y:.7463120929913156},{x:.620755107094902,y:.7539838750034306},{x:.6149873951738065,y:.7606586868780956},{x:.6080283170219642,y:.7660800193382449},{x:.6001453061100546,y:.7700395336177532},{x:.5916413021265788,y:.7723850678033803},{x:.5828431091755216,y:.7730264843317632},{x:.5740888368779085,y:.7719391339254268},{x:.5657149070086843,y:.7691648028506933},{x:.5580431249965694,y:.7648101070949019},{x:.5513683131219045,y:.7590423951738065},{x:.29567976193894085,y:.4900232412279098},{x:.051392518681138845,y:.7592432097223631},{x:.04485280102201476,y:.765163657957578},{x:.03728372005126494,y:.7696945108160528},{x:.028976151305805796,y:.7726616501633681},{x:.02024934999358704,y:.7739510504983974},{x:.011438682194990706,y:.7735131608893697},{x:.002882736932437466,y:.7713648091883885},{x:-.0050896856158622154,y:.7675885553465129},{x:-.012172209722363214,y:.7623295186811389},{x:-.01809265795757798,y:.7557898010220148},{x:-.022623510816052815,y:.7482207200512649},{x:-.025590650163368103,y:.7399131513058058},{x:-.02688005049839745,y:.731186349993587}]],Z:[[{x:.008711000000000003,y:.05103000000000002},{x:.00905278632815029,y:.04755978517413498},{x:.009251179439517476,y:.04407842782316871},{x:.009484424544736794,y:.043177288815328604},{x:.009575662381854637,y:.04225093550927423},{x:.01058788670939069,y:.038914079093048184},{x:.01146164687940622,y:.0355383196233794},{x:.011866213744552238,y:.0346999996115786},{x:.012136421036992098,y:.03380924554357098},{x:.013780184150668652,y:.030733981057728944},{x:.015295733266009179,y:.0275935480126292},{x:.015856074613338045,y:.026850263164785913},{x:.01629486744638546,y:.026029339514117927},{x:.01850700045157689,y:.023333847648222647},{x:.020606096809669634,y:.02054942610843994},{x:.02130067903544657,y:.01992974044441782},{x:.021891194846605365,y:.019210194846605383},{x:.024586686712500538,y:.016998061841414044},{x:.027188663217490867,y:.014676655565200585},{x:.02799079391630549,y:.014204383257544266},{x:.028710339514117916,y:.013613867446385479},{x:.03178560399995988,y:.01197010433270896},{x:.03479046815396611,y:.010200923661400137},{x:.035669321892902964,y:.00989421387003954},{x:.036490245543570964,y:.009455421036992116},{x:.03982710195979704,y:.008443196709456058},{x:.04311937851852794,y:.007294230264082269},{x:.04404118144126662,y:.007164869674294513},{x:.04493193550927423,y:.006894662381854655},{x:.048402150335139275,y:.006552876053704368},{x:.05185531895677298,y:.006068277970413476},{x:.052784646693945655,y:.006121237837117864},{x:.053711,y:.0060300000000000215},{x:.548341,y:.0060300000000000215},{x:.5571200644907257,y:.006894662381854655},{x:.565561754456429,y:.009455421036992116},{x:.5733416604858821,y:.013613867446385479},{x:.5801608051533946,y:.019210194846605383},{x:.5857571325536145,y:.026029339514117927},{x:.5899155789630078,y:.03380924554357098},{x:.5924763376181453,y:.04225093550927425},{x:.593341,y:.05103000000000002},{x:.5924763376181453,y:.05980906449072579},{x:.5899155789630078,y:.06825075445642906},{x:.5857571325536145,y:.07603066048588211},{x:.5801608051533946,y:.08284980515339466},{x:.5733416604858821,y:.08844613255361455},{x:.565561754456429,y:.09260457896300792},{x:.5571200644907257,y:.09516533761814538},{x:.548341,y:.09603000000000002},{x:.14224494935878249,y:.09603000000000002},{x:.5846943444347994,y:.7024816632174908},{x:.5851666167424556,y:.7032837939163054},{x:.5857571325536145,y:.7040033395141179},{x:.5874008956672913,y:.7070786039999603},{x:.5891700763385999,y:.7100834681539662},{x:.5894767861299605,y:.7109623218929031},{x:.5899155789630078,y:.711783245543571},{x:.5909278032905438,y:.7151201019597967},{x:.5920767697359177,y:.7184123785185279},{x:.5922061303257055,y:.7193341814412667},{x:.5924763376181453,y:.7202249355092742},{x:.5928181239462956,y:.7236951503351391},{x:.5933027220295866,y:.7271483189567729},{x:.5932497621628822,y:.7280776466939456},{x:.593341,y:.729004},{x:.5929992136718496,y:.7324742148258655},{x:.5928008205604824,y:.7359555721768313},{x:.5925675754552632,y:.7368567111846711},{x:.5924763376181453,y:.7377830644907257},{x:.5914641132906093,y:.7411199209069517},{x:.5905903531205937,y:.7444956803766206},{x:.5901857862554476,y:.7453340003884216},{x:.5899155789630078,y:.746224754456429},{x:.5882718158493319,y:.74930001894227},{x:.5867562667339908,y:.7524404519873709},{x:.5861959253866618,y:.7531837368352144},{x:.5857571325536145,y:.7540046604858821},{x:.5835449995484229,y:.7567001523517777},{x:.5814459031903303,y:.7594845738915601},{x:.5807513209645536,y:.760104259555582},{x:.5801608051533946,y:.7608238051533946},{x:.5774653132874991,y:.7630359381585863},{x:.5748633367825091,y:.7653573444347994},{x:.5740612060836946,y:.7658296167424556},{x:.5733416604858821,y:.7664201325536145},{x:.5702663960000408,y:.7680638956672906},{x:.5672615318460339,y:.7698330763385999},{x:.5663826781070966,y:.7701397861299606},{x:.565561754456429,y:.7705785789630079},{x:.5622248980402041,y:.7715908032905435},{x:.558932621481472,y:.7727397697359177},{x:.5580108185587332,y:.7728691303257055},{x:.5571200644907257,y:.7731393376181454},{x:.553649849664861,y:.7734811239462956},{x:.5501966810432269,y:.7739657220295866},{x:.5492673533060543,y:.7739127621628822},{x:.548341,y:.774004},{x:.053711,y:.774004},{x:.04493193550927421,y:.7731393376181454},{x:.036490245543570936,y:.7705785789630079},{x:.028710339514117906,y:.7664201325536145},{x:.021891194846605358,y:.7608238051533946},{x:.01629486744638546,y:.7540046604858821},{x:.012136421036992098,y:.746224754456429},{x:.009575662381854637,y:.7377830644907257},{x:.008711000000000003,y:.729004},{x:.009575662381854637,y:.7202249355092742},{x:.012136421036992098,y:.711783245543571},{x:.01629486744638546,y:.7040033395141179},{x:.021891194846605365,y:.6971841948466053},{x:.028710339514117916,y:.6915878674463855},{x:.036490245543570964,y:.6874294210369921},{x:.04493193550927423,y:.6848686623818546},{x:.053711,y:.684004},{x:.4598070506412174,y:.684004},{x:.017357655565200567,y:.07755233678250915},{x:.016885383257544267,y:.07675020608369457},{x:.01629486744638546,y:.07603066048588211},{x:.014651104332708876,y:.07295539600004002},{x:.012881923661400112,y:.06995053184603389},{x:.012575213870039523,y:.06907167810709706},{x:.012136421036992098,y:.06825075445642906},{x:.011124196709456038,y:.06491389804020298},{x:.00997523026408225,y:.06162162148147208},{x:.009845869674294495,y:.0606998185587334},{x:.009575662381854637,y:.05980906449072579},{x:.009233876053704348,y:.056338849664860746},{x:.008749277970413458,y:.05288568104322705},{x:.008802237837117845,y:.05195635330605437},{x:.008711000000000003,y:.05103000000000002}]],"[":[[{x:.152511,y:-.06942399999999993},{x:.15337566238185463,y:-.0782030644907257},{x:.1559364210369921,y:-.08664475445642897},{x:.16009486744638546,y:-.09442466048588202},{x:.16569119484660536,y:-.10124380515339457},{x:.1725103395141179,y:-.10684013255361446},{x:.18029024554357093,y:-.11099857896300783},{x:.1887319355092742,y:-.1135593376181453},{x:.197511,y:-.11442399999999993},{x:.404542,y:-.11442399999999993},{x:.4133210644907258,y:-.1135593376181453},{x:.4217627544564291,y:-.11099857896300783},{x:.42954266048588213,y:-.10684013255361446},{x:.4363618051533946,y:-.10124380515339457},{x:.44195813255361455,y:-.09442466048588202},{x:.44611657896300794,y:-.08664475445642897},{x:.4486773376181454,y:-.0782030644907257},{x:.449542,y:-.06942399999999993},{x:.4486773376181454,y:-.06064493550927416},{x:.44611657896300794,y:-.05220324554357089},{x:.44195813255361455,y:-.04442333951411784},{x:.4363618051533946,y:-.03760419484660529},{x:.42954266048588213,y:-.032007867446385396},{x:.4217627544564291,y:-.027849421036992027},{x:.4133210644907258,y:-.025288662381854565},{x:.404542,y:-.024423999999999932},{x:.24251099999999998,y:-.024423999999999932},{x:.24251099999999998,y:.7147659999999999},{x:.404542,y:.7147659999999999},{x:.4133210644907258,y:.7156306623818546},{x:.4217627544564291,y:.7181914210369921},{x:.42954266048588213,y:.7223498674463854},{x:.4363618051533946,y:.7279461948466053},{x:.44195813255361455,y:.7347653395141178},{x:.44611657896300794,y:.7425452455435709},{x:.4486773376181454,y:.7509869355092742},{x:.449542,y:.7597659999999999},{x:.4486773376181454,y:.7685450644907257},{x:.44611657896300794,y:.776986754456429},{x:.44195813255361455,y:.7847666604858821},{x:.4363618051533946,y:.7915858051533946},{x:.42954266048588213,y:.7971821325536145},{x:.4217627544564291,y:.8013405789630078},{x:.4133210644907258,y:.8039013376181453},{x:.404542,y:.804766},{x:.197511,y:.804766},{x:.1887319355092742,y:.8039013376181453},{x:.18029024554357093,y:.8013405789630078},{x:.1725103395141179,y:.7971821325536145},{x:.16569119484660536,y:.7915858051533946},{x:.16009486744638546,y:.7847666604858821},{x:.1559364210369921,y:.776986754456429},{x:.15337566238185463,y:.7685450644907257},{x:.152511,y:.7597659999999999},{x:.152511,y:-.06942399999999993}]],"\\\\":[[{x:.017522651058219416,y:.7303997530123288},{x:.018114599516431164,y:.7215980934307649},{x:.020412292453046287,y:.7130810386853763},{x:.024327430817071727,y:.7051758944136092},{x:.5013774308170718,y:-.059077105586390885},{x:.5067595580368128,y:-.06606654912342862},{x:.5134018419815468,y:-.0718716915303336},{x:.521049023404313,y:-.07626944443996993},{x:.5294072254116235,y:-.07909080467430848},{x:.5381552469876711,y:-.08022734894178067},{x:.5469569065692351,y:-.07963540048356893},{x:.5554739613146237,y:-.0773377075469538},{x:.5633791055863908,y:-.07342256918292836},{x:.5703685491234285,y:-.06804044196318723},{x:.5761736915303335,y:-.06139815801845332},{x:.5805714444399699,y:-.05375097659568702},{x:.5833928046743084,y:-.04539277458837649},{x:.5845293489417805,y:-.03664475301232898},{x:.5839374004835688,y:-.02784309343076498},{x:.5816397075469537,y:-.01932603868537643},{x:.5777245691829282,y:-.011420894413609283},{x:.10067456918292828,y:.7528321055863908},{x:.09529244196318712,y:.7598215491234285},{x:.0886501580184532,y:.7656266915303336},{x:.08100297659568693,y:.7700244444399699},{x:.07264477458837638,y:.7728458046743084},{x:.06389675301232887,y:.7739823489417805},{x:.055095093430764894,y:.7733904004835688},{x:.04657803868537634,y:.7710927075469537},{x:.03867289441360919,y:.7671775691829282},{x:.03168345087657147,y:.7617954419631872},{x:.025878308469666468,y:.7551531580184532},{x:.021480555560030153,y:.747505976595687},{x:.01865919532569161,y:.7391477745883763},{x:.017522651058219416,y:.7303997530123288}]],"]":[[{x:.15250999999999998,y:-.06942399999999993},{x:.15337466238185463,y:-.0782030644907257},{x:.1559354210369921,y:-.08664475445642897},{x:.16009386744638546,y:-.09442466048588202},{x:.16569019484660535,y:-.10124380515339457},{x:.1725093395141179,y:-.10684013255361446},{x:.18028924554357095,y:-.11099857896300783},{x:.18873093550927422,y:-.1135593376181453},{x:.19751,y:-.11442399999999993},{x:.404542,y:-.11442399999999993},{x:.4133210644907258,y:-.1135593376181453},{x:.4217627544564291,y:-.11099857896300783},{x:.42954266048588213,y:-.10684013255361446},{x:.4363618051533946,y:-.10124380515339457},{x:.44195813255361455,y:-.09442466048588202},{x:.44611657896300794,y:-.08664475445642897},{x:.4486773376181454,y:-.0782030644907257},{x:.449542,y:-.06942399999999993},{x:.449542,y:.7597659999999999},{x:.4486773376181454,y:.7685450644907257},{x:.44611657896300794,y:.776986754456429},{x:.44195813255361455,y:.7847666604858821},{x:.4363618051533946,y:.7915858051533946},{x:.42954266048588213,y:.7971821325536145},{x:.4217627544564291,y:.8013405789630078},{x:.4133210644907258,y:.8039013376181453},{x:.404542,y:.804766},{x:.19751,y:.804766},{x:.18873093550927422,y:.8039013376181453},{x:.18028924554357095,y:.8013405789630078},{x:.1725093395141179,y:.7971821325536145},{x:.16569019484660535,y:.7915858051533946},{x:.16009386744638546,y:.7847666604858821},{x:.1559354210369921,y:.776986754456429},{x:.15337466238185463,y:.7685450644907257},{x:.15250999999999998,y:.7597659999999999},{x:.15337466238185463,y:.7509869355092742},{x:.1559354210369921,y:.7425452455435709},{x:.16009386744638546,y:.7347653395141178},{x:.16569019484660535,y:.7279461948466053},{x:.1725093395141179,y:.7223498674463854},{x:.18028924554357095,y:.7181914210369921},{x:.18873093550927422,y:.7156306623818546},{x:.19751,y:.7147659999999999},{x:.35954200000000003,y:.7147659999999999},{x:.35954200000000003,y:-.024423999999999932},{x:.19751,y:-.024423999999999932},{x:.18873093550927422,y:-.025288662381854565},{x:.18028924554357095,y:-.027849421036992027},{x:.1725093395141179,y:-.03200786744638539},{x:.16569019484660535,y:-.03760419484660529},{x:.16009386744638546,y:-.04442333951411784},{x:.1559354210369921,y:-.052203245543570885},{x:.15337466238185463,y:-.06064493550927414},{x:.15250999999999998,y:-.06942399999999993}]],"^":[[{x:-.009830024293871129,y:.4771904357900641},{x:-.009184411720694952,y:.46839254975009553},{x:-.006834821991481832,y:.4598896653882279},{x:-.002871548521860348,y:.4520085437820153},{x:.002553102311361327,y:.44505205201500053},{x:.009230664218841726,y:.43928752416454453},{x:.016904522241296224,y:.4349364878031557},{x:.02527977431847106,y:.43216615081811305},{x:.034034564209935884,y:.43108297570612886},{x:.04283245024990444,y:.431728588279305},{x:.05133533461177206,y:.4340781780085181},{x:.05921645621798466,y:.4380414514781396},{x:.06617294798499941,y:.4434661023113613},{x:.30102423332324457,y:.6668931783680099},{x:.5358792969655858,y:.44346586927801307},{x:.5428358294884947,y:.4380412707099504},{x:.5507169808710617,y:.43407805645230807},{x:.5592198828854552,y:.4317285306064111},{x:.5680177737757447,y:.431082984132888},{x:.5767725555289304,y:.4321662250206897},{x:.5851477867919753,y:.43493662492998636},{x:.5928216121243246,y:.439287718945922},{x:.5994991307219868,y:.44505229696558585},{x:.6049237292900496,y:.45200882948849475},{x:.6088869435476919,y:.4598899808710617},{x:.6112364693935889,y:.4683928828854553},{x:.6118820158671119,y:.47719077377574476},{x:.6107987749793102,y:.4859455555289303},{x:.6080283750700135,y:.4943207867919753},{x:.6036772810540779,y:.5019946121243246},{x:.5979127030344141,y:.5086721307219868},{x:.33204070303441413,y:.7616071307219868},{x:.3294429315385385,y:.7636328335402047},{x:.3269493357811583,y:.7657854758354554},{x:.3259710287822201,y:.7663401706594313},{x:.32508417051150523,y:.7670317292900496},{x:.3221411194513825,y:.7685117087189752},{x:.3192754777587038,y:.7701365121968442},{x:.31820775306259985,y:.7704896904878621},{x:.3172030191289383,y:.7709949435476919},{x:.31402778830632944,y:.7718723248078522},{x:.310900225681529,y:.7729068491818869},{x:.30978411534954325,y:.7730449384962876},{x:.3087001171145447,y:.7733444693935889},{x:.30541472886927135,y:.7735855352151975},{x:.30214543579006414,y:.7739900242938711},{x:.3010238313163334,y:.7739077179367437},{x:.2999022262242552,y:.773990015867112},{x:.29663293618411596,y:.7735855022258356},{x:.2933475497500956,y:.7733444117206949},{x:.29226355376554153,y:.7730448726791859},{x:.29114744447106966,y:.7729067749793103},{x:.2880198896188706,y:.7718722271075298},{x:.28484466538822795,y:.7709948219914818},{x:.28383993525062523,y:.7704895613829726},{x:.2827722132080247,y:.7701363750700135},{x:.27990658372278143,y:.7685115500622604},{x:.2769635437820154,y:.7670315485218604},{x:.2760766907070934,y:.7663399832281829},{x:.2750983878756754,y:.765785281054078},{x:.27260480829144085,y:.7636326200241867},{x:.2700070520150006,y:.7616068976886387},{x:.004139052015000585,y:.5086718976886386},{x:-.001625475835455463,y:.5019943357811583},{x:-.0059765121968442594,y:.49432047775870375},{x:-.00874684918188691,y:.4859452256815289},{x:-.009830024293871129,y:.4771904357900641}]],_:[[{x:-.045,y:-.160601},{x:-.044135337618145365,y:-.16938006449072576},{x:-.041574578963007904,y:-.17782175445642903},{x:-.03741613255361454,y:-.1856016604858821},{x:-.03181980515339464,y:-.19242080515339463},{x:-.025000660485882086,y:-.19801713255361453},{x:-.017220754456429038,y:-.2021755789630079},{x:-.008779064490725769,y:-.20473633761814536},{x:0,y:-.20560099999999998},{x:.602052,y:-.20560099999999998},{x:.6108310644907258,y:-.20473633761814536},{x:.619272754456429,y:-.2021755789630079},{x:.6270526604858822,y:-.19801713255361453},{x:.6338718051533947,y:-.19242080515339463},{x:.6394681325536146,y:-.1856016604858821},{x:.6436265789630079,y:-.17782175445642903},{x:.6461873376181454,y:-.16938006449072576},{x:.6470520000000001,y:-.160601},{x:.6461873376181454,y:-.15182193550927423},{x:.6436265789630079,y:-.14338024554357096},{x:.6394681325536146,y:-.1356003395141179},{x:.6338718051533947,y:-.12878119484660536},{x:.6270526604858822,y:-.12318486744638546},{x:.619272754456429,y:-.1190264210369921},{x:.6108310644907258,y:-.11646566238185463},{x:.602052,y:-.115601},{x:0,y:-.115601},{x:-.00877906449072579,y:-.11646566238185463},{x:-.017220754456429066,y:-.1190264210369921},{x:-.025000660485882096,y:-.12318486744638546},{x:-.03181980515339464,y:-.12878119484660536},{x:-.03741613255361454,y:-.1356003395141179},{x:-.041574578963007904,y:-.14338024554357096},{x:-.044135337618145365,y:-.15182193550927423},{x:-.045,y:-.160601}]],a:[[{x:.029951000000000005,y:.25490100000000004},{x:.030216131121475042,y:.2522090785486062},{x:.03027571711850824,y:.2495047884160563},{x:.03064747136410999,y:.24782960757010103},{x:.03081566238185464,y:.24612193550927428},{x:.0316008669059687,y:.24353346308961055},{x:.0321868888075612,y:.2408927597850148},{x:.06949088880756119,y:.12701175978501478},{x:.07014919013856018,y:.12551652306247207},{x:.07061771774296957,y:.1239514111231075},{x:.07192248021942128,y:.12148874987750752},{x:.07304546130734973,y:.1189380599695235},{x:.0739828197765546,y:.11759998201998349},{x:.07474768294666384,y:.11615634846888903},{x:.07650781615341086,y:.11399555310027064},{x:.07810683439013419,y:.11171295672570881},{x:.07928722783725009,y:.11058345913436952},{x:.08031903331037206,y:.10931678199931477},{x:.15605303331037207,y:.033026781999314685},{x:.1581401110567553,y:.03130114899494214},{x:.16009013354595797,y:.02942202284781055},{x:.16153164054777758,y:.028496972085311937},{x:.16285166496406625,y:.027405552418137233},{x:.16523529439528092,y:.026120245637685162},{x:.16751444707429886,y:.024657656887915},{x:.24324744707429888,y:-.014037343112084925},{x:.24491821916217926,y:-.014693433733650136},{x:.24650124554357095,y:-.015539578963007873},{x:.24901423193062222,y:-.016301885049470277},{x:.2514585861893129,y:-.017261751399011975},{x:.25322525179064753,y:-.017579283958613606},{x:.2549429355092742,y:-.018100337618145335},{x:.2575563541074305,y:-.01835773688343746},{x:.2601410014196699,y:-.018822289810772906},{x:.26193566856615697,y:-.018789061710219754},{x:.263722,y:-.018964999999999968},{x:.376759,y:-.018964999999999968},{x:.3786816094876915,y:-.018775639493449434},{x:.3806133727303473,y:-.01879962736385296},{x:.3830607170270406,y:-.018344335046447002},{x:.3855380644907258,y:-.018100337618145335},{x:.3873867891740171,y:-.01753953311656589},{x:.3892861139289994,y:-.017186191753697247},{x:.3915976100664607,y:-.016262194563578608},{x:.3939797544564291,y:-.015539578963007873},{x:.3956835488825182,y:-.014628881868892333},{x:.3974774451646465,y:-.013911789983170525},{x:.4720844451646465,y:.0247832100168294},{x:.4742399118062311,y:.026185049737888398},{x:.4765030886255536,y:.02740538646642049},{x:.47792879308654873,y:.028584168427667152},{x:.47947957817165415,y:.02959274452399146},{x:.48132014276352414,y:.0313881589690925},{x:.48210100000000006,y:.032033776942416534},{x:.48210100000000006,y:.02603500000000003},{x:.4829656623818547,y:.01725593550927424},{x:.4855264210369921,y:.008814245543570985},{x:.4896848674463855,y:.0010343395141179344},{x:.4952811948466054,y:-.0057848051533946065},{x:.5021003395141179,y:-.01138113255361451},{x:.509880245543571,y:-.015539578963007873},{x:.5183219355092743,y:-.018100337618145335},{x:.527101,y:-.018964999999999968},{x:.5358800644907258,y:-.018100337618145335},{x:.544321754456429,y:-.015539578963007873},{x:.5521016604858822,y:-.011381132553614504},{x:.5589208051533947,y:-.0057848051533946065},{x:.5645171325536146,y:.0010343395141179344},{x:.5686755789630079,y:.008814245543570992},{x:.5712363376181454,y:.01725593550927426},{x:.5721010000000001,y:.02603500000000003},{x:.5721010000000001,y:.560059},{x:.5712363376181454,y:.5688380644907257},{x:.5686755789630079,y:.577279754456429},{x:.5645171325536146,y:.5850596604858821},{x:.5589208051533947,y:.5918788051533946},{x:.5521016604858822,y:.5974751325536145},{x:.544321754456429,y:.6016335789630078},{x:.5358800644907258,y:.6041943376181453},{x:.527101,y:.605059},{x:.5183219355092743,y:.6041943376181453},{x:.509880245543571,y:.6016335789630078},{x:.5021003395141179,y:.5974751325536145},{x:.4952811948466054,y:.5918788051533946},{x:.4896848674463855,y:.5850596604858821},{x:.4855264210369921,y:.577279754456429},{x:.4829656623818547,y:.5688380644907257},{x:.48210100000000006,y:.560059},{x:.48210100000000006,y:.5551612473179106},{x:.48111784979070266,y:.5559741116228759},{x:.47906658786156825,y:.5579287481398052},{x:.4777260461549398,y:.558778440075324},{x:.476502844006682,y:.5597897782764175},{x:.474008872962507,y:.5611345413953497},{x:.47161569478864906,y:.5626514387693977},{x:.3970086947886491,y:.6002454387693977},{x:.39545173243232984,y:.6008467903430146},{x:.3939797544564291,y:.6016335789630078},{x:.39134652561635536,y:.6024323601988234},{x:.3887796173011618,y:.6034237870938969},{x:.38713525366780027,y:.6037098355781862},{x:.3855380644907258,y:.6041943376181453},{x:.3827995979159321,y:.6044640530341434},{x:.3800885942320307,y:.6049356509696303},{x:.37842002129388747,y:.6048954036817589},{x:.376759,y:.605059},{x:.263722,y:.605059},{x:.26219504701733515,y:.604908608257877},{x:.26066140118579323,y:.6049547986330399},{x:.25781511370268967,y:.6044772224791067},{x:.2549429355092742,y:.6041943376181453},{x:.2534746624734083,y:.6037489418620853},{x:.2519614739213154,y:.6034950452430072},{x:.24926304753974865,y:.6024713624393285},{x:.24650124554357095,y:.6016335789630078},{x:.24514807736385555,y:.6009102955021357},{x:.24371349707866236,y:.6003660689935006},{x:.16798049707866233,y:.5627720689935006},{x:.1654642487594581,y:.5611982224645521},{x:.16285190958182658,y:.5597896123262998},{x:.16173267757498783,y:.5588642237445607},{x:.16050143578237863,y:.5580941146870384},{x:.15834057869520102,y:.5560596134829665},{x:.15605324108782545,y:.5541684273021619},{x:.08031924108782545,y:.47787942730216193},{x:.07924694249287094,y:.47656305714472025},{x:.07802357952480113,y:.4753857561141845},{x:.07646760484406812,y:.47315109973327435},{x:.07474784589903924,y:.4710398973462887},{x:.07395296229881854,y:.46953962579412084},{x:.07298278594430238,y:.4681462799973844},{x:.07189266871370663,y:.46565100631071576},{x:.07061782960809859,y:.46324486175923196},{x:.0701309079335922,y:.4616183434067253},{x:.06945120152585271,y:.46006249834135976},{x:.032147201525852716,y:.3450764983413597},{x:.031582343425880205,y:.34249647318004567},{x:.03081566238185464,y:.3399690644907258},{x:.030641204072877935,y:.33819775955415116},{x:.03026054307811779,y:.33645906634171463},{x:.03020987650767869,y:.3338184172918108},{x:.029951000000000005,y:.33119},{x:.029951000000000005,y:.25490100000000004}],[{x:.119951,y:.2620835578942187},{x:.119951,y:.3240730820964405},{x:.15174843963453788,y:.42208563822492473},{x:.21467365091165175,y:.4854719831046318},{x:.2742766075147511,y:.5150589999999999},{x:.3660620360389177,y:.5150589999999999},{x:.4245839309326211,y:.4855701837142105},{x:.48210100000000006,y:.4276323784447675},{x:.48210100000000006,y:.15956344905445352},{x:.4243936225653894,y:.10143318135145685},{x:.36578354074375496,y:.07103500000000003},{x:.2745522516182332,y:.07103500000000003},{x:.21486246778999646,y:.10153288315838035},{x:.15170083487400915,y:.1651582162341545},{x:.119951,y:.2620835578942187}]],b:[[{x:.03166000000000001,y:.04001500000000002},{x:.03252466238185464,y:.031235935509274233},{x:.0350854210369921,y:.022794245543570978},{x:.039243867446385465,y:.015014339514117927},{x:.04484019484660537,y:.008195194846605386},{x:.05165933951411792,y:.002598867446385482},{x:.05943924554357097,y:-.0015595789630078807},{x:.06788093550927424,y:-.004120337618145342},{x:.07666,y:-.0049849999999999756},{x:.08543906449072577,y:-.004120337618145342},{x:.09388075445642904,y:-.0015595789630078807},{x:.10166066048588211,y:.002598867446385489},{x:.10847980515339464,y:.008195194846605386},{x:.11407613255361454,y:.015014339514117927},{x:.1182345789630079,y:.022794245543570985},{x:.12079533761814537,y:.031235935509274254},{x:.12166,y:.04001500000000002},{x:.12166,y:.041388769861289504},{x:.12338630711141785,y:.04010106584896898},{x:.12512540667363178,y:.03853443023544684},{x:.12691331624345048,y:.03747016444054036},{x:.12858112311649333,y:.036226097502515},{x:.13069431360107225,y:.035219499067818724},{x:.13270563229917137,y:.034022247411931134},{x:.20674863229917137,y:-.0007227525880688923},{x:.20772794171481185,y:-.0010698043626217635},{x:.20864424554357097,y:-.0015595789630078669},{x:.21187816153300185,y:-.0025405766534664824},{x:.21506348921487128,y:-.003669406425619949},{x:.21609168791714548,y:-.0038187359083884913},{x:.21708593550927424,y:-.004120337618145342},{x:.22044909586509742,y:-.004451580001305548},{x:.22379344213248661,y:-.004937293022731791},{x:.22483101702188665,y:-.00488316156543817},{x:.225865,y:-.0049849999999999756},{x:.338045,y:-.0049849999999999756},{x:.33894984805462636,y:-.004895880245274822},{x:.33985755144997865,y:-.004948481373678995},{x:.343332465401001,y:-.004464230112452937},{x:.3468240644907258,y:-.004120337618145342},{x:.3476941397420575,y:-.003856403176165039},{x:.34859466384226984,y:-.0037309094409420443},{x:.351908335561611,y:-.0025780408502315546},{x:.35526575445642905,y:-.0015595789630078807},{x:.35606762040050133,y:-.0011309726863615623},{x:.35692635856942223,y:-.0008322067413783357},{x:.43209235856942224,y:.03391279325862169},{x:.4342218624454842,y:.03516383683568551},{x:.43645162164562873,y:.03622594356254809},{x:.4380158580934015,y:.037392738102356306},{x:.4396984532755396,y:.03838123120587913},{x:.4415429728374372,y:.04002368192832182},{x:.4435226810964235,y:.04150038501262054},{x:.5186856810964235,y:.11000138501262047},{x:.5200684051728882,y:.11153543836568303},{x:.5216038163727121,y:.1129166544997947},{x:.5230144082918019,y:.11480386048953693},{x:.5245918796416693,y:.11655397481445093},{x:.5256487561000858,y:.11832830784782436},{x:.5268852029038621,y:.11998252816661786},{x:.5279005150705119,y:.12210866485417524},{x:.5291062453835067,y:.12413290061668979},{x:.5297966590542814,y:.12607932670695898},{x:.530686625504748,y:.12794298045128052},{x:.567704625504748,y:.2301969804512806},{x:.5685418230641662,y:.23348712941632632},{x:.5695273376181453,y:.23673593550927427},{x:.5696276430094915,y:.2377543532384077},{x:.5698799976366801,y:.23874609563675617},{x:.5700592324586751,y:.24213635445346285},{x:.570392,y:.24551500000000004},{x:.570392,y:.314017},{x:.570065993218988,y:.3173270023951309},{x:.5699006262411136,y:.32064890697528625},{x:.569634437926433,y:.3217086568121163},{x:.5695273376181453,y:.3227960644907258},{x:.5685618455328773,y:.32597886535008125},{x:.5677515846008636,y:.32920467896823863},{x:.5307335846008636,y:.4324506789682387},{x:.5298196963817511,y:.43437967657309706},{x:.5291061063615623,y:.4363913954201699},{x:.5279358002551,y:.43835612690926706},{x:.5269566878799311,y:.4404227969757902},{x:.5256840310027916,y:.4421364386856148},{x:.5245916855370664,y:.44397028841230757},{x:.523060566435399,y:.4456689527415915},{x:.5216970801011935,y:.44750489697372575},{x:.5201145620561008,y:.4489373284986299},{x:.5186854393684929,y:.45052283528838016},{x:.44352243936849295,y:.5190228352883801},{x:.44134657552661755,y:.5206458300432604},{x:.43929971954126384,y:.5224287703137037},{x:.4378191137317927,y:.523276992839783},{x:.43645134158383936,y:.5242972253466508},{x:.43400065578620683,y:.5254645447348341},{x:.43164529517316985,y:.52681390451462},{x:.35647929517316984,y:.56056790451462},{x:.3558506134628383,y:.560778965311121},{x:.35526575445642905,y:.5610915789630079},{x:.351674330744245,y:.5621810254355277},{x:.34811645117964274,y:.5633754754766519},{x:.34745867349333664,y:.563459831081816},{x:.3468240644907258,y:.5636523376181454},{x:.3430891085149791,y:.5640201986736739},{x:.3393665669654169,y:.5644975898222324},{x:.3387049713307353,y:.5644519984974604},{x:.338045,y:.564517},{x:.225865,y:.564517},{x:.22507819619617456,y:.5644395065891945},{x:.22428916125732748,y:.5644893996719887},{x:.22069487882474298,y:.5640077875099223},{x:.21708593550927424,y:.5636523376181454},{x:.21632936813438544,y:.5634228354140474},{x:.21554576062305134,y:.5633178367349442},{x:.2121144991913443,y:.5621442688983362},{x:.20864424554357097,y:.5610915789630079},{x:.20794698905754733,y:.5607188876066144},{x:.20719892257093525,y:.5604630322059678},{x:.13315592257093525,y:.5267090322059678},{x:.13091775246116674,y:.5254099486077729},{x:.12858140317750869,y:.5242970714087468},{x:.1271119341080524,y:.5232009671819817},{x:.12552641140636125,y:.5222806946221156},{x:.12358468574515913,y:.5205699272235509},{x:.12166,y:.5191342684374534},{x:.12166,y:.7597659999999999},{x:.12079533761814537,y:.7685450644907257},{x:.1182345789630079,y:.776986754456429},{x:.11407613255361454,y:.7847666604858821},{x:.10847980515339464,y:.7915858051533946},{x:.10166066048588208,y:.7971821325536145},{x:.09388075445642904,y:.8013405789630078},{x:.08543906449072577,y:.8039013376181453},{x:.07666,y:.804766},{x:.06788093550927421,y:.8039013376181453},{x:.05943924554357094,y:.8013405789630078},{x:.05165933951411792,y:.7971821325536145},{x:.04484019484660537,y:.7915858051533946},{x:.039243867446385465,y:.7847666604858821},{x:.0350854210369921,y:.776986754456429},{x:.03252466238185464,y:.7685450644907257},{x:.03166000000000001,y:.7597659999999999},{x:.03166000000000001,y:.04001500000000002}],[{x:.12166,y:.16313400296117606},{x:.12166,y:.39738980161800674},{x:.17691400696537596,y:.447746357818324},{x:.23563826658076475,y:.474517},{x:.3284048540018634,y:.474517},{x:.3882155063572531,y:.44765846343288423},{x:.44979135555302596,y:.39154114946310603},{x:.480392,y:.30619363915535625},{x:.480392,y:.2534097446111891},{x:.44984564070758065,y:.16903221413717517},{x:.38802932067077023,y:.11269492399652684},{x:.3281476350434013,y:.08501500000000002},{x:.2358983461114888,y:.08501500000000002},{x:.1771018588393058,y:.11260550754658781},{x:.12166,y:.16313400296117606}]],c:[[{x:.0446,y:.25490100000000004},{x:.044822712444716174,y:.2526397626013558},{x:.04482893549381362,y:.2503675925637664},{x:.045254001037800355,y:.24826081602954003},{x:.045464662381854634,y:.24612193550927428},{x:.04612424100165128,y:.2439475961957434},{x:.04657362286091401,y:.24172029932495478},{x:.08145962286091402,y:.1278402993249547},{x:.08196610920465827,y:.1266269431042867},{x:.08230081253195312,y:.125355433994083},{x:.08366176737769918,y:.12256476567779218},{x:.08485778977199918,y:.11969953302126297},{x:.0855912581784792,y:.11860830168404396},{x:.08616758939694805,y:.11742652164475936},{x:.08804682625741464,y:.11495498435675963},{x:.08977884657839008,y:.1123781387363477},{x:.09071111026807865,y:.11145096769089737},{x:.09150692129220603,y:.11040433186669174},{x:.16233292129220603,y:.03411333186669174},{x:.16445877247754231,y:.03223237849112975},{x:.1664474797904295,y:.03020697184383589},{x:.16775479669311927,y:.029316055882572942},{x:.16893962068732413,y:.02826772347496185},{x:.17139158003796548,y:.02683764508339147},{x:.17373721213250964,y:.02523913360696181},{x:.24456521213250962,y:-.013455866393038113},{x:.2467886390083486,y:-.014400746043602006},{x:.24891924554357092,y:-.015539578963007873},{x:.25083834630720225,y:-.016121731815163746},{x:.25268405147305695,y:-.01690609278116076},{x:.2550490927002279,y:-.01739904776899966},{x:.2573609355092742,y:-.018100337618145335},{x:.259356733677244,y:-.018296906580526337},{x:.26131999536931183,y:-.018706117055345653},{x:.26373576373978486,y:-.0187282033967292},{x:.26614,y:-.018964999999999968},{x:.371854,y:-.018964999999999968},{x:.3744001776009888,y:-.018714223394882004},{x:.3769583677219744,y:-.018674567546095353},{x:.3787793796063011,y:-.01828290964379429},{x:.3806330644907258,y:-.018100337618145335},{x:.3830813939144215,y:-.01735764500708899},{x:.3855826926572475,y:-.01681967299983559},{x:.38729230564255435,y:-.01608027889939661},{x:.3890747544564291,y:-.015539578963007873},{x:.391331147776118,y:-.014333511606549179},{x:.393679431632842,y:-.013317897403369645},{x:.463449431632842,y:.02537710259663028},{x:.46566730315778443,y:.026909287408228903},{x:.46799586592077425,y:.028267352155161442},{x:.4692879686356918,y:.029410572352257962},{x:.47070743151062955,y:.03039118797094862},{x:.4725837728278355,y:.03232661755101331},{x:.4746026476214732,y:.03411286752390576},{x:.5454306476214732,y:.11040386752390575},{x:.5507700783887176,y:.11742598212342069},{x:.5546369668925095,y:.12535484002769406},{x:.5568827107762242,y:.13388573967401945},{x:.5574210073618384,y:.14269084337317217},{x:.5562311702134469,y:.15143177592795284},{x:.5533589241053942,y:.15977262820225266},{x:.5489146478448386,y:.16739286592077418},{x:.5430691324760942,y:.17399964762147313},{x:.5360470178765793,y:.17933907838871752},{x:.5281181599723059,y:.18320596689250943},{x:.5195872603259806,y:.1854517107762242},{x:.5107821566268278,y:.1859900073618383},{x:.5020412240720471,y:.18480017021344686},{x:.4937003717977473,y:.18192792410539416},{x:.4860801340792258,y:.17748364784483847},{x:.47947335237852684,y:.17163813247609414},{x:.41352572033101553,y:.10060392571412592},{x:.36021071976053953,y:.07103500000000003},{x:.27763077403847125,y:.07103500000000003},{x:.2233107097601157,y:.10071132697875086},{x:.16448866962379677,y:.16407213041308155},{x:.1346,y:.2616391113440561},{x:.1346,y:.3245158400933278},{x:.1645319520417492,y:.4231721923699009},{x:.2231207776861973,y:.4862793045993598},{x:.27734241586879393,y:.5150589999999999},{x:.3605019191882548,y:.5150589999999999},{x:.41371701660545657,y:.4863852380349392},{x:.47947395272027693,y:.4155592208902026},{x:.48608084903755494,y:.4097138350672089},{x:.4937011738972078,y:.40526970822380387},{x:.5020420824884065,y:.4023976256622846},{x:.5107830383716269,y:.4012079599048077},{x:.5195881315142611,y:.40174642913926084},{x:.5281189871247909,y:.40399234029494097},{x:.5360477692062626,y:.4078593842656568},{x:.5430697791097975,y:.41319895272027696},{x:.5489151649327911,y:.41980584903755497},{x:.5533592917761961,y:.42742617389720783},{x:.5562313743377155,y:.4357670824884066},{x:.5574210400951923,y:.4445080383716269},{x:.5568825708607392,y:.4533131315142611},{x:.5546366597050592,y:.4618439871247909},{x:.5507696157343432,y:.46977276920626265},{x:.5454300472797231,y:.4767947791097975},{x:.4746020472797231,y:.5530827791097974},{x:.47237947035514305,y:.5550491819442839},{x:.4702881116089302,y:.5571546051529963},{x:.469083054274185,y:.5579656532949738},{x:.4679951509624451,y:.5589281649327911},{x:.46543165406806053,y:.5604231806402761},{x:.46296973250196366,y:.5620801448811513},{x:.39319973250196366,y:.5996741448811513},{x:.39109075852725916,y:.6005560023370271},{x:.3890747544564291,y:.6016335789630078},{x:.38703122642603144,y:.6022534764138876},{x:.38506104886577136,y:.6030772968079529},{x:.3828205563795885,y:.6035307692082409},{x:.3806330644907258,y:.6041943376181453},{x:.3785078662851109,y:.6044036513718285},{x:.37641482574826585,y:.6048272797133635},{x:.3741289156203665,y:.604834940368031},{x:.371854,y:.605059},{x:.26614,y:.605059},{x:.26400488750824663,y:.6048487097743618},{x:.26185945318827825,y:.6048549475733314},{x:.2596259398913868,y:.6044174210783497},{x:.2573609355092742,y:.6041943376181453},{x:.2553078741931944,y:.60357154827667},{x:.25320244685788745,y:.6031591127457343},{x:.2510972070775077,y:.6022942563713519},{x:.24891924554357092,y:.6016335789630078},{x:.24702713339817148,y:.6006222239508241},{x:.24504262343928468,y:.5998069647561404},{x:.1742146234392847,y:.5622129647561404},{x:.17162525666515238,y:.5604936738034747},{x:.16894033563687538,y:.5589277936219744},{x:.16795812189104978,y:.5580587651214349},{x:.16686556037036515,y:.5573333247718834},{x:.16466136457832586,y:.5551419091149951},{x:.16233352162359432,y:.5530823147741101},{x:.09150752162359431,y:.47679431477411016},{x:.09067474586023959,y:.4756991081857825},{x:.08970182133886938,y:.4747262717047309},{x:.08801053269383365,y:.4721953272870651},{x:.08616805203977476,y:.4697722296898647},{x:.08556494203519081,y:.46853560069719197},{x:.08480050296804506,y:.467391648838166},{x:.08363547472152838,y:.4645793817614187},{x:.08230111970711389,y:.461843393160995},{x:.08195085264054901,y:.4605128647226562},{x:.08142427599227564,y:.4592417589140625},{x:.046538275992275634,y:.3442567589140625},{x:.04610669192420131,y:.34208755224892967},{x:.045464662381854634,y:.33997106449072584},{x:.04524807462900009,y:.3377720121321243},{x:.04481688692083,y:.3356047976316928},{x:.044816786846426454,y:.33339307378956023},{x:.0446,y:.33119200000000004},{x:.0446,y:.25490100000000004}]],d:[[{x:.03166100000000001,y:.24551500000000004},{x:.03199378652782141,y:.24213616168032864},{x:.032173060891358886,y:.2387457109778176},{x:.032425376075824915,y:.237754159461938},{x:.03252566238185464,y:.23673593550927427},{x:.03351123316568353,y:.23348694405135337},{x:.034348506941927405,y:.23019661460170962},{x:.0713675069419274,y:.12794261460170955},{x:.07225746993456125,y:.1260790095358921},{x:.0729478813145148,y:.12413263082247869},{x:.07415364826248581,y:.12210836405190925},{x:.07516899837159816,y:.11998219518580837},{x:.07640543228727825,y:.1183280219355851},{x:.07746229725612473,y:.11655373492181778},{x:.07903981058640837,y:.11480359733178996},{x:.08045044599662987,y:.11291636718401242},{x:.08198583537337678,y:.11153519469971836},{x:.08336853920306012,y:.1100011842405046},{x:.15853253920306012,y:.04150018424050468},{x:.16051177365736521,y:.04002385498013544},{x:.16235580937568672,y:.038381768082408986},{x:.16403890527939927,y:.03739293492543645},{x:.16560363358955885,y:.03622578962650935},{x:.16783285515961555,y:.03516395710594637},{x:.16996181351033893,y:.03391317596960988},{x:.24512381351033893,y:-.0008318240303901436},{x:.24598297689097734,y:-.0011307574341723537},{x:.24678524554357095,y:-.0015595789630078807},{x:.25014222995258023,y:-.0025779090504023904},{x:.2534554494825366,y:-.0037306956028641883},{x:.25435642329373365,y:-.003856270624521421},{x:.2552269355092742,y:-.004120337618145342},{x:.2587180827488419,y:-.0044641856090968535},{x:.2621925371943035,y:-.004948444626188875},{x:.2631006975177666,y:-.004895835488062085},{x:.264006,y:-.0049849999999999756},{x:.376189,y:-.0049849999999999756},{x:.37722298297811335,y:-.004883161565438171},{x:.3782605578675134,y:-.004937293022731791},{x:.3816049041349026,y:-.004451580001305548},{x:.3849680644907258,y:-.004120337618145342},{x:.3859623120828546,y:-.003818735908388489},{x:.38699051078512875,y:-.003669406425619949},{x:.39017583846699794,y:-.0025405766534665605},{x:.39340975445642906,y:-.0015595789630078807},{x:.39432605828518835,y:-.0010698043626217065},{x:.39530536770082864,y:-.0007227525880688923},{x:.46934836770082866,y:.034022247411931134},{x:.4713599418403825,y:.035219651121148166},{x:.4734733873673339,y:.03622640539423388},{x:.4751409393435705,y:.037470316580519136},{x:.4769285933263682,y:.03853443023544684},{x:.47866791375766776,y:.04010126481479184},{x:.480392,y:.041387347763641016},{x:.480392,y:.04001500000000002},{x:.4812566623818546,y:.031235935509274233},{x:.48381742103699205,y:.022794245543570978},{x:.48797586744638544,y:.015014339514117927},{x:.4935721948466053,y:.008195194846605386},{x:.5003913395141178,y:.002598867446385482},{x:.508171245543571,y:-.0015595789630078807},{x:.5166129355092742,y:-.004120337618145342},{x:.525392,y:-.0049849999999999756},{x:.5341710644907257,y:-.004120337618145342},{x:.542612754456429,y:-.0015595789630078807},{x:.5503926604858821,y:.002598867446385489},{x:.5572118051533946,y:.008195194846605386},{x:.5628081325536145,y:.015014339514117927},{x:.5669665789630078,y:.022794245543570985},{x:.5695273376181453,y:.031235935509274254},{x:.570392,y:.04001500000000002},{x:.570392,y:.7597659999999999},{x:.5695273376181453,y:.7685450644907257},{x:.5669665789630078,y:.776986754456429},{x:.5628081325536145,y:.7847666604858821},{x:.5572118051533946,y:.7915858051533946},{x:.5503926604858821,y:.7971821325536145},{x:.542612754456429,y:.8013405789630078},{x:.5341710644907257,y:.8039013376181453},{x:.525392,y:.804766},{x:.5166129355092742,y:.8039013376181453},{x:.508171245543571,y:.8013405789630078},{x:.5003913395141178,y:.7971821325536145},{x:.4935721948466053,y:.7915858051533946},{x:.48797586744638544,y:.7847666604858821},{x:.48381742103699205,y:.776986754456429},{x:.4812566623818546,y:.7685450644907257},{x:.480392,y:.7597659999999999},{x:.480392,y:.5191356905079497},{x:.47846953719699326,y:.5205697307992189},{x:.47652758859363875,y:.5222806946221157},{x:.47494232329576636,y:.5232008177790934},{x:.47347310730786674,y:.524296763521154},{x:.4711365045177018,y:.5254097994515352},{x:.46889807742906475,y:.5267090322059679},{x:.3948550774290648,y:.5604630322059679},{x:.3941070109424522,y:.5607188876066146},{x:.39340975445642906,y:.5610915789630079},{x:.389939500808656,y:.5621442688983361},{x:.38650823937694867,y:.5633178367349442},{x:.38572463186561456,y:.5634228354140474},{x:.3849680644907258,y:.5636523376181454},{x:.38135912117525683,y:.5640077875099224},{x:.3777648387426725,y:.5644893996719887},{x:.3769758038038255,y:.5644395065891945},{x:.376189,y:.564517},{x:.264006,y:.564517},{x:.26334558239453953,y:.5644519545432365},{x:.2626835384795895,y:.5644975635305632},{x:.2589614482177297,y:.5640201550156564},{x:.2552269355092742,y:.5636523376181454},{x:.25459189738202526,y:.5634597009082802},{x:.2539336765832372,y:.5633752751711479},{x:.2503762430229788,y:.5621808961392286},{x:.24678524554357095,y:.5610915789630079},{x:.24619999105363047,y:.5607787539207695},{x:.24557088842716707,y:.5605675378929096},{x:.17040888842716706,y:.5268135378929095},{x:.16805407047382528,y:.5254644267942322},{x:.16560391365212207,y:.5242973792806265},{x:.16423565717286473,y:.5232767996121171},{x:.1627545512703112,y:.5224282514648534},{x:.16070817900232118,y:.5206456609648356},{x:.15853278093215223,y:.5190230360586235},{x:.08336878093215222,y:.45052303605862365},{x:.08193967718325436,y:.44893757139643337},{x:.08035717944512263,y:.44750518296134467},{x:.07899365114577664,y:.44566921514174185},{x:.07746249136223225,y:.4439705283033309},{x:.07637015625263606,y:.44213672358948825},{x:.0750975108858587,y:.44042312810321155},{x:.07411836195358443,y:.43835642671545355},{x:.07294802033824888,y:.4363916652130956},{x:.07223443169362759,y:.4343799925343442},{x:.07132054574594202,y:.4324510425104215},{x:.034301545745942026,y:.32920504251042143},{x:.033491210284420626,y:.32597904935505284},{x:.03252566238185464,y:.3227960644907258},{x:.03241858101312289,y:.3217088491086539},{x:.03215243067755317,y:.32064928896150824},{x:.031987025628206905,y:.31732719375391183},{x:.03166100000000001,y:.314017},{x:.03166100000000001,y:.24551500000000004}],[{x:.121661,y:.25340994514221},{x:.121661,y:.3061934402169761},{x:.15226243948714763,y:.39154086238640384},{x:.21383969339611897,y:.4476587099299689},{x:.27364661400534074,y:.474517},{x:.3664157334192352,y:.474517},{x:.42513971513426946,y:.4477464845048247},{x:.480392,y:.3973901578243758},{x:.480392,y:.1631336467554691},{x:.4249518651426514,y:.1126053780239199},{x:.3661556538885112,y:.08501500000000002},{x:.2739038430667855,y:.08501500000000002},{x:.21402588591940364,y:.11269467351967463},{x:.15220815290195538,y:.1690325018607451},{x:.121661,y:.25340994514221}]],e:[[{x:.014571,y:.25490100000000004},{x:.014880046743786594,y:.2517631957525991},{x:.01501248842711947,y:.2486129918567585},{x:.015311525398480692,y:.24738231945287367},{x:.015435662381854634,y:.24612193550927428},{x:.016350926120166094,y:.24310471531940006},{x:.01709539726614681,y:.24004087979874045},{x:.05693639726614681,y:.12616087979874036},{x:.057746546207777846,y:.12441615547982068},{x:.05835851556287996,y:.12259245107255745},{x:.05959975008908581,y:.12042512406141898},{x:.06065161969764369,y:.11815983382640528},{x:.06178658068373706,y:.11660668611395116},{x:.06274257829935428,y:.11493741297405176},{x:.06438278737670251,y:.11305388338712186},{x:.06585638180708843,y:.11103732964943176},{x:.06727253892344205,y:.10973544513901749},{x:.06853582634733585,y:.1082847524971091},{x:.14942282634733584,y:.031993752497109104},{x:.15144602889400902,y:.03043003785468449},{x:.15333307828862142,y:.02870446646813117},{x:.1549277151407192,y:.027739074573098352},{x:.15640262843323158,y:.02659912765300345},{x:.15869202130341495,y:.025460166585296706},{x:.1608794538505091,y:.024135896643135493},{x:.2417664538505091,y:-.01455910335686443},{x:.24290092295632487,y:-.014970686687880902},{x:.2439652455435709,y:-.015539578963007873},{x:.24703931387581265,y:-.016472087396775758},{x:.2500591116803148,y:-.017567664555291233},{x:.2512520782049556,y:-.01775001548484057},{x:.2524069355092742,y:-.018100337618145335},{x:.25560385985111694,y:-.01841520718300011},{x:.2587793695882151,y:-.01890059980751419},{x:.2599849884971624,y:-.018846710691637396},{x:.261186,y:-.018964999999999968},{x:.381914,y:-.018964999999999968},{x:.3832466926412995,y:-.01883374123151461},{x:.3845848263549422,y:-.018885671038862982},{x:.3876272824249201,y:-.01840229079619376},{x:.39069306449072577,y:-.018100337618145335},{x:.3919745425012029,y:-.017711605513551366},{x:.39329709535359264,y:-.017501480567117658},{x:.39618678867610163,y:-.016433834605858122},{x:.39913475445642904,y:-.015539578963007873},{x:.4003157713548023,y:-.014908312279081314},{x:.40157191838151796,y:-.014444207562717595},{x:.48125191838151804,y:.02425079243728233},{x:.4833189661071789,y:.02551885102394819},{x:.4854901362659954,y:.026598980192539007},{x:.48706966813422276,y:.027819770278194},{x:.48877129863032925,y:.028863658687316496},{x:.4905512426555404,y:.030510612890229178},{x:.492469971641239,y:.03199356196515255},{x:.573357971641239,y:.10828456196515254},{x:.5791512607417543,y:.11493718669263933},{x:.5835353707163221,y:.12259219773755695},{x:.5863418226772573,y:.13095541731842886},{x:.5874627662495775,y:.13970545159690978},{x:.5868551242004307,y:.1485060416627534},{x:.584542247872996,y:.15701898577515713},{x:.5806130198074609,y:.16491713626599536},{x:.5752184380348474,y:.17189697164123896},{x:.5685658133073607,y:.17769026074175415},{x:.560910802262443,y:.1820743707163221},{x:.5525475826815711,y:.18488082267725728},{x:.5437975484030901,y:.18600176624957743},{x:.5349969583372466,y:.1853941242004306},{x:.5264840142248428,y:.183081247872996},{x:.5185858637340046,y:.17915201980746093},{x:.511606028358761,y:.17375743803484736},{x:.43573388395098006,y:.1021972341849065},{x:.3715652104827451,y:.07103500000000003},{x:.2713955768569904,y:.07103500000000003},{x:.2060606884620834,y:.10229012760321096},{x:.13826613078700495,y:.16623259795801962},{x:.104571,y:.2625454790108076},{x:.104571,y:.28619200000000006},{x:.542482,y:.28619200000000006},{x:.5512610644907258,y:.2870566623818547},{x:.559702754456429,y:.2896174210369921},{x:.5674826604858821,y:.2937758674463855},{x:.5743018051533947,y:.2993721948466054},{x:.5798981325536146,y:.3061913395141179},{x:.5840565789630079,y:.31397124554357103},{x:.5866173376181454,y:.32241293550927425},{x:.5874820000000001,y:.33119200000000004},{x:.5866173376181454,y:.33997106449072584},{x:.5840565789630079,y:.34841275445642905},{x:.5798981325536146,y:.35619266048588216},{x:.5743018051533947,y:.3630118051533947},{x:.5674826604858821,y:.3686081325536146},{x:.5660433240263831,y:.3693774739195968},{x:.5706944449992851,y:.3724210772554575},{x:.5769918122169339,y:.3785986803904119},{x:.5819629867044116,y:.38588613801169297},{x:.5854169290140312,y:.3940033972097681},{x:.5872209060798271,y:.40263851626586683},{x:.5873055920748429,y:.4114596523972937},{x:.5856677325637826,y:.4201278142894682},{x:.5823702695691338,y:.4283098893420352},{x:.5425292695691338,y:.5045998893420351},{x:.54083893518448,y:.5071829952333479},{x:.5393041274419548,y:.5098614335042745},{x:.5384286685906833,y:.5108662746451583},{x:.5376989227445426,y:.5119814449992851},{x:.5355371287009763,y:.5141851493557908},{x:.5335092744740836,y:.5165126960496618},{x:.49246227447408364,y:.5552086960496617},{x:.4903478252727746,y:.5568421196453192},{x:.48836639942178184,y:.5586345815458318},{x:.486865329057947,y:.5595323670561179},{x:.4854811710293013,y:.5606016367187369},{x:.48308868524123094,y:.5617911659624512},{x:.4807956399629947,y:.5631626292028359},{x:.40111563996299465,y:.6007566292028359},{x:.40009264564938235,y:.6011215754533451},{x:.39913475445642904,y:.6016335789630078},{x:.3959457374462889,y:.6026009566970012},{x:.3928069722488333,y:.6037206897930685},{x:.3917324370025758,y:.603879047413643},{x:.39069306449072577,y:.6041943376181453},{x:.38737659751458814,y:.6045209811048129},{x:.38407969371999856,y:.6050068561303112},{x:.38299491132800306,y:.6049525395264004},{x:.381914,y:.605059},{x:.261186,y:.605059},{x:.26023449599616577,y:.6049652850353624},{x:.2592798763752433,y:.6050186117946668},{x:.25585213857488087,y:.6045336605029273},{x:.2524069355092742,y:.6041943376181453},{x:.2514919972706982,y:.6039167941377678},{x:.2505453168634681,y:.6037828591890964},{x:.24727805138745723,y:.6026385076291858},{x:.2439652455435709,y:.6016335789630078},{x:.24312203363365809,y:.6011828728071931},{x:.24221967283726598,y:.6008668231955117},{x:.161332672837266,y:.5632728231955116},{x:.15891596978001063,y:.5618462817840929},{x:.15640337688314435,y:.5605963413854953},{x:.1551260781006526,y:.5596091689500753},{x:.15373589412748892,y:.5587885654418143},{x:.1516439317651508,y:.5569179592459522},{x:.1494234689111216,y:.555201853544281},{x:.06853646891112161,y:.47891385354428107},{x:.06722863655802509,y:.4774120673763562},{x:.06576662511800205,y:.47605991734502884},{x:.06433886916992998,y:.4740937424536807},{x:.06274309028364713,y:.4722613067803989},{x:.06175337150959475,y:.4705332315776763},{x:.06058324359446483,y:.4689218384474283},{x:.05956650326928079,y:.4667149016876259},{x:.05835887729241062,y:.4646063547351938},{x:.05772530643484857,y:.4627183994585984},{x:.05689202940417486,y:.4609096881637455},{x:.017051029404174856,y:.3459246881637455},{x:.016331419439147486,y:.342923979771159},{x:.015435662381854634,y:.33997106449072584},{x:.015304912520774374,y:.33864353887302173},{x:.014993833838408223,y:.33734636893611664},{x:.014873460143664087,y:.33426292937408214},{x:.014571,y:.33119200000000004},{x:.014571,y:.25490100000000004}],[{x:.12278767041868709,y:.376192},{x:.13831799224413532,y:.421014018902617},{x:.20587340146207272,y:.4847284236699839},{x:.27113246747276615,y:.5150589999999999},{x:.37183117966561724,y:.5150589999999999},{x:.4359272756482788,y:.48481767680255794},{x:.4662598881310508,y:.45622238914125884},{x:.5025937304308662,y:.3866481106579649},{x:.5074240772554575,y:.379266555000715},{x:.5104401600015575,y:.376192},{x:.12278767041868709,y:.376192}]],f:[[{x:.044112,y:.5239119999999999},{x:.04497666238185463,y:.5151329355092742},{x:.04753742103699209,y:.5066912455435709},{x:.051695867446385456,y:.4989113395141178},{x:.05729219484660536,y:.49209219484660527},{x:.0641113395141179,y:.4864958674463854},{x:.07189124554357096,y:.482337421036992},{x:.08033293550927423,y:.47977666238185457},{x:.089112,y:.47891199999999995},{x:.20304699999999998,y:.47891199999999995},{x:.20304699999999998,y:.05318299999999998},{x:.20391166238185462,y:.04440393550927419},{x:.2064724210369921,y:.03596224554357094},{x:.21063086744638546,y:.028182339514117884},{x:.21622719484660535,y:.021363194846605343},{x:.2230463395141179,y:.01576686744638544},{x:.23082624554357095,y:.011608421036992077},{x:.23926793550927422,y:.009047662381854615},{x:.248047,y:.008182999999999982},{x:.25682606449072576,y:.009047662381854615},{x:.26526775445642903,y:.011608421036992077},{x:.2730476604858821,y:.015766867446385446},{x:.2798668051533946,y:.021363194846605343},{x:.28546313255361455,y:.028182339514117884},{x:.2896215789630079,y:.03596224554357094},{x:.2921823376181454,y:.04440393550927421},{x:.293047,y:.05318299999999998},{x:.293047,y:.47891199999999995},{x:.459965,y:.47891199999999995},{x:.4687440644907258,y:.47977666238185457},{x:.4771857544564291,y:.482337421036992},{x:.48496566048588213,y:.4864958674463854},{x:.4917848051533946,y:.49209219484660527},{x:.49738113255361455,y:.4989113395141178},{x:.5015395789630079,y:.5066912455435709},{x:.5041003376181454,y:.5151329355092742},{x:.504965,y:.5239119999999999},{x:.5041003376181454,y:.5326910644907257},{x:.5015395789630079,y:.5411327544564289},{x:.49738113255361455,y:.548912660485882},{x:.4917848051533946,y:.5557318051533946},{x:.48496566048588213,y:.5613281325536145},{x:.4771857544564291,y:.5654865789630078},{x:.4687440644907258,y:.5680473376181453},{x:.459965,y:.568912},{x:.293047,y:.568912},{x:.293047,y:.6141229501499061},{x:.3322669208002554,y:.6884371453882767},{x:.4140490730325775,y:.7147659999999999},{x:.512941,y:.7147659999999999},{x:.5217200644907257,y:.7156306623818546},{x:.530161754456429,y:.7181914210369921},{x:.5379416604858821,y:.7223498674463854},{x:.5447608051533946,y:.7279461948466053},{x:.5503571325536145,y:.7347653395141178},{x:.5545155789630078,y:.7425452455435709},{x:.5570763376181453,y:.7509869355092742},{x:.557941,y:.7597659999999999},{x:.5570763376181453,y:.7685450644907257},{x:.5545155789630078,y:.776986754456429},{x:.5503571325536145,y:.7847666604858821},{x:.5447608051533946,y:.7915858051533946},{x:.5379416604858821,y:.7971821325536145},{x:.530161754456429,y:.8013405789630078},{x:.5217200644907257,y:.8039013376181453},{x:.512941,y:.804766},{x:.406984,y:.804766},{x:.40440576588043703,y:.8045120661033809},{x:.40181542834229744,y:.8044681908525655},{x:.400026512750784,y:.8040807473169851},{x:.3982049355092742,y:.8039013376181453},{x:.39572578148103565,y:.8031492944655273},{x:.39319377618916257,y:.8026009124809075},{x:.2872357761891626,y:.7684889124809076},{x:.28342960508890525,y:.7668362808879404},{x:.2796044085190959,y:.7652281761559891},{x:.27938594032962494,y:.7650805300410848},{x:.27914407460343155,y:.764975512444704},{x:.2757334504432472,y:.7626120885587936},{x:.27229547962292316,y:.7602886242777711},{x:.2721100135665551,y:.7601011941121303},{x:.27189328313916555,y:.7599510087370087},{x:.2690092742928275,y:.7569676176126634},{x:.26609064851257996,y:.7540180832118794},{x:.26594531194585036,y:.7537980718316557},{x:.26576204564604555,y:.7536084902175343},{x:.26351548295615396,y:.7501197819025626},{x:.26122836336792754,y:.7466575263349163},{x:.2082493633679275,y:.6462725263349164},{x:.20745880379789322,y:.6443351468057326},{x:.2064724210369921,y:.6424897544564291},{x:.20579637196662365,y:.6402611193438609},{x:.20491647908027386,y:.6381048157198157},{x:.20451907388691828,y:.636050431873947},{x:.20391166238185462,y:.6340480644907258},{x:.20368338854657433,y:.6317303613460921},{x:.20324107652369047,y:.6294438319050109},{x:.20325209776572678,y:.6273513925615422},{x:.20304699999999998,y:.6252690000000001},{x:.20304699999999998,y:.568912},{x:.089112,y:.568912},{x:.0803329355092742,y:.5680473376181453},{x:.07189124554357093,y:.5654865789630078},{x:.0641113395141179,y:.5613281325536145},{x:.05729219484660536,y:.5557318051533946},{x:.051695867446385456,y:.548912660485882},{x:.04753742103699209,y:.5411327544564289},{x:.04497666238185463,y:.5326910644907257},{x:.044112,y:.5239119999999999}]],g:[[{x:.03166100000000001,y:.285331},{x:.03199195389402992,y:.28197076872347165},{x:.03216742697517915,y:.27859884139484714},{x:.032423533978450624,y:.2775888625904497},{x:.03252566238185464,y:.2765519355092742},{x:.03350580569139788,y:.2733208360362635},{x:.034335737494852386,y:.2700479324456657},{x:.07135573749485238,y:.1675239324456658},{x:.07223945098422414,y:.16566943556296815},{x:.07292365731738822,y:.16373243532732273},{x:.07413231799188957,y:.16169720247238553},{x:.07515058411631778,y:.15956034321175439},{x:.07637911169281072,y:.15791388391586245},{x:.07742806119285411,y:.15614758463046624},{x:.07901055202445481,y:.15438725620434748},{x:.0804261330120869,y:.15249010996133996},{x:.08195226304990277,y:.15111496075964967},{x:.08332564517579637,y:.14958724031548856},{x:.1584886451757964,y:.08090524031548854},{x:.16047116284778873,y:.07942238349974136},{x:.16231838489394151,y:.07777404756068641},{x:.16399482319868336,y:.07678680357956279},{x:.16555276842115366,y:.07562151273533077},{x:.16778648358567103,y:.07455391860853194},{x:.1699197861673149,y:.07329763012616651},{x:.2450797861673149,y:.038459630126166475},{x:.2459605302529857,y:.0381521715215269},{x:.24678324554357095,y:.03771242103699209},{x:.2501181687545519,y:.03670078314085588},{x:.253408434365457,y:.03555218561964517},{x:.254332237398671,y:.03542245939316866},{x:.2552249355092742,y:.03515166238185463},{x:.2586931398688001,y:.03481007406735549},{x:.26214426420887293,y:.034325445502994434},{x:.2630756249571383,y:.03437843696081321},{x:.264004,y:.034287},{x:.376189,y:.034287},{x:.37724627227682206,y:.03439113223027483},{x:.37830727432005307,y:.03433688416138392},{x:.3816280756224084,y:.03482270219101675},{x:.3849680644907258,y:.03515166238185463},{x:.38598470638687477,y:.035460057329467706},{x:.38703590484658207,y:.03561384285228289},{x:.39019811948723343,y:.036738182220129235},{x:.39340975445642906,y:.03771242103699209},{x:.39434669699397534,y:.038213227257056566},{x:.39534769490287125,y:.03856913648017993},{x:.4693886949028713,y:.07340713648017996},{x:.47140406041677185,y:.07460963544760885},{x:.47352148667564636,y:.07562166704766733},{x:.4751827197672129,y:.0768642309221422},{x:.47696422705836306,y:.07792719476830276},{x:.47870627197824944,y:.0794997663623443},{x:.480392,y:.08076065187723735},{x:.480392,y:.018480463023952315},{x:.44982106300216956,y:-.06618482166306154},{x:.42509763890365326,y:-.0887666681923909},{x:.3663917896728536,y:-.115601},{x:.27366828971008494,y:-.115601},{x:.21388478385740822,y:-.08868092320279419},{x:.15228882603575622,y:-.032396134475538775},{x:.11903308523020223,y:.0605977685009861},{x:.11526275900748023,y:.06857299605517989},{x:.11000898883421664,y:.07565942769130271},{x:.1034736741518217,y:.08158473581569503},{x:.09590796343849313,y:.08612121416008753},{x:.08760260271404471,y:.08909452840579157},{x:.07887676233341709,y:.09039041575379858},{x:.07006577144893004,y:.08995907598006667},{x:.061508231499013855,y:.08781708523020218},{x:.05353300394482007,y:.08404675900748018},{x:.046446572308697254,y:.07879298883421659},{x:.04052126418430494,y:.07225767415182165},{x:.035984785839912437,y:.06469196343849308},{x:.03301147159420839,y:.05638660271404467},{x:.03171558424620138,y:.04766076233341703},{x:.0321469240199333,y:.038849771448930016},{x:.03428891476979778,y:.030292231499013812},{x:.07130891476979778,y:-.07322776850098624},{x:.07221644299685706,y:-.07514742841768875},{x:.07292365731738822,y:-.07714956467267746},{x:.07409706350042253,y:-.07912543338941479},{x:.07507924099251978,y:-.08120299605518004},{x:.07634383839048098,y:-.08290872027080634},{x:.07742806119285414,y:-.08473441536953392},{x:.07896439356931816,y:-.08644339813281518},{x:.08033301116578337,y:-.08828942769130284},{x:.0819060799658371,y:-.08971566618082738},{x:.08332564517579637,y:-.09129475968451163},{x:.1584886451757964,y:-.15997675968451153},{x:.16066766565506738,y:-.1616065940183929},{x:.16271768036753925,y:-.16339598773796155},{x:.16419165994754753,y:-.1642424237156923},{x:.16555276842115366,y:-.1652604872646693},{x:.16800788453794988,y:-.16643389898185532},{x:.17036760218951646,y:-.1677889719724602},{x:.24552760218951647,y:-.2016329719724602},{x:.24617798725770038,y:-.20185206166908357},{x:.24678324554357095,y:-.2021755789630079},{x:.2503526828238078,y:-.20325835592431216},{x:.25388756161766735,y:-.20444912053505218},{x:.25456819199860076,y:-.20453711665220192},{x:.2552249355092742,y:-.20473633761814536},{x:.25893702635910487,y:-.20510194665533446},{x:.2626362900994872,y:-.20558021041579141},{x:.263321009549333,y:-.20553373131203426},{x:.264004,y:-.20560099999999998},{x:.376189,y:-.20560099999999998},{x:.3769985938815523,y:-.20552126196245651},{x:.37781053527049396,y:-.2055717752142049},{x:.38138177137190815,y:-.20508955666026785},{x:.3849680644907258,y:-.20473633761814536},{x:.3857465461334356,y:-.20450018779358015},{x:.38655274094280934,y:-.2043913285403334},{x:.3899612805709507,y:-.2032216620796743},{x:.39340975445642906,y:-.2021755789630079},{x:.39412720724734457,y:-.20179209245674457},{x:.39489667386274535,y:-.20152804409855607},{x:.4689376738627454,y:-.16768404409855608},{x:.471176129388074,y:-.16638175223486265},{x:.4735129313995788,y:-.16526550692304898},{x:.47497970384913024,y:-.16416890323360386},{x:.4765626813675205,y:-.163247956304222},{x:.47850406105855325,y:-.16153398660426738},{x:.480578193417323,y:-.15998330217620907},{x:.5187211934173229,y:-.125144302176209},{x:.5200982241105119,y:-.12361318710120846},{x:.5216280341275545,y:-.12223470670068204},{x:.5230406381933351,y:-.12034152832018923},{x:.5246201913815024,y:-.1185852292702623},{x:.52567205708302,y:-.11681488878073784},{x:.5269035440443172,y:-.11516444436572898},{x:.5279196645391884,y:-.1130320574948894},{x:.5291262301085498,y:-.11100134969861394},{x:.5298125082093796,y:-.10905981698676002},{x:.5306983467616347,y:-.10720083421055714},{x:.5677173467616347,y:-.0046778342105572215},{x:.5685472301626403,y:-.001405045768812418},{x:.5695273376181453,y:.0018259355092742052},{x:.5696294781899907,y:.002862986138707272},{x:.5698856101392306,y:.003873086692614168},{x:.5700610582123972,y:.007244891642088324},{x:.570392,y:.010604999999999976},{x:.570392,y:.560059},{x:.5695273376181453,y:.5688380644907257},{x:.5669665789630078,y:.577279754456429},{x:.5628081325536145,y:.5850596604858821},{x:.5572118051533946,y:.5918788051533946},{x:.5503926604858821,y:.5974751325536145},{x:.542612754456429,y:.6016335789630078},{x:.5341710644907257,y:.6041943376181453},{x:.525392,y:.605059},{x:.5166129355092742,y:.6041943376181453},{x:.508171245543571,y:.6016335789630078},{x:.5003913395141178,y:.5974751325536145},{x:.4935721948466053,y:.5918788051533946},{x:.48797586744638544,y:.5850596604858821},{x:.48381742103699205,y:.577279754456429},{x:.4812566623818546,y:.5688380644907257},{x:.480392,y:.560059},{x:.480392,y:.5595783858718113},{x:.47850787544975776,y:.5609876460911735},{x:.47656308903374583,y:.5627046621197919},{x:.47498407852937236,y:.5636233247252487},{x:.47352120750708176,y:.5647175018259646},{x:.47118052218859596,y:.5658362200595997},{x:.46893813108831367,y:.5671408350985324},{x:.39489713108831365,y:.6009858350985324},{x:.39412742928685096,y:.6012499737741558},{x:.39340975445642906,y:.6016335789630078},{x:.38996152003118717,y:.6026795894402057},{x:.3865532301567984,y:.60384921275647},{x:.38574678706033977,y:.6039581147092028},{x:.3849680644907258,y:.6041943376181453},{x:.38138202040224084,y:.6045475321329209},{x:.37781103767268465,y:.6050297570960106},{x:.3769988444371686,y:.6049792372848822},{x:.376189,y:.605059},{x:.264004,y:.605059},{x:.2633207613423033,y:.6049917068657756},{x:.2626357925427961,y:.6050381952835313},{x:.25893677979996554,y:.6045599223713788},{x:.2552249355092742,y:.6041943376181453},{x:.25456795333002863,y:.6039950442528821},{x:.2538870765735461,y:.6039070086250592},{x:.2503524457397967,y:.6027162840056636},{x:.24678324554357095,y:.6016335789630078},{x:.24617776729948443,y:.6013099440989677},{x:.24552714829793862,y:.6010907675853725},{x:.17036714829793861,y:.5672457675853725},{x:.16800780172583518,y:.5658908729822889},{x:.16555304759050302,y:.5647176561362495},{x:.1641916021742222,y:.563699355958929},{x:.16271727507130354,y:.5628526987282604},{x:.16066758950642807,y:.5610635523625588},{x:.15848888603577402,y:.5594339797745099},{x:.08332588603577401,y:.49075297977450993},{x:.08190615458499984,y:.48917372437901785},{x:.08033291862515302,y:.48774732555289924},{x:.07896444452212992,y:.48590147772545017},{x:.07742825448734617,y:.4841926782200152},{x:.07634390022195357,y:.48236679190821125},{x:.07507917015624571,y:.48066087782555583},{x:.0740970979464375,y:.4785835213931001},{x:.07292379561819572,y:.47660786018244516},{x:.07221648966449083,y:.47460551074132296},{x:.0713088683600783,y:.4726856387236396},{x:.034288868360078294,y:.36916463872363964},{x:.03348577523186824,y:.3659561323879453},{x:.03252566238185464,y:.3627910644907258},{x:.0324167369020588,y:.3616851255348066},{x:.032146903820267865,y:.36060709221327164},{x:.03198519043554786,y:.35730356073015046},{x:.03166100000000001,y:.354012},{x:.03166100000000001,y:.285331}],[{x:.121661,y:.29320659086815803},{x:.121661,y:.34620780969623244},{x:.15228882172599023,y:.4318540207415116},{x:.21388481974037543,y:.48813802669691503},{x:.2736685500834057,y:.5150589999999999},{x:.3663915263934284,y:.5150589999999999},{x:.4250929420729598,y:.48822590193711934},{x:.480392,y:.4376951204586189},{x:.480392,y:.20264468470162808},{x:.4249051037436742,y:.15194152341431572},{x:.3661311050032371,y:.124287},{x:.2739261218560311,y:.124287},{x:.21407100266628776,y:.15203091487935444},{x:.15223458736534265,y:.208535427414771},{x:.121661,y:.29320659086815803}]],h:[[{x:.047041,y:.05318299999999998},{x:.04790566238185463,y:.04440393550927419},{x:.050466421036992094,y:.03596224554357094},{x:.05462486744638546,y:.028182339514117884},{x:.06022119484660536,y:.021363194846605343},{x:.06704033951411792,y:.01576686744638544},{x:.07482024554357096,y:.011608421036992077},{x:.08326193550927423,y:.009047662381854615},{x:.092041,y:.008182999999999982},{x:.10082006449072577,y:.009047662381854615},{x:.10926175445642904,y:.011608421036992077},{x:.1170416604858821,y:.015766867446385446},{x:.12386080515339463,y:.021363194846605343},{x:.12945713255361452,y:.028182339514117884},{x:.1336155789630079,y:.03596224554357094},{x:.13617633761814535,y:.04440393550927421},{x:.137041,y:.05318299999999998},{x:.137041,y:.3692271498339558},{x:.23047284680205596,y:.45237128863270537},{x:.2915669774325256,y:.478914},{x:.38669764440631527,y:.478914},{x:.43644054132690624,y:.4571557093088599},{x:.465011,y:.38123324165433015},{x:.465011,y:.05318299999999998},{x:.4658756623818546,y:.04440393550927419},{x:.46843642103699207,y:.03596224554357094},{x:.47259486744638546,y:.028182339514117884},{x:.4781911948466053,y:.021363194846605343},{x:.4850103395141179,y:.01576686744638544},{x:.492790245543571,y:.011608421036992077},{x:.5012319355092743,y:.009047662381854615},{x:.510011,y:.008182999999999982},{x:.5187900644907257,y:.009047662381854615},{x:.527231754456429,y:.011608421036992077},{x:.5350116604858821,y:.015766867446385446},{x:.5418308051533947,y:.021363194846605343},{x:.5474271325536145,y:.028182339514117884},{x:.5515855789630079,y:.03596224554357094},{x:.5541463376181454,y:.04440393550927421},{x:.555011,y:.05318299999999998},{x:.555011,y:.38942},{x:.5546506186962206,y:.39307901278178137},{x:.554410350301749,y:.3967478709583736},{x:.5542188683658584,y:.3974626474508545},{x:.5541463376181454,y:.3981990644907258},{x:.5530790429582076,y:.40171746346329923},{x:.5521276325304605,y:.40526895152034226},{x:.5139866325304605,y:.5066239515203422},{x:.5138553396770835,y:.5068902237569821},{x:.5137747554395128,y:.50717595947055},{x:.511905898744729,y:.5108438433478746},{x:.5100853961903059,y:.5145359657635786},{x:.5099046789559015,y:.5147715076888114},{x:.5097698988494882,y:.5150360318659072},{x:.5072213830653152,y:.5182688425286295},{x:.504715563605999,y:.5215348594178236},{x:.5044923668525381,y:.521730619287556},{x:.5043085704011859,y:.5219637664124008},{x:.5011783335599848,y:.5246372687597332},{x:.4980834944323178,y:.5273516689249697},{x:.497826395485866,y:.5275001237971909},{x:.49760064588412606,y:.5276929341565276},{x:.49400898123224624,y:.5297043869925788},{x:.49044405536829966,y:.5317628575577613},{x:.490162934397186,y:.5318583023949868},{x:.48990390707565157,y:.532003366394835},{x:.41414290707565155,y:.5651423663948351},{x:.41372099607879415,y:.5652794559590063},{x:.41332975445642905,y:.5654885789630079},{x:.40952975949805703,y:.5666412948313546},{x:.4057531353317914,y:.5678684156337233},{x:.40531258638921414,y:.5679205603081202},{x:.4048880644907258,y:.5680493376181454},{x:.4009362016599996,y:.5684385621342186},{x:.39699274487562397,y:.5689053213297277},{x:.39655048803612764,y:.5688705172237564},{x:.396109,y:.568914},{x:.282214,y:.568914},{x:.28182836168040026,y:.5688760179407144},{x:.2814421286004882,y:.5689073796745989},{x:.27744221175957573,y:.5684440198796774},{x:.2734349355092742,y:.5680493376181454},{x:.2730641170540284,y:.5679368510695262},{x:.2726791869636831,y:.5678922598605547},{x:.26884652441488044,y:.5666574583296339},{x:.26499324554357095,y:.5654885789630079},{x:.2646514972979566,y:.5653059107200353},{x:.264282662844679,y:.5651870801833616},{x:.18800566284467896,y:.5320480801833616},{x:.1856267698486466,y:.5307235797343987},{x:.1831549202301779,y:.529581917442145},{x:.18178185218619736,y:.5285828381463435},{x:.18029822995654404,y:.527756799180932},{x:.17822344394147954,y:.5259936496360635},{x:.17602181748454487,y:.5243916901265875},{x:.137041,y:.4897030201456747},{x:.137041,y:.7597659999999999},{x:.13617633761814535,y:.7685450644907257},{x:.1336155789630079,y:.776986754456429},{x:.12945713255361452,y:.7847666604858821},{x:.12386080515339463,y:.7915858051533946},{x:.11704166048588208,y:.7971821325536145},{x:.10926175445642904,y:.8013405789630078},{x:.10082006449072577,y:.8039013376181453},{x:.092041,y:.804766},{x:.08326193550927423,y:.8039013376181453},{x:.07482024554357093,y:.8013405789630078},{x:.06704033951411792,y:.7971821325536145},{x:.06022119484660536,y:.7915858051533946},{x:.05462486744638546,y:.7847666604858821},{x:.050466421036992094,y:.776986754456429},{x:.04790566238185463,y:.7685450644907257},{x:.047041,y:.7597659999999999},{x:.047041,y:.05318299999999998}]],i:[[{x:.216026,y:.7597659999999999},{x:.21689066238185462,y:.7509869355092742},{x:.21945142103699208,y:.7425452455435709},{x:.22360986744638545,y:.7347653395141178},{x:.22920619484660534,y:.7279461948466053},{x:.2360253395141179,y:.7223498674463854},{x:.24380524554357094,y:.7181914210369921},{x:.25224693550927424,y:.7156306623818546},{x:.261026,y:.7147659999999999},{x:.341026,y:.7147659999999999},{x:.3498050644907258,y:.7156306623818546},{x:.35824675445642906,y:.7181914210369921},{x:.3660266604858821,y:.7223498674463854},{x:.3728458051533946,y:.7279461948466053},{x:.37844213255361453,y:.7347653395141178},{x:.3826005789630079,y:.7425452455435709},{x:.38516133761814536,y:.7509869355092742},{x:.386026,y:.7597659999999999},{x:.38516133761814536,y:.7685450644907257},{x:.3826005789630079,y:.776986754456429},{x:.37844213255361453,y:.7847666604858821},{x:.3728458051533946,y:.7915858051533946},{x:.3660266604858821,y:.7971821325536145},{x:.35824675445642906,y:.8013405789630078},{x:.3498050644907258,y:.8039013376181453},{x:.341026,y:.804766},{x:.261026,y:.804766},{x:.25224693550927424,y:.8039013376181453},{x:.24380524554357094,y:.8013405789630078},{x:.2360253395141179,y:.7971821325536145},{x:.22920619484660534,y:.7915858051533946},{x:.22360986744638545,y:.7847666604858821},{x:.21945142103699208,y:.776986754456429},{x:.21689066238185462,y:.7685450644907257},{x:.216026,y:.7597659999999999}],[{x:.25597800000000004,y:.05318299999999998},{x:.25684266238185466,y:.04440393550927419},{x:.2594034210369921,y:.03596224554357094},{x:.2635618674463855,y:.028182339514117884},{x:.2691581948466054,y:.021363194846605343},{x:.27597733951411796,y:.01576686744638544},{x:.28375724554357096,y:.011608421036992077},{x:.2921989355092742,y:.009047662381854615},{x:.300978,y:.008182999999999982},{x:.3097570644907258,y:.009047662381854615},{x:.3181987544564291,y:.011608421036992077},{x:.32597866048588214,y:.015766867446385446},{x:.33279780515339463,y:.021363194846605343},{x:.33839413255361456,y:.028182339514117884},{x:.34255257896300795,y:.03596224554357094},{x:.3451133376181454,y:.04440393550927421},{x:.345978,y:.05318299999999998},{x:.345978,y:.523911},{x:.3451133376181454,y:.5326900644907258},{x:.34255257896300795,y:.541131754456429},{x:.33839413255361456,y:.5489116604858821},{x:.33279780515339463,y:.5557308051533947},{x:.32597866048588214,y:.5613271325536145},{x:.3181987544564291,y:.5654855789630079},{x:.3097570644907258,y:.5680463376181454},{x:.300978,y:.5689110000000001},{x:.2921989355092742,y:.5680463376181454},{x:.28375724554357096,y:.5654855789630079},{x:.27597733951411796,y:.5613271325536145},{x:.2691581948466054,y:.5557308051533947},{x:.2635618674463855,y:.5489116604858821},{x:.2594034210369921,y:.541131754456429},{x:.25684266238185466,y:.5326900644907258},{x:.25597800000000004,y:.523911},{x:.25597800000000004,y:.05318299999999998}]],j:[[{x:.11017199870220953,y:-.1121580749666587},{x:.11173080987432929,y:-.12084080046598154},{x:.114953584640513,y:-.12905258085596802},{x:.11971647357384912,y:-.1364778420214504},{x:.12583644152368842,y:-.14283123533997366},{x:.1330783015538362,y:-.147868603469331},{x:.14116375304461573,y:-.15139636317729976},{x:.23896575304461573,y:-.18307436317729964},{x:.2424293887998465,y:-.18383095770413346},{x:.24586120600074532,y:-.1847208108507566},{x:.24673197042105502,y:-.1847708110651418},{x:.2475840766296098,y:-.18495694463669302},{x:.2511287638648936,y:-.18502327959701073},{x:.25466824139749206,y:-.18522652014211538},{x:.25553202888155596,y:-.18510568190524296},{x:.2564040749666586,y:-.1851220012977904},{x:.25989359333942796,y:-.1844955274762681},{x:.2634047110671092,y:-.18400434499968443},{x:.3944597110671092,y:-.15232634499968456},{x:.39510744613291976,y:-.15210060706564532},{x:.39578357398914765,y:-.1519849807175323},{x:.3992672661785621,y:-.15065089524264363},{x:.4027898773796621,y:-.14942325292878383},{x:.40338112711156726,y:-.1490754856432793},{x:.40402170577913904,y:-.1488301750218278},{x:.4071781926350792,y:-.14684208899421944},{x:.4103936167153703,y:-.14495080812962524},{x:.41090565971774945,y:-.14449437599440731},{x:.41148607211771127,y:-.14412880824922783},{x:.41419405162048195,y:-.14156312270000898},{x:.41697872163578864,y:-.1390808841476645},{x:.4173918803832174,y:-.13853332759371953},{x:.41788982159253774,y:-.13806155128824654},{x:.42004522760849955,y:-.13501686407422092},{x:.422292130251795,y:-.13203905886963707},{x:.4225905272853119,y:-.13142142018825975},{x:.42298686170256505,y:-.13086156542133753},{x:.4245068631872901,y:-.12745488216466036},{x:.4261296512500701,y:-.1240959456918764},{x:.4263018193390199,y:-.1234319603912164},{x:.42658131605481786,y:-.12280554206756752},{x:.4588533160548179,y:-.025908542067567514},{x:.4594769463166796,y:-.023162642495487502},{x:.46029433761814537,y:-.02046806449072583},{x:.46045163429328767,y:-.01887100454660151},{x:.46080705178433234,y:-.017306069686551954},{x:.4608830007338393,y:-.01449126757618431},{x:.461159,y:-.01168900000000006},{x:.461159,y:.534292},{x:.46029433761814537,y:.5430710644907257},{x:.4577335789630079,y:.551512754456429},{x:.45357513255361454,y:.5592926604858821},{x:.4479788051533946,y:.5661118051533947},{x:.4411596604858821,y:.5717081325536145},{x:.43337975445642907,y:.5758665789630079},{x:.4249380644907258,y:.5784273376181454},{x:.416159,y:.579292},{x:.4073799355092742,y:.5784273376181454},{x:.39893824554357094,y:.5758665789630079},{x:.39115833951411794,y:.5717081325536145},{x:.3843391948466054,y:.5661118051533947},{x:.37874286744638547,y:.5592926604858821},{x:.3745844210369921,y:.551512754456429},{x:.37202366238185464,y:.5430710644907257},{x:.371159,y:.534292},{x:.371159,y:-.004392296840350002},{x:.3490732119536395,y:-.07070509444595838},{x:.254610065464387,y:-.09353828321774525},{x:.16889624695538427,y:-.06577563682270039},{x:.16027792337039018,y:-.063893055363307},{x:.15145792503334138,y:-.0637279987022096},{x:.14277519953401854,y:-.06528680987432936},{x:.13456341914403205,y:-.06850958464051307},{x:.12713815797854966,y:-.0732724735738492},{x:.12078476466002638,y:-.07939244152368852},{x:.11574739653066908,y:-.08663430155383627},{x:.11221963682270032,y:-.0947197530446158},{x:.11033705536330693,y:-.10333807662960988},{x:.11017199870220953,y:-.1121580749666587}],[{x:.3403,y:.7597659999999999},{x:.3411646623818546,y:.7509869355092742},{x:.34372542103699205,y:.7425452455435709},{x:.34788386744638544,y:.7347653395141178},{x:.3534801948466053,y:.7279461948466053},{x:.3602993395141179,y:.7223498674463854},{x:.36807924554357097,y:.7181914210369921},{x:.37652093550927423,y:.7156306623818546},{x:.3853,y:.7147659999999999},{x:.447023,y:.7147659999999999},{x:.4558020644907258,y:.7156306623818546},{x:.46424375445642907,y:.7181914210369921},{x:.4720236604858821,y:.7223498674463854},{x:.4788428051533946,y:.7279461948466053},{x:.48443913255361454,y:.7347653395141178},{x:.48859757896300793,y:.7425452455435709},{x:.49115833761814537,y:.7509869355092742},{x:.492023,y:.7597659999999999},{x:.49115833761814537,y:.7685450644907257},{x:.48859757896300793,y:.776986754456429},{x:.48443913255361454,y:.7847666604858821},{x:.4788428051533946,y:.7915858051533946},{x:.4720236604858821,y:.7971821325536145},{x:.46424375445642907,y:.8013405789630078},{x:.4558020644907258,y:.8039013376181453},{x:.447023,y:.804766},{x:.3853,y:.804766},{x:.37652093550927423,y:.8039013376181453},{x:.36807924554357097,y:.8013405789630078},{x:.3602993395141179,y:.7971821325536145},{x:.3534801948466053,y:.7915858051533946},{x:.34788386744638544,y:.7847666604858821},{x:.34372542103699205,y:.776986754456429},{x:.3411646623818546,y:.7685450644907257},{x:.3403,y:.7597659999999999}]],k:[[{x:.020185999999999996,y:.05318299999999998},{x:.02105066238185463,y:.04440393550927419},{x:.02361142103699209,y:.03596224554357094},{x:.027769867446385453,y:.028182339514117884},{x:.03336619484660536,y:.021363194846605343},{x:.04018533951411791,y:.01576686744638544},{x:.047965245543570956,y:.011608421036992077},{x:.056406935509274225,y:.009047662381854615},{x:.065186,y:.008182999999999982},{x:.07396506449072576,y:.009047662381854615},{x:.08240675445642903,y:.011608421036992077},{x:.0901866604858821,y:.015766867446385446},{x:.09700580515339463,y:.021363194846605343},{x:.10260213255361453,y:.028182339514117884},{x:.10676057896300789,y:.03596224554357094},{x:.10932133761814536,y:.04440393550927421},{x:.11018599999999999,y:.05318299999999998},{x:.11018599999999999,y:.16578332733911408},{x:.23477705990096162,y:.26351643594805596},{x:.5068321321577423,y:.019673199736523116},{x:.5139466814455551,y:.014457569113271652},{x:.5219420457215526,y:.010730135081525344},{x:.5305109676204599,y:.008634140840755075},{x:.539324148279209,y:.008250134274186548},{x:.5480429021075728,y:.009592872538819623},{x:.5563321722854605,y:.012610754956160736},{x:.5638734068086124,y:.017187805997359452},{x:.5703768002634768,y:.02314813215774228},{x:.5755924308867283,y:.030262681445555134},{x:.5793198649184746,y:.03825804572155257},{x:.5814158591592449,y:.04682696762045996},{x:.5817998657258134,y:.05564014827920904},{x:.5804571274611804,y:.06435890210757275},{x:.5774392450438393,y:.07264817228546054},{x:.5728621940026405,y:.08018940680861247},{x:.5669018678422577,y:.08669280026347684},{x:.3066862956724008,y:.3199242805817128},{x:.5215978711622948,y:.4885076152557163},{x:.5279716470169837,y:.49460635247919954},{x:.533033147947031,y:.5018313661609891},{x:.5365878633102175,y:.5099050030771282},{x:.5384991873886431,y:.5185169978886772},{x:.5386936690698568,y:.5273363964646907},{x:.5371638345319164,y:.5360242742638681},{x:.5339684744581735,y:.5442467610146052},{x:.5292303847442837,y:.5516878711622948},{x:.5231316475208004,y:.5580616470169838},{x:.5159066338390108,y:.5631231479470311},{x:.5078329969228718,y:.5666778633102175},{x:.4992210021113228,y:.5685891873886431},{x:.49040160353530926,y:.5687836690698569},{x:.4817137257361318,y:.5672538345319164},{x:.47349123898539475,y:.5640584744581736},{x:.46605012883770514,y:.5593203847442837},{x:.11018599999999999,y:.28016947631338524},{x:.11018599999999999,y:.7597659999999999},{x:.10932133761814536,y:.7685450644907257},{x:.10676057896300789,y:.776986754456429},{x:.10260213255361453,y:.7847666604858821},{x:.09700580515339463,y:.7915858051533946},{x:.09018666048588207,y:.7971821325536145},{x:.08240675445642903,y:.8013405789630078},{x:.07396506449072576,y:.8039013376181453},{x:.065186,y:.804766},{x:.056406935509274204,y:.8039013376181453},{x:.04796524554357093,y:.8013405789630078},{x:.04018533951411791,y:.7971821325536145},{x:.03336619484660536,y:.7915858051533946},{x:.027769867446385453,y:.7847666604858821},{x:.02361142103699209,y:.776986754456429},{x:.02105066238185463,y:.7685450644907257},{x:.020185999999999996,y:.7597659999999999},{x:.020185999999999996,y:.05318299999999998}]],l:[[{x:.25602600000000003,y:.05355900000000002},{x:.25689066238185465,y:.044779935509274234},{x:.2594514210369921,y:.036338245543570985},{x:.2636098674463855,y:.028558339514117927},{x:.26920619484660535,y:.021739194846605386},{x:.27602533951411795,y:.016142867446385482},{x:.283805245543571,y:.01198442103699212},{x:.2922469355092743,y:.009423662381854658},{x:.301026,y:.008559000000000025},{x:.3098050644907258,y:.009423662381854658},{x:.3182467544564291,y:.01198442103699212},{x:.32602666048588214,y:.01614286744638549},{x:.3328458051533947,y:.021739194846605386},{x:.33844213255361455,y:.028558339514117927},{x:.34260057896300794,y:.036338245543570985},{x:.3451613376181454,y:.044779935509274255},{x:.346026,y:.05355900000000002},{x:.346026,y:.765137},{x:.3451613376181454,y:.7739160644907257},{x:.34260057896300794,y:.782357754456429},{x:.33844213255361455,y:.7901376604858821},{x:.3328458051533947,y:.7969568051533946},{x:.32602666048588214,y:.8025531325536145},{x:.3182467544564291,y:.8067115789630078},{x:.3098050644907258,y:.8092723376181453},{x:.301026,y:.810137},{x:.2922469355092743,y:.8092723376181453},{x:.283805245543571,y:.8067115789630078},{x:.27602533951411795,y:.8025531325536145},{x:.26920619484660535,y:.7969568051533946},{x:.2636098674463855,y:.7901376604858821},{x:.2594514210369921,y:.782357754456429},{x:.25689066238185465,y:.7739160644907257},{x:.25602600000000003,y:.765137},{x:.25602600000000003,y:.05355900000000002}]],m:[[{x:.005538000000000001,y:.03920400000000002},{x:.006402662381854635,y:.030424935509274227},{x:.008963421036992096,y:.02198324554357097},{x:.013121867446385459,y:.01420333951411792},{x:.018718194846605363,y:.00738419484660538},{x:.025537339514117914,y:.0017878674463854757},{x:.03331724554357096,y:-.002370578963007887},{x:.04175893550927423,y:-.004931337618145348},{x:.050538,y:-.005795999999999982},{x:.059317064490725775,y:-.004931337618145348},{x:.06775875445642904,y:-.002370578963007887},{x:.0755386604858821,y:.0017878674463854827},{x:.08235780515339464,y:.00738419484660538},{x:.08795413255361453,y:.01420333951411792},{x:.0921125789630079,y:.02198324554357098},{x:.09467333761814536,y:.030424935509274248},{x:.095538,y:.03920400000000002},{x:.095538,y:.3993271266071161},{x:.14963521853994496,y:.4943223065353007},{x:.1738257653562211,y:.5150589999999999},{x:.22021623464377893,y:.5150589999999999},{x:.2416666625786254,y:.49667119950297894},{x:.27741,y:.4029520066676719},{x:.27741,y:.03920400000000002},{x:.2782746623818546,y:.030424935509274227},{x:.28083542103699205,y:.02198324554357097},{x:.28499386744638544,y:.01420333951411792},{x:.2905901948466053,y:.00738419484660538},{x:.2974093395141179,y:.0017878674463854757},{x:.30518924554357096,y:-.002370578963007887},{x:.31363093550927423,y:-.004931337618145348},{x:.32241,y:-.005795999999999982},{x:.33118906449072577,y:-.004931337618145348},{x:.33963075445642904,y:-.002370578963007887},{x:.3474106604858821,y:.0017878674463854827},{x:.35422980515339464,y:.00738419484660538},{x:.3598261325536145,y:.01420333951411792},{x:.3639845789630079,y:.02198324554357098},{x:.36654533761814534,y:.030424935509274248},{x:.36740999999999996,y:.03920400000000002},{x:.36740999999999996,y:.3993264781598986},{x:.4215891088917321,y:.494459500052724},{x:.445289826307752,y:.5150589999999999},{x:.4920928256254945,y:.5150589999999999},{x:.5065149999999999,y:.5026965582556255},{x:.5065149999999999,y:.03920400000000002},{x:.5073796623818546,y:.030424935509274227},{x:.5099404210369921,y:.02198324554357097},{x:.5140988674463854,y:.01420333951411792},{x:.5196951948466053,y:.00738419484660538},{x:.5265143395141179,y:.0017878674463854757},{x:.534294245543571,y:-.002370578963007887},{x:.5427359355092742,y:-.004931337618145348},{x:.551515,y:-.005795999999999982},{x:.5602940644907257,y:-.004931337618145348},{x:.568735754456429,y:-.002370578963007887},{x:.5765156604858821,y:.0017878674463854827},{x:.5833348051533946,y:.00738419484660538},{x:.5889311325536145,y:.01420333951411792},{x:.5930895789630078,y:.02198324554357098},{x:.5956503376181453,y:.030424935509274248},{x:.596515,y:.03920400000000002},{x:.596515,y:.523393},{x:.5963454778388272,y:.5251141873868636},{x:.5963825315707437,y:.5268433058919912},{x:.5959141404350922,y:.5294936295415332},{x:.5956503376181453,y:.5321720644907257},{x:.5951482857762117,y:.5338271076115645},{x:.59484729324509,y:.5355302304139588},{x:.5938708496195351,y:.5380382502602514},{x:.5930895789630078,y:.540613754456429},{x:.592274291011045,y:.5421390509322689},{x:.5916468191910574,y:.543750727977755},{x:.5901998472565338,y:.5460200622246176},{x:.5889311325536145,y:.5483936604858821},{x:.5878339395503975,y:.5497305940285525},{x:.5869041018316961,y:.5511888894721116},{x:.5850422079081763,y:.5531323288770946},{x:.5833348051533946,y:.5552128051533947},{x:.581997871610724,y:.5563099981566119},{x:.5808014011353795,y:.5575588705221693},{x:.5380264011353795,y:.5942248705221693},{x:.5358211367621821,y:.5957677297988329},{x:.5337406604858821,y:.5974751325536145},{x:.5322153640100423,y:.5982904205055773},{x:.5307982404674333,y:.599281876328501},{x:.5283343527176928,y:.600364864260089},{x:.525960754456429,y:.6016335789630078},{x:.5243057113355902,y:.6021356308049415},{x:.5227223939887274,y:.6028315689939708},{x:.5200945686869033,y:.6034130669616181},{x:.5175190644907257,y:.6041943376181453},{x:.5157978771038628,y:.6043638597793182},{x:.5141092119504517,y:.6047375358201355},{x:.5114184349491921,y:.6047951971830532},{x:.50874,y:.605059},{x:.428467,y:.605059},{x:.42563553135621585,y:.6047801246797119},{x:.42279150043448566,y:.6046996620098968},{x:.4212557149999115,y:.6043487504203328},{x:.4196879355092742,y:.6041943376181453},{x:.41696527861756566,y:.6033684286794448},{x:.4141915924406847,y:.6027346691689239},{x:.4127537761476033,y:.6020908833721776},{x:.4112462455435709,y:.6016335789630078},{x:.40873703058140176,y:.6002923756232341},{x:.4061402803536474,y:.5991296742945802},{x:.40485568767586616,y:.5982177546177817},{x:.4034663395141179,y:.5974751325536145},{x:.4012669942053008,y:.5956701765049598},{x:.3989469715816508,y:.5940232153181825},{x:.3567609715816508,y:.5573572153181825},{x:.3545792701559384,y:.5550484712393128},{x:.3522737143614353,y:.552863400803129},{x:.35155574109793963,y:.5518488790642903},{x:.35070210094674875,y:.5509455305944583},{x:.3490127339279754,y:.5482555195520005},{x:.34717776483660073,y:.5456626430091704},{x:.33048446785976626,y:.5163509060824124},{x:.3216828574856715,y:.5394287684036221},{x:.32062739498214626,y:.5415455848316745},{x:.31976928952310246,y:.5437498007710907},{x:.3186639603788477,y:.5454834136126945},{x:.31774653490223986,y:.5473233854865517},{x:.3162983824161672,y:.5491936173608123},{x:.31502674401548947,y:.5511880718386934},{x:.3136044423732838,y:.5526727347769701},{x:.3123456842645886,y:.5542983712755478},{x:.3105604934838748,y:.5558501466339272},{x:.30892419049215825,y:.5575581938831911},{x:.2661511904921582,y:.594224193883191},{x:.26394553725639397,y:.5957674011217274},{x:.2618646604858821,y:.5974751325536145},{x:.26033982189406285,y:.5982901757614695},{x:.258923146662659,y:.5992813666868191},{x:.25645880963824363,y:.6003646200309664},{x:.25408475445642903,y:.6016335789630078},{x:.25243020816870526,y:.6021354800922637},{x:.25084738219782576,y:.6028312459348294},{x:.24821906447459133,y:.6034129165660671},{x:.24564306449072576,y:.6041943376181453},{x:.24392239379305308,y:.6043638088898747},{x:.2422342441971012,y:.6047374117585159},{x:.2395429505511757,y:.6047951464006902},{x:.236864,y:.605059},{x:.157178,y:.605059},{x:.1544990494488241,y:.6047951464006902},{x:.1518077558028988,y:.6047374117585159},{x:.15011960620694695,y:.6043638088898747},{x:.14839893550927424,y:.6041943376181453},{x:.14582293552540848,y:.6034129165660671},{x:.1431946178021742,y:.6028312459348294},{x:.1416117918312948,y:.6021354800922637},{x:.13995724554357097,y:.6016335789630078},{x:.13758319036175665,y:.6003646200309664},{x:.135118853337341,y:.5992813666868191},{x:.13370217810593676,y:.5982901757614691},{x:.13217733951411792,y:.5974751325536145},{x:.13009646274360603,y:.5957674011217274},{x:.1278908095078418,y:.594224193883191},{x:.09495385911112918,y:.5659898819750746},{x:.09467333761814536,y:.5688380644907257},{x:.0921125789630079,y:.577279754456429},{x:.08795413255361453,y:.5850596604858821},{x:.08235780515339464,y:.5918788051533946},{x:.07553866048588208,y:.5974751325536145},{x:.06775875445642904,y:.6016335789630078},{x:.059317064490725775,y:.6041943376181453},{x:.050538,y:.605059},{x:.04175893550927421,y:.6041943376181453},{x:.033317245543570934,y:.6016335789630078},{x:.025537339514117904,y:.5974751325536145},{x:.018718194846605356,y:.5918788051533946},{x:.013121867446385459,y:.5850596604858821},{x:.008963421036992096,y:.577279754456429},{x:.006402662381854635,y:.5688380644907257},{x:.005538000000000001,y:.560059},{x:.005538000000000001,y:.03920400000000002}]],n:[[{x:.047041,y:.03920400000000002},{x:.04790566238185463,y:.030424935509274227},{x:.050466421036992094,y:.02198324554357097},{x:.05462486744638546,y:.01420333951411792},{x:.06022119484660536,y:.00738419484660538},{x:.06704033951411792,y:.0017878674463854757},{x:.07482024554357096,y:-.002370578963007887},{x:.08326193550927423,y:-.004931337618145348},{x:.092041,y:-.005795999999999982},{x:.10082006449072577,y:-.004931337618145348},{x:.10926175445642904,y:-.002370578963007887},{x:.1170416604858821,y:.0017878674463854827},{x:.12386080515339463,y:.00738419484660538},{x:.12945713255361452,y:.01420333951411792},{x:.1336155789630079,y:.02198324554357098},{x:.13617633761814535,y:.030424935509274248},{x:.137041,y:.03920400000000002},{x:.137041,y:.3923986904044417},{x:.23217657812189968,y:.4860775193429304},{x:.29246969284729285,y:.5150589999999999},{x:.3857956927587408,y:.5150589999999999},{x:.4353266752666751,y:.4910865745843881},{x:.465011,y:.4037995608673687},{x:.465011,y:.03920400000000002},{x:.4658756623818546,y:.030424935509274227},{x:.46843642103699207,y:.02198324554357097},{x:.47259486744638546,y:.01420333951411792},{x:.4781911948466053,y:.00738419484660538},{x:.4850103395141179,y:.0017878674463854757},{x:.492790245543571,y:-.002370578963007887},{x:.5012319355092743,y:-.004931337618145348},{x:.510011,y:-.005795999999999982},{x:.5187900644907257,y:-.004931337618145348},{x:.527231754456429,y:-.002370578963007887},{x:.5350116604858821,y:.0017878674463854827},{x:.5418308051533947,y:.00738419484660538},{x:.5474271325536145,y:.01420333951411792},{x:.5515855789630079,y:.02198324554357098},{x:.5541463376181454,y:.030424935509274248},{x:.555011,y:.03920400000000002},{x:.555011,y:.411242},{x:.5547211401667089,y:.41418499627592825},{x:.5546227314347089,y:.4171405946120584},{x:.5542897326303223,y:.4185651504993601},{x:.5541463376181454,y:.4200210644907258},{x:.5532878972691104,y:.42285096307022063},{x:.5526147708021555,y:.4257305718218671},{x:.5144747708021555,y:.537881571821867},{x:.5144109474804813,y:.5380222238814931},{x:.5143747633675698,y:.5381723808934484},{x:.5125889395552703,y:.5420375142269895},{x:.5108295711501452,y:.5459147613418461},{x:.5107395343200961,y:.546040259499208},{x:.5106747512949527,y:.5461804721160435},{x:.5081691914797779,y:.5496229410537735},{x:.5056872154570532,y:.5530824522038071},{x:.5055744251835149,y:.5531879736350976},{x:.505483532821465,y:.5533128535645805},{x:.5023545242619802,y:.5562003659557777},{x:.4992453215682988,y:.5591091940676126},{x:.49911411231822944,y:.5591906836434047},{x:.49900060356177384,y:.559295431819878},{x:.49536839230215873,y:.5615170221826804},{x:.49175144785337105,y:.5637633826232722},{x:.4916068619246677,y:.563817708744868},{x:.49147509885166074,y:.5638982997546532},{x:.41571709885166075,y:.6005642997546532},{x:.4144883994140345,y:.6010164083750983},{x:.41333375445642906,y:.6016335789630078},{x:.41035728417594536,y:.6025364813514484},{x:.4074382196167836,y:.6036105717354909},{x:.4061449272779714,y:.6038142858466193},{x:.4048920644907258,y:.6041943376181453},{x:.4017966387343604,y:.6044992104448776},{x:.3987241185432898,y:.6049831812385367},{x:.3974159338025849,y:.6049306722213019},{x:.396113,y:.605059},{x:.282216,y:.605059},{x:.28097323419788345,y:.6049365982521052},{x:.2797255990169867,y:.6049900349640848},{x:.2765922846246742,y:.6045051123806029},{x:.2734369355092743,y:.6041943376181453},{x:.2722419284999821,y:.603831836204989},{x:.27100784129389754,y:.6036408445963318},{x:.26802933636200627,y:.6025539603505436},{x:.264995245543571,y:.6016335789630078},{x:.2638939207763026,y:.6010449086106044},{x:.2627208068242762,y:.6006168283817219},{x:.18644080682427616,y:.563950828381722},{x:.18387931815291048,y:.5623935720684188},{x:.18122474955630472,y:.5610008994562176},{x:.18011833133270075,y:.5601070811947741},{x:.17890296169536754,y:.5593681975674947},{x:.17669449694619624,y:.5573411418478543},{x:.17436263208920222,y:.5554573484070612},{x:.137041,y:.5187071981771466},{x:.137041,y:.560059},{x:.13617633761814535,y:.5688380644907257},{x:.1336155789630079,y:.577279754456429},{x:.12945713255361452,y:.5850596604858821},{x:.12386080515339463,y:.5918788051533946},{x:.11704166048588208,y:.5974751325536145},{x:.10926175445642904,y:.6016335789630078},{x:.10082006449072577,y:.6041943376181453},{x:.092041,y:.605059},{x:.08326193550927423,y:.6041943376181453},{x:.07482024554357093,y:.6016335789630078},{x:.06704033951411792,y:.5974751325536145},{x:.06022119484660536,y:.5918788051533946},{x:.05462486744638546,y:.5850596604858821},{x:.050466421036992094,y:.577279754456429},{x:.04790566238185463,y:.5688380644907257},{x:.047041,y:.560059},{x:.047041,y:.03920400000000002}]],o:[[{x:.021894999999999998,y:.25490100000000004},{x:.022142430975592695,y:.2523887911456351},{x:.02217771682540861,y:.24986467341374632},{x:.02257373987793045,y:.24800963837050735},{x:.02275966238185463,y:.24612193550927428},{x:.023492446675001572,y:.24370626943231966},{x:.02401948545822835,y:.2412375358426815},{x:.060310485458228355,y:.12735753584268142},{x:.06080304558444478,y:.12621387418764726},{x:.061129830312657105,y:.12501229639135567},{x:.06254436541764224,y:.12217075210694647},{x:.06379993607002282,y:.11925547753662338},{x:.06450614911208748,y:.11822988473324028},{x:.0650610709625847,y:.11711514745523491},{x:.06700278396163635,y:.114604164756607},{x:.06880297103068717,y:.11198985605258731},{x:.06969569761744246,y:.11112174505713},{x:.07045743125471368,y:.1101366870258529},{x:.14244943125471368,y:.0338456870258529},{x:.144568728324263,y:.03200109409682955},{x:.1465508815997487,y:.0300098604251366},{x:.14788834203377002,y:.029111770054614114},{x:.1491035320893312,y:.02805409342394511},{x:.1515419696884587,y:.026658398178569347},{x:.15387450686277807,y:.025092124424329433},{x:.22587150686277807,y:-.01360287557567049},{x:.22795933917571506,y:-.014473279294209745},{x:.22995424554357097,y:-.015539578963007873},{x:.23202067225559728,y:-.016166422653018674},{x:.2340138134199343,y:-.01699735024728135},{x:.23623133596214702,y:-.01744371352418634},{x:.23839593550927424,y:-.018100337618145335},{x:.2405449475487996,y:-.01831199682974963},{x:.24266189699648397,y:-.01873811583170923},{x:.2449238916202761,y:-.018743285176571887},{x:.247175,y:-.018964999999999968},{x:.354874,y:-.018964999999999968},{x:.35712497901801044,y:-.018743297917588594},{x:.3593868436844028,y:-.018738141970160445},{x:.36150392306047363,y:-.018312009573623896},{x:.3636530644907258,y:-.018100337618145335},{x:.36581753964743763,y:-.017443751257606326},{x:.36803493734305537,y:-.016997426474138877},{x:.370028203326089,y:-.016166460394901543},{x:.3720947544564291,y:-.015539578963007873},{x:.3740895461854217,y:-.014473340569958804},{x:.376177263560353,y:-.01360299896157894},{x:.448175263560353,y:.025092001038420984},{x:.4505076595021602,y:.026658160356610353},{x:.4529459593263057,y:.028053731854915283},{x:.45416130097157975,y:.029111510806286087},{x:.45549891730603415,y:.030009694621828502},{x:.4574809543881169,y:.03200078850323144},{x:.4596001404718476,y:.03384523318438343},{x:.5315941404718476,y:.11013623318438343},{x:.5323560786638525,y:.11112152750713142},{x:.5332490289693128,y:.11198985605258731},{x:.5350490398057314,y:.11460390882403626},{x:.5369905975332091,y:.11711461878219896},{x:.5375456739097991,y:.11822962771804991},{x:.5382520639299772,y:.11925547753662338},{x:.5395075116659538,y:.12217046671076734},{x:.5409219476918898,y:.12501171320336152},{x:.5412488309792026,y:.126213587584214},{x:.5417415145417717,y:.12735753584268142},{x:.5780325145417716,y:.2412375358426815},{x:.5785595533249983,y:.2437062694323195},{x:.5792923376181454,y:.24612193550927428},{x:.5794782601220696,y:.2480096383705079},{x:.5798742831745913,y:.24986467341374632},{x:.5799095690244073,y:.25238879114563434},{x:.580157,y:.25490100000000004},{x:.580157,y:.33119200000000004},{x:.5799156873690254,y:.3336420882589673},{x:.5798881240960263,y:.3361038771468651},{x:.5794843860383102,y:.3380211641581212},{x:.5792923376181454,y:.33997106449072584},{x:.5785776732343003,y:.3423269972319261},{x:.5780703683949873,y:.3447361062088315},{x:.5417793683949873,y:.4597211062088315},{x:.5412650895934552,y:.4609244011905288},{x:.540921633437906,y:.46218711230867804},{x:.5395351283421765,y:.46497211555478546},{x:.5383124760126231,y:.46783284286481475},{x:.5375733277285976,y:.46891268605384906},{x:.5369901282681178,y:.47008412955994733},{x:.5350869372989228,y:.47254512602400234},{x:.5333296776789325,y:.47511235762423976},{x:.5323940649664491,y:.4760272512524403},{x:.5315935342292432,y:.47706240922950055},{x:.45959953422924316,y:.5533504092295005},{x:.4572787448447235,y:.5553702403350376},{x:.45508230823461715,y:.5575246421731296},{x:.45395838697349994,y:.5582600166131206},{x:.4529452394037514,y:.5591417799431011},{x:.45027499383570063,y:.5606700370119551},{x:.44770045819082444,y:.5623545390972755},{x:.3757024581908245,y:.5999485390972755},{x:.37385313535723513,y:.6006937047902838},{x:.3720947544564291,y:.6016335789630078},{x:.36977177563531344,y:.6023382468844833},{x:.3675201821794923,y:.6032455034042244},{x:.36556101895058973,y:.6036155659602718},{x:.3636530644907258,y:.6041943376181453},{x:.36123724716457173,y:.6044322748568528},{x:.35885192047906295,y:.6048828346046191},{x:.35685820639902277,y:.60486357272721},{x:.354874,y:.605059},{x:.247175,y:.605059},{x:.24519066624232813,y:.6048635601834779},{x:.24319682408363533,y:.6048828119349353},{x:.24081162559758007,y:.6044322623250186},{x:.23839593550927424,y:.6041943376181453},{x:.23648785858508298,y:.6036155288111242},{x:.234528571713998,y:.6032454313367869},{x:.23227710201651716,y:.602338209770572},{x:.22995424554357097,y:.6016335789630078},{x:.2281957517789948,y:.6006936444633418},{x:.22634631449119302,y:.5999484204015954},{x:.15434931449119302,y:.5623544204015953},{x:.15177463525955168,y:.5606698034147719},{x:.14910425200363037,y:.5591414183832311},{x:.14809125527340347,y:.55825976164439},{x:.1469674919716301,y:.5575244814106152},{x:.14477093694990967,y:.5553699388664325},{x:.14245003748743465,y:.5533499553954043},{x:.07045803748743465,y:.4770619553954044},{x:.06965771196430402,y:.47602703312304784},{x:.06872232232106745,y:.47511235762423976},{x:.06696488716695402,y:.4725448695811053},{x:.06506154021654398,y:.4700836008922148},{x:.0644784960433022,y:.46891242859710086},{x:.06373952398737684,y:.46783284286481475},{x:.06251674952606694,y:.46497182979435886},{x:.06113014455468816,y:.46218652912371366},{x:.06078678779193787,y:.46092411430034236},{x:.06027263160501272,y:.4597211062088315},{x:.023981631605012717,y:.3447361062088315},{x:.0234743267656997,y:.3423269972319261},{x:.02275966238185463,y:.33997106449072584},{x:.0225676139616898,y:.3380211641581212},{x:.022163875903973694,y:.3361038771468651},{x:.022136312630974576,y:.33364208825896713},{x:.021894999999999998,y:.33119200000000004},{x:.021894999999999998,y:.25490100000000004}],[{x:.111895,y:.2618978965790472},{x:.111895,y:.324259211613835},{x:.14299436878278687,y:.42279496206129447},{x:.20271328316555492,y:.48607750096051383},{x:.25821631520114247,y:.5150589999999999},{x:.3438328207386419,y:.5150589999999999},{x:.3993370917152178,y:.4860772565752743},{x:.4590577300605173,y:.42279464888454726},{x:.490157,y:.324259211613835},{x:.490157,y:.2618978965790472},{x:.4591028039244665,y:.16445082019422033},{x:.39914727445977055,y:.10091681321598435},{x:.3435475642149213,y:.07103500000000003},{x:.2585015743575747,y:.07103500000000003},{x:.20290309936793577,y:.10091656436690524},{x:.14294929572583875,y:.164450507494742},{x:.111895,y:.2618978965790472}]],p:[[{x:.031904,y:-.15424400000000005},{x:.032768662381854635,y:-.16302306449072582},{x:.0353294210369921,y:-.17146475445642909},{x:.03948786744638546,y:-.17924466048588214},{x:.04508419484660536,y:-.18606380515339468},{x:.051903339514117915,y:-.19166013255361458},{x:.05968324554357096,y:-.19581857896300794},{x:.06812493550927423,y:-.1983793376181454},{x:.076904,y:-.19924400000000003},{x:.08568306449072577,y:-.1983793376181454},{x:.09412475445642904,y:-.19581857896300794},{x:.1019046604858821,y:-.19166013255361458},{x:.10872380515339464,y:-.18606380515339468},{x:.11432013255361453,y:-.17924466048588214},{x:.1184785789630079,y:-.17146475445642909},{x:.12103933761814537,y:-.16302306449072582},{x:.121904,y:-.15424400000000005},{x:.121904,y:.08461372659928788},{x:.12362832174470662,y:.08333438131496537},{x:.12536021772829115,y:.08178035235824195},{x:.1271620685101291,y:.08071254912256186},{x:.12884414120453105,y:.07946455014784792},{x:.13094744853162613,y:.07846927732892851},{x:.13294924262910485,y:.07728298474798974},{x:.20690724262910487,y:.04275398474798971},{x:.20784573679964677,y:.04242345923251374},{x:.20872324554357097,y:.041954421036992075},{x:.21199903754957586,y:.040960720395783044},{x:.21522783943974558,y:.03982357810698025},{x:.21621278303720604,y:.03968249467654502},{x:.21716493550927424,y:.0393936623818546},{x:.22057164546850772,y:.03905813073713887},{x:.2239602522910248,y:.038572746319036566},{x:.22495379448531613,y:.03862652673075318},{x:.225944,y:.038528999999999966},{x:.338005,y:.038528999999999966},{x:.33886621477794643,y:.03861382225207184},{x:.3397300481447032,y:.038562076501738984},{x:.34324908380057223,y:.0390454971728409},{x:.3467840644907258,y:.0393936623818546},{x:.3476121832677305,y:.039644869466491955},{x:.3484695134136621,y:.03976264352593092},{x:.35182662109175783,y:.04092330520367998},{x:.35522575445642907,y:.04195442103699206},{x:.3559889530923063,y:.042362359206810904},{x:.35680683330070073,y:.04264512708496585},{x:.4318888333007007,y:.07717412708496588},{x:.43400924312431544,y:.07841428389434572},{x:.43622962614931016,y:.07946501028796468},{x:.4378075563324746,y:.08063579029221077},{x:.43950360927818305,y:.0816277549521855},{x:.44134133343031445,y:.08325775393151234},{x:.4433140658676044,y:.08472146615145025},{x:.5183930658676044,y:.1527974661514503},{x:.519792625068414,y:.15434228537837358},{x:.5213447099268285,y:.1557337827706549},{x:.522746916505161,y:.1576032022519019},{x:.5243158963961404,y:.15933502631539204},{x:.52538718417891,y:.1611232027292085},{x:.5266379784876352,y:.1627907596241023},{x:.5276485364111687,y:.16489781566710873},{x:.5288495066792682,y:.16690245600899573},{x:.5295513540552914,y:.16886527099294393},{x:.530452790490496,y:.17074480411415546},{x:.5674347904904959,y:.2723648041141554},{x:.5682868803844835,y:.2756900562357905},{x:.5692833376181453,y:.27897493550927416},{x:.5693799285821196,y:.2799556400244087},{x:.5696245448495124,y:.2809102467717411},{x:.5698115375679212,y:.2843378395980749},{x:.570148,y:.28775399999999995},{x:.570148,y:.355831},{x:.5698183264321395,y:.3591782319067787},{x:.5696454905753794,y:.362537215959393},{x:.5693867528695432,y:.3635600718226051},{x:.5692833376181453,y:.3646100644907258},{x:.5683069860848939,y:.3678286641524751},{x:.567482165940186,y:.37108938766543825},{x:.530500165940186,y:.47369538766543823},{x:.5295747233109523,y:.4756403735939819},{x:.5288495066792682,y:.4776685439910043},{x:.5276841925618525,y:.47961366765708685},{x:.5267099630491849,y:.4816611880905031},{x:.5254228546094585,y:.48338825675926556},{x:.5243158963961404,y:.48523597368460797},{x:.5227934986603558,y:.48691638083844907},{x:.5214385372739072,y:.48873449599152474},{x:.5198392258792078,y:.49017727712011666},{x:.5183930658676044,y:.4917735338485497},{x:.4433140658676044,y:.5598495338485497},{x:.44114571117720175,y:.5614583923016819},{x:.43910641435493325,y:.5632279843609703},{x:.43761161896162687,y:.5640805897495177},{x:.43622962614931016,y:.5651059897120353},{x:.43378906307257026,y:.5662609093863238},{x:.43144372048223223,y:.5675986521566495},{x:.35636172048223225,y:.6011446521566495},{x:.355773047491519,y:.6013410447411239},{x:.35522575445642907,y:.6016335789630078},{x:.3515938477815883,y:.6027353058079922},{x:.3479935881359665,y:.6039364213810477},{x:.34737791203915763,y:.6040141959337602},{x:.3467840644907258,y:.6041943376181453},{x:.34300700763927916,y:.6045663452480041},{x:.3392415999493003,y:.6050420059085138},{x:.33862258083352115,y:.60499817359702},{x:.338005,y:.605059},{x:.225944,y:.605059},{x:.2251997336627212,y:.6049856961639699},{x:.22445344765540867,y:.6050343071552383},{x:.22081614914993766,y:.6045539507735711},{x:.21716493550927424,y:.6041943376181453},{x:.21644927090994795,y:.6039772431353645},{x:.21570784104506457,y:.6038793269025836},{x:.2122341450916469,y:.6026985986973952},{x:.20872324554357097,y:.6016335789630078},{x:.20806368527139987,y:.6012810366527016},{x:.20735560428285457,y:.6010403560617851},{x:.13339760428285458,y:.5674943560617851},{x:.13116986982932302,y:.566206971138138},{x:.12884414120453105,y:.5651064498521521},{x:.1273598902040749,y:.5640052229355318},{x:.12575970914356202,y:.5630804946901414},{x:.12382593632220404,y:.5613832370749092},{x:.121904,y:.5599572734007121},{x:.121904,y:.560059},{x:.12103933761814537,y:.5688380644907257},{x:.1184785789630079,y:.577279754456429},{x:.11432013255361453,y:.5850596604858821},{x:.10872380515339464,y:.5918788051533946},{x:.10190466048588208,y:.5974751325536145},{x:.09412475445642904,y:.6016335789630078},{x:.08568306449072577,y:.6041943376181453},{x:.076904,y:.605059},{x:.0681249355092742,y:.6041943376181453},{x:.059683245543570934,y:.6016335789630078},{x:.051903339514117915,y:.5974751325536145},{x:.04508419484660536,y:.5918788051533946},{x:.03948786744638546,y:.5850596604858821},{x:.0353294210369921,y:.577279754456429},{x:.032768662381854635,y:.5688380644907257},{x:.031904,y:.560059},{x:.031904,y:-.15424400000000005}],[{x:.121904,y:.20607608160839302},{x:.121904,y:.438494918391607},{x:.17699192809119763,y:.48844251958412144},{x:.23567259519301437,y:.5150589999999999},{x:.3284092961747297,y:.5150589999999999},{x:.38817711429028284,y:.4883552464171925},{x:.4496333594179428,y:.43263133769024387},{x:.48014799999999996,y:.3479689286382035},{x:.48014799999999996,y:.29568777567179994},{x:.44968806913177495,y:.21198926897045803},{x:.3879916447872207,y:.1560475837631447},{x:.32815352882369925,y:.12852899999999995},{x:.2359312215606538,y:.12852899999999995},{x:.17717907548697515,y:.15595879598931894},{x:.121904,y:.20607608160839302}]],q:[[{x:.031905,y:.285813},{x:.03224141038262204,y:.2823973680650777},{x:.0324282929389951,y:.2789703010434802},{x:.03267301908894614,y:.2780151713289937},{x:.032769662381854636,y:.2770339355092742},{x:.03376596546737772,y:.2737495643941025},{x:.03461784473664685,y:.27042480648246636},{x:.07159784473664685,y:.1688028064824664},{x:.0724995244823713,y:.166922651750872},{x:.0732016076706368,y:.1649592141085361},{x:.07440224792307432,y:.1629551516523985},{x:.07541246819615938,y:.16084867156853302},{x:.07666362241043057,y:.15918055247485355},{x:.0777352629490018,y:.15739181137154173},{x:.07930380642556048,y:.15566048970702676},{x:.08070556947724908,y:.15379156924569237},{x:.08225811700526783,y:.15239959067120604},{x:.08365813234923056,y:.15085428642438087},{x:.15873913234923054,y:.08277728642438094},{x:.16071062555900373,y:.0813145118522212},{x:.16254708404197357,y:.07968542770293169},{x:.16424441690754124,y:.07869257021816739},{x:.16582360332185575,y:.07752087268448676},{x:.16804258800473576,y:.07647082416071167},{x:.17016157800418052,y:.07523131768336211},{x:.24523757800418056,y:.0406993176833621},{x:.24605678866737324,y:.04041603175027397},{x:.24682124554357093,y:.04000742103699214},{x:.2502190216384501,y:.03897671692697023},{x:.2535747153580455,y:.03781630621794852},{x:.25443345146196317,y:.037698283616711674},{x:.2552629355092742,y:.03744666238185468},{x:.25879650468596477,y:.037098636194782805},{x:.2623141045905799,y:.03661518582049534},{x:.2631793653883337,y:.03666696209348752},{x:.264042,y:.036582000000000045},{x:.376106,y:.036582000000000045},{x:.3770966034546813,y:.036679565924422064},{x:.37809054588497415,y:.03662578154659327},{x:.38147875036256007,y:.037111169723096304},{x:.3848850644907258,y:.03744666238185468},{x:.3858375996101805,y:.03773561075136079},{x:.38682293652697,y:.03787676837406198},{x:.39005134306992567,y:.03901383585544661},{x:.39332675445642906,y:.04000742103699214},{x:.39420461585020444,y:.04047664772778637},{x:.3951434813083616,y:.04080732274273922},{x:.4691044813083616,y:.07533932274273922},{x:.47110618065167786,y:.07652560719175487},{x:.47320939667814427,y:.07752087268448679},{x:.4748915208069018,y:.0787689461703934},{x:.4766934263594154,y:.07983682509171056},{x:.47842523099597173,y:.08139082758714347},{x:.48014799999999996,y:.08266905805748193},{x:.48014799999999996,y:-.15619500000000008},{x:.4810126623818546,y:-.16497406449072585},{x:.483573421036992,y:-.17341575445642912},{x:.4877318674463854,y:-.18119566048588218},{x:.4933281948466053,y:-.18801480515339472},{x:.5001473395141178,y:-.19361113255361462},{x:.5079272455435709,y:-.19776957896300798},{x:.5163689355092742,y:-.20033033761814545},{x:.525148,y:-.20119500000000007},{x:.5339270644907257,y:-.20033033761814545},{x:.542368754456429,y:-.19776957896300798},{x:.5501486604858821,y:-.19361113255361462},{x:.5569678051533946,y:-.18801480515339472},{x:.5625641325536145,y:-.18119566048588218},{x:.5667225789630078,y:-.17341575445642912},{x:.5692833376181453,y:-.16497406449072585},{x:.570148,y:-.15619500000000008},{x:.570148,y:.5581050000000001},{x:.5692833376181453,y:.5668840644907258},{x:.5667225789630078,y:.5753257544564291},{x:.5625641325536145,y:.5831056604858822},{x:.5569678051533946,y:.5899248051533947},{x:.5501486604858821,y:.5955211325536146},{x:.542368754456429,y:.5996795789630079},{x:.5339270644907257,y:.6022403376181454},{x:.525148,y:.6031050000000001},{x:.5163689355092742,y:.6022403376181454},{x:.5079272455435709,y:.5996795789630079},{x:.5001473395141178,y:.5955211325536146},{x:.4933281948466053,y:.5899248051533947},{x:.4877318674463854,y:.5831056604858822},{x:.483573421036992,y:.5753257544564291},{x:.4810126623818546,y:.5668840644907258},{x:.48014799999999996,y:.5581050000000001},{x:.48014799999999996,y:.558005596763998},{x:.4782247267606458,y:.559432223348863},{x:.47629232280480055,y:.5611281889595863},{x:.4746904859851039,y:.5620538174856352},{x:.4732046002880372,y:.5631560030691136},{x:.4708804506539088,y:.5642554633364756},{x:.4686543108210992,y:.5655418481335316},{x:.3946933108210992,y:.5990868481335316},{x:.3939857884552202,y:.5993273179516839},{x:.39332675445642906,y:.5996795789630079},{x:.3898152875083263,y:.6007447708163117},{x:.38634099890642704,y:.6019255978665906},{x:.3856001580501581,y:.6020234163584227},{x:.3848850644907258,y:.6022403376181454},{x:.38123326077373504,y:.6026000088910167},{x:.3775953617236344,y:.6030803465985108},{x:.3768496724756141,y:.6030317546542387},{x:.376106,y:.6031050000000001},{x:.264042,y:.6031050000000001},{x:.26342400033164626,y:.6030441323453897},{x:.26280456058717394,y:.6030879828235033},{x:.25903957642572706,y:.602612304281983},{x:.2552629355092742,y:.6022403376181454},{x:.254668685221597,y:.6020600737641458},{x:.25405259303422617,y:.6019822349683996},{x:.25045275226756825,y:.6007811844842303},{x:.24682124554357093,y:.5996795789630079},{x:.24627358134186672,y:.5993868463484354},{x:.24568451278884912,y:.5991903095800973},{x:.17060851278884911,y:.5656453095800973},{x:.16826609518471405,y:.5643091772352096},{x:.16582839971196278,y:.5631560030691136},{x:.1644435861855132,y:.5621287897998347},{x:.16294590048199914,y:.5612744987855388},{x:.1609091582647261,y:.559507056844315},{x:.15874327554635076,y:.5579004698017108},{x:.08366227554635075,y:.4898404698017108},{x:.0822135909199537,y:.48824184486316324},{x:.08061175169940471,y:.4867967151276658},{x:.07925889408089541,y:.48498133393711457},{x:.07773859373239328,y:.48330368097737925},{x:.0766296214289207,y:.4814531488185024},{x:.0753404919252871,y:.4797232835162987},{x:.07436779238761855,y:.4776788549378484},{x:.07320399804016177,y:.47573684172476444},{x:.07247735524331753,y:.47370551725863386},{x:.07155047598047157,y:.4717573941431678},{x:.034570475980471575,y:.3691493941431678},{x:.03374586128764337,y:.36588916100716024},{x:.032769662381854636,y:.3626710644907258},{x:.032666195333495754,y:.36162054591923504},{x:.032407352052251925,y:.36059717166956007},{x:.03223462203187315,y:.35723870865311785},{x:.031905,y:.353892},{x:.031905,y:.285813}],[{x:.121905,y:.2937462257558374},{x:.121905,y:.3460304727958324},{x:.1524170009298456,y:.4306917867874386},{x:.21387346155335435,y:.48640130996954867},{x:.2736381428091649,y:.513105},{x:.36637802828147564,y:.513105},{x:.4250638403772601,y:.4864880590885319},{x:.48014799999999996,y:.4365549481293854},{x:.48014799999999996,y:.20413270643748072},{x:.4248733312055972,y:.15401438585682045},{x:.36611835928516706,y:.12658200000000003},{x:.27389496414813935,y:.12658200000000003},{x:.2140623112166411,y:.15410266134357853},{x:.15236330162501277,y:.21004602219345103},{x:.121905,y:.2937462257558374}]],r:[[{x:.062422000000000005,y:.03920400000000002},{x:.06328666238185464,y:.030424935509274227},{x:.0658474210369921,y:.02198324554357097},{x:.07000586744638546,y:.01420333951411792},{x:.07560219484660537,y:.00738419484660538},{x:.08242133951411793,y:.0017878674463854757},{x:.09020124554357097,y:-.002370578963007887},{x:.09864293550927423,y:-.004931337618145348},{x:.107422,y:-.005795999999999982},{x:.11620106449072577,y:-.004931337618145348},{x:.12464275445642904,y:-.002370578963007887},{x:.1324226604858821,y:.0017878674463854827},{x:.13924180515339463,y:.00738419484660538},{x:.14483813255361455,y:.01420333951411792},{x:.14899657896300791,y:.02198324554357098},{x:.15155733761814538,y:.030424935509274248},{x:.152422,y:.03920400000000002},{x:.152422,y:.3275398012121413},{x:.1925108808296549,y:.4204278633799401},{x:.27478075869941443,y:.4836647262821032},{x:.3576648607132649,y:.5150589999999999},{x:.49463,y:.5150589999999999},{x:.5034090644907258,y:.5159236623818546},{x:.511850754456429,y:.5184844210369921},{x:.5196306604858821,y:.5226428674463854},{x:.5264498051533947,y:.5282391948466053},{x:.5320461325536145,y:.5350583395141179},{x:.5362045789630079,y:.542838245543571},{x:.5387653376181454,y:.5512799355092742},{x:.53963,y:.560059},{x:.5387653376181454,y:.5688380644907257},{x:.5362045789630079,y:.577279754456429},{x:.5320461325536145,y:.5850596604858821},{x:.5264498051533947,y:.5918788051533946},{x:.5196306604858821,y:.5974751325536145},{x:.511850754456429,y:.6016335789630078},{x:.5034090644907258,y:.6041943376181453},{x:.49463,y:.605059},{x:.349428,y:.605059},{x:.34572095329292224,y:.6046938877675093},{x:.3420044651532413,y:.6044424555930356},{x:.34133700376168824,y:.6042621064259311},{x:.3406489355092742,y:.6041943376181453},{x:.33708434852821606,y:.6031130319790114},{x:.33348832364990477,y:.6021413801353276},{x:.23668632364990477,y:.5654753801353276},{x:.2347311434313091,y:.5645060813254815},{x:.23268939209293205,y:.5637356779621759},{x:.23078888495220712,y:.562551669954317},{x:.22878273496962892,y:.5615571024090896},{x:.2270542238076375,y:.5602249916656349},{x:.22520200238894322,y:.5590710654608507},{x:.152422,y:.5031286093364514},{x:.152422,y:.560059},{x:.15155733761814538,y:.5688380644907257},{x:.14899657896300791,y:.577279754456429},{x:.14483813255361455,y:.5850596604858821},{x:.13924180515339463,y:.5918788051533946},{x:.1324226604858821,y:.5974751325536145},{x:.12464275445642904,y:.6016335789630078},{x:.11620106449072577,y:.6041943376181453},{x:.107422,y:.605059},{x:.09864293550927423,y:.6041943376181453},{x:.09020124554357094,y:.6016335789630078},{x:.08242133951411793,y:.5974751325536145},{x:.07560219484660537,y:.5918788051533946},{x:.07000586744638546,y:.5850596604858821},{x:.0658474210369921,y:.577279754456429},{x:.06328666238185464,y:.5688380644907257},{x:.062422000000000005,y:.560059},{x:.062422000000000005,y:.03920400000000002}]],s:[[{x:.056563,y:.369888},{x:.056809270227573656,y:.3673875764180495},{x:.05684306423764694,y:.36487528163458033},{x:.05724057756471223,y:.36300843953465567},{x:.057427662381854636,y:.3611089355092742},{x:.05815700903783985,y:.3587046018033244},{x:.05868027810379197,y:.35624717294397146},{x:.05943435615016931,y:.3544937526945111},{x:.0599884210369921,y:.352667245543571},{x:.06117281573842168,y:.3504513989095756},{x:.06216545092350078,y:.34814327358726177},{x:.06324711489275962,y:.3465706581451233},{x:.06414686744638545,y:.3448873395141179},{x:.06574079456909979,y:.3429451336955602},{x:.0671646494598194,y:.3408750118720105},{x:.06853233161222538,y:.3395436359667022},{x:.06974319484660536,y:.33806819484660533},{x:.07168540066516299,y:.33647426772389105},{x:.07348575731657993,y:.3347217030198468},{x:.07508689839402109,y:.33368273068076537},{x:.07656233951411792,y:.33247186744638546},{x:.07877818614811302,y:.331287472744956},{x:.08088585786376518,y:.3299198152391437},{x:.15568385786376518,y:.29122381523914376},{x:.1574569269125657,y:.29051717359061785},{x:.15914024554357095,y:.2896174210369921},{x:.16154457924952065,y:.28888807438100694},{x:.16387856938737105,y:.2879578823843842},{x:.16575542835833412,y:.2876107272686775},{x:.16758193550927422,y:.2870566623818547},{x:.17008235909122482,y:.286810392154281},{x:.17255297371919248,y:.2863534124236203},{x:.17446149597461844,y:.28637908481714247},{x:.176361,y:.28619200000000006},{x:.288347309340128,y:.28619200000000006},{x:.3974525128623667,y:.21942256309828728},{x:.45549,y:.1602321160680505},{x:.45549,y:.13007078589845048},{x:.407404042616179,y:.10590438131127383},{x:.31753214348357883,y:.07103500000000003},{x:.21224543978224936,y:.07103500000000003},{x:.16354378174687056,y:.09622932957230687},{x:.14433666195924297,y:.15500005013212306},{x:.1407876006468136,y:.16307617408904287},{x:.13573115992893667,y:.17030473007440486},{x:.12936165598671553,y:.1764079287355125},{x:.12192386528459082,y:.18115122757053267},{x:.11370361794808405,y:.18435234426530817},{x:.10501681347236942,y:.18588826170046568},{x:.09619728088183255,y:.18569995543032455},{x:.08758394986787689,y:.1837946619592429},{x:.07950782591095708,y:.18024560064681355},{x:.07227926992559508,y:.1751891599289366},{x:.06617607126448745,y:.1688196559867155},{x:.06143277242946728,y:.16138186528459075},{x:.05823165573469179,y:.153161617948084},{x:.05669573829953427,y:.14447481347236937},{x:.0568840445696754,y:.1356552808818325},{x:.05878933804075704,y:.12704194986787684},{x:.08372233804075704,y:.050750949867876836},{x:.08542587043333498,y:.04687444913825993},{x:.08709879890390285,y:.042984643121031924},{x:.08719974017890864,y:.04283789110571456},{x:.0872713993531864,y:.04267482591095703},{x:.0896984666241539,y:.03920515373890898},{x:.0920981137517354,y:.03571646140762123},{x:.09222574536637099,y:.03559222185697407},{x:.09232784007106334,y:.035446269925595034},{x:.09538517138631239,y:.032516763866873036},{x:.0984193200775319,y:.02956325371133576},{x:.09856873722042347,y:.029466301081615798},{x:.09869734401328446,y:.029343071264487396},{x:.10226744784494098,y:.027066310594042624},{x:.10581949746716537,y:.024761484353185106},{x:.18061849746716538,y:-.013933515646814817},{x:.1823912439162618,y:-.014639995851387814},{x:.18407424554357094,y:-.01553957896300786},{x:.18647892276401756,y:-.016269029822976466},{x:.18881326125361947,y:-.017199317363260178},{x:.19068977232738848,y:-.017546377073194466},{x:.1925159355092742,y:-.018100337618145335},{x:.19501671633437545,y:-.018346643031098245},{x:.19748769126025723,y:-.018803648509519946},{x:.19939585369049342,y:-.018777950414796084},{x:.201295,y:-.018964999999999968},{x:.325956,y:-.018964999999999968},{x:.3298421413721484,y:-.018582248482612737},{x:.33373593654739714,y:-.01828737118339306},{x:.334227355251249,y:-.018150342613638803},{x:.3347350644907258,y:-.018100337618145335},{x:.33847186362931597,y:-.016966791992147238},{x:.34223331291484477,y:-.015917938922943478},{x:.44196531291484475,y:.022777061077056446},{x:.44388622686678575,y:.02374867869889352},{x:.4458951331158935,y:.02452214291663178},{x:.5206971331158935,y:.06211514291663188},{x:.5230429253028388,y:.06359852573319036},{x:.5254906604858821,y:.06490686744638552},{x:.526762463529903,y:.06595060923072474},{x:.5281530225051898,y:.06682994172267823},{x:.5301643473216751,y:.06874246310749585},{x:.5323098051533947,y:.07050319484660542},{x:.5333535469377338,y:.07177499789062616},{x:.5345458374532134,y:.07290871885358566},{x:.536145400814505,y:.07517688168239829},{x:.5379061325536145,y:.07732233951411796},{x:.538681702666837,y:.0787733291400739},{x:.5396299056666436,y:.08011787031323085},{x:.5407562372498129,y:.08265451036052812},{x:.5420645789630079,y:.08510224554357101},{x:.5425421726806072,y:.08667666103386074},{x:.5432098492552168,y:.08818035245395842},{x:.5438196647691762,y:.09088798806528645},{x:.5446253376181454,y:.09354393550927428},{x:.5447866012813922,y:.09518127295954937},{x:.5451480929944793,y:.09678632860859225},{x:.545217957571016,y:.09956090686586556},{x:.54549,y:.10232300000000005},{x:.54549,y:.17861300000000002},{x:.5450792542455133,y:.1827833716312913},{x:.5447095428008049,y:.18695758114513777},{x:.5446471218945653,y:.18717088502046353},{x:.5446253376181454,y:.1873920644907258},{x:.5434088850836819,y:.19140217107899518},{x:.5422319296624953,y:.19542404720269643},{x:.5421290946347417,y:.1956210747891699},{x:.5420645789630079,y:.19583375445642906},{x:.5400891672372728,y:.199529489854385},{x:.5381501975764,y:.20324447414399938},{x:.5380109003195782,y:.20341765378196683},{x:.5379061325536145,y:.20361366048588211},{x:.5352476756014034,y:.20685299965477524},{x:.5326212052175259,y:.21011832734743824},{x:.45781920521752584,y:.28640632734743826},{x:.45695946559173245,y:.28712616331644525},{x:.45621413415776596,y:.2879638966272176},{x:.45358375241990234,y:.28995255364350675},{x:.45105542866152953,y:.29206944848930627},{x:.4500717756605794,y:.29260772613156716},{x:.4491773318997613,y:.2932839556822147},{x:.3245133318997613,y:.3695749556822147},{x:.3213472249094816,y:.3711082739568931},{x:.3182447544564291,y:.37276657896300797},{x:.31738368821196916,y:.37302778055263114},{x:.3165738477898179,y:.3734199792757539},{x:.31316944110160955,y:.3743061584374605},{x:.3098030644907258,y:.3753273376181454},{x:.3089075854904768,y:.3754155346015568},{x:.3080367917497669,y:.3756422053074494},{x:.30452491480344407,y:.37584718998797495},{x:.301024,y:.376192},{x:.18731182116617404,y:.376192},{x:.146563,y:.397272996602132},{x:.146563,y:.42779681790574337},{x:.20153437253410483,y:.48386323770148376},{x:.2842918489876165,y:.5150589999999999},{x:.39008456648169626,y:.5150589999999999},{x:.4553477907191711,y:.4822576837794137},{x:.4635801440629335,y:.47908783003036465},{x:.47227272283422006,y:.4775849365970516},{x:.4810914761057044,y:.47780675883128426},{x:.48969750413477736,y:.47974477222900047},{x:.4977600820905977,y:.48332450002217653},{x:.5049693696238691,y:.488408375279255},{x:.5110483178577028,y:.4948010275251766},{x:.5157633162205862,y:.5022567907191711},{x:.5189331699696352,y:.5104891440629334},{x:.5204360634029483,y:.51918172283422},{x:.5202142411687157,y:.5280004761057044},{x:.5182762277709995,y:.5366065041347774},{x:.5146964999778234,y:.5446690820905977},{x:.509612624720745,y:.551878369623869},{x:.5032199724748234,y:.5579573178577029},{x:.49576420928082887,y:.5626723162205862},{x:.42096520928082887,y:.6002663162205862},{x:.41942927464851043,y:.6008577252562829},{x:.41797775445642904,y:.6016335789630078},{x:.4153223812886681,y:.6024390776071881},{x:.41273285593706643,y:.6034361699696352},{x:.41111105567880996,y:.6037165692645292},{x:.40953606449072577,y:.6041943376181453},{x:.40677456858393113,y:.6044663212253706},{x:.4040402771657799,y:.6049390634029483},{x:.4023949361559939,y:.6048976773693867},{x:.400757,y:.605059},{x:.276092,y:.605059},{x:.2724204350331364,y:.6046973824138966},{x:.26873912724910987,y:.6044542166602351},{x:.2680367190736708,y:.6042656240771296},{x:.2673129355092742,y:.6041943376181453},{x:.2637824667250502,y:.6031233816208718},{x:.26021933352302795,y:.6021667007079561},{x:.1604883335230279,y:.5645727007079561},{x:.15963695838633216,y:.5641523105976027},{x:.15873109713512196,y:.563867735718488},{x:.15568848233041307,y:.5622026409240001},{x:.1525785174681621,y:.5606670094317409},{x:.15182551530799093,y:.5600886019499048},{x:.15099257773152036,y:.559632770334096},{x:.14833326979676884,y:.5574060851671644},{x:.1455826488796249,y:.5552932363569977},{x:.14495695714670492,y:.554579039378831},{x:.14422895256892138,y:.5539694683796904},{x:.06943095256892137,y:.47768146837969044},{x:.06680494464711424,y:.4744165369262552},{x:.06414686744638545,y:.4711776604858821},{x:.0640418150384659,y:.470981121254323},{x:.0639021439692389,y:.47080746737336276},{x:.06196355058191934,y:.4670929619312254},{x:.0599884210369921,y:.46339775445642906},{x:.05992373008360734,y:.46318449696300446},{x:.05982062094636722,y:.462986931318802},{x:.05864394115023422,y:.4589655982489849},{x:.057427662381854636,y:.45495606449072584},{x:.05740581892006417,y:.454734284101312},{x:.05734323414113077,y:.4545203990307778},{x:.05697368708086039,y:.4503467759079653},{x:.056563,y:.44617700000000005},{x:.056563,y:.369888}]],t:[[{x:.036055000000000004,y:.484201},{x:.03691966238185464,y:.4754219355092742},{x:.0394804210369921,y:.466980245543571},{x:.04363886744638546,y:.4592003395141179},{x:.049235194846605365,y:.45238119484660533},{x:.05605433951411792,y:.44678486744638546},{x:.06383424554357096,y:.44262642103699207},{x:.07227593550927423,y:.4400656623818546},{x:.081055,y:.439201},{x:.201032,y:.439201},{x:.201032,y:.17345100000000002},{x:.2013458215844704,y:.17026471598156256},{x:.20148726326025637,y:.1670661406603643},{x:.20177732050748418,y:.165883633894134},{x:.20189666238185464,y:.16467193550927425},{x:.20282606714776777,y:.16160809859877695},{x:.20358880215081968,y:.15849857690755997},{x:.20410398165518515,y:.15739537903902878},{x:.2044574210369921,y:.15623024554357098},{x:.20596669248041014,y:.15340659727526443},{x:.20732140933230742,y:.15050562638878262},{x:.2623124093323074,y:.05773162638878261},{x:.2645408071528226,y:.05469603003381387},{x:.2666808493837164,y:.051597510818645845},{x:.2671477670132535,y:.051144744093296994},{x:.26753264280400524,y:.05062045370997057},{x:.2703104380556505,y:.04807792433615628},{x:.27301385108661325,y:.04545644382682572},{x:.2735601274310704,y:.04510346799784869},{x:.2740398919211364,y:.04466433724917905},{x:.27726033549019774,y:.04271258283448707},{x:.28042322867453984,y:.040668883056825214},{x:.28102787064035484,y:.04042926278737637},{x:.28158408674943697,y:.04009216722176761},{x:.28512341879560005,y:.038806192593798694},{x:.288624243922019,y:.03741881178414046},{x:.39861224392201905,y:.005893811784140432},{x:.4004470188387682,y:.005558110934368086},{x:.4022319355092743,y:.0050166623818546086},{x:.4047755505163489,y:.004766138170207483},{x:.4072897364122725,y:.0043061284251197166},{x:.4091547486303562,y:.0043348248023798485},{x:.411011,y:.004151999999999975},{x:.520997,y:.004151999999999975},{x:.5297760644907258,y:.0050166623818546086},{x:.538217754456429,y:.00757742103699207},{x:.5459976604858822,y:.011735867446385433},{x:.5528168051533947,y:.017332194846605337},{x:.5584131325536146,y:.02415133951411788},{x:.5625715789630079,y:.031931245543570935},{x:.5651323376181454,y:.040372935509274205},{x:.5659970000000001,y:.049151999999999973},{x:.5651323376181454,y:.05793106449072574},{x:.5625715789630079,y:.06637275445642901},{x:.5584131325536146,y:.07415266048588207},{x:.5528168051533947,y:.08097180515339461},{x:.5459976604858822,y:.08656813255361451},{x:.538217754456429,y:.09072657896300787},{x:.5297760644907258,y:.09328733761814534},{x:.520997,y:.09415199999999997},{x:.41733272532416527,y:.09415199999999997},{x:.33061421916568134,y:.11900744701827656},{x:.291032,y:.1857856616511605},{x:.291032,y:.439201},{x:.466004,y:.439201},{x:.47478306449072577,y:.4400656623818546},{x:.48322475445642904,y:.44262642103699207},{x:.4910046604858821,y:.44678486744638546},{x:.49782380515339464,y:.45238119484660533},{x:.5034201325536145,y:.4592003395141179},{x:.5075785789630078,y:.466980245543571},{x:.5101393376181453,y:.4754219355092742},{x:.511004,y:.484201},{x:.5101393376181453,y:.4929800644907258},{x:.5075785789630078,y:.501421754456429},{x:.5034201325536145,y:.5092016604858821},{x:.49782380515339464,y:.5160208051533947},{x:.4910046604858821,y:.5216171325536145},{x:.48322475445642904,y:.5257755789630079},{x:.47478306449072577,y:.5283363376181454},{x:.466004,y:.529201},{x:.291032,y:.529201},{x:.291032,y:.702148},{x:.2901673376181454,y:.7109270644907257},{x:.2876065789630079,y:.719368754456429},{x:.28344813255361456,y:.7271486604858821},{x:.27785180515339464,y:.7339678051533947},{x:.2710326604858821,y:.7395641325536145},{x:.26325275445642904,y:.7437225789630079},{x:.25481106449072577,y:.7462833376181454},{x:.246032,y:.747148},{x:.23725293550927423,y:.7462833376181454},{x:.22881124554357096,y:.7437225789630079},{x:.2210313395141179,y:.7395641325536145},{x:.21421219484660536,y:.7339678051533947},{x:.20861586744638547,y:.7271486604858821},{x:.2044574210369921,y:.719368754456429},{x:.20189666238185464,y:.7109270644907257},{x:.201032,y:.702148},{x:.201032,y:.529201},{x:.081055,y:.529201},{x:.07227593550927423,y:.5283363376181454},{x:.06383424554357094,y:.5257755789630079},{x:.05605433951411792,y:.5216171325536145},{x:.049235194846605365,y:.5160208051533947},{x:.04363886744638546,y:.5092016604858821},{x:.0394804210369921,y:.501421754456429},{x:.03691966238185464,y:.4929800644907258},{x:.036055000000000004,y:.484201}]],u:[[{x:.047041,y:.17386599999999997},{x:.04733731084809023,y:.17085750547164297},{x:.04744678100255899,y:.1678364368310572},{x:.0477687404511641,y:.16647712720137547},{x:.04790566238185463,y:.1650869355092742},{x:.048783207866406234,y:.16219405573845885},{x:.04947995583647738,y:.15925239265237093},{x:.08761895583647737,y:.04817539265237096},{x:.08938287590080696,y:.04431825367483454},{x:.09111755940033861,y:.04044787795123246},{x:.0912166047918106,y:.04030846472648272},{x:.0912877277290914,y:.04015294120864865},{x:.09377024504918263,y:.03671403980837168},{x:.09622666993792225,y:.03325645223155292},{x:.09635101037087945,y:.03313904059014135},{x:.09645110783403886,y:.03300038080982997},{x:.09955682066149267,y:.030111872039067004},{x:.10264058790854466,y:.027199945760571206},{x:.10278544504987946,y:.027109047766032002},{x:.10291067034954356,y:.026992580340839414},{x:.10652022788210418,y:.024765467971757132},{x:.11011283004156149,y:.02251110668543916},{x:.1858688300415615,y:-.015231893314560811},{x:.1873332068933575,y:-.0157898639141544},{x:.18871524554357097,y:-.01652857896300789},{x:.19144581156206075,y:-.017356887109087667},{x:.19411224226228255,y:-.018372875537717062},{x:.1956573361874375,y:-.018634439137126358},{x:.19715693550927424,y:-.019089337618145352},{x:.1999966293703256,y:-.019369023051625026},{x:.20281003486202434,y:-.01984529472354478},{x:.2043764687674932,y:-.01980039958033106},{x:.205936,y:-.019953999999999986},{x:.319832,y:-.019953999999999986},{x:.32132997950952447,y:-.01980646189590665},{x:.3228344649392302,y:-.019853723877644197},{x:.3257100002545037,y:-.019375067506000147},{x:.3286110644907258,y:-.019089337618145352},{x:.3300514774877758,y:-.018652393112465325},{x:.33153627500704863,y:-.018405236421526333},{x:.3342631764918695,y:-.017374788187221168},{x:.33705275445642907,y:-.01652857896300789},{x:.3383802466773209,y:-.015819019588053155},{x:.3397882963501792,y:-.015286942317463331},{x:.4160692963501792,y:.02245605768253664},{x:.4183042276197719,y:.02384992521458428},{x:.42064256487504254,y:.025062345668598177},{x:.4220380841989542,y:.02617863282445781},{x:.4235544084161923,y:.027124324140885128},{x:.42547446604244665,y:.028927422360218155},{x:.42753134130624215,y:.03057273346328787},{x:.465011,y:.06712410441560081},{x:.465011,y:.025046000000000013},{x:.4658756623818546,y:.016266935509274223},{x:.46843642103699207,y:.007825245543570968},{x:.47259486744638546,y:45339514117916785e-21},{x:.4781911948466053,y:-.006773805153394624},{x:.4850103395141179,y:-.012370132553614528},{x:.492790245543571,y:-.01652857896300789},{x:.5012319355092743,y:-.019089337618145352},{x:.510011,y:-.019953999999999986},{x:.5187900644907257,y:-.019089337618145352},{x:.527231754456429,y:-.01652857896300789},{x:.5350116604858821,y:-.012370132553614521},{x:.5418308051533947,y:-.006773805153394624},{x:.5474271325536145,y:45339514117916785e-21},{x:.5515855789630079,y:.007825245543570974},{x:.5541463376181454,y:.016266935509274244},{x:.555011,y:.025046000000000013},{x:.555011,y:.545898},{x:.5541463376181454,y:.5546770644907257},{x:.5515855789630079,y:.563118754456429},{x:.5474271325536145,y:.5708986604858821},{x:.5418308051533947,y:.5777178051533947},{x:.5350116604858821,y:.5833141325536145},{x:.527231754456429,y:.5874725789630079},{x:.5187900644907257,y:.5900333376181454},{x:.510011,y:.590898},{x:.5012319355092743,y:.5900333376181454},{x:.492790245543571,y:.5874725789630079},{x:.4850103395141179,y:.5833141325536145},{x:.4781911948466053,y:.5777178051533947},{x:.47259486744638546,y:.5708986604858821},{x:.46843642103699207,y:.563118754456429},{x:.4658756623818546,y:.5546770644907257},{x:.465011,y:.545898},{x:.465011,y:.19283699530520199},{x:.36978450462305706,y:.099969048308901},{x:.30930812362389754,y:.07004600000000001},{x:.2165251763155874,y:.07004600000000001},{x:.16675256431883717,y:.09484360935890679},{x:.137041,y:.18137632992954258},{x:.137041,y:.545898},{x:.13617633761814535,y:.5546770644907257},{x:.1336155789630079,y:.563118754456429},{x:.12945713255361452,y:.5708986604858821},{x:.12386080515339463,y:.5777178051533947},{x:.11704166048588208,y:.5833141325536145},{x:.10926175445642904,y:.5874725789630079},{x:.10082006449072577,y:.5900333376181454},{x:.092041,y:.590898},{x:.08326193550927423,y:.5900333376181454},{x:.07482024554357093,y:.5874725789630079},{x:.06704033951411792,y:.5833141325536145},{x:.06022119484660536,y:.5777178051533947},{x:.05462486744638546,y:.5708986604858821},{x:.050466421036992094,y:.563118754456429},{x:.04790566238185463,y:.5546770644907257},{x:.047041,y:.545898},{x:.047041,y:.17386599999999997}]],v:[[{x:.003930906419490336,y:.5438334563092145},{x:.005386967221411215,y:.5351329102741644},{x:.00851244255100142,y:.5268836061622384},{x:.26071044255100145,y:.018289606162238365},{x:.26144011887972296,y:.017121905714788027},{x:.2620056398700735,y:.01586646241095203},{x:.26377267234206975,y:.013389122267562115},{x:.26538522214413157,y:.010808560104194675},{x:.26632868500311185,y:.009805649483352854},{x:.267128264504625,y:.008684656842684199},{x:.2693446490294707,y:.006599649029470163},{x:.2714296568426842,y:.00438326450462502},{x:.27255064948335267,y:.0035836850031119977},{x:.2735535601041947,y:.0026402221441315446},{x:.27613412226756273,y:.0010276723420693272},{x:.278611462410952,y:-.0007393601299264599},{x:.2798669057147878,y:-.0013048811202769175},{x:.28103460616223835,y:-.0020345574489985807},{x:.28388017640738666,y:-.0031126798553442526},{x:.2866546460885495,y:-.00436245420755494},{x:.28799629407344673,y:-.00467218403223142},{x:.2892839102741644,y:-.005160032778588779},{x:.2922851349323858,y:-.00566229614975999},{x:.29525011283741587,y:-.006346784254711718},{x:.2966264067237199,y:-.006388820170250395},{x:.2979844563092145,y:-.006616093580509658},{x:.301026,y:-.00652319621682493},{x:.30406754369078554,y:-.006616093580509658},{x:.3054255932762801,y:-.006388820170250395},{x:.30680188716258416,y:-.006346784254711718},{x:.30976686506761425,y:-.005662296149759988},{x:.31276808972583564,y:-.005160032778588779},{x:.3140557059265533,y:-.00467218403223142},{x:.3153973539114505,y:-.00436245420755494},{x:.3181718235926135,y:-.0031126798553442175},{x:.3210173938377617,y:-.0020345574489985807},{x:.32218509428521225,y:-.0013048811202769192},{x:.323440537589048,y:-.0007393601299264599},{x:.32591787773243747,y:.0010276723420694187},{x:.32849843989580535,y:.0026402221441315446},{x:.32950135051664736,y:.0035836850031119635},{x:.3306223431573158,y:.00438326450462502},{x:.3327073509705293,y:.006599649029470129},{x:.334923735495375,y:.008684656842684203},{x:.33572331499688823,y:.009805649483352899},{x:.33666677785586846,y:.01080856010419469},{x:.3382793276579303,y:.013389122267562135},{x:.3400463601299265,y:.01586646241095204},{x:.34061188112027707,y:.017121905714788034},{x:.3413415574489986,y:.018289606162238365},{x:.5935395574489987,y:.5268836061622384},{x:.5966650327785888,y:.5351329102741644},{x:.5981210935805097,y:.5438334563092145},{x:.5978517842547117,y:.5526508871625841},{x:.595867454207555,y:.5612463539114505},{x:.5922443601299265,y:.569289537589048},{x:.587121735495375,y:.5764713431573159},{x:.5806964398958053,y:.5825157778558685},{x:.5732153938377617,y:.5871905574489986},{x:.5649660897258356,y:.5903160327785888},{x:.5562655436907855,y:.5917720935805096},{x:.5474481128374159,y:.5915027842547117},{x:.5388526460885495,y:.589518454207555},{x:.5308094624109521,y:.5858953601299265},{x:.5236276568426842,y:.580772735495375},{x:.5175832221441315,y:.5743474398958054},{x:.5129084425510014,y:.5668663938377616},{x:.301026,y:.13957458745236595},{x:.08914355744899859,y:.5668663938377616},{x:.08446877785586845,y:.5743474398958054},{x:.07842434315731579,y:.580772735495375},{x:.07124253758904797,y:.5858953601299265},{x:.06319935391145051,y:.589518454207555},{x:.054603887162584124,y:.5915027842547117},{x:.04578645630921451,y:.5917720935805096},{x:.037085910274164385,y:.5903160327785888},{x:.028836606162238352,y:.5871905574489986},{x:.02135556010419467,y:.5825157778558685},{x:.014930264504625007,y:.5764713431573159},{x:.009807639870073534,y:.569289537589048},{x:.006184545792445054,y:.5612463539114505},{x:.004200215745288276,y:.5526508871625841},{x:.003930906419490336,y:.5438334563092145}]],w:[[{x:-.04481226541001698,y:.5427688011711321},{x:-.0431501306438814,y:.534105261341125},{x:.1073618693561186,y:.025511261341124997},{x:.10747750697825527,y:.02522662926113043},{x:.10753949092041715,y:.02492572151525217},{x:.1091366577408943,y:.021142772088450095},{x:.11068223944402648,y:.01733845540642648},{x:.11085118408582124,y:.017081852232977028},{x:.1109706812129555,y:.01679881881229654},{x:.11327517574267339,y:.0134001494872997},{x:.11553324489331337,y:.009970459715744673},{x:.11574900410692728,y:.009751746564891355},{x:.11592142221145292,y:.009497464285038355},{x:.11884468401801046,y:.006613684018010047},{x:.12172846428503836,y:.0036904222114529234},{x:.12198274656489135,y:.0035180041069272803},{x:.12220145971574467,y:.0033022448933133844},{x:.1256311494872997,y:.001044175742673395},{x:.12902981881229655,y:-.0012603187870445023},{x:.12931285223297703,y:-.0013798159141787526},{x:.12956945540642648,y:-.0015487605559735135},{x:.1333737720884501,y:-.0030943422591057004},{x:.13715672151525218,y:-.004691509079582858},{x:.13745762926113045,y:-.004753493021744735},{x:.137742261341125,y:-.004869130643881392},{x:.14177500717701197,y:-.005642829061426576},{x:.14579686008065018,y:-.006471289947453558},{x:.1461040784358031,y:-.006473378696506754},{x:.14640580117113214,y:-.006531265410016966},{x:.150512,y:-.006503347745684165},{x:.15461819882886788,y:-.006531265410016966},{x:.15491992156419693,y:-.006473378696506754},{x:.15522713991934983,y:-.006471289947453558},{x:.159248992822988,y:-.005642829061426585},{x:.16328173865887502,y:-.004869130643881392},{x:.16356637073886957,y:-.004753493021744732},{x:.16386727848474786,y:-.004691509079582851},{x:.1676502279115502,y:-.0030943422591055763},{x:.17145454459357354,y:-.0015487605559735135},{x:.17171114776702298,y:-.0013798159141787517},{x:.17199418118770346,y:-.0012603187870445023},{x:.17539285051270065,y:.001044175742673613},{x:.17882254028425534,y:.0033022448933133844},{x:.17904125343510863,y:.0035180041069272374},{x:.17929553571496165,y:.0036904222114529095},{x:.18217931598198978,y:.006613684018010279},{x:.1851025777885471,y:.009497464285038375},{x:.18527499589307275,y:.009751746564891386},{x:.18549075510668664,y:.009970459715744683},{x:.1877488242573266,y:.013400149487299715},{x:.1900533187870445,y:.016798818812296553},{x:.19017281591417878,y:.01708185223297707},{x:.19034176055597352,y:.01733845540642648},{x:.19188734225910553,y:.02114277208844964},{x:.19348450907958287,y:.02492572151525217},{x:.19354649302174473,y:.02522662926113043},{x:.1936621306438814,y:.025511261341124997},{x:.30102443002882817,y:.38829842311817664},{x:.4083889386148475,y:.025511027311792445},{x:.40850451632069196,y:.025226547135196155},{x:.40856646677585007,y:.0249257992040805},{x:.410163689741502,y:.021142697708463984},{x:.41170935302882616,y:.01733823938560964},{x:.41187820927072055,y:.017081773507688556},{x:.41199764237598097,y:.016798890297984457},{x:.41430222163921304,y:.013400082779514221},{x:.4165603984391837,y:.009970270005002412},{x:.41677604416644776,y:.009751674265617277},{x:.4169483701745541,y:.009497526820430955},{x:.41987174204670485,y:.006613627545966159},{x:.42275565189129766,y:.0036902661012626486},{x:.42300979995956794,y:.0035179410120882958},{x:.4232283964786704,y:.003302296075210584},{x:.4266582174181369,y:.0010441316765615349},{x:.4300570332693414,y:-.001260435297455717},{x:.43033991691088264,y:-.001379867379883588},{x:.4305963833993421,y:-.0015487226944633017},{x:.43440084731088763,y:-.0030943722258508074},{x:.43818395458161874,y:-.004691581512785238},{x:.43848470273672896,y:-.004753530880516994},{x:.4387691833312223,y:-.0048691075577547704},{x:.44280208680029426,y:-.005642843777199688},{x:.4468241027997286,y:-.0064713155198797695},{x:.44713115788546864,y:-.006473401493455157},{x:.44743272015628793,y:-.006531257986460835},{x:.45153908096424766,y:-.006503346644966049},{x:.45564544187310013,y:-.00653124313893301},{x:.4559470039347234,y:-.006473385555557348},{x:.4562540590129192,y:-.0064712984717510205},{x:.4602760720167908,y:-.005642812186517322},{x:.4643089726882076,y:-.004869061385152536},{x:.46459345286480397,y:-.004753483679308031},{x:.46489420079591953,y:-.0046915332241499325},{x:.46867730229153426,y:-.003094310258498727},{x:.4724817606143904,y:-.0015486469711738574},{x:.4727382264923116,y:-.0013797907292793573},{x:.47302110970201555,y:-.0012603576240190345},{x:.4764199172204845,y:.0010442216392121837},{x:.47984972999499764,y:.0033023984391836667},{x:.4800683257343829,y:.003518044166447842},{x:.48032247317956905,y:.003690370174554085},{x:.483206372454032,y:.0066137420467029156},{x:.48612973389873737,y:.009497651891297622},{x:.4863020589879118,y:.009751799959568049},{x:.48651770392478944,y:.009970396478670394},{x:.4887758683234383,y:.01340021741813658},{x:.49108043529745576,y:.016799033269341422},{x:.49119986737988364,y:.017081916910882677},{x:.4913687226944633,y:.017338383399342037},{x:.4929143722258502,y:.021142847310886045},{x:.4945115815127853,y:.024925954581618698},{x:.4945735308805171,y:.025226702736729056},{x:.4946891075577548,y:.025511183331222268},{x:.6452021075577549,y:.5341051833312223},{x:.6468642579864609,y:.542768720156288},{x:.646804298471751,y:.5515900590129192},{x:.64502453322415,y:.5602302007959196},{x:.641593357624019,y:.5683571097020156},{x:.636642629825446,y:.5756584731795691},{x:.6303626035213297,y:.5818537039247894},{x:.622994616600658,y:.5867047226944633},{x:.6148218166687778,y:.5900251075577548},{x:.6061582798437121,y:.5916872579864608},{x:.5973369409870808,y:.591627298471751},{x:.5886967992040805,y:.58984753322415},{x:.5805698902979844,y:.5864163576240191},{x:.573268526820431,y:.5814656298254459},{x:.5670732960752106,y:.5751856035213296},{x:.5622222773055368,y:.567817616600658},{x:.5589018924422452,y:.5596448166687777},{x:.4515387133151436,y:.1968570925189096},{x:.34417406138515255,y:.5596449726882076},{x:.3440584683142858,y:.559929490683899},{x:.34399650907958285,y:.5602302784847478},{x:.3423992950207163,y:.5640133397974443},{x:.3408536469711739,y:.5678177606143904},{x:.3406847682813525,y:.5680742605871558},{x:.34056531878704455,y:.5683571811877035},{x:.33826075609875456,y:.5717559510329858},{x:.33600260156081635,y:.5751857299949976},{x:.33578692716538155,y:.5754043547947312},{x:.3356145777885471,y:.5756585357149616},{x:.33269122952253233,y:.5785424012737268},{x:.32980734810870244,y:.5814657338987373},{x:.3295531662537196,y:.581638081896991},{x:.3293345402842553,y:.5818537551066867},{x:.3259047490749403,y:.5841118910428063},{x:.32250596673065857,y:.5864164352974557},{x:.322223045482268,y:.5865358832573104},{x:.32196654459357354,y:.5867047605559735},{x:.318162115393689,y:.5882503879717952},{x:.31437904541838135,y:.5898475815127853},{x:.31407825728149374,y:.5899095391161314},{x:.313793738658875,y:.5900251306438814},{x:.30976087354902626,y:.5907988519446131},{x:.3057388972002714,y:.5916273155198798},{x:.3054318012943039,y:.5916294017707667},{x:.3051301988288679,y:.5916872654100169},{x:.30102387855356455,y:.5916593469199811},{x:.29691755812689985,y:.5916872431389331},{x:.2966159559752979,y:.5916293778639092},{x:.2963088600806502,y:.5916272899474536},{x:.29228688822522214,y:.5907988045585649},{x:.28825402731179245,y:.5900250613851525},{x:.2879695093161011,y:.5899094683142858},{x:.2876687215152522,y:.5898475090795828},{x:.2838856602025565,y:.5882502950207166},{x:.28008123938560964,y:.5867046469711739},{x:.27982473941284386,y:.5865357682813523},{x:.27954181881229656,y:.5864163187870445},{x:.276143048967013,y:.5841117560987538},{x:.2727132700050024,y:.5818536015608163},{x:.2724946452052691,y:.5816379271653819},{x:.27224046428503834,y:.5814655777885471},{x:.2693565987262721,y:.5785422295225312},{x:.2664332661012626,y:.5756583481087024},{x:.2662609181030087,y:.5754041662537193},{x:.2660452448933134,y:.5751855402842553},{x:.26378710895719626,y:.5717557490749442},{x:.2614825647025443,y:.5683569667306586},{x:.2613631167426894,y:.5680740454822678},{x:.2611942394440265,y:.5678175445935736},{x:.2596486120282045,y:.5640131153936881},{x:.2580514184872148,y:.5602300454183813},{x:.25798946088386876,y:.5599292572814941},{x:.2578738693561186,y:.559644738658875},{x:.150512,y:.196859029989096},{x:.0431501306438814,y:.559644738658875},{x:.039829760555973516,y:.5678175445935736},{x:.034978755106686646,y:.5751855402842553},{x:.028783535714961644,y:.5814655777885471},{x:.021482181187703456,y:.5864163187870445},{x:.01335527848474783,y:.5898475090795828},{x:.0047151399193498065,y:.5916272899474536},{x:-.004106198828867862,y:.5916872654100169},{x:-.01276973865887501,y:.5900251306438814},{x:-.020942544593573535,y:.5867047605559735},{x:-.028310540284255312,y:.5818537551066867},{x:-.034590577788547086,y:.5756585357149616},{x:-.03954131878704451,y:.5683571811877035},{x:-.04297250907958286,y:.5602302784847478},{x:-.04475228994745356,y:.5515901399193498},{x:-.04481226541001698,y:.5427688011711321}]],x:[[{x:-.007882248997940308,y:.03911618267902263},{x:-.007180671607209664,y:.030322582532795114},{x:-.0047770285451087455,y:.021834819906700376},{x:-.0007636904665355299,y:.013979074758467071},{x:.004705112296856322,y:.007057238968589209},{x:.011419216721809594,y:.001335314804661543},{x:.019120603540586492,y:-.0029668073965882433},{x:.02751331277672888,y:-.0056837994916240225},{x:.036274817320977384,y:-.006711248997940296},{x:.04506841746720488,y:-.006009671607209652},{x:.05355618009329963,y:-.003606028545108733},{x:.061411925241532925,y:.0004073095334644686},{x:.0683337610314108,y:.005876112296856327},{x:.3010265,y:.23008742701759316},{x:.5337192389685892,y:.005876112296856327},{x:.540641074758467,y:.0004073095334644686},{x:.5484968199067003,y:-.003606028545108733},{x:.556984582532795,y:-.006009671607209652},{x:.5657781826790226,y:-.006711248997940296},{x:.5745396872232711,y:-.0056837994916240225},{x:.5829323964594135,y:-.0029668073965882433},{x:.5906337832781904,y:.001335314804661536},{x:.5973478877031436,y:.007057238968589213},{x:.6028166904665355,y:.013979074758467089},{x:.6068300285451087,y:.021834819906700383},{x:.6092336716072096,y:.030322582532795128},{x:.6099352489979403,y:.03911618267902263},{x:.608907799491624,y:.047877687223271126},{x:.6061908073965883,y:.05627039645941352},{x:.6018886851953384,y:.0639717832781904},{x:.5961667610314108,y:.07068588770314368},{x:.36588095484811606,y:.292578},{x:.5961667610314108,y:.5144701122968564},{x:.6018886851953384,y:.5211842167218096},{x:.6061908073965883,y:.5288856035405864},{x:.608907799491624,y:.5372783127767289},{x:.6099352489979403,y:.5460398173209774},{x:.6092336716072096,y:.5548334174672048},{x:.6068300285451087,y:.5633211800932996},{x:.6028166904665355,y:.571176925241533},{x:.5973478877031436,y:.5780987610314108},{x:.5906337832781904,y:.5838206851953385},{x:.5829323964594135,y:.5881228073965883},{x:.5745396872232711,y:.590839799491624},{x:.5657781826790226,y:.5918672489979403},{x:.556984582532795,y:.5911656716072097},{x:.5484968199067003,y:.5887620285451087},{x:.540641074758467,y:.5847486904665355},{x:.5337192389685892,y:.5792798877031436},{x:.3010265,y:.35506857298240685},{x:.0683337610314108,y:.5792798877031436},{x:.06141192524153289,y:.5847486904665355},{x:.05355618009329961,y:.5887620285451087},{x:.0450684174672049,y:.5911656716072097},{x:.03627481732097735,y:.5918672489979403},{x:.02751331277672888,y:.590839799491624},{x:.01912060354058648,y:.5881228073965883},{x:.011419216721809584,y:.5838206851953385},{x:.004705112296856315,y:.5780987610314108},{x:-.0007636904665355368,y:.571176925241533},{x:-.004777028545108752,y:.5633211800932996},{x:-.007180671607209664,y:.5548334174672048},{x:-.007882248997940308,y:.5460398173209774},{x:-.006854799491624035,y:.5372783127767289},{x:-.004137807396588256,y:.5288856035405864},{x:.0001643148046615306,y:.5211842167218096},{x:.005886238968589197,y:.5144701122968564},{x:.23617204515188386,y:.292578},{x:.005886238968589197,y:.07068588770314368},{x:.00016431480466150977,y:.0639717832781904},{x:-.004137807396588256,y:.05627039645941351},{x:-.006854799491624035,y:.047877687223271126},{x:-.007882248997940308,y:.03911618267902263}]],y:[[{x:-7800000000000168e-20,y:-.15516599999999992},{x:.0007866623818546317,y:-.16394506449072568},{x:.003347421036992093,y:-.17238675445642895},{x:.007505867446385456,y:-.180166660485882},{x:.013102194846605353,y:-.18698580515339455},{x:.0199213395141179,y:-.19258213255361445},{x:.02770124554357093,y:-.1967405789630078},{x:.03614293550927421,y:-.19930133761814528},{x:.044922,y:-.2001659999999999},{x:.084618,y:-.2001659999999999},{x:.08470326921416556,y:-.20015760171543356},{x:.08478856964894584,y:-.200165676732115},{x:.08909199801123496,y:-.19972534965725622},{x:.09339706449072577,y:-.19930133761814528},{x:.0934790568568106,y:-.19927646550581232},{x:.09356429362525961,y:-.1992677440740231},{x:.09769912926743524,y:-.1979963205354665},{x:.10183875445642904,y:-.1967405789630078},{x:.1019143190537861,y:-.19670018884423682},{x:.10199621655469396,y:-.19667500612370953},{x:.18074721655469395,y:-.16370500612370958},{x:.18295470197399702,y:-.16251430076809983},{x:.18525522528778574,y:-.16151511930158513},{x:.18682754729843723,y:-.16042530954354395},{x:.18851130436774752,y:-.15951710034658062},{x:.19044407848245243,y:-.15791861501920362},{x:.19250546725178602,y:-.1564898227103016},{x:.27125546725178606,y:-.08958282271030155},{x:.27347158712358693,y:-.0872898341236823},{x:.27580944257935097,y:-.08512109812948883},{x:.27653091968085064,y:-.08412438503144627},{x:.2773860111192193,y:-.08323963374445845},{x:.2791122089873479,y:-.0805583607511536},{x:.2809820438025964,y:-.07797520343727593},{x:.35909504380259644,y:.055837796562724036},{x:.35921507445013207,y:.05609937330868571},{x:.35938084670619436,y:.05633463764830328},{x:.359814044874128,y:.05731131476590327},{x:.3603874218559792,y:.0582128676935936},{x:.5972854218559792,y:.5265638676935935},{x:.6004763520268956,y:.5347880745861305},{x:.6020015061983327,y:.5434767752438966},{x:.6018022735507984,y:.5522960677732933},{x:.5998863104832066,y:.5609070317083322},{x:.5963272463817603,y:.568978752534074},{x:.591261854083932,y:.5762010385458585},{x:.5848847937750224,y:.5822963413425576},{x:.5774411323064065,y:.5870304218559792},{x:.5692169254138695,y:.5902213520268956},{x:.5605282247561034,y:.5917465061983327},{x:.5517089322267067,y:.5915472735507984},{x:.5430979682916678,y:.5896313104832066},{x:.5350262474659261,y:.5860722463817603},{x:.5278039614541415,y:.5810068540839319},{x:.5217086586574424,y:.5746297937750224},{x:.5169745781440208,y:.5671861323064065},{x:.3203411783046204,y:.17843886787959407},{x:.12481771439881506,y:.5670983271806026},{x:.12009991274687032,y:.5745523168465348},{x:.11401856108654926,y:.5809426827476728},{x:.10680736235169674,y:.5860238467061943},{x:.09874343886560628,y:.5896005424407229},{x:.09013668268554793,y:.5915353195400148},{x:.08131784662479694,y:.5917538256051798},{x:.0726258336075076,y:.5902476635706729},{x:.06439467281939737,y:.5870747143988151},{x:.05694068315346515,y:.5823569127468703},{x:.05055031725232718,y:.5762755610865493},{x:.04546915329380567,y:.5690643623516968},{x:.041892457559277035,y:.5610004388656062},{x:.039957680459985136,y:.5523936826855479},{x:.039739174394820276,y:.5435748466247969},{x:.0412453364293271,y:.5348828336075077},{x:.04441828560118493,y:.5266516728193974},{x:.26905653043412125,y:.0801181620528446},{x:.20712852539925722,y:-.025968816269973185},{x:.1395520619925953,y:-.08338263769409424},{x:.07557825049874085,y:-.11016599999999992},{x:.044922,y:-.11016599999999992},{x:.03614293550927422,y:-.11103066238185455},{x:.02770124554357096,y:-.11359142103699202},{x:.01992133951411791,y:-.11774986744638538},{x:.01310219484660536,y:-.12334619484660528},{x:.007505867446385456,y:-.13016533951411782},{x:.003347421036992093,y:-.13794524554357088},{x:.0007866623818546317,y:-.14638693550927412},{x:-7800000000000168e-20,y:-.15516599999999992}]],z:[[{x:.051680000000000004,y:.038348999999999966},{x:.05192127447228559,y:.035899299172703986},{x:.05194879067317478,y:.033437899088824954},{x:.05235257576103353,y:.03152022369965088},{x:.05254466238185464,y:.029569935509274177},{x:.053259213756049764,y:.02721437531096308},{x:.05376639657582897,y:.024805638484003446},{x:.054536542955643516,y:.023003585252525667},{x:.0551054210369921,y:.02112824554357092},{x:.05626578950451143,y:.018957348831652537},{x:.05723314819184797,y:.01669384166703705},{x:.05834005957014514,y:.015076662488338128},{x:.05926386744638546,y:.01334833951411787},{x:.060825460697764414,y:.011445532631778232},{x:.062215820200804926,y:.009414240440453706},{x:.0636169585940798,y:.00804408260344652},{x:.06486019484660537,y:.0065291948466053296},{x:.06676300172894496,y:.004967601595226417},{x:.06852293131171022,y:.0032465857969436324},{x:.07016445175727676,y:.0021761036989109733},{x:.07167933951411792,y:.0009328674463854256},{x:.07385023622603624,y:-.00022750102113387976},{x:.07591210278164046,y:-.0015721027544036703},{x:.07773092256935071,y:-.0023017710867676167},{x:.07945924554357096,y:-.003225578963007937},{x:.08181480574188199,y:-.003940130337203038},{x:.08409937289490133,y:-.004856645714911602},{x:.08602559580031956,y:-.00521745953679684},{x:.08790093550927423,y:-.0057863376181453985},{x:.09035063633657014,y:-.00602761209043098},{x:.09277010945251417,y:-.006480819940600742},{x:.09472971180962335,y:-.006458913379178931},{x:.09668,y:-.006651000000000032},{x:.505373,y:-.006651000000000032},{x:.5141520644907257,y:-.0057863376181453985},{x:.522593754456429,y:-.003225578963007937},{x:.5303736604858821,y:.0009328674463854256},{x:.5371928051533946,y:.0065291948466053296},{x:.5427891325536145,y:.013348339514117874},{x:.5469475789630078,y:.021128245543570928},{x:.5495083376181453,y:.029569935509274198},{x:.550373,y:.038348999999999966},{x:.5495083376181453,y:.047128064490725735},{x:.5469475789630078,y:.055569754456429005},{x:.5427891325536145,y:.06334966048588206},{x:.5371928051533946,y:.0701688051533946},{x:.5303736604858821,y:.0757651325536145},{x:.522593754456429,y:.07992357896300786},{x:.5141520644907257,y:.08248433761814533},{x:.505373,y:.08334899999999996},{x:.190464663126857,y:.08334899999999996},{x:.5404754142030563,y:.5196949313117102},{x:.5415458963010891,y:.5213364517572769},{x:.5427891325536145,y:.5228513395141179},{x:.5439495010211337,y:.525022236226036},{x:.5452941027544036,y:.5270841027816404},{x:.5460237710867677,y:.5289029225693511},{x:.5469475789630078,y:.530631245543571},{x:.5476621303372028,y:.5329868057418816},{x:.5485786457149116,y:.5352713728949013},{x:.5489394595367969,y:.53719759580032},{x:.5495083376181453,y:.5390729355092743},{x:.5497496120904308,y:.5415226363365697},{x:.5502028199406007,y:.5439421094525142},{x:.5501809133791788,y:.5459017118096235},{x:.550373,y:.547852},{x:.5501317255277144,y:.5503017008272966},{x:.5501042093268251,y:.552763100911175},{x:.5497004242389665,y:.5546807763003486},{x:.5495083376181453,y:.5566310644907257},{x:.5487937862439503,y:.5589866246890365},{x:.548286603424171,y:.5613953615159966},{x:.5475164570443563,y:.5631974147474748},{x:.5469475789630078,y:.565072754456429},{x:.5457872104954887,y:.567243651168347},{x:.544819851808152,y:.569507158332963},{x:.5437129404298549,y:.5711243375116617},{x:.5427891325536145,y:.5728526604858821},{x:.5412275393022352,y:.5747554673682221},{x:.539837179799195,y:.5767867595595463},{x:.5384360414059206,y:.578156917396553},{x:.5371928051533946,y:.5796718051533947},{x:.5352899982710546,y:.5812333984047738},{x:.5335300686882897,y:.5829544142030564},{x:.5318885482427235,y:.5840248963010888},{x:.5303736604858821,y:.5852681325536145},{x:.5282027637739638,y:.5864285010211338},{x:.5261408972183595,y:.5877731027544036},{x:.5243220774306487,y:.5885027710867679},{x:.522593754456429,y:.5894265789630079},{x:.5202381942581186,y:.5901411303372028},{x:.5179536271050986,y:.5910576457149116},{x:.5160274041996802,y:.5914184595367968},{x:.5141520644907257,y:.5919873376181454},{x:.5117023636634302,y:.5922286120904309},{x:.5092828905474858,y:.5926818199406008},{x:.5073232881903766,y:.5926599133791789},{x:.505373,y:.592852},{x:.09668,y:.592852},{x:.08790093550927423,y:.5919873376181454},{x:.07945924554357094,y:.5894265789630079},{x:.07167933951411792,y:.5852681325536145},{x:.06486019484660537,y:.5796718051533947},{x:.05926386744638546,y:.5728526604858821},{x:.0551054210369921,y:.565072754456429},{x:.05254466238185464,y:.5566310644907257},{x:.051680000000000004,y:.547852},{x:.05254466238185464,y:.5390729355092743},{x:.0551054210369921,y:.530631245543571},{x:.05926386744638546,y:.5228513395141179},{x:.06486019484660537,y:.5160321948466053},{x:.07167933951411792,y:.5104358674463855},{x:.07945924554357096,y:.5062774210369921},{x:.08790093550927423,y:.5037166623818546},{x:.09668,y:.502852},{x:.41158833687314295,y:.502852},{x:.06157758579694366,y:.06650606868828973},{x:.06050710369891106,y:.06486454824272328},{x:.05926386744638546,y:.06334966048588206},{x:.05810349897886612,y:.06117876377396365},{x:.05675889724559635,y:.059116897218359485},{x:.05602922891323242,y:.05729807743064926},{x:.0551054210369921,y:.055569754456429005},{x:.054390869662797,y:.05321419425811798},{x:.053474354285088434,y:.050929627105098636},{x:.0531135404632032,y:.04900340419968042},{x:.05254466238185464,y:.047128064490725735},{x:.05230338790956906,y:.04467836366342984},{x:.051850180059399294,y:.04225889054748581},{x:.05187208662082111,y:.04029928819037662},{x:.051680000000000004,y:.038348999999999966}]]},w5=T4;function X0(y){return!y||typeof y!="object"?!1:"route_type"in y&&y.route_type==="wire"&&("start_width"in y||"end_width"in y||"width_interpolation_mode"in y)}function N4(y){let x=[];for(let e=0;e<y.length-1;e++){let r=y[e];if(!X0(r))continue;let o=y[e+1];if(!o)continue;let c=o.route_type==="through_pad"?o.start:{x:o.x,y:o.y},a=o.route_type==="via"?o.from_layer:o.route_type==="through_pad"?o.start_layer:o.layer;if(!c||a!==r.layer||r.width!==r.start_width)continue;let f={start:{x:r.x,y:r.y},end:c,start_width:r.start_width,end_width:r.end_width,width_interpolation_mode:r.width_interpolation_mode,layer:r.layer,is_inside_copper_pour:!!(r.is_inside_copper_pour&&o.is_inside_copper_pour)};I5(f)&&x.push(f)}return x}function O4(y){let{start:x,end:e,start_width:r,end_width:o}=y,c=e.x-x.x,a=e.y-x.y,f=Math.hypot(c,a);if(!I5(y))return[];let v=Math.abs(o-r),w=y.width_interpolation_mode==="linear"?1:Math.max(1,Math.ceil(Math.sqrt(v/(.001+v*1e-6)*(3/8)))),T=-a/f,I=c/f,b=[],k=[];for(let g=0;g<=w;g++){let P=g/w,N=r<=o?P:1-P,E=(y.width_interpolation_mode==="quadratic"?Math.min(r,o)+v*N*N:r+(o-r)*P)/2,S=x.x+c*P,O=x.y+a*P;b.push({x:S+T*E,y:O+I*E}),k.push({x:S-T*E,y:O-I*E})}return[...b,...k.reverse()]}function I5(y){let{start:x,end:e,start_width:r,end_width:o}=y,c=Math.hypot(e.x-x.x,e.y-x.y);return!(![x.x,x.y,e.x,e.y,c,r,o].every(Number.isFinite)||c<=0||r<=0||o<=0||y.width_interpolation_mode!=="linear"&&y.width_interpolation_mode!=="quadratic")}var Z0=class{constructor(y=[1,1,1,1],x=0,e=0){U(this,"color");U(this,"element");U(this,"category");U(this,"vertices",[]);U(this,"indices",[]);this.color=y,this.element=x,this.category=e}polygon(y){if(!y[0]||y[0].length<3)return;let x=[],e=[];for(let[c,a]of y.entries()){c&&e.push(x.length/2);for(let f of a){if(!Number.isFinite(f.x)||!Number.isFinite(f.y))throw new Error("Non-finite polygon vertex");x.push(f.x,f.y)}}let r=$0(x,e,2),o=this.vertices.length/8;for(let c=0;c<x.length;c+=2)this.vertices.push(x[c],x[c+1],...this.color,this.element,this.category);for(let c of r)this.indices.push(o+c)}line(y,x,e){if(!(e>0))return;let r=b5(y,x,e);this.polygon([r])}path(y,x,e=!1){for(let r=1;r<y.length;r++)this.line(y[r-1],y[r],x);e&&y.length>2&&this.line(y.at(-1),y[0],x)}fabricationPath(y,x,e){if(y.length<2)return;let r=[];if(e&&y.length>=3&&r.push([y.map(c=>[c.x,c.y])]),x>0){let c=e?[...y,y[0]]:y;for(let a=1;a<c.length;a++)r.push([b5(c[a-1],c[a],x).map(f=>[f.x,f.y])])}if(!r.length)return;let o=r.map(c=>c.map(a=>a.map(([f,v])=>[Math.round(f*1e9)/1e9,Math.round(v*1e9)/1e9])));for(let c of R5.default.union(o[0],...o.slice(1)))this.polygon(c.map(a=>a.map(([f,v])=>({x:f,y:v}))))}build(){return{vertices:new Float32Array(this.vertices),indices:new Uint32Array(this.indices)}}};function b5(y,x,e){let r=Math.atan2(x.y-y.y,x.x-y.x),o=e/2,c=[];for(let a=0;a<=12;a++){let f=r+Math.PI/2+a*Math.PI/12;c.push({x:y.x+o*Math.cos(f),y:y.y+o*Math.sin(f)})}for(let a=0;a<=12;a++){let f=r-Math.PI/2+a*Math.PI/12;c.push({x:x.x+o*Math.cos(f),y:x.y+o*Math.sin(f)})}return c}function G0(y,x,e=0){let r=e*Math.PI/180,o=y.x-x.x,c=y.y-x.y;return{x:x.x+o*Math.cos(r)-c*Math.sin(r),y:x.y+o*Math.sin(r)+c*Math.cos(r)}}function j0(y,x,e=x,r=0){return x>0&&e>0?Array.from({length:96},(o,c)=>{let a=c*2*Math.PI/96;return G0({x:y.x+Math.cos(a)*x/2,y:y.y+Math.sin(a)*e/2},y,r)}):[]}function D0(y,x,e,r=0,o=0){if(!(x>0&&e>0))return[];r=Math.max(0,Math.min(r,x/2,e/2));let c=[];for(let a=0;a<4;a++){let f=a===0||a===3?1:-1,v=a<2?1:-1,w=r?24:1;for(let T=0;T<w;T++){let I=(a+T/(w-1||1))*Math.PI/2;c.push(G0({x:y.x+f*(x/2-r)+r*Math.cos(I),y:y.y+v*(e/2-r)+r*Math.sin(I)},y,o))}}return c}function G4(y){let x=[];for(let e=0;e<y.length;e++){let r=y[e],o=y[(e+1)%y.length];x.push({x:r.x,y:r.y});let c=r.bulge??0,a=o.x-r.x,f=o.y-r.y;if(!c||!a&&!f)continue;let v=4*Math.atan(c),w={x:(r.x+o.x)/2-f*(1-c*c)/(4*c),y:(r.y+o.y)/2+a*(1-c*c)/(4*c)},T=Math.atan2(r.y-w.y,r.x-w.x),I=Math.hypot(r.x-w.x,r.y-w.y),b=Math.max(2,Math.ceil(Math.abs(v)/(Math.PI/48)));for(let k=1;k<b;k++)x.push({x:w.x+I*Math.cos(T+v*k/b),y:w.y+I*Math.sin(T+v*k/b)})}return x}function M5(y,x,e){let r=[];for(let o=0;o<y.length;o++){let c=y[o],a=y[(o+1)%y.length],f=c.x+c.y-x,v=a.x+a.y-x,w=e?f>=0:f<=0,T=e?v>=0:v<=0;if(w&&r.push(c),w!==T){let I=f/(f-v);r.push({x:c.x+I*(a.x-c.x),y:c.y+I*(a.y-c.y)})}}return r}function C4(y,x){let e=y.color,r=[e[0]+(1-e[0])*.4,e[1]+(1-e[1])*.4,e[2]+(1-e[2])*.4,e[3]];y.color=[r[0],r[1],r[2],r[3]*.2],y.polygon(x),y.color=r;let o=new Z0;o.polygon(x);let c=.15*Math.SQRT2/2;for(let a=0;a<o.indices.length;a+=3){let f=o.indices.slice(a,a+3).map(I=>({x:o.vertices[I*8],y:o.vertices[I*8+1]})),v=f.map(I=>I.x+I.y),w=Math.ceil(Math.min(...v)-c),T=Math.floor(Math.max(...v)+c);for(let I=w;I<=T;I++)y.polygon([M5(M5(f,I-c,!0),I+c,!1)])}y.color=e}var $=(y,x,e)=>[y/255,x/255,e/255,1],B4={board:$(70,72,72),top:$(200,52,52),bottom:$(77,127,196),inner1:$(127,200,127),inner2:$(206,125,44),inner3:$(79,203,203),inner4:$(219,98,139),inner5:$(167,165,198),inner6:$(40,204,217),inner7:$(232,178,167),inner8:$(242,237,161),drill:$(255,38,226),top_silkscreen:$(242,237,161),bottom_silkscreen:$(242,237,161),soldermask_top:$(12,55,33),soldermask_bottom:$(12,55,33),top_fabrication:[1,1,1,.5],bottom_fabrication:[1,1,1,.5],top_notes:$(89,148,220),bottom_notes:$(89,148,220),top_courtyard:$(255,0,245),bottom_courtyard:$(38,233,255),edge_cuts:$(208,210,205)},q0=y=>y.replace(/_copper$/,"");function H0(y){let x=y.match(/^#([0-9a-f]{3,8})$/i)?.[1];if(x){let r=x.length<=4?[...x].map(o=>o+o).join(""):x;if(r.length!==6&&r.length!==8)throw new Error(`Unsupported color: ${y}`);return[parseInt(r.slice(0,2),16)/255,parseInt(r.slice(2,4),16)/255,parseInt(r.slice(4,6),16)/255,r.length===8?parseInt(r.slice(6),16)/255:1]}let e=y.match(/^rgba?\\(([^)]+)\\)$/);if(e){let r=e[1].split(",").map(o=>Number(o.trim()));if((r.length===3||r.length===4)&&r.every(Number.isFinite))return[r[0]/255,r[1]/255,r[2]/255,r[3]??1]}throw new Error(`Unsupported color: ${y}`)}function U4(y,x){let e=!1;for(let r=0,o=y.length-1;r<y.length;o=r++){let c=y[r],a=y[o];c.y>x.y!=a.y>x.y&&x.x<(a.x-c.x)*(x.y-c.y)/(a.y-c.y)+c.x&&(e=!e)}return e}function E5(y,x){let e=x.filter(r=>r.length>=3).map(r=>({ring:r,parents:[]}));for(let[r,o]of e.entries())o.parents=e.flatMap((c,a)=>r!==a&&U4(c.ring,o.ring[0])?[a]:[]);for(let[r,o]of e.entries())if(o.parents.length%2===0){let c=e.filter(a=>a.parents.length===o.parents.length+1&&a.parents.includes(r));y.polygon([o.ring,...c.map(a=>a.ring)])}}var F4=y=>_5[y]??(y===" "?c0.spaceWidthRatio:c0.glyphWidthRatio);function k5(y,x,e){let r=F4(y),o=x?c0.letterSpacingRatio:0,c=x?v5[y]?.[x]??0:0;return e*(r+o+c)}function W4(y,x){let e=x*c0.glyphWidthRatio,r=x*c0.letterSpacingRatio,o=x*c0.spaceWidthRatio,c=x*c0.strokeWidthRatio,a=x*c0.lineHeightRatio,f=y.replace(/\\\\n/g,`\n`).split(`\n`),v=f.map(I=>{let b=Array.from(I);return b.reduce((k,g,P)=>k+k5(g,b[P+1],x),0)}),w=v.reduce((I,b)=>Math.max(I,b),0),T=f.length>1?x+(f.length-1)*a:x;return{width:w,height:T,glyphWidth:e,letterSpacing:r,spaceWidth:o,strokeWidth:c,lineHeight:a,lines:f,lineWidths:v}}function z4(y){let{line:x,fontSize:e,startX:r,startY:o}=y,c=e,a=e,f=Array.from(x),v=[],w=r+y.layout.strokeWidth/2;return f.forEach((T,I)=>{let b=w5[T];if(b?.length){let k=[];for(let g of b){let P=g.map(N=>({x:w+N.x*a,y:o+(1-N.y)*c}));P.length>=3&&k.push(P)}k.length>0&&v.push(k)}w+=k5(T,f[I+1],e)}),v}function $4(y){let x=Number.POSITIVE_INFINITY,e=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,o=Number.NEGATIVE_INFINITY;for(let c of y)for(let a of c)x=Math.min(x,a.x),e=Math.min(e,a.y),r=Math.max(r,a.x),o=Math.max(o,a.y);return x===Number.POSITIVE_INFINITY||e===Number.POSITIVE_INFINITY||r===Number.NEGATIVE_INFINITY||o===Number.NEGATIVE_INFINITY?null:{minX:x,minY:e,maxX:r,maxY:o}}function Y4(y,x,e){let r=X4(y,x),o=Z4(r,x,e),c=$4(o.flat()),a=j4(y,x,c);return{bounds:c?Q4(c,a):null,glyphGroups:H4(o,a),linePlacements:r.map(({line:f,startX:v,startY:w})=>({line:f,startX:v+a.x,startY:w+a.y})),startOffset:a}}function V4(y,x){let e=x.width+x.strokeWidth,r=x.height+x.strokeWidth,o=0,c=0;return y==="center"||y==="top_center"||y==="bottom_center"?o=-e/2:y==="top_left"||y==="bottom_left"||y==="center_left"?o=0:y==="top_right"||y==="bottom_right"||y==="center_right"?o=-e:(y==="top_center"||y==="bottom_center")&&(o=-e/2),y==="center"||y==="center_left"||y==="center_right"?c=-r/2:y==="top_left"||y==="top_right"||y==="top_center"?c=0:(y==="bottom_left"||y==="bottom_right"||y==="bottom_center")&&(c=-r),{x:o,y:c}}function X4(y,x){return x.lines.map((e,r)=>({line:e,startX:J4({alignment:y,lineWidth:x.lineWidths[r],maxWidth:x.width,strokeWidth:x.strokeWidth}),startY:r*x.lineHeight}))}function Z4(y,x,e){return y.flatMap(({line:r,startX:o,startY:c})=>z4({line:r,fontSize:e,startX:o,startY:c,layout:x}))}function j4(y,x,e){return e?{x:-D4(y,e),y:-q4(y,e)}:V4(y,x)}function D4(y,x){return y==="top_left"||y==="bottom_left"||y==="center_left"?x.minX:y==="top_right"||y==="bottom_right"||y==="center_right"?x.maxX:(x.minX+x.maxX)/2}function q4(y,x){return y==="top_left"||y==="top_right"||y==="top_center"?x.minY:y==="bottom_left"||y==="bottom_right"||y==="bottom_center"?x.maxY:(x.minY+x.maxY)/2}function H4(y,x){return x.x===0&&x.y===0?y:y.map(e=>e.map(r=>r.map(o=>({x:o.x+x.x,y:o.y+x.y}))))}function Q4(y,x){return{minX:y.minX+x.x,minY:y.minY+x.y,maxX:y.maxX+x.x,maxY:y.maxY+x.y}}function J4(y){let{alignment:x,lineWidth:e,maxWidth:r,strokeWidth:o}=y,c=e+o,a=r+o;return x==="top_left"||x==="bottom_left"||x==="center_left"?0:x==="top_right"||x==="bottom_right"||x==="center_right"?a-c:(a-c)/2}function Q0(y,x,e="up"){let r=String(x.text??"");if(!r)return;let o=x.anchor_position??x.center??{x:x.x??0,y:x.y??0},c=x.font_size??1,a=W4(r,c),f=Y4(x.anchor_alignment??"center",a,c),v=x.type==="pcb_note_text",w=x.type==="pcb_fabrication_note_text",T=w?!1:v?x.is_mirrored_from_top_view??x.layer==="bottom":x.type==="pcb_silkscreen_text"?x.layer==="bottom":x.is_mirrored??x.layer==="bottom",I=v||w?0:x.ccw_rotation??0,b=e==="up"?-1:1,k=g=>G0({x:o.x+(T?-g.x:g.x),y:o.y+b*g.y},o,-b*I);if(x.is_knockout&&!v&&!w){let g=f.bounds;if(!g)return;let P={left:.2,right:.2,top:.2,bottom:.2,...x.knockout_padding},N=[{x:g.minX-P.left,y:g.minY-P.top},{x:g.maxX+P.right,y:g.minY-P.top},{x:g.maxX+P.right,y:g.maxY+P.bottom},{x:g.minX-P.left,y:g.maxY+P.bottom}];E5(y,[N.map(k),...f.glyphGroups.flatMap(A=>A.map(E=>E.map(k)))]);return}for(let g of f.glyphGroups)E5(y,g.map(P=>P.map(k)))}function K4(y,x){return{x:(y.x+x.x)/2,y:(y.y+x.y)/2}}function g0(y,x){return Array.isArray(x)?[y.a*x[0]+y.c*x[1]+y.e,y.b*x[0]+y.d*x[1]+y.f]:{x:y.a*x.x+y.c*x.y+y.e,y:y.b*x.x+y.d*x.y+y.f}}function P0(y){return typeof y>"u"}function I0(y,x=0){return{a:1,c:0,e:y,b:0,d:1,f:x}}function J0(...y){y=Array.isArray(y[0])?y[0]:y;let x=(e,r)=>({a:e.a*r.a+e.c*r.b,c:e.a*r.c+e.c*r.d,e:e.a*r.e+e.c*r.f+e.e,b:e.b*r.a+e.d*r.b,d:e.b*r.c+e.d*r.d,f:e.b*r.e+e.d*r.f+e.f});switch(y.length){case 0:throw new Error("no matrices provided");case 1:return y[0];case 2:return x(y[0],y[1]);default:{let[e,r,...o]=y,c=x(e,r);return J0(c,...o)}}}var{cos:y3,sin:x3,PI:t3}=Math;function e3(y,x,e){let r=y3(y),o=x3(y),c={a:r,c:-o,e:0,b:o,d:r,f:0};return P0(x)||P0(e)?c:J0([I0(x,e),c,I0(-x,-e)])}function A5(y,x=void 0,e=void 0){return e3(y*t3/180,x,e)}function T5(y,x=void 0,e=void 0,r=void 0){P0(x)&&(x=y);let o={a:y,c:0,e:0,b:0,d:x,f:0};return P0(e)||P0(r)?o:J0([I0(e,r),o,I0(-e,-r)])}var{tan:P3}=Math,n3=1.5,r3=.6,i3=.3;function o3({pcbDimension:y}){let x=S5({x:y.to.x-y.from.x,y:y.to.y-y.from.y}),e=g0(A5(90),x),r=S5(y.offset_direction??{x:0,y:0}),o=y.offset_distance??0,c=f0(r,o),a=x0(y.from,c),f=x0(y.to,c),v=y.arrow_size??1,w=x0(a,f0(x,v)),T=x0(f,f0(x,-v)),I=f0(e,v/2),b=f0(e,-v/2),k=c3(r)?r:e,g=f0(k,o+v),P=x0(K4(y.from,y.to),c),N=y.font_size??1,A=v*n3+l3({fontSize:N,text:y.text??"",textCcwRotationDegrees:y.text_ccw_rotation});return{arrowPolygons:[[a,x0(w,I),x0(w,b)],[f,x0(T,I),x0(T,b)]],dimensionLine:{start:w,end:T,width:v/5},extensionLines:[{start:y.from,end:x0(y.from,g)},{start:y.to,end:x0(y.to,g)}],label:y.text?{anchorPosition:x0(P,f0(e,A)),ccwRotationDegrees:s3({dimensionDirection:x,requestedCcwRotationDegrees:y.text_ccw_rotation}),fontSize:N,text:y.text}:void 0}}function s3({dimensionDirection:y,requestedCcwRotationDegrees:x}){let e=Math.atan2(y.y,y.x)*180/Math.PI;return(e>90||e<-90)&&(e+=180),e+(x??0)}function l3({fontSize:y,text:x,textCcwRotationDegrees:e}){if(e===void 0||!Number.isFinite(e))return 0;let r=x.length*y*r3/2,o=y/2,c=A5(e),a=g0(c,{x:r,y:0}),f=g0(c,{x:0,y:o});return Math.abs(a.y)+Math.abs(f.y)+y*i3}function S5(y){let x=Math.hypot(y.x,y.y)||1;return g0(T5(1/x),y)}function f0(y,x){return g0(T5(x),y)}function x0(y,x){return g0(I0(x.x,x.y),y)}function c3(y){return Math.abs(y.x)>Number.EPSILON||Math.abs(y.y)>Number.EPSILON}function a3({mesh:y,pcbDimension:x,textYAxis:e}){x.color&&(y.color=H0(x.color));let{arrowPolygons:r,dimensionLine:o,extensionLines:c,label:a}=o3({pcbDimension:x});for(let f of r)y.polygon([f]);y.line(o.start,o.end,o.width);for(let f of c)y.line(f.start,f.end,o.width);a&&Q0(y,{anchor_alignment:"center",anchor_position:a.anchorPosition,ccw_rotation:a.ccwRotationDegrees,font_size:a.fontSize,text:a.text,type:"pcb_dimension_text"},e)}function u3(y,x=0){return y[`${y.type}_id`]??`${y.type}:${x}`}function O0(y){return y.center??y.anchor_position??{x:y.x??0,y:y.y??0}}function t0(y,x=!1){if(y.brep_shape)return[y.brep_shape.outer_ring,...y.brep_shape.inner_rings??[]].map(v=>G4(v.vertices));if(y.outline?.length)return[y.outline];if(y.shape==="rotated_pill_hole_with_rect_pad"){let v=O0(y),w=x?{x:v.x+(y.hole_offset_x??0),y:v.y+(y.hole_offset_y??0)}:v,T=x?y.hole_width:y.rect_pad_width,I=x?y.hole_height:y.rect_pad_height;return[D0(w,T,I,x?Math.min(T,I)/2:y.rect_border_radius??0,(x?y.hole_ccw_rotation:y.rect_ccw_rotation)??0)]}let e=x?y.hole_shape??y.shape:y.shape;if(e==="polygon")return[y.points??y.vertices??[]];let r=O0(y),o=y.rect_ccw_rotation??y.ccw_rotation??y.rotation??0,c=x?G0({x:r.x+(y.hole_offset_x??0),y:r.y+(y.hole_offset_y??0)},r,o):r;if(e==="circle"||e==="circular_hole_with_rect_pad"&&x||y.type==="pcb_via"){let v=x?y.hole_diameter:y.outer_diameter??(y.radius!=null?y.radius*2:y.diameter);return[j0(c,v||y.diameter||y.hole_diameter||y.radius*2)]}let a=x?y.hole_width??y.hole_diameter:y.rect_pad_width??y.outer_width??y.width??y.hole_diameter,f=x?y.hole_height??y.hole_diameter:y.rect_pad_height??y.outer_height??y.height??y.hole_diameter;if(e==="oval")return[j0(c,a,f,o)];if(["rect","square","rotated_rect","roundrect","rounded_rect","pill","rotated_pill","circular_hole_with_rect_pad","pill_hole_with_rect_pad",void 0].includes(e)){let w=e?.includes("pill")&&!(e==="pill_hole_with_rect_pad"&&!x)?Math.min(a,f)/2:y.corner_radius??y.rect_border_radius??0;return[D0(c,a,f,w,o)]}throw new Error(`Unsupported shape: ${e}`)}function f3(y,x={}){let e=new Map,r=[],o=y.map(u3),c=y.find(b=>b.type==="pcb_board"),a=["top",...Array.from({length:Math.max(0,Math.min(8,(c?.num_layers??2)-2))},(b,k)=>`inner${k+1}`),"bottom"],f=(b,k,g=!1,P=0)=>{b=q0(b),e.has(b)||e.set(b,{paint:new Z0,erase:new Z0});let N=e.get(b)[g?"erase":"paint"];return N.color=x.layerColors?.[b]??B4[b]??[.75,.75,.75,1],N.element=k,N.category=P,N},v=[],w=[],T=[];for(let[b,k]of y.entries()){let g=k,P=g.type;try{if(P==="pcb_board"||P==="pcb_panel"){let N=t0(g);f("board",b).polygon(N);for(let A of N)f("edge_cuts",b).path(A,.1,!0);for(let A of["top","bottom"])f(`soldermask_${A}`,b).polygon(N)}else if(P==="pcb_cutout")T.push({rings:t0(g),index:b}),f("edge_cuts",b).path(t0(g)[0],.05,!0);else if(k.type==="pcb_soldermask_opening")f(`soldermask_${k.layer}`,b,!0).polygon(t0(k));else if(P==="pcb_smtpad")f(g.layer,b).polygon(t0(g)),g.is_covered_with_solder_mask||f(`soldermask_${g.layer}`,b,!0).polygon(t0(g));else if(P==="pcb_via"||P==="pcb_plated_hole"){let N=g.layers??a;if(P==="pcb_via"&&!g.layers&&g.from_layer&&g.to_layer){let A=a.indexOf(g.from_layer),E=a.indexOf(g.to_layer);N=a.slice(Math.min(A,E),Math.max(A,E)+1)}for(let A of N)f(A,b).polygon(t0(g));v.push({element:g,index:b,layers:N});for(let A of["top","bottom"])N.includes(A)&&!g.is_covered_with_solder_mask&&f(`soldermask_${A}`,b,!0).polygon(t0(g))}else if(P==="pcb_hole")v.push({element:{...g,shape:g.hole_shape},index:b,layers:a});else if(k.type==="pcb_trace"){let N=k.route;if(k.route_thickness_mode==="interpolated"&&N.some((A,E)=>A.route_type==="wire"&&!X0(A)&&N[E+1]?.route_type==="wire"))throw new Error("Interpolated/through-pad traces are not supported yet");for(let A of N4(N)){let E=O4(A);if(!E.length)throw new Error("Invalid teardrop geometry or interpolation mode");f(A.layer,b).polygon([E])}for(let A of N)if(A.route_type==="through_pad")for(let E of new Set([A.start_layer,A.end_layer]))f(E,b).line(A.start,A.end,A.width);for(let A=1;A<N.length;A++){let E=N[A-1],S=N[A];X0(E)||(E.route_type==="through_pad"&&(E={route_type:"wire",...E.end,layer:E.end_layer,width:E.width}),S.route_type==="through_pad"&&(S={route_type:"wire",...S.start,layer:S.start_layer,width:S.width}),E.route_type==="wire"&&S.route_type==="wire"&&E.layer===S.layer||E.route_type==="wire"&&S.route_type==="via"&&[S.from_layer,S.to_layer].includes(E.layer)?f(E.layer,b).line(E,S,E.width):E.route_type==="via"&&S.route_type==="wire"&&[E.from_layer,E.to_layer].includes(S.layer)&&f(S.layer,b).line(E,S,S.width))}}else if(P==="pcb_copper_pour")f(g.layer,b,!1,1).polygon(t0(g));else if(P==="pcb_copper_text")Q0(f(g.layer,b),g,x.textYAxis);else if(/^pcb_(silkscreen|fabrication_note|courtyard|note|user_note)_/.test(P)){let N=P.match(/^pcb_(silkscreen|fabrication_note|courtyard|note|user_note)_/)[1],A={silkscreen:"silkscreen",fabrication_note:"fabrication",courtyard:"courtyard",note:"notes",user_note:"notes"}[N],E=`${g.layer??"top"}_${A}`,S=f(E,b);if(k.type==="pcb_note_dimension"||k.type==="pcb_fabrication_note_dimension")a3({mesh:S,pcbDimension:k,textYAxis:x.textYAxis});else if(P.endsWith("_text"))g.color&&(N==="note"||N==="fabrication_note")&&(S.color=H0(g.color)),Q0(S,g,x.textYAxis);else if(P.endsWith("_path")||P.endsWith("_line")||P.endsWith("_outline")){let O=g.route??g.points??g.outline??[g.start,g.end].filter(Boolean),s0=P==="pcb_fabrication_note_path";s0&&g.color&&(S.color=H0(g.color)),s0?S.fabricationPath(O,g.has_stroke===!1?0:g.stroke_width??.05,!!g.is_filled):S.path(O,g.stroke_width??g.width??.05,P.endsWith("_outline"))}else if(P==="pcb_silkscreen_graphic"&&g.shape==="brep")S.polygon(t0(g));else if(P.endsWith("_rect")){let O=D0(O0(g),g.width,g.height,g.corner_radius??0,g.ccw_rotation??0);g.is_filled?S.polygon([O]):S.path(O,g.stroke_width??.05,!0)}else if(P.endsWith("_circle")){let O=j0(O0(g),(g.radius??0)*2);g.is_filled?S.polygon([O]):S.path(O,g.stroke_width??.05,!0)}else throw new Error("Unsupported annotation geometry")}else if(P==="pcb_keepout")w.push({rings:t0(g),index:b,layers:g.layers??[g.layer??"top"]});else if(P.startsWith("pcb_")&&!["pcb_component","pcb_port","pcb_group","pcb_solder_paste","pcb_debug_object","pcb_trace_hint","pcb_anchor","pcb_breakout_point"].includes(P)&&!/_(error|warning)$/.test(P))throw new Error("Unsupported PCB element")}catch(N){r.push({elementId:o[b],type:P,message:String(N)})}}for(let{rings:b,index:k,layers:g}of w)try{for(let P of g)C4(f(P,k),b)}catch(P){r.push({elementId:o[k],type:"pcb_keepout",message:String(P)})}for(let{element:b,index:k,layers:g}of v){let P=t0(b,!0);for(let A of g)f(A,k,!0).polygon(P);g.includes("top")&&g.includes("bottom")&&(f("board",k,!0).polygon(P),f("drill",k).polygon(P));for(let A of["top","bottom"])g.includes(A)&&f(`soldermask_${A}`,k,!0).polygon(P)}for(let{rings:b,index:k}of T){f("drill",k).polygon(b);for(let g of e.keys())g!=="edge_cuts"&&g!=="drill"&&f(g,k,!0).polygon(b)}let I=[...e].map(([b,k])=>({name:b,paint:k.paint.build(),erase:k.erase.build()}));return{layers:I,elementIds:o,diagnostics:r,triangleCount:I.reduce((b,k)=>b+(k.paint.indices.length+k.erase.indices.length)/3,0)}}var h3=`\nstruct Camera { rowX: vec4f, rowY: vec4f, viewport: vec4f }\n@group(0) @binding(0) var<uniform> camera: Camera;\n@group(0) @binding(1) var<storage, read> highlights: array<u32>;\nstruct VertexOut {\n  @builtin(position) position: vec4f,\n  @location(0) color: vec4f,\n  @location(1) @interpolate(flat) category: u32,\n  @location(2) @interpolate(flat) selected: u32,\n}\n@vertex fn vertexMain(@location(0) p: vec2f, @location(1) color: vec4f,\n  @location(2) element: f32, @location(3) category: f32) -> VertexOut {\n  let pixel = vec2f(dot(camera.rowX.xyz, vec3f(p, 1)), dot(camera.rowY.xyz, vec3f(p, 1)));\n  var out: VertexOut;\n  out.position = vec4f(pixel.x / camera.viewport.x * 2 - 1, 1 - pixel.y / camera.viewport.y * 2, 0, 1);\n  let highlight = select(0.0, 1.0, (highlights[u32(element)] & 1u) != 0u);\n  out.color = vec4f(mix(color.rgb, min(vec3f(1), color.rgb * 1.5), highlight), color.a);\n  out.category = u32(category);\n  out.selected = highlights[u32(element)] & 2u;\n  return out;\n}\n@fragment fn fragmentMain(in: VertexOut) -> @location(0) vec4f {\n  if (in.category == 1u && camera.viewport.z == 0) { discard; }\n  if (camera.viewport.w == 1) {\n    if (in.selected == 0u) { discard; }\n    return vec4f(in.color.rgb, 1);\n  }\n  let alpha = in.color.a * select(1.0, camera.viewport.z, in.category == 1u);\n  return vec4f(in.color.rgb * alpha, alpha);\n}\n`,p3=`\n@group(0) @binding(0) var image: texture_2d<f32>;\n@group(0) @binding(1) var imageSampler: sampler;\n@group(0) @binding(2) var<uniform> fade: vec4f;\nstruct Out { @builtin(position) position: vec4f, @location(0) uv: vec2f }\n@vertex fn vertexMain(@builtin(vertex_index) index: u32) -> Out {\n  let points = array<vec2f, 6>(vec2f(0,0),vec2f(1,0),vec2f(0,1),vec2f(0,1),vec2f(1,0),vec2f(1,1));\n  var out: Out;\n  out.uv = points[index];\n  out.position = vec4f(out.uv.x * 2 - 1, 1 - out.uv.y * 2, 0, 1);\n  return out;\n}\n@fragment fn fragmentMain(in: Out) -> @location(0) vec4f {\n  return textureSample(image, imageSampler, in.uv) * fade.x;\n}\n`,P5={color:{srcFactor:"one",dstFactor:"one-minus-src-alpha"},alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha"}},h0,C0=(h0=class{constructor(x,e,r,o,c){U(this,"canvas");U(this,"device");U(this,"context");U(this,"config");U(this,"realToCanvasMat",{a:1,b:0,c:0,d:-1,e:0,f:0});U(this,"stats",{geometryUploads:0,frames:0,triangleCount:0,compileMs:0,vertexBytes:0});U(this,"circuit");U(this,"scene");U(this,"layers",[]);U(this,"xRayLayers",[]);U(this,"xRayUniform");U(this,"xRayCameraGroup");U(this,"uniform");U(this,"highlights");U(this,"cameraGroup");U(this,"highlightKey","");U(this,"highlightIndices",new Map);U(this,"sample");U(this,"size","");U(this,"disposed",!1);U(this,"adapterInfo");U(this,"lost",!1);U(this,"paintPipeline");U(this,"erasePipeline");U(this,"compositePipeline");U(this,"sampler");U(this,"options",{});this.canvas=x,this.device=e,this.context=r,this.config=c,this.uniform=e.createBuffer({size:48,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST}),this.xRayUniform=e.createBuffer({size:48,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST}),this.highlights=e.createBuffer({size:4,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST});let a=e.createShaderModule({code:h3}),f=e.createPipelineLayout({bindGroupLayouts:[e.createBindGroupLayout({entries:[{binding:0,visibility:GPUShaderStage.VERTEX|GPUShaderStage.FRAGMENT,buffer:{type:"uniform"}},{binding:1,visibility:GPUShaderStage.VERTEX,buffer:{type:"read-only-storage"}}]})]}),v=T=>({layout:f,vertex:{module:a,entryPoint:"vertexMain",buffers:[{arrayStride:32,attributes:[{shaderLocation:0,offset:0,format:"float32x2"},{shaderLocation:1,offset:8,format:"float32x4"},{shaderLocation:2,offset:24,format:"float32"},{shaderLocation:3,offset:28,format:"float32"}]}]},fragment:{module:a,entryPoint:"fragmentMain",targets:[{format:"rgba8unorm",blend:T}]},primitive:{topology:"triangle-list"},multisample:{count:c.sampleCount??4}});this.paintPipeline=e.createRenderPipeline(v(P5)),this.erasePipeline=e.createRenderPipeline(v({color:{srcFactor:"zero",dstFactor:"one-minus-src-alpha"},alpha:{srcFactor:"zero",dstFactor:"one-minus-src-alpha"}}));let w=e.createShaderModule({code:p3});this.compositePipeline=e.createRenderPipeline({layout:"auto",vertex:{module:w,entryPoint:"vertexMain"},fragment:{module:w,entryPoint:"fragmentMain",targets:[{format:o,blend:P5}]},primitive:{topology:"triangle-list"}}),this.sampler=e.createSampler({minFilter:"linear",magFilter:"linear"}),e.lost.then(T=>{this.lost=!0,this.disposed||c.onDeviceLost?.(T.message||T.reason)})}static async create(x,e={}){if(!globalThis.navigator?.gpu)throw new Error("WebGPU is unavailable");let r=await navigator.gpu.requestAdapter({powerPreference:"high-performance"});if(!r)throw new Error("No WebGPU adapter available");let o=await r.requestDevice(),c=x.getContext("webgpu");if(!c)throw o.destroy(),new Error("WebGPU canvas context is unavailable");let a=navigator.gpu.getPreferredCanvasFormat();c.configure({device:o,format:a,alphaMode:"premultiplied"}),o.pushErrorScope("validation");try{let f=new h0(x,o,c,a,e),v=await o.popErrorScope();if(v)throw f.dispose(),new Error(v.message);return o.addEventListener("uncapturederror",w=>e.onDeviceLost?.(w.error.message)),f.adapterInfo=r.info,f}catch(f){throw c.unconfigure(),o.destroy(),f}}get diagnostics(){return this.scene?.diagnostics??[]}setCircuitJson(x){if(this.assertLive(),this.circuit===x)return;let e=performance.now(),r=f3(x,this.config);this.releaseLayers(),this.highlights.destroy(),this.highlights=this.device.createBuffer({size:Math.max(4,r.elementIds.length*4),usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST}),this.highlightIndices=new Map(r.elementIds.map((c,a)=>[c,a])),this.highlightKey="!",this.cameraGroup=this.device.createBindGroup({layout:this.paintPipeline.getBindGroupLayout(0),entries:[{binding:0,resource:{buffer:this.uniform}},{binding:1,resource:{buffer:this.highlights}}]}),this.xRayCameraGroup=this.device.createBindGroup({layout:this.paintPipeline.getBindGroupLayout(0),entries:[{binding:0,resource:{buffer:this.xRayUniform}},{binding:1,resource:{buffer:this.highlights}}]}),this.stats.vertexBytes=0;let o=c=>{let a=(f,v)=>{let w=this.device.createBuffer({size:Math.max(4,f.byteLength),usage:v|GPUBufferUsage.COPY_DST});return f.byteLength&&this.device.queue.writeBuffer(w,0,f.buffer,f.byteOffset,f.byteLength),this.stats.vertexBytes+=f.byteLength,w};return{vertices:a(c.vertices,GPUBufferUsage.VERTEX),indices:a(c.indices,GPUBufferUsage.INDEX),count:c.indices.length}};this.layers=r.layers.map(c=>({name:c.name,paint:o(c.paint),erase:o(c.erase),opacity:this.device.createBuffer({size:16,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST})})),this.xRayLayers=this.layers.filter(c=>this.isCopper(c.name)||c.name==="drill").map(c=>({...c,opacity:this.device.createBuffer({size:16,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST})})),this.scene=r,this.circuit=x,this.size="",this.stats.geometryUploads++,this.stats.triangleCount=r.triangleCount,this.stats.compileMs=performance.now()-e}drawElements(x,e={}){this.setCircuitJson(x),this.options={},this.render(e)}render(x={}){this.assertLive(),this.options={...this.options,...x};let e=this.options;e.transform&&(this.realToCanvasMat=e.transform);let r=this.realToCanvasMat,o=this.canvas.width,c=this.canvas.height;if(!o||!c)return;if(![...Object.values(r),o,c].every(Number.isFinite))throw new Error("Invalid camera or canvas dimensions");if(o>this.device.limits.maxTextureDimension2D||c>this.device.limits.maxTextureDimension2D)throw new Error("Canvas exceeds GPU texture limits");let a=e.showCopperPours===!1?0:Number.isFinite(e.copperPourOpacity)?Math.max(0,Math.min(1,e.copperPourOpacity)):1;this.resize(o,c),this.device.queue.writeBuffer(this.uniform,0,new Float32Array([r.a,r.c,r.e,0,r.b,r.d,r.f,0,o,c,a,0]));let f=e.xRayElementIds??[],v=f.length>0;v&&this.device.queue.writeBuffer(this.xRayUniform,0,new Float32Array([r.a,r.c,r.e,0,r.b,r.d,r.f,0,o,c,a,1]));let w=v?[]:e.highlightedElementIds??[],T=JSON.stringify([w,f]);if(T!==this.highlightKey){let E=new Uint32Array(Math.max(1,this.scene?.elementIds.length??0));for(let S of w){let O=this.highlightIndices.get(S);O!==void 0&&(E[O]=1)}for(let S of f){let O=this.highlightIndices.get(S);O!==void 0&&(E[O]|=2)}this.device.queue.writeBuffer(this.highlights,0,E),this.highlightKey=T}let I=q0(e.selectedLayer??"top"),b=e.layers?new Set(e.layers.map(q0)):void 0,k=this.layers.filter(E=>b&&!b.has(E.name)||v&&!this.isCopper(E.name)||E.name==="board"&&!e.showBoardMaterial||E.name.startsWith("soldermask_")&&(!e.showSolderMask||E.name!==`soldermask_${I}`)||E.name.includes("silkscreen")&&e.showSilkscreen===!1||E.name.includes("fabrication")&&!e.showFabricationNotes||E.name.includes("notes")&&e.showPcbNotes===!1||E.name.includes("courtyard")&&!e.showCourtyards?!1:v&&this.isCopper(E.name)||this.opacity(E.name,I,e.hiddenLayerOpacity??.4)>0).sort((E,S)=>this.order(E.name,I)-this.order(S.name,I)),g=v?this.xRayLayers.filter(E=>!b||b.has(E.name)).sort((E,S)=>this.xRayOrder(E.name,I)-this.xRayOrder(S.name,I)):[],P=[...k.map(E=>({layer:E,xRay:!1})),...g.map(E=>({layer:E,xRay:!0}))],N=this.device.createCommandEncoder();for(let{layer:E,xRay:S}of P){this.ensureTexture(E,o,c);let O=E.texture.createView(),s0=(this.config.sampleCount??4)>1,J=N.beginRenderPass({colorAttachments:[{view:s0?this.sample.createView():O,...s0?{resolveTarget:O}:{},clearValue:[0,0,0,0],loadOp:"clear",storeOp:s0?"discard":"store"}]});for(let[H,V]of[[E.paint,this.paintPipeline],[E.erase,this.erasePipeline]])H.count&&(J.setBindGroup(0,S&&V===this.paintPipeline?this.xRayCameraGroup:this.cameraGroup),J.setPipeline(V),J.setVertexBuffer(0,H.vertices),J.setIndexBuffer(H.indices,"uint32"),J.drawIndexed(H.count));J.end(),this.device.queue.writeBuffer(E.opacity,0,new Float32Array([S?1:v&&this.isCopper(E.name)?Math.max(0,Math.min(1,e.hiddenLayerOpacity??.4)):this.opacity(E.name,I,e.hiddenLayerOpacity??.4),0,0,0]))}let A=N.beginRenderPass({colorAttachments:[{view:this.context.getCurrentTexture().createView(),clearValue:e.background??[0,0,0,0],loadOp:"clear",storeOp:"store"}]});A.setPipeline(this.compositePipeline);for(let{layer:E}of P)A.setBindGroup(0,E.composite),A.draw(6);A.end(),this.device.queue.submit([N.finish()]),this.stats.frames++}async flush(){this.assertLive(),await this.device.queue.onSubmittedWorkDone()}isCopper(x){return/^(top|bottom|inner\\d+)$/.test(x)}opacity(x,e,r){return["board","drill","edge_cuts"].includes(x)||x===e||x.startsWith(`${e}_`)||x.endsWith(`_${e}`)?1:Math.max(0,Math.min(1,r))}xRayOrder(x,e){return x==="drill"?200:x===e?100:x==="bottom"?0:x.startsWith("inner")?20-Number(x.slice(5)):40}order(x,e){if(x==="board")return-100;if(x==="drill")return 200;if(x==="edge_cuts")return 150;let r=x===e?100:x.startsWith("inner")?20-Number(x.slice(5)):x==="bottom"?30:40;return x.includes("soldermask")?110:x.startsWith(`${e}_`)?120:r}resize(x,e){let r=`${x}:${e}`;if(r!==this.size){this.sample?.destroy(),this.sample=(this.config.sampleCount??4)>1?this.device.createTexture({size:[x,e],format:"rgba8unorm",sampleCount:this.config.sampleCount??4,usage:GPUTextureUsage.RENDER_ATTACHMENT}):void 0;for(let o of[...this.layers,...this.xRayLayers])o.texture?.destroy(),o.texture=void 0,o.composite=void 0;this.size=r}}ensureTexture(x,e,r){x.texture||(x.texture=this.device.createTexture({size:[e,r],format:"rgba8unorm",usage:GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.TEXTURE_BINDING}),x.composite=this.device.createBindGroup({layout:this.compositePipeline.getBindGroupLayout(0),entries:[{binding:0,resource:x.texture.createView()},{binding:1,resource:this.sampler},{binding:2,resource:{buffer:x.opacity}}]}))}assertLive(){if(this.disposed||this.lost)throw new Error(this.lost?"WebGPU device lost":"Renderer disposed")}releaseLayers(){for(let x of this.xRayLayers)x.opacity.destroy(),x.texture?.destroy();this.xRayLayers=[];for(let x of this.layers){for(let e of[x.paint,x.erase])e.vertices.destroy(),e.indices.destroy();x.opacity.destroy(),x.texture?.destroy()}this.layers=[]}dispose(){if(this.disposed)return;this.disposed=!0,this.releaseLayers(),this.sample?.destroy(),this.uniform.destroy(),this.xRayUniform.destroy(),this.highlights.destroy(),this.context.unconfigure();let x=()=>this.device.destroy();this.device.queue.onSubmittedWorkDone().then(x,x),this.circuit=void 0,this.scene=void 0}},U(h0,"supportsXRayNet",!0),h0);var m0=self,O5="supportsXRayNet"in C0&&C0.supportsXRayNet===!0,Q,d0,B0,G5=0,K0=!1,_0=!1,y5=y=>{_0||(_0=!0,Q?.dispose(),m0.postMessage({type:"error",message:y instanceof Error?y.message:String(y)}))};function N5(){if(K0||_0||!Q||!B0)return;K0=!0;let y=()=>{if(K0=!1,!(_0||!Q||!B0))try{let x=B0,e=G5;d0.width!==x.width&&(d0.width=x.width),d0.height!==x.height&&(d0.height=x.height),Q.render({...x.options,transform:x.transform}),m0.postMessage({type:"rendered",xRayActive:O5&&!!x.options.xRayElementIds?.length,geometryUploads:Q.stats.geometryUploads,frames:Q.stats.frames,compileMs:Q.stats.compileMs,sceneGeneration:e})}catch(x){y5(x)}};m0.requestAnimationFrame?m0.requestAnimationFrame(y):setTimeout(y,16)}m0.onmessage=async y=>{let x=y.data;try{if(x.type==="init"){if(d0=x.canvas,Q=await C0.create(d0,{onDeviceLost:y5}),_0){Q.dispose();return}m0.postMessage({type:"ready",supportsXRayNet:O5})}else if(x.type==="scene"){if(Q.setCircuitJson(x.elements),Q.diagnostics.length)throw new Error(`Unsupported WebGPU geometry: ${Q.diagnostics.map(e=>`${e.type}: ${e.message}`).join("; ")}`);G5=x.sceneGeneration,N5()}else x.type==="view"?(B0=x,N5()):(_0=!0,Q?.dispose())}catch(e){y5(e)}};})();\n/*! Bundled license information:\n\npolygon-clipping/dist/polygon-clipping.umd.js:\n  (**\n   * splaytree v3.1.2\n   * Fast Splay tree for Node and browser\n   *\n   * @author Alexander Milevski <info@w8r.name>\n   * @license MIT\n   * @preserve\n   *)\n  (*! *****************************************************************************\n      Copyright (c) Microsoft Corporation. All rights reserved.\n      Licensed under the Apache License, Version 2.0 (the "License"); you may not use\n      this file except in compliance with the License. You may obtain a copy of the\n      License at http://www.apache.org/licenses/LICENSE-2.0\n  \n      THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n      KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\n      WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\n      MERCHANTABLITY OR NON-INFRINGEMENT.\n  \n      See the Apache Version 2.0 License for specific language governing permissions\n      and limitations under the License.\n      ***************************************************************************** *)\n*/\n'],{type:"text/javascript"}));try{return new Worker(e)}finally{URL.revokeObjectURL(e)}}var Kts=Yts({"inline-worker:/home/runner/work/pcb-viewer/pcb-viewer/src/lib/webgpu/pcb-webgpu.worker.ts"(){}}),$ts=Ngt({"node_modules/svgson/dist/svgson.umd.js"(e,t){(function(n,o){typeof e==="object"&&typeof t<"u"?t.exports=o():typeof define==="function"&&define.amd?define(o):(n=typeof globalThis<"u"?globalThis:n||self,n.svgson=o())})(e,function(){var n=function(Y){return Y!=null&&(o(Y)||r(Y)||!!Y._isBuffer)};function o(Y){return!!Y.constructor&&typeof Y.constructor.isBuffer==="function"&&Y.constructor.isBuffer(Y)}function r(Y){return typeof Y.readFloatLE==="function"&&typeof Y.slice==="function"&&o(Y.slice(0,0))}var i=Object.prototype.toString,s=function(X){if(typeof X>"u")return"undefined";if(X===null)return"null";if(X===!0||X===!1||X instanceof Boolean)return"boolean";if(typeof X==="string"||X instanceof String)return"string";if(typeof X==="number"||X instanceof Number)return"number";if(typeof X==="function"||X instanceof Function)return"function";if(typeof Array.isArray<"u"&&Array.isArray(X))return"array";if(X instanceof RegExp)return"regexp";if(X instanceof Date)return"date";var K=i.call(X);if(K==="[object RegExp]")return"regexp";if(K==="[object Date]")return"date";if(K==="[object Arguments]")return"arguments";if(K==="[object Error]")return"error";if(n(X))return"buffer";if(K==="[object Set]")return"set";if(K==="[object WeakSet]")return"weakset";if(K==="[object Map]")return"map";if(K==="[object WeakMap]")return"weakmap";if(K==="[object Symbol]")return"symbol";if(K==="[object Int8Array]")return"int8array";if(K==="[object Uint8Array]")return"uint8array";if(K==="[object Uint8ClampedArray]")return"uint8clampedarray";if(K==="[object Int16Array]")return"int16array";if(K==="[object Uint16Array]")return"uint16array";if(K==="[object Int32Array]")return"int32array";if(K==="[object Uint32Array]")return"uint32array";if(K==="[object Float32Array]")return"float32array";if(K==="[object Float64Array]")return"float64array";return"object"};function a(Y,X){return X={exports:{}},Y(X,X.exports),X.exports}var c=a(function(Y){(function(){function X(K,J){if(typeof J!=="function")return K;var ee={};for(var se in K)if(Object.prototype.hasOwnProperty.call(K,se))ee[J(se,K[se])||se]=K[se];return ee}if(Y.exports)Y.exports=X;else window.rename=X})()}),l=function Y(X,K){var J=s(X);if(J!=="object"&&J!=="array")throw Error("expected an object");var ee=[];if(J==="object")X=c(X,K),ee={};for(var se in X)if(X.hasOwnProperty(se)){var ne=X[se];if(s(ne)==="object"||s(ne)==="array")ee[se]=Y(ne,K);else ee[se]=ne}return ee},h=a(function(Y){var X=Object.prototype.hasOwnProperty,K="~";function J(){}if(Object.create){if(J.prototype=Object.create(null),!new J().__proto__)K=!1}function ee(ne,re,Z){this.fn=ne,this.context=re,this.once=Z||!1}function se(){this._events=new J,this._eventsCount=0}se.prototype.eventNames=function(){var re=[],Z,te;if(this._eventsCount===0)return re;for(te in Z=this._events)if(X.call(Z,te))re.push(K?te.slice(1):te);if(Object.getOwnPropertySymbols)return re.concat(Object.getOwnPropertySymbols(Z));return re},se.prototype.listeners=function(re,Z){var te=K?K+re:re,ie=this._events[te];if(Z)return!!ie;if(!ie)return[];if(ie.fn)return[ie.fn];for(var le=0,ue=ie.length,de=Array(ue);le<ue;le++)de[le]=ie[le].fn;return de},se.prototype.emit=function(re,Z,te,ie,le,ue){var de=K?K+re:re;if(!this._events[de])return!1;var me=this._events[de],Ae=arguments.length,xe,Me;if(me.fn){if(me.once)this.removeListener(re,me.fn,void 0,!0);switch(Ae){case 1:return me.fn.call(me.context),!0;case 2:return me.fn.call(me.context,Z),!0;case 3:return me.fn.call(me.context,Z,te),!0;case 4:return me.fn.call(me.context,Z,te,ie),!0;case 5:return me.fn.call(me.context,Z,te,ie,le),!0;case 6:return me.fn.call(me.context,Z,te,ie,le,ue),!0}for(Me=1,xe=Array(Ae-1);Me<Ae;Me++)xe[Me-1]=arguments[Me];me.fn.apply(me.context,xe)}else{var Re=me.length,we;for(Me=0;Me<Re;Me++){if(me[Me].once)this.removeListener(re,me[Me].fn,void 0,!0);switch(Ae){case 1:me[Me].fn.call(me[Me].context);break;case 2:me[Me].fn.call(me[Me].context,Z);break;case 3:me[Me].fn.call(me[Me].context,Z,te);break;case 4:me[Me].fn.call(me[Me].context,Z,te,ie);break;default:if(!xe)for(we=1,xe=Array(Ae-1);we<Ae;we++)xe[we-1]=arguments[we];me[Me].fn.apply(me[Me].context,xe)}}}return!0},se.prototype.on=function(re,Z,te){var ie=new ee(Z,te||this),le=K?K+re:re;if(!this._events[le])this._events[le]=ie,this._eventsCount++;else if(!this._events[le].fn)this._events[le].push(ie);else this._events[le]=[this._events[le],ie];return this},se.prototype.once=function(re,Z,te){var ie=new ee(Z,te||this,!0),le=K?K+re:re;if(!this._events[le])this._events[le]=ie,this._eventsCount++;else if(!this._events[le].fn)this._events[le].push(ie);else this._events[le]=[this._events[le],ie];return this},se.prototype.removeListener=function(re,Z,te,ie){var le=K?K+re:re;if(!this._events[le])return this;if(!Z){if(--this._eventsCount===0)this._events=new J;else delete this._events[le];return this}var ue=this._events[le];if(ue.fn){if(ue.fn===Z&&(!ie||ue.once)&&(!te||ue.context===te))if(--this._eventsCount===0)this._events=new J;else delete this._events[le]}else{for(var de=0,me=[],Ae=ue.length;de<Ae;de++)if(ue[de].fn!==Z||ie&&!ue[de].once||te&&ue[de].context!==te)me.push(ue[de]);if(me.length)this._events[le]=me.length===1?me[0]:me;else if(--this._eventsCount===0)this._events=new J;else delete this._events[le]}return this},se.prototype.removeAllListeners=function(re){var Z;if(re){if(Z=K?K+re:re,this._events[Z])if(--this._eventsCount===0)this._events=new J;else delete this._events[Z]}else this._events=new J,this._eventsCount=0;return this},se.prototype.off=se.prototype.removeListener,se.prototype.addListener=se.prototype.on,se.prototype.setMaxListeners=function(){return this},se.prefixed=K,se.EventEmitter=se,Y.exports=se});function d(Y,X,K){if(X in Y)Object.defineProperty(Y,X,{value:K,enumerable:!0,configurable:!0,writable:!0});else Y[X]=K;return Y}var u=function(){},_={data:"state-data",cdata:"state-cdata",tagBegin:"state-tag-begin",tagName:"state-tag-name",tagEnd:"state-tag-end",attributeNameStart:"state-attribute-name-start",attributeName:"state-attribute-name",attributeNameEnd:"state-attribute-name-end",attributeValueBegin:"state-attribute-value-begin",attributeValue:"state-attribute-value"},p={lt:"action-lt",gt:"action-gt",space:"action-space",equal:"action-equal",quote:"action-quote",slash:"action-slash",char:"action-char",error:"action-error"},m={text:"text",openTag:"open-tag",closeTag:"close-tag",attributeName:"attribute-name",attributeValue:"attribute-value"},A={" ":p.space,"\t":p.space,"\n":p.space,"\r":p.space,"<":p.lt,">":p.gt,'"':p.quote,"'":p.quote,"=":p.equal,"/":p.slash},g=function(X){return A[X]||p.char},f=function(X){var K,J,ee,se,ne,re,Z,te,ie,le;X=Object.assign({debug:!1},X);var ue=new h,de=_.data,me="",Ae="",xe="",Me="",Re="",we="",_e=function(Ne,ke){if(Ae[0]==="?"||Ae[0]==="!")return;var nt={type:Ne,value:ke};if(X.debug)console.log("emit:",nt);ue.emit("data",nt)};ue.stateMachine=(le={},d(le,_.data,(K={},d(K,p.lt,function(){if(me.trim())_e(m.text,me);Ae="",Re=!1,de=_.tagBegin}),d(K,p.char,function(Se){me+=Se}),K)),d(le,_.cdata,d({},p.char,function(Se){if(me+=Se,me.substr(-3)==="]]>")_e(m.text,me.slice(0,-3)),me="",de=_.data})),d(le,_.tagBegin,(J={},d(J,p.space,u),d(J,p.char,function(Se){Ae=Se,de=_.tagName}),d(J,p.slash,function(){Ae="",Re=!0}),J)),d(le,_.tagName,(ee={},d(ee,p.space,function(){if(Re)de=_.tagEnd;else de=_.attributeNameStart,_e(m.openTag,Ae)}),d(ee,p.gt,function(){if(Re)_e(m.closeTag,Ae);else _e(m.openTag,Ae);me="",de=_.data}),d(ee,p.slash,function(){de=_.tagEnd,_e(m.openTag,Ae)}),d(ee,p.char,function(Se){if(Ae+=Se,Ae==="![CDATA[")de=_.cdata,me="",Ae=""}),ee)),d(le,_.tagEnd,(se={},d(se,p.gt,function(){_e(m.closeTag,Ae),me="",de=_.data}),d(se,p.char,u),se)),d(le,_.attributeNameStart,(ne={},d(ne,p.char,function(Se){xe=Se,de=_.attributeName}),d(ne,p.gt,function(){me="",de=_.data}),d(ne,p.space,u),d(ne,p.slash,function(){Re=!0,de=_.tagEnd}),ne)),d(le,_.attributeName,(re={},d(re,p.space,function(){de=_.attributeNameEnd}),d(re,p.equal,function(){_e(m.attributeName,xe),de=_.attributeValueBegin}),d(re,p.gt,function(){Me="",_e(m.attributeName,xe),_e(m.attributeValue,Me),me="",de=_.data}),d(re,p.slash,function(){Re=!0,Me="",_e(m.attributeName,xe),_e(m.attributeValue,Me),de=_.tagEnd}),d(re,p.char,function(Se){xe+=Se}),re)),d(le,_.attributeNameEnd,(Z={},d(Z,p.space,u),d(Z,p.equal,function(){_e(m.attributeName,xe),de=_.attributeValueBegin}),d(Z,p.gt,function(){Me="",_e(m.attributeName,xe),_e(m.attributeValue,Me),me="",de=_.data}),d(Z,p.char,function(Se){Me="",_e(m.attributeName,xe),_e(m.attributeValue,Me),xe=Se,de=_.attributeName}),Z)),d(le,_.attributeValueBegin,(te={},d(te,p.space,u),d(te,p.quote,function(Se){we=Se,Me="",de=_.attributeValue}),d(te,p.gt,function(){Me="",_e(m.attributeValue,Me),me="",de=_.data}),d(te,p.char,function(Se){we="",Me=Se,de=_.attributeValue}),te)),d(le,_.attributeValue,(ie={},d(ie,p.space,function(Se){if(we)Me+=Se;else _e(m.attributeValue,Me),de=_.attributeNameStart}),d(ie,p.quote,function(Se){if(we===Se)_e(m.attributeValue,Me),de=_.attributeNameStart;else Me+=Se}),d(ie,p.gt,function(Se){if(we)Me+=Se;else _e(m.attributeValue,Me),me="",de=_.data}),d(ie,p.slash,function(Se){if(we)Me+=Se;else _e(m.attributeValue,Me),Re=!0,de=_.tagEnd}),d(ie,p.char,function(Se){Me+=Se}),ie)),le);var ye=function(Ne){if(X.debug)console.log(de,Ne);var ke=ue.stateMachine[de],nt=ke[g(Ne)]||ke[p.error]||ke[p.char];nt(Ne)};return ue.write=function(Se){var Ne=Se.length;for(var ke=0;ke<Ne;ke++)ye(Se[ke])},ue},y={State:_,Action:p,Type:m,create:f},x=y.Type,C={element:"element",text:"text"},b=function(X){return Object.assign({name:"",type:C.element,value:"",parent:null,attributes:{},children:[]},X)},I=function(X){X=Object.assign({stream:!1,parentNodes:!0,doneEvent:"done",tagPrefix:"tag:",emitTopLevelOnly:!1,debug:!1},X);var K=void 0,J=void 0,ee=void 0,se=void 0,ne=new h,re=function(te){switch(te.type){case x.openTag:if(ee===null)ee=J,ee.name=te.value;else{var ie=b({name:te.value,parent:ee});ee.children.push(ie),ee=ie}break;case x.closeTag:var le=ee.parent;if(!X.parentNodes)ee.parent=null;if(ee.name!==te.value)break;if(X.stream&&le===J)J.children=[],ee.parent=null;if(!X.emitTopLevelOnly||le===J)ne.emit(X.tagPrefix+ee.name,ee),ne.emit("tag",ee.name,ee);if(ee===J)K.removeAllListeners("data"),ne.emit(X.doneEvent,ee),J=null;ee=le;break;case x.text:if(ee)ee.children.push(b({type:C.text,value:te.value,parent:X.parentNodes?ee:null}));break;case x.attributeName:se=te.value,ee.attributes[se]="";break;case x.attributeValue:ee.attributes[se]=te.value;break}};return ne.reset=function(){K=y.create({debug:X.debug}),K.on("data",re),J=b(),ee=null,se="",ne.parse=K.write},ne.reset(),ne},v=function(X,K){K=Object.assign({},K,{stream:!1,tagPrefix:":"});var J=I(K),ee=void 0;return J.on("done",function(se){ee=se}),J.parse(X),ee},P={parseSync:v,create:I,NodeType:C},M=P.parseSync,B=function(X){var K=M("<root>".concat(X,"</root>"),{parentNodes:!1}),J=K.children&&K.children.length>0&&K.children.every(function(ee){return ee.name==="svg"});if(J)return K.children.length===1?K.children[0]:K.children;else throw Error("nothing to parse")},T=function(X){return l(X,function(K){if(!D(K))return N(K);return K})},N=function(X){return X.replace(/[-|:]([a-z])/gi,function(K,J){return J.toUpperCase()})},D=function(X){return/^(data|aria)(-\w+)/.test(X)},L=function(X){if(X){var K=String(X);return/[&<>]/.test(K)?"<![CDATA[".concat(K.replace(/]]>/,"]]]]><![CDATA[>"),"]]>"):K}return""},H=function(X){return String(X).replace(/&/g,"&amp;").replace(/'/g,"&apos;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},V=function(X){var K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},J=K.transformNode,ee=J===void 0?function(Z){return Z}:J,se=K.camelcase,ne=se===void 0?!1:se,re=function(te){var ie=ee(te);if(ne)ie=T(ie);return ie};return re(B(X))};function O(){for(var Y=arguments.length,X=Array(Y),K=0;K<Y;K++)X[K]=arguments[K];return new Promise(function(J,ee){try{var se=V.apply(void 0,X);J(se)}catch(ne){ee(ne)}})}var U=function Y(X){var K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},J=K.transformAttr,ee=J===void 0?function(de,me,Ae){return"".concat(de,'="').concat(Ae(me),'"')}:J,se=K.transformNode,ne=se===void 0?function(de){return de}:se,re=K.selfClose,Z=re===void 0?!0:re;if(Array.isArray(X))return X.map(function(de){return Y(de,{transformAttr:ee,selfClose:Z,transformNode:ne})}).join("");var te=ne(X);if(te.type==="text")return L(te.value);var ie="";for(var le in te.attributes){var ue=ee(le,te.attributes[le],H,te.name);ie+=ue?" ".concat(ue):""}return te.children&&te.children.length>0||!Z?"<".concat(te.name).concat(ie,">").concat(Y(te.children,{transformAttr:ee,transformNode:ne,selfClose:Z}),"</").concat(te.name,">"):"<".concat(te.name).concat(ie,"/>")},j=Object.assign({},{parse:O,parseSync:V,stringify:U});return j})}}),Jdo=bTe.createContext(null),qts=()=>bTe.useContext(Jdo),Zdo=!0,Jts=!1,Dme={CCW:-1,CW:1,NOT_ORIENTABLE:0},Zts=2*Math.PI,fTe=1,euo=0,QE=2,ens=3,tns=4,nns=1,ons=2,Rgt=0,Nme=1,vne=2,yTe=Object.freeze({__proto__:null,BOUNDARY:QE,CCW:Zdo,CONTAINS:ens,CW:Jts,END_VERTEX:vne,INSIDE:fTe,INTERLACE:tns,NOT_VERTEX:Rgt,ORIENTATION:Dme,OUTSIDE:euo,OVERLAP_OPPOSITE:ons,OVERLAP_SAME:nns,PIx2:Zts,START_VERTEX:Nme}),OE=0.000001;function tuo(e){OE=e}function nuo(){return OE}var rns=3;function mgt(e){return e<OE&&e>-OE}function wU(e,t){return e-t<OE&&e-t>-OE}function ouo(e,t){return e-t>OE}function ins(e,t){return e-t>-OE}function ruo(e,t){return e-t<-OE}function sns(e,t){return e-t<OE}var ans=Object.freeze({__proto__:null,DECIMALS:rns,EQ:wU,EQ_0:mgt,GE:ins,GT:ouo,LE:sns,LT:ruo,getTolerance:nuo,setTolerance:tuo}),Oe={Utils:ans,Errors:void 0,Matrix:void 0,Planar_set:void 0,Point:void 0,Vector:void 0,Line:void 0,Circle:void 0,Segment:void 0,Arc:void 0,Box:void 0,Edge:void 0,Face:void 0,Ray:void 0,Ray_shooting:void 0,Multiline:void 0,Polygon:void 0,Distance:void 0,Inversion:void 0};for(let e in yTe)Oe[e]=yTe[e];Object.defineProperty(Oe,"DP_TOL",{get:function(){return nuo()},set:function(e){tuo(e)}});var R0=class{static get ILLEGAL_PARAMETERS(){return ReferenceError("Illegal Parameters")}static get ZERO_DIVISION(){return Error("Zero division")}static get UNRESOLVED_BOUNDARY_CONFLICT(){return Error("Unresolved boundary conflict in boolean operation")}static get INFINITE_LOOP(){return Error("Infinite loop")}static get CANNOT_COMPLETE_BOOLEAN_OPERATION(){return Error("Cannot complete boolean operation")}static get CANNOT_INVOKE_ABSTRACT_METHOD(){return Error("Abstract method cannot be invoked")}static get OPERATION_IS_NOT_SUPPORTED(){return Error("Operation is not supported")}static get UNSUPPORTED_SHAPE_TYPE(){return Error("Unsupported shape type")}};Oe.Errors=R0;var Qgt=class{constructor(e,t){this.first=e,this.last=t||this.first}[Symbol.iterator](){let e=void 0;return{next:()=>(e=e?e.next:this.first,{value:e,done:e===void 0})}}get size(){let e=0;for(let t of this)e++;return e}toArray(e=void 0,t=void 0){let n=[],o=e||this.first,r=t||this.last,i=o;if(i===void 0)return n;do n.push(i),i=i.next;while(i!==r.next);return n}append(e){if(this.isEmpty())this.first=e;else e.prev=this.last,this.last.next=e;return this.last=e,this.last.next=void 0,this.first.prev=void 0,this}insert(e,t){if(this.isEmpty())this.first=e,this.last=e;else if(t===null||t===void 0)e.next=this.first,this.first.prev=e,this.first=e;else{let n=t.next;if(t.next=e,n)n.prev=e;if(e.prev=t,e.next=n,this.last===t)this.last=e}return this.last.next=void 0,this.first.prev=void 0,this}remove(e){if(e===this.first&&e===this.last)this.first=void 0,this.last=void 0;else{if(e.prev)e.prev.next=e.next;if(e.next)e.next.prev=e.prev;if(e===this.first)this.first=e.next;if(e===this.last)this.last=e.prev}return this}isEmpty(){return this.first===void 0}static testInfiniteLoop(e){let t=e,n=e;do{if(t!=e&&t===n)throw R0.INFINITE_LOOP;t=t.next,n=n.next.next}while(t!=e)}},odo={stroke:"black"},cns=class{constructor(e=odo){for(let t in e)this[t]=e[t];this.stroke=e.stroke??odo.stroke}toAttributesString(){return Object.keys(this).reduce((e,t)=>e+(this[t]!==void 0?this.toAttrString(t,this[t]):""),"")}toAttrString(e,t){let n=e==="className"?"class":this.convertCamelToKebabCase(e);return t===null?`${n} `:`${n}="${t.toString()}" `}convertCamelToKebabCase(e){return e.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g).join("-").toLowerCase()}};function DU(e){return new cns(e).toAttributesString()}function Dne(e,t){let n=[],[o,r,i]=e.standard,[s,a,c]=t.standard,l=o*a-r*s,h=i*a-r*c,d=o*c-i*s;if(!Oe.Utils.EQ_0(l)){let u,_;if(r===0)u=i/o,_=d/l;else if(a===0)u=c/s,_=d/l;else if(o===0)u=h/l,_=i/r;else if(s===0)u=h/l,_=c/a;else u=h/l,_=d/l;n.push(new Oe.Point(u,_))}return n}function NU(e,t){let n=[],o=t.pc.projectionOn(e),r=t.pc.distanceTo(o)[0];if(Oe.Utils.EQ(r,t.r))n.push(o);else if(Oe.Utils.LT(r,t.r)){let i=Math.sqrt(t.r*t.r-r*r),s,a;s=e.norm.rotate90CCW().multiply(i),a=o.translate(s),n.push(a),s=e.norm.rotate90CW().multiply(i),a=o.translate(s),n.push(a)}return n}function Mne(e,t){let n=[];for(let o of t.toSegments()){let r=Ume(o,e);for(let i of r)if(!puo(i,n))n.push(i)}return n}function ITe(e,t){let n=[];if(Mne(e,t.box).length===0)return n;let o=new Oe.Circle(t.pc,t.r),r=NU(e,o);for(let i of r)if(i.on(t))n.push(i);return n}function Ume(e,t){let n=[];if(e.ps.on(t))n.push(e.ps);if(e.pe.on(t)&&!e.isZeroLength())n.push(e.pe);if(n.length>0)return n;if(e.isZeroLength())return n;if(e.ps.leftTo(t)&&e.pe.leftTo(t)||!e.ps.leftTo(t)&&!e.pe.leftTo(t))return n;let o=new Oe.Line(e.ps,e.pe);return Dne(o,t)}function vTe(e,t){let n=[];if(e.isZeroLength()){if(e.ps.on(t))n.push(e.ps);return n}if(t.isZeroLength()){if(t.ps.on(e))n.push(t.ps);return n}let o=new Oe.Line(e.ps,e.pe),r=new Oe.Line(t.ps,t.pe);if(o.incidentTo(r)){if(e.ps.on(t))n.push(e.ps);if(e.pe.on(t))n.push(e.pe);if(t.ps.on(e)&&!t.ps.equalTo(e.ps)&&!t.ps.equalTo(e.pe))n.push(t.ps);if(t.pe.on(e)&&!t.pe.equalTo(e.ps)&&!t.pe.equalTo(e.pe))n.push(t.pe)}else if(o.parallelTo(r)){let i=new Oe.Vector(e.ps,e.pe),s=new Oe.Vector(t.ps,t.pe),a=new Oe.Vector(e.ps,t.ps),c=i.cross(s);if(!Oe.Utils.EQ_0(c)){let l=a.cross(s)/c,h=a.cross(i)/c;if(Oe.Utils.GE(l,0)&&Oe.Utils.LE(l,1)&&Oe.Utils.GE(h,0)&&Oe.Utils.LE(h,1))n.push(rdo(e.ps.translate(i.multiply(l)),e,t))}}else{let i=Dne(o,r);if(i.length>0){if(ido(i[0],e)&&ido(i[0],t))n.push(rdo(i[0],e,t))}}return n}function rdo(e,t,n){for(let o of[t.ps,t.pe,n.ps,n.pe])if(e.equalTo(o))return o;return e}function ido(e,t){let n=t.box;return Oe.Utils.LE(e.x,n.xmax)&&Oe.Utils.GE(e.x,n.xmin)&&Oe.Utils.LE(e.y,n.ymax)&&Oe.Utils.GE(e.y,n.ymin)}function STe(e,t){let n=[];if(e.isZeroLength()){let[i,s]=e.ps.distanceTo(t.pc);if(Oe.Utils.EQ(i,t.r))n.push(e.ps);return n}let o=new Oe.Line(e.ps,e.pe),r=NU(o,t);for(let i of r)if(i.on(e))n.push(i);return n}function Nne(e,t){let n=[];if(e.isZeroLength()){if(e.ps.on(t))n.push(e.ps);return n}let o=new Oe.Line(e.ps,e.pe),r=new Oe.Circle(t.pc,t.r),i=NU(o,r);for(let s of i)if(s.on(e)&&s.on(t))n.push(s);return n}function lns(e,t){let n=[];for(let o of t.toSegments()){let r=vTe(o,e);for(let i of r)n.push(i)}return n}function iuo(e,t){let n=[],o=new Oe.Vector(e.pc,t.pc),r=e.r,i=t.r;if(Oe.Utils.EQ_0(r)||Oe.Utils.EQ_0(i))return n;if(Oe.Utils.EQ_0(o.x)&&Oe.Utils.EQ_0(o.y)&&Oe.Utils.EQ(r,i))return n.push(e.pc.translate(-r,0)),n;let s=e.pc.distanceTo(t.pc)[0];if(Oe.Utils.GT(s,r+i))return n;if(Oe.Utils.LT(s,Math.abs(r-i)))return n;o.x/=s,o.y/=s;let a;if(Oe.Utils.EQ(s,r+i)||Oe.Utils.EQ(s,Math.abs(r-i)))return a=e.pc.translate(r*o.x,r*o.y),n.push(a),n;let c=r*r/(2*s)-i*i/(2*s)+s/2,l=e.pc.translate(c*o.x,c*o.y),h=Math.sqrt(r*r-c*c);return a=l.translate(o.rotate90CCW().multiply(h)),n.push(a),a=l.translate(o.rotate90CW().multiply(h)),n.push(a),n}function hns(e,t){let n=[];for(let o of t.toSegments()){let r=STe(o,e);for(let i of r)n.push(i)}return n}function suo(e,t){let n=[];if(e.pc.equalTo(t.pc)&&Oe.Utils.EQ(e.r,t.r)){let s;if(s=e.start,s.on(t))n.push(s);if(s=e.end,s.on(t))n.push(s);if(s=t.start,s.on(e))n.push(s);if(s=t.end,s.on(e))n.push(s);return n}let o=new Oe.Circle(e.pc,e.r),r=new Oe.Circle(t.pc,t.r),i=o.intersect(r);for(let s of i)if(s.on(e)&&s.on(t))n.push(s);return n}function kgt(e,t){let n=[];if(t.pc.equalTo(e.pc)&&Oe.Utils.EQ(t.r,e.r))return n.push(e.start),n.push(e.end),n;let o=t,r=new Oe.Circle(e.pc,e.r),i=iuo(o,r);for(let s of i)if(s.on(e))n.push(s);return n}function dns(e,t){let n=[];for(let o of t.toSegments()){let r=Nne(o,e);for(let i of r)n.push(i)}return n}function auo(e,t){return e.isSegment?vTe(e.shape,t):Nne(t,e.shape)}function cuo(e,t){return e.isSegment?Nne(e.shape,t):suo(e.shape,t)}function luo(e,t){return e.isSegment?Ume(e.shape,t):ITe(t,e.shape)}function uns(e,t){return e.isSegment?Fgt(t,e.shape):zgt(t,e.shape)}function pns(e,t){return e.isSegment?STe(e.shape,t):kgt(e.shape,t)}function Lgt(e,t){let n=[];for(let o of t.edges)for(let r of auo(o,e))n.push(r);return n}function Hgt(e,t){let n=[];for(let o of t.edges)for(let r of cuo(o,e))n.push(r);return n}function Wme(e,t){let n=[];if(t.isEmpty())return n;for(let o of t.edges)for(let r of luo(o,e))if(!puo(r,n))n.push(r);return e.sortPoints(n)}function huo(e,t){let n=[];if(t.isEmpty())return n;for(let o of t.edges)for(let r of pns(o,e))n.push(r);return n}function duo(e,t){if(e.isSegment)return auo(t,e.shape);else if(e.isArc)return cuo(t,e.shape);else if(e.isLine)return luo(t,e.shape);else if(e.isRay)return uns(t,e.shape);return[]}function uuo(e,t){let n=[];if(t.isEmpty()||e.shape.box.not_intersect(t.box))return n;let o=t.edges.search(e.shape.box);for(let r of o)n=[...n,...duo(e,r)];return n}function mns(e,t){let n=[];if(t.isEmpty()||e.size===0)return n;for(let o of e)n=[...n,...uuo(o,t)];return n}function _ns(e,t){let n=[];if(e.isEmpty()||t.isEmpty())return n;if(e.box.not_intersect(t.box))return n;for(let o of e.edges)n=[...n,...uuo(o,t)];return n}function gns(e,t){if(e instanceof Oe.Line)return Wme(e,t);else if(e instanceof Oe.Segment)return Lgt(e,t);else if(e instanceof Oe.Arc)return Hgt(e,t);else return[]}function puo(e,t){return t.some((n)=>n.equalTo(e))}function EH(e){return new Oe.Line(e.start,e.norm)}function Fgt(e,t){return Ume(t,EH(e)).filter((n)=>e.contains(n))}function zgt(e,t){return ITe(EH(e),t).filter((n)=>e.contains(n))}function muo(e,t){return NU(EH(e),t).filter((n)=>e.contains(n))}function Ans(e,t){return Mne(EH(e),t).filter((n)=>e.contains(n))}function _uo(e,t){return Dne(EH(e),t).filter((n)=>e.contains(n))}function fns(e,t){return Dne(EH(e),EH(t)).filter((n)=>e.contains(n)).filter((n)=>t.contains(n))}function guo(e,t){return Wme(EH(e),t).filter((n)=>e.contains(n))}function Auo(e,t){if(e.intersect&&e.intersect instanceof Function)return e.intersect(t);throw R0.UNSUPPORTED_SHAPE_TYPE}function Rne(e,t){let n=[];for(let o of t)n=[...n,...Auo(e,o.shape)];return n}function yns(e,t){let n=[];for(let o of e)for(let r of t)n=[...n,...Auo(o.shape,r.shape)];return n}var RU=class e extends Qgt{constructor(...t){super();if(this.isInfinite=!1,t.length===1&&t[0]instanceof Array&&t[0].length>0){let n=t[0],o=n.length,r=(c)=>c instanceof Oe.Segment||c instanceof Oe.Arc||c instanceof Oe.Ray||c instanceof Oe.Line,i=(c)=>c instanceof Oe.Segment||c instanceof Oe.Arc||c instanceof Oe.Ray,s=(c)=>c instanceof Oe.Segment||c instanceof Oe.Arc;if(o===1&&r(n[0])||o>1&&i(n[0])&&i(n[o-1])&&n.slice(1,o-1).every(s)){this.isInfinite=n.some((c)=>c instanceof Oe.Ray||c instanceof Oe.Line);for(let c of n){let l=new Oe.Edge(c);this.append(l)}this.setArcLength()}else throw Oe.Errors.ILLEGAL_PARAMETERS}}get edges(){return[...this]}get box(){return this.edges.reduce((t,n)=>t.merge(n.box),new Oe.Box)}get vertices(){let t=this.edges.map((n)=>n.start);return t.push(this.last.end),t}get length(){if(this.isEmpty())return 0;if(this.isInfinite)return Number.POSITIVE_INFINITY;let t=0;for(let n of this)t+=n.length;return t}clone(){return new e(this.toShapes())}setArcLength(){for(let t of this)this.setOneEdgeArcLength(t)}setOneEdgeArcLength(t){if(t===this.first)t.arc_length=0;else t.arc_length=t.prev.arc_length+t.prev.length}pointAtLength(t){if(t>this.length||t<0)return null;if(this.isInfinite)return null;let n=null;for(let o of this)if(t>=o.arc_length&&(o===this.last||t<o.next.arc_length)){n=o.pointAtLength(t-o.arc_length);break}return n}addVertex(t,n){let o=n.shape.split(t);if(o[0]===null)return n.prev;if(o[1]===null)return n;let r=new Oe.Edge(o[0]),i=n.prev;return this.insert(r,i),n.shape=o[1],r}getChain(t,n){let o=[];for(let r=t;r!==n.next;r=r.next)o.push(r);return o}split(t){for(let n of t){let o=this.findEdgeByPoint(n);this.addVertex(n,o)}return this}findEdgeByPoint(t){let n;for(let o of this)if(o.shape.contains(t)){n=o;break}return n}distanceTo(t){if(t instanceof Oe.Point){let[n,o]=Oe.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof Oe.Line){let[n,o]=Oe.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof Oe.Circle){let[n,o]=Oe.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof Oe.Segment){let[n,o]=Oe.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof Oe.Arc){let[n,o]=Oe.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof Oe.Box){let[n,o]=Oe.Distance.shape2multiline(new Oe.Polygon(t),this);return[n,o.reverse()]}if(t instanceof Oe.Multiline)return Oe.Distance.multiline2multiline(this,t);throw Oe.Errors.UNSUPPORTED_SHAPE_TYPE}intersect(t){if(t instanceof Oe.Multiline)return yns(this,t);else return Rne(t,this)}contains(t){if(t instanceof Oe.Point)return this.edges.some((n)=>n.shape.contains(t));throw Oe.Errors.UNSUPPORTED_SHAPE_TYPE}translate(t){return new e(this.edges.map((n)=>n.shape.translate(t)))}rotate(t=0,n=new Oe.Point){return new e(this.edges.map((o)=>o.shape.rotate(t,n)))}transform(t=new Oe.Matrix){return new e(this.edges.map((n)=>n.shape.transform(t)))}toShapes(){return this.edges.map((t)=>t.shape.clone())}toJSON(){return this.edges.map((t)=>t.toJSON())}svgPoints(){return this.vertices.map((t)=>`${t.x},${t.y}`).join(" ")}dpath(){let t=`M${this.first.start.x},${this.first.start.y}`;for(let n of this)t+=n.svg();return t}svg(t={}){let n=`
<path ${DU({fill:"none",...t})} d="`;n+=`
M${this.first.start.x},${this.first.start.y}`;for(let o of this)n+=o.svg();return n+=`" >
</path>`,n}};Oe.Multiline=RU;var xns=(...e)=>new Oe.Multiline(...e);Oe.multiline=xns;function wne(e,t,n){let o=n.length,r=e.shape.split(t);if(r.length===0)return;let i=0;if(r[0]===null)i=0;else if(r[1]===null)i=e.shape.length;else i=r[0].length;let s=Rgt;if(wU(i,0))s|=Nme;if(wU(i,e.shape.length))s|=vne;let a;if(i===1/0)a=r[0].coord(t);else a=s&vne&&e.next&&e.next.arc_length===0?0:e.arc_length+i;n.push({id:o,pt:t,arc_length:a,edge_before:e,edge_after:void 0,face:e.face,is_vertex:s})}function kme(e){e.int_points1_sorted=IH(e.int_points1),e.int_points2_sorted=IH(e.int_points2)}function IH(e){let t=new Map,n=0;for(let r of e)if(!t.has(r.face))t.set(r.face,n),n++;for(let r of e)r.faceId=t.get(r.face);return e.slice().sort(Cns)}function Cns(e,t){if(e.faceId<t.faceId)return-1;if(e.faceId>t.faceId)return 1;if(e.arc_length<t.arc_length)return-1;if(e.arc_length>t.arc_length)return 1;return 0}function Ogt(e){if(e.int_points1.length<2)return;let t=!1,n,o,r,i;for(let s=0;s<e.int_points1_sorted.length;s++){if(e.int_points1_sorted[s].id===-1)continue;n=e.int_points1_sorted[s],o=e.int_points2[n.id];for(let a=s+1;a<e.int_points1_sorted.length;a++){if(r=e.int_points1_sorted[a],!wU(r.arc_length,n.arc_length))break;if(r.id===-1)continue;if(i=e.int_points2[r.id],i.id===-1)continue;if(r.edge_before===n.edge_before&&r.edge_after===n.edge_after&&i.edge_before===o.edge_before&&i.edge_after===o.edge_after)r.id=-1,i.id=-1,t=!0}}o=e.int_points2_sorted[0],n=e.int_points1[o.id];for(let s=1;s<e.int_points2_sorted.length;s++){let a=e.int_points2_sorted[s];if(a.id===-1)continue;if(o.id===-1||!wU(a.arc_length,o.arc_length)){o=a,n=e.int_points1[o.id];continue}let c=e.int_points1[a.id];if(c.edge_before===n.edge_before&&c.edge_after===n.edge_after&&a.edge_before===o.edge_before&&a.edge_after===o.edge_after)c.id=-1,a.id=-1,t=!0}if(t)e.int_points1=e.int_points1.filter((s)=>s.id>=0),e.int_points2=e.int_points2.filter((s)=>s.id>=0),e.int_points1.forEach((s,a)=>s.id=a),e.int_points2.forEach((s,a)=>s.id=a)}function _gt(e){for(let t of e){if(t.edge_before)t.edge_before.bvStart=void 0,t.edge_before.bvEnd=void 0,t.edge_before.bv=void 0,t.edge_before.overlap=void 0;if(t.edge_after)t.edge_after.bvStart=void 0,t.edge_after.bvEnd=void 0,t.edge_after.bv=void 0,t.edge_after.overlap=void 0}for(let t of e){if(t.edge_before)t.edge_before.bvEnd=QE;if(t.edge_after)t.edge_after.bvStart=QE}}function ggt(e,t){for(let n of e){if(n.edge_before)n.edge_before.setInclusion(t);if(n.edge_after)n.edge_after.setInclusion(t)}}function bns(e){let t=void 0,n=void 0,o=void 0,r=e.int_points1.length;for(let i=0;i<r;i++){let s=e.int_points1_sorted[i];if(s.face!==t)n=i,t=s.face;let a=i,c=Bne(e.int_points1_sorted,i,t),l;if(a+c<r&&e.int_points1_sorted[a+c].face===t)l=a+c;else l=n;let h=Bne(e.int_points1_sorted,l,t);o=null;for(let g=l;g<l+h;g++){let f=e.int_points1_sorted[g];if(f.face===t&&e.int_points2[f.id].face===e.int_points2[s.id].face){o=f;break}}if(o===null)continue;let d=s.edge_after,u=o.edge_before;if(!(d.bv===QE&&u.bv===QE))continue;if(d!==u)continue;let _=e.int_points2[s.id],p=e.int_points2[o.id],m=_.edge_after,A=p.edge_before;if(!(m.bv===QE&&A.bv===QE&&m===A))_=e.int_points2[o.id],p=e.int_points2[s.id],m=_.edge_after,A=p.edge_before;if(!(m.bv===QE&&A.bv===QE&&m===A))continue;d.setOverlap(m)}}function Bne(e,t,n){let o,r,i=1;if(e.length===1)return 1;o=e[t];for(let s=t+1;s<e.length;s++){if(o.face!==n)break;if(r=e[s],!(r.pt.equalTo(o.pt)&&r.edge_before===o.edge_before&&r.edge_after===o.edge_after))break;i++}return i}function Tne(e,t){if(!t)return;for(let n of t){let o=n.edge_before;if(n.is_vertex=Rgt,o.shape.start&&o.shape.start.equalTo(n.pt))n.is_vertex|=Nme;if(o.shape.end&&o.shape.end.equalTo(n.pt))n.is_vertex|=vne;if(n.is_vertex&Nme){if(n.edge_before=o.prev,o.prev)n.is_vertex=vne;continue}if(n.is_vertex&vne)continue;let r=e.addVertex(n.pt,o);n.edge_before=r}for(let n of t)if(n.edge_before)n.edge_after=n.edge_before.next;else if(e instanceof RU&&n.is_vertex&Nme)n.edge_after=e.first}function sdo(e,t,n){let o=e.edge_before,r=t.edge_after,i=n.length;o.next=n[0],n[0].prev=o,n[i-1].next=r,r.prev=n[i-1]}var{INSIDE:LE,OUTSIDE:HE,BOUNDARY:If,OVERLAP_SAME:Ins,OVERLAP_OPPOSITE:vns}=yTe,{NOT_VERTEX:Nka,START_VERTEX:ado,END_VERTEX:cdo}=yTe,PTe=1,Xme=2,BU=3;function Sns(e,t){let[n,o]=jme(e,t,PTe,!0);return n}function Agt(e,t){let o=t.clone().reverse(),[r,i]=jme(e,o,BU,!0);return r}function fuo(e,t){let[n,o]=jme(e,t,Xme,!0);return n}function yuo(e,t){let[n,o]=jme(e,t,Xme,!1),r=[];for(let s of n.faces)r=[...r,...[...s.edges].map((a)=>a.shape)];let i=[];for(let s of o.faces)i=[...i,...[...s.edges].map((a)=>a.shape)];return[r,i]}function fgt(e,t){let[n,o]=jme(e,t,BU,!1),r=[];for(let i of n.faces)r=[...r,...[...i.edges].map((s)=>s.shape)];return r}function xuo(e,t){let n=e.clone(),o=t.clone(),r=Cuo(n,o);kme(r),Tne(n,r.int_points1_sorted),Tne(o,r.int_points2_sorted),Ogt(r),kme(r);let i=r.int_points1_sorted.map((a)=>a.pt),s=r.int_points2_sorted.map((a)=>a.pt);return[i,s]}function Pns(e,t,n,o){let r=ldo(e,n.int_points1),i=ldo(t,n.int_points2);hdo(r,t),hdo(i,e),_gt(n.int_points1),_gt(n.int_points2),ggt(n.int_points1,t),ggt(n.int_points2,e);while(Mns(e,t,n.int_points1,n.int_points1_sorted,n.int_points2,n));bns(n),ygt(e,o,n.int_points1_sorted,!0),ygt(t,o,n.int_points2_sorted,!1),ddo(e,r,o,!0),ddo(t,i,o,!1)}function Ens(e,t,n,o){wns(e,t,o,n.int_points2),Bns(e,t,n),xgt(e,n.int_points1),xgt(t,n.int_points2),Cgt(e,n.int_points1,n.int_points2),Cgt(e,n.int_points2,n.int_points1),udo(e),udo(t)}function jme(e,t,n,o){let r=e.clone(),i=t.clone(),s=Cuo(r,i);if(kme(s),Tne(r,s.int_points1_sorted),Tne(i,s.int_points2_sorted),Ogt(s),kme(s),Pns(r,i,s,n),o)Ens(r,i,s,n);return[r,i]}function Cuo(e,t){let n={int_points1:[],int_points2:[]};for(let o of e.edges){let r=t.edges.search(o.box);for(let i of r){let s=o.shape.intersect(i.shape);for(let a of s)wne(o,a,n.int_points1),wne(i,a,n.int_points2)}}return n}function ldo(e,t){let n=[];for(let o of e.faces)if(!t.find((r)=>r.face===o))n.push(o);return n}function hdo(e,t){for(let n of e)n.first.bv=n.first.bvStart=n.first.bvEnd=void 0,n.first.setInclusion(t)}function Mns(e,t,n,o,r,i){let s,a,c,l=o.length,h=!1;for(let d=0;d<l;d++){let u=o[d];if(u.face!==s)a=d,s=u.face;let _=d,p=Bne(o,d,s),m;if(_+p<l&&o[_+p].face===s)m=_+p;else m=a;let A=Bne(o,m,s);c=null;for(let y=m;y<m+A;y++){let x=o[y];if(x.face===s&&r[x.id].face===r[u.id].face){c=x;break}}if(c===null)continue;let g=u.edge_after,f=c.edge_before;if(g.bv===If&&f.bv!=If){g.bv=f.bv;continue}if(g.bv!=If&&f.bv===If){f.bv=g.bv;continue}if(g.bv===If&&f.bv===If&&g!=f||(g.bv===LE&&f.bv===HE||g.bv===HE&&f.bv===LE)){let y=g.next;while(y!=f)y.bvStart=void 0,y.bvEnd=void 0,y.bv=void 0,y.setInclusion(t),y=y.next}if(g.bv===If&&f.bv===If&&g!=f){let y=g.next,x;while(y!=f){if(y.bv!=If){if(x===void 0)x=y.bv;else if(y.bv!=x)throw R0.UNRESOLVED_BOUNDARY_CONFLICT}y=y.next}if(x!=null)g.bv=x,f.bv=x;continue}if(g.bv===LE&&f.bv===HE||g.bv===HE&&f.bv===LE){let y=g;while(y!=f){if(y.bvStart===g.bv&&y.bvEnd===f.bv){let[x,C]=y.shape.distanceTo(t);if(x<10*Oe.DP_TOL){wne(y,C.ps,n);let b=n[n.length-1];if(b.is_vertex&ado)b.edge_after=y,b.edge_before=y.prev,y.bvStart=If,y.bv=void 0,y.setInclusion(t);else if(b.is_vertex&cdo)b.edge_after=y.next,y.bvEnd=If,y.bv=void 0,y.setInclusion(t);else{let P=t.addVertex(b.pt,y);b.edge_before=P,b.edge_after=P.next,P.setInclusion(t),P.next.bvStart=If,P.next.bvEnd=void 0,P.next.bv=void 0,P.next.setInclusion(t)}let I=t.findEdgeByPoint(C.pe);wne(I,C.pe,r);let v=r[r.length-1];if(v.is_vertex&ado)v.edge_after=I,v.edge_before=I.prev;else if(v.is_vertex&cdo)v.edge_after=I.next;else{let P=r.find((B)=>B.edge_after===I),M=t.addVertex(v.pt,I);if(v.edge_before=M,v.edge_after=M.next,P)P.edge_after=M;M.bvStart=void 0,M.bvEnd=If,M.bv=void 0,M.setInclusion(e),M.next.bvStart=If,M.next.bvEnd=void 0,M.next.bv=void 0,M.next.setInclusion(e)}kme(i),h=!0;break}}y=y.next}if(h)break;throw R0.UNRESOLVED_BOUNDARY_CONFLICT}}return h}function ygt(e,t,n,o){if(!n)return;let r=void 0,i=void 0,s,a;for(let c=0;c<n.length;c++){if(s=n[c],s.face!==r)i=c,r=s.face;if(r.isEmpty())continue;let l=c,h=Bne(n,c,r),d;if(l+h<n.length&&n[l+h].face===s.face)d=l+h;else d=i;a=n[d];let u=d,_=Bne(n,u,r),p=s.edge_after,m=a.edge_before;if(p.bv===LE&&m.bv===LE&&t===PTe||p.bv===HE&&m.bv===HE&&t===Xme||(p.bv===HE||m.bv===HE)&&t===BU&&!o||(p.bv===LE||m.bv===LE)&&t===BU&&o||p.bv===If&&m.bv===If&&p.overlap&Ins&&o||p.bv===If&&m.bv===If&&p.overlap&vns){e.removeChain(r,p,m);for(let A=l;A<l+h;A++)n[A].edge_after=void 0;for(let A=u;A<u+_;A++)n[A].edge_before=void 0}c+=h-1}}function wns(e,t,n,o){for(let r of t.faces){for(let i of r)e.edges.add(i);if(o.find((i)=>i.face===r)===void 0)e.addFace(r.first,r.last)}}function Bns(e,t,n){if(n.int_points1.length===0)return;for(let o=0;o<n.int_points1.length;o++){let r=n.int_points1[o],i=n.int_points2[o];if(r.edge_before!==void 0&&r.edge_after===void 0){if(i.edge_before===void 0&&i.edge_after!==void 0)r.edge_before.next=i.edge_after,i.edge_after.prev=r.edge_before,r.edge_after=i.edge_after,i.edge_before=r.edge_before}if(i.edge_before!==void 0&&i.edge_after===void 0){if(r.edge_before===void 0&&r.edge_after!==void 0)i.edge_before.next=r.edge_after,r.edge_after.prev=i.edge_before,i.edge_after=r.edge_after,r.edge_before=i.edge_before}if(r.edge_before!==void 0&&r.edge_after===void 0)for(let s of n.int_points1_sorted){if(s===r)continue;if(s.edge_before===void 0&&s.edge_after!==void 0){if(s.pt.equalTo(r.pt))r.edge_before.next=s.edge_after,s.edge_after.prev=r.edge_before,r.edge_after=s.edge_after,s.edge_before=r.edge_before}}if(i.edge_before!==void 0&&i.edge_after===void 0)for(let s of n.int_points2_sorted){if(s===i)continue;if(s.edge_before===void 0&&s.edge_after!==void 0){if(s.pt.equalTo(i.pt))i.edge_before.next=s.edge_after,s.edge_after.prev=i.edge_before,i.edge_after=s.edge_after,s.edge_before=i.edge_before}}}}function xgt(e,t){for(let n of t){if(e.faces.delete(n.face),n.face=void 0,n.edge_before)n.edge_before.face=void 0;if(n.edge_after)n.edge_after.face=void 0}}function Cgt(e,t,n){for(let o of t){if(o.edge_before===void 0||o.edge_after===void 0)continue;if(o.face)continue;if(o.edge_after.face||o.edge_before.face)continue;let{edge_after:r,edge_before:i}=o;try{Qgt.testInfiniteLoop(r)}catch(a){throw R0.CANNOT_COMPLETE_BOOLEAN_OPERATION}let s=e.addFace(r,i);for(let a of t)if(a.edge_before&&a.edge_after&&a.edge_before.face===s&&a.edge_after.face===s)a.face=s;for(let a of n)if(a.edge_before&&a.edge_after&&a.edge_before.face===s&&a.edge_after.face===s)a.face=s}}function ddo(e,t,n,o){for(let r of t){let i=r.first.bv;if(n===PTe&&i===LE||n===BU&&i===LE&&o||n===BU&&i===HE&&!o||n===Xme&&i===HE)e.deleteFace(r)}}function udo(e){let t=[];for(let n of e.edges)if(!n.face||!e.faces.has(n.face))t.push(n);for(let n of t)e.edges.delete(n)}var Tns=Object.freeze({__proto__:null,BOOLEAN_INTERSECT:Xme,BOOLEAN_SUBTRACT:BU,BOOLEAN_UNION:PTe,calculateIntersections:xuo,innerClip:yuo,intersect:fuo,outerClip:fgt,removeNotRelevantChains:ygt,removeOldFaces:xgt,restoreFaces:Cgt,subtract:Agt,unify:Sns}),Dns=RegExp("T.F..FFF.|T.F...F.."),Nns=RegExp("T........|.T.......|...T.....|....T...."),Rns=RegExp("FT.......|F..T.....|F...T...."),Qns=RegExp("T.F..F..."),kns=RegExp("T.F..F...|.TF..F...|..FT.F...|..F.TF..."),Qne=class{constructor(){this.m=[,,,,,,,,,].fill(void 0)}get I2I(){return this.m[0]}set I2I(e){this.m[0]=e}get I2B(){return this.m[1]}set I2B(e){this.m[1]=e}get I2E(){return this.m[2]}set I2E(e){this.m[2]=e}get B2I(){return this.m[3]}set B2I(e){this.m[3]=e}get B2B(){return this.m[4]}set B2B(e){this.m[4]=e}get B2E(){return this.m[5]}set B2E(e){this.m[5]=e}get E2I(){return this.m[6]}set E2I(e){this.m[6]=e}get E2B(){return this.m[7]}set E2B(e){this.m[7]=e}get E2E(){return this.m[8]}set E2E(e){this.m[8]=e}toString(){return this.m.map((e)=>{if(e instanceof Array&&e.length>0)return"T";else if(e instanceof Array&&e.length===0)return"F";else return"*"}).join("")}equal(){return Dns.test(this.toString())}intersect(){return Nns.test(this.toString())}touch(){return Rns.test(this.toString())}inside(){return Qns.test(this.toString())}covered(){return kns.test(this.toString())}};function Rme(e,t){let n=void 0,o=new Oe.Ray(t),r=new Oe.Line(o.pt,o.norm),i=new Oe.Box(o.box.xmin-Oe.DP_TOL,o.box.ymin-Oe.DP_TOL,o.box.xmax+Oe.DP_TOL,o.box.ymax+Oe.DP_TOL);if(e.box.not_intersect(i))return Oe.OUTSIDE;let s=e.edges.search(i);if(s.length===0)return Oe.OUTSIDE;for(let h of s)if(h.shape.contains(t))return Oe.BOUNDARY;let a=[...e.faces],c=[];for(let h of s)for(let d of o.intersect(h.shape)){if(d.equalTo(t))return Oe.BOUNDARY;c.push({pt:d,edge:h,face_index:a.indexOf(h.face)})}c.sort((h,d)=>{if(ruo(h.pt.x,d.pt.x))return-1;if(ouo(h.pt.x,d.pt.x))return 1;if(h.face_index<d.face_index)return-1;if(h.face_index>d.face_index)return 1;if(h.edge.arc_length<d.edge.arc_length)return-1;if(h.edge.arc_length>d.edge.arc_length)return 1;return 0});let l=0;for(let h=0;h<c.length;h++){let d=c[h];if(d.pt.equalTo(d.edge.shape.start)){if(h>0&&d.pt.equalTo(c[h-1].pt)&&d.face_index===c[h-1].face_index&&d.edge.prev===c[h-1].edge)continue;let u=d.edge.prev;while(mgt(u.length))u=u.prev;let _=u.shape.tangentInEnd(),p=d.pt.translate(_),m=d.edge.shape.tangentInStart(),A=d.pt.translate(m),g=p.leftTo(r),f=A.leftTo(r);if(g&&!f||!g&&f)l++}else if(d.pt.equalTo(d.edge.shape.end)){if(h>0&&d.pt.equalTo(c[h-1].pt)&&d.face_index===c[h-1].face_index&&d.edge.next===c[h-1].edge)continue;let u=d.edge.next;while(mgt(u.length))u=u.next;let _=u.shape.tangentInStart(),p=d.pt.translate(_),m=d.edge.shape.tangentInEnd(),A=d.pt.translate(m),g=p.leftTo(r),f=A.leftTo(r);if(g&&!f||!g&&f)l++}else if(d.edge.shape instanceof Oe.Segment)l++;else{let u=d.edge.shape.box;if(!(wU(d.pt.y,u.ymin)||wU(d.pt.y,u.ymax)))l++}}return n=l%2===1?fTe:euo,n}function Lns(e,t){return kne(e,t).equal()}function buo(e,t){return kne(e,t).intersect()}function Hns(e,t){return kne(e,t).touch()}function Fns(e,t){return!buo(e,t)}function Iuo(e,t){return kne(e,t).inside()}function vuo(e,t){return kne(e,t).covered()}function zns(e,t){return Iuo(t,e)}function Suo(e,t){return vuo(t,e)}function kne(e,t){if(e instanceof Oe.Line&&t instanceof Oe.Line)return Ons(e,t);else if(e instanceof Oe.Line&&t instanceof Oe.Circle)return Vns(e,t);else if(e instanceof Oe.Line&&t instanceof Oe.Box)return Yns(e,t);else if(e instanceof Oe.Line&&t instanceof Oe.Polygon)return Gns(e,t);else if((e instanceof Oe.Segment||e instanceof Oe.Arc)&&t instanceof Oe.Polygon)return pdo(e,t);else if((e instanceof Oe.Segment||e instanceof Oe.Arc)&&(t instanceof Oe.Circle||t instanceof Oe.Box))return pdo(e,new Oe.Polygon(t));else if(e instanceof Oe.Polygon&&t instanceof Oe.Polygon)return hTe(e,t);else if((e instanceof Oe.Circle||e instanceof Oe.Box)&&(t instanceof Oe.Circle||t instanceof Oe.Box))return hTe(new Oe.Polygon(e),new Oe.Polygon(t));else if((e instanceof Oe.Circle||e instanceof Oe.Box)&&t instanceof Oe.Polygon)return hTe(new Oe.Polygon(e),t);else if(e instanceof Oe.Polygon&&(t instanceof Oe.Circle||t instanceof Oe.Box))return hTe(e,new Oe.Polygon(t))}function Ons(e,t){let n=new Qne,o=Dne(e,t);if(o.length===0)if(e.contains(t.pt)&&t.contains(e.pt))n.I2I=[e],n.I2E=[],n.E2I=[];else n.I2I=[],n.I2E=[e],n.E2I=[t];else n.I2I=o,n.I2E=e.split(o),n.E2I=t.split(o);return n}function Vns(e,t){let n=new Qne,o=NU(e,t);if(o.length===0)n.I2I=[],n.I2B=[],n.I2E=[e],n.E2I=[t];else if(o.length===1)n.I2I=[],n.I2B=o,n.I2E=e.split(o),n.E2I=[t];else{let r=new RU([e]),i=e.sortPoints(o);r.split(i);let s=r.toShapes();n.I2I=[s[1]],n.I2B=i,n.I2E=[s[0],s[2]],n.E2I=new Oe.Polygon([t.toArc()]).cutWithLine(e)}return n}function Yns(e,t){let n=new Qne,o=Mne(e,t);if(o.length===0)n.I2I=[],n.I2B=[],n.I2E=[e],n.E2I=[t];else if(o.length===1)n.I2I=[],n.I2B=o,n.I2E=e.split(o),n.E2I=[t];else{let r=new RU([e]),i=e.sortPoints(o);r.split(i);let s=r.toShapes();if(t.toSegments().some((a)=>a.contains(o[0])&&a.contains(o[1])))n.I2I=[],n.I2B=[s[1]],n.I2E=[s[0],s[2]],n.E2I=[t];else n.I2I=[s[1]],n.I2B=i,n.I2E=[s[0],s[2]],n.E2I=new Oe.Polygon(t.toSegments()).cutWithLine(e)}return n}function Gns(e,t){let n=new Qne,o=Wme(e,t),r=new RU([e]),i=o.length>0?o.slice():e.sortPoints(o);return r.split(i),[...r].forEach((s)=>s.setInclusion(t)),n.I2I=[...r].filter((s)=>s.bv===Oe.INSIDE).map((s)=>s.shape),n.I2B=[...r].slice(1).map((s)=>s.bv===Oe.BOUNDARY?s.shape:s.shape.start),n.I2E=[...r].filter((s)=>s.bv===Oe.OUTSIDE).map((s)=>s.shape),n.E2I=t.cutWithLine(e),n}function pdo(e,t){let n=new Qne,o=gns(e,t),r=o.length>0?o.slice():e.sortPoints(o),i=new RU([e]);i.split(r),[...i].forEach((s)=>s.setInclusion(t)),n.I2I=[...i].filter((s)=>s.bv===Oe.INSIDE).map((s)=>s.shape),n.I2B=[...i].slice(1).map((s)=>s.bv===Oe.BOUNDARY?s.shape:s.shape.start),n.I2E=[...i].filter((s)=>s.bv===Oe.OUTSIDE).map((s)=>s.shape),n.B2I=[],n.B2B=[],n.B2E=[];for(let s of[e.start,e.end])switch(Rme(t,s)){case Oe.INSIDE:n.B2I.push(s);break;case Oe.BOUNDARY:n.B2B.push(s);break;case Oe.OUTSIDE:n.B2E.push(s);break}return n}function hTe(e,t){let n=new Qne,[o,r]=xuo(e,t),i=fuo(e,t),s=Agt(e,t),a=Agt(t,e),[c,l]=yuo(e,t),h=fgt(e,t),d=fgt(t,e);return n.I2I=i.isEmpty()?[]:[i],n.I2B=l,n.I2E=s.isEmpty()?[]:[s],n.B2I=c,n.B2B=o,n.B2E=h,n.E2I=a.isEmpty()?[]:[a],n.E2B=d,n}var Uns=Object.freeze({__proto__:null,contain:zns,cover:Suo,covered:vuo,disjoint:Fns,equal:Lns,inside:Iuo,intersect:buo,relate:kne,touch:Hns}),Qme=class e{constructor(t=1,n=0,o=0,r=1,i=0,s=0){this.a=t,this.b=n,this.c=o,this.d=r,this.tx=i,this.ty=s}fromMatrix3x3(t){let[n,o,r]=t[0],[i,s,a]=t[1];return new e(n,i,o,s,r,a)}toMatrix3x3(){return[[this.a,this.c,this.tx],[this.b,this.d,this.ty],[0,0,1]]}clone(){return new e(this.a,this.b,this.c,this.d,this.tx,this.ty)}transform(t){return[t[0]*this.a+t[1]*this.c+this.tx,t[0]*this.b+t[1]*this.d+this.ty]}multiply(t){return new e(this.a*t.a+this.c*t.b,this.b*t.a+this.d*t.b,this.a*t.c+this.c*t.d,this.b*t.c+this.d*t.d,this.a*t.tx+this.c*t.ty+this.tx,this.b*t.tx+this.d*t.ty+this.ty)}translate(...t){let n,o;if(t.length==1&&!isNaN(t[0].x)&&!isNaN(t[0].y))n=t[0].x,o=t[0].y;else if(t.length===2&&typeof t[0]=="number"&&typeof t[1]=="number")n=t[0],o=t[1];else throw R0.ILLEGAL_PARAMETERS;return this.multiply(new e(1,0,0,1,n,o))}rotate(t,n=0,o=0){let r=Math.cos(t),i=Math.sin(t);return this.translate(n,o).multiply(new e(r,i,-i,r,0,0)).translate(-n,-o)}scale(t,n){return this.multiply(new e(t,0,0,n,0,0))}equalTo(t){if(!Oe.Utils.EQ(this.tx,t.tx))return!1;if(!Oe.Utils.EQ(this.ty,t.ty))return!1;if(!Oe.Utils.EQ(this.a,t.a))return!1;if(!Oe.Utils.EQ(this.b,t.b))return!1;if(!Oe.Utils.EQ(this.c,t.c))return!1;if(!Oe.Utils.EQ(this.d,t.d))return!1;return!0}};Oe.Matrix=Qme;var Wns=(...e)=>new Oe.Matrix(...e);Oe.matrix=Wns;var Xns=class{constructor(e,t){this.low=e,this.high=t}get max(){return this.clone()}less_than(e){return this.low<e.low||this.low===e.low&&this.high<e.high}equal_to(e){return this.low===e.low&&this.high===e.high}intersect(e){return!this.not_intersect(e)}not_intersect(e){return this.high<e.low||e.high<this.low}merge(e){let t=this.low===void 0?e.low:this.low<e.low?this.low:e.low,n=this.high===void 0?e.high:this.high>e.high?this.high:e.high,o=this.clone();return o.low=t,o.high=n,o}output(){return[this.low,this.high]}comparable_less_than(e,t){return e<t}},jns=class e extends Xns{clone(){return new e(this.low,this.high)}},M2=1,pd=0,yH=class{constructor(e,t,n=null,o=null,r=null,i=pd){if(this.left=n,this.right=o,this.parent=r,this.color=i,this.item={key:void 0,values:[]},t!==void 0)this.item.values.push(t);if(e!==void 0)if(Array.isArray(e)){let[s,a]=e;if(!Number.isNaN(s)&&!Number.isNaN(a)){let c=s,l=a;if(c>l)[c,l]=[l,c];this.item.key=new jns(c,l)}}else this.item.key=e;this.max=this.item.key?this.item.key.max:void 0}isNil(){return this.item.key===void 0&&this.item.values.length===0&&this.left===null&&this.right===null&&this.color===pd}requireKey(){if(!this.item.key)throw Error("Node key is undefined (nil/sentinel). Operation is not applicable.");return this.item.key}less_than(e){let t=this.requireKey(),n=e.requireKey();return t.less_than(n)}_value_equal(e){let t=this.item.values[0],n=e.item.values[0];return t&&n&&t.equal_to?t.equal_to(n):t===n}equal_to(e){let t=this.requireKey(),n=e.requireKey();return t.equal_to(n)}intersect(e){let t=this.requireKey(),n=e.requireKey();return t.intersect(n)}copy_data(e){this.item.key=e.item.key,this.item.values=e.item.values.slice()}update_max(){if(this.max=this.item.key?this.item.key.max:void 0,this.right&&this.right.max)this.max=this.max?this.max.merge(this.right.max):this.right.max;if(this.left&&this.left.max)this.max=this.max?this.max.merge(this.left.max):this.left.max}not_intersect_left_subtree(e){if(!this.left)return!0;let t=this.left.max?this.left.max.high:this.left.item.key.high,n=this.requireKey(),o=e.requireKey();return n.comparable_less_than(t,o.low)}not_intersect_right_subtree(e){if(!this.right)return!0;let t=this.right.max?this.right.max.low:this.right.item.key.low,n=this.requireKey(),o=e.requireKey();return n.comparable_less_than(o.high,t)}},bgt=class e{constructor(){this.root=null,this.nil_node=new yH}get size(){let t=0;return this.tree_walk(this.root,(n)=>t+=n.item.values.length),t}get keys(){let t=[];return this.tree_walk(this.root,(n)=>t.push(n.item.key.output())),t}get values(){let t=[];return this.tree_walk(this.root,(n)=>{for(let o of n.item.values)t.push(o)}),t}get items(){let t=[];return this.tree_walk(this.root,(n)=>{let o=n.item.key.output();for(let r of n.item.values)t.push({key:o,value:r})}),t}isEmpty(){return this.root==null||this.root===this.nil_node}clear(){this.root=null}insert(t,n=t){if(t===void 0)return;let o=this.tree_search(this.root,new yH(t));if(o)return o.item.values.push(n),o;let r=new yH(t,n,this.nil_node,this.nil_node,null,M2);return this.tree_insert(r),this.recalc_max(r),r}exist(t,n=t){let o=this.tree_search(this.root,new yH(t));if(!o)return!1;if(arguments.length<2||n===t)return!0;return o.item.values.some((r)=>r&&r.equal_to?r.equal_to(n):r===n)}remove(t,n=t){let o=this.tree_search(this.root,new yH(t));if(!o)return;if(arguments.length<2)return this.tree_delete(o),o;let r=o.item.values.findIndex((i)=>i&&i.equal_to?i.equal_to(n):i===n);if(r>=0){if(o.item.values.splice(r,1),o.item.values.length===0)this.tree_delete(o);return o}return}search(t,n=(o,r)=>o===r?r.output():o){let o=new yH(t),r=[];this.tree_search_interval(this.root,o,r);let i=[];for(let s of r)for(let a of s.item.values)i.push(n(a,s.item.key));return i}intersect_any(t){let n=new yH(t);return this.tree_find_any_interval(this.root,n)}forEach(t){this.tree_walk(this.root,(n)=>{for(let o of n.item.values)t(n.item.key,o)})}map(t){let n=new e;return this.tree_walk(this.root,(o)=>{for(let r of o.item.values)n.insert(o.item.key,t(r,o.item.key))}),n}*iterate(t,n=(o,r)=>o===r?r.output():o){let o=null;if(t)o=this.tree_search_nearest_forward(this.root,new yH(t));else if(this.root)o=this.local_minimum(this.root);while(o){for(let r of o.item.values)yield n(r,o.item.key);o=this.tree_successor(o)}}recalc_max(t){let n=t;while(n.parent!=null)n.parent.update_max(),n=n.parent}tree_insert(t){let n=this.root,o=null;if(this.root==null||this.root===this.nil_node)this.root=t;else{while(n!==this.nil_node)if(o=n,t.less_than(n))n=n.left;else n=n.right;if(t.parent=o,t.less_than(o))o.left=t;else o.right=t}this.insert_fixup(t)}insert_fixup(t){let n,o;n=t;while(n!==this.root&&n.parent.color===M2)if(n.parent===n.parent.parent.left)if(o=n.parent.parent.right,o.color===M2)n.parent.color=pd,o.color=pd,n.parent.parent.color=M2,n=n.parent.parent;else{if(n===n.parent.right)n=n.parent,this.rotate_left(n);n.parent.color=pd,n.parent.parent.color=M2,this.rotate_right(n.parent.parent)}else if(o=n.parent.parent.left,o.color===M2)n.parent.color=pd,o.color=pd,n.parent.parent.color=M2,n=n.parent.parent;else{if(n===n.parent.left)n=n.parent,this.rotate_right(n);n.parent.color=pd,n.parent.parent.color=M2,this.rotate_left(n.parent.parent)}this.root.color=pd}tree_delete(t){let n,o;if(t.left===this.nil_node||t.right===this.nil_node)n=t;else n=this.tree_successor(t);if(n.left!==this.nil_node)o=n.left;else o=n.right;if(o.parent=n.parent,n===this.root)this.root=o;else{if(n===n.parent.left)n.parent.left=o;else n.parent.right=o;n.parent.update_max()}if(this.recalc_max(o),n!==t)t.copy_data(n),t.update_max(),this.recalc_max(t);if(n.color===pd)this.delete_fixup(o)}delete_fixup(t){let n=t,o;while(n!==this.root&&n.parent!=null&&n.color===pd)if(n===n.parent.left){if(o=n.parent.right,o.color===M2)o.color=pd,n.parent.color=M2,this.rotate_left(n.parent),o=n.parent.right;if(o.left.color===pd&&o.right.color===pd)o.color=M2,n=n.parent;else{if(o.right.color===pd)o.color=M2,o.left.color=pd,this.rotate_right(o),o=n.parent.right;o.color=n.parent.color,n.parent.color=pd,o.right.color=pd,this.rotate_left(n.parent),n=this.root}}else{if(o=n.parent.left,o.color===M2)o.color=pd,n.parent.color=M2,this.rotate_right(n.parent),o=n.parent.left;if(o.left.color===pd&&o.right.color===pd)o.color=M2,n=n.parent;else{if(o.left.color===pd)o.color=M2,o.right.color=pd,this.rotate_left(o),o=n.parent.left;o.color=n.parent.color,n.parent.color=pd,o.left.color=pd,this.rotate_right(n.parent),n=this.root}}n.color=pd}tree_search(t,n){if(t==null||t===this.nil_node)return;if(n.equal_to(t))return t;if(n.less_than(t))return this.tree_search(t.left,n);else return this.tree_search(t.right,n)}tree_search_nearest_forward(t,n){let o=null,r=t;while(r&&r!==this.nil_node)if(r.less_than(n))if(r.intersect(n))o=r,r=r.left;else r=r.right;else{if(!o||r.less_than(o))o=r;r=r.left}return o||null}tree_search_interval(t,n,o){if(t!=null&&t!==this.nil_node){if(t.left!==this.nil_node&&!t.not_intersect_left_subtree(n))this.tree_search_interval(t.left,n,o);if(t.intersect(n))o.push(t);if(t.right!==this.nil_node&&!t.not_intersect_right_subtree(n))this.tree_search_interval(t.right,n,o)}}tree_find_any_interval(t,n){let o=!1;if(t!=null&&t!==this.nil_node){if(t.left!==this.nil_node&&!t.not_intersect_left_subtree(n))o=this.tree_find_any_interval(t.left,n);if(!o)o=t.intersect(n);if(!o&&t.right!==this.nil_node&&!t.not_intersect_right_subtree(n))o=this.tree_find_any_interval(t.right,n)}return o}local_minimum(t){let n=t;while(n.left!=null&&n.left!==this.nil_node)n=n.left;return n}local_maximum(t){let n=t;while(n.right!=null&&n.right!==this.nil_node)n=n.right;return n}tree_successor(t){let n,o,r;if(t.right!==this.nil_node)n=this.local_minimum(t.right);else{o=t,r=t.parent;while(r!=null&&r.right===o)o=r,r=r.parent;n=r}return n}rotate_left(t){let n=t.right;if(t.right=n.left,n.left!==this.nil_node)n.left.parent=t;if(n.parent=t.parent,t===this.root)this.root=n;else if(t===t.parent.left)t.parent.left=n;else t.parent.right=n;if(n.left=t,t.parent=n,t!==null&&t!==this.nil_node)t.update_max();if(n!=null&&n!==this.nil_node)n.update_max()}rotate_right(t){let n=t.left;if(t.left=n.right,n.right!==this.nil_node)n.right.parent=t;if(n.parent=t.parent,t===this.root)this.root=n;else if(t===t.parent.left)t.parent.left=n;else t.parent.right=n;if(n.right=t,t.parent=n,t!==null&&t!==this.nil_node)t.update_max();if(n!=null&&n!==this.nil_node)n.update_max()}tree_walk(t,n){if(t!=null&&t!==this.nil_node)this.tree_walk(t.left,n),n(t),this.tree_walk(t.right,n)}testRedBlackProperty(){let t=!0;return this.tree_walk(this.root,function(n){if(n.color===M2){if(!(n.left.color===pd&&n.right.color===pd))t=!1}}),t}testBlackHeightProperty(t){let n=0,o=0,r=0;if(t.color===pd)n++;if(t.left!==this.nil_node)o=this.testBlackHeightProperty(t.left);else o=1;if(t.right!==this.nil_node)r=this.testBlackHeightProperty(t.right);else r=1;if(o!==r)throw Error("Red-black height property violated");return n+=o,n}},Kns=class extends Set{constructor(e){super(e);this.index=new bgt,this.forEach((t)=>this.index.insert(t))}add(e){let t=this.size,{key:n,value:o}=e,r=n||e.box,i=o||e;if(super.add(i),this.size>t)this.index.insert(r,i);return this}delete(e){let{key:t,value:n}=e,o=t||e.box,r=n||e,i=super.delete(r);if(i)this.index.remove(o,r);return i}clear(){super.clear(),this.index=new bgt}search(e){return this.index.search(e)}hit(e){let t=new Oe.Box(e.x-1,e.y-1,e.x+1,e.y+1);return this.index.search(t).filter((o)=>e.on(o))}svg(){return[...this].reduce((t,n)=>t+n.svg(),"")}};Oe.PlanarSet=Kns;var MH=class{get name(){throw R0.CANNOT_INVOKE_ABSTRACT_METHOD}get box(){throw R0.CANNOT_INVOKE_ABSTRACT_METHOD}clone(){throw R0.CANNOT_INVOKE_ABSTRACT_METHOD}translate(...e){return this.transform(new Qme().translate(...e))}rotate(e,t=new Oe.Point){return this.transform(new Qme().rotate(e,t.x,t.y))}scale(e,t){return this.transform(new Qme().scale(e,t))}transform(...e){throw R0.CANNOT_INVOKE_ABSTRACT_METHOD}toJSON(){return Object.assign({},this,{name:this.name})}svg(e={}){throw R0.CANNOT_INVOKE_ABSTRACT_METHOD}},$ns=class e extends MH{constructor(...t){super();if(this.x=0,this.y=0,t.length===0)return;if(t.length===1&&t[0]instanceof Array&&t[0].length===2){let n=t[0];if(typeof n[0]=="number"&&typeof n[1]=="number"){this.x=n[0],this.y=n[1];return}}if(t.length===1&&t[0]instanceof Object&&t[0].name==="point"){let{x:n,y:o}=t[0];this.x=n,this.y=o;return}if(t.length===2){if(typeof t[0]=="number"&&typeof t[1]=="number"){this.x=t[0],this.y=t[1];return}}throw R0.ILLEGAL_PARAMETERS}get box(){return new Oe.Box(this.x,this.y,this.x,this.y)}clone(){return new Oe.Point(this.x,this.y)}get vertices(){return[this.clone()]}equalTo(t){return Oe.Utils.EQ(this.x,t.x)&&Oe.Utils.EQ(this.y,t.y)}lessThan(t){if(Oe.Utils.LT(this.y,t.y))return!0;if(Oe.Utils.EQ(this.y,t.y)&&Oe.Utils.LT(this.x,t.x))return!0;return!1}transform(t){return new Oe.Point(t.transform([this.x,this.y]))}projectionOn(t){if(this.equalTo(t.pt))return this.clone();let n=new Oe.Vector(this,t.pt);if(Oe.Utils.EQ_0(n.cross(t.norm)))return t.pt.clone();let o=n.dot(t.norm),r=t.norm.multiply(o);return this.translate(r)}leftTo(t){let n=new Oe.Vector(t.pt,this);return Oe.Utils.GT(n.dot(t.norm),0)}distanceTo(t){if(t instanceof e){let n=t.x-this.x,o=t.y-this.y;return[Math.sqrt(n*n+o*o),new Oe.Segment(this,t)]}if(t instanceof Oe.Line)return Oe.Distance.point2line(this,t);if(t instanceof Oe.Circle)return Oe.Distance.point2circle(this,t);if(t instanceof Oe.Segment)return Oe.Distance.point2segment(this,t);if(t instanceof Oe.Arc)return Oe.Distance.point2arc(this,t);if(t instanceof Oe.Box)return Oe.Distance.point2polygon(this,new Oe.Polygon(t));if(t instanceof Oe.Polygon)return Oe.Distance.point2polygon(this,t);if(t instanceof Oe.PlanarSet)return Oe.Distance.shape2planarSet(this,t);if(t instanceof Oe.Multiline)return Oe.Distance.shape2multiline(this,t)}on(t){if(t instanceof Oe.Point)return this.equalTo(t);if(t.contains&&t.contains instanceof Function)return t.contains(this);throw Oe.Errors.UNSUPPORTED_SHAPE_TYPE}get name(){return"point"}svg(t={}){let n=t.r??3;return`
<circle cx="${this.x}" cy="${this.y}" r="${n}"
            ${DU({fill:"red",...t})} />`}};Oe.Point=$ns;var qns=(...e)=>new Oe.Point(...e);Oe.point=qns;var Jns=class extends MH{constructor(...t){super();if(this.x=0,this.y=0,t.length===0)return;if(t.length===1&&t[0]instanceof Array&&t[0].length===2){let n=t[0];if(typeof n[0]=="number"&&typeof n[1]=="number"){this.x=n[0],this.y=n[1];return}}if(t.length===1&&t[0]instanceof Object&&t[0].name==="vector"){let{x:n,y:o}=t[0];this.x=n,this.y=o;return}if(t.length===1&&t[0]instanceof Object&&t[0].name==="segment"){let{start:n,end:o}=t[0];this.x=o.x-n.x,this.y=o.y-n.y;return}if(t.length===2){let n=t[0],o=t[1];if(typeof n=="number"&&typeof o=="number"){this.x=n,this.y=o;return}if(n instanceof Oe.Point&&o instanceof Oe.Point){this.x=o.x-n.x,this.y=o.y-n.y;return}}throw R0.ILLEGAL_PARAMETERS}clone(){return new Oe.Vector(this.x,this.y)}get slope(){let t=Math.atan2(this.y,this.x);if(t<0)t=2*Math.PI+t;return t}get length(){return Math.sqrt(this.dot(this))}isZeroLength(){return Oe.Utils.EQ_0(this.length)}equalTo(t){return Oe.Utils.EQ(this.x,t.x)&&Oe.Utils.EQ(this.y,t.y)}multiply(t){return new Oe.Vector(t*this.x,t*this.y)}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}normalize(){if(this.isZeroLength())throw R0.ZERO_DIVISION;return new Oe.Vector(this.x/this.length,this.y/this.length)}rotate(t,n=new Oe.Point){if(n.x===0&&n.y===0)return this.transform(new Qme().rotate(t));throw R0.OPERATION_IS_NOT_SUPPORTED}transform(t){return new Oe.Vector(t.transform([this.x,this.y]))}rotate90CCW(){return new Oe.Vector(-this.y,this.x)}rotate90CW(){return new Oe.Vector(this.y,-this.x)}invert(){return new Oe.Vector(-this.x,-this.y)}add(t){return new Oe.Vector(this.x+t.x,this.y+t.y)}subtract(t){return new Oe.Vector(this.x-t.x,this.y-t.y)}angleTo(t){let n=this.normalize(),o=t.normalize(),r=Math.atan2(n.cross(o),n.dot(o));if(r<0)r+=2*Math.PI;return r}projectionOn(t){let n=t.normalize(),o=this.dot(n);return n.multiply(o)}get name(){return"vector"}};Oe.Vector=Jns;var Puo=(...e)=>new Oe.Vector(...e);Oe.vector=Puo;var Zns=class e extends MH{constructor(...t){super();if(this.ps=new Oe.Point,this.pe=new Oe.Point,t.length===0)return;if(t.length===1&&t[0]instanceof Array&&t[0].length===4){let n=t[0];this.ps=new Oe.Point(n[0],n[1]),this.pe=new Oe.Point(n[2],n[3]);return}if(t.length===1&&t[0]instanceof Object&&t[0].name==="segment"){let{ps:n,pe:o}=t[0];this.ps=new Oe.Point(n.x,n.y),this.pe=new Oe.Point(o.x,o.y);return}if(t.length===1&&t[0]instanceof Oe.Point){this.ps=t[0].clone();return}if(t.length===2&&t[0]instanceof Oe.Point&&t[1]instanceof Oe.Point){this.ps=t[0].clone(),this.pe=t[1].clone();return}if(t.length===4){this.ps=new Oe.Point(t[0],t[1]),this.pe=new Oe.Point(t[2],t[3]);return}throw R0.ILLEGAL_PARAMETERS}clone(){return new Oe.Segment(this.start,this.end)}get start(){return this.ps}get end(){return this.pe}get vertices(){return[this.ps.clone(),this.pe.clone()]}get length(){return this.start.distanceTo(this.end)[0]}get slope(){return new Oe.Vector(this.start,this.end).slope}get box(){return new Oe.Box(Math.min(this.start.x,this.end.x),Math.min(this.start.y,this.end.y),Math.max(this.start.x,this.end.x),Math.max(this.start.y,this.end.y))}equalTo(t){return this.ps.equalTo(t.ps)&&this.pe.equalTo(t.pe)}contains(t){return Oe.Utils.EQ_0(this.distanceToPoint(t))}intersect(t){if(t instanceof Oe.Point)return this.contains(t)?[t]:[];if(t instanceof Oe.Line)return Ume(this,t);if(t instanceof Oe.Ray)return Fgt(t,this);if(t instanceof Oe.Segment)return vTe(this,t);if(t instanceof Oe.Circle)return STe(this,t);if(t instanceof Oe.Box)return lns(this,t);if(t instanceof Oe.Arc)return Nne(this,t);if(t instanceof Oe.Polygon)return Lgt(this,t);if(t instanceof Oe.Multiline)return Rne(this,t)}distanceTo(t){if(t instanceof Oe.Point){let[n,o]=Oe.Distance.point2segment(t,this);return o=o.reverse(),[n,o]}if(t instanceof Oe.Circle){let[n,o]=Oe.Distance.segment2circle(this,t);return[n,o]}if(t instanceof Oe.Line){let[n,o]=Oe.Distance.segment2line(this,t);return[n,o]}if(t instanceof Oe.Segment){let[n,o]=Oe.Distance.segment2segment(this,t);return[n,o]}if(t instanceof Oe.Arc){let[n,o]=Oe.Distance.segment2arc(this,t);return[n,o]}if(t instanceof Oe.Box){let[n,o]=Oe.Distance.shape2polygon(this,new Oe.Polygon(t));return[n,o]}if(t instanceof Oe.Polygon){let[n,o]=Oe.Distance.shape2polygon(this,t);return[n,o]}if(t instanceof Oe.PlanarSet){let[n,o]=Oe.Distance.shape2planarSet(this,t);return[n,o]}if(t instanceof Oe.Multiline)return Oe.Distance.shape2multiline(this,t)}tangentInStart(){return new Oe.Vector(this.start,this.end).normalize()}tangentInEnd(){return new Oe.Vector(this.end,this.start).normalize()}reverse(){return new e(this.end,this.start)}split(t){if(this.start.equalTo(t))return[null,this.clone()];if(this.end.equalTo(t))return[this.clone(),null];return[new Oe.Segment(this.start,t),new Oe.Segment(t,this.end)]}middle(){return new Oe.Point((this.start.x+this.end.x)/2,(this.start.y+this.end.y)/2)}pointAtLength(t){if(t>this.length||t<0)return null;if(t==0)return this.start;if(t==this.length)return this.end;let n=t/this.length;return new Oe.Point((this.end.x-this.start.x)*n+this.start.x,(this.end.y-this.start.y)*n+this.start.y)}distanceToPoint(t){let[n,...o]=Oe.Distance.point2segment(t,this);return n}definiteIntegral(t=0){let n=this.end.x-this.start.x,o=this.start.y-t,r=this.end.y-t;return n*(o+r)/2}transform(t=new Oe.Matrix){return new e(this.ps.transform(t),this.pe.transform(t))}isZeroLength(){return this.ps.equalTo(this.pe)}sortPoints(t){return new Oe.Line(this.start,this.end).sortPoints(t)}get name(){return"segment"}svg(t={}){return`
<line x1="${this.start.x}" y1="${this.start.y}" x2="${this.end.x}" y2="${this.end.y}" ${DU(t)} />`}};Oe.Segment=Zns;var eos=(...e)=>new Oe.Segment(...e);Oe.segment=eos;var{vector:Mme}=Oe,tos=class e extends MH{constructor(...t){super();if(this.pt=new Oe.Point,this.norm=new Oe.Vector(0,1),t.length===0)return;if(t.length===1&&t[0]instanceof Object&&t[0].name==="line"){let{pt:n,norm:o}=t[0];this.pt=new Oe.Point(n),this.norm=new Oe.Vector(o);return}if(t.length===2){let n=t[0],o=t[1];if(n instanceof Oe.Point&&o instanceof Oe.Point){if(this.pt=n,this.norm=e.points2norm(n,o),this.norm.dot(Mme(this.pt.x,this.pt.y))>=0)this.norm.invert();return}if(n instanceof Oe.Point&&o instanceof Oe.Vector){if(Oe.Utils.EQ_0(o.x)&&Oe.Utils.EQ_0(o.y))throw R0.ILLEGAL_PARAMETERS;if(this.pt=n.clone(),this.norm=o.clone(),this.norm=this.norm.normalize(),this.norm.dot(Mme(this.pt.x,this.pt.y))>=0)this.norm.invert();return}if(n instanceof Oe.Vector&&o instanceof Oe.Point){if(Oe.Utils.EQ_0(n.x)&&Oe.Utils.EQ_0(n.y))throw R0.ILLEGAL_PARAMETERS;if(this.pt=o.clone(),this.norm=n.clone(),this.norm=this.norm.normalize(),this.norm.dot(Mme(this.pt.x,this.pt.y))>=0)this.norm.invert();return}}throw R0.ILLEGAL_PARAMETERS}clone(){return new Oe.Line(this.pt,this.norm)}get start(){return}get end(){return}get length(){return Number.POSITIVE_INFINITY}get box(){return new Oe.Box(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY)}get middle(){return}get slope(){return new Oe.Vector(this.norm.y,-this.norm.x).slope}get standard(){let t=this.norm.x,n=this.norm.y,o=this.norm.dot(Mme(this.pt.x,this.pt.y));return[t,n,o]}parallelTo(t){return Oe.Utils.EQ_0(this.norm.cross(t.norm))}incidentTo(t){return this.parallelTo(t)&&this.pt.on(t)}contains(t){if(this.pt.equalTo(t))return!0;let n=new Oe.Vector(this.pt,t);return Oe.Utils.EQ_0(this.norm.dot(n))}coord(t){return Mme(t.x,t.y).cross(this.norm)}intersect(t){if(t instanceof Oe.Point)return this.contains(t)?[t]:[];if(t instanceof Oe.Line)return Dne(this,t);if(t instanceof Oe.Ray)return _uo(t,this);if(t instanceof Oe.Circle)return NU(this,t);if(t instanceof Oe.Box)return Mne(this,t);if(t instanceof Oe.Segment)return Ume(t,this);if(t instanceof Oe.Arc)return ITe(this,t);if(t instanceof Oe.Polygon)return Wme(this,t);if(t instanceof Oe.Multiline)return Rne(this,t)}distanceTo(t){if(t instanceof Oe.Point){let[n,o]=Oe.Distance.point2line(t,this);return o=o.reverse(),[n,o]}if(t instanceof Oe.Circle){let[n,o]=Oe.Distance.circle2line(t,this);return o=o.reverse(),[n,o]}if(t instanceof Oe.Segment){let[n,o]=Oe.Distance.segment2line(t,this);return[n,o.reverse()]}if(t instanceof Oe.Arc){let[n,o]=Oe.Distance.arc2line(t,this);return[n,o.reverse()]}if(t instanceof Oe.Box){let[n,o]=Oe.Distance.shape2polygon(this,new Oe.Polygon(t));return[n,o]}if(t instanceof Oe.Polygon){let[n,o]=Oe.Distance.shape2polygon(this,t);return[n,o]}}split(t){if(t instanceof Oe.Point)return[new Oe.Ray(t,this.norm),new Oe.Ray(t,this.norm)];else{let n=new Oe.Multiline([this]),o=this.sortPoints(t);return n.split(o),n.toShapes()}}rotate(t,n=new Oe.Point){return new Oe.Line(this.pt.rotate(t,n),this.norm.rotate(t))}transform(t){return new Oe.Line(this.pt.transform(t),this.norm.clone())}sortPoints(t){return t.slice().sort((n,o)=>{if(this.coord(n)<this.coord(o))return-1;if(this.coord(n)>this.coord(o))return 1;return 0})}get name(){return"line"}svg(t,n={}){let o=Mne(this,t);if(o.length===0)return"";let r=o[0],i=o.length===2?o[1]:o.find((a)=>!a.equalTo(r));if(i===void 0)i=r;return new Oe.Segment(r,i).svg(n)}static points2norm(t,n){if(t.equalTo(n))throw R0.ILLEGAL_PARAMETERS;return new Oe.Vector(t,n).normalize().rotate90CCW()}};Oe.Line=tos;var nos=(...e)=>new Oe.Line(...e);Oe.line=nos;var oos=class extends MH{constructor(...t){super();if(this.pc=new Oe.Point,this.r=1,t.length===1&&t[0]instanceof Object&&t[0].name==="circle"){let{pc:n,r:o}=t[0];this.pc=new Oe.Point(n),this.r=o}else{let[n,o]=[...t];if(n&&n instanceof Oe.Point)this.pc=n.clone();if(o!==void 0)this.r=o}}clone(){return new Oe.Circle(this.pc.clone(),this.r)}get center(){return this.pc}get box(){return new Oe.Box(this.pc.x-this.r,this.pc.y-this.r,this.pc.x+this.r,this.pc.y+this.r)}contains(t){if(t instanceof Oe.Point)return Oe.Utils.LE(t.distanceTo(this.center)[0],this.r);if(t instanceof Oe.Segment)return Oe.Utils.LE(t.start.distanceTo(this.center)[0],this.r)&&Oe.Utils.LE(t.end.distanceTo(this.center)[0],this.r);if(t instanceof Oe.Arc)return this.intersect(t).length===0&&Oe.Utils.LE(t.start.distanceTo(this.center)[0],this.r)&&Oe.Utils.LE(t.end.distanceTo(this.center)[0],this.r);if(t instanceof Oe.Circle)return this.intersect(t).length===0&&Oe.Utils.LE(t.r,this.r)&&Oe.Utils.LE(t.center.distanceTo(this.center)[0],this.r)}toArc(t=!0){return new Oe.Arc(this.center,this.r,Math.PI,-Math.PI,t)}scale(t,n){if(t!==n)throw R0.OPERATION_IS_NOT_SUPPORTED;if(!(this.pc.x===0&&this.pc.y===0))throw R0.OPERATION_IS_NOT_SUPPORTED;return new Oe.Circle(this.pc,this.r*t)}transform(t=new Oe.Matrix){return new Oe.Circle(this.pc.transform(t),this.r)}intersect(t){if(t instanceof Oe.Point)return this.contains(t)?[t]:[];if(t instanceof Oe.Line)return NU(t,this);if(t instanceof Oe.Ray)return muo(t,this);if(t instanceof Oe.Segment)return STe(t,this);if(t instanceof Oe.Circle)return iuo(t,this);if(t instanceof Oe.Box)return hns(this,t);if(t instanceof Oe.Arc)return kgt(t,this);if(t instanceof Oe.Polygon)return huo(this,t);if(t instanceof Oe.Multiline)return Rne(this,t)}distanceTo(t){if(t instanceof Oe.Point){let[n,o]=Oe.Distance.point2circle(t,this);return o=o.reverse(),[n,o]}if(t instanceof Oe.Circle){let[n,o]=Oe.Distance.circle2circle(this,t);return[n,o]}if(t instanceof Oe.Line){let[n,o]=Oe.Distance.circle2line(this,t);return[n,o]}if(t instanceof Oe.Segment){let[n,o]=Oe.Distance.segment2circle(t,this);return o=o.reverse(),[n,o]}if(t instanceof Oe.Arc){let[n,o]=Oe.Distance.arc2circle(t,this);return o=o.reverse(),[n,o]}if(t instanceof Oe.Box){let[n,o]=Oe.Distance.shape2polygon(this,new Oe.Polygon(t));return[n,o]}if(t instanceof Oe.Polygon){let[n,o]=Oe.Distance.shape2polygon(this,t);return[n,o]}if(t instanceof Oe.PlanarSet){let[n,o]=Oe.Distance.shape2planarSet(this,t);return[n,o]}if(t instanceof Oe.Multiline){let[n,o]=Oe.Distance.shape2multiline(this,t);return[n,o]}}get name(){return"circle"}svg(t={}){return`
<circle cx="${this.pc.x}" cy="${this.pc.y}" r="${this.r}"
                ${DU({fill:"none",...t})} />`}};Oe.Circle=oos;var ros=(...e)=>new Oe.Circle(...e);Oe.circle=ros;var ios=class extends MH{constructor(...e){super();if(this.pc=new Oe.Point,this.r=1,this.startAngle=0,this.endAngle=2*Math.PI,this.counterClockwise=!0,e.length===0)return;if(e.length===1&&e[0]instanceof Object&&e[0].name==="arc"){let{pc:t,r:n,startAngle:o,endAngle:r,counterClockwise:i}=e[0];this.pc=new Oe.Point(t.x,t.y),this.r=n,this.startAngle=o,this.endAngle=r,this.counterClockwise=i}else{let[t,n,o,r,i]=[...e];if(t&&t instanceof Oe.Point)this.pc=t.clone();if(n!==void 0)this.r=n;if(o!==void 0)this.startAngle=o;if(r!==void 0)this.endAngle=r;if(i!==void 0)this.counterClockwise=i}}clone(){return new Oe.Arc(this.pc.clone(),this.r,this.startAngle,this.endAngle,this.counterClockwise)}get sweep(){let e=this.startAngle,t=this.endAngle;if(Oe.Utils.EQ(Math.abs(e-t),Oe.PIx2))return Oe.PIx2;if(Math.abs(e)>Oe.PIx2)e-=Math.trunc(e/Oe.PIx2)*Oe.PIx2;if(e<0)e+=Oe.PIx2;if(Math.abs(t)>Oe.PIx2)t-=Math.trunc(t/Oe.PIx2)*Oe.PIx2;if(t<0)t+=Oe.PIx2;let n=this.counterClockwise?t-e:e-t;if(n<0)n+=Oe.PIx2;return n}get start(){return new Oe.Point(this.pc.x+this.r,this.pc.y).rotate(this.startAngle,this.pc)}get end(){return new Oe.Point(this.pc.x+this.r,this.pc.y).rotate(this.endAngle,this.pc)}get center(){return this.pc.clone()}get vertices(){return[this.start.clone(),this.end.clone()]}get length(){return Math.abs(this.sweep*this.r)}get box(){let t=this.breakToFunctional().reduce((n,o)=>n.merge(o.start.box),new Oe.Box);return t=t.merge(this.end.box),t}contains(e){if(!Oe.Utils.EQ(this.pc.distanceTo(e)[0],this.r))return!1;if(e.equalTo(this.start))return!0;let t=new Oe.Vector(this.pc,e).slope,n=new Oe.Arc(this.pc,this.r,this.startAngle,t,this.counterClockwise);return Oe.Utils.LE(n.length,this.length)}split(e){if(this.start.equalTo(e))return[null,this.clone()];if(this.end.equalTo(e))return[this.clone(),null];let t=new Oe.Vector(this.pc,e).slope;return[new Oe.Arc(this.pc,this.r,this.startAngle,t,this.counterClockwise),new Oe.Arc(this.pc,this.r,t,this.endAngle,this.counterClockwise)]}middle(){let e=this.counterClockwise?this.startAngle+this.sweep/2:this.startAngle-this.sweep/2;return new Oe.Arc(this.pc,this.r,this.startAngle,e,this.counterClockwise).end}pointAtLength(e){if(e>this.length||e<0)return null;if(e===0)return this.start;if(e===this.length)return this.end;let t=e/this.length,n=this.counterClockwise?this.startAngle+this.sweep*t:this.startAngle-this.sweep*t;return new Oe.Arc(this.pc,this.r,this.startAngle,n,this.counterClockwise).end}chordHeight(){return(1-Math.cos(Math.abs(this.sweep/2)))*this.r}intersect(e){if(e instanceof Oe.Point)return this.contains(e)?[e]:[];if(e instanceof Oe.Line)return ITe(e,this);if(e instanceof Oe.Ray)return zgt(e,this);if(e instanceof Oe.Circle)return kgt(this,e);if(e instanceof Oe.Segment)return Nne(e,this);if(e instanceof Oe.Box)return dns(this,e);if(e instanceof Oe.Arc)return suo(this,e);if(e instanceof Oe.Polygon)return Hgt(this,e);if(e instanceof Oe.Multiline)return Rne(this,e)}distanceTo(e){if(e instanceof Oe.Point){let[t,n]=Oe.Distance.point2arc(e,this);return n=n.reverse(),[t,n]}if(e instanceof Oe.Circle){let[t,n]=Oe.Distance.arc2circle(this,e);return[t,n]}if(e instanceof Oe.Line){let[t,n]=Oe.Distance.arc2line(this,e);return[t,n]}if(e instanceof Oe.Segment){let[t,n]=Oe.Distance.segment2arc(e,this);return n=n.reverse(),[t,n]}if(e instanceof Oe.Arc){let[t,n]=Oe.Distance.arc2arc(this,e);return[t,n]}if(e instanceof Oe.Box){let[t,n]=Oe.Distance.shape2polygon(this,new Oe.Polygon(e));return[t,n]}if(e instanceof Oe.Polygon){let[t,n]=Oe.Distance.shape2polygon(this,e);return[t,n]}if(e instanceof Oe.PlanarSet){let[t,n]=Oe.Distance.shape2planarSet(this,e);return[t,n]}if(e instanceof Oe.Multiline)return Oe.Distance.shape2multiline(this,e)}breakToFunctional(){let e=[],t=[0,Math.PI/2,Math.PI,3*Math.PI/2],n=this.startAngle,o=this.endAngle;if(Oe.Utils.EQ(Math.abs(n-o),Oe.PIx2))o=n;if(Math.abs(n)>Oe.PIx2)n-=Math.trunc(n/Oe.PIx2)*Oe.PIx2;if(n<0)n+=Oe.PIx2;if(Math.abs(o)>Oe.PIx2)o-=Math.trunc(o/Oe.PIx2)*Oe.PIx2;if(o<0)o+=Oe.PIx2;let r=n,i,s,a;if(this.counterClockwise)s=Math.ceil(n/(Math.PI/2))%4,a=1;else s=Math.floor(n/(Math.PI/2))%4,a=-1;for(let c=0,l=s;c<4;c++,l=(l+a+4)%4){if(i=t[l],i===r)continue;let h=this.counterClockwise?i-n:n-i;if(h<0)h+=Oe.PIx2;if(h>this.sweep)break;e.push(new Oe.Arc(this.pc,this.r,r,i,this.counterClockwise)),r=i}if(e.length===0)return e.push(this),e;if(i=o,r!==i)e.push(new Oe.Arc(this.pc,this.r,r,i,this.counterClockwise));return e}tangentInStart(){let e=new Oe.Vector(this.pc,this.start),t=this.counterClockwise?Math.PI/2:-Math.PI/2;return e.rotate(t).normalize()}tangentInEnd(){let e=new Oe.Vector(this.pc,this.end),t=this.counterClockwise?-Math.PI/2:Math.PI/2;return e.rotate(t).normalize()}reverse(){return new Oe.Arc(this.pc,this.r,this.endAngle,this.startAngle,!this.counterClockwise)}transform(e=new Oe.Matrix){let t=this.start.transform(e),n=this.end.transform(e),o=this.pc.transform(e),r=this.counterClockwise;if(e.a*e.d<0)r=!r;return Oe.Arc.arcSE(o,t,n,r)}static arcSE(e,t,n,o){let{vector:r}=Oe,i=r(e,t).slope,s=r(e,n).slope;if(Oe.Utils.EQ(i,s))s+=2*Math.PI,o=!0;let a=r(e,t).length;return new Oe.Arc(e,a,i,s,o)}definiteIntegral(e=0){return this.breakToFunctional().reduce((o,r)=>o+r.circularSegmentDefiniteIntegral(e),0)}circularSegmentDefiniteIntegral(e){let n=new Oe.Segment(this.start,this.end).definiteIntegral(e),o=Oe.Utils.EQ(this.sweep,Oe.PIx2)?0:this.circularSegmentArea();return this.counterClockwise?n-o:n+o}circularSegmentArea(){return 0.5*this.r*this.r*(this.sweep-Math.sin(this.sweep))}sortPoints(e){let{vector:t}=Oe;return e.slice().sort((n,o)=>{let r=t(this.pc,n).slope,i=t(this.pc,o).slope;if(r<i)return-1;if(r>i)return 1;return 0})}get name(){return"arc"}svg(e={}){let t=this.sweep<=Math.PI?"0":"1",n=this.counterClockwise?"1":"0";if(Oe.Utils.EQ(this.sweep,2*Math.PI))return new Oe.Circle(this.pc,this.r).svg(e);else return`
<path d="M${this.start.x},${this.start.y}
                             A${this.r},${this.r} 0 ${t},${n} ${this.end.x},${this.end.y}"
                    ${DU({fill:"none",...e})} />`}};Oe.Arc=ios;var sos=(...e)=>new Oe.Arc(...e);Oe.arc=sos;var aos=class e extends MH{constructor(t=void 0,n=void 0,o=void 0,r=void 0){super();this.xmin=t,this.ymin=n,this.xmax=o,this.ymax=r}clone(){return new e(this.xmin,this.ymin,this.xmax,this.ymax)}get low(){return new Oe.Point(this.xmin,this.ymin)}get high(){return new Oe.Point(this.xmax,this.ymax)}get max(){return this.clone()}get center(){return new Oe.Point((this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)}get width(){return Math.abs(this.xmax-this.xmin)}get height(){return Math.abs(this.ymax-this.ymin)}get box(){return this.clone()}not_intersect(t){return this.xmax<t.xmin||this.xmin>t.xmax||this.ymax<t.ymin||this.ymin>t.ymax}intersect(t){return!this.not_intersect(t)}merge(t){return new e(this.xmin===void 0?t.xmin:Math.min(this.xmin,t.xmin),this.ymin===void 0?t.ymin:Math.min(this.ymin,t.ymin),this.xmax===void 0?t.xmax:Math.max(this.xmax,t.xmax),this.ymax===void 0?t.ymax:Math.max(this.ymax,t.ymax))}less_than(t){if(this.low.lessThan(t.low))return!0;if(this.low.equalTo(t.low)&&this.high.lessThan(t.high))return!0;return!1}equal_to(t){return this.low.equalTo(t.low)&&this.high.equalTo(t.high)}output(){return this.clone()}comparable_less_than(t,n){return t.lessThan(n)}set(t,n,o,r){this.xmin=t,this.ymin=n,this.xmax=o,this.ymax=r}extend(t){if(t<=0)return this.clone();return new e(this.xmin-t,this.ymin-t,this.xmax+t,this.ymax+t)}toPoints(){return[new Oe.Point(this.xmin,this.ymin),new Oe.Point(this.xmax,this.ymin),new Oe.Point(this.xmax,this.ymax),new Oe.Point(this.xmin,this.ymax)]}toSegments(){let t=this.toPoints();return[new Oe.Segment(t[0],t[1]),new Oe.Segment(t[1],t[2]),new Oe.Segment(t[2],t[3]),new Oe.Segment(t[3],t[0])]}rotate(t,n=new Oe.Point){throw R0.OPERATION_IS_NOT_SUPPORTED}transform(t=new Oe.Matrix){return this.toPoints().map((o)=>o.transform(t)).reduce((o,r)=>o.merge(r.box),new e)}contains(t){if(t instanceof Oe.Point)return t.x>=this.xmin&&t.x<=this.xmax&&t.y>=this.ymin&&t.y<=this.ymax;if(t instanceof Oe.Segment)return t.vertices.every((n)=>this.contains(n));if(t instanceof Oe.Box)return t.toSegments().every((n)=>this.contains(n));if(t instanceof Oe.Circle)return this.contains(t.box);if(t instanceof Oe.Arc)return t.vertices.every((n)=>this.contains(n))&&this.toSegments().every((n)=>Nne(n,t).length===0);if(t instanceof Oe.Line||t instanceof Oe.Ray)return!1;if(t instanceof Oe.Multiline)return t.toShapes().every((n)=>this.contains(n));if(t instanceof Oe.Polygon)return this.contains(t.box)}distanceTo(t){let n=this.toSegments().map((r)=>r.distanceTo(t)),o=[Number.MAX_SAFE_INTEGER,null];return n.forEach((r)=>{if(r[0]<o[0])o=r}),o}get name(){return"box"}svg(t={}){let n=this.xmax-this.xmin,o=this.ymax-this.ymin;return`
<rect x="${this.xmin}" y="${this.ymin}" width="${n}" height="${o}"
                ${DU({fill:"none",...t})} />`}};Oe.Box=aos;var cos=(...e)=>new Oe.Box(...e);Oe.box=cos;var los=class{constructor(e){this.shape=e,this.next=void 0,this.prev=void 0,this.face=void 0,this.arc_length=0,this.bvStart=void 0,this.bvEnd=void 0,this.bv=void 0,this.overlap=void 0}get start(){return this.shape.start}get end(){return this.shape.end}get length(){return this.shape.length}get box(){return this.shape.box}get isSegment(){return this.shape instanceof Oe.Segment}get isArc(){return this.shape instanceof Oe.Arc}get isLine(){return this.shape instanceof Oe.Line}get isRay(){return this.shape instanceof Oe.Ray}middle(){return this.shape.middle()}pointAtLength(e){return this.shape.pointAtLength(e)}contains(e){return this.shape.contains(e)}setInclusion(e){if(this.bv!==void 0)return this.bv;if(this.shape instanceof Oe.Line||this.shape instanceof Oe.Ray)return this.bv=Oe.OUTSIDE,this.bv;if(this.bvStart===void 0)this.bvStart=Rme(e,this.start);if(this.bvEnd===void 0)this.bvEnd=Rme(e,this.end);if(this.bvStart===Oe.OUTSIDE||this.bvEnd==Oe.OUTSIDE)this.bv=Oe.OUTSIDE;else if(this.bvStart===Oe.INSIDE||this.bvEnd==Oe.INSIDE)this.bv=Oe.INSIDE;else{let t=Rme(e,this.middle());this.bv=t}return this.bv}setOverlap(e){let t=void 0,n=this.shape,o=e.shape;if(n instanceof Oe.Segment&&o instanceof Oe.Segment){if(n.start.equalTo(o.start)&&n.end.equalTo(o.end))t=Oe.OVERLAP_SAME;else if(n.start.equalTo(o.end)&&n.end.equalTo(o.start))t=Oe.OVERLAP_OPPOSITE}else if(n instanceof Oe.Arc&&o instanceof Oe.Arc){if(n.start.equalTo(o.start)&&n.end.equalTo(o.end)&&n.middle().equalTo(o.middle()))t=Oe.OVERLAP_SAME;else if(n.start.equalTo(o.end)&&n.end.equalTo(o.start)&&n.middle().equalTo(o.middle()))t=Oe.OVERLAP_OPPOSITE}else if(n instanceof Oe.Segment&&o instanceof Oe.Arc||n instanceof Oe.Arc&&o instanceof Oe.Segment){if(n.start.equalTo(o.start)&&n.end.equalTo(o.end)&&n.middle().equalTo(o.middle()))t=Oe.OVERLAP_SAME;else if(n.start.equalTo(o.end)&&n.end.equalTo(o.start)&&n.middle().equalTo(o.middle()))t=Oe.OVERLAP_OPPOSITE}if(this.overlap===void 0)this.overlap=t;if(e.overlap===void 0)e.overlap=t}svg(){if(this.shape instanceof Oe.Segment)return` L${this.shape.end.x},${this.shape.end.y}`;else if(this.shape instanceof Oe.Arc){let e=this.shape,t,n=e.counterClockwise?"1":"0";if(Oe.Utils.EQ(e.sweep,2*Math.PI)){let o=e.counterClockwise?1:-1,r=new Oe.Arc(e.pc,e.r,e.startAngle,e.startAngle+o*Math.PI,e.counterClockwise),i=new Oe.Arc(e.pc,e.r,e.startAngle+o*Math.PI,e.endAngle,e.counterClockwise);return t="0",` A${r.r},${r.r} 0 ${t},${n} ${r.end.x},${r.end.y}
                    A${i.r},${i.r} 0 ${t},${n} ${i.end.x},${i.end.y}`}else return t=e.sweep<=Math.PI?"0":"1",` A${e.r},${e.r} 0 ${t},${n} ${e.end.x},${e.end.y}`}}toJSON(){return this.shape.toJSON()}};Oe.Edge=los;var hos=class extends Qgt{constructor(e,t){super(e,t);this.setCircularLinks()}setCircularLinks(){if(this.isEmpty())return;this.last.next=this.first,this.first.prev=this.last}[Symbol.iterator](){let e=void 0;return{next:()=>{let t=e?e:this.first,n=this.first?e?e===this.first:!1:!0;return e=t?t.next:void 0,{value:t,done:n}}}}append(e){return super.append(e),this.setCircularLinks(),this}insert(e,t){return super.insert(e,t),this.setCircularLinks(),this}remove(e){return super.remove(e),this}},dos=class e extends hos{constructor(t,...n){super();if(this._box=void 0,this._orientation=void 0,n.length===0)return;if(n.length===1){if(n[0]instanceof Array){let o=n[0];if(o.length===0)return;if(o.every((r)=>r instanceof Oe.Point)){let r=e.points2segments(o);this.shapes2face(t.edges,r)}else if(o.every((r)=>r instanceof Array&&r.length===2)){let r=o.map((s)=>new Oe.Point(s[0],s[1])),i=e.points2segments(r);this.shapes2face(t.edges,i)}else if(o.every((r)=>r instanceof Oe.Segment||r instanceof Oe.Arc))this.shapes2face(t.edges,o);else if(o.every((r)=>r.name==="segment"||r.name==="arc")){let r=[];for(let i of o){let s;if(i.name==="segment")s=new Oe.Segment(i);else s=new Oe.Arc(i);r.push(s)}this.shapes2face(t.edges,r)}}else if(n[0]instanceof e){let o=n[0];this.first=o.first,this.last=o.last;for(let r of o)t.edges.add(r)}else if(n[0]instanceof Oe.Circle)this.shapes2face(t.edges,[n[0].toArc(Zdo)]);else if(n[0]instanceof Oe.Box){let o=n[0];this.shapes2face(t.edges,[new Oe.Segment(new Oe.Point(o.xmin,o.ymin),new Oe.Point(o.xmax,o.ymin)),new Oe.Segment(new Oe.Point(o.xmax,o.ymin),new Oe.Point(o.xmax,o.ymax)),new Oe.Segment(new Oe.Point(o.xmax,o.ymax),new Oe.Point(o.xmin,o.ymax)),new Oe.Segment(new Oe.Point(o.xmin,o.ymax),new Oe.Point(o.xmin,o.ymin))])}}if(n.length===2&&n[0]instanceof Oe.Edge&&n[1]instanceof Oe.Edge)this.first=n[0],this.last=n[1],this.last.next=this.first,this.first.prev=this.last,this.setArcLength()}get edges(){return this.toArray()}get vertices(){return this.edges.map((t)=>t.shape.start.clone())}get shapes(){return this.edges.map((t)=>t.shape.clone())}get box(){if(this._box===void 0){let t=new Oe.Box;for(let n of this)t=t.merge(n.box);this._box=t}return this._box}get perimeter(){return this.last.arc_length+this.last.length}pointAtLength(t){if(t>this.perimeter||t<0)return null;let n=null;for(let o of this)if(t>=o.arc_length&&(o===this.last||t<o.next.arc_length)){n=o.pointAtLength(t-o.arc_length);break}return n}static points2segments(t){let n=[];for(let o=0;o<t.length;o++){if(t[o].equalTo(t[(o+1)%t.length]))continue;n.push(new Oe.Segment(t[o],t[(o+1)%t.length]))}return n}shapes2face(t,n){for(let o of n){let r=new Oe.Edge(o);this.append(r),t.add(r)}}append(t){return super.append(t),this.setOneEdgeArcLength(t),t.face=this,this}insert(t,n){return super.insert(t,n),this.setOneEdgeArcLength(t),t.face=this,this}remove(t){return super.remove(t),this.setArcLength(),this}merge_with_next_edge(t){return t.shape.end.x=t.next.shape.end.x,t.shape.end.y=t.next.shape.end.y,this.remove(t.next),this}reverse(){let t=[],n=this.last;do n.shape=n.shape.reverse(),t.push(n),n=n.prev;while(n!==this.last);this.first=void 0,this.last=void 0;for(let o of t){if(this.first===void 0)o.prev=o,o.next=o,this.first=o,this.last=o;else o.prev=this.last,this.last.next=o,this.last=o,this.last.next=this.first,this.first.prev=this.last;this.setOneEdgeArcLength(o)}if(this._orientation!==void 0)this._orientation=void 0,this._orientation=this.orientation()}setArcLength(){for(let t of this)this.setOneEdgeArcLength(t),t.face=this}setOneEdgeArcLength(t){if(t===this.first)t.arc_length=0;else t.arc_length=t.prev.arc_length+t.prev.length}area(){return Math.abs(this.signedArea())}signedArea(){let t=0,n=this.box.ymin;for(let o of this)t+=o.shape.definiteIntegral(n);return t}orientation(){if(this._orientation===void 0){let t=this.signedArea();if(Oe.Utils.EQ_0(t))this._orientation=Dme.NOT_ORIENTABLE;else if(Oe.Utils.LT(t,0))this._orientation=Dme.CCW;else this._orientation=Dme.CW}return this._orientation}isSimple(t){return e.getSelfIntersections(this,t,!0).length===0}static getSelfIntersections(t,n,o=!1){let r=[];for(let i of t){let s=n.search(i.box);for(let a of s){if(i===a)continue;if(a.face!==t)continue;if(i.shape instanceof Oe.Segment&&a.shape instanceof Oe.Segment&&(i.next===a||i.prev===a))continue;let c=i.shape.intersect(a.shape);for(let l of c){if(l.equalTo(i.start)&&l.equalTo(a.end)&&a===i.prev)continue;if(l.equalTo(i.end)&&l.equalTo(a.start)&&a===i.next)continue;if(r.push(l),o)break}if(r.length>0&&o)break}if(r.length>0&&o)break}return r}findEdgeByPoint(t){let n;for(let o of this){if(t.equalTo(o.shape.start))continue;if(t.equalTo(o.shape.end)||o.shape.contains(t)){n=o;break}}return n}toPolygon(){return new Oe.Polygon(this.shapes)}toJSON(){return this.edges.map((t)=>t.toJSON())}svg(){let t=`M${this.first.start.x},${this.first.start.y}`;for(let n of this)t+=n.svg();return t+=" z",t}};Oe.Face=dos;var uos=class e extends MH{constructor(...t){super();if(this.pt=new Oe.Point,this.norm=new Oe.Vector(0,1),t.length===0)return;if(t.length>=1&&t[0]instanceof Oe.Point)this.pt=t[0].clone();if(t.length===1)return;if(t.length===2&&t[1]instanceof Oe.Vector){this.norm=t[1].clone();return}throw R0.ILLEGAL_PARAMETERS}clone(){return new e(this.pt,this.norm)}get slope(){return new Oe.Vector(this.norm.y,-this.norm.x).slope}get box(){let t=this.slope;return new Oe.Box(t>Math.PI/2&&t<3*Math.PI/2?Number.NEGATIVE_INFINITY:this.pt.x,t>=0&&t<=Math.PI?this.pt.y:Number.NEGATIVE_INFINITY,t>=Math.PI/2&&t<=3*Math.PI/2?this.pt.x:Number.POSITIVE_INFINITY,t>=Math.PI&&t<=2*Math.PI||t===0?this.pt.y:Number.POSITIVE_INFINITY)}get start(){return this.pt}get end(){return}get length(){return Number.POSITIVE_INFINITY}contains(t){if(this.pt.equalTo(t))return!0;let n=new Oe.Vector(this.pt,t);return Oe.Utils.EQ_0(this.norm.dot(n))&&Oe.Utils.GE(n.cross(this.norm),0)}coord(t){return Puo(t.x,t.y).cross(this.norm)}split(t){if(!this.contains(t))return[];if(this.pt.equalTo(t))return[this];return[new Oe.Segment(this.pt,t),new Oe.Ray(t,this.norm)]}intersect(t){if(t instanceof Oe.Point)return this.contains(t)?[t]:[];if(t instanceof Oe.Segment)return Fgt(this,t);if(t instanceof Oe.Arc)return zgt(this,t);if(t instanceof Oe.Line)return _uo(this,t);if(t instanceof Oe.Ray)return fns(this,t);if(t instanceof Oe.Circle)return muo(this,t);if(t instanceof Oe.Box)return Ans(this,t);if(t instanceof Oe.Polygon)return guo(this,t);if(t instanceof Oe.Multiline)return Rne(this,t)}rotate(t,n=new Oe.Point){return new Oe.Ray(this.pt.rotate(t,n),this.norm.rotate(t))}transform(t){return new Oe.Ray(this.pt.transform(t),this.norm.clone())}get name(){return"ray"}svg(t,n={}){let o=new Oe.Line(this.pt,this.norm),r=Mne(o,t);if(r=r.filter((s)=>this.contains(s)),r.length===0||r.length===2)return"";return new Oe.Segment(this.pt,r[0]).svg(n)}};Oe.Ray=uos;var pos=(...e)=>new Oe.Ray(...e);Oe.ray=pos;var mos=class e{constructor(){this.faces=new Oe.PlanarSet,this.edges=new Oe.PlanarSet;let t=[...arguments];if(t.length===1&&(t[0]instanceof Array&&t[0].length>0||t[0]instanceof Oe.Circle||t[0]instanceof Oe.Box)){let n=t[0];if(t[0]instanceof Array&&t[0].every((o)=>o instanceof Array))if(n.every((o)=>o instanceof Array&&o.length===2&&typeof o[0]==="number"&&typeof o[1]==="number"))this.faces.add(new Oe.Face(this,n));else for(let o of n)if(o instanceof Array&&o[0]instanceof Array&&o[0].every((r)=>r instanceof Array&&r.length===2&&typeof r[0]==="number"&&typeof r[1]==="number"))for(let r of o)this.faces.add(new Oe.Face(this,r));else this.faces.add(new Oe.Face(this,o));else this.faces.add(new Oe.Face(this,n))}}get box(){return[...this.faces].reduce((t,n)=>t.merge(n.box),new Oe.Box)}get vertices(){return[...this.faces].flatMap((t)=>t.vertices)}clone(){let t=new e;for(let n of this.faces)t.addFace(n.shapes);return t}createFromArray(t){let n=new e;return t.forEach((o)=>[...o.faces].forEach((r)=>n.addFace(r.shapes))),n}isEmpty(){return this.edges.size===0||this.faces.size===0}isValid(){let t=!0;for(let n of this.faces)if(!n.isSimple(this.edges)){t=!1;break}return t}area(){let t=[...this.faces].reduce((n,o)=>n+o.signedArea(),0);return Math.abs(t)}addFace(...t){let n=new Oe.Face(this,...t);return this.faces.add(n),n}deleteFace(t){for(let n of t)this.edges.delete(n);return this.faces.delete(t)}recreateFaces(){this.faces.clear();for(let o of this.edges)o.face=null;let t,n=!0;while(n){n=!1;for(let o of this.edges)if(o.face===null){t=o,n=!0;break}if(n){let o=t;do o=o.next;while(o.next!==t);this.addFace(t,o)}}}removeChain(t,n,o){if(o.next===n){this.deleteFace(t);return}for(let r=n;r!==o.next;r=r.next)if(t.remove(r),this.edges.delete(r),t.isEmpty()){this.deleteFace(t);break}}addVertex(t,n){let o=n.shape.split(t);if(o[0]===null)return n.prev;if(o[1]===null)return n;let r=new Oe.Edge(o[0]),i=n.prev;return n.face.insert(r,i),this.edges.delete(n),this.edges.add(r),n.shape=o[1],this.edges.add(n),r}removeEndVertex(t){let n=t.next;if(n===t)return;t.face.merge_with_next_edge(t),this.edges.delete(n)}cut(t){let o=this.splitToIslands().flatMap((r)=>r._cutSingleIsland(t)).filter((r)=>r.isValid()&&r.isEmpty()===!1);return this.createFromArray(o)}_cutSingleIsland(t){let n=this.clone(),o=t.clone(),r={int_points1:[],int_points2:[],int_points1_sorted:[],int_points2_sorted:[]};for(let a of o.edges)for(let c of n.edges){let l=duo(a,c);for(let h of l)wne(a,h,r.int_points1),wne(c,h,r.int_points2)}if(r.int_points1.length===0)return n;r.int_points1_sorted=IH(r.int_points1),r.int_points2_sorted=IH(r.int_points2),Tne(o,r.int_points1_sorted),Tne(n,r.int_points2_sorted),Ogt(r),r.int_points1_sorted=IH(r.int_points1),r.int_points2_sorted=IH(r.int_points2),_gt(r.int_points1),ggt(r.int_points1,n);for(let a of r.int_points1_sorted)if(a.edge_before&&a.edge_after&&a.edge_before.bv===a.edge_after.bv)r.int_points2[a.id]=-1,a.id=-1;if(r.int_points1=r.int_points1.filter((a)=>a.id>=0),r.int_points2=r.int_points2.filter((a)=>a.id>=0),r.int_points1.forEach((a,c)=>{a.id=c}),r.int_points2.forEach((a,c)=>{a.id=c}),r.int_points1.length===0)return n;r.int_points1_sorted=IH(r.int_points1),r.int_points2_sorted=IH(r.int_points2);let i,s;for(let a=1;a<r.int_points1_sorted.length;a++)if(s=r.int_points1_sorted[a],i=r.int_points1_sorted[a-1],s.edge_before&&s.edge_before.bv===fTe){let c=i.edge_after,l=s.edge_before,h=o.getChain(c,l);sdo(r.int_points2[i.id],r.int_points2[s.id],h),h.forEach((d)=>n.edges.add(d)),h=h.reverse().map((d)=>new Oe.Edge(d.shape.reverse()));for(let d=0;d<h.length-1;d++)h[d].next=h[d+1],h[d+1].prev=h[d];sdo(r.int_points2[s.id],r.int_points2[i.id],h),h.forEach((d)=>n.edges.add(d))}return n.recreateFaces(),n}cutWithLine(t){let n=new RU([t]);return this.cut(n)}findEdgeByPoint(t){let n;for(let o of this.faces)if(n=o.findEdgeByPoint(t),n!==void 0)break;return n}splitToIslands(){if(this.isEmpty())return[];let t=this.toArray();t.sort((r,i)=>i.area()-r.area());let n=[...t[0].faces][0].orientation(),o=t.filter((r)=>[...r.faces][0].orientation()===n);for(let r of t){let i=[...r.faces][0];if(i.orientation()===n)continue;for(let s of o)if(i.shapes.every((a)=>s.contains(a))){s.addFace(i.shapes);break}}return o}rearrange(){if(this.faces.size<=1)return this.clone();let t=this.splitToIslands(),n=new e;return t.forEach((o)=>{o.faces.forEach((r)=>n.addFace(r.shapes))}),n}orientation(){if(this.isEmpty())return Dme.NOT_ORIENTABLE;return[...this.faces][0].orientation()}isOuter(t){return t.orientation()===this.orientation()}isMultiPolygon(){let t=0;return this.faces.forEach((n)=>{if(this.isOuter(n))t++}),t>1}reverse(){for(let t of this.faces)t.reverse();return this}contains(t){if(t instanceof Oe.Point){let n=Rme(this,t);return n===fTe||n===QE}else return Suo(this,t)}distanceTo(t){if(t instanceof Oe.Point){let[n,o]=Oe.Distance.point2polygon(t,this);return o=o.reverse(),[n,o]}if(t instanceof Oe.Circle||t instanceof Oe.Line||t instanceof Oe.Segment||t instanceof Oe.Arc){let[n,o]=Oe.Distance.shape2polygon(t,this);return o=o.reverse(),[n,o]}if(t instanceof Oe.Box)return this.distanceTo(new Oe.Polygon(t));if(t instanceof Oe.Polygon){let n=[Number.POSITIVE_INFINITY,new Oe.Segment],o,r;for(let i of this.edges){let s=n[0];if([o,r]=Oe.Distance.shape2planarSet(i.shape,t.edges,s),Oe.Utils.LT(o,s))n=[o,r]}return n}}intersect(t){if(t instanceof Oe.Point)return this.contains(t)?[t]:[];if(t instanceof Oe.Line)return Wme(t,this);if(t instanceof Oe.Ray)return guo(t,this);if(t instanceof Oe.Circle)return huo(t,this);if(t instanceof Oe.Segment)return Lgt(t,this);if(t instanceof Oe.Arc)return Hgt(t,this);if(t instanceof Oe.Polygon)return _ns(t,this);if(t instanceof Oe.Multiline)return mns(t,this)}translate(t){let n=new e;for(let o of this.faces)n.addFace(o.shapes.map((r)=>r.translate(t)));return n}rotate(t=0,n=new Oe.Point){let o=new e;for(let r of this.faces)o.addFace(r.shapes.map((i)=>i.rotate(t,n)));return o}scale(t,n){let o=new e;for(let r of this.faces)o.addFace(r.shapes.map((i)=>i.scale(t,n)));return o}transform(t=new Oe.Matrix){let n=new e;for(let o of this.faces)n.addFace(o.shapes.map((r)=>r.transform(t)));return n}toJSON(){return[...this.faces].map((t)=>t.toJSON())}toArray(){return[...this.faces].map((t)=>t.toPolygon())}dpath(){return[...this.faces].reduce((t,n)=>t+n.svg(),"")}svg(t={}){let n=`
<path ${DU({fillRule:"evenodd",fill:"lightcyan",...t})} d="`;for(let o of this.faces)n+=`
${o.svg()}`;return n+=`" >
</path>`,n}};Oe.Polygon=mos;var _os=(...e)=>new Oe.Polygon(...e);Oe.polygon=_os;var{Circle:cgt,Line:mdo,Point:_do,Vector:dTe,Utils:lgt}=Oe,gos=class e{constructor(t){this.circle=t}get inversion_circle(){return this.circle}static inversePoint(t,n){let o=new dTe(t.pc,n),r=t.r*t.r,i=o.dot(o);return lgt.EQ_0(i)?new _do(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY):t.pc.translate(o.multiply(r/i))}static inverseCircle(t,n){let o=t.pc.distanceTo(n.pc)[0];if(lgt.EQ(o,n.r)){let r=t.r*t.r/(2*n.r),i=new dTe(t.pc,n.pc);i=i.normalize();let s=t.pc.translate(i.multiply(r));return new mdo(s,i)}else{let r=new dTe(t.pc,n.pc),i=t.r*t.r/(r.dot(r)-n.r*n.r),s=t.pc.translate(r.multiply(i)),a=Math.abs(i)*n.r;return new cgt(s,a)}}static inverseLine(t,n){let[o,r]=t.pc.distanceTo(n);if(lgt.EQ_0(o))return n.clone();else{let i=t.r*t.r/(2*o),s=new dTe(t.pc,r.end);return s=s.multiply(i/o),new cgt(t.pc.translate(s),i)}}inverse(t){if(t instanceof _do)return e.inversePoint(this.circle,t);else if(t instanceof cgt)return e.inverseCircle(this.circle,t);else if(t instanceof mdo)return e.inverseLine(this.circle,t)}};Oe.Inversion=gos;var Aos=(e)=>new Oe.Inversion(e);Oe.inversion=Aos;var fos=class e{static point2point(t,n){return t.distanceTo(n)}static point2line(t,n){let o=t.projectionOn(n);return[new Oe.Vector(t,o).length,new Oe.Segment(t,o)]}static point2circle(t,n){let[o,r]=t.distanceTo(n.center);if(Oe.Utils.EQ_0(o))return[n.r,new Oe.Segment(t,n.toArc().start)];else{let i=Math.abs(o-n.r),s=new Oe.Vector(n.pc,t).normalize().multiply(n.r),a=n.pc.translate(s);return[i,new Oe.Segment(t,a)]}}static point2segment(t,n){if(n.start.equalTo(n.end))return e.point2point(t,n.start);let o=new Oe.Vector(n.start,n.end),r=new Oe.Vector(n.start,t),i=new Oe.Vector(n.end,t),s=o.dot(r),a=-o.dot(i),c,l;if(Oe.Utils.GE(s,0)&&Oe.Utils.GE(a,0)){let h=n.tangentInStart();return c=Math.abs(h.cross(r)),l=n.start.translate(h.multiply(h.dot(r))),[c,new Oe.Segment(t,l)]}else if(s<0)return t.distanceTo(n.start);else return t.distanceTo(n.end)}static point2arc(t,n){let o=new Oe.Circle(n.pc,n.r),r=[],i,s;if([i,s]=e.point2circle(t,o),s.end.on(n))r.push(e.point2circle(t,o));return r.push(e.point2point(t,n.start)),r.push(e.point2point(t,n.end)),e.sort(r),r[0]}static point2edge(t,n){return n.shape instanceof Oe.Segment?e.point2segment(t,n.shape):e.point2arc(t,n.shape)}static segment2line(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Oe.Segment(o[0],o[0])];let r=[];return r.push(e.point2line(t.start,n)),r.push(e.point2line(t.end,n)),e.sort(r),r[0]}static segment2segment(t,n){let o=vTe(t,n);if(o.length>0)return[0,new Oe.Segment(o[0],o[0])];let r=[],i,s;return[i,s]=e.point2segment(n.start,t),r.push([i,s.reverse()]),[i,s]=e.point2segment(n.end,t),r.push([i,s.reverse()]),r.push(e.point2segment(t.start,n)),r.push(e.point2segment(t.end,n)),e.sort(r),r[0]}static segment2circle(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Oe.Segment(o[0],o[0])];let r=new Oe.Line(t.ps,t.pe),[i,s]=e.point2line(n.center,r);if(Oe.Utils.GE(i,n.r)&&s.end.on(t))return e.point2circle(s.end,n);else{let[a,c]=e.point2circle(t.start,n),[l,h]=e.point2circle(t.end,n);return Oe.Utils.LT(a,l)?[a,c]:[l,h]}}static segment2arc(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Oe.Segment(o[0],o[0])];let r=new Oe.Line(t.ps,t.pe),i=new Oe.Circle(n.pc,n.r),[s,a]=e.point2line(i.center,r);if(Oe.Utils.GE(s,i.r)&&a.end.on(t)){let[d,u]=e.point2circle(a.end,i);if(u.end.on(n))return[d,u]}let c=[];c.push(e.point2arc(t.start,n)),c.push(e.point2arc(t.end,n));let l,h;return[l,h]=e.point2segment(n.start,t),c.push([l,h.reverse()]),[l,h]=e.point2segment(n.end,t),c.push([l,h.reverse()]),e.sort(c),c[0]}static circle2circle(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Oe.Segment(o[0],o[0])];if(t.center.equalTo(n.center)){let r=t.toArc(),i=n.toArc();return e.point2point(r.start,i.start)}else{let r=new Oe.Line(t.center,n.center),i=r.intersect(t),s=r.intersect(n),a=[];return a.push(e.point2point(i[0],s[0])),a.push(e.point2point(i[0],s[1])),a.push(e.point2point(i[1],s[0])),a.push(e.point2point(i[1],s[1])),e.sort(a),a[0]}}static circle2line(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Oe.Segment(o[0],o[0])];let[r,i]=e.point2line(t.center,n),[s,a]=e.point2circle(i.end,t);return a=a.reverse(),[s,a]}static arc2line(t,n){let o=n.intersect(t);if(o.length>0)return[0,new Oe.Segment(o[0],o[0])];let r=new Oe.Circle(t.center,t.r),[i,s]=e.point2line(r.center,n);if(Oe.Utils.GE(i,r.r)){let[a,c]=e.point2circle(s.end,r);if(c.end.on(t))return[a,c]}else{let a=[];return a.push(e.point2line(t.start,n)),a.push(e.point2line(t.end,n)),e.sort(a),a[0]}}static arc2circle(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Oe.Segment(o[0],o[0])];let r=new Oe.Circle(t.center,t.r),[i,s]=e.circle2circle(r,n);if(s.start.on(t))return[i,s];else{let a=[];return a.push(e.point2circle(t.start,n)),a.push(e.point2circle(t.end,n)),e.sort(a),a[0]}}static arc2arc(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Oe.Segment(o[0],o[0])];let r=new Oe.Circle(t.center,t.r),i=new Oe.Circle(n.center,n.r),[s,a]=e.circle2circle(r,i);if(a.start.on(t)&&a.end.on(n))return[s,a];else{let c=[],l,h;if([l,h]=e.point2arc(t.start,n),h.end.on(n))c.push([l,h]);if([l,h]=e.point2arc(t.end,n),h.end.on(n))c.push([l,h]);if([l,h]=e.point2arc(n.start,t),h.end.on(t))c.push([l,h.reverse()]);if([l,h]=e.point2arc(n.end,t),h.end.on(t))c.push([l,h.reverse()]);return[l,h]=e.point2point(t.start,n.start),c.push([l,h]),[l,h]=e.point2point(t.start,n.end),c.push([l,h]),[l,h]=e.point2point(t.end,n.start),c.push([l,h]),[l,h]=e.point2point(t.end,n.end),c.push([l,h]),e.sort(c),c[0]}}static point2polygon(t,n){let o=[Number.POSITIVE_INFINITY,new Oe.Segment];for(let r of n.edges){let[i,s]=e.point2edge(t,r);if(Oe.Utils.LT(i,o[0]))o=[i,s]}return o}static shape2polygon(t,n){let o=[Number.POSITIVE_INFINITY,new Oe.Segment];for(let r of n.edges){let[i,s]=t.distanceTo(r.shape);if(Oe.Utils.LT(i,o[0]))o=[i,s]}return o}static polygon2polygon(t,n){let o=[Number.POSITIVE_INFINITY,new Oe.Segment];for(let r of t.edges)for(let i of n.edges){let[s,a]=r.shape.distanceTo(i.shape);if(Oe.Utils.LT(s,o[0]))o=[s,a]}return o}static box2box_minmax(t,n){let o=Math.max(Math.max(t.xmin-n.xmax,0),Math.max(n.xmin-t.xmax,0)),r=Math.max(Math.max(t.ymin-n.ymax,0),Math.max(n.ymin-t.ymax,0)),i=o*o+r*r,s=t.merge(n),a=s.xmax-s.xmin,c=s.ymax-s.ymin,l=a*a+c*c;return[i,l]}static minmax_tree_process_level(t,n,o,r){let i,s;for(let h of n){[i,s]=e.box2box_minmax(t.box,h.item.key);for(let d of h.item.values)if(d instanceof Oe.Edge)r.insert([i,s],d.shape);else r.insert([i,s],d);if(Oe.Utils.LT(s,o))o=s}if(n.length===0)return o;let a=n.map((h)=>h.left.isNil()?void 0:h.left).filter((h)=>h!==void 0),c=n.map((h)=>h.right.isNil()?void 0:h.right).filter((h)=>h!==void 0),l=[...a,...c].filter((h)=>{let[d,u]=e.box2box_minmax(t.box,h.max);return Oe.Utils.LE(d,o)});return o=e.minmax_tree_process_level(t,l,o,r),o}static minmax_tree(t,n,o){let r=new bgt,i=[n.index.root],s=o<Number.POSITIVE_INFINITY?o*o:Number.POSITIVE_INFINITY;return s=e.minmax_tree_process_level(t,i,s,r),r}static minmax_tree_calc_distance(t,n,o){let r,i;if(n!=null&&!n.isNil()){if([r,i]=e.minmax_tree_calc_distance(t,n.left,o),i)return[r,i];if(Oe.Utils.LT(r[0],Math.sqrt(n.item.key.low)))return[r,!0];let[s,a]=e.distanceToArray(t,n.item.values);if(Oe.Utils.LT(s,r[0]))r=[s,a];return[r,i]=e.minmax_tree_calc_distance(t,n.right,r),[r,i]}return[o,!1]}static shape2planarSet(t,n,o=Number.POSITIVE_INFINITY){let r=[o,new Oe.Segment],i=!1;if(n instanceof Oe.PlanarSet){let s=e.minmax_tree(t,n,o);[r,i]=e.minmax_tree_calc_distance(t,s.root,r)}return r}static sort(t){t.sort((n,o)=>{if(Oe.Utils.LT(n[0],o[0]))return-1;if(Oe.Utils.GT(n[0],o[0]))return 1;return 0})}static distance(t,n){return t.distanceTo(n)}static distanceToArray(t,n){let o=[Number.POSITIVE_INFINITY,new Oe.Segment];for(let r of n){let[i,s]=t.distanceTo(r);if(Oe.Utils.LT(i,o[0]))o=[i,s]}return o}static shape2multiline(t,n){let o=[Number.POSITIVE_INFINITY,new Oe.Segment];for(let r of n){let[i,s]=e.distance(t,r.shape);if(Oe.Utils.LT(i,o[0]))o=[i,s]}return o}static multiline2multiline(t,n){let o=[Number.POSITIVE_INFINITY,new Oe.Segment];for(let r of t)for(let i of n){let[s,a]=e.distance(r.shape,i.shape);if(Oe.Utils.LT(s,o[0]))o=[s,a]}return o}};Oe.Distance=fos;var{Multiline:yos,Point:Euo,Segment:xos,Polygon:Muo}=Oe;function Vgt(e){return new Euo(e.split(" ").map(Number))}function wuo(e){return e.split(", ").map(Vgt)}function Ygt(e){let t=wuo(e),n=[];for(let o=0;o<t.length-1;o++)n.push(new xos(t[o],t[o+1]));return new yos(n)}function Cos(e){return e.replace(/\(\(/,"").replace(/\)\)$/,"").split("), (").map(Ygt)}function Buo(e){let t=e.replace(/\(\(/,"").replace(/\)\)$/,"").split("), ("),n=new Muo,o;return t.forEach((r,i)=>{let s=r.split(", ").map((c)=>new Euo(c.split(" ").map(Number))),a=n.addFace(s);if(i===0)o=a.orientation();else if(a.orientation()===o)a.reverse()}),n}function bos(e){let n=e.split(/\)\), \(\(/).map((i)=>"(("+i+"))").map(Buo),o=new Muo;return n.reduce((i,s)=>[...i,...s?.faces],[]).forEach((i)=>o.addFace([...i?.shapes])),o}function Ios(e){if(e.startsWith("POLYGON")){let t=e.replace(/^POLYGON /,"");return Buo(t)}else{let t=e.replace(/^MULTIPOLYGON \(\(\((.*)\)\)\)$/,"$1");return bos(t)}}function vos(e){return e.split(`
`).map((n)=>n.match(/\(([^)]+)\)/)[1]).map(Vgt)}function Sos(e){return e.split(`
`).map((n)=>n.match(/\(([^)]+)\)/)[1]).map(Ygt).reduce((n,o)=>[...n,...o],[])}function Tuo(e){if(e.startsWith("POINT")){let t=e.replace(/^POINT \(/,"").replace(/\)$/,"");return Vgt(t)}else if(e.startsWith("MULTIPOINT")){let t=e.replace(/^MULTIPOINT \(/,"").replace(/\)$/,"");return wuo(t)}else if(e.startsWith("LINESTRING")){let t=e.replace(/^LINESTRING \(/,"").replace(/\)$/,"");return Ygt(t)}else if(e.startsWith("MULTILINESTRING")){let t=e.replace(/^MULTILINESTRING /,"");return Cos(t)}else if(e.startsWith("POLYGON")||e.startsWith("MULTIPOLYGON"))return Ios(e);else if(e.startsWith("GEOMETRYCOLLECTION")){let t=/(?<type>POINT|LINESTRING|POLYGON|MULTIPOINT|MULTILINESTRING|MULTIPOLYGON) \((?:[^\(\)]|\([^\)]*\))*\)/g,n=e.match(t);if(n[0].startsWith("GEOMETRYCOLLECTION"))n[0]=n[0].replace("GEOMETRYCOLLECTION (","");return n.map(Tuo).map((r)=>r instanceof Array?r:[r]).reduce((r,i)=>[...r,...i],[])}else if(Duo(e))return vos(e);else if(Nuo(e))return Sos(e);return[]}function Duo(e){return e.split(`
`)?.every((t)=>t.includes("POINT"))}function Nuo(e){return e.split(`
`)?.every((t)=>t.includes("LINESTRING"))}function Pos(e){return e.startsWith("POINT")||Duo(e)||e.startsWith("LINESTRING")||Nuo(e)||e.startsWith("MULTILINESTRING")||e.startsWith("POLYGON")||e.startsWith("MULTIPOINT")||e.startsWith("MULTIPOLYGON")||e.startsWith("GEOMETRYCOLLECTION")}Oe.isWktString=Pos;Oe.parseWKT=Tuo;Oe.BooleanOperations=Tns;Oe.Relations=Uns;function gdo(e,t,n){if(!t||!n)return;let o=e.get(t);if(!o)o=new Set,e.set(t,o);o.add(n);let r=e.get(n);if(!r)r=new Set,e.set(n,r);r.add(t)}function Ruo(e,t){if(!t.subcircuit_id&&!t.source_group_id)return[...e];let n=t;if(t.subcircuit_id){let a=new Set([t.subcircuit_id]),c=new Map,l=new Map;for(let d of e)if(d.type==="source_group"){let{source_group_id:u,subcircuit_id:_}=d;if(_)l.set(u,_);let p=d.parent_source_group_id;if(p){if(!c.has(p))c.set(p,[]);c.get(p).push(u)}}let h;for(let[d,u]of l)if(u===t.subcircuit_id){h=d;break}if(h){let d=(u)=>{let _=c.get(u)||[];for(let p of _){let m=l.get(p);if(m)a.add(m);d(p)}};d(h),n={...t,subcircuit_ids:Array.from(a)}}}let o=new Map;for(let a of e){let c=`${a.type}_id`,l=a[c];if(typeof l==="string")o.set(l,a)}let r=new Map;for(let a of e){let c=Object.entries(a);for(let[l,h]of c){if(l==="parent_source_group_id")continue;if(l.endsWith("_id")&&typeof h==="string"){let d=o.get(h);gdo(r,a,d)}else if(l.endsWith("_ids")&&Array.isArray(h)){for(let d of h)if(typeof d==="string"){let u=o.get(d);gdo(r,a,u)}}}}let i=[],s=new Set;for(let a of e){let c=!1;if(n.subcircuit_id&&"subcircuit_id"in a&&a.subcircuit_id===n.subcircuit_id)c=!0;else if(n.subcircuit_ids&&"subcircuit_id"in a&&a.subcircuit_id&&n.subcircuit_ids.includes(a.subcircuit_id))c=!0;else if(n.source_group_id&&"source_group_id"in a&&a.source_group_id===n.source_group_id)c=!0;else if(n.source_group_id&&"member_source_group_ids"in a&&Array.isArray(a.member_source_group_ids)&&a.member_source_group_ids.includes(n.source_group_id))c=!0;if(c)i.push(a),s.add(a)}while(i.length>0){let a=i.shift(),c=r.get(a);if(!c)continue;for(let l of c)if(!s.has(l))s.add(l),i.push(l)}return e.filter((a)=>s.has(a))}var xTe=(e,t={})=>{let n=e,o=n._internal_store;if(!o){o={counts:{},editCount:0},n._internal_store=o;for(let i of n){let s=i.type,a=i[`${s}_id`];if(!a)continue;let c=Number.parseInt(a.split("_").pop());if(!Number.isNaN(c))o.counts[s]=Math.max(o.counts[s]??0,c)}}let r=new Proxy({},{get:(i,s)=>{if(s==="toArray")return()=>(n.editCount=o.editCount,n);if(s==="editCount")return o.editCount;if(s==="subtree")return(c)=>xTe(Ruo(n,c),t);if(s==="insert")return(c)=>{let l=c.type;if(!l)throw Error("insert requires an element with a type");o.counts[l]??=-1,o.counts[l]++;let h=o.counts[l],d={...c,type:l,[`${l}_id`]:`${l}_${h}`};if(t.validateInserts)(lne[l]??cne).parse(d);return n.push(d),o.editCount++,d};if(s==="insertAll")return(c)=>c.map((l)=>r.insert(l));let a=s;return{get:(c)=>n.find((l)=>l.type===a&&l[`${a}_id`]===c),getUsing:(c)=>{let l=Object.keys(c);if(l.length!==1)throw Error("getUsing requires exactly one key, e.g. { pcb_component_id }");let h=l[0],d=h.replace("_id",""),u=n.find((_)=>_.type===d&&_[h]===c[h]);if(!u)return null;return n.find((_)=>_.type===a&&_[`${a}_id`]===u[`${a}_id`])},getWhere:(c)=>{let l=Object.keys(c);return n.find((h)=>h.type===a&&l.every((d)=>h[d]===c[d]))},list:(c)=>{let l=!c?[]:Object.keys(c);return n.filter((h)=>h.type===a&&l.every((d)=>h[d]===c[d]))},insert:(c)=>{o.counts[a]??=-1,o.counts[a]++;let l=o.counts[a],h={type:a,[`${a}_id`]:`${a}_${l}`,...c};if(t.validateInserts)(lne[a]??cne).parse(h);return n.push(h),o.editCount++,h},delete:(c)=>{let l=n.find((h)=>h[`${a}_id`]===c);if(!l)return;n.splice(n.indexOf(l),1),o.editCount++},update:(c,l)=>{let h=n.find((d)=>d.type===a&&d[`${a}_id`]===c);if(!h)return null;return Object.assign(h,l),o.editCount++,h},select:(c)=>{if(a==="source_component")return n.find((l)=>l.type==="source_component"&&l.name===c.replace(/\./g,""));else if(a==="pcb_port"||a==="source_port"||a==="schematic_port"){let[l,h]=c.replace(/\./g,"").split(/[\s\>]+/),d=n.find((_)=>_.type==="source_component"&&_.name===l);if(!d)return null;let u=n.find((_)=>_.type==="source_port"&&_.source_component_id===d.source_component_id&&(_.name===h||(_.port_hints??[]).includes(h)));if(!u)return null;if(a==="source_port")return u;if(a==="pcb_port")return n.find((_)=>_.type==="pcb_port"&&_.source_port_id===u.source_port_id);else if(a==="schematic_port")return n.find((_)=>_.type==="schematic_port"&&_.source_port_id===u.source_port_id)}}}}});return r};xTe.unparsed=xTe;var eD=xTe;function hgt(e){let t=e.type;return`${t}:${e[`${t}_id`]}`}var Igt=(e,t={})=>{let n=e._internal_store_indexed;if(!n){n={counts:{},editCount:0,indexes:{}};for(let s of e){let a=s.type,c=s[`${a}_id`];if(!c)continue;let l=Number.parseInt(c.split("_").pop()||"");if(!Number.isNaN(l))n.counts[a]=Math.max(n.counts[a]??0,l)}let r=t.indexConfig||{},i=n.indexes;if(r.byId)i.byId=new Map;if(r.byType)i.byType=new Map;if(r.byRelation)i.byRelation=new Map;if(r.bySubcircuit)i.bySubcircuit=new Map;if(r.byCustomField&&r.byCustomField.length>0){i.byCustomField=new Map;for(let s of r.byCustomField)i.byCustomField.set(s,new Map)}for(let s of e){if(r.byId){let a=hgt(s);i.byId.set(a,s)}if(r.byType){let a=i.byType.get(s.type)||[];a.push(s),i.byType.set(s.type,a)}if(r.byRelation){let a=Object.entries(s);for(let[c,l]of a)if(c.endsWith("_id")&&c!==`${s.type}_id`&&typeof l==="string"){let h=i.byRelation.get(c)||new Map,d=h.get(l)||[];d.push(s),h.set(l,d),i.byRelation.set(c,h)}}if(r.bySubcircuit&&"subcircuit_id"in s){let a=s.subcircuit_id;if(a&&typeof a==="string"){let c=i.bySubcircuit.get(a)||[];c.push(s),i.bySubcircuit.set(a,c)}}if(r.byCustomField&&i.byCustomField){for(let a of r.byCustomField)if(a in s){let c=s[a];if(c!==void 0&&(typeof c==="string"||typeof c==="number")){let l=String(c),h=i.byCustomField.get(a),d=h.get(l)||[];d.push(s),h.set(l,d)}}}}e._internal_store_indexed=n}let o=new Proxy({},{get:(r,i)=>{if(i==="toArray")return()=>(e.editCount=n.editCount,e);if(i==="editCount")return n.editCount;if(i==="insert")return(a)=>{let{type:c,...l}=a;if(!c)throw Error("insert requires an element with a type");return delete l[`${c}_id`],o[c].insert(l)};if(i==="insertAll")return(a)=>a.map((c)=>o.insert(c));if(i==="subtree")return(a)=>Igt(Ruo(e,a),t);let s=i;return{get:(a)=>{let c=t.indexConfig||{};if(c.byId&&n.indexes.byId)return n.indexes.byId.get(`${s}:${a}`)||null;if(c.byType&&n.indexes.byType)return(n.indexes.byType.get(s)||[]).find((h)=>h[`${s}_id`]===a)||null;return e.find((l)=>l.type===s&&l[`${s}_id`]===a)||null},getUsing:(a)=>{let c=t.indexConfig||{},l=Object.keys(a);if(l.length!==1)throw Error("getUsing requires exactly one key, e.g. { pcb_component_id }");let h=l[0],d=h.replace("_id","");if(c.byRelation&&n.indexes.byRelation){let _=n.indexes.byRelation.get(h);if(_){let m=(_.get(a[h])||[]).find((g)=>g.type===d);if(!m)return null;let A=m[`${s}_id`];if(c.byId&&n.indexes.byId)return n.indexes.byId.get(`${s}:${A}`)||null;if(c.byType&&n.indexes.byType)return(n.indexes.byType.get(s)||[]).find((f)=>f[`${s}_id`]===A)||null;return e.find((g)=>g.type===s&&g[`${s}_id`]===A)||null}}let u=e.find((_)=>_.type===d&&_[h]===a[h]);if(!u)return null;return e.find((_)=>_.type===s&&_[`${s}_id`]===u[`${s}_id`])||null},getWhere:(a)=>{let c=t.indexConfig||{},l=Object.keys(a);if(l.length===1&&c.byCustomField&&n.indexes.byCustomField){let h=l[0],d=n.indexes.byCustomField.get(h);if(d){let u=String(a[h]);return(d.get(u)||[]).find((p)=>p.type===s)||null}}if("subcircuit_id"in a&&c.bySubcircuit&&n.indexes.bySubcircuit){let h=a.subcircuit_id;return(n.indexes.bySubcircuit.get(h)||[]).find((u)=>u.type===s&&l.every((_)=>u[_]===a[_]))||null}if(c.byType&&n.indexes.byType)return(n.indexes.byType.get(s)||[]).find((d)=>l.every((u)=>d[u]===a[u]))||null;return e.find((h)=>h.type===s&&l.every((d)=>h[d]===a[d]))||null},list:(a)=>{let c=t.indexConfig||{},l=!a?[]:Object.keys(a);if(l.length===0&&c.byType&&n.indexes.byType)return(n.indexes.byType.get(s)||[]).slice();if(l.length===1&&l[0]==="subcircuit_id"&&c.bySubcircuit&&n.indexes.bySubcircuit){let d=a.subcircuit_id;return(n.indexes.bySubcircuit.get(d)||[]).filter((_)=>_.type===s)}let h;if(c.byType&&n.indexes.byType)h=n.indexes.byType.get(s)||[];else h=e.filter((d)=>d.type===s);if(l.length>0)return h.filter((d)=>l.every((u)=>d[u]===a[u]));return h.slice()},insert:(a)=>{n.counts[s]??=-1,n.counts[s]++;let c=n.counts[s],l={type:s,[`${s}_id`]:`${s}_${c}`,...a};if(t.validateInserts)(lne[s]??cne).parse(l);e.push(l),n.editCount++;let h=t.indexConfig||{};if(h.byId&&n.indexes.byId){let d=hgt(l);n.indexes.byId.set(d,l)}if(h.byType&&n.indexes.byType){let d=n.indexes.byType.get(s)||[];d.push(l),n.indexes.byType.set(s,d)}if(h.byRelation&&n.indexes.byRelation){let d=Object.entries(l);for(let[u,_]of d)if(u.endsWith("_id")&&u!==`${l.type}_id`&&typeof _==="string"){let p=n.indexes.byRelation.get(u)||new Map,m=p.get(_)||[];m.push(l),p.set(_,m),n.indexes.byRelation.set(u,p)}}if(h.bySubcircuit&&n.indexes.bySubcircuit&&"subcircuit_id"in l){let d=l.subcircuit_id;if(d&&typeof d==="string"){let u=n.indexes.bySubcircuit.get(d)||[];u.push(l),n.indexes.bySubcircuit.set(d,u)}}if(h.byCustomField&&n.indexes.byCustomField){for(let d of h.byCustomField)if(d in l){let u=l[d];if(u!==void 0&&(typeof u==="string"||typeof u==="number")){let _=String(u),p=n.indexes.byCustomField.get(d),m=p.get(_)||[];m.push(l),p.set(_,m)}}}return l},delete:(a)=>{let c=t.indexConfig||{},l;if(c.byId&&n.indexes.byId)l=n.indexes.byId.get(`${s}:${a}`);else if(c.byType&&n.indexes.byType)l=(n.indexes.byType.get(s)||[]).find((u)=>u[`${s}_id`]===a);else l=e.find((d)=>d[`${s}_id`]===a);if(!l)return;let h=e.indexOf(l);if(h>=0)e.splice(h,1),n.editCount++;if(c.byId&&n.indexes.byId){let d=hgt(l);n.indexes.byId.delete(d)}if(c.byType&&n.indexes.byType){let u=(n.indexes.byType.get(s)||[]).filter((_)=>_[`${s}_id`]!==a);n.indexes.byType.set(s,u)}if(c.byRelation&&n.indexes.byRelation)for(let[d,u]of n.indexes.byRelation.entries())for(let[_,p]of u.entries()){let m=p.filter((A)=>A!==l);if(m.length===0)u.delete(_);else u.set(_,m)}if(c.bySubcircuit&&n.indexes.bySubcircuit&&"subcircuit_id"in l){let d=l.subcircuit_id;if(d){let _=(n.indexes.bySubcircuit.get(d)||[]).filter((p)=>p!==l);if(_.length===0)n.indexes.bySubcircuit.delete(d);else n.indexes.bySubcircuit.set(d,_)}}if(c.byCustomField&&n.indexes.byCustomField)for(let d of n.indexes.byCustomField.values())for(let[u,_]of d.entries()){let p=_.filter((m)=>m!==l);if(p.length===0)d.delete(u);else d.set(u,p)}},update:(a,c)=>{let l=t.indexConfig||{},h;if(l.byId&&n.indexes.byId)h=n.indexes.byId.get(`${s}:${a}`);else if(l.byType&&n.indexes.byType)h=(n.indexes.byType.get(s)||[]).find((u)=>u[`${s}_id`]===a);else h=e.find((d)=>d.type===s&&d[`${s}_id`]===a);if(!h)return null;if(l.byRelation&&n.indexes.byRelation){let d=Object.entries(h);for(let[u,_]of d)if(u.endsWith("_id")&&u!==`${h.type}_id`&&typeof _==="string"){if(u in c&&c[u]!==_){let p=n.indexes.byRelation.get(u);if(p){let A=(p.get(_)||[]).filter((g)=>g!==h);if(A.length===0)p.delete(_);else p.set(_,A)}}}}if(l.bySubcircuit&&n.indexes.bySubcircuit&&"subcircuit_id"in h&&"subcircuit_id"in c){let d=h.subcircuit_id,u=c.subcircuit_id;if(d!==u){let p=(n.indexes.bySubcircuit.get(d)||[]).filter((m)=>m!==h);if(p.length===0)n.indexes.bySubcircuit.delete(d);else n.indexes.bySubcircuit.set(d,p)}}if(l.byCustomField&&n.indexes.byCustomField){for(let d of l.byCustomField)if(d in h&&d in c&&h[d]!==c[d]){let u=n.indexes.byCustomField.get(d);if(u){let _=String(h[d]),m=(u.get(_)||[]).filter((A)=>A!==h);if(m.length===0)u.delete(_);else u.set(_,m)}}}if(Object.assign(h,c),n.editCount++,l.byRelation&&n.indexes.byRelation){let d=Object.entries(h);for(let[u,_]of d)if(u.endsWith("_id")&&u!==`${h.type}_id`&&typeof _==="string"){if(u in c){let p=n.indexes.byRelation.get(u)||new Map,m=p.get(_)||[];if(!m.includes(h))m.push(h),p.set(_,m),n.indexes.byRelation.set(u,p)}}}if(l.bySubcircuit&&n.indexes.bySubcircuit&&"subcircuit_id"in h&&"subcircuit_id"in c){let d=h.subcircuit_id;if(d&&typeof d==="string"){let u=n.indexes.bySubcircuit.get(d)||[];if(!u.includes(h))u.push(h),n.indexes.bySubcircuit.set(d,u)}}if(l.byCustomField&&n.indexes.byCustomField){for(let d of l.byCustomField)if(d in h&&d in c){let u=h[d];if(u!==void 0&&(typeof u==="string"||typeof u==="number")){let _=String(u),p=n.indexes.byCustomField.get(d),m=p.get(_)||[];if(!m.includes(h))m.push(h),p.set(_,m)}}}return h},select:(a)=>{if(s==="source_component")return e.find((c)=>c.type==="source_component"&&c.name===a.replace(/\./g,""))||null;else if(s==="pcb_port"||s==="source_port"||s==="schematic_port"){let[c,l]=a.replace(/\./g,"").split(/[\s\>]+/),h=e.find((u)=>u.type==="source_component"&&u.name===c);if(!h)return null;let d=e.find((u)=>u.type==="source_port"&&u.source_component_id===h.source_component_id&&(u.name===l||(u.port_hints??[]).includes(l)));if(!d)return null;if(s==="source_port")return d;if(s==="pcb_port")return e.find((u)=>u.type==="pcb_port"&&u.source_port_id===d.source_port_id)||null;else if(s==="schematic_port")return e.find((u)=>u.type==="schematic_port"&&u.source_port_id===d.source_port_id)||null}return null}}}});return o};Igt.unparsed=Igt;var Eos=(e)=>Math.round(e/(Math.PI/2)),Mos=(e)=>{switch(e){case"from_left":return{x:-1,y:0};case"from_right":return{x:1,y:0};case"from_top":return{x:0,y:1};case"from_bottom":return{x:0,y:-1}}},wos=({x:e,y:t})=>{if(e>0)return"from_right";if(e<0)return"from_left";if(t>0)return"from_top";return"from_bottom"},Bos=(e,t)=>{if(!e)return e;if(e==="from_above"||e==="from_below"){if(!t.isFlipped)return e;return e==="from_above"?"from_below":"from_above"}let{x:n,y:o}=Mos(e),r=Math.round(t.rotationDegrees/90);while(r>0)[n,o]=[-o,n],r--;while(r<0)[n,o]=[o,-n],r++;if(t.isFlipped)o=-o;return wos({x:n,y:o})},Tos=(e,t)=>{if(e.shape==="polygon")return e.points=e.points.map((s)=>fo(t,s)),e;let n=fo(t,{x:e.x,y:e.y});if(e.x=n.x,e.y=n.y,e.shape==="circle")return e;let o=e.shape==="rotated_rect"?e.ccw_rotation:0,r=t.a*t.d-t.b*t.c<0,i=Y_t(ud(t,O_t(o)),!1,r).rotation.angle*180/Math.PI;if(Math.abs(i)<0.00000001)Object.assign(e,{shape:"rect"}),Reflect.deleteProperty(e,"ccw_rotation");else Object.assign(e,{shape:"rotated_rect",ccw_rotation:i});return e},Dos=(e,t)=>{if(e.type==="pcb_soldermask_opening")return Tos(e,t);if((e.type==="pcb_smtpad"||e.type==="pcb_solder_paste")&&e.shape==="polygon"){if(e.points=e.points.map((s)=>fo(t,s)),e.type==="pcb_solder_paste"&&e.holes)e.holes=e.holes.map((s)=>s.map((a)=>fo(t,a)));return e}let n=Y_t(t),o=Math.abs(Eos(n.rotation.angle))%2===1,r=n.rotation.angle/Math.PI*180,i=n.scale.sy<0;if(e.type==="pcb_plated_hole"||e.type==="pcb_hole"||e.type==="pcb_via"||e.type==="pcb_smtpad"||e.type==="pcb_solder_paste"||e.type==="pcb_port"){let{x:s,y:a}=fo(t,{x:e.x,y:e.y});e.x=s,e.y=a}else if(e.type==="pcb_keepout"&&e.shape==="outline")e.outline=e.outline.map((s)=>fo(t,s));else if(e.type==="pcb_keepout"||e.type==="pcb_board")e.center=fo(t,e.center);else if(e.type==="pcb_silkscreen_text"||e.type==="pcb_fabrication_note_text"||e.type==="pcb_note_text")e.anchor_position=fo(t,e.anchor_position);else if(e.type==="pcb_copper_text"){if(e.anchor_position)e.anchor_position=fo(t,e.anchor_position)}else if(e.type==="pcb_courtyard_rect")e.center=fo(t,e.center),e.ccw_rotation=((e.ccw_rotation??0)+r)%360;else if(e.type==="pcb_silkscreen_circle"||e.type==="pcb_silkscreen_rect"||e.type==="pcb_silkscreen_pill"||e.type==="pcb_silkscreen_oval"||e.type==="pcb_note_rect"||e.type==="pcb_courtyard_circle")e.center=fo(t,e.center);else if(e.type==="pcb_component"){if(e.center=fo(t,e.center),e.rotation=e.rotation+r,e.rotation=e.rotation%360,e.cable_insertion_center)e.cable_insertion_center=fo(t,e.cable_insertion_center);if(e.insertion_direction=Bos(e.insertion_direction,{rotationDegrees:r,isFlipped:i}),o)[e.width,e.height]=[e.height,e.width]}else if(e.type==="pcb_courtyard_outline")e.outline=e.outline.map((s)=>{let a=fo(t,s);return s.x=a.x,s.y=a.y,s});else if(e.type==="pcb_courtyard_polygon")e.points=e.points.map((s)=>{let a=fo(t,s);return s.x=a.x,s.y=a.y,s});else if(e.type==="pcb_trace")e.route=e.route.map((s)=>{if(!("x"in s))return s.start=fo(t,s.start),s.end=fo(t,s.end),s;let a=fo(t,s);return s.x=a.x,s.y=a.y,s});else if(e.type==="pcb_silkscreen_path"||e.type==="pcb_trace_hint"||e.type==="pcb_fabrication_note_path"||e.type==="pcb_note_path")e.route=e.route.map((s)=>{let a=fo(t,s);return s.x=a.x,s.y=a.y,s});else if(e.type==="pcb_silkscreen_line"||e.type==="pcb_note_line"){let s={x:e.x1,y:e.y1},a={x:e.x2,y:e.y2},c=fo(t,s),l=fo(t,a);e.x1=c.x,e.y1=c.y,e.x2=l.x,e.y2=l.y}else if(e.type==="cad_component"){let s=fo(t,{x:e.position.x,y:e.position.y});e.position.x=s.x,e.position.y=s.y}return e},Nos=(e)=>{let t=e.type;return e[`${t}_id`]},vgt=(e,t)=>({minX:Math.min(e.minX,t.minX),minY:Math.min(e.minY,t.minY),maxX:Math.max(e.maxX,t.maxX),maxY:Math.max(e.maxY,t.maxY)}),wme=(e,t,n)=>{let o=n/2;return{minX:e-o,minY:t-o,maxX:e+o,maxY:t+o}},Ado=(e,t,n,o,r)=>{let i=n/2,s=o/2,a=r*Math.PI/180,c=Math.cos(a),l=Math.sin(a),h=[{x:-i,y:-s},{x:i,y:-s},{x:i,y:s},{x:-i,y:s}].map((d)=>({x:e+d.x*c-d.y*l,y:t+d.x*l+d.y*c}));return{minX:Math.min(...h.map((d)=>d.x)),minY:Math.min(...h.map((d)=>d.y)),maxX:Math.max(...h.map((d)=>d.x)),maxY:Math.max(...h.map((d)=>d.y))}},Ros=(e,t,n,o,r)=>{let i=n/2,s=o/2,a=r*Math.PI/180,c=Math.cos(a),l=Math.sin(a),h=Math.hypot(i*c,s*l),d=Math.hypot(i*l,s*c);return{minX:e-h,minY:t-d,maxX:e+h,maxY:t+d}},Qos=(e,t,n,o,r)=>{let i=Math.min(n,o)/2,s=Math.max(n,o)/2-i,a=r*Math.PI/180,c=n>=o?{x:s,y:0}:{x:0,y:s},l={x:c.x*Math.cos(a)-c.y*Math.sin(a),y:c.x*Math.sin(a)+c.y*Math.cos(a)},h=Math.abs(l.x)+i,d=Math.abs(l.y)+i;return{minX:e-h,minY:t-d,maxX:e+h,maxY:t+d}},uTe=(e)=>{if(e.length===0)return null;return{minX:Math.min(...e.map((t)=>t.x)),minY:Math.min(...e.map((t)=>t.y)),maxX:Math.max(...e.map((t)=>t.x)),maxY:Math.max(...e.map((t)=>t.y))}},dgt=(e)=>{if(!Array.isArray(e))return[];return e.flatMap((t)=>{if(!t||typeof t!=="object")return[];if("x"in t&&"y"in t&&typeof t.x==="number"&&typeof t.y==="number")return[{x:t.x,y:t.y}];if("start"in t&&"end"in t)return[t.start,t.end].filter((o)=>Boolean(o&&typeof o==="object"&&"x"in o&&"y"in o&&typeof o.x==="number"&&typeof o.y==="number"));return[]})},Quo=(e)=>{if(!e.type.startsWith("pcb_"))return null;if(e.type==="pcb_smtpad"&&e.shape==="polygon"&&Array.isArray(e.points))return uTe(e.points);if(e.type==="pcb_hole"&&e.hole_shape==="circle")return wme(e.x,e.y,e.hole_diameter);if(e.type==="pcb_plated_hole"){let d;if("outer_diameter"in e&&typeof e.outer_diameter==="number")d=wme(e.x,e.y,e.outer_diameter);else if("hole_diameter"in e&&typeof e.hole_diameter==="number")d=wme(e.x,e.y,e.hole_diameter);if((e.shape==="oval"||e.shape==="pill")&&typeof e.outer_width==="number"&&typeof e.outer_height==="number")d=(e.shape==="pill"?Qos:Ros)(e.x,e.y,e.outer_width,e.outer_height,e.ccw_rotation??0);if("rect_pad_width"in e&&typeof e.rect_pad_width==="number"&&"rect_pad_height"in e&&typeof e.rect_pad_height==="number"){let u=Ado(e.x,e.y,e.rect_pad_width,e.rect_pad_height,"rect_ccw_rotation"in e?e.rect_ccw_rotation??0:0);d=d?vgt(d,u):u}if("hole_diameter"in e&&typeof e.hole_diameter==="number"){let u=wme(e.x+("hole_offset_x"in e?e.hole_offset_x??0:0),e.y+("hole_offset_y"in e?e.hole_offset_y??0:0),e.hole_diameter);d=d?vgt(d,u):u}if(d)return d}let t=e,n=uTe(dgt(t.route));if(n)return n;let o=uTe(dgt(t.outline));if(o)return o;let r=uTe(dgt(t.points));if(r)return r;let i,s,a,c;if("x"in e&&"y"in e)i=Number(e.x),s=Number(e.y);if("outer_diameter"in e)a=Number(e.outer_diameter),c=Number(e.outer_diameter);if("width"in e)a=Number(e.width);if("height"in e)c=Number(e.height);if("center"in e&&e.center&&typeof e.center==="object"&&"x"in e.center&&"y"in e.center)i=Number(e.center.x),s=Number(e.center.y);let l=0;if("rotation"in e&&typeof e.rotation==="number")l=e.rotation;if("ccw_rotation"in e&&typeof e.ccw_rotation==="number")l=e.ccw_rotation;if(i!==void 0&&s!==void 0){if(a!==void 0&&c!==void 0)return l?Ado(i,s,a,c,l):{minX:i-a/2,minY:s-c/2,maxX:i+a/2,maxY:s+c/2};if("radius"in e&&typeof e.radius==="number")return wme(i,s,e.radius*2);return{minX:i,minY:s,maxX:i,maxY:s}}let h=[t.anchor_position,t.position].filter((d)=>Boolean(d&&typeof d==="object"&&"x"in d&&"y"in d&&typeof d.x==="number"&&typeof d.y==="number")).at(0);return h?{minX:h.x,minY:h.y,maxX:h.x,maxY:h.y}:null},Sgt=(e)=>{let t={minX:Number.POSITIVE_INFINITY,minY:Number.POSITIVE_INFINITY,maxX:Number.NEGATIVE_INFINITY,maxY:Number.NEGATIVE_INFINITY};for(let n of e){let o=Quo(n);if(o)t=vgt(t,o)}return t};function kos(e){let t=0;if(e.length==0)return t;for(var n=0;n<e.length;n++){var o=e.charCodeAt(n);t=(t<<5)-t+o,t=t&t}return Math.abs(t)}var fdo=[["#69d2e7","#a7dbd8","#e0e4cc","#f38630","#fa6900"],["#fe4365","#fc9d9a","#f9cdad","#c8c8a9","#83af9b"],["#ecd078","#d95b43","#c02942","#542437","#53777a"],["#556270","#4ecdc4","#c7f464","#ff6b6b","#c44d58"],["#774f38","#e08e79","#f1d4af","#ece5ce","#c5e0dc"],["#e8ddcb","#cdb380","#036564","#033649","#031634"],["#490a3d","#bd1550","#e97f02","#f8ca00","#8a9b0f"],["#594f4f","#547980","#45ada8","#9de0ad","#e5fcc2"],["#00a0b0","#6a4a3c","#cc333f","#eb6841","#edc951"],["#e94e77","#d68189","#c6a49a","#c6e5d9","#f4ead5"],["#3fb8af","#7fc7af","#dad8a7","#ff9e9d","#ff3d7f"],["#d9ceb2","#948c75","#d5ded9","#7a6a53","#99b2b7"],["#ffffff","#cbe86b","#f2e9e1","#1c140d","#cbe86b"],["#efffcd","#dce9be","#555152","#2e2633","#99173c"],["#343838","#005f6b","#008c9e","#00b4cc","#00dffc"],["#413e4a","#73626e","#b38184","#f0b49e","#f7e4be"],["#ff4e50","#fc913a","#f9d423","#ede574","#e1f5c4"],["#99b898","#fecea8","#ff847c","#e84a5f","#2a363b"],["#655643","#80bca3","#f6f7bd","#e6ac27","#bf4d28"],["#00a8c6","#40c0cb","#f9f2e7","#aee239","#8fbe00"],["#351330","#424254","#64908a","#e8caa4","#cc2a41"],["#554236","#f77825","#d3ce3d","#f1efa5","#60b99a"],["#5d4157","#838689","#a8caba","#cad7b2","#ebe3aa"],["#8c2318","#5e8c6a","#88a65e","#bfb35a","#f2c45a"],["#fad089","#ff9c5b","#f5634a","#ed303c","#3b8183"],["#ff4242","#f4fad2","#d4ee5e","#e1edb9","#f0f2eb"],["#f8b195","#f67280","#c06c84","#6c5b7b","#355c7d"],["#d1e751","#ffffff","#000000","#4dbce9","#26ade4"],["#1b676b","#519548","#88c425","#bef202","#eafde6"],["#5e412f","#fcebb6","#78c0a8","#f07818","#f0a830"],["#bcbdac","#cfbe27","#f27435","#f02475","#3b2d38"],["#452632","#91204d","#e4844a","#e8bf56","#e2f7ce"],["#eee6ab","#c5bc8e","#696758","#45484b","#36393b"],["#f0d8a8","#3d1c00","#86b8b1","#f2d694","#fa2a00"],["#2a044a","#0b2e59","#0d6759","#7ab317","#a0c55f"],["#f04155","#ff823a","#f2f26f","#fff7bd","#95cfb7"],["#b9d7d9","#668284","#2a2829","#493736","#7b3b3b"],["#bbbb88","#ccc68d","#eedd99","#eec290","#eeaa88"],["#b3cc57","#ecf081","#ffbe40","#ef746f","#ab3e5b"],["#a3a948","#edb92e","#f85931","#ce1836","#009989"],["#300030","#480048","#601848","#c04848","#f07241"],["#67917a","#170409","#b8af03","#ccbf82","#e33258"],["#aab3ab","#c4cbb7","#ebefc9","#eee0b7","#e8caaf"],["#e8d5b7","#0e2430","#fc3a51","#f5b349","#e8d5b9"],["#ab526b","#bca297","#c5ceae","#f0e2a4","#f4ebc3"],["#607848","#789048","#c0d860","#f0f0d8","#604848"],["#b6d8c0","#c8d9bf","#dadabd","#ecdbbc","#fedcba"],["#a8e6ce","#dcedc2","#ffd3b5","#ffaaa6","#ff8c94"],["#3e4147","#fffedf","#dfba69","#5a2e2e","#2a2c31"],["#fc354c","#29221f","#13747d","#0abfbc","#fcf7c5"],["#cc0c39","#e6781e","#c8cf02","#f8fcc1","#1693a7"],["#1c2130","#028f76","#b3e099","#ffeaad","#d14334"],["#a7c5bd","#e5ddcb","#eb7b59","#cf4647","#524656"],["#dad6ca","#1bb0ce","#4f8699","#6a5e72","#563444"],["#5c323e","#a82743","#e15e32","#c0d23e","#e5f04c"],["#edebe6","#d6e1c7","#94c7b6","#403b33","#d3643b"],["#fdf1cc","#c6d6b8","#987f69","#e3ad40","#fcd036"],["#230f2b","#f21d41","#ebebbc","#bce3c5","#82b3ae"],["#b9d3b0","#81bda4","#b28774","#f88f79","#f6aa93"],["#3a111c","#574951","#83988e","#bcdea5","#e6f9bc"],["#5e3929","#cd8c52","#b7d1a3","#dee8be","#fcf7d3"],["#1c0113","#6b0103","#a30006","#c21a01","#f03c02"],["#000000","#9f111b","#b11623","#292c37","#cccccc"],["#382f32","#ffeaf2","#fcd9e5","#fbc5d8","#f1396d"],["#e3dfba","#c8d6bf","#93ccc6","#6cbdb5","#1a1f1e"],["#f6f6f6","#e8e8e8","#333333","#990100","#b90504"],["#1b325f","#9cc4e4","#e9f2f9","#3a89c9","#f26c4f"],["#a1dbb2","#fee5ad","#faca66","#f7a541","#f45d4c"],["#c1b398","#605951","#fbeec2","#61a6ab","#accec0"],["#5e9fa3","#dcd1b4","#fab87f","#f87e7b","#b05574"],["#951f2b","#f5f4d7","#e0dfb1","#a5a36c","#535233"],["#8dccad","#988864","#fea6a2","#f9d6ac","#ffe9af"],["#2d2d29","#215a6d","#3ca2a2","#92c7a3","#dfece6"],["#413d3d","#040004","#c8ff00","#fa023c","#4b000f"],["#eff3cd","#b2d5ba","#61ada0","#248f8d","#605063"],["#ffefd3","#fffee4","#d0ecea","#9fd6d2","#8b7a5e"],["#cfffdd","#b4dec1","#5c5863","#a85163","#ff1f4c"],["#9dc9ac","#fffec7","#f56218","#ff9d2e","#919167"],["#4e395d","#827085","#8ebe94","#ccfc8e","#dc5b3e"],["#a8a7a7","#cc527a","#e8175d","#474747","#363636"],["#f8edd1","#d88a8a","#474843","#9d9d93","#c5cfc6"],["#046d8b","#309292","#2fb8ac","#93a42a","#ecbe13"],["#f38a8a","#55443d","#a0cab5","#cde9ca","#f1edd0"],["#a70267","#f10c49","#fb6b41","#f6d86b","#339194"],["#ff003c","#ff8a00","#fabe28","#88c100","#00c176"],["#ffedbf","#f7803c","#f54828","#2e0d23","#f8e4c1"],["#4e4d4a","#353432","#94ba65","#2790b0","#2b4e72"],["#0ca5b0","#4e3f30","#fefeeb","#f8f4e4","#a5b3aa"],["#4d3b3b","#de6262","#ffb88c","#ffd0b3","#f5e0d3"],["#fffbb7","#a6f6af","#66b6ab","#5b7c8d","#4f2958"],["#edf6ee","#d1c089","#b3204d","#412e28","#151101"],["#9d7e79","#ccac95","#9a947c","#748b83","#5b756c"],["#fcfef5","#e9ffe1","#cdcfb7","#d6e6c3","#fafbe3"],["#9cddc8","#bfd8ad","#ddd9ab","#f7af63","#633d2e"],["#30261c","#403831","#36544f","#1f5f61","#0b8185"],["#aaff00","#ffaa00","#ff00aa","#aa00ff","#00aaff"],["#d1313d","#e5625c","#f9bf76","#8eb2c5","#615375"],["#ffe181","#eee9e5","#fad3b2","#ffba7f","#ff9c97"],["#73c8a9","#dee1b6","#e1b866","#bd5532","#373b44"],["#805841","#dcf7f3","#fffcdd","#ffd8d8","#f5a2a2"]],Los=(e)=>{let{x:t,y:n,width:o,height:r}={...e,...e.size,...e.center,...e.position};if(e.x1!==void 0&&e.x2!==void 0&&e.y1!==void 0&&e.y2!==void 0)t=(e.x1+e.x2)/2,n=(e.y1+e.y2)/2,o=Math.abs(e.x1-e.x2),r=Math.abs(e.y1-e.y2);if(e.points&&Array.isArray(e.points)&&e.points.length>0){let a=e.points.map((_)=>_.x),c=e.points.map((_)=>_.y),l=Math.min(...a),h=Math.max(...a),d=Math.min(...c),u=Math.max(...c);t=(l+h)/2,n=(d+u)/2,o=h-l,r=u-d}let i=e.text||e.name||e.source?.text||e.source?.name||"?",s=e;if(t===void 0||n===void 0)return null;if(o===void 0){if("radius"in e)o=e.radius*2,r=e.radius*2;else if("outer_diameter"in e)o=e.outer_diameter,r=e.outer_diameter;else if("rect_pad_width"in e&&"rect_pad_height"in e){if(o=e.rect_pad_width,r=e.rect_pad_height,"hole_diameter"in e)o=Math.max(o,e.hole_diameter),r=Math.max(r,e.hole_diameter)}else if("hole_diameter"in e)o=e.hole_diameter,r=e.hole_diameter}if(o===void 0||r===void 0)o=0.1,r=0.1;return{x:t,y:n,width:o,height:r,title:i,content:s,bg_color:fdo[kos(e.type||i)%fdo.length]?.[4]??"#f00"}},Hos=(e)=>Boolean(e),Fos=(e)=>{let t=e.filter((l)=>l.type.startsWith("pcb_")||l.type.startsWith("schematic_")).concat(e.filter((l)=>l.type==="pcb_trace"||l.type==="schematic_trace").flatMap((l)=>l.route)).map((l)=>Los(l)).filter(Hos);if(t.length===0)return{center:{x:0,y:0},width:0,height:0};let n=t[0].x-t[0].width/2,o=t[0].x+t[0].width/2,r=t[0].y-t[0].height/2,i=t[0].y+t[0].height/2;for(let l of t.slice(1))n=Math.min(n,l.x-l.width/2),o=Math.max(o,l.x+l.width/2),r=Math.min(r,l.y-l.height/2),i=Math.max(i,l.y+l.height/2);let s=o-n,a=i-r;return{center:{x:n+s/2,y:r+a/2},width:s,height:a}},zos={leftside_top:{side:"leftside",alignment:"top"},leftside_bottom:{side:"leftside",alignment:"bottom"},rightside_top:{side:"rightside",alignment:"top"},rightside_bottom:{side:"rightside",alignment:"bottom"},topside_left:{side:"topside",alignment:"left"},topside_right:{side:"topside",alignment:"right"},bottomside_left:{side:"bottomside",alignment:"left"},bottomside_right:{side:"bottomside",alignment:"right"}},Qka=Object.keys(zos),ip={RENDERING_ENGINE:"pcb_viewer_rendering_engine",COPPER_POUR_OPACITY:"pcb_viewer_copper_pour_opacity",HIDDEN_LAYER_OPACITY:"pcb_viewer_hidden_layer_opacity",IS_SHOWING_PCB_GROUPS:"pcb_viewer_is_showing_pcb_groups",PCB_GROUP_VIEW_MODE:"pcb_viewer_group_view_mode",IS_SHOWING_COPPER_POURS:"pcb_viewer_is_showing_copper_pours",IS_SHOWING_COURTYARDS:"pcb_viewer_is_showing_courtyards",IS_SHOWING_GROUP_ANCHOR_OFFSETS:"pcb_viewer_is_showing_group_anchor_offsets",IS_SHOWING_SOLDER_MASK:"pcb_viewer_is_showing_solder_mask",IS_SHOWING_FABRICATION_NOTES:"pcb_viewer_is_showing_fabrication_notes",IS_SHOWING_PCB_NOTES:"pcb_viewer_is_showing_pcb_notes",IS_SHOWING_SILKSCREEN:"pcb_viewer_is_showing_silkscreen"},xH=(e,t)=>{if(typeof window>"u")return t;try{let n=localStorage.getItem(e);return n!==null?JSON.parse(n):t}catch{return t}},CH=(e,t)=>{if(typeof window>"u")return;try{localStorage.setItem(e,JSON.stringify(t))}catch{}},Fuo=(e,t)=>{if(typeof window>"u")return t;try{let n=localStorage.getItem(e);return n!==null?JSON.parse(n):t}catch{return t}},zuo=(e,t)=>{if(typeof window>"u")return;try{localStorage.setItem(e,JSON.stringify(t))}catch{}},ydo=(e,t)=>{if(typeof window>"u")return t;try{let n=localStorage.getItem(e),o=n!==null?JSON.parse(n):null;return typeof o==="number"&&Number.isFinite(o)?o:t}catch{return t}},xdo=(e,t)=>{if(typeof window>"u")return;try{localStorage.setItem(e,JSON.stringify(t))}catch{}},Vos="named_only",Yos=(e={},t=!1)=>nho((n)=>({copper_pour_opacity:Math.max(0,Math.min(1,ydo(ip.COPPER_POUR_OPACITY,1))),setCopperPourOpacity:(o)=>{if(!Number.isFinite(o))return;let r=Math.max(0,Math.min(1,o));xdo(ip.COPPER_POUR_OPACITY,r),n({copper_pour_opacity:r})},hidden_layer_opacity:Math.max(0,Math.min(1,ydo(ip.HIDDEN_LAYER_OPACITY,0.2))),setHiddenLayerOpacity:(o)=>{if(!Number.isFinite(o))return;let r=Math.max(0,Math.min(1,o));xdo(ip.HIDDEN_LAYER_OPACITY,r),n({hidden_layer_opacity:r})},selected_layer:"top",pcb_viewer_id:`pcb_viewer_${Math.random().toString().slice(2,10)}`,in_edit_mode:!1,in_move_footprint_mode:!1,is_moving_component:!1,is_mouse_over_container:!1,is_showing_multiple_traces_length:!1,is_showing_rats_nest:!1,is_showing_autorouting:!0,is_showing_drc_errors:!0,is_showing_drc_warnings:!0,is_showing_copper_pours:xH(ip.IS_SHOWING_COPPER_POURS,!0),is_showing_courtyards:xH(ip.IS_SHOWING_COURTYARDS,!0),is_showing_pcb_groups:t?!1:xH(ip.IS_SHOWING_PCB_GROUPS,!0),is_showing_group_anchor_offsets:xH(ip.IS_SHOWING_GROUP_ANCHOR_OFFSETS,!1),is_showing_solder_mask:xH(ip.IS_SHOWING_SOLDER_MASK,!1),is_showing_silkscreen:xH(ip.IS_SHOWING_SILKSCREEN,!0),is_showing_fabrication_notes:xH(ip.IS_SHOWING_FABRICATION_NOTES,!1),is_showing_pcb_notes:xH(ip.IS_SHOWING_PCB_NOTES,!0),pcb_group_view_mode:t?"all":Fuo(ip.PCB_GROUP_VIEW_MODE,Vos),hovered_error_id:null,focused_error_id:null,...e,selectLayer:(o)=>n({selected_layer:o}),setEditMode:(o)=>n({in_edit_mode:o!=="off",in_move_footprint_mode:o==="move_footprint",is_moving_component:!1}),setIsShowingRatsNest:(o)=>n({is_showing_rats_nest:o}),setIsMovingComponent:(o)=>n({is_moving_component:o}),setIsMouseOverContainer:(o)=>n({is_mouse_over_container:o}),setIsShowingMultipleTracesLength:(o)=>n({is_showing_multiple_traces_length:o}),setIsShowingAutorouting:(o)=>n({is_showing_autorouting:o}),setIsShowingDrcErrors:(o)=>n({is_showing_drc_errors:o}),setIsShowingDrcWarnings:(o)=>n({is_showing_drc_warnings:o}),setIsShowingCopperPours:(o)=>{CH(ip.IS_SHOWING_COPPER_POURS,o),n({is_showing_copper_pours:o})},setIsShowingCourtyards:(o)=>{CH(ip.IS_SHOWING_COURTYARDS,o),n({is_showing_courtyards:o})},setIsShowingPcbGroups:(o)=>{if(t)return;CH(ip.IS_SHOWING_PCB_GROUPS,o),n({is_showing_pcb_groups:o})},setIsShowingGroupAnchorOffsets:(o)=>{CH(ip.IS_SHOWING_GROUP_ANCHOR_OFFSETS,o),n({is_showing_group_anchor_offsets:o})},setIsShowingSolderMask:(o)=>{CH(ip.IS_SHOWING_SOLDER_MASK,o),n({is_showing_solder_mask:o})},setIsShowingSilkscreen:(o)=>{CH(ip.IS_SHOWING_SILKSCREEN,o),n({is_showing_silkscreen:o})},setIsShowingFabricationNotes:(o)=>{CH(ip.IS_SHOWING_FABRICATION_NOTES,o),n({is_showing_fabrication_notes:o})},setIsShowingPcbNotes:(o)=>{CH(ip.IS_SHOWING_PCB_NOTES,o),n({is_showing_pcb_notes:o})},setPcbGroupViewMode:(o)=>{if(t)return;zuo(ip.PCB_GROUP_VIEW_MODE,o),n({pcb_group_view_mode:o})},setHoveredErrorId:(o)=>n({hovered_error_id:o}),setFocusedErrorId:(o)=>n({focused_error_id:o})})),Qa=(e)=>{let t=Huo.useContext(Vuo);return cho(t,e)},Vuo=Luo.createContext(null),Gos=({children:e,initialState:t,disablePcbGroups:n})=>{let o=kuo.useMemo(()=>Yos(t,n),[n]);return Ouo.jsx(Vuo.Provider,{value:o,children:e})},Uos=()=>{Yuo.useEffect(()=>{Aho()},[]);let e=Qa((t)=>t.pcb_viewer_id);return Guo.jsx(gho,{position:"top-center",containerId:e})};function Wos(){var e=Lne.useRef(!1),t=Lne.useCallback(function(){return e.current},[]);return Lne.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),t}var Xos=function(e){if(e===void 0)e={};var t=ETe.useState(e),n=t[0],o=t[1],r=ETe.useCallback(function(i){o(function(s){return Object.assign({},s,i instanceof Function?i(s):i)})},[]);return[n,r]},jos=Xos,Kos=function(){},Uuo=typeof window<"u",$os=$do(Xts()),qos=function(){var e=Wos(),t=jos({value:void 0,error:void 0,noUserInteraction:!0}),n=t[0],o=t[1],r=Wuo.useCallback(function(i){if(!e())return;var s,a;try{if(typeof i!=="string"&&typeof i!=="number"){var c=Error("Cannot copy typeof "+typeof i+" to clipboard, must be a string");console.error(c),o({value:i,error:c,noUserInteraction:!0});return}else if(i===""){var c=Error("Cannot copy empty string to clipboard.");console.error(c),o({value:i,error:c,noUserInteraction:!0});return}a=i.toString(),s=(0,$os.default)(a),o({value:a,error:void 0,noUserInteraction:s})}catch(l){o({value:a,error:l,noUserInteraction:s})}},[]);return[n,r]},Jos=qos,Zos=Uuo?MTe.useLayoutEffect:MTe.useEffect,ers=Zos,Xuo={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};function trs(){var e=Lme.useState(null),t=e[0],n=e[1],o=Lme.useState(Xuo),r=o[0],i=o[1],s=Lme.useMemo(function(){return new window.ResizeObserver(function(a){if(a[0]){var c=a[0].contentRect,{x:l,y:h,width:d,height:u,top:_,left:p,bottom:m,right:A}=c;i({x:l,y:h,width:d,height:u,top:_,left:p,bottom:m,right:A})}})},[]);return ers(function(){if(!t)return;return s.observe(t),function(){s.disconnect()}},[t]),[n,r]}var Kme=Uuo&&typeof window.ResizeObserver<"u"?trs:function(){return[Kos,Xuo]},Cdo=({initialTransform:e,initialTouch1:t,initialTouch2:n,finalTouch1:o,finalTouch2:r})=>{if(!o||!r)return e;let i={x:(t.x+n.x)/2,y:(t.y+n.y)/2},s={x:(o.x+r.x)/2,y:(o.y+r.y)/2},a=Math.hypot(n.x-t.x,n.y-t.y),c=Math.hypot(r.x-o.x,r.y-o.y),l=a===0?1:c/a,h=s.x-i.x,d=s.y-i.y;return ud(Ra(h,d),Ra(i.x,i.y),bf(l,l),Ra(-i.x,-i.y),e)},nrs=(e={})=>{let t=vf.useRef(null),[n,o]=vf.useState(0),r=e.canvasElm??t.current,[i,s]=vf.useState(e.initialTransform??xf()),[a,c]=vf.useState(0),[l,h]=vf.useReducer((y)=>y+1,0),d=vf.useCallback((y)=>{if(e.onSetTransform)e.onSetTransform(y);if(!e.transform)s(y)},[e.onSetTransform,s]),u=vf.useCallback((y)=>{d(y),h()},[d]),_=e.transform??i,p=vf.useCallback(()=>{o(Date.now())},[]),m=vf.useRef("none"),A=vf.useRef(null),g=vf.useRef(null);vf.useEffect(()=>{let y=e.canvasElm??t.current;if(y&&!r){c(a+1);return}if(!y){let O=setTimeout(()=>{c(a+1)},100);return()=>clearTimeout(O)}let x=e.transform??i,C={x:0,y:0},b={x:0,y:0},I=!1,v={x:0,y:0},P=(O)=>({x:O.pageX-y.getBoundingClientRect().left-window.scrollX,y:O.pageY-y.getBoundingClientRect().top-window.scrollY});function M(O){if(e.enabled===!1)return;if(e.shouldDrag&&!e.shouldDrag(O))return;if(C=P(O),Date.now()-n<100)return;I=!0,O.preventDefault()}function B(O){if(!I||e.enabled===!1)return;if(e.shouldDrag&&!e.shouldDrag(O))return;b=P(O);let U=ud(Ra(b.x-C.x,b.y-C.y),x);d(U),x=U,I=!1}function T(O){if(v=P(O),!I||e.enabled===!1)return;if(e.shouldDrag&&!e.shouldDrag(O))return;b=P(O);let U=ud(Ra(b.x-C.x,b.y-C.y),x);d(U)}function N(O){if(e.enabled===!1)return;if(e.shouldDrag&&!e.shouldDrag(O))return;let U=P(O),j=ud(Ra(U.x,U.y),bf(1-O.deltaY/1000,1-O.deltaY/1000),Ra(-U.x,-U.y),x);d(j),x=j,O.preventDefault()}function D(O){if(!I)return;if(e.shouldDrag&&!e.shouldDrag(O))return;if(y){let j=y.getBoundingClientRect();if(O.clientX>=j.left+10&&O.clientX<=j.right-10&&O.clientY>=j.top+10&&O.clientY<=j.bottom-10)return}I=!1,b=P(O);let U=ud(Ra(b.x-C.x,b.y-C.y),x);d(U),x=U}function L(O){if(O.preventDefault(),e.enabled===!1)return;if(O.touches.length===1){m.current="drag";let U=O.touches[0];A.current={initialTransform:x,initialTouch:{x:U.clientX,y:U.clientY}}}else if(O.touches.length===2){m.current="pinch";let U=O.touches[0],j=O.touches[1];g.current={initialTransform:x,initialTouch1:{x:U.clientX,y:U.clientY},initialTouch2:{x:j.clientX,y:j.clientY},finalTouch1:null,finalTouch2:null}}}function H(O){if(O.preventDefault(),e.enabled===!1)return;if(m.current==="drag"&&O.touches.length===1&&A.current){let U=O.touches[0],j={x:U.clientX,y:U.clientY},Y=j.x-A.current.initialTouch.x,X=j.y-A.current.initialTouch.y,K=ud(Ra(Y,X),A.current.initialTransform);d(K)}else if(m.current==="pinch"&&O.touches.length===2&&g.current){let U=O.touches[0],j=O.touches[1];g.current.finalTouch1={x:U.clientX,y:U.clientY},g.current.finalTouch2={x:j.clientX,y:j.clientY};let Y=Cdo(g.current);d(Y)}}function V(O){O.preventDefault();let U=O.changedTouches[0];if(m.current==="drag"&&A.current&&U){let j={x:U.clientX,y:U.clientY},Y=j.x-A.current.initialTouch.x,X=j.y-A.current.initialTouch.y,K=ud(Ra(Y,X),A.current.initialTransform);d(K),x=K}else if(m.current==="pinch"&&g.current){let j=Cdo(g.current);d(j),x=j}m.current="none",A.current=null,g.current=null}return y.addEventListener("mousedown",M),y.addEventListener("mouseup",B),window.addEventListener("mousemove",T),y.addEventListener("mouseout",D),y.addEventListener("wheel",N),y.addEventListener("touchstart",L,{passive:!1}),y.addEventListener("touchmove",H,{passive:!1}),y.addEventListener("touchend",V,{passive:!1}),y.addEventListener("touchcancel",V,{passive:!1}),()=>{y.removeEventListener("mousedown",M),y.removeEventListener("mouseup",B),window.removeEventListener("mousemove",T),y.removeEventListener("mouseout",D),y.removeEventListener("wheel",N),y.removeEventListener("touchstart",L),y.removeEventListener("touchmove",H),y.removeEventListener("touchend",V),y.removeEventListener("touchcancel",V)}},[r,a,l,n,e.enabled,e.shouldDrag]);let f=vf.useCallback((y)=>fo(_,y),[_]);return{ref:t,transform:_,applyTransformToPoint:f,setTransform:u,cancelDrag:p}},ors=nrs,rrs=(e,t)=>{if(e?.type!=="pcb_smtpad"&&e?.type!=="pcb_plated_hole")return;let n=t.find((r)=>r.type==="pcb_component"&&r.pcb_component_id===e.pcb_component_id);if(n?.type!=="pcb_component")return;let o=t.find((r)=>r.type==="source_component"&&r.source_component_id===n.source_component_id);if(o?.type!=="source_component")return;return{source_component_id:o.source_component_id,pcb_component_id:n.pcb_component_id,refdes:o.name,manufacturer_part_number:o.manufacturer_part_number}};function juo(e){let t=e;while(t.parent!==null)t=t.parent;let n=e;while(n.parent!==null&&n.parent!==t){let o=n.parent;n.parent=t,n=o}return t}function irs(e,t){let n={nodeId:e,nextMember:null},o={parent:null,networkId:`connectivity_net${t.nextNetworkNumber++}`,firstMember:n,lastMember:n};return t.rootByNodeId.set(e,o),o}function srs(e,t){let n=t.rootByNodeId.get(e);return n===void 0?irs(e,t):juo(n)}function ars({targetRoot:e,sourceRoot:t}){e.lastMember.nextMember=t.firstMember,e.lastMember=t.lastMember,t.parent=e}function crs(e){let t=[],n=e.firstMember;while(n!==null)t.push(n.nodeId),n=n.nextMember;return t}function lrs(e){let t={rootByNodeId:new Map,nextNetworkNumber:0};for(let o of e){let r=null;for(let i of o){let s=srs(i,t);if(r===null){r=s;continue}if(r=juo(r),s!==r)ars({targetRoot:r,sourceRoot:s})}}let n={};for(let o of t.rootByNodeId.values()){if(o.parent!==null)continue;n[o.networkId]=crs(o)}return n}var hrs=class{netMap;idToNetMap;constructor(e){this.netMap=e,this.idToNetMap={};for(let[t,n]of Object.entries(e))for(let o of n)this.idToNetMap[o]=t}addConnections(e){for(let t of e){let n=new Set;for(let r of t){let i=this.idToNetMap[r];if(i)n.add(i)}let o;if(n.size===0)o=`connectivity_net${Object.keys(this.netMap).length}`,this.netMap[o]=[];else if(n.size===1)o=n.values().next().value??`connectivity_net${Object.keys(this.netMap).length}`;else{o=n.values().next().value??`connectivity_net${Object.keys(this.netMap).length}`;for(let r of n)if(r!==o){this.netMap[o].push(...this.netMap[r]),this.netMap[r]=this.netMap[o];for(let i of this.netMap[o])this.idToNetMap[i]=o}}for(let r of t){if(!this.netMap[o].includes(r))this.netMap[o].push(r);this.idToNetMap[r]=o}}}getIdsConnectedToNet(e){return this.netMap[e]||[]}getNetConnectedToId(e){return this.idToNetMap[e]}areIdsConnected(e,t){if(e===t)return!0;let n=this.getNetConnectedToId(e);if(!n)return!1;let o=this.getNetConnectedToId(t);if(!o)return!1;return n===o||o===e||o===e}areAllIdsConnected(e){let t=this.getNetConnectedToId(e[0]);for(let n of e){let o=this.getNetConnectedToId(n);if(o===void 0)return!1;if(o!==t)return!1}return!0}},Kuo=(e)=>{let t=[];for(let o of e)if(o.type==="source_trace")t.push([o.source_trace_id,...o.connected_source_port_ids??[],...o.connected_source_net_ids??[]].filter(Boolean));else if(o.type==="pcb_port"){let{pcb_port_id:r,source_port_id:i}=o;if(i&&r)t.push([i,r])}else if(o.type==="pcb_smtpad"){let{pcb_smtpad_id:r,pcb_port_id:i}=o;if(i&&r)t.push([r,i])}else if(o.type==="pcb_plated_hole"){let{pcb_plated_hole_id:r,pcb_port_id:i}=o;if(i&&r)t.push([r,i])}else if(o.type==="pcb_trace"){let{pcb_trace_id:r,source_trace_id:i}=o,s=Array.isArray(o.route)?o.route.filter((a)=>a&&a.route_type==="wire"):[];if(i&&r)t.push([r,i]);if(Array.isArray(s)){let a=s.find((l)=>l?.start_pcb_port_id)?.start_pcb_port_id,c=s.find((l)=>l?.end_pcb_port_id)?.end_pcb_port_id;if(a&&r)t.push([a,r]);if(r&&c)t.push([r,c])}}else if(o.type==="pcb_via"){let{pcb_via_id:r,pcb_trace_id:i,source_trace_id:s,source_net_id:a}=o,c=[...o.pcb_port_ids??[],i,s,a].filter((l)=>Boolean(l));if(r&&c.length>0)t.push([r,...c])}else if(o.type==="source_component"){if(o.internally_connected_source_port_ids)for(let r of o.internally_connected_source_port_ids)t.push(r)}let n=lrs(t);return new hrs(n)};function drs(e,t){if(e.length<2)throw Error("Stroke must have at least two points");let n=e.map((d)=>{if(Array.isArray(d))return{x:d[0],y:d[1]};return d}),o=[],r=[];function i(d,u){let _=u.x-d.x,p=u.y-d.y,m=Math.sqrt(_*_+p*p);return{x:-p/m,y:_/m}}function s(d,u,_,p){let m=p/2,A={x:d.x+u.x*m*_,y:d.y+u.y*m*_};if(_>0)o.push(A);else r.unshift(A)}let a=i(n[0],n[1]),c=n[0].trace_width??t;s(n[0],a,1,c),s(n[0],a,-1,c);for(let d=1;d<n.length-1;d++){let u=n[d-1],_=n[d],p=n[d+1],m=i(u,_),A=i(_,p),g=m.x+A.x,f=m.y+A.y,y=Math.sqrt(g*g+f*f),x=_.trace_width??t,C=2;if(y/2>2*(x/2))s(_,m,1,x),s(_,A,1,x),s(_,m,-1,x),s(_,A,-1,x);else{let b=1/y;s(_,{x:g*b,y:f*b},1,x),s(_,{x:g*b,y:f*b},-1,x)}}let l=i(n[n.length-2],n[n.length-1]),h=n[n.length-1].trace_width??t;return s(n[n.length-1],l,1,h),s(n[n.length-1],l,-1,h),[...o,...r]}var urs=(e,t)=>{let{x:n,y:o,width:r,height:i,layer:s,rect_border_radius:a}=e,c=e.corner_radius??a??0,l=[{_pcb_drawing_object_id:r8("rect"),pcb_drawing_type:"rect",x:n,y:o,w:r,h:i,layer:s||"top",_element:e,_parent_pcb_component:t._parent_pcb_component,_parent_source_component:t._parent_source_component,_source_port:t._source_port,roundness:c,...e.shape==="rotated_rect"&&e.ccw_rotation!==void 0?{ccw_rotation:e.ccw_rotation}:{}}];if(e.is_covered_with_solder_mask){let h=s==="bottom"?"soldermask_with_copper_bottom":"soldermask_with_copper_top",u={...{_pcb_drawing_object_id:r8("rect"),pcb_drawing_type:"rect",x:n,y:o,w:r,h:i,layer:h,_element:e,_parent_pcb_component:t._parent_pcb_component,_parent_source_component:t._parent_source_component,_source_port:t._source_port,roundness:c,...e.shape==="rotated_rect"&&e.ccw_rotation!==void 0?{ccw_rotation:e.ccw_rotation}:{}},..."solder_mask_color"in e&&e.solder_mask_color?{color:e.solder_mask_color}:{}};l.push(u)}return l},prs=(e,t)=>{let{x:n,y:o,radius:r,layer:i}=e,s=[{_pcb_drawing_object_id:r8("circle"),pcb_drawing_type:"circle",x:n,y:o,r,layer:i||"top",_element:e,_parent_pcb_component:t._parent_pcb_component,_parent_source_component:t._parent_source_component,_source_port:t._source_port}];if(e.is_covered_with_solder_mask){let a=i==="bottom"?"soldermask_with_copper_bottom":"soldermask_with_copper_top",c={_pcb_drawing_object_id:r8("circle"),pcb_drawing_type:"circle",x:n,y:o,r,layer:a,_element:e,_parent_pcb_component:t._parent_pcb_component,_parent_source_component:t._parent_source_component,_source_port:t._source_port,..."solder_mask_color"in e&&e.solder_mask_color?{color:e.solder_mask_color}:{}};s.push(c)}return s},mrs=(e,t)=>{let{layer:n,points:o}=e,r=[{_pcb_drawing_object_id:r8("polygon"),pcb_drawing_type:"polygon",points:Pgt(o),layer:n||"top",_element:e,_parent_pcb_component:t._parent_pcb_component,_parent_source_component:t._parent_source_component,_source_port:t._source_port}];if(e.is_covered_with_solder_mask){let i=n==="bottom"?"soldermask_with_copper_bottom":"soldermask_with_copper_top",s={_pcb_drawing_object_id:r8("polygon"),pcb_drawing_type:"polygon",points:Pgt(o),layer:i,_element:e,_parent_pcb_component:t._parent_pcb_component,_parent_source_component:t._parent_source_component,_source_port:t._source_port,..."solder_mask_color"in e&&e.solder_mask_color?{color:e.solder_mask_color}:{}};r.push(s)}return r},_rs=(e,t)=>{let{x:n,y:o,width:r,height:i,layer:s}=e,a=[{_pcb_drawing_object_id:r8("pill"),pcb_drawing_type:"pill",x:n,y:o,w:r,h:i,layer:s||"top",_element:e,_parent_pcb_component:t._parent_pcb_component,_parent_source_component:t._parent_source_component,_source_port:t._source_port}];if(e.is_covered_with_solder_mask){let c=s==="bottom"?"soldermask_with_copper_bottom":"soldermask_with_copper_top",l={_pcb_drawing_object_id:r8("pill"),pcb_drawing_type:"pill",x:n,y:o,w:r,h:i,layer:c,_element:e,_parent_pcb_component:t._parent_pcb_component,_parent_source_component:t._parent_source_component,_source_port:t._source_port,..."solder_mask_color"in e&&e.solder_mask_color?{color:e.solder_mask_color}:{}};a.push(l)}return a},grs=(e,t)=>{let{x:n,y:o,width:r,height:i,layer:s,ccw_rotation:a}=e,c=[{_pcb_drawing_object_id:r8("pill"),pcb_drawing_type:"pill",x:n,y:o,w:r,h:i,layer:s||"top",_element:e,_parent_pcb_component:t._parent_pcb_component,_parent_source_component:t._parent_source_component,_source_port:t._source_port,ccw_rotation:a}];if(e.is_covered_with_solder_mask){let l=s==="bottom"?"soldermask_with_copper_bottom":"soldermask_with_copper_top",h={_pcb_drawing_object_id:r8("pill"),pcb_drawing_type:"pill",x:n,y:o,w:r,h:i,layer:l,_element:e,_parent_pcb_component:t._parent_pcb_component,_parent_source_component:t._parent_source_component,_source_port:t._source_port,ccw_rotation:a,..."solder_mask_color"in e&&e.solder_mask_color?{color:e.solder_mask_color}:{}};c.push(h)}return c},N0=0,r8=(e)=>`${e}_${N0++}`,Pgt=(e)=>(e??[]).map((t)=>({x:En.parse(t.x),y:En.parse(t.y)}));function Ars(e){let t=new Map;for(let n of e){let o=n[`${n.type}_id`];if(o!==void 0&&!t.has(`${n.type}:${o}`))t.set(`${n.type}:${o}`,n)}return t}var frs=(e,t,n)=>{let o=(c,l)=>{if(l===void 0)return;return n?n.get(`${c}:${l}`):t.find((h)=>h.type===c&&h[`${c}_id`]===l)},r=o("pcb_component","pcb_component_id"in e?e.pcb_component_id:void 0),i=o("source_component",r?.source_component_id),s="source_port_id"in e?e.source_port_id:("pcb_port_id"in e)?o("pcb_port",e.pcb_port_id)?.source_port_id:void 0,a=o("source_port",s);switch(e.type){case"pcb_smtpad":{let c={_parent_pcb_component:r,_parent_source_component:i,_source_port:a};if(e.shape==="rect"||e.shape==="rotated_rect")return urs(e,c);else if(e.shape==="circle")return prs(e,c);else if(e.shape==="polygon")return mrs(e,c);else if(e.shape==="pill")return _rs(e,c);else if(e.shape==="rotated_pill")return grs(e,c);return[]}case"pcb_trace":{let c=[];if(e.route_thickness_mode==="interpolated"){let d=e.route.flatMap((p)=>{if(p.route_type==="through_pad")return[{...p.start,trace_width:p.width},{...p.end,trace_width:p.width}];return[{x:p.x,y:p.y,trace_width:p.route_type==="wire"?p.width:0.5}]}),u=drs(d,0.5),_=e.route[0].layer;return c.push({_pcb_drawing_object_id:`polygon_${N0++}`,_element:e,pcb_drawing_type:"polygon",points:u,layer:_}),e.route.forEach((p)=>{if(p.route_type==="via")c.push({_pcb_drawing_object_id:`circle_${N0++}`,_element:e,pcb_drawing_type:"circle",x:p.x,y:p.y,r:p.outer_diameter/2,layer:p.from_layer})}),c}let l=null,h=null;for(let d of e.route)if(d.route_type==="wire"){if(l!==null&&h!==null)c.push({_pcb_drawing_object_id:`line_${N0++}`,_element:e,pcb_drawing_type:"line",x1:l,y1:h,x2:d.x,y2:d.y,width:d.width,squareCap:!1,layer:d.layer});l=d.x,h=d.y}return c}case"pcb_via":{let{x:c,y:l,outer_diameter:h,hole_diameter:d}=e,{from_layer:u,to_layer:_,layers:p}=e,m=[];if(u&&_)m.push(u,_);else if(p&&Array.isArray(p))m.push(...p);else m.push("top","bottom");let A=[];for(let g of m)A.push({_pcb_drawing_object_id:`circle_${N0++}`,pcb_drawing_type:"circle",x:c,y:l,r:h/2,layer:g,_element:e,_parent_pcb_component:r,_parent_source_component:i});return A.push({_pcb_drawing_object_id:`circle_${N0++}`,pcb_drawing_type:"circle",x:c,y:l,r:d/2,layer:"drill",_element:e}),A}case"pcb_plated_hole":if(e.shape==="circle"){let{x:c,y:l,hole_diameter:h,outer_diameter:d}=e;return[{_pcb_drawing_object_id:`circle_${N0++}`,pcb_drawing_type:"circle",x:c,y:l,r:d/2,layer:"top",_element:e,_parent_pcb_component:r,_parent_source_component:i,_source_port:a},{_pcb_drawing_object_id:`circle_${N0++}`,pcb_drawing_type:"circle",x:c,y:l,r:h/2,layer:"drill",_element:e}]}else if(e.shape==="oval"){let{x:c,y:l,outer_height:h,outer_width:d,hole_height:u,hole_width:_}=e;return[{_pcb_drawing_object_id:`oval_${N0++}`,pcb_drawing_type:"oval",x:c,y:l,rX:d/2,rY:h/2,layer:"top",_element:e,_parent_pcb_component:r,_parent_source_component:i,_source_port:a},{_pcb_drawing_object_id:`oval_${N0++}`,_element:e,pcb_drawing_type:"oval",x:c,y:l,rX:_/2,rY:u/2,layer:"drill"}]}else if(e.shape==="pill"){let{x:c,y:l,outer_height:h,outer_width:d,hole_height:u,hole_width:_}=e;return[{_pcb_drawing_object_id:`pill_${N0++}`,pcb_drawing_type:"pill",x:c,y:l,w:d,h,layer:"top",_element:e,_parent_pcb_component:r,_parent_source_component:i,_source_port:a,ccw_rotation:e.ccw_rotation},{_pcb_drawing_object_id:`pill_${N0++}`,_element:e,pcb_drawing_type:"pill",x:c,y:l,w:_,h:u,layer:"drill",ccw_rotation:e.ccw_rotation}]}else if(e.shape==="circular_hole_with_rect_pad"){let{x:c,y:l,hole_diameter:h,rect_pad_width:d,rect_pad_height:u,rect_border_radius:_,hole_offset_x:p,hole_offset_y:m}=e,A=En.parse(p??0),g=En.parse(m??0);return[{_pcb_drawing_object_id:`rect_${N0++}`,pcb_drawing_type:"rect",x:c,y:l,w:d,h:u,layer:"top",_element:e,_parent_pcb_component:r,_parent_source_component:i,_source_port:a,roundness:_},{_pcb_drawing_object_id:`rect_${N0++}`,pcb_drawing_type:"rect",x:c,y:l,w:d,h:u,layer:"bottom",_element:e,_parent_pcb_component:r,_parent_source_component:i,_source_port:a,roundness:_,is_hoverable:!1},{_pcb_drawing_object_id:`circle_${N0++}`,_element:e,pcb_drawing_type:"circle",x:c+A,y:l+g,r:h/2,layer:"drill",is_hoverable:!1}]}else if(e.shape==="pill_hole_with_rect_pad"){let{x:c,y:l,hole_width:h,hole_height:d,rect_pad_width:u,rect_pad_height:_,rect_border_radius:p}=e;return[{_pcb_drawing_object_id:`rect_${N0++}`,pcb_drawing_type:"rect",x:c,y:l,w:u,h:_,layer:"top",_element:e,_parent_pcb_component:r,_parent_source_component:i,_source_port:a,roundness:p},{_pcb_drawing_object_id:`rect_${N0++}`,pcb_drawing_type:"rect",x:c,y:l,w:u,h:_,layer:"bottom",_element:e,_parent_pcb_component:r,_parent_source_component:i,_source_port:a,roundness:p,is_hoverable:!1},{_pcb_drawing_object_id:`pill_${N0++}`,_element:e,pcb_drawing_type:"pill",x:c,y:l,w:h,h:d,layer:"drill",is_hoverable:!1}]}else if(e.shape==="rotated_pill_hole_with_rect_pad"){let{x:c,y:l,hole_width:h,hole_height:d,hole_ccw_rotation:u,rect_pad_width:_,rect_pad_height:p,rect_ccw_rotation:m,rect_border_radius:A}=e;return[{_pcb_drawing_object_id:`rect_${N0++}`,pcb_drawing_type:"rect",x:c,y:l,w:_,h:p,layer:"top",_element:e,_parent_pcb_component:r,_parent_source_component:i,_source_port:a,ccw_rotation:m,roundness:A},{_pcb_drawing_object_id:`rect_${N0++}`,pcb_drawing_type:"rect",x:c,y:l,w:_,h:p,layer:"bottom",_element:e,_parent_pcb_component:r,_parent_source_component:i,_source_port:a,ccw_rotation:m,roundness:A,is_hoverable:!1},{_pcb_drawing_object_id:`pill_${N0++}`,_element:e,pcb_drawing_type:"pill",x:c,y:l,w:h,h:d,layer:"drill",ccw_rotation:u,is_hoverable:!1}]}else if(e.shape==="hole_with_polygon_pad"){let{x:c,y:l,pad_outline:h,hole_shape:d,hole_diameter:u,hole_width:_,hole_height:p,layers:m,hole_offset_x:A,hole_offset_y:g}=e,f=En.parse(A??0),y=En.parse(g??0),x=h,C=[];if(x&&Array.isArray(x)){let v=Pgt(x).map((P)=>({x:P.x+c,y:P.y+l}));for(let P of m||["top","bottom"])C.push({_pcb_drawing_object_id:`polygon_${N0++}`,pcb_drawing_type:"polygon",points:v,layer:P,_element:e,_parent_pcb_component:r,_parent_source_component:i,_source_port:a})}let b={x:c+f,y:l+y},I=[];if(d==="circle")I.push({_pcb_drawing_object_id:`circle_${N0++}`,pcb_drawing_type:"circle",x:b.x,y:b.y,r:(u??0)/2,layer:"drill",_element:e,_parent_pcb_component:r,_parent_source_component:i});else if(d==="oval")I.push({_pcb_drawing_object_id:`oval_${N0++}`,pcb_drawing_type:"oval",x:b.x,y:b.y,rX:(_??0)/2,rY:(p??0)/2,layer:"drill",_element:e,_parent_pcb_component:r,_parent_source_component:i});else if(d==="pill"||d==="rotated_pill")I.push({_pcb_drawing_object_id:`pill_${N0++}`,pcb_drawing_type:"pill",x:b.x,y:b.y,w:_??0,h:p??0,layer:"drill",_element:e,_parent_pcb_component:r,_parent_source_component:i,ccw_rotation:e.ccw_rotation});return[...C,...I]}else return[]}return[]};function yrs({primitivesWithoutInteractionMetadata:e,drawingObjectIdsWithMouseOver:t,primitiveIdsInMousedOverNet:n}){let o=[];for(let r of e){let i={...r},{_element:s,_parent_pcb_component:a}=r;if(r?.layer==="drill")i.is_in_highlighted_net=!1,i.is_mouse_over=!1;else if(t.has(r._pcb_drawing_object_id))i.is_mouse_over=!0;else if(s&&(("pcb_trace_id"in s)&&n.includes(s.pcb_trace_id)||("pcb_port_id"in s)&&n.includes(s.pcb_port_id)||("pcb_via_id"in s)&&n.includes(s.pcb_via_id)||("pcb_component_id"in s)&&n.includes(s.pcb_component_id)||a&&("pcb_component_id"in a)&&n.includes(a.pcb_component_id)))i.is_in_highlighted_net=!0;else i.is_in_highlighted_net=!1,i.is_mouse_over=!1;o.push(i)}return o}var $uo=(e)=>{let t=new Map,n=new Map,o=new Map,r=new Map,i=new Map;for(let s of e)if(s.type==="pcb_trace"&&s.pcb_trace_id)t.set(s.pcb_trace_id,s);else if(s.type==="pcb_port"&&s.pcb_port_id)n.set(s.pcb_port_id,s);else if(s.type==="pcb_via"&&s.pcb_via_id)o.set(s.pcb_via_id,s);else if(s.type==="pcb_component"&&s.pcb_component_id)r.set(s.pcb_component_id,s);else if(s.type==="pcb_board"&&s.pcb_board_id)i.set(s.pcb_board_id,s);return{tracesById:t,portsById:n,viasById:o,componentsById:r,boardsById:i}},nI=(e,t)=>{if(!t)return e;if(!e)return t;return{minX:Math.min(e.minX,t.minX),maxX:Math.max(e.maxX,t.maxX),minY:Math.min(e.minY,t.minY),maxY:Math.max(e.maxY,t.maxY)}},EU=(e,t=0.45)=>({minX:e.x-t,maxX:e.x+t,minY:e.y-t,maxY:e.y+t}),xrs=(e)=>{if(e.length===0)return null;let t=null;for(let n of e){let o=Math.max((n.width??0.2)/2,0.3);t=nI(t,EU(n,o))}return t},bdo=(e)=>{if(!e?.center)return null;let t=Math.max(e.width??0,1.2),n=Math.max(e.height??0,1.2);return{minX:e.center.x-t/2,maxX:e.center.x+t/2,minY:e.center.y-n/2,maxY:e.center.y+n/2}},Crs=(e)=>{if(!e?.center||typeof e.width!=="number"||typeof e.height!=="number")return null;return{minX:e.center.x-e.width/2,maxX:e.center.x+e.width/2,minY:e.center.y-e.height/2,maxY:e.center.y+e.height/2}},brs=(e,t)=>({minX:e.minX-t,maxX:e.maxX+t,minY:e.minY-t,maxY:e.maxY+t}),Irs=(e,t=0.35)=>{let n=Hs(e);if(!n)return null;return brs(n,t)},quo=({error:e,tracesById:t,portsById:n,viasById:o,componentsById:r})=>{if(e.center)return e.center;if(e.pcb_center)return e.pcb_center;if(e.component_center)return e.component_center;if(e.pcb_via_ids?.length){let i=e.pcb_via_ids.map((s)=>o.get(s)).filter(Boolean);if(i.length>0)return{x:i.reduce((s,a)=>s+a.x,0)/i.length,y:i.reduce((s,a)=>s+a.y,0)/i.length}}if(e.pcb_port_ids?.length){let i=e.pcb_port_ids.map((s)=>n.get(s)).filter(Boolean);if(i.length>0)return{x:i.reduce((s,a)=>s+a.x,0)/i.length,y:i.reduce((s,a)=>s+a.y,0)/i.length}}if(e.pcb_trace_id){let i=t.get(e.pcb_trace_id);if(i?.route?.length){let s=Math.floor(i.route.length/2);return{x:i.route[s].x,y:i.route[s].y}}}if(e.pcb_component_id)return r.get(e.pcb_component_id)?.center??null;return null},vrs=({error:e,indexes:t})=>quo({error:e,...t}),Srs=({error:e,boardsById:t})=>{if(!e.component_bounds||!e.pcb_board_id)return null;let n=Crs(t.get(e.pcb_board_id));if(!n)return null;let o=e.component_bounds,r=[];if(o.min_x<n.minX)r.push({x:n.minX,y:Math.max(o.min_y,n.minY)}),r.push({x:n.minX,y:Math.min(o.max_y,n.maxY)});if(o.max_x>n.maxX)r.push({x:n.maxX,y:Math.max(o.min_y,n.minY)}),r.push({x:n.maxX,y:Math.min(o.max_y,n.maxY)});if(o.min_y<n.minY)r.push({x:Math.max(o.min_x,n.minX),y:n.minY}),r.push({x:Math.min(o.max_x,n.maxX),y:n.minY});if(o.max_y>n.maxY)r.push({x:Math.max(o.min_x,n.minX),y:n.maxY}),r.push({x:Math.min(o.max_x,n.maxX),y:n.maxY});return Irs(r,0.3)},Ido=new Set(["source_failed_to_create_component_error"]),Prs=({error:e,indexes:t})=>{if(Ido.has(e.error_type)||Ido.has(e.type))return null;let n=null,o=quo({error:e,...t});if(o)n=nI(n,EU(o,0.35));if(e.error_type==="pcb_component_outside_board_error")n=nI(n,Srs({error:e,boardsById:t.boardsById}));else if(e.component_bounds&&!o)n=nI(n,{minX:e.component_bounds.min_x,maxX:e.component_bounds.max_x,minY:e.component_bounds.min_y,maxY:e.component_bounds.max_y});if(e.center&&!o)n=nI(n,EU(e.center));if(e.pcb_center&&!o)n=nI(n,EU(e.pcb_center));if(e.component_center&&!o)n=nI(n,EU(e.component_center));if(e.pcb_port_ids&&!o)for(let r of e.pcb_port_ids){let i=t.portsById.get(r);if(i)n=nI(n,EU({x:i.x,y:i.y},0.4))}if(e.pcb_trace_id&&!o){let r=t.tracesById.get(e.pcb_trace_id);if(r?.route)n=nI(n,xrs(r.route))}if(e.pcb_via_ids)for(let r of e.pcb_via_ids){let i=t.viasById.get(r);if(i)n=nI(n,EU({x:i.x,y:i.y},Math.max((i.outer_diameter??0.5)/2,0.28)))}if(e.pcb_component_id&&!o)n=nI(n,bdo(t.componentsById.get(e.pcb_component_id)));if(e.pcb_component_ids&&!o)for(let r of e.pcb_component_ids)n=nI(n,bdo(t.componentsById.get(r)));return n},Juo=({bounds:e,width:t,height:n})=>{let o={x:(e.minX+e.maxX)/2,y:(e.minY+e.maxY)/2},r=Math.max(e.maxX-e.minX,0.8)+1.4,i=Math.max(e.maxY-e.minY,0.8)+1.4,s=Math.min(t/r,n/i,240)*0.92;return ud(Ra(t/2,n/2),bf(s,-s,0,0),Ra(-o.x,-o.y))},Ers=(e)=>{let t=new Set;if(e.pcb_trace_id)t.add(e.pcb_trace_id);for(let n of e.pcb_port_ids??[])t.add(n);for(let n of e.pcb_via_ids??[])t.add(n);if(e.pcb_component_id)t.add(e.pcb_component_id);for(let n of e.pcb_component_ids??[])t.add(n);return[...t]},Sne=(e,t)=>{let n=["pcb_trace_error_id","pcb_via_clearance_error_id","pcb_component_outside_board_error_id","source_failed_to_create_component_error_id","pcb_error_id"];for(let o of n)if(typeof e?.[o]==="string"&&e[o].length>0)return e[o];for(let[o,r]of Object.entries(e??{}))if(o.endsWith("_error_id")&&typeof r==="string"&&r.length>0)return r;return`error_${t}_${e?.error_type}_${e?.message?.slice(0,20)}`},Zuo=(e,t)=>{if(!t)return null;return e.find((n,o)=>{if(!n.type?.includes("error"))return!1;return Sne(n,o)===t})??null},Mrs=(e)=>1-(1-e)**3,wrs=(e,t,n)=>({a:e.a+(t.a-e.a)*n,b:e.b+(t.b-e.b)*n,c:e.c+(t.c-e.c)*n,d:e.d+(t.d-e.d)*n,e:e.e+(t.e-e.e)*n,f:e.f+(t.f-e.f)*n}),vdo=(e)=>{if(e!==null)window.cancelAnimationFrame(e)},Brs=({startTransform:e,endTransform:t,durationMs:n,onUpdate:o,setAnimationFrameId:r,onComplete:i})=>{let s=performance.now(),a=(l)=>{let h=l-s,d=Math.min(1,h/n),u=Mrs(d);if(o(wrs(e,t,u)),d<1){r(window.requestAnimationFrame(a));return}r(null),i?.()},c=window.requestAnimationFrame(a);return r(c),c},gTe=(e)=>e?.trim()||null;function Ggt({primitiveElement:e,elements:t}){let n=e.source_trace_id;if(!n)return null;let o=eD(t),r=o.source_trace.get(n),i=gTe(r?.name);if(i)return i;let s=o.source_net.get(n),a=gTe(s?.name);if(a)return a;for(let c of r?.connected_source_net_ids??[]){let l=gTe(o.source_net.get(c)?.name);if(l)return l}return null}function e0o({primitiveElement:e,elements:t}){let n=eD(t).source_trace.get(e?.source_trace_id),o=e.trace_length,r=typeof o==="number",i=n?.max_length,s=r?`${o.toFixed(3)}${typeof i==="number"?` / ${i}`:""} mm`:"",a=Ggt({primitiveElement:e,elements:t})??gTe(n?.display_name);if(!s&&!a)return null;let c=Boolean(r&&typeof i==="number"&&o>i);return{text:s,name:a,isOverLength:c}}function Ine(e,t){if(!e)return;let n=[];for(let o of[`${e.type}_id`,"pcb_port_id","pcb_trace_id","source_trace_id","source_net_id"]){let r=e[o];if(typeof r==="string")n.push(r)}for(let o of n){let r=t.getNetConnectedToId(o);if(r)return r}if("source_net_id"in e)return e.source_net_id}function Sdo(e){return e&&["pcb_trace","pcb_smtpad","pcb_plated_hole","pcb_via","pcb_copper_pour"].includes(e.type)}function Trs(e,t,n){let o=e.type==="pcb_trace"?Ggt({primitiveElement:e,elements:t}):null;if(o)return o;let r=Ine(e,n),i=r?t.filter((s)=>Ine(s,n)===r):[];for(let s of["source_net","source_trace"])for(let a of i)if(a.type===s&&"name"in a&&typeof a.name==="string"&&a.name.trim())return a.name.trim();if(e.type==="pcb_trace"){let s=e0o({primitiveElement:e,elements:t})?.name;if(s)return s}for(let s of i)if(s.type==="source_trace"&&s.display_name?.trim())return s.display_name.trim();return"Net"}function Drs(e,t,n){return t.flatMap((o)=>{if(o.type!=="source_bus")return[];let r=[...new Set(o.source_trace_ids.flatMap((i)=>{let s=n.getNetConnectedToId(i);return s?[s]:[]}))];if(!r.includes(e))return[];return[{id:o.source_bus_id,name:o.name?.trim()||"Bus",netIds:r}]})}function Nrs(e,t,n){let o=document.createElement("canvas");o.width=o.height=1;let r=o.getContext("2d");return e.filter((i)=>{if(i.type!=="pcb_copper_pour"||i.layer!==n)return!1;return Qut({ctx:r,pour:i,realToCanvasMat:xf(),colorMap:$u}),r.isPointInPath(t.x,t.y,i.shape==="brep"?"evenodd":"nonzero")})}function Rrs(e){return e.type==="pcb_copper_pour"}function Pdo({canvas:e,elements:t,layers:n,realToCanvasMat:o,opacity:r=1}){let i=t.filter(Rrs);if(i.length===0||r<=0)return;let s=new ui(e);s.configure({colorOverrides:{copper:Object.fromEntries(Object.entries($u.copper).map(([a,c])=>[a,t0o.default(c).alpha(r).rgb().string()]))}}),s.realToCanvasMat=o,s.drawElements(i,{layers:n})}var Qrs=async()=>{let{default:e}=await Promise.resolve().then(()=>(Kts(),qdo));return new e};function krs(e){let{elements:t,primitives:n,transform:o,width:r=500,height:i=500}=e,s=gm.useRef(null),a=gm.useRef(void 0),c=gm.useRef(e.onRenderComplete),l=gm.useRef({elements:t,sceneGeneration:0}),h=gm.useRef(0),d=gm.useRef(0),u=gm.useRef(!1),[_,p]=gm.useState(null),[m,A]=gm.useState(),g=Qa((L)=>L.selected_layer),f=Qa((L)=>L.hidden_layer_opacity),y=Qa((L)=>L.copper_pour_opacity),x=Qa((L)=>L.is_showing_copper_pours),C=Qa((L)=>L.is_showing_solder_mask),b=Qa((L)=>L.is_showing_silkscreen),I=Qa((L)=>L.is_showing_fabrication_notes),v=Qa((L)=>L.is_showing_pcb_notes),P=Qa((L)=>L.is_showing_courtyards),M=gm.useMemo(()=>[...new Set(n.flatMap((L)=>{if(!L.is_mouse_over&&!L.is_in_highlighted_net)return[];let H=L._element,V=H?.[`${H.type}_id`];return V?[V]:[]}))],[n]),B=gm.useMemo(()=>(e.xRayElements??[]).map((L)=>L[`${L.type}_id`]),[e.xRayElements]),T=gm.useMemo(()=>({selectedLayer:g,hiddenLayerOpacity:f,copperPourOpacity:y,showCopperPours:x,showSolderMask:C,showSilkscreen:b,showFabricationNotes:I,showPcbNotes:v,showCourtyards:P,highlightedElementIds:M,xRayElementIds:B}),[g,f,y,x,C,b,I,v,P,M,B]),N=gm.useRef(void 0);if(o){let L=typeof window>"u"?1:window.devicePixelRatio||1;N.current={type:"view",width:Math.max(1,Math.round(r*L)),height:Math.max(1,Math.round(i*L)),transform:{a:o.a*L,b:o.b*L,c:o.c*L,d:o.d*L,e:o.e*L,f:o.f*L},options:T}}gm.useLayoutEffect(()=>{c.current=e.onRenderComplete},[e.onRenderComplete]),gm.useLayoutEffect(()=>{let L=l.current.sceneGeneration+1;if(l.current={elements:t,sceneGeneration:L},!u.current||!a.current)return;h.current=L,a.current.postMessage({type:"scene",elements:t,sceneGeneration:L})},[t]),gm.useEffect(()=>{let L=!1,H=!1,V,O=document.createElement("canvas");O.className="pcb-webgpu-canvas",O.style.cssText="position:absolute;inset:0;width:100%;height:100%;pointer-events:none",s.current?.append(O);let U=(Y)=>{if(L||H)return;if(H=!0,clearTimeout(j),O.remove(),u.current=!1,V?.terminate(),V=void 0,a.current=void 0,s.current)s.current.dataset.xRayNetActive="false";A(Y)},j=setTimeout(()=>U("WebGPU worker startup timed out"),15000);return(async()=>{try{if(!navigator.gpu||typeof Worker>"u"||!O.transferControlToOffscreen)throw Error("WebGPU workers are unavailable");if(V=await Qrs(),L||H){V.terminate();return}a.current=V,V.onmessage=(X)=>{if(L||H)return;let K=X.data;if(K.type==="rendered"){if(K.sceneGeneration!==h.current)return;if(s.current)s.current.dataset.xRayNetActive=String(K.xRayActive);if(K.sceneGeneration===d.current)return;d.current=K.sceneGeneration,c.current?.()}else if(K.type==="error")U(K.message);else if(K.type==="ready"){clearTimeout(j),p(K.supportsXRayNet),u.current=!0;let J=l.current;if(h.current=J.sceneGeneration,V.postMessage({type:"scene",elements:J.elements,sceneGeneration:J.sceneGeneration}),N.current)V.postMessage(N.current)}},V.onerror=(X)=>{X.preventDefault(),U(X.message||"WebGPU worker failed")},V.addEventListener("messageerror",()=>{U("WebGPU worker communication failed")});let Y=O.transferControlToOffscreen();V.postMessage({type:"init",canvas:Y},[Y])}catch(Y){U(String(Y))}})(),()=>{L=!0,clearTimeout(j),u.current=!1,a.current=void 0,V?.terminate(),O.remove()}},[]),gm.useEffect(()=>{if(u.current&&N.current)a.current?.postMessage(N.current)},[o,r,i,T]);let D=Boolean(e.xRayElements&&_===!1);return n8.jsx("div",{ref:s,"data-pcb-renderer":"webgpu","data-webgpu-error":m,style:{width:r,height:i,background:"black",position:"relative",overflow:"hidden"},children:m?n8.jsxs("div",{role:"alert",style:{padding:16,color:"white",position:"relative"},children:[n8.jsx("strong",{children:"WebGPU rendering failed"}),n8.jsx("div",{children:m})]}):n8.jsxs(n8.Fragment,{children:[n8.jsx(Hme.SuperGrid,{textColor:"rgba(0,255,0,0.8)",majorColor:"rgba(0,255,0,0.4)",minorColor:"rgba(0,255,0,0.2)",screenSpaceCellSize:200,width:r,height:i,transform:o,stringifyCoord:(L,H,V)=>`${Hme.toMMSI(L,V)}, ${Hme.toMMSI(H,V)}`}),D&&n8.jsx("div",{role:"status",style:{padding:16,color:"white",position:"relative"},children:"X-Ray is unavailable in this WebGPU renderer."})]})})}var Ir={"3d_viewer":{background_bottom:"rgb(102, 102, 128)",background_top:"rgb(204, 204, 230)",board:"rgb(51, 43, 23)",copper:"rgb(179, 156, 0)",silkscreen_bottom:"rgb(230, 230, 230)",silkscreen_top:"rgb(230, 230, 230)",soldermask:"rgb(20, 51, 36)",solderpaste:"rgb(128, 128, 128)"},board:{anchor:"rgb(255, 38, 226)",aux_items:"rgb(255, 255, 255)",b_adhes:"rgb(0, 0, 132)",b_crtyd:"rgb(38, 233, 255)",b_fab:"rgb(88, 93, 132)",b_mask:"rgba(2, 255, 238, 0.400)",b_paste:"rgb(0, 194, 194)",b_silks:"rgb(242, 237, 161)",background:"rgb(0, 16, 35)",cmts_user:"rgb(89, 148, 220)",copper:{b:"rgb(77, 127, 196)",f:"rgb(200, 52, 52)",in1:"rgb(127, 200, 127)",in10:"rgb(237, 124, 51)",in11:"rgb(91, 195, 235)",in12:"rgb(247, 111, 142)",in13:"rgb(167, 165, 198)",in14:"rgb(40, 204, 217)",in15:"rgb(232, 178, 167)",in16:"rgb(242, 237, 161)",in17:"rgb(237, 124, 51)",in18:"rgb(91, 195, 235)",in19:"rgb(247, 111, 142)",in2:"rgb(206, 125, 44)",in20:"rgb(167, 165, 198)",in21:"rgb(40, 204, 217)",in22:"rgb(232, 178, 167)",in23:"rgb(242, 237, 161)",in24:"rgb(237, 124, 51)",in25:"rgb(91, 195, 235)",in26:"rgb(247, 111, 142)",in27:"rgb(167, 165, 198)",in28:"rgb(40, 204, 217)",in29:"rgb(232, 178, 167)",in3:"rgb(79, 203, 203)",in30:"rgb(242, 237, 161)",in4:"rgb(219, 98, 139)",in5:"rgb(167, 165, 198)",in6:"rgb(40, 204, 217)",in7:"rgb(232, 178, 167)",in8:"rgb(242, 237, 161)",in9:"rgb(141, 203, 129)"},cursor:"rgb(255, 255, 255)",drc:"rgb(194, 194, 194)",drc_error:"rgba(215, 91, 107, 0.800)",drc_exclusion:"rgb(255, 255, 255)",drc_warning:"rgba(255, 208, 66, 0.902)",dwgs_user:"rgb(194, 194, 194)",eco1_user:"rgb(180, 219, 210)",eco2_user:"rgb(216, 200, 82)",edge_cuts:"rgb(208, 210, 205)",f_adhes:"rgb(132, 0, 132)",f_crtyd:"rgb(255, 0, 245)",f_fab:"rgb(175, 175, 175)",f_mask:"rgba(216, 100, 255, 0.400)",f_paste:"rgba(180, 160, 154, 0.902)",f_silks:"rgb(242, 237, 161)",footprint_text_back:"rgb(0, 0, 132)",footprint_text_front:"rgb(194, 194, 194)",footprint_text_invisible:"rgb(132, 132, 132)",grid:"rgb(132, 132, 132)",grid_axes:"rgb(194, 194, 194)",margin:"rgb(255, 38, 226)",microvia:"rgb(0, 132, 132)",no_connect:"rgb(0, 0, 132)",pad_back:"rgb(77, 127, 196)",pad_front:"rgb(200, 52, 52)",pad_plated_hole:"rgb(194, 194, 0)",pad_through_hole:"rgb(227, 183, 46)",plated_hole:"rgb(26, 196, 210)",ratsnest:"rgba(245, 255, 213, 0.702)",select_overlay:"rgb(4, 255, 67)",soldermaskWithCopper:{top:"rgb(18, 82, 50)",bottom:"rgb(77, 127, 196)"},soldermask:{top:"rgb(12, 55, 33)",bottom:"rgb(12, 55, 33)"},through_via:"rgb(236, 236, 236)",user_1:"rgb(194, 194, 194)",user_2:"rgb(89, 148, 220)",user_3:"rgb(180, 219, 210)",user_4:"rgb(216, 200, 82)",user_5:"rgb(194, 194, 194)",user_6:"rgb(89, 148, 220)",user_7:"rgb(180, 219, 210)",user_8:"rgb(216, 200, 82)",user_9:"rgb(232, 178, 167)",via_blind_buried:"rgb(187, 151, 38)",via_hole:"rgb(227, 183, 46)",via_micro:"rgb(0, 132, 132)",via_through:"rgb(236, 236, 236)",worksheet:"rgb(200, 114, 171)"},gerbview:{axes:"rgb(0, 0, 132)",background:"rgb(0, 0, 0)",dcodes:"rgb(255, 255, 255)",grid:"rgb(132, 132, 132)",layers:["rgb(132, 0, 0)","rgb(194, 194, 0)","rgb(194, 0, 194)","rgb(194, 0, 0)","rgb(0, 132, 132)","rgb(0, 132, 0)","rgb(0, 0, 132)","rgb(132, 132, 132)","rgb(132, 0, 132)","rgb(194, 194, 194)","rgb(132, 0, 132)","rgb(132, 0, 0)","rgb(132, 132, 0)","rgb(194, 194, 194)","rgb(0, 0, 132)","rgb(0, 132, 0)","rgb(132, 0, 0)","rgb(194, 194, 0)","rgb(194, 0, 194)","rgb(194, 0, 0)","rgb(0, 132, 132)","rgb(0, 132, 0)","rgb(0, 0, 132)","rgb(132, 132, 132)","rgb(132, 0, 132)","rgb(194, 194, 194)","rgb(132, 0, 132)","rgb(132, 0, 0)","rgb(132, 132, 0)","rgb(194, 194, 194)","rgb(0, 0, 132)","rgb(0, 132, 0)","rgb(132, 0, 0)","rgb(194, 194, 0)","rgb(194, 0, 194)","rgb(194, 0, 0)","rgb(0, 132, 132)","rgb(0, 132, 0)","rgb(0, 0, 132)","rgb(132, 132, 132)","rgb(132, 0, 132)","rgb(194, 194, 194)","rgb(132, 0, 132)","rgb(132, 0, 0)","rgb(132, 132, 0)","rgb(194, 194, 194)","rgb(0, 0, 132)","rgb(0, 132, 0)","rgb(132, 0, 0)","rgb(194, 194, 0)","rgb(194, 0, 194)","rgb(194, 0, 0)","rgb(0, 132, 132)","rgb(0, 132, 0)","rgb(0, 0, 132)","rgb(132, 132, 132)","rgb(132, 0, 132)","rgb(194, 194, 194)","rgb(132, 0, 132)","rgb(132, 0, 0)"],negative_objects:"rgb(132, 132, 132)",worksheet:"rgb(0, 0, 132)"},palette:["rgb(132, 0, 0)","rgb(194, 194, 0)","rgb(194, 0, 194)","rgb(194, 0, 0)","rgb(0, 132, 132)","rgb(0, 132, 0)","rgb(0, 0, 132)","rgb(132, 132, 132)","rgb(132, 0, 132)","rgb(194, 194, 194)","rgb(132, 0, 132)","rgb(132, 0, 0)","rgb(132, 132, 0)","rgb(194, 194, 194)","rgb(0, 0, 132)","rgb(0, 132, 0)"],schematic:{anchor:"rgb(0, 0, 255)",aux_items:"rgb(0, 0, 0)",background:"rgb(33, 33, 33)",brightened:"rgb(204, 204, 204)",bus:"rgb(0, 96, 192)",bus_junction:"rgb(0, 96, 192)",component_body:"rgb(44, 44, 44)",component_outline:"rgb(192, 0, 0)",cursor:"rgb(224, 224, 224)",erc_error:"rgba(192, 48, 48, 0.800)",erc_warning:"rgba(192, 140, 0, 0.800)",fields:"rgb(128, 0, 160)",grid:"rgb(60, 60, 60)",grid_axes:"rgb(60, 60, 60)",hidden:"rgb(194, 194, 194)",junction:"rgb(0, 160, 0)",label_global:"rgb(0, 160, 224)",label_hier:"rgb(160, 160, 0)",label_local:"rgb(192, 192, 192)",net_name:"rgb(224, 224, 224)",no_connect:"rgb(97, 43, 224)",note:"rgb(192, 192, 0)",override_item_colors:!1,pin:"rgb(192, 0, 0)",pin_name:"rgb(192, 192, 192)",pin_number:"rgb(192, 0, 0)",reference:"rgb(192, 192, 192)",shadow:"rgba(102, 179, 255, 0.800)",sheet:"rgb(128, 0, 160)",sheet_background:"rgba(255, 255, 255, 0.000)",sheet_fields:"rgb(160, 160, 0)",sheet_filename:"rgb(160, 160, 0)",sheet_label:"rgb(160, 160, 0)",sheet_name:"rgb(0, 160, 204)",value:"rgb(192, 192, 192)",wire:"rgb(0, 160, 0)",worksheet:"rgb(192, 0, 0)"}},_4=(e,t=1)=>{if(Math.abs(e.a)!==Math.abs(e.d))throw Error("Cannot scale non-uniformly");return t*Math.abs(e.a)},md={elementOverlay:40,dimensionOverlay:40,errorOverlay:40,pcbGroupOverlay:35,ratsNestOverlay:30,toolbarOverlay:70,warnings:30,topLayer:30,clickToInteractOverlay:100},$me={red:"red",black:"black",green:"green",board:"rgb(255, 255, 255)",other:"#eee",top:Ir.board.copper.f,inner1:Ir.board.copper.in1,inner2:Ir.board.copper.in2,inner3:Ir.board.copper.in3,inner4:Ir.board.copper.in4,inner5:Ir.board.copper.in5,inner6:Ir.board.copper.in6,inner7:Ir.board.copper.in7,inner8:Ir.board.copper.in8,bottom:Ir.board.copper.b,drill:Ir.board.anchor,keepout:Ir.board.background,tkeepout:Ir.board.b_crtyd,tplace:Ir.board.b_silks,top_courtyard:Ir.board.f_crtyd,bottom_courtyard:Ir.board.b_crtyd,top_silkscreen:Ir.board.f_silks,bottom_silkscreen:Ir.board.b_silks,top_fabrication:Ir.board.f_fab,bottom_fabrication:Ir.board.b_fab,soldermask_top:Ir.board.soldermask.top,soldermask_bottom:Ir.board.soldermask.bottom,soldermask_with_copper_top:Ir.board.soldermaskWithCopper.top,soldermask_with_copper_bottom:Ir.board.soldermaskWithCopper.bottom,bottom_notes:Ir.board.user_2,top_notes:Ir.board.user_2,...Ir.board},Lrs=["board","bottom","soldermask_bottom","bottom_silkscreen","top","soldermask_top","bottom_courtyard","bottom_fabrication","top_courtyard","top_fabrication","edge_cuts","top_silkscreen"],Hrs=class{canvasLayerMap;ctxLayerMap;aperture;transform;foregroundLayer="top";hiddenLayerOpacity=0.2;xRayNetActive=!1;lastPoint;constructor(e){this.canvasLayerMap=e,this.ctxLayerMap=Object.fromEntries(Object.entries(e).map(([t,n])=>[t,n.getContext("2d")])),this.transform=xf(),this.transform.d*=-1,this.transform=ud(this.transform,Ra(0,-500)),this.lastPoint={x:0,y:0},this.equip({})}clear(){for(let e of Object.values(this.ctxLayerMap))e.clearRect(0,0,e.canvas.width,e.canvas.height)}equip(e){this.aperture={fontSize:0,shape:"circle",mode:"add",size:0,color:"red",layer:"top",opacity:this.foregroundLayer===e.color?1:0.5,...e}}drawMeshPattern(e,t,n,o,r,i=45){let s=this.getLayerCtx(),[a,c]=fo(this.transform,[e,t]),[l,h]=fo(this.transform,[e+n,t+o]),d=_4(this.transform,r);s.lineWidth=1,s.strokeStyle=this.aperture.color;let u=(_)=>{let p=Math.sin(_),m=Math.cos(_),A=Math.sqrt((l-a)**2+(h-c)**2);for(let g=-A;g<=A;g+=d)s.beginPath(),s.moveTo(a+g*m-A*p,c+g*p+A*m),s.lineTo(a+g*m+A*p,c+g*p-A*m),s.stroke()};u(i*Math.PI/180),u((i+90)*Math.PI/180)}rect({x:e,y:t,w:n,h:o,mesh_fill:r,is_filled:i=!0,has_stroke:s,is_stroke_dashed:a,stroke_width:c,roundness:l}){let[h,d]=fo(this.transform,[e-n/2,t-o/2]),[u,_]=fo(this.transform,[e+n/2,t+o/2]);this.applyAperture();let p=this.getLayerCtx(),m=l?_4(this.transform,l):0,A=s===void 0?i===!1:s;if(r){if(p.save(),p.beginPath(),m>0&&p.roundRect)p.roundRect(h,d,u-h,_-d,m);else p.rect(h,d,u-h,_-d);if(p.clip(),this.drawMeshPattern(e-n/2,t-o/2,n,o,0.15),p.restore(),m>0&&p.roundRect)p.beginPath(),p.roundRect(h,d,u-h,_-d,m),p.stroke();else p.strokeRect(h,d,u-h,_-d)}else{if(i!==!1)if(m>0&&p.roundRect)p.beginPath(),p.roundRect(h,d,u-h,_-d,m),p.fill();else p.fillRect(h,d,u-h,_-d);if(A){let g=p.lineWidth;if(c!==void 0)p.lineWidth=_4(this.transform,c);if(a){let f=[],y=Math.abs(this.transform.a);if(y>0){let C=0.1*y,b=C*1.3;if(C>0.5)f=[C,b]}p.setLineDash(f)}if(m>0&&p.roundRect)p.beginPath(),p.roundRect(h,d,u-h,_-d,m),p.stroke();else p.strokeRect(h,d,u-h,_-d);if(a)p.setLineDash([]);if(c!==void 0)p.lineWidth=g}}}rotatedRect(e,t,n,o,r,i,s){let a=this.getLayerCtx();this.applyAperture();let[c,l]=fo(this.transform,[e-n/2,t-o/2]),[h,d]=fo(this.transform,[e+n/2,t+o/2]),u=i?_4(this.transform,i):0;a.save();let[_,p]=fo(this.transform,[e,t]);a.translate(_,p);let m=360-r;if(r)a.rotate(m*Math.PI/180);if(a.translate(-_,-p),s){if(a.beginPath(),u>0&&a.roundRect)a.roundRect(c,l,h-c,d-l,u);else a.rect(c,l,h-c,d-l);if(a.clip(),this.drawMeshPattern(e-n/2,t-o/2,n,o,0.15),u>0&&a.roundRect)a.beginPath(),a.roundRect(c,l,h-c,d-l,u),a.stroke();else a.strokeRect(c,l,h-c,d-l)}else if(u>0&&a.roundRect)a.beginPath(),a.roundRect(c,l,h-c,d-l,u),a.fill();else a.fillRect(c,l,h-c,d-l);a.restore()}rotatedPill(e,t,n,o,r){let i=this.getLayerCtx();this.applyAperture(),i.save();let[s,a]=fo(this.transform,[e,t]);i.translate(s,a);let c=360-r;if(r)i.rotate(c*Math.PI/180);i.translate(-s,-a),this.pill(e,t,n,o),i.restore()}circle(e,t,n,o,r=!0){let i=_4(this.transform,n),[s,a]=fo(this.transform,[e,t]);this.applyAperture();let c=this.getLayerCtx();if(o)c.save(),c.beginPath(),c.arc(s,a,i,0,2*Math.PI),c.clip(),this.drawMeshPattern(e-n,t-n,n*2,n*2,0.15),c.restore(),c.beginPath(),c.arc(s,a,i,0,2*Math.PI),c.stroke();else c.beginPath(),c.arc(s,a,i,0,2*Math.PI),c.fill()}oval(e,t,n,o){let r=_4(this.transform,n),i=_4(this.transform,o),[s,a]=fo(this.transform,[e,t]);this.applyAperture();let c=this.getLayerCtx();c.beginPath(),c.ellipse(s,a,r,i,0,0,2*Math.PI),c.fill(),c.closePath()}pill(e,t,n,o){let[r,i]=fo(this.transform,[e-n/2,t+o/2]),s=_4(this.transform,n),a=_4(this.transform,o),c=Math.min(s,a)/2;this.applyAperture();let l=this.getLayerCtx();l.beginPath(),l.arc(r+c,i+c,c,Math.PI,Math.PI*1.5),l.arc(r+s-c,i+c,c,Math.PI*1.5,0),l.arc(r+s-c,i+a-c,c,0,Math.PI*0.5),l.arc(r+c,i+a-c,c,Math.PI*0.5,Math.PI),l.fill(),l.closePath()}polygon(e){if(e.length<3)return;this.applyAperture();let t=this.getLayerCtx(),n=e.map((r)=>fo(this.transform,[r.x,r.y]));t.beginPath(),t.moveTo(n[0][0],n[0][1]);for(let r=1;r<n.length;r++)t.lineTo(n[r][0],n[r][1]);t.closePath(),t.fill("evenodd");let o=_4(this.transform,this.aperture.size);if(o>0)t.lineWidth=o,t.stroke()}debugText(e,t,n){let[o,r]=fo(this.transform,[t,n]);this.applyAperture();let i=this.getLayerCtx();i.font="10px sans-serif",i.fillText(e,o,r)}getLayerCtx(){let e=this.ctxLayerMap[this.aperture.layer];if(!e)throw Error(`No context for layer "${this.aperture.layer}"`);return e}getLayerOpacity(e){if(this.xRayNetActive)return/^(top|bottom|inner\d+)$/.test(e)?this.hiddenLayerOpacity:0;let t=this.foregroundLayer,n=(t==="top"||t==="bottom")&&(e.startsWith(`${t}_`)||e.endsWith(`_${t}`)),o=["board","drill","edge_cuts","other"].includes(e);return e===t||n||o?1:this.hiddenLayerOpacity}orderAndFadeLayers(){let{canvasLayerMap:e,foregroundLayer:t}=this,o=["board",...Object.keys(e).filter((d)=>/^inner\d+$/.test(d)).sort((d,u)=>Number(u.slice(5))-Number(d.slice(5))),...Lrs.filter((d)=>d!=="board")],r=t==="top"?"soldermask_top":t==="bottom"?"soldermask_bottom":void 0,i=t==="top"?"top_silkscreen":t==="bottom"?"bottom_silkscreen":void 0,s=t==="top"?"top_notes":t==="bottom"?"bottom_notes":void 0,a=t==="top"?"top_fabrication":t==="bottom"?"bottom_fabrication":void 0,c=t==="top"?"top_courtyard":t==="bottom"?"bottom_courtyard":void 0,l=[t,"edge_cuts",...r?[r]:[],...i?[i]:[],...s?[s]:[],...a?[a]:[],...c?[c]:[]],h=[...o.filter((d)=>!l.includes(d)),...t==="drill"?[]:[t],...r?[r]:[],"edge_cuts",...i?[i]:[],...s?[s]:[],...a?[a]:[],...c?[c]:[],"drill"];h.forEach((d,u)=>{let _=e[d];if(!_)return;_.style.zIndex=`${md.topLayer-(h.length-u)}`});for(let[d,u]of Object.entries(e)){let _=this.getLayerOpacity(d);u.style.opacity=String(_),u.style.display=_===0?"none":""}}applyAperture(){let{transform:e,aperture:t}=this,{size:n,mode:o,color:r,fontSize:i,layer:s}=t;if(!(s in this.ctxLayerMap))this.aperture.layer="other";let a=this.getLayerCtx();if(!a)throw Error(`No context for layer "${this.foregroundLayer}"`);if(!r)r="undefined";if(a.lineWidth=_4(e,n),a.lineCap="round",o==="add"){a.globalCompositeOperation="source-over";let c=$me[r.toLowerCase()];if(!c)try{c=n0o.default(r).rgb().toString()}catch(l){console.warn(`Invalid color format: '${r}'`),c="white"}a.fillStyle=c,a.strokeStyle=c}else a.globalCompositeOperation="destination-out",a.fillStyle="rgba(0,0,0,1)",a.strokeStyle="rgba(0,0,0,1)";a.font=`${_4(Cf(e),i)}px sans-serif`}moveTo(e,t){this.lastPoint={x:e,y:t}}lineTo(e,t){let[n,o]=fo(this.transform,[e,t]),{size:r,shape:i,mode:s}=this.aperture,a=_4(this.transform,r),{lastPoint:c}=this,l=fo(this.transform,c);this.applyAperture();let h=this.getLayerCtx();if(i==="square")h.fillRect(l.x-a/2,l.y-a/2,a,a);if(h.beginPath(),h.moveTo(l.x,l.y),h.lineTo(n,o),h.stroke(),h.closePath(),i==="square")h.fillRect(n-a/2,o-a/2,a,a);this.lastPoint={x:e,y:t}}polygonWithArcs(e){let t=this.getLayerCtx(),n=(o)=>{if(o.vertices.length===0)return;let r=o.vertices[0],i=fo(this.transform,[r.x,r.y]);t.moveTo(i[0],i[1]);for(let s=0;s<o.vertices.length;s++){let a=o.vertices[s],c=o.vertices[(s+1)%o.vertices.length];if(a.bulge&&a.bulge!==0){let l=a.bulge,h=c.x-a.x,d=c.y-a.y,u=Math.sqrt(h*h+d*d);if(u<0.000000001){let T=fo(this.transform,[c.x,c.y]);t.lineTo(T[0],T[1]);continue}let _=4*Math.atan(l),p=Math.abs(u/(2*Math.sin(_/2))),m=(a.x+c.x)/2,A=(a.y+c.y)/2,g=h/u,y=-(d/u),x=g,C=Math.sqrt(Math.max(0,p*p-(u/2)**2)),b=m+C*y*Math.sign(l),I=A+C*x*Math.sign(l),v=Math.atan2(a.y-I,a.x-b),P=Math.atan2(c.y-I,c.x-b);if(l>0&&P<v)P+=2*Math.PI;else if(l<0&&P>v)P-=2*Math.PI;let M=fo(this.transform,[b,I]),B=_4(this.transform,p);t.arc(M[0],M[1],B,-v,-P,l>0)}else{let l=fo(this.transform,[c.x,c.y]);t.lineTo(l[0],l[1])}}t.closePath()};if(t.beginPath(),n(e.outer_ring),e.inner_rings)for(let o of e.inner_rings)n(o);t.fill("evenodd")}},Frs=(e=2)=>{let t=Math.max(2,Math.min(10,Math.floor(e)));return["top",...Array.from({length:t-2},(n,o)=>`inner${o+1}`),"bottom"]},wTe=(e)=>{let t=e.find((n)=>n.type==="pcb_board");return Frs(t?.num_layers??2)},Egt=(e)=>`${e}_copper`,o0o=(e)=>e.map((t)=>t.endsWith("_copper")?t.slice(0,-7):t),zrs=(e)=>["board","bottom","soldermask_bottom","bottom_silkscreen","top","soldermask_top","soldermask_with_copper_bottom","soldermask_with_copper_top","top_fabrication","bottom_fabrication",...wTe(e).filter((n)=>n.startsWith("inner")),"drill","edge_cuts","bottom_notes","top_notes","top_silkscreen","top_courtyard","bottom_courtyard","other"],Ors=(e,t)=>{let n=wTe(e).reverse();return[...n.filter((o)=>o!==t),...n.filter((o)=>o===t)]},Vrs={...$u,courtyard:{top:Ir.board.f_crtyd,bottom:Ir.board.b_crtyd}};function Yrs(e){return e.type==="pcb_courtyard_circle"||e.type==="pcb_courtyard_rect"||e.type==="pcb_courtyard_outline"}function Edo({canvas:e,elements:t,layers:n,realToCanvasMat:o}){let r=new ui(e);r.configure({colorOverrides:Vrs}),r.realToCanvasMat=o;let i=t.filter(Yrs);r.drawElements(i,{layers:n})}var Grs={...$u,silkscreen:{top:Ir.board.f_fab,bottom:Ir.board.b_fab}};function Urs(e){return e.type.includes("pcb_fabrication_note")}function Mdo({canvas:e,elements:t,layers:n,realToCanvasMat:o}){let r=new ui(e);r.configure({colorOverrides:Grs}),r.realToCanvasMat=o;let i=t.filter(Urs);r.drawElements(i,{layers:n})}function Wrs(e){return e.type==="pcb_hole"}function Xrs({canvas:e,elements:t,layers:n,realToCanvasMat:o,drawSoldermask:r}){let i=new ui(e);i.realToCanvasMat=o;let s=t.filter(Wrs);i.drawElements(s,{layers:n,drawSoldermask:r})}function jrs(e){return e.type==="pcb_board"}function r0o({canvas:e,elements:t,layers:n,realToCanvasMat:o,drawSoldermask:r}){let i=new ui(e);i.realToCanvasMat=o;let s=t.filter(jrs);for(let a of s)i.drawElements([a],{layers:n,drawSoldermask:!1,drawBoardMaterial:r??!1,minBoardOutlineStrokePx:2})}function Krs(e){return e.type==="pcb_copper_text"}function $rs({canvas:e,elements:t,layers:n,realToCanvasMat:o}){let r=t.filter(Krs);if(r.length===0)return;let i=new ui(e);i.realToCanvasMat=o,i.drawElements(r,{layers:n})}function qrs(e){return e.type==="pcb_cutout"}function Jrs({canvas:e,elements:t,layers:n,realToCanvasMat:o}){let r=new ui(e);r.realToCanvasMat=o;let i=t.filter(qrs);r.drawElements(i,{layers:n})}function Zrs(e){return e.type==="pcb_keepout"}function eis({elements:e,layer:t}){return e.filter(Zrs).filter((n)=>n.layers.includes(t))}function tis(e){return i0o.default($me[e]).lighten(0.4).hex()}function nis({canvas:e,elements:t,layer:n,realToCanvasMat:o}){let r=eis({elements:t,layer:n});if(r.length===0)return;let i=new ui(e),s=tis(n);i.configure({colorOverrides:{keepout:{top:s,bottom:s}}}),i.realToCanvasMat=o,i.drawElements(r,{layers:[Egt(n)]})}function ois(e){return e.type.startsWith("pcb_note_")}function wdo({canvas:e,elements:t,layers:n,realToCanvasMat:o}){let r=new ui(e);r.realToCanvasMat=o;let i=t.filter(ois);r.drawElements(i,{layers:n})}function ris(e){return e.type==="pcb_panel"}function iis({canvas:e,elements:t,layers:n,realToCanvasMat:o,drawSoldermask:r}){let i=new ui(e);i.realToCanvasMat=o;let s=t.filter(ris);for(let a of s)i.drawElements([a],{layers:n})}var sis={...$u,copper:{...$u.copper,top:Jv.default(Ir.board.pad_front).lighten(0.5).toString(),bottom:Jv.default(Ir.board.pad_back).lighten(0.5).toString(),inner1:Jv.default(Ir.board.copper.in1).lighten(0.5).toString(),inner2:Jv.default(Ir.board.copper.in2).lighten(0.5).toString(),inner3:Jv.default(Ir.board.copper.in3).lighten(0.5).toString(),inner4:Jv.default(Ir.board.copper.in4).lighten(0.5).toString(),inner5:Jv.default(Ir.board.copper.in5).lighten(0.5).toString(),inner6:Jv.default(Ir.board.copper.in6).lighten(0.5).toString(),inner7:Jv.default(Ir.board.copper.in7).lighten(0.5).toString(),inner8:Jv.default(Ir.board.copper.in8).lighten(0.5).toString()}};function ais(e){return e.type==="pcb_smtpad"}function Bdo({canvas:e,elements:t,layers:n,realToCanvasMat:o,primitives:r,drawSoldermask:i}){let s=new Set(o0o(n)),a=t.filter(ais).filter((d)=>s.has(d.layer));if(a.length===0)return;let c=new Set;if(r){for(let d of r)if((d.is_mouse_over||d.is_in_highlighted_net)&&d._element?.type==="pcb_smtpad")c.add(d._element.pcb_smtpad_id)}let l=a.filter((d)=>c.has(d.pcb_smtpad_id)),h=a.filter((d)=>!c.has(d.pcb_smtpad_id));if(h.length>0){let d=new ui(e);d.realToCanvasMat=o,d.drawElements(h,{layers:n,drawSoldermask:i})}if(l.length>0){let d=new ui(e);d.configure({colorOverrides:sis}),d.realToCanvasMat=o,d.drawElements(l,{layers:n,drawSoldermask:i})}}var cis={...$u,copper:Object.fromEntries(Object.entries($u.copper).map(([e,t])=>[e,s0o.default(t).lighten(0.5).toString()]))};function lis(e){return e.type==="pcb_trace"}var his=(e,t)=>{let n=e.route.filter((i)=>{if(i.route_type==="wire"&&"layer"in i&&t.has(i.layer))return!0;if(i.route_type==="via")return t.has(i.from_layer)||t.has(i.to_layer);return!1}),o=n.filter((i)=>i.route_type==="wire").length,r=n.some((i)=>i.route_type==="via");if(o<2&&!r)return null;return{...e,route:n}},dis=(e)=>({...e,route:e.route.map((t)=>{if(!("is_inside_copper_pour"in t)||t.is_inside_copper_pour!==!0)return t;return{...t,is_inside_copper_pour:!1}})}),uis=(e,t)=>t?e:e.filter((n)=>n.type!=="pcb_copper_pour"),pis=({primitives:e})=>{let t=new Set;for(let n of e)if((n.is_mouse_over||n.is_in_highlighted_net)&&n._element?.type==="pcb_trace")t.add(n._element.pcb_trace_id);return t};function Tdo({canvas:e,elements:t,layers:n,realToCanvasMat:o,primitives:r,showCopperPours:i}){let s=new Set(o0o(n)),a=t.filter(lis).map((u)=>his(u,s)).filter((u)=>u!==null).map((u)=>i?u:dis(u));if(a.length===0)return;let c=pis({primitives:r??[]}),l=[],h=[];for(let u of a)if(c.has(u.pcb_trace_id))l.push(u);else h.push(u);let d=uis(t,i);if(h.length>0){let u=new ui(e);u.realToCanvasMat=o,u.drawElements(h,{layers:n,clipContextElements:d})}if(l.length>0){let u=new ui(e);u.configure({colorOverrides:cis}),u.realToCanvasMat=o,u.drawElements(l,{layers:n,clipContextElements:d})}}var mis={...$u,copper:{...$u.copper,top:Zv.default(Ir.board.pad_front).lighten(0.5).toString(),bottom:Zv.default(Ir.board.pad_back).lighten(0.5).toString(),inner1:Zv.default(Ir.board.copper.in1).lighten(0.5).toString(),inner2:Zv.default(Ir.board.copper.in2).lighten(0.5).toString(),inner3:Zv.default(Ir.board.copper.in3).lighten(0.5).toString(),inner4:Zv.default(Ir.board.copper.in4).lighten(0.5).toString(),inner5:Zv.default(Ir.board.copper.in5).lighten(0.5).toString(),inner6:Zv.default(Ir.board.copper.in6).lighten(0.5).toString(),inner7:Zv.default(Ir.board.copper.in7).lighten(0.5).toString(),inner8:Zv.default(Ir.board.copper.in8).lighten(0.5).toString()}};function _is(e){return e.type==="pcb_plated_hole"}function Ddo({canvas:e,elements:t,layers:n,realToCanvasMat:o,primitives:r,drawSoldermask:i}){let s=t.filter(_is);if(s.length===0)return;let a=new Set;if(r){for(let h of r)if((h.is_mouse_over||h.is_in_highlighted_net)&&h._element?.type==="pcb_plated_hole")a.add(h._element.pcb_plated_hole_id)}let c=s.filter((h)=>a.has(h.pcb_plated_hole_id)),l=s.filter((h)=>!a.has(h.pcb_plated_hole_id));if(l.length>0){let h=new ui(e);h.realToCanvasMat=o,h.drawElements(l,{layers:n,drawSoldermask:i})}if(c.length>0){let h=new ui(e);h.configure({colorOverrides:mis}),h.realToCanvasMat=o,h.drawElements(c,{layers:n,drawSoldermask:i})}}function a0o(e){let{lines:t,anchorPoint:n,ccwRotation:o}=e;if(!o)return t;let r=o*Math.PI/180,i=fme(r),s=ud(Ra(n.x,n.y),i,Ra(-n.x,-n.y));return fo(s,n),t.map((a)=>({...a,x1:fo(s,{x:a.x1,y:a.y1}).x,y1:fo(s,{x:a.x1,y:a.y1}).y,x2:fo(s,{x:a.x2,y:a.y2}).x,y2:fo(s,{x:a.x2,y:a.y2}).y}))}var gis=0.6,Ndo=0.2,c0o=(e)=>{let t=e.size*0.7,n=t*gis,o=t*Ndo,r=t*Ndo,i=e.text.split(/\r?\n/),s=e.text.length>0&&t>0,a=s?i.length:0,c=s?i.map((d)=>{if(d.length===0)return 0;return d.length*n+(d.length-1)*o}):[],l=c.length>0?Math.max(...c):0,h=a>0?a*t+(a-1)*r:0;return{text_lines:i,line_count:a,line_widths:c,target_height:t,target_width_char:n,space_between_chars:o,space_between_lines:r,width:l,height:h}},l0o=(e)=>{let t=c0o(e);return{width:t.width,height:t.height,lineHeight:t.target_height,lineSpacing:t.space_between_lines,lineCount:t.line_count}},h0o=(e)=>{let{text_lines:t,line_count:n,line_widths:o,target_height:r,target_width_char:i,space_between_chars:s,space_between_lines:a,width:c}=c0o(e);if(r<=0||n===0)return[];let l=r/12,h=[];for(let d=0;d<n;d++){let u=-d*(r+a),_=o[d],p=(c-_)/2,m=e.x+p;for(let A=0;A<t[d].length;A++){let g=t[d][A],f=d5[g]??d5[g.toUpperCase()];if(!f){m+=i+s;continue}for(let{x1:y,y1:x,x2:C,y2:b}of f)h.push({_pcb_drawing_object_id:r8("line"),pcb_drawing_type:"line",x1:m+i*y,y1:e.y+u+r*x,x2:m+i*C,y2:e.y+u+r*b,width:l,layer:e.layer,unit:e.unit,color:e.color});m+=i+s}}return h};function VE(e){let n=e.color??$me[e.layer],o=d0o.default(n);if(e._element?.type==="pcb_copper_pour")o=o.alpha(0.7);if(e.is_mouse_over||e.is_in_highlighted_net)return o.lighten(0.5).rgb().toString();return o.rgb().toString()}var u0o=(e,t)=>{e.equip({size:t.zoomIndependent?t.width/e.transform.a:t.width,shape:t.squareCap?"square":"circle",color:VE(t),layer:t.layer}),e.moveTo(t.x1,t.y1),e.lineTo(t.x2,t.y2)},Ais=(e,t,n)=>{switch(n){case"top_left":return{x:0,y:-t};case"top_center":return{x:-e/2,y:-t};case"top_right":return{x:-e,y:-t};case"center_left":return{x:0,y:-t/2};case"center":return{x:-e/2,y:-t/2};case"center_right":return{x:-e,y:-t/2};case"bottom_left":return{x:0,y:0};case"bottom_center":return{x:-e/2,y:0};case"bottom_right":return{x:-e,y:0};default:return{x:0,y:0}}},p0o=(e)=>{if(e.layer==="bottom_silkscreen"||e.layer==="bottom")return e.is_mirrored!==!1;return e.is_mirrored===!0},fis=(e,t)=>{e.equip({fontSize:t.size,color:VE(t),layer:t.layer});let{width:n,height:o}=l0o(t),r=Ais(n,o,t.align);t.x??=0,t.y??=0;let i={x:t.x,y:t.y},s=h0o({...t,x:t.x+r.x,y:t.y+r.y});if(p0o(t))s=s.map((a)=>({...a,x1:2*t.x-a.x1,x2:2*t.x-a.x2}));if(t.ccw_rotation){let a={lines:s,anchorPoint:i,ccwRotation:t.ccw_rotation};s=a0o(a)}for(let a of s)u0o(e,a)},yis=(e,t)=>{let{width:n,height:o,lineHeight:r}=l0o(t);t.x??=0,t.y??=0;let i=t.knockout_padding??{left:t.size*0.5,right:t.size*0.5,top:t.size*0.3,bottom:t.size*0.3},s=n+i.left+i.right,a=o+i.top+i.bottom,c=n/2,l=r-o/2,h=t.x-c,d=t.y-l,u={x:t.x,y:t.y},_={_pcb_drawing_object_id:`knockout_rect_${t._pcb_drawing_object_id}`,pcb_drawing_type:"rect",x:t.x,y:t.y,w:s,h:a,layer:t.layer,ccw_rotation:t.ccw_rotation};if(t.ccw_rotation)_0o(e,_);else m0o(e,_);let p=h0o({...t,x:h,y:d});if(p0o(t))p=p.map((m)=>({...m,x1:2*t.x-m.x1,x2:2*t.x-m.x2}));if(t.ccw_rotation){let m={lines:p,anchorPoint:u,ccwRotation:t.ccw_rotation};p=a0o(m)}for(let m of p)e.equip({size:m.width,shape:"circle",color:"black",layer:t.layer,mode:"subtract"}),e.moveTo(m.x1,m.y1),e.lineTo(m.x2,m.y2);e.equip({mode:"add"})},m0o=(e,t)=>{e.equip({color:VE(t),layer:t.layer,size:t.stroke_width}),e.rect({x:t.x,y:t.y,w:t.w,h:t.h,mesh_fill:t.mesh_fill,is_filled:t.is_filled,has_stroke:t.has_stroke,is_stroke_dashed:t.is_stroke_dashed,stroke_width:t.stroke_width,roundness:t.roundness})},_0o=(e,t)=>{e.equip({color:VE(t),layer:t.layer}),e.rotatedRect(t.x,t.y,t.w,t.h,t.ccw_rotation,t.roundness,t.mesh_fill)},xis=(e,t)=>{e.equip({color:VE(t),layer:t.layer}),e.rotatedPill(t.x,t.y,t.w,t.h,t.ccw_rotation)},Cis=(e,t)=>{e.equip({color:VE(t),layer:t.layer}),e.circle(t.x,t.y,t.r,t.mesh_fill)},bis=(e,t)=>{e.equip({color:VE(t),layer:t.layer}),e.oval(t.x,t.y,t.rX,t.rY)},Iis=(e,t)=>{e.equip({color:VE(t),layer:t.layer}),e.pill(t.x,t.y,t.w,t.h)},vis=(e,t)=>{e.equip({color:VE(t),layer:t.layer}),e.polygon(t.points)},Sis=(e,t)=>{e.equip({color:VE(t),layer:t.layer}),e.polygonWithArcs(t.brep_shape)},Pis=(e,t)=>{switch(t.pcb_drawing_type){case"line":return u0o(e,t);case"text":if(t.is_knockout)return yis(e,t);return fis(e,t);case"rect":{if(t.ccw_rotation)return _0o(e,t);return m0o(e,t)}case"circle":return Cis(e,t);case"oval":return bis(e,t);case"pill":if(t.ccw_rotation)return xis(e,t);return Iis(e,t);case"polygon":return vis(e,t);case"polygon_with_arcs":return Sis(e,t)}},Eis=(e,t)=>{for(let n of t)Pis(e,n)},Mis={...$u,silkscreen:{top:Ir.board.f_silks,bottom:Ir.board.b_silks}};function wis(e){return e.type.includes("pcb_silkscreen")}function Rdo({canvas:e,elements:t,layers:n,realToCanvasMat:o}){let r=new ui(e);r.configure({colorOverrides:Mis}),r.realToCanvasMat=o;let i=t.filter(wis);r.drawElements(i,{layers:n})}var Bis={...$u,copper:{...$u.copper,top:yC.default(Ir.board.pad_front).lighten(0.5).toString(),bottom:yC.default(Ir.board.pad_back).lighten(0.5).toString(),inner1:yC.default(Ir.board.copper.in1).lighten(0.5).toString(),inner2:yC.default(Ir.board.copper.in2).lighten(0.5).toString(),inner3:yC.default(Ir.board.copper.in3).lighten(0.5).toString(),inner4:yC.default(Ir.board.copper.in4).lighten(0.5).toString(),inner5:yC.default(Ir.board.copper.in5).lighten(0.5).toString(),inner6:yC.default(Ir.board.copper.in6).lighten(0.5).toString(),inner7:yC.default(Ir.board.copper.in7).lighten(0.5).toString(),inner8:yC.default(Ir.board.copper.in8).lighten(0.5).toString()},soldermask:{...$u.soldermask,top:yC.default(Ir.board.soldermask.top).lighten(0.35).toString(),bottom:yC.default(Ir.board.soldermask.bottom).lighten(0.35).toString()}};function Qdo({canvas:e,elements:t,layers:n,realToCanvasMat:o,drawSoldermaskTop:r,drawSoldermaskBottom:i,primitives:s}){let a=new ui(e);a.realToCanvasMat=o;let c=t.filter((u)=>u.type==="pcb_board");if(a.drawElements(t,{layers:n,drawSoldermask:!0,drawSoldermaskTop:r,drawSoldermaskBottom:i,drawBoardMaterial:!1}),c.length>1)r0o({canvas:e,elements:c,layers:[],realToCanvasMat:o,drawSoldermask:!1});if(!s)return;let l=new Set;for(let u of s){if(!(u.is_mouse_over||u.is_in_highlighted_net))continue;let _=u._element;if(_?.type==="pcb_smtpad")l.add(_.pcb_smtpad_id);else if(_?.type==="pcb_plated_hole")l.add(_.pcb_plated_hole_id);else if(_?.type==="pcb_via")l.add(_.pcb_via_id)}if(l.size===0)return;let h=t.filter((u)=>{if(u.type==="pcb_smtpad")return l.has(u.pcb_smtpad_id);if(u.type==="pcb_plated_hole")return l.has(u.pcb_plated_hole_id);if(u.type==="pcb_via")return l.has(u.pcb_via_id);return!1});if(h.length===0)return;let d=new ui(e);d.configure({colorOverrides:Bis}),d.realToCanvasMat=o,d.drawElements(h,{layers:n,clipContextElements:t,drawSoldermask:!0,drawSoldermaskTop:r,drawSoldermaskBottom:i,drawBoardMaterial:!1})}var Tis={...$u,copper:{...$u.copper,top:e8.default(Ir.board.pad_front).lighten(0.5).toString(),bottom:e8.default(Ir.board.pad_back).lighten(0.5).toString(),inner1:e8.default(Ir.board.copper.in1).lighten(0.5).toString(),inner2:e8.default(Ir.board.copper.in2).lighten(0.5).toString(),inner3:e8.default(Ir.board.copper.in3).lighten(0.5).toString(),inner4:e8.default(Ir.board.copper.in4).lighten(0.5).toString(),inner5:e8.default(Ir.board.copper.in5).lighten(0.5).toString(),inner6:e8.default(Ir.board.copper.in6).lighten(0.5).toString(),inner7:e8.default(Ir.board.copper.in7).lighten(0.5).toString(),inner8:e8.default(Ir.board.copper.in8).lighten(0.5).toString()}};function Dis(e){return e.type==="pcb_via"}function kdo({canvas:e,elements:t,layers:n,realToCanvasMat:o,primitives:r,drawSoldermask:i}){let s=t.filter(Dis).filter((h)=>n.some((d)=>d.includes("copper")));if(s.length===0)return;let a=new Set;if(r){for(let h of r)if((h.is_mouse_over||h.is_in_highlighted_net)&&h._element?.type==="pcb_via")a.add(h._element.pcb_via_id)}let c=s.filter((h)=>a.has(h.pcb_via_id)),l=s.filter((h)=>!a.has(h.pcb_via_id));if(l.length>0){let h=new ui(e);h.realToCanvasMat=o,h.drawElements(l,{layers:n,drawSoldermask:i,drawSoldermaskTop:n.includes("top_copper"),drawSoldermaskBottom:n.includes("bottom_copper"),clipContextElements:t})}if(c.length>0){let h=new ui(e);h.configure({colorOverrides:Tis}),h.realToCanvasMat=o,h.drawElements(c,{layers:n,drawSoldermask:i,drawSoldermaskTop:n.includes("top_copper"),drawSoldermaskBottom:n.includes("bottom_copper"),clipContextElements:t})}}var Nis=({primitives:e,isShowingSolderMask:t,isShowingSilkscreen:n,isShowingFabricationNotes:o})=>e.filter((r)=>t||!r.layer?.includes("soldermask")).filter((r)=>n||!r.layer?.includes("silkscreen")).filter((r)=>o||!r.layer?.includes("fabrication")).filter((r)=>r.layer!=="board").filter((r)=>r._element?.type!=="pcb_smtpad").filter((r)=>r._element?.type!=="pcb_plated_hole"||r.layer==="drill").filter((r)=>r._element?.type!=="pcb_via").filter((r)=>r._element?.type!=="pcb_trace").filter((r)=>r._element?.type!=="pcb_copper_text"),Ris=({primitives:e,elements:t,circuitJson:n,xRayElements:o,transform:r,grid:i,width:s=500,height:a=500,onRenderComplete:c})=>{let l=vH.useRef(null),h=vH.useRef({}),d=vH.useRef(c),u=vH.useRef(void 0),_=Qa((b)=>b.hidden_layer_opacity),p=Qa((b)=>b.selected_layer),m=Qa((b)=>b.copper_pour_opacity),A=Qa((b)=>b.is_showing_copper_pours),g=Qa((b)=>b.is_showing_solder_mask),f=Qa((b)=>b.is_showing_fabrication_notes),y=Qa((b)=>b.is_showing_pcb_notes),x=Qa((b)=>b.is_showing_courtyards),C=Qa((b)=>b.is_showing_silkscreen);return vH.useEffect(()=>{d.current=c},[c]),vH.useEffect(()=>{if(!h.current)return;if(Object.keys(h.current).length===0)return;let b=Object.fromEntries(Object.entries(h.current).filter(([B,T])=>{if(!T)return!1;return!0}));if(Object.keys(b).length===0)return;let I=new Hrs(b);if(r)I.transform=r;I.clear(),I.foregroundLayer=p,I.hiddenLayerOpacity=_,I.xRayNetActive=Boolean(o);let v=Object.fromEntries(Object.entries(b).filter(([B])=>I.getLayerOpacity(B)>0)),P=Nis({primitives:e,isShowingSolderMask:g,isShowingSilkscreen:C,isShowingFabricationNotes:f});if(Eis(I,P.filter((B)=>I.getLayerOpacity(B.layer??"other")>0)),r){let B=wTe(t).map((L)=>({canvas:v[L],layer:L,copperLayer:Egt(L)}));for(let{canvas:L,copperLayer:H}of B){if(!L)continue;Tdo({canvas:L,elements:t,layers:[H],realToCanvasMat:r,primitives:e,showCopperPours:A&&m>0})}for(let{canvas:L,copperLayer:H}of B){if(!L)continue;$rs({canvas:L,elements:t,layers:[H],realToCanvasMat:r})}for(let{canvas:L,copperLayer:H,layer:V}of B){if(!L)continue;Ddo({canvas:L,elements:t,layers:[H],realToCanvasMat:r,primitives:e,drawSoldermask:g&&(V==="top"||V==="bottom")})}for(let{canvas:L,copperLayer:H}of B){if(!L)continue;Pdo({canvas:L,elements:t,layers:[H],realToCanvasMat:r,opacity:A?m:0})}for(let{canvas:L,copperLayer:H}of B){if(!L)continue;Bdo({canvas:L,elements:t,layers:[H],realToCanvasMat:r,primitives:e,drawSoldermask:g})}for(let{canvas:L,copperLayer:H,layer:V}of B){if(!L)continue;kdo({canvas:L,elements:t,layers:[H],realToCanvasMat:r,primitives:e,drawSoldermask:g&&(V==="top"||V==="bottom")})}if(g){let L=p==="bottom"?"bottom":"top",H=L==="top",V=L==="bottom",O=v.soldermask_top;if(O&&L==="top")Qdo({canvas:O,elements:t,layers:["top_soldermask"],realToCanvasMat:r,drawSoldermaskTop:H,drawSoldermaskBottom:V,primitives:e});let U=v.soldermask_bottom;if(U&&L==="bottom")Qdo({canvas:U,elements:t,layers:["bottom_soldermask"],realToCanvasMat:r,drawSoldermaskTop:H,drawSoldermaskBottom:V,primitives:e})}let T=v.drill;if(T)Xrs({canvas:T,elements:t,layers:["drill"],realToCanvasMat:r});if(C){let L=v.top_silkscreen;if(L)Rdo({canvas:L,elements:t,layers:["top_silkscreen"],realToCanvasMat:r});let H=v.bottom_silkscreen;if(H)Rdo({canvas:H,elements:t,layers:["bottom_silkscreen"],realToCanvasMat:r})}if(f){let L=v.top_fabrication;if(L)Mdo({canvas:L,elements:t,layers:["top_fabrication_note"],realToCanvasMat:r});let H=v.bottom_fabrication;if(H)Mdo({canvas:H,elements:t,layers:["bottom_fabrication_note"],realToCanvasMat:r})}if(y){let L=v.bottom_notes;if(L)wdo({canvas:L,elements:t,layers:["bottom_user_note"],realToCanvasMat:r});let H=v.top_notes;if(H)wdo({canvas:H,elements:t,layers:["top_user_note"],realToCanvasMat:r})}if(x){let L=v.top_courtyard;if(L)Edo({canvas:L,elements:t,layers:["top_courtyard"],realToCanvasMat:r});let H=v.bottom_courtyard;if(H)Edo({canvas:H,elements:t,layers:["bottom_courtyard"],realToCanvasMat:r})}let N=v.board;if(N)iis({canvas:N,elements:t,layers:[],realToCanvasMat:r,drawSoldermask:g}),r0o({canvas:N,elements:t,layers:[],realToCanvasMat:r,drawSoldermask:g});let D=v.edge_cuts;if(D)Jrs({canvas:D,elements:t,layers:["edge_cuts"],realToCanvasMat:r});for(let{canvas:L,layer:H}of B){if(!L)continue;nis({canvas:L,elements:t,layer:H,realToCanvasMat:r})}}I.orderAndFadeLayers();let M=l.current;if(M&&r&&o){M.getContext("2d").clearRect(0,0,s,a);for(let T of Ors(t,p)){let N={canvas:M,elements:o,layers:[Egt(T)],realToCanvasMat:r,drawSoldermask:!1};if(A)Pdo({...N,opacity:m});Tdo({...N,showCopperPours:!1}),Bdo(N),Ddo(N),kdo(N)}let B=new ui(M);B.realToCanvasMat=r,B.drawElements(o.filter((T)=>T.type==="pcb_via"||T.type==="pcb_plated_hole"),{layers:["drill"],drawSoldermask:!1})}if(u.current!==n)u.current=n,d.current?.()},[e,t,n,o,s,a,r,p,_,m,A,g,f,y,x,C]),Pne.jsxs("div",{style:{backgroundColor:"black",width:s,height:a,position:"relative"},children:[Pne.jsx(Fme.SuperGrid,{textColor:"rgba(0,255,0,0.8)",majorColor:"rgba(0,255,0,0.4)",minorColor:"rgba(0,255,0,0.2)",screenSpaceCellSize:200,width:s,height:a,transform:r,stringifyCoord:(b,I,v)=>`${Fme.toMMSI(b,v)}, ${Fme.toMMSI(I,v)}`}),o&&Pne.jsx("canvas",{ref:l,className:"pcb-x-ray-net",width:s,height:a,style:{position:"absolute",left:0,top:0,zIndex:md.topLayer,pointerEvents:"none"}}),zrs(t).filter((b)=>{if(!g&&b.includes("soldermask"))return!1;if(!C&&b.includes("silkscreen"))return!1;return!0}).map((b)=>b.replace(/-/g,"")).map((b,I)=>Pne.jsx("canvas",{className:`pcb-layer-${b}`,ref:(v)=>{if(h.current??={},v)h.current[b]=v;else delete h.current[b]},style:{position:"absolute",zIndex:I,left:0,top:0,pointerEvents:"none"},width:s,height:a},b))]})};var _La=(()=>{let e=new Uint8Array(4),t=new Uint32Array(e.buffer);return!((t[0]=1)&e[0])})(),gLa={int8:globalThis.Int8Array,uint8:globalThis.Uint8Array,int16:globalThis.Int16Array,uint16:globalThis.Uint16Array,int32:globalThis.Int32Array,uint32:globalThis.Uint32Array,uint64:globalThis.BigUint64Array,int64:globalThis.BigInt64Array,float32:globalThis.Float32Array,float64:globalThis.Float64Array},Qis=[];for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)if(t&1)t=3988292384^t>>>1;else t=t>>>1;Qis[e]=t}var kis=new Uint16Array([255]),Lis=new Uint8Array(kis.buffer),ALa=Lis[0]===255,His=new Uint16Array([255]),Fis=new Uint8Array(His.buffer),fLa=Fis[0]===255,yLa=new Uint8Array(0),xLa=Uint8Array.of(137,80,78,71,13,10,26,10),CLa=new TextDecoder("latin1"),SH=0.000000001,pTe=(e,t,n)=>e>=t-SH&&e<=n+SH,zis=(e)=>{let t=[];for(let n of e)if(!t.some((o)=>Math.abs(o.x-n.x)<SH&&Math.abs(o.y-n.y)<SH))t.push(n);return t};function Ois(e,t){let{origin:n,directionVector:o}=e;if(Math.abs(o.x)<SH&&Math.abs(o.y)<SH)return null;let r=[];if(Math.abs(o.x)>=SH){let l=(t.minX-n.x)/o.x,h=n.y+l*o.y;if(pTe(h,t.minY,t.maxY))r.push({x:t.minX,y:h});let d=(t.maxX-n.x)/o.x,u=n.y+d*o.y;if(pTe(u,t.minY,t.maxY))r.push({x:t.maxX,y:u})}if(Math.abs(o.y)>=SH){let l=(t.minY-n.y)/o.y,h=n.x+l*o.x;if(pTe(h,t.minX,t.maxX))r.push({x:h,y:t.minY});let d=(t.maxY-n.y)/o.y,u=n.x+d*o.x;if(pTe(u,t.minX,t.maxX))r.push({x:u,y:t.maxY})}let i=zis(r);if(i.length<2)return null;let s=i[0],a=i[1],c=(s.x-a.x)**2+(s.y-a.y)**2;for(let l=0;l<i.length;l++)for(let h=l+1;h<i.length;h++){let d=i[l],u=i[h],_=(d.x-u.x)**2+(d.y-u.y)**2;if(_>c)s=d,a=u,c=_}return[s,a]}function Vis(e,t,n){let o=Cf(e),r=[fo(o,{x:0,y:0}),fo(o,{x:t,y:0}),fo(o,{x:0,y:n}),fo(o,{x:t,y:n})];return{minX:Math.min(...r.map((i)=>i.x)),maxX:Math.max(...r.map((i)=>i.x)),minY:Math.min(...r.map((i)=>i.y)),maxY:Math.max(...r.map((i)=>i.y))}}var Yis=0.6,Gis=1,Ldo=(e,t)=>Math.hypot(e.x-t.x,e.y-t.y),g0o=(e)=>(e.ccwRotationDegrees??0)*Math.PI/180,Uis=(e)=>e.a*e.d-e.b*e.c<0?1:-1,Wis=(e,t)=>g0o(e)*Uis(t),Xis=(e,t)=>{let n=Math.cos(t),o=Math.sin(t);return{x:e.x*n-e.y*o,y:e.x*o+e.y*n}},jis=(e)=>A0o(e,g0o(e)),Kis=(e,t)=>A0o(e,Wis(e,t)),A0o=(e,t)=>{let n=e.width/2,o=e.height/2;return[{x:-n,y:-o},{x:n,y:-o},{x:n,y:o},{x:-n,y:o}].map((r)=>{let i=Xis(r,t);return{x:e.center.x+i.x,y:e.center.y+i.y}})},$is=(e,t)=>{let n=Kis(e,t).map((l)=>fo(t,l)),o=fo(t,e.center),r=Ldo(n[0],n[1]),i=Ldo(n[1],n[2]),s=n.length>=2?Math.atan2(n[1].y-n[0].y,n[1].x-n[0].x):0,a=s*180/Math.PI,c=n.reduce((l,h)=>({minX:Math.min(l.minX,h.x),maxX:Math.max(l.maxX,h.x),minY:Math.min(l.minY,h.y),maxY:Math.max(l.maxY,h.y)}),{minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0});return{center:o,corners:n,width:r,height:i,angleRadians:s,angleDegrees:a,bounds:c}},qis=2,Jis=12,Zis=12,ATe=(e)=>({tip:{...e},base:{...e},leftWing:{...e},rightWing:{...e}}),Hdo=(e,t,n)=>{let o=e.x-t.x,r=e.y-t.y,i=Math.hypot(o,r);if(i===0)return ATe(e);let s=o/i,c=-(r/i)*(n/2),l=s*(n/2);return{tip:{...e},base:{...t},leftWing:{x:t.x+c,y:t.y+l},rightWing:{x:t.x-c,y:t.y-l}}};function f0o(e){let{start:t,end:n}=e,o=n.x-t.x,r=n.y-t.y,i=Math.hypot(o,r),s=qis,a=Jis;if(i===0){let f=e.doubleSided?[ATe(t),ATe(t)]:[ATe(t)];return{shaftStart:{...t},shaftEnd:{...t},heads:f,shaftWidth:s,headLength:0,headWidth:a,length:i}}let c=o/i,l=r/i,h=Math.min(Zis,i*0.5),d=Math.max(h,s*2),u=e.doubleSided?i/2:i,_=Math.min(d,u),p={x:n.x-c*_,y:n.y-l*_},m=[Hdo(n,p,a)],A={...t},g={...p};if(e.doubleSided){let f={x:t.x+c*_,y:t.y+l*_};m.unshift(Hdo(t,f,a)),A=f}return{shaftStart:A,shaftEnd:g,heads:m,shaftWidth:s,headLength:_,headWidth:a,length:i}}function ess(e){let t=f0o(e);return[t.shaftStart,t.shaftEnd,...t.heads.flatMap((o)=>[o.tip,o.base,o.leftWing,o.rightWing])].reduce((o,r)=>({minX:Math.min(o.minX,r.x),maxX:Math.max(o.maxX,r.x),minY:Math.min(o.minY,r.y),maxY:Math.max(o.maxY,r.y)}),{minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0})}function Fdo(e,t,{fontSize:n=12,strokeWidth:o=2,normalPadding:r=6,alongOffset:i=0}={}){let s={x:(e.x+t.x)/2,y:(e.y+t.y)/2},a=t.x-e.x,c=t.y-e.y,l=Math.hypot(a,c);if(l===0)return{x:s.x+i,y:s.y-(o/2+n*0.65+r),angleRadians:0,angleDegrees:0,direction:{x:1,y:0},normal:{x:0,y:-1}};let h=a/l,d=c/l,u=-d,_=h;if(h<0||h===0&&d<0)h=-h,d=-d,u=-u,_=-_;let m=Math.atan2(d,h),A=o/2+n*0.65+r;return{x:s.x+u*A+h*i,y:s.y+_*A+d*i,angleRadians:m,angleDegrees:m*180/Math.PI,direction:{x:h,y:d},normal:{x:u,y:_}}}var bH=["rgba(239, 68, 68, 0.8)","rgba(249, 115, 22, 0.8)","rgba(245, 158, 11, 0.8)","rgba(234, 179, 8, 0.8)","rgba(132, 204, 22, 0.8)","rgba(34, 197, 94, 0.8)","rgba(16, 185, 129, 0.8)","rgba(20, 184, 166, 0.8)","rgba(6, 182, 212, 0.8)","rgba(14, 165, 233, 0.8)","rgba(59, 130, 246, 0.8)","rgba(99, 102, 241, 0.8)","rgba(139, 92, 246, 0.8)","rgba(168, 85, 247, 0.8)","rgba(217, 70, 239, 0.8)","rgba(236, 72, 153, 0.8)","rgba(249, 168, 212, 0.8)","rgba(161, 161, 170, 0.8)"];function zdo(e,t,n,o={}){let r=o.padding??40,i=o.yFlip??!1,s;if("center"in e){let h=e.width/2,d=e.height/2;s={minX:e.center.x-h,maxX:e.center.x+h,minY:e.center.y-d,maxY:e.center.y+d}}else s=e;let a=s.maxX-s.minX||1,c=s.maxY-s.minY||1,l=Math.min((t-2*r)/a,(n-2*r)/c);return ud(Ra(t/2,n/2),bf(l,i?-l:l),Ra(-(s.minX+a/2),-(s.minY+c/2)))}function tss(e){let t=[...e.points||[],...(e.lines||[]).flatMap((n)=>n.points),...(e.polygons||[]).flatMap((n)=>n.points),...(e.rects||[]).flatMap((n)=>jis(n)),...(e.circles||[]).flatMap((n)=>[{x:n.center.x-n.radius,y:n.center.y},{x:n.center.x+n.radius,y:n.center.y},{x:n.center.x,y:n.center.y-n.radius},{x:n.center.x,y:n.center.y+n.radius}]),...(e.arrows||[]).flatMap((n)=>{let o=ess(n);return[{x:o.minX,y:o.minY},{x:o.maxX,y:o.maxY}]}),...(e.texts||[]).flatMap((n)=>{let o=n.fontSize??12,r=n.text.length*o*Yis,i=o*Gis,s=n.anchorSide??"center",a={top_left:{dx:0,dy:0},top_center:{dx:-r/2,dy:0},top_right:{dx:-r,dy:0},center_left:{dx:0,dy:-i/2},center:{dx:-r/2,dy:-i/2},center_right:{dx:-r,dy:-i/2},bottom_left:{dx:0,dy:-i},bottom_center:{dx:-r/2,dy:-i},bottom_right:{dx:-r,dy:-i}},{dx:c,dy:l}=a[s],h=n.x+c,d=n.y+l;return[{x:h,y:d},{x:h+r,y:d+i}]})];if(t.length===0)return{minX:-1,maxX:1,minY:-1,maxY:1};return t.reduce((n,o)=>({minX:Math.min(n.minX,o.x),maxX:Math.max(n.maxX,o.x),minY:Math.min(n.minY,o.y),maxY:Math.max(n.maxY,o.y)}),{minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0})}function nss(e,t,n={}){let o=n.disableLabels!==!1,r=n.hideInlineLabels??o,i=t instanceof HTMLCanvasElement?t.getContext("2d"):t;if(!i)throw Error("Could not get 2D context from canvas");let s=t instanceof HTMLCanvasElement?t.width:t.canvas.width,a=t instanceof HTMLCanvasElement?t.height:t.canvas.height,c;if(n.transform)c=n.transform;else if(n.viewbox)c=zdo(n.viewbox,s,a,{padding:n.padding,yFlip:n.yFlip});else{let l=tss(e),h=e.coordinateSystem==="cartesian";c=zdo(l,s,a,{padding:n.padding??40,yFlip:h})}if(i.clearRect(0,0,s,a),i.save(),e.rects&&e.rects.length>0)e.rects.forEach((l)=>{let h=$is(l,c);if(i.save(),i.translate(h.center.x,h.center.y),Math.abs(h.angleRadians)>0.000001)i.rotate(h.angleRadians);if(i.beginPath(),i.rect(-h.width/2,-h.height/2,h.width,h.height),l.fill)i.fillStyle=l.fill,i.fill();if(l.stroke)i.strokeStyle=l.stroke,i.stroke();i.restore()});if(e.circles&&e.circles.length>0)e.circles.forEach((l)=>{let h=fo(c,l.center),d=l.radius*Math.abs(c.a);if(i.beginPath(),i.arc(h.x,h.y,d,0,2*Math.PI),l.fill)i.fillStyle=l.fill,i.fill();if(l.stroke)i.strokeStyle=l.stroke??"transparent",i.stroke()});if(e.polygons&&e.polygons.length>0)e.polygons.forEach((l)=>{if(l.points.length===0)return;let h=l.points.map((d)=>fo(c,d));i.beginPath(),i.moveTo(h[0].x,h[0].y);for(let d=1;d<h.length;d++)i.lineTo(h[d].x,h[d].y);if(i.closePath(),l.fill)i.fillStyle=l.fill,i.fill();if(l.stroke){if(i.strokeStyle=l.stroke,l.strokeWidth!==void 0)i.lineWidth=l.strokeWidth*Math.abs(c.a);i.stroke()}});if(e.arrows&&e.arrows.length>0)e.arrows.forEach((l,h)=>{let d=f0o(l),u=fo(c,d.shaftStart),_=fo(c,d.shaftEnd),p=l.color||bH[h%bH.length],m=Math.hypot(c.a,c.b);i.strokeStyle=p,i.fillStyle=p,i.lineWidth=d.shaftWidth*(m||1),i.lineCap="round",i.setLineDash([]),i.beginPath(),i.moveTo(u.x,u.y),i.lineTo(_.x,_.y),i.stroke(),d.heads.forEach((C)=>{let b=fo(c,C.tip),I=fo(c,C.leftWing),v=fo(c,C.rightWing);i.beginPath(),i.moveTo(b.x,b.y),i.lineTo(I.x,I.y),i.lineTo(v.x,v.y),i.closePath(),i.fill()});let A=12,g=d.shaftWidth*(m||1),f=A*0.6,y=Fdo(u,_,{fontSize:A,strokeWidth:g,normalPadding:6,alongOffset:l.label?f:0}),x=Fdo(u,_,{fontSize:A,strokeWidth:g,normalPadding:12,alongOffset:l.inlineLabel?-f:0});if(i.fillStyle=p,i.font=`${A}px sans-serif`,!o&&l.label){let{x:C,y:b}=x;i.save(),i.textAlign="center",i.textBaseline="middle",i.fillText(l.label,C,b),i.restore()}if(!r&&l.inlineLabel)i.save(),i.translate(y.x,y.y),i.rotate(y.angleRadians),i.textAlign="center",i.textBaseline="middle",i.fillText(l.inlineLabel,0,0),i.restore()});if(e.lines&&e.lines.length>0)e.lines.map((l,h)=>({line:l,originalIndex:h})).sort((l,h)=>(l.line.zIndex??0)-(h.line.zIndex??0)||l.originalIndex-h.originalIndex).forEach(({line:l,originalIndex:h})=>{if(l.points.length===0)return;i.beginPath();let d=fo(c,l.points[0]);i.moveTo(d.x,d.y);for(let u=1;u<l.points.length;u++){let _=fo(c,l.points[u]);i.lineTo(_.x,_.y)}if(i.strokeStyle=l.strokeColor||bH[h%bH.length],l.strokeWidth)i.lineWidth=l.strokeWidth*c.a;else i.lineWidth=2;if(i.lineCap="round",l.strokeDash)if(typeof l.strokeDash==="string"){let u;if(l.strokeDash.includes(","))u=l.strokeDash.split(",").map((_)=>parseFloat(_.trim())).filter((_)=>!Number.isNaN(_));else{let _=parseFloat(l.strokeDash.trim());u=!Number.isNaN(_)?[_]:[]}i.setLineDash(u)}else i.setLineDash(l.strokeDash.map((u)=>u*Math.abs(c.a)));else i.setLineDash([]);i.stroke()});if(e.infiniteLines&&e.infiniteLines.length>0){let l=Vis(c,s,a);e.infiniteLines.forEach((h,d)=>{let u=Ois(h,l);if(!u)return;let[_,p]=u,m=fo(c,_),A=fo(c,p);if(i.beginPath(),i.moveTo(m.x,m.y),i.lineTo(A.x,A.y),i.strokeStyle=h.strokeColor||bH[d%bH.length],i.lineWidth=h.strokeWidth?h.strokeWidth*Math.abs(c.a):2,i.lineCap="round",h.strokeDash)if(typeof h.strokeDash==="string"){let g;if(h.strokeDash.includes(","))g=h.strokeDash.split(",").map((f)=>parseFloat(f.trim())).filter((f)=>!Number.isNaN(f));else{let f=parseFloat(h.strokeDash.trim());g=!Number.isNaN(f)?[f]:[]}i.setLineDash(g)}else i.setLineDash(h.strokeDash.map((g)=>g*Math.abs(c.a)));else i.setLineDash([]);i.stroke()})}if(e.texts&&e.texts.length>0)e.texts.forEach((l)=>{let h=fo(c,{x:l.x,y:l.y});i.fillStyle=l.color||"black",i.font=`${(l.fontSize??12)*Math.abs(c.a)}px sans-serif`;let d=l.anchorSide??"center",u={top_left:"left",center_left:"left",bottom_left:"left",top_center:"center",center:"center",bottom_center:"center",top_right:"right",center_right:"right",bottom_right:"right"},_={top_left:"top",top_center:"top",top_right:"top",center_left:"middle",center:"middle",center_right:"middle",bottom_left:"bottom",bottom_center:"bottom",bottom_right:"bottom"};i.textAlign=u[d],i.textBaseline=_[d],i.fillText(l.text,h.x,h.y)});if(e.points&&e.points.length>0)e.points.forEach((l,h)=>{let d=fo(c,l);if(i.beginPath(),i.arc(d.x,d.y,3,0,2*Math.PI),i.fillStyle=l.color||bH[h%bH.length],i.fill(),l.label&&!o)i.fillStyle=l.color||"black",i.font="12px sans-serif",i.fillText(l.label,d.x+5,d.y-5)});i.restore()}var PLa=$do($ts(),1),oss=({children:e,transform:t,debugGraphics:n})=>{let o=BTe.useRef(null),[r,{width:i,height:s}]=Kme(),a=Qa((c)=>c.is_showing_autorouting);if(BTe.useEffect(()=>{if(!a)return;if(o.current&&n&&i&&s)o.current.width=i,o.current.height=s,nss(n,o.current,{transform:t,disableLabels:!0})},[n,t,i,s,a]),!a)return e;return TTe.jsxs("div",{ref:r,style:{position:"relative",width:"100%",height:"100%"},children:[e,TTe.jsx("canvas",{ref:o,style:{position:"absolute",top:0,left:0,opacity:0.5,zIndex:100,width:"100%",height:"100%",pointerEvents:"none"}})]})},mTe=(e,t,n)=>n(e,t),Odo=(e,t,n,o,r)=>{let i=r*Math.PI/180,s=Math.cos(i),a=Math.sin(i),c=e-n,l=t-o,h=c*s-l*a,d=c*a+l*s;return{x:h+n,y:d+o}},Bme=(e)=>{if(e.length===0)return null;let t=e[0].x,n=e[0].x,o=e[0].y,r=e[0].y;for(let i of e)t=mTe(t,i.x,Math.min),n=mTe(n,i.x,Math.max),o=mTe(o,i.y,Math.min),r=mTe(r,i.y,Math.max);return{minX:t,maxX:n,minY:o,maxY:r}},rss=(e,t)=>({minX:Math.min(e.minX,t.minX),maxX:Math.max(e.maxX,t.maxX),minY:Math.min(e.minY,t.minY),maxY:Math.max(e.maxY,t.maxY)}),iss=(e,t)=>{if(!e)return t;return rss(e,t)},sss=(e)=>{switch(e.pcb_drawing_type){case"line":{let t=(e.width??0)/2,n=[{x:e.x1,y:e.y1},{x:e.x2,y:e.y2}],o=Bme(n);if(!o)return null;return{minX:o.minX-t,maxX:o.maxX+t,minY:o.minY-t,maxY:o.maxY+t}}case"rect":{let t=e.w/2,n=e.h/2,o=[{x:e.x-t,y:e.y-n},{x:e.x+t,y:e.y-n},{x:e.x+t,y:e.y+n},{x:e.x-t,y:e.y+n}],r=e.ccw_rotation??0,i=r===0?o:o.map((s)=>Odo(s.x,s.y,e.x,e.y,r));return Bme(i)}case"circle":return{minX:e.x-e.r,maxX:e.x+e.r,minY:e.y-e.r,maxY:e.y+e.r};case"oval":return{minX:e.x-e.rX,maxX:e.x+e.rX,minY:e.y-e.rY,maxY:e.y+e.rY};case"pill":{let t=e.w/2,n=e.h/2,o=[{x:e.x-t,y:e.y-n},{x:e.x+t,y:e.y-n},{x:e.x+t,y:e.y+n},{x:e.x-t,y:e.y+n}],r=e.ccw_rotation??0,i=r===0?o:o.map((s)=>Odo(s.x,s.y,e.x,e.y,r));return Bme(i)}case"polygon":return Bme(e.points);case"polygon_with_arcs":{let t=e.brep_shape.outer_ring.vertices.map((n)=>({x:n.x,y:n.y}));return Bme(t)}case"text":{let t=e.size??0,n=e.text?e.text.length*t*0.6:0,o=t;if(n===0&&o===0)return{minX:e.x,maxX:e.x,minY:e.y,maxY:e.y};let r=n/2,i=o/2;return{minX:e.x-r,maxX:e.x+r,minY:e.y-i,maxY:e.y+i}}default:return null}};function ass(e){let{dimensionStart:t,dimensionEnd:n,screenDimensionStart:o,screenDimensionEnd:r,flipX:i,flipY:s}=e,a=n.x-t.x,c=n.y-t.y,l=Math.sqrt(a*a+c*c),h=r.x-o.x,d=r.y-o.y,u=Math.sqrt(h*h+d*d),_=Math.atan2(d,h)*(180/Math.PI),p=Math.abs(_)%90,A=Math.min(p,90-p)>15,g=(o.x+r.x)/2,f=(o.y+r.y)/2,y=15,x=_+90,C=Math.cos(x*Math.PI/180)*15,b=Math.sin(x*Math.PI/180)*15,I=h>0&&d<0,v=h<0&&d<0,P=h>0&&d>0,M=h<0&&d>0;if(i!==s&&!I)C=-C,b=-b;if(I)C+=Math.cos(x*Math.PI/180)*-45,b+=Math.sin(x*Math.PI/180)*-45;if(P)C+=Math.cos(x*Math.PI/180)+-20,b+=Math.sin(x*Math.PI/180)+-10;if(M)C+=Math.cos(x*Math.PI/180)*10,b+=Math.sin(x*Math.PI/180)*10;let B=g+C,T=f+b;return{distance:l,screenDistance:u,x:B,y:T,show:l>0.01&&u>30&&A}}function css(e){let{dimensionStart:t,dimensionEnd:n,screenDimensionStart:o,screenDimensionEnd:r,flipX:i,flipY:s}=e;return y0o.useMemo(()=>ass({dimensionStart:t,dimensionEnd:n,screenDimensionStart:o,screenDimensionEnd:r,flipX:i,flipY:s}),[t,n,o,r,i,s])}var lss=(e,t,n)=>{let o=n*Math.PI/180,r=Math.cos(o),i=Math.sin(o),s=e.x-t.x,a=e.y-t.y,c=s*r-a*i,l=s*i+a*r;return{x:c+t.x,y:l+t.y}},Vdo=(e,t,n,o)=>{let r={top_left:{x:e.x-t,y:e.y-n},top_center:{x:e.x,y:e.y-n},top_right:{x:e.x+t,y:e.y-n},center_left:{x:e.x-t,y:e.y},center:{x:e.x,y:e.y},center_right:{x:e.x+t,y:e.y},bottom_left:{x:e.x-t,y:e.y+n},bottom_center:{x:e.x,y:e.y+n},bottom_right:{x:e.x+t,y:e.y+n}};if(o===0)return Object.entries(r).map(([i,s])=>({anchor:i,point:s}));return Object.entries(r).map(([i,s])=>({anchor:i,point:lss(s,e,o)}))},hss=(e)=>{switch(e.pcb_drawing_type){case"rect":{let t=e.ccw_rotation??0;return Vdo({x:e.x,y:e.y},e.w/2,e.h/2,t)}case"pill":{let t=e.ccw_rotation??0;return Vdo({x:e.x,y:e.y},e.w/2,e.h/2,t)}case"circle":return[{anchor:"circle_center",point:{x:e.x,y:e.y}},{anchor:"circle_right",point:{x:e.x+e.r,y:e.y}},{anchor:"circle_left",point:{x:e.x-e.r,y:e.y}},{anchor:"circle_top",point:{x:e.x,y:e.y-e.r}},{anchor:"circle_bottom",point:{x:e.x,y:e.y+e.r}}];case"oval":return[{anchor:"oval_center",point:{x:e.x,y:e.y}},{anchor:"oval_right",point:{x:e.x+e.rX,y:e.y}},{anchor:"oval_left",point:{x:e.x-e.rX,y:e.y}},{anchor:"oval_top",point:{x:e.x,y:e.y-e.rY}},{anchor:"oval_bottom",point:{x:e.x,y:e.y+e.rY}}];case"line":{let t={x:(e.x1+e.x2)/2,y:(e.y1+e.y2)/2};return[{anchor:"line_start",point:{x:e.x1,y:e.y1}},{anchor:"line_mid",point:t},{anchor:"line_end",point:{x:e.x2,y:e.y2}}]}case"polygon":return e.points.map((t,n)=>({anchor:`polygon_vertex_${n}`,point:t}));case"polygon_with_arcs":return e.brep_shape.outer_ring.vertices.map((t,n)=>({anchor:`polygon_with_arcs_vertex_${n}`,point:{x:t.x,y:t.y}}));default:return[]}},Ydo=({screenPoint:{x:e,y:t}})=>`M${e-2.5},${t-2.5}l5,5m0,-5l-5,5`,dss=DTe.memo(function({points:t,startId:n,endId:o}){let{path:r,pointsById:i}=DTe.useMemo(()=>({path:t.map(Ydo).join(""),pointsById:new Map(t.map((a)=>[a.id,a]))}),[t]),s=[...new Set([n,o])].flatMap((a)=>{let c=a===null?void 0:i.get(a);return c?[Ydo(c)]:[]}).join("");return zme.jsxs("svg",{"aria-hidden":"true",width:"100%",height:"100%",style:{position:"absolute",left:0,top:0,overflow:"visible",pointerEvents:"none",zIndex:md.dimensionOverlay},fill:"none",strokeWidth:1,children:[zme.jsx("path",{d:r,stroke:"white"}),zme.jsx("path",{d:s,stroke:"#66ccff"})]})}),uss=16,pss=[],mss=xf(),Gdo=(e)=>{if(e.pcb_drawing_type==="text")return!0;let t=e._element;if(!t||typeof t!=="object")return!1;let n=typeof t.type==="string"?t.type:void 0;if(!n)return!1;if(n.startsWith("pcb_silkscreen_"))return!0;if(n.startsWith("pcb_note_"))return!0;if(n==="pcb_text")return!0;if(n.startsWith("pcb_fabrication_note_")&&n!=="pcb_fabrication_note_rect")return!0;return!1},_ss=({children:e,transform:t,focusOnHover:n=!1,primitives:o=pss,onBoundsSelected:r,cancelPanDrag:i})=>{if(!t)t=mss;let[s,a]=Hd.useState(!1),[c,l]=Hd.useState(!1),[h,d]=Hd.useState(!1),[u,_]=Hd.useState(!1),[p,m]=Hd.useState(!1),[A,g]=Hd.useState(!1),[f,y]=Hd.useState({start:null,end:null}),x=Qa((de)=>de.is_mouse_over_container),C=Hd.useCallback(()=>{if(h)d(!1),window.dispatchEvent(new Event("disarm-dimension-tool"))},[h]),b=Hd.useCallback(()=>{if(u)_(!1),window.dispatchEvent(new Event("disarm-bounds-tool"))},[u]),[I,v]=Hd.useState({x:0,y:0}),[P,M]=Hd.useState({x:0,y:0}),[B,T]=Hd.useState({x:0,y:0}),[N,D]=Hd.useState({x:0,y:0}),L=Hd.useRef({x:0,y:0}),H=Hd.useRef(!1),V=Hd.useRef(null),U=V.current?.getBoundingClientRect(),j=Hd.useMemo(()=>{let de=new Map;for(let me of o){if(!me._element)continue;if(Gdo(me))continue;if(me.pcb_drawing_type==="pill")continue;if(me.pcb_drawing_type==="rect"&&me.ccw_rotation&&me.ccw_rotation!==0)continue;let Ae=sss(me);if(!Ae)continue;let xe=de.get(me._element);de.set(me._element,iss(xe??void 0,Ae))}return de},[o]),Y=Hd.useMemo(()=>{let de=[];for(let me of o){if(!me._element)continue;if(Gdo(me))continue;let Ae=hss(me);if(Ae.length===0)continue;for(let xe of Ae)de.push({anchor:xe.anchor,point:xe.point,element:me._element})}return de},[o]),X=Hd.useMemo(()=>{let de=[];j.forEach((me,Ae)=>{if(!me)return;let xe=(me.minX+me.maxX)/2,Me=(me.minY+me.maxY)/2,Re={top_left:{x:me.minX,y:me.minY},top_center:{x:xe,y:me.minY},top_right:{x:me.maxX,y:me.minY},center_left:{x:me.minX,y:Me},center:{x:xe,y:Me},center_right:{x:me.maxX,y:Me},bottom_left:{x:me.minX,y:me.maxY},bottom_center:{x:xe,y:me.maxY},bottom_right:{x:me.maxX,y:me.maxY}};for(let[we,_e]of Object.entries(Re))de.push({anchor:we,point:_e,element:Ae})});for(let me of Y)de.push(me);return de.push({anchor:"origin",point:{x:0,y:0},element:null}),de},[j,Y]),K=Hd.useMemo(()=>X.map((de,me)=>({...de,id:`${me}-${de.anchor}`,screenPoint:fo(t,de.point)})),[X,t]),J=Hd.useCallback((de)=>{if(K.length===0)return{point:de,id:null};let me=fo(t,de),Ae=null;for(let xe of K){let Me=xe.screenPoint.x-me.x,Re=xe.screenPoint.y-me.y,we=Math.hypot(Me,Re);if(we>uss)continue;if(!Ae||we<Ae.distance)Ae={distance:we,id:xe.id,point:xe.point}}if(!Ae)return{point:de,id:null};return{point:Ae.point,id:Ae.id}},[K,t]);Hd.useEffect(()=>{let de=(xe)=>{let Me=xe.target;if(Me.tagName==="INPUT"||Me.tagName==="TEXTAREA"||Me.isContentEditable)return;let Re=V.current?.contains(document.activeElement)||document.activeElement===V.current;if(!x&&!Re)return;if(xe.key==="d"){let we=J({x:L.current.x,y:L.current.y});if(v({x:we.point.x,y:we.point.y}),M({x:we.point.x,y:we.point.y}),y({start:we.id,end:we.id}),s)a(!1),l(!1),y({start:null,end:null});else a(!0),l(!0);C()}if(xe.key==="Escape")a(!1),l(!1),y({start:null,end:null}),m(!1),g(!1),C(),b()},me=()=>{d(!0),_(!1),window.dispatchEvent(new Event("disarm-bounds-tool"))},Ae=()=>{_(!0),d(!1),a(!1),l(!1),window.dispatchEvent(new Event("disarm-dimension-tool"))};return window.addEventListener("keydown",de),window.addEventListener("arm-dimension-tool",me),window.addEventListener("arm-bounds-tool",Ae),()=>{window.removeEventListener("keydown",de),window.removeEventListener("arm-dimension-tool",me),window.removeEventListener("arm-bounds-tool",Ae),C(),b()}},[x,s,C,b,J]);let ee=fo(t,I),se=fo(t,P),ne=fo(t,B),re=fo(t,N),Z={minX:Math.min(B.x,N.x),minY:Math.min(B.y,N.y),maxX:Math.max(B.x,N.x),maxY:Math.max(B.y,N.y)},te={left:Math.min(ne.x,re.x),top:Math.min(ne.y,re.y),width:Math.abs(ne.x-re.x),height:Math.abs(ne.y-re.y)},ie=Hd.useCallback((de,me)=>{let Ae={minX:Math.min(de.x,me.x),minY:Math.min(de.y,me.y),maxX:Math.max(de.x,me.x),maxY:Math.max(de.y,me.y)};r?.(Ae),window.dispatchEvent(new CustomEvent("pcb-viewer:bounds-selected",{detail:Ae}))},[r]),le={left:Math.min(ee.x,se.x),right:Math.max(ee.x,se.x),top:Math.min(ee.y,se.y),bottom:Math.max(ee.y,se.y),flipX:ee.x>se.x,flipY:ee.y>se.y,width:0,height:0};le.width=le.right-le.left,le.height=le.bottom-le.top;let ue=css({dimensionStart:I,dimensionEnd:P,screenDimensionStart:ee,screenDimensionEnd:se,flipX:le.flipX,flipY:le.flipY});return pu.jsxs("div",{ref:V,"data-pcb-viewer":!0,tabIndex:0,style:{position:"relative",outline:"none"},onMouseDownCapture:()=>{H.current=!1},onClickCapture:(de)=>{if(!H.current)return;H.current=!1,de.stopPropagation(),V.current?.focus()},onContextMenuCapture:(de)=>{if(!h&&!s&&!H.current)return;de.preventDefault(),de.stopPropagation()},onMouseEnter:()=>{if(n&&V.current)V.current.focus()},onMouseLeave:()=>{if(V.current)V.current.blur()},onClick:()=>{if(V.current)V.current.focus()},onMouseMove:(de)=>{let me=de.currentTarget.getBoundingClientRect(),Ae=de.clientX-me.left,xe=de.clientY-me.top,Me=fo(Cf(t),{x:Ae,y:xe});if(L.current.x=Me.x,L.current.y=Me.y,c){let Re=J(Me);M({x:Re.point.x,y:Re.point.y}),y((we)=>({...we,end:Re.id}))}if(A)i?.(),D({x:Me.x,y:Me.y})},onMouseDown:(de)=>{H.current=h||s;let me=de.currentTarget.getBoundingClientRect(),Ae=de.clientX-me.left,xe=de.clientY-me.top,Me=fo(Cf(t),{x:Ae,y:xe});if(u)de.preventDefault(),de.stopPropagation(),i?.(),T({x:Me.x,y:Me.y}),D({x:Me.x,y:Me.y}),m(!0),g(!0),b();else if(h&&!s){let Re=J(Me);v({x:Re.point.x,y:Re.point.y}),M({x:Re.point.x,y:Re.point.y}),y({start:Re.id,end:Re.id}),a(!0),l(!0),C()}else if(c)l(!1),y((Re)=>({...Re,end:null}));else if(s)a(!1),y({start:null,end:null})},onMouseUp:(de)=>{if(!A)return;let me=de.currentTarget.getBoundingClientRect(),Ae=de.clientX-me.left,xe=de.clientY-me.top,Me=fo(Cf(t),{x:Ae,y:xe}),Re={x:Me.x,y:Me.y};de.preventDefault(),de.stopPropagation(),i?.(),D(Re),g(!1),ie(B,Re)},children:[e,p&&pu.jsxs(pu.Fragment,{children:[pu.jsx("svg",{style:{position:"absolute",left:0,top:0,pointerEvents:"none",mixBlendMode:"difference",zIndex:md.dimensionOverlay},width:U.width,height:U.height,children:pu.jsx("rect",{x:te.left,y:te.top,width:te.width,height:te.height,stroke:"red",strokeWidth:1.5,strokeDasharray:"4,3",fill:"rgba(255, 0, 0, 0.12)"})}),pu.jsxs("div",{style:{left:0,bottom:s?58:0,position:"absolute",color:"red",fontFamily:"sans-serif",fontSize:12,margin:4,pointerEvents:"none",mixBlendMode:"difference",zIndex:md.dimensionOverlay},children:["minX: ",Z.minX.toFixed(2),", minY:"," ",Z.minY.toFixed(2),pu.jsx("br",{}),"maxX: ",Z.maxX.toFixed(2),", maxY:"," ",Z.maxY.toFixed(2)]})]}),s&&pu.jsxs(pu.Fragment,{children:[ue.show&&pu.jsx("div",{style:{position:"absolute",left:ue.x,top:ue.y,color:"red",mixBlendMode:"difference",pointerEvents:"none",fontSize:12,fontFamily:"sans-serif",whiteSpace:"nowrap",zIndex:md.dimensionOverlay},children:ue.distance.toFixed(2)}),pu.jsx("div",{style:{position:"absolute",left:le.left,width:le.width,textAlign:"center",top:ee.y+2,color:"red",mixBlendMode:"difference",pointerEvents:"none",marginTop:le.flipY?0:-20,fontSize:12,fontFamily:"sans-serif",zIndex:md.dimensionOverlay},children:Math.abs(I.x-P.x).toFixed(2)}),pu.jsx("div",{style:{position:"absolute",left:se.x,height:le.height,display:"flex",flexDirection:"column",justifyContent:"center",top:le.top,color:"red",pointerEvents:"none",mixBlendMode:"difference",fontSize:12,fontFamily:"sans-serif",zIndex:md.dimensionOverlay},children:pu.jsx("div",{style:{marginLeft:le.flipX?"-100%":4,paddingRight:4},children:Math.abs(I.y-P.y).toFixed(2)})}),pu.jsxs("svg",{style:{position:"absolute",left:0,top:0,pointerEvents:"none",mixBlendMode:"difference",zIndex:md.dimensionOverlay},width:U.width,height:U.height,children:[pu.jsx("defs",{children:pu.jsx("marker",{id:"head",orient:"auto",markerWidth:"3",markerHeight:"4",refX:"2",refY:"2",children:pu.jsx("path",{d:"M0,0 V4 L2,2 Z",fill:"red"})})}),pu.jsx("line",{x1:ee.x,y1:ee.y,x2:se.x,y2:se.y,markerEnd:"url(#head)",strokeWidth:1.5,fill:"none",stroke:"red"}),pu.jsx("line",{x1:ee.x,y1:ee.y,x2:se.x,y2:ee.y,strokeWidth:1.5,fill:"none",strokeDasharray:"2,2",stroke:"red"}),pu.jsx("line",{x1:se.x,y1:ee.y,x2:se.x,y2:se.y,strokeWidth:1.5,fill:"none",strokeDasharray:"2,2",stroke:"red"})]}),c&&pu.jsx(dss,{points:K,startId:f.start,endId:f.end}),pu.jsxs("div",{style:{right:0,bottom:0,position:"absolute",color:"red",fontFamily:"sans-serif",fontSize:12,margin:4},children:["(",I.x.toFixed(2),",",I.y.toFixed(2),")",pu.jsx("br",{}),"(",P.x.toFixed(2),",",P.y.toFixed(2),")",pu.jsx("br",{}),"dist:"," ",Math.sqrt((P.x-I.x)**2+(P.y-I.y)**2).toFixed(2)]})]})]})},gss=(e,t,n=0)=>{let o=e.width/2,r=e.height/2,i=e.center.x-o-n,s=e.center.x+o+n,a=e.center.y-r-n,c=e.center.y+r+n;return t.x>i&&t.x<s&&t.y>a&&t.y<c},Ass=({children:e,disabled:t,transform:n,soup:o,cancelPanDrag:r,onCreateEditEvent:i,onModifyEditEvent:s})=>{if(!n)n=xf();let a=Ome.useRef(null),[c,l]=Ome.useState(null),[h,d]=Ome.useState(null),u=c!==null,_=Qa((g)=>g.in_edit_mode),p=Qa((g)=>g.in_move_footprint_mode),m=Qa((g)=>g.setIsMovingComponent),A=t||!p;return NTe.jsxs("div",{ref:a,style:{position:"relative",overflow:"hidden"},onMouseDown:(g)=>{if(A)return;let f=g.currentTarget.getBoundingClientRect(),y=g.clientX-f.left,x=g.clientY-f.top;if(Number.isNaN(y)||Number.isNaN(x))return;let C=fo(Cf(n),{x:y,y:x}),b=!1;for(let I of o)if(I.type==="pcb_component"&&gss(I,C,10/n.a)){r(),l(I.pcb_component_id),b=!0;let v=Math.random().toString();d({dragStart:C,originalCenter:I.center,dragEnd:C,edit_event_id:v}),i({edit_event_id:v,edit_event_type:"edit_pcb_component_location",pcb_edit_event_type:"edit_component_location",pcb_component_id:I.pcb_component_id,original_center:I.center,new_center:I.center,in_progress:!0,created_at:Date.now()}),m(!0);break}if(!b)l(null);if(b)return g.preventDefault(),!1},onMouseMove:(g)=>{if(!c||!h)return;let f=g.currentTarget.getBoundingClientRect(),y=g.clientX-f.left,x=g.clientY-f.top;if(Number.isNaN(y)||Number.isNaN(x))return;let C=fo(Cf(n),{x:y,y:x});d({...h,dragEnd:C}),s({edit_event_id:h.edit_event_id,new_center:{x:h.originalCenter.x+C.x-h.dragStart.x,y:h.originalCenter.y+C.y-h.dragStart.y}})},onMouseUp:(g)=>{if(!c)return;if(l(null),m(!1),h)s({edit_event_id:h.edit_event_id,in_progress:!1}),d(null)},children:[e,!A&&o.filter((g)=>g.type==="pcb_component").map((g)=>{if(!g?.center)return null;let f=fo(n,g.center);return NTe.jsx("div",{style:{position:"absolute",pointerEvents:"none",left:f.x,top:f.y,width:g.width*n.a+20,height:g.height*n.a+20,transform:"translate(-50%, -50%)",background:u&&c===g.pcb_component_id?"rgba(255, 0, 0, 0.2)":""}},g.pcb_component_id)})]})},ugt=(e,t)=>{let n=t.current;if(!n)return{transform:"translate(-50%, -100%)",left:e.x,top:e.y};let o=n.getBoundingClientRect(),r=200,i=10,s=60,a="-50%",c="-100%",{x:l,y:h}=e;if(e.x+s+r<o.width-i)l=e.x+s,a="0%";else if(e.x-s-r>i)l=e.x-s,a="-100%";else l=e.x,a="-50%";return{transform:`translate(${a}, ${c})`,left:l,top:h}},fss=({center:e})=>qT.jsxs("svg",{style:{position:"absolute",left:0,top:0,pointerEvents:"none",mixBlendMode:"difference",zIndex:md.errorOverlay+30},width:"100%",height:"100%",children:[qT.jsx("circle",{cx:e.x,cy:e.y,r:11,fill:"none",stroke:"#ff6b6b",strokeWidth:2.5,opacity:0.95}),qT.jsx("circle",{cx:e.x,cy:e.y,r:4.5,fill:"#ff6b6b",opacity:0.95}),qT.jsx("line",{x1:e.x-18,y1:e.y,x2:e.x-8,y2:e.y,stroke:"#ff6b6b",strokeWidth:2}),qT.jsx("line",{x1:e.x+8,y1:e.y,x2:e.x+18,y2:e.y,stroke:"#ff6b6b",strokeWidth:2}),qT.jsx("line",{x1:e.x,y1:e.y-18,x2:e.x,y2:e.y-8,stroke:"#ff6b6b",strokeWidth:2}),qT.jsx("line",{x1:e.x,y1:e.y+8,x2:e.x,y2:e.y+18,stroke:"#ff6b6b",strokeWidth:2})]}),Udo=({errorCenter:e,isHighlighted:t=!1})=>sp.jsx("svg",{style:{position:"absolute",left:0,top:0,pointerEvents:"none",mixBlendMode:"difference",zIndex:md.errorOverlay},width:"100%",height:"100%",children:sp.jsx("rect",{x:e.x-7,y:e.y-7,width:14,height:14,transform:`rotate(45 ${e.x} ${e.y})`,fill:t?"#ff4444":"transparent",stroke:t?"#ff4444":"red",strokeWidth:t?2.5:1.5})}),pgt=$T`
  opacity: 0;
  pointer-events: none;
  background-color: rgba(0, 0, 0, 0.8);
  padding: 8px 12px;
  border-radius: 4px;
  width: 200px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  word-wrap: break-word;
  line-height: 1.4;
  transition: opacity 0.2s;
  margin-bottom: 10px;
  color: red;
`,yss=({children:e,transform:t=xf(),elements:n})=>{let o=Ene.useRef(null),{isShowingDRCErrors:r,hoveredErrorId:i,focusedErrorId:s}=Qa((m)=>({isShowingDRCErrors:m.is_showing_drc_errors,hoveredErrorId:m.hovered_error_id,focusedErrorId:m.focused_error_id})),a=s??i;if(!n)return sp.jsx("div",{style:{position:"relative"},ref:o,children:e});let c=n.filter((m)=>m.type==="pcb_trace_error"&&!m.message?.includes("Multiple components found with name")),l=n.filter((m)=>m.type==="pcb_via_clearance_error"),h=n.filter((m)=>m.type==="pcb_trace_error"&&m.message?.includes("Multiple components found with name")),d=$uo(n),u=Zuo(n,a),_=(m)=>{let A=vrs({error:m,indexes:d});if(!A||typeof A.x!=="number"||typeof A.y!=="number")return null;let g=fo(t,A);if(Number.isNaN(g.x)||Number.isNaN(g.y))return null;return g},p=null;if(u)p=_(u);return sp.jsxs("div",{style:{position:"relative"},ref:o,children:[e,c.map((m,A)=>{let g=Sne(m,A),f=a===g;if(!f&&!r)return null;let y=_(m);if(!y)return null;let x=ugt(y,o);return sp.jsxs(Ene.Fragment,{children:[sp.jsx(Udo,{errorCenter:y,isHighlighted:f}),sp.jsx("div",{style:{position:"absolute",left:y.x-15,top:y.y-15,width:30,height:30,zIndex:md.errorOverlay+5,cursor:"pointer",borderRadius:"50%"},onMouseEnter:(C)=>{let b=C.currentTarget.nextElementSibling;if(b){let I=b.querySelector(".error-message");if(I)I.style.opacity="1"}},onMouseLeave:(C)=>{if(!f){let b=C.currentTarget.nextElementSibling;if(b){let I=b.querySelector(".error-message");if(I)I.style.opacity="0"}}}}),sp.jsx("div",{style:{position:"absolute",zIndex:f?200:100,left:x.left,top:x.top,color:f?"#ff4444":"red",textAlign:"center",fontFamily:"sans-serif",fontSize:12,display:r||f?"flex":"none",flexDirection:"column",alignItems:"center",pointerEvents:"none",transform:x.transform},children:sp.jsx("div",{className:`error-message ${pgt}`,style:{opacity:f?1:0,border:`1px solid ${f?"#ff4444":"red"}`},children:m.message})})]},g)}),l.map((m,A)=>{let g=Sne(m,A),f=a===g;if(!f&&!r)return null;let y=_(m);if(!y)return null;let x=ugt({x:y.x,y:y.y},o);return sp.jsxs(Ene.Fragment,{children:[sp.jsx(Udo,{errorCenter:y,isHighlighted:f}),sp.jsx("div",{style:{position:"absolute",left:y.x-15,top:y.y-15,width:30,height:30,zIndex:md.errorOverlay+5,cursor:"pointer",borderRadius:"50%"},onMouseEnter:(C)=>{let b=C.currentTarget.nextElementSibling;if(b){let I=b.querySelector(".error-message");if(I)I.style.opacity="1"}},onMouseLeave:(C)=>{if(!f){let b=C.currentTarget.nextElementSibling;if(b){let I=b.querySelector(".error-message");if(I)I.style.opacity="0"}}}}),sp.jsx("div",{style:{position:"absolute",zIndex:f?md.errorOverlay+10:md.errorOverlay+1,left:x.left,top:x.top,color:f?"#ff4444":"red",textAlign:"center",fontFamily:"sans-serif",fontSize:12,display:"flex",flexDirection:"column",alignItems:"center",pointerEvents:"none",transform:x.transform},children:sp.jsx("div",{className:`error-message ${pgt}`,style:{opacity:f?1:0,border:`1px solid ${f?"#ff4444":"red"}`},children:m.message})})]},g)}),h.map((m,A)=>{let g=m.component_name||m.message?.match(/name "([^"]+)"/)?.[1];if(!g)return null;let f=n?.filter((C)=>C.type==="source_component"&&C.name===g||C.type==="pcb_component"&&n?.find((b)=>b.type==="source_component"&&b.source_component_id===C.source_component_id&&b.name===g))||[],y=Sne(m,A),x=a===y;if(!x&&!r)return null;return f.map((C,b)=>{let I={x:0,y:0};if(C.type==="pcb_component")I=C.center||{x:0,y:0};else if(C.type==="source_component"){let L=n?.find((H)=>H.type==="pcb_component"&&H.source_component_id===C.source_component_id);if(L&&L.type==="pcb_component")I=L.center||{x:0,y:0}}let v=fo(t,I);if(Number.isNaN(v.x)||Number.isNaN(v.y))return null;let P=Math.abs(t.a),N=Math.max(8,Math.min(30,0.5*P)),D=ugt(v,o);return sp.jsxs(Ene.Fragment,{children:[sp.jsx("svg",{style:{position:"absolute",left:0,top:0,pointerEvents:"none",mixBlendMode:"difference",zIndex:md.errorOverlay},width:"100%",height:"100%",children:x?sp.jsx("polygon",{points:`${v.x},${v.y-N*1.25} ${v.x+N},${v.y} ${v.x},${v.y+N*1.25} ${v.x-N},${v.y}`,fill:"#ff4444"}):sp.jsx("circle",{cx:v.x,cy:v.y,r:N,fill:"none",stroke:x?"#ff4444":"red",strokeWidth:x?Math.max(2,N*0.15):Math.max(1,N*0.1),opacity:1})}),sp.jsx("div",{style:{position:"absolute",left:v.x-(N+10),top:v.y-(N+10),width:(N+10)*2,height:(N+10)*2,zIndex:md.errorOverlay+5,cursor:"pointer",borderRadius:"50%"},onMouseEnter:(L)=>{let H=L.currentTarget.nextElementSibling;if(H){let V=H.querySelector(".error-message");if(V)V.style.opacity="1"}},onMouseLeave:(L)=>{if(!x){let H=L.currentTarget.nextElementSibling;if(H){let V=H.querySelector(".error-message");if(V)V.style.opacity="0"}}}}),sp.jsx("div",{style:{position:"absolute",zIndex:x?md.errorOverlay+20:md.errorOverlay+10,left:D.left,top:D.top,color:x?"#ff4444":"red",textAlign:"center",fontFamily:"sans-serif",fontSize:12,display:r||x?"flex":"none",flexDirection:"column",alignItems:"center",pointerEvents:"none",transform:D.transform},children:sp.jsx("div",{className:`error-message ${pgt}`,style:{opacity:x?1:0,border:`1px solid ${x?"#ff4444":"red"}`},children:m.message})})]},`${y}_${b}`)})}),p&&sp.jsx(fss,{center:p})]})};function xss(e,t){if(e.size!==t.size)return!1;return Array.from(e).every((n)=>t.has(n))}var PH=(e)=>e?.type==="pcb_component",x0o=(e)=>e?.type==="pcb_group",Css=(e)=>e?.type==="pcb_panel",Mgt=(e)=>e?.type==="pcb_board",Zu={GROUP_PADDING:1,MIN_LINE_LENGTH_FOR_LABEL:40,LABEL_OFFSET_ABOVE:2,LABEL_OFFSET_BELOW:-18,LABEL_OFFSET_RIGHT:8,LABEL_OFFSET_LEFT:-120,Y_LABEL_MIN_WIDTH:110,LINE_STROKE_WIDTH:1.5,LINE_DASH_PATTERN:"4,4",COMPONENT_MARKER_RADIUS:3,LABEL_FONT_SIZE:11,ANCHOR_MARKER_SIZE:6,ANCHOR_MARKER_STROKE_WIDTH:1.5},xC={OFFSET_LINE:"white",COMPONENT_MARKER_FILL:"#66ccff",COMPONENT_MARKER_STROKE:"white",LABEL_TEXT:"white"},Ugt=({targets:e,transform:t,containerWidth:n,containerHeight:o})=>{if(e.length===0)return null;let r={color:xC.LABEL_TEXT,mixBlendMode:"difference",pointerEvents:"none",fontSize:Zu.LABEL_FONT_SIZE,fontFamily:"monospace",fontWeight:"bold"},i=new Map;return e.forEach((s)=>{if(!i.has(s.anchor_id)){let a=fo(t,s.anchor);i.set(s.anchor_id,a)}}),lg.jsx("div",{style:{position:"absolute",left:0,top:0,width:n,height:o,overflow:"hidden",pointerEvents:"none",zIndex:md.dimensionOverlay},children:lg.jsxs("svg",{style:{position:"absolute",left:0,top:0,pointerEvents:"none"},width:n,height:o,children:[e.map((s)=>{let{anchor:a,anchor_id:c,target:l}=s,h=i.get(c),d=fo(t,l),u=l.x-a.x,_=l.y-a.y,p=Math.abs(d.x-h.x),m=Math.abs(d.y-h.y),A=d.y<h.y,g=d.x>h.x,f=A?Zu.LABEL_OFFSET_ABOVE:Zu.LABEL_OFFSET_BELOW,y=g?Zu.LABEL_OFFSET_RIGHT:Zu.LABEL_OFFSET_LEFT,x=p>Zu.MIN_LINE_LENGTH_FOR_LABEL,C=m>Zu.MIN_LINE_LENGTH_FOR_LABEL,b=`${s.display_offset_x??u.toFixed(2)}mm`,I=`${s.display_offset_y??_.toFixed(2)}mm`;return lg.jsxs("g",{children:[lg.jsx("line",{x1:h.x,y1:h.y,x2:d.x,y2:h.y,stroke:xC.OFFSET_LINE,strokeWidth:Zu.LINE_STROKE_WIDTH,strokeDasharray:Zu.LINE_DASH_PATTERN}),lg.jsx("line",{x1:d.x,y1:h.y,x2:d.x,y2:d.y,stroke:xC.OFFSET_LINE,strokeWidth:Zu.LINE_STROKE_WIDTH,strokeDasharray:Zu.LINE_DASH_PATTERN}),s.type==="component"||s.type==="board"?lg.jsx("circle",{cx:d.x,cy:d.y,r:Zu.COMPONENT_MARKER_RADIUS,fill:xC.COMPONENT_MARKER_FILL,stroke:xC.COMPONENT_MARKER_STROKE,strokeWidth:1}):lg.jsxs(lg.Fragment,{children:[lg.jsx("line",{x1:d.x-Zu.ANCHOR_MARKER_SIZE,y1:d.y,x2:d.x+Zu.ANCHOR_MARKER_SIZE,y2:d.y,stroke:xC.OFFSET_LINE,strokeWidth:Zu.ANCHOR_MARKER_STROKE_WIDTH}),lg.jsx("line",{x1:d.x,y1:d.y-Zu.ANCHOR_MARKER_SIZE,x2:d.x,y2:d.y+Zu.ANCHOR_MARKER_SIZE,stroke:xC.OFFSET_LINE,strokeWidth:Zu.ANCHOR_MARKER_STROKE_WIDTH})]}),x&&lg.jsx("foreignObject",{x:Math.min(h.x,d.x),y:h.y+f,width:Math.abs(d.x-h.x),height:20,style:{overflow:"visible"},children:lg.jsx("div",{style:{...r,textAlign:"center"},children:b})}),C&&lg.jsx("foreignObject",{x:d.x+y,y:Math.min(h.y,d.y),width:Zu.Y_LABEL_MIN_WIDTH,height:Math.abs(d.y-h.y),style:{overflow:"visible"},children:lg.jsx("div",{style:{...r,display:"flex",alignItems:"center",justifyContent:g?"flex-start":"flex-end",whiteSpace:"nowrap",padding:"0 4px",height:"100%"},children:I})})]},s.id)}),Array.from(i.entries()).map(([s,a])=>lg.jsxs("g",{children:[lg.jsx("line",{x1:a.x-Zu.ANCHOR_MARKER_SIZE,y1:a.y,x2:a.x+Zu.ANCHOR_MARKER_SIZE,y2:a.y,stroke:xC.OFFSET_LINE,strokeWidth:Zu.ANCHOR_MARKER_STROKE_WIDTH}),lg.jsx("line",{x1:a.x,y1:a.y-Zu.ANCHOR_MARKER_SIZE,x2:a.x,y2:a.y+Zu.ANCHOR_MARKER_SIZE,stroke:xC.OFFSET_LINE,strokeWidth:Zu.ANCHOR_MARKER_STROKE_WIDTH})]},`anchor-${s}`))]})})},bss=({elements:e,highlightedPrimitives:t,transform:n,containerWidth:o,containerHeight:r})=>{let i=e.filter((g)=>Mgt(g)),s=e.filter((g)=>PH(g)),a=e.filter((g)=>x0o(g)),c=t.map((g)=>{if(PH(g._parent_pcb_component))return g._parent_pcb_component.pcb_component_id;if(PH(g._element))return g._element.pcb_component_id;return null}).filter((g)=>Boolean(g)),l=new Set;if(c.forEach((g)=>{let f=s.find((y)=>y.pcb_component_id===g);if(f?.pcb_group_id)l.add(f.pcb_group_id)}),!Qa((g)=>g.is_showing_group_anchor_offsets)&&c.length===0)return null;let d=s.map((g)=>{let f=g.positioned_relative_to_pcb_board_id;if(!f)return null;let y=i.find((x)=>x.pcb_board_id===f);return y?{component:g,board:y,type:"component"}:null}).filter((g)=>Boolean(g)),u=a.map((g)=>{let f=g.positioned_relative_to_pcb_board_id;if(!f||!g.center)return null;let y=i.find((x)=>x.pcb_board_id===f);return y?{group:g,board:y,type:"group"}:null}).filter((g)=>Boolean(g)),_=[...d,...u];if(_.length===0)return null;let p=c.length===0,m=_.filter((g)=>{if(g.type==="component")return p||c.includes(g.component.pcb_component_id);else return p||l.has(g.group.pcb_group_id)});if(m.length===0)return null;let A=m.map((g)=>{if(g.type==="component")return{id:`${g.board.pcb_board_id}-${g.component.pcb_component_id}-${g.type}`,anchor:g.board.center,anchor_id:g.board.pcb_board_id,target:g.component.center,type:"component",display_offset_x:g.component.display_offset_x,display_offset_y:g.component.display_offset_y};return{id:`${g.board.pcb_board_id}-${g.group.pcb_group_id}-${g.type}`,anchor:g.board.center,anchor_id:g.board.pcb_board_id,target:{x:g.group.anchor_position?.x??g.group.center.x,y:g.group.anchor_position?.y??g.group.center.y},type:"group",display_offset_x:g.group.display_offset_x,display_offset_y:g.group.display_offset_y}}).filter((g)=>Boolean(g));return C0o.jsx(Ugt,{targets:A,transform:n,containerWidth:o,containerHeight:r})},Iss=({elements:e,highlightedPrimitives:t,transform:n,containerWidth:o,containerHeight:r})=>{let i=e.filter((g)=>x0o(g)),s=e.filter((g)=>PH(g)),a=t.map((g)=>{if(PH(g._parent_pcb_component))return g._parent_pcb_component.pcb_component_id;if(PH(g._element))return g._element.pcb_component_id;return null}).filter((g)=>Boolean(g)),c=(g,f)=>{if(f.has(g))return;f.add(g);let y=i.find((x)=>x.pcb_group_id===g);if(y?.position_mode==="relative_to_group_anchor"&&y.positioned_relative_to_pcb_group_id)c(y.positioned_relative_to_pcb_group_id,f)},l=new Set;if(a.forEach((g)=>{let f=s.find((y)=>y.pcb_component_id===g);if(!f)return;if(f.position_mode==="relative_to_group_anchor"&&f.positioned_relative_to_pcb_group_id)c(f.positioned_relative_to_pcb_group_id,l);if(f.pcb_group_id)c(f.pcb_group_id,l)}),!Qa((g)=>g.is_showing_group_anchor_offsets)&&a.length===0)return null;let d=s.map((g)=>{if(g.position_mode==="relative_to_group_anchor"&&g.positioned_relative_to_pcb_group_id){let f=i.find((y)=>y.pcb_group_id===g.positioned_relative_to_pcb_group_id);return f&&f.anchor_position?{component:g,parentGroup:f,type:"component"}:null}if(g.pcb_group_id){let f=i.find((y)=>y.pcb_group_id===g.pcb_group_id);return f&&f.anchor_position?{component:g,parentGroup:f,type:"component"}:null}return null}).filter((g)=>Boolean(g)),u=i.map((g)=>{if(g.position_mode==="relative_to_group_anchor"&&g.positioned_relative_to_pcb_group_id){let f=i.find((y)=>y.pcb_group_id===g.positioned_relative_to_pcb_group_id);if(f&&f.anchor_position&&g.anchor_position)return{group:g,parentGroup:f,type:"group"}}return null}).filter((g)=>Boolean(g)),_=[...d,...u];if(_.length===0)return null;let p=a.length===0,m=_.filter((g)=>{if(g.type==="component")return p||a.includes(g.component.pcb_component_id);else return p||l.has(g.group.pcb_group_id)||l.has(g.parentGroup.pcb_group_id)});if(m.length===0)return null;let A=m.map((g)=>{let f=g.parentGroup.anchor_position;if(!f)return null;if(g.type==="component"){if(!g.component.center)return null;return{id:`${g.parentGroup.pcb_group_id}-${g.component.pcb_component_id}-${g.type}`,anchor:f,anchor_id:g.parentGroup.pcb_group_id,target:g.component.center,type:"component",display_offset_x:g.component.display_offset_x,display_offset_y:g.component.display_offset_y}}if(!g.group.anchor_position)return null;return{id:`${g.parentGroup.pcb_group_id}-${g.group.pcb_group_id}-${g.type}`,anchor:f,anchor_id:g.parentGroup.pcb_group_id,target:g.group.anchor_position,type:"group",display_offset_x:g.group.display_offset_x,display_offset_y:g.group.display_offset_y}}).filter((g)=>Boolean(g));return b0o.jsx(Ugt,{targets:A,transform:n,containerWidth:o,containerHeight:r})},vss=(e,t)=>{let n=e.pcb_component_id,o=t.filter((r)=>(r.type==="pcb_smtpad"||r.type==="pcb_plated_hole")&&r.pcb_component_id===n||r.type==="pcb_hole"&&r.pcb_component_id===n);if(o.length===0)return Sgt([e]);return Sgt(o)},Sss=({elements:e,highlightedPrimitives:t,transform:n,containerWidth:o,containerHeight:r})=>{let i=new Map;for(let a of t){if(PH(a._parent_pcb_component))i.set(a._parent_pcb_component.pcb_component_id,a._parent_pcb_component);if(PH(a._element))i.set(a._element.pcb_component_id,a._element)}if(i.size===0)return null;let s=[];for(let a of i.values()){let c=vss(a,e);if(!c)continue;let l=a.positioned_relative_to_pcb_group_id??a.pcb_group_id,h=l?eD(e).pcb_group.get(l):null;s.push({component:a,bbox:c,group:h})}if(s.length===0)return null;return JT.jsx("div",{style:{position:"absolute",left:0,top:0,width:o,height:r,overflow:"hidden",pointerEvents:"none",zIndex:md.dimensionOverlay},children:JT.jsx("svg",{style:{position:"absolute",left:0,top:0,pointerEvents:"none"},width:o,height:r,children:s.map(({component:a,bbox:c,group:l})=>{let h=fo(n,{x:c.minX,y:c.maxY}),d=fo(n,{x:c.maxX,y:c.minY}),u={x:Math.min(h.x,d.x),y:Math.min(h.y,d.y),width:Math.abs(d.x-h.x),height:Math.abs(d.y-h.y)},_=a.center??{x:(c.minX+c.maxX)/2,y:(c.minY+c.maxY)/2},p=fo(n,_);return JT.jsxs("g",{children:[JT.jsx("rect",{x:u.x,y:u.y,width:u.width,height:u.height,fill:"none",stroke:"white",strokeWidth:1.5,strokeDasharray:"4,4"}),JT.jsx("line",{x1:p.x-6,y1:p.y,x2:p.x+6,y2:p.y,stroke:xC.COMPONENT_MARKER_STROKE,strokeWidth:1.5}),JT.jsx("line",{x1:p.x,y1:p.y-6,x2:p.x,y2:p.y+6,stroke:xC.COMPONENT_MARKER_STROKE,strokeWidth:1.5}),JT.jsx("circle",{cx:p.x,cy:p.y,r:Zu.COMPONENT_MARKER_RADIUS,fill:xC.COMPONENT_MARKER_FILL,stroke:xC.COMPONENT_MARKER_STROKE,strokeWidth:1})]},a.pcb_component_id)})})})},Pss=({elements:e,highlightedPrimitives:t,transform:n,containerWidth:o,containerHeight:r})=>{let i=e.filter((_)=>Css(_)),s=e.filter((_)=>Mgt(_)),a=t.map((_)=>{if(Mgt(_._element))return _._element.pcb_board_id;return null}).filter((_)=>Boolean(_));if(!Qa((_)=>_.is_showing_group_anchor_offsets)&&a.length===0)return null;let l=s.map((_)=>{let{pcb_panel_id:p,position_mode:m}=_;if(!p||m!=="relative_to_panel_anchor")return null;let A=i.find((g)=>g.pcb_panel_id===p);return A?{board:_,panel:A,type:"board"}:null}).filter((_)=>Boolean(_));if(l.length===0)return null;let h=a.length===0,d=l.filter((_)=>h||a.includes(_.board.pcb_board_id));if(d.length===0)return null;let u=d.map((_)=>{if(!_.board.center)return null;return{id:`${_.panel.pcb_panel_id}-${_.board.pcb_board_id}-${_.type}`,anchor:_.panel.center,anchor_id:_.panel.pcb_panel_id,target:_.board.center,type:"board",display_offset_x:_.board.display_offset_x,display_offset_y:_.board.display_offset_y}}).filter((_)=>Boolean(_));return I0o.jsx(Ugt,{targets:u,transform:n,containerWidth:o,containerHeight:r})};function Ess(e){let{primitives:t,is_showing_multiple_traces_length:n,elements:o}=e,r=t.filter((c)=>c._element.type==="pcb_trace"),i=o.filter((c)=>c.type==="source_trace"),s=t.filter((c)=>c._element.type!=="pcb_trace"),a=r.filter((c)=>i.some((h)=>c._element.source_trace_id===h.source_trace_id&&h.max_length!==void 0)||Ggt({primitiveElement:c._element,elements:o})!==null);if(!n)return[...s,...a];if(r.length>1){let c=r.reduce((l,h)=>{let d=l._element.trace_length;return h._element.trace_length<d?h:l},r[0]);return[...s,c]}return t}var Mss={position:"absolute",left:0,top:0,pointerEvents:"none",color:"red",fontFamily:"sans-serif",fontSize:12,textShadow:"0 0 2px black"},wss=(e)=>{let{_element:t,_parent_pcb_component:n,_parent_source_component:o,_source_port:r}=e;switch(t.type){case"pcb_trace":{if(t.trace_length)return`${t.trace_length.toFixed(3)}`;return""}case"pcb_smtpad":case"pcb_plated_hole":{let i=[],s=Array.from(new Set((t.port_hints??[]).concat(r?.port_hints??[]))).filter((c)=>!/^[0-9]+$/.test(c)).filter((c)=>!c.includes("unnamed_")).sort((c,l)=>l.localeCompare(c)),a=o&&"name"in o&&o.name&&!o.name.includes("unnamed_")?o.name:null;if(s.length>0)if(a)i.push(...s.map((c)=>`${a}.${c}`));else i.push(...s);else if(a)i.push(a);return i.join(", ")}default:return""}},Bss={top:"red",bottom:"aqua"},Tss=({primitive:e,mousePos:t,elements:n})=>{let[o,r]=RTe.useState(!1),i=e._element;RTe.useEffect(()=>{setTimeout(()=>{r(!0)},100)},[]);let[s,a,c,l]=[e.screen_x,e.screen_y,e.screen_w,e.screen_h],h=e.same_space_index??0,d=26,u=Bss[e?._element?.layer]??"red",_=0;if(i.type==="pcb_smtpad"&&i?.shape==="rotated_rect")_=i?.ccw_rotation??0;else if(i.type==="pcb_smtpad"&&(i?.shape==="pill"||i?.shape==="rotated_pill")&&"ccw_rotation"in e)_=i.ccw_rotation??0;else if(i.type==="pcb_plated_hole"&&(i?.shape==="pill"||i?.shape==="oval")&&"ccw_rotation"in e)_=i.ccw_rotation??0;if(i.type==="pcb_trace"){let A=e0o({primitiveElement:i,elements:n});if(!A)return null;return t8.jsx("div",{style:{zIndex:md.elementOverlay,position:"absolute",left:t.x+12,top:t.y+12,color:u,pointerEvents:"none"},children:t8.jsxs("div",{style:{backgroundColor:"#f2efcc",color:A.isOverLength?"red":"black",textShadow:"none",WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",padding:"4px 6px",borderRadius:"4px",fontSize:"11px",lineHeight:1.2,textAlign:"left",whiteSpace:"nowrap"},children:[A.text&&t8.jsx("div",{children:A.text}),A.name&&t8.jsx("div",{style:{marginTop:A.text?"2px":0},children:A.name})]})})}let p=wss(e);if(p.trim().length===0)return null;return t8.jsx("div",{style:{zIndex:md.elementOverlay,position:"absolute",left:s-c/2-8,top:a-l/2-8,width:c+16,height:l+16,color:u,transform:`rotate(${-_}deg)`,transformOrigin:"center center"},children:t8.jsx("div",{style:{width:o?`calc(100% + ${d*2*h}px)`:"100%",height:o?`calc(100% + ${d*2*h}px)`:"100%",marginLeft:o?`${-d*h}px`:0,marginTop:o?`${-d*h}px`:0,border:`1px solid ${u}`,opacity:o?1:h===0?1:0,transition:"width 0.2s, height 0.2s, margin-left 0.2s, margin-top 0.2s, opacity 0.2s"},children:t8.jsx("div",{style:{position:"absolute",bottom:l+20+d*h,marginRight:o?`${-d*h}px`:0,marginBottom:o?0:-d*h,transition:"margin-right 0.2s, margin-bottom 0.2s",backgroundColor:"#f2efcc",color:"black",textShadow:"none",WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",padding:"6px 6px",borderRadius:"6px",fontSize:"14px",transform:`rotate(${_}deg)`,minWidth:"45px",textAlign:"center"},children:p})})})},Dss=({highlightedPrimitives:e,mousePos:t,elements:n})=>{let[o,r]=Qa((a)=>[a.is_moving_component,a.is_showing_multiple_traces_length]),i=e.some((a)=>a._element.type==="pcb_smtpad")&&e.some((a)=>a._element.type==="pcb_trace"),s=e;if(i)s=s.filter((a)=>a._element.type==="pcb_smtpad");return s=Ess({primitives:s,is_showing_multiple_traces_length:r,elements:n}),t8.jsx("div",{style:Mss,children:!o&&s.map((a)=>t8.jsx(Tss,{primitive:a,mousePos:t,elements:n},a._pcb_drawing_object_id))})},CTe=(e)=>{if(e.length===0)return null;let t=e[0].x,n=e[0].y,o=e[0].x,r=e[0].y;for(let i of e){if(i.x<t)t=i.x;if(i.y<n)n=i.y;if(i.x>o)o=i.x;if(i.y>r)r=i.y}return{center:{x:(t+o)/2,y:(n+r)/2},width:o-t,height:r-n}},Wdo=(e,t)=>{if(t.length<3)return!1;let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o].x,s=t[o].y,a=t[r].x,c=t[r].y;if(s>e.y!==c>e.y&&e.x<(a-i)*(e.y-s)/(c-s||Number.EPSILON)+i)n=!n}return n},wgt=(e,t,n,o,r=!1)=>{let i=[];for(let s of e){if(!s._element)continue;if(!r&&s._element.type==="pcb_trace"&&s.layer!==o)continue;if("x1"in s&&s._element?.type==="pcb_trace"){let l=ga({x:t.x,y:t.y},{x:s.x1,y:s.y1},{x:s.x2,y:s.y2}),h=s.width||0.5,d=Math.max(h*25,2)/n.a;if(l<d)i.push(s);continue}if(s.pcb_drawing_type==="polygon"){let l=s.points.map((d)=>({x:En.parse(d.x),y:En.parse(d.y)})),h=CTe(l);if(!h)continue;if(t.x<h.center.x-h.width/2||t.x>h.center.x+h.width/2||t.y<h.center.y-h.height/2||t.y>h.center.y+h.height/2)continue;if(Wdo(t,l))i.push(s);continue}if(s.pcb_drawing_type==="polygon_with_arcs"){let l=s.brep_shape.outer_ring.vertices.map((d)=>({x:En.parse(d.x),y:En.parse(d.y)})),h=CTe(l);if(!h)continue;if(t.x<h.center.x-h.width/2||t.x>h.center.x+h.width/2||t.y<h.center.y-h.height/2||t.y>h.center.y+h.height/2)continue;if(Wdo(t,l))i.push(s);continue}if(!(("x"in s)&&("y"in s)))continue;let a=0,c=0;if("w"in s&&"h"in s)a=s.w,c=s.h;else if("r"in s)a=s.r*2,c=s.r*2;else if("rX"in s&&"rY"in s)a=s.rX*2,c=s.rY*2;else continue;if(Math.abs(s.x-t.x)<a/2&&Math.abs(s.y-t.y)<c/2)i.push(s)}return i},Nss=({elements:e,children:t,transform:n,primitives:o,selectedLayer:r,onMouseHoverOverPrimitives:i})=>{let[s,a]=TU.useState([]),[c,l]=TU.useState({x:0,y:0}),[h,{width:d,height:u}]=Kme();TU.useEffect(()=>{a([]),i([])},[r,o,i]);let _=TU.useMemo(()=>{let m=[];for(let A of s){if(A._element?.type==="pcb_via")continue;if(A._element?.type==="pcb_component")continue;if(A?.layer==="drill")continue;if(A?.is_hoverable===!1)continue;let g=null,f=0,y=0;if(A.pcb_drawing_type==="polygon"){let I=CTe(A.points);if(!I)continue;g=I.center,f=I.width,y=I.height}else if(A.pcb_drawing_type==="polygon_with_arcs"){let I=A.brep_shape.outer_ring.vertices.map((P)=>({x:P.x,y:P.y})),v=CTe(I);if(!v)continue;g=v.center,f=v.width,y=v.height}else if(A.pcb_drawing_type==="line")g={x:(A.x1+A.x2)/2,y:(A.y1+A.y2)/2},f=Math.abs(A.x2-A.x1),y=Math.abs(A.y2-A.y1);else if("x"in A&&"y"in A)g={x:A.x,y:A.y},f="w"in A?A.w:("r"in A)?A.r*2:("rX"in A)&&("rY"in A)?A.rX*2:0,y="h"in A?A.h:("r"in A)?A.r*2:("rX"in A)&&("rY"in A)?A.rY*2:0;if(!g)continue;let x=fo(n,g),C={w:f*n.a,h:y*n.a},b=m.filter((I)=>x.x===I.screen_x&&x.y===I.screen_y&&C.w===I.screen_w&&C.h===I.screen_h).length;m.push({...A,x:g.x,y:g.y,w:f,h:y,screen_x:x.x,screen_y:x.y,screen_w:C.w,screen_h:C.h,same_space_index:b})}return m},[s,n]),p=(m,A,g,f)=>{l({x:m,y:A});let y=fo(Cf(g),{x:m,y:A}),x=wgt(f,y,g,r);if(xss(new Set(x.map((C)=>C._pcb_drawing_object_id)),new Set(s.map((C)=>C._pcb_drawing_object_id))))return;a(x),i(x)};return o8.jsxs("div",{ref:h,style:{position:"relative",width:"100%",height:"100%"},onMouseMove:(m)=>{if(n){let A=m.currentTarget.getBoundingClientRect(),g=m.clientX-A.left,f=m.clientY-A.top;p(g,f,n,o)}},onTouchStart:(m)=>{if(n){let A=m.touches[0],g=m.currentTarget.getBoundingClientRect(),f=A.clientX-g.left,y=A.clientY-g.top;p(f,y,n,o)}},children:[t,o8.jsx(Dss,{elements:e,mousePos:c,highlightedPrimitives:_}),n&&o8.jsxs(o8.Fragment,{children:[o8.jsx(bss,{elements:e,highlightedPrimitives:_,transform:n,containerWidth:d,containerHeight:u}),o8.jsx(Iss,{elements:e,highlightedPrimitives:_,transform:n,containerWidth:d,containerHeight:u}),o8.jsx(Sss,{elements:e,highlightedPrimitives:_,transform:n,containerWidth:d,containerHeight:u}),o8.jsx(Pss,{elements:e,highlightedPrimitives:_,transform:n,containerWidth:d,containerHeight:u})]})]})},Xdo=["rgb(255, 100, 100)","rgb(100, 255, 100)","rgb(100, 100, 255)","rgb(255, 255, 100)","rgb(255, 100, 255)","rgb(100, 255, 255)","rgb(255, 150, 100)","rgb(150, 100, 255)","rgb(100, 255, 150)","rgb(255, 100, 150)"],Rss=({children:e,transform:t=xf(),elements:n=[],hoveredComponentIds:o=[]})=>{let[r,{width:i,height:s}]=Kme(),a=QTe.useRef(null),{is_showing_pcb_groups:c,pcb_group_view_mode:l,is_showing_group_anchor_offsets:h}=Qa((d)=>({is_showing_pcb_groups:d.is_showing_pcb_groups,pcb_group_view_mode:d.pcb_group_view_mode,is_showing_group_anchor_offsets:d.is_showing_group_anchor_offsets}));return QTe.useEffect(()=>{let d=a.current;if(!d||!i||!s)return;d.width=i,d.height=s;let u=d.getContext("2d");if(!u)return;if(u.clearRect(0,0,i,s),!c)return;let _=n.filter((b)=>b.type==="pcb_group"),p=n.filter((b)=>b.type==="pcb_component"),m=n.filter((b)=>b.type==="source_group"),A=new Map(m.map((b)=>[b.source_group_id,b])),g=_.filter((b)=>{if(b.name?.toLowerCase().includes("subpanel"))return!1;if(l==="all")return!0;if(!b.source_group_id)return!1;let I=A.get(b.source_group_id);if(!I)return!1;return I.was_automatically_named!==!0}),f=new Map;m.forEach((b)=>{let I=b;if(I.parent_source_group_id){let v=f.get(I.parent_source_group_id)||[];v.push(b.source_group_id),f.set(I.parent_source_group_id,v)}});let y=(b)=>{let I=[],v=f.get(b)||[];for(let P of v)I.push(P),I.push(...y(P));return I},x=(b)=>{let I=m.find((v)=>v.source_group_id===b);if(!I?.parent_source_group_id)return 0;return 1+x(I.parent_source_group_id)},C=new Set;if(o.length>0)for(let b of p){if(!o.includes(b.pcb_component_id))continue;let I=b.positioned_relative_to_pcb_group_id??b.pcb_group_id;if(I)C.add(I)}g.forEach((b,I)=>{let v=p.filter((Me)=>Me.pcb_group_id===b.pcb_group_id);if(b.source_group_id){let Me=y(b.source_group_id),Re=_.filter((we)=>we.source_group_id&&Me.includes(we.source_group_id));for(let we of Re){let _e=p.filter((ye)=>ye.pcb_group_id===we.pcb_group_id);v=[...v,..._e]}}let P,M,B,T,N=!1;if(b.center&&b.width&&b.height){N=!0;let Me=b.width/2,Re=b.height/2;P=b.center.x-Me,B=b.center.x+Me,M=b.center.y-Re,T=b.center.y+Re}else{if(v.length===0)return;if(P=1/0,M=1/0,B=-1/0,T=-1/0,v.forEach((Me)=>{if(Me.center&&typeof Me.width==="number"&&typeof Me.height==="number"){let Re=Me.center.x-Me.width/2,we=Me.center.x+Me.width/2,_e=Me.center.y+Me.height/2,ye=Me.center.y-Me.height/2;P=Math.min(P,Re),B=Math.max(B,we),M=Math.min(M,ye),T=Math.max(T,_e)}}),P===1/0||B===-1/0)return}let D=b.source_group_id?x(b.source_group_id):0,L=b.source_group_id?y(b.source_group_id).length>0:!1;if(!N){let we=1+(L?0.5:0);P-=we,B+=we,M-=we,T+=we}let H=fo(t,{x:P,y:T}),V=fo(t,{x:B,y:T}),O=fo(t,{x:P,y:M}),U=fo(t,{x:B,y:M}),j=Xdo[I%Xdo.length];u.strokeStyle=j,u.lineWidth=2;let Y=Math.max(4,Math.min(12,8*Math.abs(t.a))),X=Math.max(2,Math.min(6,4*Math.abs(t.a))),J=Y*(L?1.3:1),ee=X;u.setLineDash([J,ee]),u.beginPath(),u.moveTo(H.x,H.y),u.lineTo(V.x,V.y),u.lineTo(U.x,U.y),u.lineTo(O.x,O.y),u.closePath(),u.stroke();let se=Math.max(8,Math.min(12,10*Math.abs(t.a))),ne=D==0||D==1?0:D*0.11,re=se*(1-ne),Z=4,te=b.name||`Group ${I+1}`;u.font=`${re}px sans-serif`,u.setLineDash([]);let le=u.measureText(te).width+Z*2,ue=re+Z*2,de=H.x-5,me=H.y-5,Ae=3;if(u.fillStyle="rgba(0, 0, 0, 0.8)",u.beginPath(),u.roundRect(de,me-ue,le,ue,Ae),u.fill(),u.fillStyle=j,u.textAlign="left",u.textBaseline="middle",u.fillText(te,de+Z,me-ue/2),h&&C.has(b.pcb_group_id)&&Boolean(b.anchor_position)&&b.anchor_position){let Me=Array.isArray(b.anchor_position)?{x:b.anchor_position[0]??0,y:b.anchor_position[1]??0}:{x:b.anchor_position.x,y:b.anchor_position.y},Re=fo(t,Me);u.strokeStyle="white",u.lineWidth=1.5,u.setLineDash([]);let we=Math.max(4,Math.min(8,6*Math.abs(t.a)));u.beginPath(),u.moveTo(Re.x-we,Re.y),u.lineTo(Re.x+we,Re.y),u.stroke(),u.beginPath(),u.moveTo(Re.x,Re.y-we),u.lineTo(Re.x,Re.y+we),u.stroke()}})},[n,t,i,s,c,l,h,o]),kTe.jsxs("div",{ref:r,style:{position:"relative",width:"100%",height:"100%"},children:[e,kTe.jsx("canvas",{ref:a,style:{position:"absolute",top:0,left:0,pointerEvents:"none",zIndex:md.pcbGroupOverlay,display:c?"block":"none"}})]})};var Qss=({transform:e,soup:t,children:n})=>{let o=Qa((a)=>a.is_showing_rats_nest),{netMap:r,idToNetMap:i}=Bgt.useMemo(()=>Kuo(t||[]),[t]),s=Bgt.useMemo(()=>{if(!t||!o)return[];let a=(u)=>{let _=eD(t)[u.replace(/_\d+$/,"")].get(u);if(_&&"x"in _&&"y"in _)return{x:_.x,y:_.y};return null},c=(u,_)=>{let p=r[_]||[],m=null,A=1/0;return p.forEach((g)=>{let f=a(g);if(f){let y=Math.sqrt((u.x-f.x)**2+(u.y-f.y)**2);if(y<A&&y>0)A=y,m=f}}),m},l=eD(t).pcb_port.list(),h=eD(t).source_trace.list(),d=[];return l.forEach((u,_)=>{let p=i[u.pcb_port_id],m=!1;for(let f of h)if(f.connected_source_port_ids.includes(u.source_port_id)&&f.connected_source_net_ids.length>0)m=!0;if(!p)return;let A={x:u.x,y:u.y},g=c(A,p);if(!g)return;d.push({key:`${u.pcb_port_id}-${_}`,startPoint:A,endPoint:g,isInNet:m})}),d},[t,r,i,o]);if(!t||!o)return n;if(!e)e=xf();return Vme.jsxs("div",{style:{position:"relative"},children:[n,Vme.jsx("svg",{style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",pointerEvents:"none",opacity:0.5,zIndex:md.ratsNestOverlay},children:s.map(({key:a,startPoint:c,endPoint:l,isInNet:h})=>{let d=fo(e,c),u=fo(e,l);return Vme.jsx("line",{x1:d.x,y1:d.y,x2:u.x,y2:u.y,stroke:"white",strokeWidth:"1",strokeDasharray:h?"6,6":void 0},a)})})]})},kss={name:"@tscircuit/pcb-viewer",version:"1.11.428",main:"dist/index.js",type:"module",repository:{type:"git",url:"https://github.com/tscircuit/pcb-viewer"},license:"MIT",scripts:{start:"cosmos",build:"tsup ./src/index.tsx --platform browser --dts --sourcemap --format esm --outDir dist",yalc:"npm run build && yalc push",format:"biome format . --write","format:check":"biome format .",cosmos:"cosmos","cosmos-export":"cosmos-export","test:copper-pour-x-ray":"bun run build && bun tests/copper-pour-x-ray/run.ts","test:x-ray-net":"bun run build && bun tests/x-ray-net/run.ts","test:component-focus":"bun run build && bun tests/component-focus/run.ts","test:measurement-context-menu":"bun run build && bun tests/measurement-context-menu/run.ts","test:copper-pour-opacity":"bun run build && bun tests/copper-pour-opacity/run.ts","test:webgpu":"bun run build && bun tests/webgpu/run.ts"},files:["dist"],devDependencies:{"@biomejs/biome":"^1.9.4","@semantic-release/commit-analyzer":"^9.0.2","@semantic-release/git":"^10.0.1","@semantic-release/npm":"^9.0.1","@semantic-release/release-notes-generator":"^10.0.3","@swc/core":"^1.4.12","@tscircuit/circuit-json-util":"^0.0.120","@tscircuit/circuit-json-webgpu":"github:tscircuit/circuit-json-webgpu#08f8a79c88d42ae8816905e33b63a801f25a23cb","@tscircuit/core":"^0.0.1701","@tscircuit/eagle-xml-converter":"^1.0.0","@types/bun":"latest","@types/color":"^3.0.6","@types/node":"18.7.23","@types/react":"19","@types/react-dom":"~19.1.0","@webgpu/types":"^0.1.72","circuit-json-to-connectivity-map":"^0.0.35",esbuild:"^0.25.2","format-si-unit":"^0.0.12",next:"^14.1.4","pixi.js":"^8.6.6",playwright:"1.63.0",react:"19.1.0","react-cosmos":"7.0.0-beta.4","react-cosmos-plugin-vite":"7.0.0-beta.0","react-dom":"19.1.0","react-use":"^17.4.0",tscircuit:"^0.0.2354",tsup:"^8.0.2","type-fest":"^3.0.0",typescript:"^5.4.4","use-mouse-matrix-transform":"^1.3.4",zod:"^3.23.5"},peerDependencies:{react:"*","react-dom":"*"},dependencies:{"@emotion/css":"^11.11.2","@tscircuit/alphabet":"^0.0.25","@tscircuit/math-utils":"^0.0.36","@vitejs/plugin-react":"^5.0.2","circuit-json":"^0.0.518","circuit-to-canvas":"0.0.135",color:"^4.2.3","react-supergrid":"^1.0.10","react-toastify":"^10.0.5","transformation-matrix":"^2.13.0",zustand:"^4.5.2"}},RE=(e,t,n)=>{let o=Qa((s)=>s.is_mouse_over_container),r=MU.useRef(o),i=MU.useRef(t);MU.useEffect(()=>{r.current=o},[o]),MU.useEffect(()=>{i.current=t},[t]),MU.useEffect(()=>{if(!e)return;let s=(a)=>{let c=a.target;if(c.tagName==="INPUT"||c.tagName==="TEXTAREA"||c.isContentEditable)return;let l=e.split("+"),h=l.includes("ctrl"),d=l.includes("shift"),u=l.includes("alt"),_=l.includes("meta"),p=l[l.length-1],m=n?.current?n.current.contains(document.activeElement)||document.activeElement===n.current:!1;if((r.current||m)&&(!h||a.ctrlKey)&&(!d||a.shiftKey)&&(!u||a.altKey)&&(!_||a.metaKey)&&a.key.toLowerCase()===p.toLowerCase())a.preventDefault(),i.current()};return window.addEventListener("keydown",s),()=>{window.removeEventListener("keydown",s)}},[e])},Lss=()=>{let[e,t]=LTe.useState(!1);return LTe.useEffect(()=>{let n=()=>{t(window.innerWidth<=768)};return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]),e},qme=(e,t={stopPropagation:!0})=>{let n=Yme.useRef(0),o=Yme.useCallback((s)=>{if(t.stopPropagation)s.stopPropagation();let a=Date.now();if(a-n.current<300)return;n.current=a,e?.(s)},[e,t.stopPropagation]),r=Yme.useCallback((s)=>{s.preventDefault(),o(s)},[o]);return{onClick:o,onTouchEnd:r,style:{touchAction:"manipulation"}}},Tme=$T`
  background: #222;
  color: #eee;
  border: 1px solid #555;
  border-radius: 4px;
  padding: 4px;
  font: 12px sans-serif;
  box-shadow: 0 4px 16px #0008;
  outline: none;
`,eI=$T`
  display: block;
  width: 100%;
  padding: 8px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  &:hover, &:focus-visible { background: #444; }
`,Hss=({component:e,onViewSchematicComponent:t,position:n,onClose:o,onXRayNet:r,xRayGroups:i=[],onXRayGroup:s,xRayDisplayName:a="Net",onExitXRayNet:c})=>{let l=qts(),[h,d]=ZT.useState(!1),u=Qa((N)=>N.hidden_layer_opacity),_=Qa((N)=>N.setHiddenLayerOpacity),p=Qa((N)=>N.copper_pour_opacity),m=Qa((N)=>N.setCopperPourOpacity),A=Qa((N)=>N.is_showing_copper_pours),g=Qa((N)=>N.setIsShowingCopperPours),[f,y]=ZT.useState(!1),x=A?p:0,[C,b]=ZT.useState(!1),[I,v]=ZT.useState(!1),P=ZT.useRef(null),M=window.innerWidth<480,B=!M&&n.x+460>window.innerWidth,T=M?{position:"relative"}:{position:"absolute",top:0,...B?{right:"100%"}:{left:"100%"}};return ZT.useEffect(()=>{let N=(L)=>{if(!P.current?.contains(L.target))L.preventDefault(),o()},D=(L)=>{if(L.key==="Escape")L.preventDefault(),o()};return P.current?.focus(),window.addEventListener("pointerdown",N,!0),window.addEventListener("keydown",D),window.addEventListener("resize",o),window.addEventListener("scroll",o,!0),()=>{window.removeEventListener("pointerdown",N,!0),window.removeEventListener("keydown",D),window.removeEventListener("resize",o),window.removeEventListener("scroll",o,!0)}},[o]),v0o.createPortal(Ld.jsxs("div",{ref:P,role:"menu",tabIndex:-1,"aria-label":"PCB context menu",className:Tme,onContextMenu:(N)=>{N.preventDefault(),N.stopPropagation()},onPointerDown:(N)=>N.stopPropagation(),onMouseDown:(N)=>N.stopPropagation(),onClick:(N)=>N.stopPropagation(),onKeyDown:(N)=>{N.stopPropagation();let D=N.target.closest("button"),L=D?.closest('[role="menu"]')??P.current;if(!L)return;let H=Array.from(L.querySelectorAll("button:not(:disabled)")).filter((V)=>V.closest('[role="menu"]')===L);if(N.key==="ArrowDown"||N.key==="ArrowUp"){N.preventDefault();let V=N.key==="ArrowDown"?1:-1,O=D?H.indexOf(D):V===1?-1:0;H[(O+V+H.length)%H.length]?.focus()}else if(N.key==="ArrowRight"&&D?.hasAttribute("aria-haspopup"))N.preventDefault(),D.click(),requestAnimationFrame(()=>D.parentElement?.querySelector('[role="menu"] button')?.focus());else if(N.key==="ArrowLeft"){if(N.preventDefault(),L.parentElement?.querySelector(":scope > button")?.focus(),L.getAttribute("aria-label")==="Hidden Layer Visibility")v(!1);else if(L.getAttribute("aria-label")==="Copper Pour Visibility")y(!1);else if(L.getAttribute("aria-label")==="Visibility")b(!1);else if(L.getAttribute("aria-label")==="Rendering Engine")d(!1)}else if(N.key==="Escape")N.preventDefault(),o()},style:{position:"fixed",zIndex:1e4,left:Math.max(B?310:4,Math.min(n.x,window.innerWidth-(M?248:168))),top:Math.max(4,Math.min(n.y,window.innerHeight-(M?340:260))),width:M?230:150,maxHeight:window.innerHeight-8,...M?{overflowY:"auto"}:{}},children:[r&&Ld.jsxs("button",{type:"button",role:"menuitem",className:eI,style:{whiteSpace:"normal",overflowWrap:"anywhere"},onClick:()=>{r(),o()},children:["X-Ray ",a]}),s&&i.map((N)=>Ld.jsxs("button",{type:"button",role:"menuitem",className:eI,style:{whiteSpace:"normal",overflowWrap:"anywhere"},onClick:()=>{s(N),o()},children:["X-Ray ",N.name]},N.id)),c&&Ld.jsx("button",{type:"button",role:"menuitem",className:eI,onClick:()=>{c(),o()},children:"Exit X-Ray Net"}),Ld.jsxs("div",{style:{position:"relative"},onMouseEnter:()=>{b(!0),d(!1)},children:[Ld.jsx("button",{type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded":C,className:eI,onClick:()=>{b(!0),d(!1)},children:"Visibility ▸"}),C&&Ld.jsxs("div",{role:"menu","aria-label":"Visibility",className:Tme,style:T,children:[Ld.jsxs("div",{style:{position:"relative"},onMouseEnter:()=>{v(!0),y(!1)},children:[Ld.jsx("button",{type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded":I,className:eI,onClick:()=>{v(!0),y(!1)},children:"Hidden Layer Visibility ▸"}),I&&Ld.jsx("div",{role:"menu","aria-label":"Hidden Layer Visibility",className:Tme,style:{minWidth:80,...T},children:[0,0.05,0.1,0.2,0.4,0.6,0.8,1].map((N)=>Ld.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":u===N,className:eI,onClick:()=>{_(N),o()},children:[Ld.jsx("span",{"aria-hidden":"true",style:{display:"inline-block",width:16},children:u===N?"✓":""}),N===0?"Hide":`${N*100}%`]},N))})]}),Ld.jsxs("div",{style:{position:"relative"},onMouseEnter:()=>{y(!0),v(!1)},children:[Ld.jsx("button",{type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded":f,className:eI,onClick:()=>{y(!0),v(!1)},children:"Copper Pour Visibility ▸"}),f&&Ld.jsx("div",{role:"menu","aria-label":"Copper Pour Visibility",className:Tme,style:{minWidth:80,...T},children:[0,0.05,0.1,0.2,0.4,0.6,0.8,1].map((N)=>Ld.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":x===N,className:eI,onClick:()=>{if(N>0)m(N);g(N>0),o()},children:[Ld.jsx("span",{"aria-hidden":"true",style:{display:"inline-block",width:16},children:x===N?"✓":""}),N===0?"Hide":`${N*100}%`]},N))})]})]})]}),l&&Ld.jsxs("div",{style:{position:"relative"},onMouseEnter:()=>{d(!0),b(!1)},children:[Ld.jsx("button",{type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded":h,className:eI,onClick:()=>{d(!0),b(!1)},children:"Rendering Engine ▸"}),h&&Ld.jsx("div",{role:"menu","aria-label":"Rendering Engine",className:Tme,style:T,children:["canvas","webgpu"].map((N)=>Ld.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":l.renderer===N,className:eI,onClick:()=>{l.setRenderer(N),o()},children:[Ld.jsx("span",{"aria-hidden":"true",style:{display:"inline-block",width:16},children:l.renderer===N?"✓":""}),N==="canvas"?"Canvas":"WebGPU (experimental)"]},N))})]}),e&&t&&Ld.jsxs("button",{type:"button",role:"menuitem",className:eI,style:{whiteSpace:"normal",overflowWrap:"anywhere"},onClick:()=>{o(),t({source_component_id:e.source_component_id,pcb_component_id:e.pcb_component_id,refdes:e.refdes})},children:[Ld.jsx("svg",{"aria-hidden":"true",width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{verticalAlign:"-1px",marginRight:5},children:Ld.jsx("path",{d:"M5 11 11 5M5 5h6v6"})}),e.refdes," on Schematic"]}),e?.manufacturer_part_number&&Ld.jsxs("button",{type:"button",role:"menuitem",disabled:!0,"aria-label":`Manufacturer part number: ${e.manufacturer_part_number}`,className:eI,style:{marginTop:4,background:"#292929",color:"#aaa",cursor:"default",whiteSpace:"normal",overflowWrap:"anywhere"},children:["MPN: ",e.manufacturer_part_number]})]}),document.body)},bne=({children:e,isSmallScreen:t,onClick:n,...o})=>{let{style:r,...i}=qme(n);return S0o.jsx("div",{...o,...i,style:{backgroundColor:"#1F1F1F",border:"1px solid #666",margin:0,padding:4,paddingLeft:t?8:6,paddingRight:t?8:6,borderRadius:2,color:"#eee",cursor:"pointer",fontSize:12,height:"fit-content",userSelect:"none",whiteSpace:"nowrap",...r,...o.style},children:e})},Fss=(e)=>{let t=new Map;return e.forEach((n,o)=>{let r=n.error_type||"unknown_error",i=t.get(r)||[];i.push({error:n,index:o,errorId:Sne(n,o)}),t.set(r,i)}),Array.from(t.entries()).map(([n,o])=>({errorType:n,errors:o}))},zss=({onClose:e,setHoveredErrorId:t,setFocusedErrorId:n,highlightDurationMs:o=3000})=>{let r=zE.useRef(null),i=zE.useRef(null),s=zE.useRef(null),a=zE.useCallback(()=>{if(r.current!==null)window.clearTimeout(r.current),r.current=null;if(i.current!==null)window.cancelAnimationFrame(i.current),i.current=null},[]);zE.useEffect(()=>a,[a]);let c=zE.useCallback((h)=>{a(),s.current=h,t(h),n(null),i.current=window.requestAnimationFrame(()=>{n(h),i.current=null}),e(),r.current=window.setTimeout(()=>{s.current=null,t(null),n(null),r.current=null},o)},[a,o,e,n,t]),l=zE.useCallback((h)=>s.current===h,[]);return{handleErrorSelect:c,isSelectedError:l}},Oss=({errorId:e,errorMessage:t,copiedErrorId:n,onCopy:o})=>{let{style:r,...i}=qme(()=>o(t,e));return Np.jsx("button",{type:"button","aria-label":n===e?"Error message copied":"Copy error message",style:{position:"absolute",top:12,right:16,cursor:"pointer",color:"#888",fontSize:16,background:"none",border:"none",padding:0,display:"flex",alignItems:"center",...r},...i,children:n===e?Np.jsx("span",{style:{color:"#4caf50",fontSize:12},children:"Copied!"}):Np.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:Np.jsx("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"})})})},Vss=({elements:e,isOpen:t,isSmallScreen:n,onToggle:o,onClose:r,setHoveredErrorId:i,setFocusedErrorId:s})=>{let[a,c]=FE.useState(null),[l,h]=FE.useState(new Set),[d,u]=FE.useState(new Set),[,_]=Jos(),{handleErrorSelect:p,isSelectedError:m}=zss({onClose:r,setHoveredErrorId:i,setFocusedErrorId:s}),A=FE.useMemo(()=>e?.filter((C)=>C.type.includes("error"))??[],[e]),g=A.length,f=FE.useMemo(()=>Fss(A),[A]),y=FE.useCallback((C)=>{h((b)=>{let I=new Set(b);if(I.has(C))I.delete(C);else I.add(C);return I})},[]),x=FE.useCallback((C)=>{u((b)=>{let I=new Set(b);if(I.has(C))I.delete(C);else I.add(C);return I})},[]);return Np.jsxs("div",{style:{position:"relative"},children:[Np.jsx(bne,{isSmallScreen:n,style:g>0?{color:"red"}:void 0,onClick:o,children:Np.jsxs("div",{children:[g," errors"]})}),t&&g>0&&Np.jsx("div",{style:{position:"absolute",top:"100%",left:0,backgroundColor:"#2a2a2a",border:"1px solid #666",borderRadius:4,marginTop:4,zIndex:1000,minWidth:n?"280px":"400px",maxWidth:n?"90vw":"600px",maxHeight:"400px",overflow:"auto",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.3)"},children:f.map(({errorType:C,errors:b},I)=>{let v=l.has(C);return Np.jsxs("div",{style:{borderBottom:I<f.length-1?"1px solid #444":"none"},children:[Np.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",cursor:"pointer",backgroundColor:"#232323",transition:"background-color 0.2s ease",touchAction:"manipulation",position:"sticky",top:0,zIndex:1},onMouseEnter:(P)=>{P.currentTarget.style.backgroundColor="#303030"},onMouseLeave:(P)=>{P.currentTarget.style.backgroundColor="#232323"},onTouchStart:(P)=>{P.stopPropagation(),P.currentTarget.style.backgroundColor="#303030"},onTouchEnd:(P)=>{P.stopPropagation(),P.preventDefault(),P.currentTarget.style.backgroundColor="#232323",y(C)},onClick:(P)=>{P.stopPropagation(),y(C)},children:[Np.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,color:"#ff6b6b"},children:[Np.jsx("div",{style:{color:"#888",fontSize:"16px",transform:v?"rotate(90deg)":"rotate(0deg)",transition:"transform 0.2s ease",flexShrink:0},children:"›"}),Np.jsx("div",{style:{fontWeight:"bold",fontSize:n?"12px":"13px"},children:C})]}),Np.jsx("div",{style:{fontSize:n?"12px":"13px",color:"#aaa",whiteSpace:"nowrap",marginLeft:12},children:b.length})]}),!v&&b.map(({error:P,index:M,errorId:B})=>{let T=d.has(B),N=P.message??"No error message";return Np.jsxs("div",{style:{borderTop:"1px solid #3a3a3a"},children:[Np.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"12px 16px 12px 24px",cursor:"pointer",backgroundColor:"#2a2a2a",transition:"background-color 0.2s ease",touchAction:"manipulation"},onMouseEnter:(D)=>{D.currentTarget.style.backgroundColor="#333",i(B)},onMouseLeave:(D)=>{if(D.currentTarget.style.backgroundColor="#2a2a2a",!m(B))i(null)},onTouchStart:(D)=>{D.stopPropagation(),D.currentTarget.style.backgroundColor="#333",i(B)},onTouchEnd:(D)=>{D.stopPropagation(),D.preventDefault(),D.currentTarget.style.backgroundColor="#2a2a2a",p(B)},onClick:(D)=>{D.stopPropagation(),p(B)},children:[Np.jsx("div",{style:{flex:1,fontSize:n?"12px":"13px",color:"#ddd",lineHeight:1.4,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",userSelect:"text"},children:N}),Np.jsx("button",{type:"button","aria-label":T?"Collapse error details":"Expand error details",style:{color:"#888",fontSize:"16px",transform:T?"rotate(0deg)":"rotate(90deg)",transition:"transform 0.2s ease",flexShrink:0,background:"none",border:"none",padding:0,cursor:"pointer"},onMouseDown:(D)=>D.stopPropagation(),onClick:(D)=>{D.stopPropagation(),x(B)},onTouchEnd:(D)=>{D.stopPropagation(),D.preventDefault(),x(B)},children:"›"})]}),T&&Np.jsxs("div",{"data-error-id":M,style:{display:"block",padding:"12px 16px 12px 24px",backgroundColor:"#1a1a1a",borderTop:"1px solid #444",position:"relative"},children:[Np.jsx("div",{style:{fontSize:n?"11px":"12px",color:"#ccc",lineHeight:1.5,wordWrap:"break-word",overflowWrap:"break-word",hyphens:"auto",userSelect:"text",paddingRight:30},onMouseDown:(D)=>D.stopPropagation(),onClick:(D)=>D.stopPropagation(),children:N}),Np.jsx(Oss,{errorId:B,errorMessage:N,copiedErrorId:a,onCopy:(D,L)=>{_(D),c(L),setTimeout(()=>c(null),2000)}})]})]},B)})]},C)})})]})},Yss=({name:e,selected:t,onClick:n})=>{let{style:o,...r}=qme(n);return Zs.jsxs("div",{className:$T`
        margin-top: 2px;
        padding: 4px;
        padding-left: 8px;
        padding-right: 18px;
        cursor: pointer;

        &:hover {
          background-color: rgba(255, 255, 255, 0.1);
        }
      `,...r,style:o,children:[Zs.jsx("span",{style:{marginRight:2,opacity:t?1:0},children:"•"}),Zs.jsx("span",{style:{marginLeft:2,fontWeight:500,color:$me[e.replace(/-/,"")]},children:e})]})},tI=({label:e,checked:t,onClick:n})=>{let{style:o,...r}=qme(n);return Zs.jsxs("div",{className:$T`
        margin-top: 2px;
        padding: 4px;
        padding-left: 8px;
        padding-right: 18px;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 8px;

        &:hover {
          background-color: rgba(255, 255, 255, 0.1);
        }
      `,...r,style:o,children:[Zs.jsx("input",{type:"checkbox",checked:t,onChange:()=>{},readOnly:!0}),Zs.jsx("span",{style:{color:"#eee"},children:e})]})},jdo=({label:e,checked:t,onClick:n})=>{let{style:o,...r}=qme(n);return Zs.jsxs("div",{className:$T`
        margin-top: 2px;
        padding: 4px;
        padding-left: 8px;
        padding-right: 18px;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 8px;

        &:hover {
          background-color: rgba(255, 255, 255, 0.1);
        }
      `,...r,style:o,children:[Zs.jsx("input",{type:"radio",checked:t,onChange:()=>{},readOnly:!0}),Zs.jsx("span",{style:{color:"#eee"},children:e})]})},Gss=({children:e,elements:t,onContextMenuOpenChange:n,getNetAtPoint:o,getComponentAtPoint:r,onViewSchematicComponent:i,xRayNetIds:s=[],onXRayNetsChange:a})=>{let c=Lss(),{isMouseOverContainer:l,setIsMouseOverContainer:h,selectedLayer:d,selectLayer:u,viewSettings:_,setIsShowingRatsNest:p,setIsShowingMultipleTracesLength:m,setIsShowingAutorouting:A,setIsShowingDrcErrors:g,setIsShowingDrcWarnings:f,setIsShowingCopperPours:y,setIsShowingCourtyards:x,setIsShowingPcbGroups:C,setIsShowingGroupAnchorOffsets:b,setIsShowingSolderMask:I,setIsShowingSilkscreen:v,setIsShowingFabricationNotes:P,setIsShowingPcbNotes:M,setPcbGroupViewMode:B,setHoveredErrorId:T,setFocusedErrorId:N}=Qa((et)=>({isMouseOverContainer:et.is_mouse_over_container,setIsMouseOverContainer:et.setIsMouseOverContainer,selectedLayer:et.selected_layer,selectLayer:et.selectLayer,viewSettings:{is_showing_rats_nest:et.is_showing_rats_nest,is_showing_multiple_traces_length:et.is_showing_multiple_traces_length,is_showing_autorouting:et.is_showing_autorouting,is_showing_drc_errors:et.is_showing_drc_errors,is_showing_drc_warnings:et.is_showing_drc_warnings,is_showing_copper_pours:et.is_showing_copper_pours,is_showing_courtyards:et.is_showing_courtyards,is_showing_pcb_groups:et.is_showing_pcb_groups,is_showing_group_anchor_offsets:et.is_showing_group_anchor_offsets,is_showing_solder_mask:et.is_showing_solder_mask,is_showing_silkscreen:et.is_showing_silkscreen,is_showing_fabrication_notes:et.is_showing_fabrication_notes,is_showing_pcb_notes:et.is_showing_pcb_notes,pcb_group_view_mode:et.pcb_group_view_mode},setIsShowingRatsNest:et.setIsShowingRatsNest,setIsShowingMultipleTracesLength:et.setIsShowingMultipleTracesLength,setIsShowingAutorouting:et.setIsShowingAutorouting,setIsShowingDrcErrors:et.setIsShowingDrcErrors,setIsShowingDrcWarnings:et.setIsShowingDrcWarnings,setIsShowingCopperPours:et.setIsShowingCopperPours,setIsShowingCourtyards:et.setIsShowingCourtyards,setIsShowingPcbGroups:et.setIsShowingPcbGroups,setIsShowingGroupAnchorOffsets:et.setIsShowingGroupAnchorOffsets,setIsShowingSolderMask:et.setIsShowingSolderMask,setIsShowingSilkscreen:et.setIsShowingSilkscreen,setIsShowingFabricationNotes:et.setIsShowingFabricationNotes,setIsShowingPcbNotes:et.setIsShowingPcbNotes,setPcbGroupViewMode:et.setPcbGroupViewMode,setHoveredErrorId:et.setHoveredErrorId,setFocusedErrorId:et.setFocusedErrorId})),[D,L]=ah.useState(null),[H,V]=ah.useState([]),[O,U]=ah.useState(),[j,Y]=ah.useState("Net"),[X,K]=ah.useState(),J=(et)=>{let vt=et.currentTarget.getBoundingClientRect();return r?.({x:et.clientX-vt.left,y:et.clientY-vt.top})},ee=ah.useRef(null),se=Qa((et)=>et.in_edit_mode),ne=(et)=>{let vt=et.currentTarget.getBoundingClientRect();return o?.({x:et.clientX-vt.left,y:et.clientY-vt.top})},re=ah.useCallback(()=>{L(null),n?.(!1)},[n]),[Z,te]=ah.useState(!1),[ie,le]=ah.useState(!1),[ue,de]=ah.useState(!1),[me,Ae]=ah.useState(!1),[xe,Me]=ah.useState(!1);ah.useEffect(()=>{let et=()=>Ae(!0),vt=()=>Ae(!1),ht=()=>Me(!0),We=()=>Me(!1);return window.addEventListener("arm-dimension-tool",et),window.addEventListener("disarm-dimension-tool",vt),window.addEventListener("arm-bounds-tool",ht),window.addEventListener("disarm-bounds-tool",We),()=>{window.removeEventListener("arm-dimension-tool",et),window.removeEventListener("disarm-dimension-tool",vt),window.removeEventListener("arm-bounds-tool",ht),window.removeEventListener("disarm-bounds-tool",We)}},[]);let Re=wTe(t??[]),we=Re,_e=ah.useRef(!1),ye=ah.useRef(null),Se={"1":Re[0]?()=>u(Re[0]):()=>{},"2":Re[1]?()=>u(Re[1]):()=>{},"3":Re[2]?()=>u(Re[2]):()=>{},"4":Re[3]?()=>u(Re[3]):()=>{},"5":Re[4]?()=>u(Re[4]):()=>{},"6":Re[5]?()=>u(Re[5]):()=>{},"7":Re[6]?()=>u(Re[6]):()=>{},"8":Re[7]?()=>u(Re[7]):()=>{},"9":Re[8]?()=>u(Re[8]):()=>{},"0":Re[9]?()=>u(Re[9]):()=>{}};RE("1",Se["1"],ye),RE("2",Se["2"],ye),RE("3",Se["3"],ye),RE("4",Se["4"],ye),RE("5",Se["5"],ye),RE("6",Se["6"],ye),RE("7",Se["7"],ye),RE("8",Se["8"],ye),RE("9",Se["9"],ye),RE("0",Se["0"],ye),ah.useLayoutEffect(()=>{if(_e.current)return;_e.current=!0;let et=(vt)=>{if(ye.current){let ht=ye.current.getBoundingClientRect();if(vt.clientX>=ht.left&&vt.clientX<=ht.right&&vt.clientY>=ht.top&&vt.clientY<=ht.bottom)h(!0)}document.removeEventListener("mousemove",et)};return document.addEventListener("mousemove",et),()=>{document.removeEventListener("mousemove",et)}},[h]);let Ne=ah.useCallback(()=>{h(!0)},[h]),ke=ah.useCallback(()=>{if(!l)h(!0)},[l,h]),nt=ah.useCallback(()=>{h(!1),le(!1),te(!1),de(!1)},[h]),dt=ah.useCallback(()=>{le(!ie)},[ie]),rt=ah.useCallback(()=>{let et=!ue;if(de(et),et)te(!1);if(!et)T(null)},[ue,T]),mt=ah.useCallback(()=>{de(!1)},[]),lt=ah.useCallback(()=>{p(!_.is_showing_rats_nest)},[_.is_showing_rats_nest,p]),Ct=ah.useCallback(()=>{Ae(!0),Me(!1),window.dispatchEvent(new Event("arm-dimension-tool"))},[]),Nt=ah.useCallback(()=>{Me(!0),Ae(!1),window.dispatchEvent(new Event("arm-bounds-tool"))},[]),Ht=ah.useCallback(()=>{let et=!Z;if(te(et),et)de(!1)},[Z]),Tt=ah.useCallback((et)=>{et.stopPropagation()},[]);return Zs.jsxs("div",{ref:ye,onPointerDownCapture:(et)=>{if(!et.target.closest("[data-view-menu]"))te(!1)},onPointerDown:(et)=>{ee.current={x:et.clientX,y:et.clientY}},onClick:(et)=>{if(et.detail>1||se||me||xe||et.target.closest("button, input, select, [role=menu]"))return;let vt=ee.current;if(!vt||Math.hypot(et.clientX-vt.x,et.clientY-vt.y)>4)return;let ht=ne(et),We=J(et);if(!ht&&!We)return;let Le=ht?.netId;if(Le&&s.includes(Le))a?.(s.filter((Ze)=>Ze!==Le)),re();else U(Le),Y(ht?.displayName??"Net"),V(ht?.groups??[]),K(We),n?.(!0),L({x:et.clientX,y:et.clientY})},onDoubleClick:()=>{a?.([]),re()},onContextMenu:(et)=>{et.preventDefault(),et.stopPropagation();let vt=ne(et);K(J(et)),U(vt?.netId),Y(vt?.displayName??"Net"),V(vt?.groups??[]),n?.(!0),L({x:et.clientX,y:et.clientY})},style:{position:"relative",zIndex:"999 !important"},onMouseEnter:Ne,onMouseLeave:nt,onMouseMove:ke,children:[e,D&&Zs.jsx(Hss,{position:D,component:X,onViewSchematicComponent:i,onClose:re,xRayDisplayName:j,xRayGroups:H.filter((et)=>et.netIds.some((vt)=>!s.includes(vt))),onXRayGroup:(et)=>a?.([...new Set([...s,...et.netIds])]),onXRayNet:O&&!s.includes(O)?()=>a?.([...s,O]):void 0,onExitXRayNet:s.length>0?()=>a?.([]):void 0}),Zs.jsxs("div",{style:{position:"absolute",bottom:4,right:8,pointerEvents:"none",color:"white",fontSize:11,opacity:l?0.5:0,transition:"opacity 1s",transitionDelay:"2s",fontFamily:"sans-serif"},children:["@tscircuit/pcb-viewer@",kss.version]}),Zs.jsxs("div",{"data-toolbar-overlay":!0,onTouchStart:(et)=>et.stopPropagation(),onTouchEnd:(et)=>et.stopPropagation(),onTouchMove:(et)=>et.stopPropagation(),onMouseDown:Tt,onMouseMove:Tt,onMouseUp:Tt,onPointerDown:Tt,onPointerMove:Tt,onPointerUp:Tt,onWheel:Tt,style:{position:"absolute",opacity:c?1:l?1:0,top:16,left:16,right:c?16:"auto",transition:l?"opacity 100ms linear":"opacity 300ms linear",zIndex:md.toolbarOverlay,color:"red",display:"flex",flexWrap:"wrap",maxWidth:"550px",gap:4,fontSize:12,fontFamily:"sans-serif"},children:[Zs.jsxs(bne,{isSmallScreen:c,onClick:dt,onMouseLeave:()=>{if(ie)le(!1)},children:[Zs.jsxs("div",{children:["layer:"," ",Zs.jsx("span",{style:{marginLeft:2,fontWeight:500,color:$me[d]},children:d})]}),ie&&Zs.jsx("div",{style:{marginTop:4,minWidth:120},children:we.map((et)=>Zs.jsx(Yss,{name:et,selected:et===d,onClick:()=>{u(et)}},et))})]}),Zs.jsx(Vss,{elements:t,isOpen:ue,isSmallScreen:c,onToggle:rt,onClose:mt,setHoveredErrorId:T,setFocusedErrorId:N}),Zs.jsx(bne,{isSmallScreen:c,style:{},onClick:lt,children:Zs.jsxs("div",{children:[_.is_showing_rats_nest?"✖ ":"","Rats Nest"]})}),Zs.jsx(bne,{isSmallScreen:c,style:me?{backgroundColor:"#444"}:{},onClick:Ct,children:Zs.jsx("div",{children:"\uD83D\uDCCF"})}),Zs.jsx(bne,{isSmallScreen:c,style:xe?{backgroundColor:"#444"}:{},onClick:Nt,children:Zs.jsx("div",{children:"Bounds"})}),Zs.jsx(bne,{"data-view-menu":!0,isSmallScreen:c,onClick:Ht,children:Zs.jsxs("div",{children:[Zs.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:["View",Zs.jsx("span",{style:{fontSize:"8px",transform:Z?"rotate(180deg)":"rotate(0)",transition:"transform 0.1s ease",display:"inline-block"},children:"▼"})]}),Z&&Zs.jsxs("div",{style:{marginTop:4,minWidth:120},children:[Zs.jsx(tI,{label:"Show All Trace Lengths",checked:_.is_showing_multiple_traces_length,onClick:()=>{m(!_.is_showing_multiple_traces_length)}}),Zs.jsx(tI,{label:"Show Autorouting Animation",checked:_.is_showing_autorouting,onClick:()=>{A(!_.is_showing_autorouting)}}),Zs.jsx(tI,{label:"Show DRC Errors",checked:_.is_showing_drc_errors,onClick:()=>{g(!_.is_showing_drc_errors)}}),Zs.jsx(tI,{label:"Show DRC Warnings",checked:_.is_showing_drc_warnings,onClick:()=>{f(!_.is_showing_drc_warnings)}}),Zs.jsx(tI,{label:"Show Copper Pours",checked:_.is_showing_copper_pours,onClick:()=>{y(!_.is_showing_copper_pours)}}),Zs.jsx(tI,{label:"Show Courtyards",checked:_.is_showing_courtyards,onClick:()=>{x(!_.is_showing_courtyards)}}),Zs.jsx(tI,{label:"Show Solder Mask",checked:_.is_showing_solder_mask,onClick:()=>{I(!_.is_showing_solder_mask)}}),Zs.jsx(tI,{label:"Show Silkscreen",checked:_.is_showing_silkscreen,onClick:()=>{v(!_.is_showing_silkscreen)}}),Zs.jsx(tI,{label:"Show Fabrication Notes",checked:_.is_showing_fabrication_notes,onClick:()=>{P(!_.is_showing_fabrication_notes)}}),Zs.jsx(tI,{label:"Show PCB Notes",checked:_.is_showing_pcb_notes,onClick:()=>{M(!_.is_showing_pcb_notes)}}),Zs.jsx(tI,{label:"Show Group Anchor Offsets",checked:_.is_showing_group_anchor_offsets,onClick:()=>{b(!_.is_showing_group_anchor_offsets)}}),Zs.jsx(tI,{label:"Show PCB Groups",checked:_.is_showing_pcb_groups,onClick:()=>{C(!_.is_showing_pcb_groups)}}),_.is_showing_pcb_groups&&Zs.jsxs("div",{style:{marginLeft:16},children:[Zs.jsx(jdo,{label:"Show All Groups",checked:_.pcb_group_view_mode==="all",onClick:()=>{B("all")}}),Zs.jsx(jdo,{label:"Show Named Groups",checked:_.pcb_group_view_mode==="named_only",onClick:()=>{B("named_only")}})]})]})]})})]})]})},Uss=(e)=>e.type==="pcb_manual_edit_conflict_warning"||e.type==="pcb_connector_not_in_accessible_orientation_warning",Wss=(e)=>{if(e.type==="pcb_connector_not_in_accessible_orientation_warning")return`Connector faces ${e.facing_direction}; expected ${e.recommended_facing_direction}`;return"Manual Edit Conflict"},Xss=({children:e,transform:t=xf(),elements:n=[]})=>{let[o,{width:r,height:i}]=Kme(),s=HTe.useRef(null),a=Qa((c)=>c.is_showing_drc_warnings);if(HTe.useEffect(()=>{let c=s.current;if(!c||!r||!i)return;c.width=r,c.height=i;let l=c.getContext("2d");if(!l)return;l.clearRect(0,0,r,i);let h=n.filter((u)=>u.type==="pcb_component"),d=n.filter(Uss);l.strokeStyle=Ir.board.drc_warning,l.lineWidth=2,d.forEach((u)=>{let _=h.find((V)=>V.pcb_component_id===u.pcb_component_id);if(!_)return;let{width:p,height:m,center:A}=_,g=fo(t,A),f=p*Math.abs(t.a),y=m*Math.abs(t.d),x=0.1*Math.abs(t.a),C=f+x*2,b=y+x*2,I=g.x-C/2,v=g.y-b/2;l.beginPath(),l.rect(I,v,C,b),l.stroke();let P=Wss(u),M=4,B=Math.max(8,Math.min(12,10*Math.abs(t.a)));l.font=`${B}px sans-serif`;let N=l.measureText(P).width+M*2,D=B+M*2,L=I+(C-N)/2,H=v+b+5;l.fillStyle="rgba(0, 0, 0, 0.7)",l.beginPath(),l.roundRect(L,H,N,D,3),l.fill(),l.fillStyle=Ir.board.drc_warning,l.textAlign="center",l.textBaseline="middle",l.fillText(P,L+N/2,H+D/2)})},[n,t,r,i,a]),!a)return Gme.jsx("div",{ref:o,style:{position:"relative",width:"100%",height:"100%"},children:e});return Gme.jsxs("div",{ref:o,style:{position:"relative",width:"100%",height:"100%"},children:[e,Gme.jsx("canvas",{ref:s,style:{position:"absolute",top:0,left:0,pointerEvents:"none",zIndex:md.warnings}})]})},E0o=(e,t,n,o)=>{if(n<=0||o<=0)return;let r=e.find((s)=>s.type==="pcb_component"&&s.pcb_component_id===t);if(r?.type!=="pcb_component")return;let i=Quo(r);if(!i)return;return{component:r,bounds:i,transform:Juo({bounds:i,width:n,height:o})}},jss=({focusRequest:e,elements:t,transform:n})=>{let o=e?.pcbComponentId,r=Qa((h)=>h.selectLayer),i=o?E0o(t,o,1,1):void 0,s=i?.component.layer;if(P0o.useEffect(()=>{if(s)r(s)},[e,s,r]),!i||!n)return null;let{bounds:a}=i,c=fo(n,{x:a.minX,y:a.minY}),l=fo(n,{x:a.maxX,y:a.maxY});return M0o.jsx("div",{"data-focused-pcb-component-id":o,style:{position:"absolute",left:Math.min(c.x,l.x)-4,top:Math.min(c.y,l.y)-4,width:Math.abs(l.x-c.x)+8,height:Math.abs(l.y-c.y)+8,border:"2px solid #3399ff",borderRadius:4,boxSizing:"border-box",pointerEvents:"none",zIndex:md.elementOverlay}})},Kss=(e)=>{let{transform:t,elements:n}=e,{hoveredErrorId:o,focusedErrorId:r,isShowingCopperPours:i,copperPourOpacity:s,selectedLayer:a}=Qa((T)=>({hoveredErrorId:T.hovered_error_id,focusedErrorId:T.focused_error_id,isShowingCopperPours:T.is_showing_copper_pours,copperPourOpacity:T.copper_pour_opacity,selectedLayer:T.selected_layer})),c=r??o,l=ap.useMemo(()=>i?n:n.filter((T)=>T.type!=="pcb_copper_pour"),[n,i]),h=ap.useMemo(()=>{let T=Ars(n);return l.flatMap((N)=>frs(N,n,T))},[l,n]),d=ap.useMemo(()=>Kuo(n),[n]),[u,_]=ap.useState([]);ap.useEffect(()=>_([]),[d]),ap.useEffect(()=>{if(u.length===0)return;let T=(N)=>{if(N.key==="Escape")_([])};return window.addEventListener("keydown",T,!0),()=>window.removeEventListener("keydown",T,!0)},[u.length]);let p=ap.useMemo(()=>u.length>0?l.filter((T)=>Sdo(T)&&(T.type!=="pcb_copper_pour"||s>0)&&u.includes(Ine(T,d)??"")):void 0,[l,d,u,s]),m=ap.useMemo(()=>{if(!p)return h;let T=new Set(p);return h.filter((N)=>(N._element?.type==="pcb_smtpad"||N._element?.type==="pcb_plated_hole")&&T.has(N._element))},[h,p]),A=(T)=>{if(!t)return;let N=wgt(h,fo(Cf(t),T),t,a).filter((D)=>D._element?.type==="pcb_smtpad"||D._element?.type==="pcb_plated_hole");return N.sort((D,L)=>Number(L.layer===a)-Number(D.layer===a)),rrs(N[0]?._element,n)},g=(T)=>{if(!t)return;let N=(H,V)=>({netId:H,displayName:Trs(V,n,d),groups:Drs(H,n,d)});if(i&&s>0)for(let H of Nrs(l,fo(Cf(t),T),a).reverse()){let V=Ine(H,d);if(V)return N(V,H)}let L=wgt(h,fo(Cf(t),T),t,a,u.length>0).filter((H)=>Sdo(H._element)&&H.layer!=="drill");L.sort((H,V)=>Number(V.layer===a)-Number(H.layer===a));for(let H of L){let V=Ine(H._element,d);if(V&&u.includes(V))return N(V,H._element)}for(let H of L){let V=Ine(H._element,d);if(V)return N(V,H._element)}},[f,y]=ap.useState({drawingObjectIdsWithMouseOver:new Set,primitiveIdsInMousedOverNet:[]}),[x,C]=ap.useState([]),b=ap.useRef(t??null),I=ap.useRef(null),v=ap.useMemo(()=>$uo(n),[n]),P=ap.useMemo(()=>{if(!c)return[];let N=n.filter((D)=>D.type.includes("error")).find((D,L)=>Sne(D,L)===c);if(!N)return[];return Ers(N)},[c,n]);ap.useEffect(()=>{if(t)b.current=t},[t]),ap.useEffect(()=>()=>{vdo(I.current)},[]),ap.useEffect(()=>{if(!e.width||!e.height||!e.setTransform||!r)return;let T=Zuo(n,r);if(!T)return;let N=Prs({error:T,indexes:v});if(!N)return;let D=b.current??t;if(!D)return;let L=Juo({bounds:N,width:e.width,height:e.height});vdo(I.current),Brs({startTransform:D,endTransform:L,durationMs:420,setAnimationFrameId:(H)=>{I.current=H},onUpdate:(H)=>{b.current=H,e.setTransform?.(H)}})},[r,n,v,e.height,e.setTransform,e.width]);let M=ap.useMemo(()=>{if(u.length>0)return h;let T=[...f.primitiveIdsInMousedOverNet,...P];return yrs({primitivesWithoutInteractionMetadata:h,drawingObjectIdsWithMouseOver:f.drawingObjectIdsWithMouseOver,primitiveIdsInMousedOverNet:T})},[h,f,P,u]),B=ap.useCallback((T)=>{let N=[];for(let H of T)if(H._element){let V=d.getNetConnectedToId("pcb_port_id"in H._element?H._element?.pcb_port_id:("pcb_trace_id"in H._element)?H._element?.pcb_trace_id:"");N.push(...d.getIdsConnectedToNet(V))}let D=new Set(T.map((H)=>H._pcb_drawing_object_id));y({drawingObjectIdsWithMouseOver:D,primitiveIdsInMousedOverNet:N});let L=T.map((H)=>{if(H._parent_pcb_component?.type==="pcb_component"&&H._parent_pcb_component.pcb_component_id)return H._parent_pcb_component.pcb_component_id;if(H._element?.type==="pcb_component"&&H._element.pcb_component_id)return H._element.pcb_component_id;return null}).filter((H)=>Boolean(H));C(Array.from(new Set(L)))},[d]);return g4.jsxs(Nss,{elements:l,transform:t,primitives:m,selectedLayer:a,onMouseHoverOverPrimitives:B,children:[g4.jsx(jss,{focusRequest:e.focusedPcbComponent,elements:n,transform:t}),g4.jsx(Ass,{disabled:!e.allowEditing,transform:t,soup:n,cancelPanDrag:e.cancelPanDrag,onCreateEditEvent:e.onCreateEditEvent,onModifyEditEvent:e.onModifyEditEvent,children:g4.jsx(_ss,{transform:t,focusOnHover:e.focusOnHover,primitives:h,onBoundsSelected:e.onBoundsSelected,cancelPanDrag:e.cancelPanDrag,children:g4.jsx(Gss,{elements:n,getNetAtPoint:g,xRayNetIds:u,onXRayNetsChange:_,onContextMenuOpenChange:e.onContextMenuOpenChange,getComponentAtPoint:A,onViewSchematicComponent:e.onViewSchematicComponent,children:g4.jsx(yss,{transform:t,elements:n,children:g4.jsx(Qss,{transform:t,soup:n,children:g4.jsx(Rss,{transform:t,elements:n,hoveredComponentIds:x,children:g4.jsx(oss,{transform:t,debugGraphics:e.debugGraphics,children:g4.jsx(Xss,{transform:t,elements:n,children:e.renderer==="canvas"?g4.jsx(Ris,{transform:t,primitives:M,elements:l,circuitJson:n,xRayElements:p,width:e.width,height:e.height,grid:e.grid,onRenderComplete:e.onRenderComplete}):g4.jsx(krs,{transform:t,primitives:M,elements:n,xRayElements:p,width:e.width,height:e.height,grid:e.grid,onRenderComplete:e.onRenderComplete})})})})})})})})})]})},_Te=(e)=>Number.isFinite(e)?e.toFixed(4):"NaN",$ss=(e)=>{let t=5381;for(let n=0;n<e.length;n++)t=(t<<5)+t+e.charCodeAt(n);return Math.abs(t)},qss=(e)=>{if(!e?.length)return"0";let t=[];for(let r of e){if(!r?.type?.startsWith("pcb_"))continue;let i=Nos(r),s=Sgt([r]),a=[_Te(s.minX),_Te(s.minY),_Te(s.maxX),_Te(s.maxY)].join(","),c=`${i}:${a}`;if(r.type==="pcb_trace"){let l=(r.route??[]).length;c+=`:${l}`;for(let h of r.route??[]){if(h.route_type!=="via")continue;c+=`:${h.tented_on_top}:${h.tented_on_bottom}`}}if(r.type==="pcb_board")c+=`:${r.default_via_tented_on_top}:${r.default_via_tented_on_bottom}`;if(r.type==="pcb_via")c+=`:${r.tented_on_top}:${r.tented_on_bottom}`;t.push(c)}if(t.length===0)return"0";t.sort();let n=t.join(","),o=$ss(n);return`${t.length}_${o.toString(36)}`},Jss=(e)=>{if(!e)return"empty";let t=e.find((o)=>o.type==="pcb_board");if(!t)return"no-board";let n=(o)=>Math.round(o*1000)/1000;if(t.outline)return t.outline.map((o)=>`${n(o.x)}_${n(o.y)}`).join(",");return`${n(t.width)}_${n(t.height)}`};function Zss({circuitJson:e,editEvents:t}){let n=structuredClone(e);for(let o of t){if(o.edit_event_type==="edit_pcb_component_location"){let a=eD(n).pcb_component.get(o.pcb_component_id);if(a?.center.x===o.new_center.x&&a.center.y===o.new_center.y)continue;let l=Ra(o.new_center.x-o.original_center.x,o.new_center.y-o.original_center.y);n=n.map((h)=>("pcb_component_id"in h)&&h.pcb_component_id===o.pcb_component_id?Dos(h,l):h);continue}if(o.edit_event_type==="edit_schematic_component_location"){n=n.map((a)=>a.type==="schematic_component"&&a.schematic_component_id===o.schematic_component_id?{...a,center:o.new_center}:a);continue}if(o.edit_event_type!=="edit_pcb_trace_hint")continue;if(!o.pcb_trace_hint_id)continue;if(eD(n).pcb_trace_hint.get(o.pcb_trace_hint_id)){n=n.map((a)=>a.type==="pcb_trace_hint"&&a.pcb_trace_hint_id===o.pcb_trace_hint_id?{...a,route:o.route}:a);continue}let i=eD(n).pcb_port.get(o.pcb_port_id);if(!i?.pcb_component_id)continue;let s={type:"pcb_trace_hint",pcb_trace_hint_id:o.pcb_trace_hint_id,route:o.route,pcb_port_id:o.pcb_port_id,pcb_component_id:i.pcb_component_id};n=n.filter((a)=>a.type!=="pcb_trace_hint"||a.pcb_port_id!==o.pcb_port_id).concat(s)}return n}var eas=ud(Ra(400,300),bf(40,-40)),Kdo=()=>{let e=Fuo(ip.RENDERING_ENGINE,"webgpu");return e==="canvas"||e==="webgpu"?e:"webgpu"},w0o=({circuitJson:e,debugGraphics:t,height:n=600,renderer:o,initialState:r,allowEditing:i=!0,editEvents:s,onEditEventsChanged:a,onRenderComplete:c,onBoundsSelected:l,onViewSchematicComponent:h,focusOnHover:d=!1,clickToInteractEnabled:u=!1,disablePcbGroups:_=!1,controller:p})=>{let[m,A]=e0.useState(()=>o??Kdo()),[g,f]=e0.useState(null);e0.useEffect(()=>A(o??Kdo()),[o]);let y=e0.useCallback((ie)=>{A(ie),zuo(ip.RENDERING_ENGINE,ie)},[]),x=e0.useMemo(()=>({renderer:m,setRenderer:y}),[m,y]),[C,b]=e0.useState(!u),[I,v]=e0.useState(!1),P=e0.useRef(!1),[M,B]=Kme(),[T,N]=e0.useState(eas),D=e0.useCallback((ie)=>{if(P.current)return!1;if(ie instanceof MouseEvent&&(ie.button===2||(ie.buttons&2)!==0))return!1;let le=ie.target;if(!(le instanceof Element))return!0;return!le.closest("[data-toolbar-overlay]")},[]),{ref:L,setTransform:H,cancelDrag:V}=ors({transform:T,onSetTransform:N,enabled:C&&!I,shouldDrag:D}),O=e0.useCallback((ie)=>{if(P.current=ie,ie)V();v(ie)},[V]),[U,j]=e0.useState([]);U=s??U;let Y=e0.useRef(!1),X=e0.useRef(null),K=e0.useMemo(()=>qss(e),[e]),J=Jss(e),ee=()=>{let ie=B?.width>0?B:{width:500,height:500},{center:le,width:ue,height:de}=ne.some((xe)=>xe.type.startsWith("pcb_"))?Fos(ne.filter((xe)=>xe.type.startsWith("pcb_"))):{center:{x:0,y:0},width:0.001,height:0.001},me=Math.min((ie.width??0)/ue,(ie.height??0)/de,100)*0.75,Ae=ud(Ra((ie.width??0)/2,(ie.height??0)/2),bf(me,-me,0,0),Ra(-le.x,-le.y));H(Ae);return};e0.useEffect(()=>{if(!B?.width)return;if(!e)return;if(e.length===0)return;if(!Y.current)ee(),Y.current=!0},[e,B]),e0.useEffect(()=>{if(Y.current===!0)ee()},[J]);let se=e0.useMemo(()=>e?.filter((ie)=>ie.type.startsWith("pcb_")||ie.type.startsWith("source_"))??[],[K]),ne=e0.useMemo(()=>Zss({circuitJson:se,editEvents:U}),[se,U]);e0.useEffect(()=>{let ie=p?.focusRequest;if(!ie||!B.width||!n||!ne.length)return;let le=E0o(ne,ie.pcbComponentId,B.width,n);if(le)V(),H(le.transform),f(ie);p.onFocusRequestHandled(ie)},[p,ne,B.width,n,V,H]);let re=(ie)=>{j([...U,ie]),a?.([...U,ie])},Z=(ie)=>{let le=U.map((ue)=>ue.edit_event_id===ie.edit_event_id?{...ue,...ie}:ue);j(le),a?.(le)},te=e0.useMemo(()=>({...r,..._&&{is_showing_pcb_groups:!1}}),[r,_]);return kE.jsx(Jdo.Provider,{value:x,children:kE.jsxs("div",{ref:L,style:{position:"relative"},onContextMenu:(ie)=>ie.preventDefault(),children:[kE.jsx("div",{ref:M,children:kE.jsxs(Gos,{initialState:te,disablePcbGroups:_,children:[kE.jsx(Kss,{renderer:m,transform:T,setTransform:H,height:n,width:B.width,allowEditing:i,focusOnHover:d,onBoundsSelected:l,onViewSchematicComponent:h,focusedPcbComponent:g,cancelPanDrag:V,onContextMenuOpenChange:O,onCreateEditEvent:re,onModifyEditEvent:Z,onRenderComplete:c,grid:{spacing:1,view_window:{left:0,right:B.width||500,top:n,bottom:0}},elements:ne,debugGraphics:t}),kE.jsx(Uos,{})]})}),u&&!C&&kE.jsx("div",{onClick:()=>{b(!0),ee()},onTouchStart:(ie)=>{let le=ie.touches[0];X.current={x:le.clientX,y:le.clientY}},onTouchEnd:(ie)=>{let le=ie.changedTouches[0],ue=X.current;if(!ue)return;let de=Math.abs(le.clientX-ue.x),me=Math.abs(le.clientY-ue.y);if(de<10&&me<10)ie.preventDefault(),b(!0),ee();X.current=null},style:{position:"absolute",inset:0,cursor:"pointer",zIndex:md.clickToInteractOverlay,display:"flex",alignItems:"center",justifyContent:"center",touchAction:"pan-x pan-y pinch-zoom"},children:kE.jsx("div",{style:{backgroundColor:"rgba(0, 0, 0, 0.8)",color:"white",padding:"12px 24px",borderRadius:"8px",fontSize:"16px",pointerEvents:"none"},children:typeof window<"u"&&(("ontouchstart"in window)||navigator.maxTouchPoints>0)?"Touch to Interact":"Click to Interact"})})]})})};/*! Bundled license information:

svgson/dist/svgson.umd.js:
  (*!
   * Determine if an object is a Buffer
   *
   * @author   Feross Aboukhadijeh <https://feross.org>
   * @license  MIT
   *)
*/var tas=EX();function nas({circuitJson:e,onSelectComponent:t}){let n=YE.useRef(null),[o,r]=YE.useState(600);return YE.useEffect(()=>{try{localStorage.setItem("pcb-viewer:rendering-engine","canvas")}catch{}let i=n.current?.parentElement||n.current;if(!i)return;let s=()=>{let c=i.clientHeight||window.innerHeight-52;if(c>50)r(c)};s();let a=new ResizeObserver(s);return a.observe(i),window.addEventListener("resize",s),()=>{a.disconnect(),window.removeEventListener("resize",s)}},[]),kBe(e||[],t),YE.default.createElement("div",{ref:n,style:{width:"100%",height:"100%",position:"relative",overflow:"hidden"}},YE.default.createElement(w0o,{circuitJson:e||[],height:o,renderer:"canvas",allowEditing:!1,onViewSchematicComponent:(i)=>{let s=i?.refdes||i?.source_component_id;if(s&&t)t(wE(e||[],s))}}))}function B0o(e,t,n){let o={circuitJson:t||[],onSelectComponent:n};MX(tas,e,YE.default.createElement(nas,o))}var g8=at(ln());var mu=at(ln(),1);var oas=Object.defineProperty,Hne=(e,t)=>oas(e,"name",{value:t,configurable:!0}),T0o=!!(typeof window<"u"&&window.document&&window.document.createElement);function ka(e,t,{checkForDefaultPrevented:n=!0}={}){return Hne(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},"handleEvent")}Hne(ka,"composeEventHandlers");function ras(e){if(!T0o)throw Error("Cannot access window outside of the DOM");return e?.ownerDocument?.defaultView??window}Hne(ras,"getOwnerWindow");function Xgt(e){if(!T0o)throw Error("Cannot access document outside of the DOM");return e?.ownerDocument??document}Hne(Xgt,"getOwnerDocument");function D0o(e,t=!1){let{activeElement:n}=Xgt(e);if(!n?.nodeName)return null;if(N0o(n)&&n.contentDocument)return D0o(n.contentDocument.body,t);if(t){let o=n.getAttribute("aria-activedescendant");if(o){let r=Xgt(n).getElementById(o);if(r)return r}}return n}Hne(D0o,"getActiveElement");function N0o(e){return e.tagName==="IFRAME"}Hne(N0o,"isFrame");var R0o=at(ln(),1),ias=Object.defineProperty,Kgt=(e,t)=>ias(e,"name",{value:t,configurable:!0});function jgt(e,t){if(typeof e==="function")return e(t);else if(e!==null&&e!==void 0)e.current=t}Kgt(jgt,"setRef");function Q0o(...e){return(t)=>{let n=!1,o=e.map((r)=>{let i=jgt(r,t);if(!n&&typeof i=="function")n=!0;return i});if(n)return()=>{for(let r=0;r<o.length;r++){let i=o[r];if(typeof i=="function")i();else jgt(e[r],null)}}}}Kgt(Q0o,"composeRefs");function Eh(...e){return R0o.useCallback(Q0o(...e),e)}Kgt(Eh,"useComposedRefs");var rI=at(ln(),1),$gt=at(lo(),1),sas=Object.defineProperty,oI=(e,t)=>sas(e,"name",{value:t,configurable:!0});function aas(e,t){let n=rI.createContext(t);n.displayName=e+"Context";let o=oI((i)=>{let{children:s,...a}=i,c=rI.useMemo(()=>a,Object.values(a));return $gt.jsx(n.Provider,{value:c,children:s})},"Provider");o.displayName=e+"Provider";function r(i,s={}){let{optional:a=!1}=s,c=rI.useContext(n);if(c)return c;if(t!==void 0)return t;if(a)return;throw Error(`\`${i}\` must be used within \`${e}\``)}return oI(r,"useContext"),[o,r]}oI(aas,"createContext");function Bx(e,t=[]){let n=[];function o(i,s){let a=rI.createContext(s);a.displayName=i+"Context";let c=n.length;n=[...n,s];let l=oI((d)=>{let{scope:u,children:_,...p}=d,m=u?.[e]?.[c]||a,A=rI.useMemo(()=>p,Object.values(p));return $gt.jsx(m.Provider,{value:A,children:_})},"Provider");l.displayName=i+"Provider";function h(d,u,_={}){let{optional:p=!1}=_,m=u?.[e]?.[c]||a,A=rI.useContext(m);if(A)return A;if(s!==void 0)return s;if(p)return;throw Error(`\`${d}\` must be used within \`${i}\``)}return oI(h,"useContext"),[l,h]}oI(o,"createContext");let r=oI(()=>{let i=n.map((s)=>rI.createContext(s));return oI(function(a){let c=a?.[e]||i;return rI.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])},"useScope")},"createScope");return r.scopeName=e,[o,k0o(r,...t)]}oI(Bx,"createContextScope");function k0o(...e){let t=e[0];if(e.length===1)return t;let n=oI(()=>{let o=e.map((r)=>({useScope:r(),scopeName:r.scopeName}));return oI(function(i){let s=o.reduce((a,{useScope:c,scopeName:l})=>{let d=c(i)[`__scope${l}`];return{...a,...d}},{});return rI.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}oI(k0o,"composeContextScopes");var qgt=at(ln(),1);var L0o=at(ln(),1),t0=globalThis?.document?L0o.useLayoutEffect:()=>{};var cas=Object.defineProperty,las=(e,t)=>cas(e,"name",{value:t,configurable:!0}),has=qgt[" useId ".trim().toString()]||(()=>{return}),das=0;function CC(e){let[t,n]=qgt.useState(has());return t0(()=>{if(!e)n((o)=>o??String(das++))},[e]),e||(t?`radix-${t}`:"")}las(CC,"useId");var iI=at(ln(),1);var FTe=!0;var i8=at(ln(),1);var Fne=at(ln(),1),uas=Object.defineProperty,pas=(e,t)=>uas(e,"name",{value:t,configurable:!0}),H0o=Fne[" useEffectEvent ".trim().toString()],F0o=Fne[" useInsertionEffect ".trim().toString()];function Jgt(e){if(typeof H0o==="function")return H0o(e);let t=Fne.useRef(()=>{throw Error("Cannot call an event handler while rendering.")});if(typeof F0o==="function")F0o(()=>{t.current=e});else t0(()=>{t.current=e});return Fne.useMemo(()=>(...n)=>t.current?.(...n),[])}pas(Jgt,"useEffectEvent");var mas=Object.defineProperty,Jme=(e,t)=>mas(e,"name",{value:t,configurable:!0}),_as=iI[" useInsertionEffect ".trim().toString()]||t0;function wH({prop:e,defaultProp:t,onChange:n=Jme(()=>{},"onChange"),caller:o}){let[r,i,s]=O0o({defaultProp:t,onChange:n}),a=e!==void 0,c=a?e:r;if(FTe){let h=iI.useRef(e!==void 0);iI.useEffect(()=>{let d=h.current;if(d!==a)console.warn(`${o} is changing from ${d?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`);h.current=a},[a,o])}let l=iI.useCallback((h)=>{if(a){let d=V0o(h)?h(e):h;if(d!==e)s.current?.(d)}else i(h)},[a,e,i,s]);return[c,l]}Jme(wH,"useControllableState");function O0o({defaultProp:e,onChange:t}){let[n,o]=iI.useState(e),r=iI.useRef(n),i=iI.useRef(t);return _as(()=>{i.current=t},[t]),iI.useEffect(()=>{if(r.current!==n)i.current?.(n),r.current=n},[n,r]),[n,o,i]}Jme(O0o,"useUncontrolledState");function V0o(e){return typeof e==="function"}Jme(V0o,"isFunction");var z0o=Symbol("RADIX:SYNC_STATE");function gas(e,t,n,o){let{prop:r,defaultProp:i,onChange:s,caller:a}=t,c=r!==void 0,l=Jgt(s);if(FTe){let A=i8.useRef(r!==void 0);i8.useEffect(()=>{let g=A.current;if(g!==c)console.warn(`${a} is changing from ${g?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`);A.current=c},[c,a])}let h=[{...n,state:i}];if(o)h.push(o);let[d,u]=i8.useReducer((A,g)=>{if(g.type===z0o)return{...A,state:g.state};let f=e(A,g);if(c&&!Object.is(f.state,A.state))l(f.state);return f},...h),_=d.state,p=i8.useRef(_);i8.useEffect(()=>{if(p.current!==_){if(p.current=_,!c)l(_)}},[_,p,c]);let m=i8.useMemo(()=>{if(r!==void 0)return{...d,state:r};return d},[d,r]);return i8.useEffect(()=>{if(c&&!Object.is(r,d.state))u({type:z0o,state:r})},[r,d.state,c]),[m,u]}Jme(gas,"useControllableStateReducer");var Fd=at(ln(),1);var $0o=at(ln(),1),q0o=at(z7(),1);var w2=at(ln(),1);var Aas=Object.defineProperty,bC=(e,t)=>Aas(e,"name",{value:t,configurable:!0});function IC(e){let t=w2.forwardRef((n,o)=>{let{children:r,...i}=n,s=null,a=!1,c=[];if(r=j0o(r),w2.Children.forEach(r,(u)=>{if(W0o(u)){a=!0;let _=u,p="child"in _.props?_.props.child:_.props.children;while(Zgt(p)&&typeof zTe==="function")p=zTe(p._payload);s=yas(_,p),c.push(s?.props?.children)}else c.push(u)}),s)s=w2.cloneElement(s,void 0,c);else if(!a&&w2.Children.count(r)===1&&w2.isValidElement(r))s=r;let l=s?U0o(s):void 0,h=Eh(o,l);if(!s){if(r||r===0)throw Error(a?bas(e):Cas(e));return r}let d=G0o(i,s.props??{});if(s.type!==w2.Fragment)d.ref=o?h:l;return w2.cloneElement(s,d)});return t.displayName=`${e}.Slot`,t}bC(IC,"createSlot");var Y0o=Symbol.for("radix.slottable");function fas(e){let t=bC((n)=>("child"in n)?n.children(n.child):n.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=Y0o,t}bC(fas,"createSlottable");var yas=bC((e,t)=>{if("child"in e.props){if(!w2.isValidElement(t))return null;return w2.cloneElement(t,void 0,e.props.children(t.props.children))}return w2.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function G0o(e,t){let n={...t};for(let o in t){let r=e[o],i=t[o];if(/^on[A-Z]/.test(o)){if(r&&i)n[o]=(...a)=>{let c=i(...a);return r(...a),c};else if(r)n[o]=r}else if(o==="style")n[o]={...r,...i};else if(o==="className")n[o]=[r,i].filter(Boolean).join(" ");else if(o==="aria-describedby")n[o]=K0o(i,r)}return{...e,...n}}bC(G0o,"mergeProps");function U0o(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}bC(U0o,"getElementRef");function W0o(e){return w2.isValidElement(e)&&typeof e.type==="function"&&"__radixId"in e.type&&e.type.__radixId===Y0o}bC(W0o,"isSlottable");var xas=Symbol.for("react.lazy");function Zgt(e){return e!=null&&typeof e==="object"&&"$$typeof"in e&&e.$$typeof===xas&&"_payload"in e&&X0o(e._payload)}bC(Zgt,"isLazyComponent");function X0o(e){return typeof e==="object"&&e!==null&&"then"in e}bC(X0o,"isPromiseLike");function j0o(e){let t=e;while(Zgt(t)&&typeof zTe==="function")t=zTe(t._payload);return t}bC(j0o,"useUnwrappedLazy");function K0o(...e){let t=new Set;for(let n of e){if(typeof n!=="string")continue;for(let o of String(n).trim().split(/\s+/))if(o)t.add(o)}return t.size>0?Array.from(t).join(" "):void 0}bC(K0o,"concatAriaDescribedby");var Cas=bC((e)=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),bas=bC((e)=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),zTe=w2[" use ".trim().toString()];var J0o=at(lo(),1),Ias=Object.defineProperty,vas=(e,t)=>Ias(e,"name",{value:t,configurable:!0}),Sas=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Rp=Sas.reduce((e,t)=>{let n=IC(`Primitive.${t}`),o=$0o.forwardRef((r,i)=>{let{asChild:s,...a}=r,c=s?n:t;if(typeof window<"u")window[Symbol.for("radix-ui")]=!0;return J0o.jsx(c,{...a,ref:i})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function Zme(e,t){if(e)q0o.flushSync(()=>e.dispatchEvent(t))}vas(Zme,"dispatchDiscreteCustomEvent");var e_e=at(ln(),1),Pas=Object.defineProperty,Eas=(e,t)=>Pas(e,"name",{value:t,configurable:!0}),Z0o=e_e[" useInsertionEffect ".trim().toString()];function Tx(e){let t=e_e.useRef(e);if(typeof Z0o==="function")Z0o(()=>{t.current=e});else t0(()=>{t.current=e});return e_e.useMemo(()=>(...n)=>t.current?.(...n),[])}Eas(Tx,"useCallbackRef");var tpo=at(lo(),1),Mas=Object.defineProperty,Sf=(e,t)=>Mas(e,"name",{value:t,configurable:!0}),eAt="dismissableLayer.update",was="dismissableLayer.pointerDownOutside",Bas="dismissableLayer.focusOutside",epo,npo=Fd.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),OTe=Fd.forwardRef(Sf(function(t,n){let{disableOutsidePointerEvents:o=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:c,onDismiss:l,...h}=t,d=Fd.useContext(npo),[u,_]=Fd.useState(null),p=u?.ownerDocument??globalThis?.document,[,m]=Fd.useState({}),A=Eh(n,_),g=Array.from(d.layers),[f]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=f?g.indexOf(f):-1,x=u?g.indexOf(u):-1,C=d.layersWithOutsidePointerEventsDisabled.size>0,b=x>=y,I=Fd.useRef(!1),v=opo((T)=>{if(s?.(T),c?.(T),!T.defaultPrevented)l?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:I,dismissableSurfaces:d.dismissableSurfaces,shouldHandlePointerDownOutside:Fd.useCallback((T)=>{if(!(T instanceof Node))return!1;let N=[...d.branches].some((D)=>D.contains(T));return b&&!N},[d.branches,b])}),P=rpo((T)=>{if(r&&I.current)return;let N=T.target;if([...d.branches].some((L)=>L.contains(N)))return;if(a?.(T),c?.(T),!T.defaultPrevented)l?.()},p),M=u?x===g.length-1:!1,B=Tx((T)=>{if(T.key!=="Escape")return;if(i?.(T),!T.defaultPrevented&&l)T.preventDefault(),l()});return Fd.useEffect(()=>{if(!M)return;return p.addEventListener("keydown",B,{capture:!0}),()=>p.removeEventListener("keydown",B,{capture:!0})},[p,M,B]),Fd.useEffect(()=>{if(!u)return;if(o){if(d.layersWithOutsidePointerEventsDisabled.size===0)epo=p.body.style.pointerEvents,p.body.style.pointerEvents="none";d.layersWithOutsidePointerEventsDisabled.add(u)}return d.layers.add(u),tAt(),()=>{if(o){if(d.layersWithOutsidePointerEventsDisabled.delete(u),d.layersWithOutsidePointerEventsDisabled.size===0)p.body.style.pointerEvents=epo}}},[u,p,o,d]),Fd.useEffect(()=>()=>{if(!u)return;d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),tAt()},[u,d]),Fd.useEffect(()=>{let T=Sf(()=>m({}),"handleUpdate");return document.addEventListener(eAt,T),()=>document.removeEventListener(eAt,T)},[]),tpo.jsx(Rp.div,{...h,ref:A,style:{pointerEvents:C?b?"auto":"none":void 0,...t.style},onFocusCapture:ka(t.onFocusCapture,P.onFocusCapture),onBlurCapture:ka(t.onBlurCapture,P.onBlurCapture),onPointerDownCapture:ka(t.onPointerDownCapture,v.onPointerDownCapture)})},"DismissableLayer"));function nAt(){let e=Fd.useContext(npo),[t,n]=Fd.useState(null);return Fd.useEffect(()=>{if(!t)return;return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Sf(nAt,"useDismissableLayerSurface");var Tas=Sf(()=>!0,"IS_TRUE");function opo(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:o=!1,isDeferredPointerDownOutsideRef:r,dismissableSurfaces:i,shouldHandlePointerDownOutside:s=Tas}=t,a=Tx(e),c=Fd.useRef(!1),l=Fd.useRef(!1),h=Fd.useRef(new Map),d=Fd.useRef(()=>{});return Fd.useEffect(()=>{function u(){l.current=!1,r.current=!1,h.current.clear()}Sf(u,"resetOutsideInteraction");function _(){return Array.from(h.current.values()).some(Boolean)}Sf(_,"isOutsideInteractionIntercepted");function p(y){if(!l.current)return;let x=y.target;if(!(x instanceof Node&&[...i].some((b)=>b.contains(x))))h.current.set(y.type,!0);if(y.type==="click")window.setTimeout(()=>{if(l.current)d.current()},0)}Sf(p,"handleInteractionCapture");function m(y){if(l.current)h.current.set(y.type,!1)}Sf(m,"handleInteractionBubble");let A=Sf((y)=>{if(y.target&&!c.current){let C=function(){n.removeEventListener("click",d.current);let I=_();if(u(),!I)oAt(was,a,b,{discrete:!0})};var x=C;if(Sf(C,"handleAndDispatchPointerDownOutsideEvent"),!s(y.target)){n.removeEventListener("click",d.current),u(),c.current=!1;return}let b={originalEvent:y};if(l.current=!0,r.current=o&&y.button===0,h.current.clear(),!o||y.button!==0)C();else n.removeEventListener("click",d.current),d.current=C,n.addEventListener("click",d.current,{once:!0})}else n.removeEventListener("click",d.current),u();c.current=!1},"handlePointerDown"),g=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(let y of g)n.addEventListener(y,p,!0),n.addEventListener(y,m);let f=window.setTimeout(()=>{n.addEventListener("pointerdown",A)},0);return()=>{window.clearTimeout(f),n.removeEventListener("pointerdown",A),n.removeEventListener("click",d.current);for(let y of g)n.removeEventListener(y,p,!0),n.removeEventListener(y,m)}},[n,a,o,r,i,s]),{onPointerDownCapture:Sf(()=>c.current=!0,"onPointerDownCapture")}}Sf(opo,"usePointerDownOutside");function rpo(e,t=globalThis?.document){let n=Tx(e),o=Fd.useRef(!1);return Fd.useEffect(()=>{let r=Sf((i)=>{if(i.target&&!o.current)oAt(Bas,n,{originalEvent:i},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:Sf(()=>o.current=!0,"onFocusCapture"),onBlurCapture:Sf(()=>o.current=!1,"onBlurCapture")}}Sf(rpo,"useFocusOutside");function tAt(){let e=new CustomEvent(eAt);document.dispatchEvent(e)}Sf(tAt,"dispatchUpdate");function oAt(e,t,n,{discrete:o}){let r=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});if(t)r.addEventListener(e,t,{once:!0});if(o)Zme(r,i);else r.dispatchEvent(i)}Sf(oAt,"handleAndDispatchCustomEvent");var Qp=at(ln(),1);var cAt=at(lo(),1),Das=Object.defineProperty,hg=(e,t)=>Das(e,"name",{value:t,configurable:!0}),rAt="focusScope.autoFocusOnMount",iAt="focusScope.autoFocusOnUnmount",ipo={bubbles:!1,cancelable:!0},VTe=Qp.forwardRef(hg(function(t,n){let{loop:o=!1,trapped:r=!1,branches:i,onMountAutoFocus:s,onUnmountAutoFocus:a,...c}=t,[l,h]=Qp.useState(null),d=Tx(s),u=Tx(a),_=Qp.useRef(null),p=Eh(n,h),m=Qp.useRef(i);Qp.useEffect(()=>{m.current=i});let A=Qp.useCallback((y)=>{if(!y)return!1;if(l?.contains(y))return!0;return Boolean(m.current?.some((x)=>x.contains(y)))},[l]),g=Qp.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;Qp.useEffect(()=>{if(r){let b=function(M){if(g.paused||!l)return;let B=M.target;if(A(B))_.current=B;else tD(_.current,{select:!0})},I=function(M){if(g.paused||!l)return;let B=M.relatedTarget;if(B===null)return;if(!A(B))tD(_.current,{select:!0})},v=function(M){if(document.activeElement!==document.body)return;for(let T of M)if(T.removedNodes.length>0)tD(l)};var y=b,x=I,C=v;hg(b,"handleFocusIn"),hg(I,"handleFocusOut"),hg(v,"handleMutations"),document.addEventListener("focusin",b),document.addEventListener("focusout",I);let P=new MutationObserver(v);if(l)P.observe(l,{childList:!0,subtree:!0});return()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",I),P.disconnect()}}},[r,l,g.paused,A]),Qp.useEffect(()=>{if(l){spo.add(g);let y=document.activeElement;if(!l.contains(y)){let C=new CustomEvent(rAt,ipo);if(l.addEventListener(rAt,d),l.dispatchEvent(C),!C.defaultPrevented){if(cpo(ppo(hAt(l)),{select:!0}),document.activeElement===y)tD(l)}}return()=>{l.removeEventListener(rAt,d);let C=l.ownerDocument,b=CustomEvent;setTimeout(()=>{let I=new b(iAt,ipo);if(l.addEventListener(iAt,u),l.dispatchEvent(I),!I.defaultPrevented)tD(y??C.body,{select:!0});l.removeEventListener(iAt,u),spo.remove(g)},0)}}},[l,d,u,g]);let f=Qp.useCallback((y)=>{if(!o&&!r)return;if(g.paused)return;let x=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,C=document.activeElement;if(x&&C){let b=y.currentTarget,[I,v]=lpo(b);if(!(I&&v)){if(C===b)y.preventDefault()}else if(!y.shiftKey&&C===v){if(y.preventDefault(),o)tD(I,{select:!0})}else if(y.shiftKey&&C===I){if(y.preventDefault(),o)tD(v,{select:!0})}}},[o,r,g.paused]);return cAt.jsx(Rp.div,{tabIndex:-1,...c,ref:p,onKeyDown:f})},"FocusScope")),apo=Qp.createContext(null);function t_e({registry:e,children:t}){if(!e)return t;return cAt.jsx(apo.Provider,{value:e,children:t})}hg(t_e,"FocusScopeBranchProvider");function n_e(){let[e,t]=Qp.useState([]),n=Qp.useMemo(()=>({add:hg((o)=>t((r)=>r.includes(o)?r:[...r,o]),"add"),remove:hg((o)=>t((r)=>r.filter((i)=>i!==o)),"remove")}),[]);return{nodes:e,registry:n}}hg(n_e,"useFocusScopeBranchRegistry");function lAt(e){let t=Qp.useContext(apo);Qp.useEffect(()=>{if(!e||!t)return;return t.add(e),()=>t.remove(e)},[e,t])}hg(lAt,"useFocusScopeBranch");function cpo(e,{select:t=!1}={}){let n=document.activeElement;for(let o of e)if(tD(o,{select:t}),document.activeElement!==n)return}hg(cpo,"focusFirst");function lpo(e){let t=hAt(e),n=sAt(t,e),o=sAt(t.reverse(),e);return[n,o]}hg(lpo,"getTabbableEdges");function hAt(e){let t=[],o=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:hg((r)=>{let i=r.tagName==="INPUT"&&r.type==="hidden";if(r.disabled||r.hidden||i)return NodeFilter.FILTER_SKIP;return r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});while(o.nextNode())t.push(o.currentNode);return t}hg(hAt,"getTabbableCandidates");function sAt(e,t){let n=typeof t.checkVisibility==="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(let o of e)if(!(n?!o.checkVisibility({checkVisibilityCSS:!0}):hpo(o,{upTo:t})))return o}hg(sAt,"findVisible");function hpo(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;while(e){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}hg(hpo,"isHidden");function dpo(e){return e.tagName==="INPUT"&&typeof e.select==="function"}hg(dpo,"isSelectableInput");function tD(e,{select:t=!1}={}){if(e&&e.focus){let o=(e.ownerDocument??document).activeElement;if(e.focus({preventScroll:!0}),e!==o&&dpo(e)&&t)e.select()}}hg(tD,"focus");var spo=upo();function upo(){let e=[];return{add(t){let n=e[0];if(t!==n)n?.pause();e=aAt(e,t),e.unshift(t)},remove(t){e=aAt(e,t),e[0]?.resume()}}}hg(upo,"createFocusScopesStack");function aAt(e,t){let n=[...e],o=n.indexOf(t);if(o!==-1)n.splice(o,1);return n}hg(aAt,"arrayRemove");function ppo(e){return e.filter((t)=>t.tagName!=="A")}hg(ppo,"removeLinks");var YTe=at(ln(),1),mpo=at(z7(),1);var _po=at(lo(),1),Nas=Object.defineProperty,Ras=(e,t)=>Nas(e,"name",{value:t,configurable:!0}),GTe=YTe.forwardRef(Ras(function(t,n){let{container:o,...r}=t,[i,s]=YTe.useState(!1);t0(()=>s(!0),[]);let a=o||i&&globalThis?.document?.body;return a?mpo.createPortal(_po.jsx(Rp.div,{...r,ref:n}),a):null},"Portal"));var B2=at(ln(),1);var gpo=at(ln(),1),Qas=Object.defineProperty,nD=(e,t)=>Qas(e,"name",{value:t,configurable:!0});function Apo(e,t){return gpo.useReducer((n,o)=>t[n][o]??n,e)}nD(Apo,"useStateMachine");var oD=nD((e)=>{let{present:t,children:n}=e,o=fpo(t),r=typeof n==="function"?n({present:o.isPresent}):B2.Children.only(n),i=ypo(o.ref,xpo(r));return typeof n==="function"||o.isPresent?B2.cloneElement(r,{ref:i}):null},"Presence");function fpo(e){let[t,n]=B2.useState(),o=B2.useRef(null),r=B2.useRef(e),i=B2.useRef("none"),s=B2.useRef(void 0),a=e?"mounted":"unmounted",[c,l]=Apo(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return B2.useEffect(()=>{if(c==="mounted")i.current=s.current??zne(o.current),s.current=void 0;else i.current="none"},[c]),t0(()=>{let h=o.current,d=r.current;if(d!==e){let _=i.current,p=zne(h);if(e)s.current=p,l("MOUNT");else if(p==="none"||h?.display==="none")l("UNMOUNT");else if(d&&_!==p)l("ANIMATION_OUT");else l("UNMOUNT");r.current=e}},[e,l]),t0(()=>{if(t){let h,d=t.ownerDocument.defaultView??window,u=nD((p)=>{let A=zne(o.current).includes(CSS.escape(p.animationName));if(p.target===t&&A){if(l("ANIMATION_END"),!r.current){let g=t.style.animationFillMode;t.style.animationFillMode="forwards",h=d.setTimeout(()=>{if(t.style.animationFillMode==="forwards")t.style.animationFillMode=g})}}},"handleAnimationEnd"),_=nD((p)=>{if(p.target===t)i.current=zne(o.current)},"handleAnimationStart");return t.addEventListener("animationstart",_),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{d.clearTimeout(h),t.removeEventListener("animationstart",_),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:B2.useCallback((h)=>{if(h){let d=getComputedStyle(h);o.current=d,s.current=zne(d)}else o.current=null;n(h)},[])}}nD(fpo,"usePresence");function dAt(e,t){if(typeof e==="function")return e(t);else if(e!==null&&e!==void 0)e.current=t}nD(dAt,"setRef");function ypo(...e){let t=B2.useRef(e);return t.current=e,B2.useCallback((n)=>{let o=t.current,r=!1,i=o.map((s)=>{let a=dAt(s,n);if(!r&&typeof a==="function")r=!0;return a});if(r)return()=>{for(let s=0;s<i.length;s++){let a=i[s];if(typeof a==="function")a();else dAt(o[s],null)}}},[])}nD(ypo,"useStableComposedRefs");function zne(e){return e?.animationName||"none"}nD(zne,"getAnimationName");function xpo(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}nD(xpo,"getElementRef");var Cpo=at(ln(),1),kas=Object.defineProperty,pAt=(e,t)=>kas(e,"name",{value:t,configurable:!0}),UTe=0,One=null;function Las(e){return Vne(),e.children}pAt(Las,"FocusGuards");function Vne(){Cpo.useEffect(()=>{if(!One)One={start:uAt(),end:uAt()};let{start:e,end:t}=One;if(document.body.firstElementChild!==e)document.body.insertAdjacentElement("afterbegin",e);if(document.body.lastElementChild!==t)document.body.insertAdjacentElement("beforeend",t);return UTe++,()=>{if(UTe===1)One?.start.remove(),One?.end.remove(),One=null;UTe=Math.max(0,UTe-1)}},[])}pAt(Vne,"useFocusGuards");function uAt(){let e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}pAt(uAt,"createFocusGuard");var A4=function(){return A4=Object.assign||function(t){for(var n,o=1,r=arguments.length;o<r;o++){n=arguments[o];for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i))t[i]=n[i]}return t},A4.apply(this,arguments)};function WTe(e,t){var n={};for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0)n[o]=e[o];if(e!=null&&typeof Object.getOwnPropertySymbols==="function"){for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)if(t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r]))n[o[r]]=e[o[r]]}return n}function bpo(e,t,n){if(n||arguments.length===2){for(var o=0,r=t.length,i;o<r;o++)if(i||!(o in t)){if(!i)i=Array.prototype.slice.call(t,0,o);i[o]=t[o]}}return e.concat(i||Array.prototype.slice.call(t))}var qTe=at(ln());var X1=at(ln());var QU="right-scroll-bar-position",kU="width-before-scroll-bar",mAt="with-scroll-bars-hidden",_At="--removed-body-scroll-bar-size";var jTe=at(ln());function XTe(e,t){if(typeof e==="function")e(t);else if(e)e.current=t;return e}var Ipo=at(ln());function vpo(e,t){var n=Ipo.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(o){var r=n.value;if(r!==o)n.value=o,n.callback(o,r)}}}})[0];return n.callback=t,n.facade}var Has=typeof window<"u"?jTe.useLayoutEffect:jTe.useEffect,Spo=new WeakMap;function gAt(e,t){var n=vpo(t||null,function(o){return e.forEach(function(r){return XTe(r,o)})});return Has(function(){var o=Spo.get(n);if(o){var r=new Set(o),i=new Set(e),s=n.current;r.forEach(function(a){if(!i.has(a))XTe(a,null)}),i.forEach(function(a){if(!r.has(a))XTe(a,s)})}Spo.set(n,e)},[e]),n}function Fas(e){return e}function zas(e,t){if(t===void 0)t=Fas;var n=[],o=!1,r={read:function(){if(o)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");if(n.length)return n[n.length-1];return e},useMedium:function(i){var s=t(i,o);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(i){o=!0;while(n.length){var s=n;n=[],s.forEach(i)}n={push:function(a){return i(a)},filter:function(){return n}}},assignMedium:function(i){o=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(i),s=n}var c=function(){var h=s;s=[],h.forEach(i)},l=function(){return Promise.resolve().then(c)};l(),n={push:function(h){s.push(h),l()},filter:function(h){return s=s.filter(h),n}}}};return r}function AAt(e){if(e===void 0)e={};var t=zas(null);return t.options=A4({async:!0,ssr:!1},e),t}var Ppo=at(ln()),Epo=function(e){var t=e.sideCar,n=WTe(e,["sideCar"]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var o=t.read();if(!o)throw Error("Sidecar medium not found");return Ppo.createElement(o,A4({},n))};Epo.isSideCarExport=!0;function fAt(e,t){return e.useMedium(t),Epo}var KTe=AAt();var yAt=function(){return},o_e=X1.forwardRef(function(e,t){var n=X1.useRef(null),o=X1.useState({onScrollCapture:yAt,onWheelCapture:yAt,onTouchMoveCapture:yAt}),r=o[0],i=o[1],{forwardProps:s,children:a,className:c,removeScrollBar:l,enabled:h,shards:d,sideCar:u,noRelative:_,noIsolation:p,inert:m,allowPinchZoom:A,as:g}=e,f=g===void 0?"div":g,y=e.gapMode,x=WTe(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=u,b=gAt([n,t]),I=A4(A4({},x),r);return X1.createElement(X1.Fragment,null,h&&X1.createElement(C,{sideCar:KTe,removeScrollBar:l,shards:d,noRelative:_,noIsolation:p,inert:m,setCallbacks:i,allowPinchZoom:!!A,lockRef:n,gapMode:y}),s?X1.cloneElement(X1.Children.only(a),A4(A4({},I),{ref:b})):X1.createElement(f,A4({},I,{className:c,ref:b}),a))});o_e.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};o_e.classNames={fullWidth:kU,zeroRight:QU};var Q0=at(ln());var Gne=at(ln());var Bpo=at(ln());var Mpo;var wpo=function(){if(Mpo)return Mpo;if(typeof __webpack_nonce__<"u")return __webpack_nonce__;return};function Oas(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=wpo();if(t)e.setAttribute("nonce",t);return e}function Vas(e,t){if(e.styleSheet)e.styleSheet.cssText=t;else e.appendChild(document.createTextNode(t))}function Yas(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var xAt=function(){var e=0,t=null;return{add:function(n){if(e==0){if(t=Oas())Vas(t,n),Yas(t)}e++},remove:function(){if(e--,!e&&t)t.parentNode&&t.parentNode.removeChild(t),t=null}}};var CAt=function(){var e=xAt();return function(t,n){Bpo.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}};var r_e=function(){var e=CAt(),t=function(n){var{styles:o,dynamic:r}=n;return e(o,r),null};return t};var Gas={left:0,top:0,right:0,gap:0},bAt=function(e){return parseInt(e||"",10)||0},Uas=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],o=t[e==="padding"?"paddingTop":"marginTop"],r=t[e==="padding"?"paddingRight":"marginRight"];return[bAt(n),bAt(o),bAt(r)]},IAt=function(e){if(e===void 0)e="margin";if(typeof window>"u")return Gas;var t=Uas(e),n=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-n+t[2]-t[0])}};var Was=r_e(),Yne="data-scroll-locked",Xas=function(e,t,n,o){var{left:r,top:i,right:s,gap:a}=e;if(n===void 0)n="margin";return`
  .`.concat(mAt,` {
   overflow: hidden `).concat(o,`;
   padding-right: `).concat(a,"px ").concat(o,`;
  }
  body[`).concat(Yne,`] {
    overflow: hidden `).concat(o,`;
    overscroll-behavior: contain;
    `).concat([t&&"position: relative ".concat(o,";"),n==="margin"&&`
    padding-left: `.concat(r,`px;
    padding-top: `).concat(i,`px;
    padding-right: `).concat(s,`px;
    margin-left:0;
    margin-top:0;
    margin-right: `).concat(a,"px ").concat(o,`;
    `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(o,";")].filter(Boolean).join(""),`
  }
  
  .`).concat(QU,` {
    right: `).concat(a,"px ").concat(o,`;
  }
  
  .`).concat(kU,` {
    margin-right: `).concat(a,"px ").concat(o,`;
  }
  
  .`).concat(QU," .").concat(QU,` {
    right: 0 `).concat(o,`;
  }
  
  .`).concat(kU," .").concat(kU,` {
    margin-right: 0 `).concat(o,`;
  }
  
  body[`).concat(Yne,`] {
    `).concat(_At,": ").concat(a,`px;
  }
`)},Tpo=function(){var e=parseInt(document.body.getAttribute(Yne)||"0",10);return isFinite(e)?e:0},jas=function(){Gne.useEffect(function(){return document.body.setAttribute(Yne,(Tpo()+1).toString()),function(){var e=Tpo()-1;if(e<=0)document.body.removeAttribute(Yne);else document.body.setAttribute(Yne,e.toString())}},[])},vAt=function(e){var{noRelative:t,noImportant:n,gapMode:o}=e,r=o===void 0?"margin":o;jas();var i=Gne.useMemo(function(){return IAt(r)},[r]);return Gne.createElement(Was,{styles:Xas(i,!t,r,!n?"!important":"")})};var SAt=!1;if(typeof window<"u")try{Une=Object.defineProperty({},"passive",{get:function(){return SAt=!0,!0}}),window.addEventListener("test",Une,Une),window.removeEventListener("test",Une,Une)}catch(e){SAt=!1}var Une,LU=SAt?{passive:!1}:!1;var Kas=function(e){return e.tagName==="TEXTAREA"},Dpo=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Kas(e)&&n[t]==="visible")},$as=function(e){return Dpo(e,"overflowY")},qas=function(e){return Dpo(e,"overflowX")},PAt=function(e,t){var n=t.ownerDocument,o=t;do{if(typeof ShadowRoot<"u"&&o instanceof ShadowRoot)o=o.host;var r=Npo(e,o);if(r){var i=Rpo(e,o),s=i[1],a=i[2];if(s>a)return!0}o=o.parentNode}while(o&&o!==n.body);return!1},Jas=function(e){var{scrollTop:t,scrollHeight:n,clientHeight:o}=e;return[t,n,o]},Zas=function(e){var{scrollLeft:t,scrollWidth:n,clientWidth:o}=e;return[t,n,o]},Npo=function(e,t){return e==="v"?$as(t):qas(t)},Rpo=function(e,t){return e==="v"?Jas(t):Zas(t)},ecs=function(e,t){return e==="h"&&t==="rtl"?-1:1},Qpo=function(e,t,n,o,r){var i=ecs(e,window.getComputedStyle(t).direction),s=i*o,a=n.target,c=t.contains(a),l=!1,h=s>0,d=0,u=0;do{if(!a)break;var _=Rpo(e,a),p=_[0],m=_[1],A=_[2],g=m-A-i*p;if(p||g){if(Npo(e,a))d+=g,u+=p}var f=a.parentNode;a=f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE?f.host:f}while(!c&&a!==document.body||c&&(t.contains(a)||t===a));if(h&&(r&&Math.abs(d)<1||!r&&s>d))l=!0;else if(!h&&(r&&Math.abs(u)<1||!r&&-s>u))l=!0;return l};var $Te=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},kpo=function(e){return[e.deltaX,e.deltaY]},Lpo=function(e){return e&&"current"in e?e.current:e},tcs=function(e,t){return e[0]===t[0]&&e[1]===t[1]},ncs=function(e){return`
  .block-interactivity-`.concat(e,` {pointer-events: none;}
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},ocs=0,Wne=[];function Hpo(e){var t=Q0.useRef([]),n=Q0.useRef([0,0]),o=Q0.useRef(),r=Q0.useState(ocs++)[0],i=Q0.useState(r_e)[0],s=Q0.useRef(e);Q0.useEffect(function(){s.current=e},[e]),Q0.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var m=bpo([e.lockRef.current],(e.shards||[]).map(Lpo),!0).filter(Boolean);return m.forEach(function(A){return A.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),m.forEach(function(A){return A.classList.remove("allow-interactivity-".concat(r))})}}return},[e.inert,e.lockRef.current,e.shards]);var a=Q0.useCallback(function(m,A){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!s.current.allowPinchZoom;var g=$Te(m),f=n.current,y="deltaX"in m?m.deltaX:f[0]-g[0],x="deltaY"in m?m.deltaY:f[1]-g[1],C,b=m.target,I=Math.abs(y)>Math.abs(x)?"h":"v";if("touches"in m&&I==="h"&&b.type==="range")return!1;var v=window.getSelection(),P=v&&v.anchorNode,M=P?P===b||P.contains(b):!1;if(M)return!1;var B=PAt(I,b);if(!B)return!0;if(B)C=I;else C=I==="v"?"h":"v",B=PAt(I,b);if(!B)return!1;if(!o.current&&"changedTouches"in m&&(y||x))o.current=C;if(!C)return!0;var T=o.current||C;return Qpo(T,A,m,T==="h"?y:x,!0)},[]),c=Q0.useCallback(function(m){var A=m;if(!Wne.length||Wne[Wne.length-1]!==i)return;var g="deltaY"in A?kpo(A):$Te(A),f=t.current.filter(function(C){return C.name===A.type&&(C.target===A.target||A.target===C.shadowParent)&&tcs(C.delta,g)})[0];if(f&&f.should){if(A.cancelable)A.preventDefault();return}if(!f){var y=(s.current.shards||[]).map(Lpo).filter(Boolean).filter(function(C){return C.contains(A.target)}),x=y.length>0?a(A,y[0]):!s.current.noIsolation;if(x){if(A.cancelable)A.preventDefault()}}},[]),l=Q0.useCallback(function(m,A,g,f){var y={name:m,delta:A,target:g,should:f,shadowParent:rcs(g)};t.current.push(y),setTimeout(function(){t.current=t.current.filter(function(x){return x!==y})},1)},[]),h=Q0.useCallback(function(m){n.current=$Te(m),o.current=void 0},[]),d=Q0.useCallback(function(m){l(m.type,kpo(m),m.target,a(m,e.lockRef.current))},[]),u=Q0.useCallback(function(m){l(m.type,$Te(m),m.target,a(m,e.lockRef.current))},[]);Q0.useEffect(function(){return Wne.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:u}),document.addEventListener("wheel",c,LU),document.addEventListener("touchmove",c,LU),document.addEventListener("touchstart",h,LU),function(){Wne=Wne.filter(function(m){return m!==i}),document.removeEventListener("wheel",c,LU),document.removeEventListener("touchmove",c,LU),document.removeEventListener("touchstart",h,LU)}},[]);var{removeScrollBar:_,inert:p}=e;return Q0.createElement(Q0.Fragment,null,p?Q0.createElement(i,{styles:ncs(r)}):null,_?Q0.createElement(vAt,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function rcs(e){var t=null;while(e!==null){if(e instanceof ShadowRoot)t=e.host,e=e.host;e=e.parentNode}return t}var Fpo=fAt(KTe,Hpo);var zpo=qTe.forwardRef(function(e,t){return qTe.createElement(o_e,A4({},e,{ref:t,sideCar:Fpo}))});zpo.classNames=o_e.classNames;var i_e=zpo;var ics=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Xne=new WeakMap,JTe=new WeakMap,ZTe={},EAt=0,Opo=function(e){return e&&(e.host||Opo(e.parentNode))},scs=function(e,t){return t.map(function(n){if(e.contains(n))return n;var o=Opo(n);if(o&&e.contains(o))return o;return console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null}).filter(function(n){return Boolean(n)})},acs=function(e,t,n,o){var r=scs(t,Array.isArray(e)?e:[e]);if(!ZTe[n])ZTe[n]=new WeakMap;var i=ZTe[n],s=[],a=new Set,c=new Set(r),l=function(d){if(!d||a.has(d))return;a.add(d),l(d.parentNode)};r.forEach(l);var h=function(d){if(!d||c.has(d))return;Array.prototype.forEach.call(d.children,function(u){if(a.has(u))h(u);else try{var _=u.getAttribute(o),p=_!==null&&_!=="false",m=(Xne.get(u)||0)+1,A=(i.get(u)||0)+1;if(Xne.set(u,m),i.set(u,A),s.push(u),m===1&&p)JTe.set(u,!0);if(A===1)u.setAttribute(n,"true");if(!p)u.setAttribute(o,"true")}catch(g){console.error("aria-hidden: cannot operate on ",u,g)}})};return h(t),a.clear(),EAt++,function(){if(s.forEach(function(d){var u=Xne.get(d)-1,_=i.get(d)-1;if(Xne.set(d,u),i.set(d,_),!u){if(!JTe.has(d))d.removeAttribute(o);JTe.delete(d)}if(!_)d.removeAttribute(n)}),EAt--,!EAt)Xne=new WeakMap,Xne=new WeakMap,JTe=new WeakMap,ZTe={}}},eDe=function(e,t,n){if(n===void 0)n="data-aria-hidden";var o=Array.from(Array.isArray(e)?e:[e]),r=t||ics(e);if(!r)return function(){return null};return o.push.apply(o,Array.from(r.querySelectorAll("[aria-live], script"))),acs(o,r,n,"aria-hidden")};var dg=at(lo(),1),ccs=Object.defineProperty,vC=(e,t)=>ccs(e,"name",{value:t,configurable:!0}),wAt="Dialog",[Vpo,Bza]=Bx(wAt),[lcs,GE]=Vpo(wAt),Ypo=vC((e)=>{let{__scopeDialog:t,children:n,open:o,defaultOpen:r,onOpenChange:i,modal:s=!0}=e,a=mu.useRef(null),c=mu.useRef(null),{nodes:l,registry:h}=n_e(),[d,u]=wH({prop:o,defaultProp:r??!1,onChange:i,caller:wAt}),[_,p]=mu.useState(0),[m,A]=mu.useState(0);return dg.jsx(lcs,{scope:t,triggerRef:a,contentRef:c,contentId:CC(),titleId:CC(),descriptionId:CC(),titlePresent:_>0,descriptionPresent:m>0,setTitleCount:p,setDescriptionCount:A,open:d,onOpenChange:u,onOpenToggle:mu.useCallback(()=>u((g)=>!g),[u]),modal:s,branchNodes:l,branchRegistry:h,children:n})},"Dialog");var Gpo="DialogPortal",[hcs,Upo]=Vpo(Gpo,{forceMount:void 0}),Wpo=vC((e)=>{let{__scopeDialog:t,forceMount:n,children:o,container:r}=e,i=GE(Gpo,t);return dg.jsx(hcs,{scope:t,forceMount:n,children:mu.Children.map(o,(s)=>dg.jsx(oD,{present:n||i.open,children:dg.jsx(GTe,{asChild:!0,container:r,children:s})}))})},"DialogPortal"),MAt="DialogOverlay",Xpo=mu.forwardRef(vC(function(t,n){let o=Upo(MAt,t.__scopeDialog),{forceMount:r=o.forceMount,...i}=t,s=GE(MAt,t.__scopeDialog);return s.modal?dg.jsx(oD,{present:r||s.open,children:dg.jsx(ucs,{...i,ref:n})}):null},"DialogOverlay")),dcs=IC("DialogOverlay.RemoveScroll"),ucs=mu.forwardRef(vC(function(t,n){let{__scopeDialog:o,...r}=t,i=GE(MAt,o),s=nAt(),a=Eh(n,s);return dg.jsx(i_e,{as:dcs,allowPinchZoom:!0,shards:mu.useMemo(()=>[i.contentRef,...i.branchNodes.map((c)=>({current:c}))],[i.contentRef,i.branchNodes]),children:dg.jsx(Rp.div,{"data-state":BAt(i.open),...r,ref:a,style:{pointerEvents:"auto",...r.style}})})},"DialogOverlayImpl")),s_e="DialogContent",jpo=mu.forwardRef(vC(function(t,n){let o=Upo(s_e,t.__scopeDialog),{forceMount:r=o.forceMount,...i}=t,s=GE(s_e,t.__scopeDialog);return dg.jsx(oD,{present:r||s.open,children:s.modal?dg.jsx(pcs,{...i,ref:n}):dg.jsx(mcs,{...i,ref:n})})},"DialogContent")),pcs=mu.forwardRef(vC(function(t,n){let o=GE(s_e,t.__scopeDialog),r=mu.useRef(null),i=Eh(n,o.contentRef,r);return mu.useEffect(()=>{let s=r.current;if(s)return eDe(s)},[]),dg.jsx(Kpo,{...t,ref:i,trapFocus:o.open,disableOutsidePointerEvents:o.open,onCloseAutoFocus:ka(t.onCloseAutoFocus,(s)=>{s.preventDefault(),o.triggerRef.current?.focus()}),onPointerDownOutside:ka(t.onPointerDownOutside,(s)=>{let a=s.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0;if(a.button===2||c)s.preventDefault()}),onFocusOutside:ka(t.onFocusOutside,(s)=>s.preventDefault())})},"DialogContentModal")),mcs=mu.forwardRef(vC(function(t,n){let o=GE(s_e,t.__scopeDialog),r=mu.useRef(!1),i=mu.useRef(!1);return dg.jsx(Kpo,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:(s)=>{if(t.onCloseAutoFocus?.(s),!s.defaultPrevented){if(!r.current)o.triggerRef.current?.focus();s.preventDefault()}r.current=!1,i.current=!1},onInteractOutside:(s)=>{if(t.onInteractOutside?.(s),!s.defaultPrevented){if(r.current=!0,s.detail.originalEvent.type==="pointerdown")i.current=!0}let a=s.target;if(o.triggerRef.current?.contains(a))s.preventDefault();if(s.detail.originalEvent.type==="focusin"&&i.current)s.preventDefault()}})},"DialogContentNonModal")),Kpo=mu.forwardRef(vC(function(t,n){let{__scopeDialog:o,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,"aria-describedby":a,children:c,...l}=t,h=GE(s_e,o);return Vne(),dg.jsx(t_e,{registry:h.branchRegistry,children:dg.jsx(VTe,{asChild:!0,loop:!0,trapped:r,branches:h.branchNodes,onMountAutoFocus:i,onUnmountAutoFocus:s,children:dg.jsx(OTe,{role:"dialog",id:h.contentId,"aria-labelledby":h.titlePresent?h.titleId:void 0,"aria-describedby":h.descriptionPresent?Zpo(a,h.descriptionId):a,"data-state":BAt(h.open),...l,ref:n,deferPointerDownOutside:!0,onDismiss:()=>h.onOpenChange(!1),children:c})})})},"DialogContentImpl")),$po=mu.forwardRef(vC(function(t,n){let{__scopeDialog:o,...r}=t,i=GE("DialogTitle",o),{setTitleCount:s}=i;return t0(()=>(s((a)=>a+1),()=>s((a)=>a-1)),[s]),dg.jsx(Rp.h2,{id:i.titleId,...r,ref:n})},"DialogTitle")),qpo=mu.forwardRef(vC(function(t,n){let{__scopeDialog:o,...r}=t,i=GE("DialogDescription",o),{setDescriptionCount:s}=i;return t0(()=>(s((a)=>a+1),()=>s((a)=>a-1)),[s]),dg.jsx(Rp.p,{id:i.descriptionId,...r,ref:n})},"DialogDescription")),_cs="DialogClose",Jpo=mu.forwardRef(vC(function(t,n){let{__scopeDialog:o,...r}=t,i=GE(_cs,o);return dg.jsx(Rp.button,{type:"button",...r,ref:n,onClick:ka(t.onClick,()=>i.onOpenChange(!1))})},"DialogClose"));function Zpo(...e){let t=new Set;for(let n of e){if(typeof n!=="string")continue;for(let o of String(n).trim().split(/\s+/))if(o)t.add(o)}return t.size>0?Array.from(t).join(" "):void 0}vC(Zpo,"concatAriaDescribedby");function BAt(e){return e?"open":"closed"}vC(BAt,"getState");var Acs=()=>{if(globalThis.tscircuitDynamicModules)return globalThis.tscircuitDynamicModules;let e={};return globalThis.tscircuitDynamicModules=e,e};var fcs=["circuit-json-to-3d-png","circuit-json-to-bom-csv","circuit-json-to-bpc","circuit-json-to-connectivity-map","circuit-json-to-fdm-component-box","circuit-json-to-gerber","circuit-json-to-gltf","circuit-json-to-kicad","circuit-json-to-lbrn","circuit-json-to-pnp-csv","circuit-json-to-readable-netlist","circuit-json-to-simple-3d","circuit-json-to-spice","circuit-json-to-step","circuit-json-to-tscircuit","circuit-to-canvas","circuit-to-svg","kicad-to-circuit-json","@tscircuit/circuit-json-schematic-placement-analysis"],tmo=(e)=>{let t=e.indexOf("@",e.startsWith("@")?1:0);return t===-1?e:e.slice(0,t)},ycs=new Set(fcs),xcs=new Map([["@tscircuit/circuit-json-schematic-placement-analysis","dist/browser.js"]]);function Ccs(e){if(!ycs.has(tmo(e)))throw Error(`Unsupported module: ${e}`)}var bcs=(e)=>{Ccs(e);let t=tmo(e),n=e.length===t.length?"latest":e.slice(t.length+1),o=xcs.get(t)??"+esm";return`https://jscdn.tscircuit.com/${t}/${n}/${o}`},Ics=(e)=>[bcs(e),`https://esm.run/${e}`];function vcs(e=(t)=>import(t)){return async(t)=>{let n=Acs();if(Object.hasOwn(n,t))return n[t];let o;for(let r of Ics(t))try{let i=await e(r);return n[t]=i,i}catch(i){o=i}throw o}}var Scs=()=>globalThis.tscircuitDynamicImportResolver;var emo=vcs();async function Pcs(e){let t=Scs();return t?t(e,emo):emo(e)}var nmo=Pcs;var aNe=at(ln(),1),gg=at(lo(),1);var Ufo=at(W0(),1);bp();be();bp();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();be();var tDe=k().or(ge()).transform((e)=>Ta(e,"Ω").value),RAt=k().or(ge()).transform((e)=>Ta(e,"F").value).transform((e)=>Number.parseFloat(e.toPrecision(12))),smo=k().or(ge()).transform((e)=>Ta(e,"H").value),s8=k().or(ge()).transform((e)=>Ta(e,"V").value),ar=k().or(ge()).transform((e)=>Ta(e).value),HU=k().or(ge()).transform((e)=>Ta(e,"Hz").value),un=ar,TH=k().or(ge()).transform((e)=>Ta(e,"A").value),jne=k().or(ge()).transform((e)=>Ta(e).value),Ecs=jne,dA=jne,amo=k().datetime(),n0=k().or(ge()).transform((e)=>{if(typeof e==="number")return e;if(e.endsWith("deg"))return Number.parseFloat(e.split("deg")[0]);if(e.endsWith("rad"))return Number.parseFloat(e.split("rad")[0])*180/Math.PI;return Number.parseFloat(e)}),cmo=ge().or(k().endsWith("mAh")).transform((e)=>{if(typeof e==="string"){let t=e.replace("mAh",""),n=Number.parseFloat(t);if(Number.isNaN(n))throw Error("Invalid capacity");return n}return e}).describe("Battery capacity in mAh"),$t=(e)=>{};$t("extra props b");$t("missing props b");$t(!0);$t("mismatched prop types: a");var FU=(e)=>{};FU(!0);FU('T1 has extra: "c", T2 has extra: "d"');FU('T1 has extra: "c"');FU('T2 has extra: "c"');FU('T1 has extra: "d", T2 has extra: "c"');FU(!0);var Tr=Ee({x:un,y:un}),Mcs=Tr;$t(!0);$t(!0);var rD=Ee({x:un,y:un,z:un}),wcs=rD;$t(!0);var nDe=Ee({width:ge(),height:ge()});$t(!0);var Bcs=(e)=>Array.from({length:e},()=>"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[Math.floor(Math.random()*62)]).join(""),Wn=(e)=>k().optional().default(()=>`${e}_${Bcs(10)}`),iD=bt(["top_left","top_center","top_right","center_left","center","center_right","bottom_left","bottom_center","bottom_right"]);$t(!0);var Tcs=bt(["top_silkscreen","bottom_silkscreen","top_copper","bottom_copper","top_soldermask","bottom_soldermask","top_fabrication_note","bottom_fabrication_note","top_user_note","bottom_user_note","top_courtyard","bottom_courtyard","inner1_copper","inner2_copper","inner3_copper","inner4_copper","inner5_copper","inner6_copper","inner7_copper","inner8_copper","edge_cuts","drill"]);$t(!0);var oDe=Ee({project_relative_path:k(),url:k(),mimetype:k()});$t(!0);var rDe=Tr.extend({rotation:n0.optional()});$t(!0);var QAt=Ee({size:Tr.optional(),thickness:un.optional()});$t(!0);var lmo=Ee({font:QAt.optional()});$t(!0);var c_e=Ee({value:k(),at:rDe.optional(),layer:k().optional(),uuid:k().optional(),hide:Be().optional(),effects:lmo.optional()});$t(!0);var hmo=Ee({Reference:c_e.optional(),Value:c_e.optional(),Datasheet:c_e.optional(),Description:c_e.optional()});$t(!0);var dmo=Ee({through_hole:Be().optional(),smd:Be().optional(),exclude_from_pos_files:Be().optional(),exclude_from_bom:Be().optional()});$t(!0);var umo=Ee({name:k(),type:k(),shape:k().optional(),at:rDe.optional(),size:Tr.optional(),drill:un.optional(),layers:st(k()).optional(),removeUnusedLayers:Be().optional(),uuid:k().optional()});$t(!0);var pmo=Ee({path:k(),offset:rD.optional(),scale:rD.optional(),rotate:rD.optional()});$t(!0);var mmo=Ee({footprintName:k().optional(),version:an([ge(),k()]).optional(),generator:k().optional(),generatorVersion:an([ge(),k()]).optional(),layer:k().optional(),properties:hmo.optional(),attributes:dmo.optional(),pads:st(umo).optional(),embeddedFonts:Be().optional(),model:pmo.optional()});$t(!0);var _mo=Ee({hide:Be().optional()});$t(!0);var gmo=Ee({offset:un.optional(),hide:Be().optional()});$t(!0);var Amo=Ee({font:QAt.optional(),justify:an([k(),st(k())]).optional(),hide:Be().optional()});$t(!0);var BH=Ee({value:k(),id:an([ge(),k()]).optional(),at:rDe.optional(),effects:Amo.optional()});$t(!0);var fmo=Ee({Reference:BH.optional(),Value:BH.optional(),Footprint:BH.optional(),Datasheet:BH.optional(),Description:BH.optional(),ki_keywords:BH.optional(),ki_fp_filters:BH.optional()});$t(!0);var ymo=Ee({symbolName:k().optional(),extends:k().optional(),pinNumbers:_mo.optional(),pinNames:gmo.optional(),excludeFromSim:Be().optional(),inBom:Be().optional(),onBoard:Be().optional(),properties:fmo.optional(),embeddedFonts:Be().optional()});$t(!0);var Kl=Ee({error_type:k(),message:k(),is_fatal:Be().optional()});$t(!0);var l_e=bt(["jlcpcb","macrofab","pcbway","digikey","mouser","lcsc"]);$t(!0);var zd=Ee({type:ce("source_component"),ftype:k().optional(),source_component_id:k(),name:k(),manufacturer_part_number:k().optional(),supplier_part_numbers:Ss(l_e,st(k())).optional(),display_value:k().optional(),display_name:k().optional(),are_pins_interchangeable:Be().optional(),internally_connected_source_port_ids:st(st(k())).optional(),source_group_id:k().optional(),subcircuit_id:k().optional()});$t(!0);var kAt=zd.extend({ftype:ce("simple_capacitor"),capacitance:RAt,max_voltage_rating:s8.optional(),display_capacitance:k().optional(),max_decoupling_trace_length:un.optional()});$t(!0);var LAt=zd.extend({ftype:ce("simple_resistor"),resistance:tDe,display_resistance:k().optional()});$t(!0);var iDe=zd.extend({ftype:ce("simple_diode")});$t(!0);var xmo=zd.extend({ftype:ce("simple_fiducial")});$t(!0);var HAt=iDe.extend({ftype:ce("simple_led"),color:k().optional(),wavelength:k().optional()});$t(!0);var Cmo=zd.extend({ftype:ce("simple_ground")});$t(!0);var FAt=zd.extend({ftype:ce("simple_chip")});$t(!0);var zAt=zd.extend({ftype:ce("simple_power_source"),voltage:s8});$t(!0);var bmo=zd.extend({ftype:ce("simple_current_source"),current:TH,frequency:HU.optional(),peak_to_peak_current:TH.optional(),wave_shape:bt(["sine","square","triangle","sawtooth","dc"]).optional().default("dc"),phase:ge().optional(),duty_cycle:ge().min(0).max(1).optional()});$t(!0);var Imo=zd.extend({ftype:ce("simple_fuse"),current_rating_amps:ge().describe("Nominal current in amps the fuse is rated for"),voltage_rating_volts:ge().describe("Voltage rating in volts, e.g. ±5V would be 5")});$t(!0);var vmo=zd.extend({ftype:ce("simple_ammeter")});$t(!0);var Smo=Ee({must_be_connected:Be().optional(),provides_power:Be().optional(),requires_power:Be().optional(),provides_ground:Be().optional(),requires_ground:Be().optional(),provides_voltage:an([k(),ge()]).optional(),requires_voltage:an([k(),ge()]).optional(),do_not_connect:Be().optional(),include_in_board_pinout:Be().optional(),can_use_internal_pullup:Be().optional(),is_using_internal_pullup:Be().optional(),needs_external_pullup:Be().optional(),can_use_internal_pulldown:Be().optional(),is_using_internal_pulldown:Be().optional(),needs_external_pulldown:Be().optional(),can_use_open_drain:Be().optional(),is_using_open_drain:Be().optional(),can_use_push_pull:Be().optional(),is_using_push_pull:Be().optional(),should_have_decoupling_capacitor:Be().optional(),recommended_decoupling_capacitor_capacitance:an([k(),ge()]).optional(),is_configured_for_i2c_sda:Be().optional(),is_configured_for_i2c_scl:Be().optional(),is_configured_for_spi_mosi:Be().optional(),is_configured_for_spi_miso:Be().optional(),is_configured_for_spi_sck:Be().optional(),is_configured_for_spi_cs:Be().optional(),is_configured_for_uart_tx:Be().optional(),is_configured_for_uart_rx:Be().optional(),supports_i2c_sda:Be().optional(),supports_i2c_scl:Be().optional(),supports_spi_mosi:Be().optional(),supports_spi_miso:Be().optional(),supports_spi_sck:Be().optional(),supports_spi_cs:Be().optional(),supports_uart_tx:Be().optional(),supports_uart_rx:Be().optional()});$t(!0);var OAt=zd.extend({ftype:ce("simple_battery"),capacity:cmo});$t(!0);var VAt=zd.extend({ftype:ce("simple_inductor"),inductance:smo,display_inductance:k().optional(),max_current_rating:ge().optional()});$t(!0);var YAt=zd.extend({ftype:ce("simple_push_button")});$t(!0);var GAt=zd.extend({ftype:ce("simple_potentiometer"),max_resistance:tDe,display_max_resistance:k().optional()});$t(!0);var Pmo=zd.extend({ftype:ce("simple_crystal"),frequency:ge().describe("Frequency in Hz"),load_capacitance:ge().optional().describe("Load capacitance in pF"),pin_variant:bt(["two_pin","four_pin"]).optional()});$t(!0);var UAt=zd.extend({ftype:ce("simple_pin_header"),pin_count:ge(),gender:bt(["male","female"]).optional().default("male")});$t(!0);var Emo=["usb_c","m2","jst_sh","jst_gh","jst_zh","jst_ph","jst_xh","jst_vh"],Mmo=zd.extend({ftype:ce("simple_connector"),standard:bt(Emo).optional(),pin_count:ge().int().positive().optional()});$t(!0);var WAt=zd.extend({ftype:ce("simple_pinout")});$t(!0);var XAt=zd.extend({ftype:ce("simple_resonator"),load_capacitance:RAt,equivalent_series_resistance:tDe.optional(),frequency:HU});$t(!0);var jAt=zd.extend({ftype:ce("simple_transistor"),transistor_type:bt(["npn","pnp"])});$t(!0);var KAt=zd.extend({ftype:ce("simple_test_point"),footprint_variant:bt(["pad","through_hole"]).optional(),pad_shape:bt(["rect","circle"]).optional(),pad_diameter:an([ge(),k()]).optional(),hole_diameter:an([ge(),k()]).optional(),width:an([ge(),k()]).optional(),height:an([ge(),k()]).optional()});$t(!0);var $At=zd.extend({ftype:ce("simple_mosfet"),channel_type:bt(["n","p"]),mosfet_mode:bt(["enhancement","depletion"])});$t(!0);var qAt=zd.extend({ftype:ce("simple_op_amp")});$t(!0);var JAt=zd.extend({ftype:ce("simple_switch")});$t(!0);var ZAt=Ee({type:ce("source_project_metadata"),name:k().optional(),software_used_string:k().optional(),project_url:k().optional(),source_filesystem_md5_hash:k().optional(),created_at:amo.optional()});$t(!0);var wmo=Kl.extend({type:ce("source_missing_property_error"),source_missing_property_error_id:Wn("source_missing_property_error"),source_component_id:k(),property_name:k(),subcircuit_id:k().optional(),error_type:ce("source_missing_property_error").default("source_missing_property_error")}).describe("The source code is missing a property");$t(!0);var Bmo=Kl.extend({type:ce("source_failed_to_create_component_error"),source_failed_to_create_component_error_id:Wn("source_failed_to_create_component_error"),error_type:ce("source_failed_to_create_component_error").default("source_failed_to_create_component_error"),component_name:k().optional(),subcircuit_id:k().optional(),parent_source_component_id:k().optional(),pcb_center:Ee({x:ge().optional(),y:ge().optional()}).optional(),schematic_center:Ee({x:ge().optional(),y:ge().optional()}).optional()}).describe("Error emitted when a component fails to be constructed");$t(!0);var eft=Kl.extend({type:ce("source_invalid_component_property_error"),source_invalid_component_property_error_id:Wn("source_invalid_component_property_error"),source_component_id:k(),property_name:k(),property_value:Xz().optional(),expected_format:k().optional(),subcircuit_id:k().optional(),error_type:ce("source_invalid_component_property_error").default("source_invalid_component_property_error")}).describe("The source component property is invalid");$t(!0);var tft=Kl.extend({type:ce("source_trace_not_connected_error"),source_trace_not_connected_error_id:Wn("source_trace_not_connected_error"),error_type:ce("source_trace_not_connected_error").default("source_trace_not_connected_error"),subcircuit_id:k().optional(),source_group_id:k().optional(),source_trace_id:k().optional(),connected_source_port_ids:st(k()).optional(),selectors_not_found:st(k()).optional()}).describe("Occurs when a source trace selector does not match any ports");$t(!0);var Tmo=Ee({type:ce("source_property_ignored_warning"),source_property_ignored_warning_id:Wn("source_property_ignored_warning"),source_component_id:k(),property_name:k(),subcircuit_id:k().optional(),error_type:ce("source_property_ignored_warning").default("source_property_ignored_warning"),message:k()}).describe("The source property was ignored");$t(!0);var nft=Ee({type:ce("source_pin_missing_trace_warning"),source_pin_missing_trace_warning_id:Wn("source_pin_missing_trace_warning"),warning_type:ce("source_pin_missing_trace_warning").default("source_pin_missing_trace_warning"),message:k(),source_component_id:k(),source_port_id:k(),subcircuit_id:k().optional()}).describe("Warning emitted when a source component pin is missing a trace connection");$t(!0);var oft=Ee({type:ce("source_missing_manufacturer_part_number_warning"),source_missing_manufacturer_part_number_warning_id:Wn("source_missing_manufacturer_part_number_warning"),warning_type:ce("source_missing_manufacturer_part_number_warning").default("source_missing_manufacturer_part_number_warning"),message:k(),source_component_id:k(),standard:k(),subcircuit_id:k().optional()}).describe("Warning emitted when a standard connector is missing manufacturer part number");$t(!0);var rft=Ee({type:ce("source_refdes_convention_warning"),source_refdes_convention_warning_id:Wn("source_refdes_convention_warning"),warning_type:ce("source_refdes_convention_warning").default("source_refdes_convention_warning"),message:k(),source_component_id:k(),refdes:k(),source_component_ftype:k(),expected_prefixes:st(k()),actual_prefix:k().optional(),subcircuit_id:k().optional()}).describe("Warning emitted when a source component reference designator does not match the component type convention");$t(!0);var Dmo=zd.extend({ftype:ce("simple_voltage_probe")});$t(!0);var Nmo=zd.extend({ftype:ce("interconnect")});$t(!0);var ift=Kl.extend({type:ce("source_i2c_misconfigured_error"),source_i2c_misconfigured_error_id:Wn("source_i2c_misconfigured_error"),error_type:ce("source_i2c_misconfigured_error").default("source_i2c_misconfigured_error"),source_port_ids:st(k())}).describe("Error emitted when incompatible I2C pins (e.g. SDA and SCL) are connected to the same net");$t(!0);var sft=Kl.extend({type:ce("source_component_misconfigured_error"),source_component_misconfigured_error_id:Wn("source_component_misconfigured_error"),error_type:ce("source_component_misconfigured_error").default("source_component_misconfigured_error"),source_component_ids:st(k()),source_port_ids:st(k()).optional()}).describe("Error emitted when one or more source components have an invalid or conflicting configuration");$t(!0);var Rmo=zd.extend({ftype:ce("simple_voltage_source"),voltage:s8,frequency:HU.optional(),peak_to_peak_voltage:s8.optional(),wave_shape:bt(["sinewave","square","triangle","sawtooth"]).optional(),phase:n0.optional(),duty_cycle:ge().optional().describe("Duty cycle as a fraction (0 to 1)"),pulse_delay:dA.optional(),rise_time:dA.optional(),fall_time:dA.optional(),pulse_width:dA.optional(),period:dA.optional()});$t(!0);var Qmo=an([LAt,kAt,iDe,xmo,HAt,Cmo,FAt,zAt,bmo,vmo,OAt,VAt,YAt,GAt,Pmo,UAt,Mmo,WAt,XAt,JAt,jAt,KAt,$At,qAt,Imo,Dmo,Nmo,Rmo,ZAt,wmo,eft,Bmo,tft,Tmo,nft,oft,rft,ift,sft]);$t(!0);var kmo=Ee({type:ce("source_port"),pin_number:ge().optional(),port_hints:st(k()).optional(),name:k(),source_port_id:k(),source_component_id:k().optional(),source_group_id:k().optional(),most_frequently_referenced_by_name:k().optional(),subcircuit_id:k().optional(),subcircuit_connectivity_map_key:k().optional()}).merge(Smo);$t(!0);var Lmo=Ee({type:ce("source_component_internal_connection"),source_component_internal_connection_id:k(),source_component_id:k(),source_port_ids:st(k()),subcircuit_id:k().optional()});$t(!0);var Hmo=Ee({type:ce("source_trace"),source_trace_id:k(),connected_source_port_ids:st(k()),connected_source_net_ids:st(k()),subcircuit_id:k().optional(),subcircuit_connectivity_map_key:k().optional(),max_length:ge().optional(),max_via_count:ge().int().nonnegative().optional(),name:k().optional(),min_trace_thickness:ge().optional(),display_name:k().optional()});$t(!0);var Fmo=Ee({type:ce("source_group"),source_group_id:k(),subcircuit_id:k().optional(),parent_subcircuit_id:k().optional(),parent_source_group_id:k().optional(),is_subcircuit:Be().optional(),show_as_schematic_box:Be().optional(),name:k().optional(),was_automatically_named:Be().optional()});$t(!0);var zmo=Ee({type:ce("source_net"),source_net_id:k(),name:k(),member_source_group_ids:st(k()),is_power:Be().optional(),is_ground:Be().optional(),is_digital_signal:Be().optional(),is_analog_signal:Be().optional(),is_positive_voltage_source:Be().optional(),trace_width:ge().optional(),subcircuit_id:k().optional(),subcircuit_connectivity_map_key:k().optional()});$t(!0);var Omo=Ee({type:ce("source_board"),source_board_id:k(),source_group_id:k(),title:k().optional()}).describe("Defines a board in the source domain");$t(!0);var Vmo=Kl.extend({type:ce("source_ambiguous_port_reference"),source_ambiguous_port_reference_id:Wn("source_ambiguous_port_reference"),error_type:ce("source_ambiguous_port_reference").default("source_ambiguous_port_reference"),source_port_id:k().optional(),source_component_id:k().optional()}).describe("Error emitted when a port hint matches multiple non-overlapping pads, making the port reference ambiguous");$t(!0);var Ymo=Ee({type:ce("source_pcb_ground_plane"),source_pcb_ground_plane_id:k(),source_group_id:k(),source_net_id:k(),subcircuit_id:k().optional()}).describe("Defines a ground plane in the source domain");$t(!0);var Gmo=["top","bottom","inner1","inner2","inner3","inner4","inner5","inner6","inner7","inner8"],TAt=bt(Gmo),Ka=TAt.or(Ee({name:TAt})).transform((e)=>{if(typeof e==="string")return e;return e.name});$t(!0);var uA=bt(["top","bottom"]),Umo=Ee({type:ce("source_manually_placed_via"),source_manually_placed_via_id:k(),source_group_id:k(),source_net_id:k().min(1).optional(),subcircuit_id:k().optional(),source_trace_id:k().optional()}).describe("Defines a via that is manually placed in the source domain");$t(!0);var Wmo=Ee({type:ce("source_unnamed_trace_warning"),source_unnamed_trace_warning_id:Wn("source_unnamed_trace_warning"),warning_type:ce("source_unnamed_trace_warning").default("source_unnamed_trace_warning"),message:k(),source_trace_id:k(),subcircuit_id:k().optional()}).describe("Warning emitted when a source trace is missing a name");$t(!0);var Xmo=Ee({type:ce("source_no_power_pin_defined_warning"),source_no_power_pin_defined_warning_id:Wn("source_no_power_pin_defined_warning"),warning_type:ce("source_no_power_pin_defined_warning").default("source_no_power_pin_defined_warning"),message:k(),source_component_id:k(),source_port_ids:st(k()),subcircuit_id:k().optional()}).describe("Warning emitted when a chip has no source ports with requires_power=true");$t(!0);var jmo=Ee({type:ce("source_no_ground_pin_defined_warning"),source_no_ground_pin_defined_warning_id:Wn("source_no_ground_pin_defined_warning"),warning_type:ce("source_no_ground_pin_defined_warning").default("source_no_ground_pin_defined_warning"),message:k(),source_component_id:k(),source_port_ids:st(k()),subcircuit_id:k().optional()}).describe("Warning emitted when a chip has no source ports marked as ground pins");$t(!0);var Kmo=Ee({type:ce("source_component_pins_underspecified_warning"),source_component_pins_underspecified_warning_id:Wn("source_component_pins_underspecified_warning"),warning_type:ce("source_component_pins_underspecified_warning").default("source_component_pins_underspecified_warning"),message:k(),source_component_id:k(),source_port_ids:st(k()),subcircuit_id:k().optional()}).describe("Warning emitted when all ports on a source component are underspecified");$t(!0);var $mo=Kl.extend({type:ce("source_pin_must_be_connected_error"),source_pin_must_be_connected_error_id:Wn("source_pin_must_be_connected_error"),error_type:ce("source_pin_must_be_connected_error").default("source_pin_must_be_connected_error"),source_component_id:k(),source_port_id:k(),subcircuit_id:k().optional()}).describe("Error emitted when a pin with mustBeConnected attribute is not connected to any trace");$t(!0);var qmo=Kl.extend({type:ce("unknown_error_finding_part"),unknown_error_finding_part_id:Wn("unknown_error_finding_part"),error_type:ce("unknown_error_finding_part").default("unknown_error_finding_part"),source_component_id:k().optional(),subcircuit_id:k().optional()}).describe("Error emitted when an unexpected error occurs while finding a part");$t(!0);var Jmo=Ee({type:ce("source_part_not_found_warning"),source_part_not_found_warning_id:Wn("source_part_not_found_warning"),warning_type:ce("source_part_not_found_warning").default("source_part_not_found_warning"),message:k(),source_component_id:k().optional(),subcircuit_id:k().optional(),supplier_name:l_e.optional(),manufacturer_part_number:k().optional(),supplier_part_number:k().optional(),part_name:k().optional()}).describe("Warning emitted when a requested part can not be found");$t(!0);var Zmo=Ee({type:ce("schematic_box"),schematic_sheet_id:k().optional(),schematic_component_id:k().optional(),schematic_symbol_id:k().optional(),width:un,height:un,is_dashed:Be().default(!1),x:un,y:un,subcircuit_id:k().optional()}).describe("Draws a box on the schematic");$t(!0);var e_o=Ee({type:ce("schematic_path"),schematic_path_id:Wn("schematic_path"),schematic_sheet_id:k().optional(),schematic_component_id:k().optional(),schematic_symbol_id:k().optional(),fill_color:k().optional(),is_filled:Be().optional(),is_dashed:Be().default(!1),stroke_width:un.nullable().optional(),stroke_color:k().optional(),dash_length:un.optional(),dash_gap:un.optional(),points:st(Tr),subcircuit_id:k().optional()});$t(!0);var t_o=Ss(Ee({left_margin:ar.optional(),right_margin:ar.optional(),top_margin:ar.optional(),bottom_margin:ar.optional()})),n_o=Ee({left_size:ge(),right_size:ge(),top_size:ge().optional(),bottom_size:ge().optional()});$t(!0);var o_o=Ee({left_side:Ee({pins:st(ge()),direction:bt(["top-to-bottom","bottom-to-top"]).optional()}).optional(),right_side:Ee({pins:st(ge()),direction:bt(["top-to-bottom","bottom-to-top"]).optional()}).optional(),top_side:Ee({pins:st(ge()),direction:bt(["left-to-right","right-to-left"]).optional()}).optional(),bottom_side:Ee({pins:st(ge()),direction:bt(["left-to-right","right-to-left"]).optional()}).optional()});$t(!0);var r_o=an([n_o,o_o]),i_o=Ee({type:ce("schematic_component"),size:nDe,center:Tr,source_component_id:k().optional(),schematic_component_id:k(),schematic_sheet_id:k().optional(),schematic_symbol_id:k().optional(),pin_spacing:ar.optional(),pin_styles:t_o.optional(),box_width:ar.optional(),symbol_name:k().optional(),port_arrangement:r_o.optional(),port_labels:Ss(k()).optional(),symbol_display_value:k().optional(),subcircuit_id:k().optional(),schematic_group_id:k().optional(),is_schematic_group:Be().optional(),source_group_id:k().optional(),is_box_with_pins:Be().optional().default(!0)});$t(!0);var Dcs=Ee({kicad_symbol:ymo.optional()}).catchall(Xz()),s_o=Ee({type:ce("schematic_symbol"),schematic_symbol_id:k(),name:k().optional(),metadata:Dcs.optional()}).describe("Defines a named schematic symbol that can be referenced by components.");$t(!0);var a_o=Ee({type:ce("schematic_line"),schematic_line_id:Wn("schematic_line"),schematic_sheet_id:k().optional(),schematic_component_id:k().optional(),schematic_symbol_id:k().optional(),x1:un,y1:un,x2:un,y2:un,stroke_width:un.nullable().optional(),color:k().default("#000000"),is_dashed:Be().default(!1),dash_length:un.optional(),dash_gap:un.optional(),subcircuit_id:k().optional()}).describe("Draws a styled line on the schematic");$t(!0);var c_o=Ee({type:ce("schematic_rect"),schematic_rect_id:Wn("schematic_rect"),schematic_sheet_id:k().optional(),schematic_component_id:k().optional(),schematic_symbol_id:k().optional(),center:Tr,width:un,height:un,rotation:n0.default(0),stroke_width:un.nullable().optional(),color:k().default("#000000"),is_filled:Be().default(!1),fill_color:k().optional(),is_dashed:Be().default(!1),subcircuit_id:k().optional()}).describe("Draws a styled rectangle on the schematic");$t(!0);var l_o=Ee({type:ce("schematic_circle"),schematic_circle_id:Wn("schematic_circle"),schematic_sheet_id:k().optional(),schematic_component_id:k().optional(),schematic_symbol_id:k().optional(),center:Tr,radius:un,stroke_width:un.nullable().optional(),color:k().default("#000000"),is_filled:Be().default(!1),fill_color:k().optional(),is_dashed:Be().default(!1),subcircuit_id:k().optional()}).describe("Draws a styled circle on the schematic");$t(!0);var h_o=Ee({type:ce("schematic_arc"),schematic_arc_id:Wn("schematic_arc"),schematic_sheet_id:k().optional(),schematic_component_id:k().optional(),schematic_symbol_id:k().optional(),center:Tr,radius:un,start_angle_degrees:n0,end_angle_degrees:n0,direction:bt(["clockwise","counterclockwise"]).default("counterclockwise"),stroke_width:un.nullable().optional(),color:k().default("#000000"),is_dashed:Be().default(!1),subcircuit_id:k().optional()}).describe("Draws a styled arc on the schematic");$t(!0);var d_o=Ee({type:ce("schematic_trace"),schematic_trace_id:k(),schematic_sheet_id:k().optional(),source_trace_id:k().optional(),junctions:st(Ee({x:ge(),y:ge()})),edges:st(Ee({from:Ee({x:ge(),y:ge()}),to:Ee({x:ge(),y:ge()}),is_crossing:Be().optional(),from_schematic_port_id:k().optional(),to_schematic_port_id:k().optional()})),subcircuit_id:k().optional(),subcircuit_connectivity_map_key:k().optional()});$t(!0);var Ncs=bt(["center","left","right","top","bottom"]);$t(!0);var u_o=Ee({type:ce("schematic_text"),schematic_sheet_id:k().optional(),schematic_component_id:k().optional(),schematic_symbol_id:k().optional(),schematic_text_id:k(),source_trace_id:k().optional(),text:k(),font_size:ge().default(0.18),position:Ee({x:un,y:un}),rotation:ge().default(0),anchor:an([Ncs.describe("legacy"),iD]).default("center"),color:k().default("#000000"),subcircuit_id:k().optional()});$t(!0);var p_o=Ee({type:ce("schematic_port"),schematic_port_id:k(),source_port_id:k(),schematic_sheet_id:k().optional(),schematic_component_id:k().optional(),center:Tr,facing_direction:bt(["up","down","left","right"]).optional(),distance_from_component_edge:ge().optional(),side_of_component:bt(["top","bottom","left","right"]).optional(),true_ccw_index:ge().optional(),pin_number:ge().optional(),display_pin_label:k().optional(),display_pin_label_font_size:ge().positive().finite().optional(),subcircuit_id:k().optional(),is_connected:Be().optional(),is_internal_circuit_port:Be().optional(),is_overlapping_internal_circuit_port:Be().optional(),has_input_arrow:Be().optional(),has_output_arrow:Be().optional(),is_drawn_with_inversion_circle:Be().optional()}).describe("Defines a port on a schematic component");$t(!0);var m_o=Ee({type:ce("schematic_net_label"),schematic_net_label_id:Wn("schematic_net_label"),schematic_sheet_id:k().optional(),schematic_trace_id:k().optional(),source_trace_id:k().optional(),source_net_id:k(),center:Tr,anchor_position:Tr.optional(),anchor_side:bt(["top","bottom","left","right"]),text:k(),symbol_name:k().optional(),is_movable:Be().optional(),subcircuit_id:k().optional()});$t(!0);var __o=Kl.extend({type:ce("schematic_error"),schematic_error_id:k(),error_type:ce("schematic_port_not_found").default("schematic_port_not_found"),subcircuit_id:k().optional()}).describe("Defines a schematic error on the schematic");$t(!0);var g_o=Kl.extend({type:ce("schematic_layout_error"),schematic_layout_error_id:Wn("schematic_layout_error"),error_type:ce("schematic_layout_error").default("schematic_layout_error"),source_group_id:k(),schematic_group_id:k(),subcircuit_id:k().optional()}).describe("Error emitted when schematic layout fails for a group");$t(!0);var sDe=Ee({type:ce("schematic_debug_object"),label:k().optional(),subcircuit_id:k().optional()}),A_o=sDe.extend({shape:ce("rect"),center:Tr,size:nDe}),f_o=sDe.extend({shape:ce("line"),start:Tr,end:Tr}),y_o=sDe.extend({shape:ce("point"),center:Tr}),x_o=ss("shape",[A_o,f_o,y_o]);$t(!0);var C_o=Ee({type:ce("schematic_voltage_probe"),schematic_voltage_probe_id:k(),schematic_sheet_id:k().optional(),source_component_id:k().optional(),name:k().optional(),position:Tr,schematic_trace_id:k(),voltage:s8.optional(),subcircuit_id:k().optional(),color:k().optional(),label_alignment:iD.optional()}).describe("Defines a voltage probe measurement point on a schematic trace");$t(!0);var b_o=Ee({type:ce("schematic_manual_edit_conflict_warning"),schematic_manual_edit_conflict_warning_id:Wn("schematic_manual_edit_conflict_warning"),warning_type:ce("schematic_manual_edit_conflict_warning").default("schematic_manual_edit_conflict_warning"),message:k(),schematic_component_id:k(),schematic_group_id:k().optional(),subcircuit_id:k().optional(),source_component_id:k()}).describe("Warning emitted when a component has both manual placement and explicit schX/schY coordinates");$t(!0);var I_o=Ee({type:ce("schematic_component_overlap_warning"),schematic_component_overlap_warning_id:Wn("schematic_component_overlap_warning"),warning_type:ce("schematic_component_overlap_warning").default("schematic_component_overlap_warning"),message:k(),schematic_component_ids:c1([k(),k()]),schematic_sheet_id:k().optional()}).describe("Warning emitted when the rendered bounds of two schematic components overlap");$t(!0);var v_o=Ee({type:ce("schematic_component_styling_warning"),schematic_component_styling_warning_id:Wn("schematic_component_styling_warning"),warning_type:ce("schematic_component_styling_warning").default("schematic_component_styling_warning"),message:k(),schematic_component_id:k(),styling_issue_type:k(),schematic_port_ids:st(k()).optional(),source_component_id:k().optional(),schematic_sheet_id:k().optional(),subcircuit_id:k().optional()}).describe("Warning emitted when a schematic component has a visual styling issue");$t(!0);var S_o=Ee({type:ce("schematic_element_outside_sheet_warning"),schematic_element_outside_sheet_warning_id:Wn("schematic_element_outside_sheet_warning"),warning_type:ce("schematic_element_outside_sheet_warning").default("schematic_element_outside_sheet_warning"),message:k(),schematic_sheet_id:k(),schematic_element_type:bt(["schematic_component","schematic_net_label","schematic_trace"]),schematic_element_id:k()}).describe("Warning emitted when a schematic component, net label, or trace extends outside its schematic sheet");$t(!0);var omo=un.pipe(ge().positive().finite()),P_o=Ee({type:ce("schematic_graphic"),schematic_graphic_id:Wn("schematic_graphic"),schematic_sheet_id:k().optional(),asset:oDe.optional(),svg_content:k().optional(),width:omo.optional(),height:omo.optional()}).describe("References a graphic asset or inline SVG content with optional centered layout bounds on a schematic sheet").superRefine(({asset:e,svg_content:t},n)=>{if(e===void 0&&t===void 0)n.addIssue({code:Gt.custom,message:"At least one of asset or svg_content is required"})});$t(!0);var E_o=Ee({type:ce("schematic_group"),schematic_group_id:Wn("schematic_group"),schematic_sheet_id:k().optional(),source_group_id:k(),is_subcircuit:Be().optional(),subcircuit_id:k().optional(),width:ar,height:ar,center:Tr,schematic_component_ids:st(k()),show_as_schematic_box:Be().optional(),name:k().optional(),description:k().optional()}).describe("Defines a group of components on the schematic");$t(!0);var M_o=Ee({type:ce("schematic_table"),schematic_table_id:Wn("schematic_table"),schematic_sheet_id:k().optional(),anchor_position:Tr,column_widths:st(un),row_heights:st(un),cell_padding:un.optional(),border_width:un.optional(),subcircuit_id:k().optional(),schematic_component_id:k().optional(),anchor:iD.optional()}).describe("Defines a table on the schematic");$t(!0);var w_o=Ee({type:ce("schematic_table_cell"),schematic_table_cell_id:Wn("schematic_table_cell"),schematic_sheet_id:k().optional(),schematic_table_id:k(),start_row_index:ge(),end_row_index:ge(),start_column_index:ge(),end_column_index:ge(),text:k().optional(),center:Tr,width:un,height:un,horizontal_align:bt(["left","center","right"]).optional(),vertical_align:bt(["top","middle","bottom"]).optional(),font_size:un.optional(),subcircuit_id:k().optional()}).describe("Defines a cell within a schematic_table");$t(!0);var B_o=bt(["a4","ansi_b"]),T_o=Ee({type:ce("schematic_sheet"),schematic_sheet_id:Wn("schematic_sheet"),name:k().optional(),sheet_index:ge().optional(),sheet_size:B_o.optional(),sheet_width:ge().positive().optional(),sheet_height:ge().positive().optional(),subcircuit_id:k().optional(),outline_color:k().optional()}).describe("Defines a schematic sheet or page that components can be placed on");$t(!0);var D_o=Ee({x:un,y:un,bulge:ge().optional()});$t(!0);var DAt=Ee({vertices:st(D_o)});$t(!0);var aft=Ee({outer_ring:DAt,inner_rings:st(DAt).default([])});$t(!0);var N_o={from_left:"from_left",from_right:"from_right",from_top:"from_top",from_bottom:"from_bottom",from_above:"from_above",from_below:"from_below",from_x_neg:"from_left",from_x_pos:"from_right",from_y_pos:"from_top",from_y_neg:"from_bottom",from_z_pos:"from_above",from_z_neg:"from_below",from_front:"from_top",from_back:"from_bottom"},Rcs={from_left:{x:-1,y:0,z:0},from_right:{x:1,y:0,z:0},from_top:{x:0,y:1,z:0},from_bottom:{x:0,y:-1,z:0},from_above:{x:0,y:0,z:1},from_below:{x:0,y:0,z:-1}},R_o=bt(["from_left","from_right","from_top","from_bottom","from_above","from_below","from_x_neg","from_x_pos","from_y_pos","from_y_neg","from_z_pos","from_z_neg","from_front","from_back"]).transform((e)=>N_o[e]).describe('The side exposing the receptacle where the cable or mating part is attached, following the 2D PCB diagram convention, not a 3D viewport frame. In project coordinate space, "from_top" is +Y, "from_bottom" -Y, "from_left" -X, "from_right" +X, "from_above" +Z and "from_below" -Z. A receptacle on the +Y edge is "from_top" even though the plug moves in -Y as it seats. Cartesian spellings such as "from_y_pos" are accepted and normalized to the named values, as are the deprecated "from_front" (now "from_top") and "from_back" (now "from_bottom").');$t(!0);$t(!0);var NAt=bt(["leftside_top","leftside_bottom","rightside_top","rightside_bottom","topside_left","topside_right","bottomside_left","bottomside_right"]);$t(!0);var Qcs=[["leftside_top","bottomside_left","rightside_bottom","topside_right"],["leftside_bottom","bottomside_right","rightside_top","topside_left"]],kcs=(e,t)=>{for(let n of Qcs){let o=n.indexOf(e),r=n.indexOf(t);if(o!==-1&&r!==-1)return(r-o+n.length)%n.length*90}return null},Q_o=Ee({x:un,y:un,via:Be().optional(),via_to_layer:Ka.optional()}),Lcs=st(Q_o);$t(!0);$t(!0);var k_o=Ee({x:un,y:un,via:Be().optional(),to_layer:Ka.optional(),trace_width:un.optional()});$t(!0);var L_o=Ee({min_trace_width:ar.optional(),min_board_edge_clearance:ar.optional(),min_via_hole_edge_to_via_hole_edge_clearance:ar.optional(),min_plated_hole_drill_edge_to_drill_edge_clearance:ar.optional(),min_trace_to_pad_edge_clearance:ar.optional(),min_pad_edge_to_pad_edge_clearance:ar.optional(),min_same_net_trace_edge_to_trace_edge_clearance:ar.optional(),min_different_net_trace_edge_to_trace_edge_clearance:ar.optional(),min_via_edge_to_pad_edge_clearance:ar.optional(),min_via_hole_diameter:ar.optional(),min_via_pad_diameter:ar.optional()}),H_o=Ee({type:ce("pcb_component"),pcb_component_id:Wn("pcb_component"),source_component_id:k(),center:Tr,layer:Ka,rotation:n0,display_offset_x:k().optional().describe("How to display the x offset for this part, usually corresponding with how the user specified it"),display_offset_y:k().optional().describe("How to display the y offset for this part, usually corresponding with how the user specified it"),width:ar,height:ar,do_not_place:Be().optional(),is_allowed_to_be_off_board:Be().optional(),subcircuit_id:k().optional(),pcb_group_id:k().optional(),position_mode:bt(["packed","relative_to_group_anchor","relative_to_another_component","none"]).optional(),anchor_position:Tr.optional(),anchor_alignment:iD.optional(),positioned_relative_to_pcb_group_id:k().optional(),positioned_relative_to_pcb_board_id:k().optional(),cable_insertion_center:Tr.optional(),insertion_direction:R_o.optional(),pin1_location:NAt.optional().describe("Location of pin 1 on the unrotated, top-view component footprint"),supplier_pin1_location_map:Ss(l_e,NAt).optional().describe("Pin 1 location for each supplier's unrotated, top-view footprint"),metadata:Ee({kicad_footprint:mmo.optional()}).optional(),obstructs_within_bounds:Be().default(!0).describe("Does this component take up all the space within its bounds on a layer. This is generally true except for when separated pin headers are being represented by a single component (in which case, chips can be placed between the pin headers) or for tall modules where chips fit underneath")}).describe("Defines a component on the PCB");$t(!0);var aDe=Ee({type:ce("pcb_debug_object"),pcb_debug_object_id:Wn("pcb_debug_object"),label:k().optional(),subcircuit_id:k().optional()}),F_o=aDe.extend({shape:ce("rect"),center:Tr,size:nDe}),z_o=aDe.extend({shape:ce("line"),start:Tr,end:Tr}),O_o=aDe.extend({shape:ce("point"),center:Tr}),V_o=ss("shape",[F_o,z_o,O_o]);$t(!0);var Y_o=Ee({type:ce("pcb_hole"),pcb_hole_id:Wn("pcb_hole"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),pcb_component_id:k().optional(),hole_shape:ce("circle"),hole_diameter:ge(),x:un,y:un,is_covered_with_solder_mask:Be().optional(),soldermask_margin:ge().optional()}),Hcs=Y_o.describe("Defines a circular hole on the PCB");$t(!0);var G_o=Ee({type:ce("pcb_hole"),pcb_hole_id:Wn("pcb_hole"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),pcb_component_id:k().optional(),hole_shape:ce("rect"),hole_width:ge(),hole_height:ge(),x:un,y:un,is_covered_with_solder_mask:Be().optional(),soldermask_margin:ge().optional()}),Fcs=G_o.describe("Defines a rectangular (square-capable) hole on the PCB. Use equal width/height for square.");$t(!0);var U_o=Ee({type:ce("pcb_hole"),pcb_hole_id:Wn("pcb_hole"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),pcb_component_id:k().optional(),hole_shape:bt(["circle","square"]),hole_diameter:ge(),x:un,y:un,is_covered_with_solder_mask:Be().optional(),soldermask_margin:ge().optional()}),zcs=U_o.describe("Defines a circular or square hole on the PCB");$t(!0);var W_o=Ee({type:ce("pcb_hole"),pcb_hole_id:Wn("pcb_hole"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),pcb_component_id:k().optional(),hole_shape:ce("oval"),hole_width:ge(),hole_height:ge(),x:un,y:un,is_covered_with_solder_mask:Be().optional(),soldermask_margin:ge().optional()}),Ocs=W_o.describe("Defines an oval hole on the PCB");$t(!0);var X_o=Ee({type:ce("pcb_hole"),pcb_hole_id:Wn("pcb_hole"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),pcb_component_id:k().optional(),hole_shape:ce("pill"),hole_width:ge(),hole_height:ge(),x:un,y:un,is_covered_with_solder_mask:Be().optional(),soldermask_margin:ge().optional()}),Vcs=X_o.describe("Defines a pill-shaped hole on the PCB");$t(!0);var j_o=Ee({type:ce("pcb_hole"),pcb_hole_id:Wn("pcb_hole"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),pcb_component_id:k().optional(),hole_shape:ce("rotated_pill"),hole_width:ge(),hole_height:ge(),x:un,y:un,ccw_rotation:n0,is_covered_with_solder_mask:Be().optional(),soldermask_margin:ge().optional()}),Ycs=j_o.describe("Defines a rotated pill-shaped hole on the PCB");$t(!0);var K_o=U_o.or(W_o).or(X_o).or(j_o).or(Y_o).or(G_o),Gcs=Ee({type:ce("pcb_plated_hole"),shape:ce("circle"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),outer_diameter:ge(),hole_diameter:ge(),is_covered_with_solder_mask:Be().optional(),x:un,y:un,layers:st(Ka),port_hints:st(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),pcb_plated_hole_id:Wn("pcb_plated_hole"),soldermask_margin:ge().optional()}),Ucs=Ee({type:ce("pcb_plated_hole"),shape:bt(["oval","pill"]),pcb_group_id:k().optional(),subcircuit_id:k().optional(),outer_width:ge(),outer_height:ge(),hole_width:ge(),hole_height:ge(),is_covered_with_solder_mask:Be().optional(),x:un,y:un,ccw_rotation:n0,layers:st(Ka),port_hints:st(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),pcb_plated_hole_id:Wn("pcb_plated_hole"),soldermask_margin:ge().optional()}),Wcs=Ee({type:ce("pcb_plated_hole"),shape:ce("circular_hole_with_rect_pad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),hole_shape:ce("circle"),pad_shape:ce("rect"),hole_diameter:ge(),rect_pad_width:ge(),rect_pad_height:ge(),rect_border_radius:ge().optional(),hole_offset_x:un.default(0),hole_offset_y:un.default(0),is_covered_with_solder_mask:Be().optional(),x:un,y:un,layers:st(Ka),port_hints:st(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),pcb_plated_hole_id:Wn("pcb_plated_hole"),soldermask_margin:ge().optional(),rect_ccw_rotation:n0.optional()}),Xcs=Ee({type:ce("pcb_plated_hole"),shape:ce("pill_hole_with_rect_pad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),hole_shape:ce("pill"),pad_shape:ce("rect"),hole_width:ge(),hole_height:ge(),rect_pad_width:ge(),rect_pad_height:ge(),rect_border_radius:ge().optional(),hole_offset_x:un.default(0),hole_offset_y:un.default(0),is_covered_with_solder_mask:Be().optional(),x:un,y:un,layers:st(Ka),port_hints:st(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),pcb_plated_hole_id:Wn("pcb_plated_hole"),soldermask_margin:ge().optional()}),jcs=Ee({type:ce("pcb_plated_hole"),shape:ce("rotated_pill_hole_with_rect_pad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),hole_shape:ce("rotated_pill"),pad_shape:ce("rect"),hole_width:ge(),hole_height:ge(),hole_ccw_rotation:n0,rect_pad_width:ge(),rect_pad_height:ge(),rect_border_radius:ge().optional(),rect_ccw_rotation:n0,hole_offset_x:un.default(0),hole_offset_y:un.default(0),is_covered_with_solder_mask:Be().optional(),x:un,y:un,layers:st(Ka),port_hints:st(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),pcb_plated_hole_id:Wn("pcb_plated_hole"),soldermask_margin:ge().optional()}),Kcs=Ee({type:ce("pcb_plated_hole"),shape:ce("hole_with_polygon_pad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),hole_shape:bt(["circle","oval","pill","rotated_pill"]),hole_diameter:ge().optional(),hole_width:ge().optional(),hole_height:ge().optional(),pad_outline:st(Ee({x:un,y:un})).min(3),hole_offset_x:un.default(0),hole_offset_y:un.default(0),is_covered_with_solder_mask:Be().optional(),x:un,y:un,layers:st(Ka),port_hints:st(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),pcb_plated_hole_id:Wn("pcb_plated_hole"),soldermask_margin:ge().optional(),ccw_rotation:n0.optional()}),$_o=an([Gcs,Ucs,Wcs,Xcs,jcs,Kcs]);$t(!0);$t(!0);$t(!0);$t(!0);$t(!0);$t(!0);var q_o=Ee({type:ce("pcb_port"),pcb_port_id:Wn("pcb_port"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),source_port_id:k(),pcb_component_id:k().optional(),x:un,y:un,layers:st(Ka),is_board_pinout:Be().optional()}).describe("Defines a port on the PCB");$t(!0);var $cs=Ee({type:ce("pcb_smtpad"),shape:ce("circle"),pcb_smtpad_id:Wn("pcb_smtpad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:un,y:un,radius:ge(),layer:Ka,port_hints:st(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),is_covered_with_solder_mask:Be().optional(),soldermask_margin:ge().optional(),solderpaste_margin:ge().optional()}),qcs=Ee({type:ce("pcb_smtpad"),shape:ce("rect"),pcb_smtpad_id:Wn("pcb_smtpad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:un,y:un,width:ge(),height:ge(),rect_border_radius:ge().optional(),corner_radius:ge().optional(),layer:Ka,port_hints:st(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),is_covered_with_solder_mask:Be().optional(),soldermask_margin:ge().optional(),soldermask_margin_left:ge().optional(),soldermask_margin_top:ge().optional(),soldermask_margin_right:ge().optional(),soldermask_margin_bottom:ge().optional(),solderpaste_margin:ge().optional()}),Jcs=Ee({type:ce("pcb_smtpad"),shape:ce("rotated_rect"),pcb_smtpad_id:Wn("pcb_smtpad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:un,y:un,width:ge(),height:ge(),rect_border_radius:ge().optional(),corner_radius:ge().optional(),ccw_rotation:n0,layer:Ka,port_hints:st(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),is_covered_with_solder_mask:Be().optional(),soldermask_margin:ge().optional(),soldermask_margin_left:ge().optional(),soldermask_margin_top:ge().optional(),soldermask_margin_right:ge().optional(),soldermask_margin_bottom:ge().optional(),solderpaste_margin:ge().optional()}),J_o=Ee({type:ce("pcb_smtpad"),shape:ce("pill"),pcb_smtpad_id:Wn("pcb_smtpad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:un,y:un,width:ge(),height:ge(),radius:ge(),layer:Ka,port_hints:st(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),is_covered_with_solder_mask:Be().optional(),soldermask_margin:ge().optional(),solderpaste_margin:ge().optional()}),Zcs=Ee({type:ce("pcb_smtpad"),shape:ce("rotated_pill"),pcb_smtpad_id:Wn("pcb_smtpad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:un,y:un,width:ge(),height:ge(),radius:ge(),ccw_rotation:n0,layer:Ka,port_hints:st(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),is_covered_with_solder_mask:Be().optional(),soldermask_margin:ge().optional(),solderpaste_margin:ge().optional()}),els=Ee({type:ce("pcb_smtpad"),shape:ce("polygon"),pcb_smtpad_id:Wn("pcb_smtpad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),points:st(Tr),layer:Ka,port_hints:st(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),is_covered_with_solder_mask:Be().optional(),soldermask_margin:ge().optional(),solderpaste_margin:ge().optional()}),Z_o=ss("shape",[$cs,qcs,Jcs,Zcs,J_o,els]).describe("Defines an SMT pad on the PCB");$t(!0);$t(!0);$t(!0);$t(!0);$t(!0);$t(!0);var tls=Ee({type:ce("pcb_solder_paste"),shape:ce("circle"),pcb_solder_paste_id:Wn("pcb_solder_paste"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:un,y:un,radius:ge(),layer:Ka,pcb_component_id:k().optional(),pcb_smtpad_id:k().optional()}),nls=Ee({type:ce("pcb_solder_paste"),shape:ce("rect"),pcb_solder_paste_id:Wn("pcb_solder_paste"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:un,y:un,width:ge(),height:ge(),layer:Ka,pcb_component_id:k().optional(),pcb_smtpad_id:k().optional()}),ols=Ee({type:ce("pcb_solder_paste"),shape:ce("pill"),pcb_solder_paste_id:Wn("pcb_solder_paste"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:un,y:un,width:ge(),height:ge(),radius:ge(),layer:Ka,pcb_component_id:k().optional(),pcb_smtpad_id:k().optional()}),rls=Ee({type:ce("pcb_solder_paste"),shape:ce("rotated_rect"),pcb_solder_paste_id:Wn("pcb_solder_paste"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:un,y:un,width:ge(),height:ge(),ccw_rotation:un,layer:Ka,pcb_component_id:k().optional(),pcb_smtpad_id:k().optional()}),ils=Ee({type:ce("pcb_solder_paste"),shape:ce("rotated_pill"),pcb_solder_paste_id:Wn("pcb_solder_paste"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:un,y:un,width:ge(),height:ge(),radius:ge(),ccw_rotation:n0,layer:Ka,pcb_component_id:k().optional(),pcb_smtpad_id:k().optional()}),sls=Ee({type:ce("pcb_solder_paste"),shape:ce("oval"),pcb_solder_paste_id:Wn("pcb_solder_paste"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:un,y:un,width:ge(),height:ge(),layer:Ka,pcb_component_id:k().optional(),pcb_smtpad_id:k().optional()}),ego=an([tls,nls,ols,rls,ils,sls]).describe("Defines solderpaste on the PCB");$t(!0);$t(!0);$t(!0);$t(!0);$t(!0);$t(!0);var tgo=Ee({type:ce("pcb_text"),pcb_text_id:Wn("pcb_text"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),text:k(),center:Tr,layer:Ka,width:ar,height:ar,lines:ge(),align:bt(["bottom-left"])}).describe("Defines text on the PCB");$t(!0);var ngo=Ee({route_type:ce("wire"),x:un,y:un,width:un,copper_pour_id:k().optional(),is_inside_copper_pour:Be().optional(),start_pcb_port_id:k().optional(),end_pcb_port_id:k().optional(),layer:Ka}),ogo=Ee({route_type:ce("via"),x:un,y:un,copper_pour_id:k().optional(),is_inside_copper_pour:Be().optional(),hole_diameter:un.optional(),outer_diameter:un.optional(),from_layer:Ka,to_layer:Ka}),rgo=Ee({route_type:ce("through_pad"),start:Tr,end:Tr,width:un,start_layer:Ka,end_layer:Ka,pcb_smtpad_id:k().optional(),pcb_plated_hole_id:k().optional()}),igo=an([ngo,ogo,rgo]),sgo=Ee({type:ce("pcb_trace"),source_trace_id:k().optional(),pcb_component_id:k().optional(),pcb_trace_id:Wn("pcb_trace"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),route_thickness_mode:bt(["constant","interpolated"]).default("constant").optional(),route_order_index:ge().optional(),should_round_corners:Be().optional(),trace_length:ge().optional(),highlight_color:k().optional(),route:st(igo)}).describe("Defines a trace on the PCB");$t(!0);$t(!0);var ago=Ee({type:ce("pcb_trace_warning"),pcb_trace_warning_id:Wn("pcb_trace_warning"),warning_type:ce("pcb_trace_warning").default("pcb_trace_warning"),message:k(),center:Tr.optional(),pcb_trace_id:k(),source_trace_id:k(),pcb_component_ids:st(k()),pcb_port_ids:st(k()),subcircuit_id:k().optional()}).describe("Defines a trace warning on the PCB");$t(!0);var cgo=Ee({type:ce("pcb_trace_too_long_warning"),pcb_trace_too_long_warning_id:Wn("pcb_trace_too_long_warning"),warning_type:ce("pcb_trace_too_long_warning").default("pcb_trace_too_long_warning"),message:k(),pcb_trace_id:k(),source_net_id:k().optional(),source_trace_id:k().optional(),actual_trace_length:un,maximum_trace_length:un,subcircuit_id:k().optional()}).describe("Warning emitted when a PCB trace is longer than its maximum allowed length");$t(!0);var lgo=Ee({type:ce("pcb_trace_too_many_vias_warning"),pcb_trace_too_many_vias_warning_id:Wn("pcb_trace_too_many_vias_warning"),warning_type:ce("pcb_trace_too_many_vias_warning").default("pcb_trace_too_many_vias_warning"),message:k(),pcb_trace_id:k(),source_net_id:k().optional(),source_trace_id:k().optional(),actual_via_count:ge().int().nonnegative(),maximum_via_count:ge().int().nonnegative(),subcircuit_id:k().optional()}).describe("Warning emitted when a PCB trace has more vias than its maximum allowed count");$t(!0);var hgo=Kl.extend({type:ce("pcb_trace_error"),pcb_trace_error_id:Wn("pcb_trace_error"),error_type:ce("pcb_trace_error").default("pcb_trace_error"),center:Tr.optional(),pcb_trace_id:k(),source_trace_id:k(),pcb_component_ids:st(k()),pcb_port_ids:st(k()),subcircuit_id:k().optional()}).describe("Defines a trace error on the PCB");$t(!0);var dgo=Kl.extend({type:ce("pcb_trace_missing_error"),pcb_trace_missing_error_id:Wn("pcb_trace_missing_error"),error_type:ce("pcb_trace_missing_error").default("pcb_trace_missing_error"),center:Tr.optional(),source_trace_id:k(),pcb_component_ids:st(k()),pcb_port_ids:st(k()),subcircuit_id:k().optional()}).describe("Defines an error when a source trace has no corresponding PCB trace");$t(!0);var ugo=Kl.extend({type:ce("pcb_port_not_matched_error"),pcb_error_id:Wn("pcb_error"),error_type:ce("pcb_port_not_matched_error").default("pcb_port_not_matched_error"),pcb_component_ids:st(k()),subcircuit_id:k().optional()}).describe("Defines a trace error on the PCB where a port is not matched");$t(!0);var pgo=Kl.extend({type:ce("pcb_port_not_connected_error"),pcb_port_not_connected_error_id:Wn("pcb_port_not_connected_error"),error_type:ce("pcb_port_not_connected_error").default("pcb_port_not_connected_error"),pcb_port_ids:st(k()),pcb_component_ids:st(k()),subcircuit_id:k().optional()}).describe("Defines an error when a pcb port is not connected to any trace");$t(!0);var mgo=Ee({type:ce("pcb_net"),pcb_net_id:Wn("pcb_net"),source_net_id:k().optional(),highlight_color:k().optional()}).describe("Defines a net on the PCB");$t(!0);var _go=Ee({type:ce("pcb_via"),pcb_via_id:Wn("pcb_via"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),subcircuit_connectivity_map_key:k().optional(),x:un,y:un,outer_diameter:un.default("0.6mm"),hole_diameter:un.default("0.25mm"),from_layer:Ka.optional(),to_layer:Ka.optional(),layers:st(Ka),pcb_trace_id:k().optional(),source_trace_id:k().optional(),source_net_id:k().min(1).optional(),net_is_assignable:Be().optional(),net_assigned:Be().optional(),is_tented:Be().optional()}).describe("Defines a via on the PCB");$t(!0);var ggo=Ee({type:ce("pcb_board"),pcb_board_id:Wn("pcb_board"),pcb_panel_id:k().optional(),carrier_pcb_board_id:k().optional(),is_subcircuit:Be().optional(),subcircuit_id:k().optional(),is_mounted_to_carrier_board:Be().optional(),is_via_in_pad_allowed:Be().optional(),width:ar.optional(),height:ar.optional(),center:Tr,display_offset_x:k().optional().describe("How to display the x offset for this board, usually corresponding with how the user specified it"),display_offset_y:k().optional().describe("How to display the y offset for this board, usually corresponding with how the user specified it"),thickness:ar.optional().default(1.4),num_layers:ge().optional().default(4),allow_blind_and_buried_vias:Be().optional().describe("Whether autorouters may generate blind and buried vias. False restricts newly generated vias to the full board stack."),outline:st(Tr).optional(),shape:bt(["rect","polygon"]).optional(),material:bt(["fr4","fr1"]).default("fr4"),solder_mask_color:k().optional(),silkscreen_color:k().optional(),anchor_position:Tr.optional(),anchor_alignment:iD.optional(),position_mode:bt(["relative_to_panel_anchor","none"]).optional()}).merge(L_o).describe("Defines the board outline of the PCB");$t(!0);var Ago=Ee({type:ce("pcb_panel"),pcb_panel_id:Wn("pcb_panel"),width:ar,height:ar,center:Tr,thickness:ar.optional().default(1.4),covered_with_solder_mask:Be().optional().default(!0)}).describe("Defines a PCB panel that can contain multiple boards");$t(!0);var fgo=Kl.extend({type:ce("pcb_placement_error"),pcb_placement_error_id:Wn("pcb_placement_error"),error_type:ce("pcb_placement_error").default("pcb_placement_error"),subcircuit_id:k().optional()}).describe("Defines a placement error on the PCB");$t(!0);var ygo=Kl.extend({type:ce("pcb_packing_error"),pcb_packing_error_id:Wn("pcb_packing_error"),error_type:ce("pcb_packing_error").default("pcb_packing_error"),pcb_group_id:k().optional(),subcircuit_id:k().optional()}).describe("Defines a failure to pack PCB components within layout bounds");$t(!0);var xgo=Kl.extend({type:ce("pcb_panelization_placement_error"),pcb_panelization_placement_error_id:Wn("pcb_panelization_placement_error"),error_type:ce("pcb_panelization_placement_error").default("pcb_panelization_placement_error"),pcb_panel_id:k().optional(),pcb_board_id:k().optional(),subcircuit_id:k().optional()}).describe("Defines a panelization placement error on the PCB");$t(!0);var Cgo=Ee({type:ce("pcb_trace_hint"),pcb_trace_hint_id:Wn("pcb_trace_hint"),pcb_port_id:k(),pcb_component_id:k(),route:st(k_o),subcircuit_id:k().optional()}).describe("A hint that can be used during generation of a PCB trace");$t(!0);var bgo=Ee({type:ce("pcb_silkscreen_line"),pcb_silkscreen_line_id:Wn("pcb_silkscreen_line"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),stroke_width:un.default("0.1mm"),x1:un,y1:un,x2:un,y2:un,layer:uA}).describe("Defines a silkscreen line on the PCB");$t(!0);var Igo=Ee({type:ce("pcb_silkscreen_path"),pcb_silkscreen_path_id:Wn("pcb_silkscreen_path"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),layer:uA,route:st(Tr),stroke_width:ar}).describe("Defines a silkscreen path on the PCB");$t(!0);var vgo=Ee({type:ce("pcb_silkscreen_text"),pcb_silkscreen_text_id:Wn("pcb_silkscreen_text"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),font:ce("tscircuit2024").default("tscircuit2024"),font_size:un.default("0.2mm"),pcb_component_id:k(),text:k(),is_knockout:Be().default(!1).optional(),knockout_padding:Ee({left:ar,top:ar,bottom:ar,right:ar}).default({left:"0.2mm",top:"0.2mm",bottom:"0.2mm",right:"0.2mm"}).optional(),ccw_rotation:ge().optional(),layer:Ka,is_mirrored:Be().default(!1).optional(),anchor_position:Tr.default({x:0,y:0}),anchor_alignment:iD.default("center")}).describe("Defines silkscreen text on the PCB");$t(!0);var Sgo=Ee({type:ce("pcb_copper_text"),pcb_copper_text_id:Wn("pcb_copper_text"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),font:ce("tscircuit2024").default("tscircuit2024"),font_size:un.default("0.2mm"),pcb_component_id:k(),text:k(),is_knockout:Be().default(!1).optional(),knockout_padding:Ee({left:ar,top:ar,bottom:ar,right:ar}).default({left:"0.2mm",top:"0.2mm",bottom:"0.2mm",right:"0.2mm"}).optional(),ccw_rotation:ge().optional(),layer:Ka,is_mirrored:Be().default(!1).optional(),anchor_position:Tr.default({x:0,y:0}),anchor_alignment:iD.default("center")}).describe("Defines copper text on the PCB");$t(!0);var Pgo=Ee({type:ce("pcb_silkscreen_rect"),pcb_silkscreen_rect_id:Wn("pcb_silkscreen_rect"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:Tr,width:ar,height:ar,layer:Ka,stroke_width:ar.default("1mm"),corner_radius:ar.optional(),is_filled:Be().default(!0).optional(),has_stroke:Be().optional(),is_stroke_dashed:Be().optional(),ccw_rotation:ge().optional()}).describe("Defines a silkscreen rect on the PCB");$t(!0);var Ego=Ee({type:ce("pcb_silkscreen_circle"),pcb_silkscreen_circle_id:Wn("pcb_silkscreen_circle"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:Tr,radius:ar,layer:uA,stroke_width:ar.default("1mm"),is_filled:Be().optional()}).describe("Defines a silkscreen circle on the PCB");$t(!0);var Mgo=Ee({type:ce("pcb_silkscreen_oval"),pcb_silkscreen_oval_id:Wn("pcb_silkscreen_oval"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:Tr,radius_x:un,radius_y:un,layer:uA,ccw_rotation:n0.optional()}).describe("Defines a silkscreen oval on the PCB");$t(!0);var als=Ee({type:ce("pcb_silkscreen_graphic"),pcb_silkscreen_graphic_id:Wn("pcb_silkscreen_graphic"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),layer:uA,image_asset:oDe.optional()}),wgo=als.extend({shape:ce("brep"),brep_shape:aft}).describe("Defines a BRep silkscreen graphic on the PCB");$t(!0);var Bgo=ss("shape",[wgo]).describe("Defines a silkscreen graphic on the PCB");$t(!0);var Tgo=Ee({type:ce("pcb_silkscreen_pill"),pcb_silkscreen_pill_id:Wn("pcb_silkscreen_pill"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:Tr,width:ar,height:ar,layer:Ka,ccw_rotation:ge().optional()}).describe("Defines a silkscreen pill on the PCB");$t(!0);var Dgo=Ee({type:ce("pcb_fabrication_note_text"),pcb_fabrication_note_text_id:Wn("pcb_fabrication_note_text"),subcircuit_id:k().optional(),pcb_group_id:k().optional(),font:ce("tscircuit2024").default("tscircuit2024"),font_size:un.default("1mm"),pcb_component_id:k(),text:k(),ccw_rotation:ge().optional(),layer:uA,anchor_position:Tr.default({x:0,y:0}),anchor_alignment:bt(["center","top_left","top_right","bottom_left","bottom_right"]).default("center"),color:k().optional()}).describe("Defines a fabrication note in text on the PCB, useful for leaving notes for assemblers or fabricators");$t(!0);var Ngo=Ee({type:ce("pcb_fabrication_note_path"),pcb_fabrication_note_path_id:Wn("pcb_fabrication_note_path"),pcb_component_id:k(),subcircuit_id:k().optional(),layer:Ka,route:st(Tr),stroke_width:ar,color:k().optional()}).describe("Defines a fabrication path on the PCB for fabricators or assemblers");$t(!0);var Rgo=Ee({type:ce("pcb_fabrication_note_rect"),pcb_fabrication_note_rect_id:Wn("pcb_fabrication_note_rect"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:Tr,width:ar,height:ar,layer:uA,stroke_width:ar.default("0.1mm"),corner_radius:ar.optional(),is_filled:Be().optional(),has_stroke:Be().optional(),is_stroke_dashed:Be().optional(),color:k().optional()}).describe("Defines a fabrication note rectangle on the PCB");$t(!0);var Qgo=Ee({type:ce("pcb_fabrication_note_dimension"),pcb_fabrication_note_dimension_id:Wn("pcb_fabrication_note_dimension"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),layer:uA,from:Tr,to:Tr,text:k().optional(),text_ccw_rotation:ge().optional(),offset:ar.optional(),offset_distance:ar.optional(),offset_direction:Ee({x:ge(),y:ge()}).optional(),font:ce("tscircuit2024").default("tscircuit2024"),font_size:ar.default("1mm"),color:k().optional(),arrow_size:ar.default("1mm")}).describe("Defines a measurement annotation within PCB fabrication notes");$t(!0);var kgo=Ee({type:ce("pcb_note_text"),pcb_note_text_id:Wn("pcb_note_text"),pcb_component_id:k().optional(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),name:k().optional(),font:ce("tscircuit2024").default("tscircuit2024"),font_size:un.default("1mm"),text:k().optional(),anchor_position:Tr.default({x:0,y:0}),anchor_alignment:bt(["center","top_left","top_right","bottom_left","bottom_right"]).default("center"),layer:uA.default("top"),is_mirrored_from_top_view:Be().optional(),color:k().optional()}).describe("Defines a documentation note in text on the PCB");$t(!0);var Lgo=Ee({type:ce("pcb_note_rect"),pcb_note_rect_id:Wn("pcb_note_rect"),pcb_component_id:k().optional(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),name:k().optional(),text:k().optional(),center:Tr,width:ar,height:ar,layer:uA.default("top"),stroke_width:ar.default("0.1mm"),corner_radius:ar.optional(),is_filled:Be().optional(),has_stroke:Be().optional(),is_stroke_dashed:Be().optional(),color:k().optional()}).describe("Defines a rectangular documentation note on the PCB");$t(!0);var Hgo=Ee({type:ce("pcb_note_path"),pcb_note_path_id:Wn("pcb_note_path"),pcb_component_id:k().optional(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),name:k().optional(),text:k().optional(),route:st(Tr),layer:uA.default("top"),stroke_width:ar.default("0.1mm"),color:k().optional()}).describe("Defines a polyline documentation note on the PCB");$t(!0);var Fgo=Ee({type:ce("pcb_note_line"),pcb_note_line_id:Wn("pcb_note_line"),pcb_component_id:k().optional(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),name:k().optional(),text:k().optional(),x1:un,y1:un,x2:un,y2:un,layer:uA.default("top"),stroke_width:un.default("0.1mm"),color:k().optional(),is_dashed:Be().optional()}).describe("Defines a straight documentation note line on the PCB");$t(!0);var zgo=Ee({type:ce("pcb_note_dimension"),pcb_note_dimension_id:Wn("pcb_note_dimension"),pcb_component_id:k().optional(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),name:k().optional(),from:Tr,to:Tr,text:k().optional(),text_ccw_rotation:ge().optional(),offset_distance:ar.optional(),offset_direction:Ee({x:ge(),y:ge()}).optional(),font:ce("tscircuit2024").default("tscircuit2024"),font_size:ar.default("1mm"),layer:uA.default("top"),color:k().optional(),arrow_size:ar.default("1mm")}).describe("Defines a measurement annotation within PCB documentation notes");$t(!0);var Ogo=Kl.extend({type:ce("pcb_footprint_overlap_error"),pcb_error_id:Wn("pcb_error"),error_type:ce("pcb_footprint_overlap_error").default("pcb_footprint_overlap_error"),pcb_smtpad_ids:st(k()).optional(),pcb_plated_hole_ids:st(k()).optional(),pcb_hole_ids:st(k()).optional(),pcb_keepout_ids:st(k()).optional()}).describe("Error emitted when a pcb footprint overlaps with another element");$t(!0);var Vgo=Kl.extend({type:ce("pcb_courtyard_overlap_error"),pcb_error_id:Wn("pcb_error"),error_type:ce("pcb_courtyard_overlap_error").default("pcb_courtyard_overlap_error"),pcb_component_ids:c1([k(),k()])}).describe("Error emitted when the courtyard (CrtYd) of one PCB component overlaps with the courtyard of another");$t(!0);var Ygo=Ee({type:ce("pcb_keepout"),shape:ce("rect"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:Tr,width:un,height:un,pcb_keepout_id:k(),layers:st(k()),description:k().optional(),excluded_pcb_component_ids:st(k()).optional()}).or(Ee({type:ce("pcb_keepout"),shape:ce("circle"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:Tr,radius:un,pcb_keepout_id:k(),layers:st(k()),description:k().optional(),excluded_pcb_component_ids:st(k()).optional()}));$t(!0);var cDe=Ee({type:ce("pcb_cutout"),pcb_cutout_id:Wn("pcb_cutout"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),pcb_board_id:k().optional(),pcb_panel_id:k().optional()}),Ggo=cDe.extend({shape:ce("rect"),center:Tr,width:ar,height:ar,rotation:n0.optional(),corner_radius:ar.optional()});$t(!0);var Ugo=cDe.extend({shape:ce("circle"),center:Tr,radius:ar});$t(!0);var Wgo=cDe.extend({shape:ce("polygon"),points:st(Tr)});$t(!0);var Xgo=cDe.extend({shape:ce("path"),route:st(Tr),slot_width:ar,slot_length:ar.optional(),space_between_slots:ar.optional(),slot_corner_radius:ar.optional()});$t(!0);var jgo=ss("shape",[Ggo,Ugo,Wgo,Xgo]).describe("Defines a cutout on the PCB, removing board material.");$t(!0);var Kgo=Kl.extend({type:ce("pcb_missing_footprint_error"),pcb_missing_footprint_error_id:Wn("pcb_missing_footprint_error"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),error_type:ce("pcb_missing_footprint_error").default("pcb_missing_footprint_error"),source_component_id:k()}).describe("Defines a missing footprint error on the PCB");$t(!0);var $go=Kl.extend({type:ce("external_footprint_load_error"),external_footprint_load_error_id:Wn("external_footprint_load_error"),pcb_component_id:k(),source_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),footprinter_string:k().optional(),error_type:ce("external_footprint_load_error").default("external_footprint_load_error")}).describe("Defines an error when an external footprint fails to load");$t(!0);var qgo=Kl.extend({type:ce("circuit_json_footprint_load_error"),circuit_json_footprint_load_error_id:Wn("circuit_json_footprint_load_error"),pcb_component_id:k(),source_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),error_type:ce("circuit_json_footprint_load_error").default("circuit_json_footprint_load_error"),circuit_json:st(Sd()).optional()}).describe("Defines an error when a circuit JSON footprint fails to load");$t(!0);var Jgo=Ee({type:ce("pcb_group"),pcb_group_id:Wn("pcb_group"),source_group_id:k(),is_subcircuit:Be().optional(),subcircuit_id:k().optional(),width:ar.optional(),height:ar.optional(),center:Tr,display_offset_x:k().optional().describe("How to display the x offset for this group, usually corresponding with how the user specified it"),display_offset_y:k().optional().describe("How to display the y offset for this group, usually corresponding with how the user specified it"),outline:st(Tr).optional(),anchor_position:Tr.optional(),anchor_alignment:iD.default("center"),position_mode:bt(["packed","relative_to_group_anchor","none"]).optional(),positioned_relative_to_pcb_group_id:k().optional(),positioned_relative_to_pcb_board_id:k().optional(),pcb_component_ids:st(k()),child_layout_mode:bt(["packed","none"]).optional(),name:k().optional(),description:k().optional(),layout_mode:k().optional(),autorouter_configuration:Ee({trace_clearance:ar}).optional(),autorouter_used_string:k().optional()}).describe("Defines a group of components on the PCB");$t(!0);var Zgo=Kl.extend({type:ce("pcb_autorouting_error"),pcb_error_id:Wn("pcb_autorouting_error"),error_type:ce("pcb_autorouting_error").default("pcb_autorouting_error"),subcircuit_id:k().optional()}).describe("The autorouting has failed to route a portion of the board");$t(!0);var eAo=Ee({type:ce("pcb_manual_edit_conflict_warning"),pcb_manual_edit_conflict_warning_id:Wn("pcb_manual_edit_conflict_warning"),warning_type:ce("pcb_manual_edit_conflict_warning").default("pcb_manual_edit_conflict_warning"),message:k(),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),source_component_id:k()}).describe("Warning emitted when a component has both manual placement and explicit pcbX/pcbY coordinates");$t(!0);var rmo=bt(["x-","x+","y+","y-"]),tAo=Ee({type:ce("pcb_connector_not_in_accessible_orientation_warning"),pcb_connector_not_in_accessible_orientation_warning_id:Wn("pcb_connector_not_in_accessible_orientation_warning"),warning_type:ce("pcb_connector_not_in_accessible_orientation_warning").default("pcb_connector_not_in_accessible_orientation_warning"),message:k(),pcb_component_id:k(),source_component_id:k().optional(),pcb_board_id:k().optional(),facing_direction:rmo,recommended_facing_direction:rmo,subcircuit_id:k().optional()}).describe("Warning emitted when a connector PCB component is facing inward toward the board and should be reoriented to an outward-facing direction");$t(!0);var nAo=Ee({type:ce("pcb_component_missing_courtyard_warning"),pcb_component_missing_courtyard_warning_id:Wn("pcb_component_missing_courtyard_warning"),warning_type:ce("pcb_component_missing_courtyard_warning").default("pcb_component_missing_courtyard_warning"),message:k(),pcb_component_id:k(),source_component_id:k().optional(),subcircuit_id:k().optional()}).describe("Warning emitted when a PCB component has no courtyard geometry");$t(!0);var oAo=Ee({type:ce("supplier_footprint_mismatch_warning"),supplier_footprint_mismatch_warning_id:Wn("supplier_footprint_mismatch_warning"),warning_type:ce("supplier_footprint_mismatch_warning").default("supplier_footprint_mismatch_warning"),message:k(),source_component_id:k(),pcb_component_id:k().optional(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),supplier_name:l_e.optional(),supplier_part_number:k().optional(),supplier_footprint_url:k().optional(),footprint_copper_intersection_over_union:ge()}).describe("Warning emitted when a supplier part footprint does not match the expected footprint");$t(!0);var rAo=Ee({type:ce("pcb_breakout_point"),pcb_breakout_point_id:Wn("pcb_breakout_point"),pcb_group_id:k(),subcircuit_id:k().optional(),source_trace_id:k().optional(),source_port_id:k().optional(),source_net_id:k().optional(),layer:Ka.optional(),x:un,y:un}).describe("Defines a routing target within a pcb_group for a source_trace or source_net");$t(!0);var iAo=Ee({type:ce("pcb_ground_plane"),pcb_ground_plane_id:Wn("pcb_ground_plane"),source_pcb_ground_plane_id:k(),source_net_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional()}).describe("Defines a ground plane on the PCB");$t(!0);var sAo=Ee({type:ce("pcb_ground_plane_region"),pcb_ground_plane_region_id:Wn("pcb_ground_plane_region"),pcb_ground_plane_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),layer:Ka,points:st(Tr)}).describe("Defines a polygon region of a ground plane");$t(!0);var aAo=Ee({type:ce("pcb_thermal_spoke"),pcb_thermal_spoke_id:Wn("pcb_thermal_spoke"),pcb_ground_plane_id:k(),shape:k(),spoke_count:ge(),spoke_thickness:un,spoke_inner_diameter:un,spoke_outer_diameter:un,pcb_plated_hole_id:k().optional(),subcircuit_id:k().optional()}).describe("Pattern for connecting a ground plane to a plated hole");$t(!0);var cft=Ee({type:ce("pcb_copper_pour"),pcb_copper_pour_id:Wn("pcb_copper_pour"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),layer:Ka,source_net_id:k().optional(),covered_with_solder_mask:Be().optional().default(!0)}),cAo=cft.extend({shape:ce("rect"),center:Tr,width:ar,height:ar,rotation:n0.optional()});$t(!0);var lAo=cft.extend({shape:ce("brep"),brep_shape:aft});$t(!0);var hAo=cft.extend({shape:ce("polygon"),points:st(Tr)});$t(!0);var dAo=ss("shape",[cAo,lAo,hAo]).describe("Defines a copper pour on the PCB.");$t(!0);var uAo=Kl.extend({type:ce("pcb_component_outside_board_error"),pcb_component_outside_board_error_id:Wn("pcb_component_outside_board_error"),error_type:ce("pcb_component_outside_board_error").default("pcb_component_outside_board_error"),pcb_component_id:k(),pcb_board_id:k(),component_center:Tr,component_bounds:Ee({min_x:ge(),max_x:ge(),min_y:ge(),max_y:ge()}),subcircuit_id:k().optional(),source_component_id:k().optional()}).describe("Error emitted when a PCB component is placed outside the board boundaries");$t(!0);var pAo=Kl.extend({type:ce("pcb_component_not_on_board_edge_error"),pcb_component_not_on_board_edge_error_id:Wn("pcb_component_not_on_board_edge_error"),error_type:ce("pcb_component_not_on_board_edge_error").default("pcb_component_not_on_board_edge_error"),pcb_component_id:k(),pcb_board_id:k(),component_center:Tr,pad_to_nearest_board_edge_distance:ge(),source_component_id:k().optional(),subcircuit_id:k().optional()}).describe("Error emitted when a component that must be placed on the board edge is centered away from the edge");$t(!0);var mAo=Kl.extend({type:ce("pcb_component_invalid_layer_error"),pcb_component_invalid_layer_error_id:Wn("pcb_component_invalid_layer_error"),error_type:ce("pcb_component_invalid_layer_error").default("pcb_component_invalid_layer_error"),pcb_component_id:k().optional(),source_component_id:k(),layer:Ka,subcircuit_id:k().optional()}).describe("Error emitted when a component is placed on an invalid layer (components can only be on 'top' or 'bottom' layers)");$t(!0);var _Ao=Kl.extend({type:ce("pcb_via_clearance_error"),pcb_error_id:Wn("pcb_error"),error_type:ce("pcb_via_clearance_error").default("pcb_via_clearance_error"),pcb_via_ids:st(k()).min(2),minimum_clearance:un.optional(),actual_clearance:un.optional(),pcb_center:Ee({x:ge().optional(),y:ge().optional()}).optional(),subcircuit_id:k().optional()}).describe("Error emitted when vias are closer than the allowed clearance");$t(!0);var gAo=Kl.extend({type:ce("pcb_via_trace_clearance_error"),pcb_via_trace_clearance_error_id:Wn("pcb_via_trace_clearance_error"),error_type:ce("pcb_via_trace_clearance_error").default("pcb_via_trace_clearance_error"),pcb_via_id:k(),pcb_trace_id:k(),minimum_clearance:un.optional(),actual_clearance:un.optional(),center:Ee({x:ge().optional(),y:ge().optional()}).optional(),subcircuit_id:k().optional()}).describe("Error emitted when a via and trace are closer than the allowed clearance");$t(!0);var AAo=Kl.extend({type:ce("pcb_pad_pad_clearance_error"),pcb_pad_pad_clearance_error_id:Wn("pcb_pad_pad_clearance_error"),error_type:ce("pcb_pad_pad_clearance_error").default("pcb_pad_pad_clearance_error"),pcb_pad_ids:st(k()).min(2),minimum_clearance:un.optional(),actual_clearance:un.optional(),center:Ee({x:ge().optional(),y:ge().optional()}).optional(),subcircuit_id:k().optional()}).describe("Error emitted when pads are closer than the allowed clearance");$t(!0);var fAo=Kl.extend({type:ce("pcb_pad_trace_clearance_error"),pcb_pad_trace_clearance_error_id:Wn("pcb_pad_trace_clearance_error"),error_type:ce("pcb_pad_trace_clearance_error").default("pcb_pad_trace_clearance_error"),pcb_pad_id:k(),pcb_trace_id:k(),minimum_clearance:un.optional(),actual_clearance:un.optional(),center:Ee({x:ge().optional(),y:ge().optional()}).optional(),subcircuit_id:k().optional()}).describe("Error emitted when a pad and trace are closer than allowed clearance");$t(!0);var yAo=Ee({type:ce("pcb_courtyard_rect"),pcb_courtyard_rect_id:Wn("pcb_courtyard_rect"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:Tr,width:ar,height:ar,layer:uA,ccw_rotation:n0.optional(),color:k().optional()}).describe("Defines a courtyard rectangle on the PCB");$t(!0);var xAo=Ee({type:ce("pcb_courtyard_outline"),pcb_courtyard_outline_id:Wn("pcb_courtyard_outline"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),layer:uA,outline:st(Tr).min(2)}).describe("Defines a courtyard outline on the PCB");$t(!0);var CAo=Ee({type:ce("pcb_courtyard_polygon"),pcb_courtyard_polygon_id:Wn("pcb_courtyard_polygon"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),layer:uA,points:st(Tr).min(3),color:k().optional()}).describe("Defines a courtyard polygon on the PCB");$t(!0);var bAo=Ee({type:ce("pcb_courtyard_circle"),pcb_courtyard_circle_id:Wn("pcb_courtyard_circle"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:Tr,radius:ar,layer:uA,color:k().optional()}).describe("Defines a courtyard circle on the PCB");$t(!0);var IAo=Ee({type:ce("pcb_courtyard_pill"),pcb_courtyard_pill_id:Wn("pcb_courtyard_pill"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:Tr,width:ar,height:ar,radius:ar,layer:uA,color:k().optional()}).describe("Defines a courtyard pill on the PCB");$t(!0);var cls=["obj","stl","3mf","gltf","glb","step","wrl"],vAo=["x+","x-","y+","y-","z+","z-"],lls={obj:"z+",stl:"z+","3mf":"z+",gltf:"y+",glb:"y+",step:"z+",wrl:"y+"},SAo=Ee({type:ce("cad_component"),cad_component_id:k(),pcb_component_id:k(),source_component_id:k(),position:rD,rotation:rD.optional(),size:rD.optional(),layer:Ka.optional(),subcircuit_id:k().optional(),footprinter_string:k().optional(),model_obj_url:k().optional(),model_stl_url:k().optional(),model_3mf_url:k().optional(),model_gltf_url:k().optional(),model_glb_url:k().optional(),model_step_url:k().optional(),model_wrl_url:k().optional(),model_asset:oDe.optional(),model_unit_to_mm_scale_factor:ge().optional(),model_board_normal_direction:bt(vAo).optional().describe(`The direction in the model's coordinate space that is considered "up" or "coming out of the board surface"`),model_origin_position:rD.optional(),model_origin_alignment:bt(["unknown","center","center_of_component_on_board_surface","bottom_center_of_component"]).optional(),model_object_fit:bt(["contain_within_bounds","fill_bounds"]).optional().default("contain_within_bounds"),model_jscad:Sd().optional(),show_as_translucent_model:Be().optional(),show_as_bounding_box:Be().optional(),show_hidden_edges:Be().optional(),anchor_alignment:bt(["center","center_of_component_on_board_surface"]).optional().default("center")}).describe("Defines a component on the PCB");$t(!0);var lft=bt(["sinewave","square","triangle","sawtooth"]),hls=an([k(),ge()]).transform((e)=>{if(typeof e==="string"){if(e.endsWith("%"))return parseFloat(e.slice(0,-1))/100;return parseFloat(e)}return e}).pipe(ge().min(0,"Duty cycle must be non-negative").max(1,"Duty cycle cannot be greater than 100%")),PAo=Ee({type:ce("simulation_voltage_source"),simulation_voltage_source_id:Wn("simulation_voltage_source"),is_dc_source:ce(!0).optional().default(!0),positive_source_port_id:k().optional(),negative_source_port_id:k().optional(),positive_source_net_id:k().optional(),negative_source_net_id:k().optional(),voltage:s8,ac_magnitude:s8.optional(),ac_phase:n0.optional()}).describe("Defines a DC voltage source for simulation"),EAo=Ee({type:ce("simulation_voltage_source"),simulation_voltage_source_id:Wn("simulation_voltage_source"),is_dc_source:ce(!1),terminal1_source_port_id:k().optional(),terminal2_source_port_id:k().optional(),terminal1_source_net_id:k().optional(),terminal2_source_net_id:k().optional(),voltage:s8.optional(),frequency:HU.optional(),peak_to_peak_voltage:s8.optional(),wave_shape:lft.optional(),phase:n0.optional(),duty_cycle:hls.optional(),pulse_delay:dA.optional(),rise_time:dA.optional(),fall_time:dA.optional(),pulse_width:dA.optional(),period:dA.optional(),ac_magnitude:s8.optional(),ac_phase:n0.optional()}).describe("Defines an AC voltage source for simulation"),MAo=an([PAo,EAo]).describe("Defines a voltage source for simulation");$t(!0);$t(!0);$t(!0);var dls=an([k(),ge()]).transform((e)=>{if(typeof e==="string"){if(e.endsWith("%"))return parseFloat(e.slice(0,-1))/100;return parseFloat(e)}return e}).pipe(ge().min(0,"Duty cycle must be non-negative").max(1,"Duty cycle cannot be greater than 100%")),wAo=Ee({type:ce("simulation_current_source"),simulation_current_source_id:Wn("simulation_current_source"),is_dc_source:ce(!0).optional().default(!0),positive_source_port_id:k().optional(),negative_source_port_id:k().optional(),positive_source_net_id:k().optional(),negative_source_net_id:k().optional(),current:TH,ac_magnitude:TH.optional(),ac_phase:n0.optional()}).describe("Defines a DC current source for simulation"),BAo=Ee({type:ce("simulation_current_source"),simulation_current_source_id:Wn("simulation_current_source"),is_dc_source:ce(!1),terminal1_source_port_id:k().optional(),terminal2_source_port_id:k().optional(),terminal1_source_net_id:k().optional(),terminal2_source_net_id:k().optional(),current:TH.optional(),frequency:HU.optional(),peak_to_peak_current:TH.optional(),wave_shape:lft.optional(),phase:n0.optional(),duty_cycle:dls.optional(),ac_magnitude:TH.optional(),ac_phase:n0.optional()}).describe("Defines an AC current source for simulation"),TAo=an([wAo,BAo]).describe("Defines a current source for simulation");$t(!0);$t(!0);$t(!0);var lDe=cc((e)=>e==="V"||e==="A"),hft=cc((e)=>e==="Ω"||e==="F"||e==="H"||e==="V"||e==="A"),DAo=an([ce("spice_dc_sweep"),ce("spice_dc_operating_point"),ce("spice_transient_analysis"),ce("spice_ac_analysis")]),NAo=Ee({method:bt(["trap","gear"]).optional(),reltol:an([ge(),k()]).optional(),abstol:an([ge(),k()]).optional(),vntol:an([ge(),k()]).optional()}).describe("SPICE solver options for a simulation experiment"),RAo=Ee({type:ce("simulation_experiment"),simulation_experiment_id:Wn("simulation_experiment"),name:k(),experiment_type:DAo,time_per_step:jne.optional(),start_time_ms:dA.optional(),end_time_ms:dA.optional(),spice_options:NAo.optional(),dc_sweep_voltage_source_id:k().optional(),dc_sweep_current_source_id:k().optional(),dc_sweep_start:ge().optional(),dc_sweep_stop:ge().optional(),dc_sweep_step:ge().refine((e)=>e!==0).optional(),dc_sweep_unit:lDe.optional(),ac_sweep_type:bt(["linear","decade","octave"]).optional(),ac_samples_per_interval:ge().int().positive().optional(),ac_sample_count:ge().int().positive().optional(),ac_start_frequency_hz:ge().positive().optional(),ac_stop_frequency_hz:ge().positive().optional()}).superRefine((e,t)=>{if(e.experiment_type==="spice_dc_sweep"){let n=["dc_sweep_start","dc_sweep_stop","dc_sweep_step","dc_sweep_unit"];for(let i of n)if(e[i]===void 0)t.addIssue({code:Gt.custom,path:[i],message:`${i} is required for a DC sweep`});let o=e.dc_sweep_voltage_source_id!==void 0,r=e.dc_sweep_current_source_id!==void 0;if(o===r)t.addIssue({code:Gt.custom,path:["dc_sweep_voltage_source_id"],message:"Exactly one DC sweep voltage or current source ID is required"})}if(e.experiment_type==="spice_ac_analysis"){if(e.ac_sweep_type===void 0)t.addIssue({code:Gt.custom,path:["ac_sweep_type"],message:"ac_sweep_type is required for an AC analysis"});if(e.ac_start_frequency_hz===void 0)t.addIssue({code:Gt.custom,path:["ac_start_frequency_hz"],message:"ac_start_frequency_hz is required for an AC analysis"});if(e.ac_stop_frequency_hz===void 0)t.addIssue({code:Gt.custom,path:["ac_stop_frequency_hz"],message:"ac_stop_frequency_hz is required for an AC analysis"});if(e.ac_sweep_type==="linear"&&e.ac_sample_count===void 0)t.addIssue({code:Gt.custom,path:["ac_sample_count"],message:"ac_sample_count is required for a linear AC analysis"});if((e.ac_sweep_type==="decade"||e.ac_sweep_type==="octave")&&e.ac_samples_per_interval===void 0)t.addIssue({code:Gt.custom,path:["ac_samples_per_interval"],message:"ac_samples_per_interval is required for decade and octave AC analyses"})}}).describe("Defines a simulation experiment configuration");$t(!0);var sD=Ee({simulation_parameter_sweep_id:k(),sweep_index:ge().int().nonnegative(),parameter_value:ge(),parameter_unit:hft});$t(!0);var QAo=Ee({type:ce("simulation_transient_voltage_graph"),simulation_transient_voltage_graph_id:Wn("simulation_transient_voltage_graph"),simulation_experiment_id:k(),simulation_parameter_sweep_coordinate:sD.optional(),timestamps_ms:st(ge()).optional(),voltage_levels:st(ge()),source_component_id:k().optional(),subcircuit_connectivity_map_key:k().optional(),time_per_step:jne,start_time_ms:dA,end_time_ms:dA,name:k().optional(),color:k().optional()}).describe("Stores voltage measurements over time for a simulation");$t(!0);var kAo=Ee({type:ce("simulation_transient_current_graph"),simulation_transient_current_graph_id:Wn("simulation_transient_current_graph"),simulation_experiment_id:k(),simulation_parameter_sweep_coordinate:sD.optional(),timestamps_ms:st(ge()).optional(),current_levels:st(ge()),source_component_id:k().optional(),subcircuit_connectivity_map_key:k().optional(),time_per_step:jne,start_time_ms:dA,end_time_ms:dA,name:k().optional(),color:k().optional()}).describe("Stores current measurements over time for a simulation");$t(!0);var LAo=Ee({type:ce("simulation_switch"),simulation_switch_id:Wn("simulation_switch"),source_component_id:k().optional(),closes_at:dA.optional(),opens_at:dA.optional(),starts_closed:Be().optional(),switching_frequency:HU.optional()}).describe("Defines a switch for simulation timing control");$t(!0);var HAo=Ee({type:ce("simulation_voltage_probe"),simulation_voltage_probe_id:Wn("simulation_voltage_probe"),source_component_id:k().optional(),name:k().optional(),signal_input_source_port_id:k().optional(),signal_input_source_net_id:k().optional(),reference_input_source_port_id:k().optional(),reference_input_source_net_id:k().optional(),subcircuit_id:k().optional(),color:k().optional()}).describe("Defines a voltage probe for simulation. If a reference input is not provided, it measures against ground. If a reference input is provided, it measures the differential voltage between two points.").superRefine((e,t)=>{if(e.reference_input_source_port_id||e.reference_input_source_net_id){let o=!!e.signal_input_source_port_id||!!e.reference_input_source_port_id,r=!!e.signal_input_source_net_id||!!e.reference_input_source_net_id;if(o&&r)t.addIssue({code:Gt.custom,message:"Cannot mix port and net connections in a differential probe."});else if(o){if(!e.signal_input_source_port_id||!e.reference_input_source_port_id)t.addIssue({code:Gt.custom,message:"Differential port probe requires both signal_input_source_port_id and reference_input_source_port_id."})}else if(r){if(!e.signal_input_source_net_id||!e.reference_input_source_net_id)t.addIssue({code:Gt.custom,message:"Differential net probe requires both signal_input_source_net_id and reference_input_source_net_id."})}}else if(!!e.signal_input_source_port_id===!!e.signal_input_source_net_id)t.addIssue({code:Gt.custom,message:"A voltage probe must have exactly one of signal_input_source_port_id or signal_input_source_net_id."})});$t(!0);var FAo=Ee({type:ce("simulation_current_probe"),simulation_current_probe_id:Wn("simulation_current_probe"),source_component_id:k().optional(),name:k().optional(),positive_source_port_id:k().optional(),negative_source_port_id:k().optional(),positive_source_net_id:k().optional(),negative_source_net_id:k().optional(),subcircuit_id:k().optional(),color:k().optional()}).describe("Defines a current probe for simulation. It measures current flowing from the positive endpoint to the negative endpoint.").superRefine((e,t)=>{let n=!!e.positive_source_port_id,o=!!e.negative_source_port_id,r=!!e.positive_source_net_id,i=!!e.negative_source_net_id,s=n||o,a=r||i;if(s&&a){t.addIssue({code:Gt.custom,message:"Cannot mix port and net connections in a current probe."});return}if(s){if(!n||!o)t.addIssue({code:Gt.custom,message:"Current probe using source ports requires both positive_source_port_id and negative_source_port_id."});return}if(a){if(!r||!i)t.addIssue({code:Gt.custom,message:"Current probe using source nets requires both positive_source_net_id and negative_source_net_id."});return}t.addIssue({code:Gt.custom,message:"A current probe must have either positive/negative source port ids or positive/negative source net ids."})});$t(!0);var zAo=Kl.extend({type:ce("simulation_unknown_experiment_error"),simulation_unknown_experiment_error_id:Wn("simulation_unknown_experiment_error"),error_type:ce("simulation_unknown_experiment_error").default("simulation_unknown_experiment_error"),simulation_experiment_id:k().optional(),subcircuit_id:k().optional()}).describe("An unknown error occurred during the simulation experiment.");$t(!0);var uls=bt(["resistance","capacitance","inductance","voltage","current"]),a_e=Ee({type:ce("simulation_parameter_sweep"),simulation_parameter_sweep_id:Wn("simulation_parameter_sweep"),simulation_experiment_id:k(),name:k().optional(),parameter_values:st(ge()).min(1),parameter_unit:hft}),OAo=ss("parameter_type",[a_e.extend({parameter_type:ce("resistance"),resistor_source_component_id:k()}),a_e.extend({parameter_type:ce("capacitance"),capacitor_source_component_id:k()}),a_e.extend({parameter_type:ce("inductance"),inductor_source_component_id:k()}),a_e.extend({parameter_type:ce("voltage"),source_net_id:k()}),a_e.extend({parameter_type:ce("current"),current_source_component_id:k()})]).describe("Repeats a simulation experiment over component parameter values");$t(!0);var VAo=Ee({type:ce("simulation_dc_operating_point_voltage"),simulation_dc_operating_point_voltage_id:Wn("simulation_dc_operating_point_voltage"),simulation_experiment_id:k(),simulation_parameter_sweep_coordinate:sD.optional(),simulation_voltage_probe_id:k(),voltage:ge(),name:k().optional(),color:k().optional()});$t(!0);var YAo=Ee({type:ce("simulation_dc_operating_point_current"),simulation_dc_operating_point_current_id:Wn("simulation_dc_operating_point_current"),simulation_experiment_id:k(),simulation_parameter_sweep_coordinate:sD.optional(),simulation_current_probe_id:k(),current:ge(),name:k().optional(),color:k().optional()});$t(!0);var GAo=Ee({type:ce("simulation_dc_sweep_voltage_graph"),simulation_dc_sweep_voltage_graph_id:Wn("simulation_dc_sweep_voltage_graph"),simulation_experiment_id:k(),simulation_parameter_sweep_coordinate:sD.optional(),simulation_voltage_probe_id:k(),sweep_values:st(ge()),sweep_unit:lDe,voltage_levels:st(ge()),name:k().optional(),color:k().optional()}).refine((e)=>e.sweep_values.length===e.voltage_levels.length,{message:"sweep_values and voltage_levels must have the same length"});$t(!0);var UAo=Ee({type:ce("simulation_dc_sweep_current_graph"),simulation_dc_sweep_current_graph_id:Wn("simulation_dc_sweep_current_graph"),simulation_experiment_id:k(),simulation_parameter_sweep_coordinate:sD.optional(),simulation_current_probe_id:k(),sweep_values:st(ge()),sweep_unit:lDe,current_levels:st(ge()),name:k().optional(),color:k().optional()}).refine((e)=>e.sweep_values.length===e.current_levels.length,{message:"sweep_values and current_levels must have the same length"});$t(!0);var dft=Ee({re:ge(),im:ge()});$t(!0);var WAo=Ee({type:ce("simulation_ac_sweep_voltage_graph"),simulation_ac_sweep_voltage_graph_id:Wn("simulation_ac_sweep_voltage_graph"),simulation_experiment_id:k(),simulation_parameter_sweep_coordinate:sD.optional(),simulation_voltage_probe_id:k(),frequencies_hz:st(ge()),complex_voltages:st(dft),name:k().optional(),color:k().optional()}).refine((e)=>e.frequencies_hz.length===e.complex_voltages.length,{message:"frequencies_hz and complex_voltages must have the same length"});$t(!0);var XAo=Ee({type:ce("simulation_ac_sweep_current_graph"),simulation_ac_sweep_current_graph_id:Wn("simulation_ac_sweep_current_graph"),simulation_experiment_id:k(),simulation_parameter_sweep_coordinate:sD.optional(),simulation_current_probe_id:k(),frequencies_hz:st(ge()),complex_currents:st(dft),name:k().optional(),color:k().optional()}).refine((e)=>e.frequencies_hz.length===e.complex_currents.length,{message:"frequencies_hz and complex_currents must have the same length"});$t(!0);var jAo=Ee({type:ce("simulation_op_amp"),simulation_op_amp_id:Wn("simulation_op_amp"),source_component_id:k().optional(),inverting_input_source_port_id:k(),non_inverting_input_source_port_id:k(),output_source_port_id:k(),positive_supply_source_port_id:k(),negative_supply_source_port_id:k()}).describe("Defines a simple ideal operational amplifier for simulation");$t(!0);var KAo=Ee({type:ce("simulation_spice_subcircuit"),simulation_spice_subcircuit_id:Wn("simulation_spice_subcircuit"),source_component_id:k(),spice_pin_to_source_port_map:Ss(k(),k()),subcircuit_source:k()}).describe("Defines a custom SPICE subcircuit model for simulation");$t(!0);var imo=(e)=>e!==void 0,$Ao=Ee({type:ce("simulation_oscilloscope_trace"),simulation_oscilloscope_trace_id:Wn("simulation_oscilloscope_trace"),simulation_transient_voltage_graph_id:k().optional(),simulation_transient_current_graph_id:k().optional(),simulation_voltage_probe_id:k().optional(),simulation_current_probe_id:k().optional(),display_name:k().optional(),color:k().optional(),display_center_value:ge().optional(),display_center_offset_divs:ge().optional(),volts_per_div:ge().positive().optional(),amps_per_div:ge().positive().optional()}).describe("Defines how a simulation measurement is rendered as an oscilloscope-style trace.").superRefine((e,t)=>{let n=[e.simulation_transient_voltage_graph_id,e.simulation_voltage_probe_id].filter(imo).length,o=[e.simulation_transient_current_graph_id,e.simulation_current_probe_id].filter(imo).length;if(n+o!==1)t.addIssue({code:Gt.custom,message:"An oscilloscope trace must reference exactly one voltage graph, current graph, voltage probe, or current probe."});if(n>0&&e.amps_per_div!==void 0)t.addIssue({code:Gt.custom,message:"Voltage oscilloscope traces must use volts_per_div, not amps_per_div."});if(o>0&&e.volts_per_div!==void 0)t.addIssue({code:Gt.custom,message:"Current oscilloscope traces must use amps_per_div, not volts_per_div."})});$t(!0);var qAo=an([Hmo,kmo,Lmo,Qmo,zmo,Fmo,FAt,kAt,iDe,HAt,LAt,zAt,OAt,VAt,UAt,WAt,XAt,JAt,jAt,KAt,$At,qAt,GAt,YAt,Ymo,Umo,Omo,ZAt,eft,tft,nft,Wmo,oft,rft,Xmo,jmo,Kmo,$mo,qmo,Jmo,ift,sft,Vmo,H_o,V_o,K_o,Kgo,$go,qgo,eAo,tAo,nAo,oAo,$_o,Ygo,q_o,mgo,tgo,sgo,ago,cgo,lgo,_go,Z_o,ego,ggo,Ago,Jgo,Cgo,bgo,Igo,vgo,Tgo,Sgo,Pgo,Ego,Mgo,Bgo,hgo,dgo,fgo,ygo,xgo,ugo,pgo,_Ao,gAo,AAo,fAo,Ngo,Dgo,Rgo,Qgo,kgo,Lgo,Hgo,Fgo,zgo,Zgo,Ogo,Vgo,rAo,jgo,iAo,sAo,aAo,dAo,uAo,pAo,mAo,yAo,xAo,CAo,bAo,IAo,Zmo,u_o,a_o,c_o,l_o,h_o,i_o,s_o,p_o,d_o,e_o,__o,g_o,m_o,x_o,C_o,b_o,I_o,v_o,S_o,P_o,E_o,T_o,M_o,w_o,SAo,MAo,TAo,RAo,QAo,kAo,VAo,YAo,GAo,UAo,WAo,XAo,OAo,LAo,HAo,FAo,$Ao,zAo,jAo,KAo]),Kne=qAo;$t(!0);FU(!0);var KUa=at(W0(),1);function Vt(e,t){return Array.isArray(t)?[e.a*t[0]+e.c*t[1]+e.e,e.b*t[0]+e.d*t[1]+e.f]:{x:e.a*t.x+e.c*t.y+e.e,y:e.b*t.x+e.d*t.y+e.f}}var pls=/^matrix\(\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*\)$/i;function hDe(e){let t=e.match(pls);if(t===null||t.length<7)throw Error(`'${e}' is not a matrix`);return{a:parseFloat(t[1]),b:parseFloat(t[2]),c:parseFloat(t[3]),d:parseFloat(t[4]),e:parseFloat(t[5]),f:parseFloat(t[6])}}function JAo(e){let{a:t,b:n,c:o,d:r,e:i,f:s}=e,a=t*r-n*o;return{a:r/a,b:n/-a,c:o/-a,d:t/a,e:(r*i-o*s)/-a,f:(n*i-t*s)/a}}function zU(e){return typeof e>"u"}function Wc(e,t=0){return{a:1,c:0,e,b:0,d:1,f:t}}function DH(...e){e=Array.isArray(e[0])?e[0]:e;let t=(n,o)=>({a:n.a*o.a+n.c*o.b,c:n.a*o.c+n.c*o.d,e:n.a*o.e+n.c*o.f+n.e,b:n.b*o.a+n.d*o.b,d:n.b*o.c+n.d*o.d,f:n.b*o.e+n.d*o.f+n.f});switch(e.length){case 0:throw Error("no matrices provided");case 1:return e[0];case 2:return t(e[0],e[1]);default:{let[n,o,...r]=e,i=t(n,o);return DH(i,...r)}}}function va(...e){return DH(...e)}var{cos:mls,sin:_ls,PI:DGa}=Math;function T2(e,t,n){let o=mls(e),r=_ls(e),i={a:o,c:-r,e:0,b:r,d:o,f:0};if(zU(t)||zU(n))return i;return DH([Wc(t,n),i,Wc(-t,-n)])}function kp(e,t=void 0,n=void 0,o=void 0){if(zU(t))t=e;let r={a:e,c:0,e:0,b:0,d:t,f:0};if(zU(n)||zU(o))return r;return DH([Wc(n,o),r,Wc(-n,-o)])}var{tan:FGa}=Math;function ZAo(e){return Pf(e)}function Pf(e){return`matrix(${e.a},${e.b},${e.c},${e.d},${e.e},${e.f})`}function efo(e,t=10000000000){return{a:Math.round(e.a*t)/t,b:Math.round(e.b*t)/t,c:Math.round(e.c*t)/t,d:Math.round(e.d*t)/t,e:Math.round(e.e*t)/t,f:Math.round(e.f*t)/t}}function tfo(e,t){let n=e[0].x!=null?e[0].x:e[0][0],o=e[0].y!=null?e[0].y:e[0][1],r=t[0].x!=null?t[0].x:t[0][0],i=t[0].y!=null?t[0].y:t[0][1],s=e[1].x!=null?e[1].x:e[1][0],a=e[1].y!=null?e[1].y:e[1][1],c=t[1].x!=null?t[1].x:t[1][0],l=t[1].y!=null?t[1].y:t[1][1],h=e[2].x!=null?e[2].x:e[2][0],d=e[2].y!=null?e[2].y:e[2][1],u=t[2].x!=null?t[2].x:t[2][0],_=t[2].y!=null?t[2].y:t[2][1],p={a:n-h,b:o-d,c:s-h,d:a-d,e:h,f:d},m={a:r-u,b:i-_,c:c-u,d:l-_,e:u,f:_},A=JAo(p),g=DH([m,A]);return efo(g)}function gls(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n}function dDe(e,t,n,o){var r=Error.call(this,e);if(Object.setPrototypeOf)Object.setPrototypeOf(r,dDe.prototype);return r.expected=t,r.found=n,r.location=o,r.name="SyntaxError",r}gls(dDe,Error);function uft(e,t,n){if(n=n||" ",e.length>t)return e;return t-=e.length,n+=n.repeat(t),e+n.slice(0,t)}dDe.prototype.format=function(e){var t="Error: "+this.message;if(this.location){var n=null,o;for(o=0;o<e.length;o++)if(e[o].source===this.location.source){n=e[o].text.split(/\r\n|\n|\r/g);break}var r=this.location.start,i=this.location.source&&typeof this.location.source.offset==="function"?this.location.source.offset(r):r,s=this.location.source+":"+i.line+":"+i.column;if(n){var a=this.location.end,c=uft("",i.line.toString().length," "),l=n[r.line-1],h=r.line===a.line?a.column:l.length+1,d=h-r.column||1;t+=`
 --> `+s+`
`+c+` |
`+i.line+" | "+l+`
`+c+" | "+uft("",r.column-1," ")+uft("",d,"^")}else t+=`
 at `+s}return t};dDe.buildMessage=function(e,t){var n={literal:function(l){return'"'+r(l.text)+'"'},class:function(l){var h=l.parts.map(function(d){return Array.isArray(d)?i(d[0])+"-"+i(d[1]):i(d)});return"["+(l.inverted?"^":"")+h.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(l){return l.description}};function o(l){return l.charCodeAt(0).toString(16).toUpperCase()}function r(l){return l.replace(/\\/g,"\\\\").replace(/"/g,"\\\"").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(h){return"\\x0"+o(h)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(h){return"\\x"+o(h)})}function i(l){return l.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(h){return"\\x0"+o(h)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(h){return"\\x"+o(h)})}function s(l){return n[l.type](l)}function a(l){var h=l.map(s),d,u;if(h.sort(),h.length>0){for(d=1,u=1;d<h.length;d++)if(h[d-1]!==h[d])h[u]=h[d],u++;h.length=u}switch(h.length){case 1:return h[0];case 2:return h[0]+" or "+h[1];default:return h.slice(0,-1).join(", ")+", or "+h[h.length-1]}}function c(l){return l?'"'+r(l)+'"':"end of input"}return"Expected "+a(e)+" but "+c(t)+" found."};var Xfo=at(j0(),1);H9();H9();yc();var WWa=at(W0(),1);Yfe();function nfo(e,t,n){if(!t||!n)return;let o=e.get(t);if(!o)o=new Set,e.set(t,o);o.add(n);let r=e.get(n);if(!r)r=new Set,e.set(n,r);r.add(t)}function Als(e,t){if(!t.subcircuit_id&&!t.source_group_id)return[...e];let n=t;if(t.subcircuit_id){let a=new Set([t.subcircuit_id]),c=new Map,l=new Map;for(let d of e)if(d.type==="source_group"){let{source_group_id:u,subcircuit_id:_}=d;if(_)l.set(u,_);let p=d.parent_source_group_id;if(p){if(!c.has(p))c.set(p,[]);c.get(p).push(u)}}let h;for(let[d,u]of l)if(u===t.subcircuit_id){h=d;break}if(h){let d=(u)=>{let _=c.get(u)||[];for(let p of _){let m=l.get(p);if(m)a.add(m);d(p)}};d(h),n={...t,subcircuit_ids:Array.from(a)}}}let o=new Map;for(let a of e){let c=`${a.type}_id`,l=a[c];if(typeof l==="string")o.set(l,a)}let r=new Map;for(let a of e){let c=Object.entries(a);for(let[l,h]of c){if(l==="parent_source_group_id")continue;if(l.endsWith("_id")&&typeof h==="string"){let d=o.get(h);nfo(r,a,d)}else if(l.endsWith("_ids")&&Array.isArray(h)){for(let d of h)if(typeof d==="string"){let u=o.get(d);nfo(r,a,u)}}}}let i=[],s=new Set;for(let a of e){let c=!1;if(n.subcircuit_id&&"subcircuit_id"in a&&a.subcircuit_id===n.subcircuit_id)c=!0;else if(n.subcircuit_ids&&"subcircuit_id"in a&&a.subcircuit_id&&n.subcircuit_ids.includes(a.subcircuit_id))c=!0;else if(n.source_group_id&&"source_group_id"in a&&a.source_group_id===n.source_group_id)c=!0;else if(n.source_group_id&&"member_source_group_ids"in a&&Array.isArray(a.member_source_group_ids)&&a.member_source_group_ids.includes(n.source_group_id))c=!0;if(c)i.push(a),s.add(a)}while(i.length>0){let a=i.shift(),c=r.get(a);if(!c)continue;for(let l of c)if(!s.has(l))s.add(l),i.push(l)}return e.filter((a)=>s.has(a))}var pDe=(e,t={})=>{let n=e,o=n._internal_store;if(!o){o={counts:{},editCount:0},n._internal_store=o;for(let i of n){let s=i.type,a=i[`${s}_id`];if(!a)continue;let c=Number.parseInt(a.split("_").pop());if(!Number.isNaN(c))o.counts[s]=Math.max(o.counts[s]??0,c)}}let r=new Proxy({},{get:(i,s)=>{if(s==="toArray")return()=>(n.editCount=o.editCount,n);if(s==="editCount")return o.editCount;if(s==="subtree")return(c)=>pDe(Als(n,c),t);if(s==="insert")return(c)=>{let l=c.type;if(!l)throw Error("insert requires an element with a type");o.counts[l]??=-1,o.counts[l]++;let h=o.counts[l],d={...c,type:l,[`${l}_id`]:`${l}_${h}`};if(t.validateInserts)($ne[l]??Kne).parse(d);return n.push(d),o.editCount++,d};if(s==="insertAll")return(c)=>c.map((l)=>r.insert(l));let a=s;return{get:(c)=>n.find((l)=>l.type===a&&l[`${a}_id`]===c),getUsing:(c)=>{let l=Object.keys(c);if(l.length!==1)throw Error("getUsing requires exactly one key, e.g. { pcb_component_id }");let h=l[0],d=h.replace("_id",""),u=n.find((_)=>_.type===d&&_[h]===c[h]);if(!u)return null;return n.find((_)=>_.type===a&&_[`${a}_id`]===u[`${a}_id`])},getWhere:(c)=>{let l=Object.keys(c);return n.find((h)=>h.type===a&&l.every((d)=>h[d]===c[d]))},list:(c)=>{let l=!c?[]:Object.keys(c);return n.filter((h)=>h.type===a&&l.every((d)=>h[d]===c[d]))},insert:(c)=>{o.counts[a]??=-1,o.counts[a]++;let l=o.counts[a],h={type:a,[`${a}_id`]:`${a}_${l}`,...c};if(t.validateInserts)($ne[a]??Kne).parse(h);return n.push(h),o.editCount++,h},delete:(c)=>{let l=n.find((h)=>h[`${a}_id`]===c);if(!l)return;n.splice(n.indexOf(l),1),o.editCount++},update:(c,l)=>{let h=n.find((d)=>d.type===a&&d[`${a}_id`]===c);if(!h)return null;return Object.assign(h,l),o.editCount++,h},select:(c)=>{if(a==="source_component")return n.find((l)=>l.type==="source_component"&&l.name===c.replace(/\./g,""));else if(a==="pcb_port"||a==="source_port"||a==="schematic_port"){let[l,h]=c.replace(/\./g,"").split(/[\s\>]+/),d=n.find((_)=>_.type==="source_component"&&_.name===l);if(!d)return null;let u=n.find((_)=>_.type==="source_port"&&_.source_component_id===d.source_component_id&&(_.name===h||(_.port_hints??[]).includes(h)));if(!u)return null;if(a==="source_port")return u;if(a==="pcb_port")return n.find((_)=>_.type==="pcb_port"&&_.source_port_id===u.source_port_id);else if(a==="schematic_port")return n.find((_)=>_.type==="schematic_port"&&_.source_port_id===u.source_port_id)}}}}});return r};pDe.unparsed=pDe;var ug=pDe;function pft(e){let t=e.type;return`${t}:${e[`${t}_id`]}`}var ofo=(e,t={})=>{let n=e._internal_store_indexed;if(!n){n={counts:{},editCount:0,indexes:{}};for(let s of e){let a=s.type,c=s[`${a}_id`];if(!c)continue;let l=Number.parseInt(c.split("_").pop()||"");if(!Number.isNaN(l))n.counts[a]=Math.max(n.counts[a]??0,l)}let r=t.indexConfig||{},i=n.indexes;if(r.byId)i.byId=new Map;if(r.byType)i.byType=new Map;if(r.byRelation)i.byRelation=new Map;if(r.bySubcircuit)i.bySubcircuit=new Map;if(r.byCustomField&&r.byCustomField.length>0){i.byCustomField=new Map;for(let s of r.byCustomField)i.byCustomField.set(s,new Map)}for(let s of e){if(r.byId){let a=pft(s);i.byId.set(a,s)}if(r.byType){let a=i.byType.get(s.type)||[];a.push(s),i.byType.set(s.type,a)}if(r.byRelation){let a=Object.entries(s);for(let[c,l]of a)if(c.endsWith("_id")&&c!==`${s.type}_id`&&typeof l==="string"){let h=i.byRelation.get(c)||new Map,d=h.get(l)||[];d.push(s),h.set(l,d),i.byRelation.set(c,h)}}if(r.bySubcircuit&&"subcircuit_id"in s){let a=s.subcircuit_id;if(a&&typeof a==="string"){let c=i.bySubcircuit.get(a)||[];c.push(s),i.bySubcircuit.set(a,c)}}if(r.byCustomField&&i.byCustomField){for(let a of r.byCustomField)if(a in s){let c=s[a];if(c!==void 0&&(typeof c==="string"||typeof c==="number")){let l=String(c),h=i.byCustomField.get(a),d=h.get(l)||[];d.push(s),h.set(l,d)}}}}e._internal_store_indexed=n}return new Proxy({},{get:(r,i)=>{if(i==="toArray")return()=>(e.editCount=n.editCount,e);if(i==="editCount")return n.editCount;let s=i;return{get:(a)=>{let c=t.indexConfig||{};if(c.byId&&n.indexes.byId)return n.indexes.byId.get(`${s}:${a}`)||null;if(c.byType&&n.indexes.byType)return(n.indexes.byType.get(s)||[]).find((h)=>h[`${s}_id`]===a)||null;return e.find((l)=>l.type===s&&l[`${s}_id`]===a)||null},getUsing:(a)=>{let c=t.indexConfig||{},l=Object.keys(a);if(l.length!==1)throw Error("getUsing requires exactly one key, e.g. { pcb_component_id }");let h=l[0],d=h.replace("_id","");if(c.byRelation&&n.indexes.byRelation){let _=n.indexes.byRelation.get(h);if(_){let m=(_.get(a[h])||[]).find((g)=>g.type===d);if(!m)return null;let A=m[`${s}_id`];if(c.byId&&n.indexes.byId)return n.indexes.byId.get(`${s}:${A}`)||null;if(c.byType&&n.indexes.byType)return(n.indexes.byType.get(s)||[]).find((f)=>f[`${s}_id`]===A)||null;return e.find((g)=>g.type===s&&g[`${s}_id`]===A)||null}}let u=e.find((_)=>_.type===d&&_[h]===a[h]);if(!u)return null;return e.find((_)=>_.type===s&&_[`${s}_id`]===u[`${s}_id`])||null},getWhere:(a)=>{let c=t.indexConfig||{},l=Object.keys(a);if(l.length===1&&c.byCustomField&&n.indexes.byCustomField){let h=l[0],d=n.indexes.byCustomField.get(h);if(d){let u=String(a[h]);return(d.get(u)||[]).find((p)=>p.type===s)||null}}if("subcircuit_id"in a&&c.bySubcircuit&&n.indexes.bySubcircuit){let h=a.subcircuit_id;return(n.indexes.bySubcircuit.get(h)||[]).find((u)=>u.type===s&&l.every((_)=>u[_]===a[_]))||null}if(c.byType&&n.indexes.byType)return(n.indexes.byType.get(s)||[]).find((d)=>l.every((u)=>d[u]===a[u]))||null;return e.find((h)=>h.type===s&&l.every((d)=>h[d]===a[d]))||null},list:(a)=>{let c=t.indexConfig||{},l=!a?[]:Object.keys(a);if(l.length===0&&c.byType&&n.indexes.byType)return n.indexes.byType.get(s)||[];if(l.length===1&&l[0]==="subcircuit_id"&&c.bySubcircuit&&n.indexes.bySubcircuit){let d=a.subcircuit_id;return(n.indexes.bySubcircuit.get(d)||[]).filter((_)=>_.type===s)}let h;if(c.byType&&n.indexes.byType)h=n.indexes.byType.get(s)||[];else h=e.filter((d)=>d.type===s);if(l.length>0)return h.filter((d)=>l.every((u)=>d[u]===a[u]));return h},insert:(a)=>{n.counts[s]??=-1,n.counts[s]++;let c=n.counts[s],l={type:s,[`${s}_id`]:`${s}_${c}`,...a};if(t.validateInserts)($ne[s]??Kne).parse(l);e.push(l),n.editCount++;let h=t.indexConfig||{};if(h.byId&&n.indexes.byId){let d=pft(l);n.indexes.byId.set(d,l)}if(h.byType&&n.indexes.byType){let d=n.indexes.byType.get(s)||[];d.push(l),n.indexes.byType.set(s,d)}if(h.byRelation&&n.indexes.byRelation){let d=Object.entries(l);for(let[u,_]of d)if(u.endsWith("_id")&&u!==`${l.type}_id`&&typeof _==="string"){let p=n.indexes.byRelation.get(u)||new Map,m=p.get(_)||[];m.push(l),p.set(_,m),n.indexes.byRelation.set(u,p)}}if(h.bySubcircuit&&n.indexes.bySubcircuit&&"subcircuit_id"in l){let d=l.subcircuit_id;if(d&&typeof d==="string"){let u=n.indexes.bySubcircuit.get(d)||[];u.push(l),n.indexes.bySubcircuit.set(d,u)}}if(h.byCustomField&&n.indexes.byCustomField){for(let d of h.byCustomField)if(d in l){let u=l[d];if(u!==void 0&&(typeof u==="string"||typeof u==="number")){let _=String(u),p=n.indexes.byCustomField.get(d),m=p.get(_)||[];m.push(l),p.set(_,m)}}}return l},delete:(a)=>{let c=t.indexConfig||{},l;if(c.byId&&n.indexes.byId)l=n.indexes.byId.get(`${s}:${a}`);else if(c.byType&&n.indexes.byType)l=(n.indexes.byType.get(s)||[]).find((u)=>u[`${s}_id`]===a);else l=e.find((d)=>d[`${s}_id`]===a);if(!l)return;let h=e.indexOf(l);if(h>=0)e.splice(h,1),n.editCount++;if(c.byId&&n.indexes.byId){let d=pft(l);n.indexes.byId.delete(d)}if(c.byType&&n.indexes.byType){let u=(n.indexes.byType.get(s)||[]).filter((_)=>_[`${s}_id`]!==a);n.indexes.byType.set(s,u)}if(c.byRelation&&n.indexes.byRelation)for(let[d,u]of n.indexes.byRelation.entries())for(let[_,p]of u.entries()){let m=p.filter((A)=>A!==l);if(m.length===0)u.delete(_);else u.set(_,m)}if(c.bySubcircuit&&n.indexes.bySubcircuit&&"subcircuit_id"in l){let d=l.subcircuit_id;if(d){let _=(n.indexes.bySubcircuit.get(d)||[]).filter((p)=>p!==l);if(_.length===0)n.indexes.bySubcircuit.delete(d);else n.indexes.bySubcircuit.set(d,_)}}if(c.byCustomField&&n.indexes.byCustomField)for(let d of n.indexes.byCustomField.values())for(let[u,_]of d.entries()){let p=_.filter((m)=>m!==l);if(p.length===0)d.delete(u);else d.set(u,p)}},update:(a,c)=>{let l=t.indexConfig||{},h;if(l.byId&&n.indexes.byId)h=n.indexes.byId.get(`${s}:${a}`);else if(l.byType&&n.indexes.byType)h=(n.indexes.byType.get(s)||[]).find((u)=>u[`${s}_id`]===a);else h=e.find((d)=>d.type===s&&d[`${s}_id`]===a);if(!h)return null;if(l.byRelation&&n.indexes.byRelation){let d=Object.entries(h);for(let[u,_]of d)if(u.endsWith("_id")&&u!==`${h.type}_id`&&typeof _==="string"){if(u in c&&c[u]!==_){let p=n.indexes.byRelation.get(u);if(p){let A=(p.get(_)||[]).filter((g)=>g!==h);if(A.length===0)p.delete(_);else p.set(_,A)}}}}if(l.bySubcircuit&&n.indexes.bySubcircuit&&"subcircuit_id"in h&&"subcircuit_id"in c){let d=h.subcircuit_id,u=c.subcircuit_id;if(d!==u){let p=(n.indexes.bySubcircuit.get(d)||[]).filter((m)=>m!==h);if(p.length===0)n.indexes.bySubcircuit.delete(d);else n.indexes.bySubcircuit.set(d,p)}}if(l.byCustomField&&n.indexes.byCustomField){for(let d of l.byCustomField)if(d in h&&d in c&&h[d]!==c[d]){let u=n.indexes.byCustomField.get(d);if(u){let _=String(h[d]),m=(u.get(_)||[]).filter((A)=>A!==h);if(m.length===0)u.delete(_);else u.set(_,m)}}}if(Object.assign(h,c),n.editCount++,l.byRelation&&n.indexes.byRelation){let d=Object.entries(h);for(let[u,_]of d)if(u.endsWith("_id")&&u!==`${h.type}_id`&&typeof _==="string"){if(u in c){let p=n.indexes.byRelation.get(u)||new Map,m=p.get(_)||[];if(!m.includes(h))m.push(h),p.set(_,m),n.indexes.byRelation.set(u,p)}}}if(l.bySubcircuit&&n.indexes.bySubcircuit&&"subcircuit_id"in h&&"subcircuit_id"in c){let d=h.subcircuit_id;if(d&&typeof d==="string"){let u=n.indexes.bySubcircuit.get(d)||[];if(!u.includes(h))u.push(h),n.indexes.bySubcircuit.set(d,u)}}if(l.byCustomField&&n.indexes.byCustomField){for(let d of l.byCustomField)if(d in h&&d in c){let u=h[d];if(u!==void 0&&(typeof u==="string"||typeof u==="number")){let _=String(u),p=n.indexes.byCustomField.get(d),m=p.get(_)||[];if(!m.includes(h))m.push(h),p.set(_,m)}}}return h},select:(a)=>{if(s==="source_component")return e.find((c)=>c.type==="source_component"&&c.name===a.replace(/\./g,""))||null;else if(s==="pcb_port"||s==="source_port"||s==="schematic_port"){let[c,l]=a.replace(/\./g,"").split(/[\s\>]+/),h=e.find((u)=>u.type==="source_component"&&u.name===c);if(!h)return null;let d=e.find((u)=>u.type==="source_port"&&u.source_component_id===h.source_component_id&&(u.name===l||(u.port_hints??[]).includes(l)));if(!d)return null;if(s==="source_port")return d;if(s==="pcb_port")return e.find((u)=>u.type==="pcb_port"&&u.source_port_id===d.source_port_id)||null;else if(s==="schematic_port")return e.find((u)=>u.type==="schematic_port"&&u.source_port_id===d.source_port_id)||null}return null}}}})};ofo.unparsed=ofo;var rfo=(e,t)=>({minX:Math.min(e.minX,t.minX),minY:Math.min(e.minY,t.minY),maxX:Math.max(e.maxX,t.maxX),maxY:Math.max(e.maxY,t.maxY)}),h_e=(e,t,n)=>{let o=n/2;return{minX:e-o,minY:t-o,maxX:e+o,maxY:t+o}},ifo=(e,t,n,o,r)=>{let i=n/2,s=o/2,a=r*Math.PI/180,c=Math.cos(a),l=Math.sin(a),h=[{x:-i,y:-s},{x:i,y:-s},{x:i,y:s},{x:-i,y:s}].map((d)=>({x:e+d.x*c-d.y*l,y:t+d.x*l+d.y*c}));return{minX:Math.min(...h.map((d)=>d.x)),minY:Math.min(...h.map((d)=>d.y)),maxX:Math.max(...h.map((d)=>d.x)),maxY:Math.max(...h.map((d)=>d.y))}},fls=(e,t,n,o,r)=>{let i=n/2,s=o/2,a=r*Math.PI/180,c=Math.cos(a),l=Math.sin(a),h=Math.hypot(i*c,s*l),d=Math.hypot(i*l,s*c);return{minX:e-h,minY:t-d,maxX:e+h,maxY:t+d}},yls=(e,t,n,o,r)=>{let i=Math.min(n,o)/2,s=Math.max(n,o)/2-i,a=r*Math.PI/180,c=n>=o?{x:s,y:0}:{x:0,y:s},l={x:c.x*Math.cos(a)-c.y*Math.sin(a),y:c.x*Math.sin(a)+c.y*Math.cos(a)},h=Math.abs(l.x)+i,d=Math.abs(l.y)+i;return{minX:e-h,minY:t-d,maxX:e+h,maxY:t+d}},uDe=(e)=>{if(e.length===0)return null;return{minX:Math.min(...e.map((t)=>t.x)),minY:Math.min(...e.map((t)=>t.y)),maxX:Math.max(...e.map((t)=>t.x)),maxY:Math.max(...e.map((t)=>t.y))}},mft=(e)=>{if(!Array.isArray(e))return[];return e.flatMap((t)=>{if(!t||typeof t!=="object")return[];if("x"in t&&"y"in t&&typeof t.x==="number"&&typeof t.y==="number")return[{x:t.x,y:t.y}];if("start"in t&&"end"in t)return[t.start,t.end].filter((o)=>Boolean(o&&typeof o==="object"&&"x"in o&&"y"in o&&typeof o.x==="number"&&typeof o.y==="number"));return[]})},_ft=(e)=>{if(!e.type.startsWith("pcb_"))return null;if(e.type==="pcb_smtpad"&&e.shape==="polygon"&&Array.isArray(e.points))return uDe(e.points);if(e.type==="pcb_hole"&&e.hole_shape==="circle")return h_e(e.x,e.y,e.hole_diameter);if(e.type==="pcb_plated_hole"){let d;if("outer_diameter"in e&&typeof e.outer_diameter==="number")d=h_e(e.x,e.y,e.outer_diameter);else if("hole_diameter"in e&&typeof e.hole_diameter==="number")d=h_e(e.x,e.y,e.hole_diameter);if((e.shape==="oval"||e.shape==="pill")&&typeof e.outer_width==="number"&&typeof e.outer_height==="number")d=(e.shape==="pill"?yls:fls)(e.x,e.y,e.outer_width,e.outer_height,e.ccw_rotation??0);if("rect_pad_width"in e&&typeof e.rect_pad_width==="number"&&"rect_pad_height"in e&&typeof e.rect_pad_height==="number"){let u=ifo(e.x,e.y,e.rect_pad_width,e.rect_pad_height,"rect_ccw_rotation"in e?e.rect_ccw_rotation??0:0);d=d?rfo(d,u):u}if("hole_diameter"in e&&typeof e.hole_diameter==="number"){let u=h_e(e.x+("hole_offset_x"in e?e.hole_offset_x??0:0),e.y+("hole_offset_y"in e?e.hole_offset_y??0:0),e.hole_diameter);d=d?rfo(d,u):u}if(d)return d}let t=e,n=uDe(mft(t.route));if(n)return n;let o=uDe(mft(t.outline));if(o)return o;let r=uDe(mft(t.points));if(r)return r;let i,s,a,c;if("x"in e&&"y"in e)i=Number(e.x),s=Number(e.y);if("outer_diameter"in e)a=Number(e.outer_diameter),c=Number(e.outer_diameter);if("width"in e)a=Number(e.width);if("height"in e)c=Number(e.height);if("center"in e&&e.center&&typeof e.center==="object"&&"x"in e.center&&"y"in e.center)i=Number(e.center.x),s=Number(e.center.y);let l=0;if("rotation"in e&&typeof e.rotation==="number")l=e.rotation;if("ccw_rotation"in e&&typeof e.ccw_rotation==="number")l=e.ccw_rotation;if(i!==void 0&&s!==void 0){if(a!==void 0&&c!==void 0)return l?ifo(i,s,a,c,l):{minX:i-a/2,minY:s-c/2,maxX:i+a/2,maxY:s+c/2};if("radius"in e&&typeof e.radius==="number")return h_e(i,s,e.radius*2);return{minX:i,minY:s,maxX:i,maxY:s}}let h=[t.anchor_position,t.position].filter((d)=>Boolean(d&&typeof d==="object"&&"x"in d&&"y"in d&&typeof d.x==="number"&&typeof d.y==="number")).at(0);return h?{minX:h.x,minY:h.y,maxX:h.x,maxY:h.y}:null};var sfo=(e,t)=>e.filter((n)=>{let o=_ft(n);if(!o)return!1;return o.minX<=t.maxX&&o.maxX>=t.minX&&o.minY<=t.maxY&&o.maxY>=t.minY});var xls={leftside_top:{side:"leftside",alignment:"top"},leftside_bottom:{side:"leftside",alignment:"bottom"},rightside_top:{side:"rightside",alignment:"top"},rightside_bottom:{side:"rightside",alignment:"bottom"},topside_left:{side:"topside",alignment:"left"},topside_right:{side:"topside",alignment:"right"},bottomside_left:{side:"bottomside",alignment:"left"},bottomside_right:{side:"bottomside",alignment:"right"}},UUa=Object.keys(xls);yc();var tXa=at(W0(),1);var lXa=at(W0(),1);var fXa=at(W0(),1);rae();K0();K0();K0();K0();var eja=at(W0(),1);K0();var rja=at(W0(),1);var a0s=at(W0(),1);var c0s=at(W0(),1);var Ija=at(W0(),1);var Cls=new Set(["pcb_trace","pcb_smtpad","pcb_via","pcb_plated_hole","pcb_copper_pour","pcb_copper_text"]),d_e=(e,t)=>({name:"g",type:"element",value:"",attributes:e,children:t});function SDe(e,t){return e.flatMap((n)=>{if(n.children.length){let r=SDe(n.children,t);return r.length?[{...n,children:r}]:[]}return n.attributes["data-pcb-layer"]==="drill"===t?[n]:[]})}function Gfo(e){let t={...e.attributes};for(let n of["opacity","fill-opacity","stroke-opacity"])if(n in t)t[n]="1";return{...e,attributes:t,children:e.children.map(Gfo)}}function Pft(e){return{...e,attributes:{...e.attributes,...e.attributes.fill&&e.attributes.fill!=="none"?{fill:"black"}:{},...e.attributes.stroke&&e.attributes.stroke!=="none"?{stroke:"black"}:{}},children:e.children.map(Pft)}}function bls({circuitJson:e,ctx:t,selectedIds:n,hiddenOpacity:o,width:r,height:i,create:s}){let a=new Set(n),c=(f)=>f[`${f.type}_id`],l=new Set(["top","bottom"]);for(let f of e){if(f.type==="pcb_board")for(let y=1;y<=(f.num_layers??2)-2;y++)l.add(`inner${y}`);if("layer"in f&&typeof f.layer==="string"&&/^(top|bottom|inner\d+)$/.test(f.layer))l.add(f.layer);if("layers"in f&&Array.isArray(f.layers)){for(let y of f.layers)if(/^(top|bottom|inner\d+)$/.test(y))l.add(y)}if(f.type==="pcb_trace"){for(let y of f.route)if(y.route_type==="wire")l.add(y.layer)}}let h=t.layer??"top",d=(f)=>f===h?100:f==="bottom"?0:f==="top"?50:40-Number(f.slice(5)),u=[...l].sort((f,y)=>d(f)-d(y)),_={...t,showSolderMask:!1,showSolderPaste:!1,showPinNumbers:!1,showAnchorOffsets:!1,circuitJson:e.filter((f)=>f.type!=="pcb_copper_pour")},p=[],m=[],A=[],g=[];for(let f of u){let y={..._,layer:f,colorMap:{...t.colorMap,copper:{...t.colorMap.copper,top:t.colorMap.copper[f]}}},x=[],C=[],b=[];for(let P of e){if(P.type==="pcb_hole"||P.type==="pcb_cutout"){b.push(...s(P,y).map(Pft));continue}if(!Cls.has(P.type))continue;if("layer"in P&&P.layer!==f)continue;if((P.type==="pcb_via"||P.type==="pcb_plated_hole")&&!P.layers.includes(f))continue;let M=P.type==="pcb_plated_hole"?{...P,layers:[f]}:P,B=M.type==="pcb_trace"?{...M,route:M.route.map((D)=>{let{is_inside_copper_pour:L,copper_pour_id:H,...V}=D;return V})}:M,T=s(B,y).map(Gfo),N=SDe(T,!0);if(b.push(...N.map(Pft)),x.push(...SDe(T,!1)),a.has(c(P))){if(C.push(...SDe(T,!1)),f===u.filter((D)=>!("layers"in P)||!Array.isArray(P.layers)||P.layers.includes(D)).at(-1))A.push(...N)}}let I=`xray-holes-${f}`;g.push({name:"mask",type:"element",value:"",attributes:{id:I,maskUnits:"userSpaceOnUse",x:"0",y:"0",width:String(r),height:String(i)},children:[{name:"rect",type:"element",value:"",children:[],attributes:{x:"0",y:"0",width:String(r),height:String(i),fill:"white"}},...b]});let v={"data-pcb-layer":f,mask:`url(#${I})`};p.push(d_e({...v,opacity:String(o)},x)),m.push(d_e(v,C))}return[{name:"defs",type:"element",value:"",attributes:{},children:g},d_e({"data-x-ray":"background"},p),d_e({"data-x-ray":"selected"},m),d_e({"data-x-ray":"drills"},A)]}var C_e="TscircuitAlphabet",afo="data-tscircuit-alphabet-font";function Wfo(e){let t=(o)=>({...o,children:(o.children??[]).filter((r)=>!(afo in(r.attributes??{}))).map(t)}),n=t(e);return n.children.push({name:"style",type:"element",value:"",attributes:{[afo]:"",type:"text/css"},children:[{name:"",type:"text",value:`@font-face { font-family: '${C_e}'; src: url('data:font/ttf;base64,${SIe}') format('truetype'); font-weight: normal; font-style: normal; }`,attributes:{},children:[]}]}),Ufo.stringify(n)}function Ils(e,t,n){let{transform:o,shouldDrawErrors:r}=n;if(!r)return[];let{pcb_port_ids:i}=e,s=t.find((u)=>u.type==="pcb_port"&&u.pcb_port_id===i?.[0]),a=t.find((u)=>u.type==="pcb_port"&&u.pcb_port_id===i?.[1]);if(!s||!a){let _=e.message?.match(/pcb_via\[#?(pcb_via_\d+)\]/)?.[1],p=t.find((m)=>m.type==="pcb_via"&&m.pcb_via_id===_);if(p&&p.type==="pcb_via")return vls(e,p,n);if(e.center){let m=Vt(o,{x:e.center.x,y:e.center.y});return Eft([{name:"rect",type:"element",attributes:{x:(m.x-5).toString(),y:(m.y-5).toString(),width:"10",height:"10",fill:"red",transform:`rotate(45 ${m.x} ${m.y})`},children:[],value:""},{name:"text",type:"element",attributes:{x:m.x.toString(),y:(m.y-15).toString(),fill:"red","font-family":"sans-serif","font-size":"12","text-anchor":"middle"},children:[{type:"text",value:e.message||"Pcb Trace Error",name:"",attributes:{},children:[]}],value:""}])}else return[]}let c=Vt(o,{x:s.x,y:s.y}),l=Vt(o,{x:a.x,y:a.y}),h={x:(c.x+l.x)/2,y:(c.y+l.y)/2};if(isNaN(c.x)||isNaN(c.y)||isNaN(l.x)||isNaN(l.y)||isNaN(h.x)||isNaN(h.y))return[];let d=[{name:"line",type:"element",attributes:{x1:c.x.toString(),y1:c.y.toString(),x2:h.x.toString(),y2:h.y.toString(),stroke:"red","stroke-width":"1.5","stroke-dasharray":"2,2"},children:[],value:""},{name:"line",type:"element",attributes:{x1:h.x.toString(),y1:h.y.toString(),x2:l.x.toString(),y2:l.y.toString(),stroke:"red","stroke-width":"1.5","stroke-dasharray":"2,2"},children:[],value:""},{name:"rect",type:"element",attributes:{x:(h.x-5).toString(),y:(h.y-5).toString(),width:"10",height:"10",fill:"red",transform:`rotate(45 ${h.x} ${h.y})`},children:[],value:""},{name:"text",type:"element",attributes:{x:h.x.toString(),y:(h.y-15).toString(),fill:"red","font-family":"sans-serif","font-size":"12","text-anchor":"middle"},children:[{type:"text",value:e.message||"Pcb Trace Error",name:"",attributes:{},children:[]}],value:""}];return Eft(d)}function vls(e,t,n){let{transform:o}=n;if(e.center&&t){let r=Vt(o,{x:e.center.x,y:e.center.y}),i=Vt(o,{x:t.x,y:t.y}),s=i.x-r.x,a=i.y-r.y,c=Math.sqrt(s*s+a*a),l=Math.atan2(a,s)*180/Math.PI,h=10,d=c+20,u=20,_=(r.x+i.x)/2,p=(r.y+i.y)/2;return Eft([{name:"rect",type:"element",attributes:{x:(_-d/2).toString(),y:(p-10).toString(),width:d.toString(),height:20 .toString(),fill:"none",stroke:"red","stroke-width":"1","stroke-dasharray":"3,2",transform:`rotate(${l} ${_} ${p})`},children:[],value:""},{name:"rect",type:"element",attributes:{x:(_-5).toString(),y:(p-5).toString(),width:"10",height:"10",fill:"red",transform:`rotate(45 ${_} ${p})`},children:[],value:""},{name:"text",type:"element",attributes:{x:_.toString(),y:(p-10-5).toString(),fill:"red","font-family":"sans-serif","font-size":"12","text-anchor":"middle"},children:[{type:"text",value:e.message||"Pcb Trace Error",name:"",attributes:{},children:[]}],value:""}])}return[]}function Eft(e){return e.map((t)=>({...t,attributes:{...t.attributes??{},"data-type":t.attributes?.["data-type"]??"pcb_trace_error","data-pcb-layer":t.attributes?.["data-pcb-layer"]??"overlay"},children:(t.children??[]).map((n)=>{if(n?.type==="element")return{...n,attributes:{...n.attributes??{},"data-type":n.attributes?.["data-type"]??"pcb_trace_error","data-pcb-layer":n.attributes?.["data-pcb-layer"]??"overlay"}};return n})}))}function Sls(e){return e.map((t)=>({...t,attributes:{...t.attributes??{},"data-type":t.attributes?.["data-type"]??"pcb_footprint_overlap_error","data-pcb-layer":t.attributes?.["data-pcb-layer"]??"overlay"},children:(t.children??[]).map((n)=>{if(n?.type==="element")return{...n,attributes:{...n.attributes??{},"data-type":n.attributes?.["data-type"]??"pcb_footprint_overlap_error","data-pcb-layer":n.attributes?.["data-pcb-layer"]??"overlay"}};return n})}))}function Pls(e,t,n){let{transform:o,shouldDrawErrors:r}=n;if(!r)return[];let i=[],s=[],a=[];if(e.pcb_smtpad_ids)for(let h of e.pcb_smtpad_ids){let d=t.find((u)=>u.type==="pcb_smtpad"&&u.pcb_smtpad_id===h);if(d){if(s.push({x:d.x,y:d.y,type:"pcb_smtpad",id:h,pcb_port_id:d.pcb_port_id}),d.pcb_port_id)a.push(d.pcb_port_id)}}let c=a.length>1&&a.every((h)=>h===a[0]),l=s;if(c)l=s.filter((h)=>h.type!=="pcb_smtpad");if(e.pcb_plated_hole_ids)for(let h of e.pcb_plated_hole_ids){let d=t.find((u)=>u.type==="pcb_plated_hole"&&u.pcb_plated_hole_id===h);if(d)l.push({x:d.x,y:d.y,type:"pcb_plated_hole",id:h})}if(e.pcb_hole_ids)for(let h of e.pcb_hole_ids){let d=t.find((u)=>u.type==="pcb_hole"&&u.pcb_hole_id===h);if(d)l.push({x:d.x,y:d.y,type:"pcb_hole",id:h})}if(l.length>0){let h=l.reduce((_,p)=>_+p.x,0)/l.length,d=l.reduce((_,p)=>_+p.y,0)/l.length,u=Vt(o,{x:h,y:d});i.push({name:"rect",type:"element",attributes:{x:(u.x-5).toString(),y:(u.y-5).toString(),width:"10",height:"10",fill:"red",transform:`rotate(45 ${u.x} ${u.y})`},children:[],value:""}),i.push({name:"text",type:"element",attributes:{x:u.x.toString(),y:(u.y-15).toString(),fill:"red","font-family":"sans-serif","font-size":"12","text-anchor":"middle"},children:[{type:"text",value:e.message||"PCB Footprint Overlap Error",name:"",attributes:{},children:[]}],value:""});for(let _ of l){let p=Vt(o,{x:_.x,y:_.y});if(i.push({name:"rect",type:"element",attributes:{x:(p.x-5).toString(),y:(p.y-5).toString(),width:"10",height:"10",fill:"red",transform:`rotate(45 ${p.x} ${p.y})`},children:[],value:""}),l.length>1)i.push({name:"line",type:"element",attributes:{x1:u.x.toString(),y1:u.y.toString(),x2:p.x.toString(),y2:p.y.toString(),stroke:"red","stroke-width":"1.5","stroke-dasharray":"2,2"},children:[],value:""})}}return Sls(i)}function Els(e,t,n){let{transform:o,shouldDrawErrors:r}=n;if(!r)return[];let i=[],s=[];for(let h of e.pcb_component_ids){let d=t.find((u)=>u.type==="pcb_component"&&u.pcb_component_id===h);if(d)s.push(d.center)}if(s.length===0)return[];let a=s.reduce((h,d)=>h+d.x,0)/s.length,c=s.reduce((h,d)=>h+d.y,0)/s.length,l=Vt(o,{x:a,y:c});i.push({name:"rect",type:"element",attributes:{x:(l.x-5).toString(),y:(l.y-5).toString(),width:"10",height:"10",fill:"red",transform:`rotate(45 ${l.x} ${l.y})`,"data-type":"pcb_courtyard_overlap_error","data-pcb-layer":"overlay"},children:[],value:""}),i.push({name:"text",type:"element",attributes:{x:l.x.toString(),y:(l.y-15).toString(),fill:"red","font-family":"sans-serif","font-size":"12","text-anchor":"middle","data-type":"pcb_courtyard_overlap_error","data-pcb-layer":"overlay"},children:[{type:"text",value:e.message||"PCB Courtyard Overlap",name:"",attributes:{},children:[]}],value:""});for(let h of s){let d=Vt(o,h);i.push({name:"rect",type:"element",attributes:{x:(d.x-5).toString(),y:(d.y-5).toString(),width:"10",height:"10",fill:"red",transform:`rotate(45 ${d.x} ${d.y})`,"data-type":"pcb_courtyard_overlap_error","data-pcb-layer":"overlay"},children:[],value:""})}if(s.length===2){let h=s.map((_)=>Vt(o,_)),d=h[0],u=h[1];i.push({name:"line",type:"element",attributes:{x1:d.x.toString(),y1:d.y.toString(),x2:u.x.toString(),y2:u.y.toString(),stroke:"red","stroke-width":"1.5","stroke-dasharray":"4,3","data-type":"pcb_courtyard_overlap_error","data-pcb-layer":"overlay"},children:[],value:""})}return i}function Mls(e){return e.map((t)=>({...t,attributes:{...t.attributes??{},"data-type":t.attributes?.["data-type"]??"pcb_component_outside_board_error","data-pcb-layer":t.attributes?.["data-pcb-layer"]??"overlay"}}))}function wls(e,t){let n=e.pcb_component_id;if(!n)return e.component_bounds??null;let o=t.find((r)=>r.type==="pcb_component"&&r.pcb_component_id===n);if(o?.center&&o?.width&&o?.height)return{min_x:o.center.x-o.width/2,max_x:o.center.x+o.width/2,min_y:o.center.y-o.height/2,max_y:o.center.y+o.height/2};return e.component_bounds??null}function Bls(e,t,n){let{shouldDrawErrors:o,transform:r}=n;if(!o)return[];let i=wls(e,t);if(!i)return[];let s=Vt(r,{x:i.min_x,y:i.min_y}),a=Vt(r,{x:i.max_x,y:i.max_y}),c=Math.min(s.x,a.x),l=Math.min(s.y,a.y),h=Math.abs(a.x-s.x),d=Math.abs(a.y-s.y),u=c+h/2,_=l+d/2,p=[{type:"element",name:"rect",value:"",attributes:{x:c.toString(),y:l.toString(),width:h.toString(),height:d.toString(),fill:"none",stroke:"red","stroke-width":"1.5","stroke-dasharray":"4,2"},children:[]},{type:"element",name:"rect",value:"",attributes:{x:(u-5).toString(),y:(_-5).toString(),width:"10",height:"10",fill:"red",transform:`rotate(45 ${u} ${_})`},children:[]},{type:"element",name:"text",value:"",attributes:{x:u.toString(),y:(l-10).toString(),fill:"red","font-family":"sans-serif","font-size":"12","text-anchor":"middle"},children:[{type:"text",name:"",value:e.message??"PCB component extends outside board boundaries",attributes:{},children:[]}]}];return Mls(p)}function A_e(e){return e!==void 0&&typeof e.x==="number"&&Number.isFinite(e.x)&&typeof e.y==="number"&&Number.isFinite(e.y)}function Tls(e,t){if(e.type==="pcb_via_trace_clearance_error")return t.find((n)=>n.type==="pcb_via"&&n.pcb_via_id===e.pcb_via_id);return t.find((n)=>n.type==="pcb_smtpad"&&n.pcb_smtpad_id===e.pcb_pad_id||n.type==="pcb_plated_hole"&&n.pcb_plated_hole_id===e.pcb_pad_id)}function Dls(e){if(!e)return;if("x"in e&&"y"in e&&A_e(e))return{x:e.x,y:e.y};if(e.type==="pcb_smtpad"&&e.shape==="polygon"&&e.points.length>0){let t=e.points.filter(A_e);if(t.length===0)return;let n=t.map((r)=>r.x),o=t.map((r)=>r.y);return{x:(Math.min(...n)+Math.max(...n))/2,y:(Math.min(...o)+Math.max(...o))/2}}return}function Nls(e){if(e.route_type==="through_pad")return[e.start,e.end].filter(A_e);return A_e(e)?[{x:e.x,y:e.y}]:[]}function Rls(e){if(!e)return;let t,n;for(let o of e.route){let r=Nls(o);if(!t&&r[0])t=r[0];if(r.length>0)n=r[r.length-1]}return t&&n?{start:t,end:n}:void 0}function Qls(e,t){return{x:(e.x+t.x)/2,y:(e.y+t.y)/2}}function gft(e,t,n){let o=e.x-t.x,r=e.y-t.y;if(o*o+r*r<0.25)return;return{type:"element",name:"line",value:"",attributes:{x1:e.x.toString(),y1:e.y.toString(),x2:t.x.toString(),y2:t.y.toString(),stroke:"red","stroke-width":"1.5","stroke-dasharray":"2,2","data-error-reference":n},children:[]}}function kls(e,t){return e.map((n)=>({...n,attributes:{...n.attributes??{},"data-type":n.attributes?.["data-type"]??t,"data-pcb-layer":n.attributes?.["data-pcb-layer"]??"overlay"}}))}function Lls(e,t,n){let{shouldDrawErrors:o,transform:r}=n;if(!o)return[];let i=Dls(Tls(e,t)),s=t.find((y)=>y.type==="pcb_trace"&&y.pcb_trace_id===e.pcb_trace_id),a=Rls(s),c=A_e(e.center)?e.center:i??(a?Qls(a.start,a.end):void 0);if(!c)return[];let l=Vt(r,c),h=i?Vt(r,i):void 0,d=a?{start:Vt(r,a.start),end:Vt(r,a.end)}:void 0,u=[d?gft(d.start,l,"trace-start"):void 0,d?gft(d.end,l,"trace-end"):void 0,h?gft(h,l,"obstacle"):void 0].filter((y)=>y!==void 0),_=e.type==="pcb_pad_trace_clearance_error"?"Pad/trace":"Via/trace",{actual_clearance:p,minimum_clearance:m}=e,A=p!==void 0&&m!==void 0?`${_} clearance ${p} is below minimum ${m}`:e.type==="pcb_pad_trace_clearance_error"?"Pad and trace too close":"Via and trace too close",g=e.message??A,f=[...u,{type:"element",name:"rect",value:"",attributes:{x:(l.x-5).toString(),y:(l.y-5).toString(),width:"10",height:"10",fill:"red",transform:`rotate(45 ${l.x} ${l.y})`},children:[]},{type:"element",name:"text",value:"",attributes:{x:l.x.toString(),y:(l.y-15).toString(),fill:"red","font-family":"sans-serif","font-size":"12","text-anchor":"middle"},children:[{type:"text",name:"",value:g,attributes:{},children:[]}]}];return kls(f,e.type)}function Hls(e,t){let{transform:n,layer:o}=t;if(!e.route||!Array.isArray(e.route))return[];let r=e.route[0],i=e.route[e.route.length-1],s=r.x===i.x&&r.y===i.y,a=e.route.slice(0,s?-1:void 0).map((c,l)=>{let[h,d]=Vt(n,[c.x,c.y]);return l===0?`M ${h} ${d}`:`L ${h} ${d}`}).join(" ")+(s?" Z":"");return[{name:"path",type:"element",attributes:{class:"pcb-fabrication-note-path",stroke:e.color||"rgba(255,255,255,0.5)",fill:"none",d:a,"stroke-width":(e.stroke_width*Math.abs(n.a)).toString(),"data-pcb-component-id":e.pcb_component_id,"data-pcb-fabrication-note-path-id":e.pcb_fabrication_note_path_id,"data-type":"pcb_fabrication_note_path","data-pcb-layer":"overlay"},value:"",children:[]}]}var jfo=Xfo.default("circuit-to-svg"),i_=jfo.extend("pcb"),oWa=jfo.extend("sch");function Kfo(e){switch(e){case"top_left":return{textAnchor:"start",dominantBaseline:"text-before-edge"};case"top_center":return{textAnchor:"middle",dominantBaseline:"text-before-edge"};case"top_right":return{textAnchor:"end",dominantBaseline:"text-before-edge"};case"center_left":return{textAnchor:"start",dominantBaseline:"central"};case"center_right":return{textAnchor:"end",dominantBaseline:"central"};case"bottom_left":return{textAnchor:"start",dominantBaseline:"text-after-edge"};case"bottom_center":return{textAnchor:"middle",dominantBaseline:"text-after-edge"};case"bottom_right":return{textAnchor:"end",dominantBaseline:"text-after-edge"};case"center":default:return{textAnchor:"middle",dominantBaseline:"central"}}}function Fls(e,t){let{transform:n,layer:o}=t,{anchor_position:r,anchor_alignment:i="center",text:s,font_size:a=1,layer:c="top",color:l,ccw_rotation:h=0}=e;if(o&&c!==o)return[];if(!r||typeof r.x!=="number"||typeof r.y!=="number")return i_(`[pcb_fabrication_note_text] Invalid anchor_position for "${e.pcb_fabrication_note_text_id}": expected {x: number, y: number}, got ${JSON.stringify(r)}`),[];let[d,u]=Vt(n,[r.x,r.y]),_=a*Math.abs(n.a),{textAnchor:p,dominantBaseline:m}=Kfo(i),A=va(Wc(d,u),T2(-h*Math.PI/180));return[{name:"text",type:"element",attributes:{x:"0",y:"0","font-family":C_e,"font-size":_.toString(),"text-anchor":p,"dominant-baseline":m,transform:Pf(A),class:"pcb-fabrication-note-text",fill:l||"rgba(255,255,255,0.5)","data-type":"pcb_fabrication_note_text","data-pcb-layer":"overlay"},children:[{type:"text",value:s,name:"",attributes:{},children:[]}],value:""}]}var zls="rgba(255,255,255,0.5)",Ols="rgba(255,255,255,0.2)";function Vls(e,t){let{transform:n,layer:o}=t,{center:r,width:i,height:s,stroke_width:a,is_filled:c,has_stroke:l,is_stroke_dashed:h,color:d,layer:u="top",pcb_component_id:_,pcb_fabrication_note_rect_id:p,corner_radius:m}=e;if(o&&u!==o)return[];if(!r||typeof r.x!=="number"||typeof r.y!=="number"||typeof i!=="number"||typeof s!=="number")return i_(`[pcb_fabrication_note_rect] Invalid data for "${p}": expected center {x: number, y: number}, width: number, height: number, got center=${JSON.stringify(r)}, width=${JSON.stringify(i)}, height=${JSON.stringify(s)}`),[];let A=i/2,g=s/2,[f,y]=Vt(n,[r.x-A,r.y+g]),[x,C]=Vt(n,[r.x+A,r.y-g]),b=Math.min(f,x),I=Math.min(y,C),v=Math.abs(x-f),P=Math.abs(C-y),B=(typeof a==="number"?a:0)*Math.abs(n.a),T=d??zls,N=typeof m==="number"&&m>0?m:0,D=N*Math.abs(n.a),L=N*Math.abs(n.d),H={x:b.toString(),y:I.toString(),width:v.toString(),height:P.toString(),class:"pcb-fabrication-note-rect","data-type":"pcb_fabrication_note_rect","data-pcb-fabrication-note-rect-id":p,"data-pcb-layer":"overlay"};if(_!==void 0)H["data-pcb-component-id"]=_;if(D>0)H.rx=D.toString();if(L>0)H.ry=L.toString();if(c)H.fill=d??Ols;else H.fill="none";if(l??B>0){if(H.stroke=T,H["stroke-width"]=B.toString(),h){let U=0.2*Math.abs(n.a),j=0.1*Math.abs(n.a);H["stroke-dasharray"]=`${U} ${j}`}}else H.stroke="none";return[{name:"rect",type:"element",value:"",attributes:H,children:[]}]}function Aft(e){let t=Math.hypot(e.x,e.y)||1;return{x:e.x/t,y:e.y/t}}var Yls=1.5,Gls=0.6,Uls=0.3;function cfo(e){return e.map((t,n)=>n===0?`M ${t.x} ${t.y}`:`L ${t.x} ${t.y}`).join(" ")}function Wls(e,t){let{transform:n,layer:o}=t,{from:r,to:i,text:s,font_size:a=1,color:c,arrow_size:l,layer:h,pcb_component_id:d,pcb_fabrication_note_dimension_id:u,offset_distance:_,offset_direction:p,text_ccw_rotation:m}=e;if(o&&h&&h!==o)return[];if(!r||!i||typeof r!=="object"||typeof i!=="object")return i_(`[pcb_fabrication_note_dimension] Invalid endpoints for "${u}": expected {from: {x, y}, to: {x, y}}, got from=${JSON.stringify(r)}, to=${JSON.stringify(i)}`),[];if(typeof r.x!=="number"||typeof r.y!=="number"||typeof i.x!=="number"||typeof i.y!=="number")return i_(`[pcb_fabrication_note_dimension] Invalid point values for "${u}": x and y must be numbers, got from=${JSON.stringify(r)}, to=${JSON.stringify(i)}`),[];let A=typeof l==="number"?l:void 0;if(A===void 0||!Number.isFinite(A)||A<=0)return i_(`[pcb_fabrication_note_dimension] Invalid arrow_size for "${u}": expected positive number, got ${JSON.stringify(l)}`),[];let g=A,f=Aft({x:i.x-r.x,y:i.y-r.y});if(Number.isNaN(f.x)||Number.isNaN(f.y))return[];let y={x:-f.y,y:f.x},x=p&&typeof p.x==="number"&&typeof p.y==="number",C=x?Aft({x:p.x,y:p.y}):{x:0,y:0},b=typeof _==="number"?_:0,I={x:C.x*b,y:C.y*b},v=(Se)=>({x:Se.x+I.x,y:Se.y+I.y}),P=v(r),M=v(i),B=g/2,T={x:P.x+f.x*g,y:P.y+f.y*g},N={x:M.x-f.x*g,y:M.y-f.y*g},D=[ye(P),ye({x:T.x+y.x*B,y:T.y+y.y*B}),ye({x:T.x-y.x*B,y:T.y-y.y*B})],L=[ye(M),ye({x:N.x+y.x*B,y:N.y+y.y*B}),ye({x:N.x-y.x*B,y:N.y-y.y*B})],[H,V]=Vt(n,[T.x,T.y]),[O,U]=Vt(n,[N.x,N.y]),j=g/5*Math.abs(n.a),Y=c||"rgba(255,255,255,0.5)",X=x&&(Math.abs(C.x)>Number.EPSILON||Math.abs(C.y)>Number.EPSILON)?C:y,K=b+g,J=(Se)=>{let Ne={x:Se.x+X.x*K,y:Se.y+X.y*K},[ke,nt]=Vt(n,[Se.x,Se.y]),[dt,rt]=Vt(n,[Ne.x,Ne.y]);return{name:"path",type:"element",value:"",attributes:{d:`M ${ke} ${nt} L ${dt} ${rt}`,stroke:Y,fill:"none","stroke-width":j.toString(),"stroke-linecap":"round",class:"pcb-fabrication-note-dimension-extension"},children:[]}},ee=[J(r),J(i)],se={x:(r.x+i.x)/2+I.x,y:(r.y+i.y)/2+I.y},[ne,re]=Vt(n,[P.x,P.y]),[Z,te]=Vt(n,[M.x,M.y]),ie=Aft({x:Z-ne,y:te-re}),le=Math.atan2(ie.y,ie.x)*180/Math.PI;if(le>90||le<-90)le+=180;let ue=typeof m==="number"&&Number.isFinite(m)?le-m:le,de=0;if(s&&typeof m==="number"&&Number.isFinite(m)){let Se=s.length*a*Gls,Ne=a,ke=m*Math.PI/180,nt=Math.abs(Math.sin(ke)),dt=Math.abs(Math.cos(ke)),rt=Se/2,mt=Ne/2;de=rt*nt+mt*dt+a*Uls}let me=g*Yls+de,Ae={x:se.x+y.x*me,y:se.y+y.y*me},[xe,Me]=Vt(n,[Ae.x,Ae.y]),Re=a*Math.abs(n.a),we=[...ee,{name:"path",type:"element",value:"",attributes:{d:`M ${H} ${V} L ${O} ${U}`,stroke:Y,fill:"none","stroke-width":j.toString(),"stroke-linecap":"round",class:"pcb-fabrication-note-dimension-line"},children:[]},{name:"path",type:"element",value:"",attributes:{d:`${cfo(D)} Z`,fill:Y,class:"pcb-fabrication-note-dimension-arrow"},children:[]},{name:"path",type:"element",value:"",attributes:{d:`${cfo(L)} Z`,fill:Y,class:"pcb-fabrication-note-dimension-arrow"},children:[]}];if(s)we.push({name:"text",type:"element",value:"",attributes:{x:xe.toString(),y:Me.toString(),fill:Y,"font-size":Re.toString(),"font-family":C_e,"text-anchor":"middle","dominant-baseline":"central",class:"pcb-fabrication-note-dimension-text",transform:`rotate(${ue} ${xe} ${Me})`},children:[{type:"text",name:"",value:s,attributes:{},children:[]}]});let _e={class:"pcb-fabrication-note-dimension","data-type":"pcb_fabrication_note_dimension","data-pcb-fabrication-note-dimension-id":u,"data-pcb-layer":h??"overlay"};if(d!==void 0)_e["data-pcb-component-id"]=d;return[{name:"g",type:"element",value:"",attributes:_e,children:we}];function ye(Se){let[Ne,ke]=Vt(n,[Se.x,Se.y]);return{x:Ne,y:ke}}}var Ef={"3d_viewer":{background_bottom:"rgb(102, 102, 128)",background_top:"rgb(204, 204, 230)",board:"rgb(51, 43, 23)",copper:"rgb(179, 156, 0)",silkscreen_bottom:"rgb(230, 230, 230)",silkscreen_top:"rgb(230, 230, 230)",soldermask:"rgb(20, 51, 36)",solderpaste:"rgb(128, 128, 128)"},board:{anchor:"rgb(255, 38, 226)",aux_items:"rgb(255, 255, 255)",b_adhes:"rgb(0, 0, 132)",b_crtyd:"rgb(255, 38, 226)",b_fab:"rgb(88, 93, 132)",b_mask:"rgba(2, 255, 238, 0.400)",b_paste:"rgb(0, 194, 194)",b_silks:"rgb(232, 178, 167)",background:"rgb(0, 16, 35)",cmts_user:"rgb(89, 148, 220)",copper:{b:"rgb(77, 127, 196)",f:"rgb(200, 52, 52)",in1:"rgb(127, 200, 127)",in10:"rgb(237, 124, 51)",in11:"rgb(91, 195, 235)",in12:"rgb(247, 111, 142)",in13:"rgb(167, 165, 198)",in14:"rgb(40, 204, 217)",in15:"rgb(232, 178, 167)",in16:"rgb(242, 237, 161)",in17:"rgb(237, 124, 51)",in18:"rgb(91, 195, 235)",in19:"rgb(247, 111, 142)",in2:"rgb(206, 125, 44)",in20:"rgb(167, 165, 198)",in21:"rgb(40, 204, 217)",in22:"rgb(232, 178, 167)",in23:"rgb(242, 237, 161)",in24:"rgb(237, 124, 51)",in25:"rgb(91, 195, 235)",in26:"rgb(247, 111, 142)",in27:"rgb(167, 165, 198)",in28:"rgb(40, 204, 217)",in29:"rgb(232, 178, 167)",in3:"rgb(79, 203, 203)",in30:"rgb(242, 237, 161)",in4:"rgb(219, 98, 139)",in5:"rgb(167, 165, 198)",in6:"rgb(40, 204, 217)",in7:"rgb(232, 178, 167)",in8:"rgb(242, 237, 161)",in9:"rgb(141, 203, 129)"},cursor:"rgb(255, 255, 255)",drc:"rgb(194, 194, 194)",drc_error:"rgba(215, 91, 107, 0.800)",drc_exclusion:"rgb(255, 255, 255)",drc_warning:"rgba(255, 208, 66, 0.902)",dwgs_user:"rgb(194, 194, 194)",eco1_user:"rgb(180, 219, 210)",eco2_user:"rgb(216, 200, 82)",edge_cuts:"rgb(208, 210, 205)",f_adhes:"rgb(132, 0, 132)",f_crtyd:"rgb(255, 0, 245)",f_fab:"rgb(175, 175, 175)",f_mask:"rgba(216, 100, 255, 0.400)",f_paste:"rgba(180, 160, 154, 0.902)",f_silks:"rgb(242, 237, 161)",footprint_text_back:"rgb(0, 0, 132)",footprint_text_front:"rgb(194, 194, 194)",footprint_text_invisible:"rgb(132, 132, 132)",grid:"rgb(132, 132, 132)",grid_axes:"rgb(194, 194, 194)",margin:"rgb(255, 38, 226)",microvia:"rgb(0, 132, 132)",no_connect:"rgb(0, 0, 132)",pad_back:"rgb(77, 127, 196)",pad_front:"rgb(200, 52, 52)",pad_plated_hole:"rgb(194, 194, 0)",pad_through_hole:"rgb(227, 183, 46)",plated_hole:"rgb(26, 196, 210)",ratsnest:"rgba(245, 255, 213, 0.702)",select_overlay:"rgb(4, 255, 67)",through_via:"rgb(236, 236, 236)",user_1:"rgb(194, 194, 194)",user_2:"rgb(89, 148, 220)",user_3:"rgb(180, 219, 210)",user_4:"rgb(216, 200, 82)",user_5:"rgb(194, 194, 194)",user_6:"rgb(89, 148, 220)",user_7:"rgb(180, 219, 210)",user_8:"rgb(216, 200, 82)",user_9:"rgb(232, 178, 167)",via_blind_buried:"rgb(187, 151, 38)",via_hole:"rgb(227, 183, 46)",via_micro:"rgb(0, 132, 132)",via_through:"rgb(236, 236, 236)",worksheet:"rgb(200, 114, 171)"},gerbview:{axes:"rgb(0, 0, 132)",background:"rgb(0, 0, 0)",dcodes:"rgb(255, 255, 255)",grid:"rgb(132, 132, 132)",layers:["rgb(132, 0, 0)","rgb(194, 194, 0)","rgb(194, 0, 194)","rgb(194, 0, 0)","rgb(0, 132, 132)","rgb(0, 132, 0)","rgb(0, 0, 132)","rgb(132, 132, 132)","rgb(132, 0, 132)","rgb(194, 194, 194)","rgb(132, 0, 132)","rgb(132, 0, 0)","rgb(132, 132, 0)","rgb(194, 194, 194)","rgb(0, 0, 132)","rgb(0, 132, 0)","rgb(132, 0, 0)","rgb(194, 194, 0)","rgb(194, 0, 194)","rgb(194, 0, 0)","rgb(0, 132, 132)","rgb(0, 132, 0)","rgb(0, 0, 132)","rgb(132, 132, 132)","rgb(132, 0, 132)","rgb(194, 194, 194)","rgb(132, 0, 132)","rgb(132, 0, 0)","rgb(132, 132, 0)","rgb(194, 194, 194)","rgb(0, 0, 132)","rgb(0, 132, 0)","rgb(132, 0, 0)","rgb(194, 194, 0)","rgb(194, 0, 194)","rgb(194, 0, 0)","rgb(0, 132, 132)","rgb(0, 132, 0)","rgb(0, 0, 132)","rgb(132, 132, 132)","rgb(132, 0, 132)","rgb(194, 194, 194)","rgb(132, 0, 132)","rgb(132, 0, 0)","rgb(132, 132, 0)","rgb(194, 194, 194)","rgb(0, 0, 132)","rgb(0, 132, 0)","rgb(132, 0, 0)","rgb(194, 194, 0)","rgb(194, 0, 194)","rgb(194, 0, 0)","rgb(0, 132, 132)","rgb(0, 132, 0)","rgb(0, 0, 132)","rgb(132, 132, 132)","rgb(132, 0, 132)","rgb(194, 194, 194)","rgb(132, 0, 132)","rgb(132, 0, 0)"],negative_objects:"rgb(132, 132, 132)",worksheet:"rgb(0, 0, 132)"},meta:{filename:"kicad_2020",name:"KiCad 2020",version:2},simulation_palette:["#1f77b4","#d62728","#2ca02c","#ff7f0e","#9467bd","#17becf","#8c564b","#e377c2","#7f7f7f","#bcbd22"],palette:["rgb(132, 0, 0)","rgb(194, 194, 0)","rgb(194, 0, 194)","rgb(194, 0, 0)","rgb(0, 132, 132)","rgb(0, 132, 0)","rgb(0, 0, 132)","rgb(132, 132, 132)","rgb(132, 0, 132)","rgb(194, 194, 194)","rgb(132, 0, 132)","rgb(132, 0, 0)","rgb(132, 132, 0)","rgb(194, 194, 194)","rgb(0, 0, 132)","rgb(0, 132, 0)"],schematic:{aux_items:"rgb(46, 46, 46)",background:"rgb(245, 241, 237)",brightened:"rgb(255, 0, 255)",bus:"rgb(0, 0, 132)",bus_junction:"rgb(0, 0, 132)",component_body:"rgb(255, 255, 194)",component_outline:"rgb(132, 0, 0)",cursor:"rgb(15, 15, 15)",erc_error:"rgba(230, 9, 13, 0.800)",erc_warning:"rgba(209, 146, 0, 0.800)",fields:"rgb(132, 0, 132)",grid:"rgb(181, 181, 181)",grid_axes:"rgb(0, 0, 132)",hidden:"rgb(194, 194, 194)",junction:"rgb(0, 150, 0)",label_global:"rgb(132, 0, 0)",label_background:"rgba(255, 255, 255, 0.6)",label_hier:"rgb(114, 86, 0)",label_local:"rgb(15, 15, 15)",net_name:"rgb(132, 132, 132)",no_connect:"rgb(132, 0, 0)",note:"rgb(0, 0, 194)",override_item_colors:!1,pin:"rgb(132, 0, 0)",pin_name:"rgb(0, 100, 100)",pin_number:"rgb(169, 0, 0)",reference:"rgb(0, 100, 100)",shadow:"rgba(102, 179, 255, 0.800)",sheet:"rgb(132, 0, 0)",sheet_background:"rgba(253, 255, 231, 0.000)",sheet_fields:"rgb(132, 0, 132)",sheet_filename:"rgb(114, 86, 0)",sheet_label:"rgb(0, 100, 100)",sheet_name:"rgb(0, 100, 100)",table:"rgb(102, 102, 102)",value:"rgb(0, 100, 100)",wire:"rgb(0, 150, 0)",wire_crossing:"rgb(30, 180, 30)",worksheet:"rgb(132, 0, 0)"}};function fft(e){let t=Math.hypot(e.x,e.y)||1;return{x:e.x/t,y:e.y/t}}function lfo(e){return e.map((t,n)=>n===0?`M ${t.x} ${t.y}`:`L ${t.x} ${t.y}`).join(" ")}function Xls(e,t){let{transform:n}=t,{from:o,to:r,text:i,font_size:s=1,color:a,arrow_size:c,offset_distance:l,offset_direction:h,text_ccw_rotation:d}=e;if(!o||!r)return i_(`[pcb_note_dimension] Invalid endpoints for "${e.pcb_note_dimension_id}": expected {from: {x, y}, to: {x, y}}, got from=${JSON.stringify(o)}, to=${JSON.stringify(r)}`),[];if(!Number.isFinite(c)||c<=0)return i_(`[pcb_note_dimension] Invalid arrow_size for "${e.pcb_note_dimension_id}": expected positive number, got ${JSON.stringify(c)}`),[];let u=fft({x:r.x-o.x,y:r.y-o.y});if(Number.isNaN(u.x)||Number.isNaN(u.y))return[];let _={x:-u.y,y:u.x},p=h&&typeof h.x==="number"&&typeof h.y==="number",m=p?fft({x:h.x,y:h.y}):{x:0,y:0},A=typeof l==="number"?l:0,g={x:m.x*A,y:m.y*A},f=(Ae)=>({x:Ae.x+g.x,y:Ae.y+g.y}),y=f(o),x=f(r),C=c/2,b={x:y.x+u.x*c,y:y.y+u.y*c},I={x:x.x-u.x*c,y:x.y-u.y*c},v=[me(y),me({x:b.x+_.x*C,y:b.y+_.y*C}),me({x:b.x-_.x*C,y:b.y-_.y*C})],P=[me(x),me({x:I.x+_.x*C,y:I.y+_.y*C}),me({x:I.x-_.x*C,y:I.y-_.y*C})],[M,B]=Vt(n,[b.x,b.y]),[T,N]=Vt(n,[I.x,I.y]),D=c/5*Math.abs(n.a),L=a||Ef.board.user_2,H=p&&(Math.abs(m.x)>Number.EPSILON||Math.abs(m.y)>Number.EPSILON)?m:_,V=A+c,O=(Ae)=>{let xe={x:Ae.x+H.x*V,y:Ae.y+H.y*V},[Me,Re]=Vt(n,[Ae.x,Ae.y]),[we,_e]=Vt(n,[xe.x,xe.y]);return{name:"path",type:"element",value:"",attributes:{d:`M ${Me} ${Re} L ${we} ${_e}`,stroke:L,fill:"none","stroke-width":D.toString(),"stroke-linecap":"round",class:"pcb-note-dimension-extension"},children:[]}},U=[O(o),O(r)],j={x:(o.x+r.x)/2+g.x,y:(o.y+r.y)/2+g.y},[Y,X]=Vt(n,[y.x,y.y]),[K,J]=Vt(n,[x.x,x.y]),ee=fft({x:K-Y,y:J-X}),se=Math.atan2(ee.y,ee.x)*180/Math.PI;if(se>90||se<-90)se+=180;let ne=typeof d==="number"&&Number.isFinite(d)?se-d:se,re=0;if(i&&typeof d==="number"&&Number.isFinite(d)){let Ae=i.length*s*0.6,xe=s,Me=d*Math.PI/180,Re=Math.abs(Math.sin(Me)),we=Math.abs(Math.cos(Me)),_e=Ae/2,ye=xe/2;re=_e*Re+ye*we+s*0.3}let Z=c*1.5+re,te={x:j.x+_.x*Z,y:j.y+_.y*Z},[ie,le]=Vt(n,[te.x,te.y]),ue=s*Math.abs(n.a),de=[...U,{name:"path",type:"element",value:"",attributes:{d:`M ${M} ${B} L ${T} ${N}`,stroke:L,fill:"none","stroke-width":D.toString(),"stroke-linecap":"round",class:"pcb-note-dimension-line"},children:[]},{name:"path",type:"element",value:"",attributes:{d:`${lfo(v)} Z`,fill:L,class:"pcb-note-dimension-arrow"},children:[]},{name:"path",type:"element",value:"",attributes:{d:`${lfo(P)} Z`,fill:L,class:"pcb-note-dimension-arrow"},children:[]}];if(i)de.push({name:"text",type:"element",value:"",attributes:{x:ie.toString(),y:le.toString(),fill:L,"font-size":ue.toString(),"font-family":"Arial, sans-serif","text-anchor":"middle","dominant-baseline":"central",class:"pcb-note-dimension-text",transform:`rotate(${ne} ${ie} ${le})`},children:[{type:"text",name:"",value:i,attributes:{},children:[]}]});return[{name:"g",type:"element",value:"",attributes:{class:"pcb-note-dimension","data-type":"pcb_note_dimension","data-pcb-note-dimension-id":e.pcb_note_dimension_id,"data-pcb-layer":"overlay"},children:de}];function me(Ae){let[xe,Me]=Vt(n,[Ae.x,Ae.y]);return{x:xe,y:Me}}}var jls=Ef.board.user_2;function Kls(e,t){let{transform:n}=t,{anchor_position:o,text:r,font_size:i=1,anchor_alignment:s="center",color:a}=e;if(!o||typeof o.x!=="number"||typeof o.y!=="number")return i_(`[pcb_note_text] Invalid anchor_position for "${e.pcb_note_text_id}": expected {x: number, y: number}, got ${JSON.stringify(o)}`),[];if(typeof r!=="string"||r.length===0)return i_(`[pcb_note_text] Invalid text for "${e.pcb_note_text_id}": expected non-empty string, got ${JSON.stringify(r)}`),[];let[c,l]=Vt(n,[o.x,o.y]),h=i*Math.abs(n.a),{textAnchor:d,dominantBaseline:u}=Kfo(s),_=r.split(`
`),p=_.length===1?[{type:"text",name:"",value:r,attributes:{},children:[]}]:_.map((A,g)=>({type:"element",name:"tspan",value:"",attributes:{x:c.toString(),...g>0?{dy:"1em"}:{}},children:[{type:"text",name:"",value:A,attributes:{},children:[]}]}));return[{name:"text",type:"element",value:"",attributes:{x:c.toString(),y:l.toString(),fill:a??jls,"font-family":"Arial, sans-serif","font-size":h.toString(),"text-anchor":d,"dominant-baseline":u,class:"pcb-note-text","data-type":"pcb_note_text","data-pcb-note-text-id":e.pcb_note_text_id,"data-pcb-layer":"overlay"},children:p}]}var $ls=Ef.board.user_2,qls=Ef.board.user_2;function Jls(e,t){let{transform:n}=t,{center:o,width:r,height:i,stroke_width:s,is_filled:a,has_stroke:c,is_stroke_dashed:l,color:h,corner_radius:d}=e;if(!o||typeof o.x!=="number"||typeof o.y!=="number"||typeof r!=="number"||typeof i!=="number")return i_(`[pcb_note_rect] Invalid data for "${e.pcb_note_rect_id}": expected center {x: number, y: number}, width: number, height: number, got center=${JSON.stringify(o)}, width=${JSON.stringify(r)}, height=${JSON.stringify(i)}`),[];let u=r/2,_=i/2,[p,m]=Vt(n,[o.x-u,o.y+_]),[A,g]=Vt(n,[o.x+u,o.y-_]),f=Math.min(p,A),y=Math.min(m,g),x=Math.abs(A-p),C=Math.abs(g-m),I=(typeof s==="number"?s:0)*Math.abs(n.a),v=typeof d==="number"&&d>0?d:0,P=v*Math.abs(n.a),M=v*Math.abs(n.d),B=h??$ls,T={x:f.toString(),y:y.toString(),width:x.toString(),height:C.toString(),class:"pcb-note-rect","data-type":"pcb_note_rect","data-pcb-note-rect-id":e.pcb_note_rect_id,"data-pcb-layer":"overlay"};if(P>0)T.rx=P.toString();if(M>0)T.ry=M.toString();if(a)T.fill=h??qls;else T.fill="none";if(c??I>0){if(T.stroke=B,T["stroke-width"]=I.toString(),l){let L=0.2*Math.abs(n.a),H=0.1*Math.abs(n.a);T["stroke-dasharray"]=`${L} ${H}`}}else T.stroke="none";return[{name:"rect",type:"element",value:"",attributes:T,children:[]}]}var Zls=Ef.board.user_2;function ehs(e,t){let{transform:n}=t;if(!Array.isArray(e.route)||e.route.length===0)return i_(`[pcb_note_path] Invalid route for "${e.pcb_note_path_id}": expected non-empty array of points, got ${JSON.stringify(e.route)}`),[];for(let s of e.route)if(typeof s.x!=="number"||typeof s.y!=="number")return i_(`[pcb_note_path] Invalid point in route for "${e.pcb_note_path_id}": expected {x: number, y: number}, got ${JSON.stringify(s)}`),[];let o=e.route.map((s,a)=>{let[c,l]=Vt(n,[s.x,s.y]);return a===0?`M ${c} ${l}`:`L ${c} ${l}`}).join(" "),r=e.stroke_width*Math.abs(n.a);return[{name:"path",type:"element",value:"",attributes:{d:o,stroke:e.color??Zls,fill:"none","stroke-width":r.toString(),class:"pcb-note-path","data-type":"pcb_note_path","data-pcb-note-path-id":e.pcb_note_path_id,"data-pcb-layer":"overlay"},children:[]}]}var ths=Ef.board.user_2;function nhs(e,t){let{transform:n}=t,{x1:o,y1:r,x2:i,y2:s,stroke_width:a,color:c,is_dashed:l}=e;if(typeof o!=="number"||typeof r!=="number"||typeof i!=="number"||typeof s!=="number")return i_(`[pcb_note_line] Invalid coordinates for "${e.pcb_note_line_id}": expected x1, y1, x2, y2 as numbers, got x1=${JSON.stringify(o)}, y1=${JSON.stringify(r)}, x2=${JSON.stringify(i)}, y2=${JSON.stringify(s)}`),[];let[h,d]=Vt(n,[o,r]),[u,_]=Vt(n,[i,s]),m=(typeof a==="number"?a:0)*Math.abs(n.a),A={x1:h.toString(),y1:d.toString(),x2:u.toString(),y2:_.toString(),stroke:c??ths,"stroke-width":m.toString(),"stroke-linecap":"round",class:"pcb-note-line","data-type":"pcb_note_line","data-pcb-note-line-id":e.pcb_note_line_id,"data-pcb-layer":"overlay"};if(l){let f=0.2*Math.abs(n.a),y=0.1*Math.abs(n.a);A["stroke-dasharray"]=`${f} ${y}`}return[{name:"line",type:"element",value:"",attributes:A,children:[]}]}function $fo(e,t){if(!t)return{};let n=qfo(e,t);if(!n)return{};let o=t.find((a)=>a.type==="source_port"&&a.source_port_id===n),r=t.find((a)=>a.type==="source_component"&&a.source_component_id===o?.source_component_id),i={};if(r?.name&&o?.name)i["data-pad-name"]=`${r.name}.${o.name}`;let s=rhs(n,t);if(s)i["data-pad-net-name"]=s;return i}function ohs(e,t){if(t){let r=qfo(e,t),i=t.find((s)=>s.type==="source_port"&&s.source_port_id===r);if(i?.type==="source_port"&&i.pin_number!=null)return i.pin_number.toString()}let n=e.port_hints?.find((r)=>r.trim().length>0);if(!n)return;return n.match(/^pin(\d+)$/i)?.[1]??n}function qfo(e,t){if(e.source_port_id)return e.source_port_id;if(e.pcb_port_id){let r=t.find((i)=>i.type==="pcb_port"&&i.pcb_port_id===e.pcb_port_id);if(r?.source_port_id)return r.source_port_id}let n=e.pcb_smtpad_id??e.pcb_plated_hole_id;if(!n)return;return t.find((r)=>{if(r.type!=="pcb_port")return!1;let i=r;return i.pcb_smtpad_id===n||i.pcb_plated_hole_id===n})?.source_port_id}function rhs(e,t){let o=t.find((i)=>{if(i.type!=="source_trace")return!1;return i.connected_source_port_ids?.includes(e)})?.connected_source_net_ids?.[0];if(!o)return;return t.find((i)=>i.type==="source_net"&&i.source_net_id===o)?.name}function ihs(e,t){let{transform:n,colorMap:o,showSolderMask:r}=t,[i,s]=Vt(n,[e.x,e.y]),a=$fo(e,t.circuitJson),c=Array.isArray(e.layers)&&e.layers[0]||e.layer||"top",l=c,h=Boolean(e.is_covered_with_solder_mask),d=(e.soldermask_margin??0)*Math.abs(n.a),u=r&&h&&d!==0,_=o.soldermaskWithCopperUnderneath.top;if(e.shape==="pill"){let p=e.outer_width*Math.abs(n.a),m=e.outer_height*Math.abs(n.a),A=e.hole_width*Math.abs(n.a),g=e.hole_height*Math.abs(n.a),f=e.ccw_rotation||0,y=f?`translate(${i} ${s}) rotate(${-f})`:`translate(${i} ${s})`,x=f?`translate(${i} ${s}) rotate(${-f})`:`translate(${i} ${s})`,C=(I,v)=>{if(I>v){let P=v/2,M=I-2*P;return`M${-I/2+P},${-P} h${M} a${P},${P} 0 0 1 0,${v} h${-M} a${P},${P} 0 0 1 0,${-v} z`}else if(v>I){let P=I/2,M=v-2*P;return`M${P},${-v/2+P} v${M} a${P},${P} 0 0 1 ${-I},0 v${-M} a${P},${P} 0 0 1 ${I},0 z`}else{let P=I/2;return`M${-P},0 a${P},${P} 0 0 1 ${I},0 a${P},${P} 0 0 1 ${-I},0 z`}},b=[{name:"path",type:"element",attributes:{class:"pcb-hole-outer",fill:o.copper.top,d:C(p,m),transform:y,"data-type":"pcb_plated_hole","data-pcb-layer":c},value:"",children:[]},{name:"path",type:"element",attributes:{class:"pcb-hole-inner",fill:o.drill,d:C(A,g),transform:x,"data-type":"pcb_plated_hole_drill","data-pcb-layer":"drill"},value:"",children:[]}];if(u){let I=p+2*d,v=m+2*d;if(d<0)b=[{name:"path",type:"element",attributes:{class:"pcb-hole-outer-covered",fill:_,d:C(p,m),transform:y,"data-type":"pcb_plated_hole","data-pcb-layer":c},value:"",children:[]},{name:"path",type:"element",attributes:{class:"pcb-hole-outer-exposed",fill:o.copper.top,d:C(I,v),transform:y,"data-type":"pcb_soldermask","data-pcb-layer":l},value:"",children:[]},b[1]];else b.unshift({name:"path",type:"element",attributes:{class:"pcb-soldermask-cutout",fill:o.substrate,d:C(I,v),transform:y,"data-type":"pcb_soldermask_opening","data-pcb-layer":l},value:"",children:[]})}return[{name:"g",type:"element",attributes:{"data-type":"pcb_plated_hole","data-pcb-layer":"through",...a},children:b,value:""}]}if(e.shape==="oval"){let p=e.outer_width*Math.abs(n.a),m=e.outer_height*Math.abs(n.a),A=e.hole_width*Math.abs(n.a),g=e.hole_height*Math.abs(n.a),f=e.ccw_rotation||0,y=f?`translate(${i} ${s}) rotate(${-f})`:`translate(${i} ${s})`,x=[{name:"ellipse",type:"element",attributes:{class:"pcb-hole-outer",fill:o.copper.top,cx:"0",cy:"0",rx:(p/2).toString(),ry:(m/2).toString(),transform:y,"data-type":"pcb_plated_hole","data-pcb-layer":c},value:"",children:[]},{name:"ellipse",type:"element",attributes:{class:"pcb-hole-inner",fill:o.drill,cx:"0",cy:"0",rx:(A/2).toString(),ry:(g/2).toString(),transform:y,"data-type":"pcb_plated_hole_drill","data-pcb-layer":"drill"},value:"",children:[]}];return[{name:"g",type:"element",attributes:{"data-type":"pcb_plated_hole","data-pcb-layer":"through",...a},children:x,value:""}]}if(e.shape==="circle"){let p=e.outer_diameter*Math.abs(n.a),m=e.outer_diameter*Math.abs(n.a),A=e.hole_diameter*Math.abs(n.a),g=e.hole_diameter*Math.abs(n.a),f=Math.min(p,m)/2,y=Math.min(A,g)/2,x=[{name:"circle",type:"element",attributes:{class:"pcb-hole-outer",fill:o.copper.top,cx:i.toString(),cy:s.toString(),r:f.toString(),"data-type":"pcb_plated_hole","data-pcb-layer":c},value:"",children:[]},{name:"circle",type:"element",attributes:{class:"pcb-hole-inner",fill:o.drill,cx:i.toString(),cy:s.toString(),r:y.toString(),"data-type":"pcb_plated_hole_drill","data-pcb-layer":"drill"},value:"",children:[]}];if(u){let C=f+d;if(d<0)x=[{name:"circle",type:"element",attributes:{class:"pcb-hole-outer-covered",fill:_,cx:i.toString(),cy:s.toString(),r:f.toString(),"data-type":"pcb_plated_hole","data-pcb-layer":c},value:"",children:[]},{name:"circle",type:"element",attributes:{class:"pcb-hole-outer-exposed",fill:o.copper.top,cx:i.toString(),cy:s.toString(),r:C.toString(),"data-type":"pcb_soldermask","data-pcb-layer":l},value:"",children:[]},x[1]];else x.unshift({name:"circle",type:"element",attributes:{class:"pcb-soldermask-cutout",fill:o.substrate,cx:i.toString(),cy:s.toString(),r:C.toString(),"data-type":"pcb_soldermask_opening","data-pcb-layer":l},value:"",children:[]})}return[{name:"g",type:"element",attributes:{"data-type":"pcb_plated_hole","data-pcb-layer":"through",...a},children:x,value:""}]}if(e.shape==="circular_hole_with_rect_pad"){let p=e,m=e.hole_diameter*Math.abs(n.a),A=e.rect_pad_width*Math.abs(n.a),g=e.rect_pad_height*Math.abs(n.a),f=(e.rect_border_radius??0)*Math.abs(n.a),y=e.rect_ccw_rotation??0,x=p.rect_ccw_rotation??0,C=x?`translate(${i} ${s}) rotate(${-x})`:void 0,b=x?(-A/2).toString():(i-A/2).toString(),I=x?(-g/2).toString():(s-g/2).toString(),v=m/2,[P,M]=Vt(n,[p.x+(p.hole_offset_x??0),p.y+(p.hole_offset_y??0)]),B=[{name:"rect",type:"element",attributes:{class:"pcb-hole-outer-pad",fill:o.copper.top,...y?{x:(-A/2).toString(),y:(-g/2).toString(),transform:`translate(${i} ${s}) rotate(${-y})`}:{x:(i-A/2).toString(),y:(s-g/2).toString()},width:A.toString(),height:g.toString(),...C?{transform:C}:{},...f?{rx:f.toString(),ry:f.toString()}:{},"data-type":"pcb_plated_hole","data-pcb-layer":c},value:"",children:[]},{name:"circle",type:"element",attributes:{class:"pcb-hole-inner",fill:o.drill,cx:P.toString(),cy:M.toString(),r:v.toString(),"data-type":"pcb_plated_hole_drill","data-pcb-layer":"drill"},value:"",children:[]}];if(u){let T=A+2*d,N=g+2*d,D=f+d;if(d<0)B=[{name:"rect",type:"element",attributes:{class:"pcb-hole-outer-covered",fill:_,...y?{x:(-A/2).toString(),y:(-g/2).toString(),transform:`translate(${i} ${s}) rotate(${-y})`}:{x:(i-A/2).toString(),y:(s-g/2).toString()},width:A.toString(),height:g.toString(),...C?{transform:C}:{},...f?{rx:f.toString(),ry:f.toString()}:{},"data-type":"pcb_plated_hole","data-pcb-layer":c},value:"",children:[]},{name:"rect",type:"element",attributes:{class:"pcb-hole-outer-exposed",fill:o.copper.top,...y?{x:(-T/2).toString(),y:(-N/2).toString(),transform:`translate(${i} ${s}) rotate(${-y})`}:{x:(i-T/2).toString(),y:(s-N/2).toString()},width:T.toString(),height:N.toString(),...C?{transform:C}:{},...D>0?{rx:D.toString(),ry:D.toString()}:{},"data-type":"pcb_soldermask","data-pcb-layer":l},value:"",children:[]},B[1]];else B.unshift({name:"rect",type:"element",attributes:{class:"pcb-soldermask-cutout",fill:o.substrate,...y?{x:(-T/2).toString(),y:(-N/2).toString(),transform:`translate(${i} ${s}) rotate(${-y})`}:{x:(i-T/2).toString(),y:(s-N/2).toString()},width:T.toString(),height:N.toString(),...C?{transform:C}:{},...f?{rx:D.toString(),ry:D.toString()}:{},"data-type":"pcb_soldermask_opening","data-pcb-layer":l},value:"",children:[]})}return[{name:"g",type:"element",attributes:{"data-type":"pcb_plated_hole","data-pcb-layer":"through",...a},children:B,value:""}]}if(e.shape==="pill_hole_with_rect_pad"){let p=e,m=p.rect_pad_width*Math.abs(n.a),A=p.rect_pad_height*Math.abs(n.a),g=(p.rect_border_radius??0)*Math.abs(n.a),f=p.hole_height*Math.abs(n.a),y=p.hole_width*Math.abs(n.a),x=p,C=x.hole_offset_x??0,b=x.hole_offset_y??0,[I,v]=Vt(n,[p.x+C,p.y+b]),P=Math.min(f,y)/2,M=[{name:"rect",type:"element",attributes:{class:"pcb-hole-outer-pad",fill:o.copper.top,x:(i-m/2).toString(),y:(s-A/2).toString(),width:m.toString(),height:A.toString(),...g?{rx:g.toString(),ry:g.toString()}:{},"data-type":"pcb_plated_hole","data-pcb-layer":c},value:"",children:[]},{name:"rect",type:"element",attributes:{class:"pcb-hole-inner",fill:o.drill,x:(I-y/2).toString(),y:(v-f/2).toString(),width:y.toString(),height:f.toString(),rx:P.toString(),ry:P.toString(),"data-type":"pcb_plated_hole_drill","data-pcb-layer":"drill"},value:"",children:[]}];if(u){let B=m+2*d,T=A+2*d,N=g+d;if(d<0)M=[{name:"rect",type:"element",attributes:{class:"pcb-hole-outer-covered",fill:_,x:(i-m/2).toString(),y:(s-A/2).toString(),width:m.toString(),height:A.toString(),...g?{rx:g.toString(),ry:g.toString()}:{},"data-type":"pcb_plated_hole","data-pcb-layer":c},value:"",children:[]},{name:"rect",type:"element",attributes:{class:"pcb-hole-outer-exposed",fill:o.copper.top,x:(i-B/2).toString(),y:(s-T/2).toString(),width:B.toString(),height:T.toString(),...N>0?{rx:N.toString(),ry:N.toString()}:{},"data-type":"pcb_soldermask","data-pcb-layer":l},value:"",children:[]},M[1]];else M.unshift({name:"rect",type:"element",attributes:{class:"pcb-soldermask-cutout",fill:o.substrate,x:(i-B/2).toString(),y:(s-T/2).toString(),width:B.toString(),height:T.toString(),...g?{rx:N.toString(),ry:N.toString()}:{},"data-type":"pcb_soldermask_opening","data-pcb-layer":l},value:"",children:[]})}return[{name:"g",type:"element",attributes:{"data-type":"pcb_plated_hole","data-pcb-layer":"through",...a},children:M,value:""}]}if(e.shape==="rotated_pill_hole_with_rect_pad"){let p=e,m=p.rect_pad_width*Math.abs(n.a),A=p.rect_pad_height*Math.abs(n.a),g=(p.rect_border_radius??0)*Math.abs(n.a),f=p.hole_height*Math.abs(n.a),y=p.hole_width*Math.abs(n.a),x=p,C=x.hole_offset_x??0,b=x.hole_offset_y??0,[I,v]=Vt(n,[p.x+C,p.y+b]),P=Math.min(f,y)/2,M=[{name:"rect",type:"element",attributes:{class:"pcb-hole-outer-pad",fill:o.copper.top,x:(-m/2).toString(),y:(-A/2).toString(),width:m.toString(),height:A.toString(),transform:`translate(${i} ${s}) rotate(${-p.rect_ccw_rotation})`,...g?{rx:g.toString(),ry:g.toString()}:{},"data-type":"pcb_plated_hole","data-pcb-layer":c},value:"",children:[]},{name:"rect",type:"element",attributes:{class:"pcb-hole-inner",fill:o.drill,x:(-y/2).toString(),y:(-f/2).toString(),width:y.toString(),height:f.toString(),rx:P.toString(),ry:P.toString(),transform:`translate(${I} ${v}) rotate(${-p.hole_ccw_rotation})`,"data-type":"pcb_plated_hole_drill","data-pcb-layer":"drill"},value:"",children:[]}];if(u){let B=m+2*d,T=A+2*d,N=g+d;if(d<0)M=[{name:"rect",type:"element",attributes:{class:"pcb-hole-outer-covered",fill:_,x:(-m/2).toString(),y:(-A/2).toString(),width:m.toString(),height:A.toString(),transform:`translate(${i} ${s}) rotate(${-p.rect_ccw_rotation})`,...g?{rx:g.toString(),ry:g.toString()}:{},"data-type":"pcb_plated_hole","data-pcb-layer":c},value:"",children:[]},{name:"rect",type:"element",attributes:{class:"pcb-hole-outer-exposed",fill:o.copper.top,x:(-B/2).toString(),y:(-T/2).toString(),width:B.toString(),height:T.toString(),transform:`translate(${i} ${s}) rotate(${-p.rect_ccw_rotation})`,...N>0?{rx:N.toString(),ry:N.toString()}:{},"data-type":"pcb_soldermask","data-pcb-layer":l},value:"",children:[]},M[1]];else M.push({name:"rect",type:"element",attributes:{class:"pcb-solder-mask",fill:_,x:(-B/2).toString(),y:(-T/2).toString(),width:B.toString(),height:T.toString(),transform:`translate(${i} ${s}) rotate(${-p.rect_ccw_rotation})`,...g?{rx:N.toString(),ry:N.toString()}:{},"data-type":"pcb_soldermask","data-pcb-layer":l},value:"",children:[]})}return[{name:"g",type:"element",attributes:{"data-type":"pcb_plated_hole","data-pcb-layer":"through",...a},children:M,value:""}]}if(e.shape==="hole_with_polygon_pad"){let p=e,m=p.pad_outline||[],A=p.x??0,g=p.y??0,y=m.map((I)=>Vt(n,[A+I.x,g+I.y])).map((I)=>I.join(",")).join(" "),[x,C]=Vt(n,[A+p.hole_offset_x,g+p.hole_offset_y]),b=()=>{if(p.hole_shape==="circle"){let v=(p.hole_diameter??0)*Math.abs(n.a)/2;return{name:"circle",type:"element",attributes:{class:"pcb-hole-inner",fill:o.drill,cx:x.toString(),cy:C.toString(),r:v.toString(),"data-type":"pcb_plated_hole_drill","data-pcb-layer":"drill"},value:"",children:[]}}if(p.hole_shape==="oval"){let I=(p.hole_width??0)*Math.abs(n.a),v=(p.hole_height??0)*Math.abs(n.a),P=I/2,M=v/2;return{name:"ellipse",type:"element",attributes:{class:"pcb-hole-inner",fill:o.drill,cx:x.toString(),cy:C.toString(),rx:P.toString(),ry:M.toString(),"data-type":"pcb_plated_hole_drill","data-pcb-layer":"drill"},value:"",children:[]}}if(p.hole_shape==="pill"||p.hole_shape==="rotated_pill"){let I=(p.hole_width??0)*Math.abs(n.a),v=(p.hole_height??0)*Math.abs(n.a),P=I>v,M=Math.min(I,v)/2,B=Math.abs(P?I-v:v-I),T=P?`M${-B/2},${-M} h${B} a${M},${M} 0 0 1 0,${v} h-${B} a${M},${M} 0 0 1 0,-${v} z`:`M${-M},${-B/2} v${B} a${M},${M} 0 0 0 ${I},0 v-${B} a${M},${M} 0 0 0 -${I},0 z`;return{name:"path",type:"element",attributes:{class:"pcb-hole-inner",fill:o.drill,d:T,transform:`translate(${x} ${C})`,"data-type":"pcb_plated_hole_drill","data-pcb-layer":"drill"},value:"",children:[]}}return{name:"g",type:"element",attributes:{},value:"",children:[]}};return[{name:"g",type:"element",attributes:{"data-type":"pcb_plated_hole","data-pcb-layer":"through",...a},children:[{name:"polygon",type:"element",attributes:{class:"pcb-hole-outer-pad",fill:o.copper.top,points:y,"data-type":"pcb_plated_hole","data-pcb-layer":c},value:"",children:[]},b()],value:""}]}return[]}function shs(e,t){let{transform:n,layer:o,colorMap:r}=t;if(!e.route||!Array.isArray(e.route))return[];let i=e.route.map((h,d)=>{let[u,_]=Vt(n,[h.x,h.y]);return d===0?`M ${u} ${_}`:`L ${u} ${_}`}).join(" "),s=e.route[0],a=e.route[e.route.length-1];if(s&&a&&s.x===a.x&&s.y===a.y)i+=" Z";let c=e.layer||"top";if(o&&c!==o)return[];let l=c==="bottom"?r.silkscreen.bottom:r.silkscreen.top;return[{name:"path",type:"element",attributes:{class:`pcb-silkscreen pcb-silkscreen-${c}`,d:i,fill:"none",stroke:l,"stroke-width":(e.stroke_width*Math.abs(n.a)).toString(),"stroke-linecap":"round","stroke-linejoin":"round","data-pcb-component-id":e.pcb_component_id,"data-pcb-silkscreen-path-id":e.pcb_silkscreen_path_id,"data-type":"pcb_silkscreen_path","data-pcb-layer":c},value:"",children:[]}]}function PDe(e,t){if(e.length===0)return"";let n=e.map((r)=>{let[i,s]=Vt(t,[r.x,r.y]);return{...r,x:i,y:s}}),o=`M ${n[0].x} ${n[0].y}`;for(let r=0;r<n.length;r++){let i=n[r],s=n[(r+1)%n.length];if(i.bulge){if(Math.hypot(s.x-i.x,s.y-i.y)<0.000000001)continue;let a=i.bulge,c=s.x-i.x,l=s.y-i.y,h=Math.hypot(c,l),d=Math.abs(h/4/a*(a*a+1)),u=a<0?1:0,_=Math.abs(a)>1?1:0;o+=` A ${d} ${d} 0 ${_} ${u} ${s.x} ${s.y}`}else o+=` L ${s.x} ${s.y}`}return o+=" Z",o}function ahs(e,t){let{transform:n,layer:o,colorMap:r}=t,{layer:i="top"}=e;if(o&&i!==o)return[];if(e.shape!=="brep")return[];let s=i==="bottom"?r.silkscreen.bottom:r.silkscreen.top,a=PDe(e.brep_shape.outer_ring.vertices,n);for(let c of e.brep_shape.inner_rings??[])a+=` ${PDe(c.vertices,n)}`;return[{name:"path",type:"element",attributes:{class:`pcb-silkscreen pcb-silkscreen-${i}`,d:a,fill:s,"fill-rule":"evenodd",stroke:"none","data-pcb-component-id":e.pcb_component_id,"data-pcb-silkscreen-graphic-id":e.pcb_silkscreen_graphic_id,"data-type":"pcb_silkscreen_graphic","data-pcb-layer":i},value:"",children:[]}]}function hfo(e){let{text:t,anchorAlignment:n,fontSize:o,charAdvance:r,spaceAdvance:i,trailingSpacing:s,lineHeight:a,mapSegment:c}=e,l=t.split(`
`),h=l.length*a,d=l.map((f)=>chs(f,r,i,s)),u=[],_=-h/2;for(let f=0;f<l.length;f++){let y=l[f]??"",C=-(d[f]??0)/2;for(let b of y){if(b===" "){C+=i;continue}let I=d5[b];if(I)for(let v of I)u.push(c(v,C,_,o));C+=r}_+=a}let p=lhs(u);if(!p)return{pathData:"",bounds:null};let m=wft(n,p),A=uhs(u,m),g=phs(p,m);return{pathData:mhs(A),bounds:g}}function chs(e,t,n,o){let r=0;for(let i of e)r+=i===" "?n:t;return r>0?r-o:0}function lhs(e){if(e.length===0)return null;let{POSITIVE_INFINITY:t,POSITIVE_INFINITY:n,NEGATIVE_INFINITY:o,NEGATIVE_INFINITY:r}=Number;for(let i of e)t=Math.min(t,i.x1,i.x2),n=Math.min(n,i.y1,i.y2),o=Math.max(o,i.x1,i.x2),r=Math.max(r,i.y1,i.y2);return{minX:t,minY:n,maxX:o,maxY:r}}function wft(e,t){return{x:-hhs(e,t),y:-dhs(e,t)}}function hhs(e,t){if(e==="top_left"||e==="center_left"||e==="bottom_left")return t.minX;if(e==="top_right"||e==="center_right"||e==="bottom_right")return t.maxX;return(t.minX+t.maxX)/2}function dhs(e,t){if(e==="top_left"||e==="top_center"||e==="top_right")return t.minY;if(e==="bottom_left"||e==="bottom_center"||e==="bottom_right")return t.maxY;return(t.minY+t.maxY)/2}function uhs(e,t){if(t.x===0&&t.y===0)return e;return e.map((n)=>({x1:n.x1+t.x,y1:n.y1+t.y,x2:n.x2+t.x,y2:n.y2+t.y}))}function phs(e,t){return{minX:e.minX+t.x,minY:e.minY+t.y,maxX:e.maxX+t.x,maxY:e.maxY+t.y}}function mhs(e){return e.map((t)=>`M${t.x1} ${t.y1}L${t.x2} ${t.y2}`).join(" ")}var dfo=0.94,mDe=0.045,Jfo=Object.fromEntries(Object.entries(d5).map(([e,t])=>{let n=t.flatMap((r)=>[r.x1,r.x2]),o=t.flatMap((r)=>[r.y1,r.y2]);return[e,t.length?{minX:Math.min(...n)-mDe,maxX:Math.max(...n)+mDe,minY:-(Math.max(...o)+mDe)*dfo,maxY:-(Math.min(...o)-mDe)*dfo}:null]})),ufo=Math.round(Math.max(...Object.values(Jfo).map((e)=>e?e.maxX-e.minX:0))*1000)/1000;function _hs(e,t){let n=null,r=e.split(`
`).map((i,s)=>{let a=Array.from(i),c=-(a.length*ufo*t)/2,l=s*t*1.1;return a.forEach((h,d)=>{let u=Jfo[h];if(!u)return;let _=c+d*ufo*t,p={minX:_+u.minX*t,maxX:_+u.maxX*t,minY:l+u.minY*t,maxY:l+u.maxY*t};n=n?{minX:Math.min(n.minX,p.minX),maxX:Math.max(n.maxX,p.maxX),minY:Math.min(n.minY,p.minY),maxY:Math.max(n.maxY,p.maxY)}:p}),{name:"tspan",type:"element",value:"",attributes:{x:c.toString(),y:l.toString()},children:[{name:"",type:"text",value:i,attributes:{},children:[]}]}});return{bounds:n,textNode:{name:"text",type:"element",value:"",attributes:{"font-family":C_e,"font-size":t.toString(),"text-anchor":"start","dominant-baseline":"alphabetic","xml:space":"preserve",fill:"black",stroke:"none"},children:r}}}var ghs=0;function Ahs(e,t){let{transform:n,layer:o,colorMap:r}=t,{anchor_position:i,text:s,font_size:a=1,layer:c="top",ccw_rotation:l=0,anchor_alignment:h="center",is_knockout:d=!1,knockout_padding:u,is_mirrored:_=!1}=e;if(o&&c!==o)return[];if(!i||typeof i.x!=="number"||typeof i.y!=="number")return i_(`[pcb_silkscreen_text] Invalid anchor_position for "${e.pcb_silkscreen_text_id}": expected {x: number, y: number}, got ${JSON.stringify(i)}`),[];if(!s)return[];let[p,m]=Vt(n,[i.x,i.y]),A=Math.abs(n.a),g=c==="bottom"?r.silkscreen.bottom:r.silkscreen.top,y=c==="bottom"?!0:_===!0;if(d){let M=_hs(s,a);if(!M.bounds)return[];let B=u?.left??a*0.5,T=u?.right??a*0.5,N=u?.top??a*0.3,D=u?.bottom??a*0.3,L=M.bounds.minX-B,H=M.bounds.minY-N,V=M.bounds.maxX-M.bounds.minX+B+T,O=M.bounds.maxY-M.bounds.minY+N+D,U={minX:L,minY:H,maxX:L+V,maxY:H+O},j=wft(h,U),Y=L+j.x,X=H+j.y,K=[{name:"rect",type:"element",value:"",attributes:{x:L.toString(),y:H.toString(),width:V.toString(),height:O.toString(),fill:"white"},children:[]},M.textNode],ee=j.x!==0||j.y!==0?[{name:"g",type:"element",value:"",attributes:{transform:`translate(${j.x} ${j.y})`},children:K}]:K,se=Pf(va(Wc(p,m),T2(-l*Math.PI/180),...y?[kp(-1,1)]:[],kp(A,A))),ne=`silkscreen-knockout-mask-${e.pcb_silkscreen_text_id}-${ghs++}`;return[{name:"defs",type:"element",value:"",children:[{name:"mask",type:"element",value:"",attributes:{id:ne},children:ee}],attributes:{}},{name:"rect",type:"element",value:"",children:[],attributes:{x:Y.toString(),y:X.toString(),width:V.toString(),height:O.toString(),fill:g,mask:`url(#${ne})`,transform:se,class:`pcb-silkscreen-text-knockout pcb-silkscreen-${c}`,"data-type":"pcb_silkscreen_text","data-pcb-silkscreen-text-id":e.pcb_silkscreen_text_id,"data-pcb-layer":c}}]}let x=a*A,C="middle",b="central";switch(h){case"top_left":C="start",b="text-before-edge";break;case"top_center":C="middle",b="text-before-edge";break;case"top_right":C="end",b="text-before-edge";break;case"center_left":C="start",b="central";break;case"center_right":C="end",b="central";break;case"bottom_left":C="start",b="text-after-edge";break;case"bottom_center":C="middle",b="text-after-edge";break;case"bottom_right":C="end",b="text-after-edge";break;case"center":default:C="middle",b="central";break}let I=va(Wc(p,m),T2(-l*Math.PI/180),...y?[kp(-1,1)]:[]),v=s.split(`
`),P=v.length===1?[{type:"text",value:s,name:"",attributes:{},children:[]}]:v.map((M,B)=>({type:"element",name:"tspan",value:"",attributes:{x:"0",...B>0?{dy:x.toString()}:{}},children:[{type:"text",value:M,name:"",attributes:{},children:[]}]}));return[{name:"text",type:"element",attributes:{x:"0",y:"0",dx:"0",dy:"0",fill:g,"font-family":C_e,"font-size":x.toString(),"text-anchor":C,"dominant-baseline":b,transform:Pf(I),class:`pcb-silkscreen-text pcb-silkscreen-${c}`,"data-pcb-silkscreen-text-id":e.pcb_silkscreen_text_id,stroke:"none","data-type":"pcb_silkscreen_text","data-pcb-layer":c},children:P,value:""}]}function fhs(e,t){let{transform:n,layer:o,colorMap:r}=t,{center:i,width:s,height:a,layer:c="top",pcb_silkscreen_rect_id:l,stroke_width:h,is_filled:d,has_stroke:u,is_stroke_dashed:_,corner_radius:p,ccw_rotation:m=0}=e;if(o&&c!==o)return[];if(!i||typeof i.x!=="number"||typeof i.y!=="number"||typeof s!=="number"||typeof a!=="number")return i_(`[pcb_silkscreen_rect] Invalid data for "${l}": expected center {x: number, y: number}, width: number, height: number, got center=${JSON.stringify(i)}, width=${JSON.stringify(s)}, height=${JSON.stringify(a)}`),[];let[A,g]=Vt(n,[i.x,i.y]),f=typeof p==="number"&&p>0?p:0,y=f*Math.abs(n.a),x=f*Math.abs(n.d),C=s*Math.abs(n.a),b=a*Math.abs(n.d),I=h*Math.abs(n.a),v=c==="bottom"?r.silkscreen.bottom:r.silkscreen.top,P={x:(-C/2).toString(),y:(-b/2).toString(),width:C.toString(),height:b.toString(),class:`pcb-silkscreen-rect pcb-silkscreen-${c}`,"data-pcb-silkscreen-rect-id":l,"data-type":"pcb_silkscreen_rect","data-pcb-layer":c};if(typeof m==="number"&&m!==0)P.transform=`translate(${A} ${g}) rotate(${-m})`;else P.x=(A-C/2).toString(),P.y=(g-b/2).toString();if(y>0)P.rx=y.toString();if(x>0)P.ry=x.toString();P.fill=d?v:"none";let M;if(u===void 0)M=I>0;else M=u;if(M){if(P.stroke=v,P["stroke-width"]=I.toString(),_){let T=0.1*Math.abs(n.a),N=0.05*Math.abs(n.a);P["stroke-dasharray"]=`${T} ${N}`}}else P.stroke="none";return[{name:"rect",type:"element",attributes:P,value:"",children:[]}]}var Lp={copper:{top:"rgb(200, 52, 52)",inner1:"rgb(255, 140, 0)",inner2:"rgb(255, 215, 0)",inner3:"rgb(50, 205, 50)",inner4:"rgb(64, 224, 208)",inner5:"rgb(138, 43, 226)",inner6:"rgb(255, 105, 180)",inner7:"rgb(0, 191, 255)",inner8:"rgb(160, 82, 45)",bottom:"rgb(77, 127, 196)"},soldermaskWithCopperUnderneath:{top:"rgb(18, 82, 50)",bottom:"rgb(18, 82, 50)"},soldermask:{top:"rgb(12, 55, 33)",bottom:"rgb(12, 55, 33)"},soldermaskOverCopper:{top:"rgb(52, 135, 73)",bottom:"rgb(52, 135, 73)"},substrate:"rgb(201, 162, 110)",drill:"#FF26E2",silkscreen:{top:"#f2eda1",bottom:"#5da9e9"},boardOutline:"rgba(255, 255, 255, 0.5)",courtyard:{top:"#FF00FF",bottom:"rgb(38, 233, 255)"},keepout:"#FF6B6B",debugComponent:{fill:null,stroke:null}},CWa=Lp.drill,bWa=Lp.silkscreen.top,IWa=Lp.silkscreen.bottom,vWa={...Lp.copper};function f4(e,t=Lp){return t.copper[e]??"white"}var yhs={bottom:"rgb(105, 105, 105)",top:"rgb(105, 105, 105)"};function qne(e){return yhs[e]??"rgb(105, 105, 105)"}var _De=1,Jne=0.2,pfo=1.4,mfo=0.53,xhs=0;function Chs(e,t){let{transform:n,layer:o,colorMap:r}=t,{anchor_position:i,text:s,font_size:a="0.2mm",layer:c,ccw_rotation:l=0,anchor_alignment:h="center",is_knockout:d=!1,knockout_padding:u,is_mirrored:_=!1}=e,p=c??"top";if(o&&o!==p)return[];if(!i)return[];if(!s)return[];let[m,A]=Vt(n,[i.x,i.y]),g=un.parse(a)??0.2,f=Math.abs(n.a),y=f4(p,r),C=p==="bottom"?!0:_===!0;if(d){let M=g*mfo,B=hfo({text:s,anchorAlignment:h,fontSize:M,charAdvance:(_De+Jne)*M,spaceAdvance:(_De+Jne)*M*0.6,trailingSpacing:Jne*M,lineHeight:M*pfo,mapSegment:(te,ie,le,ue)=>({x1:ie+te.x1*ue,y1:le+(1-te.y1)*ue,x2:ie+te.x2*ue,y2:le+(1-te.y2)*ue})});if(!B.bounds||!B.pathData)return[];let T=u?.left??M*0.5,N=u?.right??M*0.5,D=u?.top??M*0.3,L=u?.bottom??M*0.3,H=B.bounds.minX-T,V=B.bounds.minY-D,O=B.bounds.maxX-B.bounds.minX+T+N,U=B.bounds.maxY-B.bounds.minY+D+L,j=M*0.15,Y={minX:H,minY:V,maxX:H+O,maxY:V+U},X=wft(h,Y),K=H+X.x,J=V+X.y,ee=[{name:"rect",type:"element",value:"",attributes:{x:H.toString(),y:V.toString(),width:O.toString(),height:U.toString(),fill:"white"},children:[]},{name:"path",type:"element",value:"",attributes:{d:B.pathData,fill:"none",stroke:"black","stroke-width":j.toString(),"stroke-linecap":"round","stroke-linejoin":"round"},children:[]}],ne=X.x!==0||X.y!==0?[{name:"g",type:"element",value:"",attributes:{transform:`translate(${X.x} ${X.y})`},children:ee}]:ee,re=Pf(va(Wc(m,A),T2(-l*Math.PI/180),...C?[kp(-1,1)]:[],kp(f,f))),Z=`knockout-mask-${e.pcb_copper_text_id}-${xhs++}`;return[{name:"defs",type:"element",value:"",children:[{name:"mask",type:"element",value:"",attributes:{id:Z},children:ne}],attributes:{}},{name:"rect",type:"element",value:"",children:[],attributes:{x:K.toString(),y:J.toString(),width:O.toString(),height:U.toString(),fill:y,mask:`url(#${Z})`,transform:re,class:`pcb-copper-text-knockout pcb-copper-${p}`,"data-type":"pcb_copper_text","data-pcb-copper-text-id":e.pcb_copper_text_id}}]}let b=g*mfo,I=hfo({text:s,anchorAlignment:h,fontSize:b,charAdvance:(_De+Jne)*b,spaceAdvance:(_De+Jne)*b*0.6,trailingSpacing:Jne*b,lineHeight:b*pfo,mapSegment:(M,B,T,N)=>({x1:B+M.x1*N,y1:T+(1-M.y1)*N,x2:B+M.x2*N,y2:T+(1-M.y2)*N})});if(!I.pathData)return[];let v=Pf(va(Wc(m,A),T2(-l*Math.PI/180),...C?[kp(-1,1)]:[],kp(f,f))),P=b*0.15;return[{name:"path",type:"element",attributes:{d:I.pathData,fill:"none",stroke:y,"stroke-width":P.toString(),"stroke-linecap":"round","stroke-linejoin":"round",transform:v,class:`pcb-copper-text pcb-copper-${p}`,"data-type":"pcb_copper_text","data-pcb-copper-text-id":e.pcb_copper_text_id},children:[],value:""}]}function bhs(e,t){let{transform:n,layer:o,colorMap:r}=t,{center:i,radius:s,layer:a="top",pcb_silkscreen_circle_id:c,stroke_width:l=1,is_filled:h}=e;if(o&&a!==o)return[];if(!i||typeof i.x!=="number"||typeof i.y!=="number"||typeof s!=="number")return console.error("Invalid PCB Silkscreen Circle data:",{center:i,radius:s}),[];let[d,u]=Vt(n,[i.x,i.y]),_=s*Math.abs(n.a),p=l*Math.abs(n.a),m=a==="bottom"?r.silkscreen.bottom:r.silkscreen.top;return[{name:"circle",type:"element",attributes:{cx:d.toString(),cy:u.toString(),r:_.toString(),class:`pcb-silkscreen-circle pcb-silkscreen-${a}`,fill:h?m:"none",stroke:m,"stroke-width":p.toString(),"data-pcb-silkscreen-circle-id":c,"data-type":"pcb_silkscreen_circle","data-pcb-layer":a},value:"",children:[]}]}function Ihs(e,t){let{transform:n,layer:o,colorMap:r}=t,{x1:i,y1:s,x2:a,y2:c,stroke_width:l,layer:h="top",pcb_silkscreen_line_id:d}=e;if(o&&h!==o)return[];if(typeof i!=="number"||typeof s!=="number"||typeof a!=="number"||typeof c!=="number")return i_(`[pcb_silkscreen_line] Invalid coordinates for "${d}": expected x1, y1, x2, y2 as numbers, got x1=${JSON.stringify(i)}, y1=${JSON.stringify(s)}, x2=${JSON.stringify(a)}, y2=${JSON.stringify(c)}`),[];let[u,_]=Vt(n,[i,s]),[p,m]=Vt(n,[a,c]),A=l*Math.abs(n.a),g=h==="bottom"?r.silkscreen.bottom:r.silkscreen.top;return[{name:"line",type:"element",attributes:{x1:u.toString(),y1:_.toString(),x2:p.toString(),y2:m.toString(),stroke:g,"stroke-width":A.toString(),class:`pcb-silkscreen-line pcb-silkscreen-${h}`,"data-pcb-silkscreen-line-id":d,"data-type":"pcb_silkscreen_line","data-pcb-layer":h},value:"",children:[]}]}function vhs(e,t){let{transform:n,layer:o,colorMap:r}=t,{center:i,width:s,height:a,layer:c="top",pcb_silkscreen_pill_id:l,ccw_rotation:h=0}=e;if(o&&c!==o)return[];let[d,u]=Vt(n,[i.x,i.y]),_=s*Math.abs(n.a),p=a*Math.abs(n.d),A=Math.min(s,a)/2,g=A*Math.abs(n.a),f=A*Math.abs(n.d),y=c==="bottom"?r.silkscreen.bottom:r.silkscreen.top;return[{name:"rect",type:"element",attributes:{x:(d-_/2).toString(),y:(u-p/2).toString(),width:_.toString(),height:p.toString(),rx:g.toString(),ry:f.toString(),fill:"none",stroke:y,"stroke-width":(0.1*Math.abs(n.a)).toString(),class:`pcb-silkscreen-pill pcb-silkscreen-${c}`,"data-pcb-silkscreen-pill-id":l,"data-type":"pcb_silkscreen_pill","data-pcb-layer":c,...h!==0&&{transform:`rotate(${-h} ${d} ${u})`}},value:"",children:[]}]}function Shs(e,t){let{transform:n,layer:o,colorMap:r}=t,{center:i,radius_x:s,radius_y:a,layer:c="top",pcb_silkscreen_oval_id:l,ccw_rotation:h=0}=e;if(o&&c!==o)return[];if(!i||typeof i.x!=="number"||typeof i.y!=="number"||typeof s!=="number"||typeof a!=="number")return i_(`[pcb_silkscreen_oval] Invalid data for "${l}": expected center {x: number, y: number}, radius_x: number, radius_y: number, got center=${JSON.stringify(i)}, radius_x=${JSON.stringify(s)}, radius_y=${JSON.stringify(a)}`),[];let[d,u]=Vt(n,[i.x,i.y]),_=s*Math.abs(n.a),p=a*Math.abs(n.d),m=c==="bottom"?r.silkscreen.bottom:r.silkscreen.top;return[{name:"ellipse",type:"element",attributes:{cx:d.toString(),cy:u.toString(),rx:_.toString(),ry:p.toString(),fill:"none",stroke:m,"stroke-width":(0.1*Math.abs(n.a)).toString(),class:`pcb-silkscreen-oval pcb-silkscreen-${c}`,"data-pcb-silkscreen-oval-id":l,"data-type":"pcb_silkscreen_oval","data-pcb-layer":c,...h!==0&&{transform:`rotate(${-h} ${d} ${u})`}},value:"",children:[]}]}function Phs(e,t){let{transform:n,layer:o,colorMap:r}=t,{center:i,width:s,height:a,layer:c="top",pcb_courtyard_rect_id:l,ccw_rotation:h=0}=e;if(o&&c!==o)return[];if(!i||typeof i.x!=="number"||typeof i.y!=="number"||typeof s!=="number"||typeof a!=="number")return i_(`[pcb_courtyard_rect] Invalid data for "${l}": expected center {x: number, y: number}, width: number, height: number, got center=${JSON.stringify(i)}, width=${JSON.stringify(s)}, height=${JSON.stringify(a)}`),[];let[d,u]=Vt(n,[i.x,i.y]),_=s*Math.abs(n.a),p=a*Math.abs(n.d),m=0.05*Math.abs(n.a),A=c==="bottom"?r.courtyard.bottom:r.courtyard.top,g={x:(-_/2).toString(),y:(-p/2).toString(),width:_.toString(),height:p.toString(),class:`pcb-courtyard-rect pcb-courtyard-${c}`,"data-pcb-courtyard-rect-id":l,"data-type":"pcb_courtyard_rect","data-pcb-layer":c,"stroke-linejoin":"round"};if(typeof h==="number"&&h!==0)g.transform=`translate(${d} ${u}) rotate(${-h})`;else g.x=(d-_/2).toString(),g.y=(u-p/2).toString();return g.fill="none",g.stroke=A,g["stroke-width"]=m.toString(),[{name:"rect",type:"element",attributes:g,value:"",children:[]}]}function Ehs(e,t){let{transform:n,layer:o,colorMap:r}=t,{layer:i="top",pcb_courtyard_polygon_id:s,points:a,color:c}=e;if(o&&i!==o)return[];if(!a||a.length===0)return i_(`[pcb_courtyard_polygon] Invalid data for "${s}": expected non-empty array of points, got ${JSON.stringify(a)}`),[];let h=a.map((m)=>Vt(n,[m.x,m.y])).map((m)=>`${m[0]},${m[1]}`).join(" "),d=0.05*Math.abs(n.a),u=c??(i==="bottom"?r.courtyard.bottom:r.courtyard.top);return[{name:"polygon",type:"element",attributes:{points:h,class:`pcb-courtyard-polygon pcb-courtyard-${i}`,"data-pcb-courtyard-polygon-id":s,"data-type":"pcb_courtyard_polygon","data-pcb-layer":i,fill:"none",stroke:u,"stroke-width":d.toString(),"stroke-linejoin":"round"},value:"",children:[]}]}function Mhs(e,t){let{transform:n,layer:o,colorMap:r}=t,{layer:i,pcb_courtyard_outline_id:s,outline:a}=e;if(o&&i!==o)return[];if(!a||a.length===0)return i_(`[pcb_courtyard_outline] Invalid data for "${s}": expected non-empty array of points, got ${JSON.stringify(a)}`),[];let l=a.map((p)=>Vt(n,[p.x,p.y])).map((p)=>`${p[0]},${p[1]}`).join(" "),h=0.05*Math.abs(n.a),d=i==="bottom"?r.courtyard.bottom:r.courtyard.top;return[{name:"polygon",type:"element",attributes:{points:l,class:`pcb-courtyard-outline pcb-courtyard-${i}`,"data-pcb-courtyard-outline-id":s,"data-type":"pcb_courtyard_outline","data-pcb-layer":i,fill:"none",stroke:d,"stroke-width":h.toString(),"stroke-linejoin":"round"},value:"",children:[]}]}function whs(e,t){let{transform:n,layer:o,colorMap:r}=t,{center:i,radius:s,layer:a="top",pcb_courtyard_circle_id:c}=e;if(o&&a!==o)return[];if(!i||typeof i.x!=="number"||typeof i.y!=="number"||typeof s!=="number")return console.error(`[pcb_courtyard_circle] Invalid data for "${c}": expected center {x: number, y: number}, radius: number, got center=${JSON.stringify(i)}, radius=${JSON.stringify(s)}`),[];let[l,h]=Vt(n,[i.x,i.y]),d=s*Math.abs(n.a),u=0.05*Math.abs(n.a),_=a==="bottom"?r.courtyard.bottom:r.courtyard.top,p={cx:l.toString(),cy:h.toString(),r:d.toString(),class:`pcb-courtyard-circle pcb-courtyard-${a}`,"data-pcb-courtyard-circle-id":c,"data-type":"pcb_courtyard_circle","data-pcb-layer":a};return p.fill="none",p.stroke=_,p["stroke-width"]=u.toString(),[{name:"circle",type:"element",attributes:p,value:"",children:[]}]}var y4=0.000000001;function Bhs(e,t){let{startIsInsideCopperPour:n,endIsInsideCopperPour:o,start:r,end:i}=e;if(n===o)return e;let s=OU(r),a=OU(i),c=Dhs(t).flatMap((_)=>Rhs(_,s,a));if(c.length===0)return e;let l=o?Math.min(...c):Math.max(...c),h=e2o(s,a,l),d=Ths(e.startWidth,e.endWidth,l),u={...e,start:n?h:r,end:o?h:i,startWidth:n?d:e.startWidth,endWidth:o?d:e.endWidth};return khs(u.start,u.end)?null:u}function Ths(e,t,n){return e+(t-e)*n}function Dhs(e){switch(e.shape){case"rect":return[Nhs(e)];case"polygon":return[e.points.map(OU)];case"brep":return[e.brep_shape.outer_ring.vertices.map(gfo),...e.brep_shape.inner_rings.map((t)=>t.vertices.map(gfo))]}}function Nhs(e){let t=OU(e.center),n=e.width/2,o=e.height/2,r=(e.rotation??0)*Math.PI/180,i=Math.cos(r),s=Math.sin(r);return[{x:-n,y:-o},{x:n,y:-o},{x:n,y:o},{x:-n,y:o}].map((a)=>({x:t.x+a.x*i-a.y*s,y:t.y+a.x*s+a.y*i}))}function Rhs(e,t,n){let o=[];for(let r=0;r<e.length;r++){let i=e[r],s=e[(r+1)%e.length];if(!i||!s)continue;if(i.bulge){o.push(...Qhs(t,n,i,s,i.bulge));continue}let a=Zfo(t,n,i,s);if(a!==null)o.push(a)}return o}function Qhs(e,t,n,o,r){let i=o.x-n.x,s=o.y-n.y,a=Math.hypot(i,s);if(a<y4||Math.abs(r)<y4){let x=Zfo(e,t,n,o);return x===null?[]:[x]}let c=a*(1-r**2)/(4*r),l={x:(n.x+o.x)/2-s/a*c,y:(n.y+o.y)/2+i/a*c},h=Math.atan2(n.y-l.y,n.x-l.x),d=4*Math.atan(r),u=Math.hypot(n.x-l.x,n.y-l.y),_={x:t.x-e.x,y:t.y-e.y},p={x:e.x-l.x,y:e.y-l.y},m=xft(_,_);if(m<y4)return[];let A=2*xft(p,_),g=xft(p,p)-u**2,f=A**2-4*m*g;if(f<-y4)return[];let y=Math.sqrt(Math.max(0,f));return[(-A-y)/(2*m),(-A+y)/(2*m)].filter((x)=>{if(x<-y4||x>1+y4)return!1;let C=e2o(e,t,x),b=Math.atan2(C.y-l.y,C.x-l.x);return(d>0?_fo(b-h):_fo(h-b))<=Math.abs(d)+y4})}function Zfo(e,t,n,o){let r={x:t.x-e.x,y:t.y-e.y},i={x:o.x-n.x,y:o.y-n.y},s=yft(r,i);if(Math.abs(s)<y4)return null;let a={x:n.x-e.x,y:n.y-e.y},c=yft(a,i)/s,l=yft(a,r)/s;if(c<-y4||c>1+y4||l<-y4||l>1+y4)return null;return Math.min(1,Math.max(0,c))}function yft(e,t){return e.x*t.y-e.y*t.x}function xft(e,t){return e.x*t.x+e.y*t.y}function _fo(e){let t=2*Math.PI,n=e%t;return n<0?n+t:n}function e2o(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function OU(e){return{x:un.parse(e.x),y:un.parse(e.y)}}function gfo(e){return{...OU(e),bulge:e.bulge}}function khs(e,t){let n=OU(e),o=OU(t);return Math.abs(n.x-o.x)<y4&&Math.abs(n.y-o.y)<y4}function Lhs(e){switch(e.route_type){case"through_pad":return[e.start,e.end];default:return[e]}}function Hhs(e){let t=[];for(let n=0;n<e.length-1;n++){let o=e[n],r=e[n+1];if(!o||!r)continue;let i=o.route_type==="through_pad"?o.end:o,s=r.route_type==="through_pad"?r.start:r,a=o.route_type==="wire"?o.layer:o.route_type==="through_pad"?o.end_layer:r.route_type==="wire"?r.layer:r.route_type==="through_pad"?r.start_layer:null;if(!a)continue;if(Fhs(i,s))continue;let c=Afo(o),l=Afo(r),h=Cft(o)??Cft(r)??0,d=Cft(r)??h;t.push({start:i,end:s,layer:a,width:h,startWidth:h,endWidth:d,isInsideCopperPour:c&&l,startIsInsideCopperPour:c,endIsInsideCopperPour:l,copperPourId:c?ffo(o):l?ffo(r):void 0})}for(let n of e){if(!n||n.route_type!=="through_pad")continue;for(let o of new Set([n.start_layer,n.end_layer]))t.push({start:n.start,end:n.end,layer:o,width:n.width,startWidth:n.width,endWidth:n.width,isInsideCopperPour:!1,startIsInsideCopperPour:!1,endIsInsideCopperPour:!1})}return t}function Cft(e){return"width"in e?un.parse(e.width):void 0}function Afo(e){return"is_inside_copper_pour"in e&&e.is_inside_copper_pour===!0}function ffo(e){if(!("copper_pour_id"in e))return;return e.copper_pour_id}function Fhs(e,t){let n=un.parse(e.x),o=un.parse(e.y),r=un.parse(t.x),i=un.parse(t.y);return n===r&&o===i}function zhs(e){let t=[],n=[];for(let o=0;o<e.length;o++){let r=e[o];if(!r)continue;let i=Ohs(e,o),s=Bft(-i.y,i.x),a=r.width/2;t.push({x:r.x+s.x*a,y:r.y+s.y*a}),n.push({x:r.x-s.x*a,y:r.y-s.y*a})}return t.concat(n.reverse())}function Ohs(e,t){if(e.length<2)return{x:1,y:0};if(t<=0)return gDe(e[0],e[1]);if(t>=e.length-1)return gDe(e[e.length-2],e[e.length-1]);let n=gDe(e[t-1],e[t]),o=gDe(e[t],e[t+1]),r=Bft(n.x+o.x,n.y+o.y);if(r.x!==0||r.y!==0)return r;if(n.x!==0||n.y!==0)return n;if(o.x!==0||o.y!==0)return o;return{x:1,y:0}}function gDe(e,t){if(!e||!t)return{x:1,y:0};let n=Bft(t.x-e.x,t.y-e.y);return n.x===0&&n.y===0?{x:1,y:0}:n}function Bft(e,t){let n=Math.hypot(e,t);if(n<=Number.EPSILON)return{x:0,y:0};return{x:e/n,y:t/n}}function t2o({elementType:e,shapeAttributes:t,layer:n,fillColor:o,fillOpacity:r,className:i,additionalAttributes:s}){let a={class:i,fill:o,"fill-opacity":r,"data-type":"pcb_soldermask","data-pcb-layer":n,...t,...s};return{name:e,type:"element",value:"",children:[],attributes:a}}function n2o(e,t){let{transform:n,colorMap:o}=t,r=t.layer??"top",i=t.showSolderMask&&(r==="top"||r==="bottom");if(i&&!e.layers.includes(r))return[];let s=t.boardOwnerMap?.has(e.pcb_via_id)?e.pcb_via_id:e.pcb_trace_id??e.pcb_via_id,a=t.boardOwnerMap?.get(s),c=e,l=(r==="top"?c.tented_on_top:c.tented_on_bottom)??c.is_tented??(r==="top"?a?.default_via_tented_on_top:a?.default_via_tented_on_bottom),[h,d]=Vt(n,[e.x,e.y]),u=e.outer_diameter*Math.abs(n.a),_=e.outer_diameter*Math.abs(n.a),p=e.hole_diameter*Math.abs(n.a),m=e.hole_diameter*Math.abs(n.a),A=Math.min(u,_)/2,g=Math.min(p,m)/2,f={name:"g",type:"element",value:"",attributes:{"data-type":"pcb_via","data-pcb-layer":i&&l?r:"through"},children:[{name:"circle",type:"element",value:"",children:[],attributes:{class:"pcb-hole-outer",fill:o.copper[i?r:"top"],cx:h.toString(),cy:d.toString(),r:A.toString(),"data-type":"pcb_via","data-pcb-layer":i?r:"top"}},{name:"circle",type:"element",value:"",children:[],attributes:{class:"pcb-hole-inner",fill:o.drill,cx:h.toString(),cy:d.toString(),r:g.toString(),"data-type":"pcb_via","data-pcb-layer":"drill"}}]};if(i&&l)f.children.push(t2o({elementType:"circle",shapeAttributes:{cx:h.toString(),cy:d.toString(),r:A.toString()},layer:r,fillColor:o.soldermaskWithCopperUnderneath[r],fillOpacity:"1",className:"pcb-via-tenting"}));return[f]}function o2o(e,t){if(e.shape==="rect"){let[n,o]=Vt(t,[e.center.x,e.center.y]),r=e.width*Math.abs(t.a),i=e.height*Math.abs(t.d),s=-(e.rotation??0);return{elementType:"rect",shapeAttributes:{x:(-r/2).toString(),y:(-i/2).toString(),width:r.toString(),height:i.toString(),transform:Pf(va(Wc(n,o),T2(s*Math.PI/180)))}}}if(e.shape==="polygon"){if(!e.points||e.points.length===0)return null;return{elementType:"polygon",shapeAttributes:{points:e.points.map((o)=>Vt(t,[o.x,o.y])).map((o)=>`${o[0]},${o[1]}`).join(" ")}}}if(e.shape==="brep"){let{brep_shape:n}=e,o=PDe(n.outer_ring.vertices,t);for(let r of n.inner_rings??[])o+=` ${PDe(r.vertices,t)}`;return{elementType:"path",shapeAttributes:{d:o,"fill-rule":"evenodd"}}}return null}function r2o(e){return`copper-pour-trace-mask-${e}`.replace(/[^a-zA-Z0-9_-]/g,"_")}function Vhs({layer:e,circuitJson:t}){for(let n of t){if(n.type!=="pcb_copper_pour")continue;if(n.layer!==e)continue;return r2o(e)}return}function Yhs({circuitJson:e,transform:t,svgWidth:n,svgHeight:o,usedMaskIds:r}){if(r.size===0)return null;let i=new Map;for(let a of e){if(a.type!=="pcb_copper_pour")continue;let c=a,l=r2o(c.layer);if(!r.has(l))continue;let h=i.get(l);if(h)h.push(c);else i.set(l,[c])}if(i.size===0)return null;let s=[];for(let[a,c]of i){let l=[{name:"rect",type:"element",value:"",children:[],attributes:{x:"0",y:"0",width:n.toString(),height:o.toString(),fill:"#fff"}}];for(let h of c){let d=o2o(h,t);if(!d)continue;l.push({name:d.elementType,type:"element",value:"",children:[],attributes:{...d.shapeAttributes,fill:"#000"}})}s.push({name:"mask",type:"element",value:"",children:l,attributes:{id:a,maskUnits:"userSpaceOnUse",x:"0",y:"0",width:n.toString(),height:o.toString()}})}return{name:"defs",type:"element",value:"",children:s,attributes:{class:"copper-pour-trace-mask-defs"}}}function Ghs(e){let t=[],n=new Map;for(let o of e){let r=o.attributes?.["data-type"],i=o.attributes?.mask;if(!(r==="pcb_trace"||r==="pcb_trace_soldermask")||!i?.includes("#copper-pour-trace-mask-")){t.push(o);continue}let a=n.get(i);if(!a){let p={name:"g",type:"element",value:"",children:[],attributes:{class:"pcb-trace-mask-group",mask:i}};a={object:p,pathsByAttributes:new Map},n.set(i,a),t.push(p)}let{mask:c,d:l="",...h}=o.attributes,d=JSON.stringify(h),u=a.pathsByAttributes.get(d);if(u){u.attributes.d+=` ${l}`;continue}let _={...o,attributes:{...h,d:l}};a.pathsByAttributes.set(d,_),a.object.children.push(_)}return t}function Uhs(e,t){let{transform:n,layer:o,colorMap:r,showSolderMask:i}=t;if(!e.route||!Array.isArray(e.route)||e.route.length<2)return[];let s=[],a=Jhs(t),c=new Map,l=[];for(let d of Hhs(e.route)){let u=d;if(u.isInsideCopperPour)continue;if(u.copperPourId&&u.startIsInsideCopperPour!==u.endIsInsideCopperPour){let p=t.circuitJson?.find((m)=>m.type==="pcb_copper_pour"&&m.pcb_copper_pour_id===u.copperPourId);if(p){let m=Bhs(u,p);if(!m)continue;u=m}}let _=u.layer;if(!_)continue;if(o&&_!==o)continue;l.push(u)}let h=(d)=>{if(!c.has(d))c.set(d,t.circuitJson?Vhs({layer:d,circuitJson:t.circuitJson}):void 0);let u=c.get(d);if(u)return t.usedCopperPourTraceMaskIds?.add(u),{mask:`url(#${u})`};return{}};if(e.route_thickness_mode==="interpolated")for(let d of Whs(l)){let u=d[0]?.layer;if(!u)continue;let _=Xhs(d,n);if(!_)continue;let p=f4(u,r),m=r.soldermaskWithCopperUnderneath[u];s.push({name:"path",type:"element",value:"",children:[],attributes:{class:i?"pcb-soldermask":"pcb-trace",fill:i?m:p,stroke:"none",d:_,"shape-rendering":"geometricPrecision","data-type":i?"pcb_trace_soldermask":"pcb_trace","data-pcb-layer":u,...h(u)}})}else for(let d of l){let u=Vt(n,[d.start.x,d.start.y]),_=Vt(n,[d.end.x,d.end.y]),p=d.layer,m=f4(p,r),A=r.soldermaskWithCopperUnderneath[p],g=d.width?(d.width*Math.abs(n.a)).toString():"0.3",f=h(p);if(i){let y={name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-soldermask",stroke:A,fill:"none",d:`M ${u[0]} ${u[1]} L ${_[0]} ${_[1]}`,"stroke-width":g,"stroke-linecap":"round","stroke-linejoin":"round","shape-rendering":"crispEdges","data-type":"pcb_trace_soldermask","data-pcb-layer":p,...f}};s.push(y)}else{let y={name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-trace",stroke:m,fill:"none",d:`M ${u[0]} ${u[1]} L ${_[0]} ${_[1]}`,"stroke-width":g,"stroke-linecap":"round","stroke-linejoin":"round","shape-rendering":"crispEdges","data-type":"pcb_trace","data-pcb-layer":p,...f}};s.push(y)}}for(let[d,u]of e.route.entries()){if(!u||u.route_type!=="via")continue;if(a.has(i2o(u)))continue;s.push(...n2o(Khs(e,u,d,t),t))}return s}function Whs(e){let t=[];for(let n of e){let o=t[t.length-1],r=o?.[o.length-1];if(o&&r?.layer===n.layer&&jhs(r.end,n.start))o.push(n);else t.push([n])}return t}function Xhs(e,t){let n=e[0];if(!n)return"";let o=[{x:un.parse(n.start.x),y:un.parse(n.start.y),width:n.startWidth},...e.map((c)=>({x:un.parse(c.end.x),y:un.parse(c.end.y),width:c.endWidth}))],i=zhs(o).map((c)=>Vt(t,[c.x,c.y])),[s,...a]=i;if(!s)return"";return[`M ${s[0]} ${s[1]}`,...a.map((c)=>`L ${c[0]} ${c[1]}`),"Z"].join(" ")}function jhs(e,t){return un.parse(e.x)===un.parse(t.x)&&un.parse(e.y)===un.parse(t.y)}function Khs(e,t,n,o){let r=$hs(e.route,n),i=o.boardOwnerMap?.get(e.pcb_trace_id),{holeDiameter:s,outerDiameter:a}=qhs(i,r);return{type:"pcb_via",pcb_via_id:`${e.pcb_trace_id}_route_via_${n}`,pcb_trace_id:e.pcb_trace_id,subcircuit_id:e.subcircuit_id,pcb_group_id:e.pcb_group_id,x:t.x,y:t.y,outer_diameter:a,hole_diameter:s,layers:[t.from_layer,t.to_layer],tented_on_top:t.tented_on_top,tented_on_bottom:t.tented_on_bottom}}function $hs(e,t){let n=yfo(e,t,-1),o=yfo(e,t,1);return Math.max(n??0,o??0)}function yfo(e,t,n){for(let o=t+n;o>=0&&o<e.length;o+=n){let r=e[o];if(!r||!("width"in r)||typeof r.width!=="number")continue;return r.width}return}function qhs(e,t){let n=EDe(e?.min_via_hole_diameter),o=EDe(e?.min_via_pad_diameter),r=Math.max(t,0.3),i=Math.max(r*2,0.6);return{holeDiameter:n??r,outerDiameter:o??i}}function Jhs(e){return new Set(e.circuitJson?.filter((t)=>t.type==="pcb_via").map((t)=>i2o(t))??[])}function i2o(e){let t=EDe(e.x),n=EDe(e.y);if(t!==void 0&&n!==void 0)return`${t}:${n}`;return`${String(e.x)}:${String(e.y)}`}function EDe(e){if(e===null||e===void 0)return;let t=un.safeParse(e);return t.success?t.data:void 0}function Zhs(e,t){let{transform:n,layer:o,colorMap:r,showSolderMask:i}=t;if(o&&e.layer!==o)return[];let s=$fo(e,t.circuitJson),a=Boolean(e?.is_covered_with_solder_mask),c=i&&a,l=r.soldermaskWithCopperUnderneath[e.layer]??r.soldermaskWithCopperUnderneath.top,h=(e.soldermask_margin??0)*Math.abs(n.a);if(e.shape==="rect"||e.shape==="rotated_rect"){let d=e.width*Math.abs(n.a),u=e.height*Math.abs(n.d),[_,p]=Vt(n,[e.x,e.y]),A=(e.corner_radius??e.rect_border_radius??0)*Math.abs(n.a),g={left:(e.soldermask_margin_left??e.soldermask_margin??0)*Math.abs(n.a),right:(e.soldermask_margin_right??e.soldermask_margin??0)*Math.abs(n.a),top:(e.soldermask_margin_top??e.soldermask_margin??0)*Math.abs(n.a),bottom:(e.soldermask_margin_bottom??e.soldermask_margin??0)*Math.abs(n.a)},f=g.left<0||g.right<0||g.top<0||g.bottom<0,y=g.left===0&&g.right===0&&g.top===0&&g.bottom===0;if(e.shape==="rotated_rect"&&e.ccw_rotation){let P={name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-pad",fill:f4(e.layer,r),x:(-d/2).toString(),y:(-u/2).toString(),width:d.toString(),height:u.toString(),transform:`translate(${_} ${p}) rotate(${-e.ccw_rotation})`,"data-type":"pcb_smtpad","data-pcb-layer":e.layer,...s,...A?{rx:A.toString(),ry:A.toString()}:{}}};if(!c)return[P];let M=d+g.left+g.right,B=u+g.top+g.bottom,T=A?A+h:0;if(f){let D={name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-pad-covered",fill:l,x:(-d/2).toString(),y:(-u/2).toString(),width:d.toString(),height:u.toString(),transform:`translate(${_} ${p}) rotate(${-e.ccw_rotation})`,"data-type":"pcb_smtpad","data-pcb-layer":e.layer,...A?{rx:A.toString(),ry:A.toString()}:{}}},L={name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-pad-exposed",fill:f4(e.layer,r),x:(-d/2-g.left).toString(),y:(-u/2-g.top).toString(),width:M.toString(),height:B.toString(),transform:`translate(${_} ${p}) rotate(${-e.ccw_rotation})`,"data-type":"pcb_soldermask","data-pcb-layer":e.layer,...T>0?{rx:T.toString(),ry:T.toString()}:{}}};return[D,L]}if(y)return[{name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-pad-covered",fill:l,x:(-d/2).toString(),y:(-u/2).toString(),width:d.toString(),height:u.toString(),transform:`translate(${_} ${p}) rotate(${-e.ccw_rotation})`,"data-type":"pcb_smtpad","data-pcb-layer":e.layer,...A?{rx:A.toString(),ry:A.toString()}:{}}}];return[{name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-soldermask-cutout",fill:r.substrate,x:(-d/2-g.left).toString(),y:(-u/2-g.top).toString(),width:M.toString(),height:B.toString(),transform:`translate(${_} ${p}) rotate(${-e.ccw_rotation})`,...T>0?{rx:T.toString(),ry:T.toString()}:{},"data-type":"pcb_soldermask_opening","data-pcb-layer":e.layer}},P]}let x={name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-pad",fill:f4(e.layer,r),x:(_-d/2).toString(),y:(p-u/2).toString(),width:d.toString(),height:u.toString(),"data-type":"pcb_smtpad","data-pcb-layer":e.layer,...s,...A?{rx:A.toString(),ry:A.toString()}:{}}};if(!c)return[x];let C=d+g.left+g.right,b=u+g.top+g.bottom,I=A?A+h:0;if(f){let P={name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-pad-covered",fill:l,x:(_-d/2).toString(),y:(p-u/2).toString(),width:d.toString(),height:u.toString(),"data-type":"pcb_smtpad","data-pcb-layer":e.layer,...A?{rx:A.toString(),ry:A.toString()}:{}}},M={name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-pad-exposed",fill:f4(e.layer,r),x:(_-d/2-g.left).toString(),y:(p-u/2-g.top).toString(),width:C.toString(),height:b.toString(),"data-type":"pcb_soldermask","data-pcb-layer":e.layer,...I>0?{rx:I.toString(),ry:I.toString()}:{}}};return[P,M]}if(y)return[{name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-pad-covered",fill:l,x:(_-d/2).toString(),y:(p-u/2).toString(),width:d.toString(),height:u.toString(),...I>0?{rx:A.toString(),ry:A.toString()}:{},"data-type":"pcb_smtpad","data-pcb-layer":e.layer}}];return[{name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-soldermask-cutout",fill:r.substrate,x:(_-d/2-g.left).toString(),y:(p-u/2-g.top).toString(),width:C.toString(),height:b.toString(),...I>0?{rx:I.toString(),ry:I.toString()}:{},"data-type":"pcb_soldermask_opening","data-pcb-layer":e.layer}},x]}if(e.shape==="pill"||e.shape==="rotated_pill"){let d=e.shape==="rotated_pill",u=e.width*Math.abs(n.a),_=e.height*Math.abs(n.d),p=e.radius*Math.abs(n.a),[m,A]=Vt(n,[e.x,e.y]),g=d?{transform:`translate(${m} ${A}) rotate(${-(e.ccw_rotation??0)})`}:void 0,f={class:"pcb-pad",fill:f4(e.layer,r),x:d?(-u/2).toString():(m-u/2).toString(),y:d?(-_/2).toString():(A-_/2).toString(),width:u.toString(),height:_.toString(),rx:p.toString(),ry:p.toString(),"data-type":"pcb_smtpad","data-pcb-layer":e.layer,...s,...g??{}},y={name:"rect",type:"element",value:"",children:[],attributes:f};if(!c)return[y];let x=u+2*h,C=_+2*h,b=p+h;if(h<0){let P={name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-pad-covered",fill:l,x:d?(-u/2).toString():(m-u/2).toString(),y:d?(-_/2).toString():(A-_/2).toString(),width:u.toString(),height:_.toString(),rx:p.toString(),ry:p.toString(),"data-type":"pcb_smtpad","data-pcb-layer":e.layer,...g??{}}},M={class:"pcb-pad-exposed",fill:f4(e.layer,r),x:d?(-x/2).toString():(m-x/2).toString(),y:d?(-C/2).toString():(A-C/2).toString(),width:x.toString(),height:C.toString(),rx:b.toString(),ry:b.toString(),"data-type":"pcb_soldermask","data-pcb-layer":e.layer,...g??{}};return[P,{name:"rect",type:"element",value:"",children:[],attributes:M}]}if(h===0)return[{name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-pad-covered",fill:l,x:d?(-u/2).toString():(m-u/2).toString(),y:d?(-_/2).toString():(A-_/2).toString(),width:u.toString(),height:_.toString(),rx:p.toString(),ry:p.toString(),"data-type":"pcb_smtpad","data-pcb-layer":e.layer,...g??{}}}];let I={class:"pcb-soldermask-cutout",fill:r.substrate,x:d?(-x/2).toString():(m-x/2).toString(),y:d?(-C/2).toString():(A-C/2).toString(),width:x.toString(),height:C.toString(),rx:b.toString(),ry:b.toString(),"data-type":"pcb_soldermask_opening","data-pcb-layer":e.layer,...g??{}};return[{name:"rect",type:"element",value:"",children:[],attributes:I},y]}if(e.shape==="circle"){let d=e.radius*Math.abs(n.a),[u,_]=Vt(n,[e.x,e.y]),p={name:"circle",type:"element",value:"",children:[],attributes:{class:"pcb-pad",fill:f4(e.layer,r),cx:u.toString(),cy:_.toString(),r:d.toString(),"data-type":"pcb_smtpad","data-pcb-layer":e.layer,...s}};if(!c)return[p];let m=d+h;if(h<0){let g={name:"circle",type:"element",value:"",children:[],attributes:{class:"pcb-pad-covered",fill:l,cx:u.toString(),cy:_.toString(),r:d.toString(),"data-type":"pcb_smtpad","data-pcb-layer":e.layer}},f={name:"circle",type:"element",value:"",children:[],attributes:{class:"pcb-pad-exposed",fill:f4(e.layer,r),cx:u.toString(),cy:_.toString(),r:m.toString(),"data-type":"pcb_soldermask","data-pcb-layer":e.layer}};return[g,f]}if(h===0)return[{name:"circle",type:"element",value:"",children:[],attributes:{class:"pcb-pad-covered",fill:l,cx:u.toString(),cy:_.toString(),r:d.toString(),"data-type":"pcb_smtpad","data-pcb-layer":e.layer}}];return[{name:"circle",type:"element",value:"",children:[],attributes:{class:"pcb-soldermask-cutout",fill:r.substrate,cx:u.toString(),cy:_.toString(),r:m.toString(),"data-type":"pcb_soldermask_opening","data-pcb-layer":e.layer}},p]}if(e.shape==="polygon"){let d=(e.points??[]).map((m)=>Vt(n,[m.x,m.y])),u={name:"polygon",type:"element",value:"",children:[],attributes:{class:"pcb-pad",fill:f4(e.layer,r),points:d.map((m)=>m.join(",")).join(" "),"data-type":"pcb_smtpad","data-pcb-layer":e.layer,...s}};if(!c)return[u];let _=d;if(h!==0){let m=d.reduce((g,f)=>g+f[0],0)/d.length,A=d.reduce((g,f)=>g+f[1],0)/d.length;_=d.map(([g,f])=>{let y=g-m,x=f-A,C=Math.sqrt(y*y+x*x);if(C===0)return[g,f];let b=y/C,I=x/C;return[g+b*h,f+I*h]})}if(h<0){let m={name:"polygon",type:"element",value:"",children:[],attributes:{class:"pcb-pad-covered",fill:l,points:d.map((g)=>g.join(",")).join(" "),"data-type":"pcb_smtpad","data-pcb-layer":e.layer}},A={name:"polygon",type:"element",value:"",children:[],attributes:{class:"pcb-pad-exposed",fill:f4(e.layer,r),points:_.map((g)=>g.join(",")).join(" "),"data-type":"pcb_soldermask","data-pcb-layer":e.layer}};return[m,A]}if(h===0)return[{name:"polygon",type:"element",value:"",children:[],attributes:{class:"pcb-pad-covered",fill:l,points:d.map((A)=>A.join(",")).join(" "),"data-type":"pcb_smtpad","data-pcb-layer":e.layer}}];return[{name:"polygon",type:"element",value:"",children:[],attributes:{class:"pcb-soldermask-cutout",fill:r.substrate,points:_.map((m)=>m.join(",")).join(" "),"data-type":"pcb_soldermask_opening","data-pcb-layer":e.layer}},u]}return[]}var xfo=0.05,SC=4,Cfo=8,s2o=11,ooe=1,toe=5,bfo=1.5,a2o=2,bft=toe+2,Ift=a2o+2,__e=toe+SC+6,eds=15,tds=10,nds=0.2,ods=50;function Tft(e){let{groupAnchorPosition:t,componentPosition:n,transform:o,componentWidth:r=0,componentHeight:i=0,displayXOffset:s,displayYOffset:a}=e,c=[],[l,h]=Vt(o,[t.x,t.y]),[d,u]=Vt(o,[n.x,n.y]),_=n.x-t.x,p=n.y-t.y,m=Math.abs(o.a),A=r*m,g=i*m;c.push(ids(l,h));let f=rds(l,h,d,u);c.push({name:"line",type:"element",attributes:{x1:f.x1.toString(),y1:f.y1.toString(),x2:f.x2.toString(),y2:f.y2.toString(),stroke:"#ffffff","stroke-width":"0.5","stroke-dasharray":"3,3",opacity:"0.5",class:"anchor-offset-connector"},children:[],value:""}),c.push({name:"circle",type:"element",attributes:{cx:d.toString(),cy:u.toString(),r:a2o.toString(),fill:"#ffffff",opacity:"0.7",class:"anchor-offset-component-marker"},children:[],value:""});let y=Math.abs(u-h),x=Math.abs(d-l),C=Math.sqrt(x*x+y*y),b=g/2+eds,I=Math.max(b,Math.min(ods,C*nds)),v=p>0?u-I:u+I,P=A/2+tds,M=_>0?d+P:d-P;if(ADe(v,h)||ADe(v,u)){let B=Math.min(h,u),T=Math.max(h,u),N=B-__e,D=T+__e;v=Math.abs(v-N)<Math.abs(v-D)?N:D}if(ADe(M,l)||ADe(M,d)){let B=Math.min(l,d),T=Math.max(l,d),N=B-__e,D=T+__e;M=Math.abs(M-N)<Math.abs(M-D)?N:D}if(Math.abs(_)>xfo)c.push(...sds({startX:l,endX:d,y:v,offsetMm:_,offsetY:p,displayOffset:s}));if(Math.abs(p)>xfo)c.push(...ads({x:M,startY:h,endY:u,offsetMm:p,offsetX:_,displayOffset:a}));return c}function rds(e,t,n,o){let r=n-e,i=o-t,s=Math.hypot(r,i),a=bft+Ift;if(!(s>a))return{x1:e,y1:t,x2:n,y2:o};let c=r/s,l=i/s;return{x1:e+c*bft,y1:t+l*bft,x2:n-c*Ift,y2:o-l*Ift}}function ADe(e,t){return Math.abs(e-t)<__e}function ids(e,t){return{name:"g",type:"element",attributes:{class:"anchor-offset-marker","data-type":"anchor_offset_marker"},children:[{name:"line",type:"element",attributes:{x1:e.toString(),y1:(t-toe).toString(),x2:e.toString(),y2:(t+toe).toString(),stroke:"#ffffff","stroke-width":bfo.toString(),"stroke-linecap":"round"},children:[],value:""},{name:"line",type:"element",attributes:{x1:(e-toe).toString(),y1:t.toString(),x2:(e+toe).toString(),y2:t.toString(),stroke:"#ffffff","stroke-width":bfo.toString(),"stroke-linecap":"round"},children:[],value:""}],value:""}}function sds({startX:e,endX:t,y:n,offsetMm:o,offsetY:r,displayOffset:i}){let s=[];s.push({name:"line",type:"element",attributes:{x1:e.toString(),y1:n.toString(),x2:t.toString(),y2:n.toString(),stroke:"#ffffff","stroke-width":ooe.toString(),class:"anchor-offset-dimension-x"},children:[],value:""}),s.push({name:"line",type:"element",attributes:{x1:e.toString(),y1:(n-SC).toString(),x2:e.toString(),y2:(n+SC).toString(),stroke:"#ffffff","stroke-width":ooe.toString()},children:[],value:""}),s.push({name:"line",type:"element",attributes:{x1:t.toString(),y1:(n-SC).toString(),x2:t.toString(),y2:(n+SC).toString(),stroke:"#ffffff","stroke-width":ooe.toString()},children:[],value:""});let a=(e+t)/2,c=r>0?n-SC-Cfo:n+SC+Cfo;return s.push({name:"text",type:"element",attributes:{x:a.toString(),y:c.toString(),fill:"#ffffff","font-size":s2o.toString(),"font-family":"Arial, sans-serif","text-anchor":"middle","dominant-baseline":r>0?"baseline":"hanging",class:"anchor-offset-label"},children:[{type:"text",value:c2o("X",o,i),name:"",attributes:{},children:[]}],value:""}),s}function ads({x:e,startY:t,endY:n,offsetMm:o,offsetX:r,displayOffset:i}){let s=[];s.push({name:"line",type:"element",attributes:{x1:e.toString(),y1:t.toString(),x2:e.toString(),y2:n.toString(),stroke:"#ffffff","stroke-width":ooe.toString(),class:"anchor-offset-dimension-y"},children:[],value:""}),s.push({name:"line",type:"element",attributes:{x1:(e-SC).toString(),y1:t.toString(),x2:(e+SC).toString(),y2:t.toString(),stroke:"#ffffff","stroke-width":ooe.toString()},children:[],value:""}),s.push({name:"line",type:"element",attributes:{x1:(e-SC).toString(),y1:n.toString(),x2:(e+SC).toString(),y2:n.toString(),stroke:"#ffffff","stroke-width":ooe.toString()},children:[],value:""});let a=(t+n)/2,c=r<0?e-SC-4:e+SC+4;return s.push({name:"text",type:"element",attributes:{x:c.toString(),y:a.toString(),fill:"#ffffff","font-size":s2o.toString(),"font-family":"Arial, sans-serif","text-anchor":r<0?"end":"start","dominant-baseline":"middle",class:"anchor-offset-label"},children:[{type:"text",value:c2o("Y",o,i),name:"",attributes:{},children:[]}],value:""}),s}function c2o(e,t,n){let o=typeof n==="string"?n:t.toFixed(2),i=typeof o==="string"&&o.trim().endsWith("mm")?"":"mm";return`${e}: ${o}${i}`}function f_e(e){let t=e?.anchor_position??e?.center;if(t&&typeof t.x==="number"&&typeof t.y==="number")return{x:t.x,y:t.y};return}function cds(e,t){let{transform:n,colorMap:o,showSolderMask:r,circuitJson:i}=t,{width:s,height:a,center:c,outline:l,position_mode:h,anchor_position:d,display_offset_x:u,display_offset_y:_}=e,p;if(l&&Array.isArray(l)&&l.length>=3)p=l.map((A,g)=>{let[f,y]=Vt(n,[A.x,A.y]);return g===0?`M ${f} ${y}`:`L ${f} ${y}`}).join(" ");else{let A=s/2,g=a/2,f=Vt(n,[c.x-A,c.y-g]),y=Vt(n,[c.x+A,c.y-g]),x=Vt(n,[c.x+A,c.y+g]),C=Vt(n,[c.x-A,c.y+g]);p=`M ${f[0]} ${f[1]} L ${y[0]} ${y[1]} L ${x[0]} ${x[1]} L ${C[0]} ${C[1]}`}p+=" Z";let m=[];if(r){let g=(t.layer??"top")==="bottom"?"soldermask-bottom":"soldermask-top";m.push({name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-board-soldermask",d:p,fill:o.soldermask.top,"fill-opacity":"0.8",stroke:"none","data-type":"pcb_soldermask","data-pcb-layer":g}})}if(m.push({name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-board",d:p,fill:"none",stroke:o.boardOutline,"stroke-width":(0.1*Math.abs(n.a)).toString(),"data-type":"pcb_board","data-pcb-layer":"board"}}),t.showAnchorOffsets&&i&&h==="relative_to_panel_anchor"){let A=i.find((g)=>g.type==="pcb_panel");if(A){let g=f_e(A);if(g)m.push(...Tft({groupAnchorPosition:g,componentPosition:d??c,transform:n,componentWidth:s,componentHeight:a,displayXOffset:u,displayYOffset:_}))}}return m}function lds(e,t){let{transform:n,colorMap:o,showSolderMask:r}=t,i=Number(e.width),s=Number(e.height),a=e.center??{x:i/2,y:s/2},c=i/2,l=s/2,h=Vt(n,[a.x-c,a.y-l]),d=Vt(n,[a.x+c,a.y-l]),u=Vt(n,[a.x+c,a.y+l]),_=Vt(n,[a.x-c,a.y+l]),p=`M ${h[0]} ${h[1]} L ${d[0]} ${d[1]} L ${u[0]} ${u[1]} L ${_[0]} ${_[1]} Z`,m=e.covered_with_solder_mask!==!1,A=Boolean(r&&m);return[{name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-panel",d:p,fill:"none",stroke:o.boardOutline,"stroke-width":(0.1*Math.abs(n.a)).toString(),"data-type":"pcb_panel","data-pcb-layer":"board"}}]}function hds(e,t){let{transform:n,colorMap:o,showSolderMask:r}=t,i=t.layer??"top",[s,a]=Vt(n,[e.x,e.y]),c=Boolean(e.is_covered_with_solder_mask),l=(e.soldermask_margin??0)*Math.abs(n.a),h=r&&c&&l!==0,d=o.soldermask.top;if(e.hole_shape==="circle"||e.hole_shape==="square"){let u=e.hole_diameter*Math.abs(n.a),_=u/2;if(e.hole_shape==="circle"){let g={name:"circle",type:"element",attributes:{class:"pcb-hole",cx:s.toString(),cy:a.toString(),r:_.toString(),fill:o.drill,"data-type":"pcb_hole","data-pcb-layer":"drill"},children:[],value:""};if(!h)return[g];let f=_+l;if(l<0){let x={name:"circle",type:"element",value:"",children:[],attributes:{class:"pcb-hole-covered",fill:d,cx:s.toString(),cy:a.toString(),r:_.toString(),"data-type":"pcb_hole","data-pcb-layer":"drill"}},C={name:"circle",type:"element",value:"",children:[],attributes:{class:"pcb-hole-exposed",fill:o.drill,cx:s.toString(),cy:a.toString(),r:f.toString(),"data-type":"pcb_soldermask","data-pcb-layer":"drill"}};return[x,C]}return[{name:"circle",type:"element",value:"",children:[],attributes:{class:"pcb-soldermask-cutout",fill:o.substrate,cx:s.toString(),cy:a.toString(),r:f.toString(),"data-type":"pcb_soldermask_opening","data-pcb-layer":i}},g]}let p={name:"rect",type:"element",attributes:{class:"pcb-hole",x:(s-_).toString(),y:(a-_).toString(),width:u.toString(),height:u.toString(),fill:o.drill,"data-type":"pcb_hole","data-pcb-layer":"drill"},children:[],value:""};if(!h)return[p];let m=u+2*l;if(l<0){let g={name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-hole-covered",fill:d,x:(s-_).toString(),y:(a-_).toString(),width:u.toString(),height:u.toString(),"data-type":"pcb_hole","data-pcb-layer":"drill"}},f={name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-hole-exposed",fill:o.drill,x:(s-m/2).toString(),y:(a-m/2).toString(),width:m.toString(),height:m.toString(),"data-type":"pcb_soldermask","data-pcb-layer":"drill"}};return[g,f]}return[{name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-soldermask-cutout",fill:o.substrate,x:(s-m/2).toString(),y:(a-m/2).toString(),width:m.toString(),height:m.toString(),"data-type":"pcb_soldermask_opening","data-pcb-layer":i}},p]}if(e.hole_shape==="oval"){let u=e.hole_width*Math.abs(n.a),_=e.hole_height*Math.abs(n.a),p=u/2,m=_/2,A={name:"ellipse",type:"element",attributes:{class:"pcb-hole",cx:s.toString(),cy:a.toString(),rx:p.toString(),ry:m.toString(),fill:o.drill,"data-type":"pcb_hole","data-pcb-layer":"drill"},children:[],value:""};if(!h)return[A];let g=p+l,f=m+l;if(l<0){let x={name:"ellipse",type:"element",value:"",children:[],attributes:{class:"pcb-hole-covered",fill:d,cx:s.toString(),cy:a.toString(),rx:p.toString(),ry:m.toString(),"data-type":"pcb_hole","data-pcb-layer":"drill"}},C={name:"ellipse",type:"element",value:"",children:[],attributes:{class:"pcb-hole-exposed",fill:o.drill,cx:s.toString(),cy:a.toString(),rx:g.toString(),ry:f.toString(),"data-type":"pcb_soldermask","data-pcb-layer":"drill"}};return[x,C]}return[{name:"ellipse",type:"element",value:"",children:[],attributes:{class:"pcb-soldermask-cutout",fill:o.substrate,cx:s.toString(),cy:a.toString(),rx:g.toString(),ry:f.toString(),"data-type":"pcb_soldermask_opening","data-pcb-layer":i}},A]}if(e.hole_shape==="rect"){let u=e.hole_width*Math.abs(n.a),_=e.hole_height*Math.abs(n.a),p={name:"rect",type:"element",attributes:{class:"pcb-hole",x:(s-u/2).toString(),y:(a-_/2).toString(),width:u.toString(),height:_.toString(),fill:o.drill,"data-type":"pcb_hole","data-pcb-layer":"drill"},children:[],value:""};if(!h)return[p];let m=u+2*l,A=_+2*l;if(l<0){let f={name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-hole-covered",fill:d,x:(s-u/2).toString(),y:(a-_/2).toString(),width:u.toString(),height:_.toString(),"data-type":"pcb_hole","data-pcb-layer":"drill"}},y={name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-hole-exposed",fill:o.drill,x:(s-m/2).toString(),y:(a-A/2).toString(),width:m.toString(),height:A.toString(),"data-type":"pcb_soldermask","data-pcb-layer":"drill"}};return[f,y]}return[{name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-soldermask-cutout",fill:o.substrate,x:(s-m/2).toString(),y:(a-A/2).toString(),width:m.toString(),height:A.toString(),"data-type":"pcb_soldermask_opening","data-pcb-layer":i}},p]}if(e.hole_shape==="pill"){let u=e.hole_width*Math.abs(n.a),_=e.hole_height*Math.abs(n.a),p=u>_,m=Math.min(u,_)/2,A=Math.abs(p?u-_:_-u),g=p?`M${s-A/2},${a-m} h${A} a${m},${m} 0 0 1 0,${_} h-${A} a${m},${m} 0 0 1 0,-${_} z`:`M${s-m},${a-A/2} v${A} a${m},${m} 0 0 0 ${u},0 v-${A} a${m},${m} 0 0 0 -${u},0 z`,f={name:"path",type:"element",attributes:{class:"pcb-hole",fill:o.drill,d:g,"data-type":"pcb_hole","data-pcb-layer":"drill"},children:[],value:""};if(!h)return[f];let y=u+2*l,x=_+2*l,C=y>x,b=Math.min(y,x)/2,I=Math.abs(C?y-x:x-y),v=C?`M${s-I/2},${a-b} h${I} a${b},${b} 0 0 1 0,${x} h-${I} a${b},${b} 0 0 1 0,-${x} z`:`M${s-b},${a-I/2} v${I} a${b},${b} 0 0 0 ${y},0 v-${I} a${b},${b} 0 0 0 -${y},0 z`;if(l<0){let M={name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-hole-covered",fill:d,d:g,"data-type":"pcb_hole","data-pcb-layer":"drill"}},B={name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-hole-exposed",fill:o.drill,d:v,"data-type":"pcb_soldermask","data-pcb-layer":"drill"}};return[M,B]}return[{name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-soldermask-cutout",fill:o.substrate,d:v,"data-type":"pcb_soldermask_opening","data-pcb-layer":i}},f]}if(e.hole_shape==="rotated_pill"){let u=e.hole_width*Math.abs(n.a),_=e.hole_height*Math.abs(n.a),p="ccw_rotation"in e?e.ccw_rotation??0:0,m=u>_,A=Math.min(u,_)/2,g=Math.abs(m?u-_:_-u),f=m?`M${-g/2},${-A} h${g} a${A},${A} 0 0 1 0,${_} h-${g} a${A},${A} 0 0 1 0,-${_} z`:`M${-A},${-g/2} v${g} a${A},${A} 0 0 0 ${u},0 v-${g} a${A},${A} 0 0 0 -${u},0 z`,y={name:"path",type:"element",attributes:{class:"pcb-hole",fill:o.drill,d:f,transform:`translate(${s} ${a}) rotate(${-p})`,"data-type":"pcb_hole","data-pcb-layer":"drill"},children:[],value:""};if(!h)return[y];let x=u+2*l,C=_+2*l,b=x>C,I=Math.min(x,C)/2,v=Math.abs(b?x-C:C-x),P=b?`M${-v/2},${-I} h${v} a${I},${I} 0 0 1 0,${C} h-${v} a${I},${I} 0 0 1 0,-${C} z`:`M${-I},${-v/2} v${v} a${I},${I} 0 0 0 ${x},0 v-${v} a${I},${I} 0 0 0 -${x},0 z`;if(l<0){let B={name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-hole-covered",fill:d,d:f,transform:`translate(${s} ${a}) rotate(${-p})`,"data-type":"pcb_hole","data-pcb-layer":"drill"}},T={name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-hole-exposed",fill:o.drill,d:P,transform:`translate(${s} ${a}) rotate(${-p})`,"data-type":"pcb_soldermask","data-pcb-layer":"drill"}};return[B,T]}return[{name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-soldermask-cutout",fill:o.substrate,d:P,"data-type":"pcb_soldermask_opening","data-pcb-layer":i}},y]}return[]}var dds=(e,t)=>{let n=ug(t).pcb_smtpad.get(e);if(n&&"x"in n&&"y"in n)return{x:n.x,y:n.y};let o=ug(t).pcb_plated_hole.get(e);if(o&&"x"in o&&"y"in o)return{x:o.x,y:o.y};return null},uds=(e,t,n,o)=>{let r=n.getIdsConnectedToNet(t),i=null,s=1/0;for(let a of r){let c=dds(a,o);if(c){let l=e.x-c.x,h=e.y-c.y,d=Math.sqrt(l*l+h*h);if(d>0&&d<s)s=d,i=c}}return i};function pds(e,t){let{transform:n}=t,o=Aa(e),r=e.filter((c)=>c.type==="pcb_port"),i=e.filter((c)=>c.type==="source_trace"),s=[];r.forEach((c,l)=>{let h=c.pcb_port_id;if(!h)return;let d=o.getNetConnectedToId(h);if(!d)return;let u=!1,_=ug(e).source_port.getWhere({pcb_port_id:h});if(_&&_.source_port_id){let A=_.source_port_id;for(let g of i)if(Array.isArray(g.connected_source_port_ids)&&g.connected_source_port_ids.includes(A)&&Array.isArray(g.connected_source_net_ids)&&g.connected_source_net_ids.length>0){u=!0;break}}let p={x:c.x,y:c.y},m=uds(p,d,o,e);if(!m)return;s.push({key:`${h}-${l}`,startPoint:p,endPoint:m,isInNet:u})});let a=[];for(let c of s){let l=Vt(n,[c.startPoint.x,c.startPoint.y]),h=Vt(n,[c.endPoint.x,c.endPoint.y]),d={x1:l[0].toString(),y1:l[1].toString(),x2:h[0].toString(),y2:h[1].toString(),stroke:"white","stroke-width":"1","stroke-dasharray":"6,6","data-type":"pcb_rats_nest","data-pcb-layer":"overlay"};a.push({name:"line",type:"element",attributes:d,value:"",children:[]})}return a}function mds(e,t){let{transform:n,colorMap:o}=t;if(e.shape==="rect"){let r=e,[i,s]=Vt(n,[r.center.x,r.center.y]),a=r.width*Math.abs(n.a),c=r.height*Math.abs(n.d),l=-(r.rotation??0),{corner_radius:h}=r,d=typeof h==="number"&&h>0?h:0,u=d*Math.abs(n.a),_=d*Math.abs(n.d),p={class:"pcb-cutout pcb-cutout-rect",x:(-a/2).toString(),y:(-c/2).toString(),width:a.toString(),height:c.toString(),fill:o.drill,transform:Pf(va(Wc(i,s),T2(l*Math.PI/180))),"data-type":"pcb_cutout","data-pcb-layer":"drill"};if(u>0)p.rx=u.toString();if(_>0)p.ry=_.toString();return[{name:"rect",type:"element",attributes:p,children:[],value:""}]}if(e.shape==="circle"){let r=e,[i,s]=Vt(n,[r.center.x,r.center.y]),a=r.radius*Math.abs(n.a);return[{name:"circle",type:"element",attributes:{class:"pcb-cutout pcb-cutout-circle",cx:i.toString(),cy:s.toString(),r:a.toString(),fill:o.drill,"data-type":"pcb_cutout","data-pcb-layer":"drill"},children:[],value:""}]}if(e.shape==="polygon"){let r=e;if(!r.points||r.points.length===0)return[];return[{name:"polygon",type:"element",attributes:{class:"pcb-cutout pcb-cutout-polygon",points:r.points.map((a)=>Vt(n,[a.x,a.y])).map((a)=>`${a[0]},${a[1]}`).join(" "),fill:o.drill,"data-type":"pcb_cutout","data-pcb-layer":"drill"},children:[],value:""}]}return[]}function _ds(e,t){let{transform:n,colorMap:o}=t;if(!e.route||!Array.isArray(e.route))return[];let r=e.route[0],i=e.route[e.route.length-1],s=r&&i&&r.x===i.x&&r.y===i.y;return[{name:"path",type:"element",attributes:{class:"pcb-cutout pcb-cutout-path",d:e.route.slice(0,s?-1:void 0).map((c,l)=>{let[h,d]=Vt(n,[c.x,c.y]);return l===0?`M ${h} ${d}`:`L ${h} ${d}`}).join(" ")+(s?" Z":""),fill:o.drill,"data-type":"pcb_cutout_path","data-pcb-cutout-id":e.pcb_cutout_id,"data-pcb-layer":"drill"},value:"",children:[]}]}var l2o="pcb-keepout-pattern",noe=20,gds=5,Ifo="rgba(255, 107, 107, 0.2)";function Ads(e){let t=[];for(let n=-noe;n<=noe;n+=gds)t.push({name:"line",type:"element",value:"",attributes:{x1:n.toString(),y1:"0",x2:(n+noe).toString(),y2:noe.toString(),stroke:e,"stroke-width":"1"},children:[]});return t}function fds(e){return{name:"defs",type:"element",value:"",attributes:{},children:[{name:"pattern",type:"element",value:"",attributes:{id:l2o,width:noe.toString(),height:noe.toString(),patternUnits:"userSpaceOnUse"},children:Ads(e)}]}}function vfo(e,t,n,o){let r={class:`pcb-keepout ${n} pcb-keepout-background`,"data-type":"pcb_keepout","data-pcb-layer":t,"data-pcb-keepout-id":e,stroke:"none"};if(o)r["data-description"]=o;return r}function Sfo(e,t,n,o){let r={class:`pcb-keepout ${n} pcb-keepout-pattern`,fill:`url(#${l2o})`,"data-type":"pcb_keepout","data-pcb-layer":t,"data-pcb-keepout-id":e,stroke:"none"};if(o)r["data-description"]=o;return r}function yds(e,t){let{transform:n,layer:o,colorMap:r}=t;if(o&&!e.layers.includes(o))return[];let i=[],s=r.keepout;for(let a of e.layers){if(o&&a!==o)continue;if(e.shape==="rect"){let c=e,[l,h]=Vt(n,[c.center.x,c.center.y]),d=c.width*Math.abs(n.a),u=c.height*Math.abs(n.d),_=Pf(va(Wc(l,h))),p={...vfo(c.pcb_keepout_id,a,"pcb-keepout-rect",c.description),x:(-d/2).toString(),y:(-u/2).toString(),width:d.toString(),height:u.toString(),fill:Ifo,transform:_},m={...Sfo(c.pcb_keepout_id,a,"pcb-keepout-rect",c.description),x:(-d/2).toString(),y:(-u/2).toString(),width:d.toString(),height:u.toString(),transform:_};i.push({name:"rect",type:"element",attributes:p,children:[],value:""},{name:"rect",type:"element",attributes:m,children:[],value:""})}else if(e.shape==="circle"){let c=e,[l,h]=Vt(n,[c.center.x,c.center.y]),d=c.radius*Math.abs(n.a),u={...vfo(c.pcb_keepout_id,a,"pcb-keepout-circle",c.description),cx:l.toString(),cy:h.toString(),r:d.toString(),fill:Ifo},_={...Sfo(c.pcb_keepout_id,a,"pcb-keepout-circle",c.description),cx:l.toString(),cy:h.toString(),r:d.toString()};i.push({name:"circle",type:"element",attributes:u,children:[],value:""},{name:"circle",type:"element",attributes:_,children:[],value:""})}}return i}function xds({elementType:e,shapeAttributes:t,layer:n,colorMap:o,additionalAttributes:r}){let i={class:"pcb-soldermask-cutout",fill:o.substrate,"data-type":"pcb_soldermask_opening","data-pcb-layer":n,...t,...r};return{name:e,type:"element",value:"",children:[],attributes:i}}function Cds(e,t){let{transform:n,layer:o,colorMap:r,showSolderMask:i}=t,{layer:s}=e;if(o&&s!==o)return[];let a=o2o(e,n);if(!a)return[];let{elementType:c,shapeAttributes:l}=a,h=f4(s,r),d="0.5",u=e.covered_with_solder_mask!==!1,_=s==="bottom"?r.soldermaskOverCopper.bottom:r.soldermaskOverCopper.top,p="0.9",m={name:c,type:"element",value:"",children:[],attributes:{class:`pcb-copper-pour pcb-copper-pour-${e.shape}`,...l,fill:h,"fill-opacity":d,"data-type":"pcb_copper_pour","data-pcb-layer":s}},A=i?u?t2o({elementType:c,shapeAttributes:l,layer:s,fillColor:_,fillOpacity:p,className:"pcb-soldermask-covered-pour"}):xds({elementType:c,shapeAttributes:l,layer:s,colorMap:r}):null;if(!A)return[m];if(!u&&e.pcb_copper_pour_id?.includes("substrate_only"))return[A];return[m,A]}function bds(e,t){let{transform:n,layer:o}=t;if(o&&e.layer!==o)return[];let[r,i]=Vt(n,[e.x,e.y]);if(e.shape==="rect"||e.shape==="rotated_rect"){let s=e.width*Math.abs(n.a),a=e.height*Math.abs(n.d);if(e.shape==="rotated_rect"&&e.ccw_rotation)return[{name:"rect",type:"element",attributes:{class:"pcb-solder-paste",fill:qne(e.layer),x:(-s/2).toString(),y:(-a/2).toString(),width:s.toString(),height:a.toString(),transform:`translate(${r} ${i}) rotate(${-e.ccw_rotation})`,"data-type":"pcb_solder_paste","data-pcb-layer":e.layer}}];return[{name:"rect",type:"element",attributes:{class:"pcb-solder-paste",fill:qne(e.layer),x:(r-s/2).toString(),y:(i-a/2).toString(),width:s.toString(),height:a.toString(),"data-type":"pcb_solder_paste","data-pcb-layer":e.layer}}]}if(e.shape==="pill"){let s=e.width*Math.abs(n.a),a=e.height*Math.abs(n.d),c=e.radius*Math.abs(n.a);return[{name:"rect",type:"element",attributes:{class:"pcb-solder-paste",fill:qne(e.layer),x:(r-s/2).toString(),y:(i-a/2).toString(),width:s.toString(),height:a.toString(),rx:c.toString(),"data-type":"pcb_solder_paste","data-pcb-layer":e.layer}}]}if(e.shape==="rotated_pill"){let s=e.width*Math.abs(n.a),a=e.height*Math.abs(n.d),c=e.radius*Math.abs(n.a);return[{name:"rect",type:"element",attributes:{class:"pcb-solder-paste",fill:qne(e.layer),x:(-s/2).toString(),y:(-a/2).toString(),width:s.toString(),height:a.toString(),rx:c.toString(),transform:`translate(${r} ${i}) rotate(${-e.ccw_rotation})`,"data-type":"pcb_solder_paste","data-pcb-layer":e.layer}}]}if(e.shape==="oval"){let s=e.width*Math.abs(n.a),a=e.height*Math.abs(n.d);return[{name:"ellipse",type:"element",attributes:{class:"pcb-solder-paste",fill:qne(e.layer),cx:r.toString(),cy:i.toString(),rx:(s/2).toString(),ry:(a/2).toString(),"data-type":"pcb_solder_paste","data-pcb-layer":e.layer}}]}if(e.shape==="circle"){let s=e.radius*Math.abs(n.a);return[{name:"circle",type:"element",attributes:{class:"pcb-solder-paste",fill:qne(e.layer),cx:r.toString(),cy:i.toString(),r:s.toString(),"data-type":"pcb_solder_paste","data-pcb-layer":e.layer}}]}}var Ids="rgba(255, 255, 255, 0.5)",Pfo="pcb-grid-pattern";function vds({grid:e,svgWidth:t,svgHeight:n}){if(!e)return{};let o=e.lineColor??Ids,{cellSize:r,majorCellSize:i}=e,s=e.majorLineColor??o;if(i!==void 0){if(!r||r<=0)throw Error("grid.majorCellSize requires a positive grid.cellSize");if(i<=0)throw Error("grid.majorCellSize must be a positive multiple of grid.cellSize");let d=i/r,u=Math.round(d);if(!Number.isFinite(d)||Math.abs(d-u)>0.000001)throw Error("grid.majorCellSize must be a positive multiple of grid.cellSize")}if(!r||r<=0)return{};let a=i!==void 0,c=a?Sds(r,i,o,s):[{name:"path",type:"element",value:"",attributes:{d:`M ${r} 0 L 0 0 0 ${r}`,fill:"none",stroke:o,"stroke-width":"1","shape-rendering":"crispEdges"},children:[]}],l={name:"defs",type:"element",value:"",attributes:{},children:[{name:"pattern",type:"element",value:"",attributes:{id:Pfo,width:a?i.toString():r.toString(),height:a?i.toString():r.toString(),patternUnits:"userSpaceOnUse"},children:c}]},h={name:"rect",type:"element",value:"",attributes:{x:"0",y:"0",width:t.toString(),height:n.toString(),fill:`url(#${Pfo})`,"pointer-events":"none","data-type":"pcb_grid","data-pcb-layer":"global"},children:[]};return{defs:l,rect:h}}function Sds(e,t,n,o){let r=[],i=Math.round(t/e);for(let s=0;s<i;s+=1){let c=Number((s*e).toFixed(6)).toString(),l=s===0?o:n,h=t.toString();r.push({name:"line",type:"element",value:"",attributes:{x1:c,y1:"0",x2:c,y2:h,stroke:l,"stroke-width":"1","shape-rendering":"crispEdges"},children:[]}),r.push({name:"line",type:"element",value:"",attributes:{x1:"0",y1:c,x2:h,y2:c,stroke:l,"stroke-width":"1","shape-rendering":"crispEdges"},children:[]})}return r}function Pds(e,t){let{transform:n,circuitJson:o}=t,{center:r,width:i,height:s,rotation:a=0}=e,[c,l]=Vt(n,[r.x,r.y]),h=i*Math.abs(n.a),d=s*Math.abs(n.d),u=`translate(${c}, ${l}) rotate(${-a}) scale(1, -1)`,_=[];if(t.showAnchorOffsets&&o&&e.position_mode==="relative_to_group_anchor"&&(e.positioned_relative_to_pcb_group_id||e.positioned_relative_to_pcb_board_id)){let p=Eds(e,o);if(p)_.push(...Tft({groupAnchorPosition:p,componentPosition:r,transform:n,componentWidth:i,componentHeight:s,displayXOffset:e.display_offset_x,displayYOffset:e.display_offset_y}))}if(!t.colorMap.debugComponent?.fill&&!t.colorMap.debugComponent?.stroke)return _;return _.push({name:"g",type:"element",attributes:{transform:u,"data-type":"pcb_component","data-pcb-layer":e.layer??"top"},children:[{name:"rect",type:"element",attributes:{class:"pcb-component",x:(-h/2).toString(),y:(-d/2).toString(),width:h.toString(),height:d.toString(),fill:t.colorMap.debugComponent.fill??"transparent",stroke:t.colorMap.debugComponent.stroke??"transparent","data-type":"pcb_component","data-pcb-layer":e.layer??"top"}}],value:""}),_}function Eds(e,t){if(e.positioned_relative_to_pcb_group_id){let n=t.find((r)=>r.type==="pcb_group"&&r.pcb_group_id===e.positioned_relative_to_pcb_group_id),o=f_e(n);if(o)return o}if(e.positioned_relative_to_pcb_board_id){let n=t.find((r)=>r.type==="pcb_board"&&r.pcb_board_id===e.positioned_relative_to_pcb_board_id),o=f_e(n);if(o)return o}return}var Efo=["rgba(100, 200, 255, 0.6)","rgba(255, 150, 100, 0.6)","rgba(100, 255, 150, 0.6)","rgba(200, 100, 255, 0.6)","rgba(255, 220, 100, 0.6)","rgba(255, 100, 200, 0.6)","rgba(100, 255, 255, 0.6)","rgba(180, 255, 100, 0.6)"],Mds=0.1;function wds(e,t){let{transform:n,circuitJson:o}=t,{center:r,width:i,height:s}=e,a=[];if(t.showAnchorOffsets&&e.position_mode==="relative_to_group_anchor"&&o){let v=Tds(e,o);if(v)a.push(...Tft({groupAnchorPosition:v,componentPosition:e.anchor_position??e.center,transform:n,componentWidth:e.width,componentHeight:e.height,displayXOffset:e.display_offset_x,displayYOffset:e.display_offset_y}))}let c=Array.isArray(e.outline)?e.outline:void 0,l=Mds*Math.abs(n.a),h=0.3*Math.abs(n.a),d=0.15*Math.abs(n.a),u={class:"pcb-group",fill:"none",stroke:Bds(e.pcb_group_id),"stroke-width":l.toString(),"stroke-dasharray":`${h} ${d}`,"data-type":"pcb_group","data-pcb-group-id":e.pcb_group_id,"data-pcb-layer":"overlay"};if(e.name)u["data-group-name"]=e.name;if(c&&c.length>=3&&c.every((v)=>v&&typeof v.x==="number"&&typeof v.y==="number")){let v=c.map((P,M)=>{let[B,T]=Vt(n,[P.x,P.y]);return M===0?`M ${B} ${T}`:`L ${B} ${T}`}).join(" ");return a.push({name:"path",type:"element",value:"",children:[],attributes:{...u,d:`${v} Z`}}),a}if(!r||typeof r.x!=="number"||typeof r.y!=="number"||typeof i!=="number"||typeof s!=="number")return i_(`[pcb_group] Invalid data for "${e.pcb_group_id}"${e.name?` (name: "${e.name}")`:""}: expected center {x: number, y: number}, width: number, height: number, got center=${JSON.stringify(r)}, width=${JSON.stringify(i)}, height=${JSON.stringify(s)}`),a;let _=i/2,p=s/2,[m,A]=Vt(n,[r.x-_,r.y+p]),[g,f]=Vt(n,[r.x+_,r.y-p]),y=Math.min(m,g),x=Math.min(A,f),C=Math.abs(g-m),b=Math.abs(f-A),I={name:"rect",type:"element",value:"",attributes:{...u,x:y.toString(),y:x.toString(),width:C.toString(),height:b.toString()},children:[]};return a.push(I),a}function Bds(e){let t=e.match(/(\d+)$/),n=t?Number.parseInt(t[1],10):0;return Efo[n%Efo.length]}function Tds(e,t){if(e.positioned_relative_to_pcb_group_id){let n=t.find((r)=>r.type==="pcb_group"&&r.pcb_group_id===e.positioned_relative_to_pcb_group_id),o=f_e(n);if(o)return o}if(e.positioned_relative_to_pcb_board_id){let n=t.find((r)=>r.type==="pcb_board"&&r.pcb_board_id===e.positioned_relative_to_pcb_board_id),o=f_e(n);if(o)return o}return}function h2o(e){return e.find((n)=>n.type==="project_software_metadata"||n.type==="source_project_metadata")?.software_used_string}var Dds={name:"circuit-to-svg",type:"module",version:"0.0.431",repository:{type:"git",url:"https://github.com/tscircuit/circuit-to-svg.git"},description:"Convert Circuit JSON to SVG",main:"dist/index.js",files:["dist"],scripts:{start:"cosmos",prepublish:"npm run build",prepare:"node scripts/prepare-git.cjs",build:"tsup-node ./lib/index.ts --format esm --dts --sourcemap --external tscircuit",format:"biome format . --write","format:check":"biome format .",cosmos:"cosmos","cosmos-export":"cosmos-export"},license:"ISC",devDependencies:{"@biomejs/biome":"^1.9.4","@resvg/resvg-js":"^2.6.2","@tscircuit/alphabet":"^0.0.27","@tscircuit/checks-latest":"npm:@tscircuit/checks@0.0.179","@types/bun":"^1.2.8","@types/debug":"^4.1.12","@vitejs/plugin-react":"5.0.0",biome:"^0.3.3","bun-match-svg":"^0.0.12","circuit-json":"^0.0.491",esbuild:"^0.20.2","format-si-unit":"^0.0.12","performance-now":"^2.1.0",react:"19.1.0","react-cosmos":"7.0.0","react-cosmos-plugin-vite":"7.0.0","react-dom":"19.1.0",tscircuit:"^0.0.2629",tsup:"^8.0.2",typescript:"^5.4.5","vite-tsconfig-paths":"^5.0.1"},peerDependencies:{"@tscircuit/alphabet":"*"},dependencies:{"@types/node":"^22.5.5","bun-types":"^1.1.40","calculate-elbow":"0.0.12",debug:"^4.4.3","svg-path-commander":"^2.1.11",svgson:"^5.3.1","transformation-matrix":"^2.16.1"}},d2o=Dds.version,Nds={pcb_background:0,pcb_boundary:1,pcb_panel:5,pcb_board:10,pcb_cutout:15,pcb_cutout_path:15,pcb_keepout:16,pcb_hole:18,pcb_plated_hole_drill:19,pcb_plated_hole:20,pcb_trace_soldermask:25,pcb_trace:30,pcb_smtpad:30,pcb_copper_pour:35,pcb_via:36,pcb_soldermask:40,pcb_soldermask_opening:25,pcb_solder_paste:45,pcb_silkscreen_text:50,pcb_silkscreen_path:50,pcb_silkscreen_graphic:50,pcb_silkscreen_rect:50,pcb_silkscreen_circle:50,pcb_silkscreen_line:50,pcb_silkscreen_oval:50,pcb_silkscreen_pill:50,pcb_component:60,pcb_pad_pin_number:65,pcb_fabrication_note_text:70,pcb_fabrication_note_path:70,pcb_fabrication_note_rect:70,pcb_fabrication_note_dimension:70,pcb_note_dimension:70,pcb_note_text:70,pcb_note_rect:70,pcb_note_path:70,pcb_note_line:70,pcb_trace_error:80,pcb_footprint_overlap_error:80,pcb_component_outside_board_error:80,pcb_pad_trace_clearance_error:80,pcb_via_trace_clearance_error:80,pcb_connector_not_in_accessible_orientation_warning:80,pcb_manual_edit_conflict_warning:80,pcb_rats_nest:85,pcb_debug_object:90},Mfo=100;function Rds(e){return e.map((t,n)=>({object:t,index:n,layerPriority:Qds(t.attributes?.["data-pcb-layer"]??void 0),typePriority:kds(t.attributes?.["data-type"]??void 0)})).sort((t,n)=>{if(t.layerPriority!==n.layerPriority)return t.layerPriority-n.layerPriority;if(t.typePriority!==n.typePriority)return t.typePriority-n.typePriority;return t.index-n.index}).map(({object:t})=>t)}function Qds(e){if(!e)return 500;let t=e.toLowerCase();if(t==="global")return-100;if(t==="bottom")return 4;if(t==="board")return 2;if(t==="soldermask-top"||t==="soldermask-bottom")return 3;if(t.startsWith("inner")){let n=t.match(/\d+/);return 5+(n?Number.parseInt(n[0],10):0)}if(t==="through")return 18;if(t==="top")return 17;if(t==="drill")return 30;if(t==="overlay")return 40;return 10}function kds(e){if(!e)return Mfo;return Nds[e]??Mfo}function Lds({objects:e,layer:t,width:n,height:o,showSolderMask:r=!1}){let i=e.filter((h)=>h.attributes["data-pcb-layer"]===t&&(h.attributes.class==="pcb-pad"||h.attributes.class==="pcb-pad-exposed"||h.attributes["data-type"]==="pcb_soldermask_opening"));if(i.length===0)return null;let s=e.filter((h)=>h.attributes["data-type"]==="pcb_via").flatMap((h)=>h.children).filter((h)=>h.attributes.class==="pcb-via-tenting"),a=e.filter((h)=>r&&h.attributes["data-pcb-layer"]===t&&(h.attributes["data-type"]==="pcb_copper_pour"||h.attributes.class==="pcb-soldermask-covered-pour")),c=i.filter((h)=>h.attributes.class==="pcb-pad"||h.attributes.class==="pcb-pad-exposed"),l=[];for(let{targets:h,cutouts:d,maskId:u}of[{targets:s,cutouts:i,maskId:`via-tenting-mask-${t}`},{targets:a,cutouts:c,maskId:`copper-pour-pad-opening-mask-${t}`}]){if(h.length===0||d.length===0)continue;for(let _ of h)_.attributes.mask=`url(#${u})`;l.push(Hds(u,d,n,o))}if(l.length===0)return null;return{name:"defs",type:"element",value:"",attributes:{},children:l}}function Hds(e,t,n,o){return{name:"mask",type:"element",value:"",attributes:{id:e,maskUnits:"userSpaceOnUse",x:"0",y:"0",width:String(n),height:String(o)},children:[{name:"rect",type:"element",value:"",attributes:{x:"0",y:"0",width:String(n),height:String(o),fill:"white"},children:[]},...t.map((r)=>({...r,attributes:{...r.attributes,fill:"black"}}))]}}function u2o(e,t="error_text_overlay"){let n=e.filter((i)=>i.type.endsWith("_error"));if(n.length===0)return null;let o=n.map((i)=>i.message).filter((i)=>!!i);if(o.length===0)return null;return{name:"text",type:"element",value:"",attributes:{x:"10",y:"20",fill:"red","font-family":"monospace","font-size":"12px","data-type":t,"data-layer":"global"},children:o.map((i,s)=>({name:"tspan",type:"element",value:"",attributes:{x:"10",dy:s===0?"0":"1.2em"},children:[{type:"text",value:i,name:"",attributes:{},children:[]}]}))}}function Fds({anchorPosition:e,textWidth:t,textHeight:n,anchorAlignment:o}){switch(o){case"top_left":return{x:e.x+t/2,y:e.y+n/2};case"top_center":return{x:e.x,y:e.y+n/2};case"top_right":return{x:e.x-t/2,y:e.y+n/2};case"center_left":return{x:e.x+t/2,y:e.y};case"center_right":return{x:e.x-t/2,y:e.y};case"bottom_left":return{x:e.x+t/2,y:e.y-n/2};case"bottom_center":return{x:e.x,y:e.y-n/2};case"bottom_right":return{x:e.x-t/2,y:e.y-n/2};case"center":default:return e}}function zds(e){let{POSITIVE_INFINITY:t,POSITIVE_INFINITY:n,NEGATIVE_INFINITY:o,NEGATIVE_INFINITY:r}=Number,i=!1,{POSITIVE_INFINITY:s,POSITIVE_INFINITY:a,NEGATIVE_INFINITY:c,NEGATIVE_INFINITY:l}=Number,h=!1;for(let y of e)if(y.type==="pcb_panel"){let x=y,C=un.parse(x.width),b=un.parse(x.height);if(C===void 0||b===void 0)continue;let I=x.center??{x:C/2,y:b/2};d({center:I,width:C,height:b})}else if(y.type==="pcb_board"){if(y.outline&&Array.isArray(y.outline)&&y.outline.length>=3)_(y.outline),p(y.outline);else if("center"in y&&"width"in y&&"height"in y)d({center:y.center,width:y.width,height:y.height}),u({center:y.center,width:y.width,height:y.height})}else if(y.type==="pcb_courtyard_rect")d({center:y.center,width:y.width,height:y.height,ccwRotationDegrees:y.ccw_rotation});else if(y.type==="pcb_smtpad"){let x=y;if(x.shape==="rect"||x.shape==="pill")d({center:{x:x.x,y:x.y},width:x.width,height:x.height});else if(x.shape==="rotated_rect"||x.shape==="rotated_pill")d({center:{x:x.x,y:x.y},width:x.width,height:x.height,ccwRotationDegrees:x.ccw_rotation});else if(x.shape==="circle"){let C=un.parse(x.radius);if(C!==void 0)d({center:{x:x.x,y:x.y},width:C*2,height:C*2})}else if(x.shape==="polygon")m(x.points)}else if(y.type==="pcb_via"){let x=un.parse(y.outer_diameter);d({center:{x:y.x,y:y.y},width:x??0,height:x??0})}else if(y.type==="pcb_plated_hole"){let x=y,C={x:x.x,y:x.y};if(x.shape==="circle"){let b=un.parse(x.outer_diameter);d({center:C,width:b??0,height:b??0})}else if(x.shape==="oval"||x.shape==="pill")d({center:C,width:x.outer_width,height:x.outer_height});else if(x.shape==="circular_hole_with_rect_pad"||x.shape==="pill_hole_with_rect_pad")d({center:C,width:x.rect_pad_width,height:x.rect_pad_height});else if(x.shape==="rotated_pill_hole_with_rect_pad")d({center:C,width:x.rect_pad_width,height:x.rect_pad_height,ccwRotationDegrees:x.rect_ccw_rotation});else if(x.shape==="hole_with_polygon_pad")m((x.pad_outline??[]).map((b)=>({x:x.x+b.x,y:x.y+b.y})))}else if(y.type==="pcb_hole"){let x=y,C={x:x.x,y:x.y};if(x.hole_shape==="circle"||x.hole_shape==="square"){let b=un.parse(x.hole_diameter);d({center:C,width:b??0,height:b??0})}else if(x.hole_shape==="rotated_pill")d({center:C,width:x.hole_width,height:x.hole_height,ccwRotationDegrees:x.ccw_rotation});else if(x.hole_shape==="oval"||x.hole_shape==="rect"||x.hole_shape==="pill")d({center:C,width:x.hole_width,height:x.hole_height})}else if(y.type==="pcb_note_line")m([{x:y.x1,y:y.y1},{x:y.x2,y:y.y2}]);else if("x"in y&&"y"in y)d({center:{x:y.x,y:y.y},width:0,height:0});else if("route"in y)m(y.route);else if(y.type==="pcb_note_rect"||y.type==="pcb_fabrication_note_rect")d({center:y.center,width:y.width,height:y.height});else if(y.type==="pcb_note_dimension"||y.type==="pcb_fabrication_note_dimension"){let x=y,{from:C,to:b,text:I,font_size:v=1,arrow_size:P,offset_distance:M,offset_direction:B}=x;if(!C||!b||!P)continue;d({center:C,width:0,height:0}),d({center:b,width:0,height:0});let T=(le)=>{let ue=Math.hypot(le.x,le.y)||1;return{x:le.x/ue,y:le.y/ue}},N=T({x:b.x-C.x,y:b.y-C.y});if(Number.isNaN(N.x)||Number.isNaN(N.y))continue;let D={x:-N.y,y:N.x},L=B&&typeof B.x==="number"&&typeof B.y==="number",H=L?T(B):{x:0,y:0},V=typeof M==="number"?M:0,O={x:H.x*V,y:H.y*V},U={x:C.x+O.x,y:C.y+O.y},j={x:b.x+O.x,y:b.y+O.y};d({center:U,width:0,height:0}),d({center:j,width:0,height:0});let Y=L&&(Math.abs(H.x)>Number.EPSILON||Math.abs(H.y)>Number.EPSILON)?H:D,X=V+P,K={x:C.x+Y.x*X,y:C.y+Y.y*X},J={x:b.x+Y.x*X,y:b.y+Y.y*X};d({center:K,width:0,height:0}),d({center:J,width:0,height:0});let ee=P/2,se={x:U.x+N.x*P,y:U.y+N.y*P},ne={x:j.x-N.x*P,y:j.y-N.y*P},re={x:se.x+D.x*ee,y:se.y+D.y*ee},Z={x:se.x-D.x*ee,y:se.y-D.y*ee};d({center:re,width:0,height:0}),d({center:Z,width:0,height:0});let te={x:ne.x+D.x*ee,y:ne.y+D.y*ee},ie={x:ne.x-D.x*ee,y:ne.y-D.y*ee};if(d({center:te,width:0,height:0}),d({center:ie,width:0,height:0}),I){let le={x:(C.x+b.x)/2+O.x,y:(C.y+b.y)/2+O.y},ue=P*1.5,de={x:le.x+D.x*ue,y:le.y+D.y*ue},me=I.length*v*0.6;d({center:de,width:me,height:v})}}else if(y.type==="pcb_note_text"||y.type==="pcb_fabrication_note_text")g({text:y.text,anchorPosition:y.anchor_position,fontSize:y.font_size,anchorAlignment:y.anchor_alignment,ccwRotationDegrees:y.type==="pcb_fabrication_note_text"?y.ccw_rotation??1:0});else if(y.type==="pcb_cutout"){let x=y;if(x.shape==="rect")d({center:x.center,width:x.width,height:x.height,ccwRotationDegrees:x.rotation});else if(x.shape==="circle"){let C=un.parse(x.radius);if(C!==void 0)d({center:x.center,width:C*2,height:C*2})}else if(x.shape==="polygon")m(x.points);else if(x.shape==="path"){let C=x;if(C.route&&Array.isArray(C.route))m(C.route)}}else if(y.type==="pcb_keepout"){let x=y;if(x.shape==="rect")d({center:x.center,width:x.width,height:x.height});else if(x.shape==="circle"){let C=typeof x.radius==="number"?x.radius:un.parse(x.radius)??0;if(C>0)d({center:x.center,width:C*2,height:C*2})}}else if(y.type==="pcb_silkscreen_graphic"||y.type==="pcb_silkscreen_text"||y.type==="pcb_silkscreen_rect"||y.type==="pcb_silkscreen_circle"||y.type==="pcb_silkscreen_line"||y.type==="pcb_silkscreen_oval"||y.type==="pcb_silkscreen_pill")f(y);else if(y.type==="pcb_copper_text")d({center:y.anchor_position,width:0,height:0});else if(y.type==="pcb_copper_pour"){if(y.shape==="rect")d({center:y.center,width:y.width,height:y.height,ccwRotationDegrees:y.rotation});else if(y.shape==="polygon")m(y.points);else if(y.shape==="brep")m(y.brep_shape.outer_ring.vertices)}return{minX:t,minY:n,maxX:o,maxY:r,boardMinX:s,boardMinY:a,boardMaxX:c,boardMaxY:l,hasBounds:i,hasBoardBounds:h};function d({center:y,width:x,height:C,ccwRotationDegrees:b}){if(!y)return;let I=un.parse(y.x),v=un.parse(y.y);if(I===void 0||v===void 0)return;let P=un.parse(x)??0,M=un.parse(C)??0,B=P/2,T=M/2;if(typeof b==="number"&&b!==0){let N=b*Math.PI/180,D=Math.abs(Math.cos(N)),L=Math.abs(Math.sin(N)),H=B*D+T*L,V=B*L+T*D;B=H,T=V}t=Math.min(t,I-B),n=Math.min(n,v-T),o=Math.max(o,I+B),r=Math.max(r,v+T),i=!0}function u({center:y,width:x,height:C}){if(!y)return;let b=un.parse(y.x),I=un.parse(y.y);if(b===void 0||I===void 0)return;let v=un.parse(x)??0,P=un.parse(C)??0,M=v/2,B=P/2;s=Math.min(s,b-M),a=Math.min(a,I-B),c=Math.max(c,b+M),l=Math.max(l,I+B),i=!0,h=!0}function _(y){let x=!1;for(let C of y){let b=un.parse(C.x),I=un.parse(C.y);if(b===void 0||I===void 0)continue;t=Math.min(t,b),n=Math.min(n,I),o=Math.max(o,b),r=Math.max(r,I),x=!0}if(x)i=!0}function p(y){let x=!1;for(let C of y){let b=un.parse(C.x),I=un.parse(C.y);if(b===void 0||I===void 0)continue;s=Math.min(s,b),a=Math.min(a,I),c=Math.max(c,b),l=Math.max(l,I),x=!0}if(x)i=!0,h=!0}function m(y){let x=!1;for(let C of y)for(let b of A(C)){let I=un.parse(b.x),v=un.parse(b.y);if(I===void 0||v===void 0)continue;t=Math.min(t,I),n=Math.min(n,v),o=Math.max(o,I),r=Math.max(r,v),x=!0}if(x)i=!0}function A(y){return"route_type"in y?Lhs(y):[y]}function g({text:y,anchorPosition:x,fontSize:C=1,anchorAlignment:b="center",ccwRotationDegrees:I=0}){if(!y||!x)return;let v=y.split(`
`),M=Math.max(...v.map((N)=>N.length),0)*C*0.6,B=Math.max(v.length,1)*C,T=Fds({anchorPosition:x,textWidth:M,textHeight:B,anchorAlignment:b});d({center:T,width:M,height:B,ccwRotationDegrees:I})}function f(y){if(y.type==="pcb_silkscreen_text")d({center:y.anchor_position,width:0,height:0});else if(y.type==="pcb_silkscreen_graphic"){for(let x of y.brep_shape.outer_ring.vertices)d({center:{x:x.x,y:x.y},width:0,height:0});for(let x of y.brep_shape.inner_rings??[])for(let C of x.vertices)d({center:{x:C.x,y:C.y},width:0,height:0})}else if(y.type==="pcb_silkscreen_path")m(y.route);else if(y.type==="pcb_silkscreen_rect")d({center:y.center,width:y.width,height:y.height,ccwRotationDegrees:y.ccw_rotation});else if(y.type==="pcb_silkscreen_circle"){let x=un.parse(y.radius);if(x!==void 0)d({center:y.center,width:x*2,height:x*2})}else if(y.type==="pcb_silkscreen_line")d({center:{x:y.x1,y:y.y1},width:0,height:0}),d({center:{x:y.x2,y:y.y2},width:0,height:0});else if(y.type==="pcb_silkscreen_oval"){let x=un.parse(y.radius_x),C=un.parse(y.radius_y);if(x!==void 0&&C!==void 0)d({center:y.center,width:x*2,height:C*2})}else if(y.type==="pcb_silkscreen_pill")d({center:y.center,width:y.width,height:y.height,ccwRotationDegrees:y.ccw_rotation});else if(y.type==="pcb_cutout"){let x=y;if(x.shape==="rect")d({center:x.center,width:x.width,height:x.height,ccwRotationDegrees:x.rotation});else if(x.shape==="circle"){let C=un.parse(x.radius);if(C!==void 0)d({center:x.center,width:C*2,height:C*2})}else if(x.shape==="polygon")m(x.points);else if(x.shape==="path"){let C=x;if(C.route&&Array.isArray(C.route))m(C.route)}}}}var Ods=({circuitJson:e,drawPaddingOutsideBoard:t,baseBounds:n,viewportOptions:o})=>{let r=t?1:0,i=t||!n.hasBoardBounds?n.minX:n.boardMinX,s=t||!n.hasBoardBounds?n.minY:n.boardMinY,a=t||!n.hasBoardBounds?n.maxX:n.boardMaxX,c=t||!n.hasBoardBounds?n.maxY:n.boardMaxY,l=!1,{POSITIVE_INFINITY:h,POSITIVE_INFINITY:d,NEGATIVE_INFINITY:u,NEGATIVE_INFINITY:_}=Number,p=new Map,m=new Map;for(let A of e)if(A.type==="pcb_panel"){let g=A,f=wfo(g.center,g.width,g.height);if(!f)continue;if(h=Math.min(h,f.minX),d=Math.min(d,f.minY),u=Math.max(u,f.maxX),_=Math.max(_,f.maxY),l=!0,g.pcb_panel_id)p.set(g.pcb_panel_id,f)}else if(A.type==="pcb_board"){let g=A,y=Vds(g.outline)??wfo(g.center,g.width,g.height);if(y&&g.pcb_board_id)m.set(g.pcb_board_id,y)}if(o?.viewport){let{minX:A,minY:g,maxX:f,maxY:y}=o.viewport;i=A,s=g,a=f,c=y,r=0}else if(o?.viewportTarget?.pcb_panel_id){let A=p.get(o.viewportTarget.pcb_panel_id);if(!A)throw Error(`Viewport target panel '${o.viewportTarget.pcb_panel_id}' not found`);i=A.minX,s=A.minY,a=A.maxX,c=A.maxY,r=0}else if(o?.viewportTarget?.pcb_board_id){let A=m.get(o.viewportTarget.pcb_board_id);if(!A)throw Error(`Viewport target board '${o.viewportTarget.pcb_board_id}' not found`);i=A.minX,s=A.minY,a=A.maxX,c=A.maxY,r=0}else if(l)i=h,s=d,a=u,c=_;return{boundsMinX:i,boundsMinY:s,boundsMaxX:a,boundsMaxY:c,padding:r}};function wfo(e,t,n){if(!e||t===void 0||n===void 0)return;let o=un.parse(e.x),r=un.parse(e.y);if(o===void 0||r===void 0)return;let i=un.parse(t),s=un.parse(n);if(i===void 0||s===void 0)return;let a=i/2,c=s/2;return{minX:o-a,minY:r-c,maxX:o+a,maxY:r+c}}function Vds(e){if(!e||e.length<3)return;let{POSITIVE_INFINITY:t,POSITIVE_INFINITY:n,NEGATIVE_INFINITY:o,NEGATIVE_INFINITY:r}=Number;for(let i of e){let s=un.parse(i.x),a=un.parse(i.y);if(s===void 0||a===void 0)continue;t=Math.min(t,s),n=Math.min(n,a),o=Math.max(o,s),r=Math.max(r,a)}if(!Number.isFinite(t)||!Number.isFinite(n))return;if(!Number.isFinite(o)||!Number.isFinite(r))return;return{minX:t,minY:n,maxX:o,maxY:r}}var Yds=0.5,Gds=0.42,Uds=0.58,Wds=0.75;function Bfo(e,t){if(!t.showPinNumbers)return[];if(e.type==="pcb_smtpad"){if(t.layer&&e.layer!==t.layer)return[]}else if(t.layer&&!e.layers.includes(t.layer))return[];let n=ohs(e,t.circuitJson);if(!n)return[];let o=Xds(e);if(!o||o.width<=0||o.height<=0)return[];let r=Math.abs(t.transform.a),i=Math.min(Yds,o.height*Gds,o.width*Wds/(n.length*Uds));if(i<=0)return[];let[s,a]=Vt(t.transform,[o.centerX,o.centerY]),c=e.type==="pcb_smtpad"?e.layer:"through",l=o.ccwRotation?`rotate(${-o.ccwRotation} ${s} ${a})`:void 0;return[{name:"text",type:"element",value:"",attributes:{class:"pcb-pad-pin-number",x:s.toString(),y:a.toString(),fill:"#b0b0b0","font-family":"Arial, sans-serif","font-size":(i*r).toString(),"font-weight":"500","text-anchor":"middle","dominant-baseline":"central","pointer-events":"none","data-type":"pcb_pad_pin_number","data-pcb-layer":c,"data-pin-number":n,...l?{transform:l}:{}},children:[{type:"text",value:n,name:"",attributes:{},children:[]}]}]}function Xds(e){if(e.type==="pcb_smtpad"){if(e.shape==="polygon")return Tfo(e.points);if(e.shape==="circle")return{centerX:e.x,centerY:e.y,width:e.radius*2,height:e.radius*2,ccwRotation:0};return{centerX:e.x,centerY:e.y,width:e.width,height:e.height,ccwRotation:e.shape==="rotated_rect"||e.shape==="rotated_pill"?e.ccw_rotation:0}}if(e.shape==="circle")return{centerX:e.x,centerY:e.y,width:e.outer_diameter,height:e.outer_diameter,ccwRotation:0};if(e.shape==="oval"||e.shape==="pill")return{centerX:e.x,centerY:e.y,width:e.outer_width,height:e.outer_height,ccwRotation:e.ccw_rotation};if(e.shape==="hole_with_polygon_pad"){let t=Tfo(e.pad_outline);if(!t)return;return{...t,centerX:e.x+t.centerX,centerY:e.y+t.centerY,ccwRotation:0}}if("rect_pad_width"in e)return{centerX:e.x,centerY:e.y,width:e.rect_pad_width,height:e.rect_pad_height,ccwRotation:e.shape==="rotated_pill_hole_with_rect_pad"?e.rect_ccw_rotation:e.shape==="circular_hole_with_rect_pad"?e.rect_ccw_rotation??0:0};return}function Tfo(e){if(e.length===0)return;let t=e.map((a)=>a.x),n=e.map((a)=>a.y),o=Math.min(...t),r=Math.max(...t),i=Math.min(...n),s=Math.max(...n);return{centerX:(o+r)/2,centerY:(i+s)/2,width:r-o,height:s-i,ccwRotation:0}}var Dfo="rgb(255, 208, 66)";function jds(e,t){return e.map((n)=>({...n,attributes:{...n.attributes??{},"data-type":t.type,"data-pcb-layer":"overlay"}}))}function Kds(e,t,n){if(!n.shouldDrawWarnings)return[];let o=t.find((g)=>g.type==="pcb_component"&&g.pcb_component_id===e.pcb_component_id);if(!o)return[];let r=(o.rotation??0)*Math.PI/180,i=Math.cos(r),s=Math.sin(r),a=o.width/2,c=o.height/2,l=[{x:-a,y:-c},{x:a,y:-c},{x:a,y:c},{x:-a,y:c}].map((g)=>Vt(n.transform,{x:o.center.x+g.x*i-g.y*s,y:o.center.y+g.x*s+g.y*i})),h=Math.min(...l.map((g)=>g.x)),d=Math.min(...l.map((g)=>g.y)),u=Math.max(...l.map((g)=>g.x)),_=Math.max(...l.map((g)=>g.y)),p=u-h,m=_-d,A=h+p/2;return jds([{name:"rect",type:"element",value:"",attributes:{x:h.toString(),y:d.toString(),width:p.toString(),height:m.toString(),fill:"none",stroke:Dfo,"stroke-width":"2","stroke-dasharray":"6,3"},children:[]},{name:"text",type:"element",value:"",attributes:{x:A.toString(),y:(d-10).toString(),fill:Dfo,"font-family":"sans-serif","font-size":"12","font-weight":"600","text-anchor":"middle"},children:[{type:"text",name:"",value:e.message,attributes:{},children:[]}]}],e)}var p2o="#ff4d4d",$ds=(e)=>({type:"text",value:e,name:"",attributes:{},children:[]}),vft=({label:e,x:t,y:n,style:o,anchor:r="start"})=>e?[{name:"text",type:"element",value:"",attributes:{x:t.toString(),y:n.toString(),fill:p2o,"font-family":"monospace","font-size":o.fontSize.toString(),"font-weight":"600","text-anchor":r},children:[$ds(e)]}]:[],qds=(e)=>({"data-type":"pcb_debug_object","data-pcb-layer":"overlay","data-pcb-debug-object-id":e.pcb_debug_object_id,"data-debug-shape":e.shape});function Jds({debugObject:e,transform:t,style:n,labelStackIndex:o=0}){let r=qds(e),i={fill:"none",stroke:p2o,"stroke-width":n.strokeWidth.toString(),"stroke-dasharray":`${n.dashLength},${n.dashLength}`};if(e.shape==="rect"){let c=Vt(t,[e.center.x-e.size.width/2,e.center.y-e.size.height/2]),l=Vt(t,[e.center.x+e.size.width/2,e.center.y+e.size.height/2]),h=Math.min(c[0],l[0]),d=Math.min(c[1],l[1]),u=Math.abs(l[0]-c[0]),_=Math.abs(l[1]-c[1]);return[{name:"g",type:"element",value:"",attributes:r,children:[{name:"rect",type:"element",value:"",attributes:{x:h.toString(),y:d.toString(),width:u.toString(),height:_.toString(),...i},children:[]},...vft({label:e.label,x:h,y:d-n.labelGap-o*(n.fontSize+n.labelGap),style:n})]}]}if(e.shape==="line"){let[c,l]=Vt(t,[e.start.x,e.start.y]),[h,d]=Vt(t,[e.end.x,e.end.y]);return[{name:"g",type:"element",value:"",attributes:r,children:[{name:"line",type:"element",value:"",attributes:{x1:c.toString(),y1:l.toString(),x2:h.toString(),y2:d.toString(),...i},children:[]},...vft({label:e.label,x:(c+h)/2,y:(l+d)/2-n.labelGap,style:n,anchor:"middle"})]}]}let[s,a]=Vt(t,[e.center.x,e.center.y]);return[{name:"g",type:"element",value:"",attributes:r,children:[{name:"circle",type:"element",value:"",attributes:{cx:s.toString(),cy:a.toString(),r:n.pointRadius.toString(),...i},children:[]},...vft({label:e.label,x:s+n.pointRadius+n.labelGap,y:a-n.pointRadius,style:n})]}]}function Zds(e){let t=new Map,n=new Map,o=e.filter((s)=>s.type==="pcb_board");for(let s of e)switch(s.type){case"source_group":if(n.set(s.source_group_id,s.subcircuit_id??s.parent_subcircuit_id??s.parent_source_group_id),s.is_subcircuit&&s.subcircuit_id)n.set(s.subcircuit_id,s.parent_subcircuit_id??s.parent_source_group_id);break;case"pcb_group":n.set(s.pcb_group_id,s.subcircuit_id??s.source_group_id);break;case"pcb_component":n.set(s.pcb_component_id,s.subcircuit_id??s.pcb_group_id);break;case"pcb_trace":n.set(s.pcb_trace_id,s.subcircuit_id??s.pcb_group_id??s.pcb_component_id);break;case"pcb_via":n.set(s.pcb_via_id,s.subcircuit_id??s.pcb_group_id??s.pcb_trace_id);break}for(let s of o)if(t.set(s.pcb_board_id,s),s.subcircuit_id)t.set(s.subcircuit_id,s);let r=new Set;function i(s){if(t.has(s))return t.get(s);if(r.has(s)||!n.has(s))return;r.add(s);let a=n.get(s),c=a?i(a):o.length===1?o[0]:void 0;return t.set(s,c),r.delete(s),c}for(let s of n.keys())i(s);return t}function m2o(e,t){if(t?.showFabricationNotes===!1)e=e.filter((ue)=>!ue.type.startsWith("pcb_fabrication_note_"));let n=Boolean(t?.xRayElementIds?.length);if(n&&t?.hiddenLayerOpacity!==void 0&&(!Number.isFinite(t.hiddenLayerOpacity)||t.hiddenLayerOpacity<0||t.hiddenLayerOpacity>1))throw Error("hiddenLayerOpacity must be between 0 and 1");let o=!n&&(t?.drawPaddingOutsideBoard??!0),r=t?.layer,i=t?.colorOverrides,s={...Lp.copper};if(i?.copper){for(let[ue,de]of Object.entries(i.copper))if(de!==void 0)s[ue]=de}let a={copper:s,drill:i?.drill??Lp.drill,silkscreen:{top:i?.silkscreen?.top??Lp.silkscreen.top,bottom:i?.silkscreen?.bottom??Lp.silkscreen.bottom},boardOutline:i?.boardOutline??Lp.boardOutline,soldermask:{top:i?.soldermask?.top??Lp.soldermask.top,bottom:i?.soldermask?.bottom??Lp.soldermask.bottom},soldermaskOverCopper:{top:i?.soldermaskOverCopper?.top??Lp.soldermaskOverCopper.top,bottom:i?.soldermaskOverCopper?.bottom??Lp.soldermaskOverCopper.bottom},soldermaskWithCopperUnderneath:{top:i?.soldermaskWithCopperUnderneath?.top??Lp.soldermaskWithCopperUnderneath.top,bottom:i?.soldermaskWithCopperUnderneath?.bottom??Lp.soldermaskWithCopperUnderneath.bottom},substrate:i?.substrate??Lp.substrate,courtyard:{top:i?.courtyard?.top??Lp.courtyard.top,bottom:i?.courtyard?.bottom??Lp.courtyard.bottom},keepout:i?.keepout??Lp.keepout,debugComponent:{fill:i?.debugComponent?.fill??Lp.debugComponent.fill,stroke:i?.debugComponent?.stroke??Lp.debugComponent.stroke}},c=t?.showCourtyards?e:e.filter((ue)=>ue.type!=="pcb_courtyard_rect"),{minX:l,minY:h,maxX:d,maxY:u,boardMinX:_,boardMinY:p,boardMaxX:m,boardMaxY:A,hasBoardBounds:g}=zds(c),{boundsMinX:f,boundsMinY:y,boundsMaxX:x,boundsMaxY:C,padding:b}=Ods({circuitJson:e,drawPaddingOutsideBoard:o,baseBounds:{minX:l,minY:h,maxX:d,maxY:u,boardMinX:_,boardMinY:p,boardMaxX:m,boardMaxY:A,hasBoardBounds:g},viewportOptions:{viewport:t?.viewport,viewportTarget:t?.viewportTarget}}),I=x-f+2*b,v=C-y+2*b,P=t?.width??800,M=t?.height??600;if(t?.matchBoardAspectRatio){let ue=x-f,de=C-y;if(ue>0&&de>0){let me=ue/de;if(t?.width&&!t?.height)M=t.width/me;else if(t?.height&&!t?.width)P=t.height*me;else M=P/me}}let B=[];for(let ue of e)if("route"in ue&&ue.route!==void 0)B.push(ue.route);let T=P/I,N=M/v,D=Math.min(T,N),L=(P-I*D)/2,H=(M-v*D)/2,V=va(Wc(L-f*D+b*D,M-H+y*D-b*D),kp(D,-D)),O=Math.min(P,M),U=Math.max(1,Math.min(2,O*0.002)),j=Math.max(10,Math.min(18,O*0.02)),Y={transform:V,layer:r,shouldDrawErrors:t?.shouldDrawErrors,shouldDrawWarnings:t?.shouldDrawWarnings,showCourtyards:t?.showCourtyards,showPcbGroups:t?.showPcbGroups,drawPaddingOutsideBoard:o,colorMap:a,showSolderMask:t?.showSolderMask,showSolderPaste:t?.showSolderPaste,showPcbNotes:t?.showPcbNotes??!0,showDebugObjects:t?.showDebugObjects,debugObjectStyle:{fontSize:j,strokeWidth:U,dashLength:U*4,labelGap:j*0.35,pointRadius:U*3},showAnchorOffsets:t?.showAnchorOffsets,showPinNumbers:t?.showPinNumbers,circuitJson:e,boardOwnerMap:Zds(e),usedCopperPourTraceMaskIds:new Set},X=n?[]:e.flatMap((ue)=>Nfo({elm:ue,circuitJson:e,ctx:Y})),K=String(0.05*D);for(let ue of e)if("stroke_width"in ue){K=String(D*ue.stroke_width);break}if(!n&&t?.shouldDrawRatsNest){let ue=pds(e,Y);X=[...X,...ue]}let J=n?bls({circuitJson:e,ctx:Y,selectedIds:t.xRayElementIds,hiddenOpacity:t?.hiddenLayerOpacity??0.2,width:P,height:M,create:(ue,de)=>Nfo({elm:ue,circuitJson:e,ctx:de})}):Ghs(Rds(X)),ee=[{name:"style",type:"element",value:"",attributes:{},children:[{type:"text",value:"",name:"",attributes:{},children:[]}]}],se=vds({grid:n?void 0:t?.grid,svgWidth:P,svgHeight:M});if(se.defs)ee.push(se.defs);if(e.some((ue)=>ue.type==="pcb_keepout"))ee.push(fds(a.keepout??Lp.keepout));let re=Yhs({circuitJson:e,transform:V,svgWidth:P,svgHeight:M,usedMaskIds:Y.usedCopperPourTraceMaskIds});if(re)ee.push(re);let Z=Lds({showSolderMask:Y.showSolderMask,objects:X,layer:r??"top",width:P,height:M});if(Z)ee.push(Z);if(ee.push({name:"rect",type:"element",value:"",attributes:{class:"boundary",x:"0",y:"0",fill:t?.backgroundColor??"#000",width:P.toString(),height:M.toString(),"data-type":"pcb_background","data-pcb-layer":"global"},children:[]}),o)ee.push(eus(V,l,h,d,u));if(ee.push(...J),se.rect)ee.push(se.rect);if(!n&&t?.showErrorsInTextOverlay){let ue=u2o(e,"pcb_error_text_overlay");if(ue)ee.push(ue)}let te=h2o(e),ie=d2o,le={name:"svg",type:"element",attributes:{xmlns:"http://www.w3.org/2000/svg",width:P.toString(),height:M.toString(),...te&&{"data-software-used-string":te},...t?.includeVersion&&{"data-circuit-to-svg-version":ie}},value:"",children:ee.filter((ue)=>ue!==null)};try{return Wfo(le)}catch(ue){throw console.error("Error stringifying SVG object:",ue),ue}}function Nfo({elm:e,circuitJson:t,ctx:n}){switch(e.type){case"pcb_debug_object":return n.showDebugObjects?Jds({debugObject:e,transform:n.transform,style:n.debugObjectStyle,labelStackIndex:e.shape==="rect"?t.slice(0,t.indexOf(e)).filter((r)=>r.type==="pcb_debug_object"&&r.shape==="rect"&&r.center.x===e.center.x&&r.center.y===e.center.y&&r.size.width===e.size.width&&r.size.height===e.size.height).length:0}):[];case"pcb_trace_error":return Ils(e,t,n).filter(Boolean);case"pcb_footprint_overlap_error":return Pls(e,t,n).filter(Boolean);case"pcb_courtyard_overlap_error":return Els(e,t,n).filter(Boolean);case"pcb_component_outside_board_error":return Bls(e,t,n).filter(Boolean);case"pcb_pad_trace_clearance_error":case"pcb_via_trace_clearance_error":return Lls(e,t,n).filter(Boolean);case"pcb_connector_not_in_accessible_orientation_warning":case"pcb_manual_edit_conflict_warning":return Kds(e,t,n);case"pcb_component":return Pds(e,n).filter(Boolean);case"pcb_trace":return Uhs(e,n);case"pcb_copper_pour":return Cds(e,n);case"pcb_plated_hole":return[...ihs(e,n).filter(Boolean),...Bfo(e,n)];case"pcb_hole":return hds(e,n);case"pcb_smtpad":return[...Zhs(e,n),...Bfo(e,n)];case"pcb_solder_paste":return n.showSolderPaste?bds(e,n):[];case"pcb_silkscreen_text":return Ahs(e,n);case"pcb_silkscreen_rect":return fhs(e,n);case"pcb_silkscreen_circle":return bhs(e,n);case"pcb_silkscreen_line":return Ihs(e,n);case"pcb_silkscreen_pill":return vhs(e,n);case"pcb_silkscreen_oval":return Shs(e,n);case"pcb_copper_text":return Chs(e,n);case"pcb_courtyard_rect":if(!n.showCourtyards)return[];return Phs(e,n);case"pcb_courtyard_polygon":if(!n.showCourtyards)return[];return Ehs(e,n);case"pcb_courtyard_circle":if(!n.showCourtyards)return[];return whs(e,n);case"pcb_courtyard_outline":if(!n.showCourtyards)return[];return Mhs(e,n);case"pcb_fabrication_note_path":return Hls(e,n);case"pcb_fabrication_note_text":return Fls(e,n);case"pcb_fabrication_note_rect":return Vls(e,n);case"pcb_fabrication_note_dimension":return Wls(e,n);case"pcb_note_dimension":if(!n.showPcbNotes)return[];return Xls(e,n);case"pcb_note_text":if(!n.showPcbNotes)return[];return Kls(e,n);case"pcb_note_rect":if(!n.showPcbNotes)return[];return Jls(e,n);case"pcb_note_path":if(!n.showPcbNotes)return[];return ehs(e,n);case"pcb_note_line":if(!n.showPcbNotes)return[];return nhs(e,n);case"pcb_silkscreen_path":return shs(e,n);case"pcb_silkscreen_graphic":return ahs(e,n);case"pcb_panel":return n.drawPaddingOutsideBoard?lds(e,n):[];case"pcb_board":return n.drawPaddingOutsideBoard?cds(e,n):[];case"pcb_via":return n2o(e,n);case"pcb_cutout":let o=e;if(o.shape==="path")return _ds(o,n);return mds(e,n);case"pcb_keepout":return yds(e,n);case"pcb_group":return n.showPcbGroups?wds(e,n):[];default:return[]}}function eus(e,t,n,o,r){let[i,s]=Vt(e,[t,n]),[a,c]=Vt(e,[o,r]),l=Math.abs(a-i),h=Math.abs(c-s),d=Math.min(i,a),u=Math.min(s,c);return{name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-boundary",fill:"none",stroke:"#fff","stroke-width":"0.3",x:d.toString(),y:u.toString(),width:l.toString(),height:h.toString(),"data-type":"pcb_boundary","data-pcb-layer":"global"}}}var tus={pin_number:0.15,negated_pin_number:0.12,reference_designator:0.18,manufacturer_number:0.18,net_label:0.18,error:0.05},RH=(e,t)=>t??tus[e],PC=(e,t,n)=>Math.abs(e.a)*RH(t,n);function nus(e){let{minX:t,minY:n,maxX:o,maxY:r}=e.bounds,i=e.cellSize??1,s=e.labelCells??!1,a=[],c=(l,h)=>{let[d,u]=Vt(e.transform,[l,h]);return{x:d,y:u}};for(let l=Math.floor(t);l<=Math.ceil(o);l+=i){let h=c(l,n),d=c(l,r);a.push({name:"line",type:"element",attributes:{x1:h.x.toString(),y1:h.y.toString(),x2:d.x.toString(),y2:d.y.toString(),stroke:Ef.schematic.grid,"stroke-width":(0.01*Math.abs(e.transform.a)).toString(),"stroke-opacity":"0.5"}})}for(let l=Math.floor(n);l<=Math.ceil(r);l+=i){let h=c(t,l),d=c(o,l);a.push({name:"line",type:"element",attributes:{x1:h.x.toString(),y1:h.y.toString(),x2:d.x.toString(),y2:d.y.toString(),stroke:Ef.schematic.grid,"stroke-width":(0.01*Math.abs(e.transform.a)).toString(),"stroke-opacity":"0.5"}})}if(s){let l=(h,d)=>{if(i<=0.1)return`${h.toFixed(1)},${d.toFixed(1)}`;return`${h},${d}`};for(let h=Math.floor(t);h<=Math.ceil(o);h+=i)for(let d=Math.floor(n);d<=Math.ceil(r);d+=i){let u=c(h,d);a.push({name:"text",type:"element",attributes:{x:(u.x-2.5).toString(),y:(u.y-5).toString(),fill:Ef.schematic.grid,"font-size":(i/5*Math.abs(e.transform.a)).toString(),"fill-opacity":"0.5","text-anchor":"middle","dominant-baseline":"middle","font-family":"sans-serif"},children:[{type:"text",value:l(h,d),name:"",attributes:{},children:[]}]})}}return{name:"g",value:"",type:"element",attributes:{class:"grid sch-grid"},children:a}}function ous(e){let{points:t,transform:n}=e,o=[];for(let r of t){let[i,s]=Vt(n,[r.x-0.1,r.y-0.1]),[a,c]=Vt(n,[r.x+0.1,r.y+0.1]),[l,h]=Vt(n,[r.x-0.1,r.y+0.1]),[d,u]=Vt(n,[r.x+0.1,r.y-0.1]);o.push({name:"path",type:"element",attributes:{d:`M${i},${s} L${a},${c} M${l},${h} L${d},${u}`,stroke:Ef.schematic.grid,"stroke-width":(0.02*Math.abs(n.a)).toString(),"stroke-opacity":"0.7"}});let[_,p]=Vt(n,[r.x+0.15,r.y-0.15]);o.push({name:"text",type:"element",attributes:{x:_.toString(),y:p.toString(),fill:Ef.schematic.grid,"font-size":(0.1*Math.abs(n.a)).toString(),"fill-opacity":"0.7","text-anchor":"start","font-family":"sans-serif","dominant-baseline":"middle"},children:[{type:"text",value:r.label||`(${r.x},${r.y})`,name:"",attributes:{},children:[]}]})}return{name:"g",value:"",type:"element",attributes:{class:"labeled-points sch-labeled-points"},children:o}}function rus(e){return e.reduce((t,n)=>{if(!t)return n;if(n.sheet_index===void 0)return t;if(t.sheet_index===void 0)return n;return n.sheet_index<t.sheet_index?n:t},void 0)}var Rfo={"0":{width:13,height:27,ascent:22,descent:5,left:-1,right:12},"1":{width:13,height:27,ascent:22,descent:5,left:-3,right:9},"2":{width:13,height:27,ascent:22,descent:5,left:-1,right:12},"3":{width:13,height:27,ascent:22,descent:5,left:-1,right:12},"4":{width:13,height:27,ascent:22,descent:5,left:0,right:12},"5":{width:13,height:27,ascent:22,descent:5,left:-1,right:12},"6":{width:13,height:27,ascent:22,descent:5,left:-1,right:12},"7":{width:13,height:27,ascent:22,descent:5,left:-1,right:12},"8":{width:13,height:27,ascent:22,descent:5,left:-1,right:12},"9":{width:13,height:27,ascent:22,descent:5,left:-1,right:12}," ":{width:7,height:27,ascent:22,descent:5,left:0,right:0},"!":{width:7,height:27,ascent:22,descent:5,left:-2,right:5},'"':{width:9,height:27,ascent:22,descent:5,left:-1,right:7},"#":{width:13,height:27,ascent:22,descent:5,left:0,right:13},$:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},"%":{width:21,height:27,ascent:22,descent:5,left:-1,right:20},"&":{width:16,height:27,ascent:22,descent:5,left:-1,right:15},"'":{width:5,height:27,ascent:22,descent:5,left:-1,right:3},"(":{width:8,height:27,ascent:22,descent:5,left:-1,right:7},")":{width:8,height:27,ascent:22,descent:5,left:-1,right:7},"*":{width:9,height:27,ascent:22,descent:5,left:-1,right:8},"+":{width:14,height:27,ascent:22,descent:5,left:-1,right:13},",":{width:7,height:27,ascent:22,descent:5,left:-2,right:5},"-":{width:8,height:27,ascent:22,descent:5,left:-1,right:7},".":{width:7,height:27,ascent:22,descent:5,left:-2,right:5},"/":{width:7,height:27,ascent:22,descent:5,left:0,right:7},":":{width:7,height:27,ascent:22,descent:5,left:-2,right:5},";":{width:7,height:27,ascent:22,descent:5,left:-2,right:5},"<":{width:14,height:27,ascent:22,descent:5,left:-1,right:13},"=":{width:14,height:27,ascent:22,descent:5,left:-1,right:13},">":{width:14,height:27,ascent:22,descent:5,left:-1,right:13},"?":{width:13,height:27,ascent:22,descent:5,left:-1,right:12},"@":{width:24,height:27,ascent:22,descent:5,left:-1,right:23},A:{width:16,height:27,ascent:22,descent:5,left:0,right:16},B:{width:16,height:27,ascent:22,descent:5,left:-2,right:15},C:{width:17,height:27,ascent:22,descent:5,left:-1,right:16},D:{width:17,height:27,ascent:22,descent:5,left:-2,right:16},E:{width:16,height:27,ascent:22,descent:5,left:-2,right:15},F:{width:15,height:27,ascent:22,descent:5,left:-2,right:14},G:{width:19,height:27,ascent:22,descent:5,left:-1,right:17},H:{width:17,height:27,ascent:22,descent:5,left:-2,right:15},I:{width:7,height:27,ascent:22,descent:5,left:-2,right:5},J:{width:12,height:27,ascent:22,descent:5,left:-1,right:10},K:{width:16,height:27,ascent:22,descent:5,left:-2,right:16},L:{width:13,height:27,ascent:22,descent:5,left:-2,right:12},M:{width:20,height:27,ascent:22,descent:5,left:-2,right:18},N:{width:17,height:27,ascent:22,descent:5,left:-2,right:15},O:{width:19,height:27,ascent:22,descent:5,left:-1,right:18},P:{width:16,height:27,ascent:22,descent:5,left:-2,right:15},Q:{width:19,height:27,ascent:22,descent:5,left:-1,right:18},R:{width:17,height:27,ascent:22,descent:5,left:-2,right:17},S:{width:16,height:27,ascent:22,descent:5,left:-1,right:15},T:{width:15,height:27,ascent:22,descent:5,left:-1,right:14},U:{width:17,height:27,ascent:22,descent:5,left:-2,right:15},V:{width:16,height:27,ascent:22,descent:5,left:0,right:16},W:{width:23,height:27,ascent:22,descent:5,left:0,right:22},X:{width:16,height:27,ascent:22,descent:5,left:0,right:16},Y:{width:16,height:27,ascent:22,descent:5,left:0,right:16},Z:{width:15,height:27,ascent:22,descent:5,left:0,right:14},"[":{width:7,height:27,ascent:22,descent:5,left:-2,right:6},"\\":{width:7,height:27,ascent:22,descent:5,left:0,right:7},"]":{width:7,height:27,ascent:22,descent:5,left:0,right:5},"^":{width:11,height:27,ascent:22,descent:5,left:-1,right:11},_:{width:13,height:27,ascent:22,descent:5,left:0,right:14},"`":{width:8,height:27,ascent:22,descent:5,left:-1,right:5},a:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},b:{width:13,height:27,ascent:22,descent:5,left:-2,right:12},c:{width:12,height:27,ascent:22,descent:5,left:-1,right:12},d:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},e:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},f:{width:7,height:27,ascent:22,descent:5,left:0,right:8},g:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},h:{width:13,height:27,ascent:22,descent:5,left:-2,right:12},i:{width:5,height:27,ascent:22,descent:5,left:-2,right:4},j:{width:5,height:27,ascent:22,descent:5,left:1,right:4},k:{width:12,height:27,ascent:22,descent:5,left:-2,right:12},l:{width:5,height:27,ascent:22,descent:5,left:-2,right:4},m:{width:20,height:27,ascent:22,descent:5,left:-2,right:18},n:{width:13,height:27,ascent:22,descent:5,left:-2,right:12},o:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},p:{width:13,height:27,ascent:22,descent:5,left:-2,right:12},q:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},r:{width:8,height:27,ascent:22,descent:5,left:-2,right:8},s:{width:12,height:27,ascent:22,descent:5,left:-1,right:11},t:{width:7,height:27,ascent:22,descent:5,left:0,right:6},u:{width:13,height:27,ascent:22,descent:5,left:-2,right:12},v:{width:12,height:27,ascent:22,descent:5,left:0,right:12},w:{width:17,height:27,ascent:22,descent:5,left:0,right:17},x:{width:12,height:27,ascent:22,descent:5,left:0,right:12},y:{width:12,height:27,ascent:22,descent:5,left:0,right:12},z:{width:12,height:27,ascent:22,descent:5,left:0,right:11},"{":{width:8,height:27,ascent:22,descent:5,left:-1,right:7},"|":{width:6,height:27,ascent:22,descent:5,left:-2,right:4},"}":{width:8,height:27,ascent:22,descent:5,left:-1,right:7},"~":{width:14,height:27,ascent:22,descent:5,left:-1,right:13}},y_e=(e)=>{if(!e)return 0;let t=0;for(let n of e){let o=Rfo[n];if(o)t+=o.width;else t+=Rfo["?"].width}return t/27},_2o=0.65,g2o=0.08;function MDe(e){return y_e(e.text||"")+(e.display_superscript?g2o+y_e(e.display_superscript)*_2o:0)}function Dft(e,t,n,o="central"){let r=[{type:"text",value:e,name:"",attributes:{},children:[]}];if(t)r.push({type:"element",name:"tspan",value:"",attributes:{class:"sch-net-label-superscript","font-size":`${n*_2o}px`,dx:`${n*g2o}`,dy:`${-n*(o==="ideographic"?0.5:0.25)}`},children:[{type:"text",value:t,name:"",attributes:{},children:[]}]});return r}var soe=(e)=>{switch(e){case"top":return{x:0,y:-1};case"bottom":return{x:0,y:1};case"left":return{x:1,y:0};case"right":return{x:-1,y:0}}throw Error(`Invalid side: ${e}`)},NH=0.3,roe=0.3,ioe=0.06,A2o=0.2,f2o=(e)=>({"data-circuit-json-type":"schematic_net_label","data-schematic-net-label-id":e.schematic_net_label_id}),ius={top_left:"start",top_right:"end",middle_left:"start",middle_right:"end",bottom_left:"start",bottom_right:"end",center:"middle",middle_top:"middle",middle_bottom:"middle"},Qfo={top_left:"hanging",top_right:"hanging",bottom_left:"ideographic",bottom_right:"ideographic",center:"middle",middle_left:"middle",middle_right:"middle",middle_top:"hanging",middle_bottom:"ideographic"};function sus(e){return{left:180,top:90,bottom:-90,right:0}[e]??0}function aus(e,t,n){let o=n+NH*2+ioe*e.text.length+roe,r=soe(e.anchor_side);return e.anchor_position??{x:e.center.x-r.x*o*t/2,y:e.center.y-r.y*o*t/2}}var cus=(e,t)=>{let n=e<0?e+2*Math.PI:e,o=t<0?t+2*Math.PI:t,r=Math.abs(n-o);if(r>Math.PI)r=2*Math.PI-r;return r},y2o=({schPorts:e,symbol:t,schComponent:n})=>{let o=e.map((a)=>{let c=a.center.x-n.center.x,l=a.center.y-n.center.y;return{port:a,angle:Math.atan2(l,c)}}),r=t.ports.map((a)=>{let c=a.x-t.center.x,l=a.y-t.center.y;return{port:a,angle:Math.atan2(l,c)}});o.sort((a,c)=>a.angle-c.angle),r.sort((a,c)=>a.angle-c.angle);let i=[],s=new Set;for(let a of o){let c=null;for(let l of r){if(s.has(l.port))continue;let h=cus(a.angle,l.angle);if(c===null||h<c.angleDiff)c={symbolPort:l.port,angleDiff:h}}if(c&&c.angleDiff<Math.PI/4)i.push({schPort:a.port,symbolPort:c.symbolPort}),s.add(c.symbolPort)}return i};function x2o(e,t,n,o){let r=Math.sqrt((n.x-e.x)**2+(n.y-e.y)**2),s=Math.sqrt((o.x-t.x)**2+(o.y-t.y)**2)/r,a=t.x-s*e.x,c=t.y-s*e.y,l=Wc(a,c),h=kp(s,s);return va(l,h)}function lus(e){let t=[],n=new Map,o=new Map,r=null;for(let i of e)if(i.type==="schematic_component")t.push(i);else if(i.type==="schematic_port"&&i.schematic_component_id){let s=n.get(i.schematic_component_id)??[];s.push(i),n.set(i.schematic_component_id,s)}else if(i.type==="source_component")o.set(i.source_component_id,i);for(let i of t){let s=hus({component:i,schematicPorts:n.get(i.schematic_component_id)??[],sourceComponent:i.source_component_id?o.get(i.source_component_id):void 0});if(!s)continue;r=r?C2o(r,s):s}return r}function hus({component:e,schematicPorts:t,sourceComponent:n}){if(!e.symbol_name)return null;let o=zs[e.symbol_name];if(!o)return null;let r=y2o({schPorts:t,symbol:o,schComponent:e});if(!r[0])return null;let i=x2o(r[1]?.symbolPort??o.center,r[1]?.schPort.center??e.center,r[0].symbolPort,r[0].schPort.center),s=null;for(let a of o.primitives){if(a.type!=="text")continue;let c=dus({primitive:a,component:e,sourceComponent:n});if(!c)continue;let l=Vt(i,a),h=RH("reference_designator"),d=uus({x:l.x,y:l.y,width:y_e(c)*h,height:h,anchor:a.anchor});s=s?C2o(s,d):d}return s}function dus({primitive:e,component:t,sourceComponent:n}){if(e.text==="{REF}")return n?.display_name??n?.name??"";if(e.text==="{VAL}")return t.symbol_display_value??"";return""}function uus({x:e,y:t,width:n,height:o,anchor:r}){let i=e,s=e,a=t-o/2,c=t+o/2;if(r.includes("left"))s=e+n;else if(r.includes("right"))i=e-n;else i=e-n/2,s=e+n/2;if(r.includes("top"))a=t-o,c=t;else if(r.includes("bottom"))a=t,c=t+o;return{minX:i,minY:a,maxX:s,maxY:c}}function C2o(e,t){return{minX:Math.min(e.minX,t.minX),minY:Math.min(e.minY,t.minY),maxX:Math.max(e.maxX,t.maxX),maxY:Math.max(e.maxY,t.maxY)}}var b2o=(e,t)=>{if(e.column_widths&&e.column_widths.length>0&&e.row_heights&&e.row_heights.length>0){let h=(d)=>{if(typeof d==="number")return d;if(d.endsWith("mm"))return parseFloat(d);if(d.endsWith("in"))return parseFloat(d)*25.4;return parseFloat(d)};return{column_widths:e.column_widths.map(h),row_heights:e.row_heights.map(h)}}let n=t.filter((h)=>h.type==="schematic_table_cell"&&h.schematic_table_id===e.schematic_table_id);if(n.length===0)return{column_widths:[],row_heights:[]};let o=n.reduce((h,d)=>Math.max(h,d.end_column_index),-1)+1,r=n.reduce((h,d)=>Math.max(h,d.end_row_index),-1)+1,{cell_padding:i=0.2}=e,s=Array(o).fill(0),a=Array(r).fill(0),c={},l={};for(let h of n){let d=RH("reference_designator",h.font_size),_=y_e(h.text??"")*d+2*i,p=d*1.2+2*i,m=`${h.start_row_index}-${h.start_column_index}`;c[m]=_,l[m]=p}for(let h=0;h<r;h++)for(let d=0;d<o;d++){let u=`${h}-${d}`;if(c[u]&&c[u]>s[d])s[d]=c[u];if(l[u]&&l[u]>a[h])a[h]=l[u]}for(let h of n){if(h.start_column_index===h.end_column_index&&h.start_row_index===h.end_row_index)continue;let d=`${h.start_row_index}-${h.start_column_index}`,u=c[d],_=l[d];if(u===void 0||_===void 0)continue;let p=0;for(let A=h.start_column_index;A<=h.end_column_index;A++)p+=s[A];if(u>p){let g=(u-p)/(h.end_column_index-h.start_column_index+1);for(let f=h.start_column_index;f<=h.end_column_index;f++)s[f]+=g}let m=0;for(let A=h.start_row_index;A<=h.end_row_index;A++)m+=a[A];if(_>m){let g=(_-m)/(h.end_row_index-h.start_row_index+1);for(let f=h.start_row_index;f<=h.end_row_index;f++)a[f]+=g}}return{column_widths:s,row_heights:a}},pus=10.16,mus=1.1,QH=pus/mus,_us=297/QH,gus=210/QH,FXa=20/QH,fDe=5/QH;function Nft(e={}){let t=e.center??{x:0,y:0},n=e.sheet_width===void 0?_us:e.sheet_width/QH,o=e.sheet_height===void 0?gus:e.sheet_height/QH,r=t.x-n/2,i=t.x+n/2,s=t.y-o/2,a=t.y+o/2;return{center:t,width:n,height:o,minX:r,maxX:i,minY:s,maxY:a,innerMinX:r+fDe,innerMaxX:i-fDe,innerMinY:s+fDe,innerMaxY:a-fDe}}function Aus(e,t=0.5){let{POSITIVE_INFINITY:n,POSITIVE_INFINITY:o,NEGATIVE_INFINITY:r,NEGATIVE_INFINITY:i}=Number,s=0.2;for(let l of e)if(l.type==="schematic_sheet"){let h=Nft(l);c(h.center,{width:h.width,height:h.height},0)}else if(l.type==="schematic_component")c(l.center,l.size,0);else if(l.type==="schematic_port")c(l.center,{width:s,height:s},0);else if(l.type==="schematic_debug_object"){if(l.shape==="rect")c(l.center,l.size,0);else if(l.shape==="line")c(l.start,{width:0.1,height:0.1},0),c(l.end,{width:0.1,height:0.1},0)}else if(l.type==="schematic_net_label"){let h=RH("net_label"),d=MDe(l),_=(d+NH*2+ioe*(l.text?.length||0)+roe)*h,p=A2o,m=sus(l.anchor_side)/180*Math.PI,A=aus(l,h,d),g=soe(l.anchor_side),f={x:A.x+g.x*_/2,y:A.y+g.y*_/2};c(f,{width:_,height:p},m)}else if(l.type==="schematic_trace")for(let h of l.edges)c(h.from,{width:0.1,height:0.1},0),c(h.to,{width:0.1,height:0.1},0);else if(l.type==="schematic_text"){let d=RH("reference_designator",l.font_size)??0.18,u=l.text??"",_=l.display_superscript;if(_){let p=u.split(`
`),m=Math.max(...p.map((b,I)=>MDe({text:b,display_superscript:I===p.length-1?_:void 0})))*d,A=l.anchor,g=A==="left"||A.endsWith("_left")?m/2:A==="right"||A.endsWith("_right")?-m/2:0,f=A==="top"||A.startsWith("top_")?0:A==="bottom"||A.startsWith("bottom_")?-d:-d/2,y=(p.length+0.3)*d,x=-(f-0.3*d+y/2),C=-(l.rotation??0)*Math.PI/180;c({x:l.position.x+g*Math.cos(C)-x*Math.sin(C),y:l.position.y+g*Math.sin(C)+x*Math.cos(C)},{width:m,height:y},C)}else{let p=u.length*d,m=d;c(l.position,{width:p,height:m},l.rotation??0)}}else if(l.type==="schematic_voltage_probe"){if(c(l.position,{width:0.2,height:0.4},0),l.name){let h=RH("net_label"),d=y_e(l.name)*h,u=h,_=0.3,p=l.label_alignment??"top_right",m=l.position.x,A=l.position.y;if(p.includes("top"))A+=0.3+u/2;else if(p.includes("bottom"))A-=0.3+u/2;if(p.includes("right"))m+=0.3+d/2;else if(p.includes("left"))m-=0.3+d/2;c({x:m,y:A},{width:d,height:u},0)}}else if(l.type==="schematic_box")c({x:l.x+l.width/2,y:l.y+l.height/2},{width:l.width,height:l.height},0);else if(l.type==="schematic_table"){let{column_widths:h,row_heights:d}=b2o(l,e),u=h.reduce((y,x)=>y+x,0),_=d.reduce((y,x)=>y+x,0),p=l.anchor??"center",m=l.anchor_position.x,A=l.anchor_position.y;if(p.includes("center"))m-=u/2;else if(p.includes("right"))m-=u;if(p.includes("center"))A+=_/2;else if(p.includes("bottom"))A+=_;let g=m+u/2,f=A-_/2;c({x:g,y:f},{width:u,height:_},0)}else if(l.type==="schematic_line")c({x:l.x1,y:l.y1},{width:0.02,height:0.02},0),c({x:l.x2,y:l.y2},{width:0.02,height:0.02},0);else if(l.type==="schematic_circle")c(l.center,{width:l.radius*2,height:l.radius*2},0);else if(l.type==="schematic_rect")c(l.center,{width:l.width,height:l.height},l.rotation);else if(l.type==="schematic_arc")c(l.center,{width:l.radius*2,height:l.radius*2},0);else if(l.type==="schematic_path"){if(l.points&&l.points.length>0)for(let h of l.points)c(h,{width:0.02,height:0.02},0)}if(!Number.isFinite(n))n=-1,o=-1,r=1,i=1;n-=t,o-=t,r+=t,i+=t;let a=lus(e);if(a){if(a.minX<n)n=a.minX-t;if(a.minY<o)o=a.minY-t;if(a.maxX>r)r=a.maxX+t;if(a.maxY>i)i=a.maxY+t}return{minX:n,minY:o,maxX:r,maxY:i};function c(l,h,d){let u=[{x:-h.width/2,y:-h.height/2},{x:h.width/2,y:-h.height/2},{x:h.width/2,y:h.height/2},{x:-h.width/2,y:h.height/2}];for(let _ of u){let p=_.x*Math.cos(d)-_.y*Math.sin(d)+l.x,m=_.x*Math.sin(d)+_.y*Math.cos(d)+l.y;n=Math.min(n,p),o=Math.min(o,m),r=Math.max(r,p),i=Math.max(i,m)}}}function yDe(e){if(!Number.isFinite(e))return"0";return Number.parseFloat(e.toFixed(6)).toString()}var x_e="image/svg+xml";function fus({schematicGraphic:e,viewport:t}){let n=yus(e);return{name:"g",type:"element",value:"",attributes:{class:"schematic-graphic","pointer-events":"none","data-circuit-json-type":"schematic_graphic","data-schematic-graphic-id":e.schematic_graphic_id,...e.schematic_sheet_id?{"data-schematic-sheet-id":e.schematic_sheet_id}:{}},children:[{name:"image",type:"element",value:"",attributes:{href:n,x:yDe(t.x),y:yDe(t.y),width:yDe(t.width),height:yDe(t.height),preserveAspectRatio:"xMidYMid meet",overflow:"hidden","pointer-events":"none"},children:[]}]}}function yus(e){let t=`Unable to render schematic graphic "${e.schematic_graphic_id}"`,{asset:n,svg_content:o}=e;if(!n){if(o!==void 0)return kfo(o);throw Error(`${t}: asset or svg_content is required`)}if(I2o(n.mimetype)!==x_e)throw Error(`${t}: asset.mimetype must be "${x_e}" (received ${JSON.stringify(n.mimetype)})`);let r=n.url.trim();if(r.toLowerCase().startsWith("data:"))return xus(r,t),r;if(o!==void 0)return kfo(o);throw Error(`${t}: asset.url must be an inline SVG data URL because circuit-to-svg cannot synchronously load ${JSON.stringify(n.url)}`)}function xus(e,t){let n=e.match(/^data:([^,]*),(.*)$/is);if(!n)throw Error(`${t}: asset.url is not a valid SVG data URL`);let o=n[1].split(";").map((c)=>c.trim());if(I2o(o.shift()??"")!==x_e)throw Error(`${t}: asset.url must use the "${x_e}" media type`);let i=n[2],s=o.findIndex((c)=>c.toLowerCase()==="base64"),a=s!==-1;if(a&&s!==o.length-1)throw Error(`${t}: asset.url must place "base64" as its final metadata token`);if(a){let c=i.replace(/\s+/g,"");if(!/^(?:[a-z\d+/]{4})*(?:[a-z\d+/]{2}==|[a-z\d+/]{3}=)?$/i.test(c))throw Error(`${t}: asset.url is not a valid SVG data URL`);return}if(i.includes("#"))throw Error(`${t}: asset.url must percent-encode "#" in a non-base64 SVG data URL`);try{decodeURIComponent(i)}catch(c){throw Error(`${t}: asset.url is not a valid SVG data URL`,{cause:c})}}function kfo(e){let t=new TextEncoder().encode(e),n="",o=32768;for(let r=0;r<t.length;r+=o)n+=String.fromCharCode(...t.subarray(r,r+o));return`data:${x_e};base64,${btoa(n)}`}function I2o(e){return(e.split(";",1)[0]??"").trim().toLowerCase()}var pg=(e)=>Math.abs(e.a)*0.02,Mft=({text:e,realCenter:t,realToScreenTransform:n})=>{let o=Vt(n,t);return{type:"element",name:"text",value:"",attributes:{x:o.x.toString(),y:o.y.toString(),fill:"red","text-anchor":"middle","dominant-baseline":"middle","font-family":"sans-serif","font-size":`${PC(n,"error")}px`},children:[{type:"text",value:e,name:"",attributes:{},children:[]}]}},Cus=({schNetLabel:e,realToScreenTransform:t,colorMap:n})=>{if(!e.text)return[];let o=e.text.startsWith("N_"),r=o?e.text.slice(2):e.text,i=f2o(e),s=[],a=zs[e.symbol_name];if(!a){let H=Mft({text:`Symbol not found: ${e.symbol_name}`,realCenter:e.center,realToScreenTransform:t});return H.attributes={...H.attributes,...i},s.push(H),s}let c=a.primitives.filter((H)=>H.type==="path"),l=a.primitives.filter((H)=>H.type==="text"),h=a.primitives.filter((H)=>H.type==="circle"),d=a.primitives.filter((H)=>H.type==="box"),u={minX:Math.min(...c.flatMap((H)=>H.points.map((V)=>V.x))),maxX:Math.max(...c.flatMap((H)=>H.points.map((V)=>V.x))),minY:Math.min(...c.flatMap((H)=>H.points.map((V)=>V.y))),maxY:Math.max(...c.flatMap((H)=>H.points.map((V)=>V.y)))},_=RH("net_label"),m=MDe({...e,text:r})+NH*2+ioe*r.length+roe,A=soe(e.anchor_side),g=e.anchor_position??{x:e.center.x-A.x*m*_/2,y:e.center.y-A.y*m*_/2},y=T2(0/180*Math.PI),x={minX:Math.min(...a.primitives.flatMap((H)=>H.type==="path"?H.points.map((V)=>V.x):[])),maxX:Math.max(...a.primitives.flatMap((H)=>H.type==="path"?H.points.map((V)=>V.x):[])),minY:Math.min(...a.primitives.flatMap((H)=>H.type==="path"?H.points.map((V)=>V.y):[])),maxY:Math.max(...a.primitives.flatMap((H)=>H.type==="path"?H.points.map((V)=>V.y):[]))},C=a.ports?.[0]?{x:a.ports[0].x,y:a.ports[0].y}:{x:x.minX,y:(x.minY+x.maxY)/2},b=Vt(y,C),I=va(Wc(g.x-b.x,g.y-b.y),y,kp(1)),[v,P]=Vt(va(t,I),[u.minX,u.minY]),[M,B]=Vt(va(t,I),[u.maxX,u.maxY]),T=Math.abs(B-P),N=Math.min(P,B),D=Math.abs(M-v),L=Math.min(v,M);s.push({name:"rect",type:"element",value:"",attributes:{class:"component-overlay sch-component-overlay sch-net-label-overlay",...i,x:L.toString(),y:N.toString(),width:D.toString(),height:T.toString(),fill:"transparent"},children:[]});for(let H of c){let V=H.points.map((O,U)=>{let[j,Y]=Vt(va(t,I),[O.x,O.y]);return`${U===0?"M":"L"} ${j} ${Y}`}).join(" ");s.push({name:"path",type:"element",attributes:{class:"sch-net-label-symbol-path",...i,d:V+(H.closed?" Z":""),stroke:n.schematic.component_outline,fill:"none","stroke-width":`${pg(t)}px`,"stroke-linecap":"round"},value:"",children:[]})}for(let H of l){let V=Vt(va(t,I),H),O=H.text;if(O==="{REF}")O=r||"";else if(O==="{VAL}")O="";let j=Math.abs(t.a)*0.1,Y={x:V.x,y:V.y};s.push({name:"text",type:"element",attributes:{class:"sch-net-label-symbol-text",...i,x:Y.x.toString(),y:Y.y.toString(),fill:n.schematic.label_local,"font-family":"sans-serif","text-anchor":ius[H.anchor],"dominant-baseline":Qfo[H.anchor],"font-size":`${PC(t,"reference_designator")}px`,...o&&O===r?{style:"text-decoration: overline;"}:{}},children:Dft(O,H.text==="{REF}"?e.display_superscript:void 0,PC(t,"reference_designator"),Qfo[H.anchor]),value:""})}for(let H of d){let V=Vt(va(t,I),H),O=va(t,I).a;s.push({name:"rect",type:"element",attributes:{class:"sch-net-label-symbol-box",...i,x:V.x.toString(),y:V.y.toString(),width:(H.width*O).toString(),height:(H.height*O).toString(),fill:"red"},value:"",children:[]})}for(let H of h){let V=Vt(va(t,I),H),O=va(t,I).a;s.push({name:"circle",type:"element",attributes:{class:"sch-net-label-symbol-circle",...i,cx:V.x.toString(),cy:V.y.toString(),r:(H.radius*O).toString(),fill:"none",stroke:n.schematic.component_outline,"stroke-width":`${pg(t)}px`},value:"",children:[]})}return s},bus=({schNetLabel:e,realToScreenTransform:t,colorMap:n})=>{if(!e.text)return[];let o=e.text;if(e.symbol_name)return Cus({schNetLabel:e,realToScreenTransform:t,colorMap:n});let r=f2o(e),i=[],s=PC(t,"net_label"),a=RH("net_label"),c=A2o/a/2,l=MDe({...e,text:o}),h=Vt(t,e.center),d=soe(e.anchor_side),u={...d};u.y*=-1;let _=l+NH*2+ioe*o.length+roe,p=e.anchor_position?Vt(t,e.anchor_position):{x:h.x-u.x*_*s/2,y:h.y-u.y*_*s/2},m=e.anchor_position??{x:e.center.x-d.x*_*a/2,y:e.center.y-d.y*_*a/2},A={left:0,top:-90,bottom:90,right:180}[e.anchor_side],g=[{x:0,y:0},{x:NH,y:c},{x:NH*2+roe+ioe*o.length+l,y:c},{x:NH*2+roe+ioe*o.length+l,y:-c},{x:NH,y:-c}].map((b)=>Vt(va(t,Wc(m.x,m.y),kp(a),T2(A/180*Math.PI)),b)),f=`
    M ${g[0].x},${g[0].y}
    L ${g[1].x},${g[1].y}
    L ${g[2].x},${g[2].y}
    L ${g[3].x},${g[3].y}
    L ${g[4].x},${g[4].y}
    Z
  `;i.push({name:"path",type:"element",attributes:{class:"net-label sch-net-label",...r,d:f,fill:n.schematic.label_background,stroke:n.schematic.label_global,"stroke-width":`${pg(t)}px`},value:"",children:[]});let y={x:p.x+u.x*s*0.5,y:p.y+u.y*s*0.5},x={left:"start",top:"start",bottom:"start",right:"end"}[e.anchor_side],C={left:"",right:"",top:`rotate(90 ${y.x} ${y.y})`,bottom:`rotate(-90 ${y.x} ${y.y})`}[e.anchor_side];return i.push({name:"text",type:"element",attributes:{class:"net-label-text sch-net-label-text",...r,x:y.x.toString(),y:y.y.toString(),fill:n.schematic.label_global,"text-anchor":x,"dominant-baseline":"central","font-family":"sans-serif","font-variant-numeric":"tabular-nums","font-size":`${s}px`,transform:C},children:Dft(o,e.display_superscript,s),value:""}),i},Ius=0.02,vus=({schPort:e,transform:t})=>{let n=Vt(t,e.center),o=Math.abs(t.a)*Ius*2;return[{name:"g",type:"element",value:"",attributes:{class:"schematic-port-hover sch-port-hover","data-schematic-port-id":e.source_port_id,...e.schematic_sheet_id?{"data-schematic-sheet-id":e.schematic_sheet_id}:{}},children:[{name:"circle",type:"element",value:"",attributes:{cx:n.x.toString(),cy:n.y.toString(),r:o.toString(),fill:"red",opacity:"0"},children:[]}]}]},Sus=({component:e,transform:t,circuitJson:n})=>{let o=ug(n).schematic_port.list({schematic_component_id:e.schematic_component_id}),r=[];for(let i of o)r.push(...vus({schPort:i,transform:t}));return r},Pus=({schPort:e,transform:t,colorMap:n})=>{let{x:r,y:i}=e.center,s=[-1,1].map((a)=>{let c=Vt(t,{x:r-0.05,y:i-a*0.05}),l=Vt(t,{x:r+0.05,y:i+a*0.05});return`M ${c.x} ${c.y} L ${l.x} ${l.y}`}).join(" ");return{name:"path",type:"element",value:"",attributes:{class:"sch-port-no-connect","data-schematic-port-id":e.schematic_port_id,"data-source-port-id":e.source_port_id,d:s,fill:"none",stroke:n.schematic.no_connect,"stroke-width":`${pg(t)}px`,"stroke-linecap":"round"},children:[]}},Lfo=0.02,Eus=({schPort:e,transform:t,circuitJson:n,colorMap:o})=>{let r=[],i=Math.abs(t.a)*Lfo,s=Math.abs(t.a)*Lfo,a=Vt(t,e.center),c=n.find((h)=>h.type==="source_port"&&h.source_port_id===e.source_port_id);if(!c?.do_not_connect)r.push({name:"circle",type:"element",value:"",attributes:{class:"component-pin sch-component-pin sch-port-indicator",cx:a.x.toString(),cy:a.y.toString(),r:i.toString(),fill:"none",stroke:o.schematic.component_outline,"stroke-width":s.toString(),"data-schematic-port-id":e.schematic_port_id},children:[]});let l=e.display_pin_label??c?.name;if(l){let h={...e.center},d=e.distance_from_component_edge??0,u=0.05,_="middle",p="";switch(e.facing_direction){case"left":h.x+=d/2,h.y+=0.05,_="start";break;case"right":h.x-=d/2,h.y+=0.05,_="end";break;case"up":h.y-=d/2,h.x-=0.05,_="middle";break;case"down":h.y+=d/2,h.x-=0.05,_="middle";break}let m=Vt(t,h),A=PC(t,"pin_number");if(e.facing_direction==="up"||e.facing_direction==="down")p=`rotate(-90 ${m.x} ${m.y})`;r.push({name:"text",type:"element",value:"",attributes:{class:"port-indicator-label sch-port-label",x:m.x.toString(),y:m.y.toString(),fill:o.schematic.component_outline,"font-family":"sans-serif","font-size":`${A*0.7}px`,"text-anchor":_,"dominant-baseline":"middle",...p&&{transform:p}},children:[{type:"text",value:l,name:"",attributes:{},children:[]}]})}return r},v2o=(e)=>({type:"element",name:"tspan",value:"",attributes:e.is_overlined?{"text-decoration":"overline"}:{},children:[{type:"text",name:"",value:e.text,attributes:{},children:[]}]}),Mus=(e)=>e.filter((t)=>t.text).map(v2o),wus=(e)=>{let t=[[]];for(let n of e)n.text.split(`
`).forEach((o,r)=>{if(r>0)t.push([]);if(o)t.at(-1).push(v2o({...n,text:o}))});return t},Rft=({elm:e,transform:t,colorMap:n})=>{let o=Vt(t,e.position),r={center:"middle",center_right:"end",bottom_left:"start",bottom_center:"middle",bottom_right:"end",left:"start",right:"end",top:"middle",bottom:"middle",top_left:"start",top_center:"middle",top_right:"end",center_left:"start"},i={center:"middle",center_right:"middle",bottom_left:"ideographic",bottom_center:"ideographic",bottom_right:"ideographic",left:"middle",right:"middle",top:"hanging",bottom:"ideographic",top_left:"hanging",top_center:"hanging",top_right:"hanging",center_left:"middle"},s=e.text.split(`
`),a=wus(e.text_parts??[]),c=s.length===1?e.text_parts?.length?a[0]:[{type:"text",value:e.text,name:e.schematic_text_id,attributes:{},children:[]}]:s.map((l,h)=>({type:"element",name:"tspan",value:"",attributes:{x:o.x.toString(),...h>0?{dy:"1em"}:{}},children:e.text_parts?.length?a[h]??[]:[{type:"text",value:l,name:h===0?e.schematic_text_id:"",attributes:{},children:[]}]}));if(e.display_superscript)(s.length===1?c:c[c.length-1].children).push(...Dft("",e.display_superscript,PC(t,"reference_designator",e.font_size),i[e.anchor]).slice(1));return{type:"element",name:"text",value:"",attributes:{class:"sch-text","data-schematic-text-id":e.schematic_text_id,x:o.x.toString(),y:o.y.toString(),fill:e.color??n.schematic.sheet_label,"text-anchor":r[e.anchor],"dominant-baseline":i[e.anchor],"font-family":"sans-serif","font-size":`${PC(t,"reference_designator",e.font_size)}px`,transform:`rotate(${e.rotation}, ${o.x}, ${o.y})`},children:c}};function S2o({schArc:e,transform:t,colorMap:n}){let o=Vt(t,e.center),r=Math.abs(t.a)*e.radius,i=e.stroke_width??0.02,s=Math.abs(t.a)*i,a=e.start_angle_degrees*Math.PI/180,c=e.end_angle_degrees*Math.PI/180,l=o.x+r*Math.cos(a),h=o.y+r*Math.sin(a),d=o.x+r*Math.cos(c),u=o.y+r*Math.sin(c),_=e.end_angle_degrees-e.start_angle_degrees;if(e.direction==="clockwise")_=-_;if(_<0)_+=360;let p=_>180?1:0,m=e.direction==="clockwise"?1:0;return[{name:"path",type:"element",attributes:{class:"sch-arc",d:`M ${l} ${h} A ${r} ${r} 0 ${p} ${m} ${d} ${u}`,fill:"none",stroke:e.color,"stroke-width":s.toString(),...e.is_dashed&&{"stroke-dasharray":(s*3).toString()},"data-schematic-arc-id":e.schematic_arc_id,...e.schematic_component_id&&{"data-schematic-component-id":e.schematic_component_id}},children:[],value:""}]}var Bus=({schematicBox:e,transform:t,colorMap:n})=>{let o=Vt(t,{x:e.x,y:e.y}),r=Vt(t,{x:e.x+e.width,y:e.y+e.height}),i=Math.min(o.y,r.y),s=Math.max(o.y,r.y),a=Math.min(o.x,r.x),c=Math.max(o.x,r.x),l=pg(t),h={class:"schematic-box sch-box",x:a.toString(),y:i.toString(),width:(c-a).toString(),height:(s-i).toString(),"stroke-width":`${l}px`,stroke:n.schematic.component_outline||"black",fill:"transparent"};if(e.is_dashed){let d=8*l,u=4*l;h["stroke-dasharray"]=`${d} ${u}`}return[{name:"rect",type:"element",value:"",attributes:h,children:[]}]};function P2o({schCircle:e,transform:t,colorMap:n}){let o=Vt(t,e.center),r=Math.abs(t.a)*e.radius,i=e.stroke_width??0.02,s=Math.abs(t.a)*i;return[{name:"circle",type:"element",attributes:{class:"sch-circle",cx:o.x.toString(),cy:o.y.toString(),r:r.toString(),fill:e.is_filled?e.fill_color??e.color:"none",stroke:e.color,"stroke-width":s.toString(),...e.is_dashed&&{"stroke-dasharray":(s*3).toString()},"data-schematic-circle-id":e.schematic_circle_id,...e.schematic_component_id&&{"data-schematic-component-id":e.schematic_component_id}},children:[],value:""}]}var E2o=(e,t)=>{for(let n of e){if(n.type!=="source_trace")continue;let o=n;if(Array.isArray(o.connected_source_port_ids)&&o.connected_source_port_ids.includes(t))return!0}return!1},Tus={top_left:"start",top_right:"end",middle_left:"start",middle_right:"end",bottom_left:"start",bottom_right:"end",center:"middle",middle_top:"middle",middle_bottom:"middle"},Dus={top_left:"hanging",top_right:"hanging",bottom_left:"ideographic",bottom_right:"ideographic",center:"middle",middle_left:"middle",middle_right:"middle",middle_top:"hanging",middle_bottom:"ideographic"},Nus=({component:e,transform:t,circuitJson:n,colorMap:o})=>{let r=[],i=zs[e.symbol_name];if(!i)return[Mft({text:`Symbol not found: ${e.symbol_name}`,realCenter:e.center,realToScreenTransform:t})];let s=ug(n).schematic_port.list({schematic_component_id:e.schematic_component_id}),a=ug(n).source_component.get(e.source_component_id),c=y2o({schPorts:s,symbol:i,schComponent:e});if(!c[0])return[Mft({text:`Could not match ports for symbol ${e.symbol_name}`,realCenter:e.center,realToScreenTransform:t})];let l=x2o(c[1]?.symbolPort??i.center,c[1]?.schPort.center??e.center,c[0].symbolPort,c[0].schPort.center),h=i.primitives.filter((v)=>v.type==="path"),d=i.primitives.filter((v)=>v.type==="text"),u=i.primitives.filter((v)=>v.type==="circle"),_=i.primitives.filter((v)=>v.type==="box"),p=new Set;for(let v of c)if(E2o(n,v.schPort.source_port_id)||ug(n).source_port.get(v.schPort.source_port_id)?.do_not_connect)p.add(v.symbolPort);let m={minX:Math.min(...h.flatMap((v)=>v.points.map((P)=>P.x))),maxX:Math.max(...h.flatMap((v)=>v.points.map((P)=>P.x))),minY:Math.min(...h.flatMap((v)=>v.points.map((P)=>P.y))),maxY:Math.max(...h.flatMap((v)=>v.points.map((P)=>P.y)))},[A,g]=Vt(va(t,l),[m.minX,m.minY]),[f,y]=Vt(va(t,l),[m.maxX,m.maxY]),x=Math.abs(y-g),C=Math.min(g,y),b=Math.abs(f-A),I=Math.min(A,f);r.push({name:"rect",type:"element",value:"",attributes:{class:"component-overlay sch-component-overlay",x:I.toString(),y:C.toString(),width:b.toString(),height:x.toString(),fill:"transparent"},children:[]});for(let v of h){let{points:P,color:M,closed:B,fill:T}=v;r.push({type:"element",name:"path",attributes:{class:"sch-component-symbol-path",d:P.map((N,D)=>{let[L,H]=Vt(va(t,l),[N.x,N.y]);return`${D===0?"M":"L"} ${L} ${H}`}).join(" ")+(B?" Z":""),stroke:o.schematic.component_outline,fill:"none","stroke-width":`${pg(t)}px`,"stroke-linecap":"round"},value:"",children:[]})}for(let v of d){let P=Vt(va(t,l),v),M="",B=v.text==="{REF}";if(B)M=a?.display_name??a?.name??"";else if(v.text==="{VAL}")M=e.symbol_display_value??"";let T=Dus[v.anchor];r.push({name:"text",type:"element",attributes:{class:B?"sch-component-name sch-component-text":"sch-component-text",x:P.x.toString(),y:P.y.toString(),...B?{stroke:o.schematic.background,"stroke-width":`${pg(t)}px`,"paint-order":"stroke"}:{},fill:o.schematic.label_local,"font-family":"sans-serif","text-anchor":Tus[v.anchor],"dominant-baseline":T,"font-size":`${PC(t,"reference_designator")}px`},value:"",children:[{type:"text",value:M,name:"",attributes:{},children:[]}]})}for(let v of _){let P=Vt(va(t,l),v),M=va(t,l).a;r.push({name:"rect",type:"element",attributes:{class:"sch-component-symbol-box",x:P.x.toString(),y:P.y.toString(),width:(v.width*M).toString(),height:(v.height*M).toString(),fill:"red"},value:"",children:[]})}for(let v of i.ports){if(p.has(v))continue;let P=Vt(va(t,l),v);r.push({type:"element",name:"circle",attributes:{class:"component-pin sch-component-pin",cx:P.x.toString(),cy:P.y.toString(),r:`${Math.abs(t.a)*0.02}px`,"stroke-width":`${pg(t)}px`,fill:"none",stroke:o.schematic.component_outline},value:"",children:[]})}for(let v of u){let P=Vt(va(t,l),v),M=Math.abs(v.radius*t.a);r.push({type:"element",name:"circle",attributes:{class:"sch-component-symbol-circle",cx:P.x.toString(),cy:P.y.toString(),r:`${M}px`,"stroke-width":`${pg(t)}px`,fill:"none",stroke:o.schematic.component_outline},value:"",children:[]})}return r},u_e=0.02,Hfo=(e,t,n,o,r)=>{let i=Math.PI/6,s={x:e.x-n*Math.cos(t-i),y:e.y-n*Math.sin(t-i)},a={x:e.x-n*Math.cos(t+i),y:e.y-n*Math.sin(t+i)};return{name:"polygon",type:"element",attributes:{points:`${e.x},${e.y} ${s.x},${s.y} ${a.x},${a.y}`,fill:"white",stroke:o,"stroke-width":`${r}px`},value:"",children:[]}},Rus=({schPort:e,schComponent:t,transform:n,circuitJson:o})=>{let r=[],i=ug(o).source_port.get(e.source_port_id),s={x:e.center.x,y:e.center.y},a=e.distance_from_component_edge??0.4;switch(e.side_of_component){case"left":s.x+=a;break;case"right":s.x-=a;break;case"top":s.y-=a;break;case"bottom":s.y+=a;break}let c=Vt(n,e.center),l=Vt(n,s),h=i!=null&&i.source_component_id==null&&typeof e.is_connected==="boolean"?e.is_connected:E2o(o,e.source_port_id),d=e.is_drawn_with_inversion_circle??!1,u=0.06,_={...e.center};if(!h&&!i?.do_not_connect)switch(e.side_of_component){case"left":_.x+=u_e;break;case"right":_.x-=u_e;break;case"top":_.y-=u_e;break;case"bottom":_.y+=u_e;break}let p=Vt(n,_);if(d){let y=Math.abs(n.a)*u,x={...l};switch(e.side_of_component){case"left":x.x-=y,l.x-=y*2;break;case"right":x.x+=y,l.x+=y*2;break;case"top":x.y-=y,l.y-=y*2;break;case"bottom":x.y+=y,l.y+=y*2;break}r.push({name:"circle",type:"element",attributes:{class:"component-pin sch-component-pin sch-inversion-bubble",cx:x.x.toString(),cy:x.y.toString(),r:y.toString(),fill:"white",stroke:Ef.schematic.component_outline,"stroke-width":`${pg(n)}px`},value:"",children:[]})}r.push({name:"line",type:"element",attributes:{class:"component-pin sch-component-pin sch-port-line",x1:l.x.toString(),y1:l.y.toString(),x2:p.x.toString(),y2:p.y.toString(),"stroke-width":`${pg(n)}px`},value:"",children:[]});let m=Math.abs(n.a)*u_e,A=[];if(!h&&!i?.do_not_connect)A.push({name:"circle",type:"element",attributes:{class:"component-pin sch-component-pin sch-port-terminal",cx:c.x.toString(),cy:c.y.toString(),r:m.toString(),"stroke-width":`${pg(n)}px`},value:"",children:[]});A.push({name:"rect",type:"element",attributes:{x:(c.x-m).toString(),y:(c.y-m).toString(),width:(m*2).toString(),height:(m*2).toString(),opacity:"0"},value:"",children:[]}),r.push({name:"g",type:"element",value:"",attributes:{class:"sch-port","data-schematic-port-id":e.source_port_id},children:A});let{has_input_arrow:g,has_output_arrow:f}=e;if((g||f)&&e.side_of_component){let y=Math.abs(n.a)*0.1,x=Ef.schematic.component_outline,C=y*Math.cos(Math.PI/6),b=pg(n)/3,I=0,v=0;if(e.side_of_component==="left")I=0,v=Math.PI;else if(e.side_of_component==="right")I=Math.PI,v=0;else if(e.side_of_component==="top")I=Math.PI/2,v=-Math.PI/2;else if(e.side_of_component==="bottom")I=-Math.PI/2,v=Math.PI/2;let P=g&&f,M={...l},B={...l};if(P){let T=C;if(e.side_of_component==="left")B.x-=T;else if(e.side_of_component==="right")B.x+=T;else if(e.side_of_component==="top")B.y-=T;else if(e.side_of_component==="bottom")B.y+=T}if(g)r.push(Hfo(M,I,y,x,b));if(f){let T={x:B.x+y*Math.cos(v),y:B.y+y*Math.sin(v)};r.push(Hfo(T,v,y,x,b))}}return r},Qus=(e)=>{let t=[],{schPort:n,schComponent:o,transform:r,circuitJson:i}=e,s={x:n.center.x,y:n.center.y};if(!n.side_of_component)return[];let a=soe(n.side_of_component),c=n.distance_from_component_edge??0.4;if(s.x+=a.x*c/2,s.y+=a.y*c/2,n.side_of_component==="top"||n.side_of_component==="bottom")s.x-=0.02;else s.y+=0.02;let l=Vt(r,s);return t.push({name:"text",type:"element",attributes:{class:"pin-number sch-pin-number",x:l.x.toString(),y:l.y.toString(),style:"font-family: sans-serif;",fill:Ef.schematic.pin_number,"text-anchor":"middle","dominant-baseline":"auto","font-size":`${PC(r,"pin_number")}px`,transform:n.side_of_component==="top"||n.side_of_component==="bottom"?`rotate(-90 ${l.x} ${l.y})`:""},children:[{type:"text",value:n.pin_number?.toString()||"",name:"",attributes:{},children:[]}],value:""}),t},Ffo=0.1,M2o=(e)=>{let t=[],{schPort:n,schComponent:o,transform:r,labelColor:i=Ef.schematic.pin_number,labelClassName:s="pin-number sch-pin-label"}=e,a={x:n.center.x,y:n.center.y};if(!n.side_of_component)return[];let c=soe(n.side_of_component),l=n.distance_from_component_edge??0.4;a.x+=c.x*(l+Ffo),a.y+=c.y*(l+Ffo);let h=Vt(r,a),d=n.display_pin_label??o.port_labels?.[`${n.pin_number}`];if(!d)return[];let u=d.startsWith("N_"),_=u?d.slice(2):d,p=n.display_pin_label_text_parts,m=n.is_drawn_with_inversion_circle??!1,A=PC(r,u||m?"negated_pin_number":"pin_number",n.display_pin_label_font_size);return t.push({name:"text",type:"element",attributes:{class:s,x:h.x.toString(),y:h.y.toString(),style:`font-family: sans-serif;${u&&!p?.length?" text-decoration: overline;":""}`,fill:i,"text-anchor":n.side_of_component==="left"||n.side_of_component==="bottom"?"start":"end","dominant-baseline":"middle","font-size":`${A}px`,transform:n.side_of_component==="top"||n.side_of_component==="bottom"?`rotate(-90 ${h.x} ${h.y})`:""},children:p?.length?Mus(p):[{type:"text",value:_||"",name:"",attributes:{},children:[]}],value:""}),t},kus=(e)=>{let t=[],{schPort:n,schComponent:o,transform:r,circuitJson:i}=e;return t.push(...Rus(e)),t.push(...Qus(e)),t.push(...M2o(e)),t},Lus=({component:e,transform:t,circuitJson:n,colorMap:o})=>{let r=[],i=Vt(t,{x:e.center.x-e.size.width/2,y:e.center.y+e.size.height/2}),s=Vt(t,{x:e.center.x+e.size.width/2,y:e.center.y-e.size.height/2}),a=s.x-i.x,c=s.y-i.y;r.push({name:"rect",type:"element",value:"",attributes:{class:"component chip sch-component-body",x:i.x.toString(),y:i.y.toString(),width:a.toString(),height:c.toString(),"stroke-width":`${pg(t)}px`,fill:o.schematic.component_body,stroke:o.schematic.component_outline},children:[]}),r.push({name:"rect",type:"element",value:"",attributes:{class:"component-overlay sch-component-overlay",x:i.x.toString(),y:i.y.toString(),width:a.toString(),height:c.toString(),fill:"transparent"},children:[]});let l=ug(n).schematic_text.list();for(let d of l)if(d.schematic_component_id===e.schematic_component_id)r.push(Rft({elm:d,transform:t,colorMap:o}));let h=ug(n).schematic_port.list({schematic_component_id:e.schematic_component_id});for(let d of h)r.push(...kus({schPort:d,schComponent:e,transform:t,circuitJson:n}));return r};function w2o({isDashed:e,dashLength:t,dashGap:n,strokeWidth:o,transform:r}){if(!e)return;let i=Math.abs(r.a),s=o*i*3,a=t!==void 0?t*i:s,c=n!==void 0?n*i:s;return`${a} ${c}`}function B2o({schLine:e,transform:t,colorMap:n}){let o=Vt(t,{x:e.x1,y:e.y1}),r=Vt(t,{x:e.x2,y:e.y2}),i=e.stroke_width??0.02,s=Math.abs(t.a)*i,a=w2o({isDashed:e.is_dashed,dashLength:e.dash_length,dashGap:e.dash_gap,strokeWidth:i,transform:t});return[{name:"line",type:"element",attributes:{class:"sch-line",x1:o.x.toString(),y1:o.y.toString(),x2:r.x.toString(),y2:r.y.toString(),stroke:e.color,"stroke-width":s.toString(),...a&&{"stroke-dasharray":a},"data-schematic-line-id":e.schematic_line_id,...e.schematic_component_id&&{"data-schematic-component-id":e.schematic_component_id}},children:[],value:""}]}function T2o({schRect:e,transform:t,colorMap:n}){let o=Vt(t,e.center),r=Math.abs(t.a)*e.width,i=Math.abs(t.d)*e.height,s=e.stroke_width??0.02,a=Math.abs(t.a)*s,c=o.x-r/2,l=o.y-i/2;return[{name:"rect",type:"element",attributes:{class:"sch-rect",x:c.toString(),y:l.toString(),width:r.toString(),height:i.toString(),fill:e.is_filled?e.fill_color??e.color:"none",stroke:e.color,"stroke-width":a.toString(),...e.is_dashed&&{"stroke-dasharray":(a*3).toString()},...e.rotation!==0&&{transform:`rotate(${e.rotation} ${o.x} ${o.y})`},"data-schematic-rect-id":e.schematic_rect_id,...e.schematic_component_id&&{"data-schematic-component-id":e.schematic_component_id}},children:[],value:""}]}function D2o({schPath:e,transform:t,colorMap:n}){let o=e.stroke_color??n.schematic.component_outline,r=e.fill_color??"none",i=e.stroke_width??0.02,s=Math.abs(t.a)*i,a=w2o({isDashed:e.is_dashed,dashLength:e.dash_length,dashGap:e.dash_gap,strokeWidth:i,transform:t});if(!e.points||e.points.length<2)return[];return[{name:"path",type:"element",attributes:{class:"sch-path",d:e.points.map((h)=>Vt(t,{x:h.x,y:h.y})).map((h,d)=>`${d===0?"M":"L"} ${h.x} ${h.y}`).join(" "),stroke:o,"stroke-width":s.toString(),fill:e.is_filled?r:"none","stroke-linecap":"round","stroke-linejoin":"round",...a&&{"stroke-dasharray":a},...e.schematic_component_id&&{"data-schematic-component-id":e.schematic_component_id}},children:[],value:""}]}var Hus=({component:e,transform:t,circuitJson:n,colorMap:o})=>{let r=[],i=e.schematic_component_id;for(let s of n){if(!("schematic_component_id"in s)||s.schematic_component_id!==i)continue;if(s.type==="schematic_text"&&e.is_box_with_pins===!1)r.push(Rft({elm:s,transform:t,colorMap:o}));else if(s.type==="schematic_line")r.push(...B2o({schLine:s,transform:t,colorMap:o}));else if(s.type==="schematic_circle")r.push(...P2o({schCircle:s,transform:t,colorMap:o}));else if(s.type==="schematic_rect")r.push(...T2o({schRect:s,transform:t,colorMap:o}));else if(s.type==="schematic_arc")r.push(...S2o({schArc:s,transform:t,colorMap:o}));else if(s.type==="schematic_path")r.push(...D2o({schPath:s,transform:t,colorMap:o}))}if(e.is_box_with_pins===!1){let s=n.filter((c)=>c.type==="schematic_line"&&c.schematic_component_id===i),a=n.filter((c)=>c.type==="schematic_port"&&c.schematic_component_id===i);for(let c of a){let l=s.find((m)=>m.x1===c.center.x&&m.y1===c.center.y||m.x2===c.center.x&&m.y2===c.center.y);if(!l)continue;let h=l.x1===c.center.x&&l.y1===c.center.y?{x:l.x2,y:l.y2}:{x:l.x1,y:l.y1},d=h.x-c.center.x,u=h.y-c.center.y,_=Math.abs(d)>Math.abs(u)?d>0?"left":"right":u>0?"bottom":"top",p=Math.max(Math.abs(d),Math.abs(u));r.push(...M2o({schPort:{...c,side_of_component:_,distance_from_component_edge:p},schComponent:e,transform:t,circuitJson:n,labelClassName:"port-label sch-pin-label",labelColor:o.schematic.pin_name}))}}return r};function Fus(e){let{component:t}=e,n=[];if(t.is_box_with_pins!==!1)if(t.symbol_name)n=Nus(e);else n=Lus(e);let o=Hus(e),r=[...n,...o];return[{type:"element",name:"g",attributes:{class:"sch-component","data-circuit-json-type":"schematic_component","data-schematic-component-id":t.schematic_component_id,...t.schematic_sheet_id?{"data-schematic-sheet-id":t.schematic_sheet_id}:{}},children:r,value:""}]}function zus({debugObject:e,transform:t}){if(e.shape==="rect"){let[n,o]=Vt(t,[e.center.x-e.size.width/2,e.center.y-e.size.height/2]),[r,i]=Vt(t,[e.center.x+e.size.width/2,e.center.y+e.size.height/2]);[o,i]=[Math.min(o,i),Math.max(o,i)];let s=Math.abs(r-n),a=Math.abs(i-o),[c,l]=Vt(t,[e.center.x,e.center.y]);return[{name:"rect",type:"element",value:"",attributes:{x:n.toString(),y:o.toString(),width:s.toString(),height:a.toString(),fill:"none",stroke:"red","stroke-width":(0.02*Math.abs(t.a)).toString(),"stroke-dasharray":"5,5"},children:e.label?[{name:"text",type:"element",value:"",attributes:{x:c.toString(),y:(l-10).toString(),"text-anchor":"middle","font-size":(0.2*Math.abs(t.a)).toString(),fill:"red"},children:[{type:"text",value:e.label,name:"",attributes:{},children:[]}]}]:[]}]}if(e.shape==="line"){let[n,o]=Vt(t,[e.start.x,e.start.y]),[r,i]=Vt(t,[e.end.x,e.end.y]),s=(n+r)/2,a=(o+i)/2;return[{name:"line",type:"element",value:"",attributes:{x1:n.toString(),y1:o.toString(),x2:r.toString(),y2:i.toString(),stroke:"red","stroke-width":(0.02*Math.abs(t.a)).toString(),"stroke-dasharray":"5,5"},children:e.label?[{name:"text",type:"element",value:"",attributes:{x:s.toString(),y:(a-10).toString(),"text-anchor":"middle","font-size":(0.2*Math.abs(t.a)).toString(),fill:"red"},children:[{type:"text",value:e.label,name:"",attributes:{},children:[]}]}]:[]}]}return[]}var N2o=0.2/QH,Ous=3/QH,xDe=["1","2","3","4","5","6"],p_e=["A","B","C","D"];function Vus({schematicSheet:e,transform:t,colorMap:n}){let o=Nft(e),r=n.schematic.sheet,i=n.schematic.net_name,s=[zfo({id:`${e.schematic_sheet_id}_outer`,center:o.center,width:o.width,height:o.height,transform:t,color:r}),zfo({id:`${e.schematic_sheet_id}_inner`,center:o.center,width:o.innerMaxX-o.innerMinX,height:o.innerMaxY-o.innerMinY,transform:t,color:r})];for(let a=1;a<xDe.length;a++){let c=o.innerMinX+(o.innerMaxX-o.innerMinX)*a/xDe.length;s.push(CDe({id:`${e.schematic_sheet_id}_top_column_${a}`,x1:c,y1:o.maxY,x2:c,y2:o.innerMaxY,transform:t,color:r}),CDe({id:`${e.schematic_sheet_id}_bottom_column_${a}`,x1:c,y1:o.minY,x2:c,y2:o.innerMinY,transform:t,color:r}))}for(let a=1;a<p_e.length;a++){let c=o.innerMinY+(o.innerMaxY-o.innerMinY)*a/p_e.length;s.push(CDe({id:`${e.schematic_sheet_id}_left_row_${a}`,x1:o.minX,y1:c,x2:o.innerMinX,y2:c,transform:t,color:r}),CDe({id:`${e.schematic_sheet_id}_right_row_${a}`,x1:o.maxX,y1:c,x2:o.innerMaxX,y2:c,transform:t,color:r}))}return xDe.forEach((a,c)=>{let l=o.innerMinX+(o.innerMaxX-o.innerMinX)*(c+0.5)/xDe.length;s.push(bDe({text:a,x:l,y:(o.maxY+o.innerMaxY)/2,transform:t,color:i}),bDe({text:a,x:l,y:(o.minY+o.innerMinY)/2,transform:t,color:i}))}),p_e.forEach((a,c)=>{let l=o.innerMinY+(o.innerMaxY-o.innerMinY)*(p_e.length-c-0.5)/p_e.length;s.push(bDe({text:a,x:(o.minX+o.innerMinX)/2,y:l,transform:t,color:i}),bDe({text:a,x:(o.maxX+o.innerMaxX)/2,y:l,transform:t,color:i}))}),[{name:"g",type:"element",value:"",attributes:{class:"schematic-sheet","data-circuit-json-type":"schematic_sheet","data-schematic-sheet-id":e.schematic_sheet_id},children:s}]}function zfo({id:e,center:t,width:n,height:o,transform:r,color:i}){let s=Vt(r,t),a=Math.abs(r.a)*n,c=Math.abs(r.d)*o;return{name:"rect",type:"element",value:"",attributes:{class:"sch-rect",x:(s.x-a/2).toString(),y:(s.y-c/2).toString(),width:a.toString(),height:c.toString(),fill:"none",stroke:i,"stroke-width":(Math.abs(r.a)*N2o).toString(),"data-schematic-rect-id":e},children:[]}}function CDe({id:e,x1:t,y1:n,x2:o,y2:r,transform:i,color:s}){let a=Vt(i,{x:t,y:n}),c=Vt(i,{x:o,y:r});return{name:"line",type:"element",value:"",attributes:{class:"sch-line",x1:a.x.toString(),y1:a.y.toString(),x2:c.x.toString(),y2:c.y.toString(),stroke:s,"stroke-width":(Math.abs(i.a)*N2o).toString(),"data-schematic-line-id":e},children:[]}}function bDe({text:e,x:t,y:n,transform:o,color:r}){let i=Vt(o,{x:t,y:n});return{type:"element",name:"text",value:"",attributes:{class:"sch-text",x:i.x.toString(),y:i.y.toString(),fill:r,"text-anchor":"middle","dominant-baseline":"middle","font-family":"sans-serif","font-size":`${PC(o,"reference_designator",Ous)}px`,transform:`rotate(0, ${i.x}, ${i.y})`},children:[{type:"text",value:e,name:"",attributes:{},children:[]}]}}var Yus=({schematicTable:e,transform:t,colorMap:n,circuitJson:o})=>{let{anchor_position:r,border_width:i=0.05,anchor:s="center"}=e,{column_widths:a,row_heights:c}=b2o(e,o),l=a.reduce((I,v)=>I+v,0),h=c.reduce((I,v)=>I+v,0),{x:d,y:u}=r;if(s.includes("center"))d-=l/2;else if(s.includes("right"))d-=l;if(s.includes("center"))u+=h/2;else if(s.includes("bottom"))u+=h;let _=[],p=i*Math.abs(t.a),m=pg(t),[A,g]=Vt(t,[d,u]),[f,y]=Vt(t,[d+l,u-h]);_.push({name:"rect",type:"element",attributes:{class:"sch-table-border",x:A.toString(),y:g.toString(),width:(f-A).toString(),height:(y-g).toString(),fill:"none",stroke:n.schematic.table,"stroke-width":p.toString()},children:[],value:""});let x=o.filter((I)=>I.type==="schematic_table_cell"&&I.schematic_table_id===e.schematic_table_id),C=d;for(let I=0;I<a.length-1;I++){C+=a[I];let v=u;for(let P=0;P<c.length;P++){let M=v-c[P];if(!x.some((T)=>T.start_column_index<=I&&T.end_column_index>I&&T.start_row_index<=P&&T.end_row_index>=P)){let T=Vt(t,{x:C,y:v}),N=Vt(t,{x:C,y:M});_.push({name:"line",type:"element",attributes:{class:"sch-table-grid-line",x1:T.x.toString(),y1:T.y.toString(),x2:N.x.toString(),y2:N.y.toString(),stroke:n.schematic.table,"stroke-width":m.toString()},children:[],value:""})}v=M}}let b=u;for(let I=0;I<c.length-1;I++){b-=c[I];let v=d;for(let P=0;P<a.length;P++){let M=v+a[P];if(!x.some((T)=>T.start_row_index<=I&&T.end_row_index>I&&T.start_column_index<=P&&T.end_column_index>=P)){let T=Vt(t,{x:v,y:b}),N=Vt(t,{x:M,y:b});_.push({name:"line",type:"element",attributes:{class:"sch-table-grid-line",x1:T.x.toString(),y1:T.y.toString(),x2:N.x.toString(),y2:N.y.toString(),stroke:n.schematic.table,"stroke-width":m.toString()},children:[],value:""})}v=M}}for(let I of x)if(I.text){let v=a.slice(I.start_column_index,I.end_column_index+1).reduce((j,Y)=>j+Y,0),P=c.slice(I.start_row_index,I.end_row_index+1).reduce((j,Y)=>j+Y,0),M=d+a.slice(0,I.start_column_index).reduce((j,Y)=>j+Y,0),B=u-c.slice(0,I.start_row_index).reduce((j,Y)=>j+Y,0),{cell_padding:T=0.2}=e,N=I.horizontal_align??"center",D=I.vertical_align??"middle",L={x:M+v/2,y:B-P/2};if(N==="left")L.x=M+T;else if(N==="right")L.x=M+v-T;if(D==="top")L.y=B-T;else if(D==="bottom")L.y=B-P+T;let H=Vt(t,L),V=PC(t,"reference_designator",I.font_size),O={left:"start",center:"middle",right:"end"},U={top:"hanging",middle:"middle",bottom:"ideographic"};_.push({name:"text",type:"element",attributes:{class:"sch-table-text",x:H.x.toString(),y:H.y.toString(),"font-size":`${V}px`,"text-anchor":O[N],"dominant-baseline":U[D],fill:n.schematic.table,"font-family":"sans-serif"},children:[{type:"text",value:I.text,name:"",attributes:{},children:[]}],value:""})}return[{name:"g",type:"element",attributes:{class:"sch-table","data-schematic-table-id":e.schematic_table_id},children:_,value:""}]};function Gus({trace:e,transform:t,colorMap:n}){let o=e.edges;if(o.length===0)return[];let r=[],i=[],s="";for(let a=0;a<o.length;a++){let c=o[a];if(c.is_crossing)continue;let[l,h]=Vt(t,[c.from.x,c.from.y]),[d,u]=Vt(t,[c.to.x,c.to.y]);if(a===0||o[a-1]?.is_crossing)s+=`M ${l} ${h} L ${d} ${u}`;else s+=` L ${d} ${u}`}if(s)r.push({name:"path",type:"element",attributes:{d:s,class:"trace-invisible-hover-outline sch-trace-hitbox",stroke:n.schematic.wire,fill:"none","stroke-width":`${pg(t)*8}px`,"stroke-linecap":"round",opacity:"0","stroke-linejoin":"round"},value:"",children:[]}),r.push({name:"path",type:"element",attributes:{class:"sch-trace-path",d:s,stroke:n.schematic.wire,fill:"none","stroke-width":`${pg(t)}px`,"stroke-linecap":"round","stroke-linejoin":"round"},value:"",children:[]});for(let a of o){if(!a.is_crossing)continue;let[c,l]=Vt(t,[a.from.x,a.from.y]),[h,d]=Vt(t,[a.to.x,a.to.y]),u=(c+h)/2,_=(l+d)/2,p=h-c,m=d-l,A=Math.sqrt(p*p+m*m),g=A*0.7,f=-m/A*g,y=p/A*g,x=u+f,C=_-Math.abs(y);i.push({name:"path",type:"element",attributes:{class:"trace-crossing-outline sch-trace-crossing-outline",d:`M ${c} ${l} Q ${x} ${C} ${h} ${d}`,stroke:n.schematic.background,fill:"none","stroke-width":`${pg(t)*1.5}px`,"stroke-linecap":"butt"},value:"",children:[]}),i.push({name:"path",type:"element",attributes:{class:"sch-trace-crossing-path",d:`M ${c} ${l} Q ${x} ${C} ${h} ${d}`,stroke:n.schematic.wire,fill:"none","stroke-width":`${pg(t)}px`,"stroke-linecap":"round"},value:"",children:[]})}if(e.junctions)for(let a of e.junctions){let[c,l]=Vt(t,[a.x,a.y]);i.push({name:"circle",type:"element",attributes:{cx:c.toString(),cy:l.toString(),r:(Math.abs(t.a)*0.03).toString(),class:"trace-junction sch-trace-junction",fill:n.schematic.junction},value:"",children:[]})}return[{name:"g",type:"element",value:"",attributes:{class:"trace sch-trace","data-layer":"base","data-circuit-json-type":"schematic_trace","data-schematic-trace-id":e.schematic_trace_id,...e.subcircuit_connectivity_map_key&&{"data-subcircuit-connectivity-map-key":e.subcircuit_connectivity_map_key}},children:r},{name:"g",type:"element",value:"",attributes:{class:"trace-overlays sch-trace-overlays","data-layer":"overlay","data-circuit-json-type":"schematic_trace","data-schematic-trace-id":e.schematic_trace_id,...e.subcircuit_connectivity_map_key&&{"data-subcircuit-connectivity-map-key":e.subcircuit_connectivity_map_key}},children:i}]}function Uus({probe:e,transform:t,colorMap:n,fallbackColor:o}){let[r,i]=Vt(t,[e.position.x,e.position.y]),s=e.color??o??n.schematic.reference,a=Math.abs(t.a)*0.6,c=Math.abs(t.a)*0.28,l=e.label_alignment??"top_right",h,d,u,_;switch(l){case"top_left":h=-135*Math.PI/180,d="end",u=-8,_=-8;break;case"top_center":h=-90*Math.PI/180,d="middle",u=0,_=-8;break;case"top_right":h=-45*Math.PI/180,d="start",u=8,_=-8;break;case"center_left":h=180*Math.PI/180,d="end",u=-8,_=0;break;case"center":h=-90*Math.PI/180,d="middle",u=0,_=-8;break;case"center_right":h=0*Math.PI/180,d="start",u=8,_=0;break;case"bottom_left":h=135*Math.PI/180,d="end",u=-8,_=8;break;case"bottom_center":h=90*Math.PI/180,d="middle",u=0,_=8;break;case"bottom_right":h=45*Math.PI/180,d="start",u=8,_=8;break;default:h=-50*Math.PI/180,d="start",u=8,_=0}let p=r+a*Math.cos(h),m=i+a*Math.sin(h),A=r,g=i,f=[`M ${p},${m}`,`L ${A},${g}`,`M ${A},${g}`,`L ${A-c*Math.cos((h*180/Math.PI+150)*Math.PI/180)},${g-c*Math.sin((h*180/Math.PI+150)*Math.PI/180)}`,`L ${A-c*Math.cos((h*180/Math.PI+210)*Math.PI/180)},${g-c*Math.sin((h*180/Math.PI+210)*Math.PI/180)}`,"Z"].join(" "),y=(p+u).toString(),x=(m+_).toString(),C=[];if(e.name&&e.voltage!==void 0)C.push({type:"element",name:"tspan",value:"",attributes:{x:y},children:[{type:"text",value:e.name,name:"",attributes:{},children:[]}]}),C.push({type:"element",name:"tspan",value:"",attributes:{x:y,dy:"1.2em"},children:[{type:"text",value:`${e.voltage}V`,name:"",attributes:{},children:[]}]});else{let b=[];if(e.name)b.push(e.name);if(e.voltage!==void 0)b.push(`${e.voltage}V`);C.push({type:"text",value:b.join(" "),name:"",attributes:{},children:[]})}return[{name:"path",type:"element",attributes:{class:"sch-voltage-probe",d:f,stroke:s,fill:s,"stroke-width":`${pg(t)}px`},value:"",children:[]},{type:"element",name:"text",value:"",attributes:{class:"sch-voltage-probe-label",x:y,y:x,fill:s,"text-anchor":d,"dominant-baseline":"middle","font-family":"sans-serif","font-size":`${PC(t,"reference_designator")}px`,"font-weight":"bold","data-schematic-voltage-probe-id":e.schematic_voltage_probe_id},children:C}]}var g_e=6,IDe=12,D2=12,Zne=6,Ofo=14,vDe=11,Vfo=280,Wus=140,R2o=(e)=>e.type==="schematic_component_overlap_warning"||e.type==="schematic_component_styling_warning"||e.type==="schematic_element_outside_sheet_warning"||e.type==="schematic_manual_edit_conflict_warning";function Xus({circuitJson:e,transform:t,svgWidth:n,svgHeight:o,colorMap:r}){let i=r.schematic.erc_warning,s=[];return e.filter(R2o).flatMap((a)=>{let c=jus(a,e,t);if(!c)return[];let l=Math.max(1,n-D2*2),h=t0s(a.message,Math.max(12,Math.floor((Math.min(Vfo,l)-Zne*2)/(vDe*0.56)))),d=Math.max(...h.map((y)=>y.length)),u=Math.min(Vfo,l,Math.max(Math.min(Wus,l),d*vDe*0.56+Zne*2)),_=Zne*2+h.length*Ofo,p=Jus({targetBounds:c,calloutWidth:u,calloutHeight:_,svgWidth:n,svgHeight:o,occupiedCalloutBounds:s});s.push(p);let m=e0s(a),A=wDe(c,g_e),g=Zus(p,A);return[{name:"g",type:"element",value:"",attributes:{class:"schematic-warning","data-type":a.type,"data-warning-id":m,role:"note","aria-label":a.message},children:[{name:"rect",type:"element",value:"",attributes:{x:A.minX.toString(),y:A.minY.toString(),width:(A.maxX-A.minX).toString(),height:(A.maxY-A.minY).toString(),rx:"6",fill:"none",stroke:i,"stroke-width":"1","stroke-dasharray":"4,3","data-warning-reference":"target"},children:[]},{name:"line",type:"element",value:"",attributes:{x1:g.from.x.toString(),y1:g.from.y.toString(),x2:g.to.x.toString(),y2:g.to.y.toString(),stroke:i,"stroke-width":"1","data-warning-reference":"leader"},children:[]},{name:"rect",type:"element",value:"",attributes:{x:p.minX.toString(),y:p.minY.toString(),width:u.toString(),height:_.toString(),fill:"rgba(255, 250, 235, 0.97)",stroke:i,"stroke-width":"1","data-warning-reference":"callout"},children:[]},{name:"text",type:"element",value:"",attributes:{x:(p.minX+Zne).toString(),y:(p.minY+Zne+vDe).toString(),fill:"#5c4300","font-family":"sans-serif","font-size":vDe.toString()},children:h.map((y,x)=>({name:"tspan",type:"element",value:"",attributes:{x:(p.minX+Zne).toString(),dy:x===0?"0":Ofo.toString()},children:[r0s(y)]}))}]}]})}function jus(e,t,n){let r=Kus(e).map((i)=>$us(t,i)).filter((i)=>Boolean(i)).map((i)=>qus(i,n)).filter((i)=>Boolean(i));if(r.length===0)return null;return r.reduce(n0s)}function Kus(e){switch(e.type){case"schematic_component_overlap_warning":return e.schematic_component_ids;case"schematic_component_styling_warning":return[e.schematic_component_id,...e.schematic_port_ids??[]];case"schematic_manual_edit_conflict_warning":return[e.schematic_component_id];case"schematic_element_outside_sheet_warning":return[e.schematic_element_id]}}function $us(e,t){return e.find((n)=>{if(!n.type.startsWith("schematic_"))return!1;let o=`${n.type}_id`;return n[o]===t})}function qus(e,t){if(e.type==="schematic_component"){let n=Vt(t,{x:e.center.x-e.size.width/2,y:e.center.y+e.size.height/2}),o=Vt(t,{x:e.center.x+e.size.width/2,y:e.center.y-e.size.height/2});return Sft([n,o])}if(e.type==="schematic_port"){let n=Vt(t,e.center);return wDe(Sft([n]),4)}if(e.type==="schematic_net_label"){let n=Vt(t,e.anchor_position??e.center),o=Math.max(28,e.text.length*8);return{minX:n.x-o/2,minY:n.y-10,maxX:n.x+o/2,maxY:n.y+10}}if(e.type==="schematic_trace"){let n=e.edges.flatMap((o)=>[Vt(t,o.from),Vt(t,o.to)]);if(n.length===0)return null;return wDe(Sft(n),4)}return null}function Jus({targetBounds:e,calloutWidth:t,calloutHeight:n,svgWidth:o,svgHeight:r,occupiedCalloutBounds:i}){let s=(e.minX+e.maxX)/2,a=(e.minY+e.maxY)/2,c=e.minY-g_e-IDe-n,l=e.maxY+g_e+IDe,h=e.minX-g_e-IDe-t,d=e.maxX+g_e+IDe,u=[];if(c>=D2)u.push(m_e({x:eoe(s-t/2,D2,o-D2-t),y:c,width:t,height:n,side:"top"}));if(l+n<=r-D2)u.push(m_e({x:eoe(s-t/2,D2,o-D2-t),y:l,width:t,height:n,side:"bottom"}));if(d+t<=o-D2)u.push(m_e({x:d,y:eoe(a-n/2,D2,r-D2-n),width:t,height:n,side:"right"}));if(h>=D2)u.push(m_e({x:h,y:eoe(a-n/2,D2,r-D2-n),width:t,height:n,side:"left"}));let _=u.find((p)=>i.every((m)=>!o0s(wDe(p,4),m)));if(_)return _;if(u[0])return u[0];return m_e({x:eoe(s-t/2,D2,o-D2-t),y:eoe(c,D2,r-D2-n),width:t,height:n,side:"top"})}function Zus(e,t){let n=(t.minX+t.maxX)/2,o=(t.minY+t.maxY)/2,r=(e.minX+e.maxX)/2,i=(e.minY+e.maxY)/2;switch(e.side){case"top":return{from:{x:r,y:e.maxY},to:{x:n,y:t.minY}};case"bottom":return{from:{x:r,y:e.minY},to:{x:n,y:t.maxY}};case"left":return{from:{x:e.maxX,y:i},to:{x:t.minX,y:o}};case"right":return{from:{x:e.minX,y:i},to:{x:t.maxX,y:o}}}}function e0s(e){switch(e.type){case"schematic_component_overlap_warning":return e.schematic_component_overlap_warning_id;case"schematic_component_styling_warning":return e.schematic_component_styling_warning_id;case"schematic_element_outside_sheet_warning":return e.schematic_element_outside_sheet_warning_id;case"schematic_manual_edit_conflict_warning":return e.schematic_manual_edit_conflict_warning_id}}function t0s(e,t){let n=e.trim().split(/\s+/),o=[],r="";for(let i of n){let s=r?`${r} ${i}`:i;if(s.length<=t||r.length===0){r=s;continue}o.push(r),r=i}if(r)o.push(r);return o.length>0?o:["Warning"]}function Sft(e){return{minX:Math.min(...e.map((t)=>t.x)),minY:Math.min(...e.map((t)=>t.y)),maxX:Math.max(...e.map((t)=>t.x)),maxY:Math.max(...e.map((t)=>t.y))}}function n0s(e,t){return{minX:Math.min(e.minX,t.minX),minY:Math.min(e.minY,t.minY),maxX:Math.max(e.maxX,t.maxX),maxY:Math.max(e.maxY,t.maxY)}}function wDe(e,t){return{minX:e.minX-t,minY:e.minY-t,maxX:e.maxX+t,maxY:e.maxY+t}}function o0s(e,t){return!(e.maxX<=t.minX||e.minX>=t.maxX||e.maxY<=t.minY||e.minY>=t.maxY)}function m_e({x:e,y:t,width:n,height:o,side:r}){return{minX:e,minY:t,maxX:e+n,maxY:t+o,side:r}}function eoe(e,t,n){if(n<t)return(t+n)/2;return Math.min(Math.max(e,t),n)}function r0s(e){return{name:"",type:"text",value:e,attributes:{},children:[]}}function Q2o(e,t){let n=e.filter((ne)=>ne.type==="schematic_sheet"),o=rus(n),r=o;if(t?.schematicSheetId!==void 0)r=n.find((ne)=>ne.schematic_sheet_id===t.schematicSheetId)??o;else if(t?.schematicSheetIndex!==void 0)r=n.find((ne)=>ne.sheet_index===t.schematicSheetIndex)??o;let i=r?e.filter((ne)=>!ne.type.startsWith("schematic_")||R2o(ne)||("schematic_sheet_id"in ne)&&ne.schematic_sheet_id===r.schematic_sheet_id):e,s=Aus(i),a=s.maxX-s.minX,c=s.maxY-s.minY,l=t?.width??1200,h=t?.height??600,d=t?.colorOverrides,u={...Ef,schematic:{...Ef.schematic,...d?.schematic??{}}},_=a/c,p=l/h,m;if(_>p){let ne=l/_;m={x:0,y:(h-ne)/2}}else{let ne=h*_;m={x:(l-ne)/2,y:0}}let A=tfo([{x:s.minX,y:s.maxY},{x:s.maxX,y:s.maxY},{x:s.maxX,y:s.minY}],[{x:m.x,y:m.y},{x:l-m.x,y:m.y},{x:l-m.x,y:h-m.y}]),g=[];if(g.push({name:"rect",type:"element",attributes:{class:"boundary",x:"0",y:"0",width:l.toString(),height:h.toString()},children:[],value:""}),t?.grid){let ne=typeof t.grid==="object"?t.grid:{};g.push(nus({bounds:s,transform:A,...ne}))}let f=[],y=[],x=[],C=[],b=[],I=[],v=[],P=[],M=[],B=[],T=[],N=[],D=[],L=[],H=[],V=[],O=[],U=i0s({transform:A,svgWidth:l,svgHeight:h,schematicSheet:r}),j=Array.isArray(u.simulation_palette)?u.simulation_palette:Array.isArray(u.palette)?u.palette:[],Y=0;for(let ne of i)if(ne.type==="schematic_sheet")V.push(...Vus({schematicSheet:ne,transform:A,colorMap:u}));else if(ne.type==="schematic_graphic")O.push(fus({schematicGraphic:ne,viewport:s0s({availableViewport:U,schematicGraphic:ne,transform:A})}));else if(ne.type==="schematic_debug_object")f.push(...zus({debugObject:ne,transform:A}));else if(ne.type==="schematic_component")y.push(...Fus({component:ne,transform:A,circuitJson:i,colorMap:u})),M.push(...Sus({component:ne,transform:A,circuitJson:i}));else if(ne.type==="schematic_box")v.push(...Bus({schematicBox:ne,transform:A,colorMap:u}));else if(ne.type==="schematic_trace")x.push(...Gus({trace:ne,transform:A,colorMap:u}));else if(ne.type==="schematic_net_label")C.push(...bus({schNetLabel:ne,realToScreenTransform:A,colorMap:u}));else if(ne.type==="schematic_text"&&!ne.schematic_component_id)b.push(Rft({elm:ne,transform:A,colorMap:u}));else if(ne.type==="schematic_voltage_probe"){let re=j.length>0?j[Y%j.length]:void 0;Y+=1,I.push(...Uus({probe:ne,transform:A,colorMap:u,fallbackColor:re}))}else if(ne.type==="schematic_table")P.push(...Yus({schematicTable:ne,transform:A,colorMap:u,circuitJson:i}));else if(ne.type==="schematic_line"){if(ne.schematic_component_id)continue;T.push(...B2o({schLine:ne,transform:A,colorMap:u}))}else if(ne.type==="schematic_circle"){if(ne.schematic_component_id)continue;N.push(...P2o({schCircle:ne,transform:A,colorMap:u}))}else if(ne.type==="schematic_rect"){if(ne.schematic_component_id)continue;D.push(...T2o({schRect:ne,transform:A,colorMap:u}))}else if(ne.type==="schematic_arc"){if(ne.schematic_component_id)continue;L.push(...S2o({schArc:ne,transform:A,colorMap:u}))}else if(ne.type==="schematic_path"){if(ne.schematic_component_id)continue;H.push(...D2o({schPath:ne,transform:A,colorMap:u}))}else if(ne.type==="schematic_port"){let re=i.find((Z)=>Z.type==="source_port"&&Z.source_port_id===ne.source_port_id);if(re?.type==="source_port"&&re.do_not_connect===!0)B.push(Pus({schPort:ne,transform:A,colorMap:u}));if(t?.drawPorts)B.push(...Eus({schPort:ne,transform:A,circuitJson:i,colorMap:u}))}let X=x.filter((ne)=>ne.attributes?.["data-layer"]!=="overlay"),K=x.filter((ne)=>ne.attributes?.["data-layer"]==="overlay");if(g.push(...O,...f,...V,...X,...K,...T,...N,...D,...L,...H,...y,...M,...B,...C,...b,...v,...I,...P),t?.labeledPoints)g.push(ous({points:t.labeledPoints,transform:A}));if(t?.shouldDrawWarnings)g.push(...Xus({circuitJson:i,transform:A,svgWidth:l,svgHeight:h,colorMap:u}));let J=h2o(e),ee=d2o;if(t?.showErrorsInTextOverlay){let ne=u2o(e);if(ne)g.push(ne)}let se={name:"svg",type:"element",attributes:{xmlns:"http://www.w3.org/2000/svg",class:["tscircuit-schematic",t?.className].filter(Boolean).join(" "),width:l.toString(),height:h.toString(),style:`background-color: ${u.schematic.background}`,"data-real-to-screen-transform":ZAo(A),...J&&{"data-software-used-string":J},...t?.includeVersion&&{"data-circuit-to-svg-version":ee}},children:[{name:"style",type:"element",children:[{type:"text",value:`
              .boundary { fill: ${u.schematic.background}; }
              .schematic-boundary { fill: none; stroke: #fff; }
              .component { fill: none; stroke: ${u.schematic.component_outline}; }
              .chip { fill: ${u.schematic.component_body}; stroke: ${u.schematic.component_outline}; }
              .component-pin { fill: none; stroke: ${u.schematic.component_outline}; }
              .text { font-family: sans-serif; fill: ${u.schematic.wire}; }
              .pin-number { fill: ${u.schematic.pin_number}; }
              .port-label { fill: ${u.schematic.reference}; }
              .component-name { fill: ${u.schematic.reference}; }
              ${t?.css??""}
            `,name:"",attributes:{},children:[]}],value:"",attributes:{}},...g],value:""};return Wfo(se)}function i0s({transform:e,svgWidth:t,svgHeight:n,schematicSheet:o}){if(!o)return{x:0,y:0,width:t,height:n};let r=Nft(o),i=Vt(e,{x:r.innerMinX,y:r.innerMaxY}),s=Vt(e,{x:r.innerMaxX,y:r.innerMinY});return{x:Math.min(i.x,s.x),y:Math.min(i.y,s.y),width:Math.abs(s.x-i.x),height:Math.abs(s.y-i.y)}}function s0s({availableViewport:e,schematicGraphic:t,transform:n}){if(t.width===void 0&&t.height===void 0)return e;let o=t.width===void 0?e.width:Yfo(t.width*Math.hypot(n.a,n.b),e.width),r=t.height===void 0?e.height:Yfo(t.height*Math.hypot(n.c,n.d),e.height);return{x:e.x+(e.width-o)/2,y:e.y+(e.height-r)/2,width:o,height:r}}function Yfo(e,t){if(!Number.isFinite(e))return t;return Math.max(0,Math.min(e,t))}var Fps=at(ln(),1),Kyo=at(ln(),1);var $yo=at(ln(),1),Q_e=at(ln(),1),K1=at(ln(),1);var x2t=at(j0(),1),Fc=at(ln(),1);var kH=at(As(),1),Qft=({initialTransform:e,initialTouch1:t,initialTouch2:n,finalTouch1:o,finalTouch2:r})=>{if(!o||!r)return e;let i={x:(t.x+n.x)/2,y:(t.y+n.y)/2},s={x:(o.x+r.x)/2,y:(o.y+r.y)/2},a=Math.hypot(n.x-t.x,n.y-t.y),c=Math.hypot(r.x-o.x,r.y-o.y),l=a===0?1:c/a,h=s.x-i.x,d=s.y-i.y;return kH.compose(kH.translate(h,d),kH.translate(i.x,i.y),kH.scale(l,l),kH.translate(-i.x,-i.y),e)};var s_=at(As(),1),Mf=at(ln(),1),BDe=(e={})=>{let t=Mf.useRef(null),[n,o]=Mf.useState(0),r=e.canvasElm??t.current,[i,s]=Mf.useState(e.initialTransform??s_.identity()),[a,c]=Mf.useState(0),[l,h]=Mf.useReducer((y)=>y+1,0),d=Mf.useCallback((y)=>{if(e.onSetTransform)e.onSetTransform(y);if(!e.transform)s(y)},[e.onSetTransform,s]),u=Mf.useCallback((y)=>{d(y),h()},[d]),_=e.transform??i,p=Mf.useCallback(()=>{o(Date.now())},[]),m=Mf.useRef("none"),A=Mf.useRef(null),g=Mf.useRef(null);Mf.useEffect(()=>{let y=e.canvasElm??t.current;if(y&&!r){c(a+1);return}if(!y){let O=setTimeout(()=>{c(a+1)},100);return()=>clearTimeout(O)}let x=e.transform??i,C={x:0,y:0},b={x:0,y:0},I=!1,v={x:0,y:0},P=(O)=>({x:O.pageX-y.getBoundingClientRect().left-window.scrollX,y:O.pageY-y.getBoundingClientRect().top-window.scrollY});function M(O){if(e.enabled===!1)return;if(e.shouldDrag&&!e.shouldDrag(O))return;if(C=P(O),Date.now()-n<100)return;I=!0,O.preventDefault()}function B(O){if(!I||e.enabled===!1)return;if(e.shouldDrag&&!e.shouldDrag(O))return;b=P(O);let U=s_.compose(s_.translate(b.x-C.x,b.y-C.y),x);d(U),x=U,I=!1}function T(O){if(v=P(O),!I||e.enabled===!1)return;if(e.shouldDrag&&!e.shouldDrag(O))return;b=P(O);let U=s_.compose(s_.translate(b.x-C.x,b.y-C.y),x);d(U)}function N(O){if(e.enabled===!1)return;if(e.shouldDrag&&!e.shouldDrag(O))return;let U=P(O),j=s_.compose(s_.translate(U.x,U.y),s_.scale(1-O.deltaY/1000,1-O.deltaY/1000),s_.translate(-U.x,-U.y),x);d(j),x=j,O.preventDefault()}function D(O){if(!I)return;if(e.shouldDrag&&!e.shouldDrag(O))return;if(y){let j=y.getBoundingClientRect();if(O.clientX>=j.left+10&&O.clientX<=j.right-10&&O.clientY>=j.top+10&&O.clientY<=j.bottom-10)return}I=!1,b=P(O);let U=s_.compose(s_.translate(b.x-C.x,b.y-C.y),x);d(U),x=U}function L(O){if(O.preventDefault(),e.enabled===!1)return;if(O.touches.length===1){m.current="drag";let U=O.touches[0];A.current={initialTransform:x,initialTouch:{x:U.clientX,y:U.clientY}}}else if(O.touches.length===2){m.current="pinch";let U=O.touches[0],j=O.touches[1];g.current={initialTransform:x,initialTouch1:{x:U.clientX,y:U.clientY},initialTouch2:{x:j.clientX,y:j.clientY},finalTouch1:null,finalTouch2:null}}}function H(O){if(O.preventDefault(),e.enabled===!1)return;if(m.current==="drag"&&O.touches.length===1&&A.current){let U=O.touches[0],j={x:U.clientX,y:U.clientY},Y=j.x-A.current.initialTouch.x,X=j.y-A.current.initialTouch.y,K=s_.compose(s_.translate(Y,X),A.current.initialTransform);d(K)}else if(m.current==="pinch"&&O.touches.length===2&&g.current){let U=O.touches[0],j=O.touches[1];g.current.finalTouch1={x:U.clientX,y:U.clientY},g.current.finalTouch2={x:j.clientX,y:j.clientY};let Y=Qft(g.current);d(Y)}}function V(O){O.preventDefault();let U=O.changedTouches[0];if(m.current==="drag"&&A.current&&U){let j={x:U.clientX,y:U.clientY},Y=j.x-A.current.initialTouch.x,X=j.y-A.current.initialTouch.y,K=s_.compose(s_.translate(Y,X),A.current.initialTransform);d(K),x=K}else if(m.current==="pinch"&&g.current){let j=Qft(g.current);d(j),x=j}m.current="none",A.current=null,g.current=null}return y.addEventListener("mousedown",M),y.addEventListener("mouseup",B),window.addEventListener("mousemove",T),y.addEventListener("mouseout",D),y.addEventListener("wheel",N),y.addEventListener("touchstart",L,{passive:!1}),y.addEventListener("touchmove",H,{passive:!1}),y.addEventListener("touchend",V,{passive:!1}),y.addEventListener("touchcancel",V,{passive:!1}),()=>{y.removeEventListener("mousedown",M),y.removeEventListener("mouseup",B),window.removeEventListener("mousemove",T),y.removeEventListener("mouseout",D),y.removeEventListener("wheel",N),y.removeEventListener("touchstart",L),y.removeEventListener("touchmove",H),y.removeEventListener("touchend",V),y.removeEventListener("touchcancel",V)}},[r,a,l,n,e.enabled,e.shouldDrag]);let f=Mf.useCallback((y)=>s_.applyToPoint(_,y),[_]);return{ref:t,transform:_,applyTransformToPoint:f,setTransform:u,cancelDrag:p}};var k_e=at(ln(),1),_A=at(ln(),1);var Bf=at(ln(),1),moe=at(lo(),1),sNe=at(ln(),1),L_e=at(ln(),1),sI=at(lo(),1),Hp=at(lo(),1),aI=at(ln(),1),EC=at(ln(),1),Zyo=at(lo(),1),cI=at(ln(),1),JU=at(lo(),1),_8=at(ln(),1),Ag=at(lo(),1),ch=at(lo(),1),exo=at(ln(),1);var C4=at(ln(),1);var Ri=at(ln(),1);var a8=at(ln(),1);var DDe=at(lo(),1),mA=at(ln(),1);var LH=at(lo(),1),l0s=Object.defineProperty,pA=(e,t)=>l0s(e,"name",{value:t,configurable:!0});function b_e(e){let t=e+"CollectionProvider",[n,o]=Bx(t),[r,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=pA((m)=>{let{scope:A,children:g}=m,f=a8.useRef(null),y=a8.useRef(new Map).current;return DDe.jsx(r,{scope:A,itemMap:y,collectionRef:f,children:g})},"CollectionProvider");s.displayName=t;let a=e+"CollectionSlot",c=IC(a),l=a8.forwardRef((m,A)=>{let{scope:g,children:f}=m,y=i(a,g),x=Eh(A,y.collectionRef);return DDe.jsx(c,{ref:x,children:f})});l.displayName=a;let h=e+"CollectionItemSlot",d="data-radix-collection-item",u=IC(h),_=a8.forwardRef((m,A)=>{let{scope:g,children:f,...y}=m,x=a8.useRef(null),C=Eh(A,x),b=i(h,g);return a8.useEffect(()=>(b.itemMap.set(x,{ref:x,...y}),()=>void b.itemMap.delete(x))),DDe.jsx(u,{...{[d]:""},ref:C,children:f})});_.displayName=h;function p(m){let A=i(e+"CollectionConsumer",m);return a8.useCallback(()=>{let f=A.collectionRef.current;if(!f)return[];let y=Array.from(f.querySelectorAll(`[${d}]`));return Array.from(A.itemMap.values()).sort((b,I)=>y.indexOf(b.ref.current)-y.indexOf(I.ref.current))},[A.collectionRef,A.itemMap])}return pA(p,"useCollection"),[{Provider:s,Slot:l,ItemSlot:_},p,o]}pA(b_e,"createCollection");var k2o=new WeakMap,TDe=class e extends Map{static{pA(this,"OrderedDict")}#e;constructor(t){super(t);this.#e=[...super.keys()],k2o.set(this,!0)}set(t,n){if(k2o.get(this)&&!this.has(t))this.#e.push(t);return super.set(t,n),this}insert(t,n,o){let r=this.has(n),i=r?this.size:this.size+1,s=kft(t),a=s>=0?Math.min(s,i-1):Math.max(i+s,0);if(r?this.#e.indexOf(n)===a:a===this.size)return this.set(n,o),this;let c=this.#e.filter((h)=>h!==n);c.splice(a,0,n);let l=c.map((h)=>[h,h===n?o:this.get(h)]);this.clear();for(let[h,d]of l)this.set(h,d);return this}with(t,n,o){let r=new e(this);return r.insert(t,n,o),r}before(t){let n=this.#e.indexOf(t)-1;if(n<0)return;return this.entryAt(n)}setBefore(t,n,o){let r=this.#e.indexOf(t);if(r===-1)return this;let i=this.#e.indexOf(n),s=i!==-1&&i<r?r-1:r;return this.insert(s,n,o)}after(t){let n=this.#e.indexOf(t);if(n=n===-1||n===this.size-1?-1:n+1,n===-1)return;return this.entryAt(n)}setAfter(t,n,o){let r=this.#e.indexOf(t);if(r===-1)return this;let i=this.#e.indexOf(n),s=i!==-1&&i<=r?r:r+1;return this.insert(s,n,o)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(t){let n=super.delete(t);if(n)this.#e.splice(this.#e.indexOf(t),1);return n}deleteAt(t){let n=this.keyAt(t);if(n!==void 0)return this.delete(n);return!1}at(t){let n=NDe(this.#e,t);if(n!==void 0)return this.get(n)}entryAt(t){let n=NDe(this.#e,t);if(n!==void 0)return[n,this.get(n)]}indexOf(t){return this.#e.indexOf(t)}keyAt(t){return NDe(this.#e,t)}from(t,n){let o=this.indexOf(t);if(o===-1)return;let r=o+n;if(r<0)r=0;if(r>=this.size)r=this.size-1;return this.at(r)}keyFrom(t,n){let o=this.indexOf(t);if(o===-1)return;let r=o+n;if(r<0)r=0;if(r>=this.size)r=this.size-1;return this.keyAt(r)}find(t,n){let o=0;for(let r of this){if(Reflect.apply(t,n,[r,o,this]))return r;o++}return}findIndex(t,n){let o=0;for(let r of this){if(Reflect.apply(t,n,[r,o,this]))return o;o++}return-1}filter(t,n){let o=[],r=0;for(let i of this){if(Reflect.apply(t,n,[i,r,this]))o.push(i);r++}return new e(o)}map(t,n){let o=[],r=0;for(let i of this)o.push([i[0],Reflect.apply(t,n,[i,r,this])]),r++;return new e(o)}reduce(...t){let[n,o]=t,r=t.length>1;if(!r&&this.size===0)throw TypeError("Reduce of empty OrderedDict with no initial value");let i=0,s=o;for(let a of this){if(i===0&&!r)s=a;else s=Reflect.apply(n,this,[s,a,i,this]);i++}return s}reduceRight(...t){let[n,o]=t,r=t.length>1;if(!r&&this.size===0)throw TypeError("Reduce of empty OrderedDict with no initial value");let i=o;for(let s=this.size-1;s>=0;s--){let a=this.entryAt(s);if(s===this.size-1&&!r)i=a;else i=Reflect.apply(n,this,[i,a,s,this])}return i}sort(t){if(typeof t!=="function")throw TypeError("OrderedDict.sort requires a compare function");let n=[...this.entries()].sort(t);this.clear();for(let[o,r]of n)this.set(o,r);return this}toSorted(t){if(typeof t!=="function")throw TypeError("OrderedDict.toSorted requires a compare function");let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let n=this.size-1;n>=0;n--){let o=this.keyAt(n),r=this.get(o);t.set(o,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let o=new e;for(let r of this.#e.slice(t,n))o.set(r,this.get(r));return o}every(t,n){let o=0;for(let r of this){if(!Reflect.apply(t,n,[r,o,this]))return!1;o++}return!0}some(t,n){let o=0;for(let r of this){if(Reflect.apply(t,n,[r,o,this]))return!0;o++}return!1}};function NDe(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);let n=L2o(e,t);return n===-1?void 0:e[n]}pA(NDe,"at");function L2o(e,t){let n=e.length,o=kft(t),r=o>=0?o:n+o;return r<0||r>=n?-1:r}pA(L2o,"toSafeIndex");function kft(e){return e!==e||e===0?0:Math.trunc(e)}pA(kft,"toSafeInteger");function h0s(e){let t=e+"CollectionProvider",[n,o]=Bx(t),[r,i]=n(t);r.displayName=e+"CollectionStableContextProvider";let[s,a]=n(t);s.displayName=e+"CollectionStatefulContextProvider";let c=pA(({state:b,...I})=>b?LH.jsx(h,{...I,state:b}):LH.jsx(l,{...I}),"CollectionProvider");c.displayName=t;let l=pA((b)=>{let I=f();return LH.jsx(h,{...b,state:I})},"CollectionInit");l.displayName=e+"CollectionInit";let h=pA((b)=>{let{scope:I,children:v,state:P}=b,M=mA.useRef(null),[B,T]=mA.useState(null),N=Eh(M,T),[D,L]=P,H=mA.useRef(new TDe),V=mA.useCallback(()=>{let O=H.current;if(!z2o(O))O.sort(RDe);return O},[]);return mA.useEffect(()=>{if(!B)return;let O=O2o(()=>{L((U)=>{let j=U.toSorted(RDe);return j.some(([X],K)=>U.keyAt(K)!==X)?j:U})});return O.observe(B,{childList:!0,subtree:!0}),()=>{O.disconnect()}},[B,L]),LH.jsx(r,{scope:I,collectionElementRef:N,collectionElementRefObject:M,getCollection:V,setCollection:L,registryRef:H,children:LH.jsx(s,{scope:I,collectionElement:B,collection:D,children:v})})},"CollectionProviderImpl");h.displayName=e+"CollectionProviderImpl";let d=e+"CollectionSlot",u=IC(d),_=mA.forwardRef((b,I)=>{let{scope:v,children:P}=b,M=i(d,v),B=Eh(I,M.collectionElementRef);return LH.jsx(u,{ref:B,children:P})});_.displayName=d;let p=e+"CollectionItemSlot",m="data-radix-collection-item",A=IC(p),g=mA.forwardRef((b,I)=>{let{scope:v,children:P,...M}=b,B=mA.useRef(null),T=i(p,v),{setCollection:N,registryRef:D}=T,L=mA.useRef(M);if(!H2o(L.current,M))L.current=M;let H=L.current,V=mA.useCallback((j)=>{let Y=D.current;if(j)Y.set(j,{...L.current,element:j});else if(B.current)Y.delete(B.current)},[D]),O=Eh(I,V,B);t0(()=>{let j=B.current,Y=D.current;if(j&&Y.has(j))Y.set(j,{...H,element:j})},[H,D]);let U=mA.useRef(null);return mA.useEffect(()=>{let j=B.current,Y=U.current;if((Y?.element??null)===j&&(!j||Y?.itemData===H))return;U.current=j?{element:j,itemData:H}:null,N((X)=>{let K=new TDe(X);if(Y&&Y.element!==j)K.delete(Y.element);if(j)K.set(j,{...H,element:j});return K.sort(RDe)})}),mA.useEffect(()=>()=>{let j=U.current;if(U.current=null,!j)return;N((Y)=>{if(!Y.has(j.element))return Y;let X=new TDe(Y);return X.delete(j.element),X})},[N]),LH.jsx(A,{...{[m]:""},ref:O,children:P})});g.displayName=p;function f(){return mA.useState(new TDe)}pA(f,"useInitCollection");function y(b){let{collection:I}=a(e+"CollectionConsumer",b);return I}pA(y,"useCollection");function x(b){let{getCollection:I}=i(e+"CollectionConsumer",b);return I}return pA(x,"useGetCollection"),[{Provider:c,Slot:_,ItemSlot:g},{createCollectionScope:o,useCollection:y,useGetCollection:x,useInitCollection:f}]}pA(h0s,"createCollection");function H2o(e,t){if(e===t)return!0;if(typeof e!=="object"||typeof t!=="object")return!1;if(e==null||t==null)return!1;let n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(let r of n){if(!Object.prototype.hasOwnProperty.call(t,r))return!1;if(e[r]!==t[r])return!1}return!0}pA(H2o,"shallowEqual");function F2o(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}pA(F2o,"isElementPreceding");function z2o(e){let t;for(let n of e.keys()){if(t){let o=t.compareDocumentPosition(n);if(!(o&Node.DOCUMENT_POSITION_DISCONNECTED)&&o&Node.DOCUMENT_POSITION_PRECEDING)return!1}t=n}return!0}pA(z2o,"isInDocumentOrder");function RDe(e,t){return!e[1].element||!t[1].element?0:F2o(e[1].element,t[1].element)?-1:1}pA(RDe,"sortByDocumentPosition");function O2o(e){return new MutationObserver((n)=>{for(let o of n)if(o.type==="childList"){e();return}})}pA(O2o,"getChildListObserver");var QDe=at(ln(),1),p0s=at(lo(),1),d0s=Object.defineProperty,u0s=(e,t)=>d0s(e,"name",{value:t,configurable:!0}),m0s={LTR:"ltr",RTL:"rtl"},_0s=QDe.createContext(void 0);function I_e(e){let t=QDe.useContext(_0s);return e||t||m0s.LTR}u0s(I_e,"useDirection");var j1=at(ln(),1);var G2o=["top","right","bottom","left"];var{min:UE,max:c8,round:S_e,floor:P_e}=Math,WE=(e)=>({x:e,y:e}),g0s={left:"right",right:"left",bottom:"top",top:"bottom"};function Lft(e,t,n){return c8(e,UE(t,n))}function XE(e,t){return typeof e==="function"?e(t):e}function aD(e){return e.split("-")[0]}function VU(e){return e.split("-")[1]}function LDe(e){return e==="x"?"y":"x"}function HDe(e){return e==="y"?"height":"width"}function l8(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function FDe(e){return LDe(l8(e))}function U2o(e,t,n){if(n===void 0)n=!1;let o=VU(e),r=FDe(e),i=HDe(r),s=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";if(t.reference[i]>t.floating[i])s=v_e(s);return[s,v_e(s)]}function W2o(e){let t=v_e(e);return[kDe(e),t,kDe(t)]}function kDe(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}var V2o=["left","right"],Y2o=["right","left"],A0s=["top","bottom"],f0s=["bottom","top"];function y0s(e,t,n){switch(e){case"top":case"bottom":if(n)return t?Y2o:V2o;return t?V2o:Y2o;case"left":case"right":return t?A0s:f0s;default:return[]}}function X2o(e,t,n,o){let r=VU(e),i=y0s(aD(e),n==="start",o);if(r){if(i=i.map((s)=>s+"-"+r),t)i=i.concat(i.map(kDe))}return i}function v_e(e){let t=aD(e);return g0s[t]+e.slice(t.length)}function x0s(e){var t,n,o,r;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(o=e.bottom)!=null?o:0,left:(r=e.left)!=null?r:0}}function Hft(e){return typeof e!=="number"?x0s(e):{top:e,right:e,bottom:e,left:e}}function YU(e){let{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function j2o(e,t,n){let{reference:o,floating:r}=e,i=l8(t),s=FDe(t),a=HDe(s),c=aD(t),l=i==="y",h=o.x+o.width/2-r.width/2,d=o.y+o.height/2-r.height/2,u=o[a]/2-r[a]/2,_;switch(c){case"top":_={x:h,y:o.y-r.height};break;case"bottom":_={x:h,y:o.y+o.height};break;case"right":_={x:o.x+o.width,y:d};break;case"left":_={x:o.x-r.width,y:d};break;default:_={x:o.x,y:o.y}}let p=VU(t);if(p)_[s]+=u*(p==="end"?1:-1)*(n&&l?-1:1);return _}async function q2o(e,t){var n;if(t===void 0)t={};let{x:o,y:r,platform:i,rects:s,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:h="viewport",elementContext:d="floating",altBoundary:u=!1,padding:_=0}=XE(t,e),p=Hft(_),A=a[u?d==="floating"?"reference":"floating":d],g=YU(await i.getClippingRect({element:((n=await(i.isElement==null?void 0:i.isElement(A)))!=null?n:!0)?A:A.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:l,rootBoundary:h,strategy:c})),f=d==="floating"?{x:o,y:r,width:s.floating.width,height:s.floating.height}:s.reference,y=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),x=await(i.isElement==null?void 0:i.isElement(y))&&await(i.getScale==null?void 0:i.getScale(y))||{x:1,y:1},C=YU(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:f,offsetParent:y,strategy:c}):f);return{top:(g.top-C.top+p.top)/x.y,bottom:(C.bottom-g.bottom+p.bottom)/x.y,left:(g.left-C.left+p.left)/x.x,right:(C.right-g.right+p.right)/x.x}}var C0s=50,J2o=async(e,t,n)=>{let{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:s}=n,a=s.detectOverflow?s:{...s,detectOverflow:q2o},c=await(s.isRTL==null?void 0:s.isRTL(t)),l=await s.getElementRects({reference:e,floating:t,strategy:r}),{x:h,y:d}=j2o(l,o,c),u=o,_=0,p={};for(let m=0;m<i.length;m++){let A=i[m];if(!A)continue;let{name:g,fn:f}=A,{x:y,y:x,data:C,reset:b}=await f({x:h,y:d,initialPlacement:o,placement:u,strategy:r,middlewareData:p,rects:l,platform:a,elements:{reference:e,floating:t}});if(h=y!=null?y:h,d=x!=null?x:d,p[g]={...p[g],...C},b&&_<C0s){if(_++,typeof b==="object"){if(b.placement)u=b.placement;if(b.rects)l=b.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:r}):b.rects;({x:h,y:d}=j2o(l,u,c))}m=-1}}return{x:h,y:d,placement:u,strategy:r,middlewareData:p}},Z2o=(e)=>({name:"arrow",options:e,async fn(t){let{x:n,y:o,placement:r,rects:i,platform:s,elements:a,middlewareData:c}=t,{element:l,padding:h=0}=XE(e,t)||{};if(l==null)return{};let d=Hft(h),u={x:n,y:o},_=FDe(r),p=HDe(_),m=await s.getDimensions(l),A=_==="y",g=A?"top":"left",f=A?"bottom":"right",y=A?"clientHeight":"clientWidth",x=i.reference[p]+i.reference[_]-u[_]-i.floating[p],C=u[_]-i.reference[_],b=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l)),I=b?b[y]:0;if(!I||!await(s.isElement==null?void 0:s.isElement(b)))I=a.floating[y]||i.floating[p];let v=x/2-C/2,P=I/2-m[p]/2-1,M=UE(d[g],P),B=UE(d[f],P),T=I-m[p]-B,N=I/2-m[p]/2+v,D=Lft(M,N,T),L=!c.arrow&&VU(r)!=null&&N!==D&&i.reference[p]/2-(N<M?M:B)-m[p]/2<0,H=L?N<M?N-M:N-T:0;return{[_]:u[_]+H,data:{[_]:D,centerOffset:N-D-H,...L&&{alignmentOffset:H}},reset:L}}});var e1o=function(e){if(e===void 0)e={};return{name:"flip",options:e,async fn(t){var n,o;let{placement:r,middlewareData:i,rects:s,initialPlacement:a,platform:c,elements:l}=t,{mainAxis:h=!0,crossAxis:d=!0,fallbackPlacements:u,fallbackStrategy:_="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...A}=XE(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=aD(r),f=l8(a),y=aD(a)===a,x=await(c.isRTL==null?void 0:c.isRTL(l.floating)),C=u||(y||!m?[v_e(a)]:W2o(a)),b=p!=="none";if(!u&&b)C.push(...X2o(a,m,p,x));let I=[a,...C],v=await c.detectOverflow(t,A),P=[],M=((o=i.flip)==null?void 0:o.overflows)||[];if(h)P.push(v[g]);if(d){let D=U2o(r,s,x);P.push(v[D[0]],v[D[1]])}if(M=[...M,{placement:r,overflows:P}],!P.every((D)=>D<=0)){var B,T;let D=(((B=i.flip)==null?void 0:B.index)||0)+1,L=I[D];if(L){if(!(d==="alignment"?f!==l8(L):!1)||M.every((O)=>l8(O.placement)===f?O.overflows[0]>0:!0))return{data:{index:D,overflows:M},reset:{placement:L}}}let H=(T=M.filter((V)=>V.overflows[0]<=0).sort((V,O)=>V.overflows[1]-O.overflows[1])[0])==null?void 0:T.placement;if(!H)switch(_){case"bestFit":{var N;let V=(N=M.filter((O)=>{if(b){let U=l8(O.placement);return U===f||U==="y"}return!0}).map((O)=>[O.placement,O.overflows.filter((U)=>U>0).reduce((U,j)=>U+j,0)]).sort((O,U)=>O[1]-U[1])[0])==null?void 0:N[0];if(V)H=V;break}case"initialPlacement":H=a;break}if(r!==H)return{reset:{placement:H}}}return{}}}};function K2o(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function $2o(e){return G2o.some((t)=>e[t]>=0)}var t1o=function(e){if(e===void 0)e={};return{name:"hide",options:e,async fn(t){let{rects:n,platform:o}=t,{strategy:r="referenceHidden",...i}=XE(e,t);switch(r){case"referenceHidden":{let s=await o.detectOverflow(t,{...i,elementContext:"reference"}),a=K2o(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:$2o(a)}}}case"escaped":{let s=await o.detectOverflow(t,{...i,altBoundary:!0}),a=K2o(s,n.floating);return{data:{escapedOffsets:a,escaped:$2o(a)}}}default:return{}}}}};var n1o=new Set(["left","top"]);async function b0s(e,t){let{placement:n,platform:o,elements:r}=e,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),s=aD(n),a=VU(n),c=l8(n)==="y",l=n1o.has(s)?-1:1,h=i&&c?-1:1,d=XE(t,e),{mainAxis:u,crossAxis:_,alignmentAxis:p}=typeof d==="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};if(a&&typeof p==="number")_=a==="end"?p*-1:p;return c?{x:_*h,y:u*l}:{x:u*l,y:_*h}}var o1o=function(e){if(e===void 0)e=0;return{name:"offset",options:e,async fn(t){var n,o;let{x:r,y:i,placement:s,middlewareData:a}=t,c=await b0s(t,e);if(s===((n=a.offset)==null?void 0:n.placement)&&(o=a.arrow)!=null&&o.alignmentOffset)return{};return{x:r+c.x,y:i+c.y,data:{...c,placement:s}}}}},r1o=function(e){if(e===void 0)e={};return{name:"shift",options:e,async fn(t){let{x:n,y:o,placement:r,platform:i}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:c={fn:(f)=>{let{x:y,y:x}=f;return{x:y,y:x}}},...l}=XE(e,t),h={x:n,y:o},d=await i.detectOverflow(t,l),u=l8(r),_=LDe(u),p=h[_],m=h[u],A=(f,y)=>Lft(y+d[f==="y"?"top":"left"],y,y-d[f==="y"?"bottom":"right"]);if(s)p=A(_,p);if(a)m=A(u,m);let g=c.fn({...t,[_]:p,[u]:m});return{...g,data:{x:g.x-n,y:g.y-o,enabled:{[_]:s,[u]:a}}}}}},i1o=function(e){if(e===void 0)e={};return{options:e,fn(t){var n,o;let{x:r,y:i,placement:s,rects:a,middlewareData:c}=t,{offset:l=0,mainAxis:h=!0,crossAxis:d=!0}=XE(e,t),u={x:r,y:i},_=l8(s),p=LDe(_),m=u[p],A=u[_],g=XE(l,t),f=typeof g==="number"?{mainAxis:g,crossAxis:0}:{mainAxis:(n=g.mainAxis)!=null?n:0,crossAxis:(o=g.crossAxis)!=null?o:0};if(h){let C=p==="y"?"height":"width",b=a.reference[p]-a.floating[C]+f.mainAxis,I=a.reference[p]+a.reference[C]-f.mainAxis;if(m<b)m=b;else if(m>I)m=I}if(d){var y,x;let C=p==="y"?"width":"height",b=n1o.has(aD(s)),I=a.reference[_]-a.floating[C]+(b?((y=c.offset)==null?void 0:y[_])||0:0)+(b?0:f.crossAxis),v=a.reference[_]+a.reference[C]+(b?0:((x=c.offset)==null?void 0:x[_])||0)-(b?f.crossAxis:0);if(A<I)A=I;else if(A>v)A=v}return{[p]:m,[_]:A}}}},s1o=function(e){if(e===void 0)e={};return{name:"size",options:e,async fn(t){let{placement:n,rects:o,platform:r,elements:i}=t,{apply:s=()=>{},...a}=XE(e,t),c=await r.detectOverflow(t,a),l=aD(n),h=VU(n),d=l8(n)==="y",{width:u,height:_}=o.floating,p,m;if(l==="top"||l==="bottom")p=l,m=h===(await(r.isRTL==null?void 0:r.isRTL(i.floating))?"start":"end")?"left":"right";else m=l,p=h==="end"?"top":"bottom";let A=_-c.top-c.bottom,g=u-c.left-c.right,f=UE(_-c[p],A),y=UE(u-c[m],g),x=t.middlewareData.shift,C=!x,b=f,I=y;if(x!=null&&x.enabled.x)I=g;if(x!=null&&x.enabled.y)b=A;if(C&&!h)if(d)I=u-2*c8(c.left,c.right);else b=_-2*c8(c.top,c.bottom);await s({...t,availableWidth:I,availableHeight:b});let v=await r.getDimensions(i.floating);if(u!==v.width||_!==v.height)return{reset:{rects:!0}};return{}}}};function zDe(){return typeof window<"u"}function WU(e){if(c1o(e))return(e.nodeName||"").toLowerCase();return"#document"}function Dx(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function jE(e){var t;return(t=(c1o(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function c1o(e){if(!zDe())return!1;return e instanceof Node||e instanceof Dx(e).Node}function h8(e){if(!zDe())return!1;return e instanceof Element||e instanceof Dx(e).Element}function cD(e){if(!zDe())return!1;return e instanceof HTMLElement||e instanceof Dx(e).HTMLElement}function a1o(e){if(!zDe()||typeof ShadowRoot>"u")return!1;return e instanceof ShadowRoot||e instanceof Dx(e).ShadowRoot}function E_e(e){let{overflow:t,overflowX:n,overflowY:o,display:r}=d8(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&r!=="inline"&&r!=="contents"}function l1o(e){return/^(table|td|th)$/.test(WU(e))}function M_e(e){try{if(e.matches(":popover-open"))return!0}catch(t){}try{return e.matches(":modal")}catch(t){return!1}}var I0s=/transform|translate|scale|rotate|perspective|filter/,v0s=/paint|layout|strict|content/,GU=(e)=>!!e&&e!=="none",Fft;function ODe(e){let t=h8(e)?d8(e):e;return GU(t.transform)||GU(t.translate)||GU(t.scale)||GU(t.rotate)||GU(t.perspective)||!VDe()&&(GU(t.backdropFilter)||GU(t.filter))||I0s.test(t.willChange||"")||v0s.test(t.contain||"")}function h1o(e){let t=HH(e);while(cD(t)&&!aoe(t)){if(ODe(t))return t;else if(M_e(t))return null;t=HH(t)}return null}function VDe(){if(Fft==null)Fft=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none");return Fft}function aoe(e){return/^(html|body|#document)$/.test(WU(e))}function d8(e){return Dx(e).getComputedStyle(e)}function w_e(e){if(h8(e))return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop};return{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function HH(e){if(WU(e)==="html")return e;let t=e.assignedSlot||e.parentNode||a1o(e)&&e.host||jE(e);return a1o(t)?t.host:t}function d1o(e){let t=HH(e);if(aoe(t))return(e.ownerDocument||e).body;if(cD(t)&&E_e(t))return t;return d1o(t)}function UU(e,t,n){var o;if(t===void 0)t=[];if(n===void 0)n=!0;let r=d1o(e),i=r===((o=e.ownerDocument)==null?void 0:o.body),s=Dx(r);if(i){let a=YDe(s);return t.concat(s,s.visualViewport||[],E_e(r)?r:[],a&&n?UU(a):[])}else return t.concat(r,UU(r,[],n))}function YDe(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function m1o(e){let t=d8(e),n=parseFloat(t.width)||0,o=parseFloat(t.height)||0,r=cD(e),i=r?e.offsetWidth:n,s=r?e.offsetHeight:o,a=S_e(n)!==i||S_e(o)!==s;if(a)n=i,o=s;return{width:n,height:o,$:a}}function Oft(e){return!h8(e)?e.contextElement:e}function coe(e){let t=Oft(e);if(!cD(t))return WE(1);let n=t.getBoundingClientRect(),{width:o,height:r,$:i}=m1o(t),s=(i?S_e(n.width):n.width)/o,a=(i?S_e(n.height):n.height)/r;if(!s||!Number.isFinite(s))s=1;if(!a||!Number.isFinite(a))a=1;return{x:s,y:a}}var S0s=WE(0);function _1o(e){let t=Dx(e);if(!VDe()||!t.visualViewport)return S0s;return{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function P0s(e,t,n){if(t===void 0)t=!1;return!!n&&t&&n===Dx(e)}function XU(e,t,n,o){if(t===void 0)t=!1;if(n===void 0)n=!1;let r=e.getBoundingClientRect(),i=Oft(e),s=WE(1);if(t)if(o){if(h8(o))s=coe(o)}else s=coe(e);let a=P0s(i,n,o)?_1o(i):WE(0),c=(r.left+a.x)/s.x,l=(r.top+a.y)/s.y,h=r.width/s.x,d=r.height/s.y;if(i&&o){let u=Dx(i),_=h8(o)?Dx(o):o,p=u,m=YDe(p);while(m&&_!==p){let A=coe(m),g=m.getBoundingClientRect(),f=d8(m),y=g.left+(m.clientLeft+parseFloat(f.paddingLeft))*A.x,x=g.top+(m.clientTop+parseFloat(f.paddingTop))*A.y;c*=A.x,l*=A.y,h*=A.x,d*=A.y,c+=y,l+=x,p=Dx(m),m=YDe(p)}}return YU({width:h,height:d,x:c,y:l})}function GDe(e,t){let n=w_e(e).scrollLeft;if(!t)return XU(jE(e)).left+n;return t.left+n}function g1o(e,t){let n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-GDe(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function E0s(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e,i=r==="fixed",s=jE(o),a=t?M_e(t.floating):!1;if(o===s||a&&i)return n;let c={scrollLeft:0,scrollTop:0},l=WE(1),h=WE(0),d=cD(o);if(d||!i){if(WU(o)!=="body"||E_e(s))c=w_e(o);if(d){let _=XU(o);l=coe(o),h.x=_.x+o.clientLeft,h.y=_.y+o.clientTop}}let u=s&&!d&&!i?g1o(s,c):WE(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+h.x+u.x,y:n.y*l.y-c.scrollTop*l.y+h.y+u.y}}function M0s(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function w0s(e){let t=w_e(e),n=e.ownerDocument.body,o=c8(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),r=c8(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),i=-t.scrollLeft+GDe(e),s=-t.scrollTop;if(d8(n).direction==="rtl")i+=c8(e.clientWidth,n.clientWidth)-o;return{width:o,height:r,x:i,y:s}}var B0s=25;function T0s(e,t,n){if(n===void 0)n="viewport";let o=n==="layoutViewport",r=Dx(e),i=jE(e),s=r.visualViewport,{clientWidth:a,clientHeight:c}=i,l=0,h=0;if(s){let u=!VDe()||t==="fixed";if(o){if(!u)l=-s.offsetLeft,h=-s.offsetTop}else if(a=s.width,c=s.height,u)l=s.offsetLeft,h=s.offsetTop}if(GDe(i)<=0){let u=i.ownerDocument,_=u.body,p=getComputedStyle(_),m=u.compatMode==="CSS1Compat"?parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0:0,A=Math.abs(i.clientWidth-_.clientWidth-m),g=getComputedStyle(i).scrollbarGutter==="stable both-edges"?A/2:A;if(g<=B0s)a-=g}return{width:a,height:c,x:l,y:h}}function D0s(e,t){let n=XU(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=coe(e),s=e.clientWidth*i.x,a=e.clientHeight*i.y,c=r*i.x,l=o*i.y;return{width:s,height:a,x:c,y:l}}function u1o(e,t,n){let o;if(t==="viewport"||t==="layoutViewport")o=T0s(e,n,t);else if(t==="document")o=w0s(jE(e));else if(h8(t))o=D0s(t,n);else{let r=_1o(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return YU(o)}function N0s(e,t){let n=t.get(e);if(n)return n;let o=UU(e,[],!1).filter((a)=>h8(a)&&WU(a)!=="body"),r=null,i=d8(e).position==="fixed",s=i?HH(e):e;while(h8(s)&&!aoe(s)){let a=d8(s),c=ODe(s),l=r?r.position:i?"fixed":"";if(!c&&(l==="fixed"||l==="absolute"&&a.position==="static"))o=o.filter((d)=>d!==s);else r=a;s=HH(s)}return t.set(e,o),o}function R0s(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e,s=[...n==="clippingAncestors"?M_e(t)?[]:N0s(t,this._c):[].concat(n),o],a=u1o(t,s[0],r),{top:c,right:l,bottom:h,left:d}=a;for(let u=1;u<s.length;u++){let _=u1o(t,s[u],r);c=c8(_.top,c),l=UE(_.right,l),h=UE(_.bottom,h),d=c8(_.left,d)}return{width:l-d,height:h-c,x:d,y:c}}function Q0s(e){let{width:t,height:n}=m1o(e);return{width:t,height:n}}function k0s(e,t,n){let o=cD(t),r=jE(t),i=n==="fixed",s=XU(e,!0,i,t),a={scrollLeft:0,scrollTop:0},c=WE(0);if(o||!i){if(WU(t)!=="body"||E_e(r))a=w_e(t);if(o){let u=XU(t,!0,i,t);c.x=u.x+t.clientLeft,c.y=u.y+t.clientTop}}if(!o&&r)c.x=GDe(r);let l=r&&!o&&!i?g1o(r,a):WE(0),h=s.left+a.scrollLeft-c.x-l.x,d=s.top+a.scrollTop-c.y-l.y;return{x:h,y:d,width:s.width,height:s.height}}function zft(e){return d8(e).position==="static"}function p1o(e,t){if(!cD(e)||d8(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;if(jE(e)===n)n=n.ownerDocument.body;return n}function A1o(e,t){let n=Dx(e);if(M_e(e))return n;if(!cD(e)){let r=HH(e);while(r&&!aoe(r)){if(h8(r)&&!zft(r))return r;r=HH(r)}return n}let o=p1o(e,t);while(o&&l1o(o)&&zft(o))o=p1o(o,t);if(o&&aoe(o)&&zft(o)&&!ODe(o))return n;return o||h1o(e)||n}var L0s=async function(e){let t=this.getOffsetParent||A1o,n=this.getDimensions,o=await n(e.floating);return{reference:k0s(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function H0s(e){return d8(e).direction==="rtl"}var f1o={convertOffsetParentRelativeRectToViewportRelativeRect:E0s,getDocumentElement:jE,getClippingRect:R0s,getOffsetParent:A1o,getElementRects:L0s,getClientRects:M0s,getDimensions:Q0s,getScale:coe,isElement:h8,isRTL:H0s};function y1o(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function F0s(e,t,n){let o=null,r,i=jE(e);function s(){var h;clearTimeout(r),(h=o)==null||h.disconnect(),o=null}function a(h,d){if(h===void 0)h=!1;if(d===void 0)d=1;s();let u=e.getBoundingClientRect(),{left:_,top:p,width:m,height:A}=u;if(!h)t();if(!m||!A)return;let g=P_e(p),f=P_e(i.clientWidth-(_+m)),y=P_e(i.clientHeight-(p+A)),x=P_e(_),b={rootMargin:-g+"px "+-f+"px "+-y+"px "+-x+"px",threshold:c8(0,UE(1,d))||1},I=!0;function v(P){let M=P[0].intersectionRatio;if(!y1o(u,e.getBoundingClientRect()))return a();if(M!==d){if(!I)return a();if(!M)r=setTimeout(()=>{a(!1,0.0000001)},1000);else a(!1,M)}I=!1}try{o=new IntersectionObserver(v,{...b,root:i.ownerDocument})}catch(P){o=new IntersectionObserver(v,b)}o.observe(e)}let c=Dx(e),l=()=>a(n);return c.addEventListener("resize",l),a(!0),()=>{c.removeEventListener("resize",l),s()}}function Vft(e,t,n,o){if(o===void 0)o={};let{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver==="function",layoutShift:a=typeof IntersectionObserver==="function",animationFrame:c=!1}=o,l=Oft(e),h=r||i?[...l?UU(l):[],...t?UU(t):[]]:[];h.forEach((g)=>{r&&g.addEventListener("scroll",n),i&&g.addEventListener("resize",n)});let d=l&&a?F0s(l,n,i):null,u=-1,_=null;if(s){if(_=new ResizeObserver((g)=>{let[f]=g;if(f&&f.target===l&&_&&t)_.unobserve(t),cancelAnimationFrame(u),u=requestAnimationFrame(()=>{var y;(y=_)==null||y.observe(t)});n()}),l&&!c)_.observe(l);if(t)_.observe(t)}let p,m=c?XU(e):null;if(c)A();function A(){let g=XU(e);if(m&&!y1o(m,g))n();m=g,p=requestAnimationFrame(A)}return n(),()=>{var g;if(h.forEach((f)=>{r&&f.removeEventListener("scroll",n),i&&f.removeEventListener("resize",n)}),d==null||d(),(g=_)==null||g.disconnect(),_=null,c)cancelAnimationFrame(p)}}var x1o=o1o;var C1o=r1o,b1o=e1o,I1o=s1o,v1o=t1o,Yft=Z2o;var S1o=i1o,Gft=(e,t,n)=>{let o=new Map,r=n!=null?n:{},i={...f1o,...r.platform,_c:o};return J2o(e,t,{...r,platform:i})};var mg=at(ln(),1),E1o=at(ln(),1),M1o=at(z7(),1),z0s=typeof document<"u",O0s=function(){},UDe=z0s?E1o.useLayoutEffect:O0s;function WDe(e,t){if(e===t)return!0;if(typeof e!==typeof t)return!1;if(typeof e==="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e==="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!WDe(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){let i=r[o];if(i==="_owner"&&e.$$typeof)continue;if(!WDe(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function w1o(e){if(typeof window>"u")return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function P1o(e,t){let n=w1o(e);return Math.round(t*n)/n}function Uft(e){let t=mg.useRef(e);return UDe(()=>{t.current=e}),t}function B1o(e){if(e===void 0)e={};let{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:c,open:l}=e,[h,d]=mg.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[u,_]=mg.useState(o);if(!WDe(u,o))_(o);let[p,m]=mg.useState(null),[A,g]=mg.useState(null),f=mg.useCallback((O)=>{if(O!==b.current)b.current=O,m(O)},[]),y=mg.useCallback((O)=>{if(O!==I.current)I.current=O,g(O)},[]),x=i||p,C=s||A,b=mg.useRef(null),I=mg.useRef(null),v=mg.useRef(h),P=c!=null,M=Uft(c),B=Uft(r),T=Uft(l),N=mg.useCallback(()=>{if(!b.current||!I.current)return;let O={placement:t,strategy:n,middleware:u};if(B.current)O.platform=B.current;Gft(b.current,I.current,O).then((U)=>{let j={...U,isPositioned:T.current!==!1};if(D.current&&!WDe(v.current,j))v.current=j,M1o.flushSync(()=>{d(j)})})},[u,t,n,B,T]);UDe(()=>{if(l===!1&&v.current.isPositioned)v.current.isPositioned=!1,d((O)=>({...O,isPositioned:!1}))},[l]);let D=mg.useRef(!1);UDe(()=>(D.current=!0,()=>{D.current=!1}),[]),UDe(()=>{if(x)b.current=x;if(C)I.current=C;if(x&&C){if(M.current)return M.current(x,C,N);N()}},[x,C,N,M,P]);let L=mg.useMemo(()=>({reference:b,floating:I,setReference:f,setFloating:y}),[f,y]),H=mg.useMemo(()=>({reference:x,floating:C}),[x,C]),V=mg.useMemo(()=>{let O={position:n,left:0,top:0};if(!H.floating)return O;let U=P1o(H.floating,h.x),j=P1o(H.floating,h.y);if(a)return{...O,transform:"translate("+U+"px, "+j+"px)",...w1o(H.floating)>=1.5&&{willChange:"transform"}};return{position:n,left:U,top:j}},[n,a,H.floating,h.x,h.y]);return mg.useMemo(()=>({...h,update:N,refs:L,elements:H,floatingStyles:V}),[h,N,L,H,V])}var V0s=(e)=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){let{element:o,padding:r}=typeof e==="function"?e(n):e;if(o&&t(o)){if(o.current!=null)return Yft({element:o.current,padding:r}).fn(n);return{}}if(o)return Yft({element:o,padding:r}).fn(n);return{}}}},T1o=(e,t)=>{let n=x1o(e);return{name:n.name,fn:n.fn,options:[e,t]}},D1o=(e,t)=>{let n=C1o(e);return{name:n.name,fn:n.fn,options:[e,t]}},N1o=(e,t)=>({fn:S1o(e).fn,options:[e,t]}),R1o=(e,t)=>{let n=b1o(e);return{name:n.name,fn:n.fn,options:[e,t]}},Q1o=(e,t)=>{let n=I1o(e);return{name:n.name,fn:n.fn,options:[e,t]}};var k1o=(e,t)=>{let n=v1o(e);return{name:n.name,fn:n.fn,options:[e,t]}};var L1o=(e,t)=>{let n=V0s(e);return{name:n.name,fn:n.fn,options:[e,t]}};var H1o=at(ln(),1);var Y0s=Object.defineProperty,G0s=(e,t)=>Y0s(e,"name",{value:t,configurable:!0});function Wft(e){let[t,n]=H1o.useState(void 0);return t0(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let o=0,r=new ResizeObserver((i)=>{if(!Array.isArray(i))return;if(!i.length)return;let s=i[0];window.cancelAnimationFrame(o),o=window.requestAnimationFrame(()=>{let a,c;if("borderBoxSize"in s){let l=s.borderBoxSize,h=Array.isArray(l)?l[0]:l;a=h.inlineSize,c=h.blockSize}else a=e.offsetWidth,c=e.offsetHeight;n({width:a,height:c})})});return r.observe(e,{box:"border-box"}),()=>{window.cancelAnimationFrame(o),r.unobserve(e)}}else n(void 0)},[e]),t}G0s(Wft,"useSize");var loe=at(lo(),1),U0s=Object.defineProperty,FH=(e,t)=>U0s(e,"name",{value:t,configurable:!0});var F1o={Partial:"partial",Always:"always"},z1o={Optimized:"optimized",Always:"always"},O1o="Popper",[V1o,Xft]=Bx(O1o),[W0s,Y1o]=V1o(O1o),jft=FH((e)=>{let{__scopePopper:t,children:n}=e,[o,r]=j1.useState(null),[i,s]=j1.useState(void 0);return loe.jsx(W0s,{scope:t,anchor:o,onAnchorChange:r,placementState:i,setPlacementState:s,children:n})},"Popper"),X0s="PopperAnchor",G1o=j1.forwardRef(FH(function(t,n){let{__scopePopper:o,virtualRef:r,...i}=t,s=Y1o(X0s,o),a=j1.useRef(null),c=s.onAnchorChange,l=j1.useCallback((m)=>{if(a.current=m,m)c(m)},[c]),h=Eh(n,l),d=j1.useRef(null);j1.useEffect(()=>{if(!r)return;let m=d.current;if(d.current=r.current,m!==d.current)c(d.current)});let u=s.placementState&&XDe(s.placementState),_=u?.[0],p=u?.[1];return r?null:loe.jsx(Rp.div,{"data-radix-popper-side":_,"data-radix-popper-align":p,...i,ref:h})},"PopperAnchor")),U1o="PopperContent",[j0s,_Ka]=V1o(U1o),W1o=j1.forwardRef(FH(function(t,n){let{__scopePopper:o,side:r="bottom",sideOffset:i=0,align:s="center",alignOffset:a=0,arrowPadding:c=0,avoidCollisions:l=!0,collisionBoundary:h=[],collisionPadding:d=0,sticky:u=F1o.Partial,hideWhenDetached:_=!1,updatePositionStrategy:p=z1o.Optimized,onPlaced:m,...A}=t,g=Y1o(U1o,o),[f,y]=j1.useState(null),x=Eh(n,y),[C,b]=j1.useState(null),I=Wft(C),v=I?.width??0,P=I?.height??0,M=r+(s!=="center"?"-"+s:""),B=typeof d==="number"?d:{top:0,right:0,bottom:0,left:0,...d},T=Array.isArray(h)?h:[h],N=T.length>0,D={padding:B,boundary:T.filter(X1o),altBoundary:N},{refs:L,floatingStyles:H,placement:V,isPositioned:O,middlewareData:U}=B1o({strategy:"fixed",placement:M,whileElementsMounted:FH((...Z)=>Vft(...Z,{animationFrame:p===z1o.Always}),"whileElementsMounted"),elements:{reference:g.anchor},middleware:[T1o({mainAxis:i+P,alignmentAxis:a}),l&&D1o({mainAxis:!0,crossAxis:!1,...u===F1o.Partial?{limiter:N1o()}:{},...D}),l&&R1o({...D}),Q1o({...D,apply:FH(({elements:Z,rects:te,availableWidth:ie,availableHeight:le})=>{let{width:ue,height:de}=te.reference,me=Z.floating.style;me.setProperty("--radix-popper-available-width",`${ie}px`),me.setProperty("--radix-popper-available-height",`${le}px`),me.setProperty("--radix-popper-anchor-width",`${ue}px`),me.setProperty("--radix-popper-anchor-height",`${de}px`)},"apply")}),C&&L1o({element:C,padding:c}),K0s({arrowWidth:v,arrowHeight:P}),_&&k1o(N?{strategy:"referenceHidden",...D}:{strategy:"referenceHidden",padding:D.padding,altBoundary:D.altBoundary})]}),j=g.setPlacementState;t0(()=>(j(V),()=>{j(void 0)}),[V,j]);let[Y,X]=XDe(V),K=Tx(m);t0(()=>{if(O)K?.()},[O,K]);let J=U.arrow?.x,ee=U.arrow?.y,se=U.arrow?.centerOffset!==0,[ne,re]=j1.useState();return t0(()=>{if(f)re(window.getComputedStyle(f).zIndex)},[f]),loe.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:O?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ne,"--radix-popper-transform-origin":[U.transformOrigin?.x,U.transformOrigin?.y].join(" "),...U.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:loe.jsx(j0s,{scope:o,placedSide:Y,placedAlign:X,onArrowChange:b,arrowX:J,arrowY:ee,shouldHideArrow:se,children:loe.jsx(Rp.div,{"data-side":Y,"data-align":X,...A,ref:x,style:{...A.style,animation:!O?"none":A.style?.animation}})})})},"PopperContent"));function X1o(e){return e!==null}FH(X1o,"isNotNull");var K0s=FH((e)=>({name:"transformOrigin",options:e,fn(t){let{placement:n,rects:o,middlewareData:r}=t,s=r.arrow?.centerOffset!==0,a=s?0:e.arrowWidth,c=s?0:e.arrowHeight,[l,h]=XDe(n),d={start:"0%",center:"50%",end:"100%"}[h],u=(r.arrow?.x??0)+a/2,_=(r.arrow?.y??0)+c/2,p="",m="";if(l==="bottom")p=s?d:`${u}px`,m=`${-c}px`;else if(l==="top")p=s?d:`${u}px`,m=`${o.floating.height+c}px`;else if(l==="right")p=`${-c}px`,m=s?d:`${_}px`;else if(l==="left")p=`${o.floating.width+c}px`,m=s?d:`${_}px`;return{data:{x:p,y:m}}}}),"transformOrigin");function XDe(e){let[t,n="center"]=e.split("-");return[t,n]}FH(XDe,"getSideAndAlignFromPlacement");var wf=at(ln(),1);var J0s=at(ln(),1),jDe=at(ln(),1),q0s=Object.defineProperty,$ft=(e,t)=>q0s(e,"name",{value:t,configurable:!0}),Kft=!1;function j1o(){let[e,t]=jDe.useState(Kft);return jDe.useEffect(()=>{if(!Kft)Kft=!0,t(!0)},[]),e}$ft(j1o,"useIsHydrated");var K1o=J0s[" useSyncExternalStore ".trim().toString()];function $1o(){return()=>{}}$ft($1o,"subscribe");function q1o(){return K1o($1o,()=>!0,()=>!1)}$ft(q1o,"useIsHydratedModern");var J1o=typeof K1o==="function"?q1o:j1o;var zH=at(lo(),1),Z0s=Object.defineProperty,jU=(e,t)=>Z0s(e,"name",{value:t,configurable:!0}),qft="rovingFocusGroup.onEntryFocus",eps={bubbles:!1,cancelable:!0},KDe="RovingFocusGroup",[Jft,eyo,tps]=b_e(KDe),[nps,Zft]=Bx(KDe,[tps]),Z1o={Vertical:"vertical",Horizontal:"horizontal"},ops={LTR:"ltr",RTL:"rtl"},[rps,ips]=nps(KDe),tyo=wf.forwardRef(jU(function(t,n){return zH.jsx(Jft.Provider,{scope:t.__scopeRovingFocusGroup,children:zH.jsx(Jft.Slot,{scope:t.__scopeRovingFocusGroup,children:zH.jsx(sps,{...t,ref:n})})})},"RovingFocusGroup")),sps=wf.forwardRef(jU(function(t,n){let{__scopeRovingFocusGroup:o,orientation:r,loop:i=!1,dir:s,currentTabStopId:a,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:l,onEntryFocus:h,preventScrollOnEntryFocus:d=!1,...u}=t,_=wf.useRef(null),p=Eh(n,_),m=I_e(s),[A,g]=wH({prop:a,defaultProp:c??null,onChange:l,caller:KDe}),[f,y]=wf.useState(!1),x=Tx(h),C=eyo(o),b=wf.useRef(!1),[I,v]=wf.useState(0);return wf.useEffect(()=>{let P=_.current;if(P)return P.addEventListener(qft,x),()=>P.removeEventListener(qft,x)},[x]),zH.jsx(rps,{scope:o,orientation:r,dir:m,loop:i,currentTabStopId:A,onItemFocus:wf.useCallback((P)=>g(P),[g]),onItemShiftTab:wf.useCallback(()=>y(!0),[]),onFocusableItemAdd:wf.useCallback(()=>v((P)=>P+1),[]),onFocusableItemRemove:wf.useCallback(()=>v((P)=>P-1),[]),children:zH.jsx(Rp.div,{tabIndex:f||I===0?-1:0,"data-orientation":r,...u,ref:p,style:{outline:"none",...t.style},onMouseDown:ka(t.onMouseDown,()=>{b.current=!0}),onFocus:ka(t.onFocus,(P)=>{let M=!b.current;if(P.target===P.currentTarget&&M&&!f){let B=new CustomEvent(qft,eps);if(P.currentTarget.dispatchEvent(B),!B.defaultPrevented){let T=C().filter((V)=>V.focusable),N=T.find((V)=>V.active),D=T.find((V)=>V.id===A),H=[N,D,...T].filter(Boolean).map((V)=>V.ref.current);e2t(H,d)}}b.current=!1}),onBlur:ka(t.onBlur,()=>y(!1))})})},"RovingFocusGroupImpl")),aps="RovingFocusGroupItem",nyo=wf.forwardRef(jU(function(t,n){let{__scopeRovingFocusGroup:o,focusable:r=!0,active:i=!1,tabStopId:s,children:a,...c}=t,l=CC(),h=s||l,d=ips(aps,o),u=d.currentTabStopId===h,_=eyo(o),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:A}=d,g=J1o();return t0(()=>{if(!g||!r)return;return p(),()=>m()},[g,r,p,m]),wf.useEffect(()=>{if(g||!r)return;return p(),()=>m()},[g,r,p,m]),zH.jsx(Jft.ItemSlot,{scope:o,id:h,focusable:r,active:i,children:zH.jsx(Rp.span,{tabIndex:u?0:-1,"data-orientation":d.orientation,...c,ref:n,onMouseDown:ka(t.onMouseDown,(f)=>{if(!r)f.preventDefault();else d.onItemFocus(h)}),onFocus:ka(t.onFocus,()=>d.onItemFocus(h)),onKeyDown:ka(t.onKeyDown,(f)=>{if(f.key==="Tab"&&f.shiftKey){d.onItemShiftTab();return}if(f.target!==f.currentTarget)return;let y=ryo(f,d.orientation,d.dir);if(y!==void 0){if(f.metaKey||f.ctrlKey||f.altKey||f.shiftKey)return;f.preventDefault();let C=_().filter((b)=>b.focusable).map((b)=>b.ref.current);if(y==="last")C.reverse();else if(y==="prev"||y==="next"){if(y==="prev")C.reverse();let b=C.indexOf(f.currentTarget);C=d.loop?iyo(C,b+1):C.slice(b+1)}setTimeout(()=>e2t(C))}}),children:typeof a==="function"?a({isCurrentTabStop:u,hasTabStop:A!=null}):a})})},"RovingFocusGroupItem")),cps={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function oyo(e,t){if(t!==ops.RTL)return e;return e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}jU(oyo,"getDirectionAwareKey");function ryo(e,t,n){let o=oyo(e.key,n);if(t===Z1o.Vertical&&["ArrowLeft","ArrowRight"].includes(o))return;if(t===Z1o.Horizontal&&["ArrowUp","ArrowDown"].includes(o))return;return cps[o]}jU(ryo,"getFocusIntent");function e2t(e,t=!1){let n=document.activeElement;for(let o of e){if(o===n)return;if(o.focus({preventScroll:t}),document.activeElement!==n)return}}jU(e2t,"focusFirst");function iyo(e,t){return e.map((n,o)=>e[(t+o)%e.length])}jU(iyo,"wrapArray");var gc=at(lo(),1),hps=Object.defineProperty,Mh=(e,t)=>hps(e,"name",{value:t,configurable:!0}),dps={LTR:"ltr",RTL:"rtl"},t2t=["Enter"," "],ups=["ArrowDown","PageUp","Home"],ayo=["ArrowUp","PageDown","End"],pps=[...ups,...ayo],mps={ltr:[...t2t,"ArrowRight"],rtl:[...t2t,"ArrowLeft"]},_ps={ltr:["ArrowLeft"],rtl:["ArrowRight"]},qDe="Menu",[B_e,gps,Aps]=b_e(qDe),[KU,o2t]=Bx(qDe,[Aps,Xft,Zft]),JDe=Xft(),cyo=Zft(),[lyo,OH]=KU(qDe),[fps,D_e]=KU(qDe),hyo=Mh((e)=>{let{__scopeMenu:t,open:n=!1,children:o,dir:r,onOpenChange:i,modal:s=!0}=e,a=JDe(t),[c,l]=Ri.useState(null),h=Ri.useRef(!1),d=Tx(i),u=I_e(r);return Ri.useEffect(()=>{let _=Mh(()=>{h.current=!0,document.addEventListener("pointerdown",p,{capture:!0,once:!0}),document.addEventListener("pointermove",p,{capture:!0,once:!0})},"handleKeyDown"),p=Mh(()=>h.current=!1,"handlePointer");return document.addEventListener("keydown",_,{capture:!0}),()=>{document.removeEventListener("keydown",_,{capture:!0}),document.removeEventListener("pointerdown",p,{capture:!0}),document.removeEventListener("pointermove",p,{capture:!0})}},[]),Ri.useEffect(()=>{if(!n)return;let _=Mh(()=>d(!1),"handleBlur");return window.addEventListener("blur",_),()=>window.removeEventListener("blur",_)},[n,d]),gc.jsx(jft,{...a,children:gc.jsx(lyo,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:gc.jsx(fps,{scope:t,onClose:Ri.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:h,dir:u,modal:s,children:o})})})},"Menu"),r2t=Ri.forwardRef(Mh(function(t,n){let{__scopeMenu:o,...r}=t,i=JDe(o);return gc.jsx(G1o,{...i,...r,ref:n})},"MenuAnchor")),dyo="MenuPortal",[yps,uyo]=KU(dyo,{forceMount:void 0}),pyo=Mh((e)=>{let{__scopeMenu:t,forceMount:n,children:o,container:r}=e,i=OH(dyo,t);return gc.jsx(yps,{scope:t,forceMount:n,children:gc.jsx(oD,{present:n||i.open,children:gc.jsx(GTe,{asChild:!0,container:r,children:o})})})},"MenuPortal"),u8="MenuContent",[xps,i2t]=KU(u8),myo=Ri.forwardRef(Mh(function(t,n){let o=uyo(u8,t.__scopeMenu),{forceMount:r=o.forceMount,...i}=t,s=OH(u8,t.__scopeMenu),a=D_e(u8,t.__scopeMenu);return gc.jsx(B_e.Provider,{scope:t.__scopeMenu,children:gc.jsx(oD,{present:r||s.open,children:gc.jsx(B_e.Slot,{scope:t.__scopeMenu,children:a.modal?gc.jsx(Cps,{...i,ref:n}):gc.jsx(bps,{...i,ref:n})})})})},"MenuContent")),Cps=Ri.forwardRef(Mh(function(t,n){let o=OH(u8,t.__scopeMenu),r=Ri.useRef(null),i=Eh(n,r);return Ri.useEffect(()=>{let s=r.current;if(s)return eDe(s)},[]),gc.jsx(s2t,{...t,ref:i,trapFocus:o.open,disableOutsidePointerEvents:o.open,disableOutsideScroll:!0,onFocusOutside:ka(t.onFocusOutside,(s)=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>o.onOpenChange(!1)})},"MenuRootContentModal")),bps=Ri.forwardRef(Mh(function(t,n){let o=OH(u8,t.__scopeMenu);return gc.jsx(s2t,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>o.onOpenChange(!1)})},"MenuRootContentNonModal")),Ips=IC("MenuContent.ScrollLock"),s2t=Ri.forwardRef(Mh(function(t,n){let{__scopeMenu:o,loop:r=!1,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:c,onEntryFocus:l,onEscapeKeyDown:h,onPointerDownOutside:d,onFocusOutside:u,onInteractOutside:_,onDismiss:p,disableOutsideScroll:m,...A}=t,g=OH(u8,o),f=D_e(u8,o),y=JDe(o),x=cyo(o),C=gps(o),[b,I]=Ri.useState(null),v=Ri.useRef(null),[P,M]=Ri.useState(null);lAt(P);let{nodes:B,registry:T}=n_e(),N=Boolean(i||m),D=Eh(n,v,g.onContentChange,M),L=Ri.useRef(0),H=Ri.useRef(""),V=Ri.useRef(0),O=Ri.useRef(null),U=Ri.useRef("right"),j=Ri.useRef(0),Y=Ri.useMemo(()=>m?[v,...B.map((se)=>({current:se}))]:[],[v,B,m]),X=m?i_e:Ri.Fragment,K=m?{as:Ips,allowPinchZoom:!0,shards:Y}:void 0,J=Mh((se)=>{let ne=H.current+se,re=C().filter((me)=>!me.disabled),Z=document.activeElement,te=re.find((me)=>me.ref.current===Z)?.textValue,ie=re.map((me)=>me.textValue),le=Eyo(ie,ne,te),ue=re.find((me)=>me.textValue===le)?.ref.current;function de(me){if(H.current=me,window.clearTimeout(L.current),me!=="")L.current=window.setTimeout(()=>de(""),1000)}if(Mh(de,"updateSearch"),de(ne),ue)setTimeout(()=>ue.focus())},"handleTypeaheadSearch");Ri.useEffect(()=>()=>window.clearTimeout(L.current),[]),Vne();let ee=Ri.useCallback((se)=>U.current===O.current?.side&&wyo(se,O.current?.area),[]);return gc.jsx(xps,{scope:o,searchRef:H,onItemEnter:Ri.useCallback((se)=>{if(ee(se))se.preventDefault()},[ee]),onItemLeave:Ri.useCallback((se)=>{if(ee(se))return;v.current?.focus(),I(null)},[ee]),onTriggerLeave:Ri.useCallback((se)=>{if(ee(se))se.preventDefault()},[ee]),pointerGraceTimerRef:V,onPointerGraceIntentChange:Ri.useCallback((se)=>{O.current=se},[]),children:gc.jsx(t_e,{registry:N?T:null,children:gc.jsx(X,{...K,children:gc.jsx(VTe,{asChild:!0,trapped:i,branches:B,onMountAutoFocus:ka(s,(se)=>{se.preventDefault(),v.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:gc.jsx(OTe,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:h,onPointerDownOutside:d,onFocusOutside:u,onInteractOutside:_,onDismiss:p,children:gc.jsx(tyo,{asChild:!0,...x,dir:f.dir,orientation:"vertical",loop:r,currentTabStopId:b,onCurrentTabStopIdChange:I,onEntryFocus:ka(l,(se)=>{if(!f.isUsingKeyboardRef.current)se.preventDefault()}),preventScrollOnEntryFocus:!0,children:gc.jsx(W1o,{role:"menu","aria-orientation":"vertical","data-state":c2t(g.open),"data-radix-menu-content":"",dir:f.dir,...y,...A,ref:D,style:{outline:"none",...A.style},onKeyDown:ka(A.onKeyDown,(se)=>{let re=se.target.closest("[data-radix-menu-content]")===se.currentTarget,Z=se.ctrlKey||se.altKey||se.metaKey,te=se.key.length===1;if(re){if(se.key==="Tab")se.preventDefault();if(!Z&&te)J(se.key)}let ie=v.current;if(se.target!==ie)return;if(!pps.includes(se.key))return;se.preventDefault();let ue=C().filter((de)=>!de.disabled).map((de)=>de.ref.current);if(ayo.includes(se.key))ue.reverse();Syo(ue)}),onBlur:ka(t.onBlur,(se)=>{if(!se.currentTarget.contains(se.target))window.clearTimeout(L.current),H.current=""}),onPointerMove:ka(t.onPointerMove,hoe((se)=>{let ne=se.target,re=j.current!==se.clientX;if(se.currentTarget.contains(ne)&&re){let Z=se.clientX>j.current?"right":"left";U.current=Z,j.current=se.clientX}}))})})})})})})})},"MenuContentImpl"));var n2t="MenuItem",syo="menu.itemSelect",a2t=Ri.forwardRef(Mh(function(t,n){let{disabled:o=!1,onSelect:r,...i}=t,s=Ri.useRef(null),a=D_e(n2t,t.__scopeMenu),c=i2t(n2t,t.__scopeMenu),l=Eh(n,s),h=Ri.useRef(!1),d=Mh(()=>{let u=s.current;if(!o&&u){let _=new CustomEvent(syo,{bubbles:!0,cancelable:!0});if(u.addEventListener(syo,(p)=>r?.(p),{once:!0}),Zme(u,_),_.defaultPrevented)h.current=!1;else a.onClose()}},"handleSelect");return gc.jsx(_yo,{...i,ref:l,disabled:o,onClick:ka(t.onClick,d),onPointerDown:(u)=>{t.onPointerDown?.(u),h.current=!0},onPointerUp:ka(t.onPointerUp,(u)=>{if(!h.current)u.currentTarget?.click()}),onKeyDown:ka(t.onKeyDown,(u)=>{if(o||u.target!==u.currentTarget)return;if(c.searchRef.current!==""&&u.key===" ")return;if(t2t.includes(u.key))u.currentTarget.click(),u.preventDefault()})})},"MenuItem")),_yo=Ri.forwardRef(Mh(function(t,n){let{__scopeMenu:o,disabled:r=!1,textValue:i,...s}=t,a=i2t(n2t,o),c=cyo(o),l=Ri.useRef(null),h=Eh(n,l),[d,u]=Ri.useState(!1),[_,p]=Ri.useState("");return Ri.useEffect(()=>{let m=l.current;if(m)p((m.textContent??"").trim())},[s.children]),gc.jsx(B_e.ItemSlot,{scope:o,disabled:r,textValue:i??_,children:gc.jsx(nyo,{asChild:!0,...c,focusable:!r,children:gc.jsx(Rp.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:h,onPointerMove:ka(t.onPointerMove,hoe((m)=>{if(r)a.onItemLeave(m);else if(a.onItemEnter(m),!m.defaultPrevented)m.currentTarget.focus({preventScroll:!0})})),onPointerLeave:ka(t.onPointerLeave,hoe((m)=>a.onItemLeave(m))),onFocus:ka(t.onFocus,()=>u(!0)),onBlur:ka(t.onBlur,()=>u(!1))})})})},"MenuItemImpl")),gyo=Ri.forwardRef(Mh(function(t,n){let{checked:o=!1,onCheckedChange:r,...i}=t;return gc.jsx(Sps,{scope:t.__scopeMenu,checked:o,children:gc.jsx(a2t,{role:"menuitemcheckbox","aria-checked":T_e(o)?"mixed":o,...i,ref:n,"data-state":l2t(o),onSelect:ka(i.onSelect,()=>r?.(T_e(o)?!0:!o),{checkForDefaultPrevented:!1})})})},"MenuCheckboxItem")),vps="MenuRadioGroup",[XKa,jKa]=KU(vps,{value:void 0,onValueChange:Mh(()=>{},"onValueChange")});var Ayo="MenuItemIndicator",[Sps,Pps]=KU(Ayo,{checked:!1}),fyo=Ri.forwardRef(Mh(function(t,n){let{__scopeMenu:o,forceMount:r,...i}=t,s=Pps(Ayo,o);return gc.jsx(oD,{present:r||T_e(s.checked)||s.checked===!0,children:gc.jsx(Rp.span,{...i,ref:n,"data-state":l2t(s.checked)})})},"MenuItemIndicator")),yyo=Ri.forwardRef(Mh(function(t,n){let{__scopeMenu:o,...r}=t;return gc.jsx(Rp.div,{role:"separator","aria-orientation":"horizontal",...r,ref:n})},"MenuSeparator"));var xyo="MenuSub",[Eps,Cyo]=KU(xyo),byo=Mh((e)=>{let{__scopeMenu:t,children:n,open:o=!1,onOpenChange:r}=e,i=OH(xyo,t),s=JDe(t),[a,c]=Ri.useState(null),[l,h]=Ri.useState(null),d=Tx(r);return Ri.useEffect(()=>{if(i.open===!1)d(!1);return()=>d(!1)},[i.open,d]),gc.jsx(jft,{...s,children:gc.jsx(lyo,{scope:t,open:o,onOpenChange:d,content:l,onContentChange:h,children:gc.jsx(Eps,{scope:t,contentId:CC(),triggerId:CC(),trigger:a,onTriggerChange:c,children:n})})})},"MenuSub"),$De="MenuSubTrigger",Iyo=Ri.forwardRef(Mh(function(t,n){let o=OH($De,t.__scopeMenu),r=D_e($De,t.__scopeMenu),i=Cyo($De,t.__scopeMenu),s=i2t($De,t.__scopeMenu),a=Ri.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:l}=s,h={__scopeMenu:t.__scopeMenu},d=Ri.useCallback(()=>{if(a.current)window.clearTimeout(a.current);a.current=null},[]);Ri.useEffect(()=>d,[d]),Ri.useEffect(()=>{let _=c.current;return()=>{window.clearTimeout(_),l(null)}},[c,l]);let u=Eh(n,i.onTriggerChange);return gc.jsx(r2t,{asChild:!0,...h,children:gc.jsx(_yo,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?i.contentId:void 0,"data-state":c2t(o.open),...t,ref:u,onClick:(_)=>{if(t.onClick?.(_),t.disabled||_.defaultPrevented)return;if(_.currentTarget.focus(),!o.open)o.onOpenChange(!0)},onPointerMove:ka(t.onPointerMove,hoe((_)=>{if(s.onItemEnter(_),_.defaultPrevented)return;if(!t.disabled&&!o.open&&!a.current)s.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{o.onOpenChange(!0),d()},100)})),onPointerLeave:ka(t.onPointerLeave,hoe((_)=>{d();let p=o.content?.getBoundingClientRect();if(p){let m=o.content?.dataset.side,A=m==="right",g=A?-5:5,f=p[A?"left":"right"],y=p[A?"right":"left"];s.onPointerGraceIntentChange({area:[{x:_.clientX+g,y:_.clientY},{x:f,y:p.top},{x:y,y:p.top},{x:y,y:p.bottom},{x:f,y:p.bottom}],side:m}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(_),_.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:ka(t.onKeyDown,(_)=>{if(t.disabled||_.target!==_.currentTarget)return;if(s.searchRef.current!==""&&_.key===" ")return;if(mps[r.dir].includes(_.key))o.onOpenChange(!0),o.content?.focus(),_.preventDefault()})})})},"MenuSubTrigger")),Mps="MenuSubContent",vyo=Ri.forwardRef(Mh(function(t,n){let o=uyo(u8,t.__scopeMenu),{forceMount:r=o.forceMount,align:i="start",...s}=t,a=OH(u8,t.__scopeMenu),c=D_e(u8,t.__scopeMenu),l=Cyo(Mps,t.__scopeMenu),h=Ri.useRef(null),d=Eh(n,h);return gc.jsx(B_e.Provider,{scope:t.__scopeMenu,children:gc.jsx(oD,{present:r||a.open,children:gc.jsx(B_e.Slot,{scope:t.__scopeMenu,children:gc.jsx(s2t,{id:l.contentId,"aria-labelledby":l.triggerId,...s,ref:d,align:i,side:c.dir===dps.RTL?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:(u)=>{if(c.isUsingKeyboardRef.current)h.current?.focus();u.preventDefault()},onCloseAutoFocus:(u)=>u.preventDefault(),onFocusOutside:ka(t.onFocusOutside,(u)=>{if(u.target!==l.trigger)a.onOpenChange(!1)}),onEscapeKeyDown:ka(t.onEscapeKeyDown,(u)=>{c.onClose(),u.preventDefault()}),onKeyDown:ka(t.onKeyDown,(u)=>{let _=u.currentTarget.contains(u.target),p=_ps[c.dir].includes(u.key);if(_&&p)a.onOpenChange(!1),l.trigger?.focus(),u.preventDefault()})})})})})},"MenuSubContent"));function c2t(e){return e?"open":"closed"}Mh(c2t,"getOpenState");function T_e(e){return e==="indeterminate"}Mh(T_e,"isIndeterminate");function l2t(e){return T_e(e)?"indeterminate":e?"checked":"unchecked"}Mh(l2t,"getCheckedState");function Syo(e){let t=document.activeElement;for(let n of e){if(n===t)return;if(n.focus(),document.activeElement!==t)return}}Mh(Syo,"focusFirst");function Pyo(e,t){return e.map((n,o)=>e[(t+o)%e.length])}Mh(Pyo,"wrapArray");function Eyo(e,t,n){let r=t.length>1&&Array.from(t).every((l)=>l===t[0])?t[0]:t,i=n?e.indexOf(n):-1,s=Pyo(e,Math.max(i,0));if(r.length===1)s=s.filter((l)=>l!==n);let c=s.find((l)=>l.toLowerCase().startsWith(r.toLowerCase()));return c!==n?c:void 0}Mh(Eyo,"getNextMatch");function Myo(e,t){let{x:n,y:o}=e,r=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){let a=t[i],c=t[s],{x:l,y:h}=a,{x:d,y:u}=c;if(h>o!==u>o&&n<(d-l)*(o-h)/(u-h)+l)r=!r}return r}Mh(Myo,"isPointInPolygon");function wyo(e,t){if(!t)return!1;let n={x:e.clientX,y:e.clientY};return Myo(n,t)}Mh(wyo,"isPointerInGraceArea");function hoe(e){return(t)=>t.pointerType==="mouse"?e(t):void 0}Mh(hoe,"whenMouse");var x4=at(lo(),1),Bps=Object.defineProperty,p8=(e,t)=>Bps(e,"name",{value:t,configurable:!0}),h2t="DropdownMenu",[Tps,a$a]=Bx(h2t,[o2t]),m8=o2t(),[Dps,Byo]=Tps(h2t),ZDe=p8((e)=>{let{__scopeDropdownMenu:t,children:n,dir:o,open:r,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,c=m8(t),l=C4.useRef(null),[h,d]=wH({prop:r,defaultProp:i??!1,onChange:s,caller:h2t});return x4.jsx(Dps,{scope:t,triggerId:CC(),triggerRef:l,contentId:CC(),open:h,onOpenChange:d,onOpenToggle:C4.useCallback(()=>d((u)=>!u),[d]),modal:a,children:x4.jsx(hyo,{...c,open:h,onOpenChange:d,dir:o,modal:a,children:n})})},"DropdownMenu"),Nps="DropdownMenuTrigger",eNe=C4.forwardRef(p8(function(t,n){let{__scopeDropdownMenu:o,disabled:r=!1,...i}=t,s=Byo(Nps,o),a=m8(o),c=Eh(n,s.triggerRef);return x4.jsx(r2t,{asChild:!0,...a,children:x4.jsx(Rp.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:c,onPointerDown:ka(t.onPointerDown,(l)=>{if(!r&&l.button===0&&l.ctrlKey===!1){if(s.onOpenToggle(),!s.open)l.preventDefault()}}),onKeyDown:ka(t.onKeyDown,(l)=>{if(r)return;if(["Enter"," "].includes(l.key))s.onOpenToggle();if(l.key==="ArrowDown")s.onOpenChange(!0);if(["Enter"," ","ArrowDown"].includes(l.key))l.preventDefault()})})})},"DropdownMenuTrigger")),N_e=p8((e)=>{let{__scopeDropdownMenu:t,...n}=e,o=m8(t);return x4.jsx(pyo,{...o,...n})},"DropdownMenuPortal"),Rps="DropdownMenuContent",tNe=C4.forwardRef(p8(function(t,n){let{__scopeDropdownMenu:o,...r}=t,i=Byo(Rps,o),s=m8(o),a=C4.useRef(!1);return x4.jsx(myo,{id:i.contentId,"aria-labelledby":i.triggerId,...s,...r,ref:n,onCloseAutoFocus:ka(t.onCloseAutoFocus,(c)=>{if(!a.current)i.triggerRef.current?.focus();a.current=!1,c.preventDefault()}),onInteractOutside:ka(t.onInteractOutside,(c)=>{let l=c.detail.originalEvent,h=l.button===0&&l.ctrlKey===!0,d=l.button===2||h;if(!i.modal||d)a.current=!0}),style:{...t.style,...{"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}})},"DropdownMenuContent"));var lD=C4.forwardRef(p8(function(t,n){let{__scopeDropdownMenu:o,...r}=t,i=m8(o);return x4.jsx(a2t,{...i,...r,ref:n})},"DropdownMenuItem")),Tyo=C4.forwardRef(p8(function(t,n){let{__scopeDropdownMenu:o,...r}=t,i=m8(o);return x4.jsx(gyo,{...i,...r,ref:n})},"DropdownMenuCheckboxItem"));var Dyo=C4.forwardRef(p8(function(t,n){let{__scopeDropdownMenu:o,...r}=t,i=m8(o);return x4.jsx(fyo,{...i,...r,ref:n})},"DropdownMenuItemIndicator")),d2t=C4.forwardRef(p8(function(t,n){let{__scopeDropdownMenu:o,...r}=t,i=m8(o);return x4.jsx(yyo,{...i,...r,ref:n})},"DropdownMenuSeparator"));var Nyo=p8((e)=>{let{__scopeDropdownMenu:t,children:n,open:o,onOpenChange:r,defaultOpen:i}=e,s=m8(t),[a,c]=wH({prop:o,defaultProp:i??!1,onChange:r,caller:"DropdownMenuSub"});return x4.jsx(byo,{...s,open:a,onOpenChange:c,children:n})},"DropdownMenuSub"),Ryo=C4.forwardRef(p8(function(t,n){let{__scopeDropdownMenu:o,...r}=t,i=m8(o);return x4.jsx(Iyo,{...i,...r,ref:n})},"DropdownMenuSubTrigger")),Qyo=C4.forwardRef(p8(function(t,n){let{__scopeDropdownMenu:o,...r}=t,i=m8(o);return x4.jsx(vyo,{...i,...r,ref:n,style:{...t.style,...{"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}})},"DropdownMenuSubContent"));var Am=at(lo(),1),qU=at(lo(),1);var f2t=at(ln(),1),Gs=at(lo(),1),_g=at(lo(),1);var cNe=at(ln(),1);var qms=at(ln(),1),v2t=at(lo(),1),nxo=at(lo(),1),S2t=at(ln(),1);function y2t(e){let t=WA(e),n=new Map;for(let s of t.schematic_component.list())if(s.source_component_id)n.set(s.source_component_id,s.schematic_component_id);let o=new Map;for(let s of t.source_trace.list()){let a=s.subcircuit_connectivity_map_key;if(!a)continue;for(let c of s.connected_source_port_ids??[]){let l=n.get(t.source_port.get(c)?.source_component_id??"");if(!l)continue;if(!o.has(l))o.set(l,new Set);o.get(l).add(a)}}let r=new Map;for(let s of t.schematic_net_label.list()){if(!s.source_net_id)continue;let a=t.source_net.get(s.source_net_id)?.subcircuit_connectivity_map_key??s.source_net_id;r.set(s.schematic_net_label_id,a)}let i=new Map;for(let s of t.schematic_text.list()){if(!s.source_trace_id)continue;let a=t.source_trace.get(s.source_trace_id)?.subcircuit_connectivity_map_key;if(a)i.set(s.schematic_text_id,a)}return{componentIdToKeys:o,netLabelIdToKey:r,textIdToKey:i}}var iNe=(e,t)=>Math.hypot(e.x-t.x,e.y-t.y),Lyo=(e,t,n)=>{let o=n.x-t.x,r=n.y-t.y,i=o*o+r*r,s=i?Math.max(0,Math.min(1,((e.x-t.x)*o+(e.y-t.y)*r)/i)):0;return iNe(e,{x:t.x+s*o,y:t.y+s*r})},$U=(e,t,n)=>Math.abs(iNe(t,e)+iNe(e,n)-iNe(t,n))<0.00001;function Qps(e,t){let n=y2t(t),o=e?.closest("[data-subcircuit-connectivity-map-key], [data-schematic-net-label-id], [data-schematic-text-id], [data-schematic-trace-id]");if(!o)return;let r=t.find((i)=>i.type==="schematic_trace"&&i.schematic_trace_id===o.getAttribute("data-schematic-trace-id"));return o.getAttribute("data-subcircuit-connectivity-map-key")||n.netLabelIdToKey.get(o.getAttribute("data-schematic-net-label-id"))||n.textIdToKey.get(o.getAttribute("data-schematic-text-id"))||(r?.type==="schematic_trace"?r.subcircuit_connectivity_map_key||t.filter((i)=>i.type==="source_trace").find((i)=>i.source_trace_id===r.source_trace_id)?.subcircuit_connectivity_map_key:void 0)}function kps(e,t){let n=y2t(e),o=e.filter((d)=>d.type==="source_trace"),r=e.filter((d)=>d.type==="schematic_trace"),i=e.filter((d)=>d.type==="schematic_sheet"),s=i[0]?.schematic_sheet_id,a=[];for(let d of r){if((d.subcircuit_connectivity_map_key??o.find((_)=>_.source_trace_id===d.source_trace_id)?.subcircuit_connectivity_map_key)!==t)continue;for(let _ of d.edges)a.push({a:_.from,b:_.to,sheet:d.schematic_sheet_id??s,target:{type:"schematic_trace",id:d.schematic_trace_id},sourceTraceId:d.source_trace_id,portIds:[_.from_schematic_port_id,_.to_schematic_port_id].filter((p)=>!!p),junctions:d.junctions})}for(let d of e)if(d.type==="schematic_net_label"&&n.netLabelIdToKey.get(d.schematic_net_label_id)===t){let u=d.anchor_position??d.center;a.push({a:u,b:u,sheet:d.schematic_sheet_id??s,target:{type:"schematic_net_label",id:d.schematic_net_label_id},name:d.text})}for(let d of e){if(d.type!=="schematic_text"||n.textIdToKey.get(d.schematic_text_id)!==t)continue;let u=d.schematic_sheet_id??s,p=a.filter((m)=>m.sheet===u&&m.sourceTraceId===d.source_trace_id).sort((m,A)=>Lyo(d.position,m.a,m.b)-Lyo(d.position,A.a,A.b))[0]?.a??d.position;a.push({a:p,b:p,sheet:u,target:{type:"schematic_text",id:d.schematic_text_id},name:d.text})}let c=a.map((d,u)=>u),l=(d)=>c[d]===d?d:c[d]=l(c[d]);for(let d=0;d<a.length;d++)for(let u=0;u<d;u++){let _=a[d],p=a[u];if(_.sheet!==p.sheet)continue;if($U(_.a,p.a,p.b)||$U(_.b,p.a,p.b)||$U(p.a,_.a,_.b)||$U(p.b,_.a,_.b)||[..._.junctions??[],...p.junctions??[]].some((m)=>$U(m,_.a,_.b)&&$U(m,p.a,p.b)))c[l(d)]=l(u)}let h=new Map;return a.forEach((d,u)=>h.set(l(u),[...h.get(l(u))??[],d])),[...h.values()].map((d,u)=>{let _=d.find((f)=>f.target.type!=="schematic_trace")??d[0],m=e.filter((f)=>f.type==="schematic_port").filter((f)=>(f.schematic_sheet_id??s)===_.sheet&&d.some((y)=>y.portIds?.includes(f.schematic_port_id)||$U(f.center,y.a,y.b))).map((f)=>{let y=e.find((C)=>C.type==="source_port"&&C.source_port_id===f.source_port_id);if(y?.type!=="source_port")return;let x=e.find((C)=>C.type==="source_component"&&C.source_component_id===y.source_component_id);return x?.type==="source_component"?`${x.name}.${y.name??`pin${y.pin_number}`}`:void 0}).filter((f)=>!!f).sort(),A=i.findIndex((f)=>f.schematic_sheet_id===_.sheet);return{kind:"net",label:`${i[A]?.name??`Sheet ${Math.max(0,A)+1}`}: ${m[0]??_.name??`Location ${u+1}`}`,schematicSheetId:_.sheet,target:_.target,focusPoint:{x:(_.a.x+_.b.x)/2,y:(_.a.y+_.b.y)/2}}})}var Lps={async load(){let e=await nmo("@tscircuit/circuit-json-schematic-placement-analysis");if(typeof e.createSchematicPlacementIssueArtifacts!=="function")throw Error("The style analyzer module does not export its analysis function.");return e}},lI={contextMenu:110,styleAnalysis:120,viewMenu:110,viewMenuIcon:48,clickToInteractOverlay:100,schematicComponentDetailsTooltip:105,schematicComponentHoverOutline:47,schematicPortHoverOutline:48,schematicSearch:101},Hps=({circuitJson:e,onClose:t})=>{let[n,o]=aNe.useState({status:"loading"});return aNe.useEffect(()=>{let r=!1;o({status:"loading"});let i=window.setTimeout(async()=>{try{let{createSchematicPlacementIssueArtifacts:s}=await Lps.load();if(r)return;let a=s(e);if(!r)o({status:"complete",artifacts:a})}catch(s){if(!r)o({status:"error",message:s instanceof Error?s.message:String(s)})}},0);return()=>{r=!0,window.clearTimeout(i)}},[e]),gg.jsx(Ypo,{open:!0,onOpenChange:(r)=>!r&&t(),children:gg.jsxs(Wpo,{children:[gg.jsx(Xpo,{style:{position:"fixed",inset:0,background:"#0008",zIndex:lI.styleAnalysis}}),gg.jsxs(jpo,{style:{position:"fixed",top:"5vh",left:"50%",transform:"translateX(-50%)",width:"min(1000px, 94vw)",maxHeight:"90vh",overflowY:"auto",boxSizing:"border-box",padding:24,borderRadius:12,background:"#fafafa",color:"#171717",fontFamily:"system-ui, sans-serif",boxShadow:"0 20px 60px #0005",zIndex:lI.styleAnalysis},children:[gg.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16},children:[gg.jsx($po,{style:{margin:0,fontSize:22},children:"Style Analysis"}),gg.jsx(Jpo,{style:{cursor:"pointer",padding:"6px 12px"},children:"Close"})]}),gg.jsx(qpo,{style:{color:"#525252"},children:"Placement and style issues across all schematic sheets. Each image highlights one issue with its description below."}),n.status==="loading"&&gg.jsx("p",{role:"status",children:"Running style analysis…"}),n.status==="error"&&gg.jsxs("p",{role:"alert",children:["Style analysis failed: ",n.message]}),n.status==="complete"&&gg.jsxs(gg.Fragment,{children:[gg.jsx("p",{role:"status",children:n.artifacts.length===0?"No style issues found.":`${n.artifacts.length} style ${n.artifacts.length===1?"issue":"issues"} found.`}),n.artifacts.map((r)=>gg.jsxs("section",{style:{marginTop:24,border:"1px solid #ddd",borderRadius:8,overflow:"hidden",background:"white"},children:[gg.jsxs("h3",{style:{margin:16,fontSize:16},children:[r.issueIndex+1,"."," ",r.issue.lineItemType.replace(/([a-z])([A-Z])/g,"$1 $2"),r.schematicSheetId&&gg.jsxs("small",{style:{display:"block",marginTop:4,color:"#525252"},children:["Sheet: ",r.schematicSheetId]})]}),gg.jsx("img",{src:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(r.content)}`,alt:r.descriptionXml,loading:"lazy",style:{display:"block",width:"100%",height:"auto"}})]},r.issueIndex))]})]})]})})},doe={IS_SHOWING_SCHEMATIC_GROUPS:"schematic_viewer_show_groups",IS_SHOWING_SCHEMATIC_PORTS:"schematic_viewer_show_ports",SELECTED_SCHEMATIC_SHEET:"schematic_viewer_selected_sheet"},Hyo=(e,t)=>{if(typeof window>"u")return t;try{let n=localStorage.getItem(e);return n!==null?JSON.parse(n):t}catch{return t}},Fyo=(e,t)=>{if(typeof window>"u")return;try{localStorage.setItem(e,JSON.stringify(t))}catch{}},zps=(e)=>{if(typeof window>"u")return null;try{return localStorage.getItem(e)}catch{return null}},Ops=(e,t)=>{if(typeof window>"u")return;try{localStorage.setItem(e,t)}catch{}},zyo=["#8B0000","#2F4F4F","#191970","#006400","#FF4500","#800080","#2E8B57","#B8860B","#C71585","#008B8B"],Vps=(e)=>{let{svgDivRef:t,circuitJson:n,circuitJsonKey:o,showGroups:r}=e;Kyo.useEffect(()=>{if(t.current)t.current.querySelectorAll(".schematic-group-overlay").forEach((a)=>a.remove());if(!t.current||!r||!n||n.length===0)return;let i=setTimeout(()=>{if(!t.current)return;let s=t.current.querySelector("svg");if(!s)return;s.querySelectorAll(".schematic-group-overlay").forEach((c)=>c.remove());try{let c=WA(n).source_group?.list().filter((f)=>!f.is_subcircuit)||[],l=WA(n).schematic_component?.list()||[],h=new Map;c.forEach((f)=>{let y=f;if(y.parent_source_group_id){let x=h.get(y.parent_source_group_id)||[];x.push(f.source_group_id),h.set(y.parent_source_group_id,x)}});let d=(f)=>{let y=[],x=h.get(f)||[];for(let C of x)y.push(C),y.push(...d(C));return y},u=(f)=>{let y=c.find((x)=>x.source_group_id===f);if(!y?.parent_source_group_id)return 0;return 1+u(y.parent_source_group_id)},_=c.length>0&&c.some((f)=>f.name&&f.name.trim()!==""),p=[];if(_){let f=new Map;for(let y of l){let x=WA(n).source_component.get(y.source_component_id);if(x?.source_group_id){if(!f.has(x.source_group_id))f.set(x.source_group_id,[]);f.get(x.source_group_id).push(y)}}c.forEach((y,x)=>{let C=f.get(y.source_group_id)||[],b=d(y.source_group_id);for(let I of b){let v=f.get(I)||[];C=[...C,...v]}if(C.length>0){let I=u(y.source_group_id),v=d(y.source_group_id).length>0;if(y.name?.startsWith("unnamed_board"))return;p.push({id:y.source_group_id,name:y.name||`Group ${x+1}`,components:C,color:zyo[x%zyo.length],depthLevel:I,hasChildren:v,sourceGroupId:y.source_group_id})}})}let m=s.viewBox.baseVal,A=s.getBoundingClientRect(),g=Math.min(A.width/m.width,A.height/m.height)||1;p.sort((f,y)=>f.depthLevel-y.depthLevel),p.forEach((f)=>{if(f.components.length===0)return;let y=Yps(f.components,s);if(!y)return;let x=Math.max(8,Math.min(25,15/Math.max(g,0.3))),C=f.hasChildren?x*0.6:0,b=x+C,I=Math.max(1,2/Math.max(g,0.5)),v=f.depthLevel===0?I:I*0.7,P=Math.max(4,8/Math.max(g,0.5)),M=f.hasChildren?1.3:1,B=P*M,T=B*0.5,N=document.createElementNS("http://www.w3.org/2000/svg","rect");N.setAttribute("class","schematic-group-overlay"),N.setAttribute("x",(y.minX-b).toString()),N.setAttribute("y",(y.minY-b).toString()),N.setAttribute("width",(y.maxX-y.minX+b*2).toString()),N.setAttribute("height",(y.maxY-y.minY+b*2).toString()),N.setAttribute("fill","none"),N.setAttribute("stroke",f.color),N.setAttribute("stroke-width",v.toString()),N.setAttribute("stroke-dasharray",`${B},${T}`),N.setAttribute("opacity","0.8"),N.setAttribute("rx","0"),N.setAttribute("ry","0");let D=Math.max(6,Math.min(20,14/Math.max(g,0.2))),L=f.depthLevel===0||f.depthLevel===1?0:f.depthLevel*0.2,H=D*(1-L),V=Math.max(1,H*0.2),O=f.name,U=document.createElementNS("http://www.w3.org/2000/svg","text");U.setAttribute("font-size",H.toString()),U.setAttribute("font-family","Arial, sans-serif"),U.textContent=O,s.appendChild(U);let j=U.getBBox();s.removeChild(U);let Y=j.width+V*2,X=H+V*2,K=y.minX-b,J=y.minY-b-X,ee=document.createElementNS("http://www.w3.org/2000/svg","rect");ee.setAttribute("class","schematic-group-overlay"),ee.setAttribute("x",K.toString()),ee.setAttribute("y",(J-X).toString()),ee.setAttribute("width",Y.toString()),ee.setAttribute("height",X.toString()),ee.setAttribute("fill","transparent"),ee.setAttribute("rx","0"),ee.setAttribute("ry","0");let se=document.createElementNS("http://www.w3.org/2000/svg","text");se.setAttribute("class","schematic-group-overlay"),se.setAttribute("x",(K+V).toString()),se.setAttribute("y",(J+X-V).toString()),se.setAttribute("fill",f.color),se.setAttribute("font-size",H.toString()),se.setAttribute("font-family","Arial, sans-serif"),se.setAttribute("font-weight",f.depthLevel===0?"600":"500"),se.setAttribute("stroke",f.color),se.setAttribute("stroke-width",Math.max(0.2,H*0.02).toString()),se.textContent=O,s.appendChild(N),s.appendChild(ee),s.appendChild(se)})}catch(c){console.error("Error creating group overlays:",c)}},10);return()=>clearTimeout(i)},[t,o,r])};function Yps(e,t){let n=1/0,o=1/0,r=-1/0,i=-1/0;for(let a of e){let c=t.querySelector(`g[data-schematic-component-id="${a.schematic_component_id}"]`);if(!c)c=t.querySelector(`[data-schematic-component-id="${a.schematic_component_id}"]`);if(c){let l=c.getBBox();n=Math.min(n,l.x),o=Math.min(o,l.y),r=Math.max(r,l.x+l.width),i=Math.max(i,l.y+l.height)}}if(n===1/0)return null;return{minX:n,minY:o,maxX:r,maxY:i}}var u2t="sch-net-faded",Oyo="g.trace[data-subcircuit-connectivity-map-key], g.trace-overlays[data-subcircuit-connectivity-map-key]",p2t="[data-schematic-net-label-id], [data-schematic-text-id]",Gps=({svgDivRef:e,circuitJson:t,circuitJsonKey:n,enabled:o})=>{$yo.useEffect(()=>{let r=e.current;if(!o||!r)return;let{componentIdToKeys:i,netLabelIdToKey:s,textIdToKey:a}=y2t(t),c=[],l=new Map,h=null,d=()=>{for(let{el:g}of c)g.classList.remove(u2t);c=[],l.clear(),h=null;let A=r.querySelector("svg");if(!A)return;for(let g of Array.from(A.querySelectorAll(Oyo))){let f=g.getAttribute("data-subcircuit-connectivity-map-key"),y=new Set;if(f)y.add(f),l.set(g,f);c.push({el:g,keys:y})}for(let g of Array.from(A.querySelectorAll("g[data-schematic-component-id]"))){let f=g.getAttribute("data-schematic-component-id");c.push({el:g,keys:i.get(f)??new Set})}for(let g of Array.from(A.querySelectorAll(p2t))){let f=s.get(g.getAttribute("data-schematic-net-label-id"))??a.get(g.getAttribute("data-schematic-text-id")),y=new Set;if(f)y.add(f),l.set(g,f);c.push({el:g,keys:y})}},u=(A)=>{if(A===h)return;h=A;for(let{el:g,keys:f}of c)g.classList.toggle(u2t,A!==null&&!f.has(A))},_=(A)=>{let g=A.target;if(!(g instanceof Element)){u(null);return}let f=g.closest(`${Oyo}, ${p2t}`);if(f&&l.has(f)){u(l.get(f));return}for(let[y,x]of l){if(!y.matches(p2t))continue;let C=y.getBoundingClientRect();if(A.clientX>=C.left-6&&A.clientX<=C.right+6&&A.clientY>=C.top-6&&A.clientY<=C.bottom+6){u(x);return}}u(null)},p=()=>u(null);d(),r.addEventListener("mousemove",_),r.addEventListener("mouseleave",p);let m=new MutationObserver(d);return m.observe(r,{childList:!0}),()=>{m.disconnect(),r.removeEventListener("mousemove",_),r.removeEventListener("mouseleave",p);for(let{el:A}of c)A.classList.remove(u2t)}},[e,n,o])},m2t="http://www.w3.org/2000/svg",Ups=({svgDivRef:e,svgContent:t,circuitJsonKey:n})=>{let o=Q_e.useRef(new Set);Q_e.useLayoutEffect(()=>{o.current.clear()},[n]),Q_e.useLayoutEffect(()=>{let r=[];for(let i of e.current?.querySelectorAll(".schematic-warning")??[]){let s=i.getAttribute("data-warning-id"),a=i.querySelector('[data-warning-reference="callout"]');if(!s||!a)continue;let c=Array.from(i.children),l=c.map((y)=>y.style.display),h=i.getAttribute("role"),d=i.getAttribute("aria-label")??"Warning",u=document.createElementNS(m2t,"g");u.setAttribute("data-warning-icon",""),u.setAttribute("aria-hidden","true"),u.setAttribute("transform",`translate(${a.getAttribute("x")} ${a.getAttribute("y")})`);let _=document.createElementNS(m2t,"rect");_.setAttribute("width","24"),_.setAttribute("height","24"),_.setAttribute("fill",a.getAttribute("fill")??"#fffaeb"),_.setAttribute("stroke",a.getAttribute("stroke")??"#d99a00"),_.setAttribute("stroke-width","1");let p=document.createElementNS(m2t,"text");p.setAttribute("x","12"),p.setAttribute("y","12"),p.setAttribute("dominant-baseline","central"),p.setAttribute("text-anchor","middle"),p.setAttribute("font-size","16"),p.setAttribute("font-family","sans-serif"),p.setAttribute("font-weight","bold"),p.setAttribute("fill","#5c4300"),p.textContent="!",u.append(_,p),i.append(u),i.setAttribute("role","button"),i.setAttribute("tabindex","0"),i.style.cursor="pointer",i.style.outline="none";let m=()=>{let y=o.current.has(s);c.forEach((x,C)=>{x.style.display=y?"none":l[C]}),u.style.display=y?"":"none",i.setAttribute("aria-expanded",String(!y)),i.setAttribute("aria-label",`${y?"Expand":"Minimize"} warning: ${d}`)},A=(y)=>{if(y.preventDefault(),y.stopPropagation(),o.current.has(s))o.current.delete(s);else o.current.add(s);m()},g=(y)=>{if(y.key==="Enter"||y.key===" ")if(!y.repeat)A(y);else y.preventDefault()},f=(y)=>y.stopPropagation();i.addEventListener("click",A),i.addEventListener("keydown",g),i.addEventListener("mousedown",f),i.addEventListener("touchstart",f),m(),r.push(()=>{if(i.removeEventListener("click",A),i.removeEventListener("keydown",g),i.removeEventListener("mousedown",f),i.removeEventListener("touchstart",f),u.remove(),c.forEach((y,x)=>{y.style.display=l[x]}),h)i.setAttribute("role",h);else i.removeAttribute("role");i.setAttribute("aria-label",d),i.removeAttribute("aria-expanded"),i.removeAttribute("tabindex"),i.style.removeProperty("cursor"),i.style.removeProperty("outline")})}return()=>r.forEach((i)=>i())},[e,t,n])},A2t=(e)=>String(e??"").toLocaleLowerCase(),R_e=(e,t)=>{let n=A2t(e);if(n===t)return 0;if(n.startsWith(t))return 1;if(n.includes(t))return 2;return Number.POSITIVE_INFINITY},Wps=(e)=>{if(!e)return;return String(e).replace(/^simple_/,"").replaceAll("_"," ").replace(/\b\w/g,(t)=>t.toLocaleUpperCase())},Xps=(e,t,n)=>{let r=Wps(e?.ftype);if(e?.ftype==="simple_chip"&&e.manufacturer_part_number)r=e.manufacturer_part_number;let i=[];if(e?.display_name===n&&e.name!==n)i.push(e.name);let s=e?.display_value;if(!s&&e){for(let a of["display_resistance","display_capacitance","display_inductance","display_frequency","symbol_display_value"])if(a in e){let c=e[a];if(typeof c==="string"){s=c;break}}}if(s??(s=t.symbol_display_value),r)i.push(r);if(s)i.push(s);if(!r&&!s&&e?.manufacturer_part_number)i.push(e.manufacturer_part_number);if(i.length===0)return;return i.join(" · ")},jps=(e)=>e.type==="source_component"&&("source_component_id"in e),Kps=(e)=>e.type==="source_port",$ps=(e)=>e.type==="source_trace",qps=(e)=>e.type==="schematic_component",Jps=(e)=>e.type==="schematic_port",Zps=(e)=>e.type==="schematic_net_label",ems=(e)=>e.type==="schematic_sheet",_2t=({schematicSheets:e,schematicSheetId:t})=>{if(e.length<=1||!t)return;return e.find((n)=>n.schematic_sheet_id===t)?.name},tms=(e,t)=>{let n=A2t(t).trim();if(!n)return[];let o=new Map(e.filter(jps).map((h)=>[h.source_component_id,h])),r=new Map(e.filter(Kps).map((h)=>[h.source_port_id,h])),i=e.filter(Jps),s=e.filter($ps),a=e.filter(ems),c=[],l=new Map;for(let h of e.filter(qps)){let d=h.source_component_id?o.get(h.source_component_id):void 0,u=d?.display_name??d?.name??"Component",_=Math.min(R_e(d?.name,n),R_e(d?.display_name,n),R_e(d?.manufacturer_part_number,n));if(Number.isFinite(_)){let p={label:u,detail:Xps(d,h,u),kind:"component",schematicSheetId:h.schematic_sheet_id,schematicSheetName:_2t({schematicSheets:a,schematicSheetId:h.schematic_sheet_id}),target:{type:"schematic_component",id:h.schematic_component_id}};c.push(p),l.set(p,_)}}for(let h of e.filter(Zps)){if(!A2t(h.text).includes(n))continue;let d=new Set;for(let y of s.filter((x)=>x.connected_source_net_ids.includes(h.source_net_id)))for(let x of y.connected_source_port_ids)d.add(x);let u=h.anchor_position??h.center,_=i.filter((y)=>d.has(y.source_port_id)&&(!h.schematic_sheet_id||!y.schematic_sheet_id||y.schematic_sheet_id===h.schematic_sheet_id)).map((y)=>({port:y,distance:Math.hypot(y.center.x-u.x,y.center.y-u.y)})).filter(({distance:y})=>y<=1).sort((y,x)=>y.distance-x.distance)[0]?.port,p=_?r.get(_.source_port_id):void 0,m=p?.source_component_id?o.get(p.source_component_id):void 0,A=p?.name??(p?.pin_number!==void 0?`pin${p.pin_number}`:_?.display_pin_label),g=m?.name&&A?`Connected to ${m.name}.${A}`:void 0,f={label:h.text,detail:g,kind:"net",schematicSheetId:h.schematic_sheet_id,schematicSheetName:_2t({schematicSheets:a,schematicSheetId:h.schematic_sheet_id}),target:{type:"schematic_net_label",id:h.schematic_net_label_id}};c.push(f),l.set(f,R_e(h.text,n))}for(let h of e){if(h.type!=="schematic_text"||!h.source_trace_id)continue;let d=R_e(h.text,n);if(!Number.isFinite(d))continue;let u={label:h.text,kind:"net",schematicSheetId:h.schematic_sheet_id,schematicSheetName:_2t({schematicSheets:a,schematicSheetId:h.schematic_sheet_id}),target:{type:"schematic_text",id:h.schematic_text_id}};c.push(u),l.set(u,d)}return c.sort((h,d)=>(l.get(h)??Number.POSITIVE_INFINITY)-(l.get(d)??Number.POSITIVE_INFINITY)||h.label.localeCompare(d.label))},nms=({containerRect:e,targetRect:t,visibleProjection:n,minimumScale:o})=>{let r=n.a||1,i={x:t.left+t.width/2-e.left,y:t.top+t.height/2-e.top},s={x:(i.x-n.e)/r,y:(i.y-n.f)/r},a=Math.max(r,o);return{a,b:0,c:0,d:a,e:e.width/2-s.x*a,f:e.height/2-s.y*a}},oms=1.8,Vyo=350,rms=({controller:e,circuitJson:t,circuitJsonKey:n,svgDivRef:o,containerRef:r,activeSheetId:i,hasMultipleSheets:s,handleSelectSheet:a,svgString:c,svgToScreenProjection:l,setSvgToScreenProjection:h,setIsInteractionEnabled:d})=>{let[u,_]=K1.useState(""),[p,m]=K1.useState(null),A=K1.useRef(null),g=K1.useMemo(()=>tms(t,u),[t,n,u]),f=K1.useCallback((I)=>{let v=o.current,P=r.current;if(!v||!P)return!1;let M=`data-${I.target.type.replaceAll("_","-")}-id`,B=Array.from(v.querySelectorAll(`[${M}]`)).find((H)=>H.getAttribute(M)===I.target.id);if(!B)return!1;let T=B.getBoundingClientRect();if(I.focusPoint){let H=B.closest("svg"),V=H?.getAttribute("data-real-to-screen-transform"),O=H?.getScreenCTM?.();if(V&&O){let U=Vt(O,Vt(hDe(V),I.focusPoint));T={left:U.x-1,top:U.y-1,width:2,height:2}}}let N=P.getBoundingClientRect();if(!N.width||!N.height)return!1;if(!T.width&&!T.height)return!1;if(A.current)clearTimeout(A.current);let D=l,L=getComputedStyle(v).transform;if(L&&L!=="none")try{D=hDe(L),v.style.transition="none",v.style.transform=L,v.offsetWidth}catch{}return v.style.transition=`transform ${Vyo}ms ease-in-out`,v.offsetWidth,h(nms({containerRect:N,targetRect:T,visibleProjection:D,minimumScale:oms})),A.current=setTimeout(()=>{v.style.transition=""},Vyo),v.querySelectorAll(".schematic-search-match").forEach((H)=>H.classList.remove("schematic-search-match")),v.querySelectorAll(`[${M}]`).forEach((H)=>{if(H.getAttribute(M)===I.target.id)H.classList.add("schematic-search-match")}),!0},[r,h,o,l]),y=K1.useCallback((I)=>{if(d(!0),I.schematicSheetId&&I.schematicSheetId!==i&&s){a(I.schematicSheetId),m(I);return}f(I)},[i,f,a,s,d]),x=K1.useCallback(()=>{if(_(""),m(null),A.current)clearTimeout(A.current),A.current=null;if(o.current)o.current.style.transition="",o.current.querySelectorAll(".schematic-search-match").forEach((I)=>I.classList.remove("schematic-search-match"))},[o]),C=e?.focusRequest,b=e?.onFocusRequestHandled;return K1.useEffect(()=>{if(!C)return;let I=t.find((v)=>v.type==="schematic_component"&&v.schematic_component_id===C.schematicComponentId);if(I?.type!=="schematic_component"){m(null),b?.(C);return}if(d(!0),I.schematic_sheet_id&&s)a(I.schematic_sheet_id);m({kind:"component",label:I.schematic_component_id,schematicSheetId:I.schematic_sheet_id,target:{type:"schematic_component",id:I.schematic_component_id}})},[C,b,t,n,s,a,d]),K1.useEffect(()=>{if(!p||!c)return;if(s&&p.schematicSheetId&&p.schematicSheetId!==i)return;let I=requestAnimationFrame(()=>{if(f(p)){if(m(null),C?.schematicComponentId===p.target.id)b?.(C)}});return()=>cancelAnimationFrame(I)},[f,C,b,p,c,s,i]),K1.useEffect(()=>{if(u)return;o.current?.querySelectorAll(".schematic-search-match").forEach((I)=>I.classList.remove("schematic-search-match"))},[u,o]),K1.useEffect(()=>()=>{if(A.current)clearTimeout(A.current)},[]),{searchQuery:u,setSearchQuery:_,searchResults:g,handleSearchResultSelect:y,handleCancelSearch:x}},g$a=x2t.default("schematic-viewer"),ims=()=>{x2t.default.enable("schematic-viewer*")},sms=(e)=>{let[t,n]=k_e.useState(0),[o,r]=k_e.useState(0);return k_e.useEffect(()=>{if(!e.current)return;let i=()=>{let a=e.current?.getBoundingClientRect();n(a?.width||0),r(a?.height||0)};i();let s=new ResizeObserver(i);return s.observe(e.current),window.addEventListener("resize",i),()=>{s.disconnect(),window.removeEventListener("resize",i)}},[]),{containerWidth:t,containerHeight:o}},ams=600,nNe=10,cms=({containerRef:e})=>{let[t,n]=_A.useState(null),[o,r]=_A.useState(!1),[i,s]=_A.useState({x:0,y:0}),a=_A.useRef(null),c=_A.useRef(null),l=_A.useRef(null),h=_A.useRef(0),d=_A.useCallback(()=>{if(l.current===null)return;window.clearTimeout(l.current),l.current=null},[]),u=_A.useCallback((g)=>{if(g.preventDefault(),Date.now()<h.current)return;let f=c.current;if(!f)return;let y=Math.abs(g.clientX-f.x)>nNe||Math.abs(g.clientY-f.y)>nNe;if(c.current=null,y)return;n(g.target instanceof Element?g.target:null),s({x:g.clientX,y:g.clientY}),r(!0)},[]),_=_A.useCallback((g)=>{if(d(),g.touches.length!==1){c.current=null;return}let f=g.touches[0];if(!f)return;let y=g.target instanceof Element?g.target:null;c.current={x:f.clientX,y:f.clientY},l.current=window.setTimeout(()=>{let x=e.current;if(!x||!c.current)return;n(y);let C=x.getBoundingClientRect();s({x:C.left+C.width/2,y:C.top+C.height/2}),r(!0),h.current=Date.now()+1000,c.current=null},ams)},[d,e]),p=_A.useCallback((g)=>{let f=c.current;if(!f||g.touches.length!==1)return;let y=g.touches[0];if(!y||Math.abs(y.clientX-f.x)>nNe||Math.abs(y.clientY-f.y)>nNe)c.current=null,d()},[d]),m=_A.useCallback(()=>{d(),c.current=null},[d]),A=_A.useCallback((g)=>{let f=g.target;if(a.current?.contains(f))return;if(f.closest?.("[data-radix-popper-content-wrapper], [data-radix-dropdown-menu-content]"))return;r(!1)},[]);return _A.useEffect(()=>{if(!o)return;return document.addEventListener("mousedown",A),document.addEventListener("touchstart",A),()=>{document.removeEventListener("mousedown",A),document.removeEventListener("touchstart",A)}},[A,o]),_A.useEffect(()=>d,[d]),{menuVisible:o,menuTarget:t,menuPos:i,menuRef:a,setMenuVisible:r,contextMenuEventHandlers:{onMouseDown:(g)=>{c.current=g.button===2||g.button===0&&g.ctrlKey?{x:g.clientX,y:g.clientY}:null},onContextMenu:u,onTouchStart:_,onTouchMove:p,onTouchEnd:m,onTouchCancel:m}}},lms=(e,t,n)=>e.filter((o)=>{if(!o.type.endsWith("_warning"))return!1;let r=o;return[["source_component",t.source_component_id],["schematic_component",t.schematic_component_id],["pcb_component",n?.pcb_component_id]].some(([s,a])=>{if(!a)return!1;let c=r[`${s}_ids`];return r[`${s}_id`]===a||Array.isArray(c)&&c.includes(a)||r.schematic_element_type===s&&r.schematic_element_id===a})}),hms=new Set(["type","source_component_id","source_group_id","subcircuit_id","display_name","ftype","are_pins_interchangeable","supplier_part_numbers"]),Yyo=["name","resistance","capacitance","inductance","frequency","voltage","current","max_voltage_rating","max_current_rating","power_rating","manufacturer_part_number"],dms={jlcpcb:(e)=>`https://jlcpcb.com/partdetail/${encodeURIComponent(e)}`,lcsc:(e)=>`https://www.lcsc.com/product-detail/${encodeURIComponent(e)}.html`},ums=(e)=>{let t=e.trim(),n=/^c?(\d+)$/i.exec(t);return n?`C${n[1]}`:t},Gyo=(e)=>{let t=Yyo.indexOf(e);return t===-1?Yyo.length:t},pms=(e,t,n)=>{if(t==="name")return String(n);let o=e[`display_${t}`];if(typeof o==="string"&&o.trim()){let r=t==="resistance"?o.replace(/Ω$/,""):o;return JSON.stringify(r)}return JSON.stringify(n)??String(n)},mms=(e)=>Object.entries(e).filter(([t,n])=>{if(hms.has(t))return!1;if(t.startsWith("display_")&&t.slice(8)in e)return!1;return n!==void 0&&n!==null&&n!==""}).sort(([t],[n])=>Gyo(t)-Gyo(n)||t.localeCompare(n)).map(([t,n])=>({key:t,label:t,value:pms(e,t,n)})),_ms=(e)=>{let t=e.supplier_part_numbers;if(!t)return[];return["jlcpcb","lcsc"].flatMap((n)=>{let o=t[n];if(!Array.isArray(o))return[];let r=[...new Set(o.filter((i)=>Boolean(typeof i==="string"&&i.trim())).map(ums))];if(!r.length)return[];return[{key:`supplier_part_numbers.${n}`,label:n,links:r.map((i)=>({partNumber:i,href:dms[n](i)}))}]})},gms=(e,t)=>{let n=e.find((c)=>c.type==="schematic_component"&&c.schematic_component_id===t);if(!n)return null;let o=e.find((c)=>c.type==="source_component"&&c.source_component_id===n.source_component_id);if(!o)return null;let r=e.find((c)=>c.type==="pcb_component"&&c.source_component_id===o.source_component_id),i=e.find((c)=>c.type==="cad_component"&&c.source_component_id===o.source_component_id&&(!r||c.pcb_component_id===r.pcb_component_id)),s=r?.footprinter_string??i?.footprinter_string,a=r?Ams(e,r.pcb_component_id):null;return{schematicComponent:n,sourceComponent:o,pcbComponent:r,footprinterString:s,footprintPreviewCircuitJson:a?.circuitJson,footprintPreviewViewBox:a?.viewBox,warnings:lms(e,n,r)}},oNe=2,Ams=(e,t)=>{let n=e.find((i)=>i.type==="pcb_component"&&i.pcb_component_id===t);if(!n)return null;let o=_ft(n);if(!o)return null;let r={minX:o.minX-oNe,minY:o.minY-oNe,maxX:o.maxX+oNe,maxY:o.maxY+oNe};return{circuitJson:sfo(e,r),viewBox:r}},fms=(e,t)=>{let n=m2o(e,{width:320,height:240,viewport:t,backgroundColor:"#f8fafc",includeVersion:!1});return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`},qyo=(e,t)=>{let n=e?.closest("[data-schematic-component-id]")?.getAttribute("data-schematic-component-id"),o=e?.closest("[data-schematic-text-id]")?.getAttribute("data-schematic-text-id"),r=e?.closest("[data-schematic-port-id]")?.getAttribute("data-schematic-port-id");if(!n&&!o&&!r)return;let i=t.find((l)=>l.type==="schematic_text"&&l.schematic_text_id===o),s=t.find((l)=>l.type==="schematic_port"&&!!r&&(l.schematic_port_id===r||l.source_port_id===r)),a=n??(i?.type==="schematic_text"?i.schematic_component_id:void 0)??(s?.type==="schematic_port"?s.schematic_component_id:void 0);if(!a)return;let c=t.find((l)=>l.type==="schematic_component"&&l.schematic_component_id===a);if(c?.type!=="schematic_component")return;return c},yms=(e,t)=>{let n=qyo(e,t);if(!n)return;let o=t.find((i)=>i.type==="source_component"&&i.source_component_id===n.source_component_id),r=t.find((i)=>i.type==="pcb_component"&&i.source_component_id===n.source_component_id);if(o?.type!=="source_component"||r?.type!=="pcb_component")return;return{source_component_id:o.source_component_id,schematic_component_id:n.schematic_component_id,pcb_component_id:r.pcb_component_id,refdes:o.name}},C2t=Bf.createContext(null),xms=5,Cms=(e,t)=>{if(!e&&!t)return!0;if(!e||!t)return!1;return e.minX===t.minX&&e.maxX===t.maxX&&e.minY===t.minY&&e.maxY===t.maxY},bms=({children:e})=>{if(Bf.useContext(C2t))return moe.jsx(moe.Fragment,{children:e});return moe.jsx(Ims,{children:e})},Ims=({children:e})=>{let t=Bf.useRef({pointer:null,boundingBoxes:new Map,hoveringIds:new Set,subscribers:new Set,mouseDownPosition:null}),n=Bf.useCallback(()=>{for(let h of t.current.subscribers)h()},[]),o=Bf.useCallback(()=>{let h=t.current.pointer,d=new Set;if(h)for(let[_,p]of t.current.boundingBoxes){let m=p.bounds;if(!m)continue;if(h.x>=m.minX&&h.x<=m.maxX&&h.y>=m.minY&&h.y<=m.maxY)d.add(_)}let u=t.current.hoveringIds;if(d.size===u.size&&[...d].every((_)=>u.has(_)))return;t.current.hoveringIds=d,n()},[n]),r=Bf.useCallback((h,d)=>{t.current.boundingBoxes.set(h,d),o()},[o]),i=Bf.useCallback((h,d)=>{let u=t.current.boundingBoxes.get(h);if(u&&Cms(u.bounds,d.bounds)&&u.onClick===d.onClick)return;t.current.boundingBoxes.set(h,d),o()},[o]),s=Bf.useCallback((h)=>{if(t.current.boundingBoxes.delete(h))o()},[o]),a=Bf.useCallback((h)=>(t.current.subscribers.add(h),()=>{t.current.subscribers.delete(h)}),[]),c=Bf.useCallback((h)=>t.current.hoveringIds.has(h),[]);Bf.useEffect(()=>{let h=(p)=>{let{clientX:m,clientY:A}=p,g=t.current.pointer;if(g&&g.x===m&&g.y===A)return;t.current.pointer={x:m,y:A},o()},d=()=>{if(t.current.pointer===null)return;t.current.pointer=null,t.current.mouseDownPosition=null,o()},u=(p)=>{t.current.mouseDownPosition={x:p.clientX,y:p.clientY}},_=(p)=>{let{clientX:m,clientY:A}=p,g=t.current.mouseDownPosition;if(g){if(Math.sqrt(Math.pow(m-g.x,2)+Math.pow(A-g.y,2))>xms){t.current.mouseDownPosition=null;return}}t.current.mouseDownPosition=null;for(let f of t.current.boundingBoxes.values()){let y=f.bounds;if(!y)continue;if(m>=y.minX&&m<=y.maxX&&A>=y.minY&&A<=y.maxY)f.onClick?.(p)}};return window.addEventListener("pointermove",h,{passive:!0}),window.addEventListener("pointerdown",h,{passive:!0}),window.addEventListener("pointerup",h,{passive:!0}),window.addEventListener("pointerleave",d),window.addEventListener("pointercancel",d),window.addEventListener("blur",d),window.addEventListener("mousedown",u,{passive:!0}),window.addEventListener("click",_,{passive:!0}),()=>{window.removeEventListener("pointermove",h),window.removeEventListener("pointerdown",h),window.removeEventListener("pointerup",h),window.removeEventListener("pointerleave",d),window.removeEventListener("pointercancel",d),window.removeEventListener("blur",d),window.removeEventListener("mousedown",u),window.removeEventListener("click",_)}},[o]);let l=Bf.useMemo(()=>({registerBoundingBox:r,updateBoundingBox:i,unregisterBoundingBox:s,subscribe:a,isHovering:c}),[r,i,s,a,c]);return moe.jsx(C2t.Provider,{value:l,children:e})},poe=(e)=>{if(typeof e!=="number"&&typeof e!=="string")return null;if(typeof e==="string"&&!e.trim())return null;let t=Number(e);return Number.isFinite(t)&&t>=0?t:null},vms=(e)=>{let t=poe(e);if(t!==null)return t;if(typeof e!=="string")return null;try{let n=JSON.parse(e);if(Array.isArray(n))return poe(n[0]?.price)}catch{return e.split(",").map((o)=>{let[r,i]=o.split(":");return{quantity:poe(r?.split("-")[0]),price:poe(i)}}).filter((o)=>o.quantity!==null&&o.price!==null).sort((o,r)=>o.quantity-r.quantity)[0]?.price??null}return null},Sms=async(e,t,n=fetch)=>{let o=await n(`https://jlcsearch.tscircuit.com/api/search?q=${encodeURIComponent(e)}&limit=1`,{signal:t,cache:"no-store"});if(!o.ok)throw Error("JLC part lookup failed");let r=await o.json();if(!Array.isArray(r?.components))return null;let i=r.components.find((s)=>s&&String(s.lcsc).replace(/^c/i,"")===e.replace(/^c/i,""));if(!i)return null;return{price:poe(i.price1)??vms(i.price),stock:poe(i.stock)}},Pms=(e)=>{if(e?.price==null)return"Price unavailable";let t={minimumFractionDigits:2,maximumFractionDigits:6};if(e.currency===null)return e.price.toLocaleString("en-US",t);return e.price.toLocaleString("en-US",{...t,style:"currency",currency:e.currency??"USD"})},Ems=({partNumber:e,platformConfig:t})=>{let[n,o]=L_e.useState(null),[r,i]=L_e.useState(!0),s=t?.partsEngine,a=t?.platformFetch;return L_e.useEffect(()=>{let c=new AbortController,l=!0;i(!0),o(null);let h=setTimeout(()=>{if(c.abort(),l)i(!1)},1e4);return Promise.resolve().then(async()=>{if(s?.fetchPartAvailability)return await s.fetchPartAvailability({supplierName:"jlcpcb",supplierPartNumber:e,signal:c.signal,platformFetch:a})??null;return Sms(e,c.signal,a)}).then((d)=>{if(l)o(d)}).catch(()=>{}).finally(()=>{if(clearTimeout(h),l)i(!1)}),()=>{l=!1,clearTimeout(h),c.abort()}},[e,s,a]),sI.jsx("span",{role:"status","aria-label":`${e} price and stock`,"aria-busy":r,style:{display:"block",color:"#64748b",marginTop:"2px"},children:r?sI.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4},children:[sI.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12","aria-hidden":"true",children:sI.jsx("circle",{cx:"6",cy:"6",r:"4",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeDasharray:"18 8",children:sI.jsx("animateTransform",{attributeName:"transform",type:"rotate",from:"0 6 6",to:"360 6 6",dur:"1s",repeatCount:"indefinite"})})}),"Loading price and stock…"]}):sI.jsxs(sI.Fragment,{children:[sI.jsx("span",{style:{display:"block"},children:Pms(n)}),sI.jsx("span",{style:{display:"block"},children:n?.stock!=null?`${n.stock.toLocaleString("en-US")} in stock`:"Stock unavailable"})]})})},g2t={color:"#64748b",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace',fontSize:"12px",lineHeight:1.45},Mms=({platformConfig:e,sourceComponent:t,warnings:n=[],footprinterString:o,footprintPreviewCircuitJson:r,footprintPreviewViewBox:i,left:s,top:a,width:c,maxHeight:l})=>{let h=sNe.useMemo(()=>mms(t),[t]),d=sNe.useMemo(()=>_ms(t),[t]),u=sNe.useMemo(()=>r?.length&&i?fms(r,i):void 0,[r,i]);return Hp.jsxs("dialog",{open:!0,"aria-label":`${t.name} component details`,"data-schematic-component-details-tooltip":!0,style:{position:"absolute",left:s,right:"auto",top:a,bottom:"auto",width:c,maxHeight:l,margin:0,padding:0,overflowY:"auto",overscrollBehavior:"contain",cursor:"auto",boxSizing:"border-box",border:"1px solid #cbd5e1",borderRadius:"4px",backgroundColor:"rgba(255, 255, 255, 0.98)",boxShadow:"0 20px 25px -5px rgba(15, 23, 42, 0.18), 0 8px 10px -6px rgba(15, 23, 42, 0.12)",color:"#0f172a",fontFamily:'Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',pointerEvents:"auto",userSelect:"text",WebkitUserSelect:"text",zIndex:lI.schematicComponentDetailsTooltip},onMouseDown:(_)=>_.stopPropagation(),onClick:(_)=>_.stopPropagation(),onWheel:(_)=>_.stopPropagation(),children:[Hp.jsxs("dl",{style:{display:"grid",gridTemplateColumns:"minmax(110px, 0.8fr) minmax(0, 1.2fr)",gap:"6px 12px",margin:0,padding:"8px"},children:[h.map((_)=>Hp.jsxs("div",{style:{display:"contents"},children:[Hp.jsx("dt",{style:g2t,children:_.label}),Hp.jsx("dd",{style:{minWidth:0,margin:0,color:"#1e293b",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace',fontSize:"12px",lineHeight:1.45,overflowWrap:"anywhere"},children:_.value})]},_.key)),d.map((_)=>Hp.jsxs("div",{style:{display:"contents"},children:[Hp.jsx("dt",{style:g2t,children:_.label}),Hp.jsx("dd",{style:{minWidth:0,margin:0,fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace',fontSize:"12px",lineHeight:1.45,overflowWrap:"anywhere"},children:_.links.map((p,m)=>Hp.jsxs("span",{style:_.label==="jlcpcb"?{display:"block",marginTop:m>0?6:0}:void 0,children:[_.label!=="jlcpcb"&&m>0&&", ",Hp.jsx("a",{href:p.href,target:"_blank",rel:"noreferrer noopener",style:{color:"#2563eb",textDecoration:"underline"},children:p.partNumber}),_.label==="jlcpcb"&&Hp.jsx(Ems,{partNumber:p.partNumber,platformConfig:e},`${t.source_component_id}-${p.partNumber}`)]},p.href))})]},_.key)),o&&Hp.jsxs("div",{style:{display:"contents"},children:[Hp.jsx("dt",{style:g2t,children:"footprint"}),Hp.jsx("dd",{style:{minWidth:0,margin:0,color:"#1e293b",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace',fontSize:"12px",lineHeight:1.45,overflowWrap:"anywhere"},children:JSON.stringify(o)})]})]}),n.length>0&&Hp.jsxs("section",{"aria-label":"Component warnings",style:{margin:"0 8px 8px",padding:"8px",border:"1px solid #fcd34d",borderRadius:"4px",backgroundColor:"#fffbeb",color:"#92400e",fontSize:"12px",lineHeight:1.45,overflowWrap:"anywhere"},children:[Hp.jsxs("strong",{children:["Warnings (",n.length,")"]}),Hp.jsx("ul",{style:{margin:"4px 0 0",paddingLeft:"18px"},children:n.map((_,p)=>Hp.jsx("li",{children:_.message},`${_.type}-${p}`))})]}),u&&Hp.jsx("div",{style:{padding:"0 4px 4px"},children:Hp.jsx("div",{style:{height:"210px",overflow:"hidden",border:"1px solid #e2e8f0",borderRadius:"2px",background:"#f8fafc"},children:Hp.jsx("img",{src:u,alt:`${t.name}${o?` ${o}`:""} PCB footprint`,loading:"lazy",referrerPolicy:"no-referrer",style:{display:"block",width:"100%",height:"100%",objectFit:"contain"}})})})]})},Jyo=(e)=>{let t=EC.useContext(C2t);if(!t)throw Error("useMouseEventsOverBoundingBox must be used within a MouseTracker");let n=EC.useId(),o=EC.useRef(e);o.current=e;let r=EC.useMemo(()=>(s)=>{o.current.onClick?.(s)},[]);return EC.useEffect(()=>(t.registerBoundingBox(n,{bounds:o.current.bounds,onClick:o.current.onClick?r:void 0}),()=>{t.unregisterBoundingBox(n)}),[t,r,n]),EC.useEffect(()=>{t.updateBoundingBox(n,{bounds:o.current.bounds,onClick:o.current.onClick?r:void 0})},[t,r,n,e.bounds?.minX,e.bounds?.maxX,e.bounds?.minY,e.bounds?.maxY,e.onClick]),{hovering:EC.useSyncExternalStore(t.subscribe,()=>t.isHovering(n),()=>!1)}},wms=(e,t)=>{if(!e&&!t)return!0;if(!e||!t)return!1;return Math.abs(e.bounds.minX-t.bounds.minX)<0.5&&Math.abs(e.bounds.maxX-t.bounds.maxX)<0.5&&Math.abs(e.bounds.minY-t.bounds.minY)<0.5&&Math.abs(e.bounds.maxY-t.bounds.maxY)<0.5&&Math.abs(e.rect.left-t.rect.left)<0.5&&Math.abs(e.rect.top-t.rect.top)<0.5&&Math.abs(e.rect.width-t.rect.width)<0.5&&Math.abs(e.rect.height-t.rect.height)<0.5},Bms=({componentId:e,svgDivRef:t,containerRef:n,onComponentClick:o,onHoverChange:r,showOutline:i,circuitJsonKey:s})=>{let[a,c]=aI.useState(null),l=aI.useRef(null),h=aI.useCallback(()=>{l.current=null;let A=t.current,g=n.current;if(!A||!g){c((b)=>b?null:b);return}let f=A.querySelector(`[data-schematic-component-id="${e}"]`);if(!f){c((b)=>b?null:b);return}let y=f.getBoundingClientRect(),x=g.getBoundingClientRect(),C={bounds:{minX:y.left,maxX:y.right,minY:y.top,maxY:y.bottom},rect:{left:y.left-x.left,top:y.top-x.top,width:y.width,height:y.height}};c((b)=>wms(b,C)?b:C)},[e,n,t]),d=aI.useCallback(()=>{if(l.current!==null)return;l.current=window.requestAnimationFrame(h)},[h]);aI.useEffect(()=>{d()},[d,s]),aI.useEffect(()=>{d();let A=t.current,g=n.current;if(!A||!g)return;let f=typeof ResizeObserver<"u"?new ResizeObserver(()=>{d()}):null;f?.observe(g),f?.observe(A);let y=typeof MutationObserver<"u"?new MutationObserver(()=>{d()}):null;return y?.observe(A,{attributes:!0,attributeFilter:["style","transform"],subtree:!0,childList:!0}),window.addEventListener("scroll",d,!0),window.addEventListener("resize",d),()=>{if(f?.disconnect(),y?.disconnect(),window.removeEventListener("scroll",d,!0),window.removeEventListener("resize",d),l.current!==null)cancelAnimationFrame(l.current),l.current=null}},[d,t,n]);let u=aI.useCallback((A)=>{if(o)o(e,A)},[e,o]),_=a?.bounds??null,{hovering:p}=Jyo({bounds:_,onClick:o?u:void 0});if(aI.useEffect(()=>{if(r)r(e,p)},[p,e,r]),!a||!p||!i)return null;let m=a.rect;return Zyo.jsx("div",{style:{position:"absolute",left:m.left,top:m.top,width:m.width,height:m.height,border:"1.5px solid rgba(51, 153, 255, 0.9)",pointerEvents:"none",zIndex:lI.schematicComponentHoverOutline}})},Tms=(e,t)=>{if(!e&&!t)return!0;if(!e||!t)return!1;return Math.abs(e.bounds.minX-t.bounds.minX)<0.5&&Math.abs(e.bounds.maxX-t.bounds.maxX)<0.5&&Math.abs(e.bounds.minY-t.bounds.minY)<0.5&&Math.abs(e.bounds.maxY-t.bounds.maxY)<0.5&&Math.abs(e.rect.left-t.rect.left)<0.5&&Math.abs(e.rect.top-t.rect.top)<0.5&&Math.abs(e.rect.width-t.rect.width)<0.5&&Math.abs(e.rect.height-t.rect.height)<0.5},Dms=({portId:e,portLabel:t,svgDivRef:n,containerRef:o,onPortClick:r,onHoverChange:i,showOutline:s,circuitJsonKey:a})=>{let[c,l]=cI.useState(null),h=cI.useRef(null),d=cI.useCallback(()=>{h.current=null;let g=n.current,f=o.current;if(!g||!f){l((v)=>v?null:v);return}let y=g.querySelector(`[data-schematic-port-id="${e}"]`);if(!y){l((v)=>v?null:v);return}let x=y.getBoundingClientRect(),C=f.getBoundingClientRect(),b=4,I={bounds:{minX:x.left-b,maxX:x.right+b,minY:x.top-b,maxY:x.bottom+b},rect:{left:x.left-C.left-b,top:x.top-C.top-b,width:x.width+b*2,height:x.height+b*2}};l((v)=>Tms(v,I)?v:I)},[e,o,n]),u=cI.useCallback(()=>{if(h.current!==null)return;h.current=window.requestAnimationFrame(d)},[d]);cI.useEffect(()=>{u()},[u,a]),cI.useEffect(()=>{u();let g=n.current,f=o.current;if(!g||!f)return;let y=typeof ResizeObserver<"u"?new ResizeObserver(()=>{u()}):null;y?.observe(f),y?.observe(g);let x=typeof MutationObserver<"u"?new MutationObserver(()=>{u()}):null;return x?.observe(g,{attributes:!0,attributeFilter:["style","transform"],subtree:!0,childList:!0}),window.addEventListener("scroll",u,!0),window.addEventListener("resize",u),()=>{if(y?.disconnect(),x?.disconnect(),window.removeEventListener("scroll",u,!0),window.removeEventListener("resize",u),h.current!==null)cancelAnimationFrame(h.current),h.current=null}},[u,n,o]);let _=cI.useCallback((g)=>{if(r)r(e,g)},[e,r]),p=c?.bounds??null,{hovering:m}=Jyo({bounds:p,onClick:r?_:void 0});if(cI.useEffect(()=>{if(i)i(e,m)},[m,e,i]),!c||!s)return null;let A=c.rect;return JU.jsxs(JU.Fragment,{children:[JU.jsx("div",{style:{position:"absolute",left:A.left,top:A.top,width:A.width,height:A.height,border:m?"1.5px solid rgba(255, 153, 51, 0.9)":"1.5px solid rgba(255, 153, 51, 0.3)",backgroundColor:m?"rgba(255, 153, 51, 0.15)":"rgba(255, 153, 51, 0.05)",borderRadius:"50%",pointerEvents:"none",zIndex:lI.schematicPortHoverOutline,transition:"border-color 0.15s, background-color 0.15s"}}),m&&t&&JU.jsx("div",{style:{position:"absolute",left:A.left+A.width/2,top:A.top-24,transform:"translateX(-50%)",backgroundColor:"rgba(0, 0, 0, 0.85)",color:"white",padding:"4px 8px",borderRadius:"4px",fontSize:"12px",fontFamily:"monospace",whiteSpace:"nowrap",pointerEvents:"none",zIndex:lI.schematicPortHoverOutline+1},children:t})]})},H_e=({children:e,size:t,strokeWidth:n})=>Ag.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e}),Uyo=(e)=>Ag.jsxs(H_e,{...e,children:[Ag.jsx("circle",{cx:"11",cy:"11",r:"8"}),Ag.jsx("path",{d:"m21 21-4.34-4.34"})]}),Nms=(e)=>Ag.jsxs(H_e,{...e,children:[Ag.jsx("path",{d:"M18 6 6 18"}),Ag.jsx("path",{d:"m6 6 12 12"})]}),Rms=(e)=>Ag.jsxs(H_e,{...e,children:[Ag.jsx("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"}),Ag.jsx("rect",{x:"8",y:"8",width:"8",height:"8",rx:"1"}),Ag.jsx("path",{d:"M7 2v2M12 2v2M17 2v2M7 20v2M12 20v2M17 20v2M2 7h2M2 12h2M2 17h2M20 7h2M20 12h2M20 17h2"})]}),Qms=(e)=>Ag.jsxs(H_e,{...e,children:[Ag.jsx("path",{d:"M15 6a9 9 0 0 0-9 9V3"}),Ag.jsx("circle",{cx:"18",cy:"6",r:"3"}),Ag.jsx("circle",{cx:"6",cy:"18",r:"3"})]}),kms=(e)=>Ag.jsxs(H_e,{...e,children:[Ag.jsx("path",{d:"M20 4v7a4 4 0 0 1-4 4H4"}),Ag.jsx("path",{d:"m9 10-5 5 5 5"})]}),Lms=({text:e,query:t})=>{let n=t.trim().toLocaleLowerCase();if(!n)return e;let o=e.toLocaleLowerCase(),r=[],i=0,s=o.indexOf(n);while(s!==-1){if(s>i)r.push(e.slice(i,s));r.push(ch.jsx("strong",{style:{fontWeight:700},children:e.slice(s,s+n.length)},`${s}-${i}`)),i=s+n.length,s=o.indexOf(n,i)}if(i<e.length)r.push(e.slice(i));if(r.length>0)return r;return e},Hms=()=>{if(typeof navigator>"u")return"Ctrl F";if(/mac/i.test(navigator.platform))return"⌘ F";return"Ctrl F"},Fms=({query:e,onQueryChange:t,onCancel:n,results:o,onSelect:r,viewerContainerRef:i})=>{let[s,a]=_8.useState(!1),[c,l]=_8.useState(null),[h,d]=_8.useState(null),u=_8.useRef(null),_=_8.useRef(null),p=Hms();_8.useEffect(()=>{l((P)=>{if(o.some((M)=>M.target.id===P))return P;return o.find((M)=>M.kind==="component")?.target.id??o[0]?.target.id??null})},[o]),_8.useEffect(()=>{if(!c)return;_.current?.querySelector(`[data-search-result-id="${c}"]`)?.scrollIntoView({behavior:"smooth",block:"nearest"})},[c]),_8.useEffect(()=>{let P=(B)=>{if(B.key==="Escape"&&s){B.preventDefault(),B.stopPropagation(),B.stopImmediatePropagation(),n(),a(!1),u.current?.blur();return}if(B.code!=="KeyF"&&B.key.toLocaleLowerCase()!=="f")return;if(!B.metaKey&&!B.ctrlKey)return;if(!i.current?.matches(":hover"))return;B.preventDefault(),B.stopPropagation(),B.stopImmediatePropagation(),a(!0),requestAnimationFrame(()=>{u.current?.focus(),u.current?.select()})},M=[window];try{if(window.parent!==window&&window.parent.document)M.push(window.parent)}catch{}return M.forEach((B)=>B.addEventListener("keydown",P,{capture:!0})),()=>{M.forEach((B)=>B.removeEventListener("keydown",P,{capture:!0}))}},[s,n,i]);let m=()=>{n(),a(!1),u.current?.blur()},A=(P)=>{if(a(!0),P)requestAnimationFrame(()=>u.current?.focus())},g=o.filter((P)=>P.kind==="component"),f=o.filter((P)=>P.kind==="net"),y=[...g,...f],x=y.find((P)=>P.target.id===c)??y[0],C=o.length===1?"1 result":`${o.length} results`,b="none";if(e)b="1px solid #e8e8e8";let I=(P)=>{if(P.key==="Enter"&&P.target instanceof Element&&P.target.closest('[aria-label="Clear search"]'))return;if(P.key==="Escape"){P.preventDefault(),m();return}if(y.length>0&&(P.key==="ArrowDown"||P.key==="ArrowUp")){P.preventDefault();let M=-1;if(P.key==="ArrowDown")M=1;l((B)=>{let T=y.findIndex((L)=>L.target.id===B),N=T;if(T===-1){if(N=0,M===1)N=-1}let D=(N+M+y.length)%y.length;return y[D]?.target.id??null});return}if(P.key==="Enter"&&x)P.preventDefault(),r(x)},v=(P,M)=>{if(M.length===0)return null;return ch.jsxs("section",{children:[ch.jsx("div",{style:{padding:"6px 12px 3px",backgroundColor:"#f7f7f8",color:"#777777",fontSize:"11px",fontWeight:600,letterSpacing:"0.02em",textTransform:"lowercase"},children:P}),M.map((B)=>{let T=B.target.id===x?.target.id,N=B.target.id===h,D="#ffffff";if(N||T)D="#f1f3f5";let L=ch.jsx(Qms,{size:15,strokeWidth:1.8});if(B.kind==="component")L=ch.jsx(Rms,{size:15,strokeWidth:1.8});let H=()=>{u.current?.blur(),l(B.target.id),r(B)};return ch.jsxs("button",{type:"button","data-search-result-id":B.target.id,onPointerUp:(V)=>{if(V.button===0)H()},onClick:(V)=>{if(V.detail===0)H()},onMouseEnter:()=>d(B.target.id),onMouseLeave:()=>d(null),style:{width:"100%",display:"flex",alignItems:"center",gap:"9px",padding:"7px 12px",border:"none",background:D,color:"#222222",cursor:"pointer",textAlign:"left"},children:[ch.jsx("span",{style:{width:"26px",height:"26px",flexShrink:0,display:"grid",placeItems:"center",border:"1px solid #e5e5e5",borderRadius:"6px",backgroundColor:"#f7f7f7",color:"#666666"},children:L}),ch.jsxs("span",{style:{minWidth:0,flex:1},children:[ch.jsx("span",{style:{display:"block",overflow:"hidden",fontSize:"13px",fontWeight:400,lineHeight:1.25,textOverflow:"ellipsis",whiteSpace:"nowrap"},children:ch.jsx(Lms,{text:B.label,query:e})}),B.detail&&ch.jsx("span",{style:{display:"block",overflow:"hidden",marginTop:"2px",color:"#777777",fontSize:"11px",lineHeight:1.2,textOverflow:"ellipsis",whiteSpace:"nowrap"},children:B.detail}),B.schematicSheetName&&ch.jsxs("span",{style:{display:"block",overflow:"hidden",marginTop:"2px",color:"#777777",fontSize:"11px",lineHeight:1.2,textOverflow:"ellipsis",whiteSpace:"nowrap"},children:["Sheet: ",B.schematicSheetName]})]}),T&&ch.jsx("span",{title:"Press Enter to open",style:{flexShrink:0,color:"#666666",fontSize:"17px",lineHeight:1},children:ch.jsx(kms,{size:14,strokeWidth:1.8})})]},B.target.id)})]})};return ch.jsx("div",{"data-schematic-search":!0,onPointerDown:(P)=>P.stopPropagation(),onMouseDown:(P)=>P.stopPropagation(),onTouchStart:(P)=>P.stopPropagation(),onTouchEnd:(P)=>P.stopPropagation(),style:{position:"relative",zIndex:lI.schematicSearch,fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif'},children:!s?ch.jsx("button",{type:"button",title:"Search schematic","aria-label":"Search schematic",onPointerDown:(P)=>{if(P.stopPropagation(),P.pointerType!=="mouse")A(!1)},onPointerUp:(P)=>{if(P.pointerType==="mouse"&&P.button===0)A(!0)},onClick:(P)=>{if(P.detail===0)A(!0)},style:{width:"32px",height:"32px",display:"grid",placeItems:"center",padding:0,border:"none",borderRadius:"4px",backgroundColor:"#ffffff",color:"#000000",cursor:"pointer",boxShadow:"0 2px 4px rgba(0,0,0,0.1)"},children:ch.jsx(Uyo,{size:16,strokeWidth:2})}):ch.jsxs("div",{onKeyDown:I,style:{width:"min(280px, calc(100vw - 32px))",overflow:"hidden",border:"none",borderRadius:"4px",backgroundColor:"#ffffff",boxShadow:"0 2px 4px rgba(0,0,0,0.1)"},children:[ch.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",height:"32px",boxSizing:"border-box",padding:"0 12px",borderBottom:b},children:[ch.jsx(Uyo,{size:15,strokeWidth:2}),ch.jsx("input",{ref:u,value:e,"aria-label":"Search components and nets",placeholder:"Search...",onPointerUp:(P)=>P.currentTarget.focus(),onChange:(P)=>t(P.target.value),style:{minWidth:0,flex:1,border:"none",outline:"none",fontSize:"13px",color:"#222222",background:"transparent"}}),e&&o.length>0?ch.jsx("span",{style:{flexShrink:0,color:"#888888",fontSize:"12px",whiteSpace:"nowrap"},children:C}):ch.jsx("kbd",{style:{flexShrink:0,padding:"2px 5px",border:"1px solid #dddddd",borderRadius:"4px",backgroundColor:"#f7f7f7",color:"#777777",fontFamily:"inherit",fontSize:"10px",lineHeight:1.2},children:p}),s&&ch.jsx("button",{type:"button","aria-label":"Clear search",onPointerUp:(P)=>{if(P.button===0)m()},onClick:(P)=>{if(P.detail===0)m()},style:{border:"none",background:"transparent",color:"#777777",cursor:"pointer",width:"20px",height:"20px",display:"grid",placeItems:"center",padding:0,lineHeight:1},children:ch.jsx(Nms,{size:16,strokeWidth:2})})]}),e&&ch.jsx("div",{ref:_,style:{maxHeight:"240px",overflowX:"hidden",overflowY:"auto",overscrollBehavior:"contain",scrollBehavior:"smooth",touchAction:"pan-y",WebkitOverflowScrolling:"touch"},onWheel:(P)=>P.stopPropagation(),onTouchMove:(P)=>P.stopPropagation(),children:o.length===0?ch.jsx("div",{style:{padding:"12px",color:"#777777",fontSize:"13px"},children:"No matching components or nets"}):ch.jsxs(ch.Fragment,{children:[v("components",g),v("nets",f)]})})]})})},b2t='system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',zms={backgroundColor:"#ffffff",color:"#111111",borderRadius:8,boxShadow:"0 6px 24px rgba(0,0,0,0.12), 0 1px 3px rgba(0,0,0,0.08)",border:"1px solid #e5e7eb",padding:4,minWidth:200,maxWidth:320,maxHeight:320,overflowY:"auto",fontSize:13,fontFamily:b2t,outline:"none",zIndex:lI.viewMenu},Oms={display:"flex",alignItems:"center",gap:8,padding:"7px 10px 7px 8px",borderRadius:6,cursor:"pointer",outline:"none",userSelect:"none",color:"#111111",fontSize:13,fontFamily:b2t},Vms={width:16,height:16,flexShrink:0,display:"inline-flex",alignItems:"center",justifyContent:"center",color:"#111111"},Wyo={overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},Yms=`
.sv-sheet-item[data-highlighted], .sv-sheet-item:hover { background-color: #f1f3f5; }
.sv-sheet-chevron { transition: transform 0.2s ease; }
[data-state="open"] > .sv-sheet-chevron { transform: rotate(180deg); }
`,Gms=()=>Am.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:Am.jsx("path",{d:"M20 6 9 17l-5-5"})}),Ums=({className:e})=>Am.jsx("svg",{className:e,width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{opacity:0.6,flexShrink:0},"aria-hidden":"true",children:Am.jsx("path",{d:"m6 9 6 6 6-6"})}),Wms=({sheets:e,selectedSheetId:t,onSelectSheet:n})=>{let[o,r]=exo.useState(!1);if(e.length<=1)return null;let s=e.find((a)=>a.schematic_sheet_id===t)?.name??"Select sheet";return Am.jsxs(Am.Fragment,{children:[Am.jsx("style",{children:Yms}),Am.jsxs(ZDe,{open:o,onOpenChange:r,modal:!1,children:[Am.jsx(eNe,{asChild:!0,children:Am.jsxs("button",{type:"button",title:s,onPointerDown:(a)=>a.stopPropagation(),style:{display:"flex",alignItems:"center",gap:"6px",maxWidth:"220px",height:"32px",boxSizing:"border-box",padding:"0 12px",backgroundColor:"#ffffff",color:"#000000",border:"none",outline:"none",borderRadius:"4px",cursor:"pointer",boxShadow:"0 2px 4px rgba(0,0,0,0.1)",fontSize:"13px",fontFamily:b2t},children:[Am.jsx("span",{style:{color:"#888888",flexShrink:0},children:"Sheet:"}),Am.jsx("span",{style:{...Wyo,minWidth:0},children:s}),Am.jsx(Ums,{className:"sv-sheet-chevron"})]})}),Am.jsx(N_e,{children:Am.jsx(tNe,{style:zms,side:"bottom",align:"start",sideOffset:8,collisionPadding:10,children:e.map((a)=>{let c=a.schematic_sheet_id===t;return Am.jsxs(lD,{className:"sv-sheet-item",style:Oms,title:a.name,onSelect:(l)=>l.preventDefault(),onPointerUp:()=>{n(a.schematic_sheet_id),r(!1)},children:[Am.jsx("span",{style:Vms,children:c&&Am.jsx(Gms,{})}),Am.jsx("span",{style:{...Wyo,minWidth:0},children:a.name})]},a.schematic_sheet_id)})})})]})]})},Xms=({count:e,showWarnings:t,onToggle:n})=>{let o=`${t?"Hide":"Show"} ${e} ${e===1?"warning":"warnings"}`;return qU.jsxs("button",{type:"button","data-schematic-warnings":!0,title:o,"aria-label":o,"aria-pressed":t,onClick:n,onPointerDown:(r)=>r.stopPropagation(),onMouseDown:(r)=>r.stopPropagation(),onTouchStart:(r)=>r.stopPropagation(),onTouchEnd:(r)=>r.stopPropagation(),style:{height:"32px",display:"flex",alignItems:"center",gap:"4px",padding:"0 8px",border:"none",borderRadius:"4px",backgroundColor:t?"#fff3cd":"#ffffff",color:"#946200",cursor:"pointer",boxShadow:"0 2px 4px rgba(0,0,0,0.1)",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',fontSize:"12px",fontWeight:600},children:[qU.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[qU.jsx("path",{d:"M10.3 3.9 1.8 18.1A2 2 0 0 0 3.5 21h17a2 2 0 0 0 1.7-2.9L13.7 3.9a2 2 0 0 0-3.4 0Z"}),qU.jsx("path",{d:"M12 9v4m0 4h.01"})]}),qU.jsx("span",{children:e})]})},jms={name:"@tscircuit/schematic-viewer",version:"2.0.104",repository:{type:"git",url:"https://github.com/tscircuit/schematic-viewer"},main:"dist/index.js",exports:{".":{types:"./dist/index.d.ts",default:"./dist/index.js"}},type:"module",scripts:{start:"cosmos",build:"tsup-node ./lib/index.ts --dts --format esm --sourcemap","build:site":"cosmos-export","test:package":"bun run build && bun run scripts/test-package.ts","vercel-build":"bun run build:site",format:"biome format --write .","format:check":"biome format ."},files:["dist"],devDependencies:{"@biomejs/biome":"^1.9.4","@types/bun":"latest","@types/debug":"^4.1.12","@types/jsdom":"^21.1.7","@types/react":"^19.0.1","@types/react-dom":"^19.0.2","@vitejs/plugin-react":"^4.3.4",jsdom:"^26.0.0",react:"^19.1.0","react-cosmos":"^6.2.1","react-cosmos-plugin-vite":"^6.2.0","react-dom":"^19.1.0","react-reconciler":"^0.31.0",semver:"^7.7.2",tscircuit:"^0.0.2460",tsup:"^8.3.5",vite:"^6.0.3","@tscircuit/circuit-json-schematic-placement-analysis":"https://jscdn.tscircuit.com/@tscircuit/circuit-json-schematic-placement-analysis/0.0.46.tgz"},peerDependencies:{typescript:"^5.0.0",tscircuit:"*"},dependencies:{"@radix-ui/react-dialog":"^1.1.23","@radix-ui/react-dropdown-menu":"^2.1.16","@tscircuit/circuit-json-util":"^0.0.108","@tscircuit/internal-dynamic-import":"^0.0.17","@tscircuit/props":"^0.0.697","@tscircuit/soup-util":"^0.0.41","circuit-json":"^0.0.479","circuit-to-svg":"^0.0.432",debug:"^4.4.0","performance-now":"^2.1.0","transformation-matrix":"^2.16.1","use-mouse-matrix-transform":"^1.2.2"}},I2t='system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',Xyo={backgroundColor:"#262626",color:"#fafafa",borderRadius:6,boxShadow:"0px 12px 48px -12px rgba(0, 0, 0, 0.5), 0px 8px 24px -8px rgba(0, 0, 0, 0.3)",border:"1px solid #333333",padding:4,minWidth:208,fontSize:14,fontWeight:400,fontFamily:I2t,outline:"none",zIndex:lI.contextMenu},VH={display:"flex",alignItems:"center",gap:8,padding:"6px 8px",borderRadius:6,cursor:"default",outline:"none",userSelect:"none",color:"#fafafa",fontSize:14,fontWeight:400,fontFamily:I2t},uoe={width:16,height:16,flexShrink:0,display:"inline-flex",alignItems:"center",justifyContent:"center",color:"#fafafa"},jyo={height:1,backgroundColor:"#ffffff1a",margin:"4px 0"},Kms=`
.sv-vm-item[data-highlighted]:not([data-disabled]),
.sv-vm-item:hover:not([data-disabled]) { background-color: #404040; }
.sv-vm-item[data-disabled] { opacity: 0.45; cursor: not-allowed; }
`,rNe=()=>Gs.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:Gs.jsx("path",{d:"M20 6 9 17l-5-5"})}),$ms=({isComponentMenu:e=!1,pcbComponent:t,onViewPcbComponent:n,netLocations:o=[],onSelectNetLocation:r,circuitJson:i,circuitJsonKey:s,menuRef:a,menuPos:c,onOpenChange:l,onRunStyleAnalysis:h,showGroups:d,onToggleGroups:u,showGrid:_,onToggleGrid:p,showPorts:m,onTogglePorts:A,showWarnings:g,onToggleWarnings:f})=>{let y=f2t.useMemo(()=>{if(!i||i.length===0)return!1;try{if((WA(i).source_group?.list()||[]).length>0)return!0;let b=WA(i).schematic_component?.list()||[];if(b.length>1){let I=new Set;for(let v of b){let P=WA(i).source_component.get(v.source_component_id);if(P?.ftype)I.add(P.ftype)}return I.size>1}return!1}catch(C){return console.error("Error checking for groups:",C),!1}},[s]),x=f2t.useMemo(()=>{if(!i||i.length===0)return!1;try{return(WA(i).schematic_port?.list()||[]).length>0}catch(C){return console.error("Error checking for schematic ports:",C),!1}},[s]);if(e&&(!t||!n))return null;return Gs.jsx("div",{ref:a,style:{position:"fixed",left:c.x,top:c.y,width:0,height:0},children:Gs.jsxs(ZDe,{open:!0,onOpenChange:l,modal:!1,children:[Gs.jsx(eNe,{asChild:!0,children:Gs.jsx("div",{style:{position:"absolute",width:1,height:1}})}),Gs.jsx(N_e,{children:Gs.jsxs(tNe,{style:Xyo,align:"start",sideOffset:0,collisionPadding:10,avoidCollisions:!0,children:[Gs.jsx("style",{children:Kms}),t&&n&&Gs.jsx(Gs.Fragment,{children:Gs.jsxs(lD,{className:"sv-vm-item",style:VH,onSelect:()=>{l(!1),n(t)},children:[Gs.jsx("span",{style:uoe,children:"↗"}),Gs.jsx("span",{children:"Show on PCB"})]})}),!e&&o.length>0&&Gs.jsxs(Nyo,{children:[Gs.jsxs(Ryo,{className:"sv-vm-item",style:VH,children:["Net Locations ",Gs.jsx("span",{style:{marginLeft:"auto"},children:"›"})]}),Gs.jsx(N_e,{children:Gs.jsx(Qyo,{style:{...Xyo,maxHeight:"min(400px, var(--radix-dropdown-menu-content-available-height))",overflowY:"auto"},collisionPadding:10,children:o.map((C,b)=>Gs.jsx(lD,{className:"sv-vm-item",style:VH,onSelect:()=>r?.(C),children:C.label},b))})})]}),!e&&Gs.jsxs(Gs.Fragment,{children:[Gs.jsxs(lD,{className:"sv-vm-item",style:VH,disabled:!x,title:x?void 0:"No ports found in this schematic",onSelect:(C)=>C.preventDefault(),onPointerDown:(C)=>{if(C.preventDefault(),x)A(!m)},children:[Gs.jsx("span",{style:uoe,children:m&&Gs.jsx(rNe,{})}),Gs.jsx("span",{children:"Show Schematic Ports"})]}),Gs.jsxs(lD,{className:"sv-vm-item",style:VH,disabled:!y,title:y?void 0:"No groups found in this schematic",onSelect:(C)=>C.preventDefault(),onPointerDown:(C)=>{if(C.preventDefault(),y)u(!d)},children:[Gs.jsx("span",{style:uoe,children:d&&Gs.jsx(rNe,{})}),Gs.jsx("span",{children:"View Schematic Groups"})]}),Gs.jsxs(lD,{className:"sv-vm-item",style:VH,onSelect:(C)=>C.preventDefault(),onPointerDown:(C)=>{C.preventDefault(),p(!_)},children:[Gs.jsx("span",{style:uoe,children:_&&Gs.jsx(rNe,{})}),Gs.jsx("span",{children:"Show Grid"})]}),Gs.jsxs(Tyo,{className:"sv-vm-item",style:VH,checked:g,onCheckedChange:f,onSelect:(C)=>C.preventDefault(),children:[Gs.jsx("span",{style:uoe,children:Gs.jsx(Dyo,{children:Gs.jsx(rNe,{})})}),Gs.jsx("span",{children:"Show Warnings"})]}),Gs.jsx(d2t,{style:jyo}),Gs.jsxs(lD,{className:"sv-vm-item",style:VH,onSelect:h,children:[Gs.jsx("span",{style:uoe}),Gs.jsx("span",{children:"Run Style Analysis"})]}),Gs.jsx(d2t,{style:jyo}),Gs.jsxs("div",{style:{padding:"4px 8px 4px 32px",fontSize:11,opacity:0.35,color:"#a1a1aa",letterSpacing:"0.2px",fontFamily:I2t},children:["@tscircuit/schematic-viewer@",String(jms?.version)]})]})]})})]})})},txo=({circuitJson:e,platformConfig:t,containerStyle:n,debugGrid:o=!1,debug:r=!1,clickToInteractEnabled:i=!1,colorOverrides:s,disableGroups:a=!1,netHoverHighlightEnabled:c=!0,onSchematicComponentClicked:l,showSchematicPorts:h,onSchematicPortClicked:d,onSchematicSheetChange:u,searchEnabled:_=!0,controller:p,onViewPcbComponent:m,css:A,className:g})=>{if(r)ims();let f=(ze)=>`${ze?.length||0}_${ze?.editCount||0}`,y=Fc.useMemo(()=>f(e),[e]),x=Fc.useMemo(()=>{try{return e.filter((ze)=>ze?.type==="schematic_sheet").slice().sort((ze,Xe)=>(ze.sheet_index??0)-(Xe.sheet_index??0))}catch(ze){return console.error("Failed to derive schematic sheets",ze),[]}},[y]),C=x.length>1,b=x[0]?.schematic_sheet_id,[I,v]=Fc.useState(()=>{let ze=zps(doe.SELECTED_SCHEMATIC_SHEET);if(ze&&x.some((Xe)=>Xe.schematic_sheet_id===ze))return ze;return b});Fc.useEffect(()=>{if(!(I!==void 0&&x.some((Xe)=>Xe.schematic_sheet_id===I)))v(b)},[y]);let P=C?I??b:void 0,M=Fc.useCallback((ze)=>{v(ze),Ops(doe.SELECTED_SCHEMATIC_SHEET,ze),u?.(ze)},[u]),[B,T]=Fc.useState(!1),[N,D]=Fc.useState(null),[L,H]=Fc.useState(!1),V=e.filter((ze)=>ze.type.startsWith("schematic_")&&ze.type.endsWith("_warning")).length,O=o||B,[U,j]=Fc.useState(!i),[Y,X]=Fc.useState(()=>{if(a)return!1;return Hyo(doe.IS_SHOWING_SCHEMATIC_GROUPS,!1)}),[K,J]=Fc.useState(()=>h??Hyo(doe.IS_SHOWING_SCHEMATIC_PORTS,!1));Fc.useEffect(()=>{if(h!==void 0)J(h)},[h]);let[ee,se]=Fc.useState(!1),ne=Fc.useRef(new Set),[re,Z]=Fc.useState(null),te=Fc.useCallback((ze,Xe)=>{if(Xe)ne.current.add(ze);else ne.current.delete(ze);se(ne.current.size>0)},[]),[ie,le]=Fc.useState(!1),ue=Fc.useRef(new Set),de=Fc.useCallback((ze,Xe)=>{if(Xe)ue.current.add(ze);else ue.current.delete(ze);le(ue.current.size>0)},[]),me=Fc.useRef(null),Ae=Fc.useRef(null),xe=Fc.useRef({x:1,y:1}),Me=Fc.useMemo(()=>{try{return(WA(e).schematic_component?.list()??[]).filter((Xe)=>!P||Xe.schematic_sheet_id===P).map((Xe)=>Xe.schematic_component_id)}catch(ze){return console.error("Failed to derive schematic component ids",ze),[]}},[y,e,P]),Re=Fc.useMemo(()=>{if(!K)return[];try{return(WA(e).schematic_port?.list()??[]).filter((Xe)=>!P||Xe.schematic_sheet_id===P).map((Xe)=>{let it=WA(e).source_port.get(Xe.source_port_id),kt=(it?.source_component_id?WA(e).source_component.get(it.source_component_id):null)?.name??"?",Lt=Xe.display_pin_label??it?.pin_number??it?.name??"?";return{portId:Xe.source_port_id,label:`${kt}.${Lt}`}})}catch(ze){return console.error("Failed to derive schematic port info",ze),[]}},[y,e,K,P]),we=(ze)=>{let Xe=ze.touches[0];Ae.current={x:Xe.clientX,y:Xe.clientY}},_e=(ze)=>{let Xe=ze.changedTouches[0],it=Ae.current;if(!it)return;let St=Math.abs(Xe.clientX-it.x),kt=Math.abs(Xe.clientY-it.y);if(St<10&&kt<10)ze.preventDefault(),j(!0);Ae.current=null},ye=Fc.useCallback((ze)=>{if(ze.target instanceof Element&&ze.target.closest("[data-schematic-search], [data-schematic-warnings], .schematic-warning, [data-schematic-component-details-tooltip]"))return!1;if(ze.type!=="mousedown"||!("button"in ze))return!0;return ze.button!==2&&!(ze.button===0&&ze.ctrlKey)},[]),{ref:Se,transform:Ne,setTransform:ke}=BDe({onSetTransform(ze){let Xe=ze.a!==xe.current.x||ze.d!==xe.current.y;if(xe.current={x:ze.a,y:ze.d},Xe)Z(null);if(!me.current)return;me.current.style.transform=Pf(ze)},enabled:U,shouldDrag:ye}),{menuVisible:nt,menuPos:dt,menuRef:rt,setMenuVisible:mt,contextMenuEventHandlers:lt,menuTarget:Ct}=cms({containerRef:Se}),{containerWidth:Nt,containerHeight:Ht}=sms(Se),Tt=Fc.useMemo(()=>re?gms(e,re.schematicComponentId):null,[y,e,re]),et=Fc.useMemo(()=>{if(!re||!Nt||!Ht)return null;let ze=12,Xe=14,it=Math.min(420,Nt-ze*2),St=Math.min(520,Ht-ze*2),{anchorX:kt,anchorY:Lt}=re,Wt=kt+Xe,bn=kt-it-Xe,pn=Wt+it<=Nt-ze?Wt:bn>=ze?bn:Math.max(ze,Math.min(kt-it/2,Nt-it-ze)),wn=Math.max(ze,Math.min(Lt-24,Ht-St-ze));return{left:pn,top:wn,width:it,maxHeight:St}},[re,Nt,Ht]),vt=Fc.useCallback((ze,Xe)=>{if(Xe.target instanceof Element&&Xe.target.closest("[data-schematic-component-details-tooltip]"))return;let it=Se.current?.getBoundingClientRect();if(!it)return;Z({schematicComponentId:ze,anchorX:Xe.clientX-it.left,anchorY:Xe.clientY-it.top}),l?.({schematicComponentId:ze,event:Xe})},[Se,l]);Fc.useEffect(()=>{Z(null)},[y,P]),Fc.useEffect(()=>{if(!re)return;let ze=(it)=>{if(it.key==="Escape")Z(null)},Xe=(it)=>{if(it.target instanceof Element&&it.target.closest("[data-schematic-component-details-tooltip]"))return;Z(null)};return window.addEventListener("keydown",ze),document.addEventListener("mousedown",Xe),()=>{window.removeEventListener("keydown",ze),document.removeEventListener("mousedown",Xe)}},[re]);let ht=Fc.useMemo(()=>{if(!Nt||!Ht)return"";return Q2o(e,{width:Nt,height:Ht||720,drawPorts:K,shouldDrawWarnings:L,schematicSheetId:P,grid:!O?void 0:{cellSize:1,labelCells:!0},colorOverrides:s,css:A,className:g})},[y,Nt,Ht,O,L,K,P]),We=Fc.useMemo(()=>ht.match(/<svg[^>]*style="[^"]*background-color:\s*([^;\"]+)/i)?.[1]??"transparent",[ht]),{searchQuery:Le,setSearchQuery:Ze,searchResults:$e,handleSearchResultSelect:qe,handleCancelSearch:ft}=rms({controller:p,circuitJson:e,circuitJsonKey:y,svgDivRef:me,containerRef:Se,activeSheetId:P,hasMultipleSheets:C,handleSelectSheet:M,svgString:ht,svgToScreenProjection:Ne,setSvgToScreenProjection:ke,setIsInteractionEnabled:j});Vps({svgDivRef:me,circuitJson:e,circuitJsonKey:`${y}_${P??""}`,showGroups:Y&&!a}),Gps({svgDivRef:me,circuitJson:e,circuitJsonKey:`${y}_${P??""}`,enabled:c});let It=Fc.useMemo(()=>_g.jsx("div",{ref:me,style:{pointerEvents:i?U?"auto":"none":"auto",transformOrigin:"0 0"},className:"schematic-component-clickable",dangerouslySetInnerHTML:{__html:ht}}),[ht,U,i]);return Ups({svgDivRef:me,svgContent:It,circuitJsonKey:y}),_g.jsxs(bms,{children:[c&&_g.jsx("style",{children:`.sch-net-faded { opacity: 0.35; }
            svg :is(g.trace, g.trace-overlays, g[data-schematic-component-id], [data-schematic-net-label-id]) { transition: opacity 0.12s ease-in-out; }`}),_&&_g.jsx("style",{children:`.schematic-search-match text,
            text.schematic-search-match {
              fill: #ff00d4 !important;
            }
            .schematic-search-match [stroke]:not(text):not([stroke="none"]),
            [stroke]:not(text):not([stroke="none"]).schematic-search-match {
              stroke: #ff00d4 !important;
            }
            .schematic-viewer-toolbar {
              flex-direction: row;
            }
            @media (max-width: 640px) {
              .schematic-viewer-toolbar {
                flex-direction: column;
              }
            }`}),_g.jsx("style",{children:".schematic-component-clickable [data-schematic-component-id]:hover { cursor: pointer !important; }"}),d&&_g.jsx("style",{children:"[data-schematic-port-id]:hover { cursor: pointer !important; }"}),_g.jsxs("div",{ref:Se,style:{position:"relative",backgroundColor:We,overflow:"hidden",cursor:i&&!U?"pointer":ee?"pointer":ie&&d?"pointer":"grab",minHeight:"300px",userSelect:"none",WebkitUserSelect:"none",WebkitTouchCallout:"none",...n},onMouseDownCapture:(ze)=>{if(lt.onMouseDown(ze),i&&!U){ze.preventDefault(),ze.stopPropagation();return}},onContextMenu:lt.onContextMenu,onTouchStart:(ze)=>{we(ze),lt.onTouchStart(ze)},onTouchMove:lt.onTouchMove,onTouchEnd:(ze)=>{_e(ze),lt.onTouchEnd()},onTouchCancel:lt.onTouchCancel,children:[!U&&i&&_g.jsx("div",{onClick:(ze)=>{ze.preventDefault(),ze.stopPropagation(),j(!0)},style:{position:"absolute",inset:0,cursor:"pointer",zIndex:lI.clickToInteractOverlay,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"all",touchAction:"pan-x pan-y pinch-zoom"},children:_g.jsx("div",{style:{backgroundColor:"rgba(0, 0, 0, 0.8)",color:"white",padding:"12px 24px",borderRadius:"8px",fontSize:"16px",fontFamily:"sans-serif",pointerEvents:"none"},children:typeof window<"u"&&(("ontouchstart"in window)||navigator.maxTouchPoints>0)?"Touch to Interact":"Click to Interact"})}),N&&_g.jsx(Hps,{circuitJson:N,onClose:()=>D(null)}),nt&&_g.jsx($ms,{isComponentMenu:!!qyo(Ct,e),pcbComponent:yms(Ct,e),onViewPcbComponent:m,circuitJson:e,circuitJsonKey:y,netLocations:(()=>{let ze=Qps(Ct,e);return ze?kps(e,ze):[]})(),onSelectNetLocation:(ze)=>{mt(!1),qe(ze)},menuRef:rt,menuPos:dt,onOpenChange:mt,onRunStyleAnalysis:()=>{mt(!1),D(structuredClone(e))},showPorts:K,onTogglePorts:(ze)=>{J(ze),Fyo(doe.IS_SHOWING_SCHEMATIC_PORTS,ze)},showGroups:Y,onToggleGroups:(ze)=>{if(!a)X(ze),Fyo(doe.IS_SHOWING_SCHEMATIC_GROUPS,ze)},showWarnings:L,onToggleWarnings:H,showGrid:O,onToggleGrid:T}),_g.jsxs("div",{className:"schematic-viewer-toolbar",style:{position:"absolute",top:"16px",left:"16px",display:"flex",alignItems:"flex-start",gap:"8px",zIndex:lI.schematicSearch},children:[_g.jsx(Wms,{sheets:x,selectedSheetId:P,onSelectSheet:M}),_&&_g.jsx(Fms,{query:Le,onQueryChange:Ze,onCancel:ft,results:$e,onSelect:qe,viewerContainerRef:Se}),V>0&&_g.jsx(Xms,{count:V,showWarnings:L,onToggle:()=>H((ze)=>!ze)})]}),Me.map((ze)=>_g.jsx(Bms,{componentId:ze,svgDivRef:me,containerRef:Se,showOutline:!0,circuitJsonKey:y,onHoverChange:te,onComponentClick:vt},ze)),It,Tt&&et&&_g.jsx(Mms,{platformConfig:t,sourceComponent:Tt.sourceComponent,warnings:Tt.warnings,footprinterString:Tt.footprinterString,footprintPreviewCircuitJson:Tt.footprintPreviewCircuitJson,footprintPreviewViewBox:Tt.footprintPreviewViewBox,...et}),K&&Re.map(({portId:ze,label:Xe})=>_g.jsx(Dms,{portId:ze,portLabel:Xe,svgDivRef:me,containerRef:Se,showOutline:!0,circuitJsonKey:y,onHoverChange:de,onPortClick:d?(it,St)=>{d?.({schematicPortId:it,event:St})}:void 0},ze))]})]})};var Jms='system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',P$a={backgroundColor:"#ffffff",color:"#111111",borderRadius:8,boxShadow:"0 6px 24px rgba(0,0,0,0.12), 0 1px 3px rgba(0,0,0,0.08)",border:"1px solid #e5e7eb",padding:4,minWidth:220,maxWidth:360,maxHeight:320,overflowY:"auto",fontSize:13,fontFamily:Jms,outline:"none",zIndex:lI.viewMenu};function oxo(){return{background:rl("bg"),component_body:rl("surface"),component_outline:rl("silver"),wire:rl("green"),wire_crossing:rl("olive"),junction:rl("olive"),pin:rl("silver"),pin_name:rl("text"),pin_number:rl("olive"),reference:rl("text"),value:rl("muted"),label_local:rl("text"),label_global:rl("olive"),label_hier:rl("olive"),label_background:rl("surface"),net_name:rl("green"),bus:rl("olive"),bus_junction:rl("olive"),grid:rl("surface"),grid_axes:rl("border"),fields:rl("muted"),note:rl("muted"),sheet:rl("border"),sheet_background:rl("bg"),sheet_fields:rl("muted"),sheet_filename:rl("text"),sheet_label:rl("text"),sheet_name:rl("text"),cursor:rl("green"),aux_items:rl("dim"),erc_error:rl("alert"),erc_warning:rl("olive")}}var Zms=new Set(["schematic_component_overlap_warning","schematic_component_styling_warning","schematic_element_outside_sheet_warning","schematic_manual_edit_conflict_warning"]);function e_s(e){let t=e?.type;return typeof t==="string"&&t.startsWith("schematic_")&&t.endsWith("_warning")&&!Zms.has(t)}function rxo(e){if(!Array.isArray(e))return e||[];let t=e.filter((i)=>!e_s(i));if(!t.filter((i)=>i?.type==="schematic_sheet").length)return t;let o=t.filter((i)=>i?.type==="schematic_component"),r=o.filter((i)=>!!i.schematic_sheet_id);if(o.length>0&&r.length===0)return t.filter((i)=>i?.type!=="schematic_sheet");return t}var t_s=EX();function n_s({circuitJson:e,onSelectComponent:t}){let n=g8.useRef(null),[o,r]=g8.useState({width:800,height:600}),i=g8.default.useMemo(()=>rxo(e),[e]);return g8.useEffect(()=>{let s=n.current?.parentElement||n.current;if(!s)return;let a=()=>{let l=s.clientWidth||window.innerWidth,h=s.clientHeight||window.innerHeight-52;if(l>50&&h>50)r({width:l,height:h})};a();let c=new ResizeObserver(a);return c.observe(s),window.addEventListener("resize",a),()=>{c.disconnect(),window.removeEventListener("resize",a)}},[]),g8.default.createElement("div",{ref:n,style:{width:"100%",height:"100%",position:"relative",overflow:"hidden"}},g8.default.createElement(txo,{key:`${o.width}x${o.height}`,circuitJson:i||[],containerStyle:{width:"100%",height:"100%",backgroundColor:rl("bg")},colorOverrides:{schematic:oxo()},onSchematicComponentClicked:(s)=>{let a=s?.schematicComponentId||s?.refdes;if(a&&t)t(wE(i||[],a))},onViewPcbComponent:(s)=>{let a=s?.refdes;if(a&&t)t(wE(i||[],a))}}))}function ixo(e,t,n){let o={circuitJson:t||[],onSelectComponent:n};MX(t_s,e,g8.default.createElement(n_s,o))}Ero(Mro);if(typeof window<"u")wro();function o_s({circuitJson:e,onSelectComponent:t,autoRotateDisabled:n=!0,clickToInteractEnabled:o=!1,onViewSchematicComponent:r,onCameraControllerReady:i,...s}){let a=hD.useRef(null),c=hD.useRef(null);return kBe(e||[],t),hD.useEffect(()=>{let l=a.current;if(!l||!t)return;let h=(p)=>{c.current={x:p.clientX,y:p.clientY}},d=(p,m)=>{let A=ene(l);if(!A)return;let{__threeCamera:g,__threeScene:f}=A;if(!g||!f)return;let y=A.getBoundingClientRect();if(!y.width||!y.height)return;if(p<y.left||p>y.right||m<y.top||m>y.bottom)return;let x=new ro((p-y.left)/y.width*2-1,-((m-y.top)/y.height)*2+1);g.updateWorldMatrix(!0,!1),f.updateWorldMatrix(!0,!0);let C=new Lz;C.setFromCamera(x,g);let v=C.intersectObjects(f.children,!0).filter((P)=>P.object instanceof Mo).map((P)=>Mio(e||[],P.object)).find(Boolean);if(v)t(v)},u=(p)=>{let m=c.current;if(m&&Math.hypot(p.clientX-m.x,p.clientY-m.y)>6)return;d(p.clientX,p.clientY)},_=(p)=>{d(p.clientX,p.clientY)};return l.addEventListener("pointerdown",h,!0),l.addEventListener("click",u,!0),l.addEventListener("contextmenu",_,!0),()=>{l.removeEventListener("pointerdown",h,!0),l.removeEventListener("click",u,!0),l.removeEventListener("contextmenu",_,!0)}},[e,t]),hD.default.createElement("div",{ref:a,style:{width:"100%",height:"100%",position:"relative",overflow:"hidden"}},hD.default.createElement(Xoo,{...s,circuitJson:e||[],autoRotateDisabled:n,clickToInteractEnabled:o,onViewSchematicComponent:(l)=>{let h=l?.refdes||l?.source_component_id;if(h&&t)t(wE(e||[],h));if(r)r(l)},onCameraControllerReady:(l)=>{if(window.cadCameraController=l??void 0,i)i(l)}}))}var r_s=EX();function i_s(e,t,n){let o={circuitJson:t||[],onSelectComponent:n};MX(r_s,e,hD.default.createElement(o_s,o))}var sxo={render3dViewer:i_s,renderPcbViewer:B0o,renderSchematicViewer:ixo,animateCadCameraPreset:Nro,...Eio,...$ro};if(typeof window<"u")window.Tscircuit=sxo,window.dispatchEvent(new CustomEvent("tscircuit-ready"));var q$a=sxo;export{o_s as CadViewer,sxo as Tscircuit,q$a as default,i_s as render3dViewer};